aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig736
-rw-r--r--arch/arm/Kconfig.debug109
-rw-r--r--arch/arm/Makefile216
-rw-r--r--arch/arm/boot/Makefile91
-rw-r--r--arch/arm/boot/bootp/Makefile24
-rw-r--r--arch/arm/boot/bootp/bootp.lds30
-rw-r--r--arch/arm/boot/bootp/init.S86
-rw-r--r--arch/arm/boot/bootp/initrd.S6
-rw-r--r--arch/arm/boot/bootp/kernel.S6
-rw-r--r--arch/arm/boot/compressed/Makefile114
-rw-r--r--arch/arm/boot/compressed/Makefile.debug23
-rw-r--r--arch/arm/boot/compressed/big-endian.S13
-rw-r--r--arch/arm/boot/compressed/head-clps7500.S87
-rw-r--r--arch/arm/boot/compressed/head-epxa10db.S5
-rw-r--r--arch/arm/boot/compressed/head-l7200.S30
-rw-r--r--arch/arm/boot/compressed/head-sa1100.S48
-rw-r--r--arch/arm/boot/compressed/head-shark.S115
-rw-r--r--arch/arm/boot/compressed/head-sharpsl.S92
-rw-r--r--arch/arm/boot/compressed/head-xscale.S49
-rw-r--r--arch/arm/boot/compressed/head.S786
-rw-r--r--arch/arm/boot/compressed/ice-dcc.S17
-rw-r--r--arch/arm/boot/compressed/ll_char_wr.S134
-rw-r--r--arch/arm/boot/compressed/misc.c329
-rw-r--r--arch/arm/boot/compressed/ofw-shark.c260
-rw-r--r--arch/arm/boot/compressed/piggy.S6
-rw-r--r--arch/arm/boot/compressed/vmlinux.lds.in55
-rw-r--r--arch/arm/boot/install.sh52
-rw-r--r--arch/arm/common/Kconfig24
-rw-r--r--arch/arm/common/Makefile15
-rw-r--r--arch/arm/common/amba.c357
-rw-r--r--arch/arm/common/dmabounce.c682
-rw-r--r--arch/arm/common/icst307.c161
-rw-r--r--arch/arm/common/icst525.c160
-rw-r--r--arch/arm/common/locomo.c1058
-rw-r--r--arch/arm/common/rtctime.c506
-rw-r--r--arch/arm/common/sa1111.c1292
-rw-r--r--arch/arm/common/scoop.c176
-rw-r--r--arch/arm/common/sharpsl_param.c60
-rw-r--r--arch/arm/common/time-acorn.c96
-rw-r--r--arch/arm/common/via82c505.c94
-rw-r--r--arch/arm/configs/assabet_defconfig906
-rw-r--r--arch/arm/configs/badge4_defconfig1240
-rw-r--r--arch/arm/configs/bast_defconfig952
-rw-r--r--arch/arm/configs/cerfcube_defconfig905
-rw-r--r--arch/arm/configs/clps7500_defconfig803
-rw-r--r--arch/arm/configs/ebsa110_defconfig749
-rw-r--r--arch/arm/configs/edb7211_defconfig575
-rw-r--r--arch/arm/configs/enp2611_defconfig887
-rw-r--r--arch/arm/configs/ep80219_defconfig952
-rw-r--r--arch/arm/configs/epxa10db_defconfig644
-rw-r--r--arch/arm/configs/footbridge_defconfig1257
-rw-r--r--arch/arm/configs/fortunet_defconfig558
-rw-r--r--arch/arm/configs/h3600_defconfig913
-rw-r--r--arch/arm/configs/h7201_defconfig567
-rw-r--r--arch/arm/configs/h7202_defconfig732
-rw-r--r--arch/arm/configs/hackkit_defconfig768
-rw-r--r--arch/arm/configs/integrator_defconfig864
-rw-r--r--arch/arm/configs/iq31244_defconfig922
-rw-r--r--arch/arm/configs/iq80321_defconfig843
-rw-r--r--arch/arm/configs/iq80331_defconfig916
-rw-r--r--arch/arm/configs/iq80332_defconfig916
-rw-r--r--arch/arm/configs/ixdp2400_defconfig888
-rw-r--r--arch/arm/configs/ixdp2401_defconfig889
-rw-r--r--arch/arm/configs/ixdp2800_defconfig888
-rw-r--r--arch/arm/configs/ixdp2801_defconfig889
-rw-r--r--arch/arm/configs/ixp4xx_defconfig1164
-rw-r--r--arch/arm/configs/jornada720_defconfig919
-rw-r--r--arch/arm/configs/lart_defconfig877
-rw-r--r--arch/arm/configs/lpd7a400_defconfig781
-rw-r--r--arch/arm/configs/lpd7a404_defconfig919
-rw-r--r--arch/arm/configs/lubbock_defconfig803
-rw-r--r--arch/arm/configs/lusl7200_defconfig455
-rw-r--r--arch/arm/configs/mainstone_defconfig797
-rw-r--r--arch/arm/configs/mx1ads_defconfig745
-rw-r--r--arch/arm/configs/neponset_defconfig1145
-rw-r--r--arch/arm/configs/netwinder_defconfig1046
-rw-r--r--arch/arm/configs/omap_h2_1610_defconfig971
-rw-r--r--arch/arm/configs/omnimeter_defconfig803
-rw-r--r--arch/arm/configs/pleb_defconfig749
-rw-r--r--arch/arm/configs/pxa255-idp_defconfig799
-rw-r--r--arch/arm/configs/rpc_defconfig939
-rw-r--r--arch/arm/configs/s3c2410_defconfig954
-rw-r--r--arch/arm/configs/shannon_defconfig872
-rw-r--r--arch/arm/configs/shark_defconfig974
-rw-r--r--arch/arm/configs/simpad_defconfig964
-rw-r--r--arch/arm/configs/smdk2410_defconfig736
-rw-r--r--arch/arm/configs/versatile_defconfig902
-rw-r--r--arch/arm/kernel/Makefile38
-rw-r--r--arch/arm/kernel/apm.c610
-rw-r--r--arch/arm/kernel/arch.c46
-rw-r--r--arch/arm/kernel/armksyms.c175
-rw-r--r--arch/arm/kernel/arthur.c91
-rw-r--r--arch/arm/kernel/asm-offsets.c83
-rw-r--r--arch/arm/kernel/bios32.c699
-rw-r--r--arch/arm/kernel/calls.S335
-rw-r--r--arch/arm/kernel/compat.c225
-rw-r--r--arch/arm/kernel/debug.S106
-rw-r--r--arch/arm/kernel/dma-isa.c207
-rw-r--r--arch/arm/kernel/dma.c302
-rw-r--r--arch/arm/kernel/ecard.c1210
-rw-r--r--arch/arm/kernel/entry-armv.S745
-rw-r--r--arch/arm/kernel/entry-common.S260
-rw-r--r--arch/arm/kernel/entry-header.S182
-rw-r--r--arch/arm/kernel/fiq.c181
-rw-r--r--arch/arm/kernel/head.S516
-rw-r--r--arch/arm/kernel/init_task.c44
-rw-r--r--arch/arm/kernel/io.c51
-rw-r--r--arch/arm/kernel/irq.c1038
-rw-r--r--arch/arm/kernel/isa.c53
-rw-r--r--arch/arm/kernel/iwmmxt.S320
-rw-r--r--arch/arm/kernel/module.c152
-rw-r--r--arch/arm/kernel/process.c460
-rw-r--r--arch/arm/kernel/ptrace.c861
-rw-r--r--arch/arm/kernel/ptrace.h12
-rw-r--r--arch/arm/kernel/semaphore.c220
-rw-r--r--arch/arm/kernel/setup.c875
-rw-r--r--arch/arm/kernel/signal.c748
-rw-r--r--arch/arm/kernel/smp.c396
-rw-r--r--arch/arm/kernel/sys_arm.c332
-rw-r--r--arch/arm/kernel/time.c402
-rw-r--r--arch/arm/kernel/traps.c590
-rw-r--r--arch/arm/kernel/vmlinux.lds.S166
-rw-r--r--arch/arm/lib/Makefile29
-rw-r--r--arch/arm/lib/ashldi3.c61
-rw-r--r--arch/arm/lib/ashrdi3.c61
-rw-r--r--arch/arm/lib/backtrace.S157
-rw-r--r--arch/arm/lib/changebit.S28
-rw-r--r--arch/arm/lib/clearbit.S31
-rw-r--r--arch/arm/lib/copy_page.S46
-rw-r--r--arch/arm/lib/csumipv6.S32
-rw-r--r--arch/arm/lib/csumpartial.S137
-rw-r--r--arch/arm/lib/csumpartialcopy.S52
-rw-r--r--arch/arm/lib/csumpartialcopygeneric.S331
-rw-r--r--arch/arm/lib/csumpartialcopyuser.S104
-rw-r--r--arch/arm/lib/delay.S58
-rw-r--r--arch/arm/lib/div64.S200
-rw-r--r--arch/arm/lib/ecard.S45
-rw-r--r--arch/arm/lib/findbit.S168
-rw-r--r--arch/arm/lib/floppydma.S32
-rw-r--r--arch/arm/lib/gcclib.h25
-rw-r--r--arch/arm/lib/getuser.S78
-rw-r--r--arch/arm/lib/io-acorn.S32
-rw-r--r--arch/arm/lib/io-readsb.S122
-rw-r--r--arch/arm/lib/io-readsl.S78
-rw-r--r--arch/arm/lib/io-readsw-armv3.S107
-rw-r--r--arch/arm/lib/io-readsw-armv4.S130
-rw-r--r--arch/arm/lib/io-shark.c83
-rw-r--r--arch/arm/lib/io-writesb.S92
-rw-r--r--arch/arm/lib/io-writesl.S66
-rw-r--r--arch/arm/lib/io-writesw-armv3.S127
-rw-r--r--arch/arm/lib/io-writesw-armv4.S95
-rw-r--r--arch/arm/lib/lib1funcs.S314
-rw-r--r--arch/arm/lib/longlong.h183
-rw-r--r--arch/arm/lib/lshrdi3.c61
-rw-r--r--arch/arm/lib/memchr.S25
-rw-r--r--arch/arm/lib/memcpy.S393
-rw-r--r--arch/arm/lib/memset.S80
-rw-r--r--arch/arm/lib/memzero.S80
-rw-r--r--arch/arm/lib/muldi3.c77
-rw-r--r--arch/arm/lib/putuser.S76
-rw-r--r--arch/arm/lib/setbit.S29
-rw-r--r--arch/arm/lib/strchr.S26
-rw-r--r--arch/arm/lib/strncpy_from_user.S43
-rw-r--r--arch/arm/lib/strnlen_user.S40
-rw-r--r--arch/arm/lib/strrchr.S25
-rw-r--r--arch/arm/lib/testchangebit.S29
-rw-r--r--arch/arm/lib/testclearbit.S29
-rw-r--r--arch/arm/lib/testsetbit.S29
-rw-r--r--arch/arm/lib/uaccess.S697
-rw-r--r--arch/arm/lib/ucmpdi2.c51
-rw-r--r--arch/arm/lib/udivdi3.c242
-rw-r--r--arch/arm/mach-clps711x/Kconfig71
-rw-r--r--arch/arm/mach-clps711x/Makefile20
-rw-r--r--arch/arm/mach-clps711x/Makefile.boot7
-rw-r--r--arch/arm/mach-clps711x/autcpu12.c69
-rw-r--r--arch/arm/mach-clps711x/cdb89712.c58
-rw-r--r--arch/arm/mach-clps711x/ceiva.c62
-rw-r--r--arch/arm/mach-clps711x/clep7312.c48
-rw-r--r--arch/arm/mach-clps711x/common.h11
-rw-r--r--arch/arm/mach-clps711x/dma.c27
-rw-r--r--arch/arm/mach-clps711x/edb7211-arch.c61
-rw-r--r--arch/arm/mach-clps711x/edb7211-mm.c70
-rw-r--r--arch/arm/mach-clps711x/fortunet.c85
-rw-r--r--arch/arm/mach-clps711x/irq.c143
-rw-r--r--arch/arm/mach-clps711x/mm.c43
-rw-r--r--arch/arm/mach-clps711x/p720t-leds.c67
-rw-r--r--arch/arm/mach-clps711x/p720t.c115
-rw-r--r--arch/arm/mach-clps711x/time.c85
-rw-r--r--arch/arm/mach-clps7500/Makefile11
-rw-r--r--arch/arm/mach-clps7500/Makefile.boot2
-rw-r--r--arch/arm/mach-clps7500/core.c374
-rw-r--r--arch/arm/mach-ebsa110/Makefile12
-rw-r--r--arch/arm/mach-ebsa110/Makefile.boot4
-rw-r--r--arch/arm/mach-ebsa110/core.c245
-rw-r--r--arch/arm/mach-ebsa110/io.c378
-rw-r--r--arch/arm/mach-ebsa110/leds.c51
-rw-r--r--arch/arm/mach-epxa10db/Kconfig23
-rw-r--r--arch/arm/mach-epxa10db/Makefile11
-rw-r--r--arch/arm/mach-epxa10db/Makefile.boot2
-rw-r--r--arch/arm/mach-epxa10db/arch.c72
-rw-r--r--arch/arm/mach-epxa10db/dma.c28
-rw-r--r--arch/arm/mach-epxa10db/irq.c82
-rw-r--r--arch/arm/mach-epxa10db/mm.c45
-rw-r--r--arch/arm/mach-epxa10db/time.c78
-rw-r--r--arch/arm/mach-footbridge/Kconfig80
-rw-r--r--arch/arm/mach-footbridge/Makefile30
-rw-r--r--arch/arm/mach-footbridge/Makefile.boot4
-rw-r--r--arch/arm/mach-footbridge/cats-hw.c95
-rw-r--r--arch/arm/mach-footbridge/cats-pci.c55
-rw-r--r--arch/arm/mach-footbridge/co285.c38
-rw-r--r--arch/arm/mach-footbridge/common.c205
-rw-r--r--arch/arm/mach-footbridge/common.h9
-rw-r--r--arch/arm/mach-footbridge/dc21285-timer.c68
-rw-r--r--arch/arm/mach-footbridge/dc21285.c384
-rw-r--r--arch/arm/mach-footbridge/dma.c54
-rw-r--r--arch/arm/mach-footbridge/ebsa285-leds.c140
-rw-r--r--arch/arm/mach-footbridge/ebsa285-pci.c48
-rw-r--r--arch/arm/mach-footbridge/ebsa285.c24
-rw-r--r--arch/arm/mach-footbridge/isa-irq.c168
-rw-r--r--arch/arm/mach-footbridge/isa-timer.c94
-rw-r--r--arch/arm/mach-footbridge/isa.c48
-rw-r--r--arch/arm/mach-footbridge/netwinder-hw.c660
-rw-r--r--arch/arm/mach-footbridge/netwinder-leds.c141
-rw-r--r--arch/arm/mach-footbridge/netwinder-pci.c62
-rw-r--r--arch/arm/mach-footbridge/personal-pci.c56
-rw-r--r--arch/arm/mach-footbridge/personal.c23
-rw-r--r--arch/arm/mach-footbridge/time.c180
-rw-r--r--arch/arm/mach-h720x/Kconfig38
-rw-r--r--arch/arm/mach-h720x/Makefile16
-rw-r--r--arch/arm/mach-h720x/Makefile.boot2
-rw-r--r--arch/arm/mach-h720x/common.c247
-rw-r--r--arch/arm/mach-h720x/common.h29
-rw-r--r--arch/arm/mach-h720x/cpu-h7201.c64
-rw-r--r--arch/arm/mach-h720x/cpu-h7202.c228
-rw-r--r--arch/arm/mach-h720x/h7201-eval.c39
-rw-r--r--arch/arm/mach-h720x/h7202-eval.c81
-rw-r--r--arch/arm/mach-imx/Kconfig10
-rw-r--r--arch/arm/mach-imx/Makefile19
-rw-r--r--arch/arm/mach-imx/Makefile.boot2
-rw-r--r--arch/arm/mach-imx/dma.c203
-rw-r--r--arch/arm/mach-imx/generic.c274
-rw-r--r--arch/arm/mach-imx/generic.h16
-rw-r--r--arch/arm/mach-imx/irq.c252
-rw-r--r--arch/arm/mach-imx/leds-mx1ads.c54
-rw-r--r--arch/arm/mach-imx/leds.c31
-rw-r--r--arch/arm/mach-imx/leds.h9
-rw-r--r--arch/arm/mach-imx/mx1ads.c88
-rw-r--r--arch/arm/mach-imx/time.c101
-rw-r--r--arch/arm/mach-integrator/Kconfig33
-rw-r--r--arch/arm/mach-integrator/Makefile14
-rw-r--r--arch/arm/mach-integrator/Makefile.boot4
-rw-r--r--arch/arm/mach-integrator/clock.c141
-rw-r--r--arch/arm/mach-integrator/clock.h25
-rw-r--r--arch/arm/mach-integrator/common.h2
-rw-r--r--arch/arm/mach-integrator/core.c271
-rw-r--r--arch/arm/mach-integrator/cpu.c221
-rw-r--r--arch/arm/mach-integrator/dma.c35
-rw-r--r--arch/arm/mach-integrator/impd1.c475
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c302
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c528
-rw-r--r--arch/arm/mach-integrator/leds.c88
-rw-r--r--arch/arm/mach-integrator/lm.c96
-rw-r--r--arch/arm/mach-integrator/pci.c132
-rw-r--r--arch/arm/mach-integrator/pci_v3.c604
-rw-r--r--arch/arm/mach-integrator/time.c213
-rw-r--r--arch/arm/mach-iop3xx/Kconfig63
-rw-r--r--arch/arm/mach-iop3xx/Makefile23
-rw-r--r--arch/arm/mach-iop3xx/Makefile.boot9
-rw-r--r--arch/arm/mach-iop3xx/common.c74
-rw-r--r--arch/arm/mach-iop3xx/iop321-irq.c96
-rw-r--r--arch/arm/mach-iop3xx/iop321-pci.c220
-rw-r--r--arch/arm/mach-iop3xx/iop321-setup.c169
-rw-r--r--arch/arm/mach-iop3xx/iop321-time.c109
-rw-r--r--arch/arm/mach-iop3xx/iop331-irq.c127
-rw-r--r--arch/arm/mach-iop3xx/iop331-pci.c222
-rw-r--r--arch/arm/mach-iop3xx/iop331-setup.c177
-rw-r--r--arch/arm/mach-iop3xx/iop331-time.c107
-rw-r--r--arch/arm/mach-iop3xx/iq31244-mm.c44
-rw-r--r--arch/arm/mach-iop3xx/iq31244-pci.c129
-rw-r--r--arch/arm/mach-iop3xx/iq80321-mm.c44
-rw-r--r--arch/arm/mach-iop3xx/iq80321-pci.c123
-rw-r--r--arch/arm/mach-iop3xx/iq80331-mm.c36
-rw-r--r--arch/arm/mach-iop3xx/iq80331-pci.c119
-rw-r--r--arch/arm/mach-iop3xx/iq80332-mm.c36
-rw-r--r--arch/arm/mach-iop3xx/iq80332-pci.c125
-rw-r--r--arch/arm/mach-ixp2000/Kconfig59
-rw-r--r--arch/arm/mach-ixp2000/Makefile14
-rw-r--r--arch/arm/mach-ixp2000/Makefile.boot3
-rw-r--r--arch/arm/mach-ixp2000/core.c390
-rw-r--r--arch/arm/mach-ixp2000/enp2611.c220
-rw-r--r--arch/arm/mach-ixp2000/ixdp2400.c179
-rw-r--r--arch/arm/mach-ixp2000/ixdp2800.c180
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x00.c304
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x01.c400
-rw-r--r--arch/arm/mach-ixp2000/pci.c235
-rw-r--r--arch/arm/mach-ixp4xx/Kconfig127
-rw-r--r--arch/arm/mach-ixp4xx/Makefile11
-rw-r--r--arch/arm/mach-ixp4xx/Makefile.boot3
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c527
-rw-r--r--arch/arm/mach-ixp4xx/common.c353
-rw-r--r--arch/arm/mach-ixp4xx/coyote-pci.c70
-rw-r--r--arch/arm/mach-ixp4xx/coyote-setup.c130
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-pci.c101
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-setup.c153
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-pci.c84
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c181
-rw-r--r--arch/arm/mach-ixp4xx/ixdpg425-pci.c66
-rw-r--r--arch/arm/mach-l7200/Makefile11
-rw-r--r--arch/arm/mach-l7200/Makefile.boot2
-rw-r--r--arch/arm/mach-l7200/core.c89
-rw-r--r--arch/arm/mach-lh7a40x/Kconfig70
-rw-r--r--arch/arm/mach-lh7a40x/Makefile14
-rw-r--r--arch/arm/mach-lh7a40x/Makefile.boot4
-rw-r--r--arch/arm/mach-lh7a40x/arch-kev7a400.c111
-rw-r--r--arch/arm/mach-lh7a40x/arch-lpd7a40x.c286
-rw-r--r--arch/arm/mach-lh7a40x/common.h16
-rw-r--r--arch/arm/mach-lh7a40x/irq-kev7a400.c92
-rw-r--r--arch/arm/mach-lh7a40x/irq-lh7a400.c90
-rw-r--r--arch/arm/mach-lh7a40x/irq-lh7a404.c158
-rw-r--r--arch/arm/mach-lh7a40x/irq-lpd7a40x.c128
-rw-r--r--arch/arm/mach-lh7a40x/time.c75
-rw-r--r--arch/arm/mach-omap/Kconfig221
-rw-r--r--arch/arm/mach-omap/Makefile40
-rw-r--r--arch/arm/mach-omap/Makefile.boot4
-rw-r--r--arch/arm/mach-omap/board-generic.c98
-rw-r--r--arch/arm/mach-omap/board-h2.c187
-rw-r--r--arch/arm/mach-omap/board-h3.c205
-rw-r--r--arch/arm/mach-omap/board-innovator.c280
-rw-r--r--arch/arm/mach-omap/board-netstar.c151
-rw-r--r--arch/arm/mach-omap/board-osk.c169
-rw-r--r--arch/arm/mach-omap/board-perseus2.c189
-rw-r--r--arch/arm/mach-omap/board-voiceblue.c256
-rw-r--r--arch/arm/mach-omap/clock.c1076
-rw-r--r--arch/arm/mach-omap/clock.h112
-rw-r--r--arch/arm/mach-omap/common.c549
-rw-r--r--arch/arm/mach-omap/common.h36
-rw-r--r--arch/arm/mach-omap/dma.c1086
-rw-r--r--arch/arm/mach-omap/fpga.c188
-rw-r--r--arch/arm/mach-omap/gpio.c762
-rw-r--r--arch/arm/mach-omap/irq.c219
-rw-r--r--arch/arm/mach-omap/leds-h2p2-debug.c144
-rw-r--r--arch/arm/mach-omap/leds-innovator.c103
-rw-r--r--arch/arm/mach-omap/leds-osk.c198
-rw-r--r--arch/arm/mach-omap/leds.c61
-rw-r--r--arch/arm/mach-omap/leds.h3
-rw-r--r--arch/arm/mach-omap/mcbsp.c685
-rw-r--r--arch/arm/mach-omap/mux.c163
-rw-r--r--arch/arm/mach-omap/ocpi.c114
-rw-r--r--arch/arm/mach-omap/pm.c628
-rw-r--r--arch/arm/mach-omap/sleep.S314
-rw-r--r--arch/arm/mach-omap/time.c384
-rw-r--r--arch/arm/mach-omap/usb.c594
-rw-r--r--arch/arm/mach-pxa/Kconfig77
-rw-r--r--arch/arm/mach-pxa/Makefile26
-rw-r--r--arch/arm/mach-pxa/Makefile.boot2
-rw-r--r--arch/arm/mach-pxa/corgi.c320
-rw-r--r--arch/arm/mach-pxa/corgi_ssp.c248
-rw-r--r--arch/arm/mach-pxa/dma.c133
-rw-r--r--arch/arm/mach-pxa/generic.c237
-rw-r--r--arch/arm/mach-pxa/generic.h24
-rw-r--r--arch/arm/mach-pxa/idp.c190
-rw-r--r--arch/arm/mach-pxa/irq.c313
-rw-r--r--arch/arm/mach-pxa/leds-idp.c117
-rw-r--r--arch/arm/mach-pxa/leds-lubbock.c126
-rw-r--r--arch/arm/mach-pxa/leds-mainstone.c121
-rw-r--r--arch/arm/mach-pxa/leds.c32
-rw-r--r--arch/arm/mach-pxa/leds.h12
-rw-r--r--arch/arm/mach-pxa/lubbock.c247
-rw-r--r--arch/arm/mach-pxa/mainstone.c316
-rw-r--r--arch/arm/mach-pxa/pm.c227
-rw-r--r--arch/arm/mach-pxa/poodle.c189
-rw-r--r--arch/arm/mach-pxa/pxa25x.c104
-rw-r--r--arch/arm/mach-pxa/pxa27x.c163
-rw-r--r--arch/arm/mach-pxa/sleep.S194
-rw-r--r--arch/arm/mach-pxa/ssp.c363
-rw-r--r--arch/arm/mach-pxa/time.c164
-rw-r--r--arch/arm/mach-rpc/Makefile11
-rw-r--r--arch/arm/mach-rpc/Makefile.boot4
-rw-r--r--arch/arm/mach-rpc/dma.c338
-rw-r--r--arch/arm/mach-rpc/irq.c162
-rw-r--r--arch/arm/mach-rpc/riscpc.c179
-rw-r--r--arch/arm/mach-s3c2410/Kconfig169
-rw-r--r--arch/arm/mach-s3c2410/Makefile36
-rw-r--r--arch/arm/mach-s3c2410/Makefile.boot3
-rw-r--r--arch/arm/mach-s3c2410/bast-irq.c132
-rw-r--r--arch/arm/mach-s3c2410/bast.h2
-rw-r--r--arch/arm/mach-s3c2410/clock.c507
-rw-r--r--arch/arm/mach-s3c2410/clock.h44
-rw-r--r--arch/arm/mach-s3c2410/cpu.c241
-rw-r--r--arch/arm/mach-s3c2410/cpu.h69
-rw-r--r--arch/arm/mach-s3c2410/devs.c485
-rw-r--r--arch/arm/mach-s3c2410/devs.h48
-rw-r--r--arch/arm/mach-s3c2410/dma.c1210
-rw-r--r--arch/arm/mach-s3c2410/gpio.c213
-rw-r--r--arch/arm/mach-s3c2410/irq.c966
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c409
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c126
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c155
-rw-r--r--arch/arm/mach-s3c2410/mach-nexcoder.c156
-rw-r--r--arch/arm/mach-s3c2410/mach-otom.c124
-rw-r--r--arch/arm/mach-s3c2410/mach-rx3715.c141
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2410.c123
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2440.c135
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c317
-rw-r--r--arch/arm/mach-s3c2410/pm.c672
-rw-r--r--arch/arm/mach-s3c2410/pm.h59
-rw-r--r--arch/arm/mach-s3c2410/s3c2410.c200
-rw-r--r--arch/arm/mach-s3c2410/s3c2410.h37
-rw-r--r--arch/arm/mach-s3c2410/s3c2440-dsc.c59
-rw-r--r--arch/arm/mach-s3c2410/s3c2440.c281
-rw-r--r--arch/arm/mach-s3c2410/s3c2440.h35
-rw-r--r--arch/arm/mach-s3c2410/sleep.S180
-rw-r--r--arch/arm/mach-s3c2410/time.c256
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.c113
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.h19
-rw-r--r--arch/arm/mach-sa1100/Kconfig162
-rw-r--r--arch/arm/mach-sa1100/Makefile53
-rw-r--r--arch/arm/mach-sa1100/Makefile.boot7
-rw-r--r--arch/arm/mach-sa1100/assabet.c441
-rw-r--r--arch/arm/mach-sa1100/badge4.c293
-rw-r--r--arch/arm/mach-sa1100/cerf.c132
-rw-r--r--arch/arm/mach-sa1100/collie.c192
-rw-r--r--arch/arm/mach-sa1100/cpu-sa1100.c249
-rw-r--r--arch/arm/mach-sa1100/cpu-sa1110.c367
-rw-r--r--arch/arm/mach-sa1100/dma.c348
-rw-r--r--arch/arm/mach-sa1100/generic.c419
-rw-r--r--arch/arm/mach-sa1100/generic.h38
-rw-r--r--arch/arm/mach-sa1100/h3600.c892
-rw-r--r--arch/arm/mach-sa1100/hackkit.c200
-rw-r--r--arch/arm/mach-sa1100/irq.c332
-rw-r--r--arch/arm/mach-sa1100/jornada720.c105
-rw-r--r--arch/arm/mach-sa1100/lart.c49
-rw-r--r--arch/arm/mach-sa1100/leds-assabet.c115
-rw-r--r--arch/arm/mach-sa1100/leds-badge4.c112
-rw-r--r--arch/arm/mach-sa1100/leds-cerf.c111
-rw-r--r--arch/arm/mach-sa1100/leds-hackkit.c113
-rw-r--r--arch/arm/mach-sa1100/leds-lart.c102
-rw-r--r--arch/arm/mach-sa1100/leds-simpad.c101
-rw-r--r--arch/arm/mach-sa1100/leds.c52
-rw-r--r--arch/arm/mach-sa1100/leds.h14
-rw-r--r--arch/arm/mach-sa1100/neponset.c342
-rw-r--r--arch/arm/mach-sa1100/pleb.c154
-rw-r--r--arch/arm/mach-sa1100/pm.c167
-rw-r--r--arch/arm/mach-sa1100/shannon.c85
-rw-r--r--arch/arm/mach-sa1100/simpad.c224
-rw-r--r--arch/arm/mach-sa1100/sleep.S215
-rw-r--r--arch/arm/mach-sa1100/ssp.c214
-rw-r--r--arch/arm/mach-sa1100/time.c159
-rw-r--r--arch/arm/mach-shark/Makefile12
-rw-r--r--arch/arm/mach-shark/Makefile.boot2
-rw-r--r--arch/arm/mach-shark/core.c114
-rw-r--r--arch/arm/mach-shark/dma.c22
-rw-r--r--arch/arm/mach-shark/irq.c109
-rw-r--r--arch/arm/mach-shark/leds.c163
-rw-r--r--arch/arm/mach-shark/pci.c42
-rw-r--r--arch/arm/mach-versatile/Kconfig16
-rw-r--r--arch/arm/mach-versatile/Makefile7
-rw-r--r--arch/arm/mach-versatile/Makefile.boot4
-rw-r--r--arch/arm/mach-versatile/clock.c145
-rw-r--r--arch/arm/mach-versatile/clock.h25
-rw-r--r--arch/arm/mach-versatile/core.c918
-rw-r--r--arch/arm/mach-versatile/core.h50
-rw-r--r--arch/arm/mach-versatile/versatile_ab.c45
-rw-r--r--arch/arm/mach-versatile/versatile_pb.c109
-rw-r--r--arch/arm/mm/Kconfig411
-rw-r--r--arch/arm/mm/Makefile56
-rw-r--r--arch/arm/mm/abort-ev4.S30
-rw-r--r--arch/arm/mm/abort-ev4t.S30
-rw-r--r--arch/arm/mm/abort-ev5t.S31
-rw-r--r--arch/arm/mm/abort-ev5tj.S35
-rw-r--r--arch/arm/mm/abort-ev6.S23
-rw-r--r--arch/arm/mm/abort-lv4t.S220
-rw-r--r--arch/arm/mm/abort-macro.S42
-rw-r--r--arch/arm/mm/alignment.c756
-rw-r--r--arch/arm/mm/blockops.c184
-rw-r--r--arch/arm/mm/cache-v3.S137
-rw-r--r--arch/arm/mm/cache-v4.S139
-rw-r--r--arch/arm/mm/cache-v4wb.S216
-rw-r--r--arch/arm/mm/cache-v4wt.S188
-rw-r--r--arch/arm/mm/cache-v6.S227
-rw-r--r--arch/arm/mm/consistent.c451
-rw-r--r--arch/arm/mm/copypage-v3.S67
-rw-r--r--arch/arm/mm/copypage-v4mc.S80
-rw-r--r--arch/arm/mm/copypage-v4wb.S79
-rw-r--r--arch/arm/mm/copypage-v4wt.S73
-rw-r--r--arch/arm/mm/copypage-v6.c155
-rw-r--r--arch/arm/mm/copypage-xscale.S113
-rw-r--r--arch/arm/mm/discontig.c49
-rw-r--r--arch/arm/mm/extable.c16
-rw-r--r--arch/arm/mm/fault-armv.c223
-rw-r--r--arch/arm/mm/fault.c462
-rw-r--r--arch/arm/mm/fault.h6
-rw-r--r--arch/arm/mm/flush.c94
-rw-r--r--arch/arm/mm/init.c621
-rw-r--r--arch/arm/mm/ioremap.c172
-rw-r--r--arch/arm/mm/minicache.c73
-rw-r--r--arch/arm/mm/mm-armv.c760
-rw-r--r--arch/arm/mm/mmap.c109
-rw-r--r--arch/arm/mm/mmu.c45
-rw-r--r--arch/arm/mm/proc-arm1020.S530
-rw-r--r--arch/arm/mm/proc-arm1020e.S513
-rw-r--r--arch/arm/mm/proc-arm1022.S495
-rw-r--r--arch/arm/mm/proc-arm1026.S491
-rw-r--r--arch/arm/mm/proc-arm6_7.S404
-rw-r--r--arch/arm/mm/proc-arm720.S267
-rw-r--r--arch/arm/mm/proc-arm920.S480
-rw-r--r--arch/arm/mm/proc-arm922.S484
-rw-r--r--arch/arm/mm/proc-arm925.S562
-rw-r--r--arch/arm/mm/proc-arm926.S495
-rw-r--r--arch/arm/mm/proc-macros.S51
-rw-r--r--arch/arm/mm/proc-sa110.S272
-rw-r--r--arch/arm/mm/proc-sa1100.S323
-rw-r--r--arch/arm/mm/proc-syms.c40
-rw-r--r--arch/arm/mm/proc-v6.S272
-rw-r--r--arch/arm/mm/proc-xscale.S934
-rw-r--r--arch/arm/mm/tlb-v3.S52
-rw-r--r--arch/arm/mm/tlb-v4.S65
-rw-r--r--arch/arm/mm/tlb-v4wb.S77
-rw-r--r--arch/arm/mm/tlb-v4wbi.S68
-rw-r--r--arch/arm/mm/tlb-v6.S92
-rw-r--r--arch/arm/nwfpe/ARM-gcc.h120
-rw-r--r--arch/arm/nwfpe/ChangeLog91
-rw-r--r--arch/arm/nwfpe/Makefile13
-rw-r--r--arch/arm/nwfpe/double_cpdo.c167
-rw-r--r--arch/arm/nwfpe/entry.S119
-rw-r--r--arch/arm/nwfpe/entry26.S112
-rw-r--r--arch/arm/nwfpe/extended_cpdo.c154
-rw-r--r--arch/arm/nwfpe/fpa11.c143
-rw-r--r--arch/arm/nwfpe/fpa11.h93
-rw-r--r--arch/arm/nwfpe/fpa11.inl51
-rw-r--r--arch/arm/nwfpe/fpa11_cpdo.c132
-rw-r--r--arch/arm/nwfpe/fpa11_cpdt.c392
-rw-r--r--arch/arm/nwfpe/fpa11_cprt.c369
-rw-r--r--arch/arm/nwfpe/fpmodule.c173
-rw-r--r--arch/arm/nwfpe/fpmodule.h47
-rw-r--r--arch/arm/nwfpe/fpmodule.inl74
-rw-r--r--arch/arm/nwfpe/fpopcode.c90
-rw-r--r--arch/arm/nwfpe/fpopcode.h479
-rw-r--r--arch/arm/nwfpe/fpsr.h108
-rw-r--r--arch/arm/nwfpe/milieu.h48
-rw-r--r--arch/arm/nwfpe/single_cpdo.c124
-rw-r--r--arch/arm/nwfpe/softfloat-macros740
-rw-r--r--arch/arm/nwfpe/softfloat-specialize366
-rw-r--r--arch/arm/nwfpe/softfloat.c3443
-rw-r--r--arch/arm/nwfpe/softfloat.h278
-rw-r--r--arch/arm/oprofile/Kconfig23
-rw-r--r--arch/arm/oprofile/Makefile11
-rw-r--r--arch/arm/oprofile/common.c156
-rw-r--r--arch/arm/oprofile/init.c31
-rw-r--r--arch/arm/oprofile/op_arm_model.h29
-rw-r--r--arch/arm/oprofile/op_counter.h29
-rw-r--r--arch/arm/oprofile/op_model_xscale.c443
-rw-r--r--arch/arm/tools/Makefile9
-rw-r--r--arch/arm/tools/gen-mach-types73
-rw-r--r--arch/arm/tools/mach-types726
-rw-r--r--arch/arm/vfp/Makefile12
-rw-r--r--arch/arm/vfp/entry.S45
-rw-r--r--arch/arm/vfp/vfp.h344
-rw-r--r--arch/arm/vfp/vfpdouble.c1186
-rw-r--r--arch/arm/vfp/vfphw.S215
-rw-r--r--arch/arm/vfp/vfpinstr.h88
-rw-r--r--arch/arm/vfp/vfpmodule.c288
-rw-r--r--arch/arm/vfp/vfpsingle.c1224
563 files changed, 140025 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
new file mode 100644
index 000000000000..4055115ae0e2
--- /dev/null
+++ b/arch/arm/Kconfig
@@ -0,0 +1,736 @@
1#
2# For a description of the syntax of this configuration file,
3# see Documentation/kbuild/kconfig-language.txt.
4#
5
6mainmenu "Linux Kernel Configuration"
7
8config ARM
9 bool
10 default y
11 help
12 The ARM series is a line of low-power-consumption RISC chip designs
13 licensed by ARM ltd and targeted at embedded applications and
14 handhelds such as the Compaq IPAQ. ARM-based PCs are no longer
15 manufactured, but legacy ARM-based PC hardware remains popular in
16 Europe. There is an ARM Linux project with a web page at
17 <http://www.arm.linux.org.uk/>.
18
19config MMU
20 bool
21 default y
22
23config EISA
24 bool
25 ---help---
26 The Extended Industry Standard Architecture (EISA) bus was
27 developed as an open alternative to the IBM MicroChannel bus.
28
29 The EISA bus provided some of the features of the IBM MicroChannel
30 bus while maintaining backward compatibility with cards made for
31 the older ISA bus. The EISA bus saw limited use between 1988 and
32 1995 when it was made obsolete by the PCI bus.
33
34 Say Y here if you are building a kernel for an EISA-based machine.
35
36 Otherwise, say N.
37
38config SBUS
39 bool
40
41config MCA
42 bool
43 help
44 MicroChannel Architecture is found in some IBM PS/2 machines and
45 laptops. It is a bus system similar to PCI or ISA. See
46 <file:Documentation/mca.txt> (and especially the web page given
47 there) before attempting to build an MCA bus kernel.
48
49config UID16
50 bool
51 default y
52
53config RWSEM_GENERIC_SPINLOCK
54 bool
55 default y
56
57config RWSEM_XCHGADD_ALGORITHM
58 bool
59
60config GENERIC_CALIBRATE_DELAY
61 bool
62 default y
63
64config GENERIC_BUST_SPINLOCK
65 bool
66
67config GENERIC_ISA_DMA
68 bool
69
70config GENERIC_IOMAP
71 bool
72 default y
73
74config FIQ
75 bool
76
77source "init/Kconfig"
78
79menu "System Type"
80
81choice
82 prompt "ARM system type"
83 default ARCH_RPC
84
85config ARCH_CLPS7500
86 bool "Cirrus-CL-PS7500FE"
87 select TIMER_ACORN
88
89config ARCH_CLPS711X
90 bool "CLPS711x/EP721x-based"
91
92config ARCH_CO285
93 bool "Co-EBSA285"
94 select FOOTBRIDGE
95 select FOOTBRIDGE_ADDIN
96
97config ARCH_EBSA110
98 bool "EBSA-110"
99 help
100 This is an evaluation board for the StrongARM processor available
101 from Digital. It has limited hardware on-board, including an onboard
102 Ethernet interface, two PCMCIA sockets, two serial ports and a
103 parallel port.
104
105config ARCH_CAMELOT
106 bool "Epxa10db"
107 help
108 This enables support for Altera's Excalibur XA10 development board.
109 If you would like to build your kernel to run on one of these boards
110 then you must say 'Y' here. Otherwise say 'N'
111
112config ARCH_FOOTBRIDGE
113 bool "FootBridge"
114 select FOOTBRIDGE
115
116config ARCH_INTEGRATOR
117 bool "Integrator"
118 select ARM_AMBA
119 select ICST525
120
121config ARCH_IOP3XX
122 bool "IOP3xx-based"
123
124config ARCH_IXP4XX
125 bool "IXP4xx-based"
126 select DMABOUNCE
127
128config ARCH_IXP2000
129 bool "IXP2400/2800-based"
130
131config ARCH_L7200
132 bool "LinkUp-L7200"
133 select FIQ
134 help
135 Say Y here if you intend to run this kernel on a LinkUp Systems
136 L7200 Software Development Board which uses an ARM720T processor.
137 Information on this board can be obtained at:
138
139 <http://www.linkupsys.com/>
140
141 If you have any questions or comments about the Linux kernel port
142 to this board, send e-mail to <sjhill@cotw.com>.
143
144config ARCH_PXA
145 bool "PXA2xx-based"
146
147config ARCH_RPC
148 bool "RiscPC"
149 select ARCH_ACORN
150 select FIQ
151 select TIMER_ACORN
152 help
153 On the Acorn Risc-PC, Linux can support the internal IDE disk and
154 CD-ROM interface, serial and parallel port, and the floppy drive.
155
156config ARCH_SA1100
157 bool "SA1100-based"
158
159config ARCH_S3C2410
160 bool "Samsung S3C2410"
161 help
162 Samsung S3C2410X CPU based systems, such as the Simtec Electronics
163 BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
164 the Samsung SMDK2410 development board (and derviatives).
165
166config ARCH_SHARK
167 bool "Shark"
168
169config ARCH_LH7A40X
170 bool "Sharp LH7A40X"
171 help
172 Say Y here for systems based on one of the Sharp LH7A40X
173 System on a Chip processors. These CPUs include an ARM922T
174 core with a wide array of integrated devices for
175 hand-held and low-power applications.
176
177config ARCH_OMAP
178 bool "TI OMAP"
179
180config ARCH_VERSATILE
181 bool "Versatile"
182 select ARM_AMBA
183 select ICST307
184 help
185 This enables support for ARM Ltd Versatile board.
186
187config ARCH_IMX
188 bool "IMX"
189
190config ARCH_H720X
191 bool "Hynix-HMS720x-based"
192 help
193 This enables support for systems based on the Hynix HMS720x
194
195endchoice
196
197source "arch/arm/mach-clps711x/Kconfig"
198
199source "arch/arm/mach-epxa10db/Kconfig"
200
201source "arch/arm/mach-footbridge/Kconfig"
202
203source "arch/arm/mach-integrator/Kconfig"
204
205source "arch/arm/mach-iop3xx/Kconfig"
206
207source "arch/arm/mach-ixp4xx/Kconfig"
208
209source "arch/arm/mach-ixp2000/Kconfig"
210
211source "arch/arm/mach-pxa/Kconfig"
212
213source "arch/arm/mach-sa1100/Kconfig"
214
215source "arch/arm/mach-omap/Kconfig"
216
217source "arch/arm/mach-s3c2410/Kconfig"
218
219source "arch/arm/mach-lh7a40x/Kconfig"
220
221source "arch/arm/mach-imx/Kconfig"
222
223source "arch/arm/mach-h720x/Kconfig"
224
225source "arch/arm/mach-versatile/Kconfig"
226
227# Definitions to make life easier
228config ARCH_ACORN
229 bool
230
231source arch/arm/mm/Kconfig
232
233# bool 'Use XScale PMU as timer source' CONFIG_XSCALE_PMU_TIMER
234config XSCALE_PMU
235 bool
236 depends on CPU_XSCALE && !XSCALE_PMU_TIMER
237 default y
238
239endmenu
240
241source "arch/arm/common/Kconfig"
242
243config FORCE_MAX_ZONEORDER
244 int
245 depends on SA1111
246 default "9"
247
248menu "Bus support"
249
250config ARM_AMBA
251 bool
252
253config ISA
254 bool
255 depends on FOOTBRIDGE_HOST || ARCH_SHARK || ARCH_CLPS7500 || ARCH_EBSA110 || ARCH_CDB89712 || ARCH_EDB7211 || ARCH_SA1100 || ARCH_MX1ADS
256 default y
257 help
258 Find out whether you have ISA slots on your motherboard. ISA is the
259 name of a bus system, i.e. the way the CPU talks to the other stuff
260 inside your box. Other bus systems are PCI, EISA, MicroChannel
261 (MCA) or VESA. ISA is an older system, now being displaced by PCI;
262 newer boards don't support it. If you have ISA, say Y, otherwise N.
263
264config ISA_DMA
265 bool
266 depends on FOOTBRIDGE_HOST || ARCH_SHARK
267 default y
268
269config PCI
270 bool "PCI support" if ARCH_INTEGRATOR_AP
271 default y if ARCH_SHARK || FOOTBRIDGE_HOST || ARCH_IOP3XX || ARCH_IXP4XX || ARCH_IXP2000
272 help
273 Find out whether you have a PCI motherboard. PCI is the name of a
274 bus system, i.e. the way the CPU talks to the other stuff inside
275 your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
276 VESA. If you have PCI, say Y, otherwise N.
277
278 The PCI-HOWTO, available from
279 <http://www.tldp.org/docs.html#howto>, contains valuable
280 information about which PCI hardware does work under Linux and which
281 doesn't.
282
283# Select the host bridge type
284config PCI_HOST_VIA82C505
285 bool
286 depends on PCI && ARCH_SHARK
287 default y
288
289source "drivers/pci/Kconfig"
290
291source "drivers/pcmcia/Kconfig"
292
293endmenu
294
295menu "Kernel Features"
296
297config SMP
298 bool "Symmetric Multi-Processing (EXPERIMENTAL)"
299 depends on EXPERIMENTAL && n
300 help
301 This enables support for systems with more than one CPU. If you have
302 a system with only one CPU, like most personal computers, say N. If
303 you have a system with more than one CPU, say Y.
304
305 If you say N here, the kernel will run on single and multiprocessor
306 machines, but will use only one CPU of a multiprocessor machine. If
307 you say Y here, the kernel will run on many, but not all, single
308 processor machines. On a single processor machine, the kernel will
309 run faster if you say N here.
310
311 See also the <file:Documentation/smp.tex>,
312 <file:Documentation/smp.txt>, <file:Documentation/i386/IO-APIC.txt>,
313 <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
314 <http://www.linuxdoc.org/docs.html#howto>.
315
316 If you don't know what to do here, say N.
317
318config NR_CPUS
319 int "Maximum number of CPUs (2-32)"
320 range 2 32
321 depends on SMP
322 default "4"
323
324config PREEMPT
325 bool "Preemptible Kernel (EXPERIMENTAL)"
326 depends on EXPERIMENTAL
327 help
328 This option reduces the latency of the kernel when reacting to
329 real-time or interactive events by allowing a low priority process to
330 be preempted even if it is in kernel mode executing a system call.
331 This allows applications to run more reliably even when the system is
332 under load.
333
334 Say Y here if you are building a kernel for a desktop, embedded
335 or real-time system. Say N if you are unsure.
336
337config DISCONTIGMEM
338 bool
339 depends on ARCH_EDB7211 || ARCH_SA1100 || (ARCH_LH7A40X && !LH7A40X_CONTIGMEM)
340 default y
341 help
342 Say Y to support efficient handling of discontiguous physical memory,
343 for architectures which are either NUMA (Non-Uniform Memory Access)
344 or have huge holes in the physical address space for other reasons.
345 See <file:Documentation/vm/numa> for more.
346
347config LEDS
348 bool "Timer and CPU usage LEDs"
349 depends on ARCH_CDB89712 || ARCH_CO285 || ARCH_EBSA110 || \
350 ARCH_EBSA285 || ARCH_IMX || ARCH_INTEGRATOR || \
351 ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \
352 ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \
353 ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE
354 help
355 If you say Y here, the LEDs on your machine will be used
356 to provide useful information about your current system status.
357
358 If you are compiling a kernel for a NetWinder or EBSA-285, you will
359 be able to select which LEDs are active using the options below. If
360 you are compiling a kernel for the EBSA-110 or the LART however, the
361 red LED will simply flash regularly to indicate that the system is
362 still functional. It is safe to say Y here if you have a CATS
363 system, but the driver will do nothing.
364
365config LEDS_TIMER
366 bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \
367 MACH_OMAP_H2 || MACH_OMAP_PERSEUS2
368 depends on LEDS
369 default y if ARCH_EBSA110
370 help
371 If you say Y here, one of the system LEDs (the green one on the
372 NetWinder, the amber one on the EBSA285, or the red one on the LART)
373 will flash regularly to indicate that the system is still
374 operational. This is mainly useful to kernel hackers who are
375 debugging unstable kernels.
376
377 The LART uses the same LED for both Timer LED and CPU usage LED
378 functions. You may choose to use both, but the Timer LED function
379 will overrule the CPU usage LED.
380
381config LEDS_CPU
382 bool "CPU usage LED" if (!ARCH_CDB89712 && !ARCH_EBSA110 && \
383 !ARCH_OMAP) || MACH_OMAP_H2 || MACH_OMAP_PERSEUS2
384 depends on LEDS
385 help
386 If you say Y here, the red LED will be used to give a good real
387 time indication of CPU usage, by lighting whenever the idle task
388 is not currently executing.
389
390 The LART uses the same LED for both Timer LED and CPU usage LED
391 functions. You may choose to use both, but the Timer LED function
392 will overrule the CPU usage LED.
393
394config ALIGNMENT_TRAP
395 bool
396 default y if !ARCH_EBSA110
397 help
398 ARM processors can not fetch/store information which is not
399 naturally aligned on the bus, i.e., a 4 byte fetch must start at an
400 address divisible by 4. On 32-bit ARM processors, these non-aligned
401 fetch/store instructions will be emulated in software if you say
402 here, which has a severe performance impact. This is necessary for
403 correct operation of some network protocols. With an IP-only
404 configuration it is safe to say N, otherwise say Y.
405
406endmenu
407
408menu "Boot options"
409
410# Compressed boot loader in ROM. Yes, we really want to ask about
411# TEXT and BSS so we preserve their values in the config files.
412config ZBOOT_ROM_TEXT
413 hex "Compressed ROM boot loader base address"
414 default "0"
415 help
416 The physical address at which the ROM-able zImage is to be
417 placed in the target. Platforms which normally make use of
418 ROM-able zImage formats normally set this to a suitable
419 value in their defconfig file.
420
421 If ZBOOT_ROM is not enabled, this has no effect.
422
423config ZBOOT_ROM_BSS
424 hex "Compressed ROM boot loader BSS address"
425 default "0"
426 help
427 The base address of 64KiB of read/write memory in the target
428 for the ROM-able zImage, which must be available while the
429 decompressor is running. Platforms which normally make use of
430 ROM-able zImage formats normally set this to a suitable
431 value in their defconfig file.
432
433 If ZBOOT_ROM is not enabled, this has no effect.
434
435config ZBOOT_ROM
436 bool "Compressed boot loader in ROM/flash"
437 depends on ZBOOT_ROM_TEXT != ZBOOT_ROM_BSS
438 help
439 Say Y here if you intend to execute your compressed kernel image
440 (zImage) directly from ROM or flash. If unsure, say N.
441
442config CMDLINE
443 string "Default kernel command string"
444 default ""
445 help
446 On some architectures (EBSA110 and CATS), there is currently no way
447 for the boot loader to pass arguments to the kernel. For these
448 architectures, you should supply some command-line options at build
449 time by entering them here. As a minimum, you should specify the
450 memory size and the root device (e.g., mem=64M root=/dev/nfs).
451
452config XIP_KERNEL
453 bool "Kernel Execute-In-Place from ROM"
454 depends on !ZBOOT_ROM
455 help
456 Execute-In-Place allows the kernel to run from non-volatile storage
457 directly addressable by the CPU, such as NOR flash. This saves RAM
458 space since the text section of the kernel is not loaded from flash
459 to RAM. Read-write sections, such as the data section and stack,
460 are still copied to RAM. The XIP kernel is not compressed since
461 it has to run directly from flash, so it will take more space to
462 store it. The flash address used to link the kernel object files,
463 and for storing it, is configuration dependent. Therefore, if you
464 say Y here, you must know the proper physical address where to
465 store the kernel image depending on your own flash memory usage.
466
467 Also note that the make target becomes "make xipImage" rather than
468 "make zImage" or "make Image". The final kernel binary to put in
469 ROM memory will be arch/arm/boot/xipImage.
470
471 If unsure, say N.
472
473config XIP_PHYS_ADDR
474 hex "XIP Kernel Physical Location"
475 depends on XIP_KERNEL
476 default "0x00080000"
477 help
478 This is the physical address in your flash memory the kernel will
479 be linked for and stored to. This address is dependent on your
480 own flash usage.
481
482endmenu
483
484if (ARCH_SA1100 || ARCH_INTEGRATOR)
485
486menu "CPU Frequency scaling"
487
488source "drivers/cpufreq/Kconfig"
489
490config CPU_FREQ_SA1100
491 bool
492 depends on CPU_FREQ && (SA1100_LART || SA1100_PLEB)
493 default y
494
495config CPU_FREQ_SA1110
496 bool
497 depends on CPU_FREQ && (SA1100_ASSABET || SA1100_CERF || SA1100_PT_SYSTEM3)
498 default y
499
500config CPU_FREQ_INTEGRATOR
501 tristate "CPUfreq driver for ARM Integrator CPUs"
502 depends on ARCH_INTEGRATOR && CPU_FREQ
503 default y
504 help
505 This enables the CPUfreq driver for ARM Integrator CPUs.
506
507 For details, take a look at <file:Documentation/cpu-freq>.
508
509 If in doubt, say Y.
510
511endmenu
512
513endif
514
515menu "Floating point emulation"
516
517comment "At least one emulation must be selected"
518
519config FPE_NWFPE
520 bool "NWFPE math emulation"
521 ---help---
522 Say Y to include the NWFPE floating point emulator in the kernel.
523 This is necessary to run most binaries. Linux does not currently
524 support floating point hardware so you need to say Y here even if
525 your machine has an FPA or floating point co-processor podule.
526
527 You may say N here if you are going to load the Acorn FPEmulator
528 early in the bootup.
529
530config FPE_NWFPE_XP
531 bool "Support extended precision"
532 depends on FPE_NWFPE && !CPU_BIG_ENDIAN
533 help
534 Say Y to include 80-bit support in the kernel floating-point
535 emulator. Otherwise, only 32 and 64-bit support is compiled in.
536 Note that gcc does not generate 80-bit operations by default,
537 so in most cases this option only enlarges the size of the
538 floating point emulator without any good reason.
539
540 You almost surely want to say N here.
541
542config FPE_FASTFPE
543 bool "FastFPE math emulation (EXPERIMENTAL)"
544 depends on !CPU_32v3 && EXPERIMENTAL
545 ---help---
546 Say Y here to include the FAST floating point emulator in the kernel.
547 This is an experimental much faster emulator which now also has full
548 precision for the mantissa. It does not support any exceptions.
549 It is very simple, and approximately 3-6 times faster than NWFPE.
550
551 It should be sufficient for most programs. It may be not suitable
552 for scientific calculations, but you have to check this for yourself.
553 If you do not feel you need a faster FP emulation you should better
554 choose NWFPE.
555
556config VFP
557 bool "VFP-format floating point maths"
558 depends on CPU_V6 || CPU_ARM926T
559 help
560 Say Y to include VFP support code in the kernel. This is needed
561 if your hardware includes a VFP unit.
562
563 Please see <file:Documentation/arm/VFP/release-notes.txt> for
564 release notes and additional status information.
565
566 Say N if your target does not have VFP hardware.
567
568endmenu
569
570menu "Userspace binary formats"
571
572source "fs/Kconfig.binfmt"
573
574config ARTHUR
575 tristate "RISC OS personality"
576 help
577 Say Y here to include the kernel code necessary if you want to run
578 Acorn RISC OS/Arthur binaries under Linux. This code is still very
579 experimental; if this sounds frightening, say N and sleep in peace.
580 You can also say M here to compile this support as a module (which
581 will be called arthur).
582
583endmenu
584
585menu "Power management options"
586
587config PM
588 bool "Power Management support"
589 ---help---
590 "Power Management" means that parts of your computer are shut
591 off or put into a power conserving "sleep" mode if they are not
592 being used. There are two competing standards for doing this: APM
593 and ACPI. If you want to use either one, say Y here and then also
594 to the requisite support below.
595
596 Power Management is most important for battery powered laptop
597 computers; if you have a laptop, check out the Linux Laptop home
598 page on the WWW at <http://www.linux-on-laptops.com/> or
599 Tuxmobil - Linux on Mobile Computers at <http://www.tuxmobil.org/>
600 and the Battery Powered Linux mini-HOWTO, available from
601 <http://www.tldp.org/docs.html#howto>.
602
603 Note that, even if you say N here, Linux on the x86 architecture
604 will issue the hlt instruction if nothing is to be done, thereby
605 sending the processor to sleep and saving power.
606
607config APM
608 tristate "Advanced Power Management Emulation"
609 depends on PM
610 ---help---
611 APM is a BIOS specification for saving power using several different
612 techniques. This is mostly useful for battery powered laptops with
613 APM compliant BIOSes. If you say Y here, the system time will be
614 reset after a RESUME operation, the /proc/apm device will provide
615 battery status information, and user-space programs will receive
616 notification of APM "events" (e.g. battery status change).
617
618 If you select "Y" here, you can disable actual use of the APM
619 BIOS by passing the "apm=off" option to the kernel at boot time.
620
621 Note that the APM support is almost completely disabled for
622 machines with more than one CPU.
623
624 In order to use APM, you will need supporting software. For location
625 and more information, read <file:Documentation/pm.txt> and the
626 Battery Powered Linux mini-HOWTO, available from
627 <http://www.tldp.org/docs.html#howto>.
628
629 This driver does not spin down disk drives (see the hdparm(8)
630 manpage ("man 8 hdparm") for that), and it doesn't turn off
631 VESA-compliant "green" monitors.
632
633 This driver does not support the TI 4000M TravelMate and the ACER
634 486/DX4/75 because they don't have compliant BIOSes. Many "green"
635 desktop machines also don't have compliant BIOSes, and this driver
636 may cause those machines to panic during the boot phase.
637
638 Generally, if you don't have a battery in your machine, there isn't
639 much point in using this driver and you should say N. If you get
640 random kernel OOPSes or reboots that don't seem to be related to
641 anything, try disabling/enabling this option (or disabling/enabling
642 APM in your BIOS).
643
644 Some other things you should try when experiencing seemingly random,
645 "weird" problems:
646
647 1) make sure that you have enough swap space and that it is
648 enabled.
649 2) pass the "no-hlt" option to the kernel
650 3) switch on floating point emulation in the kernel and pass
651 the "no387" option to the kernel
652 4) pass the "floppy=nodma" option to the kernel
653 5) pass the "mem=4M" option to the kernel (thereby disabling
654 all but the first 4 MB of RAM)
655 6) make sure that the CPU is not over clocked.
656 7) read the sig11 FAQ at <http://www.bitwizard.nl/sig11/>
657 8) disable the cache from your BIOS settings
658 9) install a fan for the video card or exchange video RAM
659 10) install a better fan for the CPU
660 11) exchange RAM chips
661 12) exchange the motherboard.
662
663 To compile this driver as a module, choose M here: the
664 module will be called apm.
665
666endmenu
667
668menu "Device Drivers"
669
670source "drivers/base/Kconfig"
671
672if ALIGNMENT_TRAP
673source "drivers/mtd/Kconfig"
674endif
675
676source "drivers/parport/Kconfig"
677
678source "drivers/pnp/Kconfig"
679
680source "drivers/block/Kconfig"
681
682source "drivers/acorn/block/Kconfig"
683
684if ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE
685source "drivers/ide/Kconfig"
686endif
687
688source "drivers/scsi/Kconfig"
689
690source "drivers/md/Kconfig"
691
692source "drivers/message/fusion/Kconfig"
693
694source "drivers/ieee1394/Kconfig"
695
696source "drivers/message/i2o/Kconfig"
697
698source "net/Kconfig"
699
700source "drivers/isdn/Kconfig"
701
702# input before char - char/joystick depends on it. As does USB.
703
704source "drivers/input/Kconfig"
705
706source "drivers/char/Kconfig"
707
708source "drivers/i2c/Kconfig"
709
710#source "drivers/l3/Kconfig"
711
712source "drivers/misc/Kconfig"
713
714source "drivers/media/Kconfig"
715
716source "drivers/video/Kconfig"
717
718source "sound/Kconfig"
719
720source "drivers/usb/Kconfig"
721
722source "drivers/mmc/Kconfig"
723
724endmenu
725
726source "fs/Kconfig"
727
728source "arch/arm/oprofile/Kconfig"
729
730source "arch/arm/Kconfig.debug"
731
732source "security/Kconfig"
733
734source "crypto/Kconfig"
735
736source "lib/Kconfig"
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
new file mode 100644
index 000000000000..45a5709eaaa4
--- /dev/null
+++ b/arch/arm/Kconfig.debug
@@ -0,0 +1,109 @@
1menu "Kernel hacking"
2
3source "lib/Kconfig.debug"
4
5# RMK wants arm kernels compiled with frame pointers so hardwire this to y.
6# If you know what you are doing and are willing to live without stack
7# traces, you can get a slightly smaller kernel by setting this option to
8# n, but then RMK will have to kill you ;).
9config FRAME_POINTER
10 bool
11 default y
12 help
13 If you say N here, the resulting kernel will be slightly smaller and
14 faster. However, when a problem occurs with the kernel, the
15 information that is reported is severely limited. Most people
16 should say Y here.
17
18config DEBUG_USER
19 bool "Verbose user fault messages"
20 help
21 When a user program crashes due to an exception, the kernel can
22 print a brief message explaining what the problem was. This is
23 sometimes helpful for debugging but serves no purpose on a
24 production system. Most people should say N here.
25
26 In addition, you need to pass user_debug=N on the kernel command
27 line to enable this feature. N consists of the sum of:
28
29 1 - undefined instruction events
30 2 - system calls
31 4 - invalid data aborts
32 8 - SIGSEGV faults
33 16 - SIGBUS faults
34
35config DEBUG_WAITQ
36 bool "Wait queue debugging"
37 depends on DEBUG_KERNEL
38
39config DEBUG_ERRORS
40 bool "Verbose kernel error messages"
41 depends on DEBUG_KERNEL
42 help
43 This option controls verbose debugging information which can be
44 printed when the kernel detects an internal error. This debugging
45 information is useful to kernel hackers when tracking down problems,
46 but mostly meaningless to other people. It's safe to say Y unless
47 you are concerned with the code size or don't want to see these
48 messages.
49
50
51# These options are only for real kernel hackers who want to get their hands dirty.
52config DEBUG_LL
53 bool "Kernel low-level debugging functions"
54 depends on DEBUG_KERNEL
55 help
56 Say Y here to include definitions of printascii, printchar, printhex
57 in the kernel. This is helpful if you are debugging code that
58 executes before the console is initialized.
59
60config DEBUG_ICEDCC
61 bool "Kernel low-level debugging via EmbeddedICE DCC channel"
62 depends on DEBUG_LL
63 help
64 Say Y here if you want the debug print routines to direct their
65 output to the EmbeddedICE macrocell's DCC channel using
66 co-processor 14. This is known to work on the ARM9 style ICE
67 channel.
68
69 It does include a timeout to ensure that the system does not
70 totally freeze when there is nothing connected to read.
71
72config DEBUG_DC21285_PORT
73 bool "Kernel low-level debugging messages via footbridge serial port"
74 depends on DEBUG_LL && FOOTBRIDGE
75 help
76 Say Y here if you want the debug print routines to direct their
77 output to the serial port in the DC21285 (Footbridge). Saying N
78 will cause the debug messages to appear on the first 16550
79 serial port.
80
81config DEBUG_CLPS711X_UART2
82 bool "Kernel low-level debugging messages via UART2"
83 depends on DEBUG_LL && ARCH_CLPS711X
84 help
85 Say Y here if you want the debug print routines to direct their
86 output to the second serial port on these devices. Saying N will
87 cause the debug messages to appear on the first serial port.
88
89config DEBUG_S3C2410_PORT
90 depends on DEBUG_LL && ARCH_S3C2410
91 bool "Kernel low-level debugging messages via S3C2410 UART"
92 help
93 Say Y here if you want debug print routines to go to one of the
94 S3C2410 internal UARTs. The chosen UART must have been configured
95 before it is used.
96
97config DEBUG_S3C2410_UART
98 depends on ARCH_S3C2410
99 int "S3C2410 UART to use for low-level debug"
100 default "0"
101 help
102 Choice for UART for kernel low-level using S3C2410 UARTS,
103 should be between zero and two. The port must have been
104 initalised by the boot-loader before use.
105
106 The uncompressor code port configuration is now handled
107 by CONFIG_S3C2410_LOWLEVEL_UART_PORT.
108
109endmenu
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
new file mode 100644
index 000000000000..2277e3d179cc
--- /dev/null
+++ b/arch/arm/Makefile
@@ -0,0 +1,216 @@
1#
2# arch/arm/Makefile
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) 1995-2001 by Russell King
9
10LDFLAGS_vmlinux :=-p --no-undefined -X
11CPPFLAGS_vmlinux.lds = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR)
12OBJCOPYFLAGS :=-O binary -R .note -R .comment -S
13GZFLAGS :=-9
14#CFLAGS +=-pipe
15
16# Do not use arch/arm/defconfig - it's always outdated.
17# Select a platform tht is kept up-to-date
18KBUILD_DEFCONFIG := versatile_defconfig
19
20ifeq ($(CONFIG_FRAME_POINTER),y)
21CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog
22endif
23
24ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
25CPPFLAGS += -mbig-endian
26AS += -EB
27LD += -EB
28else
29CPPFLAGS += -mlittle-endian
30AS += -EL
31LD += -EL
32endif
33
34comma = ,
35
36# This selects which instruction set is used.
37# Note that GCC does not numerically define an architecture version
38# macro, but instead defines a whole series of macros which makes
39# testing for a specific architecture or later rather impossible.
40arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
41arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4)
42arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4
43arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3
44
45# This selects how we optimise for the processor.
46tune-$(CONFIG_CPU_ARM610) :=-mtune=arm610
47tune-$(CONFIG_CPU_ARM710) :=-mtune=arm710
48tune-$(CONFIG_CPU_ARM720T) :=-mtune=arm7tdmi
49tune-$(CONFIG_CPU_ARM920T) :=-mtune=arm9tdmi
50tune-$(CONFIG_CPU_ARM922T) :=-mtune=arm9tdmi
51tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi
52tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi
53tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110
54tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100
55tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
56tune-$(CONFIG_CPU_V6) :=-mtune=strongarm
57
58# Need -Uarm for gcc < 3.x
59CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
60CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
61AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float
62
63CHECKFLAGS += -D__arm__
64
65#Default value
66head-y := arch/arm/kernel/head.o arch/arm/kernel/init_task.o
67textaddr-y := 0xC0008000
68
69 machine-$(CONFIG_ARCH_RPC) := rpc
70 machine-$(CONFIG_ARCH_EBSA110) := ebsa110
71 machine-$(CONFIG_ARCH_CLPS7500) := clps7500
72 incdir-$(CONFIG_ARCH_CLPS7500) := cl7500
73 machine-$(CONFIG_FOOTBRIDGE) := footbridge
74 incdir-$(CONFIG_FOOTBRIDGE) := ebsa285
75textaddr-$(CONFIG_ARCH_CO285) := 0x60008000
76 machine-$(CONFIG_ARCH_CO285) := footbridge
77 incdir-$(CONFIG_ARCH_CO285) := ebsa285
78 machine-$(CONFIG_ARCH_SHARK) := shark
79 machine-$(CONFIG_ARCH_SA1100) := sa1100
80ifeq ($(CONFIG_ARCH_SA1100),y)
81# SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
82textaddr-$(CONFIG_SA1111) := 0xc0208000
83endif
84 machine-$(CONFIG_ARCH_PXA) := pxa
85 machine-$(CONFIG_ARCH_L7200) := l7200
86 machine-$(CONFIG_ARCH_INTEGRATOR) := integrator
87 machine-$(CONFIG_ARCH_CAMELOT) := epxa10db
88textaddr-$(CONFIG_ARCH_CLPS711X) := 0xc0028000
89 machine-$(CONFIG_ARCH_CLPS711X) := clps711x
90textaddr-$(CONFIG_ARCH_FORTUNET) := 0xc0008000
91 machine-$(CONFIG_ARCH_IOP3XX) := iop3xx
92 machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx
93 machine-$(CONFIG_ARCH_IXP2000) := ixp2000
94 machine-$(CONFIG_ARCH_OMAP) := omap
95 machine-$(CONFIG_ARCH_S3C2410) := s3c2410
96 machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x
97 machine-$(CONFIG_ARCH_VERSATILE) := versatile
98 machine-$(CONFIG_ARCH_IMX) := imx
99 machine-$(CONFIG_ARCH_H720X) := h720x
100
101ifeq ($(CONFIG_ARCH_EBSA110),y)
102# This is what happens if you forget the IOCS16 line.
103# PCMCIA cards stop working.
104CFLAGS_3c589_cs.o :=-DISA_SIXTEEN_BIT_PERIPHERAL
105export CFLAGS_3c589_cs.o
106endif
107
108TEXTADDR := $(textaddr-y)
109ifeq ($(CONFIG_XIP_KERNEL),y)
110 DATAADDR := $(TEXTADDR)
111 xipaddr-$(CONFIG_ARCH_CO285) := 0x5f000000
112 xipaddr-y ?= 0xbf000000
113 # Replace phys addr with virt addr while keeping offset from base.
114 TEXTADDR := $(shell echo $(CONFIG_XIP_PHYS_ADDR) $(xipaddr-y) | \
115 awk --non-decimal-data '/[:xdigit:]/ \
116 { printf("0x%x\n", and($$1, 0x000fffff) + $$2) }' )
117endif
118
119ifeq ($(incdir-y),)
120incdir-y := $(machine-y)
121endif
122INCDIR := arch-$(incdir-y)
123ifneq ($(machine-y),)
124MACHINE := arch/arm/mach-$(machine-y)/
125else
126MACHINE :=
127endif
128
129export TEXTADDR DATAADDR GZFLAGS
130
131# Do we have FASTFPE?
132FASTFPE :=arch/arm/fastfpe
133ifeq ($(FASTFPE),$(wildcard $(FASTFPE)))
134FASTFPE_OBJ :=$(FASTFPE)/
135endif
136
137# If we have a machine-specific directory, then include it in the build.
138core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
139core-y += $(MACHINE)
140core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/
141core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ)
142core-$(CONFIG_VFP) += arch/arm/vfp/
143
144drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
145drivers-$(CONFIG_ARCH_CLPS7500) += drivers/acorn/char/
146drivers-$(CONFIG_ARCH_L7200) += drivers/acorn/char/
147
148libs-y += arch/arm/lib/
149
150# Default target when executing plain make
151ifeq ($(CONFIG_XIP_KERNEL),y)
152all: xipImage
153else
154all: zImage
155endif
156
157boot := arch/arm/boot
158
159# Update machine arch and proc symlinks if something which affects
160# them changed. We use .arch to indicate when they were updated
161# last, otherwise make uses the target directory mtime.
162
163include/asm-arm/.arch: $(wildcard include/config/arch/*.h) include/config/MARKER
164 @echo ' SYMLINK include/asm-arm/arch -> include/asm-arm/$(INCDIR)'
165ifneq ($(KBUILD_SRC),)
166 $(Q)mkdir -p include/asm-arm
167 $(Q)ln -fsn $(srctree)/include/asm-arm/$(INCDIR) include/asm-arm/arch
168else
169 $(Q)ln -fsn $(INCDIR) include/asm-arm/arch
170endif
171 @touch $@
172
173prepare: maketools include/asm-arm/.arch
174
175.PHONY: maketools FORCE
176maketools: include/asm-arm/constants.h include/linux/version.h FORCE
177 $(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h
178
179# Convert bzImage to zImage
180bzImage: zImage
181
182zImage Image xipImage bootpImage uImage: vmlinux
183 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
184
185zinstall install: vmlinux
186 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
187
188CLEAN_FILES += include/asm-arm/constants.h* include/asm-arm/mach-types.h \
189 include/asm-arm/arch include/asm-arm/.arch
190
191# We use MRPROPER_FILES and CLEAN_FILES now
192archclean:
193 $(Q)$(MAKE) $(clean)=$(boot)
194
195# My testing targets (bypasses dependencies)
196bp:; $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/bootpImage
197i zi:; $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
198
199arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
200 include/asm-arm/.arch
201
202include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s
203 $(call filechk,gen-asm-offsets)
204
205define archhelp
206 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
207 echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
208 echo '* xipImage - XIP kernel image, if configured (arch/$(ARCH)/boot/xipImage)'
209 echo ' bootpImage - Combined zImage and initial RAM disk'
210 echo ' (supply initrd image via make variable INITRD=<path>)'
211 echo ' install - Install uncompressed kernel'
212 echo ' zinstall - Install compressed kernel'
213 echo ' Install using (your) ~/bin/installkernel or'
214 echo ' (distribution) /sbin/installkernel or'
215 echo ' install to $$(INSTALL_PATH) and run lilo'
216endef
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
new file mode 100644
index 000000000000..937a353bc37c
--- /dev/null
+++ b/arch/arm/boot/Makefile
@@ -0,0 +1,91 @@
1#
2# arch/arm/boot/Makefile
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) 1995-2002 Russell King
9#
10
11MKIMAGE := $(srctree)/scripts/mkuboot.sh
12
13ifneq ($(MACHINE),)
14include $(srctree)/$(MACHINE)/Makefile.boot
15endif
16
17# Note: the following conditions must always be true:
18# ZRELADDR == virt_to_phys(TEXTADDR)
19# PARAMS_PHYS must be within 4MB of ZRELADDR
20# INITRD_PHYS must be in RAM
21ZRELADDR := $(zreladdr-y)
22PARAMS_PHYS := $(params_phys-y)
23INITRD_PHYS := $(initrd_phys-y)
24
25export ZRELADDR INITRD_PHYS PARAMS_PHYS
26
27targets := Image zImage xipImage bootpImage uImage
28
29ifeq ($(CONFIG_XIP_KERNEL),y)
30
31$(obj)/xipImage: vmlinux FORCE
32 $(call if_changed,objcopy)
33 @echo ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))'
34
35$(obj)/Image $(obj)/zImage: FORCE
36 @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
37 @echo 'Only the xipImage target is available in this case'
38 @false
39
40else
41
42$(obj)/xipImage: FORCE
43 @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
44 @false
45
46$(obj)/Image: vmlinux FORCE
47 $(call if_changed,objcopy)
48 @echo ' Kernel: $@ is ready'
49
50$(obj)/compressed/vmlinux: $(obj)/Image FORCE
51 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
52
53$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
54 $(call if_changed,objcopy)
55 @echo ' Kernel: $@ is ready'
56
57endif
58
59quiet_cmd_uimage = UIMAGE $@
60 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
61 -C none -a $(ZRELADDR) -e $(ZRELADDR) \
62 -n 'Linux-$(KERNELRELEASE)' -d $< $@
63
64$(obj)/uImage: $(obj)/zImage FORCE
65 $(call if_changed,uimage)
66 @echo ' Image $@ is ready'
67
68$(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
69 $(Q)$(MAKE) $(build)=$(obj)/bootp $@
70 @:
71
72$(obj)/bootpImage: $(obj)/bootp/bootp FORCE
73 $(call if_changed,objcopy)
74 @echo ' Kernel: $@ is ready'
75
76.PHONY: initrd FORCE
77initrd:
78 @test "$(INITRD_PHYS)" != "" || \
79 (echo This machine does not support INITRD; exit -1)
80 @test "$(INITRD)" != "" || \
81 (echo You must specify INITRD; exit -1)
82
83install: $(obj)/Image
84 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
85 $(obj)/Image System.map "$(INSTALL_PATH)"
86
87zinstall: $(obj)/zImage
88 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
89 $(obj)/zImage System.map "$(INSTALL_PATH)"
90
91subdir- := bootp compressed
diff --git a/arch/arm/boot/bootp/Makefile b/arch/arm/boot/bootp/Makefile
new file mode 100644
index 000000000000..8e8879b6b3d7
--- /dev/null
+++ b/arch/arm/boot/bootp/Makefile
@@ -0,0 +1,24 @@
1#
2# linux/arch/arm/boot/bootp/Makefile
3#
4
5LDFLAGS_bootp :=-p --no-undefined -X \
6 --defsym initrd_phys=$(INITRD_PHYS) \
7 --defsym params_phys=$(PARAMS_PHYS) -T
8AFLAGS_initrd.o :=-DINITRD=\"$(INITRD)\"
9
10targets := bootp init.o kernel.o initrd.o
11
12# Note that bootp.lds picks up kernel.o and initrd.o
13$(obj)/bootp: $(src)/bootp.lds $(addprefix $(obj)/,init.o kernel.o initrd.o) FORCE
14 $(call if_changed,ld)
15 @:
16
17# kernel.o and initrd.o includes a binary image using
18# .incbin, a dependency which is not tracked automatically
19
20$(obj)/kernel.o: arch/arm/boot/zImage FORCE
21
22$(obj)/initrd.o: $(INITRD) FORCE
23
24.PHONY: $(INITRD) FORCE
diff --git a/arch/arm/boot/bootp/bootp.lds b/arch/arm/boot/bootp/bootp.lds
new file mode 100644
index 000000000000..8e3d81ce695e
--- /dev/null
+++ b/arch/arm/boot/bootp/bootp.lds
@@ -0,0 +1,30 @@
1/*
2 * linux/arch/arm/boot/bootp/bootp.lds
3 *
4 * Copyright (C) 2000-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10OUTPUT_ARCH(arm)
11ENTRY(_start)
12SECTIONS
13{
14 . = 0;
15 .text : {
16 _stext = .;
17 *(.start)
18 *(.text)
19 initrd_size = initrd_end - initrd_start;
20 _etext = .;
21 }
22
23 .stab 0 : { *(.stab) }
24 .stabstr 0 : { *(.stabstr) }
25 .stab.excl 0 : { *(.stab.excl) }
26 .stab.exclstr 0 : { *(.stab.exclstr) }
27 .stab.index 0 : { *(.stab.index) }
28 .stab.indexstr 0 : { *(.stab.indexstr) }
29 .comment 0 : { *(.comment) }
30}
diff --git a/arch/arm/boot/bootp/init.S b/arch/arm/boot/bootp/init.S
new file mode 100644
index 000000000000..df7bc7068d0f
--- /dev/null
+++ b/arch/arm/boot/bootp/init.S
@@ -0,0 +1,86 @@
1/*
2 * linux/arch/arm/boot/bootp/init.S
3 *
4 * Copyright (C) 2000-2003 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * "Header" file for splitting kernel + initrd. Note that we pass
11 * r0 through to r3 straight through.
12 *
13 * This demonstrates how to append code to the start of the kernel
14 * zImage, and boot the kernel without copying it around. This
15 * example would be simpler; if we didn't have an object of unknown
16 * size immediately following the kernel, we could build this into
17 * a binary blob, and concatenate the zImage using the cat command.
18 */
19 .section .start,#alloc,#execinstr
20 .type _start, #function
21 .globl _start
22
23_start: add lr, pc, #-0x8 @ lr = current load addr
24 adr r13, data
25 ldmia r13!, {r4-r6} @ r5 = dest, r6 = length
26 add r4, r4, lr @ r4 = initrd_start + load addr
27 bl move @ move the initrd
28
29/*
30 * Setup the initrd parameters to pass to the kernel. This can only be
31 * passed in via the tagged list.
32 */
33 ldmia r13, {r5-r9} @ get size and addr of initrd
34 @ r5 = ATAG_CORE
35 @ r6 = ATAG_INITRD2
36 @ r7 = initrd start
37 @ r8 = initrd end
38 @ r9 = param_struct address
39
40 ldr r10, [r9, #4] @ get first tag
41 teq r10, r5 @ is it ATAG_CORE?
42/*
43 * If we didn't find a valid tag list, create a dummy ATAG_CORE entry.
44 */
45 movne r10, #0 @ terminator
46 movne r4, #2 @ Size of this entry (2 words)
47 stmneia r9, {r4, r5, r10} @ Size, ATAG_CORE, terminator
48
49/*
50 * find the end of the tag list, and then add an INITRD tag on the end.
51 * If there is already an INITRD tag, then we ignore it; the last INITRD
52 * tag takes precidence.
53 */
54taglist: ldr r10, [r9, #0] @ tag length
55 teq r10, #0 @ last tag (zero length)?
56 addne r9, r9, r10, lsl #2
57 bne taglist
58
59 mov r5, #4 @ Size of initrd tag (4 words)
60 stmia r9, {r5, r6, r7, r8, r10}
61 b kernel_start @ call kernel
62
63/*
64 * Move the block of memory length r6 from address r4 to address r5
65 */
66move: ldmia r4!, {r7 - r10} @ move 32-bytes at a time
67 stmia r5!, {r7 - r10}
68 ldmia r4!, {r7 - r10}
69 stmia r5!, {r7 - r10}
70 subs r6, r6, #8 * 4
71 bcs move
72 mov pc, lr
73
74 .size _start, . - _start
75
76 .type data,#object
77data: .word initrd_start @ source initrd address
78 .word initrd_phys @ destination initrd address
79 .word initrd_size @ initrd size
80
81 .word 0x54410001 @ r5 = ATAG_CORE
82 .word 0x54420005 @ r6 = ATAG_INITRD2
83 .word initrd_phys @ r7
84 .word initrd_size @ r8
85 .word params_phys @ r9
86 .size data, . - data
diff --git a/arch/arm/boot/bootp/initrd.S b/arch/arm/boot/bootp/initrd.S
new file mode 100644
index 000000000000..d81ea183785c
--- /dev/null
+++ b/arch/arm/boot/bootp/initrd.S
@@ -0,0 +1,6 @@
1 .type initrd_start,#object
2 .globl initrd_start
3initrd_start:
4 .incbin INITRD
5 .globl initrd_end
6initrd_end:
diff --git a/arch/arm/boot/bootp/kernel.S b/arch/arm/boot/bootp/kernel.S
new file mode 100644
index 000000000000..b87a25c7ef88
--- /dev/null
+++ b/arch/arm/boot/bootp/kernel.S
@@ -0,0 +1,6 @@
1 .globl kernel_start
2kernel_start:
3 .incbin "arch/arm/boot/zImage"
4 .globl kernel_end
5kernel_end:
6 .align 2
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
new file mode 100644
index 000000000000..6b505ce41a75
--- /dev/null
+++ b/arch/arm/boot/compressed/Makefile
@@ -0,0 +1,114 @@
1#
2# linux/arch/arm/boot/compressed/Makefile
3#
4# create a compressed vmlinuz image from the original vmlinux
5#
6
7HEAD = head.o
8OBJS = misc.o
9FONTC = drivers/video/console/font_acorn_8x8.c
10
11FONT = $(addprefix ../../../../drivers/video/console/, font_acorn_8x8.o)
12
13#
14# Architecture dependencies
15#
16ifeq ($(CONFIG_ARCH_ACORN),y)
17OBJS += ll_char_wr.o $(FONT)
18endif
19
20ifeq ($(CONFIG_ARCH_SHARK),y)
21OBJS += head-shark.o ofw-shark.o
22endif
23
24ifeq ($(CONFIG_ARCH_CAMELOT),y)
25OBJS += head-epxa10db.o
26endif
27
28ifeq ($(CONFIG_ARCH_L7200),y)
29OBJS += head-l7200.o
30endif
31
32ifeq ($(CONFIG_ARCH_CLPS7500),y)
33HEAD = head-clps7500.o
34endif
35
36ifeq ($(CONFIG_ARCH_P720T),y)
37# Borrow this code from SA1100
38OBJS += head-sa1100.o
39endif
40
41ifeq ($(CONFIG_ARCH_SA1100),y)
42OBJS += head-sa1100.o
43endif
44
45ifeq ($(CONFIG_CPU_XSCALE),y)
46OBJS += head-xscale.o
47endif
48
49ifeq ($(CONFIG_PXA_SHARPSL),y)
50OBJS += head-sharpsl.o
51endif
52
53ifeq ($(CONFIG_DEBUG_ICEDCC),y)
54OBJS += ice-dcc.o
55endif
56
57ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
58OBJS += big-endian.o
59endif
60
61#
62# We now have a PIC decompressor implementation. Decompressors running
63# from RAM should not define ZTEXTADDR. Decompressors running directly
64# from ROM or Flash must define ZTEXTADDR (preferably via the config)
65# FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
66ifeq ($(CONFIG_ZBOOT_ROM),y)
67ZTEXTADDR := $(CONFIG_ZBOOT_ROM_TEXT)
68ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS)
69else
70ZTEXTADDR := 0
71ZBSSADDR := ALIGN(4)
72endif
73
74SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
75
76targets := vmlinux vmlinux.lds piggy.gz piggy.o $(FONT) \
77 head.o misc.o $(OBJS)
78EXTRA_CFLAGS := -fpic
79EXTRA_AFLAGS :=
80
81# Supply ZRELADDR, INITRD_PHYS and PARAMS_PHYS to the decompressor via
82# linker symbols. We only define initrd_phys and params_phys if the
83# machine class defined the corresponding makefile variable.
84LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
85ifneq ($(INITRD_PHYS),)
86LDFLAGS_vmlinux += --defsym initrd_phys=$(INITRD_PHYS)
87endif
88ifneq ($(PARAMS_PHYS),)
89LDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS)
90endif
91LDFLAGS_vmlinux += -p --no-undefined -X \
92 $(shell $(CC) $(CFLAGS) --print-libgcc-file-name) -T
93
94# Don't allow any static data in misc.o, which
95# would otherwise mess up our GOT table
96CFLAGS_misc.o := -Dstatic=
97
98$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \
99 $(addprefix $(obj)/, $(OBJS)) FORCE
100 $(call if_changed,ld)
101 @:
102
103$(obj)/piggy.gz: $(obj)/../Image FORCE
104 $(call if_changed,gzip)
105
106$(obj)/piggy.o: $(obj)/piggy.gz FORCE
107
108CFLAGS_font_acorn_8x8.o := -Dstatic=
109
110$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config
111 @sed "$(SEDFLAGS)" < $< > $@
112
113$(obj)/misc.o: $(obj)/misc.c include/asm/arch/uncompress.h lib/inflate.c
114
diff --git a/arch/arm/boot/compressed/Makefile.debug b/arch/arm/boot/compressed/Makefile.debug
new file mode 100644
index 000000000000..491a037b2973
--- /dev/null
+++ b/arch/arm/boot/compressed/Makefile.debug
@@ -0,0 +1,23 @@
1#
2# linux/arch/arm/boot/compressed/Makefile
3#
4# create a compressed vmlinux image from the original vmlinux
5#
6
7COMPRESSED_EXTRA=../../lib/ll_char_wr.o
8OBJECTS=misc-debug.o ll_char_wr.aout.o
9
10CFLAGS=-D__KERNEL__ -O2 -DSTDC_HEADERS -DSTANDALONE_DEBUG -Wall -I../../../../include -c
11
12test-gzip: piggy.aout.o $(OBJECTS)
13 $(CC) -o $@ $(OBJECTS) piggy.aout.o
14
15misc-debug.o: misc.c
16 $(CC) $(CFLAGS) -o $@ misc.c
17
18piggy.aout.o: piggy.o
19 arm-linuxelf-objcopy --change-leading-char -I elf32-arm -O arm-aout32-linux piggy.o piggy.aout.o
20
21ll_char_wr.aout.o: $(COMPRESSED_EXTRA)
22 arm-linuxelf-objcopy --change-leading-char -I elf32-arm -O arm-aout32-linux $(COMPRESSED_EXTRA) ll_char_wr.aout.o
23
diff --git a/arch/arm/boot/compressed/big-endian.S b/arch/arm/boot/compressed/big-endian.S
new file mode 100644
index 000000000000..25ab26f1c6f0
--- /dev/null
+++ b/arch/arm/boot/compressed/big-endian.S
@@ -0,0 +1,13 @@
1/*
2 * linux/arch/arm/boot/compressed/big-endian.S
3 *
4 * Switch CPU into big endian mode.
5 * Author: Nicolas Pitre
6 */
7
8 .section ".start", #alloc, #execinstr
9
10 mrc p15, 0, r0, c1, c0, 0 @ read control reg
11 orr r0, r0, #(1 << 7) @ enable big endian mode
12 mcr p15, 0, r0, c1, c0, 0 @ write control reg
13
diff --git a/arch/arm/boot/compressed/head-clps7500.S b/arch/arm/boot/compressed/head-clps7500.S
new file mode 100644
index 000000000000..4a8a689d15e6
--- /dev/null
+++ b/arch/arm/boot/compressed/head-clps7500.S
@@ -0,0 +1,87 @@
1/*
2 * linux/arch/arm/boot/compressed/head.S
3 *
4 * Copyright (C) 1999, 2000, 2001 Nexus Electronics Ltd
5 */
6
7#include <linux/config.h>
8
9 /* There are three different ways the kernel can be
10 booted on a 7500 system: from Angel (loaded in RAM), from
11 16-bit ROM or from 32-bit Flash. Luckily, a single kernel
12 image does for them all. */
13 /* This branch is taken if the CPU memory width matches the
14 actual device in use. The default at power on is 16 bits
15 so we must be prepared for a mismatch. */
16 .section ".start", "ax"
172:
18 b 1f
19 .word 0xffff
20 .word 0xb632 @ mov r11, #0x03200000
21 .word 0xe3a0
22 .word 0x0000 @ mov r0, #0
23 .word 0xe3a0
24 .word 0x0080 @ strb r0, [r11, #0x80]
25 .word 0xe5cb
26 .word 0xf000 @ mov pc, #0
27 .word 0xe3a0
281:
29 adr r1, 2b
30 teq r1, #0
31 bne .Langel
32 /* This is a direct-from-ROM boot. Copy the kernel into
33 RAM and run it there. */
34 mov r0, #0x30
35 mcr p15, 0, r0, c1, c0, 0
36 mov r0, #0x13
37 msr cpsr_cxsf, r0
38 mov r12, #0x03000000 @ point to LEDs
39 orr r12, r12, #0x00020000
40 orr r12, r12, #0xba00
41 mov r0, #0x5500
42 str r0, [r12]
43 mov r0, #0x10000000
44 orr r0, r0, #0x8000
45 mov r4, r0
46 ldr r2, =_end
472:
48 ldr r3, [r1], #4
49 str r3, [r0], #4
50 teq r0, r2
51 bne 2b
52 mov r0, #0xff00
53 str r0, [r12]
541:
55 mov r12, #0x03000000 @ point to LEDs
56 orr r12, r12, #0x00020000
57 orr r12, r12, #0xba00
58 mov r0, #0xfe00
59 str r0, [r12]
60
61 adr lr, 1f
62 mov r0, #0
63 mov r1, #14 /* MACH_TYPE_CLPS7500 */
64 mov pc, lr
65.Langel:
66#ifdef CONFIG_ANGELBOOT
67 /* Call Angel to switch into SVC mode. */
68 mov r0, #0x17
69 swi 0x123456
70#endif
71 /* Ensure all interrupts are off and MMU disabled */
72 mrs r0, cpsr
73 orr r0, r0, #0xc0
74 msr cpsr_cxsf, r0
75
76 adr lr, 1b
77 orr lr, lr, #0x10000000
78 mov r0, #0x30 @ MMU off
79 mcr p15, 0, r0, c1, c0, 0
80 mov r0, r0
81 mov pc, lr
82
83 .ltorg
84
851:
86/* And the rest */
87#include "head.S"
diff --git a/arch/arm/boot/compressed/head-epxa10db.S b/arch/arm/boot/compressed/head-epxa10db.S
new file mode 100644
index 000000000000..757681f12a39
--- /dev/null
+++ b/arch/arm/boot/compressed/head-epxa10db.S
@@ -0,0 +1,5 @@
1#include <asm/mach-types.h>
2#include <asm/arch/excalibur.h>
3
4 .section ".start", "ax"
5 mov r7, #MACH_TYPE_CAMELOT
diff --git a/arch/arm/boot/compressed/head-l7200.S b/arch/arm/boot/compressed/head-l7200.S
new file mode 100644
index 000000000000..b08bd23f8d16
--- /dev/null
+++ b/arch/arm/boot/compressed/head-l7200.S
@@ -0,0 +1,30 @@
1/*
2 * linux/arch/arm/boot/compressed/head-l7200.S
3 *
4 * Copyright (C) 2000 Steve Hill <sjhill@cotw.com>
5 *
6 * Some code borrowed from Nicolas Pitre's 'head-sa1100.S' file. This
7 * is merged with head.S by the linker.
8 */
9
10#include <linux/config.h>
11#include <asm/mach-types.h>
12
13#ifndef CONFIG_ARCH_L7200
14#error What am I doing here...
15#endif
16
17 .section ".start", "ax"
18
19__L7200_start:
20 mov r0, #0x00100000 @ FLASH address of initrd
21 mov r2, #0xf1000000 @ RAM address of initrd
22 add r3, r2, #0x00700000 @ Size of initrd
231:
24 ldmia r0!, {r4, r5, r6, r7}
25 stmia r2!, {r4, r5, r6, r7}
26 cmp r2, r3
27 ble 1b
28
29 mov r8, #0 @ Zero it out
30 mov r7, #MACH_TYPE_L7200 @ Set architecture ID
diff --git a/arch/arm/boot/compressed/head-sa1100.S b/arch/arm/boot/compressed/head-sa1100.S
new file mode 100644
index 000000000000..5aefffd46048
--- /dev/null
+++ b/arch/arm/boot/compressed/head-sa1100.S
@@ -0,0 +1,48 @@
1/*
2 * linux/arch/arm/boot/compressed/head-sa1100.S
3 *
4 * Copyright (C) 1999 Nicolas Pitre <nico@cam.org>
5 *
6 * SA1100 specific tweaks. This is merged into head.S by the linker.
7 *
8 */
9
10#include <linux/config.h>
11#include <linux/linkage.h>
12#include <asm/mach-types.h>
13
14 .section ".start", "ax"
15
16__SA1100_start:
17
18 @ Preserve r8/r7 i.e. kernel entry values
19#ifdef CONFIG_SA1100_COLLIE
20 mov r7, #MACH_TYPE_COLLIE
21#endif
22#ifdef CONFIG_SA1100_SIMPAD
23 @ UNTIL we've something like an open bootldr
24 mov r7, #MACH_TYPE_SIMPAD @should be 87
25#endif
26 mrc p15, 0, r0, c1, c0, 0 @ read control reg
27 ands r0, r0, #0x0d
28 beq 99f
29
30 @ Data cache might be active.
31 @ Be sure to flush kernel binary out of the cache,
32 @ whatever state it is, before it is turned off.
33 @ This is done by fetching through currently executed
34 @ memory to be sure we hit the same cache.
35 bic r2, pc, #0x1f
36 add r3, r2, #0x4000 @ 16 kb is quite enough...
371: ldr r0, [r2], #32
38 teq r2, r3
39 bne 1b
40 mcr p15, 0, r0, c7, c10, 4 @ drain WB
41 mcr p15, 0, r0, c7, c7, 0 @ flush I & D caches
42
43 @ disabling MMU and caches
44 mrc p15, 0, r0, c1, c0, 0 @ read control reg
45 bic r0, r0, #0x0d @ clear WB, DC, MMU
46 bic r0, r0, #0x1000 @ clear Icache
47 mcr p15, 0, r0, c1, c0, 0
4899:
diff --git a/arch/arm/boot/compressed/head-shark.S b/arch/arm/boot/compressed/head-shark.S
new file mode 100644
index 000000000000..848f60e5429b
--- /dev/null
+++ b/arch/arm/boot/compressed/head-shark.S
@@ -0,0 +1,115 @@
1/* The head-file for the Shark
2 * by Alexander Schulz
3 *
4 * Does the following:
5 * - get the memory layout from firmware. This can only be done as long as the mmu
6 * is still on.
7 * - switch the mmu off, so we have physical addresses
8 * - copy the kernel to 0x08508000. This is done to have a fixed address where the
9 * C-parts (misc.c) are executed. This address must be known at compile-time,
10 * but the load-address of the kernel depends on how much memory is installed.
11 * - Jump to this location.
12 * - Set r8 with 0, r7 with the architecture ID for head.S
13 */
14
15#include <linux/linkage.h>
16
17#include <asm/assembler.h>
18
19 .section ".start", "ax"
20
21 b __beginning
22
23__ofw_data: .long 0 @ the number of memory blocks
24 .space 128 @ (startaddr,size) ...
25 .space 128 @ bootargs
26 .align
27
28__beginning: mov r4, r0 @ save the entry to the firmware
29
30 mov r0, #0xC0 @ disable irq and fiq
31 mov r1, r0
32 mrs r3, cpsr
33 bic r2, r3, r0
34 eor r2, r2, r1
35 msr cpsr_c, r2
36
37 mov r0, r4 @ get the Memory layout from firmware
38 adr r1, __ofw_data
39 add r2, r1, #4
40 mov lr, pc
41 b ofw_init
42 mov r1, #0
43
44 adr r2, __mmu_off @ calculate physical address
45 sub r2, r2, #0xf0000000 @ openprom maps us at f000 virt, 0e50 phys
46 adr r0, __ofw_data
47 ldr r0, [r0, #4]
48 add r2, r2, r0
49 add r2, r2, #0x00500000
50
51 mrc p15, 0, r3, c1, c0
52 bic r3, r3, #0xC @ Write Buffer and DCache
53 bic r3, r3, #0x1000 @ ICache
54 mcr p15, 0, r3, c1, c0 @ disabled
55
56 mov r0, #0
57 mcr p15, 0, r0, c7, c7 @ flush I,D caches on v4
58 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
59 mcr p15, 0, r0, c8, c7 @ flush I,D TLBs on v4
60
61 bic r3, r3, #0x1 @ MMU
62 mcr p15, 0, r3, c1, c0 @ disabled
63
64 mov pc, r2
65
66__copy_target: .long 0x08508000
67__copy_end: .long 0x08608000
68
69 .word _start
70 .word __bss_start
71
72 .align
73__temp_stack: .space 128
74
75__mmu_off:
76 adr r0, __ofw_data
77 ldr r0, [r0, #4]
78 orr r0, r0, #0x00600000
79
80 ldr r1, __copy_end
81 ldr r3, __copy_target
82
83/* r0 = 0x0e600000 (current end of kernelcode)
84 * r3 = 0x08508000 (where it should begin)
85 * r1 = 0x08608000 (end of copying area, 1MB)
86 * The kernel is compressed, so 1 MB should be enough.
87 * copy the kernel to the beginning of physical memory
88 * We start from the highest address, so we can copy
89 * from 0x08500000 to 0x08508000 if we have only 8MB
90 */
91
92
93__Copy: ldr r2, [r0], #-4
94 str r2, [r1], #-4
95 teq r1, r3
96 bne __Copy
97 /* and jump to it */
98 adr r2, __go_on
99 adr r0, __ofw_data
100 ldr r0, [r0, #4]
101 sub r2, r2, r0
102 sub r2, r2, #0x00500000
103 ldr r0, __copy_target
104 add r2, r2, r0
105 mov pc, r2
106
107__go_on:
108 adr sp, __temp_stack
109 add sp, sp, #128
110 adr r0, __ofw_data
111 mov lr, pc
112 b create_params
113
114 mov r8, #0
115 mov r7, #15
diff --git a/arch/arm/boot/compressed/head-sharpsl.S b/arch/arm/boot/compressed/head-sharpsl.S
new file mode 100644
index 000000000000..d6bf8a2b090d
--- /dev/null
+++ b/arch/arm/boot/compressed/head-sharpsl.S
@@ -0,0 +1,92 @@
1/*
2 * linux/arch/arm/boot/compressed/head-sharpsl.S
3 *
4 * Copyright (C) 2004-2005 Richard Purdie <rpurdie@rpsys.net>
5 *
6 * Sharp's bootloader doesn't pass any kind of machine ID
7 * so we have to figure out the machine for ourselves...
8 *
9 * Support for Poodle, Corgi (SL-C700), Shepherd (SL-C750)
10 * and Husky (SL-C760).
11 *
12 */
13
14#include <linux/config.h>
15#include <linux/linkage.h>
16#include <asm/mach-types.h>
17
18#ifndef CONFIG_PXA_SHARPSL
19#error What am I doing here...
20#endif
21
22 .section ".start", "ax"
23
24__SharpSL_start:
25
26 ldr r1, .W100ADDR @ Base address of w100 chip + regs offset
27
28 mov r6, #0x31 @ Load Magic Init value
29 str r6, [r1, #0x280] @ to SCRATCH_UMSK
30 mov r5, #0x3000
31.W100LOOP:
32 subs r5, r5, #1
33 bne .W100LOOP
34 mov r6, #0x30 @ Load 2nd Magic Init value
35 str r6, [r1, #0x280] @ to SCRATCH_UMSK
36
37 ldr r6, [r1, #0] @ Load Chip ID
38 ldr r3, .W100ID
39 ldr r7, .POODLEID
40 cmp r6, r3
41 bne .SHARPEND @ We have no w100 - Poodle
42
43 mrc p15, 0, r6, c0, c0 @ Get Processor ID
44 and r6, r6, #0xffffff00
45 ldr r7, .CORGIID
46 ldr r3, .PXA255ID
47 cmp r6, r3
48 blo .SHARPEND @ We have a PXA250 - Corgi
49
50 mov r1, #0x0c000000 @ Base address of NAND chip
51 ldrb r3, [r1, #24] @ Load FLASHCTL
52 bic r3, r3, #0x11 @ SET NCE
53 orr r3, r3, #0x0a @ SET CLR + FLWP
54 strb r3, [r1, #24] @ Save to FLASHCTL
55 mov r2, #0x90 @ Command "readid"
56 strb r2, [r1, #20] @ Save to FLASHIO
57 bic r3, r3, #2 @ CLR CLE
58 orr r3, r3, #4 @ SET ALE
59 strb r3, [r1, #24] @ Save to FLASHCTL
60 mov r2, #0 @ Address 0x00
61 strb r2, [r1, #20] @ Save to FLASHIO
62 bic r3, r3, #4 @ CLR ALE
63 strb r3, [r1, #24] @ Save to FLASHCTL
64.SHARP1:
65 ldrb r3, [r1, #24] @ Load FLASHCTL
66 tst r3, #32 @ Is chip ready?
67 beq .SHARP1
68 ldrb r2, [r1, #20] @ NAND Manufacturer ID
69 ldrb r3, [r1, #20] @ NAND Chip ID
70 ldr r7, .SHEPHERDID
71 cmp r3, #0x76 @ 64MiB flash
72 beq .SHARPEND @ We have Shepherd
73 ldr r7, .HUSKYID @ Must be Husky
74 b .SHARPEND
75
76.PXA255ID:
77 .word 0x69052d00 @ PXA255 Processor ID
78.W100ID:
79 .word 0x57411002 @ w100 Chip ID
80.W100ADDR:
81 .word 0x08010000 @ w100 Chip ID Reg Address
82.POODLEID:
83 .word MACH_TYPE_POODLE
84.CORGIID:
85 .word MACH_TYPE_CORGI
86.SHEPHERDID:
87 .word MACH_TYPE_SHEPHERD
88.HUSKYID:
89 .word MACH_TYPE_HUSKY
90.SHARPEND:
91
92
diff --git a/arch/arm/boot/compressed/head-xscale.S b/arch/arm/boot/compressed/head-xscale.S
new file mode 100644
index 000000000000..665bd2c20743
--- /dev/null
+++ b/arch/arm/boot/compressed/head-xscale.S
@@ -0,0 +1,49 @@
1/*
2 * linux/arch/arm/boot/compressed/head-xscale.S
3 *
4 * XScale specific tweaks. This is merged into head.S by the linker.
5 *
6 */
7
8#include <linux/config.h>
9#include <linux/linkage.h>
10#include <asm/mach-types.h>
11
12 .section ".start", "ax"
13
14__XScale_start:
15
16 @ Preserve r8/r7 i.e. kernel entry values
17
18 @ Data cache might be active.
19 @ Be sure to flush kernel binary out of the cache,
20 @ whatever state it is, before it is turned off.
21 @ This is done by fetching through currently executed
22 @ memory to be sure we hit the same cache.
23 bic r2, pc, #0x1f
24 add r3, r2, #0x10000 @ 64 kb is quite enough...
251: ldr r0, [r2], #32
26 teq r2, r3
27 bne 1b
28 mcr p15, 0, r0, c7, c10, 4 @ drain WB
29 mcr p15, 0, r0, c7, c7, 0 @ flush I & D caches
30
31 @ disabling MMU and caches
32 mrc p15, 0, r0, c1, c0, 0 @ read control reg
33 bic r0, r0, #0x05 @ clear DC, MMU
34 bic r0, r0, #0x1000 @ clear Icache
35 mcr p15, 0, r0, c1, c0, 0
36
37#ifdef CONFIG_ARCH_LUBBOCK
38 mov r7, #MACH_TYPE_LUBBOCK
39#endif
40
41#ifdef CONFIG_ARCH_COTULLA_IDP
42 mov r7, #MACH_TYPE_COTULLA_IDP
43#endif
44
45#ifdef CONFIG_MACH_GTWX5715
46 mov r7, #(MACH_TYPE_GTWX5715 & 0xff)
47 orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00)
48#endif
49
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
new file mode 100644
index 000000000000..c0e7aff3dec2
--- /dev/null
+++ b/arch/arm/boot/compressed/head.S
@@ -0,0 +1,786 @@
1/*
2 * linux/arch/arm/boot/compressed/head.S
3 *
4 * Copyright (C) 1996-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/config.h>
11#include <linux/linkage.h>
12
13/*
14 * Debugging stuff
15 *
16 * Note that these macros must not contain any code which is not
17 * 100% relocatable. Any attempt to do so will result in a crash.
18 * Please select one of the following when turning on debugging.
19 */
20#ifdef DEBUG
21#if defined(CONFIG_DEBUG_DC21285_PORT)
22 .macro loadsp, rb
23 mov \rb, #0x42000000
24 .endm
25 .macro writeb, rb
26 str \rb, [r3, #0x160]
27 .endm
28#elif defined(CONFIG_DEBUG_ICEDCC)
29 .macro loadsp, rb
30 .endm
31 .macro writeb, rb
32 mcr p14, 0, \rb, c0, c1, 0
33 .endm
34#elif defined(CONFIG_FOOTBRIDGE)
35 .macro loadsp, rb
36 mov \rb, #0x7c000000
37 .endm
38 .macro writeb, rb
39 strb \rb, [r3, #0x3f8]
40 .endm
41#elif defined(CONFIG_ARCH_RPC)
42 .macro loadsp, rb
43 mov \rb, #0x03000000
44 orr \rb, \rb, #0x00010000
45 .endm
46 .macro writeb, rb
47 strb \rb, [r3, #0x3f8 << 2]
48 .endm
49#elif defined(CONFIG_ARCH_INTEGRATOR)
50 .macro loadsp, rb
51 mov \rb, #0x16000000
52 .endm
53 .macro writeb, rb
54 strb \rb, [r3, #0]
55 .endm
56#elif defined(CONFIG_ARCH_PXA) /* Xscale-type */
57 .macro loadsp, rb
58 mov \rb, #0x40000000
59 orr \rb, \rb, #0x00100000
60 .endm
61 .macro writeb, rb
62 strb \rb, [r3, #0]
63 .endm
64#elif defined(CONFIG_ARCH_SA1100)
65 .macro loadsp, rb
66 mov \rb, #0x80000000 @ physical base address
67# if defined(CONFIG_DEBUG_LL_SER3)
68 add \rb, \rb, #0x00050000 @ Ser3
69# else
70 add \rb, \rb, #0x00010000 @ Ser1
71# endif
72 .endm
73 .macro writeb, rb
74 str \rb, [r3, #0x14] @ UTDR
75 .endm
76#elif defined(CONFIG_ARCH_IXP4XX)
77 .macro loadsp, rb
78 mov \rb, #0xc8000000
79 .endm
80 .macro writeb, rb
81 str \rb, [r3, #0]
82#elif defined(CONFIG_ARCH_IXP2000)
83 .macro loadsp, rb
84 mov \rb, #0xc0000000
85 orr \rb, \rb, #0x00030000
86 .endm
87 .macro writeb, rb
88 str \rb, [r3, #0]
89 .endm
90#elif defined(CONFIG_ARCH_LH7A40X)
91 .macro loadsp, rb
92 ldr \rb, =0x80000700 @ UART2 UARTBASE
93 .endm
94 .macro writeb, rb
95 strb \rb, [r3, #0]
96 .endm
97#elif defined(CONFIG_ARCH_OMAP)
98 .macro loadsp, rb
99 mov \rb, #0xff000000 @ physical base address
100 add \rb, \rb, #0x00fb0000
101#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
102 add \rb, \rb, #0x00000800
103#endif
104#ifdef CONFIG_OMAP_LL_DEBUG_UART3
105 add \rb, \rb, #0x00009000
106#endif
107 .endm
108 .macro writeb, rb
109 strb \rb, [r3]
110 .endm
111#elif defined(CONFIG_ARCH_IOP331)
112 .macro loadsp, rb
113 mov \rb, #0xff000000
114 orr \rb, \rb, #0x00ff0000
115 orr \rb, \rb, #0x0000f700 @ location of the UART
116 .endm
117 .macro writeb, rb
118 str \rb, [r3, #0]
119 .endm
120#elif defined(CONFIG_ARCH_S3C2410)
121 .macro loadsp, rb
122 mov \rb, #0x50000000
123 add \rb, \rb, #0x4000 * CONFIG_S3C2410_LOWLEVEL_UART_PORT
124 .endm
125 .macro writeb, rb
126 strb \rb, [r3, #0x20]
127 .endm
128#else
129#error no serial architecture defined
130#endif
131#endif
132
133 .macro kputc,val
134 mov r0, \val
135 bl putc
136 .endm
137
138 .macro kphex,val,len
139 mov r0, \val
140 mov r1, #\len
141 bl phex
142 .endm
143
144 .macro debug_reloc_start
145#ifdef DEBUG
146 kputc #'\n'
147 kphex r6, 8 /* processor id */
148 kputc #':'
149 kphex r7, 8 /* architecture id */
150 kputc #':'
151 mrc p15, 0, r0, c1, c0
152 kphex r0, 8 /* control reg */
153 kputc #'\n'
154 kphex r5, 8 /* decompressed kernel start */
155 kputc #'-'
156 kphex r8, 8 /* decompressed kernel end */
157 kputc #'>'
158 kphex r4, 8 /* kernel execution address */
159 kputc #'\n'
160#endif
161 .endm
162
163 .macro debug_reloc_end
164#ifdef DEBUG
165 kphex r5, 8 /* end of kernel */
166 kputc #'\n'
167 mov r0, r4
168 bl memdump /* dump 256 bytes at start of kernel */
169#endif
170 .endm
171
172 .section ".start", #alloc, #execinstr
173/*
174 * sort out different calling conventions
175 */
176 .align
177start:
178 .type start,#function
179 .rept 8
180 mov r0, r0
181 .endr
182
183 b 1f
184 .word 0x016f2818 @ Magic numbers to help the loader
185 .word start @ absolute load/run zImage address
186 .word _edata @ zImage end address
1871: mov r7, r1 @ save architecture ID
188 mov r8, #0 @ save r0
189
190#ifndef __ARM_ARCH_2__
191 /*
192 * Booting from Angel - need to enter SVC mode and disable
193 * FIQs/IRQs (numeric definitions from angel arm.h source).
194 * We only do this if we were in user mode on entry.
195 */
196 mrs r2, cpsr @ get current mode
197 tst r2, #3 @ not user?
198 bne not_angel
199 mov r0, #0x17 @ angel_SWIreason_EnterSVC
200 swi 0x123456 @ angel_SWI_ARM
201not_angel:
202 mrs r2, cpsr @ turn off interrupts to
203 orr r2, r2, #0xc0 @ prevent angel from running
204 msr cpsr_c, r2
205#else
206 teqp pc, #0x0c000003 @ turn off interrupts
207#endif
208
209 /*
210 * Note that some cache flushing and other stuff may
211 * be needed here - is there an Angel SWI call for this?
212 */
213
214 /*
215 * some architecture specific code can be inserted
216 * by the linker here, but it should preserve r7 and r8.
217 */
218
219 .text
220 adr r0, LC0
221 ldmia r0, {r1, r2, r3, r4, r5, r6, ip, sp}
222 subs r0, r0, r1 @ calculate the delta offset
223
224 @ if delta is zero, we are
225 beq not_relocated @ running at the address we
226 @ were linked at.
227
228 /*
229 * We're running at a different address. We need to fix
230 * up various pointers:
231 * r5 - zImage base address
232 * r6 - GOT start
233 * ip - GOT end
234 */
235 add r5, r5, r0
236 add r6, r6, r0
237 add ip, ip, r0
238
239#ifndef CONFIG_ZBOOT_ROM
240 /*
241 * If we're running fully PIC === CONFIG_ZBOOT_ROM = n,
242 * we need to fix up pointers into the BSS region.
243 * r2 - BSS start
244 * r3 - BSS end
245 * sp - stack pointer
246 */
247 add r2, r2, r0
248 add r3, r3, r0
249 add sp, sp, r0
250
251 /*
252 * Relocate all entries in the GOT table.
253 */
2541: ldr r1, [r6, #0] @ relocate entries in the GOT
255 add r1, r1, r0 @ table. This fixes up the
256 str r1, [r6], #4 @ C references.
257 cmp r6, ip
258 blo 1b
259#else
260
261 /*
262 * Relocate entries in the GOT table. We only relocate
263 * the entries that are outside the (relocated) BSS region.
264 */
2651: ldr r1, [r6, #0] @ relocate entries in the GOT
266 cmp r1, r2 @ entry < bss_start ||
267 cmphs r3, r1 @ _end < entry
268 addlo r1, r1, r0 @ table. This fixes up the
269 str r1, [r6], #4 @ C references.
270 cmp r6, ip
271 blo 1b
272#endif
273
274not_relocated: mov r0, #0
2751: str r0, [r2], #4 @ clear bss
276 str r0, [r2], #4
277 str r0, [r2], #4
278 str r0, [r2], #4
279 cmp r2, r3
280 blo 1b
281
282 /*
283 * The C runtime environment should now be setup
284 * sufficiently. Turn the cache on, set up some
285 * pointers, and start decompressing.
286 */
287 bl cache_on
288
289 mov r1, sp @ malloc space above stack
290 add r2, sp, #0x10000 @ 64k max
291
292/*
293 * Check to see if we will overwrite ourselves.
294 * r4 = final kernel address
295 * r5 = start of this image
296 * r2 = end of malloc space (and therefore this image)
297 * We basically want:
298 * r4 >= r2 -> OK
299 * r4 + image length <= r5 -> OK
300 */
301 cmp r4, r2
302 bhs wont_overwrite
303 add r0, r4, #4096*1024 @ 4MB largest kernel size
304 cmp r0, r5
305 bls wont_overwrite
306
307 mov r5, r2 @ decompress after malloc space
308 mov r0, r5
309 mov r3, r7
310 bl decompress_kernel
311
312 add r0, r0, #127
313 bic r0, r0, #127 @ align the kernel length
314/*
315 * r0 = decompressed kernel length
316 * r1-r3 = unused
317 * r4 = kernel execution address
318 * r5 = decompressed kernel start
319 * r6 = processor ID
320 * r7 = architecture ID
321 * r8-r14 = unused
322 */
323 add r1, r5, r0 @ end of decompressed kernel
324 adr r2, reloc_start
325 ldr r3, LC1
326 add r3, r2, r3
3271: ldmia r2!, {r8 - r13} @ copy relocation code
328 stmia r1!, {r8 - r13}
329 ldmia r2!, {r8 - r13}
330 stmia r1!, {r8 - r13}
331 cmp r2, r3
332 blo 1b
333
334 bl cache_clean_flush
335 add pc, r5, r0 @ call relocation code
336
337/*
338 * We're not in danger of overwriting ourselves. Do this the simple way.
339 *
340 * r4 = kernel execution address
341 * r7 = architecture ID
342 */
343wont_overwrite: mov r0, r4
344 mov r3, r7
345 bl decompress_kernel
346 b call_kernel
347
348 .type LC0, #object
349LC0: .word LC0 @ r1
350 .word __bss_start @ r2
351 .word _end @ r3
352 .word zreladdr @ r4
353 .word _start @ r5
354 .word _got_start @ r6
355 .word _got_end @ ip
356 .word user_stack+4096 @ sp
357LC1: .word reloc_end - reloc_start
358 .size LC0, . - LC0
359
360#ifdef CONFIG_ARCH_RPC
361 .globl params
362params: ldr r0, =params_phys
363 mov pc, lr
364 .ltorg
365 .align
366#endif
367
368/*
369 * Turn on the cache. We need to setup some page tables so that we
370 * can have both the I and D caches on.
371 *
372 * We place the page tables 16k down from the kernel execution address,
373 * and we hope that nothing else is using it. If we're using it, we
374 * will go pop!
375 *
376 * On entry,
377 * r4 = kernel execution address
378 * r6 = processor ID
379 * r7 = architecture number
380 * r8 = run-time address of "start"
381 * On exit,
382 * r1, r2, r3, r8, r9, r12 corrupted
383 * This routine must preserve:
384 * r4, r5, r6, r7
385 */
386 .align 5
387cache_on: mov r3, #8 @ cache_on function
388 b call_cache_fn
389
390__setup_mmu: sub r3, r4, #16384 @ Page directory size
391 bic r3, r3, #0xff @ Align the pointer
392 bic r3, r3, #0x3f00
393/*
394 * Initialise the page tables, turning on the cacheable and bufferable
395 * bits for the RAM area only.
396 */
397 mov r0, r3
398 mov r8, r0, lsr #18
399 mov r8, r8, lsl #18 @ start of RAM
400 add r9, r8, #0x10000000 @ a reasonable RAM size
401 mov r1, #0x12
402 orr r1, r1, #3 << 10
403 add r2, r3, #16384
4041: cmp r1, r8 @ if virt > start of RAM
405 orrhs r1, r1, #0x0c @ set cacheable, bufferable
406 cmp r1, r9 @ if virt > end of RAM
407 bichs r1, r1, #0x0c @ clear cacheable, bufferable
408 str r1, [r0], #4 @ 1:1 mapping
409 add r1, r1, #1048576
410 teq r0, r2
411 bne 1b
412/*
413 * If ever we are running from Flash, then we surely want the cache
414 * to be enabled also for our execution instance... We map 2MB of it
415 * so there is no map overlap problem for up to 1 MB compressed kernel.
416 * If the execution is in RAM then we would only be duplicating the above.
417 */
418 mov r1, #0x1e
419 orr r1, r1, #3 << 10
420 mov r2, pc, lsr #20
421 orr r1, r1, r2, lsl #20
422 add r0, r3, r2, lsl #2
423 str r1, [r0], #4
424 add r1, r1, #1048576
425 str r1, [r0]
426 mov pc, lr
427
428__armv4_cache_on:
429 mov r12, lr
430 bl __setup_mmu
431 mov r0, #0
432 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
433 mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
434 mrc p15, 0, r0, c1, c0, 0 @ read control reg
435 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
436 orr r0, r0, #0x0030
437 bl __common_cache_on
438 mov r0, #0
439 mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
440 mov pc, r12
441
442__arm6_cache_on:
443 mov r12, lr
444 bl __setup_mmu
445 mov r0, #0
446 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
447 mcr p15, 0, r0, c5, c0, 0 @ invalidate whole TLB v3
448 mov r0, #0x30
449 bl __common_cache_on
450 mov r0, #0
451 mcr p15, 0, r0, c5, c0, 0 @ invalidate whole TLB v3
452 mov pc, r12
453
454__common_cache_on:
455#ifndef DEBUG
456 orr r0, r0, #0x000d @ Write buffer, mmu
457#endif
458 mov r1, #-1
459 mcr p15, 0, r3, c2, c0, 0 @ load page table pointer
460 mcr p15, 0, r1, c3, c0, 0 @ load domain access control
461 mcr p15, 0, r0, c1, c0, 0 @ load control register
462 mov pc, lr
463
464/*
465 * All code following this line is relocatable. It is relocated by
466 * the above code to the end of the decompressed kernel image and
467 * executed there. During this time, we have no stacks.
468 *
469 * r0 = decompressed kernel length
470 * r1-r3 = unused
471 * r4 = kernel execution address
472 * r5 = decompressed kernel start
473 * r6 = processor ID
474 * r7 = architecture ID
475 * r8-r14 = unused
476 */
477 .align 5
478reloc_start: add r8, r5, r0
479 debug_reloc_start
480 mov r1, r4
4811:
482 .rept 4
483 ldmia r5!, {r0, r2, r3, r9 - r13} @ relocate kernel
484 stmia r1!, {r0, r2, r3, r9 - r13}
485 .endr
486
487 cmp r5, r8
488 blo 1b
489 debug_reloc_end
490
491call_kernel: bl cache_clean_flush
492 bl cache_off
493 mov r0, #0
494 mov r1, r7 @ restore architecture number
495 mov pc, r4 @ call kernel
496
497/*
498 * Here follow the relocatable cache support functions for the
499 * various processors. This is a generic hook for locating an
500 * entry and jumping to an instruction at the specified offset
501 * from the start of the block. Please note this is all position
502 * independent code.
503 *
504 * r1 = corrupted
505 * r2 = corrupted
506 * r3 = block offset
507 * r6 = corrupted
508 * r12 = corrupted
509 */
510
511call_cache_fn: adr r12, proc_types
512 mrc p15, 0, r6, c0, c0 @ get processor ID
5131: ldr r1, [r12, #0] @ get value
514 ldr r2, [r12, #4] @ get mask
515 eor r1, r1, r6 @ (real ^ match)
516 tst r1, r2 @ & mask
517 addeq pc, r12, r3 @ call cache function
518 add r12, r12, #4*5
519 b 1b
520
521/*
522 * Table for cache operations. This is basically:
523 * - CPU ID match
524 * - CPU ID mask
525 * - 'cache on' method instruction
526 * - 'cache off' method instruction
527 * - 'cache flush' method instruction
528 *
529 * We match an entry using: ((real_id ^ match) & mask) == 0
530 *
531 * Writethrough caches generally only need 'on' and 'off'
532 * methods. Writeback caches _must_ have the flush method
533 * defined.
534 */
535 .type proc_types,#object
536proc_types:
537 .word 0x41560600 @ ARM6/610
538 .word 0xffffffe0
539 b __arm6_cache_off @ works, but slow
540 b __arm6_cache_off
541 mov pc, lr
542@ b __arm6_cache_on @ untested
543@ b __arm6_cache_off
544@ b __armv3_cache_flush
545
546 .word 0x00000000 @ old ARM ID
547 .word 0x0000f000
548 mov pc, lr
549 mov pc, lr
550 mov pc, lr
551
552 .word 0x41007000 @ ARM7/710
553 .word 0xfff8fe00
554 b __arm7_cache_off
555 b __arm7_cache_off
556 mov pc, lr
557
558 .word 0x41807200 @ ARM720T (writethrough)
559 .word 0xffffff00
560 b __armv4_cache_on
561 b __armv4_cache_off
562 mov pc, lr
563
564 .word 0x00007000 @ ARM7 IDs
565 .word 0x0000f000
566 mov pc, lr
567 mov pc, lr
568 mov pc, lr
569
570 @ Everything from here on will be the new ID system.
571
572 .word 0x4401a100 @ sa110 / sa1100
573 .word 0xffffffe0
574 b __armv4_cache_on
575 b __armv4_cache_off
576 b __armv4_cache_flush
577
578 .word 0x6901b110 @ sa1110
579 .word 0xfffffff0
580 b __armv4_cache_on
581 b __armv4_cache_off
582 b __armv4_cache_flush
583
584 @ These match on the architecture ID
585
586 .word 0x00020000 @ ARMv4T
587 .word 0x000f0000
588 b __armv4_cache_on
589 b __armv4_cache_off
590 b __armv4_cache_flush
591
592 .word 0x00050000 @ ARMv5TE
593 .word 0x000f0000
594 b __armv4_cache_on
595 b __armv4_cache_off
596 b __armv4_cache_flush
597
598 .word 0x00060000 @ ARMv5TEJ
599 .word 0x000f0000
600 b __armv4_cache_on
601 b __armv4_cache_off
602 b __armv4_cache_flush
603
604 .word 0x00070000 @ ARMv6
605 .word 0x000f0000
606 b __armv4_cache_on
607 b __armv4_cache_off
608 b __armv6_cache_flush
609
610 .word 0 @ unrecognised type
611 .word 0
612 mov pc, lr
613 mov pc, lr
614 mov pc, lr
615
616 .size proc_types, . - proc_types
617
618/*
619 * Turn off the Cache and MMU. ARMv3 does not support
620 * reading the control register, but ARMv4 does.
621 *
622 * On entry, r6 = processor ID
623 * On exit, r0, r1, r2, r3, r12 corrupted
624 * This routine must preserve: r4, r6, r7
625 */
626 .align 5
627cache_off: mov r3, #12 @ cache_off function
628 b call_cache_fn
629
630__armv4_cache_off:
631 mrc p15, 0, r0, c1, c0
632 bic r0, r0, #0x000d
633 mcr p15, 0, r0, c1, c0 @ turn MMU and cache off
634 mov r0, #0
635 mcr p15, 0, r0, c7, c7 @ invalidate whole cache v4
636 mcr p15, 0, r0, c8, c7 @ invalidate whole TLB v4
637 mov pc, lr
638
639__arm6_cache_off:
640 mov r0, #0x00000030 @ ARM6 control reg.
641 b __armv3_cache_off
642
643__arm7_cache_off:
644 mov r0, #0x00000070 @ ARM7 control reg.
645 b __armv3_cache_off
646
647__armv3_cache_off:
648 mcr p15, 0, r0, c1, c0, 0 @ turn MMU and cache off
649 mov r0, #0
650 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
651 mcr p15, 0, r0, c5, c0, 0 @ invalidate whole TLB v3
652 mov pc, lr
653
654/*
655 * Clean and flush the cache to maintain consistency.
656 *
657 * On entry,
658 * r6 = processor ID
659 * On exit,
660 * r1, r2, r3, r11, r12 corrupted
661 * This routine must preserve:
662 * r0, r4, r5, r6, r7
663 */
664 .align 5
665cache_clean_flush:
666 mov r3, #16
667 b call_cache_fn
668
669__armv6_cache_flush:
670 mov r1, #0
671 mcr p15, 0, r1, c7, c14, 0 @ clean+invalidate D
672 mcr p15, 0, r1, c7, c5, 0 @ invalidate I+BTB
673 mcr p15, 0, r1, c7, c15, 0 @ clean+invalidate unified
674 mcr p15, 0, r1, c7, c10, 4 @ drain WB
675 mov pc, lr
676
677__armv4_cache_flush:
678 mov r2, #64*1024 @ default: 32K dcache size (*2)
679 mov r11, #32 @ default: 32 byte line size
680 mrc p15, 0, r3, c0, c0, 1 @ read cache type
681 teq r3, r6 @ cache ID register present?
682 beq no_cache_id
683 mov r1, r3, lsr #18
684 and r1, r1, #7
685 mov r2, #1024
686 mov r2, r2, lsl r1 @ base dcache size *2
687 tst r3, #1 << 14 @ test M bit
688 addne r2, r2, r2, lsr #1 @ +1/2 size if M == 1
689 mov r3, r3, lsr #12
690 and r3, r3, #3
691 mov r11, #8
692 mov r11, r11, lsl r3 @ cache line size in bytes
693no_cache_id:
694 bic r1, pc, #63 @ align to longest cache line
695 add r2, r1, r2
6961: ldr r3, [r1], r11 @ s/w flush D cache
697 teq r1, r2
698 bne 1b
699
700 mcr p15, 0, r1, c7, c5, 0 @ flush I cache
701 mcr p15, 0, r1, c7, c6, 0 @ flush D cache
702 mcr p15, 0, r1, c7, c10, 4 @ drain WB
703 mov pc, lr
704
705__armv3_cache_flush:
706 mov r1, #0
707 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
708 mov pc, lr
709
710/*
711 * Various debugging routines for printing hex characters and
712 * memory, which again must be relocatable.
713 */
714#ifdef DEBUG
715 .type phexbuf,#object
716phexbuf: .space 12
717 .size phexbuf, . - phexbuf
718
719phex: adr r3, phexbuf
720 mov r2, #0
721 strb r2, [r3, r1]
7221: subs r1, r1, #1
723 movmi r0, r3
724 bmi puts
725 and r2, r0, #15
726 mov r0, r0, lsr #4
727 cmp r2, #10
728 addge r2, r2, #7
729 add r2, r2, #'0'
730 strb r2, [r3, r1]
731 b 1b
732
733puts: loadsp r3
7341: ldrb r2, [r0], #1
735 teq r2, #0
736 moveq pc, lr
7372: writeb r2
738 mov r1, #0x00020000
7393: subs r1, r1, #1
740 bne 3b
741 teq r2, #'\n'
742 moveq r2, #'\r'
743 beq 2b
744 teq r0, #0
745 bne 1b
746 mov pc, lr
747putc:
748 mov r2, r0
749 mov r0, #0
750 loadsp r3
751 b 2b
752
753memdump: mov r12, r0
754 mov r10, lr
755 mov r11, #0
7562: mov r0, r11, lsl #2
757 add r0, r0, r12
758 mov r1, #8
759 bl phex
760 mov r0, #':'
761 bl putc
7621: mov r0, #' '
763 bl putc
764 ldr r0, [r12, r11, lsl #2]
765 mov r1, #8
766 bl phex
767 and r0, r11, #7
768 teq r0, #3
769 moveq r0, #' '
770 bleq putc
771 and r0, r11, #7
772 add r11, r11, #1
773 teq r0, #7
774 bne 1b
775 mov r0, #'\n'
776 bl putc
777 cmp r11, #64
778 blt 2b
779 mov pc, r10
780#endif
781
782reloc_end:
783
784 .align
785 .section ".stack", "w"
786user_stack: .space 4096
diff --git a/arch/arm/boot/compressed/ice-dcc.S b/arch/arm/boot/compressed/ice-dcc.S
new file mode 100644
index 000000000000..104377a199bb
--- /dev/null
+++ b/arch/arm/boot/compressed/ice-dcc.S
@@ -0,0 +1,17 @@
1
2
3 .text
4
5 .global icedcc_putc
6
7icedcc_putc:
8 mov r2, #0x4000000
91:
10 subs r2, r2, #1
11 movlt pc, r14
12 mrc p14, 0, r1, c0, c0, 0
13 tst r1, #2
14 bne 1b
15
16 mcr p14, 0, r0, c1, c0, 0
17 mov pc, r14
diff --git a/arch/arm/boot/compressed/ll_char_wr.S b/arch/arm/boot/compressed/ll_char_wr.S
new file mode 100644
index 000000000000..d7bbd9da2fca
--- /dev/null
+++ b/arch/arm/boot/compressed/ll_char_wr.S
@@ -0,0 +1,134 @@
1/*
2 * linux/arch/arm/lib/ll_char_wr.S
3 *
4 * Copyright (C) 1995, 1996 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Speedups & 1bpp code (C) 1996 Philip Blundell & Russell King.
11 *
12 * 10-04-96 RMK Various cleanups & reduced register usage.
13 * 08-04-98 RMK Shifts re-ordered
14 */
15
16@ Regs: [] = corruptible
17@ {} = used
18@ () = do not use
19
20#include <linux/linkage.h>
21#include <asm/assembler.h>
22 .text
23
24LC0: .word LC0
25 .word bytes_per_char_h
26 .word video_size_row
27 .word acorndata_8x8
28 .word con_charconvtable
29
30/*
31 * r0 = ptr
32 * r1 = char
33 * r2 = white
34 */
35ENTRY(ll_write_char)
36 stmfd sp!, {r4 - r7, lr}
37@
38@ Smashable regs: {r0 - r3}, [r4 - r7], (r8 - fp), [ip], (sp), [lr], (pc)
39@
40 /*
41 * calculate offset into character table
42 */
43 mov r1, r1, lsl #3
44 /*
45 * calculate offset required for each row.
46 */
47 adr ip, LC0
48 ldmia ip, {r3, r4, r5, r6, lr}
49 sub ip, ip, r3
50 add r6, r6, ip
51 add lr, lr, ip
52 ldr r4, [r4, ip]
53 ldr r5, [r5, ip]
54 /*
55 * Go to resolution-dependent routine...
56 */
57 cmp r4, #4
58 blt Lrow1bpp
59 add r0, r0, r5, lsl #3 @ Move to bottom of character
60 orr r1, r1, #7
61 ldrb r7, [r6, r1]
62 teq r4, #8
63 beq Lrow8bpplp
64@
65@ Smashable regs: {r0 - r3}, [r4], {r5 - r7}, (r8 - fp), [ip], (sp), {lr}, (pc)
66@
67Lrow4bpplp:
68 ldr r7, [lr, r7, lsl #2]
69 mul r7, r2, r7
70 sub r1, r1, #1 @ avoid using r7 directly after
71 str r7, [r0, -r5]!
72 ldrb r7, [r6, r1]
73 ldr r7, [lr, r7, lsl #2]
74 mul r7, r2, r7
75 tst r1, #7 @ avoid using r7 directly after
76 str r7, [r0, -r5]!
77 subne r1, r1, #1
78 ldrneb r7, [r6, r1]
79 bne Lrow4bpplp
80 LOADREGS(fd, sp!, {r4 - r7, pc})
81
82@
83@ Smashable regs: {r0 - r3}, [r4], {r5 - r7}, (r8 - fp), [ip], (sp), {lr}, (pc)
84@
85Lrow8bpplp:
86 mov ip, r7, lsr #4
87 ldr ip, [lr, ip, lsl #2]
88 mul r4, r2, ip
89 and ip, r7, #15 @ avoid r4
90 ldr ip, [lr, ip, lsl #2] @ avoid r4
91 mul ip, r2, ip @ avoid r4
92 sub r1, r1, #1 @ avoid ip
93 sub r0, r0, r5 @ avoid ip
94 stmia r0, {r4, ip}
95 ldrb r7, [r6, r1]
96 mov ip, r7, lsr #4
97 ldr ip, [lr, ip, lsl #2]
98 mul r4, r2, ip
99 and ip, r7, #15 @ avoid r4
100 ldr ip, [lr, ip, lsl #2] @ avoid r4
101 mul ip, r2, ip @ avoid r4
102 tst r1, #7 @ avoid ip
103 sub r0, r0, r5 @ avoid ip
104 stmia r0, {r4, ip}
105 subne r1, r1, #1
106 ldrneb r7, [r6, r1]
107 bne Lrow8bpplp
108 LOADREGS(fd, sp!, {r4 - r7, pc})
109
110@
111@ Smashable regs: {r0 - r3}, [r4], {r5, r6}, [r7], (r8 - fp), [ip], (sp), [lr], (pc)
112@
113Lrow1bpp:
114 add r6, r6, r1
115 ldmia r6, {r4, r7}
116 strb r4, [r0], r5
117 mov r4, r4, lsr #8
118 strb r4, [r0], r5
119 mov r4, r4, lsr #8
120 strb r4, [r0], r5
121 mov r4, r4, lsr #8
122 strb r4, [r0], r5
123 strb r7, [r0], r5
124 mov r7, r7, lsr #8
125 strb r7, [r0], r5
126 mov r7, r7, lsr #8
127 strb r7, [r0], r5
128 mov r7, r7, lsr #8
129 strb r7, [r0], r5
130 LOADREGS(fd, sp!, {r4 - r7, pc})
131
132 .bss
133ENTRY(con_charconvtable)
134 .space 1024
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
new file mode 100644
index 000000000000..23434b56786a
--- /dev/null
+++ b/arch/arm/boot/compressed/misc.c
@@ -0,0 +1,329 @@
1/*
2 * misc.c
3 *
4 * This is a collection of several routines from gzip-1.0.3
5 * adapted for Linux.
6 *
7 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
8 *
9 * Modified for ARM Linux by Russell King
10 *
11 * Nicolas Pitre <nico@visuaide.com> 1999/04/14 :
12 * For this code to run directly from Flash, all constant variables must
13 * be marked with 'const' and all other variables initialized at run-time
14 * only. This way all non constant variables will end up in the bss segment,
15 * which should point to addresses in RAM and cleared to 0 on start.
16 * This allows for a much quicker boot time.
17 */
18
19unsigned int __machine_arch_type;
20
21#include <linux/string.h>
22
23#include <asm/arch/uncompress.h>
24
25#ifdef STANDALONE_DEBUG
26#define putstr printf
27#endif
28
29#ifdef CONFIG_DEBUG_ICEDCC
30#define putstr icedcc_putstr
31#define putc icedcc_putc
32
33extern void idedcc_putc(int ch);
34
35static void
36icedcc_putstr(const char *ptr)
37{
38 for (; *ptr != '\0'; ptr++) {
39 icedcc_putc(*ptr);
40 }
41}
42
43#endif
44
45#define __ptr_t void *
46
47/*
48 * Optimised C version of memzero for the ARM.
49 */
50void __memzero (__ptr_t s, size_t n)
51{
52 union { void *vp; unsigned long *ulp; unsigned char *ucp; } u;
53 int i;
54
55 u.vp = s;
56
57 for (i = n >> 5; i > 0; i--) {
58 *u.ulp++ = 0;
59 *u.ulp++ = 0;
60 *u.ulp++ = 0;
61 *u.ulp++ = 0;
62 *u.ulp++ = 0;
63 *u.ulp++ = 0;
64 *u.ulp++ = 0;
65 *u.ulp++ = 0;
66 }
67
68 if (n & 1 << 4) {
69 *u.ulp++ = 0;
70 *u.ulp++ = 0;
71 *u.ulp++ = 0;
72 *u.ulp++ = 0;
73 }
74
75 if (n & 1 << 3) {
76 *u.ulp++ = 0;
77 *u.ulp++ = 0;
78 }
79
80 if (n & 1 << 2)
81 *u.ulp++ = 0;
82
83 if (n & 1 << 1) {
84 *u.ucp++ = 0;
85 *u.ucp++ = 0;
86 }
87
88 if (n & 1)
89 *u.ucp++ = 0;
90}
91
92static inline __ptr_t memcpy(__ptr_t __dest, __const __ptr_t __src,
93 size_t __n)
94{
95 int i = 0;
96 unsigned char *d = (unsigned char *)__dest, *s = (unsigned char *)__src;
97
98 for (i = __n >> 3; i > 0; i--) {
99 *d++ = *s++;
100 *d++ = *s++;
101 *d++ = *s++;
102 *d++ = *s++;
103 *d++ = *s++;
104 *d++ = *s++;
105 *d++ = *s++;
106 *d++ = *s++;
107 }
108
109 if (__n & 1 << 2) {
110 *d++ = *s++;
111 *d++ = *s++;
112 *d++ = *s++;
113 *d++ = *s++;
114 }
115
116 if (__n & 1 << 1) {
117 *d++ = *s++;
118 *d++ = *s++;
119 }
120
121 if (__n & 1)
122 *d++ = *s++;
123
124 return __dest;
125}
126
127/*
128 * gzip delarations
129 */
130#define OF(args) args
131#define STATIC static
132
133typedef unsigned char uch;
134typedef unsigned short ush;
135typedef unsigned long ulg;
136
137#define WSIZE 0x8000 /* Window size must be at least 32k, */
138 /* and a power of two */
139
140static uch *inbuf; /* input buffer */
141static uch window[WSIZE]; /* Sliding window buffer */
142
143static unsigned insize; /* valid bytes in inbuf */
144static unsigned inptr; /* index of next byte to be processed in inbuf */
145static unsigned outcnt; /* bytes in output buffer */
146
147/* gzip flag byte */
148#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
149#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */
150#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
151#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
152#define COMMENT 0x10 /* bit 4 set: file comment present */
153#define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */
154#define RESERVED 0xC0 /* bit 6,7: reserved */
155
156#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf())
157
158/* Diagnostic functions */
159#ifdef DEBUG
160# define Assert(cond,msg) {if(!(cond)) error(msg);}
161# define Trace(x) fprintf x
162# define Tracev(x) {if (verbose) fprintf x ;}
163# define Tracevv(x) {if (verbose>1) fprintf x ;}
164# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
165# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
166#else
167# define Assert(cond,msg)
168# define Trace(x)
169# define Tracev(x)
170# define Tracevv(x)
171# define Tracec(c,x)
172# define Tracecv(c,x)
173#endif
174
175static int fill_inbuf(void);
176static void flush_window(void);
177static void error(char *m);
178static void gzip_mark(void **);
179static void gzip_release(void **);
180
181extern char input_data[];
182extern char input_data_end[];
183
184static uch *output_data;
185static ulg output_ptr;
186static ulg bytes_out;
187
188static void *malloc(int size);
189static void free(void *where);
190static void error(char *m);
191static void gzip_mark(void **);
192static void gzip_release(void **);
193
194static void putstr(const char *);
195
196extern int end;
197static ulg free_mem_ptr;
198static ulg free_mem_ptr_end;
199
200#define HEAP_SIZE 0x2000
201
202#include "../../../../lib/inflate.c"
203
204#ifndef STANDALONE_DEBUG
205static void *malloc(int size)
206{
207 void *p;
208
209 if (size <0) error("Malloc error");
210 if (free_mem_ptr <= 0) error("Memory error");
211
212 free_mem_ptr = (free_mem_ptr + 3) & ~3; /* Align */
213
214 p = (void *)free_mem_ptr;
215 free_mem_ptr += size;
216
217 if (free_mem_ptr >= free_mem_ptr_end)
218 error("Out of memory");
219 return p;
220}
221
222static void free(void *where)
223{ /* gzip_mark & gzip_release do the free */
224}
225
226static void gzip_mark(void **ptr)
227{
228 arch_decomp_wdog();
229 *ptr = (void *) free_mem_ptr;
230}
231
232static void gzip_release(void **ptr)
233{
234 arch_decomp_wdog();
235 free_mem_ptr = (long) *ptr;
236}
237#else
238static void gzip_mark(void **ptr)
239{
240}
241
242static void gzip_release(void **ptr)
243{
244}
245#endif
246
247/* ===========================================================================
248 * Fill the input buffer. This is called only when the buffer is empty
249 * and at least one byte is really needed.
250 */
251int fill_inbuf(void)
252{
253 if (insize != 0)
254 error("ran out of input data");
255
256 inbuf = input_data;
257 insize = &input_data_end[0] - &input_data[0];
258
259 inptr = 1;
260 return inbuf[0];
261}
262
263/* ===========================================================================
264 * Write the output window window[0..outcnt-1] and update crc and bytes_out.
265 * (Used for the decompressed data only.)
266 */
267void flush_window(void)
268{
269 ulg c = crc;
270 unsigned n;
271 uch *in, *out, ch;
272
273 in = window;
274 out = &output_data[output_ptr];
275 for (n = 0; n < outcnt; n++) {
276 ch = *out++ = *in++;
277 c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
278 }
279 crc = c;
280 bytes_out += (ulg)outcnt;
281 output_ptr += (ulg)outcnt;
282 outcnt = 0;
283 putstr(".");
284}
285
286static void error(char *x)
287{
288 putstr("\n\n");
289 putstr(x);
290 putstr("\n\n -- System halted");
291
292 while(1); /* Halt */
293}
294
295#ifndef STANDALONE_DEBUG
296
297ulg
298decompress_kernel(ulg output_start, ulg free_mem_ptr_p, ulg free_mem_ptr_end_p,
299 int arch_id)
300{
301 output_data = (uch *)output_start; /* Points to kernel start */
302 free_mem_ptr = free_mem_ptr_p;
303 free_mem_ptr_end = free_mem_ptr_end_p;
304 __machine_arch_type = arch_id;
305
306 arch_decomp_setup();
307
308 makecrc();
309 putstr("Uncompressing Linux...");
310 gunzip();
311 putstr(" done, booting the kernel.\n");
312 return output_ptr;
313}
314#else
315
316char output_buffer[1500*1024];
317
318int main()
319{
320 output_data = output_buffer;
321
322 makecrc();
323 putstr("Uncompressing Linux...");
324 gunzip();
325 putstr("done.\n");
326 return 0;
327}
328#endif
329
diff --git a/arch/arm/boot/compressed/ofw-shark.c b/arch/arm/boot/compressed/ofw-shark.c
new file mode 100644
index 000000000000..7f6f5db0d060
--- /dev/null
+++ b/arch/arm/boot/compressed/ofw-shark.c
@@ -0,0 +1,260 @@
1/*
2 * linux/arch/arm/boot/compressed/ofw-shark.c
3 *
4 * by Alexander Schulz
5 *
6 * This file is used to get some basic information
7 * about the memory layout of the shark we are running
8 * on. Memory is usually divided in blocks a 8 MB.
9 * And bootargs are copied from OpenFirmware.
10 */
11
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <asm/setup.h>
16#include <asm/page.h>
17
18
19asmlinkage void
20create_params (unsigned long *buffer)
21{
22 /* Is there a better address? Also change in mach-shark/core.c */
23 struct tag *tag = (struct tag *) 0x08003000;
24 int j,i,m,k,nr_banks,size;
25 unsigned char *c;
26
27 k = 0;
28
29 /* Head of the taglist */
30 tag->hdr.tag = ATAG_CORE;
31 tag->hdr.size = tag_size(tag_core);
32 tag->u.core.flags = 1;
33 tag->u.core.pagesize = PAGE_SIZE;
34 tag->u.core.rootdev = 0;
35
36 /* Build up one tagged block for each memory region */
37 size=0;
38 nr_banks=(unsigned int) buffer[0];
39 for (j=0;j<nr_banks;j++){
40 /* search the lowest address and put it into the next entry */
41 /* not a fast sort algorithm, but there are at most 8 entries */
42 /* and this is used only once anyway */
43 m=0xffffffff;
44 for (i=0;i<(unsigned int) buffer[0];i++){
45 if (buffer[2*i+1]<m) {
46 m=buffer[2*i+1];
47 k=i;
48 }
49 }
50
51 tag = tag_next(tag);
52 tag->hdr.tag = ATAG_MEM;
53 tag->hdr.size = tag_size(tag_mem32);
54 tag->u.mem.size = buffer[2*k+2];
55 tag->u.mem.start = buffer[2*k+1];
56
57 size += buffer[2*k+2];
58
59 buffer[2*k+1]=0xffffffff; /* mark as copied */
60 }
61
62 /* The command line */
63 tag = tag_next(tag);
64 tag->hdr.tag = ATAG_CMDLINE;
65
66 c=(unsigned char *)(&buffer[34]);
67 j=0;
68 while (*c) tag->u.cmdline.cmdline[j++]=*c++;
69
70 tag->u.cmdline.cmdline[j]=0;
71 tag->hdr.size = (j + 7 + sizeof(struct tag_header)) >> 2;
72
73 /* Hardware revision */
74 tag = tag_next(tag);
75 tag->hdr.tag = ATAG_REVISION;
76 tag->hdr.size = tag_size(tag_revision);
77 tag->u.revision.rev = ((unsigned char) buffer[33])-'0';
78
79 /* End of the taglist */
80 tag = tag_next(tag);
81 tag->hdr.tag = 0;
82 tag->hdr.size = 0;
83}
84
85
86typedef int (*ofw_handle_t)(void *);
87
88/* Everything below is called with a wrong MMU setting.
89 * This means: no string constants, no initialization of
90 * arrays, no global variables! This is ugly but I didn't
91 * want to write this in assembler :-)
92 */
93
94int
95of_decode_int(const unsigned char *p)
96{
97 unsigned int i = *p++ << 8;
98 i = (i + *p++) << 8;
99 i = (i + *p++) << 8;
100 return (i + *p);
101}
102
103int
104OF_finddevice(ofw_handle_t openfirmware, char *name)
105{
106 unsigned int args[8];
107 char service[12];
108
109 service[0]='f';
110 service[1]='i';
111 service[2]='n';
112 service[3]='d';
113 service[4]='d';
114 service[5]='e';
115 service[6]='v';
116 service[7]='i';
117 service[8]='c';
118 service[9]='e';
119 service[10]='\0';
120
121 args[0]=(unsigned int)service;
122 args[1]=1;
123 args[2]=1;
124 args[3]=(unsigned int)name;
125
126 if (openfirmware(args) == -1)
127 return -1;
128 return args[4];
129}
130
131int
132OF_getproplen(ofw_handle_t openfirmware, int handle, char *prop)
133{
134 unsigned int args[8];
135 char service[12];
136
137 service[0]='g';
138 service[1]='e';
139 service[2]='t';
140 service[3]='p';
141 service[4]='r';
142 service[5]='o';
143 service[6]='p';
144 service[7]='l';
145 service[8]='e';
146 service[9]='n';
147 service[10]='\0';
148
149 args[0] = (unsigned int)service;
150 args[1] = 2;
151 args[2] = 1;
152 args[3] = (unsigned int)handle;
153 args[4] = (unsigned int)prop;
154
155 if (openfirmware(args) == -1)
156 return -1;
157 return args[5];
158}
159
160int
161OF_getprop(ofw_handle_t openfirmware, int handle, char *prop, void *buf, unsigned int buflen)
162{
163 unsigned int args[8];
164 char service[8];
165
166 service[0]='g';
167 service[1]='e';
168 service[2]='t';
169 service[3]='p';
170 service[4]='r';
171 service[5]='o';
172 service[6]='p';
173 service[7]='\0';
174
175 args[0] = (unsigned int)service;
176 args[1] = 4;
177 args[2] = 1;
178 args[3] = (unsigned int)handle;
179 args[4] = (unsigned int)prop;
180 args[5] = (unsigned int)buf;
181 args[6] = buflen;
182
183 if (openfirmware(args) == -1)
184 return -1;
185 return args[7];
186}
187
188asmlinkage void ofw_init(ofw_handle_t o, int *nomr, int *pointer)
189{
190 int phandle,i,mem_len,buffer[32];
191 char temp[15];
192
193 temp[0]='/';
194 temp[1]='m';
195 temp[2]='e';
196 temp[3]='m';
197 temp[4]='o';
198 temp[5]='r';
199 temp[6]='y';
200 temp[7]='\0';
201
202 phandle=OF_finddevice(o,temp);
203
204 temp[0]='r';
205 temp[1]='e';
206 temp[2]='g';
207 temp[3]='\0';
208
209 mem_len = OF_getproplen(o,phandle, temp);
210 OF_getprop(o,phandle, temp, buffer, mem_len);
211 *nomr=mem_len >> 3;
212
213 for (i=0; i<=mem_len/4; i++) pointer[i]=of_decode_int((const unsigned char *)&buffer[i]);
214
215 temp[0]='/';
216 temp[1]='c';
217 temp[2]='h';
218 temp[3]='o';
219 temp[4]='s';
220 temp[5]='e';
221 temp[6]='n';
222 temp[7]='\0';
223
224 phandle=OF_finddevice(o,temp);
225
226 temp[0]='b';
227 temp[1]='o';
228 temp[2]='o';
229 temp[3]='t';
230 temp[4]='a';
231 temp[5]='r';
232 temp[6]='g';
233 temp[7]='s';
234 temp[8]='\0';
235
236 mem_len = OF_getproplen(o,phandle, temp);
237 OF_getprop(o,phandle, temp, buffer, mem_len);
238 if (mem_len > 128) mem_len=128;
239 for (i=0; i<=mem_len/4; i++) pointer[i+33]=buffer[i];
240 pointer[i+33]=0;
241
242 temp[0]='/';
243 temp[1]='\0';
244 phandle=OF_finddevice(o,temp);
245 temp[0]='b';
246 temp[1]='a';
247 temp[2]='n';
248 temp[3]='n';
249 temp[4]='e';
250 temp[5]='r';
251 temp[6]='-';
252 temp[7]='n';
253 temp[8]='a';
254 temp[9]='m';
255 temp[10]='e';
256 temp[11]='\0';
257 mem_len = OF_getproplen(o,phandle, temp);
258 OF_getprop(o,phandle, temp, buffer, mem_len);
259 (unsigned char) pointer[32] = ((unsigned char *) buffer)[mem_len-2];
260}
diff --git a/arch/arm/boot/compressed/piggy.S b/arch/arm/boot/compressed/piggy.S
new file mode 100644
index 000000000000..54c951800ebd
--- /dev/null
+++ b/arch/arm/boot/compressed/piggy.S
@@ -0,0 +1,6 @@
1 .section .piggydata,#alloc
2 .globl input_data
3input_data:
4 .incbin "arch/arm/boot/compressed/piggy.gz"
5 .globl input_data_end
6input_data_end:
diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in
new file mode 100644
index 000000000000..eed616113e47
--- /dev/null
+++ b/arch/arm/boot/compressed/vmlinux.lds.in
@@ -0,0 +1,55 @@
1/*
2 * linux/arch/arm/boot/compressed/vmlinux.lds.in
3 *
4 * Copyright (C) 2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10OUTPUT_ARCH(arm)
11ENTRY(_start)
12SECTIONS
13{
14 . = TEXT_START;
15 _text = .;
16
17 .text : {
18 _start = .;
19 *(.start)
20 *(.text)
21 *(.fixup)
22 *(.gnu.warning)
23 *(.rodata)
24 *(.rodata.*)
25 *(.glue_7)
26 *(.glue_7t)
27 *(.piggydata)
28 . = ALIGN(4);
29 }
30
31 _etext = .;
32
33 _got_start = .;
34 .got : { *(.got) }
35 _got_end = .;
36 .got.plt : { *(.got.plt) }
37 .data : { *(.data) }
38 _edata = .;
39
40 . = BSS_START;
41 __bss_start = .;
42 .bss : { *(.bss) }
43 _end = .;
44
45 .stack (NOLOAD) : { *(.stack) }
46
47 .stab 0 : { *(.stab) }
48 .stabstr 0 : { *(.stabstr) }
49 .stab.excl 0 : { *(.stab.excl) }
50 .stab.exclstr 0 : { *(.stab.exclstr) }
51 .stab.index 0 : { *(.stab.index) }
52 .stab.indexstr 0 : { *(.stab.indexstr) }
53 .comment 0 : { *(.comment) }
54}
55
diff --git a/arch/arm/boot/install.sh b/arch/arm/boot/install.sh
new file mode 100644
index 000000000000..935bb27369e9
--- /dev/null
+++ b/arch/arm/boot/install.sh
@@ -0,0 +1,52 @@
1#!/bin/sh
2#
3# arch/arm/boot/install.sh
4#
5# This file is subject to the terms and conditions of the GNU General Public
6# License. See the file "COPYING" in the main directory of this archive
7# for more details.
8#
9# Copyright (C) 1995 by Linus Torvalds
10#
11# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
12# Adapted from code in arch/i386/boot/install.sh by Russell King
13#
14# "make install" script for arm architecture
15#
16# Arguments:
17# $1 - kernel version
18# $2 - kernel image file
19# $3 - kernel map file
20# $4 - default install path (blank if root directory)
21#
22
23# User may have a custom install script
24if [ -x ~/bin/installkernel ]; then exec ~/bin/installkernel "$@"; fi
25if [ -x /sbin/installkernel ]; then exec /sbin/installkernel "$@"; fi
26
27if [ "$(basename $2)" = "zImage" ]; then
28# Compressed install
29 echo "Installing compressed kernel"
30 base=vmlinuz
31else
32# Normal install
33 echo "Installing normal kernel"
34 base=vmlinux
35fi
36
37if [ -f $4/$base-$1 ]; then
38 mv $4/$base-$1 $4/$base-$1.old
39fi
40cat $2 > $4/$base-$1
41
42# Install system map file
43if [ -f $4/System.map-$1 ]; then
44 mv $4/System.map-$1 $4/System.map-$1.old
45fi
46cp $3 $4/System.map-$1
47
48if [ -x /sbin/loadmap ]; then
49 /sbin/loadmap
50else
51 echo "You have to install it yourself"
52fi
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
new file mode 100644
index 000000000000..692af6b5e8ff
--- /dev/null
+++ b/arch/arm/common/Kconfig
@@ -0,0 +1,24 @@
1config ICST525
2 bool
3
4config ICST307
5 bool
6
7config SA1111
8 bool
9 select DMABOUNCE
10
11config DMABOUNCE
12 bool
13
14config TIMER_ACORN
15 bool
16
17config SHARP_LOCOMO
18 bool
19
20config SHARP_PARAM
21 bool
22
23config SHARP_SCOOP
24 bool
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
new file mode 100644
index 000000000000..11f20a43ee3a
--- /dev/null
+++ b/arch/arm/common/Makefile
@@ -0,0 +1,15 @@
1#
2# Makefile for the linux kernel.
3#
4
5obj-y += rtctime.o
6obj-$(CONFIG_ARM_AMBA) += amba.o
7obj-$(CONFIG_ICST525) += icst525.o
8obj-$(CONFIG_ICST307) += icst307.o
9obj-$(CONFIG_SA1111) += sa1111.o
10obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o
11obj-$(CONFIG_DMABOUNCE) += dmabounce.o
12obj-$(CONFIG_TIMER_ACORN) += time-acorn.o
13obj-$(CONFIG_SHARP_LOCOMO) += locomo.o
14obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o
15obj-$(CONFIG_SHARP_SCOOP) += scoop.o
diff --git a/arch/arm/common/amba.c b/arch/arm/common/amba.c
new file mode 100644
index 000000000000..a0507f8c33fe
--- /dev/null
+++ b/arch/arm/common/amba.c
@@ -0,0 +1,357 @@
1/*
2 * linux/arch/arm/common/amba.c
3 *
4 * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/module.h>
11#include <linux/init.h>
12#include <linux/device.h>
13
14#include <asm/io.h>
15#include <asm/irq.h>
16#include <asm/hardware/amba.h>
17#include <asm/sizes.h>
18
19#define to_amba_device(d) container_of(d, struct amba_device, dev)
20#define to_amba_driver(d) container_of(d, struct amba_driver, drv)
21
22static struct amba_id *
23amba_lookup(struct amba_id *table, struct amba_device *dev)
24{
25 int ret = 0;
26
27 while (table->mask) {
28 ret = (dev->periphid & table->mask) == table->id;
29 if (ret)
30 break;
31 table++;
32 }
33
34 return ret ? table : NULL;
35}
36
37static int amba_match(struct device *dev, struct device_driver *drv)
38{
39 struct amba_device *pcdev = to_amba_device(dev);
40 struct amba_driver *pcdrv = to_amba_driver(drv);
41
42 return amba_lookup(pcdrv->id_table, pcdev) != NULL;
43}
44
45#ifdef CONFIG_HOTPLUG
46static int amba_hotplug(struct device *dev, char **envp, int nr_env, char *buf, int bufsz)
47{
48 struct amba_device *pcdev = to_amba_device(dev);
49
50 if (nr_env < 2)
51 return -ENOMEM;
52
53 snprintf(buf, bufsz, "AMBA_ID=%08x", pcdev->periphid);
54 *envp++ = buf;
55 *envp++ = NULL;
56 return 0;
57}
58#else
59#define amba_hotplug NULL
60#endif
61
62static int amba_suspend(struct device *dev, pm_message_t state)
63{
64 struct amba_driver *drv = to_amba_driver(dev->driver);
65 int ret = 0;
66
67 if (dev->driver && drv->suspend)
68 ret = drv->suspend(to_amba_device(dev), state);
69 return ret;
70}
71
72static int amba_resume(struct device *dev)
73{
74 struct amba_driver *drv = to_amba_driver(dev->driver);
75 int ret = 0;
76
77 if (dev->driver && drv->resume)
78 ret = drv->resume(to_amba_device(dev));
79 return ret;
80}
81
82/*
83 * Primecells are part of the Advanced Microcontroller Bus Architecture,
84 * so we call the bus "amba".
85 */
86static struct bus_type amba_bustype = {
87 .name = "amba",
88 .match = amba_match,
89 .hotplug = amba_hotplug,
90 .suspend = amba_suspend,
91 .resume = amba_resume,
92};
93
94static int __init amba_init(void)
95{
96 return bus_register(&amba_bustype);
97}
98
99postcore_initcall(amba_init);
100
101/*
102 * These are the device model conversion veneers; they convert the
103 * device model structures to our more specific structures.
104 */
105static int amba_probe(struct device *dev)
106{
107 struct amba_device *pcdev = to_amba_device(dev);
108 struct amba_driver *pcdrv = to_amba_driver(dev->driver);
109 struct amba_id *id;
110
111 id = amba_lookup(pcdrv->id_table, pcdev);
112
113 return pcdrv->probe(pcdev, id);
114}
115
116static int amba_remove(struct device *dev)
117{
118 struct amba_driver *drv = to_amba_driver(dev->driver);
119 return drv->remove(to_amba_device(dev));
120}
121
122static void amba_shutdown(struct device *dev)
123{
124 struct amba_driver *drv = to_amba_driver(dev->driver);
125 drv->shutdown(to_amba_device(dev));
126}
127
128/**
129 * amba_driver_register - register an AMBA device driver
130 * @drv: amba device driver structure
131 *
132 * Register an AMBA device driver with the Linux device model
133 * core. If devices pre-exist, the drivers probe function will
134 * be called.
135 */
136int amba_driver_register(struct amba_driver *drv)
137{
138 drv->drv.bus = &amba_bustype;
139
140#define SETFN(fn) if (drv->fn) drv->drv.fn = amba_##fn
141 SETFN(probe);
142 SETFN(remove);
143 SETFN(shutdown);
144
145 return driver_register(&drv->drv);
146}
147
148/**
149 * amba_driver_unregister - remove an AMBA device driver
150 * @drv: AMBA device driver structure to remove
151 *
152 * Unregister an AMBA device driver from the Linux device
153 * model. The device model will call the drivers remove function
154 * for each device the device driver is currently handling.
155 */
156void amba_driver_unregister(struct amba_driver *drv)
157{
158 driver_unregister(&drv->drv);
159}
160
161
162static void amba_device_release(struct device *dev)
163{
164 struct amba_device *d = to_amba_device(dev);
165
166 if (d->res.parent)
167 release_resource(&d->res);
168 kfree(d);
169}
170
171#define amba_attr(name,fmt,arg...) \
172static ssize_t show_##name(struct device *_dev, char *buf) \
173{ \
174 struct amba_device *dev = to_amba_device(_dev); \
175 return sprintf(buf, fmt, arg); \
176} \
177static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)
178
179amba_attr(id, "%08x\n", dev->periphid);
180amba_attr(irq0, "%u\n", dev->irq[0]);
181amba_attr(irq1, "%u\n", dev->irq[1]);
182amba_attr(resource, "\t%08lx\t%08lx\t%08lx\n",
183 dev->res.start, dev->res.end, dev->res.flags);
184
185/**
186 * amba_device_register - register an AMBA device
187 * @dev: AMBA device to register
188 * @parent: parent memory resource
189 *
190 * Setup the AMBA device, reading the cell ID if present.
191 * Claim the resource, and register the AMBA device with
192 * the Linux device manager.
193 */
194int amba_device_register(struct amba_device *dev, struct resource *parent)
195{
196 u32 pid, cid;
197 void __iomem *tmp;
198 int i, ret;
199
200 dev->dev.release = amba_device_release;
201 dev->dev.bus = &amba_bustype;
202 dev->dev.dma_mask = &dev->dma_mask;
203 dev->res.name = dev->dev.bus_id;
204
205 if (!dev->dev.coherent_dma_mask && dev->dma_mask)
206 dev_warn(&dev->dev, "coherent dma mask is unset\n");
207
208 ret = request_resource(parent, &dev->res);
209 if (ret == 0) {
210 tmp = ioremap(dev->res.start, SZ_4K);
211 if (!tmp) {
212 ret = -ENOMEM;
213 goto out;
214 }
215
216 for (pid = 0, i = 0; i < 4; i++)
217 pid |= (readl(tmp + 0xfe0 + 4 * i) & 255) << (i * 8);
218 for (cid = 0, i = 0; i < 4; i++)
219 cid |= (readl(tmp + 0xff0 + 4 * i) & 255) << (i * 8);
220
221 iounmap(tmp);
222
223 if (cid == 0xb105f00d)
224 dev->periphid = pid;
225
226 if (dev->periphid)
227 ret = device_register(&dev->dev);
228 else
229 ret = -ENODEV;
230
231 if (ret == 0) {
232 device_create_file(&dev->dev, &dev_attr_id);
233 if (dev->irq[0] != NO_IRQ)
234 device_create_file(&dev->dev, &dev_attr_irq0);
235 if (dev->irq[1] != NO_IRQ)
236 device_create_file(&dev->dev, &dev_attr_irq1);
237 device_create_file(&dev->dev, &dev_attr_resource);
238 } else {
239 out:
240 release_resource(&dev->res);
241 }
242 }
243 return ret;
244}
245
246/**
247 * amba_device_unregister - unregister an AMBA device
248 * @dev: AMBA device to remove
249 *
250 * Remove the specified AMBA device from the Linux device
251 * manager. All files associated with this object will be
252 * destroyed, and device drivers notified that the device has
253 * been removed. The AMBA device's resources including
254 * the amba_device structure will be freed once all
255 * references to it have been dropped.
256 */
257void amba_device_unregister(struct amba_device *dev)
258{
259 device_unregister(&dev->dev);
260}
261
262
263struct find_data {
264 struct amba_device *dev;
265 struct device *parent;
266 const char *busid;
267 unsigned int id;
268 unsigned int mask;
269};
270
271static int amba_find_match(struct device *dev, void *data)
272{
273 struct find_data *d = data;
274 struct amba_device *pcdev = to_amba_device(dev);
275 int r;
276
277 r = (pcdev->periphid & d->mask) == d->id;
278 if (d->parent)
279 r &= d->parent == dev->parent;
280 if (d->busid)
281 r &= strcmp(dev->bus_id, d->busid) == 0;
282
283 if (r) {
284 get_device(dev);
285 d->dev = pcdev;
286 }
287
288 return r;
289}
290
291/**
292 * amba_find_device - locate an AMBA device given a bus id
293 * @busid: bus id for device (or NULL)
294 * @parent: parent device (or NULL)
295 * @id: peripheral ID (or 0)
296 * @mask: peripheral ID mask (or 0)
297 *
298 * Return the AMBA device corresponding to the supplied parameters.
299 * If no device matches, returns NULL.
300 *
301 * NOTE: When a valid device is found, its refcount is
302 * incremented, and must be decremented before the returned
303 * reference.
304 */
305struct amba_device *
306amba_find_device(const char *busid, struct device *parent, unsigned int id,
307 unsigned int mask)
308{
309 struct find_data data;
310
311 data.dev = NULL;
312 data.parent = parent;
313 data.busid = busid;
314 data.id = id;
315 data.mask = mask;
316
317 bus_for_each_dev(&amba_bustype, NULL, &data, amba_find_match);
318
319 return data.dev;
320}
321
322/**
323 * amba_request_regions - request all mem regions associated with device
324 * @dev: amba_device structure for device
325 * @name: name, or NULL to use driver name
326 */
327int amba_request_regions(struct amba_device *dev, const char *name)
328{
329 int ret = 0;
330
331 if (!name)
332 name = dev->dev.driver->name;
333
334 if (!request_mem_region(dev->res.start, SZ_4K, name))
335 ret = -EBUSY;
336
337 return ret;
338}
339
340/**
341 * amba_release_regions - release mem regions assoicated with device
342 * @dev: amba_device structure for device
343 *
344 * Release regions claimed by a successful call to amba_request_regions.
345 */
346void amba_release_regions(struct amba_device *dev)
347{
348 release_mem_region(dev->res.start, SZ_4K);
349}
350
351EXPORT_SYMBOL(amba_driver_register);
352EXPORT_SYMBOL(amba_driver_unregister);
353EXPORT_SYMBOL(amba_device_register);
354EXPORT_SYMBOL(amba_device_unregister);
355EXPORT_SYMBOL(amba_find_device);
356EXPORT_SYMBOL(amba_request_regions);
357EXPORT_SYMBOL(amba_release_regions);
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
new file mode 100644
index 000000000000..5797b1b100a1
--- /dev/null
+++ b/arch/arm/common/dmabounce.c
@@ -0,0 +1,682 @@
1/*
2 * arch/arm/common/dmabounce.c
3 *
4 * Special dma_{map/unmap/dma_sync}_* routines for systems that have
5 * limited DMA windows. These functions utilize bounce buffers to
6 * copy data to/from buffers located outside the DMA region. This
7 * only works for systems in which DMA memory is at the bottom of
8 * RAM and the remainder of memory is at the top an the DMA memory
9 * can be marked as ZONE_DMA. Anything beyond that such as discontigous
10 * DMA windows will require custom implementations that reserve memory
11 * areas at early bootup.
12 *
13 * Original version by Brad Parker (brad@heeltoe.com)
14 * Re-written by Christopher Hoover <ch@murgatroid.com>
15 * Made generic by Deepak Saxena <dsaxena@plexity.net>
16 *
17 * Copyright (C) 2002 Hewlett Packard Company.
18 * Copyright (C) 2004 MontaVista Software, Inc.
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 * version 2 as published by the Free Software Foundation.
23 */
24
25#include <linux/module.h>
26#include <linux/init.h>
27#include <linux/slab.h>
28#include <linux/device.h>
29#include <linux/dma-mapping.h>
30#include <linux/dmapool.h>
31#include <linux/list.h>
32
33#undef DEBUG
34
35#undef STATS
36#ifdef STATS
37#define DO_STATS(X) do { X ; } while (0)
38#else
39#define DO_STATS(X) do { } while (0)
40#endif
41
42/* ************************************************** */
43
44struct safe_buffer {
45 struct list_head node;
46
47 /* original request */
48 void *ptr;
49 size_t size;
50 int direction;
51
52 /* safe buffer info */
53 struct dma_pool *pool;
54 void *safe;
55 dma_addr_t safe_dma_addr;
56};
57
58struct dmabounce_device_info {
59 struct list_head node;
60
61 struct device *dev;
62 struct dma_pool *small_buffer_pool;
63 struct dma_pool *large_buffer_pool;
64 struct list_head safe_buffers;
65 unsigned long small_buffer_size, large_buffer_size;
66#ifdef STATS
67 unsigned long sbp_allocs;
68 unsigned long lbp_allocs;
69 unsigned long total_allocs;
70 unsigned long map_op_count;
71 unsigned long bounce_count;
72#endif
73};
74
75static LIST_HEAD(dmabounce_devs);
76
77#ifdef STATS
78static void print_alloc_stats(struct dmabounce_device_info *device_info)
79{
80 printk(KERN_INFO
81 "%s: dmabounce: sbp: %lu, lbp: %lu, other: %lu, total: %lu\n",
82 device_info->dev->bus_id,
83 device_info->sbp_allocs, device_info->lbp_allocs,
84 device_info->total_allocs - device_info->sbp_allocs -
85 device_info->lbp_allocs,
86 device_info->total_allocs);
87}
88#endif
89
90/* find the given device in the dmabounce device list */
91static inline struct dmabounce_device_info *
92find_dmabounce_dev(struct device *dev)
93{
94 struct list_head *entry;
95
96 list_for_each(entry, &dmabounce_devs) {
97 struct dmabounce_device_info *d =
98 list_entry(entry, struct dmabounce_device_info, node);
99
100 if (d->dev == dev)
101 return d;
102 }
103 return NULL;
104}
105
106
107/* allocate a 'safe' buffer and keep track of it */
108static inline struct safe_buffer *
109alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr,
110 size_t size, enum dma_data_direction dir)
111{
112 struct safe_buffer *buf;
113 struct dma_pool *pool;
114 struct device *dev = device_info->dev;
115 void *safe;
116 dma_addr_t safe_dma_addr;
117
118 dev_dbg(dev, "%s(ptr=%p, size=%d, dir=%d)\n",
119 __func__, ptr, size, dir);
120
121 DO_STATS ( device_info->total_allocs++ );
122
123 buf = kmalloc(sizeof(struct safe_buffer), GFP_ATOMIC);
124 if (buf == NULL) {
125 dev_warn(dev, "%s: kmalloc failed\n", __func__);
126 return NULL;
127 }
128
129 if (size <= device_info->small_buffer_size) {
130 pool = device_info->small_buffer_pool;
131 safe = dma_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr);
132
133 DO_STATS ( device_info->sbp_allocs++ );
134 } else if (size <= device_info->large_buffer_size) {
135 pool = device_info->large_buffer_pool;
136 safe = dma_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr);
137
138 DO_STATS ( device_info->lbp_allocs++ );
139 } else {
140 pool = NULL;
141 safe = dma_alloc_coherent(dev, size, &safe_dma_addr, GFP_ATOMIC);
142 }
143
144 if (safe == NULL) {
145 dev_warn(device_info->dev,
146 "%s: could not alloc dma memory (size=%d)\n",
147 __func__, size);
148 kfree(buf);
149 return NULL;
150 }
151
152#ifdef STATS
153 if (device_info->total_allocs % 1000 == 0)
154 print_alloc_stats(device_info);
155#endif
156
157 buf->ptr = ptr;
158 buf->size = size;
159 buf->direction = dir;
160 buf->pool = pool;
161 buf->safe = safe;
162 buf->safe_dma_addr = safe_dma_addr;
163
164 list_add(&buf->node, &device_info->safe_buffers);
165
166 return buf;
167}
168
169/* determine if a buffer is from our "safe" pool */
170static inline struct safe_buffer *
171find_safe_buffer(struct dmabounce_device_info *device_info, dma_addr_t safe_dma_addr)
172{
173 struct list_head *entry;
174
175 list_for_each(entry, &device_info->safe_buffers) {
176 struct safe_buffer *b =
177 list_entry(entry, struct safe_buffer, node);
178
179 if (b->safe_dma_addr == safe_dma_addr)
180 return b;
181 }
182
183 return NULL;
184}
185
186static inline void
187free_safe_buffer(struct dmabounce_device_info *device_info, struct safe_buffer *buf)
188{
189 dev_dbg(device_info->dev, "%s(buf=%p)\n", __func__, buf);
190
191 list_del(&buf->node);
192
193 if (buf->pool)
194 dma_pool_free(buf->pool, buf->safe, buf->safe_dma_addr);
195 else
196 dma_free_coherent(device_info->dev, buf->size, buf->safe,
197 buf->safe_dma_addr);
198
199 kfree(buf);
200}
201
202/* ************************************************** */
203
204#ifdef STATS
205
206static void print_map_stats(struct dmabounce_device_info *device_info)
207{
208 printk(KERN_INFO
209 "%s: dmabounce: map_op_count=%lu, bounce_count=%lu\n",
210 device_info->dev->bus_id,
211 device_info->map_op_count, device_info->bounce_count);
212}
213#endif
214
215static inline dma_addr_t
216map_single(struct device *dev, void *ptr, size_t size,
217 enum dma_data_direction dir)
218{
219 struct dmabounce_device_info *device_info = find_dmabounce_dev(dev);
220 dma_addr_t dma_addr;
221 int needs_bounce = 0;
222
223 if (device_info)
224 DO_STATS ( device_info->map_op_count++ );
225
226 dma_addr = virt_to_dma(dev, ptr);
227
228 if (dev->dma_mask) {
229 unsigned long mask = *dev->dma_mask;
230 unsigned long limit;
231
232 limit = (mask + 1) & ~mask;
233 if (limit && size > limit) {
234 dev_err(dev, "DMA mapping too big (requested %#x "
235 "mask %#Lx)\n", size, *dev->dma_mask);
236 return ~0;
237 }
238
239 /*
240 * Figure out if we need to bounce from the DMA mask.
241 */
242 needs_bounce = (dma_addr | (dma_addr + size - 1)) & ~mask;
243 }
244
245 if (device_info && (needs_bounce || dma_needs_bounce(dev, dma_addr, size))) {
246 struct safe_buffer *buf;
247
248 buf = alloc_safe_buffer(device_info, ptr, size, dir);
249 if (buf == 0) {
250 dev_err(dev, "%s: unable to map unsafe buffer %p!\n",
251 __func__, ptr);
252 return 0;
253 }
254
255 dev_dbg(dev,
256 "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n",
257 __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr),
258 buf->safe, (void *) buf->safe_dma_addr);
259
260 if ((dir == DMA_TO_DEVICE) ||
261 (dir == DMA_BIDIRECTIONAL)) {
262 dev_dbg(dev, "%s: copy unsafe %p to safe %p, size %d\n",
263 __func__, ptr, buf->safe, size);
264 memcpy(buf->safe, ptr, size);
265 }
266 consistent_sync(buf->safe, size, dir);
267
268 dma_addr = buf->safe_dma_addr;
269 } else {
270 consistent_sync(ptr, size, dir);
271 }
272
273 return dma_addr;
274}
275
276static inline void
277unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
278 enum dma_data_direction dir)
279{
280 struct dmabounce_device_info *device_info = find_dmabounce_dev(dev);
281 struct safe_buffer *buf = NULL;
282
283 /*
284 * Trying to unmap an invalid mapping
285 */
286 if (dma_addr == ~0) {
287 dev_err(dev, "Trying to unmap invalid mapping\n");
288 return;
289 }
290
291 if (device_info)
292 buf = find_safe_buffer(device_info, dma_addr);
293
294 if (buf) {
295 BUG_ON(buf->size != size);
296
297 dev_dbg(dev,
298 "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n",
299 __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr),
300 buf->safe, (void *) buf->safe_dma_addr);
301
302
303 DO_STATS ( device_info->bounce_count++ );
304
305 if ((dir == DMA_FROM_DEVICE) ||
306 (dir == DMA_BIDIRECTIONAL)) {
307 dev_dbg(dev,
308 "%s: copy back safe %p to unsafe %p size %d\n",
309 __func__, buf->safe, buf->ptr, size);
310 memcpy(buf->ptr, buf->safe, size);
311 }
312 free_safe_buffer(device_info, buf);
313 }
314}
315
316static inline void
317sync_single(struct device *dev, dma_addr_t dma_addr, size_t size,
318 enum dma_data_direction dir)
319{
320 struct dmabounce_device_info *device_info = find_dmabounce_dev(dev);
321 struct safe_buffer *buf = NULL;
322
323 if (device_info)
324 buf = find_safe_buffer(device_info, dma_addr);
325
326 if (buf) {
327 /*
328 * Both of these checks from original code need to be
329 * commented out b/c some drivers rely on the following:
330 *
331 * 1) Drivers may map a large chunk of memory into DMA space
332 * but only sync a small portion of it. Good example is
333 * allocating a large buffer, mapping it, and then
334 * breaking it up into small descriptors. No point
335 * in syncing the whole buffer if you only have to
336 * touch one descriptor.
337 *
338 * 2) Buffers that are mapped as DMA_BIDIRECTIONAL are
339 * usually only synced in one dir at a time.
340 *
341 * See drivers/net/eepro100.c for examples of both cases.
342 *
343 * -ds
344 *
345 * BUG_ON(buf->size != size);
346 * BUG_ON(buf->direction != dir);
347 */
348
349 dev_dbg(dev,
350 "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n",
351 __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr),
352 buf->safe, (void *) buf->safe_dma_addr);
353
354 DO_STATS ( device_info->bounce_count++ );
355
356 switch (dir) {
357 case DMA_FROM_DEVICE:
358 dev_dbg(dev,
359 "%s: copy back safe %p to unsafe %p size %d\n",
360 __func__, buf->safe, buf->ptr, size);
361 memcpy(buf->ptr, buf->safe, size);
362 break;
363 case DMA_TO_DEVICE:
364 dev_dbg(dev,
365 "%s: copy out unsafe %p to safe %p, size %d\n",
366 __func__,buf->ptr, buf->safe, size);
367 memcpy(buf->safe, buf->ptr, size);
368 break;
369 case DMA_BIDIRECTIONAL:
370 BUG(); /* is this allowed? what does it mean? */
371 default:
372 BUG();
373 }
374 consistent_sync(buf->safe, size, dir);
375 } else {
376 consistent_sync(dma_to_virt(dev, dma_addr), size, dir);
377 }
378}
379
380/* ************************************************** */
381
382/*
383 * see if a buffer address is in an 'unsafe' range. if it is
384 * allocate a 'safe' buffer and copy the unsafe buffer into it.
385 * substitute the safe buffer for the unsafe one.
386 * (basically move the buffer from an unsafe area to a safe one)
387 */
388dma_addr_t
389dma_map_single(struct device *dev, void *ptr, size_t size,
390 enum dma_data_direction dir)
391{
392 unsigned long flags;
393 dma_addr_t dma_addr;
394
395 dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n",
396 __func__, ptr, size, dir);
397
398 BUG_ON(dir == DMA_NONE);
399
400 local_irq_save(flags);
401
402 dma_addr = map_single(dev, ptr, size, dir);
403
404 local_irq_restore(flags);
405
406 return dma_addr;
407}
408
409/*
410 * see if a mapped address was really a "safe" buffer and if so, copy
411 * the data from the safe buffer back to the unsafe buffer and free up
412 * the safe buffer. (basically return things back to the way they
413 * should be)
414 */
415
416void
417dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
418 enum dma_data_direction dir)
419{
420 unsigned long flags;
421
422 dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n",
423 __func__, (void *) dma_addr, size, dir);
424
425 BUG_ON(dir == DMA_NONE);
426
427 local_irq_save(flags);
428
429 unmap_single(dev, dma_addr, size, dir);
430
431 local_irq_restore(flags);
432}
433
434int
435dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
436 enum dma_data_direction dir)
437{
438 unsigned long flags;
439 int i;
440
441 dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n",
442 __func__, sg, nents, dir);
443
444 BUG_ON(dir == DMA_NONE);
445
446 local_irq_save(flags);
447
448 for (i = 0; i < nents; i++, sg++) {
449 struct page *page = sg->page;
450 unsigned int offset = sg->offset;
451 unsigned int length = sg->length;
452 void *ptr = page_address(page) + offset;
453
454 sg->dma_address =
455 map_single(dev, ptr, length, dir);
456 }
457
458 local_irq_restore(flags);
459
460 return nents;
461}
462
463void
464dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
465 enum dma_data_direction dir)
466{
467 unsigned long flags;
468 int i;
469
470 dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n",
471 __func__, sg, nents, dir);
472
473 BUG_ON(dir == DMA_NONE);
474
475 local_irq_save(flags);
476
477 for (i = 0; i < nents; i++, sg++) {
478 dma_addr_t dma_addr = sg->dma_address;
479 unsigned int length = sg->length;
480
481 unmap_single(dev, dma_addr, length, dir);
482 }
483
484 local_irq_restore(flags);
485}
486
487void
488dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_addr, size_t size,
489 enum dma_data_direction dir)
490{
491 unsigned long flags;
492
493 dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n",
494 __func__, (void *) dma_addr, size, dir);
495
496 local_irq_save(flags);
497
498 sync_single(dev, dma_addr, size, dir);
499
500 local_irq_restore(flags);
501}
502
503void
504dma_sync_single_for_device(struct device *dev, dma_addr_t dma_addr, size_t size,
505 enum dma_data_direction dir)
506{
507 unsigned long flags;
508
509 dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n",
510 __func__, (void *) dma_addr, size, dir);
511
512 local_irq_save(flags);
513
514 sync_single(dev, dma_addr, size, dir);
515
516 local_irq_restore(flags);
517}
518
519void
520dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents,
521 enum dma_data_direction dir)
522{
523 unsigned long flags;
524 int i;
525
526 dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n",
527 __func__, sg, nents, dir);
528
529 BUG_ON(dir == DMA_NONE);
530
531 local_irq_save(flags);
532
533 for (i = 0; i < nents; i++, sg++) {
534 dma_addr_t dma_addr = sg->dma_address;
535 unsigned int length = sg->length;
536
537 sync_single(dev, dma_addr, length, dir);
538 }
539
540 local_irq_restore(flags);
541}
542
543void
544dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
545 enum dma_data_direction dir)
546{
547 unsigned long flags;
548 int i;
549
550 dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n",
551 __func__, sg, nents, dir);
552
553 BUG_ON(dir == DMA_NONE);
554
555 local_irq_save(flags);
556
557 for (i = 0; i < nents; i++, sg++) {
558 dma_addr_t dma_addr = sg->dma_address;
559 unsigned int length = sg->length;
560
561 sync_single(dev, dma_addr, length, dir);
562 }
563
564 local_irq_restore(flags);
565}
566
567int
568dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
569 unsigned long large_buffer_size)
570{
571 struct dmabounce_device_info *device_info;
572
573 device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC);
574 if (!device_info) {
575 printk(KERN_ERR
576 "Could not allocated dmabounce_device_info for %s",
577 dev->bus_id);
578 return -ENOMEM;
579 }
580
581 device_info->small_buffer_pool =
582 dma_pool_create("small_dmabounce_pool",
583 dev,
584 small_buffer_size,
585 0 /* byte alignment */,
586 0 /* no page-crossing issues */);
587 if (!device_info->small_buffer_pool) {
588 printk(KERN_ERR
589 "dmabounce: could not allocate small DMA pool for %s\n",
590 dev->bus_id);
591 kfree(device_info);
592 return -ENOMEM;
593 }
594
595 if (large_buffer_size) {
596 device_info->large_buffer_pool =
597 dma_pool_create("large_dmabounce_pool",
598 dev,
599 large_buffer_size,
600 0 /* byte alignment */,
601 0 /* no page-crossing issues */);
602 if (!device_info->large_buffer_pool) {
603 printk(KERN_ERR
604 "dmabounce: could not allocate large DMA pool for %s\n",
605 dev->bus_id);
606 dma_pool_destroy(device_info->small_buffer_pool);
607
608 return -ENOMEM;
609 }
610 }
611
612 device_info->dev = dev;
613 device_info->small_buffer_size = small_buffer_size;
614 device_info->large_buffer_size = large_buffer_size;
615 INIT_LIST_HEAD(&device_info->safe_buffers);
616
617#ifdef STATS
618 device_info->sbp_allocs = 0;
619 device_info->lbp_allocs = 0;
620 device_info->total_allocs = 0;
621 device_info->map_op_count = 0;
622 device_info->bounce_count = 0;
623#endif
624
625 list_add(&device_info->node, &dmabounce_devs);
626
627 printk(KERN_INFO "dmabounce: registered device %s on %s bus\n",
628 dev->bus_id, dev->bus->name);
629
630 return 0;
631}
632
633void
634dmabounce_unregister_dev(struct device *dev)
635{
636 struct dmabounce_device_info *device_info = find_dmabounce_dev(dev);
637
638 if (!device_info) {
639 printk(KERN_WARNING
640 "%s: Never registered with dmabounce but attempting" \
641 "to unregister!\n", dev->bus_id);
642 return;
643 }
644
645 if (!list_empty(&device_info->safe_buffers)) {
646 printk(KERN_ERR
647 "%s: Removing from dmabounce with pending buffers!\n",
648 dev->bus_id);
649 BUG();
650 }
651
652 if (device_info->small_buffer_pool)
653 dma_pool_destroy(device_info->small_buffer_pool);
654 if (device_info->large_buffer_pool)
655 dma_pool_destroy(device_info->large_buffer_pool);
656
657#ifdef STATS
658 print_alloc_stats(device_info);
659 print_map_stats(device_info);
660#endif
661
662 list_del(&device_info->node);
663
664 kfree(device_info);
665
666 printk(KERN_INFO "dmabounce: device %s on %s bus unregistered\n",
667 dev->bus_id, dev->bus->name);
668}
669
670
671EXPORT_SYMBOL(dma_map_single);
672EXPORT_SYMBOL(dma_unmap_single);
673EXPORT_SYMBOL(dma_map_sg);
674EXPORT_SYMBOL(dma_unmap_sg);
675EXPORT_SYMBOL(dma_sync_single);
676EXPORT_SYMBOL(dma_sync_sg);
677EXPORT_SYMBOL(dmabounce_register_dev);
678EXPORT_SYMBOL(dmabounce_unregister_dev);
679
680MODULE_AUTHOR("Christopher Hoover <ch@hpl.hp.com>, Deepak Saxena <dsaxena@plexity.net>");
681MODULE_DESCRIPTION("Special dma_{map/unmap/dma_sync}_* routines for systems with limited DMA windows");
682MODULE_LICENSE("GPL");
diff --git a/arch/arm/common/icst307.c b/arch/arm/common/icst307.c
new file mode 100644
index 000000000000..bafe8b19be82
--- /dev/null
+++ b/arch/arm/common/icst307.c
@@ -0,0 +1,161 @@
1/*
2 * linux/arch/arm/common/icst307.c
3 *
4 * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Support functions for calculating clocks/divisors for the ICST307
11 * clock generators. See http://www.icst.com/ for more information
12 * on these devices.
13 *
14 * This is an almost identical implementation to the ICST525 clock generator.
15 * The s2div and idx2s files are different
16 */
17#include <linux/module.h>
18#include <linux/kernel.h>
19
20#include <asm/hardware/icst307.h>
21
22/*
23 * Divisors for each OD setting.
24 */
25static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 3, 6 };
26
27unsigned long icst307_khz(const struct icst307_params *p, struct icst307_vco vco)
28{
29 return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]);
30}
31
32EXPORT_SYMBOL(icst307_khz);
33
34/*
35 * Ascending divisor S values.
36 */
37static unsigned char idx2s[8] = { 1, 6, 3, 4, 7, 5, 2, 0 };
38
39struct icst307_vco
40icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq)
41{
42 struct icst307_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
43 unsigned long f;
44 unsigned int i = 0, rd, best = (unsigned int)-1;
45
46 /*
47 * First, find the PLL output divisor such
48 * that the PLL output is within spec.
49 */
50 do {
51 f = freq * s2div[idx2s[i]];
52
53 /*
54 * f must be between 6MHz and 200MHz (3.3 or 5V)
55 */
56 if (f > 6000 && f <= p->vco_max)
57 break;
58 } while (i < ARRAY_SIZE(idx2s));
59
60 if (i > ARRAY_SIZE(idx2s))
61 return vco;
62
63 vco.s = idx2s[i];
64
65 /*
66 * Now find the closest divisor combination
67 * which gives a PLL output of 'f'.
68 */
69 for (rd = p->rd_min; rd <= p->rd_max; rd++) {
70 unsigned long fref_div, f_pll;
71 unsigned int vd;
72 int f_diff;
73
74 fref_div = (2 * p->ref) / rd;
75
76 vd = (f + fref_div / 2) / fref_div;
77 if (vd < p->vd_min || vd > p->vd_max)
78 continue;
79
80 f_pll = fref_div * vd;
81 f_diff = f_pll - f;
82 if (f_diff < 0)
83 f_diff = -f_diff;
84
85 if ((unsigned)f_diff < best) {
86 vco.v = vd - 8;
87 vco.r = rd - 2;
88 if (f_diff == 0)
89 break;
90 best = f_diff;
91 }
92 }
93
94 return vco;
95}
96
97EXPORT_SYMBOL(icst307_khz_to_vco);
98
99struct icst307_vco
100icst307_ps_to_vco(const struct icst307_params *p, unsigned long period)
101{
102 struct icst307_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
103 unsigned long f, ps;
104 unsigned int i = 0, rd, best = (unsigned int)-1;
105
106 ps = 1000000000UL / p->vco_max;
107
108 /*
109 * First, find the PLL output divisor such
110 * that the PLL output is within spec.
111 */
112 do {
113 f = period / s2div[idx2s[i]];
114
115 /*
116 * f must be between 6MHz and 200MHz (3.3 or 5V)
117 */
118 if (f >= ps && f < 1000000000UL / 6000 + 1)
119 break;
120 } while (i < ARRAY_SIZE(idx2s));
121
122 if (i > ARRAY_SIZE(idx2s))
123 return vco;
124
125 vco.s = idx2s[i];
126
127 ps = 500000000UL / p->ref;
128
129 /*
130 * Now find the closest divisor combination
131 * which gives a PLL output of 'f'.
132 */
133 for (rd = p->rd_min; rd <= p->rd_max; rd++) {
134 unsigned long f_in_div, f_pll;
135 unsigned int vd;
136 int f_diff;
137
138 f_in_div = ps * rd;
139
140 vd = (f_in_div + f / 2) / f;
141 if (vd < p->vd_min || vd > p->vd_max)
142 continue;
143
144 f_pll = (f_in_div + vd / 2) / vd;
145 f_diff = f_pll - f;
146 if (f_diff < 0)
147 f_diff = -f_diff;
148
149 if ((unsigned)f_diff < best) {
150 vco.v = vd - 8;
151 vco.r = rd - 2;
152 if (f_diff == 0)
153 break;
154 best = f_diff;
155 }
156 }
157
158 return vco;
159}
160
161EXPORT_SYMBOL(icst307_ps_to_vco);
diff --git a/arch/arm/common/icst525.c b/arch/arm/common/icst525.c
new file mode 100644
index 000000000000..943ef88c0379
--- /dev/null
+++ b/arch/arm/common/icst525.c
@@ -0,0 +1,160 @@
1/*
2 * linux/arch/arm/common/icst525.c
3 *
4 * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Support functions for calculating clocks/divisors for the ICST525
11 * clock generators. See http://www.icst.com/ for more information
12 * on these devices.
13 */
14#include <linux/module.h>
15#include <linux/kernel.h>
16
17#include <asm/hardware/icst525.h>
18
19/*
20 * Divisors for each OD setting.
21 */
22static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 9, 6 };
23
24unsigned long icst525_khz(const struct icst525_params *p, struct icst525_vco vco)
25{
26 return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]);
27}
28
29EXPORT_SYMBOL(icst525_khz);
30
31/*
32 * Ascending divisor S values.
33 */
34static unsigned char idx2s[] = { 1, 3, 4, 7, 5, 2, 6, 0 };
35
36struct icst525_vco
37icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq)
38{
39 struct icst525_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
40 unsigned long f;
41 unsigned int i = 0, rd, best = (unsigned int)-1;
42
43 /*
44 * First, find the PLL output divisor such
45 * that the PLL output is within spec.
46 */
47 do {
48 f = freq * s2div[idx2s[i]];
49
50 /*
51 * f must be between 10MHz and
52 * 320MHz (5V) or 200MHz (3V)
53 */
54 if (f > 10000 && f <= p->vco_max)
55 break;
56 } while (i < ARRAY_SIZE(idx2s));
57
58 if (i > ARRAY_SIZE(idx2s))
59 return vco;
60
61 vco.s = idx2s[i];
62
63 /*
64 * Now find the closest divisor combination
65 * which gives a PLL output of 'f'.
66 */
67 for (rd = p->rd_min; rd <= p->rd_max; rd++) {
68 unsigned long fref_div, f_pll;
69 unsigned int vd;
70 int f_diff;
71
72 fref_div = (2 * p->ref) / rd;
73
74 vd = (f + fref_div / 2) / fref_div;
75 if (vd < p->vd_min || vd > p->vd_max)
76 continue;
77
78 f_pll = fref_div * vd;
79 f_diff = f_pll - f;
80 if (f_diff < 0)
81 f_diff = -f_diff;
82
83 if ((unsigned)f_diff < best) {
84 vco.v = vd - 8;
85 vco.r = rd - 2;
86 if (f_diff == 0)
87 break;
88 best = f_diff;
89 }
90 }
91
92 return vco;
93}
94
95EXPORT_SYMBOL(icst525_khz_to_vco);
96
97struct icst525_vco
98icst525_ps_to_vco(const struct icst525_params *p, unsigned long period)
99{
100 struct icst525_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
101 unsigned long f, ps;
102 unsigned int i = 0, rd, best = (unsigned int)-1;
103
104 ps = 1000000000UL / p->vco_max;
105
106 /*
107 * First, find the PLL output divisor such
108 * that the PLL output is within spec.
109 */
110 do {
111 f = period / s2div[idx2s[i]];
112
113 /*
114 * f must be between 10MHz and
115 * 320MHz (5V) or 200MHz (3V)
116 */
117 if (f >= ps && f < 100000)
118 break;
119 } while (i < ARRAY_SIZE(idx2s));
120
121 if (i > ARRAY_SIZE(idx2s))
122 return vco;
123
124 vco.s = idx2s[i];
125
126 ps = 500000000UL / p->ref;
127
128 /*
129 * Now find the closest divisor combination
130 * which gives a PLL output of 'f'.
131 */
132 for (rd = p->rd_min; rd <= p->rd_max; rd++) {
133 unsigned long f_in_div, f_pll;
134 unsigned int vd;
135 int f_diff;
136
137 f_in_div = ps * rd;
138
139 vd = (f_in_div + f / 2) / f;
140 if (vd < p->vd_min || vd > p->vd_max)
141 continue;
142
143 f_pll = (f_in_div + vd / 2) / vd;
144 f_diff = f_pll - f;
145 if (f_diff < 0)
146 f_diff = -f_diff;
147
148 if ((unsigned)f_diff < best) {
149 vco.v = vd - 8;
150 vco.r = rd - 2;
151 if (f_diff == 0)
152 break;
153 best = f_diff;
154 }
155 }
156
157 return vco;
158}
159
160EXPORT_SYMBOL(icst525_ps_to_vco);
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
new file mode 100644
index 000000000000..41f12658c8b4
--- /dev/null
+++ b/arch/arm/common/locomo.c
@@ -0,0 +1,1058 @@
1/*
2 * linux/arch/arm/common/locomo.c
3 *
4 * Sharp LoCoMo support
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This file contains all generic LoCoMo support.
11 *
12 * All initialization functions provided here are intended to be called
13 * from machine specific code with proper arguments when required.
14 *
15 * Based on sa1111.c
16 */
17
18#include <linux/config.h>
19#include <linux/module.h>
20#include <linux/init.h>
21#include <linux/kernel.h>
22#include <linux/delay.h>
23#include <linux/errno.h>
24#include <linux/ioport.h>
25#include <linux/device.h>
26#include <linux/slab.h>
27#include <linux/spinlock.h>
28
29#include <asm/hardware.h>
30#include <asm/mach-types.h>
31#include <asm/io.h>
32#include <asm/irq.h>
33#include <asm/mach/irq.h>
34
35#include <asm/hardware/locomo.h>
36
37/* M62332 output channel selection */
38#define M62332_EVR_CH 1 /* M62332 volume channel number */
39 /* 0 : CH.1 , 1 : CH. 2 */
40/* DAC send data */
41#define M62332_SLAVE_ADDR 0x4e /* Slave address */
42#define M62332_W_BIT 0x00 /* W bit (0 only) */
43#define M62332_SUB_ADDR 0x00 /* Sub address */
44#define M62332_A_BIT 0x00 /* A bit (0 only) */
45
46/* DAC setup and hold times (expressed in us) */
47#define DAC_BUS_FREE_TIME 5 /* 4.7 us */
48#define DAC_START_SETUP_TIME 5 /* 4.7 us */
49#define DAC_STOP_SETUP_TIME 4 /* 4.0 us */
50#define DAC_START_HOLD_TIME 5 /* 4.7 us */
51#define DAC_SCL_LOW_HOLD_TIME 5 /* 4.7 us */
52#define DAC_SCL_HIGH_HOLD_TIME 4 /* 4.0 us */
53#define DAC_DATA_SETUP_TIME 1 /* 250 ns */
54#define DAC_DATA_HOLD_TIME 1 /* 300 ns */
55#define DAC_LOW_SETUP_TIME 1 /* 300 ns */
56#define DAC_HIGH_SETUP_TIME 1 /* 1000 ns */
57
58/* the following is the overall data for the locomo chip */
59struct locomo {
60 struct device *dev;
61 unsigned long phys;
62 unsigned int irq;
63 spinlock_t lock;
64 void *base;
65};
66
67struct locomo_dev_info {
68 unsigned long offset;
69 unsigned long length;
70 unsigned int devid;
71 unsigned int irq[1];
72 const char * name;
73};
74
75/* All the locomo devices. If offset is non-zero, the mapbase for the
76 * locomo_dev will be set to the chip base plus offset. If offset is
77 * zero, then the mapbase for the locomo_dev will be set to zero. An
78 * offset of zero means the device only uses GPIOs or other helper
79 * functions inside this file */
80static struct locomo_dev_info locomo_devices[] = {
81 {
82 .devid = LOCOMO_DEVID_KEYBOARD,
83 .irq = {
84 IRQ_LOCOMO_KEY,
85 },
86 .name = "locomo-keyboard",
87 .offset = LOCOMO_KEYBOARD,
88 .length = 16,
89 },
90 {
91 .devid = LOCOMO_DEVID_FRONTLIGHT,
92 .irq = {},
93 .name = "locomo-frontlight",
94 .offset = LOCOMO_FRONTLIGHT,
95 .length = 8,
96
97 },
98 {
99 .devid = LOCOMO_DEVID_BACKLIGHT,
100 .irq = {},
101 .name = "locomo-backlight",
102 .offset = LOCOMO_BACKLIGHT,
103 .length = 8,
104 },
105 {
106 .devid = LOCOMO_DEVID_AUDIO,
107 .irq = {},
108 .name = "locomo-audio",
109 .offset = LOCOMO_AUDIO,
110 .length = 4,
111 },
112 {
113 .devid = LOCOMO_DEVID_LED,
114 .irq = {},
115 .name = "locomo-led",
116 .offset = LOCOMO_LED,
117 .length = 8,
118 },
119 {
120 .devid = LOCOMO_DEVID_UART,
121 .irq = {},
122 .name = "locomo-uart",
123 .offset = 0,
124 .length = 0,
125 },
126};
127
128
129/** LoCoMo interrupt handling stuff.
130 * NOTE: LoCoMo has a 1 to many mapping on all of its IRQs.
131 * that is, there is only one real hardware interrupt
132 * we determine which interrupt it is by reading some IO memory.
133 * We have two levels of expansion, first in the handler for the
134 * hardware interrupt we generate an interrupt
135 * IRQ_LOCOMO_*_BASE and those handlers generate more interrupts
136 *
137 * hardware irq reads LOCOMO_ICR & 0x0f00
138 * IRQ_LOCOMO_KEY_BASE
139 * IRQ_LOCOMO_GPIO_BASE
140 * IRQ_LOCOMO_LT_BASE
141 * IRQ_LOCOMO_SPI_BASE
142 * IRQ_LOCOMO_KEY_BASE reads LOCOMO_KIC & 0x0001
143 * IRQ_LOCOMO_KEY
144 * IRQ_LOCOMO_GPIO_BASE reads LOCOMO_GIR & LOCOMO_GPD & 0xffff
145 * IRQ_LOCOMO_GPIO[0-15]
146 * IRQ_LOCOMO_LT_BASE reads LOCOMO_LTINT & 0x0001
147 * IRQ_LOCOMO_LT
148 * IRQ_LOCOMO_SPI_BASE reads LOCOMO_SPIIR & 0x000F
149 * IRQ_LOCOMO_SPI_RFR
150 * IRQ_LOCOMO_SPI_RFW
151 * IRQ_LOCOMO_SPI_OVRN
152 * IRQ_LOCOMO_SPI_TEND
153 */
154
155#define LOCOMO_IRQ_START (IRQ_LOCOMO_KEY_BASE)
156#define LOCOMO_IRQ_KEY_START (IRQ_LOCOMO_KEY)
157#define LOCOMO_IRQ_GPIO_START (IRQ_LOCOMO_GPIO0)
158#define LOCOMO_IRQ_LT_START (IRQ_LOCOMO_LT)
159#define LOCOMO_IRQ_SPI_START (IRQ_LOCOMO_SPI_RFR)
160
161static void locomo_handler(unsigned int irq, struct irqdesc *desc,
162 struct pt_regs *regs)
163{
164 int req, i;
165 struct irqdesc *d;
166 void *mapbase = get_irq_chipdata(irq);
167
168 /* Acknowledge the parent IRQ */
169 desc->chip->ack(irq);
170
171 /* check why this interrupt was generated */
172 req = locomo_readl(mapbase + LOCOMO_ICR) & 0x0f00;
173
174 if (req) {
175 /* generate the next interrupt(s) */
176 irq = LOCOMO_IRQ_START;
177 d = irq_desc + irq;
178 for (i = 0; i <= 3; i++, d++, irq++) {
179 if (req & (0x0100 << i)) {
180 d->handle(irq, d, regs);
181 }
182
183 }
184 }
185}
186
187static void locomo_ack_irq(unsigned int irq)
188{
189}
190
191static void locomo_mask_irq(unsigned int irq)
192{
193 void *mapbase = get_irq_chipdata(irq);
194 unsigned int r;
195 r = locomo_readl(mapbase + LOCOMO_ICR);
196 r &= ~(0x0010 << (irq - LOCOMO_IRQ_START));
197 locomo_writel(r, mapbase + LOCOMO_ICR);
198}
199
200static void locomo_unmask_irq(unsigned int irq)
201{
202 void *mapbase = get_irq_chipdata(irq);
203 unsigned int r;
204 r = locomo_readl(mapbase + LOCOMO_ICR);
205 r |= (0x0010 << (irq - LOCOMO_IRQ_START));
206 locomo_writel(r, mapbase + LOCOMO_ICR);
207}
208
209static struct irqchip locomo_chip = {
210 .ack = locomo_ack_irq,
211 .mask = locomo_mask_irq,
212 .unmask = locomo_unmask_irq,
213};
214
215static void locomo_key_handler(unsigned int irq, struct irqdesc *desc,
216 struct pt_regs *regs)
217{
218 struct irqdesc *d;
219 void *mapbase = get_irq_chipdata(irq);
220
221 if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) {
222 d = irq_desc + LOCOMO_IRQ_KEY_START;
223 d->handle(LOCOMO_IRQ_KEY_START, d, regs);
224 }
225}
226
227static void locomo_key_ack_irq(unsigned int irq)
228{
229 void *mapbase = get_irq_chipdata(irq);
230 unsigned int r;
231 r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
232 r &= ~(0x0100 << (irq - LOCOMO_IRQ_KEY_START));
233 locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
234}
235
236static void locomo_key_mask_irq(unsigned int irq)
237{
238 void *mapbase = get_irq_chipdata(irq);
239 unsigned int r;
240 r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
241 r &= ~(0x0010 << (irq - LOCOMO_IRQ_KEY_START));
242 locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
243}
244
245static void locomo_key_unmask_irq(unsigned int irq)
246{
247 void *mapbase = get_irq_chipdata(irq);
248 unsigned int r;
249 r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
250 r |= (0x0010 << (irq - LOCOMO_IRQ_KEY_START));
251 locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
252}
253
254static struct irqchip locomo_key_chip = {
255 .ack = locomo_key_ack_irq,
256 .mask = locomo_key_mask_irq,
257 .unmask = locomo_key_unmask_irq,
258};
259
260static void locomo_gpio_handler(unsigned int irq, struct irqdesc *desc,
261 struct pt_regs *regs)
262{
263 int req, i;
264 struct irqdesc *d;
265 void *mapbase = get_irq_chipdata(irq);
266
267 req = locomo_readl(mapbase + LOCOMO_GIR) &
268 locomo_readl(mapbase + LOCOMO_GPD) &
269 0xffff;
270
271 if (req) {
272 irq = LOCOMO_IRQ_GPIO_START;
273 d = irq_desc + LOCOMO_IRQ_GPIO_START;
274 for (i = 0; i <= 15; i++, irq++, d++) {
275 if (req & (0x0001 << i)) {
276 d->handle(irq, d, regs);
277 }
278 }
279 }
280}
281
282static void locomo_gpio_ack_irq(unsigned int irq)
283{
284 void *mapbase = get_irq_chipdata(irq);
285 unsigned int r;
286 r = locomo_readl(mapbase + LOCOMO_GWE);
287 r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
288 locomo_writel(r, mapbase + LOCOMO_GWE);
289
290 r = locomo_readl(mapbase + LOCOMO_GIS);
291 r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
292 locomo_writel(r, mapbase + LOCOMO_GIS);
293
294 r = locomo_readl(mapbase + LOCOMO_GWE);
295 r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
296 locomo_writel(r, mapbase + LOCOMO_GWE);
297}
298
299static void locomo_gpio_mask_irq(unsigned int irq)
300{
301 void *mapbase = get_irq_chipdata(irq);
302 unsigned int r;
303 r = locomo_readl(mapbase + LOCOMO_GIE);
304 r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
305 locomo_writel(r, mapbase + LOCOMO_GIE);
306}
307
308static void locomo_gpio_unmask_irq(unsigned int irq)
309{
310 void *mapbase = get_irq_chipdata(irq);
311 unsigned int r;
312 r = locomo_readl(mapbase + LOCOMO_GIE);
313 r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
314 locomo_writel(r, mapbase + LOCOMO_GIE);
315}
316
317static struct irqchip locomo_gpio_chip = {
318 .ack = locomo_gpio_ack_irq,
319 .mask = locomo_gpio_mask_irq,
320 .unmask = locomo_gpio_unmask_irq,
321};
322
323static void locomo_lt_handler(unsigned int irq, struct irqdesc *desc,
324 struct pt_regs *regs)
325{
326 struct irqdesc *d;
327 void *mapbase = get_irq_chipdata(irq);
328
329 if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) {
330 d = irq_desc + LOCOMO_IRQ_LT_START;
331 d->handle(LOCOMO_IRQ_LT_START, d, regs);
332 }
333}
334
335static void locomo_lt_ack_irq(unsigned int irq)
336{
337 void *mapbase = get_irq_chipdata(irq);
338 unsigned int r;
339 r = locomo_readl(mapbase + LOCOMO_LTINT);
340 r &= ~(0x0100 << (irq - LOCOMO_IRQ_LT_START));
341 locomo_writel(r, mapbase + LOCOMO_LTINT);
342}
343
344static void locomo_lt_mask_irq(unsigned int irq)
345{
346 void *mapbase = get_irq_chipdata(irq);
347 unsigned int r;
348 r = locomo_readl(mapbase + LOCOMO_LTINT);
349 r &= ~(0x0010 << (irq - LOCOMO_IRQ_LT_START));
350 locomo_writel(r, mapbase + LOCOMO_LTINT);
351}
352
353static void locomo_lt_unmask_irq(unsigned int irq)
354{
355 void *mapbase = get_irq_chipdata(irq);
356 unsigned int r;
357 r = locomo_readl(mapbase + LOCOMO_LTINT);
358 r |= (0x0010 << (irq - LOCOMO_IRQ_LT_START));
359 locomo_writel(r, mapbase + LOCOMO_LTINT);
360}
361
362static struct irqchip locomo_lt_chip = {
363 .ack = locomo_lt_ack_irq,
364 .mask = locomo_lt_mask_irq,
365 .unmask = locomo_lt_unmask_irq,
366};
367
368static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc,
369 struct pt_regs *regs)
370{
371 int req, i;
372 struct irqdesc *d;
373 void *mapbase = get_irq_chipdata(irq);
374
375 req = locomo_readl(mapbase + LOCOMO_SPIIR) & 0x000F;
376 if (req) {
377 irq = LOCOMO_IRQ_SPI_START;
378 d = irq_desc + irq;
379
380 for (i = 0; i <= 3; i++, irq++, d++) {
381 if (req & (0x0001 << i)) {
382 d->handle(irq, d, regs);
383 }
384 }
385 }
386}
387
388static void locomo_spi_ack_irq(unsigned int irq)
389{
390 void *mapbase = get_irq_chipdata(irq);
391 unsigned int r;
392 r = locomo_readl(mapbase + LOCOMO_SPIWE);
393 r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
394 locomo_writel(r, mapbase + LOCOMO_SPIWE);
395
396 r = locomo_readl(mapbase + LOCOMO_SPIIS);
397 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
398 locomo_writel(r, mapbase + LOCOMO_SPIIS);
399
400 r = locomo_readl(mapbase + LOCOMO_SPIWE);
401 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
402 locomo_writel(r, mapbase + LOCOMO_SPIWE);
403}
404
405static void locomo_spi_mask_irq(unsigned int irq)
406{
407 void *mapbase = get_irq_chipdata(irq);
408 unsigned int r;
409 r = locomo_readl(mapbase + LOCOMO_SPIIE);
410 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
411 locomo_writel(r, mapbase + LOCOMO_SPIIE);
412}
413
414static void locomo_spi_unmask_irq(unsigned int irq)
415{
416 void *mapbase = get_irq_chipdata(irq);
417 unsigned int r;
418 r = locomo_readl(mapbase + LOCOMO_SPIIE);
419 r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
420 locomo_writel(r, mapbase + LOCOMO_SPIIE);
421}
422
423static struct irqchip locomo_spi_chip = {
424 .ack = locomo_spi_ack_irq,
425 .mask = locomo_spi_mask_irq,
426 .unmask = locomo_spi_unmask_irq,
427};
428
429static void locomo_setup_irq(struct locomo *lchip)
430{
431 int irq;
432 void *irqbase = lchip->base;
433
434 /*
435 * Install handler for IRQ_LOCOMO_HW.
436 */
437 set_irq_type(lchip->irq, IRQT_FALLING);
438 set_irq_chipdata(lchip->irq, irqbase);
439 set_irq_chained_handler(lchip->irq, locomo_handler);
440
441 /* Install handlers for IRQ_LOCOMO_*_BASE */
442 set_irq_chip(IRQ_LOCOMO_KEY_BASE, &locomo_chip);
443 set_irq_chipdata(IRQ_LOCOMO_KEY_BASE, irqbase);
444 set_irq_chained_handler(IRQ_LOCOMO_KEY_BASE, locomo_key_handler);
445 set_irq_flags(IRQ_LOCOMO_KEY_BASE, IRQF_VALID | IRQF_PROBE);
446
447 set_irq_chip(IRQ_LOCOMO_GPIO_BASE, &locomo_chip);
448 set_irq_chipdata(IRQ_LOCOMO_GPIO_BASE, irqbase);
449 set_irq_chained_handler(IRQ_LOCOMO_GPIO_BASE, locomo_gpio_handler);
450 set_irq_flags(IRQ_LOCOMO_GPIO_BASE, IRQF_VALID | IRQF_PROBE);
451
452 set_irq_chip(IRQ_LOCOMO_LT_BASE, &locomo_chip);
453 set_irq_chipdata(IRQ_LOCOMO_LT_BASE, irqbase);
454 set_irq_chained_handler(IRQ_LOCOMO_LT_BASE, locomo_lt_handler);
455 set_irq_flags(IRQ_LOCOMO_LT_BASE, IRQF_VALID | IRQF_PROBE);
456
457 set_irq_chip(IRQ_LOCOMO_SPI_BASE, &locomo_chip);
458 set_irq_chipdata(IRQ_LOCOMO_SPI_BASE, irqbase);
459 set_irq_chained_handler(IRQ_LOCOMO_SPI_BASE, locomo_spi_handler);
460 set_irq_flags(IRQ_LOCOMO_SPI_BASE, IRQF_VALID | IRQF_PROBE);
461
462 /* install handlers for IRQ_LOCOMO_KEY_BASE generated interrupts */
463 set_irq_chip(LOCOMO_IRQ_KEY_START, &locomo_key_chip);
464 set_irq_chipdata(LOCOMO_IRQ_KEY_START, irqbase);
465 set_irq_handler(LOCOMO_IRQ_KEY_START, do_edge_IRQ);
466 set_irq_flags(LOCOMO_IRQ_KEY_START, IRQF_VALID | IRQF_PROBE);
467
468 /* install handlers for IRQ_LOCOMO_GPIO_BASE generated interrupts */
469 for (irq = LOCOMO_IRQ_GPIO_START; irq < LOCOMO_IRQ_GPIO_START + 16; irq++) {
470 set_irq_chip(irq, &locomo_gpio_chip);
471 set_irq_chipdata(irq, irqbase);
472 set_irq_handler(irq, do_edge_IRQ);
473 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
474 }
475
476 /* install handlers for IRQ_LOCOMO_LT_BASE generated interrupts */
477 set_irq_chip(LOCOMO_IRQ_LT_START, &locomo_lt_chip);
478 set_irq_chipdata(LOCOMO_IRQ_LT_START, irqbase);
479 set_irq_handler(LOCOMO_IRQ_LT_START, do_edge_IRQ);
480 set_irq_flags(LOCOMO_IRQ_LT_START, IRQF_VALID | IRQF_PROBE);
481
482 /* install handlers for IRQ_LOCOMO_SPI_BASE generated interrupts */
483 for (irq = LOCOMO_IRQ_SPI_START; irq < LOCOMO_IRQ_SPI_START + 3; irq++) {
484 set_irq_chip(irq, &locomo_spi_chip);
485 set_irq_chipdata(irq, irqbase);
486 set_irq_handler(irq, do_edge_IRQ);
487 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
488 }
489}
490
491
492static void locomo_dev_release(struct device *_dev)
493{
494 struct locomo_dev *dev = LOCOMO_DEV(_dev);
495
496 kfree(dev);
497}
498
499static int
500locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
501{
502 struct locomo_dev *dev;
503 int ret;
504
505 dev = kmalloc(sizeof(struct locomo_dev), GFP_KERNEL);
506 if (!dev) {
507 ret = -ENOMEM;
508 goto out;
509 }
510 memset(dev, 0, sizeof(struct locomo_dev));
511
512 strncpy(dev->dev.bus_id,info->name,sizeof(dev->dev.bus_id));
513 /*
514 * If the parent device has a DMA mask associated with it,
515 * propagate it down to the children.
516 */
517 if (lchip->dev->dma_mask) {
518 dev->dma_mask = *lchip->dev->dma_mask;
519 dev->dev.dma_mask = &dev->dma_mask;
520 }
521
522 dev->devid = info->devid;
523 dev->dev.parent = lchip->dev;
524 dev->dev.bus = &locomo_bus_type;
525 dev->dev.release = locomo_dev_release;
526 dev->dev.coherent_dma_mask = lchip->dev->coherent_dma_mask;
527
528 if (info->offset)
529 dev->mapbase = lchip->base + info->offset;
530 else
531 dev->mapbase = 0;
532 dev->length = info->length;
533
534 memmove(dev->irq, info->irq, sizeof(dev->irq));
535
536 ret = device_register(&dev->dev);
537 if (ret) {
538 out:
539 kfree(dev);
540 }
541 return ret;
542}
543
544/**
545 * locomo_probe - probe for a single LoCoMo chip.
546 * @phys_addr: physical address of device.
547 *
548 * Probe for a LoCoMo chip. This must be called
549 * before any other locomo-specific code.
550 *
551 * Returns:
552 * %-ENODEV device not found.
553 * %-EBUSY physical address already marked in-use.
554 * %0 successful.
555 */
556static int
557__locomo_probe(struct device *me, struct resource *mem, int irq)
558{
559 struct locomo *lchip;
560 unsigned long r;
561 int i, ret = -ENODEV;
562
563 lchip = kmalloc(sizeof(struct locomo), GFP_KERNEL);
564 if (!lchip)
565 return -ENOMEM;
566
567 memset(lchip, 0, sizeof(struct locomo));
568
569 spin_lock_init(&lchip->lock);
570
571 lchip->dev = me;
572 dev_set_drvdata(lchip->dev, lchip);
573
574 lchip->phys = mem->start;
575 lchip->irq = irq;
576
577 /*
578 * Map the whole region. This also maps the
579 * registers for our children.
580 */
581 lchip->base = ioremap(mem->start, PAGE_SIZE);
582 if (!lchip->base) {
583 ret = -ENOMEM;
584 goto out;
585 }
586
587 /* locomo initialize */
588 locomo_writel(0, lchip->base + LOCOMO_ICR);
589 /* KEYBOARD */
590 locomo_writel(0, lchip->base + LOCOMO_KEYBOARD + LOCOMO_KIC);
591
592 /* GPIO */
593 locomo_writel(0, lchip->base + LOCOMO_GPO);
594 locomo_writel( (LOCOMO_GPIO(2) | LOCOMO_GPIO(3) | LOCOMO_GPIO(13) | LOCOMO_GPIO(14))
595 , lchip->base + LOCOMO_GPE);
596 locomo_writel( (LOCOMO_GPIO(2) | LOCOMO_GPIO(3) | LOCOMO_GPIO(13) | LOCOMO_GPIO(14))
597 , lchip->base + LOCOMO_GPD);
598 locomo_writel(0, lchip->base + LOCOMO_GIE);
599
600 /* FrontLight */
601 locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
602 locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
603 /* Longtime timer */
604 locomo_writel(0, lchip->base + LOCOMO_LTINT);
605 /* SPI */
606 locomo_writel(0, lchip->base + LOCOMO_SPIIE);
607
608 locomo_writel(6 + 8 + 320 + 30 - 10, lchip->base + LOCOMO_ASD);
609 r = locomo_readl(lchip->base + LOCOMO_ASD);
610 r |= 0x8000;
611 locomo_writel(r, lchip->base + LOCOMO_ASD);
612
613 locomo_writel(6 + 8 + 320 + 30 - 10 - 128 + 4, lchip->base + LOCOMO_HSD);
614 r = locomo_readl(lchip->base + LOCOMO_HSD);
615 r |= 0x8000;
616 locomo_writel(r, lchip->base + LOCOMO_HSD);
617
618 locomo_writel(128 / 8, lchip->base + LOCOMO_HSC);
619
620 /* XON */
621 locomo_writel(0x80, lchip->base + LOCOMO_TADC);
622 udelay(1000);
623 /* CLK9MEN */
624 r = locomo_readl(lchip->base + LOCOMO_TADC);
625 r |= 0x10;
626 locomo_writel(r, lchip->base + LOCOMO_TADC);
627 udelay(100);
628
629 /* init DAC */
630 r = locomo_readl(lchip->base + LOCOMO_DAC);
631 r |= LOCOMO_DAC_SCLOEB | LOCOMO_DAC_SDAOEB;
632 locomo_writel(r, lchip->base + LOCOMO_DAC);
633
634 r = locomo_readl(lchip->base + LOCOMO_VER);
635 printk(KERN_INFO "LoCoMo Chip: %lu%lu\n", (r >> 8), (r & 0xff));
636
637 /*
638 * The interrupt controller must be initialised before any
639 * other device to ensure that the interrupts are available.
640 */
641 if (lchip->irq != NO_IRQ)
642 locomo_setup_irq(lchip);
643
644 for (i = 0; i < ARRAY_SIZE(locomo_devices); i++)
645 locomo_init_one_child(lchip, &locomo_devices[i]);
646
647 return 0;
648
649 out:
650 kfree(lchip);
651 return ret;
652}
653
654static void __locomo_remove(struct locomo *lchip)
655{
656 struct list_head *l, *n;
657
658 list_for_each_safe(l, n, &lchip->dev->children) {
659 struct device *d = list_to_dev(l);
660
661 device_unregister(d);
662 }
663
664 if (lchip->irq != NO_IRQ) {
665 set_irq_chained_handler(lchip->irq, NULL);
666 set_irq_data(lchip->irq, NULL);
667 }
668
669 iounmap(lchip->base);
670 kfree(lchip);
671}
672
673static int locomo_probe(struct device *dev)
674{
675 struct platform_device *pdev = to_platform_device(dev);
676 struct resource *mem;
677 int irq;
678
679 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
680 if (!mem)
681 return -EINVAL;
682 irq = platform_get_irq(pdev, 0);
683
684 return __locomo_probe(dev, mem, irq);
685}
686
687static int locomo_remove(struct device *dev)
688{
689 struct locomo *lchip = dev_get_drvdata(dev);
690
691 if (lchip) {
692 __locomo_remove(lchip);
693 dev_set_drvdata(dev, NULL);
694 }
695
696 return 0;
697}
698
699/*
700 * Not sure if this should be on the system bus or not yet.
701 * We really want some way to register a system device at
702 * the per-machine level, and then have this driver pick
703 * up the registered devices.
704 */
705static struct device_driver locomo_device_driver = {
706 .name = "locomo",
707 .bus = &platform_bus_type,
708 .probe = locomo_probe,
709 .remove = locomo_remove,
710};
711
712/*
713 * Get the parent device driver (us) structure
714 * from a child function device
715 */
716static inline struct locomo *locomo_chip_driver(struct locomo_dev *ldev)
717{
718 return (struct locomo *)dev_get_drvdata(ldev->dev.parent);
719}
720
721void locomo_gpio_set_dir(struct locomo_dev *ldev, unsigned int bits, unsigned int dir)
722{
723 struct locomo *lchip = locomo_chip_driver(ldev);
724 unsigned long flags;
725 unsigned int r;
726
727 spin_lock_irqsave(&lchip->lock, flags);
728
729 r = locomo_readl(lchip->base + LOCOMO_GPD);
730 r &= ~bits;
731 locomo_writel(r, lchip->base + LOCOMO_GPD);
732
733 r = locomo_readl(lchip->base + LOCOMO_GPE);
734 if (dir)
735 r |= bits;
736 else
737 r &= ~bits;
738 locomo_writel(r, lchip->base + LOCOMO_GPE);
739
740 spin_unlock_irqrestore(&lchip->lock, flags);
741}
742
743unsigned int locomo_gpio_read_level(struct locomo_dev *ldev, unsigned int bits)
744{
745 struct locomo *lchip = locomo_chip_driver(ldev);
746 unsigned long flags;
747 unsigned int ret;
748
749 spin_lock_irqsave(&lchip->lock, flags);
750 ret = locomo_readl(lchip->base + LOCOMO_GPL);
751 spin_unlock_irqrestore(&lchip->lock, flags);
752
753 ret &= bits;
754 return ret;
755}
756
757unsigned int locomo_gpio_read_output(struct locomo_dev *ldev, unsigned int bits)
758{
759 struct locomo *lchip = locomo_chip_driver(ldev);
760 unsigned long flags;
761 unsigned int ret;
762
763 spin_lock_irqsave(&lchip->lock, flags);
764 ret = locomo_readl(lchip->base + LOCOMO_GPO);
765 spin_unlock_irqrestore(&lchip->lock, flags);
766
767 ret &= bits;
768 return ret;
769}
770
771void locomo_gpio_write(struct locomo_dev *ldev, unsigned int bits, unsigned int set)
772{
773 struct locomo *lchip = locomo_chip_driver(ldev);
774 unsigned long flags;
775 unsigned int r;
776
777 spin_lock_irqsave(&lchip->lock, flags);
778
779 r = locomo_readl(lchip->base + LOCOMO_GPO);
780 if (set)
781 r |= bits;
782 else
783 r &= ~bits;
784 locomo_writel(r, lchip->base + LOCOMO_GPO);
785
786 spin_unlock_irqrestore(&lchip->lock, flags);
787}
788
789static void locomo_m62332_sendbit(void *mapbase, int bit)
790{
791 unsigned int r;
792
793 r = locomo_readl(mapbase + LOCOMO_DAC);
794 r &= ~(LOCOMO_DAC_SCLOEB);
795 locomo_writel(r, mapbase + LOCOMO_DAC);
796 udelay(DAC_LOW_SETUP_TIME); /* 300 nsec */
797 udelay(DAC_DATA_HOLD_TIME); /* 300 nsec */
798 r = locomo_readl(mapbase + LOCOMO_DAC);
799 r &= ~(LOCOMO_DAC_SCLOEB);
800 locomo_writel(r, mapbase + LOCOMO_DAC);
801 udelay(DAC_LOW_SETUP_TIME); /* 300 nsec */
802 udelay(DAC_SCL_LOW_HOLD_TIME); /* 4.7 usec */
803
804 if (bit & 1) {
805 r = locomo_readl(mapbase + LOCOMO_DAC);
806 r |= LOCOMO_DAC_SDAOEB;
807 locomo_writel(r, mapbase + LOCOMO_DAC);
808 udelay(DAC_HIGH_SETUP_TIME); /* 1000 nsec */
809 } else {
810 r = locomo_readl(mapbase + LOCOMO_DAC);
811 r &= ~(LOCOMO_DAC_SDAOEB);
812 locomo_writel(r, mapbase + LOCOMO_DAC);
813 udelay(DAC_LOW_SETUP_TIME); /* 300 nsec */
814 }
815
816 udelay(DAC_DATA_SETUP_TIME); /* 250 nsec */
817 r = locomo_readl(mapbase + LOCOMO_DAC);
818 r |= LOCOMO_DAC_SCLOEB;
819 locomo_writel(r, mapbase + LOCOMO_DAC);
820 udelay(DAC_HIGH_SETUP_TIME); /* 1000 nsec */
821 udelay(DAC_SCL_HIGH_HOLD_TIME); /* 4.0 usec */
822}
823
824void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int channel)
825{
826 struct locomo *lchip = locomo_chip_driver(ldev);
827 int i;
828 unsigned char data;
829 unsigned int r;
830 void *mapbase = lchip->base;
831 unsigned long flags;
832
833 spin_lock_irqsave(&lchip->lock, flags);
834
835 /* Start */
836 udelay(DAC_BUS_FREE_TIME); /* 5.0 usec */
837 r = locomo_readl(mapbase + LOCOMO_DAC);
838 r |= LOCOMO_DAC_SCLOEB | LOCOMO_DAC_SDAOEB;
839 locomo_writel(r, mapbase + LOCOMO_DAC);
840 udelay(DAC_HIGH_SETUP_TIME); /* 1000 nsec */
841 udelay(DAC_SCL_HIGH_HOLD_TIME); /* 4.0 usec */
842 r = locomo_readl(mapbase + LOCOMO_DAC);
843 r &= ~(LOCOMO_DAC_SDAOEB);
844 locomo_writel(r, mapbase + LOCOMO_DAC);
845 udelay(DAC_START_HOLD_TIME); /* 5.0 usec */
846 udelay(DAC_DATA_HOLD_TIME); /* 300 nsec */
847
848 /* Send slave address and W bit (LSB is W bit) */
849 data = (M62332_SLAVE_ADDR << 1) | M62332_W_BIT;
850 for (i = 1; i <= 8; i++) {
851 locomo_m62332_sendbit(mapbase, data >> (8 - i));
852 }
853
854 /* Check A bit */
855 r = locomo_readl(mapbase + LOCOMO_DAC);
856 r &= ~(LOCOMO_DAC_SCLOEB);
857 locomo_writel(r, mapbase + LOCOMO_DAC);
858 udelay(DAC_LOW_SETUP_TIME); /* 300 nsec */
859 udelay(DAC_SCL_LOW_HOLD_TIME); /* 4.7 usec */
860 r = locomo_readl(mapbase + LOCOMO_DAC);
861 r &= ~(LOCOMO_DAC_SDAOEB);
862 locomo_writel(r, mapbase + LOCOMO_DAC);
863 udelay(DAC_LOW_SETUP_TIME); /* 300 nsec */
864 r = locomo_readl(mapbase + LOCOMO_DAC);
865 r |= LOCOMO_DAC_SCLOEB;
866 locomo_writel(r, mapbase + LOCOMO_DAC);
867 udelay(DAC_HIGH_SETUP_TIME); /* 1000 nsec */
868 udelay(DAC_SCL_HIGH_HOLD_TIME); /* 4.7 usec */
869 if (locomo_readl(mapbase + LOCOMO_DAC) & LOCOMO_DAC_SDAOEB) { /* High is error */
870 printk(KERN_WARNING "locomo: m62332_senddata Error 1\n");
871 return;
872 }
873
874 /* Send Sub address (LSB is channel select) */
875 /* channel = 0 : ch1 select */
876 /* = 1 : ch2 select */
877 data = M62332_SUB_ADDR + channel;
878 for (i = 1; i <= 8; i++) {
879 locomo_m62332_sendbit(mapbase, data >> (8 - i));
880 }
881
882 /* Check A bit */
883 r = locomo_readl(mapbase + LOCOMO_DAC);
884 r &= ~(LOCOMO_DAC_SCLOEB);
885 locomo_writel(r, mapbase + LOCOMO_DAC);
886 udelay(DAC_LOW_SETUP_TIME); /* 300 nsec */
887 udelay(DAC_SCL_LOW_HOLD_TIME); /* 4.7 usec */
888 r = locomo_readl(mapbase + LOCOMO_DAC);
889 r &= ~(LOCOMO_DAC_SDAOEB);
890 locomo_writel(r, mapbase + LOCOMO_DAC);
891 udelay(DAC_LOW_SETUP_TIME); /* 300 nsec */
892 r = locomo_readl(mapbase + LOCOMO_DAC);
893 r |= LOCOMO_DAC_SCLOEB;
894 locomo_writel(r, mapbase + LOCOMO_DAC);
895 udelay(DAC_HIGH_SETUP_TIME); /* 1000 nsec */
896 udelay(DAC_SCL_HIGH_HOLD_TIME); /* 4.7 usec */
897 if (locomo_readl(mapbase + LOCOMO_DAC) & LOCOMO_DAC_SDAOEB) { /* High is error */
898 printk(KERN_WARNING "locomo: m62332_senddata Error 2\n");
899 return;
900 }
901
902 /* Send DAC data */
903 for (i = 1; i <= 8; i++) {
904 locomo_m62332_sendbit(mapbase, dac_data >> (8 - i));
905 }
906
907 /* Check A bit */
908 r = locomo_readl(mapbase + LOCOMO_DAC);
909 r &= ~(LOCOMO_DAC_SCLOEB);
910 locomo_writel(r, mapbase + LOCOMO_DAC);
911 udelay(DAC_LOW_SETUP_TIME); /* 300 nsec */
912 udelay(DAC_SCL_LOW_HOLD_TIME); /* 4.7 usec */
913 r = locomo_readl(mapbase + LOCOMO_DAC);
914 r &= ~(LOCOMO_DAC_SDAOEB);
915 locomo_writel(r, mapbase + LOCOMO_DAC);
916 udelay(DAC_LOW_SETUP_TIME); /* 300 nsec */
917 r = locomo_readl(mapbase + LOCOMO_DAC);
918 r |= LOCOMO_DAC_SCLOEB;
919 locomo_writel(r, mapbase + LOCOMO_DAC);
920 udelay(DAC_HIGH_SETUP_TIME); /* 1000 nsec */
921 udelay(DAC_SCL_HIGH_HOLD_TIME); /* 4.7 usec */
922 if (locomo_readl(mapbase + LOCOMO_DAC) & LOCOMO_DAC_SDAOEB) { /* High is error */
923 printk(KERN_WARNING "locomo: m62332_senddata Error 3\n");
924 return;
925 }
926
927 /* stop */
928 r = locomo_readl(mapbase + LOCOMO_DAC);
929 r &= ~(LOCOMO_DAC_SCLOEB);
930 locomo_writel(r, mapbase + LOCOMO_DAC);
931 udelay(DAC_LOW_SETUP_TIME); /* 300 nsec */
932 udelay(DAC_SCL_LOW_HOLD_TIME); /* 4.7 usec */
933 r = locomo_readl(mapbase + LOCOMO_DAC);
934 r |= LOCOMO_DAC_SCLOEB;
935 locomo_writel(r, mapbase + LOCOMO_DAC);
936 udelay(DAC_HIGH_SETUP_TIME); /* 1000 nsec */
937 udelay(DAC_SCL_HIGH_HOLD_TIME); /* 4 usec */
938 r = locomo_readl(mapbase + LOCOMO_DAC);
939 r |= LOCOMO_DAC_SDAOEB;
940 locomo_writel(r, mapbase + LOCOMO_DAC);
941 udelay(DAC_HIGH_SETUP_TIME); /* 1000 nsec */
942 udelay(DAC_SCL_HIGH_HOLD_TIME); /* 4 usec */
943
944 r = locomo_readl(mapbase + LOCOMO_DAC);
945 r |= LOCOMO_DAC_SCLOEB | LOCOMO_DAC_SDAOEB;
946 locomo_writel(r, mapbase + LOCOMO_DAC);
947 udelay(DAC_LOW_SETUP_TIME); /* 1000 nsec */
948 udelay(DAC_SCL_LOW_HOLD_TIME); /* 4.7 usec */
949
950 spin_unlock_irqrestore(&lchip->lock, flags);
951}
952
953/*
954 * LoCoMo "Register Access Bus."
955 *
956 * We model this as a regular bus type, and hang devices directly
957 * off this.
958 */
959static int locomo_match(struct device *_dev, struct device_driver *_drv)
960{
961 struct locomo_dev *dev = LOCOMO_DEV(_dev);
962 struct locomo_driver *drv = LOCOMO_DRV(_drv);
963
964 return dev->devid == drv->devid;
965}
966
967static int locomo_bus_suspend(struct device *dev, pm_message_t state)
968{
969 struct locomo_dev *ldev = LOCOMO_DEV(dev);
970 struct locomo_driver *drv = LOCOMO_DRV(dev->driver);
971 int ret = 0;
972
973 if (drv && drv->suspend)
974 ret = drv->suspend(ldev, state);
975 return ret;
976}
977
978static int locomo_bus_resume(struct device *dev)
979{
980 struct locomo_dev *ldev = LOCOMO_DEV(dev);
981 struct locomo_driver *drv = LOCOMO_DRV(dev->driver);
982 int ret = 0;
983
984 if (drv && drv->resume)
985 ret = drv->resume(ldev);
986 return ret;
987}
988
989static int locomo_bus_probe(struct device *dev)
990{
991 struct locomo_dev *ldev = LOCOMO_DEV(dev);
992 struct locomo_driver *drv = LOCOMO_DRV(dev->driver);
993 int ret = -ENODEV;
994
995 if (drv->probe)
996 ret = drv->probe(ldev);
997 return ret;
998}
999
1000static int locomo_bus_remove(struct device *dev)
1001{
1002 struct locomo_dev *ldev = LOCOMO_DEV(dev);
1003 struct locomo_driver *drv = LOCOMO_DRV(dev->driver);
1004 int ret = 0;
1005
1006 if (drv->remove)
1007 ret = drv->remove(ldev);
1008 return ret;
1009}
1010
1011struct bus_type locomo_bus_type = {
1012 .name = "locomo-bus",
1013 .match = locomo_match,
1014 .suspend = locomo_bus_suspend,
1015 .resume = locomo_bus_resume,
1016};
1017
1018int locomo_driver_register(struct locomo_driver *driver)
1019{
1020 driver->drv.probe = locomo_bus_probe;
1021 driver->drv.remove = locomo_bus_remove;
1022 driver->drv.bus = &locomo_bus_type;
1023 return driver_register(&driver->drv);
1024}
1025
1026void locomo_driver_unregister(struct locomo_driver *driver)
1027{
1028 driver_unregister(&driver->drv);
1029}
1030
1031static int __init locomo_init(void)
1032{
1033 int ret = bus_register(&locomo_bus_type);
1034 if (ret == 0)
1035 driver_register(&locomo_device_driver);
1036 return ret;
1037}
1038
1039static void __exit locomo_exit(void)
1040{
1041 driver_unregister(&locomo_device_driver);
1042 bus_unregister(&locomo_bus_type);
1043}
1044
1045module_init(locomo_init);
1046module_exit(locomo_exit);
1047
1048MODULE_DESCRIPTION("Sharp LoCoMo core driver");
1049MODULE_LICENSE("GPL");
1050MODULE_AUTHOR("John Lenz <lenz@cs.wisc.edu>");
1051
1052EXPORT_SYMBOL(locomo_driver_register);
1053EXPORT_SYMBOL(locomo_driver_unregister);
1054EXPORT_SYMBOL(locomo_gpio_set_dir);
1055EXPORT_SYMBOL(locomo_gpio_read_level);
1056EXPORT_SYMBOL(locomo_gpio_read_output);
1057EXPORT_SYMBOL(locomo_gpio_write);
1058EXPORT_SYMBOL(locomo_m62332_senddata);
diff --git a/arch/arm/common/rtctime.c b/arch/arm/common/rtctime.c
new file mode 100644
index 000000000000..c397e71f938d
--- /dev/null
+++ b/arch/arm/common/rtctime.c
@@ -0,0 +1,506 @@
1/*
2 * linux/arch/arm/common/rtctime.c
3 *
4 * Copyright (C) 2003 Deep Blue Solutions Ltd.
5 * Based on sa1100-rtc.c, Nils Faerber, CIH, Nicolas Pitre.
6 * Based on rtc.c by Paul Gortmaker
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/module.h>
13#include <linux/kernel.h>
14#include <linux/time.h>
15#include <linux/rtc.h>
16#include <linux/poll.h>
17#include <linux/proc_fs.h>
18#include <linux/miscdevice.h>
19#include <linux/spinlock.h>
20#include <linux/device.h>
21
22#include <asm/rtc.h>
23#include <asm/semaphore.h>
24
25static DECLARE_WAIT_QUEUE_HEAD(rtc_wait);
26static struct fasync_struct *rtc_async_queue;
27
28/*
29 * rtc_lock protects rtc_irq_data
30 */
31static DEFINE_SPINLOCK(rtc_lock);
32static unsigned long rtc_irq_data;
33
34/*
35 * rtc_sem protects rtc_inuse and rtc_ops
36 */
37static DECLARE_MUTEX(rtc_sem);
38static unsigned long rtc_inuse;
39static struct rtc_ops *rtc_ops;
40
41#define rtc_epoch 1900UL
42
43static const unsigned char days_in_month[] = {
44 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
45};
46
47#define LEAPS_THRU_END_OF(y) ((y)/4 - (y)/100 + (y)/400)
48#define LEAP_YEAR(year) ((!(year % 4) && (year % 100)) || !(year % 400))
49
50static int month_days(unsigned int month, unsigned int year)
51{
52 return days_in_month[month] + (LEAP_YEAR(year) && month == 1);
53}
54
55/*
56 * Convert seconds since 01-01-1970 00:00:00 to Gregorian date.
57 */
58void rtc_time_to_tm(unsigned long time, struct rtc_time *tm)
59{
60 int days, month, year;
61
62 days = time / 86400;
63 time -= days * 86400;
64
65 tm->tm_wday = (days + 4) % 7;
66
67 year = 1970 + days / 365;
68 days -= (year - 1970) * 365
69 + LEAPS_THRU_END_OF(year - 1)
70 - LEAPS_THRU_END_OF(1970 - 1);
71 if (days < 0) {
72 year -= 1;
73 days += 365 + LEAP_YEAR(year);
74 }
75 tm->tm_year = year - 1900;
76 tm->tm_yday = days + 1;
77
78 for (month = 0; month < 11; month++) {
79 int newdays;
80
81 newdays = days - month_days(month, year);
82 if (newdays < 0)
83 break;
84 days = newdays;
85 }
86 tm->tm_mon = month;
87 tm->tm_mday = days + 1;
88
89 tm->tm_hour = time / 3600;
90 time -= tm->tm_hour * 3600;
91 tm->tm_min = time / 60;
92 tm->tm_sec = time - tm->tm_min * 60;
93}
94EXPORT_SYMBOL(rtc_time_to_tm);
95
96/*
97 * Does the rtc_time represent a valid date/time?
98 */
99int rtc_valid_tm(struct rtc_time *tm)
100{
101 if (tm->tm_year < 70 ||
102 tm->tm_mon >= 12 ||
103 tm->tm_mday < 1 ||
104 tm->tm_mday > month_days(tm->tm_mon, tm->tm_year + 1900) ||
105 tm->tm_hour >= 24 ||
106 tm->tm_min >= 60 ||
107 tm->tm_sec >= 60)
108 return -EINVAL;
109
110 return 0;
111}
112EXPORT_SYMBOL(rtc_valid_tm);
113
114/*
115 * Convert Gregorian date to seconds since 01-01-1970 00:00:00.
116 */
117int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time)
118{
119 *time = mktime(tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
120 tm->tm_hour, tm->tm_min, tm->tm_sec);
121
122 return 0;
123}
124EXPORT_SYMBOL(rtc_tm_to_time);
125
126/*
127 * Calculate the next alarm time given the requested alarm time mask
128 * and the current time.
129 *
130 * FIXME: for now, we just copy the alarm time because we're lazy (and
131 * is therefore buggy - setting a 10am alarm at 8pm will not result in
132 * the alarm triggering.)
133 */
134void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, struct rtc_time *alrm)
135{
136 next->tm_year = now->tm_year;
137 next->tm_mon = now->tm_mon;
138 next->tm_mday = now->tm_mday;
139 next->tm_hour = alrm->tm_hour;
140 next->tm_min = alrm->tm_min;
141 next->tm_sec = alrm->tm_sec;
142}
143
144static inline void rtc_read_time(struct rtc_ops *ops, struct rtc_time *tm)
145{
146 memset(tm, 0, sizeof(struct rtc_time));
147 ops->read_time(tm);
148}
149
150static inline int rtc_set_time(struct rtc_ops *ops, struct rtc_time *tm)
151{
152 int ret;
153
154 ret = rtc_valid_tm(tm);
155 if (ret == 0)
156 ret = ops->set_time(tm);
157
158 return ret;
159}
160
161static inline int rtc_read_alarm(struct rtc_ops *ops, struct rtc_wkalrm *alrm)
162{
163 int ret = -EINVAL;
164 if (ops->read_alarm) {
165 memset(alrm, 0, sizeof(struct rtc_wkalrm));
166 ops->read_alarm(alrm);
167 ret = 0;
168 }
169 return ret;
170}
171
172static inline int rtc_set_alarm(struct rtc_ops *ops, struct rtc_wkalrm *alrm)
173{
174 int ret = -EINVAL;
175 if (ops->set_alarm)
176 ret = ops->set_alarm(alrm);
177 return ret;
178}
179
180void rtc_update(unsigned long num, unsigned long events)
181{
182 spin_lock(&rtc_lock);
183 rtc_irq_data = (rtc_irq_data + (num << 8)) | events;
184 spin_unlock(&rtc_lock);
185
186 wake_up_interruptible(&rtc_wait);
187 kill_fasync(&rtc_async_queue, SIGIO, POLL_IN);
188}
189EXPORT_SYMBOL(rtc_update);
190
191
192static ssize_t
193rtc_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
194{
195 DECLARE_WAITQUEUE(wait, current);
196 unsigned long data;
197 ssize_t ret;
198
199 if (count < sizeof(unsigned long))
200 return -EINVAL;
201
202 add_wait_queue(&rtc_wait, &wait);
203 do {
204 __set_current_state(TASK_INTERRUPTIBLE);
205
206 spin_lock_irq(&rtc_lock);
207 data = rtc_irq_data;
208 rtc_irq_data = 0;
209 spin_unlock_irq(&rtc_lock);
210
211 if (data != 0) {
212 ret = 0;
213 break;
214 }
215 if (file->f_flags & O_NONBLOCK) {
216 ret = -EAGAIN;
217 break;
218 }
219 if (signal_pending(current)) {
220 ret = -ERESTARTSYS;
221 break;
222 }
223 schedule();
224 } while (1);
225 set_current_state(TASK_RUNNING);
226 remove_wait_queue(&rtc_wait, &wait);
227
228 if (ret == 0) {
229 ret = put_user(data, (unsigned long __user *)buf);
230 if (ret == 0)
231 ret = sizeof(unsigned long);
232 }
233 return ret;
234}
235
236static unsigned int rtc_poll(struct file *file, poll_table *wait)
237{
238 unsigned long data;
239
240 poll_wait(file, &rtc_wait, wait);
241
242 spin_lock_irq(&rtc_lock);
243 data = rtc_irq_data;
244 spin_unlock_irq(&rtc_lock);
245
246 return data != 0 ? POLLIN | POLLRDNORM : 0;
247}
248
249static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
250 unsigned long arg)
251{
252 struct rtc_ops *ops = file->private_data;
253 struct rtc_time tm;
254 struct rtc_wkalrm alrm;
255 void __user *uarg = (void __user *)arg;
256 int ret = -EINVAL;
257
258 switch (cmd) {
259 case RTC_ALM_READ:
260 ret = rtc_read_alarm(ops, &alrm);
261 if (ret)
262 break;
263 ret = copy_to_user(uarg, &alrm.time, sizeof(tm));
264 if (ret)
265 ret = -EFAULT;
266 break;
267
268 case RTC_ALM_SET:
269 ret = copy_from_user(&alrm.time, uarg, sizeof(tm));
270 if (ret) {
271 ret = -EFAULT;
272 break;
273 }
274 alrm.enabled = 0;
275 alrm.pending = 0;
276 alrm.time.tm_mday = -1;
277 alrm.time.tm_mon = -1;
278 alrm.time.tm_year = -1;
279 alrm.time.tm_wday = -1;
280 alrm.time.tm_yday = -1;
281 alrm.time.tm_isdst = -1;
282 ret = rtc_set_alarm(ops, &alrm);
283 break;
284
285 case RTC_RD_TIME:
286 rtc_read_time(ops, &tm);
287 ret = copy_to_user(uarg, &tm, sizeof(tm));
288 if (ret)
289 ret = -EFAULT;
290 break;
291
292 case RTC_SET_TIME:
293 if (!capable(CAP_SYS_TIME)) {
294 ret = -EACCES;
295 break;
296 }
297 ret = copy_from_user(&tm, uarg, sizeof(tm));
298 if (ret) {
299 ret = -EFAULT;
300 break;
301 }
302 ret = rtc_set_time(ops, &tm);
303 break;
304
305 case RTC_EPOCH_SET:
306#ifndef rtc_epoch
307 /*
308 * There were no RTC clocks before 1900.
309 */
310 if (arg < 1900) {
311 ret = -EINVAL;
312 break;
313 }
314 if (!capable(CAP_SYS_TIME)) {
315 ret = -EACCES;
316 break;
317 }
318 rtc_epoch = arg;
319 ret = 0;
320#endif
321 break;
322
323 case RTC_EPOCH_READ:
324 ret = put_user(rtc_epoch, (unsigned long __user *)uarg);
325 break;
326
327 case RTC_WKALM_SET:
328 ret = copy_from_user(&alrm, uarg, sizeof(alrm));
329 if (ret) {
330 ret = -EFAULT;
331 break;
332 }
333 ret = rtc_set_alarm(ops, &alrm);
334 break;
335
336 case RTC_WKALM_RD:
337 ret = rtc_read_alarm(ops, &alrm);
338 if (ret)
339 break;
340 ret = copy_to_user(uarg, &alrm, sizeof(alrm));
341 if (ret)
342 ret = -EFAULT;
343 break;
344
345 default:
346 if (ops->ioctl)
347 ret = ops->ioctl(cmd, arg);
348 break;
349 }
350 return ret;
351}
352
353static int rtc_open(struct inode *inode, struct file *file)
354{
355 int ret;
356
357 down(&rtc_sem);
358
359 if (rtc_inuse) {
360 ret = -EBUSY;
361 } else if (!rtc_ops || !try_module_get(rtc_ops->owner)) {
362 ret = -ENODEV;
363 } else {
364 file->private_data = rtc_ops;
365
366 ret = rtc_ops->open ? rtc_ops->open() : 0;
367 if (ret == 0) {
368 spin_lock_irq(&rtc_lock);
369 rtc_irq_data = 0;
370 spin_unlock_irq(&rtc_lock);
371
372 rtc_inuse = 1;
373 }
374 }
375 up(&rtc_sem);
376
377 return ret;
378}
379
380static int rtc_release(struct inode *inode, struct file *file)
381{
382 struct rtc_ops *ops = file->private_data;
383
384 if (ops->release)
385 ops->release();
386
387 spin_lock_irq(&rtc_lock);
388 rtc_irq_data = 0;
389 spin_unlock_irq(&rtc_lock);
390
391 module_put(rtc_ops->owner);
392 rtc_inuse = 0;
393
394 return 0;
395}
396
397static int rtc_fasync(int fd, struct file *file, int on)
398{
399 return fasync_helper(fd, file, on, &rtc_async_queue);
400}
401
402static struct file_operations rtc_fops = {
403 .owner = THIS_MODULE,
404 .llseek = no_llseek,
405 .read = rtc_read,
406 .poll = rtc_poll,
407 .ioctl = rtc_ioctl,
408 .open = rtc_open,
409 .release = rtc_release,
410 .fasync = rtc_fasync,
411};
412
413static struct miscdevice rtc_miscdev = {
414 .minor = RTC_MINOR,
415 .name = "rtc",
416 .fops = &rtc_fops,
417};
418
419
420static int rtc_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data)
421{
422 struct rtc_ops *ops = data;
423 struct rtc_wkalrm alrm;
424 struct rtc_time tm;
425 char *p = page;
426
427 rtc_read_time(ops, &tm);
428
429 p += sprintf(p,
430 "rtc_time\t: %02d:%02d:%02d\n"
431 "rtc_date\t: %04d-%02d-%02d\n"
432 "rtc_epoch\t: %04lu\n",
433 tm.tm_hour, tm.tm_min, tm.tm_sec,
434 tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
435 rtc_epoch);
436
437 if (rtc_read_alarm(ops, &alrm) == 0) {
438 p += sprintf(p, "alrm_time\t: ");
439 if ((unsigned int)alrm.time.tm_hour <= 24)
440 p += sprintf(p, "%02d:", alrm.time.tm_hour);
441 else
442 p += sprintf(p, "**:");
443 if ((unsigned int)alrm.time.tm_min <= 59)
444 p += sprintf(p, "%02d:", alrm.time.tm_min);
445 else
446 p += sprintf(p, "**:");
447 if ((unsigned int)alrm.time.tm_sec <= 59)
448 p += sprintf(p, "%02d\n", alrm.time.tm_sec);
449 else
450 p += sprintf(p, "**\n");
451
452 p += sprintf(p, "alrm_date\t: ");
453 if ((unsigned int)alrm.time.tm_year <= 200)
454 p += sprintf(p, "%04d-", alrm.time.tm_year + 1900);
455 else
456 p += sprintf(p, "****-");
457 if ((unsigned int)alrm.time.tm_mon <= 11)
458 p += sprintf(p, "%02d-", alrm.time.tm_mon + 1);
459 else
460 p += sprintf(p, "**-");
461 if ((unsigned int)alrm.time.tm_mday <= 31)
462 p += sprintf(p, "%02d\n", alrm.time.tm_mday);
463 else
464 p += sprintf(p, "**\n");
465 p += sprintf(p, "alrm_wakeup\t: %s\n",
466 alrm.enabled ? "yes" : "no");
467 p += sprintf(p, "alrm_pending\t: %s\n",
468 alrm.pending ? "yes" : "no");
469 }
470
471 if (ops->proc)
472 p += ops->proc(p);
473
474 return p - page;
475}
476
477int register_rtc(struct rtc_ops *ops)
478{
479 int ret = -EBUSY;
480
481 down(&rtc_sem);
482 if (rtc_ops == NULL) {
483 rtc_ops = ops;
484
485 ret = misc_register(&rtc_miscdev);
486 if (ret == 0)
487 create_proc_read_entry("driver/rtc", 0, NULL,
488 rtc_read_proc, ops);
489 }
490 up(&rtc_sem);
491
492 return ret;
493}
494EXPORT_SYMBOL(register_rtc);
495
496void unregister_rtc(struct rtc_ops *rtc)
497{
498 down(&rtc_sem);
499 if (rtc == rtc_ops) {
500 remove_proc_entry("driver/rtc", NULL);
501 misc_deregister(&rtc_miscdev);
502 rtc_ops = NULL;
503 }
504 up(&rtc_sem);
505}
506EXPORT_SYMBOL(unregister_rtc);
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
new file mode 100644
index 000000000000..21fce3414ed1
--- /dev/null
+++ b/arch/arm/common/sa1111.c
@@ -0,0 +1,1292 @@
1/*
2 * linux/arch/arm/mach-sa1100/sa1111.c
3 *
4 * SA1111 support
5 *
6 * Original code by John Dorsey
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This file contains all generic SA1111 support.
13 *
14 * All initialization functions provided here are intended to be called
15 * from machine specific code with proper arguments when required.
16 */
17#include <linux/config.h>
18#include <linux/module.h>
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/delay.h>
22#include <linux/ptrace.h>
23#include <linux/errno.h>
24#include <linux/ioport.h>
25#include <linux/device.h>
26#include <linux/slab.h>
27#include <linux/spinlock.h>
28#include <linux/dma-mapping.h>
29
30#include <asm/hardware.h>
31#include <asm/mach-types.h>
32#include <asm/io.h>
33#include <asm/irq.h>
34#include <asm/mach/irq.h>
35
36#include <asm/hardware/sa1111.h>
37
38#ifdef CONFIG_ARCH_PXA
39#include <asm/arch/pxa-regs.h>
40#endif
41
42extern void __init sa1110_mb_enable(void);
43
44/*
45 * We keep the following data for the overall SA1111. Note that the
46 * struct device and struct resource are "fake"; they should be supplied
47 * by the bus above us. However, in the interests of getting all SA1111
48 * drivers converted over to the device model, we provide this as an
49 * anchor point for all the other drivers.
50 */
51struct sa1111 {
52 struct device *dev;
53 unsigned long phys;
54 int irq;
55 spinlock_t lock;
56 void __iomem *base;
57};
58
59/*
60 * We _really_ need to eliminate this. Its only users
61 * are the PWM and DMA checking code.
62 */
63static struct sa1111 *g_sa1111;
64
65struct sa1111_dev_info {
66 unsigned long offset;
67 unsigned long skpcr_mask;
68 unsigned int devid;
69 unsigned int irq[6];
70};
71
72static struct sa1111_dev_info sa1111_devices[] = {
73 {
74 .offset = SA1111_USB,
75 .skpcr_mask = SKPCR_UCLKEN,
76 .devid = SA1111_DEVID_USB,
77 .irq = {
78 IRQ_USBPWR,
79 IRQ_HCIM,
80 IRQ_HCIBUFFACC,
81 IRQ_HCIRMTWKP,
82 IRQ_NHCIMFCIR,
83 IRQ_USB_PORT_RESUME
84 },
85 },
86 {
87 .offset = 0x0600,
88 .skpcr_mask = SKPCR_I2SCLKEN | SKPCR_L3CLKEN,
89 .devid = SA1111_DEVID_SAC,
90 .irq = {
91 AUDXMTDMADONEA,
92 AUDXMTDMADONEB,
93 AUDRCVDMADONEA,
94 AUDRCVDMADONEB
95 },
96 },
97 {
98 .offset = 0x0800,
99 .skpcr_mask = SKPCR_SCLKEN,
100 .devid = SA1111_DEVID_SSP,
101 },
102 {
103 .offset = SA1111_KBD,
104 .skpcr_mask = SKPCR_PTCLKEN,
105 .devid = SA1111_DEVID_PS2,
106 .irq = {
107 IRQ_TPRXINT,
108 IRQ_TPTXINT
109 },
110 },
111 {
112 .offset = SA1111_MSE,
113 .skpcr_mask = SKPCR_PMCLKEN,
114 .devid = SA1111_DEVID_PS2,
115 .irq = {
116 IRQ_MSRXINT,
117 IRQ_MSTXINT
118 },
119 },
120 {
121 .offset = 0x1800,
122 .skpcr_mask = 0,
123 .devid = SA1111_DEVID_PCMCIA,
124 .irq = {
125 IRQ_S0_READY_NINT,
126 IRQ_S0_CD_VALID,
127 IRQ_S0_BVD1_STSCHG,
128 IRQ_S1_READY_NINT,
129 IRQ_S1_CD_VALID,
130 IRQ_S1_BVD1_STSCHG,
131 },
132 },
133};
134
135/*
136 * SA1111 interrupt support. Since clearing an IRQ while there are
137 * active IRQs causes the interrupt output to pulse, the upper levels
138 * will call us again if there are more interrupts to process.
139 */
140static void
141sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
142{
143 unsigned int stat0, stat1, i;
144 void __iomem *base = desc->data;
145
146 stat0 = sa1111_readl(base + SA1111_INTSTATCLR0);
147 stat1 = sa1111_readl(base + SA1111_INTSTATCLR1);
148
149 sa1111_writel(stat0, base + SA1111_INTSTATCLR0);
150
151 desc->chip->ack(irq);
152
153 sa1111_writel(stat1, base + SA1111_INTSTATCLR1);
154
155 if (stat0 == 0 && stat1 == 0) {
156 do_bad_IRQ(irq, desc, regs);
157 return;
158 }
159
160 for (i = IRQ_SA1111_START; stat0; i++, stat0 >>= 1)
161 if (stat0 & 1)
162 do_edge_IRQ(i, irq_desc + i, regs);
163
164 for (i = IRQ_SA1111_START + 32; stat1; i++, stat1 >>= 1)
165 if (stat1 & 1)
166 do_edge_IRQ(i, irq_desc + i, regs);
167
168 /* For level-based interrupts */
169 desc->chip->unmask(irq);
170}
171
172#define SA1111_IRQMASK_LO(x) (1 << (x - IRQ_SA1111_START))
173#define SA1111_IRQMASK_HI(x) (1 << (x - IRQ_SA1111_START - 32))
174
175static void sa1111_ack_irq(unsigned int irq)
176{
177}
178
179static void sa1111_mask_lowirq(unsigned int irq)
180{
181 void __iomem *mapbase = get_irq_chipdata(irq);
182 unsigned long ie0;
183
184 ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
185 ie0 &= ~SA1111_IRQMASK_LO(irq);
186 writel(ie0, mapbase + SA1111_INTEN0);
187}
188
189static void sa1111_unmask_lowirq(unsigned int irq)
190{
191 void __iomem *mapbase = get_irq_chipdata(irq);
192 unsigned long ie0;
193
194 ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
195 ie0 |= SA1111_IRQMASK_LO(irq);
196 sa1111_writel(ie0, mapbase + SA1111_INTEN0);
197}
198
199/*
200 * Attempt to re-trigger the interrupt. The SA1111 contains a register
201 * (INTSET) which claims to do this. However, in practice no amount of
202 * manipulation of INTEN and INTSET guarantees that the interrupt will
203 * be triggered. In fact, its very difficult, if not impossible to get
204 * INTSET to re-trigger the interrupt.
205 */
206static int sa1111_retrigger_lowirq(unsigned int irq)
207{
208 unsigned int mask = SA1111_IRQMASK_LO(irq);
209 void __iomem *mapbase = get_irq_chipdata(irq);
210 unsigned long ip0;
211 int i;
212
213 ip0 = sa1111_readl(mapbase + SA1111_INTPOL0);
214 for (i = 0; i < 8; i++) {
215 sa1111_writel(ip0 ^ mask, mapbase + SA1111_INTPOL0);
216 sa1111_writel(ip0, mapbase + SA1111_INTPOL0);
217 if (sa1111_readl(mapbase + SA1111_INTSTATCLR1) & mask)
218 break;
219 }
220
221 if (i == 8)
222 printk(KERN_ERR "Danger Will Robinson: failed to "
223 "re-trigger IRQ%d\n", irq);
224 return i == 8 ? -1 : 0;
225}
226
227static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
228{
229 unsigned int mask = SA1111_IRQMASK_LO(irq);
230 void __iomem *mapbase = get_irq_chipdata(irq);
231 unsigned long ip0;
232
233 if (flags == IRQT_PROBE)
234 return 0;
235
236 if ((!(flags & __IRQT_RISEDGE) ^ !(flags & __IRQT_FALEDGE)) == 0)
237 return -EINVAL;
238
239 ip0 = sa1111_readl(mapbase + SA1111_INTPOL0);
240 if (flags & __IRQT_RISEDGE)
241 ip0 &= ~mask;
242 else
243 ip0 |= mask;
244 sa1111_writel(ip0, mapbase + SA1111_INTPOL0);
245 sa1111_writel(ip0, mapbase + SA1111_WAKEPOL0);
246
247 return 0;
248}
249
250static int sa1111_wake_lowirq(unsigned int irq, unsigned int on)
251{
252 unsigned int mask = SA1111_IRQMASK_LO(irq);
253 void __iomem *mapbase = get_irq_chipdata(irq);
254 unsigned long we0;
255
256 we0 = sa1111_readl(mapbase + SA1111_WAKEEN0);
257 if (on)
258 we0 |= mask;
259 else
260 we0 &= ~mask;
261 sa1111_writel(we0, mapbase + SA1111_WAKEEN0);
262
263 return 0;
264}
265
266static struct irqchip sa1111_low_chip = {
267 .ack = sa1111_ack_irq,
268 .mask = sa1111_mask_lowirq,
269 .unmask = sa1111_unmask_lowirq,
270 .retrigger = sa1111_retrigger_lowirq,
271 .type = sa1111_type_lowirq,
272 .wake = sa1111_wake_lowirq,
273};
274
275static void sa1111_mask_highirq(unsigned int irq)
276{
277 void __iomem *mapbase = get_irq_chipdata(irq);
278 unsigned long ie1;
279
280 ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
281 ie1 &= ~SA1111_IRQMASK_HI(irq);
282 sa1111_writel(ie1, mapbase + SA1111_INTEN1);
283}
284
285static void sa1111_unmask_highirq(unsigned int irq)
286{
287 void __iomem *mapbase = get_irq_chipdata(irq);
288 unsigned long ie1;
289
290 ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
291 ie1 |= SA1111_IRQMASK_HI(irq);
292 sa1111_writel(ie1, mapbase + SA1111_INTEN1);
293}
294
295/*
296 * Attempt to re-trigger the interrupt. The SA1111 contains a register
297 * (INTSET) which claims to do this. However, in practice no amount of
298 * manipulation of INTEN and INTSET guarantees that the interrupt will
299 * be triggered. In fact, its very difficult, if not impossible to get
300 * INTSET to re-trigger the interrupt.
301 */
302static int sa1111_retrigger_highirq(unsigned int irq)
303{
304 unsigned int mask = SA1111_IRQMASK_HI(irq);
305 void __iomem *mapbase = get_irq_chipdata(irq);
306 unsigned long ip1;
307 int i;
308
309 ip1 = sa1111_readl(mapbase + SA1111_INTPOL1);
310 for (i = 0; i < 8; i++) {
311 sa1111_writel(ip1 ^ mask, mapbase + SA1111_INTPOL1);
312 sa1111_writel(ip1, mapbase + SA1111_INTPOL1);
313 if (sa1111_readl(mapbase + SA1111_INTSTATCLR1) & mask)
314 break;
315 }
316
317 if (i == 8)
318 printk(KERN_ERR "Danger Will Robinson: failed to "
319 "re-trigger IRQ%d\n", irq);
320 return i == 8 ? -1 : 0;
321}
322
323static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
324{
325 unsigned int mask = SA1111_IRQMASK_HI(irq);
326 void __iomem *mapbase = get_irq_chipdata(irq);
327 unsigned long ip1;
328
329 if (flags == IRQT_PROBE)
330 return 0;
331
332 if ((!(flags & __IRQT_RISEDGE) ^ !(flags & __IRQT_FALEDGE)) == 0)
333 return -EINVAL;
334
335 ip1 = sa1111_readl(mapbase + SA1111_INTPOL1);
336 if (flags & __IRQT_RISEDGE)
337 ip1 &= ~mask;
338 else
339 ip1 |= mask;
340 sa1111_writel(ip1, mapbase + SA1111_INTPOL1);
341 sa1111_writel(ip1, mapbase + SA1111_WAKEPOL1);
342
343 return 0;
344}
345
346static int sa1111_wake_highirq(unsigned int irq, unsigned int on)
347{
348 unsigned int mask = SA1111_IRQMASK_HI(irq);
349 void __iomem *mapbase = get_irq_chipdata(irq);
350 unsigned long we1;
351
352 we1 = sa1111_readl(mapbase + SA1111_WAKEEN1);
353 if (on)
354 we1 |= mask;
355 else
356 we1 &= ~mask;
357 sa1111_writel(we1, mapbase + SA1111_WAKEEN1);
358
359 return 0;
360}
361
362static struct irqchip sa1111_high_chip = {
363 .ack = sa1111_ack_irq,
364 .mask = sa1111_mask_highirq,
365 .unmask = sa1111_unmask_highirq,
366 .retrigger = sa1111_retrigger_highirq,
367 .type = sa1111_type_highirq,
368 .wake = sa1111_wake_highirq,
369};
370
371static void sa1111_setup_irq(struct sa1111 *sachip)
372{
373 void __iomem *irqbase = sachip->base + SA1111_INTC;
374 unsigned int irq;
375
376 /*
377 * We're guaranteed that this region hasn't been taken.
378 */
379 request_mem_region(sachip->phys + SA1111_INTC, 512, "irq");
380
381 /* disable all IRQs */
382 sa1111_writel(0, irqbase + SA1111_INTEN0);
383 sa1111_writel(0, irqbase + SA1111_INTEN1);
384 sa1111_writel(0, irqbase + SA1111_WAKEEN0);
385 sa1111_writel(0, irqbase + SA1111_WAKEEN1);
386
387 /*
388 * detect on rising edge. Note: Feb 2001 Errata for SA1111
389 * specifies that S0ReadyInt and S1ReadyInt should be '1'.
390 */
391 sa1111_writel(0, irqbase + SA1111_INTPOL0);
392 sa1111_writel(SA1111_IRQMASK_HI(IRQ_S0_READY_NINT) |
393 SA1111_IRQMASK_HI(IRQ_S1_READY_NINT),
394 irqbase + SA1111_INTPOL1);
395
396 /* clear all IRQs */
397 sa1111_writel(~0, irqbase + SA1111_INTSTATCLR0);
398 sa1111_writel(~0, irqbase + SA1111_INTSTATCLR1);
399
400 for (irq = IRQ_GPAIN0; irq <= SSPROR; irq++) {
401 set_irq_chip(irq, &sa1111_low_chip);
402 set_irq_chipdata(irq, irqbase);
403 set_irq_handler(irq, do_edge_IRQ);
404 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
405 }
406
407 for (irq = AUDXMTDMADONEA; irq <= IRQ_S1_BVD1_STSCHG; irq++) {
408 set_irq_chip(irq, &sa1111_high_chip);
409 set_irq_chipdata(irq, irqbase);
410 set_irq_handler(irq, do_edge_IRQ);
411 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
412 }
413
414 /*
415 * Register SA1111 interrupt
416 */
417 set_irq_type(sachip->irq, IRQT_RISING);
418 set_irq_data(sachip->irq, irqbase);
419 set_irq_chained_handler(sachip->irq, sa1111_irq_handler);
420}
421
422/*
423 * Bring the SA1111 out of reset. This requires a set procedure:
424 * 1. nRESET asserted (by hardware)
425 * 2. CLK turned on from SA1110
426 * 3. nRESET deasserted
427 * 4. VCO turned on, PLL_BYPASS turned off
428 * 5. Wait lock time, then assert RCLKEn
429 * 7. PCR set to allow clocking of individual functions
430 *
431 * Until we've done this, the only registers we can access are:
432 * SBI_SKCR
433 * SBI_SMCR
434 * SBI_SKID
435 */
436static void sa1111_wake(struct sa1111 *sachip)
437{
438 unsigned long flags, r;
439
440 spin_lock_irqsave(&sachip->lock, flags);
441
442#ifdef CONFIG_ARCH_SA1100
443 /*
444 * First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111:
445 * (SA-1110 Developer's Manual, section 9.1.2.1)
446 */
447 GAFR |= GPIO_32_768kHz;
448 GPDR |= GPIO_32_768kHz;
449 TUCR = TUCR_3_6864MHz;
450#elif CONFIG_ARCH_PXA
451 pxa_gpio_mode(GPIO11_3_6MHz_MD);
452#else
453#error missing clock setup
454#endif
455
456 /*
457 * Turn VCO on, and disable PLL Bypass.
458 */
459 r = sa1111_readl(sachip->base + SA1111_SKCR);
460 r &= ~SKCR_VCO_OFF;
461 sa1111_writel(r, sachip->base + SA1111_SKCR);
462 r |= SKCR_PLL_BYPASS | SKCR_OE_EN;
463 sa1111_writel(r, sachip->base + SA1111_SKCR);
464
465 /*
466 * Wait lock time. SA1111 manual _doesn't_
467 * specify a figure for this! We choose 100us.
468 */
469 udelay(100);
470
471 /*
472 * Enable RCLK. We also ensure that RDYEN is set.
473 */
474 r |= SKCR_RCLKEN | SKCR_RDYEN;
475 sa1111_writel(r, sachip->base + SA1111_SKCR);
476
477 /*
478 * Wait 14 RCLK cycles for the chip to finish coming out
479 * of reset. (RCLK=24MHz). This is 590ns.
480 */
481 udelay(1);
482
483 /*
484 * Ensure all clocks are initially off.
485 */
486 sa1111_writel(0, sachip->base + SA1111_SKPCR);
487
488 spin_unlock_irqrestore(&sachip->lock, flags);
489}
490
491#ifdef CONFIG_ARCH_SA1100
492
493static u32 sa1111_dma_mask[] = {
494 ~0,
495 ~(1 << 20),
496 ~(1 << 23),
497 ~(1 << 24),
498 ~(1 << 25),
499 ~(1 << 20),
500 ~(1 << 20),
501 0,
502};
503
504/*
505 * Configure the SA1111 shared memory controller.
506 */
507void
508sa1111_configure_smc(struct sa1111 *sachip, int sdram, unsigned int drac,
509 unsigned int cas_latency)
510{
511 unsigned int smcr = SMCR_DTIM | SMCR_MBGE | FInsrt(drac, SMCR_DRAC);
512
513 if (cas_latency == 3)
514 smcr |= SMCR_CLAT;
515
516 sa1111_writel(smcr, sachip->base + SA1111_SMCR);
517
518 /*
519 * Now clear the bits in the DMA mask to work around the SA1111
520 * DMA erratum (Intel StrongARM SA-1111 Microprocessor Companion
521 * Chip Specification Update, June 2000, Erratum #7).
522 */
523 if (sachip->dev->dma_mask)
524 *sachip->dev->dma_mask &= sa1111_dma_mask[drac >> 2];
525
526 sachip->dev->coherent_dma_mask &= sa1111_dma_mask[drac >> 2];
527}
528
529#endif
530
531static void sa1111_dev_release(struct device *_dev)
532{
533 struct sa1111_dev *dev = SA1111_DEV(_dev);
534
535 release_resource(&dev->res);
536 kfree(dev);
537}
538
539static int
540sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
541 struct sa1111_dev_info *info)
542{
543 struct sa1111_dev *dev;
544 int ret;
545
546 dev = kmalloc(sizeof(struct sa1111_dev), GFP_KERNEL);
547 if (!dev) {
548 ret = -ENOMEM;
549 goto out;
550 }
551 memset(dev, 0, sizeof(struct sa1111_dev));
552
553 snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id),
554 "%4.4lx", info->offset);
555
556 dev->devid = info->devid;
557 dev->dev.parent = sachip->dev;
558 dev->dev.bus = &sa1111_bus_type;
559 dev->dev.release = sa1111_dev_release;
560 dev->dev.coherent_dma_mask = sachip->dev->coherent_dma_mask;
561 dev->res.start = sachip->phys + info->offset;
562 dev->res.end = dev->res.start + 511;
563 dev->res.name = dev->dev.bus_id;
564 dev->res.flags = IORESOURCE_MEM;
565 dev->mapbase = sachip->base + info->offset;
566 dev->skpcr_mask = info->skpcr_mask;
567 memmove(dev->irq, info->irq, sizeof(dev->irq));
568
569 ret = request_resource(parent, &dev->res);
570 if (ret) {
571 printk("SA1111: failed to allocate resource for %s\n",
572 dev->res.name);
573 kfree(dev);
574 goto out;
575 }
576
577
578 ret = device_register(&dev->dev);
579 if (ret) {
580 release_resource(&dev->res);
581 kfree(dev);
582 goto out;
583 }
584
585 /*
586 * If the parent device has a DMA mask associated with it,
587 * propagate it down to the children.
588 */
589 if (sachip->dev->dma_mask) {
590 dev->dma_mask = *sachip->dev->dma_mask;
591 dev->dev.dma_mask = &dev->dma_mask;
592
593 if (dev->dma_mask != 0xffffffffUL) {
594 ret = dmabounce_register_dev(&dev->dev, 1024, 4096);
595 if (ret) {
596 printk("SA1111: Failed to register %s with dmabounce", dev->dev.bus_id);
597 device_unregister(&dev->dev);
598 }
599 }
600 }
601
602out:
603 return ret;
604}
605
606/**
607 * sa1111_probe - probe for a single SA1111 chip.
608 * @phys_addr: physical address of device.
609 *
610 * Probe for a SA1111 chip. This must be called
611 * before any other SA1111-specific code.
612 *
613 * Returns:
614 * %-ENODEV device not found.
615 * %-EBUSY physical address already marked in-use.
616 * %0 successful.
617 */
618static int
619__sa1111_probe(struct device *me, struct resource *mem, int irq)
620{
621 struct sa1111 *sachip;
622 unsigned long id;
623 unsigned int has_devs, val;
624 int i, ret = -ENODEV;
625
626 sachip = kmalloc(sizeof(struct sa1111), GFP_KERNEL);
627 if (!sachip)
628 return -ENOMEM;
629
630 memset(sachip, 0, sizeof(struct sa1111));
631
632 spin_lock_init(&sachip->lock);
633
634 sachip->dev = me;
635 dev_set_drvdata(sachip->dev, sachip);
636
637 sachip->phys = mem->start;
638 sachip->irq = irq;
639
640 /*
641 * Map the whole region. This also maps the
642 * registers for our children.
643 */
644 sachip->base = ioremap(mem->start, PAGE_SIZE * 2);
645 if (!sachip->base) {
646 ret = -ENOMEM;
647 goto out;
648 }
649
650 /*
651 * Probe for the chip. Only touch the SBI registers.
652 */
653 id = sa1111_readl(sachip->base + SA1111_SKID);
654 if ((id & SKID_ID_MASK) != SKID_SA1111_ID) {
655 printk(KERN_DEBUG "SA1111 not detected: ID = %08lx\n", id);
656 ret = -ENODEV;
657 goto unmap;
658 }
659
660 printk(KERN_INFO "SA1111 Microprocessor Companion Chip: "
661 "silicon revision %lx, metal revision %lx\n",
662 (id & SKID_SIREV_MASK)>>4, (id & SKID_MTREV_MASK));
663
664 /*
665 * We found it. Wake the chip up, and initialise.
666 */
667 sa1111_wake(sachip);
668
669#ifdef CONFIG_ARCH_SA1100
670 /*
671 * The SDRAM configuration of the SA1110 and the SA1111 must
672 * match. This is very important to ensure that SA1111 accesses
673 * don't corrupt the SDRAM. Note that this ungates the SA1111's
674 * MBGNT signal, so we must have called sa1110_mb_disable()
675 * beforehand.
676 */
677 sa1111_configure_smc(sachip, 1,
678 FExtr(MDCNFG, MDCNFG_SA1110_DRAC0),
679 FExtr(MDCNFG, MDCNFG_SA1110_TDL0));
680
681 /*
682 * We only need to turn on DCLK whenever we want to use the
683 * DMA. It can otherwise be held firmly in the off position.
684 * (currently, we always enable it.)
685 */
686 val = sa1111_readl(sachip->base + SA1111_SKPCR);
687 sa1111_writel(val | SKPCR_DCLKEN, sachip->base + SA1111_SKPCR);
688
689 /*
690 * Enable the SA1110 memory bus request and grant signals.
691 */
692 sa1110_mb_enable();
693#endif
694
695 /*
696 * The interrupt controller must be initialised before any
697 * other device to ensure that the interrupts are available.
698 */
699 if (sachip->irq != NO_IRQ)
700 sa1111_setup_irq(sachip);
701
702 g_sa1111 = sachip;
703
704 has_devs = ~0;
705 if (machine_is_assabet() || machine_is_jornada720() ||
706 machine_is_badge4())
707 has_devs &= ~(1 << 4);
708 else
709 has_devs &= ~(1 << 1);
710
711 for (i = 0; i < ARRAY_SIZE(sa1111_devices); i++)
712 if (has_devs & (1 << i))
713 sa1111_init_one_child(sachip, mem, &sa1111_devices[i]);
714
715 return 0;
716
717 unmap:
718 iounmap(sachip->base);
719 out:
720 kfree(sachip);
721 return ret;
722}
723
724static void __sa1111_remove(struct sa1111 *sachip)
725{
726 struct list_head *l, *n;
727 void __iomem *irqbase = sachip->base + SA1111_INTC;
728
729 list_for_each_safe(l, n, &sachip->dev->children) {
730 struct device *d = list_to_dev(l);
731
732 device_unregister(d);
733 }
734
735 /* disable all IRQs */
736 sa1111_writel(0, irqbase + SA1111_INTEN0);
737 sa1111_writel(0, irqbase + SA1111_INTEN1);
738 sa1111_writel(0, irqbase + SA1111_WAKEEN0);
739 sa1111_writel(0, irqbase + SA1111_WAKEEN1);
740
741 if (sachip->irq != NO_IRQ) {
742 set_irq_chained_handler(sachip->irq, NULL);
743 set_irq_data(sachip->irq, NULL);
744
745 release_mem_region(sachip->phys + SA1111_INTC, 512);
746 }
747
748 iounmap(sachip->base);
749 kfree(sachip);
750}
751
752/*
753 * According to the "Intel StrongARM SA-1111 Microprocessor Companion
754 * Chip Specification Update" (June 2000), erratum #7, there is a
755 * significant bug in the SA1111 SDRAM shared memory controller. If
756 * an access to a region of memory above 1MB relative to the bank base,
757 * it is important that address bit 10 _NOT_ be asserted. Depending
758 * on the configuration of the RAM, bit 10 may correspond to one
759 * of several different (processor-relative) address bits.
760 *
761 * This routine only identifies whether or not a given DMA address
762 * is susceptible to the bug.
763 *
764 * This should only get called for sa1111_device types due to the
765 * way we configure our device dma_masks.
766 */
767int dma_needs_bounce(struct device *dev, dma_addr_t addr, size_t size)
768{
769 /*
770 * Section 4.6 of the "Intel StrongARM SA-1111 Development Module
771 * User's Guide" mentions that jumpers R51 and R52 control the
772 * target of SA-1111 DMA (either SDRAM bank 0 on Assabet, or
773 * SDRAM bank 1 on Neponset). The default configuration selects
774 * Assabet, so any address in bank 1 is necessarily invalid.
775 */
776 return ((machine_is_assabet() || machine_is_pfs168()) &&
777 (addr >= 0xc8000000 || (addr + size) >= 0xc8000000));
778}
779
780struct sa1111_save_data {
781 unsigned int skcr;
782 unsigned int skpcr;
783 unsigned int skcdr;
784 unsigned char skaud;
785 unsigned char skpwm0;
786 unsigned char skpwm1;
787
788 /*
789 * Interrupt controller
790 */
791 unsigned int intpol0;
792 unsigned int intpol1;
793 unsigned int inten0;
794 unsigned int inten1;
795 unsigned int wakepol0;
796 unsigned int wakepol1;
797 unsigned int wakeen0;
798 unsigned int wakeen1;
799};
800
801#ifdef CONFIG_PM
802
803static int sa1111_suspend(struct device *dev, pm_message_t state, u32 level)
804{
805 struct sa1111 *sachip = dev_get_drvdata(dev);
806 struct sa1111_save_data *save;
807 unsigned long flags;
808 unsigned int val;
809 void __iomem *base;
810
811 if (level != SUSPEND_DISABLE)
812 return 0;
813
814 save = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL);
815 if (!save)
816 return -ENOMEM;
817 dev->power.saved_state = save;
818
819 spin_lock_irqsave(&sachip->lock, flags);
820
821 /*
822 * Save state.
823 */
824 base = sachip->base;
825 save->skcr = sa1111_readl(base + SA1111_SKCR);
826 save->skpcr = sa1111_readl(base + SA1111_SKPCR);
827 save->skcdr = sa1111_readl(base + SA1111_SKCDR);
828 save->skaud = sa1111_readl(base + SA1111_SKAUD);
829 save->skpwm0 = sa1111_readl(base + SA1111_SKPWM0);
830 save->skpwm1 = sa1111_readl(base + SA1111_SKPWM1);
831
832 base = sachip->base + SA1111_INTC;
833 save->intpol0 = sa1111_readl(base + SA1111_INTPOL0);
834 save->intpol1 = sa1111_readl(base + SA1111_INTPOL1);
835 save->inten0 = sa1111_readl(base + SA1111_INTEN0);
836 save->inten1 = sa1111_readl(base + SA1111_INTEN1);
837 save->wakepol0 = sa1111_readl(base + SA1111_WAKEPOL0);
838 save->wakepol1 = sa1111_readl(base + SA1111_WAKEPOL1);
839 save->wakeen0 = sa1111_readl(base + SA1111_WAKEEN0);
840 save->wakeen1 = sa1111_readl(base + SA1111_WAKEEN1);
841
842 /*
843 * Disable.
844 */
845 val = sa1111_readl(sachip->base + SA1111_SKCR);
846 sa1111_writel(val | SKCR_SLEEP, sachip->base + SA1111_SKCR);
847 sa1111_writel(0, sachip->base + SA1111_SKPWM0);
848 sa1111_writel(0, sachip->base + SA1111_SKPWM1);
849
850 spin_unlock_irqrestore(&sachip->lock, flags);
851
852 return 0;
853}
854
855/*
856 * sa1111_resume - Restore the SA1111 device state.
857 * @dev: device to restore
858 * @level: resume level
859 *
860 * Restore the general state of the SA1111; clock control and
861 * interrupt controller. Other parts of the SA1111 must be
862 * restored by their respective drivers, and must be called
863 * via LDM after this function.
864 */
865static int sa1111_resume(struct device *dev, u32 level)
866{
867 struct sa1111 *sachip = dev_get_drvdata(dev);
868 struct sa1111_save_data *save;
869 unsigned long flags, id;
870 void __iomem *base;
871
872 if (level != RESUME_ENABLE)
873 return 0;
874
875 save = (struct sa1111_save_data *)dev->power.saved_state;
876 if (!save)
877 return 0;
878
879 spin_lock_irqsave(&sachip->lock, flags);
880
881 /*
882 * Ensure that the SA1111 is still here.
883 * FIXME: shouldn't do this here.
884 */
885 id = sa1111_readl(sachip->base + SA1111_SKID);
886 if ((id & SKID_ID_MASK) != SKID_SA1111_ID) {
887 __sa1111_remove(sachip);
888 dev_set_drvdata(dev, NULL);
889 kfree(save);
890 return 0;
891 }
892
893 /*
894 * First of all, wake up the chip.
895 */
896 sa1111_wake(sachip);
897 sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN0);
898 sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN1);
899
900 base = sachip->base;
901 sa1111_writel(save->skcr, base + SA1111_SKCR);
902 sa1111_writel(save->skpcr, base + SA1111_SKPCR);
903 sa1111_writel(save->skcdr, base + SA1111_SKCDR);
904 sa1111_writel(save->skaud, base + SA1111_SKAUD);
905 sa1111_writel(save->skpwm0, base + SA1111_SKPWM0);
906 sa1111_writel(save->skpwm1, base + SA1111_SKPWM1);
907
908 base = sachip->base + SA1111_INTC;
909 sa1111_writel(save->intpol0, base + SA1111_INTPOL0);
910 sa1111_writel(save->intpol1, base + SA1111_INTPOL1);
911 sa1111_writel(save->inten0, base + SA1111_INTEN0);
912 sa1111_writel(save->inten1, base + SA1111_INTEN1);
913 sa1111_writel(save->wakepol0, base + SA1111_WAKEPOL0);
914 sa1111_writel(save->wakepol1, base + SA1111_WAKEPOL1);
915 sa1111_writel(save->wakeen0, base + SA1111_WAKEEN0);
916 sa1111_writel(save->wakeen1, base + SA1111_WAKEEN1);
917
918 spin_unlock_irqrestore(&sachip->lock, flags);
919
920 dev->power.saved_state = NULL;
921 kfree(save);
922
923 return 0;
924}
925
926#else
927#define sa1111_suspend NULL
928#define sa1111_resume NULL
929#endif
930
931static int sa1111_probe(struct device *dev)
932{
933 struct platform_device *pdev = to_platform_device(dev);
934 struct resource *mem;
935 int irq;
936
937 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
938 if (!mem)
939 return -EINVAL;
940 irq = platform_get_irq(pdev, 0);
941
942 return __sa1111_probe(dev, mem, irq);
943}
944
945static int sa1111_remove(struct device *dev)
946{
947 struct sa1111 *sachip = dev_get_drvdata(dev);
948
949 if (sachip) {
950 __sa1111_remove(sachip);
951 dev_set_drvdata(dev, NULL);
952
953#ifdef CONFIG_PM
954 kfree(dev->power.saved_state);
955 dev->power.saved_state = NULL;
956#endif
957 }
958
959 return 0;
960}
961
962/*
963 * Not sure if this should be on the system bus or not yet.
964 * We really want some way to register a system device at
965 * the per-machine level, and then have this driver pick
966 * up the registered devices.
967 *
968 * We also need to handle the SDRAM configuration for
969 * PXA250/SA1110 machine classes.
970 */
971static struct device_driver sa1111_device_driver = {
972 .name = "sa1111",
973 .bus = &platform_bus_type,
974 .probe = sa1111_probe,
975 .remove = sa1111_remove,
976 .suspend = sa1111_suspend,
977 .resume = sa1111_resume,
978};
979
980/*
981 * Get the parent device driver (us) structure
982 * from a child function device
983 */
984static inline struct sa1111 *sa1111_chip_driver(struct sa1111_dev *sadev)
985{
986 return (struct sa1111 *)dev_get_drvdata(sadev->dev.parent);
987}
988
989/*
990 * The bits in the opdiv field are non-linear.
991 */
992static unsigned char opdiv_table[] = { 1, 4, 2, 8 };
993
994static unsigned int __sa1111_pll_clock(struct sa1111 *sachip)
995{
996 unsigned int skcdr, fbdiv, ipdiv, opdiv;
997
998 skcdr = sa1111_readl(sachip->base + SA1111_SKCDR);
999
1000 fbdiv = (skcdr & 0x007f) + 2;
1001 ipdiv = ((skcdr & 0x0f80) >> 7) + 2;
1002 opdiv = opdiv_table[(skcdr & 0x3000) >> 12];
1003
1004 return 3686400 * fbdiv / (ipdiv * opdiv);
1005}
1006
1007/**
1008 * sa1111_pll_clock - return the current PLL clock frequency.
1009 * @sadev: SA1111 function block
1010 *
1011 * BUG: we should look at SKCR. We also blindly believe that
1012 * the chip is being fed with the 3.6864MHz clock.
1013 *
1014 * Returns the PLL clock in Hz.
1015 */
1016unsigned int sa1111_pll_clock(struct sa1111_dev *sadev)
1017{
1018 struct sa1111 *sachip = sa1111_chip_driver(sadev);
1019
1020 return __sa1111_pll_clock(sachip);
1021}
1022
1023/**
1024 * sa1111_select_audio_mode - select I2S or AC link mode
1025 * @sadev: SA1111 function block
1026 * @mode: One of %SA1111_AUDIO_ACLINK or %SA1111_AUDIO_I2S
1027 *
1028 * Frob the SKCR to select AC Link mode or I2S mode for
1029 * the audio block.
1030 */
1031void sa1111_select_audio_mode(struct sa1111_dev *sadev, int mode)
1032{
1033 struct sa1111 *sachip = sa1111_chip_driver(sadev);
1034 unsigned long flags;
1035 unsigned int val;
1036
1037 spin_lock_irqsave(&sachip->lock, flags);
1038
1039 val = sa1111_readl(sachip->base + SA1111_SKCR);
1040 if (mode == SA1111_AUDIO_I2S) {
1041 val &= ~SKCR_SELAC;
1042 } else {
1043 val |= SKCR_SELAC;
1044 }
1045 sa1111_writel(val, sachip->base + SA1111_SKCR);
1046
1047 spin_unlock_irqrestore(&sachip->lock, flags);
1048}
1049
1050/**
1051 * sa1111_set_audio_rate - set the audio sample rate
1052 * @sadev: SA1111 SAC function block
1053 * @rate: sample rate to select
1054 */
1055int sa1111_set_audio_rate(struct sa1111_dev *sadev, int rate)
1056{
1057 struct sa1111 *sachip = sa1111_chip_driver(sadev);
1058 unsigned int div;
1059
1060 if (sadev->devid != SA1111_DEVID_SAC)
1061 return -EINVAL;
1062
1063 div = (__sa1111_pll_clock(sachip) / 256 + rate / 2) / rate;
1064 if (div == 0)
1065 div = 1;
1066 if (div > 128)
1067 div = 128;
1068
1069 sa1111_writel(div - 1, sachip->base + SA1111_SKAUD);
1070
1071 return 0;
1072}
1073
1074/**
1075 * sa1111_get_audio_rate - get the audio sample rate
1076 * @sadev: SA1111 SAC function block device
1077 */
1078int sa1111_get_audio_rate(struct sa1111_dev *sadev)
1079{
1080 struct sa1111 *sachip = sa1111_chip_driver(sadev);
1081 unsigned long div;
1082
1083 if (sadev->devid != SA1111_DEVID_SAC)
1084 return -EINVAL;
1085
1086 div = sa1111_readl(sachip->base + SA1111_SKAUD) + 1;
1087
1088 return __sa1111_pll_clock(sachip) / (256 * div);
1089}
1090
1091void sa1111_set_io_dir(struct sa1111_dev *sadev,
1092 unsigned int bits, unsigned int dir,
1093 unsigned int sleep_dir)
1094{
1095 struct sa1111 *sachip = sa1111_chip_driver(sadev);
1096 unsigned long flags;
1097 unsigned int val;
1098 void __iomem *gpio = sachip->base + SA1111_GPIO;
1099
1100#define MODIFY_BITS(port, mask, dir) \
1101 if (mask) { \
1102 val = sa1111_readl(port); \
1103 val &= ~(mask); \
1104 val |= (dir) & (mask); \
1105 sa1111_writel(val, port); \
1106 }
1107
1108 spin_lock_irqsave(&sachip->lock, flags);
1109 MODIFY_BITS(gpio + SA1111_GPIO_PADDR, bits & 15, dir);
1110 MODIFY_BITS(gpio + SA1111_GPIO_PBDDR, (bits >> 8) & 255, dir >> 8);
1111 MODIFY_BITS(gpio + SA1111_GPIO_PCDDR, (bits >> 16) & 255, dir >> 16);
1112
1113 MODIFY_BITS(gpio + SA1111_GPIO_PASDR, bits & 15, sleep_dir);
1114 MODIFY_BITS(gpio + SA1111_GPIO_PBSDR, (bits >> 8) & 255, sleep_dir >> 8);
1115 MODIFY_BITS(gpio + SA1111_GPIO_PCSDR, (bits >> 16) & 255, sleep_dir >> 16);
1116 spin_unlock_irqrestore(&sachip->lock, flags);
1117}
1118
1119void sa1111_set_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v)
1120{
1121 struct sa1111 *sachip = sa1111_chip_driver(sadev);
1122 unsigned long flags;
1123 unsigned int val;
1124 void __iomem *gpio = sachip->base + SA1111_GPIO;
1125
1126 spin_lock_irqsave(&sachip->lock, flags);
1127 MODIFY_BITS(gpio + SA1111_GPIO_PADWR, bits & 15, v);
1128 MODIFY_BITS(gpio + SA1111_GPIO_PBDWR, (bits >> 8) & 255, v >> 8);
1129 MODIFY_BITS(gpio + SA1111_GPIO_PCDWR, (bits >> 16) & 255, v >> 16);
1130 spin_unlock_irqrestore(&sachip->lock, flags);
1131}
1132
1133void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v)
1134{
1135 struct sa1111 *sachip = sa1111_chip_driver(sadev);
1136 unsigned long flags;
1137 unsigned int val;
1138 void __iomem *gpio = sachip->base + SA1111_GPIO;
1139
1140 spin_lock_irqsave(&sachip->lock, flags);
1141 MODIFY_BITS(gpio + SA1111_GPIO_PASSR, bits & 15, v);
1142 MODIFY_BITS(gpio + SA1111_GPIO_PBSSR, (bits >> 8) & 255, v >> 8);
1143 MODIFY_BITS(gpio + SA1111_GPIO_PCSSR, (bits >> 16) & 255, v >> 16);
1144 spin_unlock_irqrestore(&sachip->lock, flags);
1145}
1146
1147/*
1148 * Individual device operations.
1149 */
1150
1151/**
1152 * sa1111_enable_device - enable an on-chip SA1111 function block
1153 * @sadev: SA1111 function block device to enable
1154 */
1155void sa1111_enable_device(struct sa1111_dev *sadev)
1156{
1157 struct sa1111 *sachip = sa1111_chip_driver(sadev);
1158 unsigned long flags;
1159 unsigned int val;
1160
1161 spin_lock_irqsave(&sachip->lock, flags);
1162 val = sa1111_readl(sachip->base + SA1111_SKPCR);
1163 sa1111_writel(val | sadev->skpcr_mask, sachip->base + SA1111_SKPCR);
1164 spin_unlock_irqrestore(&sachip->lock, flags);
1165}
1166
1167/**
1168 * sa1111_disable_device - disable an on-chip SA1111 function block
1169 * @sadev: SA1111 function block device to disable
1170 */
1171void sa1111_disable_device(struct sa1111_dev *sadev)
1172{
1173 struct sa1111 *sachip = sa1111_chip_driver(sadev);
1174 unsigned long flags;
1175 unsigned int val;
1176
1177 spin_lock_irqsave(&sachip->lock, flags);
1178 val = sa1111_readl(sachip->base + SA1111_SKPCR);
1179 sa1111_writel(val & ~sadev->skpcr_mask, sachip->base + SA1111_SKPCR);
1180 spin_unlock_irqrestore(&sachip->lock, flags);
1181}
1182
1183/*
1184 * SA1111 "Register Access Bus."
1185 *
1186 * We model this as a regular bus type, and hang devices directly
1187 * off this.
1188 */
1189static int sa1111_match(struct device *_dev, struct device_driver *_drv)
1190{
1191 struct sa1111_dev *dev = SA1111_DEV(_dev);
1192 struct sa1111_driver *drv = SA1111_DRV(_drv);
1193
1194 return dev->devid == drv->devid;
1195}
1196
1197static int sa1111_bus_suspend(struct device *dev, pm_message_t state)
1198{
1199 struct sa1111_dev *sadev = SA1111_DEV(dev);
1200 struct sa1111_driver *drv = SA1111_DRV(dev->driver);
1201 int ret = 0;
1202
1203 if (drv && drv->suspend)
1204 ret = drv->suspend(sadev, state);
1205 return ret;
1206}
1207
1208static int sa1111_bus_resume(struct device *dev)
1209{
1210 struct sa1111_dev *sadev = SA1111_DEV(dev);
1211 struct sa1111_driver *drv = SA1111_DRV(dev->driver);
1212 int ret = 0;
1213
1214 if (drv && drv->resume)
1215 ret = drv->resume(sadev);
1216 return ret;
1217}
1218
1219static int sa1111_bus_probe(struct device *dev)
1220{
1221 struct sa1111_dev *sadev = SA1111_DEV(dev);
1222 struct sa1111_driver *drv = SA1111_DRV(dev->driver);
1223 int ret = -ENODEV;
1224
1225 if (drv->probe)
1226 ret = drv->probe(sadev);
1227 return ret;
1228}
1229
1230static int sa1111_bus_remove(struct device *dev)
1231{
1232 struct sa1111_dev *sadev = SA1111_DEV(dev);
1233 struct sa1111_driver *drv = SA1111_DRV(dev->driver);
1234 int ret = 0;
1235
1236 if (drv->remove)
1237 ret = drv->remove(sadev);
1238 return ret;
1239}
1240
1241struct bus_type sa1111_bus_type = {
1242 .name = "sa1111-rab",
1243 .match = sa1111_match,
1244 .suspend = sa1111_bus_suspend,
1245 .resume = sa1111_bus_resume,
1246};
1247
1248int sa1111_driver_register(struct sa1111_driver *driver)
1249{
1250 driver->drv.probe = sa1111_bus_probe;
1251 driver->drv.remove = sa1111_bus_remove;
1252 driver->drv.bus = &sa1111_bus_type;
1253 return driver_register(&driver->drv);
1254}
1255
1256void sa1111_driver_unregister(struct sa1111_driver *driver)
1257{
1258 driver_unregister(&driver->drv);
1259}
1260
1261static int __init sa1111_init(void)
1262{
1263 int ret = bus_register(&sa1111_bus_type);
1264 if (ret == 0)
1265 driver_register(&sa1111_device_driver);
1266 return ret;
1267}
1268
1269static void __exit sa1111_exit(void)
1270{
1271 driver_unregister(&sa1111_device_driver);
1272 bus_unregister(&sa1111_bus_type);
1273}
1274
1275module_init(sa1111_init);
1276module_exit(sa1111_exit);
1277
1278MODULE_DESCRIPTION("Intel Corporation SA1111 core driver");
1279MODULE_LICENSE("GPL");
1280
1281EXPORT_SYMBOL(sa1111_select_audio_mode);
1282EXPORT_SYMBOL(sa1111_set_audio_rate);
1283EXPORT_SYMBOL(sa1111_get_audio_rate);
1284EXPORT_SYMBOL(sa1111_set_io_dir);
1285EXPORT_SYMBOL(sa1111_set_io);
1286EXPORT_SYMBOL(sa1111_set_sleep_io);
1287EXPORT_SYMBOL(sa1111_enable_device);
1288EXPORT_SYMBOL(sa1111_disable_device);
1289EXPORT_SYMBOL(sa1111_pll_clock);
1290EXPORT_SYMBOL(sa1111_bus_type);
1291EXPORT_SYMBOL(sa1111_driver_register);
1292EXPORT_SYMBOL(sa1111_driver_unregister);
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
new file mode 100644
index 000000000000..cfd0d3e550d9
--- /dev/null
+++ b/arch/arm/common/scoop.c
@@ -0,0 +1,176 @@
1/*
2 * Support code for the SCOOP interface found on various Sharp PDAs
3 *
4 * Copyright (c) 2004 Richard Purdie
5 *
6 * Based on code written by Sharp/Lineo for 2.4 kernels
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#include <linux/device.h>
15#include <asm/io.h>
16#include <asm/hardware/scoop.h>
17
18#define SCOOP_REG(d,adr) (*(volatile unsigned short*)(d +(adr)))
19
20struct scoop_dev {
21 void *base;
22 spinlock_t scoop_lock;
23 u32 scoop_gpwr;
24};
25
26void reset_scoop(struct device *dev)
27{
28 struct scoop_dev *sdev = dev_get_drvdata(dev);
29
30 SCOOP_REG(sdev->base,SCOOP_MCR) = 0x0100; // 00
31 SCOOP_REG(sdev->base,SCOOP_CDR) = 0x0000; // 04
32 SCOOP_REG(sdev->base,SCOOP_CPR) = 0x0000; // 0C
33 SCOOP_REG(sdev->base,SCOOP_CCR) = 0x0000; // 10
34 SCOOP_REG(sdev->base,SCOOP_IMR) = 0x0000; // 18
35 SCOOP_REG(sdev->base,SCOOP_IRM) = 0x00FF; // 14
36 SCOOP_REG(sdev->base,SCOOP_ISR) = 0x0000; // 1C
37 SCOOP_REG(sdev->base,SCOOP_IRM) = 0x0000;
38}
39
40unsigned short set_scoop_gpio(struct device *dev, unsigned short bit)
41{
42 unsigned short gpio_bit;
43 unsigned long flag;
44 struct scoop_dev *sdev = dev_get_drvdata(dev);
45
46 spin_lock_irqsave(&sdev->scoop_lock, flag);
47 gpio_bit = SCOOP_REG(sdev->base, SCOOP_GPWR) | bit;
48 SCOOP_REG(sdev->base, SCOOP_GPWR) = gpio_bit;
49 spin_unlock_irqrestore(&sdev->scoop_lock, flag);
50
51 return gpio_bit;
52}
53
54unsigned short reset_scoop_gpio(struct device *dev, unsigned short bit)
55{
56 unsigned short gpio_bit;
57 unsigned long flag;
58 struct scoop_dev *sdev = dev_get_drvdata(dev);
59
60 spin_lock_irqsave(&sdev->scoop_lock, flag);
61 gpio_bit = SCOOP_REG(sdev->base, SCOOP_GPWR) & ~bit;
62 SCOOP_REG(sdev->base,SCOOP_GPWR) = gpio_bit;
63 spin_unlock_irqrestore(&sdev->scoop_lock, flag);
64
65 return gpio_bit;
66}
67
68EXPORT_SYMBOL(set_scoop_gpio);
69EXPORT_SYMBOL(reset_scoop_gpio);
70
71unsigned short read_scoop_reg(struct device *dev, unsigned short reg)
72{
73 struct scoop_dev *sdev = dev_get_drvdata(dev);
74 return SCOOP_REG(sdev->base,reg);
75}
76
77void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data)
78{
79 struct scoop_dev *sdev = dev_get_drvdata(dev);
80 SCOOP_REG(sdev->base,reg)=data;
81}
82
83EXPORT_SYMBOL(reset_scoop);
84EXPORT_SYMBOL(read_scoop_reg);
85EXPORT_SYMBOL(write_scoop_reg);
86
87#ifdef CONFIG_PM
88static int scoop_suspend(struct device *dev, uint32_t state, uint32_t level)
89{
90 if (level == SUSPEND_POWER_DOWN) {
91 struct scoop_dev *sdev = dev_get_drvdata(dev);
92
93 sdev->scoop_gpwr = SCOOP_REG(sdev->base,SCOOP_GPWR);
94 SCOOP_REG(sdev->base,SCOOP_GPWR) = 0;
95 }
96 return 0;
97}
98
99static int scoop_resume(struct device *dev, uint32_t level)
100{
101 if (level == RESUME_POWER_ON) {
102 struct scoop_dev *sdev = dev_get_drvdata(dev);
103
104 SCOOP_REG(sdev->base,SCOOP_GPWR) = sdev->scoop_gpwr;
105 }
106 return 0;
107}
108#else
109#define scoop_suspend NULL
110#define scoop_resume NULL
111#endif
112
113int __init scoop_probe(struct device *dev)
114{
115 struct scoop_dev *devptr;
116 struct scoop_config *inf;
117 struct platform_device *pdev = to_platform_device(dev);
118 struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
119
120 if (!mem)
121 return -EINVAL;
122
123 devptr = kmalloc(sizeof(struct scoop_dev), GFP_KERNEL);
124
125 if (!devptr)
126 return -ENOMEM;
127
128 memset(devptr, 0, sizeof(struct scoop_dev));
129 spin_lock_init(&devptr->scoop_lock);
130
131 inf = dev->platform_data;
132 devptr->base = ioremap(mem->start, mem->end - mem->start + 1);
133
134 if (!devptr->base) {
135 kfree(devptr);
136 return -ENOMEM;
137 }
138
139 dev_set_drvdata(dev, devptr);
140
141 printk("Sharp Scoop Device found at 0x%08x -> 0x%08x\n",(unsigned int)mem->start,(unsigned int)devptr->base);
142
143 SCOOP_REG(devptr->base, SCOOP_MCR) = 0x0140;
144 reset_scoop(dev);
145 SCOOP_REG(devptr->base, SCOOP_GPCR) = inf->io_dir & 0xffff;
146 SCOOP_REG(devptr->base, SCOOP_GPWR) = inf->io_out & 0xffff;
147
148 return 0;
149}
150
151static int scoop_remove(struct device *dev)
152{
153 struct scoop_dev *sdev = dev_get_drvdata(dev);
154 if (sdev) {
155 iounmap(sdev->base);
156 kfree(sdev);
157 dev_set_drvdata(dev, NULL);
158 }
159 return 0;
160}
161
162static struct device_driver scoop_driver = {
163 .name = "sharp-scoop",
164 .bus = &platform_bus_type,
165 .probe = scoop_probe,
166 .remove = scoop_remove,
167 .suspend = scoop_suspend,
168 .resume = scoop_resume,
169};
170
171int __init scoop_init(void)
172{
173 return driver_register(&scoop_driver);
174}
175
176subsys_initcall(scoop_init);
diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c
new file mode 100644
index 000000000000..c2c557a224c2
--- /dev/null
+++ b/arch/arm/common/sharpsl_param.c
@@ -0,0 +1,60 @@
1/*
2 * Hardware parameter area specific to Sharp SL series devices
3 *
4 * Copyright (c) 2005 Richard Purdie
5 *
6 * Based on Sharp's 2.4 kernel patches
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <asm/mach/sharpsl_param.h>
17
18/*
19 * Certain hardware parameters determined at the time of device manufacture,
20 * typically including LCD parameters are loaded by the bootloader at the
21 * address PARAM_BASE. As the kernel will overwrite them, we need to store
22 * them early in the boot process, then pass them to the appropriate drivers.
23 * Not all devices use all paramaters but the format is common to all.
24 */
25#ifdef ARCH_SA1100
26#define PARAM_BASE 0xe8ffc000
27#else
28#define PARAM_BASE 0xa0000a00
29#endif
30#define MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a )
31
32#define COMADJ_MAGIC MAGIC_CHG('C','M','A','D')
33#define UUID_MAGIC MAGIC_CHG('U','U','I','D')
34#define TOUCH_MAGIC MAGIC_CHG('T','U','C','H')
35#define AD_MAGIC MAGIC_CHG('B','V','A','D')
36#define PHAD_MAGIC MAGIC_CHG('P','H','A','D')
37
38struct sharpsl_param_info sharpsl_param;
39
40void sharpsl_save_param(void)
41{
42 memcpy(&sharpsl_param, (void *)PARAM_BASE, sizeof(struct sharpsl_param_info));
43
44 if (sharpsl_param.comadj_keyword != COMADJ_MAGIC)
45 sharpsl_param.comadj=-1;
46
47 if (sharpsl_param.phad_keyword != PHAD_MAGIC)
48 sharpsl_param.phadadj=-1;
49
50 if (sharpsl_param.uuid_keyword != UUID_MAGIC)
51 sharpsl_param.uuid[0]=-1;
52
53 if (sharpsl_param.touch_keyword != TOUCH_MAGIC)
54 sharpsl_param.touch_xp=-1;
55
56 if (sharpsl_param.adadj_keyword != AD_MAGIC)
57 sharpsl_param.adadj=-1;
58}
59
60
diff --git a/arch/arm/common/time-acorn.c b/arch/arm/common/time-acorn.c
new file mode 100644
index 000000000000..486add853fb8
--- /dev/null
+++ b/arch/arm/common/time-acorn.c
@@ -0,0 +1,96 @@
1/*
2 * linux/arch/arm/common/time-acorn.c
3 *
4 * Copyright (c) 1996-2000 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Changelog:
11 * 24-Sep-1996 RMK Created
12 * 10-Oct-1996 RMK Brought up to date with arch-sa110eval
13 * 04-Dec-1997 RMK Updated for new arch/arm/time.c
14 * 13=Jun-2004 DS Moved to arch/arm/common b/c shared w/CLPS7500
15 */
16#include <linux/timex.h>
17#include <linux/init.h>
18#include <linux/interrupt.h>
19
20#include <asm/hardware.h>
21#include <asm/io.h>
22#include <asm/hardware/ioc.h>
23
24#include <asm/mach/time.h>
25
26unsigned long ioc_timer_gettimeoffset(void)
27{
28 unsigned int count1, count2, status;
29 long offset;
30
31 ioc_writeb (0, IOC_T0LATCH);
32 barrier ();
33 count1 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8);
34 barrier ();
35 status = ioc_readb(IOC_IRQREQA);
36 barrier ();
37 ioc_writeb (0, IOC_T0LATCH);
38 barrier ();
39 count2 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8);
40
41 offset = count2;
42 if (count2 < count1) {
43 /*
44 * We have not had an interrupt between reading count1
45 * and count2.
46 */
47 if (status & (1 << 5))
48 offset -= LATCH;
49 } else if (count2 > count1) {
50 /*
51 * We have just had another interrupt between reading
52 * count1 and count2.
53 */
54 offset -= LATCH;
55 }
56
57 offset = (LATCH - offset) * (tick_nsec / 1000);
58 return (offset + LATCH/2) / LATCH;
59}
60
61void __init ioctime_init(void)
62{
63 ioc_writeb(LATCH & 255, IOC_T0LTCHL);
64 ioc_writeb(LATCH >> 8, IOC_T0LTCHH);
65 ioc_writeb(0, IOC_T0GO);
66}
67
68static irqreturn_t
69ioc_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
70{
71 write_seqlock(&xtime_lock);
72 timer_tick(regs);
73 write_sequnlock(&xtime_lock);
74 return IRQ_HANDLED;
75}
76
77static struct irqaction ioc_timer_irq = {
78 .name = "timer",
79 .flags = SA_INTERRUPT,
80 .handler = ioc_timer_interrupt
81};
82
83/*
84 * Set up timer interrupt.
85 */
86static void __init ioc_timer_init(void)
87{
88 ioctime_init();
89 setup_irq(IRQ_TIMER, &ioc_timer_irq);
90}
91
92struct sys_timer ioc_timer = {
93 .init = ioc_timer_init,
94 .offset = ioc_timer_gettimeoffset,
95};
96
diff --git a/arch/arm/common/via82c505.c b/arch/arm/common/via82c505.c
new file mode 100644
index 000000000000..ef716a5b07ac
--- /dev/null
+++ b/arch/arm/common/via82c505.c
@@ -0,0 +1,94 @@
1#include <linux/config.h>
2#include <linux/kernel.h>
3#include <linux/pci.h>
4#include <linux/ptrace.h>
5#include <linux/interrupt.h>
6#include <linux/mm.h>
7#include <linux/init.h>
8#include <linux/ioport.h>
9
10#include <asm/io.h>
11#include <asm/system.h>
12
13#include <asm/mach/pci.h>
14
15#define MAX_SLOTS 7
16
17#define CONFIG_CMD(bus, devfn, where) (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3))
18
19static int
20via82c505_read_config(struct pci_bus *bus, unsigned int devfn, int where,
21 int size, u32 *value)
22{
23 outl(CONFIG_CMD(bus,devfn,where),0xCF8);
24 switch (size) {
25 case 1:
26 *value=inb(0xCFC + (where&3));
27 break;
28 case 2:
29 *value=inw(0xCFC + (where&2));
30 break;
31 case 4:
32 *value=inl(0xCFC);
33 break;
34 }
35 return PCIBIOS_SUCCESSFUL;
36}
37
38static int
39via82c505_write_config(struct pci_bus *bus, unsigned int devfn, int where,
40 int size, u32 value)
41{
42 outl(CONFIG_CMD(bus,devfn,where),0xCF8);
43 switch (size) {
44 case 1:
45 outb(value, 0xCFC + (where&3));
46 break;
47 case 2:
48 outw(value, 0xCFC + (where&2));
49 break;
50 case 4:
51 outl(value, 0xCFC);
52 break;
53 }
54 return PCIBIOS_SUCCESSFUL;
55}
56
57static struct pci_ops via82c505_ops = {
58 .read = via82c505_read_config,
59 .write = via82c505_write_config,
60};
61
62void __init via82c505_preinit(void)
63{
64 printk(KERN_DEBUG "PCI: VIA 82c505\n");
65 if (!request_region(0xA8,2,"via config")) {
66 printk(KERN_WARNING"VIA 82c505: Unable to request region 0xA8\n");
67 return;
68 }
69 if (!request_region(0xCF8,8,"pci config")) {
70 printk(KERN_WARNING"VIA 82c505: Unable to request region 0xCF8\n");
71 release_region(0xA8, 2);
72 return;
73 }
74
75 /* Enable compatible Mode */
76 outb(0x96,0xA8);
77 outb(0x18,0xA9);
78 outb(0x93,0xA8);
79 outb(0xd0,0xA9);
80
81}
82
83int __init via82c505_setup(int nr, struct pci_sys_data *sys)
84{
85 return (nr == 0);
86}
87
88struct pci_bus * __init via82c505_scan_bus(int nr, struct pci_sys_data *sysdata)
89{
90 if (nr == 0)
91 return pci_scan_bus(0, &via82c505_ops, sysdata);
92
93 return NULL;
94}
diff --git a/arch/arm/configs/assabet_defconfig b/arch/arm/configs/assabet_defconfig
new file mode 100644
index 000000000000..ccbb4c0d58c4
--- /dev/null
+++ b/arch/arm/configs/assabet_defconfig
@@ -0,0 +1,906 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11
4# Wed Mar 9 13:13:30 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_LOG_BUF_SHIFT=14
31CONFIG_HOTPLUG=y
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_UNLOAD is not set
54CONFIG_OBSOLETE_MODPARM=y
55# CONFIG_MODVERSIONS is not set
56# CONFIG_MODULE_SRCVERSION_ALL is not set
57# CONFIG_KMOD is not set
58
59#
60# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66# CONFIG_ARCH_CAMELOT is not set
67# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73# CONFIG_ARCH_PXA is not set
74# CONFIG_ARCH_RPC is not set
75CONFIG_ARCH_SA1100=y
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81# CONFIG_ARCH_IMX is not set
82# CONFIG_ARCH_H720X is not set
83
84#
85# SA11x0 Implementations
86#
87CONFIG_SA1100_ASSABET=y
88# CONFIG_ASSABET_NEPONSET is not set
89# CONFIG_SA1100_CERF is not set
90# CONFIG_SA1100_COLLIE is not set
91# CONFIG_SA1100_H3100 is not set
92# CONFIG_SA1100_H3600 is not set
93# CONFIG_SA1100_H3800 is not set
94# CONFIG_SA1100_BADGE4 is not set
95# CONFIG_SA1100_JORNADA720 is not set
96# CONFIG_SA1100_HACKKIT is not set
97# CONFIG_SA1100_LART is not set
98# CONFIG_SA1100_PLEB is not set
99# CONFIG_SA1100_SHANNON is not set
100# CONFIG_SA1100_SIMPAD is not set
101# CONFIG_SA1100_SSP is not set
102
103#
104# Processor Type
105#
106CONFIG_CPU_32=y
107CONFIG_CPU_SA1100=y
108CONFIG_CPU_32v4=y
109CONFIG_CPU_ABRT_EV4=y
110CONFIG_CPU_CACHE_V4WB=y
111CONFIG_CPU_CACHE_VIVT=y
112CONFIG_CPU_TLB_V4WB=y
113CONFIG_CPU_MINICACHE=y
114
115#
116# Processor Features
117#
118
119#
120# Bus support
121#
122CONFIG_ISA=y
123
124#
125# PCCARD (PCMCIA/CardBus) support
126#
127CONFIG_PCCARD=y
128# CONFIG_PCMCIA_DEBUG is not set
129CONFIG_PCMCIA=y
130
131#
132# PC-card bridges
133#
134# CONFIG_I82365 is not set
135# CONFIG_TCIC is not set
136CONFIG_PCMCIA_SA1100=y
137
138#
139# Kernel Features
140#
141# CONFIG_PREEMPT is not set
142CONFIG_DISCONTIGMEM=y
143CONFIG_LEDS=y
144CONFIG_LEDS_TIMER=y
145CONFIG_LEDS_CPU=y
146CONFIG_ALIGNMENT_TRAP=y
147
148#
149# Boot options
150#
151CONFIG_ZBOOT_ROM_TEXT=0x0
152CONFIG_ZBOOT_ROM_BSS=0x0
153CONFIG_CMDLINE="mem=32M console=ttySA0,38400n8 initrd=0xc0800000,3M root=/dev/ram"
154# CONFIG_XIP_KERNEL is not set
155CONFIG_CPU_FREQ=y
156# CONFIG_CPU_FREQ_DEBUG is not set
157# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
158CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
159# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set
160# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
161CONFIG_CPU_FREQ_GOV_USERSPACE=y
162# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
163CONFIG_CPU_FREQ_SA1110=y
164
165#
166# Floating point emulation
167#
168
169#
170# At least one emulation must be selected
171#
172CONFIG_FPE_NWFPE=y
173# CONFIG_FPE_NWFPE_XP is not set
174# CONFIG_FPE_FASTFPE is not set
175
176#
177# Userspace binary formats
178#
179CONFIG_BINFMT_ELF=y
180# CONFIG_BINFMT_AOUT is not set
181# CONFIG_BINFMT_MISC is not set
182# CONFIG_ARTHUR is not set
183
184#
185# Power management options
186#
187CONFIG_PM=y
188# CONFIG_APM is not set
189
190#
191# Device Drivers
192#
193
194#
195# Generic Driver Options
196#
197CONFIG_STANDALONE=y
198CONFIG_PREVENT_FIRMWARE_BUILD=y
199# CONFIG_FW_LOADER is not set
200
201#
202# Memory Technology Devices (MTD)
203#
204CONFIG_MTD=y
205# CONFIG_MTD_DEBUG is not set
206CONFIG_MTD_PARTITIONS=y
207# CONFIG_MTD_CONCAT is not set
208CONFIG_MTD_REDBOOT_PARTS=y
209CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
210# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
211# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
212# CONFIG_MTD_CMDLINE_PARTS is not set
213# CONFIG_MTD_AFS_PARTS is not set
214
215#
216# User Modules And Translation Layers
217#
218CONFIG_MTD_CHAR=y
219CONFIG_MTD_BLOCK=y
220# CONFIG_FTL is not set
221# CONFIG_NFTL is not set
222# CONFIG_INFTL is not set
223
224#
225# RAM/ROM/Flash chip drivers
226#
227CONFIG_MTD_CFI=y
228# CONFIG_MTD_JEDECPROBE is not set
229CONFIG_MTD_GEN_PROBE=y
230CONFIG_MTD_CFI_ADV_OPTIONS=y
231CONFIG_MTD_CFI_NOSWAP=y
232# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
233# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
234CONFIG_MTD_CFI_GEOMETRY=y
235CONFIG_MTD_MAP_BANK_WIDTH_1=y
236CONFIG_MTD_MAP_BANK_WIDTH_2=y
237CONFIG_MTD_MAP_BANK_WIDTH_4=y
238# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
239# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
240# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
241# CONFIG_MTD_CFI_I1 is not set
242CONFIG_MTD_CFI_I2=y
243# CONFIG_MTD_CFI_I4 is not set
244# CONFIG_MTD_CFI_I8 is not set
245CONFIG_MTD_CFI_INTELEXT=y
246# CONFIG_MTD_CFI_AMDSTD is not set
247# CONFIG_MTD_CFI_STAA is not set
248CONFIG_MTD_CFI_UTIL=y
249# CONFIG_MTD_RAM is not set
250# CONFIG_MTD_ROM is not set
251# CONFIG_MTD_ABSENT is not set
252# CONFIG_MTD_XIP is not set
253
254#
255# Mapping drivers for chip access
256#
257# CONFIG_MTD_COMPLEX_MAPPINGS is not set
258# CONFIG_MTD_PHYSMAP is not set
259# CONFIG_MTD_ARM_INTEGRATOR is not set
260CONFIG_MTD_SA1100=y
261# CONFIG_MTD_EDB7312 is not set
262
263#
264# Self-contained MTD device drivers
265#
266# CONFIG_MTD_SLRAM is not set
267# CONFIG_MTD_PHRAM is not set
268# CONFIG_MTD_MTDRAM is not set
269# CONFIG_MTD_BLKMTD is not set
270# CONFIG_MTD_BLOCK2MTD is not set
271
272#
273# Disk-On-Chip Device Drivers
274#
275# CONFIG_MTD_DOC2000 is not set
276# CONFIG_MTD_DOC2001 is not set
277# CONFIG_MTD_DOC2001PLUS is not set
278
279#
280# NAND Flash Device Drivers
281#
282# CONFIG_MTD_NAND is not set
283
284#
285# Parallel port support
286#
287# CONFIG_PARPORT is not set
288
289#
290# Plug and Play support
291#
292# CONFIG_PNP is not set
293
294#
295# Block devices
296#
297# CONFIG_BLK_DEV_FD is not set
298# CONFIG_BLK_DEV_XD is not set
299# CONFIG_BLK_DEV_COW_COMMON is not set
300CONFIG_BLK_DEV_LOOP=m
301# CONFIG_BLK_DEV_CRYPTOLOOP is not set
302# CONFIG_BLK_DEV_NBD is not set
303CONFIG_BLK_DEV_RAM=y
304CONFIG_BLK_DEV_RAM_COUNT=16
305CONFIG_BLK_DEV_RAM_SIZE=4096
306CONFIG_BLK_DEV_INITRD=y
307CONFIG_INITRAMFS_SOURCE=""
308# CONFIG_CDROM_PKTCDVD is not set
309
310#
311# IO Schedulers
312#
313CONFIG_IOSCHED_NOOP=y
314CONFIG_IOSCHED_AS=y
315CONFIG_IOSCHED_DEADLINE=y
316CONFIG_IOSCHED_CFQ=y
317# CONFIG_ATA_OVER_ETH is not set
318
319#
320# ATA/ATAPI/MFM/RLL support
321#
322CONFIG_IDE=y
323CONFIG_BLK_DEV_IDE=y
324
325#
326# Please see Documentation/ide.txt for help/info on IDE drives
327#
328# CONFIG_BLK_DEV_IDE_SATA is not set
329CONFIG_BLK_DEV_IDEDISK=y
330# CONFIG_IDEDISK_MULTI_MODE is not set
331# CONFIG_BLK_DEV_IDECS is not set
332# CONFIG_BLK_DEV_IDECD is not set
333# CONFIG_BLK_DEV_IDETAPE is not set
334# CONFIG_BLK_DEV_IDEFLOPPY is not set
335# CONFIG_IDE_TASK_IOCTL is not set
336
337#
338# IDE chipset support/bugfixes
339#
340CONFIG_IDE_GENERIC=y
341# CONFIG_IDE_ARM is not set
342# CONFIG_IDE_CHIPSETS is not set
343# CONFIG_BLK_DEV_IDEDMA is not set
344# CONFIG_IDEDMA_AUTO is not set
345# CONFIG_BLK_DEV_HD is not set
346
347#
348# SCSI device support
349#
350# CONFIG_SCSI is not set
351
352#
353# Multi-device support (RAID and LVM)
354#
355# CONFIG_MD is not set
356
357#
358# Fusion MPT device support
359#
360
361#
362# IEEE 1394 (FireWire) support
363#
364
365#
366# I2O device support
367#
368
369#
370# Networking support
371#
372CONFIG_NET=y
373
374#
375# Networking options
376#
377# CONFIG_PACKET is not set
378# CONFIG_NETLINK_DEV is not set
379CONFIG_UNIX=y
380# CONFIG_NET_KEY is not set
381CONFIG_INET=y
382# CONFIG_IP_MULTICAST is not set
383# CONFIG_IP_ADVANCED_ROUTER is not set
384# CONFIG_IP_PNP is not set
385# CONFIG_NET_IPIP is not set
386# CONFIG_NET_IPGRE is not set
387# CONFIG_ARPD is not set
388# CONFIG_SYN_COOKIES is not set
389# CONFIG_INET_AH is not set
390# CONFIG_INET_ESP is not set
391# CONFIG_INET_IPCOMP is not set
392# CONFIG_INET_TUNNEL is not set
393# CONFIG_IP_TCPDIAG is not set
394# CONFIG_IP_TCPDIAG_IPV6 is not set
395# CONFIG_IPV6 is not set
396# CONFIG_NETFILTER is not set
397
398#
399# SCTP Configuration (EXPERIMENTAL)
400#
401# CONFIG_IP_SCTP is not set
402# CONFIG_ATM is not set
403# CONFIG_BRIDGE is not set
404# CONFIG_VLAN_8021Q is not set
405# CONFIG_DECNET is not set
406# CONFIG_LLC2 is not set
407# CONFIG_IPX is not set
408# CONFIG_ATALK is not set
409# CONFIG_X25 is not set
410# CONFIG_LAPB is not set
411# CONFIG_NET_DIVERT is not set
412# CONFIG_ECONET is not set
413# CONFIG_WAN_ROUTER is not set
414
415#
416# QoS and/or fair queueing
417#
418# CONFIG_NET_SCHED is not set
419# CONFIG_NET_CLS_ROUTE is not set
420
421#
422# Network testing
423#
424# CONFIG_NET_PKTGEN is not set
425# CONFIG_NETPOLL is not set
426# CONFIG_NET_POLL_CONTROLLER is not set
427# CONFIG_HAMRADIO is not set
428CONFIG_IRDA=m
429
430#
431# IrDA protocols
432#
433CONFIG_IRLAN=m
434# CONFIG_IRCOMM is not set
435# CONFIG_IRDA_ULTRA is not set
436
437#
438# IrDA options
439#
440# CONFIG_IRDA_CACHE_LAST_LSAP is not set
441# CONFIG_IRDA_FAST_RR is not set
442# CONFIG_IRDA_DEBUG is not set
443
444#
445# Infrared-port device drivers
446#
447
448#
449# SIR device drivers
450#
451# CONFIG_IRTTY_SIR is not set
452
453#
454# Dongle support
455#
456
457#
458# Old SIR device drivers
459#
460# CONFIG_IRPORT_SIR is not set
461
462#
463# Old Serial dongle support
464#
465
466#
467# FIR device drivers
468#
469# CONFIG_NSC_FIR is not set
470# CONFIG_WINBOND_FIR is not set
471# CONFIG_SMC_IRCC_FIR is not set
472# CONFIG_ALI_FIR is not set
473CONFIG_SA1100_FIR=m
474# CONFIG_BT is not set
475CONFIG_NETDEVICES=y
476# CONFIG_DUMMY is not set
477# CONFIG_BONDING is not set
478# CONFIG_EQUALIZER is not set
479# CONFIG_TUN is not set
480
481#
482# ARCnet devices
483#
484# CONFIG_ARCNET is not set
485
486#
487# Ethernet (10 or 100Mbit)
488#
489CONFIG_NET_ETHERNET=y
490# CONFIG_MII is not set
491# CONFIG_NET_VENDOR_3COM is not set
492# CONFIG_LANCE is not set
493# CONFIG_NET_VENDOR_SMC is not set
494# CONFIG_SMC91X is not set
495# CONFIG_NET_VENDOR_RACAL is not set
496# CONFIG_AT1700 is not set
497# CONFIG_DEPCA is not set
498# CONFIG_HP100 is not set
499# CONFIG_NET_ISA is not set
500# CONFIG_NET_PCI is not set
501# CONFIG_NET_POCKET is not set
502
503#
504# Ethernet (1000 Mbit)
505#
506
507#
508# Ethernet (10000 Mbit)
509#
510
511#
512# Token Ring devices
513#
514# CONFIG_TR is not set
515
516#
517# Wireless LAN (non-hamradio)
518#
519# CONFIG_NET_RADIO is not set
520
521#
522# PCMCIA network device support
523#
524CONFIG_NET_PCMCIA=y
525# CONFIG_PCMCIA_3C589 is not set
526# CONFIG_PCMCIA_3C574 is not set
527# CONFIG_PCMCIA_FMVJ18X is not set
528CONFIG_PCMCIA_PCNET=y
529# CONFIG_PCMCIA_NMCLAN is not set
530# CONFIG_PCMCIA_SMC91C92 is not set
531# CONFIG_PCMCIA_XIRC2PS is not set
532# CONFIG_PCMCIA_AXNET is not set
533
534#
535# Wan interfaces
536#
537# CONFIG_WAN is not set
538# CONFIG_PPP is not set
539# CONFIG_SLIP is not set
540# CONFIG_SHAPER is not set
541# CONFIG_NETCONSOLE is not set
542
543#
544# ISDN subsystem
545#
546# CONFIG_ISDN is not set
547
548#
549# Input device support
550#
551CONFIG_INPUT=y
552
553#
554# Userland interfaces
555#
556CONFIG_INPUT_MOUSEDEV=y
557CONFIG_INPUT_MOUSEDEV_PSAUX=y
558CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
559CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
560# CONFIG_INPUT_JOYDEV is not set
561CONFIG_INPUT_TSDEV=y
562CONFIG_INPUT_TSDEV_SCREEN_X=240
563CONFIG_INPUT_TSDEV_SCREEN_Y=320
564CONFIG_INPUT_EVDEV=y
565# CONFIG_INPUT_EVBUG is not set
566
567#
568# Input I/O drivers
569#
570# CONFIG_GAMEPORT is not set
571CONFIG_SOUND_GAMEPORT=y
572# CONFIG_SERIO is not set
573
574#
575# Input Device Drivers
576#
577# CONFIG_INPUT_KEYBOARD is not set
578# CONFIG_INPUT_MOUSE is not set
579# CONFIG_INPUT_JOYSTICK is not set
580# CONFIG_INPUT_TOUCHSCREEN is not set
581# CONFIG_INPUT_MISC 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#
594CONFIG_SERIAL_8250=m
595# CONFIG_SERIAL_8250_CS is not set
596CONFIG_SERIAL_8250_NR_UARTS=4
597# CONFIG_SERIAL_8250_EXTENDED is not set
598
599#
600# Non-8250 serial port support
601#
602CONFIG_SERIAL_SA1100=y
603CONFIG_SERIAL_SA1100_CONSOLE=y
604CONFIG_SERIAL_CORE=y
605CONFIG_SERIAL_CORE_CONSOLE=y
606CONFIG_UNIX98_PTYS=y
607CONFIG_LEGACY_PTYS=y
608CONFIG_LEGACY_PTY_COUNT=256
609
610#
611# IPMI
612#
613# CONFIG_IPMI_HANDLER is not set
614
615#
616# Watchdog Cards
617#
618# CONFIG_WATCHDOG is not set
619# CONFIG_NVRAM is not set
620# CONFIG_RTC is not set
621# CONFIG_DTLK is not set
622# CONFIG_R3964 is not set
623
624#
625# Ftape, the floppy tape device driver
626#
627# CONFIG_DRM is not set
628
629#
630# PCMCIA character devices
631#
632# CONFIG_SYNCLINK_CS is not set
633# CONFIG_RAW_DRIVER is not set
634
635#
636# I2C support
637#
638# CONFIG_I2C is not set
639
640#
641# Misc devices
642#
643
644#
645# Multimedia devices
646#
647# CONFIG_VIDEO_DEV is not set
648
649#
650# Digital Video Broadcasting Devices
651#
652# CONFIG_DVB is not set
653
654#
655# Graphics support
656#
657CONFIG_FB=y
658# CONFIG_FB_MODE_HELPERS is not set
659# CONFIG_FB_TILEBLITTING is not set
660CONFIG_FB_SA1100=y
661# CONFIG_FB_VIRTUAL is not set
662
663#
664# Console display driver support
665#
666# CONFIG_VGA_CONSOLE is not set
667# CONFIG_MDA_CONSOLE is not set
668CONFIG_DUMMY_CONSOLE=y
669# CONFIG_FRAMEBUFFER_CONSOLE is not set
670
671#
672# Logo configuration
673#
674# CONFIG_LOGO is not set
675# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
676
677#
678# Sound
679#
680CONFIG_SOUND=y
681
682#
683# Advanced Linux Sound Architecture
684#
685# CONFIG_SND is not set
686
687#
688# Open Sound System
689#
690# CONFIG_SOUND_PRIME is not set
691
692#
693# USB support
694#
695# CONFIG_USB is not set
696CONFIG_USB_ARCH_HAS_HCD=y
697# CONFIG_USB_ARCH_HAS_OHCI is not set
698
699#
700# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
701#
702
703#
704# USB Gadget Support
705#
706# CONFIG_USB_GADGET is not set
707
708#
709# MMC/SD Card support
710#
711# CONFIG_MMC is not set
712
713#
714# File systems
715#
716CONFIG_EXT2_FS=y
717# CONFIG_EXT2_FS_XATTR is not set
718# CONFIG_EXT3_FS is not set
719# CONFIG_JBD is not set
720# CONFIG_REISERFS_FS is not set
721# CONFIG_JFS_FS is not set
722
723#
724# XFS support
725#
726# CONFIG_XFS_FS is not set
727# CONFIG_MINIX_FS is not set
728# CONFIG_ROMFS_FS is not set
729# CONFIG_QUOTA is not set
730CONFIG_DNOTIFY=y
731# CONFIG_AUTOFS_FS is not set
732# CONFIG_AUTOFS4_FS is not set
733
734#
735# CD-ROM/DVD Filesystems
736#
737# CONFIG_ISO9660_FS is not set
738# CONFIG_UDF_FS is not set
739
740#
741# DOS/FAT/NT Filesystems
742#
743CONFIG_FAT_FS=y
744CONFIG_MSDOS_FS=y
745# CONFIG_VFAT_FS is not set
746CONFIG_FAT_DEFAULT_CODEPAGE=437
747# CONFIG_NTFS_FS is not set
748
749#
750# Pseudo filesystems
751#
752CONFIG_PROC_FS=y
753CONFIG_SYSFS=y
754# CONFIG_DEVFS_FS is not set
755# CONFIG_DEVPTS_FS_XATTR is not set
756CONFIG_TMPFS=y
757# CONFIG_TMPFS_XATTR is not set
758# CONFIG_HUGETLB_PAGE is not set
759CONFIG_RAMFS=y
760
761#
762# Miscellaneous filesystems
763#
764# CONFIG_ADFS_FS is not set
765# CONFIG_AFFS_FS is not set
766# CONFIG_HFS_FS is not set
767# CONFIG_HFSPLUS_FS is not set
768# CONFIG_BEFS_FS is not set
769# CONFIG_BFS_FS is not set
770# CONFIG_EFS_FS is not set
771# CONFIG_JFFS_FS is not set
772CONFIG_JFFS2_FS=y
773CONFIG_JFFS2_FS_DEBUG=0
774# CONFIG_JFFS2_FS_NAND is not set
775# CONFIG_JFFS2_FS_NOR_ECC is not set
776# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
777CONFIG_JFFS2_ZLIB=y
778CONFIG_JFFS2_RTIME=y
779# CONFIG_JFFS2_RUBIN is not set
780# CONFIG_CRAMFS is not set
781# CONFIG_VXFS_FS is not set
782# CONFIG_HPFS_FS is not set
783# CONFIG_QNX4FS_FS is not set
784# CONFIG_SYSV_FS is not set
785# CONFIG_UFS_FS is not set
786
787#
788# Network File Systems
789#
790CONFIG_NFS_FS=y
791# CONFIG_NFS_V3 is not set
792# CONFIG_NFS_V4 is not set
793# CONFIG_NFS_DIRECTIO is not set
794# CONFIG_NFSD is not set
795CONFIG_LOCKD=y
796CONFIG_SUNRPC=y
797# CONFIG_RPCSEC_GSS_KRB5 is not set
798# CONFIG_RPCSEC_GSS_SPKM3 is not set
799# CONFIG_SMB_FS is not set
800# CONFIG_CIFS is not set
801# CONFIG_NCP_FS is not set
802# CONFIG_CODA_FS is not set
803# CONFIG_AFS_FS is not set
804
805#
806# Partition Types
807#
808CONFIG_PARTITION_ADVANCED=y
809# CONFIG_ACORN_PARTITION is not set
810# CONFIG_OSF_PARTITION is not set
811# CONFIG_AMIGA_PARTITION is not set
812# CONFIG_ATARI_PARTITION is not set
813# CONFIG_MAC_PARTITION is not set
814CONFIG_MSDOS_PARTITION=y
815# CONFIG_BSD_DISKLABEL is not set
816# CONFIG_MINIX_SUBPARTITION is not set
817# CONFIG_SOLARIS_X86_PARTITION is not set
818# CONFIG_UNIXWARE_DISKLABEL is not set
819# CONFIG_LDM_PARTITION is not set
820# CONFIG_SGI_PARTITION is not set
821# CONFIG_ULTRIX_PARTITION is not set
822# CONFIG_SUN_PARTITION is not set
823# CONFIG_EFI_PARTITION is not set
824
825#
826# Native Language Support
827#
828CONFIG_NLS=y
829CONFIG_NLS_DEFAULT="iso8859-1"
830CONFIG_NLS_CODEPAGE_437=y
831# CONFIG_NLS_CODEPAGE_737 is not set
832# CONFIG_NLS_CODEPAGE_775 is not set
833# CONFIG_NLS_CODEPAGE_850 is not set
834# CONFIG_NLS_CODEPAGE_852 is not set
835# CONFIG_NLS_CODEPAGE_855 is not set
836# CONFIG_NLS_CODEPAGE_857 is not set
837# CONFIG_NLS_CODEPAGE_860 is not set
838# CONFIG_NLS_CODEPAGE_861 is not set
839# CONFIG_NLS_CODEPAGE_862 is not set
840# CONFIG_NLS_CODEPAGE_863 is not set
841# CONFIG_NLS_CODEPAGE_864 is not set
842# CONFIG_NLS_CODEPAGE_865 is not set
843# CONFIG_NLS_CODEPAGE_866 is not set
844# CONFIG_NLS_CODEPAGE_869 is not set
845# CONFIG_NLS_CODEPAGE_936 is not set
846# CONFIG_NLS_CODEPAGE_950 is not set
847# CONFIG_NLS_CODEPAGE_932 is not set
848# CONFIG_NLS_CODEPAGE_949 is not set
849# CONFIG_NLS_CODEPAGE_874 is not set
850# CONFIG_NLS_ISO8859_8 is not set
851# CONFIG_NLS_CODEPAGE_1250 is not set
852# CONFIG_NLS_CODEPAGE_1251 is not set
853# CONFIG_NLS_ASCII is not set
854# CONFIG_NLS_ISO8859_1 is not set
855# CONFIG_NLS_ISO8859_2 is not set
856# CONFIG_NLS_ISO8859_3 is not set
857# CONFIG_NLS_ISO8859_4 is not set
858# CONFIG_NLS_ISO8859_5 is not set
859# CONFIG_NLS_ISO8859_6 is not set
860# CONFIG_NLS_ISO8859_7 is not set
861# CONFIG_NLS_ISO8859_9 is not set
862# CONFIG_NLS_ISO8859_13 is not set
863# CONFIG_NLS_ISO8859_14 is not set
864# CONFIG_NLS_ISO8859_15 is not set
865# CONFIG_NLS_KOI8_R is not set
866# CONFIG_NLS_KOI8_U is not set
867# CONFIG_NLS_UTF8 is not set
868
869#
870# Profiling support
871#
872# CONFIG_PROFILING is not set
873
874#
875# Kernel hacking
876#
877# CONFIG_DEBUG_KERNEL is not set
878# CONFIG_PRINTK_TIME is not set
879CONFIG_DEBUG_BUGVERBOSE=y
880# CONFIG_DEBUG_INFO is not set
881CONFIG_FRAME_POINTER=y
882CONFIG_DEBUG_USER=y
883
884#
885# Security options
886#
887# CONFIG_KEYS is not set
888# CONFIG_SECURITY is not set
889
890#
891# Cryptographic options
892#
893# CONFIG_CRYPTO is not set
894
895#
896# Hardware crypto devices
897#
898
899#
900# Library routines
901#
902CONFIG_CRC_CCITT=m
903CONFIG_CRC32=y
904# CONFIG_LIBCRC32C is not set
905CONFIG_ZLIB_INFLATE=y
906CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/badge4_defconfig b/arch/arm/configs/badge4_defconfig
new file mode 100644
index 000000000000..2b4059d2f8e4
--- /dev/null
+++ b/arch/arm/configs/badge4_defconfig
@@ -0,0 +1,1240 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sat Mar 26 21:32:26 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25# CONFIG_SYSVIPC is not set
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_UNLOAD is not set
54CONFIG_OBSOLETE_MODPARM=y
55CONFIG_MODVERSIONS=y
56# CONFIG_MODULE_SRCVERSION_ALL is not set
57CONFIG_KMOD=y
58
59#
60# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66# CONFIG_ARCH_CAMELOT is not set
67# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73# CONFIG_ARCH_PXA is not set
74# CONFIG_ARCH_RPC is not set
75CONFIG_ARCH_SA1100=y
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81# CONFIG_ARCH_IMX is not set
82# CONFIG_ARCH_H720X is not set
83
84#
85# SA11x0 Implementations
86#
87# CONFIG_SA1100_ASSABET is not set
88# CONFIG_SA1100_CERF is not set
89# CONFIG_SA1100_COLLIE is not set
90# CONFIG_SA1100_H3100 is not set
91# CONFIG_SA1100_H3600 is not set
92# CONFIG_SA1100_H3800 is not set
93CONFIG_SA1100_BADGE4=y
94# CONFIG_SA1100_JORNADA720 is not set
95# CONFIG_SA1100_HACKKIT is not set
96# CONFIG_SA1100_LART is not set
97# CONFIG_SA1100_PLEB is not set
98# CONFIG_SA1100_SHANNON is not set
99# CONFIG_SA1100_SIMPAD is not set
100# CONFIG_SA1100_SSP is not set
101
102#
103# Processor Type
104#
105CONFIG_CPU_32=y
106CONFIG_CPU_SA1100=y
107CONFIG_CPU_32v4=y
108CONFIG_CPU_ABRT_EV4=y
109CONFIG_CPU_CACHE_V4WB=y
110CONFIG_CPU_CACHE_VIVT=y
111CONFIG_CPU_TLB_V4WB=y
112CONFIG_CPU_MINICACHE=y
113
114#
115# Processor Features
116#
117CONFIG_SA1111=y
118CONFIG_DMABOUNCE=y
119CONFIG_FORCE_MAX_ZONEORDER=9
120
121#
122# Bus support
123#
124CONFIG_ISA=y
125
126#
127# PCCARD (PCMCIA/CardBus) support
128#
129# CONFIG_PCCARD is not set
130
131#
132# Kernel Features
133#
134# CONFIG_PREEMPT is not set
135CONFIG_DISCONTIGMEM=y
136# CONFIG_LEDS is not set
137CONFIG_ALIGNMENT_TRAP=y
138
139#
140# Boot options
141#
142CONFIG_ZBOOT_ROM_TEXT=0x0
143CONFIG_ZBOOT_ROM_BSS=0x0
144CONFIG_CMDLINE="init=/linuxrc root=/dev/mtdblock3"
145# CONFIG_XIP_KERNEL is not set
146
147#
148# CPU Frequency scaling
149#
150CONFIG_CPU_FREQ=y
151CONFIG_CPU_FREQ_TABLE=y
152# CONFIG_CPU_FREQ_DEBUG is not set
153CONFIG_CPU_FREQ_STAT=y
154# CONFIG_CPU_FREQ_STAT_DETAILS is not set
155CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
156# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
157CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
158# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
159# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
160# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
161
162#
163# Floating point emulation
164#
165
166#
167# At least one emulation must be selected
168#
169CONFIG_FPE_NWFPE=y
170# CONFIG_FPE_NWFPE_XP is not set
171# CONFIG_FPE_FASTFPE is not set
172
173#
174# Userspace binary formats
175#
176CONFIG_BINFMT_ELF=y
177CONFIG_BINFMT_AOUT=m
178CONFIG_BINFMT_MISC=m
179CONFIG_ARTHUR=m
180
181#
182# Power management options
183#
184# CONFIG_PM is not set
185
186#
187# Device Drivers
188#
189
190#
191# Generic Driver Options
192#
193CONFIG_STANDALONE=y
194CONFIG_PREVENT_FIRMWARE_BUILD=y
195# CONFIG_FW_LOADER is not set
196# CONFIG_DEBUG_DRIVER is not set
197
198#
199# Memory Technology Devices (MTD)
200#
201CONFIG_MTD=y
202CONFIG_MTD_DEBUG=y
203CONFIG_MTD_DEBUG_VERBOSE=0
204# CONFIG_MTD_CONCAT is not set
205CONFIG_MTD_PARTITIONS=y
206# CONFIG_MTD_REDBOOT_PARTS is not set
207# CONFIG_MTD_CMDLINE_PARTS is not set
208# CONFIG_MTD_AFS_PARTS is not set
209
210#
211# User Modules And Translation Layers
212#
213CONFIG_MTD_CHAR=y
214CONFIG_MTD_BLOCK=y
215# CONFIG_FTL is not set
216# CONFIG_NFTL is not set
217# CONFIG_INFTL is not set
218
219#
220# RAM/ROM/Flash chip drivers
221#
222CONFIG_MTD_CFI=y
223# CONFIG_MTD_JEDECPROBE is not set
224CONFIG_MTD_GEN_PROBE=y
225CONFIG_MTD_CFI_ADV_OPTIONS=y
226CONFIG_MTD_CFI_NOSWAP=y
227# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
228# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
229CONFIG_MTD_CFI_GEOMETRY=y
230CONFIG_MTD_MAP_BANK_WIDTH_1=y
231CONFIG_MTD_MAP_BANK_WIDTH_2=y
232CONFIG_MTD_MAP_BANK_WIDTH_4=y
233# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
234# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
235# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
236CONFIG_MTD_CFI_I1=y
237# CONFIG_MTD_CFI_I2 is not set
238# CONFIG_MTD_CFI_I4 is not set
239# CONFIG_MTD_CFI_I8 is not set
240CONFIG_MTD_CFI_INTELEXT=y
241# CONFIG_MTD_CFI_AMDSTD is not set
242# CONFIG_MTD_CFI_STAA is not set
243CONFIG_MTD_CFI_UTIL=y
244CONFIG_MTD_RAM=y
245# CONFIG_MTD_ROM is not set
246# CONFIG_MTD_ABSENT is not set
247# CONFIG_MTD_XIP is not set
248
249#
250# Mapping drivers for chip access
251#
252# CONFIG_MTD_COMPLEX_MAPPINGS is not set
253# CONFIG_MTD_PHYSMAP is not set
254# CONFIG_MTD_ARM_INTEGRATOR is not set
255CONFIG_MTD_SA1100=y
256# CONFIG_MTD_EDB7312 is not set
257
258#
259# Self-contained MTD device drivers
260#
261# CONFIG_MTD_SLRAM is not set
262# CONFIG_MTD_PHRAM is not set
263# CONFIG_MTD_MTDRAM is not set
264# CONFIG_MTD_BLKMTD is not set
265# CONFIG_MTD_BLOCK2MTD is not set
266
267#
268# Disk-On-Chip Device Drivers
269#
270# CONFIG_MTD_DOC2000 is not set
271# CONFIG_MTD_DOC2001 is not set
272# CONFIG_MTD_DOC2001PLUS is not set
273
274#
275# NAND Flash Device Drivers
276#
277# CONFIG_MTD_NAND is not set
278
279#
280# Parallel port support
281#
282CONFIG_PARPORT=m
283# CONFIG_PARPORT_PC is not set
284CONFIG_PARPORT_NOT_PC=y
285# CONFIG_PARPORT_ARC is not set
286# CONFIG_PARPORT_GSC is not set
287# CONFIG_PARPORT_1284 is not set
288
289#
290# Plug and Play support
291#
292# CONFIG_PNP is not set
293
294#
295# Block devices
296#
297# CONFIG_BLK_DEV_FD is not set
298# CONFIG_BLK_DEV_XD is not set
299# CONFIG_PARIDE is not set
300# CONFIG_BLK_DEV_COW_COMMON is not set
301CONFIG_BLK_DEV_LOOP=y
302# CONFIG_BLK_DEV_CRYPTOLOOP is not set
303CONFIG_BLK_DEV_NBD=m
304# CONFIG_BLK_DEV_UB is not set
305# CONFIG_BLK_DEV_RAM is not set
306CONFIG_BLK_DEV_RAM_COUNT=16
307CONFIG_INITRAMFS_SOURCE=""
308# CONFIG_CDROM_PKTCDVD is not set
309
310#
311# IO Schedulers
312#
313CONFIG_IOSCHED_NOOP=y
314CONFIG_IOSCHED_AS=y
315CONFIG_IOSCHED_DEADLINE=y
316CONFIG_IOSCHED_CFQ=y
317# CONFIG_ATA_OVER_ETH is not set
318
319#
320# ATA/ATAPI/MFM/RLL support
321#
322CONFIG_IDE=m
323CONFIG_BLK_DEV_IDE=m
324
325#
326# Please see Documentation/ide.txt for help/info on IDE drives
327#
328# CONFIG_BLK_DEV_IDE_SATA is not set
329CONFIG_BLK_DEV_IDEDISK=m
330# CONFIG_IDEDISK_MULTI_MODE is not set
331CONFIG_BLK_DEV_IDECD=m
332# CONFIG_BLK_DEV_IDETAPE is not set
333CONFIG_BLK_DEV_IDEFLOPPY=m
334CONFIG_BLK_DEV_IDESCSI=m
335# CONFIG_IDE_TASK_IOCTL is not set
336
337#
338# IDE chipset support/bugfixes
339#
340CONFIG_IDE_GENERIC=m
341# CONFIG_IDE_ARM is not set
342# CONFIG_IDE_CHIPSETS is not set
343# CONFIG_BLK_DEV_IDEDMA is not set
344# CONFIG_IDEDMA_AUTO is not set
345# CONFIG_BLK_DEV_HD is not set
346
347#
348# SCSI device support
349#
350CONFIG_SCSI=y
351CONFIG_SCSI_PROC_FS=y
352
353#
354# SCSI support type (disk, tape, CD-ROM)
355#
356CONFIG_BLK_DEV_SD=y
357CONFIG_CHR_DEV_ST=m
358# CONFIG_CHR_DEV_OSST is not set
359CONFIG_BLK_DEV_SR=m
360# CONFIG_BLK_DEV_SR_VENDOR is not set
361CONFIG_CHR_DEV_SG=y
362
363#
364# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
365#
366# CONFIG_SCSI_MULTI_LUN is not set
367# CONFIG_SCSI_CONSTANTS is not set
368# CONFIG_SCSI_LOGGING is not set
369
370#
371# SCSI Transport Attributes
372#
373# CONFIG_SCSI_SPI_ATTRS is not set
374# CONFIG_SCSI_FC_ATTRS is not set
375# CONFIG_SCSI_ISCSI_ATTRS is not set
376
377#
378# SCSI low-level drivers
379#
380# CONFIG_SCSI_7000FASST is not set
381# CONFIG_SCSI_AHA152X is not set
382# CONFIG_SCSI_AHA1542 is not set
383# CONFIG_SCSI_AIC7XXX_OLD is not set
384# CONFIG_SCSI_IN2000 is not set
385# CONFIG_SCSI_SATA is not set
386# CONFIG_SCSI_BUSLOGIC is not set
387# CONFIG_SCSI_DTC3280 is not set
388# CONFIG_SCSI_EATA is not set
389# CONFIG_SCSI_FUTURE_DOMAIN is not set
390# CONFIG_SCSI_GDTH is not set
391# CONFIG_SCSI_GENERIC_NCR5380 is not set
392# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
393# CONFIG_SCSI_PPA is not set
394# CONFIG_SCSI_IMM is not set
395# CONFIG_SCSI_NCR53C406A is not set
396# CONFIG_SCSI_PAS16 is not set
397# CONFIG_SCSI_PSI240I is not set
398# CONFIG_SCSI_QLOGIC_FAS is not set
399# CONFIG_SCSI_SYM53C416 is not set
400# CONFIG_SCSI_T128 is not set
401# CONFIG_SCSI_U14_34F is not set
402# CONFIG_SCSI_DEBUG is not set
403
404#
405# Multi-device support (RAID and LVM)
406#
407# CONFIG_MD is not set
408
409#
410# Fusion MPT device support
411#
412
413#
414# IEEE 1394 (FireWire) support
415#
416
417#
418# I2O device support
419#
420
421#
422# Networking support
423#
424CONFIG_NET=y
425
426#
427# Networking options
428#
429CONFIG_PACKET=y
430# CONFIG_PACKET_MMAP is not set
431# CONFIG_NETLINK_DEV is not set
432CONFIG_UNIX=y
433# CONFIG_NET_KEY is not set
434CONFIG_INET=y
435# CONFIG_IP_MULTICAST is not set
436# CONFIG_IP_ADVANCED_ROUTER is not set
437# CONFIG_IP_PNP is not set
438# CONFIG_NET_IPIP is not set
439# CONFIG_NET_IPGRE is not set
440# CONFIG_ARPD is not set
441# CONFIG_SYN_COOKIES is not set
442# CONFIG_INET_AH is not set
443# CONFIG_INET_ESP is not set
444# CONFIG_INET_IPCOMP is not set
445# CONFIG_INET_TUNNEL is not set
446CONFIG_IP_TCPDIAG=y
447# CONFIG_IP_TCPDIAG_IPV6 is not set
448# CONFIG_IPV6 is not set
449# CONFIG_NETFILTER is not set
450
451#
452# SCTP Configuration (EXPERIMENTAL)
453#
454# CONFIG_IP_SCTP is not set
455# CONFIG_ATM is not set
456# CONFIG_BRIDGE is not set
457# CONFIG_VLAN_8021Q is not set
458# CONFIG_DECNET is not set
459# CONFIG_LLC2 is not set
460# CONFIG_IPX is not set
461# CONFIG_ATALK is not set
462# CONFIG_X25 is not set
463# CONFIG_LAPB is not set
464# CONFIG_NET_DIVERT is not set
465# CONFIG_ECONET is not set
466# CONFIG_WAN_ROUTER is not set
467
468#
469# QoS and/or fair queueing
470#
471# CONFIG_NET_SCHED is not set
472# CONFIG_NET_CLS_ROUTE is not set
473
474#
475# Network testing
476#
477# CONFIG_NET_PKTGEN is not set
478# CONFIG_NETPOLL is not set
479# CONFIG_NET_POLL_CONTROLLER is not set
480# CONFIG_HAMRADIO is not set
481CONFIG_IRDA=y
482
483#
484# IrDA protocols
485#
486CONFIG_IRLAN=y
487CONFIG_IRCOMM=y
488CONFIG_IRDA_ULTRA=y
489
490#
491# IrDA options
492#
493# CONFIG_IRDA_CACHE_LAST_LSAP is not set
494# CONFIG_IRDA_FAST_RR is not set
495# CONFIG_IRDA_DEBUG is not set
496
497#
498# Infrared-port device drivers
499#
500
501#
502# SIR device drivers
503#
504# CONFIG_IRTTY_SIR is not set
505
506#
507# Dongle support
508#
509
510#
511# Old SIR device drivers
512#
513# CONFIG_IRPORT_SIR is not set
514
515#
516# Old Serial dongle support
517#
518
519#
520# FIR device drivers
521#
522# CONFIG_USB_IRDA is not set
523# CONFIG_SIGMATEL_FIR is not set
524# CONFIG_NSC_FIR is not set
525# CONFIG_WINBOND_FIR is not set
526# CONFIG_SMC_IRCC_FIR is not set
527# CONFIG_ALI_FIR is not set
528CONFIG_SA1100_FIR=y
529CONFIG_BT=m
530CONFIG_BT_L2CAP=m
531# CONFIG_BT_SCO is not set
532# CONFIG_BT_RFCOMM is not set
533# CONFIG_BT_BNEP is not set
534# CONFIG_BT_HIDP is not set
535
536#
537# Bluetooth device drivers
538#
539CONFIG_BT_HCIUSB=m
540# CONFIG_BT_HCIUSB_SCO is not set
541CONFIG_BT_HCIUART=m
542# CONFIG_BT_HCIUART_H4 is not set
543# CONFIG_BT_HCIUART_BCSP is not set
544# CONFIG_BT_HCIBCM203X is not set
545# CONFIG_BT_HCIBPA10X is not set
546# CONFIG_BT_HCIBFUSB is not set
547CONFIG_BT_HCIVHCI=m
548CONFIG_NETDEVICES=y
549# CONFIG_DUMMY is not set
550# CONFIG_BONDING is not set
551# CONFIG_EQUALIZER is not set
552# CONFIG_TUN is not set
553
554#
555# ARCnet devices
556#
557# CONFIG_ARCNET is not set
558
559#
560# Ethernet (10 or 100Mbit)
561#
562# CONFIG_NET_ETHERNET is not set
563CONFIG_MII=m
564
565#
566# Ethernet (1000 Mbit)
567#
568
569#
570# Ethernet (10000 Mbit)
571#
572
573#
574# Token Ring devices
575#
576# CONFIG_TR is not set
577
578#
579# Wireless LAN (non-hamradio)
580#
581CONFIG_NET_RADIO=y
582
583#
584# Obsolete Wireless cards support (pre-802.11)
585#
586# CONFIG_STRIP is not set
587# CONFIG_ARLAN is not set
588# CONFIG_WAVELAN is not set
589
590#
591# Wireless 802.11b ISA/PCI cards support
592#
593# CONFIG_ATMEL is not set
594CONFIG_NET_WIRELESS=y
595
596#
597# Wan interfaces
598#
599# CONFIG_WAN is not set
600# CONFIG_PLIP is not set
601# CONFIG_PPP is not set
602# CONFIG_SLIP is not set
603# CONFIG_SHAPER is not set
604# CONFIG_NETCONSOLE is not set
605
606#
607# ISDN subsystem
608#
609# CONFIG_ISDN is not set
610
611#
612# Input device support
613#
614# CONFIG_INPUT is not set
615
616#
617# Hardware I/O ports
618#
619# CONFIG_SERIO is not set
620# CONFIG_GAMEPORT is not set
621CONFIG_SOUND_GAMEPORT=y
622
623#
624# Character devices
625#
626# CONFIG_VT is not set
627# CONFIG_SERIAL_NONSTANDARD is not set
628
629#
630# Serial drivers
631#
632# CONFIG_SERIAL_8250 is not set
633
634#
635# Non-8250 serial port support
636#
637CONFIG_SERIAL_SA1100=y
638CONFIG_SERIAL_SA1100_CONSOLE=y
639CONFIG_SERIAL_CORE=y
640CONFIG_SERIAL_CORE_CONSOLE=y
641CONFIG_UNIX98_PTYS=y
642CONFIG_LEGACY_PTYS=y
643CONFIG_LEGACY_PTY_COUNT=256
644# CONFIG_PRINTER is not set
645# CONFIG_PPDEV is not set
646# CONFIG_TIPAR is not set
647
648#
649# IPMI
650#
651# CONFIG_IPMI_HANDLER is not set
652
653#
654# Watchdog Cards
655#
656CONFIG_WATCHDOG=y
657# CONFIG_WATCHDOG_NOWAYOUT is not set
658
659#
660# Watchdog Device Drivers
661#
662CONFIG_SOFT_WATCHDOG=m
663CONFIG_SA1100_WATCHDOG=m
664
665#
666# ISA-based Watchdog Cards
667#
668# CONFIG_PCWATCHDOG is not set
669# CONFIG_MIXCOMWD is not set
670# CONFIG_WDT is not set
671
672#
673# USB-based Watchdog Cards
674#
675# CONFIG_USBPCWATCHDOG is not set
676# CONFIG_NVRAM is not set
677CONFIG_RTC=m
678# CONFIG_DTLK is not set
679# CONFIG_R3964 is not set
680
681#
682# Ftape, the floppy tape device driver
683#
684# CONFIG_DRM is not set
685# CONFIG_RAW_DRIVER is not set
686
687#
688# TPM devices
689#
690# CONFIG_TCG_TPM is not set
691
692#
693# I2C support
694#
695CONFIG_I2C=m
696CONFIG_I2C_CHARDEV=m
697
698#
699# I2C Algorithms
700#
701CONFIG_I2C_ALGOBIT=m
702CONFIG_I2C_ALGOPCF=m
703# CONFIG_I2C_ALGOPCA is not set
704
705#
706# I2C Hardware Bus support
707#
708CONFIG_I2C_ELEKTOR=m
709# CONFIG_I2C_ISA is not set
710# CONFIG_I2C_PARPORT is not set
711# CONFIG_I2C_PARPORT_LIGHT is not set
712# CONFIG_I2C_STUB is not set
713# CONFIG_I2C_PCA_ISA is not set
714
715#
716# Hardware Sensors Chip support
717#
718# CONFIG_I2C_SENSOR is not set
719# CONFIG_SENSORS_ADM1021 is not set
720# CONFIG_SENSORS_ADM1025 is not set
721# CONFIG_SENSORS_ADM1026 is not set
722# CONFIG_SENSORS_ADM1031 is not set
723# CONFIG_SENSORS_ASB100 is not set
724# CONFIG_SENSORS_DS1621 is not set
725# CONFIG_SENSORS_FSCHER is not set
726# CONFIG_SENSORS_FSCPOS is not set
727# CONFIG_SENSORS_GL518SM is not set
728# CONFIG_SENSORS_GL520SM is not set
729# CONFIG_SENSORS_IT87 is not set
730# CONFIG_SENSORS_LM63 is not set
731# CONFIG_SENSORS_LM75 is not set
732# CONFIG_SENSORS_LM77 is not set
733# CONFIG_SENSORS_LM78 is not set
734# CONFIG_SENSORS_LM80 is not set
735# CONFIG_SENSORS_LM83 is not set
736# CONFIG_SENSORS_LM85 is not set
737# CONFIG_SENSORS_LM87 is not set
738# CONFIG_SENSORS_LM90 is not set
739# CONFIG_SENSORS_MAX1619 is not set
740# CONFIG_SENSORS_PC87360 is not set
741# CONFIG_SENSORS_SMSC47B397 is not set
742# CONFIG_SENSORS_SMSC47M1 is not set
743# CONFIG_SENSORS_W83781D is not set
744# CONFIG_SENSORS_W83L785TS is not set
745# CONFIG_SENSORS_W83627HF is not set
746
747#
748# Other I2C Chip support
749#
750# CONFIG_SENSORS_EEPROM is not set
751# CONFIG_SENSORS_PCF8574 is not set
752# CONFIG_SENSORS_PCF8591 is not set
753# CONFIG_SENSORS_RTC8564 is not set
754# CONFIG_I2C_DEBUG_CORE is not set
755# CONFIG_I2C_DEBUG_ALGO is not set
756# CONFIG_I2C_DEBUG_BUS is not set
757# CONFIG_I2C_DEBUG_CHIP is not set
758
759#
760# Misc devices
761#
762
763#
764# Multimedia devices
765#
766CONFIG_VIDEO_DEV=y
767
768#
769# Video For Linux
770#
771
772#
773# Video Adapters
774#
775# CONFIG_VIDEO_PMS is not set
776# CONFIG_VIDEO_BWQCAM is not set
777# CONFIG_VIDEO_CQCAM is not set
778# CONFIG_VIDEO_CPIA is not set
779# CONFIG_VIDEO_SAA5246A is not set
780# CONFIG_VIDEO_SAA5249 is not set
781# CONFIG_TUNER_3036 is not set
782# CONFIG_VIDEO_OVCAMCHIP is not set
783
784#
785# Radio Adapters
786#
787# CONFIG_RADIO_CADET is not set
788# CONFIG_RADIO_RTRACK is not set
789# CONFIG_RADIO_RTRACK2 is not set
790# CONFIG_RADIO_AZTECH is not set
791# CONFIG_RADIO_GEMTEK is not set
792# CONFIG_RADIO_MAESTRO is not set
793# CONFIG_RADIO_SF16FMI is not set
794# CONFIG_RADIO_SF16FMR2 is not set
795# CONFIG_RADIO_TERRATEC is not set
796# CONFIG_RADIO_TRUST is not set
797# CONFIG_RADIO_TYPHOON is not set
798# CONFIG_RADIO_ZOLTRIX 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# Sound
812#
813CONFIG_SOUND=y
814
815#
816# Advanced Linux Sound Architecture
817#
818# CONFIG_SND is not set
819
820#
821# Open Sound System
822#
823CONFIG_SOUND_PRIME=y
824# CONFIG_SOUND_BT878 is not set
825# CONFIG_SOUND_FUSION is not set
826# CONFIG_SOUND_CS4281 is not set
827# CONFIG_SOUND_SONICVIBES is not set
828# CONFIG_SOUND_TRIDENT is not set
829# CONFIG_SOUND_MSNDCLAS is not set
830# CONFIG_SOUND_MSNDPIN is not set
831# CONFIG_SOUND_OSS is not set
832# CONFIG_SOUND_TVMIXER is not set
833# CONFIG_SOUND_AD1980 is not set
834
835#
836# USB support
837#
838CONFIG_USB_ARCH_HAS_HCD=y
839CONFIG_USB_ARCH_HAS_OHCI=y
840CONFIG_USB=y
841CONFIG_USB_DEBUG=y
842
843#
844# Miscellaneous USB options
845#
846CONFIG_USB_DEVICEFS=y
847# CONFIG_USB_BANDWIDTH is not set
848# CONFIG_USB_DYNAMIC_MINORS is not set
849# CONFIG_USB_OTG is not set
850
851#
852# USB Host Controller Drivers
853#
854# CONFIG_USB_OHCI_HCD is not set
855# CONFIG_USB_SL811_HCD is not set
856
857#
858# USB Device Class drivers
859#
860CONFIG_USB_AUDIO=y
861
862#
863# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
864#
865# CONFIG_USB_MIDI is not set
866CONFIG_USB_ACM=m
867CONFIG_USB_PRINTER=m
868
869#
870# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
871#
872CONFIG_USB_STORAGE=y
873CONFIG_USB_STORAGE_DEBUG=y
874# CONFIG_USB_STORAGE_RW_DETECT is not set
875# CONFIG_USB_STORAGE_DATAFAB is not set
876# CONFIG_USB_STORAGE_FREECOM is not set
877# CONFIG_USB_STORAGE_ISD200 is not set
878# CONFIG_USB_STORAGE_DPCM is not set
879# CONFIG_USB_STORAGE_USBAT is not set
880# CONFIG_USB_STORAGE_SDDR09 is not set
881# CONFIG_USB_STORAGE_SDDR55 is not set
882# CONFIG_USB_STORAGE_JUMPSHOT is not set
883
884#
885# USB Input Devices
886#
887# CONFIG_USB_HID is not set
888
889#
890# USB HID Boot Protocol drivers
891#
892
893#
894# USB Imaging devices
895#
896CONFIG_USB_MDC800=m
897CONFIG_USB_MICROTEK=m
898
899#
900# USB Multimedia devices
901#
902CONFIG_USB_DABUSB=m
903CONFIG_USB_VICAM=m
904CONFIG_USB_DSBR=m
905CONFIG_USB_IBMCAM=m
906CONFIG_USB_KONICAWC=m
907CONFIG_USB_OV511=m
908CONFIG_USB_SE401=m
909# CONFIG_USB_SN9C102 is not set
910# CONFIG_USB_STV680 is not set
911CONFIG_USB_PWC=m
912
913#
914# USB Network Adapters
915#
916CONFIG_USB_CATC=m
917CONFIG_USB_KAWETH=m
918CONFIG_USB_PEGASUS=m
919# CONFIG_USB_RTL8150 is not set
920CONFIG_USB_USBNET=m
921
922#
923# USB Host-to-Host Cables
924#
925CONFIG_USB_ALI_M5632=y
926CONFIG_USB_AN2720=y
927CONFIG_USB_BELKIN=y
928CONFIG_USB_GENESYS=y
929CONFIG_USB_NET1080=y
930CONFIG_USB_PL2301=y
931CONFIG_USB_KC2190=y
932
933#
934# Intelligent USB Devices/Gadgets
935#
936CONFIG_USB_ARMLINUX=y
937CONFIG_USB_EPSON2888=y
938CONFIG_USB_ZAURUS=y
939CONFIG_USB_CDCETHER=y
940
941#
942# USB Network Adapters
943#
944# CONFIG_USB_ZD1201 is not set
945CONFIG_USB_MON=y
946
947#
948# USB port drivers
949#
950CONFIG_USB_USS720=m
951
952#
953# USB Serial Converter support
954#
955CONFIG_USB_SERIAL=m
956CONFIG_USB_SERIAL_GENERIC=y
957CONFIG_USB_SERIAL_BELKIN=m
958CONFIG_USB_SERIAL_WHITEHEAT=m
959CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
960# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
961CONFIG_USB_SERIAL_EMPEG=m
962CONFIG_USB_SERIAL_FTDI_SIO=m
963CONFIG_USB_SERIAL_VISOR=m
964# CONFIG_USB_SERIAL_IPAQ is not set
965CONFIG_USB_SERIAL_IR=m
966CONFIG_USB_SERIAL_EDGEPORT=m
967# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
968# CONFIG_USB_SERIAL_GARMIN is not set
969# CONFIG_USB_SERIAL_IPW is not set
970CONFIG_USB_SERIAL_KEYSPAN_PDA=m
971CONFIG_USB_SERIAL_KEYSPAN=m
972# CONFIG_USB_SERIAL_KEYSPAN_MPR is not set
973# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
974# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
975# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
976# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
977# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
978# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
979# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
980# CONFIG_USB_SERIAL_KEYSPAN_USA19QW is not set
981# CONFIG_USB_SERIAL_KEYSPAN_USA19QI is not set
982# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
983# CONFIG_USB_SERIAL_KEYSPAN_USA49WLC is not set
984# CONFIG_USB_SERIAL_KLSI is not set
985# CONFIG_USB_SERIAL_KOBIL_SCT is not set
986CONFIG_USB_SERIAL_MCT_U232=m
987CONFIG_USB_SERIAL_PL2303=m
988# CONFIG_USB_SERIAL_SAFE is not set
989# CONFIG_USB_SERIAL_TI is not set
990CONFIG_USB_SERIAL_CYBERJACK=m
991CONFIG_USB_SERIAL_XIRCOM=m
992CONFIG_USB_SERIAL_OMNINET=m
993CONFIG_USB_EZUSB=y
994
995#
996# USB Miscellaneous drivers
997#
998# CONFIG_USB_EMI62 is not set
999# CONFIG_USB_EMI26 is not set
1000# CONFIG_USB_AUERSWALD is not set
1001CONFIG_USB_RIO500=m
1002# CONFIG_USB_LEGOTOWER is not set
1003# CONFIG_USB_LCD is not set
1004# CONFIG_USB_LED is not set
1005# CONFIG_USB_CYTHERM is not set
1006# CONFIG_USB_PHIDGETKIT is not set
1007# CONFIG_USB_PHIDGETSERVO is not set
1008# CONFIG_USB_IDMOUSE is not set
1009# CONFIG_USB_TEST is not set
1010
1011#
1012# USB ATM/DSL drivers
1013#
1014
1015#
1016# USB Gadget Support
1017#
1018# CONFIG_USB_GADGET is not set
1019
1020#
1021# MMC/SD Card support
1022#
1023# CONFIG_MMC is not set
1024
1025#
1026# File systems
1027#
1028CONFIG_EXT2_FS=m
1029# CONFIG_EXT2_FS_XATTR is not set
1030CONFIG_EXT3_FS=m
1031CONFIG_EXT3_FS_XATTR=y
1032# CONFIG_EXT3_FS_POSIX_ACL is not set
1033# CONFIG_EXT3_FS_SECURITY is not set
1034CONFIG_JBD=m
1035# CONFIG_JBD_DEBUG is not set
1036CONFIG_FS_MBCACHE=m
1037# CONFIG_REISERFS_FS is not set
1038# CONFIG_JFS_FS is not set
1039
1040#
1041# XFS support
1042#
1043# CONFIG_XFS_FS is not set
1044CONFIG_MINIX_FS=m
1045# CONFIG_ROMFS_FS is not set
1046# CONFIG_QUOTA is not set
1047CONFIG_DNOTIFY=y
1048# CONFIG_AUTOFS_FS is not set
1049# CONFIG_AUTOFS4_FS is not set
1050
1051#
1052# CD-ROM/DVD Filesystems
1053#
1054# CONFIG_ISO9660_FS is not set
1055# CONFIG_UDF_FS is not set
1056
1057#
1058# DOS/FAT/NT Filesystems
1059#
1060CONFIG_FAT_FS=y
1061CONFIG_MSDOS_FS=y
1062CONFIG_VFAT_FS=m
1063CONFIG_FAT_DEFAULT_CODEPAGE=437
1064CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1065# CONFIG_NTFS_FS is not set
1066
1067#
1068# Pseudo filesystems
1069#
1070CONFIG_PROC_FS=y
1071CONFIG_SYSFS=y
1072CONFIG_DEVFS_FS=y
1073CONFIG_DEVFS_MOUNT=y
1074# CONFIG_DEVFS_DEBUG is not set
1075# CONFIG_DEVPTS_FS_XATTR is not set
1076CONFIG_TMPFS=y
1077# CONFIG_TMPFS_XATTR is not set
1078# CONFIG_HUGETLB_PAGE is not set
1079CONFIG_RAMFS=y
1080
1081#
1082# Miscellaneous filesystems
1083#
1084# CONFIG_ADFS_FS is not set
1085# CONFIG_AFFS_FS is not set
1086# CONFIG_HFS_FS is not set
1087# CONFIG_HFSPLUS_FS is not set
1088# CONFIG_BEFS_FS is not set
1089# CONFIG_BFS_FS is not set
1090# CONFIG_EFS_FS is not set
1091# CONFIG_JFFS_FS is not set
1092CONFIG_JFFS2_FS=y
1093CONFIG_JFFS2_FS_DEBUG=0
1094# CONFIG_JFFS2_FS_NAND is not set
1095# CONFIG_JFFS2_FS_NOR_ECC is not set
1096# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1097CONFIG_JFFS2_ZLIB=y
1098CONFIG_JFFS2_RTIME=y
1099# CONFIG_JFFS2_RUBIN is not set
1100CONFIG_CRAMFS=m
1101# CONFIG_VXFS_FS is not set
1102# CONFIG_HPFS_FS is not set
1103# CONFIG_QNX4FS_FS is not set
1104# CONFIG_SYSV_FS is not set
1105# CONFIG_UFS_FS is not set
1106
1107#
1108# Network File Systems
1109#
1110CONFIG_NFS_FS=m
1111CONFIG_NFS_V3=y
1112# CONFIG_NFS_V4 is not set
1113# CONFIG_NFS_DIRECTIO is not set
1114# CONFIG_NFSD is not set
1115CONFIG_LOCKD=m
1116CONFIG_LOCKD_V4=y
1117CONFIG_SUNRPC=m
1118# CONFIG_RPCSEC_GSS_KRB5 is not set
1119# CONFIG_RPCSEC_GSS_SPKM3 is not set
1120CONFIG_SMB_FS=m
1121# CONFIG_SMB_NLS_DEFAULT is not set
1122# CONFIG_CIFS is not set
1123# CONFIG_NCP_FS is not set
1124# CONFIG_CODA_FS is not set
1125# CONFIG_AFS_FS is not set
1126
1127#
1128# Partition Types
1129#
1130CONFIG_PARTITION_ADVANCED=y
1131# CONFIG_ACORN_PARTITION is not set
1132# CONFIG_OSF_PARTITION is not set
1133# CONFIG_AMIGA_PARTITION is not set
1134# CONFIG_ATARI_PARTITION is not set
1135# CONFIG_MAC_PARTITION is not set
1136CONFIG_MSDOS_PARTITION=y
1137# CONFIG_BSD_DISKLABEL is not set
1138# CONFIG_MINIX_SUBPARTITION is not set
1139# CONFIG_SOLARIS_X86_PARTITION is not set
1140# CONFIG_UNIXWARE_DISKLABEL is not set
1141# CONFIG_LDM_PARTITION is not set
1142# CONFIG_SGI_PARTITION is not set
1143# CONFIG_ULTRIX_PARTITION is not set
1144# CONFIG_SUN_PARTITION is not set
1145# CONFIG_EFI_PARTITION is not set
1146
1147#
1148# Native Language Support
1149#
1150CONFIG_NLS=y
1151CONFIG_NLS_DEFAULT="iso8859-1"
1152# CONFIG_NLS_CODEPAGE_437 is not set
1153# CONFIG_NLS_CODEPAGE_737 is not set
1154# CONFIG_NLS_CODEPAGE_775 is not set
1155# CONFIG_NLS_CODEPAGE_850 is not set
1156# CONFIG_NLS_CODEPAGE_852 is not set
1157# CONFIG_NLS_CODEPAGE_855 is not set
1158# CONFIG_NLS_CODEPAGE_857 is not set
1159# CONFIG_NLS_CODEPAGE_860 is not set
1160# CONFIG_NLS_CODEPAGE_861 is not set
1161# CONFIG_NLS_CODEPAGE_862 is not set
1162# CONFIG_NLS_CODEPAGE_863 is not set
1163# CONFIG_NLS_CODEPAGE_864 is not set
1164# CONFIG_NLS_CODEPAGE_865 is not set
1165# CONFIG_NLS_CODEPAGE_866 is not set
1166# CONFIG_NLS_CODEPAGE_869 is not set
1167# CONFIG_NLS_CODEPAGE_936 is not set
1168# CONFIG_NLS_CODEPAGE_950 is not set
1169# CONFIG_NLS_CODEPAGE_932 is not set
1170# CONFIG_NLS_CODEPAGE_949 is not set
1171# CONFIG_NLS_CODEPAGE_874 is not set
1172# CONFIG_NLS_ISO8859_8 is not set
1173# CONFIG_NLS_CODEPAGE_1250 is not set
1174# CONFIG_NLS_CODEPAGE_1251 is not set
1175# CONFIG_NLS_ASCII is not set
1176# CONFIG_NLS_ISO8859_1 is not set
1177# CONFIG_NLS_ISO8859_2 is not set
1178# CONFIG_NLS_ISO8859_3 is not set
1179# CONFIG_NLS_ISO8859_4 is not set
1180# CONFIG_NLS_ISO8859_5 is not set
1181# CONFIG_NLS_ISO8859_6 is not set
1182# CONFIG_NLS_ISO8859_7 is not set
1183# CONFIG_NLS_ISO8859_9 is not set
1184# CONFIG_NLS_ISO8859_13 is not set
1185# CONFIG_NLS_ISO8859_14 is not set
1186# CONFIG_NLS_ISO8859_15 is not set
1187# CONFIG_NLS_KOI8_R is not set
1188# CONFIG_NLS_KOI8_U is not set
1189# CONFIG_NLS_UTF8 is not set
1190
1191#
1192# Profiling support
1193#
1194# CONFIG_PROFILING is not set
1195
1196#
1197# Kernel hacking
1198#
1199# CONFIG_PRINTK_TIME is not set
1200CONFIG_DEBUG_KERNEL=y
1201CONFIG_MAGIC_SYSRQ=y
1202CONFIG_LOG_BUF_SHIFT=14
1203# CONFIG_SCHEDSTATS is not set
1204# CONFIG_DEBUG_SLAB is not set
1205# CONFIG_DEBUG_SPINLOCK is not set
1206# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1207# CONFIG_DEBUG_KOBJECT is not set
1208# CONFIG_DEBUG_BUGVERBOSE is not set
1209CONFIG_DEBUG_INFO=y
1210# CONFIG_DEBUG_FS is not set
1211CONFIG_FRAME_POINTER=y
1212CONFIG_DEBUG_USER=y
1213# CONFIG_DEBUG_WAITQ is not set
1214CONFIG_DEBUG_ERRORS=y
1215CONFIG_DEBUG_LL=y
1216# CONFIG_DEBUG_ICEDCC is not set
1217
1218#
1219# Security options
1220#
1221# CONFIG_KEYS is not set
1222# CONFIG_SECURITY is not set
1223
1224#
1225# Cryptographic options
1226#
1227# CONFIG_CRYPTO is not set
1228
1229#
1230# Hardware crypto devices
1231#
1232
1233#
1234# Library routines
1235#
1236CONFIG_CRC_CCITT=y
1237CONFIG_CRC32=y
1238# CONFIG_LIBCRC32C is not set
1239CONFIG_ZLIB_INFLATE=y
1240CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/bast_defconfig b/arch/arm/configs/bast_defconfig
new file mode 100644
index 000000000000..2d985e9611cd
--- /dev/null
+++ b/arch/arm/configs/bast_defconfig
@@ -0,0 +1,952 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 02:24:16 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17# CONFIG_CLEAN_COMPILE is not set
18CONFIG_BROKEN=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
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
54# CONFIG_MODULE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set
57# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y
59
60#
61# System Type
62#
63# CONFIG_ARCH_CLPS7500 is not set
64# CONFIG_ARCH_CLPS711X is not set
65# CONFIG_ARCH_CO285 is not set
66# CONFIG_ARCH_EBSA110 is not set
67# CONFIG_ARCH_CAMELOT is not set
68# CONFIG_ARCH_FOOTBRIDGE is not set
69# CONFIG_ARCH_INTEGRATOR is not set
70# CONFIG_ARCH_IOP3XX is not set
71# CONFIG_ARCH_IXP4XX is not set
72# CONFIG_ARCH_IXP2000 is not set
73# CONFIG_ARCH_L7200 is not set
74# CONFIG_ARCH_PXA is not set
75# CONFIG_ARCH_RPC is not set
76# CONFIG_ARCH_SA1100 is not set
77CONFIG_ARCH_S3C2410=y
78# CONFIG_ARCH_SHARK is not set
79# CONFIG_ARCH_LH7A40X is not set
80# CONFIG_ARCH_OMAP is not set
81# CONFIG_ARCH_VERSATILE is not set
82# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set
84
85#
86# S3C24XX Implementations
87#
88CONFIG_ARCH_BAST=y
89# CONFIG_ARCH_H1940 is not set
90# CONFIG_MACH_N30 is not set
91# CONFIG_ARCH_SMDK2410 is not set
92# CONFIG_ARCH_S3C2440 is not set
93CONFIG_MACH_VR1000=y
94# CONFIG_MACH_RX3715 is not set
95# CONFIG_MACH_OTOM is not set
96# CONFIG_MACH_NEXCODER_2440 is not set
97CONFIG_CPU_S3C2410=y
98
99#
100# S3C2410 Boot
101#
102# CONFIG_S3C2410_BOOT_WATCHDOG is not set
103
104#
105# S3C2410 Setup
106#
107CONFIG_S3C2410_DMA=y
108# CONFIG_S3C2410_DMA_DEBUG is not set
109# CONFIG_S3C2410_PM_DEBUG is not set
110# CONFIG_S3C2410_PM_CHECK is not set
111CONFIG_S3C2410_LOWLEVEL_UART_PORT=0
112
113#
114# Processor Type
115#
116CONFIG_CPU_32=y
117CONFIG_CPU_ARM920T=y
118CONFIG_CPU_32v4=y
119CONFIG_CPU_ABRT_EV4T=y
120CONFIG_CPU_CACHE_V4WT=y
121CONFIG_CPU_CACHE_VIVT=y
122CONFIG_CPU_COPY_V4WB=y
123CONFIG_CPU_TLB_V4WBI=y
124
125#
126# Processor Features
127#
128# CONFIG_ARM_THUMB is not set
129# CONFIG_CPU_ICACHE_DISABLE is not set
130# CONFIG_CPU_DCACHE_DISABLE is not set
131# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
132
133#
134# Bus support
135#
136
137#
138# PCCARD (PCMCIA/CardBus) support
139#
140# CONFIG_PCCARD is not set
141
142#
143# Kernel Features
144#
145# CONFIG_PREEMPT is not set
146CONFIG_ALIGNMENT_TRAP=y
147
148#
149# Boot options
150#
151CONFIG_ZBOOT_ROM_TEXT=0x0
152CONFIG_ZBOOT_ROM_BSS=0x0
153CONFIG_CMDLINE="root=/dev/hda1 ro init=/bin/bash console=ttySAC0"
154# CONFIG_XIP_KERNEL is not set
155
156#
157# Floating point emulation
158#
159
160#
161# At least one emulation must be selected
162#
163CONFIG_FPE_NWFPE=y
164# CONFIG_FPE_NWFPE_XP is not set
165# CONFIG_FPE_FASTFPE is not set
166
167#
168# Userspace binary formats
169#
170CONFIG_BINFMT_ELF=y
171CONFIG_BINFMT_AOUT=y
172# CONFIG_BINFMT_MISC is not set
173# CONFIG_ARTHUR is not set
174
175#
176# Power management options
177#
178CONFIG_PM=y
179CONFIG_APM=y
180
181#
182# Device Drivers
183#
184
185#
186# Generic Driver Options
187#
188CONFIG_STANDALONE=y
189CONFIG_PREVENT_FIRMWARE_BUILD=y
190# CONFIG_FW_LOADER is not set
191# CONFIG_DEBUG_DRIVER is not set
192
193#
194# Memory Technology Devices (MTD)
195#
196CONFIG_MTD=y
197# CONFIG_MTD_DEBUG is not set
198# CONFIG_MTD_CONCAT is not set
199CONFIG_MTD_PARTITIONS=y
200CONFIG_MTD_REDBOOT_PARTS=y
201CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
202CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
203# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
204CONFIG_MTD_CMDLINE_PARTS=y
205# CONFIG_MTD_AFS_PARTS is not set
206
207#
208# User Modules And Translation Layers
209#
210CONFIG_MTD_CHAR=y
211CONFIG_MTD_BLOCK=y
212# CONFIG_FTL is not set
213# CONFIG_NFTL is not set
214# CONFIG_INFTL is not set
215
216#
217# RAM/ROM/Flash chip drivers
218#
219CONFIG_MTD_CFI=y
220CONFIG_MTD_JEDECPROBE=y
221CONFIG_MTD_GEN_PROBE=y
222# CONFIG_MTD_CFI_ADV_OPTIONS is not set
223CONFIG_MTD_MAP_BANK_WIDTH_1=y
224CONFIG_MTD_MAP_BANK_WIDTH_2=y
225CONFIG_MTD_MAP_BANK_WIDTH_4=y
226# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
227CONFIG_MTD_MAP_BANK_WIDTH_16=y
228# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
229CONFIG_MTD_CFI_I1=y
230CONFIG_MTD_CFI_I2=y
231# CONFIG_MTD_CFI_I4 is not set
232# CONFIG_MTD_CFI_I8 is not set
233CONFIG_MTD_CFI_INTELEXT=y
234# CONFIG_MTD_CFI_AMDSTD is not set
235# CONFIG_MTD_CFI_STAA is not set
236CONFIG_MTD_CFI_UTIL=y
237# CONFIG_MTD_RAM is not set
238# CONFIG_MTD_ROM is not set
239# CONFIG_MTD_ABSENT is not set
240# CONFIG_MTD_OBSOLETE_CHIPS is not set
241# CONFIG_MTD_XIP is not set
242
243#
244# Mapping drivers for chip access
245#
246# CONFIG_MTD_COMPLEX_MAPPINGS is not set
247# CONFIG_MTD_PHYSMAP is not set
248# CONFIG_MTD_ARM_INTEGRATOR is not set
249# CONFIG_MTD_EDB7312 is not set
250# CONFIG_MTD_IMPA7 is not set
251CONFIG_MTD_BAST=y
252CONFIG_MTD_BAST_MAXSIZE=4
253
254#
255# Self-contained MTD device drivers
256#
257# CONFIG_MTD_SLRAM is not set
258# CONFIG_MTD_PHRAM is not set
259# CONFIG_MTD_MTDRAM is not set
260# CONFIG_MTD_BLKMTD is not set
261# CONFIG_MTD_BLOCK2MTD is not set
262
263#
264# Disk-On-Chip Device Drivers
265#
266# CONFIG_MTD_DOC2000 is not set
267# CONFIG_MTD_DOC2001 is not set
268# CONFIG_MTD_DOC2001PLUS is not set
269
270#
271# NAND Flash Device Drivers
272#
273CONFIG_MTD_NAND=y
274# CONFIG_MTD_NAND_VERIFY_WRITE is not set
275CONFIG_MTD_NAND_IDS=y
276CONFIG_MTD_NAND_S3C2410=y
277# CONFIG_MTD_NAND_S3C2410_DEBUG is not set
278# CONFIG_MTD_NAND_S3C2410_HWECC is not set
279# CONFIG_MTD_NAND_DISKONCHIP is not set
280# CONFIG_MTD_NAND_NANDSIM is not set
281
282#
283# Parallel port support
284#
285CONFIG_PARPORT=y
286# CONFIG_PARPORT_PC is not set
287# CONFIG_PARPORT_ARC is not set
288# CONFIG_PARPORT_GSC is not set
289CONFIG_PARPORT_1284=y
290
291#
292# Plug and Play support
293#
294
295#
296# Block devices
297#
298# CONFIG_BLK_DEV_FD is not set
299# CONFIG_PARIDE is not set
300# CONFIG_BLK_DEV_COW_COMMON is not set
301CONFIG_BLK_DEV_LOOP=y
302# CONFIG_BLK_DEV_CRYPTOLOOP is not set
303CONFIG_BLK_DEV_NBD=m
304CONFIG_BLK_DEV_RAM=y
305CONFIG_BLK_DEV_RAM_COUNT=16
306CONFIG_BLK_DEV_RAM_SIZE=4096
307CONFIG_BLK_DEV_INITRD=y
308CONFIG_INITRAMFS_SOURCE=""
309# CONFIG_CDROM_PKTCDVD is not set
310
311#
312# IO Schedulers
313#
314CONFIG_IOSCHED_NOOP=y
315CONFIG_IOSCHED_AS=y
316CONFIG_IOSCHED_DEADLINE=y
317CONFIG_IOSCHED_CFQ=y
318# CONFIG_ATA_OVER_ETH is not set
319
320#
321# ATA/ATAPI/MFM/RLL support
322#
323CONFIG_IDE=y
324CONFIG_BLK_DEV_IDE=y
325
326#
327# Please see Documentation/ide.txt for help/info on IDE drives
328#
329# CONFIG_BLK_DEV_IDE_SATA is not set
330CONFIG_BLK_DEV_IDEDISK=y
331# CONFIG_IDEDISK_MULTI_MODE is not set
332CONFIG_BLK_DEV_IDECD=y
333CONFIG_BLK_DEV_IDETAPE=m
334CONFIG_BLK_DEV_IDEFLOPPY=m
335# CONFIG_IDE_TASK_IOCTL is not set
336
337#
338# IDE chipset support/bugfixes
339#
340CONFIG_IDE_GENERIC=y
341# CONFIG_IDE_ARM is not set
342CONFIG_BLK_DEV_IDE_BAST=y
343# CONFIG_BLK_DEV_IDEDMA is not set
344# CONFIG_IDEDMA_AUTO is not set
345# CONFIG_BLK_DEV_HD is not set
346
347#
348# SCSI device support
349#
350# CONFIG_SCSI is not set
351
352#
353# Multi-device support (RAID and LVM)
354#
355# CONFIG_MD is not set
356
357#
358# Fusion MPT device support
359#
360
361#
362# IEEE 1394 (FireWire) support
363#
364# CONFIG_IEEE1394 is not set
365
366#
367# I2O device support
368#
369
370#
371# Networking support
372#
373CONFIG_NET=y
374
375#
376# Networking options
377#
378# CONFIG_PACKET is not set
379# CONFIG_NETLINK_DEV is not set
380CONFIG_UNIX=y
381# CONFIG_NET_KEY is not set
382CONFIG_INET=y
383# CONFIG_IP_MULTICAST is not set
384# CONFIG_IP_ADVANCED_ROUTER is not set
385CONFIG_IP_PNP=y
386# CONFIG_IP_PNP_DHCP is not set
387CONFIG_IP_PNP_BOOTP=y
388# CONFIG_IP_PNP_RARP is not set
389# CONFIG_NET_IPIP is not set
390# CONFIG_NET_IPGRE is not set
391# CONFIG_ARPD is not set
392# CONFIG_SYN_COOKIES is not set
393# CONFIG_INET_AH is not set
394# CONFIG_INET_ESP is not set
395# CONFIG_INET_IPCOMP is not set
396# CONFIG_INET_TUNNEL is not set
397CONFIG_IP_TCPDIAG=y
398# CONFIG_IP_TCPDIAG_IPV6 is not set
399# CONFIG_IPV6 is not set
400# CONFIG_NETFILTER is not set
401
402#
403# SCTP Configuration (EXPERIMENTAL)
404#
405# CONFIG_IP_SCTP is not set
406# CONFIG_ATM is not set
407# CONFIG_BRIDGE is not set
408# CONFIG_VLAN_8021Q is not set
409# CONFIG_DECNET is not set
410# CONFIG_LLC2 is not set
411# CONFIG_IPX is not set
412# CONFIG_ATALK is not set
413# CONFIG_X25 is not set
414# CONFIG_LAPB is not set
415# CONFIG_NET_DIVERT is not set
416# CONFIG_ECONET is not set
417# CONFIG_WAN_ROUTER is not set
418
419#
420# QoS and/or fair queueing
421#
422# CONFIG_NET_SCHED is not set
423# CONFIG_NET_CLS_ROUTE is not set
424
425#
426# Network testing
427#
428# CONFIG_NET_PKTGEN is not set
429# CONFIG_NETPOLL is not set
430# CONFIG_NET_POLL_CONTROLLER is not set
431# CONFIG_HAMRADIO is not set
432# CONFIG_IRDA is not set
433# CONFIG_BT is not set
434CONFIG_NETDEVICES=y
435# CONFIG_DUMMY is not set
436# CONFIG_BONDING is not set
437# CONFIG_EQUALIZER is not set
438# CONFIG_TUN is not set
439
440#
441# Ethernet (10 or 100Mbit)
442#
443CONFIG_NET_ETHERNET=y
444# CONFIG_MII is not set
445# CONFIG_SMC91X is not set
446
447#
448# Ethernet (1000 Mbit)
449#
450
451#
452# Ethernet (10000 Mbit)
453#
454
455#
456# Token Ring devices
457#
458
459#
460# Wireless LAN (non-hamradio)
461#
462# CONFIG_NET_RADIO is not set
463
464#
465# Wan interfaces
466#
467# CONFIG_WAN is not set
468# CONFIG_PLIP is not set
469# CONFIG_PPP is not set
470# CONFIG_SLIP is not set
471# CONFIG_SHAPER is not set
472# CONFIG_NETCONSOLE is not set
473
474#
475# ISDN subsystem
476#
477# CONFIG_ISDN is not set
478
479#
480# Input device support
481#
482CONFIG_INPUT=y
483
484#
485# Userland interfaces
486#
487CONFIG_INPUT_MOUSEDEV=y
488CONFIG_INPUT_MOUSEDEV_PSAUX=y
489CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
490CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
491# CONFIG_INPUT_JOYDEV is not set
492# CONFIG_INPUT_TSDEV is not set
493# CONFIG_INPUT_EVDEV is not set
494# CONFIG_INPUT_EVBUG is not set
495
496#
497# Input Device Drivers
498#
499CONFIG_INPUT_KEYBOARD=y
500CONFIG_KEYBOARD_ATKBD=y
501# CONFIG_KEYBOARD_SUNKBD is not set
502# CONFIG_KEYBOARD_LKKBD is not set
503# CONFIG_KEYBOARD_XTKBD is not set
504# CONFIG_KEYBOARD_NEWTON is not set
505CONFIG_INPUT_MOUSE=y
506CONFIG_MOUSE_PS2=y
507# CONFIG_MOUSE_SERIAL is not set
508# CONFIG_MOUSE_VSXXXAA is not set
509# CONFIG_INPUT_JOYSTICK is not set
510# CONFIG_INPUT_TOUCHSCREEN is not set
511# CONFIG_INPUT_MISC is not set
512
513#
514# Hardware I/O ports
515#
516CONFIG_SERIO=y
517CONFIG_SERIO_SERPORT=y
518# CONFIG_SERIO_PARKBD is not set
519CONFIG_SERIO_LIBPS2=y
520# CONFIG_SERIO_RAW is not set
521# CONFIG_GAMEPORT is not set
522CONFIG_SOUND_GAMEPORT=y
523
524#
525# Character devices
526#
527CONFIG_VT=y
528CONFIG_VT_CONSOLE=y
529CONFIG_HW_CONSOLE=y
530CONFIG_SERIAL_NONSTANDARD=y
531# CONFIG_COMPUTONE is not set
532# CONFIG_ROCKETPORT is not set
533# CONFIG_CYCLADES is not set
534# CONFIG_DIGIEPCA is not set
535# CONFIG_MOXA_INTELLIO is not set
536# CONFIG_MOXA_SMARTIO is not set
537# CONFIG_ISI is not set
538# CONFIG_SYNCLINKMP is not set
539# CONFIG_N_HDLC is not set
540# CONFIG_RISCOM8 is not set
541# CONFIG_SPECIALIX is not set
542# CONFIG_SX is not set
543# CONFIG_RIO is not set
544# CONFIG_STALDRV is not set
545
546#
547# Serial drivers
548#
549CONFIG_SERIAL_8250=y
550CONFIG_SERIAL_8250_CONSOLE=y
551CONFIG_SERIAL_8250_NR_UARTS=8
552CONFIG_SERIAL_8250_EXTENDED=y
553CONFIG_SERIAL_8250_MANY_PORTS=y
554CONFIG_SERIAL_8250_SHARE_IRQ=y
555# CONFIG_SERIAL_8250_DETECT_IRQ is not set
556# CONFIG_SERIAL_8250_MULTIPORT is not set
557# CONFIG_SERIAL_8250_RSA is not set
558
559#
560# Non-8250 serial port support
561#
562CONFIG_SERIAL_S3C2410=y
563CONFIG_SERIAL_S3C2410_CONSOLE=y
564CONFIG_SERIAL_BAST_SIO=y
565CONFIG_SERIAL_CORE=y
566CONFIG_SERIAL_CORE_CONSOLE=y
567CONFIG_UNIX98_PTYS=y
568CONFIG_LEGACY_PTYS=y
569CONFIG_LEGACY_PTY_COUNT=256
570CONFIG_PRINTER=y
571# CONFIG_LP_CONSOLE is not set
572CONFIG_PPDEV=y
573# CONFIG_TIPAR is not set
574
575#
576# IPMI
577#
578# CONFIG_IPMI_HANDLER is not set
579
580#
581# Watchdog Cards
582#
583CONFIG_WATCHDOG=y
584# CONFIG_WATCHDOG_NOWAYOUT is not set
585
586#
587# Watchdog Device Drivers
588#
589# CONFIG_SOFT_WATCHDOG is not set
590CONFIG_S3C2410_WATCHDOG=y
591# CONFIG_NVRAM is not set
592# CONFIG_RTC is not set
593CONFIG_S3C2410_RTC=y
594# CONFIG_DTLK is not set
595# CONFIG_R3964 is not set
596
597#
598# Ftape, the floppy tape device driver
599#
600# CONFIG_DRM is not set
601# CONFIG_RAW_DRIVER is not set
602
603#
604# TPM devices
605#
606# CONFIG_TCG_TPM is not set
607
608#
609# I2C support
610#
611CONFIG_I2C=y
612CONFIG_I2C_CHARDEV=m
613
614#
615# I2C Algorithms
616#
617CONFIG_I2C_ALGOBIT=m
618# CONFIG_I2C_ALGOPCF is not set
619# CONFIG_I2C_ALGOPCA is not set
620
621#
622# I2C Hardware Bus support
623#
624# CONFIG_I2C_ISA is not set
625# CONFIG_I2C_PARPORT is not set
626# CONFIG_I2C_PARPORT_LIGHT is not set
627CONFIG_I2C_S3C2410=y
628# CONFIG_I2C_STUB is not set
629# CONFIG_I2C_PCA_ISA is not set
630
631#
632# Hardware Sensors Chip support
633#
634CONFIG_I2C_SENSOR=m
635# CONFIG_SENSORS_ADM1021 is not set
636# CONFIG_SENSORS_ADM1025 is not set
637# CONFIG_SENSORS_ADM1026 is not set
638# CONFIG_SENSORS_ADM1031 is not set
639# CONFIG_SENSORS_ASB100 is not set
640# CONFIG_SENSORS_DS1621 is not set
641# CONFIG_SENSORS_FSCHER is not set
642# CONFIG_SENSORS_FSCPOS is not set
643# CONFIG_SENSORS_GL518SM is not set
644# CONFIG_SENSORS_GL520SM is not set
645# CONFIG_SENSORS_IT87 is not set
646# CONFIG_SENSORS_LM63 is not set
647CONFIG_SENSORS_LM75=m
648# CONFIG_SENSORS_LM77 is not set
649CONFIG_SENSORS_LM78=m
650# CONFIG_SENSORS_LM80 is not set
651# CONFIG_SENSORS_LM83 is not set
652CONFIG_SENSORS_LM85=m
653# CONFIG_SENSORS_LM87 is not set
654# CONFIG_SENSORS_LM90 is not set
655# CONFIG_SENSORS_MAX1619 is not set
656# CONFIG_SENSORS_PC87360 is not set
657# CONFIG_SENSORS_SMSC47B397 is not set
658# CONFIG_SENSORS_SMSC47M1 is not set
659# CONFIG_SENSORS_W83781D is not set
660# CONFIG_SENSORS_W83L785TS is not set
661# CONFIG_SENSORS_W83627HF is not set
662
663#
664# Other I2C Chip support
665#
666CONFIG_SENSORS_EEPROM=m
667# CONFIG_SENSORS_PCF8574 is not set
668# CONFIG_SENSORS_PCF8591 is not set
669# CONFIG_SENSORS_RTC8564 is not set
670# CONFIG_I2C_DEBUG_CORE is not set
671# CONFIG_I2C_DEBUG_ALGO is not set
672# CONFIG_I2C_DEBUG_BUS is not set
673# CONFIG_I2C_DEBUG_CHIP is not set
674
675#
676# Misc devices
677#
678
679#
680# Multimedia devices
681#
682# CONFIG_VIDEO_DEV is not set
683
684#
685# Digital Video Broadcasting Devices
686#
687# CONFIG_DVB is not set
688
689#
690# Graphics support
691#
692CONFIG_FB=y
693# CONFIG_FB_CFB_FILLRECT is not set
694# CONFIG_FB_CFB_COPYAREA is not set
695# CONFIG_FB_CFB_IMAGEBLIT is not set
696# CONFIG_FB_SOFT_CURSOR is not set
697CONFIG_FB_MODE_HELPERS=y
698# CONFIG_FB_TILEBLITTING is not set
699# CONFIG_FB_VIRTUAL is not set
700
701#
702# Console display driver support
703#
704# CONFIG_VGA_CONSOLE is not set
705CONFIG_DUMMY_CONSOLE=y
706# CONFIG_FRAMEBUFFER_CONSOLE is not set
707
708#
709# Logo configuration
710#
711# CONFIG_LOGO is not set
712# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
713
714#
715# Sound
716#
717# CONFIG_SOUND is not set
718
719#
720# USB support
721#
722CONFIG_USB_ARCH_HAS_HCD=y
723# CONFIG_USB_ARCH_HAS_OHCI is not set
724# CONFIG_USB is not set
725
726#
727# USB Gadget Support
728#
729# CONFIG_USB_GADGET is not set
730
731#
732# MMC/SD Card support
733#
734# CONFIG_MMC is not set
735
736#
737# File systems
738#
739CONFIG_EXT2_FS=y
740# CONFIG_EXT2_FS_XATTR is not set
741CONFIG_EXT3_FS=y
742CONFIG_EXT3_FS_XATTR=y
743# CONFIG_EXT3_FS_POSIX_ACL is not set
744# CONFIG_EXT3_FS_SECURITY is not set
745CONFIG_JBD=y
746# CONFIG_JBD_DEBUG is not set
747CONFIG_FS_MBCACHE=y
748# CONFIG_REISERFS_FS is not set
749# CONFIG_JFS_FS is not set
750
751#
752# XFS support
753#
754# CONFIG_XFS_FS is not set
755# CONFIG_MINIX_FS is not set
756CONFIG_ROMFS_FS=y
757# CONFIG_QUOTA is not set
758CONFIG_DNOTIFY=y
759# CONFIG_AUTOFS_FS is not set
760# CONFIG_AUTOFS4_FS is not set
761
762#
763# CD-ROM/DVD Filesystems
764#
765# CONFIG_ISO9660_FS is not set
766# CONFIG_UDF_FS is not set
767
768#
769# DOS/FAT/NT Filesystems
770#
771CONFIG_FAT_FS=y
772CONFIG_MSDOS_FS=y
773CONFIG_VFAT_FS=y
774CONFIG_FAT_DEFAULT_CODEPAGE=437
775CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
776# CONFIG_NTFS_FS is not set
777
778#
779# Pseudo filesystems
780#
781CONFIG_PROC_FS=y
782CONFIG_SYSFS=y
783# CONFIG_DEVFS_FS is not set
784# CONFIG_DEVPTS_FS_XATTR is not set
785# CONFIG_TMPFS is not set
786# CONFIG_HUGETLBFS is not set
787# CONFIG_HUGETLB_PAGE is not set
788CONFIG_RAMFS=y
789
790#
791# Miscellaneous filesystems
792#
793# CONFIG_ADFS_FS is not set
794# CONFIG_AFFS_FS is not set
795# CONFIG_HFS_FS is not set
796# CONFIG_HFSPLUS_FS is not set
797# CONFIG_BEFS_FS is not set
798# CONFIG_BFS_FS is not set
799# CONFIG_EFS_FS is not set
800CONFIG_JFFS_FS=y
801CONFIG_JFFS_FS_VERBOSE=0
802# CONFIG_JFFS_PROC_FS is not set
803CONFIG_JFFS2_FS=y
804CONFIG_JFFS2_FS_DEBUG=0
805# CONFIG_JFFS2_FS_NAND is not set
806# CONFIG_JFFS2_FS_NOR_ECC is not set
807# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
808CONFIG_JFFS2_ZLIB=y
809CONFIG_JFFS2_RTIME=y
810# CONFIG_JFFS2_RUBIN is not set
811# CONFIG_CRAMFS is not set
812# CONFIG_VXFS_FS is not set
813# CONFIG_HPFS_FS is not set
814# CONFIG_QNX4FS_FS is not set
815# CONFIG_SYSV_FS is not set
816# CONFIG_UFS_FS is not set
817
818#
819# Network File Systems
820#
821CONFIG_NFS_FS=y
822# CONFIG_NFS_V3 is not set
823# CONFIG_NFS_V4 is not set
824# CONFIG_NFS_DIRECTIO is not set
825# CONFIG_NFSD is not set
826CONFIG_ROOT_NFS=y
827CONFIG_LOCKD=y
828CONFIG_SUNRPC=y
829# CONFIG_RPCSEC_GSS_KRB5 is not set
830# CONFIG_RPCSEC_GSS_SPKM3 is not set
831# CONFIG_SMB_FS is not set
832# CONFIG_CIFS is not set
833# CONFIG_NCP_FS is not set
834# CONFIG_CODA_FS is not set
835# CONFIG_AFS_FS is not set
836
837#
838# Partition Types
839#
840CONFIG_PARTITION_ADVANCED=y
841# CONFIG_ACORN_PARTITION is not set
842# CONFIG_OSF_PARTITION is not set
843# CONFIG_AMIGA_PARTITION is not set
844# CONFIG_ATARI_PARTITION is not set
845# CONFIG_MAC_PARTITION is not set
846CONFIG_MSDOS_PARTITION=y
847CONFIG_BSD_DISKLABEL=y
848# CONFIG_MINIX_SUBPARTITION is not set
849CONFIG_SOLARIS_X86_PARTITION=y
850# CONFIG_UNIXWARE_DISKLABEL is not set
851# CONFIG_LDM_PARTITION is not set
852# CONFIG_SGI_PARTITION is not set
853# CONFIG_ULTRIX_PARTITION is not set
854# CONFIG_SUN_PARTITION is not set
855# CONFIG_EFI_PARTITION is not set
856
857#
858# Native Language Support
859#
860CONFIG_NLS=y
861CONFIG_NLS_DEFAULT="iso8859-1"
862# CONFIG_NLS_CODEPAGE_437 is not set
863# CONFIG_NLS_CODEPAGE_737 is not set
864# CONFIG_NLS_CODEPAGE_775 is not set
865# CONFIG_NLS_CODEPAGE_850 is not set
866# CONFIG_NLS_CODEPAGE_852 is not set
867# CONFIG_NLS_CODEPAGE_855 is not set
868# CONFIG_NLS_CODEPAGE_857 is not set
869# CONFIG_NLS_CODEPAGE_860 is not set
870# CONFIG_NLS_CODEPAGE_861 is not set
871# CONFIG_NLS_CODEPAGE_862 is not set
872# CONFIG_NLS_CODEPAGE_863 is not set
873# CONFIG_NLS_CODEPAGE_864 is not set
874# CONFIG_NLS_CODEPAGE_865 is not set
875# CONFIG_NLS_CODEPAGE_866 is not set
876# CONFIG_NLS_CODEPAGE_869 is not set
877# CONFIG_NLS_CODEPAGE_936 is not set
878# CONFIG_NLS_CODEPAGE_950 is not set
879# CONFIG_NLS_CODEPAGE_932 is not set
880# CONFIG_NLS_CODEPAGE_949 is not set
881# CONFIG_NLS_CODEPAGE_874 is not set
882# CONFIG_NLS_ISO8859_8 is not set
883# CONFIG_NLS_CODEPAGE_1250 is not set
884# CONFIG_NLS_CODEPAGE_1251 is not set
885# CONFIG_NLS_ASCII is not set
886# CONFIG_NLS_ISO8859_1 is not set
887# CONFIG_NLS_ISO8859_2 is not set
888# CONFIG_NLS_ISO8859_3 is not set
889# CONFIG_NLS_ISO8859_4 is not set
890# CONFIG_NLS_ISO8859_5 is not set
891# CONFIG_NLS_ISO8859_6 is not set
892# CONFIG_NLS_ISO8859_7 is not set
893# CONFIG_NLS_ISO8859_9 is not set
894# CONFIG_NLS_ISO8859_13 is not set
895# CONFIG_NLS_ISO8859_14 is not set
896# CONFIG_NLS_ISO8859_15 is not set
897# CONFIG_NLS_KOI8_R is not set
898# CONFIG_NLS_KOI8_U is not set
899# CONFIG_NLS_UTF8 is not set
900
901#
902# Profiling support
903#
904# CONFIG_PROFILING is not set
905
906#
907# Kernel hacking
908#
909# CONFIG_PRINTK_TIME is not set
910CONFIG_DEBUG_KERNEL=y
911# CONFIG_MAGIC_SYSRQ is not set
912CONFIG_LOG_BUF_SHIFT=16
913# CONFIG_SCHEDSTATS is not set
914# CONFIG_DEBUG_SLAB is not set
915# CONFIG_DEBUG_SPINLOCK is not set
916# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
917# CONFIG_DEBUG_KOBJECT is not set
918CONFIG_DEBUG_BUGVERBOSE=y
919CONFIG_DEBUG_INFO=y
920# CONFIG_DEBUG_FS is not set
921CONFIG_FRAME_POINTER=y
922CONFIG_DEBUG_USER=y
923# CONFIG_DEBUG_WAITQ is not set
924# CONFIG_DEBUG_ERRORS is not set
925CONFIG_DEBUG_LL=y
926# CONFIG_DEBUG_ICEDCC is not set
927CONFIG_DEBUG_S3C2410_PORT=y
928CONFIG_DEBUG_S3C2410_UART=0
929
930#
931# Security options
932#
933# CONFIG_KEYS is not set
934# CONFIG_SECURITY is not set
935
936#
937# Cryptographic options
938#
939# CONFIG_CRYPTO is not set
940
941#
942# Hardware crypto devices
943#
944
945#
946# Library routines
947#
948# CONFIG_CRC_CCITT is not set
949CONFIG_CRC32=y
950# CONFIG_LIBCRC32C is not set
951CONFIG_ZLIB_INFLATE=y
952CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/cerfcube_defconfig b/arch/arm/configs/cerfcube_defconfig
new file mode 100644
index 000000000000..d8fe0f40408f
--- /dev/null
+++ b/arch/arm/configs/cerfcube_defconfig
@@ -0,0 +1,905 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 14:19:40 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31CONFIG_HOTPLUG=y
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
55CONFIG_MODULE_FORCE_UNLOAD=y
56CONFIG_OBSOLETE_MODPARM=y
57# CONFIG_MODVERSIONS is not set
58# CONFIG_MODULE_SRCVERSION_ALL is not set
59CONFIG_KMOD=y
60
61#
62# System Type
63#
64# CONFIG_ARCH_CLPS7500 is not set
65# CONFIG_ARCH_CLPS711X is not set
66# CONFIG_ARCH_CO285 is not set
67# CONFIG_ARCH_EBSA110 is not set
68# CONFIG_ARCH_CAMELOT is not set
69# CONFIG_ARCH_FOOTBRIDGE is not set
70# CONFIG_ARCH_INTEGRATOR is not set
71# CONFIG_ARCH_IOP3XX is not set
72# CONFIG_ARCH_IXP4XX is not set
73# CONFIG_ARCH_IXP2000 is not set
74# CONFIG_ARCH_L7200 is not set
75# CONFIG_ARCH_PXA is not set
76# CONFIG_ARCH_RPC is not set
77CONFIG_ARCH_SA1100=y
78# CONFIG_ARCH_S3C2410 is not set
79# CONFIG_ARCH_SHARK is not set
80# CONFIG_ARCH_LH7A40X is not set
81# CONFIG_ARCH_OMAP is not set
82# CONFIG_ARCH_VERSATILE is not set
83# CONFIG_ARCH_IMX is not set
84# CONFIG_ARCH_H720X is not set
85
86#
87# SA11x0 Implementations
88#
89# CONFIG_SA1100_ASSABET is not set
90CONFIG_SA1100_CERF=y
91# CONFIG_SA1100_CERF_FLASH_8MB is not set
92CONFIG_SA1100_CERF_FLASH_16MB=y
93# CONFIG_SA1100_CERF_FLASH_32MB is not set
94# CONFIG_SA1100_COLLIE is not set
95# CONFIG_SA1100_H3100 is not set
96# CONFIG_SA1100_H3600 is not set
97# CONFIG_SA1100_H3800 is not set
98# CONFIG_SA1100_BADGE4 is not set
99# CONFIG_SA1100_JORNADA720 is not set
100# CONFIG_SA1100_HACKKIT is not set
101# CONFIG_SA1100_LART is not set
102# CONFIG_SA1100_PLEB is not set
103# CONFIG_SA1100_SHANNON is not set
104# CONFIG_SA1100_SIMPAD is not set
105# CONFIG_SA1100_SSP is not set
106
107#
108# Processor Type
109#
110CONFIG_CPU_32=y
111CONFIG_CPU_SA1100=y
112CONFIG_CPU_32v4=y
113CONFIG_CPU_ABRT_EV4=y
114CONFIG_CPU_CACHE_V4WB=y
115CONFIG_CPU_CACHE_VIVT=y
116CONFIG_CPU_TLB_V4WB=y
117CONFIG_CPU_MINICACHE=y
118
119#
120# Processor Features
121#
122
123#
124# Bus support
125#
126CONFIG_ISA=y
127
128#
129# PCCARD (PCMCIA/CardBus) support
130#
131CONFIG_PCCARD=m
132# CONFIG_PCMCIA_DEBUG is not set
133CONFIG_PCMCIA=m
134
135#
136# PC-card bridges
137#
138# CONFIG_I82365 is not set
139# CONFIG_TCIC is not set
140CONFIG_PCMCIA_SA1100=m
141
142#
143# Kernel Features
144#
145# CONFIG_PREEMPT is not set
146CONFIG_DISCONTIGMEM=y
147CONFIG_LEDS=y
148CONFIG_LEDS_TIMER=y
149CONFIG_LEDS_CPU=y
150CONFIG_ALIGNMENT_TRAP=y
151
152#
153# Boot options
154#
155CONFIG_ZBOOT_ROM_TEXT=0x0
156CONFIG_ZBOOT_ROM_BSS=0x0
157CONFIG_CMDLINE="console=ttySA0,38400 root=/dev/mtdblock3 rootfstype=jffs2 rw mem=32M init=/linuxrc"
158# CONFIG_XIP_KERNEL is not set
159
160#
161# CPU Frequency scaling
162#
163CONFIG_CPU_FREQ=y
164CONFIG_CPU_FREQ_TABLE=y
165# CONFIG_CPU_FREQ_DEBUG is not set
166CONFIG_CPU_FREQ_STAT=y
167# CONFIG_CPU_FREQ_STAT_DETAILS is not set
168CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
169# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
170CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
171# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
172CONFIG_CPU_FREQ_GOV_USERSPACE=m
173# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
174CONFIG_CPU_FREQ_SA1110=y
175
176#
177# Floating point emulation
178#
179
180#
181# At least one emulation must be selected
182#
183# CONFIG_FPE_NWFPE is not set
184CONFIG_FPE_FASTFPE=y
185
186#
187# Userspace binary formats
188#
189CONFIG_BINFMT_ELF=y
190# CONFIG_BINFMT_AOUT is not set
191# CONFIG_BINFMT_MISC is not set
192# CONFIG_ARTHUR is not set
193
194#
195# Power management options
196#
197CONFIG_PM=y
198# CONFIG_APM is not set
199
200#
201# Device Drivers
202#
203
204#
205# Generic Driver Options
206#
207CONFIG_STANDALONE=y
208CONFIG_PREVENT_FIRMWARE_BUILD=y
209# CONFIG_FW_LOADER is not set
210# CONFIG_DEBUG_DRIVER is not set
211
212#
213# Memory Technology Devices (MTD)
214#
215CONFIG_MTD=y
216# CONFIG_MTD_DEBUG is not set
217# CONFIG_MTD_CONCAT is not set
218CONFIG_MTD_PARTITIONS=y
219CONFIG_MTD_REDBOOT_PARTS=y
220CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
221# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
222# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
223CONFIG_MTD_CMDLINE_PARTS=y
224# CONFIG_MTD_AFS_PARTS is not set
225
226#
227# User Modules And Translation Layers
228#
229CONFIG_MTD_CHAR=m
230CONFIG_MTD_BLOCK=y
231# CONFIG_FTL is not set
232# CONFIG_NFTL is not set
233# CONFIG_INFTL is not set
234
235#
236# RAM/ROM/Flash chip drivers
237#
238CONFIG_MTD_CFI=y
239# CONFIG_MTD_JEDECPROBE is not set
240CONFIG_MTD_GEN_PROBE=y
241# CONFIG_MTD_CFI_ADV_OPTIONS is not set
242CONFIG_MTD_MAP_BANK_WIDTH_1=y
243CONFIG_MTD_MAP_BANK_WIDTH_2=y
244CONFIG_MTD_MAP_BANK_WIDTH_4=y
245# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
246# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
247# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
248CONFIG_MTD_CFI_I1=y
249CONFIG_MTD_CFI_I2=y
250# CONFIG_MTD_CFI_I4 is not set
251# CONFIG_MTD_CFI_I8 is not set
252CONFIG_MTD_CFI_INTELEXT=y
253# CONFIG_MTD_CFI_AMDSTD is not set
254# CONFIG_MTD_CFI_STAA is not set
255CONFIG_MTD_CFI_UTIL=y
256# CONFIG_MTD_RAM is not set
257# CONFIG_MTD_ROM is not set
258# CONFIG_MTD_ABSENT is not set
259# CONFIG_MTD_XIP is not set
260
261#
262# Mapping drivers for chip access
263#
264# CONFIG_MTD_COMPLEX_MAPPINGS is not set
265# CONFIG_MTD_PHYSMAP is not set
266# CONFIG_MTD_ARM_INTEGRATOR is not set
267CONFIG_MTD_SA1100=y
268# CONFIG_MTD_EDB7312 is not set
269
270#
271# Self-contained MTD device drivers
272#
273# CONFIG_MTD_SLRAM is not set
274# CONFIG_MTD_PHRAM is not set
275# CONFIG_MTD_MTDRAM is not set
276# CONFIG_MTD_BLKMTD is not set
277# CONFIG_MTD_BLOCK2MTD is not set
278
279#
280# Disk-On-Chip Device Drivers
281#
282# CONFIG_MTD_DOC2000 is not set
283# CONFIG_MTD_DOC2001 is not set
284# CONFIG_MTD_DOC2001PLUS is not set
285
286#
287# NAND Flash Device Drivers
288#
289# CONFIG_MTD_NAND is not set
290
291#
292# Parallel port support
293#
294# CONFIG_PARPORT is not set
295
296#
297# Plug and Play support
298#
299# CONFIG_PNP is not set
300
301#
302# Block devices
303#
304# CONFIG_BLK_DEV_FD is not set
305# CONFIG_BLK_DEV_XD is not set
306# CONFIG_BLK_DEV_COW_COMMON is not set
307CONFIG_BLK_DEV_LOOP=m
308# CONFIG_BLK_DEV_CRYPTOLOOP is not set
309# CONFIG_BLK_DEV_NBD is not set
310CONFIG_BLK_DEV_RAM=m
311CONFIG_BLK_DEV_RAM_COUNT=16
312CONFIG_BLK_DEV_RAM_SIZE=4096
313CONFIG_INITRAMFS_SOURCE=""
314# CONFIG_CDROM_PKTCDVD is not set
315
316#
317# IO Schedulers
318#
319CONFIG_IOSCHED_NOOP=y
320CONFIG_IOSCHED_AS=y
321CONFIG_IOSCHED_DEADLINE=y
322CONFIG_IOSCHED_CFQ=y
323# CONFIG_ATA_OVER_ETH is not set
324
325#
326# ATA/ATAPI/MFM/RLL support
327#
328CONFIG_IDE=y
329CONFIG_BLK_DEV_IDE=y
330
331#
332# Please see Documentation/ide.txt for help/info on IDE drives
333#
334# CONFIG_BLK_DEV_IDE_SATA is not set
335CONFIG_BLK_DEV_IDEDISK=m
336# CONFIG_IDEDISK_MULTI_MODE is not set
337# CONFIG_BLK_DEV_IDECS is not set
338# CONFIG_BLK_DEV_IDECD is not set
339# CONFIG_BLK_DEV_IDETAPE is not set
340# CONFIG_BLK_DEV_IDEFLOPPY is not set
341# CONFIG_IDE_TASK_IOCTL is not set
342
343#
344# IDE chipset support/bugfixes
345#
346CONFIG_IDE_GENERIC=y
347# CONFIG_IDE_ARM is not set
348# CONFIG_IDE_CHIPSETS is not set
349# CONFIG_BLK_DEV_IDEDMA is not set
350# CONFIG_IDEDMA_AUTO is not set
351# CONFIG_BLK_DEV_HD is not set
352
353#
354# SCSI device support
355#
356# CONFIG_SCSI is not set
357
358#
359# Multi-device support (RAID and LVM)
360#
361# CONFIG_MD is not set
362
363#
364# Fusion MPT device support
365#
366
367#
368# IEEE 1394 (FireWire) support
369#
370
371#
372# I2O device support
373#
374
375#
376# Networking support
377#
378CONFIG_NET=y
379
380#
381# Networking options
382#
383CONFIG_PACKET=y
384# CONFIG_PACKET_MMAP is not set
385# CONFIG_NETLINK_DEV is not set
386CONFIG_UNIX=y
387# CONFIG_NET_KEY is not set
388CONFIG_INET=y
389# CONFIG_IP_MULTICAST is not set
390# CONFIG_IP_ADVANCED_ROUTER is not set
391CONFIG_IP_PNP=y
392CONFIG_IP_PNP_DHCP=y
393CONFIG_IP_PNP_BOOTP=y
394CONFIG_IP_PNP_RARP=y
395# CONFIG_NET_IPIP is not set
396# CONFIG_NET_IPGRE is not set
397# CONFIG_ARPD is not set
398# CONFIG_SYN_COOKIES is not set
399# CONFIG_INET_AH is not set
400# CONFIG_INET_ESP is not set
401# CONFIG_INET_IPCOMP is not set
402# CONFIG_INET_TUNNEL is not set
403CONFIG_IP_TCPDIAG=y
404# CONFIG_IP_TCPDIAG_IPV6 is not set
405# CONFIG_IPV6 is not set
406# CONFIG_NETFILTER is not set
407
408#
409# SCTP Configuration (EXPERIMENTAL)
410#
411# CONFIG_IP_SCTP is not set
412# CONFIG_ATM is not set
413# CONFIG_BRIDGE is not set
414# CONFIG_VLAN_8021Q is not set
415# CONFIG_DECNET is not set
416# CONFIG_LLC2 is not set
417# CONFIG_IPX is not set
418# CONFIG_ATALK is not set
419# CONFIG_X25 is not set
420# CONFIG_LAPB is not set
421# CONFIG_NET_DIVERT is not set
422# CONFIG_ECONET is not set
423# CONFIG_WAN_ROUTER is not set
424
425#
426# QoS and/or fair queueing
427#
428# CONFIG_NET_SCHED is not set
429# CONFIG_NET_CLS_ROUTE is not set
430
431#
432# Network testing
433#
434# CONFIG_NET_PKTGEN is not set
435# CONFIG_NETPOLL is not set
436# CONFIG_NET_POLL_CONTROLLER is not set
437# CONFIG_HAMRADIO is not set
438# CONFIG_IRDA is not set
439# CONFIG_BT is not set
440CONFIG_NETDEVICES=y
441# CONFIG_DUMMY is not set
442# CONFIG_BONDING is not set
443# CONFIG_EQUALIZER is not set
444# CONFIG_TUN is not set
445
446#
447# ARCnet devices
448#
449# CONFIG_ARCNET is not set
450
451#
452# Ethernet (10 or 100Mbit)
453#
454CONFIG_NET_ETHERNET=y
455# CONFIG_MII is not set
456# CONFIG_NET_VENDOR_3COM is not set
457# CONFIG_LANCE is not set
458# CONFIG_NET_VENDOR_SMC is not set
459# CONFIG_SMC91X is not set
460# CONFIG_NET_VENDOR_RACAL is not set
461# CONFIG_AT1700 is not set
462# CONFIG_DEPCA is not set
463# CONFIG_HP100 is not set
464# CONFIG_NET_ISA is not set
465CONFIG_NET_PCI=y
466# CONFIG_AC3200 is not set
467# CONFIG_APRICOT is not set
468# CONFIG_CS89x0 is not set
469# CONFIG_NET_POCKET is not set
470
471#
472# Ethernet (1000 Mbit)
473#
474
475#
476# Ethernet (10000 Mbit)
477#
478
479#
480# Token Ring devices
481#
482# CONFIG_TR is not set
483
484#
485# Wireless LAN (non-hamradio)
486#
487# CONFIG_NET_RADIO is not set
488
489#
490# PCMCIA network device support
491#
492# CONFIG_NET_PCMCIA is not set
493
494#
495# Wan interfaces
496#
497# CONFIG_WAN is not set
498# CONFIG_PPP is not set
499# CONFIG_SLIP is not set
500# CONFIG_SHAPER is not set
501# CONFIG_NETCONSOLE is not set
502
503#
504# ISDN subsystem
505#
506# CONFIG_ISDN is not set
507
508#
509# Input device support
510#
511CONFIG_INPUT=y
512
513#
514# Userland interfaces
515#
516CONFIG_INPUT_MOUSEDEV=y
517CONFIG_INPUT_MOUSEDEV_PSAUX=y
518CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
519CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
520# CONFIG_INPUT_JOYDEV is not set
521# CONFIG_INPUT_TSDEV is not set
522# CONFIG_INPUT_EVDEV is not set
523# CONFIG_INPUT_EVBUG is not set
524
525#
526# Input Device Drivers
527#
528# CONFIG_INPUT_KEYBOARD is not set
529# CONFIG_INPUT_MOUSE is not set
530# CONFIG_INPUT_JOYSTICK is not set
531# CONFIG_INPUT_TOUCHSCREEN is not set
532# CONFIG_INPUT_MISC is not set
533
534#
535# Hardware I/O ports
536#
537# CONFIG_SERIO is not set
538# CONFIG_GAMEPORT is not set
539CONFIG_SOUND_GAMEPORT=y
540
541#
542# Character devices
543#
544CONFIG_VT=y
545CONFIG_VT_CONSOLE=y
546CONFIG_HW_CONSOLE=y
547# CONFIG_SERIAL_NONSTANDARD is not set
548
549#
550# Serial drivers
551#
552# CONFIG_SERIAL_8250 is not set
553
554#
555# Non-8250 serial port support
556#
557CONFIG_SERIAL_SA1100=y
558CONFIG_SERIAL_SA1100_CONSOLE=y
559CONFIG_SERIAL_CORE=y
560CONFIG_SERIAL_CORE_CONSOLE=y
561CONFIG_UNIX98_PTYS=y
562CONFIG_LEGACY_PTYS=y
563CONFIG_LEGACY_PTY_COUNT=256
564
565#
566# IPMI
567#
568# CONFIG_IPMI_HANDLER is not set
569
570#
571# Watchdog Cards
572#
573CONFIG_WATCHDOG=y
574# CONFIG_WATCHDOG_NOWAYOUT is not set
575
576#
577# Watchdog Device Drivers
578#
579# CONFIG_SOFT_WATCHDOG is not set
580CONFIG_SA1100_WATCHDOG=m
581
582#
583# ISA-based Watchdog Cards
584#
585# CONFIG_PCWATCHDOG is not set
586# CONFIG_MIXCOMWD is not set
587# CONFIG_WDT is not set
588# CONFIG_NVRAM is not set
589# CONFIG_RTC is not set
590# CONFIG_DTLK is not set
591# CONFIG_R3964 is not set
592
593#
594# Ftape, the floppy tape device driver
595#
596# CONFIG_DRM is not set
597
598#
599# PCMCIA character devices
600#
601# CONFIG_SYNCLINK_CS is not set
602# CONFIG_RAW_DRIVER is not set
603
604#
605# TPM devices
606#
607# CONFIG_TCG_TPM is not set
608
609#
610# I2C support
611#
612# CONFIG_I2C is not set
613
614#
615# Misc devices
616#
617
618#
619# Multimedia devices
620#
621# CONFIG_VIDEO_DEV is not set
622
623#
624# Digital Video Broadcasting Devices
625#
626# CONFIG_DVB is not set
627
628#
629# Graphics support
630#
631# CONFIG_FB is not set
632
633#
634# Console display driver support
635#
636# CONFIG_VGA_CONSOLE is not set
637# CONFIG_MDA_CONSOLE is not set
638CONFIG_DUMMY_CONSOLE=y
639
640#
641# Sound
642#
643# CONFIG_SOUND is not set
644
645#
646# USB support
647#
648CONFIG_USB_ARCH_HAS_HCD=y
649# CONFIG_USB_ARCH_HAS_OHCI is not set
650# CONFIG_USB is not set
651
652#
653# USB Gadget Support
654#
655# CONFIG_USB_GADGET is not set
656
657#
658# MMC/SD Card support
659#
660# CONFIG_MMC is not set
661
662#
663# File systems
664#
665CONFIG_EXT2_FS=m
666# CONFIG_EXT2_FS_XATTR is not set
667CONFIG_EXT3_FS=m
668CONFIG_EXT3_FS_XATTR=y
669# CONFIG_EXT3_FS_POSIX_ACL is not set
670# CONFIG_EXT3_FS_SECURITY is not set
671CONFIG_JBD=m
672# CONFIG_JBD_DEBUG is not set
673CONFIG_FS_MBCACHE=m
674# CONFIG_REISERFS_FS is not set
675# CONFIG_JFS_FS is not set
676CONFIG_FS_POSIX_ACL=y
677
678#
679# XFS support
680#
681# CONFIG_XFS_FS is not set
682# CONFIG_MINIX_FS is not set
683CONFIG_ROMFS_FS=y
684# CONFIG_QUOTA is not set
685CONFIG_DNOTIFY=y
686# CONFIG_AUTOFS_FS is not set
687# CONFIG_AUTOFS4_FS is not set
688
689#
690# CD-ROM/DVD Filesystems
691#
692# CONFIG_ISO9660_FS is not set
693# CONFIG_UDF_FS is not set
694
695#
696# DOS/FAT/NT Filesystems
697#
698CONFIG_FAT_FS=m
699CONFIG_MSDOS_FS=m
700CONFIG_VFAT_FS=m
701CONFIG_FAT_DEFAULT_CODEPAGE=437
702CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
703# CONFIG_NTFS_FS is not set
704
705#
706# Pseudo filesystems
707#
708CONFIG_PROC_FS=y
709CONFIG_SYSFS=y
710# CONFIG_DEVFS_FS is not set
711# CONFIG_DEVPTS_FS_XATTR is not set
712CONFIG_TMPFS=y
713# CONFIG_TMPFS_XATTR is not set
714# CONFIG_HUGETLB_PAGE is not set
715CONFIG_RAMFS=y
716
717#
718# Miscellaneous filesystems
719#
720# CONFIG_ADFS_FS is not set
721# CONFIG_AFFS_FS is not set
722# CONFIG_HFS_FS is not set
723# CONFIG_HFSPLUS_FS is not set
724# CONFIG_BEFS_FS is not set
725# CONFIG_BFS_FS is not set
726# CONFIG_EFS_FS is not set
727# CONFIG_JFFS_FS is not set
728CONFIG_JFFS2_FS=y
729CONFIG_JFFS2_FS_DEBUG=0
730# CONFIG_JFFS2_FS_NAND is not set
731# CONFIG_JFFS2_FS_NOR_ECC is not set
732# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
733CONFIG_JFFS2_ZLIB=y
734CONFIG_JFFS2_RTIME=y
735# CONFIG_JFFS2_RUBIN is not set
736# CONFIG_CRAMFS is not set
737# CONFIG_VXFS_FS is not set
738# CONFIG_HPFS_FS is not set
739# CONFIG_QNX4FS_FS is not set
740# CONFIG_SYSV_FS is not set
741# CONFIG_UFS_FS is not set
742
743#
744# Network File Systems
745#
746CONFIG_NFS_FS=m
747CONFIG_NFS_V3=y
748CONFIG_NFS_V4=y
749# CONFIG_NFS_DIRECTIO is not set
750CONFIG_NFSD=m
751CONFIG_NFSD_V3=y
752CONFIG_NFSD_V4=y
753CONFIG_NFSD_TCP=y
754CONFIG_LOCKD=m
755CONFIG_LOCKD_V4=y
756CONFIG_EXPORTFS=m
757CONFIG_SUNRPC=m
758CONFIG_SUNRPC_GSS=m
759CONFIG_RPCSEC_GSS_KRB5=m
760# CONFIG_RPCSEC_GSS_SPKM3 is not set
761CONFIG_SMB_FS=m
762# CONFIG_SMB_NLS_DEFAULT is not set
763# CONFIG_CIFS is not set
764# CONFIG_NCP_FS is not set
765# CONFIG_CODA_FS is not set
766# CONFIG_AFS_FS is not set
767
768#
769# Partition Types
770#
771CONFIG_PARTITION_ADVANCED=y
772# CONFIG_ACORN_PARTITION is not set
773# CONFIG_OSF_PARTITION is not set
774# CONFIG_AMIGA_PARTITION is not set
775# CONFIG_ATARI_PARTITION is not set
776# CONFIG_MAC_PARTITION is not set
777CONFIG_MSDOS_PARTITION=y
778# CONFIG_BSD_DISKLABEL is not set
779# CONFIG_MINIX_SUBPARTITION is not set
780# CONFIG_SOLARIS_X86_PARTITION is not set
781# CONFIG_UNIXWARE_DISKLABEL is not set
782# CONFIG_LDM_PARTITION is not set
783# CONFIG_SGI_PARTITION is not set
784# CONFIG_ULTRIX_PARTITION is not set
785# CONFIG_SUN_PARTITION is not set
786# CONFIG_EFI_PARTITION is not set
787
788#
789# Native Language Support
790#
791CONFIG_NLS=y
792CONFIG_NLS_DEFAULT="iso8859-1"
793CONFIG_NLS_CODEPAGE_437=m
794# CONFIG_NLS_CODEPAGE_737 is not set
795# CONFIG_NLS_CODEPAGE_775 is not set
796# CONFIG_NLS_CODEPAGE_850 is not set
797# CONFIG_NLS_CODEPAGE_852 is not set
798# CONFIG_NLS_CODEPAGE_855 is not set
799# CONFIG_NLS_CODEPAGE_857 is not set
800# CONFIG_NLS_CODEPAGE_860 is not set
801# CONFIG_NLS_CODEPAGE_861 is not set
802# CONFIG_NLS_CODEPAGE_862 is not set
803# CONFIG_NLS_CODEPAGE_863 is not set
804# CONFIG_NLS_CODEPAGE_864 is not set
805# CONFIG_NLS_CODEPAGE_865 is not set
806# CONFIG_NLS_CODEPAGE_866 is not set
807# CONFIG_NLS_CODEPAGE_869 is not set
808# CONFIG_NLS_CODEPAGE_936 is not set
809# CONFIG_NLS_CODEPAGE_950 is not set
810# CONFIG_NLS_CODEPAGE_932 is not set
811# CONFIG_NLS_CODEPAGE_949 is not set
812# CONFIG_NLS_CODEPAGE_874 is not set
813# CONFIG_NLS_ISO8859_8 is not set
814# CONFIG_NLS_CODEPAGE_1250 is not set
815# CONFIG_NLS_CODEPAGE_1251 is not set
816# CONFIG_NLS_ASCII is not set
817CONFIG_NLS_ISO8859_1=m
818# CONFIG_NLS_ISO8859_2 is not set
819# CONFIG_NLS_ISO8859_3 is not set
820# CONFIG_NLS_ISO8859_4 is not set
821# CONFIG_NLS_ISO8859_5 is not set
822# CONFIG_NLS_ISO8859_6 is not set
823# CONFIG_NLS_ISO8859_7 is not set
824# CONFIG_NLS_ISO8859_9 is not set
825# CONFIG_NLS_ISO8859_13 is not set
826# CONFIG_NLS_ISO8859_14 is not set
827# CONFIG_NLS_ISO8859_15 is not set
828# CONFIG_NLS_KOI8_R is not set
829# CONFIG_NLS_KOI8_U is not set
830# CONFIG_NLS_UTF8 is not set
831
832#
833# Profiling support
834#
835# CONFIG_PROFILING is not set
836
837#
838# Kernel hacking
839#
840# CONFIG_PRINTK_TIME is not set
841CONFIG_DEBUG_KERNEL=y
842CONFIG_MAGIC_SYSRQ=y
843CONFIG_LOG_BUF_SHIFT=14
844# CONFIG_SCHEDSTATS is not set
845# CONFIG_DEBUG_SLAB is not set
846# CONFIG_DEBUG_SPINLOCK is not set
847# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
848# CONFIG_DEBUG_KOBJECT is not set
849CONFIG_DEBUG_BUGVERBOSE=y
850# CONFIG_DEBUG_INFO is not set
851# CONFIG_DEBUG_FS is not set
852CONFIG_FRAME_POINTER=y
853CONFIG_DEBUG_USER=y
854# CONFIG_DEBUG_WAITQ is not set
855CONFIG_DEBUG_ERRORS=y
856CONFIG_DEBUG_LL=y
857# CONFIG_DEBUG_ICEDCC is not set
858
859#
860# Security options
861#
862# CONFIG_KEYS is not set
863# CONFIG_SECURITY is not set
864
865#
866# Cryptographic options
867#
868CONFIG_CRYPTO=y
869# CONFIG_CRYPTO_HMAC is not set
870# CONFIG_CRYPTO_NULL is not set
871# CONFIG_CRYPTO_MD4 is not set
872CONFIG_CRYPTO_MD5=m
873# CONFIG_CRYPTO_SHA1 is not set
874# CONFIG_CRYPTO_SHA256 is not set
875# CONFIG_CRYPTO_SHA512 is not set
876# CONFIG_CRYPTO_WP512 is not set
877# CONFIG_CRYPTO_TGR192 is not set
878CONFIG_CRYPTO_DES=m
879# CONFIG_CRYPTO_BLOWFISH is not set
880# CONFIG_CRYPTO_TWOFISH is not set
881# CONFIG_CRYPTO_SERPENT is not set
882# CONFIG_CRYPTO_AES is not set
883# CONFIG_CRYPTO_CAST5 is not set
884# CONFIG_CRYPTO_CAST6 is not set
885# CONFIG_CRYPTO_TEA is not set
886# CONFIG_CRYPTO_ARC4 is not set
887# CONFIG_CRYPTO_KHAZAD is not set
888# CONFIG_CRYPTO_ANUBIS is not set
889# CONFIG_CRYPTO_DEFLATE is not set
890# CONFIG_CRYPTO_MICHAEL_MIC is not set
891# CONFIG_CRYPTO_CRC32C is not set
892# CONFIG_CRYPTO_TEST is not set
893
894#
895# Hardware crypto devices
896#
897
898#
899# Library routines
900#
901# CONFIG_CRC_CCITT is not set
902CONFIG_CRC32=y
903# CONFIG_LIBCRC32C is not set
904CONFIG_ZLIB_INFLATE=y
905CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/clps7500_defconfig b/arch/arm/configs/clps7500_defconfig
new file mode 100644
index 000000000000..908758371405
--- /dev/null
+++ b/arch/arm/configs/clps7500_defconfig
@@ -0,0 +1,803 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 17:20:48 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28# CONFIG_SYSCTL is not set
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51# CONFIG_MODULES is not set
52
53#
54# System Type
55#
56CONFIG_ARCH_CLPS7500=y
57# CONFIG_ARCH_CLPS711X is not set
58# CONFIG_ARCH_CO285 is not set
59# CONFIG_ARCH_EBSA110 is not set
60# CONFIG_ARCH_CAMELOT is not set
61# CONFIG_ARCH_FOOTBRIDGE is not set
62# CONFIG_ARCH_INTEGRATOR is not set
63# CONFIG_ARCH_IOP3XX is not set
64# CONFIG_ARCH_IXP4XX is not set
65# CONFIG_ARCH_IXP2000 is not set
66# CONFIG_ARCH_L7200 is not set
67# CONFIG_ARCH_PXA is not set
68# CONFIG_ARCH_RPC is not set
69# CONFIG_ARCH_SA1100 is not set
70# CONFIG_ARCH_S3C2410 is not set
71# CONFIG_ARCH_SHARK is not set
72# CONFIG_ARCH_LH7A40X is not set
73# CONFIG_ARCH_OMAP is not set
74# CONFIG_ARCH_VERSATILE is not set
75# CONFIG_ARCH_IMX is not set
76# CONFIG_ARCH_H720X is not set
77
78#
79# Processor Type
80#
81CONFIG_CPU_32=y
82CONFIG_CPU_ARM710=y
83CONFIG_CPU_32v3=y
84CONFIG_CPU_CACHE_V3=y
85CONFIG_CPU_CACHE_VIVT=y
86CONFIG_CPU_COPY_V3=y
87CONFIG_CPU_TLB_V3=y
88
89#
90# Processor Features
91#
92CONFIG_TIMER_ACORN=y
93
94#
95# Bus support
96#
97CONFIG_ISA=y
98
99#
100# PCCARD (PCMCIA/CardBus) support
101#
102# CONFIG_PCCARD is not set
103
104#
105# Kernel Features
106#
107# CONFIG_PREEMPT is not set
108CONFIG_ALIGNMENT_TRAP=y
109
110#
111# Boot options
112#
113CONFIG_ZBOOT_ROM_TEXT=0x0
114CONFIG_ZBOOT_ROM_BSS=0x0
115CONFIG_CMDLINE="mem=16M root=nfs"
116# CONFIG_XIP_KERNEL is not set
117
118#
119# Floating point emulation
120#
121
122#
123# At least one emulation must be selected
124#
125# CONFIG_FPE_NWFPE is not set
126
127#
128# Userspace binary formats
129#
130CONFIG_BINFMT_ELF=y
131# CONFIG_BINFMT_AOUT is not set
132# CONFIG_BINFMT_MISC is not set
133# CONFIG_ARTHUR is not set
134
135#
136# Power management options
137#
138# CONFIG_PM is not set
139
140#
141# Device Drivers
142#
143
144#
145# Generic Driver Options
146#
147CONFIG_STANDALONE=y
148CONFIG_PREVENT_FIRMWARE_BUILD=y
149# CONFIG_FW_LOADER is not set
150
151#
152# Memory Technology Devices (MTD)
153#
154CONFIG_MTD=y
155# CONFIG_MTD_DEBUG is not set
156# CONFIG_MTD_CONCAT is not set
157# CONFIG_MTD_PARTITIONS is not set
158
159#
160# User Modules And Translation Layers
161#
162# CONFIG_MTD_CHAR is not set
163# CONFIG_MTD_BLOCK is not set
164# CONFIG_MTD_BLOCK_RO is not set
165# CONFIG_FTL is not set
166# CONFIG_NFTL is not set
167# CONFIG_INFTL is not set
168
169#
170# RAM/ROM/Flash chip drivers
171#
172# CONFIG_MTD_CFI is not set
173# CONFIG_MTD_JEDECPROBE is not set
174CONFIG_MTD_MAP_BANK_WIDTH_1=y
175CONFIG_MTD_MAP_BANK_WIDTH_2=y
176CONFIG_MTD_MAP_BANK_WIDTH_4=y
177# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
178# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
179# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
180CONFIG_MTD_CFI_I1=y
181CONFIG_MTD_CFI_I2=y
182# CONFIG_MTD_CFI_I4 is not set
183# CONFIG_MTD_CFI_I8 is not set
184# CONFIG_MTD_RAM is not set
185# CONFIG_MTD_ROM is not set
186# CONFIG_MTD_ABSENT is not set
187
188#
189# Mapping drivers for chip access
190#
191# CONFIG_MTD_COMPLEX_MAPPINGS is not set
192
193#
194# Self-contained MTD device drivers
195#
196# CONFIG_MTD_SLRAM is not set
197# CONFIG_MTD_PHRAM is not set
198# CONFIG_MTD_MTDRAM is not set
199# CONFIG_MTD_BLKMTD is not set
200# CONFIG_MTD_BLOCK2MTD is not set
201
202#
203# Disk-On-Chip Device Drivers
204#
205# CONFIG_MTD_DOC2000 is not set
206# CONFIG_MTD_DOC2001 is not set
207# CONFIG_MTD_DOC2001PLUS is not set
208
209#
210# NAND Flash Device Drivers
211#
212# CONFIG_MTD_NAND is not set
213
214#
215# Parallel port support
216#
217CONFIG_PARPORT=y
218CONFIG_PARPORT_PC=y
219CONFIG_PARPORT_PC_FIFO=y
220# CONFIG_PARPORT_PC_SUPERIO is not set
221# CONFIG_PARPORT_ARC is not set
222# CONFIG_PARPORT_GSC is not set
223CONFIG_PARPORT_1284=y
224
225#
226# Plug and Play support
227#
228# CONFIG_PNP is not set
229
230#
231# Block devices
232#
233# CONFIG_BLK_DEV_FD is not set
234# CONFIG_BLK_DEV_XD is not set
235# CONFIG_PARIDE is not set
236# CONFIG_BLK_DEV_COW_COMMON is not set
237# CONFIG_BLK_DEV_LOOP is not set
238CONFIG_BLK_DEV_NBD=y
239CONFIG_BLK_DEV_RAM=y
240CONFIG_BLK_DEV_RAM_COUNT=16
241CONFIG_BLK_DEV_RAM_SIZE=4096
242# CONFIG_BLK_DEV_INITRD is not set
243CONFIG_INITRAMFS_SOURCE=""
244# CONFIG_CDROM_PKTCDVD is not set
245
246#
247# IO Schedulers
248#
249CONFIG_IOSCHED_NOOP=y
250CONFIG_IOSCHED_AS=y
251CONFIG_IOSCHED_DEADLINE=y
252CONFIG_IOSCHED_CFQ=y
253# CONFIG_ATA_OVER_ETH is not set
254
255#
256# ATA/ATAPI/MFM/RLL support
257#
258# CONFIG_IDE is not set
259
260#
261# SCSI device support
262#
263# CONFIG_SCSI is not set
264
265#
266# Multi-device support (RAID and LVM)
267#
268# CONFIG_MD is not set
269
270#
271# Fusion MPT device support
272#
273
274#
275# IEEE 1394 (FireWire) support
276#
277
278#
279# I2O device support
280#
281
282#
283# Networking support
284#
285CONFIG_NET=y
286
287#
288# Networking options
289#
290# CONFIG_PACKET is not set
291# CONFIG_NETLINK_DEV is not set
292CONFIG_UNIX=y
293# CONFIG_NET_KEY is not set
294CONFIG_INET=y
295# CONFIG_IP_MULTICAST is not set
296# CONFIG_IP_ADVANCED_ROUTER is not set
297CONFIG_IP_PNP=y
298# CONFIG_IP_PNP_DHCP is not set
299CONFIG_IP_PNP_BOOTP=y
300# CONFIG_IP_PNP_RARP is not set
301# CONFIG_NET_IPIP is not set
302# CONFIG_NET_IPGRE is not set
303# CONFIG_ARPD is not set
304# CONFIG_SYN_COOKIES is not set
305# CONFIG_INET_AH is not set
306# CONFIG_INET_ESP is not set
307# CONFIG_INET_IPCOMP is not set
308# CONFIG_INET_TUNNEL is not set
309CONFIG_IP_TCPDIAG=y
310# CONFIG_IP_TCPDIAG_IPV6 is not set
311# CONFIG_IPV6 is not set
312# CONFIG_NETFILTER is not set
313
314#
315# SCTP Configuration (EXPERIMENTAL)
316#
317# CONFIG_IP_SCTP is not set
318# CONFIG_ATM is not set
319# CONFIG_BRIDGE is not set
320# CONFIG_VLAN_8021Q is not set
321# CONFIG_DECNET is not set
322# CONFIG_LLC2 is not set
323# CONFIG_IPX is not set
324# CONFIG_ATALK is not set
325# CONFIG_X25 is not set
326# CONFIG_LAPB is not set
327# CONFIG_NET_DIVERT is not set
328# CONFIG_ECONET is not set
329# CONFIG_WAN_ROUTER is not set
330
331#
332# QoS and/or fair queueing
333#
334# CONFIG_NET_SCHED is not set
335# CONFIG_NET_CLS_ROUTE is not set
336
337#
338# Network testing
339#
340# CONFIG_NET_PKTGEN is not set
341# CONFIG_NETPOLL is not set
342# CONFIG_NET_POLL_CONTROLLER is not set
343# CONFIG_HAMRADIO is not set
344# CONFIG_IRDA is not set
345# CONFIG_BT is not set
346CONFIG_NETDEVICES=y
347CONFIG_DUMMY=y
348# CONFIG_BONDING is not set
349# CONFIG_EQUALIZER is not set
350# CONFIG_TUN is not set
351
352#
353# ARCnet devices
354#
355# CONFIG_ARCNET is not set
356
357#
358# Ethernet (10 or 100Mbit)
359#
360CONFIG_NET_ETHERNET=y
361# CONFIG_MII is not set
362# CONFIG_NET_VENDOR_3COM is not set
363# CONFIG_LANCE is not set
364# CONFIG_NET_VENDOR_SMC is not set
365# CONFIG_SMC91X is not set
366# CONFIG_NET_VENDOR_RACAL is not set
367# CONFIG_AT1700 is not set
368# CONFIG_DEPCA is not set
369# CONFIG_HP100 is not set
370# CONFIG_NET_ISA is not set
371CONFIG_NET_PCI=y
372# CONFIG_AC3200 is not set
373# CONFIG_APRICOT is not set
374CONFIG_CS89x0=y
375# CONFIG_NET_POCKET is not set
376
377#
378# Ethernet (1000 Mbit)
379#
380
381#
382# Ethernet (10000 Mbit)
383#
384
385#
386# Token Ring devices
387#
388# CONFIG_TR is not set
389
390#
391# Wireless LAN (non-hamradio)
392#
393# CONFIG_NET_RADIO is not set
394
395#
396# Wan interfaces
397#
398# CONFIG_WAN is not set
399# CONFIG_PLIP is not set
400CONFIG_PPP=y
401# CONFIG_PPP_MULTILINK is not set
402# CONFIG_PPP_FILTER is not set
403# CONFIG_PPP_ASYNC is not set
404# CONFIG_PPP_SYNC_TTY is not set
405# CONFIG_PPP_DEFLATE is not set
406# CONFIG_PPP_BSDCOMP is not set
407# CONFIG_PPPOE is not set
408CONFIG_SLIP=y
409CONFIG_SLIP_COMPRESSED=y
410# CONFIG_SLIP_SMART is not set
411# CONFIG_SLIP_MODE_SLIP6 is not set
412# CONFIG_SHAPER is not set
413# CONFIG_NETCONSOLE is not set
414
415#
416# ISDN subsystem
417#
418# CONFIG_ISDN is not set
419
420#
421# Input device support
422#
423CONFIG_INPUT=y
424
425#
426# Userland interfaces
427#
428CONFIG_INPUT_MOUSEDEV=y
429CONFIG_INPUT_MOUSEDEV_PSAUX=y
430CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
431CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
432# CONFIG_INPUT_JOYDEV is not set
433# CONFIG_INPUT_TSDEV is not set
434# CONFIG_INPUT_EVDEV is not set
435# CONFIG_INPUT_EVBUG is not set
436
437#
438# Input Device Drivers
439#
440CONFIG_INPUT_KEYBOARD=y
441CONFIG_KEYBOARD_ATKBD=y
442# CONFIG_KEYBOARD_SUNKBD is not set
443# CONFIG_KEYBOARD_LKKBD is not set
444# CONFIG_KEYBOARD_XTKBD is not set
445# CONFIG_KEYBOARD_NEWTON is not set
446CONFIG_INPUT_MOUSE=y
447CONFIG_MOUSE_PS2=y
448# CONFIG_MOUSE_SERIAL is not set
449# CONFIG_MOUSE_INPORT is not set
450# CONFIG_MOUSE_LOGIBM is not set
451# CONFIG_MOUSE_PC110PAD is not set
452# CONFIG_MOUSE_VSXXXAA 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# Hardware I/O ports
459#
460CONFIG_SERIO=y
461# CONFIG_SERIO_SERPORT is not set
462# CONFIG_SERIO_PARKBD is not set
463CONFIG_SERIO_RPCKBD=y
464CONFIG_SERIO_LIBPS2=y
465# CONFIG_SERIO_RAW is not set
466# CONFIG_GAMEPORT is not set
467CONFIG_SOUND_GAMEPORT=y
468
469#
470# Character devices
471#
472CONFIG_VT=y
473CONFIG_VT_CONSOLE=y
474CONFIG_HW_CONSOLE=y
475# CONFIG_SERIAL_NONSTANDARD is not set
476
477#
478# Serial drivers
479#
480CONFIG_SERIAL_8250=y
481CONFIG_SERIAL_8250_CONSOLE=y
482CONFIG_SERIAL_8250_NR_UARTS=4
483# CONFIG_SERIAL_8250_EXTENDED is not set
484
485#
486# Non-8250 serial port support
487#
488CONFIG_SERIAL_CORE=y
489CONFIG_SERIAL_CORE_CONSOLE=y
490CONFIG_UNIX98_PTYS=y
491CONFIG_LEGACY_PTYS=y
492CONFIG_LEGACY_PTY_COUNT=256
493CONFIG_PRINTER=y
494# CONFIG_LP_CONSOLE is not set
495# CONFIG_PPDEV is not set
496# CONFIG_TIPAR is not set
497
498#
499# IPMI
500#
501# CONFIG_IPMI_HANDLER is not set
502
503#
504# Watchdog Cards
505#
506# CONFIG_WATCHDOG is not set
507# CONFIG_NVRAM is not set
508# CONFIG_RTC is not set
509# CONFIG_DTLK is not set
510# CONFIG_R3964 is not set
511
512#
513# Ftape, the floppy tape device driver
514#
515# CONFIG_DRM is not set
516# CONFIG_RAW_DRIVER is not set
517
518#
519# TPM devices
520#
521# CONFIG_TCG_TPM is not set
522
523#
524# I2C support
525#
526CONFIG_I2C=y
527# CONFIG_I2C_CHARDEV is not set
528
529#
530# I2C Algorithms
531#
532CONFIG_I2C_ALGOBIT=y
533# CONFIG_I2C_ALGOPCF is not set
534# CONFIG_I2C_ALGOPCA is not set
535
536#
537# I2C Hardware Bus support
538#
539# CONFIG_I2C_ELEKTOR is not set
540# CONFIG_I2C_ISA is not set
541# CONFIG_I2C_PARPORT is not set
542# CONFIG_I2C_PARPORT_LIGHT is not set
543# CONFIG_I2C_PCA_ISA is not set
544
545#
546# Hardware Sensors Chip support
547#
548# CONFIG_I2C_SENSOR is not set
549# CONFIG_SENSORS_ADM1021 is not set
550# CONFIG_SENSORS_ADM1025 is not set
551# CONFIG_SENSORS_ADM1026 is not set
552# CONFIG_SENSORS_ADM1031 is not set
553# CONFIG_SENSORS_ASB100 is not set
554# CONFIG_SENSORS_DS1621 is not set
555# CONFIG_SENSORS_FSCHER is not set
556# CONFIG_SENSORS_FSCPOS is not set
557# CONFIG_SENSORS_GL518SM is not set
558# CONFIG_SENSORS_GL520SM is not set
559# CONFIG_SENSORS_IT87 is not set
560# CONFIG_SENSORS_LM63 is not set
561# CONFIG_SENSORS_LM75 is not set
562# CONFIG_SENSORS_LM77 is not set
563# CONFIG_SENSORS_LM78 is not set
564# CONFIG_SENSORS_LM80 is not set
565# CONFIG_SENSORS_LM83 is not set
566# CONFIG_SENSORS_LM85 is not set
567# CONFIG_SENSORS_LM87 is not set
568# CONFIG_SENSORS_LM90 is not set
569# CONFIG_SENSORS_MAX1619 is not set
570# CONFIG_SENSORS_PC87360 is not set
571# CONFIG_SENSORS_SMSC47B397 is not set
572# CONFIG_SENSORS_SMSC47M1 is not set
573# CONFIG_SENSORS_W83781D is not set
574# CONFIG_SENSORS_W83L785TS is not set
575# CONFIG_SENSORS_W83627HF is not set
576
577#
578# Other I2C Chip support
579#
580# CONFIG_SENSORS_EEPROM is not set
581# CONFIG_SENSORS_PCF8574 is not set
582# CONFIG_SENSORS_PCF8591 is not set
583# CONFIG_SENSORS_RTC8564 is not set
584# CONFIG_I2C_DEBUG_CORE is not set
585# CONFIG_I2C_DEBUG_ALGO is not set
586# CONFIG_I2C_DEBUG_BUS is not set
587# CONFIG_I2C_DEBUG_CHIP is not set
588
589#
590# Misc devices
591#
592
593#
594# Multimedia devices
595#
596# CONFIG_VIDEO_DEV is not set
597
598#
599# Digital Video Broadcasting Devices
600#
601# CONFIG_DVB is not set
602
603#
604# Graphics support
605#
606CONFIG_FB=y
607CONFIG_FB_CFB_FILLRECT=y
608CONFIG_FB_CFB_COPYAREA=y
609CONFIG_FB_CFB_IMAGEBLIT=y
610CONFIG_FB_SOFT_CURSOR=y
611# CONFIG_FB_MODE_HELPERS is not set
612# CONFIG_FB_TILEBLITTING is not set
613CONFIG_FB_ACORN=y
614# CONFIG_FB_VIRTUAL is not set
615
616#
617# Console display driver support
618#
619# CONFIG_VGA_CONSOLE is not set
620# CONFIG_MDA_CONSOLE is not set
621CONFIG_DUMMY_CONSOLE=y
622CONFIG_FRAMEBUFFER_CONSOLE=y
623CONFIG_FONTS=y
624CONFIG_FONT_8x8=y
625CONFIG_FONT_8x16=y
626# CONFIG_FONT_6x11 is not set
627# CONFIG_FONT_PEARL_8x8 is not set
628# CONFIG_FONT_ACORN_8x8 is not set
629# CONFIG_FONT_MINI_4x6 is not set
630# CONFIG_FONT_SUN8x16 is not set
631# CONFIG_FONT_SUN12x22 is not set
632
633#
634# Logo configuration
635#
636CONFIG_LOGO=y
637CONFIG_LOGO_LINUX_MONO=y
638CONFIG_LOGO_LINUX_VGA16=y
639CONFIG_LOGO_LINUX_CLUT224=y
640# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
641
642#
643# Sound
644#
645# CONFIG_SOUND is not set
646
647#
648# USB support
649#
650CONFIG_USB_ARCH_HAS_HCD=y
651# CONFIG_USB_ARCH_HAS_OHCI is not set
652# CONFIG_USB is not set
653
654#
655# USB Gadget Support
656#
657# CONFIG_USB_GADGET is not set
658
659#
660# MMC/SD Card support
661#
662# CONFIG_MMC is not set
663
664#
665# File systems
666#
667CONFIG_EXT2_FS=y
668# CONFIG_EXT2_FS_XATTR is not set
669# CONFIG_EXT3_FS is not set
670# CONFIG_JBD is not set
671# CONFIG_REISERFS_FS is not set
672# CONFIG_JFS_FS is not set
673
674#
675# XFS support
676#
677# CONFIG_XFS_FS is not set
678CONFIG_MINIX_FS=y
679# CONFIG_ROMFS_FS is not set
680# CONFIG_QUOTA is not set
681CONFIG_DNOTIFY=y
682# CONFIG_AUTOFS_FS is not set
683# CONFIG_AUTOFS4_FS is not set
684
685#
686# CD-ROM/DVD Filesystems
687#
688# CONFIG_ISO9660_FS is not set
689# CONFIG_UDF_FS is not set
690
691#
692# DOS/FAT/NT Filesystems
693#
694# CONFIG_MSDOS_FS is not set
695# CONFIG_VFAT_FS is not set
696# CONFIG_NTFS_FS is not set
697
698#
699# Pseudo filesystems
700#
701CONFIG_PROC_FS=y
702CONFIG_SYSFS=y
703# CONFIG_DEVFS_FS is not set
704# CONFIG_DEVPTS_FS_XATTR is not set
705# CONFIG_TMPFS is not set
706# CONFIG_HUGETLB_PAGE is not set
707CONFIG_RAMFS=y
708
709#
710# Miscellaneous filesystems
711#
712# CONFIG_ADFS_FS is not set
713# CONFIG_AFFS_FS is not set
714# CONFIG_HFS_FS is not set
715# CONFIG_HFSPLUS_FS is not set
716# CONFIG_BEFS_FS is not set
717# CONFIG_BFS_FS is not set
718# CONFIG_EFS_FS is not set
719# CONFIG_JFFS_FS is not set
720# CONFIG_JFFS2_FS is not set
721# CONFIG_CRAMFS is not set
722# CONFIG_VXFS_FS is not set
723# CONFIG_HPFS_FS is not set
724# CONFIG_QNX4FS_FS is not set
725# CONFIG_SYSV_FS is not set
726# CONFIG_UFS_FS is not set
727
728#
729# Network File Systems
730#
731CONFIG_NFS_FS=y
732# CONFIG_NFS_V3 is not set
733# CONFIG_NFS_V4 is not set
734# CONFIG_NFS_DIRECTIO is not set
735# CONFIG_NFSD is not set
736CONFIG_ROOT_NFS=y
737CONFIG_LOCKD=y
738CONFIG_SUNRPC=y
739# CONFIG_RPCSEC_GSS_KRB5 is not set
740# CONFIG_RPCSEC_GSS_SPKM3 is not set
741# CONFIG_SMB_FS is not set
742# CONFIG_CIFS is not set
743# CONFIG_NCP_FS is not set
744# CONFIG_CODA_FS is not set
745# CONFIG_AFS_FS is not set
746
747#
748# Partition Types
749#
750CONFIG_PARTITION_ADVANCED=y
751# CONFIG_ACORN_PARTITION is not set
752# CONFIG_OSF_PARTITION is not set
753# CONFIG_AMIGA_PARTITION is not set
754# CONFIG_ATARI_PARTITION is not set
755# CONFIG_MAC_PARTITION is not set
756# CONFIG_MSDOS_PARTITION is not set
757# CONFIG_LDM_PARTITION is not set
758# CONFIG_SGI_PARTITION is not set
759# CONFIG_ULTRIX_PARTITION is not set
760# CONFIG_SUN_PARTITION is not set
761# CONFIG_EFI_PARTITION is not set
762
763#
764# Native Language Support
765#
766# CONFIG_NLS is not set
767
768#
769# Profiling support
770#
771# CONFIG_PROFILING is not set
772
773#
774# Kernel hacking
775#
776# CONFIG_PRINTK_TIME is not set
777# CONFIG_DEBUG_KERNEL is not set
778CONFIG_LOG_BUF_SHIFT=14
779# CONFIG_DEBUG_BUGVERBOSE is not set
780CONFIG_FRAME_POINTER=y
781# CONFIG_DEBUG_USER is not set
782
783#
784# Security options
785#
786# CONFIG_KEYS is not set
787# CONFIG_SECURITY is not set
788
789#
790# Cryptographic options
791#
792# CONFIG_CRYPTO is not set
793
794#
795# Hardware crypto devices
796#
797
798#
799# Library routines
800#
801# CONFIG_CRC_CCITT is not set
802CONFIG_CRC32=y
803# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/configs/ebsa110_defconfig b/arch/arm/configs/ebsa110_defconfig
new file mode 100644
index 000000000000..6f61929b97a8
--- /dev/null
+++ b/arch/arm/configs/ebsa110_defconfig
@@ -0,0 +1,749 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 18:29:48 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31CONFIG_HOTPLUG=y
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34CONFIG_EMBEDDED=y
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_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# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65CONFIG_ARCH_EBSA110=y
66# CONFIG_ARCH_CAMELOT is not set
67# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73# CONFIG_ARCH_PXA is not set
74# CONFIG_ARCH_RPC is not set
75# CONFIG_ARCH_SA1100 is not set
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81# CONFIG_ARCH_IMX is not set
82# CONFIG_ARCH_H720X is not set
83
84#
85# Processor Type
86#
87CONFIG_CPU_32=y
88CONFIG_CPU_SA110=y
89CONFIG_CPU_32v4=y
90CONFIG_CPU_ABRT_EV4=y
91CONFIG_CPU_CACHE_V4WB=y
92CONFIG_CPU_CACHE_VIVT=y
93CONFIG_CPU_COPY_V4WB=y
94CONFIG_CPU_TLB_V4WB=y
95
96#
97# Processor Features
98#
99
100#
101# Bus support
102#
103CONFIG_ISA=y
104
105#
106# PCCARD (PCMCIA/CardBus) support
107#
108CONFIG_PCCARD=m
109# CONFIG_PCMCIA_DEBUG is not set
110CONFIG_PCMCIA=m
111
112#
113# PC-card bridges
114#
115CONFIG_I82365=m
116# CONFIG_TCIC is not set
117CONFIG_PCMCIA_PROBE=y
118CONFIG_PCCARD_NONSTATIC=m
119
120#
121# Kernel Features
122#
123# CONFIG_PREEMPT is not set
124CONFIG_LEDS=y
125CONFIG_LEDS_TIMER=y
126
127#
128# Boot options
129#
130CONFIG_ZBOOT_ROM_TEXT=0x0
131CONFIG_ZBOOT_ROM_BSS=0x0
132CONFIG_CMDLINE="root=/dev/nfs rw mem=16M console=ttyS1,38400n8"
133# CONFIG_XIP_KERNEL is not set
134
135#
136# Floating point emulation
137#
138
139#
140# At least one emulation must be selected
141#
142CONFIG_FPE_NWFPE=y
143# CONFIG_FPE_NWFPE_XP is not set
144CONFIG_FPE_FASTFPE=y
145
146#
147# Userspace binary formats
148#
149CONFIG_BINFMT_ELF=y
150CONFIG_BINFMT_AOUT=y
151# CONFIG_BINFMT_MISC is not set
152# CONFIG_ARTHUR is not set
153
154#
155# Power management options
156#
157# CONFIG_PM is not set
158
159#
160# Device Drivers
161#
162
163#
164# Generic Driver Options
165#
166CONFIG_STANDALONE=y
167CONFIG_PREVENT_FIRMWARE_BUILD=y
168# CONFIG_FW_LOADER is not set
169
170#
171# Parallel port support
172#
173CONFIG_PARPORT=y
174CONFIG_PARPORT_PC=y
175CONFIG_PARPORT_PC_FIFO=y
176# CONFIG_PARPORT_PC_SUPERIO is not set
177# CONFIG_PARPORT_PC_PCMCIA is not set
178# CONFIG_PARPORT_ARC is not set
179# CONFIG_PARPORT_GSC is not set
180CONFIG_PARPORT_1284=y
181
182#
183# Plug and Play support
184#
185# CONFIG_PNP is not set
186
187#
188# Block devices
189#
190# CONFIG_BLK_DEV_FD is not set
191# CONFIG_BLK_DEV_XD is not set
192# CONFIG_PARIDE is not set
193# CONFIG_BLK_DEV_COW_COMMON is not set
194# CONFIG_BLK_DEV_LOOP is not set
195# CONFIG_BLK_DEV_NBD is not set
196CONFIG_BLK_DEV_RAM=y
197CONFIG_BLK_DEV_RAM_COUNT=16
198CONFIG_BLK_DEV_RAM_SIZE=4096
199# CONFIG_BLK_DEV_INITRD is not set
200CONFIG_INITRAMFS_SOURCE=""
201# CONFIG_CDROM_PKTCDVD is not set
202
203#
204# IO Schedulers
205#
206CONFIG_IOSCHED_NOOP=y
207CONFIG_IOSCHED_AS=y
208CONFIG_IOSCHED_DEADLINE=y
209CONFIG_IOSCHED_CFQ=y
210# CONFIG_ATA_OVER_ETH is not set
211
212#
213# SCSI device support
214#
215# CONFIG_SCSI is not set
216
217#
218# Multi-device support (RAID and LVM)
219#
220# CONFIG_MD is not set
221
222#
223# Fusion MPT device support
224#
225
226#
227# IEEE 1394 (FireWire) support
228#
229
230#
231# I2O device support
232#
233
234#
235# Networking support
236#
237CONFIG_NET=y
238
239#
240# Networking options
241#
242CONFIG_PACKET=y
243CONFIG_PACKET_MMAP=y
244# CONFIG_NETLINK_DEV is not set
245CONFIG_UNIX=y
246# CONFIG_NET_KEY is not set
247CONFIG_INET=y
248CONFIG_IP_MULTICAST=y
249CONFIG_IP_ADVANCED_ROUTER=y
250CONFIG_IP_MULTIPLE_TABLES=y
251CONFIG_IP_ROUTE_FWMARK=y
252# CONFIG_IP_ROUTE_MULTIPATH is not set
253CONFIG_IP_ROUTE_VERBOSE=y
254CONFIG_IP_PNP=y
255# CONFIG_IP_PNP_DHCP is not set
256CONFIG_IP_PNP_BOOTP=y
257# CONFIG_IP_PNP_RARP is not set
258# CONFIG_NET_IPIP is not set
259# CONFIG_NET_IPGRE is not set
260# CONFIG_IP_MROUTE is not set
261# CONFIG_ARPD is not set
262CONFIG_SYN_COOKIES=y
263# CONFIG_INET_AH is not set
264# CONFIG_INET_ESP is not set
265# CONFIG_INET_IPCOMP is not set
266# CONFIG_INET_TUNNEL is not set
267CONFIG_IP_TCPDIAG=y
268CONFIG_IP_TCPDIAG_IPV6=y
269
270#
271# IP: Virtual Server Configuration
272#
273# CONFIG_IP_VS is not set
274CONFIG_IPV6=y
275# CONFIG_IPV6_PRIVACY is not set
276# CONFIG_INET6_AH is not set
277# CONFIG_INET6_ESP is not set
278# CONFIG_INET6_IPCOMP is not set
279# CONFIG_INET6_TUNNEL is not set
280# CONFIG_IPV6_TUNNEL is not set
281CONFIG_NETFILTER=y
282# CONFIG_NETFILTER_DEBUG is not set
283
284#
285# IP: Netfilter Configuration
286#
287CONFIG_IP_NF_CONNTRACK=y
288# CONFIG_IP_NF_CT_ACCT is not set
289# CONFIG_IP_NF_CONNTRACK_MARK is not set
290# CONFIG_IP_NF_CT_PROTO_SCTP is not set
291CONFIG_IP_NF_FTP=y
292CONFIG_IP_NF_IRC=y
293# CONFIG_IP_NF_TFTP is not set
294# CONFIG_IP_NF_AMANDA is not set
295# CONFIG_IP_NF_QUEUE is not set
296CONFIG_IP_NF_IPTABLES=y
297CONFIG_IP_NF_MATCH_LIMIT=y
298CONFIG_IP_NF_MATCH_IPRANGE=y
299CONFIG_IP_NF_MATCH_MAC=y
300CONFIG_IP_NF_MATCH_PKTTYPE=y
301CONFIG_IP_NF_MATCH_MARK=y
302CONFIG_IP_NF_MATCH_MULTIPORT=y
303CONFIG_IP_NF_MATCH_TOS=y
304CONFIG_IP_NF_MATCH_RECENT=y
305CONFIG_IP_NF_MATCH_ECN=y
306CONFIG_IP_NF_MATCH_DSCP=y
307CONFIG_IP_NF_MATCH_AH_ESP=y
308CONFIG_IP_NF_MATCH_LENGTH=y
309CONFIG_IP_NF_MATCH_TTL=y
310CONFIG_IP_NF_MATCH_TCPMSS=y
311CONFIG_IP_NF_MATCH_HELPER=y
312CONFIG_IP_NF_MATCH_STATE=y
313CONFIG_IP_NF_MATCH_CONNTRACK=y
314# CONFIG_IP_NF_MATCH_OWNER is not set
315# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
316# CONFIG_IP_NF_MATCH_REALM is not set
317# CONFIG_IP_NF_MATCH_SCTP is not set
318# CONFIG_IP_NF_MATCH_COMMENT is not set
319# CONFIG_IP_NF_MATCH_HASHLIMIT is not set
320CONFIG_IP_NF_FILTER=y
321CONFIG_IP_NF_TARGET_REJECT=y
322CONFIG_IP_NF_TARGET_LOG=y
323# CONFIG_IP_NF_TARGET_ULOG is not set
324CONFIG_IP_NF_TARGET_TCPMSS=y
325CONFIG_IP_NF_NAT=y
326CONFIG_IP_NF_NAT_NEEDED=y
327CONFIG_IP_NF_TARGET_MASQUERADE=y
328CONFIG_IP_NF_TARGET_REDIRECT=y
329CONFIG_IP_NF_TARGET_NETMAP=y
330CONFIG_IP_NF_TARGET_SAME=y
331# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
332CONFIG_IP_NF_NAT_IRC=y
333CONFIG_IP_NF_NAT_FTP=y
334CONFIG_IP_NF_MANGLE=y
335CONFIG_IP_NF_TARGET_TOS=y
336CONFIG_IP_NF_TARGET_ECN=y
337CONFIG_IP_NF_TARGET_DSCP=y
338CONFIG_IP_NF_TARGET_MARK=y
339CONFIG_IP_NF_TARGET_CLASSIFY=y
340# CONFIG_IP_NF_RAW is not set
341# CONFIG_IP_NF_ARPTABLES is not set
342
343#
344# IPv6: Netfilter Configuration (EXPERIMENTAL)
345#
346# CONFIG_IP6_NF_QUEUE is not set
347CONFIG_IP6_NF_IPTABLES=y
348CONFIG_IP6_NF_MATCH_LIMIT=y
349CONFIG_IP6_NF_MATCH_MAC=y
350CONFIG_IP6_NF_MATCH_RT=y
351CONFIG_IP6_NF_MATCH_OPTS=y
352CONFIG_IP6_NF_MATCH_FRAG=y
353CONFIG_IP6_NF_MATCH_HL=y
354CONFIG_IP6_NF_MATCH_MULTIPORT=y
355# CONFIG_IP6_NF_MATCH_OWNER is not set
356CONFIG_IP6_NF_MATCH_MARK=y
357# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set
358CONFIG_IP6_NF_MATCH_AHESP=y
359CONFIG_IP6_NF_MATCH_LENGTH=y
360# CONFIG_IP6_NF_MATCH_EUI64 is not set
361CONFIG_IP6_NF_FILTER=y
362# CONFIG_IP6_NF_TARGET_LOG is not set
363CONFIG_IP6_NF_MANGLE=y
364CONFIG_IP6_NF_TARGET_MARK=y
365# CONFIG_IP6_NF_RAW is not set
366
367#
368# SCTP Configuration (EXPERIMENTAL)
369#
370# CONFIG_IP_SCTP is not set
371# CONFIG_ATM is not set
372# CONFIG_BRIDGE is not set
373# CONFIG_VLAN_8021Q is not set
374# CONFIG_DECNET is not set
375# CONFIG_LLC2 is not set
376# CONFIG_IPX is not set
377# CONFIG_ATALK is not set
378# CONFIG_X25 is not set
379# CONFIG_LAPB is not set
380# CONFIG_NET_DIVERT is not set
381# CONFIG_ECONET is not set
382# CONFIG_WAN_ROUTER is not set
383
384#
385# QoS and/or fair queueing
386#
387# CONFIG_NET_SCHED is not set
388# CONFIG_NET_CLS_ROUTE is not set
389
390#
391# Network testing
392#
393# CONFIG_NET_PKTGEN is not set
394# CONFIG_NETPOLL is not set
395# CONFIG_NET_POLL_CONTROLLER is not set
396# CONFIG_HAMRADIO is not set
397# CONFIG_IRDA is not set
398# CONFIG_BT is not set
399CONFIG_NETDEVICES=y
400# CONFIG_DUMMY is not set
401# CONFIG_BONDING is not set
402# CONFIG_EQUALIZER is not set
403# CONFIG_TUN is not set
404
405#
406# ARCnet devices
407#
408# CONFIG_ARCNET is not set
409
410#
411# Ethernet (10 or 100Mbit)
412#
413CONFIG_NET_ETHERNET=y
414# CONFIG_MII is not set
415CONFIG_ARM_AM79C961A=y
416# CONFIG_NET_VENDOR_3COM is not set
417# CONFIG_LANCE is not set
418# CONFIG_NET_VENDOR_SMC is not set
419# CONFIG_SMC91X is not set
420# CONFIG_NET_VENDOR_RACAL is not set
421# CONFIG_AT1700 is not set
422# CONFIG_DEPCA is not set
423# CONFIG_HP100 is not set
424# CONFIG_NET_ISA is not set
425# CONFIG_NET_PCI is not set
426# CONFIG_NET_POCKET is not set
427
428#
429# Ethernet (1000 Mbit)
430#
431
432#
433# Ethernet (10000 Mbit)
434#
435
436#
437# Token Ring devices
438#
439# CONFIG_TR is not set
440
441#
442# Wireless LAN (non-hamradio)
443#
444# CONFIG_NET_RADIO is not set
445
446#
447# PCMCIA network device support
448#
449CONFIG_NET_PCMCIA=y
450# CONFIG_PCMCIA_3C589 is not set
451# CONFIG_PCMCIA_3C574 is not set
452# CONFIG_PCMCIA_FMVJ18X is not set
453CONFIG_PCMCIA_PCNET=m
454# CONFIG_PCMCIA_NMCLAN is not set
455# CONFIG_PCMCIA_SMC91C92 is not set
456# CONFIG_PCMCIA_XIRC2PS is not set
457# CONFIG_PCMCIA_AXNET is not set
458
459#
460# Wan interfaces
461#
462# CONFIG_WAN is not set
463# CONFIG_PLIP is not set
464CONFIG_PPP=m
465# CONFIG_PPP_MULTILINK is not set
466# CONFIG_PPP_FILTER is not set
467CONFIG_PPP_ASYNC=m
468# CONFIG_PPP_SYNC_TTY is not set
469CONFIG_PPP_DEFLATE=m
470CONFIG_PPP_BSDCOMP=m
471# CONFIG_PPPOE is not set
472# CONFIG_SLIP 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# Input device support
483#
484# CONFIG_INPUT is not set
485
486#
487# Hardware I/O ports
488#
489# CONFIG_SERIO is not set
490# CONFIG_GAMEPORT is not set
491CONFIG_SOUND_GAMEPORT=y
492
493#
494# Character devices
495#
496# CONFIG_VT is not set
497# CONFIG_SERIAL_NONSTANDARD is not set
498
499#
500# Serial drivers
501#
502CONFIG_SERIAL_8250=y
503CONFIG_SERIAL_8250_CONSOLE=y
504CONFIG_SERIAL_8250_CS=m
505CONFIG_SERIAL_8250_NR_UARTS=4
506# CONFIG_SERIAL_8250_EXTENDED is not set
507
508#
509# Non-8250 serial port support
510#
511CONFIG_SERIAL_CORE=y
512CONFIG_SERIAL_CORE_CONSOLE=y
513CONFIG_UNIX98_PTYS=y
514CONFIG_LEGACY_PTYS=y
515CONFIG_LEGACY_PTY_COUNT=256
516CONFIG_PRINTER=m
517# CONFIG_LP_CONSOLE is not set
518# CONFIG_PPDEV is not set
519# CONFIG_TIPAR is not set
520
521#
522# IPMI
523#
524# CONFIG_IPMI_HANDLER is not set
525
526#
527# Watchdog Cards
528#
529CONFIG_WATCHDOG=y
530# CONFIG_WATCHDOG_NOWAYOUT is not set
531
532#
533# Watchdog Device Drivers
534#
535CONFIG_SOFT_WATCHDOG=y
536
537#
538# ISA-based Watchdog Cards
539#
540# CONFIG_PCWATCHDOG is not set
541# CONFIG_MIXCOMWD is not set
542# CONFIG_WDT is not set
543# CONFIG_NVRAM is not set
544# CONFIG_RTC is not set
545# CONFIG_DTLK is not set
546# CONFIG_R3964 is not set
547
548#
549# Ftape, the floppy tape device driver
550#
551# CONFIG_DRM is not set
552
553#
554# PCMCIA character devices
555#
556# CONFIG_SYNCLINK_CS is not set
557# CONFIG_RAW_DRIVER is not set
558
559#
560# TPM devices
561#
562# CONFIG_TCG_TPM is not set
563
564#
565# I2C support
566#
567# CONFIG_I2C is not set
568
569#
570# Misc devices
571#
572
573#
574# Multimedia devices
575#
576# CONFIG_VIDEO_DEV is not set
577
578#
579# Digital Video Broadcasting Devices
580#
581# CONFIG_DVB is not set
582
583#
584# Graphics support
585#
586# CONFIG_FB is not set
587
588#
589# Sound
590#
591# CONFIG_SOUND is not set
592
593#
594# USB support
595#
596CONFIG_USB_ARCH_HAS_HCD=y
597# CONFIG_USB_ARCH_HAS_OHCI is not set
598# CONFIG_USB is not set
599
600#
601# USB Gadget Support
602#
603# CONFIG_USB_GADGET is not set
604
605#
606# MMC/SD Card support
607#
608# CONFIG_MMC is not set
609
610#
611# File systems
612#
613# CONFIG_EXT2_FS is not set
614# CONFIG_EXT3_FS is not set
615# CONFIG_JBD is not set
616# CONFIG_REISERFS_FS is not set
617# CONFIG_JFS_FS is not set
618
619#
620# XFS support
621#
622# CONFIG_XFS_FS is not set
623CONFIG_MINIX_FS=y
624# CONFIG_ROMFS_FS is not set
625# CONFIG_QUOTA is not set
626CONFIG_DNOTIFY=y
627# CONFIG_AUTOFS_FS is not set
628CONFIG_AUTOFS4_FS=y
629
630#
631# CD-ROM/DVD Filesystems
632#
633# CONFIG_ISO9660_FS is not set
634# CONFIG_UDF_FS is not set
635
636#
637# DOS/FAT/NT Filesystems
638#
639# CONFIG_MSDOS_FS is not set
640# CONFIG_VFAT_FS is not set
641# CONFIG_NTFS_FS is not set
642
643#
644# Pseudo filesystems
645#
646CONFIG_PROC_FS=y
647CONFIG_SYSFS=y
648# CONFIG_DEVFS_FS is not set
649# CONFIG_DEVPTS_FS_XATTR is not set
650# CONFIG_TMPFS is not set
651# CONFIG_HUGETLB_PAGE is not set
652CONFIG_RAMFS=y
653
654#
655# Miscellaneous filesystems
656#
657# CONFIG_ADFS_FS is not set
658# CONFIG_AFFS_FS is not set
659# CONFIG_HFS_FS is not set
660# CONFIG_HFSPLUS_FS is not set
661# CONFIG_BEFS_FS is not set
662# CONFIG_BFS_FS is not set
663# CONFIG_EFS_FS is not set
664# CONFIG_CRAMFS is not set
665# CONFIG_VXFS_FS is not set
666# CONFIG_HPFS_FS is not set
667# CONFIG_QNX4FS_FS is not set
668# CONFIG_SYSV_FS is not set
669# CONFIG_UFS_FS is not set
670
671#
672# Network File Systems
673#
674CONFIG_NFS_FS=y
675CONFIG_NFS_V3=y
676# CONFIG_NFS_V4 is not set
677# CONFIG_NFS_DIRECTIO is not set
678# CONFIG_NFSD is not set
679CONFIG_ROOT_NFS=y
680CONFIG_LOCKD=y
681CONFIG_LOCKD_V4=y
682CONFIG_SUNRPC=y
683# CONFIG_RPCSEC_GSS_KRB5 is not set
684# CONFIG_RPCSEC_GSS_SPKM3 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#
694CONFIG_PARTITION_ADVANCED=y
695# CONFIG_ACORN_PARTITION is not set
696# CONFIG_OSF_PARTITION is not set
697# CONFIG_AMIGA_PARTITION is not set
698# CONFIG_ATARI_PARTITION is not set
699# CONFIG_MAC_PARTITION is not set
700# CONFIG_MSDOS_PARTITION is not set
701# CONFIG_LDM_PARTITION is not set
702# CONFIG_SGI_PARTITION is not set
703# CONFIG_ULTRIX_PARTITION is not set
704# CONFIG_SUN_PARTITION is not set
705# CONFIG_EFI_PARTITION is not set
706
707#
708# Native Language Support
709#
710# CONFIG_NLS is not set
711
712#
713# Profiling support
714#
715# CONFIG_PROFILING is not set
716
717#
718# Kernel hacking
719#
720# CONFIG_PRINTK_TIME is not set
721# CONFIG_DEBUG_KERNEL is not set
722CONFIG_LOG_BUF_SHIFT=14
723# CONFIG_DEBUG_BUGVERBOSE is not set
724CONFIG_FRAME_POINTER=y
725# CONFIG_DEBUG_USER 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#
741
742#
743# Library routines
744#
745CONFIG_CRC_CCITT=m
746CONFIG_CRC32=y
747# CONFIG_LIBCRC32C is not set
748CONFIG_ZLIB_INFLATE=m
749CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/arm/configs/edb7211_defconfig b/arch/arm/configs/edb7211_defconfig
new file mode 100644
index 000000000000..78b08ed4d5f4
--- /dev/null
+++ b/arch/arm/configs/edb7211_defconfig
@@ -0,0 +1,575 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 21:48:12 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51# CONFIG_MODULES is not set
52
53#
54# System Type
55#
56# CONFIG_ARCH_CLPS7500 is not set
57CONFIG_ARCH_CLPS711X=y
58# CONFIG_ARCH_CO285 is not set
59# CONFIG_ARCH_EBSA110 is not set
60# CONFIG_ARCH_CAMELOT is not set
61# CONFIG_ARCH_FOOTBRIDGE is not set
62# CONFIG_ARCH_INTEGRATOR is not set
63# CONFIG_ARCH_IOP3XX is not set
64# CONFIG_ARCH_IXP4XX is not set
65# CONFIG_ARCH_IXP2000 is not set
66# CONFIG_ARCH_L7200 is not set
67# CONFIG_ARCH_PXA is not set
68# CONFIG_ARCH_RPC is not set
69# CONFIG_ARCH_SA1100 is not set
70# CONFIG_ARCH_S3C2410 is not set
71# CONFIG_ARCH_SHARK is not set
72# CONFIG_ARCH_LH7A40X is not set
73# CONFIG_ARCH_OMAP is not set
74# CONFIG_ARCH_VERSATILE is not set
75# CONFIG_ARCH_IMX is not set
76# CONFIG_ARCH_H720X is not set
77
78#
79# CLPS711X/EP721X Implementations
80#
81# CONFIG_ARCH_AUTCPU12 is not set
82# CONFIG_ARCH_CDB89712 is not set
83# CONFIG_ARCH_CEIVA is not set
84# CONFIG_ARCH_CLEP7312 is not set
85CONFIG_ARCH_EDB7211=y
86# CONFIG_ARCH_P720T is not set
87# CONFIG_ARCH_FORTUNET is not set
88CONFIG_ARCH_EP7211=y
89# CONFIG_EP72XX_ROM_BOOT is not set
90
91#
92# Processor Type
93#
94CONFIG_CPU_32=y
95CONFIG_CPU_ARM720T=y
96CONFIG_CPU_32v4=y
97CONFIG_CPU_ABRT_LV4T=y
98CONFIG_CPU_CACHE_V4=y
99CONFIG_CPU_CACHE_VIVT=y
100CONFIG_CPU_COPY_V4WT=y
101CONFIG_CPU_TLB_V4WT=y
102
103#
104# Processor Features
105#
106CONFIG_ARM_THUMB=y
107
108#
109# Bus support
110#
111CONFIG_ISA=y
112
113#
114# PCCARD (PCMCIA/CardBus) support
115#
116# CONFIG_PCCARD is not set
117
118#
119# Kernel Features
120#
121# CONFIG_PREEMPT is not set
122CONFIG_DISCONTIGMEM=y
123CONFIG_ALIGNMENT_TRAP=y
124
125#
126# Boot options
127#
128CONFIG_ZBOOT_ROM_TEXT=0x0
129CONFIG_ZBOOT_ROM_BSS=0x0
130CONFIG_CMDLINE=""
131# CONFIG_XIP_KERNEL is not set
132
133#
134# Floating point emulation
135#
136
137#
138# At least one emulation must be selected
139#
140# CONFIG_FPE_NWFPE is not set
141# CONFIG_FPE_FASTFPE is not set
142
143#
144# Userspace binary formats
145#
146CONFIG_BINFMT_ELF=y
147# CONFIG_BINFMT_AOUT is not set
148# CONFIG_BINFMT_MISC is not set
149# CONFIG_ARTHUR is not set
150
151#
152# Power management options
153#
154# CONFIG_PM is not set
155
156#
157# Device Drivers
158#
159
160#
161# Generic Driver Options
162#
163CONFIG_STANDALONE=y
164CONFIG_PREVENT_FIRMWARE_BUILD=y
165# CONFIG_FW_LOADER is not set
166
167#
168# Memory Technology Devices (MTD)
169#
170# CONFIG_MTD is not set
171
172#
173# Parallel port support
174#
175# CONFIG_PARPORT is not set
176
177#
178# Plug and Play support
179#
180# CONFIG_PNP is not set
181
182#
183# Block devices
184#
185# CONFIG_BLK_DEV_FD is not set
186# CONFIG_BLK_DEV_XD is not set
187# CONFIG_BLK_DEV_COW_COMMON is not set
188# CONFIG_BLK_DEV_LOOP is not set
189# CONFIG_BLK_DEV_NBD is not set
190CONFIG_BLK_DEV_RAM=y
191CONFIG_BLK_DEV_RAM_COUNT=16
192CONFIG_BLK_DEV_RAM_SIZE=4096
193CONFIG_BLK_DEV_INITRD=y
194CONFIG_INITRAMFS_SOURCE=""
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# SCSI device support
208#
209# CONFIG_SCSI is not set
210
211#
212# Multi-device support (RAID and LVM)
213#
214# CONFIG_MD is not set
215
216#
217# Fusion MPT device support
218#
219
220#
221# IEEE 1394 (FireWire) support
222#
223
224#
225# I2O device support
226#
227
228#
229# Networking support
230#
231CONFIG_NET=y
232
233#
234# Networking options
235#
236CONFIG_PACKET=y
237# CONFIG_PACKET_MMAP is not set
238# CONFIG_NETLINK_DEV is not set
239CONFIG_UNIX=y
240# CONFIG_NET_KEY is not set
241CONFIG_INET=y
242# CONFIG_IP_MULTICAST is not set
243# CONFIG_IP_ADVANCED_ROUTER is not set
244# CONFIG_IP_PNP is not set
245# CONFIG_NET_IPIP is not set
246# CONFIG_NET_IPGRE is not set
247# CONFIG_ARPD is not set
248# CONFIG_SYN_COOKIES is not set
249# CONFIG_INET_AH is not set
250# CONFIG_INET_ESP is not set
251# CONFIG_INET_IPCOMP is not set
252# CONFIG_INET_TUNNEL is not set
253# CONFIG_IP_TCPDIAG is not set
254# CONFIG_IP_TCPDIAG_IPV6 is not set
255# CONFIG_IPV6 is not set
256# CONFIG_NETFILTER is not set
257
258#
259# SCTP Configuration (EXPERIMENTAL)
260#
261# CONFIG_IP_SCTP is not set
262# CONFIG_ATM is not set
263# CONFIG_BRIDGE is not set
264# CONFIG_VLAN_8021Q is not set
265# CONFIG_DECNET is not set
266# CONFIG_LLC2 is not set
267# CONFIG_IPX is not set
268# CONFIG_ATALK is not set
269# CONFIG_X25 is not set
270# CONFIG_LAPB is not set
271# CONFIG_NET_DIVERT is not set
272# CONFIG_ECONET is not set
273# CONFIG_WAN_ROUTER is not set
274
275#
276# QoS and/or fair queueing
277#
278# CONFIG_NET_SCHED is not set
279# CONFIG_NET_CLS_ROUTE is not set
280
281#
282# Network testing
283#
284# CONFIG_NET_PKTGEN is not set
285# CONFIG_NETPOLL is not set
286# CONFIG_NET_POLL_CONTROLLER is not set
287# CONFIG_HAMRADIO is not set
288# CONFIG_IRDA is not set
289# CONFIG_BT is not set
290CONFIG_NETDEVICES=y
291# CONFIG_DUMMY is not set
292# CONFIG_BONDING is not set
293# CONFIG_EQUALIZER is not set
294# CONFIG_TUN is not set
295
296#
297# ARCnet devices
298#
299# CONFIG_ARCNET is not set
300
301#
302# Ethernet (10 or 100Mbit)
303#
304# CONFIG_NET_ETHERNET is not set
305
306#
307# Ethernet (1000 Mbit)
308#
309
310#
311# Ethernet (10000 Mbit)
312#
313
314#
315# Token Ring devices
316#
317# CONFIG_TR is not set
318
319#
320# Wireless LAN (non-hamradio)
321#
322# CONFIG_NET_RADIO is not set
323
324#
325# Wan interfaces
326#
327# CONFIG_WAN is not set
328# CONFIG_PPP is not set
329# CONFIG_SLIP is not set
330# CONFIG_SHAPER is not set
331# CONFIG_NETCONSOLE is not set
332
333#
334# ISDN subsystem
335#
336# CONFIG_ISDN is not set
337
338#
339# Input device support
340#
341# CONFIG_INPUT is not set
342
343#
344# Hardware I/O ports
345#
346CONFIG_SERIO=y
347CONFIG_SERIO_SERPORT=y
348CONFIG_SERIO_LIBPS2=y
349# CONFIG_SERIO_RAW is not set
350# CONFIG_GAMEPORT is not set
351CONFIG_SOUND_GAMEPORT=y
352
353#
354# Character devices
355#
356# CONFIG_VT is not set
357# CONFIG_SERIAL_NONSTANDARD is not set
358
359#
360# Serial drivers
361#
362# CONFIG_SERIAL_8250 is not set
363
364#
365# Non-8250 serial port support
366#
367CONFIG_SERIAL_CLPS711X=y
368CONFIG_SERIAL_CLPS711X_CONSOLE=y
369CONFIG_SERIAL_CORE=y
370CONFIG_SERIAL_CORE_CONSOLE=y
371CONFIG_UNIX98_PTYS=y
372CONFIG_LEGACY_PTYS=y
373CONFIG_LEGACY_PTY_COUNT=256
374
375#
376# IPMI
377#
378# CONFIG_IPMI_HANDLER is not set
379
380#
381# Watchdog Cards
382#
383# CONFIG_WATCHDOG is not set
384# CONFIG_NVRAM is not set
385# CONFIG_RTC is not set
386# CONFIG_DTLK is not set
387# CONFIG_R3964 is not set
388
389#
390# Ftape, the floppy tape device driver
391#
392# CONFIG_DRM is not set
393# CONFIG_RAW_DRIVER is not set
394
395#
396# TPM devices
397#
398# CONFIG_TCG_TPM is not set
399
400#
401# I2C support
402#
403# CONFIG_I2C is not set
404
405#
406# Misc devices
407#
408
409#
410# Multimedia devices
411#
412# CONFIG_VIDEO_DEV is not set
413
414#
415# Digital Video Broadcasting Devices
416#
417# CONFIG_DVB is not set
418
419#
420# Graphics support
421#
422# CONFIG_FB is not set
423
424#
425# Sound
426#
427# CONFIG_SOUND is not set
428
429#
430# USB support
431#
432CONFIG_USB_ARCH_HAS_HCD=y
433# CONFIG_USB_ARCH_HAS_OHCI is not set
434# CONFIG_USB is not set
435
436#
437# USB Gadget Support
438#
439# CONFIG_USB_GADGET is not set
440
441#
442# MMC/SD Card support
443#
444# CONFIG_MMC is not set
445
446#
447# File systems
448#
449CONFIG_EXT2_FS=y
450# CONFIG_EXT2_FS_XATTR is not set
451# CONFIG_EXT3_FS is not set
452# CONFIG_JBD is not set
453# CONFIG_REISERFS_FS is not set
454# CONFIG_JFS_FS is not set
455
456#
457# XFS support
458#
459# CONFIG_XFS_FS is not set
460CONFIG_MINIX_FS=y
461# CONFIG_ROMFS_FS is not set
462# CONFIG_QUOTA is not set
463CONFIG_DNOTIFY=y
464# CONFIG_AUTOFS_FS is not set
465# CONFIG_AUTOFS4_FS is not set
466
467#
468# CD-ROM/DVD Filesystems
469#
470# CONFIG_ISO9660_FS is not set
471# CONFIG_UDF_FS is not set
472
473#
474# DOS/FAT/NT Filesystems
475#
476# CONFIG_MSDOS_FS is not set
477# CONFIG_VFAT_FS is not set
478# CONFIG_NTFS_FS is not set
479
480#
481# Pseudo filesystems
482#
483CONFIG_PROC_FS=y
484CONFIG_SYSFS=y
485# CONFIG_DEVFS_FS is not set
486# CONFIG_DEVPTS_FS_XATTR is not set
487# CONFIG_TMPFS is not set
488# CONFIG_HUGETLB_PAGE is not set
489CONFIG_RAMFS=y
490
491#
492# Miscellaneous filesystems
493#
494# CONFIG_ADFS_FS is not set
495# CONFIG_AFFS_FS is not set
496# CONFIG_HFS_FS is not set
497# CONFIG_HFSPLUS_FS is not set
498# CONFIG_BEFS_FS is not set
499# CONFIG_BFS_FS is not set
500# CONFIG_EFS_FS is not set
501# CONFIG_CRAMFS is not set
502# CONFIG_VXFS_FS is not set
503# CONFIG_HPFS_FS is not set
504# CONFIG_QNX4FS_FS is not set
505# CONFIG_SYSV_FS is not set
506# CONFIG_UFS_FS is not set
507
508#
509# Network File Systems
510#
511# CONFIG_NFS_FS is not set
512# CONFIG_NFSD is not set
513# CONFIG_SMB_FS is not set
514# CONFIG_CIFS is not set
515# CONFIG_NCP_FS is not set
516# CONFIG_CODA_FS is not set
517# CONFIG_AFS_FS is not set
518
519#
520# Partition Types
521#
522CONFIG_PARTITION_ADVANCED=y
523# CONFIG_ACORN_PARTITION is not set
524# CONFIG_OSF_PARTITION is not set
525# CONFIG_AMIGA_PARTITION is not set
526# CONFIG_ATARI_PARTITION is not set
527# CONFIG_MAC_PARTITION is not set
528# CONFIG_MSDOS_PARTITION is not set
529# CONFIG_LDM_PARTITION is not set
530# CONFIG_SGI_PARTITION is not set
531# CONFIG_ULTRIX_PARTITION is not set
532# CONFIG_SUN_PARTITION is not set
533# CONFIG_EFI_PARTITION is not set
534
535#
536# Native Language Support
537#
538# CONFIG_NLS is not set
539
540#
541# Profiling support
542#
543# CONFIG_PROFILING is not set
544
545#
546# Kernel hacking
547#
548# CONFIG_PRINTK_TIME is not set
549# CONFIG_DEBUG_KERNEL is not set
550CONFIG_LOG_BUF_SHIFT=14
551# CONFIG_DEBUG_BUGVERBOSE is not set
552CONFIG_FRAME_POINTER=y
553CONFIG_DEBUG_USER=y
554
555#
556# Security options
557#
558# CONFIG_KEYS is not set
559# CONFIG_SECURITY is not set
560
561#
562# Cryptographic options
563#
564# CONFIG_CRYPTO is not set
565
566#
567# Hardware crypto devices
568#
569
570#
571# Library routines
572#
573# CONFIG_CRC_CCITT is not set
574CONFIG_CRC32=y
575# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/configs/enp2611_defconfig b/arch/arm/configs/enp2611_defconfig
new file mode 100644
index 000000000000..e8f9fccffe84
--- /dev/null
+++ b/arch/arm/configs/enp2611_defconfig
@@ -0,0 +1,887 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 22:08:24 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34CONFIG_EMBEDDED=y
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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#
53# CONFIG_MODULES is not set
54
55#
56# System Type
57#
58# CONFIG_ARCH_CLPS7500 is not set
59# CONFIG_ARCH_CLPS711X is not set
60# CONFIG_ARCH_CO285 is not set
61# CONFIG_ARCH_EBSA110 is not set
62# CONFIG_ARCH_CAMELOT is not set
63# CONFIG_ARCH_FOOTBRIDGE is not set
64# CONFIG_ARCH_INTEGRATOR is not set
65# CONFIG_ARCH_IOP3XX is not set
66# CONFIG_ARCH_IXP4XX is not set
67CONFIG_ARCH_IXP2000=y
68# CONFIG_ARCH_L7200 is not set
69# CONFIG_ARCH_PXA is not set
70# CONFIG_ARCH_RPC is not set
71# CONFIG_ARCH_SA1100 is not set
72# CONFIG_ARCH_S3C2410 is not set
73# CONFIG_ARCH_SHARK is not set
74# CONFIG_ARCH_LH7A40X is not set
75# CONFIG_ARCH_OMAP is not set
76# CONFIG_ARCH_VERSATILE is not set
77# CONFIG_ARCH_IMX is not set
78# CONFIG_ARCH_H720X is not set
79CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
80
81#
82# Intel IXP2400/2800 Implementation Options
83#
84
85#
86# IXP2400/2800 Platforms
87#
88CONFIG_ARCH_ENP2611=y
89# CONFIG_ARCH_IXDP2400 is not set
90# CONFIG_ARCH_IXDP2800 is not set
91# CONFIG_ARCH_IXDP2401 is not set
92# CONFIG_ARCH_IXDP2801 is not set
93
94#
95# Processor Type
96#
97CONFIG_CPU_32=y
98CONFIG_CPU_XSCALE=y
99CONFIG_CPU_32v5=y
100CONFIG_CPU_ABRT_EV5T=y
101CONFIG_CPU_CACHE_VIVT=y
102CONFIG_CPU_TLB_V4WBI=y
103CONFIG_CPU_MINICACHE=y
104
105#
106# Processor Features
107#
108# CONFIG_ARM_THUMB is not set
109CONFIG_CPU_BIG_ENDIAN=y
110CONFIG_XSCALE_PMU=y
111
112#
113# Bus support
114#
115CONFIG_PCI=y
116CONFIG_PCI_LEGACY_PROC=y
117CONFIG_PCI_NAMES=y
118
119#
120# PCCARD (PCMCIA/CardBus) support
121#
122# CONFIG_PCCARD is not set
123
124#
125# Kernel Features
126#
127# CONFIG_PREEMPT is not set
128CONFIG_ALIGNMENT_TRAP=y
129
130#
131# Boot options
132#
133CONFIG_ZBOOT_ROM_TEXT=0x0
134CONFIG_ZBOOT_ROM_BSS=0x0
135CONFIG_CMDLINE="console=ttyS0,57600 root=/dev/nfs ip=bootp mem=64M@0x0 pci=firmware"
136# CONFIG_XIP_KERNEL is not set
137
138#
139# Floating point emulation
140#
141
142#
143# At least one emulation must be selected
144#
145CONFIG_FPE_NWFPE=y
146# CONFIG_FPE_FASTFPE is not set
147
148#
149# Userspace binary formats
150#
151CONFIG_BINFMT_ELF=y
152# CONFIG_BINFMT_AOUT is not set
153# CONFIG_BINFMT_MISC is not set
154# CONFIG_ARTHUR is not set
155
156#
157# Power management options
158#
159# CONFIG_PM is not set
160
161#
162# Device Drivers
163#
164
165#
166# Generic Driver Options
167#
168CONFIG_STANDALONE=y
169# CONFIG_PREVENT_FIRMWARE_BUILD is not set
170# CONFIG_FW_LOADER is not set
171# CONFIG_DEBUG_DRIVER is not set
172
173#
174# Memory Technology Devices (MTD)
175#
176CONFIG_MTD=y
177# CONFIG_MTD_DEBUG is not set
178# CONFIG_MTD_CONCAT is not set
179CONFIG_MTD_PARTITIONS=y
180CONFIG_MTD_REDBOOT_PARTS=y
181CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
182CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
183CONFIG_MTD_REDBOOT_PARTS_READONLY=y
184# CONFIG_MTD_CMDLINE_PARTS is not set
185# CONFIG_MTD_AFS_PARTS is not set
186
187#
188# User Modules And Translation Layers
189#
190CONFIG_MTD_CHAR=y
191CONFIG_MTD_BLOCK=y
192# CONFIG_FTL is not set
193# CONFIG_NFTL is not set
194# CONFIG_INFTL is not set
195
196#
197# RAM/ROM/Flash chip drivers
198#
199CONFIG_MTD_CFI=y
200# CONFIG_MTD_JEDECPROBE is not set
201CONFIG_MTD_GEN_PROBE=y
202# CONFIG_MTD_CFI_ADV_OPTIONS is not set
203CONFIG_MTD_MAP_BANK_WIDTH_1=y
204CONFIG_MTD_MAP_BANK_WIDTH_2=y
205CONFIG_MTD_MAP_BANK_WIDTH_4=y
206# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
207# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
208# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
209CONFIG_MTD_CFI_I1=y
210CONFIG_MTD_CFI_I2=y
211# CONFIG_MTD_CFI_I4 is not set
212# CONFIG_MTD_CFI_I8 is not set
213CONFIG_MTD_CFI_INTELEXT=y
214# CONFIG_MTD_CFI_AMDSTD is not set
215# CONFIG_MTD_CFI_STAA is not set
216CONFIG_MTD_CFI_UTIL=y
217# CONFIG_MTD_RAM is not set
218# CONFIG_MTD_ROM is not set
219# CONFIG_MTD_ABSENT is not set
220# CONFIG_MTD_XIP is not set
221
222#
223# Mapping drivers for chip access
224#
225CONFIG_MTD_COMPLEX_MAPPINGS=y
226# CONFIG_MTD_PHYSMAP is not set
227# CONFIG_MTD_ARM_INTEGRATOR is not set
228CONFIG_MTD_IXP2000=y
229# CONFIG_MTD_EDB7312 is not set
230# CONFIG_MTD_PCI is not set
231
232#
233# Self-contained MTD device drivers
234#
235# CONFIG_MTD_PMC551 is not set
236# CONFIG_MTD_SLRAM is not set
237# CONFIG_MTD_PHRAM is not set
238# CONFIG_MTD_MTDRAM is not set
239# CONFIG_MTD_BLKMTD is not set
240# CONFIG_MTD_BLOCK2MTD is not set
241
242#
243# Disk-On-Chip Device Drivers
244#
245# CONFIG_MTD_DOC2000 is not set
246# CONFIG_MTD_DOC2001 is not set
247# CONFIG_MTD_DOC2001PLUS is not set
248
249#
250# NAND Flash Device Drivers
251#
252# CONFIG_MTD_NAND is not set
253
254#
255# Parallel port support
256#
257# CONFIG_PARPORT is not set
258
259#
260# Plug and Play support
261#
262
263#
264# Block devices
265#
266# CONFIG_BLK_DEV_FD is not set
267# CONFIG_BLK_CPQ_DA is not set
268# CONFIG_BLK_CPQ_CISS_DA is not set
269# CONFIG_BLK_DEV_DAC960 is not set
270# CONFIG_BLK_DEV_UMEM is not set
271# CONFIG_BLK_DEV_COW_COMMON is not set
272CONFIG_BLK_DEV_LOOP=y
273# CONFIG_BLK_DEV_CRYPTOLOOP is not set
274# CONFIG_BLK_DEV_NBD is not set
275# CONFIG_BLK_DEV_SX8 is not set
276CONFIG_BLK_DEV_RAM=y
277CONFIG_BLK_DEV_RAM_COUNT=16
278CONFIG_BLK_DEV_RAM_SIZE=8192
279CONFIG_BLK_DEV_INITRD=y
280CONFIG_INITRAMFS_SOURCE=""
281# CONFIG_CDROM_PKTCDVD is not set
282
283#
284# IO Schedulers
285#
286CONFIG_IOSCHED_NOOP=y
287CONFIG_IOSCHED_AS=y
288CONFIG_IOSCHED_DEADLINE=y
289CONFIG_IOSCHED_CFQ=y
290# CONFIG_ATA_OVER_ETH is not set
291
292#
293# SCSI device support
294#
295# CONFIG_SCSI is not set
296
297#
298# Multi-device support (RAID and LVM)
299#
300# CONFIG_MD is not set
301
302#
303# Fusion MPT device support
304#
305
306#
307# IEEE 1394 (FireWire) support
308#
309# CONFIG_IEEE1394 is not set
310
311#
312# I2O device support
313#
314# CONFIG_I2O is not set
315
316#
317# Networking support
318#
319CONFIG_NET=y
320
321#
322# Networking options
323#
324CONFIG_PACKET=y
325CONFIG_PACKET_MMAP=y
326# CONFIG_NETLINK_DEV is not set
327CONFIG_UNIX=y
328# CONFIG_NET_KEY is not set
329CONFIG_INET=y
330# CONFIG_IP_MULTICAST is not set
331# CONFIG_IP_ADVANCED_ROUTER is not set
332CONFIG_IP_PNP=y
333CONFIG_IP_PNP_DHCP=y
334CONFIG_IP_PNP_BOOTP=y
335# CONFIG_IP_PNP_RARP is not set
336# CONFIG_NET_IPIP is not set
337# CONFIG_NET_IPGRE is not set
338# CONFIG_ARPD is not set
339CONFIG_SYN_COOKIES=y
340# CONFIG_INET_AH is not set
341# CONFIG_INET_ESP is not set
342# CONFIG_INET_IPCOMP is not set
343# CONFIG_INET_TUNNEL is not set
344# CONFIG_IP_TCPDIAG is not set
345# CONFIG_IP_TCPDIAG_IPV6 is not set
346# CONFIG_IPV6 is not set
347# CONFIG_NETFILTER is not set
348
349#
350# SCTP Configuration (EXPERIMENTAL)
351#
352# CONFIG_IP_SCTP is not set
353# CONFIG_ATM is not set
354# CONFIG_BRIDGE is not set
355# CONFIG_VLAN_8021Q is not set
356# CONFIG_DECNET is not set
357# CONFIG_LLC2 is not set
358# CONFIG_IPX is not set
359# CONFIG_ATALK is not set
360# CONFIG_X25 is not set
361# CONFIG_LAPB is not set
362# CONFIG_NET_DIVERT is not set
363# CONFIG_ECONET is not set
364# CONFIG_WAN_ROUTER is not set
365
366#
367# QoS and/or fair queueing
368#
369# CONFIG_NET_SCHED is not set
370# CONFIG_NET_CLS_ROUTE is not set
371
372#
373# Network testing
374#
375# CONFIG_NET_PKTGEN is not set
376# CONFIG_NETPOLL is not set
377# CONFIG_NET_POLL_CONTROLLER is not set
378# CONFIG_HAMRADIO is not set
379# CONFIG_IRDA is not set
380# CONFIG_BT is not set
381CONFIG_NETDEVICES=y
382CONFIG_DUMMY=y
383# CONFIG_BONDING is not set
384# CONFIG_EQUALIZER is not set
385# CONFIG_TUN is not set
386
387#
388# ARCnet devices
389#
390# CONFIG_ARCNET is not set
391
392#
393# Ethernet (10 or 100Mbit)
394#
395CONFIG_NET_ETHERNET=y
396CONFIG_MII=y
397# CONFIG_HAPPYMEAL is not set
398# CONFIG_SUNGEM is not set
399# CONFIG_NET_VENDOR_3COM is not set
400# CONFIG_SMC91X is not set
401
402#
403# Tulip family network device support
404#
405# CONFIG_NET_TULIP is not set
406# CONFIG_HP100 is not set
407CONFIG_NET_PCI=y
408# CONFIG_PCNET32 is not set
409# CONFIG_AMD8111_ETH is not set
410# CONFIG_ADAPTEC_STARFIRE is not set
411# CONFIG_B44 is not set
412# CONFIG_FORCEDETH is not set
413# CONFIG_DGRS is not set
414CONFIG_EEPRO100=y
415# CONFIG_E100 is not set
416# CONFIG_FEALNX is not set
417# CONFIG_NATSEMI is not set
418# CONFIG_NE2K_PCI is not set
419# CONFIG_8139CP is not set
420# CONFIG_8139TOO is not set
421# CONFIG_SIS900 is not set
422# CONFIG_EPIC100 is not set
423# CONFIG_SUNDANCE is not set
424# CONFIG_TLAN is not set
425# CONFIG_VIA_RHINE is not set
426
427#
428# Ethernet (1000 Mbit)
429#
430# CONFIG_ACENIC is not set
431# CONFIG_DL2K is not set
432# CONFIG_E1000 is not set
433# CONFIG_NS83820 is not set
434# CONFIG_HAMACHI is not set
435# CONFIG_YELLOWFIN is not set
436# CONFIG_R8169 is not set
437# CONFIG_SK98LIN is not set
438# CONFIG_VIA_VELOCITY is not set
439# CONFIG_TIGON3 is not set
440
441#
442# Ethernet (10000 Mbit)
443#
444# CONFIG_IXGB is not set
445# CONFIG_S2IO is not set
446
447#
448# Token Ring devices
449#
450# CONFIG_TR is not set
451
452#
453# Wireless LAN (non-hamradio)
454#
455# CONFIG_NET_RADIO is not set
456
457#
458# Wan interfaces
459#
460CONFIG_WAN=y
461# CONFIG_LANMEDIA is not set
462# CONFIG_SYNCLINK_SYNCPPP is not set
463CONFIG_HDLC=y
464CONFIG_HDLC_RAW=y
465# CONFIG_HDLC_RAW_ETH is not set
466CONFIG_HDLC_CISCO=y
467CONFIG_HDLC_FR=y
468CONFIG_HDLC_PPP=y
469
470#
471# X.25/LAPB support is disabled
472#
473# CONFIG_PCI200SYN is not set
474# CONFIG_WANXL is not set
475# CONFIG_PC300 is not set
476# CONFIG_FARSYNC is not set
477CONFIG_DLCI=y
478CONFIG_DLCI_COUNT=24
479CONFIG_DLCI_MAX=8
480# CONFIG_FDDI is not set
481# CONFIG_HIPPI is not set
482# CONFIG_PPP is not set
483# CONFIG_SLIP is not set
484# CONFIG_SHAPER is not set
485# CONFIG_NETCONSOLE is not set
486
487#
488# ISDN subsystem
489#
490# CONFIG_ISDN is not set
491
492#
493# Input device support
494#
495CONFIG_INPUT=y
496
497#
498# Userland interfaces
499#
500CONFIG_INPUT_MOUSEDEV=y
501CONFIG_INPUT_MOUSEDEV_PSAUX=y
502CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
503CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
504# CONFIG_INPUT_JOYDEV is not set
505# CONFIG_INPUT_TSDEV is not set
506# CONFIG_INPUT_EVDEV is not set
507# CONFIG_INPUT_EVBUG is not set
508
509#
510# Input Device Drivers
511#
512# CONFIG_INPUT_KEYBOARD is not set
513# CONFIG_INPUT_MOUSE is not set
514# CONFIG_INPUT_JOYSTICK is not set
515# CONFIG_INPUT_TOUCHSCREEN is not set
516# CONFIG_INPUT_MISC is not set
517
518#
519# Hardware I/O ports
520#
521# CONFIG_SERIO is not set
522# CONFIG_GAMEPORT is not set
523CONFIG_SOUND_GAMEPORT=y
524
525#
526# Character devices
527#
528# CONFIG_VT is not set
529# CONFIG_SERIAL_NONSTANDARD is not set
530
531#
532# Serial drivers
533#
534CONFIG_SERIAL_8250=y
535CONFIG_SERIAL_8250_CONSOLE=y
536CONFIG_SERIAL_8250_NR_UARTS=2
537# CONFIG_SERIAL_8250_EXTENDED is not set
538
539#
540# Non-8250 serial port support
541#
542CONFIG_SERIAL_CORE=y
543CONFIG_SERIAL_CORE_CONSOLE=y
544CONFIG_UNIX98_PTYS=y
545CONFIG_LEGACY_PTYS=y
546CONFIG_LEGACY_PTY_COUNT=256
547
548#
549# IPMI
550#
551# CONFIG_IPMI_HANDLER is not set
552
553#
554# Watchdog Cards
555#
556CONFIG_WATCHDOG=y
557# CONFIG_WATCHDOG_NOWAYOUT is not set
558
559#
560# Watchdog Device Drivers
561#
562# CONFIG_SOFT_WATCHDOG is not set
563CONFIG_IXP2000_WATCHDOG=y
564
565#
566# PCI-based Watchdog Cards
567#
568# CONFIG_PCIPCWATCHDOG is not set
569# CONFIG_WDTPCI is not set
570# CONFIG_NVRAM is not set
571# CONFIG_RTC 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_DRM is not set
580# CONFIG_RAW_DRIVER is not set
581
582#
583# TPM devices
584#
585# CONFIG_TCG_TPM is not set
586
587#
588# I2C support
589#
590CONFIG_I2C=y
591CONFIG_I2C_CHARDEV=y
592
593#
594# I2C Algorithms
595#
596CONFIG_I2C_ALGOBIT=y
597# CONFIG_I2C_ALGOPCF is not set
598# CONFIG_I2C_ALGOPCA is not set
599
600#
601# I2C Hardware Bus support
602#
603# CONFIG_I2C_ALI1535 is not set
604# CONFIG_I2C_ALI1563 is not set
605# CONFIG_I2C_ALI15X3 is not set
606# CONFIG_I2C_AMD756 is not set
607# CONFIG_I2C_AMD8111 is not set
608# CONFIG_I2C_I801 is not set
609# CONFIG_I2C_I810 is not set
610# CONFIG_I2C_ISA is not set
611# CONFIG_I2C_IXP2000 is not set
612# CONFIG_I2C_NFORCE2 is not set
613# CONFIG_I2C_PARPORT_LIGHT is not set
614# CONFIG_I2C_PIIX4 is not set
615# CONFIG_I2C_PROSAVAGE is not set
616# CONFIG_I2C_SAVAGE4 is not set
617# CONFIG_SCx200_ACB is not set
618# CONFIG_I2C_SIS5595 is not set
619# CONFIG_I2C_SIS630 is not set
620# CONFIG_I2C_SIS96X is not set
621# CONFIG_I2C_VIA is not set
622# CONFIG_I2C_VIAPRO is not set
623# CONFIG_I2C_VOODOO3 is not set
624# CONFIG_I2C_PCA_ISA is not set
625
626#
627# Hardware Sensors Chip support
628#
629CONFIG_I2C_SENSOR=y
630# CONFIG_SENSORS_ADM1021 is not set
631# CONFIG_SENSORS_ADM1025 is not set
632# CONFIG_SENSORS_ADM1026 is not set
633# CONFIG_SENSORS_ADM1031 is not set
634# CONFIG_SENSORS_ASB100 is not set
635# CONFIG_SENSORS_DS1621 is not set
636# CONFIG_SENSORS_FSCHER is not set
637# CONFIG_SENSORS_FSCPOS is not set
638# CONFIG_SENSORS_GL518SM is not set
639# CONFIG_SENSORS_GL520SM is not set
640# CONFIG_SENSORS_IT87 is not set
641# CONFIG_SENSORS_LM63 is not set
642# CONFIG_SENSORS_LM75 is not set
643# CONFIG_SENSORS_LM77 is not set
644# CONFIG_SENSORS_LM78 is not set
645# CONFIG_SENSORS_LM80 is not set
646# CONFIG_SENSORS_LM83 is not set
647# CONFIG_SENSORS_LM85 is not set
648# CONFIG_SENSORS_LM87 is not set
649# CONFIG_SENSORS_LM90 is not set
650# CONFIG_SENSORS_MAX1619 is not set
651# CONFIG_SENSORS_PC87360 is not set
652# CONFIG_SENSORS_SMSC47B397 is not set
653# CONFIG_SENSORS_SIS5595 is not set
654# CONFIG_SENSORS_SMSC47M1 is not set
655# CONFIG_SENSORS_VIA686A is not set
656# CONFIG_SENSORS_W83781D is not set
657# CONFIG_SENSORS_W83L785TS is not set
658# CONFIG_SENSORS_W83627HF is not set
659
660#
661# Other I2C Chip support
662#
663CONFIG_SENSORS_EEPROM=y
664# CONFIG_SENSORS_PCF8574 is not set
665# CONFIG_SENSORS_PCF8591 is not set
666# CONFIG_SENSORS_RTC8564 is not set
667# CONFIG_I2C_DEBUG_CORE is not set
668# CONFIG_I2C_DEBUG_ALGO is not set
669# CONFIG_I2C_DEBUG_BUS is not set
670# CONFIG_I2C_DEBUG_CHIP is not set
671
672#
673# Misc devices
674#
675
676#
677# Multimedia devices
678#
679# CONFIG_VIDEO_DEV is not set
680
681#
682# Digital Video Broadcasting Devices
683#
684# CONFIG_DVB is not set
685
686#
687# Graphics support
688#
689# CONFIG_FB is not set
690
691#
692# Sound
693#
694# CONFIG_SOUND is not set
695
696#
697# USB support
698#
699CONFIG_USB_ARCH_HAS_HCD=y
700CONFIG_USB_ARCH_HAS_OHCI=y
701# CONFIG_USB is not set
702
703#
704# USB Gadget Support
705#
706# CONFIG_USB_GADGET is not set
707
708#
709# MMC/SD Card support
710#
711# CONFIG_MMC is not set
712
713#
714# File systems
715#
716CONFIG_EXT2_FS=y
717CONFIG_EXT2_FS_XATTR=y
718CONFIG_EXT2_FS_POSIX_ACL=y
719# CONFIG_EXT2_FS_SECURITY is not set
720CONFIG_EXT3_FS=y
721CONFIG_EXT3_FS_XATTR=y
722CONFIG_EXT3_FS_POSIX_ACL=y
723# CONFIG_EXT3_FS_SECURITY is not set
724CONFIG_JBD=y
725# CONFIG_JBD_DEBUG is not set
726CONFIG_FS_MBCACHE=y
727# CONFIG_REISERFS_FS is not set
728# CONFIG_JFS_FS is not set
729CONFIG_FS_POSIX_ACL=y
730
731#
732# XFS support
733#
734# CONFIG_XFS_FS is not set
735# CONFIG_MINIX_FS is not set
736# CONFIG_ROMFS_FS is not set
737# CONFIG_QUOTA is not set
738CONFIG_DNOTIFY=y
739# CONFIG_AUTOFS_FS is not set
740# CONFIG_AUTOFS4_FS is not set
741
742#
743# CD-ROM/DVD Filesystems
744#
745# CONFIG_ISO9660_FS is not set
746# CONFIG_UDF_FS is not set
747
748#
749# DOS/FAT/NT Filesystems
750#
751# CONFIG_MSDOS_FS is not set
752# CONFIG_VFAT_FS is not set
753# CONFIG_NTFS_FS is not set
754
755#
756# Pseudo filesystems
757#
758CONFIG_PROC_FS=y
759CONFIG_SYSFS=y
760# CONFIG_DEVFS_FS is not set
761# CONFIG_DEVPTS_FS_XATTR is not set
762CONFIG_TMPFS=y
763# CONFIG_TMPFS_XATTR is not set
764# CONFIG_HUGETLB_PAGE is not set
765CONFIG_RAMFS=y
766
767#
768# Miscellaneous filesystems
769#
770# CONFIG_ADFS_FS is not set
771# CONFIG_AFFS_FS is not set
772# CONFIG_HFS_FS is not set
773# CONFIG_HFSPLUS_FS is not set
774# CONFIG_BEFS_FS is not set
775# CONFIG_BFS_FS is not set
776# CONFIG_EFS_FS is not set
777# CONFIG_JFFS_FS is not set
778CONFIG_JFFS2_FS=y
779CONFIG_JFFS2_FS_DEBUG=0
780# CONFIG_JFFS2_FS_NAND is not set
781# CONFIG_JFFS2_FS_NOR_ECC is not set
782# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
783CONFIG_JFFS2_ZLIB=y
784CONFIG_JFFS2_RTIME=y
785# CONFIG_JFFS2_RUBIN is not set
786# CONFIG_CRAMFS is not set
787# CONFIG_VXFS_FS is not set
788# CONFIG_HPFS_FS is not set
789# CONFIG_QNX4FS_FS is not set
790# CONFIG_SYSV_FS is not set
791# CONFIG_UFS_FS is not set
792
793#
794# Network File Systems
795#
796CONFIG_NFS_FS=y
797CONFIG_NFS_V3=y
798# CONFIG_NFS_V4 is not set
799# CONFIG_NFS_DIRECTIO is not set
800# CONFIG_NFSD is not set
801CONFIG_ROOT_NFS=y
802CONFIG_LOCKD=y
803CONFIG_LOCKD_V4=y
804CONFIG_SUNRPC=y
805# CONFIG_RPCSEC_GSS_KRB5 is not set
806# CONFIG_RPCSEC_GSS_SPKM3 is not set
807# CONFIG_SMB_FS is not set
808# CONFIG_CIFS is not set
809# CONFIG_NCP_FS is not set
810# CONFIG_CODA_FS is not set
811# CONFIG_AFS_FS is not set
812
813#
814# Partition Types
815#
816CONFIG_PARTITION_ADVANCED=y
817# CONFIG_ACORN_PARTITION is not set
818# CONFIG_OSF_PARTITION is not set
819# CONFIG_AMIGA_PARTITION is not set
820# CONFIG_ATARI_PARTITION is not set
821# CONFIG_MAC_PARTITION is not set
822CONFIG_MSDOS_PARTITION=y
823# CONFIG_BSD_DISKLABEL is not set
824# CONFIG_MINIX_SUBPARTITION is not set
825# CONFIG_SOLARIS_X86_PARTITION is not set
826# CONFIG_UNIXWARE_DISKLABEL is not set
827# CONFIG_LDM_PARTITION is not set
828# CONFIG_SGI_PARTITION is not set
829# CONFIG_ULTRIX_PARTITION is not set
830# CONFIG_SUN_PARTITION is not set
831# CONFIG_EFI_PARTITION is not set
832
833#
834# Native Language Support
835#
836# CONFIG_NLS is not set
837
838#
839# Profiling support
840#
841# CONFIG_PROFILING is not set
842
843#
844# Kernel hacking
845#
846# CONFIG_PRINTK_TIME is not set
847CONFIG_DEBUG_KERNEL=y
848CONFIG_MAGIC_SYSRQ=y
849CONFIG_LOG_BUF_SHIFT=14
850# CONFIG_SCHEDSTATS is not set
851# CONFIG_DEBUG_SLAB is not set
852# CONFIG_DEBUG_SPINLOCK is not set
853# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
854# CONFIG_DEBUG_KOBJECT is not set
855CONFIG_DEBUG_BUGVERBOSE=y
856# CONFIG_DEBUG_INFO is not set
857# CONFIG_DEBUG_FS is not set
858CONFIG_FRAME_POINTER=y
859CONFIG_DEBUG_USER=y
860# CONFIG_DEBUG_WAITQ is not set
861CONFIG_DEBUG_ERRORS=y
862CONFIG_DEBUG_LL=y
863# CONFIG_DEBUG_ICEDCC is not set
864
865#
866# Security options
867#
868# CONFIG_KEYS is not set
869# CONFIG_SECURITY is not set
870
871#
872# Cryptographic options
873#
874# CONFIG_CRYPTO is not set
875
876#
877# Hardware crypto devices
878#
879
880#
881# Library routines
882#
883# CONFIG_CRC_CCITT is not set
884CONFIG_CRC32=y
885# CONFIG_LIBCRC32C is not set
886CONFIG_ZLIB_INFLATE=y
887CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/ep80219_defconfig b/arch/arm/configs/ep80219_defconfig
new file mode 100644
index 000000000000..96342afa9c5f
--- /dev/null
+++ b/arch/arm/configs/ep80219_defconfig
@@ -0,0 +1,952 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 22:34:12 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53CONFIG_MODULE_UNLOAD=y
54# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set
57# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y
59
60#
61# System Type
62#
63# CONFIG_ARCH_CLPS7500 is not set
64# CONFIG_ARCH_CLPS711X is not set
65# CONFIG_ARCH_CO285 is not set
66# CONFIG_ARCH_EBSA110 is not set
67# CONFIG_ARCH_CAMELOT is not set
68# CONFIG_ARCH_FOOTBRIDGE is not set
69# CONFIG_ARCH_INTEGRATOR is not set
70CONFIG_ARCH_IOP3XX=y
71# CONFIG_ARCH_IXP4XX is not set
72# CONFIG_ARCH_IXP2000 is not set
73# CONFIG_ARCH_L7200 is not set
74# CONFIG_ARCH_PXA is not set
75# CONFIG_ARCH_RPC is not set
76# CONFIG_ARCH_SA1100 is not set
77# CONFIG_ARCH_S3C2410 is not set
78# CONFIG_ARCH_SHARK is not set
79# CONFIG_ARCH_LH7A40X is not set
80# CONFIG_ARCH_OMAP is not set
81# CONFIG_ARCH_VERSATILE is not set
82# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set
84
85#
86# IOP3xx Implementation Options
87#
88
89#
90# IOP3xx Platform Types
91#
92# CONFIG_ARCH_IQ80321 is not set
93CONFIG_ARCH_IQ31244=y
94# CONFIG_ARCH_IQ80331 is not set
95# CONFIG_MACH_IQ80332 is not set
96CONFIG_ARCH_EP80219=y
97CONFIG_ARCH_IOP321=y
98# CONFIG_ARCH_IOP331 is not set
99
100#
101# IOP3xx Chipset Features
102#
103
104#
105# Processor Type
106#
107CONFIG_CPU_32=y
108CONFIG_CPU_XSCALE=y
109CONFIG_CPU_32v5=y
110CONFIG_CPU_ABRT_EV5T=y
111CONFIG_CPU_CACHE_VIVT=y
112CONFIG_CPU_TLB_V4WBI=y
113CONFIG_CPU_MINICACHE=y
114
115#
116# Processor Features
117#
118# CONFIG_ARM_THUMB is not set
119CONFIG_XSCALE_PMU=y
120
121#
122# Bus support
123#
124CONFIG_PCI=y
125# CONFIG_PCI_LEGACY_PROC is not set
126CONFIG_PCI_NAMES=y
127
128#
129# PCCARD (PCMCIA/CardBus) support
130#
131# CONFIG_PCCARD is not set
132
133#
134# Kernel Features
135#
136# CONFIG_PREEMPT is not set
137CONFIG_ALIGNMENT_TRAP=y
138
139#
140# Boot options
141#
142CONFIG_ZBOOT_ROM_TEXT=0x0
143CONFIG_ZBOOT_ROM_BSS=0x0
144CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200"
145# CONFIG_XIP_KERNEL is not set
146
147#
148# Floating point emulation
149#
150
151#
152# At least one emulation must be selected
153#
154CONFIG_FPE_NWFPE=y
155# CONFIG_FPE_NWFPE_XP is not set
156# CONFIG_FPE_FASTFPE is not set
157
158#
159# Userspace binary formats
160#
161CONFIG_BINFMT_ELF=y
162CONFIG_BINFMT_AOUT=y
163# CONFIG_BINFMT_MISC is not set
164# CONFIG_ARTHUR is not set
165
166#
167# Power management options
168#
169# CONFIG_PM is not set
170
171#
172# Device Drivers
173#
174
175#
176# Generic Driver Options
177#
178CONFIG_STANDALONE=y
179CONFIG_PREVENT_FIRMWARE_BUILD=y
180# CONFIG_FW_LOADER is not set
181
182#
183# Memory Technology Devices (MTD)
184#
185CONFIG_MTD=y
186# CONFIG_MTD_DEBUG is not set
187# CONFIG_MTD_CONCAT is not set
188CONFIG_MTD_PARTITIONS=y
189CONFIG_MTD_REDBOOT_PARTS=y
190CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
191CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
192CONFIG_MTD_REDBOOT_PARTS_READONLY=y
193# CONFIG_MTD_CMDLINE_PARTS is not set
194# CONFIG_MTD_AFS_PARTS is not set
195
196#
197# User Modules And Translation Layers
198#
199CONFIG_MTD_CHAR=y
200CONFIG_MTD_BLOCK=y
201# CONFIG_FTL is not set
202# CONFIG_NFTL is not set
203# CONFIG_INFTL is not set
204
205#
206# RAM/ROM/Flash chip drivers
207#
208CONFIG_MTD_CFI=y
209# CONFIG_MTD_JEDECPROBE is not set
210CONFIG_MTD_GEN_PROBE=y
211# CONFIG_MTD_CFI_ADV_OPTIONS is not set
212CONFIG_MTD_MAP_BANK_WIDTH_1=y
213CONFIG_MTD_MAP_BANK_WIDTH_2=y
214CONFIG_MTD_MAP_BANK_WIDTH_4=y
215# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
216# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
217# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
218CONFIG_MTD_CFI_I1=y
219CONFIG_MTD_CFI_I2=y
220# CONFIG_MTD_CFI_I4 is not set
221# CONFIG_MTD_CFI_I8 is not set
222CONFIG_MTD_CFI_INTELEXT=y
223# CONFIG_MTD_CFI_AMDSTD is not set
224# CONFIG_MTD_CFI_STAA is not set
225CONFIG_MTD_CFI_UTIL=y
226# CONFIG_MTD_RAM is not set
227# CONFIG_MTD_ROM is not set
228# CONFIG_MTD_ABSENT is not set
229# CONFIG_MTD_XIP is not set
230
231#
232# Mapping drivers for chip access
233#
234# CONFIG_MTD_COMPLEX_MAPPINGS is not set
235CONFIG_MTD_PHYSMAP=y
236CONFIG_MTD_PHYSMAP_START=0xf0000000
237CONFIG_MTD_PHYSMAP_LEN=0x00800000
238CONFIG_MTD_PHYSMAP_BANKWIDTH=2
239# CONFIG_MTD_ARM_INTEGRATOR is not set
240# CONFIG_MTD_EDB7312 is not set
241
242#
243# Self-contained MTD device drivers
244#
245# CONFIG_MTD_PMC551 is not set
246# CONFIG_MTD_SLRAM is not set
247# CONFIG_MTD_PHRAM is not set
248# CONFIG_MTD_MTDRAM is not set
249# CONFIG_MTD_BLKMTD is not set
250# CONFIG_MTD_BLOCK2MTD is not set
251
252#
253# Disk-On-Chip Device Drivers
254#
255# CONFIG_MTD_DOC2000 is not set
256# CONFIG_MTD_DOC2001 is not set
257# CONFIG_MTD_DOC2001PLUS is not set
258
259#
260# NAND Flash Device Drivers
261#
262# CONFIG_MTD_NAND is not set
263
264#
265# Parallel port support
266#
267# CONFIG_PARPORT is not set
268
269#
270# Plug and Play support
271#
272
273#
274# Block devices
275#
276# CONFIG_BLK_DEV_FD is not set
277# CONFIG_BLK_CPQ_DA is not set
278# CONFIG_BLK_CPQ_CISS_DA is not set
279# CONFIG_BLK_DEV_DAC960 is not set
280# CONFIG_BLK_DEV_UMEM is not set
281# CONFIG_BLK_DEV_COW_COMMON is not set
282# CONFIG_BLK_DEV_LOOP is not set
283# CONFIG_BLK_DEV_NBD is not set
284# CONFIG_BLK_DEV_SX8 is not set
285CONFIG_BLK_DEV_RAM=y
286CONFIG_BLK_DEV_RAM_COUNT=16
287CONFIG_BLK_DEV_RAM_SIZE=8192
288# CONFIG_BLK_DEV_INITRD is not set
289CONFIG_INITRAMFS_SOURCE=""
290# CONFIG_CDROM_PKTCDVD is not set
291
292#
293# IO Schedulers
294#
295CONFIG_IOSCHED_NOOP=y
296CONFIG_IOSCHED_AS=y
297CONFIG_IOSCHED_DEADLINE=y
298CONFIG_IOSCHED_CFQ=y
299# CONFIG_ATA_OVER_ETH is not set
300
301#
302# ATA/ATAPI/MFM/RLL support
303#
304# CONFIG_IDE is not set
305
306#
307# SCSI device support
308#
309CONFIG_SCSI=y
310CONFIG_SCSI_PROC_FS=y
311
312#
313# SCSI support type (disk, tape, CD-ROM)
314#
315CONFIG_BLK_DEV_SD=y
316# CONFIG_CHR_DEV_ST is not set
317# CONFIG_CHR_DEV_OSST is not set
318# CONFIG_BLK_DEV_SR is not set
319CONFIG_CHR_DEV_SG=y
320
321#
322# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
323#
324# CONFIG_SCSI_MULTI_LUN is not set
325# CONFIG_SCSI_CONSTANTS is not set
326# CONFIG_SCSI_LOGGING is not set
327
328#
329# SCSI Transport Attributes
330#
331# CONFIG_SCSI_SPI_ATTRS is not set
332# CONFIG_SCSI_FC_ATTRS is not set
333# CONFIG_SCSI_ISCSI_ATTRS is not set
334
335#
336# SCSI low-level drivers
337#
338# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
339# CONFIG_SCSI_3W_9XXX is not set
340# CONFIG_SCSI_ACARD is not set
341# CONFIG_SCSI_AACRAID is not set
342# CONFIG_SCSI_AIC7XXX is not set
343# CONFIG_SCSI_AIC7XXX_OLD is not set
344# CONFIG_SCSI_AIC79XX is not set
345# CONFIG_SCSI_DPT_I2O is not set
346# CONFIG_MEGARAID_NEWGEN is not set
347# CONFIG_MEGARAID_LEGACY is not set
348# CONFIG_SCSI_SATA is not set
349# CONFIG_SCSI_BUSLOGIC is not set
350# CONFIG_SCSI_DMX3191D is not set
351# CONFIG_SCSI_EATA is not set
352# CONFIG_SCSI_FUTURE_DOMAIN is not set
353# CONFIG_SCSI_GDTH is not set
354# CONFIG_SCSI_IPS is not set
355# CONFIG_SCSI_INITIO is not set
356# CONFIG_SCSI_INIA100 is not set
357# CONFIG_SCSI_SYM53C8XX_2 is not set
358# CONFIG_SCSI_IPR is not set
359# CONFIG_SCSI_QLOGIC_FC is not set
360# CONFIG_SCSI_QLOGIC_1280 is not set
361CONFIG_SCSI_QLA2XXX=y
362# CONFIG_SCSI_QLA21XX is not set
363# CONFIG_SCSI_QLA22XX is not set
364# CONFIG_SCSI_QLA2300 is not set
365# CONFIG_SCSI_QLA2322 is not set
366# CONFIG_SCSI_QLA6312 is not set
367# CONFIG_SCSI_DC395x is not set
368# CONFIG_SCSI_DC390T is not set
369# CONFIG_SCSI_NSP32 is not set
370# CONFIG_SCSI_DEBUG is not set
371
372#
373# Multi-device support (RAID and LVM)
374#
375CONFIG_MD=y
376CONFIG_BLK_DEV_MD=y
377# CONFIG_MD_LINEAR is not set
378CONFIG_MD_RAID0=y
379CONFIG_MD_RAID1=y
380# CONFIG_MD_RAID10 is not set
381CONFIG_MD_RAID5=y
382# CONFIG_MD_RAID6 is not set
383# CONFIG_MD_MULTIPATH is not set
384# CONFIG_MD_FAULTY is not set
385CONFIG_BLK_DEV_DM=y
386# CONFIG_DM_CRYPT is not set
387# CONFIG_DM_SNAPSHOT is not set
388# CONFIG_DM_MIRROR is not set
389# CONFIG_DM_ZERO is not set
390# CONFIG_DM_MULTIPATH is not set
391
392#
393# Fusion MPT device support
394#
395# CONFIG_FUSION is not set
396
397#
398# IEEE 1394 (FireWire) support
399#
400# CONFIG_IEEE1394 is not set
401
402#
403# I2O device support
404#
405# CONFIG_I2O is not set
406
407#
408# Networking support
409#
410CONFIG_NET=y
411
412#
413# Networking options
414#
415CONFIG_PACKET=y
416CONFIG_PACKET_MMAP=y
417# CONFIG_NETLINK_DEV is not set
418CONFIG_UNIX=y
419# CONFIG_NET_KEY is not set
420CONFIG_INET=y
421CONFIG_IP_MULTICAST=y
422# CONFIG_IP_ADVANCED_ROUTER is not set
423CONFIG_IP_PNP=y
424# CONFIG_IP_PNP_DHCP is not set
425CONFIG_IP_PNP_BOOTP=y
426# CONFIG_IP_PNP_RARP is not set
427# CONFIG_NET_IPIP is not set
428# CONFIG_NET_IPGRE is not set
429# CONFIG_IP_MROUTE is not set
430# CONFIG_ARPD is not set
431# CONFIG_SYN_COOKIES is not set
432# CONFIG_INET_AH is not set
433# CONFIG_INET_ESP is not set
434# CONFIG_INET_IPCOMP is not set
435# CONFIG_INET_TUNNEL is not set
436CONFIG_IP_TCPDIAG=y
437# CONFIG_IP_TCPDIAG_IPV6 is not set
438# CONFIG_IPV6 is not set
439# CONFIG_NETFILTER is not set
440
441#
442# SCTP Configuration (EXPERIMENTAL)
443#
444# CONFIG_IP_SCTP is not set
445# CONFIG_ATM is not set
446# CONFIG_BRIDGE is not set
447# CONFIG_VLAN_8021Q is not set
448# CONFIG_DECNET is not set
449# CONFIG_LLC2 is not set
450# CONFIG_IPX is not set
451# CONFIG_ATALK is not set
452# CONFIG_X25 is not set
453# CONFIG_LAPB is not set
454# CONFIG_NET_DIVERT is not set
455# CONFIG_ECONET is not set
456# CONFIG_WAN_ROUTER is not set
457
458#
459# QoS and/or fair queueing
460#
461# CONFIG_NET_SCHED is not set
462# CONFIG_NET_CLS_ROUTE is not set
463
464#
465# Network testing
466#
467# CONFIG_NET_PKTGEN is not set
468# CONFIG_NETPOLL is not set
469# CONFIG_NET_POLL_CONTROLLER is not set
470# CONFIG_HAMRADIO is not set
471# CONFIG_IRDA is not set
472# CONFIG_BT is not set
473CONFIG_NETDEVICES=y
474# CONFIG_DUMMY is not set
475# CONFIG_BONDING is not set
476# CONFIG_EQUALIZER is not set
477# CONFIG_TUN is not set
478
479#
480# ARCnet devices
481#
482# CONFIG_ARCNET is not set
483
484#
485# Ethernet (10 or 100Mbit)
486#
487CONFIG_NET_ETHERNET=y
488CONFIG_MII=y
489# CONFIG_HAPPYMEAL is not set
490# CONFIG_SUNGEM is not set
491# CONFIG_NET_VENDOR_3COM is not set
492# CONFIG_SMC91X is not set
493
494#
495# Tulip family network device support
496#
497# CONFIG_NET_TULIP is not set
498# CONFIG_HP100 is not set
499CONFIG_NET_PCI=y
500# CONFIG_PCNET32 is not set
501# CONFIG_AMD8111_ETH is not set
502# CONFIG_ADAPTEC_STARFIRE is not set
503# CONFIG_B44 is not set
504# CONFIG_FORCEDETH is not set
505# CONFIG_DGRS is not set
506# CONFIG_EEPRO100 is not set
507CONFIG_E100=y
508# CONFIG_FEALNX is not set
509# CONFIG_NATSEMI is not set
510# CONFIG_NE2K_PCI is not set
511# CONFIG_8139CP is not set
512# CONFIG_8139TOO is not set
513# CONFIG_SIS900 is not set
514# CONFIG_EPIC100 is not set
515# CONFIG_SUNDANCE is not set
516# CONFIG_TLAN is not set
517# CONFIG_VIA_RHINE is not set
518
519#
520# Ethernet (1000 Mbit)
521#
522# CONFIG_ACENIC is not set
523# CONFIG_DL2K is not set
524CONFIG_E1000=y
525CONFIG_E1000_NAPI=y
526# CONFIG_NS83820 is not set
527# CONFIG_HAMACHI is not set
528# CONFIG_YELLOWFIN is not set
529# CONFIG_R8169 is not set
530# CONFIG_SK98LIN is not set
531# CONFIG_VIA_VELOCITY is not set
532# CONFIG_TIGON3 is not set
533
534#
535# Ethernet (10000 Mbit)
536#
537# CONFIG_IXGB is not set
538# CONFIG_S2IO is not set
539
540#
541# Token Ring devices
542#
543# CONFIG_TR is not set
544
545#
546# Wireless LAN (non-hamradio)
547#
548# CONFIG_NET_RADIO is not set
549
550#
551# Wan interfaces
552#
553# CONFIG_WAN is not set
554# CONFIG_FDDI is not set
555# CONFIG_HIPPI is not set
556# CONFIG_PPP is not set
557# CONFIG_SLIP is not set
558# CONFIG_NET_FC is not set
559# CONFIG_SHAPER is not set
560# CONFIG_NETCONSOLE is not set
561
562#
563# ISDN subsystem
564#
565# CONFIG_ISDN is not set
566
567#
568# Input device support
569#
570CONFIG_INPUT=y
571
572#
573# Userland interfaces
574#
575CONFIG_INPUT_MOUSEDEV=y
576# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
577CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
578CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
579# CONFIG_INPUT_JOYDEV is not set
580# CONFIG_INPUT_TSDEV is not set
581# CONFIG_INPUT_EVDEV is not set
582# CONFIG_INPUT_EVBUG is not set
583
584#
585# Input Device Drivers
586#
587# CONFIG_INPUT_KEYBOARD is not set
588# CONFIG_INPUT_MOUSE is not set
589# CONFIG_INPUT_JOYSTICK is not set
590# CONFIG_INPUT_TOUCHSCREEN is not set
591# CONFIG_INPUT_MISC is not set
592
593#
594# Hardware I/O ports
595#
596# CONFIG_SERIO is not set
597# CONFIG_GAMEPORT is not set
598CONFIG_SOUND_GAMEPORT=y
599
600#
601# Character devices
602#
603CONFIG_VT=y
604CONFIG_VT_CONSOLE=y
605CONFIG_HW_CONSOLE=y
606# CONFIG_SERIAL_NONSTANDARD is not set
607
608#
609# Serial drivers
610#
611CONFIG_SERIAL_8250=y
612CONFIG_SERIAL_8250_CONSOLE=y
613CONFIG_SERIAL_8250_NR_UARTS=4
614# CONFIG_SERIAL_8250_EXTENDED is not set
615
616#
617# Non-8250 serial port support
618#
619CONFIG_SERIAL_CORE=y
620CONFIG_SERIAL_CORE_CONSOLE=y
621CONFIG_UNIX98_PTYS=y
622CONFIG_LEGACY_PTYS=y
623CONFIG_LEGACY_PTY_COUNT=256
624
625#
626# IPMI
627#
628# CONFIG_IPMI_HANDLER is not set
629
630#
631# Watchdog Cards
632#
633# CONFIG_WATCHDOG is not set
634# CONFIG_NVRAM is not set
635# CONFIG_RTC is not set
636# CONFIG_DTLK is not set
637# CONFIG_R3964 is not set
638# CONFIG_APPLICOM is not set
639
640#
641# Ftape, the floppy tape device driver
642#
643# CONFIG_DRM is not set
644# CONFIG_RAW_DRIVER is not set
645
646#
647# TPM devices
648#
649# CONFIG_TCG_TPM is not set
650
651#
652# I2C support
653#
654CONFIG_I2C=y
655CONFIG_I2C_CHARDEV=y
656
657#
658# I2C Algorithms
659#
660# CONFIG_I2C_ALGOBIT is not set
661# CONFIG_I2C_ALGOPCF is not set
662# CONFIG_I2C_ALGOPCA is not set
663
664#
665# I2C Hardware Bus support
666#
667# CONFIG_I2C_ALI1535 is not set
668# CONFIG_I2C_ALI1563 is not set
669# CONFIG_I2C_ALI15X3 is not set
670# CONFIG_I2C_AMD756 is not set
671# CONFIG_I2C_AMD8111 is not set
672# CONFIG_I2C_I801 is not set
673# CONFIG_I2C_I810 is not set
674CONFIG_I2C_IOP3XX=y
675# CONFIG_I2C_ISA is not set
676# CONFIG_I2C_NFORCE2 is not set
677# CONFIG_I2C_PARPORT_LIGHT is not set
678# CONFIG_I2C_PIIX4 is not set
679# CONFIG_I2C_PROSAVAGE is not set
680# CONFIG_I2C_SAVAGE4 is not set
681# CONFIG_SCx200_ACB is not set
682# CONFIG_I2C_SIS5595 is not set
683# CONFIG_I2C_SIS630 is not set
684# CONFIG_I2C_SIS96X is not set
685# CONFIG_I2C_STUB is not set
686# CONFIG_I2C_VIA is not set
687# CONFIG_I2C_VIAPRO is not set
688# CONFIG_I2C_VOODOO3 is not set
689# CONFIG_I2C_PCA_ISA is not set
690
691#
692# Hardware Sensors Chip support
693#
694# CONFIG_I2C_SENSOR is not set
695# CONFIG_SENSORS_ADM1021 is not set
696# CONFIG_SENSORS_ADM1025 is not set
697# CONFIG_SENSORS_ADM1026 is not set
698# CONFIG_SENSORS_ADM1031 is not set
699# CONFIG_SENSORS_ASB100 is not set
700# CONFIG_SENSORS_DS1621 is not set
701# CONFIG_SENSORS_FSCHER is not set
702# CONFIG_SENSORS_FSCPOS is not set
703# CONFIG_SENSORS_GL518SM is not set
704# CONFIG_SENSORS_GL520SM is not set
705# CONFIG_SENSORS_IT87 is not set
706# CONFIG_SENSORS_LM63 is not set
707# CONFIG_SENSORS_LM75 is not set
708# CONFIG_SENSORS_LM77 is not set
709# CONFIG_SENSORS_LM78 is not set
710# CONFIG_SENSORS_LM80 is not set
711# CONFIG_SENSORS_LM83 is not set
712# CONFIG_SENSORS_LM85 is not set
713# CONFIG_SENSORS_LM87 is not set
714# CONFIG_SENSORS_LM90 is not set
715# CONFIG_SENSORS_MAX1619 is not set
716# CONFIG_SENSORS_PC87360 is not set
717# CONFIG_SENSORS_SMSC47B397 is not set
718# CONFIG_SENSORS_SIS5595 is not set
719# CONFIG_SENSORS_SMSC47M1 is not set
720# CONFIG_SENSORS_VIA686A is not set
721# CONFIG_SENSORS_W83781D is not set
722# CONFIG_SENSORS_W83L785TS is not set
723# CONFIG_SENSORS_W83627HF is not set
724
725#
726# Other I2C Chip support
727#
728# CONFIG_SENSORS_EEPROM is not set
729# CONFIG_SENSORS_PCF8574 is not set
730# CONFIG_SENSORS_PCF8591 is not set
731# CONFIG_SENSORS_RTC8564 is not set
732# CONFIG_I2C_DEBUG_CORE is not set
733# CONFIG_I2C_DEBUG_ALGO is not set
734# CONFIG_I2C_DEBUG_BUS is not set
735# CONFIG_I2C_DEBUG_CHIP is not set
736
737#
738# Misc devices
739#
740
741#
742# Multimedia devices
743#
744# CONFIG_VIDEO_DEV is not set
745
746#
747# Digital Video Broadcasting Devices
748#
749# CONFIG_DVB is not set
750
751#
752# Graphics support
753#
754# CONFIG_FB is not set
755
756#
757# Console display driver support
758#
759# CONFIG_VGA_CONSOLE is not set
760CONFIG_DUMMY_CONSOLE=y
761
762#
763# Sound
764#
765# CONFIG_SOUND is not set
766
767#
768# USB support
769#
770CONFIG_USB_ARCH_HAS_HCD=y
771CONFIG_USB_ARCH_HAS_OHCI=y
772# CONFIG_USB is not set
773
774#
775# USB Gadget Support
776#
777# CONFIG_USB_GADGET is not set
778
779#
780# MMC/SD Card support
781#
782# CONFIG_MMC is not set
783
784#
785# File systems
786#
787CONFIG_EXT2_FS=y
788# CONFIG_EXT2_FS_XATTR is not set
789CONFIG_EXT3_FS=y
790CONFIG_EXT3_FS_XATTR=y
791# CONFIG_EXT3_FS_POSIX_ACL is not set
792# CONFIG_EXT3_FS_SECURITY is not set
793CONFIG_JBD=y
794# CONFIG_JBD_DEBUG is not set
795CONFIG_FS_MBCACHE=y
796# CONFIG_REISERFS_FS is not set
797# CONFIG_JFS_FS is not set
798
799#
800# XFS support
801#
802CONFIG_XFS_FS=y
803CONFIG_XFS_EXPORT=y
804# CONFIG_XFS_RT is not set
805# CONFIG_XFS_QUOTA is not set
806CONFIG_XFS_SECURITY=y
807CONFIG_XFS_POSIX_ACL=y
808# CONFIG_MINIX_FS is not set
809# CONFIG_ROMFS_FS is not set
810# CONFIG_QUOTA is not set
811CONFIG_DNOTIFY=y
812# CONFIG_AUTOFS_FS is not set
813# CONFIG_AUTOFS4_FS is not set
814
815#
816# CD-ROM/DVD Filesystems
817#
818# CONFIG_ISO9660_FS is not set
819# CONFIG_UDF_FS is not set
820
821#
822# DOS/FAT/NT Filesystems
823#
824# CONFIG_MSDOS_FS is not set
825# CONFIG_VFAT_FS is not set
826# CONFIG_NTFS_FS is not set
827
828#
829# Pseudo filesystems
830#
831CONFIG_PROC_FS=y
832CONFIG_SYSFS=y
833# CONFIG_DEVFS_FS is not set
834# CONFIG_DEVPTS_FS_XATTR is not set
835CONFIG_TMPFS=y
836# CONFIG_TMPFS_XATTR is not set
837# CONFIG_HUGETLB_PAGE is not set
838CONFIG_RAMFS=y
839
840#
841# Miscellaneous filesystems
842#
843# CONFIG_ADFS_FS is not set
844# CONFIG_AFFS_FS is not set
845# CONFIG_HFS_FS is not set
846# CONFIG_HFSPLUS_FS is not set
847# CONFIG_BEFS_FS is not set
848# CONFIG_BFS_FS is not set
849# CONFIG_EFS_FS is not set
850# CONFIG_JFFS_FS is not set
851CONFIG_JFFS2_FS=y
852CONFIG_JFFS2_FS_DEBUG=0
853# CONFIG_JFFS2_FS_NAND is not set
854# CONFIG_JFFS2_FS_NOR_ECC is not set
855# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
856CONFIG_JFFS2_ZLIB=y
857CONFIG_JFFS2_RTIME=y
858# CONFIG_JFFS2_RUBIN is not set
859# CONFIG_CRAMFS is not set
860# CONFIG_VXFS_FS is not set
861# CONFIG_HPFS_FS is not set
862# CONFIG_QNX4FS_FS is not set
863# CONFIG_SYSV_FS is not set
864# CONFIG_UFS_FS is not set
865
866#
867# Network File Systems
868#
869CONFIG_NFS_FS=y
870CONFIG_NFS_V3=y
871# CONFIG_NFS_V4 is not set
872# CONFIG_NFS_DIRECTIO is not set
873CONFIG_NFSD=y
874CONFIG_NFSD_V3=y
875# CONFIG_NFSD_V4 is not set
876# CONFIG_NFSD_TCP is not set
877CONFIG_ROOT_NFS=y
878CONFIG_LOCKD=y
879CONFIG_LOCKD_V4=y
880CONFIG_EXPORTFS=y
881CONFIG_SUNRPC=y
882# CONFIG_RPCSEC_GSS_KRB5 is not set
883# CONFIG_RPCSEC_GSS_SPKM3 is not set
884# CONFIG_SMB_FS is not set
885# CONFIG_CIFS is not set
886# CONFIG_NCP_FS is not set
887# CONFIG_CODA_FS is not set
888# CONFIG_AFS_FS is not set
889
890#
891# Partition Types
892#
893CONFIG_PARTITION_ADVANCED=y
894# CONFIG_ACORN_PARTITION is not set
895# CONFIG_OSF_PARTITION is not set
896# CONFIG_AMIGA_PARTITION is not set
897# CONFIG_ATARI_PARTITION is not set
898# CONFIG_MAC_PARTITION is not set
899CONFIG_MSDOS_PARTITION=y
900# CONFIG_BSD_DISKLABEL is not set
901# CONFIG_MINIX_SUBPARTITION is not set
902# CONFIG_SOLARIS_X86_PARTITION is not set
903# CONFIG_UNIXWARE_DISKLABEL is not set
904# CONFIG_LDM_PARTITION is not set
905# CONFIG_SGI_PARTITION is not set
906# CONFIG_ULTRIX_PARTITION is not set
907# CONFIG_SUN_PARTITION is not set
908# CONFIG_EFI_PARTITION is not set
909
910#
911# Native Language Support
912#
913# CONFIG_NLS is not set
914
915#
916# Profiling support
917#
918# CONFIG_PROFILING is not set
919
920#
921# Kernel hacking
922#
923# CONFIG_PRINTK_TIME is not set
924# CONFIG_DEBUG_KERNEL is not set
925CONFIG_LOG_BUF_SHIFT=14
926CONFIG_DEBUG_BUGVERBOSE=y
927CONFIG_FRAME_POINTER=y
928CONFIG_DEBUG_USER=y
929
930#
931# Security options
932#
933# CONFIG_KEYS is not set
934# CONFIG_SECURITY is not set
935
936#
937# Cryptographic options
938#
939# CONFIG_CRYPTO is not set
940
941#
942# Hardware crypto devices
943#
944
945#
946# Library routines
947#
948# CONFIG_CRC_CCITT is not set
949CONFIG_CRC32=y
950# CONFIG_LIBCRC32C is not set
951CONFIG_ZLIB_INFLATE=y
952CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/epxa10db_defconfig b/arch/arm/configs/epxa10db_defconfig
new file mode 100644
index 000000000000..9fb8b58c4954
--- /dev/null
+++ b/arch/arm/configs/epxa10db_defconfig
@@ -0,0 +1,644 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 22:46:51 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
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
57# CONFIG_KMOD is not set
58
59#
60# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66CONFIG_ARCH_CAMELOT=y
67# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73# CONFIG_ARCH_PXA is not set
74# CONFIG_ARCH_RPC is not set
75# CONFIG_ARCH_SA1100 is not set
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81# CONFIG_ARCH_IMX is not set
82# CONFIG_ARCH_H720X is not set
83
84#
85# Epxa10db
86#
87
88#
89# PLD hotswap support
90#
91CONFIG_PLD=y
92# CONFIG_PLD_HOTSWAP is not set
93
94#
95# Processor Type
96#
97CONFIG_CPU_32=y
98CONFIG_CPU_ARM922T=y
99CONFIG_CPU_32v4=y
100CONFIG_CPU_ABRT_EV4T=y
101CONFIG_CPU_CACHE_V4WT=y
102CONFIG_CPU_CACHE_VIVT=y
103CONFIG_CPU_COPY_V4WB=y
104CONFIG_CPU_TLB_V4WBI=y
105
106#
107# Processor Features
108#
109# CONFIG_ARM_THUMB is not set
110# CONFIG_CPU_ICACHE_DISABLE is not set
111# CONFIG_CPU_DCACHE_DISABLE is not set
112# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
113
114#
115# Bus support
116#
117
118#
119# PCCARD (PCMCIA/CardBus) support
120#
121# CONFIG_PCCARD is not set
122
123#
124# Kernel Features
125#
126# CONFIG_PREEMPT is not set
127CONFIG_ALIGNMENT_TRAP=y
128
129#
130# Boot options
131#
132CONFIG_ZBOOT_ROM_TEXT=0x0
133CONFIG_ZBOOT_ROM_BSS=0x0
134CONFIG_CMDLINE="mem=32M console=ttyUA0,115200 initrd=0x00200000,8M root=/dev/ram0 rw"
135# CONFIG_XIP_KERNEL is not set
136
137#
138# Floating point emulation
139#
140
141#
142# At least one emulation must be selected
143#
144CONFIG_FPE_NWFPE=y
145# CONFIG_FPE_NWFPE_XP is not set
146# CONFIG_FPE_FASTFPE is not set
147
148#
149# Userspace binary formats
150#
151CONFIG_BINFMT_ELF=y
152# CONFIG_BINFMT_AOUT is not set
153# CONFIG_BINFMT_MISC is not set
154# CONFIG_ARTHUR is not set
155
156#
157# Power management options
158#
159# CONFIG_PM is not set
160
161#
162# Device Drivers
163#
164
165#
166# Generic Driver Options
167#
168CONFIG_STANDALONE=y
169CONFIG_PREVENT_FIRMWARE_BUILD=y
170# CONFIG_FW_LOADER is not set
171
172#
173# Memory Technology Devices (MTD)
174#
175# CONFIG_MTD is not set
176
177#
178# Parallel port support
179#
180# CONFIG_PARPORT is not set
181
182#
183# Plug and Play support
184#
185
186#
187# Block devices
188#
189# CONFIG_BLK_DEV_FD is not set
190# CONFIG_BLK_DEV_COW_COMMON is not set
191CONFIG_BLK_DEV_LOOP=y
192# CONFIG_BLK_DEV_CRYPTOLOOP is not set
193# CONFIG_BLK_DEV_NBD is not set
194CONFIG_BLK_DEV_RAM=y
195CONFIG_BLK_DEV_RAM_COUNT=16
196CONFIG_BLK_DEV_RAM_SIZE=8192
197CONFIG_BLK_DEV_INITRD=y
198CONFIG_INITRAMFS_SOURCE=""
199# CONFIG_CDROM_PKTCDVD is not set
200
201#
202# IO Schedulers
203#
204CONFIG_IOSCHED_NOOP=y
205CONFIG_IOSCHED_AS=y
206CONFIG_IOSCHED_DEADLINE=y
207CONFIG_IOSCHED_CFQ=y
208# CONFIG_ATA_OVER_ETH is not set
209
210#
211# SCSI device support
212#
213# CONFIG_SCSI is not set
214
215#
216# Multi-device support (RAID and LVM)
217#
218# CONFIG_MD is not set
219
220#
221# Fusion MPT device support
222#
223
224#
225# IEEE 1394 (FireWire) support
226#
227
228#
229# I2O device support
230#
231
232#
233# Networking support
234#
235CONFIG_NET=y
236
237#
238# Networking options
239#
240CONFIG_PACKET=y
241# CONFIG_PACKET_MMAP is not set
242# CONFIG_NETLINK_DEV is not set
243CONFIG_UNIX=y
244# CONFIG_NET_KEY is not set
245CONFIG_INET=y
246CONFIG_IP_MULTICAST=y
247# CONFIG_IP_ADVANCED_ROUTER is not set
248CONFIG_IP_PNP=y
249# CONFIG_IP_PNP_DHCP is not set
250# CONFIG_IP_PNP_BOOTP is not set
251# CONFIG_IP_PNP_RARP is not set
252# CONFIG_NET_IPIP is not set
253# CONFIG_NET_IPGRE is not set
254# CONFIG_IP_MROUTE is not set
255# CONFIG_ARPD is not set
256# CONFIG_SYN_COOKIES is not set
257# CONFIG_INET_AH is not set
258# CONFIG_INET_ESP is not set
259# CONFIG_INET_IPCOMP is not set
260# CONFIG_INET_TUNNEL is not set
261# CONFIG_IP_TCPDIAG is not set
262# CONFIG_IP_TCPDIAG_IPV6 is not set
263# CONFIG_IPV6 is not set
264# CONFIG_NETFILTER is not set
265
266#
267# SCTP Configuration (EXPERIMENTAL)
268#
269# CONFIG_IP_SCTP is not set
270# CONFIG_ATM is not set
271# CONFIG_BRIDGE is not set
272# CONFIG_VLAN_8021Q is not set
273# CONFIG_DECNET is not set
274# CONFIG_LLC2 is not set
275# CONFIG_IPX is not set
276# CONFIG_ATALK is not set
277# CONFIG_X25 is not set
278# CONFIG_LAPB is not set
279# CONFIG_NET_DIVERT is not set
280# CONFIG_ECONET is not set
281# CONFIG_WAN_ROUTER is not set
282
283#
284# QoS and/or fair queueing
285#
286# CONFIG_NET_SCHED is not set
287# CONFIG_NET_CLS_ROUTE is not set
288
289#
290# Network testing
291#
292# CONFIG_NET_PKTGEN is not set
293# CONFIG_NETPOLL is not set
294# CONFIG_NET_POLL_CONTROLLER is not set
295# CONFIG_HAMRADIO is not set
296# CONFIG_IRDA is not set
297# CONFIG_BT is not set
298CONFIG_NETDEVICES=y
299# CONFIG_DUMMY is not set
300# CONFIG_BONDING is not set
301# CONFIG_EQUALIZER is not set
302# CONFIG_TUN is not set
303
304#
305# Ethernet (10 or 100Mbit)
306#
307# CONFIG_NET_ETHERNET is not set
308
309#
310# Ethernet (1000 Mbit)
311#
312
313#
314# Ethernet (10000 Mbit)
315#
316
317#
318# Token Ring devices
319#
320
321#
322# Wireless LAN (non-hamradio)
323#
324# CONFIG_NET_RADIO is not set
325
326#
327# Wan interfaces
328#
329# CONFIG_WAN is not set
330CONFIG_PPP=y
331CONFIG_PPP_MULTILINK=y
332# CONFIG_PPP_FILTER is not set
333CONFIG_PPP_ASYNC=y
334CONFIG_PPP_SYNC_TTY=y
335CONFIG_PPP_DEFLATE=y
336# CONFIG_PPP_BSDCOMP is not set
337# CONFIG_PPPOE is not set
338# CONFIG_SLIP 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# Input device support
349#
350CONFIG_INPUT=y
351
352#
353# Userland interfaces
354#
355CONFIG_INPUT_MOUSEDEV=y
356CONFIG_INPUT_MOUSEDEV_PSAUX=y
357CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
358CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
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 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# Hardware I/O ports
375#
376CONFIG_SERIO=y
377CONFIG_SERIO_SERPORT=y
378# CONFIG_SERIO_RAW is not set
379# CONFIG_GAMEPORT is not set
380CONFIG_SOUND_GAMEPORT=y
381
382#
383# Character devices
384#
385CONFIG_VT=y
386CONFIG_VT_CONSOLE=y
387CONFIG_HW_CONSOLE=y
388# CONFIG_SERIAL_NONSTANDARD is not set
389
390#
391# Serial drivers
392#
393# CONFIG_SERIAL_8250 is not set
394
395#
396# Non-8250 serial port support
397#
398CONFIG_SERIAL_UART00=y
399CONFIG_SERIAL_UART00_CONSOLE=y
400CONFIG_SERIAL_CORE=y
401CONFIG_SERIAL_CORE_CONSOLE=y
402CONFIG_UNIX98_PTYS=y
403CONFIG_LEGACY_PTYS=y
404CONFIG_LEGACY_PTY_COUNT=256
405
406#
407# IPMI
408#
409# CONFIG_IPMI_HANDLER is not set
410
411#
412# Watchdog Cards
413#
414# CONFIG_WATCHDOG is not set
415# CONFIG_NVRAM is not set
416# CONFIG_RTC is not set
417# CONFIG_DTLK is not set
418# CONFIG_R3964 is not set
419
420#
421# Ftape, the floppy tape device driver
422#
423# CONFIG_DRM is not set
424# CONFIG_RAW_DRIVER is not set
425
426#
427# TPM devices
428#
429# CONFIG_TCG_TPM 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# Console display driver support
457#
458# CONFIG_VGA_CONSOLE is not set
459CONFIG_DUMMY_CONSOLE=y
460
461#
462# Sound
463#
464# CONFIG_SOUND is not set
465
466#
467# USB support
468#
469CONFIG_USB_ARCH_HAS_HCD=y
470# CONFIG_USB_ARCH_HAS_OHCI is not set
471# CONFIG_USB is not set
472
473#
474# USB Gadget Support
475#
476# CONFIG_USB_GADGET is not set
477
478#
479# MMC/SD Card support
480#
481# CONFIG_MMC is not set
482
483#
484# File systems
485#
486CONFIG_EXT2_FS=y
487# CONFIG_EXT2_FS_XATTR is not set
488# CONFIG_EXT3_FS is not set
489# CONFIG_JBD is not set
490# CONFIG_REISERFS_FS is not set
491# CONFIG_JFS_FS is not set
492
493#
494# XFS support
495#
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
500CONFIG_DNOTIFY=y
501CONFIG_AUTOFS_FS=y
502CONFIG_AUTOFS4_FS=y
503
504#
505# CD-ROM/DVD Filesystems
506#
507# CONFIG_ISO9660_FS is not set
508# CONFIG_UDF_FS is not set
509
510#
511# DOS/FAT/NT Filesystems
512#
513# CONFIG_MSDOS_FS is not set
514# CONFIG_VFAT_FS is not set
515# CONFIG_NTFS_FS is not set
516
517#
518# Pseudo filesystems
519#
520CONFIG_PROC_FS=y
521CONFIG_SYSFS=y
522# CONFIG_DEVFS_FS is not set
523# CONFIG_DEVPTS_FS_XATTR is not set
524# CONFIG_TMPFS is not set
525# CONFIG_HUGETLB_PAGE is not set
526CONFIG_RAMFS=y
527
528#
529# Miscellaneous filesystems
530#
531# CONFIG_ADFS_FS is not set
532# CONFIG_AFFS_FS is not set
533# CONFIG_HFS_FS is not set
534# CONFIG_HFSPLUS_FS is not set
535# CONFIG_BEFS_FS is not set
536# CONFIG_BFS_FS is not set
537# CONFIG_EFS_FS is not set
538# CONFIG_CRAMFS is not set
539# CONFIG_VXFS_FS is not set
540# CONFIG_HPFS_FS is not set
541# CONFIG_QNX4FS_FS is not set
542# CONFIG_SYSV_FS is not set
543# CONFIG_UFS_FS is not set
544
545#
546# Network File Systems
547#
548# CONFIG_NFS_FS is not set
549# CONFIG_NFSD is not set
550CONFIG_SMB_FS=y
551# CONFIG_SMB_NLS_DEFAULT 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_AFS_FS is not set
556
557#
558# Partition Types
559#
560# CONFIG_PARTITION_ADVANCED is not set
561CONFIG_MSDOS_PARTITION=y
562
563#
564# Native Language Support
565#
566CONFIG_NLS=y
567CONFIG_NLS_DEFAULT="iso8859-1"
568# CONFIG_NLS_CODEPAGE_437 is not set
569# CONFIG_NLS_CODEPAGE_737 is not set
570# CONFIG_NLS_CODEPAGE_775 is not set
571# CONFIG_NLS_CODEPAGE_850 is not set
572# CONFIG_NLS_CODEPAGE_852 is not set
573# CONFIG_NLS_CODEPAGE_855 is not set
574# CONFIG_NLS_CODEPAGE_857 is not set
575# CONFIG_NLS_CODEPAGE_860 is not set
576# CONFIG_NLS_CODEPAGE_861 is not set
577# CONFIG_NLS_CODEPAGE_862 is not set
578# CONFIG_NLS_CODEPAGE_863 is not set
579# CONFIG_NLS_CODEPAGE_864 is not set
580# CONFIG_NLS_CODEPAGE_865 is not set
581# CONFIG_NLS_CODEPAGE_866 is not set
582# CONFIG_NLS_CODEPAGE_869 is not set
583# CONFIG_NLS_CODEPAGE_936 is not set
584# CONFIG_NLS_CODEPAGE_950 is not set
585# CONFIG_NLS_CODEPAGE_932 is not set
586# CONFIG_NLS_CODEPAGE_949 is not set
587# CONFIG_NLS_CODEPAGE_874 is not set
588# CONFIG_NLS_ISO8859_8 is not set
589# CONFIG_NLS_CODEPAGE_1250 is not set
590# CONFIG_NLS_CODEPAGE_1251 is not set
591# CONFIG_NLS_ASCII is not set
592# CONFIG_NLS_ISO8859_1 is not set
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# Profiling support
609#
610# CONFIG_PROFILING is not set
611
612#
613# Kernel hacking
614#
615# CONFIG_PRINTK_TIME is not set
616# CONFIG_DEBUG_KERNEL is not set
617CONFIG_LOG_BUF_SHIFT=14
618CONFIG_DEBUG_BUGVERBOSE=y
619CONFIG_FRAME_POINTER=y
620# CONFIG_DEBUG_USER is not set
621
622#
623# Security options
624#
625# CONFIG_KEYS is not set
626# CONFIG_SECURITY is not set
627
628#
629# Cryptographic options
630#
631# CONFIG_CRYPTO is not set
632
633#
634# Hardware crypto devices
635#
636
637#
638# Library routines
639#
640CONFIG_CRC_CCITT=y
641CONFIG_CRC32=y
642# CONFIG_LIBCRC32C is not set
643CONFIG_ZLIB_INFLATE=y
644CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/footbridge_defconfig b/arch/arm/configs/footbridge_defconfig
new file mode 100644
index 000000000000..9737c4850721
--- /dev/null
+++ b/arch/arm/configs/footbridge_defconfig
@@ -0,0 +1,1257 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 23:02:24 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34CONFIG_EMBEDDED=y
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_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# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66# CONFIG_ARCH_CAMELOT is not set
67CONFIG_ARCH_FOOTBRIDGE=y
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73# CONFIG_ARCH_PXA is not set
74# CONFIG_ARCH_RPC is not set
75# CONFIG_ARCH_SA1100 is not set
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81# CONFIG_ARCH_IMX is not set
82# CONFIG_ARCH_H720X is not set
83
84#
85# Footbridge Implementations
86#
87CONFIG_ARCH_CATS=y
88CONFIG_ARCH_PERSONAL_SERVER=y
89# CONFIG_ARCH_EBSA285_ADDIN is not set
90CONFIG_ARCH_EBSA285_HOST=y
91CONFIG_ARCH_NETWINDER=y
92CONFIG_FOOTBRIDGE=y
93CONFIG_FOOTBRIDGE_HOST=y
94CONFIG_ARCH_EBSA285=y
95
96#
97# Processor Type
98#
99CONFIG_CPU_32=y
100CONFIG_CPU_SA110=y
101CONFIG_CPU_32v4=y
102CONFIG_CPU_ABRT_EV4=y
103CONFIG_CPU_CACHE_V4WB=y
104CONFIG_CPU_CACHE_VIVT=y
105CONFIG_CPU_COPY_V4WB=y
106CONFIG_CPU_TLB_V4WB=y
107
108#
109# Processor Features
110#
111
112#
113# Bus support
114#
115CONFIG_ISA=y
116CONFIG_ISA_DMA=y
117CONFIG_PCI=y
118# CONFIG_PCI_LEGACY_PROC is not set
119CONFIG_PCI_NAMES=y
120
121#
122# PCCARD (PCMCIA/CardBus) support
123#
124# CONFIG_PCCARD is not set
125
126#
127# Kernel Features
128#
129# CONFIG_PREEMPT is not set
130CONFIG_LEDS=y
131CONFIG_LEDS_TIMER=y
132# CONFIG_LEDS_CPU is not set
133CONFIG_ALIGNMENT_TRAP=y
134
135#
136# Boot options
137#
138CONFIG_ZBOOT_ROM_TEXT=0x0
139CONFIG_ZBOOT_ROM_BSS=0x0
140CONFIG_CMDLINE=""
141# CONFIG_XIP_KERNEL is not set
142
143#
144# Floating point emulation
145#
146
147#
148# At least one emulation must be selected
149#
150CONFIG_FPE_NWFPE=y
151CONFIG_FPE_NWFPE_XP=y
152# CONFIG_FPE_FASTFPE is not set
153
154#
155# Userspace binary formats
156#
157CONFIG_BINFMT_ELF=y
158CONFIG_BINFMT_AOUT=y
159# CONFIG_BINFMT_MISC is not set
160# CONFIG_ARTHUR is not set
161
162#
163# Power management options
164#
165# CONFIG_PM is not set
166
167#
168# Device Drivers
169#
170
171#
172# Generic Driver Options
173#
174CONFIG_STANDALONE=y
175CONFIG_PREVENT_FIRMWARE_BUILD=y
176# CONFIG_FW_LOADER is not set
177
178#
179# Memory Technology Devices (MTD)
180#
181# CONFIG_MTD is not set
182
183#
184# Parallel port support
185#
186CONFIG_PARPORT=y
187CONFIG_PARPORT_PC=y
188CONFIG_PARPORT_PC_FIFO=y
189# CONFIG_PARPORT_PC_SUPERIO is not set
190# CONFIG_PARPORT_ARC is not set
191# CONFIG_PARPORT_GSC is not set
192CONFIG_PARPORT_1284=y
193
194#
195# Plug and Play support
196#
197CONFIG_PNP=y
198# CONFIG_PNP_DEBUG is not set
199
200#
201# Protocols
202#
203CONFIG_ISAPNP=y
204
205#
206# Block devices
207#
208# CONFIG_BLK_DEV_FD is not set
209# CONFIG_BLK_DEV_XD is not set
210CONFIG_PARIDE=m
211CONFIG_PARIDE_PARPORT=y
212
213#
214# Parallel IDE high-level drivers
215#
216CONFIG_PARIDE_PD=m
217CONFIG_PARIDE_PCD=m
218CONFIG_PARIDE_PF=m
219CONFIG_PARIDE_PT=m
220CONFIG_PARIDE_PG=m
221
222#
223# Parallel IDE protocol modules
224#
225CONFIG_PARIDE_ATEN=m
226CONFIG_PARIDE_BPCK=m
227# CONFIG_PARIDE_BPCK6 is not set
228CONFIG_PARIDE_COMM=m
229CONFIG_PARIDE_DSTR=m
230CONFIG_PARIDE_FIT2=m
231CONFIG_PARIDE_FIT3=m
232CONFIG_PARIDE_EPAT=m
233# CONFIG_PARIDE_EPATC8 is not set
234CONFIG_PARIDE_EPIA=m
235CONFIG_PARIDE_FRIQ=m
236CONFIG_PARIDE_FRPW=m
237CONFIG_PARIDE_KBIC=m
238CONFIG_PARIDE_KTTI=m
239CONFIG_PARIDE_ON20=m
240CONFIG_PARIDE_ON26=m
241# CONFIG_BLK_CPQ_DA is not set
242# CONFIG_BLK_CPQ_CISS_DA is not set
243# CONFIG_BLK_DEV_DAC960 is not set
244# CONFIG_BLK_DEV_UMEM is not set
245# CONFIG_BLK_DEV_COW_COMMON is not set
246CONFIG_BLK_DEV_LOOP=m
247# CONFIG_BLK_DEV_CRYPTOLOOP is not set
248CONFIG_BLK_DEV_NBD=m
249# CONFIG_BLK_DEV_SX8 is not set
250# CONFIG_BLK_DEV_UB is not set
251CONFIG_BLK_DEV_RAM=y
252CONFIG_BLK_DEV_RAM_COUNT=16
253CONFIG_BLK_DEV_RAM_SIZE=4096
254CONFIG_BLK_DEV_INITRD=y
255CONFIG_INITRAMFS_SOURCE=""
256# CONFIG_CDROM_PKTCDVD is not set
257
258#
259# IO Schedulers
260#
261CONFIG_IOSCHED_NOOP=y
262CONFIG_IOSCHED_AS=y
263CONFIG_IOSCHED_DEADLINE=y
264CONFIG_IOSCHED_CFQ=y
265# CONFIG_ATA_OVER_ETH is not set
266
267#
268# ATA/ATAPI/MFM/RLL support
269#
270CONFIG_IDE=y
271CONFIG_BLK_DEV_IDE=y
272
273#
274# Please see Documentation/ide.txt for help/info on IDE drives
275#
276# CONFIG_BLK_DEV_IDE_SATA is not set
277CONFIG_BLK_DEV_IDEDISK=y
278CONFIG_IDEDISK_MULTI_MODE=y
279# CONFIG_BLK_DEV_IDECD is not set
280# CONFIG_BLK_DEV_IDETAPE is not set
281# CONFIG_BLK_DEV_IDEFLOPPY is not set
282# CONFIG_IDE_TASK_IOCTL is not set
283
284#
285# IDE chipset support/bugfixes
286#
287CONFIG_IDE_GENERIC=y
288# CONFIG_BLK_DEV_IDEPNP is not set
289# CONFIG_BLK_DEV_IDEPCI is not set
290# CONFIG_IDE_ARM is not set
291# CONFIG_IDE_CHIPSETS is not set
292# CONFIG_BLK_DEV_IDEDMA is not set
293# CONFIG_IDEDMA_AUTO is not set
294# CONFIG_BLK_DEV_HD is not set
295
296#
297# SCSI device support
298#
299# CONFIG_SCSI is not set
300
301#
302# Multi-device support (RAID and LVM)
303#
304# CONFIG_MD is not set
305
306#
307# Fusion MPT device support
308#
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# Networking support
322#
323CONFIG_NET=y
324
325#
326# Networking options
327#
328CONFIG_PACKET=y
329CONFIG_PACKET_MMAP=y
330# CONFIG_NETLINK_DEV is not set
331CONFIG_UNIX=y
332# CONFIG_NET_KEY is not set
333CONFIG_INET=y
334CONFIG_IP_MULTICAST=y
335# CONFIG_IP_ADVANCED_ROUTER is not set
336CONFIG_IP_PNP=y
337# CONFIG_IP_PNP_DHCP is not set
338CONFIG_IP_PNP_BOOTP=y
339# CONFIG_IP_PNP_RARP is not set
340# CONFIG_NET_IPIP is not set
341# CONFIG_NET_IPGRE is not set
342# CONFIG_IP_MROUTE is not set
343# CONFIG_ARPD is not set
344CONFIG_SYN_COOKIES=y
345# CONFIG_INET_AH is not set
346# CONFIG_INET_ESP is not set
347# CONFIG_INET_IPCOMP is not set
348# CONFIG_INET_TUNNEL is not set
349# CONFIG_IP_TCPDIAG is not set
350# CONFIG_IP_TCPDIAG_IPV6 is not set
351# CONFIG_IPV6 is not set
352# CONFIG_NETFILTER is not set
353
354#
355# SCTP Configuration (EXPERIMENTAL)
356#
357# CONFIG_IP_SCTP is not set
358CONFIG_ATM=y
359# CONFIG_ATM_CLIP is not set
360# CONFIG_ATM_LANE is not set
361# CONFIG_ATM_BR2684 is not set
362# CONFIG_BRIDGE is not set
363# CONFIG_VLAN_8021Q is not set
364# CONFIG_DECNET 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
374#
375# QoS and/or fair queueing
376#
377# CONFIG_NET_SCHED is not set
378# CONFIG_NET_CLS_ROUTE is not set
379
380#
381# Network testing
382#
383# CONFIG_NET_PKTGEN is not set
384# CONFIG_NETPOLL is not set
385# CONFIG_NET_POLL_CONTROLLER is not set
386# CONFIG_HAMRADIO is not set
387CONFIG_IRDA=m
388
389#
390# IrDA protocols
391#
392CONFIG_IRLAN=m
393CONFIG_IRNET=m
394CONFIG_IRCOMM=m
395CONFIG_IRDA_ULTRA=y
396
397#
398# IrDA options
399#
400CONFIG_IRDA_CACHE_LAST_LSAP=y
401CONFIG_IRDA_FAST_RR=y
402CONFIG_IRDA_DEBUG=y
403
404#
405# Infrared-port device drivers
406#
407
408#
409# SIR device drivers
410#
411# CONFIG_IRTTY_SIR is not set
412
413#
414# Dongle support
415#
416
417#
418# Old SIR device drivers
419#
420# CONFIG_IRPORT_SIR is not set
421
422#
423# Old Serial dongle support
424#
425
426#
427# FIR device drivers
428#
429# CONFIG_USB_IRDA is not set
430# CONFIG_SIGMATEL_FIR is not set
431# CONFIG_NSC_FIR is not set
432CONFIG_WINBOND_FIR=m
433# CONFIG_TOSHIBA_FIR is not set
434# CONFIG_SMC_IRCC_FIR is not set
435# CONFIG_ALI_FIR is not set
436# CONFIG_VLSI_FIR is not set
437# CONFIG_VIA_FIR is not set
438# CONFIG_BT is not set
439CONFIG_NETDEVICES=y
440# CONFIG_DUMMY is not set
441# CONFIG_BONDING is not set
442# CONFIG_EQUALIZER is not set
443# CONFIG_TUN is not set
444# CONFIG_NET_SB1000 is not set
445
446#
447# ARCnet devices
448#
449# CONFIG_ARCNET is not set
450
451#
452# Ethernet (10 or 100Mbit)
453#
454CONFIG_NET_ETHERNET=y
455CONFIG_MII=y
456# CONFIG_HAPPYMEAL is not set
457# CONFIG_SUNGEM is not set
458CONFIG_NET_VENDOR_3COM=y
459# CONFIG_EL1 is not set
460# CONFIG_EL2 is not set
461# CONFIG_ELPLUS is not set
462# CONFIG_EL16 is not set
463# CONFIG_EL3 is not set
464# CONFIG_3C515 is not set
465CONFIG_VORTEX=y
466# CONFIG_TYPHOON is not set
467# CONFIG_LANCE is not set
468# CONFIG_NET_VENDOR_SMC is not set
469# CONFIG_SMC91X is not set
470# CONFIG_NET_VENDOR_RACAL is not set
471
472#
473# Tulip family network device support
474#
475# CONFIG_NET_TULIP is not set
476# CONFIG_AT1700 is not set
477# CONFIG_DEPCA is not set
478# CONFIG_HP100 is not set
479# CONFIG_NET_ISA is not set
480CONFIG_NET_PCI=y
481# CONFIG_PCNET32 is not set
482# CONFIG_AMD8111_ETH is not set
483# CONFIG_ADAPTEC_STARFIRE is not set
484# CONFIG_AC3200 is not set
485# CONFIG_APRICOT is not set
486# CONFIG_B44 is not set
487# CONFIG_FORCEDETH is not set
488# CONFIG_CS89x0 is not set
489# CONFIG_DGRS is not set
490# CONFIG_EEPRO100 is not set
491# CONFIG_E100 is not set
492# CONFIG_FEALNX is not set
493# CONFIG_NATSEMI is not set
494CONFIG_NE2K_PCI=y
495# CONFIG_8139CP is not set
496# CONFIG_8139TOO is not set
497# CONFIG_SIS900 is not set
498# CONFIG_EPIC100 is not set
499# CONFIG_SUNDANCE is not set
500# CONFIG_TLAN is not set
501# CONFIG_VIA_RHINE is not set
502# CONFIG_NET_POCKET is not set
503
504#
505# Ethernet (1000 Mbit)
506#
507# CONFIG_ACENIC is not set
508# CONFIG_DL2K is not set
509# CONFIG_E1000 is not set
510# CONFIG_NS83820 is not set
511# CONFIG_HAMACHI is not set
512# CONFIG_YELLOWFIN is not set
513# CONFIG_R8169 is not set
514# CONFIG_SK98LIN is not set
515# CONFIG_VIA_VELOCITY is not set
516# CONFIG_TIGON3 is not set
517
518#
519# Ethernet (10000 Mbit)
520#
521# CONFIG_IXGB is not set
522# CONFIG_S2IO is not set
523
524#
525# Token Ring devices
526#
527# CONFIG_TR is not set
528
529#
530# Wireless LAN (non-hamradio)
531#
532# CONFIG_NET_RADIO is not set
533
534#
535# Wan interfaces
536#
537# CONFIG_WAN is not set
538
539#
540# ATM drivers
541#
542# CONFIG_ATM_TCP is not set
543# CONFIG_ATM_LANAI is not set
544# CONFIG_ATM_ENI is not set
545# CONFIG_ATM_FIRESTREAM is not set
546# CONFIG_ATM_ZATM is not set
547# CONFIG_ATM_NICSTAR is not set
548# CONFIG_ATM_IDT77252 is not set
549# CONFIG_ATM_AMBASSADOR is not set
550# CONFIG_ATM_HORIZON is not set
551# CONFIG_ATM_IA is not set
552# CONFIG_ATM_FORE200E_MAYBE is not set
553# CONFIG_ATM_HE is not set
554# CONFIG_FDDI is not set
555# CONFIG_HIPPI is not set
556# CONFIG_PLIP is not set
557CONFIG_PPP=m
558# CONFIG_PPP_MULTILINK is not set
559# CONFIG_PPP_FILTER is not set
560CONFIG_PPP_ASYNC=m
561# CONFIG_PPP_SYNC_TTY is not set
562CONFIG_PPP_DEFLATE=m
563CONFIG_PPP_BSDCOMP=m
564CONFIG_PPPOE=m
565# CONFIG_PPPOATM is not set
566CONFIG_SLIP=m
567CONFIG_SLIP_COMPRESSED=y
568CONFIG_SLIP_SMART=y
569CONFIG_SLIP_MODE_SLIP6=y
570# CONFIG_SHAPER is not set
571# CONFIG_NETCONSOLE is not set
572
573#
574# ISDN subsystem
575#
576# CONFIG_ISDN is not set
577
578#
579# Input device support
580#
581CONFIG_INPUT=y
582
583#
584# Userland interfaces
585#
586CONFIG_INPUT_MOUSEDEV=y
587CONFIG_INPUT_MOUSEDEV_PSAUX=y
588CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
589CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
590# CONFIG_INPUT_JOYDEV is not set
591# CONFIG_INPUT_TSDEV is not set
592# CONFIG_INPUT_EVDEV is not set
593# CONFIG_INPUT_EVBUG is not set
594
595#
596# Input Device Drivers
597#
598CONFIG_INPUT_KEYBOARD=y
599CONFIG_KEYBOARD_ATKBD=y
600# CONFIG_KEYBOARD_SUNKBD is not set
601# CONFIG_KEYBOARD_LKKBD is not set
602# CONFIG_KEYBOARD_XTKBD is not set
603# CONFIG_KEYBOARD_NEWTON is not set
604CONFIG_INPUT_MOUSE=y
605CONFIG_MOUSE_PS2=y
606# CONFIG_MOUSE_SERIAL is not set
607# CONFIG_MOUSE_INPORT is not set
608# CONFIG_MOUSE_LOGIBM is not set
609# CONFIG_MOUSE_PC110PAD is not set
610# CONFIG_MOUSE_VSXXXAA is not set
611# CONFIG_INPUT_JOYSTICK is not set
612# CONFIG_INPUT_TOUCHSCREEN is not set
613# CONFIG_INPUT_MISC is not set
614
615#
616# Hardware I/O ports
617#
618CONFIG_SERIO=y
619CONFIG_SERIO_I8042=y
620CONFIG_SERIO_SERPORT=y
621# CONFIG_SERIO_PARKBD is not set
622# CONFIG_SERIO_PCIPS2 is not set
623CONFIG_SERIO_LIBPS2=y
624# CONFIG_SERIO_RAW is not set
625# CONFIG_GAMEPORT is not set
626CONFIG_SOUND_GAMEPORT=y
627
628#
629# Character devices
630#
631CONFIG_VT=y
632CONFIG_VT_CONSOLE=y
633CONFIG_HW_CONSOLE=y
634CONFIG_SERIAL_NONSTANDARD=y
635# CONFIG_COMPUTONE is not set
636# CONFIG_ROCKETPORT is not set
637# CONFIG_CYCLADES is not set
638# CONFIG_DIGIEPCA is not set
639# CONFIG_ESPSERIAL is not set
640# CONFIG_MOXA_INTELLIO is not set
641# CONFIG_MOXA_SMARTIO is not set
642# CONFIG_ISI is not set
643# CONFIG_SYNCLINK is not set
644# CONFIG_SYNCLINKMP is not set
645# CONFIG_N_HDLC is not set
646# CONFIG_RISCOM8 is not set
647# CONFIG_SPECIALIX is not set
648# CONFIG_SX is not set
649# CONFIG_RIO is not set
650# CONFIG_STALDRV is not set
651
652#
653# Serial drivers
654#
655# CONFIG_SERIAL_8250 is not set
656
657#
658# Non-8250 serial port support
659#
660CONFIG_SERIAL_21285=y
661CONFIG_SERIAL_21285_CONSOLE=y
662CONFIG_SERIAL_CORE=y
663CONFIG_SERIAL_CORE_CONSOLE=y
664CONFIG_UNIX98_PTYS=y
665CONFIG_LEGACY_PTYS=y
666CONFIG_LEGACY_PTY_COUNT=256
667CONFIG_PRINTER=m
668# CONFIG_LP_CONSOLE is not set
669# CONFIG_PPDEV is not set
670# CONFIG_TIPAR is not set
671
672#
673# IPMI
674#
675# CONFIG_IPMI_HANDLER is not set
676
677#
678# Watchdog Cards
679#
680CONFIG_WATCHDOG=y
681# CONFIG_WATCHDOG_NOWAYOUT is not set
682
683#
684# Watchdog Device Drivers
685#
686CONFIG_SOFT_WATCHDOG=y
687CONFIG_21285_WATCHDOG=m
688CONFIG_977_WATCHDOG=m
689
690#
691# ISA-based Watchdog Cards
692#
693# CONFIG_PCWATCHDOG is not set
694# CONFIG_MIXCOMWD is not set
695# CONFIG_WDT is not set
696
697#
698# PCI-based Watchdog Cards
699#
700# CONFIG_PCIPCWATCHDOG is not set
701# CONFIG_WDTPCI is not set
702
703#
704# USB-based Watchdog Cards
705#
706# CONFIG_USBPCWATCHDOG is not set
707CONFIG_DS1620=y
708CONFIG_NWBUTTON=y
709CONFIG_NWBUTTON_REBOOT=y
710CONFIG_NWFLASH=m
711CONFIG_NVRAM=m
712CONFIG_RTC=y
713# CONFIG_DTLK is not set
714# CONFIG_R3964 is not set
715# CONFIG_APPLICOM is not set
716
717#
718# Ftape, the floppy tape device driver
719#
720# CONFIG_DRM is not set
721# CONFIG_RAW_DRIVER is not set
722
723#
724# TPM devices
725#
726# CONFIG_TCG_TPM is not set
727
728#
729# I2C support
730#
731CONFIG_I2C=m
732# CONFIG_I2C_CHARDEV is not set
733
734#
735# I2C Algorithms
736#
737# CONFIG_I2C_ALGOBIT is not set
738# CONFIG_I2C_ALGOPCF is not set
739# CONFIG_I2C_ALGOPCA is not set
740
741#
742# I2C Hardware Bus support
743#
744# CONFIG_I2C_ALI1535 is not set
745# CONFIG_I2C_ALI1563 is not set
746# CONFIG_I2C_ALI15X3 is not set
747# CONFIG_I2C_AMD756 is not set
748# CONFIG_I2C_AMD8111 is not set
749# CONFIG_I2C_ELEKTOR is not set
750# CONFIG_I2C_I801 is not set
751# CONFIG_I2C_I810 is not set
752# CONFIG_I2C_ISA is not set
753# CONFIG_I2C_NFORCE2 is not set
754# CONFIG_I2C_PARPORT is not set
755# CONFIG_I2C_PARPORT_LIGHT is not set
756# CONFIG_I2C_PIIX4 is not set
757# CONFIG_I2C_PROSAVAGE is not set
758# CONFIG_I2C_SAVAGE4 is not set
759# CONFIG_SCx200_ACB is not set
760# CONFIG_I2C_SIS5595 is not set
761# CONFIG_I2C_SIS630 is not set
762# CONFIG_I2C_SIS96X is not set
763# CONFIG_I2C_STUB is not set
764# CONFIG_I2C_VIA is not set
765# CONFIG_I2C_VIAPRO is not set
766# CONFIG_I2C_VOODOO3 is not set
767# CONFIG_I2C_PCA_ISA is not set
768
769#
770# Hardware Sensors Chip support
771#
772# CONFIG_I2C_SENSOR is not set
773# CONFIG_SENSORS_ADM1021 is not set
774# CONFIG_SENSORS_ADM1025 is not set
775# CONFIG_SENSORS_ADM1026 is not set
776# CONFIG_SENSORS_ADM1031 is not set
777# CONFIG_SENSORS_ASB100 is not set
778# CONFIG_SENSORS_DS1621 is not set
779# CONFIG_SENSORS_FSCHER is not set
780# CONFIG_SENSORS_FSCPOS is not set
781# CONFIG_SENSORS_GL518SM is not set
782# CONFIG_SENSORS_GL520SM is not set
783# CONFIG_SENSORS_IT87 is not set
784# CONFIG_SENSORS_LM63 is not set
785# CONFIG_SENSORS_LM75 is not set
786# CONFIG_SENSORS_LM77 is not set
787# CONFIG_SENSORS_LM78 is not set
788# CONFIG_SENSORS_LM80 is not set
789# CONFIG_SENSORS_LM83 is not set
790# CONFIG_SENSORS_LM85 is not set
791# CONFIG_SENSORS_LM87 is not set
792# CONFIG_SENSORS_LM90 is not set
793# CONFIG_SENSORS_MAX1619 is not set
794# CONFIG_SENSORS_PC87360 is not set
795# CONFIG_SENSORS_SMSC47B397 is not set
796# CONFIG_SENSORS_SIS5595 is not set
797# CONFIG_SENSORS_SMSC47M1 is not set
798# CONFIG_SENSORS_VIA686A is not set
799# CONFIG_SENSORS_W83781D is not set
800# CONFIG_SENSORS_W83L785TS is not set
801# CONFIG_SENSORS_W83627HF is not set
802
803#
804# Other I2C Chip support
805#
806# CONFIG_SENSORS_EEPROM is not set
807# CONFIG_SENSORS_PCF8574 is not set
808# CONFIG_SENSORS_PCF8591 is not set
809# CONFIG_SENSORS_RTC8564 is not set
810# CONFIG_I2C_DEBUG_CORE is not set
811# CONFIG_I2C_DEBUG_ALGO is not set
812# CONFIG_I2C_DEBUG_BUS is not set
813# CONFIG_I2C_DEBUG_CHIP is not set
814
815#
816# Misc devices
817#
818
819#
820# Multimedia devices
821#
822CONFIG_VIDEO_DEV=m
823
824#
825# Video For Linux
826#
827
828#
829# Video Adapters
830#
831# CONFIG_VIDEO_BT848 is not set
832# CONFIG_VIDEO_PMS is not set
833# CONFIG_VIDEO_BWQCAM is not set
834# CONFIG_VIDEO_CQCAM is not set
835# CONFIG_VIDEO_W9966 is not set
836# CONFIG_VIDEO_CPIA is not set
837# CONFIG_VIDEO_SAA5246A is not set
838# CONFIG_VIDEO_SAA5249 is not set
839# CONFIG_TUNER_3036 is not set
840# CONFIG_VIDEO_STRADIS is not set
841# CONFIG_VIDEO_SAA7134 is not set
842# CONFIG_VIDEO_MXB is not set
843# CONFIG_VIDEO_DPC is not set
844# CONFIG_VIDEO_HEXIUM_ORION is not set
845# CONFIG_VIDEO_HEXIUM_GEMINI is not set
846# CONFIG_VIDEO_CX88 is not set
847# CONFIG_VIDEO_OVCAMCHIP is not set
848
849#
850# Radio Adapters
851#
852# CONFIG_RADIO_CADET is not set
853# CONFIG_RADIO_RTRACK is not set
854# CONFIG_RADIO_RTRACK2 is not set
855# CONFIG_RADIO_AZTECH is not set
856# CONFIG_RADIO_GEMTEK is not set
857# CONFIG_RADIO_GEMTEK_PCI is not set
858# CONFIG_RADIO_MAXIRADIO is not set
859# CONFIG_RADIO_MAESTRO is not set
860# CONFIG_RADIO_SF16FMI is not set
861# CONFIG_RADIO_SF16FMR2 is not set
862# CONFIG_RADIO_TERRATEC is not set
863# CONFIG_RADIO_TRUST is not set
864# CONFIG_RADIO_TYPHOON is not set
865# CONFIG_RADIO_ZOLTRIX is not set
866
867#
868# Digital Video Broadcasting Devices
869#
870# CONFIG_DVB is not set
871
872#
873# Graphics support
874#
875CONFIG_FB=y
876CONFIG_FB_CFB_FILLRECT=y
877CONFIG_FB_CFB_COPYAREA=y
878CONFIG_FB_CFB_IMAGEBLIT=y
879CONFIG_FB_SOFT_CURSOR=y
880# CONFIG_FB_MODE_HELPERS is not set
881# CONFIG_FB_TILEBLITTING is not set
882# CONFIG_FB_CIRRUS is not set
883# CONFIG_FB_PM2 is not set
884CONFIG_FB_CYBER2000=y
885# CONFIG_FB_ASILIANT is not set
886# CONFIG_FB_IMSTT is not set
887# CONFIG_FB_NVIDIA is not set
888# CONFIG_FB_RIVA is not set
889# CONFIG_FB_MATROX is not set
890# CONFIG_FB_RADEON_OLD is not set
891# CONFIG_FB_RADEON is not set
892# CONFIG_FB_ATY128 is not set
893# CONFIG_FB_ATY is not set
894# CONFIG_FB_SAVAGE is not set
895# CONFIG_FB_SIS is not set
896# CONFIG_FB_NEOMAGIC is not set
897# CONFIG_FB_KYRO is not set
898# CONFIG_FB_3DFX is not set
899# CONFIG_FB_VOODOO1 is not set
900# CONFIG_FB_TRIDENT is not set
901# CONFIG_FB_VIRTUAL is not set
902
903#
904# Console display driver support
905#
906CONFIG_VGA_CONSOLE=y
907# CONFIG_MDA_CONSOLE is not set
908CONFIG_DUMMY_CONSOLE=y
909# CONFIG_FRAMEBUFFER_CONSOLE is not set
910
911#
912# Logo configuration
913#
914# CONFIG_LOGO is not set
915# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
916
917#
918# Sound
919#
920CONFIG_SOUND=m
921
922#
923# Advanced Linux Sound Architecture
924#
925# CONFIG_SND is not set
926
927#
928# Open Sound System
929#
930# CONFIG_SOUND_PRIME is not set
931
932#
933# USB support
934#
935CONFIG_USB_ARCH_HAS_HCD=y
936CONFIG_USB_ARCH_HAS_OHCI=y
937CONFIG_USB=m
938CONFIG_USB_DEBUG=y
939
940#
941# Miscellaneous USB options
942#
943CONFIG_USB_DEVICEFS=y
944# CONFIG_USB_BANDWIDTH is not set
945# CONFIG_USB_DYNAMIC_MINORS is not set
946# CONFIG_USB_OTG is not set
947
948#
949# USB Host Controller Drivers
950#
951# CONFIG_USB_EHCI_HCD is not set
952# CONFIG_USB_OHCI_HCD is not set
953# CONFIG_USB_UHCI_HCD is not set
954# CONFIG_USB_SL811_HCD is not set
955
956#
957# USB Device Class drivers
958#
959CONFIG_USB_AUDIO=m
960# CONFIG_USB_BLUETOOTH_TTY is not set
961# CONFIG_USB_MIDI is not set
962# CONFIG_USB_ACM is not set
963CONFIG_USB_PRINTER=m
964
965#
966# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
967#
968# CONFIG_USB_STORAGE is not set
969
970#
971# USB Input Devices
972#
973# CONFIG_USB_HID is not set
974
975#
976# USB HID Boot Protocol drivers
977#
978# CONFIG_USB_KBD is not set
979# CONFIG_USB_MOUSE is not set
980# CONFIG_USB_AIPTEK is not set
981# CONFIG_USB_WACOM is not set
982# CONFIG_USB_KBTAB is not set
983# CONFIG_USB_POWERMATE is not set
984# CONFIG_USB_MTOUCH is not set
985# CONFIG_USB_EGALAX is not set
986# CONFIG_USB_XPAD is not set
987# CONFIG_USB_ATI_REMOTE is not set
988
989#
990# USB Imaging devices
991#
992# CONFIG_USB_MDC800 is not set
993
994#
995# USB Multimedia devices
996#
997# CONFIG_USB_DABUSB is not set
998# CONFIG_USB_VICAM is not set
999# CONFIG_USB_DSBR is not set
1000# CONFIG_USB_IBMCAM is not set
1001# CONFIG_USB_KONICAWC is not set
1002# CONFIG_USB_OV511 is not set
1003# CONFIG_USB_SE401 is not set
1004# CONFIG_USB_SN9C102 is not set
1005# CONFIG_USB_STV680 is not set
1006# CONFIG_USB_PWC is not set
1007
1008#
1009# USB Network Adapters
1010#
1011# CONFIG_USB_CATC is not set
1012# CONFIG_USB_KAWETH is not set
1013# CONFIG_USB_PEGASUS is not set
1014# CONFIG_USB_RTL8150 is not set
1015# CONFIG_USB_USBNET is not set
1016CONFIG_USB_MON=m
1017
1018#
1019# USB port drivers
1020#
1021# CONFIG_USB_USS720 is not set
1022
1023#
1024# USB Serial Converter support
1025#
1026# CONFIG_USB_SERIAL is not set
1027
1028#
1029# USB Miscellaneous drivers
1030#
1031# CONFIG_USB_EMI62 is not set
1032# CONFIG_USB_EMI26 is not set
1033# CONFIG_USB_AUERSWALD is not set
1034# CONFIG_USB_RIO500 is not set
1035# CONFIG_USB_LEGOTOWER is not set
1036# CONFIG_USB_LCD is not set
1037# CONFIG_USB_LED is not set
1038# CONFIG_USB_CYTHERM is not set
1039# CONFIG_USB_PHIDGETKIT is not set
1040# CONFIG_USB_PHIDGETSERVO is not set
1041# CONFIG_USB_IDMOUSE is not set
1042# CONFIG_USB_TEST is not set
1043
1044#
1045# USB ATM/DSL drivers
1046#
1047# CONFIG_USB_ATM is not set
1048# CONFIG_USB_SPEEDTOUCH is not set
1049
1050#
1051# USB Gadget Support
1052#
1053# CONFIG_USB_GADGET is not set
1054
1055#
1056# MMC/SD Card support
1057#
1058# CONFIG_MMC is not set
1059
1060#
1061# File systems
1062#
1063CONFIG_EXT2_FS=y
1064# CONFIG_EXT2_FS_XATTR is not set
1065# CONFIG_EXT3_FS is not set
1066# CONFIG_JBD is not set
1067# CONFIG_REISERFS_FS is not set
1068# CONFIG_JFS_FS is not set
1069
1070#
1071# XFS support
1072#
1073# CONFIG_XFS_FS is not set
1074# CONFIG_MINIX_FS is not set
1075# CONFIG_ROMFS_FS is not set
1076# CONFIG_QUOTA is not set
1077CONFIG_DNOTIFY=y
1078# CONFIG_AUTOFS_FS is not set
1079CONFIG_AUTOFS4_FS=y
1080
1081#
1082# CD-ROM/DVD Filesystems
1083#
1084CONFIG_ISO9660_FS=m
1085CONFIG_JOLIET=y
1086# CONFIG_ZISOFS is not set
1087# CONFIG_UDF_FS is not set
1088
1089#
1090# DOS/FAT/NT Filesystems
1091#
1092CONFIG_FAT_FS=m
1093CONFIG_MSDOS_FS=m
1094CONFIG_VFAT_FS=m
1095CONFIG_FAT_DEFAULT_CODEPAGE=437
1096CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1097# CONFIG_NTFS_FS is not set
1098
1099#
1100# Pseudo filesystems
1101#
1102CONFIG_PROC_FS=y
1103CONFIG_SYSFS=y
1104# CONFIG_DEVFS_FS is not set
1105# CONFIG_DEVPTS_FS_XATTR is not set
1106# CONFIG_TMPFS is not set
1107# CONFIG_HUGETLB_PAGE is not set
1108CONFIG_RAMFS=y
1109
1110#
1111# Miscellaneous filesystems
1112#
1113CONFIG_ADFS_FS=m
1114# CONFIG_ADFS_FS_RW is not set
1115# CONFIG_AFFS_FS is not set
1116# CONFIG_HFS_FS is not set
1117# CONFIG_HFSPLUS_FS is not set
1118# CONFIG_BEFS_FS is not set
1119# CONFIG_BFS_FS is not set
1120# CONFIG_EFS_FS is not set
1121# CONFIG_CRAMFS is not set
1122# CONFIG_VXFS_FS is not set
1123# CONFIG_HPFS_FS is not set
1124# CONFIG_QNX4FS_FS is not set
1125# CONFIG_SYSV_FS is not set
1126# CONFIG_UFS_FS is not set
1127
1128#
1129# Network File Systems
1130#
1131CONFIG_NFS_FS=y
1132# CONFIG_NFS_V3 is not set
1133# CONFIG_NFS_V4 is not set
1134# CONFIG_NFS_DIRECTIO is not set
1135CONFIG_NFSD=m
1136# CONFIG_NFSD_V3 is not set
1137CONFIG_NFSD_TCP=y
1138CONFIG_ROOT_NFS=y
1139CONFIG_LOCKD=y
1140CONFIG_EXPORTFS=m
1141CONFIG_SUNRPC=y
1142# CONFIG_RPCSEC_GSS_KRB5 is not set
1143# CONFIG_RPCSEC_GSS_SPKM3 is not set
1144# CONFIG_SMB_FS is not set
1145# CONFIG_CIFS is not set
1146# CONFIG_NCP_FS is not set
1147# CONFIG_CODA_FS is not set
1148# CONFIG_AFS_FS is not set
1149
1150#
1151# Partition Types
1152#
1153CONFIG_PARTITION_ADVANCED=y
1154CONFIG_ACORN_PARTITION=y
1155# CONFIG_ACORN_PARTITION_CUMANA is not set
1156# CONFIG_ACORN_PARTITION_EESOX is not set
1157# CONFIG_ACORN_PARTITION_ICS is not set
1158CONFIG_ACORN_PARTITION_ADFS=y
1159# CONFIG_ACORN_PARTITION_POWERTEC is not set
1160# CONFIG_ACORN_PARTITION_RISCIX is not set
1161# CONFIG_OSF_PARTITION is not set
1162# CONFIG_AMIGA_PARTITION is not set
1163# CONFIG_ATARI_PARTITION is not set
1164# CONFIG_MAC_PARTITION is not set
1165CONFIG_MSDOS_PARTITION=y
1166# CONFIG_BSD_DISKLABEL is not set
1167# CONFIG_MINIX_SUBPARTITION is not set
1168# CONFIG_SOLARIS_X86_PARTITION is not set
1169# CONFIG_UNIXWARE_DISKLABEL is not set
1170# CONFIG_LDM_PARTITION is not set
1171# CONFIG_SGI_PARTITION is not set
1172# CONFIG_ULTRIX_PARTITION is not set
1173# CONFIG_SUN_PARTITION is not set
1174# CONFIG_EFI_PARTITION is not set
1175
1176#
1177# Native Language Support
1178#
1179CONFIG_NLS=y
1180CONFIG_NLS_DEFAULT="iso8859-1"
1181CONFIG_NLS_CODEPAGE_437=m
1182# CONFIG_NLS_CODEPAGE_737 is not set
1183# CONFIG_NLS_CODEPAGE_775 is not set
1184CONFIG_NLS_CODEPAGE_850=m
1185CONFIG_NLS_CODEPAGE_852=m
1186# CONFIG_NLS_CODEPAGE_855 is not set
1187# CONFIG_NLS_CODEPAGE_857 is not set
1188# CONFIG_NLS_CODEPAGE_860 is not set
1189# CONFIG_NLS_CODEPAGE_861 is not set
1190# CONFIG_NLS_CODEPAGE_862 is not set
1191# CONFIG_NLS_CODEPAGE_863 is not set
1192# CONFIG_NLS_CODEPAGE_864 is not set
1193# CONFIG_NLS_CODEPAGE_865 is not set
1194# CONFIG_NLS_CODEPAGE_866 is not set
1195# CONFIG_NLS_CODEPAGE_869 is not set
1196# CONFIG_NLS_CODEPAGE_936 is not set
1197# CONFIG_NLS_CODEPAGE_950 is not set
1198# CONFIG_NLS_CODEPAGE_932 is not set
1199# CONFIG_NLS_CODEPAGE_949 is not set
1200# CONFIG_NLS_CODEPAGE_874 is not set
1201# CONFIG_NLS_ISO8859_8 is not set
1202# CONFIG_NLS_CODEPAGE_1250 is not set
1203# CONFIG_NLS_CODEPAGE_1251 is not set
1204# CONFIG_NLS_ASCII is not set
1205CONFIG_NLS_ISO8859_1=m
1206CONFIG_NLS_ISO8859_2=m
1207# CONFIG_NLS_ISO8859_3 is not set
1208# CONFIG_NLS_ISO8859_4 is not set
1209# CONFIG_NLS_ISO8859_5 is not set
1210# CONFIG_NLS_ISO8859_6 is not set
1211# CONFIG_NLS_ISO8859_7 is not set
1212# CONFIG_NLS_ISO8859_9 is not set
1213# CONFIG_NLS_ISO8859_13 is not set
1214# CONFIG_NLS_ISO8859_14 is not set
1215CONFIG_NLS_ISO8859_15=m
1216# CONFIG_NLS_KOI8_R is not set
1217# CONFIG_NLS_KOI8_U is not set
1218# CONFIG_NLS_UTF8 is not set
1219
1220#
1221# Profiling support
1222#
1223# CONFIG_PROFILING is not set
1224
1225#
1226# Kernel hacking
1227#
1228# CONFIG_PRINTK_TIME is not set
1229# CONFIG_DEBUG_KERNEL is not set
1230CONFIG_LOG_BUF_SHIFT=14
1231# CONFIG_DEBUG_BUGVERBOSE is not set
1232CONFIG_FRAME_POINTER=y
1233CONFIG_DEBUG_USER=y
1234
1235#
1236# Security options
1237#
1238# CONFIG_KEYS is not set
1239# CONFIG_SECURITY is not set
1240
1241#
1242# Cryptographic options
1243#
1244# CONFIG_CRYPTO is not set
1245
1246#
1247# Hardware crypto devices
1248#
1249
1250#
1251# Library routines
1252#
1253CONFIG_CRC_CCITT=m
1254CONFIG_CRC32=y
1255# CONFIG_LIBCRC32C is not set
1256CONFIG_ZLIB_INFLATE=m
1257CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/arm/configs/fortunet_defconfig b/arch/arm/configs/fortunet_defconfig
new file mode 100644
index 000000000000..b6f688d850dc
--- /dev/null
+++ b/arch/arm/configs/fortunet_defconfig
@@ -0,0 +1,558 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 23:51:10 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51# CONFIG_MODULES is not set
52
53#
54# System Type
55#
56# CONFIG_ARCH_CLPS7500 is not set
57CONFIG_ARCH_CLPS711X=y
58# CONFIG_ARCH_CO285 is not set
59# CONFIG_ARCH_EBSA110 is not set
60# CONFIG_ARCH_CAMELOT is not set
61# CONFIG_ARCH_FOOTBRIDGE is not set
62# CONFIG_ARCH_INTEGRATOR is not set
63# CONFIG_ARCH_IOP3XX is not set
64# CONFIG_ARCH_IXP4XX is not set
65# CONFIG_ARCH_IXP2000 is not set
66# CONFIG_ARCH_L7200 is not set
67# CONFIG_ARCH_PXA is not set
68# CONFIG_ARCH_RPC is not set
69# CONFIG_ARCH_SA1100 is not set
70# CONFIG_ARCH_S3C2410 is not set
71# CONFIG_ARCH_SHARK is not set
72# CONFIG_ARCH_LH7A40X is not set
73# CONFIG_ARCH_OMAP is not set
74# CONFIG_ARCH_VERSATILE is not set
75# CONFIG_ARCH_IMX is not set
76# CONFIG_ARCH_H720X is not set
77
78#
79# CLPS711X/EP721X Implementations
80#
81# CONFIG_ARCH_AUTCPU12 is not set
82# CONFIG_ARCH_CDB89712 is not set
83# CONFIG_ARCH_CEIVA is not set
84# CONFIG_ARCH_CLEP7312 is not set
85# CONFIG_ARCH_EDB7211 is not set
86# CONFIG_ARCH_P720T is not set
87CONFIG_ARCH_FORTUNET=y
88
89#
90# Processor Type
91#
92CONFIG_CPU_32=y
93CONFIG_CPU_ARM720T=y
94CONFIG_CPU_32v4=y
95CONFIG_CPU_ABRT_LV4T=y
96CONFIG_CPU_CACHE_V4=y
97CONFIG_CPU_CACHE_VIVT=y
98CONFIG_CPU_COPY_V4WT=y
99CONFIG_CPU_TLB_V4WT=y
100
101#
102# Processor Features
103#
104# CONFIG_ARM_THUMB is not set
105
106#
107# Bus support
108#
109
110#
111# PCCARD (PCMCIA/CardBus) support
112#
113# CONFIG_PCCARD is not set
114
115#
116# Kernel Features
117#
118# CONFIG_PREEMPT is not set
119CONFIG_ALIGNMENT_TRAP=y
120
121#
122# Boot options
123#
124CONFIG_ZBOOT_ROM_TEXT=0x0
125CONFIG_ZBOOT_ROM_BSS=0x0
126CONFIG_CMDLINE=""
127# CONFIG_XIP_KERNEL is not set
128
129#
130# Floating point emulation
131#
132
133#
134# At least one emulation must be selected
135#
136# CONFIG_FPE_NWFPE is not set
137CONFIG_FPE_FASTFPE=y
138
139#
140# Userspace binary formats
141#
142CONFIG_BINFMT_ELF=y
143CONFIG_BINFMT_AOUT=y
144# CONFIG_BINFMT_MISC is not set
145# CONFIG_ARTHUR is not set
146
147#
148# Power management options
149#
150# CONFIG_PM is not set
151
152#
153# Device Drivers
154#
155
156#
157# Generic Driver Options
158#
159CONFIG_STANDALONE=y
160CONFIG_PREVENT_FIRMWARE_BUILD=y
161# CONFIG_FW_LOADER is not set
162
163#
164# Memory Technology Devices (MTD)
165#
166CONFIG_MTD=y
167# CONFIG_MTD_DEBUG is not set
168# CONFIG_MTD_CONCAT is not set
169# CONFIG_MTD_PARTITIONS is not set
170
171#
172# User Modules And Translation Layers
173#
174CONFIG_MTD_CHAR=y
175CONFIG_MTD_BLOCK=y
176# CONFIG_FTL is not set
177# CONFIG_NFTL is not set
178# CONFIG_INFTL is not set
179
180#
181# RAM/ROM/Flash chip drivers
182#
183CONFIG_MTD_CFI=y
184# CONFIG_MTD_JEDECPROBE is not set
185CONFIG_MTD_GEN_PROBE=y
186# CONFIG_MTD_CFI_ADV_OPTIONS is not set
187CONFIG_MTD_MAP_BANK_WIDTH_1=y
188CONFIG_MTD_MAP_BANK_WIDTH_2=y
189CONFIG_MTD_MAP_BANK_WIDTH_4=y
190# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
191# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
192# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
193CONFIG_MTD_CFI_I1=y
194CONFIG_MTD_CFI_I2=y
195# CONFIG_MTD_CFI_I4 is not set
196# CONFIG_MTD_CFI_I8 is not set
197CONFIG_MTD_CFI_INTELEXT=y
198# CONFIG_MTD_CFI_AMDSTD is not set
199# CONFIG_MTD_CFI_STAA is not set
200CONFIG_MTD_CFI_UTIL=y
201# CONFIG_MTD_RAM is not set
202# CONFIG_MTD_ROM is not set
203# CONFIG_MTD_ABSENT is not set
204# CONFIG_MTD_XIP is not set
205
206#
207# Mapping drivers for chip access
208#
209# CONFIG_MTD_COMPLEX_MAPPINGS is not set
210# CONFIG_MTD_PHYSMAP is not set
211# CONFIG_MTD_ARM_INTEGRATOR is not set
212# CONFIG_MTD_EDB7312 is not set
213
214#
215# Self-contained MTD device drivers
216#
217# CONFIG_MTD_SLRAM is not set
218# CONFIG_MTD_PHRAM is not set
219# CONFIG_MTD_MTDRAM is not set
220# CONFIG_MTD_BLKMTD is not set
221# CONFIG_MTD_BLOCK2MTD is not set
222
223#
224# Disk-On-Chip Device Drivers
225#
226# CONFIG_MTD_DOC2000 is not set
227# CONFIG_MTD_DOC2001 is not set
228# CONFIG_MTD_DOC2001PLUS is not set
229
230#
231# NAND Flash Device Drivers
232#
233# CONFIG_MTD_NAND is not set
234
235#
236# Parallel port support
237#
238# CONFIG_PARPORT is not set
239
240#
241# Plug and Play support
242#
243
244#
245# Block devices
246#
247# CONFIG_BLK_DEV_FD is not set
248# CONFIG_BLK_DEV_COW_COMMON is not set
249# CONFIG_BLK_DEV_LOOP is not set
250# CONFIG_BLK_DEV_NBD is not set
251CONFIG_BLK_DEV_RAM=y
252CONFIG_BLK_DEV_RAM_COUNT=16
253CONFIG_BLK_DEV_RAM_SIZE=4096
254CONFIG_BLK_DEV_INITRD=y
255CONFIG_INITRAMFS_SOURCE=""
256# CONFIG_CDROM_PKTCDVD is not set
257
258#
259# IO Schedulers
260#
261CONFIG_IOSCHED_NOOP=y
262CONFIG_IOSCHED_AS=y
263CONFIG_IOSCHED_DEADLINE=y
264CONFIG_IOSCHED_CFQ=y
265# CONFIG_ATA_OVER_ETH is not set
266
267#
268# SCSI device support
269#
270# CONFIG_SCSI is not set
271
272#
273# Multi-device support (RAID and LVM)
274#
275# CONFIG_MD is not set
276
277#
278# Fusion MPT device support
279#
280
281#
282# IEEE 1394 (FireWire) support
283#
284
285#
286# I2O device support
287#
288
289#
290# Networking support
291#
292CONFIG_NET=y
293
294#
295# Networking options
296#
297# CONFIG_PACKET is not set
298# CONFIG_NETLINK_DEV is not set
299CONFIG_UNIX=y
300# CONFIG_NET_KEY is not set
301# CONFIG_INET is not set
302# CONFIG_IP_TCPDIAG_IPV6 is not set
303# CONFIG_NETFILTER is not set
304# CONFIG_ATM is not set
305# CONFIG_BRIDGE is not set
306# CONFIG_VLAN_8021Q is not set
307# CONFIG_DECNET is not set
308# CONFIG_LLC2 is not set
309# CONFIG_IPX is not set
310# CONFIG_ATALK is not set
311# CONFIG_X25 is not set
312# CONFIG_LAPB is not set
313# CONFIG_NET_DIVERT is not set
314# CONFIG_WAN_ROUTER is not set
315
316#
317# QoS and/or fair queueing
318#
319# CONFIG_NET_SCHED is not set
320# CONFIG_NET_CLS_ROUTE is not set
321
322#
323# Network testing
324#
325# CONFIG_NET_PKTGEN is not set
326# CONFIG_NETPOLL is not set
327# CONFIG_NET_POLL_CONTROLLER is not set
328# CONFIG_HAMRADIO is not set
329# CONFIG_IRDA is not set
330# CONFIG_BT is not set
331# CONFIG_NETDEVICES is not set
332
333#
334# ISDN subsystem
335#
336# CONFIG_ISDN is not set
337
338#
339# Input device support
340#
341# CONFIG_INPUT is not set
342
343#
344# Hardware I/O ports
345#
346# CONFIG_SERIO is not set
347# CONFIG_GAMEPORT is not set
348CONFIG_SOUND_GAMEPORT=y
349
350#
351# Character devices
352#
353# CONFIG_VT is not set
354# CONFIG_SERIAL_NONSTANDARD is not set
355
356#
357# Serial drivers
358#
359# CONFIG_SERIAL_8250 is not set
360
361#
362# Non-8250 serial port support
363#
364CONFIG_SERIAL_CLPS711X=y
365CONFIG_SERIAL_CLPS711X_CONSOLE=y
366CONFIG_SERIAL_CORE=y
367CONFIG_SERIAL_CORE_CONSOLE=y
368CONFIG_UNIX98_PTYS=y
369CONFIG_LEGACY_PTYS=y
370CONFIG_LEGACY_PTY_COUNT=256
371
372#
373# IPMI
374#
375# CONFIG_IPMI_HANDLER is not set
376
377#
378# Watchdog Cards
379#
380# CONFIG_WATCHDOG is not set
381# CONFIG_NVRAM is not set
382# CONFIG_RTC is not set
383# CONFIG_DTLK is not set
384# CONFIG_R3964 is not set
385
386#
387# Ftape, the floppy tape device driver
388#
389# CONFIG_DRM is not set
390# CONFIG_RAW_DRIVER is not set
391
392#
393# TPM devices
394#
395# CONFIG_TCG_TPM is not set
396
397#
398# I2C support
399#
400# CONFIG_I2C is not set
401
402#
403# Misc devices
404#
405
406#
407# Multimedia devices
408#
409# CONFIG_VIDEO_DEV is not set
410
411#
412# Digital Video Broadcasting Devices
413#
414
415#
416# Graphics support
417#
418# CONFIG_FB is not set
419
420#
421# Sound
422#
423# CONFIG_SOUND is not set
424
425#
426# USB support
427#
428CONFIG_USB_ARCH_HAS_HCD=y
429# CONFIG_USB_ARCH_HAS_OHCI is not set
430# CONFIG_USB is not set
431
432#
433# USB Gadget Support
434#
435# CONFIG_USB_GADGET is not set
436
437#
438# MMC/SD Card support
439#
440# CONFIG_MMC is not set
441
442#
443# File systems
444#
445CONFIG_EXT2_FS=y
446# CONFIG_EXT2_FS_XATTR is not set
447# CONFIG_EXT3_FS is not set
448# CONFIG_JBD is not set
449# CONFIG_REISERFS_FS is not set
450# CONFIG_JFS_FS is not set
451
452#
453# XFS support
454#
455# CONFIG_XFS_FS is not set
456# CONFIG_MINIX_FS is not set
457# CONFIG_ROMFS_FS is not set
458# CONFIG_QUOTA is not set
459CONFIG_DNOTIFY=y
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_MSDOS_FS is not set
473# CONFIG_VFAT_FS is not set
474# CONFIG_NTFS_FS is not set
475
476#
477# Pseudo filesystems
478#
479CONFIG_PROC_FS=y
480CONFIG_SYSFS=y
481# CONFIG_DEVFS_FS is not set
482# CONFIG_DEVPTS_FS_XATTR is not set
483# CONFIG_TMPFS is not set
484# CONFIG_HUGETLB_PAGE is not set
485CONFIG_RAMFS=y
486
487#
488# Miscellaneous filesystems
489#
490# CONFIG_ADFS_FS is not set
491# CONFIG_AFFS_FS is not set
492# CONFIG_HFS_FS is not set
493# CONFIG_HFSPLUS_FS is not set
494# CONFIG_BEFS_FS is not set
495# CONFIG_BFS_FS is not set
496# CONFIG_EFS_FS is not set
497CONFIG_JFFS_FS=y
498CONFIG_JFFS_FS_VERBOSE=0
499# CONFIG_JFFS_PROC_FS is not set
500# CONFIG_JFFS2_FS is not set
501# CONFIG_CRAMFS is not set
502# CONFIG_VXFS_FS is not set
503# CONFIG_HPFS_FS is not set
504# CONFIG_QNX4FS_FS is not set
505# CONFIG_SYSV_FS is not set
506# CONFIG_UFS_FS is not set
507
508#
509# Network File Systems
510#
511
512#
513# Partition Types
514#
515# CONFIG_PARTITION_ADVANCED is not set
516CONFIG_MSDOS_PARTITION=y
517
518#
519# Native Language Support
520#
521# CONFIG_NLS is not set
522
523#
524# Profiling support
525#
526# CONFIG_PROFILING is not set
527
528#
529# Kernel hacking
530#
531# CONFIG_PRINTK_TIME is not set
532# CONFIG_DEBUG_KERNEL is not set
533CONFIG_LOG_BUF_SHIFT=14
534# CONFIG_DEBUG_BUGVERBOSE is not set
535CONFIG_FRAME_POINTER=y
536CONFIG_DEBUG_USER=y
537
538#
539# Security options
540#
541# CONFIG_KEYS is not set
542# CONFIG_SECURITY is not set
543
544#
545# Cryptographic options
546#
547# CONFIG_CRYPTO is not set
548
549#
550# Hardware crypto devices
551#
552
553#
554# Library routines
555#
556# CONFIG_CRC_CCITT is not set
557CONFIG_CRC32=y
558# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/configs/h3600_defconfig b/arch/arm/configs/h3600_defconfig
new file mode 100644
index 000000000000..b4e297dd54b2
--- /dev/null
+++ b/arch/arm/configs/h3600_defconfig
@@ -0,0 +1,913 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Mon Mar 28 00:02:26 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51CONFIG_MODULES=y
52# CONFIG_MODULE_UNLOAD is not set
53CONFIG_OBSOLETE_MODPARM=y
54# CONFIG_MODVERSIONS is not set
55# CONFIG_MODULE_SRCVERSION_ALL is not set
56# CONFIG_KMOD is not set
57
58#
59# System Type
60#
61# CONFIG_ARCH_CLPS7500 is not set
62# CONFIG_ARCH_CLPS711X is not set
63# CONFIG_ARCH_CO285 is not set
64# CONFIG_ARCH_EBSA110 is not set
65# CONFIG_ARCH_CAMELOT is not set
66# CONFIG_ARCH_FOOTBRIDGE is not set
67# CONFIG_ARCH_INTEGRATOR is not set
68# CONFIG_ARCH_IOP3XX is not set
69# CONFIG_ARCH_IXP4XX is not set
70# CONFIG_ARCH_IXP2000 is not set
71# CONFIG_ARCH_L7200 is not set
72# CONFIG_ARCH_PXA is not set
73# CONFIG_ARCH_RPC is not set
74CONFIG_ARCH_SA1100=y
75# CONFIG_ARCH_S3C2410 is not set
76# CONFIG_ARCH_SHARK is not set
77# CONFIG_ARCH_LH7A40X is not set
78# CONFIG_ARCH_OMAP is not set
79# CONFIG_ARCH_VERSATILE is not set
80# CONFIG_ARCH_IMX is not set
81# CONFIG_ARCH_H720X is not set
82
83#
84# SA11x0 Implementations
85#
86# CONFIG_SA1100_ASSABET is not set
87# CONFIG_SA1100_CERF is not set
88# CONFIG_SA1100_COLLIE is not set
89# CONFIG_SA1100_H3100 is not set
90CONFIG_SA1100_H3600=y
91# CONFIG_SA1100_H3800 is not set
92CONFIG_SA1100_H3XXX=y
93# CONFIG_SA1100_BADGE4 is not set
94# CONFIG_SA1100_JORNADA720 is not set
95# CONFIG_SA1100_HACKKIT is not set
96# CONFIG_SA1100_LART is not set
97# CONFIG_SA1100_PLEB is not set
98# CONFIG_SA1100_SHANNON is not set
99# CONFIG_SA1100_SIMPAD is not set
100# CONFIG_SA1100_SSP is not set
101# CONFIG_H3600_SLEEVE is not set
102
103#
104# Processor Type
105#
106CONFIG_CPU_32=y
107CONFIG_CPU_SA1100=y
108CONFIG_CPU_32v4=y
109CONFIG_CPU_ABRT_EV4=y
110CONFIG_CPU_CACHE_V4WB=y
111CONFIG_CPU_CACHE_VIVT=y
112CONFIG_CPU_TLB_V4WB=y
113CONFIG_CPU_MINICACHE=y
114
115#
116# Processor Features
117#
118
119#
120# Bus support
121#
122CONFIG_ISA=y
123
124#
125# PCCARD (PCMCIA/CardBus) support
126#
127CONFIG_PCCARD=y
128# CONFIG_PCMCIA_DEBUG is not set
129CONFIG_PCMCIA=y
130
131#
132# PC-card bridges
133#
134# CONFIG_I82365 is not set
135# CONFIG_TCIC is not set
136CONFIG_PCMCIA_SA1100=y
137
138#
139# Kernel Features
140#
141# CONFIG_PREEMPT is not set
142CONFIG_DISCONTIGMEM=y
143# CONFIG_LEDS is not set
144CONFIG_ALIGNMENT_TRAP=y
145
146#
147# Boot options
148#
149CONFIG_ZBOOT_ROM_TEXT=0x0
150CONFIG_ZBOOT_ROM_BSS=0x0
151CONFIG_CMDLINE=""
152# CONFIG_XIP_KERNEL is not set
153
154#
155# CPU Frequency scaling
156#
157CONFIG_CPU_FREQ=y
158CONFIG_CPU_FREQ_TABLE=y
159# CONFIG_CPU_FREQ_DEBUG is not set
160CONFIG_CPU_FREQ_STAT=y
161# CONFIG_CPU_FREQ_STAT_DETAILS is not set
162CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
163# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
164CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
165# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
166# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
167# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
168
169#
170# Floating point emulation
171#
172
173#
174# At least one emulation must be selected
175#
176CONFIG_FPE_NWFPE=y
177# CONFIG_FPE_NWFPE_XP is not set
178# CONFIG_FPE_FASTFPE is not set
179
180#
181# Userspace binary formats
182#
183CONFIG_BINFMT_ELF=y
184# CONFIG_BINFMT_AOUT is not set
185# CONFIG_BINFMT_MISC is not set
186# CONFIG_ARTHUR is not set
187
188#
189# Power management options
190#
191CONFIG_PM=y
192# CONFIG_APM is not set
193
194#
195# Device Drivers
196#
197
198#
199# Generic Driver Options
200#
201CONFIG_STANDALONE=y
202CONFIG_PREVENT_FIRMWARE_BUILD=y
203# CONFIG_FW_LOADER is not set
204
205#
206# Memory Technology Devices (MTD)
207#
208CONFIG_MTD=y
209# CONFIG_MTD_DEBUG is not set
210# CONFIG_MTD_CONCAT is not set
211CONFIG_MTD_PARTITIONS=y
212CONFIG_MTD_REDBOOT_PARTS=y
213CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
214# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
215# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
216# CONFIG_MTD_CMDLINE_PARTS is not set
217# CONFIG_MTD_AFS_PARTS is not set
218
219#
220# User Modules And Translation Layers
221#
222CONFIG_MTD_CHAR=y
223CONFIG_MTD_BLOCK=y
224# CONFIG_FTL is not set
225# CONFIG_NFTL is not set
226# CONFIG_INFTL is not set
227
228#
229# RAM/ROM/Flash chip drivers
230#
231CONFIG_MTD_CFI=y
232# CONFIG_MTD_JEDECPROBE is not set
233CONFIG_MTD_GEN_PROBE=y
234CONFIG_MTD_CFI_ADV_OPTIONS=y
235CONFIG_MTD_CFI_NOSWAP=y
236# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
237# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
238CONFIG_MTD_CFI_GEOMETRY=y
239CONFIG_MTD_MAP_BANK_WIDTH_1=y
240CONFIG_MTD_MAP_BANK_WIDTH_2=y
241CONFIG_MTD_MAP_BANK_WIDTH_4=y
242# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
243# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
244# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
245# CONFIG_MTD_CFI_I1 is not set
246CONFIG_MTD_CFI_I2=y
247# CONFIG_MTD_CFI_I4 is not set
248# CONFIG_MTD_CFI_I8 is not set
249CONFIG_MTD_CFI_INTELEXT=y
250# CONFIG_MTD_CFI_AMDSTD is not set
251# CONFIG_MTD_CFI_STAA is not set
252CONFIG_MTD_CFI_UTIL=y
253# CONFIG_MTD_RAM is not set
254# CONFIG_MTD_ROM is not set
255# CONFIG_MTD_ABSENT is not set
256# CONFIG_MTD_XIP is not set
257
258#
259# Mapping drivers for chip access
260#
261# CONFIG_MTD_COMPLEX_MAPPINGS is not set
262# CONFIG_MTD_PHYSMAP is not set
263# CONFIG_MTD_ARM_INTEGRATOR is not set
264CONFIG_MTD_SA1100=y
265# CONFIG_MTD_EDB7312 is not set
266
267#
268# Self-contained MTD device drivers
269#
270# CONFIG_MTD_SLRAM is not set
271# CONFIG_MTD_PHRAM is not set
272# CONFIG_MTD_MTDRAM is not set
273# CONFIG_MTD_BLKMTD is not set
274# CONFIG_MTD_BLOCK2MTD is not set
275
276#
277# Disk-On-Chip Device Drivers
278#
279# CONFIG_MTD_DOC2000 is not set
280# CONFIG_MTD_DOC2001 is not set
281# CONFIG_MTD_DOC2001PLUS is not set
282
283#
284# NAND Flash Device Drivers
285#
286# CONFIG_MTD_NAND is not set
287
288#
289# Parallel port support
290#
291# CONFIG_PARPORT is not set
292
293#
294# Plug and Play support
295#
296# CONFIG_PNP is not set
297
298#
299# Block devices
300#
301# CONFIG_BLK_DEV_FD is not set
302# CONFIG_BLK_DEV_XD is not set
303# CONFIG_BLK_DEV_COW_COMMON is not set
304CONFIG_BLK_DEV_LOOP=m
305# CONFIG_BLK_DEV_CRYPTOLOOP is not set
306# CONFIG_BLK_DEV_NBD is not set
307CONFIG_BLK_DEV_RAM=y
308CONFIG_BLK_DEV_RAM_COUNT=16
309CONFIG_BLK_DEV_RAM_SIZE=8192
310CONFIG_BLK_DEV_INITRD=y
311CONFIG_INITRAMFS_SOURCE=""
312# CONFIG_CDROM_PKTCDVD is not set
313
314#
315# IO Schedulers
316#
317CONFIG_IOSCHED_NOOP=y
318CONFIG_IOSCHED_AS=y
319CONFIG_IOSCHED_DEADLINE=y
320CONFIG_IOSCHED_CFQ=y
321# CONFIG_ATA_OVER_ETH is not set
322
323#
324# ATA/ATAPI/MFM/RLL support
325#
326CONFIG_IDE=m
327CONFIG_BLK_DEV_IDE=m
328
329#
330# Please see Documentation/ide.txt for help/info on IDE drives
331#
332# CONFIG_BLK_DEV_IDE_SATA is not set
333CONFIG_BLK_DEV_IDEDISK=m
334# CONFIG_IDEDISK_MULTI_MODE is not set
335# CONFIG_BLK_DEV_IDECS is not set
336CONFIG_BLK_DEV_IDECD=m
337# CONFIG_BLK_DEV_IDETAPE is not set
338# CONFIG_BLK_DEV_IDEFLOPPY is not set
339# CONFIG_IDE_TASK_IOCTL is not set
340
341#
342# IDE chipset support/bugfixes
343#
344CONFIG_IDE_GENERIC=m
345# CONFIG_IDE_ARM is not set
346# CONFIG_IDE_CHIPSETS is not set
347# CONFIG_BLK_DEV_IDEDMA is not set
348# CONFIG_IDEDMA_AUTO is not set
349# CONFIG_BLK_DEV_HD is not set
350
351#
352# SCSI device support
353#
354# CONFIG_SCSI is not set
355
356#
357# Multi-device support (RAID and LVM)
358#
359# CONFIG_MD is not set
360
361#
362# Fusion MPT device support
363#
364
365#
366# IEEE 1394 (FireWire) support
367#
368
369#
370# I2O device support
371#
372
373#
374# Networking support
375#
376CONFIG_NET=y
377
378#
379# Networking options
380#
381# CONFIG_PACKET is not set
382# CONFIG_NETLINK_DEV is not set
383CONFIG_UNIX=y
384# CONFIG_NET_KEY is not set
385CONFIG_INET=y
386# CONFIG_IP_MULTICAST is not set
387# CONFIG_IP_ADVANCED_ROUTER is not set
388# CONFIG_IP_PNP is not set
389# CONFIG_NET_IPIP is not set
390# CONFIG_NET_IPGRE is not set
391# CONFIG_ARPD is not set
392# CONFIG_SYN_COOKIES is not set
393# CONFIG_INET_AH is not set
394# CONFIG_INET_ESP is not set
395# CONFIG_INET_IPCOMP is not set
396# CONFIG_INET_TUNNEL is not set
397# CONFIG_IP_TCPDIAG is not set
398# CONFIG_IP_TCPDIAG_IPV6 is not set
399# CONFIG_IPV6 is not set
400# CONFIG_NETFILTER is not set
401
402#
403# SCTP Configuration (EXPERIMENTAL)
404#
405# CONFIG_IP_SCTP is not set
406# CONFIG_ATM is not set
407# CONFIG_BRIDGE is not set
408# CONFIG_VLAN_8021Q is not set
409# CONFIG_DECNET is not set
410# CONFIG_LLC2 is not set
411# CONFIG_IPX is not set
412# CONFIG_ATALK is not set
413# CONFIG_X25 is not set
414# CONFIG_LAPB is not set
415# CONFIG_NET_DIVERT is not set
416# CONFIG_ECONET is not set
417# CONFIG_WAN_ROUTER is not set
418
419#
420# QoS and/or fair queueing
421#
422# CONFIG_NET_SCHED is not set
423# CONFIG_NET_CLS_ROUTE is not set
424
425#
426# Network testing
427#
428# CONFIG_NET_PKTGEN is not set
429# CONFIG_NETPOLL is not set
430# CONFIG_NET_POLL_CONTROLLER is not set
431# CONFIG_HAMRADIO is not set
432CONFIG_IRDA=m
433
434#
435# IrDA protocols
436#
437CONFIG_IRLAN=m
438CONFIG_IRNET=m
439CONFIG_IRCOMM=m
440# CONFIG_IRDA_ULTRA is not set
441
442#
443# IrDA options
444#
445# CONFIG_IRDA_CACHE_LAST_LSAP is not set
446# CONFIG_IRDA_FAST_RR is not set
447# CONFIG_IRDA_DEBUG is not set
448
449#
450# Infrared-port device drivers
451#
452
453#
454# SIR device drivers
455#
456# CONFIG_IRTTY_SIR is not set
457
458#
459# Dongle support
460#
461
462#
463# Old SIR device drivers
464#
465# CONFIG_IRPORT_SIR is not set
466
467#
468# Old Serial dongle support
469#
470
471#
472# FIR device drivers
473#
474# CONFIG_NSC_FIR is not set
475# CONFIG_WINBOND_FIR is not set
476# CONFIG_SMC_IRCC_FIR is not set
477# CONFIG_ALI_FIR is not set
478CONFIG_SA1100_FIR=m
479# CONFIG_BT is not set
480CONFIG_NETDEVICES=y
481# CONFIG_DUMMY is not set
482# CONFIG_BONDING is not set
483# CONFIG_EQUALIZER is not set
484# CONFIG_TUN is not set
485
486#
487# ARCnet devices
488#
489# CONFIG_ARCNET is not set
490
491#
492# Ethernet (10 or 100Mbit)
493#
494# CONFIG_NET_ETHERNET is not set
495
496#
497# Ethernet (1000 Mbit)
498#
499
500#
501# Ethernet (10000 Mbit)
502#
503
504#
505# Token Ring devices
506#
507# CONFIG_TR is not set
508
509#
510# Wireless LAN (non-hamradio)
511#
512# CONFIG_NET_RADIO is not set
513
514#
515# PCMCIA network device support
516#
517CONFIG_NET_PCMCIA=y
518# CONFIG_PCMCIA_3C589 is not set
519# CONFIG_PCMCIA_3C574 is not set
520# CONFIG_PCMCIA_FMVJ18X is not set
521CONFIG_PCMCIA_PCNET=y
522# CONFIG_PCMCIA_NMCLAN is not set
523# CONFIG_PCMCIA_SMC91C92 is not set
524# CONFIG_PCMCIA_XIRC2PS is not set
525# CONFIG_PCMCIA_AXNET is not set
526
527#
528# Wan interfaces
529#
530# CONFIG_WAN is not set
531CONFIG_PPP=m
532# CONFIG_PPP_MULTILINK is not set
533# CONFIG_PPP_FILTER is not set
534CONFIG_PPP_ASYNC=m
535# CONFIG_PPP_SYNC_TTY is not set
536CONFIG_PPP_DEFLATE=m
537CONFIG_PPP_BSDCOMP=m
538# CONFIG_PPPOE is not set
539# CONFIG_SLIP is not set
540# CONFIG_SHAPER is not set
541# CONFIG_NETCONSOLE is not set
542
543#
544# ISDN subsystem
545#
546# CONFIG_ISDN is not set
547
548#
549# Input device support
550#
551CONFIG_INPUT=y
552
553#
554# Userland interfaces
555#
556CONFIG_INPUT_MOUSEDEV=y
557CONFIG_INPUT_MOUSEDEV_PSAUX=y
558CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
559CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
560# CONFIG_INPUT_JOYDEV is not set
561# CONFIG_INPUT_TSDEV is not set
562# CONFIG_INPUT_EVDEV is not set
563# CONFIG_INPUT_EVBUG is not set
564
565#
566# Input Device Drivers
567#
568CONFIG_INPUT_KEYBOARD=y
569CONFIG_KEYBOARD_ATKBD=y
570# CONFIG_KEYBOARD_SUNKBD is not set
571# CONFIG_KEYBOARD_LKKBD is not set
572# CONFIG_KEYBOARD_XTKBD is not set
573# CONFIG_KEYBOARD_NEWTON is not set
574CONFIG_INPUT_MOUSE=y
575CONFIG_MOUSE_PS2=y
576# CONFIG_MOUSE_SERIAL is not set
577# CONFIG_MOUSE_INPORT is not set
578# CONFIG_MOUSE_LOGIBM is not set
579# CONFIG_MOUSE_PC110PAD is not set
580# CONFIG_MOUSE_VSXXXAA is not set
581# CONFIG_INPUT_JOYSTICK is not set
582# CONFIG_INPUT_TOUCHSCREEN is not set
583# CONFIG_INPUT_MISC is not set
584
585#
586# Hardware I/O ports
587#
588CONFIG_SERIO=y
589CONFIG_SERIO_SERPORT=y
590CONFIG_SERIO_LIBPS2=y
591# CONFIG_SERIO_RAW is not set
592# CONFIG_GAMEPORT is not set
593CONFIG_SOUND_GAMEPORT=y
594
595#
596# Character devices
597#
598CONFIG_VT=y
599CONFIG_VT_CONSOLE=y
600CONFIG_HW_CONSOLE=y
601# CONFIG_SERIAL_NONSTANDARD is not set
602
603#
604# Serial drivers
605#
606CONFIG_SERIAL_8250=m
607# CONFIG_SERIAL_8250_CS is not set
608CONFIG_SERIAL_8250_NR_UARTS=4
609# CONFIG_SERIAL_8250_EXTENDED is not set
610
611#
612# Non-8250 serial port support
613#
614CONFIG_SERIAL_SA1100=y
615CONFIG_SERIAL_SA1100_CONSOLE=y
616CONFIG_SERIAL_CORE=y
617CONFIG_SERIAL_CORE_CONSOLE=y
618CONFIG_UNIX98_PTYS=y
619CONFIG_LEGACY_PTYS=y
620CONFIG_LEGACY_PTY_COUNT=256
621
622#
623# IPMI
624#
625# CONFIG_IPMI_HANDLER is not set
626
627#
628# Watchdog Cards
629#
630# CONFIG_WATCHDOG is not set
631# CONFIG_NVRAM is not set
632# CONFIG_RTC is not set
633# CONFIG_DTLK is not set
634# CONFIG_R3964 is not set
635
636#
637# Ftape, the floppy tape device driver
638#
639# CONFIG_DRM is not set
640
641#
642# PCMCIA character devices
643#
644# CONFIG_SYNCLINK_CS is not set
645# CONFIG_RAW_DRIVER is not set
646
647#
648# TPM devices
649#
650# CONFIG_TCG_TPM is not set
651
652#
653# I2C support
654#
655# CONFIG_I2C is not set
656
657#
658# Misc devices
659#
660
661#
662# Multimedia devices
663#
664# CONFIG_VIDEO_DEV is not set
665
666#
667# Digital Video Broadcasting Devices
668#
669# CONFIG_DVB is not set
670
671#
672# Graphics support
673#
674CONFIG_FB=y
675CONFIG_FB_CFB_FILLRECT=y
676CONFIG_FB_CFB_COPYAREA=y
677CONFIG_FB_CFB_IMAGEBLIT=y
678CONFIG_FB_SOFT_CURSOR=y
679# CONFIG_FB_MODE_HELPERS is not set
680# CONFIG_FB_TILEBLITTING is not set
681CONFIG_FB_SA1100=y
682# CONFIG_FB_VIRTUAL is not set
683
684#
685# Console display driver support
686#
687# CONFIG_VGA_CONSOLE is not set
688# CONFIG_MDA_CONSOLE is not set
689CONFIG_DUMMY_CONSOLE=y
690# CONFIG_FRAMEBUFFER_CONSOLE is not set
691
692#
693# Logo configuration
694#
695# CONFIG_LOGO is not set
696# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
697
698#
699# Sound
700#
701CONFIG_SOUND=y
702
703#
704# Advanced Linux Sound Architecture
705#
706# CONFIG_SND is not set
707
708#
709# Open Sound System
710#
711# CONFIG_SOUND_PRIME is not set
712
713#
714# USB support
715#
716CONFIG_USB_ARCH_HAS_HCD=y
717# CONFIG_USB_ARCH_HAS_OHCI is not set
718# CONFIG_USB is not set
719
720#
721# USB Gadget Support
722#
723# CONFIG_USB_GADGET is not set
724
725#
726# MMC/SD Card support
727#
728# CONFIG_MMC is not set
729
730#
731# File systems
732#
733CONFIG_EXT2_FS=y
734# CONFIG_EXT2_FS_XATTR is not set
735# CONFIG_EXT3_FS is not set
736# CONFIG_JBD is not set
737# CONFIG_REISERFS_FS is not set
738# CONFIG_JFS_FS is not set
739
740#
741# XFS support
742#
743# CONFIG_XFS_FS is not set
744# CONFIG_MINIX_FS is not set
745# CONFIG_ROMFS_FS is not set
746# CONFIG_QUOTA is not set
747CONFIG_DNOTIFY=y
748# CONFIG_AUTOFS_FS is not set
749# CONFIG_AUTOFS4_FS is not set
750
751#
752# CD-ROM/DVD Filesystems
753#
754# CONFIG_ISO9660_FS is not set
755# CONFIG_UDF_FS is not set
756
757#
758# DOS/FAT/NT Filesystems
759#
760CONFIG_FAT_FS=m
761CONFIG_MSDOS_FS=m
762CONFIG_VFAT_FS=m
763CONFIG_FAT_DEFAULT_CODEPAGE=437
764CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
765# CONFIG_NTFS_FS is not set
766
767#
768# Pseudo filesystems
769#
770CONFIG_PROC_FS=y
771CONFIG_SYSFS=y
772# CONFIG_DEVFS_FS is not set
773# CONFIG_DEVPTS_FS_XATTR is not set
774# CONFIG_TMPFS is not set
775# CONFIG_HUGETLB_PAGE is not set
776CONFIG_RAMFS=y
777
778#
779# Miscellaneous filesystems
780#
781# CONFIG_ADFS_FS is not set
782# CONFIG_AFFS_FS is not set
783# CONFIG_HFS_FS is not set
784# CONFIG_HFSPLUS_FS is not set
785# CONFIG_BEFS_FS is not set
786# CONFIG_BFS_FS is not set
787# CONFIG_EFS_FS is not set
788# CONFIG_JFFS_FS is not set
789CONFIG_JFFS2_FS=y
790CONFIG_JFFS2_FS_DEBUG=0
791# CONFIG_JFFS2_FS_NAND is not set
792# CONFIG_JFFS2_FS_NOR_ECC is not set
793# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
794CONFIG_JFFS2_ZLIB=y
795CONFIG_JFFS2_RTIME=y
796# CONFIG_JFFS2_RUBIN is not set
797CONFIG_CRAMFS=m
798# CONFIG_VXFS_FS is not set
799# CONFIG_HPFS_FS is not set
800# CONFIG_QNX4FS_FS is not set
801# CONFIG_SYSV_FS is not set
802# CONFIG_UFS_FS is not set
803
804#
805# Network File Systems
806#
807CONFIG_NFS_FS=y
808# CONFIG_NFS_V3 is not set
809# CONFIG_NFS_V4 is not set
810# CONFIG_NFS_DIRECTIO is not set
811CONFIG_NFSD=m
812# CONFIG_NFSD_V3 is not set
813CONFIG_NFSD_TCP=y
814CONFIG_LOCKD=y
815CONFIG_EXPORTFS=m
816CONFIG_SUNRPC=y
817# CONFIG_RPCSEC_GSS_KRB5 is not set
818# CONFIG_RPCSEC_GSS_SPKM3 is not set
819CONFIG_SMB_FS=m
820# CONFIG_SMB_NLS_DEFAULT is not set
821# CONFIG_CIFS is not set
822# CONFIG_NCP_FS is not set
823# CONFIG_CODA_FS is not set
824# CONFIG_AFS_FS is not set
825
826#
827# Partition Types
828#
829# CONFIG_PARTITION_ADVANCED is not set
830CONFIG_MSDOS_PARTITION=y
831
832#
833# Native Language Support
834#
835CONFIG_NLS=y
836CONFIG_NLS_DEFAULT="iso8859-1"
837# CONFIG_NLS_CODEPAGE_437 is not set
838# CONFIG_NLS_CODEPAGE_737 is not set
839# CONFIG_NLS_CODEPAGE_775 is not set
840# CONFIG_NLS_CODEPAGE_850 is not set
841# CONFIG_NLS_CODEPAGE_852 is not set
842# CONFIG_NLS_CODEPAGE_855 is not set
843# CONFIG_NLS_CODEPAGE_857 is not set
844# CONFIG_NLS_CODEPAGE_860 is not set
845# CONFIG_NLS_CODEPAGE_861 is not set
846# CONFIG_NLS_CODEPAGE_862 is not set
847# CONFIG_NLS_CODEPAGE_863 is not set
848# CONFIG_NLS_CODEPAGE_864 is not set
849# CONFIG_NLS_CODEPAGE_865 is not set
850# CONFIG_NLS_CODEPAGE_866 is not set
851# CONFIG_NLS_CODEPAGE_869 is not set
852# CONFIG_NLS_CODEPAGE_936 is not set
853# CONFIG_NLS_CODEPAGE_950 is not set
854# CONFIG_NLS_CODEPAGE_932 is not set
855# CONFIG_NLS_CODEPAGE_949 is not set
856# CONFIG_NLS_CODEPAGE_874 is not set
857# CONFIG_NLS_ISO8859_8 is not set
858# CONFIG_NLS_CODEPAGE_1250 is not set
859# CONFIG_NLS_CODEPAGE_1251 is not set
860# CONFIG_NLS_ASCII is not set
861# CONFIG_NLS_ISO8859_1 is not set
862# CONFIG_NLS_ISO8859_2 is not set
863# CONFIG_NLS_ISO8859_3 is not set
864# CONFIG_NLS_ISO8859_4 is not set
865# CONFIG_NLS_ISO8859_5 is not set
866# CONFIG_NLS_ISO8859_6 is not set
867# CONFIG_NLS_ISO8859_7 is not set
868# CONFIG_NLS_ISO8859_9 is not set
869# CONFIG_NLS_ISO8859_13 is not set
870# CONFIG_NLS_ISO8859_14 is not set
871# CONFIG_NLS_ISO8859_15 is not set
872# CONFIG_NLS_KOI8_R is not set
873# CONFIG_NLS_KOI8_U is not set
874# CONFIG_NLS_UTF8 is not set
875
876#
877# Profiling support
878#
879# CONFIG_PROFILING is not set
880
881#
882# Kernel hacking
883#
884# CONFIG_PRINTK_TIME is not set
885# CONFIG_DEBUG_KERNEL is not set
886CONFIG_LOG_BUF_SHIFT=14
887CONFIG_DEBUG_BUGVERBOSE=y
888CONFIG_FRAME_POINTER=y
889# CONFIG_DEBUG_USER is not set
890
891#
892# Security options
893#
894# CONFIG_KEYS is not set
895# CONFIG_SECURITY is not set
896
897#
898# Cryptographic options
899#
900# CONFIG_CRYPTO is not set
901
902#
903# Hardware crypto devices
904#
905
906#
907# Library routines
908#
909CONFIG_CRC_CCITT=m
910CONFIG_CRC32=y
911# CONFIG_LIBCRC32C is not set
912CONFIG_ZLIB_INFLATE=y
913CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/h7201_defconfig b/arch/arm/configs/h7201_defconfig
new file mode 100644
index 000000000000..39c13a354541
--- /dev/null
+++ b/arch/arm/configs/h7201_defconfig
@@ -0,0 +1,567 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Mon Mar 28 00:11:33 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_BSD_PROCESS_ACCT is not set
27CONFIG_SYSCTL=y
28# CONFIG_AUDIT is not set
29CONFIG_HOTPLUG=y
30# CONFIG_IKCONFIG is not set
31# CONFIG_EMBEDDED is not set
32CONFIG_KALLSYMS=y
33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y
36CONFIG_EPOLL=y
37CONFIG_CC_OPTIMIZE_FOR_SIZE=y
38CONFIG_SHMEM=y
39CONFIG_CC_ALIGN_FUNCTIONS=0
40CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set
44CONFIG_BASE_SMALL=0
45
46#
47# Loadable module support
48#
49CONFIG_MODULES=y
50# CONFIG_MODULE_UNLOAD is not set
51CONFIG_OBSOLETE_MODPARM=y
52# CONFIG_MODVERSIONS is not set
53# CONFIG_MODULE_SRCVERSION_ALL is not set
54CONFIG_KMOD=y
55
56#
57# System Type
58#
59# CONFIG_ARCH_CLPS7500 is not set
60# CONFIG_ARCH_CLPS711X is not set
61# CONFIG_ARCH_CO285 is not set
62# CONFIG_ARCH_EBSA110 is not set
63# CONFIG_ARCH_CAMELOT is not set
64# CONFIG_ARCH_FOOTBRIDGE is not set
65# CONFIG_ARCH_INTEGRATOR is not set
66# CONFIG_ARCH_IOP3XX is not set
67# CONFIG_ARCH_IXP4XX is not set
68# CONFIG_ARCH_IXP2000 is not set
69# CONFIG_ARCH_L7200 is not set
70# CONFIG_ARCH_PXA is not set
71# CONFIG_ARCH_RPC is not set
72# CONFIG_ARCH_SA1100 is not set
73# CONFIG_ARCH_S3C2410 is not set
74# CONFIG_ARCH_SHARK is not set
75# CONFIG_ARCH_LH7A40X is not set
76# CONFIG_ARCH_OMAP is not set
77# CONFIG_ARCH_VERSATILE is not set
78# CONFIG_ARCH_IMX is not set
79CONFIG_ARCH_H720X=y
80
81#
82# h720x Implementations
83#
84CONFIG_ARCH_H7201=y
85# CONFIG_ARCH_H7202 is not set
86CONFIG_CPU_H7201=y
87
88#
89# Processor Type
90#
91CONFIG_CPU_32=y
92CONFIG_CPU_ARM720T=y
93CONFIG_CPU_32v4=y
94CONFIG_CPU_ABRT_LV4T=y
95CONFIG_CPU_CACHE_V4=y
96CONFIG_CPU_CACHE_VIVT=y
97CONFIG_CPU_COPY_V4WT=y
98CONFIG_CPU_TLB_V4WT=y
99
100#
101# Processor Features
102#
103CONFIG_ARM_THUMB=y
104
105#
106# Bus support
107#
108
109#
110# PCCARD (PCMCIA/CardBus) support
111#
112# CONFIG_PCCARD is not set
113
114#
115# Kernel Features
116#
117# CONFIG_PREEMPT is not set
118CONFIG_ALIGNMENT_TRAP=y
119
120#
121# Boot options
122#
123CONFIG_ZBOOT_ROM_TEXT=0x0
124CONFIG_ZBOOT_ROM_BSS=0x0
125CONFIG_CMDLINE=""
126# CONFIG_XIP_KERNEL is not set
127
128#
129# Floating point emulation
130#
131
132#
133# At least one emulation must be selected
134#
135CONFIG_FPE_NWFPE=y
136# CONFIG_FPE_NWFPE_XP is not set
137# CONFIG_FPE_FASTFPE is not set
138
139#
140# Userspace binary formats
141#
142CONFIG_BINFMT_ELF=y
143# CONFIG_BINFMT_AOUT is not set
144# CONFIG_BINFMT_MISC is not set
145# CONFIG_ARTHUR is not set
146
147#
148# Power management options
149#
150# CONFIG_PM is not set
151
152#
153# Device Drivers
154#
155
156#
157# Generic Driver Options
158#
159CONFIG_STANDALONE=y
160CONFIG_PREVENT_FIRMWARE_BUILD=y
161# CONFIG_FW_LOADER is not set
162
163#
164# Memory Technology Devices (MTD)
165#
166CONFIG_MTD=y
167CONFIG_MTD_DEBUG=y
168CONFIG_MTD_DEBUG_VERBOSE=0
169# CONFIG_MTD_CONCAT is not set
170CONFIG_MTD_PARTITIONS=y
171# CONFIG_MTD_REDBOOT_PARTS is not set
172# CONFIG_MTD_CMDLINE_PARTS is not set
173# CONFIG_MTD_AFS_PARTS is not set
174
175#
176# User Modules And Translation Layers
177#
178CONFIG_MTD_CHAR=y
179CONFIG_MTD_BLOCK=y
180# CONFIG_FTL is not set
181# CONFIG_NFTL is not set
182# CONFIG_INFTL is not set
183
184#
185# RAM/ROM/Flash chip drivers
186#
187CONFIG_MTD_CFI=y
188# CONFIG_MTD_JEDECPROBE is not set
189CONFIG_MTD_GEN_PROBE=y
190CONFIG_MTD_CFI_ADV_OPTIONS=y
191CONFIG_MTD_CFI_NOSWAP=y
192# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
193# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
194# CONFIG_MTD_CFI_GEOMETRY is not set
195CONFIG_MTD_MAP_BANK_WIDTH_1=y
196CONFIG_MTD_MAP_BANK_WIDTH_2=y
197CONFIG_MTD_MAP_BANK_WIDTH_4=y
198# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
199# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
200# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
201CONFIG_MTD_CFI_I1=y
202CONFIG_MTD_CFI_I2=y
203# CONFIG_MTD_CFI_I4 is not set
204# CONFIG_MTD_CFI_I8 is not set
205CONFIG_MTD_CFI_INTELEXT=y
206# CONFIG_MTD_CFI_AMDSTD is not set
207# CONFIG_MTD_CFI_STAA is not set
208CONFIG_MTD_CFI_UTIL=y
209# CONFIG_MTD_RAM is not set
210# CONFIG_MTD_ROM is not set
211# CONFIG_MTD_ABSENT is not set
212# CONFIG_MTD_XIP is not set
213
214#
215# Mapping drivers for chip access
216#
217# CONFIG_MTD_COMPLEX_MAPPINGS is not set
218# CONFIG_MTD_PHYSMAP is not set
219# CONFIG_MTD_ARM_INTEGRATOR is not set
220# CONFIG_MTD_EDB7312 is not set
221# CONFIG_MTD_H720X is not set
222
223#
224# Self-contained MTD device drivers
225#
226# CONFIG_MTD_SLRAM is not set
227# CONFIG_MTD_PHRAM is not set
228# CONFIG_MTD_MTDRAM is not set
229# CONFIG_MTD_BLKMTD is not set
230# CONFIG_MTD_BLOCK2MTD is not set
231
232#
233# Disk-On-Chip Device Drivers
234#
235# CONFIG_MTD_DOC2000 is not set
236# CONFIG_MTD_DOC2001 is not set
237# CONFIG_MTD_DOC2001PLUS is not set
238
239#
240# NAND Flash Device Drivers
241#
242# CONFIG_MTD_NAND is not set
243
244#
245# Parallel port support
246#
247# CONFIG_PARPORT is not set
248
249#
250# Plug and Play support
251#
252
253#
254# Block devices
255#
256# CONFIG_BLK_DEV_FD is not set
257# CONFIG_BLK_DEV_COW_COMMON is not set
258# CONFIG_BLK_DEV_LOOP is not set
259CONFIG_BLK_DEV_RAM=y
260CONFIG_BLK_DEV_RAM_COUNT=16
261CONFIG_BLK_DEV_RAM_SIZE=8192
262CONFIG_BLK_DEV_INITRD=y
263CONFIG_INITRAMFS_SOURCE=""
264# CONFIG_CDROM_PKTCDVD is not set
265
266#
267# IO Schedulers
268#
269CONFIG_IOSCHED_NOOP=y
270CONFIG_IOSCHED_AS=y
271CONFIG_IOSCHED_DEADLINE=y
272CONFIG_IOSCHED_CFQ=y
273
274#
275# SCSI device support
276#
277# CONFIG_SCSI is not set
278
279#
280# Multi-device support (RAID and LVM)
281#
282# CONFIG_MD is not set
283
284#
285# Fusion MPT device support
286#
287
288#
289# IEEE 1394 (FireWire) support
290#
291
292#
293# I2O device support
294#
295
296#
297# Networking support
298#
299# CONFIG_NET is not set
300# CONFIG_NETPOLL is not set
301# CONFIG_NET_POLL_CONTROLLER is not set
302
303#
304# ISDN subsystem
305#
306
307#
308# Input device support
309#
310CONFIG_INPUT=y
311
312#
313# Userland interfaces
314#
315CONFIG_INPUT_MOUSEDEV=y
316CONFIG_INPUT_MOUSEDEV_PSAUX=y
317CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
318CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
319# CONFIG_INPUT_JOYDEV is not set
320# CONFIG_INPUT_TSDEV is not set
321# CONFIG_INPUT_EVDEV is not set
322# CONFIG_INPUT_EVBUG is not set
323
324#
325# Input Device Drivers
326#
327# CONFIG_INPUT_KEYBOARD is not set
328# CONFIG_INPUT_MOUSE is not set
329# CONFIG_INPUT_JOYSTICK is not set
330# CONFIG_INPUT_TOUCHSCREEN is not set
331# CONFIG_INPUT_MISC is not set
332
333#
334# Hardware I/O ports
335#
336CONFIG_SERIO=y
337CONFIG_SERIO_SERPORT=y
338# CONFIG_SERIO_RAW is not set
339# CONFIG_GAMEPORT is not set
340CONFIG_SOUND_GAMEPORT=y
341
342#
343# Character devices
344#
345CONFIG_VT=y
346CONFIG_VT_CONSOLE=y
347CONFIG_HW_CONSOLE=y
348# CONFIG_SERIAL_NONSTANDARD is not set
349
350#
351# Serial drivers
352#
353# CONFIG_SERIAL_8250 is not set
354
355#
356# Non-8250 serial port support
357#
358CONFIG_UNIX98_PTYS=y
359CONFIG_LEGACY_PTYS=y
360CONFIG_LEGACY_PTY_COUNT=256
361
362#
363# IPMI
364#
365# CONFIG_IPMI_HANDLER is not set
366
367#
368# Watchdog Cards
369#
370# CONFIG_WATCHDOG is not set
371# CONFIG_NVRAM is not set
372# CONFIG_RTC 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_DRM is not set
380# CONFIG_RAW_DRIVER is not set
381
382#
383# TPM devices
384#
385# CONFIG_TCG_TPM is not set
386
387#
388# I2C support
389#
390# CONFIG_I2C is not set
391
392#
393# Misc devices
394#
395
396#
397# Multimedia devices
398#
399# CONFIG_VIDEO_DEV is not set
400
401#
402# Digital Video Broadcasting Devices
403#
404
405#
406# Graphics support
407#
408# CONFIG_FB is not set
409
410#
411# Console display driver support
412#
413# CONFIG_VGA_CONSOLE is not set
414CONFIG_DUMMY_CONSOLE=y
415
416#
417# Sound
418#
419CONFIG_SOUND=m
420
421#
422# Advanced Linux Sound Architecture
423#
424# CONFIG_SND is not set
425
426#
427# Open Sound System
428#
429# CONFIG_SOUND_PRIME is not set
430
431#
432# USB support
433#
434CONFIG_USB_ARCH_HAS_HCD=y
435# CONFIG_USB_ARCH_HAS_OHCI is not set
436# CONFIG_USB is not set
437
438#
439# USB Gadget Support
440#
441# CONFIG_USB_GADGET is not set
442
443#
444# MMC/SD Card support
445#
446# CONFIG_MMC is not set
447
448#
449# File systems
450#
451CONFIG_EXT2_FS=y
452# CONFIG_EXT2_FS_XATTR is not set
453# CONFIG_EXT3_FS is not set
454# CONFIG_JBD is not set
455# CONFIG_REISERFS_FS is not set
456# CONFIG_JFS_FS is not set
457
458#
459# XFS support
460#
461# CONFIG_XFS_FS is not set
462# CONFIG_MINIX_FS is not set
463# CONFIG_ROMFS_FS is not set
464# CONFIG_QUOTA is not set
465CONFIG_DNOTIFY=y
466# CONFIG_AUTOFS_FS is not set
467# CONFIG_AUTOFS4_FS is not set
468
469#
470# CD-ROM/DVD Filesystems
471#
472# CONFIG_ISO9660_FS is not set
473# CONFIG_UDF_FS is not set
474
475#
476# DOS/FAT/NT Filesystems
477#
478# CONFIG_MSDOS_FS is not set
479# CONFIG_VFAT_FS is not set
480# CONFIG_NTFS_FS is not set
481
482#
483# Pseudo filesystems
484#
485CONFIG_PROC_FS=y
486CONFIG_SYSFS=y
487# CONFIG_DEVFS_FS is not set
488# CONFIG_DEVPTS_FS_XATTR is not set
489# CONFIG_TMPFS is not set
490# CONFIG_HUGETLB_PAGE is not set
491CONFIG_RAMFS=y
492
493#
494# Miscellaneous filesystems
495#
496# CONFIG_ADFS_FS is not set
497# CONFIG_AFFS_FS is not set
498# CONFIG_HFS_FS is not set
499# CONFIG_HFSPLUS_FS is not set
500# CONFIG_BEFS_FS is not set
501# CONFIG_BFS_FS is not set
502# CONFIG_EFS_FS is not set
503# CONFIG_JFFS_FS is not set
504CONFIG_JFFS2_FS=y
505CONFIG_JFFS2_FS_DEBUG=0
506# CONFIG_JFFS2_FS_NAND is not set
507# CONFIG_JFFS2_FS_NOR_ECC is not set
508# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
509CONFIG_JFFS2_ZLIB=y
510CONFIG_JFFS2_RTIME=y
511# CONFIG_JFFS2_RUBIN is not set
512# CONFIG_CRAMFS is not set
513# CONFIG_VXFS_FS is not set
514# CONFIG_HPFS_FS is not set
515# CONFIG_QNX4FS_FS is not set
516# CONFIG_SYSV_FS is not set
517# CONFIG_UFS_FS is not set
518
519#
520# Partition Types
521#
522# CONFIG_PARTITION_ADVANCED is not set
523CONFIG_MSDOS_PARTITION=y
524
525#
526# Native Language Support
527#
528# CONFIG_NLS is not set
529
530#
531# Profiling support
532#
533# CONFIG_PROFILING is not set
534
535#
536# Kernel hacking
537#
538# CONFIG_PRINTK_TIME is not set
539# CONFIG_DEBUG_KERNEL is not set
540CONFIG_LOG_BUF_SHIFT=14
541CONFIG_DEBUG_BUGVERBOSE=y
542CONFIG_FRAME_POINTER=y
543CONFIG_DEBUG_USER=y
544
545#
546# Security options
547#
548# CONFIG_KEYS is not set
549# CONFIG_SECURITY is not set
550
551#
552# Cryptographic options
553#
554# CONFIG_CRYPTO is not set
555
556#
557# Hardware crypto devices
558#
559
560#
561# Library routines
562#
563# CONFIG_CRC_CCITT is not set
564CONFIG_CRC32=y
565# CONFIG_LIBCRC32C is not set
566CONFIG_ZLIB_INFLATE=y
567CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/h7202_defconfig b/arch/arm/configs/h7202_defconfig
new file mode 100644
index 000000000000..fbf5c244c696
--- /dev/null
+++ b/arch/arm/configs/h7202_defconfig
@@ -0,0 +1,732 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Mon Mar 28 00:15:45 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_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# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66# CONFIG_ARCH_CAMELOT is not set
67# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73# CONFIG_ARCH_PXA is not set
74# CONFIG_ARCH_RPC is not set
75# CONFIG_ARCH_SA1100 is not set
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81# CONFIG_ARCH_IMX is not set
82CONFIG_ARCH_H720X=y
83
84#
85# h720x Implementations
86#
87# CONFIG_ARCH_H7201 is not set
88CONFIG_ARCH_H7202=y
89CONFIG_CPU_H7202=y
90# CONFIG_H7202_SERIAL23 is not set
91
92#
93# Processor Type
94#
95CONFIG_CPU_32=y
96CONFIG_CPU_ARM720T=y
97CONFIG_CPU_32v4=y
98CONFIG_CPU_ABRT_LV4T=y
99CONFIG_CPU_CACHE_V4=y
100CONFIG_CPU_CACHE_VIVT=y
101CONFIG_CPU_COPY_V4WT=y
102CONFIG_CPU_TLB_V4WT=y
103
104#
105# Processor Features
106#
107# CONFIG_ARM_THUMB is not set
108
109#
110# Bus support
111#
112
113#
114# PCCARD (PCMCIA/CardBus) support
115#
116# CONFIG_PCCARD is not set
117
118#
119# Kernel Features
120#
121# CONFIG_PREEMPT is not set
122CONFIG_ALIGNMENT_TRAP=y
123
124#
125# Boot options
126#
127CONFIG_ZBOOT_ROM_TEXT=0x0
128CONFIG_ZBOOT_ROM_BSS=0x0
129CONFIG_CMDLINE="console=ttyS0,19200"
130# CONFIG_XIP_KERNEL is not set
131
132#
133# Floating point emulation
134#
135
136#
137# At least one emulation must be selected
138#
139CONFIG_FPE_NWFPE=y
140CONFIG_FPE_NWFPE_XP=y
141# CONFIG_FPE_FASTFPE is not set
142
143#
144# Userspace binary formats
145#
146CONFIG_BINFMT_ELF=y
147# CONFIG_BINFMT_AOUT is not set
148# CONFIG_BINFMT_MISC is not set
149# CONFIG_ARTHUR is not set
150
151#
152# Power management options
153#
154# CONFIG_PM is not set
155
156#
157# Device Drivers
158#
159
160#
161# Generic Driver Options
162#
163CONFIG_STANDALONE=y
164CONFIG_PREVENT_FIRMWARE_BUILD=y
165# CONFIG_FW_LOADER is not set
166# CONFIG_DEBUG_DRIVER is not set
167
168#
169# Memory Technology Devices (MTD)
170#
171CONFIG_MTD=y
172# CONFIG_MTD_DEBUG is not set
173# CONFIG_MTD_CONCAT is not set
174CONFIG_MTD_PARTITIONS=y
175# CONFIG_MTD_REDBOOT_PARTS is not set
176CONFIG_MTD_CMDLINE_PARTS=y
177# CONFIG_MTD_AFS_PARTS is not set
178
179#
180# User Modules And Translation Layers
181#
182CONFIG_MTD_CHAR=y
183CONFIG_MTD_BLOCK=y
184# CONFIG_FTL is not set
185# CONFIG_NFTL is not set
186# CONFIG_INFTL is not set
187
188#
189# RAM/ROM/Flash chip drivers
190#
191CONFIG_MTD_CFI=y
192# CONFIG_MTD_JEDECPROBE is not set
193CONFIG_MTD_GEN_PROBE=y
194# CONFIG_MTD_CFI_ADV_OPTIONS is not set
195CONFIG_MTD_MAP_BANK_WIDTH_1=y
196CONFIG_MTD_MAP_BANK_WIDTH_2=y
197CONFIG_MTD_MAP_BANK_WIDTH_4=y
198# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
199# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
200# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
201CONFIG_MTD_CFI_I1=y
202CONFIG_MTD_CFI_I2=y
203# CONFIG_MTD_CFI_I4 is not set
204# CONFIG_MTD_CFI_I8 is not set
205CONFIG_MTD_CFI_INTELEXT=y
206# CONFIG_MTD_CFI_AMDSTD is not set
207# CONFIG_MTD_CFI_STAA is not set
208CONFIG_MTD_CFI_UTIL=y
209# CONFIG_MTD_RAM is not set
210# CONFIG_MTD_ROM is not set
211# CONFIG_MTD_ABSENT is not set
212# CONFIG_MTD_XIP is not set
213
214#
215# Mapping drivers for chip access
216#
217# CONFIG_MTD_COMPLEX_MAPPINGS is not set
218# CONFIG_MTD_PHYSMAP is not set
219# CONFIG_MTD_ARM_INTEGRATOR is not set
220# CONFIG_MTD_EDB7312 is not set
221CONFIG_MTD_H720X=y
222
223#
224# Self-contained MTD device drivers
225#
226# CONFIG_MTD_SLRAM is not set
227# CONFIG_MTD_PHRAM is not set
228# CONFIG_MTD_MTDRAM is not set
229# CONFIG_MTD_BLKMTD is not set
230# CONFIG_MTD_BLOCK2MTD is not set
231
232#
233# Disk-On-Chip Device Drivers
234#
235# CONFIG_MTD_DOC2000 is not set
236# CONFIG_MTD_DOC2001 is not set
237# CONFIG_MTD_DOC2001PLUS is not set
238
239#
240# NAND Flash Device Drivers
241#
242# CONFIG_MTD_NAND is not set
243
244#
245# Parallel port support
246#
247# CONFIG_PARPORT is not set
248
249#
250# Plug and Play support
251#
252
253#
254# Block devices
255#
256# CONFIG_BLK_DEV_FD is not set
257# CONFIG_BLK_DEV_COW_COMMON is not set
258# CONFIG_BLK_DEV_LOOP is not set
259# CONFIG_BLK_DEV_NBD is not set
260# CONFIG_BLK_DEV_RAM is not set
261CONFIG_BLK_DEV_RAM_COUNT=16
262CONFIG_INITRAMFS_SOURCE=""
263# CONFIG_CDROM_PKTCDVD is not set
264
265#
266# IO Schedulers
267#
268CONFIG_IOSCHED_NOOP=y
269CONFIG_IOSCHED_AS=y
270CONFIG_IOSCHED_DEADLINE=y
271CONFIG_IOSCHED_CFQ=y
272# CONFIG_ATA_OVER_ETH is not set
273
274#
275# SCSI device support
276#
277# CONFIG_SCSI is not set
278
279#
280# Multi-device support (RAID and LVM)
281#
282# CONFIG_MD is not set
283
284#
285# Fusion MPT device support
286#
287
288#
289# IEEE 1394 (FireWire) support
290#
291
292#
293# I2O device support
294#
295
296#
297# Networking support
298#
299CONFIG_NET=y
300
301#
302# Networking options
303#
304# CONFIG_PACKET is not set
305# CONFIG_NETLINK_DEV is not set
306CONFIG_UNIX=y
307# CONFIG_NET_KEY is not set
308CONFIG_INET=y
309# CONFIG_IP_MULTICAST is not set
310# CONFIG_IP_ADVANCED_ROUTER is not set
311CONFIG_IP_PNP=y
312# CONFIG_IP_PNP_DHCP is not set
313CONFIG_IP_PNP_BOOTP=y
314# CONFIG_IP_PNP_RARP is not set
315# CONFIG_NET_IPIP is not set
316# CONFIG_NET_IPGRE is not set
317# CONFIG_ARPD is not set
318# CONFIG_SYN_COOKIES is not set
319# CONFIG_INET_AH is not set
320# CONFIG_INET_ESP is not set
321# CONFIG_INET_IPCOMP is not set
322# CONFIG_INET_TUNNEL is not set
323# CONFIG_IP_TCPDIAG is not set
324# CONFIG_IP_TCPDIAG_IPV6 is not set
325# CONFIG_IPV6 is not set
326# CONFIG_NETFILTER is not set
327
328#
329# SCTP Configuration (EXPERIMENTAL)
330#
331# CONFIG_IP_SCTP is not set
332# CONFIG_ATM is not set
333# CONFIG_BRIDGE is not set
334# CONFIG_VLAN_8021Q is not set
335# CONFIG_DECNET is not set
336# CONFIG_LLC2 is not set
337# CONFIG_IPX is not set
338# CONFIG_ATALK is not set
339# CONFIG_X25 is not set
340# CONFIG_LAPB is not set
341# CONFIG_NET_DIVERT is not set
342# CONFIG_ECONET is not set
343# CONFIG_WAN_ROUTER is not set
344
345#
346# QoS and/or fair queueing
347#
348# CONFIG_NET_SCHED is not set
349# CONFIG_NET_CLS_ROUTE is not set
350
351#
352# Network testing
353#
354# CONFIG_NET_PKTGEN is not set
355# CONFIG_NETPOLL is not set
356# CONFIG_NET_POLL_CONTROLLER is not set
357# CONFIG_HAMRADIO is not set
358# CONFIG_IRDA is not set
359# CONFIG_BT is not set
360CONFIG_NETDEVICES=y
361# CONFIG_DUMMY is not set
362# CONFIG_BONDING is not set
363# CONFIG_EQUALIZER is not set
364# CONFIG_TUN is not set
365
366#
367# Ethernet (10 or 100Mbit)
368#
369CONFIG_NET_ETHERNET=y
370# CONFIG_MII is not set
371# CONFIG_SMC91X is not set
372
373#
374# Ethernet (1000 Mbit)
375#
376
377#
378# Ethernet (10000 Mbit)
379#
380
381#
382# Token Ring devices
383#
384
385#
386# Wireless LAN (non-hamradio)
387#
388# CONFIG_NET_RADIO is not set
389
390#
391# Wan interfaces
392#
393# CONFIG_WAN is not set
394# CONFIG_PPP is not set
395# CONFIG_SLIP is not set
396# CONFIG_SHAPER is not set
397# CONFIG_NETCONSOLE is not set
398
399#
400# ISDN subsystem
401#
402# CONFIG_ISDN is not set
403
404#
405# Input device support
406#
407CONFIG_INPUT=y
408
409#
410# Userland interfaces
411#
412CONFIG_INPUT_MOUSEDEV=y
413CONFIG_INPUT_MOUSEDEV_PSAUX=y
414CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
415CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
416# CONFIG_INPUT_JOYDEV is not set
417# CONFIG_INPUT_TSDEV is not set
418# CONFIG_INPUT_EVDEV is not set
419# CONFIG_INPUT_EVBUG is not set
420
421#
422# Input Device Drivers
423#
424CONFIG_INPUT_KEYBOARD=y
425CONFIG_KEYBOARD_ATKBD=y
426# CONFIG_KEYBOARD_SUNKBD is not set
427# CONFIG_KEYBOARD_LKKBD is not set
428# CONFIG_KEYBOARD_XTKBD is not set
429# CONFIG_KEYBOARD_NEWTON is not set
430CONFIG_INPUT_MOUSE=y
431CONFIG_MOUSE_PS2=y
432# CONFIG_MOUSE_SERIAL is not set
433# CONFIG_MOUSE_VSXXXAA is not set
434# CONFIG_INPUT_JOYSTICK is not set
435# CONFIG_INPUT_TOUCHSCREEN is not set
436# CONFIG_INPUT_MISC is not set
437
438#
439# Hardware I/O ports
440#
441CONFIG_SERIO=y
442CONFIG_SERIO_SERPORT=y
443CONFIG_SERIO_LIBPS2=y
444# CONFIG_SERIO_RAW is not set
445# CONFIG_GAMEPORT is not set
446CONFIG_SOUND_GAMEPORT=y
447
448#
449# Character devices
450#
451CONFIG_VT=y
452CONFIG_VT_CONSOLE=y
453CONFIG_HW_CONSOLE=y
454# CONFIG_SERIAL_NONSTANDARD is not set
455
456#
457# Serial drivers
458#
459CONFIG_SERIAL_8250=y
460CONFIG_SERIAL_8250_CONSOLE=y
461CONFIG_SERIAL_8250_NR_UARTS=4
462# CONFIG_SERIAL_8250_EXTENDED is not set
463
464#
465# Non-8250 serial port support
466#
467CONFIG_SERIAL_CORE=y
468CONFIG_SERIAL_CORE_CONSOLE=y
469CONFIG_UNIX98_PTYS=y
470CONFIG_LEGACY_PTYS=y
471CONFIG_LEGACY_PTY_COUNT=256
472
473#
474# IPMI
475#
476# CONFIG_IPMI_HANDLER is not set
477
478#
479# Watchdog Cards
480#
481# CONFIG_WATCHDOG is not set
482# CONFIG_NVRAM is not set
483# CONFIG_RTC is not set
484# CONFIG_DTLK is not set
485# CONFIG_R3964 is not set
486
487#
488# Ftape, the floppy tape device driver
489#
490# CONFIG_DRM is not set
491# CONFIG_RAW_DRIVER is not set
492
493#
494# TPM devices
495#
496# CONFIG_TCG_TPM is not set
497
498#
499# I2C support
500#
501# CONFIG_I2C is not set
502
503#
504# Misc devices
505#
506
507#
508# Multimedia devices
509#
510# CONFIG_VIDEO_DEV is not set
511
512#
513# Digital Video Broadcasting Devices
514#
515# CONFIG_DVB is not set
516
517#
518# Graphics support
519#
520CONFIG_FB=y
521# CONFIG_FB_CFB_FILLRECT is not set
522# CONFIG_FB_CFB_COPYAREA is not set
523# CONFIG_FB_CFB_IMAGEBLIT is not set
524# CONFIG_FB_SOFT_CURSOR is not set
525CONFIG_FB_MODE_HELPERS=y
526# CONFIG_FB_TILEBLITTING is not set
527# CONFIG_FB_VIRTUAL is not set
528
529#
530# Console display driver support
531#
532# CONFIG_VGA_CONSOLE is not set
533CONFIG_DUMMY_CONSOLE=y
534# CONFIG_FRAMEBUFFER_CONSOLE is not set
535
536#
537# Logo configuration
538#
539# CONFIG_LOGO is not set
540# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
541
542#
543# Sound
544#
545# CONFIG_SOUND is not set
546
547#
548# USB support
549#
550CONFIG_USB_ARCH_HAS_HCD=y
551# CONFIG_USB_ARCH_HAS_OHCI is not set
552# CONFIG_USB is not set
553
554#
555# USB Gadget Support
556#
557CONFIG_USB_GADGET=m
558# CONFIG_USB_GADGET_DEBUG_FILES is not set
559# CONFIG_USB_GADGET_NET2280 is not set
560# CONFIG_USB_GADGET_PXA2XX is not set
561# CONFIG_USB_GADGET_GOKU is not set
562# CONFIG_USB_GADGET_SA1100 is not set
563# CONFIG_USB_GADGET_LH7A40X is not set
564# CONFIG_USB_GADGET_DUMMY_HCD is not set
565# CONFIG_USB_GADGET_OMAP is not set
566# CONFIG_USB_GADGET_DUALSPEED is not set
567CONFIG_USB_ZERO=m
568# CONFIG_USB_ETH is not set
569CONFIG_USB_GADGETFS=m
570CONFIG_USB_FILE_STORAGE=m
571CONFIG_USB_FILE_STORAGE_TEST=y
572CONFIG_USB_G_SERIAL=m
573
574#
575# MMC/SD Card support
576#
577# CONFIG_MMC is not set
578
579#
580# File systems
581#
582CONFIG_EXT2_FS=y
583# CONFIG_EXT2_FS_XATTR is not set
584# CONFIG_EXT3_FS is not set
585# CONFIG_JBD is not set
586# CONFIG_REISERFS_FS is not set
587# CONFIG_JFS_FS is not set
588
589#
590# XFS support
591#
592# CONFIG_XFS_FS is not set
593# CONFIG_MINIX_FS is not set
594# CONFIG_ROMFS_FS is not set
595# CONFIG_QUOTA is not set
596CONFIG_DNOTIFY=y
597# CONFIG_AUTOFS_FS is not set
598# CONFIG_AUTOFS4_FS is not set
599
600#
601# CD-ROM/DVD Filesystems
602#
603# CONFIG_ISO9660_FS is not set
604# CONFIG_UDF_FS is not set
605
606#
607# DOS/FAT/NT Filesystems
608#
609# CONFIG_MSDOS_FS is not set
610# CONFIG_VFAT_FS is not set
611# CONFIG_NTFS_FS is not set
612
613#
614# Pseudo filesystems
615#
616CONFIG_PROC_FS=y
617CONFIG_SYSFS=y
618CONFIG_DEVFS_FS=y
619CONFIG_DEVFS_MOUNT=y
620# CONFIG_DEVFS_DEBUG is not set
621# CONFIG_DEVPTS_FS_XATTR is not set
622CONFIG_TMPFS=y
623# CONFIG_TMPFS_XATTR is not set
624# CONFIG_HUGETLB_PAGE is not set
625CONFIG_RAMFS=y
626
627#
628# Miscellaneous filesystems
629#
630# CONFIG_ADFS_FS is not set
631# CONFIG_AFFS_FS is not set
632# CONFIG_HFS_FS is not set
633# CONFIG_HFSPLUS_FS is not set
634# CONFIG_BEFS_FS is not set
635# CONFIG_BFS_FS is not set
636# CONFIG_EFS_FS is not set
637# CONFIG_JFFS_FS is not set
638CONFIG_JFFS2_FS=y
639CONFIG_JFFS2_FS_DEBUG=0
640# CONFIG_JFFS2_FS_NAND is not set
641# CONFIG_JFFS2_FS_NOR_ECC is not set
642# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
643CONFIG_JFFS2_ZLIB=y
644CONFIG_JFFS2_RTIME=y
645# CONFIG_JFFS2_RUBIN is not set
646# CONFIG_CRAMFS is not set
647# CONFIG_VXFS_FS is not set
648# CONFIG_HPFS_FS is not set
649# CONFIG_QNX4FS_FS is not set
650# CONFIG_SYSV_FS is not set
651# CONFIG_UFS_FS is not set
652
653#
654# Network File Systems
655#
656CONFIG_NFS_FS=y
657CONFIG_NFS_V3=y
658# CONFIG_NFS_V4 is not set
659# CONFIG_NFS_DIRECTIO is not set
660# CONFIG_NFSD is not set
661# CONFIG_ROOT_NFS is not set
662CONFIG_LOCKD=y
663CONFIG_LOCKD_V4=y
664CONFIG_SUNRPC=y
665# CONFIG_RPCSEC_GSS_KRB5 is not set
666# CONFIG_RPCSEC_GSS_SPKM3 is not set
667# CONFIG_SMB_FS is not set
668# CONFIG_CIFS is not set
669# CONFIG_NCP_FS is not set
670# CONFIG_CODA_FS is not set
671# CONFIG_AFS_FS is not set
672
673#
674# Partition Types
675#
676# CONFIG_PARTITION_ADVANCED is not set
677CONFIG_MSDOS_PARTITION=y
678
679#
680# Native Language Support
681#
682# CONFIG_NLS is not set
683
684#
685# Profiling support
686#
687# CONFIG_PROFILING is not set
688
689#
690# Kernel hacking
691#
692# CONFIG_PRINTK_TIME is not set
693CONFIG_DEBUG_KERNEL=y
694CONFIG_MAGIC_SYSRQ=y
695CONFIG_LOG_BUF_SHIFT=14
696# CONFIG_SCHEDSTATS is not set
697# CONFIG_DEBUG_SLAB is not set
698# CONFIG_DEBUG_SPINLOCK is not set
699# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
700# CONFIG_DEBUG_KOBJECT is not set
701CONFIG_DEBUG_BUGVERBOSE=y
702CONFIG_DEBUG_INFO=y
703# CONFIG_DEBUG_FS is not set
704CONFIG_FRAME_POINTER=y
705CONFIG_DEBUG_USER=y
706# CONFIG_DEBUG_WAITQ is not set
707# CONFIG_DEBUG_ERRORS is not set
708# CONFIG_DEBUG_LL is not set
709
710#
711# Security options
712#
713# CONFIG_KEYS is not set
714# CONFIG_SECURITY is not set
715
716#
717# Cryptographic options
718#
719# CONFIG_CRYPTO is not set
720
721#
722# Hardware crypto devices
723#
724
725#
726# Library routines
727#
728# CONFIG_CRC_CCITT is not set
729CONFIG_CRC32=y
730# CONFIG_LIBCRC32C is not set
731CONFIG_ZLIB_INFLATE=y
732CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/hackkit_defconfig b/arch/arm/configs/hackkit_defconfig
new file mode 100644
index 000000000000..6987c8c5ddb4
--- /dev/null
+++ b/arch/arm/configs/hackkit_defconfig
@@ -0,0 +1,768 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Mon Mar 28 00:22:34 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_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# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66# CONFIG_ARCH_CAMELOT is not set
67# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73# CONFIG_ARCH_PXA is not set
74# CONFIG_ARCH_RPC is not set
75CONFIG_ARCH_SA1100=y
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81# CONFIG_ARCH_IMX is not set
82# CONFIG_ARCH_H720X is not set
83
84#
85# SA11x0 Implementations
86#
87# CONFIG_SA1100_ASSABET is not set
88# CONFIG_SA1100_CERF is not set
89# CONFIG_SA1100_COLLIE is not set
90# CONFIG_SA1100_H3100 is not set
91# CONFIG_SA1100_H3600 is not set
92# CONFIG_SA1100_H3800 is not set
93# CONFIG_SA1100_BADGE4 is not set
94# CONFIG_SA1100_JORNADA720 is not set
95CONFIG_SA1100_HACKKIT=y
96# CONFIG_SA1100_LART is not set
97# CONFIG_SA1100_PLEB is not set
98# CONFIG_SA1100_SHANNON is not set
99# CONFIG_SA1100_SIMPAD is not set
100# CONFIG_SA1100_SSP is not set
101
102#
103# Processor Type
104#
105CONFIG_CPU_32=y
106CONFIG_CPU_SA1100=y
107CONFIG_CPU_32v4=y
108CONFIG_CPU_ABRT_EV4=y
109CONFIG_CPU_CACHE_V4WB=y
110CONFIG_CPU_CACHE_VIVT=y
111CONFIG_CPU_TLB_V4WB=y
112CONFIG_CPU_MINICACHE=y
113
114#
115# Processor Features
116#
117
118#
119# Bus support
120#
121CONFIG_ISA=y
122
123#
124# PCCARD (PCMCIA/CardBus) support
125#
126# CONFIG_PCCARD is not set
127
128#
129# Kernel Features
130#
131# CONFIG_PREEMPT is not set
132CONFIG_DISCONTIGMEM=y
133CONFIG_LEDS=y
134CONFIG_LEDS_TIMER=y
135CONFIG_LEDS_CPU=y
136CONFIG_ALIGNMENT_TRAP=y
137
138#
139# Boot options
140#
141CONFIG_ZBOOT_ROM_TEXT=0x0
142CONFIG_ZBOOT_ROM_BSS=0x0
143CONFIG_CMDLINE="console=ttySA0,115200 root=/dev/ram0 initrd=0xc0400000,8M init=/rootshell"
144# CONFIG_XIP_KERNEL is not set
145
146#
147# CPU Frequency scaling
148#
149CONFIG_CPU_FREQ=y
150CONFIG_CPU_FREQ_TABLE=y
151# CONFIG_CPU_FREQ_DEBUG is not set
152CONFIG_CPU_FREQ_STAT=y
153# CONFIG_CPU_FREQ_STAT_DETAILS is not set
154CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
155# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
156CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
157# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
158# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
159# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
160
161#
162# Floating point emulation
163#
164
165#
166# At least one emulation must be selected
167#
168CONFIG_FPE_NWFPE=y
169# CONFIG_FPE_NWFPE_XP is not set
170# CONFIG_FPE_FASTFPE is not set
171
172#
173# Userspace binary formats
174#
175CONFIG_BINFMT_ELF=y
176CONFIG_BINFMT_AOUT=y
177# CONFIG_BINFMT_MISC is not set
178# CONFIG_ARTHUR is not set
179
180#
181# Power management options
182#
183# CONFIG_PM is not set
184
185#
186# Device Drivers
187#
188
189#
190# Generic Driver Options
191#
192CONFIG_STANDALONE=y
193CONFIG_PREVENT_FIRMWARE_BUILD=y
194# CONFIG_FW_LOADER is not set
195# CONFIG_DEBUG_DRIVER is not set
196
197#
198# Memory Technology Devices (MTD)
199#
200CONFIG_MTD=y
201CONFIG_MTD_DEBUG=y
202CONFIG_MTD_DEBUG_VERBOSE=3
203# CONFIG_MTD_CONCAT is not set
204# CONFIG_MTD_PARTITIONS is not set
205
206#
207# User Modules And Translation Layers
208#
209CONFIG_MTD_CHAR=y
210CONFIG_MTD_BLOCK=y
211# CONFIG_FTL is not set
212# CONFIG_NFTL is not set
213# CONFIG_INFTL is not set
214
215#
216# RAM/ROM/Flash chip drivers
217#
218CONFIG_MTD_CFI=y
219# CONFIG_MTD_JEDECPROBE is not set
220CONFIG_MTD_GEN_PROBE=y
221# CONFIG_MTD_CFI_ADV_OPTIONS is not set
222CONFIG_MTD_MAP_BANK_WIDTH_1=y
223CONFIG_MTD_MAP_BANK_WIDTH_2=y
224CONFIG_MTD_MAP_BANK_WIDTH_4=y
225# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
226# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
227# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
228CONFIG_MTD_CFI_I1=y
229CONFIG_MTD_CFI_I2=y
230# CONFIG_MTD_CFI_I4 is not set
231# CONFIG_MTD_CFI_I8 is not set
232CONFIG_MTD_CFI_INTELEXT=y
233# CONFIG_MTD_CFI_AMDSTD is not set
234# CONFIG_MTD_CFI_STAA is not set
235CONFIG_MTD_CFI_UTIL=y
236# CONFIG_MTD_RAM is not set
237# CONFIG_MTD_ROM is not set
238# CONFIG_MTD_ABSENT is not set
239# CONFIG_MTD_XIP is not set
240
241#
242# Mapping drivers for chip access
243#
244# CONFIG_MTD_COMPLEX_MAPPINGS is not set
245# CONFIG_MTD_PHYSMAP is not set
246# CONFIG_MTD_ARM_INTEGRATOR is not set
247# CONFIG_MTD_EDB7312 is not set
248
249#
250# Self-contained MTD device drivers
251#
252# CONFIG_MTD_SLRAM is not set
253# CONFIG_MTD_PHRAM is not set
254# CONFIG_MTD_MTDRAM is not set
255# CONFIG_MTD_BLKMTD is not set
256# CONFIG_MTD_BLOCK2MTD is not set
257
258#
259# Disk-On-Chip Device Drivers
260#
261# CONFIG_MTD_DOC2000 is not set
262# CONFIG_MTD_DOC2001 is not set
263# CONFIG_MTD_DOC2001PLUS is not set
264
265#
266# NAND Flash Device Drivers
267#
268# CONFIG_MTD_NAND is not set
269
270#
271# Parallel port support
272#
273# CONFIG_PARPORT is not set
274
275#
276# Plug and Play support
277#
278# CONFIG_PNP is not set
279
280#
281# Block devices
282#
283# CONFIG_BLK_DEV_FD is not set
284# CONFIG_BLK_DEV_XD is not set
285# CONFIG_BLK_DEV_COW_COMMON is not set
286# CONFIG_BLK_DEV_LOOP is not set
287# CONFIG_BLK_DEV_NBD is not set
288CONFIG_BLK_DEV_RAM=y
289CONFIG_BLK_DEV_RAM_COUNT=16
290CONFIG_BLK_DEV_RAM_SIZE=8192
291CONFIG_BLK_DEV_INITRD=y
292CONFIG_INITRAMFS_SOURCE=""
293# CONFIG_CDROM_PKTCDVD is not set
294
295#
296# IO Schedulers
297#
298CONFIG_IOSCHED_NOOP=y
299CONFIG_IOSCHED_AS=y
300CONFIG_IOSCHED_DEADLINE=y
301CONFIG_IOSCHED_CFQ=y
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_SCSI is not set
313
314#
315# Multi-device support (RAID and LVM)
316#
317# CONFIG_MD is not set
318
319#
320# Fusion MPT device support
321#
322
323#
324# IEEE 1394 (FireWire) support
325#
326
327#
328# I2O device support
329#
330
331#
332# Networking support
333#
334CONFIG_NET=y
335
336#
337# Networking options
338#
339CONFIG_PACKET=y
340# CONFIG_PACKET_MMAP is not set
341# CONFIG_NETLINK_DEV is not set
342CONFIG_UNIX=y
343# CONFIG_NET_KEY is not set
344CONFIG_INET=y
345# CONFIG_IP_MULTICAST is not set
346# CONFIG_IP_ADVANCED_ROUTER is not set
347# CONFIG_IP_PNP is not set
348# CONFIG_NET_IPIP is not set
349# CONFIG_NET_IPGRE 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
356# CONFIG_IP_TCPDIAG is not set
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
394CONFIG_DUMMY=y
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#
407# CONFIG_NET_ETHERNET is not set
408
409#
410# Ethernet (1000 Mbit)
411#
412
413#
414# Ethernet (10000 Mbit)
415#
416
417#
418# Token Ring devices
419#
420# CONFIG_TR is not set
421
422#
423# Wireless LAN (non-hamradio)
424#
425CONFIG_NET_RADIO=y
426
427#
428# Obsolete Wireless cards support (pre-802.11)
429#
430# CONFIG_STRIP is not set
431# CONFIG_ARLAN is not set
432# CONFIG_WAVELAN is not set
433
434#
435# Wireless 802.11b ISA/PCI cards support
436#
437# CONFIG_ATMEL is not set
438CONFIG_NET_WIRELESS=y
439
440#
441# Wan interfaces
442#
443# CONFIG_WAN 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
449#
450# ISDN subsystem
451#
452# CONFIG_ISDN is not set
453
454#
455# Input device support
456#
457CONFIG_INPUT=y
458
459#
460# Userland interfaces
461#
462CONFIG_INPUT_MOUSEDEV=y
463CONFIG_INPUT_MOUSEDEV_PSAUX=y
464CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
465CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
466# CONFIG_INPUT_JOYDEV is not set
467# CONFIG_INPUT_TSDEV is not set
468# CONFIG_INPUT_EVDEV is not set
469# CONFIG_INPUT_EVBUG is not set
470
471#
472# Input Device Drivers
473#
474# CONFIG_INPUT_KEYBOARD is not set
475# CONFIG_INPUT_MOUSE is not set
476# CONFIG_INPUT_JOYSTICK is not set
477# CONFIG_INPUT_TOUCHSCREEN is not set
478# CONFIG_INPUT_MISC is not set
479
480#
481# Hardware I/O ports
482#
483CONFIG_SERIO=y
484CONFIG_SERIO_SERPORT=y
485# CONFIG_SERIO_RAW is not set
486# CONFIG_GAMEPORT is not set
487CONFIG_SOUND_GAMEPORT=y
488
489#
490# Character devices
491#
492CONFIG_VT=y
493CONFIG_VT_CONSOLE=y
494CONFIG_HW_CONSOLE=y
495# CONFIG_SERIAL_NONSTANDARD is not set
496
497#
498# Serial drivers
499#
500# CONFIG_SERIAL_8250 is not set
501
502#
503# Non-8250 serial port support
504#
505CONFIG_SERIAL_SA1100=y
506CONFIG_SERIAL_SA1100_CONSOLE=y
507CONFIG_SERIAL_CORE=y
508CONFIG_SERIAL_CORE_CONSOLE=y
509CONFIG_UNIX98_PTYS=y
510CONFIG_LEGACY_PTYS=y
511CONFIG_LEGACY_PTY_COUNT=256
512
513#
514# IPMI
515#
516# CONFIG_IPMI_HANDLER is not set
517
518#
519# Watchdog Cards
520#
521# CONFIG_WATCHDOG is not set
522# CONFIG_NVRAM is not set
523# CONFIG_RTC is not set
524# CONFIG_DTLK is not set
525# CONFIG_R3964 is not set
526
527#
528# Ftape, the floppy tape device driver
529#
530# CONFIG_DRM is not set
531# CONFIG_RAW_DRIVER is not set
532
533#
534# TPM devices
535#
536# CONFIG_TCG_TPM is not set
537
538#
539# I2C support
540#
541# CONFIG_I2C is not set
542
543#
544# Misc devices
545#
546
547#
548# Multimedia devices
549#
550# CONFIG_VIDEO_DEV is not set
551
552#
553# Digital Video Broadcasting Devices
554#
555# CONFIG_DVB is not set
556
557#
558# Graphics support
559#
560# CONFIG_FB is not set
561
562#
563# Console display driver support
564#
565# CONFIG_VGA_CONSOLE is not set
566# CONFIG_MDA_CONSOLE is not set
567CONFIG_DUMMY_CONSOLE=y
568
569#
570# Sound
571#
572# CONFIG_SOUND is not set
573
574#
575# USB support
576#
577CONFIG_USB_ARCH_HAS_HCD=y
578# CONFIG_USB_ARCH_HAS_OHCI is not set
579# CONFIG_USB is not set
580
581#
582# USB Gadget Support
583#
584# CONFIG_USB_GADGET is not set
585
586#
587# MMC/SD Card support
588#
589# CONFIG_MMC is not set
590
591#
592# File systems
593#
594CONFIG_EXT2_FS=y
595# CONFIG_EXT2_FS_XATTR is not set
596# CONFIG_EXT3_FS is not set
597# CONFIG_JBD is not set
598# CONFIG_REISERFS_FS is not set
599# CONFIG_JFS_FS is not set
600
601#
602# XFS support
603#
604# CONFIG_XFS_FS is not set
605# CONFIG_MINIX_FS is not set
606# CONFIG_ROMFS_FS is not set
607# CONFIG_QUOTA is not set
608CONFIG_DNOTIFY=y
609# CONFIG_AUTOFS_FS is not set
610# CONFIG_AUTOFS4_FS is not set
611
612#
613# CD-ROM/DVD Filesystems
614#
615# CONFIG_ISO9660_FS is not set
616# CONFIG_UDF_FS is not set
617
618#
619# DOS/FAT/NT Filesystems
620#
621CONFIG_FAT_FS=y
622CONFIG_MSDOS_FS=y
623CONFIG_VFAT_FS=y
624CONFIG_FAT_DEFAULT_CODEPAGE=437
625CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
626# CONFIG_NTFS_FS is not set
627
628#
629# Pseudo filesystems
630#
631CONFIG_PROC_FS=y
632CONFIG_SYSFS=y
633# CONFIG_DEVFS_FS is not set
634# CONFIG_DEVPTS_FS_XATTR is not set
635CONFIG_TMPFS=y
636# CONFIG_TMPFS_XATTR is not set
637# CONFIG_HUGETLB_PAGE is not set
638CONFIG_RAMFS=y
639
640#
641# Miscellaneous filesystems
642#
643# CONFIG_ADFS_FS is not set
644# CONFIG_AFFS_FS is not set
645# CONFIG_HFS_FS is not set
646# CONFIG_HFSPLUS_FS is not set
647# CONFIG_BEFS_FS is not set
648# CONFIG_BFS_FS is not set
649# CONFIG_EFS_FS is not set
650# CONFIG_JFFS_FS is not set
651# CONFIG_JFFS2_FS is not set
652CONFIG_CRAMFS=y
653# CONFIG_VXFS_FS is not set
654# CONFIG_HPFS_FS is not set
655# CONFIG_QNX4FS_FS is not set
656# CONFIG_SYSV_FS is not set
657# CONFIG_UFS_FS is not set
658
659#
660# Network File Systems
661#
662# CONFIG_NFS_FS is not set
663# CONFIG_NFSD is not set
664# CONFIG_SMB_FS is not set
665# CONFIG_CIFS is not set
666# CONFIG_NCP_FS is not set
667# CONFIG_CODA_FS is not set
668# CONFIG_AFS_FS is not set
669
670#
671# Partition Types
672#
673# CONFIG_PARTITION_ADVANCED is not set
674CONFIG_MSDOS_PARTITION=y
675
676#
677# Native Language Support
678#
679CONFIG_NLS=y
680CONFIG_NLS_DEFAULT="iso8859-1"
681# CONFIG_NLS_CODEPAGE_437 is not set
682# CONFIG_NLS_CODEPAGE_737 is not set
683# CONFIG_NLS_CODEPAGE_775 is not set
684# CONFIG_NLS_CODEPAGE_850 is not set
685# CONFIG_NLS_CODEPAGE_852 is not set
686# CONFIG_NLS_CODEPAGE_855 is not set
687# CONFIG_NLS_CODEPAGE_857 is not set
688# CONFIG_NLS_CODEPAGE_860 is not set
689# CONFIG_NLS_CODEPAGE_861 is not set
690# CONFIG_NLS_CODEPAGE_862 is not set
691# CONFIG_NLS_CODEPAGE_863 is not set
692# CONFIG_NLS_CODEPAGE_864 is not set
693# CONFIG_NLS_CODEPAGE_865 is not set
694# CONFIG_NLS_CODEPAGE_866 is not set
695# CONFIG_NLS_CODEPAGE_869 is not set
696# CONFIG_NLS_CODEPAGE_936 is not set
697# CONFIG_NLS_CODEPAGE_950 is not set
698# CONFIG_NLS_CODEPAGE_932 is not set
699# CONFIG_NLS_CODEPAGE_949 is not set
700# CONFIG_NLS_CODEPAGE_874 is not set
701# CONFIG_NLS_ISO8859_8 is not set
702# CONFIG_NLS_CODEPAGE_1250 is not set
703# CONFIG_NLS_CODEPAGE_1251 is not set
704# CONFIG_NLS_ASCII is not set
705# CONFIG_NLS_ISO8859_1 is not set
706# CONFIG_NLS_ISO8859_2 is not set
707# CONFIG_NLS_ISO8859_3 is not set
708# CONFIG_NLS_ISO8859_4 is not set
709# CONFIG_NLS_ISO8859_5 is not set
710# CONFIG_NLS_ISO8859_6 is not set
711# CONFIG_NLS_ISO8859_7 is not set
712# CONFIG_NLS_ISO8859_9 is not set
713# CONFIG_NLS_ISO8859_13 is not set
714# CONFIG_NLS_ISO8859_14 is not set
715# CONFIG_NLS_ISO8859_15 is not set
716# CONFIG_NLS_KOI8_R is not set
717# CONFIG_NLS_KOI8_U is not set
718# CONFIG_NLS_UTF8 is not set
719
720#
721# Profiling support
722#
723# CONFIG_PROFILING is not set
724
725#
726# Kernel hacking
727#
728# CONFIG_PRINTK_TIME is not set
729CONFIG_DEBUG_KERNEL=y
730CONFIG_MAGIC_SYSRQ=y
731CONFIG_LOG_BUF_SHIFT=14
732# CONFIG_SCHEDSTATS is not set
733CONFIG_DEBUG_SLAB=y
734CONFIG_DEBUG_SPINLOCK=y
735# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
736# CONFIG_DEBUG_KOBJECT is not set
737CONFIG_DEBUG_BUGVERBOSE=y
738# CONFIG_DEBUG_INFO is not set
739# CONFIG_DEBUG_FS is not set
740CONFIG_FRAME_POINTER=y
741CONFIG_DEBUG_USER=y
742CONFIG_DEBUG_WAITQ=y
743CONFIG_DEBUG_ERRORS=y
744CONFIG_DEBUG_LL=y
745# CONFIG_DEBUG_ICEDCC is not set
746
747#
748# Security options
749#
750# CONFIG_KEYS is not set
751# CONFIG_SECURITY is not set
752
753#
754# Cryptographic options
755#
756# CONFIG_CRYPTO is not set
757
758#
759# Hardware crypto devices
760#
761
762#
763# Library routines
764#
765# CONFIG_CRC_CCITT is not set
766# CONFIG_CRC32 is not set
767# CONFIG_LIBCRC32C is not set
768CONFIG_ZLIB_INFLATE=y
diff --git a/arch/arm/configs/integrator_defconfig b/arch/arm/configs/integrator_defconfig
new file mode 100644
index 000000000000..27ee76825254
--- /dev/null
+++ b/arch/arm/configs/integrator_defconfig
@@ -0,0 +1,864 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 21:14:51 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32CONFIG_IKCONFIG=y
33CONFIG_IKCONFIG_PROC=y
34# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
60
61#
62# System Type
63#
64# CONFIG_ARCH_CLPS7500 is not set
65# CONFIG_ARCH_CLPS711X is not set
66# CONFIG_ARCH_CO285 is not set
67# CONFIG_ARCH_EBSA110 is not set
68# CONFIG_ARCH_CAMELOT is not set
69# CONFIG_ARCH_FOOTBRIDGE is not set
70CONFIG_ARCH_INTEGRATOR=y
71# CONFIG_ARCH_IOP3XX is not set
72# CONFIG_ARCH_IXP4XX is not set
73# CONFIG_ARCH_IXP2000 is not set
74# CONFIG_ARCH_L7200 is not set
75# CONFIG_ARCH_PXA is not set
76# CONFIG_ARCH_RPC is not set
77# CONFIG_ARCH_SA1100 is not set
78# CONFIG_ARCH_S3C2410 is not set
79# CONFIG_ARCH_SHARK is not set
80# CONFIG_ARCH_LH7A40X is not set
81# CONFIG_ARCH_OMAP is not set
82# CONFIG_ARCH_VERSATILE is not set
83# CONFIG_ARCH_IMX is not set
84# CONFIG_ARCH_H720X is not set
85
86#
87# Integrator Options
88#
89CONFIG_ARCH_INTEGRATOR_AP=y
90# CONFIG_ARCH_INTEGRATOR_CP is not set
91# CONFIG_INTEGRATOR_IMPD1 is not set
92
93#
94# Processor Type
95#
96CONFIG_CPU_32=y
97CONFIG_CPU_ARM720T=y
98CONFIG_CPU_ARM920T=y
99# CONFIG_CPU_ARM922T is not set
100# CONFIG_CPU_ARM926T is not set
101# CONFIG_CPU_ARM1020 is not set
102# CONFIG_CPU_ARM1022 is not set
103# CONFIG_CPU_ARM1026 is not set
104# CONFIG_CPU_V6 is not set
105CONFIG_CPU_32v4=y
106CONFIG_CPU_ABRT_EV4T=y
107CONFIG_CPU_ABRT_LV4T=y
108CONFIG_CPU_CACHE_V4=y
109CONFIG_CPU_CACHE_V4WT=y
110CONFIG_CPU_CACHE_VIVT=y
111CONFIG_CPU_COPY_V4WT=y
112CONFIG_CPU_COPY_V4WB=y
113CONFIG_CPU_TLB_V4WT=y
114CONFIG_CPU_TLB_V4WBI=y
115
116#
117# Processor Features
118#
119CONFIG_ARM_THUMB=y
120# CONFIG_CPU_ICACHE_DISABLE is not set
121# CONFIG_CPU_DCACHE_DISABLE is not set
122# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
123CONFIG_ICST525=y
124
125#
126# Bus support
127#
128CONFIG_ARM_AMBA=y
129CONFIG_PCI=y
130CONFIG_PCI_LEGACY_PROC=y
131CONFIG_PCI_NAMES=y
132
133#
134# PCCARD (PCMCIA/CardBus) support
135#
136# CONFIG_PCCARD is not set
137
138#
139# Kernel Features
140#
141# CONFIG_PREEMPT is not set
142CONFIG_LEDS=y
143CONFIG_LEDS_TIMER=y
144CONFIG_LEDS_CPU=y
145CONFIG_ALIGNMENT_TRAP=y
146
147#
148# Boot options
149#
150CONFIG_ZBOOT_ROM_TEXT=0x0
151CONFIG_ZBOOT_ROM_BSS=0x0
152CONFIG_CMDLINE="console=ttyAM0,38400n8 root=/dev/nfs ip=bootp mem=32M"
153# CONFIG_XIP_KERNEL is not set
154
155#
156# CPU Frequency scaling
157#
158CONFIG_CPU_FREQ=y
159CONFIG_CPU_FREQ_TABLE=y
160# CONFIG_CPU_FREQ_DEBUG is not set
161CONFIG_CPU_FREQ_STAT=y
162# CONFIG_CPU_FREQ_STAT_DETAILS is not set
163CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
164# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
165CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
166CONFIG_CPU_FREQ_GOV_POWERSAVE=y
167CONFIG_CPU_FREQ_GOV_USERSPACE=y
168CONFIG_CPU_FREQ_GOV_ONDEMAND=y
169CONFIG_CPU_FREQ_INTEGRATOR=y
170
171#
172# Floating point emulation
173#
174
175#
176# At least one emulation must be selected
177#
178CONFIG_FPE_NWFPE=y
179# CONFIG_FPE_NWFPE_XP is not set
180# CONFIG_FPE_FASTFPE is not set
181
182#
183# Userspace binary formats
184#
185CONFIG_BINFMT_ELF=y
186# CONFIG_BINFMT_AOUT is not set
187# CONFIG_BINFMT_MISC is not set
188# CONFIG_ARTHUR is not set
189
190#
191# Power management options
192#
193CONFIG_PM=y
194# CONFIG_APM is not set
195
196#
197# Device Drivers
198#
199
200#
201# Generic Driver Options
202#
203CONFIG_STANDALONE=y
204CONFIG_PREVENT_FIRMWARE_BUILD=y
205# CONFIG_FW_LOADER is not set
206# CONFIG_DEBUG_DRIVER is not set
207
208#
209# Memory Technology Devices (MTD)
210#
211CONFIG_MTD=y
212# CONFIG_MTD_DEBUG is not set
213# CONFIG_MTD_CONCAT is not set
214CONFIG_MTD_PARTITIONS=y
215# CONFIG_MTD_REDBOOT_PARTS is not set
216CONFIG_MTD_CMDLINE_PARTS=y
217CONFIG_MTD_AFS_PARTS=y
218
219#
220# User Modules And Translation Layers
221#
222CONFIG_MTD_CHAR=y
223CONFIG_MTD_BLOCK=y
224# CONFIG_FTL is not set
225# CONFIG_NFTL is not set
226# CONFIG_INFTL is not set
227
228#
229# RAM/ROM/Flash chip drivers
230#
231CONFIG_MTD_CFI=y
232# CONFIG_MTD_JEDECPROBE is not set
233CONFIG_MTD_GEN_PROBE=y
234CONFIG_MTD_CFI_ADV_OPTIONS=y
235CONFIG_MTD_CFI_NOSWAP=y
236# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
237# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
238# CONFIG_MTD_CFI_GEOMETRY is not set
239CONFIG_MTD_MAP_BANK_WIDTH_1=y
240CONFIG_MTD_MAP_BANK_WIDTH_2=y
241CONFIG_MTD_MAP_BANK_WIDTH_4=y
242# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
243# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
244# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
245CONFIG_MTD_CFI_I1=y
246CONFIG_MTD_CFI_I2=y
247# CONFIG_MTD_CFI_I4 is not set
248# CONFIG_MTD_CFI_I8 is not set
249CONFIG_MTD_CFI_INTELEXT=y
250# CONFIG_MTD_CFI_AMDSTD is not set
251# CONFIG_MTD_CFI_STAA is not set
252CONFIG_MTD_CFI_UTIL=y
253# CONFIG_MTD_RAM is not set
254# CONFIG_MTD_ROM is not set
255# CONFIG_MTD_ABSENT is not set
256# CONFIG_MTD_XIP is not set
257
258#
259# Mapping drivers for chip access
260#
261# CONFIG_MTD_COMPLEX_MAPPINGS is not set
262# CONFIG_MTD_PHYSMAP is not set
263# CONFIG_MTD_ARM_INTEGRATOR is not set
264# CONFIG_MTD_EDB7312 is not set
265
266#
267# Self-contained MTD device drivers
268#
269# CONFIG_MTD_PMC551 is not set
270# CONFIG_MTD_SLRAM is not set
271# CONFIG_MTD_PHRAM is not set
272# CONFIG_MTD_MTDRAM is not set
273# CONFIG_MTD_BLKMTD is not set
274# CONFIG_MTD_BLOCK2MTD is not set
275
276#
277# Disk-On-Chip Device Drivers
278#
279# CONFIG_MTD_DOC2000 is not set
280# CONFIG_MTD_DOC2001 is not set
281# CONFIG_MTD_DOC2001PLUS is not set
282
283#
284# NAND Flash Device Drivers
285#
286# CONFIG_MTD_NAND is not set
287
288#
289# Parallel port support
290#
291# CONFIG_PARPORT is not set
292
293#
294# Plug and Play support
295#
296
297#
298# Block devices
299#
300# CONFIG_BLK_DEV_FD is not set
301# CONFIG_BLK_CPQ_DA is not set
302# CONFIG_BLK_CPQ_CISS_DA is not set
303# CONFIG_BLK_DEV_DAC960 is not set
304# CONFIG_BLK_DEV_UMEM is not set
305# CONFIG_BLK_DEV_COW_COMMON is not set
306CONFIG_BLK_DEV_LOOP=y
307# CONFIG_BLK_DEV_CRYPTOLOOP is not set
308# CONFIG_BLK_DEV_NBD is not set
309# CONFIG_BLK_DEV_SX8 is not set
310CONFIG_BLK_DEV_RAM=y
311CONFIG_BLK_DEV_RAM_COUNT=16
312CONFIG_BLK_DEV_RAM_SIZE=8192
313CONFIG_BLK_DEV_INITRD=y
314CONFIG_INITRAMFS_SOURCE=""
315# CONFIG_CDROM_PKTCDVD is not set
316
317#
318# IO Schedulers
319#
320CONFIG_IOSCHED_NOOP=y
321CONFIG_IOSCHED_AS=y
322CONFIG_IOSCHED_DEADLINE=y
323CONFIG_IOSCHED_CFQ=y
324# CONFIG_ATA_OVER_ETH is not set
325
326#
327# SCSI device support
328#
329# CONFIG_SCSI is not set
330
331#
332# Multi-device support (RAID and LVM)
333#
334# CONFIG_MD is not set
335
336#
337# Fusion MPT device support
338#
339
340#
341# IEEE 1394 (FireWire) support
342#
343# CONFIG_IEEE1394 is not set
344
345#
346# I2O device support
347#
348# CONFIG_I2O is not set
349
350#
351# Networking support
352#
353CONFIG_NET=y
354
355#
356# Networking options
357#
358CONFIG_PACKET=y
359CONFIG_PACKET_MMAP=y
360# CONFIG_NETLINK_DEV is not set
361CONFIG_UNIX=y
362# CONFIG_NET_KEY is not set
363CONFIG_INET=y
364CONFIG_IP_MULTICAST=y
365# CONFIG_IP_ADVANCED_ROUTER is not set
366CONFIG_IP_PNP=y
367CONFIG_IP_PNP_DHCP=y
368CONFIG_IP_PNP_BOOTP=y
369# CONFIG_IP_PNP_RARP is not set
370# CONFIG_NET_IPIP is not set
371# CONFIG_NET_IPGRE is not set
372# CONFIG_IP_MROUTE is not set
373# CONFIG_ARPD is not set
374# CONFIG_SYN_COOKIES is not set
375# CONFIG_INET_AH is not set
376# CONFIG_INET_ESP is not set
377# CONFIG_INET_IPCOMP is not set
378# CONFIG_INET_TUNNEL is not set
379CONFIG_IP_TCPDIAG=y
380# CONFIG_IP_TCPDIAG_IPV6 is not set
381# CONFIG_IPV6 is not set
382# CONFIG_NETFILTER is not set
383
384#
385# SCTP Configuration (EXPERIMENTAL)
386#
387# CONFIG_IP_SCTP is not set
388# CONFIG_ATM is not set
389# CONFIG_BRIDGE is not set
390# CONFIG_VLAN_8021Q is not set
391# CONFIG_DECNET is not set
392# CONFIG_LLC2 is not set
393# CONFIG_IPX is not set
394# CONFIG_ATALK is not set
395# CONFIG_X25 is not set
396# CONFIG_LAPB is not set
397# CONFIG_NET_DIVERT is not set
398# CONFIG_ECONET is not set
399# CONFIG_WAN_ROUTER is not set
400
401#
402# QoS and/or fair queueing
403#
404# CONFIG_NET_SCHED is not set
405# CONFIG_NET_CLS_ROUTE is not set
406
407#
408# Network testing
409#
410# CONFIG_NET_PKTGEN is not set
411# CONFIG_NETPOLL is not set
412# CONFIG_NET_POLL_CONTROLLER is not set
413# CONFIG_HAMRADIO is not set
414# CONFIG_IRDA is not set
415# CONFIG_BT is not set
416CONFIG_NETDEVICES=y
417# CONFIG_DUMMY is not set
418# CONFIG_BONDING is not set
419# CONFIG_EQUALIZER is not set
420# CONFIG_TUN is not set
421
422#
423# ARCnet devices
424#
425# CONFIG_ARCNET is not set
426
427#
428# Ethernet (10 or 100Mbit)
429#
430CONFIG_NET_ETHERNET=y
431CONFIG_MII=y
432# CONFIG_HAPPYMEAL is not set
433# CONFIG_SUNGEM is not set
434# CONFIG_NET_VENDOR_3COM is not set
435# CONFIG_SMC91X is not set
436
437#
438# Tulip family network device support
439#
440# CONFIG_NET_TULIP is not set
441# CONFIG_HP100 is not set
442CONFIG_NET_PCI=y
443# CONFIG_PCNET32 is not set
444# CONFIG_AMD8111_ETH is not set
445# CONFIG_ADAPTEC_STARFIRE is not set
446# CONFIG_B44 is not set
447# CONFIG_FORCEDETH is not set
448# CONFIG_DGRS is not set
449# CONFIG_EEPRO100 is not set
450CONFIG_E100=y
451# CONFIG_FEALNX is not set
452# CONFIG_NATSEMI is not set
453# CONFIG_NE2K_PCI is not set
454# CONFIG_8139CP is not set
455# CONFIG_8139TOO is not set
456# CONFIG_SIS900 is not set
457# CONFIG_EPIC100 is not set
458# CONFIG_SUNDANCE is not set
459# CONFIG_TLAN is not set
460# CONFIG_VIA_RHINE is not set
461
462#
463# Ethernet (1000 Mbit)
464#
465# CONFIG_ACENIC is not set
466# CONFIG_DL2K is not set
467# CONFIG_E1000 is not set
468# CONFIG_NS83820 is not set
469# CONFIG_HAMACHI is not set
470# CONFIG_YELLOWFIN is not set
471# CONFIG_R8169 is not set
472# CONFIG_SK98LIN is not set
473# CONFIG_VIA_VELOCITY is not set
474# CONFIG_TIGON3 is not set
475
476#
477# Ethernet (10000 Mbit)
478#
479# CONFIG_IXGB is not set
480# CONFIG_S2IO is not set
481
482#
483# Token Ring devices
484#
485# CONFIG_TR is not set
486
487#
488# Wireless LAN (non-hamradio)
489#
490# CONFIG_NET_RADIO is not set
491
492#
493# Wan interfaces
494#
495# CONFIG_WAN is not set
496# CONFIG_FDDI is not set
497# CONFIG_HIPPI is not set
498# CONFIG_PPP is not set
499# CONFIG_SLIP is not set
500# CONFIG_SHAPER is not set
501# CONFIG_NETCONSOLE is not set
502
503#
504# ISDN subsystem
505#
506# CONFIG_ISDN is not set
507
508#
509# Input device support
510#
511CONFIG_INPUT=y
512
513#
514# Userland interfaces
515#
516CONFIG_INPUT_MOUSEDEV=y
517CONFIG_INPUT_MOUSEDEV_PSAUX=y
518CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
519CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
520# CONFIG_INPUT_JOYDEV is not set
521# CONFIG_INPUT_TSDEV is not set
522# CONFIG_INPUT_EVDEV is not set
523# CONFIG_INPUT_EVBUG is not set
524
525#
526# Input Device Drivers
527#
528CONFIG_INPUT_KEYBOARD=y
529# CONFIG_KEYBOARD_ATKBD is not set
530# CONFIG_KEYBOARD_SUNKBD is not set
531# CONFIG_KEYBOARD_LKKBD is not set
532# CONFIG_KEYBOARD_XTKBD is not set
533# CONFIG_KEYBOARD_NEWTON is not set
534CONFIG_INPUT_MOUSE=y
535CONFIG_MOUSE_PS2=y
536# CONFIG_MOUSE_SERIAL is not set
537# CONFIG_MOUSE_VSXXXAA is not set
538# CONFIG_INPUT_JOYSTICK is not set
539# CONFIG_INPUT_TOUCHSCREEN is not set
540# CONFIG_INPUT_MISC is not set
541
542#
543# Hardware I/O ports
544#
545CONFIG_SERIO=y
546# CONFIG_SERIO_SERPORT is not set
547# CONFIG_SERIO_AMBAKMI is not set
548# CONFIG_SERIO_PCIPS2 is not set
549CONFIG_SERIO_LIBPS2=y
550# CONFIG_SERIO_RAW is not set
551# CONFIG_GAMEPORT is not set
552CONFIG_SOUND_GAMEPORT=y
553
554#
555# Character devices
556#
557CONFIG_VT=y
558CONFIG_VT_CONSOLE=y
559CONFIG_HW_CONSOLE=y
560# CONFIG_SERIAL_NONSTANDARD is not set
561
562#
563# Serial drivers
564#
565# CONFIG_SERIAL_8250 is not set
566
567#
568# Non-8250 serial port support
569#
570CONFIG_SERIAL_AMBA_PL010=y
571CONFIG_SERIAL_AMBA_PL010_CONSOLE=y
572# CONFIG_SERIAL_AMBA_PL011 is not set
573CONFIG_SERIAL_CORE=y
574CONFIG_SERIAL_CORE_CONSOLE=y
575CONFIG_UNIX98_PTYS=y
576CONFIG_LEGACY_PTYS=y
577CONFIG_LEGACY_PTY_COUNT=256
578
579#
580# IPMI
581#
582# CONFIG_IPMI_HANDLER is not set
583
584#
585# Watchdog Cards
586#
587# CONFIG_WATCHDOG is not set
588# CONFIG_NVRAM is not set
589# CONFIG_RTC is not set
590# CONFIG_DTLK is not set
591# CONFIG_R3964 is not set
592# CONFIG_APPLICOM is not set
593
594#
595# Ftape, the floppy tape device driver
596#
597# CONFIG_DRM is not set
598# CONFIG_RAW_DRIVER is not set
599
600#
601# TPM devices
602#
603# CONFIG_TCG_TPM is not set
604
605#
606# I2C support
607#
608# CONFIG_I2C is not set
609
610#
611# Misc devices
612#
613
614#
615# Multimedia devices
616#
617# CONFIG_VIDEO_DEV is not set
618
619#
620# Digital Video Broadcasting Devices
621#
622# CONFIG_DVB is not set
623
624#
625# Graphics support
626#
627CONFIG_FB=y
628CONFIG_FB_CFB_FILLRECT=y
629CONFIG_FB_CFB_COPYAREA=y
630CONFIG_FB_CFB_IMAGEBLIT=y
631CONFIG_FB_SOFT_CURSOR=y
632CONFIG_FB_MODE_HELPERS=y
633CONFIG_FB_TILEBLITTING=y
634# CONFIG_FB_CIRRUS is not set
635# CONFIG_FB_PM2 is not set
636# CONFIG_FB_ARMCLCD is not set
637# CONFIG_FB_CYBER2000 is not set
638# CONFIG_FB_ASILIANT is not set
639# CONFIG_FB_IMSTT is not set
640# CONFIG_FB_NVIDIA is not set
641# CONFIG_FB_RIVA is not set
642CONFIG_FB_MATROX=y
643CONFIG_FB_MATROX_MILLENIUM=y
644CONFIG_FB_MATROX_MYSTIQUE=y
645# CONFIG_FB_MATROX_G is not set
646CONFIG_FB_MATROX_MULTIHEAD=y
647# CONFIG_FB_RADEON_OLD is not set
648# CONFIG_FB_RADEON is not set
649# CONFIG_FB_ATY128 is not set
650# CONFIG_FB_ATY is not set
651# CONFIG_FB_SAVAGE is not set
652# CONFIG_FB_SIS is not set
653# CONFIG_FB_NEOMAGIC is not set
654# CONFIG_FB_KYRO is not set
655# CONFIG_FB_3DFX is not set
656# CONFIG_FB_VOODOO1 is not set
657# CONFIG_FB_TRIDENT is not set
658# CONFIG_FB_VIRTUAL is not set
659
660#
661# Console display driver support
662#
663CONFIG_VGA_CONSOLE=y
664CONFIG_DUMMY_CONSOLE=y
665# CONFIG_FRAMEBUFFER_CONSOLE is not set
666
667#
668# Logo configuration
669#
670# CONFIG_LOGO is not set
671# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
672
673#
674# Sound
675#
676# CONFIG_SOUND is not set
677
678#
679# USB support
680#
681CONFIG_USB_ARCH_HAS_HCD=y
682CONFIG_USB_ARCH_HAS_OHCI=y
683# CONFIG_USB is not set
684
685#
686# USB Gadget Support
687#
688# CONFIG_USB_GADGET is not set
689
690#
691# MMC/SD Card support
692#
693# CONFIG_MMC is not set
694
695#
696# File systems
697#
698CONFIG_EXT2_FS=y
699# CONFIG_EXT2_FS_XATTR is not set
700# CONFIG_EXT3_FS is not set
701# CONFIG_JBD is not set
702# CONFIG_REISERFS_FS is not set
703# CONFIG_JFS_FS is not set
704
705#
706# XFS support
707#
708# CONFIG_XFS_FS is not set
709# CONFIG_MINIX_FS is not set
710# CONFIG_ROMFS_FS is not set
711# CONFIG_QUOTA is not set
712CONFIG_DNOTIFY=y
713# CONFIG_AUTOFS_FS is not set
714# CONFIG_AUTOFS4_FS is not set
715
716#
717# CD-ROM/DVD Filesystems
718#
719# CONFIG_ISO9660_FS is not set
720# CONFIG_UDF_FS is not set
721
722#
723# DOS/FAT/NT Filesystems
724#
725# CONFIG_MSDOS_FS is not set
726# CONFIG_VFAT_FS is not set
727# CONFIG_NTFS_FS is not set
728
729#
730# Pseudo filesystems
731#
732CONFIG_PROC_FS=y
733CONFIG_SYSFS=y
734# CONFIG_DEVFS_FS is not set
735# CONFIG_DEVPTS_FS_XATTR is not set
736CONFIG_TMPFS=y
737# CONFIG_TMPFS_XATTR is not set
738# CONFIG_HUGETLB_PAGE is not set
739CONFIG_RAMFS=y
740
741#
742# Miscellaneous filesystems
743#
744# CONFIG_ADFS_FS is not set
745# CONFIG_AFFS_FS is not set
746# CONFIG_HFS_FS is not set
747# CONFIG_HFSPLUS_FS is not set
748# CONFIG_BEFS_FS is not set
749# CONFIG_BFS_FS is not set
750# CONFIG_EFS_FS is not set
751# CONFIG_JFFS_FS is not set
752CONFIG_JFFS2_FS=y
753CONFIG_JFFS2_FS_DEBUG=0
754# CONFIG_JFFS2_FS_NAND is not set
755# CONFIG_JFFS2_FS_NOR_ECC is not set
756# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
757CONFIG_JFFS2_ZLIB=y
758CONFIG_JFFS2_RTIME=y
759# CONFIG_JFFS2_RUBIN is not set
760CONFIG_CRAMFS=y
761# CONFIG_VXFS_FS is not set
762# CONFIG_HPFS_FS is not set
763# CONFIG_QNX4FS_FS is not set
764# CONFIG_SYSV_FS is not set
765# CONFIG_UFS_FS is not set
766
767#
768# Network File Systems
769#
770CONFIG_NFS_FS=y
771CONFIG_NFS_V3=y
772# CONFIG_NFS_V4 is not set
773# CONFIG_NFS_DIRECTIO is not set
774CONFIG_NFSD=y
775CONFIG_NFSD_V3=y
776# CONFIG_NFSD_V4 is not set
777# CONFIG_NFSD_TCP is not set
778CONFIG_ROOT_NFS=y
779CONFIG_LOCKD=y
780CONFIG_LOCKD_V4=y
781CONFIG_EXPORTFS=y
782CONFIG_SUNRPC=y
783# CONFIG_RPCSEC_GSS_KRB5 is not set
784# CONFIG_RPCSEC_GSS_SPKM3 is not set
785# CONFIG_SMB_FS is not set
786# CONFIG_CIFS is not set
787# CONFIG_NCP_FS is not set
788# CONFIG_CODA_FS is not set
789# CONFIG_AFS_FS is not set
790
791#
792# Partition Types
793#
794CONFIG_PARTITION_ADVANCED=y
795# CONFIG_ACORN_PARTITION is not set
796# CONFIG_OSF_PARTITION is not set
797# CONFIG_AMIGA_PARTITION is not set
798# CONFIG_ATARI_PARTITION is not set
799# CONFIG_MAC_PARTITION is not set
800CONFIG_MSDOS_PARTITION=y
801# CONFIG_BSD_DISKLABEL is not set
802# CONFIG_MINIX_SUBPARTITION is not set
803# CONFIG_SOLARIS_X86_PARTITION is not set
804# CONFIG_UNIXWARE_DISKLABEL is not set
805# CONFIG_LDM_PARTITION is not set
806# CONFIG_SGI_PARTITION is not set
807# CONFIG_ULTRIX_PARTITION is not set
808# CONFIG_SUN_PARTITION is not set
809# CONFIG_EFI_PARTITION is not set
810
811#
812# Native Language Support
813#
814# CONFIG_NLS is not set
815
816#
817# Profiling support
818#
819# CONFIG_PROFILING is not set
820
821#
822# Kernel hacking
823#
824# CONFIG_PRINTK_TIME is not set
825CONFIG_DEBUG_KERNEL=y
826CONFIG_MAGIC_SYSRQ=y
827CONFIG_LOG_BUF_SHIFT=14
828# CONFIG_SCHEDSTATS is not set
829# CONFIG_DEBUG_SLAB is not set
830# CONFIG_DEBUG_SPINLOCK is not set
831# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
832# CONFIG_DEBUG_KOBJECT is not set
833CONFIG_DEBUG_BUGVERBOSE=y
834# CONFIG_DEBUG_INFO is not set
835# CONFIG_DEBUG_FS is not set
836CONFIG_FRAME_POINTER=y
837# CONFIG_DEBUG_USER is not set
838# CONFIG_DEBUG_WAITQ is not set
839CONFIG_DEBUG_ERRORS=y
840# CONFIG_DEBUG_LL is not set
841
842#
843# Security options
844#
845# CONFIG_KEYS is not set
846# CONFIG_SECURITY is not set
847
848#
849# Cryptographic options
850#
851# CONFIG_CRYPTO is not set
852
853#
854# Hardware crypto devices
855#
856
857#
858# Library routines
859#
860# CONFIG_CRC_CCITT is not set
861CONFIG_CRC32=y
862# CONFIG_LIBCRC32C is not set
863CONFIG_ZLIB_INFLATE=y
864CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/iq31244_defconfig b/arch/arm/configs/iq31244_defconfig
new file mode 100644
index 000000000000..e71443b97390
--- /dev/null
+++ b/arch/arm/configs/iq31244_defconfig
@@ -0,0 +1,922 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 02:10:38 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33CONFIG_IKCONFIG=y
34CONFIG_IKCONFIG_PROC=y
35# CONFIG_EMBEDDED is not set
36CONFIG_KALLSYMS=y
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
60
61#
62# System Type
63#
64# CONFIG_ARCH_CLPS7500 is not set
65# CONFIG_ARCH_CLPS711X is not set
66# CONFIG_ARCH_CO285 is not set
67# CONFIG_ARCH_EBSA110 is not set
68# CONFIG_ARCH_CAMELOT is not set
69# CONFIG_ARCH_FOOTBRIDGE is not set
70# CONFIG_ARCH_INTEGRATOR is not set
71CONFIG_ARCH_IOP3XX=y
72# CONFIG_ARCH_IXP4XX is not set
73# CONFIG_ARCH_IXP2000 is not set
74# CONFIG_ARCH_L7200 is not set
75# CONFIG_ARCH_PXA is not set
76# CONFIG_ARCH_RPC is not set
77# CONFIG_ARCH_SA1100 is not set
78# CONFIG_ARCH_S3C2410 is not set
79# CONFIG_ARCH_SHARK is not set
80# CONFIG_ARCH_LH7A40X is not set
81# CONFIG_ARCH_OMAP is not set
82# CONFIG_ARCH_VERSATILE is not set
83# CONFIG_ARCH_IMX is not set
84# CONFIG_ARCH_H720X is not set
85
86#
87# IOP3xx Implementation Options
88#
89
90#
91# IOP3xx Platform Types
92#
93# CONFIG_ARCH_IQ80321 is not set
94CONFIG_ARCH_IQ31244=y
95# CONFIG_ARCH_IQ80331 is not set
96# CONFIG_MACH_IQ80332 is not set
97# CONFIG_ARCH_EP80219 is not set
98CONFIG_ARCH_IOP321=y
99# CONFIG_ARCH_IOP331 is not set
100
101#
102# IOP3xx Chipset Features
103#
104
105#
106# Processor Type
107#
108CONFIG_CPU_32=y
109CONFIG_CPU_XSCALE=y
110CONFIG_CPU_32v5=y
111CONFIG_CPU_ABRT_EV5T=y
112CONFIG_CPU_CACHE_VIVT=y
113CONFIG_CPU_TLB_V4WBI=y
114CONFIG_CPU_MINICACHE=y
115
116#
117# Processor Features
118#
119# CONFIG_ARM_THUMB is not set
120CONFIG_XSCALE_PMU=y
121
122#
123# Bus support
124#
125CONFIG_PCI=y
126# CONFIG_PCI_LEGACY_PROC is not set
127CONFIG_PCI_NAMES=y
128
129#
130# PCCARD (PCMCIA/CardBus) support
131#
132# CONFIG_PCCARD is not set
133
134#
135# Kernel Features
136#
137# CONFIG_PREEMPT is not set
138CONFIG_ALIGNMENT_TRAP=y
139
140#
141# Boot options
142#
143CONFIG_ZBOOT_ROM_TEXT=0x0
144CONFIG_ZBOOT_ROM_BSS=0x0
145CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200"
146# CONFIG_XIP_KERNEL is not set
147
148#
149# Floating point emulation
150#
151
152#
153# At least one emulation must be selected
154#
155CONFIG_FPE_NWFPE=y
156# CONFIG_FPE_NWFPE_XP is not set
157# CONFIG_FPE_FASTFPE is not set
158
159#
160# Userspace binary formats
161#
162CONFIG_BINFMT_ELF=y
163CONFIG_BINFMT_AOUT=y
164# CONFIG_BINFMT_MISC is not set
165# CONFIG_ARTHUR is not set
166
167#
168# Power management options
169#
170# CONFIG_PM is not set
171
172#
173# Device Drivers
174#
175
176#
177# Generic Driver Options
178#
179CONFIG_STANDALONE=y
180CONFIG_PREVENT_FIRMWARE_BUILD=y
181# CONFIG_FW_LOADER is not set
182
183#
184# Memory Technology Devices (MTD)
185#
186CONFIG_MTD=y
187# CONFIG_MTD_DEBUG is not set
188# CONFIG_MTD_CONCAT is not set
189CONFIG_MTD_PARTITIONS=y
190CONFIG_MTD_REDBOOT_PARTS=y
191CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
192CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
193CONFIG_MTD_REDBOOT_PARTS_READONLY=y
194# CONFIG_MTD_CMDLINE_PARTS is not set
195# CONFIG_MTD_AFS_PARTS is not set
196
197#
198# User Modules And Translation Layers
199#
200CONFIG_MTD_CHAR=y
201CONFIG_MTD_BLOCK=y
202# CONFIG_FTL is not set
203# CONFIG_NFTL is not set
204# CONFIG_INFTL is not set
205
206#
207# RAM/ROM/Flash chip drivers
208#
209CONFIG_MTD_CFI=y
210# CONFIG_MTD_JEDECPROBE is not set
211CONFIG_MTD_GEN_PROBE=y
212# CONFIG_MTD_CFI_ADV_OPTIONS is not set
213CONFIG_MTD_MAP_BANK_WIDTH_1=y
214CONFIG_MTD_MAP_BANK_WIDTH_2=y
215CONFIG_MTD_MAP_BANK_WIDTH_4=y
216# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
217# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
218# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
219CONFIG_MTD_CFI_I1=y
220CONFIG_MTD_CFI_I2=y
221# CONFIG_MTD_CFI_I4 is not set
222# CONFIG_MTD_CFI_I8 is not set
223CONFIG_MTD_CFI_INTELEXT=y
224# CONFIG_MTD_CFI_AMDSTD is not set
225# CONFIG_MTD_CFI_STAA is not set
226CONFIG_MTD_CFI_UTIL=y
227# CONFIG_MTD_RAM is not set
228# CONFIG_MTD_ROM is not set
229# CONFIG_MTD_ABSENT is not set
230# CONFIG_MTD_XIP is not set
231
232#
233# Mapping drivers for chip access
234#
235# CONFIG_MTD_COMPLEX_MAPPINGS is not set
236CONFIG_MTD_PHYSMAP=y
237CONFIG_MTD_PHYSMAP_START=0xf0000000
238CONFIG_MTD_PHYSMAP_LEN=0x00800000
239CONFIG_MTD_PHYSMAP_BANKWIDTH=2
240# CONFIG_MTD_ARM_INTEGRATOR is not set
241# CONFIG_MTD_EDB7312 is not set
242
243#
244# Self-contained MTD device drivers
245#
246# CONFIG_MTD_PMC551 is not set
247# CONFIG_MTD_SLRAM is not set
248# CONFIG_MTD_PHRAM is not set
249# CONFIG_MTD_MTDRAM is not set
250# CONFIG_MTD_BLKMTD is not set
251# CONFIG_MTD_BLOCK2MTD is not set
252
253#
254# Disk-On-Chip Device Drivers
255#
256# CONFIG_MTD_DOC2000 is not set
257# CONFIG_MTD_DOC2001 is not set
258# CONFIG_MTD_DOC2001PLUS is not set
259
260#
261# NAND Flash Device Drivers
262#
263# CONFIG_MTD_NAND is not set
264
265#
266# Parallel port support
267#
268# CONFIG_PARPORT is not set
269
270#
271# Plug and Play support
272#
273
274#
275# Block devices
276#
277# CONFIG_BLK_DEV_FD is not set
278# CONFIG_BLK_CPQ_DA is not set
279# CONFIG_BLK_CPQ_CISS_DA is not set
280# CONFIG_BLK_DEV_DAC960 is not set
281# CONFIG_BLK_DEV_UMEM is not set
282# CONFIG_BLK_DEV_COW_COMMON is not set
283# CONFIG_BLK_DEV_LOOP is not set
284# CONFIG_BLK_DEV_NBD is not set
285# CONFIG_BLK_DEV_SX8 is not set
286CONFIG_BLK_DEV_RAM=y
287CONFIG_BLK_DEV_RAM_COUNT=16
288CONFIG_BLK_DEV_RAM_SIZE=8192
289# CONFIG_BLK_DEV_INITRD is not set
290CONFIG_INITRAMFS_SOURCE=""
291# CONFIG_CDROM_PKTCDVD is not set
292
293#
294# IO Schedulers
295#
296CONFIG_IOSCHED_NOOP=y
297CONFIG_IOSCHED_AS=y
298CONFIG_IOSCHED_DEADLINE=y
299CONFIG_IOSCHED_CFQ=y
300# CONFIG_ATA_OVER_ETH is not set
301
302#
303# ATA/ATAPI/MFM/RLL support
304#
305# CONFIG_IDE is not set
306
307#
308# SCSI device support
309#
310CONFIG_SCSI=y
311CONFIG_SCSI_PROC_FS=y
312
313#
314# SCSI support type (disk, tape, CD-ROM)
315#
316CONFIG_BLK_DEV_SD=y
317# CONFIG_CHR_DEV_ST is not set
318# CONFIG_CHR_DEV_OSST is not set
319# CONFIG_BLK_DEV_SR is not set
320CONFIG_CHR_DEV_SG=y
321
322#
323# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
324#
325# CONFIG_SCSI_MULTI_LUN is not set
326# CONFIG_SCSI_CONSTANTS is not set
327# CONFIG_SCSI_LOGGING is not set
328
329#
330# SCSI Transport Attributes
331#
332# CONFIG_SCSI_SPI_ATTRS is not set
333# CONFIG_SCSI_FC_ATTRS is not set
334# CONFIG_SCSI_ISCSI_ATTRS is not set
335
336#
337# SCSI low-level drivers
338#
339# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
340# CONFIG_SCSI_3W_9XXX is not set
341# CONFIG_SCSI_ACARD is not set
342# CONFIG_SCSI_AACRAID is not set
343# CONFIG_SCSI_AIC7XXX is not set
344# CONFIG_SCSI_AIC7XXX_OLD is not set
345# CONFIG_SCSI_AIC79XX is not set
346# CONFIG_SCSI_DPT_I2O is not set
347# CONFIG_MEGARAID_NEWGEN is not set
348# CONFIG_MEGARAID_LEGACY is not set
349# CONFIG_SCSI_SATA is not set
350# CONFIG_SCSI_BUSLOGIC is not set
351# CONFIG_SCSI_DMX3191D is not set
352# CONFIG_SCSI_EATA is not set
353# CONFIG_SCSI_FUTURE_DOMAIN is not set
354# CONFIG_SCSI_GDTH is not set
355# CONFIG_SCSI_IPS is not set
356# CONFIG_SCSI_INITIO is not set
357# CONFIG_SCSI_INIA100 is not set
358# CONFIG_SCSI_SYM53C8XX_2 is not set
359# CONFIG_SCSI_IPR is not set
360# CONFIG_SCSI_QLOGIC_FC is not set
361# CONFIG_SCSI_QLOGIC_1280 is not set
362CONFIG_SCSI_QLA2XXX=y
363# CONFIG_SCSI_QLA21XX is not set
364# CONFIG_SCSI_QLA22XX is not set
365# CONFIG_SCSI_QLA2300 is not set
366# CONFIG_SCSI_QLA2322 is not set
367# CONFIG_SCSI_QLA6312 is not set
368# CONFIG_SCSI_DC395x is not set
369# CONFIG_SCSI_DC390T is not set
370# CONFIG_SCSI_NSP32 is not set
371# CONFIG_SCSI_DEBUG is not set
372
373#
374# Multi-device support (RAID and LVM)
375#
376CONFIG_MD=y
377CONFIG_BLK_DEV_MD=y
378# CONFIG_MD_LINEAR is not set
379CONFIG_MD_RAID0=y
380CONFIG_MD_RAID1=y
381# CONFIG_MD_RAID10 is not set
382CONFIG_MD_RAID5=y
383# CONFIG_MD_RAID6 is not set
384# CONFIG_MD_MULTIPATH is not set
385# CONFIG_MD_FAULTY is not set
386CONFIG_BLK_DEV_DM=y
387# CONFIG_DM_CRYPT is not set
388# CONFIG_DM_SNAPSHOT is not set
389# CONFIG_DM_MIRROR is not set
390# CONFIG_DM_ZERO is not set
391# CONFIG_DM_MULTIPATH is not set
392
393#
394# Fusion MPT device support
395#
396# CONFIG_FUSION is not set
397
398#
399# IEEE 1394 (FireWire) support
400#
401# CONFIG_IEEE1394 is not set
402
403#
404# I2O device support
405#
406# CONFIG_I2O is not set
407
408#
409# Networking support
410#
411CONFIG_NET=y
412
413#
414# Networking options
415#
416CONFIG_PACKET=y
417CONFIG_PACKET_MMAP=y
418# CONFIG_NETLINK_DEV is not set
419CONFIG_UNIX=y
420# CONFIG_NET_KEY is not set
421CONFIG_INET=y
422CONFIG_IP_MULTICAST=y
423# CONFIG_IP_ADVANCED_ROUTER is not set
424CONFIG_IP_PNP=y
425# CONFIG_IP_PNP_DHCP is not set
426CONFIG_IP_PNP_BOOTP=y
427# CONFIG_IP_PNP_RARP is not set
428# CONFIG_NET_IPIP is not set
429# CONFIG_NET_IPGRE is not set
430# CONFIG_IP_MROUTE is not set
431# CONFIG_ARPD is not set
432# CONFIG_SYN_COOKIES is not set
433# CONFIG_INET_AH is not set
434# CONFIG_INET_ESP is not set
435# CONFIG_INET_IPCOMP is not set
436# CONFIG_INET_TUNNEL is not set
437CONFIG_IP_TCPDIAG=y
438# CONFIG_IP_TCPDIAG_IPV6 is not set
439# CONFIG_IPV6 is not set
440# CONFIG_NETFILTER is not set
441
442#
443# SCTP Configuration (EXPERIMENTAL)
444#
445# CONFIG_IP_SCTP is not set
446# CONFIG_ATM is not set
447# CONFIG_BRIDGE is not set
448# CONFIG_VLAN_8021Q is not set
449# CONFIG_DECNET is not set
450# CONFIG_LLC2 is not set
451# CONFIG_IPX is not set
452# CONFIG_ATALK is not set
453# CONFIG_X25 is not set
454# CONFIG_LAPB is not set
455# CONFIG_NET_DIVERT is not set
456# CONFIG_ECONET is not set
457# CONFIG_WAN_ROUTER is not set
458
459#
460# QoS and/or fair queueing
461#
462# CONFIG_NET_SCHED is not set
463# CONFIG_NET_CLS_ROUTE is not set
464
465#
466# Network testing
467#
468# CONFIG_NET_PKTGEN is not set
469# CONFIG_NETPOLL is not set
470# CONFIG_NET_POLL_CONTROLLER is not set
471# CONFIG_HAMRADIO is not set
472# CONFIG_IRDA is not set
473# CONFIG_BT is not set
474CONFIG_NETDEVICES=y
475# CONFIG_DUMMY is not set
476# CONFIG_BONDING is not set
477# CONFIG_EQUALIZER is not set
478# CONFIG_TUN is not set
479
480#
481# ARCnet devices
482#
483# CONFIG_ARCNET is not set
484
485#
486# Ethernet (10 or 100Mbit)
487#
488# CONFIG_NET_ETHERNET is not set
489
490#
491# Ethernet (1000 Mbit)
492#
493# CONFIG_ACENIC is not set
494# CONFIG_DL2K is not set
495CONFIG_E1000=y
496CONFIG_E1000_NAPI=y
497# CONFIG_NS83820 is not set
498# CONFIG_HAMACHI is not set
499# CONFIG_YELLOWFIN is not set
500# CONFIG_R8169 is not set
501# CONFIG_SK98LIN is not set
502# CONFIG_TIGON3 is not set
503
504#
505# Ethernet (10000 Mbit)
506#
507# CONFIG_IXGB is not set
508# CONFIG_S2IO is not set
509
510#
511# Token Ring devices
512#
513# CONFIG_TR is not set
514
515#
516# Wireless LAN (non-hamradio)
517#
518# CONFIG_NET_RADIO is not set
519
520#
521# Wan interfaces
522#
523# CONFIG_WAN is not set
524# CONFIG_FDDI is not set
525# CONFIG_HIPPI is not set
526# CONFIG_PPP is not set
527# CONFIG_SLIP is not set
528# CONFIG_NET_FC is not set
529# CONFIG_SHAPER is not set
530# CONFIG_NETCONSOLE is not set
531
532#
533# ISDN subsystem
534#
535# CONFIG_ISDN is not set
536
537#
538# Input device support
539#
540CONFIG_INPUT=y
541
542#
543# Userland interfaces
544#
545CONFIG_INPUT_MOUSEDEV=y
546# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
547CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
548CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
549# CONFIG_INPUT_JOYDEV is not set
550# CONFIG_INPUT_TSDEV is not set
551# CONFIG_INPUT_EVDEV is not set
552# CONFIG_INPUT_EVBUG is not set
553
554#
555# Input Device Drivers
556#
557# CONFIG_INPUT_KEYBOARD is not set
558# CONFIG_INPUT_MOUSE is not set
559# CONFIG_INPUT_JOYSTICK is not set
560# CONFIG_INPUT_TOUCHSCREEN is not set
561# CONFIG_INPUT_MISC is not set
562
563#
564# Hardware I/O ports
565#
566# CONFIG_SERIO is not set
567# CONFIG_GAMEPORT is not set
568CONFIG_SOUND_GAMEPORT=y
569
570#
571# Character devices
572#
573CONFIG_VT=y
574CONFIG_VT_CONSOLE=y
575CONFIG_HW_CONSOLE=y
576# CONFIG_SERIAL_NONSTANDARD is not set
577
578#
579# Serial drivers
580#
581CONFIG_SERIAL_8250=y
582CONFIG_SERIAL_8250_CONSOLE=y
583CONFIG_SERIAL_8250_NR_UARTS=4
584# CONFIG_SERIAL_8250_EXTENDED is not set
585
586#
587# Non-8250 serial port support
588#
589CONFIG_SERIAL_CORE=y
590CONFIG_SERIAL_CORE_CONSOLE=y
591CONFIG_UNIX98_PTYS=y
592CONFIG_LEGACY_PTYS=y
593CONFIG_LEGACY_PTY_COUNT=256
594
595#
596# IPMI
597#
598# CONFIG_IPMI_HANDLER is not set
599
600#
601# Watchdog Cards
602#
603# CONFIG_WATCHDOG is not set
604# CONFIG_NVRAM is not set
605# CONFIG_RTC is not set
606# CONFIG_DTLK is not set
607# CONFIG_R3964 is not set
608# CONFIG_APPLICOM is not set
609
610#
611# Ftape, the floppy tape device driver
612#
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#
624CONFIG_I2C=y
625CONFIG_I2C_CHARDEV=y
626
627#
628# I2C Algorithms
629#
630# CONFIG_I2C_ALGOBIT is not set
631# CONFIG_I2C_ALGOPCF is not set
632# CONFIG_I2C_ALGOPCA is not set
633
634#
635# I2C Hardware Bus support
636#
637# CONFIG_I2C_ALI1535 is not set
638# CONFIG_I2C_ALI1563 is not set
639# CONFIG_I2C_ALI15X3 is not set
640# CONFIG_I2C_AMD756 is not set
641# CONFIG_I2C_AMD8111 is not set
642# CONFIG_I2C_I801 is not set
643# CONFIG_I2C_I810 is not set
644CONFIG_I2C_IOP3XX=y
645# CONFIG_I2C_ISA is not set
646# CONFIG_I2C_NFORCE2 is not set
647# CONFIG_I2C_PARPORT_LIGHT is not set
648# CONFIG_I2C_PIIX4 is not set
649# CONFIG_I2C_PROSAVAGE is not set
650# CONFIG_I2C_SAVAGE4 is not set
651# CONFIG_SCx200_ACB is not set
652# CONFIG_I2C_SIS5595 is not set
653# CONFIG_I2C_SIS630 is not set
654# CONFIG_I2C_SIS96X is not set
655# CONFIG_I2C_STUB is not set
656# CONFIG_I2C_VIA is not set
657# CONFIG_I2C_VIAPRO is not set
658# CONFIG_I2C_VOODOO3 is not set
659# CONFIG_I2C_PCA_ISA is not set
660
661#
662# Hardware Sensors Chip support
663#
664# CONFIG_I2C_SENSOR is not set
665# CONFIG_SENSORS_ADM1021 is not set
666# CONFIG_SENSORS_ADM1025 is not set
667# CONFIG_SENSORS_ADM1026 is not set
668# CONFIG_SENSORS_ADM1031 is not set
669# CONFIG_SENSORS_ASB100 is not set
670# CONFIG_SENSORS_DS1621 is not set
671# CONFIG_SENSORS_FSCHER is not set
672# CONFIG_SENSORS_FSCPOS is not set
673# CONFIG_SENSORS_GL518SM is not set
674# CONFIG_SENSORS_GL520SM is not set
675# CONFIG_SENSORS_IT87 is not set
676# CONFIG_SENSORS_LM63 is not set
677# CONFIG_SENSORS_LM75 is not set
678# CONFIG_SENSORS_LM77 is not set
679# CONFIG_SENSORS_LM78 is not set
680# CONFIG_SENSORS_LM80 is not set
681# CONFIG_SENSORS_LM83 is not set
682# CONFIG_SENSORS_LM85 is not set
683# CONFIG_SENSORS_LM87 is not set
684# CONFIG_SENSORS_LM90 is not set
685# CONFIG_SENSORS_MAX1619 is not set
686# CONFIG_SENSORS_PC87360 is not set
687# CONFIG_SENSORS_SMSC47B397 is not set
688# CONFIG_SENSORS_SIS5595 is not set
689# CONFIG_SENSORS_SMSC47M1 is not set
690# CONFIG_SENSORS_VIA686A is not set
691# CONFIG_SENSORS_W83781D is not set
692# CONFIG_SENSORS_W83L785TS is not set
693# CONFIG_SENSORS_W83627HF is not set
694
695#
696# Other I2C Chip support
697#
698# CONFIG_SENSORS_EEPROM is not set
699# CONFIG_SENSORS_PCF8574 is not set
700# CONFIG_SENSORS_PCF8591 is not set
701# CONFIG_SENSORS_RTC8564 is not set
702# CONFIG_I2C_DEBUG_CORE is not set
703# CONFIG_I2C_DEBUG_ALGO is not set
704# CONFIG_I2C_DEBUG_BUS is not set
705# CONFIG_I2C_DEBUG_CHIP is not set
706
707#
708# Misc devices
709#
710
711#
712# Multimedia devices
713#
714# CONFIG_VIDEO_DEV is not set
715
716#
717# Digital Video Broadcasting Devices
718#
719# CONFIG_DVB is not set
720
721#
722# Graphics support
723#
724# CONFIG_FB is not set
725
726#
727# Console display driver support
728#
729# CONFIG_VGA_CONSOLE is not set
730CONFIG_DUMMY_CONSOLE=y
731
732#
733# Sound
734#
735# CONFIG_SOUND is not set
736
737#
738# USB support
739#
740CONFIG_USB_ARCH_HAS_HCD=y
741CONFIG_USB_ARCH_HAS_OHCI=y
742# CONFIG_USB is not set
743
744#
745# USB Gadget Support
746#
747# CONFIG_USB_GADGET is not set
748
749#
750# MMC/SD Card support
751#
752# CONFIG_MMC is not set
753
754#
755# File systems
756#
757CONFIG_EXT2_FS=y
758# CONFIG_EXT2_FS_XATTR is not set
759CONFIG_EXT3_FS=y
760CONFIG_EXT3_FS_XATTR=y
761# CONFIG_EXT3_FS_POSIX_ACL is not set
762# CONFIG_EXT3_FS_SECURITY is not set
763CONFIG_JBD=y
764# CONFIG_JBD_DEBUG is not set
765CONFIG_FS_MBCACHE=y
766# CONFIG_REISERFS_FS is not set
767# CONFIG_JFS_FS is not set
768
769#
770# XFS support
771#
772CONFIG_XFS_FS=y
773CONFIG_XFS_EXPORT=y
774# CONFIG_XFS_RT is not set
775# CONFIG_XFS_QUOTA is not set
776CONFIG_XFS_SECURITY=y
777CONFIG_XFS_POSIX_ACL=y
778# CONFIG_MINIX_FS is not set
779# CONFIG_ROMFS_FS is not set
780# CONFIG_QUOTA is not set
781CONFIG_DNOTIFY=y
782# CONFIG_AUTOFS_FS is not set
783# CONFIG_AUTOFS4_FS is not set
784
785#
786# CD-ROM/DVD Filesystems
787#
788# CONFIG_ISO9660_FS is not set
789# CONFIG_UDF_FS is not set
790
791#
792# DOS/FAT/NT Filesystems
793#
794# CONFIG_MSDOS_FS is not set
795# CONFIG_VFAT_FS is not set
796# CONFIG_NTFS_FS is not set
797
798#
799# Pseudo filesystems
800#
801CONFIG_PROC_FS=y
802CONFIG_SYSFS=y
803# CONFIG_DEVFS_FS is not set
804# CONFIG_DEVPTS_FS_XATTR is not set
805CONFIG_TMPFS=y
806# CONFIG_TMPFS_XATTR is not set
807# CONFIG_HUGETLB_PAGE is not set
808CONFIG_RAMFS=y
809
810#
811# Miscellaneous filesystems
812#
813# CONFIG_ADFS_FS is not set
814# CONFIG_AFFS_FS is not set
815# CONFIG_HFS_FS is not set
816# CONFIG_HFSPLUS_FS is not set
817# CONFIG_BEFS_FS is not set
818# CONFIG_BFS_FS is not set
819# CONFIG_EFS_FS is not set
820# CONFIG_JFFS_FS is not set
821CONFIG_JFFS2_FS=y
822CONFIG_JFFS2_FS_DEBUG=0
823# CONFIG_JFFS2_FS_NAND is not set
824# CONFIG_JFFS2_FS_NOR_ECC is not set
825# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
826CONFIG_JFFS2_ZLIB=y
827CONFIG_JFFS2_RTIME=y
828# CONFIG_JFFS2_RUBIN is not set
829# CONFIG_CRAMFS is not set
830# CONFIG_VXFS_FS is not set
831# CONFIG_HPFS_FS is not set
832# CONFIG_QNX4FS_FS is not set
833# CONFIG_SYSV_FS is not set
834# CONFIG_UFS_FS is not set
835
836#
837# Network File Systems
838#
839CONFIG_NFS_FS=y
840CONFIG_NFS_V3=y
841# CONFIG_NFS_V4 is not set
842# CONFIG_NFS_DIRECTIO is not set
843CONFIG_NFSD=y
844CONFIG_NFSD_V3=y
845# CONFIG_NFSD_V4 is not set
846# CONFIG_NFSD_TCP is not set
847CONFIG_ROOT_NFS=y
848CONFIG_LOCKD=y
849CONFIG_LOCKD_V4=y
850CONFIG_EXPORTFS=y
851CONFIG_SUNRPC=y
852# CONFIG_RPCSEC_GSS_KRB5 is not set
853# CONFIG_RPCSEC_GSS_SPKM3 is not set
854# CONFIG_SMB_FS is not set
855# CONFIG_CIFS is not set
856# CONFIG_NCP_FS is not set
857# CONFIG_CODA_FS is not set
858# CONFIG_AFS_FS is not set
859
860#
861# Partition Types
862#
863CONFIG_PARTITION_ADVANCED=y
864# CONFIG_ACORN_PARTITION is not set
865# CONFIG_OSF_PARTITION is not set
866# CONFIG_AMIGA_PARTITION is not set
867# CONFIG_ATARI_PARTITION is not set
868# CONFIG_MAC_PARTITION is not set
869CONFIG_MSDOS_PARTITION=y
870# CONFIG_BSD_DISKLABEL is not set
871# CONFIG_MINIX_SUBPARTITION is not set
872# CONFIG_SOLARIS_X86_PARTITION is not set
873# CONFIG_UNIXWARE_DISKLABEL is not set
874# CONFIG_LDM_PARTITION is not set
875# CONFIG_SGI_PARTITION is not set
876# CONFIG_ULTRIX_PARTITION is not set
877# CONFIG_SUN_PARTITION is not set
878# CONFIG_EFI_PARTITION is not set
879
880#
881# Native Language Support
882#
883# CONFIG_NLS is not set
884
885#
886# Profiling support
887#
888# CONFIG_PROFILING is not set
889
890#
891# Kernel hacking
892#
893# CONFIG_PRINTK_TIME is not set
894# CONFIG_DEBUG_KERNEL is not set
895CONFIG_LOG_BUF_SHIFT=14
896CONFIG_DEBUG_BUGVERBOSE=y
897CONFIG_FRAME_POINTER=y
898CONFIG_DEBUG_USER=y
899
900#
901# Security options
902#
903# CONFIG_KEYS is not set
904# CONFIG_SECURITY is not set
905
906#
907# Cryptographic options
908#
909# CONFIG_CRYPTO is not set
910
911#
912# Hardware crypto devices
913#
914
915#
916# Library routines
917#
918# CONFIG_CRC_CCITT is not set
919CONFIG_CRC32=y
920# CONFIG_LIBCRC32C is not set
921CONFIG_ZLIB_INFLATE=y
922CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/iq80321_defconfig b/arch/arm/configs/iq80321_defconfig
new file mode 100644
index 000000000000..ab5ad23b27da
--- /dev/null
+++ b/arch/arm/configs/iq80321_defconfig
@@ -0,0 +1,843 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 13:24:10 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53CONFIG_MODULE_UNLOAD=y
54# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set
57# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y
59
60#
61# System Type
62#
63# CONFIG_ARCH_CLPS7500 is not set
64# CONFIG_ARCH_CLPS711X is not set
65# CONFIG_ARCH_CO285 is not set
66# CONFIG_ARCH_EBSA110 is not set
67# CONFIG_ARCH_CAMELOT is not set
68# CONFIG_ARCH_FOOTBRIDGE is not set
69# CONFIG_ARCH_INTEGRATOR is not set
70CONFIG_ARCH_IOP3XX=y
71# CONFIG_ARCH_IXP4XX is not set
72# CONFIG_ARCH_IXP2000 is not set
73# CONFIG_ARCH_L7200 is not set
74# CONFIG_ARCH_PXA is not set
75# CONFIG_ARCH_RPC is not set
76# CONFIG_ARCH_SA1100 is not set
77# CONFIG_ARCH_S3C2410 is not set
78# CONFIG_ARCH_SHARK is not set
79# CONFIG_ARCH_LH7A40X is not set
80# CONFIG_ARCH_OMAP is not set
81# CONFIG_ARCH_VERSATILE is not set
82# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set
84
85#
86# IOP3xx Implementation Options
87#
88
89#
90# IOP3xx Platform Types
91#
92CONFIG_ARCH_IQ80321=y
93# CONFIG_ARCH_IQ31244 is not set
94# CONFIG_ARCH_IQ80331 is not set
95# CONFIG_MACH_IQ80332 is not set
96# CONFIG_ARCH_EP80219 is not set
97CONFIG_ARCH_IOP321=y
98# CONFIG_ARCH_IOP331 is not set
99
100#
101# IOP3xx Chipset Features
102#
103
104#
105# Processor Type
106#
107CONFIG_CPU_32=y
108CONFIG_CPU_XSCALE=y
109CONFIG_CPU_32v5=y
110CONFIG_CPU_ABRT_EV5T=y
111CONFIG_CPU_CACHE_VIVT=y
112CONFIG_CPU_TLB_V4WBI=y
113CONFIG_CPU_MINICACHE=y
114
115#
116# Processor Features
117#
118# CONFIG_ARM_THUMB is not set
119CONFIG_XSCALE_PMU=y
120
121#
122# Bus support
123#
124CONFIG_PCI=y
125# CONFIG_PCI_LEGACY_PROC is not set
126CONFIG_PCI_NAMES=y
127
128#
129# PCCARD (PCMCIA/CardBus) support
130#
131# CONFIG_PCCARD is not set
132
133#
134# Kernel Features
135#
136# CONFIG_PREEMPT is not set
137CONFIG_ALIGNMENT_TRAP=y
138
139#
140# Boot options
141#
142CONFIG_ZBOOT_ROM_TEXT=0x0
143CONFIG_ZBOOT_ROM_BSS=0x0
144CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200"
145# CONFIG_XIP_KERNEL is not set
146
147#
148# Floating point emulation
149#
150
151#
152# At least one emulation must be selected
153#
154CONFIG_FPE_NWFPE=y
155# CONFIG_FPE_NWFPE_XP is not set
156# CONFIG_FPE_FASTFPE is not set
157
158#
159# Userspace binary formats
160#
161CONFIG_BINFMT_ELF=y
162CONFIG_BINFMT_AOUT=y
163# CONFIG_BINFMT_MISC is not set
164# CONFIG_ARTHUR is not set
165
166#
167# Power management options
168#
169# CONFIG_PM is not set
170
171#
172# Device Drivers
173#
174
175#
176# Generic Driver Options
177#
178CONFIG_STANDALONE=y
179CONFIG_PREVENT_FIRMWARE_BUILD=y
180# CONFIG_FW_LOADER is not set
181
182#
183# Memory Technology Devices (MTD)
184#
185CONFIG_MTD=y
186# CONFIG_MTD_DEBUG is not set
187# CONFIG_MTD_CONCAT is not set
188CONFIG_MTD_PARTITIONS=y
189CONFIG_MTD_REDBOOT_PARTS=y
190CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
191CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
192CONFIG_MTD_REDBOOT_PARTS_READONLY=y
193# CONFIG_MTD_CMDLINE_PARTS is not set
194# CONFIG_MTD_AFS_PARTS is not set
195
196#
197# User Modules And Translation Layers
198#
199CONFIG_MTD_CHAR=y
200CONFIG_MTD_BLOCK=y
201# CONFIG_FTL is not set
202# CONFIG_NFTL is not set
203# CONFIG_INFTL is not set
204
205#
206# RAM/ROM/Flash chip drivers
207#
208CONFIG_MTD_CFI=y
209# CONFIG_MTD_JEDECPROBE is not set
210CONFIG_MTD_GEN_PROBE=y
211# CONFIG_MTD_CFI_ADV_OPTIONS is not set
212CONFIG_MTD_MAP_BANK_WIDTH_1=y
213CONFIG_MTD_MAP_BANK_WIDTH_2=y
214CONFIG_MTD_MAP_BANK_WIDTH_4=y
215# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
216# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
217# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
218CONFIG_MTD_CFI_I1=y
219CONFIG_MTD_CFI_I2=y
220# CONFIG_MTD_CFI_I4 is not set
221# CONFIG_MTD_CFI_I8 is not set
222CONFIG_MTD_CFI_INTELEXT=y
223# CONFIG_MTD_CFI_AMDSTD is not set
224# CONFIG_MTD_CFI_STAA is not set
225CONFIG_MTD_CFI_UTIL=y
226# CONFIG_MTD_RAM is not set
227# CONFIG_MTD_ROM is not set
228# CONFIG_MTD_ABSENT is not set
229# CONFIG_MTD_XIP is not set
230
231#
232# Mapping drivers for chip access
233#
234# CONFIG_MTD_COMPLEX_MAPPINGS is not set
235CONFIG_MTD_PHYSMAP=y
236CONFIG_MTD_PHYSMAP_START=0xf0000000
237CONFIG_MTD_PHYSMAP_LEN=0x00800000
238CONFIG_MTD_PHYSMAP_BANKWIDTH=1
239# CONFIG_MTD_ARM_INTEGRATOR is not set
240# CONFIG_MTD_EDB7312 is not set
241
242#
243# Self-contained MTD device drivers
244#
245# CONFIG_MTD_PMC551 is not set
246# CONFIG_MTD_SLRAM is not set
247# CONFIG_MTD_PHRAM is not set
248# CONFIG_MTD_MTDRAM is not set
249# CONFIG_MTD_BLKMTD is not set
250# CONFIG_MTD_BLOCK2MTD is not set
251
252#
253# Disk-On-Chip Device Drivers
254#
255# CONFIG_MTD_DOC2000 is not set
256# CONFIG_MTD_DOC2001 is not set
257# CONFIG_MTD_DOC2001PLUS is not set
258
259#
260# NAND Flash Device Drivers
261#
262# CONFIG_MTD_NAND is not set
263
264#
265# Parallel port support
266#
267# CONFIG_PARPORT is not set
268
269#
270# Plug and Play support
271#
272
273#
274# Block devices
275#
276# CONFIG_BLK_DEV_FD is not set
277# CONFIG_BLK_CPQ_DA is not set
278# CONFIG_BLK_CPQ_CISS_DA is not set
279# CONFIG_BLK_DEV_DAC960 is not set
280# CONFIG_BLK_DEV_UMEM is not set
281# CONFIG_BLK_DEV_COW_COMMON is not set
282# CONFIG_BLK_DEV_LOOP is not set
283# CONFIG_BLK_DEV_NBD is not set
284# CONFIG_BLK_DEV_SX8 is not set
285CONFIG_BLK_DEV_RAM=y
286CONFIG_BLK_DEV_RAM_COUNT=16
287CONFIG_BLK_DEV_RAM_SIZE=8192
288# CONFIG_BLK_DEV_INITRD is not set
289CONFIG_INITRAMFS_SOURCE=""
290# CONFIG_CDROM_PKTCDVD is not set
291
292#
293# IO Schedulers
294#
295CONFIG_IOSCHED_NOOP=y
296CONFIG_IOSCHED_AS=y
297CONFIG_IOSCHED_DEADLINE=y
298CONFIG_IOSCHED_CFQ=y
299# CONFIG_ATA_OVER_ETH is not set
300
301#
302# ATA/ATAPI/MFM/RLL support
303#
304# CONFIG_IDE is not set
305
306#
307# SCSI device support
308#
309# CONFIG_SCSI is not set
310
311#
312# Multi-device support (RAID and LVM)
313#
314# CONFIG_MD is not set
315
316#
317# Fusion MPT device support
318#
319
320#
321# IEEE 1394 (FireWire) support
322#
323# CONFIG_IEEE1394 is not set
324
325#
326# I2O device support
327#
328# CONFIG_I2O is not set
329
330#
331# Networking support
332#
333CONFIG_NET=y
334
335#
336# Networking options
337#
338CONFIG_PACKET=y
339CONFIG_PACKET_MMAP=y
340# CONFIG_NETLINK_DEV is not set
341CONFIG_UNIX=y
342# CONFIG_NET_KEY is not set
343CONFIG_INET=y
344CONFIG_IP_MULTICAST=y
345# CONFIG_IP_ADVANCED_ROUTER is not set
346CONFIG_IP_PNP=y
347# CONFIG_IP_PNP_DHCP is not set
348CONFIG_IP_PNP_BOOTP=y
349# CONFIG_IP_PNP_RARP is not set
350# CONFIG_NET_IPIP is not set
351# CONFIG_NET_IPGRE is not set
352# CONFIG_IP_MROUTE is not set
353# CONFIG_ARPD is not set
354# CONFIG_SYN_COOKIES is not set
355# CONFIG_INET_AH is not set
356# CONFIG_INET_ESP is not set
357# CONFIG_INET_IPCOMP is not set
358# CONFIG_INET_TUNNEL is not set
359CONFIG_IP_TCPDIAG=y
360# CONFIG_IP_TCPDIAG_IPV6 is not set
361# CONFIG_IPV6 is not set
362# CONFIG_NETFILTER is not set
363
364#
365# SCTP Configuration (EXPERIMENTAL)
366#
367# CONFIG_IP_SCTP is not set
368# CONFIG_ATM is not set
369# CONFIG_BRIDGE is not set
370# CONFIG_VLAN_8021Q is not set
371# CONFIG_DECNET is not set
372# CONFIG_LLC2 is not set
373# CONFIG_IPX is not set
374# CONFIG_ATALK is not set
375# CONFIG_X25 is not set
376# CONFIG_LAPB is not set
377# CONFIG_NET_DIVERT is not set
378# CONFIG_ECONET is not set
379# CONFIG_WAN_ROUTER is not set
380
381#
382# QoS and/or fair queueing
383#
384# CONFIG_NET_SCHED is not set
385# CONFIG_NET_CLS_ROUTE is not set
386
387#
388# Network testing
389#
390# CONFIG_NET_PKTGEN is not set
391# CONFIG_NETPOLL is not set
392# CONFIG_NET_POLL_CONTROLLER is not set
393# CONFIG_HAMRADIO is not set
394# CONFIG_IRDA is not set
395# CONFIG_BT is not set
396CONFIG_NETDEVICES=y
397# CONFIG_DUMMY is not set
398# CONFIG_BONDING is not set
399# CONFIG_EQUALIZER is not set
400# CONFIG_TUN is not set
401
402#
403# ARCnet devices
404#
405# CONFIG_ARCNET is not set
406
407#
408# Ethernet (10 or 100Mbit)
409#
410# CONFIG_NET_ETHERNET is not set
411
412#
413# Ethernet (1000 Mbit)
414#
415# CONFIG_ACENIC is not set
416# CONFIG_DL2K is not set
417CONFIG_E1000=y
418CONFIG_E1000_NAPI=y
419# CONFIG_NS83820 is not set
420# CONFIG_HAMACHI is not set
421# CONFIG_YELLOWFIN is not set
422# CONFIG_R8169 is not set
423# CONFIG_SK98LIN is not set
424# CONFIG_TIGON3 is not set
425
426#
427# Ethernet (10000 Mbit)
428#
429# CONFIG_IXGB is not set
430# CONFIG_S2IO is not set
431
432#
433# Token Ring devices
434#
435# CONFIG_TR is not set
436
437#
438# Wireless LAN (non-hamradio)
439#
440# CONFIG_NET_RADIO is not set
441
442#
443# Wan interfaces
444#
445# CONFIG_WAN is not set
446# CONFIG_FDDI is not set
447# CONFIG_HIPPI is not set
448# CONFIG_PPP is not set
449# CONFIG_SLIP is not set
450# CONFIG_SHAPER is not set
451# CONFIG_NETCONSOLE is not set
452
453#
454# ISDN subsystem
455#
456# CONFIG_ISDN is not set
457
458#
459# Input device support
460#
461CONFIG_INPUT=y
462
463#
464# Userland interfaces
465#
466CONFIG_INPUT_MOUSEDEV=y
467# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
468CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
469CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
470# CONFIG_INPUT_JOYDEV is not set
471# CONFIG_INPUT_TSDEV is not set
472# CONFIG_INPUT_EVDEV is not set
473# CONFIG_INPUT_EVBUG is not set
474
475#
476# Input Device Drivers
477#
478# CONFIG_INPUT_KEYBOARD is not set
479# CONFIG_INPUT_MOUSE is not set
480# CONFIG_INPUT_JOYSTICK is not set
481# CONFIG_INPUT_TOUCHSCREEN is not set
482# CONFIG_INPUT_MISC is not set
483
484#
485# Hardware I/O ports
486#
487# CONFIG_SERIO is not set
488# CONFIG_GAMEPORT is not set
489CONFIG_SOUND_GAMEPORT=y
490
491#
492# Character devices
493#
494CONFIG_VT=y
495CONFIG_VT_CONSOLE=y
496CONFIG_HW_CONSOLE=y
497# CONFIG_SERIAL_NONSTANDARD is not set
498
499#
500# Serial drivers
501#
502CONFIG_SERIAL_8250=y
503CONFIG_SERIAL_8250_CONSOLE=y
504CONFIG_SERIAL_8250_NR_UARTS=4
505# CONFIG_SERIAL_8250_EXTENDED is not set
506
507#
508# Non-8250 serial port support
509#
510CONFIG_SERIAL_CORE=y
511CONFIG_SERIAL_CORE_CONSOLE=y
512CONFIG_UNIX98_PTYS=y
513CONFIG_LEGACY_PTYS=y
514CONFIG_LEGACY_PTY_COUNT=256
515
516#
517# IPMI
518#
519# CONFIG_IPMI_HANDLER is not set
520
521#
522# Watchdog Cards
523#
524# CONFIG_WATCHDOG is not set
525# CONFIG_NVRAM is not set
526# CONFIG_RTC is not set
527# CONFIG_DTLK is not set
528# CONFIG_R3964 is not set
529# CONFIG_APPLICOM is not set
530
531#
532# Ftape, the floppy tape device driver
533#
534# CONFIG_DRM is not set
535# CONFIG_RAW_DRIVER is not set
536
537#
538# TPM devices
539#
540# CONFIG_TCG_TPM is not set
541
542#
543# I2C support
544#
545CONFIG_I2C=y
546CONFIG_I2C_CHARDEV=y
547
548#
549# I2C Algorithms
550#
551# CONFIG_I2C_ALGOBIT is not set
552# CONFIG_I2C_ALGOPCF is not set
553# CONFIG_I2C_ALGOPCA is not set
554
555#
556# I2C Hardware Bus support
557#
558# CONFIG_I2C_ALI1535 is not set
559# CONFIG_I2C_ALI1563 is not set
560# CONFIG_I2C_ALI15X3 is not set
561# CONFIG_I2C_AMD756 is not set
562# CONFIG_I2C_AMD8111 is not set
563# CONFIG_I2C_I801 is not set
564# CONFIG_I2C_I810 is not set
565CONFIG_I2C_IOP3XX=y
566# CONFIG_I2C_ISA is not set
567# CONFIG_I2C_NFORCE2 is not set
568# CONFIG_I2C_PARPORT_LIGHT is not set
569# CONFIG_I2C_PIIX4 is not set
570# CONFIG_I2C_PROSAVAGE is not set
571# CONFIG_I2C_SAVAGE4 is not set
572# CONFIG_SCx200_ACB is not set
573# CONFIG_I2C_SIS5595 is not set
574# CONFIG_I2C_SIS630 is not set
575# CONFIG_I2C_SIS96X is not set
576# CONFIG_I2C_STUB is not set
577# CONFIG_I2C_VIA is not set
578# CONFIG_I2C_VIAPRO is not set
579# CONFIG_I2C_VOODOO3 is not set
580# CONFIG_I2C_PCA_ISA is not set
581
582#
583# Hardware Sensors Chip support
584#
585# CONFIG_I2C_SENSOR is not set
586# CONFIG_SENSORS_ADM1021 is not set
587# CONFIG_SENSORS_ADM1025 is not set
588# CONFIG_SENSORS_ADM1026 is not set
589# CONFIG_SENSORS_ADM1031 is not set
590# CONFIG_SENSORS_ASB100 is not set
591# CONFIG_SENSORS_DS1621 is not set
592# CONFIG_SENSORS_FSCHER is not set
593# CONFIG_SENSORS_FSCPOS is not set
594# CONFIG_SENSORS_GL518SM is not set
595# CONFIG_SENSORS_GL520SM is not set
596# CONFIG_SENSORS_IT87 is not set
597# CONFIG_SENSORS_LM63 is not set
598# CONFIG_SENSORS_LM75 is not set
599# CONFIG_SENSORS_LM77 is not set
600# CONFIG_SENSORS_LM78 is not set
601# CONFIG_SENSORS_LM80 is not set
602# CONFIG_SENSORS_LM83 is not set
603# CONFIG_SENSORS_LM85 is not set
604# CONFIG_SENSORS_LM87 is not set
605# CONFIG_SENSORS_LM90 is not set
606# CONFIG_SENSORS_MAX1619 is not set
607# CONFIG_SENSORS_PC87360 is not set
608# CONFIG_SENSORS_SMSC47B397 is not set
609# CONFIG_SENSORS_SIS5595 is not set
610# CONFIG_SENSORS_SMSC47M1 is not set
611# CONFIG_SENSORS_VIA686A is not set
612# CONFIG_SENSORS_W83781D is not set
613# CONFIG_SENSORS_W83L785TS is not set
614# CONFIG_SENSORS_W83627HF is not set
615
616#
617# Other I2C Chip support
618#
619# CONFIG_SENSORS_EEPROM is not set
620# CONFIG_SENSORS_PCF8574 is not set
621# CONFIG_SENSORS_PCF8591 is not set
622# CONFIG_SENSORS_RTC8564 is not set
623# CONFIG_I2C_DEBUG_CORE is not set
624# CONFIG_I2C_DEBUG_ALGO is not set
625# CONFIG_I2C_DEBUG_BUS is not set
626# CONFIG_I2C_DEBUG_CHIP is not set
627
628#
629# Misc devices
630#
631
632#
633# Multimedia devices
634#
635# CONFIG_VIDEO_DEV is not set
636
637#
638# Digital Video Broadcasting Devices
639#
640# CONFIG_DVB is not set
641
642#
643# Graphics support
644#
645# CONFIG_FB is not set
646
647#
648# Console display driver support
649#
650# CONFIG_VGA_CONSOLE is not set
651CONFIG_DUMMY_CONSOLE=y
652
653#
654# Sound
655#
656# CONFIG_SOUND is not set
657
658#
659# USB support
660#
661CONFIG_USB_ARCH_HAS_HCD=y
662CONFIG_USB_ARCH_HAS_OHCI=y
663# CONFIG_USB is not set
664
665#
666# USB Gadget Support
667#
668# CONFIG_USB_GADGET is not set
669
670#
671# MMC/SD Card support
672#
673# CONFIG_MMC is not set
674
675#
676# File systems
677#
678CONFIG_EXT2_FS=y
679# CONFIG_EXT2_FS_XATTR is not set
680CONFIG_EXT3_FS=y
681CONFIG_EXT3_FS_XATTR=y
682# CONFIG_EXT3_FS_POSIX_ACL is not set
683# CONFIG_EXT3_FS_SECURITY is not set
684CONFIG_JBD=y
685# CONFIG_JBD_DEBUG is not set
686CONFIG_FS_MBCACHE=y
687# CONFIG_REISERFS_FS is not set
688# CONFIG_JFS_FS is not set
689
690#
691# XFS support
692#
693CONFIG_XFS_FS=y
694CONFIG_XFS_EXPORT=y
695# CONFIG_XFS_RT is not set
696# CONFIG_XFS_QUOTA is not set
697CONFIG_XFS_SECURITY=y
698CONFIG_XFS_POSIX_ACL=y
699# CONFIG_MINIX_FS is not set
700# CONFIG_ROMFS_FS is not set
701# CONFIG_QUOTA is not set
702CONFIG_DNOTIFY=y
703# CONFIG_AUTOFS_FS is not set
704# CONFIG_AUTOFS4_FS is not set
705
706#
707# CD-ROM/DVD Filesystems
708#
709# CONFIG_ISO9660_FS is not set
710# CONFIG_UDF_FS is not set
711
712#
713# DOS/FAT/NT Filesystems
714#
715# CONFIG_MSDOS_FS is not set
716# CONFIG_VFAT_FS is not set
717# CONFIG_NTFS_FS is not set
718
719#
720# Pseudo filesystems
721#
722CONFIG_PROC_FS=y
723CONFIG_SYSFS=y
724# CONFIG_DEVFS_FS is not set
725# CONFIG_DEVPTS_FS_XATTR is not set
726CONFIG_TMPFS=y
727# CONFIG_TMPFS_XATTR is not set
728# CONFIG_HUGETLB_PAGE is not set
729CONFIG_RAMFS=y
730
731#
732# Miscellaneous filesystems
733#
734# CONFIG_ADFS_FS is not set
735# CONFIG_AFFS_FS is not set
736# CONFIG_HFS_FS is not set
737# CONFIG_HFSPLUS_FS is not set
738# CONFIG_BEFS_FS is not set
739# CONFIG_BFS_FS is not set
740# CONFIG_EFS_FS is not set
741# CONFIG_JFFS_FS is not set
742CONFIG_JFFS2_FS=y
743CONFIG_JFFS2_FS_DEBUG=0
744# CONFIG_JFFS2_FS_NAND is not set
745# CONFIG_JFFS2_FS_NOR_ECC is not set
746# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
747CONFIG_JFFS2_ZLIB=y
748CONFIG_JFFS2_RTIME=y
749# CONFIG_JFFS2_RUBIN is not set
750# CONFIG_CRAMFS is not set
751# CONFIG_VXFS_FS is not set
752# CONFIG_HPFS_FS is not set
753# CONFIG_QNX4FS_FS is not set
754# CONFIG_SYSV_FS is not set
755# CONFIG_UFS_FS is not set
756
757#
758# Network File Systems
759#
760CONFIG_NFS_FS=y
761CONFIG_NFS_V3=y
762# CONFIG_NFS_V4 is not set
763# CONFIG_NFS_DIRECTIO is not set
764CONFIG_NFSD=y
765CONFIG_NFSD_V3=y
766# CONFIG_NFSD_V4 is not set
767# CONFIG_NFSD_TCP is not set
768CONFIG_ROOT_NFS=y
769CONFIG_LOCKD=y
770CONFIG_LOCKD_V4=y
771CONFIG_EXPORTFS=y
772CONFIG_SUNRPC=y
773# CONFIG_RPCSEC_GSS_KRB5 is not set
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#
784CONFIG_PARTITION_ADVANCED=y
785# CONFIG_ACORN_PARTITION is not set
786# CONFIG_OSF_PARTITION is not set
787# CONFIG_AMIGA_PARTITION is not set
788# CONFIG_ATARI_PARTITION is not set
789# CONFIG_MAC_PARTITION is not set
790CONFIG_MSDOS_PARTITION=y
791# CONFIG_BSD_DISKLABEL is not set
792# CONFIG_MINIX_SUBPARTITION is not set
793# CONFIG_SOLARIS_X86_PARTITION is not set
794# CONFIG_UNIXWARE_DISKLABEL is not set
795# CONFIG_LDM_PARTITION is not set
796# CONFIG_SGI_PARTITION is not set
797# CONFIG_ULTRIX_PARTITION is not set
798# CONFIG_SUN_PARTITION is not set
799# CONFIG_EFI_PARTITION is not set
800
801#
802# Native Language Support
803#
804# CONFIG_NLS is not set
805
806#
807# Profiling support
808#
809# CONFIG_PROFILING is not set
810
811#
812# Kernel hacking
813#
814# CONFIG_PRINTK_TIME is not set
815# CONFIG_DEBUG_KERNEL is not set
816CONFIG_LOG_BUF_SHIFT=14
817CONFIG_DEBUG_BUGVERBOSE=y
818CONFIG_FRAME_POINTER=y
819CONFIG_DEBUG_USER=y
820
821#
822# Security options
823#
824# CONFIG_KEYS is not set
825# CONFIG_SECURITY is not set
826
827#
828# Cryptographic options
829#
830# CONFIG_CRYPTO is not set
831
832#
833# Hardware crypto devices
834#
835
836#
837# Library routines
838#
839# CONFIG_CRC_CCITT is not set
840CONFIG_CRC32=y
841# CONFIG_LIBCRC32C is not set
842CONFIG_ZLIB_INFLATE=y
843CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/iq80331_defconfig b/arch/arm/configs/iq80331_defconfig
new file mode 100644
index 000000000000..bb536133ef87
--- /dev/null
+++ b/arch/arm/configs/iq80331_defconfig
@@ -0,0 +1,916 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 15:13:37 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53CONFIG_MODULE_UNLOAD=y
54# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set
57# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y
59
60#
61# System Type
62#
63# CONFIG_ARCH_CLPS7500 is not set
64# CONFIG_ARCH_CLPS711X is not set
65# CONFIG_ARCH_CO285 is not set
66# CONFIG_ARCH_EBSA110 is not set
67# CONFIG_ARCH_CAMELOT is not set
68# CONFIG_ARCH_FOOTBRIDGE is not set
69# CONFIG_ARCH_INTEGRATOR is not set
70CONFIG_ARCH_IOP3XX=y
71# CONFIG_ARCH_IXP4XX is not set
72# CONFIG_ARCH_IXP2000 is not set
73# CONFIG_ARCH_L7200 is not set
74# CONFIG_ARCH_PXA is not set
75# CONFIG_ARCH_RPC is not set
76# CONFIG_ARCH_SA1100 is not set
77# CONFIG_ARCH_S3C2410 is not set
78# CONFIG_ARCH_SHARK is not set
79# CONFIG_ARCH_LH7A40X is not set
80# CONFIG_ARCH_OMAP is not set
81# CONFIG_ARCH_VERSATILE is not set
82# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set
84
85#
86# IOP3xx Implementation Options
87#
88
89#
90# IOP3xx Platform Types
91#
92# CONFIG_ARCH_IQ80321 is not set
93# CONFIG_ARCH_IQ31244 is not set
94CONFIG_ARCH_IQ80331=y
95# CONFIG_MACH_IQ80332 is not set
96# CONFIG_ARCH_EP80219 is not set
97CONFIG_ARCH_IOP331=y
98
99#
100# IOP3xx Chipset Features
101#
102CONFIG_IOP331_STEPD=y
103
104#
105# Processor Type
106#
107CONFIG_CPU_32=y
108CONFIG_CPU_XSCALE=y
109CONFIG_CPU_32v5=y
110CONFIG_CPU_ABRT_EV5T=y
111CONFIG_CPU_CACHE_VIVT=y
112CONFIG_CPU_TLB_V4WBI=y
113CONFIG_CPU_MINICACHE=y
114
115#
116# Processor Features
117#
118# CONFIG_ARM_THUMB is not set
119CONFIG_XSCALE_PMU=y
120
121#
122# Bus support
123#
124CONFIG_PCI=y
125# CONFIG_PCI_LEGACY_PROC is not set
126CONFIG_PCI_NAMES=y
127
128#
129# PCCARD (PCMCIA/CardBus) support
130#
131# CONFIG_PCCARD is not set
132
133#
134# Kernel Features
135#
136# CONFIG_PREEMPT is not set
137CONFIG_ALIGNMENT_TRAP=y
138
139#
140# Boot options
141#
142CONFIG_ZBOOT_ROM_TEXT=0x0
143CONFIG_ZBOOT_ROM_BSS=0x0
144CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200"
145# CONFIG_XIP_KERNEL is not set
146
147#
148# Floating point emulation
149#
150
151#
152# At least one emulation must be selected
153#
154CONFIG_FPE_NWFPE=y
155# CONFIG_FPE_NWFPE_XP is not set
156# CONFIG_FPE_FASTFPE is not set
157
158#
159# Userspace binary formats
160#
161CONFIG_BINFMT_ELF=y
162CONFIG_BINFMT_AOUT=y
163# CONFIG_BINFMT_MISC is not set
164# CONFIG_ARTHUR is not set
165
166#
167# Power management options
168#
169# CONFIG_PM is not set
170
171#
172# Device Drivers
173#
174
175#
176# Generic Driver Options
177#
178CONFIG_STANDALONE=y
179CONFIG_PREVENT_FIRMWARE_BUILD=y
180# CONFIG_FW_LOADER is not set
181
182#
183# Memory Technology Devices (MTD)
184#
185CONFIG_MTD=y
186# CONFIG_MTD_DEBUG is not set
187# CONFIG_MTD_CONCAT is not set
188CONFIG_MTD_PARTITIONS=y
189CONFIG_MTD_REDBOOT_PARTS=y
190CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
191CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
192CONFIG_MTD_REDBOOT_PARTS_READONLY=y
193# CONFIG_MTD_CMDLINE_PARTS is not set
194# CONFIG_MTD_AFS_PARTS is not set
195
196#
197# User Modules And Translation Layers
198#
199CONFIG_MTD_CHAR=y
200CONFIG_MTD_BLOCK=y
201# CONFIG_FTL is not set
202# CONFIG_NFTL is not set
203# CONFIG_INFTL is not set
204
205#
206# RAM/ROM/Flash chip drivers
207#
208CONFIG_MTD_CFI=y
209# CONFIG_MTD_JEDECPROBE is not set
210CONFIG_MTD_GEN_PROBE=y
211CONFIG_MTD_CFI_ADV_OPTIONS=y
212CONFIG_MTD_CFI_NOSWAP=y
213# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
214# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
215# CONFIG_MTD_CFI_GEOMETRY is not set
216CONFIG_MTD_MAP_BANK_WIDTH_1=y
217CONFIG_MTD_MAP_BANK_WIDTH_2=y
218CONFIG_MTD_MAP_BANK_WIDTH_4=y
219# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
220# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
221# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
222CONFIG_MTD_CFI_I1=y
223CONFIG_MTD_CFI_I2=y
224# CONFIG_MTD_CFI_I4 is not set
225# CONFIG_MTD_CFI_I8 is not set
226CONFIG_MTD_CFI_INTELEXT=y
227# CONFIG_MTD_CFI_AMDSTD is not set
228# CONFIG_MTD_CFI_STAA is not set
229CONFIG_MTD_CFI_UTIL=y
230# CONFIG_MTD_RAM is not set
231# CONFIG_MTD_ROM is not set
232# CONFIG_MTD_ABSENT is not set
233# CONFIG_MTD_XIP is not set
234
235#
236# Mapping drivers for chip access
237#
238# CONFIG_MTD_COMPLEX_MAPPINGS is not set
239CONFIG_MTD_PHYSMAP=y
240CONFIG_MTD_PHYSMAP_START=0xc0000000
241CONFIG_MTD_PHYSMAP_LEN=0x00800000
242CONFIG_MTD_PHYSMAP_BANKWIDTH=1
243# CONFIG_MTD_ARM_INTEGRATOR is not set
244# CONFIG_MTD_EDB7312 is not set
245
246#
247# Self-contained MTD device drivers
248#
249# CONFIG_MTD_PMC551 is not set
250# CONFIG_MTD_SLRAM is not set
251# CONFIG_MTD_PHRAM is not set
252# CONFIG_MTD_MTDRAM is not set
253# CONFIG_MTD_BLKMTD is not set
254# CONFIG_MTD_BLOCK2MTD is not set
255
256#
257# Disk-On-Chip Device Drivers
258#
259# CONFIG_MTD_DOC2000 is not set
260# CONFIG_MTD_DOC2001 is not set
261# CONFIG_MTD_DOC2001PLUS is not set
262
263#
264# NAND Flash Device Drivers
265#
266# CONFIG_MTD_NAND 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
286# CONFIG_BLK_DEV_LOOP is not set
287# CONFIG_BLK_DEV_NBD is not set
288# CONFIG_BLK_DEV_SX8 is not set
289CONFIG_BLK_DEV_RAM=y
290CONFIG_BLK_DEV_RAM_COUNT=16
291CONFIG_BLK_DEV_RAM_SIZE=8192
292# CONFIG_BLK_DEV_INITRD is not set
293CONFIG_INITRAMFS_SOURCE=""
294# CONFIG_CDROM_PKTCDVD is not set
295
296#
297# IO Schedulers
298#
299CONFIG_IOSCHED_NOOP=y
300CONFIG_IOSCHED_AS=y
301CONFIG_IOSCHED_DEADLINE=y
302CONFIG_IOSCHED_CFQ=y
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#
313CONFIG_SCSI=y
314CONFIG_SCSI_PROC_FS=y
315
316#
317# SCSI support type (disk, tape, CD-ROM)
318#
319CONFIG_BLK_DEV_SD=y
320# CONFIG_CHR_DEV_ST is not set
321# CONFIG_CHR_DEV_OSST is not set
322# CONFIG_BLK_DEV_SR is not set
323CONFIG_CHR_DEV_SG=y
324
325#
326# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
327#
328# CONFIG_SCSI_MULTI_LUN is not set
329# CONFIG_SCSI_CONSTANTS is not set
330# CONFIG_SCSI_LOGGING is not set
331
332#
333# SCSI Transport Attributes
334#
335# CONFIG_SCSI_SPI_ATTRS is not set
336# CONFIG_SCSI_FC_ATTRS is not set
337# CONFIG_SCSI_ISCSI_ATTRS is not set
338
339#
340# SCSI low-level drivers
341#
342# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
343# CONFIG_SCSI_3W_9XXX is not set
344# CONFIG_SCSI_ACARD is not set
345# CONFIG_SCSI_AACRAID is not set
346# CONFIG_SCSI_AIC7XXX is not set
347# CONFIG_SCSI_AIC7XXX_OLD is not set
348# CONFIG_SCSI_AIC79XX is not set
349# CONFIG_SCSI_DPT_I2O is not set
350# CONFIG_MEGARAID_NEWGEN is not set
351# CONFIG_MEGARAID_LEGACY is not set
352# CONFIG_SCSI_SATA is not set
353# CONFIG_SCSI_BUSLOGIC is not set
354# CONFIG_SCSI_DMX3191D is not set
355# CONFIG_SCSI_EATA is not set
356# CONFIG_SCSI_FUTURE_DOMAIN is not set
357# CONFIG_SCSI_GDTH is not set
358# CONFIG_SCSI_IPS is not set
359# CONFIG_SCSI_INITIO is not set
360# CONFIG_SCSI_INIA100 is not set
361# CONFIG_SCSI_SYM53C8XX_2 is not set
362# CONFIG_SCSI_IPR is not set
363# CONFIG_SCSI_QLOGIC_FC is not set
364# CONFIG_SCSI_QLOGIC_1280 is not set
365CONFIG_SCSI_QLA2XXX=y
366# CONFIG_SCSI_QLA21XX is not set
367# CONFIG_SCSI_QLA22XX is not set
368# CONFIG_SCSI_QLA2300 is not set
369# CONFIG_SCSI_QLA2322 is not set
370# CONFIG_SCSI_QLA6312 is not set
371# CONFIG_SCSI_DC395x is not set
372# CONFIG_SCSI_DC390T is not set
373# CONFIG_SCSI_NSP32 is not set
374# CONFIG_SCSI_DEBUG is not set
375
376#
377# Multi-device support (RAID and LVM)
378#
379CONFIG_MD=y
380CONFIG_BLK_DEV_MD=y
381CONFIG_MD_LINEAR=y
382CONFIG_MD_RAID0=y
383CONFIG_MD_RAID1=y
384# CONFIG_MD_RAID10 is not set
385CONFIG_MD_RAID5=y
386# CONFIG_MD_RAID6 is not set
387# CONFIG_MD_MULTIPATH is not set
388# CONFIG_MD_FAULTY is not set
389CONFIG_BLK_DEV_DM=y
390# CONFIG_DM_CRYPT is not set
391# CONFIG_DM_SNAPSHOT is not set
392# CONFIG_DM_MIRROR is not set
393# CONFIG_DM_ZERO is not set
394# CONFIG_DM_MULTIPATH is not set
395
396#
397# Fusion MPT device support
398#
399# CONFIG_FUSION is not set
400
401#
402# IEEE 1394 (FireWire) support
403#
404# CONFIG_IEEE1394 is not set
405
406#
407# I2O device support
408#
409# CONFIG_I2O is not set
410
411#
412# Networking support
413#
414CONFIG_NET=y
415
416#
417# Networking options
418#
419CONFIG_PACKET=y
420CONFIG_PACKET_MMAP=y
421# CONFIG_NETLINK_DEV is not set
422CONFIG_UNIX=y
423# CONFIG_NET_KEY is not set
424CONFIG_INET=y
425CONFIG_IP_MULTICAST=y
426# CONFIG_IP_ADVANCED_ROUTER is not set
427CONFIG_IP_PNP=y
428# CONFIG_IP_PNP_DHCP is not set
429CONFIG_IP_PNP_BOOTP=y
430# CONFIG_IP_PNP_RARP is not set
431# CONFIG_NET_IPIP is not set
432# CONFIG_NET_IPGRE is not set
433# CONFIG_IP_MROUTE is not set
434# CONFIG_ARPD is not set
435# CONFIG_SYN_COOKIES is not set
436# CONFIG_INET_AH is not set
437# CONFIG_INET_ESP is not set
438# CONFIG_INET_IPCOMP is not set
439# CONFIG_INET_TUNNEL is not set
440CONFIG_IP_TCPDIAG=y
441# CONFIG_IP_TCPDIAG_IPV6 is not set
442# CONFIG_IPV6 is not set
443# CONFIG_NETFILTER is not set
444
445#
446# SCTP Configuration (EXPERIMENTAL)
447#
448# CONFIG_IP_SCTP is not set
449# CONFIG_ATM is not set
450# CONFIG_BRIDGE is not set
451# CONFIG_VLAN_8021Q is not set
452# CONFIG_DECNET is not set
453# CONFIG_LLC2 is not set
454# CONFIG_IPX is not set
455# CONFIG_ATALK is not set
456# CONFIG_X25 is not set
457# CONFIG_LAPB is not set
458# CONFIG_NET_DIVERT is not set
459# CONFIG_ECONET is not set
460# CONFIG_WAN_ROUTER is not set
461
462#
463# QoS and/or fair queueing
464#
465# CONFIG_NET_SCHED is not set
466# CONFIG_NET_CLS_ROUTE is not set
467
468#
469# Network testing
470#
471# CONFIG_NET_PKTGEN is not set
472# CONFIG_NETPOLL is not set
473# CONFIG_NET_POLL_CONTROLLER is not set
474# CONFIG_HAMRADIO is not set
475# CONFIG_IRDA is not set
476# CONFIG_BT is not set
477CONFIG_NETDEVICES=y
478# CONFIG_DUMMY is not set
479# CONFIG_BONDING is not set
480# CONFIG_EQUALIZER is not set
481# CONFIG_TUN is not set
482
483#
484# ARCnet devices
485#
486# CONFIG_ARCNET is not set
487
488#
489# Ethernet (10 or 100Mbit)
490#
491# CONFIG_NET_ETHERNET is not set
492
493#
494# Ethernet (1000 Mbit)
495#
496# CONFIG_ACENIC is not set
497# CONFIG_DL2K is not set
498CONFIG_E1000=y
499CONFIG_E1000_NAPI=y
500# CONFIG_NS83820 is not set
501# CONFIG_HAMACHI is not set
502# CONFIG_YELLOWFIN is not set
503# CONFIG_R8169 is not set
504# CONFIG_SK98LIN is not set
505# CONFIG_TIGON3 is not set
506
507#
508# Ethernet (10000 Mbit)
509#
510# CONFIG_IXGB is not set
511# CONFIG_S2IO is not set
512
513#
514# Token Ring devices
515#
516# CONFIG_TR is not set
517
518#
519# Wireless LAN (non-hamradio)
520#
521# CONFIG_NET_RADIO is not set
522
523#
524# Wan interfaces
525#
526# CONFIG_WAN is not set
527# CONFIG_FDDI is not set
528# CONFIG_HIPPI is not set
529# CONFIG_PPP is not set
530# CONFIG_SLIP is not set
531# CONFIG_NET_FC is not set
532# CONFIG_SHAPER is not set
533# CONFIG_NETCONSOLE is not set
534
535#
536# ISDN subsystem
537#
538# CONFIG_ISDN is not set
539
540#
541# Input device support
542#
543CONFIG_INPUT=y
544
545#
546# Userland interfaces
547#
548CONFIG_INPUT_MOUSEDEV=y
549# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
550CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
551CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
552# CONFIG_INPUT_JOYDEV is not set
553# CONFIG_INPUT_TSDEV is not set
554# CONFIG_INPUT_EVDEV is not set
555# CONFIG_INPUT_EVBUG is not set
556
557#
558# Input Device Drivers
559#
560# CONFIG_INPUT_KEYBOARD is not set
561# CONFIG_INPUT_MOUSE is not set
562# CONFIG_INPUT_JOYSTICK is not set
563# CONFIG_INPUT_TOUCHSCREEN is not set
564# CONFIG_INPUT_MISC is not set
565
566#
567# Hardware I/O ports
568#
569# CONFIG_SERIO is not set
570# CONFIG_GAMEPORT is not set
571CONFIG_SOUND_GAMEPORT=y
572
573#
574# Character devices
575#
576CONFIG_VT=y
577CONFIG_VT_CONSOLE=y
578CONFIG_HW_CONSOLE=y
579# CONFIG_SERIAL_NONSTANDARD is not set
580
581#
582# Serial drivers
583#
584CONFIG_SERIAL_8250=y
585CONFIG_SERIAL_8250_CONSOLE=y
586CONFIG_SERIAL_8250_NR_UARTS=4
587# CONFIG_SERIAL_8250_EXTENDED is not set
588
589#
590# Non-8250 serial port support
591#
592CONFIG_SERIAL_CORE=y
593CONFIG_SERIAL_CORE_CONSOLE=y
594CONFIG_UNIX98_PTYS=y
595CONFIG_LEGACY_PTYS=y
596CONFIG_LEGACY_PTY_COUNT=256
597
598#
599# IPMI
600#
601# CONFIG_IPMI_HANDLER is not set
602
603#
604# Watchdog Cards
605#
606# CONFIG_WATCHDOG is not set
607# CONFIG_NVRAM is not set
608# CONFIG_RTC is not set
609# CONFIG_DTLK is not set
610# CONFIG_R3964 is not set
611# CONFIG_APPLICOM is not set
612
613#
614# Ftape, the floppy tape device driver
615#
616# CONFIG_DRM is not set
617# CONFIG_RAW_DRIVER is not set
618
619#
620# TPM devices
621#
622# CONFIG_TCG_TPM is not set
623
624#
625# I2C support
626#
627CONFIG_I2C=y
628CONFIG_I2C_CHARDEV=y
629
630#
631# I2C Algorithms
632#
633# CONFIG_I2C_ALGOBIT is not set
634# CONFIG_I2C_ALGOPCF is not set
635# CONFIG_I2C_ALGOPCA is not set
636
637#
638# I2C Hardware Bus support
639#
640# CONFIG_I2C_ALI1535 is not set
641# CONFIG_I2C_ALI1563 is not set
642# CONFIG_I2C_ALI15X3 is not set
643# CONFIG_I2C_AMD756 is not set
644# CONFIG_I2C_AMD8111 is not set
645# CONFIG_I2C_I801 is not set
646# CONFIG_I2C_I810 is not set
647CONFIG_I2C_IOP3XX=y
648# CONFIG_I2C_ISA is not set
649# CONFIG_I2C_NFORCE2 is not set
650# CONFIG_I2C_PARPORT_LIGHT is not set
651# CONFIG_I2C_PIIX4 is not set
652# CONFIG_I2C_PROSAVAGE is not set
653# CONFIG_I2C_SAVAGE4 is not set
654# CONFIG_SCx200_ACB is not set
655# CONFIG_I2C_SIS5595 is not set
656# CONFIG_I2C_SIS630 is not set
657# CONFIG_I2C_SIS96X is not set
658# CONFIG_I2C_STUB is not set
659# CONFIG_I2C_VIA is not set
660# CONFIG_I2C_VIAPRO is not set
661# CONFIG_I2C_VOODOO3 is not set
662# CONFIG_I2C_PCA_ISA is not set
663
664#
665# Hardware Sensors Chip support
666#
667# CONFIG_I2C_SENSOR is not set
668# CONFIG_SENSORS_ADM1021 is not set
669# CONFIG_SENSORS_ADM1025 is not set
670# CONFIG_SENSORS_ADM1026 is not set
671# CONFIG_SENSORS_ADM1031 is not set
672# CONFIG_SENSORS_ASB100 is not set
673# CONFIG_SENSORS_DS1621 is not set
674# CONFIG_SENSORS_FSCHER is not set
675# CONFIG_SENSORS_FSCPOS is not set
676# CONFIG_SENSORS_GL518SM is not set
677# CONFIG_SENSORS_GL520SM is not set
678# CONFIG_SENSORS_IT87 is not set
679# CONFIG_SENSORS_LM63 is not set
680# CONFIG_SENSORS_LM75 is not set
681# CONFIG_SENSORS_LM77 is not set
682# CONFIG_SENSORS_LM78 is not set
683# CONFIG_SENSORS_LM80 is not set
684# CONFIG_SENSORS_LM83 is not set
685# CONFIG_SENSORS_LM85 is not set
686# CONFIG_SENSORS_LM87 is not set
687# CONFIG_SENSORS_LM90 is not set
688# CONFIG_SENSORS_MAX1619 is not set
689# CONFIG_SENSORS_PC87360 is not set
690# CONFIG_SENSORS_SMSC47B397 is not set
691# CONFIG_SENSORS_SIS5595 is not set
692# CONFIG_SENSORS_SMSC47M1 is not set
693# CONFIG_SENSORS_VIA686A is not set
694# CONFIG_SENSORS_W83781D is not set
695# CONFIG_SENSORS_W83L785TS is not set
696# CONFIG_SENSORS_W83627HF is not set
697
698#
699# Other I2C Chip support
700#
701# CONFIG_SENSORS_EEPROM is not set
702# CONFIG_SENSORS_PCF8574 is not set
703# CONFIG_SENSORS_PCF8591 is not set
704# CONFIG_SENSORS_RTC8564 is not set
705# CONFIG_I2C_DEBUG_CORE is not set
706# CONFIG_I2C_DEBUG_ALGO is not set
707# CONFIG_I2C_DEBUG_BUS is not set
708# CONFIG_I2C_DEBUG_CHIP is not set
709
710#
711# Misc devices
712#
713
714#
715# Multimedia devices
716#
717# CONFIG_VIDEO_DEV is not set
718
719#
720# Digital Video Broadcasting Devices
721#
722# CONFIG_DVB is not set
723
724#
725# Graphics support
726#
727# CONFIG_FB is not set
728
729#
730# Console display driver support
731#
732# CONFIG_VGA_CONSOLE is not set
733CONFIG_DUMMY_CONSOLE=y
734
735#
736# Sound
737#
738# CONFIG_SOUND is not set
739
740#
741# USB support
742#
743CONFIG_USB_ARCH_HAS_HCD=y
744CONFIG_USB_ARCH_HAS_OHCI=y
745# CONFIG_USB is not set
746
747#
748# USB Gadget Support
749#
750# CONFIG_USB_GADGET is not set
751
752#
753# MMC/SD Card support
754#
755# CONFIG_MMC is not set
756
757#
758# File systems
759#
760CONFIG_EXT2_FS=y
761# CONFIG_EXT2_FS_XATTR is not set
762CONFIG_EXT3_FS=y
763CONFIG_EXT3_FS_XATTR=y
764# CONFIG_EXT3_FS_POSIX_ACL is not set
765# CONFIG_EXT3_FS_SECURITY is not set
766CONFIG_JBD=y
767# CONFIG_JBD_DEBUG is not set
768CONFIG_FS_MBCACHE=y
769# CONFIG_REISERFS_FS is not set
770# CONFIG_JFS_FS is not set
771
772#
773# XFS support
774#
775CONFIG_XFS_FS=y
776CONFIG_XFS_EXPORT=y
777# CONFIG_XFS_RT is not set
778# CONFIG_XFS_QUOTA is not set
779CONFIG_XFS_SECURITY=y
780CONFIG_XFS_POSIX_ACL=y
781# CONFIG_MINIX_FS is not set
782# CONFIG_ROMFS_FS is not set
783# CONFIG_QUOTA is not set
784CONFIG_DNOTIFY=y
785# CONFIG_AUTOFS_FS is not set
786# CONFIG_AUTOFS4_FS is not set
787
788#
789# CD-ROM/DVD Filesystems
790#
791# CONFIG_ISO9660_FS is not set
792# CONFIG_UDF_FS is not set
793
794#
795# DOS/FAT/NT Filesystems
796#
797# CONFIG_MSDOS_FS is not set
798# CONFIG_VFAT_FS is not set
799# CONFIG_NTFS_FS is not set
800
801#
802# Pseudo filesystems
803#
804CONFIG_PROC_FS=y
805CONFIG_SYSFS=y
806# CONFIG_DEVFS_FS is not set
807# CONFIG_DEVPTS_FS_XATTR is not set
808CONFIG_TMPFS=y
809# CONFIG_TMPFS_XATTR is not set
810# CONFIG_HUGETLB_PAGE is not set
811CONFIG_RAMFS=y
812
813#
814# Miscellaneous filesystems
815#
816# CONFIG_ADFS_FS is not set
817# CONFIG_AFFS_FS is not set
818# CONFIG_HFS_FS is not set
819# CONFIG_HFSPLUS_FS is not set
820# CONFIG_BEFS_FS is not set
821# CONFIG_BFS_FS is not set
822# CONFIG_EFS_FS is not set
823# CONFIG_JFFS_FS is not set
824# CONFIG_JFFS2_FS is not set
825# CONFIG_CRAMFS is not set
826# CONFIG_VXFS_FS is not set
827# CONFIG_HPFS_FS is not set
828# CONFIG_QNX4FS_FS is not set
829# CONFIG_SYSV_FS is not set
830# CONFIG_UFS_FS is not set
831
832#
833# Network File Systems
834#
835CONFIG_NFS_FS=y
836CONFIG_NFS_V3=y
837# CONFIG_NFS_V4 is not set
838# CONFIG_NFS_DIRECTIO is not set
839CONFIG_NFSD=y
840CONFIG_NFSD_V3=y
841# CONFIG_NFSD_V4 is not set
842# CONFIG_NFSD_TCP is not set
843CONFIG_ROOT_NFS=y
844CONFIG_LOCKD=y
845CONFIG_LOCKD_V4=y
846CONFIG_EXPORTFS=y
847CONFIG_SUNRPC=y
848# CONFIG_RPCSEC_GSS_KRB5 is not set
849# CONFIG_RPCSEC_GSS_SPKM3 is not set
850# CONFIG_SMB_FS is not set
851# CONFIG_CIFS is not set
852# CONFIG_NCP_FS is not set
853# CONFIG_CODA_FS is not set
854# CONFIG_AFS_FS is not set
855
856#
857# Partition Types
858#
859CONFIG_PARTITION_ADVANCED=y
860# CONFIG_ACORN_PARTITION is not set
861# CONFIG_OSF_PARTITION is not set
862# CONFIG_AMIGA_PARTITION is not set
863# CONFIG_ATARI_PARTITION is not set
864# CONFIG_MAC_PARTITION is not set
865CONFIG_MSDOS_PARTITION=y
866# CONFIG_BSD_DISKLABEL is not set
867# CONFIG_MINIX_SUBPARTITION is not set
868# CONFIG_SOLARIS_X86_PARTITION is not set
869# CONFIG_UNIXWARE_DISKLABEL is not set
870# CONFIG_LDM_PARTITION is not set
871# CONFIG_SGI_PARTITION is not set
872# CONFIG_ULTRIX_PARTITION is not set
873# CONFIG_SUN_PARTITION is not set
874# CONFIG_EFI_PARTITION is not set
875
876#
877# Native Language Support
878#
879# CONFIG_NLS is not set
880
881#
882# Profiling support
883#
884# CONFIG_PROFILING is not set
885
886#
887# Kernel hacking
888#
889# CONFIG_PRINTK_TIME is not set
890# CONFIG_DEBUG_KERNEL is not set
891CONFIG_LOG_BUF_SHIFT=14
892CONFIG_DEBUG_BUGVERBOSE=y
893CONFIG_FRAME_POINTER=y
894CONFIG_DEBUG_USER=y
895
896#
897# Security options
898#
899# CONFIG_KEYS is not set
900# CONFIG_SECURITY is not set
901
902#
903# Cryptographic options
904#
905# CONFIG_CRYPTO is not set
906
907#
908# Hardware crypto devices
909#
910
911#
912# Library routines
913#
914# CONFIG_CRC_CCITT is not set
915# CONFIG_CRC32 is not set
916# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/configs/iq80332_defconfig b/arch/arm/configs/iq80332_defconfig
new file mode 100644
index 000000000000..305f01f3a729
--- /dev/null
+++ b/arch/arm/configs/iq80332_defconfig
@@ -0,0 +1,916 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 17:33:39 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53CONFIG_MODULE_UNLOAD=y
54# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set
57# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y
59
60#
61# System Type
62#
63# CONFIG_ARCH_CLPS7500 is not set
64# CONFIG_ARCH_CLPS711X is not set
65# CONFIG_ARCH_CO285 is not set
66# CONFIG_ARCH_EBSA110 is not set
67# CONFIG_ARCH_CAMELOT is not set
68# CONFIG_ARCH_FOOTBRIDGE is not set
69# CONFIG_ARCH_INTEGRATOR is not set
70CONFIG_ARCH_IOP3XX=y
71# CONFIG_ARCH_IXP4XX is not set
72# CONFIG_ARCH_IXP2000 is not set
73# CONFIG_ARCH_L7200 is not set
74# CONFIG_ARCH_PXA is not set
75# CONFIG_ARCH_RPC is not set
76# CONFIG_ARCH_SA1100 is not set
77# CONFIG_ARCH_S3C2410 is not set
78# CONFIG_ARCH_SHARK is not set
79# CONFIG_ARCH_LH7A40X is not set
80# CONFIG_ARCH_OMAP is not set
81# CONFIG_ARCH_VERSATILE is not set
82# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set
84
85#
86# IOP3xx Implementation Options
87#
88
89#
90# IOP3xx Platform Types
91#
92# CONFIG_ARCH_IQ80321 is not set
93# CONFIG_ARCH_IQ31244 is not set
94# CONFIG_ARCH_IQ80331 is not set
95CONFIG_MACH_IQ80332=y
96# CONFIG_ARCH_EP80219 is not set
97CONFIG_ARCH_IOP331=y
98
99#
100# IOP3xx Chipset Features
101#
102# CONFIG_IOP331_STEPD is not set
103
104#
105# Processor Type
106#
107CONFIG_CPU_32=y
108CONFIG_CPU_XSCALE=y
109CONFIG_CPU_32v5=y
110CONFIG_CPU_ABRT_EV5T=y
111CONFIG_CPU_CACHE_VIVT=y
112CONFIG_CPU_TLB_V4WBI=y
113CONFIG_CPU_MINICACHE=y
114
115#
116# Processor Features
117#
118# CONFIG_ARM_THUMB is not set
119CONFIG_XSCALE_PMU=y
120
121#
122# Bus support
123#
124CONFIG_PCI=y
125# CONFIG_PCI_LEGACY_PROC is not set
126CONFIG_PCI_NAMES=y
127
128#
129# PCCARD (PCMCIA/CardBus) support
130#
131# CONFIG_PCCARD is not set
132
133#
134# Kernel Features
135#
136# CONFIG_PREEMPT is not set
137CONFIG_ALIGNMENT_TRAP=y
138
139#
140# Boot options
141#
142CONFIG_ZBOOT_ROM_TEXT=0x0
143CONFIG_ZBOOT_ROM_BSS=0x0
144CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200"
145# CONFIG_XIP_KERNEL is not set
146
147#
148# Floating point emulation
149#
150
151#
152# At least one emulation must be selected
153#
154CONFIG_FPE_NWFPE=y
155# CONFIG_FPE_NWFPE_XP is not set
156# CONFIG_FPE_FASTFPE is not set
157
158#
159# Userspace binary formats
160#
161CONFIG_BINFMT_ELF=y
162CONFIG_BINFMT_AOUT=y
163# CONFIG_BINFMT_MISC is not set
164# CONFIG_ARTHUR is not set
165
166#
167# Power management options
168#
169# CONFIG_PM is not set
170
171#
172# Device Drivers
173#
174
175#
176# Generic Driver Options
177#
178CONFIG_STANDALONE=y
179CONFIG_PREVENT_FIRMWARE_BUILD=y
180# CONFIG_FW_LOADER is not set
181
182#
183# Memory Technology Devices (MTD)
184#
185CONFIG_MTD=y
186# CONFIG_MTD_DEBUG is not set
187# CONFIG_MTD_CONCAT is not set
188CONFIG_MTD_PARTITIONS=y
189CONFIG_MTD_REDBOOT_PARTS=y
190CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
191CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
192CONFIG_MTD_REDBOOT_PARTS_READONLY=y
193# CONFIG_MTD_CMDLINE_PARTS is not set
194# CONFIG_MTD_AFS_PARTS is not set
195
196#
197# User Modules And Translation Layers
198#
199CONFIG_MTD_CHAR=y
200CONFIG_MTD_BLOCK=y
201# CONFIG_FTL is not set
202# CONFIG_NFTL is not set
203# CONFIG_INFTL is not set
204
205#
206# RAM/ROM/Flash chip drivers
207#
208CONFIG_MTD_CFI=y
209# CONFIG_MTD_JEDECPROBE is not set
210CONFIG_MTD_GEN_PROBE=y
211CONFIG_MTD_CFI_ADV_OPTIONS=y
212CONFIG_MTD_CFI_NOSWAP=y
213# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
214# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
215# CONFIG_MTD_CFI_GEOMETRY is not set
216CONFIG_MTD_MAP_BANK_WIDTH_1=y
217CONFIG_MTD_MAP_BANK_WIDTH_2=y
218CONFIG_MTD_MAP_BANK_WIDTH_4=y
219# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
220# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
221# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
222CONFIG_MTD_CFI_I1=y
223CONFIG_MTD_CFI_I2=y
224# CONFIG_MTD_CFI_I4 is not set
225# CONFIG_MTD_CFI_I8 is not set
226CONFIG_MTD_CFI_INTELEXT=y
227# CONFIG_MTD_CFI_AMDSTD is not set
228# CONFIG_MTD_CFI_STAA is not set
229CONFIG_MTD_CFI_UTIL=y
230# CONFIG_MTD_RAM is not set
231# CONFIG_MTD_ROM is not set
232# CONFIG_MTD_ABSENT is not set
233# CONFIG_MTD_XIP is not set
234
235#
236# Mapping drivers for chip access
237#
238# CONFIG_MTD_COMPLEX_MAPPINGS is not set
239CONFIG_MTD_PHYSMAP=y
240CONFIG_MTD_PHYSMAP_START=0xc0000000
241CONFIG_MTD_PHYSMAP_LEN=0x00800000
242CONFIG_MTD_PHYSMAP_BANKWIDTH=1
243# CONFIG_MTD_ARM_INTEGRATOR is not set
244# CONFIG_MTD_EDB7312 is not set
245
246#
247# Self-contained MTD device drivers
248#
249# CONFIG_MTD_PMC551 is not set
250# CONFIG_MTD_SLRAM is not set
251# CONFIG_MTD_PHRAM is not set
252# CONFIG_MTD_MTDRAM is not set
253# CONFIG_MTD_BLKMTD is not set
254# CONFIG_MTD_BLOCK2MTD is not set
255
256#
257# Disk-On-Chip Device Drivers
258#
259# CONFIG_MTD_DOC2000 is not set
260# CONFIG_MTD_DOC2001 is not set
261# CONFIG_MTD_DOC2001PLUS is not set
262
263#
264# NAND Flash Device Drivers
265#
266# CONFIG_MTD_NAND 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
286# CONFIG_BLK_DEV_LOOP is not set
287# CONFIG_BLK_DEV_NBD is not set
288# CONFIG_BLK_DEV_SX8 is not set
289CONFIG_BLK_DEV_RAM=y
290CONFIG_BLK_DEV_RAM_COUNT=16
291CONFIG_BLK_DEV_RAM_SIZE=8192
292# CONFIG_BLK_DEV_INITRD is not set
293CONFIG_INITRAMFS_SOURCE=""
294# CONFIG_CDROM_PKTCDVD is not set
295
296#
297# IO Schedulers
298#
299CONFIG_IOSCHED_NOOP=y
300CONFIG_IOSCHED_AS=y
301CONFIG_IOSCHED_DEADLINE=y
302CONFIG_IOSCHED_CFQ=y
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#
313CONFIG_SCSI=y
314CONFIG_SCSI_PROC_FS=y
315
316#
317# SCSI support type (disk, tape, CD-ROM)
318#
319CONFIG_BLK_DEV_SD=y
320# CONFIG_CHR_DEV_ST is not set
321# CONFIG_CHR_DEV_OSST is not set
322# CONFIG_BLK_DEV_SR is not set
323CONFIG_CHR_DEV_SG=y
324
325#
326# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
327#
328# CONFIG_SCSI_MULTI_LUN is not set
329# CONFIG_SCSI_CONSTANTS is not set
330# CONFIG_SCSI_LOGGING is not set
331
332#
333# SCSI Transport Attributes
334#
335# CONFIG_SCSI_SPI_ATTRS is not set
336# CONFIG_SCSI_FC_ATTRS is not set
337# CONFIG_SCSI_ISCSI_ATTRS is not set
338
339#
340# SCSI low-level drivers
341#
342# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
343# CONFIG_SCSI_3W_9XXX is not set
344# CONFIG_SCSI_ACARD is not set
345# CONFIG_SCSI_AACRAID is not set
346# CONFIG_SCSI_AIC7XXX is not set
347# CONFIG_SCSI_AIC7XXX_OLD is not set
348# CONFIG_SCSI_AIC79XX is not set
349# CONFIG_SCSI_DPT_I2O is not set
350# CONFIG_MEGARAID_NEWGEN is not set
351# CONFIG_MEGARAID_LEGACY is not set
352# CONFIG_SCSI_SATA is not set
353# CONFIG_SCSI_BUSLOGIC is not set
354# CONFIG_SCSI_DMX3191D is not set
355# CONFIG_SCSI_EATA is not set
356# CONFIG_SCSI_FUTURE_DOMAIN is not set
357# CONFIG_SCSI_GDTH is not set
358# CONFIG_SCSI_IPS is not set
359# CONFIG_SCSI_INITIO is not set
360# CONFIG_SCSI_INIA100 is not set
361# CONFIG_SCSI_SYM53C8XX_2 is not set
362# CONFIG_SCSI_IPR is not set
363# CONFIG_SCSI_QLOGIC_FC is not set
364# CONFIG_SCSI_QLOGIC_1280 is not set
365CONFIG_SCSI_QLA2XXX=y
366# CONFIG_SCSI_QLA21XX is not set
367# CONFIG_SCSI_QLA22XX is not set
368# CONFIG_SCSI_QLA2300 is not set
369# CONFIG_SCSI_QLA2322 is not set
370# CONFIG_SCSI_QLA6312 is not set
371# CONFIG_SCSI_DC395x is not set
372# CONFIG_SCSI_DC390T is not set
373# CONFIG_SCSI_NSP32 is not set
374# CONFIG_SCSI_DEBUG is not set
375
376#
377# Multi-device support (RAID and LVM)
378#
379CONFIG_MD=y
380CONFIG_BLK_DEV_MD=y
381CONFIG_MD_LINEAR=y
382CONFIG_MD_RAID0=y
383CONFIG_MD_RAID1=y
384# CONFIG_MD_RAID10 is not set
385CONFIG_MD_RAID5=y
386# CONFIG_MD_RAID6 is not set
387# CONFIG_MD_MULTIPATH is not set
388# CONFIG_MD_FAULTY is not set
389CONFIG_BLK_DEV_DM=y
390# CONFIG_DM_CRYPT is not set
391# CONFIG_DM_SNAPSHOT is not set
392# CONFIG_DM_MIRROR is not set
393# CONFIG_DM_ZERO is not set
394# CONFIG_DM_MULTIPATH is not set
395
396#
397# Fusion MPT device support
398#
399# CONFIG_FUSION is not set
400
401#
402# IEEE 1394 (FireWire) support
403#
404# CONFIG_IEEE1394 is not set
405
406#
407# I2O device support
408#
409# CONFIG_I2O is not set
410
411#
412# Networking support
413#
414CONFIG_NET=y
415
416#
417# Networking options
418#
419CONFIG_PACKET=y
420CONFIG_PACKET_MMAP=y
421# CONFIG_NETLINK_DEV is not set
422CONFIG_UNIX=y
423# CONFIG_NET_KEY is not set
424CONFIG_INET=y
425CONFIG_IP_MULTICAST=y
426# CONFIG_IP_ADVANCED_ROUTER is not set
427CONFIG_IP_PNP=y
428# CONFIG_IP_PNP_DHCP is not set
429CONFIG_IP_PNP_BOOTP=y
430# CONFIG_IP_PNP_RARP is not set
431# CONFIG_NET_IPIP is not set
432# CONFIG_NET_IPGRE is not set
433# CONFIG_IP_MROUTE is not set
434# CONFIG_ARPD is not set
435# CONFIG_SYN_COOKIES is not set
436# CONFIG_INET_AH is not set
437# CONFIG_INET_ESP is not set
438# CONFIG_INET_IPCOMP is not set
439# CONFIG_INET_TUNNEL is not set
440CONFIG_IP_TCPDIAG=y
441# CONFIG_IP_TCPDIAG_IPV6 is not set
442# CONFIG_IPV6 is not set
443# CONFIG_NETFILTER is not set
444
445#
446# SCTP Configuration (EXPERIMENTAL)
447#
448# CONFIG_IP_SCTP is not set
449# CONFIG_ATM is not set
450# CONFIG_BRIDGE is not set
451# CONFIG_VLAN_8021Q is not set
452# CONFIG_DECNET is not set
453# CONFIG_LLC2 is not set
454# CONFIG_IPX is not set
455# CONFIG_ATALK is not set
456# CONFIG_X25 is not set
457# CONFIG_LAPB is not set
458# CONFIG_NET_DIVERT is not set
459# CONFIG_ECONET is not set
460# CONFIG_WAN_ROUTER is not set
461
462#
463# QoS and/or fair queueing
464#
465# CONFIG_NET_SCHED is not set
466# CONFIG_NET_CLS_ROUTE is not set
467
468#
469# Network testing
470#
471# CONFIG_NET_PKTGEN is not set
472# CONFIG_NETPOLL is not set
473# CONFIG_NET_POLL_CONTROLLER is not set
474# CONFIG_HAMRADIO is not set
475# CONFIG_IRDA is not set
476# CONFIG_BT is not set
477CONFIG_NETDEVICES=y
478# CONFIG_DUMMY is not set
479# CONFIG_BONDING is not set
480# CONFIG_EQUALIZER is not set
481# CONFIG_TUN is not set
482
483#
484# ARCnet devices
485#
486# CONFIG_ARCNET is not set
487
488#
489# Ethernet (10 or 100Mbit)
490#
491# CONFIG_NET_ETHERNET is not set
492
493#
494# Ethernet (1000 Mbit)
495#
496# CONFIG_ACENIC is not set
497# CONFIG_DL2K is not set
498CONFIG_E1000=y
499CONFIG_E1000_NAPI=y
500# CONFIG_NS83820 is not set
501# CONFIG_HAMACHI is not set
502# CONFIG_YELLOWFIN is not set
503# CONFIG_R8169 is not set
504# CONFIG_SK98LIN is not set
505# CONFIG_TIGON3 is not set
506
507#
508# Ethernet (10000 Mbit)
509#
510# CONFIG_IXGB is not set
511# CONFIG_S2IO is not set
512
513#
514# Token Ring devices
515#
516# CONFIG_TR is not set
517
518#
519# Wireless LAN (non-hamradio)
520#
521# CONFIG_NET_RADIO is not set
522
523#
524# Wan interfaces
525#
526# CONFIG_WAN is not set
527# CONFIG_FDDI is not set
528# CONFIG_HIPPI is not set
529# CONFIG_PPP is not set
530# CONFIG_SLIP is not set
531# CONFIG_NET_FC is not set
532# CONFIG_SHAPER is not set
533# CONFIG_NETCONSOLE is not set
534
535#
536# ISDN subsystem
537#
538# CONFIG_ISDN is not set
539
540#
541# Input device support
542#
543CONFIG_INPUT=y
544
545#
546# Userland interfaces
547#
548CONFIG_INPUT_MOUSEDEV=y
549# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
550CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
551CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
552# CONFIG_INPUT_JOYDEV is not set
553# CONFIG_INPUT_TSDEV is not set
554# CONFIG_INPUT_EVDEV is not set
555# CONFIG_INPUT_EVBUG is not set
556
557#
558# Input Device Drivers
559#
560# CONFIG_INPUT_KEYBOARD is not set
561# CONFIG_INPUT_MOUSE is not set
562# CONFIG_INPUT_JOYSTICK is not set
563# CONFIG_INPUT_TOUCHSCREEN is not set
564# CONFIG_INPUT_MISC is not set
565
566#
567# Hardware I/O ports
568#
569# CONFIG_SERIO is not set
570# CONFIG_GAMEPORT is not set
571CONFIG_SOUND_GAMEPORT=y
572
573#
574# Character devices
575#
576CONFIG_VT=y
577CONFIG_VT_CONSOLE=y
578CONFIG_HW_CONSOLE=y
579# CONFIG_SERIAL_NONSTANDARD is not set
580
581#
582# Serial drivers
583#
584CONFIG_SERIAL_8250=y
585CONFIG_SERIAL_8250_CONSOLE=y
586CONFIG_SERIAL_8250_NR_UARTS=4
587# CONFIG_SERIAL_8250_EXTENDED is not set
588
589#
590# Non-8250 serial port support
591#
592CONFIG_SERIAL_CORE=y
593CONFIG_SERIAL_CORE_CONSOLE=y
594CONFIG_UNIX98_PTYS=y
595CONFIG_LEGACY_PTYS=y
596CONFIG_LEGACY_PTY_COUNT=256
597
598#
599# IPMI
600#
601# CONFIG_IPMI_HANDLER is not set
602
603#
604# Watchdog Cards
605#
606# CONFIG_WATCHDOG is not set
607# CONFIG_NVRAM is not set
608# CONFIG_RTC is not set
609# CONFIG_DTLK is not set
610# CONFIG_R3964 is not set
611# CONFIG_APPLICOM is not set
612
613#
614# Ftape, the floppy tape device driver
615#
616# CONFIG_DRM is not set
617# CONFIG_RAW_DRIVER is not set
618
619#
620# TPM devices
621#
622# CONFIG_TCG_TPM is not set
623
624#
625# I2C support
626#
627CONFIG_I2C=y
628CONFIG_I2C_CHARDEV=y
629
630#
631# I2C Algorithms
632#
633# CONFIG_I2C_ALGOBIT is not set
634# CONFIG_I2C_ALGOPCF is not set
635# CONFIG_I2C_ALGOPCA is not set
636
637#
638# I2C Hardware Bus support
639#
640# CONFIG_I2C_ALI1535 is not set
641# CONFIG_I2C_ALI1563 is not set
642# CONFIG_I2C_ALI15X3 is not set
643# CONFIG_I2C_AMD756 is not set
644# CONFIG_I2C_AMD8111 is not set
645# CONFIG_I2C_I801 is not set
646# CONFIG_I2C_I810 is not set
647CONFIG_I2C_IOP3XX=y
648# CONFIG_I2C_ISA is not set
649# CONFIG_I2C_NFORCE2 is not set
650# CONFIG_I2C_PARPORT_LIGHT is not set
651# CONFIG_I2C_PIIX4 is not set
652# CONFIG_I2C_PROSAVAGE is not set
653# CONFIG_I2C_SAVAGE4 is not set
654# CONFIG_SCx200_ACB is not set
655# CONFIG_I2C_SIS5595 is not set
656# CONFIG_I2C_SIS630 is not set
657# CONFIG_I2C_SIS96X is not set
658# CONFIG_I2C_STUB is not set
659# CONFIG_I2C_VIA is not set
660# CONFIG_I2C_VIAPRO is not set
661# CONFIG_I2C_VOODOO3 is not set
662# CONFIG_I2C_PCA_ISA is not set
663
664#
665# Hardware Sensors Chip support
666#
667# CONFIG_I2C_SENSOR is not set
668# CONFIG_SENSORS_ADM1021 is not set
669# CONFIG_SENSORS_ADM1025 is not set
670# CONFIG_SENSORS_ADM1026 is not set
671# CONFIG_SENSORS_ADM1031 is not set
672# CONFIG_SENSORS_ASB100 is not set
673# CONFIG_SENSORS_DS1621 is not set
674# CONFIG_SENSORS_FSCHER is not set
675# CONFIG_SENSORS_FSCPOS is not set
676# CONFIG_SENSORS_GL518SM is not set
677# CONFIG_SENSORS_GL520SM is not set
678# CONFIG_SENSORS_IT87 is not set
679# CONFIG_SENSORS_LM63 is not set
680# CONFIG_SENSORS_LM75 is not set
681# CONFIG_SENSORS_LM77 is not set
682# CONFIG_SENSORS_LM78 is not set
683# CONFIG_SENSORS_LM80 is not set
684# CONFIG_SENSORS_LM83 is not set
685# CONFIG_SENSORS_LM85 is not set
686# CONFIG_SENSORS_LM87 is not set
687# CONFIG_SENSORS_LM90 is not set
688# CONFIG_SENSORS_MAX1619 is not set
689# CONFIG_SENSORS_PC87360 is not set
690# CONFIG_SENSORS_SMSC47B397 is not set
691# CONFIG_SENSORS_SIS5595 is not set
692# CONFIG_SENSORS_SMSC47M1 is not set
693# CONFIG_SENSORS_VIA686A is not set
694# CONFIG_SENSORS_W83781D is not set
695# CONFIG_SENSORS_W83L785TS is not set
696# CONFIG_SENSORS_W83627HF is not set
697
698#
699# Other I2C Chip support
700#
701# CONFIG_SENSORS_EEPROM is not set
702# CONFIG_SENSORS_PCF8574 is not set
703# CONFIG_SENSORS_PCF8591 is not set
704# CONFIG_SENSORS_RTC8564 is not set
705# CONFIG_I2C_DEBUG_CORE is not set
706# CONFIG_I2C_DEBUG_ALGO is not set
707# CONFIG_I2C_DEBUG_BUS is not set
708# CONFIG_I2C_DEBUG_CHIP is not set
709
710#
711# Misc devices
712#
713
714#
715# Multimedia devices
716#
717# CONFIG_VIDEO_DEV is not set
718
719#
720# Digital Video Broadcasting Devices
721#
722# CONFIG_DVB is not set
723
724#
725# Graphics support
726#
727# CONFIG_FB is not set
728
729#
730# Console display driver support
731#
732# CONFIG_VGA_CONSOLE is not set
733CONFIG_DUMMY_CONSOLE=y
734
735#
736# Sound
737#
738# CONFIG_SOUND is not set
739
740#
741# USB support
742#
743CONFIG_USB_ARCH_HAS_HCD=y
744CONFIG_USB_ARCH_HAS_OHCI=y
745# CONFIG_USB is not set
746
747#
748# USB Gadget Support
749#
750# CONFIG_USB_GADGET is not set
751
752#
753# MMC/SD Card support
754#
755# CONFIG_MMC is not set
756
757#
758# File systems
759#
760CONFIG_EXT2_FS=y
761# CONFIG_EXT2_FS_XATTR is not set
762CONFIG_EXT3_FS=y
763CONFIG_EXT3_FS_XATTR=y
764# CONFIG_EXT3_FS_POSIX_ACL is not set
765# CONFIG_EXT3_FS_SECURITY is not set
766CONFIG_JBD=y
767# CONFIG_JBD_DEBUG is not set
768CONFIG_FS_MBCACHE=y
769# CONFIG_REISERFS_FS is not set
770# CONFIG_JFS_FS is not set
771
772#
773# XFS support
774#
775CONFIG_XFS_FS=y
776CONFIG_XFS_EXPORT=y
777# CONFIG_XFS_RT is not set
778# CONFIG_XFS_QUOTA is not set
779CONFIG_XFS_SECURITY=y
780CONFIG_XFS_POSIX_ACL=y
781# CONFIG_MINIX_FS is not set
782# CONFIG_ROMFS_FS is not set
783# CONFIG_QUOTA is not set
784CONFIG_DNOTIFY=y
785# CONFIG_AUTOFS_FS is not set
786# CONFIG_AUTOFS4_FS is not set
787
788#
789# CD-ROM/DVD Filesystems
790#
791# CONFIG_ISO9660_FS is not set
792# CONFIG_UDF_FS is not set
793
794#
795# DOS/FAT/NT Filesystems
796#
797# CONFIG_MSDOS_FS is not set
798# CONFIG_VFAT_FS is not set
799# CONFIG_NTFS_FS is not set
800
801#
802# Pseudo filesystems
803#
804CONFIG_PROC_FS=y
805CONFIG_SYSFS=y
806# CONFIG_DEVFS_FS is not set
807# CONFIG_DEVPTS_FS_XATTR is not set
808CONFIG_TMPFS=y
809# CONFIG_TMPFS_XATTR is not set
810# CONFIG_HUGETLB_PAGE is not set
811CONFIG_RAMFS=y
812
813#
814# Miscellaneous filesystems
815#
816# CONFIG_ADFS_FS is not set
817# CONFIG_AFFS_FS is not set
818# CONFIG_HFS_FS is not set
819# CONFIG_HFSPLUS_FS is not set
820# CONFIG_BEFS_FS is not set
821# CONFIG_BFS_FS is not set
822# CONFIG_EFS_FS is not set
823# CONFIG_JFFS_FS is not set
824# CONFIG_JFFS2_FS is not set
825# CONFIG_CRAMFS is not set
826# CONFIG_VXFS_FS is not set
827# CONFIG_HPFS_FS is not set
828# CONFIG_QNX4FS_FS is not set
829# CONFIG_SYSV_FS is not set
830# CONFIG_UFS_FS is not set
831
832#
833# Network File Systems
834#
835CONFIG_NFS_FS=y
836CONFIG_NFS_V3=y
837# CONFIG_NFS_V4 is not set
838# CONFIG_NFS_DIRECTIO is not set
839CONFIG_NFSD=y
840CONFIG_NFSD_V3=y
841# CONFIG_NFSD_V4 is not set
842# CONFIG_NFSD_TCP is not set
843CONFIG_ROOT_NFS=y
844CONFIG_LOCKD=y
845CONFIG_LOCKD_V4=y
846CONFIG_EXPORTFS=y
847CONFIG_SUNRPC=y
848# CONFIG_RPCSEC_GSS_KRB5 is not set
849# CONFIG_RPCSEC_GSS_SPKM3 is not set
850# CONFIG_SMB_FS is not set
851# CONFIG_CIFS is not set
852# CONFIG_NCP_FS is not set
853# CONFIG_CODA_FS is not set
854# CONFIG_AFS_FS is not set
855
856#
857# Partition Types
858#
859CONFIG_PARTITION_ADVANCED=y
860# CONFIG_ACORN_PARTITION is not set
861# CONFIG_OSF_PARTITION is not set
862# CONFIG_AMIGA_PARTITION is not set
863# CONFIG_ATARI_PARTITION is not set
864# CONFIG_MAC_PARTITION is not set
865CONFIG_MSDOS_PARTITION=y
866# CONFIG_BSD_DISKLABEL is not set
867# CONFIG_MINIX_SUBPARTITION is not set
868# CONFIG_SOLARIS_X86_PARTITION is not set
869# CONFIG_UNIXWARE_DISKLABEL is not set
870# CONFIG_LDM_PARTITION is not set
871# CONFIG_SGI_PARTITION is not set
872# CONFIG_ULTRIX_PARTITION is not set
873# CONFIG_SUN_PARTITION is not set
874# CONFIG_EFI_PARTITION is not set
875
876#
877# Native Language Support
878#
879# CONFIG_NLS is not set
880
881#
882# Profiling support
883#
884# CONFIG_PROFILING is not set
885
886#
887# Kernel hacking
888#
889# CONFIG_PRINTK_TIME is not set
890# CONFIG_DEBUG_KERNEL is not set
891CONFIG_LOG_BUF_SHIFT=14
892CONFIG_DEBUG_BUGVERBOSE=y
893CONFIG_FRAME_POINTER=y
894CONFIG_DEBUG_USER=y
895
896#
897# Security options
898#
899# CONFIG_KEYS is not set
900# CONFIG_SECURITY is not set
901
902#
903# Cryptographic options
904#
905# CONFIG_CRYPTO is not set
906
907#
908# Hardware crypto devices
909#
910
911#
912# Library routines
913#
914# CONFIG_CRC_CCITT is not set
915# CONFIG_CRC32 is not set
916# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/configs/ixdp2400_defconfig b/arch/arm/configs/ixdp2400_defconfig
new file mode 100644
index 000000000000..4fd663ecbe39
--- /dev/null
+++ b/arch/arm/configs/ixdp2400_defconfig
@@ -0,0 +1,888 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 21:13:38 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34CONFIG_EMBEDDED=y
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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#
53# CONFIG_MODULES is not set
54
55#
56# System Type
57#
58# CONFIG_ARCH_CLPS7500 is not set
59# CONFIG_ARCH_CLPS711X is not set
60# CONFIG_ARCH_CO285 is not set
61# CONFIG_ARCH_EBSA110 is not set
62# CONFIG_ARCH_CAMELOT is not set
63# CONFIG_ARCH_FOOTBRIDGE is not set
64# CONFIG_ARCH_INTEGRATOR is not set
65# CONFIG_ARCH_IOP3XX is not set
66# CONFIG_ARCH_IXP4XX is not set
67CONFIG_ARCH_IXP2000=y
68# CONFIG_ARCH_L7200 is not set
69# CONFIG_ARCH_PXA is not set
70# CONFIG_ARCH_RPC is not set
71# CONFIG_ARCH_SA1100 is not set
72# CONFIG_ARCH_S3C2410 is not set
73# CONFIG_ARCH_SHARK is not set
74# CONFIG_ARCH_LH7A40X is not set
75# CONFIG_ARCH_OMAP is not set
76# CONFIG_ARCH_VERSATILE is not set
77# CONFIG_ARCH_IMX is not set
78# CONFIG_ARCH_H720X is not set
79CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
80
81#
82# Intel IXP2400/2800 Implementation Options
83#
84
85#
86# IXP2400/2800 Platforms
87#
88# CONFIG_ARCH_ENP2611 is not set
89CONFIG_ARCH_IXDP2400=y
90# CONFIG_ARCH_IXDP2800 is not set
91CONFIG_ARCH_IXDP2X00=y
92# CONFIG_ARCH_IXDP2401 is not set
93# CONFIG_ARCH_IXDP2801 is not set
94
95#
96# Processor Type
97#
98CONFIG_CPU_32=y
99CONFIG_CPU_XSCALE=y
100CONFIG_CPU_32v5=y
101CONFIG_CPU_ABRT_EV5T=y
102CONFIG_CPU_CACHE_VIVT=y
103CONFIG_CPU_TLB_V4WBI=y
104CONFIG_CPU_MINICACHE=y
105
106#
107# Processor Features
108#
109# CONFIG_ARM_THUMB is not set
110CONFIG_CPU_BIG_ENDIAN=y
111CONFIG_XSCALE_PMU=y
112
113#
114# Bus support
115#
116CONFIG_PCI=y
117CONFIG_PCI_LEGACY_PROC=y
118CONFIG_PCI_NAMES=y
119
120#
121# PCCARD (PCMCIA/CardBus) support
122#
123# CONFIG_PCCARD is not set
124
125#
126# Kernel Features
127#
128# CONFIG_PREEMPT is not set
129CONFIG_ALIGNMENT_TRAP=y
130
131#
132# Boot options
133#
134CONFIG_ZBOOT_ROM_TEXT=0x0
135CONFIG_ZBOOT_ROM_BSS=0x0
136CONFIG_CMDLINE="console=ttyS0,57600 root=/dev/nfs ip=bootp mem=64M@0x0 pci=firmware"
137# CONFIG_XIP_KERNEL is not set
138
139#
140# Floating point emulation
141#
142
143#
144# At least one emulation must be selected
145#
146CONFIG_FPE_NWFPE=y
147# CONFIG_FPE_FASTFPE is not set
148
149#
150# Userspace binary formats
151#
152CONFIG_BINFMT_ELF=y
153# CONFIG_BINFMT_AOUT is not set
154# CONFIG_BINFMT_MISC is not set
155# CONFIG_ARTHUR is not set
156
157#
158# Power management options
159#
160# CONFIG_PM is not set
161
162#
163# Device Drivers
164#
165
166#
167# Generic Driver Options
168#
169CONFIG_STANDALONE=y
170# CONFIG_PREVENT_FIRMWARE_BUILD is not set
171# CONFIG_FW_LOADER is not set
172# CONFIG_DEBUG_DRIVER is not set
173
174#
175# Memory Technology Devices (MTD)
176#
177CONFIG_MTD=y
178# CONFIG_MTD_DEBUG is not set
179# CONFIG_MTD_CONCAT is not set
180CONFIG_MTD_PARTITIONS=y
181CONFIG_MTD_REDBOOT_PARTS=y
182CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
183CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
184CONFIG_MTD_REDBOOT_PARTS_READONLY=y
185# CONFIG_MTD_CMDLINE_PARTS is not set
186# CONFIG_MTD_AFS_PARTS is not set
187
188#
189# User Modules And Translation Layers
190#
191CONFIG_MTD_CHAR=y
192CONFIG_MTD_BLOCK=y
193# CONFIG_FTL is not set
194# CONFIG_NFTL is not set
195# CONFIG_INFTL is not set
196
197#
198# RAM/ROM/Flash chip drivers
199#
200CONFIG_MTD_CFI=y
201# CONFIG_MTD_JEDECPROBE is not set
202CONFIG_MTD_GEN_PROBE=y
203# CONFIG_MTD_CFI_ADV_OPTIONS is not set
204CONFIG_MTD_MAP_BANK_WIDTH_1=y
205CONFIG_MTD_MAP_BANK_WIDTH_2=y
206CONFIG_MTD_MAP_BANK_WIDTH_4=y
207# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
208# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
209# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
210CONFIG_MTD_CFI_I1=y
211CONFIG_MTD_CFI_I2=y
212# CONFIG_MTD_CFI_I4 is not set
213# CONFIG_MTD_CFI_I8 is not set
214CONFIG_MTD_CFI_INTELEXT=y
215# CONFIG_MTD_CFI_AMDSTD is not set
216# CONFIG_MTD_CFI_STAA is not set
217CONFIG_MTD_CFI_UTIL=y
218# CONFIG_MTD_RAM is not set
219# CONFIG_MTD_ROM is not set
220# CONFIG_MTD_ABSENT is not set
221# CONFIG_MTD_XIP is not set
222
223#
224# Mapping drivers for chip access
225#
226CONFIG_MTD_COMPLEX_MAPPINGS=y
227# CONFIG_MTD_PHYSMAP is not set
228# CONFIG_MTD_ARM_INTEGRATOR is not set
229CONFIG_MTD_IXP2000=y
230# CONFIG_MTD_EDB7312 is not set
231# CONFIG_MTD_PCI is not set
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=8192
280CONFIG_BLK_DEV_INITRD=y
281CONFIG_INITRAMFS_SOURCE=""
282# CONFIG_CDROM_PKTCDVD is not set
283
284#
285# IO Schedulers
286#
287CONFIG_IOSCHED_NOOP=y
288CONFIG_IOSCHED_AS=y
289CONFIG_IOSCHED_DEADLINE=y
290CONFIG_IOSCHED_CFQ=y
291# CONFIG_ATA_OVER_ETH is not set
292
293#
294# SCSI device support
295#
296# CONFIG_SCSI is not set
297
298#
299# Multi-device support (RAID and LVM)
300#
301# CONFIG_MD is not set
302
303#
304# Fusion MPT device support
305#
306
307#
308# IEEE 1394 (FireWire) support
309#
310# CONFIG_IEEE1394 is not set
311
312#
313# I2O device support
314#
315# CONFIG_I2O is not set
316
317#
318# Networking support
319#
320CONFIG_NET=y
321
322#
323# Networking options
324#
325CONFIG_PACKET=y
326CONFIG_PACKET_MMAP=y
327# CONFIG_NETLINK_DEV is not set
328CONFIG_UNIX=y
329# CONFIG_NET_KEY is not set
330CONFIG_INET=y
331# CONFIG_IP_MULTICAST is not set
332# CONFIG_IP_ADVANCED_ROUTER is not set
333CONFIG_IP_PNP=y
334CONFIG_IP_PNP_DHCP=y
335CONFIG_IP_PNP_BOOTP=y
336# CONFIG_IP_PNP_RARP is not set
337# CONFIG_NET_IPIP is not set
338# CONFIG_NET_IPGRE is not set
339# CONFIG_ARPD is not set
340CONFIG_SYN_COOKIES=y
341# CONFIG_INET_AH is not set
342# CONFIG_INET_ESP is not set
343# CONFIG_INET_IPCOMP is not set
344# CONFIG_INET_TUNNEL is not set
345# CONFIG_IP_TCPDIAG is not set
346# CONFIG_IP_TCPDIAG_IPV6 is not set
347# CONFIG_IPV6 is not set
348# CONFIG_NETFILTER is not set
349
350#
351# SCTP Configuration (EXPERIMENTAL)
352#
353# CONFIG_IP_SCTP is not set
354# CONFIG_ATM is not set
355# CONFIG_BRIDGE is not set
356# CONFIG_VLAN_8021Q is not set
357# CONFIG_DECNET is not set
358# CONFIG_LLC2 is not set
359# CONFIG_IPX is not set
360# CONFIG_ATALK is not set
361# CONFIG_X25 is not set
362# CONFIG_LAPB is not set
363# CONFIG_NET_DIVERT is not set
364# CONFIG_ECONET is not set
365# CONFIG_WAN_ROUTER is not set
366
367#
368# QoS and/or fair queueing
369#
370# CONFIG_NET_SCHED is not set
371# CONFIG_NET_CLS_ROUTE is not set
372
373#
374# Network testing
375#
376# CONFIG_NET_PKTGEN is not set
377# CONFIG_NETPOLL is not set
378# CONFIG_NET_POLL_CONTROLLER is not set
379# CONFIG_HAMRADIO is not set
380# CONFIG_IRDA is not set
381# CONFIG_BT is not set
382CONFIG_NETDEVICES=y
383CONFIG_DUMMY=y
384# CONFIG_BONDING is not set
385# CONFIG_EQUALIZER is not set
386# CONFIG_TUN is not set
387
388#
389# ARCnet devices
390#
391# CONFIG_ARCNET is not set
392
393#
394# Ethernet (10 or 100Mbit)
395#
396CONFIG_NET_ETHERNET=y
397CONFIG_MII=y
398# CONFIG_HAPPYMEAL is not set
399# CONFIG_SUNGEM is not set
400# CONFIG_NET_VENDOR_3COM is not set
401# CONFIG_SMC91X is not set
402
403#
404# Tulip family network device support
405#
406# CONFIG_NET_TULIP is not set
407# CONFIG_HP100 is not set
408CONFIG_NET_PCI=y
409# CONFIG_PCNET32 is not set
410# CONFIG_AMD8111_ETH is not set
411# CONFIG_ADAPTEC_STARFIRE is not set
412# CONFIG_B44 is not set
413# CONFIG_FORCEDETH is not set
414# CONFIG_DGRS is not set
415CONFIG_EEPRO100=y
416# CONFIG_E100 is not set
417# CONFIG_FEALNX is not set
418# CONFIG_NATSEMI is not set
419# CONFIG_NE2K_PCI is not set
420# CONFIG_8139CP is not set
421# CONFIG_8139TOO is not set
422# CONFIG_SIS900 is not set
423# CONFIG_EPIC100 is not set
424# CONFIG_SUNDANCE is not set
425# CONFIG_TLAN is not set
426# CONFIG_VIA_RHINE is not set
427
428#
429# Ethernet (1000 Mbit)
430#
431# CONFIG_ACENIC is not set
432# CONFIG_DL2K is not set
433# CONFIG_E1000 is not set
434# CONFIG_NS83820 is not set
435# CONFIG_HAMACHI is not set
436# CONFIG_YELLOWFIN is not set
437# CONFIG_R8169 is not set
438# CONFIG_SK98LIN is not set
439# CONFIG_VIA_VELOCITY is not set
440# CONFIG_TIGON3 is not set
441
442#
443# Ethernet (10000 Mbit)
444#
445# CONFIG_IXGB is not set
446# CONFIG_S2IO is not set
447
448#
449# Token Ring devices
450#
451# CONFIG_TR is not set
452
453#
454# Wireless LAN (non-hamradio)
455#
456# CONFIG_NET_RADIO is not set
457
458#
459# Wan interfaces
460#
461CONFIG_WAN=y
462# CONFIG_LANMEDIA is not set
463# CONFIG_SYNCLINK_SYNCPPP is not set
464CONFIG_HDLC=y
465CONFIG_HDLC_RAW=y
466# CONFIG_HDLC_RAW_ETH is not set
467CONFIG_HDLC_CISCO=y
468CONFIG_HDLC_FR=y
469CONFIG_HDLC_PPP=y
470
471#
472# X.25/LAPB support is disabled
473#
474# CONFIG_PCI200SYN is not set
475# CONFIG_WANXL is not set
476# CONFIG_PC300 is not set
477# CONFIG_FARSYNC is not set
478CONFIG_DLCI=y
479CONFIG_DLCI_COUNT=24
480CONFIG_DLCI_MAX=8
481# CONFIG_FDDI is not set
482# CONFIG_HIPPI is not set
483# CONFIG_PPP is not set
484# CONFIG_SLIP is not set
485# CONFIG_SHAPER is not set
486# CONFIG_NETCONSOLE is not set
487
488#
489# ISDN subsystem
490#
491# CONFIG_ISDN is not set
492
493#
494# Input device support
495#
496CONFIG_INPUT=y
497
498#
499# Userland interfaces
500#
501CONFIG_INPUT_MOUSEDEV=y
502CONFIG_INPUT_MOUSEDEV_PSAUX=y
503CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
504CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
505# CONFIG_INPUT_JOYDEV is not set
506# CONFIG_INPUT_TSDEV is not set
507# CONFIG_INPUT_EVDEV is not set
508# CONFIG_INPUT_EVBUG is not set
509
510#
511# Input Device Drivers
512#
513# CONFIG_INPUT_KEYBOARD is not set
514# CONFIG_INPUT_MOUSE is not set
515# CONFIG_INPUT_JOYSTICK is not set
516# CONFIG_INPUT_TOUCHSCREEN is not set
517# CONFIG_INPUT_MISC is not set
518
519#
520# Hardware I/O ports
521#
522# CONFIG_SERIO is not set
523# CONFIG_GAMEPORT is not set
524CONFIG_SOUND_GAMEPORT=y
525
526#
527# Character devices
528#
529# CONFIG_VT is not set
530# CONFIG_SERIAL_NONSTANDARD is not set
531
532#
533# Serial drivers
534#
535CONFIG_SERIAL_8250=y
536CONFIG_SERIAL_8250_CONSOLE=y
537CONFIG_SERIAL_8250_NR_UARTS=2
538# CONFIG_SERIAL_8250_EXTENDED is not set
539
540#
541# Non-8250 serial port support
542#
543CONFIG_SERIAL_CORE=y
544CONFIG_SERIAL_CORE_CONSOLE=y
545CONFIG_UNIX98_PTYS=y
546CONFIG_LEGACY_PTYS=y
547CONFIG_LEGACY_PTY_COUNT=256
548
549#
550# IPMI
551#
552# CONFIG_IPMI_HANDLER is not set
553
554#
555# Watchdog Cards
556#
557CONFIG_WATCHDOG=y
558# CONFIG_WATCHDOG_NOWAYOUT is not set
559
560#
561# Watchdog Device Drivers
562#
563# CONFIG_SOFT_WATCHDOG is not set
564CONFIG_IXP2000_WATCHDOG=y
565
566#
567# PCI-based Watchdog Cards
568#
569# CONFIG_PCIPCWATCHDOG is not set
570# CONFIG_WDTPCI is not set
571# CONFIG_NVRAM is not set
572# CONFIG_RTC is not set
573# CONFIG_DTLK is not set
574# CONFIG_R3964 is not set
575# CONFIG_APPLICOM is not set
576
577#
578# Ftape, the floppy tape device driver
579#
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#
591CONFIG_I2C=y
592CONFIG_I2C_CHARDEV=y
593
594#
595# I2C Algorithms
596#
597CONFIG_I2C_ALGOBIT=y
598# CONFIG_I2C_ALGOPCF is not set
599# CONFIG_I2C_ALGOPCA is not set
600
601#
602# I2C Hardware Bus support
603#
604# CONFIG_I2C_ALI1535 is not set
605# CONFIG_I2C_ALI1563 is not set
606# CONFIG_I2C_ALI15X3 is not set
607# CONFIG_I2C_AMD756 is not set
608# CONFIG_I2C_AMD8111 is not set
609# CONFIG_I2C_I801 is not set
610# CONFIG_I2C_I810 is not set
611# CONFIG_I2C_ISA is not set
612# CONFIG_I2C_IXP2000 is not set
613# CONFIG_I2C_NFORCE2 is not set
614# CONFIG_I2C_PARPORT_LIGHT is not set
615# CONFIG_I2C_PIIX4 is not set
616# CONFIG_I2C_PROSAVAGE is not set
617# CONFIG_I2C_SAVAGE4 is not set
618# CONFIG_SCx200_ACB is not set
619# CONFIG_I2C_SIS5595 is not set
620# CONFIG_I2C_SIS630 is not set
621# CONFIG_I2C_SIS96X is not set
622# CONFIG_I2C_VIA is not set
623# CONFIG_I2C_VIAPRO is not set
624# CONFIG_I2C_VOODOO3 is not set
625# CONFIG_I2C_PCA_ISA is not set
626
627#
628# Hardware Sensors Chip support
629#
630CONFIG_I2C_SENSOR=y
631# CONFIG_SENSORS_ADM1021 is not set
632# CONFIG_SENSORS_ADM1025 is not set
633# CONFIG_SENSORS_ADM1026 is not set
634# CONFIG_SENSORS_ADM1031 is not set
635# CONFIG_SENSORS_ASB100 is not set
636# CONFIG_SENSORS_DS1621 is not set
637# CONFIG_SENSORS_FSCHER is not set
638# CONFIG_SENSORS_FSCPOS is not set
639# CONFIG_SENSORS_GL518SM is not set
640# CONFIG_SENSORS_GL520SM is not set
641# CONFIG_SENSORS_IT87 is not set
642# CONFIG_SENSORS_LM63 is not set
643# CONFIG_SENSORS_LM75 is not set
644# CONFIG_SENSORS_LM77 is not set
645# CONFIG_SENSORS_LM78 is not set
646# CONFIG_SENSORS_LM80 is not set
647# CONFIG_SENSORS_LM83 is not set
648# CONFIG_SENSORS_LM85 is not set
649# CONFIG_SENSORS_LM87 is not set
650# CONFIG_SENSORS_LM90 is not set
651# CONFIG_SENSORS_MAX1619 is not set
652# CONFIG_SENSORS_PC87360 is not set
653# CONFIG_SENSORS_SMSC47B397 is not set
654# CONFIG_SENSORS_SIS5595 is not set
655# CONFIG_SENSORS_SMSC47M1 is not set
656# CONFIG_SENSORS_VIA686A is not set
657# CONFIG_SENSORS_W83781D is not set
658# CONFIG_SENSORS_W83L785TS is not set
659# CONFIG_SENSORS_W83627HF is not set
660
661#
662# Other I2C Chip support
663#
664CONFIG_SENSORS_EEPROM=y
665# CONFIG_SENSORS_PCF8574 is not set
666# CONFIG_SENSORS_PCF8591 is not set
667# CONFIG_SENSORS_RTC8564 is not set
668# CONFIG_I2C_DEBUG_CORE is not set
669# CONFIG_I2C_DEBUG_ALGO is not set
670# CONFIG_I2C_DEBUG_BUS is not set
671# CONFIG_I2C_DEBUG_CHIP is not set
672
673#
674# Misc devices
675#
676
677#
678# Multimedia devices
679#
680# CONFIG_VIDEO_DEV is not set
681
682#
683# Digital Video Broadcasting Devices
684#
685# CONFIG_DVB is not set
686
687#
688# Graphics support
689#
690# CONFIG_FB is not set
691
692#
693# Sound
694#
695# CONFIG_SOUND is not set
696
697#
698# USB support
699#
700CONFIG_USB_ARCH_HAS_HCD=y
701CONFIG_USB_ARCH_HAS_OHCI=y
702# CONFIG_USB is not set
703
704#
705# USB Gadget Support
706#
707# CONFIG_USB_GADGET is not set
708
709#
710# MMC/SD Card support
711#
712# CONFIG_MMC is not set
713
714#
715# File systems
716#
717CONFIG_EXT2_FS=y
718CONFIG_EXT2_FS_XATTR=y
719CONFIG_EXT2_FS_POSIX_ACL=y
720# CONFIG_EXT2_FS_SECURITY is not set
721CONFIG_EXT3_FS=y
722CONFIG_EXT3_FS_XATTR=y
723CONFIG_EXT3_FS_POSIX_ACL=y
724# CONFIG_EXT3_FS_SECURITY is not set
725CONFIG_JBD=y
726# CONFIG_JBD_DEBUG is not set
727CONFIG_FS_MBCACHE=y
728# CONFIG_REISERFS_FS is not set
729# CONFIG_JFS_FS is not set
730CONFIG_FS_POSIX_ACL=y
731
732#
733# XFS support
734#
735# CONFIG_XFS_FS is not set
736# CONFIG_MINIX_FS is not set
737# CONFIG_ROMFS_FS is not set
738# CONFIG_QUOTA is not set
739CONFIG_DNOTIFY=y
740# CONFIG_AUTOFS_FS is not set
741# CONFIG_AUTOFS4_FS is not set
742
743#
744# CD-ROM/DVD Filesystems
745#
746# CONFIG_ISO9660_FS is not set
747# CONFIG_UDF_FS is not set
748
749#
750# DOS/FAT/NT Filesystems
751#
752# CONFIG_MSDOS_FS is not set
753# CONFIG_VFAT_FS is not set
754# CONFIG_NTFS_FS is not set
755
756#
757# Pseudo filesystems
758#
759CONFIG_PROC_FS=y
760CONFIG_SYSFS=y
761# CONFIG_DEVFS_FS is not set
762# CONFIG_DEVPTS_FS_XATTR is not set
763CONFIG_TMPFS=y
764# CONFIG_TMPFS_XATTR is not set
765# CONFIG_HUGETLB_PAGE is not set
766CONFIG_RAMFS=y
767
768#
769# Miscellaneous filesystems
770#
771# CONFIG_ADFS_FS is not set
772# CONFIG_AFFS_FS is not set
773# CONFIG_HFS_FS is not set
774# CONFIG_HFSPLUS_FS is not set
775# CONFIG_BEFS_FS is not set
776# CONFIG_BFS_FS is not set
777# CONFIG_EFS_FS is not set
778# CONFIG_JFFS_FS is not set
779CONFIG_JFFS2_FS=y
780CONFIG_JFFS2_FS_DEBUG=0
781# CONFIG_JFFS2_FS_NAND is not set
782# CONFIG_JFFS2_FS_NOR_ECC is not set
783# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
784CONFIG_JFFS2_ZLIB=y
785CONFIG_JFFS2_RTIME=y
786# CONFIG_JFFS2_RUBIN is not set
787# CONFIG_CRAMFS is not set
788# CONFIG_VXFS_FS is not set
789# CONFIG_HPFS_FS is not set
790# CONFIG_QNX4FS_FS is not set
791# CONFIG_SYSV_FS is not set
792# CONFIG_UFS_FS is not set
793
794#
795# Network File Systems
796#
797CONFIG_NFS_FS=y
798CONFIG_NFS_V3=y
799# CONFIG_NFS_V4 is not set
800# CONFIG_NFS_DIRECTIO is not set
801# CONFIG_NFSD is not set
802CONFIG_ROOT_NFS=y
803CONFIG_LOCKD=y
804CONFIG_LOCKD_V4=y
805CONFIG_SUNRPC=y
806# CONFIG_RPCSEC_GSS_KRB5 is not set
807# CONFIG_RPCSEC_GSS_SPKM3 is not set
808# CONFIG_SMB_FS is not set
809# CONFIG_CIFS is not set
810# CONFIG_NCP_FS is not set
811# CONFIG_CODA_FS is not set
812# CONFIG_AFS_FS is not set
813
814#
815# Partition Types
816#
817CONFIG_PARTITION_ADVANCED=y
818# CONFIG_ACORN_PARTITION is not set
819# CONFIG_OSF_PARTITION is not set
820# CONFIG_AMIGA_PARTITION is not set
821# CONFIG_ATARI_PARTITION is not set
822# CONFIG_MAC_PARTITION is not set
823CONFIG_MSDOS_PARTITION=y
824# CONFIG_BSD_DISKLABEL is not set
825# CONFIG_MINIX_SUBPARTITION is not set
826# CONFIG_SOLARIS_X86_PARTITION is not set
827# CONFIG_UNIXWARE_DISKLABEL is not set
828# CONFIG_LDM_PARTITION is not set
829# CONFIG_SGI_PARTITION is not set
830# CONFIG_ULTRIX_PARTITION is not set
831# CONFIG_SUN_PARTITION is not set
832# CONFIG_EFI_PARTITION is not set
833
834#
835# Native Language Support
836#
837# CONFIG_NLS is not set
838
839#
840# Profiling support
841#
842# CONFIG_PROFILING is not set
843
844#
845# Kernel hacking
846#
847# CONFIG_PRINTK_TIME is not set
848CONFIG_DEBUG_KERNEL=y
849CONFIG_MAGIC_SYSRQ=y
850CONFIG_LOG_BUF_SHIFT=14
851# CONFIG_SCHEDSTATS is not set
852# CONFIG_DEBUG_SLAB is not set
853# CONFIG_DEBUG_SPINLOCK is not set
854# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
855# CONFIG_DEBUG_KOBJECT is not set
856CONFIG_DEBUG_BUGVERBOSE=y
857# CONFIG_DEBUG_INFO is not set
858# CONFIG_DEBUG_FS is not set
859CONFIG_FRAME_POINTER=y
860CONFIG_DEBUG_USER=y
861# CONFIG_DEBUG_WAITQ is not set
862CONFIG_DEBUG_ERRORS=y
863CONFIG_DEBUG_LL=y
864# CONFIG_DEBUG_ICEDCC is not set
865
866#
867# Security options
868#
869# CONFIG_KEYS is not set
870# CONFIG_SECURITY is not set
871
872#
873# Cryptographic options
874#
875# CONFIG_CRYPTO is not set
876
877#
878# Hardware crypto devices
879#
880
881#
882# Library routines
883#
884# CONFIG_CRC_CCITT is not set
885CONFIG_CRC32=y
886# CONFIG_LIBCRC32C is not set
887CONFIG_ZLIB_INFLATE=y
888CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/ixdp2401_defconfig b/arch/arm/configs/ixdp2401_defconfig
new file mode 100644
index 000000000000..6f51c98084a3
--- /dev/null
+++ b/arch/arm/configs/ixdp2401_defconfig
@@ -0,0 +1,889 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 21:53:55 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34CONFIG_EMBEDDED=y
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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#
53# CONFIG_MODULES is not set
54
55#
56# System Type
57#
58# CONFIG_ARCH_CLPS7500 is not set
59# CONFIG_ARCH_CLPS711X is not set
60# CONFIG_ARCH_CO285 is not set
61# CONFIG_ARCH_EBSA110 is not set
62# CONFIG_ARCH_CAMELOT is not set
63# CONFIG_ARCH_FOOTBRIDGE is not set
64# CONFIG_ARCH_INTEGRATOR is not set
65# CONFIG_ARCH_IOP3XX is not set
66# CONFIG_ARCH_IXP4XX is not set
67CONFIG_ARCH_IXP2000=y
68# CONFIG_ARCH_L7200 is not set
69# CONFIG_ARCH_PXA is not set
70# CONFIG_ARCH_RPC is not set
71# CONFIG_ARCH_SA1100 is not set
72# CONFIG_ARCH_S3C2410 is not set
73# CONFIG_ARCH_SHARK is not set
74# CONFIG_ARCH_LH7A40X is not set
75# CONFIG_ARCH_OMAP is not set
76# CONFIG_ARCH_VERSATILE is not set
77# CONFIG_ARCH_IMX is not set
78# CONFIG_ARCH_H720X is not set
79CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
80
81#
82# Intel IXP2400/2800 Implementation Options
83#
84
85#
86# IXP2400/2800 Platforms
87#
88# CONFIG_ARCH_ENP2611 is not set
89# CONFIG_ARCH_IXDP2400 is not set
90# CONFIG_ARCH_IXDP2800 is not set
91CONFIG_ARCH_IXDP2401=y
92# CONFIG_ARCH_IXDP2801 is not set
93CONFIG_ARCH_IXDP2X01=y
94
95#
96# Processor Type
97#
98CONFIG_CPU_32=y
99CONFIG_CPU_XSCALE=y
100CONFIG_CPU_32v5=y
101CONFIG_CPU_ABRT_EV5T=y
102CONFIG_CPU_CACHE_VIVT=y
103CONFIG_CPU_TLB_V4WBI=y
104CONFIG_CPU_MINICACHE=y
105
106#
107# Processor Features
108#
109# CONFIG_ARM_THUMB is not set
110CONFIG_CPU_BIG_ENDIAN=y
111CONFIG_XSCALE_PMU=y
112
113#
114# Bus support
115#
116CONFIG_PCI=y
117CONFIG_PCI_LEGACY_PROC=y
118CONFIG_PCI_NAMES=y
119
120#
121# PCCARD (PCMCIA/CardBus) support
122#
123# CONFIG_PCCARD is not set
124
125#
126# Kernel Features
127#
128# CONFIG_PREEMPT is not set
129CONFIG_ALIGNMENT_TRAP=y
130
131#
132# Boot options
133#
134CONFIG_ZBOOT_ROM_TEXT=0x0
135CONFIG_ZBOOT_ROM_BSS=0x0
136CONFIG_CMDLINE="console=ttyS0,57600 root=/dev/nfs ip=bootp mem=64M@0x0 pci=firmware"
137# CONFIG_XIP_KERNEL is not set
138
139#
140# Floating point emulation
141#
142
143#
144# At least one emulation must be selected
145#
146CONFIG_FPE_NWFPE=y
147# CONFIG_FPE_FASTFPE is not set
148
149#
150# Userspace binary formats
151#
152CONFIG_BINFMT_ELF=y
153# CONFIG_BINFMT_AOUT is not set
154# CONFIG_BINFMT_MISC is not set
155# CONFIG_ARTHUR is not set
156
157#
158# Power management options
159#
160# CONFIG_PM is not set
161
162#
163# Device Drivers
164#
165
166#
167# Generic Driver Options
168#
169CONFIG_STANDALONE=y
170# CONFIG_PREVENT_FIRMWARE_BUILD is not set
171# CONFIG_FW_LOADER is not set
172# CONFIG_DEBUG_DRIVER is not set
173
174#
175# Memory Technology Devices (MTD)
176#
177CONFIG_MTD=y
178# CONFIG_MTD_DEBUG is not set
179# CONFIG_MTD_CONCAT is not set
180CONFIG_MTD_PARTITIONS=y
181CONFIG_MTD_REDBOOT_PARTS=y
182CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
183CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
184CONFIG_MTD_REDBOOT_PARTS_READONLY=y
185# CONFIG_MTD_CMDLINE_PARTS is not set
186# CONFIG_MTD_AFS_PARTS is not set
187
188#
189# User Modules And Translation Layers
190#
191CONFIG_MTD_CHAR=y
192CONFIG_MTD_BLOCK=y
193# CONFIG_FTL is not set
194# CONFIG_NFTL is not set
195# CONFIG_INFTL is not set
196
197#
198# RAM/ROM/Flash chip drivers
199#
200CONFIG_MTD_CFI=y
201# CONFIG_MTD_JEDECPROBE is not set
202CONFIG_MTD_GEN_PROBE=y
203# CONFIG_MTD_CFI_ADV_OPTIONS is not set
204CONFIG_MTD_MAP_BANK_WIDTH_1=y
205CONFIG_MTD_MAP_BANK_WIDTH_2=y
206CONFIG_MTD_MAP_BANK_WIDTH_4=y
207# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
208# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
209# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
210CONFIG_MTD_CFI_I1=y
211CONFIG_MTD_CFI_I2=y
212# CONFIG_MTD_CFI_I4 is not set
213# CONFIG_MTD_CFI_I8 is not set
214CONFIG_MTD_CFI_INTELEXT=y
215# CONFIG_MTD_CFI_AMDSTD is not set
216# CONFIG_MTD_CFI_STAA is not set
217CONFIG_MTD_CFI_UTIL=y
218# CONFIG_MTD_RAM is not set
219# CONFIG_MTD_ROM is not set
220# CONFIG_MTD_ABSENT is not set
221# CONFIG_MTD_XIP is not set
222
223#
224# Mapping drivers for chip access
225#
226CONFIG_MTD_COMPLEX_MAPPINGS=y
227# CONFIG_MTD_PHYSMAP is not set
228# CONFIG_MTD_ARM_INTEGRATOR is not set
229CONFIG_MTD_IXP2000=y
230# CONFIG_MTD_EDB7312 is not set
231# CONFIG_MTD_PCI is not set
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=8192
280CONFIG_BLK_DEV_INITRD=y
281CONFIG_INITRAMFS_SOURCE=""
282# CONFIG_CDROM_PKTCDVD is not set
283
284#
285# IO Schedulers
286#
287CONFIG_IOSCHED_NOOP=y
288CONFIG_IOSCHED_AS=y
289CONFIG_IOSCHED_DEADLINE=y
290CONFIG_IOSCHED_CFQ=y
291# CONFIG_ATA_OVER_ETH is not set
292
293#
294# SCSI device support
295#
296# CONFIG_SCSI is not set
297
298#
299# Multi-device support (RAID and LVM)
300#
301# CONFIG_MD is not set
302
303#
304# Fusion MPT device support
305#
306
307#
308# IEEE 1394 (FireWire) support
309#
310# CONFIG_IEEE1394 is not set
311
312#
313# I2O device support
314#
315# CONFIG_I2O is not set
316
317#
318# Networking support
319#
320CONFIG_NET=y
321
322#
323# Networking options
324#
325CONFIG_PACKET=y
326CONFIG_PACKET_MMAP=y
327# CONFIG_NETLINK_DEV is not set
328CONFIG_UNIX=y
329# CONFIG_NET_KEY is not set
330CONFIG_INET=y
331# CONFIG_IP_MULTICAST is not set
332# CONFIG_IP_ADVANCED_ROUTER is not set
333CONFIG_IP_PNP=y
334CONFIG_IP_PNP_DHCP=y
335CONFIG_IP_PNP_BOOTP=y
336# CONFIG_IP_PNP_RARP is not set
337# CONFIG_NET_IPIP is not set
338# CONFIG_NET_IPGRE is not set
339# CONFIG_ARPD is not set
340CONFIG_SYN_COOKIES=y
341# CONFIG_INET_AH is not set
342# CONFIG_INET_ESP is not set
343# CONFIG_INET_IPCOMP is not set
344# CONFIG_INET_TUNNEL is not set
345CONFIG_IP_TCPDIAG=y
346# CONFIG_IP_TCPDIAG_IPV6 is not set
347# CONFIG_IPV6 is not set
348# CONFIG_NETFILTER is not set
349
350#
351# SCTP Configuration (EXPERIMENTAL)
352#
353# CONFIG_IP_SCTP is not set
354# CONFIG_ATM is not set
355# CONFIG_BRIDGE is not set
356# CONFIG_VLAN_8021Q is not set
357# CONFIG_DECNET is not set
358# CONFIG_LLC2 is not set
359# CONFIG_IPX is not set
360# CONFIG_ATALK is not set
361# CONFIG_X25 is not set
362# CONFIG_LAPB is not set
363# CONFIG_NET_DIVERT is not set
364# CONFIG_ECONET is not set
365# CONFIG_WAN_ROUTER is not set
366
367#
368# QoS and/or fair queueing
369#
370# CONFIG_NET_SCHED is not set
371# CONFIG_NET_CLS_ROUTE is not set
372
373#
374# Network testing
375#
376# CONFIG_NET_PKTGEN is not set
377# CONFIG_NETPOLL is not set
378# CONFIG_NET_POLL_CONTROLLER is not set
379# CONFIG_HAMRADIO is not set
380# CONFIG_IRDA is not set
381# CONFIG_BT is not set
382CONFIG_NETDEVICES=y
383CONFIG_DUMMY=y
384# CONFIG_BONDING is not set
385# CONFIG_EQUALIZER is not set
386# CONFIG_TUN is not set
387
388#
389# ARCnet devices
390#
391# CONFIG_ARCNET is not set
392
393#
394# Ethernet (10 or 100Mbit)
395#
396CONFIG_NET_ETHERNET=y
397CONFIG_MII=y
398# CONFIG_HAPPYMEAL is not set
399# CONFIG_SUNGEM is not set
400# CONFIG_NET_VENDOR_3COM is not set
401# CONFIG_SMC91X is not set
402
403#
404# Tulip family network device support
405#
406# CONFIG_NET_TULIP is not set
407# CONFIG_HP100 is not set
408CONFIG_NET_PCI=y
409# CONFIG_PCNET32 is not set
410# CONFIG_AMD8111_ETH is not set
411# CONFIG_ADAPTEC_STARFIRE is not set
412# CONFIG_B44 is not set
413# CONFIG_FORCEDETH is not set
414CONFIG_CS89x0=y
415# CONFIG_DGRS is not set
416CONFIG_EEPRO100=y
417# CONFIG_E100 is not set
418# CONFIG_FEALNX is not set
419# CONFIG_NATSEMI is not set
420# CONFIG_NE2K_PCI is not set
421# CONFIG_8139CP is not set
422# CONFIG_8139TOO is not set
423# CONFIG_SIS900 is not set
424# CONFIG_EPIC100 is not set
425# CONFIG_SUNDANCE is not set
426# CONFIG_TLAN is not set
427# CONFIG_VIA_RHINE is not set
428
429#
430# Ethernet (1000 Mbit)
431#
432# CONFIG_ACENIC is not set
433# CONFIG_DL2K is not set
434# CONFIG_E1000 is not set
435# CONFIG_NS83820 is not set
436# CONFIG_HAMACHI is not set
437# CONFIG_YELLOWFIN is not set
438# CONFIG_R8169 is not set
439# CONFIG_SK98LIN is not set
440# CONFIG_VIA_VELOCITY is not set
441# CONFIG_TIGON3 is not set
442
443#
444# Ethernet (10000 Mbit)
445#
446# CONFIG_IXGB is not set
447# CONFIG_S2IO is not set
448
449#
450# Token Ring devices
451#
452# CONFIG_TR is not set
453
454#
455# Wireless LAN (non-hamradio)
456#
457# CONFIG_NET_RADIO is not set
458
459#
460# Wan interfaces
461#
462CONFIG_WAN=y
463# CONFIG_LANMEDIA is not set
464# CONFIG_SYNCLINK_SYNCPPP is not set
465CONFIG_HDLC=y
466CONFIG_HDLC_RAW=y
467# CONFIG_HDLC_RAW_ETH is not set
468CONFIG_HDLC_CISCO=y
469CONFIG_HDLC_FR=y
470CONFIG_HDLC_PPP=y
471
472#
473# X.25/LAPB support is disabled
474#
475# CONFIG_PCI200SYN is not set
476# CONFIG_WANXL is not set
477# CONFIG_PC300 is not set
478# CONFIG_FARSYNC is not set
479CONFIG_DLCI=y
480CONFIG_DLCI_COUNT=24
481CONFIG_DLCI_MAX=8
482# CONFIG_FDDI is not set
483# CONFIG_HIPPI is not set
484# CONFIG_PPP is not set
485# CONFIG_SLIP is not set
486# CONFIG_SHAPER is not set
487# CONFIG_NETCONSOLE is not set
488
489#
490# ISDN subsystem
491#
492# CONFIG_ISDN is not set
493
494#
495# Input device support
496#
497CONFIG_INPUT=y
498
499#
500# Userland interfaces
501#
502CONFIG_INPUT_MOUSEDEV=y
503CONFIG_INPUT_MOUSEDEV_PSAUX=y
504CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
505CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
506# CONFIG_INPUT_JOYDEV is not set
507# CONFIG_INPUT_TSDEV is not set
508# CONFIG_INPUT_EVDEV is not set
509# CONFIG_INPUT_EVBUG is not set
510
511#
512# Input Device Drivers
513#
514# CONFIG_INPUT_KEYBOARD is not set
515# CONFIG_INPUT_MOUSE is not set
516# CONFIG_INPUT_JOYSTICK is not set
517# CONFIG_INPUT_TOUCHSCREEN is not set
518# CONFIG_INPUT_MISC is not set
519
520#
521# Hardware I/O ports
522#
523# CONFIG_SERIO is not set
524# CONFIG_GAMEPORT is not set
525CONFIG_SOUND_GAMEPORT=y
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=2
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# IPMI
552#
553# CONFIG_IPMI_HANDLER is not set
554
555#
556# Watchdog Cards
557#
558CONFIG_WATCHDOG=y
559# CONFIG_WATCHDOG_NOWAYOUT is not set
560
561#
562# Watchdog Device Drivers
563#
564# CONFIG_SOFT_WATCHDOG is not set
565CONFIG_IXP2000_WATCHDOG=y
566
567#
568# PCI-based Watchdog Cards
569#
570# CONFIG_PCIPCWATCHDOG is not set
571# CONFIG_WDTPCI is not set
572# CONFIG_NVRAM is not set
573# CONFIG_RTC is not set
574# CONFIG_DTLK is not set
575# CONFIG_R3964 is not set
576# CONFIG_APPLICOM is not set
577
578#
579# Ftape, the floppy tape device driver
580#
581# CONFIG_DRM is not set
582# CONFIG_RAW_DRIVER is not set
583
584#
585# TPM devices
586#
587# CONFIG_TCG_TPM is not set
588
589#
590# I2C support
591#
592CONFIG_I2C=y
593CONFIG_I2C_CHARDEV=y
594
595#
596# I2C Algorithms
597#
598CONFIG_I2C_ALGOBIT=y
599# CONFIG_I2C_ALGOPCF is not set
600# CONFIG_I2C_ALGOPCA is not set
601
602#
603# I2C Hardware Bus support
604#
605# CONFIG_I2C_ALI1535 is not set
606# CONFIG_I2C_ALI1563 is not set
607# CONFIG_I2C_ALI15X3 is not set
608# CONFIG_I2C_AMD756 is not set
609# CONFIG_I2C_AMD8111 is not set
610# CONFIG_I2C_I801 is not set
611# CONFIG_I2C_I810 is not set
612# CONFIG_I2C_ISA is not set
613# CONFIG_I2C_IXP2000 is not set
614# CONFIG_I2C_NFORCE2 is not set
615# CONFIG_I2C_PARPORT_LIGHT is not set
616# CONFIG_I2C_PIIX4 is not set
617# CONFIG_I2C_PROSAVAGE is not set
618# CONFIG_I2C_SAVAGE4 is not set
619# CONFIG_SCx200_ACB is not set
620# CONFIG_I2C_SIS5595 is not set
621# CONFIG_I2C_SIS630 is not set
622# CONFIG_I2C_SIS96X is not set
623# CONFIG_I2C_VIA is not set
624# CONFIG_I2C_VIAPRO is not set
625# CONFIG_I2C_VOODOO3 is not set
626# CONFIG_I2C_PCA_ISA is not set
627
628#
629# Hardware Sensors Chip support
630#
631CONFIG_I2C_SENSOR=y
632# CONFIG_SENSORS_ADM1021 is not set
633# CONFIG_SENSORS_ADM1025 is not set
634# CONFIG_SENSORS_ADM1026 is not set
635# CONFIG_SENSORS_ADM1031 is not set
636# CONFIG_SENSORS_ASB100 is not set
637# CONFIG_SENSORS_DS1621 is not set
638# CONFIG_SENSORS_FSCHER is not set
639# CONFIG_SENSORS_FSCPOS is not set
640# CONFIG_SENSORS_GL518SM is not set
641# CONFIG_SENSORS_GL520SM is not set
642# CONFIG_SENSORS_IT87 is not set
643# CONFIG_SENSORS_LM63 is not set
644# CONFIG_SENSORS_LM75 is not set
645# CONFIG_SENSORS_LM77 is not set
646# CONFIG_SENSORS_LM78 is not set
647# CONFIG_SENSORS_LM80 is not set
648# CONFIG_SENSORS_LM83 is not set
649# CONFIG_SENSORS_LM85 is not set
650# CONFIG_SENSORS_LM87 is not set
651# CONFIG_SENSORS_LM90 is not set
652# CONFIG_SENSORS_MAX1619 is not set
653# CONFIG_SENSORS_PC87360 is not set
654# CONFIG_SENSORS_SMSC47B397 is not set
655# CONFIG_SENSORS_SIS5595 is not set
656# CONFIG_SENSORS_SMSC47M1 is not set
657# CONFIG_SENSORS_VIA686A is not set
658# CONFIG_SENSORS_W83781D is not set
659# CONFIG_SENSORS_W83L785TS is not set
660# CONFIG_SENSORS_W83627HF is not set
661
662#
663# Other I2C Chip support
664#
665CONFIG_SENSORS_EEPROM=y
666# CONFIG_SENSORS_PCF8574 is not set
667# CONFIG_SENSORS_PCF8591 is not set
668# CONFIG_SENSORS_RTC8564 is not set
669# CONFIG_I2C_DEBUG_CORE is not set
670# CONFIG_I2C_DEBUG_ALGO is not set
671# CONFIG_I2C_DEBUG_BUS is not set
672# CONFIG_I2C_DEBUG_CHIP is not set
673
674#
675# Misc devices
676#
677
678#
679# Multimedia devices
680#
681# CONFIG_VIDEO_DEV is not set
682
683#
684# Digital Video Broadcasting Devices
685#
686# CONFIG_DVB is not set
687
688#
689# Graphics support
690#
691# CONFIG_FB is not set
692
693#
694# Sound
695#
696# CONFIG_SOUND is not set
697
698#
699# USB support
700#
701CONFIG_USB_ARCH_HAS_HCD=y
702CONFIG_USB_ARCH_HAS_OHCI=y
703# CONFIG_USB is not set
704
705#
706# USB Gadget Support
707#
708# CONFIG_USB_GADGET is not set
709
710#
711# MMC/SD Card support
712#
713# CONFIG_MMC is not set
714
715#
716# File systems
717#
718CONFIG_EXT2_FS=y
719CONFIG_EXT2_FS_XATTR=y
720CONFIG_EXT2_FS_POSIX_ACL=y
721# CONFIG_EXT2_FS_SECURITY is not set
722CONFIG_EXT3_FS=y
723CONFIG_EXT3_FS_XATTR=y
724CONFIG_EXT3_FS_POSIX_ACL=y
725# CONFIG_EXT3_FS_SECURITY is not set
726CONFIG_JBD=y
727# CONFIG_JBD_DEBUG is not set
728CONFIG_FS_MBCACHE=y
729# CONFIG_REISERFS_FS is not set
730# CONFIG_JFS_FS is not set
731CONFIG_FS_POSIX_ACL=y
732
733#
734# XFS support
735#
736# CONFIG_XFS_FS is not set
737# CONFIG_MINIX_FS is not set
738# CONFIG_ROMFS_FS is not set
739# CONFIG_QUOTA is not set
740CONFIG_DNOTIFY=y
741# CONFIG_AUTOFS_FS is not set
742# CONFIG_AUTOFS4_FS is not set
743
744#
745# CD-ROM/DVD Filesystems
746#
747# CONFIG_ISO9660_FS is not set
748# CONFIG_UDF_FS is not set
749
750#
751# DOS/FAT/NT Filesystems
752#
753# CONFIG_MSDOS_FS is not set
754# CONFIG_VFAT_FS is not set
755# CONFIG_NTFS_FS is not set
756
757#
758# Pseudo filesystems
759#
760CONFIG_PROC_FS=y
761CONFIG_SYSFS=y
762# CONFIG_DEVFS_FS is not set
763# CONFIG_DEVPTS_FS_XATTR is not set
764CONFIG_TMPFS=y
765# CONFIG_TMPFS_XATTR is not set
766# CONFIG_HUGETLB_PAGE is not set
767CONFIG_RAMFS=y
768
769#
770# Miscellaneous filesystems
771#
772# CONFIG_ADFS_FS is not set
773# CONFIG_AFFS_FS is not set
774# CONFIG_HFS_FS is not set
775# CONFIG_HFSPLUS_FS is not set
776# CONFIG_BEFS_FS is not set
777# CONFIG_BFS_FS is not set
778# CONFIG_EFS_FS is not set
779# CONFIG_JFFS_FS is not set
780CONFIG_JFFS2_FS=y
781CONFIG_JFFS2_FS_DEBUG=0
782# CONFIG_JFFS2_FS_NAND is not set
783# CONFIG_JFFS2_FS_NOR_ECC is not set
784# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
785CONFIG_JFFS2_ZLIB=y
786CONFIG_JFFS2_RTIME=y
787# CONFIG_JFFS2_RUBIN is not set
788# CONFIG_CRAMFS is not set
789# CONFIG_VXFS_FS is not set
790# CONFIG_HPFS_FS is not set
791# CONFIG_QNX4FS_FS is not set
792# CONFIG_SYSV_FS is not set
793# CONFIG_UFS_FS is not set
794
795#
796# Network File Systems
797#
798CONFIG_NFS_FS=y
799CONFIG_NFS_V3=y
800# CONFIG_NFS_V4 is not set
801# CONFIG_NFS_DIRECTIO is not set
802# CONFIG_NFSD is not set
803CONFIG_ROOT_NFS=y
804CONFIG_LOCKD=y
805CONFIG_LOCKD_V4=y
806CONFIG_SUNRPC=y
807# CONFIG_RPCSEC_GSS_KRB5 is not set
808# CONFIG_RPCSEC_GSS_SPKM3 is not set
809# CONFIG_SMB_FS is not set
810# CONFIG_CIFS is not set
811# CONFIG_NCP_FS is not set
812# CONFIG_CODA_FS is not set
813# CONFIG_AFS_FS is not set
814
815#
816# Partition Types
817#
818CONFIG_PARTITION_ADVANCED=y
819# CONFIG_ACORN_PARTITION is not set
820# CONFIG_OSF_PARTITION is not set
821# CONFIG_AMIGA_PARTITION is not set
822# CONFIG_ATARI_PARTITION is not set
823# CONFIG_MAC_PARTITION is not set
824CONFIG_MSDOS_PARTITION=y
825# CONFIG_BSD_DISKLABEL is not set
826# CONFIG_MINIX_SUBPARTITION is not set
827# CONFIG_SOLARIS_X86_PARTITION is not set
828# CONFIG_UNIXWARE_DISKLABEL is not set
829# CONFIG_LDM_PARTITION is not set
830# CONFIG_SGI_PARTITION is not set
831# CONFIG_ULTRIX_PARTITION is not set
832# CONFIG_SUN_PARTITION is not set
833# CONFIG_EFI_PARTITION is not set
834
835#
836# Native Language Support
837#
838# CONFIG_NLS is not set
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
849CONFIG_DEBUG_KERNEL=y
850CONFIG_MAGIC_SYSRQ=y
851CONFIG_LOG_BUF_SHIFT=14
852# CONFIG_SCHEDSTATS is not set
853# CONFIG_DEBUG_SLAB is not set
854# CONFIG_DEBUG_SPINLOCK is not set
855# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
856# CONFIG_DEBUG_KOBJECT is not set
857CONFIG_DEBUG_BUGVERBOSE=y
858# CONFIG_DEBUG_INFO is not set
859# CONFIG_DEBUG_FS is not set
860CONFIG_FRAME_POINTER=y
861CONFIG_DEBUG_USER=y
862# CONFIG_DEBUG_WAITQ is not set
863CONFIG_DEBUG_ERRORS=y
864CONFIG_DEBUG_LL=y
865# CONFIG_DEBUG_ICEDCC is not set
866
867#
868# Security options
869#
870# CONFIG_KEYS is not set
871# CONFIG_SECURITY is not set
872
873#
874# Cryptographic options
875#
876# CONFIG_CRYPTO is not set
877
878#
879# Hardware crypto devices
880#
881
882#
883# Library routines
884#
885# CONFIG_CRC_CCITT is not set
886CONFIG_CRC32=y
887# CONFIG_LIBCRC32C is not set
888CONFIG_ZLIB_INFLATE=y
889CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/ixdp2800_defconfig b/arch/arm/configs/ixdp2800_defconfig
new file mode 100644
index 000000000000..d36f99192962
--- /dev/null
+++ b/arch/arm/configs/ixdp2800_defconfig
@@ -0,0 +1,888 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 22:15:23 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34CONFIG_EMBEDDED=y
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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#
53# CONFIG_MODULES is not set
54
55#
56# System Type
57#
58# CONFIG_ARCH_CLPS7500 is not set
59# CONFIG_ARCH_CLPS711X is not set
60# CONFIG_ARCH_CO285 is not set
61# CONFIG_ARCH_EBSA110 is not set
62# CONFIG_ARCH_CAMELOT is not set
63# CONFIG_ARCH_FOOTBRIDGE is not set
64# CONFIG_ARCH_INTEGRATOR is not set
65# CONFIG_ARCH_IOP3XX is not set
66# CONFIG_ARCH_IXP4XX is not set
67CONFIG_ARCH_IXP2000=y
68# CONFIG_ARCH_L7200 is not set
69# CONFIG_ARCH_PXA is not set
70# CONFIG_ARCH_RPC is not set
71# CONFIG_ARCH_SA1100 is not set
72# CONFIG_ARCH_S3C2410 is not set
73# CONFIG_ARCH_SHARK is not set
74# CONFIG_ARCH_LH7A40X is not set
75# CONFIG_ARCH_OMAP is not set
76# CONFIG_ARCH_VERSATILE is not set
77# CONFIG_ARCH_IMX is not set
78# CONFIG_ARCH_H720X is not set
79CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
80
81#
82# Intel IXP2400/2800 Implementation Options
83#
84
85#
86# IXP2400/2800 Platforms
87#
88# CONFIG_ARCH_ENP2611 is not set
89# CONFIG_ARCH_IXDP2400 is not set
90CONFIG_ARCH_IXDP2800=y
91CONFIG_ARCH_IXDP2X00=y
92# CONFIG_ARCH_IXDP2401 is not set
93# CONFIG_ARCH_IXDP2801 is not set
94
95#
96# Processor Type
97#
98CONFIG_CPU_32=y
99CONFIG_CPU_XSCALE=y
100CONFIG_CPU_32v5=y
101CONFIG_CPU_ABRT_EV5T=y
102CONFIG_CPU_CACHE_VIVT=y
103CONFIG_CPU_TLB_V4WBI=y
104CONFIG_CPU_MINICACHE=y
105
106#
107# Processor Features
108#
109# CONFIG_ARM_THUMB is not set
110CONFIG_CPU_BIG_ENDIAN=y
111CONFIG_XSCALE_PMU=y
112
113#
114# Bus support
115#
116CONFIG_PCI=y
117CONFIG_PCI_LEGACY_PROC=y
118CONFIG_PCI_NAMES=y
119
120#
121# PCCARD (PCMCIA/CardBus) support
122#
123# CONFIG_PCCARD is not set
124
125#
126# Kernel Features
127#
128# CONFIG_PREEMPT is not set
129CONFIG_ALIGNMENT_TRAP=y
130
131#
132# Boot options
133#
134CONFIG_ZBOOT_ROM_TEXT=0x0
135CONFIG_ZBOOT_ROM_BSS=0x0
136CONFIG_CMDLINE="console=ttyS0,9600 root=/dev/nfs ip=bootp mem=64M@0x0 pci=firmware"
137# CONFIG_XIP_KERNEL is not set
138
139#
140# Floating point emulation
141#
142
143#
144# At least one emulation must be selected
145#
146CONFIG_FPE_NWFPE=y
147# CONFIG_FPE_FASTFPE is not set
148
149#
150# Userspace binary formats
151#
152CONFIG_BINFMT_ELF=y
153# CONFIG_BINFMT_AOUT is not set
154# CONFIG_BINFMT_MISC is not set
155# CONFIG_ARTHUR is not set
156
157#
158# Power management options
159#
160# CONFIG_PM is not set
161
162#
163# Device Drivers
164#
165
166#
167# Generic Driver Options
168#
169CONFIG_STANDALONE=y
170# CONFIG_PREVENT_FIRMWARE_BUILD is not set
171# CONFIG_FW_LOADER is not set
172# CONFIG_DEBUG_DRIVER is not set
173
174#
175# Memory Technology Devices (MTD)
176#
177CONFIG_MTD=y
178# CONFIG_MTD_DEBUG is not set
179# CONFIG_MTD_CONCAT is not set
180CONFIG_MTD_PARTITIONS=y
181CONFIG_MTD_REDBOOT_PARTS=y
182CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
183CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
184CONFIG_MTD_REDBOOT_PARTS_READONLY=y
185# CONFIG_MTD_CMDLINE_PARTS is not set
186# CONFIG_MTD_AFS_PARTS is not set
187
188#
189# User Modules And Translation Layers
190#
191CONFIG_MTD_CHAR=y
192CONFIG_MTD_BLOCK=y
193# CONFIG_FTL is not set
194# CONFIG_NFTL is not set
195# CONFIG_INFTL is not set
196
197#
198# RAM/ROM/Flash chip drivers
199#
200CONFIG_MTD_CFI=y
201# CONFIG_MTD_JEDECPROBE is not set
202CONFIG_MTD_GEN_PROBE=y
203# CONFIG_MTD_CFI_ADV_OPTIONS is not set
204CONFIG_MTD_MAP_BANK_WIDTH_1=y
205CONFIG_MTD_MAP_BANK_WIDTH_2=y
206CONFIG_MTD_MAP_BANK_WIDTH_4=y
207# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
208# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
209# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
210CONFIG_MTD_CFI_I1=y
211CONFIG_MTD_CFI_I2=y
212# CONFIG_MTD_CFI_I4 is not set
213# CONFIG_MTD_CFI_I8 is not set
214CONFIG_MTD_CFI_INTELEXT=y
215# CONFIG_MTD_CFI_AMDSTD is not set
216# CONFIG_MTD_CFI_STAA is not set
217CONFIG_MTD_CFI_UTIL=y
218# CONFIG_MTD_RAM is not set
219# CONFIG_MTD_ROM is not set
220# CONFIG_MTD_ABSENT is not set
221# CONFIG_MTD_XIP is not set
222
223#
224# Mapping drivers for chip access
225#
226CONFIG_MTD_COMPLEX_MAPPINGS=y
227# CONFIG_MTD_PHYSMAP is not set
228# CONFIG_MTD_ARM_INTEGRATOR is not set
229CONFIG_MTD_IXP2000=y
230# CONFIG_MTD_EDB7312 is not set
231# CONFIG_MTD_PCI is not set
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=8192
280CONFIG_BLK_DEV_INITRD=y
281CONFIG_INITRAMFS_SOURCE=""
282# CONFIG_CDROM_PKTCDVD is not set
283
284#
285# IO Schedulers
286#
287CONFIG_IOSCHED_NOOP=y
288CONFIG_IOSCHED_AS=y
289CONFIG_IOSCHED_DEADLINE=y
290CONFIG_IOSCHED_CFQ=y
291# CONFIG_ATA_OVER_ETH is not set
292
293#
294# SCSI device support
295#
296# CONFIG_SCSI is not set
297
298#
299# Multi-device support (RAID and LVM)
300#
301# CONFIG_MD is not set
302
303#
304# Fusion MPT device support
305#
306
307#
308# IEEE 1394 (FireWire) support
309#
310# CONFIG_IEEE1394 is not set
311
312#
313# I2O device support
314#
315# CONFIG_I2O is not set
316
317#
318# Networking support
319#
320CONFIG_NET=y
321
322#
323# Networking options
324#
325CONFIG_PACKET=y
326CONFIG_PACKET_MMAP=y
327# CONFIG_NETLINK_DEV is not set
328CONFIG_UNIX=y
329# CONFIG_NET_KEY is not set
330CONFIG_INET=y
331# CONFIG_IP_MULTICAST is not set
332# CONFIG_IP_ADVANCED_ROUTER is not set
333CONFIG_IP_PNP=y
334CONFIG_IP_PNP_DHCP=y
335CONFIG_IP_PNP_BOOTP=y
336# CONFIG_IP_PNP_RARP is not set
337# CONFIG_NET_IPIP is not set
338# CONFIG_NET_IPGRE is not set
339# CONFIG_ARPD is not set
340CONFIG_SYN_COOKIES=y
341# CONFIG_INET_AH is not set
342# CONFIG_INET_ESP is not set
343# CONFIG_INET_IPCOMP is not set
344# CONFIG_INET_TUNNEL is not set
345# CONFIG_IP_TCPDIAG is not set
346# CONFIG_IP_TCPDIAG_IPV6 is not set
347# CONFIG_IPV6 is not set
348# CONFIG_NETFILTER is not set
349
350#
351# SCTP Configuration (EXPERIMENTAL)
352#
353# CONFIG_IP_SCTP is not set
354# CONFIG_ATM is not set
355# CONFIG_BRIDGE is not set
356# CONFIG_VLAN_8021Q is not set
357# CONFIG_DECNET is not set
358# CONFIG_LLC2 is not set
359# CONFIG_IPX is not set
360# CONFIG_ATALK is not set
361# CONFIG_X25 is not set
362# CONFIG_LAPB is not set
363# CONFIG_NET_DIVERT is not set
364# CONFIG_ECONET is not set
365# CONFIG_WAN_ROUTER is not set
366
367#
368# QoS and/or fair queueing
369#
370# CONFIG_NET_SCHED is not set
371# CONFIG_NET_CLS_ROUTE is not set
372
373#
374# Network testing
375#
376# CONFIG_NET_PKTGEN is not set
377# CONFIG_NETPOLL is not set
378# CONFIG_NET_POLL_CONTROLLER is not set
379# CONFIG_HAMRADIO is not set
380# CONFIG_IRDA is not set
381# CONFIG_BT is not set
382CONFIG_NETDEVICES=y
383CONFIG_DUMMY=y
384# CONFIG_BONDING is not set
385# CONFIG_EQUALIZER is not set
386# CONFIG_TUN is not set
387
388#
389# ARCnet devices
390#
391# CONFIG_ARCNET is not set
392
393#
394# Ethernet (10 or 100Mbit)
395#
396CONFIG_NET_ETHERNET=y
397CONFIG_MII=y
398# CONFIG_HAPPYMEAL is not set
399# CONFIG_SUNGEM is not set
400# CONFIG_NET_VENDOR_3COM is not set
401# CONFIG_SMC91X is not set
402
403#
404# Tulip family network device support
405#
406# CONFIG_NET_TULIP is not set
407# CONFIG_HP100 is not set
408CONFIG_NET_PCI=y
409# CONFIG_PCNET32 is not set
410# CONFIG_AMD8111_ETH is not set
411# CONFIG_ADAPTEC_STARFIRE is not set
412# CONFIG_B44 is not set
413# CONFIG_FORCEDETH is not set
414# CONFIG_DGRS is not set
415CONFIG_EEPRO100=y
416# CONFIG_E100 is not set
417# CONFIG_FEALNX is not set
418# CONFIG_NATSEMI is not set
419# CONFIG_NE2K_PCI is not set
420# CONFIG_8139CP is not set
421# CONFIG_8139TOO is not set
422# CONFIG_SIS900 is not set
423# CONFIG_EPIC100 is not set
424# CONFIG_SUNDANCE is not set
425# CONFIG_TLAN is not set
426# CONFIG_VIA_RHINE is not set
427
428#
429# Ethernet (1000 Mbit)
430#
431# CONFIG_ACENIC is not set
432# CONFIG_DL2K is not set
433# CONFIG_E1000 is not set
434# CONFIG_NS83820 is not set
435# CONFIG_HAMACHI is not set
436# CONFIG_YELLOWFIN is not set
437# CONFIG_R8169 is not set
438# CONFIG_SK98LIN is not set
439# CONFIG_VIA_VELOCITY is not set
440# CONFIG_TIGON3 is not set
441
442#
443# Ethernet (10000 Mbit)
444#
445# CONFIG_IXGB is not set
446# CONFIG_S2IO is not set
447
448#
449# Token Ring devices
450#
451# CONFIG_TR is not set
452
453#
454# Wireless LAN (non-hamradio)
455#
456# CONFIG_NET_RADIO is not set
457
458#
459# Wan interfaces
460#
461CONFIG_WAN=y
462# CONFIG_LANMEDIA is not set
463# CONFIG_SYNCLINK_SYNCPPP is not set
464CONFIG_HDLC=y
465CONFIG_HDLC_RAW=y
466# CONFIG_HDLC_RAW_ETH is not set
467CONFIG_HDLC_CISCO=y
468CONFIG_HDLC_FR=y
469CONFIG_HDLC_PPP=y
470
471#
472# X.25/LAPB support is disabled
473#
474# CONFIG_PCI200SYN is not set
475# CONFIG_WANXL is not set
476# CONFIG_PC300 is not set
477# CONFIG_FARSYNC is not set
478CONFIG_DLCI=y
479CONFIG_DLCI_COUNT=24
480CONFIG_DLCI_MAX=8
481# CONFIG_FDDI is not set
482# CONFIG_HIPPI is not set
483# CONFIG_PPP is not set
484# CONFIG_SLIP is not set
485# CONFIG_SHAPER is not set
486# CONFIG_NETCONSOLE is not set
487
488#
489# ISDN subsystem
490#
491# CONFIG_ISDN is not set
492
493#
494# Input device support
495#
496CONFIG_INPUT=y
497
498#
499# Userland interfaces
500#
501CONFIG_INPUT_MOUSEDEV=y
502CONFIG_INPUT_MOUSEDEV_PSAUX=y
503CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
504CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
505# CONFIG_INPUT_JOYDEV is not set
506# CONFIG_INPUT_TSDEV is not set
507# CONFIG_INPUT_EVDEV is not set
508# CONFIG_INPUT_EVBUG is not set
509
510#
511# Input Device Drivers
512#
513# CONFIG_INPUT_KEYBOARD is not set
514# CONFIG_INPUT_MOUSE is not set
515# CONFIG_INPUT_JOYSTICK is not set
516# CONFIG_INPUT_TOUCHSCREEN is not set
517# CONFIG_INPUT_MISC is not set
518
519#
520# Hardware I/O ports
521#
522# CONFIG_SERIO is not set
523# CONFIG_GAMEPORT is not set
524CONFIG_SOUND_GAMEPORT=y
525
526#
527# Character devices
528#
529# CONFIG_VT is not set
530# CONFIG_SERIAL_NONSTANDARD is not set
531
532#
533# Serial drivers
534#
535CONFIG_SERIAL_8250=y
536CONFIG_SERIAL_8250_CONSOLE=y
537CONFIG_SERIAL_8250_NR_UARTS=2
538# CONFIG_SERIAL_8250_EXTENDED is not set
539
540#
541# Non-8250 serial port support
542#
543CONFIG_SERIAL_CORE=y
544CONFIG_SERIAL_CORE_CONSOLE=y
545CONFIG_UNIX98_PTYS=y
546CONFIG_LEGACY_PTYS=y
547CONFIG_LEGACY_PTY_COUNT=256
548
549#
550# IPMI
551#
552# CONFIG_IPMI_HANDLER is not set
553
554#
555# Watchdog Cards
556#
557CONFIG_WATCHDOG=y
558# CONFIG_WATCHDOG_NOWAYOUT is not set
559
560#
561# Watchdog Device Drivers
562#
563# CONFIG_SOFT_WATCHDOG is not set
564CONFIG_IXP2000_WATCHDOG=y
565
566#
567# PCI-based Watchdog Cards
568#
569# CONFIG_PCIPCWATCHDOG is not set
570# CONFIG_WDTPCI is not set
571# CONFIG_NVRAM is not set
572# CONFIG_RTC is not set
573# CONFIG_DTLK is not set
574# CONFIG_R3964 is not set
575# CONFIG_APPLICOM is not set
576
577#
578# Ftape, the floppy tape device driver
579#
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#
591CONFIG_I2C=y
592CONFIG_I2C_CHARDEV=y
593
594#
595# I2C Algorithms
596#
597CONFIG_I2C_ALGOBIT=y
598# CONFIG_I2C_ALGOPCF is not set
599# CONFIG_I2C_ALGOPCA is not set
600
601#
602# I2C Hardware Bus support
603#
604# CONFIG_I2C_ALI1535 is not set
605# CONFIG_I2C_ALI1563 is not set
606# CONFIG_I2C_ALI15X3 is not set
607# CONFIG_I2C_AMD756 is not set
608# CONFIG_I2C_AMD8111 is not set
609# CONFIG_I2C_I801 is not set
610# CONFIG_I2C_I810 is not set
611# CONFIG_I2C_ISA is not set
612# CONFIG_I2C_IXP2000 is not set
613# CONFIG_I2C_NFORCE2 is not set
614# CONFIG_I2C_PARPORT_LIGHT is not set
615# CONFIG_I2C_PIIX4 is not set
616# CONFIG_I2C_PROSAVAGE is not set
617# CONFIG_I2C_SAVAGE4 is not set
618# CONFIG_SCx200_ACB is not set
619# CONFIG_I2C_SIS5595 is not set
620# CONFIG_I2C_SIS630 is not set
621# CONFIG_I2C_SIS96X is not set
622# CONFIG_I2C_VIA is not set
623# CONFIG_I2C_VIAPRO is not set
624# CONFIG_I2C_VOODOO3 is not set
625# CONFIG_I2C_PCA_ISA is not set
626
627#
628# Hardware Sensors Chip support
629#
630CONFIG_I2C_SENSOR=y
631# CONFIG_SENSORS_ADM1021 is not set
632# CONFIG_SENSORS_ADM1025 is not set
633# CONFIG_SENSORS_ADM1026 is not set
634# CONFIG_SENSORS_ADM1031 is not set
635# CONFIG_SENSORS_ASB100 is not set
636# CONFIG_SENSORS_DS1621 is not set
637# CONFIG_SENSORS_FSCHER is not set
638# CONFIG_SENSORS_FSCPOS is not set
639# CONFIG_SENSORS_GL518SM is not set
640# CONFIG_SENSORS_GL520SM is not set
641# CONFIG_SENSORS_IT87 is not set
642# CONFIG_SENSORS_LM63 is not set
643# CONFIG_SENSORS_LM75 is not set
644# CONFIG_SENSORS_LM77 is not set
645# CONFIG_SENSORS_LM78 is not set
646# CONFIG_SENSORS_LM80 is not set
647# CONFIG_SENSORS_LM83 is not set
648# CONFIG_SENSORS_LM85 is not set
649# CONFIG_SENSORS_LM87 is not set
650# CONFIG_SENSORS_LM90 is not set
651# CONFIG_SENSORS_MAX1619 is not set
652# CONFIG_SENSORS_PC87360 is not set
653# CONFIG_SENSORS_SMSC47B397 is not set
654# CONFIG_SENSORS_SIS5595 is not set
655# CONFIG_SENSORS_SMSC47M1 is not set
656# CONFIG_SENSORS_VIA686A is not set
657# CONFIG_SENSORS_W83781D is not set
658# CONFIG_SENSORS_W83L785TS is not set
659# CONFIG_SENSORS_W83627HF is not set
660
661#
662# Other I2C Chip support
663#
664CONFIG_SENSORS_EEPROM=y
665# CONFIG_SENSORS_PCF8574 is not set
666# CONFIG_SENSORS_PCF8591 is not set
667# CONFIG_SENSORS_RTC8564 is not set
668# CONFIG_I2C_DEBUG_CORE is not set
669# CONFIG_I2C_DEBUG_ALGO is not set
670# CONFIG_I2C_DEBUG_BUS is not set
671# CONFIG_I2C_DEBUG_CHIP is not set
672
673#
674# Misc devices
675#
676
677#
678# Multimedia devices
679#
680# CONFIG_VIDEO_DEV is not set
681
682#
683# Digital Video Broadcasting Devices
684#
685# CONFIG_DVB is not set
686
687#
688# Graphics support
689#
690# CONFIG_FB is not set
691
692#
693# Sound
694#
695# CONFIG_SOUND is not set
696
697#
698# USB support
699#
700CONFIG_USB_ARCH_HAS_HCD=y
701CONFIG_USB_ARCH_HAS_OHCI=y
702# CONFIG_USB is not set
703
704#
705# USB Gadget Support
706#
707# CONFIG_USB_GADGET is not set
708
709#
710# MMC/SD Card support
711#
712# CONFIG_MMC is not set
713
714#
715# File systems
716#
717CONFIG_EXT2_FS=y
718CONFIG_EXT2_FS_XATTR=y
719CONFIG_EXT2_FS_POSIX_ACL=y
720# CONFIG_EXT2_FS_SECURITY is not set
721CONFIG_EXT3_FS=y
722CONFIG_EXT3_FS_XATTR=y
723CONFIG_EXT3_FS_POSIX_ACL=y
724# CONFIG_EXT3_FS_SECURITY is not set
725CONFIG_JBD=y
726# CONFIG_JBD_DEBUG is not set
727CONFIG_FS_MBCACHE=y
728# CONFIG_REISERFS_FS is not set
729# CONFIG_JFS_FS is not set
730CONFIG_FS_POSIX_ACL=y
731
732#
733# XFS support
734#
735# CONFIG_XFS_FS is not set
736# CONFIG_MINIX_FS is not set
737# CONFIG_ROMFS_FS is not set
738# CONFIG_QUOTA is not set
739CONFIG_DNOTIFY=y
740# CONFIG_AUTOFS_FS is not set
741# CONFIG_AUTOFS4_FS is not set
742
743#
744# CD-ROM/DVD Filesystems
745#
746# CONFIG_ISO9660_FS is not set
747# CONFIG_UDF_FS is not set
748
749#
750# DOS/FAT/NT Filesystems
751#
752# CONFIG_MSDOS_FS is not set
753# CONFIG_VFAT_FS is not set
754# CONFIG_NTFS_FS is not set
755
756#
757# Pseudo filesystems
758#
759CONFIG_PROC_FS=y
760CONFIG_SYSFS=y
761# CONFIG_DEVFS_FS is not set
762# CONFIG_DEVPTS_FS_XATTR is not set
763CONFIG_TMPFS=y
764# CONFIG_TMPFS_XATTR is not set
765# CONFIG_HUGETLB_PAGE is not set
766CONFIG_RAMFS=y
767
768#
769# Miscellaneous filesystems
770#
771# CONFIG_ADFS_FS is not set
772# CONFIG_AFFS_FS is not set
773# CONFIG_HFS_FS is not set
774# CONFIG_HFSPLUS_FS is not set
775# CONFIG_BEFS_FS is not set
776# CONFIG_BFS_FS is not set
777# CONFIG_EFS_FS is not set
778# CONFIG_JFFS_FS is not set
779CONFIG_JFFS2_FS=y
780CONFIG_JFFS2_FS_DEBUG=0
781# CONFIG_JFFS2_FS_NAND is not set
782# CONFIG_JFFS2_FS_NOR_ECC is not set
783# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
784CONFIG_JFFS2_ZLIB=y
785CONFIG_JFFS2_RTIME=y
786# CONFIG_JFFS2_RUBIN is not set
787# CONFIG_CRAMFS is not set
788# CONFIG_VXFS_FS is not set
789# CONFIG_HPFS_FS is not set
790# CONFIG_QNX4FS_FS is not set
791# CONFIG_SYSV_FS is not set
792# CONFIG_UFS_FS is not set
793
794#
795# Network File Systems
796#
797CONFIG_NFS_FS=y
798CONFIG_NFS_V3=y
799# CONFIG_NFS_V4 is not set
800# CONFIG_NFS_DIRECTIO is not set
801# CONFIG_NFSD is not set
802CONFIG_ROOT_NFS=y
803CONFIG_LOCKD=y
804CONFIG_LOCKD_V4=y
805CONFIG_SUNRPC=y
806# CONFIG_RPCSEC_GSS_KRB5 is not set
807# CONFIG_RPCSEC_GSS_SPKM3 is not set
808# CONFIG_SMB_FS is not set
809# CONFIG_CIFS is not set
810# CONFIG_NCP_FS is not set
811# CONFIG_CODA_FS is not set
812# CONFIG_AFS_FS is not set
813
814#
815# Partition Types
816#
817CONFIG_PARTITION_ADVANCED=y
818# CONFIG_ACORN_PARTITION is not set
819# CONFIG_OSF_PARTITION is not set
820# CONFIG_AMIGA_PARTITION is not set
821# CONFIG_ATARI_PARTITION is not set
822# CONFIG_MAC_PARTITION is not set
823CONFIG_MSDOS_PARTITION=y
824# CONFIG_BSD_DISKLABEL is not set
825# CONFIG_MINIX_SUBPARTITION is not set
826# CONFIG_SOLARIS_X86_PARTITION is not set
827# CONFIG_UNIXWARE_DISKLABEL is not set
828# CONFIG_LDM_PARTITION is not set
829# CONFIG_SGI_PARTITION is not set
830# CONFIG_ULTRIX_PARTITION is not set
831# CONFIG_SUN_PARTITION is not set
832# CONFIG_EFI_PARTITION is not set
833
834#
835# Native Language Support
836#
837# CONFIG_NLS is not set
838
839#
840# Profiling support
841#
842# CONFIG_PROFILING is not set
843
844#
845# Kernel hacking
846#
847# CONFIG_PRINTK_TIME is not set
848CONFIG_DEBUG_KERNEL=y
849CONFIG_MAGIC_SYSRQ=y
850CONFIG_LOG_BUF_SHIFT=14
851# CONFIG_SCHEDSTATS is not set
852# CONFIG_DEBUG_SLAB is not set
853# CONFIG_DEBUG_SPINLOCK is not set
854# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
855# CONFIG_DEBUG_KOBJECT is not set
856CONFIG_DEBUG_BUGVERBOSE=y
857# CONFIG_DEBUG_INFO is not set
858# CONFIG_DEBUG_FS is not set
859CONFIG_FRAME_POINTER=y
860CONFIG_DEBUG_USER=y
861# CONFIG_DEBUG_WAITQ is not set
862CONFIG_DEBUG_ERRORS=y
863CONFIG_DEBUG_LL=y
864# CONFIG_DEBUG_ICEDCC is not set
865
866#
867# Security options
868#
869# CONFIG_KEYS is not set
870# CONFIG_SECURITY is not set
871
872#
873# Cryptographic options
874#
875# CONFIG_CRYPTO is not set
876
877#
878# Hardware crypto devices
879#
880
881#
882# Library routines
883#
884# CONFIG_CRC_CCITT is not set
885CONFIG_CRC32=y
886# CONFIG_LIBCRC32C is not set
887CONFIG_ZLIB_INFLATE=y
888CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/ixdp2801_defconfig b/arch/arm/configs/ixdp2801_defconfig
new file mode 100644
index 000000000000..cd84a20f30f1
--- /dev/null
+++ b/arch/arm/configs/ixdp2801_defconfig
@@ -0,0 +1,889 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 22:39:19 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34CONFIG_EMBEDDED=y
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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#
53# CONFIG_MODULES is not set
54
55#
56# System Type
57#
58# CONFIG_ARCH_CLPS7500 is not set
59# CONFIG_ARCH_CLPS711X is not set
60# CONFIG_ARCH_CO285 is not set
61# CONFIG_ARCH_EBSA110 is not set
62# CONFIG_ARCH_CAMELOT is not set
63# CONFIG_ARCH_FOOTBRIDGE is not set
64# CONFIG_ARCH_INTEGRATOR is not set
65# CONFIG_ARCH_IOP3XX is not set
66# CONFIG_ARCH_IXP4XX is not set
67CONFIG_ARCH_IXP2000=y
68# CONFIG_ARCH_L7200 is not set
69# CONFIG_ARCH_PXA is not set
70# CONFIG_ARCH_RPC is not set
71# CONFIG_ARCH_SA1100 is not set
72# CONFIG_ARCH_S3C2410 is not set
73# CONFIG_ARCH_SHARK is not set
74# CONFIG_ARCH_LH7A40X is not set
75# CONFIG_ARCH_OMAP is not set
76# CONFIG_ARCH_VERSATILE is not set
77# CONFIG_ARCH_IMX is not set
78# CONFIG_ARCH_H720X is not set
79CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
80
81#
82# Intel IXP2400/2800 Implementation Options
83#
84
85#
86# IXP2400/2800 Platforms
87#
88# CONFIG_ARCH_ENP2611 is not set
89# CONFIG_ARCH_IXDP2400 is not set
90# CONFIG_ARCH_IXDP2800 is not set
91# CONFIG_ARCH_IXDP2401 is not set
92CONFIG_ARCH_IXDP2801=y
93CONFIG_ARCH_IXDP2X01=y
94
95#
96# Processor Type
97#
98CONFIG_CPU_32=y
99CONFIG_CPU_XSCALE=y
100CONFIG_CPU_32v5=y
101CONFIG_CPU_ABRT_EV5T=y
102CONFIG_CPU_CACHE_VIVT=y
103CONFIG_CPU_TLB_V4WBI=y
104CONFIG_CPU_MINICACHE=y
105
106#
107# Processor Features
108#
109# CONFIG_ARM_THUMB is not set
110CONFIG_CPU_BIG_ENDIAN=y
111CONFIG_XSCALE_PMU=y
112
113#
114# Bus support
115#
116CONFIG_PCI=y
117CONFIG_PCI_LEGACY_PROC=y
118CONFIG_PCI_NAMES=y
119
120#
121# PCCARD (PCMCIA/CardBus) support
122#
123# CONFIG_PCCARD is not set
124
125#
126# Kernel Features
127#
128# CONFIG_PREEMPT is not set
129CONFIG_ALIGNMENT_TRAP=y
130
131#
132# Boot options
133#
134CONFIG_ZBOOT_ROM_TEXT=0x0
135CONFIG_ZBOOT_ROM_BSS=0x0
136CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp mem=64M@0x0 pci=firmware ixdp2x01_clock=50000000"
137# CONFIG_XIP_KERNEL is not set
138
139#
140# Floating point emulation
141#
142
143#
144# At least one emulation must be selected
145#
146CONFIG_FPE_NWFPE=y
147# CONFIG_FPE_FASTFPE is not set
148
149#
150# Userspace binary formats
151#
152CONFIG_BINFMT_ELF=y
153# CONFIG_BINFMT_AOUT is not set
154# CONFIG_BINFMT_MISC is not set
155# CONFIG_ARTHUR is not set
156
157#
158# Power management options
159#
160# CONFIG_PM is not set
161
162#
163# Device Drivers
164#
165
166#
167# Generic Driver Options
168#
169CONFIG_STANDALONE=y
170# CONFIG_PREVENT_FIRMWARE_BUILD is not set
171# CONFIG_FW_LOADER is not set
172# CONFIG_DEBUG_DRIVER is not set
173
174#
175# Memory Technology Devices (MTD)
176#
177CONFIG_MTD=y
178# CONFIG_MTD_DEBUG is not set
179# CONFIG_MTD_CONCAT is not set
180CONFIG_MTD_PARTITIONS=y
181CONFIG_MTD_REDBOOT_PARTS=y
182CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
183CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
184CONFIG_MTD_REDBOOT_PARTS_READONLY=y
185# CONFIG_MTD_CMDLINE_PARTS is not set
186# CONFIG_MTD_AFS_PARTS is not set
187
188#
189# User Modules And Translation Layers
190#
191CONFIG_MTD_CHAR=y
192CONFIG_MTD_BLOCK=y
193# CONFIG_FTL is not set
194# CONFIG_NFTL is not set
195# CONFIG_INFTL is not set
196
197#
198# RAM/ROM/Flash chip drivers
199#
200CONFIG_MTD_CFI=y
201# CONFIG_MTD_JEDECPROBE is not set
202CONFIG_MTD_GEN_PROBE=y
203# CONFIG_MTD_CFI_ADV_OPTIONS is not set
204CONFIG_MTD_MAP_BANK_WIDTH_1=y
205CONFIG_MTD_MAP_BANK_WIDTH_2=y
206CONFIG_MTD_MAP_BANK_WIDTH_4=y
207# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
208# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
209# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
210CONFIG_MTD_CFI_I1=y
211CONFIG_MTD_CFI_I2=y
212# CONFIG_MTD_CFI_I4 is not set
213# CONFIG_MTD_CFI_I8 is not set
214CONFIG_MTD_CFI_INTELEXT=y
215# CONFIG_MTD_CFI_AMDSTD is not set
216# CONFIG_MTD_CFI_STAA is not set
217CONFIG_MTD_CFI_UTIL=y
218# CONFIG_MTD_RAM is not set
219# CONFIG_MTD_ROM is not set
220# CONFIG_MTD_ABSENT is not set
221# CONFIG_MTD_XIP is not set
222
223#
224# Mapping drivers for chip access
225#
226CONFIG_MTD_COMPLEX_MAPPINGS=y
227# CONFIG_MTD_PHYSMAP is not set
228# CONFIG_MTD_ARM_INTEGRATOR is not set
229CONFIG_MTD_IXP2000=y
230# CONFIG_MTD_EDB7312 is not set
231# CONFIG_MTD_PCI is not set
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=8192
280CONFIG_BLK_DEV_INITRD=y
281CONFIG_INITRAMFS_SOURCE=""
282# CONFIG_CDROM_PKTCDVD is not set
283
284#
285# IO Schedulers
286#
287CONFIG_IOSCHED_NOOP=y
288CONFIG_IOSCHED_AS=y
289CONFIG_IOSCHED_DEADLINE=y
290CONFIG_IOSCHED_CFQ=y
291# CONFIG_ATA_OVER_ETH is not set
292
293#
294# SCSI device support
295#
296# CONFIG_SCSI is not set
297
298#
299# Multi-device support (RAID and LVM)
300#
301# CONFIG_MD is not set
302
303#
304# Fusion MPT device support
305#
306
307#
308# IEEE 1394 (FireWire) support
309#
310# CONFIG_IEEE1394 is not set
311
312#
313# I2O device support
314#
315# CONFIG_I2O is not set
316
317#
318# Networking support
319#
320CONFIG_NET=y
321
322#
323# Networking options
324#
325CONFIG_PACKET=y
326CONFIG_PACKET_MMAP=y
327# CONFIG_NETLINK_DEV is not set
328CONFIG_UNIX=y
329# CONFIG_NET_KEY is not set
330CONFIG_INET=y
331# CONFIG_IP_MULTICAST is not set
332# CONFIG_IP_ADVANCED_ROUTER is not set
333CONFIG_IP_PNP=y
334CONFIG_IP_PNP_DHCP=y
335CONFIG_IP_PNP_BOOTP=y
336# CONFIG_IP_PNP_RARP is not set
337# CONFIG_NET_IPIP is not set
338# CONFIG_NET_IPGRE is not set
339# CONFIG_ARPD is not set
340CONFIG_SYN_COOKIES=y
341# CONFIG_INET_AH is not set
342# CONFIG_INET_ESP is not set
343# CONFIG_INET_IPCOMP is not set
344# CONFIG_INET_TUNNEL is not set
345# CONFIG_IP_TCPDIAG is not set
346# CONFIG_IP_TCPDIAG_IPV6 is not set
347# CONFIG_IPV6 is not set
348# CONFIG_NETFILTER is not set
349
350#
351# SCTP Configuration (EXPERIMENTAL)
352#
353# CONFIG_IP_SCTP is not set
354# CONFIG_ATM is not set
355# CONFIG_BRIDGE is not set
356# CONFIG_VLAN_8021Q is not set
357# CONFIG_DECNET is not set
358# CONFIG_LLC2 is not set
359# CONFIG_IPX is not set
360# CONFIG_ATALK is not set
361# CONFIG_X25 is not set
362# CONFIG_LAPB is not set
363# CONFIG_NET_DIVERT is not set
364# CONFIG_ECONET is not set
365# CONFIG_WAN_ROUTER is not set
366
367#
368# QoS and/or fair queueing
369#
370# CONFIG_NET_SCHED is not set
371# CONFIG_NET_CLS_ROUTE is not set
372
373#
374# Network testing
375#
376# CONFIG_NET_PKTGEN is not set
377# CONFIG_NETPOLL is not set
378# CONFIG_NET_POLL_CONTROLLER is not set
379# CONFIG_HAMRADIO is not set
380# CONFIG_IRDA is not set
381# CONFIG_BT is not set
382CONFIG_NETDEVICES=y
383CONFIG_DUMMY=y
384# CONFIG_BONDING is not set
385# CONFIG_EQUALIZER is not set
386# CONFIG_TUN is not set
387
388#
389# ARCnet devices
390#
391# CONFIG_ARCNET is not set
392
393#
394# Ethernet (10 or 100Mbit)
395#
396CONFIG_NET_ETHERNET=y
397CONFIG_MII=y
398# CONFIG_HAPPYMEAL is not set
399# CONFIG_SUNGEM is not set
400# CONFIG_NET_VENDOR_3COM is not set
401# CONFIG_SMC91X is not set
402
403#
404# Tulip family network device support
405#
406# CONFIG_NET_TULIP is not set
407# CONFIG_HP100 is not set
408CONFIG_NET_PCI=y
409# CONFIG_PCNET32 is not set
410# CONFIG_AMD8111_ETH is not set
411# CONFIG_ADAPTEC_STARFIRE is not set
412# CONFIG_B44 is not set
413# CONFIG_FORCEDETH is not set
414CONFIG_CS89x0=y
415# CONFIG_DGRS is not set
416CONFIG_EEPRO100=y
417# CONFIG_E100 is not set
418# CONFIG_FEALNX is not set
419# CONFIG_NATSEMI is not set
420# CONFIG_NE2K_PCI is not set
421# CONFIG_8139CP is not set
422# CONFIG_8139TOO is not set
423# CONFIG_SIS900 is not set
424# CONFIG_EPIC100 is not set
425# CONFIG_SUNDANCE is not set
426# CONFIG_TLAN is not set
427# CONFIG_VIA_RHINE is not set
428
429#
430# Ethernet (1000 Mbit)
431#
432# CONFIG_ACENIC is not set
433# CONFIG_DL2K is not set
434# CONFIG_E1000 is not set
435# CONFIG_NS83820 is not set
436# CONFIG_HAMACHI is not set
437# CONFIG_YELLOWFIN is not set
438# CONFIG_R8169 is not set
439# CONFIG_SK98LIN is not set
440# CONFIG_VIA_VELOCITY is not set
441# CONFIG_TIGON3 is not set
442
443#
444# Ethernet (10000 Mbit)
445#
446# CONFIG_IXGB is not set
447# CONFIG_S2IO is not set
448
449#
450# Token Ring devices
451#
452# CONFIG_TR is not set
453
454#
455# Wireless LAN (non-hamradio)
456#
457# CONFIG_NET_RADIO is not set
458
459#
460# Wan interfaces
461#
462CONFIG_WAN=y
463# CONFIG_LANMEDIA is not set
464# CONFIG_SYNCLINK_SYNCPPP is not set
465CONFIG_HDLC=y
466CONFIG_HDLC_RAW=y
467# CONFIG_HDLC_RAW_ETH is not set
468CONFIG_HDLC_CISCO=y
469CONFIG_HDLC_FR=y
470CONFIG_HDLC_PPP=y
471
472#
473# X.25/LAPB support is disabled
474#
475# CONFIG_PCI200SYN is not set
476# CONFIG_WANXL is not set
477# CONFIG_PC300 is not set
478# CONFIG_FARSYNC is not set
479CONFIG_DLCI=y
480CONFIG_DLCI_COUNT=24
481CONFIG_DLCI_MAX=8
482# CONFIG_FDDI is not set
483# CONFIG_HIPPI is not set
484# CONFIG_PPP is not set
485# CONFIG_SLIP is not set
486# CONFIG_SHAPER is not set
487# CONFIG_NETCONSOLE is not set
488
489#
490# ISDN subsystem
491#
492# CONFIG_ISDN is not set
493
494#
495# Input device support
496#
497CONFIG_INPUT=y
498
499#
500# Userland interfaces
501#
502CONFIG_INPUT_MOUSEDEV=y
503CONFIG_INPUT_MOUSEDEV_PSAUX=y
504CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
505CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
506# CONFIG_INPUT_JOYDEV is not set
507# CONFIG_INPUT_TSDEV is not set
508# CONFIG_INPUT_EVDEV is not set
509# CONFIG_INPUT_EVBUG is not set
510
511#
512# Input Device Drivers
513#
514# CONFIG_INPUT_KEYBOARD is not set
515# CONFIG_INPUT_MOUSE is not set
516# CONFIG_INPUT_JOYSTICK is not set
517# CONFIG_INPUT_TOUCHSCREEN is not set
518# CONFIG_INPUT_MISC is not set
519
520#
521# Hardware I/O ports
522#
523# CONFIG_SERIO is not set
524# CONFIG_GAMEPORT is not set
525CONFIG_SOUND_GAMEPORT=y
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=2
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# IPMI
552#
553# CONFIG_IPMI_HANDLER is not set
554
555#
556# Watchdog Cards
557#
558CONFIG_WATCHDOG=y
559# CONFIG_WATCHDOG_NOWAYOUT is not set
560
561#
562# Watchdog Device Drivers
563#
564# CONFIG_SOFT_WATCHDOG is not set
565CONFIG_IXP2000_WATCHDOG=y
566
567#
568# PCI-based Watchdog Cards
569#
570# CONFIG_PCIPCWATCHDOG is not set
571# CONFIG_WDTPCI is not set
572# CONFIG_NVRAM is not set
573# CONFIG_RTC is not set
574# CONFIG_DTLK is not set
575# CONFIG_R3964 is not set
576# CONFIG_APPLICOM is not set
577
578#
579# Ftape, the floppy tape device driver
580#
581# CONFIG_DRM is not set
582# CONFIG_RAW_DRIVER is not set
583
584#
585# TPM devices
586#
587# CONFIG_TCG_TPM is not set
588
589#
590# I2C support
591#
592CONFIG_I2C=y
593CONFIG_I2C_CHARDEV=y
594
595#
596# I2C Algorithms
597#
598CONFIG_I2C_ALGOBIT=y
599# CONFIG_I2C_ALGOPCF is not set
600# CONFIG_I2C_ALGOPCA is not set
601
602#
603# I2C Hardware Bus support
604#
605# CONFIG_I2C_ALI1535 is not set
606# CONFIG_I2C_ALI1563 is not set
607# CONFIG_I2C_ALI15X3 is not set
608# CONFIG_I2C_AMD756 is not set
609# CONFIG_I2C_AMD8111 is not set
610# CONFIG_I2C_I801 is not set
611# CONFIG_I2C_I810 is not set
612# CONFIG_I2C_ISA is not set
613# CONFIG_I2C_IXP2000 is not set
614# CONFIG_I2C_NFORCE2 is not set
615# CONFIG_I2C_PARPORT_LIGHT is not set
616# CONFIG_I2C_PIIX4 is not set
617# CONFIG_I2C_PROSAVAGE is not set
618# CONFIG_I2C_SAVAGE4 is not set
619# CONFIG_SCx200_ACB is not set
620# CONFIG_I2C_SIS5595 is not set
621# CONFIG_I2C_SIS630 is not set
622# CONFIG_I2C_SIS96X is not set
623# CONFIG_I2C_VIA is not set
624# CONFIG_I2C_VIAPRO is not set
625# CONFIG_I2C_VOODOO3 is not set
626# CONFIG_I2C_PCA_ISA is not set
627
628#
629# Hardware Sensors Chip support
630#
631CONFIG_I2C_SENSOR=y
632# CONFIG_SENSORS_ADM1021 is not set
633# CONFIG_SENSORS_ADM1025 is not set
634# CONFIG_SENSORS_ADM1026 is not set
635# CONFIG_SENSORS_ADM1031 is not set
636# CONFIG_SENSORS_ASB100 is not set
637# CONFIG_SENSORS_DS1621 is not set
638# CONFIG_SENSORS_FSCHER is not set
639# CONFIG_SENSORS_FSCPOS is not set
640# CONFIG_SENSORS_GL518SM is not set
641# CONFIG_SENSORS_GL520SM is not set
642# CONFIG_SENSORS_IT87 is not set
643# CONFIG_SENSORS_LM63 is not set
644# CONFIG_SENSORS_LM75 is not set
645# CONFIG_SENSORS_LM77 is not set
646# CONFIG_SENSORS_LM78 is not set
647# CONFIG_SENSORS_LM80 is not set
648# CONFIG_SENSORS_LM83 is not set
649# CONFIG_SENSORS_LM85 is not set
650# CONFIG_SENSORS_LM87 is not set
651# CONFIG_SENSORS_LM90 is not set
652# CONFIG_SENSORS_MAX1619 is not set
653# CONFIG_SENSORS_PC87360 is not set
654# CONFIG_SENSORS_SMSC47B397 is not set
655# CONFIG_SENSORS_SIS5595 is not set
656# CONFIG_SENSORS_SMSC47M1 is not set
657# CONFIG_SENSORS_VIA686A is not set
658# CONFIG_SENSORS_W83781D is not set
659# CONFIG_SENSORS_W83L785TS is not set
660# CONFIG_SENSORS_W83627HF is not set
661
662#
663# Other I2C Chip support
664#
665CONFIG_SENSORS_EEPROM=y
666# CONFIG_SENSORS_PCF8574 is not set
667# CONFIG_SENSORS_PCF8591 is not set
668# CONFIG_SENSORS_RTC8564 is not set
669# CONFIG_I2C_DEBUG_CORE is not set
670# CONFIG_I2C_DEBUG_ALGO is not set
671# CONFIG_I2C_DEBUG_BUS is not set
672# CONFIG_I2C_DEBUG_CHIP is not set
673
674#
675# Misc devices
676#
677
678#
679# Multimedia devices
680#
681# CONFIG_VIDEO_DEV is not set
682
683#
684# Digital Video Broadcasting Devices
685#
686# CONFIG_DVB is not set
687
688#
689# Graphics support
690#
691# CONFIG_FB is not set
692
693#
694# Sound
695#
696# CONFIG_SOUND is not set
697
698#
699# USB support
700#
701CONFIG_USB_ARCH_HAS_HCD=y
702CONFIG_USB_ARCH_HAS_OHCI=y
703# CONFIG_USB is not set
704
705#
706# USB Gadget Support
707#
708# CONFIG_USB_GADGET is not set
709
710#
711# MMC/SD Card support
712#
713# CONFIG_MMC is not set
714
715#
716# File systems
717#
718CONFIG_EXT2_FS=y
719CONFIG_EXT2_FS_XATTR=y
720CONFIG_EXT2_FS_POSIX_ACL=y
721# CONFIG_EXT2_FS_SECURITY is not set
722CONFIG_EXT3_FS=y
723CONFIG_EXT3_FS_XATTR=y
724CONFIG_EXT3_FS_POSIX_ACL=y
725# CONFIG_EXT3_FS_SECURITY is not set
726CONFIG_JBD=y
727# CONFIG_JBD_DEBUG is not set
728CONFIG_FS_MBCACHE=y
729# CONFIG_REISERFS_FS is not set
730# CONFIG_JFS_FS is not set
731CONFIG_FS_POSIX_ACL=y
732
733#
734# XFS support
735#
736# CONFIG_XFS_FS is not set
737# CONFIG_MINIX_FS is not set
738# CONFIG_ROMFS_FS is not set
739# CONFIG_QUOTA is not set
740CONFIG_DNOTIFY=y
741# CONFIG_AUTOFS_FS is not set
742# CONFIG_AUTOFS4_FS is not set
743
744#
745# CD-ROM/DVD Filesystems
746#
747# CONFIG_ISO9660_FS is not set
748# CONFIG_UDF_FS is not set
749
750#
751# DOS/FAT/NT Filesystems
752#
753# CONFIG_MSDOS_FS is not set
754# CONFIG_VFAT_FS is not set
755# CONFIG_NTFS_FS is not set
756
757#
758# Pseudo filesystems
759#
760CONFIG_PROC_FS=y
761CONFIG_SYSFS=y
762# CONFIG_DEVFS_FS is not set
763# CONFIG_DEVPTS_FS_XATTR is not set
764CONFIG_TMPFS=y
765# CONFIG_TMPFS_XATTR is not set
766# CONFIG_HUGETLB_PAGE is not set
767CONFIG_RAMFS=y
768
769#
770# Miscellaneous filesystems
771#
772# CONFIG_ADFS_FS is not set
773# CONFIG_AFFS_FS is not set
774# CONFIG_HFS_FS is not set
775# CONFIG_HFSPLUS_FS is not set
776# CONFIG_BEFS_FS is not set
777# CONFIG_BFS_FS is not set
778# CONFIG_EFS_FS is not set
779# CONFIG_JFFS_FS is not set
780CONFIG_JFFS2_FS=y
781CONFIG_JFFS2_FS_DEBUG=0
782# CONFIG_JFFS2_FS_NAND is not set
783# CONFIG_JFFS2_FS_NOR_ECC is not set
784# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
785CONFIG_JFFS2_ZLIB=y
786CONFIG_JFFS2_RTIME=y
787# CONFIG_JFFS2_RUBIN is not set
788# CONFIG_CRAMFS is not set
789# CONFIG_VXFS_FS is not set
790# CONFIG_HPFS_FS is not set
791# CONFIG_QNX4FS_FS is not set
792# CONFIG_SYSV_FS is not set
793# CONFIG_UFS_FS is not set
794
795#
796# Network File Systems
797#
798CONFIG_NFS_FS=y
799CONFIG_NFS_V3=y
800# CONFIG_NFS_V4 is not set
801# CONFIG_NFS_DIRECTIO is not set
802# CONFIG_NFSD is not set
803CONFIG_ROOT_NFS=y
804CONFIG_LOCKD=y
805CONFIG_LOCKD_V4=y
806CONFIG_SUNRPC=y
807# CONFIG_RPCSEC_GSS_KRB5 is not set
808# CONFIG_RPCSEC_GSS_SPKM3 is not set
809# CONFIG_SMB_FS is not set
810# CONFIG_CIFS is not set
811# CONFIG_NCP_FS is not set
812# CONFIG_CODA_FS is not set
813# CONFIG_AFS_FS is not set
814
815#
816# Partition Types
817#
818CONFIG_PARTITION_ADVANCED=y
819# CONFIG_ACORN_PARTITION is not set
820# CONFIG_OSF_PARTITION is not set
821# CONFIG_AMIGA_PARTITION is not set
822# CONFIG_ATARI_PARTITION is not set
823# CONFIG_MAC_PARTITION is not set
824CONFIG_MSDOS_PARTITION=y
825# CONFIG_BSD_DISKLABEL is not set
826# CONFIG_MINIX_SUBPARTITION is not set
827# CONFIG_SOLARIS_X86_PARTITION is not set
828# CONFIG_UNIXWARE_DISKLABEL is not set
829# CONFIG_LDM_PARTITION is not set
830# CONFIG_SGI_PARTITION is not set
831# CONFIG_ULTRIX_PARTITION is not set
832# CONFIG_SUN_PARTITION is not set
833# CONFIG_EFI_PARTITION is not set
834
835#
836# Native Language Support
837#
838# CONFIG_NLS is not set
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
849CONFIG_DEBUG_KERNEL=y
850CONFIG_MAGIC_SYSRQ=y
851CONFIG_LOG_BUF_SHIFT=14
852# CONFIG_SCHEDSTATS is not set
853# CONFIG_DEBUG_SLAB is not set
854# CONFIG_DEBUG_SPINLOCK is not set
855# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
856# CONFIG_DEBUG_KOBJECT is not set
857CONFIG_DEBUG_BUGVERBOSE=y
858# CONFIG_DEBUG_INFO is not set
859# CONFIG_DEBUG_FS is not set
860CONFIG_FRAME_POINTER=y
861CONFIG_DEBUG_USER=y
862# CONFIG_DEBUG_WAITQ is not set
863CONFIG_DEBUG_ERRORS=y
864CONFIG_DEBUG_LL=y
865# CONFIG_DEBUG_ICEDCC is not set
866
867#
868# Security options
869#
870# CONFIG_KEYS is not set
871# CONFIG_SECURITY is not set
872
873#
874# Cryptographic options
875#
876# CONFIG_CRYPTO is not set
877
878#
879# Hardware crypto devices
880#
881
882#
883# Library routines
884#
885# CONFIG_CRC_CCITT is not set
886CONFIG_CRC32=y
887# CONFIG_LIBCRC32C is not set
888CONFIG_ZLIB_INFLATE=y
889CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig
new file mode 100644
index 000000000000..94aafec5fb46
--- /dev/null
+++ b/arch/arm/configs/ixp4xx_defconfig
@@ -0,0 +1,1164 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 22:53:40 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34CONFIG_EMBEDDED=y
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
54# CONFIG_MODULE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56CONFIG_MODVERSIONS=y
57# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y
59
60#
61# System Type
62#
63# CONFIG_ARCH_CLPS7500 is not set
64# CONFIG_ARCH_CLPS711X is not set
65# CONFIG_ARCH_CO285 is not set
66# CONFIG_ARCH_EBSA110 is not set
67# CONFIG_ARCH_CAMELOT is not set
68# CONFIG_ARCH_FOOTBRIDGE is not set
69# CONFIG_ARCH_INTEGRATOR is not set
70# CONFIG_ARCH_IOP3XX is not set
71CONFIG_ARCH_IXP4XX=y
72# CONFIG_ARCH_IXP2000 is not set
73# CONFIG_ARCH_L7200 is not set
74# CONFIG_ARCH_PXA is not set
75# CONFIG_ARCH_RPC is not set
76# CONFIG_ARCH_SA1100 is not set
77# CONFIG_ARCH_S3C2410 is not set
78# CONFIG_ARCH_SHARK is not set
79# CONFIG_ARCH_LH7A40X is not set
80# CONFIG_ARCH_OMAP is not set
81# CONFIG_ARCH_VERSATILE is not set
82# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set
84CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
85
86#
87# Intel IXP4xx Implementation Options
88#
89
90#
91# IXP4xx Platforms
92#
93# CONFIG_ARCH_AVILA is not set
94CONFIG_ARCH_ADI_COYOTE=y
95CONFIG_ARCH_IXDP425=y
96# CONFIG_MACH_IXDPG425 is not set
97# CONFIG_MACH_IXDP465 is not set
98CONFIG_ARCH_IXCDP1100=y
99CONFIG_ARCH_PRPMC1100=y
100CONFIG_ARCH_IXDP4XX=y
101# CONFIG_MACH_GTWX5715 is not set
102
103#
104# IXP4xx Options
105#
106# CONFIG_IXP4XX_INDIRECT_PCI is not set
107
108#
109# Processor Type
110#
111CONFIG_CPU_32=y
112CONFIG_CPU_XSCALE=y
113CONFIG_CPU_32v5=y
114CONFIG_CPU_ABRT_EV5T=y
115CONFIG_CPU_CACHE_VIVT=y
116CONFIG_CPU_TLB_V4WBI=y
117CONFIG_CPU_MINICACHE=y
118
119#
120# Processor Features
121#
122# CONFIG_ARM_THUMB is not set
123CONFIG_CPU_BIG_ENDIAN=y
124CONFIG_XSCALE_PMU=y
125CONFIG_DMABOUNCE=y
126
127#
128# Bus support
129#
130CONFIG_PCI=y
131CONFIG_PCI_LEGACY_PROC=y
132CONFIG_PCI_NAMES=y
133
134#
135# PCCARD (PCMCIA/CardBus) support
136#
137# CONFIG_PCCARD is not set
138
139#
140# Kernel Features
141#
142# CONFIG_PREEMPT is not set
143CONFIG_ALIGNMENT_TRAP=y
144
145#
146# Boot options
147#
148CONFIG_ZBOOT_ROM_TEXT=0x0
149CONFIG_ZBOOT_ROM_BSS=0x0
150CONFIG_CMDLINE="console=ttyS0,115200 ip=bootp root=/dev/nfs"
151# CONFIG_XIP_KERNEL is not set
152
153#
154# Floating point emulation
155#
156
157#
158# At least one emulation must be selected
159#
160CONFIG_FPE_NWFPE=y
161# CONFIG_FPE_FASTFPE is not set
162
163#
164# Userspace binary formats
165#
166CONFIG_BINFMT_ELF=y
167# CONFIG_BINFMT_AOUT is not set
168# CONFIG_BINFMT_MISC is not set
169# CONFIG_ARTHUR is not set
170
171#
172# Power management options
173#
174CONFIG_PM=y
175CONFIG_APM=y
176
177#
178# Device Drivers
179#
180
181#
182# Generic Driver Options
183#
184CONFIG_STANDALONE=y
185CONFIG_PREVENT_FIRMWARE_BUILD=y
186# CONFIG_FW_LOADER is not set
187# CONFIG_DEBUG_DRIVER is not set
188
189#
190# Memory Technology Devices (MTD)
191#
192CONFIG_MTD=y
193# CONFIG_MTD_DEBUG is not set
194# CONFIG_MTD_CONCAT is not set
195CONFIG_MTD_PARTITIONS=y
196CONFIG_MTD_REDBOOT_PARTS=y
197CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
198# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
199# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
200# CONFIG_MTD_CMDLINE_PARTS is not set
201# CONFIG_MTD_AFS_PARTS is not set
202
203#
204# User Modules And Translation Layers
205#
206CONFIG_MTD_CHAR=y
207CONFIG_MTD_BLOCK=y
208# CONFIG_FTL is not set
209# CONFIG_NFTL is not set
210# CONFIG_INFTL is not set
211
212#
213# RAM/ROM/Flash chip drivers
214#
215CONFIG_MTD_CFI=y
216# CONFIG_MTD_JEDECPROBE is not set
217CONFIG_MTD_GEN_PROBE=y
218# CONFIG_MTD_CFI_ADV_OPTIONS is not set
219CONFIG_MTD_MAP_BANK_WIDTH_1=y
220CONFIG_MTD_MAP_BANK_WIDTH_2=y
221CONFIG_MTD_MAP_BANK_WIDTH_4=y
222# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
223# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
224# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
225CONFIG_MTD_CFI_I1=y
226CONFIG_MTD_CFI_I2=y
227# CONFIG_MTD_CFI_I4 is not set
228# CONFIG_MTD_CFI_I8 is not set
229CONFIG_MTD_CFI_INTELEXT=y
230# CONFIG_MTD_CFI_AMDSTD is not set
231# CONFIG_MTD_CFI_STAA is not set
232CONFIG_MTD_CFI_UTIL=y
233# CONFIG_MTD_RAM is not set
234# CONFIG_MTD_ROM is not set
235# CONFIG_MTD_ABSENT is not set
236# CONFIG_MTD_XIP is not set
237
238#
239# Mapping drivers for chip access
240#
241CONFIG_MTD_COMPLEX_MAPPINGS=y
242# CONFIG_MTD_PHYSMAP is not set
243# CONFIG_MTD_ARM_INTEGRATOR is not set
244CONFIG_MTD_IXP4XX=y
245# CONFIG_MTD_EDB7312 is not set
246# CONFIG_MTD_PCI is not set
247
248#
249# Self-contained MTD device drivers
250#
251# CONFIG_MTD_PMC551 is not set
252# CONFIG_MTD_SLRAM is not set
253# CONFIG_MTD_PHRAM is not set
254# CONFIG_MTD_MTDRAM is not set
255# CONFIG_MTD_BLKMTD is not set
256# CONFIG_MTD_BLOCK2MTD is not set
257
258#
259# Disk-On-Chip Device Drivers
260#
261# CONFIG_MTD_DOC2000 is not set
262# CONFIG_MTD_DOC2001 is not set
263# CONFIG_MTD_DOC2001PLUS is not set
264
265#
266# NAND Flash Device Drivers
267#
268CONFIG_MTD_NAND=m
269# CONFIG_MTD_NAND_VERIFY_WRITE is not set
270CONFIG_MTD_NAND_IDS=m
271# CONFIG_MTD_NAND_DISKONCHIP is not set
272# CONFIG_MTD_NAND_NANDSIM is not set
273
274#
275# Parallel port support
276#
277# CONFIG_PARPORT is not set
278
279#
280# Plug and Play support
281#
282
283#
284# Block devices
285#
286# CONFIG_BLK_DEV_FD is not set
287# CONFIG_BLK_CPQ_DA is not set
288# CONFIG_BLK_CPQ_CISS_DA is not set
289# CONFIG_BLK_DEV_DAC960 is not set
290# CONFIG_BLK_DEV_UMEM is not set
291# CONFIG_BLK_DEV_COW_COMMON is not set
292CONFIG_BLK_DEV_LOOP=y
293# CONFIG_BLK_DEV_CRYPTOLOOP is not set
294# CONFIG_BLK_DEV_NBD is not set
295# CONFIG_BLK_DEV_SX8 is not set
296CONFIG_BLK_DEV_RAM=y
297CONFIG_BLK_DEV_RAM_COUNT=16
298CONFIG_BLK_DEV_RAM_SIZE=8192
299CONFIG_BLK_DEV_INITRD=y
300CONFIG_INITRAMFS_SOURCE=""
301# CONFIG_CDROM_PKTCDVD is not set
302
303#
304# IO Schedulers
305#
306CONFIG_IOSCHED_NOOP=y
307CONFIG_IOSCHED_AS=y
308CONFIG_IOSCHED_DEADLINE=y
309CONFIG_IOSCHED_CFQ=y
310# CONFIG_ATA_OVER_ETH is not set
311
312#
313# ATA/ATAPI/MFM/RLL support
314#
315CONFIG_IDE=y
316CONFIG_BLK_DEV_IDE=y
317
318#
319# Please see Documentation/ide.txt for help/info on IDE drives
320#
321# CONFIG_BLK_DEV_IDE_SATA is not set
322CONFIG_BLK_DEV_IDEDISK=y
323# CONFIG_IDEDISK_MULTI_MODE is not set
324# CONFIG_BLK_DEV_IDECD is not set
325# CONFIG_BLK_DEV_IDETAPE is not set
326# CONFIG_BLK_DEV_IDEFLOPPY is not set
327# CONFIG_IDE_TASK_IOCTL is not set
328
329#
330# IDE chipset support/bugfixes
331#
332CONFIG_IDE_GENERIC=y
333CONFIG_BLK_DEV_IDEPCI=y
334# CONFIG_IDEPCI_SHARE_IRQ is not set
335# CONFIG_BLK_DEV_OFFBOARD is not set
336# CONFIG_BLK_DEV_GENERIC is not set
337# CONFIG_BLK_DEV_OPTI621 is not set
338# CONFIG_BLK_DEV_SL82C105 is not set
339CONFIG_BLK_DEV_IDEDMA_PCI=y
340# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
341# CONFIG_IDEDMA_PCI_AUTO is not set
342# CONFIG_BLK_DEV_AEC62XX is not set
343# CONFIG_BLK_DEV_ALI15X3 is not set
344# CONFIG_BLK_DEV_AMD74XX is not set
345CONFIG_BLK_DEV_CMD64X=y
346# CONFIG_BLK_DEV_TRIFLEX is not set
347# CONFIG_BLK_DEV_CY82C693 is not set
348# CONFIG_BLK_DEV_CS5520 is not set
349# CONFIG_BLK_DEV_CS5530 is not set
350# CONFIG_BLK_DEV_HPT34X is not set
351CONFIG_BLK_DEV_HPT366=y
352# CONFIG_BLK_DEV_SC1200 is not set
353# CONFIG_BLK_DEV_PIIX is not set
354# CONFIG_BLK_DEV_NS87415 is not set
355# CONFIG_BLK_DEV_PDC202XX_OLD is not set
356CONFIG_BLK_DEV_PDC202XX_NEW=y
357# CONFIG_PDC202XX_FORCE is not set
358# CONFIG_BLK_DEV_SVWKS is not set
359# CONFIG_BLK_DEV_SIIMAGE is not set
360# CONFIG_BLK_DEV_SLC90E66 is not set
361# CONFIG_BLK_DEV_TRM290 is not set
362# CONFIG_BLK_DEV_VIA82CXXX is not set
363# CONFIG_IDE_ARM is not set
364CONFIG_BLK_DEV_IDEDMA=y
365# CONFIG_IDEDMA_IVB is not set
366# CONFIG_IDEDMA_AUTO is not set
367# CONFIG_BLK_DEV_HD is not set
368
369#
370# SCSI device support
371#
372# CONFIG_SCSI is not set
373
374#
375# Multi-device support (RAID and LVM)
376#
377# CONFIG_MD is not set
378
379#
380# Fusion MPT device support
381#
382
383#
384# IEEE 1394 (FireWire) support
385#
386# CONFIG_IEEE1394 is not set
387
388#
389# I2O device support
390#
391# CONFIG_I2O is not set
392
393#
394# Networking support
395#
396CONFIG_NET=y
397
398#
399# Networking options
400#
401CONFIG_PACKET=m
402CONFIG_PACKET_MMAP=y
403CONFIG_NETLINK_DEV=m
404CONFIG_UNIX=y
405# CONFIG_NET_KEY is not set
406CONFIG_INET=y
407CONFIG_IP_MULTICAST=y
408CONFIG_IP_ADVANCED_ROUTER=y
409CONFIG_IP_MULTIPLE_TABLES=y
410CONFIG_IP_ROUTE_FWMARK=y
411CONFIG_IP_ROUTE_MULTIPATH=y
412# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
413CONFIG_IP_ROUTE_VERBOSE=y
414CONFIG_IP_PNP=y
415CONFIG_IP_PNP_DHCP=y
416CONFIG_IP_PNP_BOOTP=y
417# CONFIG_IP_PNP_RARP is not set
418# CONFIG_NET_IPIP is not set
419CONFIG_NET_IPGRE=m
420CONFIG_NET_IPGRE_BROADCAST=y
421CONFIG_IP_MROUTE=y
422CONFIG_IP_PIMSM_V1=y
423CONFIG_IP_PIMSM_V2=y
424# CONFIG_ARPD is not set
425CONFIG_SYN_COOKIES=y
426# CONFIG_INET_AH is not set
427# CONFIG_INET_ESP is not set
428# CONFIG_INET_IPCOMP is not set
429CONFIG_INET_TUNNEL=m
430# CONFIG_IP_TCPDIAG is not set
431# CONFIG_IP_TCPDIAG_IPV6 is not set
432
433#
434# IP: Virtual Server Configuration
435#
436CONFIG_IP_VS=m
437CONFIG_IP_VS_DEBUG=y
438CONFIG_IP_VS_TAB_BITS=12
439
440#
441# IPVS transport protocol load balancing support
442#
443# CONFIG_IP_VS_PROTO_TCP is not set
444# CONFIG_IP_VS_PROTO_UDP is not set
445# CONFIG_IP_VS_PROTO_ESP is not set
446# CONFIG_IP_VS_PROTO_AH is not set
447
448#
449# IPVS scheduler
450#
451CONFIG_IP_VS_RR=m
452CONFIG_IP_VS_WRR=m
453CONFIG_IP_VS_LC=m
454CONFIG_IP_VS_WLC=m
455CONFIG_IP_VS_LBLC=m
456CONFIG_IP_VS_LBLCR=m
457CONFIG_IP_VS_DH=m
458CONFIG_IP_VS_SH=m
459# CONFIG_IP_VS_SED is not set
460# CONFIG_IP_VS_NQ is not set
461
462#
463# IPVS application helper
464#
465# CONFIG_IPV6 is not set
466CONFIG_NETFILTER=y
467# CONFIG_NETFILTER_DEBUG is not set
468CONFIG_BRIDGE_NETFILTER=y
469
470#
471# IP: Netfilter Configuration
472#
473CONFIG_IP_NF_CONNTRACK=m
474# CONFIG_IP_NF_CT_ACCT is not set
475# CONFIG_IP_NF_CONNTRACK_MARK is not set
476# CONFIG_IP_NF_CT_PROTO_SCTP is not set
477CONFIG_IP_NF_FTP=m
478CONFIG_IP_NF_IRC=m
479# CONFIG_IP_NF_TFTP is not set
480# CONFIG_IP_NF_AMANDA is not set
481CONFIG_IP_NF_QUEUE=m
482CONFIG_IP_NF_IPTABLES=m
483CONFIG_IP_NF_MATCH_LIMIT=m
484# CONFIG_IP_NF_MATCH_IPRANGE is not set
485CONFIG_IP_NF_MATCH_MAC=m
486# CONFIG_IP_NF_MATCH_PKTTYPE is not set
487CONFIG_IP_NF_MATCH_MARK=m
488CONFIG_IP_NF_MATCH_MULTIPORT=m
489CONFIG_IP_NF_MATCH_TOS=m
490# CONFIG_IP_NF_MATCH_RECENT is not set
491# CONFIG_IP_NF_MATCH_ECN is not set
492# CONFIG_IP_NF_MATCH_DSCP is not set
493CONFIG_IP_NF_MATCH_AH_ESP=m
494CONFIG_IP_NF_MATCH_LENGTH=m
495CONFIG_IP_NF_MATCH_TTL=m
496CONFIG_IP_NF_MATCH_TCPMSS=m
497# CONFIG_IP_NF_MATCH_HELPER is not set
498CONFIG_IP_NF_MATCH_STATE=m
499# CONFIG_IP_NF_MATCH_CONNTRACK is not set
500CONFIG_IP_NF_MATCH_OWNER=m
501# CONFIG_IP_NF_MATCH_PHYSDEV is not set
502# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
503# CONFIG_IP_NF_MATCH_REALM is not set
504# CONFIG_IP_NF_MATCH_SCTP is not set
505# CONFIG_IP_NF_MATCH_COMMENT is not set
506# CONFIG_IP_NF_MATCH_HASHLIMIT is not set
507CONFIG_IP_NF_FILTER=m
508CONFIG_IP_NF_TARGET_REJECT=m
509CONFIG_IP_NF_TARGET_LOG=m
510CONFIG_IP_NF_TARGET_ULOG=m
511CONFIG_IP_NF_TARGET_TCPMSS=m
512CONFIG_IP_NF_NAT=m
513CONFIG_IP_NF_NAT_NEEDED=y
514CONFIG_IP_NF_TARGET_MASQUERADE=m
515CONFIG_IP_NF_TARGET_REDIRECT=m
516# CONFIG_IP_NF_TARGET_NETMAP is not set
517# CONFIG_IP_NF_TARGET_SAME is not set
518CONFIG_IP_NF_NAT_SNMP_BASIC=m
519CONFIG_IP_NF_NAT_IRC=m
520CONFIG_IP_NF_NAT_FTP=m
521CONFIG_IP_NF_MANGLE=m
522CONFIG_IP_NF_TARGET_TOS=m
523# CONFIG_IP_NF_TARGET_ECN is not set
524# CONFIG_IP_NF_TARGET_DSCP is not set
525CONFIG_IP_NF_TARGET_MARK=m
526# CONFIG_IP_NF_TARGET_CLASSIFY is not set
527# CONFIG_IP_NF_RAW is not set
528CONFIG_IP_NF_ARPTABLES=m
529CONFIG_IP_NF_ARPFILTER=m
530# CONFIG_IP_NF_ARP_MANGLE is not set
531
532#
533# Bridge: Netfilter Configuration
534#
535# CONFIG_BRIDGE_NF_EBTABLES is not set
536CONFIG_XFRM=y
537# CONFIG_XFRM_USER is not set
538
539#
540# SCTP Configuration (EXPERIMENTAL)
541#
542# CONFIG_IP_SCTP is not set
543CONFIG_ATM=y
544CONFIG_ATM_CLIP=y
545# CONFIG_ATM_CLIP_NO_ICMP is not set
546CONFIG_ATM_LANE=m
547CONFIG_ATM_MPOA=m
548CONFIG_ATM_BR2684=m
549# CONFIG_ATM_BR2684_IPFILTER is not set
550CONFIG_BRIDGE=m
551CONFIG_VLAN_8021Q=m
552# CONFIG_DECNET is not set
553CONFIG_LLC=m
554# CONFIG_LLC2 is not set
555CONFIG_IPX=m
556# CONFIG_IPX_INTERN is not set
557CONFIG_ATALK=m
558CONFIG_DEV_APPLETALK=y
559CONFIG_IPDDP=m
560CONFIG_IPDDP_ENCAP=y
561CONFIG_IPDDP_DECAP=y
562CONFIG_X25=m
563CONFIG_LAPB=m
564# CONFIG_NET_DIVERT is not set
565CONFIG_ECONET=m
566CONFIG_ECONET_AUNUDP=y
567CONFIG_ECONET_NATIVE=y
568CONFIG_WAN_ROUTER=m
569
570#
571# QoS and/or fair queueing
572#
573CONFIG_NET_SCHED=y
574CONFIG_NET_SCH_CLK_JIFFIES=y
575# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
576# CONFIG_NET_SCH_CLK_CPU is not set
577CONFIG_NET_SCH_CBQ=m
578CONFIG_NET_SCH_HTB=m
579# CONFIG_NET_SCH_HFSC is not set
580# CONFIG_NET_SCH_ATM is not set
581CONFIG_NET_SCH_PRIO=m
582CONFIG_NET_SCH_RED=m
583CONFIG_NET_SCH_SFQ=m
584CONFIG_NET_SCH_TEQL=m
585CONFIG_NET_SCH_TBF=m
586CONFIG_NET_SCH_GRED=m
587CONFIG_NET_SCH_DSMARK=m
588# CONFIG_NET_SCH_NETEM is not set
589CONFIG_NET_SCH_INGRESS=m
590CONFIG_NET_QOS=y
591CONFIG_NET_ESTIMATOR=y
592CONFIG_NET_CLS=y
593# CONFIG_NET_CLS_BASIC is not set
594CONFIG_NET_CLS_TCINDEX=m
595CONFIG_NET_CLS_ROUTE4=m
596CONFIG_NET_CLS_ROUTE=y
597CONFIG_NET_CLS_FW=m
598CONFIG_NET_CLS_U32=m
599# CONFIG_CLS_U32_PERF is not set
600# CONFIG_NET_CLS_IND is not set
601# CONFIG_CLS_U32_MARK is not set
602CONFIG_NET_CLS_RSVP=m
603CONFIG_NET_CLS_RSVP6=m
604# CONFIG_NET_EMATCH is not set
605# CONFIG_NET_CLS_ACT is not set
606CONFIG_NET_CLS_POLICE=y
607
608#
609# Network testing
610#
611CONFIG_NET_PKTGEN=m
612# CONFIG_NETPOLL is not set
613# CONFIG_NET_POLL_CONTROLLER is not set
614# CONFIG_HAMRADIO is not set
615# CONFIG_IRDA is not set
616# CONFIG_BT is not set
617CONFIG_NETDEVICES=y
618CONFIG_DUMMY=y
619# CONFIG_BONDING is not set
620# CONFIG_EQUALIZER is not set
621# CONFIG_TUN is not set
622# CONFIG_ETHERTAP is not set
623
624#
625# ARCnet devices
626#
627# CONFIG_ARCNET is not set
628
629#
630# Ethernet (10 or 100Mbit)
631#
632CONFIG_NET_ETHERNET=y
633CONFIG_MII=y
634# CONFIG_HAPPYMEAL is not set
635# CONFIG_SUNGEM is not set
636# CONFIG_NET_VENDOR_3COM is not set
637# CONFIG_SMC91X is not set
638
639#
640# Tulip family network device support
641#
642# CONFIG_NET_TULIP is not set
643# CONFIG_HP100 is not set
644CONFIG_NET_PCI=y
645# CONFIG_PCNET32 is not set
646# CONFIG_AMD8111_ETH is not set
647# CONFIG_ADAPTEC_STARFIRE is not set
648# CONFIG_B44 is not set
649# CONFIG_FORCEDETH is not set
650# CONFIG_DGRS is not set
651CONFIG_EEPRO100=y
652# CONFIG_E100 is not set
653# CONFIG_FEALNX is not set
654# CONFIG_NATSEMI is not set
655# CONFIG_NE2K_PCI is not set
656# CONFIG_8139CP is not set
657# CONFIG_8139TOO is not set
658# CONFIG_SIS900 is not set
659# CONFIG_EPIC100 is not set
660# CONFIG_SUNDANCE is not set
661# CONFIG_TLAN is not set
662# CONFIG_VIA_RHINE is not set
663
664#
665# Ethernet (1000 Mbit)
666#
667# CONFIG_ACENIC is not set
668# CONFIG_DL2K is not set
669# CONFIG_E1000 is not set
670# CONFIG_NS83820 is not set
671# CONFIG_HAMACHI is not set
672# CONFIG_YELLOWFIN is not set
673# CONFIG_R8169 is not set
674# CONFIG_SK98LIN is not set
675# CONFIG_VIA_VELOCITY is not set
676# CONFIG_TIGON3 is not set
677
678#
679# Ethernet (10000 Mbit)
680#
681# CONFIG_IXGB is not set
682# CONFIG_S2IO is not set
683
684#
685# Token Ring devices
686#
687# CONFIG_TR is not set
688
689#
690# Wireless LAN (non-hamradio)
691#
692CONFIG_NET_RADIO=y
693
694#
695# Obsolete Wireless cards support (pre-802.11)
696#
697# CONFIG_STRIP is not set
698
699#
700# Wireless 802.11b ISA/PCI cards support
701#
702CONFIG_HERMES=y
703# CONFIG_PLX_HERMES is not set
704# CONFIG_TMD_HERMES is not set
705CONFIG_PCI_HERMES=y
706# CONFIG_ATMEL is not set
707
708#
709# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
710#
711# CONFIG_PRISM54 is not set
712CONFIG_NET_WIRELESS=y
713
714#
715# Wan interfaces
716#
717CONFIG_WAN=y
718# CONFIG_DSCC4 is not set
719# CONFIG_LANMEDIA is not set
720# CONFIG_SYNCLINK_SYNCPPP is not set
721CONFIG_HDLC=m
722CONFIG_HDLC_RAW=y
723# CONFIG_HDLC_RAW_ETH is not set
724CONFIG_HDLC_CISCO=y
725CONFIG_HDLC_FR=y
726CONFIG_HDLC_PPP=y
727CONFIG_HDLC_X25=y
728# CONFIG_PCI200SYN is not set
729# CONFIG_WANXL is not set
730# CONFIG_PC300 is not set
731# CONFIG_FARSYNC is not set
732CONFIG_DLCI=m
733CONFIG_DLCI_COUNT=24
734CONFIG_DLCI_MAX=8
735CONFIG_WAN_ROUTER_DRIVERS=y
736# CONFIG_CYCLADES_SYNC is not set
737# CONFIG_LAPBETHER is not set
738# CONFIG_X25_ASY is not set
739
740#
741# ATM drivers
742#
743CONFIG_ATM_TCP=m
744# CONFIG_ATM_LANAI is not set
745# CONFIG_ATM_ENI is not set
746# CONFIG_ATM_FIRESTREAM is not set
747# CONFIG_ATM_ZATM is not set
748# CONFIG_ATM_NICSTAR is not set
749# CONFIG_ATM_IDT77252 is not set
750# CONFIG_ATM_AMBASSADOR is not set
751# CONFIG_ATM_HORIZON is not set
752# CONFIG_ATM_IA is not set
753# CONFIG_ATM_FORE200E_MAYBE is not set
754# CONFIG_ATM_HE is not set
755# CONFIG_FDDI is not set
756# CONFIG_HIPPI is not set
757# CONFIG_PPP is not set
758# CONFIG_SLIP is not set
759# CONFIG_SHAPER is not set
760# CONFIG_NETCONSOLE is not set
761
762#
763# ISDN subsystem
764#
765# CONFIG_ISDN is not set
766
767#
768# Input device support
769#
770CONFIG_INPUT=y
771
772#
773# Userland interfaces
774#
775CONFIG_INPUT_MOUSEDEV=y
776CONFIG_INPUT_MOUSEDEV_PSAUX=y
777CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
778CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
779# CONFIG_INPUT_JOYDEV is not set
780# CONFIG_INPUT_TSDEV is not set
781# CONFIG_INPUT_EVDEV is not set
782# CONFIG_INPUT_EVBUG is not set
783
784#
785# Input Device Drivers
786#
787# CONFIG_INPUT_KEYBOARD is not set
788# CONFIG_INPUT_MOUSE is not set
789# CONFIG_INPUT_JOYSTICK is not set
790# CONFIG_INPUT_TOUCHSCREEN is not set
791# CONFIG_INPUT_MISC is not set
792
793#
794# Hardware I/O ports
795#
796# CONFIG_SERIO is not set
797# CONFIG_GAMEPORT is not set
798CONFIG_SOUND_GAMEPORT=y
799
800#
801# Character devices
802#
803# CONFIG_VT is not set
804# CONFIG_SERIAL_NONSTANDARD is not set
805
806#
807# Serial drivers
808#
809CONFIG_SERIAL_8250=y
810CONFIG_SERIAL_8250_CONSOLE=y
811CONFIG_SERIAL_8250_NR_UARTS=2
812# CONFIG_SERIAL_8250_EXTENDED is not set
813
814#
815# Non-8250 serial port support
816#
817CONFIG_SERIAL_CORE=y
818CONFIG_SERIAL_CORE_CONSOLE=y
819CONFIG_UNIX98_PTYS=y
820CONFIG_LEGACY_PTYS=y
821CONFIG_LEGACY_PTY_COUNT=256
822
823#
824# IPMI
825#
826# CONFIG_IPMI_HANDLER is not set
827
828#
829# Watchdog Cards
830#
831CONFIG_WATCHDOG=y
832# CONFIG_WATCHDOG_NOWAYOUT is not set
833
834#
835# Watchdog Device Drivers
836#
837# CONFIG_SOFT_WATCHDOG is not set
838CONFIG_IXP4XX_WATCHDOG=y
839
840#
841# PCI-based Watchdog Cards
842#
843# CONFIG_PCIPCWATCHDOG is not set
844# CONFIG_WDTPCI is not set
845# CONFIG_NVRAM is not set
846# CONFIG_RTC is not set
847# CONFIG_DTLK is not set
848# CONFIG_R3964 is not set
849# CONFIG_APPLICOM is not set
850
851#
852# Ftape, the floppy tape device driver
853#
854# CONFIG_DRM is not set
855# CONFIG_RAW_DRIVER is not set
856
857#
858# TPM devices
859#
860# CONFIG_TCG_TPM is not set
861
862#
863# I2C support
864#
865CONFIG_I2C=y
866CONFIG_I2C_CHARDEV=y
867
868#
869# I2C Algorithms
870#
871CONFIG_I2C_ALGOBIT=y
872# CONFIG_I2C_ALGOPCF is not set
873# CONFIG_I2C_ALGOPCA is not set
874
875#
876# I2C Hardware Bus support
877#
878# CONFIG_I2C_ALI1535 is not set
879# CONFIG_I2C_ALI1563 is not set
880# CONFIG_I2C_ALI15X3 is not set
881# CONFIG_I2C_AMD756 is not set
882# CONFIG_I2C_AMD8111 is not set
883# CONFIG_I2C_I801 is not set
884# CONFIG_I2C_I810 is not set
885# CONFIG_I2C_IOP3XX is not set
886# CONFIG_I2C_ISA is not set
887CONFIG_I2C_IXP4XX=y
888# CONFIG_I2C_NFORCE2 is not set
889# CONFIG_I2C_PARPORT_LIGHT is not set
890# CONFIG_I2C_PIIX4 is not set
891# CONFIG_I2C_PROSAVAGE is not set
892# CONFIG_I2C_SAVAGE4 is not set
893# CONFIG_SCx200_ACB is not set
894# CONFIG_I2C_SIS5595 is not set
895# CONFIG_I2C_SIS630 is not set
896# CONFIG_I2C_SIS96X is not set
897# CONFIG_I2C_STUB is not set
898# CONFIG_I2C_VIA is not set
899# CONFIG_I2C_VIAPRO is not set
900# CONFIG_I2C_VOODOO3 is not set
901# CONFIG_I2C_PCA_ISA is not set
902
903#
904# Hardware Sensors Chip support
905#
906CONFIG_I2C_SENSOR=y
907# CONFIG_SENSORS_ADM1021 is not set
908# CONFIG_SENSORS_ADM1025 is not set
909# CONFIG_SENSORS_ADM1026 is not set
910# CONFIG_SENSORS_ADM1031 is not set
911# CONFIG_SENSORS_ASB100 is not set
912# CONFIG_SENSORS_DS1621 is not set
913# CONFIG_SENSORS_FSCHER is not set
914# CONFIG_SENSORS_FSCPOS is not set
915# CONFIG_SENSORS_GL518SM is not set
916# CONFIG_SENSORS_GL520SM is not set
917# CONFIG_SENSORS_IT87 is not set
918# CONFIG_SENSORS_LM63 is not set
919# CONFIG_SENSORS_LM75 is not set
920# CONFIG_SENSORS_LM77 is not set
921# CONFIG_SENSORS_LM78 is not set
922# CONFIG_SENSORS_LM80 is not set
923# CONFIG_SENSORS_LM83 is not set
924# CONFIG_SENSORS_LM85 is not set
925# CONFIG_SENSORS_LM87 is not set
926# CONFIG_SENSORS_LM90 is not set
927# CONFIG_SENSORS_MAX1619 is not set
928# CONFIG_SENSORS_PC87360 is not set
929# CONFIG_SENSORS_SMSC47B397 is not set
930# CONFIG_SENSORS_SIS5595 is not set
931# CONFIG_SENSORS_SMSC47M1 is not set
932# CONFIG_SENSORS_VIA686A is not set
933# CONFIG_SENSORS_W83781D is not set
934# CONFIG_SENSORS_W83L785TS is not set
935# CONFIG_SENSORS_W83627HF is not set
936
937#
938# Other I2C Chip support
939#
940CONFIG_SENSORS_EEPROM=y
941# CONFIG_SENSORS_PCF8574 is not set
942# CONFIG_SENSORS_PCF8591 is not set
943# CONFIG_SENSORS_RTC8564 is not set
944# CONFIG_I2C_DEBUG_CORE is not set
945# CONFIG_I2C_DEBUG_ALGO is not set
946# CONFIG_I2C_DEBUG_BUS is not set
947# CONFIG_I2C_DEBUG_CHIP is not set
948
949#
950# Misc devices
951#
952
953#
954# Multimedia devices
955#
956# CONFIG_VIDEO_DEV is not set
957
958#
959# Digital Video Broadcasting Devices
960#
961# CONFIG_DVB is not set
962
963#
964# Graphics support
965#
966# CONFIG_FB is not set
967
968#
969# Sound
970#
971# CONFIG_SOUND is not set
972
973#
974# USB support
975#
976CONFIG_USB_ARCH_HAS_HCD=y
977CONFIG_USB_ARCH_HAS_OHCI=y
978# CONFIG_USB is not set
979
980#
981# USB Gadget Support
982#
983# CONFIG_USB_GADGET is not set
984
985#
986# MMC/SD Card support
987#
988# CONFIG_MMC is not set
989
990#
991# File systems
992#
993CONFIG_EXT2_FS=y
994CONFIG_EXT2_FS_XATTR=y
995CONFIG_EXT2_FS_POSIX_ACL=y
996# CONFIG_EXT2_FS_SECURITY is not set
997CONFIG_EXT3_FS=y
998CONFIG_EXT3_FS_XATTR=y
999CONFIG_EXT3_FS_POSIX_ACL=y
1000# CONFIG_EXT3_FS_SECURITY is not set
1001CONFIG_JBD=y
1002# CONFIG_JBD_DEBUG is not set
1003CONFIG_FS_MBCACHE=y
1004# CONFIG_REISERFS_FS is not set
1005# CONFIG_JFS_FS is not set
1006CONFIG_FS_POSIX_ACL=y
1007
1008#
1009# XFS support
1010#
1011# CONFIG_XFS_FS is not set
1012# CONFIG_MINIX_FS is not set
1013# CONFIG_ROMFS_FS is not set
1014# CONFIG_QUOTA is not set
1015CONFIG_DNOTIFY=y
1016# CONFIG_AUTOFS_FS is not set
1017# CONFIG_AUTOFS4_FS is not set
1018
1019#
1020# CD-ROM/DVD Filesystems
1021#
1022# CONFIG_ISO9660_FS is not set
1023# CONFIG_UDF_FS is not set
1024
1025#
1026# DOS/FAT/NT Filesystems
1027#
1028# CONFIG_MSDOS_FS is not set
1029# CONFIG_VFAT_FS is not set
1030# CONFIG_NTFS_FS is not set
1031
1032#
1033# Pseudo filesystems
1034#
1035CONFIG_PROC_FS=y
1036CONFIG_SYSFS=y
1037# CONFIG_DEVFS_FS is not set
1038# CONFIG_DEVPTS_FS_XATTR is not set
1039CONFIG_TMPFS=y
1040# CONFIG_TMPFS_XATTR is not set
1041# CONFIG_HUGETLB_PAGE is not set
1042CONFIG_RAMFS=y
1043
1044#
1045# Miscellaneous filesystems
1046#
1047# CONFIG_ADFS_FS is not set
1048# CONFIG_AFFS_FS is not set
1049# CONFIG_HFS_FS is not set
1050# CONFIG_HFSPLUS_FS is not set
1051# CONFIG_BEFS_FS is not set
1052# CONFIG_BFS_FS is not set
1053# CONFIG_EFS_FS is not set
1054# CONFIG_JFFS_FS is not set
1055CONFIG_JFFS2_FS=y
1056CONFIG_JFFS2_FS_DEBUG=0
1057# CONFIG_JFFS2_FS_NAND is not set
1058# CONFIG_JFFS2_FS_NOR_ECC is not set
1059# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1060CONFIG_JFFS2_ZLIB=y
1061CONFIG_JFFS2_RTIME=y
1062# CONFIG_JFFS2_RUBIN is not set
1063# CONFIG_CRAMFS is not set
1064# CONFIG_VXFS_FS is not set
1065# CONFIG_HPFS_FS is not set
1066# CONFIG_QNX4FS_FS is not set
1067# CONFIG_SYSV_FS is not set
1068# CONFIG_UFS_FS is not set
1069
1070#
1071# Network File Systems
1072#
1073CONFIG_NFS_FS=y
1074CONFIG_NFS_V3=y
1075# CONFIG_NFS_V4 is not set
1076# CONFIG_NFS_DIRECTIO is not set
1077# CONFIG_NFSD is not set
1078CONFIG_ROOT_NFS=y
1079CONFIG_LOCKD=y
1080CONFIG_LOCKD_V4=y
1081CONFIG_SUNRPC=y
1082# CONFIG_RPCSEC_GSS_KRB5 is not set
1083# CONFIG_RPCSEC_GSS_SPKM3 is not set
1084# CONFIG_SMB_FS is not set
1085# CONFIG_CIFS is not set
1086# CONFIG_NCP_FS is not set
1087# CONFIG_CODA_FS is not set
1088# CONFIG_AFS_FS is not set
1089
1090#
1091# Partition Types
1092#
1093CONFIG_PARTITION_ADVANCED=y
1094# CONFIG_ACORN_PARTITION is not set
1095# CONFIG_OSF_PARTITION is not set
1096# CONFIG_AMIGA_PARTITION is not set
1097# CONFIG_ATARI_PARTITION is not set
1098# CONFIG_MAC_PARTITION is not set
1099CONFIG_MSDOS_PARTITION=y
1100# CONFIG_BSD_DISKLABEL is not set
1101# CONFIG_MINIX_SUBPARTITION is not set
1102# CONFIG_SOLARIS_X86_PARTITION is not set
1103# CONFIG_UNIXWARE_DISKLABEL is not set
1104# CONFIG_LDM_PARTITION is not set
1105# CONFIG_SGI_PARTITION is not set
1106# CONFIG_ULTRIX_PARTITION is not set
1107# CONFIG_SUN_PARTITION is not set
1108# CONFIG_EFI_PARTITION is not set
1109
1110#
1111# Native Language Support
1112#
1113# CONFIG_NLS is not set
1114
1115#
1116# Profiling support
1117#
1118# CONFIG_PROFILING is not set
1119
1120#
1121# Kernel hacking
1122#
1123# CONFIG_PRINTK_TIME is not set
1124CONFIG_DEBUG_KERNEL=y
1125CONFIG_MAGIC_SYSRQ=y
1126CONFIG_LOG_BUF_SHIFT=14
1127# CONFIG_SCHEDSTATS is not set
1128# CONFIG_DEBUG_SLAB is not set
1129# CONFIG_DEBUG_SPINLOCK is not set
1130# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1131# CONFIG_DEBUG_KOBJECT is not set
1132CONFIG_DEBUG_BUGVERBOSE=y
1133# CONFIG_DEBUG_INFO is not set
1134# CONFIG_DEBUG_FS is not set
1135CONFIG_FRAME_POINTER=y
1136# CONFIG_DEBUG_USER is not set
1137# CONFIG_DEBUG_WAITQ is not set
1138CONFIG_DEBUG_ERRORS=y
1139CONFIG_DEBUG_LL=y
1140# CONFIG_DEBUG_ICEDCC is not set
1141
1142#
1143# Security options
1144#
1145# CONFIG_KEYS is not set
1146# CONFIG_SECURITY is not set
1147
1148#
1149# Cryptographic options
1150#
1151# CONFIG_CRYPTO is not set
1152
1153#
1154# Hardware crypto devices
1155#
1156
1157#
1158# Library routines
1159#
1160# CONFIG_CRC_CCITT is not set
1161CONFIG_CRC32=y
1162# CONFIG_LIBCRC32C is not set
1163CONFIG_ZLIB_INFLATE=y
1164CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/jornada720_defconfig b/arch/arm/configs/jornada720_defconfig
new file mode 100644
index 000000000000..b88aeba82bc0
--- /dev/null
+++ b/arch/arm/configs/jornada720_defconfig
@@ -0,0 +1,919 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 23:10:35 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_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# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66# CONFIG_ARCH_CAMELOT is not set
67# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73# CONFIG_ARCH_PXA is not set
74# CONFIG_ARCH_RPC is not set
75CONFIG_ARCH_SA1100=y
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81# CONFIG_ARCH_IMX is not set
82# CONFIG_ARCH_H720X is not set
83
84#
85# SA11x0 Implementations
86#
87# CONFIG_SA1100_ASSABET is not set
88# CONFIG_SA1100_CERF is not set
89# CONFIG_SA1100_COLLIE is not set
90# CONFIG_SA1100_H3100 is not set
91# CONFIG_SA1100_H3600 is not set
92# CONFIG_SA1100_H3800 is not set
93# CONFIG_SA1100_BADGE4 is not set
94CONFIG_SA1100_JORNADA720=y
95# CONFIG_SA1100_HACKKIT is not set
96# CONFIG_SA1100_LART is not set
97# CONFIG_SA1100_PLEB is not set
98# CONFIG_SA1100_SHANNON is not set
99# CONFIG_SA1100_SIMPAD is not set
100# CONFIG_SA1100_SSP is not set
101
102#
103# Processor Type
104#
105CONFIG_CPU_32=y
106CONFIG_CPU_SA1100=y
107CONFIG_CPU_32v4=y
108CONFIG_CPU_ABRT_EV4=y
109CONFIG_CPU_CACHE_V4WB=y
110CONFIG_CPU_CACHE_VIVT=y
111CONFIG_CPU_TLB_V4WB=y
112CONFIG_CPU_MINICACHE=y
113
114#
115# Processor Features
116#
117CONFIG_SA1111=y
118CONFIG_DMABOUNCE=y
119CONFIG_FORCE_MAX_ZONEORDER=9
120
121#
122# Bus support
123#
124CONFIG_ISA=y
125
126#
127# PCCARD (PCMCIA/CardBus) support
128#
129CONFIG_PCCARD=y
130# CONFIG_PCMCIA_DEBUG is not set
131CONFIG_PCMCIA=y
132
133#
134# PC-card bridges
135#
136CONFIG_I82365=y
137# CONFIG_TCIC is not set
138CONFIG_PCMCIA_SA1100=y
139# CONFIG_PCMCIA_SA1111 is not set
140CONFIG_PCCARD_NONSTATIC=y
141
142#
143# Kernel Features
144#
145# CONFIG_PREEMPT is not set
146CONFIG_DISCONTIGMEM=y
147# CONFIG_LEDS is not set
148CONFIG_ALIGNMENT_TRAP=y
149
150#
151# Boot options
152#
153CONFIG_ZBOOT_ROM_TEXT=0x0
154CONFIG_ZBOOT_ROM_BSS=0x0
155CONFIG_CMDLINE="keepinitrd mem=32M"
156# CONFIG_XIP_KERNEL is not set
157
158#
159# CPU Frequency scaling
160#
161# CONFIG_CPU_FREQ is not set
162
163#
164# Floating point emulation
165#
166
167#
168# At least one emulation must be selected
169#
170CONFIG_FPE_NWFPE=y
171# CONFIG_FPE_NWFPE_XP is not set
172CONFIG_FPE_FASTFPE=y
173
174#
175# Userspace binary formats
176#
177CONFIG_BINFMT_ELF=y
178CONFIG_BINFMT_AOUT=m
179# CONFIG_BINFMT_MISC is not set
180# CONFIG_ARTHUR is not set
181
182#
183# Power management options
184#
185CONFIG_PM=y
186# CONFIG_APM is not set
187
188#
189# Device Drivers
190#
191
192#
193# Generic Driver Options
194#
195CONFIG_STANDALONE=y
196CONFIG_PREVENT_FIRMWARE_BUILD=y
197# CONFIG_FW_LOADER is not set
198# CONFIG_DEBUG_DRIVER is not set
199
200#
201# Memory Technology Devices (MTD)
202#
203CONFIG_MTD=y
204CONFIG_MTD_DEBUG=y
205CONFIG_MTD_DEBUG_VERBOSE=1
206# CONFIG_MTD_CONCAT is not set
207CONFIG_MTD_PARTITIONS=y
208# CONFIG_MTD_REDBOOT_PARTS is not set
209# CONFIG_MTD_CMDLINE_PARTS is not set
210# CONFIG_MTD_AFS_PARTS is not set
211
212#
213# User Modules And Translation Layers
214#
215CONFIG_MTD_CHAR=m
216CONFIG_MTD_BLOCK=y
217# CONFIG_FTL is not set
218# CONFIG_NFTL is not set
219# CONFIG_INFTL is not set
220
221#
222# RAM/ROM/Flash chip drivers
223#
224CONFIG_MTD_CFI=y
225# CONFIG_MTD_JEDECPROBE is not set
226CONFIG_MTD_GEN_PROBE=y
227CONFIG_MTD_CFI_ADV_OPTIONS=y
228CONFIG_MTD_CFI_NOSWAP=y
229# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
230# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
231CONFIG_MTD_CFI_GEOMETRY=y
232CONFIG_MTD_MAP_BANK_WIDTH_1=y
233CONFIG_MTD_MAP_BANK_WIDTH_2=y
234CONFIG_MTD_MAP_BANK_WIDTH_4=y
235# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
236# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
237# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
238CONFIG_MTD_CFI_I1=y
239CONFIG_MTD_CFI_I2=y
240# CONFIG_MTD_CFI_I4 is not set
241# CONFIG_MTD_CFI_I8 is not set
242CONFIG_MTD_CFI_INTELEXT=y
243# CONFIG_MTD_CFI_AMDSTD is not set
244# CONFIG_MTD_CFI_STAA is not set
245CONFIG_MTD_CFI_UTIL=y
246# CONFIG_MTD_RAM is not set
247# CONFIG_MTD_ROM is not set
248# CONFIG_MTD_ABSENT is not set
249# CONFIG_MTD_XIP is not set
250
251#
252# Mapping drivers for chip access
253#
254# CONFIG_MTD_COMPLEX_MAPPINGS is not set
255# CONFIG_MTD_PHYSMAP is not set
256# CONFIG_MTD_ARM_INTEGRATOR is not set
257CONFIG_MTD_SA1100=y
258# CONFIG_MTD_EDB7312 is not set
259
260#
261# Self-contained MTD device drivers
262#
263# CONFIG_MTD_SLRAM is not set
264# CONFIG_MTD_PHRAM is not set
265# CONFIG_MTD_MTDRAM is not set
266# CONFIG_MTD_BLKMTD is not set
267# CONFIG_MTD_BLOCK2MTD is not set
268
269#
270# Disk-On-Chip Device Drivers
271#
272# CONFIG_MTD_DOC2000 is not set
273# CONFIG_MTD_DOC2001 is not set
274# CONFIG_MTD_DOC2001PLUS is not set
275
276#
277# NAND Flash Device Drivers
278#
279# CONFIG_MTD_NAND 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# CONFIG_PNP is not set
290
291#
292# Block devices
293#
294# CONFIG_BLK_DEV_FD is not set
295# CONFIG_BLK_DEV_XD is not set
296# CONFIG_BLK_DEV_COW_COMMON is not set
297CONFIG_BLK_DEV_LOOP=m
298# CONFIG_BLK_DEV_CRYPTOLOOP is not set
299CONFIG_BLK_DEV_NBD=m
300# CONFIG_BLK_DEV_RAM is not set
301CONFIG_BLK_DEV_RAM_COUNT=16
302CONFIG_INITRAMFS_SOURCE=""
303# CONFIG_CDROM_PKTCDVD is not set
304
305#
306# IO Schedulers
307#
308CONFIG_IOSCHED_NOOP=y
309CONFIG_IOSCHED_AS=y
310CONFIG_IOSCHED_DEADLINE=y
311CONFIG_IOSCHED_CFQ=y
312# CONFIG_ATA_OVER_ETH is not set
313
314#
315# ATA/ATAPI/MFM/RLL support
316#
317CONFIG_IDE=m
318CONFIG_BLK_DEV_IDE=m
319
320#
321# Please see Documentation/ide.txt for help/info on IDE drives
322#
323# CONFIG_BLK_DEV_IDE_SATA is not set
324CONFIG_BLK_DEV_IDEDISK=m
325# CONFIG_IDEDISK_MULTI_MODE is not set
326# CONFIG_BLK_DEV_IDECS is not set
327CONFIG_BLK_DEV_IDECD=m
328# CONFIG_BLK_DEV_IDETAPE is not set
329# CONFIG_BLK_DEV_IDEFLOPPY is not set
330# CONFIG_IDE_TASK_IOCTL is not set
331
332#
333# IDE chipset support/bugfixes
334#
335CONFIG_IDE_GENERIC=m
336# CONFIG_IDE_ARM is not set
337# CONFIG_IDE_CHIPSETS is not set
338# CONFIG_BLK_DEV_IDEDMA is not set
339# CONFIG_IDEDMA_AUTO is not set
340# CONFIG_BLK_DEV_HD is not set
341
342#
343# SCSI device support
344#
345# CONFIG_SCSI is not set
346
347#
348# Multi-device support (RAID and LVM)
349#
350# CONFIG_MD is not set
351
352#
353# Fusion MPT device support
354#
355
356#
357# IEEE 1394 (FireWire) support
358#
359
360#
361# I2O device support
362#
363
364#
365# Networking support
366#
367CONFIG_NET=y
368
369#
370# Networking options
371#
372CONFIG_PACKET=y
373CONFIG_PACKET_MMAP=y
374# CONFIG_NETLINK_DEV is not set
375CONFIG_UNIX=y
376# CONFIG_NET_KEY is not set
377CONFIG_INET=y
378CONFIG_IP_MULTICAST=y
379# CONFIG_IP_ADVANCED_ROUTER is not set
380# CONFIG_IP_PNP is not set
381# CONFIG_NET_IPIP is not set
382# CONFIG_NET_IPGRE is not set
383# CONFIG_IP_MROUTE 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
390# CONFIG_IP_TCPDIAG is not set
391# CONFIG_IP_TCPDIAG_IPV6 is not set
392
393#
394# IP: Virtual Server Configuration
395#
396# CONFIG_IP_VS is not set
397# CONFIG_IPV6 is not set
398CONFIG_NETFILTER=y
399# CONFIG_NETFILTER_DEBUG is not set
400
401#
402# IP: Netfilter Configuration
403#
404# CONFIG_IP_NF_CONNTRACK is not set
405# CONFIG_IP_NF_CONNTRACK_MARK is not set
406# CONFIG_IP_NF_QUEUE is not set
407# CONFIG_IP_NF_IPTABLES is not set
408# CONFIG_IP_NF_ARPTABLES is not set
409
410#
411# SCTP Configuration (EXPERIMENTAL)
412#
413# CONFIG_IP_SCTP is not set
414# CONFIG_ATM is not set
415# CONFIG_BRIDGE is not set
416# CONFIG_VLAN_8021Q is not set
417# CONFIG_DECNET is not set
418# CONFIG_LLC2 is not set
419# CONFIG_IPX is not set
420# CONFIG_ATALK is not set
421# CONFIG_X25 is not set
422# CONFIG_LAPB is not set
423# CONFIG_NET_DIVERT is not set
424# CONFIG_ECONET is not set
425# CONFIG_WAN_ROUTER is not set
426
427#
428# QoS and/or fair queueing
429#
430# CONFIG_NET_SCHED is not set
431# CONFIG_NET_CLS_ROUTE is not set
432
433#
434# Network testing
435#
436# CONFIG_NET_PKTGEN is not set
437# CONFIG_NETPOLL is not set
438# CONFIG_NET_POLL_CONTROLLER is not set
439# CONFIG_HAMRADIO is not set
440CONFIG_IRDA=m
441
442#
443# IrDA protocols
444#
445CONFIG_IRLAN=m
446# CONFIG_IRNET is not set
447CONFIG_IRCOMM=m
448# CONFIG_IRDA_ULTRA is not set
449
450#
451# IrDA options
452#
453# CONFIG_IRDA_CACHE_LAST_LSAP is not set
454# CONFIG_IRDA_FAST_RR is not set
455# CONFIG_IRDA_DEBUG is not set
456
457#
458# Infrared-port device drivers
459#
460
461#
462# SIR device drivers
463#
464# CONFIG_IRTTY_SIR is not set
465
466#
467# Dongle support
468#
469
470#
471# Old SIR device drivers
472#
473# CONFIG_IRPORT_SIR is not set
474
475#
476# Old Serial dongle support
477#
478
479#
480# FIR device drivers
481#
482# CONFIG_NSC_FIR is not set
483# CONFIG_WINBOND_FIR is not set
484# CONFIG_SMC_IRCC_FIR is not set
485# CONFIG_ALI_FIR is not set
486CONFIG_SA1100_FIR=m
487# CONFIG_BT is not set
488CONFIG_NETDEVICES=y
489# CONFIG_DUMMY is not set
490# CONFIG_BONDING is not set
491# CONFIG_EQUALIZER is not set
492# CONFIG_TUN is not set
493
494#
495# ARCnet devices
496#
497# CONFIG_ARCNET is not set
498
499#
500# Ethernet (10 or 100Mbit)
501#
502# CONFIG_NET_ETHERNET is not set
503CONFIG_MII=m
504
505#
506# Ethernet (1000 Mbit)
507#
508
509#
510# Ethernet (10000 Mbit)
511#
512
513#
514# Token Ring devices
515#
516# CONFIG_TR is not set
517
518#
519# Wireless LAN (non-hamradio)
520#
521CONFIG_NET_RADIO=y
522
523#
524# Obsolete Wireless cards support (pre-802.11)
525#
526# CONFIG_STRIP is not set
527CONFIG_ARLAN=m
528CONFIG_WAVELAN=m
529CONFIG_PCMCIA_WAVELAN=m
530# CONFIG_PCMCIA_NETWAVE is not set
531
532#
533# Wireless 802.11 Frequency Hopping cards support
534#
535# CONFIG_PCMCIA_RAYCS is not set
536
537#
538# Wireless 802.11b ISA/PCI cards support
539#
540CONFIG_HERMES=m
541# CONFIG_ATMEL is not set
542
543#
544# Wireless 802.11b Pcmcia/Cardbus cards support
545#
546CONFIG_PCMCIA_HERMES=m
547CONFIG_AIRO_CS=m
548# CONFIG_PCMCIA_WL3501 is not set
549CONFIG_NET_WIRELESS=y
550
551#
552# PCMCIA network device support
553#
554CONFIG_NET_PCMCIA=y
555CONFIG_PCMCIA_3C589=m
556CONFIG_PCMCIA_3C574=m
557CONFIG_PCMCIA_FMVJ18X=m
558CONFIG_PCMCIA_PCNET=m
559CONFIG_PCMCIA_NMCLAN=m
560CONFIG_PCMCIA_SMC91C92=m
561CONFIG_PCMCIA_XIRC2PS=m
562CONFIG_PCMCIA_AXNET=m
563
564#
565# Wan interfaces
566#
567# CONFIG_WAN is not set
568CONFIG_PPP=m
569# CONFIG_PPP_MULTILINK is not set
570# CONFIG_PPP_FILTER is not set
571CONFIG_PPP_ASYNC=m
572# CONFIG_PPP_SYNC_TTY is not set
573CONFIG_PPP_DEFLATE=m
574CONFIG_PPP_BSDCOMP=m
575# CONFIG_PPPOE is not set
576# CONFIG_SLIP is not set
577# CONFIG_SHAPER is not set
578# CONFIG_NETCONSOLE is not set
579
580#
581# ISDN subsystem
582#
583# CONFIG_ISDN is not set
584
585#
586# Input device support
587#
588CONFIG_INPUT=y
589
590#
591# Userland interfaces
592#
593CONFIG_INPUT_MOUSEDEV=y
594CONFIG_INPUT_MOUSEDEV_PSAUX=y
595CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
596CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
597# CONFIG_INPUT_JOYDEV is not set
598# CONFIG_INPUT_TSDEV is not set
599# CONFIG_INPUT_EVDEV is not set
600# CONFIG_INPUT_EVBUG is not set
601
602#
603# Input Device Drivers
604#
605CONFIG_INPUT_KEYBOARD=y
606CONFIG_KEYBOARD_ATKBD=y
607# CONFIG_KEYBOARD_SUNKBD is not set
608# CONFIG_KEYBOARD_LKKBD is not set
609# CONFIG_KEYBOARD_XTKBD is not set
610# CONFIG_KEYBOARD_NEWTON is not set
611CONFIG_INPUT_MOUSE=y
612CONFIG_MOUSE_PS2=y
613# CONFIG_MOUSE_SERIAL is not set
614# CONFIG_MOUSE_INPORT is not set
615# CONFIG_MOUSE_LOGIBM is not set
616# CONFIG_MOUSE_PC110PAD is not set
617# CONFIG_MOUSE_VSXXXAA is not set
618# CONFIG_INPUT_JOYSTICK is not set
619# CONFIG_INPUT_TOUCHSCREEN is not set
620# CONFIG_INPUT_MISC is not set
621
622#
623# Hardware I/O ports
624#
625CONFIG_SERIO=y
626CONFIG_SERIO_SERPORT=y
627# CONFIG_SERIO_SA1111 is not set
628CONFIG_SERIO_LIBPS2=y
629# CONFIG_SERIO_RAW is not set
630# CONFIG_GAMEPORT is not set
631CONFIG_SOUND_GAMEPORT=y
632
633#
634# Character devices
635#
636CONFIG_VT=y
637CONFIG_VT_CONSOLE=y
638CONFIG_HW_CONSOLE=y
639# CONFIG_SERIAL_NONSTANDARD is not set
640
641#
642# Serial drivers
643#
644# CONFIG_SERIAL_8250 is not set
645
646#
647# Non-8250 serial port support
648#
649CONFIG_SERIAL_SA1100=y
650CONFIG_SERIAL_SA1100_CONSOLE=y
651CONFIG_SERIAL_CORE=y
652CONFIG_SERIAL_CORE_CONSOLE=y
653CONFIG_UNIX98_PTYS=y
654CONFIG_LEGACY_PTYS=y
655CONFIG_LEGACY_PTY_COUNT=256
656
657#
658# IPMI
659#
660# CONFIG_IPMI_HANDLER is not set
661
662#
663# Watchdog Cards
664#
665# CONFIG_WATCHDOG is not set
666# CONFIG_NVRAM is not set
667# CONFIG_RTC is not set
668# CONFIG_DTLK is not set
669# CONFIG_R3964 is not set
670
671#
672# Ftape, the floppy tape device driver
673#
674# CONFIG_DRM is not set
675
676#
677# PCMCIA character devices
678#
679# CONFIG_SYNCLINK_CS is not set
680# CONFIG_RAW_DRIVER is not set
681
682#
683# TPM devices
684#
685# CONFIG_TCG_TPM is not set
686
687#
688# I2C support
689#
690# CONFIG_I2C is not set
691
692#
693# Misc devices
694#
695
696#
697# Multimedia devices
698#
699# CONFIG_VIDEO_DEV is not set
700
701#
702# Digital Video Broadcasting Devices
703#
704# CONFIG_DVB is not set
705
706#
707# Graphics support
708#
709CONFIG_FB=y
710# CONFIG_FB_CFB_FILLRECT is not set
711# CONFIG_FB_CFB_COPYAREA is not set
712# CONFIG_FB_CFB_IMAGEBLIT is not set
713# CONFIG_FB_SOFT_CURSOR is not set
714# CONFIG_FB_MODE_HELPERS is not set
715# CONFIG_FB_TILEBLITTING is not set
716# CONFIG_FB_SA1100 is not set
717# CONFIG_FB_VIRTUAL is not set
718
719#
720# Console display driver support
721#
722# CONFIG_VGA_CONSOLE is not set
723# CONFIG_MDA_CONSOLE is not set
724CONFIG_DUMMY_CONSOLE=y
725# CONFIG_FRAMEBUFFER_CONSOLE is not set
726
727#
728# Logo configuration
729#
730# CONFIG_LOGO is not set
731# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
732
733#
734# Sound
735#
736CONFIG_SOUND=m
737
738#
739# Advanced Linux Sound Architecture
740#
741# CONFIG_SND is not set
742
743#
744# Open Sound System
745#
746# CONFIG_SOUND_PRIME is not set
747
748#
749# USB support
750#
751CONFIG_USB_ARCH_HAS_HCD=y
752CONFIG_USB_ARCH_HAS_OHCI=y
753# CONFIG_USB is not set
754
755#
756# USB Gadget Support
757#
758# CONFIG_USB_GADGET is not set
759
760#
761# MMC/SD Card support
762#
763# CONFIG_MMC is not set
764
765#
766# File systems
767#
768CONFIG_EXT2_FS=y
769# CONFIG_EXT2_FS_XATTR is not set
770# CONFIG_EXT3_FS is not set
771# CONFIG_JBD is not set
772# CONFIG_REISERFS_FS is not set
773# CONFIG_JFS_FS is not set
774
775#
776# XFS support
777#
778# CONFIG_XFS_FS is not set
779# CONFIG_MINIX_FS is not set
780# CONFIG_ROMFS_FS is not set
781# CONFIG_QUOTA is not set
782CONFIG_DNOTIFY=y
783# CONFIG_AUTOFS_FS is not set
784# CONFIG_AUTOFS4_FS is not set
785
786#
787# CD-ROM/DVD Filesystems
788#
789CONFIG_ISO9660_FS=m
790# CONFIG_JOLIET is not set
791# CONFIG_ZISOFS is not set
792# CONFIG_UDF_FS is not set
793
794#
795# DOS/FAT/NT Filesystems
796#
797# CONFIG_MSDOS_FS is not set
798# CONFIG_VFAT_FS is not set
799# CONFIG_NTFS_FS is not set
800
801#
802# Pseudo filesystems
803#
804CONFIG_PROC_FS=y
805CONFIG_SYSFS=y
806CONFIG_DEVFS_FS=y
807CONFIG_DEVFS_MOUNT=y
808CONFIG_DEVFS_DEBUG=y
809# CONFIG_DEVPTS_FS_XATTR is not set
810# CONFIG_TMPFS is not set
811# CONFIG_HUGETLB_PAGE is not set
812CONFIG_RAMFS=y
813
814#
815# Miscellaneous filesystems
816#
817# CONFIG_ADFS_FS is not set
818# CONFIG_AFFS_FS is not set
819# CONFIG_HFS_FS is not set
820# CONFIG_HFSPLUS_FS is not set
821# CONFIG_BEFS_FS is not set
822# CONFIG_BFS_FS is not set
823# CONFIG_EFS_FS is not set
824# CONFIG_JFFS_FS is not set
825CONFIG_JFFS2_FS=y
826CONFIG_JFFS2_FS_DEBUG=2
827# CONFIG_JFFS2_FS_NAND is not set
828# CONFIG_JFFS2_FS_NOR_ECC is not set
829# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
830CONFIG_JFFS2_ZLIB=y
831CONFIG_JFFS2_RTIME=y
832# CONFIG_JFFS2_RUBIN is not set
833# CONFIG_CRAMFS is not set
834# CONFIG_VXFS_FS is not set
835# CONFIG_HPFS_FS is not set
836# CONFIG_QNX4FS_FS is not set
837# CONFIG_SYSV_FS is not set
838# CONFIG_UFS_FS is not set
839
840#
841# Network File Systems
842#
843CONFIG_NFS_FS=m
844CONFIG_NFS_V3=y
845# CONFIG_NFS_V4 is not set
846# CONFIG_NFS_DIRECTIO is not set
847# CONFIG_NFSD is not set
848CONFIG_LOCKD=m
849CONFIG_LOCKD_V4=y
850CONFIG_SUNRPC=m
851# CONFIG_RPCSEC_GSS_KRB5 is not set
852# CONFIG_RPCSEC_GSS_SPKM3 is not set
853# CONFIG_SMB_FS is not set
854# CONFIG_CIFS is not set
855# CONFIG_NCP_FS is not set
856# CONFIG_CODA_FS is not set
857# CONFIG_AFS_FS is not set
858
859#
860# Partition Types
861#
862# CONFIG_PARTITION_ADVANCED is not set
863CONFIG_MSDOS_PARTITION=y
864
865#
866# Native Language Support
867#
868# CONFIG_NLS is not set
869
870#
871# Profiling support
872#
873# CONFIG_PROFILING is not set
874
875#
876# Kernel hacking
877#
878# CONFIG_PRINTK_TIME is not set
879CONFIG_DEBUG_KERNEL=y
880# CONFIG_MAGIC_SYSRQ is not set
881CONFIG_LOG_BUF_SHIFT=14
882# CONFIG_SCHEDSTATS is not set
883CONFIG_DEBUG_SLAB=y
884# CONFIG_DEBUG_SPINLOCK is not set
885# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
886# CONFIG_DEBUG_KOBJECT is not set
887CONFIG_DEBUG_BUGVERBOSE=y
888# CONFIG_DEBUG_INFO is not set
889# CONFIG_DEBUG_FS is not set
890CONFIG_FRAME_POINTER=y
891# CONFIG_DEBUG_USER is not set
892# CONFIG_DEBUG_WAITQ is not set
893CONFIG_DEBUG_ERRORS=y
894CONFIG_DEBUG_LL=y
895# CONFIG_DEBUG_ICEDCC is not set
896
897#
898# Security options
899#
900# CONFIG_KEYS is not set
901# CONFIG_SECURITY is not set
902
903#
904# Cryptographic options
905#
906# CONFIG_CRYPTO is not set
907
908#
909# Hardware crypto devices
910#
911
912#
913# Library routines
914#
915CONFIG_CRC_CCITT=m
916CONFIG_CRC32=y
917# CONFIG_LIBCRC32C is not set
918CONFIG_ZLIB_INFLATE=y
919CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/lart_defconfig b/arch/arm/configs/lart_defconfig
new file mode 100644
index 000000000000..7033829ed145
--- /dev/null
+++ b/arch/arm/configs/lart_defconfig
@@ -0,0 +1,877 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 23:53:24 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51CONFIG_MODULES=y
52# CONFIG_MODULE_UNLOAD is not set
53CONFIG_OBSOLETE_MODPARM=y
54# CONFIG_MODVERSIONS is not set
55# CONFIG_MODULE_SRCVERSION_ALL is not set
56CONFIG_KMOD=y
57
58#
59# System Type
60#
61# CONFIG_ARCH_CLPS7500 is not set
62# CONFIG_ARCH_CLPS711X is not set
63# CONFIG_ARCH_CO285 is not set
64# CONFIG_ARCH_EBSA110 is not set
65# CONFIG_ARCH_CAMELOT is not set
66# CONFIG_ARCH_FOOTBRIDGE is not set
67# CONFIG_ARCH_INTEGRATOR is not set
68# CONFIG_ARCH_IOP3XX is not set
69# CONFIG_ARCH_IXP4XX is not set
70# CONFIG_ARCH_IXP2000 is not set
71# CONFIG_ARCH_L7200 is not set
72# CONFIG_ARCH_PXA is not set
73# CONFIG_ARCH_RPC is not set
74CONFIG_ARCH_SA1100=y
75# CONFIG_ARCH_S3C2410 is not set
76# CONFIG_ARCH_SHARK is not set
77# CONFIG_ARCH_LH7A40X is not set
78# CONFIG_ARCH_OMAP is not set
79# CONFIG_ARCH_VERSATILE is not set
80# CONFIG_ARCH_IMX is not set
81# CONFIG_ARCH_H720X is not set
82
83#
84# SA11x0 Implementations
85#
86# CONFIG_SA1100_ASSABET is not set
87# CONFIG_SA1100_CERF is not set
88# CONFIG_SA1100_COLLIE is not set
89# CONFIG_SA1100_H3100 is not set
90# CONFIG_SA1100_H3600 is not set
91# CONFIG_SA1100_H3800 is not set
92# CONFIG_SA1100_BADGE4 is not set
93# CONFIG_SA1100_JORNADA720 is not set
94# CONFIG_SA1100_HACKKIT is not set
95CONFIG_SA1100_LART=y
96# CONFIG_SA1100_PLEB is not set
97# CONFIG_SA1100_SHANNON is not set
98# CONFIG_SA1100_SIMPAD is not set
99# CONFIG_SA1100_SSP is not set
100
101#
102# Processor Type
103#
104CONFIG_CPU_32=y
105CONFIG_CPU_SA1100=y
106CONFIG_CPU_32v4=y
107CONFIG_CPU_ABRT_EV4=y
108CONFIG_CPU_CACHE_V4WB=y
109CONFIG_CPU_CACHE_VIVT=y
110CONFIG_CPU_TLB_V4WB=y
111CONFIG_CPU_MINICACHE=y
112
113#
114# Processor Features
115#
116
117#
118# Bus support
119#
120CONFIG_ISA=y
121
122#
123# PCCARD (PCMCIA/CardBus) support
124#
125# CONFIG_PCCARD is not set
126
127#
128# Kernel Features
129#
130# CONFIG_PREEMPT is not set
131CONFIG_DISCONTIGMEM=y
132CONFIG_LEDS=y
133# CONFIG_LEDS_TIMER is not set
134CONFIG_LEDS_CPU=y
135CONFIG_ALIGNMENT_TRAP=y
136
137#
138# Boot options
139#
140CONFIG_ZBOOT_ROM_TEXT=0x0
141CONFIG_ZBOOT_ROM_BSS=0x0
142CONFIG_CMDLINE="console=ttySA0,9600 root=/dev/ram"
143# CONFIG_XIP_KERNEL is not set
144
145#
146# CPU Frequency scaling
147#
148CONFIG_CPU_FREQ=y
149CONFIG_CPU_FREQ_TABLE=y
150# CONFIG_CPU_FREQ_DEBUG is not set
151CONFIG_CPU_FREQ_STAT=y
152# CONFIG_CPU_FREQ_STAT_DETAILS is not set
153CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
154# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
155CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
156# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
157CONFIG_CPU_FREQ_GOV_USERSPACE=y
158# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
159CONFIG_CPU_FREQ_SA1100=y
160
161#
162# Floating point emulation
163#
164
165#
166# At least one emulation must be selected
167#
168CONFIG_FPE_NWFPE=y
169# CONFIG_FPE_NWFPE_XP is not set
170# CONFIG_FPE_FASTFPE is not set
171
172#
173# Userspace binary formats
174#
175CONFIG_BINFMT_ELF=y
176CONFIG_BINFMT_AOUT=y
177# CONFIG_BINFMT_MISC is not set
178# CONFIG_ARTHUR is not set
179
180#
181# Power management options
182#
183CONFIG_PM=y
184CONFIG_APM=m
185
186#
187# Device Drivers
188#
189
190#
191# Generic Driver Options
192#
193CONFIG_STANDALONE=y
194CONFIG_PREVENT_FIRMWARE_BUILD=y
195# CONFIG_FW_LOADER is not set
196
197#
198# Memory Technology Devices (MTD)
199#
200CONFIG_MTD=y
201CONFIG_MTD_DEBUG=y
202CONFIG_MTD_DEBUG_VERBOSE=1
203# CONFIG_MTD_CONCAT is not set
204CONFIG_MTD_PARTITIONS=y
205# CONFIG_MTD_REDBOOT_PARTS is not set
206# CONFIG_MTD_CMDLINE_PARTS is not set
207# CONFIG_MTD_AFS_PARTS is not set
208
209#
210# User Modules And Translation Layers
211#
212CONFIG_MTD_CHAR=y
213CONFIG_MTD_BLOCK=y
214# CONFIG_FTL is not set
215# CONFIG_NFTL is not set
216# CONFIG_INFTL is not set
217
218#
219# RAM/ROM/Flash chip drivers
220#
221# CONFIG_MTD_CFI is not set
222# CONFIG_MTD_JEDECPROBE is not set
223CONFIG_MTD_MAP_BANK_WIDTH_1=y
224CONFIG_MTD_MAP_BANK_WIDTH_2=y
225CONFIG_MTD_MAP_BANK_WIDTH_4=y
226# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
227# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
228# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
229CONFIG_MTD_CFI_I1=y
230CONFIG_MTD_CFI_I2=y
231# CONFIG_MTD_CFI_I4 is not set
232# CONFIG_MTD_CFI_I8 is not set
233# CONFIG_MTD_RAM is not set
234# CONFIG_MTD_ROM is not set
235# CONFIG_MTD_ABSENT is not set
236
237#
238# Mapping drivers for chip access
239#
240# CONFIG_MTD_COMPLEX_MAPPINGS is not set
241
242#
243# Self-contained MTD device drivers
244#
245# CONFIG_MTD_SLRAM is not set
246# CONFIG_MTD_PHRAM is not set
247CONFIG_MTD_LART=y
248# CONFIG_MTD_MTDRAM is not set
249# CONFIG_MTD_BLKMTD is not set
250# CONFIG_MTD_BLOCK2MTD is not set
251
252#
253# Disk-On-Chip Device Drivers
254#
255# CONFIG_MTD_DOC2000 is not set
256# CONFIG_MTD_DOC2001 is not set
257# CONFIG_MTD_DOC2001PLUS is not set
258
259#
260# NAND Flash Device Drivers
261#
262# CONFIG_MTD_NAND is not set
263
264#
265# Parallel port support
266#
267# CONFIG_PARPORT is not set
268
269#
270# Plug and Play support
271#
272# CONFIG_PNP is not set
273
274#
275# Block devices
276#
277# CONFIG_BLK_DEV_FD is not set
278# CONFIG_BLK_DEV_XD is not set
279# CONFIG_BLK_DEV_COW_COMMON is not set
280# CONFIG_BLK_DEV_LOOP is not set
281# CONFIG_BLK_DEV_NBD is not set
282CONFIG_BLK_DEV_RAM=y
283CONFIG_BLK_DEV_RAM_COUNT=16
284CONFIG_BLK_DEV_RAM_SIZE=4096
285CONFIG_BLK_DEV_INITRD=y
286CONFIG_INITRAMFS_SOURCE=""
287# CONFIG_CDROM_PKTCDVD is not set
288
289#
290# IO Schedulers
291#
292CONFIG_IOSCHED_NOOP=y
293CONFIG_IOSCHED_AS=y
294CONFIG_IOSCHED_DEADLINE=y
295CONFIG_IOSCHED_CFQ=y
296# CONFIG_ATA_OVER_ETH is not set
297
298#
299# ATA/ATAPI/MFM/RLL support
300#
301CONFIG_IDE=m
302CONFIG_BLK_DEV_IDE=m
303
304#
305# Please see Documentation/ide.txt for help/info on IDE drives
306#
307# CONFIG_BLK_DEV_IDE_SATA is not set
308CONFIG_BLK_DEV_IDEDISK=m
309# CONFIG_IDEDISK_MULTI_MODE is not set
310CONFIG_BLK_DEV_IDECD=m
311# CONFIG_BLK_DEV_IDETAPE is not set
312# CONFIG_BLK_DEV_IDEFLOPPY is not set
313# CONFIG_IDE_TASK_IOCTL is not set
314
315#
316# IDE chipset support/bugfixes
317#
318CONFIG_IDE_GENERIC=m
319# CONFIG_IDE_ARM is not set
320# CONFIG_IDE_CHIPSETS is not set
321# CONFIG_BLK_DEV_IDEDMA is not set
322# CONFIG_IDEDMA_AUTO is not set
323# CONFIG_BLK_DEV_HD is not set
324
325#
326# SCSI device support
327#
328# CONFIG_SCSI is not set
329
330#
331# Multi-device support (RAID and LVM)
332#
333# CONFIG_MD is not set
334
335#
336# Fusion MPT device support
337#
338
339#
340# IEEE 1394 (FireWire) support
341#
342
343#
344# I2O device support
345#
346
347#
348# Networking support
349#
350CONFIG_NET=y
351
352#
353# Networking options
354#
355CONFIG_PACKET=m
356# CONFIG_PACKET_MMAP is not set
357# CONFIG_NETLINK_DEV is not set
358CONFIG_UNIX=y
359# CONFIG_NET_KEY is not set
360CONFIG_INET=y
361# CONFIG_IP_MULTICAST is not set
362# CONFIG_IP_ADVANCED_ROUTER is not set
363# CONFIG_IP_PNP is not set
364# CONFIG_NET_IPIP is not set
365# CONFIG_NET_IPGRE is not set
366# CONFIG_ARPD is not set
367CONFIG_SYN_COOKIES=y
368# CONFIG_INET_AH is not set
369# CONFIG_INET_ESP is not set
370# CONFIG_INET_IPCOMP is not set
371# CONFIG_INET_TUNNEL is not set
372CONFIG_IP_TCPDIAG=y
373# CONFIG_IP_TCPDIAG_IPV6 is not set
374# CONFIG_IPV6 is not set
375# CONFIG_NETFILTER is not set
376
377#
378# SCTP Configuration (EXPERIMENTAL)
379#
380# CONFIG_IP_SCTP is not set
381# CONFIG_ATM is not set
382# CONFIG_BRIDGE is not set
383# CONFIG_VLAN_8021Q is not set
384# CONFIG_DECNET is not set
385# CONFIG_LLC2 is not set
386# CONFIG_IPX is not set
387# CONFIG_ATALK is not set
388# CONFIG_X25 is not set
389# CONFIG_LAPB is not set
390# CONFIG_NET_DIVERT is not set
391# CONFIG_ECONET is not set
392# CONFIG_WAN_ROUTER is not set
393
394#
395# QoS and/or fair queueing
396#
397# CONFIG_NET_SCHED is not set
398# CONFIG_NET_CLS_ROUTE is not set
399
400#
401# Network testing
402#
403# CONFIG_NET_PKTGEN is not set
404# CONFIG_NETPOLL is not set
405# CONFIG_NET_POLL_CONTROLLER is not set
406# CONFIG_HAMRADIO is not set
407CONFIG_IRDA=m
408
409#
410# IrDA protocols
411#
412CONFIG_IRLAN=m
413CONFIG_IRNET=m
414CONFIG_IRCOMM=m
415# CONFIG_IRDA_ULTRA is not set
416
417#
418# IrDA options
419#
420CONFIG_IRDA_CACHE_LAST_LSAP=y
421# CONFIG_IRDA_FAST_RR is not set
422CONFIG_IRDA_DEBUG=y
423
424#
425# Infrared-port device drivers
426#
427
428#
429# SIR device drivers
430#
431# CONFIG_IRTTY_SIR is not set
432
433#
434# Dongle support
435#
436
437#
438# Old SIR device drivers
439#
440# CONFIG_IRPORT_SIR is not set
441
442#
443# Old Serial dongle support
444#
445
446#
447# FIR device drivers
448#
449# CONFIG_NSC_FIR is not set
450# CONFIG_WINBOND_FIR is not set
451# CONFIG_SMC_IRCC_FIR is not set
452# CONFIG_ALI_FIR is not set
453CONFIG_SA1100_FIR=m
454# CONFIG_BT is not set
455CONFIG_NETDEVICES=y
456CONFIG_DUMMY=m
457# CONFIG_BONDING is not set
458# CONFIG_EQUALIZER is not set
459# CONFIG_TUN is not set
460
461#
462# ARCnet devices
463#
464# CONFIG_ARCNET is not set
465
466#
467# Ethernet (10 or 100Mbit)
468#
469CONFIG_NET_ETHERNET=y
470# CONFIG_MII is not set
471# CONFIG_NET_VENDOR_3COM is not set
472# CONFIG_LANCE is not set
473# CONFIG_NET_VENDOR_SMC is not set
474# CONFIG_SMC91X is not set
475# CONFIG_NET_VENDOR_RACAL is not set
476# CONFIG_AT1700 is not set
477# CONFIG_DEPCA is not set
478# CONFIG_HP100 is not set
479# CONFIG_NET_ISA is not set
480# CONFIG_NET_PCI is not set
481# CONFIG_NET_POCKET is not set
482
483#
484# Ethernet (1000 Mbit)
485#
486
487#
488# Ethernet (10000 Mbit)
489#
490
491#
492# Token Ring devices
493#
494# CONFIG_TR is not set
495
496#
497# Wireless LAN (non-hamradio)
498#
499# CONFIG_NET_RADIO is not set
500
501#
502# Wan interfaces
503#
504# CONFIG_WAN is not set
505CONFIG_PPP=m
506# CONFIG_PPP_MULTILINK is not set
507# CONFIG_PPP_FILTER is not set
508CONFIG_PPP_ASYNC=m
509# CONFIG_PPP_SYNC_TTY is not set
510CONFIG_PPP_DEFLATE=m
511CONFIG_PPP_BSDCOMP=m
512# CONFIG_PPPOE is not set
513CONFIG_SLIP=m
514CONFIG_SLIP_COMPRESSED=y
515# CONFIG_SLIP_SMART is not set
516# CONFIG_SLIP_MODE_SLIP6 is not set
517# CONFIG_SHAPER is not set
518# CONFIG_NETCONSOLE is not set
519
520#
521# ISDN subsystem
522#
523# CONFIG_ISDN is not set
524
525#
526# Input device support
527#
528CONFIG_INPUT=y
529
530#
531# Userland interfaces
532#
533CONFIG_INPUT_MOUSEDEV=y
534CONFIG_INPUT_MOUSEDEV_PSAUX=y
535CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
536CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
537# CONFIG_INPUT_JOYDEV is not set
538# CONFIG_INPUT_TSDEV is not set
539# CONFIG_INPUT_EVDEV is not set
540# CONFIG_INPUT_EVBUG is not set
541
542#
543# Input Device Drivers
544#
545CONFIG_INPUT_KEYBOARD=y
546CONFIG_KEYBOARD_ATKBD=y
547# CONFIG_KEYBOARD_SUNKBD is not set
548# CONFIG_KEYBOARD_LKKBD is not set
549# CONFIG_KEYBOARD_XTKBD is not set
550# CONFIG_KEYBOARD_NEWTON is not set
551CONFIG_INPUT_MOUSE=y
552CONFIG_MOUSE_PS2=y
553# CONFIG_MOUSE_SERIAL is not set
554# CONFIG_MOUSE_INPORT is not set
555# CONFIG_MOUSE_LOGIBM is not set
556# CONFIG_MOUSE_PC110PAD is not set
557# CONFIG_MOUSE_VSXXXAA is not set
558# CONFIG_INPUT_JOYSTICK is not set
559# CONFIG_INPUT_TOUCHSCREEN is not set
560# CONFIG_INPUT_MISC is not set
561
562#
563# Hardware I/O ports
564#
565CONFIG_SERIO=y
566CONFIG_SERIO_SERPORT=y
567CONFIG_SERIO_LIBPS2=y
568# CONFIG_SERIO_RAW is not set
569# CONFIG_GAMEPORT is not set
570CONFIG_SOUND_GAMEPORT=y
571
572#
573# Character devices
574#
575CONFIG_VT=y
576CONFIG_VT_CONSOLE=y
577CONFIG_HW_CONSOLE=y
578# CONFIG_SERIAL_NONSTANDARD is not set
579
580#
581# Serial drivers
582#
583# CONFIG_SERIAL_8250 is not set
584
585#
586# Non-8250 serial port support
587#
588CONFIG_SERIAL_SA1100=y
589CONFIG_SERIAL_SA1100_CONSOLE=y
590CONFIG_SERIAL_CORE=y
591CONFIG_SERIAL_CORE_CONSOLE=y
592CONFIG_UNIX98_PTYS=y
593CONFIG_LEGACY_PTYS=y
594CONFIG_LEGACY_PTY_COUNT=256
595
596#
597# IPMI
598#
599# CONFIG_IPMI_HANDLER is not set
600
601#
602# Watchdog Cards
603#
604# CONFIG_WATCHDOG is not set
605# CONFIG_NVRAM is not set
606# CONFIG_RTC is not set
607# CONFIG_DTLK is not set
608# CONFIG_R3964 is not set
609
610#
611# Ftape, the floppy tape device driver
612#
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# Misc devices
628#
629
630#
631# Multimedia devices
632#
633# CONFIG_VIDEO_DEV is not set
634
635#
636# Digital Video Broadcasting Devices
637#
638# CONFIG_DVB is not set
639
640#
641# Graphics support
642#
643# CONFIG_FB is not set
644
645#
646# Console display driver support
647#
648# CONFIG_VGA_CONSOLE is not set
649# CONFIG_MDA_CONSOLE is not set
650CONFIG_DUMMY_CONSOLE=y
651
652#
653# Sound
654#
655CONFIG_SOUND=m
656
657#
658# Advanced Linux Sound Architecture
659#
660# CONFIG_SND is not set
661
662#
663# Open Sound System
664#
665# CONFIG_SOUND_PRIME is not set
666
667#
668# USB support
669#
670CONFIG_USB_ARCH_HAS_HCD=y
671# CONFIG_USB_ARCH_HAS_OHCI is not set
672# CONFIG_USB is not set
673
674#
675# USB Gadget Support
676#
677# CONFIG_USB_GADGET is not set
678
679#
680# MMC/SD Card support
681#
682# CONFIG_MMC is not set
683
684#
685# File systems
686#
687CONFIG_EXT2_FS=y
688# CONFIG_EXT2_FS_XATTR is not set
689CONFIG_EXT3_FS=m
690CONFIG_EXT3_FS_XATTR=y
691# CONFIG_EXT3_FS_POSIX_ACL is not set
692# CONFIG_EXT3_FS_SECURITY is not set
693CONFIG_JBD=m
694# CONFIG_JBD_DEBUG is not set
695CONFIG_FS_MBCACHE=y
696CONFIG_REISERFS_FS=m
697# CONFIG_REISERFS_CHECK is not set
698# CONFIG_REISERFS_PROC_INFO is not set
699# CONFIG_REISERFS_FS_XATTR is not set
700# CONFIG_JFS_FS is not set
701
702#
703# XFS support
704#
705# CONFIG_XFS_FS is not set
706# CONFIG_MINIX_FS is not set
707# CONFIG_ROMFS_FS is not set
708# CONFIG_QUOTA is not set
709CONFIG_DNOTIFY=y
710# CONFIG_AUTOFS_FS is not set
711# CONFIG_AUTOFS4_FS is not set
712
713#
714# CD-ROM/DVD Filesystems
715#
716CONFIG_ISO9660_FS=m
717CONFIG_JOLIET=y
718# CONFIG_ZISOFS is not set
719CONFIG_UDF_FS=m
720CONFIG_UDF_NLS=y
721
722#
723# DOS/FAT/NT Filesystems
724#
725# CONFIG_MSDOS_FS is not set
726# CONFIG_VFAT_FS is not set
727# CONFIG_NTFS_FS is not set
728
729#
730# Pseudo filesystems
731#
732CONFIG_PROC_FS=y
733CONFIG_SYSFS=y
734# CONFIG_DEVFS_FS is not set
735# CONFIG_DEVPTS_FS_XATTR is not set
736CONFIG_TMPFS=y
737# CONFIG_TMPFS_XATTR is not set
738# CONFIG_HUGETLB_PAGE is not set
739CONFIG_RAMFS=y
740
741#
742# Miscellaneous filesystems
743#
744# CONFIG_ADFS_FS is not set
745# CONFIG_AFFS_FS is not set
746# CONFIG_HFS_FS is not set
747# CONFIG_HFSPLUS_FS is not set
748# CONFIG_BEFS_FS is not set
749# CONFIG_BFS_FS is not set
750# CONFIG_EFS_FS is not set
751# CONFIG_JFFS_FS is not set
752CONFIG_JFFS2_FS=m
753CONFIG_JFFS2_FS_DEBUG=1
754# CONFIG_JFFS2_FS_NAND is not set
755# CONFIG_JFFS2_FS_NOR_ECC is not set
756# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
757CONFIG_JFFS2_ZLIB=y
758CONFIG_JFFS2_RTIME=y
759# CONFIG_JFFS2_RUBIN is not set
760CONFIG_CRAMFS=m
761# CONFIG_VXFS_FS is not set
762# CONFIG_HPFS_FS is not set
763# CONFIG_QNX4FS_FS is not set
764# CONFIG_SYSV_FS is not set
765# CONFIG_UFS_FS is not set
766
767#
768# Network File Systems
769#
770CONFIG_NFS_FS=m
771CONFIG_NFS_V3=y
772# CONFIG_NFS_V4 is not set
773# CONFIG_NFS_DIRECTIO is not set
774CONFIG_NFSD=m
775CONFIG_NFSD_V3=y
776# CONFIG_NFSD_V4 is not set
777# CONFIG_NFSD_TCP is not set
778CONFIG_LOCKD=m
779CONFIG_LOCKD_V4=y
780CONFIG_EXPORTFS=m
781CONFIG_SUNRPC=m
782# CONFIG_RPCSEC_GSS_KRB5 is not set
783# CONFIG_RPCSEC_GSS_SPKM3 is not set
784# CONFIG_SMB_FS is not set
785# CONFIG_CIFS is not set
786# CONFIG_NCP_FS is not set
787# CONFIG_CODA_FS is not set
788# CONFIG_AFS_FS is not set
789
790#
791# Partition Types
792#
793# CONFIG_PARTITION_ADVANCED is not set
794CONFIG_MSDOS_PARTITION=y
795
796#
797# Native Language Support
798#
799CONFIG_NLS=y
800CONFIG_NLS_DEFAULT="iso8859-1"
801CONFIG_NLS_CODEPAGE_437=m
802# CONFIG_NLS_CODEPAGE_737 is not set
803# CONFIG_NLS_CODEPAGE_775 is not set
804CONFIG_NLS_CODEPAGE_850=m
805# CONFIG_NLS_CODEPAGE_852 is not set
806# CONFIG_NLS_CODEPAGE_855 is not set
807# CONFIG_NLS_CODEPAGE_857 is not set
808# CONFIG_NLS_CODEPAGE_860 is not set
809# CONFIG_NLS_CODEPAGE_861 is not set
810# CONFIG_NLS_CODEPAGE_862 is not set
811# CONFIG_NLS_CODEPAGE_863 is not set
812# CONFIG_NLS_CODEPAGE_864 is not set
813# CONFIG_NLS_CODEPAGE_865 is not set
814# CONFIG_NLS_CODEPAGE_866 is not set
815# CONFIG_NLS_CODEPAGE_869 is not set
816# CONFIG_NLS_CODEPAGE_936 is not set
817# CONFIG_NLS_CODEPAGE_950 is not set
818# CONFIG_NLS_CODEPAGE_932 is not set
819# CONFIG_NLS_CODEPAGE_949 is not set
820# CONFIG_NLS_CODEPAGE_874 is not set
821# CONFIG_NLS_ISO8859_8 is not set
822# CONFIG_NLS_CODEPAGE_1250 is not set
823# CONFIG_NLS_CODEPAGE_1251 is not set
824# CONFIG_NLS_ASCII is not set
825CONFIG_NLS_ISO8859_1=m
826# CONFIG_NLS_ISO8859_2 is not set
827# CONFIG_NLS_ISO8859_3 is not set
828# CONFIG_NLS_ISO8859_4 is not set
829# CONFIG_NLS_ISO8859_5 is not set
830# CONFIG_NLS_ISO8859_6 is not set
831# CONFIG_NLS_ISO8859_7 is not set
832# CONFIG_NLS_ISO8859_9 is not set
833# CONFIG_NLS_ISO8859_13 is not set
834# CONFIG_NLS_ISO8859_14 is not set
835CONFIG_NLS_ISO8859_15=m
836# CONFIG_NLS_KOI8_R is not set
837# CONFIG_NLS_KOI8_U is not set
838CONFIG_NLS_UTF8=m
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=14
851CONFIG_DEBUG_BUGVERBOSE=y
852CONFIG_FRAME_POINTER=y
853CONFIG_DEBUG_USER=y
854
855#
856# Security options
857#
858# CONFIG_KEYS is not set
859# CONFIG_SECURITY is not set
860
861#
862# Cryptographic options
863#
864# CONFIG_CRYPTO is not set
865
866#
867# Hardware crypto devices
868#
869
870#
871# Library routines
872#
873CONFIG_CRC_CCITT=m
874CONFIG_CRC32=m
875# CONFIG_LIBCRC32C is not set
876CONFIG_ZLIB_INFLATE=m
877CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/arm/configs/lpd7a400_defconfig b/arch/arm/configs/lpd7a400_defconfig
new file mode 100644
index 000000000000..d64706d3ff35
--- /dev/null
+++ b/arch/arm/configs/lpd7a400_defconfig
@@ -0,0 +1,781 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Mon Mar 28 00:06:33 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19CONFIG_LOCK_KERNEL=y
20
21#
22# General setup
23#
24CONFIG_LOCALVERSION=""
25# CONFIG_SWAP is not set
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
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33CONFIG_IKCONFIG=y
34# CONFIG_IKCONFIG_PROC is not set
35CONFIG_EMBEDDED=y
36CONFIG_KALLSYMS=y
37# CONFIG_KALLSYMS_ALL is not set
38# CONFIG_KALLSYMS_EXTRA_PASS is not set
39CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y
41# CONFIG_EPOLL is not set
42CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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#
54# CONFIG_MODULES is not set
55
56#
57# System Type
58#
59# CONFIG_ARCH_CLPS7500 is not set
60# CONFIG_ARCH_CLPS711X is not set
61# CONFIG_ARCH_CO285 is not set
62# CONFIG_ARCH_EBSA110 is not set
63# CONFIG_ARCH_CAMELOT is not set
64# CONFIG_ARCH_FOOTBRIDGE is not set
65# CONFIG_ARCH_INTEGRATOR is not set
66# CONFIG_ARCH_IOP3XX is not set
67# CONFIG_ARCH_IXP4XX is not set
68# CONFIG_ARCH_IXP2000 is not set
69# CONFIG_ARCH_L7200 is not set
70# CONFIG_ARCH_PXA is not set
71# CONFIG_ARCH_RPC is not set
72# CONFIG_ARCH_SA1100 is not set
73# CONFIG_ARCH_S3C2410 is not set
74# CONFIG_ARCH_SHARK is not set
75CONFIG_ARCH_LH7A40X=y
76# CONFIG_ARCH_OMAP is not set
77# CONFIG_ARCH_VERSATILE is not set
78# CONFIG_ARCH_IMX is not set
79# CONFIG_ARCH_H720X is not set
80
81#
82# LH7A40X Implementations
83#
84# CONFIG_MACH_KEV7A400 is not set
85CONFIG_MACH_LPD7A400=y
86# CONFIG_MACH_LPD7A404 is not set
87CONFIG_ARCH_LH7A400=y
88# CONFIG_LH7A40X_CONTIGMEM is not set
89# CONFIG_LH7A40X_ONE_BANK_PER_NODE is not set
90
91#
92# Processor Type
93#
94CONFIG_CPU_32=y
95CONFIG_CPU_ARM922T=y
96CONFIG_CPU_32v4=y
97CONFIG_CPU_ABRT_EV4T=y
98CONFIG_CPU_CACHE_V4WT=y
99CONFIG_CPU_CACHE_VIVT=y
100CONFIG_CPU_COPY_V4WB=y
101CONFIG_CPU_TLB_V4WBI=y
102
103#
104# Processor Features
105#
106CONFIG_ARM_THUMB=y
107# CONFIG_CPU_ICACHE_DISABLE is not set
108# CONFIG_CPU_DCACHE_DISABLE is not set
109# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
110
111#
112# Bus support
113#
114
115#
116# PCCARD (PCMCIA/CardBus) support
117#
118# CONFIG_PCCARD is not set
119
120#
121# Kernel Features
122#
123CONFIG_PREEMPT=y
124CONFIG_DISCONTIGMEM=y
125CONFIG_ALIGNMENT_TRAP=y
126
127#
128# Boot options
129#
130CONFIG_ZBOOT_ROM_TEXT=0x0
131CONFIG_ZBOOT_ROM_BSS=0x0
132CONFIG_CMDLINE=""
133# CONFIG_XIP_KERNEL is not set
134
135#
136# Floating point emulation
137#
138
139#
140# At least one emulation must be selected
141#
142CONFIG_FPE_NWFPE=y
143# CONFIG_FPE_NWFPE_XP is not set
144# CONFIG_FPE_FASTFPE is not set
145
146#
147# Userspace binary formats
148#
149CONFIG_BINFMT_ELF=y
150# CONFIG_BINFMT_AOUT is not set
151# CONFIG_BINFMT_MISC is not set
152# CONFIG_ARTHUR is not set
153
154#
155# Power management options
156#
157# CONFIG_PM is not set
158
159#
160# Device Drivers
161#
162
163#
164# Generic Driver Options
165#
166CONFIG_STANDALONE=y
167CONFIG_PREVENT_FIRMWARE_BUILD=y
168# CONFIG_FW_LOADER is not set
169# CONFIG_DEBUG_DRIVER is not set
170
171#
172# Memory Technology Devices (MTD)
173#
174CONFIG_MTD=y
175# CONFIG_MTD_DEBUG is not set
176# CONFIG_MTD_CONCAT is not set
177CONFIG_MTD_PARTITIONS=y
178# CONFIG_MTD_REDBOOT_PARTS is not set
179# CONFIG_MTD_CMDLINE_PARTS is not set
180# CONFIG_MTD_AFS_PARTS is not set
181
182#
183# User Modules And Translation Layers
184#
185CONFIG_MTD_CHAR=y
186CONFIG_MTD_BLOCK=y
187# CONFIG_FTL is not set
188# CONFIG_NFTL is not set
189# CONFIG_INFTL is not set
190
191#
192# RAM/ROM/Flash chip drivers
193#
194CONFIG_MTD_CFI=y
195# CONFIG_MTD_JEDECPROBE is not set
196CONFIG_MTD_GEN_PROBE=y
197# CONFIG_MTD_CFI_ADV_OPTIONS is not set
198CONFIG_MTD_MAP_BANK_WIDTH_1=y
199CONFIG_MTD_MAP_BANK_WIDTH_2=y
200CONFIG_MTD_MAP_BANK_WIDTH_4=y
201# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
202# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
203# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
204CONFIG_MTD_CFI_I1=y
205CONFIG_MTD_CFI_I2=y
206# CONFIG_MTD_CFI_I4 is not set
207# CONFIG_MTD_CFI_I8 is not set
208CONFIG_MTD_CFI_INTELEXT=y
209# CONFIG_MTD_CFI_AMDSTD is not set
210# CONFIG_MTD_CFI_STAA is not set
211CONFIG_MTD_CFI_UTIL=y
212# CONFIG_MTD_RAM is not set
213# CONFIG_MTD_ROM is not set
214# CONFIG_MTD_ABSENT is not set
215# CONFIG_MTD_XIP is not set
216
217#
218# Mapping drivers for chip access
219#
220# CONFIG_MTD_COMPLEX_MAPPINGS is not set
221# CONFIG_MTD_PHYSMAP is not set
222# CONFIG_MTD_ARM_INTEGRATOR is not set
223# CONFIG_MTD_EDB7312 is not set
224
225#
226# Self-contained MTD device drivers
227#
228# CONFIG_MTD_SLRAM is not set
229# CONFIG_MTD_PHRAM is not set
230# CONFIG_MTD_MTDRAM is not set
231# CONFIG_MTD_BLKMTD is not set
232# CONFIG_MTD_BLOCK2MTD is not set
233
234#
235# Disk-On-Chip Device Drivers
236#
237# CONFIG_MTD_DOC2000 is not set
238# CONFIG_MTD_DOC2001 is not set
239# CONFIG_MTD_DOC2001PLUS is not set
240
241#
242# NAND Flash Device Drivers
243#
244# CONFIG_MTD_NAND is not set
245
246#
247# Parallel port support
248#
249# CONFIG_PARPORT is not set
250
251#
252# Plug and Play support
253#
254
255#
256# Block devices
257#
258# CONFIG_BLK_DEV_FD is not set
259# CONFIG_BLK_DEV_COW_COMMON is not set
260CONFIG_BLK_DEV_LOOP=y
261# CONFIG_BLK_DEV_CRYPTOLOOP is not set
262# CONFIG_BLK_DEV_NBD is not set
263# CONFIG_BLK_DEV_RAM is not set
264CONFIG_BLK_DEV_RAM_COUNT=16
265CONFIG_INITRAMFS_SOURCE=""
266# CONFIG_CDROM_PKTCDVD is not set
267
268#
269# IO Schedulers
270#
271CONFIG_IOSCHED_NOOP=y
272# CONFIG_IOSCHED_AS is not set
273# CONFIG_IOSCHED_DEADLINE is not set
274CONFIG_IOSCHED_CFQ=y
275# CONFIG_ATA_OVER_ETH is not set
276
277#
278# ATA/ATAPI/MFM/RLL support
279#
280CONFIG_IDE=y
281CONFIG_BLK_DEV_IDE=y
282
283#
284# Please see Documentation/ide.txt for help/info on IDE drives
285#
286# CONFIG_BLK_DEV_IDE_SATA is not set
287CONFIG_BLK_DEV_IDEDISK=y
288# CONFIG_IDEDISK_MULTI_MODE is not set
289# CONFIG_BLK_DEV_IDECD is not set
290# CONFIG_BLK_DEV_IDETAPE is not set
291# CONFIG_BLK_DEV_IDEFLOPPY is not set
292# CONFIG_IDE_TASK_IOCTL is not set
293
294#
295# IDE chipset support/bugfixes
296#
297CONFIG_IDE_GENERIC=y
298# CONFIG_IDE_ARM is not set
299# CONFIG_BLK_DEV_IDEDMA is not set
300# CONFIG_IDEDMA_AUTO is not set
301# CONFIG_BLK_DEV_HD is not set
302
303#
304# SCSI device support
305#
306# CONFIG_SCSI is not set
307
308#
309# Multi-device support (RAID and LVM)
310#
311# CONFIG_MD is not set
312
313#
314# Fusion MPT device support
315#
316
317#
318# IEEE 1394 (FireWire) support
319#
320
321#
322# I2O device support
323#
324
325#
326# Networking support
327#
328CONFIG_NET=y
329
330#
331# Networking options
332#
333CONFIG_PACKET=y
334# CONFIG_PACKET_MMAP is not set
335# CONFIG_NETLINK_DEV is not set
336CONFIG_UNIX=y
337# CONFIG_NET_KEY is not set
338CONFIG_INET=y
339# CONFIG_IP_MULTICAST is not set
340# CONFIG_IP_ADVANCED_ROUTER is not set
341CONFIG_IP_PNP=y
342CONFIG_IP_PNP_DHCP=y
343CONFIG_IP_PNP_BOOTP=y
344CONFIG_IP_PNP_RARP=y
345# CONFIG_NET_IPIP is not set
346# CONFIG_NET_IPGRE is not set
347# CONFIG_ARPD is not set
348# CONFIG_SYN_COOKIES is not set
349# CONFIG_INET_AH is not set
350# CONFIG_INET_ESP is not set
351# CONFIG_INET_IPCOMP is not set
352# CONFIG_INET_TUNNEL is not set
353# CONFIG_IP_TCPDIAG is not set
354# CONFIG_IP_TCPDIAG_IPV6 is not set
355# CONFIG_IPV6 is not set
356# CONFIG_NETFILTER is not set
357
358#
359# SCTP Configuration (EXPERIMENTAL)
360#
361# CONFIG_IP_SCTP is not set
362# CONFIG_ATM is not set
363# CONFIG_BRIDGE is not set
364# CONFIG_VLAN_8021Q is not set
365# CONFIG_DECNET is not set
366# CONFIG_LLC2 is not set
367# CONFIG_IPX is not set
368# CONFIG_ATALK is not set
369# CONFIG_X25 is not set
370# CONFIG_LAPB is not set
371# CONFIG_NET_DIVERT is not set
372# CONFIG_ECONET is not set
373# CONFIG_WAN_ROUTER is not set
374
375#
376# QoS and/or fair queueing
377#
378# CONFIG_NET_SCHED is not set
379# CONFIG_NET_CLS_ROUTE is not set
380
381#
382# Network testing
383#
384# CONFIG_NET_PKTGEN is not set
385# CONFIG_NETPOLL is not set
386# CONFIG_NET_POLL_CONTROLLER is not set
387# CONFIG_HAMRADIO is not set
388# CONFIG_IRDA is not set
389# CONFIG_BT is not set
390CONFIG_NETDEVICES=y
391# CONFIG_DUMMY is not set
392# CONFIG_BONDING is not set
393# CONFIG_EQUALIZER is not set
394# CONFIG_TUN is not set
395
396#
397# Ethernet (10 or 100Mbit)
398#
399CONFIG_NET_ETHERNET=y
400CONFIG_MII=y
401CONFIG_SMC91X=y
402
403#
404# Ethernet (1000 Mbit)
405#
406
407#
408# Ethernet (10000 Mbit)
409#
410
411#
412# Token Ring devices
413#
414
415#
416# Wireless LAN (non-hamradio)
417#
418# CONFIG_NET_RADIO is not set
419
420#
421# Wan interfaces
422#
423# CONFIG_WAN is not set
424# CONFIG_PPP is not set
425# CONFIG_SLIP is not set
426# CONFIG_SHAPER is not set
427# CONFIG_NETCONSOLE is not set
428
429#
430# ISDN subsystem
431#
432# CONFIG_ISDN is not set
433
434#
435# Input device support
436#
437CONFIG_INPUT=y
438
439#
440# Userland interfaces
441#
442CONFIG_INPUT_MOUSEDEV=y
443CONFIG_INPUT_MOUSEDEV_PSAUX=y
444CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
445CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
446# CONFIG_INPUT_JOYDEV is not set
447# CONFIG_INPUT_TSDEV is not set
448# CONFIG_INPUT_EVDEV is not set
449# CONFIG_INPUT_EVBUG is not set
450
451#
452# Input Device Drivers
453#
454# CONFIG_INPUT_KEYBOARD is not set
455# CONFIG_INPUT_MOUSE is not set
456# CONFIG_INPUT_JOYSTICK is not set
457# CONFIG_INPUT_TOUCHSCREEN is not set
458# CONFIG_INPUT_MISC is not set
459
460#
461# Hardware I/O ports
462#
463# CONFIG_SERIO is not set
464# CONFIG_GAMEPORT is not set
465CONFIG_SOUND_GAMEPORT=y
466
467#
468# Character devices
469#
470CONFIG_VT=y
471CONFIG_VT_CONSOLE=y
472CONFIG_HW_CONSOLE=y
473# CONFIG_SERIAL_NONSTANDARD is not set
474
475#
476# Serial drivers
477#
478# CONFIG_SERIAL_8250 is not set
479
480#
481# Non-8250 serial port support
482#
483CONFIG_SERIAL_CORE=y
484CONFIG_SERIAL_CORE_CONSOLE=y
485CONFIG_SERIAL_LH7A40X=y
486CONFIG_SERIAL_LH7A40X_CONSOLE=y
487CONFIG_UNIX98_PTYS=y
488CONFIG_LEGACY_PTYS=y
489CONFIG_LEGACY_PTY_COUNT=256
490
491#
492# IPMI
493#
494# CONFIG_IPMI_HANDLER is not set
495
496#
497# Watchdog Cards
498#
499# CONFIG_WATCHDOG is not set
500# CONFIG_NVRAM is not set
501CONFIG_RTC=y
502# CONFIG_DTLK is not set
503# CONFIG_R3964 is not set
504
505#
506# Ftape, the floppy tape device driver
507#
508# CONFIG_DRM is not set
509# CONFIG_RAW_DRIVER is not set
510
511#
512# TPM devices
513#
514# CONFIG_TCG_TPM is not set
515
516#
517# I2C support
518#
519# CONFIG_I2C is not set
520
521#
522# Misc devices
523#
524
525#
526# Multimedia devices
527#
528# CONFIG_VIDEO_DEV is not set
529
530#
531# Digital Video Broadcasting Devices
532#
533# CONFIG_DVB is not set
534
535#
536# Graphics support
537#
538# CONFIG_FB is not set
539
540#
541# Console display driver support
542#
543# CONFIG_VGA_CONSOLE is not set
544CONFIG_DUMMY_CONSOLE=y
545
546#
547# Sound
548#
549# CONFIG_SOUND is not set
550
551#
552# USB support
553#
554CONFIG_USB_ARCH_HAS_HCD=y
555# CONFIG_USB_ARCH_HAS_OHCI is not set
556# CONFIG_USB is not set
557
558#
559# USB Gadget Support
560#
561# CONFIG_USB_GADGET is not set
562
563#
564# MMC/SD Card support
565#
566# CONFIG_MMC is not set
567
568#
569# File systems
570#
571CONFIG_EXT2_FS=y
572# CONFIG_EXT2_FS_XATTR is not set
573CONFIG_EXT3_FS=y
574CONFIG_EXT3_FS_XATTR=y
575# CONFIG_EXT3_FS_POSIX_ACL is not set
576# CONFIG_EXT3_FS_SECURITY is not set
577CONFIG_JBD=y
578# CONFIG_JBD_DEBUG is not set
579CONFIG_FS_MBCACHE=y
580# CONFIG_REISERFS_FS is not set
581# CONFIG_JFS_FS is not set
582
583#
584# XFS support
585#
586# CONFIG_XFS_FS is not set
587# CONFIG_MINIX_FS is not set
588# CONFIG_ROMFS_FS is not set
589# CONFIG_QUOTA is not set
590CONFIG_DNOTIFY=y
591# CONFIG_AUTOFS_FS is not set
592# CONFIG_AUTOFS4_FS is not set
593
594#
595# CD-ROM/DVD Filesystems
596#
597# CONFIG_ISO9660_FS is not set
598# CONFIG_UDF_FS is not set
599
600#
601# DOS/FAT/NT Filesystems
602#
603CONFIG_FAT_FS=y
604# CONFIG_MSDOS_FS is not set
605CONFIG_VFAT_FS=y
606CONFIG_FAT_DEFAULT_CODEPAGE=437
607CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
608# CONFIG_NTFS_FS is not set
609
610#
611# Pseudo filesystems
612#
613CONFIG_PROC_FS=y
614CONFIG_SYSFS=y
615# CONFIG_DEVFS_FS is not set
616# CONFIG_DEVPTS_FS_XATTR is not set
617CONFIG_TMPFS=y
618# CONFIG_TMPFS_XATTR is not set
619# CONFIG_HUGETLB_PAGE is not set
620CONFIG_RAMFS=y
621
622#
623# Miscellaneous filesystems
624#
625# CONFIG_ADFS_FS is not set
626# CONFIG_AFFS_FS is not set
627# CONFIG_HFS_FS is not set
628# CONFIG_HFSPLUS_FS is not set
629# CONFIG_BEFS_FS is not set
630# CONFIG_BFS_FS is not set
631# CONFIG_EFS_FS is not set
632# CONFIG_JFFS_FS is not set
633CONFIG_JFFS2_FS=y
634CONFIG_JFFS2_FS_DEBUG=0
635# CONFIG_JFFS2_FS_NAND is not set
636# CONFIG_JFFS2_FS_NOR_ECC is not set
637# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
638CONFIG_JFFS2_ZLIB=y
639CONFIG_JFFS2_RTIME=y
640# CONFIG_JFFS2_RUBIN is not set
641CONFIG_CRAMFS=y
642# CONFIG_VXFS_FS is not set
643# CONFIG_HPFS_FS is not set
644# CONFIG_QNX4FS_FS is not set
645# CONFIG_SYSV_FS is not set
646# CONFIG_UFS_FS is not set
647
648#
649# Network File Systems
650#
651CONFIG_NFS_FS=y
652CONFIG_NFS_V3=y
653# CONFIG_NFS_V4 is not set
654# CONFIG_NFS_DIRECTIO is not set
655# CONFIG_NFSD is not set
656CONFIG_ROOT_NFS=y
657CONFIG_LOCKD=y
658CONFIG_LOCKD_V4=y
659CONFIG_SUNRPC=y
660# CONFIG_RPCSEC_GSS_KRB5 is not set
661# CONFIG_RPCSEC_GSS_SPKM3 is not set
662# CONFIG_SMB_FS is not set
663# CONFIG_CIFS is not set
664# CONFIG_NCP_FS is not set
665# CONFIG_CODA_FS is not set
666# CONFIG_AFS_FS is not set
667
668#
669# Partition Types
670#
671CONFIG_PARTITION_ADVANCED=y
672# CONFIG_ACORN_PARTITION is not set
673# CONFIG_OSF_PARTITION is not set
674# CONFIG_AMIGA_PARTITION is not set
675# CONFIG_ATARI_PARTITION is not set
676# CONFIG_MAC_PARTITION is not set
677CONFIG_MSDOS_PARTITION=y
678# CONFIG_BSD_DISKLABEL is not set
679# CONFIG_MINIX_SUBPARTITION is not set
680# CONFIG_SOLARIS_X86_PARTITION is not set
681# CONFIG_UNIXWARE_DISKLABEL is not set
682# CONFIG_LDM_PARTITION is not set
683# CONFIG_SGI_PARTITION is not set
684# CONFIG_ULTRIX_PARTITION is not set
685# CONFIG_SUN_PARTITION is not set
686# CONFIG_EFI_PARTITION is not set
687
688#
689# Native Language Support
690#
691CONFIG_NLS=y
692CONFIG_NLS_DEFAULT="iso8859-1"
693# CONFIG_NLS_CODEPAGE_437 is not set
694# CONFIG_NLS_CODEPAGE_737 is not set
695# CONFIG_NLS_CODEPAGE_775 is not set
696# CONFIG_NLS_CODEPAGE_850 is not set
697# CONFIG_NLS_CODEPAGE_852 is not set
698# CONFIG_NLS_CODEPAGE_855 is not set
699# CONFIG_NLS_CODEPAGE_857 is not set
700# CONFIG_NLS_CODEPAGE_860 is not set
701# CONFIG_NLS_CODEPAGE_861 is not set
702# CONFIG_NLS_CODEPAGE_862 is not set
703# CONFIG_NLS_CODEPAGE_863 is not set
704# CONFIG_NLS_CODEPAGE_864 is not set
705# CONFIG_NLS_CODEPAGE_865 is not set
706# CONFIG_NLS_CODEPAGE_866 is not set
707# CONFIG_NLS_CODEPAGE_869 is not set
708# CONFIG_NLS_CODEPAGE_936 is not set
709# CONFIG_NLS_CODEPAGE_950 is not set
710# CONFIG_NLS_CODEPAGE_932 is not set
711# CONFIG_NLS_CODEPAGE_949 is not set
712# CONFIG_NLS_CODEPAGE_874 is not set
713# CONFIG_NLS_ISO8859_8 is not set
714# CONFIG_NLS_CODEPAGE_1250 is not set
715# CONFIG_NLS_CODEPAGE_1251 is not set
716# CONFIG_NLS_ASCII is not set
717# CONFIG_NLS_ISO8859_1 is not set
718# CONFIG_NLS_ISO8859_2 is not set
719# CONFIG_NLS_ISO8859_3 is not set
720# CONFIG_NLS_ISO8859_4 is not set
721# CONFIG_NLS_ISO8859_5 is not set
722# CONFIG_NLS_ISO8859_6 is not set
723# CONFIG_NLS_ISO8859_7 is not set
724# CONFIG_NLS_ISO8859_9 is not set
725# CONFIG_NLS_ISO8859_13 is not set
726# CONFIG_NLS_ISO8859_14 is not set
727# CONFIG_NLS_ISO8859_15 is not set
728# CONFIG_NLS_KOI8_R is not set
729# CONFIG_NLS_KOI8_U is not set
730# CONFIG_NLS_UTF8 is not set
731
732#
733# Profiling support
734#
735# CONFIG_PROFILING is not set
736
737#
738# Kernel hacking
739#
740# CONFIG_PRINTK_TIME is not set
741CONFIG_DEBUG_KERNEL=y
742CONFIG_MAGIC_SYSRQ=y
743CONFIG_LOG_BUF_SHIFT=14
744# CONFIG_SCHEDSTATS is not set
745# CONFIG_DEBUG_SLAB is not set
746CONFIG_DEBUG_PREEMPT=y
747# CONFIG_DEBUG_SPINLOCK is not set
748# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
749# CONFIG_DEBUG_KOBJECT is not set
750CONFIG_DEBUG_BUGVERBOSE=y
751CONFIG_DEBUG_INFO=y
752# CONFIG_DEBUG_FS is not set
753CONFIG_FRAME_POINTER=y
754CONFIG_DEBUG_USER=y
755# CONFIG_DEBUG_WAITQ is not set
756CONFIG_DEBUG_ERRORS=y
757# CONFIG_DEBUG_LL is not set
758
759#
760# Security options
761#
762# CONFIG_KEYS is not set
763# CONFIG_SECURITY is not set
764
765#
766# Cryptographic options
767#
768# CONFIG_CRYPTO is not set
769
770#
771# Hardware crypto devices
772#
773
774#
775# Library routines
776#
777# CONFIG_CRC_CCITT is not set
778CONFIG_CRC32=y
779# CONFIG_LIBCRC32C is not set
780CONFIG_ZLIB_INFLATE=y
781CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/lpd7a404_defconfig b/arch/arm/configs/lpd7a404_defconfig
new file mode 100644
index 000000000000..87cbedfb303f
--- /dev/null
+++ b/arch/arm/configs/lpd7a404_defconfig
@@ -0,0 +1,919 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Mon Mar 28 00:14:08 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19CONFIG_LOCK_KERNEL=y
20
21#
22# General setup
23#
24CONFIG_LOCALVERSION=""
25# CONFIG_SWAP is not set
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
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33CONFIG_IKCONFIG=y
34# CONFIG_IKCONFIG_PROC is not set
35CONFIG_EMBEDDED=y
36CONFIG_KALLSYMS=y
37# CONFIG_KALLSYMS_ALL is not set
38# CONFIG_KALLSYMS_EXTRA_PASS is not set
39CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y
41# CONFIG_EPOLL is not set
42CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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#
54# CONFIG_MODULES is not set
55
56#
57# System Type
58#
59# CONFIG_ARCH_CLPS7500 is not set
60# CONFIG_ARCH_CLPS711X is not set
61# CONFIG_ARCH_CO285 is not set
62# CONFIG_ARCH_EBSA110 is not set
63# CONFIG_ARCH_CAMELOT is not set
64# CONFIG_ARCH_FOOTBRIDGE is not set
65# CONFIG_ARCH_INTEGRATOR is not set
66# CONFIG_ARCH_IOP3XX is not set
67# CONFIG_ARCH_IXP4XX is not set
68# CONFIG_ARCH_IXP2000 is not set
69# CONFIG_ARCH_L7200 is not set
70# CONFIG_ARCH_PXA is not set
71# CONFIG_ARCH_RPC is not set
72# CONFIG_ARCH_SA1100 is not set
73# CONFIG_ARCH_S3C2410 is not set
74# CONFIG_ARCH_SHARK is not set
75CONFIG_ARCH_LH7A40X=y
76# CONFIG_ARCH_OMAP is not set
77# CONFIG_ARCH_VERSATILE is not set
78# CONFIG_ARCH_IMX is not set
79# CONFIG_ARCH_H720X is not set
80
81#
82# LH7A40X Implementations
83#
84# CONFIG_MACH_KEV7A400 is not set
85# CONFIG_MACH_LPD7A400 is not set
86CONFIG_MACH_LPD7A404=y
87CONFIG_ARCH_LH7A404=y
88# CONFIG_LH7A40X_CONTIGMEM is not set
89# CONFIG_LH7A40X_ONE_BANK_PER_NODE is not set
90
91#
92# Processor Type
93#
94CONFIG_CPU_32=y
95CONFIG_CPU_ARM922T=y
96CONFIG_CPU_32v4=y
97CONFIG_CPU_ABRT_EV4T=y
98CONFIG_CPU_CACHE_V4WT=y
99CONFIG_CPU_CACHE_VIVT=y
100CONFIG_CPU_COPY_V4WB=y
101CONFIG_CPU_TLB_V4WBI=y
102
103#
104# Processor Features
105#
106CONFIG_ARM_THUMB=y
107# CONFIG_CPU_ICACHE_DISABLE is not set
108# CONFIG_CPU_DCACHE_DISABLE is not set
109# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
110
111#
112# Bus support
113#
114
115#
116# PCCARD (PCMCIA/CardBus) support
117#
118# CONFIG_PCCARD is not set
119
120#
121# Kernel Features
122#
123CONFIG_PREEMPT=y
124CONFIG_DISCONTIGMEM=y
125CONFIG_ALIGNMENT_TRAP=y
126
127#
128# Boot options
129#
130CONFIG_ZBOOT_ROM_TEXT=0x0
131CONFIG_ZBOOT_ROM_BSS=0x0
132CONFIG_CMDLINE=""
133# CONFIG_XIP_KERNEL is not set
134
135#
136# Floating point emulation
137#
138
139#
140# At least one emulation must be selected
141#
142CONFIG_FPE_NWFPE=y
143# CONFIG_FPE_NWFPE_XP is not set
144# CONFIG_FPE_FASTFPE is not set
145
146#
147# Userspace binary formats
148#
149CONFIG_BINFMT_ELF=y
150# CONFIG_BINFMT_AOUT is not set
151# CONFIG_BINFMT_MISC is not set
152# CONFIG_ARTHUR is not set
153
154#
155# Power management options
156#
157# CONFIG_PM is not set
158
159#
160# Device Drivers
161#
162
163#
164# Generic Driver Options
165#
166CONFIG_STANDALONE=y
167CONFIG_PREVENT_FIRMWARE_BUILD=y
168# CONFIG_FW_LOADER is not set
169# CONFIG_DEBUG_DRIVER is not set
170
171#
172# Memory Technology Devices (MTD)
173#
174CONFIG_MTD=y
175# CONFIG_MTD_DEBUG is not set
176# CONFIG_MTD_CONCAT is not set
177CONFIG_MTD_PARTITIONS=y
178# CONFIG_MTD_REDBOOT_PARTS is not set
179# CONFIG_MTD_CMDLINE_PARTS is not set
180# CONFIG_MTD_AFS_PARTS is not set
181
182#
183# User Modules And Translation Layers
184#
185CONFIG_MTD_CHAR=y
186CONFIG_MTD_BLOCK=y
187# CONFIG_FTL is not set
188# CONFIG_NFTL is not set
189# CONFIG_INFTL is not set
190
191#
192# RAM/ROM/Flash chip drivers
193#
194CONFIG_MTD_CFI=y
195# CONFIG_MTD_JEDECPROBE is not set
196CONFIG_MTD_GEN_PROBE=y
197# CONFIG_MTD_CFI_ADV_OPTIONS is not set
198CONFIG_MTD_MAP_BANK_WIDTH_1=y
199CONFIG_MTD_MAP_BANK_WIDTH_2=y
200CONFIG_MTD_MAP_BANK_WIDTH_4=y
201# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
202# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
203# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
204CONFIG_MTD_CFI_I1=y
205CONFIG_MTD_CFI_I2=y
206# CONFIG_MTD_CFI_I4 is not set
207# CONFIG_MTD_CFI_I8 is not set
208CONFIG_MTD_CFI_INTELEXT=y
209# CONFIG_MTD_CFI_AMDSTD is not set
210# CONFIG_MTD_CFI_STAA is not set
211CONFIG_MTD_CFI_UTIL=y
212# CONFIG_MTD_RAM is not set
213# CONFIG_MTD_ROM is not set
214# CONFIG_MTD_ABSENT is not set
215# CONFIG_MTD_XIP is not set
216
217#
218# Mapping drivers for chip access
219#
220# CONFIG_MTD_COMPLEX_MAPPINGS is not set
221# CONFIG_MTD_PHYSMAP is not set
222# CONFIG_MTD_ARM_INTEGRATOR is not set
223# CONFIG_MTD_EDB7312 is not set
224
225#
226# Self-contained MTD device drivers
227#
228# CONFIG_MTD_SLRAM is not set
229# CONFIG_MTD_PHRAM is not set
230# CONFIG_MTD_MTDRAM is not set
231# CONFIG_MTD_BLKMTD is not set
232# CONFIG_MTD_BLOCK2MTD is not set
233
234#
235# Disk-On-Chip Device Drivers
236#
237# CONFIG_MTD_DOC2000 is not set
238# CONFIG_MTD_DOC2001 is not set
239# CONFIG_MTD_DOC2001PLUS is not set
240
241#
242# NAND Flash Device Drivers
243#
244# CONFIG_MTD_NAND is not set
245
246#
247# Parallel port support
248#
249# CONFIG_PARPORT is not set
250
251#
252# Plug and Play support
253#
254
255#
256# Block devices
257#
258# CONFIG_BLK_DEV_FD is not set
259# CONFIG_BLK_DEV_COW_COMMON is not set
260CONFIG_BLK_DEV_LOOP=y
261# CONFIG_BLK_DEV_CRYPTOLOOP is not set
262# CONFIG_BLK_DEV_NBD is not set
263# CONFIG_BLK_DEV_UB is not set
264# CONFIG_BLK_DEV_RAM is not set
265CONFIG_BLK_DEV_RAM_COUNT=16
266CONFIG_INITRAMFS_SOURCE=""
267# CONFIG_CDROM_PKTCDVD is not set
268
269#
270# IO Schedulers
271#
272CONFIG_IOSCHED_NOOP=y
273# CONFIG_IOSCHED_AS is not set
274# CONFIG_IOSCHED_DEADLINE is not set
275CONFIG_IOSCHED_CFQ=y
276# CONFIG_ATA_OVER_ETH is not set
277
278#
279# ATA/ATAPI/MFM/RLL support
280#
281CONFIG_IDE=y
282CONFIG_BLK_DEV_IDE=y
283
284#
285# Please see Documentation/ide.txt for help/info on IDE drives
286#
287# CONFIG_BLK_DEV_IDE_SATA is not set
288CONFIG_BLK_DEV_IDEDISK=y
289# CONFIG_IDEDISK_MULTI_MODE is not set
290# CONFIG_BLK_DEV_IDECD is not set
291# CONFIG_BLK_DEV_IDETAPE is not set
292# CONFIG_BLK_DEV_IDEFLOPPY is not set
293# CONFIG_BLK_DEV_IDESCSI is not set
294# CONFIG_IDE_TASK_IOCTL is not set
295
296#
297# IDE chipset support/bugfixes
298#
299CONFIG_IDE_GENERIC=y
300# CONFIG_IDE_ARM is not set
301# CONFIG_BLK_DEV_IDEDMA is not set
302# CONFIG_IDEDMA_AUTO is not set
303# CONFIG_BLK_DEV_HD is not set
304
305#
306# SCSI device support
307#
308CONFIG_SCSI=y
309# CONFIG_SCSI_PROC_FS is not set
310
311#
312# SCSI support type (disk, tape, CD-ROM)
313#
314# CONFIG_BLK_DEV_SD is not set
315# CONFIG_CHR_DEV_ST is not set
316# CONFIG_CHR_DEV_OSST is not set
317# CONFIG_BLK_DEV_SR is not set
318# CONFIG_CHR_DEV_SG is not set
319
320#
321# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
322#
323# CONFIG_SCSI_MULTI_LUN is not set
324# CONFIG_SCSI_CONSTANTS is not set
325# CONFIG_SCSI_LOGGING is not set
326
327#
328# SCSI Transport Attributes
329#
330# CONFIG_SCSI_SPI_ATTRS is not set
331# CONFIG_SCSI_FC_ATTRS is not set
332# CONFIG_SCSI_ISCSI_ATTRS is not set
333
334#
335# SCSI low-level drivers
336#
337# CONFIG_SCSI_SATA is not set
338# CONFIG_SCSI_DEBUG is not set
339
340#
341# Multi-device support (RAID and LVM)
342#
343# CONFIG_MD is not set
344
345#
346# Fusion MPT device support
347#
348
349#
350# IEEE 1394 (FireWire) support
351#
352
353#
354# I2O device support
355#
356
357#
358# Networking support
359#
360CONFIG_NET=y
361
362#
363# Networking options
364#
365CONFIG_PACKET=y
366# CONFIG_PACKET_MMAP is not set
367# CONFIG_NETLINK_DEV is not set
368CONFIG_UNIX=y
369# CONFIG_NET_KEY is not set
370CONFIG_INET=y
371# CONFIG_IP_MULTICAST is not set
372# CONFIG_IP_ADVANCED_ROUTER is not set
373CONFIG_IP_PNP=y
374CONFIG_IP_PNP_DHCP=y
375CONFIG_IP_PNP_BOOTP=y
376CONFIG_IP_PNP_RARP=y
377# CONFIG_NET_IPIP is not set
378# CONFIG_NET_IPGRE is not set
379# CONFIG_ARPD is not set
380# CONFIG_SYN_COOKIES is not set
381# CONFIG_INET_AH is not set
382# CONFIG_INET_ESP is not set
383# CONFIG_INET_IPCOMP is not set
384# CONFIG_INET_TUNNEL is not set
385# CONFIG_IP_TCPDIAG is not set
386# CONFIG_IP_TCPDIAG_IPV6 is not set
387# CONFIG_IPV6 is not set
388# CONFIG_NETFILTER is not set
389
390#
391# SCTP Configuration (EXPERIMENTAL)
392#
393# CONFIG_IP_SCTP is not set
394# CONFIG_ATM is not set
395# CONFIG_BRIDGE is not set
396# CONFIG_VLAN_8021Q is not set
397# CONFIG_DECNET is not set
398# CONFIG_LLC2 is not set
399# CONFIG_IPX is not set
400# CONFIG_ATALK is not set
401# CONFIG_X25 is not set
402# CONFIG_LAPB is not set
403# CONFIG_NET_DIVERT is not set
404# CONFIG_ECONET is not set
405# CONFIG_WAN_ROUTER is not set
406
407#
408# QoS and/or fair queueing
409#
410# CONFIG_NET_SCHED is not set
411# CONFIG_NET_CLS_ROUTE is not set
412
413#
414# Network testing
415#
416# CONFIG_NET_PKTGEN is not set
417# CONFIG_NETPOLL is not set
418# CONFIG_NET_POLL_CONTROLLER is not set
419# CONFIG_HAMRADIO is not set
420# CONFIG_IRDA is not set
421# CONFIG_BT is not set
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# Ethernet (10 or 100Mbit)
430#
431CONFIG_NET_ETHERNET=y
432CONFIG_MII=y
433CONFIG_SMC91X=y
434
435#
436# Ethernet (1000 Mbit)
437#
438
439#
440# Ethernet (10000 Mbit)
441#
442
443#
444# Token Ring devices
445#
446
447#
448# Wireless LAN (non-hamradio)
449#
450# CONFIG_NET_RADIO is not set
451
452#
453# Wan interfaces
454#
455# CONFIG_WAN is not set
456# CONFIG_PPP is not set
457# CONFIG_SLIP is not set
458# CONFIG_SHAPER is not set
459# CONFIG_NETCONSOLE is not set
460
461#
462# ISDN subsystem
463#
464# CONFIG_ISDN is not set
465
466#
467# Input device support
468#
469CONFIG_INPUT=y
470
471#
472# Userland interfaces
473#
474# CONFIG_INPUT_MOUSEDEV is not set
475# CONFIG_INPUT_JOYDEV is not set
476# CONFIG_INPUT_TSDEV is not set
477# CONFIG_INPUT_EVDEV is not set
478# CONFIG_INPUT_EVBUG is not set
479
480#
481# Input Device Drivers
482#
483# CONFIG_INPUT_KEYBOARD is not set
484# CONFIG_INPUT_MOUSE is not set
485# CONFIG_INPUT_JOYSTICK is not set
486# CONFIG_INPUT_TOUCHSCREEN is not set
487# CONFIG_INPUT_MISC is not set
488
489#
490# Hardware I/O ports
491#
492# CONFIG_SERIO is not set
493# CONFIG_GAMEPORT is not set
494CONFIG_SOUND_GAMEPORT=y
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_CORE=y
513CONFIG_SERIAL_CORE_CONSOLE=y
514CONFIG_SERIAL_LH7A40X=y
515CONFIG_SERIAL_LH7A40X_CONSOLE=y
516CONFIG_UNIX98_PTYS=y
517CONFIG_LEGACY_PTYS=y
518CONFIG_LEGACY_PTY_COUNT=256
519
520#
521# IPMI
522#
523# CONFIG_IPMI_HANDLER is not set
524
525#
526# Watchdog Cards
527#
528# CONFIG_WATCHDOG is not set
529# CONFIG_NVRAM is not set
530CONFIG_RTC=y
531# CONFIG_DTLK is not set
532# CONFIG_R3964 is not set
533
534#
535# Ftape, the floppy tape device driver
536#
537# CONFIG_DRM is not set
538# CONFIG_RAW_DRIVER is not set
539
540#
541# TPM devices
542#
543# CONFIG_TCG_TPM is not set
544
545#
546# I2C support
547#
548# CONFIG_I2C is not set
549
550#
551# Misc devices
552#
553
554#
555# Multimedia devices
556#
557# CONFIG_VIDEO_DEV is not set
558
559#
560# Digital Video Broadcasting Devices
561#
562# CONFIG_DVB is not set
563
564#
565# Graphics support
566#
567# CONFIG_FB is not set
568
569#
570# Console display driver support
571#
572# CONFIG_VGA_CONSOLE is not set
573CONFIG_DUMMY_CONSOLE=y
574
575#
576# Sound
577#
578# CONFIG_SOUND is not set
579
580#
581# USB support
582#
583CONFIG_USB_ARCH_HAS_HCD=y
584CONFIG_USB_ARCH_HAS_OHCI=y
585CONFIG_USB=y
586# CONFIG_USB_DEBUG is not set
587
588#
589# Miscellaneous USB options
590#
591CONFIG_USB_DEVICEFS=y
592# CONFIG_USB_BANDWIDTH is not set
593# CONFIG_USB_DYNAMIC_MINORS is not set
594# CONFIG_USB_OTG is not set
595
596#
597# USB Host Controller Drivers
598#
599CONFIG_USB_OHCI_HCD=y
600# CONFIG_USB_OHCI_BIG_ENDIAN is not set
601CONFIG_USB_OHCI_LITTLE_ENDIAN=y
602# CONFIG_USB_SL811_HCD is not set
603
604#
605# USB Device Class drivers
606#
607# CONFIG_USB_BLUETOOTH_TTY is not set
608# CONFIG_USB_ACM is not set
609# CONFIG_USB_PRINTER is not set
610
611#
612# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
613#
614CONFIG_USB_STORAGE=y
615CONFIG_USB_STORAGE_DEBUG=y
616# CONFIG_USB_STORAGE_RW_DETECT is not set
617CONFIG_USB_STORAGE_DATAFAB=y
618# CONFIG_USB_STORAGE_FREECOM is not set
619# CONFIG_USB_STORAGE_ISD200 is not set
620# CONFIG_USB_STORAGE_DPCM is not set
621# CONFIG_USB_STORAGE_USBAT is not set
622# CONFIG_USB_STORAGE_SDDR09 is not set
623# CONFIG_USB_STORAGE_SDDR55 is not set
624# CONFIG_USB_STORAGE_JUMPSHOT is not set
625
626#
627# USB Input Devices
628#
629CONFIG_USB_HID=y
630CONFIG_USB_HIDINPUT=y
631# CONFIG_HID_FF is not set
632# CONFIG_USB_HIDDEV is not set
633# CONFIG_USB_AIPTEK is not set
634# CONFIG_USB_WACOM is not set
635# CONFIG_USB_KBTAB is not set
636# CONFIG_USB_POWERMATE is not set
637# CONFIG_USB_MTOUCH is not set
638# CONFIG_USB_EGALAX is not set
639# CONFIG_USB_XPAD is not set
640# CONFIG_USB_ATI_REMOTE is not set
641
642#
643# USB Imaging devices
644#
645# CONFIG_USB_MDC800 is not set
646# CONFIG_USB_MICROTEK is not set
647
648#
649# USB Multimedia devices
650#
651# CONFIG_USB_DABUSB is not set
652
653#
654# Video4Linux support is needed for USB Multimedia device support
655#
656
657#
658# USB Network Adapters
659#
660# CONFIG_USB_CATC is not set
661# CONFIG_USB_KAWETH is not set
662# CONFIG_USB_PEGASUS is not set
663# CONFIG_USB_RTL8150 is not set
664# CONFIG_USB_USBNET is not set
665CONFIG_USB_MON=y
666
667#
668# USB port drivers
669#
670
671#
672# USB Serial Converter support
673#
674# CONFIG_USB_SERIAL is not set
675
676#
677# USB Miscellaneous drivers
678#
679# CONFIG_USB_EMI62 is not set
680# CONFIG_USB_EMI26 is not set
681# CONFIG_USB_AUERSWALD is not set
682# CONFIG_USB_RIO500 is not set
683# CONFIG_USB_LEGOTOWER is not set
684# CONFIG_USB_LCD is not set
685# CONFIG_USB_LED is not set
686# CONFIG_USB_CYTHERM is not set
687# CONFIG_USB_PHIDGETKIT is not set
688# CONFIG_USB_PHIDGETSERVO is not set
689# CONFIG_USB_IDMOUSE is not set
690# CONFIG_USB_TEST is not set
691
692#
693# USB ATM/DSL drivers
694#
695
696#
697# USB Gadget Support
698#
699# CONFIG_USB_GADGET is not set
700
701#
702# MMC/SD Card support
703#
704# CONFIG_MMC is not set
705
706#
707# File systems
708#
709CONFIG_EXT2_FS=y
710# CONFIG_EXT2_FS_XATTR is not set
711CONFIG_EXT3_FS=y
712CONFIG_EXT3_FS_XATTR=y
713# CONFIG_EXT3_FS_POSIX_ACL is not set
714# CONFIG_EXT3_FS_SECURITY is not set
715CONFIG_JBD=y
716# CONFIG_JBD_DEBUG is not set
717CONFIG_FS_MBCACHE=y
718# CONFIG_REISERFS_FS is not set
719# CONFIG_JFS_FS is not set
720
721#
722# XFS support
723#
724# CONFIG_XFS_FS is not set
725# CONFIG_MINIX_FS is not set
726# CONFIG_ROMFS_FS is not set
727# CONFIG_QUOTA is not set
728CONFIG_DNOTIFY=y
729# CONFIG_AUTOFS_FS is not set
730# CONFIG_AUTOFS4_FS is not set
731
732#
733# CD-ROM/DVD Filesystems
734#
735# CONFIG_ISO9660_FS is not set
736# CONFIG_UDF_FS is not set
737
738#
739# DOS/FAT/NT Filesystems
740#
741CONFIG_FAT_FS=y
742# CONFIG_MSDOS_FS is not set
743CONFIG_VFAT_FS=y
744CONFIG_FAT_DEFAULT_CODEPAGE=437
745CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
746# CONFIG_NTFS_FS is not set
747
748#
749# Pseudo filesystems
750#
751CONFIG_PROC_FS=y
752CONFIG_SYSFS=y
753# CONFIG_DEVFS_FS is not set
754# CONFIG_DEVPTS_FS_XATTR is not set
755CONFIG_TMPFS=y
756# CONFIG_TMPFS_XATTR is not set
757# CONFIG_HUGETLB_PAGE is not set
758CONFIG_RAMFS=y
759
760#
761# Miscellaneous filesystems
762#
763# CONFIG_ADFS_FS is not set
764# CONFIG_AFFS_FS is not set
765# CONFIG_HFS_FS is not set
766# CONFIG_HFSPLUS_FS is not set
767# CONFIG_BEFS_FS is not set
768# CONFIG_BFS_FS is not set
769# CONFIG_EFS_FS is not set
770# CONFIG_JFFS_FS is not set
771CONFIG_JFFS2_FS=y
772CONFIG_JFFS2_FS_DEBUG=0
773# CONFIG_JFFS2_FS_NAND is not set
774# CONFIG_JFFS2_FS_NOR_ECC is not set
775# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
776CONFIG_JFFS2_ZLIB=y
777CONFIG_JFFS2_RTIME=y
778# CONFIG_JFFS2_RUBIN is not set
779CONFIG_CRAMFS=y
780# CONFIG_VXFS_FS is not set
781# CONFIG_HPFS_FS is not set
782# CONFIG_QNX4FS_FS is not set
783# CONFIG_SYSV_FS is not set
784# CONFIG_UFS_FS is not set
785
786#
787# Network File Systems
788#
789CONFIG_NFS_FS=y
790CONFIG_NFS_V3=y
791# CONFIG_NFS_V4 is not set
792# CONFIG_NFS_DIRECTIO is not set
793# CONFIG_NFSD is not set
794CONFIG_ROOT_NFS=y
795CONFIG_LOCKD=y
796CONFIG_LOCKD_V4=y
797CONFIG_SUNRPC=y
798# CONFIG_RPCSEC_GSS_KRB5 is not set
799# CONFIG_RPCSEC_GSS_SPKM3 is not set
800# CONFIG_SMB_FS is not set
801# CONFIG_CIFS is not set
802# CONFIG_NCP_FS is not set
803# CONFIG_CODA_FS is not set
804# CONFIG_AFS_FS is not set
805
806#
807# Partition Types
808#
809CONFIG_PARTITION_ADVANCED=y
810# CONFIG_ACORN_PARTITION is not set
811# CONFIG_OSF_PARTITION is not set
812# CONFIG_AMIGA_PARTITION is not set
813# CONFIG_ATARI_PARTITION is not set
814# CONFIG_MAC_PARTITION is not set
815CONFIG_MSDOS_PARTITION=y
816# CONFIG_BSD_DISKLABEL is not set
817# CONFIG_MINIX_SUBPARTITION is not set
818# CONFIG_SOLARIS_X86_PARTITION is not set
819# CONFIG_UNIXWARE_DISKLABEL is not set
820# CONFIG_LDM_PARTITION is not set
821# CONFIG_SGI_PARTITION is not set
822# CONFIG_ULTRIX_PARTITION is not set
823# CONFIG_SUN_PARTITION is not set
824# CONFIG_EFI_PARTITION is not set
825
826#
827# Native Language Support
828#
829CONFIG_NLS=y
830CONFIG_NLS_DEFAULT="iso8859-1"
831# CONFIG_NLS_CODEPAGE_437 is not set
832# CONFIG_NLS_CODEPAGE_737 is not set
833# CONFIG_NLS_CODEPAGE_775 is not set
834# CONFIG_NLS_CODEPAGE_850 is not set
835# CONFIG_NLS_CODEPAGE_852 is not set
836# CONFIG_NLS_CODEPAGE_855 is not set
837# CONFIG_NLS_CODEPAGE_857 is not set
838# CONFIG_NLS_CODEPAGE_860 is not set
839# CONFIG_NLS_CODEPAGE_861 is not set
840# CONFIG_NLS_CODEPAGE_862 is not set
841# CONFIG_NLS_CODEPAGE_863 is not set
842# CONFIG_NLS_CODEPAGE_864 is not set
843# CONFIG_NLS_CODEPAGE_865 is not set
844# CONFIG_NLS_CODEPAGE_866 is not set
845# CONFIG_NLS_CODEPAGE_869 is not set
846# CONFIG_NLS_CODEPAGE_936 is not set
847# CONFIG_NLS_CODEPAGE_950 is not set
848# CONFIG_NLS_CODEPAGE_932 is not set
849# CONFIG_NLS_CODEPAGE_949 is not set
850# CONFIG_NLS_CODEPAGE_874 is not set
851# CONFIG_NLS_ISO8859_8 is not set
852# CONFIG_NLS_CODEPAGE_1250 is not set
853# CONFIG_NLS_CODEPAGE_1251 is not set
854# CONFIG_NLS_ASCII is not set
855# CONFIG_NLS_ISO8859_1 is not set
856# CONFIG_NLS_ISO8859_2 is not set
857# CONFIG_NLS_ISO8859_3 is not set
858# CONFIG_NLS_ISO8859_4 is not set
859# CONFIG_NLS_ISO8859_5 is not set
860# CONFIG_NLS_ISO8859_6 is not set
861# CONFIG_NLS_ISO8859_7 is not set
862# CONFIG_NLS_ISO8859_9 is not set
863# CONFIG_NLS_ISO8859_13 is not set
864# CONFIG_NLS_ISO8859_14 is not set
865# CONFIG_NLS_ISO8859_15 is not set
866# CONFIG_NLS_KOI8_R is not set
867# CONFIG_NLS_KOI8_U is not set
868# CONFIG_NLS_UTF8 is not set
869
870#
871# Profiling support
872#
873# CONFIG_PROFILING is not set
874
875#
876# Kernel hacking
877#
878# CONFIG_PRINTK_TIME is not set
879CONFIG_DEBUG_KERNEL=y
880CONFIG_MAGIC_SYSRQ=y
881CONFIG_LOG_BUF_SHIFT=14
882# CONFIG_SCHEDSTATS is not set
883# CONFIG_DEBUG_SLAB is not set
884CONFIG_DEBUG_PREEMPT=y
885# CONFIG_DEBUG_SPINLOCK is not set
886# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
887# CONFIG_DEBUG_KOBJECT is not set
888CONFIG_DEBUG_BUGVERBOSE=y
889CONFIG_DEBUG_INFO=y
890# CONFIG_DEBUG_FS is not set
891CONFIG_FRAME_POINTER=y
892CONFIG_DEBUG_USER=y
893# CONFIG_DEBUG_WAITQ is not set
894CONFIG_DEBUG_ERRORS=y
895# CONFIG_DEBUG_LL is not set
896
897#
898# Security options
899#
900# CONFIG_KEYS is not set
901# CONFIG_SECURITY is not set
902
903#
904# Cryptographic options
905#
906# CONFIG_CRYPTO is not set
907
908#
909# Hardware crypto devices
910#
911
912#
913# Library routines
914#
915# CONFIG_CRC_CCITT is not set
916CONFIG_CRC32=y
917# CONFIG_LIBCRC32C is not set
918CONFIG_ZLIB_INFLATE=y
919CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/lubbock_defconfig b/arch/arm/configs/lubbock_defconfig
new file mode 100644
index 000000000000..4bc8717c6f57
--- /dev/null
+++ b/arch/arm/configs/lubbock_defconfig
@@ -0,0 +1,803 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Mon Mar 28 00:18:13 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_UNLOAD is not set
54CONFIG_OBSOLETE_MODPARM=y
55# CONFIG_MODVERSIONS is not set
56# CONFIG_MODULE_SRCVERSION_ALL is not set
57# CONFIG_KMOD is not set
58
59#
60# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66# CONFIG_ARCH_CAMELOT is not set
67# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73CONFIG_ARCH_PXA=y
74# CONFIG_ARCH_RPC is not set
75# CONFIG_ARCH_SA1100 is not set
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81# CONFIG_ARCH_IMX is not set
82# CONFIG_ARCH_H720X is not set
83
84#
85# Intel PXA2xx Implementations
86#
87CONFIG_ARCH_LUBBOCK=y
88# CONFIG_MACH_MAINSTONE is not set
89# CONFIG_ARCH_PXA_IDP is not set
90# CONFIG_PXA_SHARPSL is not set
91CONFIG_PXA25x=y
92
93#
94# Processor Type
95#
96CONFIG_CPU_32=y
97CONFIG_CPU_XSCALE=y
98CONFIG_CPU_32v5=y
99CONFIG_CPU_ABRT_EV5T=y
100CONFIG_CPU_CACHE_VIVT=y
101CONFIG_CPU_TLB_V4WBI=y
102CONFIG_CPU_MINICACHE=y
103
104#
105# Processor Features
106#
107# CONFIG_ARM_THUMB is not set
108CONFIG_XSCALE_PMU=y
109CONFIG_SA1111=y
110CONFIG_DMABOUNCE=y
111CONFIG_FORCE_MAX_ZONEORDER=9
112
113#
114# Bus support
115#
116
117#
118# PCCARD (PCMCIA/CardBus) support
119#
120CONFIG_PCCARD=y
121# CONFIG_PCMCIA_DEBUG is not set
122CONFIG_PCMCIA=y
123
124#
125# PC-card bridges
126#
127# CONFIG_TCIC is not set
128CONFIG_PCMCIA_PXA2XX=y
129
130#
131# Kernel Features
132#
133# CONFIG_PREEMPT is not set
134CONFIG_LEDS=y
135CONFIG_LEDS_TIMER=y
136CONFIG_LEDS_CPU=y
137CONFIG_ALIGNMENT_TRAP=y
138
139#
140# Boot options
141#
142CONFIG_ZBOOT_ROM_TEXT=0x0
143CONFIG_ZBOOT_ROM_BSS=0x0
144CONFIG_CMDLINE="root=/dev/nfs ip=bootp console=ttyS0,115200 mem=64M"
145# CONFIG_XIP_KERNEL is not set
146
147#
148# Floating point emulation
149#
150
151#
152# At least one emulation must be selected
153#
154CONFIG_FPE_NWFPE=y
155# CONFIG_FPE_NWFPE_XP is not set
156# CONFIG_FPE_FASTFPE is not set
157
158#
159# Userspace binary formats
160#
161CONFIG_BINFMT_ELF=y
162# CONFIG_BINFMT_AOUT is not set
163# CONFIG_BINFMT_MISC is not set
164# CONFIG_ARTHUR is not set
165
166#
167# Power management options
168#
169# CONFIG_PM is not set
170
171#
172# Device Drivers
173#
174
175#
176# Generic Driver Options
177#
178CONFIG_STANDALONE=y
179CONFIG_PREVENT_FIRMWARE_BUILD=y
180# CONFIG_FW_LOADER is not set
181# CONFIG_DEBUG_DRIVER is not set
182
183#
184# Memory Technology Devices (MTD)
185#
186CONFIG_MTD=y
187# CONFIG_MTD_DEBUG is not set
188# CONFIG_MTD_CONCAT is not set
189CONFIG_MTD_PARTITIONS=y
190CONFIG_MTD_REDBOOT_PARTS=y
191CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
192# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
193# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
194# CONFIG_MTD_CMDLINE_PARTS is not set
195# CONFIG_MTD_AFS_PARTS is not set
196
197#
198# User Modules And Translation Layers
199#
200CONFIG_MTD_CHAR=y
201CONFIG_MTD_BLOCK=y
202# CONFIG_FTL is not set
203# CONFIG_NFTL is not set
204# CONFIG_INFTL is not set
205
206#
207# RAM/ROM/Flash chip drivers
208#
209CONFIG_MTD_CFI=y
210# CONFIG_MTD_JEDECPROBE is not set
211CONFIG_MTD_GEN_PROBE=y
212CONFIG_MTD_CFI_ADV_OPTIONS=y
213CONFIG_MTD_CFI_NOSWAP=y
214# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
215# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
216CONFIG_MTD_CFI_GEOMETRY=y
217CONFIG_MTD_MAP_BANK_WIDTH_1=y
218CONFIG_MTD_MAP_BANK_WIDTH_2=y
219CONFIG_MTD_MAP_BANK_WIDTH_4=y
220# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
221# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
222# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
223# CONFIG_MTD_CFI_I1 is not set
224CONFIG_MTD_CFI_I2=y
225# CONFIG_MTD_CFI_I4 is not set
226# CONFIG_MTD_CFI_I8 is not set
227CONFIG_MTD_CFI_INTELEXT=y
228# CONFIG_MTD_CFI_AMDSTD is not set
229# CONFIG_MTD_CFI_STAA is not set
230CONFIG_MTD_CFI_UTIL=y
231# CONFIG_MTD_RAM is not set
232# CONFIG_MTD_ROM is not set
233# CONFIG_MTD_ABSENT is not set
234# CONFIG_MTD_XIP is not set
235
236#
237# Mapping drivers for chip access
238#
239# CONFIG_MTD_COMPLEX_MAPPINGS is not set
240# CONFIG_MTD_PHYSMAP is not set
241CONFIG_MTD_LUBBOCK=y
242# CONFIG_MTD_ARM_INTEGRATOR is not set
243# CONFIG_MTD_EDB7312 is not set
244# CONFIG_MTD_SHARP_SL is not set
245
246#
247# Self-contained MTD device drivers
248#
249# CONFIG_MTD_SLRAM is not set
250# CONFIG_MTD_PHRAM is not set
251# CONFIG_MTD_MTDRAM is not set
252# CONFIG_MTD_BLKMTD is not set
253# CONFIG_MTD_BLOCK2MTD is not set
254
255#
256# Disk-On-Chip Device Drivers
257#
258# CONFIG_MTD_DOC2000 is not set
259# CONFIG_MTD_DOC2001 is not set
260# CONFIG_MTD_DOC2001PLUS is not set
261
262#
263# NAND Flash Device Drivers
264#
265# CONFIG_MTD_NAND is not set
266
267#
268# Parallel port support
269#
270# CONFIG_PARPORT is not set
271
272#
273# Plug and Play support
274#
275
276#
277# Block devices
278#
279# CONFIG_BLK_DEV_FD is not set
280# CONFIG_BLK_DEV_COW_COMMON is not set
281# CONFIG_BLK_DEV_LOOP is not set
282# CONFIG_BLK_DEV_NBD is not set
283# CONFIG_BLK_DEV_RAM is not set
284CONFIG_BLK_DEV_RAM_COUNT=16
285CONFIG_INITRAMFS_SOURCE=""
286# CONFIG_CDROM_PKTCDVD is not set
287
288#
289# IO Schedulers
290#
291CONFIG_IOSCHED_NOOP=y
292CONFIG_IOSCHED_AS=y
293CONFIG_IOSCHED_DEADLINE=y
294CONFIG_IOSCHED_CFQ=y
295# CONFIG_ATA_OVER_ETH is not set
296
297#
298# ATA/ATAPI/MFM/RLL support
299#
300# CONFIG_IDE is not set
301
302#
303# SCSI device support
304#
305# CONFIG_SCSI is not set
306
307#
308# Multi-device support (RAID and LVM)
309#
310# CONFIG_MD is not set
311
312#
313# Fusion MPT device support
314#
315
316#
317# IEEE 1394 (FireWire) support
318#
319
320#
321# I2O device support
322#
323
324#
325# Networking support
326#
327CONFIG_NET=y
328
329#
330# Networking options
331#
332# CONFIG_PACKET is not set
333# CONFIG_NETLINK_DEV is not set
334CONFIG_UNIX=y
335# CONFIG_NET_KEY is not set
336CONFIG_INET=y
337# CONFIG_IP_MULTICAST is not set
338# CONFIG_IP_ADVANCED_ROUTER is not set
339CONFIG_IP_PNP=y
340# CONFIG_IP_PNP_DHCP is not set
341CONFIG_IP_PNP_BOOTP=y
342# CONFIG_IP_PNP_RARP is not set
343# CONFIG_NET_IPIP is not set
344# CONFIG_NET_IPGRE is not set
345# CONFIG_ARPD is not set
346# CONFIG_SYN_COOKIES is not set
347# CONFIG_INET_AH is not set
348# CONFIG_INET_ESP is not set
349# CONFIG_INET_IPCOMP is not set
350# CONFIG_INET_TUNNEL is not set
351# CONFIG_IP_TCPDIAG is not set
352# CONFIG_IP_TCPDIAG_IPV6 is not set
353# CONFIG_IPV6 is not set
354# CONFIG_NETFILTER is not set
355
356#
357# SCTP Configuration (EXPERIMENTAL)
358#
359# CONFIG_IP_SCTP is not set
360# CONFIG_ATM is not set
361# CONFIG_BRIDGE is not set
362# CONFIG_VLAN_8021Q is not set
363# CONFIG_DECNET is not set
364# CONFIG_LLC2 is not set
365# CONFIG_IPX is not set
366# CONFIG_ATALK is not set
367# CONFIG_X25 is not set
368# CONFIG_LAPB is not set
369# CONFIG_NET_DIVERT is not set
370# CONFIG_ECONET is not set
371# CONFIG_WAN_ROUTER is not set
372
373#
374# QoS and/or fair queueing
375#
376# CONFIG_NET_SCHED is not set
377# CONFIG_NET_CLS_ROUTE is not set
378
379#
380# Network testing
381#
382# CONFIG_NET_PKTGEN is not set
383# CONFIG_NETPOLL is not set
384# CONFIG_NET_POLL_CONTROLLER is not set
385# CONFIG_HAMRADIO is not set
386# CONFIG_IRDA is not set
387# CONFIG_BT is not set
388CONFIG_NETDEVICES=y
389# CONFIG_DUMMY is not set
390# CONFIG_BONDING is not set
391# CONFIG_EQUALIZER is not set
392# CONFIG_TUN is not set
393
394#
395# Ethernet (10 or 100Mbit)
396#
397CONFIG_NET_ETHERNET=y
398CONFIG_MII=y
399CONFIG_SMC91X=y
400
401#
402# Ethernet (1000 Mbit)
403#
404
405#
406# Ethernet (10000 Mbit)
407#
408
409#
410# Token Ring devices
411#
412
413#
414# Wireless LAN (non-hamradio)
415#
416# CONFIG_NET_RADIO is not set
417
418#
419# PCMCIA network device support
420#
421CONFIG_NET_PCMCIA=y
422# CONFIG_PCMCIA_3C589 is not set
423# CONFIG_PCMCIA_3C574 is not set
424# CONFIG_PCMCIA_FMVJ18X is not set
425CONFIG_PCMCIA_PCNET=y
426# CONFIG_PCMCIA_NMCLAN is not set
427# CONFIG_PCMCIA_SMC91C92 is not set
428# CONFIG_PCMCIA_XIRC2PS is not set
429# CONFIG_PCMCIA_AXNET is not set
430
431#
432# Wan interfaces
433#
434# CONFIG_WAN is not set
435# CONFIG_PPP is not set
436# CONFIG_SLIP is not set
437# CONFIG_SHAPER is not set
438# CONFIG_NETCONSOLE is not set
439
440#
441# ISDN subsystem
442#
443# CONFIG_ISDN is not set
444
445#
446# Input device support
447#
448CONFIG_INPUT=y
449
450#
451# Userland interfaces
452#
453CONFIG_INPUT_MOUSEDEV=y
454CONFIG_INPUT_MOUSEDEV_PSAUX=y
455CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
456CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
457# CONFIG_INPUT_JOYDEV is not set
458# CONFIG_INPUT_TSDEV is not set
459CONFIG_INPUT_EVDEV=y
460# CONFIG_INPUT_EVBUG is not set
461
462#
463# Input Device Drivers
464#
465CONFIG_INPUT_KEYBOARD=y
466CONFIG_KEYBOARD_ATKBD=y
467# CONFIG_KEYBOARD_SUNKBD is not set
468# CONFIG_KEYBOARD_LKKBD is not set
469# CONFIG_KEYBOARD_XTKBD is not set
470# CONFIG_KEYBOARD_NEWTON is not set
471CONFIG_INPUT_MOUSE=y
472CONFIG_MOUSE_PS2=y
473# CONFIG_MOUSE_SERIAL is not set
474# CONFIG_MOUSE_VSXXXAA is not set
475# CONFIG_INPUT_JOYSTICK is not set
476# CONFIG_INPUT_TOUCHSCREEN is not set
477# CONFIG_INPUT_MISC is not set
478
479#
480# Hardware I/O ports
481#
482CONFIG_SERIO=y
483# CONFIG_SERIO_SERPORT is not set
484CONFIG_SERIO_SA1111=y
485CONFIG_SERIO_LIBPS2=y
486# CONFIG_SERIO_RAW is not set
487# CONFIG_GAMEPORT is not set
488CONFIG_SOUND_GAMEPORT=y
489
490#
491# Character devices
492#
493CONFIG_VT=y
494CONFIG_VT_CONSOLE=y
495CONFIG_HW_CONSOLE=y
496# CONFIG_SERIAL_NONSTANDARD is not set
497
498#
499# Serial drivers
500#
501# CONFIG_SERIAL_8250 is not set
502
503#
504# Non-8250 serial port support
505#
506CONFIG_SERIAL_PXA=y
507CONFIG_SERIAL_PXA_CONSOLE=y
508CONFIG_SERIAL_CORE=y
509CONFIG_SERIAL_CORE_CONSOLE=y
510CONFIG_UNIX98_PTYS=y
511CONFIG_LEGACY_PTYS=y
512CONFIG_LEGACY_PTY_COUNT=256
513
514#
515# IPMI
516#
517# CONFIG_IPMI_HANDLER is not set
518
519#
520# Watchdog Cards
521#
522# CONFIG_WATCHDOG is not set
523# CONFIG_NVRAM is not set
524# CONFIG_RTC is not set
525# CONFIG_DTLK is not set
526# CONFIG_R3964 is not set
527
528#
529# Ftape, the floppy tape device driver
530#
531# CONFIG_DRM is not set
532
533#
534# PCMCIA character devices
535#
536# CONFIG_SYNCLINK_CS is not set
537# CONFIG_RAW_DRIVER is not set
538
539#
540# TPM devices
541#
542# CONFIG_TCG_TPM is not set
543
544#
545# I2C support
546#
547# CONFIG_I2C is not set
548
549#
550# Misc devices
551#
552
553#
554# Multimedia devices
555#
556# CONFIG_VIDEO_DEV is not set
557
558#
559# Digital Video Broadcasting Devices
560#
561# CONFIG_DVB is not set
562
563#
564# Graphics support
565#
566# CONFIG_FB is not set
567
568#
569# Console display driver support
570#
571# CONFIG_VGA_CONSOLE is not set
572CONFIG_DUMMY_CONSOLE=y
573
574#
575# Sound
576#
577# CONFIG_SOUND is not set
578
579#
580# USB support
581#
582CONFIG_USB_ARCH_HAS_HCD=y
583CONFIG_USB_ARCH_HAS_OHCI=y
584# CONFIG_USB is not set
585
586#
587# USB Gadget Support
588#
589CONFIG_USB_GADGET=y
590# CONFIG_USB_GADGET_DEBUG_FILES is not set
591# CONFIG_USB_GADGET_NET2280 is not set
592CONFIG_USB_GADGET_PXA2XX=y
593CONFIG_USB_PXA2XX=y
594CONFIG_USB_PXA2XX_SMALL=y
595# CONFIG_USB_GADGET_GOKU is not set
596# CONFIG_USB_GADGET_SA1100 is not set
597# CONFIG_USB_GADGET_LH7A40X is not set
598# CONFIG_USB_GADGET_DUMMY_HCD is not set
599# CONFIG_USB_GADGET_OMAP is not set
600# CONFIG_USB_GADGET_DUALSPEED is not set
601# CONFIG_USB_ZERO is not set
602# CONFIG_USB_ETH is not set
603# CONFIG_USB_GADGETFS is not set
604# CONFIG_USB_FILE_STORAGE is not set
605CONFIG_USB_G_SERIAL=y
606
607#
608# MMC/SD Card support
609#
610# CONFIG_MMC is not set
611
612#
613# File systems
614#
615CONFIG_EXT2_FS=y
616# CONFIG_EXT2_FS_XATTR is not set
617# CONFIG_EXT3_FS is not set
618# CONFIG_JBD is not set
619# CONFIG_REISERFS_FS is not set
620# CONFIG_JFS_FS is not set
621
622#
623# XFS support
624#
625# CONFIG_XFS_FS is not set
626# CONFIG_MINIX_FS is not set
627# CONFIG_ROMFS_FS is not set
628# CONFIG_QUOTA is not set
629CONFIG_DNOTIFY=y
630# CONFIG_AUTOFS_FS is not set
631# CONFIG_AUTOFS4_FS is not set
632
633#
634# CD-ROM/DVD Filesystems
635#
636# CONFIG_ISO9660_FS is not set
637# CONFIG_UDF_FS is not set
638
639#
640# DOS/FAT/NT Filesystems
641#
642CONFIG_FAT_FS=y
643CONFIG_MSDOS_FS=y
644# CONFIG_VFAT_FS is not set
645CONFIG_FAT_DEFAULT_CODEPAGE=437
646# CONFIG_NTFS_FS is not set
647
648#
649# Pseudo filesystems
650#
651CONFIG_PROC_FS=y
652CONFIG_SYSFS=y
653# CONFIG_DEVFS_FS is not set
654# CONFIG_DEVPTS_FS_XATTR is not set
655# CONFIG_TMPFS is not set
656# CONFIG_HUGETLB_PAGE is not set
657CONFIG_RAMFS=y
658
659#
660# Miscellaneous filesystems
661#
662# CONFIG_ADFS_FS is not set
663# CONFIG_AFFS_FS is not set
664# CONFIG_HFS_FS is not set
665# CONFIG_HFSPLUS_FS is not set
666# CONFIG_BEFS_FS is not set
667# CONFIG_BFS_FS is not set
668# CONFIG_EFS_FS is not set
669# CONFIG_JFFS_FS is not set
670CONFIG_JFFS2_FS=y
671CONFIG_JFFS2_FS_DEBUG=0
672# CONFIG_JFFS2_FS_NAND is not set
673# CONFIG_JFFS2_FS_NOR_ECC is not set
674# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
675CONFIG_JFFS2_ZLIB=y
676CONFIG_JFFS2_RTIME=y
677# CONFIG_JFFS2_RUBIN is not set
678# CONFIG_CRAMFS is not set
679# CONFIG_VXFS_FS is not set
680# CONFIG_HPFS_FS is not set
681# CONFIG_QNX4FS_FS is not set
682# CONFIG_SYSV_FS is not set
683# CONFIG_UFS_FS is not set
684
685#
686# Network File Systems
687#
688CONFIG_NFS_FS=y
689# CONFIG_NFS_V3 is not set
690# CONFIG_NFS_V4 is not set
691# CONFIG_NFS_DIRECTIO is not set
692# CONFIG_NFSD is not set
693CONFIG_ROOT_NFS=y
694CONFIG_LOCKD=y
695CONFIG_SUNRPC=y
696# CONFIG_RPCSEC_GSS_KRB5 is not set
697# CONFIG_RPCSEC_GSS_SPKM3 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#
713CONFIG_NLS=y
714CONFIG_NLS_DEFAULT="iso8859-1"
715# CONFIG_NLS_CODEPAGE_437 is not set
716# CONFIG_NLS_CODEPAGE_737 is not set
717# CONFIG_NLS_CODEPAGE_775 is not set
718# CONFIG_NLS_CODEPAGE_850 is not set
719# CONFIG_NLS_CODEPAGE_852 is not set
720# CONFIG_NLS_CODEPAGE_855 is not set
721# CONFIG_NLS_CODEPAGE_857 is not set
722# CONFIG_NLS_CODEPAGE_860 is not set
723# CONFIG_NLS_CODEPAGE_861 is not set
724# CONFIG_NLS_CODEPAGE_862 is not set
725# CONFIG_NLS_CODEPAGE_863 is not set
726# CONFIG_NLS_CODEPAGE_864 is not set
727# CONFIG_NLS_CODEPAGE_865 is not set
728# CONFIG_NLS_CODEPAGE_866 is not set
729# CONFIG_NLS_CODEPAGE_869 is not set
730# CONFIG_NLS_CODEPAGE_936 is not set
731# CONFIG_NLS_CODEPAGE_950 is not set
732# CONFIG_NLS_CODEPAGE_932 is not set
733# CONFIG_NLS_CODEPAGE_949 is not set
734# CONFIG_NLS_CODEPAGE_874 is not set
735# CONFIG_NLS_ISO8859_8 is not set
736# CONFIG_NLS_CODEPAGE_1250 is not set
737# CONFIG_NLS_CODEPAGE_1251 is not set
738# CONFIG_NLS_ASCII is not set
739CONFIG_NLS_ISO8859_1=y
740# CONFIG_NLS_ISO8859_2 is not set
741# CONFIG_NLS_ISO8859_3 is not set
742# CONFIG_NLS_ISO8859_4 is not set
743# CONFIG_NLS_ISO8859_5 is not set
744# CONFIG_NLS_ISO8859_6 is not set
745# CONFIG_NLS_ISO8859_7 is not set
746# CONFIG_NLS_ISO8859_9 is not set
747# CONFIG_NLS_ISO8859_13 is not set
748# CONFIG_NLS_ISO8859_14 is not set
749# CONFIG_NLS_ISO8859_15 is not set
750# CONFIG_NLS_KOI8_R is not set
751# CONFIG_NLS_KOI8_U is not set
752# CONFIG_NLS_UTF8 is not set
753
754#
755# Profiling support
756#
757# CONFIG_PROFILING is not set
758
759#
760# Kernel hacking
761#
762# CONFIG_PRINTK_TIME is not set
763CONFIG_DEBUG_KERNEL=y
764CONFIG_MAGIC_SYSRQ=y
765CONFIG_LOG_BUF_SHIFT=14
766# CONFIG_SCHEDSTATS is not set
767# CONFIG_DEBUG_SLAB is not set
768# CONFIG_DEBUG_SPINLOCK is not set
769# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
770# CONFIG_DEBUG_KOBJECT is not set
771CONFIG_DEBUG_BUGVERBOSE=y
772CONFIG_DEBUG_INFO=y
773# CONFIG_DEBUG_FS is not set
774CONFIG_FRAME_POINTER=y
775CONFIG_DEBUG_USER=y
776# CONFIG_DEBUG_WAITQ is not set
777CONFIG_DEBUG_ERRORS=y
778CONFIG_DEBUG_LL=y
779# CONFIG_DEBUG_ICEDCC 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#
795
796#
797# Library routines
798#
799# CONFIG_CRC_CCITT is not set
800CONFIG_CRC32=y
801# CONFIG_LIBCRC32C is not set
802CONFIG_ZLIB_INFLATE=y
803CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/lusl7200_defconfig b/arch/arm/configs/lusl7200_defconfig
new file mode 100644
index 000000000000..3ca64cabc92c
--- /dev/null
+++ b/arch/arm/configs/lusl7200_defconfig
@@ -0,0 +1,455 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Mon Mar 28 00:24:38 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12CONFIG_FIQ=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
27CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32# CONFIG_IKCONFIG is not set
33CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51CONFIG_MODULES=y
52# CONFIG_MODULE_UNLOAD is not set
53CONFIG_OBSOLETE_MODPARM=y
54# CONFIG_MODVERSIONS is not set
55# CONFIG_MODULE_SRCVERSION_ALL is not set
56CONFIG_KMOD=y
57
58#
59# System Type
60#
61# CONFIG_ARCH_CLPS7500 is not set
62# CONFIG_ARCH_CLPS711X is not set
63# CONFIG_ARCH_CO285 is not set
64# CONFIG_ARCH_EBSA110 is not set
65# CONFIG_ARCH_CAMELOT is not set
66# CONFIG_ARCH_FOOTBRIDGE is not set
67# CONFIG_ARCH_INTEGRATOR is not set
68# CONFIG_ARCH_IOP3XX is not set
69# CONFIG_ARCH_IXP4XX is not set
70# CONFIG_ARCH_IXP2000 is not set
71CONFIG_ARCH_L7200=y
72# CONFIG_ARCH_PXA is not set
73# CONFIG_ARCH_RPC is not set
74# CONFIG_ARCH_SA1100 is not set
75# CONFIG_ARCH_S3C2410 is not set
76# CONFIG_ARCH_SHARK is not set
77# CONFIG_ARCH_LH7A40X is not set
78# CONFIG_ARCH_OMAP is not set
79# CONFIG_ARCH_VERSATILE is not set
80# CONFIG_ARCH_IMX is not set
81# CONFIG_ARCH_H720X is not set
82
83#
84# Processor Type
85#
86CONFIG_CPU_32=y
87CONFIG_CPU_ARM720T=y
88CONFIG_CPU_32v4=y
89CONFIG_CPU_ABRT_LV4T=y
90CONFIG_CPU_CACHE_V4=y
91CONFIG_CPU_CACHE_VIVT=y
92CONFIG_CPU_COPY_V4WT=y
93CONFIG_CPU_TLB_V4WT=y
94
95#
96# Processor Features
97#
98# CONFIG_ARM_THUMB is not set
99
100#
101# Bus support
102#
103
104#
105# PCCARD (PCMCIA/CardBus) support
106#
107# CONFIG_PCCARD is not set
108
109#
110# Kernel Features
111#
112# CONFIG_PREEMPT is not set
113CONFIG_ALIGNMENT_TRAP=y
114
115#
116# Boot options
117#
118CONFIG_ZBOOT_ROM_TEXT=0x00010000
119CONFIG_ZBOOT_ROM_BSS=0xf03e0000
120CONFIG_ZBOOT_ROM=y
121CONFIG_CMDLINE="console=tty0 console=ttyLU1,115200 root=/dev/ram initrd=0xf1000000,0x005dac7b mem=32M"
122
123#
124# Floating point emulation
125#
126
127#
128# At least one emulation must be selected
129#
130# CONFIG_FPE_NWFPE is not set
131# CONFIG_FPE_FASTFPE is not set
132
133#
134# Userspace binary formats
135#
136CONFIG_BINFMT_ELF=y
137CONFIG_BINFMT_AOUT=y
138# CONFIG_BINFMT_MISC is not set
139# CONFIG_ARTHUR is not set
140
141#
142# Power management options
143#
144# CONFIG_PM is not set
145
146#
147# Device Drivers
148#
149
150#
151# Generic Driver Options
152#
153CONFIG_STANDALONE=y
154CONFIG_PREVENT_FIRMWARE_BUILD=y
155# CONFIG_FW_LOADER is not set
156
157#
158# Memory Technology Devices (MTD)
159#
160# CONFIG_MTD is not set
161
162#
163# Parallel port support
164#
165# CONFIG_PARPORT is not set
166
167#
168# Plug and Play support
169#
170
171#
172# Block devices
173#
174# CONFIG_BLK_DEV_FD is not set
175# CONFIG_BLK_DEV_COW_COMMON is not set
176# CONFIG_BLK_DEV_LOOP is not set
177CONFIG_BLK_DEV_RAM=y
178CONFIG_BLK_DEV_RAM_COUNT=16
179CONFIG_BLK_DEV_RAM_SIZE=4096
180CONFIG_BLK_DEV_INITRD=y
181CONFIG_INITRAMFS_SOURCE=""
182# CONFIG_CDROM_PKTCDVD is not set
183
184#
185# IO Schedulers
186#
187CONFIG_IOSCHED_NOOP=y
188CONFIG_IOSCHED_AS=y
189CONFIG_IOSCHED_DEADLINE=y
190CONFIG_IOSCHED_CFQ=y
191
192#
193# ATA/ATAPI/MFM/RLL support
194#
195# CONFIG_IDE is not set
196
197#
198# SCSI device support
199#
200# CONFIG_SCSI is not set
201
202#
203# Multi-device support (RAID and LVM)
204#
205# CONFIG_MD is not set
206
207#
208# Fusion MPT device support
209#
210
211#
212# IEEE 1394 (FireWire) support
213#
214
215#
216# I2O device support
217#
218
219#
220# Networking support
221#
222# CONFIG_NET is not set
223# CONFIG_NETPOLL is not set
224# CONFIG_NET_POLL_CONTROLLER is not set
225
226#
227# ISDN subsystem
228#
229
230#
231# Input device support
232#
233# CONFIG_INPUT is not set
234
235#
236# Hardware I/O ports
237#
238CONFIG_SERIO=y
239# CONFIG_SERIO_SERPORT is not set
240# CONFIG_SERIO_LIBPS2 is not set
241# CONFIG_SERIO_RAW is not set
242# CONFIG_GAMEPORT is not set
243CONFIG_SOUND_GAMEPORT=y
244
245#
246# Character devices
247#
248# CONFIG_VT is not set
249CONFIG_SERIAL_NONSTANDARD=y
250# CONFIG_COMPUTONE is not set
251# CONFIG_ROCKETPORT is not set
252# CONFIG_CYCLADES is not set
253# CONFIG_DIGIEPCA is not set
254# CONFIG_MOXA_INTELLIO is not set
255# CONFIG_MOXA_SMARTIO is not set
256# CONFIG_ISI is not set
257# CONFIG_SYNCLINKMP is not set
258# CONFIG_N_HDLC is not set
259# CONFIG_RISCOM8 is not set
260# CONFIG_SPECIALIX is not set
261# CONFIG_SX is not set
262# CONFIG_RIO is not set
263# CONFIG_STALDRV is not set
264
265#
266# Serial drivers
267#
268# CONFIG_SERIAL_8250 is not set
269
270#
271# Non-8250 serial port support
272#
273CONFIG_UNIX98_PTYS=y
274CONFIG_LEGACY_PTYS=y
275CONFIG_LEGACY_PTY_COUNT=256
276
277#
278# IPMI
279#
280# CONFIG_IPMI_HANDLER is not set
281
282#
283# Watchdog Cards
284#
285# CONFIG_WATCHDOG is not set
286# CONFIG_NVRAM is not set
287# CONFIG_RTC is not set
288# CONFIG_DTLK is not set
289# CONFIG_R3964 is not set
290
291#
292# Ftape, the floppy tape device driver
293#
294# CONFIG_DRM is not set
295# CONFIG_RAW_DRIVER is not set
296
297#
298# TPM devices
299#
300# CONFIG_TCG_TPM is not set
301
302#
303# I2C support
304#
305# CONFIG_I2C is not set
306
307#
308# Misc devices
309#
310
311#
312# Multimedia devices
313#
314# CONFIG_VIDEO_DEV is not set
315
316#
317# Digital Video Broadcasting Devices
318#
319
320#
321# Graphics support
322#
323# CONFIG_FB is not set
324
325#
326# Sound
327#
328# CONFIG_SOUND is not set
329
330#
331# USB support
332#
333CONFIG_USB_ARCH_HAS_HCD=y
334# CONFIG_USB_ARCH_HAS_OHCI is not set
335# CONFIG_USB is not set
336
337#
338# USB Gadget Support
339#
340# CONFIG_USB_GADGET is not set
341
342#
343# MMC/SD Card support
344#
345# CONFIG_MMC is not set
346
347#
348# File systems
349#
350CONFIG_EXT2_FS=y
351# CONFIG_EXT2_FS_XATTR is not set
352# CONFIG_EXT3_FS is not set
353# CONFIG_JBD is not set
354# CONFIG_REISERFS_FS is not set
355# CONFIG_JFS_FS is not set
356
357#
358# XFS support
359#
360# CONFIG_XFS_FS is not set
361# CONFIG_MINIX_FS is not set
362# CONFIG_ROMFS_FS is not set
363# CONFIG_QUOTA is not set
364CONFIG_DNOTIFY=y
365# CONFIG_AUTOFS_FS is not set
366# CONFIG_AUTOFS4_FS is not set
367
368#
369# CD-ROM/DVD Filesystems
370#
371# CONFIG_ISO9660_FS is not set
372# CONFIG_UDF_FS is not set
373
374#
375# DOS/FAT/NT Filesystems
376#
377# CONFIG_MSDOS_FS is not set
378# CONFIG_VFAT_FS is not set
379# CONFIG_NTFS_FS is not set
380
381#
382# Pseudo filesystems
383#
384CONFIG_PROC_FS=y
385CONFIG_SYSFS=y
386# CONFIG_DEVFS_FS is not set
387# CONFIG_DEVPTS_FS_XATTR is not set
388# CONFIG_TMPFS is not set
389# CONFIG_HUGETLB_PAGE is not set
390CONFIG_RAMFS=y
391
392#
393# Miscellaneous filesystems
394#
395# CONFIG_ADFS_FS is not set
396# CONFIG_AFFS_FS is not set
397# CONFIG_HFS_FS is not set
398# CONFIG_HFSPLUS_FS is not set
399# CONFIG_BEFS_FS is not set
400# CONFIG_BFS_FS is not set
401# CONFIG_EFS_FS is not set
402# CONFIG_CRAMFS is not set
403# CONFIG_VXFS_FS is not set
404# CONFIG_HPFS_FS is not set
405# CONFIG_QNX4FS_FS is not set
406# CONFIG_SYSV_FS is not set
407# CONFIG_UFS_FS is not set
408
409#
410# Partition Types
411#
412# CONFIG_PARTITION_ADVANCED is not set
413CONFIG_MSDOS_PARTITION=y
414
415#
416# Native Language Support
417#
418# CONFIG_NLS is not set
419
420#
421# Profiling support
422#
423# CONFIG_PROFILING is not set
424
425#
426# Kernel hacking
427#
428# CONFIG_PRINTK_TIME is not set
429# CONFIG_DEBUG_KERNEL is not set
430CONFIG_LOG_BUF_SHIFT=14
431# CONFIG_DEBUG_BUGVERBOSE is not set
432CONFIG_FRAME_POINTER=y
433CONFIG_DEBUG_USER=y
434
435#
436# Security options
437#
438# CONFIG_KEYS is not set
439# CONFIG_SECURITY is not set
440
441#
442# Cryptographic options
443#
444# CONFIG_CRYPTO is not set
445
446#
447# Hardware crypto devices
448#
449
450#
451# Library routines
452#
453# CONFIG_CRC_CCITT is not set
454# CONFIG_CRC32 is not set
455# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/configs/mainstone_defconfig b/arch/arm/configs/mainstone_defconfig
new file mode 100644
index 000000000000..153d68594beb
--- /dev/null
+++ b/arch/arm/configs/mainstone_defconfig
@@ -0,0 +1,797 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sat Mar 26 20:00:45 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_UNLOAD is not set
54CONFIG_OBSOLETE_MODPARM=y
55# CONFIG_MODVERSIONS is not set
56# CONFIG_MODULE_SRCVERSION_ALL is not set
57# CONFIG_KMOD is not set
58
59#
60# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66# CONFIG_ARCH_CAMELOT is not set
67# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73CONFIG_ARCH_PXA=y
74# CONFIG_ARCH_RPC is not set
75# CONFIG_ARCH_SA1100 is not set
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81# CONFIG_ARCH_IMX is not set
82# CONFIG_ARCH_H720X is not set
83
84#
85# Intel PXA2xx Implementations
86#
87# CONFIG_ARCH_LUBBOCK is not set
88CONFIG_MACH_MAINSTONE=y
89# CONFIG_ARCH_PXA_IDP is not set
90# CONFIG_PXA_SHARPSL is not set
91CONFIG_PXA27x=y
92CONFIG_IWMMXT=y
93
94#
95# Processor Type
96#
97CONFIG_CPU_32=y
98CONFIG_CPU_XSCALE=y
99CONFIG_CPU_32v5=y
100CONFIG_CPU_ABRT_EV5T=y
101CONFIG_CPU_CACHE_VIVT=y
102CONFIG_CPU_TLB_V4WBI=y
103CONFIG_CPU_MINICACHE=y
104
105#
106# Processor Features
107#
108# CONFIG_ARM_THUMB is not set
109CONFIG_XSCALE_PMU=y
110
111#
112# Bus support
113#
114
115#
116# PCCARD (PCMCIA/CardBus) support
117#
118# CONFIG_PCCARD is not set
119
120#
121# Kernel Features
122#
123# CONFIG_PREEMPT is not set
124CONFIG_LEDS=y
125CONFIG_LEDS_TIMER=y
126CONFIG_LEDS_CPU=y
127CONFIG_ALIGNMENT_TRAP=y
128
129#
130# Boot options
131#
132CONFIG_ZBOOT_ROM_TEXT=0x0
133CONFIG_ZBOOT_ROM_BSS=0x0
134CONFIG_CMDLINE="root=/dev/nfs ip=bootp console=ttyS0,115200 mem=64M"
135# CONFIG_XIP_KERNEL is not set
136
137#
138# Floating point emulation
139#
140
141#
142# At least one emulation must be selected
143#
144CONFIG_FPE_NWFPE=y
145# CONFIG_FPE_NWFPE_XP is not set
146# CONFIG_FPE_FASTFPE is not set
147
148#
149# Userspace binary formats
150#
151CONFIG_BINFMT_ELF=y
152# CONFIG_BINFMT_AOUT is not set
153# CONFIG_BINFMT_MISC is not set
154# CONFIG_ARTHUR is not set
155
156#
157# Power management options
158#
159# CONFIG_PM is not set
160
161#
162# Device Drivers
163#
164
165#
166# Generic Driver Options
167#
168CONFIG_STANDALONE=y
169CONFIG_PREVENT_FIRMWARE_BUILD=y
170# CONFIG_FW_LOADER is not set
171# CONFIG_DEBUG_DRIVER is not set
172
173#
174# Memory Technology Devices (MTD)
175#
176CONFIG_MTD=y
177# CONFIG_MTD_DEBUG is not set
178# CONFIG_MTD_CONCAT is not set
179CONFIG_MTD_PARTITIONS=y
180CONFIG_MTD_REDBOOT_PARTS=y
181CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
182# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
183# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
184# CONFIG_MTD_CMDLINE_PARTS is not set
185# CONFIG_MTD_AFS_PARTS is not set
186
187#
188# User Modules And Translation Layers
189#
190CONFIG_MTD_CHAR=y
191CONFIG_MTD_BLOCK=y
192# CONFIG_FTL is not set
193# CONFIG_NFTL is not set
194# CONFIG_INFTL is not set
195
196#
197# RAM/ROM/Flash chip drivers
198#
199CONFIG_MTD_CFI=y
200# CONFIG_MTD_JEDECPROBE is not set
201CONFIG_MTD_GEN_PROBE=y
202CONFIG_MTD_CFI_ADV_OPTIONS=y
203CONFIG_MTD_CFI_NOSWAP=y
204# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
205# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
206CONFIG_MTD_CFI_GEOMETRY=y
207CONFIG_MTD_MAP_BANK_WIDTH_1=y
208CONFIG_MTD_MAP_BANK_WIDTH_2=y
209CONFIG_MTD_MAP_BANK_WIDTH_4=y
210# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
211# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
212# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
213# CONFIG_MTD_CFI_I1 is not set
214CONFIG_MTD_CFI_I2=y
215# CONFIG_MTD_CFI_I4 is not set
216# CONFIG_MTD_CFI_I8 is not set
217CONFIG_MTD_CFI_INTELEXT=y
218# CONFIG_MTD_CFI_AMDSTD is not set
219# CONFIG_MTD_CFI_STAA is not set
220CONFIG_MTD_CFI_UTIL=y
221# CONFIG_MTD_RAM is not set
222# CONFIG_MTD_ROM is not set
223# CONFIG_MTD_ABSENT is not set
224# CONFIG_MTD_XIP is not set
225
226#
227# Mapping drivers for chip access
228#
229# CONFIG_MTD_COMPLEX_MAPPINGS is not set
230# CONFIG_MTD_PHYSMAP is not set
231# CONFIG_MTD_ARM_INTEGRATOR is not set
232# CONFIG_MTD_EDB7312 is not set
233# CONFIG_MTD_SHARP_SL is not set
234
235#
236# Self-contained MTD device drivers
237#
238# CONFIG_MTD_SLRAM is not set
239# CONFIG_MTD_PHRAM is not set
240# CONFIG_MTD_MTDRAM is not set
241# CONFIG_MTD_BLKMTD is not set
242# CONFIG_MTD_BLOCK2MTD is not set
243
244#
245# Disk-On-Chip Device Drivers
246#
247# CONFIG_MTD_DOC2000 is not set
248# CONFIG_MTD_DOC2001 is not set
249# CONFIG_MTD_DOC2001PLUS is not set
250
251#
252# NAND Flash Device Drivers
253#
254# CONFIG_MTD_NAND is not set
255
256#
257# Parallel port support
258#
259# CONFIG_PARPORT is not set
260
261#
262# Plug and Play support
263#
264
265#
266# Block devices
267#
268# CONFIG_BLK_DEV_FD is not set
269# CONFIG_BLK_DEV_COW_COMMON is not set
270# CONFIG_BLK_DEV_LOOP is not set
271# CONFIG_BLK_DEV_NBD is not set
272# CONFIG_BLK_DEV_RAM is not set
273CONFIG_BLK_DEV_RAM_COUNT=16
274CONFIG_INITRAMFS_SOURCE=""
275# CONFIG_CDROM_PKTCDVD is not set
276
277#
278# IO Schedulers
279#
280CONFIG_IOSCHED_NOOP=y
281CONFIG_IOSCHED_AS=y
282CONFIG_IOSCHED_DEADLINE=y
283CONFIG_IOSCHED_CFQ=y
284# CONFIG_ATA_OVER_ETH is not set
285
286#
287# ATA/ATAPI/MFM/RLL support
288#
289CONFIG_IDE=y
290CONFIG_BLK_DEV_IDE=y
291
292#
293# Please see Documentation/ide.txt for help/info on IDE drives
294#
295# CONFIG_BLK_DEV_IDE_SATA is not set
296CONFIG_BLK_DEV_IDEDISK=y
297# CONFIG_IDEDISK_MULTI_MODE is not set
298# CONFIG_BLK_DEV_IDECD is not set
299# CONFIG_BLK_DEV_IDETAPE is not set
300# CONFIG_BLK_DEV_IDEFLOPPY is not set
301# CONFIG_IDE_TASK_IOCTL is not set
302
303#
304# IDE chipset support/bugfixes
305#
306# CONFIG_IDE_GENERIC is not set
307# CONFIG_IDE_ARM is not set
308# CONFIG_BLK_DEV_IDEDMA is not set
309# CONFIG_IDEDMA_AUTO is not set
310# CONFIG_BLK_DEV_HD is not set
311
312#
313# SCSI device support
314#
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
326#
327# IEEE 1394 (FireWire) support
328#
329
330#
331# I2O device support
332#
333
334#
335# Networking support
336#
337CONFIG_NET=y
338
339#
340# Networking options
341#
342# CONFIG_PACKET is not set
343# CONFIG_NETLINK_DEV is not set
344CONFIG_UNIX=y
345# CONFIG_NET_KEY is not set
346CONFIG_INET=y
347# CONFIG_IP_MULTICAST is not set
348# CONFIG_IP_ADVANCED_ROUTER is not set
349CONFIG_IP_PNP=y
350# CONFIG_IP_PNP_DHCP is not set
351CONFIG_IP_PNP_BOOTP=y
352# CONFIG_IP_PNP_RARP is not set
353# CONFIG_NET_IPIP is not set
354# CONFIG_NET_IPGRE is not set
355# CONFIG_ARPD is not set
356# CONFIG_SYN_COOKIES is not set
357# CONFIG_INET_AH is not set
358# CONFIG_INET_ESP is not set
359# CONFIG_INET_IPCOMP is not set
360# CONFIG_INET_TUNNEL is not set
361CONFIG_IP_TCPDIAG=y
362# CONFIG_IP_TCPDIAG_IPV6 is not set
363# CONFIG_IPV6 is not set
364# CONFIG_NETFILTER is not set
365
366#
367# SCTP Configuration (EXPERIMENTAL)
368#
369# CONFIG_IP_SCTP is not set
370# CONFIG_ATM is not set
371# CONFIG_BRIDGE is not set
372# CONFIG_VLAN_8021Q is not set
373# CONFIG_DECNET is not set
374# CONFIG_LLC2 is not set
375# CONFIG_IPX is not set
376# CONFIG_ATALK is not set
377# CONFIG_X25 is not set
378# CONFIG_LAPB is not set
379# CONFIG_NET_DIVERT is not set
380# CONFIG_ECONET is not set
381# CONFIG_WAN_ROUTER is not set
382
383#
384# QoS and/or fair queueing
385#
386# CONFIG_NET_SCHED is not set
387# CONFIG_NET_CLS_ROUTE is not set
388
389#
390# Network testing
391#
392# CONFIG_NET_PKTGEN is not set
393# CONFIG_NETPOLL is not set
394# CONFIG_NET_POLL_CONTROLLER is not set
395# CONFIG_HAMRADIO is not set
396# CONFIG_IRDA is not set
397# CONFIG_BT is not set
398CONFIG_NETDEVICES=y
399# CONFIG_DUMMY is not set
400# CONFIG_BONDING is not set
401# CONFIG_EQUALIZER is not set
402# CONFIG_TUN is not set
403
404#
405# Ethernet (10 or 100Mbit)
406#
407CONFIG_NET_ETHERNET=y
408CONFIG_MII=y
409CONFIG_SMC91X=y
410
411#
412# Ethernet (1000 Mbit)
413#
414
415#
416# Ethernet (10000 Mbit)
417#
418
419#
420# Token Ring devices
421#
422
423#
424# Wireless LAN (non-hamradio)
425#
426# CONFIG_NET_RADIO is not set
427
428#
429# Wan interfaces
430#
431# CONFIG_WAN is not set
432# CONFIG_PPP is not set
433# CONFIG_SLIP is not set
434# CONFIG_SHAPER is not set
435# CONFIG_NETCONSOLE is not set
436
437#
438# ISDN subsystem
439#
440# CONFIG_ISDN is not set
441
442#
443# Input device support
444#
445CONFIG_INPUT=y
446
447#
448# Userland interfaces
449#
450CONFIG_INPUT_MOUSEDEV=y
451CONFIG_INPUT_MOUSEDEV_PSAUX=y
452CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
453CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
454# CONFIG_INPUT_JOYDEV is not set
455# CONFIG_INPUT_TSDEV is not set
456CONFIG_INPUT_EVDEV=y
457# CONFIG_INPUT_EVBUG is not set
458
459#
460# Input Device Drivers
461#
462CONFIG_INPUT_KEYBOARD=y
463CONFIG_KEYBOARD_ATKBD=y
464# CONFIG_KEYBOARD_SUNKBD is not set
465# CONFIG_KEYBOARD_LKKBD is not set
466# CONFIG_KEYBOARD_XTKBD is not set
467# CONFIG_KEYBOARD_NEWTON is not set
468# CONFIG_INPUT_MOUSE is not set
469# CONFIG_INPUT_JOYSTICK is not set
470# CONFIG_INPUT_TOUCHSCREEN is not set
471# CONFIG_INPUT_MISC is not set
472
473#
474# Hardware I/O ports
475#
476CONFIG_SERIO=y
477# CONFIG_SERIO_SERPORT is not set
478CONFIG_SERIO_LIBPS2=y
479# CONFIG_SERIO_RAW is not set
480# CONFIG_GAMEPORT is not set
481CONFIG_SOUND_GAMEPORT=y
482
483#
484# Character devices
485#
486CONFIG_VT=y
487CONFIG_VT_CONSOLE=y
488CONFIG_HW_CONSOLE=y
489# CONFIG_SERIAL_NONSTANDARD is not set
490
491#
492# Serial drivers
493#
494# CONFIG_SERIAL_8250 is not set
495
496#
497# Non-8250 serial port support
498#
499CONFIG_SERIAL_PXA=y
500CONFIG_SERIAL_PXA_CONSOLE=y
501CONFIG_SERIAL_CORE=y
502CONFIG_SERIAL_CORE_CONSOLE=y
503CONFIG_UNIX98_PTYS=y
504CONFIG_LEGACY_PTYS=y
505CONFIG_LEGACY_PTY_COUNT=256
506
507#
508# IPMI
509#
510# CONFIG_IPMI_HANDLER is not set
511
512#
513# Watchdog Cards
514#
515# CONFIG_WATCHDOG is not set
516# CONFIG_NVRAM is not set
517# CONFIG_RTC is not set
518# CONFIG_DTLK is not set
519# CONFIG_R3964 is not set
520
521#
522# Ftape, the floppy tape device driver
523#
524# CONFIG_DRM is not set
525# CONFIG_RAW_DRIVER is not set
526
527#
528# TPM devices
529#
530# CONFIG_TCG_TPM is not set
531
532#
533# I2C support
534#
535# CONFIG_I2C is not set
536
537#
538# Misc devices
539#
540
541#
542# Multimedia devices
543#
544# CONFIG_VIDEO_DEV is not set
545
546#
547# Digital Video Broadcasting Devices
548#
549# CONFIG_DVB is not set
550
551#
552# Graphics support
553#
554CONFIG_FB=y
555CONFIG_FB_CFB_FILLRECT=y
556CONFIG_FB_CFB_COPYAREA=y
557CONFIG_FB_CFB_IMAGEBLIT=y
558CONFIG_FB_SOFT_CURSOR=y
559# CONFIG_FB_MODE_HELPERS is not set
560# CONFIG_FB_TILEBLITTING is not set
561CONFIG_FB_PXA=y
562# CONFIG_FB_PXA_PARAMETERS is not set
563# CONFIG_FB_VIRTUAL is not set
564
565#
566# Console display driver support
567#
568# CONFIG_VGA_CONSOLE is not set
569CONFIG_DUMMY_CONSOLE=y
570CONFIG_FRAMEBUFFER_CONSOLE=y
571# CONFIG_FONTS is not set
572CONFIG_FONT_8x8=y
573CONFIG_FONT_8x16=y
574
575#
576# Logo configuration
577#
578CONFIG_LOGO=y
579CONFIG_LOGO_LINUX_MONO=y
580CONFIG_LOGO_LINUX_VGA16=y
581CONFIG_LOGO_LINUX_CLUT224=y
582# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
583
584#
585# Sound
586#
587# CONFIG_SOUND is not set
588
589#
590# USB support
591#
592CONFIG_USB_ARCH_HAS_HCD=y
593CONFIG_USB_ARCH_HAS_OHCI=y
594# CONFIG_USB is not set
595
596#
597# USB Gadget Support
598#
599# CONFIG_USB_GADGET is not set
600
601#
602# MMC/SD Card support
603#
604# CONFIG_MMC is not set
605
606#
607# File systems
608#
609CONFIG_EXT2_FS=y
610# CONFIG_EXT2_FS_XATTR is not set
611# CONFIG_EXT3_FS is not set
612# CONFIG_JBD is not set
613# CONFIG_REISERFS_FS is not set
614# CONFIG_JFS_FS is not set
615
616#
617# XFS support
618#
619# CONFIG_XFS_FS is not set
620# CONFIG_MINIX_FS is not set
621# CONFIG_ROMFS_FS is not set
622# CONFIG_QUOTA is not set
623CONFIG_DNOTIFY=y
624# CONFIG_AUTOFS_FS is not set
625# CONFIG_AUTOFS4_FS is not set
626
627#
628# CD-ROM/DVD Filesystems
629#
630# CONFIG_ISO9660_FS is not set
631# CONFIG_UDF_FS is not set
632
633#
634# DOS/FAT/NT Filesystems
635#
636CONFIG_FAT_FS=y
637CONFIG_MSDOS_FS=y
638# CONFIG_VFAT_FS is not set
639CONFIG_FAT_DEFAULT_CODEPAGE=437
640# CONFIG_NTFS_FS is not set
641
642#
643# Pseudo filesystems
644#
645CONFIG_PROC_FS=y
646CONFIG_SYSFS=y
647# CONFIG_DEVFS_FS is not set
648# CONFIG_DEVPTS_FS_XATTR is not set
649# CONFIG_TMPFS is not set
650# CONFIG_HUGETLB_PAGE is not set
651CONFIG_RAMFS=y
652
653#
654# Miscellaneous filesystems
655#
656# CONFIG_ADFS_FS is not set
657# CONFIG_AFFS_FS is not set
658# CONFIG_HFS_FS is not set
659# CONFIG_HFSPLUS_FS is not set
660# CONFIG_BEFS_FS is not set
661# CONFIG_BFS_FS is not set
662# CONFIG_EFS_FS is not set
663# CONFIG_JFFS_FS is not set
664CONFIG_JFFS2_FS=y
665CONFIG_JFFS2_FS_DEBUG=0
666# CONFIG_JFFS2_FS_NAND is not set
667# CONFIG_JFFS2_FS_NOR_ECC is not set
668# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
669CONFIG_JFFS2_ZLIB=y
670CONFIG_JFFS2_RTIME=y
671# CONFIG_JFFS2_RUBIN is not set
672# CONFIG_CRAMFS is not set
673# CONFIG_VXFS_FS is not set
674# CONFIG_HPFS_FS is not set
675# CONFIG_QNX4FS_FS is not set
676# CONFIG_SYSV_FS is not set
677# CONFIG_UFS_FS is not set
678
679#
680# Network File Systems
681#
682CONFIG_NFS_FS=y
683# CONFIG_NFS_V3 is not set
684# CONFIG_NFS_V4 is not set
685# CONFIG_NFS_DIRECTIO is not set
686# CONFIG_NFSD is not set
687CONFIG_ROOT_NFS=y
688CONFIG_LOCKD=y
689CONFIG_SUNRPC=y
690# CONFIG_RPCSEC_GSS_KRB5 is not set
691# CONFIG_RPCSEC_GSS_SPKM3 is not set
692# CONFIG_SMB_FS is not set
693# CONFIG_CIFS is not set
694# CONFIG_NCP_FS is not set
695# CONFIG_CODA_FS is not set
696# CONFIG_AFS_FS is not set
697
698#
699# Partition Types
700#
701# CONFIG_PARTITION_ADVANCED is not set
702CONFIG_MSDOS_PARTITION=y
703
704#
705# Native Language Support
706#
707CONFIG_NLS=y
708CONFIG_NLS_DEFAULT="iso8859-1"
709# CONFIG_NLS_CODEPAGE_437 is not set
710# CONFIG_NLS_CODEPAGE_737 is not set
711# CONFIG_NLS_CODEPAGE_775 is not set
712# CONFIG_NLS_CODEPAGE_850 is not set
713# CONFIG_NLS_CODEPAGE_852 is not set
714# CONFIG_NLS_CODEPAGE_855 is not set
715# CONFIG_NLS_CODEPAGE_857 is not set
716# CONFIG_NLS_CODEPAGE_860 is not set
717# CONFIG_NLS_CODEPAGE_861 is not set
718# CONFIG_NLS_CODEPAGE_862 is not set
719# CONFIG_NLS_CODEPAGE_863 is not set
720# CONFIG_NLS_CODEPAGE_864 is not set
721# CONFIG_NLS_CODEPAGE_865 is not set
722# CONFIG_NLS_CODEPAGE_866 is not set
723# CONFIG_NLS_CODEPAGE_869 is not set
724# CONFIG_NLS_CODEPAGE_936 is not set
725# CONFIG_NLS_CODEPAGE_950 is not set
726# CONFIG_NLS_CODEPAGE_932 is not set
727# CONFIG_NLS_CODEPAGE_949 is not set
728# CONFIG_NLS_CODEPAGE_874 is not set
729# CONFIG_NLS_ISO8859_8 is not set
730# CONFIG_NLS_CODEPAGE_1250 is not set
731# CONFIG_NLS_CODEPAGE_1251 is not set
732# CONFIG_NLS_ASCII is not set
733CONFIG_NLS_ISO8859_1=y
734# CONFIG_NLS_ISO8859_2 is not set
735# CONFIG_NLS_ISO8859_3 is not set
736# CONFIG_NLS_ISO8859_4 is not set
737# CONFIG_NLS_ISO8859_5 is not set
738# CONFIG_NLS_ISO8859_6 is not set
739# CONFIG_NLS_ISO8859_7 is not set
740# CONFIG_NLS_ISO8859_9 is not set
741# CONFIG_NLS_ISO8859_13 is not set
742# CONFIG_NLS_ISO8859_14 is not set
743# CONFIG_NLS_ISO8859_15 is not set
744# CONFIG_NLS_KOI8_R is not set
745# CONFIG_NLS_KOI8_U is not set
746# CONFIG_NLS_UTF8 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
757CONFIG_DEBUG_KERNEL=y
758CONFIG_MAGIC_SYSRQ=y
759CONFIG_LOG_BUF_SHIFT=14
760# CONFIG_SCHEDSTATS is not set
761# CONFIG_DEBUG_SLAB is not set
762# CONFIG_DEBUG_SPINLOCK is not set
763# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
764# CONFIG_DEBUG_KOBJECT is not set
765CONFIG_DEBUG_BUGVERBOSE=y
766CONFIG_DEBUG_INFO=y
767# CONFIG_DEBUG_FS is not set
768CONFIG_FRAME_POINTER=y
769CONFIG_DEBUG_USER=y
770# CONFIG_DEBUG_WAITQ is not set
771CONFIG_DEBUG_ERRORS=y
772CONFIG_DEBUG_LL=y
773# CONFIG_DEBUG_ICEDCC is not set
774
775#
776# Security options
777#
778# CONFIG_KEYS is not set
779# CONFIG_SECURITY is not set
780
781#
782# Cryptographic options
783#
784# CONFIG_CRYPTO is not set
785
786#
787# Hardware crypto devices
788#
789
790#
791# Library routines
792#
793# CONFIG_CRC_CCITT is not set
794CONFIG_CRC32=y
795# CONFIG_LIBCRC32C is not set
796CONFIG_ZLIB_INFLATE=y
797CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/mx1ads_defconfig b/arch/arm/configs/mx1ads_defconfig
new file mode 100644
index 000000000000..6517d167acf0
--- /dev/null
+++ b/arch/arm/configs/mx1ads_defconfig
@@ -0,0 +1,745 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 02:15:46 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19CONFIG_LOCK_KERNEL=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
29# CONFIG_SYSCTL is not set
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34CONFIG_EMBEDDED=y
35# CONFIG_KALLSYMS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
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# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66# CONFIG_ARCH_CAMELOT is not set
67# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73# CONFIG_ARCH_PXA is not set
74# CONFIG_ARCH_RPC is not set
75# CONFIG_ARCH_SA1100 is not set
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81CONFIG_ARCH_IMX=y
82# CONFIG_ARCH_H720X is not set
83
84#
85# IMX Implementations
86#
87CONFIG_ARCH_MX1ADS=y
88
89#
90# Processor Type
91#
92CONFIG_CPU_32=y
93CONFIG_CPU_ARM920T=y
94CONFIG_CPU_32v4=y
95CONFIG_CPU_ABRT_EV4T=y
96CONFIG_CPU_CACHE_V4WT=y
97CONFIG_CPU_CACHE_VIVT=y
98CONFIG_CPU_COPY_V4WB=y
99CONFIG_CPU_TLB_V4WBI=y
100
101#
102# Processor Features
103#
104# CONFIG_ARM_THUMB is not set
105# CONFIG_CPU_ICACHE_DISABLE is not set
106# CONFIG_CPU_DCACHE_DISABLE is not set
107# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
108
109#
110# Bus support
111#
112CONFIG_ISA=y
113
114#
115# PCCARD (PCMCIA/CardBus) support
116#
117# CONFIG_PCCARD is not set
118
119#
120# Kernel Features
121#
122CONFIG_PREEMPT=y
123# CONFIG_LEDS is not set
124CONFIG_ALIGNMENT_TRAP=y
125
126#
127# Boot options
128#
129CONFIG_ZBOOT_ROM_TEXT=0x0
130CONFIG_ZBOOT_ROM_BSS=0x0
131CONFIG_CMDLINE="console=ttySMX0,57600n8 ip=bootp root=/dev/nfs"
132# CONFIG_XIP_KERNEL is not set
133
134#
135# Floating point emulation
136#
137
138#
139# At least one emulation must be selected
140#
141CONFIG_FPE_NWFPE=y
142CONFIG_FPE_NWFPE_XP=y
143CONFIG_FPE_FASTFPE=y
144
145#
146# Userspace binary formats
147#
148CONFIG_BINFMT_ELF=y
149# CONFIG_BINFMT_AOUT is not set
150# CONFIG_BINFMT_MISC is not set
151# CONFIG_ARTHUR is not set
152
153#
154# Power management options
155#
156# CONFIG_PM is not set
157
158#
159# Device Drivers
160#
161
162#
163# Generic Driver Options
164#
165CONFIG_STANDALONE=y
166CONFIG_PREVENT_FIRMWARE_BUILD=y
167# CONFIG_FW_LOADER is not set
168# CONFIG_DEBUG_DRIVER is not set
169
170#
171# Memory Technology Devices (MTD)
172#
173CONFIG_MTD=y
174# CONFIG_MTD_DEBUG is not set
175# CONFIG_MTD_CONCAT is not set
176CONFIG_MTD_PARTITIONS=y
177# CONFIG_MTD_REDBOOT_PARTS is not set
178# CONFIG_MTD_CMDLINE_PARTS is not set
179# CONFIG_MTD_AFS_PARTS is not set
180
181#
182# User Modules And Translation Layers
183#
184CONFIG_MTD_CHAR=y
185CONFIG_MTD_BLOCK=y
186# CONFIG_FTL is not set
187# CONFIG_NFTL is not set
188# CONFIG_INFTL is not set
189
190#
191# RAM/ROM/Flash chip drivers
192#
193# CONFIG_MTD_CFI is not set
194# CONFIG_MTD_JEDECPROBE is not set
195CONFIG_MTD_MAP_BANK_WIDTH_1=y
196CONFIG_MTD_MAP_BANK_WIDTH_2=y
197CONFIG_MTD_MAP_BANK_WIDTH_4=y
198# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
199# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
200# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
201CONFIG_MTD_CFI_I1=y
202CONFIG_MTD_CFI_I2=y
203# CONFIG_MTD_CFI_I4 is not set
204# CONFIG_MTD_CFI_I8 is not set
205# CONFIG_MTD_RAM is not set
206CONFIG_MTD_ROM=y
207# CONFIG_MTD_ABSENT is not set
208
209#
210# Mapping drivers for chip access
211#
212# CONFIG_MTD_COMPLEX_MAPPINGS is not set
213
214#
215# Self-contained MTD device drivers
216#
217# CONFIG_MTD_SLRAM is not set
218# CONFIG_MTD_PHRAM is not set
219# CONFIG_MTD_MTDRAM is not set
220# CONFIG_MTD_BLKMTD is not set
221# CONFIG_MTD_BLOCK2MTD is not set
222
223#
224# Disk-On-Chip Device Drivers
225#
226# CONFIG_MTD_DOC2000 is not set
227# CONFIG_MTD_DOC2001 is not set
228# CONFIG_MTD_DOC2001PLUS is not set
229
230#
231# NAND Flash Device Drivers
232#
233# CONFIG_MTD_NAND is not set
234
235#
236# Parallel port support
237#
238# CONFIG_PARPORT is not set
239
240#
241# Plug and Play support
242#
243# CONFIG_PNP is not set
244
245#
246# Block devices
247#
248# CONFIG_BLK_DEV_FD is not set
249# CONFIG_BLK_DEV_XD is not set
250# CONFIG_BLK_DEV_COW_COMMON is not set
251CONFIG_BLK_DEV_LOOP=y
252# CONFIG_BLK_DEV_CRYPTOLOOP is not set
253# CONFIG_BLK_DEV_NBD is not set
254# CONFIG_BLK_DEV_RAM is not set
255CONFIG_BLK_DEV_RAM_COUNT=16
256CONFIG_INITRAMFS_SOURCE=""
257# CONFIG_CDROM_PKTCDVD is not set
258
259#
260# IO Schedulers
261#
262CONFIG_IOSCHED_NOOP=y
263# CONFIG_IOSCHED_AS is not set
264CONFIG_IOSCHED_DEADLINE=y
265CONFIG_IOSCHED_CFQ=y
266# CONFIG_ATA_OVER_ETH is not set
267
268#
269# SCSI device support
270#
271# CONFIG_SCSI 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
282#
283# IEEE 1394 (FireWire) support
284#
285
286#
287# I2O device support
288#
289
290#
291# Networking support
292#
293CONFIG_NET=y
294
295#
296# Networking options
297#
298CONFIG_PACKET=m
299CONFIG_PACKET_MMAP=y
300# CONFIG_NETLINK_DEV is not set
301CONFIG_UNIX=y
302# CONFIG_NET_KEY is not set
303CONFIG_INET=y
304# CONFIG_IP_MULTICAST is not set
305# CONFIG_IP_ADVANCED_ROUTER is not set
306CONFIG_IP_PNP=y
307CONFIG_IP_PNP_DHCP=y
308CONFIG_IP_PNP_BOOTP=y
309# CONFIG_IP_PNP_RARP is not set
310# CONFIG_NET_IPIP is not set
311# CONFIG_NET_IPGRE is not set
312# CONFIG_ARPD is not set
313# CONFIG_SYN_COOKIES is not set
314# CONFIG_INET_AH is not set
315# CONFIG_INET_ESP is not set
316# CONFIG_INET_IPCOMP is not set
317# CONFIG_INET_TUNNEL is not set
318CONFIG_IP_TCPDIAG=y
319# CONFIG_IP_TCPDIAG_IPV6 is not set
320# CONFIG_IPV6 is not set
321# CONFIG_NETFILTER is not set
322
323#
324# SCTP Configuration (EXPERIMENTAL)
325#
326# CONFIG_IP_SCTP is not set
327# CONFIG_ATM is not set
328# CONFIG_BRIDGE is not set
329# CONFIG_VLAN_8021Q is not set
330# CONFIG_DECNET is not set
331# CONFIG_LLC2 is not set
332# CONFIG_IPX is not set
333# CONFIG_ATALK is not set
334# CONFIG_X25 is not set
335# CONFIG_LAPB is not set
336# CONFIG_NET_DIVERT is not set
337# CONFIG_ECONET is not set
338# CONFIG_WAN_ROUTER is not set
339
340#
341# QoS and/or fair queueing
342#
343# CONFIG_NET_SCHED is not set
344# CONFIG_NET_CLS_ROUTE is not set
345
346#
347# Network testing
348#
349# CONFIG_NET_PKTGEN is not set
350# CONFIG_NETPOLL is not set
351# CONFIG_NET_POLL_CONTROLLER is not set
352# CONFIG_HAMRADIO is not set
353# CONFIG_IRDA is not set
354# CONFIG_BT is not set
355CONFIG_NETDEVICES=y
356# CONFIG_DUMMY is not set
357# CONFIG_BONDING is not set
358# CONFIG_EQUALIZER is not set
359# CONFIG_TUN is not set
360
361#
362# ARCnet devices
363#
364# CONFIG_ARCNET is not set
365
366#
367# Ethernet (10 or 100Mbit)
368#
369CONFIG_NET_ETHERNET=y
370CONFIG_MII=y
371# CONFIG_NET_VENDOR_3COM is not set
372# CONFIG_LANCE is not set
373# CONFIG_NET_VENDOR_SMC is not set
374# CONFIG_SMC91X is not set
375# CONFIG_NET_VENDOR_RACAL is not set
376# CONFIG_AT1700 is not set
377# CONFIG_DEPCA is not set
378# CONFIG_HP100 is not set
379# CONFIG_NET_ISA is not set
380# CONFIG_NET_PCI is not set
381# CONFIG_NET_POCKET is not set
382
383#
384# Ethernet (1000 Mbit)
385#
386
387#
388# Ethernet (10000 Mbit)
389#
390
391#
392# Token Ring devices
393#
394# CONFIG_TR is not set
395
396#
397# Wireless LAN (non-hamradio)
398#
399# CONFIG_NET_RADIO is not set
400
401#
402# Wan interfaces
403#
404# CONFIG_WAN is not set
405CONFIG_PPP=y
406# CONFIG_PPP_MULTILINK is not set
407CONFIG_PPP_FILTER=y
408CONFIG_PPP_ASYNC=y
409# CONFIG_PPP_SYNC_TTY is not set
410CONFIG_PPP_DEFLATE=y
411CONFIG_PPP_BSDCOMP=y
412# CONFIG_PPPOE is not set
413# CONFIG_SLIP is not set
414# CONFIG_SHAPER is not set
415# CONFIG_NETCONSOLE is not set
416
417#
418# ISDN subsystem
419#
420# CONFIG_ISDN is not set
421
422#
423# Input device support
424#
425# CONFIG_INPUT is not set
426
427#
428# Hardware I/O ports
429#
430# CONFIG_SERIO is not set
431# CONFIG_GAMEPORT is not set
432CONFIG_SOUND_GAMEPORT=y
433
434#
435# Character devices
436#
437# CONFIG_VT is not set
438# CONFIG_SERIAL_NONSTANDARD is not set
439
440#
441# Serial drivers
442#
443# CONFIG_SERIAL_8250 is not set
444
445#
446# Non-8250 serial port support
447#
448CONFIG_SERIAL_IMX=y
449CONFIG_SERIAL_IMX_CONSOLE=y
450CONFIG_SERIAL_CORE=y
451CONFIG_SERIAL_CORE_CONSOLE=y
452CONFIG_UNIX98_PTYS=y
453# CONFIG_LEGACY_PTYS is not set
454
455#
456# IPMI
457#
458# CONFIG_IPMI_HANDLER is not set
459
460#
461# Watchdog Cards
462#
463# CONFIG_WATCHDOG is not set
464# CONFIG_NVRAM is not set
465CONFIG_RTC=m
466# CONFIG_DTLK is not set
467# CONFIG_R3964 is not set
468
469#
470# Ftape, the floppy tape device driver
471#
472# CONFIG_DRM is not set
473# CONFIG_RAW_DRIVER is not set
474
475#
476# TPM devices
477#
478# CONFIG_TCG_TPM is not set
479
480#
481# I2C support
482#
483# CONFIG_I2C is not set
484
485#
486# Misc devices
487#
488
489#
490# Multimedia devices
491#
492# CONFIG_VIDEO_DEV is not set
493
494#
495# Digital Video Broadcasting Devices
496#
497# CONFIG_DVB is not set
498
499#
500# Graphics support
501#
502# CONFIG_FB is not set
503
504#
505# Sound
506#
507# CONFIG_SOUND is not set
508
509#
510# USB support
511#
512CONFIG_USB_ARCH_HAS_HCD=y
513# CONFIG_USB_ARCH_HAS_OHCI is not set
514# CONFIG_USB is not set
515
516#
517# USB Gadget Support
518#
519# CONFIG_USB_GADGET is not set
520
521#
522# MMC/SD Card support
523#
524# CONFIG_MMC is not set
525
526#
527# File systems
528#
529# CONFIG_EXT2_FS is not set
530# CONFIG_EXT3_FS is not set
531# CONFIG_JBD is not set
532# CONFIG_REISERFS_FS is not set
533# CONFIG_JFS_FS is not set
534
535#
536# XFS support
537#
538# CONFIG_XFS_FS is not set
539# CONFIG_MINIX_FS is not set
540# CONFIG_ROMFS_FS is not set
541# CONFIG_QUOTA is not set
542CONFIG_DNOTIFY=y
543# CONFIG_AUTOFS_FS is not set
544# CONFIG_AUTOFS4_FS is not set
545
546#
547# CD-ROM/DVD Filesystems
548#
549# CONFIG_ISO9660_FS is not set
550# CONFIG_UDF_FS is not set
551
552#
553# DOS/FAT/NT Filesystems
554#
555CONFIG_FAT_FS=y
556CONFIG_MSDOS_FS=y
557CONFIG_VFAT_FS=y
558CONFIG_FAT_DEFAULT_CODEPAGE=437
559CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
560# CONFIG_NTFS_FS is not set
561
562#
563# Pseudo filesystems
564#
565CONFIG_PROC_FS=y
566CONFIG_SYSFS=y
567CONFIG_DEVFS_FS=y
568CONFIG_DEVFS_MOUNT=y
569# CONFIG_DEVFS_DEBUG is not set
570# CONFIG_DEVPTS_FS_XATTR is not set
571CONFIG_TMPFS=y
572# CONFIG_TMPFS_XATTR is not set
573# CONFIG_HUGETLB_PAGE is not set
574CONFIG_RAMFS=y
575
576#
577# Miscellaneous filesystems
578#
579# CONFIG_ADFS_FS is not set
580# CONFIG_AFFS_FS is not set
581# CONFIG_HFS_FS is not set
582# CONFIG_HFSPLUS_FS is not set
583# CONFIG_BEFS_FS is not set
584# CONFIG_BFS_FS is not set
585# CONFIG_EFS_FS is not set
586# CONFIG_JFFS_FS is not set
587CONFIG_JFFS2_FS=y
588CONFIG_JFFS2_FS_DEBUG=0
589# CONFIG_JFFS2_FS_NAND is not set
590# CONFIG_JFFS2_FS_NOR_ECC is not set
591# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
592CONFIG_JFFS2_ZLIB=y
593CONFIG_JFFS2_RTIME=y
594# CONFIG_JFFS2_RUBIN is not set
595CONFIG_CRAMFS=y
596# CONFIG_VXFS_FS is not set
597# CONFIG_HPFS_FS is not set
598# CONFIG_QNX4FS_FS is not set
599# CONFIG_SYSV_FS is not set
600# CONFIG_UFS_FS is not set
601
602#
603# Network File Systems
604#
605CONFIG_NFS_FS=y
606CONFIG_NFS_V3=y
607# CONFIG_NFS_V4 is not set
608# CONFIG_NFS_DIRECTIO is not set
609# CONFIG_NFSD is not set
610CONFIG_ROOT_NFS=y
611CONFIG_LOCKD=y
612CONFIG_LOCKD_V4=y
613CONFIG_SUNRPC=y
614# CONFIG_RPCSEC_GSS_KRB5 is not set
615# CONFIG_RPCSEC_GSS_SPKM3 is not set
616# CONFIG_SMB_FS is not set
617# CONFIG_CIFS is not set
618# CONFIG_NCP_FS is not set
619# CONFIG_CODA_FS is not set
620# CONFIG_AFS_FS is not set
621
622#
623# Partition Types
624#
625# CONFIG_PARTITION_ADVANCED is not set
626CONFIG_MSDOS_PARTITION=y
627
628#
629# Native Language Support
630#
631CONFIG_NLS=y
632CONFIG_NLS_DEFAULT="iso8859-1"
633# CONFIG_NLS_CODEPAGE_437 is not set
634# CONFIG_NLS_CODEPAGE_737 is not set
635# CONFIG_NLS_CODEPAGE_775 is not set
636# CONFIG_NLS_CODEPAGE_850 is not set
637# CONFIG_NLS_CODEPAGE_852 is not set
638# CONFIG_NLS_CODEPAGE_855 is not set
639# CONFIG_NLS_CODEPAGE_857 is not set
640# CONFIG_NLS_CODEPAGE_860 is not set
641# CONFIG_NLS_CODEPAGE_861 is not set
642# CONFIG_NLS_CODEPAGE_862 is not set
643# CONFIG_NLS_CODEPAGE_863 is not set
644# CONFIG_NLS_CODEPAGE_864 is not set
645# CONFIG_NLS_CODEPAGE_865 is not set
646# CONFIG_NLS_CODEPAGE_866 is not set
647# CONFIG_NLS_CODEPAGE_869 is not set
648# CONFIG_NLS_CODEPAGE_936 is not set
649# CONFIG_NLS_CODEPAGE_950 is not set
650# CONFIG_NLS_CODEPAGE_932 is not set
651# CONFIG_NLS_CODEPAGE_949 is not set
652# CONFIG_NLS_CODEPAGE_874 is not set
653# CONFIG_NLS_ISO8859_8 is not set
654# CONFIG_NLS_CODEPAGE_1250 is not set
655# CONFIG_NLS_CODEPAGE_1251 is not set
656# CONFIG_NLS_ASCII is not set
657# CONFIG_NLS_ISO8859_1 is not set
658# CONFIG_NLS_ISO8859_2 is not set
659# CONFIG_NLS_ISO8859_3 is not set
660# CONFIG_NLS_ISO8859_4 is not set
661# CONFIG_NLS_ISO8859_5 is not set
662# CONFIG_NLS_ISO8859_6 is not set
663# CONFIG_NLS_ISO8859_7 is not set
664# CONFIG_NLS_ISO8859_9 is not set
665# CONFIG_NLS_ISO8859_13 is not set
666# CONFIG_NLS_ISO8859_14 is not set
667# CONFIG_NLS_ISO8859_15 is not set
668# CONFIG_NLS_KOI8_R is not set
669# CONFIG_NLS_KOI8_U is not set
670# CONFIG_NLS_UTF8 is not set
671
672#
673# Profiling support
674#
675# CONFIG_PROFILING is not set
676
677#
678# Kernel hacking
679#
680# CONFIG_PRINTK_TIME is not set
681CONFIG_DEBUG_KERNEL=y
682CONFIG_MAGIC_SYSRQ=y
683CONFIG_LOG_BUF_SHIFT=14
684# CONFIG_SCHEDSTATS is not set
685# CONFIG_DEBUG_SLAB is not set
686CONFIG_DEBUG_PREEMPT=y
687# CONFIG_DEBUG_SPINLOCK is not set
688# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
689# CONFIG_DEBUG_KOBJECT is not set
690CONFIG_DEBUG_BUGVERBOSE=y
691CONFIG_DEBUG_INFO=y
692# CONFIG_DEBUG_FS is not set
693CONFIG_FRAME_POINTER=y
694CONFIG_DEBUG_USER=y
695# CONFIG_DEBUG_WAITQ is not set
696CONFIG_DEBUG_ERRORS=y
697# CONFIG_DEBUG_LL is not set
698
699#
700# Security options
701#
702# CONFIG_KEYS is not set
703# CONFIG_SECURITY is not set
704
705#
706# Cryptographic options
707#
708CONFIG_CRYPTO=y
709# CONFIG_CRYPTO_HMAC is not set
710# CONFIG_CRYPTO_NULL is not set
711# CONFIG_CRYPTO_MD4 is not set
712# CONFIG_CRYPTO_MD5 is not set
713# CONFIG_CRYPTO_SHA1 is not set
714# CONFIG_CRYPTO_SHA256 is not set
715# CONFIG_CRYPTO_SHA512 is not set
716# CONFIG_CRYPTO_WP512 is not set
717# CONFIG_CRYPTO_TGR192 is not set
718# CONFIG_CRYPTO_DES is not set
719# CONFIG_CRYPTO_BLOWFISH is not set
720# CONFIG_CRYPTO_TWOFISH is not set
721# CONFIG_CRYPTO_SERPENT is not set
722# CONFIG_CRYPTO_AES is not set
723# CONFIG_CRYPTO_CAST5 is not set
724# CONFIG_CRYPTO_CAST6 is not set
725# CONFIG_CRYPTO_TEA is not set
726# CONFIG_CRYPTO_ARC4 is not set
727# CONFIG_CRYPTO_KHAZAD is not set
728# CONFIG_CRYPTO_ANUBIS is not set
729# CONFIG_CRYPTO_DEFLATE is not set
730# CONFIG_CRYPTO_MICHAEL_MIC is not set
731# CONFIG_CRYPTO_CRC32C is not set
732# CONFIG_CRYPTO_TEST is not set
733
734#
735# Hardware crypto devices
736#
737
738#
739# Library routines
740#
741CONFIG_CRC_CCITT=y
742CONFIG_CRC32=y
743# CONFIG_LIBCRC32C is not set
744CONFIG_ZLIB_INFLATE=y
745CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/neponset_defconfig b/arch/arm/configs/neponset_defconfig
new file mode 100644
index 000000000000..7fb1f7c7bf43
--- /dev/null
+++ b/arch/arm/configs/neponset_defconfig
@@ -0,0 +1,1145 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11
4# Wed Mar 9 14:28:26 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_LOG_BUF_SHIFT=14
31CONFIG_HOTPLUG=y
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
59# CONFIG_KMOD is not set
60
61#
62# System Type
63#
64# CONFIG_ARCH_CLPS7500 is not set
65# CONFIG_ARCH_CLPS711X is not set
66# CONFIG_ARCH_CO285 is not set
67# CONFIG_ARCH_EBSA110 is not set
68# CONFIG_ARCH_CAMELOT is not set
69# CONFIG_ARCH_FOOTBRIDGE is not set
70# CONFIG_ARCH_INTEGRATOR is not set
71# CONFIG_ARCH_IOP3XX is not set
72# CONFIG_ARCH_IXP4XX is not set
73# CONFIG_ARCH_IXP2000 is not set
74# CONFIG_ARCH_L7200 is not set
75# CONFIG_ARCH_PXA is not set
76# CONFIG_ARCH_RPC is not set
77CONFIG_ARCH_SA1100=y
78# CONFIG_ARCH_S3C2410 is not set
79# CONFIG_ARCH_SHARK is not set
80# CONFIG_ARCH_LH7A40X is not set
81# CONFIG_ARCH_OMAP is not set
82# CONFIG_ARCH_VERSATILE is not set
83# CONFIG_ARCH_IMX is not set
84# CONFIG_ARCH_H720X is not set
85
86#
87# SA11x0 Implementations
88#
89CONFIG_SA1100_ASSABET=y
90CONFIG_ASSABET_NEPONSET=y
91# CONFIG_SA1100_CERF is not set
92# CONFIG_SA1100_COLLIE is not set
93# CONFIG_SA1100_H3100 is not set
94# CONFIG_SA1100_H3600 is not set
95# CONFIG_SA1100_H3800 is not set
96# CONFIG_SA1100_BADGE4 is not set
97# CONFIG_SA1100_JORNADA720 is not set
98# CONFIG_SA1100_HACKKIT is not set
99# CONFIG_SA1100_LART is not set
100# CONFIG_SA1100_PLEB is not set
101# CONFIG_SA1100_SHANNON is not set
102# CONFIG_SA1100_SIMPAD is not set
103# CONFIG_SA1100_SSP is not set
104
105#
106# Processor Type
107#
108CONFIG_CPU_32=y
109CONFIG_CPU_SA1100=y
110CONFIG_CPU_32v4=y
111CONFIG_CPU_ABRT_EV4=y
112CONFIG_CPU_CACHE_V4WB=y
113CONFIG_CPU_CACHE_VIVT=y
114CONFIG_CPU_TLB_V4WB=y
115CONFIG_CPU_MINICACHE=y
116
117#
118# Processor Features
119#
120CONFIG_SA1111=y
121CONFIG_DMABOUNCE=y
122CONFIG_FORCE_MAX_ZONEORDER=9
123
124#
125# Bus support
126#
127CONFIG_ISA=y
128
129#
130# PCCARD (PCMCIA/CardBus) support
131#
132CONFIG_PCCARD=y
133# CONFIG_PCMCIA_DEBUG is not set
134CONFIG_PCMCIA=y
135
136#
137# PC-card bridges
138#
139# CONFIG_I82365 is not set
140# CONFIG_TCIC is not set
141CONFIG_PCMCIA_SA1100=y
142CONFIG_PCMCIA_SA1111=y
143
144#
145# Kernel Features
146#
147# CONFIG_PREEMPT is not set
148CONFIG_DISCONTIGMEM=y
149CONFIG_LEDS=y
150CONFIG_LEDS_TIMER=y
151CONFIG_LEDS_CPU=y
152CONFIG_ALIGNMENT_TRAP=y
153
154#
155# Boot options
156#
157CONFIG_ZBOOT_ROM_TEXT=0x80000
158CONFIG_ZBOOT_ROM_BSS=0xc1000000
159CONFIG_ZBOOT_ROM=y
160CONFIG_CMDLINE="console=ttySA0,38400n8 cpufreq=221200 rw root=/dev/mtdblock2 mtdparts=sa1100:512K(boot),1M(kernel),2560K(initrd),4M(root) load_ramdisk=1 prompt_ramdisk=0 mem=32M noinitrd initrd=0xc0800000,3M"
161CONFIG_CPU_FREQ=y
162# CONFIG_CPU_FREQ_DEBUG is not set
163# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
164CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
165# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set
166# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
167CONFIG_CPU_FREQ_GOV_USERSPACE=y
168# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
169CONFIG_CPU_FREQ_SA1110=y
170
171#
172# Floating point emulation
173#
174
175#
176# At least one emulation must be selected
177#
178CONFIG_FPE_NWFPE=y
179# CONFIG_FPE_NWFPE_XP is not set
180# CONFIG_FPE_FASTFPE is not set
181
182#
183# Userspace binary formats
184#
185CONFIG_BINFMT_ELF=y
186CONFIG_BINFMT_AOUT=y
187# CONFIG_BINFMT_MISC is not set
188# CONFIG_ARTHUR is not set
189
190#
191# Power management options
192#
193CONFIG_PM=y
194CONFIG_APM=y
195
196#
197# Device Drivers
198#
199
200#
201# Generic Driver Options
202#
203CONFIG_STANDALONE=y
204CONFIG_PREVENT_FIRMWARE_BUILD=y
205# CONFIG_FW_LOADER is not set
206# CONFIG_DEBUG_DRIVER is not set
207
208#
209# Memory Technology Devices (MTD)
210#
211CONFIG_MTD=y
212# CONFIG_MTD_DEBUG is not set
213CONFIG_MTD_PARTITIONS=y
214CONFIG_MTD_CONCAT=y
215CONFIG_MTD_REDBOOT_PARTS=y
216CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
217# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
218# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
219CONFIG_MTD_CMDLINE_PARTS=y
220# CONFIG_MTD_AFS_PARTS is not set
221
222#
223# User Modules And Translation Layers
224#
225# CONFIG_MTD_CHAR is not set
226CONFIG_MTD_BLOCK=y
227# CONFIG_FTL is not set
228# CONFIG_NFTL is not set
229# CONFIG_INFTL is not set
230
231#
232# RAM/ROM/Flash chip drivers
233#
234CONFIG_MTD_CFI=y
235# CONFIG_MTD_JEDECPROBE is not set
236CONFIG_MTD_GEN_PROBE=y
237CONFIG_MTD_CFI_ADV_OPTIONS=y
238CONFIG_MTD_CFI_NOSWAP=y
239# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
240# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
241# CONFIG_MTD_CFI_GEOMETRY is not set
242CONFIG_MTD_MAP_BANK_WIDTH_1=y
243CONFIG_MTD_MAP_BANK_WIDTH_2=y
244CONFIG_MTD_MAP_BANK_WIDTH_4=y
245# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
246# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
247# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
248CONFIG_MTD_CFI_I1=y
249CONFIG_MTD_CFI_I2=y
250# CONFIG_MTD_CFI_I4 is not set
251# CONFIG_MTD_CFI_I8 is not set
252CONFIG_MTD_CFI_INTELEXT=y
253# CONFIG_MTD_CFI_AMDSTD is not set
254# CONFIG_MTD_CFI_STAA is not set
255CONFIG_MTD_CFI_UTIL=y
256CONFIG_MTD_RAM=y
257# CONFIG_MTD_ROM is not set
258# CONFIG_MTD_ABSENT is not set
259# CONFIG_MTD_XIP is not set
260
261#
262# Mapping drivers for chip access
263#
264# CONFIG_MTD_COMPLEX_MAPPINGS is not set
265# CONFIG_MTD_PHYSMAP is not set
266# CONFIG_MTD_ARM_INTEGRATOR is not set
267CONFIG_MTD_SA1100=y
268# CONFIG_MTD_EDB7312 is not set
269
270#
271# Self-contained MTD device drivers
272#
273# CONFIG_MTD_SLRAM is not set
274# CONFIG_MTD_PHRAM is not set
275# CONFIG_MTD_MTDRAM is not set
276# CONFIG_MTD_BLKMTD is not set
277# CONFIG_MTD_BLOCK2MTD is not set
278
279#
280# Disk-On-Chip Device Drivers
281#
282# CONFIG_MTD_DOC2000 is not set
283# CONFIG_MTD_DOC2001 is not set
284# CONFIG_MTD_DOC2001PLUS is not set
285
286#
287# NAND Flash Device Drivers
288#
289# CONFIG_MTD_NAND is not set
290
291#
292# Parallel port support
293#
294# CONFIG_PARPORT is not set
295
296#
297# Plug and Play support
298#
299# CONFIG_PNP is not set
300
301#
302# Block devices
303#
304# CONFIG_BLK_DEV_FD is not set
305# CONFIG_BLK_DEV_XD is not set
306# CONFIG_BLK_DEV_COW_COMMON is not set
307# CONFIG_BLK_DEV_LOOP is not set
308# CONFIG_BLK_DEV_NBD is not set
309# CONFIG_BLK_DEV_UB is not set
310CONFIG_BLK_DEV_RAM=y
311CONFIG_BLK_DEV_RAM_COUNT=16
312CONFIG_BLK_DEV_RAM_SIZE=8192
313CONFIG_BLK_DEV_INITRD=y
314CONFIG_INITRAMFS_SOURCE=""
315# CONFIG_CDROM_PKTCDVD is not set
316
317#
318# IO Schedulers
319#
320CONFIG_IOSCHED_NOOP=y
321CONFIG_IOSCHED_AS=y
322CONFIG_IOSCHED_DEADLINE=y
323CONFIG_IOSCHED_CFQ=y
324# CONFIG_ATA_OVER_ETH is not set
325
326#
327# ATA/ATAPI/MFM/RLL support
328#
329# CONFIG_IDE is not set
330
331#
332# SCSI device support
333#
334CONFIG_SCSI=m
335CONFIG_SCSI_PROC_FS=y
336
337#
338# SCSI support type (disk, tape, CD-ROM)
339#
340CONFIG_BLK_DEV_SD=m
341# CONFIG_CHR_DEV_ST is not set
342# CONFIG_CHR_DEV_OSST is not set
343# CONFIG_BLK_DEV_SR is not set
344# CONFIG_CHR_DEV_SG is not set
345
346#
347# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
348#
349# CONFIG_SCSI_MULTI_LUN is not set
350# CONFIG_SCSI_CONSTANTS is not set
351# CONFIG_SCSI_LOGGING is not set
352
353#
354# SCSI Transport Attributes
355#
356# CONFIG_SCSI_SPI_ATTRS is not set
357# CONFIG_SCSI_FC_ATTRS is not set
358# CONFIG_SCSI_ISCSI_ATTRS is not set
359
360#
361# SCSI low-level drivers
362#
363# CONFIG_SCSI_7000FASST is not set
364# CONFIG_SCSI_AHA152X is not set
365# CONFIG_SCSI_AHA1542 is not set
366# CONFIG_SCSI_AIC7XXX_OLD is not set
367# CONFIG_SCSI_IN2000 is not set
368# CONFIG_SCSI_SATA is not set
369# CONFIG_SCSI_BUSLOGIC is not set
370# CONFIG_SCSI_DTC3280 is not set
371# CONFIG_SCSI_EATA is not set
372# CONFIG_SCSI_EATA_PIO is not set
373# CONFIG_SCSI_FUTURE_DOMAIN is not set
374# CONFIG_SCSI_GDTH is not set
375# CONFIG_SCSI_GENERIC_NCR5380 is not set
376# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
377# CONFIG_SCSI_NCR53C406A is not set
378# CONFIG_SCSI_PAS16 is not set
379# CONFIG_SCSI_PSI240I is not set
380# CONFIG_SCSI_QLOGIC_FAS is not set
381# CONFIG_SCSI_SYM53C416 is not set
382# CONFIG_SCSI_T128 is not set
383# CONFIG_SCSI_U14_34F is not set
384# CONFIG_SCSI_DEBUG is not set
385
386#
387# PCMCIA SCSI adapter support
388#
389# CONFIG_PCMCIA_AHA152X is not set
390# CONFIG_PCMCIA_FDOMAIN is not set
391# CONFIG_PCMCIA_NINJA_SCSI is not set
392# CONFIG_PCMCIA_QLOGIC is not set
393# CONFIG_PCMCIA_SYM53C500 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
404#
405# IEEE 1394 (FireWire) support
406#
407
408#
409# I2O device support
410#
411
412#
413# Networking support
414#
415CONFIG_NET=y
416
417#
418# Networking options
419#
420CONFIG_PACKET=y
421CONFIG_PACKET_MMAP=y
422# CONFIG_NETLINK_DEV is not set
423CONFIG_UNIX=y
424# CONFIG_NET_KEY is not set
425CONFIG_INET=y
426# CONFIG_IP_MULTICAST is not set
427# CONFIG_IP_ADVANCED_ROUTER is not set
428# CONFIG_IP_PNP is not set
429# CONFIG_NET_IPIP is not set
430# CONFIG_NET_IPGRE is not set
431# CONFIG_ARPD is not set
432# CONFIG_SYN_COOKIES is not set
433# CONFIG_INET_AH is not set
434# CONFIG_INET_ESP is not set
435# CONFIG_INET_IPCOMP is not set
436# CONFIG_INET_TUNNEL is not set
437# CONFIG_IP_TCPDIAG is not set
438# CONFIG_IP_TCPDIAG_IPV6 is not set
439# CONFIG_IPV6 is not set
440# CONFIG_NETFILTER is not set
441
442#
443# SCTP Configuration (EXPERIMENTAL)
444#
445# CONFIG_IP_SCTP is not set
446# CONFIG_ATM is not set
447# CONFIG_BRIDGE is not set
448# CONFIG_VLAN_8021Q is not set
449# CONFIG_DECNET is not set
450# CONFIG_LLC2 is not set
451# CONFIG_IPX is not set
452# CONFIG_ATALK is not set
453# CONFIG_X25 is not set
454# CONFIG_LAPB is not set
455# CONFIG_NET_DIVERT is not set
456# CONFIG_ECONET is not set
457# CONFIG_WAN_ROUTER is not set
458
459#
460# QoS and/or fair queueing
461#
462# CONFIG_NET_SCHED is not set
463# CONFIG_NET_CLS_ROUTE is not set
464
465#
466# Network testing
467#
468# CONFIG_NET_PKTGEN is not set
469# CONFIG_NETPOLL is not set
470# CONFIG_NET_POLL_CONTROLLER is not set
471# CONFIG_HAMRADIO is not set
472# CONFIG_IRDA is not set
473# CONFIG_BT is not set
474CONFIG_NETDEVICES=y
475# CONFIG_DUMMY is not set
476# CONFIG_BONDING is not set
477# CONFIG_EQUALIZER is not set
478# CONFIG_TUN is not set
479
480#
481# ARCnet devices
482#
483# CONFIG_ARCNET is not set
484
485#
486# Ethernet (10 or 100Mbit)
487#
488CONFIG_NET_ETHERNET=y
489CONFIG_MII=y
490# CONFIG_NET_VENDOR_3COM is not set
491# CONFIG_LANCE is not set
492CONFIG_NET_VENDOR_SMC=y
493# CONFIG_WD80x3 is not set
494# CONFIG_ULTRA is not set
495CONFIG_SMC91X=y
496CONFIG_SMC9194=y
497# CONFIG_NET_VENDOR_RACAL is not set
498# CONFIG_AT1700 is not set
499# CONFIG_DEPCA is not set
500# CONFIG_HP100 is not set
501# CONFIG_NET_ISA is not set
502# CONFIG_NET_PCI is not set
503# CONFIG_NET_POCKET is not set
504
505#
506# Ethernet (1000 Mbit)
507#
508
509#
510# Ethernet (10000 Mbit)
511#
512
513#
514# Token Ring devices
515#
516# CONFIG_TR is not set
517
518#
519# Wireless LAN (non-hamradio)
520#
521# CONFIG_NET_RADIO is not set
522
523#
524# PCMCIA network device support
525#
526CONFIG_NET_PCMCIA=y
527# CONFIG_PCMCIA_3C589 is not set
528# CONFIG_PCMCIA_3C574 is not set
529# CONFIG_PCMCIA_FMVJ18X is not set
530CONFIG_PCMCIA_PCNET=y
531# CONFIG_PCMCIA_NMCLAN is not set
532# CONFIG_PCMCIA_SMC91C92 is not set
533# CONFIG_PCMCIA_XIRC2PS is not set
534# CONFIG_PCMCIA_AXNET is not set
535
536#
537# Wan interfaces
538#
539# CONFIG_WAN is not set
540# CONFIG_PPP is not set
541# CONFIG_SLIP is not set
542# CONFIG_SHAPER is not set
543# CONFIG_NETCONSOLE is not set
544
545#
546# ISDN subsystem
547#
548# CONFIG_ISDN is not set
549
550#
551# Input device support
552#
553CONFIG_INPUT=y
554
555#
556# Userland interfaces
557#
558CONFIG_INPUT_MOUSEDEV=y
559CONFIG_INPUT_MOUSEDEV_PSAUX=y
560CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
561CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
562# CONFIG_INPUT_JOYDEV is not set
563CONFIG_INPUT_TSDEV=y
564CONFIG_INPUT_TSDEV_SCREEN_X=240
565CONFIG_INPUT_TSDEV_SCREEN_Y=320
566# CONFIG_INPUT_EVDEV is not set
567# CONFIG_INPUT_EVBUG is not set
568
569#
570# Input I/O drivers
571#
572# CONFIG_GAMEPORT is not set
573CONFIG_SOUND_GAMEPORT=y
574CONFIG_SERIO=y
575CONFIG_SERIO_SERPORT=m
576# CONFIG_SERIO_CT82C710 is not set
577CONFIG_SERIO_SA1111=y
578CONFIG_SERIO_LIBPS2=y
579# CONFIG_SERIO_RAW is not set
580
581#
582# Input Device Drivers
583#
584CONFIG_INPUT_KEYBOARD=y
585CONFIG_KEYBOARD_ATKBD=y
586# CONFIG_KEYBOARD_SUNKBD is not set
587# CONFIG_KEYBOARD_LKKBD is not set
588# CONFIG_KEYBOARD_XTKBD is not set
589# CONFIG_KEYBOARD_NEWTON is not set
590# CONFIG_INPUT_MOUSE is not set
591# CONFIG_INPUT_JOYSTICK is not set
592CONFIG_INPUT_TOUCHSCREEN=y
593# CONFIG_TOUCHSCREEN_GUNZE is not set
594# CONFIG_INPUT_MISC is not set
595
596#
597# Character devices
598#
599CONFIG_VT=y
600CONFIG_VT_CONSOLE=y
601CONFIG_HW_CONSOLE=y
602CONFIG_SERIAL_NONSTANDARD=y
603# CONFIG_COMPUTONE is not set
604# CONFIG_ROCKETPORT is not set
605# CONFIG_CYCLADES is not set
606# CONFIG_DIGIEPCA is not set
607# CONFIG_DIGI is not set
608# CONFIG_ESPSERIAL is not set
609# CONFIG_MOXA_INTELLIO is not set
610# CONFIG_MOXA_SMARTIO is not set
611# CONFIG_ISI is not set
612# CONFIG_SYNCLINKMP is not set
613# CONFIG_N_HDLC is not set
614# CONFIG_RISCOM8 is not set
615# CONFIG_SPECIALIX is not set
616# CONFIG_SX is not set
617# CONFIG_RIO is not set
618# CONFIG_STALDRV is not set
619
620#
621# Serial drivers
622#
623CONFIG_SERIAL_8250=y
624# CONFIG_SERIAL_8250_CONSOLE is not set
625CONFIG_SERIAL_8250_CS=y
626CONFIG_SERIAL_8250_NR_UARTS=4
627# CONFIG_SERIAL_8250_EXTENDED is not set
628
629#
630# Non-8250 serial port support
631#
632CONFIG_SERIAL_SA1100=y
633CONFIG_SERIAL_SA1100_CONSOLE=y
634CONFIG_SERIAL_CORE=y
635CONFIG_SERIAL_CORE_CONSOLE=y
636CONFIG_UNIX98_PTYS=y
637CONFIG_LEGACY_PTYS=y
638CONFIG_LEGACY_PTY_COUNT=64
639
640#
641# IPMI
642#
643# CONFIG_IPMI_HANDLER is not set
644
645#
646# Watchdog Cards
647#
648CONFIG_WATCHDOG=y
649# CONFIG_WATCHDOG_NOWAYOUT is not set
650
651#
652# Watchdog Device Drivers
653#
654# CONFIG_SOFT_WATCHDOG is not set
655CONFIG_SA1100_WATCHDOG=m
656
657#
658# ISA-based Watchdog Cards
659#
660# CONFIG_PCWATCHDOG is not set
661# CONFIG_MIXCOMWD is not set
662# CONFIG_WDT is not set
663
664#
665# USB-based Watchdog Cards
666#
667# CONFIG_USBPCWATCHDOG is not set
668# CONFIG_NVRAM is not set
669# CONFIG_RTC is not set
670# CONFIG_DTLK is not set
671# CONFIG_R3964 is not set
672
673#
674# Ftape, the floppy tape device driver
675#
676# CONFIG_DRM is not set
677
678#
679# PCMCIA character devices
680#
681# CONFIG_SYNCLINK_CS is not set
682# CONFIG_RAW_DRIVER is not set
683
684#
685# I2C support
686#
687CONFIG_I2C=y
688CONFIG_I2C_CHARDEV=y
689
690#
691# I2C Algorithms
692#
693CONFIG_I2C_ALGOBIT=y
694# CONFIG_I2C_ALGOPCF is not set
695# CONFIG_I2C_ALGOPCA is not set
696
697#
698# I2C Hardware Bus support
699#
700# CONFIG_I2C_ELEKTOR is not set
701# CONFIG_I2C_ISA is not set
702# CONFIG_I2C_PARPORT_LIGHT is not set
703# CONFIG_I2C_STUB is not set
704# CONFIG_I2C_PCA_ISA is not set
705
706#
707# Hardware Sensors Chip support
708#
709# CONFIG_I2C_SENSOR is not set
710# CONFIG_SENSORS_ADM1021 is not set
711# CONFIG_SENSORS_ADM1025 is not set
712# CONFIG_SENSORS_ADM1026 is not set
713# CONFIG_SENSORS_ADM1031 is not set
714# CONFIG_SENSORS_ASB100 is not set
715# CONFIG_SENSORS_DS1621 is not set
716# CONFIG_SENSORS_FSCHER is not set
717# CONFIG_SENSORS_FSCPOS is not set
718# CONFIG_SENSORS_GL518SM is not set
719# CONFIG_SENSORS_GL520SM is not set
720# CONFIG_SENSORS_IT87 is not set
721# CONFIG_SENSORS_LM63 is not set
722# CONFIG_SENSORS_LM75 is not set
723# CONFIG_SENSORS_LM77 is not set
724# CONFIG_SENSORS_LM78 is not set
725# CONFIG_SENSORS_LM80 is not set
726# CONFIG_SENSORS_LM83 is not set
727# CONFIG_SENSORS_LM85 is not set
728# CONFIG_SENSORS_LM87 is not set
729# CONFIG_SENSORS_LM90 is not set
730# CONFIG_SENSORS_MAX1619 is not set
731# CONFIG_SENSORS_PC87360 is not set
732# CONFIG_SENSORS_SMSC47B397 is not set
733# CONFIG_SENSORS_SMSC47M1 is not set
734# CONFIG_SENSORS_W83781D is not set
735# CONFIG_SENSORS_W83L785TS is not set
736# CONFIG_SENSORS_W83627HF is not set
737
738#
739# Other I2C Chip support
740#
741# CONFIG_SENSORS_EEPROM is not set
742# CONFIG_SENSORS_PCF8574 is not set
743# CONFIG_SENSORS_PCF8591 is not set
744# CONFIG_SENSORS_RTC8564 is not set
745# CONFIG_I2C_DEBUG_CORE is not set
746# CONFIG_I2C_DEBUG_ALGO is not set
747# CONFIG_I2C_DEBUG_BUS is not set
748# CONFIG_I2C_DEBUG_CHIP is not set
749
750#
751# Misc devices
752#
753
754#
755# Multimedia devices
756#
757# CONFIG_VIDEO_DEV is not set
758
759#
760# Digital Video Broadcasting Devices
761#
762# CONFIG_DVB is not set
763
764#
765# Graphics support
766#
767CONFIG_FB=y
768# CONFIG_FB_MODE_HELPERS is not set
769# CONFIG_FB_TILEBLITTING is not set
770CONFIG_FB_SA1100=y
771# CONFIG_FB_VIRTUAL is not set
772
773#
774# Console display driver support
775#
776# CONFIG_VGA_CONSOLE is not set
777# CONFIG_MDA_CONSOLE is not set
778CONFIG_DUMMY_CONSOLE=y
779CONFIG_FRAMEBUFFER_CONSOLE=y
780# CONFIG_FONTS is not set
781CONFIG_FONT_8x8=y
782CONFIG_FONT_8x16=y
783
784#
785# Logo configuration
786#
787# CONFIG_LOGO is not set
788# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
789
790#
791# Sound
792#
793CONFIG_SOUND=y
794
795#
796# Advanced Linux Sound Architecture
797#
798# CONFIG_SND is not set
799
800#
801# Open Sound System
802#
803CONFIG_SOUND_PRIME=y
804# CONFIG_SOUND_BT878 is not set
805# CONFIG_SOUND_FUSION is not set
806# CONFIG_SOUND_CS4281 is not set
807# CONFIG_SOUND_SONICVIBES is not set
808# CONFIG_SOUND_TRIDENT is not set
809# CONFIG_SOUND_MSNDCLAS is not set
810# CONFIG_SOUND_MSNDPIN is not set
811# CONFIG_SOUND_OSS is not set
812# CONFIG_SOUND_TVMIXER is not set
813# CONFIG_SOUND_AD1980 is not set
814
815#
816# USB support
817#
818CONFIG_USB=m
819CONFIG_USB_DEBUG=y
820
821#
822# Miscellaneous USB options
823#
824CONFIG_USB_DEVICEFS=y
825# CONFIG_USB_BANDWIDTH is not set
826# CONFIG_USB_DYNAMIC_MINORS is not set
827# CONFIG_USB_SUSPEND is not set
828# CONFIG_USB_OTG is not set
829CONFIG_USB_ARCH_HAS_HCD=y
830CONFIG_USB_ARCH_HAS_OHCI=y
831
832#
833# USB Host Controller Drivers
834#
835CONFIG_USB_OHCI_HCD=m
836# CONFIG_USB_OHCI_BIG_ENDIAN is not set
837CONFIG_USB_OHCI_LITTLE_ENDIAN=y
838# CONFIG_USB_SL811_HCD is not set
839
840#
841# USB Device Class drivers
842#
843# CONFIG_USB_AUDIO is not set
844# CONFIG_USB_BLUETOOTH_TTY is not set
845# CONFIG_USB_MIDI is not set
846# CONFIG_USB_ACM is not set
847# CONFIG_USB_PRINTER is not set
848
849#
850# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
851#
852CONFIG_USB_STORAGE=m
853# CONFIG_USB_STORAGE_DEBUG is not set
854# CONFIG_USB_STORAGE_RW_DETECT is not set
855# CONFIG_USB_STORAGE_DATAFAB is not set
856# CONFIG_USB_STORAGE_FREECOM is not set
857# CONFIG_USB_STORAGE_DPCM is not set
858# CONFIG_USB_STORAGE_USBAT is not set
859# CONFIG_USB_STORAGE_SDDR09 is not set
860# CONFIG_USB_STORAGE_SDDR55 is not set
861# CONFIG_USB_STORAGE_JUMPSHOT is not set
862
863#
864# USB Input Devices
865#
866# CONFIG_USB_HID is not set
867
868#
869# USB HID Boot Protocol drivers
870#
871# CONFIG_USB_KBD is not set
872CONFIG_USB_MOUSE=m
873# CONFIG_USB_AIPTEK is not set
874# CONFIG_USB_WACOM is not set
875# CONFIG_USB_KBTAB is not set
876# CONFIG_USB_POWERMATE is not set
877# CONFIG_USB_MTOUCH is not set
878# CONFIG_USB_EGALAX is not set
879# CONFIG_USB_XPAD is not set
880# CONFIG_USB_ATI_REMOTE is not set
881
882#
883# USB Imaging devices
884#
885# CONFIG_USB_MDC800 is not set
886# CONFIG_USB_MICROTEK is not set
887
888#
889# USB Multimedia devices
890#
891# CONFIG_USB_DABUSB is not set
892
893#
894# Video4Linux support is needed for USB Multimedia device support
895#
896
897#
898# USB Network Adapters
899#
900# CONFIG_USB_CATC is not set
901# CONFIG_USB_KAWETH is not set
902# CONFIG_USB_PEGASUS is not set
903# CONFIG_USB_RTL8150 is not set
904# CONFIG_USB_USBNET is not set
905CONFIG_USB_MON=m
906
907#
908# USB port drivers
909#
910
911#
912# USB Serial Converter support
913#
914# CONFIG_USB_SERIAL is not set
915
916#
917# USB Miscellaneous drivers
918#
919# CONFIG_USB_EMI62 is not set
920# CONFIG_USB_EMI26 is not set
921# CONFIG_USB_AUERSWALD is not set
922# CONFIG_USB_RIO500 is not set
923# CONFIG_USB_LEGOTOWER is not set
924# CONFIG_USB_LCD is not set
925# CONFIG_USB_LED is not set
926# CONFIG_USB_CYTHERM is not set
927# CONFIG_USB_PHIDGETKIT is not set
928# CONFIG_USB_PHIDGETSERVO is not set
929# CONFIG_USB_IDMOUSE is not set
930# CONFIG_USB_TEST is not set
931
932#
933# USB ATM/DSL drivers
934#
935
936#
937# USB Gadget Support
938#
939# CONFIG_USB_GADGET is not set
940
941#
942# MMC/SD Card support
943#
944# CONFIG_MMC is not set
945
946#
947# File systems
948#
949CONFIG_EXT2_FS=y
950# CONFIG_EXT2_FS_XATTR is not set
951# CONFIG_EXT3_FS is not set
952# CONFIG_JBD is not set
953# CONFIG_REISERFS_FS is not set
954# CONFIG_JFS_FS is not set
955
956#
957# XFS support
958#
959# CONFIG_XFS_FS is not set
960# CONFIG_MINIX_FS is not set
961# CONFIG_ROMFS_FS is not set
962# CONFIG_QUOTA is not set
963CONFIG_DNOTIFY=y
964# CONFIG_AUTOFS_FS is not set
965# CONFIG_AUTOFS4_FS is not set
966
967#
968# CD-ROM/DVD Filesystems
969#
970# CONFIG_ISO9660_FS is not set
971# CONFIG_UDF_FS is not set
972
973#
974# DOS/FAT/NT Filesystems
975#
976CONFIG_FAT_FS=m
977CONFIG_MSDOS_FS=m
978CONFIG_VFAT_FS=m
979CONFIG_FAT_DEFAULT_CODEPAGE=437
980CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
981# CONFIG_NTFS_FS is not set
982
983#
984# Pseudo filesystems
985#
986CONFIG_PROC_FS=y
987CONFIG_SYSFS=y
988# CONFIG_DEVFS_FS is not set
989# CONFIG_DEVPTS_FS_XATTR is not set
990# CONFIG_TMPFS is not set
991# CONFIG_HUGETLB_PAGE is not set
992CONFIG_RAMFS=y
993
994#
995# Miscellaneous filesystems
996#
997# CONFIG_ADFS_FS is not set
998# CONFIG_AFFS_FS is not set
999# CONFIG_HFS_FS is not set
1000# CONFIG_HFSPLUS_FS is not set
1001# CONFIG_BEFS_FS is not set
1002# CONFIG_BFS_FS is not set
1003# CONFIG_EFS_FS is not set
1004# CONFIG_JFFS_FS is not set
1005CONFIG_JFFS2_FS=y
1006CONFIG_JFFS2_FS_DEBUG=0
1007# CONFIG_JFFS2_FS_NAND is not set
1008# CONFIG_JFFS2_FS_NOR_ECC is not set
1009# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1010CONFIG_JFFS2_ZLIB=y
1011CONFIG_JFFS2_RTIME=y
1012# CONFIG_JFFS2_RUBIN is not set
1013# CONFIG_CRAMFS is not set
1014# CONFIG_VXFS_FS is not set
1015# CONFIG_HPFS_FS is not set
1016# CONFIG_QNX4FS_FS is not set
1017# CONFIG_SYSV_FS is not set
1018# CONFIG_UFS_FS is not set
1019
1020#
1021# Network File Systems
1022#
1023CONFIG_NFS_FS=y
1024# CONFIG_NFS_V3 is not set
1025# CONFIG_NFS_V4 is not set
1026# CONFIG_NFS_DIRECTIO is not set
1027# CONFIG_NFSD is not set
1028CONFIG_LOCKD=y
1029CONFIG_SUNRPC=y
1030# CONFIG_RPCSEC_GSS_KRB5 is not set
1031# CONFIG_RPCSEC_GSS_SPKM3 is not set
1032# CONFIG_SMB_FS is not set
1033# CONFIG_CIFS is not set
1034# CONFIG_NCP_FS is not set
1035# CONFIG_CODA_FS is not set
1036# CONFIG_AFS_FS is not set
1037
1038#
1039# Partition Types
1040#
1041CONFIG_PARTITION_ADVANCED=y
1042# CONFIG_ACORN_PARTITION is not set
1043# CONFIG_OSF_PARTITION is not set
1044# CONFIG_AMIGA_PARTITION is not set
1045# CONFIG_ATARI_PARTITION is not set
1046# CONFIG_MAC_PARTITION is not set
1047# CONFIG_MSDOS_PARTITION is not set
1048# CONFIG_LDM_PARTITION is not set
1049# CONFIG_SGI_PARTITION is not set
1050# CONFIG_ULTRIX_PARTITION is not set
1051# CONFIG_SUN_PARTITION is not set
1052# CONFIG_EFI_PARTITION is not set
1053
1054#
1055# Native Language Support
1056#
1057CONFIG_NLS=y
1058CONFIG_NLS_DEFAULT="iso8859-1"
1059CONFIG_NLS_CODEPAGE_437=m
1060# CONFIG_NLS_CODEPAGE_737 is not set
1061# CONFIG_NLS_CODEPAGE_775 is not set
1062# CONFIG_NLS_CODEPAGE_850 is not set
1063# CONFIG_NLS_CODEPAGE_852 is not set
1064# CONFIG_NLS_CODEPAGE_855 is not set
1065# CONFIG_NLS_CODEPAGE_857 is not set
1066# CONFIG_NLS_CODEPAGE_860 is not set
1067# CONFIG_NLS_CODEPAGE_861 is not set
1068# CONFIG_NLS_CODEPAGE_862 is not set
1069# CONFIG_NLS_CODEPAGE_863 is not set
1070# CONFIG_NLS_CODEPAGE_864 is not set
1071# CONFIG_NLS_CODEPAGE_865 is not set
1072# CONFIG_NLS_CODEPAGE_866 is not set
1073# CONFIG_NLS_CODEPAGE_869 is not set
1074# CONFIG_NLS_CODEPAGE_936 is not set
1075# CONFIG_NLS_CODEPAGE_950 is not set
1076# CONFIG_NLS_CODEPAGE_932 is not set
1077# CONFIG_NLS_CODEPAGE_949 is not set
1078# CONFIG_NLS_CODEPAGE_874 is not set
1079# CONFIG_NLS_ISO8859_8 is not set
1080# CONFIG_NLS_CODEPAGE_1250 is not set
1081# CONFIG_NLS_CODEPAGE_1251 is not set
1082# CONFIG_NLS_ASCII is not set
1083CONFIG_NLS_ISO8859_1=m
1084# CONFIG_NLS_ISO8859_2 is not set
1085# CONFIG_NLS_ISO8859_3 is not set
1086# CONFIG_NLS_ISO8859_4 is not set
1087# CONFIG_NLS_ISO8859_5 is not set
1088# CONFIG_NLS_ISO8859_6 is not set
1089# CONFIG_NLS_ISO8859_7 is not set
1090# CONFIG_NLS_ISO8859_9 is not set
1091# CONFIG_NLS_ISO8859_13 is not set
1092# CONFIG_NLS_ISO8859_14 is not set
1093# CONFIG_NLS_ISO8859_15 is not set
1094# CONFIG_NLS_KOI8_R is not set
1095# CONFIG_NLS_KOI8_U is not set
1096# CONFIG_NLS_UTF8 is not set
1097
1098#
1099# Profiling support
1100#
1101# CONFIG_PROFILING is not set
1102
1103#
1104# Kernel hacking
1105#
1106CONFIG_DEBUG_KERNEL=y
1107CONFIG_MAGIC_SYSRQ=y
1108# CONFIG_PRINTK_TIME is not set
1109# CONFIG_SCHEDSTATS is not set
1110CONFIG_DEBUG_SLAB=y
1111# CONFIG_DEBUG_SPINLOCK is not set
1112# CONFIG_DEBUG_KOBJECT is not set
1113CONFIG_DEBUG_BUGVERBOSE=y
1114# CONFIG_DEBUG_INFO is not set
1115# CONFIG_DEBUG_FS is not set
1116CONFIG_FRAME_POINTER=y
1117CONFIG_DEBUG_USER=y
1118# CONFIG_DEBUG_WAITQ is not set
1119CONFIG_DEBUG_ERRORS=y
1120CONFIG_DEBUG_LL=y
1121# CONFIG_DEBUG_ICEDCC is not set
1122
1123#
1124# Security options
1125#
1126# CONFIG_KEYS is not set
1127# CONFIG_SECURITY is not set
1128
1129#
1130# Cryptographic options
1131#
1132# CONFIG_CRYPTO is not set
1133
1134#
1135# Hardware crypto devices
1136#
1137
1138#
1139# Library routines
1140#
1141# CONFIG_CRC_CCITT is not set
1142CONFIG_CRC32=y
1143# CONFIG_LIBCRC32C is not set
1144CONFIG_ZLIB_INFLATE=y
1145CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/netwinder_defconfig b/arch/arm/configs/netwinder_defconfig
new file mode 100644
index 000000000000..6e81acf94c2f
--- /dev/null
+++ b/arch/arm/configs/netwinder_defconfig
@@ -0,0 +1,1046 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 15:18:42 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52# CONFIG_MODULES is not set
53
54#
55# System Type
56#
57# CONFIG_ARCH_CLPS7500 is not set
58# CONFIG_ARCH_CLPS711X is not set
59# CONFIG_ARCH_CO285 is not set
60# CONFIG_ARCH_EBSA110 is not set
61# CONFIG_ARCH_CAMELOT is not set
62CONFIG_ARCH_FOOTBRIDGE=y
63# CONFIG_ARCH_INTEGRATOR is not set
64# CONFIG_ARCH_IOP3XX is not set
65# CONFIG_ARCH_IXP4XX is not set
66# CONFIG_ARCH_IXP2000 is not set
67# CONFIG_ARCH_L7200 is not set
68# CONFIG_ARCH_PXA is not set
69# CONFIG_ARCH_RPC is not set
70# CONFIG_ARCH_SA1100 is not set
71# CONFIG_ARCH_S3C2410 is not set
72# CONFIG_ARCH_SHARK is not set
73# CONFIG_ARCH_LH7A40X is not set
74# CONFIG_ARCH_OMAP is not set
75# CONFIG_ARCH_VERSATILE is not set
76# CONFIG_ARCH_IMX is not set
77# CONFIG_ARCH_H720X is not set
78
79#
80# Footbridge Implementations
81#
82# CONFIG_ARCH_CATS is not set
83# CONFIG_ARCH_PERSONAL_SERVER is not set
84# CONFIG_ARCH_EBSA285_ADDIN is not set
85# CONFIG_ARCH_EBSA285_HOST is not set
86CONFIG_ARCH_NETWINDER=y
87CONFIG_FOOTBRIDGE=y
88CONFIG_FOOTBRIDGE_HOST=y
89
90#
91# Processor Type
92#
93CONFIG_CPU_32=y
94CONFIG_CPU_SA110=y
95CONFIG_CPU_32v4=y
96CONFIG_CPU_ABRT_EV4=y
97CONFIG_CPU_CACHE_V4WB=y
98CONFIG_CPU_CACHE_VIVT=y
99CONFIG_CPU_COPY_V4WB=y
100CONFIG_CPU_TLB_V4WB=y
101
102#
103# Processor Features
104#
105
106#
107# Bus support
108#
109CONFIG_ISA=y
110CONFIG_ISA_DMA=y
111CONFIG_PCI=y
112CONFIG_PCI_LEGACY_PROC=y
113CONFIG_PCI_NAMES=y
114
115#
116# PCCARD (PCMCIA/CardBus) support
117#
118# CONFIG_PCCARD is not set
119
120#
121# Kernel Features
122#
123# CONFIG_PREEMPT is not set
124CONFIG_LEDS=y
125# CONFIG_LEDS_TIMER is not set
126CONFIG_LEDS_CPU=y
127CONFIG_ALIGNMENT_TRAP=y
128
129#
130# Boot options
131#
132CONFIG_ZBOOT_ROM_TEXT=0x0
133CONFIG_ZBOOT_ROM_BSS=0x0
134CONFIG_CMDLINE="root=0x301"
135# CONFIG_XIP_KERNEL is not set
136
137#
138# Floating point emulation
139#
140
141#
142# At least one emulation must be selected
143#
144CONFIG_FPE_NWFPE=y
145# CONFIG_FPE_NWFPE_XP is not set
146# CONFIG_FPE_FASTFPE is not set
147
148#
149# Userspace binary formats
150#
151CONFIG_BINFMT_ELF=y
152CONFIG_BINFMT_AOUT=y
153# CONFIG_BINFMT_MISC is not set
154# CONFIG_ARTHUR is not set
155
156#
157# Power management options
158#
159# CONFIG_PM is not set
160
161#
162# Device Drivers
163#
164
165#
166# Generic Driver Options
167#
168CONFIG_STANDALONE=y
169CONFIG_PREVENT_FIRMWARE_BUILD=y
170# CONFIG_FW_LOADER is not set
171# CONFIG_DEBUG_DRIVER is not set
172
173#
174# Memory Technology Devices (MTD)
175#
176# CONFIG_MTD is not set
177
178#
179# Parallel port support
180#
181CONFIG_PARPORT=y
182CONFIG_PARPORT_PC=y
183# CONFIG_PARPORT_SERIAL is not set
184# CONFIG_PARPORT_PC_FIFO is not set
185CONFIG_PARPORT_PC_SUPERIO=y
186# CONFIG_PARPORT_ARC is not set
187# CONFIG_PARPORT_GSC is not set
188# CONFIG_PARPORT_1284 is not set
189
190#
191# Plug and Play support
192#
193# CONFIG_PNP is not set
194
195#
196# Block devices
197#
198# CONFIG_BLK_DEV_FD is not set
199# CONFIG_BLK_DEV_XD is not set
200# CONFIG_PARIDE is not set
201# CONFIG_BLK_CPQ_DA is not set
202# CONFIG_BLK_CPQ_CISS_DA is not set
203# CONFIG_BLK_DEV_DAC960 is not set
204# CONFIG_BLK_DEV_UMEM is not set
205# CONFIG_BLK_DEV_COW_COMMON is not set
206CONFIG_BLK_DEV_LOOP=y
207# CONFIG_BLK_DEV_CRYPTOLOOP is not set
208# CONFIG_BLK_DEV_NBD is not set
209# CONFIG_BLK_DEV_SX8 is not set
210# CONFIG_BLK_DEV_RAM is not set
211CONFIG_BLK_DEV_RAM_COUNT=16
212CONFIG_INITRAMFS_SOURCE=""
213# CONFIG_CDROM_PKTCDVD is not set
214
215#
216# IO Schedulers
217#
218CONFIG_IOSCHED_NOOP=y
219CONFIG_IOSCHED_AS=y
220CONFIG_IOSCHED_DEADLINE=y
221CONFIG_IOSCHED_CFQ=y
222# CONFIG_ATA_OVER_ETH is not set
223
224#
225# ATA/ATAPI/MFM/RLL support
226#
227CONFIG_IDE=y
228CONFIG_BLK_DEV_IDE=y
229
230#
231# Please see Documentation/ide.txt for help/info on IDE drives
232#
233# CONFIG_BLK_DEV_IDE_SATA is not set
234CONFIG_BLK_DEV_IDEDISK=y
235CONFIG_IDEDISK_MULTI_MODE=y
236# CONFIG_BLK_DEV_IDECD is not set
237# CONFIG_BLK_DEV_IDETAPE is not set
238# CONFIG_BLK_DEV_IDEFLOPPY is not set
239# CONFIG_IDE_TASK_IOCTL is not set
240
241#
242# IDE chipset support/bugfixes
243#
244CONFIG_IDE_GENERIC=y
245CONFIG_BLK_DEV_IDEPCI=y
246# CONFIG_IDEPCI_SHARE_IRQ is not set
247# CONFIG_BLK_DEV_OFFBOARD is not set
248# CONFIG_BLK_DEV_GENERIC is not set
249# CONFIG_BLK_DEV_OPTI621 is not set
250CONFIG_BLK_DEV_SL82C105=y
251CONFIG_BLK_DEV_IDEDMA_PCI=y
252# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
253CONFIG_IDEDMA_PCI_AUTO=y
254# CONFIG_IDEDMA_ONLYDISK is not set
255# CONFIG_BLK_DEV_AEC62XX is not set
256# CONFIG_BLK_DEV_ALI15X3 is not set
257# CONFIG_BLK_DEV_AMD74XX is not set
258# CONFIG_BLK_DEV_CMD64X is not set
259# CONFIG_BLK_DEV_TRIFLEX is not set
260# CONFIG_BLK_DEV_CY82C693 is not set
261# CONFIG_BLK_DEV_CS5520 is not set
262# CONFIG_BLK_DEV_CS5530 is not set
263# CONFIG_BLK_DEV_HPT34X is not set
264# CONFIG_BLK_DEV_HPT366 is not set
265# CONFIG_BLK_DEV_SC1200 is not set
266# CONFIG_BLK_DEV_PIIX is not set
267# CONFIG_BLK_DEV_NS87415 is not set
268# CONFIG_BLK_DEV_PDC202XX_OLD is not set
269# CONFIG_BLK_DEV_PDC202XX_NEW is not set
270# CONFIG_BLK_DEV_SVWKS is not set
271# CONFIG_BLK_DEV_SIIMAGE is not set
272# CONFIG_BLK_DEV_SLC90E66 is not set
273# CONFIG_BLK_DEV_TRM290 is not set
274# CONFIG_BLK_DEV_VIA82CXXX is not set
275# CONFIG_IDE_ARM is not set
276# CONFIG_IDE_CHIPSETS is not set
277CONFIG_BLK_DEV_IDEDMA=y
278# CONFIG_IDEDMA_IVB is not set
279CONFIG_IDEDMA_AUTO=y
280# CONFIG_BLK_DEV_HD is not set
281
282#
283# SCSI device support
284#
285# CONFIG_SCSI is not set
286
287#
288# Multi-device support (RAID and LVM)
289#
290# CONFIG_MD is not set
291
292#
293# Fusion MPT device support
294#
295
296#
297# IEEE 1394 (FireWire) support
298#
299# CONFIG_IEEE1394 is not set
300
301#
302# I2O device support
303#
304# CONFIG_I2O is not set
305
306#
307# Networking support
308#
309CONFIG_NET=y
310
311#
312# Networking options
313#
314CONFIG_PACKET=y
315# CONFIG_PACKET_MMAP is not set
316CONFIG_NETLINK_DEV=y
317CONFIG_UNIX=y
318# CONFIG_NET_KEY is not set
319CONFIG_INET=y
320# CONFIG_IP_MULTICAST is not set
321# CONFIG_IP_ADVANCED_ROUTER is not set
322CONFIG_IP_PNP=y
323CONFIG_IP_PNP_DHCP=y
324CONFIG_IP_PNP_BOOTP=y
325CONFIG_IP_PNP_RARP=y
326# CONFIG_NET_IPIP is not set
327# CONFIG_NET_IPGRE is not set
328# CONFIG_ARPD is not set
329# CONFIG_SYN_COOKIES is not set
330# CONFIG_INET_AH is not set
331# CONFIG_INET_ESP is not set
332# CONFIG_INET_IPCOMP is not set
333# CONFIG_INET_TUNNEL is not set
334CONFIG_IP_TCPDIAG=y
335# CONFIG_IP_TCPDIAG_IPV6 is not set
336
337#
338# IP: Virtual Server Configuration
339#
340# CONFIG_IP_VS is not set
341# CONFIG_IPV6 is not set
342CONFIG_NETFILTER=y
343# CONFIG_NETFILTER_DEBUG is not set
344
345#
346# IP: Netfilter Configuration
347#
348CONFIG_IP_NF_CONNTRACK=y
349# CONFIG_IP_NF_CT_ACCT is not set
350# CONFIG_IP_NF_CONNTRACK_MARK is not set
351# CONFIG_IP_NF_CT_PROTO_SCTP is not set
352CONFIG_IP_NF_FTP=y
353# CONFIG_IP_NF_IRC is not set
354# CONFIG_IP_NF_TFTP is not set
355# CONFIG_IP_NF_AMANDA is not set
356CONFIG_IP_NF_QUEUE=y
357CONFIG_IP_NF_IPTABLES=y
358# CONFIG_IP_NF_MATCH_LIMIT is not set
359# CONFIG_IP_NF_MATCH_IPRANGE is not set
360# CONFIG_IP_NF_MATCH_MAC is not set
361# CONFIG_IP_NF_MATCH_PKTTYPE is not set
362# CONFIG_IP_NF_MATCH_MARK is not set
363# CONFIG_IP_NF_MATCH_MULTIPORT is not set
364# CONFIG_IP_NF_MATCH_TOS is not set
365# CONFIG_IP_NF_MATCH_RECENT is not set
366# CONFIG_IP_NF_MATCH_ECN is not set
367# CONFIG_IP_NF_MATCH_DSCP is not set
368# CONFIG_IP_NF_MATCH_AH_ESP is not set
369# CONFIG_IP_NF_MATCH_LENGTH is not set
370# CONFIG_IP_NF_MATCH_TTL is not set
371# CONFIG_IP_NF_MATCH_TCPMSS is not set
372# CONFIG_IP_NF_MATCH_HELPER is not set
373# CONFIG_IP_NF_MATCH_STATE is not set
374# CONFIG_IP_NF_MATCH_CONNTRACK is not set
375# CONFIG_IP_NF_MATCH_OWNER is not set
376# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
377# CONFIG_IP_NF_MATCH_REALM is not set
378# CONFIG_IP_NF_MATCH_SCTP is not set
379# CONFIG_IP_NF_MATCH_COMMENT is not set
380# CONFIG_IP_NF_MATCH_HASHLIMIT is not set
381# CONFIG_IP_NF_FILTER is not set
382# CONFIG_IP_NF_TARGET_LOG is not set
383# CONFIG_IP_NF_TARGET_ULOG is not set
384# CONFIG_IP_NF_TARGET_TCPMSS is not set
385# CONFIG_IP_NF_NAT is not set
386# CONFIG_IP_NF_MANGLE is not set
387# CONFIG_IP_NF_RAW is not set
388# CONFIG_IP_NF_ARPTABLES is not set
389
390#
391# SCTP Configuration (EXPERIMENTAL)
392#
393# CONFIG_IP_SCTP is not set
394# CONFIG_ATM is not set
395# CONFIG_BRIDGE is not set
396# CONFIG_VLAN_8021Q is not set
397# CONFIG_DECNET is not set
398# CONFIG_LLC2 is not set
399# CONFIG_IPX is not set
400# CONFIG_ATALK is not set
401# CONFIG_X25 is not set
402# CONFIG_LAPB is not set
403# CONFIG_NET_DIVERT is not set
404# CONFIG_ECONET is not set
405# CONFIG_WAN_ROUTER is not set
406
407#
408# QoS and/or fair queueing
409#
410# CONFIG_NET_SCHED is not set
411# CONFIG_NET_CLS_ROUTE is not set
412
413#
414# Network testing
415#
416# CONFIG_NET_PKTGEN is not set
417# CONFIG_NETPOLL is not set
418# CONFIG_NET_POLL_CONTROLLER is not set
419# CONFIG_HAMRADIO is not set
420# CONFIG_IRDA is not set
421# CONFIG_BT is not set
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# CONFIG_ETHERTAP is not set
428
429#
430# ARCnet devices
431#
432# CONFIG_ARCNET is not set
433
434#
435# Ethernet (10 or 100Mbit)
436#
437CONFIG_NET_ETHERNET=y
438CONFIG_MII=y
439# CONFIG_HAPPYMEAL is not set
440# CONFIG_SUNGEM is not set
441# CONFIG_NET_VENDOR_3COM is not set
442# CONFIG_LANCE is not set
443# CONFIG_NET_VENDOR_SMC is not set
444# CONFIG_SMC91X is not set
445# CONFIG_NET_VENDOR_RACAL is not set
446
447#
448# Tulip family network device support
449#
450CONFIG_NET_TULIP=y
451# CONFIG_DE2104X is not set
452CONFIG_TULIP=y
453# CONFIG_TULIP_MWI is not set
454CONFIG_TULIP_MMIO=y
455# CONFIG_TULIP_NAPI is not set
456# CONFIG_DE4X5 is not set
457# CONFIG_WINBOND_840 is not set
458# CONFIG_DM9102 is not set
459# CONFIG_AT1700 is not set
460# CONFIG_DEPCA is not set
461# CONFIG_HP100 is not set
462# CONFIG_NET_ISA is not set
463CONFIG_NET_PCI=y
464# CONFIG_PCNET32 is not set
465# CONFIG_AMD8111_ETH is not set
466# CONFIG_ADAPTEC_STARFIRE is not set
467# CONFIG_AC3200 is not set
468# CONFIG_APRICOT is not set
469# CONFIG_B44 is not set
470# CONFIG_FORCEDETH is not set
471# CONFIG_CS89x0 is not set
472# CONFIG_DGRS is not set
473# CONFIG_EEPRO100 is not set
474# CONFIG_E100 is not set
475# CONFIG_FEALNX is not set
476# CONFIG_NATSEMI is not set
477CONFIG_NE2K_PCI=y
478# CONFIG_8139CP is not set
479# CONFIG_8139TOO is not set
480# CONFIG_SIS900 is not set
481# CONFIG_EPIC100 is not set
482# CONFIG_SUNDANCE is not set
483# CONFIG_TLAN is not set
484# CONFIG_VIA_RHINE is not set
485# CONFIG_NET_POCKET is not set
486
487#
488# Ethernet (1000 Mbit)
489#
490# CONFIG_ACENIC is not set
491# CONFIG_DL2K is not set
492# CONFIG_E1000 is not set
493# CONFIG_NS83820 is not set
494# CONFIG_HAMACHI is not set
495# CONFIG_YELLOWFIN is not set
496# CONFIG_R8169 is not set
497# CONFIG_SK98LIN is not set
498# CONFIG_VIA_VELOCITY is not set
499# CONFIG_TIGON3 is not set
500
501#
502# Ethernet (10000 Mbit)
503#
504# CONFIG_IXGB is not set
505# CONFIG_S2IO is not set
506
507#
508# Token Ring devices
509#
510# CONFIG_TR is not set
511
512#
513# Wireless LAN (non-hamradio)
514#
515# CONFIG_NET_RADIO is not set
516
517#
518# Wan interfaces
519#
520# CONFIG_WAN is not set
521# CONFIG_FDDI is not set
522# CONFIG_HIPPI is not set
523# CONFIG_PLIP is not set
524# CONFIG_PPP is not set
525# CONFIG_SLIP is not set
526# CONFIG_SHAPER is not set
527# CONFIG_NETCONSOLE is not set
528
529#
530# ISDN subsystem
531#
532# CONFIG_ISDN is not set
533
534#
535# Input device support
536#
537CONFIG_INPUT=y
538
539#
540# Userland interfaces
541#
542CONFIG_INPUT_MOUSEDEV=y
543CONFIG_INPUT_MOUSEDEV_PSAUX=y
544CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
545CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
546# CONFIG_INPUT_JOYDEV is not set
547# CONFIG_INPUT_TSDEV is not set
548# CONFIG_INPUT_EVDEV is not set
549# CONFIG_INPUT_EVBUG is not set
550
551#
552# Input Device Drivers
553#
554CONFIG_INPUT_KEYBOARD=y
555CONFIG_KEYBOARD_ATKBD=y
556# CONFIG_KEYBOARD_SUNKBD is not set
557# CONFIG_KEYBOARD_LKKBD is not set
558# CONFIG_KEYBOARD_XTKBD is not set
559# CONFIG_KEYBOARD_NEWTON is not set
560CONFIG_INPUT_MOUSE=y
561CONFIG_MOUSE_PS2=y
562CONFIG_MOUSE_SERIAL=y
563# CONFIG_MOUSE_INPORT is not set
564# CONFIG_MOUSE_LOGIBM is not set
565# CONFIG_MOUSE_PC110PAD is not set
566# CONFIG_MOUSE_VSXXXAA is not set
567# CONFIG_INPUT_JOYSTICK is not set
568# CONFIG_INPUT_TOUCHSCREEN is not set
569CONFIG_INPUT_MISC=y
570CONFIG_INPUT_UINPUT=y
571
572#
573# Hardware I/O ports
574#
575CONFIG_SERIO=y
576CONFIG_SERIO_I8042=y
577CONFIG_SERIO_SERPORT=y
578# CONFIG_SERIO_PARKBD is not set
579# CONFIG_SERIO_PCIPS2 is not set
580CONFIG_SERIO_LIBPS2=y
581# CONFIG_SERIO_RAW is not set
582# CONFIG_GAMEPORT is not set
583CONFIG_SOUND_GAMEPORT=y
584
585#
586# Character devices
587#
588CONFIG_VT=y
589CONFIG_VT_CONSOLE=y
590CONFIG_HW_CONSOLE=y
591# CONFIG_SERIAL_NONSTANDARD is not set
592
593#
594# Serial drivers
595#
596CONFIG_SERIAL_8250=y
597CONFIG_SERIAL_8250_CONSOLE=y
598CONFIG_SERIAL_8250_NR_UARTS=4
599# CONFIG_SERIAL_8250_EXTENDED is not set
600
601#
602# Non-8250 serial port support
603#
604# CONFIG_SERIAL_21285 is not set
605CONFIG_SERIAL_CORE=y
606CONFIG_SERIAL_CORE_CONSOLE=y
607CONFIG_UNIX98_PTYS=y
608CONFIG_LEGACY_PTYS=y
609CONFIG_LEGACY_PTY_COUNT=256
610CONFIG_PRINTER=y
611# CONFIG_LP_CONSOLE is not set
612# CONFIG_PPDEV is not set
613# CONFIG_TIPAR is not set
614
615#
616# IPMI
617#
618# CONFIG_IPMI_HANDLER is not set
619
620#
621# Watchdog Cards
622#
623CONFIG_WATCHDOG=y
624# CONFIG_WATCHDOG_NOWAYOUT is not set
625
626#
627# Watchdog Device Drivers
628#
629# CONFIG_SOFT_WATCHDOG is not set
630# CONFIG_21285_WATCHDOG is not set
631CONFIG_977_WATCHDOG=y
632
633#
634# ISA-based Watchdog Cards
635#
636# CONFIG_PCWATCHDOG is not set
637# CONFIG_MIXCOMWD is not set
638# CONFIG_WDT is not set
639
640#
641# PCI-based Watchdog Cards
642#
643# CONFIG_PCIPCWATCHDOG is not set
644# CONFIG_WDTPCI is not set
645CONFIG_DS1620=y
646CONFIG_NWBUTTON=y
647CONFIG_NWBUTTON_REBOOT=y
648CONFIG_NWFLASH=y
649# CONFIG_NVRAM is not set
650CONFIG_RTC=y
651# CONFIG_DTLK is not set
652# CONFIG_R3964 is not set
653# CONFIG_APPLICOM is not set
654
655#
656# Ftape, the floppy tape device driver
657#
658# CONFIG_DRM is not set
659# CONFIG_RAW_DRIVER is not set
660
661#
662# TPM devices
663#
664# CONFIG_TCG_TPM is not set
665
666#
667# I2C support
668#
669# CONFIG_I2C is not set
670
671#
672# Misc devices
673#
674
675#
676# Multimedia devices
677#
678# CONFIG_VIDEO_DEV is not set
679
680#
681# Digital Video Broadcasting Devices
682#
683# CONFIG_DVB is not set
684
685#
686# Graphics support
687#
688CONFIG_FB=y
689CONFIG_FB_CFB_FILLRECT=y
690CONFIG_FB_CFB_COPYAREA=y
691CONFIG_FB_CFB_IMAGEBLIT=y
692CONFIG_FB_SOFT_CURSOR=y
693# CONFIG_FB_MODE_HELPERS is not set
694# CONFIG_FB_TILEBLITTING is not set
695# CONFIG_FB_CIRRUS is not set
696# CONFIG_FB_PM2 is not set
697CONFIG_FB_CYBER2000=y
698# CONFIG_FB_ASILIANT is not set
699# CONFIG_FB_IMSTT is not set
700# CONFIG_FB_NVIDIA is not set
701# CONFIG_FB_RIVA is not set
702# CONFIG_FB_MATROX is not set
703# CONFIG_FB_RADEON_OLD is not set
704# CONFIG_FB_RADEON is not set
705# CONFIG_FB_ATY128 is not set
706# CONFIG_FB_ATY is not set
707# CONFIG_FB_SAVAGE is not set
708# CONFIG_FB_SIS is not set
709# CONFIG_FB_NEOMAGIC is not set
710# CONFIG_FB_KYRO is not set
711# CONFIG_FB_3DFX is not set
712# CONFIG_FB_VOODOO1 is not set
713# CONFIG_FB_TRIDENT is not set
714# CONFIG_FB_VIRTUAL is not set
715
716#
717# Console display driver support
718#
719CONFIG_VGA_CONSOLE=y
720# CONFIG_MDA_CONSOLE is not set
721CONFIG_DUMMY_CONSOLE=y
722CONFIG_FRAMEBUFFER_CONSOLE=y
723CONFIG_FONTS=y
724CONFIG_FONT_8x8=y
725CONFIG_FONT_8x16=y
726# CONFIG_FONT_6x11 is not set
727# CONFIG_FONT_PEARL_8x8 is not set
728# CONFIG_FONT_ACORN_8x8 is not set
729# CONFIG_FONT_MINI_4x6 is not set
730# CONFIG_FONT_SUN8x16 is not set
731# CONFIG_FONT_SUN12x22 is not set
732
733#
734# Logo configuration
735#
736CONFIG_LOGO=y
737CONFIG_LOGO_LINUX_MONO=y
738CONFIG_LOGO_LINUX_VGA16=y
739CONFIG_LOGO_LINUX_CLUT224=y
740# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
741
742#
743# Sound
744#
745CONFIG_SOUND=y
746
747#
748# Advanced Linux Sound Architecture
749#
750# CONFIG_SND is not set
751
752#
753# Open Sound System
754#
755CONFIG_SOUND_PRIME=y
756# CONFIG_SOUND_BT878 is not set
757# CONFIG_SOUND_CMPCI is not set
758# CONFIG_SOUND_EMU10K1 is not set
759# CONFIG_SOUND_FUSION is not set
760# CONFIG_SOUND_CS4281 is not set
761# CONFIG_SOUND_ES1370 is not set
762# CONFIG_SOUND_ES1371 is not set
763# CONFIG_SOUND_ESSSOLO1 is not set
764# CONFIG_SOUND_MAESTRO is not set
765# CONFIG_SOUND_MAESTRO3 is not set
766# CONFIG_SOUND_ICH is not set
767# CONFIG_SOUND_SONICVIBES is not set
768# CONFIG_SOUND_TRIDENT is not set
769# CONFIG_SOUND_VIA82CXXX is not set
770CONFIG_SOUND_OSS=y
771CONFIG_SOUND_TRACEINIT=y
772CONFIG_SOUND_DMAP=y
773# CONFIG_SOUND_AD1816 is not set
774# CONFIG_SOUND_AD1889 is not set
775# CONFIG_SOUND_SGALAXY is not set
776# CONFIG_SOUND_ADLIB is not set
777# CONFIG_SOUND_ACI_MIXER is not set
778# CONFIG_SOUND_CS4232 is not set
779# CONFIG_SOUND_SSCAPE is not set
780# CONFIG_SOUND_GUS is not set
781# CONFIG_SOUND_VMIDI is not set
782# CONFIG_SOUND_TRIX is not set
783# CONFIG_SOUND_MSS is not set
784# CONFIG_SOUND_MPU401 is not set
785# CONFIG_SOUND_NM256 is not set
786# CONFIG_SOUND_MAD16 is not set
787# CONFIG_SOUND_PAS is not set
788# CONFIG_SOUND_PSS is not set
789# CONFIG_SOUND_SB is not set
790# CONFIG_SOUND_AWE32_SYNTH is not set
791# CONFIG_SOUND_MAUI is not set
792CONFIG_SOUND_YM3812=y
793# CONFIG_SOUND_OPL3SA1 is not set
794# CONFIG_SOUND_OPL3SA2 is not set
795# CONFIG_SOUND_YMFPCI is not set
796# CONFIG_SOUND_UART6850 is not set
797# CONFIG_SOUND_AEDSP16 is not set
798CONFIG_SOUND_WAVEARTIST=y
799# CONFIG_SOUND_ALI5455 is not set
800# CONFIG_SOUND_FORTE is not set
801# CONFIG_SOUND_RME96XX is not set
802# CONFIG_SOUND_AD1980 is not set
803
804#
805# USB support
806#
807CONFIG_USB_ARCH_HAS_HCD=y
808CONFIG_USB_ARCH_HAS_OHCI=y
809# CONFIG_USB is not set
810
811#
812# USB Gadget Support
813#
814# CONFIG_USB_GADGET is not set
815
816#
817# MMC/SD Card support
818#
819# CONFIG_MMC is not set
820
821#
822# File systems
823#
824CONFIG_EXT2_FS=y
825# CONFIG_EXT2_FS_XATTR is not set
826# CONFIG_EXT3_FS is not set
827# CONFIG_JBD is not set
828# CONFIG_REISERFS_FS is not set
829# CONFIG_JFS_FS is not set
830
831#
832# XFS support
833#
834# CONFIG_XFS_FS is not set
835# CONFIG_MINIX_FS is not set
836# CONFIG_ROMFS_FS is not set
837# CONFIG_QUOTA is not set
838CONFIG_DNOTIFY=y
839CONFIG_AUTOFS_FS=y
840# CONFIG_AUTOFS4_FS is not set
841
842#
843# CD-ROM/DVD Filesystems
844#
845CONFIG_ISO9660_FS=y
846CONFIG_JOLIET=y
847# CONFIG_ZISOFS is not set
848# CONFIG_UDF_FS is not set
849
850#
851# DOS/FAT/NT Filesystems
852#
853# CONFIG_MSDOS_FS is not set
854# CONFIG_VFAT_FS is not set
855# CONFIG_NTFS_FS is not set
856
857#
858# Pseudo filesystems
859#
860CONFIG_PROC_FS=y
861CONFIG_SYSFS=y
862# CONFIG_DEVFS_FS is not set
863# CONFIG_DEVPTS_FS_XATTR is not set
864CONFIG_TMPFS=y
865# CONFIG_TMPFS_XATTR is not set
866# CONFIG_HUGETLB_PAGE is not set
867CONFIG_RAMFS=y
868
869#
870# Miscellaneous filesystems
871#
872# CONFIG_ADFS_FS is not set
873# CONFIG_AFFS_FS is not set
874# CONFIG_HFS_FS is not set
875# CONFIG_HFSPLUS_FS is not set
876# CONFIG_BEFS_FS is not set
877# CONFIG_BFS_FS is not set
878# CONFIG_EFS_FS is not set
879# CONFIG_CRAMFS is not set
880# CONFIG_VXFS_FS is not set
881# CONFIG_HPFS_FS is not set
882# CONFIG_QNX4FS_FS is not set
883# CONFIG_SYSV_FS is not set
884# CONFIG_UFS_FS is not set
885
886#
887# Network File Systems
888#
889CONFIG_NFS_FS=y
890CONFIG_NFS_V3=y
891CONFIG_NFS_V4=y
892# CONFIG_NFS_DIRECTIO is not set
893CONFIG_NFSD=y
894CONFIG_NFSD_V3=y
895# CONFIG_NFSD_V4 is not set
896# CONFIG_NFSD_TCP is not set
897CONFIG_ROOT_NFS=y
898CONFIG_LOCKD=y
899CONFIG_LOCKD_V4=y
900CONFIG_EXPORTFS=y
901CONFIG_SUNRPC=y
902CONFIG_SUNRPC_GSS=y
903CONFIG_RPCSEC_GSS_KRB5=y
904# CONFIG_RPCSEC_GSS_SPKM3 is not set
905CONFIG_SMB_FS=y
906# CONFIG_SMB_NLS_DEFAULT is not set
907# CONFIG_CIFS is not set
908# CONFIG_NCP_FS is not set
909# CONFIG_CODA_FS is not set
910# CONFIG_AFS_FS is not set
911
912#
913# Partition Types
914#
915CONFIG_PARTITION_ADVANCED=y
916# CONFIG_ACORN_PARTITION is not set
917# CONFIG_OSF_PARTITION is not set
918# CONFIG_AMIGA_PARTITION is not set
919# CONFIG_ATARI_PARTITION is not set
920# CONFIG_MAC_PARTITION is not set
921CONFIG_MSDOS_PARTITION=y
922# CONFIG_BSD_DISKLABEL is not set
923# CONFIG_MINIX_SUBPARTITION is not set
924# CONFIG_SOLARIS_X86_PARTITION is not set
925# CONFIG_UNIXWARE_DISKLABEL is not set
926# CONFIG_LDM_PARTITION is not set
927# CONFIG_SGI_PARTITION is not set
928# CONFIG_ULTRIX_PARTITION is not set
929# CONFIG_SUN_PARTITION is not set
930# CONFIG_EFI_PARTITION is not set
931
932#
933# Native Language Support
934#
935CONFIG_NLS=y
936CONFIG_NLS_DEFAULT="iso8859-1"
937CONFIG_NLS_CODEPAGE_437=y
938# CONFIG_NLS_CODEPAGE_737 is not set
939# CONFIG_NLS_CODEPAGE_775 is not set
940CONFIG_NLS_CODEPAGE_850=y
941CONFIG_NLS_CODEPAGE_852=y
942# CONFIG_NLS_CODEPAGE_855 is not set
943# CONFIG_NLS_CODEPAGE_857 is not set
944# CONFIG_NLS_CODEPAGE_860 is not set
945# CONFIG_NLS_CODEPAGE_861 is not set
946# CONFIG_NLS_CODEPAGE_862 is not set
947# CONFIG_NLS_CODEPAGE_863 is not set
948# CONFIG_NLS_CODEPAGE_864 is not set
949# CONFIG_NLS_CODEPAGE_865 is not set
950# CONFIG_NLS_CODEPAGE_866 is not set
951# CONFIG_NLS_CODEPAGE_869 is not set
952# CONFIG_NLS_CODEPAGE_936 is not set
953# CONFIG_NLS_CODEPAGE_950 is not set
954# CONFIG_NLS_CODEPAGE_932 is not set
955# CONFIG_NLS_CODEPAGE_949 is not set
956# CONFIG_NLS_CODEPAGE_874 is not set
957# CONFIG_NLS_ISO8859_8 is not set
958# CONFIG_NLS_CODEPAGE_1250 is not set
959# CONFIG_NLS_CODEPAGE_1251 is not set
960# CONFIG_NLS_ASCII is not set
961CONFIG_NLS_ISO8859_1=y
962CONFIG_NLS_ISO8859_2=y
963# CONFIG_NLS_ISO8859_3 is not set
964# CONFIG_NLS_ISO8859_4 is not set
965# CONFIG_NLS_ISO8859_5 is not set
966# CONFIG_NLS_ISO8859_6 is not set
967# CONFIG_NLS_ISO8859_7 is not set
968# CONFIG_NLS_ISO8859_9 is not set
969# CONFIG_NLS_ISO8859_13 is not set
970# CONFIG_NLS_ISO8859_14 is not set
971CONFIG_NLS_ISO8859_15=y
972# CONFIG_NLS_KOI8_R is not set
973# CONFIG_NLS_KOI8_U is not set
974CONFIG_NLS_UTF8=y
975
976#
977# Profiling support
978#
979# CONFIG_PROFILING is not set
980
981#
982# Kernel hacking
983#
984# CONFIG_PRINTK_TIME is not set
985CONFIG_DEBUG_KERNEL=y
986CONFIG_MAGIC_SYSRQ=y
987CONFIG_LOG_BUF_SHIFT=14
988# CONFIG_SCHEDSTATS is not set
989# CONFIG_DEBUG_SLAB is not set
990# CONFIG_DEBUG_SPINLOCK is not set
991# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
992# CONFIG_DEBUG_KOBJECT is not set
993CONFIG_DEBUG_BUGVERBOSE=y
994# CONFIG_DEBUG_INFO is not set
995# CONFIG_DEBUG_FS is not set
996CONFIG_FRAME_POINTER=y
997CONFIG_DEBUG_USER=y
998# CONFIG_DEBUG_WAITQ is not set
999# CONFIG_DEBUG_ERRORS is not set
1000# CONFIG_DEBUG_LL is not set
1001
1002#
1003# Security options
1004#
1005# CONFIG_KEYS is not set
1006# CONFIG_SECURITY is not set
1007
1008#
1009# Cryptographic options
1010#
1011CONFIG_CRYPTO=y
1012# CONFIG_CRYPTO_HMAC is not set
1013# CONFIG_CRYPTO_NULL is not set
1014# CONFIG_CRYPTO_MD4 is not set
1015CONFIG_CRYPTO_MD5=y
1016# CONFIG_CRYPTO_SHA1 is not set
1017# CONFIG_CRYPTO_SHA256 is not set
1018# CONFIG_CRYPTO_SHA512 is not set
1019# CONFIG_CRYPTO_WP512 is not set
1020# CONFIG_CRYPTO_TGR192 is not set
1021CONFIG_CRYPTO_DES=y
1022# CONFIG_CRYPTO_BLOWFISH is not set
1023# CONFIG_CRYPTO_TWOFISH is not set
1024# CONFIG_CRYPTO_SERPENT is not set
1025# CONFIG_CRYPTO_AES is not set
1026# CONFIG_CRYPTO_CAST5 is not set
1027# CONFIG_CRYPTO_CAST6 is not set
1028# CONFIG_CRYPTO_TEA is not set
1029# CONFIG_CRYPTO_ARC4 is not set
1030# CONFIG_CRYPTO_KHAZAD is not set
1031# CONFIG_CRYPTO_ANUBIS is not set
1032# CONFIG_CRYPTO_DEFLATE is not set
1033# CONFIG_CRYPTO_MICHAEL_MIC is not set
1034# CONFIG_CRYPTO_CRC32C is not set
1035# CONFIG_CRYPTO_TEST is not set
1036
1037#
1038# Hardware crypto devices
1039#
1040
1041#
1042# Library routines
1043#
1044# CONFIG_CRC_CCITT is not set
1045CONFIG_CRC32=y
1046# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/configs/omap_h2_1610_defconfig b/arch/arm/configs/omap_h2_1610_defconfig
new file mode 100644
index 000000000000..4e58d9341bce
--- /dev/null
+++ b/arch/arm/configs/omap_h2_1610_defconfig
@@ -0,0 +1,971 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 17:52:41 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19CONFIG_LOCK_KERNEL=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
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
59# CONFIG_KMOD is not set
60
61#
62# System Type
63#
64# CONFIG_ARCH_CLPS7500 is not set
65# CONFIG_ARCH_CLPS711X is not set
66# CONFIG_ARCH_CO285 is not set
67# CONFIG_ARCH_EBSA110 is not set
68# CONFIG_ARCH_CAMELOT is not set
69# CONFIG_ARCH_FOOTBRIDGE is not set
70# CONFIG_ARCH_INTEGRATOR is not set
71# CONFIG_ARCH_IOP3XX is not set
72# CONFIG_ARCH_IXP4XX is not set
73# CONFIG_ARCH_IXP2000 is not set
74# CONFIG_ARCH_L7200 is not set
75# CONFIG_ARCH_PXA is not set
76# CONFIG_ARCH_RPC is not set
77# CONFIG_ARCH_SA1100 is not set
78# CONFIG_ARCH_S3C2410 is not set
79# CONFIG_ARCH_SHARK is not set
80# CONFIG_ARCH_LH7A40X is not set
81CONFIG_ARCH_OMAP=y
82# CONFIG_ARCH_VERSATILE is not set
83# CONFIG_ARCH_IMX is not set
84# CONFIG_ARCH_H720X is not set
85
86#
87# TI OMAP Implementations
88#
89
90#
91# OMAP Core Type
92#
93# CONFIG_ARCH_OMAP730 is not set
94# CONFIG_ARCH_OMAP1510 is not set
95CONFIG_ARCH_OMAP16XX=y
96CONFIG_ARCH_OMAP_OTG=y
97
98#
99# OMAP Board Type
100#
101# CONFIG_MACH_OMAP_INNOVATOR is not set
102CONFIG_MACH_OMAP_H2=y
103# CONFIG_MACH_OMAP_H3 is not set
104# CONFIG_MACH_OMAP_H4 is not set
105# CONFIG_MACH_OMAP_OSK is not set
106# CONFIG_MACH_OMAP_GENERIC is not set
107
108#
109# OMAP Feature Selections
110#
111CONFIG_OMAP_MUX=y
112# CONFIG_OMAP_MUX_DEBUG is not set
113CONFIG_OMAP_MUX_WARNINGS=y
114CONFIG_OMAP_MPU_TIMER=y
115# CONFIG_OMAP_32K_TIMER is not set
116CONFIG_OMAP_LL_DEBUG_UART1=y
117# CONFIG_OMAP_LL_DEBUG_UART2 is not set
118# CONFIG_OMAP_LL_DEBUG_UART3 is not set
119CONFIG_OMAP_ARM_192MHZ=y
120# CONFIG_OMAP_ARM_168MHZ is not set
121# CONFIG_OMAP_ARM_120MHZ is not set
122# CONFIG_OMAP_ARM_60MHZ is not set
123# CONFIG_OMAP_ARM_30MHZ is not set
124
125#
126# Processor Type
127#
128CONFIG_CPU_32=y
129CONFIG_CPU_ARM926T=y
130CONFIG_CPU_32v5=y
131CONFIG_CPU_ABRT_EV5TJ=y
132CONFIG_CPU_CACHE_VIVT=y
133CONFIG_CPU_COPY_V4WB=y
134CONFIG_CPU_TLB_V4WBI=y
135
136#
137# Processor Features
138#
139CONFIG_ARM_THUMB=y
140# CONFIG_CPU_ICACHE_DISABLE is not set
141# CONFIG_CPU_DCACHE_DISABLE is not set
142# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
143# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
144
145#
146# Bus support
147#
148
149#
150# PCCARD (PCMCIA/CardBus) support
151#
152# CONFIG_PCCARD is not set
153
154#
155# Kernel Features
156#
157CONFIG_PREEMPT=y
158# CONFIG_LEDS is not set
159CONFIG_ALIGNMENT_TRAP=y
160
161#
162# Boot options
163#
164CONFIG_ZBOOT_ROM_TEXT=0x0
165CONFIG_ZBOOT_ROM_BSS=0x0
166CONFIG_CMDLINE="mem=32M console=ttyS0,115200n8 root=0801 ro init=/bin/sh"
167# CONFIG_XIP_KERNEL is not set
168
169#
170# Floating point emulation
171#
172
173#
174# At least one emulation must be selected
175#
176CONFIG_FPE_NWFPE=y
177# CONFIG_FPE_NWFPE_XP is not set
178# CONFIG_FPE_FASTFPE is not set
179# CONFIG_VFP is not set
180
181#
182# Userspace binary formats
183#
184CONFIG_BINFMT_ELF=y
185CONFIG_BINFMT_AOUT=y
186# CONFIG_BINFMT_MISC is not set
187# CONFIG_ARTHUR is not set
188
189#
190# Power management options
191#
192CONFIG_PM=y
193# CONFIG_APM is not set
194
195#
196# Device Drivers
197#
198
199#
200# Generic Driver Options
201#
202CONFIG_STANDALONE=y
203CONFIG_PREVENT_FIRMWARE_BUILD=y
204# CONFIG_FW_LOADER is not set
205CONFIG_DEBUG_DRIVER=y
206
207#
208# Memory Technology Devices (MTD)
209#
210CONFIG_MTD=y
211CONFIG_MTD_DEBUG=y
212CONFIG_MTD_DEBUG_VERBOSE=3
213# CONFIG_MTD_CONCAT is not set
214CONFIG_MTD_PARTITIONS=y
215# CONFIG_MTD_REDBOOT_PARTS is not set
216CONFIG_MTD_CMDLINE_PARTS=y
217# CONFIG_MTD_AFS_PARTS is not set
218
219#
220# User Modules And Translation Layers
221#
222CONFIG_MTD_CHAR=y
223CONFIG_MTD_BLOCK=y
224# CONFIG_FTL is not set
225# CONFIG_NFTL is not set
226# CONFIG_INFTL is not set
227
228#
229# RAM/ROM/Flash chip drivers
230#
231CONFIG_MTD_CFI=y
232# CONFIG_MTD_JEDECPROBE is not set
233CONFIG_MTD_GEN_PROBE=y
234# CONFIG_MTD_CFI_ADV_OPTIONS is not set
235CONFIG_MTD_MAP_BANK_WIDTH_1=y
236CONFIG_MTD_MAP_BANK_WIDTH_2=y
237CONFIG_MTD_MAP_BANK_WIDTH_4=y
238# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
239# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
240# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
241CONFIG_MTD_CFI_I1=y
242CONFIG_MTD_CFI_I2=y
243# CONFIG_MTD_CFI_I4 is not set
244# CONFIG_MTD_CFI_I8 is not set
245CONFIG_MTD_CFI_INTELEXT=y
246# CONFIG_MTD_CFI_AMDSTD is not set
247# CONFIG_MTD_CFI_STAA is not set
248CONFIG_MTD_CFI_UTIL=y
249# CONFIG_MTD_RAM is not set
250# CONFIG_MTD_ROM is not set
251# CONFIG_MTD_ABSENT is not set
252# CONFIG_MTD_XIP is not set
253
254#
255# Mapping drivers for chip access
256#
257# CONFIG_MTD_COMPLEX_MAPPINGS is not set
258# CONFIG_MTD_PHYSMAP is not set
259# CONFIG_MTD_ARM_INTEGRATOR is not set
260# CONFIG_MTD_EDB7312 is not set
261
262#
263# Self-contained MTD device drivers
264#
265# CONFIG_MTD_SLRAM is not set
266# CONFIG_MTD_PHRAM is not set
267# CONFIG_MTD_MTDRAM is not set
268# CONFIG_MTD_BLKMTD is not set
269# CONFIG_MTD_BLOCK2MTD is not set
270
271#
272# Disk-On-Chip Device Drivers
273#
274# CONFIG_MTD_DOC2000 is not set
275# CONFIG_MTD_DOC2001 is not set
276# CONFIG_MTD_DOC2001PLUS is not set
277
278#
279# NAND Flash Device Drivers
280#
281# CONFIG_MTD_NAND is not set
282
283#
284# Parallel port support
285#
286# CONFIG_PARPORT is not set
287
288#
289# Plug and Play support
290#
291
292#
293# Block devices
294#
295# CONFIG_BLK_DEV_FD is not set
296# CONFIG_BLK_DEV_COW_COMMON is not set
297CONFIG_BLK_DEV_LOOP=y
298# CONFIG_BLK_DEV_CRYPTOLOOP is not set
299# CONFIG_BLK_DEV_NBD is not set
300CONFIG_BLK_DEV_RAM=y
301CONFIG_BLK_DEV_RAM_COUNT=16
302CONFIG_BLK_DEV_RAM_SIZE=8192
303CONFIG_BLK_DEV_INITRD=y
304CONFIG_INITRAMFS_SOURCE=""
305# CONFIG_CDROM_PKTCDVD is not set
306
307#
308# IO Schedulers
309#
310CONFIG_IOSCHED_NOOP=y
311CONFIG_IOSCHED_AS=y
312CONFIG_IOSCHED_DEADLINE=y
313CONFIG_IOSCHED_CFQ=y
314CONFIG_ATA_OVER_ETH=m
315
316#
317# SCSI device support
318#
319CONFIG_SCSI=y
320CONFIG_SCSI_PROC_FS=y
321
322#
323# SCSI support type (disk, tape, CD-ROM)
324#
325# CONFIG_BLK_DEV_SD is not set
326# CONFIG_CHR_DEV_ST is not set
327# CONFIG_CHR_DEV_OSST is not set
328# CONFIG_BLK_DEV_SR is not set
329# CONFIG_CHR_DEV_SG is not set
330
331#
332# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
333#
334# CONFIG_SCSI_MULTI_LUN is not set
335# CONFIG_SCSI_CONSTANTS is not set
336# CONFIG_SCSI_LOGGING is not set
337
338#
339# SCSI Transport Attributes
340#
341# CONFIG_SCSI_SPI_ATTRS is not set
342# CONFIG_SCSI_FC_ATTRS is not set
343# CONFIG_SCSI_ISCSI_ATTRS is not set
344
345#
346# SCSI low-level drivers
347#
348# CONFIG_SCSI_SATA is not set
349# CONFIG_SCSI_DEBUG is not set
350
351#
352# Multi-device support (RAID and LVM)
353#
354# CONFIG_MD is not set
355
356#
357# Fusion MPT device support
358#
359
360#
361# IEEE 1394 (FireWire) support
362#
363
364#
365# I2O device support
366#
367
368#
369# Networking support
370#
371CONFIG_NET=y
372
373#
374# Networking options
375#
376CONFIG_PACKET=y
377# CONFIG_PACKET_MMAP is not set
378# CONFIG_NETLINK_DEV is not set
379CONFIG_UNIX=y
380# CONFIG_NET_KEY is not set
381CONFIG_INET=y
382# CONFIG_IP_MULTICAST is not set
383# CONFIG_IP_ADVANCED_ROUTER is not set
384CONFIG_IP_PNP=y
385CONFIG_IP_PNP_DHCP=y
386CONFIG_IP_PNP_BOOTP=y
387# CONFIG_IP_PNP_RARP is not set
388# CONFIG_NET_IPIP is not set
389# CONFIG_NET_IPGRE is not set
390# CONFIG_ARPD is not set
391# CONFIG_SYN_COOKIES is not set
392# CONFIG_INET_AH is not set
393# CONFIG_INET_ESP is not set
394# CONFIG_INET_IPCOMP is not set
395# CONFIG_INET_TUNNEL is not set
396CONFIG_IP_TCPDIAG=y
397# CONFIG_IP_TCPDIAG_IPV6 is not set
398# CONFIG_IPV6 is not set
399# CONFIG_NETFILTER is not set
400
401#
402# SCTP Configuration (EXPERIMENTAL)
403#
404# CONFIG_IP_SCTP is not set
405# CONFIG_ATM is not set
406# CONFIG_BRIDGE is not set
407# CONFIG_VLAN_8021Q is not set
408# CONFIG_DECNET is not set
409# CONFIG_LLC2 is not set
410# CONFIG_IPX is not set
411# CONFIG_ATALK is not set
412# CONFIG_X25 is not set
413# CONFIG_LAPB is not set
414# CONFIG_NET_DIVERT is not set
415# CONFIG_ECONET is not set
416# CONFIG_WAN_ROUTER is not set
417
418#
419# QoS and/or fair queueing
420#
421# CONFIG_NET_SCHED is not set
422# CONFIG_NET_CLS_ROUTE is not set
423
424#
425# Network testing
426#
427# CONFIG_NET_PKTGEN is not set
428# CONFIG_NETPOLL is not set
429# CONFIG_NET_POLL_CONTROLLER is not set
430# CONFIG_HAMRADIO is not set
431# CONFIG_IRDA is not set
432# CONFIG_BT is not set
433CONFIG_NETDEVICES=y
434# CONFIG_DUMMY is not set
435# CONFIG_BONDING is not set
436# CONFIG_EQUALIZER is not set
437# CONFIG_TUN is not set
438
439#
440# Ethernet (10 or 100Mbit)
441#
442CONFIG_NET_ETHERNET=y
443CONFIG_MII=y
444CONFIG_SMC91X=y
445
446#
447# Ethernet (1000 Mbit)
448#
449
450#
451# Ethernet (10000 Mbit)
452#
453
454#
455# Token Ring devices
456#
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
467CONFIG_PPP=y
468# CONFIG_PPP_MULTILINK is not set
469# CONFIG_PPP_FILTER is not set
470# CONFIG_PPP_ASYNC is not set
471# CONFIG_PPP_SYNC_TTY is not set
472# CONFIG_PPP_DEFLATE is not set
473# CONFIG_PPP_BSDCOMP is not set
474# CONFIG_PPPOE is not set
475CONFIG_SLIP=y
476CONFIG_SLIP_COMPRESSED=y
477# CONFIG_SLIP_SMART is not set
478# CONFIG_SLIP_MODE_SLIP6 is not set
479# CONFIG_SHAPER is not set
480# CONFIG_NETCONSOLE is not set
481
482#
483# ISDN subsystem
484#
485# CONFIG_ISDN is not set
486
487#
488# Input device support
489#
490CONFIG_INPUT=y
491
492#
493# Userland interfaces
494#
495CONFIG_INPUT_MOUSEDEV=y
496CONFIG_INPUT_MOUSEDEV_PSAUX=y
497CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
498CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
499# CONFIG_INPUT_JOYDEV is not set
500# CONFIG_INPUT_TSDEV is not set
501CONFIG_INPUT_EVDEV=y
502CONFIG_INPUT_EVBUG=y
503
504#
505# Input Device Drivers
506#
507# CONFIG_INPUT_KEYBOARD is not set
508# CONFIG_INPUT_MOUSE is not set
509# CONFIG_INPUT_JOYSTICK is not set
510# CONFIG_INPUT_TOUCHSCREEN is not set
511CONFIG_INPUT_MISC=y
512CONFIG_INPUT_UINPUT=y
513
514#
515# Hardware I/O ports
516#
517CONFIG_SERIO=y
518CONFIG_SERIO_SERPORT=y
519# CONFIG_SERIO_RAW is not set
520# CONFIG_GAMEPORT is not set
521CONFIG_SOUND_GAMEPORT=y
522
523#
524# Character devices
525#
526CONFIG_VT=y
527CONFIG_VT_CONSOLE=y
528CONFIG_HW_CONSOLE=y
529# CONFIG_SERIAL_NONSTANDARD is not set
530
531#
532# Serial drivers
533#
534CONFIG_SERIAL_8250=y
535CONFIG_SERIAL_8250_CONSOLE=y
536CONFIG_SERIAL_8250_NR_UARTS=4
537# CONFIG_SERIAL_8250_EXTENDED is not set
538
539#
540# Non-8250 serial port support
541#
542CONFIG_SERIAL_CORE=y
543CONFIG_SERIAL_CORE_CONSOLE=y
544CONFIG_UNIX98_PTYS=y
545# CONFIG_LEGACY_PTYS is not set
546
547#
548# IPMI
549#
550# CONFIG_IPMI_HANDLER is not set
551
552#
553# Watchdog Cards
554#
555CONFIG_WATCHDOG=y
556CONFIG_WATCHDOG_NOWAYOUT=y
557
558#
559# Watchdog Device Drivers
560#
561# CONFIG_SOFT_WATCHDOG is not set
562# CONFIG_NVRAM is not set
563# CONFIG_RTC is not set
564# CONFIG_DTLK is not set
565# CONFIG_R3964 is not set
566
567#
568# Ftape, the floppy tape device driver
569#
570# CONFIG_DRM is not set
571# CONFIG_RAW_DRIVER is not set
572
573#
574# TPM devices
575#
576# CONFIG_TCG_TPM is not set
577
578#
579# I2C support
580#
581CONFIG_I2C=y
582CONFIG_I2C_CHARDEV=y
583
584#
585# I2C Algorithms
586#
587# CONFIG_I2C_ALGOBIT is not set
588# CONFIG_I2C_ALGOPCF is not set
589# CONFIG_I2C_ALGOPCA is not set
590
591#
592# I2C Hardware Bus support
593#
594# CONFIG_I2C_ISA is not set
595# CONFIG_I2C_PARPORT_LIGHT is not set
596# CONFIG_I2C_STUB is not set
597# CONFIG_I2C_PCA_ISA is not set
598
599#
600# Hardware Sensors Chip support
601#
602# CONFIG_I2C_SENSOR is not set
603# CONFIG_SENSORS_ADM1021 is not set
604# CONFIG_SENSORS_ADM1025 is not set
605# CONFIG_SENSORS_ADM1026 is not set
606# CONFIG_SENSORS_ADM1031 is not set
607# CONFIG_SENSORS_ASB100 is not set
608# CONFIG_SENSORS_DS1621 is not set
609# CONFIG_SENSORS_FSCHER is not set
610# CONFIG_SENSORS_FSCPOS is not set
611# CONFIG_SENSORS_GL518SM is not set
612# CONFIG_SENSORS_GL520SM is not set
613# CONFIG_SENSORS_IT87 is not set
614# CONFIG_SENSORS_LM63 is not set
615# CONFIG_SENSORS_LM75 is not set
616# CONFIG_SENSORS_LM77 is not set
617# CONFIG_SENSORS_LM78 is not set
618# CONFIG_SENSORS_LM80 is not set
619# CONFIG_SENSORS_LM83 is not set
620# CONFIG_SENSORS_LM85 is not set
621# CONFIG_SENSORS_LM87 is not set
622# CONFIG_SENSORS_LM90 is not set
623# CONFIG_SENSORS_MAX1619 is not set
624# CONFIG_SENSORS_PC87360 is not set
625# CONFIG_SENSORS_SMSC47B397 is not set
626# CONFIG_SENSORS_SMSC47M1 is not set
627# CONFIG_SENSORS_W83781D is not set
628# CONFIG_SENSORS_W83L785TS is not set
629# CONFIG_SENSORS_W83627HF is not set
630
631#
632# Other I2C Chip support
633#
634# CONFIG_SENSORS_EEPROM is not set
635# CONFIG_SENSORS_PCF8574 is not set
636# CONFIG_SENSORS_PCF8591 is not set
637# CONFIG_SENSORS_RTC8564 is not set
638CONFIG_ISP1301_OMAP=y
639# CONFIG_I2C_DEBUG_CORE is not set
640# CONFIG_I2C_DEBUG_ALGO is not set
641# CONFIG_I2C_DEBUG_BUS is not set
642# CONFIG_I2C_DEBUG_CHIP is not set
643
644#
645# Misc devices
646#
647
648#
649# Multimedia devices
650#
651# CONFIG_VIDEO_DEV is not set
652
653#
654# Digital Video Broadcasting Devices
655#
656# CONFIG_DVB is not set
657
658#
659# Graphics support
660#
661CONFIG_FB=y
662# CONFIG_FB_CFB_FILLRECT is not set
663# CONFIG_FB_CFB_COPYAREA is not set
664# CONFIG_FB_CFB_IMAGEBLIT is not set
665# CONFIG_FB_SOFT_CURSOR is not set
666CONFIG_FB_MODE_HELPERS=y
667# CONFIG_FB_TILEBLITTING is not set
668# CONFIG_FB_VIRTUAL is not set
669
670#
671# Console display driver support
672#
673# CONFIG_VGA_CONSOLE is not set
674CONFIG_DUMMY_CONSOLE=y
675CONFIG_FRAMEBUFFER_CONSOLE=y
676CONFIG_FONTS=y
677CONFIG_FONT_8x8=y
678CONFIG_FONT_8x16=y
679# CONFIG_FONT_6x11 is not set
680# CONFIG_FONT_PEARL_8x8 is not set
681# CONFIG_FONT_ACORN_8x8 is not set
682# CONFIG_FONT_MINI_4x6 is not set
683# CONFIG_FONT_SUN8x16 is not set
684# CONFIG_FONT_SUN12x22 is not set
685
686#
687# Logo configuration
688#
689CONFIG_LOGO=y
690# CONFIG_LOGO_LINUX_MONO is not set
691# CONFIG_LOGO_LINUX_VGA16 is not set
692CONFIG_LOGO_LINUX_CLUT224=y
693# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
694
695#
696# Sound
697#
698CONFIG_SOUND=y
699
700#
701# Advanced Linux Sound Architecture
702#
703# CONFIG_SND is not set
704
705#
706# Open Sound System
707#
708CONFIG_SOUND_PRIME=y
709# CONFIG_SOUND_BT878 is not set
710# CONFIG_SOUND_FUSION is not set
711# CONFIG_SOUND_CS4281 is not set
712# CONFIG_SOUND_SONICVIBES is not set
713# CONFIG_SOUND_TRIDENT is not set
714# CONFIG_SOUND_MSNDCLAS is not set
715# CONFIG_SOUND_MSNDPIN is not set
716# CONFIG_SOUND_OSS is not set
717# CONFIG_SOUND_TVMIXER is not set
718# CONFIG_SOUND_AD1980 is not set
719
720#
721# USB support
722#
723CONFIG_USB_ARCH_HAS_HCD=y
724CONFIG_USB_ARCH_HAS_OHCI=y
725# CONFIG_USB is not set
726
727#
728# USB Gadget Support
729#
730CONFIG_USB_GADGET=y
731# CONFIG_USB_GADGET_DEBUG_FILES is not set
732# CONFIG_USB_GADGET_NET2280 is not set
733# CONFIG_USB_GADGET_PXA2XX is not set
734# CONFIG_USB_GADGET_GOKU is not set
735# CONFIG_USB_GADGET_SA1100 is not set
736# CONFIG_USB_GADGET_LH7A40X is not set
737# CONFIG_USB_GADGET_DUMMY_HCD is not set
738CONFIG_USB_GADGET_OMAP=y
739CONFIG_USB_OMAP=y
740# CONFIG_USB_GADGET_DUALSPEED is not set
741# CONFIG_USB_ZERO is not set
742CONFIG_USB_ETH=y
743CONFIG_USB_ETH_RNDIS=y
744# CONFIG_USB_GADGETFS is not set
745# CONFIG_USB_FILE_STORAGE is not set
746# CONFIG_USB_G_SERIAL is not set
747
748#
749# MMC/SD Card support
750#
751# CONFIG_MMC is not set
752
753#
754# File systems
755#
756CONFIG_EXT2_FS=y
757# CONFIG_EXT2_FS_XATTR is not set
758# CONFIG_EXT3_FS is not set
759# CONFIG_JBD is not set
760# CONFIG_REISERFS_FS is not set
761# CONFIG_JFS_FS is not set
762
763#
764# XFS support
765#
766# CONFIG_XFS_FS is not set
767# CONFIG_MINIX_FS is not set
768CONFIG_ROMFS_FS=y
769# CONFIG_QUOTA is not set
770CONFIG_DNOTIFY=y
771# CONFIG_AUTOFS_FS is not set
772# CONFIG_AUTOFS4_FS is not set
773
774#
775# CD-ROM/DVD Filesystems
776#
777# CONFIG_ISO9660_FS is not set
778# CONFIG_UDF_FS is not set
779
780#
781# DOS/FAT/NT Filesystems
782#
783CONFIG_FAT_FS=y
784CONFIG_MSDOS_FS=y
785# CONFIG_VFAT_FS is not set
786CONFIG_FAT_DEFAULT_CODEPAGE=437
787# CONFIG_NTFS_FS is not set
788
789#
790# Pseudo filesystems
791#
792CONFIG_PROC_FS=y
793CONFIG_SYSFS=y
794# CONFIG_DEVFS_FS is not set
795# CONFIG_DEVPTS_FS_XATTR is not set
796# CONFIG_TMPFS is not set
797# CONFIG_HUGETLB_PAGE is not set
798CONFIG_RAMFS=y
799
800#
801# Miscellaneous filesystems
802#
803# CONFIG_ADFS_FS is not set
804# CONFIG_AFFS_FS is not set
805# CONFIG_HFS_FS is not set
806# CONFIG_HFSPLUS_FS is not set
807# CONFIG_BEFS_FS is not set
808# CONFIG_BFS_FS is not set
809# CONFIG_EFS_FS is not set
810# CONFIG_JFFS_FS is not set
811CONFIG_JFFS2_FS=y
812CONFIG_JFFS2_FS_DEBUG=2
813# CONFIG_JFFS2_FS_NAND is not set
814# CONFIG_JFFS2_FS_NOR_ECC is not set
815# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
816CONFIG_JFFS2_ZLIB=y
817CONFIG_JFFS2_RTIME=y
818# CONFIG_JFFS2_RUBIN is not set
819CONFIG_CRAMFS=y
820# CONFIG_VXFS_FS is not set
821# CONFIG_HPFS_FS is not set
822# CONFIG_QNX4FS_FS is not set
823# CONFIG_SYSV_FS is not set
824# CONFIG_UFS_FS is not set
825
826#
827# Network File Systems
828#
829CONFIG_NFS_FS=y
830CONFIG_NFS_V3=y
831CONFIG_NFS_V4=y
832# CONFIG_NFS_DIRECTIO is not set
833# CONFIG_NFSD is not set
834CONFIG_ROOT_NFS=y
835CONFIG_LOCKD=y
836CONFIG_LOCKD_V4=y
837CONFIG_SUNRPC=y
838CONFIG_SUNRPC_GSS=y
839CONFIG_RPCSEC_GSS_KRB5=y
840# CONFIG_RPCSEC_GSS_SPKM3 is not set
841# CONFIG_SMB_FS is not set
842# CONFIG_CIFS is not set
843# CONFIG_NCP_FS is not set
844# CONFIG_CODA_FS is not set
845# CONFIG_AFS_FS is not set
846
847#
848# Partition Types
849#
850# CONFIG_PARTITION_ADVANCED is not set
851CONFIG_MSDOS_PARTITION=y
852
853#
854# Native Language Support
855#
856CONFIG_NLS=y
857CONFIG_NLS_DEFAULT="iso8859-1"
858# CONFIG_NLS_CODEPAGE_437 is not set
859# CONFIG_NLS_CODEPAGE_737 is not set
860# CONFIG_NLS_CODEPAGE_775 is not set
861# CONFIG_NLS_CODEPAGE_850 is not set
862# CONFIG_NLS_CODEPAGE_852 is not set
863# CONFIG_NLS_CODEPAGE_855 is not set
864# CONFIG_NLS_CODEPAGE_857 is not set
865# CONFIG_NLS_CODEPAGE_860 is not set
866# CONFIG_NLS_CODEPAGE_861 is not set
867# CONFIG_NLS_CODEPAGE_862 is not set
868# CONFIG_NLS_CODEPAGE_863 is not set
869# CONFIG_NLS_CODEPAGE_864 is not set
870# CONFIG_NLS_CODEPAGE_865 is not set
871# CONFIG_NLS_CODEPAGE_866 is not set
872# CONFIG_NLS_CODEPAGE_869 is not set
873# CONFIG_NLS_CODEPAGE_936 is not set
874# CONFIG_NLS_CODEPAGE_950 is not set
875# CONFIG_NLS_CODEPAGE_932 is not set
876# CONFIG_NLS_CODEPAGE_949 is not set
877# CONFIG_NLS_CODEPAGE_874 is not set
878# CONFIG_NLS_ISO8859_8 is not set
879# CONFIG_NLS_CODEPAGE_1250 is not set
880# CONFIG_NLS_CODEPAGE_1251 is not set
881# CONFIG_NLS_ASCII is not set
882# CONFIG_NLS_ISO8859_1 is not set
883# CONFIG_NLS_ISO8859_2 is not set
884# CONFIG_NLS_ISO8859_3 is not set
885# CONFIG_NLS_ISO8859_4 is not set
886# CONFIG_NLS_ISO8859_5 is not set
887# CONFIG_NLS_ISO8859_6 is not set
888# CONFIG_NLS_ISO8859_7 is not set
889# CONFIG_NLS_ISO8859_9 is not set
890# CONFIG_NLS_ISO8859_13 is not set
891# CONFIG_NLS_ISO8859_14 is not set
892# CONFIG_NLS_ISO8859_15 is not set
893# CONFIG_NLS_KOI8_R is not set
894# CONFIG_NLS_KOI8_U is not set
895# CONFIG_NLS_UTF8 is not set
896
897#
898# Profiling support
899#
900# CONFIG_PROFILING is not set
901
902#
903# Kernel hacking
904#
905# CONFIG_PRINTK_TIME is not set
906CONFIG_DEBUG_KERNEL=y
907# CONFIG_MAGIC_SYSRQ is not set
908CONFIG_LOG_BUF_SHIFT=14
909# CONFIG_SCHEDSTATS is not set
910# CONFIG_DEBUG_SLAB is not set
911CONFIG_DEBUG_PREEMPT=y
912# CONFIG_DEBUG_SPINLOCK is not set
913# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
914# CONFIG_DEBUG_KOBJECT is not set
915CONFIG_DEBUG_BUGVERBOSE=y
916CONFIG_DEBUG_INFO=y
917# CONFIG_DEBUG_FS is not set
918CONFIG_FRAME_POINTER=y
919CONFIG_DEBUG_USER=y
920# CONFIG_DEBUG_WAITQ is not set
921CONFIG_DEBUG_ERRORS=y
922CONFIG_DEBUG_LL=y
923# CONFIG_DEBUG_ICEDCC is not set
924
925#
926# Security options
927#
928# CONFIG_KEYS is not set
929# CONFIG_SECURITY is not set
930
931#
932# Cryptographic options
933#
934CONFIG_CRYPTO=y
935# CONFIG_CRYPTO_HMAC is not set
936# CONFIG_CRYPTO_NULL is not set
937# CONFIG_CRYPTO_MD4 is not set
938CONFIG_CRYPTO_MD5=y
939# CONFIG_CRYPTO_SHA1 is not set
940# CONFIG_CRYPTO_SHA256 is not set
941# CONFIG_CRYPTO_SHA512 is not set
942# CONFIG_CRYPTO_WP512 is not set
943# CONFIG_CRYPTO_TGR192 is not set
944CONFIG_CRYPTO_DES=y
945# CONFIG_CRYPTO_BLOWFISH is not set
946# CONFIG_CRYPTO_TWOFISH is not set
947# CONFIG_CRYPTO_SERPENT is not set
948# CONFIG_CRYPTO_AES is not set
949# CONFIG_CRYPTO_CAST5 is not set
950# CONFIG_CRYPTO_CAST6 is not set
951# CONFIG_CRYPTO_TEA is not set
952# CONFIG_CRYPTO_ARC4 is not set
953# CONFIG_CRYPTO_KHAZAD is not set
954# CONFIG_CRYPTO_ANUBIS is not set
955# CONFIG_CRYPTO_DEFLATE is not set
956# CONFIG_CRYPTO_MICHAEL_MIC is not set
957# CONFIG_CRYPTO_CRC32C is not set
958# CONFIG_CRYPTO_TEST is not set
959
960#
961# Hardware crypto devices
962#
963
964#
965# Library routines
966#
967# CONFIG_CRC_CCITT is not set
968CONFIG_CRC32=y
969# CONFIG_LIBCRC32C is not set
970CONFIG_ZLIB_INFLATE=y
971CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/omnimeter_defconfig b/arch/arm/configs/omnimeter_defconfig
new file mode 100644
index 000000000000..78fdb4a428b1
--- /dev/null
+++ b/arch/arm/configs/omnimeter_defconfig
@@ -0,0 +1,803 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 21:31:45 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51CONFIG_MODULES=y
52# CONFIG_MODULE_UNLOAD is not set
53CONFIG_OBSOLETE_MODPARM=y
54# CONFIG_MODVERSIONS is not set
55# CONFIG_MODULE_SRCVERSION_ALL is not set
56CONFIG_KMOD=y
57
58#
59# System Type
60#
61# CONFIG_ARCH_CLPS7500 is not set
62# CONFIG_ARCH_CLPS711X is not set
63# CONFIG_ARCH_CO285 is not set
64# CONFIG_ARCH_EBSA110 is not set
65# CONFIG_ARCH_CAMELOT is not set
66# CONFIG_ARCH_FOOTBRIDGE is not set
67# CONFIG_ARCH_INTEGRATOR is not set
68# CONFIG_ARCH_IOP3XX is not set
69# CONFIG_ARCH_IXP4XX is not set
70# CONFIG_ARCH_IXP2000 is not set
71# CONFIG_ARCH_L7200 is not set
72# CONFIG_ARCH_PXA is not set
73# CONFIG_ARCH_RPC is not set
74CONFIG_ARCH_SA1100=y
75# CONFIG_ARCH_S3C2410 is not set
76# CONFIG_ARCH_SHARK is not set
77# CONFIG_ARCH_LH7A40X is not set
78# CONFIG_ARCH_OMAP is not set
79# CONFIG_ARCH_VERSATILE is not set
80# CONFIG_ARCH_IMX is not set
81# CONFIG_ARCH_H720X is not set
82
83#
84# SA11x0 Implementations
85#
86# CONFIG_SA1100_ASSABET is not set
87# CONFIG_SA1100_CERF is not set
88# CONFIG_SA1100_COLLIE is not set
89# CONFIG_SA1100_H3100 is not set
90# CONFIG_SA1100_H3600 is not set
91# CONFIG_SA1100_H3800 is not set
92# CONFIG_SA1100_BADGE4 is not set
93# CONFIG_SA1100_JORNADA720 is not set
94# CONFIG_SA1100_HACKKIT is not set
95# CONFIG_SA1100_LART is not set
96# CONFIG_SA1100_PLEB is not set
97# CONFIG_SA1100_SHANNON is not set
98# CONFIG_SA1100_SIMPAD is not set
99# CONFIG_SA1100_SSP is not set
100
101#
102# Processor Type
103#
104CONFIG_CPU_32=y
105CONFIG_CPU_SA1100=y
106CONFIG_CPU_32v4=y
107CONFIG_CPU_ABRT_EV4=y
108CONFIG_CPU_CACHE_V4WB=y
109CONFIG_CPU_CACHE_VIVT=y
110CONFIG_CPU_TLB_V4WB=y
111CONFIG_CPU_MINICACHE=y
112
113#
114# Processor Features
115#
116
117#
118# Bus support
119#
120CONFIG_ISA=y
121
122#
123# PCCARD (PCMCIA/CardBus) support
124#
125CONFIG_PCCARD=y
126# CONFIG_PCMCIA_DEBUG is not set
127CONFIG_PCMCIA=y
128
129#
130# PC-card bridges
131#
132CONFIG_I82365=y
133# CONFIG_TCIC is not set
134CONFIG_PCMCIA_SA1100=y
135CONFIG_PCCARD_NONSTATIC=y
136
137#
138# Kernel Features
139#
140# CONFIG_PREEMPT is not set
141CONFIG_DISCONTIGMEM=y
142# CONFIG_LEDS is not set
143CONFIG_ALIGNMENT_TRAP=y
144
145#
146# Boot options
147#
148CONFIG_ZBOOT_ROM_TEXT=0x0
149CONFIG_ZBOOT_ROM_BSS=0x0
150CONFIG_CMDLINE="keepinitrd mem=16M root=/dev/ram ramdisk=8192 initrd=0xd0000000,4M"
151# CONFIG_XIP_KERNEL is not set
152
153#
154# CPU Frequency scaling
155#
156# CONFIG_CPU_FREQ is not set
157
158#
159# Floating point emulation
160#
161
162#
163# At least one emulation must be selected
164#
165# CONFIG_FPE_NWFPE is not set
166# CONFIG_FPE_FASTFPE is not set
167
168#
169# Userspace binary formats
170#
171CONFIG_BINFMT_ELF=y
172CONFIG_BINFMT_AOUT=y
173# CONFIG_BINFMT_MISC is not set
174# CONFIG_ARTHUR is not set
175
176#
177# Power management options
178#
179# CONFIG_PM is not set
180
181#
182# Device Drivers
183#
184
185#
186# Generic Driver Options
187#
188CONFIG_STANDALONE=y
189CONFIG_PREVENT_FIRMWARE_BUILD=y
190# CONFIG_FW_LOADER is not set
191
192#
193# Memory Technology Devices (MTD)
194#
195# CONFIG_MTD is not set
196
197#
198# Parallel port support
199#
200# CONFIG_PARPORT is not set
201
202#
203# Plug and Play support
204#
205# CONFIG_PNP is not set
206
207#
208# Block devices
209#
210# CONFIG_BLK_DEV_FD is not set
211# CONFIG_BLK_DEV_XD is not set
212# CONFIG_BLK_DEV_COW_COMMON is not set
213CONFIG_BLK_DEV_LOOP=m
214# CONFIG_BLK_DEV_CRYPTOLOOP is not set
215CONFIG_BLK_DEV_NBD=m
216# CONFIG_BLK_DEV_RAM is not set
217CONFIG_BLK_DEV_RAM_COUNT=16
218CONFIG_INITRAMFS_SOURCE=""
219# CONFIG_CDROM_PKTCDVD is not set
220
221#
222# IO Schedulers
223#
224CONFIG_IOSCHED_NOOP=y
225CONFIG_IOSCHED_AS=y
226CONFIG_IOSCHED_DEADLINE=y
227CONFIG_IOSCHED_CFQ=y
228# CONFIG_ATA_OVER_ETH is not set
229
230#
231# ATA/ATAPI/MFM/RLL support
232#
233CONFIG_IDE=y
234CONFIG_BLK_DEV_IDE=y
235
236#
237# Please see Documentation/ide.txt for help/info on IDE drives
238#
239# CONFIG_BLK_DEV_IDE_SATA is not set
240CONFIG_BLK_DEV_IDEDISK=y
241# CONFIG_IDEDISK_MULTI_MODE is not set
242# CONFIG_BLK_DEV_IDECS is not set
243# CONFIG_BLK_DEV_IDECD is not set
244# CONFIG_BLK_DEV_IDETAPE is not set
245# CONFIG_BLK_DEV_IDEFLOPPY is not set
246# CONFIG_IDE_TASK_IOCTL is not set
247
248#
249# IDE chipset support/bugfixes
250#
251CONFIG_IDE_GENERIC=y
252# CONFIG_IDE_ARM is not set
253# CONFIG_IDE_CHIPSETS is not set
254# CONFIG_BLK_DEV_IDEDMA is not set
255# CONFIG_IDEDMA_AUTO is not set
256# CONFIG_BLK_DEV_HD is not set
257
258#
259# SCSI device support
260#
261# CONFIG_SCSI is not set
262
263#
264# Multi-device support (RAID and LVM)
265#
266# CONFIG_MD is not set
267
268#
269# Fusion MPT device support
270#
271
272#
273# IEEE 1394 (FireWire) support
274#
275
276#
277# I2O device support
278#
279
280#
281# Networking support
282#
283CONFIG_NET=y
284
285#
286# Networking options
287#
288CONFIG_PACKET=y
289CONFIG_PACKET_MMAP=y
290# CONFIG_NETLINK_DEV is not set
291CONFIG_UNIX=y
292# CONFIG_NET_KEY is not set
293CONFIG_INET=y
294CONFIG_IP_MULTICAST=y
295# CONFIG_IP_ADVANCED_ROUTER is not set
296# CONFIG_IP_PNP is not set
297# CONFIG_NET_IPIP is not set
298# CONFIG_NET_IPGRE is not set
299# CONFIG_IP_MROUTE is not set
300# CONFIG_ARPD is not set
301# CONFIG_SYN_COOKIES is not set
302# CONFIG_INET_AH is not set
303# CONFIG_INET_ESP is not set
304# CONFIG_INET_IPCOMP is not set
305# CONFIG_INET_TUNNEL is not set
306CONFIG_IP_TCPDIAG=y
307# CONFIG_IP_TCPDIAG_IPV6 is not set
308
309#
310# IP: Virtual Server Configuration
311#
312# CONFIG_IP_VS is not set
313# CONFIG_IPV6 is not set
314CONFIG_NETFILTER=y
315# CONFIG_NETFILTER_DEBUG is not set
316
317#
318# IP: Netfilter Configuration
319#
320# CONFIG_IP_NF_CONNTRACK is not set
321# CONFIG_IP_NF_CONNTRACK_MARK is not set
322# CONFIG_IP_NF_QUEUE is not set
323# CONFIG_IP_NF_IPTABLES is not set
324# CONFIG_IP_NF_ARPTABLES is not set
325
326#
327# SCTP Configuration (EXPERIMENTAL)
328#
329# CONFIG_IP_SCTP is not set
330# CONFIG_ATM is not set
331# CONFIG_BRIDGE is not set
332# CONFIG_VLAN_8021Q is not set
333# CONFIG_DECNET is not set
334# CONFIG_LLC2 is not set
335# CONFIG_IPX is not set
336# CONFIG_ATALK is not set
337# CONFIG_X25 is not set
338# CONFIG_LAPB is not set
339# CONFIG_NET_DIVERT is not set
340# CONFIG_ECONET is not set
341# CONFIG_WAN_ROUTER is not set
342
343#
344# QoS and/or fair queueing
345#
346# CONFIG_NET_SCHED is not set
347# CONFIG_NET_CLS_ROUTE is not set
348
349#
350# Network testing
351#
352# CONFIG_NET_PKTGEN is not set
353# CONFIG_NETPOLL is not set
354# CONFIG_NET_POLL_CONTROLLER is not set
355# CONFIG_HAMRADIO is not set
356# CONFIG_IRDA is not set
357# CONFIG_BT is not set
358CONFIG_NETDEVICES=y
359# CONFIG_DUMMY is not set
360# CONFIG_BONDING is not set
361# CONFIG_EQUALIZER is not set
362# CONFIG_TUN is not set
363
364#
365# ARCnet devices
366#
367# CONFIG_ARCNET is not set
368
369#
370# Ethernet (10 or 100Mbit)
371#
372CONFIG_NET_ETHERNET=y
373# CONFIG_MII is not set
374# CONFIG_NET_VENDOR_3COM is not set
375# CONFIG_LANCE is not set
376# CONFIG_NET_VENDOR_SMC is not set
377# CONFIG_SMC91X is not set
378# CONFIG_NET_VENDOR_RACAL is not set
379# CONFIG_AT1700 is not set
380# CONFIG_DEPCA is not set
381# CONFIG_HP100 is not set
382# CONFIG_NET_ISA is not set
383# CONFIG_NET_PCI is not set
384# CONFIG_NET_POCKET is not set
385
386#
387# Ethernet (1000 Mbit)
388#
389
390#
391# Ethernet (10000 Mbit)
392#
393
394#
395# Token Ring devices
396#
397# CONFIG_TR is not set
398
399#
400# Wireless LAN (non-hamradio)
401#
402CONFIG_NET_RADIO=y
403
404#
405# Obsolete Wireless cards support (pre-802.11)
406#
407# CONFIG_STRIP is not set
408# CONFIG_ARLAN is not set
409# CONFIG_WAVELAN is not set
410CONFIG_PCMCIA_WAVELAN=y
411# CONFIG_PCMCIA_NETWAVE is not set
412
413#
414# Wireless 802.11 Frequency Hopping cards support
415#
416# CONFIG_PCMCIA_RAYCS is not set
417
418#
419# Wireless 802.11b ISA/PCI cards support
420#
421# CONFIG_HERMES is not set
422# CONFIG_ATMEL is not set
423
424#
425# Wireless 802.11b Pcmcia/Cardbus cards support
426#
427CONFIG_AIRO_CS=y
428CONFIG_PCMCIA_WL3501=y
429CONFIG_NET_WIRELESS=y
430
431#
432# PCMCIA network device support
433#
434CONFIG_NET_PCMCIA=y
435CONFIG_PCMCIA_3C589=y
436# CONFIG_PCMCIA_3C574 is not set
437# CONFIG_PCMCIA_FMVJ18X is not set
438CONFIG_PCMCIA_PCNET=y
439# CONFIG_PCMCIA_NMCLAN is not set
440# CONFIG_PCMCIA_SMC91C92 is not set
441# CONFIG_PCMCIA_XIRC2PS is not set
442# CONFIG_PCMCIA_AXNET is not set
443
444#
445# Wan interfaces
446#
447# CONFIG_WAN is not set
448# CONFIG_PPP is not set
449# CONFIG_SLIP is not set
450# CONFIG_SHAPER is not set
451# CONFIG_NETCONSOLE is not set
452
453#
454# ISDN subsystem
455#
456# CONFIG_ISDN is not set
457
458#
459# Input device support
460#
461CONFIG_INPUT=y
462
463#
464# Userland interfaces
465#
466CONFIG_INPUT_MOUSEDEV=y
467CONFIG_INPUT_MOUSEDEV_PSAUX=y
468CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
469CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
470# CONFIG_INPUT_JOYDEV is not set
471# CONFIG_INPUT_TSDEV is not set
472# CONFIG_INPUT_EVDEV is not set
473# CONFIG_INPUT_EVBUG is not set
474
475#
476# Input Device Drivers
477#
478CONFIG_INPUT_KEYBOARD=y
479CONFIG_KEYBOARD_ATKBD=y
480# CONFIG_KEYBOARD_SUNKBD is not set
481# CONFIG_KEYBOARD_LKKBD is not set
482# CONFIG_KEYBOARD_XTKBD is not set
483# CONFIG_KEYBOARD_NEWTON is not set
484CONFIG_INPUT_MOUSE=y
485CONFIG_MOUSE_PS2=y
486# CONFIG_MOUSE_SERIAL is not set
487# CONFIG_MOUSE_INPORT is not set
488# CONFIG_MOUSE_LOGIBM is not set
489# CONFIG_MOUSE_PC110PAD is not set
490# CONFIG_MOUSE_VSXXXAA is not set
491# CONFIG_INPUT_JOYSTICK is not set
492# CONFIG_INPUT_TOUCHSCREEN is not set
493# CONFIG_INPUT_MISC is not set
494
495#
496# Hardware I/O ports
497#
498CONFIG_SERIO=y
499CONFIG_SERIO_SERPORT=y
500CONFIG_SERIO_LIBPS2=y
501# CONFIG_SERIO_RAW is not set
502# CONFIG_GAMEPORT is not set
503CONFIG_SOUND_GAMEPORT=y
504
505#
506# Character devices
507#
508CONFIG_VT=y
509CONFIG_VT_CONSOLE=y
510CONFIG_HW_CONSOLE=y
511# CONFIG_SERIAL_NONSTANDARD is not set
512
513#
514# Serial drivers
515#
516# CONFIG_SERIAL_8250 is not set
517
518#
519# Non-8250 serial port support
520#
521CONFIG_SERIAL_SA1100=y
522CONFIG_SERIAL_SA1100_CONSOLE=y
523CONFIG_SERIAL_CORE=y
524CONFIG_SERIAL_CORE_CONSOLE=y
525CONFIG_UNIX98_PTYS=y
526CONFIG_LEGACY_PTYS=y
527CONFIG_LEGACY_PTY_COUNT=256
528
529#
530# IPMI
531#
532# CONFIG_IPMI_HANDLER is not set
533
534#
535# Watchdog Cards
536#
537# CONFIG_WATCHDOG is not set
538# CONFIG_NVRAM is not set
539# CONFIG_RTC is not set
540# CONFIG_DTLK is not set
541# CONFIG_R3964 is not set
542
543#
544# Ftape, the floppy tape device driver
545#
546# CONFIG_DRM is not set
547
548#
549# PCMCIA character devices
550#
551# CONFIG_SYNCLINK_CS is not set
552# CONFIG_RAW_DRIVER is not set
553
554#
555# TPM devices
556#
557# CONFIG_TCG_TPM is not set
558
559#
560# I2C support
561#
562# CONFIG_I2C is not set
563
564#
565# Misc devices
566#
567
568#
569# Multimedia devices
570#
571# CONFIG_VIDEO_DEV is not set
572
573#
574# Digital Video Broadcasting Devices
575#
576# CONFIG_DVB is not set
577
578#
579# Graphics support
580#
581CONFIG_FB=y
582CONFIG_FB_CFB_FILLRECT=y
583CONFIG_FB_CFB_COPYAREA=y
584CONFIG_FB_CFB_IMAGEBLIT=y
585CONFIG_FB_SOFT_CURSOR=y
586# CONFIG_FB_MODE_HELPERS is not set
587# CONFIG_FB_TILEBLITTING is not set
588CONFIG_FB_SA1100=y
589# CONFIG_FB_VIRTUAL is not set
590
591#
592# Console display driver support
593#
594# CONFIG_VGA_CONSOLE is not set
595# CONFIG_MDA_CONSOLE is not set
596CONFIG_DUMMY_CONSOLE=y
597CONFIG_FRAMEBUFFER_CONSOLE=y
598CONFIG_FONTS=y
599CONFIG_FONT_8x8=y
600# CONFIG_FONT_8x16 is not set
601# CONFIG_FONT_6x11 is not set
602# CONFIG_FONT_PEARL_8x8 is not set
603# CONFIG_FONT_ACORN_8x8 is not set
604# CONFIG_FONT_MINI_4x6 is not set
605# CONFIG_FONT_SUN8x16 is not set
606# CONFIG_FONT_SUN12x22 is not set
607
608#
609# Logo configuration
610#
611# CONFIG_LOGO is not set
612# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
613
614#
615# Sound
616#
617# CONFIG_SOUND is not set
618
619#
620# USB support
621#
622CONFIG_USB_ARCH_HAS_HCD=y
623# CONFIG_USB_ARCH_HAS_OHCI is not set
624# CONFIG_USB is not set
625
626#
627# USB Gadget Support
628#
629# CONFIG_USB_GADGET is not set
630
631#
632# MMC/SD Card support
633#
634# CONFIG_MMC is not set
635
636#
637# File systems
638#
639CONFIG_EXT2_FS=y
640# CONFIG_EXT2_FS_XATTR is not set
641# CONFIG_EXT3_FS is not set
642# CONFIG_JBD is not set
643# CONFIG_REISERFS_FS is not set
644# CONFIG_JFS_FS is not set
645
646#
647# XFS support
648#
649# CONFIG_XFS_FS is not set
650# CONFIG_MINIX_FS is not set
651# CONFIG_ROMFS_FS is not set
652# CONFIG_QUOTA is not set
653CONFIG_DNOTIFY=y
654# CONFIG_AUTOFS_FS is not set
655# CONFIG_AUTOFS4_FS is not set
656
657#
658# CD-ROM/DVD Filesystems
659#
660# CONFIG_ISO9660_FS is not set
661# CONFIG_UDF_FS is not set
662
663#
664# DOS/FAT/NT Filesystems
665#
666CONFIG_FAT_FS=y
667CONFIG_MSDOS_FS=y
668# CONFIG_VFAT_FS is not set
669CONFIG_FAT_DEFAULT_CODEPAGE=437
670# CONFIG_NTFS_FS is not set
671
672#
673# Pseudo filesystems
674#
675CONFIG_PROC_FS=y
676CONFIG_SYSFS=y
677# CONFIG_DEVFS_FS is not set
678# CONFIG_DEVPTS_FS_XATTR is not set
679# CONFIG_TMPFS is not set
680# CONFIG_HUGETLB_PAGE is not set
681CONFIG_RAMFS=y
682
683#
684# Miscellaneous filesystems
685#
686# CONFIG_ADFS_FS is not set
687# CONFIG_AFFS_FS is not set
688# CONFIG_HFS_FS is not set
689# CONFIG_HFSPLUS_FS is not set
690# CONFIG_BEFS_FS is not set
691# CONFIG_BFS_FS is not set
692# CONFIG_EFS_FS is not set
693# CONFIG_CRAMFS is not set
694# CONFIG_VXFS_FS is not set
695# CONFIG_HPFS_FS is not set
696# CONFIG_QNX4FS_FS is not set
697# CONFIG_SYSV_FS is not set
698# CONFIG_UFS_FS is not set
699
700#
701# Network File Systems
702#
703CONFIG_NFS_FS=y
704# CONFIG_NFS_V3 is not set
705# CONFIG_NFS_V4 is not set
706# CONFIG_NFS_DIRECTIO is not set
707# CONFIG_NFSD is not set
708CONFIG_LOCKD=y
709CONFIG_SUNRPC=y
710# CONFIG_RPCSEC_GSS_KRB5 is not set
711# CONFIG_RPCSEC_GSS_SPKM3 is not set
712# CONFIG_SMB_FS is not set
713# CONFIG_CIFS is not set
714# CONFIG_NCP_FS is not set
715# CONFIG_CODA_FS is not set
716# CONFIG_AFS_FS is not set
717
718#
719# Partition Types
720#
721# CONFIG_PARTITION_ADVANCED is not set
722CONFIG_MSDOS_PARTITION=y
723
724#
725# Native Language Support
726#
727CONFIG_NLS=y
728CONFIG_NLS_DEFAULT="iso8859-1"
729# CONFIG_NLS_CODEPAGE_437 is not set
730# CONFIG_NLS_CODEPAGE_737 is not set
731# CONFIG_NLS_CODEPAGE_775 is not set
732# CONFIG_NLS_CODEPAGE_850 is not set
733# CONFIG_NLS_CODEPAGE_852 is not set
734# CONFIG_NLS_CODEPAGE_855 is not set
735# CONFIG_NLS_CODEPAGE_857 is not set
736# CONFIG_NLS_CODEPAGE_860 is not set
737# CONFIG_NLS_CODEPAGE_861 is not set
738# CONFIG_NLS_CODEPAGE_862 is not set
739# CONFIG_NLS_CODEPAGE_863 is not set
740# CONFIG_NLS_CODEPAGE_864 is not set
741# CONFIG_NLS_CODEPAGE_865 is not set
742# CONFIG_NLS_CODEPAGE_866 is not set
743# CONFIG_NLS_CODEPAGE_869 is not set
744# CONFIG_NLS_CODEPAGE_936 is not set
745# CONFIG_NLS_CODEPAGE_950 is not set
746# CONFIG_NLS_CODEPAGE_932 is not set
747# CONFIG_NLS_CODEPAGE_949 is not set
748# CONFIG_NLS_CODEPAGE_874 is not set
749# CONFIG_NLS_ISO8859_8 is not set
750# CONFIG_NLS_CODEPAGE_1250 is not set
751# CONFIG_NLS_CODEPAGE_1251 is not set
752# CONFIG_NLS_ASCII is not set
753# CONFIG_NLS_ISO8859_1 is not set
754# CONFIG_NLS_ISO8859_2 is not set
755# CONFIG_NLS_ISO8859_3 is not set
756# CONFIG_NLS_ISO8859_4 is not set
757# CONFIG_NLS_ISO8859_5 is not set
758# CONFIG_NLS_ISO8859_6 is not set
759# CONFIG_NLS_ISO8859_7 is not set
760# CONFIG_NLS_ISO8859_9 is not set
761# CONFIG_NLS_ISO8859_13 is not set
762# CONFIG_NLS_ISO8859_14 is not set
763# CONFIG_NLS_ISO8859_15 is not set
764# CONFIG_NLS_KOI8_R is not set
765# CONFIG_NLS_KOI8_U is not set
766# CONFIG_NLS_UTF8 is not set
767
768#
769# Profiling support
770#
771# CONFIG_PROFILING is not set
772
773#
774# Kernel hacking
775#
776# CONFIG_PRINTK_TIME is not set
777# CONFIG_DEBUG_KERNEL is not set
778CONFIG_LOG_BUF_SHIFT=14
779CONFIG_DEBUG_BUGVERBOSE=y
780CONFIG_FRAME_POINTER=y
781# CONFIG_DEBUG_USER is not set
782
783#
784# Security options
785#
786# CONFIG_KEYS is not set
787# CONFIG_SECURITY is not set
788
789#
790# Cryptographic options
791#
792# CONFIG_CRYPTO is not set
793
794#
795# Hardware crypto devices
796#
797
798#
799# Library routines
800#
801# CONFIG_CRC_CCITT is not set
802CONFIG_CRC32=y
803# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/configs/pleb_defconfig b/arch/arm/configs/pleb_defconfig
new file mode 100644
index 000000000000..10fec890578d
--- /dev/null
+++ b/arch/arm/configs/pleb_defconfig
@@ -0,0 +1,749 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 22:03:02 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24# CONFIG_SWAP is not set
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31# CONFIG_KOBJECT_UEVENT is not set
32# CONFIG_IKCONFIG is not set
33CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_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# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66# CONFIG_ARCH_CAMELOT is not set
67# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73# CONFIG_ARCH_PXA is not set
74# CONFIG_ARCH_RPC is not set
75CONFIG_ARCH_SA1100=y
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81# CONFIG_ARCH_IMX is not set
82# CONFIG_ARCH_H720X is not set
83
84#
85# SA11x0 Implementations
86#
87# CONFIG_SA1100_ASSABET is not set
88# CONFIG_SA1100_CERF is not set
89# CONFIG_SA1100_COLLIE is not set
90# CONFIG_SA1100_H3100 is not set
91# CONFIG_SA1100_H3600 is not set
92# CONFIG_SA1100_H3800 is not set
93# CONFIG_SA1100_BADGE4 is not set
94# CONFIG_SA1100_JORNADA720 is not set
95# CONFIG_SA1100_HACKKIT is not set
96# CONFIG_SA1100_LART is not set
97CONFIG_SA1100_PLEB=y
98# CONFIG_SA1100_SHANNON is not set
99# CONFIG_SA1100_SIMPAD is not set
100# CONFIG_SA1100_SSP is not set
101
102#
103# Processor Type
104#
105CONFIG_CPU_32=y
106CONFIG_CPU_SA1100=y
107CONFIG_CPU_32v4=y
108CONFIG_CPU_ABRT_EV4=y
109CONFIG_CPU_CACHE_V4WB=y
110CONFIG_CPU_CACHE_VIVT=y
111CONFIG_CPU_TLB_V4WB=y
112CONFIG_CPU_MINICACHE=y
113
114#
115# Processor Features
116#
117
118#
119# Bus support
120#
121CONFIG_ISA=y
122
123#
124# PCCARD (PCMCIA/CardBus) support
125#
126# CONFIG_PCCARD is not set
127
128#
129# Kernel Features
130#
131# CONFIG_PREEMPT is not set
132CONFIG_DISCONTIGMEM=y
133# CONFIG_LEDS is not set
134CONFIG_ALIGNMENT_TRAP=y
135
136#
137# Boot options
138#
139CONFIG_ZBOOT_ROM_TEXT=0x0
140CONFIG_ZBOOT_ROM_BSS=0x0
141CONFIG_CMDLINE="console=ttySA0,9600 mem=16M@0xc0000000 mem=16M@0xc8000000 root=/dev/ram initrd=0xc0400000,4M"
142# CONFIG_XIP_KERNEL is not set
143
144#
145# CPU Frequency scaling
146#
147CONFIG_CPU_FREQ=y
148CONFIG_CPU_FREQ_TABLE=y
149# CONFIG_CPU_FREQ_DEBUG is not set
150CONFIG_CPU_FREQ_STAT=y
151# CONFIG_CPU_FREQ_STAT_DETAILS is not set
152CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
153# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
154CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
155# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
156# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
157CONFIG_CPU_FREQ_GOV_ONDEMAND=y
158CONFIG_CPU_FREQ_SA1100=y
159
160#
161# Floating point emulation
162#
163
164#
165# At least one emulation must be selected
166#
167CONFIG_FPE_NWFPE=y
168# CONFIG_FPE_NWFPE_XP is not set
169# CONFIG_FPE_FASTFPE is not set
170
171#
172# Userspace binary formats
173#
174CONFIG_BINFMT_ELF=y
175# CONFIG_BINFMT_AOUT is not set
176# CONFIG_BINFMT_MISC is not set
177# CONFIG_ARTHUR is not set
178
179#
180# Power management options
181#
182# CONFIG_PM is not set
183
184#
185# Device Drivers
186#
187
188#
189# Generic Driver Options
190#
191CONFIG_STANDALONE=y
192CONFIG_PREVENT_FIRMWARE_BUILD=y
193# CONFIG_FW_LOADER is not set
194# CONFIG_DEBUG_DRIVER is not set
195
196#
197# Memory Technology Devices (MTD)
198#
199CONFIG_MTD=y
200# CONFIG_MTD_DEBUG is not set
201# CONFIG_MTD_CONCAT is not set
202CONFIG_MTD_PARTITIONS=y
203CONFIG_MTD_REDBOOT_PARTS=y
204CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
205CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
206# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
207CONFIG_MTD_CMDLINE_PARTS=y
208# CONFIG_MTD_AFS_PARTS is not set
209
210#
211# User Modules And Translation Layers
212#
213CONFIG_MTD_CHAR=y
214CONFIG_MTD_BLOCK=y
215# CONFIG_FTL is not set
216# CONFIG_NFTL is not set
217# CONFIG_INFTL is not set
218
219#
220# RAM/ROM/Flash chip drivers
221#
222CONFIG_MTD_CFI=y
223# CONFIG_MTD_JEDECPROBE is not set
224CONFIG_MTD_GEN_PROBE=y
225# CONFIG_MTD_CFI_ADV_OPTIONS is not set
226CONFIG_MTD_MAP_BANK_WIDTH_1=y
227CONFIG_MTD_MAP_BANK_WIDTH_2=y
228CONFIG_MTD_MAP_BANK_WIDTH_4=y
229# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
230# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
231# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
232CONFIG_MTD_CFI_I1=y
233CONFIG_MTD_CFI_I2=y
234# CONFIG_MTD_CFI_I4 is not set
235# CONFIG_MTD_CFI_I8 is not set
236CONFIG_MTD_CFI_INTELEXT=y
237# CONFIG_MTD_CFI_AMDSTD is not set
238# CONFIG_MTD_CFI_STAA is not set
239CONFIG_MTD_CFI_UTIL=y
240# CONFIG_MTD_RAM is not set
241# CONFIG_MTD_ROM is not set
242# CONFIG_MTD_ABSENT is not set
243# CONFIG_MTD_XIP is not set
244
245#
246# Mapping drivers for chip access
247#
248# CONFIG_MTD_COMPLEX_MAPPINGS is not set
249# CONFIG_MTD_PHYSMAP is not set
250# CONFIG_MTD_ARM_INTEGRATOR is not set
251CONFIG_MTD_SA1100=y
252# CONFIG_MTD_EDB7312 is not set
253
254#
255# Self-contained MTD device drivers
256#
257# CONFIG_MTD_SLRAM is not set
258# CONFIG_MTD_PHRAM is not set
259# CONFIG_MTD_MTDRAM is not set
260# CONFIG_MTD_BLKMTD is not set
261# CONFIG_MTD_BLOCK2MTD is not set
262
263#
264# Disk-On-Chip Device Drivers
265#
266# CONFIG_MTD_DOC2000 is not set
267# CONFIG_MTD_DOC2001 is not set
268# CONFIG_MTD_DOC2001PLUS is not set
269
270#
271# NAND Flash Device Drivers
272#
273# CONFIG_MTD_NAND is not set
274
275#
276# Parallel port support
277#
278# CONFIG_PARPORT is not set
279
280#
281# Plug and Play support
282#
283# CONFIG_PNP is not set
284
285#
286# Block devices
287#
288# CONFIG_BLK_DEV_FD is not set
289# CONFIG_BLK_DEV_XD is not set
290# CONFIG_BLK_DEV_COW_COMMON is not set
291CONFIG_BLK_DEV_LOOP=y
292# CONFIG_BLK_DEV_CRYPTOLOOP is not set
293# CONFIG_BLK_DEV_NBD is not set
294CONFIG_BLK_DEV_RAM=y
295CONFIG_BLK_DEV_RAM_COUNT=16
296CONFIG_BLK_DEV_RAM_SIZE=8192
297CONFIG_BLK_DEV_INITRD=y
298CONFIG_INITRAMFS_SOURCE=""
299# CONFIG_CDROM_PKTCDVD is not set
300
301#
302# IO Schedulers
303#
304CONFIG_IOSCHED_NOOP=y
305# CONFIG_IOSCHED_AS is not set
306# CONFIG_IOSCHED_DEADLINE is not set
307# CONFIG_IOSCHED_CFQ is not set
308# CONFIG_ATA_OVER_ETH is not set
309
310#
311# ATA/ATAPI/MFM/RLL support
312#
313# CONFIG_IDE is not set
314
315#
316# SCSI device support
317#
318# CONFIG_SCSI is not set
319
320#
321# Multi-device support (RAID and LVM)
322#
323# CONFIG_MD is not set
324
325#
326# Fusion MPT device support
327#
328
329#
330# IEEE 1394 (FireWire) support
331#
332
333#
334# I2O device support
335#
336
337#
338# Networking support
339#
340CONFIG_NET=y
341
342#
343# Networking options
344#
345CONFIG_PACKET=y
346# CONFIG_PACKET_MMAP is not set
347# CONFIG_NETLINK_DEV is not set
348CONFIG_UNIX=y
349# CONFIG_NET_KEY is not set
350CONFIG_INET=y
351# CONFIG_IP_MULTICAST is not set
352# CONFIG_IP_ADVANCED_ROUTER is not set
353# CONFIG_IP_PNP is not set
354# CONFIG_NET_IPIP is not set
355# CONFIG_NET_IPGRE is not set
356# CONFIG_ARPD is not set
357CONFIG_SYN_COOKIES=y
358# CONFIG_INET_AH is not set
359# CONFIG_INET_ESP is not set
360# CONFIG_INET_IPCOMP is not set
361# CONFIG_INET_TUNNEL is not set
362# CONFIG_IP_TCPDIAG is not set
363# CONFIG_IP_TCPDIAG_IPV6 is not set
364# CONFIG_IPV6 is not set
365# CONFIG_NETFILTER is not set
366
367#
368# SCTP Configuration (EXPERIMENTAL)
369#
370# CONFIG_IP_SCTP is not set
371# CONFIG_ATM is not set
372# CONFIG_BRIDGE is not set
373# CONFIG_VLAN_8021Q is not set
374# CONFIG_DECNET is not set
375# CONFIG_LLC2 is not set
376# CONFIG_IPX is not set
377# CONFIG_ATALK is not set
378# CONFIG_X25 is not set
379# CONFIG_LAPB is not set
380# CONFIG_NET_DIVERT is not set
381# CONFIG_ECONET is not set
382# CONFIG_WAN_ROUTER is not set
383
384#
385# QoS and/or fair queueing
386#
387# CONFIG_NET_SCHED is not set
388# CONFIG_NET_CLS_ROUTE is not set
389
390#
391# Network testing
392#
393# CONFIG_NET_PKTGEN is not set
394# CONFIG_NETPOLL is not set
395# CONFIG_NET_POLL_CONTROLLER is not set
396# CONFIG_HAMRADIO is not set
397# CONFIG_IRDA is not set
398# CONFIG_BT is not set
399CONFIG_NETDEVICES=y
400# CONFIG_DUMMY is not set
401# CONFIG_BONDING is not set
402# CONFIG_EQUALIZER is not set
403# CONFIG_TUN is not set
404
405#
406# ARCnet devices
407#
408# CONFIG_ARCNET is not set
409
410#
411# Ethernet (10 or 100Mbit)
412#
413CONFIG_NET_ETHERNET=y
414CONFIG_MII=y
415# CONFIG_NET_VENDOR_3COM is not set
416# CONFIG_LANCE is not set
417# CONFIG_NET_VENDOR_SMC is not set
418CONFIG_SMC91X=y
419# CONFIG_NET_VENDOR_RACAL is not set
420# CONFIG_AT1700 is not set
421# CONFIG_DEPCA is not set
422# CONFIG_HP100 is not set
423# CONFIG_NET_ISA is not set
424# CONFIG_NET_PCI is not set
425# CONFIG_NET_POCKET is not set
426
427#
428# Ethernet (1000 Mbit)
429#
430
431#
432# Ethernet (10000 Mbit)
433#
434
435#
436# Token Ring devices
437#
438# CONFIG_TR is not set
439
440#
441# Wireless LAN (non-hamradio)
442#
443# CONFIG_NET_RADIO is not set
444
445#
446# Wan interfaces
447#
448# CONFIG_WAN is not set
449# CONFIG_PPP is not set
450# CONFIG_SLIP is not set
451# CONFIG_SHAPER is not set
452# CONFIG_NETCONSOLE is not set
453
454#
455# ISDN subsystem
456#
457# CONFIG_ISDN is not set
458
459#
460# Input device support
461#
462# CONFIG_INPUT is not set
463
464#
465# Hardware I/O ports
466#
467# CONFIG_SERIO is not set
468# CONFIG_GAMEPORT is not set
469CONFIG_SOUND_GAMEPORT=y
470
471#
472# Character devices
473#
474# CONFIG_VT is not set
475# CONFIG_SERIAL_NONSTANDARD is not set
476
477#
478# Serial drivers
479#
480# CONFIG_SERIAL_8250 is not set
481
482#
483# Non-8250 serial port support
484#
485CONFIG_SERIAL_SA1100=y
486CONFIG_SERIAL_SA1100_CONSOLE=y
487CONFIG_SERIAL_CORE=y
488CONFIG_SERIAL_CORE_CONSOLE=y
489CONFIG_UNIX98_PTYS=y
490CONFIG_LEGACY_PTYS=y
491CONFIG_LEGACY_PTY_COUNT=256
492
493#
494# IPMI
495#
496# CONFIG_IPMI_HANDLER is not set
497
498#
499# Watchdog Cards
500#
501# CONFIG_WATCHDOG is not set
502# CONFIG_NVRAM is not set
503# CONFIG_RTC is not set
504# CONFIG_DTLK is not set
505# CONFIG_R3964 is not set
506
507#
508# Ftape, the floppy tape device driver
509#
510# CONFIG_DRM is not set
511# CONFIG_RAW_DRIVER is not set
512
513#
514# TPM devices
515#
516# CONFIG_TCG_TPM is not set
517
518#
519# I2C support
520#
521# CONFIG_I2C is not set
522
523#
524# Misc devices
525#
526
527#
528# Multimedia devices
529#
530# CONFIG_VIDEO_DEV is not set
531
532#
533# Digital Video Broadcasting Devices
534#
535# CONFIG_DVB is not set
536
537#
538# Graphics support
539#
540# CONFIG_FB is not set
541
542#
543# Sound
544#
545# CONFIG_SOUND is not set
546
547#
548# USB support
549#
550CONFIG_USB_ARCH_HAS_HCD=y
551# CONFIG_USB_ARCH_HAS_OHCI is not set
552# CONFIG_USB is not set
553
554#
555# USB Gadget Support
556#
557# CONFIG_USB_GADGET is not set
558
559#
560# MMC/SD Card support
561#
562# CONFIG_MMC is not set
563
564#
565# File systems
566#
567CONFIG_EXT2_FS=y
568# CONFIG_EXT2_FS_XATTR is not set
569CONFIG_EXT3_FS=y
570# CONFIG_EXT3_FS_XATTR is not set
571CONFIG_JBD=y
572# CONFIG_JBD_DEBUG is not set
573# CONFIG_REISERFS_FS is not set
574# CONFIG_JFS_FS is not set
575
576#
577# XFS support
578#
579# CONFIG_XFS_FS is not set
580# CONFIG_MINIX_FS is not set
581# CONFIG_ROMFS_FS is not set
582# CONFIG_QUOTA is not set
583# CONFIG_DNOTIFY is not set
584# CONFIG_AUTOFS_FS is not set
585# CONFIG_AUTOFS4_FS is not set
586
587#
588# CD-ROM/DVD Filesystems
589#
590# CONFIG_ISO9660_FS is not set
591# CONFIG_UDF_FS is not set
592
593#
594# DOS/FAT/NT Filesystems
595#
596CONFIG_FAT_FS=m
597CONFIG_MSDOS_FS=m
598CONFIG_VFAT_FS=m
599CONFIG_FAT_DEFAULT_CODEPAGE=437
600CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
601# CONFIG_NTFS_FS is not set
602
603#
604# Pseudo filesystems
605#
606CONFIG_PROC_FS=y
607CONFIG_SYSFS=y
608# CONFIG_DEVFS_FS is not set
609# CONFIG_DEVPTS_FS_XATTR is not set
610CONFIG_TMPFS=y
611# CONFIG_TMPFS_XATTR is not set
612# CONFIG_HUGETLB_PAGE is not set
613CONFIG_RAMFS=y
614
615#
616# Miscellaneous filesystems
617#
618# CONFIG_ADFS_FS is not set
619# CONFIG_AFFS_FS is not set
620# CONFIG_HFS_FS is not set
621# CONFIG_HFSPLUS_FS is not set
622# CONFIG_BEFS_FS is not set
623# CONFIG_BFS_FS is not set
624# CONFIG_EFS_FS is not set
625# CONFIG_JFFS_FS is not set
626# CONFIG_JFFS2_FS is not set
627# CONFIG_CRAMFS is not set
628# CONFIG_VXFS_FS is not set
629# CONFIG_HPFS_FS is not set
630# CONFIG_QNX4FS_FS is not set
631# CONFIG_SYSV_FS is not set
632# CONFIG_UFS_FS is not set
633
634#
635# Network File Systems
636#
637CONFIG_NFS_FS=m
638CONFIG_NFS_V3=y
639# CONFIG_NFS_V4 is not set
640CONFIG_NFS_DIRECTIO=y
641# CONFIG_NFSD is not set
642CONFIG_LOCKD=m
643CONFIG_LOCKD_V4=y
644CONFIG_SUNRPC=m
645# CONFIG_RPCSEC_GSS_KRB5 is not set
646# CONFIG_RPCSEC_GSS_SPKM3 is not set
647# CONFIG_SMB_FS is not set
648# CONFIG_CIFS is not set
649# CONFIG_NCP_FS is not set
650# CONFIG_CODA_FS is not set
651# CONFIG_AFS_FS is not set
652
653#
654# Partition Types
655#
656# CONFIG_PARTITION_ADVANCED is not set
657CONFIG_MSDOS_PARTITION=y
658
659#
660# Native Language Support
661#
662CONFIG_NLS=y
663CONFIG_NLS_DEFAULT="iso8859-1"
664# CONFIG_NLS_CODEPAGE_437 is not set
665# CONFIG_NLS_CODEPAGE_737 is not set
666# CONFIG_NLS_CODEPAGE_775 is not set
667# CONFIG_NLS_CODEPAGE_850 is not set
668# CONFIG_NLS_CODEPAGE_852 is not set
669# CONFIG_NLS_CODEPAGE_855 is not set
670# CONFIG_NLS_CODEPAGE_857 is not set
671# CONFIG_NLS_CODEPAGE_860 is not set
672# CONFIG_NLS_CODEPAGE_861 is not set
673# CONFIG_NLS_CODEPAGE_862 is not set
674# CONFIG_NLS_CODEPAGE_863 is not set
675# CONFIG_NLS_CODEPAGE_864 is not set
676# CONFIG_NLS_CODEPAGE_865 is not set
677# CONFIG_NLS_CODEPAGE_866 is not set
678# CONFIG_NLS_CODEPAGE_869 is not set
679# CONFIG_NLS_CODEPAGE_936 is not set
680# CONFIG_NLS_CODEPAGE_950 is not set
681# CONFIG_NLS_CODEPAGE_932 is not set
682# CONFIG_NLS_CODEPAGE_949 is not set
683# CONFIG_NLS_CODEPAGE_874 is not set
684# CONFIG_NLS_ISO8859_8 is not set
685# CONFIG_NLS_CODEPAGE_1250 is not set
686# CONFIG_NLS_CODEPAGE_1251 is not set
687# CONFIG_NLS_ASCII is not set
688# CONFIG_NLS_ISO8859_1 is not set
689# CONFIG_NLS_ISO8859_2 is not set
690# CONFIG_NLS_ISO8859_3 is not set
691# CONFIG_NLS_ISO8859_4 is not set
692# CONFIG_NLS_ISO8859_5 is not set
693# CONFIG_NLS_ISO8859_6 is not set
694# CONFIG_NLS_ISO8859_7 is not set
695# CONFIG_NLS_ISO8859_9 is not set
696# CONFIG_NLS_ISO8859_13 is not set
697# CONFIG_NLS_ISO8859_14 is not set
698# CONFIG_NLS_ISO8859_15 is not set
699# CONFIG_NLS_KOI8_R is not set
700# CONFIG_NLS_KOI8_U is not set
701# CONFIG_NLS_UTF8 is not set
702
703#
704# Profiling support
705#
706# CONFIG_PROFILING is not set
707
708#
709# Kernel hacking
710#
711# CONFIG_PRINTK_TIME is not set
712CONFIG_DEBUG_KERNEL=y
713CONFIG_MAGIC_SYSRQ=y
714CONFIG_LOG_BUF_SHIFT=14
715# CONFIG_SCHEDSTATS is not set
716# CONFIG_DEBUG_SLAB is not set
717# CONFIG_DEBUG_SPINLOCK is not set
718# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
719# CONFIG_DEBUG_KOBJECT is not set
720CONFIG_DEBUG_BUGVERBOSE=y
721# CONFIG_DEBUG_INFO is not set
722# CONFIG_DEBUG_FS is not set
723CONFIG_FRAME_POINTER=y
724# CONFIG_DEBUG_USER is not set
725# CONFIG_DEBUG_WAITQ is not set
726# CONFIG_DEBUG_ERRORS is not set
727# CONFIG_DEBUG_LL is not set
728
729#
730# Security options
731#
732# CONFIG_KEYS is not set
733# CONFIG_SECURITY is not set
734
735#
736# Cryptographic options
737#
738# CONFIG_CRYPTO is not set
739
740#
741# Hardware crypto devices
742#
743
744#
745# Library routines
746#
747# CONFIG_CRC_CCITT is not set
748CONFIG_CRC32=y
749# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/configs/pxa255-idp_defconfig b/arch/arm/configs/pxa255-idp_defconfig
new file mode 100644
index 000000000000..21c327883d8c
--- /dev/null
+++ b/arch/arm/configs/pxa255-idp_defconfig
@@ -0,0 +1,799 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 22:20:17 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53# CONFIG_MODULE_UNLOAD is not set
54CONFIG_OBSOLETE_MODPARM=y
55# CONFIG_MODVERSIONS is not set
56# CONFIG_MODULE_SRCVERSION_ALL is not set
57# CONFIG_KMOD is not set
58
59#
60# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66# CONFIG_ARCH_CAMELOT is not set
67# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set
72# CONFIG_ARCH_L7200 is not set
73CONFIG_ARCH_PXA=y
74# CONFIG_ARCH_RPC is not set
75# CONFIG_ARCH_SA1100 is not set
76# CONFIG_ARCH_S3C2410 is not set
77# CONFIG_ARCH_SHARK is not set
78# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set
80# CONFIG_ARCH_VERSATILE is not set
81# CONFIG_ARCH_IMX is not set
82# CONFIG_ARCH_H720X is not set
83
84#
85# Intel PXA2xx Implementations
86#
87# CONFIG_ARCH_LUBBOCK is not set
88# CONFIG_MACH_MAINSTONE is not set
89CONFIG_ARCH_PXA_IDP=y
90# CONFIG_PXA_SHARPSL is not set
91CONFIG_PXA25x=y
92
93#
94# Processor Type
95#
96CONFIG_CPU_32=y
97CONFIG_CPU_XSCALE=y
98CONFIG_CPU_32v5=y
99CONFIG_CPU_ABRT_EV5T=y
100CONFIG_CPU_CACHE_VIVT=y
101CONFIG_CPU_TLB_V4WBI=y
102CONFIG_CPU_MINICACHE=y
103
104#
105# Processor Features
106#
107# CONFIG_ARM_THUMB is not set
108CONFIG_XSCALE_PMU=y
109
110#
111# Bus support
112#
113
114#
115# PCCARD (PCMCIA/CardBus) support
116#
117# CONFIG_PCCARD is not set
118
119#
120# Kernel Features
121#
122# CONFIG_PREEMPT is not set
123CONFIG_LEDS=y
124CONFIG_LEDS_TIMER=y
125CONFIG_LEDS_CPU=y
126CONFIG_ALIGNMENT_TRAP=y
127
128#
129# Boot options
130#
131CONFIG_ZBOOT_ROM_TEXT=0x0
132CONFIG_ZBOOT_ROM_BSS=0x0
133CONFIG_CMDLINE="root=/dev/nfs ip=dhcp console=ttyS0,115200 mem=64M"
134# CONFIG_XIP_KERNEL is not set
135
136#
137# Floating point emulation
138#
139
140#
141# At least one emulation must be selected
142#
143CONFIG_FPE_NWFPE=y
144# CONFIG_FPE_NWFPE_XP is not set
145# CONFIG_FPE_FASTFPE is not set
146
147#
148# Userspace binary formats
149#
150CONFIG_BINFMT_ELF=y
151# CONFIG_BINFMT_AOUT is not set
152# CONFIG_BINFMT_MISC is not set
153# CONFIG_ARTHUR is not set
154
155#
156# Power management options
157#
158# CONFIG_PM is not set
159
160#
161# Device Drivers
162#
163
164#
165# Generic Driver Options
166#
167CONFIG_STANDALONE=y
168CONFIG_PREVENT_FIRMWARE_BUILD=y
169# CONFIG_FW_LOADER is not set
170# CONFIG_DEBUG_DRIVER is not set
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# CONFIG_MTD_AFS_PARTS is not set
182
183#
184# User Modules And Translation Layers
185#
186CONFIG_MTD_CHAR=y
187CONFIG_MTD_BLOCK=y
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
198CONFIG_MTD_CFI_ADV_OPTIONS=y
199CONFIG_MTD_CFI_NOSWAP=y
200# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
201# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
202CONFIG_MTD_CFI_GEOMETRY=y
203# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
204# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
205CONFIG_MTD_MAP_BANK_WIDTH_4=y
206# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
207# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
208# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
209# CONFIG_MTD_CFI_I1 is not set
210CONFIG_MTD_CFI_I2=y
211# CONFIG_MTD_CFI_I4 is not set
212# CONFIG_MTD_CFI_I8 is not set
213CONFIG_MTD_CFI_INTELEXT=y
214# CONFIG_MTD_CFI_AMDSTD is not set
215# CONFIG_MTD_CFI_STAA is not set
216CONFIG_MTD_CFI_UTIL=y
217# CONFIG_MTD_RAM is not set
218# CONFIG_MTD_ROM is not set
219# CONFIG_MTD_ABSENT is not set
220# CONFIG_MTD_XIP is not set
221
222#
223# Mapping drivers for chip access
224#
225# CONFIG_MTD_COMPLEX_MAPPINGS is not set
226# CONFIG_MTD_PHYSMAP is not set
227# CONFIG_MTD_ARM_INTEGRATOR is not set
228# CONFIG_MTD_EDB7312 is not set
229# CONFIG_MTD_SHARP_SL is not set
230
231#
232# Self-contained MTD device drivers
233#
234# CONFIG_MTD_SLRAM is not set
235# CONFIG_MTD_PHRAM is not set
236# CONFIG_MTD_MTDRAM is not set
237# CONFIG_MTD_BLKMTD is not set
238# CONFIG_MTD_BLOCK2MTD is not set
239
240#
241# Disk-On-Chip Device Drivers
242#
243# CONFIG_MTD_DOC2000 is not set
244# CONFIG_MTD_DOC2001 is not set
245# CONFIG_MTD_DOC2001PLUS is not set
246
247#
248# NAND Flash Device Drivers
249#
250# CONFIG_MTD_NAND is not set
251
252#
253# Parallel port support
254#
255# CONFIG_PARPORT is not set
256
257#
258# Plug and Play support
259#
260
261#
262# Block devices
263#
264# CONFIG_BLK_DEV_FD is not set
265# CONFIG_BLK_DEV_COW_COMMON is not set
266# CONFIG_BLK_DEV_LOOP is not set
267# CONFIG_BLK_DEV_NBD is not set
268# CONFIG_BLK_DEV_RAM is not set
269CONFIG_BLK_DEV_RAM_COUNT=16
270CONFIG_INITRAMFS_SOURCE=""
271# CONFIG_CDROM_PKTCDVD is not set
272
273#
274# IO Schedulers
275#
276CONFIG_IOSCHED_NOOP=y
277CONFIG_IOSCHED_AS=y
278CONFIG_IOSCHED_DEADLINE=y
279CONFIG_IOSCHED_CFQ=y
280# CONFIG_ATA_OVER_ETH is not set
281
282#
283# ATA/ATAPI/MFM/RLL support
284#
285CONFIG_IDE=y
286CONFIG_BLK_DEV_IDE=y
287
288#
289# Please see Documentation/ide.txt for help/info on IDE drives
290#
291# CONFIG_BLK_DEV_IDE_SATA is not set
292CONFIG_BLK_DEV_IDEDISK=y
293# CONFIG_IDEDISK_MULTI_MODE is not set
294# CONFIG_BLK_DEV_IDECD is not set
295# CONFIG_BLK_DEV_IDETAPE is not set
296# CONFIG_BLK_DEV_IDEFLOPPY is not set
297# CONFIG_IDE_TASK_IOCTL is not set
298
299#
300# IDE chipset support/bugfixes
301#
302# CONFIG_IDE_GENERIC is not set
303# CONFIG_IDE_ARM is not set
304# CONFIG_BLK_DEV_IDEDMA is not set
305# CONFIG_IDEDMA_AUTO is not set
306# CONFIG_BLK_DEV_HD is not set
307
308#
309# SCSI device support
310#
311# CONFIG_SCSI is not set
312
313#
314# Multi-device support (RAID and LVM)
315#
316# CONFIG_MD is not set
317
318#
319# Fusion MPT device support
320#
321
322#
323# IEEE 1394 (FireWire) support
324#
325
326#
327# I2O device support
328#
329
330#
331# Networking support
332#
333CONFIG_NET=y
334
335#
336# Networking options
337#
338# CONFIG_PACKET is not set
339# CONFIG_NETLINK_DEV is not set
340CONFIG_UNIX=y
341# CONFIG_NET_KEY is not set
342CONFIG_INET=y
343# CONFIG_IP_MULTICAST is not set
344# CONFIG_IP_ADVANCED_ROUTER is not set
345CONFIG_IP_PNP=y
346CONFIG_IP_PNP_DHCP=y
347# CONFIG_IP_PNP_BOOTP is not set
348# CONFIG_IP_PNP_RARP is not set
349# CONFIG_NET_IPIP is not set
350# CONFIG_NET_IPGRE is not set
351# CONFIG_ARPD is not set
352# CONFIG_SYN_COOKIES is not set
353# CONFIG_INET_AH is not set
354# CONFIG_INET_ESP is not set
355# CONFIG_INET_IPCOMP is not set
356# CONFIG_INET_TUNNEL is not set
357CONFIG_IP_TCPDIAG=y
358# CONFIG_IP_TCPDIAG_IPV6 is not set
359# CONFIG_IPV6 is not set
360# CONFIG_NETFILTER is not set
361
362#
363# SCTP Configuration (EXPERIMENTAL)
364#
365# CONFIG_IP_SCTP is not set
366# CONFIG_ATM is not set
367# CONFIG_BRIDGE is not set
368# CONFIG_VLAN_8021Q is not set
369# CONFIG_DECNET is not set
370# CONFIG_LLC2 is not set
371# CONFIG_IPX is not set
372# CONFIG_ATALK is not set
373# CONFIG_X25 is not set
374# CONFIG_LAPB is not set
375# CONFIG_NET_DIVERT is not set
376# CONFIG_ECONET is not set
377# CONFIG_WAN_ROUTER is not set
378
379#
380# QoS and/or fair queueing
381#
382# CONFIG_NET_SCHED is not set
383# CONFIG_NET_CLS_ROUTE is not set
384
385#
386# Network testing
387#
388# CONFIG_NET_PKTGEN is not set
389# CONFIG_NETPOLL is not set
390# CONFIG_NET_POLL_CONTROLLER is not set
391# CONFIG_HAMRADIO is not set
392# CONFIG_IRDA is not set
393# CONFIG_BT is not set
394CONFIG_NETDEVICES=y
395# CONFIG_DUMMY is not set
396# CONFIG_BONDING is not set
397# CONFIG_EQUALIZER is not set
398# CONFIG_TUN is not set
399
400#
401# Ethernet (10 or 100Mbit)
402#
403CONFIG_NET_ETHERNET=y
404CONFIG_MII=y
405CONFIG_SMC91X=y
406
407#
408# Ethernet (1000 Mbit)
409#
410
411#
412# Ethernet (10000 Mbit)
413#
414
415#
416# Token Ring devices
417#
418
419#
420# Wireless LAN (non-hamradio)
421#
422# CONFIG_NET_RADIO is not set
423
424#
425# Wan interfaces
426#
427# CONFIG_WAN is not set
428# CONFIG_PPP is not set
429# CONFIG_SLIP is not set
430# CONFIG_SHAPER is not set
431# CONFIG_NETCONSOLE is not set
432
433#
434# ISDN subsystem
435#
436# CONFIG_ISDN is not set
437
438#
439# Input device support
440#
441CONFIG_INPUT=y
442
443#
444# Userland interfaces
445#
446CONFIG_INPUT_MOUSEDEV=y
447CONFIG_INPUT_MOUSEDEV_PSAUX=y
448CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
449CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
450# CONFIG_INPUT_JOYDEV is not set
451# CONFIG_INPUT_TSDEV is not set
452CONFIG_INPUT_EVDEV=y
453# CONFIG_INPUT_EVBUG is not set
454
455#
456# Input Device Drivers
457#
458CONFIG_INPUT_KEYBOARD=y
459CONFIG_KEYBOARD_ATKBD=y
460# CONFIG_KEYBOARD_SUNKBD is not set
461# CONFIG_KEYBOARD_LKKBD is not set
462# CONFIG_KEYBOARD_XTKBD is not set
463# CONFIG_KEYBOARD_NEWTON is not set
464# CONFIG_INPUT_MOUSE is not set
465# CONFIG_INPUT_JOYSTICK is not set
466# CONFIG_INPUT_TOUCHSCREEN is not set
467# CONFIG_INPUT_MISC is not set
468
469#
470# Hardware I/O ports
471#
472CONFIG_SERIO=y
473# CONFIG_SERIO_SERPORT is not set
474CONFIG_SERIO_LIBPS2=y
475# CONFIG_SERIO_RAW is not set
476# CONFIG_GAMEPORT is not set
477CONFIG_SOUND_GAMEPORT=y
478
479#
480# Character devices
481#
482CONFIG_VT=y
483CONFIG_VT_CONSOLE=y
484CONFIG_HW_CONSOLE=y
485# CONFIG_SERIAL_NONSTANDARD is not set
486
487#
488# Serial drivers
489#
490# CONFIG_SERIAL_8250 is not set
491
492#
493# Non-8250 serial port support
494#
495CONFIG_SERIAL_PXA=y
496CONFIG_SERIAL_PXA_CONSOLE=y
497CONFIG_SERIAL_CORE=y
498CONFIG_SERIAL_CORE_CONSOLE=y
499CONFIG_UNIX98_PTYS=y
500CONFIG_LEGACY_PTYS=y
501CONFIG_LEGACY_PTY_COUNT=256
502
503#
504# IPMI
505#
506# CONFIG_IPMI_HANDLER is not set
507
508#
509# Watchdog Cards
510#
511# CONFIG_WATCHDOG is not set
512# CONFIG_NVRAM is not set
513# CONFIG_RTC is not set
514# CONFIG_DTLK is not set
515# CONFIG_R3964 is not set
516
517#
518# Ftape, the floppy tape device driver
519#
520# CONFIG_DRM is not set
521# CONFIG_RAW_DRIVER is not set
522
523#
524# TPM devices
525#
526# CONFIG_TCG_TPM is not set
527
528#
529# I2C support
530#
531# CONFIG_I2C is not set
532
533#
534# Misc devices
535#
536
537#
538# Multimedia devices
539#
540# CONFIG_VIDEO_DEV is not set
541
542#
543# Digital Video Broadcasting Devices
544#
545# CONFIG_DVB is not set
546
547#
548# Graphics support
549#
550CONFIG_FB=y
551CONFIG_FB_CFB_FILLRECT=y
552CONFIG_FB_CFB_COPYAREA=y
553CONFIG_FB_CFB_IMAGEBLIT=y
554CONFIG_FB_SOFT_CURSOR=y
555# CONFIG_FB_MODE_HELPERS is not set
556# CONFIG_FB_TILEBLITTING is not set
557CONFIG_FB_PXA=y
558# CONFIG_FB_PXA_PARAMETERS is not set
559# CONFIG_FB_VIRTUAL is not set
560
561#
562# Console display driver support
563#
564# CONFIG_VGA_CONSOLE is not set
565CONFIG_DUMMY_CONSOLE=y
566CONFIG_FRAMEBUFFER_CONSOLE=y
567CONFIG_FONTS=y
568CONFIG_FONT_8x8=y
569CONFIG_FONT_8x16=y
570# CONFIG_FONT_6x11 is not set
571# CONFIG_FONT_PEARL_8x8 is not set
572# CONFIG_FONT_ACORN_8x8 is not set
573# CONFIG_FONT_MINI_4x6 is not set
574# CONFIG_FONT_SUN8x16 is not set
575# CONFIG_FONT_SUN12x22 is not set
576
577#
578# Logo configuration
579#
580CONFIG_LOGO=y
581CONFIG_LOGO_LINUX_MONO=y
582CONFIG_LOGO_LINUX_VGA16=y
583CONFIG_LOGO_LINUX_CLUT224=y
584# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
585
586#
587# Sound
588#
589# CONFIG_SOUND is not set
590
591#
592# USB support
593#
594CONFIG_USB_ARCH_HAS_HCD=y
595# CONFIG_USB_ARCH_HAS_OHCI is not set
596# CONFIG_USB is not set
597
598#
599# USB Gadget Support
600#
601# CONFIG_USB_GADGET is not set
602
603#
604# MMC/SD Card support
605#
606# CONFIG_MMC is not set
607
608#
609# File systems
610#
611CONFIG_EXT2_FS=y
612# CONFIG_EXT2_FS_XATTR is not set
613# CONFIG_EXT3_FS is not set
614# CONFIG_JBD is not set
615# CONFIG_REISERFS_FS is not set
616# CONFIG_JFS_FS is not set
617
618#
619# XFS support
620#
621# CONFIG_XFS_FS is not set
622# CONFIG_MINIX_FS is not set
623# CONFIG_ROMFS_FS is not set
624# CONFIG_QUOTA is not set
625CONFIG_DNOTIFY=y
626# CONFIG_AUTOFS_FS is not set
627# CONFIG_AUTOFS4_FS is not set
628
629#
630# CD-ROM/DVD Filesystems
631#
632# CONFIG_ISO9660_FS is not set
633# CONFIG_UDF_FS is not set
634
635#
636# DOS/FAT/NT Filesystems
637#
638CONFIG_FAT_FS=y
639CONFIG_MSDOS_FS=y
640# CONFIG_VFAT_FS is not set
641CONFIG_FAT_DEFAULT_CODEPAGE=437
642# CONFIG_NTFS_FS is not set
643
644#
645# Pseudo filesystems
646#
647CONFIG_PROC_FS=y
648CONFIG_SYSFS=y
649# CONFIG_DEVFS_FS is not set
650# CONFIG_DEVPTS_FS_XATTR is not set
651# CONFIG_TMPFS is not set
652# CONFIG_HUGETLB_PAGE is not set
653CONFIG_RAMFS=y
654
655#
656# Miscellaneous filesystems
657#
658# CONFIG_ADFS_FS is not set
659# CONFIG_AFFS_FS is not set
660# CONFIG_HFS_FS is not set
661# CONFIG_HFSPLUS_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_JFFS_FS is not set
666CONFIG_JFFS2_FS=y
667CONFIG_JFFS2_FS_DEBUG=0
668# CONFIG_JFFS2_FS_NAND is not set
669# CONFIG_JFFS2_FS_NOR_ECC is not set
670# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
671CONFIG_JFFS2_ZLIB=y
672CONFIG_JFFS2_RTIME=y
673# CONFIG_JFFS2_RUBIN is not set
674# CONFIG_CRAMFS is not set
675# CONFIG_VXFS_FS is not set
676# CONFIG_HPFS_FS is not set
677# CONFIG_QNX4FS_FS is not set
678# CONFIG_SYSV_FS is not set
679# CONFIG_UFS_FS is not set
680
681#
682# Network File Systems
683#
684CONFIG_NFS_FS=y
685# CONFIG_NFS_V3 is not set
686# CONFIG_NFS_V4 is not set
687# CONFIG_NFS_DIRECTIO is not set
688# CONFIG_NFSD is not set
689CONFIG_ROOT_NFS=y
690CONFIG_LOCKD=y
691CONFIG_SUNRPC=y
692# CONFIG_RPCSEC_GSS_KRB5 is not set
693# CONFIG_RPCSEC_GSS_SPKM3 is not set
694# CONFIG_SMB_FS is not set
695# CONFIG_CIFS is not set
696# CONFIG_NCP_FS is not set
697# CONFIG_CODA_FS is not set
698# CONFIG_AFS_FS is not set
699
700#
701# Partition Types
702#
703# CONFIG_PARTITION_ADVANCED is not set
704CONFIG_MSDOS_PARTITION=y
705
706#
707# Native Language Support
708#
709CONFIG_NLS=y
710CONFIG_NLS_DEFAULT="iso8859-1"
711# CONFIG_NLS_CODEPAGE_437 is not set
712# CONFIG_NLS_CODEPAGE_737 is not set
713# CONFIG_NLS_CODEPAGE_775 is not set
714# CONFIG_NLS_CODEPAGE_850 is not set
715# CONFIG_NLS_CODEPAGE_852 is not set
716# CONFIG_NLS_CODEPAGE_855 is not set
717# CONFIG_NLS_CODEPAGE_857 is not set
718# CONFIG_NLS_CODEPAGE_860 is not set
719# CONFIG_NLS_CODEPAGE_861 is not set
720# CONFIG_NLS_CODEPAGE_862 is not set
721# CONFIG_NLS_CODEPAGE_863 is not set
722# CONFIG_NLS_CODEPAGE_864 is not set
723# CONFIG_NLS_CODEPAGE_865 is not set
724# CONFIG_NLS_CODEPAGE_866 is not set
725# CONFIG_NLS_CODEPAGE_869 is not set
726# CONFIG_NLS_CODEPAGE_936 is not set
727# CONFIG_NLS_CODEPAGE_950 is not set
728# CONFIG_NLS_CODEPAGE_932 is not set
729# CONFIG_NLS_CODEPAGE_949 is not set
730# CONFIG_NLS_CODEPAGE_874 is not set
731# CONFIG_NLS_ISO8859_8 is not set
732# CONFIG_NLS_CODEPAGE_1250 is not set
733# CONFIG_NLS_CODEPAGE_1251 is not set
734# CONFIG_NLS_ASCII is not set
735CONFIG_NLS_ISO8859_1=y
736# CONFIG_NLS_ISO8859_2 is not set
737# CONFIG_NLS_ISO8859_3 is not set
738# CONFIG_NLS_ISO8859_4 is not set
739# CONFIG_NLS_ISO8859_5 is not set
740# CONFIG_NLS_ISO8859_6 is not set
741# CONFIG_NLS_ISO8859_7 is not set
742# CONFIG_NLS_ISO8859_9 is not set
743# CONFIG_NLS_ISO8859_13 is not set
744# CONFIG_NLS_ISO8859_14 is not set
745# CONFIG_NLS_ISO8859_15 is not set
746# CONFIG_NLS_KOI8_R is not set
747# CONFIG_NLS_KOI8_U is not set
748# CONFIG_NLS_UTF8 is not set
749
750#
751# Profiling support
752#
753# CONFIG_PROFILING is not set
754
755#
756# Kernel hacking
757#
758# CONFIG_PRINTK_TIME is not set
759CONFIG_DEBUG_KERNEL=y
760CONFIG_MAGIC_SYSRQ=y
761CONFIG_LOG_BUF_SHIFT=14
762# CONFIG_SCHEDSTATS is not set
763# CONFIG_DEBUG_SLAB is not set
764# CONFIG_DEBUG_SPINLOCK is not set
765# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
766# CONFIG_DEBUG_KOBJECT is not set
767CONFIG_DEBUG_BUGVERBOSE=y
768CONFIG_DEBUG_INFO=y
769# CONFIG_DEBUG_FS is not set
770CONFIG_FRAME_POINTER=y
771CONFIG_DEBUG_USER=y
772# CONFIG_DEBUG_WAITQ is not set
773CONFIG_DEBUG_ERRORS=y
774CONFIG_DEBUG_LL=y
775# CONFIG_DEBUG_ICEDCC is not set
776
777#
778# Security options
779#
780# CONFIG_KEYS is not set
781# CONFIG_SECURITY is not set
782
783#
784# Cryptographic options
785#
786# CONFIG_CRYPTO is not set
787
788#
789# Hardware crypto devices
790#
791
792#
793# Library routines
794#
795# CONFIG_CRC_CCITT is not set
796CONFIG_CRC32=y
797# CONFIG_LIBCRC32C is not set
798CONFIG_ZLIB_INFLATE=y
799CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/rpc_defconfig b/arch/arm/configs/rpc_defconfig
new file mode 100644
index 000000000000..19184c1010ad
--- /dev/null
+++ b/arch/arm/configs/rpc_defconfig
@@ -0,0 +1,939 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11
4# Wed Mar 9 14:41:48 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12CONFIG_FIQ=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_ALL is not set
38# CONFIG_KALLSYMS_EXTRA_PASS is not set
39CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y
41CONFIG_EPOLL=y
42CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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# System Type
64#
65# CONFIG_ARCH_CLPS7500 is not set
66# CONFIG_ARCH_CLPS711X is not set
67# CONFIG_ARCH_CO285 is not set
68# CONFIG_ARCH_EBSA110 is not set
69# CONFIG_ARCH_CAMELOT is not set
70# CONFIG_ARCH_FOOTBRIDGE is not set
71# CONFIG_ARCH_INTEGRATOR is not set
72# CONFIG_ARCH_IOP3XX is not set
73# CONFIG_ARCH_IXP4XX is not set
74# CONFIG_ARCH_IXP2000 is not set
75# CONFIG_ARCH_L7200 is not set
76# CONFIG_ARCH_PXA is not set
77CONFIG_ARCH_RPC=y
78# CONFIG_ARCH_SA1100 is not set
79# CONFIG_ARCH_S3C2410 is not set
80# CONFIG_ARCH_SHARK is not set
81# CONFIG_ARCH_LH7A40X is not set
82# CONFIG_ARCH_OMAP is not set
83# CONFIG_ARCH_VERSATILE is not set
84# CONFIG_ARCH_IMX is not set
85# CONFIG_ARCH_H720X is not set
86CONFIG_ARCH_ACORN=y
87
88#
89# Processor Type
90#
91CONFIG_CPU_32=y
92CONFIG_CPU_ARM610=y
93CONFIG_CPU_ARM710=y
94CONFIG_CPU_SA110=y
95CONFIG_CPU_32v3=y
96CONFIG_CPU_ABRT_EV4=y
97CONFIG_CPU_CACHE_V3=y
98CONFIG_CPU_CACHE_V4WB=y
99CONFIG_CPU_CACHE_VIVT=y
100CONFIG_CPU_COPY_V3=y
101CONFIG_CPU_COPY_V4WB=y
102CONFIG_CPU_TLB_V3=y
103CONFIG_CPU_TLB_V4WB=y
104
105#
106# Processor Features
107#
108CONFIG_TIMER_ACORN=y
109
110#
111# Bus support
112#
113
114#
115# PCCARD (PCMCIA/CardBus) support
116#
117# CONFIG_PCCARD is not set
118
119#
120# PC-card bridges
121#
122
123#
124# Kernel Features
125#
126# CONFIG_PREEMPT is not set
127CONFIG_ALIGNMENT_TRAP=y
128
129#
130# Boot options
131#
132CONFIG_ZBOOT_ROM_TEXT=0x0
133CONFIG_ZBOOT_ROM_BSS=0x0
134CONFIG_CMDLINE=""
135# CONFIG_XIP_KERNEL is not set
136
137#
138# Floating point emulation
139#
140
141#
142# At least one emulation must be selected
143#
144CONFIG_FPE_NWFPE=y
145# CONFIG_FPE_NWFPE_XP is not set
146
147#
148# Userspace binary formats
149#
150CONFIG_BINFMT_ELF=y
151CONFIG_BINFMT_AOUT=y
152# CONFIG_BINFMT_MISC is not set
153# CONFIG_ARTHUR is not set
154
155#
156# Power management options
157#
158# CONFIG_PM is not set
159
160#
161# Device Drivers
162#
163
164#
165# Generic Driver Options
166#
167CONFIG_STANDALONE=y
168CONFIG_PREVENT_FIRMWARE_BUILD=y
169# CONFIG_FW_LOADER is not set
170# CONFIG_DEBUG_DRIVER is not set
171
172#
173# Memory Technology Devices (MTD)
174#
175# CONFIG_MTD is not set
176
177#
178# Parallel port support
179#
180CONFIG_PARPORT=y
181CONFIG_PARPORT_PC=y
182CONFIG_PARPORT_PC_CML1=y
183CONFIG_PARPORT_PC_FIFO=y
184# CONFIG_PARPORT_PC_SUPERIO is not set
185# CONFIG_PARPORT_ARC is not set
186# CONFIG_PARPORT_OTHER is not set
187# CONFIG_PARPORT_1284 is not set
188
189#
190# Plug and Play support
191#
192
193#
194# Block devices
195#
196CONFIG_BLK_DEV_FD=y
197# CONFIG_PARIDE is not set
198# CONFIG_BLK_DEV_COW_COMMON is not set
199CONFIG_BLK_DEV_LOOP=m
200# CONFIG_BLK_DEV_CRYPTOLOOP is not set
201# CONFIG_BLK_DEV_NBD is not set
202CONFIG_BLK_DEV_RAM=y
203CONFIG_BLK_DEV_RAM_COUNT=16
204CONFIG_BLK_DEV_RAM_SIZE=4096
205CONFIG_BLK_DEV_INITRD=y
206CONFIG_INITRAMFS_SOURCE=""
207# CONFIG_CDROM_PKTCDVD is not set
208
209#
210# IO Schedulers
211#
212CONFIG_IOSCHED_NOOP=y
213CONFIG_IOSCHED_AS=y
214CONFIG_IOSCHED_DEADLINE=y
215CONFIG_IOSCHED_CFQ=y
216# CONFIG_ATA_OVER_ETH is not set
217
218#
219# Acorn-specific block devices
220#
221
222#
223# ATA/ATAPI/MFM/RLL support
224#
225CONFIG_IDE=y
226CONFIG_BLK_DEV_IDE=y
227
228#
229# Please see Documentation/ide.txt for help/info on IDE drives
230#
231# CONFIG_BLK_DEV_IDE_SATA is not set
232CONFIG_BLK_DEV_IDEDISK=y
233CONFIG_IDEDISK_MULTI_MODE=y
234CONFIG_BLK_DEV_IDECD=y
235# CONFIG_BLK_DEV_IDETAPE is not set
236# CONFIG_BLK_DEV_IDEFLOPPY is not set
237# CONFIG_BLK_DEV_IDESCSI is not set
238# CONFIG_IDE_TASK_IOCTL is not set
239
240#
241# IDE chipset support/bugfixes
242#
243CONFIG_IDE_GENERIC=y
244CONFIG_IDE_ARM=y
245CONFIG_BLK_DEV_IDE_ICSIDE=y
246CONFIG_BLK_DEV_IDEDMA_ICS=y
247CONFIG_IDEDMA_ICS_AUTO=y
248CONFIG_BLK_DEV_IDE_RAPIDE=y
249CONFIG_BLK_DEV_IDEDMA=y
250# CONFIG_IDEDMA_IVB is not set
251CONFIG_IDEDMA_AUTO=y
252# CONFIG_BLK_DEV_HD is not set
253
254#
255# SCSI device support
256#
257CONFIG_SCSI=y
258CONFIG_SCSI_PROC_FS=y
259
260#
261# SCSI support type (disk, tape, CD-ROM)
262#
263CONFIG_BLK_DEV_SD=y
264CONFIG_CHR_DEV_ST=m
265# CONFIG_CHR_DEV_OSST is not set
266CONFIG_BLK_DEV_SR=y
267CONFIG_BLK_DEV_SR_VENDOR=y
268CONFIG_CHR_DEV_SG=y
269
270#
271# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
272#
273# CONFIG_SCSI_MULTI_LUN is not set
274CONFIG_SCSI_CONSTANTS=y
275CONFIG_SCSI_LOGGING=y
276
277#
278# SCSI Transport Attributes
279#
280# CONFIG_SCSI_SPI_ATTRS is not set
281# CONFIG_SCSI_FC_ATTRS is not set
282# CONFIG_SCSI_ISCSI_ATTRS is not set
283
284#
285# SCSI low-level drivers
286#
287# CONFIG_SCSI_SATA is not set
288CONFIG_SCSI_PPA=m
289CONFIG_SCSI_IMM=m
290# CONFIG_SCSI_IZIP_EPP16 is not set
291# CONFIG_SCSI_IZIP_SLOW_CTR is not set
292# CONFIG_SCSI_DEBUG is not set
293CONFIG_SCSI_ACORNSCSI_3=m
294CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE=y
295CONFIG_SCSI_ACORNSCSI_SYNC=y
296CONFIG_SCSI_ARXESCSI=m
297CONFIG_SCSI_CUMANA_2=m
298CONFIG_SCSI_EESOXSCSI=m
299CONFIG_SCSI_POWERTECSCSI=y
300
301#
302# The following drivers are not fully supported
303#
304CONFIG_SCSI_CUMANA_1=m
305CONFIG_SCSI_OAK1=m
306
307#
308# Multi-device support (RAID and LVM)
309#
310# CONFIG_MD is not set
311
312#
313# Fusion MPT device support
314#
315
316#
317# IEEE 1394 (FireWire) support
318#
319
320#
321# I2O device support
322#
323
324#
325# Networking support
326#
327CONFIG_NET=y
328
329#
330# Networking options
331#
332# CONFIG_PACKET is not set
333CONFIG_NETLINK_DEV=y
334CONFIG_UNIX=y
335# CONFIG_NET_KEY is not set
336CONFIG_INET=y
337CONFIG_IP_MULTICAST=y
338# CONFIG_IP_ADVANCED_ROUTER is not set
339# CONFIG_IP_PNP is not set
340# CONFIG_NET_IPIP is not set
341# CONFIG_NET_IPGRE is not set
342# CONFIG_IP_MROUTE is not set
343# CONFIG_ARPD is not set
344# CONFIG_SYN_COOKIES is not set
345# CONFIG_INET_AH is not set
346# CONFIG_INET_ESP is not set
347# CONFIG_INET_IPCOMP is not set
348# CONFIG_INET_TUNNEL is not set
349# CONFIG_IP_TCPDIAG is not set
350# CONFIG_IP_TCPDIAG_IPV6 is not set
351CONFIG_IPV6=m
352# CONFIG_IPV6_PRIVACY is not set
353# CONFIG_INET6_AH is not set
354# CONFIG_INET6_ESP is not set
355# CONFIG_INET6_IPCOMP is not set
356# CONFIG_INET6_TUNNEL is not set
357# CONFIG_IPV6_TUNNEL is not set
358# CONFIG_NETFILTER is not set
359
360#
361# SCTP Configuration (EXPERIMENTAL)
362#
363# CONFIG_IP_SCTP is not set
364# CONFIG_ATM is not set
365# CONFIG_BRIDGE is not set
366# CONFIG_VLAN_8021Q is not set
367# CONFIG_DECNET is not set
368# CONFIG_LLC2 is not set
369# CONFIG_IPX is not set
370# CONFIG_ATALK is not set
371# CONFIG_X25 is not set
372# CONFIG_LAPB is not set
373# CONFIG_NET_DIVERT is not set
374# CONFIG_ECONET is not set
375# CONFIG_WAN_ROUTER is not set
376
377#
378# QoS and/or fair queueing
379#
380# CONFIG_NET_SCHED is not set
381# CONFIG_NET_CLS_ROUTE is not set
382
383#
384# Network testing
385#
386# CONFIG_NET_PKTGEN is not set
387# CONFIG_NETPOLL is not set
388# CONFIG_NET_POLL_CONTROLLER is not set
389# CONFIG_HAMRADIO is not set
390# CONFIG_IRDA is not set
391# CONFIG_BT is not set
392CONFIG_NETDEVICES=y
393# CONFIG_DUMMY is not set
394# CONFIG_BONDING is not set
395# CONFIG_EQUALIZER is not set
396# CONFIG_TUN is not set
397# CONFIG_ETHERTAP is not set
398
399#
400# Ethernet (10 or 100Mbit)
401#
402CONFIG_NET_ETHERNET=y
403# CONFIG_MII is not set
404CONFIG_ARM_ETHER1=y
405CONFIG_ARM_ETHER3=y
406CONFIG_ARM_ETHERH=y
407# CONFIG_SMC91X is not set
408
409#
410# Ethernet (1000 Mbit)
411#
412
413#
414# Ethernet (10000 Mbit)
415#
416
417#
418# Token Ring devices
419#
420
421#
422# Wireless LAN (non-hamradio)
423#
424# CONFIG_NET_RADIO is not set
425
426#
427# Wan interfaces
428#
429# CONFIG_WAN is not set
430# CONFIG_PLIP is not set
431CONFIG_PPP=m
432# CONFIG_PPP_MULTILINK is not set
433# CONFIG_PPP_FILTER is not set
434# CONFIG_PPP_ASYNC is not set
435# CONFIG_PPP_SYNC_TTY is not set
436# CONFIG_PPP_DEFLATE is not set
437# CONFIG_PPP_BSDCOMP is not set
438CONFIG_PPPOE=m
439# CONFIG_SLIP is not set
440# CONFIG_SHAPER is not set
441# CONFIG_NETCONSOLE is not set
442
443#
444# ISDN subsystem
445#
446# CONFIG_ISDN is not set
447
448#
449# Input device support
450#
451CONFIG_INPUT=y
452
453#
454# Userland interfaces
455#
456CONFIG_INPUT_MOUSEDEV=y
457CONFIG_INPUT_MOUSEDEV_PSAUX=y
458CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
459CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
460# CONFIG_INPUT_JOYDEV is not set
461# CONFIG_INPUT_TSDEV is not set
462CONFIG_INPUT_EVDEV=y
463# CONFIG_INPUT_EVBUG is not set
464
465#
466# Input I/O drivers
467#
468# CONFIG_GAMEPORT is not set
469CONFIG_SOUND_GAMEPORT=y
470CONFIG_SERIO=y
471# CONFIG_SERIO_SERPORT is not set
472# CONFIG_SERIO_CT82C710 is not set
473# CONFIG_SERIO_PARKBD is not set
474CONFIG_SERIO_RPCKBD=y
475CONFIG_SERIO_LIBPS2=y
476# CONFIG_SERIO_RAW is not set
477
478#
479# Input Device Drivers
480#
481CONFIG_INPUT_KEYBOARD=y
482CONFIG_KEYBOARD_ATKBD=y
483# CONFIG_KEYBOARD_SUNKBD is not set
484# CONFIG_KEYBOARD_LKKBD is not set
485# CONFIG_KEYBOARD_XTKBD is not set
486# CONFIG_KEYBOARD_NEWTON is not set
487CONFIG_INPUT_MOUSE=y
488# CONFIG_MOUSE_PS2 is not set
489# CONFIG_MOUSE_SERIAL is not set
490CONFIG_MOUSE_RISCPC=y
491# CONFIG_MOUSE_VSXXXAA is not set
492# CONFIG_INPUT_JOYSTICK is not set
493# CONFIG_INPUT_TOUCHSCREEN is not set
494# CONFIG_INPUT_MISC 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#
507CONFIG_SERIAL_8250=y
508CONFIG_SERIAL_8250_CONSOLE=y
509CONFIG_SERIAL_8250_NR_UARTS=16
510# CONFIG_SERIAL_8250_EXTENDED is not set
511
512#
513# Non-8250 serial port support
514#
515CONFIG_SERIAL_8250_ACORN=y
516CONFIG_SERIAL_CORE=y
517CONFIG_SERIAL_CORE_CONSOLE=y
518CONFIG_UNIX98_PTYS=y
519CONFIG_LEGACY_PTYS=y
520CONFIG_LEGACY_PTY_COUNT=64
521CONFIG_PRINTER=m
522# CONFIG_LP_CONSOLE is not set
523# CONFIG_PPDEV is not set
524# CONFIG_TIPAR is not set
525
526#
527# IPMI
528#
529# CONFIG_IPMI_HANDLER is not set
530
531#
532# Watchdog Cards
533#
534# CONFIG_WATCHDOG is not set
535# CONFIG_NVRAM is not set
536# CONFIG_RTC is not set
537# CONFIG_DTLK is not set
538# CONFIG_R3964 is not set
539
540#
541# Ftape, the floppy tape device driver
542#
543# CONFIG_DRM is not set
544# CONFIG_RAW_DRIVER is not set
545
546#
547# I2C support
548#
549CONFIG_I2C=y
550CONFIG_I2C_CHARDEV=y
551
552#
553# I2C Algorithms
554#
555CONFIG_I2C_ALGOBIT=y
556# CONFIG_I2C_ALGOPCF is not set
557# CONFIG_I2C_ALGOPCA is not set
558
559#
560# I2C Hardware Bus support
561#
562# CONFIG_I2C_ISA is not set
563# CONFIG_I2C_PARPORT is not set
564# CONFIG_I2C_PARPORT_LIGHT is not set
565# CONFIG_I2C_STUB is not set
566# CONFIG_I2C_PCA_ISA is not set
567
568#
569# Hardware Sensors Chip support
570#
571# CONFIG_I2C_SENSOR is not set
572# CONFIG_SENSORS_ADM1021 is not set
573# CONFIG_SENSORS_ADM1025 is not set
574# CONFIG_SENSORS_ADM1026 is not set
575# CONFIG_SENSORS_ADM1031 is not set
576# CONFIG_SENSORS_ASB100 is not set
577# CONFIG_SENSORS_DS1621 is not set
578# CONFIG_SENSORS_FSCHER is not set
579# CONFIG_SENSORS_FSCPOS is not set
580# CONFIG_SENSORS_GL518SM is not set
581# CONFIG_SENSORS_GL520SM is not set
582# CONFIG_SENSORS_IT87 is not set
583# CONFIG_SENSORS_LM63 is not set
584# CONFIG_SENSORS_LM75 is not set
585# CONFIG_SENSORS_LM77 is not set
586# CONFIG_SENSORS_LM78 is not set
587# CONFIG_SENSORS_LM80 is not set
588# CONFIG_SENSORS_LM83 is not set
589# CONFIG_SENSORS_LM85 is not set
590# CONFIG_SENSORS_LM87 is not set
591# CONFIG_SENSORS_LM90 is not set
592# CONFIG_SENSORS_MAX1619 is not set
593# CONFIG_SENSORS_PC87360 is not set
594# CONFIG_SENSORS_SMSC47B397 is not set
595# CONFIG_SENSORS_SMSC47M1 is not set
596# CONFIG_SENSORS_W83781D is not set
597# CONFIG_SENSORS_W83L785TS is not set
598# CONFIG_SENSORS_W83627HF is not set
599
600#
601# Other I2C Chip support
602#
603# CONFIG_SENSORS_EEPROM is not set
604# CONFIG_SENSORS_PCF8574 is not set
605# CONFIG_SENSORS_PCF8591 is not set
606# CONFIG_SENSORS_RTC8564 is not set
607# CONFIG_I2C_DEBUG_CORE is not set
608# CONFIG_I2C_DEBUG_ALGO is not set
609# CONFIG_I2C_DEBUG_BUS is not set
610# CONFIG_I2C_DEBUG_CHIP is not set
611
612#
613# Misc devices
614#
615
616#
617# Multimedia devices
618#
619# CONFIG_VIDEO_DEV is not set
620
621#
622# Digital Video Broadcasting Devices
623#
624# CONFIG_DVB is not set
625
626#
627# Graphics support
628#
629CONFIG_FB=y
630# CONFIG_FB_MODE_HELPERS is not set
631# CONFIG_FB_TILEBLITTING is not set
632CONFIG_FB_ACORN=y
633# CONFIG_FB_VIRTUAL is not set
634
635#
636# Console display driver support
637#
638CONFIG_DUMMY_CONSOLE=y
639CONFIG_FRAMEBUFFER_CONSOLE=y
640CONFIG_FONTS=y
641# CONFIG_FONT_8x8 is not set
642CONFIG_FONT_8x16=y
643# CONFIG_FONT_6x11 is not set
644# CONFIG_FONT_PEARL_8x8 is not set
645CONFIG_FONT_ACORN_8x8=y
646# CONFIG_FONT_MINI_4x6 is not set
647# CONFIG_FONT_SUN8x16 is not set
648# CONFIG_FONT_SUN12x22 is not set
649
650#
651# Logo configuration
652#
653CONFIG_LOGO=y
654CONFIG_LOGO_LINUX_MONO=y
655CONFIG_LOGO_LINUX_VGA16=y
656CONFIG_LOGO_LINUX_CLUT224=y
657# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
658
659#
660# Sound
661#
662CONFIG_SOUND=m
663
664#
665# Advanced Linux Sound Architecture
666#
667# CONFIG_SND is not set
668
669#
670# Open Sound System
671#
672CONFIG_SOUND_PRIME=m
673# CONFIG_SOUND_BT878 is not set
674# CONFIG_SOUND_FUSION is not set
675# CONFIG_SOUND_CS4281 is not set
676# CONFIG_SOUND_SONICVIBES is not set
677# CONFIG_SOUND_TRIDENT is not set
678# CONFIG_SOUND_MSNDCLAS is not set
679# CONFIG_SOUND_MSNDPIN is not set
680CONFIG_SOUND_OSS=m
681# CONFIG_SOUND_TRACEINIT is not set
682# CONFIG_SOUND_DMAP is not set
683# CONFIG_SOUND_AD1816 is not set
684# CONFIG_SOUND_AD1889 is not set
685# CONFIG_SOUND_SGALAXY is not set
686# CONFIG_SOUND_ADLIB is not set
687# CONFIG_SOUND_ACI_MIXER is not set
688# CONFIG_SOUND_CS4232 is not set
689# CONFIG_SOUND_SSCAPE is not set
690# CONFIG_SOUND_GUS is not set
691# CONFIG_SOUND_VMIDI is not set
692# CONFIG_SOUND_TRIX is not set
693# CONFIG_SOUND_MSS is not set
694# CONFIG_SOUND_MPU401 is not set
695# CONFIG_SOUND_NM256 is not set
696# CONFIG_SOUND_MAD16 is not set
697# CONFIG_SOUND_PAS is not set
698# CONFIG_SOUND_PSS is not set
699# CONFIG_SOUND_SB is not set
700# CONFIG_SOUND_AWE32_SYNTH is not set
701# CONFIG_SOUND_WAVEFRONT is not set
702# CONFIG_SOUND_MAUI is not set
703# CONFIG_SOUND_YM3812 is not set
704# CONFIG_SOUND_OPL3SA1 is not set
705# CONFIG_SOUND_OPL3SA2 is not set
706# CONFIG_SOUND_UART6850 is not set
707# CONFIG_SOUND_AEDSP16 is not set
708CONFIG_SOUND_VIDC=m
709# CONFIG_SOUND_TVMIXER is not set
710# CONFIG_SOUND_AD1980 is not set
711
712#
713# USB support
714#
715# CONFIG_USB is not set
716CONFIG_USB_ARCH_HAS_HCD=y
717# CONFIG_USB_ARCH_HAS_OHCI is not set
718
719#
720# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
721#
722
723#
724# USB Gadget Support
725#
726# CONFIG_USB_GADGET is not set
727
728#
729# MMC/SD Card support
730#
731# CONFIG_MMC is not set
732
733#
734# File systems
735#
736CONFIG_EXT2_FS=y
737# CONFIG_EXT2_FS_XATTR is not set
738CONFIG_EXT3_FS=y
739CONFIG_EXT3_FS_XATTR=y
740# CONFIG_EXT3_FS_POSIX_ACL is not set
741# CONFIG_EXT3_FS_SECURITY is not set
742CONFIG_JBD=y
743# CONFIG_JBD_DEBUG is not set
744CONFIG_FS_MBCACHE=y
745# CONFIG_REISERFS_FS is not set
746# CONFIG_JFS_FS is not set
747
748#
749# XFS support
750#
751# CONFIG_XFS_FS is not set
752# CONFIG_MINIX_FS is not set
753# CONFIG_ROMFS_FS is not set
754# CONFIG_QUOTA is not set
755CONFIG_DNOTIFY=y
756# CONFIG_AUTOFS_FS is not set
757CONFIG_AUTOFS4_FS=m
758
759#
760# CD-ROM/DVD Filesystems
761#
762CONFIG_ISO9660_FS=y
763CONFIG_JOLIET=y
764# CONFIG_ZISOFS is not set
765# CONFIG_UDF_FS is not set
766
767#
768# DOS/FAT/NT Filesystems
769#
770CONFIG_FAT_FS=m
771CONFIG_MSDOS_FS=m
772CONFIG_VFAT_FS=m
773CONFIG_FAT_DEFAULT_CODEPAGE=437
774CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
775# CONFIG_NTFS_FS is not set
776
777#
778# Pseudo filesystems
779#
780CONFIG_PROC_FS=y
781CONFIG_SYSFS=y
782# CONFIG_DEVFS_FS is not set
783# CONFIG_DEVPTS_FS_XATTR is not set
784# CONFIG_TMPFS is not set
785# CONFIG_HUGETLB_PAGE is not set
786CONFIG_RAMFS=y
787
788#
789# Miscellaneous filesystems
790#
791CONFIG_ADFS_FS=y
792# CONFIG_ADFS_FS_RW is not set
793# CONFIG_AFFS_FS is not set
794# CONFIG_HFS_FS is not set
795# CONFIG_HFSPLUS_FS is not set
796# CONFIG_BEFS_FS is not set
797# CONFIG_BFS_FS is not set
798# CONFIG_EFS_FS is not set
799# CONFIG_CRAMFS is not set
800# CONFIG_VXFS_FS is not set
801# CONFIG_HPFS_FS is not set
802# CONFIG_QNX4FS_FS is not set
803# CONFIG_SYSV_FS is not set
804# CONFIG_UFS_FS is not set
805
806#
807# Network File Systems
808#
809CONFIG_NFS_FS=y
810# CONFIG_NFS_V3 is not set
811# CONFIG_NFS_V4 is not set
812# CONFIG_NFS_DIRECTIO is not set
813# CONFIG_NFSD is not set
814CONFIG_LOCKD=y
815CONFIG_SUNRPC=y
816# CONFIG_RPCSEC_GSS_KRB5 is not set
817# CONFIG_RPCSEC_GSS_SPKM3 is not set
818# CONFIG_SMB_FS is not set
819# CONFIG_CIFS is not set
820# CONFIG_NCP_FS is not set
821# CONFIG_CODA_FS is not set
822# CONFIG_AFS_FS is not set
823
824#
825# Partition Types
826#
827CONFIG_PARTITION_ADVANCED=y
828CONFIG_ACORN_PARTITION=y
829# CONFIG_ACORN_PARTITION_CUMANA is not set
830# CONFIG_ACORN_PARTITION_EESOX is not set
831CONFIG_ACORN_PARTITION_ICS=y
832CONFIG_ACORN_PARTITION_ADFS=y
833CONFIG_ACORN_PARTITION_POWERTEC=y
834CONFIG_ACORN_PARTITION_RISCIX=y
835CONFIG_OSF_PARTITION=y
836CONFIG_AMIGA_PARTITION=y
837# CONFIG_ATARI_PARTITION is not set
838CONFIG_MAC_PARTITION=y
839CONFIG_MSDOS_PARTITION=y
840CONFIG_BSD_DISKLABEL=y
841# CONFIG_MINIX_SUBPARTITION is not set
842CONFIG_SOLARIS_X86_PARTITION=y
843# CONFIG_UNIXWARE_DISKLABEL is not set
844# CONFIG_LDM_PARTITION is not set
845CONFIG_SGI_PARTITION=y
846# CONFIG_ULTRIX_PARTITION is not set
847CONFIG_SUN_PARTITION=y
848# CONFIG_EFI_PARTITION is not set
849
850#
851# Native Language Support
852#
853CONFIG_NLS=y
854CONFIG_NLS_DEFAULT="iso8859-1"
855CONFIG_NLS_CODEPAGE_437=m
856CONFIG_NLS_CODEPAGE_737=m
857CONFIG_NLS_CODEPAGE_775=m
858CONFIG_NLS_CODEPAGE_850=m
859CONFIG_NLS_CODEPAGE_852=m
860CONFIG_NLS_CODEPAGE_855=m
861CONFIG_NLS_CODEPAGE_857=m
862CONFIG_NLS_CODEPAGE_860=m
863CONFIG_NLS_CODEPAGE_861=m
864CONFIG_NLS_CODEPAGE_862=m
865CONFIG_NLS_CODEPAGE_863=m
866CONFIG_NLS_CODEPAGE_864=m
867CONFIG_NLS_CODEPAGE_865=m
868CONFIG_NLS_CODEPAGE_866=m
869CONFIG_NLS_CODEPAGE_869=m
870# CONFIG_NLS_CODEPAGE_936 is not set
871# CONFIG_NLS_CODEPAGE_950 is not set
872# CONFIG_NLS_CODEPAGE_932 is not set
873# CONFIG_NLS_CODEPAGE_949 is not set
874CONFIG_NLS_CODEPAGE_874=m
875CONFIG_NLS_ISO8859_8=m
876# CONFIG_NLS_CODEPAGE_1250 is not set
877# CONFIG_NLS_CODEPAGE_1251 is not set
878CONFIG_NLS_ASCII=y
879CONFIG_NLS_ISO8859_1=m
880CONFIG_NLS_ISO8859_2=m
881CONFIG_NLS_ISO8859_3=m
882CONFIG_NLS_ISO8859_4=m
883CONFIG_NLS_ISO8859_5=m
884CONFIG_NLS_ISO8859_6=m
885CONFIG_NLS_ISO8859_7=m
886CONFIG_NLS_ISO8859_9=m
887# CONFIG_NLS_ISO8859_13 is not set
888# CONFIG_NLS_ISO8859_14 is not set
889# CONFIG_NLS_ISO8859_15 is not set
890CONFIG_NLS_KOI8_R=m
891# CONFIG_NLS_KOI8_U is not set
892# CONFIG_NLS_UTF8 is not set
893
894#
895# Profiling support
896#
897# CONFIG_PROFILING is not set
898
899#
900# Kernel hacking
901#
902CONFIG_DEBUG_KERNEL=y
903CONFIG_MAGIC_SYSRQ=y
904# CONFIG_PRINTK_TIME is not set
905# CONFIG_SCHEDSTATS is not set
906# CONFIG_DEBUG_SLAB is not set
907# CONFIG_DEBUG_SPINLOCK is not set
908# CONFIG_DEBUG_KOBJECT is not set
909CONFIG_DEBUG_BUGVERBOSE=y
910# CONFIG_DEBUG_INFO is not set
911# CONFIG_DEBUG_FS is not set
912CONFIG_FRAME_POINTER=y
913CONFIG_DEBUG_USER=y
914# CONFIG_DEBUG_WAITQ is not set
915CONFIG_DEBUG_ERRORS=y
916CONFIG_DEBUG_LL=y
917# CONFIG_DEBUG_ICEDCC is not set
918
919#
920# Security options
921#
922# CONFIG_KEYS is not set
923# CONFIG_SECURITY is not set
924
925#
926# Cryptographic options
927#
928# CONFIG_CRYPTO is not set
929
930#
931# Hardware crypto devices
932#
933
934#
935# Library routines
936#
937# CONFIG_CRC_CCITT is not set
938CONFIG_CRC32=y
939# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
new file mode 100644
index 000000000000..2a63fb277196
--- /dev/null
+++ b/arch/arm/configs/s3c2410_defconfig
@@ -0,0 +1,954 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 17:47:45 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17# CONFIG_CLEAN_COMPILE is not set
18CONFIG_BROKEN=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
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
54# CONFIG_MODULE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set
57# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y
59
60#
61# System Type
62#
63# CONFIG_ARCH_CLPS7500 is not set
64# CONFIG_ARCH_CLPS711X is not set
65# CONFIG_ARCH_CO285 is not set
66# CONFIG_ARCH_EBSA110 is not set
67# CONFIG_ARCH_CAMELOT is not set
68# CONFIG_ARCH_FOOTBRIDGE is not set
69# CONFIG_ARCH_INTEGRATOR is not set
70# CONFIG_ARCH_IOP3XX is not set
71# CONFIG_ARCH_IXP4XX is not set
72# CONFIG_ARCH_IXP2000 is not set
73# CONFIG_ARCH_L7200 is not set
74# CONFIG_ARCH_PXA is not set
75# CONFIG_ARCH_RPC is not set
76# CONFIG_ARCH_SA1100 is not set
77CONFIG_ARCH_S3C2410=y
78# CONFIG_ARCH_SHARK is not set
79# CONFIG_ARCH_LH7A40X is not set
80# CONFIG_ARCH_OMAP is not set
81# CONFIG_ARCH_VERSATILE is not set
82# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set
84
85#
86# S3C24XX Implementations
87#
88CONFIG_ARCH_BAST=y
89CONFIG_ARCH_H1940=y
90CONFIG_MACH_N30=y
91CONFIG_ARCH_SMDK2410=y
92CONFIG_ARCH_S3C2440=y
93CONFIG_MACH_VR1000=y
94CONFIG_MACH_RX3715=y
95CONFIG_MACH_OTOM=y
96CONFIG_MACH_NEXCODER_2440=y
97CONFIG_CPU_S3C2410=y
98CONFIG_CPU_S3C2440=y
99
100#
101# S3C2410 Boot
102#
103# CONFIG_S3C2410_BOOT_WATCHDOG is not set
104
105#
106# S3C2410 Setup
107#
108CONFIG_S3C2410_DMA=y
109# CONFIG_S3C2410_DMA_DEBUG is not set
110# CONFIG_S3C2410_PM_DEBUG is not set
111# CONFIG_S3C2410_PM_CHECK is not set
112CONFIG_S3C2410_LOWLEVEL_UART_PORT=0
113
114#
115# Processor Type
116#
117CONFIG_CPU_32=y
118CONFIG_CPU_ARM920T=y
119CONFIG_CPU_32v4=y
120CONFIG_CPU_ABRT_EV4T=y
121CONFIG_CPU_CACHE_V4WT=y
122CONFIG_CPU_CACHE_VIVT=y
123CONFIG_CPU_COPY_V4WB=y
124CONFIG_CPU_TLB_V4WBI=y
125
126#
127# Processor Features
128#
129# CONFIG_ARM_THUMB is not set
130# CONFIG_CPU_ICACHE_DISABLE is not set
131# CONFIG_CPU_DCACHE_DISABLE is not set
132# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
133
134#
135# Bus support
136#
137
138#
139# PCCARD (PCMCIA/CardBus) support
140#
141# CONFIG_PCCARD is not set
142
143#
144# Kernel Features
145#
146# CONFIG_PREEMPT is not set
147CONFIG_ALIGNMENT_TRAP=y
148
149#
150# Boot options
151#
152CONFIG_ZBOOT_ROM_TEXT=0x0
153CONFIG_ZBOOT_ROM_BSS=0x0
154CONFIG_CMDLINE="root=/dev/hda1 ro init=/bin/bash console=ttySAC0"
155# CONFIG_XIP_KERNEL is not set
156
157#
158# Floating point emulation
159#
160
161#
162# At least one emulation must be selected
163#
164CONFIG_FPE_NWFPE=y
165# CONFIG_FPE_NWFPE_XP is not set
166# CONFIG_FPE_FASTFPE is not set
167
168#
169# Userspace binary formats
170#
171CONFIG_BINFMT_ELF=y
172CONFIG_BINFMT_AOUT=y
173# CONFIG_BINFMT_MISC is not set
174# CONFIG_ARTHUR is not set
175
176#
177# Power management options
178#
179CONFIG_PM=y
180CONFIG_APM=y
181
182#
183# Device Drivers
184#
185
186#
187# Generic Driver Options
188#
189CONFIG_STANDALONE=y
190CONFIG_PREVENT_FIRMWARE_BUILD=y
191# CONFIG_FW_LOADER is not set
192# CONFIG_DEBUG_DRIVER is not set
193
194#
195# Memory Technology Devices (MTD)
196#
197CONFIG_MTD=y
198# CONFIG_MTD_DEBUG is not set
199# CONFIG_MTD_CONCAT is not set
200CONFIG_MTD_PARTITIONS=y
201CONFIG_MTD_REDBOOT_PARTS=y
202CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
203CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
204# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
205CONFIG_MTD_CMDLINE_PARTS=y
206# CONFIG_MTD_AFS_PARTS is not set
207
208#
209# User Modules And Translation Layers
210#
211CONFIG_MTD_CHAR=y
212CONFIG_MTD_BLOCK=y
213# CONFIG_FTL is not set
214# CONFIG_NFTL is not set
215# CONFIG_INFTL is not set
216
217#
218# RAM/ROM/Flash chip drivers
219#
220CONFIG_MTD_CFI=y
221CONFIG_MTD_JEDECPROBE=y
222CONFIG_MTD_GEN_PROBE=y
223# CONFIG_MTD_CFI_ADV_OPTIONS is not set
224CONFIG_MTD_MAP_BANK_WIDTH_1=y
225CONFIG_MTD_MAP_BANK_WIDTH_2=y
226CONFIG_MTD_MAP_BANK_WIDTH_4=y
227# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
228CONFIG_MTD_MAP_BANK_WIDTH_16=y
229# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
230CONFIG_MTD_CFI_I1=y
231CONFIG_MTD_CFI_I2=y
232# CONFIG_MTD_CFI_I4 is not set
233# CONFIG_MTD_CFI_I8 is not set
234CONFIG_MTD_CFI_INTELEXT=y
235CONFIG_MTD_CFI_AMDSTD=y
236CONFIG_MTD_CFI_AMDSTD_RETRY=0
237# CONFIG_MTD_CFI_STAA is not set
238CONFIG_MTD_CFI_UTIL=y
239# CONFIG_MTD_RAM is not set
240CONFIG_MTD_ROM=y
241# CONFIG_MTD_ABSENT is not set
242# CONFIG_MTD_OBSOLETE_CHIPS is not set
243# CONFIG_MTD_XIP is not set
244
245#
246# Mapping drivers for chip access
247#
248# CONFIG_MTD_COMPLEX_MAPPINGS is not set
249# CONFIG_MTD_PHYSMAP is not set
250# CONFIG_MTD_ARM_INTEGRATOR is not set
251# CONFIG_MTD_EDB7312 is not set
252# CONFIG_MTD_IMPA7 is not set
253CONFIG_MTD_BAST=y
254CONFIG_MTD_BAST_MAXSIZE=4
255
256#
257# Self-contained MTD device drivers
258#
259# CONFIG_MTD_SLRAM is not set
260# CONFIG_MTD_PHRAM is not set
261# CONFIG_MTD_MTDRAM is not set
262# CONFIG_MTD_BLKMTD is not set
263# CONFIG_MTD_BLOCK2MTD is not set
264
265#
266# Disk-On-Chip Device Drivers
267#
268# CONFIG_MTD_DOC2000 is not set
269# CONFIG_MTD_DOC2001 is not set
270# CONFIG_MTD_DOC2001PLUS is not set
271
272#
273# NAND Flash Device Drivers
274#
275CONFIG_MTD_NAND=y
276# CONFIG_MTD_NAND_VERIFY_WRITE is not set
277CONFIG_MTD_NAND_IDS=y
278CONFIG_MTD_NAND_S3C2410=y
279# CONFIG_MTD_NAND_S3C2410_DEBUG is not set
280# CONFIG_MTD_NAND_S3C2410_HWECC is not set
281# CONFIG_MTD_NAND_DISKONCHIP is not set
282# CONFIG_MTD_NAND_NANDSIM is not set
283
284#
285# Parallel port support
286#
287CONFIG_PARPORT=y
288# CONFIG_PARPORT_PC is not set
289# CONFIG_PARPORT_ARC is not set
290# CONFIG_PARPORT_GSC is not set
291CONFIG_PARPORT_1284=y
292
293#
294# Plug and Play support
295#
296
297#
298# Block devices
299#
300# CONFIG_BLK_DEV_FD is not set
301# CONFIG_PARIDE is not set
302# CONFIG_BLK_DEV_COW_COMMON is not set
303CONFIG_BLK_DEV_LOOP=y
304# CONFIG_BLK_DEV_CRYPTOLOOP is not set
305CONFIG_BLK_DEV_NBD=m
306CONFIG_BLK_DEV_RAM=y
307CONFIG_BLK_DEV_RAM_COUNT=16
308CONFIG_BLK_DEV_RAM_SIZE=4096
309CONFIG_BLK_DEV_INITRD=y
310CONFIG_INITRAMFS_SOURCE=""
311# CONFIG_CDROM_PKTCDVD is not set
312
313#
314# IO Schedulers
315#
316CONFIG_IOSCHED_NOOP=y
317CONFIG_IOSCHED_AS=y
318CONFIG_IOSCHED_DEADLINE=y
319CONFIG_IOSCHED_CFQ=y
320CONFIG_ATA_OVER_ETH=m
321
322#
323# ATA/ATAPI/MFM/RLL support
324#
325CONFIG_IDE=y
326CONFIG_BLK_DEV_IDE=y
327
328#
329# Please see Documentation/ide.txt for help/info on IDE drives
330#
331# CONFIG_BLK_DEV_IDE_SATA is not set
332CONFIG_BLK_DEV_IDEDISK=y
333# CONFIG_IDEDISK_MULTI_MODE is not set
334CONFIG_BLK_DEV_IDECD=y
335CONFIG_BLK_DEV_IDETAPE=m
336CONFIG_BLK_DEV_IDEFLOPPY=m
337# CONFIG_IDE_TASK_IOCTL is not set
338
339#
340# IDE chipset support/bugfixes
341#
342CONFIG_IDE_GENERIC=y
343# CONFIG_IDE_ARM is not set
344CONFIG_BLK_DEV_IDE_BAST=y
345# CONFIG_BLK_DEV_IDEDMA is not set
346# CONFIG_IDEDMA_AUTO is not set
347# CONFIG_BLK_DEV_HD is not set
348
349#
350# SCSI device support
351#
352# CONFIG_SCSI is not set
353
354#
355# Multi-device support (RAID and LVM)
356#
357# CONFIG_MD is not set
358
359#
360# Fusion MPT device support
361#
362
363#
364# IEEE 1394 (FireWire) support
365#
366# CONFIG_IEEE1394 is not set
367
368#
369# I2O device support
370#
371
372#
373# Networking support
374#
375CONFIG_NET=y
376
377#
378# Networking options
379#
380# CONFIG_PACKET is not set
381# CONFIG_NETLINK_DEV is not set
382CONFIG_UNIX=y
383# CONFIG_NET_KEY is not set
384CONFIG_INET=y
385# CONFIG_IP_MULTICAST is not set
386# CONFIG_IP_ADVANCED_ROUTER is not set
387CONFIG_IP_PNP=y
388# CONFIG_IP_PNP_DHCP is not set
389CONFIG_IP_PNP_BOOTP=y
390# CONFIG_IP_PNP_RARP is not set
391# CONFIG_NET_IPIP is not set
392# CONFIG_NET_IPGRE is not set
393# CONFIG_ARPD is not set
394# CONFIG_SYN_COOKIES is not set
395# CONFIG_INET_AH is not set
396# CONFIG_INET_ESP is not set
397# CONFIG_INET_IPCOMP is not set
398# CONFIG_INET_TUNNEL is not set
399CONFIG_IP_TCPDIAG=y
400# CONFIG_IP_TCPDIAG_IPV6 is not set
401# CONFIG_IPV6 is not set
402# CONFIG_NETFILTER is not set
403
404#
405# SCTP Configuration (EXPERIMENTAL)
406#
407# CONFIG_IP_SCTP is not set
408# CONFIG_ATM is not set
409# CONFIG_BRIDGE is not set
410# CONFIG_VLAN_8021Q is not set
411# CONFIG_DECNET is not set
412# CONFIG_LLC2 is not set
413# CONFIG_IPX is not set
414# CONFIG_ATALK is not set
415# CONFIG_X25 is not set
416# CONFIG_LAPB is not set
417# CONFIG_NET_DIVERT is not set
418# CONFIG_ECONET is not set
419# CONFIG_WAN_ROUTER is not set
420
421#
422# QoS and/or fair queueing
423#
424# CONFIG_NET_SCHED is not set
425# CONFIG_NET_CLS_ROUTE is not set
426
427#
428# Network testing
429#
430# CONFIG_NET_PKTGEN is not set
431# CONFIG_NETPOLL is not set
432# CONFIG_NET_POLL_CONTROLLER is not set
433# CONFIG_HAMRADIO is not set
434# CONFIG_IRDA is not set
435# CONFIG_BT is not set
436CONFIG_NETDEVICES=y
437# CONFIG_DUMMY is not set
438# CONFIG_BONDING is not set
439# CONFIG_EQUALIZER is not set
440# CONFIG_TUN is not set
441
442#
443# Ethernet (10 or 100Mbit)
444#
445CONFIG_NET_ETHERNET=y
446# CONFIG_MII is not set
447# CONFIG_SMC91X is not set
448
449#
450# Ethernet (1000 Mbit)
451#
452
453#
454# Ethernet (10000 Mbit)
455#
456
457#
458# Token Ring devices
459#
460
461#
462# Wireless LAN (non-hamradio)
463#
464# CONFIG_NET_RADIO is not set
465
466#
467# Wan interfaces
468#
469# CONFIG_WAN is not set
470# CONFIG_PLIP is not set
471# CONFIG_PPP is not set
472# CONFIG_SLIP 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# Input device support
483#
484CONFIG_INPUT=y
485
486#
487# Userland interfaces
488#
489CONFIG_INPUT_MOUSEDEV=y
490CONFIG_INPUT_MOUSEDEV_PSAUX=y
491CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
492CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
493# CONFIG_INPUT_JOYDEV is not set
494# CONFIG_INPUT_TSDEV is not set
495# CONFIG_INPUT_EVDEV is not set
496# CONFIG_INPUT_EVBUG is not set
497
498#
499# Input Device Drivers
500#
501CONFIG_INPUT_KEYBOARD=y
502CONFIG_KEYBOARD_ATKBD=y
503# CONFIG_KEYBOARD_SUNKBD is not set
504# CONFIG_KEYBOARD_LKKBD is not set
505# CONFIG_KEYBOARD_XTKBD is not set
506# CONFIG_KEYBOARD_NEWTON is not set
507CONFIG_INPUT_MOUSE=y
508CONFIG_MOUSE_PS2=y
509# CONFIG_MOUSE_SERIAL is not set
510# CONFIG_MOUSE_VSXXXAA is not set
511# CONFIG_INPUT_JOYSTICK is not set
512# CONFIG_INPUT_TOUCHSCREEN is not set
513# CONFIG_INPUT_MISC is not set
514
515#
516# Hardware I/O ports
517#
518CONFIG_SERIO=y
519CONFIG_SERIO_SERPORT=y
520# CONFIG_SERIO_PARKBD is not set
521CONFIG_SERIO_LIBPS2=y
522# CONFIG_SERIO_RAW is not set
523# CONFIG_GAMEPORT is not set
524CONFIG_SOUND_GAMEPORT=y
525
526#
527# Character devices
528#
529CONFIG_VT=y
530CONFIG_VT_CONSOLE=y
531CONFIG_HW_CONSOLE=y
532CONFIG_SERIAL_NONSTANDARD=y
533# CONFIG_COMPUTONE is not set
534# CONFIG_ROCKETPORT is not set
535# CONFIG_CYCLADES is not set
536# CONFIG_DIGIEPCA is not set
537# CONFIG_MOXA_INTELLIO is not set
538# CONFIG_MOXA_SMARTIO is not set
539# CONFIG_ISI is not set
540# CONFIG_SYNCLINKMP is not set
541# CONFIG_N_HDLC is not set
542# CONFIG_RISCOM8 is not set
543# CONFIG_SPECIALIX is not set
544# CONFIG_SX is not set
545# CONFIG_RIO is not set
546# CONFIG_STALDRV is not set
547
548#
549# Serial drivers
550#
551CONFIG_SERIAL_8250=y
552CONFIG_SERIAL_8250_CONSOLE=y
553CONFIG_SERIAL_8250_NR_UARTS=8
554CONFIG_SERIAL_8250_EXTENDED=y
555CONFIG_SERIAL_8250_MANY_PORTS=y
556CONFIG_SERIAL_8250_SHARE_IRQ=y
557# CONFIG_SERIAL_8250_DETECT_IRQ is not set
558# CONFIG_SERIAL_8250_MULTIPORT is not set
559# CONFIG_SERIAL_8250_RSA is not set
560
561#
562# Non-8250 serial port support
563#
564CONFIG_SERIAL_S3C2410=y
565CONFIG_SERIAL_S3C2410_CONSOLE=y
566CONFIG_SERIAL_BAST_SIO=y
567CONFIG_SERIAL_CORE=y
568CONFIG_SERIAL_CORE_CONSOLE=y
569CONFIG_UNIX98_PTYS=y
570CONFIG_LEGACY_PTYS=y
571CONFIG_LEGACY_PTY_COUNT=256
572CONFIG_PRINTER=y
573# CONFIG_LP_CONSOLE is not set
574CONFIG_PPDEV=y
575# CONFIG_TIPAR is not set
576
577#
578# IPMI
579#
580# CONFIG_IPMI_HANDLER is not set
581
582#
583# Watchdog Cards
584#
585CONFIG_WATCHDOG=y
586# CONFIG_WATCHDOG_NOWAYOUT is not set
587
588#
589# Watchdog Device Drivers
590#
591# CONFIG_SOFT_WATCHDOG is not set
592CONFIG_S3C2410_WATCHDOG=y
593# CONFIG_NVRAM is not set
594# CONFIG_RTC is not set
595CONFIG_S3C2410_RTC=y
596# CONFIG_DTLK is not set
597# CONFIG_R3964 is not set
598
599#
600# Ftape, the floppy tape device driver
601#
602# CONFIG_DRM is not set
603# CONFIG_RAW_DRIVER is not set
604
605#
606# TPM devices
607#
608# CONFIG_TCG_TPM is not set
609
610#
611# I2C support
612#
613CONFIG_I2C=y
614CONFIG_I2C_CHARDEV=m
615
616#
617# I2C Algorithms
618#
619CONFIG_I2C_ALGOBIT=m
620# CONFIG_I2C_ALGOPCF is not set
621# CONFIG_I2C_ALGOPCA is not set
622
623#
624# I2C Hardware Bus support
625#
626# CONFIG_I2C_ISA is not set
627# CONFIG_I2C_PARPORT is not set
628# CONFIG_I2C_PARPORT_LIGHT is not set
629CONFIG_I2C_S3C2410=y
630# CONFIG_I2C_STUB is not set
631# CONFIG_I2C_PCA_ISA is not set
632
633#
634# Hardware Sensors Chip support
635#
636CONFIG_I2C_SENSOR=m
637# CONFIG_SENSORS_ADM1021 is not set
638# CONFIG_SENSORS_ADM1025 is not set
639# CONFIG_SENSORS_ADM1026 is not set
640# CONFIG_SENSORS_ADM1031 is not set
641# CONFIG_SENSORS_ASB100 is not set
642# CONFIG_SENSORS_DS1621 is not set
643# CONFIG_SENSORS_FSCHER is not set
644# CONFIG_SENSORS_FSCPOS is not set
645# CONFIG_SENSORS_GL518SM is not set
646# CONFIG_SENSORS_GL520SM is not set
647# CONFIG_SENSORS_IT87 is not set
648# CONFIG_SENSORS_LM63 is not set
649CONFIG_SENSORS_LM75=m
650# CONFIG_SENSORS_LM77 is not set
651CONFIG_SENSORS_LM78=m
652# CONFIG_SENSORS_LM80 is not set
653# CONFIG_SENSORS_LM83 is not set
654CONFIG_SENSORS_LM85=m
655# CONFIG_SENSORS_LM87 is not set
656# CONFIG_SENSORS_LM90 is not set
657# CONFIG_SENSORS_MAX1619 is not set
658# CONFIG_SENSORS_PC87360 is not set
659# CONFIG_SENSORS_SMSC47B397 is not set
660# CONFIG_SENSORS_SMSC47M1 is not set
661# CONFIG_SENSORS_W83781D is not set
662# CONFIG_SENSORS_W83L785TS is not set
663# CONFIG_SENSORS_W83627HF is not set
664
665#
666# Other I2C Chip support
667#
668CONFIG_SENSORS_EEPROM=m
669# CONFIG_SENSORS_PCF8574 is not set
670# CONFIG_SENSORS_PCF8591 is not set
671# CONFIG_SENSORS_RTC8564 is not set
672# CONFIG_I2C_DEBUG_CORE is not set
673# CONFIG_I2C_DEBUG_ALGO is not set
674# CONFIG_I2C_DEBUG_BUS is not set
675# CONFIG_I2C_DEBUG_CHIP is not set
676
677#
678# Misc devices
679#
680
681#
682# Multimedia devices
683#
684# CONFIG_VIDEO_DEV is not set
685
686#
687# Digital Video Broadcasting Devices
688#
689# CONFIG_DVB is not set
690
691#
692# Graphics support
693#
694CONFIG_FB=y
695# CONFIG_FB_CFB_FILLRECT is not set
696# CONFIG_FB_CFB_COPYAREA is not set
697# CONFIG_FB_CFB_IMAGEBLIT is not set
698# CONFIG_FB_SOFT_CURSOR is not set
699CONFIG_FB_MODE_HELPERS=y
700# CONFIG_FB_TILEBLITTING is not set
701# CONFIG_FB_VIRTUAL is not set
702
703#
704# Console display driver support
705#
706# CONFIG_VGA_CONSOLE is not set
707CONFIG_DUMMY_CONSOLE=y
708# CONFIG_FRAMEBUFFER_CONSOLE is not set
709
710#
711# Logo configuration
712#
713# CONFIG_LOGO is not set
714# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
715
716#
717# Sound
718#
719# CONFIG_SOUND is not set
720
721#
722# USB support
723#
724CONFIG_USB_ARCH_HAS_HCD=y
725# CONFIG_USB_ARCH_HAS_OHCI is not set
726# CONFIG_USB is not set
727
728#
729# USB Gadget Support
730#
731# CONFIG_USB_GADGET is not set
732
733#
734# MMC/SD Card support
735#
736# CONFIG_MMC is not set
737
738#
739# File systems
740#
741CONFIG_EXT2_FS=y
742# CONFIG_EXT2_FS_XATTR is not set
743CONFIG_EXT3_FS=y
744CONFIG_EXT3_FS_XATTR=y
745# CONFIG_EXT3_FS_POSIX_ACL is not set
746# CONFIG_EXT3_FS_SECURITY is not set
747CONFIG_JBD=y
748# CONFIG_JBD_DEBUG is not set
749CONFIG_FS_MBCACHE=y
750# CONFIG_REISERFS_FS is not set
751# CONFIG_JFS_FS is not set
752
753#
754# XFS support
755#
756# CONFIG_XFS_FS is not set
757# CONFIG_MINIX_FS is not set
758CONFIG_ROMFS_FS=y
759# CONFIG_QUOTA is not set
760CONFIG_DNOTIFY=y
761# CONFIG_AUTOFS_FS is not set
762# CONFIG_AUTOFS4_FS is not set
763
764#
765# CD-ROM/DVD Filesystems
766#
767# CONFIG_ISO9660_FS is not set
768# CONFIG_UDF_FS is not set
769
770#
771# DOS/FAT/NT Filesystems
772#
773CONFIG_FAT_FS=y
774CONFIG_MSDOS_FS=y
775CONFIG_VFAT_FS=y
776CONFIG_FAT_DEFAULT_CODEPAGE=437
777CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
778# CONFIG_NTFS_FS is not set
779
780#
781# Pseudo filesystems
782#
783CONFIG_PROC_FS=y
784CONFIG_SYSFS=y
785# CONFIG_DEVFS_FS is not set
786# CONFIG_DEVPTS_FS_XATTR is not set
787# CONFIG_TMPFS is not set
788# CONFIG_HUGETLBFS is not set
789# CONFIG_HUGETLB_PAGE is not set
790CONFIG_RAMFS=y
791
792#
793# Miscellaneous filesystems
794#
795# CONFIG_ADFS_FS is not set
796# CONFIG_AFFS_FS is not set
797# CONFIG_HFS_FS is not set
798# CONFIG_HFSPLUS_FS is not set
799# CONFIG_BEFS_FS is not set
800# CONFIG_BFS_FS is not set
801# CONFIG_EFS_FS is not set
802CONFIG_JFFS_FS=y
803CONFIG_JFFS_FS_VERBOSE=0
804# CONFIG_JFFS_PROC_FS is not set
805CONFIG_JFFS2_FS=y
806CONFIG_JFFS2_FS_DEBUG=0
807# CONFIG_JFFS2_FS_NAND is not set
808# CONFIG_JFFS2_FS_NOR_ECC is not set
809# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
810CONFIG_JFFS2_ZLIB=y
811CONFIG_JFFS2_RTIME=y
812# CONFIG_JFFS2_RUBIN is not set
813# CONFIG_CRAMFS is not set
814# CONFIG_VXFS_FS is not set
815# CONFIG_HPFS_FS is not set
816# CONFIG_QNX4FS_FS is not set
817# CONFIG_SYSV_FS is not set
818# CONFIG_UFS_FS is not set
819
820#
821# Network File Systems
822#
823CONFIG_NFS_FS=y
824# CONFIG_NFS_V3 is not set
825# CONFIG_NFS_V4 is not set
826# CONFIG_NFS_DIRECTIO is not set
827# CONFIG_NFSD is not set
828CONFIG_ROOT_NFS=y
829CONFIG_LOCKD=y
830CONFIG_SUNRPC=y
831# CONFIG_RPCSEC_GSS_KRB5 is not set
832# CONFIG_RPCSEC_GSS_SPKM3 is not set
833# CONFIG_SMB_FS is not set
834# CONFIG_CIFS is not set
835# CONFIG_NCP_FS is not set
836# CONFIG_CODA_FS is not set
837# CONFIG_AFS_FS is not set
838
839#
840# Partition Types
841#
842CONFIG_PARTITION_ADVANCED=y
843# CONFIG_ACORN_PARTITION is not set
844# CONFIG_OSF_PARTITION is not set
845# CONFIG_AMIGA_PARTITION is not set
846# CONFIG_ATARI_PARTITION is not set
847# CONFIG_MAC_PARTITION is not set
848CONFIG_MSDOS_PARTITION=y
849CONFIG_BSD_DISKLABEL=y
850# CONFIG_MINIX_SUBPARTITION is not set
851CONFIG_SOLARIS_X86_PARTITION=y
852# CONFIG_UNIXWARE_DISKLABEL is not set
853# CONFIG_LDM_PARTITION is not set
854# CONFIG_SGI_PARTITION is not set
855# CONFIG_ULTRIX_PARTITION is not set
856# CONFIG_SUN_PARTITION is not set
857# CONFIG_EFI_PARTITION is not set
858
859#
860# Native Language Support
861#
862CONFIG_NLS=y
863CONFIG_NLS_DEFAULT="iso8859-1"
864# CONFIG_NLS_CODEPAGE_437 is not set
865# CONFIG_NLS_CODEPAGE_737 is not set
866# CONFIG_NLS_CODEPAGE_775 is not set
867# CONFIG_NLS_CODEPAGE_850 is not set
868# CONFIG_NLS_CODEPAGE_852 is not set
869# CONFIG_NLS_CODEPAGE_855 is not set
870# CONFIG_NLS_CODEPAGE_857 is not set
871# CONFIG_NLS_CODEPAGE_860 is not set
872# CONFIG_NLS_CODEPAGE_861 is not set
873# CONFIG_NLS_CODEPAGE_862 is not set
874# CONFIG_NLS_CODEPAGE_863 is not set
875# CONFIG_NLS_CODEPAGE_864 is not set
876# CONFIG_NLS_CODEPAGE_865 is not set
877# CONFIG_NLS_CODEPAGE_866 is not set
878# CONFIG_NLS_CODEPAGE_869 is not set
879# CONFIG_NLS_CODEPAGE_936 is not set
880# CONFIG_NLS_CODEPAGE_950 is not set
881# CONFIG_NLS_CODEPAGE_932 is not set
882# CONFIG_NLS_CODEPAGE_949 is not set
883# CONFIG_NLS_CODEPAGE_874 is not set
884# CONFIG_NLS_ISO8859_8 is not set
885# CONFIG_NLS_CODEPAGE_1250 is not set
886# CONFIG_NLS_CODEPAGE_1251 is not set
887# CONFIG_NLS_ASCII is not set
888# CONFIG_NLS_ISO8859_1 is not set
889# CONFIG_NLS_ISO8859_2 is not set
890# CONFIG_NLS_ISO8859_3 is not set
891# CONFIG_NLS_ISO8859_4 is not set
892# CONFIG_NLS_ISO8859_5 is not set
893# CONFIG_NLS_ISO8859_6 is not set
894# CONFIG_NLS_ISO8859_7 is not set
895# CONFIG_NLS_ISO8859_9 is not set
896# CONFIG_NLS_ISO8859_13 is not set
897# CONFIG_NLS_ISO8859_14 is not set
898# CONFIG_NLS_ISO8859_15 is not set
899# CONFIG_NLS_KOI8_R is not set
900# CONFIG_NLS_KOI8_U is not set
901# CONFIG_NLS_UTF8 is not set
902
903#
904# Profiling support
905#
906# CONFIG_PROFILING is not set
907
908#
909# Kernel hacking
910#
911# CONFIG_PRINTK_TIME is not set
912CONFIG_DEBUG_KERNEL=y
913# CONFIG_MAGIC_SYSRQ is not set
914CONFIG_LOG_BUF_SHIFT=16
915# CONFIG_SCHEDSTATS is not set
916# CONFIG_DEBUG_SLAB is not set
917# CONFIG_DEBUG_SPINLOCK is not set
918# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
919# CONFIG_DEBUG_KOBJECT is not set
920CONFIG_DEBUG_BUGVERBOSE=y
921CONFIG_DEBUG_INFO=y
922# CONFIG_DEBUG_FS is not set
923CONFIG_FRAME_POINTER=y
924CONFIG_DEBUG_USER=y
925# CONFIG_DEBUG_WAITQ is not set
926# CONFIG_DEBUG_ERRORS is not set
927CONFIG_DEBUG_LL=y
928# CONFIG_DEBUG_ICEDCC is not set
929CONFIG_DEBUG_S3C2410_PORT=y
930CONFIG_DEBUG_S3C2410_UART=0
931
932#
933# Security options
934#
935# CONFIG_KEYS is not set
936# CONFIG_SECURITY is not set
937
938#
939# Cryptographic options
940#
941# CONFIG_CRYPTO is not set
942
943#
944# Hardware crypto devices
945#
946
947#
948# Library routines
949#
950# CONFIG_CRC_CCITT is not set
951CONFIG_CRC32=y
952# CONFIG_LIBCRC32C is not set
953CONFIG_ZLIB_INFLATE=y
954CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/shannon_defconfig b/arch/arm/configs/shannon_defconfig
new file mode 100644
index 000000000000..e3facc4fe792
--- /dev/null
+++ b/arch/arm/configs/shannon_defconfig
@@ -0,0 +1,872 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 23:26:46 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51CONFIG_MODULES=y
52# CONFIG_MODULE_UNLOAD is not set
53CONFIG_OBSOLETE_MODPARM=y
54# CONFIG_MODVERSIONS is not set
55# CONFIG_MODULE_SRCVERSION_ALL is not set
56# CONFIG_KMOD is not set
57
58#
59# System Type
60#
61# CONFIG_ARCH_CLPS7500 is not set
62# CONFIG_ARCH_CLPS711X is not set
63# CONFIG_ARCH_CO285 is not set
64# CONFIG_ARCH_EBSA110 is not set
65# CONFIG_ARCH_CAMELOT is not set
66# CONFIG_ARCH_FOOTBRIDGE is not set
67# CONFIG_ARCH_INTEGRATOR is not set
68# CONFIG_ARCH_IOP3XX is not set
69# CONFIG_ARCH_IXP4XX is not set
70# CONFIG_ARCH_IXP2000 is not set
71# CONFIG_ARCH_L7200 is not set
72# CONFIG_ARCH_PXA is not set
73# CONFIG_ARCH_RPC is not set
74CONFIG_ARCH_SA1100=y
75# CONFIG_ARCH_S3C2410 is not set
76# CONFIG_ARCH_SHARK is not set
77# CONFIG_ARCH_LH7A40X is not set
78# CONFIG_ARCH_OMAP is not set
79# CONFIG_ARCH_VERSATILE is not set
80# CONFIG_ARCH_IMX is not set
81# CONFIG_ARCH_H720X is not set
82
83#
84# SA11x0 Implementations
85#
86# CONFIG_SA1100_ASSABET is not set
87# CONFIG_SA1100_CERF is not set
88# CONFIG_SA1100_COLLIE is not set
89# CONFIG_SA1100_H3100 is not set
90# CONFIG_SA1100_H3600 is not set
91# CONFIG_SA1100_H3800 is not set
92# CONFIG_SA1100_BADGE4 is not set
93# CONFIG_SA1100_JORNADA720 is not set
94# CONFIG_SA1100_HACKKIT is not set
95# CONFIG_SA1100_LART is not set
96# CONFIG_SA1100_PLEB is not set
97CONFIG_SA1100_SHANNON=y
98# CONFIG_SA1100_SIMPAD is not set
99# CONFIG_SA1100_SSP is not set
100
101#
102# Processor Type
103#
104CONFIG_CPU_32=y
105CONFIG_CPU_SA1100=y
106CONFIG_CPU_32v4=y
107CONFIG_CPU_ABRT_EV4=y
108CONFIG_CPU_CACHE_V4WB=y
109CONFIG_CPU_CACHE_VIVT=y
110CONFIG_CPU_TLB_V4WB=y
111CONFIG_CPU_MINICACHE=y
112
113#
114# Processor Features
115#
116
117#
118# Bus support
119#
120CONFIG_ISA=y
121
122#
123# PCCARD (PCMCIA/CardBus) support
124#
125CONFIG_PCCARD=y
126# CONFIG_PCMCIA_DEBUG is not set
127CONFIG_PCMCIA=y
128
129#
130# PC-card bridges
131#
132# CONFIG_I82365 is not set
133# CONFIG_TCIC is not set
134CONFIG_PCMCIA_SA1100=y
135
136#
137# Kernel Features
138#
139# CONFIG_PREEMPT is not set
140CONFIG_DISCONTIGMEM=y
141# CONFIG_LEDS is not set
142CONFIG_ALIGNMENT_TRAP=y
143
144#
145# Boot options
146#
147CONFIG_ZBOOT_ROM_TEXT=0x0
148CONFIG_ZBOOT_ROM_BSS=0x0
149CONFIG_CMDLINE="console=ttySA0,9600 console=tty1 root=/dev/mtdblock2 init=/linuxrc"
150# CONFIG_XIP_KERNEL is not set
151
152#
153# CPU Frequency scaling
154#
155# CONFIG_CPU_FREQ is not set
156
157#
158# Floating point emulation
159#
160
161#
162# At least one emulation must be selected
163#
164CONFIG_FPE_NWFPE=y
165# CONFIG_FPE_NWFPE_XP is not set
166# CONFIG_FPE_FASTFPE is not set
167
168#
169# Userspace binary formats
170#
171CONFIG_BINFMT_ELF=y
172# CONFIG_BINFMT_AOUT is not set
173# CONFIG_BINFMT_MISC is not set
174# CONFIG_ARTHUR is not set
175
176#
177# Power management options
178#
179# CONFIG_PM is not set
180
181#
182# Device Drivers
183#
184
185#
186# Generic Driver Options
187#
188CONFIG_STANDALONE=y
189CONFIG_PREVENT_FIRMWARE_BUILD=y
190# CONFIG_FW_LOADER is not set
191
192#
193# Memory Technology Devices (MTD)
194#
195CONFIG_MTD=y
196# CONFIG_MTD_DEBUG is not set
197# CONFIG_MTD_CONCAT is not set
198CONFIG_MTD_PARTITIONS=y
199# CONFIG_MTD_REDBOOT_PARTS is not set
200# CONFIG_MTD_CMDLINE_PARTS is not set
201# CONFIG_MTD_AFS_PARTS is not set
202
203#
204# User Modules And Translation Layers
205#
206CONFIG_MTD_CHAR=y
207CONFIG_MTD_BLOCK=y
208# CONFIG_FTL is not set
209# CONFIG_NFTL is not set
210# CONFIG_INFTL is not set
211
212#
213# RAM/ROM/Flash chip drivers
214#
215CONFIG_MTD_CFI=y
216# CONFIG_MTD_JEDECPROBE is not set
217CONFIG_MTD_GEN_PROBE=y
218# CONFIG_MTD_CFI_ADV_OPTIONS is not set
219CONFIG_MTD_MAP_BANK_WIDTH_1=y
220CONFIG_MTD_MAP_BANK_WIDTH_2=y
221CONFIG_MTD_MAP_BANK_WIDTH_4=y
222# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
223# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
224# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
225CONFIG_MTD_CFI_I1=y
226CONFIG_MTD_CFI_I2=y
227# CONFIG_MTD_CFI_I4 is not set
228# CONFIG_MTD_CFI_I8 is not set
229# CONFIG_MTD_CFI_INTELEXT is not set
230CONFIG_MTD_CFI_AMDSTD=y
231CONFIG_MTD_CFI_AMDSTD_RETRY=0
232# CONFIG_MTD_CFI_STAA is not set
233CONFIG_MTD_CFI_UTIL=y
234# CONFIG_MTD_RAM is not set
235# CONFIG_MTD_ROM is not set
236# CONFIG_MTD_ABSENT is not set
237
238#
239# Mapping drivers for chip access
240#
241# CONFIG_MTD_COMPLEX_MAPPINGS is not set
242# CONFIG_MTD_PHYSMAP is not set
243# CONFIG_MTD_ARM_INTEGRATOR is not set
244CONFIG_MTD_SA1100=y
245# CONFIG_MTD_EDB7312 is not set
246
247#
248# Self-contained MTD device drivers
249#
250# CONFIG_MTD_SLRAM is not set
251# CONFIG_MTD_PHRAM is not set
252# CONFIG_MTD_MTDRAM is not set
253# CONFIG_MTD_BLKMTD is not set
254# CONFIG_MTD_BLOCK2MTD is not set
255
256#
257# Disk-On-Chip Device Drivers
258#
259# CONFIG_MTD_DOC2000 is not set
260# CONFIG_MTD_DOC2001 is not set
261# CONFIG_MTD_DOC2001PLUS is not set
262
263#
264# NAND Flash Device Drivers
265#
266# CONFIG_MTD_NAND 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# CONFIG_PNP is not set
277
278#
279# Block devices
280#
281# CONFIG_BLK_DEV_FD is not set
282# CONFIG_BLK_DEV_XD is not set
283# CONFIG_BLK_DEV_COW_COMMON is not set
284# CONFIG_BLK_DEV_LOOP is not set
285# CONFIG_BLK_DEV_NBD is not set
286CONFIG_BLK_DEV_RAM=y
287CONFIG_BLK_DEV_RAM_COUNT=16
288CONFIG_BLK_DEV_RAM_SIZE=8192
289CONFIG_BLK_DEV_INITRD=y
290CONFIG_INITRAMFS_SOURCE=""
291# CONFIG_CDROM_PKTCDVD is not set
292
293#
294# IO Schedulers
295#
296CONFIG_IOSCHED_NOOP=y
297CONFIG_IOSCHED_AS=y
298CONFIG_IOSCHED_DEADLINE=y
299CONFIG_IOSCHED_CFQ=y
300# CONFIG_ATA_OVER_ETH is not set
301
302#
303# ATA/ATAPI/MFM/RLL support
304#
305CONFIG_IDE=m
306CONFIG_BLK_DEV_IDE=m
307
308#
309# Please see Documentation/ide.txt for help/info on IDE drives
310#
311# CONFIG_BLK_DEV_IDE_SATA is not set
312# CONFIG_BLK_DEV_IDEDISK is not set
313# CONFIG_IDEDISK_MULTI_MODE is not set
314# CONFIG_BLK_DEV_IDECS is not set
315# CONFIG_BLK_DEV_IDECD is not set
316# CONFIG_BLK_DEV_IDETAPE is not set
317# CONFIG_BLK_DEV_IDEFLOPPY is not set
318# CONFIG_IDE_TASK_IOCTL is not set
319
320#
321# IDE chipset support/bugfixes
322#
323CONFIG_IDE_GENERIC=m
324# CONFIG_IDE_ARM is not set
325# CONFIG_IDE_CHIPSETS is not set
326# CONFIG_BLK_DEV_IDEDMA is not set
327# CONFIG_IDEDMA_AUTO is not set
328# CONFIG_BLK_DEV_HD is not set
329
330#
331# SCSI device support
332#
333# CONFIG_SCSI is not set
334
335#
336# Multi-device support (RAID and LVM)
337#
338# CONFIG_MD is not set
339
340#
341# Fusion MPT device support
342#
343
344#
345# IEEE 1394 (FireWire) support
346#
347
348#
349# I2O device support
350#
351
352#
353# Networking support
354#
355CONFIG_NET=y
356
357#
358# Networking options
359#
360CONFIG_PACKET=y
361CONFIG_PACKET_MMAP=y
362# CONFIG_NETLINK_DEV is not set
363CONFIG_UNIX=y
364# CONFIG_NET_KEY is not set
365CONFIG_INET=y
366# CONFIG_IP_MULTICAST is not set
367# CONFIG_IP_ADVANCED_ROUTER is not set
368# CONFIG_IP_PNP is not set
369# CONFIG_NET_IPIP is not set
370# CONFIG_NET_IPGRE is not set
371# CONFIG_ARPD is not set
372# CONFIG_SYN_COOKIES is not set
373# CONFIG_INET_AH is not set
374# CONFIG_INET_ESP is not set
375# CONFIG_INET_IPCOMP is not set
376# CONFIG_INET_TUNNEL is not set
377# CONFIG_IP_TCPDIAG is not set
378# CONFIG_IP_TCPDIAG_IPV6 is not set
379# CONFIG_IPV6 is not set
380# CONFIG_NETFILTER is not set
381
382#
383# SCTP Configuration (EXPERIMENTAL)
384#
385# CONFIG_IP_SCTP is not set
386# CONFIG_ATM is not set
387# CONFIG_BRIDGE is not set
388# CONFIG_VLAN_8021Q is not set
389# CONFIG_DECNET is not set
390# CONFIG_LLC2 is not set
391# CONFIG_IPX is not set
392# CONFIG_ATALK is not set
393# CONFIG_X25 is not set
394# CONFIG_LAPB is not set
395# CONFIG_NET_DIVERT is not set
396# CONFIG_ECONET is not set
397# CONFIG_WAN_ROUTER 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_NET_VENDOR_3COM is not set
431# CONFIG_LANCE is not set
432# CONFIG_NET_VENDOR_SMC is not set
433# CONFIG_SMC91X is not set
434# CONFIG_NET_VENDOR_RACAL is not set
435# CONFIG_AT1700 is not set
436# CONFIG_DEPCA is not set
437# CONFIG_HP100 is not set
438# CONFIG_NET_ISA is not set
439# CONFIG_NET_PCI is not set
440# CONFIG_NET_POCKET is not set
441
442#
443# Ethernet (1000 Mbit)
444#
445
446#
447# Ethernet (10000 Mbit)
448#
449
450#
451# Token Ring devices
452#
453# CONFIG_TR is not set
454
455#
456# Wireless LAN (non-hamradio)
457#
458# CONFIG_NET_RADIO is not set
459
460#
461# PCMCIA network device support
462#
463CONFIG_NET_PCMCIA=y
464# CONFIG_PCMCIA_3C589 is not set
465# CONFIG_PCMCIA_3C574 is not set
466# CONFIG_PCMCIA_FMVJ18X is not set
467CONFIG_PCMCIA_PCNET=y
468# CONFIG_PCMCIA_NMCLAN is not set
469CONFIG_PCMCIA_SMC91C92=y
470# CONFIG_PCMCIA_XIRC2PS is not set
471# CONFIG_PCMCIA_AXNET is not set
472
473#
474# Wan interfaces
475#
476# CONFIG_WAN is not set
477# CONFIG_PPP is not set
478# CONFIG_SLIP is not set
479# CONFIG_SHAPER is not set
480# CONFIG_NETCONSOLE is not set
481
482#
483# ISDN subsystem
484#
485# CONFIG_ISDN is not set
486
487#
488# Input device support
489#
490CONFIG_INPUT=y
491
492#
493# Userland interfaces
494#
495CONFIG_INPUT_MOUSEDEV=y
496CONFIG_INPUT_MOUSEDEV_PSAUX=y
497CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
498CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
499# CONFIG_INPUT_JOYDEV is not set
500# CONFIG_INPUT_TSDEV is not set
501# CONFIG_INPUT_EVDEV is not set
502# CONFIG_INPUT_EVBUG is not set
503
504#
505# Input Device Drivers
506#
507CONFIG_INPUT_KEYBOARD=y
508CONFIG_KEYBOARD_ATKBD=y
509# CONFIG_KEYBOARD_SUNKBD is not set
510# CONFIG_KEYBOARD_LKKBD is not set
511# CONFIG_KEYBOARD_XTKBD is not set
512# CONFIG_KEYBOARD_NEWTON is not set
513CONFIG_INPUT_MOUSE=y
514CONFIG_MOUSE_PS2=y
515# CONFIG_MOUSE_SERIAL is not set
516# CONFIG_MOUSE_INPORT is not set
517# CONFIG_MOUSE_LOGIBM is not set
518# CONFIG_MOUSE_PC110PAD is not set
519# CONFIG_MOUSE_VSXXXAA is not set
520# CONFIG_INPUT_JOYSTICK is not set
521# CONFIG_INPUT_TOUCHSCREEN is not set
522# CONFIG_INPUT_MISC is not set
523
524#
525# Hardware I/O ports
526#
527CONFIG_SERIO=y
528CONFIG_SERIO_SERPORT=y
529CONFIG_SERIO_LIBPS2=y
530# CONFIG_SERIO_RAW 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#
545# CONFIG_SERIAL_8250 is not set
546
547#
548# Non-8250 serial port support
549#
550CONFIG_SERIAL_SA1100=y
551CONFIG_SERIAL_SA1100_CONSOLE=y
552CONFIG_SERIAL_CORE=y
553CONFIG_SERIAL_CORE_CONSOLE=y
554CONFIG_UNIX98_PTYS=y
555CONFIG_LEGACY_PTYS=y
556CONFIG_LEGACY_PTY_COUNT=256
557
558#
559# IPMI
560#
561# CONFIG_IPMI_HANDLER is not set
562
563#
564# Watchdog Cards
565#
566CONFIG_WATCHDOG=y
567# CONFIG_WATCHDOG_NOWAYOUT is not set
568
569#
570# Watchdog Device Drivers
571#
572# CONFIG_SOFT_WATCHDOG is not set
573CONFIG_SA1100_WATCHDOG=y
574
575#
576# ISA-based Watchdog Cards
577#
578# CONFIG_PCWATCHDOG is not set
579# CONFIG_MIXCOMWD is not set
580# CONFIG_WDT is not set
581# CONFIG_NVRAM is not set
582# CONFIG_RTC is not set
583# CONFIG_DTLK is not set
584# CONFIG_R3964 is not set
585
586#
587# Ftape, the floppy tape device driver
588#
589# CONFIG_DRM is not set
590
591#
592# PCMCIA character devices
593#
594# CONFIG_SYNCLINK_CS is not set
595# CONFIG_RAW_DRIVER is not set
596
597#
598# TPM devices
599#
600# CONFIG_TCG_TPM is not set
601
602#
603# I2C support
604#
605# CONFIG_I2C is not set
606
607#
608# Misc devices
609#
610
611#
612# Multimedia devices
613#
614# CONFIG_VIDEO_DEV is not set
615
616#
617# Digital Video Broadcasting Devices
618#
619# CONFIG_DVB is not set
620
621#
622# Graphics support
623#
624CONFIG_FB=y
625CONFIG_FB_CFB_FILLRECT=y
626CONFIG_FB_CFB_COPYAREA=y
627CONFIG_FB_CFB_IMAGEBLIT=y
628CONFIG_FB_SOFT_CURSOR=y
629# CONFIG_FB_MODE_HELPERS is not set
630# CONFIG_FB_TILEBLITTING is not set
631CONFIG_FB_SA1100=y
632# CONFIG_FB_VIRTUAL is not set
633
634#
635# Console display driver support
636#
637# CONFIG_VGA_CONSOLE is not set
638# CONFIG_MDA_CONSOLE is not set
639CONFIG_DUMMY_CONSOLE=y
640# CONFIG_FRAMEBUFFER_CONSOLE is not set
641
642#
643# Logo configuration
644#
645# CONFIG_LOGO is not set
646# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
647
648#
649# Sound
650#
651CONFIG_SOUND=y
652
653#
654# Advanced Linux Sound Architecture
655#
656# CONFIG_SND is not set
657
658#
659# Open Sound System
660#
661# CONFIG_SOUND_PRIME is not set
662
663#
664# USB support
665#
666CONFIG_USB_ARCH_HAS_HCD=y
667# CONFIG_USB_ARCH_HAS_OHCI is not set
668# CONFIG_USB is not set
669
670#
671# USB Gadget Support
672#
673# CONFIG_USB_GADGET is not set
674
675#
676# MMC/SD Card support
677#
678# CONFIG_MMC is not set
679
680#
681# File systems
682#
683# CONFIG_EXT2_FS is not set
684# CONFIG_EXT3_FS is not set
685# CONFIG_JBD is not set
686# CONFIG_REISERFS_FS is not set
687# CONFIG_JFS_FS is not set
688
689#
690# XFS support
691#
692# CONFIG_XFS_FS is not set
693CONFIG_MINIX_FS=y
694# CONFIG_ROMFS_FS is not set
695# CONFIG_QUOTA is not set
696CONFIG_DNOTIFY=y
697# CONFIG_AUTOFS_FS is not set
698# CONFIG_AUTOFS4_FS is not set
699
700#
701# CD-ROM/DVD Filesystems
702#
703# CONFIG_ISO9660_FS is not set
704# CONFIG_UDF_FS is not set
705
706#
707# DOS/FAT/NT Filesystems
708#
709CONFIG_FAT_FS=y
710CONFIG_MSDOS_FS=y
711CONFIG_VFAT_FS=y
712CONFIG_FAT_DEFAULT_CODEPAGE=437
713CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
714# CONFIG_NTFS_FS is not set
715
716#
717# Pseudo filesystems
718#
719CONFIG_PROC_FS=y
720CONFIG_SYSFS=y
721# CONFIG_DEVFS_FS is not set
722# CONFIG_DEVPTS_FS_XATTR is not set
723# CONFIG_TMPFS is not set
724# CONFIG_HUGETLB_PAGE is not set
725CONFIG_RAMFS=y
726
727#
728# Miscellaneous filesystems
729#
730# CONFIG_ADFS_FS is not set
731# CONFIG_AFFS_FS is not set
732# CONFIG_HFS_FS is not set
733# CONFIG_HFSPLUS_FS is not set
734# CONFIG_BEFS_FS is not set
735# CONFIG_BFS_FS is not set
736# CONFIG_EFS_FS is not set
737# CONFIG_JFFS_FS is not set
738CONFIG_JFFS2_FS=y
739CONFIG_JFFS2_FS_DEBUG=0
740# CONFIG_JFFS2_FS_NAND is not set
741# CONFIG_JFFS2_FS_NOR_ECC is not set
742# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
743CONFIG_JFFS2_ZLIB=y
744CONFIG_JFFS2_RTIME=y
745# CONFIG_JFFS2_RUBIN is not set
746# CONFIG_CRAMFS is not set
747# CONFIG_VXFS_FS is not set
748# CONFIG_HPFS_FS is not set
749# CONFIG_QNX4FS_FS is not set
750# CONFIG_SYSV_FS is not set
751# CONFIG_UFS_FS is not set
752
753#
754# Network File Systems
755#
756CONFIG_NFS_FS=y
757# CONFIG_NFS_V3 is not set
758# CONFIG_NFS_V4 is not set
759# CONFIG_NFS_DIRECTIO is not set
760# CONFIG_NFSD is not set
761CONFIG_LOCKD=y
762CONFIG_SUNRPC=y
763# CONFIG_RPCSEC_GSS_KRB5 is not set
764# CONFIG_RPCSEC_GSS_SPKM3 is not set
765# CONFIG_SMB_FS is not set
766# CONFIG_CIFS is not set
767# CONFIG_NCP_FS is not set
768# CONFIG_CODA_FS is not set
769# CONFIG_AFS_FS is not set
770
771#
772# Partition Types
773#
774CONFIG_PARTITION_ADVANCED=y
775# CONFIG_ACORN_PARTITION is not set
776# CONFIG_OSF_PARTITION is not set
777# CONFIG_AMIGA_PARTITION is not set
778# CONFIG_ATARI_PARTITION is not set
779# CONFIG_MAC_PARTITION is not set
780CONFIG_MSDOS_PARTITION=y
781# CONFIG_BSD_DISKLABEL is not set
782# CONFIG_MINIX_SUBPARTITION is not set
783# CONFIG_SOLARIS_X86_PARTITION is not set
784# CONFIG_UNIXWARE_DISKLABEL is not set
785# CONFIG_LDM_PARTITION is not set
786# CONFIG_SGI_PARTITION is not set
787# CONFIG_ULTRIX_PARTITION is not set
788# CONFIG_SUN_PARTITION is not set
789# CONFIG_EFI_PARTITION is not set
790
791#
792# Native Language Support
793#
794CONFIG_NLS=y
795CONFIG_NLS_DEFAULT="iso8859-1"
796# CONFIG_NLS_CODEPAGE_437 is not set
797# CONFIG_NLS_CODEPAGE_737 is not set
798# CONFIG_NLS_CODEPAGE_775 is not set
799# CONFIG_NLS_CODEPAGE_850 is not set
800# CONFIG_NLS_CODEPAGE_852 is not set
801# CONFIG_NLS_CODEPAGE_855 is not set
802# CONFIG_NLS_CODEPAGE_857 is not set
803# CONFIG_NLS_CODEPAGE_860 is not set
804# CONFIG_NLS_CODEPAGE_861 is not set
805# CONFIG_NLS_CODEPAGE_862 is not set
806# CONFIG_NLS_CODEPAGE_863 is not set
807# CONFIG_NLS_CODEPAGE_864 is not set
808# CONFIG_NLS_CODEPAGE_865 is not set
809# CONFIG_NLS_CODEPAGE_866 is not set
810# CONFIG_NLS_CODEPAGE_869 is not set
811# CONFIG_NLS_CODEPAGE_936 is not set
812# CONFIG_NLS_CODEPAGE_950 is not set
813# CONFIG_NLS_CODEPAGE_932 is not set
814# CONFIG_NLS_CODEPAGE_949 is not set
815# CONFIG_NLS_CODEPAGE_874 is not set
816# CONFIG_NLS_ISO8859_8 is not set
817# CONFIG_NLS_CODEPAGE_1250 is not set
818# CONFIG_NLS_CODEPAGE_1251 is not set
819# CONFIG_NLS_ASCII is not set
820# CONFIG_NLS_ISO8859_1 is not set
821# CONFIG_NLS_ISO8859_2 is not set
822# CONFIG_NLS_ISO8859_3 is not set
823# CONFIG_NLS_ISO8859_4 is not set
824# CONFIG_NLS_ISO8859_5 is not set
825# CONFIG_NLS_ISO8859_6 is not set
826# CONFIG_NLS_ISO8859_7 is not set
827# CONFIG_NLS_ISO8859_9 is not set
828# CONFIG_NLS_ISO8859_13 is not set
829# CONFIG_NLS_ISO8859_14 is not set
830# CONFIG_NLS_ISO8859_15 is not set
831# CONFIG_NLS_KOI8_R is not set
832# CONFIG_NLS_KOI8_U is not set
833# CONFIG_NLS_UTF8 is not set
834
835#
836# Profiling support
837#
838# CONFIG_PROFILING is not set
839
840#
841# Kernel hacking
842#
843# CONFIG_PRINTK_TIME is not set
844# CONFIG_DEBUG_KERNEL is not set
845CONFIG_LOG_BUF_SHIFT=14
846CONFIG_DEBUG_BUGVERBOSE=y
847CONFIG_FRAME_POINTER=y
848CONFIG_DEBUG_USER=y
849
850#
851# Security options
852#
853# CONFIG_KEYS is not set
854# CONFIG_SECURITY is not set
855
856#
857# Cryptographic options
858#
859# CONFIG_CRYPTO is not set
860
861#
862# Hardware crypto devices
863#
864
865#
866# Library routines
867#
868# CONFIG_CRC_CCITT is not set
869CONFIG_CRC32=y
870# CONFIG_LIBCRC32C is not set
871CONFIG_ZLIB_INFLATE=y
872CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/shark_defconfig b/arch/arm/configs/shark_defconfig
new file mode 100644
index 000000000000..1d9bcbbc8dfc
--- /dev/null
+++ b/arch/arm/configs/shark_defconfig
@@ -0,0 +1,974 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 23:59:14 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17# CONFIG_CLEAN_COMPILE is not set
18CONFIG_BROKEN=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
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53CONFIG_MODULE_UNLOAD=y
54CONFIG_MODULE_FORCE_UNLOAD=y
55CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set
57# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y
59
60#
61# System Type
62#
63# CONFIG_ARCH_CLPS7500 is not set
64# CONFIG_ARCH_CLPS711X is not set
65# CONFIG_ARCH_CO285 is not set
66# CONFIG_ARCH_EBSA110 is not set
67# CONFIG_ARCH_CAMELOT is not set
68# CONFIG_ARCH_FOOTBRIDGE is not set
69# CONFIG_ARCH_INTEGRATOR is not set
70# CONFIG_ARCH_IOP3XX is not set
71# CONFIG_ARCH_IXP4XX is not set
72# CONFIG_ARCH_IXP2000 is not set
73# CONFIG_ARCH_L7200 is not set
74# CONFIG_ARCH_PXA is not set
75# CONFIG_ARCH_RPC is not set
76# CONFIG_ARCH_SA1100 is not set
77# CONFIG_ARCH_S3C2410 is not set
78CONFIG_ARCH_SHARK=y
79# CONFIG_ARCH_LH7A40X is not set
80# CONFIG_ARCH_OMAP is not set
81# CONFIG_ARCH_VERSATILE is not set
82# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set
84
85#
86# Processor Type
87#
88CONFIG_CPU_32=y
89CONFIG_CPU_SA110=y
90CONFIG_CPU_32v4=y
91CONFIG_CPU_ABRT_EV4=y
92CONFIG_CPU_CACHE_V4WB=y
93CONFIG_CPU_CACHE_VIVT=y
94CONFIG_CPU_COPY_V4WB=y
95CONFIG_CPU_TLB_V4WB=y
96
97#
98# Processor Features
99#
100
101#
102# Bus support
103#
104CONFIG_ISA=y
105CONFIG_ISA_DMA=y
106CONFIG_PCI=y
107CONFIG_PCI_HOST_VIA82C505=y
108CONFIG_PCI_LEGACY_PROC=y
109# CONFIG_PCI_NAMES is not set
110
111#
112# PCCARD (PCMCIA/CardBus) support
113#
114# CONFIG_PCCARD is not set
115
116#
117# Kernel Features
118#
119# CONFIG_PREEMPT is not set
120CONFIG_LEDS=y
121CONFIG_LEDS_TIMER=y
122# CONFIG_LEDS_CPU is not set
123CONFIG_ALIGNMENT_TRAP=y
124
125#
126# Boot options
127#
128CONFIG_ZBOOT_ROM_TEXT=0x0
129CONFIG_ZBOOT_ROM_BSS=0x0
130CONFIG_CMDLINE=""
131# CONFIG_XIP_KERNEL is not set
132
133#
134# Floating point emulation
135#
136
137#
138# At least one emulation must be selected
139#
140# CONFIG_FPE_NWFPE is not set
141CONFIG_FPE_FASTFPE=y
142
143#
144# Userspace binary formats
145#
146CONFIG_BINFMT_ELF=y
147# CONFIG_BINFMT_AOUT is not set
148# CONFIG_BINFMT_MISC is not set
149# CONFIG_ARTHUR is not set
150
151#
152# Power management options
153#
154# CONFIG_PM is not set
155
156#
157# Device Drivers
158#
159
160#
161# Generic Driver Options
162#
163# CONFIG_STANDALONE is not set
164CONFIG_PREVENT_FIRMWARE_BUILD=y
165# CONFIG_FW_LOADER is not set
166
167#
168# Memory Technology Devices (MTD)
169#
170# CONFIG_MTD is not set
171
172#
173# Parallel port support
174#
175CONFIG_PARPORT=y
176CONFIG_PARPORT_PC=y
177# CONFIG_PARPORT_SERIAL is not set
178# CONFIG_PARPORT_PC_FIFO is not set
179# CONFIG_PARPORT_PC_SUPERIO is not set
180# CONFIG_PARPORT_ARC is not set
181# CONFIG_PARPORT_GSC is not set
182# CONFIG_PARPORT_1284 is not set
183
184#
185# Plug and Play support
186#
187# CONFIG_PNP is not set
188
189#
190# Block devices
191#
192# CONFIG_BLK_DEV_FD is not set
193# CONFIG_BLK_DEV_XD is not set
194# CONFIG_PARIDE is not set
195# CONFIG_BLK_CPQ_DA is not set
196# CONFIG_BLK_CPQ_CISS_DA is not set
197# CONFIG_BLK_DEV_DAC960 is not set
198# CONFIG_BLK_DEV_UMEM is not set
199# CONFIG_BLK_DEV_COW_COMMON is not set
200CONFIG_BLK_DEV_LOOP=y
201# CONFIG_BLK_DEV_CRYPTOLOOP is not set
202# CONFIG_BLK_DEV_NBD is not set
203# CONFIG_BLK_DEV_SX8 is not set
204CONFIG_BLK_DEV_RAM=y
205CONFIG_BLK_DEV_RAM_COUNT=16
206CONFIG_BLK_DEV_RAM_SIZE=4096
207# CONFIG_BLK_DEV_INITRD is not set
208CONFIG_INITRAMFS_SOURCE=""
209# CONFIG_CDROM_PKTCDVD is not set
210
211#
212# IO Schedulers
213#
214CONFIG_IOSCHED_NOOP=y
215CONFIG_IOSCHED_AS=y
216CONFIG_IOSCHED_DEADLINE=y
217CONFIG_IOSCHED_CFQ=y
218# CONFIG_ATA_OVER_ETH is not set
219
220#
221# ATA/ATAPI/MFM/RLL support
222#
223CONFIG_IDE=y
224CONFIG_BLK_DEV_IDE=y
225
226#
227# Please see Documentation/ide.txt for help/info on IDE drives
228#
229# CONFIG_BLK_DEV_IDE_SATA is not set
230CONFIG_BLK_DEV_IDEDISK=y
231# CONFIG_IDEDISK_MULTI_MODE is not set
232CONFIG_BLK_DEV_IDECD=y
233# CONFIG_BLK_DEV_IDETAPE is not set
234CONFIG_BLK_DEV_IDEFLOPPY=y
235# CONFIG_BLK_DEV_IDESCSI is not set
236# CONFIG_IDE_TASK_IOCTL is not set
237
238#
239# IDE chipset support/bugfixes
240#
241CONFIG_IDE_GENERIC=y
242# CONFIG_BLK_DEV_IDEPCI is not set
243CONFIG_IDE_ARM=y
244# CONFIG_IDE_CHIPSETS is not set
245# CONFIG_BLK_DEV_IDEDMA is not set
246# CONFIG_IDEDMA_AUTO is not set
247# CONFIG_BLK_DEV_HD is not set
248
249#
250# SCSI device support
251#
252CONFIG_SCSI=m
253CONFIG_SCSI_PROC_FS=y
254
255#
256# SCSI support type (disk, tape, CD-ROM)
257#
258CONFIG_BLK_DEV_SD=m
259CONFIG_CHR_DEV_ST=m
260# CONFIG_CHR_DEV_OSST is not set
261CONFIG_BLK_DEV_SR=m
262# CONFIG_BLK_DEV_SR_VENDOR is not set
263CONFIG_CHR_DEV_SG=m
264
265#
266# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
267#
268# CONFIG_SCSI_MULTI_LUN is not set
269# CONFIG_SCSI_CONSTANTS is not set
270# CONFIG_SCSI_LOGGING is not set
271
272#
273# SCSI Transport Attributes
274#
275# CONFIG_SCSI_SPI_ATTRS is not set
276# CONFIG_SCSI_FC_ATTRS is not set
277# CONFIG_SCSI_ISCSI_ATTRS is not set
278
279#
280# SCSI low-level drivers
281#
282# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
283# CONFIG_SCSI_3W_9XXX is not set
284# CONFIG_SCSI_7000FASST is not set
285# CONFIG_SCSI_ACARD is not set
286# CONFIG_SCSI_AHA152X is not set
287# CONFIG_SCSI_AHA1542 is not set
288# CONFIG_SCSI_AACRAID is not set
289# CONFIG_SCSI_AIC7XXX is not set
290# CONFIG_SCSI_AIC7XXX_OLD is not set
291# CONFIG_SCSI_AIC79XX is not set
292# CONFIG_SCSI_DPT_I2O is not set
293# CONFIG_SCSI_ADVANSYS is not set
294# CONFIG_SCSI_IN2000 is not set
295# CONFIG_MEGARAID_NEWGEN is not set
296# CONFIG_MEGARAID_LEGACY is not set
297# CONFIG_SCSI_SATA is not set
298# CONFIG_SCSI_BUSLOGIC is not set
299# CONFIG_SCSI_CPQFCTS is not set
300# CONFIG_SCSI_DMX3191D is not set
301# CONFIG_SCSI_DTC3280 is not set
302# CONFIG_SCSI_EATA is not set
303# CONFIG_SCSI_EATA_PIO is not set
304# CONFIG_SCSI_FUTURE_DOMAIN is not set
305# CONFIG_SCSI_GDTH is not set
306# CONFIG_SCSI_GENERIC_NCR5380 is not set
307# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
308# CONFIG_SCSI_IPS is not set
309# CONFIG_SCSI_INITIO is not set
310# CONFIG_SCSI_INIA100 is not set
311# CONFIG_SCSI_PPA is not set
312# CONFIG_SCSI_IMM is not set
313# CONFIG_SCSI_NCR53C406A is not set
314# CONFIG_SCSI_SYM53C8XX_2 is not set
315# CONFIG_SCSI_IPR is not set
316# CONFIG_SCSI_PAS16 is not set
317# CONFIG_SCSI_PCI2000 is not set
318# CONFIG_SCSI_PCI2220I is not set
319# CONFIG_SCSI_PSI240I is not set
320# CONFIG_SCSI_QLOGIC_FAS is not set
321# CONFIG_SCSI_QLOGIC_ISP is not set
322# CONFIG_SCSI_QLOGIC_FC is not set
323# CONFIG_SCSI_QLOGIC_1280 is not set
324CONFIG_SCSI_QLA2XXX=m
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_SYM53C416 is not set
331# CONFIG_SCSI_DC395x is not set
332# CONFIG_SCSI_DC390T is not set
333# CONFIG_SCSI_T128 is not set
334# CONFIG_SCSI_U14_34F is not set
335# CONFIG_SCSI_NSP32 is not set
336# CONFIG_SCSI_DEBUG is not set
337
338#
339# Multi-device support (RAID and LVM)
340#
341# CONFIG_MD is not set
342
343#
344# Fusion MPT device support
345#
346# CONFIG_FUSION 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# Networking support
360#
361CONFIG_NET=y
362
363#
364# Networking options
365#
366CONFIG_PACKET=y
367# CONFIG_PACKET_MMAP is not set
368# CONFIG_NETLINK_DEV is not set
369CONFIG_UNIX=y
370# CONFIG_NET_KEY is not set
371CONFIG_INET=y
372# CONFIG_IP_MULTICAST is not set
373# CONFIG_IP_ADVANCED_ROUTER is not set
374# CONFIG_IP_PNP is not set
375# CONFIG_NET_IPIP is not set
376# CONFIG_NET_IPGRE is not set
377# CONFIG_ARPD is not set
378# CONFIG_SYN_COOKIES is not set
379# CONFIG_INET_AH is not set
380# CONFIG_INET_ESP is not set
381# CONFIG_INET_IPCOMP is not set
382# CONFIG_INET_TUNNEL is not set
383# CONFIG_IP_TCPDIAG is not set
384# CONFIG_IP_TCPDIAG_IPV6 is not set
385# CONFIG_IPV6 is not set
386# CONFIG_NETFILTER is not set
387
388#
389# SCTP Configuration (EXPERIMENTAL)
390#
391# CONFIG_IP_SCTP is not set
392# CONFIG_ATM is not set
393# CONFIG_BRIDGE is not set
394# CONFIG_VLAN_8021Q is not set
395# CONFIG_DECNET is not set
396# CONFIG_LLC2 is not set
397# CONFIG_IPX is not set
398# CONFIG_ATALK is not set
399# CONFIG_X25 is not set
400# CONFIG_LAPB is not set
401# CONFIG_NET_DIVERT is not set
402# CONFIG_ECONET is not set
403# CONFIG_WAN_ROUTER is not set
404
405#
406# QoS and/or fair queueing
407#
408# CONFIG_NET_SCHED is not set
409# CONFIG_NET_CLS_ROUTE is not set
410
411#
412# Network testing
413#
414# CONFIG_NET_PKTGEN is not set
415# CONFIG_NETPOLL is not set
416# CONFIG_NET_POLL_CONTROLLER is not set
417# CONFIG_HAMRADIO is not set
418# CONFIG_IRDA is not set
419# CONFIG_BT is not set
420CONFIG_NETDEVICES=y
421# CONFIG_DUMMY is not set
422# CONFIG_BONDING is not set
423# CONFIG_EQUALIZER is not set
424# CONFIG_TUN is not set
425
426#
427# ARCnet devices
428#
429# CONFIG_ARCNET is not set
430
431#
432# Ethernet (10 or 100Mbit)
433#
434CONFIG_NET_ETHERNET=y
435# CONFIG_MII is not set
436# CONFIG_HAPPYMEAL is not set
437# CONFIG_SUNGEM is not set
438# CONFIG_NET_VENDOR_3COM is not set
439# CONFIG_LANCE is not set
440# CONFIG_NET_VENDOR_SMC is not set
441# CONFIG_SMC91X is not set
442# CONFIG_NET_VENDOR_RACAL is not set
443
444#
445# Tulip family network device support
446#
447# CONFIG_NET_TULIP is not set
448# CONFIG_AT1700 is not set
449# CONFIG_DEPCA is not set
450# CONFIG_HP100 is not set
451# CONFIG_NET_ISA is not set
452CONFIG_NET_PCI=y
453# CONFIG_PCNET32 is not set
454# CONFIG_AMD8111_ETH is not set
455# CONFIG_ADAPTEC_STARFIRE is not set
456# CONFIG_AC3200 is not set
457# CONFIG_APRICOT is not set
458# CONFIG_B44 is not set
459# CONFIG_FORCEDETH is not set
460CONFIG_CS89x0=y
461# CONFIG_DGRS is not set
462# CONFIG_EEPRO100 is not set
463# CONFIG_E100 is not set
464# CONFIG_FEALNX is not set
465# CONFIG_NATSEMI is not set
466# CONFIG_NE2K_PCI is not set
467# CONFIG_8139CP is not set
468# CONFIG_8139TOO is not set
469# CONFIG_SIS900 is not set
470# CONFIG_EPIC100 is not set
471# CONFIG_SUNDANCE is not set
472# CONFIG_TLAN is not set
473# CONFIG_VIA_RHINE is not set
474# CONFIG_NET_POCKET is not set
475
476#
477# Ethernet (1000 Mbit)
478#
479# CONFIG_ACENIC is not set
480# CONFIG_DL2K is not set
481# CONFIG_E1000 is not set
482# CONFIG_NS83820 is not set
483# CONFIG_HAMACHI is not set
484# CONFIG_YELLOWFIN is not set
485# CONFIG_R8169 is not set
486# CONFIG_SK98LIN is not set
487# CONFIG_VIA_VELOCITY is not set
488# CONFIG_TIGON3 is not set
489
490#
491# Ethernet (10000 Mbit)
492#
493# CONFIG_IXGB is not set
494# CONFIG_S2IO is not set
495
496#
497# Token Ring devices
498#
499# CONFIG_TR is not set
500
501#
502# Wireless LAN (non-hamradio)
503#
504# CONFIG_NET_RADIO is not set
505
506#
507# Wan interfaces
508#
509# CONFIG_WAN is not set
510# CONFIG_FDDI is not set
511# CONFIG_HIPPI is not set
512# CONFIG_PLIP is not set
513# CONFIG_PPP is not set
514# CONFIG_SLIP is not set
515# CONFIG_NET_FC is not set
516# CONFIG_SHAPER is not set
517# CONFIG_NETCONSOLE is not set
518
519#
520# ISDN subsystem
521#
522# CONFIG_ISDN is not set
523
524#
525# Input device support
526#
527CONFIG_INPUT=y
528
529#
530# Userland interfaces
531#
532CONFIG_INPUT_MOUSEDEV=y
533CONFIG_INPUT_MOUSEDEV_PSAUX=y
534CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
535CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
536# CONFIG_INPUT_JOYDEV is not set
537# CONFIG_INPUT_TSDEV is not set
538# CONFIG_INPUT_EVDEV is not set
539# CONFIG_INPUT_EVBUG is not set
540
541#
542# Input Device Drivers
543#
544CONFIG_INPUT_KEYBOARD=y
545CONFIG_KEYBOARD_ATKBD=y
546# CONFIG_KEYBOARD_SUNKBD is not set
547# CONFIG_KEYBOARD_LKKBD is not set
548# CONFIG_KEYBOARD_XTKBD is not set
549# CONFIG_KEYBOARD_NEWTON is not set
550CONFIG_INPUT_MOUSE=y
551CONFIG_MOUSE_PS2=y
552# CONFIG_MOUSE_SERIAL is not set
553# CONFIG_MOUSE_INPORT is not set
554# CONFIG_MOUSE_LOGIBM is not set
555# CONFIG_MOUSE_PC110PAD is not set
556# CONFIG_MOUSE_VSXXXAA is not set
557# CONFIG_INPUT_JOYSTICK is not set
558# CONFIG_INPUT_TOUCHSCREEN is not set
559# CONFIG_INPUT_MISC is not set
560
561#
562# Hardware I/O ports
563#
564CONFIG_SERIO=y
565CONFIG_SERIO_I8042=y
566# CONFIG_SERIO_SERPORT is not set
567# CONFIG_SERIO_PARKBD is not set
568# CONFIG_SERIO_PCIPS2 is not set
569CONFIG_SERIO_LIBPS2=y
570# CONFIG_SERIO_RAW is not set
571# CONFIG_GAMEPORT is not set
572CONFIG_SOUND_GAMEPORT=y
573
574#
575# Character devices
576#
577CONFIG_VT=y
578CONFIG_VT_CONSOLE=y
579CONFIG_HW_CONSOLE=y
580# CONFIG_SERIAL_NONSTANDARD is not set
581
582#
583# Serial drivers
584#
585CONFIG_SERIAL_8250=y
586CONFIG_SERIAL_8250_CONSOLE=y
587CONFIG_SERIAL_8250_NR_UARTS=4
588# CONFIG_SERIAL_8250_EXTENDED is not set
589
590#
591# Non-8250 serial port support
592#
593CONFIG_SERIAL_CORE=y
594CONFIG_SERIAL_CORE_CONSOLE=y
595CONFIG_UNIX98_PTYS=y
596CONFIG_LEGACY_PTYS=y
597CONFIG_LEGACY_PTY_COUNT=256
598CONFIG_PRINTER=m
599# CONFIG_LP_CONSOLE is not set
600# CONFIG_PPDEV is not set
601# CONFIG_TIPAR is not set
602
603#
604# IPMI
605#
606# CONFIG_IPMI_HANDLER is not set
607
608#
609# Watchdog Cards
610#
611# CONFIG_WATCHDOG is not set
612# CONFIG_NVRAM is not set
613CONFIG_RTC=y
614# CONFIG_DTLK is not set
615# CONFIG_R3964 is not set
616# CONFIG_APPLICOM is not set
617
618#
619# Ftape, the floppy tape device driver
620#
621# CONFIG_DRM is not set
622# CONFIG_RAW_DRIVER is not set
623
624#
625# TPM devices
626#
627# CONFIG_TCG_TPM is not set
628
629#
630# I2C support
631#
632# CONFIG_I2C is not set
633
634#
635# Misc devices
636#
637
638#
639# Multimedia devices
640#
641# CONFIG_VIDEO_DEV is not set
642
643#
644# Digital Video Broadcasting Devices
645#
646# CONFIG_DVB is not set
647
648#
649# Graphics support
650#
651CONFIG_FB=y
652CONFIG_FB_CFB_FILLRECT=y
653CONFIG_FB_CFB_COPYAREA=y
654CONFIG_FB_CFB_IMAGEBLIT=y
655CONFIG_FB_SOFT_CURSOR=y
656# CONFIG_FB_MODE_HELPERS is not set
657# CONFIG_FB_TILEBLITTING is not set
658# CONFIG_FB_CIRRUS is not set
659# CONFIG_FB_PM2 is not set
660CONFIG_FB_CYBER2000=y
661# CONFIG_FB_ASILIANT is not set
662# CONFIG_FB_IMSTT is not set
663# CONFIG_FB_NVIDIA is not set
664# CONFIG_FB_RIVA is not set
665# CONFIG_FB_MATROX is not set
666# CONFIG_FB_RADEON_OLD is not set
667# CONFIG_FB_RADEON is not set
668# CONFIG_FB_ATY128 is not set
669# CONFIG_FB_ATY is not set
670# CONFIG_FB_SAVAGE is not set
671# CONFIG_FB_SIS is not set
672# CONFIG_FB_NEOMAGIC is not set
673# CONFIG_FB_KYRO is not set
674# CONFIG_FB_3DFX is not set
675# CONFIG_FB_VOODOO1 is not set
676# CONFIG_FB_TRIDENT is not set
677# CONFIG_FB_PM3 is not set
678# CONFIG_FB_VIRTUAL is not set
679
680#
681# Console display driver support
682#
683# CONFIG_VGA_CONSOLE is not set
684# CONFIG_MDA_CONSOLE is not set
685CONFIG_DUMMY_CONSOLE=y
686CONFIG_FRAMEBUFFER_CONSOLE=y
687# CONFIG_FONTS is not set
688CONFIG_FONT_8x8=y
689CONFIG_FONT_8x16=y
690
691#
692# Logo configuration
693#
694CONFIG_LOGO=y
695# CONFIG_LOGO_LINUX_MONO is not set
696# CONFIG_LOGO_LINUX_VGA16 is not set
697CONFIG_LOGO_LINUX_CLUT224=y
698# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
699
700#
701# Sound
702#
703CONFIG_SOUND=m
704
705#
706# Advanced Linux Sound Architecture
707#
708# CONFIG_SND is not set
709
710#
711# Open Sound System
712#
713CONFIG_SOUND_PRIME=m
714# CONFIG_SOUND_BT878 is not set
715# CONFIG_SOUND_CMPCI is not set
716# CONFIG_SOUND_EMU10K1 is not set
717# CONFIG_SOUND_FUSION is not set
718# CONFIG_SOUND_CS4281 is not set
719# CONFIG_SOUND_ES1370 is not set
720# CONFIG_SOUND_ES1371 is not set
721# CONFIG_SOUND_ESSSOLO1 is not set
722# CONFIG_SOUND_MAESTRO is not set
723# CONFIG_SOUND_MAESTRO3 is not set
724# CONFIG_SOUND_ICH is not set
725# CONFIG_SOUND_SONICVIBES is not set
726# CONFIG_SOUND_TRIDENT is not set
727# CONFIG_SOUND_MSNDCLAS is not set
728# CONFIG_SOUND_MSNDPIN is not set
729# CONFIG_SOUND_VIA82CXXX is not set
730CONFIG_SOUND_OSS=m
731# CONFIG_SOUND_TRACEINIT is not set
732# CONFIG_SOUND_DMAP is not set
733# CONFIG_SOUND_AD1816 is not set
734# CONFIG_SOUND_AD1889 is not set
735# CONFIG_SOUND_SGALAXY is not set
736CONFIG_SOUND_ADLIB=m
737# CONFIG_SOUND_ACI_MIXER is not set
738# CONFIG_SOUND_CS4232 is not set
739# CONFIG_SOUND_SSCAPE is not set
740# CONFIG_SOUND_GUS is not set
741# CONFIG_SOUND_VMIDI is not set
742# CONFIG_SOUND_TRIX is not set
743# CONFIG_SOUND_MSS is not set
744# CONFIG_SOUND_MPU401 is not set
745# CONFIG_SOUND_NM256 is not set
746# CONFIG_SOUND_MAD16 is not set
747# CONFIG_SOUND_PAS is not set
748# CONFIG_SOUND_PSS is not set
749CONFIG_SOUND_SB=m
750# CONFIG_SOUND_AWE32_SYNTH is not set
751# CONFIG_SOUND_WAVEFRONT is not set
752# CONFIG_SOUND_MAUI is not set
753# CONFIG_SOUND_YM3812 is not set
754# CONFIG_SOUND_OPL3SA1 is not set
755# CONFIG_SOUND_OPL3SA2 is not set
756# CONFIG_SOUND_YMFPCI is not set
757# CONFIG_SOUND_UART6850 is not set
758# CONFIG_SOUND_AEDSP16 is not set
759# CONFIG_SOUND_KAHLUA is not set
760# CONFIG_SOUND_ALI5455 is not set
761# CONFIG_SOUND_FORTE is not set
762# CONFIG_SOUND_RME96XX is not set
763# CONFIG_SOUND_AD1980 is not set
764
765#
766# USB support
767#
768CONFIG_USB_ARCH_HAS_HCD=y
769CONFIG_USB_ARCH_HAS_OHCI=y
770# CONFIG_USB is not set
771
772#
773# USB Gadget Support
774#
775# CONFIG_USB_GADGET is not set
776
777#
778# MMC/SD Card support
779#
780# CONFIG_MMC is not set
781
782#
783# File systems
784#
785CONFIG_EXT2_FS=y
786# CONFIG_EXT2_FS_XATTR is not set
787CONFIG_EXT3_FS=y
788CONFIG_EXT3_FS_XATTR=y
789# CONFIG_EXT3_FS_POSIX_ACL is not set
790# CONFIG_EXT3_FS_SECURITY is not set
791CONFIG_JBD=y
792# CONFIG_JBD_DEBUG is not set
793CONFIG_FS_MBCACHE=y
794# CONFIG_REISERFS_FS is not set
795# CONFIG_JFS_FS is not set
796
797#
798# XFS support
799#
800# CONFIG_XFS_FS is not set
801# CONFIG_MINIX_FS is not set
802# CONFIG_ROMFS_FS is not set
803# CONFIG_QUOTA is not set
804CONFIG_DNOTIFY=y
805# CONFIG_AUTOFS_FS is not set
806# CONFIG_AUTOFS4_FS is not set
807
808#
809# CD-ROM/DVD Filesystems
810#
811CONFIG_ISO9660_FS=y
812CONFIG_JOLIET=y
813# CONFIG_ZISOFS is not set
814# CONFIG_UDF_FS is not set
815
816#
817# DOS/FAT/NT Filesystems
818#
819CONFIG_FAT_FS=y
820CONFIG_MSDOS_FS=y
821CONFIG_VFAT_FS=y
822CONFIG_FAT_DEFAULT_CODEPAGE=437
823CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
824# CONFIG_NTFS_FS is not set
825
826#
827# Pseudo filesystems
828#
829CONFIG_PROC_FS=y
830CONFIG_SYSFS=y
831CONFIG_DEVFS_FS=y
832CONFIG_DEVFS_MOUNT=y
833# CONFIG_DEVFS_DEBUG is not set
834# CONFIG_DEVPTS_FS_XATTR is not set
835# CONFIG_TMPFS is not set
836# CONFIG_HUGETLBFS is not set
837# CONFIG_HUGETLB_PAGE is not set
838CONFIG_RAMFS=y
839
840#
841# Miscellaneous filesystems
842#
843# CONFIG_ADFS_FS is not set
844# CONFIG_AFFS_FS is not set
845# CONFIG_HFS_FS is not set
846# CONFIG_HFSPLUS_FS is not set
847# CONFIG_BEFS_FS is not set
848# CONFIG_BFS_FS is not set
849# CONFIG_EFS_FS is not set
850# CONFIG_CRAMFS is not set
851# CONFIG_VXFS_FS is not set
852# CONFIG_HPFS_FS is not set
853# CONFIG_QNX4FS_FS is not set
854# CONFIG_SYSV_FS is not set
855# CONFIG_UFS_FS is not set
856
857#
858# Network File Systems
859#
860CONFIG_NFS_FS=y
861# CONFIG_NFS_V3 is not set
862# CONFIG_NFS_V4 is not set
863# CONFIG_NFS_DIRECTIO is not set
864# CONFIG_NFSD is not set
865CONFIG_LOCKD=y
866CONFIG_SUNRPC=y
867# CONFIG_RPCSEC_GSS_KRB5 is not set
868# CONFIG_RPCSEC_GSS_SPKM3 is not set
869# CONFIG_SMB_FS is not set
870# CONFIG_CIFS is not set
871# CONFIG_NCP_FS is not set
872# CONFIG_CODA_FS is not set
873# CONFIG_AFS_FS is not set
874
875#
876# Partition Types
877#
878CONFIG_PARTITION_ADVANCED=y
879# CONFIG_ACORN_PARTITION is not set
880# CONFIG_OSF_PARTITION is not set
881# CONFIG_AMIGA_PARTITION is not set
882# CONFIG_ATARI_PARTITION is not set
883# CONFIG_MAC_PARTITION is not set
884CONFIG_MSDOS_PARTITION=y
885# CONFIG_BSD_DISKLABEL is not set
886# CONFIG_MINIX_SUBPARTITION is not set
887# CONFIG_SOLARIS_X86_PARTITION is not set
888# CONFIG_UNIXWARE_DISKLABEL is not set
889# CONFIG_LDM_PARTITION is not set
890# CONFIG_SGI_PARTITION is not set
891# CONFIG_ULTRIX_PARTITION is not set
892# CONFIG_SUN_PARTITION is not set
893# CONFIG_EFI_PARTITION is not set
894
895#
896# Native Language Support
897#
898CONFIG_NLS=y
899CONFIG_NLS_DEFAULT="iso8859-1"
900CONFIG_NLS_CODEPAGE_437=y
901# CONFIG_NLS_CODEPAGE_737 is not set
902# CONFIG_NLS_CODEPAGE_775 is not set
903CONFIG_NLS_CODEPAGE_850=y
904# CONFIG_NLS_CODEPAGE_852 is not set
905# CONFIG_NLS_CODEPAGE_855 is not set
906# CONFIG_NLS_CODEPAGE_857 is not set
907# CONFIG_NLS_CODEPAGE_860 is not set
908# CONFIG_NLS_CODEPAGE_861 is not set
909# CONFIG_NLS_CODEPAGE_862 is not set
910# CONFIG_NLS_CODEPAGE_863 is not set
911# CONFIG_NLS_CODEPAGE_864 is not set
912# CONFIG_NLS_CODEPAGE_865 is not set
913# CONFIG_NLS_CODEPAGE_866 is not set
914# CONFIG_NLS_CODEPAGE_869 is not set
915# CONFIG_NLS_CODEPAGE_936 is not set
916# CONFIG_NLS_CODEPAGE_950 is not set
917# CONFIG_NLS_CODEPAGE_932 is not set
918# CONFIG_NLS_CODEPAGE_949 is not set
919# CONFIG_NLS_CODEPAGE_874 is not set
920# CONFIG_NLS_ISO8859_8 is not set
921# CONFIG_NLS_CODEPAGE_1250 is not set
922# CONFIG_NLS_CODEPAGE_1251 is not set
923# CONFIG_NLS_ASCII is not set
924CONFIG_NLS_ISO8859_1=y
925# CONFIG_NLS_ISO8859_2 is not set
926# CONFIG_NLS_ISO8859_3 is not set
927# CONFIG_NLS_ISO8859_4 is not set
928# CONFIG_NLS_ISO8859_5 is not set
929# CONFIG_NLS_ISO8859_6 is not set
930# CONFIG_NLS_ISO8859_7 is not set
931# CONFIG_NLS_ISO8859_9 is not set
932# CONFIG_NLS_ISO8859_13 is not set
933# CONFIG_NLS_ISO8859_14 is not set
934# CONFIG_NLS_ISO8859_15 is not set
935# CONFIG_NLS_KOI8_R is not set
936# CONFIG_NLS_KOI8_U is not set
937# CONFIG_NLS_UTF8 is not set
938
939#
940# Profiling support
941#
942# CONFIG_PROFILING is not set
943
944#
945# Kernel hacking
946#
947# CONFIG_PRINTK_TIME is not set
948# CONFIG_DEBUG_KERNEL is not set
949CONFIG_LOG_BUF_SHIFT=14
950CONFIG_DEBUG_BUGVERBOSE=y
951CONFIG_FRAME_POINTER=y
952CONFIG_DEBUG_USER=y
953
954#
955# Security options
956#
957# CONFIG_KEYS is not set
958# CONFIG_SECURITY is not set
959
960#
961# Cryptographic options
962#
963# CONFIG_CRYPTO is not set
964
965#
966# Hardware crypto devices
967#
968
969#
970# Library routines
971#
972# CONFIG_CRC_CCITT is not set
973CONFIG_CRC32=y
974# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/configs/simpad_defconfig b/arch/arm/configs/simpad_defconfig
new file mode 100644
index 000000000000..5373eeb7d578
--- /dev/null
+++ b/arch/arm/configs/simpad_defconfig
@@ -0,0 +1,964 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Mon Mar 28 00:10:36 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19CONFIG_LOCK_KERNEL=y
20
21#
22# General setup
23#
24CONFIG_LOCALVERSION="oe1"
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_HOTPLUG=y
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34CONFIG_EMBEDDED=y
35CONFIG_KALLSYMS=y
36CONFIG_KALLSYMS_ALL=y
37CONFIG_KALLSYMS_EXTRA_PASS=y
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
54# CONFIG_MODULE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set
57# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y
59
60#
61# System Type
62#
63# CONFIG_ARCH_CLPS7500 is not set
64# CONFIG_ARCH_CLPS711X is not set
65# CONFIG_ARCH_CO285 is not set
66# CONFIG_ARCH_EBSA110 is not set
67# CONFIG_ARCH_CAMELOT is not set
68# CONFIG_ARCH_FOOTBRIDGE is not set
69# CONFIG_ARCH_INTEGRATOR is not set
70# CONFIG_ARCH_IOP3XX is not set
71# CONFIG_ARCH_IXP4XX is not set
72# CONFIG_ARCH_IXP2000 is not set
73# CONFIG_ARCH_L7200 is not set
74# CONFIG_ARCH_PXA is not set
75# CONFIG_ARCH_RPC is not set
76CONFIG_ARCH_SA1100=y
77# CONFIG_ARCH_S3C2410 is not set
78# CONFIG_ARCH_SHARK is not set
79# CONFIG_ARCH_LH7A40X is not set
80# CONFIG_ARCH_OMAP is not set
81# CONFIG_ARCH_VERSATILE is not set
82# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set
84
85#
86# SA11x0 Implementations
87#
88# CONFIG_SA1100_ASSABET is not set
89# CONFIG_SA1100_CERF is not set
90# CONFIG_SA1100_COLLIE is not set
91# CONFIG_SA1100_H3100 is not set
92# CONFIG_SA1100_H3600 is not set
93# CONFIG_SA1100_H3800 is not set
94# CONFIG_SA1100_BADGE4 is not set
95# CONFIG_SA1100_JORNADA720 is not set
96# CONFIG_SA1100_HACKKIT is not set
97# CONFIG_SA1100_LART is not set
98# CONFIG_SA1100_PLEB is not set
99# CONFIG_SA1100_SHANNON is not set
100CONFIG_SA1100_SIMPAD=y
101# CONFIG_SA1100_SSP is not set
102
103#
104# Processor Type
105#
106CONFIG_CPU_32=y
107CONFIG_CPU_SA1100=y
108CONFIG_CPU_32v4=y
109CONFIG_CPU_ABRT_EV4=y
110CONFIG_CPU_CACHE_V4WB=y
111CONFIG_CPU_CACHE_VIVT=y
112CONFIG_CPU_TLB_V4WB=y
113CONFIG_CPU_MINICACHE=y
114
115#
116# Processor Features
117#
118
119#
120# Bus support
121#
122CONFIG_ISA=y
123
124#
125# PCCARD (PCMCIA/CardBus) support
126#
127CONFIG_PCCARD=y
128# CONFIG_PCMCIA_DEBUG is not set
129CONFIG_PCMCIA=y
130
131#
132# PC-card bridges
133#
134# CONFIG_I82365 is not set
135# CONFIG_TCIC is not set
136CONFIG_PCMCIA_SA1100=y
137
138#
139# Kernel Features
140#
141CONFIG_PREEMPT=y
142CONFIG_DISCONTIGMEM=y
143CONFIG_LEDS=y
144CONFIG_LEDS_TIMER=y
145# CONFIG_LEDS_CPU is not set
146CONFIG_ALIGNMENT_TRAP=y
147
148#
149# Boot options
150#
151CONFIG_ZBOOT_ROM_TEXT=0x0
152CONFIG_ZBOOT_ROM_BSS=0x0
153CONFIG_CMDLINE="mtdparts=sa1100:512k(boot),1m(kernel),-(root) console=ttySA0 root=1f02 noinitrd mem=64M jffs2_orphaned_inodes=delete rootfstype=jffs2"
154# CONFIG_XIP_KERNEL is not set
155
156#
157# CPU Frequency scaling
158#
159# CONFIG_CPU_FREQ is not set
160
161#
162# Floating point emulation
163#
164
165#
166# At least one emulation must be selected
167#
168CONFIG_FPE_NWFPE=y
169# CONFIG_FPE_NWFPE_XP is not set
170# CONFIG_FPE_FASTFPE is not set
171
172#
173# Userspace binary formats
174#
175CONFIG_BINFMT_ELF=y
176# CONFIG_BINFMT_AOUT is not set
177CONFIG_BINFMT_MISC=m
178# CONFIG_ARTHUR is not set
179
180#
181# Power management options
182#
183CONFIG_PM=y
184CONFIG_APM=y
185
186#
187# Device Drivers
188#
189
190#
191# Generic Driver Options
192#
193CONFIG_STANDALONE=y
194CONFIG_PREVENT_FIRMWARE_BUILD=y
195CONFIG_FW_LOADER=m
196# CONFIG_DEBUG_DRIVER is not set
197
198#
199# Memory Technology Devices (MTD)
200#
201CONFIG_MTD=y
202# CONFIG_MTD_DEBUG is not set
203CONFIG_MTD_CONCAT=y
204CONFIG_MTD_PARTITIONS=y
205# CONFIG_MTD_REDBOOT_PARTS is not set
206CONFIG_MTD_CMDLINE_PARTS=y
207# CONFIG_MTD_AFS_PARTS is not set
208
209#
210# User Modules And Translation Layers
211#
212CONFIG_MTD_CHAR=y
213CONFIG_MTD_BLOCK=y
214# CONFIG_FTL is not set
215# CONFIG_NFTL is not set
216# CONFIG_INFTL is not set
217
218#
219# RAM/ROM/Flash chip drivers
220#
221CONFIG_MTD_CFI=y
222CONFIG_MTD_JEDECPROBE=y
223CONFIG_MTD_GEN_PROBE=y
224CONFIG_MTD_CFI_ADV_OPTIONS=y
225CONFIG_MTD_CFI_NOSWAP=y
226# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
227# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
228CONFIG_MTD_CFI_GEOMETRY=y
229CONFIG_MTD_MAP_BANK_WIDTH_1=y
230CONFIG_MTD_MAP_BANK_WIDTH_2=y
231CONFIG_MTD_MAP_BANK_WIDTH_4=y
232# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
233# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
234# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
235CONFIG_MTD_CFI_I1=y
236# CONFIG_MTD_CFI_I2 is not set
237# CONFIG_MTD_CFI_I4 is not set
238# CONFIG_MTD_CFI_I8 is not set
239CONFIG_MTD_CFI_INTELEXT=y
240# CONFIG_MTD_CFI_AMDSTD is not set
241# CONFIG_MTD_CFI_STAA is not set
242CONFIG_MTD_CFI_UTIL=y
243CONFIG_MTD_RAM=y
244# CONFIG_MTD_ROM is not set
245# CONFIG_MTD_ABSENT is not set
246# CONFIG_MTD_XIP is not set
247
248#
249# Mapping drivers for chip access
250#
251# CONFIG_MTD_COMPLEX_MAPPINGS is not set
252# CONFIG_MTD_PHYSMAP is not set
253# CONFIG_MTD_ARM_INTEGRATOR is not set
254CONFIG_MTD_SA1100=y
255# CONFIG_MTD_EDB7312 is not set
256# CONFIG_MTD_IMPA7 is not set
257
258#
259# Self-contained MTD device drivers
260#
261# CONFIG_MTD_SLRAM is not set
262# CONFIG_MTD_PHRAM is not set
263# CONFIG_MTD_MTDRAM is not set
264# CONFIG_MTD_BLKMTD is not set
265# CONFIG_MTD_BLOCK2MTD is not set
266
267#
268# Disk-On-Chip Device Drivers
269#
270# CONFIG_MTD_DOC2000 is not set
271# CONFIG_MTD_DOC2001 is not set
272# CONFIG_MTD_DOC2001PLUS is not set
273
274#
275# NAND Flash Device Drivers
276#
277# CONFIG_MTD_NAND is not set
278
279#
280# Parallel port support
281#
282# CONFIG_PARPORT is not set
283
284#
285# Plug and Play support
286#
287# CONFIG_PNP is not set
288
289#
290# Block devices
291#
292# CONFIG_BLK_DEV_FD is not set
293# CONFIG_BLK_DEV_XD is not set
294# CONFIG_BLK_DEV_COW_COMMON is not set
295CONFIG_BLK_DEV_LOOP=m
296# CONFIG_BLK_DEV_CRYPTOLOOP is not set
297# CONFIG_BLK_DEV_NBD is not set
298CONFIG_BLK_DEV_RAM=m
299CONFIG_BLK_DEV_RAM_COUNT=16
300CONFIG_BLK_DEV_RAM_SIZE=8192
301CONFIG_INITRAMFS_SOURCE=""
302# CONFIG_CDROM_PKTCDVD is not set
303
304#
305# IO Schedulers
306#
307CONFIG_IOSCHED_NOOP=y
308CONFIG_IOSCHED_AS=y
309CONFIG_IOSCHED_DEADLINE=y
310CONFIG_IOSCHED_CFQ=y
311# CONFIG_ATA_OVER_ETH is not set
312
313#
314# ATA/ATAPI/MFM/RLL support
315#
316# CONFIG_IDE is not set
317
318#
319# SCSI device support
320#
321# CONFIG_SCSI is not set
322
323#
324# Multi-device support (RAID and LVM)
325#
326# CONFIG_MD is not set
327
328#
329# Fusion MPT device support
330#
331
332#
333# IEEE 1394 (FireWire) support
334#
335
336#
337# I2O device support
338#
339
340#
341# Networking support
342#
343CONFIG_NET=y
344
345#
346# Networking options
347#
348CONFIG_PACKET=y
349CONFIG_PACKET_MMAP=y
350# CONFIG_NETLINK_DEV is not set
351CONFIG_UNIX=y
352# CONFIG_NET_KEY is not set
353CONFIG_INET=y
354# CONFIG_IP_MULTICAST is not set
355# CONFIG_IP_ADVANCED_ROUTER is not set
356CONFIG_IP_PNP=y
357CONFIG_IP_PNP_DHCP=y
358CONFIG_IP_PNP_BOOTP=y
359# CONFIG_IP_PNP_RARP is not set
360# CONFIG_NET_IPIP is not set
361# CONFIG_NET_IPGRE is not set
362# CONFIG_ARPD is not set
363# CONFIG_SYN_COOKIES is not set
364# CONFIG_INET_AH is not set
365# CONFIG_INET_ESP is not set
366# CONFIG_INET_IPCOMP is not set
367# CONFIG_INET_TUNNEL is not set
368# CONFIG_IP_TCPDIAG is not set
369# CONFIG_IP_TCPDIAG_IPV6 is not set
370# CONFIG_IPV6 is not set
371# CONFIG_NETFILTER is not set
372
373#
374# SCTP Configuration (EXPERIMENTAL)
375#
376# CONFIG_IP_SCTP is not set
377# CONFIG_ATM is not set
378# CONFIG_BRIDGE is not set
379# CONFIG_VLAN_8021Q is not set
380# CONFIG_DECNET is not set
381# CONFIG_LLC2 is not set
382# CONFIG_IPX is not set
383# CONFIG_ATALK is not set
384# CONFIG_X25 is not set
385# CONFIG_LAPB is not set
386# CONFIG_NET_DIVERT is not set
387# CONFIG_ECONET is not set
388# CONFIG_WAN_ROUTER is not set
389
390#
391# QoS and/or fair queueing
392#
393# CONFIG_NET_SCHED is not set
394# CONFIG_NET_CLS_ROUTE is not set
395
396#
397# Network testing
398#
399# CONFIG_NET_PKTGEN is not set
400# CONFIG_NETPOLL is not set
401# CONFIG_NET_POLL_CONTROLLER is not set
402# CONFIG_HAMRADIO is not set
403CONFIG_IRDA=m
404
405#
406# IrDA protocols
407#
408CONFIG_IRLAN=m
409CONFIG_IRNET=m
410CONFIG_IRCOMM=m
411# CONFIG_IRDA_ULTRA is not set
412
413#
414# IrDA options
415#
416# CONFIG_IRDA_CACHE_LAST_LSAP is not set
417# CONFIG_IRDA_FAST_RR is not set
418# CONFIG_IRDA_DEBUG is not set
419
420#
421# Infrared-port device drivers
422#
423
424#
425# SIR device drivers
426#
427CONFIG_IRTTY_SIR=m
428
429#
430# Dongle support
431#
432# CONFIG_DONGLE is not set
433
434#
435# Old SIR device drivers
436#
437CONFIG_IRPORT_SIR=m
438
439#
440# Old Serial dongle support
441#
442# CONFIG_DONGLE_OLD is not set
443
444#
445# FIR device drivers
446#
447# CONFIG_NSC_FIR is not set
448# CONFIG_WINBOND_FIR is not set
449# CONFIG_SMC_IRCC_FIR is not set
450# CONFIG_ALI_FIR is not set
451CONFIG_SA1100_FIR=m
452CONFIG_BT=m
453CONFIG_BT_L2CAP=m
454CONFIG_BT_SCO=m
455CONFIG_BT_RFCOMM=m
456CONFIG_BT_RFCOMM_TTY=y
457CONFIG_BT_BNEP=m
458CONFIG_BT_BNEP_MC_FILTER=y
459CONFIG_BT_BNEP_PROTO_FILTER=y
460# CONFIG_BT_HIDP is not set
461
462#
463# Bluetooth device drivers
464#
465# CONFIG_BT_HCIUART is not set
466# CONFIG_BT_HCIDTL1 is not set
467# CONFIG_BT_HCIBT3C is not set
468# CONFIG_BT_HCIBLUECARD is not set
469# CONFIG_BT_HCIBTUART is not set
470# CONFIG_BT_HCIVHCI is not set
471CONFIG_NETDEVICES=y
472CONFIG_DUMMY=y
473# CONFIG_BONDING is not set
474# CONFIG_EQUALIZER is not set
475# CONFIG_TUN is not set
476
477#
478# ARCnet devices
479#
480# CONFIG_ARCNET is not set
481
482#
483# Ethernet (10 or 100Mbit)
484#
485CONFIG_NET_ETHERNET=y
486CONFIG_MII=m
487# CONFIG_NET_VENDOR_3COM is not set
488# CONFIG_LANCE is not set
489# CONFIG_NET_VENDOR_SMC is not set
490# CONFIG_SMC91X is not set
491# CONFIG_NET_VENDOR_RACAL is not set
492# CONFIG_AT1700 is not set
493# CONFIG_DEPCA is not set
494# CONFIG_HP100 is not set
495# CONFIG_NET_ISA is not set
496CONFIG_NET_PCI=y
497# CONFIG_AC3200 is not set
498# CONFIG_APRICOT is not set
499# CONFIG_CS89x0 is not set
500# CONFIG_NET_POCKET is not set
501
502#
503# Ethernet (1000 Mbit)
504#
505
506#
507# Ethernet (10000 Mbit)
508#
509
510#
511# Token Ring devices
512#
513# CONFIG_TR is not set
514
515#
516# Wireless LAN (non-hamradio)
517#
518CONFIG_NET_RADIO=y
519
520#
521# Obsolete Wireless cards support (pre-802.11)
522#
523# CONFIG_STRIP is not set
524# CONFIG_ARLAN is not set
525# CONFIG_WAVELAN is not set
526CONFIG_PCMCIA_WAVELAN=m
527# CONFIG_PCMCIA_NETWAVE is not set
528
529#
530# Wireless 802.11 Frequency Hopping cards support
531#
532# CONFIG_PCMCIA_RAYCS is not set
533
534#
535# Wireless 802.11b ISA/PCI cards support
536#
537# CONFIG_HERMES is not set
538# CONFIG_ATMEL is not set
539
540#
541# Wireless 802.11b Pcmcia/Cardbus cards support
542#
543# CONFIG_AIRO_CS is not set
544# CONFIG_PCMCIA_WL3501 is not set
545CONFIG_NET_WIRELESS=y
546
547#
548# PCMCIA network device support
549#
550CONFIG_NET_PCMCIA=y
551CONFIG_PCMCIA_3C589=m
552CONFIG_PCMCIA_3C574=m
553# CONFIG_PCMCIA_FMVJ18X is not set
554CONFIG_PCMCIA_PCNET=m
555# CONFIG_PCMCIA_NMCLAN is not set
556CONFIG_PCMCIA_SMC91C92=m
557CONFIG_PCMCIA_XIRC2PS=m
558# CONFIG_PCMCIA_AXNET is not set
559
560#
561# Wan interfaces
562#
563# CONFIG_WAN is not set
564CONFIG_PPP=m
565CONFIG_PPP_MULTILINK=y
566CONFIG_PPP_FILTER=y
567CONFIG_PPP_ASYNC=m
568CONFIG_PPP_SYNC_TTY=m
569CONFIG_PPP_DEFLATE=m
570CONFIG_PPP_BSDCOMP=m
571CONFIG_PPPOE=m
572# CONFIG_SLIP is not set
573# CONFIG_SHAPER is not set
574# CONFIG_NETCONSOLE is not set
575
576#
577# ISDN subsystem
578#
579# CONFIG_ISDN is not set
580
581#
582# Input device support
583#
584CONFIG_INPUT=y
585
586#
587# Userland interfaces
588#
589CONFIG_INPUT_MOUSEDEV=y
590CONFIG_INPUT_MOUSEDEV_PSAUX=y
591CONFIG_INPUT_MOUSEDEV_SCREEN_X=800
592CONFIG_INPUT_MOUSEDEV_SCREEN_Y=600
593# CONFIG_INPUT_JOYDEV is not set
594CONFIG_INPUT_TSDEV=y
595CONFIG_INPUT_TSDEV_SCREEN_X=800
596CONFIG_INPUT_TSDEV_SCREEN_Y=600
597CONFIG_INPUT_EVDEV=m
598CONFIG_INPUT_EVBUG=y
599
600#
601# Input Device Drivers
602#
603# CONFIG_INPUT_KEYBOARD is not set
604# CONFIG_INPUT_MOUSE is not set
605# CONFIG_INPUT_JOYSTICK is not set
606# CONFIG_INPUT_TOUCHSCREEN is not set
607# CONFIG_INPUT_MISC is not set
608
609#
610# Hardware I/O ports
611#
612CONFIG_SERIO=m
613CONFIG_SERIO_SERPORT=m
614# CONFIG_SERIO_LIBPS2 is not set
615# CONFIG_SERIO_RAW is not set
616# CONFIG_GAMEPORT is not set
617CONFIG_SOUND_GAMEPORT=y
618
619#
620# Character devices
621#
622CONFIG_VT=y
623CONFIG_VT_CONSOLE=y
624CONFIG_HW_CONSOLE=y
625# CONFIG_SERIAL_NONSTANDARD is not set
626
627#
628# Serial drivers
629#
630# CONFIG_SERIAL_8250 is not set
631
632#
633# Non-8250 serial port support
634#
635CONFIG_SERIAL_SA1100=y
636CONFIG_SERIAL_SA1100_CONSOLE=y
637CONFIG_SERIAL_CORE=y
638CONFIG_SERIAL_CORE_CONSOLE=y
639CONFIG_UNIX98_PTYS=y
640CONFIG_LEGACY_PTYS=y
641CONFIG_LEGACY_PTY_COUNT=256
642
643#
644# IPMI
645#
646# CONFIG_IPMI_HANDLER is not set
647
648#
649# Watchdog Cards
650#
651# CONFIG_WATCHDOG is not set
652# CONFIG_NVRAM is not set
653# CONFIG_RTC is not set
654# CONFIG_DTLK is not set
655# CONFIG_R3964 is not set
656
657#
658# Ftape, the floppy tape device driver
659#
660# CONFIG_DRM is not set
661
662#
663# PCMCIA character devices
664#
665# CONFIG_SYNCLINK_CS is not set
666# CONFIG_RAW_DRIVER is not set
667
668#
669# TPM devices
670#
671# CONFIG_TCG_TPM is not set
672
673#
674# I2C support
675#
676# CONFIG_I2C is not set
677
678#
679# Misc devices
680#
681
682#
683# Multimedia devices
684#
685# CONFIG_VIDEO_DEV is not set
686
687#
688# Digital Video Broadcasting Devices
689#
690# CONFIG_DVB is not set
691
692#
693# Graphics support
694#
695CONFIG_FB=y
696# CONFIG_FB_CFB_FILLRECT is not set
697# CONFIG_FB_CFB_COPYAREA is not set
698# CONFIG_FB_CFB_IMAGEBLIT is not set
699# CONFIG_FB_SOFT_CURSOR is not set
700# CONFIG_FB_MODE_HELPERS is not set
701# CONFIG_FB_TILEBLITTING is not set
702# CONFIG_FB_SA1100 is not set
703# CONFIG_FB_VIRTUAL is not set
704
705#
706# Console display driver support
707#
708# CONFIG_VGA_CONSOLE is not set
709# CONFIG_MDA_CONSOLE is not set
710CONFIG_DUMMY_CONSOLE=y
711CONFIG_FRAMEBUFFER_CONSOLE=y
712# CONFIG_FONTS is not set
713CONFIG_FONT_8x8=y
714CONFIG_FONT_8x16=y
715
716#
717# Logo configuration
718#
719CONFIG_LOGO=y
720CONFIG_LOGO_LINUX_MONO=y
721CONFIG_LOGO_LINUX_VGA16=y
722CONFIG_LOGO_LINUX_CLUT224=y
723# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
724
725#
726# Sound
727#
728CONFIG_SOUND=y
729
730#
731# Advanced Linux Sound Architecture
732#
733# CONFIG_SND is not set
734
735#
736# Open Sound System
737#
738# CONFIG_SOUND_PRIME is not set
739
740#
741# USB support
742#
743CONFIG_USB_ARCH_HAS_HCD=y
744# CONFIG_USB_ARCH_HAS_OHCI is not set
745# CONFIG_USB is not set
746
747#
748# USB Gadget Support
749#
750# CONFIG_USB_GADGET is not set
751
752#
753# MMC/SD Card support
754#
755# CONFIG_MMC is not set
756
757#
758# File systems
759#
760CONFIG_EXT2_FS=m
761# CONFIG_EXT2_FS_XATTR is not set
762CONFIG_EXT3_FS=m
763CONFIG_EXT3_FS_XATTR=y
764# CONFIG_EXT3_FS_POSIX_ACL is not set
765# CONFIG_EXT3_FS_SECURITY is not set
766CONFIG_JBD=m
767# CONFIG_JBD_DEBUG is not set
768CONFIG_FS_MBCACHE=m
769CONFIG_REISERFS_FS=m
770# CONFIG_REISERFS_CHECK is not set
771CONFIG_REISERFS_PROC_INFO=y
772# CONFIG_REISERFS_FS_XATTR is not set
773# CONFIG_JFS_FS is not set
774
775#
776# XFS support
777#
778# CONFIG_XFS_FS is not set
779# CONFIG_MINIX_FS is not set
780# CONFIG_ROMFS_FS is not set
781# CONFIG_QUOTA is not set
782CONFIG_DNOTIFY=y
783# CONFIG_AUTOFS_FS is not set
784# CONFIG_AUTOFS4_FS is not set
785
786#
787# CD-ROM/DVD Filesystems
788#
789# CONFIG_ISO9660_FS is not set
790# CONFIG_UDF_FS is not set
791
792#
793# DOS/FAT/NT Filesystems
794#
795CONFIG_FAT_FS=m
796CONFIG_MSDOS_FS=m
797CONFIG_VFAT_FS=m
798CONFIG_FAT_DEFAULT_CODEPAGE=437
799CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
800# CONFIG_NTFS_FS is not set
801
802#
803# Pseudo filesystems
804#
805CONFIG_PROC_FS=y
806CONFIG_SYSFS=y
807CONFIG_DEVFS_FS=y
808CONFIG_DEVFS_MOUNT=y
809# CONFIG_DEVFS_DEBUG is not set
810# CONFIG_DEVPTS_FS_XATTR is not set
811# CONFIG_TMPFS is not set
812# CONFIG_HUGETLB_PAGE is not set
813CONFIG_RAMFS=y
814
815#
816# Miscellaneous filesystems
817#
818# CONFIG_ADFS_FS is not set
819# CONFIG_AFFS_FS is not set
820# CONFIG_HFS_FS is not set
821# CONFIG_HFSPLUS_FS is not set
822# CONFIG_BEFS_FS is not set
823# CONFIG_BFS_FS is not set
824# CONFIG_EFS_FS is not set
825CONFIG_JFFS_FS=m
826CONFIG_JFFS_FS_VERBOSE=0
827# CONFIG_JFFS_PROC_FS is not set
828CONFIG_JFFS2_FS=y
829CONFIG_JFFS2_FS_DEBUG=0
830# CONFIG_JFFS2_FS_NAND is not set
831# CONFIG_JFFS2_FS_NOR_ECC is not set
832# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
833CONFIG_JFFS2_ZLIB=y
834CONFIG_JFFS2_RTIME=y
835# CONFIG_JFFS2_RUBIN is not set
836CONFIG_CRAMFS=m
837# CONFIG_VXFS_FS is not set
838# CONFIG_HPFS_FS is not set
839# CONFIG_QNX4FS_FS is not set
840# CONFIG_SYSV_FS is not set
841# CONFIG_UFS_FS is not set
842
843#
844# Network File Systems
845#
846CONFIG_NFS_FS=y
847CONFIG_NFS_V3=y
848# CONFIG_NFS_V4 is not set
849# CONFIG_NFS_DIRECTIO is not set
850# CONFIG_NFSD is not set
851# CONFIG_ROOT_NFS is not set
852CONFIG_LOCKD=y
853CONFIG_LOCKD_V4=y
854CONFIG_SUNRPC=y
855# CONFIG_RPCSEC_GSS_KRB5 is not set
856# CONFIG_RPCSEC_GSS_SPKM3 is not set
857CONFIG_SMB_FS=m
858# CONFIG_SMB_NLS_DEFAULT is not set
859# CONFIG_CIFS is not set
860# CONFIG_NCP_FS is not set
861# CONFIG_CODA_FS is not set
862# CONFIG_AFS_FS is not set
863
864#
865# Partition Types
866#
867# CONFIG_PARTITION_ADVANCED is not set
868CONFIG_MSDOS_PARTITION=y
869
870#
871# Native Language Support
872#
873CONFIG_NLS=y
874CONFIG_NLS_DEFAULT="iso8859-1"
875CONFIG_NLS_CODEPAGE_437=y
876# CONFIG_NLS_CODEPAGE_737 is not set
877# CONFIG_NLS_CODEPAGE_775 is not set
878CONFIG_NLS_CODEPAGE_850=y
879# CONFIG_NLS_CODEPAGE_852 is not set
880# CONFIG_NLS_CODEPAGE_855 is not set
881# CONFIG_NLS_CODEPAGE_857 is not set
882# CONFIG_NLS_CODEPAGE_860 is not set
883# CONFIG_NLS_CODEPAGE_861 is not set
884# CONFIG_NLS_CODEPAGE_862 is not set
885# CONFIG_NLS_CODEPAGE_863 is not set
886# CONFIG_NLS_CODEPAGE_864 is not set
887# CONFIG_NLS_CODEPAGE_865 is not set
888# CONFIG_NLS_CODEPAGE_866 is not set
889# CONFIG_NLS_CODEPAGE_869 is not set
890# CONFIG_NLS_CODEPAGE_936 is not set
891# CONFIG_NLS_CODEPAGE_950 is not set
892# CONFIG_NLS_CODEPAGE_932 is not set
893# CONFIG_NLS_CODEPAGE_949 is not set
894# CONFIG_NLS_CODEPAGE_874 is not set
895# CONFIG_NLS_ISO8859_8 is not set
896# CONFIG_NLS_CODEPAGE_1250 is not set
897# CONFIG_NLS_CODEPAGE_1251 is not set
898# CONFIG_NLS_ASCII is not set
899CONFIG_NLS_ISO8859_1=y
900# CONFIG_NLS_ISO8859_2 is not set
901# CONFIG_NLS_ISO8859_3 is not set
902# CONFIG_NLS_ISO8859_4 is not set
903# CONFIG_NLS_ISO8859_5 is not set
904# CONFIG_NLS_ISO8859_6 is not set
905# CONFIG_NLS_ISO8859_7 is not set
906# CONFIG_NLS_ISO8859_9 is not set
907# CONFIG_NLS_ISO8859_13 is not set
908# CONFIG_NLS_ISO8859_14 is not set
909CONFIG_NLS_ISO8859_15=y
910# CONFIG_NLS_KOI8_R is not set
911# CONFIG_NLS_KOI8_U is not set
912# CONFIG_NLS_UTF8 is not set
913
914#
915# Profiling support
916#
917# CONFIG_PROFILING is not set
918
919#
920# Kernel hacking
921#
922# CONFIG_PRINTK_TIME is not set
923CONFIG_DEBUG_KERNEL=y
924# CONFIG_MAGIC_SYSRQ is not set
925CONFIG_LOG_BUF_SHIFT=14
926# CONFIG_SCHEDSTATS is not set
927# CONFIG_DEBUG_SLAB is not set
928CONFIG_DEBUG_PREEMPT=y
929# CONFIG_DEBUG_SPINLOCK is not set
930# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
931# CONFIG_DEBUG_KOBJECT is not set
932CONFIG_DEBUG_BUGVERBOSE=y
933# CONFIG_DEBUG_INFO is not set
934# CONFIG_DEBUG_FS is not set
935CONFIG_FRAME_POINTER=y
936CONFIG_DEBUG_USER=y
937# CONFIG_DEBUG_WAITQ is not set
938CONFIG_DEBUG_ERRORS=y
939CONFIG_DEBUG_LL=y
940# CONFIG_DEBUG_ICEDCC is not set
941
942#
943# Security options
944#
945# CONFIG_KEYS is not set
946# CONFIG_SECURITY is not set
947
948#
949# Cryptographic options
950#
951# CONFIG_CRYPTO is not set
952
953#
954# Hardware crypto devices
955#
956
957#
958# Library routines
959#
960CONFIG_CRC_CCITT=m
961CONFIG_CRC32=y
962# CONFIG_LIBCRC32C is not set
963CONFIG_ZLIB_INFLATE=y
964CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/smdk2410_defconfig b/arch/arm/configs/smdk2410_defconfig
new file mode 100644
index 000000000000..2c60865fda19
--- /dev/null
+++ b/arch/arm/configs/smdk2410_defconfig
@@ -0,0 +1,736 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 22:42:40 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52# CONFIG_MODULES is not set
53
54#
55# System Type
56#
57# CONFIG_ARCH_CLPS7500 is not set
58# CONFIG_ARCH_CLPS711X is not set
59# CONFIG_ARCH_CO285 is not set
60# CONFIG_ARCH_EBSA110 is not set
61# CONFIG_ARCH_CAMELOT is not set
62# CONFIG_ARCH_FOOTBRIDGE is not set
63# CONFIG_ARCH_INTEGRATOR is not set
64# CONFIG_ARCH_IOP3XX is not set
65# CONFIG_ARCH_IXP4XX is not set
66# CONFIG_ARCH_IXP2000 is not set
67# CONFIG_ARCH_L7200 is not set
68# CONFIG_ARCH_PXA is not set
69# CONFIG_ARCH_RPC is not set
70# CONFIG_ARCH_SA1100 is not set
71CONFIG_ARCH_S3C2410=y
72# CONFIG_ARCH_SHARK is not set
73# CONFIG_ARCH_LH7A40X is not set
74# CONFIG_ARCH_OMAP is not set
75# CONFIG_ARCH_VERSATILE is not set
76# CONFIG_ARCH_IMX is not set
77# CONFIG_ARCH_H720X is not set
78
79#
80# S3C24XX Implementations
81#
82# CONFIG_ARCH_BAST is not set
83# CONFIG_ARCH_H1940 is not set
84# CONFIG_MACH_N30 is not set
85CONFIG_ARCH_SMDK2410=y
86# CONFIG_ARCH_S3C2440 is not set
87# CONFIG_MACH_VR1000 is not set
88# CONFIG_MACH_RX3715 is not set
89# CONFIG_MACH_OTOM is not set
90# CONFIG_MACH_NEXCODER_2440 is not set
91CONFIG_CPU_S3C2410=y
92
93#
94# S3C2410 Boot
95#
96
97#
98# S3C2410 Setup
99#
100# CONFIG_S3C2410_DMA is not set
101CONFIG_S3C2410_LOWLEVEL_UART_PORT=0
102
103#
104# Processor Type
105#
106CONFIG_CPU_32=y
107CONFIG_CPU_ARM920T=y
108CONFIG_CPU_32v4=y
109CONFIG_CPU_ABRT_EV4T=y
110CONFIG_CPU_CACHE_V4WT=y
111CONFIG_CPU_CACHE_VIVT=y
112CONFIG_CPU_COPY_V4WB=y
113CONFIG_CPU_TLB_V4WBI=y
114
115#
116# Processor Features
117#
118CONFIG_ARM_THUMB=y
119# CONFIG_CPU_ICACHE_DISABLE is not set
120# CONFIG_CPU_DCACHE_DISABLE is not set
121# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
122
123#
124# Bus support
125#
126
127#
128# PCCARD (PCMCIA/CardBus) support
129#
130# CONFIG_PCCARD is not set
131
132#
133# Kernel Features
134#
135# CONFIG_PREEMPT is not set
136CONFIG_ALIGNMENT_TRAP=y
137
138#
139# Boot options
140#
141CONFIG_ZBOOT_ROM_TEXT=0x0
142CONFIG_ZBOOT_ROM_BSS=0x0
143CONFIG_CMDLINE="root=1f04 mem=32M"
144# CONFIG_XIP_KERNEL is not set
145
146#
147# Floating point emulation
148#
149
150#
151# At least one emulation must be selected
152#
153# CONFIG_FPE_NWFPE is not set
154# CONFIG_FPE_FASTFPE is not set
155
156#
157# Userspace binary formats
158#
159CONFIG_BINFMT_ELF=y
160CONFIG_BINFMT_AOUT=y
161# CONFIG_BINFMT_MISC is not set
162# CONFIG_ARTHUR is not set
163
164#
165# Power management options
166#
167# CONFIG_PM is not set
168
169#
170# Device Drivers
171#
172
173#
174# Generic Driver Options
175#
176CONFIG_STANDALONE=y
177CONFIG_PREVENT_FIRMWARE_BUILD=y
178# CONFIG_FW_LOADER is not set
179# CONFIG_DEBUG_DRIVER is not set
180
181#
182# Memory Technology Devices (MTD)
183#
184CONFIG_MTD=y
185# CONFIG_MTD_DEBUG is not set
186# CONFIG_MTD_CONCAT is not set
187# CONFIG_MTD_PARTITIONS is not set
188
189#
190# User Modules And Translation Layers
191#
192CONFIG_MTD_CHAR=y
193CONFIG_MTD_BLOCK=y
194# CONFIG_FTL is not set
195# CONFIG_NFTL is not set
196# CONFIG_INFTL is not set
197
198#
199# RAM/ROM/Flash chip drivers
200#
201CONFIG_MTD_CFI=y
202# CONFIG_MTD_JEDECPROBE is not set
203CONFIG_MTD_GEN_PROBE=y
204# CONFIG_MTD_CFI_ADV_OPTIONS 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
228# CONFIG_MTD_PHYSMAP is not set
229# CONFIG_MTD_ARM_INTEGRATOR is not set
230# CONFIG_MTD_EDB7312 is not set
231
232#
233# Self-contained MTD device drivers
234#
235# CONFIG_MTD_SLRAM is not set
236# CONFIG_MTD_PHRAM is not set
237# CONFIG_MTD_MTDRAM is not set
238# CONFIG_MTD_BLKMTD is not set
239# CONFIG_MTD_BLOCK2MTD is not set
240
241#
242# Disk-On-Chip Device Drivers
243#
244# CONFIG_MTD_DOC2000 is not set
245# CONFIG_MTD_DOC2001 is not set
246# CONFIG_MTD_DOC2001PLUS is not set
247
248#
249# NAND Flash Device Drivers
250#
251# CONFIG_MTD_NAND is not set
252
253#
254# Parallel port support
255#
256# CONFIG_PARPORT is not set
257
258#
259# Plug and Play support
260#
261
262#
263# Block devices
264#
265# CONFIG_BLK_DEV_FD is not set
266# CONFIG_BLK_DEV_COW_COMMON is not set
267# CONFIG_BLK_DEV_LOOP is not set
268# CONFIG_BLK_DEV_NBD is not set
269CONFIG_BLK_DEV_RAM=y
270CONFIG_BLK_DEV_RAM_COUNT=16
271CONFIG_BLK_DEV_RAM_SIZE=4096
272# CONFIG_BLK_DEV_INITRD is not set
273CONFIG_INITRAMFS_SOURCE=""
274# CONFIG_CDROM_PKTCDVD is not set
275
276#
277# IO Schedulers
278#
279CONFIG_IOSCHED_NOOP=y
280CONFIG_IOSCHED_AS=y
281CONFIG_IOSCHED_DEADLINE=y
282CONFIG_IOSCHED_CFQ=y
283# CONFIG_ATA_OVER_ETH is not set
284
285#
286# ATA/ATAPI/MFM/RLL support
287#
288# CONFIG_IDE is not set
289
290#
291# SCSI device support
292#
293# CONFIG_SCSI is not set
294
295#
296# Multi-device support (RAID and LVM)
297#
298# CONFIG_MD is not set
299
300#
301# Fusion MPT device support
302#
303
304#
305# IEEE 1394 (FireWire) support
306#
307
308#
309# I2O device support
310#
311
312#
313# Networking support
314#
315CONFIG_NET=y
316
317#
318# Networking options
319#
320# CONFIG_PACKET is not set
321# CONFIG_NETLINK_DEV is not set
322CONFIG_UNIX=y
323# CONFIG_NET_KEY is not set
324CONFIG_INET=y
325# CONFIG_IP_MULTICAST is not set
326# CONFIG_IP_ADVANCED_ROUTER is not set
327CONFIG_IP_PNP=y
328# CONFIG_IP_PNP_DHCP is not set
329CONFIG_IP_PNP_BOOTP=y
330# CONFIG_IP_PNP_RARP is not set
331# CONFIG_NET_IPIP is not set
332# CONFIG_NET_IPGRE is not set
333# CONFIG_ARPD is not set
334# CONFIG_SYN_COOKIES is not set
335# CONFIG_INET_AH is not set
336# CONFIG_INET_ESP is not set
337# CONFIG_INET_IPCOMP is not set
338# CONFIG_INET_TUNNEL is not set
339# CONFIG_IP_TCPDIAG is not set
340# CONFIG_IP_TCPDIAG_IPV6 is not set
341# CONFIG_IPV6 is not set
342# CONFIG_NETFILTER is not set
343
344#
345# SCTP Configuration (EXPERIMENTAL)
346#
347# CONFIG_IP_SCTP is not set
348# CONFIG_ATM is not set
349# CONFIG_BRIDGE is not set
350# CONFIG_VLAN_8021Q is not set
351# CONFIG_DECNET is not set
352# CONFIG_LLC2 is not set
353# CONFIG_IPX is not set
354# CONFIG_ATALK is not set
355# CONFIG_X25 is not set
356# CONFIG_LAPB is not set
357# CONFIG_NET_DIVERT is not set
358# CONFIG_ECONET is not set
359# CONFIG_WAN_ROUTER is not set
360
361#
362# QoS and/or fair queueing
363#
364# CONFIG_NET_SCHED is not set
365# CONFIG_NET_CLS_ROUTE is not set
366
367#
368# Network testing
369#
370# CONFIG_NET_PKTGEN is not set
371# CONFIG_NETPOLL is not set
372# CONFIG_NET_POLL_CONTROLLER is not set
373# CONFIG_HAMRADIO is not set
374# CONFIG_IRDA is not set
375# CONFIG_BT is not set
376CONFIG_NETDEVICES=y
377# CONFIG_DUMMY is not set
378# CONFIG_BONDING is not set
379# CONFIG_EQUALIZER is not set
380# CONFIG_TUN is not set
381
382#
383# Ethernet (10 or 100Mbit)
384#
385CONFIG_NET_ETHERNET=y
386# CONFIG_MII is not set
387# CONFIG_SMC91X is not set
388
389#
390# Ethernet (1000 Mbit)
391#
392
393#
394# Ethernet (10000 Mbit)
395#
396
397#
398# Token Ring devices
399#
400
401#
402# Wireless LAN (non-hamradio)
403#
404# CONFIG_NET_RADIO is not set
405
406#
407# Wan interfaces
408#
409# CONFIG_WAN is not set
410# CONFIG_PPP is not set
411# CONFIG_SLIP is not set
412# CONFIG_SHAPER is not set
413# CONFIG_NETCONSOLE is not set
414
415#
416# ISDN subsystem
417#
418# CONFIG_ISDN is not set
419
420#
421# Input device support
422#
423CONFIG_INPUT=y
424
425#
426# Userland interfaces
427#
428CONFIG_INPUT_MOUSEDEV=y
429CONFIG_INPUT_MOUSEDEV_PSAUX=y
430CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
431CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
432# CONFIG_INPUT_JOYDEV is not set
433# CONFIG_INPUT_TSDEV is not set
434# CONFIG_INPUT_EVDEV is not set
435# CONFIG_INPUT_EVBUG is not set
436
437#
438# Input Device Drivers
439#
440CONFIG_INPUT_KEYBOARD=y
441CONFIG_KEYBOARD_ATKBD=y
442# CONFIG_KEYBOARD_SUNKBD is not set
443# CONFIG_KEYBOARD_LKKBD is not set
444# CONFIG_KEYBOARD_XTKBD is not set
445# CONFIG_KEYBOARD_NEWTON is not set
446CONFIG_INPUT_MOUSE=y
447CONFIG_MOUSE_PS2=y
448# CONFIG_MOUSE_SERIAL is not set
449# CONFIG_MOUSE_VSXXXAA is not set
450# CONFIG_INPUT_JOYSTICK is not set
451# CONFIG_INPUT_TOUCHSCREEN is not set
452# CONFIG_INPUT_MISC is not set
453
454#
455# Hardware I/O ports
456#
457CONFIG_SERIO=y
458CONFIG_SERIO_SERPORT=y
459CONFIG_SERIO_LIBPS2=y
460# CONFIG_SERIO_RAW is not set
461# CONFIG_GAMEPORT is not set
462CONFIG_SOUND_GAMEPORT=y
463
464#
465# Character devices
466#
467CONFIG_VT=y
468CONFIG_VT_CONSOLE=y
469CONFIG_HW_CONSOLE=y
470# CONFIG_SERIAL_NONSTANDARD is not set
471
472#
473# Serial drivers
474#
475# CONFIG_SERIAL_8250 is not set
476
477#
478# Non-8250 serial port support
479#
480CONFIG_SERIAL_S3C2410=y
481CONFIG_SERIAL_S3C2410_CONSOLE=y
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
498# CONFIG_RTC is not set
499# CONFIG_S3C2410_RTC is not set
500# CONFIG_DTLK is not set
501# CONFIG_R3964 is not set
502
503#
504# Ftape, the floppy tape device driver
505#
506# CONFIG_DRM is not set
507# CONFIG_RAW_DRIVER is not set
508
509#
510# TPM devices
511#
512# CONFIG_TCG_TPM is not set
513
514#
515# I2C support
516#
517# CONFIG_I2C is not set
518
519#
520# Misc devices
521#
522
523#
524# Multimedia devices
525#
526# CONFIG_VIDEO_DEV is not set
527
528#
529# Digital Video Broadcasting Devices
530#
531# CONFIG_DVB is not set
532
533#
534# Graphics support
535#
536CONFIG_FB=y
537CONFIG_FB_CFB_FILLRECT=y
538CONFIG_FB_CFB_COPYAREA=y
539CONFIG_FB_CFB_IMAGEBLIT=y
540CONFIG_FB_SOFT_CURSOR=y
541# CONFIG_FB_MODE_HELPERS is not set
542# CONFIG_FB_TILEBLITTING is not set
543CONFIG_FB_VIRTUAL=y
544
545#
546# Console display driver support
547#
548# CONFIG_VGA_CONSOLE is not set
549CONFIG_DUMMY_CONSOLE=y
550CONFIG_FRAMEBUFFER_CONSOLE=y
551# CONFIG_FONTS is not set
552CONFIG_FONT_8x8=y
553CONFIG_FONT_8x16=y
554
555#
556# Logo configuration
557#
558# CONFIG_LOGO is not set
559# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
560
561#
562# Sound
563#
564# CONFIG_SOUND is not set
565
566#
567# USB support
568#
569CONFIG_USB_ARCH_HAS_HCD=y
570# CONFIG_USB_ARCH_HAS_OHCI is not set
571# CONFIG_USB is not set
572
573#
574# USB Gadget Support
575#
576# CONFIG_USB_GADGET is not set
577
578#
579# MMC/SD Card support
580#
581# CONFIG_MMC is not set
582
583#
584# File systems
585#
586CONFIG_EXT2_FS=y
587# CONFIG_EXT2_FS_XATTR is not set
588# CONFIG_EXT3_FS is not set
589# CONFIG_JBD is not set
590# CONFIG_REISERFS_FS is not set
591# CONFIG_JFS_FS is not set
592
593#
594# XFS support
595#
596# CONFIG_XFS_FS is not set
597# CONFIG_MINIX_FS is not set
598CONFIG_ROMFS_FS=y
599# CONFIG_QUOTA is not set
600CONFIG_DNOTIFY=y
601# CONFIG_AUTOFS_FS is not set
602# CONFIG_AUTOFS4_FS is not set
603
604#
605# CD-ROM/DVD Filesystems
606#
607# CONFIG_ISO9660_FS is not set
608# CONFIG_UDF_FS is not set
609
610#
611# DOS/FAT/NT Filesystems
612#
613# CONFIG_MSDOS_FS is not set
614# CONFIG_VFAT_FS is not set
615# CONFIG_NTFS_FS is not set
616
617#
618# Pseudo filesystems
619#
620CONFIG_PROC_FS=y
621CONFIG_SYSFS=y
622# CONFIG_DEVFS_FS is not set
623# CONFIG_DEVPTS_FS_XATTR is not set
624# CONFIG_TMPFS is not set
625# CONFIG_HUGETLB_PAGE is not set
626CONFIG_RAMFS=y
627
628#
629# Miscellaneous filesystems
630#
631# CONFIG_ADFS_FS is not set
632# CONFIG_AFFS_FS is not set
633# CONFIG_HFS_FS is not set
634# CONFIG_HFSPLUS_FS is not set
635# CONFIG_BEFS_FS is not set
636# CONFIG_BFS_FS is not set
637# CONFIG_EFS_FS is not set
638# CONFIG_JFFS_FS is not set
639# CONFIG_JFFS2_FS is not set
640# CONFIG_CRAMFS is not set
641# CONFIG_VXFS_FS is not set
642# CONFIG_HPFS_FS is not set
643# CONFIG_QNX4FS_FS is not set
644# CONFIG_SYSV_FS is not set
645# CONFIG_UFS_FS is not set
646
647#
648# Network File Systems
649#
650CONFIG_NFS_FS=y
651# CONFIG_NFS_V3 is not set
652# CONFIG_NFS_V4 is not set
653# CONFIG_NFS_DIRECTIO is not set
654# CONFIG_NFSD is not set
655CONFIG_ROOT_NFS=y
656CONFIG_LOCKD=y
657CONFIG_SUNRPC=y
658# CONFIG_RPCSEC_GSS_KRB5 is not set
659# CONFIG_RPCSEC_GSS_SPKM3 is not set
660# CONFIG_SMB_FS is not set
661# CONFIG_CIFS is not set
662# CONFIG_NCP_FS is not set
663# CONFIG_CODA_FS is not set
664# CONFIG_AFS_FS is not set
665
666#
667# Partition Types
668#
669CONFIG_PARTITION_ADVANCED=y
670# CONFIG_ACORN_PARTITION is not set
671# CONFIG_OSF_PARTITION is not set
672# CONFIG_AMIGA_PARTITION is not set
673# CONFIG_ATARI_PARTITION is not set
674# CONFIG_MAC_PARTITION is not set
675# CONFIG_MSDOS_PARTITION is not set
676# CONFIG_LDM_PARTITION is not set
677# CONFIG_SGI_PARTITION is not set
678# CONFIG_ULTRIX_PARTITION is not set
679# CONFIG_SUN_PARTITION is not set
680# CONFIG_EFI_PARTITION is not set
681
682#
683# Native Language Support
684#
685# CONFIG_NLS is not set
686
687#
688# Profiling support
689#
690# CONFIG_PROFILING is not set
691
692#
693# Kernel hacking
694#
695# CONFIG_PRINTK_TIME is not set
696CONFIG_DEBUG_KERNEL=y
697# CONFIG_MAGIC_SYSRQ is not set
698CONFIG_LOG_BUF_SHIFT=14
699# CONFIG_SCHEDSTATS is not set
700# CONFIG_DEBUG_SLAB is not set
701# CONFIG_DEBUG_SPINLOCK is not set
702# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
703# CONFIG_DEBUG_KOBJECT is not set
704CONFIG_DEBUG_BUGVERBOSE=y
705# CONFIG_DEBUG_INFO is not set
706# CONFIG_DEBUG_FS is not set
707CONFIG_FRAME_POINTER=y
708CONFIG_DEBUG_USER=y
709# CONFIG_DEBUG_WAITQ is not set
710# CONFIG_DEBUG_ERRORS is not set
711CONFIG_DEBUG_LL=y
712# CONFIG_DEBUG_ICEDCC is not set
713CONFIG_DEBUG_S3C2410_PORT=y
714CONFIG_DEBUG_S3C2410_UART=0
715
716#
717# Security options
718#
719# CONFIG_KEYS is not set
720# CONFIG_SECURITY is not set
721
722#
723# Cryptographic options
724#
725# CONFIG_CRYPTO is not set
726
727#
728# Hardware crypto devices
729#
730
731#
732# Library routines
733#
734# CONFIG_CRC_CCITT is not set
735CONFIG_CRC32=y
736CONFIG_LIBCRC32C=y
diff --git a/arch/arm/configs/versatile_defconfig b/arch/arm/configs/versatile_defconfig
new file mode 100644
index 000000000000..d72f2c754268
--- /dev/null
+++ b/arch/arm/configs/versatile_defconfig
@@ -0,0 +1,902 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Mon Mar 28 00:20:50 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
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
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53CONFIG_MODULE_UNLOAD=y
54# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set
57# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y
59
60#
61# System Type
62#
63# CONFIG_ARCH_CLPS7500 is not set
64# CONFIG_ARCH_CLPS711X is not set
65# CONFIG_ARCH_CO285 is not set
66# CONFIG_ARCH_EBSA110 is not set
67# CONFIG_ARCH_CAMELOT is not set
68# CONFIG_ARCH_FOOTBRIDGE is not set
69# CONFIG_ARCH_INTEGRATOR is not set
70# CONFIG_ARCH_IOP3XX is not set
71# CONFIG_ARCH_IXP4XX is not set
72# CONFIG_ARCH_IXP2000 is not set
73# CONFIG_ARCH_L7200 is not set
74# CONFIG_ARCH_PXA is not set
75# CONFIG_ARCH_RPC is not set
76# CONFIG_ARCH_SA1100 is not set
77# CONFIG_ARCH_S3C2410 is not set
78# CONFIG_ARCH_SHARK is not set
79# CONFIG_ARCH_LH7A40X is not set
80# CONFIG_ARCH_OMAP is not set
81CONFIG_ARCH_VERSATILE=y
82# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set
84
85#
86# Versatile platform type
87#
88CONFIG_ARCH_VERSATILE_PB=y
89# CONFIG_MACH_VERSATILE_AB is not set
90
91#
92# Processor Type
93#
94CONFIG_CPU_32=y
95CONFIG_CPU_ARM926T=y
96CONFIG_CPU_32v5=y
97CONFIG_CPU_ABRT_EV5TJ=y
98CONFIG_CPU_CACHE_VIVT=y
99CONFIG_CPU_COPY_V4WB=y
100CONFIG_CPU_TLB_V4WBI=y
101
102#
103# Processor Features
104#
105CONFIG_ARM_THUMB=y
106# CONFIG_CPU_ICACHE_DISABLE is not set
107# CONFIG_CPU_DCACHE_DISABLE is not set
108# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
109# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
110CONFIG_ICST307=y
111
112#
113# Bus support
114#
115CONFIG_ARM_AMBA=y
116
117#
118# PCCARD (PCMCIA/CardBus) support
119#
120# CONFIG_PCCARD is not set
121
122#
123# Kernel Features
124#
125# CONFIG_PREEMPT is not set
126CONFIG_LEDS=y
127CONFIG_LEDS_TIMER=y
128CONFIG_LEDS_CPU=y
129CONFIG_ALIGNMENT_TRAP=y
130
131#
132# Boot options
133#
134CONFIG_ZBOOT_ROM_TEXT=0x0
135CONFIG_ZBOOT_ROM_BSS=0x0
136CONFIG_CMDLINE="root=1f03 mem=32M"
137# CONFIG_XIP_KERNEL is not set
138
139#
140# Floating point emulation
141#
142
143#
144# At least one emulation must be selected
145#
146CONFIG_FPE_NWFPE=y
147# CONFIG_FPE_NWFPE_XP is not set
148# CONFIG_FPE_FASTFPE is not set
149# CONFIG_VFP is not set
150
151#
152# Userspace binary formats
153#
154CONFIG_BINFMT_ELF=y
155# CONFIG_BINFMT_AOUT is not set
156# CONFIG_BINFMT_MISC is not set
157# CONFIG_ARTHUR is not set
158
159#
160# Power management options
161#
162CONFIG_PM=y
163# CONFIG_APM is not set
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# CONFIG_DEBUG_DRIVER is not set
176
177#
178# Memory Technology Devices (MTD)
179#
180CONFIG_MTD=y
181# CONFIG_MTD_DEBUG is not set
182# CONFIG_MTD_CONCAT is not set
183CONFIG_MTD_PARTITIONS=y
184# CONFIG_MTD_REDBOOT_PARTS is not set
185CONFIG_MTD_CMDLINE_PARTS=y
186# CONFIG_MTD_AFS_PARTS is not set
187
188#
189# User Modules And Translation Layers
190#
191CONFIG_MTD_CHAR=y
192CONFIG_MTD_BLOCK=y
193# CONFIG_FTL is not set
194# CONFIG_NFTL is not set
195# CONFIG_INFTL is not set
196
197#
198# RAM/ROM/Flash chip drivers
199#
200CONFIG_MTD_CFI=y
201# CONFIG_MTD_JEDECPROBE is not set
202CONFIG_MTD_GEN_PROBE=y
203CONFIG_MTD_CFI_ADV_OPTIONS=y
204CONFIG_MTD_CFI_NOSWAP=y
205# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
206# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
207# CONFIG_MTD_CFI_GEOMETRY is not set
208CONFIG_MTD_MAP_BANK_WIDTH_1=y
209CONFIG_MTD_MAP_BANK_WIDTH_2=y
210CONFIG_MTD_MAP_BANK_WIDTH_4=y
211# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
212# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
213# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
214CONFIG_MTD_CFI_I1=y
215CONFIG_MTD_CFI_I2=y
216# CONFIG_MTD_CFI_I4 is not set
217# CONFIG_MTD_CFI_I8 is not set
218CONFIG_MTD_CFI_INTELEXT=y
219# CONFIG_MTD_CFI_AMDSTD is not set
220# CONFIG_MTD_CFI_STAA is not set
221CONFIG_MTD_CFI_UTIL=y
222# CONFIG_MTD_RAM is not set
223# CONFIG_MTD_ROM is not set
224# CONFIG_MTD_ABSENT is not set
225# CONFIG_MTD_XIP is not set
226
227#
228# Mapping drivers for chip access
229#
230# CONFIG_MTD_COMPLEX_MAPPINGS is not set
231# CONFIG_MTD_PHYSMAP is not set
232CONFIG_MTD_ARM_INTEGRATOR=y
233# CONFIG_MTD_EDB7312 is not set
234
235#
236# Self-contained MTD device drivers
237#
238# CONFIG_MTD_SLRAM is not set
239# CONFIG_MTD_PHRAM is not set
240# CONFIG_MTD_MTDRAM is not set
241# CONFIG_MTD_BLKMTD is not set
242# CONFIG_MTD_BLOCK2MTD is not set
243
244#
245# Disk-On-Chip Device Drivers
246#
247# CONFIG_MTD_DOC2000 is not set
248# CONFIG_MTD_DOC2001 is not set
249# CONFIG_MTD_DOC2001PLUS is not set
250
251#
252# NAND Flash Device Drivers
253#
254# CONFIG_MTD_NAND is not set
255
256#
257# Parallel port support
258#
259# CONFIG_PARPORT is not set
260
261#
262# Plug and Play support
263#
264
265#
266# Block devices
267#
268# CONFIG_BLK_DEV_FD is not set
269# CONFIG_BLK_DEV_COW_COMMON is not set
270# CONFIG_BLK_DEV_LOOP is not set
271# CONFIG_BLK_DEV_NBD is not set
272CONFIG_BLK_DEV_RAM=y
273CONFIG_BLK_DEV_RAM_COUNT=16
274CONFIG_BLK_DEV_RAM_SIZE=4096
275CONFIG_BLK_DEV_INITRD=y
276CONFIG_INITRAMFS_SOURCE=""
277# CONFIG_CDROM_PKTCDVD is not set
278
279#
280# IO Schedulers
281#
282CONFIG_IOSCHED_NOOP=y
283CONFIG_IOSCHED_AS=y
284CONFIG_IOSCHED_DEADLINE=y
285CONFIG_IOSCHED_CFQ=y
286# CONFIG_ATA_OVER_ETH is not set
287
288#
289# SCSI device support
290#
291# CONFIG_SCSI is not set
292
293#
294# Multi-device support (RAID and LVM)
295#
296# CONFIG_MD is not set
297
298#
299# Fusion MPT device support
300#
301
302#
303# IEEE 1394 (FireWire) support
304#
305
306#
307# I2O device support
308#
309
310#
311# Networking support
312#
313CONFIG_NET=y
314
315#
316# Networking options
317#
318CONFIG_PACKET=y
319CONFIG_PACKET_MMAP=y
320# CONFIG_NETLINK_DEV is not set
321CONFIG_UNIX=y
322# CONFIG_NET_KEY is not set
323CONFIG_INET=y
324CONFIG_IP_MULTICAST=y
325# CONFIG_IP_ADVANCED_ROUTER is not set
326CONFIG_IP_PNP=y
327# CONFIG_IP_PNP_DHCP is not set
328CONFIG_IP_PNP_BOOTP=y
329# CONFIG_IP_PNP_RARP is not set
330# CONFIG_NET_IPIP is not set
331# CONFIG_NET_IPGRE is not set
332# CONFIG_IP_MROUTE is not set
333# CONFIG_ARPD is not set
334# CONFIG_SYN_COOKIES is not set
335# CONFIG_INET_AH is not set
336# CONFIG_INET_ESP is not set
337# CONFIG_INET_IPCOMP is not set
338# CONFIG_INET_TUNNEL is not set
339# CONFIG_IP_TCPDIAG is not set
340# CONFIG_IP_TCPDIAG_IPV6 is not set
341# CONFIG_IPV6 is not set
342# CONFIG_NETFILTER is not set
343
344#
345# SCTP Configuration (EXPERIMENTAL)
346#
347# CONFIG_IP_SCTP is not set
348# CONFIG_ATM is not set
349# CONFIG_BRIDGE is not set
350# CONFIG_VLAN_8021Q is not set
351# CONFIG_DECNET is not set
352# CONFIG_LLC2 is not set
353# CONFIG_IPX is not set
354# CONFIG_ATALK is not set
355# CONFIG_X25 is not set
356# CONFIG_LAPB is not set
357# CONFIG_NET_DIVERT is not set
358# CONFIG_ECONET is not set
359# CONFIG_WAN_ROUTER is not set
360
361#
362# QoS and/or fair queueing
363#
364# CONFIG_NET_SCHED is not set
365# CONFIG_NET_CLS_ROUTE is not set
366
367#
368# Network testing
369#
370# CONFIG_NET_PKTGEN is not set
371# CONFIG_NETPOLL is not set
372# CONFIG_NET_POLL_CONTROLLER is not set
373# CONFIG_HAMRADIO is not set
374# CONFIG_IRDA is not set
375# CONFIG_BT is not set
376CONFIG_NETDEVICES=y
377# CONFIG_DUMMY is not set
378# CONFIG_BONDING is not set
379# CONFIG_EQUALIZER is not set
380# CONFIG_TUN is not set
381
382#
383# Ethernet (10 or 100Mbit)
384#
385CONFIG_NET_ETHERNET=y
386CONFIG_MII=y
387CONFIG_SMC91X=y
388
389#
390# Ethernet (1000 Mbit)
391#
392
393#
394# Ethernet (10000 Mbit)
395#
396
397#
398# Token Ring devices
399#
400
401#
402# Wireless LAN (non-hamradio)
403#
404# CONFIG_NET_RADIO is not set
405
406#
407# Wan interfaces
408#
409# CONFIG_WAN is not set
410# CONFIG_PPP is not set
411# CONFIG_SLIP is not set
412# CONFIG_SHAPER is not set
413# CONFIG_NETCONSOLE is not set
414
415#
416# ISDN subsystem
417#
418# CONFIG_ISDN is not set
419
420#
421# Input device support
422#
423CONFIG_INPUT=y
424
425#
426# Userland interfaces
427#
428CONFIG_INPUT_MOUSEDEV=y
429CONFIG_INPUT_MOUSEDEV_PSAUX=y
430CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
431CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
432# CONFIG_INPUT_JOYDEV is not set
433# CONFIG_INPUT_TSDEV is not set
434# CONFIG_INPUT_EVDEV is not set
435# CONFIG_INPUT_EVBUG is not set
436
437#
438# Input Device Drivers
439#
440CONFIG_INPUT_KEYBOARD=y
441CONFIG_KEYBOARD_ATKBD=y
442# CONFIG_KEYBOARD_SUNKBD is not set
443# CONFIG_KEYBOARD_LKKBD is not set
444# CONFIG_KEYBOARD_XTKBD is not set
445# CONFIG_KEYBOARD_NEWTON is not set
446CONFIG_INPUT_MOUSE=y
447CONFIG_MOUSE_PS2=y
448# CONFIG_MOUSE_SERIAL is not set
449# CONFIG_MOUSE_VSXXXAA is not set
450# CONFIG_INPUT_JOYSTICK is not set
451# CONFIG_INPUT_TOUCHSCREEN is not set
452# CONFIG_INPUT_MISC is not set
453
454#
455# Hardware I/O ports
456#
457CONFIG_SERIO=y
458# CONFIG_SERIO_SERPORT is not set
459CONFIG_SERIO_AMBAKMI=y
460CONFIG_SERIO_LIBPS2=y
461# CONFIG_SERIO_RAW is not set
462# CONFIG_GAMEPORT is not set
463CONFIG_SOUND_GAMEPORT=y
464
465#
466# Character devices
467#
468CONFIG_VT=y
469CONFIG_VT_CONSOLE=y
470CONFIG_HW_CONSOLE=y
471# CONFIG_SERIAL_NONSTANDARD is not set
472
473#
474# Serial drivers
475#
476CONFIG_SERIAL_8250=m
477CONFIG_SERIAL_8250_NR_UARTS=4
478CONFIG_SERIAL_8250_EXTENDED=y
479CONFIG_SERIAL_8250_MANY_PORTS=y
480CONFIG_SERIAL_8250_SHARE_IRQ=y
481# CONFIG_SERIAL_8250_DETECT_IRQ is not set
482CONFIG_SERIAL_8250_MULTIPORT=y
483CONFIG_SERIAL_8250_RSA=y
484
485#
486# Non-8250 serial port support
487#
488# CONFIG_SERIAL_AMBA_PL010 is not set
489CONFIG_SERIAL_AMBA_PL011=y
490CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
491CONFIG_SERIAL_CORE=y
492CONFIG_SERIAL_CORE_CONSOLE=y
493CONFIG_UNIX98_PTYS=y
494CONFIG_LEGACY_PTYS=y
495CONFIG_LEGACY_PTY_COUNT=16
496
497#
498# IPMI
499#
500# CONFIG_IPMI_HANDLER is not set
501
502#
503# Watchdog Cards
504#
505# CONFIG_WATCHDOG is not set
506# CONFIG_NVRAM is not set
507# CONFIG_RTC is not set
508# CONFIG_DTLK is not set
509# CONFIG_R3964 is not set
510
511#
512# Ftape, the floppy tape device driver
513#
514# CONFIG_DRM is not set
515# CONFIG_RAW_DRIVER is not set
516
517#
518# TPM devices
519#
520# CONFIG_TCG_TPM is not set
521
522#
523# I2C support
524#
525CONFIG_I2C=y
526CONFIG_I2C_CHARDEV=m
527
528#
529# I2C Algorithms
530#
531CONFIG_I2C_ALGOBIT=y
532# CONFIG_I2C_ALGOPCF is not set
533# CONFIG_I2C_ALGOPCA is not set
534
535#
536# I2C Hardware Bus support
537#
538# CONFIG_I2C_ISA is not set
539# CONFIG_I2C_PARPORT_LIGHT is not set
540# CONFIG_I2C_STUB is not set
541# CONFIG_I2C_PCA_ISA is not set
542
543#
544# Hardware Sensors Chip support
545#
546CONFIG_I2C_SENSOR=m
547# CONFIG_SENSORS_ADM1021 is not set
548# CONFIG_SENSORS_ADM1025 is not set
549# CONFIG_SENSORS_ADM1026 is not set
550# CONFIG_SENSORS_ADM1031 is not set
551# CONFIG_SENSORS_ASB100 is not set
552# CONFIG_SENSORS_DS1621 is not set
553# CONFIG_SENSORS_FSCHER is not set
554# CONFIG_SENSORS_FSCPOS is not set
555# CONFIG_SENSORS_GL518SM is not set
556# CONFIG_SENSORS_GL520SM is not set
557# CONFIG_SENSORS_IT87 is not set
558# CONFIG_SENSORS_LM63 is not set
559# CONFIG_SENSORS_LM75 is not set
560# CONFIG_SENSORS_LM77 is not set
561# CONFIG_SENSORS_LM78 is not set
562# CONFIG_SENSORS_LM80 is not set
563# CONFIG_SENSORS_LM83 is not set
564# CONFIG_SENSORS_LM85 is not set
565# CONFIG_SENSORS_LM87 is not set
566# CONFIG_SENSORS_LM90 is not set
567# CONFIG_SENSORS_MAX1619 is not set
568# CONFIG_SENSORS_PC87360 is not set
569# CONFIG_SENSORS_SMSC47B397 is not set
570# CONFIG_SENSORS_SMSC47M1 is not set
571# CONFIG_SENSORS_W83781D is not set
572# CONFIG_SENSORS_W83L785TS is not set
573# CONFIG_SENSORS_W83627HF is not set
574
575#
576# Other I2C Chip support
577#
578CONFIG_SENSORS_EEPROM=m
579# CONFIG_SENSORS_PCF8574 is not set
580# CONFIG_SENSORS_PCF8591 is not set
581# CONFIG_SENSORS_RTC8564 is not set
582# CONFIG_I2C_DEBUG_CORE is not set
583# CONFIG_I2C_DEBUG_ALGO is not set
584# CONFIG_I2C_DEBUG_BUS is not set
585# CONFIG_I2C_DEBUG_CHIP is not set
586
587#
588# Misc devices
589#
590
591#
592# Multimedia devices
593#
594# CONFIG_VIDEO_DEV is not set
595
596#
597# Digital Video Broadcasting Devices
598#
599# CONFIG_DVB is not set
600
601#
602# Graphics support
603#
604CONFIG_FB=y
605CONFIG_FB_CFB_FILLRECT=y
606CONFIG_FB_CFB_COPYAREA=y
607CONFIG_FB_CFB_IMAGEBLIT=y
608CONFIG_FB_SOFT_CURSOR=y
609# CONFIG_FB_MODE_HELPERS is not set
610# CONFIG_FB_TILEBLITTING is not set
611CONFIG_FB_ARMCLCD=y
612# CONFIG_FB_VIRTUAL is not set
613
614#
615# Console display driver support
616#
617# CONFIG_VGA_CONSOLE is not set
618CONFIG_DUMMY_CONSOLE=y
619CONFIG_FRAMEBUFFER_CONSOLE=y
620CONFIG_FONTS=y
621# CONFIG_FONT_8x8 is not set
622# CONFIG_FONT_8x16 is not set
623# CONFIG_FONT_6x11 is not set
624# CONFIG_FONT_PEARL_8x8 is not set
625CONFIG_FONT_ACORN_8x8=y
626# CONFIG_FONT_MINI_4x6 is not set
627# CONFIG_FONT_SUN8x16 is not set
628# CONFIG_FONT_SUN12x22 is not set
629
630#
631# Logo configuration
632#
633# CONFIG_LOGO is not set
634# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
635
636#
637# Sound
638#
639CONFIG_SOUND=y
640
641#
642# Advanced Linux Sound Architecture
643#
644CONFIG_SND=m
645CONFIG_SND_TIMER=m
646CONFIG_SND_PCM=m
647# CONFIG_SND_SEQUENCER is not set
648CONFIG_SND_OSSEMUL=y
649CONFIG_SND_MIXER_OSS=m
650CONFIG_SND_PCM_OSS=m
651# CONFIG_SND_VERBOSE_PRINTK is not set
652# CONFIG_SND_DEBUG is not set
653
654#
655# Generic devices
656#
657# CONFIG_SND_DUMMY is not set
658# CONFIG_SND_MTPAV is not set
659# CONFIG_SND_SERIAL_U16550 is not set
660# CONFIG_SND_MPU401 is not set
661
662#
663# ALSA ARM devices
664#
665
666#
667# Open Sound System
668#
669# CONFIG_SOUND_PRIME is not set
670
671#
672# USB support
673#
674CONFIG_USB_ARCH_HAS_HCD=y
675# CONFIG_USB_ARCH_HAS_OHCI is not set
676# CONFIG_USB is not set
677
678#
679# USB Gadget Support
680#
681# CONFIG_USB_GADGET is not set
682
683#
684# MMC/SD Card support
685#
686CONFIG_MMC=y
687# CONFIG_MMC_DEBUG is not set
688CONFIG_MMC_BLOCK=y
689CONFIG_MMC_ARMMMCI=m
690
691#
692# File systems
693#
694CONFIG_EXT2_FS=y
695# CONFIG_EXT2_FS_XATTR is not set
696# CONFIG_EXT3_FS is not set
697# CONFIG_JBD is not set
698# CONFIG_REISERFS_FS is not set
699# CONFIG_JFS_FS is not set
700
701#
702# XFS support
703#
704# CONFIG_XFS_FS is not set
705CONFIG_MINIX_FS=y
706CONFIG_ROMFS_FS=y
707# CONFIG_QUOTA is not set
708CONFIG_DNOTIFY=y
709# CONFIG_AUTOFS_FS is not set
710# CONFIG_AUTOFS4_FS is not set
711
712#
713# CD-ROM/DVD Filesystems
714#
715# CONFIG_ISO9660_FS is not set
716# CONFIG_UDF_FS is not set
717
718#
719# DOS/FAT/NT Filesystems
720#
721CONFIG_FAT_FS=m
722# CONFIG_MSDOS_FS is not set
723CONFIG_VFAT_FS=m
724CONFIG_FAT_DEFAULT_CODEPAGE=437
725CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
726# CONFIG_NTFS_FS is not set
727
728#
729# Pseudo filesystems
730#
731CONFIG_PROC_FS=y
732CONFIG_SYSFS=y
733# CONFIG_DEVFS_FS is not set
734# CONFIG_DEVPTS_FS_XATTR is not set
735# CONFIG_TMPFS is not set
736# CONFIG_HUGETLB_PAGE is not set
737CONFIG_RAMFS=y
738
739#
740# Miscellaneous filesystems
741#
742# CONFIG_ADFS_FS is not set
743# CONFIG_AFFS_FS is not set
744# CONFIG_HFS_FS is not set
745# CONFIG_HFSPLUS_FS is not set
746# CONFIG_BEFS_FS is not set
747# CONFIG_BFS_FS is not set
748# CONFIG_EFS_FS is not set
749# CONFIG_JFFS_FS is not set
750CONFIG_JFFS2_FS=y
751CONFIG_JFFS2_FS_DEBUG=0
752# CONFIG_JFFS2_FS_NAND is not set
753# CONFIG_JFFS2_FS_NOR_ECC is not set
754# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
755CONFIG_JFFS2_ZLIB=y
756CONFIG_JFFS2_RTIME=y
757# CONFIG_JFFS2_RUBIN is not set
758CONFIG_CRAMFS=y
759# CONFIG_VXFS_FS is not set
760# CONFIG_HPFS_FS is not set
761# CONFIG_QNX4FS_FS is not set
762# CONFIG_SYSV_FS is not set
763# CONFIG_UFS_FS is not set
764
765#
766# Network File Systems
767#
768CONFIG_NFS_FS=y
769CONFIG_NFS_V3=y
770# CONFIG_NFS_V4 is not set
771# CONFIG_NFS_DIRECTIO is not set
772CONFIG_NFSD=y
773CONFIG_NFSD_V3=y
774# CONFIG_NFSD_V4 is not set
775# CONFIG_NFSD_TCP is not set
776CONFIG_ROOT_NFS=y
777CONFIG_LOCKD=y
778CONFIG_LOCKD_V4=y
779CONFIG_EXPORTFS=y
780CONFIG_SUNRPC=y
781# CONFIG_RPCSEC_GSS_KRB5 is not set
782# CONFIG_RPCSEC_GSS_SPKM3 is not set
783# CONFIG_SMB_FS is not set
784# CONFIG_CIFS is not set
785# CONFIG_NCP_FS is not set
786# CONFIG_CODA_FS is not set
787# CONFIG_AFS_FS is not set
788
789#
790# Partition Types
791#
792CONFIG_PARTITION_ADVANCED=y
793# CONFIG_ACORN_PARTITION is not set
794# CONFIG_OSF_PARTITION is not set
795# CONFIG_AMIGA_PARTITION is not set
796# CONFIG_ATARI_PARTITION is not set
797# CONFIG_MAC_PARTITION is not set
798CONFIG_MSDOS_PARTITION=y
799# CONFIG_BSD_DISKLABEL is not set
800# CONFIG_MINIX_SUBPARTITION is not set
801# CONFIG_SOLARIS_X86_PARTITION is not set
802# CONFIG_UNIXWARE_DISKLABEL is not set
803# CONFIG_LDM_PARTITION is not set
804# CONFIG_SGI_PARTITION is not set
805# CONFIG_ULTRIX_PARTITION is not set
806# CONFIG_SUN_PARTITION is not set
807# CONFIG_EFI_PARTITION is not set
808
809#
810# Native Language Support
811#
812CONFIG_NLS=m
813CONFIG_NLS_DEFAULT="iso8859-1"
814# CONFIG_NLS_CODEPAGE_437 is not set
815# CONFIG_NLS_CODEPAGE_737 is not set
816# CONFIG_NLS_CODEPAGE_775 is not set
817CONFIG_NLS_CODEPAGE_850=m
818# CONFIG_NLS_CODEPAGE_852 is not set
819# CONFIG_NLS_CODEPAGE_855 is not set
820# CONFIG_NLS_CODEPAGE_857 is not set
821# CONFIG_NLS_CODEPAGE_860 is not set
822# CONFIG_NLS_CODEPAGE_861 is not set
823# CONFIG_NLS_CODEPAGE_862 is not set
824# CONFIG_NLS_CODEPAGE_863 is not set
825# CONFIG_NLS_CODEPAGE_864 is not set
826# CONFIG_NLS_CODEPAGE_865 is not set
827# CONFIG_NLS_CODEPAGE_866 is not set
828# CONFIG_NLS_CODEPAGE_869 is not set
829# CONFIG_NLS_CODEPAGE_936 is not set
830# CONFIG_NLS_CODEPAGE_950 is not set
831# CONFIG_NLS_CODEPAGE_932 is not set
832# CONFIG_NLS_CODEPAGE_949 is not set
833# CONFIG_NLS_CODEPAGE_874 is not set
834# CONFIG_NLS_ISO8859_8 is not set
835# CONFIG_NLS_CODEPAGE_1250 is not set
836# CONFIG_NLS_CODEPAGE_1251 is not set
837# CONFIG_NLS_ASCII is not set
838CONFIG_NLS_ISO8859_1=m
839# CONFIG_NLS_ISO8859_2 is not set
840# CONFIG_NLS_ISO8859_3 is not set
841# CONFIG_NLS_ISO8859_4 is not set
842# CONFIG_NLS_ISO8859_5 is not set
843# CONFIG_NLS_ISO8859_6 is not set
844# CONFIG_NLS_ISO8859_7 is not set
845# CONFIG_NLS_ISO8859_9 is not set
846# CONFIG_NLS_ISO8859_13 is not set
847# CONFIG_NLS_ISO8859_14 is not set
848# CONFIG_NLS_ISO8859_15 is not set
849# CONFIG_NLS_KOI8_R is not set
850# CONFIG_NLS_KOI8_U is not set
851# CONFIG_NLS_UTF8 is not set
852
853#
854# Profiling support
855#
856# CONFIG_PROFILING is not set
857
858#
859# Kernel hacking
860#
861# CONFIG_PRINTK_TIME is not set
862CONFIG_DEBUG_KERNEL=y
863CONFIG_MAGIC_SYSRQ=y
864CONFIG_LOG_BUF_SHIFT=14
865# CONFIG_SCHEDSTATS is not set
866# CONFIG_DEBUG_SLAB is not set
867# CONFIG_DEBUG_SPINLOCK is not set
868# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
869# CONFIG_DEBUG_KOBJECT is not set
870CONFIG_DEBUG_BUGVERBOSE=y
871# CONFIG_DEBUG_INFO is not set
872# CONFIG_DEBUG_FS is not set
873CONFIG_FRAME_POINTER=y
874CONFIG_DEBUG_USER=y
875# CONFIG_DEBUG_WAITQ is not set
876CONFIG_DEBUG_ERRORS=y
877CONFIG_DEBUG_LL=y
878# CONFIG_DEBUG_ICEDCC is not set
879
880#
881# Security options
882#
883# CONFIG_KEYS is not set
884# CONFIG_SECURITY is not set
885
886#
887# Cryptographic options
888#
889# CONFIG_CRYPTO is not set
890
891#
892# Hardware crypto devices
893#
894
895#
896# Library routines
897#
898# CONFIG_CRC_CCITT is not set
899CONFIG_CRC32=y
900# CONFIG_LIBCRC32C is not set
901CONFIG_ZLIB_INFLATE=y
902CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
new file mode 100644
index 000000000000..07a56ff61494
--- /dev/null
+++ b/arch/arm/kernel/Makefile
@@ -0,0 +1,38 @@
1#
2# Makefile for the linux kernel.
3#
4
5AFLAGS_head.o := -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR)
6
7# Object file lists.
8
9obj-y := arch.o compat.o dma.o entry-armv.o entry-common.o irq.o \
10 process.o ptrace.o semaphore.o setup.o signal.o sys_arm.o \
11 time.o traps.o
12
13obj-$(CONFIG_APM) += apm.o
14obj-$(CONFIG_ARCH_ACORN) += ecard.o
15obj-$(CONFIG_FOOTBRIDGE) += isa.o
16obj-$(CONFIG_FIQ) += fiq.o
17obj-$(CONFIG_MODULES) += armksyms.o module.o
18obj-$(CONFIG_ARTHUR) += arthur.o
19obj-$(CONFIG_ISA_DMA) += dma-isa.o
20obj-$(CONFIG_PCI) += bios32.o
21obj-$(CONFIG_SMP) += smp.o
22
23obj-$(CONFIG_IWMMXT) += iwmmxt.o
24AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt
25
26ifneq ($(CONFIG_ARCH_EBSA110),y)
27 obj-y += io.o
28endif
29
30head-y := head.o
31obj-$(CONFIG_DEBUG_LL) += debug.o
32
33extra-y := $(head-y) init_task.o vmlinux.lds
34
35# Spell out some dependencies that aren't automatically figured out
36$(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h
37$(obj)/entry-common.o: $(obj)/entry-header.S include/asm-arm/constants.h \
38 $(obj)/calls.S
diff --git a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c
new file mode 100644
index 000000000000..b0bbd1e62ebb
--- /dev/null
+++ b/arch/arm/kernel/apm.c
@@ -0,0 +1,610 @@
1/*
2 * bios-less APM driver for ARM Linux
3 * Jamey Hicks <jamey@crl.dec.com>
4 * adapted from the APM BIOS driver for Linux by Stephen Rothwell (sfr@linuxcare.com)
5 *
6 * APM 1.2 Reference:
7 * Intel Corporation, Microsoft Corporation. Advanced Power Management
8 * (APM) BIOS Interface Specification, Revision 1.2, February 1996.
9 *
10 * [This document is available from Microsoft at:
11 * http://www.microsoft.com/hwdev/busbios/amp_12.htm]
12 */
13#include <linux/config.h>
14#include <linux/module.h>
15#include <linux/poll.h>
16#include <linux/timer.h>
17#include <linux/slab.h>
18#include <linux/proc_fs.h>
19#include <linux/miscdevice.h>
20#include <linux/apm_bios.h>
21#include <linux/sched.h>
22#include <linux/pm.h>
23#include <linux/device.h>
24#include <linux/kernel.h>
25#include <linux/list.h>
26#include <linux/init.h>
27#include <linux/completion.h>
28
29#include <asm/apm.h> /* apm_power_info */
30#include <asm/system.h>
31
32/*
33 * The apm_bios device is one of the misc char devices.
34 * This is its minor number.
35 */
36#define APM_MINOR_DEV 134
37
38/*
39 * See Documentation/Config.help for the configuration options.
40 *
41 * Various options can be changed at boot time as follows:
42 * (We allow underscores for compatibility with the modules code)
43 * apm=on/off enable/disable APM
44 */
45
46/*
47 * Maximum number of events stored
48 */
49#define APM_MAX_EVENTS 16
50
51struct apm_queue {
52 unsigned int event_head;
53 unsigned int event_tail;
54 apm_event_t events[APM_MAX_EVENTS];
55};
56
57/*
58 * The per-file APM data
59 */
60struct apm_user {
61 struct list_head list;
62
63 unsigned int suser: 1;
64 unsigned int writer: 1;
65 unsigned int reader: 1;
66
67 int suspend_result;
68 unsigned int suspend_state;
69#define SUSPEND_NONE 0 /* no suspend pending */
70#define SUSPEND_PENDING 1 /* suspend pending read */
71#define SUSPEND_READ 2 /* suspend read, pending ack */
72#define SUSPEND_ACKED 3 /* suspend acked */
73#define SUSPEND_DONE 4 /* suspend completed */
74
75 struct apm_queue queue;
76};
77
78/*
79 * Local variables
80 */
81static int suspends_pending;
82static int apm_disabled;
83
84static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
85static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
86
87/*
88 * This is a list of everyone who has opened /dev/apm_bios
89 */
90static DECLARE_RWSEM(user_list_lock);
91static LIST_HEAD(apm_user_list);
92
93/*
94 * kapmd info. kapmd provides us a process context to handle
95 * "APM" events within - specifically necessary if we're going
96 * to be suspending the system.
97 */
98static DECLARE_WAIT_QUEUE_HEAD(kapmd_wait);
99static DECLARE_COMPLETION(kapmd_exit);
100static DEFINE_SPINLOCK(kapmd_queue_lock);
101static struct apm_queue kapmd_queue;
102
103
104static const char driver_version[] = "1.13"; /* no spaces */
105
106
107
108/*
109 * Compatibility cruft until the IPAQ people move over to the new
110 * interface.
111 */
112static void __apm_get_power_status(struct apm_power_info *info)
113{
114}
115
116/*
117 * This allows machines to provide their own "apm get power status" function.
118 */
119void (*apm_get_power_status)(struct apm_power_info *) = __apm_get_power_status;
120EXPORT_SYMBOL(apm_get_power_status);
121
122
123/*
124 * APM event queue management.
125 */
126static inline int queue_empty(struct apm_queue *q)
127{
128 return q->event_head == q->event_tail;
129}
130
131static inline apm_event_t queue_get_event(struct apm_queue *q)
132{
133 q->event_tail = (q->event_tail + 1) % APM_MAX_EVENTS;
134 return q->events[q->event_tail];
135}
136
137static void queue_add_event(struct apm_queue *q, apm_event_t event)
138{
139 q->event_head = (q->event_head + 1) % APM_MAX_EVENTS;
140 if (q->event_head == q->event_tail) {
141 static int notified;
142
143 if (notified++ == 0)
144 printk(KERN_ERR "apm: an event queue overflowed\n");
145 q->event_tail = (q->event_tail + 1) % APM_MAX_EVENTS;
146 }
147 q->events[q->event_head] = event;
148}
149
150static void queue_event_one_user(struct apm_user *as, apm_event_t event)
151{
152 if (as->suser && as->writer) {
153 switch (event) {
154 case APM_SYS_SUSPEND:
155 case APM_USER_SUSPEND:
156 /*
157 * If this user already has a suspend pending,
158 * don't queue another one.
159 */
160 if (as->suspend_state != SUSPEND_NONE)
161 return;
162
163 as->suspend_state = SUSPEND_PENDING;
164 suspends_pending++;
165 break;
166 }
167 }
168 queue_add_event(&as->queue, event);
169}
170
171static void queue_event(apm_event_t event, struct apm_user *sender)
172{
173 struct apm_user *as;
174
175 down_read(&user_list_lock);
176 list_for_each_entry(as, &apm_user_list, list) {
177 if (as != sender && as->reader)
178 queue_event_one_user(as, event);
179 }
180 up_read(&user_list_lock);
181 wake_up_interruptible(&apm_waitqueue);
182}
183
184static void apm_suspend(void)
185{
186 struct apm_user *as;
187 int err = pm_suspend(PM_SUSPEND_MEM);
188
189 /*
190 * Anyone on the APM queues will think we're still suspended.
191 * Send a message so everyone knows we're now awake again.
192 */
193 queue_event(APM_NORMAL_RESUME, NULL);
194
195 /*
196 * Finally, wake up anyone who is sleeping on the suspend.
197 */
198 down_read(&user_list_lock);
199 list_for_each_entry(as, &apm_user_list, list) {
200 as->suspend_result = err;
201 as->suspend_state = SUSPEND_DONE;
202 }
203 up_read(&user_list_lock);
204
205 wake_up(&apm_suspend_waitqueue);
206}
207
208static ssize_t apm_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos)
209{
210 struct apm_user *as = fp->private_data;
211 apm_event_t event;
212 int i = count, ret = 0;
213
214 if (count < sizeof(apm_event_t))
215 return -EINVAL;
216
217 if (queue_empty(&as->queue) && fp->f_flags & O_NONBLOCK)
218 return -EAGAIN;
219
220 wait_event_interruptible(apm_waitqueue, !queue_empty(&as->queue));
221
222 while ((i >= sizeof(event)) && !queue_empty(&as->queue)) {
223 event = queue_get_event(&as->queue);
224
225 ret = -EFAULT;
226 if (copy_to_user(buf, &event, sizeof(event)))
227 break;
228
229 if (event == APM_SYS_SUSPEND || event == APM_USER_SUSPEND)
230 as->suspend_state = SUSPEND_READ;
231
232 buf += sizeof(event);
233 i -= sizeof(event);
234 }
235
236 if (i < count)
237 ret = count - i;
238
239 return ret;
240}
241
242static unsigned int apm_poll(struct file *fp, poll_table * wait)
243{
244 struct apm_user *as = fp->private_data;
245
246 poll_wait(fp, &apm_waitqueue, wait);
247 return queue_empty(&as->queue) ? 0 : POLLIN | POLLRDNORM;
248}
249
250/*
251 * apm_ioctl - handle APM ioctl
252 *
253 * APM_IOC_SUSPEND
254 * This IOCTL is overloaded, and performs two functions. It is used to:
255 * - initiate a suspend
256 * - acknowledge a suspend read from /dev/apm_bios.
257 * Only when everyone who has opened /dev/apm_bios with write permission
258 * has acknowledge does the actual suspend happen.
259 */
260static int
261apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
262{
263 struct apm_user *as = filp->private_data;
264 unsigned long flags;
265 int err = -EINVAL;
266
267 if (!as->suser || !as->writer)
268 return -EPERM;
269
270 switch (cmd) {
271 case APM_IOC_SUSPEND:
272 as->suspend_result = -EINTR;
273
274 if (as->suspend_state == SUSPEND_READ) {
275 /*
276 * If we read a suspend command from /dev/apm_bios,
277 * then the corresponding APM_IOC_SUSPEND ioctl is
278 * interpreted as an acknowledge.
279 */
280 as->suspend_state = SUSPEND_ACKED;
281 suspends_pending--;
282 } else {
283 /*
284 * Otherwise it is a request to suspend the system.
285 * Queue an event for all readers, and expect an
286 * acknowledge from all writers who haven't already
287 * acknowledged.
288 */
289 queue_event(APM_USER_SUSPEND, as);
290 }
291
292 /*
293 * If there are no further acknowledges required, suspend
294 * the system.
295 */
296 if (suspends_pending == 0)
297 apm_suspend();
298
299 /*
300 * Wait for the suspend/resume to complete. If there are
301 * pending acknowledges, we wait here for them.
302 *
303 * Note that we need to ensure that the PM subsystem does
304 * not kick us out of the wait when it suspends the threads.
305 */
306 flags = current->flags;
307 current->flags |= PF_NOFREEZE;
308
309 /*
310 * Note: do not allow a thread which is acking the suspend
311 * to escape until the resume is complete.
312 */
313 if (as->suspend_state == SUSPEND_ACKED)
314 wait_event(apm_suspend_waitqueue,
315 as->suspend_state == SUSPEND_DONE);
316 else
317 wait_event_interruptible(apm_suspend_waitqueue,
318 as->suspend_state == SUSPEND_DONE);
319
320 current->flags = flags;
321 err = as->suspend_result;
322 as->suspend_state = SUSPEND_NONE;
323 break;
324 }
325
326 return err;
327}
328
329static int apm_release(struct inode * inode, struct file * filp)
330{
331 struct apm_user *as = filp->private_data;
332 filp->private_data = NULL;
333
334 down_write(&user_list_lock);
335 list_del(&as->list);
336 up_write(&user_list_lock);
337
338 /*
339 * We are now unhooked from the chain. As far as new
340 * events are concerned, we no longer exist. However, we
341 * need to balance suspends_pending, which means the
342 * possibility of sleeping.
343 */
344 if (as->suspend_state != SUSPEND_NONE) {
345 suspends_pending -= 1;
346 if (suspends_pending == 0)
347 apm_suspend();
348 }
349
350 kfree(as);
351 return 0;
352}
353
354static int apm_open(struct inode * inode, struct file * filp)
355{
356 struct apm_user *as;
357
358 as = (struct apm_user *)kmalloc(sizeof(*as), GFP_KERNEL);
359 if (as) {
360 memset(as, 0, sizeof(*as));
361
362 /*
363 * XXX - this is a tiny bit broken, when we consider BSD
364 * process accounting. If the device is opened by root, we
365 * instantly flag that we used superuser privs. Who knows,
366 * we might close the device immediately without doing a
367 * privileged operation -- cevans
368 */
369 as->suser = capable(CAP_SYS_ADMIN);
370 as->writer = (filp->f_mode & FMODE_WRITE) == FMODE_WRITE;
371 as->reader = (filp->f_mode & FMODE_READ) == FMODE_READ;
372
373 down_write(&user_list_lock);
374 list_add(&as->list, &apm_user_list);
375 up_write(&user_list_lock);
376
377 filp->private_data = as;
378 }
379
380 return as ? 0 : -ENOMEM;
381}
382
383static struct file_operations apm_bios_fops = {
384 .owner = THIS_MODULE,
385 .read = apm_read,
386 .poll = apm_poll,
387 .ioctl = apm_ioctl,
388 .open = apm_open,
389 .release = apm_release,
390};
391
392static struct miscdevice apm_device = {
393 .minor = APM_MINOR_DEV,
394 .name = "apm_bios",
395 .fops = &apm_bios_fops
396};
397
398
399#ifdef CONFIG_PROC_FS
400/*
401 * Arguments, with symbols from linux/apm_bios.h.
402 *
403 * 0) Linux driver version (this will change if format changes)
404 * 1) APM BIOS Version. Usually 1.0, 1.1 or 1.2.
405 * 2) APM flags from APM Installation Check (0x00):
406 * bit 0: APM_16_BIT_SUPPORT
407 * bit 1: APM_32_BIT_SUPPORT
408 * bit 2: APM_IDLE_SLOWS_CLOCK
409 * bit 3: APM_BIOS_DISABLED
410 * bit 4: APM_BIOS_DISENGAGED
411 * 3) AC line status
412 * 0x00: Off-line
413 * 0x01: On-line
414 * 0x02: On backup power (BIOS >= 1.1 only)
415 * 0xff: Unknown
416 * 4) Battery status
417 * 0x00: High
418 * 0x01: Low
419 * 0x02: Critical
420 * 0x03: Charging
421 * 0x04: Selected battery not present (BIOS >= 1.2 only)
422 * 0xff: Unknown
423 * 5) Battery flag
424 * bit 0: High
425 * bit 1: Low
426 * bit 2: Critical
427 * bit 3: Charging
428 * bit 7: No system battery
429 * 0xff: Unknown
430 * 6) Remaining battery life (percentage of charge):
431 * 0-100: valid
432 * -1: Unknown
433 * 7) Remaining battery life (time units):
434 * Number of remaining minutes or seconds
435 * -1: Unknown
436 * 8) min = minutes; sec = seconds
437 */
438static int apm_get_info(char *buf, char **start, off_t fpos, int length)
439{
440 struct apm_power_info info;
441 char *units;
442 int ret;
443
444 info.ac_line_status = 0xff;
445 info.battery_status = 0xff;
446 info.battery_flag = 0xff;
447 info.battery_life = -1;
448 info.time = -1;
449 info.units = -1;
450
451 if (apm_get_power_status)
452 apm_get_power_status(&info);
453
454 switch (info.units) {
455 default: units = "?"; break;
456 case 0: units = "min"; break;
457 case 1: units = "sec"; break;
458 }
459
460 ret = sprintf(buf, "%s 1.2 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n",
461 driver_version, APM_32_BIT_SUPPORT,
462 info.ac_line_status, info.battery_status,
463 info.battery_flag, info.battery_life,
464 info.time, units);
465
466 return ret;
467}
468#endif
469
470static int kapmd(void *arg)
471{
472 daemonize("kapmd");
473 current->flags |= PF_NOFREEZE;
474
475 do {
476 apm_event_t event;
477
478 wait_event_interruptible(kapmd_wait,
479 !queue_empty(&kapmd_queue) || !pm_active);
480
481 if (!pm_active)
482 break;
483
484 spin_lock_irq(&kapmd_queue_lock);
485 event = 0;
486 if (!queue_empty(&kapmd_queue))
487 event = queue_get_event(&kapmd_queue);
488 spin_unlock_irq(&kapmd_queue_lock);
489
490 switch (event) {
491 case 0:
492 break;
493
494 case APM_LOW_BATTERY:
495 case APM_POWER_STATUS_CHANGE:
496 queue_event(event, NULL);
497 break;
498
499 case APM_USER_SUSPEND:
500 case APM_SYS_SUSPEND:
501 queue_event(event, NULL);
502 if (suspends_pending == 0)
503 apm_suspend();
504 break;
505
506 case APM_CRITICAL_SUSPEND:
507 apm_suspend();
508 break;
509 }
510 } while (1);
511
512 complete_and_exit(&kapmd_exit, 0);
513}
514
515static int __init apm_init(void)
516{
517 int ret;
518
519 if (apm_disabled) {
520 printk(KERN_NOTICE "apm: disabled on user request.\n");
521 return -ENODEV;
522 }
523
524 if (PM_IS_ACTIVE()) {
525 printk(KERN_NOTICE "apm: overridden by ACPI.\n");
526 return -EINVAL;
527 }
528
529 pm_active = 1;
530
531 ret = kernel_thread(kapmd, NULL, CLONE_KERNEL);
532 if (ret < 0) {
533 pm_active = 0;
534 return ret;
535 }
536
537#ifdef CONFIG_PROC_FS
538 create_proc_info_entry("apm", 0, NULL, apm_get_info);
539#endif
540
541 ret = misc_register(&apm_device);
542 if (ret != 0) {
543 remove_proc_entry("apm", NULL);
544
545 pm_active = 0;
546 wake_up(&kapmd_wait);
547 wait_for_completion(&kapmd_exit);
548 }
549
550 return ret;
551}
552
553static void __exit apm_exit(void)
554{
555 misc_deregister(&apm_device);
556 remove_proc_entry("apm", NULL);
557
558 pm_active = 0;
559 wake_up(&kapmd_wait);
560 wait_for_completion(&kapmd_exit);
561}
562
563module_init(apm_init);
564module_exit(apm_exit);
565
566MODULE_AUTHOR("Stephen Rothwell");
567MODULE_DESCRIPTION("Advanced Power Management");
568MODULE_LICENSE("GPL");
569
570#ifndef MODULE
571static int __init apm_setup(char *str)
572{
573 while ((str != NULL) && (*str != '\0')) {
574 if (strncmp(str, "off", 3) == 0)
575 apm_disabled = 1;
576 if (strncmp(str, "on", 2) == 0)
577 apm_disabled = 0;
578 str = strchr(str, ',');
579 if (str != NULL)
580 str += strspn(str, ", \t");
581 }
582 return 1;
583}
584
585__setup("apm=", apm_setup);
586#endif
587
588/**
589 * apm_queue_event - queue an APM event for kapmd
590 * @event: APM event
591 *
592 * Queue an APM event for kapmd to process and ultimately take the
593 * appropriate action. Only a subset of events are handled:
594 * %APM_LOW_BATTERY
595 * %APM_POWER_STATUS_CHANGE
596 * %APM_USER_SUSPEND
597 * %APM_SYS_SUSPEND
598 * %APM_CRITICAL_SUSPEND
599 */
600void apm_queue_event(apm_event_t event)
601{
602 unsigned long flags;
603
604 spin_lock_irqsave(&kapmd_queue_lock, flags);
605 queue_add_event(&kapmd_queue, event);
606 spin_unlock_irqrestore(&kapmd_queue_lock, flags);
607
608 wake_up_interruptible(&kapmd_wait);
609}
610EXPORT_SYMBOL(apm_queue_event);
diff --git a/arch/arm/kernel/arch.c b/arch/arm/kernel/arch.c
new file mode 100644
index 000000000000..4e02fbeb10a6
--- /dev/null
+++ b/arch/arm/kernel/arch.c
@@ -0,0 +1,46 @@
1/*
2 * linux/arch/arm/kernel/arch.c
3 *
4 * Architecture specific fixups.
5 */
6#include <linux/config.h>
7#include <linux/init.h>
8#include <linux/types.h>
9
10#include <asm/elf.h>
11#include <asm/page.h>
12#include <asm/setup.h>
13#include <asm/mach/arch.h>
14
15unsigned int vram_size;
16
17#ifdef CONFIG_ARCH_ACORN
18
19unsigned int memc_ctrl_reg;
20unsigned int number_mfm_drives;
21
22static int __init parse_tag_acorn(const struct tag *tag)
23{
24 memc_ctrl_reg = tag->u.acorn.memc_control_reg;
25 number_mfm_drives = tag->u.acorn.adfsdrives;
26
27 switch (tag->u.acorn.vram_pages) {
28 case 512:
29 vram_size += PAGE_SIZE * 256;
30 case 256:
31 vram_size += PAGE_SIZE * 256;
32 default:
33 break;
34 }
35#if 0
36 if (vram_size) {
37 desc->video_start = 0x02000000;
38 desc->video_end = 0x02000000 + vram_size;
39 }
40#endif
41 return 0;
42}
43
44__tagtable(ATAG_ACORN, parse_tag_acorn);
45
46#endif
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
new file mode 100644
index 000000000000..4c38bd8bc298
--- /dev/null
+++ b/arch/arm/kernel/armksyms.c
@@ -0,0 +1,175 @@
1/*
2 * linux/arch/arm/kernel/armksyms.c
3 *
4 * Copyright (C) 2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/module.h>
11#include <linux/string.h>
12#include <linux/delay.h>
13#include <linux/in6.h>
14#include <linux/syscalls.h>
15
16#include <asm/checksum.h>
17#include <asm/io.h>
18#include <asm/system.h>
19#include <asm/uaccess.h>
20
21/*
22 * libgcc functions - functions that are used internally by the
23 * compiler... (prototypes are not correct though, but that
24 * doesn't really matter since they're not versioned).
25 */
26extern void __ashldi3(void);
27extern void __ashrdi3(void);
28extern void __divsi3(void);
29extern void __lshrdi3(void);
30extern void __modsi3(void);
31extern void __muldi3(void);
32extern void __ucmpdi2(void);
33extern void __udivdi3(void);
34extern void __umoddi3(void);
35extern void __udivmoddi4(void);
36extern void __udivsi3(void);
37extern void __umodsi3(void);
38extern void __do_div64(void);
39
40extern void fpundefinstr(void);
41extern void fp_enter(void);
42
43/*
44 * This has a special calling convention; it doesn't
45 * modify any of the usual registers, except for LR.
46 */
47#define EXPORT_SYMBOL_ALIAS(sym,orig) \
48 const struct kernel_symbol __ksymtab_##sym \
49 __attribute__((section("__ksymtab"))) = \
50 { (unsigned long)&orig, #sym };
51
52/*
53 * floating point math emulator support.
54 * These symbols will never change their calling convention...
55 */
56EXPORT_SYMBOL_ALIAS(kern_fp_enter,fp_enter);
57EXPORT_SYMBOL_ALIAS(fp_printk,printk);
58EXPORT_SYMBOL_ALIAS(fp_send_sig,send_sig);
59
60EXPORT_SYMBOL(__backtrace);
61
62 /* platform dependent support */
63EXPORT_SYMBOL(__udelay);
64EXPORT_SYMBOL(__const_udelay);
65
66 /* networking */
67EXPORT_SYMBOL(csum_partial);
68EXPORT_SYMBOL(csum_partial_copy_nocheck);
69EXPORT_SYMBOL(__csum_ipv6_magic);
70
71 /* io */
72#ifndef __raw_readsb
73EXPORT_SYMBOL(__raw_readsb);
74#endif
75#ifndef __raw_readsw
76EXPORT_SYMBOL(__raw_readsw);
77#endif
78#ifndef __raw_readsl
79EXPORT_SYMBOL(__raw_readsl);
80#endif
81#ifndef __raw_writesb
82EXPORT_SYMBOL(__raw_writesb);
83#endif
84#ifndef __raw_writesw
85EXPORT_SYMBOL(__raw_writesw);
86#endif
87#ifndef __raw_writesl
88EXPORT_SYMBOL(__raw_writesl);
89#endif
90
91 /* string / mem functions */
92EXPORT_SYMBOL(strcpy);
93EXPORT_SYMBOL(strncpy);
94EXPORT_SYMBOL(strcat);
95EXPORT_SYMBOL(strncat);
96EXPORT_SYMBOL(strcmp);
97EXPORT_SYMBOL(strncmp);
98EXPORT_SYMBOL(strchr);
99EXPORT_SYMBOL(strlen);
100EXPORT_SYMBOL(strnlen);
101EXPORT_SYMBOL(strpbrk);
102EXPORT_SYMBOL(strrchr);
103EXPORT_SYMBOL(strstr);
104EXPORT_SYMBOL(memset);
105EXPORT_SYMBOL(memcpy);
106EXPORT_SYMBOL(memmove);
107EXPORT_SYMBOL(memcmp);
108EXPORT_SYMBOL(memscan);
109EXPORT_SYMBOL(memchr);
110EXPORT_SYMBOL(__memzero);
111
112 /* user mem (segment) */
113EXPORT_SYMBOL(__arch_copy_from_user);
114EXPORT_SYMBOL(__arch_copy_to_user);
115EXPORT_SYMBOL(__arch_clear_user);
116EXPORT_SYMBOL(__arch_strnlen_user);
117EXPORT_SYMBOL(__arch_strncpy_from_user);
118
119EXPORT_SYMBOL(__get_user_1);
120EXPORT_SYMBOL(__get_user_2);
121EXPORT_SYMBOL(__get_user_4);
122EXPORT_SYMBOL(__get_user_8);
123
124EXPORT_SYMBOL(__put_user_1);
125EXPORT_SYMBOL(__put_user_2);
126EXPORT_SYMBOL(__put_user_4);
127EXPORT_SYMBOL(__put_user_8);
128
129 /* gcc lib functions */
130EXPORT_SYMBOL(__ashldi3);
131EXPORT_SYMBOL(__ashrdi3);
132EXPORT_SYMBOL(__divsi3);
133EXPORT_SYMBOL(__lshrdi3);
134EXPORT_SYMBOL(__modsi3);
135EXPORT_SYMBOL(__muldi3);
136EXPORT_SYMBOL(__ucmpdi2);
137EXPORT_SYMBOL(__udivdi3);
138EXPORT_SYMBOL(__umoddi3);
139EXPORT_SYMBOL(__udivmoddi4);
140EXPORT_SYMBOL(__udivsi3);
141EXPORT_SYMBOL(__umodsi3);
142EXPORT_SYMBOL(__do_div64);
143
144 /* bitops */
145EXPORT_SYMBOL(_set_bit_le);
146EXPORT_SYMBOL(_test_and_set_bit_le);
147EXPORT_SYMBOL(_clear_bit_le);
148EXPORT_SYMBOL(_test_and_clear_bit_le);
149EXPORT_SYMBOL(_change_bit_le);
150EXPORT_SYMBOL(_test_and_change_bit_le);
151EXPORT_SYMBOL(_find_first_zero_bit_le);
152EXPORT_SYMBOL(_find_next_zero_bit_le);
153EXPORT_SYMBOL(_find_first_bit_le);
154EXPORT_SYMBOL(_find_next_bit_le);
155
156#ifdef __ARMEB__
157EXPORT_SYMBOL(_set_bit_be);
158EXPORT_SYMBOL(_test_and_set_bit_be);
159EXPORT_SYMBOL(_clear_bit_be);
160EXPORT_SYMBOL(_test_and_clear_bit_be);
161EXPORT_SYMBOL(_change_bit_be);
162EXPORT_SYMBOL(_test_and_change_bit_be);
163EXPORT_SYMBOL(_find_first_zero_bit_be);
164EXPORT_SYMBOL(_find_next_zero_bit_be);
165EXPORT_SYMBOL(_find_first_bit_be);
166EXPORT_SYMBOL(_find_next_bit_be);
167#endif
168
169 /* syscalls */
170EXPORT_SYMBOL(sys_write);
171EXPORT_SYMBOL(sys_read);
172EXPORT_SYMBOL(sys_lseek);
173EXPORT_SYMBOL(sys_open);
174EXPORT_SYMBOL(sys_exit);
175EXPORT_SYMBOL(sys_wait4);
diff --git a/arch/arm/kernel/arthur.c b/arch/arm/kernel/arthur.c
new file mode 100644
index 000000000000..a418dad6692c
--- /dev/null
+++ b/arch/arm/kernel/arthur.c
@@ -0,0 +1,91 @@
1/*
2 * linux/arch/arm/kernel/arthur.c
3 *
4 * Copyright (C) 1998, 1999, 2000, 2001 Philip Blundell
5 *
6 * Arthur personality
7 */
8
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/module.h>
17#include <linux/personality.h>
18#include <linux/stddef.h>
19#include <linux/signal.h>
20#include <linux/init.h>
21
22#include <asm/ptrace.h>
23
24/* Arthur doesn't have many signals, and a lot of those that it does
25 have don't map easily to any Linux equivalent. Never mind. */
26
27#define ARTHUR_SIGABRT 1
28#define ARTHUR_SIGFPE 2
29#define ARTHUR_SIGILL 3
30#define ARTHUR_SIGINT 4
31#define ARTHUR_SIGSEGV 5
32#define ARTHUR_SIGTERM 6
33#define ARTHUR_SIGSTAK 7
34#define ARTHUR_SIGUSR1 8
35#define ARTHUR_SIGUSR2 9
36#define ARTHUR_SIGOSERROR 10
37
38static unsigned long arthur_to_linux_signals[32] = {
39 0, 1, 2, 3, 4, 5, 6, 7,
40 8, 9, 10, 11, 12, 13, 14, 15,
41 16, 17, 18, 19, 20, 21, 22, 23,
42 24, 25, 26, 27, 28, 29, 30, 31
43};
44
45static unsigned long linux_to_arthur_signals[32] = {
46 0, -1, ARTHUR_SIGINT, -1,
47 ARTHUR_SIGILL, 5, ARTHUR_SIGABRT, 7,
48 ARTHUR_SIGFPE, 9, ARTHUR_SIGUSR1, ARTHUR_SIGSEGV,
49 ARTHUR_SIGUSR2, 13, 14, ARTHUR_SIGTERM,
50 16, 17, 18, 19,
51 20, 21, 22, 23,
52 24, 25, 26, 27,
53 28, 29, 30, 31
54};
55
56static void arthur_lcall7(int nr, struct pt_regs *regs)
57{
58 struct siginfo info;
59 info.si_signo = SIGSWI;
60 info.si_errno = nr;
61 /* Bounce it to the emulator */
62 send_sig_info(SIGSWI, &info, current);
63}
64
65static struct exec_domain arthur_exec_domain = {
66 .name = "Arthur",
67 .handler = arthur_lcall7,
68 .pers_low = PER_RISCOS,
69 .pers_high = PER_RISCOS,
70 .signal_map = arthur_to_linux_signals,
71 .signal_invmap = linux_to_arthur_signals,
72 .module = THIS_MODULE,
73};
74
75/*
76 * We could do with some locking to stop Arthur being removed while
77 * processes are using it.
78 */
79
80static int __init arthur_init(void)
81{
82 return register_exec_domain(&arthur_exec_domain);
83}
84
85static void __exit arthur_exit(void)
86{
87 unregister_exec_domain(&arthur_exec_domain);
88}
89
90module_init(arthur_init);
91module_exit(arthur_exit);
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
new file mode 100644
index 000000000000..99d43259ff89
--- /dev/null
+++ b/arch/arm/kernel/asm-offsets.c
@@ -0,0 +1,83 @@
1/*
2 * Copyright (C) 1995-2003 Russell King
3 * 2001-2002 Keith Owens
4 *
5 * Generate definitions needed by assembly language modules.
6 * This code generates raw asm output which is post-processed to extract
7 * and format the required data.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#include <linux/sched.h>
14#include <linux/mm.h>
15#include <asm/mach/arch.h>
16#include <asm/thread_info.h>
17#include <asm/memory.h>
18
19/*
20 * Make sure that the compiler and target are compatible.
21 */
22#if defined(__APCS_26__)
23#error Sorry, your compiler targets APCS-26 but this kernel requires APCS-32
24#endif
25/*
26 * GCC 2.95.1, 2.95.2: ignores register clobber list in asm().
27 * GCC 3.0, 3.1: general bad code generation.
28 * GCC 3.2.0: incorrect function argument offset calculation.
29 * GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c
30 * (http://gcc.gnu.org/PR8896) and incorrect structure
31 * initialisation in fs/jffs2/erase.c
32 */
33#if __GNUC__ < 2 || \
34 (__GNUC__ == 2 && __GNUC_MINOR__ < 95) || \
35 (__GNUC__ == 2 && __GNUC_MINOR__ == 95 && __GNUC_PATCHLEVEL__ != 0 && \
36 __GNUC_PATCHLEVEL__ < 3) || \
37 (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
38#error Your compiler is too buggy; it is known to miscompile kernels.
39#error Known good compilers: 2.95.3, 2.95.4, 2.96, 3.3
40#endif
41
42/* Use marker if you need to separate the values later */
43
44#define DEFINE(sym, val) \
45 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
46
47#define BLANK() asm volatile("\n->" : : )
48
49int main(void)
50{
51 DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
52 BLANK();
53 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
54 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
55 DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
56 DEFINE(TI_TASK, offsetof(struct thread_info, task));
57 DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
58 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
59 DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain));
60 DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context));
61 DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp));
62 DEFINE(TI_TP_VALUE, offsetof(struct thread_info, tp_value));
63 DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate));
64 DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate));
65 DEFINE(TI_IWMMXT_STATE, (offsetof(struct thread_info, fpstate)+4)&~7);
66 BLANK();
67#if __LINUX_ARM_ARCH__ >= 6
68 DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id));
69 BLANK();
70#endif
71 DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm));
72 DEFINE(VMA_VM_FLAGS, offsetof(struct vm_area_struct, vm_flags));
73 BLANK();
74 DEFINE(VM_EXEC, VM_EXEC);
75 BLANK();
76 DEFINE(PAGE_SZ, PAGE_SIZE);
77 DEFINE(VIRT_OFFSET, PAGE_OFFSET);
78 BLANK();
79 DEFINE(SYS_ERROR0, 0x9f0000);
80 BLANK();
81 DEFINE(SIZEOF_MACHINE_DESC, sizeof(struct machine_desc));
82 return 0;
83}
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
new file mode 100644
index 000000000000..ad26e98f1e62
--- /dev/null
+++ b/arch/arm/kernel/bios32.c
@@ -0,0 +1,699 @@
1/*
2 * linux/arch/arm/kernel/bios32.c
3 *
4 * PCI bios-type initialisation for PCI machines
5 *
6 * Bits taken from various places.
7 */
8#include <linux/config.h>
9#include <linux/module.h>
10#include <linux/kernel.h>
11#include <linux/pci.h>
12#include <linux/slab.h>
13#include <linux/init.h>
14
15#include <asm/io.h>
16#include <asm/mach-types.h>
17#include <asm/mach/pci.h>
18
19static int debug_pci;
20static int use_firmware;
21
22/*
23 * We can't use pci_find_device() here since we are
24 * called from interrupt context.
25 */
26static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, int warn)
27{
28 struct pci_dev *dev;
29
30 list_for_each_entry(dev, &bus->devices, bus_list) {
31 u16 status;
32
33 /*
34 * ignore host bridge - we handle
35 * that separately
36 */
37 if (dev->bus->number == 0 && dev->devfn == 0)
38 continue;
39
40 pci_read_config_word(dev, PCI_STATUS, &status);
41 if (status == 0xffff)
42 continue;
43
44 if ((status & status_mask) == 0)
45 continue;
46
47 /* clear the status errors */
48 pci_write_config_word(dev, PCI_STATUS, status & status_mask);
49
50 if (warn)
51 printk("(%s: %04X) ", pci_name(dev), status);
52 }
53
54 list_for_each_entry(dev, &bus->devices, bus_list)
55 if (dev->subordinate)
56 pcibios_bus_report_status(dev->subordinate, status_mask, warn);
57}
58
59void pcibios_report_status(u_int status_mask, int warn)
60{
61 struct list_head *l;
62
63 list_for_each(l, &pci_root_buses) {
64 struct pci_bus *bus = pci_bus_b(l);
65
66 pcibios_bus_report_status(bus, status_mask, warn);
67 }
68}
69
70/*
71 * We don't use this to fix the device, but initialisation of it.
72 * It's not the correct use for this, but it works.
73 * Note that the arbiter/ISA bridge appears to be buggy, specifically in
74 * the following area:
75 * 1. park on CPU
76 * 2. ISA bridge ping-pong
77 * 3. ISA bridge master handling of target RETRY
78 *
79 * Bug 3 is responsible for the sound DMA grinding to a halt. We now
80 * live with bug 2.
81 */
82static void __devinit pci_fixup_83c553(struct pci_dev *dev)
83{
84 /*
85 * Set memory region to start at address 0, and enable IO
86 */
87 pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, PCI_BASE_ADDRESS_SPACE_MEMORY);
88 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_IO);
89
90 dev->resource[0].end -= dev->resource[0].start;
91 dev->resource[0].start = 0;
92
93 /*
94 * All memory requests from ISA to be channelled to PCI
95 */
96 pci_write_config_byte(dev, 0x48, 0xff);
97
98 /*
99 * Enable ping-pong on bus master to ISA bridge transactions.
100 * This improves the sound DMA substantially. The fixed
101 * priority arbiter also helps (see below).
102 */
103 pci_write_config_byte(dev, 0x42, 0x01);
104
105 /*
106 * Enable PCI retry
107 */
108 pci_write_config_byte(dev, 0x40, 0x22);
109
110 /*
111 * We used to set the arbiter to "park on last master" (bit
112 * 1 set), but unfortunately the CyberPro does not park the
113 * bus. We must therefore park on CPU. Unfortunately, this
114 * may trigger yet another bug in the 553.
115 */
116 pci_write_config_byte(dev, 0x83, 0x02);
117
118 /*
119 * Make the ISA DMA request lowest priority, and disable
120 * rotating priorities completely.
121 */
122 pci_write_config_byte(dev, 0x80, 0x11);
123 pci_write_config_byte(dev, 0x81, 0x00);
124
125 /*
126 * Route INTA input to IRQ 11, and set IRQ11 to be level
127 * sensitive.
128 */
129 pci_write_config_word(dev, 0x44, 0xb000);
130 outb(0x08, 0x4d1);
131}
132DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553, pci_fixup_83c553);
133
134static void __devinit pci_fixup_unassign(struct pci_dev *dev)
135{
136 dev->resource[0].end -= dev->resource[0].start;
137 dev->resource[0].start = 0;
138}
139DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_89C940F, pci_fixup_unassign);
140
141/*
142 * Prevent the PCI layer from seeing the resources allocated to this device
143 * if it is the host bridge by marking it as such. These resources are of
144 * no consequence to the PCI layer (they are handled elsewhere).
145 */
146static void __devinit pci_fixup_dec21285(struct pci_dev *dev)
147{
148 int i;
149
150 if (dev->devfn == 0) {
151 dev->class &= 0xff;
152 dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
153 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
154 dev->resource[i].start = 0;
155 dev->resource[i].end = 0;
156 dev->resource[i].flags = 0;
157 }
158 }
159}
160DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285, pci_fixup_dec21285);
161
162/*
163 * Same as above. The PrPMC800 carrier board for the PrPMC1100
164 * card maps the host-bridge @ 00:01:00 for some reason and it
165 * ends up getting scanned. Note that we only want to do this
166 * fixup when we find the IXP4xx on a PrPMC system, which is why
167 * we check the machine type. We could be running on a board
168 * with an IXP4xx target device and we don't want to kill the
169 * resources in that case.
170 */
171static void __devinit pci_fixup_prpmc1100(struct pci_dev *dev)
172{
173 int i;
174
175 if (machine_is_prpmc1100()) {
176 dev->class &= 0xff;
177 dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
178 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
179 dev->resource[i].start = 0;
180 dev->resource[i].end = 0;
181 dev->resource[i].flags = 0;
182 }
183 }
184}
185DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IXP4XX, pci_fixup_prpmc1100);
186
187/*
188 * PCI IDE controllers use non-standard I/O port decoding, respect it.
189 */
190static void __devinit pci_fixup_ide_bases(struct pci_dev *dev)
191{
192 struct resource *r;
193 int i;
194
195 if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
196 return;
197
198 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
199 r = dev->resource + i;
200 if ((r->start & ~0x80) == 0x374) {
201 r->start |= 2;
202 r->end = r->start;
203 }
204 }
205}
206DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases);
207
208/*
209 * Put the DEC21142 to sleep
210 */
211static void __devinit pci_fixup_dec21142(struct pci_dev *dev)
212{
213 pci_write_config_dword(dev, 0x40, 0x80000000);
214}
215DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21142, pci_fixup_dec21142);
216
217/*
218 * The CY82C693 needs some rather major fixups to ensure that it does
219 * the right thing. Idea from the Alpha people, with a few additions.
220 *
221 * We ensure that the IDE base registers are set to 1f0/3f4 for the
222 * primary bus, and 170/374 for the secondary bus. Also, hide them
223 * from the PCI subsystem view as well so we won't try to perform
224 * our own auto-configuration on them.
225 *
226 * In addition, we ensure that the PCI IDE interrupts are routed to
227 * IRQ 14 and IRQ 15 respectively.
228 *
229 * The above gets us to a point where the IDE on this device is
230 * functional. However, The CY82C693U _does not work_ in bus
231 * master mode without locking the PCI bus solid.
232 */
233static void __devinit pci_fixup_cy82c693(struct pci_dev *dev)
234{
235 if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
236 u32 base0, base1;
237
238 if (dev->class & 0x80) { /* primary */
239 base0 = 0x1f0;
240 base1 = 0x3f4;
241 } else { /* secondary */
242 base0 = 0x170;
243 base1 = 0x374;
244 }
245
246 pci_write_config_dword(dev, PCI_BASE_ADDRESS_0,
247 base0 | PCI_BASE_ADDRESS_SPACE_IO);
248 pci_write_config_dword(dev, PCI_BASE_ADDRESS_1,
249 base1 | PCI_BASE_ADDRESS_SPACE_IO);
250
251 dev->resource[0].start = 0;
252 dev->resource[0].end = 0;
253 dev->resource[0].flags = 0;
254
255 dev->resource[1].start = 0;
256 dev->resource[1].end = 0;
257 dev->resource[1].flags = 0;
258 } else if (PCI_FUNC(dev->devfn) == 0) {
259 /*
260 * Setup IDE IRQ routing.
261 */
262 pci_write_config_byte(dev, 0x4b, 14);
263 pci_write_config_byte(dev, 0x4c, 15);
264
265 /*
266 * Disable FREQACK handshake, enable USB.
267 */
268 pci_write_config_byte(dev, 0x4d, 0x41);
269
270 /*
271 * Enable PCI retry, and PCI post-write buffer.
272 */
273 pci_write_config_byte(dev, 0x44, 0x17);
274
275 /*
276 * Enable ISA master and DMA post write buffering.
277 */
278 pci_write_config_byte(dev, 0x45, 0x03);
279 }
280}
281DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, pci_fixup_cy82c693);
282
283void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
284{
285 if (debug_pci)
286 printk("PCI: Assigning IRQ %02d to %s\n", irq, pci_name(dev));
287 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
288}
289
290/*
291 * If the bus contains any of these devices, then we must not turn on
292 * parity checking of any kind. Currently this is CyberPro 20x0 only.
293 */
294static inline int pdev_bad_for_parity(struct pci_dev *dev)
295{
296 return (dev->vendor == PCI_VENDOR_ID_INTERG &&
297 (dev->device == PCI_DEVICE_ID_INTERG_2000 ||
298 dev->device == PCI_DEVICE_ID_INTERG_2010));
299}
300
301/*
302 * Adjust the device resources from bus-centric to Linux-centric.
303 */
304static void __devinit
305pdev_fixup_device_resources(struct pci_sys_data *root, struct pci_dev *dev)
306{
307 unsigned long offset;
308 int i;
309
310 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
311 if (dev->resource[i].start == 0)
312 continue;
313 if (dev->resource[i].flags & IORESOURCE_MEM)
314 offset = root->mem_offset;
315 else
316 offset = root->io_offset;
317
318 dev->resource[i].start += offset;
319 dev->resource[i].end += offset;
320 }
321}
322
323static void __devinit
324pbus_assign_bus_resources(struct pci_bus *bus, struct pci_sys_data *root)
325{
326 struct pci_dev *dev = bus->self;
327 int i;
328
329 if (!dev) {
330 /*
331 * Assign root bus resources.
332 */
333 for (i = 0; i < 3; i++)
334 bus->resource[i] = root->resource[i];
335 }
336}
337
338/*
339 * pcibios_fixup_bus - Called after each bus is probed,
340 * but before its children are examined.
341 */
342void __devinit pcibios_fixup_bus(struct pci_bus *bus)
343{
344 struct pci_sys_data *root = bus->sysdata;
345 struct pci_dev *dev;
346 u16 features = PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_FAST_BACK;
347
348 pbus_assign_bus_resources(bus, root);
349
350 /*
351 * Walk the devices on this bus, working out what we can
352 * and can't support.
353 */
354 list_for_each_entry(dev, &bus->devices, bus_list) {
355 u16 status;
356
357 pdev_fixup_device_resources(root, dev);
358
359 pci_read_config_word(dev, PCI_STATUS, &status);
360
361 /*
362 * If any device on this bus does not support fast back
363 * to back transfers, then the bus as a whole is not able
364 * to support them. Having fast back to back transfers
365 * on saves us one PCI cycle per transaction.
366 */
367 if (!(status & PCI_STATUS_FAST_BACK))
368 features &= ~PCI_COMMAND_FAST_BACK;
369
370 if (pdev_bad_for_parity(dev))
371 features &= ~(PCI_COMMAND_SERR | PCI_COMMAND_PARITY);
372
373 switch (dev->class >> 8) {
374#if defined(CONFIG_ISA) || defined(CONFIG_EISA)
375 case PCI_CLASS_BRIDGE_ISA:
376 case PCI_CLASS_BRIDGE_EISA:
377 /*
378 * If this device is an ISA bridge, set isa_bridge
379 * to point at this device. We will then go looking
380 * for things like keyboard, etc.
381 */
382 isa_bridge = dev;
383 break;
384#endif
385 case PCI_CLASS_BRIDGE_PCI:
386 pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &status);
387 status |= PCI_BRIDGE_CTL_PARITY|PCI_BRIDGE_CTL_MASTER_ABORT;
388 status &= ~(PCI_BRIDGE_CTL_BUS_RESET|PCI_BRIDGE_CTL_FAST_BACK);
389 pci_write_config_word(dev, PCI_BRIDGE_CONTROL, status);
390 break;
391
392 case PCI_CLASS_BRIDGE_CARDBUS:
393 pci_read_config_word(dev, PCI_CB_BRIDGE_CONTROL, &status);
394 status |= PCI_CB_BRIDGE_CTL_PARITY|PCI_CB_BRIDGE_CTL_MASTER_ABORT;
395 pci_write_config_word(dev, PCI_CB_BRIDGE_CONTROL, status);
396 break;
397 }
398 }
399
400 /*
401 * Now walk the devices again, this time setting them up.
402 */
403 list_for_each_entry(dev, &bus->devices, bus_list) {
404 u16 cmd;
405
406 pci_read_config_word(dev, PCI_COMMAND, &cmd);
407 cmd |= features;
408 pci_write_config_word(dev, PCI_COMMAND, cmd);
409
410 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE,
411 L1_CACHE_BYTES >> 2);
412 }
413
414 /*
415 * Propagate the flags to the PCI bridge.
416 */
417 if (bus->self && bus->self->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
418 if (features & PCI_COMMAND_FAST_BACK)
419 bus->bridge_ctl |= PCI_BRIDGE_CTL_FAST_BACK;
420 if (features & PCI_COMMAND_PARITY)
421 bus->bridge_ctl |= PCI_BRIDGE_CTL_PARITY;
422 }
423
424 /*
425 * Report what we did for this bus
426 */
427 printk(KERN_INFO "PCI: bus%d: Fast back to back transfers %sabled\n",
428 bus->number, (features & PCI_COMMAND_FAST_BACK) ? "en" : "dis");
429}
430
431/*
432 * Convert from Linux-centric to bus-centric addresses for bridge devices.
433 */
434void __devinit
435pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
436 struct resource *res)
437{
438 struct pci_sys_data *root = dev->sysdata;
439 unsigned long offset = 0;
440
441 if (res->flags & IORESOURCE_IO)
442 offset = root->io_offset;
443 if (res->flags & IORESOURCE_MEM)
444 offset = root->mem_offset;
445
446 region->start = res->start - offset;
447 region->end = res->end - offset;
448}
449
450#ifdef CONFIG_HOTPLUG
451EXPORT_SYMBOL(pcibios_fixup_bus);
452EXPORT_SYMBOL(pcibios_resource_to_bus);
453#endif
454
455/*
456 * This is the standard PCI-PCI bridge swizzling algorithm:
457 *
458 * Dev: 0 1 2 3
459 * A A B C D
460 * B B C D A
461 * C C D A B
462 * D D A B C
463 * ^^^^^^^^^^ irq pin on bridge
464 */
465u8 __devinit pci_std_swizzle(struct pci_dev *dev, u8 *pinp)
466{
467 int pin = *pinp - 1;
468
469 while (dev->bus->self) {
470 pin = (pin + PCI_SLOT(dev->devfn)) & 3;
471 /*
472 * move up the chain of bridges,
473 * swizzling as we go.
474 */
475 dev = dev->bus->self;
476 }
477 *pinp = pin + 1;
478
479 return PCI_SLOT(dev->devfn);
480}
481
482/*
483 * Swizzle the device pin each time we cross a bridge.
484 * This might update pin and returns the slot number.
485 */
486static u8 __devinit pcibios_swizzle(struct pci_dev *dev, u8 *pin)
487{
488 struct pci_sys_data *sys = dev->sysdata;
489 int slot = 0, oldpin = *pin;
490
491 if (sys->swizzle)
492 slot = sys->swizzle(dev, pin);
493
494 if (debug_pci)
495 printk("PCI: %s swizzling pin %d => pin %d slot %d\n",
496 pci_name(dev), oldpin, *pin, slot);
497
498 return slot;
499}
500
501/*
502 * Map a slot/pin to an IRQ.
503 */
504static int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
505{
506 struct pci_sys_data *sys = dev->sysdata;
507 int irq = -1;
508
509 if (sys->map_irq)
510 irq = sys->map_irq(dev, slot, pin);
511
512 if (debug_pci)
513 printk("PCI: %s mapping slot %d pin %d => irq %d\n",
514 pci_name(dev), slot, pin, irq);
515
516 return irq;
517}
518
519static void __init pcibios_init_hw(struct hw_pci *hw)
520{
521 struct pci_sys_data *sys = NULL;
522 int ret;
523 int nr, busnr;
524
525 for (nr = busnr = 0; nr < hw->nr_controllers; nr++) {
526 sys = kmalloc(sizeof(struct pci_sys_data), GFP_KERNEL);
527 if (!sys)
528 panic("PCI: unable to allocate sys data!");
529
530 memset(sys, 0, sizeof(struct pci_sys_data));
531
532 sys->hw = hw;
533 sys->busnr = busnr;
534 sys->swizzle = hw->swizzle;
535 sys->map_irq = hw->map_irq;
536 sys->resource[0] = &ioport_resource;
537 sys->resource[1] = &iomem_resource;
538
539 ret = hw->setup(nr, sys);
540
541 if (ret > 0) {
542 sys->bus = hw->scan(nr, sys);
543
544 if (!sys->bus)
545 panic("PCI: unable to scan bus!");
546
547 busnr = sys->bus->subordinate + 1;
548
549 list_add(&sys->node, &hw->buses);
550 } else {
551 kfree(sys);
552 if (ret < 0)
553 break;
554 }
555 }
556}
557
558void __init pci_common_init(struct hw_pci *hw)
559{
560 struct pci_sys_data *sys;
561
562 INIT_LIST_HEAD(&hw->buses);
563
564 if (hw->preinit)
565 hw->preinit();
566 pcibios_init_hw(hw);
567 if (hw->postinit)
568 hw->postinit();
569
570 pci_fixup_irqs(pcibios_swizzle, pcibios_map_irq);
571
572 list_for_each_entry(sys, &hw->buses, node) {
573 struct pci_bus *bus = sys->bus;
574
575 if (!use_firmware) {
576 /*
577 * Size the bridge windows.
578 */
579 pci_bus_size_bridges(bus);
580
581 /*
582 * Assign resources.
583 */
584 pci_bus_assign_resources(bus);
585 }
586
587 /*
588 * Tell drivers about devices found.
589 */
590 pci_bus_add_devices(bus);
591 }
592}
593
594char * __init pcibios_setup(char *str)
595{
596 if (!strcmp(str, "debug")) {
597 debug_pci = 1;
598 return NULL;
599 } else if (!strcmp(str, "firmware")) {
600 use_firmware = 1;
601 return NULL;
602 }
603 return str;
604}
605
606/*
607 * From arch/i386/kernel/pci-i386.c:
608 *
609 * We need to avoid collisions with `mirrored' VGA ports
610 * and other strange ISA hardware, so we always want the
611 * addresses to be allocated in the 0x000-0x0ff region
612 * modulo 0x400.
613 *
614 * Why? Because some silly external IO cards only decode
615 * the low 10 bits of the IO address. The 0x00-0xff region
616 * is reserved for motherboard devices that decode all 16
617 * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
618 * but we want to try to avoid allocating at 0x2900-0x2bff
619 * which might be mirrored at 0x0100-0x03ff..
620 */
621void pcibios_align_resource(void *data, struct resource *res,
622 unsigned long size, unsigned long align)
623{
624 unsigned long start = res->start;
625
626 if (res->flags & IORESOURCE_IO && start & 0x300)
627 start = (start + 0x3ff) & ~0x3ff;
628
629 res->start = (start + align - 1) & ~(align - 1);
630}
631
632/**
633 * pcibios_enable_device - Enable I/O and memory.
634 * @dev: PCI device to be enabled
635 */
636int pcibios_enable_device(struct pci_dev *dev, int mask)
637{
638 u16 cmd, old_cmd;
639 int idx;
640 struct resource *r;
641
642 pci_read_config_word(dev, PCI_COMMAND, &cmd);
643 old_cmd = cmd;
644 for (idx = 0; idx < 6; idx++) {
645 /* Only set up the requested stuff */
646 if (!(mask & (1 << idx)))
647 continue;
648
649 r = dev->resource + idx;
650 if (!r->start && r->end) {
651 printk(KERN_ERR "PCI: Device %s not available because"
652 " of resource collisions\n", pci_name(dev));
653 return -EINVAL;
654 }
655 if (r->flags & IORESOURCE_IO)
656 cmd |= PCI_COMMAND_IO;
657 if (r->flags & IORESOURCE_MEM)
658 cmd |= PCI_COMMAND_MEMORY;
659 }
660
661 /*
662 * Bridges (eg, cardbus bridges) need to be fully enabled
663 */
664 if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE)
665 cmd |= PCI_COMMAND_IO | PCI_COMMAND_MEMORY;
666
667 if (cmd != old_cmd) {
668 printk("PCI: enabling device %s (%04x -> %04x)\n",
669 pci_name(dev), old_cmd, cmd);
670 pci_write_config_word(dev, PCI_COMMAND, cmd);
671 }
672 return 0;
673}
674
675int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
676 enum pci_mmap_state mmap_state, int write_combine)
677{
678 struct pci_sys_data *root = dev->sysdata;
679 unsigned long phys;
680
681 if (mmap_state == pci_mmap_io) {
682 return -EINVAL;
683 } else {
684 phys = vma->vm_pgoff + (root->mem_offset >> PAGE_SHIFT);
685 }
686
687 /*
688 * Mark this as IO
689 */
690 vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO;
691 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
692
693 if (remap_pfn_range(vma, vma->vm_start, phys,
694 vma->vm_end - vma->vm_start,
695 vma->vm_page_prot))
696 return -EAGAIN;
697
698 return 0;
699}
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
new file mode 100644
index 000000000000..e5d370c235d7
--- /dev/null
+++ b/arch/arm/kernel/calls.S
@@ -0,0 +1,335 @@
1/*
2 * linux/arch/arm/kernel/calls.S
3 *
4 * Copyright (C) 1995-2005 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This file is included twice in entry-common.S
11 */
12#ifndef NR_syscalls
13#define NR_syscalls 320
14#else
15
16__syscall_start:
17/* 0 */ .long sys_restart_syscall
18 .long sys_exit
19 .long sys_fork_wrapper
20 .long sys_read
21 .long sys_write
22/* 5 */ .long sys_open
23 .long sys_close
24 .long sys_ni_syscall /* was sys_waitpid */
25 .long sys_creat
26 .long sys_link
27/* 10 */ .long sys_unlink
28 .long sys_execve_wrapper
29 .long sys_chdir
30 .long sys_time /* used by libc4 */
31 .long sys_mknod
32/* 15 */ .long sys_chmod
33 .long sys_lchown16
34 .long sys_ni_syscall /* was sys_break */
35 .long sys_ni_syscall /* was sys_stat */
36 .long sys_lseek
37/* 20 */ .long sys_getpid
38 .long sys_mount
39 .long sys_oldumount /* used by libc4 */
40 .long sys_setuid16
41 .long sys_getuid16
42/* 25 */ .long sys_stime
43 .long sys_ptrace
44 .long sys_alarm /* used by libc4 */
45 .long sys_ni_syscall /* was sys_fstat */
46 .long sys_pause
47/* 30 */ .long sys_utime /* used by libc4 */
48 .long sys_ni_syscall /* was sys_stty */
49 .long sys_ni_syscall /* was sys_getty */
50 .long sys_access
51 .long sys_nice
52/* 35 */ .long sys_ni_syscall /* was sys_ftime */
53 .long sys_sync
54 .long sys_kill
55 .long sys_rename
56 .long sys_mkdir
57/* 40 */ .long sys_rmdir
58 .long sys_dup
59 .long sys_pipe
60 .long sys_times
61 .long sys_ni_syscall /* was sys_prof */
62/* 45 */ .long sys_brk
63 .long sys_setgid16
64 .long sys_getgid16
65 .long sys_ni_syscall /* was sys_signal */
66 .long sys_geteuid16
67/* 50 */ .long sys_getegid16
68 .long sys_acct
69 .long sys_umount
70 .long sys_ni_syscall /* was sys_lock */
71 .long sys_ioctl
72/* 55 */ .long sys_fcntl
73 .long sys_ni_syscall /* was sys_mpx */
74 .long sys_setpgid
75 .long sys_ni_syscall /* was sys_ulimit */
76 .long sys_ni_syscall /* was sys_olduname */
77/* 60 */ .long sys_umask
78 .long sys_chroot
79 .long sys_ustat
80 .long sys_dup2
81 .long sys_getppid
82/* 65 */ .long sys_getpgrp
83 .long sys_setsid
84 .long sys_sigaction
85 .long sys_ni_syscall /* was sys_sgetmask */
86 .long sys_ni_syscall /* was sys_ssetmask */
87/* 70 */ .long sys_setreuid16
88 .long sys_setregid16
89 .long sys_sigsuspend_wrapper
90 .long sys_sigpending
91 .long sys_sethostname
92/* 75 */ .long sys_setrlimit
93 .long sys_old_getrlimit /* used by libc4 */
94 .long sys_getrusage
95 .long sys_gettimeofday
96 .long sys_settimeofday
97/* 80 */ .long sys_getgroups16
98 .long sys_setgroups16
99 .long old_select /* used by libc4 */
100 .long sys_symlink
101 .long sys_ni_syscall /* was sys_lstat */
102/* 85 */ .long sys_readlink
103 .long sys_uselib
104 .long sys_swapon
105 .long sys_reboot
106 .long old_readdir /* used by libc4 */
107/* 90 */ .long old_mmap /* used by libc4 */
108 .long sys_munmap
109 .long sys_truncate
110 .long sys_ftruncate
111 .long sys_fchmod
112/* 95 */ .long sys_fchown16
113 .long sys_getpriority
114 .long sys_setpriority
115 .long sys_ni_syscall /* was sys_profil */
116 .long sys_statfs
117/* 100 */ .long sys_fstatfs
118 .long sys_ni_syscall
119 .long sys_socketcall
120 .long sys_syslog
121 .long sys_setitimer
122/* 105 */ .long sys_getitimer
123 .long sys_newstat
124 .long sys_newlstat
125 .long sys_newfstat
126 .long sys_ni_syscall /* was sys_uname */
127/* 110 */ .long sys_ni_syscall /* was sys_iopl */
128 .long sys_vhangup
129 .long sys_ni_syscall
130 .long sys_syscall /* call a syscall */
131 .long sys_wait4
132/* 115 */ .long sys_swapoff
133 .long sys_sysinfo
134 .long sys_ipc
135 .long sys_fsync
136 .long sys_sigreturn_wrapper
137/* 120 */ .long sys_clone_wrapper
138 .long sys_setdomainname
139 .long sys_newuname
140 .long sys_ni_syscall
141 .long sys_adjtimex
142/* 125 */ .long sys_mprotect
143 .long sys_sigprocmask
144 .long sys_ni_syscall /* was sys_create_module */
145 .long sys_init_module
146 .long sys_delete_module
147/* 130 */ .long sys_ni_syscall /* was sys_get_kernel_syms */
148 .long sys_quotactl
149 .long sys_getpgid
150 .long sys_fchdir
151 .long sys_bdflush
152/* 135 */ .long sys_sysfs
153 .long sys_personality
154 .long sys_ni_syscall /* .long _sys_afs_syscall */
155 .long sys_setfsuid16
156 .long sys_setfsgid16
157/* 140 */ .long sys_llseek
158 .long sys_getdents
159 .long sys_select
160 .long sys_flock
161 .long sys_msync
162/* 145 */ .long sys_readv
163 .long sys_writev
164 .long sys_getsid
165 .long sys_fdatasync
166 .long sys_sysctl
167/* 150 */ .long sys_mlock
168 .long sys_munlock
169 .long sys_mlockall
170 .long sys_munlockall
171 .long sys_sched_setparam
172/* 155 */ .long sys_sched_getparam
173 .long sys_sched_setscheduler
174 .long sys_sched_getscheduler
175 .long sys_sched_yield
176 .long sys_sched_get_priority_max
177/* 160 */ .long sys_sched_get_priority_min
178 .long sys_sched_rr_get_interval
179 .long sys_nanosleep
180 .long sys_arm_mremap
181 .long sys_setresuid16
182/* 165 */ .long sys_getresuid16
183 .long sys_ni_syscall
184 .long sys_ni_syscall /* was sys_query_module */
185 .long sys_poll
186 .long sys_nfsservctl
187/* 170 */ .long sys_setresgid16
188 .long sys_getresgid16
189 .long sys_prctl
190 .long sys_rt_sigreturn_wrapper
191 .long sys_rt_sigaction
192/* 175 */ .long sys_rt_sigprocmask
193 .long sys_rt_sigpending
194 .long sys_rt_sigtimedwait
195 .long sys_rt_sigqueueinfo
196 .long sys_rt_sigsuspend_wrapper
197/* 180 */ .long sys_pread64
198 .long sys_pwrite64
199 .long sys_chown16
200 .long sys_getcwd
201 .long sys_capget
202/* 185 */ .long sys_capset
203 .long sys_sigaltstack_wrapper
204 .long sys_sendfile
205 .long sys_ni_syscall
206 .long sys_ni_syscall
207/* 190 */ .long sys_vfork_wrapper
208 .long sys_getrlimit
209 .long sys_mmap2
210 .long sys_truncate64
211 .long sys_ftruncate64
212/* 195 */ .long sys_stat64
213 .long sys_lstat64
214 .long sys_fstat64
215 .long sys_lchown
216 .long sys_getuid
217/* 200 */ .long sys_getgid
218 .long sys_geteuid
219 .long sys_getegid
220 .long sys_setreuid
221 .long sys_setregid
222/* 205 */ .long sys_getgroups
223 .long sys_setgroups
224 .long sys_fchown
225 .long sys_setresuid
226 .long sys_getresuid
227/* 210 */ .long sys_setresgid
228 .long sys_getresgid
229 .long sys_chown
230 .long sys_setuid
231 .long sys_setgid
232/* 215 */ .long sys_setfsuid
233 .long sys_setfsgid
234 .long sys_getdents64
235 .long sys_pivot_root
236 .long sys_mincore
237/* 220 */ .long sys_madvise
238 .long sys_fcntl64
239 .long sys_ni_syscall /* TUX */
240 .long sys_ni_syscall
241 .long sys_gettid
242/* 225 */ .long sys_readahead
243 .long sys_setxattr
244 .long sys_lsetxattr
245 .long sys_fsetxattr
246 .long sys_getxattr
247/* 230 */ .long sys_lgetxattr
248 .long sys_fgetxattr
249 .long sys_listxattr
250 .long sys_llistxattr
251 .long sys_flistxattr
252/* 235 */ .long sys_removexattr
253 .long sys_lremovexattr
254 .long sys_fremovexattr
255 .long sys_tkill
256 .long sys_sendfile64
257/* 240 */ .long sys_futex_wrapper
258 .long sys_sched_setaffinity
259 .long sys_sched_getaffinity
260 .long sys_io_setup
261 .long sys_io_destroy
262/* 245 */ .long sys_io_getevents
263 .long sys_io_submit
264 .long sys_io_cancel
265 .long sys_exit_group
266 .long sys_lookup_dcookie
267/* 250 */ .long sys_epoll_create
268 .long sys_epoll_ctl
269 .long sys_epoll_wait
270 .long sys_remap_file_pages
271 .long sys_ni_syscall /* sys_set_thread_area */
272/* 255 */ .long sys_ni_syscall /* sys_get_thread_area */
273 .long sys_set_tid_address
274 .long sys_timer_create
275 .long sys_timer_settime
276 .long sys_timer_gettime
277/* 260 */ .long sys_timer_getoverrun
278 .long sys_timer_delete
279 .long sys_clock_settime
280 .long sys_clock_gettime
281 .long sys_clock_getres
282/* 265 */ .long sys_clock_nanosleep
283 .long sys_statfs64
284 .long sys_fstatfs64
285 .long sys_tgkill
286 .long sys_utimes
287/* 270 */ .long sys_fadvise64_64
288 .long sys_pciconfig_iobase
289 .long sys_pciconfig_read
290 .long sys_pciconfig_write
291 .long sys_mq_open
292/* 275 */ .long sys_mq_unlink
293 .long sys_mq_timedsend
294 .long sys_mq_timedreceive
295 .long sys_mq_notify
296 .long sys_mq_getsetattr
297/* 280 */ .long sys_waitid
298 .long sys_socket
299 .long sys_bind
300 .long sys_connect
301 .long sys_listen
302/* 285 */ .long sys_accept
303 .long sys_getsockname
304 .long sys_getpeername
305 .long sys_socketpair
306 .long sys_send
307/* 290 */ .long sys_sendto
308 .long sys_recv
309 .long sys_recvfrom
310 .long sys_shutdown
311 .long sys_setsockopt
312/* 295 */ .long sys_getsockopt
313 .long sys_sendmsg
314 .long sys_recvmsg
315 .long sys_semop
316 .long sys_semget
317/* 300 */ .long sys_semctl
318 .long sys_msgsnd
319 .long sys_msgrcv
320 .long sys_msgget
321 .long sys_msgctl
322/* 305 */ .long sys_shmat
323 .long sys_shmdt
324 .long sys_shmget
325 .long sys_shmctl
326 .long sys_add_key
327/* 310 */ .long sys_request_key
328 .long sys_keyctl
329 .long sys_semtimedop
330__syscall_end:
331
332 .rept NR_syscalls - (__syscall_end - __syscall_start) / 4
333 .long sys_ni_syscall
334 .endr
335#endif
diff --git a/arch/arm/kernel/compat.c b/arch/arm/kernel/compat.c
new file mode 100644
index 000000000000..7195add42e74
--- /dev/null
+++ b/arch/arm/kernel/compat.c
@@ -0,0 +1,225 @@
1/*
2 * linux/arch/arm/kernel/compat.c
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * We keep the old params compatibility cruft in one place (here)
11 * so we don't end up with lots of mess around other places.
12 *
13 * NOTE:
14 * The old struct param_struct is deprecated, but it will be kept in
15 * the kernel for 5 years from now (2001). This will allow boot loaders
16 * to convert to the new struct tag way.
17 */
18#include <linux/config.h>
19#include <linux/types.h>
20#include <linux/kernel.h>
21#include <linux/string.h>
22#include <linux/init.h>
23
24#include <asm/setup.h>
25#include <asm/mach-types.h>
26#include <asm/page.h>
27
28#include <asm/mach/arch.h>
29
30/*
31 * Usage:
32 * - do not go blindly adding fields, add them at the end
33 * - when adding fields, don't rely on the address until
34 * a patch from me has been released
35 * - unused fields should be zero (for future expansion)
36 * - this structure is relatively short-lived - only
37 * guaranteed to contain useful data in setup_arch()
38 *
39 * This is the old deprecated way to pass parameters to the kernel
40 */
41struct param_struct {
42 union {
43 struct {
44 unsigned long page_size; /* 0 */
45 unsigned long nr_pages; /* 4 */
46 unsigned long ramdisk_size; /* 8 */
47 unsigned long flags; /* 12 */
48#define FLAG_READONLY 1
49#define FLAG_RDLOAD 4
50#define FLAG_RDPROMPT 8
51 unsigned long rootdev; /* 16 */
52 unsigned long video_num_cols; /* 20 */
53 unsigned long video_num_rows; /* 24 */
54 unsigned long video_x; /* 28 */
55 unsigned long video_y; /* 32 */
56 unsigned long memc_control_reg; /* 36 */
57 unsigned char sounddefault; /* 40 */
58 unsigned char adfsdrives; /* 41 */
59 unsigned char bytes_per_char_h; /* 42 */
60 unsigned char bytes_per_char_v; /* 43 */
61 unsigned long pages_in_bank[4]; /* 44 */
62 unsigned long pages_in_vram; /* 60 */
63 unsigned long initrd_start; /* 64 */
64 unsigned long initrd_size; /* 68 */
65 unsigned long rd_start; /* 72 */
66 unsigned long system_rev; /* 76 */
67 unsigned long system_serial_low; /* 80 */
68 unsigned long system_serial_high; /* 84 */
69 unsigned long mem_fclk_21285; /* 88 */
70 } s;
71 char unused[256];
72 } u1;
73 union {
74 char paths[8][128];
75 struct {
76 unsigned long magic;
77 char n[1024 - sizeof(unsigned long)];
78 } s;
79 } u2;
80 char commandline[COMMAND_LINE_SIZE];
81};
82
83static struct tag * __init memtag(struct tag *tag, unsigned long start, unsigned long size)
84{
85 tag = tag_next(tag);
86 tag->hdr.tag = ATAG_MEM;
87 tag->hdr.size = tag_size(tag_mem32);
88 tag->u.mem.size = size;
89 tag->u.mem.start = start;
90
91 return tag;
92}
93
94static void __init build_tag_list(struct param_struct *params, void *taglist)
95{
96 struct tag *tag = taglist;
97
98 if (params->u1.s.page_size != PAGE_SIZE) {
99 printk(KERN_WARNING "Warning: bad configuration page, "
100 "trying to continue\n");
101 return;
102 }
103
104 printk(KERN_DEBUG "Converting old-style param struct to taglist\n");
105
106#ifdef CONFIG_ARCH_NETWINDER
107 if (params->u1.s.nr_pages != 0x02000 &&
108 params->u1.s.nr_pages != 0x04000 &&
109 params->u1.s.nr_pages != 0x08000 &&
110 params->u1.s.nr_pages != 0x10000) {
111 printk(KERN_WARNING "Warning: bad NeTTrom parameters "
112 "detected, using defaults\n");
113
114 params->u1.s.nr_pages = 0x1000; /* 16MB */
115 params->u1.s.ramdisk_size = 0;
116 params->u1.s.flags = FLAG_READONLY;
117 params->u1.s.initrd_start = 0;
118 params->u1.s.initrd_size = 0;
119 params->u1.s.rd_start = 0;
120 }
121#endif
122
123 tag->hdr.tag = ATAG_CORE;
124 tag->hdr.size = tag_size(tag_core);
125 tag->u.core.flags = params->u1.s.flags & FLAG_READONLY;
126 tag->u.core.pagesize = params->u1.s.page_size;
127 tag->u.core.rootdev = params->u1.s.rootdev;
128
129 tag = tag_next(tag);
130 tag->hdr.tag = ATAG_RAMDISK;
131 tag->hdr.size = tag_size(tag_ramdisk);
132 tag->u.ramdisk.flags = (params->u1.s.flags & FLAG_RDLOAD ? 1 : 0) |
133 (params->u1.s.flags & FLAG_RDPROMPT ? 2 : 0);
134 tag->u.ramdisk.size = params->u1.s.ramdisk_size;
135 tag->u.ramdisk.start = params->u1.s.rd_start;
136
137 tag = tag_next(tag);
138 tag->hdr.tag = ATAG_INITRD;
139 tag->hdr.size = tag_size(tag_initrd);
140 tag->u.initrd.start = params->u1.s.initrd_start;
141 tag->u.initrd.size = params->u1.s.initrd_size;
142
143 tag = tag_next(tag);
144 tag->hdr.tag = ATAG_SERIAL;
145 tag->hdr.size = tag_size(tag_serialnr);
146 tag->u.serialnr.low = params->u1.s.system_serial_low;
147 tag->u.serialnr.high = params->u1.s.system_serial_high;
148
149 tag = tag_next(tag);
150 tag->hdr.tag = ATAG_REVISION;
151 tag->hdr.size = tag_size(tag_revision);
152 tag->u.revision.rev = params->u1.s.system_rev;
153
154#ifdef CONFIG_ARCH_ACORN
155 if (machine_is_riscpc()) {
156 int i;
157 for (i = 0; i < 4; i++)
158 tag = memtag(tag, PHYS_OFFSET + (i << 26),
159 params->u1.s.pages_in_bank[i] * PAGE_SIZE);
160 } else
161#endif
162 tag = memtag(tag, PHYS_OFFSET, params->u1.s.nr_pages * PAGE_SIZE);
163
164#ifdef CONFIG_FOOTBRIDGE
165 if (params->u1.s.mem_fclk_21285) {
166 tag = tag_next(tag);
167 tag->hdr.tag = ATAG_MEMCLK;
168 tag->hdr.size = tag_size(tag_memclk);
169 tag->u.memclk.fmemclk = params->u1.s.mem_fclk_21285;
170 }
171#endif
172
173#ifdef CONFIG_ARCH_EBSA285
174 if (machine_is_ebsa285()) {
175 tag = tag_next(tag);
176 tag->hdr.tag = ATAG_VIDEOTEXT;
177 tag->hdr.size = tag_size(tag_videotext);
178 tag->u.videotext.x = params->u1.s.video_x;
179 tag->u.videotext.y = params->u1.s.video_y;
180 tag->u.videotext.video_page = 0;
181 tag->u.videotext.video_mode = 0;
182 tag->u.videotext.video_cols = params->u1.s.video_num_cols;
183 tag->u.videotext.video_ega_bx = 0;
184 tag->u.videotext.video_lines = params->u1.s.video_num_rows;
185 tag->u.videotext.video_isvga = 1;
186 tag->u.videotext.video_points = 8;
187 }
188#endif
189
190#ifdef CONFIG_ARCH_ACORN
191 tag = tag_next(tag);
192 tag->hdr.tag = ATAG_ACORN;
193 tag->hdr.size = tag_size(tag_acorn);
194 tag->u.acorn.memc_control_reg = params->u1.s.memc_control_reg;
195 tag->u.acorn.vram_pages = params->u1.s.pages_in_vram;
196 tag->u.acorn.sounddefault = params->u1.s.sounddefault;
197 tag->u.acorn.adfsdrives = params->u1.s.adfsdrives;
198#endif
199
200 tag = tag_next(tag);
201 tag->hdr.tag = ATAG_CMDLINE;
202 tag->hdr.size = (strlen(params->commandline) + 3 +
203 sizeof(struct tag_header)) >> 2;
204 strcpy(tag->u.cmdline.cmdline, params->commandline);
205
206 tag = tag_next(tag);
207 tag->hdr.tag = ATAG_NONE;
208 tag->hdr.size = 0;
209
210 memmove(params, taglist, ((int)tag) - ((int)taglist) +
211 sizeof(struct tag_header));
212}
213
214void __init convert_to_tag_list(struct tag *tags)
215{
216 struct param_struct *params = (struct param_struct *)tags;
217 build_tag_list(params, &params->u2);
218}
219
220void __init squash_mem_tags(struct tag *tag)
221{
222 for (; tag->hdr.size; tag = tag_next(tag))
223 if (tag->hdr.tag == ATAG_MEM)
224 tag->hdr.tag = ATAG_NONE;
225}
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
new file mode 100644
index 000000000000..caaa919ab47a
--- /dev/null
+++ b/arch/arm/kernel/debug.S
@@ -0,0 +1,106 @@
1/*
2 * linux/arch/arm/kernel/debug.S
3 *
4 * Copyright (C) 1994-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * 32-bit debugging code
11 */
12#include <linux/config.h>
13#include <linux/linkage.h>
14#include <asm/hardware.h>
15
16 .text
17
18/*
19 * Some debugging routines (useful if you've got MM problems and
20 * printk isn't working). For DEBUGGING ONLY!!! Do not leave
21 * references to these in a production kernel!
22 */
23
24#if defined(CONFIG_DEBUG_ICEDCC)
25 @@ debug using ARM EmbeddedICE DCC channel
26 .macro addruart, rx
27 .endm
28
29 .macro senduart, rd, rx
30 mcr p14, 0, \rd, c1, c0, 0
31 .endm
32
33 .macro busyuart, rd, rx
341001:
35 mrc p14, 0, \rx, c0, c0, 0
36 tst \rx, #2
37 beq 1001b
38
39 .endm
40
41 .macro waituart, rd, rx
42 mov \rd, #0x2000000
431001:
44 subs \rd, \rd, #1
45 bmi 1002f
46 mrc p14, 0, \rx, c0, c0, 0
47 tst \rx, #2
48 bne 1001b
491002:
50 .endm
51#else
52#include <asm/arch/debug-macro.S>
53#endif
54
55/*
56 * Useful debugging routines
57 */
58ENTRY(printhex8)
59 mov r1, #8
60 b printhex
61
62ENTRY(printhex4)
63 mov r1, #4
64 b printhex
65
66ENTRY(printhex2)
67 mov r1, #2
68printhex: adr r2, hexbuf
69 add r3, r2, r1
70 mov r1, #0
71 strb r1, [r3]
721: and r1, r0, #15
73 mov r0, r0, lsr #4
74 cmp r1, #10
75 addlt r1, r1, #'0'
76 addge r1, r1, #'a' - 10
77 strb r1, [r3, #-1]!
78 teq r3, r2
79 bne 1b
80 mov r0, r2
81 b printascii
82
83 .ltorg
84
85ENTRY(printascii)
86 addruart r3
87 b 2f
881: waituart r2, r3
89 senduart r1, r3
90 busyuart r2, r3
91 teq r1, #'\n'
92 moveq r1, #'\r'
93 beq 1b
942: teq r0, #0
95 ldrneb r1, [r0], #1
96 teqne r1, #0
97 bne 1b
98 mov pc, lr
99
100ENTRY(printch)
101 addruart r3
102 mov r1, r0
103 mov r0, #0
104 b 1b
105
106hexbuf: .space 16
diff --git a/arch/arm/kernel/dma-isa.c b/arch/arm/kernel/dma-isa.c
new file mode 100644
index 000000000000..e9a36304ec3e
--- /dev/null
+++ b/arch/arm/kernel/dma-isa.c
@@ -0,0 +1,207 @@
1/*
2 * linux/arch/arm/kernel/dma-isa.c
3 *
4 * Copyright (C) 1999-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ISA DMA primitives
11 * Taken from various sources, including:
12 * linux/include/asm/dma.h: Defines for using and allocating dma channels.
13 * Written by Hennus Bergman, 1992.
14 * High DMA channel support & info by Hannu Savolainen and John Boyd,
15 * Nov. 1992.
16 * arch/arm/kernel/dma-ebsa285.c
17 * Copyright (C) 1998 Phil Blundell
18 */
19#include <linux/ioport.h>
20#include <linux/init.h>
21#include <linux/pci.h>
22
23#include <asm/dma.h>
24#include <asm/io.h>
25
26#include <asm/mach/dma.h>
27
28#define ISA_DMA_MODE_READ 0x44
29#define ISA_DMA_MODE_WRITE 0x48
30#define ISA_DMA_MODE_CASCADE 0xc0
31#define ISA_DMA_AUTOINIT 0x10
32
33#define ISA_DMA_MASK 0
34#define ISA_DMA_MODE 1
35#define ISA_DMA_CLRFF 2
36#define ISA_DMA_PGHI 3
37#define ISA_DMA_PGLO 4
38#define ISA_DMA_ADDR 5
39#define ISA_DMA_COUNT 6
40
41static unsigned int isa_dma_port[8][7] = {
42 /* MASK MODE CLRFF PAGE_HI PAGE_LO ADDR COUNT */
43 { 0x0a, 0x0b, 0x0c, 0x487, 0x087, 0x00, 0x01 },
44 { 0x0a, 0x0b, 0x0c, 0x483, 0x083, 0x02, 0x03 },
45 { 0x0a, 0x0b, 0x0c, 0x481, 0x081, 0x04, 0x05 },
46 { 0x0a, 0x0b, 0x0c, 0x482, 0x082, 0x06, 0x07 },
47 { 0xd4, 0xd6, 0xd8, 0x000, 0x000, 0xc0, 0xc2 },
48 { 0xd4, 0xd6, 0xd8, 0x48b, 0x08b, 0xc4, 0xc6 },
49 { 0xd4, 0xd6, 0xd8, 0x489, 0x089, 0xc8, 0xca },
50 { 0xd4, 0xd6, 0xd8, 0x48a, 0x08a, 0xcc, 0xce }
51};
52
53static int isa_get_dma_residue(dmach_t channel, dma_t *dma)
54{
55 unsigned int io_port = isa_dma_port[channel][ISA_DMA_COUNT];
56 int count;
57
58 count = 1 + inb(io_port);
59 count |= inb(io_port) << 8;
60
61 return channel < 4 ? count : (count << 1);
62}
63
64static void isa_enable_dma(dmach_t channel, dma_t *dma)
65{
66 if (dma->invalid) {
67 unsigned long address, length;
68 unsigned int mode, direction;
69
70 mode = channel & 3;
71 switch (dma->dma_mode & DMA_MODE_MASK) {
72 case DMA_MODE_READ:
73 mode |= ISA_DMA_MODE_READ;
74 direction = PCI_DMA_FROMDEVICE;
75 break;
76
77 case DMA_MODE_WRITE:
78 mode |= ISA_DMA_MODE_WRITE;
79 direction = PCI_DMA_TODEVICE;
80 break;
81
82 case DMA_MODE_CASCADE:
83 mode |= ISA_DMA_MODE_CASCADE;
84 direction = PCI_DMA_BIDIRECTIONAL;
85 break;
86
87 default:
88 direction = PCI_DMA_NONE;
89 break;
90 }
91
92 if (!dma->using_sg) {
93 /*
94 * Cope with ISA-style drivers which expect cache
95 * coherence.
96 */
97 dma->buf.dma_address = pci_map_single(NULL,
98 dma->buf.__address, dma->buf.length,
99 direction);
100 }
101
102 address = dma->buf.dma_address;
103 length = dma->buf.length - 1;
104
105 outb(address >> 16, isa_dma_port[channel][ISA_DMA_PGLO]);
106 outb(address >> 24, isa_dma_port[channel][ISA_DMA_PGHI]);
107
108 if (channel >= 4) {
109 address >>= 1;
110 length >>= 1;
111 }
112
113 outb(0, isa_dma_port[channel][ISA_DMA_CLRFF]);
114
115 outb(address, isa_dma_port[channel][ISA_DMA_ADDR]);
116 outb(address >> 8, isa_dma_port[channel][ISA_DMA_ADDR]);
117
118 outb(length, isa_dma_port[channel][ISA_DMA_COUNT]);
119 outb(length >> 8, isa_dma_port[channel][ISA_DMA_COUNT]);
120
121 if (dma->dma_mode & DMA_AUTOINIT)
122 mode |= ISA_DMA_AUTOINIT;
123
124 outb(mode, isa_dma_port[channel][ISA_DMA_MODE]);
125 dma->invalid = 0;
126 }
127 outb(channel & 3, isa_dma_port[channel][ISA_DMA_MASK]);
128}
129
130static void isa_disable_dma(dmach_t channel, dma_t *dma)
131{
132 outb(channel | 4, isa_dma_port[channel][ISA_DMA_MASK]);
133}
134
135static struct dma_ops isa_dma_ops = {
136 .type = "ISA",
137 .enable = isa_enable_dma,
138 .disable = isa_disable_dma,
139 .residue = isa_get_dma_residue,
140};
141
142static struct resource dma_resources[] = {
143 { "dma1", 0x0000, 0x000f },
144 { "dma low page", 0x0080, 0x008f },
145 { "dma2", 0x00c0, 0x00df },
146 { "dma high page", 0x0480, 0x048f }
147};
148
149void __init isa_init_dma(dma_t *dma)
150{
151 /*
152 * Try to autodetect presence of an ISA DMA controller.
153 * We do some minimal initialisation, and check that
154 * channel 0's DMA address registers are writeable.
155 */
156 outb(0xff, 0x0d);
157 outb(0xff, 0xda);
158
159 /*
160 * Write high and low address, and then read them back
161 * in the same order.
162 */
163 outb(0x55, 0x00);
164 outb(0xaa, 0x00);
165
166 if (inb(0) == 0x55 && inb(0) == 0xaa) {
167 int channel, i;
168
169 for (channel = 0; channel < 8; channel++) {
170 dma[channel].d_ops = &isa_dma_ops;
171 isa_disable_dma(channel, NULL);
172 }
173
174 outb(0x40, 0x0b);
175 outb(0x41, 0x0b);
176 outb(0x42, 0x0b);
177 outb(0x43, 0x0b);
178
179 outb(0xc0, 0xd6);
180 outb(0x41, 0xd6);
181 outb(0x42, 0xd6);
182 outb(0x43, 0xd6);
183
184 outb(0, 0xd4);
185
186 outb(0x10, 0x08);
187 outb(0x10, 0xd0);
188
189 /*
190 * Is this correct? According to my documentation, it
191 * doesn't appear to be. It should be:
192 * outb(0x3f, 0x40b); outb(0x3f, 0x4d6);
193 */
194 outb(0x30, 0x40b);
195 outb(0x31, 0x40b);
196 outb(0x32, 0x40b);
197 outb(0x33, 0x40b);
198 outb(0x31, 0x4d6);
199 outb(0x32, 0x4d6);
200 outb(0x33, 0x4d6);
201
202 request_dma(DMA_ISA_CASCADE, "cascade");
203
204 for (i = 0; i < sizeof(dma_resources) / sizeof(dma_resources[0]); i++)
205 request_resource(&ioport_resource, dma_resources + i);
206 }
207}
diff --git a/arch/arm/kernel/dma.c b/arch/arm/kernel/dma.c
new file mode 100644
index 000000000000..2b7883884234
--- /dev/null
+++ b/arch/arm/kernel/dma.c
@@ -0,0 +1,302 @@
1/*
2 * linux/arch/arm/kernel/dma.c
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Front-end to the DMA handling. This handles the allocation/freeing
11 * of DMA channels, and provides a unified interface to the machines
12 * DMA facilities.
13 */
14#include <linux/module.h>
15#include <linux/slab.h>
16#include <linux/mman.h>
17#include <linux/init.h>
18#include <linux/spinlock.h>
19#include <linux/errno.h>
20
21#include <asm/dma.h>
22
23#include <asm/mach/dma.h>
24
25DEFINE_SPINLOCK(dma_spin_lock);
26
27#if MAX_DMA_CHANNELS > 0
28
29static dma_t dma_chan[MAX_DMA_CHANNELS];
30
31/*
32 * Get dma list for /proc/dma
33 */
34int get_dma_list(char *buf)
35{
36 dma_t *dma;
37 char *p = buf;
38 int i;
39
40 for (i = 0, dma = dma_chan; i < MAX_DMA_CHANNELS; i++, dma++)
41 if (dma->lock)
42 p += sprintf(p, "%2d: %14s %s\n", i,
43 dma->d_ops->type, dma->device_id);
44
45 return p - buf;
46}
47
48/*
49 * Request DMA channel
50 *
51 * On certain platforms, we have to allocate an interrupt as well...
52 */
53int request_dma(dmach_t channel, const char *device_id)
54{
55 dma_t *dma = dma_chan + channel;
56 int ret;
57
58 if (channel >= MAX_DMA_CHANNELS || !dma->d_ops)
59 goto bad_dma;
60
61 if (xchg(&dma->lock, 1) != 0)
62 goto busy;
63
64 dma->device_id = device_id;
65 dma->active = 0;
66 dma->invalid = 1;
67
68 ret = 0;
69 if (dma->d_ops->request)
70 ret = dma->d_ops->request(channel, dma);
71
72 if (ret)
73 xchg(&dma->lock, 0);
74
75 return ret;
76
77bad_dma:
78 printk(KERN_ERR "dma: trying to allocate DMA%d\n", channel);
79 return -EINVAL;
80
81busy:
82 return -EBUSY;
83}
84
85/*
86 * Free DMA channel
87 *
88 * On certain platforms, we have to free interrupt as well...
89 */
90void free_dma(dmach_t channel)
91{
92 dma_t *dma = dma_chan + channel;
93
94 if (channel >= MAX_DMA_CHANNELS || !dma->d_ops)
95 goto bad_dma;
96
97 if (dma->active) {
98 printk(KERN_ERR "dma%d: freeing active DMA\n", channel);
99 dma->d_ops->disable(channel, dma);
100 dma->active = 0;
101 }
102
103 if (xchg(&dma->lock, 0) != 0) {
104 if (dma->d_ops->free)
105 dma->d_ops->free(channel, dma);
106 return;
107 }
108
109 printk(KERN_ERR "dma%d: trying to free free DMA\n", channel);
110 return;
111
112bad_dma:
113 printk(KERN_ERR "dma: trying to free DMA%d\n", channel);
114}
115
116/* Set DMA Scatter-Gather list
117 */
118void set_dma_sg (dmach_t channel, struct scatterlist *sg, int nr_sg)
119{
120 dma_t *dma = dma_chan + channel;
121
122 if (dma->active)
123 printk(KERN_ERR "dma%d: altering DMA SG while "
124 "DMA active\n", channel);
125
126 dma->sg = sg;
127 dma->sgcount = nr_sg;
128 dma->using_sg = 1;
129 dma->invalid = 1;
130}
131
132/* Set DMA address
133 *
134 * Copy address to the structure, and set the invalid bit
135 */
136void set_dma_addr (dmach_t channel, unsigned long physaddr)
137{
138 dma_t *dma = dma_chan + channel;
139
140 if (dma->active)
141 printk(KERN_ERR "dma%d: altering DMA address while "
142 "DMA active\n", channel);
143
144 dma->sg = &dma->buf;
145 dma->sgcount = 1;
146 dma->buf.__address = bus_to_virt(physaddr);
147 dma->using_sg = 0;
148 dma->invalid = 1;
149}
150
151/* Set DMA byte count
152 *
153 * Copy address to the structure, and set the invalid bit
154 */
155void set_dma_count (dmach_t channel, unsigned long count)
156{
157 dma_t *dma = dma_chan + channel;
158
159 if (dma->active)
160 printk(KERN_ERR "dma%d: altering DMA count while "
161 "DMA active\n", channel);
162
163 dma->sg = &dma->buf;
164 dma->sgcount = 1;
165 dma->buf.length = count;
166 dma->using_sg = 0;
167 dma->invalid = 1;
168}
169
170/* Set DMA direction mode
171 */
172void set_dma_mode (dmach_t channel, dmamode_t mode)
173{
174 dma_t *dma = dma_chan + channel;
175
176 if (dma->active)
177 printk(KERN_ERR "dma%d: altering DMA mode while "
178 "DMA active\n", channel);
179
180 dma->dma_mode = mode;
181 dma->invalid = 1;
182}
183
184/* Enable DMA channel
185 */
186void enable_dma (dmach_t channel)
187{
188 dma_t *dma = dma_chan + channel;
189
190 if (!dma->lock)
191 goto free_dma;
192
193 if (dma->active == 0) {
194 dma->active = 1;
195 dma->d_ops->enable(channel, dma);
196 }
197 return;
198
199free_dma:
200 printk(KERN_ERR "dma%d: trying to enable free DMA\n", channel);
201 BUG();
202}
203
204/* Disable DMA channel
205 */
206void disable_dma (dmach_t channel)
207{
208 dma_t *dma = dma_chan + channel;
209
210 if (!dma->lock)
211 goto free_dma;
212
213 if (dma->active == 1) {
214 dma->active = 0;
215 dma->d_ops->disable(channel, dma);
216 }
217 return;
218
219free_dma:
220 printk(KERN_ERR "dma%d: trying to disable free DMA\n", channel);
221 BUG();
222}
223
224/*
225 * Is the specified DMA channel active?
226 */
227int dma_channel_active(dmach_t channel)
228{
229 return dma_chan[channel].active;
230}
231
232void set_dma_page(dmach_t channel, char pagenr)
233{
234 printk(KERN_ERR "dma%d: trying to set_dma_page\n", channel);
235}
236
237void set_dma_speed(dmach_t channel, int cycle_ns)
238{
239 dma_t *dma = dma_chan + channel;
240 int ret = 0;
241
242 if (dma->d_ops->setspeed)
243 ret = dma->d_ops->setspeed(channel, dma, cycle_ns);
244 dma->speed = ret;
245}
246
247int get_dma_residue(dmach_t channel)
248{
249 dma_t *dma = dma_chan + channel;
250 int ret = 0;
251
252 if (dma->d_ops->residue)
253 ret = dma->d_ops->residue(channel, dma);
254
255 return ret;
256}
257
258void __init init_dma(void)
259{
260 arch_dma_init(dma_chan);
261}
262
263#else
264
265int request_dma(dmach_t channel, const char *device_id)
266{
267 return -EINVAL;
268}
269
270int get_dma_residue(dmach_t channel)
271{
272 return 0;
273}
274
275#define GLOBAL_ALIAS(_a,_b) asm (".set " #_a "," #_b "; .globl " #_a)
276GLOBAL_ALIAS(disable_dma, get_dma_residue);
277GLOBAL_ALIAS(enable_dma, get_dma_residue);
278GLOBAL_ALIAS(free_dma, get_dma_residue);
279GLOBAL_ALIAS(get_dma_list, get_dma_residue);
280GLOBAL_ALIAS(set_dma_mode, get_dma_residue);
281GLOBAL_ALIAS(set_dma_page, get_dma_residue);
282GLOBAL_ALIAS(set_dma_count, get_dma_residue);
283GLOBAL_ALIAS(set_dma_addr, get_dma_residue);
284GLOBAL_ALIAS(set_dma_sg, get_dma_residue);
285GLOBAL_ALIAS(set_dma_speed, get_dma_residue);
286GLOBAL_ALIAS(init_dma, get_dma_residue);
287
288#endif
289
290EXPORT_SYMBOL(request_dma);
291EXPORT_SYMBOL(free_dma);
292EXPORT_SYMBOL(enable_dma);
293EXPORT_SYMBOL(disable_dma);
294EXPORT_SYMBOL(set_dma_addr);
295EXPORT_SYMBOL(set_dma_count);
296EXPORT_SYMBOL(set_dma_mode);
297EXPORT_SYMBOL(set_dma_page);
298EXPORT_SYMBOL(get_dma_residue);
299EXPORT_SYMBOL(set_dma_sg);
300EXPORT_SYMBOL(set_dma_speed);
301
302EXPORT_SYMBOL(dma_spin_lock);
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
new file mode 100644
index 000000000000..3dc15b131f53
--- /dev/null
+++ b/arch/arm/kernel/ecard.c
@@ -0,0 +1,1210 @@
1/*
2 * linux/arch/arm/kernel/ecard.c
3 *
4 * Copyright 1995-2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Find all installed expansion cards, and handle interrupts from them.
11 *
12 * Created from information from Acorns RiscOS3 PRMs
13 *
14 * 08-Dec-1996 RMK Added code for the 9'th expansion card - the ether
15 * podule slot.
16 * 06-May-1997 RMK Added blacklist for cards whose loader doesn't work.
17 * 12-Sep-1997 RMK Created new handling of interrupt enables/disables
18 * - cards can now register their own routine to control
19 * interrupts (recommended).
20 * 29-Sep-1997 RMK Expansion card interrupt hardware not being re-enabled
21 * on reset from Linux. (Caused cards not to respond
22 * under RiscOS without hard reset).
23 * 15-Feb-1998 RMK Added DMA support
24 * 12-Sep-1998 RMK Added EASI support
25 * 10-Jan-1999 RMK Run loaders in a simulated RISC OS environment.
26 * 17-Apr-1999 RMK Support for EASI Type C cycles.
27 */
28#define ECARD_C
29
30#include <linux/config.h>
31#include <linux/module.h>
32#include <linux/kernel.h>
33#include <linux/types.h>
34#include <linux/sched.h>
35#include <linux/interrupt.h>
36#include <linux/completion.h>
37#include <linux/reboot.h>
38#include <linux/mm.h>
39#include <linux/slab.h>
40#include <linux/proc_fs.h>
41#include <linux/device.h>
42#include <linux/init.h>
43
44#include <asm/dma.h>
45#include <asm/ecard.h>
46#include <asm/hardware.h>
47#include <asm/io.h>
48#include <asm/irq.h>
49#include <asm/mmu_context.h>
50#include <asm/mach/irq.h>
51#include <asm/tlbflush.h>
52
53#ifndef CONFIG_ARCH_RPC
54#define HAVE_EXPMASK
55#endif
56
57struct ecard_request {
58 void (*fn)(struct ecard_request *);
59 ecard_t *ec;
60 unsigned int address;
61 unsigned int length;
62 unsigned int use_loader;
63 void *buffer;
64 struct completion *complete;
65};
66
67struct expcard_blacklist {
68 unsigned short manufacturer;
69 unsigned short product;
70 const char *type;
71};
72
73static ecard_t *cards;
74static ecard_t *slot_to_expcard[MAX_ECARDS];
75static unsigned int ectcr;
76#ifdef HAS_EXPMASK
77static unsigned int have_expmask;
78#endif
79
80/* List of descriptions of cards which don't have an extended
81 * identification, or chunk directories containing a description.
82 */
83static struct expcard_blacklist __initdata blacklist[] = {
84 { MANU_ACORN, PROD_ACORN_ETHER1, "Acorn Ether1" }
85};
86
87asmlinkage extern int
88ecard_loader_reset(unsigned long base, loader_t loader);
89asmlinkage extern int
90ecard_loader_read(int off, unsigned long base, loader_t loader);
91
92static inline unsigned short ecard_getu16(unsigned char *v)
93{
94 return v[0] | v[1] << 8;
95}
96
97static inline signed long ecard_gets24(unsigned char *v)
98{
99 return v[0] | v[1] << 8 | v[2] << 16 | ((v[2] & 0x80) ? 0xff000000 : 0);
100}
101
102static inline ecard_t *slot_to_ecard(unsigned int slot)
103{
104 return slot < MAX_ECARDS ? slot_to_expcard[slot] : NULL;
105}
106
107/* ===================== Expansion card daemon ======================== */
108/*
109 * Since the loader programs on the expansion cards need to be run
110 * in a specific environment, create a separate task with this
111 * environment up, and pass requests to this task as and when we
112 * need to.
113 *
114 * This should allow 99% of loaders to be called from Linux.
115 *
116 * From a security standpoint, we trust the card vendors. This
117 * may be a misplaced trust.
118 */
119static void ecard_task_reset(struct ecard_request *req)
120{
121 struct expansion_card *ec = req->ec;
122 struct resource *res;
123
124 res = ec->slot_no == 8
125 ? &ec->resource[ECARD_RES_MEMC]
126 : ec->type == ECARD_EASI
127 ? &ec->resource[ECARD_RES_EASI]
128 : &ec->resource[ECARD_RES_IOCSYNC];
129
130 ecard_loader_reset(res->start, ec->loader);
131}
132
133static void ecard_task_readbytes(struct ecard_request *req)
134{
135 struct expansion_card *ec = req->ec;
136 unsigned char *buf = req->buffer;
137 unsigned int len = req->length;
138 unsigned int off = req->address;
139
140 if (ec->slot_no == 8) {
141 void __iomem *base = (void __iomem *)
142 ec->resource[ECARD_RES_MEMC].start;
143
144 /*
145 * The card maintains an index which increments the address
146 * into a 4096-byte page on each access. We need to keep
147 * track of the counter.
148 */
149 static unsigned int index;
150 unsigned int page;
151
152 page = (off >> 12) * 4;
153 if (page > 256 * 4)
154 return;
155
156 off &= 4095;
157
158 /*
159 * If we are reading offset 0, or our current index is
160 * greater than the offset, reset the hardware index counter.
161 */
162 if (off == 0 || index > off) {
163 writeb(0, base);
164 index = 0;
165 }
166
167 /*
168 * Increment the hardware index counter until we get to the
169 * required offset. The read bytes are discarded.
170 */
171 while (index < off) {
172 readb(base + page);
173 index += 1;
174 }
175
176 while (len--) {
177 *buf++ = readb(base + page);
178 index += 1;
179 }
180 } else {
181 unsigned long base = (ec->type == ECARD_EASI
182 ? &ec->resource[ECARD_RES_EASI]
183 : &ec->resource[ECARD_RES_IOCSYNC])->start;
184 void __iomem *pbase = (void __iomem *)base;
185
186 if (!req->use_loader || !ec->loader) {
187 off *= 4;
188 while (len--) {
189 *buf++ = readb(pbase + off);
190 off += 4;
191 }
192 } else {
193 while(len--) {
194 /*
195 * The following is required by some
196 * expansion card loader programs.
197 */
198 *(unsigned long *)0x108 = 0;
199 *buf++ = ecard_loader_read(off++, base,
200 ec->loader);
201 }
202 }
203 }
204
205}
206
207static DECLARE_WAIT_QUEUE_HEAD(ecard_wait);
208static struct ecard_request *ecard_req;
209static DECLARE_MUTEX(ecard_sem);
210
211/*
212 * Set up the expansion card daemon's page tables.
213 */
214static void ecard_init_pgtables(struct mm_struct *mm)
215{
216 struct vm_area_struct vma;
217
218 /* We want to set up the page tables for the following mapping:
219 * Virtual Physical
220 * 0x03000000 0x03000000
221 * 0x03010000 unmapped
222 * 0x03210000 0x03210000
223 * 0x03400000 unmapped
224 * 0x08000000 0x08000000
225 * 0x10000000 unmapped
226 *
227 * FIXME: we don't follow this 100% yet.
228 */
229 pgd_t *src_pgd, *dst_pgd;
230
231 src_pgd = pgd_offset(mm, (unsigned long)IO_BASE);
232 dst_pgd = pgd_offset(mm, IO_START);
233
234 memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (IO_SIZE / PGDIR_SIZE));
235
236 src_pgd = pgd_offset(mm, EASI_BASE);
237 dst_pgd = pgd_offset(mm, EASI_START);
238
239 memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (EASI_SIZE / PGDIR_SIZE));
240
241 vma.vm_mm = mm;
242
243 flush_tlb_range(&vma, IO_START, IO_START + IO_SIZE);
244 flush_tlb_range(&vma, EASI_START, EASI_START + EASI_SIZE);
245}
246
247static int ecard_init_mm(void)
248{
249 struct mm_struct * mm = mm_alloc();
250 struct mm_struct *active_mm = current->active_mm;
251
252 if (!mm)
253 return -ENOMEM;
254
255 current->mm = mm;
256 current->active_mm = mm;
257 activate_mm(active_mm, mm);
258 mmdrop(active_mm);
259 ecard_init_pgtables(mm);
260 return 0;
261}
262
263static int
264ecard_task(void * unused)
265{
266 daemonize("kecardd");
267
268 /*
269 * Allocate a mm. We're not a lazy-TLB kernel task since we need
270 * to set page table entries where the user space would be. Note
271 * that this also creates the page tables. Failure is not an
272 * option here.
273 */
274 if (ecard_init_mm())
275 panic("kecardd: unable to alloc mm\n");
276
277 while (1) {
278 struct ecard_request *req;
279
280 wait_event_interruptible(ecard_wait, ecard_req != NULL);
281
282 req = xchg(&ecard_req, NULL);
283 if (req != NULL) {
284 req->fn(req);
285 complete(req->complete);
286 }
287 }
288}
289
290/*
291 * Wake the expansion card daemon to action our request.
292 *
293 * FIXME: The test here is not sufficient to detect if the
294 * kcardd is running.
295 */
296static void ecard_call(struct ecard_request *req)
297{
298 DECLARE_COMPLETION(completion);
299
300 req->complete = &completion;
301
302 down(&ecard_sem);
303 ecard_req = req;
304 wake_up(&ecard_wait);
305
306 /*
307 * Now wait for kecardd to run.
308 */
309 wait_for_completion(&completion);
310 up(&ecard_sem);
311}
312
313/* ======================= Mid-level card control ===================== */
314
315static void
316ecard_readbytes(void *addr, ecard_t *ec, int off, int len, int useld)
317{
318 struct ecard_request req;
319
320 req.fn = ecard_task_readbytes;
321 req.ec = ec;
322 req.address = off;
323 req.length = len;
324 req.use_loader = useld;
325 req.buffer = addr;
326
327 ecard_call(&req);
328}
329
330int ecard_readchunk(struct in_chunk_dir *cd, ecard_t *ec, int id, int num)
331{
332 struct ex_chunk_dir excd;
333 int index = 16;
334 int useld = 0;
335
336 if (!ec->cid.cd)
337 return 0;
338
339 while(1) {
340 ecard_readbytes(&excd, ec, index, 8, useld);
341 index += 8;
342 if (c_id(&excd) == 0) {
343 if (!useld && ec->loader) {
344 useld = 1;
345 index = 0;
346 continue;
347 }
348 return 0;
349 }
350 if (c_id(&excd) == 0xf0) { /* link */
351 index = c_start(&excd);
352 continue;
353 }
354 if (c_id(&excd) == 0x80) { /* loader */
355 if (!ec->loader) {
356 ec->loader = (loader_t)kmalloc(c_len(&excd),
357 GFP_KERNEL);
358 if (ec->loader)
359 ecard_readbytes(ec->loader, ec,
360 (int)c_start(&excd),
361 c_len(&excd), useld);
362 else
363 return 0;
364 }
365 continue;
366 }
367 if (c_id(&excd) == id && num-- == 0)
368 break;
369 }
370
371 if (c_id(&excd) & 0x80) {
372 switch (c_id(&excd) & 0x70) {
373 case 0x70:
374 ecard_readbytes((unsigned char *)excd.d.string, ec,
375 (int)c_start(&excd), c_len(&excd),
376 useld);
377 break;
378 case 0x00:
379 break;
380 }
381 }
382 cd->start_offset = c_start(&excd);
383 memcpy(cd->d.string, excd.d.string, 256);
384 return 1;
385}
386
387/* ======================= Interrupt control ============================ */
388
389static void ecard_def_irq_enable(ecard_t *ec, int irqnr)
390{
391#ifdef HAS_EXPMASK
392 if (irqnr < 4 && have_expmask) {
393 have_expmask |= 1 << irqnr;
394 __raw_writeb(have_expmask, EXPMASK_ENABLE);
395 }
396#endif
397}
398
399static void ecard_def_irq_disable(ecard_t *ec, int irqnr)
400{
401#ifdef HAS_EXPMASK
402 if (irqnr < 4 && have_expmask) {
403 have_expmask &= ~(1 << irqnr);
404 __raw_writeb(have_expmask, EXPMASK_ENABLE);
405 }
406#endif
407}
408
409static int ecard_def_irq_pending(ecard_t *ec)
410{
411 return !ec->irqmask || readb(ec->irqaddr) & ec->irqmask;
412}
413
414static void ecard_def_fiq_enable(ecard_t *ec, int fiqnr)
415{
416 panic("ecard_def_fiq_enable called - impossible");
417}
418
419static void ecard_def_fiq_disable(ecard_t *ec, int fiqnr)
420{
421 panic("ecard_def_fiq_disable called - impossible");
422}
423
424static int ecard_def_fiq_pending(ecard_t *ec)
425{
426 return !ec->fiqmask || readb(ec->fiqaddr) & ec->fiqmask;
427}
428
429static expansioncard_ops_t ecard_default_ops = {
430 ecard_def_irq_enable,
431 ecard_def_irq_disable,
432 ecard_def_irq_pending,
433 ecard_def_fiq_enable,
434 ecard_def_fiq_disable,
435 ecard_def_fiq_pending
436};
437
438/*
439 * Enable and disable interrupts from expansion cards.
440 * (interrupts are disabled for these functions).
441 *
442 * They are not meant to be called directly, but via enable/disable_irq.
443 */
444static void ecard_irq_unmask(unsigned int irqnr)
445{
446 ecard_t *ec = slot_to_ecard(irqnr - 32);
447
448 if (ec) {
449 if (!ec->ops)
450 ec->ops = &ecard_default_ops;
451
452 if (ec->claimed && ec->ops->irqenable)
453 ec->ops->irqenable(ec, irqnr);
454 else
455 printk(KERN_ERR "ecard: rejecting request to "
456 "enable IRQs for %d\n", irqnr);
457 }
458}
459
460static void ecard_irq_mask(unsigned int irqnr)
461{
462 ecard_t *ec = slot_to_ecard(irqnr - 32);
463
464 if (ec) {
465 if (!ec->ops)
466 ec->ops = &ecard_default_ops;
467
468 if (ec->ops && ec->ops->irqdisable)
469 ec->ops->irqdisable(ec, irqnr);
470 }
471}
472
473static struct irqchip ecard_chip = {
474 .ack = ecard_irq_mask,
475 .mask = ecard_irq_mask,
476 .unmask = ecard_irq_unmask,
477};
478
479void ecard_enablefiq(unsigned int fiqnr)
480{
481 ecard_t *ec = slot_to_ecard(fiqnr);
482
483 if (ec) {
484 if (!ec->ops)
485 ec->ops = &ecard_default_ops;
486
487 if (ec->claimed && ec->ops->fiqenable)
488 ec->ops->fiqenable(ec, fiqnr);
489 else
490 printk(KERN_ERR "ecard: rejecting request to "
491 "enable FIQs for %d\n", fiqnr);
492 }
493}
494
495void ecard_disablefiq(unsigned int fiqnr)
496{
497 ecard_t *ec = slot_to_ecard(fiqnr);
498
499 if (ec) {
500 if (!ec->ops)
501 ec->ops = &ecard_default_ops;
502
503 if (ec->ops->fiqdisable)
504 ec->ops->fiqdisable(ec, fiqnr);
505 }
506}
507
508static void ecard_dump_irq_state(void)
509{
510 ecard_t *ec;
511
512 printk("Expansion card IRQ state:\n");
513
514 for (ec = cards; ec; ec = ec->next) {
515 if (ec->slot_no == 8)
516 continue;
517
518 printk(" %d: %sclaimed, ",
519 ec->slot_no, ec->claimed ? "" : "not ");
520
521 if (ec->ops && ec->ops->irqpending &&
522 ec->ops != &ecard_default_ops)
523 printk("irq %spending\n",
524 ec->ops->irqpending(ec) ? "" : "not ");
525 else
526 printk("irqaddr %p, mask = %02X, status = %02X\n",
527 ec->irqaddr, ec->irqmask, readb(ec->irqaddr));
528 }
529}
530
531static void ecard_check_lockup(struct irqdesc *desc)
532{
533 static unsigned long last;
534 static int lockup;
535
536 /*
537 * If the timer interrupt has not run since the last million
538 * unrecognised expansion card interrupts, then there is
539 * something seriously wrong. Disable the expansion card
540 * interrupts so at least we can continue.
541 *
542 * Maybe we ought to start a timer to re-enable them some time
543 * later?
544 */
545 if (last == jiffies) {
546 lockup += 1;
547 if (lockup > 1000000) {
548 printk(KERN_ERR "\nInterrupt lockup detected - "
549 "disabling all expansion card interrupts\n");
550
551 desc->chip->mask(IRQ_EXPANSIONCARD);
552 ecard_dump_irq_state();
553 }
554 } else
555 lockup = 0;
556
557 /*
558 * If we did not recognise the source of this interrupt,
559 * warn the user, but don't flood the user with these messages.
560 */
561 if (!last || time_after(jiffies, last + 5*HZ)) {
562 last = jiffies;
563 printk(KERN_WARNING "Unrecognised interrupt from backplane\n");
564 ecard_dump_irq_state();
565 }
566}
567
568static void
569ecard_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
570{
571 ecard_t *ec;
572 int called = 0;
573
574 desc->chip->mask(irq);
575 for (ec = cards; ec; ec = ec->next) {
576 int pending;
577
578 if (!ec->claimed || ec->irq == NO_IRQ || ec->slot_no == 8)
579 continue;
580
581 if (ec->ops && ec->ops->irqpending)
582 pending = ec->ops->irqpending(ec);
583 else
584 pending = ecard_default_ops.irqpending(ec);
585
586 if (pending) {
587 struct irqdesc *d = irq_desc + ec->irq;
588 d->handle(ec->irq, d, regs);
589 called ++;
590 }
591 }
592 desc->chip->unmask(irq);
593
594 if (called == 0)
595 ecard_check_lockup(desc);
596}
597
598#ifdef HAS_EXPMASK
599static unsigned char priority_masks[] =
600{
601 0xf0, 0xf1, 0xf3, 0xf7, 0xff, 0xff, 0xff, 0xff
602};
603
604static unsigned char first_set[] =
605{
606 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
607 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00
608};
609
610static void
611ecard_irqexp_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
612{
613 const unsigned int statusmask = 15;
614 unsigned int status;
615
616 status = __raw_readb(EXPMASK_STATUS) & statusmask;
617 if (status) {
618 unsigned int slot = first_set[status];
619 ecard_t *ec = slot_to_ecard(slot);
620
621 if (ec->claimed) {
622 struct irqdesc *d = irqdesc + ec->irq;
623 /*
624 * this ugly code is so that we can operate a
625 * prioritorising system:
626 *
627 * Card 0 highest priority
628 * Card 1
629 * Card 2
630 * Card 3 lowest priority
631 *
632 * Serial cards should go in 0/1, ethernet/scsi in 2/3
633 * otherwise you will lose serial data at high speeds!
634 */
635 d->handle(ec->irq, d, regs);
636 } else {
637 printk(KERN_WARNING "card%d: interrupt from unclaimed "
638 "card???\n", slot);
639 have_expmask &= ~(1 << slot);
640 __raw_writeb(have_expmask, EXPMASK_ENABLE);
641 }
642 } else
643 printk(KERN_WARNING "Wild interrupt from backplane (masks)\n");
644}
645
646static int __init ecard_probeirqhw(void)
647{
648 ecard_t *ec;
649 int found;
650
651 __raw_writeb(0x00, EXPMASK_ENABLE);
652 __raw_writeb(0xff, EXPMASK_STATUS);
653 found = (__raw_readb(EXPMASK_STATUS) & 15) == 0;
654 __raw_writeb(0xff, EXPMASK_ENABLE);
655
656 if (found) {
657 printk(KERN_DEBUG "Expansion card interrupt "
658 "management hardware found\n");
659
660 /* for each card present, set a bit to '1' */
661 have_expmask = 0x80000000;
662
663 for (ec = cards; ec; ec = ec->next)
664 have_expmask |= 1 << ec->slot_no;
665
666 __raw_writeb(have_expmask, EXPMASK_ENABLE);
667 }
668
669 return found;
670}
671#else
672#define ecard_irqexp_handler NULL
673#define ecard_probeirqhw() (0)
674#endif
675
676#ifndef IO_EC_MEMC8_BASE
677#define IO_EC_MEMC8_BASE 0
678#endif
679
680unsigned int __ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed)
681{
682 unsigned long address = 0;
683 int slot = ec->slot_no;
684
685 if (ec->slot_no == 8)
686 return IO_EC_MEMC8_BASE;
687
688 ectcr &= ~(1 << slot);
689
690 switch (type) {
691 case ECARD_MEMC:
692 if (slot < 4)
693 address = IO_EC_MEMC_BASE + (slot << 12);
694 break;
695
696 case ECARD_IOC:
697 if (slot < 4)
698 address = IO_EC_IOC_BASE + (slot << 12);
699#ifdef IO_EC_IOC4_BASE
700 else
701 address = IO_EC_IOC4_BASE + ((slot - 4) << 12);
702#endif
703 if (address)
704 address += speed << 17;
705 break;
706
707#ifdef IO_EC_EASI_BASE
708 case ECARD_EASI:
709 address = IO_EC_EASI_BASE + (slot << 22);
710 if (speed == ECARD_FAST)
711 ectcr |= 1 << slot;
712 break;
713#endif
714 default:
715 break;
716 }
717
718#ifdef IOMD_ECTCR
719 iomd_writeb(ectcr, IOMD_ECTCR);
720#endif
721 return address;
722}
723
724static int ecard_prints(char *buffer, ecard_t *ec)
725{
726 char *start = buffer;
727
728 buffer += sprintf(buffer, " %d: %s ", ec->slot_no,
729 ec->type == ECARD_EASI ? "EASI" : " ");
730
731 if (ec->cid.id == 0) {
732 struct in_chunk_dir incd;
733
734 buffer += sprintf(buffer, "[%04X:%04X] ",
735 ec->cid.manufacturer, ec->cid.product);
736
737 if (!ec->card_desc && ec->cid.cd &&
738 ecard_readchunk(&incd, ec, 0xf5, 0)) {
739 ec->card_desc = kmalloc(strlen(incd.d.string)+1, GFP_KERNEL);
740
741 if (ec->card_desc)
742 strcpy((char *)ec->card_desc, incd.d.string);
743 }
744
745 buffer += sprintf(buffer, "%s\n", ec->card_desc ? ec->card_desc : "*unknown*");
746 } else
747 buffer += sprintf(buffer, "Simple card %d\n", ec->cid.id);
748
749 return buffer - start;
750}
751
752static int get_ecard_dev_info(char *buf, char **start, off_t pos, int count)
753{
754 ecard_t *ec = cards;
755 off_t at = 0;
756 int len, cnt;
757
758 cnt = 0;
759 while (ec && count > cnt) {
760 len = ecard_prints(buf, ec);
761 at += len;
762 if (at >= pos) {
763 if (!*start) {
764 *start = buf + (pos - (at - len));
765 cnt = at - pos;
766 } else
767 cnt += len;
768 buf += len;
769 }
770 ec = ec->next;
771 }
772 return (count > cnt) ? cnt : count;
773}
774
775static struct proc_dir_entry *proc_bus_ecard_dir = NULL;
776
777static void ecard_proc_init(void)
778{
779 proc_bus_ecard_dir = proc_mkdir("ecard", proc_bus);
780 create_proc_info_entry("devices", 0, proc_bus_ecard_dir,
781 get_ecard_dev_info);
782}
783
784#define ec_set_resource(ec,nr,st,sz) \
785 do { \
786 (ec)->resource[nr].name = ec->dev.bus_id; \
787 (ec)->resource[nr].start = st; \
788 (ec)->resource[nr].end = (st) + (sz) - 1; \
789 (ec)->resource[nr].flags = IORESOURCE_MEM; \
790 } while (0)
791
792static void __init ecard_free_card(struct expansion_card *ec)
793{
794 int i;
795
796 for (i = 0; i < ECARD_NUM_RESOURCES; i++)
797 if (ec->resource[i].flags)
798 release_resource(&ec->resource[i]);
799
800 kfree(ec);
801}
802
803static struct expansion_card *__init ecard_alloc_card(int type, int slot)
804{
805 struct expansion_card *ec;
806 unsigned long base;
807 int i;
808
809 ec = kmalloc(sizeof(ecard_t), GFP_KERNEL);
810 if (!ec) {
811 ec = ERR_PTR(-ENOMEM);
812 goto nomem;
813 }
814
815 memset(ec, 0, sizeof(ecard_t));
816
817 ec->slot_no = slot;
818 ec->type = type;
819 ec->irq = NO_IRQ;
820 ec->fiq = NO_IRQ;
821 ec->dma = NO_DMA;
822 ec->ops = &ecard_default_ops;
823
824 snprintf(ec->dev.bus_id, sizeof(ec->dev.bus_id), "ecard%d", slot);
825 ec->dev.parent = NULL;
826 ec->dev.bus = &ecard_bus_type;
827 ec->dev.dma_mask = &ec->dma_mask;
828 ec->dma_mask = (u64)0xffffffff;
829
830 if (slot < 4) {
831 ec_set_resource(ec, ECARD_RES_MEMC,
832 PODSLOT_MEMC_BASE + (slot << 14),
833 PODSLOT_MEMC_SIZE);
834 base = PODSLOT_IOC0_BASE + (slot << 14);
835 } else
836 base = PODSLOT_IOC4_BASE + ((slot - 4) << 14);
837
838#ifdef CONFIG_ARCH_RPC
839 if (slot < 8) {
840 ec_set_resource(ec, ECARD_RES_EASI,
841 PODSLOT_EASI_BASE + (slot << 24),
842 PODSLOT_EASI_SIZE);
843 }
844
845 if (slot == 8) {
846 ec_set_resource(ec, ECARD_RES_MEMC, NETSLOT_BASE, NETSLOT_SIZE);
847 } else
848#endif
849
850 for (i = 0; i <= ECARD_RES_IOCSYNC - ECARD_RES_IOCSLOW; i++)
851 ec_set_resource(ec, i + ECARD_RES_IOCSLOW,
852 base + (i << 19), PODSLOT_IOC_SIZE);
853
854 for (i = 0; i < ECARD_NUM_RESOURCES; i++) {
855 if (ec->resource[i].flags &&
856 request_resource(&iomem_resource, &ec->resource[i])) {
857 printk(KERN_ERR "%s: resource(s) not available\n",
858 ec->dev.bus_id);
859 ec->resource[i].end -= ec->resource[i].start;
860 ec->resource[i].start = 0;
861 ec->resource[i].flags = 0;
862 }
863 }
864
865 nomem:
866 return ec;
867}
868
869static ssize_t ecard_show_irq(struct device *dev, char *buf)
870{
871 struct expansion_card *ec = ECARD_DEV(dev);
872 return sprintf(buf, "%u\n", ec->irq);
873}
874
875static ssize_t ecard_show_dma(struct device *dev, char *buf)
876{
877 struct expansion_card *ec = ECARD_DEV(dev);
878 return sprintf(buf, "%u\n", ec->dma);
879}
880
881static ssize_t ecard_show_resources(struct device *dev, char *buf)
882{
883 struct expansion_card *ec = ECARD_DEV(dev);
884 char *str = buf;
885 int i;
886
887 for (i = 0; i < ECARD_NUM_RESOURCES; i++)
888 str += sprintf(str, "%08lx %08lx %08lx\n",
889 ec->resource[i].start,
890 ec->resource[i].end,
891 ec->resource[i].flags);
892
893 return str - buf;
894}
895
896static ssize_t ecard_show_vendor(struct device *dev, char *buf)
897{
898 struct expansion_card *ec = ECARD_DEV(dev);
899 return sprintf(buf, "%u\n", ec->cid.manufacturer);
900}
901
902static ssize_t ecard_show_device(struct device *dev, char *buf)
903{
904 struct expansion_card *ec = ECARD_DEV(dev);
905 return sprintf(buf, "%u\n", ec->cid.product);
906}
907
908static ssize_t ecard_show_type(struct device *dev, char *buf)
909{
910 struct expansion_card *ec = ECARD_DEV(dev);
911 return sprintf(buf, "%s\n", ec->type == ECARD_EASI ? "EASI" : "IOC");
912}
913
914static struct device_attribute ecard_dev_attrs[] = {
915 __ATTR(device, S_IRUGO, ecard_show_device, NULL),
916 __ATTR(dma, S_IRUGO, ecard_show_dma, NULL),
917 __ATTR(irq, S_IRUGO, ecard_show_irq, NULL),
918 __ATTR(resource, S_IRUGO, ecard_show_resources, NULL),
919 __ATTR(type, S_IRUGO, ecard_show_type, NULL),
920 __ATTR(vendor, S_IRUGO, ecard_show_vendor, NULL),
921 __ATTR_NULL,
922};
923
924
925int ecard_request_resources(struct expansion_card *ec)
926{
927 int i, err = 0;
928
929 for (i = 0; i < ECARD_NUM_RESOURCES; i++) {
930 if (ecard_resource_end(ec, i) &&
931 !request_mem_region(ecard_resource_start(ec, i),
932 ecard_resource_len(ec, i),
933 ec->dev.driver->name)) {
934 err = -EBUSY;
935 break;
936 }
937 }
938
939 if (err) {
940 while (i--)
941 if (ecard_resource_end(ec, i))
942 release_mem_region(ecard_resource_start(ec, i),
943 ecard_resource_len(ec, i));
944 }
945 return err;
946}
947EXPORT_SYMBOL(ecard_request_resources);
948
949void ecard_release_resources(struct expansion_card *ec)
950{
951 int i;
952
953 for (i = 0; i < ECARD_NUM_RESOURCES; i++)
954 if (ecard_resource_end(ec, i))
955 release_mem_region(ecard_resource_start(ec, i),
956 ecard_resource_len(ec, i));
957}
958EXPORT_SYMBOL(ecard_release_resources);
959
960/*
961 * Probe for an expansion card.
962 *
963 * If bit 1 of the first byte of the card is set, then the
964 * card does not exist.
965 */
966static int __init
967ecard_probe(int slot, card_type_t type)
968{
969 ecard_t **ecp;
970 ecard_t *ec;
971 struct ex_ecid cid;
972 int i, rc;
973
974 ec = ecard_alloc_card(type, slot);
975 if (IS_ERR(ec)) {
976 rc = PTR_ERR(ec);
977 goto nomem;
978 }
979
980 rc = -ENODEV;
981 if ((ec->podaddr = ecard_address(ec, type, ECARD_SYNC)) == 0)
982 goto nodev;
983
984 cid.r_zero = 1;
985 ecard_readbytes(&cid, ec, 0, 16, 0);
986 if (cid.r_zero)
987 goto nodev;
988
989 ec->cid.id = cid.r_id;
990 ec->cid.cd = cid.r_cd;
991 ec->cid.is = cid.r_is;
992 ec->cid.w = cid.r_w;
993 ec->cid.manufacturer = ecard_getu16(cid.r_manu);
994 ec->cid.product = ecard_getu16(cid.r_prod);
995 ec->cid.country = cid.r_country;
996 ec->cid.irqmask = cid.r_irqmask;
997 ec->cid.irqoff = ecard_gets24(cid.r_irqoff);
998 ec->cid.fiqmask = cid.r_fiqmask;
999 ec->cid.fiqoff = ecard_gets24(cid.r_fiqoff);
1000 ec->fiqaddr =
1001 ec->irqaddr = (void __iomem *)ioaddr(ec->podaddr);
1002
1003 if (ec->cid.is) {
1004 ec->irqmask = ec->cid.irqmask;
1005 ec->irqaddr += ec->cid.irqoff;
1006 ec->fiqmask = ec->cid.fiqmask;
1007 ec->fiqaddr += ec->cid.fiqoff;
1008 } else {
1009 ec->irqmask = 1;
1010 ec->fiqmask = 4;
1011 }
1012
1013 for (i = 0; i < sizeof(blacklist) / sizeof(*blacklist); i++)
1014 if (blacklist[i].manufacturer == ec->cid.manufacturer &&
1015 blacklist[i].product == ec->cid.product) {
1016 ec->card_desc = blacklist[i].type;
1017 break;
1018 }
1019
1020 /*
1021 * hook the interrupt handlers
1022 */
1023 if (slot < 8) {
1024 ec->irq = 32 + slot;
1025 set_irq_chip(ec->irq, &ecard_chip);
1026 set_irq_handler(ec->irq, do_level_IRQ);
1027 set_irq_flags(ec->irq, IRQF_VALID);
1028 }
1029
1030#ifdef IO_EC_MEMC8_BASE
1031 if (slot == 8)
1032 ec->irq = 11;
1033#endif
1034#ifdef CONFIG_ARCH_RPC
1035 /* On RiscPC, only first two slots have DMA capability */
1036 if (slot < 2)
1037 ec->dma = 2 + slot;
1038#endif
1039
1040 for (ecp = &cards; *ecp; ecp = &(*ecp)->next);
1041
1042 *ecp = ec;
1043 slot_to_expcard[slot] = ec;
1044
1045 device_register(&ec->dev);
1046
1047 return 0;
1048
1049 nodev:
1050 ecard_free_card(ec);
1051 nomem:
1052 return rc;
1053}
1054
1055/*
1056 * Initialise the expansion card system.
1057 * Locate all hardware - interrupt management and
1058 * actual cards.
1059 */
1060static int __init ecard_init(void)
1061{
1062 int slot, irqhw, ret;
1063
1064 ret = kernel_thread(ecard_task, NULL, CLONE_KERNEL);
1065 if (ret < 0) {
1066 printk(KERN_ERR "Ecard: unable to create kernel thread: %d\n",
1067 ret);
1068 return ret;
1069 }
1070
1071 printk("Probing expansion cards\n");
1072
1073 for (slot = 0; slot < 8; slot ++) {
1074 if (ecard_probe(slot, ECARD_EASI) == -ENODEV)
1075 ecard_probe(slot, ECARD_IOC);
1076 }
1077
1078#ifdef IO_EC_MEMC8_BASE
1079 ecard_probe(8, ECARD_IOC);
1080#endif
1081
1082 irqhw = ecard_probeirqhw();
1083
1084 set_irq_chained_handler(IRQ_EXPANSIONCARD,
1085 irqhw ? ecard_irqexp_handler : ecard_irq_handler);
1086
1087 ecard_proc_init();
1088
1089 return 0;
1090}
1091
1092subsys_initcall(ecard_init);
1093
1094/*
1095 * ECARD "bus"
1096 */
1097static const struct ecard_id *
1098ecard_match_device(const struct ecard_id *ids, struct expansion_card *ec)
1099{
1100 int i;
1101
1102 for (i = 0; ids[i].manufacturer != 65535; i++)
1103 if (ec->cid.manufacturer == ids[i].manufacturer &&
1104 ec->cid.product == ids[i].product)
1105 return ids + i;
1106
1107 return NULL;
1108}
1109
1110static int ecard_drv_probe(struct device *dev)
1111{
1112 struct expansion_card *ec = ECARD_DEV(dev);
1113 struct ecard_driver *drv = ECARD_DRV(dev->driver);
1114 const struct ecard_id *id;
1115 int ret;
1116
1117 id = ecard_match_device(drv->id_table, ec);
1118
1119 ecard_claim(ec);
1120 ret = drv->probe(ec, id);
1121 if (ret)
1122 ecard_release(ec);
1123 return ret;
1124}
1125
1126static int ecard_drv_remove(struct device *dev)
1127{
1128 struct expansion_card *ec = ECARD_DEV(dev);
1129 struct ecard_driver *drv = ECARD_DRV(dev->driver);
1130
1131 drv->remove(ec);
1132 ecard_release(ec);
1133
1134 return 0;
1135}
1136
1137/*
1138 * Before rebooting, we must make sure that the expansion card is in a
1139 * sensible state, so it can be re-detected. This means that the first
1140 * page of the ROM must be visible. We call the expansion cards reset
1141 * handler, if any.
1142 */
1143static void ecard_drv_shutdown(struct device *dev)
1144{
1145 struct expansion_card *ec = ECARD_DEV(dev);
1146 struct ecard_driver *drv = ECARD_DRV(dev->driver);
1147 struct ecard_request req;
1148
1149 if (drv->shutdown)
1150 drv->shutdown(ec);
1151 ecard_release(ec);
1152
1153 /*
1154 * If this card has a loader, call the reset handler.
1155 */
1156 if (ec->loader) {
1157 req.fn = ecard_task_reset;
1158 req.ec = ec;
1159 ecard_call(&req);
1160 }
1161}
1162
1163int ecard_register_driver(struct ecard_driver *drv)
1164{
1165 drv->drv.bus = &ecard_bus_type;
1166 drv->drv.probe = ecard_drv_probe;
1167 drv->drv.remove = ecard_drv_remove;
1168 drv->drv.shutdown = ecard_drv_shutdown;
1169
1170 return driver_register(&drv->drv);
1171}
1172
1173void ecard_remove_driver(struct ecard_driver *drv)
1174{
1175 driver_unregister(&drv->drv);
1176}
1177
1178static int ecard_match(struct device *_dev, struct device_driver *_drv)
1179{
1180 struct expansion_card *ec = ECARD_DEV(_dev);
1181 struct ecard_driver *drv = ECARD_DRV(_drv);
1182 int ret;
1183
1184 if (drv->id_table) {
1185 ret = ecard_match_device(drv->id_table, ec) != NULL;
1186 } else {
1187 ret = ec->cid.id == drv->id;
1188 }
1189
1190 return ret;
1191}
1192
1193struct bus_type ecard_bus_type = {
1194 .name = "ecard",
1195 .dev_attrs = ecard_dev_attrs,
1196 .match = ecard_match,
1197};
1198
1199static int ecard_bus_init(void)
1200{
1201 return bus_register(&ecard_bus_type);
1202}
1203
1204postcore_initcall(ecard_bus_init);
1205
1206EXPORT_SYMBOL(ecard_readchunk);
1207EXPORT_SYMBOL(__ecard_address);
1208EXPORT_SYMBOL(ecard_register_driver);
1209EXPORT_SYMBOL(ecard_remove_driver);
1210EXPORT_SYMBOL(ecard_bus_type);
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
new file mode 100644
index 000000000000..bb27c317d94b
--- /dev/null
+++ b/arch/arm/kernel/entry-armv.S
@@ -0,0 +1,745 @@
1/*
2 * linux/arch/arm/kernel/entry-armv.S
3 *
4 * Copyright (C) 1996,1997,1998 Russell King.
5 * ARM700 fix by Matthew Godbolt (linux-user@willothewisp.demon.co.uk)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Low-level vector interface routines
12 *
13 * Note: there is a StrongARM bug in the STMIA rn, {regs}^ instruction that causes
14 * it to save wrong values... Be aware!
15 */
16#include <linux/config.h>
17#include <linux/init.h>
18
19#include <asm/thread_info.h>
20#include <asm/glue.h>
21#include <asm/ptrace.h>
22#include <asm/vfpmacros.h>
23
24#include "entry-header.S"
25
26/*
27 * Invalid mode handlers
28 */
29 .macro inv_entry, sym, reason
30 sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go
31 stmia sp, {r0 - lr} @ Save XXX r0 - lr
32 ldr r4, .LC\sym
33 mov r1, #\reason
34 .endm
35
36__pabt_invalid:
37 inv_entry abt, BAD_PREFETCH
38 b 1f
39
40__dabt_invalid:
41 inv_entry abt, BAD_DATA
42 b 1f
43
44__irq_invalid:
45 inv_entry irq, BAD_IRQ
46 b 1f
47
48__und_invalid:
49 inv_entry und, BAD_UNDEFINSTR
50
511: zero_fp
52 ldmia r4, {r5 - r7} @ Get XXX pc, cpsr, old_r0
53 add r4, sp, #S_PC
54 stmia r4, {r5 - r7} @ Save XXX pc, cpsr, old_r0
55 mov r0, sp
56 and r2, r6, #31 @ int mode
57 b bad_mode
58
59/*
60 * SVC mode handlers
61 */
62 .macro svc_entry, sym
63 sub sp, sp, #S_FRAME_SIZE
64 stmia sp, {r0 - r12} @ save r0 - r12
65 ldr r2, .LC\sym
66 add r0, sp, #S_FRAME_SIZE
67 ldmia r2, {r2 - r4} @ get pc, cpsr
68 add r5, sp, #S_SP
69 mov r1, lr
70
71 @
72 @ We are now ready to fill in the remaining blanks on the stack:
73 @
74 @ r0 - sp_svc
75 @ r1 - lr_svc
76 @ r2 - lr_<exception>, already fixed up for correct return/restart
77 @ r3 - spsr_<exception>
78 @ r4 - orig_r0 (see pt_regs definition in ptrace.h)
79 @
80 stmia r5, {r0 - r4}
81 .endm
82
83 .align 5
84__dabt_svc:
85 svc_entry abt
86
87 @
88 @ get ready to re-enable interrupts if appropriate
89 @
90 mrs r9, cpsr
91 tst r3, #PSR_I_BIT
92 biceq r9, r9, #PSR_I_BIT
93
94 @
95 @ Call the processor-specific abort handler:
96 @
97 @ r2 - aborted context pc
98 @ r3 - aborted context cpsr
99 @
100 @ The abort handler must return the aborted address in r0, and
101 @ the fault status register in r1. r9 must be preserved.
102 @
103#ifdef MULTI_ABORT
104 ldr r4, .LCprocfns
105 mov lr, pc
106 ldr pc, [r4]
107#else
108 bl CPU_ABORT_HANDLER
109#endif
110
111 @
112 @ set desired IRQ state, then call main handler
113 @
114 msr cpsr_c, r9
115 mov r2, sp
116 bl do_DataAbort
117
118 @
119 @ IRQs off again before pulling preserved data off the stack
120 @
121 disable_irq r0
122
123 @
124 @ restore SPSR and restart the instruction
125 @
126 ldr r0, [sp, #S_PSR]
127 msr spsr_cxsf, r0
128 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
129
130 .align 5
131__irq_svc:
132 svc_entry irq
133#ifdef CONFIG_PREEMPT
134 get_thread_info r8
135 ldr r9, [r8, #TI_PREEMPT] @ get preempt count
136 add r7, r9, #1 @ increment it
137 str r7, [r8, #TI_PREEMPT]
138#endif
1391: get_irqnr_and_base r0, r6, r5, lr
140 movne r1, sp
141 @
142 @ routine called with r0 = irq number, r1 = struct pt_regs *
143 @
144 adrne lr, 1b
145 bne asm_do_IRQ
146#ifdef CONFIG_PREEMPT
147 ldr r0, [r8, #TI_FLAGS] @ get flags
148 tst r0, #_TIF_NEED_RESCHED
149 blne svc_preempt
150preempt_return:
151 ldr r0, [r8, #TI_PREEMPT] @ read preempt value
152 teq r0, r7
153 str r9, [r8, #TI_PREEMPT] @ restore preempt count
154 strne r0, [r0, -r0] @ bug()
155#endif
156 ldr r0, [sp, #S_PSR] @ irqs are already disabled
157 msr spsr_cxsf, r0
158 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
159
160 .ltorg
161
162#ifdef CONFIG_PREEMPT
163svc_preempt:
164 teq r9, #0 @ was preempt count = 0
165 ldreq r6, .LCirq_stat
166 movne pc, lr @ no
167 ldr r0, [r6, #4] @ local_irq_count
168 ldr r1, [r6, #8] @ local_bh_count
169 adds r0, r0, r1
170 movne pc, lr
171 mov r7, #0 @ preempt_schedule_irq
172 str r7, [r8, #TI_PREEMPT] @ expects preempt_count == 0
1731: bl preempt_schedule_irq @ irq en/disable is done inside
174 ldr r0, [r8, #TI_FLAGS] @ get new tasks TI_FLAGS
175 tst r0, #_TIF_NEED_RESCHED
176 beq preempt_return @ go again
177 b 1b
178#endif
179
180 .align 5
181__und_svc:
182 svc_entry und
183
184 @
185 @ call emulation code, which returns using r9 if it has emulated
186 @ the instruction, or the more conventional lr if we are to treat
187 @ this as a real undefined instruction
188 @
189 @ r0 - instruction
190 @
191 ldr r0, [r2, #-4]
192 adr r9, 1f
193 bl call_fpe
194
195 mov r0, sp @ struct pt_regs *regs
196 bl do_undefinstr
197
198 @
199 @ IRQs off again before pulling preserved data off the stack
200 @
2011: disable_irq r0
202
203 @
204 @ restore SPSR and restart the instruction
205 @
206 ldr lr, [sp, #S_PSR] @ Get SVC cpsr
207 msr spsr_cxsf, lr
208 ldmia sp, {r0 - pc}^ @ Restore SVC registers
209
210 .align 5
211__pabt_svc:
212 svc_entry abt
213
214 @
215 @ re-enable interrupts if appropriate
216 @
217 mrs r9, cpsr
218 tst r3, #PSR_I_BIT
219 biceq r9, r9, #PSR_I_BIT
220 msr cpsr_c, r9
221
222 @
223 @ set args, then call main handler
224 @
225 @ r0 - address of faulting instruction
226 @ r1 - pointer to registers on stack
227 @
228 mov r0, r2 @ address (pc)
229 mov r1, sp @ regs
230 bl do_PrefetchAbort @ call abort handler
231
232 @
233 @ IRQs off again before pulling preserved data off the stack
234 @
235 disable_irq r0
236
237 @
238 @ restore SPSR and restart the instruction
239 @
240 ldr r0, [sp, #S_PSR]
241 msr spsr_cxsf, r0
242 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
243
244 .align 5
245.LCirq:
246 .word __temp_irq
247.LCund:
248 .word __temp_und
249.LCabt:
250 .word __temp_abt
251#ifdef MULTI_ABORT
252.LCprocfns:
253 .word processor
254#endif
255.LCfp:
256 .word fp_enter
257#ifdef CONFIG_PREEMPT
258.LCirq_stat:
259 .word irq_stat
260#endif
261
262/*
263 * User mode handlers
264 */
265 .macro usr_entry, sym
266 sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go
267 stmia sp, {r0 - r12} @ save r0 - r12
268 ldr r7, .LC\sym
269 add r5, sp, #S_PC
270 ldmia r7, {r2 - r4} @ Get USR pc, cpsr
271
272 @
273 @ We are now ready to fill in the remaining blanks on the stack:
274 @
275 @ r2 - lr_<exception>, already fixed up for correct return/restart
276 @ r3 - spsr_<exception>
277 @ r4 - orig_r0 (see pt_regs definition in ptrace.h)
278 @
279 @ Also, separately save sp_usr and lr_usr
280 @
281 stmia r5, {r2 - r4}
282 stmdb r5, {sp, lr}^
283
284 @
285 @ Enable the alignment trap while in kernel mode
286 @
287 alignment_trap r7, r0, __temp_\sym
288
289 @
290 @ Clear FP to mark the first stack frame
291 @
292 zero_fp
293 .endm
294
295 .align 5
296__dabt_usr:
297 usr_entry abt
298
299 @
300 @ Call the processor-specific abort handler:
301 @
302 @ r2 - aborted context pc
303 @ r3 - aborted context cpsr
304 @
305 @ The abort handler must return the aborted address in r0, and
306 @ the fault status register in r1.
307 @
308#ifdef MULTI_ABORT
309 ldr r4, .LCprocfns
310 mov lr, pc
311 ldr pc, [r4]
312#else
313 bl CPU_ABORT_HANDLER
314#endif
315
316 @
317 @ IRQs on, then call the main handler
318 @
319 enable_irq r2
320 mov r2, sp
321 adr lr, ret_from_exception
322 b do_DataAbort
323
324 .align 5
325__irq_usr:
326 usr_entry irq
327
328#ifdef CONFIG_PREEMPT
329 get_thread_info r8
330 ldr r9, [r8, #TI_PREEMPT] @ get preempt count
331 add r7, r9, #1 @ increment it
332 str r7, [r8, #TI_PREEMPT]
333#endif
3341: get_irqnr_and_base r0, r6, r5, lr
335 movne r1, sp
336 adrne lr, 1b
337 @
338 @ routine called with r0 = irq number, r1 = struct pt_regs *
339 @
340 bne asm_do_IRQ
341#ifdef CONFIG_PREEMPT
342 ldr r0, [r8, #TI_PREEMPT]
343 teq r0, r7
344 str r9, [r8, #TI_PREEMPT]
345 strne r0, [r0, -r0]
346 mov tsk, r8
347#else
348 get_thread_info tsk
349#endif
350 mov why, #0
351 b ret_to_user
352
353 .ltorg
354
355 .align 5
356__und_usr:
357 usr_entry und
358
359 tst r3, #PSR_T_BIT @ Thumb mode?
360 bne fpundefinstr @ ignore FP
361 sub r4, r2, #4
362
363 @
364 @ fall through to the emulation code, which returns using r9 if
365 @ it has emulated the instruction, or the more conventional lr
366 @ if we are to treat this as a real undefined instruction
367 @
368 @ r0 - instruction
369 @
3701: ldrt r0, [r4]
371 adr r9, ret_from_exception
372 adr lr, fpundefinstr
373 @
374 @ fallthrough to call_fpe
375 @
376
377/*
378 * The out of line fixup for the ldrt above.
379 */
380 .section .fixup, "ax"
3812: mov pc, r9
382 .previous
383 .section __ex_table,"a"
384 .long 1b, 2b
385 .previous
386
387/*
388 * Check whether the instruction is a co-processor instruction.
389 * If yes, we need to call the relevant co-processor handler.
390 *
391 * Note that we don't do a full check here for the co-processor
392 * instructions; all instructions with bit 27 set are well
393 * defined. The only instructions that should fault are the
394 * co-processor instructions. However, we have to watch out
395 * for the ARM6/ARM7 SWI bug.
396 *
397 * Emulators may wish to make use of the following registers:
398 * r0 = instruction opcode.
399 * r2 = PC+4
400 * r10 = this threads thread_info structure.
401 */
402call_fpe:
403 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
404#if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710)
405 and r8, r0, #0x0f000000 @ mask out op-code bits
406 teqne r8, #0x0f000000 @ SWI (ARM6/7 bug)?
407#endif
408 moveq pc, lr
409 get_thread_info r10 @ get current thread
410 and r8, r0, #0x00000f00 @ mask out CP number
411 mov r7, #1
412 add r6, r10, #TI_USED_CP
413 strb r7, [r6, r8, lsr #8] @ set appropriate used_cp[]
414#ifdef CONFIG_IWMMXT
415 @ Test if we need to give access to iWMMXt coprocessors
416 ldr r5, [r10, #TI_FLAGS]
417 rsbs r7, r8, #(1 << 8) @ CP 0 or 1 only
418 movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1)
419 bcs iwmmxt_task_enable
420#endif
421 enable_irq r7
422 add pc, pc, r8, lsr #6
423 mov r0, r0
424
425 mov pc, lr @ CP#0
426 b do_fpe @ CP#1 (FPE)
427 b do_fpe @ CP#2 (FPE)
428 mov pc, lr @ CP#3
429 mov pc, lr @ CP#4
430 mov pc, lr @ CP#5
431 mov pc, lr @ CP#6
432 mov pc, lr @ CP#7
433 mov pc, lr @ CP#8
434 mov pc, lr @ CP#9
435#ifdef CONFIG_VFP
436 b do_vfp @ CP#10 (VFP)
437 b do_vfp @ CP#11 (VFP)
438#else
439 mov pc, lr @ CP#10 (VFP)
440 mov pc, lr @ CP#11 (VFP)
441#endif
442 mov pc, lr @ CP#12
443 mov pc, lr @ CP#13
444 mov pc, lr @ CP#14 (Debug)
445 mov pc, lr @ CP#15 (Control)
446
447do_fpe:
448 ldr r4, .LCfp
449 add r10, r10, #TI_FPSTATE @ r10 = workspace
450 ldr pc, [r4] @ Call FP module USR entry point
451
452/*
453 * The FP module is called with these registers set:
454 * r0 = instruction
455 * r2 = PC+4
456 * r9 = normal "successful" return address
457 * r10 = FP workspace
458 * lr = unrecognised FP instruction return address
459 */
460
461 .data
462ENTRY(fp_enter)
463 .word fpundefinstr
464 .text
465
466fpundefinstr:
467 mov r0, sp
468 adr lr, ret_from_exception
469 b do_undefinstr
470
471 .align 5
472__pabt_usr:
473 usr_entry abt
474
475 enable_irq r0 @ Enable interrupts
476 mov r0, r2 @ address (pc)
477 mov r1, sp @ regs
478 bl do_PrefetchAbort @ call abort handler
479 /* fall through */
480/*
481 * This is the return code to user mode for abort handlers
482 */
483ENTRY(ret_from_exception)
484 get_thread_info tsk
485 mov why, #0
486 b ret_to_user
487
488/*
489 * Register switch for ARMv3 and ARMv4 processors
490 * r0 = previous task_struct, r1 = previous thread_info, r2 = next thread_info
491 * previous and next are guaranteed not to be the same.
492 */
493ENTRY(__switch_to)
494 add ip, r1, #TI_CPU_SAVE
495 ldr r3, [r2, #TI_TP_VALUE]
496 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack
497 ldr r6, [r2, #TI_CPU_DOMAIN]!
498#if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT)
499 mra r4, r5, acc0
500 stmia ip, {r4, r5}
501#endif
502 mov r4, #0xffff0fff
503 str r3, [r4, #-3] @ Set TLS ptr
504 mcr p15, 0, r6, c3, c0, 0 @ Set domain register
505#ifdef CONFIG_VFP
506 @ Always disable VFP so we can lazily save/restore the old
507 @ state. This occurs in the context of the previous thread.
508 VFPFMRX r4, FPEXC
509 bic r4, r4, #FPEXC_ENABLE
510 VFPFMXR FPEXC, r4
511#endif
512#if defined(CONFIG_IWMMXT)
513 bl iwmmxt_task_switch
514#elif defined(CONFIG_CPU_XSCALE)
515 add r4, r2, #40 @ cpu_context_save->extra
516 ldmib r4, {r4, r5}
517 mar acc0, r4, r5
518#endif
519 ldmib r2, {r4 - sl, fp, sp, pc} @ Load all regs saved previously
520
521 __INIT
522/*
523 * Vector stubs.
524 *
525 * This code is copied to 0x200 or 0xffff0200 so we can use branches in the
526 * vectors, rather than ldr's.
527 *
528 * Common stub entry macro:
529 * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
530 */
531 .macro vector_stub, name, sym, correction=0
532 .align 5
533
534vector_\name:
535 ldr r13, .LCs\sym
536 .if \correction
537 sub lr, lr, #\correction
538 .endif
539 str lr, [r13] @ save lr_IRQ
540 mrs lr, spsr
541 str lr, [r13, #4] @ save spsr_IRQ
542 @
543 @ now branch to the relevant MODE handling routine
544 @
545 mrs r13, cpsr
546 bic r13, r13, #MODE_MASK
547 orr r13, r13, #MODE_SVC
548 msr spsr_cxsf, r13 @ switch to SVC_32 mode
549
550 and lr, lr, #15
551 ldr lr, [pc, lr, lsl #2]
552 movs pc, lr @ Changes mode and branches
553 .endm
554
555__stubs_start:
556/*
557 * Interrupt dispatcher
558 */
559 vector_stub irq, irq, 4
560
561 .long __irq_usr @ 0 (USR_26 / USR_32)
562 .long __irq_invalid @ 1 (FIQ_26 / FIQ_32)
563 .long __irq_invalid @ 2 (IRQ_26 / IRQ_32)
564 .long __irq_svc @ 3 (SVC_26 / SVC_32)
565 .long __irq_invalid @ 4
566 .long __irq_invalid @ 5
567 .long __irq_invalid @ 6
568 .long __irq_invalid @ 7
569 .long __irq_invalid @ 8
570 .long __irq_invalid @ 9
571 .long __irq_invalid @ a
572 .long __irq_invalid @ b
573 .long __irq_invalid @ c
574 .long __irq_invalid @ d
575 .long __irq_invalid @ e
576 .long __irq_invalid @ f
577
578/*
579 * Data abort dispatcher
580 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
581 */
582 vector_stub dabt, abt, 8
583
584 .long __dabt_usr @ 0 (USR_26 / USR_32)
585 .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32)
586 .long __dabt_invalid @ 2 (IRQ_26 / IRQ_32)
587 .long __dabt_svc @ 3 (SVC_26 / SVC_32)
588 .long __dabt_invalid @ 4
589 .long __dabt_invalid @ 5
590 .long __dabt_invalid @ 6
591 .long __dabt_invalid @ 7
592 .long __dabt_invalid @ 8
593 .long __dabt_invalid @ 9
594 .long __dabt_invalid @ a
595 .long __dabt_invalid @ b
596 .long __dabt_invalid @ c
597 .long __dabt_invalid @ d
598 .long __dabt_invalid @ e
599 .long __dabt_invalid @ f
600
601/*
602 * Prefetch abort dispatcher
603 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
604 */
605 vector_stub pabt, abt, 4
606
607 .long __pabt_usr @ 0 (USR_26 / USR_32)
608 .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32)
609 .long __pabt_invalid @ 2 (IRQ_26 / IRQ_32)
610 .long __pabt_svc @ 3 (SVC_26 / SVC_32)
611 .long __pabt_invalid @ 4
612 .long __pabt_invalid @ 5
613 .long __pabt_invalid @ 6
614 .long __pabt_invalid @ 7
615 .long __pabt_invalid @ 8
616 .long __pabt_invalid @ 9
617 .long __pabt_invalid @ a
618 .long __pabt_invalid @ b
619 .long __pabt_invalid @ c
620 .long __pabt_invalid @ d
621 .long __pabt_invalid @ e
622 .long __pabt_invalid @ f
623
624/*
625 * Undef instr entry dispatcher
626 * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
627 */
628 vector_stub und, und
629
630 .long __und_usr @ 0 (USR_26 / USR_32)
631 .long __und_invalid @ 1 (FIQ_26 / FIQ_32)
632 .long __und_invalid @ 2 (IRQ_26 / IRQ_32)
633 .long __und_svc @ 3 (SVC_26 / SVC_32)
634 .long __und_invalid @ 4
635 .long __und_invalid @ 5
636 .long __und_invalid @ 6
637 .long __und_invalid @ 7
638 .long __und_invalid @ 8
639 .long __und_invalid @ 9
640 .long __und_invalid @ a
641 .long __und_invalid @ b
642 .long __und_invalid @ c
643 .long __und_invalid @ d
644 .long __und_invalid @ e
645 .long __und_invalid @ f
646
647 .align 5
648
649/*=============================================================================
650 * Undefined FIQs
651 *-----------------------------------------------------------------------------
652 * Enter in FIQ mode, spsr = ANY CPSR, lr = ANY PC
653 * MUST PRESERVE SVC SPSR, but need to switch to SVC mode to show our msg.
654 * Basically to switch modes, we *HAVE* to clobber one register... brain
655 * damage alert! I don't think that we can execute any code in here in any
656 * other mode than FIQ... Ok you can switch to another mode, but you can't
657 * get out of that mode without clobbering one register.
658 */
659vector_fiq:
660 disable_fiq
661 subs pc, lr, #4
662
663/*=============================================================================
664 * Address exception handler
665 *-----------------------------------------------------------------------------
666 * These aren't too critical.
667 * (they're not supposed to happen, and won't happen in 32-bit data mode).
668 */
669
670vector_addrexcptn:
671 b vector_addrexcptn
672
673/*
674 * We group all the following data together to optimise
675 * for CPUs with separate I & D caches.
676 */
677 .align 5
678
679.LCvswi:
680 .word vector_swi
681
682.LCsirq:
683 .word __temp_irq
684.LCsund:
685 .word __temp_und
686.LCsabt:
687 .word __temp_abt
688
689__stubs_end:
690
691 .equ __real_stubs_start, .LCvectors + 0x200
692
693.LCvectors:
694 swi SYS_ERROR0
695 b __real_stubs_start + (vector_und - __stubs_start)
696 ldr pc, __real_stubs_start + (.LCvswi - __stubs_start)
697 b __real_stubs_start + (vector_pabt - __stubs_start)
698 b __real_stubs_start + (vector_dabt - __stubs_start)
699 b __real_stubs_start + (vector_addrexcptn - __stubs_start)
700 b __real_stubs_start + (vector_irq - __stubs_start)
701 b __real_stubs_start + (vector_fiq - __stubs_start)
702
703ENTRY(__trap_init)
704 stmfd sp!, {r4 - r6, lr}
705
706 mov r0, #0xff000000
707 orr r0, r0, #0x00ff0000 @ high vectors position
708 adr r1, .LCvectors @ set up the vectors
709 ldmia r1, {r1, r2, r3, r4, r5, r6, ip, lr}
710 stmia r0, {r1, r2, r3, r4, r5, r6, ip, lr}
711
712 add r2, r0, #0x200
713 adr r0, __stubs_start @ copy stubs to 0x200
714 adr r1, __stubs_end
7151: ldr r3, [r0], #4
716 str r3, [r2], #4
717 cmp r0, r1
718 blt 1b
719 LOADREGS(fd, sp!, {r4 - r6, pc})
720
721 .data
722
723/*
724 * Do not reorder these, and do not insert extra data between...
725 */
726
727__temp_irq:
728 .word 0 @ saved lr_irq
729 .word 0 @ saved spsr_irq
730 .word -1 @ old_r0
731__temp_und:
732 .word 0 @ Saved lr_und
733 .word 0 @ Saved spsr_und
734 .word -1 @ old_r0
735__temp_abt:
736 .word 0 @ Saved lr_abt
737 .word 0 @ Saved spsr_abt
738 .word -1 @ old_r0
739
740 .globl cr_alignment
741 .globl cr_no_alignment
742cr_alignment:
743 .space 4
744cr_no_alignment:
745 .space 4
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
new file mode 100644
index 000000000000..53a7e0dea44d
--- /dev/null
+++ b/arch/arm/kernel/entry-common.S
@@ -0,0 +1,260 @@
1/*
2 * linux/arch/arm/kernel/entry-common.S
3 *
4 * Copyright (C) 2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/config.h>
11
12#include <asm/thread_info.h>
13#include <asm/ptrace.h>
14#include <asm/unistd.h>
15
16#include "entry-header.S"
17
18/*
19 * We rely on the fact that R0 is at the bottom of the stack (due to
20 * slow/fast restore user regs).
21 */
22#if S_R0 != 0
23#error "Please fix"
24#endif
25
26 .align 5
27/*
28 * This is the fast syscall return path. We do as little as
29 * possible here, and this includes saving r0 back into the SVC
30 * stack.
31 */
32ret_fast_syscall:
33 disable_irq r1 @ disable interrupts
34 ldr r1, [tsk, #TI_FLAGS]
35 tst r1, #_TIF_WORK_MASK
36 bne fast_work_pending
37 fast_restore_user_regs
38
39/*
40 * Ok, we need to do extra processing, enter the slow path.
41 */
42fast_work_pending:
43 str r0, [sp, #S_R0+S_OFF]! @ returned r0
44work_pending:
45 tst r1, #_TIF_NEED_RESCHED
46 bne work_resched
47 tst r1, #_TIF_NOTIFY_RESUME | _TIF_SIGPENDING
48 beq no_work_pending
49 mov r0, sp @ 'regs'
50 mov r2, why @ 'syscall'
51 bl do_notify_resume
52 disable_irq r1 @ disable interrupts
53 b no_work_pending
54
55work_resched:
56 bl schedule
57/*
58 * "slow" syscall return path. "why" tells us if this was a real syscall.
59 */
60ENTRY(ret_to_user)
61ret_slow_syscall:
62 disable_irq r1 @ disable interrupts
63 ldr r1, [tsk, #TI_FLAGS]
64 tst r1, #_TIF_WORK_MASK
65 bne work_pending
66no_work_pending:
67 slow_restore_user_regs
68
69/*
70 * This is how we return from a fork.
71 */
72ENTRY(ret_from_fork)
73 bl schedule_tail
74 get_thread_info tsk
75 ldr r1, [tsk, #TI_FLAGS] @ check for syscall tracing
76 mov why, #1
77 tst r1, #_TIF_SYSCALL_TRACE @ are we tracing syscalls?
78 beq ret_slow_syscall
79 mov r1, sp
80 mov r0, #1 @ trace exit [IP = 1]
81 bl syscall_trace
82 b ret_slow_syscall
83
84
85#include "calls.S"
86
87/*=============================================================================
88 * SWI handler
89 *-----------------------------------------------------------------------------
90 */
91
92 /* If we're optimising for StrongARM the resulting code won't
93 run on an ARM7 and we can save a couple of instructions.
94 --pb */
95#ifdef CONFIG_CPU_ARM710
96 .macro arm710_bug_check, instr, temp
97 and \temp, \instr, #0x0f000000 @ check for SWI
98 teq \temp, #0x0f000000
99 bne .Larm700bug
100 .endm
101
102.Larm700bug:
103 ldr r0, [sp, #S_PSR] @ Get calling cpsr
104 sub lr, lr, #4
105 str lr, [r8]
106 msr spsr_cxsf, r0
107 ldmia sp, {r0 - lr}^ @ Get calling r0 - lr
108 mov r0, r0
109 ldr lr, [sp, #S_PC] @ Get PC
110 add sp, sp, #S_FRAME_SIZE
111 movs pc, lr
112#else
113 .macro arm710_bug_check, instr, temp
114 .endm
115#endif
116
117 .align 5
118ENTRY(vector_swi)
119 save_user_regs
120 zero_fp
121 get_scno
122 arm710_bug_check scno, ip
123
124#ifdef CONFIG_ALIGNMENT_TRAP
125 ldr ip, __cr_alignment
126 ldr ip, [ip]
127 mcr p15, 0, ip, c1, c0 @ update control register
128#endif
129 enable_irq ip
130
131 str r4, [sp, #-S_OFF]! @ push fifth arg
132
133 get_thread_info tsk
134 ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing
135 bic scno, scno, #0xff000000 @ mask off SWI op-code
136 eor scno, scno, #OS_NUMBER << 20 @ check OS number
137 adr tbl, sys_call_table @ load syscall table pointer
138 tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls?
139 bne __sys_trace
140
141 adr lr, ret_fast_syscall @ return address
142 cmp scno, #NR_syscalls @ check upper syscall limit
143 ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine
144
145 add r1, sp, #S_OFF
1462: mov why, #0 @ no longer a real syscall
147 cmp scno, #ARMSWI_OFFSET
148 eor r0, scno, #OS_NUMBER << 20 @ put OS number back
149 bcs arm_syscall
150 b sys_ni_syscall @ not private func
151
152 /*
153 * This is the really slow path. We're going to be doing
154 * context switches, and waiting for our parent to respond.
155 */
156__sys_trace:
157 add r1, sp, #S_OFF
158 mov r0, #0 @ trace entry [IP = 0]
159 bl syscall_trace
160
161 adr lr, __sys_trace_return @ return address
162 add r1, sp, #S_R0 + S_OFF @ pointer to regs
163 cmp scno, #NR_syscalls @ check upper syscall limit
164 ldmccia r1, {r0 - r3} @ have to reload r0 - r3
165 ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine
166 b 2b
167
168__sys_trace_return:
169 str r0, [sp, #S_R0 + S_OFF]! @ save returned r0
170 mov r1, sp
171 mov r0, #1 @ trace exit [IP = 1]
172 bl syscall_trace
173 b ret_slow_syscall
174
175 .align 5
176#ifdef CONFIG_ALIGNMENT_TRAP
177 .type __cr_alignment, #object
178__cr_alignment:
179 .word cr_alignment
180#endif
181
182 .type sys_call_table, #object
183ENTRY(sys_call_table)
184#include "calls.S"
185
186/*============================================================================
187 * Special system call wrappers
188 */
189@ r0 = syscall number
190@ r5 = syscall table
191 .type sys_syscall, #function
192sys_syscall:
193 eor scno, r0, #OS_NUMBER << 20
194 cmp scno, #__NR_syscall - __NR_SYSCALL_BASE
195 cmpne scno, #NR_syscalls @ check range
196 stmloia sp, {r5, r6} @ shuffle args
197 movlo r0, r1
198 movlo r1, r2
199 movlo r2, r3
200 movlo r3, r4
201 ldrlo pc, [tbl, scno, lsl #2]
202 b sys_ni_syscall
203
204sys_fork_wrapper:
205 add r0, sp, #S_OFF
206 b sys_fork
207
208sys_vfork_wrapper:
209 add r0, sp, #S_OFF
210 b sys_vfork
211
212sys_execve_wrapper:
213 add r3, sp, #S_OFF
214 b sys_execve
215
216sys_clone_wrapper:
217 add ip, sp, #S_OFF
218 str ip, [sp, #4]
219 b sys_clone
220
221sys_sigsuspend_wrapper:
222 add r3, sp, #S_OFF
223 b sys_sigsuspend
224
225sys_rt_sigsuspend_wrapper:
226 add r2, sp, #S_OFF
227 b sys_rt_sigsuspend
228
229sys_sigreturn_wrapper:
230 add r0, sp, #S_OFF
231 b sys_sigreturn
232
233sys_rt_sigreturn_wrapper:
234 add r0, sp, #S_OFF
235 b sys_rt_sigreturn
236
237sys_sigaltstack_wrapper:
238 ldr r2, [sp, #S_OFF + S_SP]
239 b do_sigaltstack
240
241sys_futex_wrapper:
242 str r5, [sp, #4] @ push sixth arg
243 b sys_futex
244
245/*
246 * Note: off_4k (r5) is always units of 4K. If we can't do the requested
247 * offset, we return EINVAL.
248 */
249sys_mmap2:
250#if PAGE_SHIFT > 12
251 tst r5, #PGOFF_MASK
252 moveq r5, r5, lsr #PAGE_SHIFT - 12
253 streq r5, [sp, #4]
254 beq do_mmap2
255 mov r0, #-EINVAL
256 RETINSTR(mov,pc, lr)
257#else
258 str r5, [sp, #4]
259 b do_mmap2
260#endif
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
new file mode 100644
index 000000000000..4039d8c120b5
--- /dev/null
+++ b/arch/arm/kernel/entry-header.S
@@ -0,0 +1,182 @@
1#include <linux/config.h> /* for CONFIG_ARCH_xxxx */
2#include <linux/linkage.h>
3
4#include <asm/assembler.h>
5#include <asm/constants.h>
6#include <asm/errno.h>
7#include <asm/hardware.h>
8#include <asm/arch/irqs.h>
9#include <asm/arch/entry-macro.S>
10
11#ifndef MODE_SVC
12#define MODE_SVC 0x13
13#endif
14
15 .macro zero_fp
16#ifdef CONFIG_FRAME_POINTER
17 mov fp, #0
18#endif
19 .endm
20
21 .text
22
23@ Bad Abort numbers
24@ -----------------
25@
26#define BAD_PREFETCH 0
27#define BAD_DATA 1
28#define BAD_ADDREXCPTN 2
29#define BAD_IRQ 3
30#define BAD_UNDEFINSTR 4
31
32#define PT_TRACESYS 0x00000002
33
34@ OS version number used in SWIs
35@ RISC OS is 0
36@ RISC iX is 8
37@
38#define OS_NUMBER 9
39#define ARMSWI_OFFSET 0x000f0000
40
41@
42@ Stack format (ensured by USER_* and SVC_*)
43@
44#define S_FRAME_SIZE 72
45#define S_OLD_R0 68
46#define S_PSR 64
47
48#define S_PC 60
49#define S_LR 56
50#define S_SP 52
51#define S_IP 48
52#define S_FP 44
53#define S_R10 40
54#define S_R9 36
55#define S_R8 32
56#define S_R7 28
57#define S_R6 24
58#define S_R5 20
59#define S_R4 16
60#define S_R3 12
61#define S_R2 8
62#define S_R1 4
63#define S_R0 0
64#define S_OFF 8
65
66 .macro set_cpsr_c, reg, mode
67 msr cpsr_c, \mode
68 .endm
69
70#if __LINUX_ARM_ARCH__ >= 6
71 .macro disable_irq, temp
72 cpsid i
73 .endm
74
75 .macro enable_irq, temp
76 cpsie i
77 .endm
78#else
79 .macro disable_irq, temp
80 set_cpsr_c \temp, #PSR_I_BIT | MODE_SVC
81 .endm
82
83 .macro enable_irq, temp
84 set_cpsr_c \temp, #MODE_SVC
85 .endm
86#endif
87
88 .macro save_user_regs
89 sub sp, sp, #S_FRAME_SIZE
90 stmia sp, {r0 - r12} @ Calling r0 - r12
91 add r8, sp, #S_PC
92 stmdb r8, {sp, lr}^ @ Calling sp, lr
93 mrs r8, spsr @ called from non-FIQ mode, so ok.
94 str lr, [sp, #S_PC] @ Save calling PC
95 str r8, [sp, #S_PSR] @ Save CPSR
96 str r0, [sp, #S_OLD_R0] @ Save OLD_R0
97 .endm
98
99 .macro restore_user_regs
100 ldr r1, [sp, #S_PSR] @ Get calling cpsr
101 disable_irq ip @ disable IRQs
102 ldr lr, [sp, #S_PC]! @ Get PC
103 msr spsr_cxsf, r1 @ save in spsr_svc
104 ldmdb sp, {r0 - lr}^ @ Get calling r0 - lr
105 mov r0, r0
106 add sp, sp, #S_FRAME_SIZE - S_PC
107 movs pc, lr @ return & move spsr_svc into cpsr
108 .endm
109
110/*
111 * Must be called with IRQs already disabled.
112 */
113 .macro fast_restore_user_regs
114 ldr r1, [sp, #S_OFF + S_PSR] @ get calling cpsr
115 ldr lr, [sp, #S_OFF + S_PC]! @ get pc
116 msr spsr_cxsf, r1 @ save in spsr_svc
117 ldmdb sp, {r1 - lr}^ @ get calling r1 - lr
118 mov r0, r0
119 add sp, sp, #S_FRAME_SIZE - S_PC
120 movs pc, lr @ return & move spsr_svc into cpsr
121 .endm
122
123/*
124 * Must be called with IRQs already disabled.
125 */
126 .macro slow_restore_user_regs
127 ldr r1, [sp, #S_PSR] @ get calling cpsr
128 ldr lr, [sp, #S_PC]! @ get pc
129 msr spsr_cxsf, r1 @ save in spsr_svc
130 ldmdb sp, {r0 - lr}^ @ get calling r1 - lr
131 mov r0, r0
132 add sp, sp, #S_FRAME_SIZE - S_PC
133 movs pc, lr @ return & move spsr_svc into cpsr
134 .endm
135
136 .macro mask_pc, rd, rm
137 .endm
138
139 .macro get_thread_info, rd
140 mov \rd, sp, lsr #13
141 mov \rd, \rd, lsl #13
142 .endm
143
144 .macro alignment_trap, rbase, rtemp, sym
145#ifdef CONFIG_ALIGNMENT_TRAP
146#define OFF_CR_ALIGNMENT(x) cr_alignment - x
147
148 ldr \rtemp, [\rbase, #OFF_CR_ALIGNMENT(\sym)]
149 mcr p15, 0, \rtemp, c1, c0
150#endif
151 .endm
152
153
154/*
155 * These are the registers used in the syscall handler, and allow us to
156 * have in theory up to 7 arguments to a function - r0 to r6.
157 *
158 * r7 is reserved for the system call number for thumb mode.
159 *
160 * Note that tbl == why is intentional.
161 *
162 * We must set at least "tsk" and "why" when calling ret_with_reschedule.
163 */
164scno .req r7 @ syscall number
165tbl .req r8 @ syscall table pointer
166why .req r8 @ Linux syscall (!= 0)
167tsk .req r9 @ current thread_info
168
169/*
170 * Get the system call number.
171 */
172 .macro get_scno
173#ifdef CONFIG_ARM_THUMB
174 tst r8, #PSR_T_BIT @ this is SPSR from save_user_regs
175 addne scno, r7, #OS_NUMBER << 20 @ put OS number in
176 ldreq scno, [lr, #-4]
177
178#else
179 mask_pc lr, lr
180 ldr scno, [lr, #-4] @ get SWI instruction
181#endif
182 .endm
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
new file mode 100644
index 000000000000..9299dfc25698
--- /dev/null
+++ b/arch/arm/kernel/fiq.c
@@ -0,0 +1,181 @@
1/*
2 * linux/arch/arm/kernel/fiq.c
3 *
4 * Copyright (C) 1998 Russell King
5 * Copyright (C) 1998, 1999 Phil Blundell
6 *
7 * FIQ support written by Philip Blundell <philb@gnu.org>, 1998.
8 *
9 * FIQ support re-written by Russell King to be more generic
10 *
11 * We now properly support a method by which the FIQ handlers can
12 * be stacked onto the vector. We still do not support sharing
13 * the FIQ vector itself.
14 *
15 * Operation is as follows:
16 * 1. Owner A claims FIQ:
17 * - default_fiq relinquishes control.
18 * 2. Owner A:
19 * - inserts code.
20 * - sets any registers,
21 * - enables FIQ.
22 * 3. Owner B claims FIQ:
23 * - if owner A has a relinquish function.
24 * - disable FIQs.
25 * - saves any registers.
26 * - returns zero.
27 * 4. Owner B:
28 * - inserts code.
29 * - sets any registers,
30 * - enables FIQ.
31 * 5. Owner B releases FIQ:
32 * - Owner A is asked to reacquire FIQ:
33 * - inserts code.
34 * - restores saved registers.
35 * - enables FIQ.
36 * 6. Goto 3
37 */
38#include <linux/module.h>
39#include <linux/kernel.h>
40#include <linux/init.h>
41#include <linux/seq_file.h>
42
43#include <asm/cacheflush.h>
44#include <asm/fiq.h>
45#include <asm/irq.h>
46#include <asm/system.h>
47#include <asm/uaccess.h>
48
49static unsigned long no_fiq_insn;
50
51/* Default reacquire function
52 * - we always relinquish FIQ control
53 * - we always reacquire FIQ control
54 */
55static int fiq_def_op(void *ref, int relinquish)
56{
57 if (!relinquish)
58 set_fiq_handler(&no_fiq_insn, sizeof(no_fiq_insn));
59
60 return 0;
61}
62
63static struct fiq_handler default_owner = {
64 .name = "default",
65 .fiq_op = fiq_def_op,
66};
67
68static struct fiq_handler *current_fiq = &default_owner;
69
70int show_fiq_list(struct seq_file *p, void *v)
71{
72 if (current_fiq != &default_owner)
73 seq_printf(p, "FIQ: %s\n", current_fiq->name);
74
75 return 0;
76}
77
78void set_fiq_handler(void *start, unsigned int length)
79{
80 memcpy((void *)0xffff001c, start, length);
81 flush_icache_range(0xffff001c, 0xffff001c + length);
82 if (!vectors_high())
83 flush_icache_range(0x1c, 0x1c + length);
84}
85
86/*
87 * Taking an interrupt in FIQ mode is death, so both these functions
88 * disable irqs for the duration. Note - these functions are almost
89 * entirely coded in assembly.
90 */
91void __attribute__((naked)) set_fiq_regs(struct pt_regs *regs)
92{
93 register unsigned long tmp;
94 asm volatile (
95 "mov ip, sp\n\
96 stmfd sp!, {fp, ip, lr, pc}\n\
97 sub fp, ip, #4\n\
98 mrs %0, cpsr\n\
99 msr cpsr_c, %2 @ select FIQ mode\n\
100 mov r0, r0\n\
101 ldmia %1, {r8 - r14}\n\
102 msr cpsr_c, %0 @ return to SVC mode\n\
103 mov r0, r0\n\
104 ldmea fp, {fp, sp, pc}"
105 : "=&r" (tmp)
106 : "r" (&regs->ARM_r8), "I" (PSR_I_BIT | PSR_F_BIT | FIQ_MODE));
107}
108
109void __attribute__((naked)) get_fiq_regs(struct pt_regs *regs)
110{
111 register unsigned long tmp;
112 asm volatile (
113 "mov ip, sp\n\
114 stmfd sp!, {fp, ip, lr, pc}\n\
115 sub fp, ip, #4\n\
116 mrs %0, cpsr\n\
117 msr cpsr_c, %2 @ select FIQ mode\n\
118 mov r0, r0\n\
119 stmia %1, {r8 - r14}\n\
120 msr cpsr_c, %0 @ return to SVC mode\n\
121 mov r0, r0\n\
122 ldmea fp, {fp, sp, pc}"
123 : "=&r" (tmp)
124 : "r" (&regs->ARM_r8), "I" (PSR_I_BIT | PSR_F_BIT | FIQ_MODE));
125}
126
127int claim_fiq(struct fiq_handler *f)
128{
129 int ret = 0;
130
131 if (current_fiq) {
132 ret = -EBUSY;
133
134 if (current_fiq->fiq_op != NULL)
135 ret = current_fiq->fiq_op(current_fiq->dev_id, 1);
136 }
137
138 if (!ret) {
139 f->next = current_fiq;
140 current_fiq = f;
141 }
142
143 return ret;
144}
145
146void release_fiq(struct fiq_handler *f)
147{
148 if (current_fiq != f) {
149 printk(KERN_ERR "%s FIQ trying to release %s FIQ\n",
150 f->name, current_fiq->name);
151 dump_stack();
152 return;
153 }
154
155 do
156 current_fiq = current_fiq->next;
157 while (current_fiq->fiq_op(current_fiq->dev_id, 0));
158}
159
160void enable_fiq(int fiq)
161{
162 enable_irq(fiq + FIQ_START);
163}
164
165void disable_fiq(int fiq)
166{
167 disable_irq(fiq + FIQ_START);
168}
169
170EXPORT_SYMBOL(set_fiq_handler);
171EXPORT_SYMBOL(set_fiq_regs);
172EXPORT_SYMBOL(get_fiq_regs);
173EXPORT_SYMBOL(claim_fiq);
174EXPORT_SYMBOL(release_fiq);
175EXPORT_SYMBOL(enable_fiq);
176EXPORT_SYMBOL(disable_fiq);
177
178void __init init_FIQ(void)
179{
180 no_fiq_insn = *(unsigned long *)0xffff001c;
181}
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
new file mode 100644
index 000000000000..171b3e811c71
--- /dev/null
+++ b/arch/arm/kernel/head.S
@@ -0,0 +1,516 @@
1/*
2 * linux/arch/arm/kernel/head.S
3 *
4 * Copyright (C) 1994-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Kernel startup code for all 32-bit CPUs
11 */
12#include <linux/config.h>
13#include <linux/linkage.h>
14#include <linux/init.h>
15
16#include <asm/assembler.h>
17#include <asm/domain.h>
18#include <asm/mach-types.h>
19#include <asm/procinfo.h>
20#include <asm/ptrace.h>
21#include <asm/constants.h>
22#include <asm/system.h>
23
24#define PROCINFO_MMUFLAGS 8
25#define PROCINFO_INITFUNC 12
26
27#define MACHINFO_TYPE 0
28#define MACHINFO_PHYSRAM 4
29#define MACHINFO_PHYSIO 8
30#define MACHINFO_PGOFFIO 12
31#define MACHINFO_NAME 16
32
33#ifndef CONFIG_XIP_KERNEL
34/*
35 * We place the page tables 16K below TEXTADDR. Therefore, we must make sure
36 * that TEXTADDR is correctly set. Currently, we expect the least significant
37 * 16 bits to be 0x8000, but we could probably relax this restriction to
38 * TEXTADDR >= PAGE_OFFSET + 0x4000
39 *
40 * Note that swapper_pg_dir is the virtual address of the page tables, and
41 * pgtbl gives us a position-independent reference to these tables. We can
42 * do this because stext == TEXTADDR
43 */
44#if (TEXTADDR & 0xffff) != 0x8000
45#error TEXTADDR must start at 0xXXXX8000
46#endif
47
48 .globl swapper_pg_dir
49 .equ swapper_pg_dir, TEXTADDR - 0x4000
50
51 .macro pgtbl, rd, phys
52 adr \rd, stext
53 sub \rd, \rd, #0x4000
54 .endm
55#else
56/*
57 * XIP Kernel:
58 *
59 * We place the page tables 16K below DATAADDR. Therefore, we must make sure
60 * that DATAADDR is correctly set. Currently, we expect the least significant
61 * 16 bits to be 0x8000, but we could probably relax this restriction to
62 * DATAADDR >= PAGE_OFFSET + 0x4000
63 *
64 * Note that pgtbl is meant to return the physical address of swapper_pg_dir.
65 * We can't make it relative to the kernel position in this case since
66 * the kernel can physically be anywhere.
67 */
68#if (DATAADDR & 0xffff) != 0x8000
69#error DATAADDR must start at 0xXXXX8000
70#endif
71
72 .globl swapper_pg_dir
73 .equ swapper_pg_dir, DATAADDR - 0x4000
74
75 .macro pgtbl, rd, phys
76 ldr \rd, =((DATAADDR - 0x4000) - VIRT_OFFSET)
77 add \rd, \rd, \phys
78 .endm
79#endif
80
81/*
82 * Kernel startup entry point.
83 * ---------------------------
84 *
85 * This is normally called from the decompressor code. The requirements
86 * are: MMU = off, D-cache = off, I-cache = dont care, r0 = 0,
87 * r1 = machine nr.
88 *
89 * This code is mostly position independent, so if you link the kernel at
90 * 0xc0008000, you call this at __pa(0xc0008000).
91 *
92 * See linux/arch/arm/tools/mach-types for the complete list of machine
93 * numbers for r1.
94 *
95 * We're trying to keep crap to a minimum; DO NOT add any machine specific
96 * crap here - that's what the boot loader (or in extreme, well justified
97 * circumstances, zImage) is for.
98 */
99 __INIT
100 .type stext, %function
101ENTRY(stext)
102 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode
103 @ and irqs disabled
104 bl __lookup_processor_type @ r5=procinfo r9=cpuid
105 movs r10, r5 @ invalid processor (r5=0)?
106 beq __error_p @ yes, error 'p'
107 bl __lookup_machine_type @ r5=machinfo
108 movs r8, r5 @ invalid machine (r5=0)?
109 beq __error_a @ yes, error 'a'
110 bl __create_page_tables
111
112 /*
113 * The following calls CPU specific code in a position independent
114 * manner. See arch/arm/mm/proc-*.S for details. r10 = base of
115 * xxx_proc_info structure selected by __lookup_machine_type
116 * above. On return, the CPU will be ready for the MMU to be
117 * turned on, and r0 will hold the CPU control register value.
118 */
119 ldr r13, __switch_data @ address to jump to after
120 @ mmu has been enabled
121 adr lr, __enable_mmu @ return (PIC) address
122 add pc, r10, #PROCINFO_INITFUNC
123
124 .type __switch_data, %object
125__switch_data:
126 .long __mmap_switched
127 .long __data_loc @ r4
128 .long __data_start @ r5
129 .long __bss_start @ r6
130 .long _end @ r7
131 .long processor_id @ r4
132 .long __machine_arch_type @ r5
133 .long cr_alignment @ r6
134 .long init_thread_union+8192 @ sp
135
136/*
137 * The following fragment of code is executed with the MMU on, and uses
138 * absolute addresses; this is not position independent.
139 *
140 * r0 = cp#15 control register
141 * r1 = machine ID
142 * r9 = processor ID
143 */
144 .type __mmap_switched, %function
145__mmap_switched:
146 adr r3, __switch_data + 4
147
148 ldmia r3!, {r4, r5, r6, r7}
149 cmp r4, r5 @ Copy data segment if needed
1501: cmpne r5, r6
151 ldrne fp, [r4], #4
152 strne fp, [r5], #4
153 bne 1b
154
155 mov fp, #0 @ Clear BSS (and zero fp)
1561: cmp r6, r7
157 strcc fp, [r6],#4
158 bcc 1b
159
160 ldmia r3, {r4, r5, r6, sp}
161 str r9, [r4] @ Save processor ID
162 str r1, [r5] @ Save machine type
163 bic r4, r0, #CR_A @ Clear 'A' bit
164 stmia r6, {r0, r4} @ Save control register values
165 b start_kernel
166
167
168
169/*
170 * Setup common bits before finally enabling the MMU. Essentially
171 * this is just loading the page table pointer and domain access
172 * registers.
173 */
174 .type __enable_mmu, %function
175__enable_mmu:
176#ifdef CONFIG_ALIGNMENT_TRAP
177 orr r0, r0, #CR_A
178#else
179 bic r0, r0, #CR_A
180#endif
181#ifdef CONFIG_CPU_DCACHE_DISABLE
182 bic r0, r0, #CR_C
183#endif
184#ifdef CONFIG_CPU_BPREDICT_DISABLE
185 bic r0, r0, #CR_Z
186#endif
187#ifdef CONFIG_CPU_ICACHE_DISABLE
188 bic r0, r0, #CR_I
189#endif
190 mov r5, #(domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \
191 domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
192 domain_val(DOMAIN_TABLE, DOMAIN_MANAGER) | \
193 domain_val(DOMAIN_IO, DOMAIN_CLIENT))
194 mcr p15, 0, r5, c3, c0, 0 @ load domain access register
195 mcr p15, 0, r4, c2, c0, 0 @ load page table pointer
196 b __turn_mmu_on
197
198/*
199 * Enable the MMU. This completely changes the structure of the visible
200 * memory space. You will not be able to trace execution through this.
201 * If you have an enquiry about this, *please* check the linux-arm-kernel
202 * mailing list archives BEFORE sending another post to the list.
203 *
204 * r0 = cp#15 control register
205 * r13 = *virtual* address to jump to upon completion
206 *
207 * other registers depend on the function called upon completion
208 */
209 .align 5
210 .type __turn_mmu_on, %function
211__turn_mmu_on:
212 mov r0, r0
213 mcr p15, 0, r0, c1, c0, 0 @ write control reg
214 mrc p15, 0, r3, c0, c0, 0 @ read id reg
215 mov r3, r3
216 mov r3, r3
217 mov pc, r13
218
219
220
221/*
222 * Setup the initial page tables. We only setup the barest
223 * amount which are required to get the kernel running, which
224 * generally means mapping in the kernel code.
225 *
226 * r8 = machinfo
227 * r9 = cpuid
228 * r10 = procinfo
229 *
230 * Returns:
231 * r0, r3, r5, r6, r7 corrupted
232 * r4 = physical page table address
233 */
234 .type __create_page_tables, %function
235__create_page_tables:
236 ldr r5, [r8, #MACHINFO_PHYSRAM] @ physram
237 pgtbl r4, r5 @ page table address
238
239 /*
240 * Clear the 16K level 1 swapper page table
241 */
242 mov r0, r4
243 mov r3, #0
244 add r6, r0, #0x4000
2451: str r3, [r0], #4
246 str r3, [r0], #4
247 str r3, [r0], #4
248 str r3, [r0], #4
249 teq r0, r6
250 bne 1b
251
252 ldr r7, [r10, #PROCINFO_MMUFLAGS] @ mmuflags
253
254 /*
255 * Create identity mapping for first MB of kernel to
256 * cater for the MMU enable. This identity mapping
257 * will be removed by paging_init(). We use our current program
258 * counter to determine corresponding section base address.
259 */
260 mov r6, pc, lsr #20 @ start of kernel section
261 orr r3, r7, r6, lsl #20 @ flags + kernel base
262 str r3, [r4, r6, lsl #2] @ identity mapping
263
264 /*
265 * Now setup the pagetables for our kernel direct
266 * mapped region. We round TEXTADDR down to the
267 * nearest megabyte boundary. It is assumed that
268 * the kernel fits within 4 contigous 1MB sections.
269 */
270 add r0, r4, #(TEXTADDR & 0xff000000) >> 18 @ start of kernel
271 str r3, [r0, #(TEXTADDR & 0x00f00000) >> 18]!
272 add r3, r3, #1 << 20
273 str r3, [r0, #4]! @ KERNEL + 1MB
274 add r3, r3, #1 << 20
275 str r3, [r0, #4]! @ KERNEL + 2MB
276 add r3, r3, #1 << 20
277 str r3, [r0, #4] @ KERNEL + 3MB
278
279 /*
280 * Then map first 1MB of ram in case it contains our boot params.
281 */
282 add r0, r4, #VIRT_OFFSET >> 18
283 orr r6, r5, r7
284 str r6, [r0]
285
286#ifdef CONFIG_XIP_KERNEL
287 /*
288 * Map some ram to cover our .data and .bss areas.
289 * Mapping 3MB should be plenty.
290 */
291 sub r3, r4, r5
292 mov r3, r3, lsr #20
293 add r0, r0, r3, lsl #2
294 add r6, r6, r3, lsl #20
295 str r6, [r0], #4
296 add r6, r6, #(1 << 20)
297 str r6, [r0], #4
298 add r6, r6, #(1 << 20)
299 str r6, [r0]
300#endif
301
302 bic r7, r7, #0x0c @ turn off cacheable
303 @ and bufferable bits
304#ifdef CONFIG_DEBUG_LL
305 /*
306 * Map in IO space for serial debugging.
307 * This allows debug messages to be output
308 * via a serial console before paging_init.
309 */
310 ldr r3, [r8, #MACHINFO_PGOFFIO]
311 add r0, r4, r3
312 rsb r3, r3, #0x4000 @ PTRS_PER_PGD*sizeof(long)
313 cmp r3, #0x0800 @ limit to 512MB
314 movhi r3, #0x0800
315 add r6, r0, r3
316 ldr r3, [r8, #MACHINFO_PHYSIO]
317 orr r3, r3, r7
3181: str r3, [r0], #4
319 add r3, r3, #1 << 20
320 teq r0, r6
321 bne 1b
322#if defined(CONFIG_ARCH_NETWINDER) || defined(CONFIG_ARCH_CATS)
323 /*
324 * If we're using the NetWinder, we need to map in
325 * the 16550-type serial port for the debug messages
326 */
327 teq r1, #MACH_TYPE_NETWINDER
328 teqne r1, #MACH_TYPE_CATS
329 bne 1f
330 add r0, r4, #0x3fc0 @ ff000000
331 mov r3, #0x7c000000
332 orr r3, r3, r7
333 str r3, [r0], #4
334 add r3, r3, #1 << 20
335 str r3, [r0], #4
3361:
337#endif
338#endif
339#ifdef CONFIG_ARCH_RPC
340 /*
341 * Map in screen at 0x02000000 & SCREEN2_BASE
342 * Similar reasons here - for debug. This is
343 * only for Acorn RiscPC architectures.
344 */
345 add r0, r4, #0x80 @ 02000000
346 mov r3, #0x02000000
347 orr r3, r3, r7
348 str r3, [r0]
349 add r0, r4, #0x3600 @ d8000000
350 str r3, [r0]
351#endif
352 mov pc, lr
353 .ltorg
354
355
356
357/*
358 * Exception handling. Something went wrong and we can't proceed. We
359 * ought to tell the user, but since we don't have any guarantee that
360 * we're even running on the right architecture, we do virtually nothing.
361 *
362 * If CONFIG_DEBUG_LL is set we try to print out something about the error
363 * and hope for the best (useful if bootloader fails to pass a proper
364 * machine ID for example).
365 */
366
367 .type __error_p, %function
368__error_p:
369#ifdef CONFIG_DEBUG_LL
370 adr r0, str_p1
371 bl printascii
372 b __error
373str_p1: .asciz "\nError: unrecognized/unsupported processor variant.\n"
374 .align
375#endif
376
377 .type __error_a, %function
378__error_a:
379#ifdef CONFIG_DEBUG_LL
380 mov r4, r1 @ preserve machine ID
381 adr r0, str_a1
382 bl printascii
383 mov r0, r4
384 bl printhex8
385 adr r0, str_a2
386 bl printascii
387 adr r3, 3f
388 ldmia r3, {r4, r5, r6} @ get machine desc list
389 sub r4, r3, r4 @ get offset between virt&phys
390 add r5, r5, r4 @ convert virt addresses to
391 add r6, r6, r4 @ physical address space
3921: ldr r0, [r5, #MACHINFO_TYPE] @ get machine type
393 bl printhex8
394 mov r0, #'\t'
395 bl printch
396 ldr r0, [r5, #MACHINFO_NAME] @ get machine name
397 add r0, r0, r4
398 bl printascii
399 mov r0, #'\n'
400 bl printch
401 add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
402 cmp r5, r6
403 blo 1b
404 adr r0, str_a3
405 bl printascii
406 b __error
407str_a1: .asciz "\nError: unrecognized/unsupported machine ID (r1 = 0x"
408str_a2: .asciz ").\n\nAvailable machine support:\n\nID (hex)\tNAME\n"
409str_a3: .asciz "\nPlease check your kernel config and/or bootloader.\n"
410 .align
411#endif
412
413 .type __error, %function
414__error:
415#ifdef CONFIG_ARCH_RPC
416/*
417 * Turn the screen red on a error - RiscPC only.
418 */
419 mov r0, #0x02000000
420 mov r3, #0x11
421 orr r3, r3, r3, lsl #8
422 orr r3, r3, r3, lsl #16
423 str r3, [r0], #4
424 str r3, [r0], #4
425 str r3, [r0], #4
426 str r3, [r0], #4
427#endif
4281: mov r0, r0
429 b 1b
430
431
432/*
433 * Read processor ID register (CP#15, CR0), and look up in the linker-built
434 * supported processor list. Note that we can't use the absolute addresses
435 * for the __proc_info lists since we aren't running with the MMU on
436 * (and therefore, we are not in the correct address space). We have to
437 * calculate the offset.
438 *
439 * Returns:
440 * r3, r4, r6 corrupted
441 * r5 = proc_info pointer in physical address space
442 * r9 = cpuid
443 */
444 .type __lookup_processor_type, %function
445__lookup_processor_type:
446 adr r3, 3f
447 ldmda r3, {r5, r6, r9}
448 sub r3, r3, r9 @ get offset between virt&phys
449 add r5, r5, r3 @ convert virt addresses to
450 add r6, r6, r3 @ physical address space
451 mrc p15, 0, r9, c0, c0 @ get processor id
4521: ldmia r5, {r3, r4} @ value, mask
453 and r4, r4, r9 @ mask wanted bits
454 teq r3, r4
455 beq 2f
456 add r5, r5, #PROC_INFO_SZ @ sizeof(proc_info_list)
457 cmp r5, r6
458 blo 1b
459 mov r5, #0 @ unknown processor
4602: mov pc, lr
461
462/*
463 * This provides a C-API version of the above function.
464 */
465ENTRY(lookup_processor_type)
466 stmfd sp!, {r4 - r6, r9, lr}
467 bl __lookup_processor_type
468 mov r0, r5
469 ldmfd sp!, {r4 - r6, r9, pc}
470
471/*
472 * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for
473 * more information about the __proc_info and __arch_info structures.
474 */
475 .long __proc_info_begin
476 .long __proc_info_end
4773: .long .
478 .long __arch_info_begin
479 .long __arch_info_end
480
481/*
482 * Lookup machine architecture in the linker-build list of architectures.
483 * Note that we can't use the absolute addresses for the __arch_info
484 * lists since we aren't running with the MMU on (and therefore, we are
485 * not in the correct address space). We have to calculate the offset.
486 *
487 * r1 = machine architecture number
488 * Returns:
489 * r3, r4, r6 corrupted
490 * r5 = mach_info pointer in physical address space
491 */
492 .type __lookup_machine_type, %function
493__lookup_machine_type:
494 adr r3, 3b
495 ldmia r3, {r4, r5, r6}
496 sub r3, r3, r4 @ get offset between virt&phys
497 add r5, r5, r3 @ convert virt addresses to
498 add r6, r6, r3 @ physical address space
4991: ldr r3, [r5, #MACHINFO_TYPE] @ get machine type
500 teq r3, r1 @ matches loader number?
501 beq 2f @ found
502 add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
503 cmp r5, r6
504 blo 1b
505 mov r5, #0 @ unknown machine
5062: mov pc, lr
507
508/*
509 * This provides a C-API version of the above function.
510 */
511ENTRY(lookup_machine_type)
512 stmfd sp!, {r4 - r6, lr}
513 mov r1, r0
514 bl __lookup_machine_type
515 mov r0, r5
516 ldmfd sp!, {r4 - r6, pc}
diff --git a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c
new file mode 100644
index 000000000000..a00cca0000bd
--- /dev/null
+++ b/arch/arm/kernel/init_task.c
@@ -0,0 +1,44 @@
1/*
2 * linux/arch/arm/kernel/init_task.c
3 */
4#include <linux/mm.h>
5#include <linux/module.h>
6#include <linux/fs.h>
7#include <linux/sched.h>
8#include <linux/init.h>
9#include <linux/init_task.h>
10#include <linux/mqueue.h>
11
12#include <asm/uaccess.h>
13#include <asm/pgtable.h>
14
15static struct fs_struct init_fs = INIT_FS;
16static struct files_struct init_files = INIT_FILES;
17static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
18static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
19struct mm_struct init_mm = INIT_MM(init_mm);
20
21EXPORT_SYMBOL(init_mm);
22
23/*
24 * Initial thread structure.
25 *
26 * We need to make sure that this is 8192-byte aligned due to the
27 * way process stacks are handled. This is done by making sure
28 * the linker maps this in the .text segment right after head.S,
29 * and making head.S ensure the proper alignment.
30 *
31 * The things we do for performance..
32 */
33union thread_union init_thread_union
34 __attribute__((__section__(".init.task"))) =
35 { INIT_THREAD_INFO(init_task) };
36
37/*
38 * Initial task structure.
39 *
40 * All other task structs will be allocated on slabs in fork.c
41 */
42struct task_struct init_task = INIT_TASK(init_task);
43
44EXPORT_SYMBOL(init_task);
diff --git a/arch/arm/kernel/io.c b/arch/arm/kernel/io.c
new file mode 100644
index 000000000000..6c20c1188b60
--- /dev/null
+++ b/arch/arm/kernel/io.c
@@ -0,0 +1,51 @@
1#include <linux/module.h>
2#include <linux/types.h>
3
4#include <asm/io.h>
5
6/*
7 * Copy data from IO memory space to "real" memory space.
8 * This needs to be optimized.
9 */
10void _memcpy_fromio(void *to, void __iomem *from, size_t count)
11{
12 unsigned char *t = to;
13 while (count) {
14 count--;
15 *t = readb(from);
16 t++;
17 from++;
18 }
19}
20
21/*
22 * Copy data from "real" memory space to IO memory space.
23 * This needs to be optimized.
24 */
25void _memcpy_toio(void __iomem *to, const void *from, size_t count)
26{
27 const unsigned char *f = from;
28 while (count) {
29 count--;
30 writeb(*f, to);
31 f++;
32 to++;
33 }
34}
35
36/*
37 * "memset" on IO memory space.
38 * This needs to be optimized.
39 */
40void _memset_io(void __iomem *dst, int c, size_t count)
41{
42 while (count) {
43 count--;
44 writeb(c, dst);
45 dst++;
46 }
47}
48
49EXPORT_SYMBOL(_memcpy_fromio);
50EXPORT_SYMBOL(_memcpy_toio);
51EXPORT_SYMBOL(_memset_io);
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
new file mode 100644
index 000000000000..ff187f4308f0
--- /dev/null
+++ b/arch/arm/kernel/irq.c
@@ -0,0 +1,1038 @@
1/*
2 * linux/arch/arm/kernel/irq.c
3 *
4 * Copyright (C) 1992 Linus Torvalds
5 * Modifications for ARM processor Copyright (C) 1995-2000 Russell King.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This file contains the code used by various IRQ handling routines:
12 * asking for different IRQ's should be done through these routines
13 * instead of just grabbing them. Thus setups with different IRQ numbers
14 * shouldn't result in any weird surprises, and installing new handlers
15 * should be easier.
16 *
17 * IRQ's are in fact implemented a bit like signal handlers for the kernel.
18 * Naturally it's not a 1:1 relation, but there are similarities.
19 */
20#include <linux/config.h>
21#include <linux/kernel_stat.h>
22#include <linux/module.h>
23#include <linux/signal.h>
24#include <linux/ioport.h>
25#include <linux/interrupt.h>
26#include <linux/ptrace.h>
27#include <linux/slab.h>
28#include <linux/random.h>
29#include <linux/smp.h>
30#include <linux/init.h>
31#include <linux/seq_file.h>
32#include <linux/errno.h>
33#include <linux/list.h>
34#include <linux/kallsyms.h>
35#include <linux/proc_fs.h>
36
37#include <asm/irq.h>
38#include <asm/system.h>
39#include <asm/mach/irq.h>
40
41/*
42 * Maximum IRQ count. Currently, this is arbitary. However, it should
43 * not be set too low to prevent false triggering. Conversely, if it
44 * is set too high, then you could miss a stuck IRQ.
45 *
46 * Maybe we ought to set a timer and re-enable the IRQ at a later time?
47 */
48#define MAX_IRQ_CNT 100000
49
50static int noirqdebug;
51static volatile unsigned long irq_err_count;
52static DEFINE_SPINLOCK(irq_controller_lock);
53static LIST_HEAD(irq_pending);
54
55struct irqdesc irq_desc[NR_IRQS];
56void (*init_arch_irq)(void) __initdata = NULL;
57
58/*
59 * No architecture-specific irq_finish function defined in arm/arch/irqs.h.
60 */
61#ifndef irq_finish
62#define irq_finish(irq) do { } while (0)
63#endif
64
65/*
66 * Dummy mask/unmask handler
67 */
68void dummy_mask_unmask_irq(unsigned int irq)
69{
70}
71
72irqreturn_t no_action(int irq, void *dev_id, struct pt_regs *regs)
73{
74 return IRQ_NONE;
75}
76
77void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
78{
79 irq_err_count += 1;
80 printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq);
81}
82
83static struct irqchip bad_chip = {
84 .ack = dummy_mask_unmask_irq,
85 .mask = dummy_mask_unmask_irq,
86 .unmask = dummy_mask_unmask_irq,
87};
88
89static struct irqdesc bad_irq_desc = {
90 .chip = &bad_chip,
91 .handle = do_bad_IRQ,
92 .pend = LIST_HEAD_INIT(bad_irq_desc.pend),
93 .disable_depth = 1,
94};
95
96#ifdef CONFIG_SMP
97void synchronize_irq(unsigned int irq)
98{
99 struct irqdesc *desc = irq_desc + irq;
100
101 while (desc->running)
102 barrier();
103}
104EXPORT_SYMBOL(synchronize_irq);
105
106#define smp_set_running(desc) do { desc->running = 1; } while (0)
107#define smp_clear_running(desc) do { desc->running = 0; } while (0)
108#else
109#define smp_set_running(desc) do { } while (0)
110#define smp_clear_running(desc) do { } while (0)
111#endif
112
113/**
114 * disable_irq_nosync - disable an irq without waiting
115 * @irq: Interrupt to disable
116 *
117 * Disable the selected interrupt line. Enables and disables
118 * are nested. We do this lazily.
119 *
120 * This function may be called from IRQ context.
121 */
122void disable_irq_nosync(unsigned int irq)
123{
124 struct irqdesc *desc = irq_desc + irq;
125 unsigned long flags;
126
127 spin_lock_irqsave(&irq_controller_lock, flags);
128 desc->disable_depth++;
129 list_del_init(&desc->pend);
130 spin_unlock_irqrestore(&irq_controller_lock, flags);
131}
132EXPORT_SYMBOL(disable_irq_nosync);
133
134/**
135 * disable_irq - disable an irq and wait for completion
136 * @irq: Interrupt to disable
137 *
138 * Disable the selected interrupt line. Enables and disables
139 * are nested. This functions waits for any pending IRQ
140 * handlers for this interrupt to complete before returning.
141 * If you use this function while holding a resource the IRQ
142 * handler may need you will deadlock.
143 *
144 * This function may be called - with care - from IRQ context.
145 */
146void disable_irq(unsigned int irq)
147{
148 struct irqdesc *desc = irq_desc + irq;
149
150 disable_irq_nosync(irq);
151 if (desc->action)
152 synchronize_irq(irq);
153}
154EXPORT_SYMBOL(disable_irq);
155
156/**
157 * enable_irq - enable interrupt handling on an irq
158 * @irq: Interrupt to enable
159 *
160 * Re-enables the processing of interrupts on this IRQ line.
161 * Note that this may call the interrupt handler, so you may
162 * get unexpected results if you hold IRQs disabled.
163 *
164 * This function may be called from IRQ context.
165 */
166void enable_irq(unsigned int irq)
167{
168 struct irqdesc *desc = irq_desc + irq;
169 unsigned long flags;
170
171 spin_lock_irqsave(&irq_controller_lock, flags);
172 if (unlikely(!desc->disable_depth)) {
173 printk("enable_irq(%u) unbalanced from %p\n", irq,
174 __builtin_return_address(0));
175 } else if (!--desc->disable_depth) {
176 desc->probing = 0;
177 desc->chip->unmask(irq);
178
179 /*
180 * If the interrupt is waiting to be processed,
181 * try to re-run it. We can't directly run it
182 * from here since the caller might be in an
183 * interrupt-protected region.
184 */
185 if (desc->pending && list_empty(&desc->pend)) {
186 desc->pending = 0;
187 if (!desc->chip->retrigger ||
188 desc->chip->retrigger(irq))
189 list_add(&desc->pend, &irq_pending);
190 }
191 }
192 spin_unlock_irqrestore(&irq_controller_lock, flags);
193}
194EXPORT_SYMBOL(enable_irq);
195
196/*
197 * Enable wake on selected irq
198 */
199void enable_irq_wake(unsigned int irq)
200{
201 struct irqdesc *desc = irq_desc + irq;
202 unsigned long flags;
203
204 spin_lock_irqsave(&irq_controller_lock, flags);
205 if (desc->chip->wake)
206 desc->chip->wake(irq, 1);
207 spin_unlock_irqrestore(&irq_controller_lock, flags);
208}
209EXPORT_SYMBOL(enable_irq_wake);
210
211void disable_irq_wake(unsigned int irq)
212{
213 struct irqdesc *desc = irq_desc + irq;
214 unsigned long flags;
215
216 spin_lock_irqsave(&irq_controller_lock, flags);
217 if (desc->chip->wake)
218 desc->chip->wake(irq, 0);
219 spin_unlock_irqrestore(&irq_controller_lock, flags);
220}
221EXPORT_SYMBOL(disable_irq_wake);
222
223int show_interrupts(struct seq_file *p, void *v)
224{
225 int i = *(loff_t *) v, cpu;
226 struct irqaction * action;
227 unsigned long flags;
228
229 if (i == 0) {
230 char cpuname[12];
231
232 seq_printf(p, " ");
233 for_each_present_cpu(cpu) {
234 sprintf(cpuname, "CPU%d", cpu);
235 seq_printf(p, " %10s", cpuname);
236 }
237 seq_putc(p, '\n');
238 }
239
240 if (i < NR_IRQS) {
241 spin_lock_irqsave(&irq_controller_lock, flags);
242 action = irq_desc[i].action;
243 if (!action)
244 goto unlock;
245
246 seq_printf(p, "%3d: ", i);
247 for_each_present_cpu(cpu)
248 seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]);
249 seq_printf(p, " %s", action->name);
250 for (action = action->next; action; action = action->next)
251 seq_printf(p, ", %s", action->name);
252
253 seq_putc(p, '\n');
254unlock:
255 spin_unlock_irqrestore(&irq_controller_lock, flags);
256 } else if (i == NR_IRQS) {
257#ifdef CONFIG_ARCH_ACORN
258 show_fiq_list(p, v);
259#endif
260#ifdef CONFIG_SMP
261 show_ipi_list(p);
262#endif
263 seq_printf(p, "Err: %10lu\n", irq_err_count);
264 }
265 return 0;
266}
267
268/*
269 * IRQ lock detection.
270 *
271 * Hopefully, this should get us out of a few locked situations.
272 * However, it may take a while for this to happen, since we need
273 * a large number if IRQs to appear in the same jiffie with the
274 * same instruction pointer (or within 2 instructions).
275 */
276static int check_irq_lock(struct irqdesc *desc, int irq, struct pt_regs *regs)
277{
278 unsigned long instr_ptr = instruction_pointer(regs);
279
280 if (desc->lck_jif == jiffies &&
281 desc->lck_pc >= instr_ptr && desc->lck_pc < instr_ptr + 8) {
282 desc->lck_cnt += 1;
283
284 if (desc->lck_cnt > MAX_IRQ_CNT) {
285 printk(KERN_ERR "IRQ LOCK: IRQ%d is locking the system, disabled\n", irq);
286 return 1;
287 }
288 } else {
289 desc->lck_cnt = 0;
290 desc->lck_pc = instruction_pointer(regs);
291 desc->lck_jif = jiffies;
292 }
293 return 0;
294}
295
296static void
297report_bad_irq(unsigned int irq, struct pt_regs *regs, struct irqdesc *desc, int ret)
298{
299 static int count = 100;
300 struct irqaction *action;
301
302 if (!count || noirqdebug)
303 return;
304
305 count--;
306
307 if (ret != IRQ_HANDLED && ret != IRQ_NONE) {
308 printk("irq%u: bogus retval mask %x\n", irq, ret);
309 } else {
310 printk("irq%u: nobody cared\n", irq);
311 }
312 show_regs(regs);
313 dump_stack();
314 printk(KERN_ERR "handlers:");
315 action = desc->action;
316 do {
317 printk("\n" KERN_ERR "[<%p>]", action->handler);
318 print_symbol(" (%s)", (unsigned long)action->handler);
319 action = action->next;
320 } while (action);
321 printk("\n");
322}
323
324static int
325__do_irq(unsigned int irq, struct irqaction *action, struct pt_regs *regs)
326{
327 unsigned int status;
328 int ret, retval = 0;
329
330 spin_unlock(&irq_controller_lock);
331
332 if (!(action->flags & SA_INTERRUPT))
333 local_irq_enable();
334
335 status = 0;
336 do {
337 ret = action->handler(irq, action->dev_id, regs);
338 if (ret == IRQ_HANDLED)
339 status |= action->flags;
340 retval |= ret;
341 action = action->next;
342 } while (action);
343
344 if (status & SA_SAMPLE_RANDOM)
345 add_interrupt_randomness(irq);
346
347 spin_lock_irq(&irq_controller_lock);
348
349 return retval;
350}
351
352/*
353 * This is for software-decoded IRQs. The caller is expected to
354 * handle the ack, clear, mask and unmask issues.
355 */
356void
357do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
358{
359 struct irqaction *action;
360 const unsigned int cpu = smp_processor_id();
361
362 desc->triggered = 1;
363
364 kstat_cpu(cpu).irqs[irq]++;
365
366 smp_set_running(desc);
367
368 action = desc->action;
369 if (action) {
370 int ret = __do_irq(irq, action, regs);
371 if (ret != IRQ_HANDLED)
372 report_bad_irq(irq, regs, desc, ret);
373 }
374
375 smp_clear_running(desc);
376}
377
378/*
379 * Most edge-triggered IRQ implementations seem to take a broken
380 * approach to this. Hence the complexity.
381 */
382void
383do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
384{
385 const unsigned int cpu = smp_processor_id();
386
387 desc->triggered = 1;
388
389 /*
390 * If we're currently running this IRQ, or its disabled,
391 * we shouldn't process the IRQ. Instead, turn on the
392 * hardware masks.
393 */
394 if (unlikely(desc->running || desc->disable_depth))
395 goto running;
396
397 /*
398 * Acknowledge and clear the IRQ, but don't mask it.
399 */
400 desc->chip->ack(irq);
401
402 /*
403 * Mark the IRQ currently in progress.
404 */
405 desc->running = 1;
406
407 kstat_cpu(cpu).irqs[irq]++;
408
409 do {
410 struct irqaction *action;
411
412 action = desc->action;
413 if (!action)
414 break;
415
416 if (desc->pending && !desc->disable_depth) {
417 desc->pending = 0;
418 desc->chip->unmask(irq);
419 }
420
421 __do_irq(irq, action, regs);
422 } while (desc->pending && !desc->disable_depth);
423
424 desc->running = 0;
425
426 /*
427 * If we were disabled or freed, shut down the handler.
428 */
429 if (likely(desc->action && !check_irq_lock(desc, irq, regs)))
430 return;
431
432 running:
433 /*
434 * We got another IRQ while this one was masked or
435 * currently running. Delay it.
436 */
437 desc->pending = 1;
438 desc->chip->mask(irq);
439 desc->chip->ack(irq);
440}
441
442/*
443 * Level-based IRQ handler. Nice and simple.
444 */
445void
446do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
447{
448 struct irqaction *action;
449 const unsigned int cpu = smp_processor_id();
450
451 desc->triggered = 1;
452
453 /*
454 * Acknowledge, clear _AND_ disable the interrupt.
455 */
456 desc->chip->ack(irq);
457
458 if (likely(!desc->disable_depth)) {
459 kstat_cpu(cpu).irqs[irq]++;
460
461 smp_set_running(desc);
462
463 /*
464 * Return with this interrupt masked if no action
465 */
466 action = desc->action;
467 if (action) {
468 int ret = __do_irq(irq, desc->action, regs);
469
470 if (ret != IRQ_HANDLED)
471 report_bad_irq(irq, regs, desc, ret);
472
473 if (likely(!desc->disable_depth &&
474 !check_irq_lock(desc, irq, regs)))
475 desc->chip->unmask(irq);
476 }
477
478 smp_clear_running(desc);
479 }
480}
481
482static void do_pending_irqs(struct pt_regs *regs)
483{
484 struct list_head head, *l, *n;
485
486 do {
487 struct irqdesc *desc;
488
489 /*
490 * First, take the pending interrupts off the list.
491 * The act of calling the handlers may add some IRQs
492 * back onto the list.
493 */
494 head = irq_pending;
495 INIT_LIST_HEAD(&irq_pending);
496 head.next->prev = &head;
497 head.prev->next = &head;
498
499 /*
500 * Now run each entry. We must delete it from our
501 * list before calling the handler.
502 */
503 list_for_each_safe(l, n, &head) {
504 desc = list_entry(l, struct irqdesc, pend);
505 list_del_init(&desc->pend);
506 desc->handle(desc - irq_desc, desc, regs);
507 }
508
509 /*
510 * The list must be empty.
511 */
512 BUG_ON(!list_empty(&head));
513 } while (!list_empty(&irq_pending));
514}
515
516/*
517 * do_IRQ handles all hardware IRQ's. Decoded IRQs should not
518 * come via this function. Instead, they should provide their
519 * own 'handler'
520 */
521asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
522{
523 struct irqdesc *desc = irq_desc + irq;
524
525 /*
526 * Some hardware gives randomly wrong interrupts. Rather
527 * than crashing, do something sensible.
528 */
529 if (irq >= NR_IRQS)
530 desc = &bad_irq_desc;
531
532 irq_enter();
533 spin_lock(&irq_controller_lock);
534 desc->handle(irq, desc, regs);
535
536 /*
537 * Now re-run any pending interrupts.
538 */
539 if (!list_empty(&irq_pending))
540 do_pending_irqs(regs);
541
542 irq_finish(irq);
543
544 spin_unlock(&irq_controller_lock);
545 irq_exit();
546}
547
548void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained)
549{
550 struct irqdesc *desc;
551 unsigned long flags;
552
553 if (irq >= NR_IRQS) {
554 printk(KERN_ERR "Trying to install handler for IRQ%d\n", irq);
555 return;
556 }
557
558 if (handle == NULL)
559 handle = do_bad_IRQ;
560
561 desc = irq_desc + irq;
562
563 if (is_chained && desc->chip == &bad_chip)
564 printk(KERN_WARNING "Trying to install chained handler for IRQ%d\n", irq);
565
566 spin_lock_irqsave(&irq_controller_lock, flags);
567 if (handle == do_bad_IRQ) {
568 desc->chip->mask(irq);
569 desc->chip->ack(irq);
570 desc->disable_depth = 1;
571 }
572 desc->handle = handle;
573 if (handle != do_bad_IRQ && is_chained) {
574 desc->valid = 0;
575 desc->probe_ok = 0;
576 desc->disable_depth = 0;
577 desc->chip->unmask(irq);
578 }
579 spin_unlock_irqrestore(&irq_controller_lock, flags);
580}
581
582void set_irq_chip(unsigned int irq, struct irqchip *chip)
583{
584 struct irqdesc *desc;
585 unsigned long flags;
586
587 if (irq >= NR_IRQS) {
588 printk(KERN_ERR "Trying to install chip for IRQ%d\n", irq);
589 return;
590 }
591
592 if (chip == NULL)
593 chip = &bad_chip;
594
595 desc = irq_desc + irq;
596 spin_lock_irqsave(&irq_controller_lock, flags);
597 desc->chip = chip;
598 spin_unlock_irqrestore(&irq_controller_lock, flags);
599}
600
601int set_irq_type(unsigned int irq, unsigned int type)
602{
603 struct irqdesc *desc;
604 unsigned long flags;
605 int ret = -ENXIO;
606
607 if (irq >= NR_IRQS) {
608 printk(KERN_ERR "Trying to set irq type for IRQ%d\n", irq);
609 return -ENODEV;
610 }
611
612 desc = irq_desc + irq;
613 if (desc->chip->type) {
614 spin_lock_irqsave(&irq_controller_lock, flags);
615 ret = desc->chip->type(irq, type);
616 spin_unlock_irqrestore(&irq_controller_lock, flags);
617 }
618
619 return ret;
620}
621EXPORT_SYMBOL(set_irq_type);
622
623void set_irq_flags(unsigned int irq, unsigned int iflags)
624{
625 struct irqdesc *desc;
626 unsigned long flags;
627
628 if (irq >= NR_IRQS) {
629 printk(KERN_ERR "Trying to set irq flags for IRQ%d\n", irq);
630 return;
631 }
632
633 desc = irq_desc + irq;
634 spin_lock_irqsave(&irq_controller_lock, flags);
635 desc->valid = (iflags & IRQF_VALID) != 0;
636 desc->probe_ok = (iflags & IRQF_PROBE) != 0;
637 desc->noautoenable = (iflags & IRQF_NOAUTOEN) != 0;
638 spin_unlock_irqrestore(&irq_controller_lock, flags);
639}
640
641int setup_irq(unsigned int irq, struct irqaction *new)
642{
643 int shared = 0;
644 struct irqaction *old, **p;
645 unsigned long flags;
646 struct irqdesc *desc;
647
648 /*
649 * Some drivers like serial.c use request_irq() heavily,
650 * so we have to be careful not to interfere with a
651 * running system.
652 */
653 if (new->flags & SA_SAMPLE_RANDOM) {
654 /*
655 * This function might sleep, we want to call it first,
656 * outside of the atomic block.
657 * Yes, this might clear the entropy pool if the wrong
658 * driver is attempted to be loaded, without actually
659 * installing a new handler, but is this really a problem,
660 * only the sysadmin is able to do this.
661 */
662 rand_initialize_irq(irq);
663 }
664
665 /*
666 * The following block of code has to be executed atomically
667 */
668 desc = irq_desc + irq;
669 spin_lock_irqsave(&irq_controller_lock, flags);
670 p = &desc->action;
671 if ((old = *p) != NULL) {
672 /* Can't share interrupts unless both agree to */
673 if (!(old->flags & new->flags & SA_SHIRQ)) {
674 spin_unlock_irqrestore(&irq_controller_lock, flags);
675 return -EBUSY;
676 }
677
678 /* add new interrupt at end of irq queue */
679 do {
680 p = &old->next;
681 old = *p;
682 } while (old);
683 shared = 1;
684 }
685
686 *p = new;
687
688 if (!shared) {
689 desc->probing = 0;
690 desc->running = 0;
691 desc->pending = 0;
692 desc->disable_depth = 1;
693 if (!desc->noautoenable) {
694 desc->disable_depth = 0;
695 desc->chip->unmask(irq);
696 }
697 }
698
699 spin_unlock_irqrestore(&irq_controller_lock, flags);
700 return 0;
701}
702
703/**
704 * request_irq - allocate an interrupt line
705 * @irq: Interrupt line to allocate
706 * @handler: Function to be called when the IRQ occurs
707 * @irqflags: Interrupt type flags
708 * @devname: An ascii name for the claiming device
709 * @dev_id: A cookie passed back to the handler function
710 *
711 * This call allocates interrupt resources and enables the
712 * interrupt line and IRQ handling. From the point this
713 * call is made your handler function may be invoked. Since
714 * your handler function must clear any interrupt the board
715 * raises, you must take care both to initialise your hardware
716 * and to set up the interrupt handler in the right order.
717 *
718 * Dev_id must be globally unique. Normally the address of the
719 * device data structure is used as the cookie. Since the handler
720 * receives this value it makes sense to use it.
721 *
722 * If your interrupt is shared you must pass a non NULL dev_id
723 * as this is required when freeing the interrupt.
724 *
725 * Flags:
726 *
727 * SA_SHIRQ Interrupt is shared
728 *
729 * SA_INTERRUPT Disable local interrupts while processing
730 *
731 * SA_SAMPLE_RANDOM The interrupt can be used for entropy
732 *
733 */
734int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *),
735 unsigned long irq_flags, const char * devname, void *dev_id)
736{
737 unsigned long retval;
738 struct irqaction *action;
739
740 if (irq >= NR_IRQS || !irq_desc[irq].valid || !handler ||
741 (irq_flags & SA_SHIRQ && !dev_id))
742 return -EINVAL;
743
744 action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
745 if (!action)
746 return -ENOMEM;
747
748 action->handler = handler;
749 action->flags = irq_flags;
750 cpus_clear(action->mask);
751 action->name = devname;
752 action->next = NULL;
753 action->dev_id = dev_id;
754
755 retval = setup_irq(irq, action);
756
757 if (retval)
758 kfree(action);
759 return retval;
760}
761
762EXPORT_SYMBOL(request_irq);
763
764/**
765 * free_irq - free an interrupt
766 * @irq: Interrupt line to free
767 * @dev_id: Device identity to free
768 *
769 * Remove an interrupt handler. The handler is removed and if the
770 * interrupt line is no longer in use by any driver it is disabled.
771 * On a shared IRQ the caller must ensure the interrupt is disabled
772 * on the card it drives before calling this function.
773 *
774 * This function must not be called from interrupt context.
775 */
776void free_irq(unsigned int irq, void *dev_id)
777{
778 struct irqaction * action, **p;
779 unsigned long flags;
780
781 if (irq >= NR_IRQS || !irq_desc[irq].valid) {
782 printk(KERN_ERR "Trying to free IRQ%d\n",irq);
783 dump_stack();
784 return;
785 }
786
787 spin_lock_irqsave(&irq_controller_lock, flags);
788 for (p = &irq_desc[irq].action; (action = *p) != NULL; p = &action->next) {
789 if (action->dev_id != dev_id)
790 continue;
791
792 /* Found it - now free it */
793 *p = action->next;
794 break;
795 }
796 spin_unlock_irqrestore(&irq_controller_lock, flags);
797
798 if (!action) {
799 printk(KERN_ERR "Trying to free free IRQ%d\n",irq);
800 dump_stack();
801 } else {
802 synchronize_irq(irq);
803 kfree(action);
804 }
805}
806
807EXPORT_SYMBOL(free_irq);
808
809static DECLARE_MUTEX(probe_sem);
810
811/* Start the interrupt probing. Unlike other architectures,
812 * we don't return a mask of interrupts from probe_irq_on,
813 * but return the number of interrupts enabled for the probe.
814 * The interrupts which have been enabled for probing is
815 * instead recorded in the irq_desc structure.
816 */
817unsigned long probe_irq_on(void)
818{
819 unsigned int i, irqs = 0;
820 unsigned long delay;
821
822 down(&probe_sem);
823
824 /*
825 * first snaffle up any unassigned but
826 * probe-able interrupts
827 */
828 spin_lock_irq(&irq_controller_lock);
829 for (i = 0; i < NR_IRQS; i++) {
830 if (!irq_desc[i].probe_ok || irq_desc[i].action)
831 continue;
832
833 irq_desc[i].probing = 1;
834 irq_desc[i].triggered = 0;
835 if (irq_desc[i].chip->type)
836 irq_desc[i].chip->type(i, IRQT_PROBE);
837 irq_desc[i].chip->unmask(i);
838 irqs += 1;
839 }
840 spin_unlock_irq(&irq_controller_lock);
841
842 /*
843 * wait for spurious interrupts to mask themselves out again
844 */
845 for (delay = jiffies + HZ/10; time_before(jiffies, delay); )
846 /* min 100ms delay */;
847
848 /*
849 * now filter out any obviously spurious interrupts
850 */
851 spin_lock_irq(&irq_controller_lock);
852 for (i = 0; i < NR_IRQS; i++) {
853 if (irq_desc[i].probing && irq_desc[i].triggered) {
854 irq_desc[i].probing = 0;
855 irqs -= 1;
856 }
857 }
858 spin_unlock_irq(&irq_controller_lock);
859
860 return irqs;
861}
862
863EXPORT_SYMBOL(probe_irq_on);
864
865unsigned int probe_irq_mask(unsigned long irqs)
866{
867 unsigned int mask = 0, i;
868
869 spin_lock_irq(&irq_controller_lock);
870 for (i = 0; i < 16 && i < NR_IRQS; i++)
871 if (irq_desc[i].probing && irq_desc[i].triggered)
872 mask |= 1 << i;
873 spin_unlock_irq(&irq_controller_lock);
874
875 up(&probe_sem);
876
877 return mask;
878}
879EXPORT_SYMBOL(probe_irq_mask);
880
881/*
882 * Possible return values:
883 * >= 0 - interrupt number
884 * -1 - no interrupt/many interrupts
885 */
886int probe_irq_off(unsigned long irqs)
887{
888 unsigned int i;
889 int irq_found = NO_IRQ;
890
891 /*
892 * look at the interrupts, and find exactly one
893 * that we were probing has been triggered
894 */
895 spin_lock_irq(&irq_controller_lock);
896 for (i = 0; i < NR_IRQS; i++) {
897 if (irq_desc[i].probing &&
898 irq_desc[i].triggered) {
899 if (irq_found != NO_IRQ) {
900 irq_found = NO_IRQ;
901 goto out;
902 }
903 irq_found = i;
904 }
905 }
906
907 if (irq_found == -1)
908 irq_found = NO_IRQ;
909out:
910 spin_unlock_irq(&irq_controller_lock);
911
912 up(&probe_sem);
913
914 return irq_found;
915}
916
917EXPORT_SYMBOL(probe_irq_off);
918
919#ifdef CONFIG_SMP
920static void route_irq(struct irqdesc *desc, unsigned int irq, unsigned int cpu)
921{
922 pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->cpu, cpu);
923
924 spin_lock_irq(&irq_controller_lock);
925 desc->cpu = cpu;
926 desc->chip->set_cpu(desc, irq, cpu);
927 spin_unlock_irq(&irq_controller_lock);
928}
929
930#ifdef CONFIG_PROC_FS
931static int
932irq_affinity_read_proc(char *page, char **start, off_t off, int count,
933 int *eof, void *data)
934{
935 struct irqdesc *desc = irq_desc + ((int)data);
936 int len = cpumask_scnprintf(page, count, desc->affinity);
937
938 if (count - len < 2)
939 return -EINVAL;
940 page[len++] = '\n';
941 page[len] = '\0';
942
943 return len;
944}
945
946static int
947irq_affinity_write_proc(struct file *file, const char __user *buffer,
948 unsigned long count, void *data)
949{
950 unsigned int irq = (unsigned int)data;
951 struct irqdesc *desc = irq_desc + irq;
952 cpumask_t affinity, tmp;
953 int ret = -EIO;
954
955 if (!desc->chip->set_cpu)
956 goto out;
957
958 ret = cpumask_parse(buffer, count, affinity);
959 if (ret)
960 goto out;
961
962 cpus_and(tmp, affinity, cpu_online_map);
963 if (cpus_empty(tmp)) {
964 ret = -EINVAL;
965 goto out;
966 }
967
968 desc->affinity = affinity;
969 route_irq(desc, irq, first_cpu(tmp));
970 ret = count;
971
972 out:
973 return ret;
974}
975#endif
976#endif
977
978void __init init_irq_proc(void)
979{
980#if defined(CONFIG_SMP) && defined(CONFIG_PROC_FS)
981 struct proc_dir_entry *dir;
982 int irq;
983
984 dir = proc_mkdir("irq", 0);
985 if (!dir)
986 return;
987
988 for (irq = 0; irq < NR_IRQS; irq++) {
989 struct proc_dir_entry *entry;
990 struct irqdesc *desc;
991 char name[16];
992
993 desc = irq_desc + irq;
994 memset(name, 0, sizeof(name));
995 snprintf(name, sizeof(name) - 1, "%u", irq);
996
997 desc->procdir = proc_mkdir(name, dir);
998 if (!desc->procdir)
999 continue;
1000
1001 entry = create_proc_entry("smp_affinity", 0600, desc->procdir);
1002 if (entry) {
1003 entry->nlink = 1;
1004 entry->data = (void *)irq;
1005 entry->read_proc = irq_affinity_read_proc;
1006 entry->write_proc = irq_affinity_write_proc;
1007 }
1008 }
1009#endif
1010}
1011
1012void __init init_IRQ(void)
1013{
1014 struct irqdesc *desc;
1015 extern void init_dma(void);
1016 int irq;
1017
1018#ifdef CONFIG_SMP
1019 bad_irq_desc.affinity = CPU_MASK_ALL;
1020 bad_irq_desc.cpu = smp_processor_id();
1021#endif
1022
1023 for (irq = 0, desc = irq_desc; irq < NR_IRQS; irq++, desc++) {
1024 *desc = bad_irq_desc;
1025 INIT_LIST_HEAD(&desc->pend);
1026 }
1027
1028 init_arch_irq();
1029 init_dma();
1030}
1031
1032static int __init noirqdebug_setup(char *str)
1033{
1034 noirqdebug = 1;
1035 return 1;
1036}
1037
1038__setup("noirqdebug", noirqdebug_setup);
diff --git a/arch/arm/kernel/isa.c b/arch/arm/kernel/isa.c
new file mode 100644
index 000000000000..685c3e591a7e
--- /dev/null
+++ b/arch/arm/kernel/isa.c
@@ -0,0 +1,53 @@
1/*
2 * linux/arch/arm/kernel/isa.c
3 *
4 * Copyright (C) 1999 Phil Blundell
5 *
6 * ISA shared memory and I/O port support
7 */
8
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/*
17 * Nothing about this is actually ARM specific. One day we could move
18 * it into kernel/resource.c or some place like that.
19 */
20
21#include <linux/stddef.h>
22#include <linux/types.h>
23#include <linux/fs.h>
24#include <linux/sysctl.h>
25#include <linux/init.h>
26
27static unsigned int isa_membase, isa_portbase, isa_portshift;
28
29static ctl_table ctl_isa_vars[4] = {
30 {BUS_ISA_MEM_BASE, "membase", &isa_membase,
31 sizeof(isa_membase), 0444, NULL, &proc_dointvec},
32 {BUS_ISA_PORT_BASE, "portbase", &isa_portbase,
33 sizeof(isa_portbase), 0444, NULL, &proc_dointvec},
34 {BUS_ISA_PORT_SHIFT, "portshift", &isa_portshift,
35 sizeof(isa_portshift), 0444, NULL, &proc_dointvec},
36 {0}
37};
38
39static struct ctl_table_header *isa_sysctl_header;
40
41static ctl_table ctl_isa[2] = {{CTL_BUS_ISA, "isa", NULL, 0, 0555, ctl_isa_vars},
42 {0}};
43static ctl_table ctl_bus[2] = {{CTL_BUS, "bus", NULL, 0, 0555, ctl_isa},
44 {0}};
45
46void __init
47register_isa_ports(unsigned int membase, unsigned int portbase, unsigned int portshift)
48{
49 isa_membase = membase;
50 isa_portbase = portbase;
51 isa_portshift = portshift;
52 isa_sysctl_header = register_sysctl_table(ctl_bus, 0);
53}
diff --git a/arch/arm/kernel/iwmmxt.S b/arch/arm/kernel/iwmmxt.S
new file mode 100644
index 000000000000..8f74e24536ba
--- /dev/null
+++ b/arch/arm/kernel/iwmmxt.S
@@ -0,0 +1,320 @@
1/*
2 * linux/arch/arm/kernel/iwmmxt.S
3 *
4 * XScale iWMMXt (Concan) context switching and handling
5 *
6 * Initial code:
7 * Copyright (c) 2003, Intel Corporation
8 *
9 * Full lazy switching support, optimizations and more, by Nicolas Pitre
10* Copyright (c) 2003-2004, MontaVista Software, Inc.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <linux/linkage.h>
18#include <asm/ptrace.h>
19#include <asm/thread_info.h>
20#include <asm/constants.h>
21
22#define MMX_WR0 (0x00)
23#define MMX_WR1 (0x08)
24#define MMX_WR2 (0x10)
25#define MMX_WR3 (0x18)
26#define MMX_WR4 (0x20)
27#define MMX_WR5 (0x28)
28#define MMX_WR6 (0x30)
29#define MMX_WR7 (0x38)
30#define MMX_WR8 (0x40)
31#define MMX_WR9 (0x48)
32#define MMX_WR10 (0x50)
33#define MMX_WR11 (0x58)
34#define MMX_WR12 (0x60)
35#define MMX_WR13 (0x68)
36#define MMX_WR14 (0x70)
37#define MMX_WR15 (0x78)
38#define MMX_WCSSF (0x80)
39#define MMX_WCASF (0x84)
40#define MMX_WCGR0 (0x88)
41#define MMX_WCGR1 (0x8C)
42#define MMX_WCGR2 (0x90)
43#define MMX_WCGR3 (0x94)
44
45#define MMX_SIZE (0x98)
46
47 .text
48
49/*
50 * Lazy switching of Concan coprocessor context
51 *
52 * r10 = struct thread_info pointer
53 * r9 = ret_from_exception
54 * lr = undefined instr exit
55 *
56 * called from prefetch exception handler with interrupts disabled
57 */
58
59ENTRY(iwmmxt_task_enable)
60
61 mrc p15, 0, r2, c15, c1, 0
62 tst r2, #0x3 @ CP0 and CP1 accessible?
63 movne pc, lr @ if so no business here
64 orr r2, r2, #0x3 @ enable access to CP0 and CP1
65 mcr p15, 0, r2, c15, c1, 0
66
67 ldr r3, =concan_owner
68 add r0, r10, #TI_IWMMXT_STATE @ get task Concan save area
69 ldr r2, [sp, #60] @ current task pc value
70 ldr r1, [r3] @ get current Concan owner
71 str r0, [r3] @ this task now owns Concan regs
72 sub r2, r2, #4 @ adjust pc back
73 str r2, [sp, #60]
74
75 mrc p15, 0, r2, c2, c0, 0
76 mov r2, r2 @ cpwait
77
78 teq r1, #0 @ test for last ownership
79 mov lr, r9 @ normal exit from exception
80 beq concan_load @ no owner, skip save
81
82concan_save:
83
84 tmrc r2, wCon
85
86 @ CUP? wCx
87 tst r2, #0x1
88 beq 1f
89
90concan_dump:
91
92 wstrw wCSSF, [r1, #MMX_WCSSF]
93 wstrw wCASF, [r1, #MMX_WCASF]
94 wstrw wCGR0, [r1, #MMX_WCGR0]
95 wstrw wCGR1, [r1, #MMX_WCGR1]
96 wstrw wCGR2, [r1, #MMX_WCGR2]
97 wstrw wCGR3, [r1, #MMX_WCGR3]
98
991: @ MUP? wRn
100 tst r2, #0x2
101 beq 2f
102
103 wstrd wR0, [r1, #MMX_WR0]
104 wstrd wR1, [r1, #MMX_WR1]
105 wstrd wR2, [r1, #MMX_WR2]
106 wstrd wR3, [r1, #MMX_WR3]
107 wstrd wR4, [r1, #MMX_WR4]
108 wstrd wR5, [r1, #MMX_WR5]
109 wstrd wR6, [r1, #MMX_WR6]
110 wstrd wR7, [r1, #MMX_WR7]
111 wstrd wR8, [r1, #MMX_WR8]
112 wstrd wR9, [r1, #MMX_WR9]
113 wstrd wR10, [r1, #MMX_WR10]
114 wstrd wR11, [r1, #MMX_WR11]
115 wstrd wR12, [r1, #MMX_WR12]
116 wstrd wR13, [r1, #MMX_WR13]
117 wstrd wR14, [r1, #MMX_WR14]
118 wstrd wR15, [r1, #MMX_WR15]
119
1202: teq r0, #0 @ anything to load?
121 moveq pc, lr
122
123concan_load:
124
125 @ Load wRn
126 wldrd wR0, [r0, #MMX_WR0]
127 wldrd wR1, [r0, #MMX_WR1]
128 wldrd wR2, [r0, #MMX_WR2]
129 wldrd wR3, [r0, #MMX_WR3]
130 wldrd wR4, [r0, #MMX_WR4]
131 wldrd wR5, [r0, #MMX_WR5]
132 wldrd wR6, [r0, #MMX_WR6]
133 wldrd wR7, [r0, #MMX_WR7]
134 wldrd wR8, [r0, #MMX_WR8]
135 wldrd wR9, [r0, #MMX_WR9]
136 wldrd wR10, [r0, #MMX_WR10]
137 wldrd wR11, [r0, #MMX_WR11]
138 wldrd wR12, [r0, #MMX_WR12]
139 wldrd wR13, [r0, #MMX_WR13]
140 wldrd wR14, [r0, #MMX_WR14]
141 wldrd wR15, [r0, #MMX_WR15]
142
143 @ Load wCx
144 wldrw wCSSF, [r0, #MMX_WCSSF]
145 wldrw wCASF, [r0, #MMX_WCASF]
146 wldrw wCGR0, [r0, #MMX_WCGR0]
147 wldrw wCGR1, [r0, #MMX_WCGR1]
148 wldrw wCGR2, [r0, #MMX_WCGR2]
149 wldrw wCGR3, [r0, #MMX_WCGR3]
150
151 @ clear CUP/MUP (only if r1 != 0)
152 teq r1, #0
153 mov r2, #0
154 moveq pc, lr
155 tmcr wCon, r2
156 mov pc, lr
157
158/*
159 * Back up Concan regs to save area and disable access to them
160 * (mainly for gdb or sleep mode usage)
161 *
162 * r0 = struct thread_info pointer of target task or NULL for any
163 */
164
165ENTRY(iwmmxt_task_disable)
166
167 stmfd sp!, {r4, lr}
168
169 mrs ip, cpsr
170 orr r2, ip, #PSR_I_BIT @ disable interrupts
171 msr cpsr_c, r2
172
173 ldr r3, =concan_owner
174 add r2, r0, #TI_IWMMXT_STATE @ get task Concan save area
175 ldr r1, [r3] @ get current Concan owner
176 teq r1, #0 @ any current owner?
177 beq 1f @ no: quit
178 teq r0, #0 @ any owner?
179 teqne r1, r2 @ or specified one?
180 bne 1f @ no: quit
181
182 mrc p15, 0, r4, c15, c1, 0
183 orr r4, r4, #0x3 @ enable access to CP0 and CP1
184 mcr p15, 0, r4, c15, c1, 0
185 mov r0, #0 @ nothing to load
186 str r0, [r3] @ no more current owner
187 mrc p15, 0, r2, c2, c0, 0
188 mov r2, r2 @ cpwait
189 bl concan_save
190
191 bic r4, r4, #0x3 @ disable access to CP0 and CP1
192 mcr p15, 0, r4, c15, c1, 0
193 mrc p15, 0, r2, c2, c0, 0
194 mov r2, r2 @ cpwait
195
1961: msr cpsr_c, ip @ restore interrupt mode
197 ldmfd sp!, {r4, pc}
198
199/*
200 * Copy Concan state to given memory address
201 *
202 * r0 = struct thread_info pointer of target task
203 * r1 = memory address where to store Concan state
204 *
205 * this is called mainly in the creation of signal stack frames
206 */
207
208ENTRY(iwmmxt_task_copy)
209
210 mrs ip, cpsr
211 orr r2, ip, #PSR_I_BIT @ disable interrupts
212 msr cpsr_c, r2
213
214 ldr r3, =concan_owner
215 add r2, r0, #TI_IWMMXT_STATE @ get task Concan save area
216 ldr r3, [r3] @ get current Concan owner
217 teq r2, r3 @ does this task own it...
218 beq 1f
219
220 @ current Concan values are in the task save area
221 msr cpsr_c, ip @ restore interrupt mode
222 mov r0, r1
223 mov r1, r2
224 mov r2, #MMX_SIZE
225 b memcpy
226
2271: @ this task owns Concan regs -- grab a copy from there
228 mov r0, #0 @ nothing to load
229 mov r2, #3 @ save all regs
230 mov r3, lr @ preserve return address
231 bl concan_dump
232 msr cpsr_c, ip @ restore interrupt mode
233 mov pc, r3
234
235/*
236 * Restore Concan state from given memory address
237 *
238 * r0 = struct thread_info pointer of target task
239 * r1 = memory address where to get Concan state from
240 *
241 * this is used to restore Concan state when unwinding a signal stack frame
242 */
243
244ENTRY(iwmmxt_task_restore)
245
246 mrs ip, cpsr
247 orr r2, ip, #PSR_I_BIT @ disable interrupts
248 msr cpsr_c, r2
249
250 ldr r3, =concan_owner
251 add r2, r0, #TI_IWMMXT_STATE @ get task Concan save area
252 ldr r3, [r3] @ get current Concan owner
253 bic r2, r2, #0x7 @ 64-bit alignment
254 teq r2, r3 @ does this task own it...
255 beq 1f
256
257 @ this task doesn't own Concan regs -- use its save area
258 msr cpsr_c, ip @ restore interrupt mode
259 mov r0, r2
260 mov r2, #MMX_SIZE
261 b memcpy
262
2631: @ this task owns Concan regs -- load them directly
264 mov r0, r1
265 mov r1, #0 @ don't clear CUP/MUP
266 mov r3, lr @ preserve return address
267 bl concan_load
268 msr cpsr_c, ip @ restore interrupt mode
269 mov pc, r3
270
271/*
272 * Concan handling on task switch
273 *
274 * r0 = previous task_struct pointer (must be preserved)
275 * r1 = previous thread_info pointer
276 * r2 = next thread_info.cpu_domain pointer (must be preserved)
277 *
278 * Called only from __switch_to with task preemption disabled.
279 * No need to care about preserving r4 and above.
280 */
281ENTRY(iwmmxt_task_switch)
282
283 mrc p15, 0, r4, c15, c1, 0
284 tst r4, #0x3 @ CP0 and CP1 accessible?
285 bne 1f @ yes: block them for next task
286
287 ldr r5, =concan_owner
288 add r6, r2, #(TI_IWMMXT_STATE - TI_CPU_DOMAIN) @ get next task Concan save area
289 ldr r5, [r5] @ get current Concan owner
290 teq r5, r6 @ next task owns it?
291 movne pc, lr @ no: leave Concan disabled
292
2931: eor r4, r4, #3 @ flip Concan access
294 mcr p15, 0, r4, c15, c1, 0
295
296 mrc p15, 0, r4, c2, c0, 0
297 sub pc, lr, r4, lsr #32 @ cpwait and return
298
299/*
300 * Remove Concan ownership of given task
301 *
302 * r0 = struct thread_info pointer
303 */
304ENTRY(iwmmxt_task_release)
305
306 mrs r2, cpsr
307 orr ip, r2, #PSR_I_BIT @ disable interrupts
308 msr cpsr_c, ip
309 ldr r3, =concan_owner
310 add r0, r0, #TI_IWMMXT_STATE @ get task Concan save area
311 ldr r1, [r3] @ get current Concan owner
312 eors r0, r0, r1 @ if equal...
313 streq r0, [r3] @ then clear ownership
314 msr cpsr_c, r2 @ restore interrupts
315 mov pc, lr
316
317 .data
318concan_owner:
319 .word 0
320
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
new file mode 100644
index 000000000000..1a85cfdad5ac
--- /dev/null
+++ b/arch/arm/kernel/module.c
@@ -0,0 +1,152 @@
1/*
2 * linux/arch/arm/kernel/module.c
3 *
4 * Copyright (C) 2002 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Module allocation method suggested by Andi Kleen.
11 */
12#include <linux/config.h>
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/elf.h>
16#include <linux/vmalloc.h>
17#include <linux/slab.h>
18#include <linux/fs.h>
19#include <linux/string.h>
20
21#include <asm/pgtable.h>
22
23#ifdef CONFIG_XIP_KERNEL
24/*
25 * The XIP kernel text is mapped in the module area for modules and
26 * some other stuff to work without any indirect relocations.
27 * MODULE_START is redefined here and not in asm/memory.h to avoid
28 * recompiling the whole kernel when CONFIG_XIP_KERNEL is turned on/off.
29 */
30extern void _etext;
31#undef MODULE_START
32#define MODULE_START (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK)
33#endif
34
35void *module_alloc(unsigned long size)
36{
37 struct vm_struct *area;
38
39 size = PAGE_ALIGN(size);
40 if (!size)
41 return NULL;
42
43 area = __get_vm_area(size, VM_ALLOC, MODULE_START, MODULE_END);
44 if (!area)
45 return NULL;
46
47 return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL);
48}
49
50void module_free(struct module *module, void *region)
51{
52 vfree(region);
53}
54
55int module_frob_arch_sections(Elf_Ehdr *hdr,
56 Elf_Shdr *sechdrs,
57 char *secstrings,
58 struct module *mod)
59{
60 return 0;
61}
62
63int
64apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
65 unsigned int relindex, struct module *module)
66{
67 Elf32_Shdr *symsec = sechdrs + symindex;
68 Elf32_Shdr *relsec = sechdrs + relindex;
69 Elf32_Shdr *dstsec = sechdrs + relsec->sh_info;
70 Elf32_Rel *rel = (void *)relsec->sh_addr;
71 unsigned int i;
72
73 for (i = 0; i < relsec->sh_size / sizeof(Elf32_Rel); i++, rel++) {
74 unsigned long loc;
75 Elf32_Sym *sym;
76 s32 offset;
77
78 offset = ELF32_R_SYM(rel->r_info);
79 if (offset < 0 || offset > (symsec->sh_size / sizeof(Elf32_Sym))) {
80 printk(KERN_ERR "%s: bad relocation, section %d reloc %d\n",
81 module->name, relindex, i);
82 return -ENOEXEC;
83 }
84
85 sym = ((Elf32_Sym *)symsec->sh_addr) + offset;
86
87 if (rel->r_offset < 0 || rel->r_offset > dstsec->sh_size - sizeof(u32)) {
88 printk(KERN_ERR "%s: out of bounds relocation, "
89 "section %d reloc %d offset %d size %d\n",
90 module->name, relindex, i, rel->r_offset,
91 dstsec->sh_size);
92 return -ENOEXEC;
93 }
94
95 loc = dstsec->sh_addr + rel->r_offset;
96
97 switch (ELF32_R_TYPE(rel->r_info)) {
98 case R_ARM_ABS32:
99 *(u32 *)loc += sym->st_value;
100 break;
101
102 case R_ARM_PC24:
103 offset = (*(u32 *)loc & 0x00ffffff) << 2;
104 if (offset & 0x02000000)
105 offset -= 0x04000000;
106
107 offset += sym->st_value - loc;
108 if (offset & 3 ||
109 offset <= (s32)0xfc000000 ||
110 offset >= (s32)0x04000000) {
111 printk(KERN_ERR
112 "%s: relocation out of range, section "
113 "%d reloc %d sym '%s'\n", module->name,
114 relindex, i, strtab + sym->st_name);
115 return -ENOEXEC;
116 }
117
118 offset >>= 2;
119
120 *(u32 *)loc &= 0xff000000;
121 *(u32 *)loc |= offset & 0x00ffffff;
122 break;
123
124 default:
125 printk(KERN_ERR "%s: unknown relocation: %u\n",
126 module->name, ELF32_R_TYPE(rel->r_info));
127 return -ENOEXEC;
128 }
129 }
130 return 0;
131}
132
133int
134apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
135 unsigned int symindex, unsigned int relsec, struct module *module)
136{
137 printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
138 module->name);
139 return -ENOEXEC;
140}
141
142int
143module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
144 struct module *module)
145{
146 return 0;
147}
148
149void
150module_arch_cleanup(struct module *mod)
151{
152}
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
new file mode 100644
index 000000000000..dbd8ca89b385
--- /dev/null
+++ b/arch/arm/kernel/process.c
@@ -0,0 +1,460 @@
1/*
2 * linux/arch/arm/kernel/process.c
3 *
4 * Copyright (C) 1996-2000 Russell King - Converted to ARM.
5 * Original Copyright (C) 1995 Linus Torvalds
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <stdarg.h>
12
13#include <linux/config.h>
14#include <linux/module.h>
15#include <linux/sched.h>
16#include <linux/kernel.h>
17#include <linux/mm.h>
18#include <linux/stddef.h>
19#include <linux/unistd.h>
20#include <linux/ptrace.h>
21#include <linux/slab.h>
22#include <linux/user.h>
23#include <linux/a.out.h>
24#include <linux/delay.h>
25#include <linux/reboot.h>
26#include <linux/interrupt.h>
27#include <linux/kallsyms.h>
28#include <linux/init.h>
29
30#include <asm/system.h>
31#include <asm/io.h>
32#include <asm/leds.h>
33#include <asm/processor.h>
34#include <asm/uaccess.h>
35
36extern const char *processor_modes[];
37extern void setup_mm_for_reboot(char mode);
38
39static volatile int hlt_counter;
40
41#include <asm/arch/system.h>
42
43void disable_hlt(void)
44{
45 hlt_counter++;
46}
47
48EXPORT_SYMBOL(disable_hlt);
49
50void enable_hlt(void)
51{
52 hlt_counter--;
53}
54
55EXPORT_SYMBOL(enable_hlt);
56
57static int __init nohlt_setup(char *__unused)
58{
59 hlt_counter = 1;
60 return 1;
61}
62
63static int __init hlt_setup(char *__unused)
64{
65 hlt_counter = 0;
66 return 1;
67}
68
69__setup("nohlt", nohlt_setup);
70__setup("hlt", hlt_setup);
71
72/*
73 * The following aren't currently used.
74 */
75void (*pm_idle)(void);
76EXPORT_SYMBOL(pm_idle);
77
78void (*pm_power_off)(void);
79EXPORT_SYMBOL(pm_power_off);
80
81/*
82 * This is our default idle handler. We need to disable
83 * interrupts here to ensure we don't miss a wakeup call.
84 */
85void default_idle(void)
86{
87 local_irq_disable();
88 if (!need_resched() && !hlt_counter)
89 arch_idle();
90 local_irq_enable();
91}
92
93/*
94 * The idle thread. We try to conserve power, while trying to keep
95 * overall latency low. The architecture specific idle is passed
96 * a value to indicate the level of "idleness" of the system.
97 */
98void cpu_idle(void)
99{
100 local_fiq_enable();
101
102 /* endless idle loop with no priority at all */
103 while (1) {
104 void (*idle)(void) = pm_idle;
105 if (!idle)
106 idle = default_idle;
107 preempt_disable();
108 leds_event(led_idle_start);
109 while (!need_resched())
110 idle();
111 leds_event(led_idle_end);
112 preempt_enable();
113 schedule();
114 }
115}
116
117static char reboot_mode = 'h';
118
119int __init reboot_setup(char *str)
120{
121 reboot_mode = str[0];
122 return 1;
123}
124
125__setup("reboot=", reboot_setup);
126
127void machine_halt(void)
128{
129}
130
131EXPORT_SYMBOL(machine_halt);
132
133void machine_power_off(void)
134{
135 if (pm_power_off)
136 pm_power_off();
137}
138
139EXPORT_SYMBOL(machine_power_off);
140
141void machine_restart(char * __unused)
142{
143 /*
144 * Clean and disable cache, and turn off interrupts
145 */
146 cpu_proc_fin();
147
148 /*
149 * Tell the mm system that we are going to reboot -
150 * we may need it to insert some 1:1 mappings so that
151 * soft boot works.
152 */
153 setup_mm_for_reboot(reboot_mode);
154
155 /*
156 * Now call the architecture specific reboot code.
157 */
158 arch_reset(reboot_mode);
159
160 /*
161 * Whoops - the architecture was unable to reboot.
162 * Tell the user!
163 */
164 mdelay(1000);
165 printk("Reboot failed -- System halted\n");
166 while (1);
167}
168
169EXPORT_SYMBOL(machine_restart);
170
171void show_regs(struct pt_regs * regs)
172{
173 unsigned long flags;
174
175 flags = condition_codes(regs);
176
177 print_symbol("PC is at %s\n", instruction_pointer(regs));
178 print_symbol("LR is at %s\n", regs->ARM_lr);
179 printk("pc : [<%08lx>] lr : [<%08lx>] %s\n"
180 "sp : %08lx ip : %08lx fp : %08lx\n",
181 instruction_pointer(regs),
182 regs->ARM_lr, print_tainted(), regs->ARM_sp,
183 regs->ARM_ip, regs->ARM_fp);
184 printk("r10: %08lx r9 : %08lx r8 : %08lx\n",
185 regs->ARM_r10, regs->ARM_r9,
186 regs->ARM_r8);
187 printk("r7 : %08lx r6 : %08lx r5 : %08lx r4 : %08lx\n",
188 regs->ARM_r7, regs->ARM_r6,
189 regs->ARM_r5, regs->ARM_r4);
190 printk("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n",
191 regs->ARM_r3, regs->ARM_r2,
192 regs->ARM_r1, regs->ARM_r0);
193 printk("Flags: %c%c%c%c",
194 flags & PSR_N_BIT ? 'N' : 'n',
195 flags & PSR_Z_BIT ? 'Z' : 'z',
196 flags & PSR_C_BIT ? 'C' : 'c',
197 flags & PSR_V_BIT ? 'V' : 'v');
198 printk(" IRQs o%s FIQs o%s Mode %s%s Segment %s\n",
199 interrupts_enabled(regs) ? "n" : "ff",
200 fast_interrupts_enabled(regs) ? "n" : "ff",
201 processor_modes[processor_mode(regs)],
202 thumb_mode(regs) ? " (T)" : "",
203 get_fs() == get_ds() ? "kernel" : "user");
204 {
205 unsigned int ctrl, transbase, dac;
206 __asm__ (
207 " mrc p15, 0, %0, c1, c0\n"
208 " mrc p15, 0, %1, c2, c0\n"
209 " mrc p15, 0, %2, c3, c0\n"
210 : "=r" (ctrl), "=r" (transbase), "=r" (dac));
211 printk("Control: %04X Table: %08X DAC: %08X\n",
212 ctrl, transbase, dac);
213 }
214}
215
216void show_fpregs(struct user_fp *regs)
217{
218 int i;
219
220 for (i = 0; i < 8; i++) {
221 unsigned long *p;
222 char type;
223
224 p = (unsigned long *)(regs->fpregs + i);
225
226 switch (regs->ftype[i]) {
227 case 1: type = 'f'; break;
228 case 2: type = 'd'; break;
229 case 3: type = 'e'; break;
230 default: type = '?'; break;
231 }
232 if (regs->init_flag)
233 type = '?';
234
235 printk(" f%d(%c): %08lx %08lx %08lx%c",
236 i, type, p[0], p[1], p[2], i & 1 ? '\n' : ' ');
237 }
238
239
240 printk("FPSR: %08lx FPCR: %08lx\n",
241 (unsigned long)regs->fpsr,
242 (unsigned long)regs->fpcr);
243}
244
245/*
246 * Task structure and kernel stack allocation.
247 */
248static unsigned long *thread_info_head;
249static unsigned int nr_thread_info;
250
251#define EXTRA_TASK_STRUCT 4
252#define ll_alloc_task_struct() ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
253#define ll_free_task_struct(p) free_pages((unsigned long)(p),1)
254
255struct thread_info *alloc_thread_info(struct task_struct *task)
256{
257 struct thread_info *thread = NULL;
258
259 if (EXTRA_TASK_STRUCT) {
260 unsigned long *p = thread_info_head;
261
262 if (p) {
263 thread_info_head = (unsigned long *)p[0];
264 nr_thread_info -= 1;
265 }
266 thread = (struct thread_info *)p;
267 }
268
269 if (!thread)
270 thread = ll_alloc_task_struct();
271
272#ifdef CONFIG_MAGIC_SYSRQ
273 /*
274 * The stack must be cleared if you want SYSRQ-T to
275 * give sensible stack usage information
276 */
277 if (thread) {
278 char *p = (char *)thread;
279 memzero(p+KERNEL_STACK_SIZE, KERNEL_STACK_SIZE);
280 }
281#endif
282 return thread;
283}
284
285void free_thread_info(struct thread_info *thread)
286{
287 if (EXTRA_TASK_STRUCT && nr_thread_info < EXTRA_TASK_STRUCT) {
288 unsigned long *p = (unsigned long *)thread;
289 p[0] = (unsigned long)thread_info_head;
290 thread_info_head = p;
291 nr_thread_info += 1;
292 } else
293 ll_free_task_struct(thread);
294}
295
296/*
297 * Free current thread data structures etc..
298 */
299void exit_thread(void)
300{
301}
302
303static void default_fp_init(union fp_state *fp)
304{
305 memset(fp, 0, sizeof(union fp_state));
306}
307
308void (*fp_init)(union fp_state *) = default_fp_init;
309EXPORT_SYMBOL(fp_init);
310
311void flush_thread(void)
312{
313 struct thread_info *thread = current_thread_info();
314 struct task_struct *tsk = current;
315
316 memset(thread->used_cp, 0, sizeof(thread->used_cp));
317 memset(&tsk->thread.debug, 0, sizeof(struct debug_info));
318#if defined(CONFIG_IWMMXT)
319 iwmmxt_task_release(thread);
320#endif
321 fp_init(&thread->fpstate);
322#if defined(CONFIG_VFP)
323 vfp_flush_thread(&thread->vfpstate);
324#endif
325}
326
327void release_thread(struct task_struct *dead_task)
328{
329#if defined(CONFIG_VFP)
330 vfp_release_thread(&dead_task->thread_info->vfpstate);
331#endif
332#if defined(CONFIG_IWMMXT)
333 iwmmxt_task_release(dead_task->thread_info);
334#endif
335}
336
337asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
338
339int
340copy_thread(int nr, unsigned long clone_flags, unsigned long stack_start,
341 unsigned long stk_sz, struct task_struct *p, struct pt_regs *regs)
342{
343 struct thread_info *thread = p->thread_info;
344 struct pt_regs *childregs;
345
346 childregs = ((struct pt_regs *)((unsigned long)thread + THREAD_SIZE - 8)) - 1;
347 *childregs = *regs;
348 childregs->ARM_r0 = 0;
349 childregs->ARM_sp = stack_start;
350
351 memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
352 thread->cpu_context.sp = (unsigned long)childregs;
353 thread->cpu_context.pc = (unsigned long)ret_from_fork;
354
355 if (clone_flags & CLONE_SETTLS)
356 thread->tp_value = regs->ARM_r3;
357
358 return 0;
359}
360
361/*
362 * fill in the fpe structure for a core dump...
363 */
364int dump_fpu (struct pt_regs *regs, struct user_fp *fp)
365{
366 struct thread_info *thread = current_thread_info();
367 int used_math = thread->used_cp[1] | thread->used_cp[2];
368
369 if (used_math)
370 memcpy(fp, &thread->fpstate.soft, sizeof (*fp));
371
372 return used_math != 0;
373}
374EXPORT_SYMBOL(dump_fpu);
375
376/*
377 * fill in the user structure for a core dump..
378 */
379void dump_thread(struct pt_regs * regs, struct user * dump)
380{
381 struct task_struct *tsk = current;
382
383 dump->magic = CMAGIC;
384 dump->start_code = tsk->mm->start_code;
385 dump->start_stack = regs->ARM_sp & ~(PAGE_SIZE - 1);
386
387 dump->u_tsize = (tsk->mm->end_code - tsk->mm->start_code) >> PAGE_SHIFT;
388 dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT;
389 dump->u_ssize = 0;
390
391 dump->u_debugreg[0] = tsk->thread.debug.bp[0].address;
392 dump->u_debugreg[1] = tsk->thread.debug.bp[1].address;
393 dump->u_debugreg[2] = tsk->thread.debug.bp[0].insn.arm;
394 dump->u_debugreg[3] = tsk->thread.debug.bp[1].insn.arm;
395 dump->u_debugreg[4] = tsk->thread.debug.nsaved;
396
397 if (dump->start_stack < 0x04000000)
398 dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT;
399
400 dump->regs = *regs;
401 dump->u_fpvalid = dump_fpu (regs, &dump->u_fp);
402}
403EXPORT_SYMBOL(dump_thread);
404
405/*
406 * Shuffle the argument into the correct register before calling the
407 * thread function. r1 is the thread argument, r2 is the pointer to
408 * the thread function, and r3 points to the exit function.
409 */
410extern void kernel_thread_helper(void);
411asm( ".section .text\n"
412" .align\n"
413" .type kernel_thread_helper, #function\n"
414"kernel_thread_helper:\n"
415" mov r0, r1\n"
416" mov lr, r3\n"
417" mov pc, r2\n"
418" .size kernel_thread_helper, . - kernel_thread_helper\n"
419" .previous");
420
421/*
422 * Create a kernel thread.
423 */
424pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
425{
426 struct pt_regs regs;
427
428 memset(&regs, 0, sizeof(regs));
429
430 regs.ARM_r1 = (unsigned long)arg;
431 regs.ARM_r2 = (unsigned long)fn;
432 regs.ARM_r3 = (unsigned long)do_exit;
433 regs.ARM_pc = (unsigned long)kernel_thread_helper;
434 regs.ARM_cpsr = SVC_MODE;
435
436 return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
437}
438EXPORT_SYMBOL(kernel_thread);
439
440unsigned long get_wchan(struct task_struct *p)
441{
442 unsigned long fp, lr;
443 unsigned long stack_page;
444 int count = 0;
445 if (!p || p == current || p->state == TASK_RUNNING)
446 return 0;
447
448 stack_page = 4096 + (unsigned long)p->thread_info;
449 fp = thread_saved_fp(p);
450 do {
451 if (fp < stack_page || fp > 4092+stack_page)
452 return 0;
453 lr = pc_pointer (((unsigned long *)fp)[-1]);
454 if (!in_sched_functions(lr))
455 return lr;
456 fp = *(unsigned long *) (fp - 12);
457 } while (count ++ < 16);
458 return 0;
459}
460EXPORT_SYMBOL(get_wchan);
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
new file mode 100644
index 000000000000..efd7a341614b
--- /dev/null
+++ b/arch/arm/kernel/ptrace.c
@@ -0,0 +1,861 @@
1/*
2 * linux/arch/arm/kernel/ptrace.c
3 *
4 * By Ross Biro 1/23/92
5 * edited by Linus Torvalds
6 * ARM modifications Copyright (C) 2000 Russell King
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/config.h>
13#include <linux/kernel.h>
14#include <linux/sched.h>
15#include <linux/mm.h>
16#include <linux/smp.h>
17#include <linux/smp_lock.h>
18#include <linux/ptrace.h>
19#include <linux/user.h>
20#include <linux/security.h>
21#include <linux/init.h>
22
23#include <asm/uaccess.h>
24#include <asm/pgtable.h>
25#include <asm/system.h>
26#include <asm/traps.h>
27
28#include "ptrace.h"
29
30#define REG_PC 15
31#define REG_PSR 16
32/*
33 * does not yet catch signals sent when the child dies.
34 * in exit.c or in signal.c.
35 */
36
37#if 0
38/*
39 * Breakpoint SWI instruction: SWI &9F0001
40 */
41#define BREAKINST_ARM 0xef9f0001
42#define BREAKINST_THUMB 0xdf00 /* fill this in later */
43#else
44/*
45 * New breakpoints - use an undefined instruction. The ARM architecture
46 * reference manual guarantees that the following instruction space
47 * will produce an undefined instruction exception on all CPUs:
48 *
49 * ARM: xxxx 0111 1111 xxxx xxxx xxxx 1111 xxxx
50 * Thumb: 1101 1110 xxxx xxxx
51 */
52#define BREAKINST_ARM 0xe7f001f0
53#define BREAKINST_THUMB 0xde01
54#endif
55
56/*
57 * Get the address of the live pt_regs for the specified task.
58 * These are saved onto the top kernel stack when the process
59 * is not running.
60 *
61 * Note: if a user thread is execve'd from kernel space, the
62 * kernel stack will not be empty on entry to the kernel, so
63 * ptracing these tasks will fail.
64 */
65static inline struct pt_regs *
66get_user_regs(struct task_struct *task)
67{
68 return (struct pt_regs *)
69 ((unsigned long)task->thread_info + THREAD_SIZE -
70 8 - sizeof(struct pt_regs));
71}
72
73/*
74 * this routine will get a word off of the processes privileged stack.
75 * the offset is how far from the base addr as stored in the THREAD.
76 * this routine assumes that all the privileged stacks are in our
77 * data space.
78 */
79static inline long get_user_reg(struct task_struct *task, int offset)
80{
81 return get_user_regs(task)->uregs[offset];
82}
83
84/*
85 * this routine will put a word on the processes privileged stack.
86 * the offset is how far from the base addr as stored in the THREAD.
87 * this routine assumes that all the privileged stacks are in our
88 * data space.
89 */
90static inline int
91put_user_reg(struct task_struct *task, int offset, long data)
92{
93 struct pt_regs newregs, *regs = get_user_regs(task);
94 int ret = -EINVAL;
95
96 newregs = *regs;
97 newregs.uregs[offset] = data;
98
99 if (valid_user_regs(&newregs)) {
100 regs->uregs[offset] = data;
101 ret = 0;
102 }
103
104 return ret;
105}
106
107static inline int
108read_u32(struct task_struct *task, unsigned long addr, u32 *res)
109{
110 int ret;
111
112 ret = access_process_vm(task, addr, res, sizeof(*res), 0);
113
114 return ret == sizeof(*res) ? 0 : -EIO;
115}
116
117static inline int
118read_instr(struct task_struct *task, unsigned long addr, u32 *res)
119{
120 int ret;
121
122 if (addr & 1) {
123 u16 val;
124 ret = access_process_vm(task, addr & ~1, &val, sizeof(val), 0);
125 ret = ret == sizeof(val) ? 0 : -EIO;
126 *res = val;
127 } else {
128 u32 val;
129 ret = access_process_vm(task, addr & ~3, &val, sizeof(val), 0);
130 ret = ret == sizeof(val) ? 0 : -EIO;
131 *res = val;
132 }
133 return ret;
134}
135
136/*
137 * Get value of register `rn' (in the instruction)
138 */
139static unsigned long
140ptrace_getrn(struct task_struct *child, unsigned long insn)
141{
142 unsigned int reg = (insn >> 16) & 15;
143 unsigned long val;
144
145 val = get_user_reg(child, reg);
146 if (reg == 15)
147 val = pc_pointer(val + 8);
148
149 return val;
150}
151
152/*
153 * Get value of operand 2 (in an ALU instruction)
154 */
155static unsigned long
156ptrace_getaluop2(struct task_struct *child, unsigned long insn)
157{
158 unsigned long val;
159 int shift;
160 int type;
161
162 if (insn & 1 << 25) {
163 val = insn & 255;
164 shift = (insn >> 8) & 15;
165 type = 3;
166 } else {
167 val = get_user_reg (child, insn & 15);
168
169 if (insn & (1 << 4))
170 shift = (int)get_user_reg (child, (insn >> 8) & 15);
171 else
172 shift = (insn >> 7) & 31;
173
174 type = (insn >> 5) & 3;
175 }
176
177 switch (type) {
178 case 0: val <<= shift; break;
179 case 1: val >>= shift; break;
180 case 2:
181 val = (((signed long)val) >> shift);
182 break;
183 case 3:
184 val = (val >> shift) | (val << (32 - shift));
185 break;
186 }
187 return val;
188}
189
190/*
191 * Get value of operand 2 (in a LDR instruction)
192 */
193static unsigned long
194ptrace_getldrop2(struct task_struct *child, unsigned long insn)
195{
196 unsigned long val;
197 int shift;
198 int type;
199
200 val = get_user_reg(child, insn & 15);
201 shift = (insn >> 7) & 31;
202 type = (insn >> 5) & 3;
203
204 switch (type) {
205 case 0: val <<= shift; break;
206 case 1: val >>= shift; break;
207 case 2:
208 val = (((signed long)val) >> shift);
209 break;
210 case 3:
211 val = (val >> shift) | (val << (32 - shift));
212 break;
213 }
214 return val;
215}
216
217#define OP_MASK 0x01e00000
218#define OP_AND 0x00000000
219#define OP_EOR 0x00200000
220#define OP_SUB 0x00400000
221#define OP_RSB 0x00600000
222#define OP_ADD 0x00800000
223#define OP_ADC 0x00a00000
224#define OP_SBC 0x00c00000
225#define OP_RSC 0x00e00000
226#define OP_ORR 0x01800000
227#define OP_MOV 0x01a00000
228#define OP_BIC 0x01c00000
229#define OP_MVN 0x01e00000
230
231static unsigned long
232get_branch_address(struct task_struct *child, unsigned long pc, unsigned long insn)
233{
234 u32 alt = 0;
235
236 switch (insn & 0x0e000000) {
237 case 0x00000000:
238 case 0x02000000: {
239 /*
240 * data processing
241 */
242 long aluop1, aluop2, ccbit;
243
244 if ((insn & 0xf000) != 0xf000)
245 break;
246
247 aluop1 = ptrace_getrn(child, insn);
248 aluop2 = ptrace_getaluop2(child, insn);
249 ccbit = get_user_reg(child, REG_PSR) & PSR_C_BIT ? 1 : 0;
250
251 switch (insn & OP_MASK) {
252 case OP_AND: alt = aluop1 & aluop2; break;
253 case OP_EOR: alt = aluop1 ^ aluop2; break;
254 case OP_SUB: alt = aluop1 - aluop2; break;
255 case OP_RSB: alt = aluop2 - aluop1; break;
256 case OP_ADD: alt = aluop1 + aluop2; break;
257 case OP_ADC: alt = aluop1 + aluop2 + ccbit; break;
258 case OP_SBC: alt = aluop1 - aluop2 + ccbit; break;
259 case OP_RSC: alt = aluop2 - aluop1 + ccbit; break;
260 case OP_ORR: alt = aluop1 | aluop2; break;
261 case OP_MOV: alt = aluop2; break;
262 case OP_BIC: alt = aluop1 & ~aluop2; break;
263 case OP_MVN: alt = ~aluop2; break;
264 }
265 break;
266 }
267
268 case 0x04000000:
269 case 0x06000000:
270 /*
271 * ldr
272 */
273 if ((insn & 0x0010f000) == 0x0010f000) {
274 unsigned long base;
275
276 base = ptrace_getrn(child, insn);
277 if (insn & 1 << 24) {
278 long aluop2;
279
280 if (insn & 0x02000000)
281 aluop2 = ptrace_getldrop2(child, insn);
282 else
283 aluop2 = insn & 0xfff;
284
285 if (insn & 1 << 23)
286 base += aluop2;
287 else
288 base -= aluop2;
289 }
290 if (read_u32(child, base, &alt) == 0)
291 alt = pc_pointer(alt);
292 }
293 break;
294
295 case 0x08000000:
296 /*
297 * ldm
298 */
299 if ((insn & 0x00108000) == 0x00108000) {
300 unsigned long base;
301 unsigned int nr_regs;
302
303 if (insn & (1 << 23)) {
304 nr_regs = hweight16(insn & 65535) << 2;
305
306 if (!(insn & (1 << 24)))
307 nr_regs -= 4;
308 } else {
309 if (insn & (1 << 24))
310 nr_regs = -4;
311 else
312 nr_regs = 0;
313 }
314
315 base = ptrace_getrn(child, insn);
316
317 if (read_u32(child, base + nr_regs, &alt) == 0)
318 alt = pc_pointer(alt);
319 break;
320 }
321 break;
322
323 case 0x0a000000: {
324 /*
325 * bl or b
326 */
327 signed long displ;
328 /* It's a branch/branch link: instead of trying to
329 * figure out whether the branch will be taken or not,
330 * we'll put a breakpoint at both locations. This is
331 * simpler, more reliable, and probably not a whole lot
332 * slower than the alternative approach of emulating the
333 * branch.
334 */
335 displ = (insn & 0x00ffffff) << 8;
336 displ = (displ >> 6) + 8;
337 if (displ != 0 && displ != 4)
338 alt = pc + displ;
339 }
340 break;
341 }
342
343 return alt;
344}
345
346static int
347swap_insn(struct task_struct *task, unsigned long addr,
348 void *old_insn, void *new_insn, int size)
349{
350 int ret;
351
352 ret = access_process_vm(task, addr, old_insn, size, 0);
353 if (ret == size)
354 ret = access_process_vm(task, addr, new_insn, size, 1);
355 return ret;
356}
357
358static void
359add_breakpoint(struct task_struct *task, struct debug_info *dbg, unsigned long addr)
360{
361 int nr = dbg->nsaved;
362
363 if (nr < 2) {
364 u32 new_insn = BREAKINST_ARM;
365 int res;
366
367 res = swap_insn(task, addr, &dbg->bp[nr].insn, &new_insn, 4);
368
369 if (res == 4) {
370 dbg->bp[nr].address = addr;
371 dbg->nsaved += 1;
372 }
373 } else
374 printk(KERN_ERR "ptrace: too many breakpoints\n");
375}
376
377/*
378 * Clear one breakpoint in the user program. We copy what the hardware
379 * does and use bit 0 of the address to indicate whether this is a Thumb
380 * breakpoint or an ARM breakpoint.
381 */
382static void clear_breakpoint(struct task_struct *task, struct debug_entry *bp)
383{
384 unsigned long addr = bp->address;
385 union debug_insn old_insn;
386 int ret;
387
388 if (addr & 1) {
389 ret = swap_insn(task, addr & ~1, &old_insn.thumb,
390 &bp->insn.thumb, 2);
391
392 if (ret != 2 || old_insn.thumb != BREAKINST_THUMB)
393 printk(KERN_ERR "%s:%d: corrupted Thumb breakpoint at "
394 "0x%08lx (0x%04x)\n", task->comm, task->pid,
395 addr, old_insn.thumb);
396 } else {
397 ret = swap_insn(task, addr & ~3, &old_insn.arm,
398 &bp->insn.arm, 4);
399
400 if (ret != 4 || old_insn.arm != BREAKINST_ARM)
401 printk(KERN_ERR "%s:%d: corrupted ARM breakpoint at "
402 "0x%08lx (0x%08x)\n", task->comm, task->pid,
403 addr, old_insn.arm);
404 }
405}
406
407void ptrace_set_bpt(struct task_struct *child)
408{
409 struct pt_regs *regs;
410 unsigned long pc;
411 u32 insn;
412 int res;
413
414 regs = get_user_regs(child);
415 pc = instruction_pointer(regs);
416
417 if (thumb_mode(regs)) {
418 printk(KERN_WARNING "ptrace: can't handle thumb mode\n");
419 return;
420 }
421
422 res = read_instr(child, pc, &insn);
423 if (!res) {
424 struct debug_info *dbg = &child->thread.debug;
425 unsigned long alt;
426
427 dbg->nsaved = 0;
428
429 alt = get_branch_address(child, pc, insn);
430 if (alt)
431 add_breakpoint(child, dbg, alt);
432
433 /*
434 * Note that we ignore the result of setting the above
435 * breakpoint since it may fail. When it does, this is
436 * not so much an error, but a forewarning that we may
437 * be receiving a prefetch abort shortly.
438 *
439 * If we don't set this breakpoint here, then we can
440 * lose control of the thread during single stepping.
441 */
442 if (!alt || predicate(insn) != PREDICATE_ALWAYS)
443 add_breakpoint(child, dbg, pc + 4);
444 }
445}
446
447/*
448 * Ensure no single-step breakpoint is pending. Returns non-zero
449 * value if child was being single-stepped.
450 */
451void ptrace_cancel_bpt(struct task_struct *child)
452{
453 int i, nsaved = child->thread.debug.nsaved;
454
455 child->thread.debug.nsaved = 0;
456
457 if (nsaved > 2) {
458 printk("ptrace_cancel_bpt: bogus nsaved: %d!\n", nsaved);
459 nsaved = 2;
460 }
461
462 for (i = 0; i < nsaved; i++)
463 clear_breakpoint(child, &child->thread.debug.bp[i]);
464}
465
466/*
467 * Called by kernel/ptrace.c when detaching..
468 *
469 * Make sure the single step bit is not set.
470 */
471void ptrace_disable(struct task_struct *child)
472{
473 child->ptrace &= ~PT_SINGLESTEP;
474 ptrace_cancel_bpt(child);
475}
476
477/*
478 * Handle hitting a breakpoint.
479 */
480void ptrace_break(struct task_struct *tsk, struct pt_regs *regs)
481{
482 siginfo_t info;
483
484 ptrace_cancel_bpt(tsk);
485
486 info.si_signo = SIGTRAP;
487 info.si_errno = 0;
488 info.si_code = TRAP_BRKPT;
489 info.si_addr = (void __user *)instruction_pointer(regs);
490
491 force_sig_info(SIGTRAP, &info, tsk);
492}
493
494static int break_trap(struct pt_regs *regs, unsigned int instr)
495{
496 ptrace_break(current, regs);
497 return 0;
498}
499
500static struct undef_hook arm_break_hook = {
501 .instr_mask = 0x0fffffff,
502 .instr_val = 0x07f001f0,
503 .cpsr_mask = PSR_T_BIT,
504 .cpsr_val = 0,
505 .fn = break_trap,
506};
507
508static struct undef_hook thumb_break_hook = {
509 .instr_mask = 0xffff,
510 .instr_val = 0xde01,
511 .cpsr_mask = PSR_T_BIT,
512 .cpsr_val = PSR_T_BIT,
513 .fn = break_trap,
514};
515
516static int __init ptrace_break_init(void)
517{
518 register_undef_hook(&arm_break_hook);
519 register_undef_hook(&thumb_break_hook);
520 return 0;
521}
522
523core_initcall(ptrace_break_init);
524
525/*
526 * Read the word at offset "off" into the "struct user". We
527 * actually access the pt_regs stored on the kernel stack.
528 */
529static int ptrace_read_user(struct task_struct *tsk, unsigned long off,
530 unsigned long __user *ret)
531{
532 unsigned long tmp;
533
534 if (off & 3 || off >= sizeof(struct user))
535 return -EIO;
536
537 tmp = 0;
538 if (off < sizeof(struct pt_regs))
539 tmp = get_user_reg(tsk, off >> 2);
540
541 return put_user(tmp, ret);
542}
543
544/*
545 * Write the word at offset "off" into "struct user". We
546 * actually access the pt_regs stored on the kernel stack.
547 */
548static int ptrace_write_user(struct task_struct *tsk, unsigned long off,
549 unsigned long val)
550{
551 if (off & 3 || off >= sizeof(struct user))
552 return -EIO;
553
554 if (off >= sizeof(struct pt_regs))
555 return 0;
556
557 return put_user_reg(tsk, off >> 2, val);
558}
559
560/*
561 * Get all user integer registers.
562 */
563static int ptrace_getregs(struct task_struct *tsk, void __user *uregs)
564{
565 struct pt_regs *regs = get_user_regs(tsk);
566
567 return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0;
568}
569
570/*
571 * Set all user integer registers.
572 */
573static int ptrace_setregs(struct task_struct *tsk, void __user *uregs)
574{
575 struct pt_regs newregs;
576 int ret;
577
578 ret = -EFAULT;
579 if (copy_from_user(&newregs, uregs, sizeof(struct pt_regs)) == 0) {
580 struct pt_regs *regs = get_user_regs(tsk);
581
582 ret = -EINVAL;
583 if (valid_user_regs(&newregs)) {
584 *regs = newregs;
585 ret = 0;
586 }
587 }
588
589 return ret;
590}
591
592/*
593 * Get the child FPU state.
594 */
595static int ptrace_getfpregs(struct task_struct *tsk, void __user *ufp)
596{
597 return copy_to_user(ufp, &tsk->thread_info->fpstate,
598 sizeof(struct user_fp)) ? -EFAULT : 0;
599}
600
601/*
602 * Set the child FPU state.
603 */
604static int ptrace_setfpregs(struct task_struct *tsk, void __user *ufp)
605{
606 struct thread_info *thread = tsk->thread_info;
607 thread->used_cp[1] = thread->used_cp[2] = 1;
608 return copy_from_user(&thread->fpstate, ufp,
609 sizeof(struct user_fp)) ? -EFAULT : 0;
610}
611
612#ifdef CONFIG_IWMMXT
613
614/*
615 * Get the child iWMMXt state.
616 */
617static int ptrace_getwmmxregs(struct task_struct *tsk, void __user *ufp)
618{
619 struct thread_info *thread = tsk->thread_info;
620 void *ptr = &thread->fpstate;
621
622 if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT))
623 return -ENODATA;
624 iwmmxt_task_disable(thread); /* force it to ram */
625 /* The iWMMXt state is stored doubleword-aligned. */
626 if (((long) ptr) & 4)
627 ptr += 4;
628 return copy_to_user(ufp, ptr, 0x98) ? -EFAULT : 0;
629}
630
631/*
632 * Set the child iWMMXt state.
633 */
634static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp)
635{
636 struct thread_info *thread = tsk->thread_info;
637 void *ptr = &thread->fpstate;
638
639 if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT))
640 return -EACCES;
641 iwmmxt_task_release(thread); /* force a reload */
642 /* The iWMMXt state is stored doubleword-aligned. */
643 if (((long) ptr) & 4)
644 ptr += 4;
645 return copy_from_user(ptr, ufp, 0x98) ? -EFAULT : 0;
646}
647
648#endif
649
650static int do_ptrace(int request, struct task_struct *child, long addr, long data)
651{
652 unsigned long tmp;
653 int ret;
654
655 switch (request) {
656 /*
657 * read word at location "addr" in the child process.
658 */
659 case PTRACE_PEEKTEXT:
660 case PTRACE_PEEKDATA:
661 ret = access_process_vm(child, addr, &tmp,
662 sizeof(unsigned long), 0);
663 if (ret == sizeof(unsigned long))
664 ret = put_user(tmp, (unsigned long __user *) data);
665 else
666 ret = -EIO;
667 break;
668
669 case PTRACE_PEEKUSR:
670 ret = ptrace_read_user(child, addr, (unsigned long __user *)data);
671 break;
672
673 /*
674 * write the word at location addr.
675 */
676 case PTRACE_POKETEXT:
677 case PTRACE_POKEDATA:
678 ret = access_process_vm(child, addr, &data,
679 sizeof(unsigned long), 1);
680 if (ret == sizeof(unsigned long))
681 ret = 0;
682 else
683 ret = -EIO;
684 break;
685
686 case PTRACE_POKEUSR:
687 ret = ptrace_write_user(child, addr, data);
688 break;
689
690 /*
691 * continue/restart and stop at next (return from) syscall
692 */
693 case PTRACE_SYSCALL:
694 case PTRACE_CONT:
695 ret = -EIO;
696 if ((unsigned long) data > _NSIG)
697 break;
698 if (request == PTRACE_SYSCALL)
699 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
700 else
701 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
702 child->exit_code = data;
703 /* make sure single-step breakpoint is gone. */
704 child->ptrace &= ~PT_SINGLESTEP;
705 ptrace_cancel_bpt(child);
706 wake_up_process(child);
707 ret = 0;
708 break;
709
710 /*
711 * make the child exit. Best I can do is send it a sigkill.
712 * perhaps it should be put in the status that it wants to
713 * exit.
714 */
715 case PTRACE_KILL:
716 /* make sure single-step breakpoint is gone. */
717 child->ptrace &= ~PT_SINGLESTEP;
718 ptrace_cancel_bpt(child);
719 if (child->exit_state != EXIT_ZOMBIE) {
720 child->exit_code = SIGKILL;
721 wake_up_process(child);
722 }
723 ret = 0;
724 break;
725
726 /*
727 * execute single instruction.
728 */
729 case PTRACE_SINGLESTEP:
730 ret = -EIO;
731 if ((unsigned long) data > _NSIG)
732 break;
733 child->ptrace |= PT_SINGLESTEP;
734 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
735 child->exit_code = data;
736 /* give it a chance to run. */
737 wake_up_process(child);
738 ret = 0;
739 break;
740
741 case PTRACE_DETACH:
742 ret = ptrace_detach(child, data);
743 break;
744
745 case PTRACE_GETREGS:
746 ret = ptrace_getregs(child, (void __user *)data);
747 break;
748
749 case PTRACE_SETREGS:
750 ret = ptrace_setregs(child, (void __user *)data);
751 break;
752
753 case PTRACE_GETFPREGS:
754 ret = ptrace_getfpregs(child, (void __user *)data);
755 break;
756
757 case PTRACE_SETFPREGS:
758 ret = ptrace_setfpregs(child, (void __user *)data);
759 break;
760
761#ifdef CONFIG_IWMMXT
762 case PTRACE_GETWMMXREGS:
763 ret = ptrace_getwmmxregs(child, (void __user *)data);
764 break;
765
766 case PTRACE_SETWMMXREGS:
767 ret = ptrace_setwmmxregs(child, (void __user *)data);
768 break;
769#endif
770
771 case PTRACE_GET_THREAD_AREA:
772 ret = put_user(child->thread_info->tp_value,
773 (unsigned long __user *) data);
774 break;
775
776 default:
777 ret = ptrace_request(child, request, addr, data);
778 break;
779 }
780
781 return ret;
782}
783
784asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
785{
786 struct task_struct *child;
787 int ret;
788
789 lock_kernel();
790 ret = -EPERM;
791 if (request == PTRACE_TRACEME) {
792 /* are we already being traced? */
793 if (current->ptrace & PT_PTRACED)
794 goto out;
795 ret = security_ptrace(current->parent, current);
796 if (ret)
797 goto out;
798 /* set the ptrace bit in the process flags. */
799 current->ptrace |= PT_PTRACED;
800 ret = 0;
801 goto out;
802 }
803 ret = -ESRCH;
804 read_lock(&tasklist_lock);
805 child = find_task_by_pid(pid);
806 if (child)
807 get_task_struct(child);
808 read_unlock(&tasklist_lock);
809 if (!child)
810 goto out;
811
812 ret = -EPERM;
813 if (pid == 1) /* you may not mess with init */
814 goto out_tsk;
815
816 if (request == PTRACE_ATTACH) {
817 ret = ptrace_attach(child);
818 goto out_tsk;
819 }
820 ret = ptrace_check_attach(child, request == PTRACE_KILL);
821 if (ret == 0)
822 ret = do_ptrace(request, child, addr, data);
823
824out_tsk:
825 put_task_struct(child);
826out:
827 unlock_kernel();
828 return ret;
829}
830
831asmlinkage void syscall_trace(int why, struct pt_regs *regs)
832{
833 unsigned long ip;
834
835 if (!test_thread_flag(TIF_SYSCALL_TRACE))
836 return;
837 if (!(current->ptrace & PT_PTRACED))
838 return;
839
840 /*
841 * Save IP. IP is used to denote syscall entry/exit:
842 * IP = 0 -> entry, = 1 -> exit
843 */
844 ip = regs->ARM_ip;
845 regs->ARM_ip = why;
846
847 /* the 0x80 provides a way for the tracing parent to distinguish
848 between a syscall stop and SIGTRAP delivery */
849 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
850 ? 0x80 : 0));
851 /*
852 * this isn't the same as continuing with a signal, but it will do
853 * for normal use. strace only continues with a signal if the
854 * stopping signal is not SIGTRAP. -brl
855 */
856 if (current->exit_code) {
857 send_sig(current->exit_code, current, 1);
858 current->exit_code = 0;
859 }
860 regs->ARM_ip = ip;
861}
diff --git a/arch/arm/kernel/ptrace.h b/arch/arm/kernel/ptrace.h
new file mode 100644
index 000000000000..f7cad13a22e9
--- /dev/null
+++ b/arch/arm/kernel/ptrace.h
@@ -0,0 +1,12 @@
1/*
2 * linux/arch/arm/kernel/ptrace.h
3 *
4 * Copyright (C) 2000-2003 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10extern void ptrace_cancel_bpt(struct task_struct *);
11extern void ptrace_set_bpt(struct task_struct *);
12extern void ptrace_break(struct task_struct *, struct pt_regs *);
diff --git a/arch/arm/kernel/semaphore.c b/arch/arm/kernel/semaphore.c
new file mode 100644
index 000000000000..ac423e3e224b
--- /dev/null
+++ b/arch/arm/kernel/semaphore.c
@@ -0,0 +1,220 @@
1/*
2 * ARM semaphore implementation, taken from
3 *
4 * i386 semaphore implementation.
5 *
6 * (C) Copyright 1999 Linus Torvalds
7 *
8 * Modified for ARM by Russell King
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14#include <linux/module.h>
15#include <linux/sched.h>
16#include <linux/errno.h>
17#include <linux/init.h>
18
19#include <asm/semaphore.h>
20
21/*
22 * Semaphores are implemented using a two-way counter:
23 * The "count" variable is decremented for each process
24 * that tries to acquire the semaphore, while the "sleeping"
25 * variable is a count of such acquires.
26 *
27 * Notably, the inline "up()" and "down()" functions can
28 * efficiently test if they need to do any extra work (up
29 * needs to do something only if count was negative before
30 * the increment operation.
31 *
32 * "sleeping" and the contention routine ordering is
33 * protected by the semaphore spinlock.
34 *
35 * Note that these functions are only called when there is
36 * contention on the lock, and as such all this is the
37 * "non-critical" part of the whole semaphore business. The
38 * critical part is the inline stuff in <asm/semaphore.h>
39 * where we want to avoid any extra jumps and calls.
40 */
41
42/*
43 * Logic:
44 * - only on a boundary condition do we need to care. When we go
45 * from a negative count to a non-negative, we wake people up.
46 * - when we go from a non-negative count to a negative do we
47 * (a) synchronize with the "sleeper" count and (b) make sure
48 * that we're on the wakeup list before we synchronize so that
49 * we cannot lose wakeup events.
50 */
51
52void __up(struct semaphore *sem)
53{
54 wake_up(&sem->wait);
55}
56
57static DEFINE_SPINLOCK(semaphore_lock);
58
59void __sched __down(struct semaphore * sem)
60{
61 struct task_struct *tsk = current;
62 DECLARE_WAITQUEUE(wait, tsk);
63 tsk->state = TASK_UNINTERRUPTIBLE;
64 add_wait_queue_exclusive(&sem->wait, &wait);
65
66 spin_lock_irq(&semaphore_lock);
67 sem->sleepers++;
68 for (;;) {
69 int sleepers = sem->sleepers;
70
71 /*
72 * Add "everybody else" into it. They aren't
73 * playing, because we own the spinlock.
74 */
75 if (!atomic_add_negative(sleepers - 1, &sem->count)) {
76 sem->sleepers = 0;
77 break;
78 }
79 sem->sleepers = 1; /* us - see -1 above */
80 spin_unlock_irq(&semaphore_lock);
81
82 schedule();
83 tsk->state = TASK_UNINTERRUPTIBLE;
84 spin_lock_irq(&semaphore_lock);
85 }
86 spin_unlock_irq(&semaphore_lock);
87 remove_wait_queue(&sem->wait, &wait);
88 tsk->state = TASK_RUNNING;
89 wake_up(&sem->wait);
90}
91
92int __sched __down_interruptible(struct semaphore * sem)
93{
94 int retval = 0;
95 struct task_struct *tsk = current;
96 DECLARE_WAITQUEUE(wait, tsk);
97 tsk->state = TASK_INTERRUPTIBLE;
98 add_wait_queue_exclusive(&sem->wait, &wait);
99
100 spin_lock_irq(&semaphore_lock);
101 sem->sleepers ++;
102 for (;;) {
103 int sleepers = sem->sleepers;
104
105 /*
106 * With signals pending, this turns into
107 * the trylock failure case - we won't be
108 * sleeping, and we* can't get the lock as
109 * it has contention. Just correct the count
110 * and exit.
111 */
112 if (signal_pending(current)) {
113 retval = -EINTR;
114 sem->sleepers = 0;
115 atomic_add(sleepers, &sem->count);
116 break;
117 }
118
119 /*
120 * Add "everybody else" into it. They aren't
121 * playing, because we own the spinlock. The
122 * "-1" is because we're still hoping to get
123 * the lock.
124 */
125 if (!atomic_add_negative(sleepers - 1, &sem->count)) {
126 sem->sleepers = 0;
127 break;
128 }
129 sem->sleepers = 1; /* us - see -1 above */
130 spin_unlock_irq(&semaphore_lock);
131
132 schedule();
133 tsk->state = TASK_INTERRUPTIBLE;
134 spin_lock_irq(&semaphore_lock);
135 }
136 spin_unlock_irq(&semaphore_lock);
137 tsk->state = TASK_RUNNING;
138 remove_wait_queue(&sem->wait, &wait);
139 wake_up(&sem->wait);
140 return retval;
141}
142
143/*
144 * Trylock failed - make sure we correct for
145 * having decremented the count.
146 *
147 * We could have done the trylock with a
148 * single "cmpxchg" without failure cases,
149 * but then it wouldn't work on a 386.
150 */
151int __down_trylock(struct semaphore * sem)
152{
153 int sleepers;
154 unsigned long flags;
155
156 spin_lock_irqsave(&semaphore_lock, flags);
157 sleepers = sem->sleepers + 1;
158 sem->sleepers = 0;
159
160 /*
161 * Add "everybody else" and us into it. They aren't
162 * playing, because we own the spinlock.
163 */
164 if (!atomic_add_negative(sleepers, &sem->count))
165 wake_up(&sem->wait);
166
167 spin_unlock_irqrestore(&semaphore_lock, flags);
168 return 1;
169}
170
171/*
172 * The semaphore operations have a special calling sequence that
173 * allow us to do a simpler in-line version of them. These routines
174 * need to convert that sequence back into the C sequence when
175 * there is contention on the semaphore.
176 *
177 * ip contains the semaphore pointer on entry. Save the C-clobbered
178 * registers (r0 to r3 and lr), but not ip, as we use it as a return
179 * value in some cases..
180 */
181asm(" .section .sched.text,\"ax\" \n\
182 .align 5 \n\
183 .globl __down_failed \n\
184__down_failed: \n\
185 stmfd sp!, {r0 - r3, lr} \n\
186 mov r0, ip \n\
187 bl __down \n\
188 ldmfd sp!, {r0 - r3, pc} \n\
189 \n\
190 .align 5 \n\
191 .globl __down_interruptible_failed \n\
192__down_interruptible_failed: \n\
193 stmfd sp!, {r0 - r3, lr} \n\
194 mov r0, ip \n\
195 bl __down_interruptible \n\
196 mov ip, r0 \n\
197 ldmfd sp!, {r0 - r3, pc} \n\
198 \n\
199 .align 5 \n\
200 .globl __down_trylock_failed \n\
201__down_trylock_failed: \n\
202 stmfd sp!, {r0 - r3, lr} \n\
203 mov r0, ip \n\
204 bl __down_trylock \n\
205 mov ip, r0 \n\
206 ldmfd sp!, {r0 - r3, pc} \n\
207 \n\
208 .align 5 \n\
209 .globl __up_wakeup \n\
210__up_wakeup: \n\
211 stmfd sp!, {r0 - r3, lr} \n\
212 mov r0, ip \n\
213 bl __up \n\
214 ldmfd sp!, {r0 - r3, pc} \n\
215 ");
216
217EXPORT_SYMBOL(__down_failed);
218EXPORT_SYMBOL(__down_interruptible_failed);
219EXPORT_SYMBOL(__down_trylock_failed);
220EXPORT_SYMBOL(__up_wakeup);
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
new file mode 100644
index 000000000000..c2a7da3ac0f1
--- /dev/null
+++ b/arch/arm/kernel/setup.c
@@ -0,0 +1,875 @@
1/*
2 * linux/arch/arm/kernel/setup.c
3 *
4 * Copyright (C) 1995-2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/config.h>
11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/stddef.h>
14#include <linux/ioport.h>
15#include <linux/delay.h>
16#include <linux/utsname.h>
17#include <linux/initrd.h>
18#include <linux/console.h>
19#include <linux/bootmem.h>
20#include <linux/seq_file.h>
21#include <linux/tty.h>
22#include <linux/init.h>
23#include <linux/root_dev.h>
24#include <linux/cpu.h>
25#include <linux/interrupt.h>
26
27#include <asm/cpu.h>
28#include <asm/elf.h>
29#include <asm/hardware.h>
30#include <asm/io.h>
31#include <asm/procinfo.h>
32#include <asm/setup.h>
33#include <asm/mach-types.h>
34#include <asm/cacheflush.h>
35#include <asm/tlbflush.h>
36
37#include <asm/mach/arch.h>
38#include <asm/mach/irq.h>
39#include <asm/mach/time.h>
40
41#ifndef MEM_SIZE
42#define MEM_SIZE (16*1024*1024)
43#endif
44
45#if defined(CONFIG_FPE_NWFPE) || defined(CONFIG_FPE_FASTFPE)
46char fpe_type[8];
47
48static int __init fpe_setup(char *line)
49{
50 memcpy(fpe_type, line, 8);
51 return 1;
52}
53
54__setup("fpe=", fpe_setup);
55#endif
56
57extern unsigned int mem_fclk_21285;
58extern void paging_init(struct meminfo *, struct machine_desc *desc);
59extern void convert_to_tag_list(struct tag *tags);
60extern void squash_mem_tags(struct tag *tag);
61extern void reboot_setup(char *str);
62extern int root_mountflags;
63extern void _stext, _text, _etext, __data_start, _edata, _end;
64
65unsigned int processor_id;
66unsigned int __machine_arch_type;
67EXPORT_SYMBOL(__machine_arch_type);
68
69unsigned int system_rev;
70EXPORT_SYMBOL(system_rev);
71
72unsigned int system_serial_low;
73EXPORT_SYMBOL(system_serial_low);
74
75unsigned int system_serial_high;
76EXPORT_SYMBOL(system_serial_high);
77
78unsigned int elf_hwcap;
79EXPORT_SYMBOL(elf_hwcap);
80
81
82#ifdef MULTI_CPU
83struct processor processor;
84#endif
85#ifdef MULTI_TLB
86struct cpu_tlb_fns cpu_tlb;
87#endif
88#ifdef MULTI_USER
89struct cpu_user_fns cpu_user;
90#endif
91#ifdef MULTI_CACHE
92struct cpu_cache_fns cpu_cache;
93#endif
94
95char elf_platform[ELF_PLATFORM_SIZE];
96EXPORT_SYMBOL(elf_platform);
97
98unsigned long phys_initrd_start __initdata = 0;
99unsigned long phys_initrd_size __initdata = 0;
100
101static struct meminfo meminfo __initdata = { 0, };
102static const char *cpu_name;
103static const char *machine_name;
104static char command_line[COMMAND_LINE_SIZE];
105
106static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
107static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
108#define ENDIANNESS ((char)endian_test.l)
109
110DEFINE_PER_CPU(struct cpuinfo_arm, cpu_data);
111
112/*
113 * Standard memory resources
114 */
115static struct resource mem_res[] = {
116 { "Video RAM", 0, 0, IORESOURCE_MEM },
117 { "Kernel text", 0, 0, IORESOURCE_MEM },
118 { "Kernel data", 0, 0, IORESOURCE_MEM }
119};
120
121#define video_ram mem_res[0]
122#define kernel_code mem_res[1]
123#define kernel_data mem_res[2]
124
125static struct resource io_res[] = {
126 { "reserved", 0x3bc, 0x3be, IORESOURCE_IO | IORESOURCE_BUSY },
127 { "reserved", 0x378, 0x37f, IORESOURCE_IO | IORESOURCE_BUSY },
128 { "reserved", 0x278, 0x27f, IORESOURCE_IO | IORESOURCE_BUSY }
129};
130
131#define lp0 io_res[0]
132#define lp1 io_res[1]
133#define lp2 io_res[2]
134
135static const char *cache_types[16] = {
136 "write-through",
137 "write-back",
138 "write-back",
139 "undefined 3",
140 "undefined 4",
141 "undefined 5",
142 "write-back",
143 "write-back",
144 "undefined 8",
145 "undefined 9",
146 "undefined 10",
147 "undefined 11",
148 "undefined 12",
149 "undefined 13",
150 "write-back",
151 "undefined 15",
152};
153
154static const char *cache_clean[16] = {
155 "not required",
156 "read-block",
157 "cp15 c7 ops",
158 "undefined 3",
159 "undefined 4",
160 "undefined 5",
161 "cp15 c7 ops",
162 "cp15 c7 ops",
163 "undefined 8",
164 "undefined 9",
165 "undefined 10",
166 "undefined 11",
167 "undefined 12",
168 "undefined 13",
169 "cp15 c7 ops",
170 "undefined 15",
171};
172
173static const char *cache_lockdown[16] = {
174 "not supported",
175 "not supported",
176 "not supported",
177 "undefined 3",
178 "undefined 4",
179 "undefined 5",
180 "format A",
181 "format B",
182 "undefined 8",
183 "undefined 9",
184 "undefined 10",
185 "undefined 11",
186 "undefined 12",
187 "undefined 13",
188 "format C",
189 "undefined 15",
190};
191
192static const char *proc_arch[] = {
193 "undefined/unknown",
194 "3",
195 "4",
196 "4T",
197 "5",
198 "5T",
199 "5TE",
200 "5TEJ",
201 "6TEJ",
202 "?(10)",
203 "?(11)",
204 "?(12)",
205 "?(13)",
206 "?(14)",
207 "?(15)",
208 "?(16)",
209 "?(17)",
210};
211
212#define CACHE_TYPE(x) (((x) >> 25) & 15)
213#define CACHE_S(x) ((x) & (1 << 24))
214#define CACHE_DSIZE(x) (((x) >> 12) & 4095) /* only if S=1 */
215#define CACHE_ISIZE(x) ((x) & 4095)
216
217#define CACHE_SIZE(y) (((y) >> 6) & 7)
218#define CACHE_ASSOC(y) (((y) >> 3) & 7)
219#define CACHE_M(y) ((y) & (1 << 2))
220#define CACHE_LINE(y) ((y) & 3)
221
222static inline void dump_cache(const char *prefix, int cpu, unsigned int cache)
223{
224 unsigned int mult = 2 + (CACHE_M(cache) ? 1 : 0);
225
226 printk("CPU%u: %s: %d bytes, associativity %d, %d byte lines, %d sets\n",
227 cpu, prefix,
228 mult << (8 + CACHE_SIZE(cache)),
229 (mult << CACHE_ASSOC(cache)) >> 1,
230 8 << CACHE_LINE(cache),
231 1 << (6 + CACHE_SIZE(cache) - CACHE_ASSOC(cache) -
232 CACHE_LINE(cache)));
233}
234
235static void __init dump_cpu_info(int cpu)
236{
237 unsigned int info = read_cpuid(CPUID_CACHETYPE);
238
239 if (info != processor_id) {
240 printk("CPU%u: D %s %s cache\n", cpu, cache_is_vivt() ? "VIVT" : "VIPT",
241 cache_types[CACHE_TYPE(info)]);
242 if (CACHE_S(info)) {
243 dump_cache("I cache", cpu, CACHE_ISIZE(info));
244 dump_cache("D cache", cpu, CACHE_DSIZE(info));
245 } else {
246 dump_cache("cache", cpu, CACHE_ISIZE(info));
247 }
248 }
249}
250
251int cpu_architecture(void)
252{
253 int cpu_arch;
254
255 if ((processor_id & 0x0000f000) == 0) {
256 cpu_arch = CPU_ARCH_UNKNOWN;
257 } else if ((processor_id & 0x0000f000) == 0x00007000) {
258 cpu_arch = (processor_id & (1 << 23)) ? CPU_ARCH_ARMv4T : CPU_ARCH_ARMv3;
259 } else {
260 cpu_arch = (processor_id >> 16) & 7;
261 if (cpu_arch)
262 cpu_arch += CPU_ARCH_ARMv3;
263 }
264
265 return cpu_arch;
266}
267
268/*
269 * These functions re-use the assembly code in head.S, which
270 * already provide the required functionality.
271 */
272extern struct proc_info_list *lookup_processor_type(void);
273extern struct machine_desc *lookup_machine_type(unsigned int);
274
275static void __init setup_processor(void)
276{
277 struct proc_info_list *list;
278
279 /*
280 * locate processor in the list of supported processor
281 * types. The linker builds this table for us from the
282 * entries in arch/arm/mm/proc-*.S
283 */
284 list = lookup_processor_type();
285 if (!list) {
286 printk("CPU configuration botched (ID %08x), unable "
287 "to continue.\n", processor_id);
288 while (1);
289 }
290
291 cpu_name = list->cpu_name;
292
293#ifdef MULTI_CPU
294 processor = *list->proc;
295#endif
296#ifdef MULTI_TLB
297 cpu_tlb = *list->tlb;
298#endif
299#ifdef MULTI_USER
300 cpu_user = *list->user;
301#endif
302#ifdef MULTI_CACHE
303 cpu_cache = *list->cache;
304#endif
305
306 printk("CPU: %s [%08x] revision %d (ARMv%s)\n",
307 cpu_name, processor_id, (int)processor_id & 15,
308 proc_arch[cpu_architecture()]);
309
310 dump_cpu_info(smp_processor_id());
311
312 sprintf(system_utsname.machine, "%s%c", list->arch_name, ENDIANNESS);
313 sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS);
314 elf_hwcap = list->elf_hwcap;
315
316 cpu_proc_init();
317}
318
319static struct machine_desc * __init setup_machine(unsigned int nr)
320{
321 struct machine_desc *list;
322
323 /*
324 * locate machine in the list of supported machines.
325 */
326 list = lookup_machine_type(nr);
327 if (!list) {
328 printk("Machine configuration botched (nr %d), unable "
329 "to continue.\n", nr);
330 while (1);
331 }
332
333 printk("Machine: %s\n", list->name);
334
335 return list;
336}
337
338static void __init early_initrd(char **p)
339{
340 unsigned long start, size;
341
342 start = memparse(*p, p);
343 if (**p == ',') {
344 size = memparse((*p) + 1, p);
345
346 phys_initrd_start = start;
347 phys_initrd_size = size;
348 }
349}
350__early_param("initrd=", early_initrd);
351
352/*
353 * Pick out the memory size. We look for mem=size@start,
354 * where start and size are "size[KkMm]"
355 */
356static void __init early_mem(char **p)
357{
358 static int usermem __initdata = 0;
359 unsigned long size, start;
360
361 /*
362 * If the user specifies memory size, we
363 * blow away any automatically generated
364 * size.
365 */
366 if (usermem == 0) {
367 usermem = 1;
368 meminfo.nr_banks = 0;
369 }
370
371 start = PHYS_OFFSET;
372 size = memparse(*p, p);
373 if (**p == '@')
374 start = memparse(*p + 1, p);
375
376 meminfo.bank[meminfo.nr_banks].start = start;
377 meminfo.bank[meminfo.nr_banks].size = size;
378 meminfo.bank[meminfo.nr_banks].node = PHYS_TO_NID(start);
379 meminfo.nr_banks += 1;
380}
381__early_param("mem=", early_mem);
382
383/*
384 * Initial parsing of the command line.
385 */
386static void __init parse_cmdline(char **cmdline_p, char *from)
387{
388 char c = ' ', *to = command_line;
389 int len = 0;
390
391 for (;;) {
392 if (c == ' ') {
393 extern struct early_params __early_begin, __early_end;
394 struct early_params *p;
395
396 for (p = &__early_begin; p < &__early_end; p++) {
397 int len = strlen(p->arg);
398
399 if (memcmp(from, p->arg, len) == 0) {
400 if (to != command_line)
401 to -= 1;
402 from += len;
403 p->fn(&from);
404
405 while (*from != ' ' && *from != '\0')
406 from++;
407 break;
408 }
409 }
410 }
411 c = *from++;
412 if (!c)
413 break;
414 if (COMMAND_LINE_SIZE <= ++len)
415 break;
416 *to++ = c;
417 }
418 *to = '\0';
419 *cmdline_p = command_line;
420}
421
422static void __init
423setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz)
424{
425#ifdef CONFIG_BLK_DEV_RAM
426 extern int rd_size, rd_image_start, rd_prompt, rd_doload;
427
428 rd_image_start = image_start;
429 rd_prompt = prompt;
430 rd_doload = doload;
431
432 if (rd_sz)
433 rd_size = rd_sz;
434#endif
435}
436
437static void __init
438request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
439{
440 struct resource *res;
441 int i;
442
443 kernel_code.start = virt_to_phys(&_text);
444 kernel_code.end = virt_to_phys(&_etext - 1);
445 kernel_data.start = virt_to_phys(&__data_start);
446 kernel_data.end = virt_to_phys(&_end - 1);
447
448 for (i = 0; i < mi->nr_banks; i++) {
449 unsigned long virt_start, virt_end;
450
451 if (mi->bank[i].size == 0)
452 continue;
453
454 virt_start = __phys_to_virt(mi->bank[i].start);
455 virt_end = virt_start + mi->bank[i].size - 1;
456
457 res = alloc_bootmem_low(sizeof(*res));
458 res->name = "System RAM";
459 res->start = __virt_to_phys(virt_start);
460 res->end = __virt_to_phys(virt_end);
461 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
462
463 request_resource(&iomem_resource, res);
464
465 if (kernel_code.start >= res->start &&
466 kernel_code.end <= res->end)
467 request_resource(res, &kernel_code);
468 if (kernel_data.start >= res->start &&
469 kernel_data.end <= res->end)
470 request_resource(res, &kernel_data);
471 }
472
473 if (mdesc->video_start) {
474 video_ram.start = mdesc->video_start;
475 video_ram.end = mdesc->video_end;
476 request_resource(&iomem_resource, &video_ram);
477 }
478
479 /*
480 * Some machines don't have the possibility of ever
481 * possessing lp0, lp1 or lp2
482 */
483 if (mdesc->reserve_lp0)
484 request_resource(&ioport_resource, &lp0);
485 if (mdesc->reserve_lp1)
486 request_resource(&ioport_resource, &lp1);
487 if (mdesc->reserve_lp2)
488 request_resource(&ioport_resource, &lp2);
489}
490
491/*
492 * Tag parsing.
493 *
494 * This is the new way of passing data to the kernel at boot time. Rather
495 * than passing a fixed inflexible structure to the kernel, we pass a list
496 * of variable-sized tags to the kernel. The first tag must be a ATAG_CORE
497 * tag for the list to be recognised (to distinguish the tagged list from
498 * a param_struct). The list is terminated with a zero-length tag (this tag
499 * is not parsed in any way).
500 */
501static int __init parse_tag_core(const struct tag *tag)
502{
503 if (tag->hdr.size > 2) {
504 if ((tag->u.core.flags & 1) == 0)
505 root_mountflags &= ~MS_RDONLY;
506 ROOT_DEV = old_decode_dev(tag->u.core.rootdev);
507 }
508 return 0;
509}
510
511__tagtable(ATAG_CORE, parse_tag_core);
512
513static int __init parse_tag_mem32(const struct tag *tag)
514{
515 if (meminfo.nr_banks >= NR_BANKS) {
516 printk(KERN_WARNING
517 "Ignoring memory bank 0x%08x size %dKB\n",
518 tag->u.mem.start, tag->u.mem.size / 1024);
519 return -EINVAL;
520 }
521 meminfo.bank[meminfo.nr_banks].start = tag->u.mem.start;
522 meminfo.bank[meminfo.nr_banks].size = tag->u.mem.size;
523 meminfo.bank[meminfo.nr_banks].node = PHYS_TO_NID(tag->u.mem.start);
524 meminfo.nr_banks += 1;
525
526 return 0;
527}
528
529__tagtable(ATAG_MEM, parse_tag_mem32);
530
531#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
532struct screen_info screen_info = {
533 .orig_video_lines = 30,
534 .orig_video_cols = 80,
535 .orig_video_mode = 0,
536 .orig_video_ega_bx = 0,
537 .orig_video_isVGA = 1,
538 .orig_video_points = 8
539};
540
541static int __init parse_tag_videotext(const struct tag *tag)
542{
543 screen_info.orig_x = tag->u.videotext.x;
544 screen_info.orig_y = tag->u.videotext.y;
545 screen_info.orig_video_page = tag->u.videotext.video_page;
546 screen_info.orig_video_mode = tag->u.videotext.video_mode;
547 screen_info.orig_video_cols = tag->u.videotext.video_cols;
548 screen_info.orig_video_ega_bx = tag->u.videotext.video_ega_bx;
549 screen_info.orig_video_lines = tag->u.videotext.video_lines;
550 screen_info.orig_video_isVGA = tag->u.videotext.video_isvga;
551 screen_info.orig_video_points = tag->u.videotext.video_points;
552 return 0;
553}
554
555__tagtable(ATAG_VIDEOTEXT, parse_tag_videotext);
556#endif
557
558static int __init parse_tag_ramdisk(const struct tag *tag)
559{
560 setup_ramdisk((tag->u.ramdisk.flags & 1) == 0,
561 (tag->u.ramdisk.flags & 2) == 0,
562 tag->u.ramdisk.start, tag->u.ramdisk.size);
563 return 0;
564}
565
566__tagtable(ATAG_RAMDISK, parse_tag_ramdisk);
567
568static int __init parse_tag_initrd(const struct tag *tag)
569{
570 printk(KERN_WARNING "ATAG_INITRD is deprecated; "
571 "please update your bootloader.\n");
572 phys_initrd_start = __virt_to_phys(tag->u.initrd.start);
573 phys_initrd_size = tag->u.initrd.size;
574 return 0;
575}
576
577__tagtable(ATAG_INITRD, parse_tag_initrd);
578
579static int __init parse_tag_initrd2(const struct tag *tag)
580{
581 phys_initrd_start = tag->u.initrd.start;
582 phys_initrd_size = tag->u.initrd.size;
583 return 0;
584}
585
586__tagtable(ATAG_INITRD2, parse_tag_initrd2);
587
588static int __init parse_tag_serialnr(const struct tag *tag)
589{
590 system_serial_low = tag->u.serialnr.low;
591 system_serial_high = tag->u.serialnr.high;
592 return 0;
593}
594
595__tagtable(ATAG_SERIAL, parse_tag_serialnr);
596
597static int __init parse_tag_revision(const struct tag *tag)
598{
599 system_rev = tag->u.revision.rev;
600 return 0;
601}
602
603__tagtable(ATAG_REVISION, parse_tag_revision);
604
605static int __init parse_tag_cmdline(const struct tag *tag)
606{
607 strlcpy(default_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE);
608 return 0;
609}
610
611__tagtable(ATAG_CMDLINE, parse_tag_cmdline);
612
613/*
614 * Scan the tag table for this tag, and call its parse function.
615 * The tag table is built by the linker from all the __tagtable
616 * declarations.
617 */
618static int __init parse_tag(const struct tag *tag)
619{
620 extern struct tagtable __tagtable_begin, __tagtable_end;
621 struct tagtable *t;
622
623 for (t = &__tagtable_begin; t < &__tagtable_end; t++)
624 if (tag->hdr.tag == t->tag) {
625 t->parse(tag);
626 break;
627 }
628
629 return t < &__tagtable_end;
630}
631
632/*
633 * Parse all tags in the list, checking both the global and architecture
634 * specific tag tables.
635 */
636static void __init parse_tags(const struct tag *t)
637{
638 for (; t->hdr.size; t = tag_next(t))
639 if (!parse_tag(t))
640 printk(KERN_WARNING
641 "Ignoring unrecognised tag 0x%08x\n",
642 t->hdr.tag);
643}
644
645/*
646 * This holds our defaults.
647 */
648static struct init_tags {
649 struct tag_header hdr1;
650 struct tag_core core;
651 struct tag_header hdr2;
652 struct tag_mem32 mem;
653 struct tag_header hdr3;
654} init_tags __initdata = {
655 { tag_size(tag_core), ATAG_CORE },
656 { 1, PAGE_SIZE, 0xff },
657 { tag_size(tag_mem32), ATAG_MEM },
658 { MEM_SIZE, PHYS_OFFSET },
659 { 0, ATAG_NONE }
660};
661
662static void (*init_machine)(void) __initdata;
663
664static int __init customize_machine(void)
665{
666 /* customizes platform devices, or adds new ones */
667 if (init_machine)
668 init_machine();
669 return 0;
670}
671arch_initcall(customize_machine);
672
673void __init setup_arch(char **cmdline_p)
674{
675 struct tag *tags = (struct tag *)&init_tags;
676 struct machine_desc *mdesc;
677 char *from = default_command_line;
678
679 setup_processor();
680 mdesc = setup_machine(machine_arch_type);
681 machine_name = mdesc->name;
682
683 if (mdesc->soft_reboot)
684 reboot_setup("s");
685
686 if (mdesc->param_offset)
687 tags = phys_to_virt(mdesc->param_offset);
688
689 /*
690 * If we have the old style parameters, convert them to
691 * a tag list.
692 */
693 if (tags->hdr.tag != ATAG_CORE)
694 convert_to_tag_list(tags);
695 if (tags->hdr.tag != ATAG_CORE)
696 tags = (struct tag *)&init_tags;
697
698 if (mdesc->fixup)
699 mdesc->fixup(mdesc, tags, &from, &meminfo);
700
701 if (tags->hdr.tag == ATAG_CORE) {
702 if (meminfo.nr_banks != 0)
703 squash_mem_tags(tags);
704 parse_tags(tags);
705 }
706
707 init_mm.start_code = (unsigned long) &_text;
708 init_mm.end_code = (unsigned long) &_etext;
709 init_mm.end_data = (unsigned long) &_edata;
710 init_mm.brk = (unsigned long) &_end;
711
712 memcpy(saved_command_line, from, COMMAND_LINE_SIZE);
713 saved_command_line[COMMAND_LINE_SIZE-1] = '\0';
714 parse_cmdline(cmdline_p, from);
715 paging_init(&meminfo, mdesc);
716 request_standard_resources(&meminfo, mdesc);
717
718 /*
719 * Set up various architecture-specific pointers
720 */
721 init_arch_irq = mdesc->init_irq;
722 system_timer = mdesc->timer;
723 init_machine = mdesc->init_machine;
724
725#ifdef CONFIG_VT
726#if defined(CONFIG_VGA_CONSOLE)
727 conswitchp = &vga_con;
728#elif defined(CONFIG_DUMMY_CONSOLE)
729 conswitchp = &dummy_con;
730#endif
731#endif
732}
733
734
735static int __init topology_init(void)
736{
737 int cpu;
738
739 for_each_cpu(cpu)
740 register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu, NULL);
741
742 return 0;
743}
744
745subsys_initcall(topology_init);
746
747static const char *hwcap_str[] = {
748 "swp",
749 "half",
750 "thumb",
751 "26bit",
752 "fastmult",
753 "fpa",
754 "vfp",
755 "edsp",
756 "java",
757 NULL
758};
759
760static void
761c_show_cache(struct seq_file *m, const char *type, unsigned int cache)
762{
763 unsigned int mult = 2 + (CACHE_M(cache) ? 1 : 0);
764
765 seq_printf(m, "%s size\t\t: %d\n"
766 "%s assoc\t\t: %d\n"
767 "%s line length\t: %d\n"
768 "%s sets\t\t: %d\n",
769 type, mult << (8 + CACHE_SIZE(cache)),
770 type, (mult << CACHE_ASSOC(cache)) >> 1,
771 type, 8 << CACHE_LINE(cache),
772 type, 1 << (6 + CACHE_SIZE(cache) - CACHE_ASSOC(cache) -
773 CACHE_LINE(cache)));
774}
775
776static int c_show(struct seq_file *m, void *v)
777{
778 int i;
779
780 seq_printf(m, "Processor\t: %s rev %d (%s)\n",
781 cpu_name, (int)processor_id & 15, elf_platform);
782
783#if defined(CONFIG_SMP)
784 for_each_online_cpu(i) {
785 seq_printf(m, "Processor\t: %d\n", i);
786 seq_printf(m, "BogoMIPS\t: %lu.%02lu\n\n",
787 per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ),
788 (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100);
789 }
790#else /* CONFIG_SMP */
791 seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
792 loops_per_jiffy / (500000/HZ),
793 (loops_per_jiffy / (5000/HZ)) % 100);
794#endif
795
796 /* dump out the processor features */
797 seq_puts(m, "Features\t: ");
798
799 for (i = 0; hwcap_str[i]; i++)
800 if (elf_hwcap & (1 << i))
801 seq_printf(m, "%s ", hwcap_str[i]);
802
803 seq_printf(m, "\nCPU implementer\t: 0x%02x\n", processor_id >> 24);
804 seq_printf(m, "CPU architecture: %s\n", proc_arch[cpu_architecture()]);
805
806 if ((processor_id & 0x0000f000) == 0x00000000) {
807 /* pre-ARM7 */
808 seq_printf(m, "CPU part\t\t: %07x\n", processor_id >> 4);
809 } else {
810 if ((processor_id & 0x0000f000) == 0x00007000) {
811 /* ARM7 */
812 seq_printf(m, "CPU variant\t: 0x%02x\n",
813 (processor_id >> 16) & 127);
814 } else {
815 /* post-ARM7 */
816 seq_printf(m, "CPU variant\t: 0x%x\n",
817 (processor_id >> 20) & 15);
818 }
819 seq_printf(m, "CPU part\t: 0x%03x\n",
820 (processor_id >> 4) & 0xfff);
821 }
822 seq_printf(m, "CPU revision\t: %d\n", processor_id & 15);
823
824 {
825 unsigned int cache_info = read_cpuid(CPUID_CACHETYPE);
826 if (cache_info != processor_id) {
827 seq_printf(m, "Cache type\t: %s\n"
828 "Cache clean\t: %s\n"
829 "Cache lockdown\t: %s\n"
830 "Cache format\t: %s\n",
831 cache_types[CACHE_TYPE(cache_info)],
832 cache_clean[CACHE_TYPE(cache_info)],
833 cache_lockdown[CACHE_TYPE(cache_info)],
834 CACHE_S(cache_info) ? "Harvard" : "Unified");
835
836 if (CACHE_S(cache_info)) {
837 c_show_cache(m, "I", CACHE_ISIZE(cache_info));
838 c_show_cache(m, "D", CACHE_DSIZE(cache_info));
839 } else {
840 c_show_cache(m, "Cache", CACHE_ISIZE(cache_info));
841 }
842 }
843 }
844
845 seq_puts(m, "\n");
846
847 seq_printf(m, "Hardware\t: %s\n", machine_name);
848 seq_printf(m, "Revision\t: %04x\n", system_rev);
849 seq_printf(m, "Serial\t\t: %08x%08x\n",
850 system_serial_high, system_serial_low);
851
852 return 0;
853}
854
855static void *c_start(struct seq_file *m, loff_t *pos)
856{
857 return *pos < 1 ? (void *)1 : NULL;
858}
859
860static void *c_next(struct seq_file *m, void *v, loff_t *pos)
861{
862 ++*pos;
863 return NULL;
864}
865
866static void c_stop(struct seq_file *m, void *v)
867{
868}
869
870struct seq_operations cpuinfo_op = {
871 .start = c_start,
872 .next = c_next,
873 .stop = c_stop,
874 .show = c_show
875};
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
new file mode 100644
index 000000000000..931919fd5121
--- /dev/null
+++ b/arch/arm/kernel/signal.c
@@ -0,0 +1,748 @@
1/*
2 * linux/arch/arm/kernel/signal.c
3 *
4 * Copyright (C) 1995-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/config.h>
11#include <linux/errno.h>
12#include <linux/signal.h>
13#include <linux/ptrace.h>
14#include <linux/personality.h>
15
16#include <asm/cacheflush.h>
17#include <asm/ucontext.h>
18#include <asm/uaccess.h>
19#include <asm/unistd.h>
20
21#include "ptrace.h"
22
23#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
24
25/*
26 * For ARM syscalls, we encode the syscall number into the instruction.
27 */
28#define SWI_SYS_SIGRETURN (0xef000000|(__NR_sigreturn))
29#define SWI_SYS_RT_SIGRETURN (0xef000000|(__NR_rt_sigreturn))
30
31/*
32 * For Thumb syscalls, we pass the syscall number via r7. We therefore
33 * need two 16-bit instructions.
34 */
35#define SWI_THUMB_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_sigreturn - __NR_SYSCALL_BASE))
36#define SWI_THUMB_RT_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE))
37
38static const unsigned long retcodes[4] = {
39 SWI_SYS_SIGRETURN, SWI_THUMB_SIGRETURN,
40 SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN
41};
42
43static int do_signal(sigset_t *oldset, struct pt_regs * regs, int syscall);
44
45/*
46 * atomically swap in the new signal mask, and wait for a signal.
47 */
48asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, old_sigset_t mask, struct pt_regs *regs)
49{
50 sigset_t saveset;
51
52 mask &= _BLOCKABLE;
53 spin_lock_irq(&current->sighand->siglock);
54 saveset = current->blocked;
55 siginitset(&current->blocked, mask);
56 recalc_sigpending();
57 spin_unlock_irq(&current->sighand->siglock);
58 regs->ARM_r0 = -EINTR;
59
60 while (1) {
61 current->state = TASK_INTERRUPTIBLE;
62 schedule();
63 if (do_signal(&saveset, regs, 0))
64 return regs->ARM_r0;
65 }
66}
67
68asmlinkage int
69sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, struct pt_regs *regs)
70{
71 sigset_t saveset, newset;
72
73 /* XXX: Don't preclude handling different sized sigset_t's. */
74 if (sigsetsize != sizeof(sigset_t))
75 return -EINVAL;
76
77 if (copy_from_user(&newset, unewset, sizeof(newset)))
78 return -EFAULT;
79 sigdelsetmask(&newset, ~_BLOCKABLE);
80
81 spin_lock_irq(&current->sighand->siglock);
82 saveset = current->blocked;
83 current->blocked = newset;
84 recalc_sigpending();
85 spin_unlock_irq(&current->sighand->siglock);
86 regs->ARM_r0 = -EINTR;
87
88 while (1) {
89 current->state = TASK_INTERRUPTIBLE;
90 schedule();
91 if (do_signal(&saveset, regs, 0))
92 return regs->ARM_r0;
93 }
94}
95
96asmlinkage int
97sys_sigaction(int sig, const struct old_sigaction __user *act,
98 struct old_sigaction __user *oact)
99{
100 struct k_sigaction new_ka, old_ka;
101 int ret;
102
103 if (act) {
104 old_sigset_t mask;
105 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
106 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
107 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
108 return -EFAULT;
109 __get_user(new_ka.sa.sa_flags, &act->sa_flags);
110 __get_user(mask, &act->sa_mask);
111 siginitset(&new_ka.sa.sa_mask, mask);
112 }
113
114 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
115
116 if (!ret && oact) {
117 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
118 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
119 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
120 return -EFAULT;
121 __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
122 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
123 }
124
125 return ret;
126}
127
128#ifdef CONFIG_IWMMXT
129
130/* iwmmxt_area is 0x98 bytes long, preceeded by 8 bytes of signature */
131#define IWMMXT_STORAGE_SIZE (0x98 + 8)
132#define IWMMXT_MAGIC0 0x12ef842a
133#define IWMMXT_MAGIC1 0x1c07ca71
134
135struct iwmmxt_sigframe {
136 unsigned long magic0;
137 unsigned long magic1;
138 unsigned long storage[0x98/4];
139};
140
141static int page_present(struct mm_struct *mm, void __user *uptr, int wr)
142{
143 unsigned long addr = (unsigned long)uptr;
144 pgd_t *pgd = pgd_offset(mm, addr);
145 if (pgd_present(*pgd)) {
146 pmd_t *pmd = pmd_offset(pgd, addr);
147 if (pmd_present(*pmd)) {
148 pte_t *pte = pte_offset_map(pmd, addr);
149 return (pte_present(*pte) && (!wr || pte_write(*pte)));
150 }
151 }
152 return 0;
153}
154
155static int copy_locked(void __user *uptr, void *kptr, size_t size, int write,
156 void (*copyfn)(void *, void __user *))
157{
158 unsigned char v, __user *userptr = uptr;
159 int err = 0;
160
161 do {
162 struct mm_struct *mm;
163
164 if (write) {
165 __put_user_error(0, userptr, err);
166 __put_user_error(0, userptr + size - 1, err);
167 } else {
168 __get_user_error(v, userptr, err);
169 __get_user_error(v, userptr + size - 1, err);
170 }
171
172 if (err)
173 break;
174
175 mm = current->mm;
176 spin_lock(&mm->page_table_lock);
177 if (page_present(mm, userptr, write) &&
178 page_present(mm, userptr + size - 1, write)) {
179 copyfn(kptr, uptr);
180 } else
181 err = 1;
182 spin_unlock(&mm->page_table_lock);
183 } while (err);
184
185 return err;
186}
187
188static int preserve_iwmmxt_context(struct iwmmxt_sigframe *frame)
189{
190 int err = 0;
191
192 /* the iWMMXt context must be 64 bit aligned */
193 WARN_ON((unsigned long)frame & 7);
194
195 __put_user_error(IWMMXT_MAGIC0, &frame->magic0, err);
196 __put_user_error(IWMMXT_MAGIC1, &frame->magic1, err);
197
198 /*
199 * iwmmxt_task_copy() doesn't check user permissions.
200 * Let's do a dummy write on the upper boundary to ensure
201 * access to user mem is OK all way up.
202 */
203 err |= copy_locked(&frame->storage, current_thread_info(),
204 sizeof(frame->storage), 1, iwmmxt_task_copy);
205 return err;
206}
207
208static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame)
209{
210 unsigned long magic0, magic1;
211 int err = 0;
212
213 /* the iWMMXt context is 64 bit aligned */
214 WARN_ON((unsigned long)frame & 7);
215
216 /*
217 * Validate iWMMXt context signature.
218 * Also, iwmmxt_task_restore() doesn't check user permissions.
219 * Let's do a dummy write on the upper boundary to ensure
220 * access to user mem is OK all way up.
221 */
222 __get_user_error(magic0, &frame->magic0, err);
223 __get_user_error(magic1, &frame->magic1, err);
224 if (!err && magic0 == IWMMXT_MAGIC0 && magic1 == IWMMXT_MAGIC1)
225 err = copy_locked(&frame->storage, current_thread_info(),
226 sizeof(frame->storage), 0, iwmmxt_task_restore);
227 return err;
228}
229
230#endif
231
232/*
233 * Auxiliary signal frame. This saves stuff like FP state.
234 * The layout of this structure is not part of the user ABI.
235 */
236struct aux_sigframe {
237#ifdef CONFIG_IWMMXT
238 struct iwmmxt_sigframe iwmmxt;
239#endif
240#ifdef CONFIG_VFP
241 union vfp_state vfp;
242#endif
243};
244
245/*
246 * Do a signal return; undo the signal stack. These are aligned to 64-bit.
247 */
248struct sigframe {
249 struct sigcontext sc;
250 unsigned long extramask[_NSIG_WORDS-1];
251 unsigned long retcode;
252 struct aux_sigframe aux __attribute__((aligned(8)));
253};
254
255struct rt_sigframe {
256 struct siginfo __user *pinfo;
257 void __user *puc;
258 struct siginfo info;
259 struct ucontext uc;
260 unsigned long retcode;
261 struct aux_sigframe aux __attribute__((aligned(8)));
262};
263
264static int
265restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
266 struct aux_sigframe __user *aux)
267{
268 int err = 0;
269
270 __get_user_error(regs->ARM_r0, &sc->arm_r0, err);
271 __get_user_error(regs->ARM_r1, &sc->arm_r1, err);
272 __get_user_error(regs->ARM_r2, &sc->arm_r2, err);
273 __get_user_error(regs->ARM_r3, &sc->arm_r3, err);
274 __get_user_error(regs->ARM_r4, &sc->arm_r4, err);
275 __get_user_error(regs->ARM_r5, &sc->arm_r5, err);
276 __get_user_error(regs->ARM_r6, &sc->arm_r6, err);
277 __get_user_error(regs->ARM_r7, &sc->arm_r7, err);
278 __get_user_error(regs->ARM_r8, &sc->arm_r8, err);
279 __get_user_error(regs->ARM_r9, &sc->arm_r9, err);
280 __get_user_error(regs->ARM_r10, &sc->arm_r10, err);
281 __get_user_error(regs->ARM_fp, &sc->arm_fp, err);
282 __get_user_error(regs->ARM_ip, &sc->arm_ip, err);
283 __get_user_error(regs->ARM_sp, &sc->arm_sp, err);
284 __get_user_error(regs->ARM_lr, &sc->arm_lr, err);
285 __get_user_error(regs->ARM_pc, &sc->arm_pc, err);
286 __get_user_error(regs->ARM_cpsr, &sc->arm_cpsr, err);
287
288 err |= !valid_user_regs(regs);
289
290#ifdef CONFIG_IWMMXT
291 if (err == 0 && test_thread_flag(TIF_USING_IWMMXT))
292 err |= restore_iwmmxt_context(&aux->iwmmxt);
293#endif
294#ifdef CONFIG_VFP
295// if (err == 0)
296// err |= vfp_restore_state(&aux->vfp);
297#endif
298
299 return err;
300}
301
302asmlinkage int sys_sigreturn(struct pt_regs *regs)
303{
304 struct sigframe __user *frame;
305 sigset_t set;
306
307 /* Always make any pending restarted system calls return -EINTR */
308 current_thread_info()->restart_block.fn = do_no_restart_syscall;
309
310 /*
311 * Since we stacked the signal on a 64-bit boundary,
312 * then 'sp' should be word aligned here. If it's
313 * not, then the user is trying to mess with us.
314 */
315 if (regs->ARM_sp & 7)
316 goto badframe;
317
318 frame = (struct sigframe __user *)regs->ARM_sp;
319
320 if (!access_ok(VERIFY_READ, frame, sizeof (*frame)))
321 goto badframe;
322 if (__get_user(set.sig[0], &frame->sc.oldmask)
323 || (_NSIG_WORDS > 1
324 && __copy_from_user(&set.sig[1], &frame->extramask,
325 sizeof(frame->extramask))))
326 goto badframe;
327
328 sigdelsetmask(&set, ~_BLOCKABLE);
329 spin_lock_irq(&current->sighand->siglock);
330 current->blocked = set;
331 recalc_sigpending();
332 spin_unlock_irq(&current->sighand->siglock);
333
334 if (restore_sigcontext(regs, &frame->sc, &frame->aux))
335 goto badframe;
336
337 /* Send SIGTRAP if we're single-stepping */
338 if (current->ptrace & PT_SINGLESTEP) {
339 ptrace_cancel_bpt(current);
340 send_sig(SIGTRAP, current, 1);
341 }
342
343 return regs->ARM_r0;
344
345badframe:
346 force_sig(SIGSEGV, current);
347 return 0;
348}
349
350asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
351{
352 struct rt_sigframe __user *frame;
353 sigset_t set;
354
355 /* Always make any pending restarted system calls return -EINTR */
356 current_thread_info()->restart_block.fn = do_no_restart_syscall;
357
358 /*
359 * Since we stacked the signal on a 64-bit boundary,
360 * then 'sp' should be word aligned here. If it's
361 * not, then the user is trying to mess with us.
362 */
363 if (regs->ARM_sp & 7)
364 goto badframe;
365
366 frame = (struct rt_sigframe __user *)regs->ARM_sp;
367
368 if (!access_ok(VERIFY_READ, frame, sizeof (*frame)))
369 goto badframe;
370 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
371 goto badframe;
372
373 sigdelsetmask(&set, ~_BLOCKABLE);
374 spin_lock_irq(&current->sighand->siglock);
375 current->blocked = set;
376 recalc_sigpending();
377 spin_unlock_irq(&current->sighand->siglock);
378
379 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &frame->aux))
380 goto badframe;
381
382 if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT)
383 goto badframe;
384
385 /* Send SIGTRAP if we're single-stepping */
386 if (current->ptrace & PT_SINGLESTEP) {
387 ptrace_cancel_bpt(current);
388 send_sig(SIGTRAP, current, 1);
389 }
390
391 return regs->ARM_r0;
392
393badframe:
394 force_sig(SIGSEGV, current);
395 return 0;
396}
397
398static int
399setup_sigcontext(struct sigcontext __user *sc, struct aux_sigframe __user *aux,
400 struct pt_regs *regs, unsigned long mask)
401{
402 int err = 0;
403
404 __put_user_error(regs->ARM_r0, &sc->arm_r0, err);
405 __put_user_error(regs->ARM_r1, &sc->arm_r1, err);
406 __put_user_error(regs->ARM_r2, &sc->arm_r2, err);
407 __put_user_error(regs->ARM_r3, &sc->arm_r3, err);
408 __put_user_error(regs->ARM_r4, &sc->arm_r4, err);
409 __put_user_error(regs->ARM_r5, &sc->arm_r5, err);
410 __put_user_error(regs->ARM_r6, &sc->arm_r6, err);
411 __put_user_error(regs->ARM_r7, &sc->arm_r7, err);
412 __put_user_error(regs->ARM_r8, &sc->arm_r8, err);
413 __put_user_error(regs->ARM_r9, &sc->arm_r9, err);
414 __put_user_error(regs->ARM_r10, &sc->arm_r10, err);
415 __put_user_error(regs->ARM_fp, &sc->arm_fp, err);
416 __put_user_error(regs->ARM_ip, &sc->arm_ip, err);
417 __put_user_error(regs->ARM_sp, &sc->arm_sp, err);
418 __put_user_error(regs->ARM_lr, &sc->arm_lr, err);
419 __put_user_error(regs->ARM_pc, &sc->arm_pc, err);
420 __put_user_error(regs->ARM_cpsr, &sc->arm_cpsr, err);
421
422 __put_user_error(current->thread.trap_no, &sc->trap_no, err);
423 __put_user_error(current->thread.error_code, &sc->error_code, err);
424 __put_user_error(current->thread.address, &sc->fault_address, err);
425 __put_user_error(mask, &sc->oldmask, err);
426
427#ifdef CONFIG_IWMMXT
428 if (err == 0 && test_thread_flag(TIF_USING_IWMMXT))
429 err |= preserve_iwmmxt_context(&aux->iwmmxt);
430#endif
431#ifdef CONFIG_VFP
432// if (err == 0)
433// err |= vfp_save_state(&aux->vfp);
434#endif
435
436 return err;
437}
438
439static inline void __user *
440get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, int framesize)
441{
442 unsigned long sp = regs->ARM_sp;
443 void __user *frame;
444
445 /*
446 * This is the X/Open sanctioned signal stack switching.
447 */
448 if ((ka->sa.sa_flags & SA_ONSTACK) && !sas_ss_flags(sp))
449 sp = current->sas_ss_sp + current->sas_ss_size;
450
451 /*
452 * ATPCS B01 mandates 8-byte alignment
453 */
454 frame = (void __user *)((sp - framesize) & ~7);
455
456 /*
457 * Check that we can actually write to the signal frame.
458 */
459 if (!access_ok(VERIFY_WRITE, frame, framesize))
460 frame = NULL;
461
462 return frame;
463}
464
465static int
466setup_return(struct pt_regs *regs, struct k_sigaction *ka,
467 unsigned long __user *rc, void __user *frame, int usig)
468{
469 unsigned long handler = (unsigned long)ka->sa.sa_handler;
470 unsigned long retcode;
471 int thumb = 0;
472 unsigned long cpsr = regs->ARM_cpsr & ~PSR_f;
473
474 /*
475 * Maybe we need to deliver a 32-bit signal to a 26-bit task.
476 */
477 if (ka->sa.sa_flags & SA_THIRTYTWO)
478 cpsr = (cpsr & ~MODE_MASK) | USR_MODE;
479
480#ifdef CONFIG_ARM_THUMB
481 if (elf_hwcap & HWCAP_THUMB) {
482 /*
483 * The LSB of the handler determines if we're going to
484 * be using THUMB or ARM mode for this signal handler.
485 */
486 thumb = handler & 1;
487
488 if (thumb)
489 cpsr |= PSR_T_BIT;
490 else
491 cpsr &= ~PSR_T_BIT;
492 }
493#endif
494
495 if (ka->sa.sa_flags & SA_RESTORER) {
496 retcode = (unsigned long)ka->sa.sa_restorer;
497 } else {
498 unsigned int idx = thumb;
499
500 if (ka->sa.sa_flags & SA_SIGINFO)
501 idx += 2;
502
503 if (__put_user(retcodes[idx], rc))
504 return 1;
505
506 /*
507 * Ensure that the instruction cache sees
508 * the return code written onto the stack.
509 */
510 flush_icache_range((unsigned long)rc,
511 (unsigned long)(rc + 1));
512
513 retcode = ((unsigned long)rc) + thumb;
514 }
515
516 regs->ARM_r0 = usig;
517 regs->ARM_sp = (unsigned long)frame;
518 regs->ARM_lr = retcode;
519 regs->ARM_pc = handler;
520 regs->ARM_cpsr = cpsr;
521
522 return 0;
523}
524
525static int
526setup_frame(int usig, struct k_sigaction *ka, sigset_t *set, struct pt_regs *regs)
527{
528 struct sigframe __user *frame = get_sigframe(ka, regs, sizeof(*frame));
529 int err = 0;
530
531 if (!frame)
532 return 1;
533
534 err |= setup_sigcontext(&frame->sc, &frame->aux, regs, set->sig[0]);
535
536 if (_NSIG_WORDS > 1) {
537 err |= __copy_to_user(frame->extramask, &set->sig[1],
538 sizeof(frame->extramask));
539 }
540
541 if (err == 0)
542 err = setup_return(regs, ka, &frame->retcode, frame, usig);
543
544 return err;
545}
546
547static int
548setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
549 sigset_t *set, struct pt_regs *regs)
550{
551 struct rt_sigframe __user *frame = get_sigframe(ka, regs, sizeof(*frame));
552 stack_t stack;
553 int err = 0;
554
555 if (!frame)
556 return 1;
557
558 __put_user_error(&frame->info, &frame->pinfo, err);
559 __put_user_error(&frame->uc, &frame->puc, err);
560 err |= copy_siginfo_to_user(&frame->info, info);
561
562 __put_user_error(0, &frame->uc.uc_flags, err);
563 __put_user_error(NULL, &frame->uc.uc_link, err);
564
565 memset(&stack, 0, sizeof(stack));
566 stack.ss_sp = (void __user *)current->sas_ss_sp;
567 stack.ss_flags = sas_ss_flags(regs->ARM_sp);
568 stack.ss_size = current->sas_ss_size;
569 err |= __copy_to_user(&frame->uc.uc_stack, &stack, sizeof(stack));
570
571 err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->aux,
572 regs, set->sig[0]);
573 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
574
575 if (err == 0)
576 err = setup_return(regs, ka, &frame->retcode, frame, usig);
577
578 if (err == 0) {
579 /*
580 * For realtime signals we must also set the second and third
581 * arguments for the signal handler.
582 * -- Peter Maydell <pmaydell@chiark.greenend.org.uk> 2000-12-06
583 */
584 regs->ARM_r1 = (unsigned long)&frame->info;
585 regs->ARM_r2 = (unsigned long)&frame->uc;
586 }
587
588 return err;
589}
590
591static inline void restart_syscall(struct pt_regs *regs)
592{
593 regs->ARM_r0 = regs->ARM_ORIG_r0;
594 regs->ARM_pc -= thumb_mode(regs) ? 2 : 4;
595}
596
597/*
598 * OK, we're invoking a handler
599 */
600static void
601handle_signal(unsigned long sig, struct k_sigaction *ka,
602 siginfo_t *info, sigset_t *oldset,
603 struct pt_regs * regs, int syscall)
604{
605 struct thread_info *thread = current_thread_info();
606 struct task_struct *tsk = current;
607 int usig = sig;
608 int ret;
609
610 /*
611 * If we were from a system call, check for system call restarting...
612 */
613 if (syscall) {
614 switch (regs->ARM_r0) {
615 case -ERESTART_RESTARTBLOCK:
616 case -ERESTARTNOHAND:
617 regs->ARM_r0 = -EINTR;
618 break;
619 case -ERESTARTSYS:
620 if (!(ka->sa.sa_flags & SA_RESTART)) {
621 regs->ARM_r0 = -EINTR;
622 break;
623 }
624 /* fallthrough */
625 case -ERESTARTNOINTR:
626 restart_syscall(regs);
627 }
628 }
629
630 /*
631 * translate the signal
632 */
633 if (usig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap)
634 usig = thread->exec_domain->signal_invmap[usig];
635
636 /*
637 * Set up the stack frame
638 */
639 if (ka->sa.sa_flags & SA_SIGINFO)
640 ret = setup_rt_frame(usig, ka, info, oldset, regs);
641 else
642 ret = setup_frame(usig, ka, oldset, regs);
643
644 /*
645 * Check that the resulting registers are actually sane.
646 */
647 ret |= !valid_user_regs(regs);
648
649 /*
650 * Block the signal if we were unsuccessful.
651 */
652 if (ret != 0 || !(ka->sa.sa_flags & SA_NODEFER)) {
653 spin_lock_irq(&tsk->sighand->siglock);
654 sigorsets(&tsk->blocked, &tsk->blocked,
655 &ka->sa.sa_mask);
656 sigaddset(&tsk->blocked, sig);
657 recalc_sigpending();
658 spin_unlock_irq(&tsk->sighand->siglock);
659 }
660
661 if (ret == 0)
662 return;
663
664 force_sigsegv(sig, tsk);
665}
666
667/*
668 * Note that 'init' is a special process: it doesn't get signals it doesn't
669 * want to handle. Thus you cannot kill init even with a SIGKILL even by
670 * mistake.
671 *
672 * Note that we go through the signals twice: once to check the signals that
673 * the kernel can handle, and then we build all the user-level signal handling
674 * stack-frames in one go after that.
675 */
676static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
677{
678 struct k_sigaction ka;
679 siginfo_t info;
680 int signr;
681
682 /*
683 * We want the common case to go fast, which
684 * is why we may in certain cases get here from
685 * kernel mode. Just return without doing anything
686 * if so.
687 */
688 if (!user_mode(regs))
689 return 0;
690
691 if (try_to_freeze(0))
692 goto no_signal;
693
694 if (current->ptrace & PT_SINGLESTEP)
695 ptrace_cancel_bpt(current);
696
697 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
698 if (signr > 0) {
699 handle_signal(signr, &ka, &info, oldset, regs, syscall);
700 if (current->ptrace & PT_SINGLESTEP)
701 ptrace_set_bpt(current);
702 return 1;
703 }
704
705 no_signal:
706 /*
707 * No signal to deliver to the process - restart the syscall.
708 */
709 if (syscall) {
710 if (regs->ARM_r0 == -ERESTART_RESTARTBLOCK) {
711 if (thumb_mode(regs)) {
712 regs->ARM_r7 = __NR_restart_syscall;
713 regs->ARM_pc -= 2;
714 } else {
715 u32 __user *usp;
716
717 regs->ARM_sp -= 12;
718 usp = (u32 __user *)regs->ARM_sp;
719
720 put_user(regs->ARM_pc, &usp[0]);
721 /* swi __NR_restart_syscall */
722 put_user(0xef000000 | __NR_restart_syscall, &usp[1]);
723 /* ldr pc, [sp], #12 */
724 put_user(0xe49df00c, &usp[2]);
725
726 flush_icache_range((unsigned long)usp,
727 (unsigned long)(usp + 3));
728
729 regs->ARM_pc = regs->ARM_sp + 4;
730 }
731 }
732 if (regs->ARM_r0 == -ERESTARTNOHAND ||
733 regs->ARM_r0 == -ERESTARTSYS ||
734 regs->ARM_r0 == -ERESTARTNOINTR) {
735 restart_syscall(regs);
736 }
737 }
738 if (current->ptrace & PT_SINGLESTEP)
739 ptrace_set_bpt(current);
740 return 0;
741}
742
743asmlinkage void
744do_notify_resume(struct pt_regs *regs, unsigned int thread_flags, int syscall)
745{
746 if (thread_flags & _TIF_SIGPENDING)
747 do_signal(&current->blocked, regs, syscall);
748}
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
new file mode 100644
index 000000000000..ecc8c3332408
--- /dev/null
+++ b/arch/arm/kernel/smp.c
@@ -0,0 +1,396 @@
1/*
2 * linux/arch/arm/kernel/smp.c
3 *
4 * Copyright (C) 2002 ARM Limited, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/config.h>
11#include <linux/delay.h>
12#include <linux/init.h>
13#include <linux/spinlock.h>
14#include <linux/sched.h>
15#include <linux/interrupt.h>
16#include <linux/cache.h>
17#include <linux/profile.h>
18#include <linux/errno.h>
19#include <linux/mm.h>
20#include <linux/cpu.h>
21#include <linux/smp.h>
22#include <linux/seq_file.h>
23
24#include <asm/atomic.h>
25#include <asm/cacheflush.h>
26#include <asm/cpu.h>
27#include <asm/processor.h>
28#include <asm/tlbflush.h>
29#include <asm/ptrace.h>
30
31/*
32 * bitmask of present and online CPUs.
33 * The present bitmask indicates that the CPU is physically present.
34 * The online bitmask indicates that the CPU is up and running.
35 */
36cpumask_t cpu_present_mask;
37cpumask_t cpu_online_map;
38
39/*
40 * structures for inter-processor calls
41 * - A collection of single bit ipi messages.
42 */
43struct ipi_data {
44 spinlock_t lock;
45 unsigned long ipi_count;
46 unsigned long bits;
47};
48
49static DEFINE_PER_CPU(struct ipi_data, ipi_data) = {
50 .lock = SPIN_LOCK_UNLOCKED,
51};
52
53enum ipi_msg_type {
54 IPI_TIMER,
55 IPI_RESCHEDULE,
56 IPI_CALL_FUNC,
57 IPI_CPU_STOP,
58};
59
60struct smp_call_struct {
61 void (*func)(void *info);
62 void *info;
63 int wait;
64 cpumask_t pending;
65 cpumask_t unfinished;
66};
67
68static struct smp_call_struct * volatile smp_call_function_data;
69static DEFINE_SPINLOCK(smp_call_function_lock);
70
71int __init __cpu_up(unsigned int cpu)
72{
73 struct task_struct *idle;
74 int ret;
75
76 /*
77 * Spawn a new process manually. Grab a pointer to
78 * its task struct so we can mess with it
79 */
80 idle = fork_idle(cpu);
81 if (IS_ERR(idle)) {
82 printk(KERN_ERR "CPU%u: fork() failed\n", cpu);
83 return PTR_ERR(idle);
84 }
85
86 /*
87 * Now bring the CPU into our world.
88 */
89 ret = boot_secondary(cpu, idle);
90 if (ret) {
91 printk(KERN_CRIT "cpu_up: processor %d failed to boot\n", cpu);
92 /*
93 * FIXME: We need to clean up the new idle thread. --rmk
94 */
95 }
96
97 return ret;
98}
99
100/*
101 * Called by both boot and secondaries to move global data into
102 * per-processor storage.
103 */
104void __init smp_store_cpu_info(unsigned int cpuid)
105{
106 struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);
107
108 cpu_info->loops_per_jiffy = loops_per_jiffy;
109}
110
111void __init smp_cpus_done(unsigned int max_cpus)
112{
113 int cpu;
114 unsigned long bogosum = 0;
115
116 for_each_online_cpu(cpu)
117 bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy;
118
119 printk(KERN_INFO "SMP: Total of %d processors activated "
120 "(%lu.%02lu BogoMIPS).\n",
121 num_online_cpus(),
122 bogosum / (500000/HZ),
123 (bogosum / (5000/HZ)) % 100);
124}
125
126void __init smp_prepare_boot_cpu(void)
127{
128 unsigned int cpu = smp_processor_id();
129
130 cpu_set(cpu, cpu_present_mask);
131 cpu_set(cpu, cpu_online_map);
132}
133
134static void send_ipi_message(cpumask_t callmap, enum ipi_msg_type msg)
135{
136 unsigned long flags;
137 unsigned int cpu;
138
139 local_irq_save(flags);
140
141 for_each_cpu_mask(cpu, callmap) {
142 struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
143
144 spin_lock(&ipi->lock);
145 ipi->bits |= 1 << msg;
146 spin_unlock(&ipi->lock);
147 }
148
149 /*
150 * Call the platform specific cross-CPU call function.
151 */
152 smp_cross_call(callmap);
153
154 local_irq_restore(flags);
155}
156
157/*
158 * You must not call this function with disabled interrupts, from a
159 * hardware interrupt handler, nor from a bottom half handler.
160 */
161int smp_call_function_on_cpu(void (*func)(void *info), void *info, int retry,
162 int wait, cpumask_t callmap)
163{
164 struct smp_call_struct data;
165 unsigned long timeout;
166 int ret = 0;
167
168 data.func = func;
169 data.info = info;
170 data.wait = wait;
171
172 cpu_clear(smp_processor_id(), callmap);
173 if (cpus_empty(callmap))
174 goto out;
175
176 data.pending = callmap;
177 if (wait)
178 data.unfinished = callmap;
179
180 /*
181 * try to get the mutex on smp_call_function_data
182 */
183 spin_lock(&smp_call_function_lock);
184 smp_call_function_data = &data;
185
186 send_ipi_message(callmap, IPI_CALL_FUNC);
187
188 timeout = jiffies + HZ;
189 while (!cpus_empty(data.pending) && time_before(jiffies, timeout))
190 barrier();
191
192 /*
193 * did we time out?
194 */
195 if (!cpus_empty(data.pending)) {
196 /*
197 * this may be causing our panic - report it
198 */
199 printk(KERN_CRIT
200 "CPU%u: smp_call_function timeout for %p(%p)\n"
201 " callmap %lx pending %lx, %swait\n",
202 smp_processor_id(), func, info, callmap, data.pending,
203 wait ? "" : "no ");
204
205 /*
206 * TRACE
207 */
208 timeout = jiffies + (5 * HZ);
209 while (!cpus_empty(data.pending) && time_before(jiffies, timeout))
210 barrier();
211
212 if (cpus_empty(data.pending))
213 printk(KERN_CRIT " RESOLVED\n");
214 else
215 printk(KERN_CRIT " STILL STUCK\n");
216 }
217
218 /*
219 * whatever happened, we're done with the data, so release it
220 */
221 smp_call_function_data = NULL;
222 spin_unlock(&smp_call_function_lock);
223
224 if (!cpus_empty(data.pending)) {
225 ret = -ETIMEDOUT;
226 goto out;
227 }
228
229 if (wait)
230 while (!cpus_empty(data.unfinished))
231 barrier();
232 out:
233
234 return 0;
235}
236
237int smp_call_function(void (*func)(void *info), void *info, int retry,
238 int wait)
239{
240 return smp_call_function_on_cpu(func, info, retry, wait,
241 cpu_online_map);
242}
243
244void show_ipi_list(struct seq_file *p)
245{
246 unsigned int cpu;
247
248 seq_puts(p, "IPI:");
249
250 for_each_online_cpu(cpu)
251 seq_printf(p, " %10lu", per_cpu(ipi_data, cpu).ipi_count);
252
253 seq_putc(p, '\n');
254}
255
256static void ipi_timer(struct pt_regs *regs)
257{
258 int user = user_mode(regs);
259
260 irq_enter();
261 profile_tick(CPU_PROFILING, regs);
262 update_process_times(user);
263 irq_exit();
264}
265
266/*
267 * ipi_call_function - handle IPI from smp_call_function()
268 *
269 * Note that we copy data out of the cross-call structure and then
270 * let the caller know that we're here and have done with their data
271 */
272static void ipi_call_function(unsigned int cpu)
273{
274 struct smp_call_struct *data = smp_call_function_data;
275 void (*func)(void *info) = data->func;
276 void *info = data->info;
277 int wait = data->wait;
278
279 cpu_clear(cpu, data->pending);
280
281 func(info);
282
283 if (wait)
284 cpu_clear(cpu, data->unfinished);
285}
286
287static DEFINE_SPINLOCK(stop_lock);
288
289/*
290 * ipi_cpu_stop - handle IPI from smp_send_stop()
291 */
292static void ipi_cpu_stop(unsigned int cpu)
293{
294 spin_lock(&stop_lock);
295 printk(KERN_CRIT "CPU%u: stopping\n", cpu);
296 dump_stack();
297 spin_unlock(&stop_lock);
298
299 cpu_clear(cpu, cpu_online_map);
300
301 local_fiq_disable();
302 local_irq_disable();
303
304 while (1)
305 cpu_relax();
306}
307
308/*
309 * Main handler for inter-processor interrupts
310 *
311 * For ARM, the ipimask now only identifies a single
312 * category of IPI (Bit 1 IPIs have been replaced by a
313 * different mechanism):
314 *
315 * Bit 0 - Inter-processor function call
316 */
317void do_IPI(struct pt_regs *regs)
318{
319 unsigned int cpu = smp_processor_id();
320 struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
321
322 ipi->ipi_count++;
323
324 for (;;) {
325 unsigned long msgs;
326
327 spin_lock(&ipi->lock);
328 msgs = ipi->bits;
329 ipi->bits = 0;
330 spin_unlock(&ipi->lock);
331
332 if (!msgs)
333 break;
334
335 do {
336 unsigned nextmsg;
337
338 nextmsg = msgs & -msgs;
339 msgs &= ~nextmsg;
340 nextmsg = ffz(~nextmsg);
341
342 switch (nextmsg) {
343 case IPI_TIMER:
344 ipi_timer(regs);
345 break;
346
347 case IPI_RESCHEDULE:
348 /*
349 * nothing more to do - eveything is
350 * done on the interrupt return path
351 */
352 break;
353
354 case IPI_CALL_FUNC:
355 ipi_call_function(cpu);
356 break;
357
358 case IPI_CPU_STOP:
359 ipi_cpu_stop(cpu);
360 break;
361
362 default:
363 printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n",
364 cpu, nextmsg);
365 break;
366 }
367 } while (msgs);
368 }
369}
370
371void smp_send_reschedule(int cpu)
372{
373 send_ipi_message(cpumask_of_cpu(cpu), IPI_RESCHEDULE);
374}
375
376void smp_send_timer(void)
377{
378 cpumask_t mask = cpu_online_map;
379 cpu_clear(smp_processor_id(), mask);
380 send_ipi_message(mask, IPI_TIMER);
381}
382
383void smp_send_stop(void)
384{
385 cpumask_t mask = cpu_online_map;
386 cpu_clear(smp_processor_id(), mask);
387 send_ipi_message(mask, IPI_CPU_STOP);
388}
389
390/*
391 * not supported here
392 */
393int __init setup_profiling_timer(unsigned int multiplier)
394{
395 return -EINVAL;
396}
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
new file mode 100644
index 000000000000..c41dc605f121
--- /dev/null
+++ b/arch/arm/kernel/sys_arm.c
@@ -0,0 +1,332 @@
1/*
2 * linux/arch/arm/kernel/sys_arm.c
3 *
4 * Copyright (C) People who wrote linux/arch/i386/kernel/sys_i386.c
5 * Copyright (C) 1995, 1996 Russell King.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This file contains various random system calls that
12 * have a non-standard calling sequence on the Linux/arm
13 * platform.
14 */
15#include <linux/module.h>
16#include <linux/errno.h>
17#include <linux/sched.h>
18#include <linux/slab.h>
19#include <linux/mm.h>
20#include <linux/sem.h>
21#include <linux/msg.h>
22#include <linux/shm.h>
23#include <linux/stat.h>
24#include <linux/syscalls.h>
25#include <linux/mman.h>
26#include <linux/fs.h>
27#include <linux/file.h>
28#include <linux/utsname.h>
29
30#include <asm/uaccess.h>
31#include <asm/ipc.h>
32
33extern unsigned long do_mremap(unsigned long addr, unsigned long old_len,
34 unsigned long new_len, unsigned long flags,
35 unsigned long new_addr);
36
37/*
38 * sys_pipe() is the normal C calling standard for creating
39 * a pipe. It's not the way unix traditionally does this, though.
40 */
41asmlinkage int sys_pipe(unsigned long __user *fildes)
42{
43 int fd[2];
44 int error;
45
46 error = do_pipe(fd);
47 if (!error) {
48 if (copy_to_user(fildes, fd, 2*sizeof(int)))
49 error = -EFAULT;
50 }
51 return error;
52}
53
54/*
55 * This is the lowest virtual address we can permit any user space
56 * mapping to be mapped at. This is particularly important for
57 * non-high vector CPUs.
58 */
59#define MIN_MAP_ADDR (PAGE_SIZE)
60
61/* common code for old and new mmaps */
62inline long do_mmap2(
63 unsigned long addr, unsigned long len,
64 unsigned long prot, unsigned long flags,
65 unsigned long fd, unsigned long pgoff)
66{
67 int error = -EINVAL;
68 struct file * file = NULL;
69
70 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
71
72 if (flags & MAP_FIXED && addr < MIN_MAP_ADDR)
73 goto out;
74
75 error = -EBADF;
76 if (!(flags & MAP_ANONYMOUS)) {
77 file = fget(fd);
78 if (!file)
79 goto out;
80 }
81
82 down_write(&current->mm->mmap_sem);
83 error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
84 up_write(&current->mm->mmap_sem);
85
86 if (file)
87 fput(file);
88out:
89 return error;
90}
91
92struct mmap_arg_struct {
93 unsigned long addr;
94 unsigned long len;
95 unsigned long prot;
96 unsigned long flags;
97 unsigned long fd;
98 unsigned long offset;
99};
100
101asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
102{
103 int error = -EFAULT;
104 struct mmap_arg_struct a;
105
106 if (copy_from_user(&a, arg, sizeof(a)))
107 goto out;
108
109 error = -EINVAL;
110 if (a.offset & ~PAGE_MASK)
111 goto out;
112
113 error = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT);
114out:
115 return error;
116}
117
118asmlinkage unsigned long
119sys_arm_mremap(unsigned long addr, unsigned long old_len,
120 unsigned long new_len, unsigned long flags,
121 unsigned long new_addr)
122{
123 unsigned long ret = -EINVAL;
124
125 if (flags & MREMAP_FIXED && new_addr < MIN_MAP_ADDR)
126 goto out;
127
128 down_write(&current->mm->mmap_sem);
129 ret = do_mremap(addr, old_len, new_len, flags, new_addr);
130 up_write(&current->mm->mmap_sem);
131
132out:
133 return ret;
134}
135
136/*
137 * Perform the select(nd, in, out, ex, tv) and mmap() system
138 * calls.
139 */
140
141struct sel_arg_struct {
142 unsigned long n;
143 fd_set __user *inp, *outp, *exp;
144 struct timeval __user *tvp;
145};
146
147asmlinkage int old_select(struct sel_arg_struct __user *arg)
148{
149 struct sel_arg_struct a;
150
151 if (copy_from_user(&a, arg, sizeof(a)))
152 return -EFAULT;
153 /* sys_select() does the appropriate kernel locking */
154 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
155}
156
157/*
158 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
159 *
160 * This is really horribly ugly.
161 */
162asmlinkage int sys_ipc(uint call, int first, int second, int third,
163 void __user *ptr, long fifth)
164{
165 int version, ret;
166
167 version = call >> 16; /* hack for backward compatibility */
168 call &= 0xffff;
169
170 switch (call) {
171 case SEMOP:
172 return sys_semtimedop (first, (struct sembuf __user *)ptr, second, NULL);
173 case SEMTIMEDOP:
174 return sys_semtimedop(first, (struct sembuf __user *)ptr, second,
175 (const struct timespec __user *)fifth);
176
177 case SEMGET:
178 return sys_semget (first, second, third);
179 case SEMCTL: {
180 union semun fourth;
181 if (!ptr)
182 return -EINVAL;
183 if (get_user(fourth.__pad, (void __user * __user *) ptr))
184 return -EFAULT;
185 return sys_semctl (first, second, third, fourth);
186 }
187
188 case MSGSND:
189 return sys_msgsnd(first, (struct msgbuf __user *) ptr,
190 second, third);
191 case MSGRCV:
192 switch (version) {
193 case 0: {
194 struct ipc_kludge tmp;
195 if (!ptr)
196 return -EINVAL;
197 if (copy_from_user(&tmp,(struct ipc_kludge __user *)ptr,
198 sizeof (tmp)))
199 return -EFAULT;
200 return sys_msgrcv (first, tmp.msgp, second,
201 tmp.msgtyp, third);
202 }
203 default:
204 return sys_msgrcv (first,
205 (struct msgbuf __user *) ptr,
206 second, fifth, third);
207 }
208 case MSGGET:
209 return sys_msgget ((key_t) first, second);
210 case MSGCTL:
211 return sys_msgctl(first, second, (struct msqid_ds __user *)ptr);
212
213 case SHMAT:
214 switch (version) {
215 default: {
216 ulong raddr;
217 ret = do_shmat(first, (char __user *)ptr, second, &raddr);
218 if (ret)
219 return ret;
220 return put_user(raddr, (ulong __user *)third);
221 }
222 case 1: /* Of course, we don't support iBCS2! */
223 return -EINVAL;
224 }
225 case SHMDT:
226 return sys_shmdt ((char __user *)ptr);
227 case SHMGET:
228 return sys_shmget (first, second, third);
229 case SHMCTL:
230 return sys_shmctl (first, second,
231 (struct shmid_ds __user *) ptr);
232 default:
233 return -ENOSYS;
234 }
235}
236
237asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg,
238 unsigned long __user *addr)
239{
240 unsigned long ret;
241 long err;
242
243 err = do_shmat(shmid, shmaddr, shmflg, &ret);
244 if (err == 0)
245 err = put_user(ret, addr);
246 return err;
247}
248
249/* Fork a new task - this creates a new program thread.
250 * This is called indirectly via a small wrapper
251 */
252asmlinkage int sys_fork(struct pt_regs *regs)
253{
254 return do_fork(SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL);
255}
256
257/* Clone a task - this clones the calling program thread.
258 * This is called indirectly via a small wrapper
259 */
260asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
261 int __user *parent_tidptr, int tls_val,
262 int __user *child_tidptr, struct pt_regs *regs)
263{
264 if (!newsp)
265 newsp = regs->ARM_sp;
266
267 return do_fork(clone_flags, newsp, regs, 0, parent_tidptr, child_tidptr);
268}
269
270asmlinkage int sys_vfork(struct pt_regs *regs)
271{
272 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL);
273}
274
275/* sys_execve() executes a new program.
276 * This is called indirectly via a small wrapper
277 */
278asmlinkage int sys_execve(char __user *filenamei, char __user * __user *argv,
279 char __user * __user *envp, struct pt_regs *regs)
280{
281 int error;
282 char * filename;
283
284 filename = getname(filenamei);
285 error = PTR_ERR(filename);
286 if (IS_ERR(filename))
287 goto out;
288 error = do_execve(filename, argv, envp, regs);
289 putname(filename);
290out:
291 return error;
292}
293
294long execve(const char *filename, char **argv, char **envp)
295{
296 struct pt_regs regs;
297 int ret;
298
299 memset(&regs, 0, sizeof(struct pt_regs));
300 ret = do_execve((char *)filename, (char __user * __user *)argv,
301 (char __user * __user *)envp, &regs);
302 if (ret < 0)
303 goto out;
304
305 /*
306 * Save argc to the register structure for userspace.
307 */
308 regs.ARM_r0 = ret;
309
310 /*
311 * We were successful. We won't be returning to our caller, but
312 * instead to user space by manipulating the kernel stack.
313 */
314 asm( "add r0, %0, %1\n\t"
315 "mov r1, %2\n\t"
316 "mov r2, %3\n\t"
317 "bl memmove\n\t" /* copy regs to top of stack */
318 "mov r8, #0\n\t" /* not a syscall */
319 "mov r9, %0\n\t" /* thread structure */
320 "mov sp, r0\n\t" /* reposition stack pointer */
321 "b ret_to_user"
322 :
323 : "r" (current_thread_info()),
324 "Ir" (THREAD_SIZE - 8 - sizeof(regs)),
325 "r" (&regs),
326 "Ir" (sizeof(regs))
327 : "r0", "r1", "r2", "r3", "ip", "memory");
328
329 out:
330 return ret;
331}
332EXPORT_SYMBOL(execve);
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
new file mode 100644
index 000000000000..c232f24f4a60
--- /dev/null
+++ b/arch/arm/kernel/time.c
@@ -0,0 +1,402 @@
1/*
2 * linux/arch/arm/kernel/time.c
3 *
4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
5 * Modifications for ARM (C) 1994-2001 Russell King
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This file contains the ARM-specific time handling details:
12 * reading the RTC at bootup, etc...
13 *
14 * 1994-07-02 Alan Modra
15 * fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
16 * 1998-12-20 Updated NTP code according to technical memorandum Jan '96
17 * "A Kernel Model for Precision Timekeeping" by Dave Mills
18 */
19#include <linux/config.h>
20#include <linux/module.h>
21#include <linux/kernel.h>
22#include <linux/interrupt.h>
23#include <linux/time.h>
24#include <linux/init.h>
25#include <linux/smp.h>
26#include <linux/timex.h>
27#include <linux/errno.h>
28#include <linux/profile.h>
29#include <linux/sysdev.h>
30#include <linux/timer.h>
31
32#include <asm/hardware.h>
33#include <asm/io.h>
34#include <asm/irq.h>
35#include <asm/leds.h>
36#include <asm/thread_info.h>
37#include <asm/mach/time.h>
38
39u64 jiffies_64 = INITIAL_JIFFIES;
40
41EXPORT_SYMBOL(jiffies_64);
42
43/*
44 * Our system timer.
45 */
46struct sys_timer *system_timer;
47
48extern unsigned long wall_jiffies;
49
50/* this needs a better home */
51DEFINE_SPINLOCK(rtc_lock);
52
53#ifdef CONFIG_SA1100_RTC_MODULE
54EXPORT_SYMBOL(rtc_lock);
55#endif
56
57/* change this if you have some constant time drift */
58#define USECS_PER_JIFFY (1000000/HZ)
59
60#ifdef CONFIG_SMP
61unsigned long profile_pc(struct pt_regs *regs)
62{
63 unsigned long fp, pc = instruction_pointer(regs);
64
65 if (in_lock_functions(pc)) {
66 fp = regs->ARM_fp;
67 pc = pc_pointer(((unsigned long *)fp)[-1]);
68 }
69
70 return pc;
71}
72EXPORT_SYMBOL(profile_pc);
73#endif
74
75/*
76 * hook for setting the RTC's idea of the current time.
77 */
78int (*set_rtc)(void);
79
80static unsigned long dummy_gettimeoffset(void)
81{
82 return 0;
83}
84
85/*
86 * Scheduler clock - returns current time in nanosec units.
87 * This is the default implementation. Sub-architecture
88 * implementations can override this.
89 */
90unsigned long long __attribute__((weak)) sched_clock(void)
91{
92 return (unsigned long long)jiffies * (1000000000 / HZ);
93}
94
95static unsigned long next_rtc_update;
96
97/*
98 * If we have an externally synchronized linux clock, then update
99 * CMOS clock accordingly every ~11 minutes. set_rtc() has to be
100 * called as close as possible to 500 ms before the new second
101 * starts.
102 */
103static inline void do_set_rtc(void)
104{
105 if (time_status & STA_UNSYNC || set_rtc == NULL)
106 return;
107
108 if (next_rtc_update &&
109 time_before((unsigned long)xtime.tv_sec, next_rtc_update))
110 return;
111
112 if (xtime.tv_nsec < 500000000 - ((unsigned) tick_nsec >> 1) &&
113 xtime.tv_nsec >= 500000000 + ((unsigned) tick_nsec >> 1))
114 return;
115
116 if (set_rtc())
117 /*
118 * rtc update failed. Try again in 60s
119 */
120 next_rtc_update = xtime.tv_sec + 60;
121 else
122 next_rtc_update = xtime.tv_sec + 660;
123}
124
125#ifdef CONFIG_LEDS
126
127static void dummy_leds_event(led_event_t evt)
128{
129}
130
131void (*leds_event)(led_event_t) = dummy_leds_event;
132
133struct leds_evt_name {
134 const char name[8];
135 int on;
136 int off;
137};
138
139static const struct leds_evt_name evt_names[] = {
140 { "amber", led_amber_on, led_amber_off },
141 { "blue", led_blue_on, led_blue_off },
142 { "green", led_green_on, led_green_off },
143 { "red", led_red_on, led_red_off },
144};
145
146static ssize_t leds_store(struct sys_device *dev, const char *buf, size_t size)
147{
148 int ret = -EINVAL, len = strcspn(buf, " ");
149
150 if (len > 0 && buf[len] == '\0')
151 len--;
152
153 if (strncmp(buf, "claim", len) == 0) {
154 leds_event(led_claim);
155 ret = size;
156 } else if (strncmp(buf, "release", len) == 0) {
157 leds_event(led_release);
158 ret = size;
159 } else {
160 int i;
161
162 for (i = 0; i < ARRAY_SIZE(evt_names); i++) {
163 if (strlen(evt_names[i].name) != len ||
164 strncmp(buf, evt_names[i].name, len) != 0)
165 continue;
166 if (strncmp(buf+len, " on", 3) == 0) {
167 leds_event(evt_names[i].on);
168 ret = size;
169 } else if (strncmp(buf+len, " off", 4) == 0) {
170 leds_event(evt_names[i].off);
171 ret = size;
172 }
173 break;
174 }
175 }
176 return ret;
177}
178
179static SYSDEV_ATTR(event, 0200, NULL, leds_store);
180
181static int leds_suspend(struct sys_device *dev, pm_message_t state)
182{
183 leds_event(led_stop);
184 return 0;
185}
186
187static int leds_resume(struct sys_device *dev)
188{
189 leds_event(led_start);
190 return 0;
191}
192
193static int leds_shutdown(struct sys_device *dev)
194{
195 leds_event(led_halted);
196 return 0;
197}
198
199static struct sysdev_class leds_sysclass = {
200 set_kset_name("leds"),
201 .shutdown = leds_shutdown,
202 .suspend = leds_suspend,
203 .resume = leds_resume,
204};
205
206static struct sys_device leds_device = {
207 .id = 0,
208 .cls = &leds_sysclass,
209};
210
211static int __init leds_init(void)
212{
213 int ret;
214 ret = sysdev_class_register(&leds_sysclass);
215 if (ret == 0)
216 ret = sysdev_register(&leds_device);
217 if (ret == 0)
218 ret = sysdev_create_file(&leds_device, &attr_event);
219 return ret;
220}
221
222device_initcall(leds_init);
223
224EXPORT_SYMBOL(leds_event);
225#endif
226
227#ifdef CONFIG_LEDS_TIMER
228static inline void do_leds(void)
229{
230 static unsigned int count = 50;
231
232 if (--count == 0) {
233 count = 50;
234 leds_event(led_timer);
235 }
236}
237#else
238#define do_leds()
239#endif
240
241void do_gettimeofday(struct timeval *tv)
242{
243 unsigned long flags;
244 unsigned long seq;
245 unsigned long usec, sec, lost;
246
247 do {
248 seq = read_seqbegin_irqsave(&xtime_lock, flags);
249 usec = system_timer->offset();
250
251 lost = jiffies - wall_jiffies;
252 if (lost)
253 usec += lost * USECS_PER_JIFFY;
254
255 sec = xtime.tv_sec;
256 usec += xtime.tv_nsec / 1000;
257 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
258
259 /* usec may have gone up a lot: be safe */
260 while (usec >= 1000000) {
261 usec -= 1000000;
262 sec++;
263 }
264
265 tv->tv_sec = sec;
266 tv->tv_usec = usec;
267}
268
269EXPORT_SYMBOL(do_gettimeofday);
270
271int do_settimeofday(struct timespec *tv)
272{
273 time_t wtm_sec, sec = tv->tv_sec;
274 long wtm_nsec, nsec = tv->tv_nsec;
275
276 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
277 return -EINVAL;
278
279 write_seqlock_irq(&xtime_lock);
280 /*
281 * This is revolting. We need to set "xtime" correctly. However, the
282 * value in this location is the value at the most recent update of
283 * wall time. Discover what correction gettimeofday() would have
284 * done, and then undo it!
285 */
286 nsec -= system_timer->offset() * NSEC_PER_USEC;
287 nsec -= (jiffies - wall_jiffies) * TICK_NSEC;
288
289 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
290 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
291
292 set_normalized_timespec(&xtime, sec, nsec);
293 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
294
295 time_adjust = 0; /* stop active adjtime() */
296 time_status |= STA_UNSYNC;
297 time_maxerror = NTP_PHASE_LIMIT;
298 time_esterror = NTP_PHASE_LIMIT;
299 write_sequnlock_irq(&xtime_lock);
300 clock_was_set();
301 return 0;
302}
303
304EXPORT_SYMBOL(do_settimeofday);
305
306/**
307 * save_time_delta - Save the offset between system time and RTC time
308 * @delta: pointer to timespec to store delta
309 * @rtc: pointer to timespec for current RTC time
310 *
311 * Return a delta between the system time and the RTC time, such
312 * that system time can be restored later with restore_time_delta()
313 */
314void save_time_delta(struct timespec *delta, struct timespec *rtc)
315{
316 set_normalized_timespec(delta,
317 xtime.tv_sec - rtc->tv_sec,
318 xtime.tv_nsec - rtc->tv_nsec);
319}
320EXPORT_SYMBOL(save_time_delta);
321
322/**
323 * restore_time_delta - Restore the current system time
324 * @delta: delta returned by save_time_delta()
325 * @rtc: pointer to timespec for current RTC time
326 */
327void restore_time_delta(struct timespec *delta, struct timespec *rtc)
328{
329 struct timespec ts;
330
331 set_normalized_timespec(&ts,
332 delta->tv_sec + rtc->tv_sec,
333 delta->tv_nsec + rtc->tv_nsec);
334
335 do_settimeofday(&ts);
336}
337EXPORT_SYMBOL(restore_time_delta);
338
339/*
340 * Kernel system timer support.
341 */
342void timer_tick(struct pt_regs *regs)
343{
344 profile_tick(CPU_PROFILING, regs);
345 do_leds();
346 do_set_rtc();
347 do_timer(regs);
348#ifndef CONFIG_SMP
349 update_process_times(user_mode(regs));
350#endif
351}
352
353#ifdef CONFIG_PM
354static int timer_suspend(struct sys_device *dev, pm_message_t state)
355{
356 struct sys_timer *timer = container_of(dev, struct sys_timer, dev);
357
358 if (timer->suspend != NULL)
359 timer->suspend();
360
361 return 0;
362}
363
364static int timer_resume(struct sys_device *dev)
365{
366 struct sys_timer *timer = container_of(dev, struct sys_timer, dev);
367
368 if (timer->resume != NULL)
369 timer->resume();
370
371 return 0;
372}
373#else
374#define timer_suspend NULL
375#define timer_resume NULL
376#endif
377
378static struct sysdev_class timer_sysclass = {
379 set_kset_name("timer"),
380 .suspend = timer_suspend,
381 .resume = timer_resume,
382};
383
384static int __init timer_init_sysfs(void)
385{
386 int ret = sysdev_class_register(&timer_sysclass);
387 if (ret == 0) {
388 system_timer->dev.cls = &timer_sysclass;
389 ret = sysdev_register(&system_timer->dev);
390 }
391 return ret;
392}
393
394device_initcall(timer_init_sysfs);
395
396void __init time_init(void)
397{
398 if (system_timer->offset == NULL)
399 system_timer->offset = dummy_gettimeoffset;
400 system_timer->init();
401}
402
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
new file mode 100644
index 000000000000..93dc4646cd7f
--- /dev/null
+++ b/arch/arm/kernel/traps.c
@@ -0,0 +1,590 @@
1/*
2 * linux/arch/arm/kernel/traps.c
3 *
4 * Copyright (C) 1995-2002 Russell King
5 * Fragments that appear the same as linux/arch/i386/kernel/traps.c (C) Linus Torvalds
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * 'traps.c' handles hardware exceptions after we have saved some state in
12 * 'linux/arch/arm/lib/traps.S'. Mostly a debugging aid, but will probably
13 * kill the offending process.
14 */
15#include <linux/config.h>
16#include <linux/module.h>
17#include <linux/signal.h>
18#include <linux/spinlock.h>
19#include <linux/personality.h>
20#include <linux/ptrace.h>
21#include <linux/kallsyms.h>
22#include <linux/init.h>
23
24#include <asm/atomic.h>
25#include <asm/cacheflush.h>
26#include <asm/io.h>
27#include <asm/system.h>
28#include <asm/uaccess.h>
29#include <asm/unistd.h>
30#include <asm/traps.h>
31
32#include "ptrace.h"
33
34extern void c_backtrace (unsigned long fp, int pmode);
35extern void show_pte(struct mm_struct *mm, unsigned long addr);
36
37const char *processor_modes[]=
38{ "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" ,
39 "UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26",
40 "USER_32", "FIQ_32" , "IRQ_32" , "SVC_32" , "UK4_32" , "UK5_32" , "UK6_32" , "ABT_32" ,
41 "UK8_32" , "UK9_32" , "UK10_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32"
42};
43
44static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" };
45
46#ifdef CONFIG_DEBUG_USER
47unsigned int user_debug;
48
49static int __init user_debug_setup(char *str)
50{
51 get_option(&str, &user_debug);
52 return 1;
53}
54__setup("user_debug=", user_debug_setup);
55#endif
56
57void dump_backtrace_entry(unsigned long where, unsigned long from)
58{
59#ifdef CONFIG_KALLSYMS
60 printk("[<%08lx>] ", where);
61 print_symbol("(%s) ", where);
62 printk("from [<%08lx>] ", from);
63 print_symbol("(%s)\n", from);
64#else
65 printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
66#endif
67}
68
69/*
70 * Stack pointers should always be within the kernels view of
71 * physical memory. If it is not there, then we can't dump
72 * out any information relating to the stack.
73 */
74static int verify_stack(unsigned long sp)
75{
76 if (sp < PAGE_OFFSET || (sp > (unsigned long)high_memory && high_memory != 0))
77 return -EFAULT;
78
79 return 0;
80}
81
82/*
83 * Dump out the contents of some memory nicely...
84 */
85static void dump_mem(const char *str, unsigned long bottom, unsigned long top)
86{
87 unsigned long p = bottom & ~31;
88 mm_segment_t fs;
89 int i;
90
91 /*
92 * We need to switch to kernel mode so that we can use __get_user
93 * to safely read from kernel space. Note that we now dump the
94 * code first, just in case the backtrace kills us.
95 */
96 fs = get_fs();
97 set_fs(KERNEL_DS);
98
99 printk("%s(0x%08lx to 0x%08lx)\n", str, bottom, top);
100
101 for (p = bottom & ~31; p < top;) {
102 printk("%04lx: ", p & 0xffff);
103
104 for (i = 0; i < 8; i++, p += 4) {
105 unsigned int val;
106
107 if (p < bottom || p >= top)
108 printk(" ");
109 else {
110 __get_user(val, (unsigned long *)p);
111 printk("%08x ", val);
112 }
113 }
114 printk ("\n");
115 }
116
117 set_fs(fs);
118}
119
120static void dump_instr(struct pt_regs *regs)
121{
122 unsigned long addr = instruction_pointer(regs);
123 const int thumb = thumb_mode(regs);
124 const int width = thumb ? 4 : 8;
125 mm_segment_t fs;
126 int i;
127
128 /*
129 * We need to switch to kernel mode so that we can use __get_user
130 * to safely read from kernel space. Note that we now dump the
131 * code first, just in case the backtrace kills us.
132 */
133 fs = get_fs();
134 set_fs(KERNEL_DS);
135
136 printk("Code: ");
137 for (i = -4; i < 1; i++) {
138 unsigned int val, bad;
139
140 if (thumb)
141 bad = __get_user(val, &((u16 *)addr)[i]);
142 else
143 bad = __get_user(val, &((u32 *)addr)[i]);
144
145 if (!bad)
146 printk(i == 0 ? "(%0*x) " : "%0*x ", width, val);
147 else {
148 printk("bad PC value.");
149 break;
150 }
151 }
152 printk("\n");
153
154 set_fs(fs);
155}
156
157static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
158{
159 unsigned int fp;
160 int ok = 1;
161
162 printk("Backtrace: ");
163 fp = regs->ARM_fp;
164 if (!fp) {
165 printk("no frame pointer");
166 ok = 0;
167 } else if (verify_stack(fp)) {
168 printk("invalid frame pointer 0x%08x", fp);
169 ok = 0;
170 } else if (fp < (unsigned long)(tsk->thread_info + 1))
171 printk("frame pointer underflow");
172 printk("\n");
173
174 if (ok)
175 c_backtrace(fp, processor_mode(regs));
176}
177
178void dump_stack(void)
179{
180#ifdef CONFIG_DEBUG_ERRORS
181 __backtrace();
182#endif
183}
184
185EXPORT_SYMBOL(dump_stack);
186
187void show_stack(struct task_struct *tsk, unsigned long *sp)
188{
189 unsigned long fp;
190
191 if (!tsk)
192 tsk = current;
193
194 if (tsk != current)
195 fp = thread_saved_fp(tsk);
196 else
197 asm("mov%? %0, fp" : "=r" (fp));
198
199 c_backtrace(fp, 0x10);
200 barrier();
201}
202
203DEFINE_SPINLOCK(die_lock);
204
205/*
206 * This function is protected against re-entrancy.
207 */
208NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
209{
210 struct task_struct *tsk = current;
211 static int die_counter;
212
213 console_verbose();
214 spin_lock_irq(&die_lock);
215 bust_spinlocks(1);
216
217 printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter);
218 print_modules();
219 printk("CPU: %d\n", smp_processor_id());
220 show_regs(regs);
221 printk("Process %s (pid: %d, stack limit = 0x%p)\n",
222 tsk->comm, tsk->pid, tsk->thread_info + 1);
223
224 if (!user_mode(regs) || in_interrupt()) {
225 dump_mem("Stack: ", regs->ARM_sp, 8192+(unsigned long)tsk->thread_info);
226 dump_backtrace(regs, tsk);
227 dump_instr(regs);
228 }
229
230 bust_spinlocks(0);
231 spin_unlock_irq(&die_lock);
232 do_exit(SIGSEGV);
233}
234
235void die_if_kernel(const char *str, struct pt_regs *regs, int err)
236{
237 if (user_mode(regs))
238 return;
239
240 die(str, regs, err);
241}
242
243static void notify_die(const char *str, struct pt_regs *regs, siginfo_t *info,
244 unsigned long err, unsigned long trap)
245{
246 if (user_mode(regs)) {
247 current->thread.error_code = err;
248 current->thread.trap_no = trap;
249
250 force_sig_info(info->si_signo, info, current);
251 } else {
252 die(str, regs, err);
253 }
254}
255
256static LIST_HEAD(undef_hook);
257static DEFINE_SPINLOCK(undef_lock);
258
259void register_undef_hook(struct undef_hook *hook)
260{
261 spin_lock_irq(&undef_lock);
262 list_add(&hook->node, &undef_hook);
263 spin_unlock_irq(&undef_lock);
264}
265
266void unregister_undef_hook(struct undef_hook *hook)
267{
268 spin_lock_irq(&undef_lock);
269 list_del(&hook->node);
270 spin_unlock_irq(&undef_lock);
271}
272
273asmlinkage void do_undefinstr(struct pt_regs *regs)
274{
275 unsigned int correction = thumb_mode(regs) ? 2 : 4;
276 unsigned int instr;
277 struct undef_hook *hook;
278 siginfo_t info;
279 void __user *pc;
280
281 /*
282 * According to the ARM ARM, PC is 2 or 4 bytes ahead,
283 * depending whether we're in Thumb mode or not.
284 * Correct this offset.
285 */
286 regs->ARM_pc -= correction;
287
288 pc = (void __user *)instruction_pointer(regs);
289 if (thumb_mode(regs)) {
290 get_user(instr, (u16 __user *)pc);
291 } else {
292 get_user(instr, (u32 __user *)pc);
293 }
294
295 spin_lock_irq(&undef_lock);
296 list_for_each_entry(hook, &undef_hook, node) {
297 if ((instr & hook->instr_mask) == hook->instr_val &&
298 (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) {
299 if (hook->fn(regs, instr) == 0) {
300 spin_unlock_irq(&undef_lock);
301 return;
302 }
303 }
304 }
305 spin_unlock_irq(&undef_lock);
306
307#ifdef CONFIG_DEBUG_USER
308 if (user_debug & UDBG_UNDEFINED) {
309 printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n",
310 current->comm, current->pid, pc);
311 dump_instr(regs);
312 }
313#endif
314
315 info.si_signo = SIGILL;
316 info.si_errno = 0;
317 info.si_code = ILL_ILLOPC;
318 info.si_addr = pc;
319
320 notify_die("Oops - undefined instruction", regs, &info, 0, 6);
321}
322
323asmlinkage void do_unexp_fiq (struct pt_regs *regs)
324{
325#ifndef CONFIG_IGNORE_FIQ
326 printk("Hmm. Unexpected FIQ received, but trying to continue\n");
327 printk("You may have a hardware problem...\n");
328#endif
329}
330
331/*
332 * bad_mode handles the impossible case in the vectors. If you see one of
333 * these, then it's extremely serious, and could mean you have buggy hardware.
334 * It never returns, and never tries to sync. We hope that we can at least
335 * dump out some state information...
336 */
337asmlinkage void bad_mode(struct pt_regs *regs, int reason, int proc_mode)
338{
339 console_verbose();
340
341 printk(KERN_CRIT "Bad mode in %s handler detected: mode %s\n",
342 handler[reason], processor_modes[proc_mode]);
343
344 die("Oops - bad mode", regs, 0);
345 local_irq_disable();
346 panic("bad mode");
347}
348
349static int bad_syscall(int n, struct pt_regs *regs)
350{
351 struct thread_info *thread = current_thread_info();
352 siginfo_t info;
353
354 if (current->personality != PER_LINUX && thread->exec_domain->handler) {
355 thread->exec_domain->handler(n, regs);
356 return regs->ARM_r0;
357 }
358
359#ifdef CONFIG_DEBUG_USER
360 if (user_debug & UDBG_SYSCALL) {
361 printk(KERN_ERR "[%d] %s: obsolete system call %08x.\n",
362 current->pid, current->comm, n);
363 dump_instr(regs);
364 }
365#endif
366
367 info.si_signo = SIGILL;
368 info.si_errno = 0;
369 info.si_code = ILL_ILLTRP;
370 info.si_addr = (void __user *)instruction_pointer(regs) -
371 (thumb_mode(regs) ? 2 : 4);
372
373 notify_die("Oops - bad syscall", regs, &info, n, 0);
374
375 return regs->ARM_r0;
376}
377
378static inline void
379do_cache_op(unsigned long start, unsigned long end, int flags)
380{
381 struct vm_area_struct *vma;
382
383 if (end < start || flags)
384 return;
385
386 vma = find_vma(current->active_mm, start);
387 if (vma && vma->vm_start < end) {
388 if (start < vma->vm_start)
389 start = vma->vm_start;
390 if (end > vma->vm_end)
391 end = vma->vm_end;
392
393 flush_cache_user_range(vma, start, end);
394 }
395}
396
397/*
398 * Handle all unrecognised system calls.
399 * 0x9f0000 - 0x9fffff are some more esoteric system calls
400 */
401#define NR(x) ((__ARM_NR_##x) - __ARM_NR_BASE)
402asmlinkage int arm_syscall(int no, struct pt_regs *regs)
403{
404 struct thread_info *thread = current_thread_info();
405 siginfo_t info;
406
407 if ((no >> 16) != 0x9f)
408 return bad_syscall(no, regs);
409
410 switch (no & 0xffff) {
411 case 0: /* branch through 0 */
412 info.si_signo = SIGSEGV;
413 info.si_errno = 0;
414 info.si_code = SEGV_MAPERR;
415 info.si_addr = NULL;
416
417 notify_die("branch through zero", regs, &info, 0, 0);
418 return 0;
419
420 case NR(breakpoint): /* SWI BREAK_POINT */
421 regs->ARM_pc -= thumb_mode(regs) ? 2 : 4;
422 ptrace_break(current, regs);
423 return regs->ARM_r0;
424
425 /*
426 * Flush a region from virtual address 'r0' to virtual address 'r1'
427 * _exclusive_. There is no alignment requirement on either address;
428 * user space does not need to know the hardware cache layout.
429 *
430 * r2 contains flags. It should ALWAYS be passed as ZERO until it
431 * is defined to be something else. For now we ignore it, but may
432 * the fires of hell burn in your belly if you break this rule. ;)
433 *
434 * (at a later date, we may want to allow this call to not flush
435 * various aspects of the cache. Passing '0' will guarantee that
436 * everything necessary gets flushed to maintain consistency in
437 * the specified region).
438 */
439 case NR(cacheflush):
440 do_cache_op(regs->ARM_r0, regs->ARM_r1, regs->ARM_r2);
441 return 0;
442
443 case NR(usr26):
444 if (!(elf_hwcap & HWCAP_26BIT))
445 break;
446 regs->ARM_cpsr &= ~MODE32_BIT;
447 return regs->ARM_r0;
448
449 case NR(usr32):
450 if (!(elf_hwcap & HWCAP_26BIT))
451 break;
452 regs->ARM_cpsr |= MODE32_BIT;
453 return regs->ARM_r0;
454
455 case NR(set_tls):
456 thread->tp_value = regs->ARM_r0;
457 /*
458 * Our user accessible TLS ptr is located at 0xffff0ffc.
459 * On SMP read access to this address must raise a fault
460 * and be emulated from the data abort handler.
461 * m
462 */
463 *((unsigned long *)0xffff0ffc) = thread->tp_value;
464 return 0;
465
466 default:
467 /* Calls 9f00xx..9f07ff are defined to return -ENOSYS
468 if not implemented, rather than raising SIGILL. This
469 way the calling program can gracefully determine whether
470 a feature is supported. */
471 if (no <= 0x7ff)
472 return -ENOSYS;
473 break;
474 }
475#ifdef CONFIG_DEBUG_USER
476 /*
477 * experience shows that these seem to indicate that
478 * something catastrophic has happened
479 */
480 if (user_debug & UDBG_SYSCALL) {
481 printk("[%d] %s: arm syscall %d\n",
482 current->pid, current->comm, no);
483 dump_instr(regs);
484 if (user_mode(regs)) {
485 show_regs(regs);
486 c_backtrace(regs->ARM_fp, processor_mode(regs));
487 }
488 }
489#endif
490 info.si_signo = SIGILL;
491 info.si_errno = 0;
492 info.si_code = ILL_ILLTRP;
493 info.si_addr = (void __user *)instruction_pointer(regs) -
494 (thumb_mode(regs) ? 2 : 4);
495
496 notify_die("Oops - bad syscall(2)", regs, &info, no, 0);
497 return 0;
498}
499
500void __bad_xchg(volatile void *ptr, int size)
501{
502 printk("xchg: bad data size: pc 0x%p, ptr 0x%p, size %d\n",
503 __builtin_return_address(0), ptr, size);
504 BUG();
505}
506EXPORT_SYMBOL(__bad_xchg);
507
508/*
509 * A data abort trap was taken, but we did not handle the instruction.
510 * Try to abort the user program, or panic if it was the kernel.
511 */
512asmlinkage void
513baddataabort(int code, unsigned long instr, struct pt_regs *regs)
514{
515 unsigned long addr = instruction_pointer(regs);
516 siginfo_t info;
517
518#ifdef CONFIG_DEBUG_USER
519 if (user_debug & UDBG_BADABORT) {
520 printk(KERN_ERR "[%d] %s: bad data abort: code %d instr 0x%08lx\n",
521 current->pid, current->comm, code, instr);
522 dump_instr(regs);
523 show_pte(current->mm, addr);
524 }
525#endif
526
527 info.si_signo = SIGILL;
528 info.si_errno = 0;
529 info.si_code = ILL_ILLOPC;
530 info.si_addr = (void __user *)addr;
531
532 notify_die("unknown data abort code", regs, &info, instr, 0);
533}
534
535volatile void __bug(const char *file, int line, void *data)
536{
537 printk(KERN_CRIT"kernel BUG at %s:%d!", file, line);
538 if (data)
539 printk(" - extra data = %p", data);
540 printk("\n");
541 *(int *)0 = 0;
542}
543EXPORT_SYMBOL(__bug);
544
545void __readwrite_bug(const char *fn)
546{
547 printk("%s called, but not implemented\n", fn);
548 BUG();
549}
550EXPORT_SYMBOL(__readwrite_bug);
551
552void __pte_error(const char *file, int line, unsigned long val)
553{
554 printk("%s:%d: bad pte %08lx.\n", file, line, val);
555}
556
557void __pmd_error(const char *file, int line, unsigned long val)
558{
559 printk("%s:%d: bad pmd %08lx.\n", file, line, val);
560}
561
562void __pgd_error(const char *file, int line, unsigned long val)
563{
564 printk("%s:%d: bad pgd %08lx.\n", file, line, val);
565}
566
567asmlinkage void __div0(void)
568{
569 printk("Division by zero in kernel.\n");
570 dump_stack();
571}
572EXPORT_SYMBOL(__div0);
573
574void abort(void)
575{
576 BUG();
577
578 /* if that doesn't kill us, halt */
579 panic("Oops failed to kill thread");
580}
581EXPORT_SYMBOL(abort);
582
583void __init trap_init(void)
584{
585 extern void __trap_init(void);
586
587 __trap_init();
588 flush_icache_range(0xffff0000, 0xffff0000 + PAGE_SIZE);
589 modify_domain(DOMAIN_USER, DOMAIN_CLIENT);
590}
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
new file mode 100644
index 000000000000..a39c6a42d68a
--- /dev/null
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -0,0 +1,166 @@
1/* ld script to make ARM Linux kernel
2 * taken from the i386 version by Russell King
3 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
4 */
5
6#include <asm-generic/vmlinux.lds.h>
7#include <linux/config.h>
8
9OUTPUT_ARCH(arm)
10ENTRY(stext)
11#ifndef __ARMEB__
12jiffies = jiffies_64;
13#else
14jiffies = jiffies_64 + 4;
15#endif
16SECTIONS
17{
18 . = TEXTADDR;
19 .init : { /* Init code and data */
20 _stext = .;
21 _sinittext = .;
22 *(.init.text)
23 _einittext = .;
24 __proc_info_begin = .;
25 *(.proc.info)
26 __proc_info_end = .;
27 __arch_info_begin = .;
28 *(.arch.info)
29 __arch_info_end = .;
30 __tagtable_begin = .;
31 *(.taglist)
32 __tagtable_end = .;
33 . = ALIGN(16);
34 __setup_start = .;
35 *(.init.setup)
36 __setup_end = .;
37 __early_begin = .;
38 *(__early_param)
39 __early_end = .;
40 __initcall_start = .;
41 *(.initcall1.init)
42 *(.initcall2.init)
43 *(.initcall3.init)
44 *(.initcall4.init)
45 *(.initcall5.init)
46 *(.initcall6.init)
47 *(.initcall7.init)
48 __initcall_end = .;
49 __con_initcall_start = .;
50 *(.con_initcall.init)
51 __con_initcall_end = .;
52 __security_initcall_start = .;
53 *(.security_initcall.init)
54 __security_initcall_end = .;
55 . = ALIGN(32);
56 __initramfs_start = .;
57 usr/built-in.o(.init.ramfs)
58 __initramfs_end = .;
59 . = ALIGN(64);
60 __per_cpu_start = .;
61 *(.data.percpu)
62 __per_cpu_end = .;
63#ifndef CONFIG_XIP_KERNEL
64 __init_begin = _stext;
65 *(.init.data)
66 . = ALIGN(4096);
67 __init_end = .;
68#endif
69 }
70
71 /DISCARD/ : { /* Exit code and data */
72 *(.exit.text)
73 *(.exit.data)
74 *(.exitcall.exit)
75 }
76
77 .text : { /* Real text segment */
78 _text = .; /* Text and read-only data */
79 *(.text)
80 SCHED_TEXT
81 LOCK_TEXT
82 *(.fixup)
83 *(.gnu.warning)
84 *(.rodata)
85 *(.rodata.*)
86 *(.glue_7)
87 *(.glue_7t)
88 *(.got) /* Global offset table */
89 }
90
91 . = ALIGN(16);
92 __ex_table : { /* Exception table */
93 __start___ex_table = .;
94 *(__ex_table)
95 __stop___ex_table = .;
96 }
97
98 RODATA
99
100 _etext = .; /* End of text and rodata section */
101
102#ifdef CONFIG_XIP_KERNEL
103 __data_loc = ALIGN(4); /* location in binary */
104 . = DATAADDR;
105#else
106 . = ALIGN(8192);
107 __data_loc = .;
108#endif
109
110 .data : AT(__data_loc) {
111 __data_start = .; /* address in memory */
112
113 /*
114 * first, the init task union, aligned
115 * to an 8192 byte boundary.
116 */
117 *(.init.task)
118
119#ifdef CONFIG_XIP_KERNEL
120 . = ALIGN(4096);
121 __init_begin = .;
122 *(.init.data)
123 . = ALIGN(4096);
124 __init_end = .;
125#endif
126
127 . = ALIGN(4096);
128 __nosave_begin = .;
129 *(.data.nosave)
130 . = ALIGN(4096);
131 __nosave_end = .;
132
133 /*
134 * then the cacheline aligned data
135 */
136 . = ALIGN(32);
137 *(.data.cacheline_aligned)
138
139 /*
140 * and the usual data section
141 */
142 *(.data)
143 CONSTRUCTORS
144
145 _edata = .;
146 }
147
148 .bss : {
149 __bss_start = .; /* BSS */
150 *(.bss)
151 *(COMMON)
152 _end = .;
153 }
154 /* Stabs debugging sections. */
155 .stab 0 : { *(.stab) }
156 .stabstr 0 : { *(.stabstr) }
157 .stab.excl 0 : { *(.stab.excl) }
158 .stab.exclstr 0 : { *(.stab.exclstr) }
159 .stab.index 0 : { *(.stab.index) }
160 .stab.indexstr 0 : { *(.stab.indexstr) }
161 .comment 0 : { *(.comment) }
162}
163
164/* those must never be empty */
165ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
166ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
new file mode 100644
index 000000000000..c0e65833ffc4
--- /dev/null
+++ b/arch/arm/lib/Makefile
@@ -0,0 +1,29 @@
1#
2# linux/arch/arm/lib/Makefile
3#
4# Copyright (C) 1995-2000 Russell King
5#
6
7lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
8 csumpartialcopy.o csumpartialcopyuser.o clearbit.o \
9 copy_page.o delay.o findbit.o memchr.o memcpy.o \
10 memset.o memzero.o setbit.o strncpy_from_user.o \
11 strnlen_user.o strchr.o strrchr.o testchangebit.o \
12 testclearbit.o testsetbit.o uaccess.o getuser.o \
13 putuser.o ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
14 ucmpdi2.o udivdi3.o lib1funcs.o div64.o \
15 io-readsb.o io-writesb.o io-readsl.o io-writesl.o
16
17ifeq ($(CONFIG_CPU_32v3),y)
18 lib-y += io-readsw-armv3.o io-writesw-armv3.o
19else
20 lib-y += io-readsw-armv4.o io-writesw-armv4.o
21endif
22
23lib-$(CONFIG_ARCH_RPC) += ecard.o io-acorn.o floppydma.o
24lib-$(CONFIG_ARCH_CLPS7500) += io-acorn.o
25lib-$(CONFIG_ARCH_L7200) += io-acorn.o
26lib-$(CONFIG_ARCH_SHARK) += io-shark.o
27
28$(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S
29$(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S
diff --git a/arch/arm/lib/ashldi3.c b/arch/arm/lib/ashldi3.c
new file mode 100644
index 000000000000..130f5a839669
--- /dev/null
+++ b/arch/arm/lib/ashldi3.c
@@ -0,0 +1,61 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34DItype
35__ashldi3 (DItype u, word_type b)
36{
37 DIunion w;
38 word_type bm;
39 DIunion uu;
40
41 if (b == 0)
42 return u;
43
44 uu.ll = u;
45
46 bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
47 if (bm <= 0)
48 {
49 w.s.low = 0;
50 w.s.high = (USItype)uu.s.low << -bm;
51 }
52 else
53 {
54 USItype carries = (USItype)uu.s.low >> bm;
55 w.s.low = (USItype)uu.s.low << b;
56 w.s.high = ((USItype)uu.s.high << b) | carries;
57 }
58
59 return w.ll;
60}
61
diff --git a/arch/arm/lib/ashrdi3.c b/arch/arm/lib/ashrdi3.c
new file mode 100644
index 000000000000..71625d218f8d
--- /dev/null
+++ b/arch/arm/lib/ashrdi3.c
@@ -0,0 +1,61 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34DItype
35__ashrdi3 (DItype u, word_type b)
36{
37 DIunion w;
38 word_type bm;
39 DIunion uu;
40
41 if (b == 0)
42 return u;
43
44 uu.ll = u;
45
46 bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
47 if (bm <= 0)
48 {
49 /* w.s.high = 1..1 or 0..0 */
50 w.s.high = uu.s.high >> (sizeof (SItype) * BITS_PER_UNIT - 1);
51 w.s.low = uu.s.high >> -bm;
52 }
53 else
54 {
55 USItype carries = (USItype)uu.s.high << bm;
56 w.s.high = uu.s.high >> b;
57 w.s.low = ((USItype)uu.s.low >> b) | carries;
58 }
59
60 return w.ll;
61}
diff --git a/arch/arm/lib/backtrace.S b/arch/arm/lib/backtrace.S
new file mode 100644
index 000000000000..68a21c0f3f52
--- /dev/null
+++ b/arch/arm/lib/backtrace.S
@@ -0,0 +1,157 @@
1/*
2 * linux/arch/arm/lib/backtrace.S
3 *
4 * Copyright (C) 1995, 1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * 27/03/03 Ian Molton Clean up CONFIG_CPU
11 *
12 */
13#include <linux/config.h>
14#include <linux/linkage.h>
15#include <asm/assembler.h>
16 .text
17
18@ fp is 0 or stack frame
19
20#define frame r4
21#define next r5
22#define save r6
23#define mask r7
24#define offset r8
25
26ENTRY(__backtrace)
27 mov r1, #0x10
28 mov r0, fp
29
30ENTRY(c_backtrace)
31
32#ifndef CONFIG_FRAME_POINTER
33 mov pc, lr
34#else
35
36 stmfd sp!, {r4 - r8, lr} @ Save an extra register so we have a location...
37 tst r1, #0x10 @ 26 or 32-bit?
38 moveq mask, #0xfc000003
39 movne mask, #0
40 tst mask, r0
41 movne r0, #0
42 movs frame, r0
431: moveq r0, #-2
44 LOADREGS(eqfd, sp!, {r4 - r8, pc})
45
462: stmfd sp!, {pc} @ calculate offset of PC in STMIA instruction
47 ldr r0, [sp], #4
48 adr r1, 2b - 4
49 sub offset, r0, r1
50
513: tst frame, mask @ Check for address exceptions...
52 bne 1b
53
541001: ldr next, [frame, #-12] @ get fp
551002: ldr r2, [frame, #-4] @ get lr
561003: ldr r3, [frame, #0] @ get pc
57 sub save, r3, offset @ Correct PC for prefetching
58 bic save, save, mask
591004: ldr r1, [save, #0] @ get instruction at function
60 mov r1, r1, lsr #10
61 ldr r3, .Ldsi+4
62 teq r1, r3
63 subeq save, save, #4
64 mov r0, save
65 bic r1, r2, mask
66 bl dump_backtrace_entry
67
68 ldr r0, [frame, #-8] @ get sp
69 sub r0, r0, #4
701005: ldr r1, [save, #4] @ get instruction at function+4
71 mov r3, r1, lsr #10
72 ldr r2, .Ldsi+4
73 teq r3, r2 @ Check for stmia sp!, {args}
74 addeq save, save, #4 @ next instruction
75 bleq .Ldumpstm
76
77 sub r0, frame, #16
781006: ldr r1, [save, #4] @ Get 'stmia sp!, {rlist, fp, ip, lr, pc}' instruction
79 mov r3, r1, lsr #10
80 ldr r2, .Ldsi
81 teq r3, r2
82 bleq .Ldumpstm
83
84 /*
85 * A zero next framepointer means we're done.
86 */
87 teq next, #0
88 LOADREGS(eqfd, sp!, {r4 - r8, pc})
89
90 /*
91 * The next framepointer must be above the
92 * current framepointer.
93 */
94 cmp next, frame
95 mov frame, next
96 bhi 3b
97 b 1007f
98
99/*
100 * Fixup for LDMDB
101 */
102 .section .fixup,"ax"
103 .align 0
1041007: ldr r0, =.Lbad
105 mov r1, frame
106 bl printk
107 LOADREGS(fd, sp!, {r4 - r8, pc})
108 .ltorg
109 .previous
110
111 .section __ex_table,"a"
112 .align 3
113 .long 1001b, 1007b
114 .long 1002b, 1007b
115 .long 1003b, 1007b
116 .long 1004b, 1007b
117 .long 1005b, 1007b
118 .long 1006b, 1007b
119 .previous
120
121#define instr r4
122#define reg r5
123#define stack r6
124
125.Ldumpstm: stmfd sp!, {instr, reg, stack, r7, lr}
126 mov stack, r0
127 mov instr, r1
128 mov reg, #9
129 mov r7, #0
1301: mov r3, #1
131 tst instr, r3, lsl reg
132 beq 2f
133 add r7, r7, #1
134 teq r7, #4
135 moveq r7, #0
136 moveq r3, #'\n'
137 movne r3, #' '
138 ldr r2, [stack], #-4
139 mov r1, reg
140 adr r0, .Lfp
141 bl printk
1422: subs reg, reg, #1
143 bpl 1b
144 teq r7, #0
145 adrne r0, .Lcr
146 blne printk
147 mov r0, stack
148 LOADREGS(fd, sp!, {instr, reg, stack, r7, pc})
149
150.Lfp: .asciz " r%d = %08X%c"
151.Lcr: .asciz "\n"
152.Lbad: .asciz "Backtrace aborted due to bad frame pointer <%p>\n"
153 .align
154.Ldsi: .word 0x00e92dd8 >> 2
155 .word 0x00e92d00 >> 2
156
157#endif
diff --git a/arch/arm/lib/changebit.S b/arch/arm/lib/changebit.S
new file mode 100644
index 000000000000..3af45cab70e1
--- /dev/null
+++ b/arch/arm/lib/changebit.S
@@ -0,0 +1,28 @@
1/*
2 * linux/arch/arm/lib/changebit.S
3 *
4 * Copyright (C) 1995-1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12 .text
13
14/* Purpose : Function to change a bit
15 * Prototype: int change_bit(int bit, void *addr)
16 */
17ENTRY(_change_bit_be)
18 eor r0, r0, #0x18 @ big endian byte ordering
19ENTRY(_change_bit_le)
20 and r2, r0, #7
21 mov r3, #1
22 mov r3, r3, lsl r2
23 save_and_disable_irqs ip, r2
24 ldrb r2, [r1, r0, lsr #3]
25 eor r2, r2, r3
26 strb r2, [r1, r0, lsr #3]
27 restore_irqs ip
28 RETINSTR(mov,pc,lr)
diff --git a/arch/arm/lib/clearbit.S b/arch/arm/lib/clearbit.S
new file mode 100644
index 000000000000..069a2ce413f0
--- /dev/null
+++ b/arch/arm/lib/clearbit.S
@@ -0,0 +1,31 @@
1/*
2 * linux/arch/arm/lib/clearbit.S
3 *
4 * Copyright (C) 1995-1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12 .text
13
14/*
15 * Purpose : Function to clear a bit
16 * Prototype: int clear_bit(int bit, void *addr)
17 */
18ENTRY(_clear_bit_be)
19 eor r0, r0, #0x18 @ big endian byte ordering
20ENTRY(_clear_bit_le)
21 and r2, r0, #7
22 mov r3, #1
23 mov r3, r3, lsl r2
24 save_and_disable_irqs ip, r2
25 ldrb r2, [r1, r0, lsr #3]
26 bic r2, r2, r3
27 strb r2, [r1, r0, lsr #3]
28 restore_irqs ip
29 RETINSTR(mov,pc,lr)
30
31
diff --git a/arch/arm/lib/copy_page.S b/arch/arm/lib/copy_page.S
new file mode 100644
index 000000000000..4c38abdbe497
--- /dev/null
+++ b/arch/arm/lib/copy_page.S
@@ -0,0 +1,46 @@
1/*
2 * linux/arch/arm/lib/copypage.S
3 *
4 * Copyright (C) 1995-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ASM optimised string functions
11 */
12#include <linux/linkage.h>
13#include <asm/assembler.h>
14#include <asm/constants.h>
15
16#define COPY_COUNT (PAGE_SZ/64 PLD( -1 ))
17
18 .text
19 .align 5
20/*
21 * StrongARM optimised copy_page routine
22 * now 1.78bytes/cycle, was 1.60 bytes/cycle (50MHz bus -> 89MB/s)
23 * Note that we probably achieve closer to the 100MB/s target with
24 * the core clock switching.
25 */
26ENTRY(copy_page)
27 stmfd sp!, {r4, lr} @ 2
28 PLD( pld [r1, #0] )
29 PLD( pld [r1, #32] )
30 mov r2, #COPY_COUNT @ 1
31 ldmia r1!, {r3, r4, ip, lr} @ 4+1
321: PLD( pld [r1, #64] )
33 PLD( pld [r1, #96] )
342: stmia r0!, {r3, r4, ip, lr} @ 4
35 ldmia r1!, {r3, r4, ip, lr} @ 4+1
36 stmia r0!, {r3, r4, ip, lr} @ 4
37 ldmia r1!, {r3, r4, ip, lr} @ 4+1
38 stmia r0!, {r3, r4, ip, lr} @ 4
39 ldmia r1!, {r3, r4, ip, lr} @ 4
40 subs r2, r2, #1 @ 1
41 stmia r0!, {r3, r4, ip, lr} @ 4
42 ldmgtia r1!, {r3, r4, ip, lr} @ 4
43 bgt 1b @ 1
44 PLD( ldmeqia r1!, {r3, r4, ip, lr} )
45 PLD( beq 2b )
46 LOADREGS(fd, sp!, {r4, pc}) @ 3
diff --git a/arch/arm/lib/csumipv6.S b/arch/arm/lib/csumipv6.S
new file mode 100644
index 000000000000..7065a20ee8ad
--- /dev/null
+++ b/arch/arm/lib/csumipv6.S
@@ -0,0 +1,32 @@
1/*
2 * linux/arch/arm/lib/csumipv6.S
3 *
4 * Copyright (C) 1995-1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12
13 .text
14
15ENTRY(__csum_ipv6_magic)
16 str lr, [sp, #-4]!
17 adds ip, r2, r3
18 ldmia r1, {r1 - r3, lr}
19 adcs ip, ip, r1
20 adcs ip, ip, r2
21 adcs ip, ip, r3
22 adcs ip, ip, lr
23 ldmia r0, {r0 - r3}
24 adcs r0, ip, r0
25 adcs r0, r0, r1
26 adcs r0, r0, r2
27 ldr r2, [sp, #4]
28 adcs r0, r0, r3
29 adcs r0, r0, r2
30 adcs r0, r0, #0
31 LOADREGS(fd, sp!, {pc})
32
diff --git a/arch/arm/lib/csumpartial.S b/arch/arm/lib/csumpartial.S
new file mode 100644
index 000000000000..cb5e3708f118
--- /dev/null
+++ b/arch/arm/lib/csumpartial.S
@@ -0,0 +1,137 @@
1/*
2 * linux/arch/arm/lib/csumpartial.S
3 *
4 * Copyright (C) 1995-1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12
13 .text
14
15/*
16 * Function: __u32 csum_partial(const char *src, int len, __u32 sum)
17 * Params : r0 = buffer, r1 = len, r2 = checksum
18 * Returns : r0 = new checksum
19 */
20
21buf .req r0
22len .req r1
23sum .req r2
24td0 .req r3
25td1 .req r4 @ save before use
26td2 .req r5 @ save before use
27td3 .req lr
28
29.zero: mov r0, sum
30 add sp, sp, #4
31 ldr pc, [sp], #4
32
33 /*
34 * Handle 0 to 7 bytes, with any alignment of source and
35 * destination pointers. Note that when we get here, C = 0
36 */
37.less8: teq len, #0 @ check for zero count
38 beq .zero
39
40 /* we must have at least one byte. */
41 tst buf, #1 @ odd address?
42 ldrneb td0, [buf], #1
43 subne len, len, #1
44 adcnes sum, sum, td0, put_byte_1
45
46.less4: tst len, #6
47 beq .less8_byte
48
49 /* we are now half-word aligned */
50
51.less8_wordlp:
52#if __LINUX_ARM_ARCH__ >= 4
53 ldrh td0, [buf], #2
54 sub len, len, #2
55#else
56 ldrb td0, [buf], #1
57 ldrb td3, [buf], #1
58 sub len, len, #2
59#ifndef __ARMEB__
60 orr td0, td0, td3, lsl #8
61#else
62 orr td0, td3, td0, lsl #8
63#endif
64#endif
65 adcs sum, sum, td0
66 tst len, #6
67 bne .less8_wordlp
68
69.less8_byte: tst len, #1 @ odd number of bytes
70 ldrneb td0, [buf], #1 @ include last byte
71 adcnes sum, sum, td0, put_byte_0 @ update checksum
72
73.done: adc r0, sum, #0 @ collect up the last carry
74 ldr td0, [sp], #4
75 tst td0, #1 @ check buffer alignment
76 movne r0, r0, ror #8 @ rotate checksum by 8 bits
77 ldr pc, [sp], #4 @ return
78
79.not_aligned: tst buf, #1 @ odd address
80 ldrneb td0, [buf], #1 @ make even
81 subne len, len, #1
82 adcnes sum, sum, td0, put_byte_1 @ update checksum
83
84 tst buf, #2 @ 32-bit aligned?
85#if __LINUX_ARM_ARCH__ >= 4
86 ldrneh td0, [buf], #2 @ make 32-bit aligned
87 subne len, len, #2
88#else
89 ldrneb td0, [buf], #1
90 ldrneb ip, [buf], #1
91 subne len, len, #2
92#ifndef __ARMEB__
93 orrne td0, td0, ip, lsl #8
94#else
95 orrne td0, ip, td0, lsl #8
96#endif
97#endif
98 adcnes sum, sum, td0 @ update checksum
99 mov pc, lr
100
101ENTRY(csum_partial)
102 stmfd sp!, {buf, lr}
103 cmp len, #8 @ Ensure that we have at least
104 blo .less8 @ 8 bytes to copy.
105
106 adds sum, sum, #0 @ C = 0
107 tst buf, #3 @ Test destination alignment
108 blne .not_aligned @ aligh destination, return here
109
1101: bics ip, len, #31
111 beq 3f
112
113 stmfd sp!, {r4 - r5}
1142: ldmia buf!, {td0, td1, td2, td3}
115 adcs sum, sum, td0
116 adcs sum, sum, td1
117 adcs sum, sum, td2
118 adcs sum, sum, td3
119 ldmia buf!, {td0, td1, td2, td3}
120 adcs sum, sum, td0
121 adcs sum, sum, td1
122 adcs sum, sum, td2
123 adcs sum, sum, td3
124 sub ip, ip, #32
125 teq ip, #0
126 bne 2b
127 ldmfd sp!, {r4 - r5}
128
1293: tst len, #0x1c @ should not change C
130 beq .less4
131
1324: ldr td0, [buf], #4
133 sub len, len, #4
134 adcs sum, sum, td0
135 tst len, #0x1c
136 bne 4b
137 b .less4
diff --git a/arch/arm/lib/csumpartialcopy.S b/arch/arm/lib/csumpartialcopy.S
new file mode 100644
index 000000000000..990ee63b2465
--- /dev/null
+++ b/arch/arm/lib/csumpartialcopy.S
@@ -0,0 +1,52 @@
1/*
2 * linux/arch/arm/lib/csumpartialcopy.S
3 *
4 * Copyright (C) 1995-1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12
13 .text
14
15/* Function: __u32 csum_partial_copy_nocheck(const char *src, char *dst, int len, __u32 sum)
16 * Params : r0 = src, r1 = dst, r2 = len, r3 = checksum
17 * Returns : r0 = new checksum
18 */
19
20 .macro save_regs
21 stmfd sp!, {r1, r4 - r8, fp, ip, lr, pc}
22 .endm
23
24 .macro load_regs,flags
25 LOADREGS(\flags,fp,{r1, r4 - r8, fp, sp, pc})
26 .endm
27
28 .macro load1b, reg1
29 ldrb \reg1, [r0], #1
30 .endm
31
32 .macro load2b, reg1, reg2
33 ldrb \reg1, [r0], #1
34 ldrb \reg2, [r0], #1
35 .endm
36
37 .macro load1l, reg1
38 ldr \reg1, [r0], #4
39 .endm
40
41 .macro load2l, reg1, reg2
42 ldr \reg1, [r0], #4
43 ldr \reg2, [r0], #4
44 .endm
45
46 .macro load4l, reg1, reg2, reg3, reg4
47 ldmia r0!, {\reg1, \reg2, \reg3, \reg4}
48 .endm
49
50#define FN_ENTRY ENTRY(csum_partial_copy_nocheck)
51
52#include "csumpartialcopygeneric.S"
diff --git a/arch/arm/lib/csumpartialcopygeneric.S b/arch/arm/lib/csumpartialcopygeneric.S
new file mode 100644
index 000000000000..d3a2f4667db4
--- /dev/null
+++ b/arch/arm/lib/csumpartialcopygeneric.S
@@ -0,0 +1,331 @@
1/*
2 * linux/arch/arm/lib/csumpartialcopygeneric.S
3 *
4 * Copyright (C) 1995-2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/*
12 * unsigned int
13 * csum_partial_copy_xxx(const char *src, char *dst, int len, int sum, )
14 * r0 = src, r1 = dst, r2 = len, r3 = sum
15 * Returns : r0 = checksum
16 *
17 * Note that 'tst' and 'teq' preserve the carry flag.
18 */
19
20src .req r0
21dst .req r1
22len .req r2
23sum .req r3
24
25.zero: mov r0, sum
26 load_regs ea
27
28 /*
29 * Align an unaligned destination pointer. We know that
30 * we have >= 8 bytes here, so we don't need to check
31 * the length. Note that the source pointer hasn't been
32 * aligned yet.
33 */
34.dst_unaligned: tst dst, #1
35 beq .dst_16bit
36
37 load1b ip
38 sub len, len, #1
39 adcs sum, sum, ip, put_byte_1 @ update checksum
40 strb ip, [dst], #1
41 tst dst, #2
42 moveq pc, lr @ dst is now 32bit aligned
43
44.dst_16bit: load2b r8, ip
45 sub len, len, #2
46 adcs sum, sum, r8, put_byte_0
47 strb r8, [dst], #1
48 adcs sum, sum, ip, put_byte_1
49 strb ip, [dst], #1
50 mov pc, lr @ dst is now 32bit aligned
51
52 /*
53 * Handle 0 to 7 bytes, with any alignment of source and
54 * destination pointers. Note that when we get here, C = 0
55 */
56.less8: teq len, #0 @ check for zero count
57 beq .zero
58
59 /* we must have at least one byte. */
60 tst dst, #1 @ dst 16-bit aligned
61 beq .less8_aligned
62
63 /* Align dst */
64 load1b ip
65 sub len, len, #1
66 adcs sum, sum, ip, put_byte_1 @ update checksum
67 strb ip, [dst], #1
68 tst len, #6
69 beq .less8_byteonly
70
711: load2b r8, ip
72 sub len, len, #2
73 adcs sum, sum, r8, put_byte_0
74 strb r8, [dst], #1
75 adcs sum, sum, ip, put_byte_1
76 strb ip, [dst], #1
77.less8_aligned: tst len, #6
78 bne 1b
79.less8_byteonly:
80 tst len, #1
81 beq .done
82 load1b r8
83 adcs sum, sum, r8, put_byte_0 @ update checksum
84 strb r8, [dst], #1
85 b .done
86
87FN_ENTRY
88 mov ip, sp
89 save_regs
90 sub fp, ip, #4
91
92 cmp len, #8 @ Ensure that we have at least
93 blo .less8 @ 8 bytes to copy.
94
95 adds sum, sum, #0 @ C = 0
96 tst dst, #3 @ Test destination alignment
97 blne .dst_unaligned @ align destination, return here
98
99 /*
100 * Ok, the dst pointer is now 32bit aligned, and we know
101 * that we must have more than 4 bytes to copy. Note
102 * that C contains the carry from the dst alignment above.
103 */
104
105 tst src, #3 @ Test source alignment
106 bne .src_not_aligned
107
108 /* Routine for src & dst aligned */
109
110 bics ip, len, #15
111 beq 2f
112
1131: load4l r4, r5, r6, r7
114 stmia dst!, {r4, r5, r6, r7}
115 adcs sum, sum, r4
116 adcs sum, sum, r5
117 adcs sum, sum, r6
118 adcs sum, sum, r7
119 sub ip, ip, #16
120 teq ip, #0
121 bne 1b
122
1232: ands ip, len, #12
124 beq 4f
125 tst ip, #8
126 beq 3f
127 load2l r4, r5
128 stmia dst!, {r4, r5}
129 adcs sum, sum, r4
130 adcs sum, sum, r5
131 tst ip, #4
132 beq 4f
133
1343: load1l r4
135 str r4, [dst], #4
136 adcs sum, sum, r4
137
1384: ands len, len, #3
139 beq .done
140 load1l r4
141 tst len, #2
142 mov r5, r4, get_byte_0
143 beq .exit
144 adcs sum, sum, r4, push #16
145 strb r5, [dst], #1
146 mov r5, r4, get_byte_1
147 strb r5, [dst], #1
148 mov r5, r4, get_byte_2
149.exit: tst len, #1
150 strneb r5, [dst], #1
151 andne r5, r5, #255
152 adcnes sum, sum, r5, put_byte_0
153
154 /*
155 * If the dst pointer was not 16-bit aligned, we
156 * need to rotate the checksum here to get around
157 * the inefficient byte manipulations in the
158 * architecture independent code.
159 */
160.done: adc r0, sum, #0
161 ldr sum, [sp, #0] @ dst
162 tst sum, #1
163 movne r0, r0, ror #8
164 load_regs ea
165
166.src_not_aligned:
167 adc sum, sum, #0 @ include C from dst alignment
168 and ip, src, #3
169 bic src, src, #3
170 load1l r5
171 cmp ip, #2
172 beq .src2_aligned
173 bhi .src3_aligned
174 mov r4, r5, pull #8 @ C = 0
175 bics ip, len, #15
176 beq 2f
1771: load4l r5, r6, r7, r8
178 orr r4, r4, r5, push #24
179 mov r5, r5, pull #8
180 orr r5, r5, r6, push #24
181 mov r6, r6, pull #8
182 orr r6, r6, r7, push #24
183 mov r7, r7, pull #8
184 orr r7, r7, r8, push #24
185 stmia dst!, {r4, r5, r6, r7}
186 adcs sum, sum, r4
187 adcs sum, sum, r5
188 adcs sum, sum, r6
189 adcs sum, sum, r7
190 mov r4, r8, pull #8
191 sub ip, ip, #16
192 teq ip, #0
193 bne 1b
1942: ands ip, len, #12
195 beq 4f
196 tst ip, #8
197 beq 3f
198 load2l r5, r6
199 orr r4, r4, r5, push #24
200 mov r5, r5, pull #8
201 orr r5, r5, r6, push #24
202 stmia dst!, {r4, r5}
203 adcs sum, sum, r4
204 adcs sum, sum, r5
205 mov r4, r6, pull #8
206 tst ip, #4
207 beq 4f
2083: load1l r5
209 orr r4, r4, r5, push #24
210 str r4, [dst], #4
211 adcs sum, sum, r4
212 mov r4, r5, pull #8
2134: ands len, len, #3
214 beq .done
215 mov r5, r4, get_byte_0
216 tst len, #2
217 beq .exit
218 adcs sum, sum, r4, push #16
219 strb r5, [dst], #1
220 mov r5, r4, get_byte_1
221 strb r5, [dst], #1
222 mov r5, r4, get_byte_2
223 b .exit
224
225.src2_aligned: mov r4, r5, pull #16
226 adds sum, sum, #0
227 bics ip, len, #15
228 beq 2f
2291: load4l r5, r6, r7, r8
230 orr r4, r4, r5, push #16
231 mov r5, r5, pull #16
232 orr r5, r5, r6, push #16
233 mov r6, r6, pull #16
234 orr r6, r6, r7, push #16
235 mov r7, r7, pull #16
236 orr r7, r7, r8, push #16
237 stmia dst!, {r4, r5, r6, r7}
238 adcs sum, sum, r4
239 adcs sum, sum, r5
240 adcs sum, sum, r6
241 adcs sum, sum, r7
242 mov r4, r8, pull #16
243 sub ip, ip, #16
244 teq ip, #0
245 bne 1b
2462: ands ip, len, #12
247 beq 4f
248 tst ip, #8
249 beq 3f
250 load2l r5, r6
251 orr r4, r4, r5, push #16
252 mov r5, r5, pull #16
253 orr r5, r5, r6, push #16
254 stmia dst!, {r4, r5}
255 adcs sum, sum, r4
256 adcs sum, sum, r5
257 mov r4, r6, pull #16
258 tst ip, #4
259 beq 4f
2603: load1l r5
261 orr r4, r4, r5, push #16
262 str r4, [dst], #4
263 adcs sum, sum, r4
264 mov r4, r5, pull #16
2654: ands len, len, #3
266 beq .done
267 mov r5, r4, get_byte_0
268 tst len, #2
269 beq .exit
270 adcs sum, sum, r4
271 strb r5, [dst], #1
272 mov r5, r4, get_byte_1
273 strb r5, [dst], #1
274 tst len, #1
275 beq .done
276 load1b r5
277 b .exit
278
279.src3_aligned: mov r4, r5, pull #24
280 adds sum, sum, #0
281 bics ip, len, #15
282 beq 2f
2831: load4l r5, r6, r7, r8
284 orr r4, r4, r5, push #8
285 mov r5, r5, pull #24
286 orr r5, r5, r6, push #8
287 mov r6, r6, pull #24
288 orr r6, r6, r7, push #8
289 mov r7, r7, pull #24
290 orr r7, r7, r8, push #8
291 stmia dst!, {r4, r5, r6, r7}
292 adcs sum, sum, r4
293 adcs sum, sum, r5
294 adcs sum, sum, r6
295 adcs sum, sum, r7
296 mov r4, r8, pull #24
297 sub ip, ip, #16
298 teq ip, #0
299 bne 1b
3002: ands ip, len, #12
301 beq 4f
302 tst ip, #8
303 beq 3f
304 load2l r5, r6
305 orr r4, r4, r5, push #8
306 mov r5, r5, pull #24
307 orr r5, r5, r6, push #8
308 stmia dst!, {r4, r5}
309 adcs sum, sum, r4
310 adcs sum, sum, r5
311 mov r4, r6, pull #24
312 tst ip, #4
313 beq 4f
3143: load1l r5
315 orr r4, r4, r5, push #8
316 str r4, [dst], #4
317 adcs sum, sum, r4
318 mov r4, r5, pull #24
3194: ands len, len, #3
320 beq .done
321 mov r5, r4, get_byte_0
322 tst len, #2
323 beq .exit
324 strb r5, [dst], #1
325 adcs sum, sum, r4
326 load1l r4
327 mov r5, r4, get_byte_0
328 strb r5, [dst], #1
329 adcs sum, sum, r4, push #24
330 mov r5, r4, get_byte_1
331 b .exit
diff --git a/arch/arm/lib/csumpartialcopyuser.S b/arch/arm/lib/csumpartialcopyuser.S
new file mode 100644
index 000000000000..46a2dc962e9d
--- /dev/null
+++ b/arch/arm/lib/csumpartialcopyuser.S
@@ -0,0 +1,104 @@
1/*
2 * linux/arch/arm/lib/csumpartialcopyuser.S
3 *
4 * Copyright (C) 1995-1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * 27/03/03 Ian Molton Clean up CONFIG_CPU
11 *
12 */
13#include <linux/linkage.h>
14#include <asm/assembler.h>
15#include <asm/errno.h>
16#include <asm/constants.h>
17
18 .text
19
20 .macro save_regs
21 stmfd sp!, {r1 - r2, r4 - r8, fp, ip, lr, pc}
22 .endm
23
24 .macro load_regs,flags
25 ldm\flags fp, {r1, r2, r4-r8, fp, sp, pc}
26 .endm
27
28 .macro load1b, reg1
299999: ldrbt \reg1, [r0], $1
30 .section __ex_table, "a"
31 .align 3
32 .long 9999b, 6001f
33 .previous
34 .endm
35
36 .macro load2b, reg1, reg2
379999: ldrbt \reg1, [r0], $1
389998: ldrbt \reg2, [r0], $1
39 .section __ex_table, "a"
40 .long 9999b, 6001f
41 .long 9998b, 6001f
42 .previous
43 .endm
44
45 .macro load1l, reg1
469999: ldrt \reg1, [r0], $4
47 .section __ex_table, "a"
48 .align 3
49 .long 9999b, 6001f
50 .previous
51 .endm
52
53 .macro load2l, reg1, reg2
549999: ldrt \reg1, [r0], $4
559998: ldrt \reg2, [r0], $4
56 .section __ex_table, "a"
57 .long 9999b, 6001f
58 .long 9998b, 6001f
59 .previous
60 .endm
61
62 .macro load4l, reg1, reg2, reg3, reg4
639999: ldrt \reg1, [r0], $4
649998: ldrt \reg2, [r0], $4
659997: ldrt \reg3, [r0], $4
669996: ldrt \reg4, [r0], $4
67 .section __ex_table, "a"
68 .long 9999b, 6001f
69 .long 9998b, 6001f
70 .long 9997b, 6001f
71 .long 9996b, 6001f
72 .previous
73 .endm
74
75/*
76 * unsigned int
77 * csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *err_ptr)
78 * r0 = src, r1 = dst, r2 = len, r3 = sum, [sp] = *err_ptr
79 * Returns : r0 = checksum, [[sp, #0], #0] = 0 or -EFAULT
80 */
81
82#define FN_ENTRY ENTRY(csum_partial_copy_from_user)
83
84#include "csumpartialcopygeneric.S"
85
86/*
87 * FIXME: minor buglet here
88 * We don't return the checksum for the data present in the buffer. To do
89 * so properly, we would have to add in whatever registers were loaded before
90 * the fault, which, with the current asm above is not predictable.
91 */
92 .section .fixup,"ax"
93 .align 4
946001: mov r4, #-EFAULT
95 ldr r5, [fp, #4] @ *err_ptr
96 str r4, [r5]
97 ldmia sp, {r1, r2} @ retrieve dst, len
98 add r2, r2, r1
99 mov r0, #0 @ zero the buffer
1006002: teq r2, r1
101 strneb r0, [r1], #1
102 bne 6002b
103 load_regs ea
104 .previous
diff --git a/arch/arm/lib/delay.S b/arch/arm/lib/delay.S
new file mode 100644
index 000000000000..3c7f7e675dd8
--- /dev/null
+++ b/arch/arm/lib/delay.S
@@ -0,0 +1,58 @@
1/*
2 * linux/arch/arm/lib/delay.S
3 *
4 * Copyright (C) 1995, 1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12 .text
13
14LC0: .word loops_per_jiffy
15
16/*
17 * 0 <= r0 <= 2000
18 */
19ENTRY(__udelay)
20 mov r2, #0x6800
21 orr r2, r2, #0x00db
22 mul r0, r2, r0
23ENTRY(__const_udelay) @ 0 <= r0 <= 0x01ffffff
24 ldr r2, LC0
25 ldr r2, [r2] @ max = 0x0fffffff
26 mov r0, r0, lsr #11 @ max = 0x00003fff
27 mov r2, r2, lsr #11 @ max = 0x0003ffff
28 mul r0, r2, r0 @ max = 2^32-1
29 movs r0, r0, lsr #6
30 RETINSTR(moveq,pc,lr)
31
32/*
33 * loops = (r0 * 0x10c6 * 100 * loops_per_jiffy) / 2^32
34 *
35 * Oh, if only we had a cycle counter...
36 */
37
38@ Delay routine
39ENTRY(__delay)
40 subs r0, r0, #1
41#if 0
42 RETINSTR(movls,pc,lr)
43 subs r0, r0, #1
44 RETINSTR(movls,pc,lr)
45 subs r0, r0, #1
46 RETINSTR(movls,pc,lr)
47 subs r0, r0, #1
48 RETINSTR(movls,pc,lr)
49 subs r0, r0, #1
50 RETINSTR(movls,pc,lr)
51 subs r0, r0, #1
52 RETINSTR(movls,pc,lr)
53 subs r0, r0, #1
54 RETINSTR(movls,pc,lr)
55 subs r0, r0, #1
56#endif
57 bhi __delay
58 RETINSTR(mov,pc,lr)
diff --git a/arch/arm/lib/div64.S b/arch/arm/lib/div64.S
new file mode 100644
index 000000000000..ec9a1cd6176f
--- /dev/null
+++ b/arch/arm/lib/div64.S
@@ -0,0 +1,200 @@
1/*
2 * linux/arch/arm/lib/div64.S
3 *
4 * Optimized computation of 64-bit dividend / 32-bit divisor
5 *
6 * Author: Nicolas Pitre
7 * Created: Oct 5, 2003
8 * Copyright: Monta Vista Software, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/linkage.h>
16
17#ifdef __ARMEB__
18#define xh r0
19#define xl r1
20#define yh r2
21#define yl r3
22#else
23#define xl r0
24#define xh r1
25#define yl r2
26#define yh r3
27#endif
28
29/*
30 * __do_div64: perform a division with 64-bit dividend and 32-bit divisor.
31 *
32 * Note: Calling convention is totally non standard for optimal code.
33 * This is meant to be used by do_div() from include/asm/div64.h only.
34 *
35 * Input parameters:
36 * xh-xl = dividend (clobbered)
37 * r4 = divisor (preserved)
38 *
39 * Output values:
40 * yh-yl = result
41 * xh = remainder
42 *
43 * Clobbered regs: xl, ip
44 */
45
46ENTRY(__do_div64)
47
48 @ Test for easy paths first.
49 subs ip, r4, #1
50 bls 9f @ divisor is 0 or 1
51 tst ip, r4
52 beq 8f @ divisor is power of 2
53
54 @ See if we need to handle upper 32-bit result.
55 cmp xh, r4
56 mov yh, #0
57 blo 3f
58
59 @ Align divisor with upper part of dividend.
60 @ The aligned divisor is stored in yl preserving the original.
61 @ The bit position is stored in ip.
62
63#if __LINUX_ARM_ARCH__ >= 5
64
65 clz yl, r4
66 clz ip, xh
67 sub yl, yl, ip
68 mov ip, #1
69 mov ip, ip, lsl yl
70 mov yl, r4, lsl yl
71
72#else
73
74 mov yl, r4
75 mov ip, #1
761: cmp yl, #0x80000000
77 cmpcc yl, xh
78 movcc yl, yl, lsl #1
79 movcc ip, ip, lsl #1
80 bcc 1b
81
82#endif
83
84 @ The division loop for needed upper bit positions.
85 @ Break out early if dividend reaches 0.
862: cmp xh, yl
87 orrcs yh, yh, ip
88 subcss xh, xh, yl
89 movnes ip, ip, lsr #1
90 mov yl, yl, lsr #1
91 bne 2b
92
93 @ See if we need to handle lower 32-bit result.
943: cmp xh, #0
95 mov yl, #0
96 cmpeq xl, r4
97 movlo xh, xl
98 movlo pc, lr
99
100 @ The division loop for lower bit positions.
101 @ Here we shift remainer bits leftwards rather than moving the
102 @ divisor for comparisons, considering the carry-out bit as well.
103 mov ip, #0x80000000
1044: movs xl, xl, lsl #1
105 adcs xh, xh, xh
106 beq 6f
107 cmpcc xh, r4
1085: orrcs yl, yl, ip
109 subcs xh, xh, r4
110 movs ip, ip, lsr #1
111 bne 4b
112 mov pc, lr
113
114 @ The top part of remainder became zero. If carry is set
115 @ (the 33th bit) this is a false positive so resume the loop.
116 @ Otherwise, if lower part is also null then we are done.
1176: bcs 5b
118 cmp xl, #0
119 moveq pc, lr
120
121 @ We still have remainer bits in the low part. Bring them up.
122
123#if __LINUX_ARM_ARCH__ >= 5
124
125 clz xh, xl @ we know xh is zero here so...
126 add xh, xh, #1
127 mov xl, xl, lsl xh
128 mov ip, ip, lsr xh
129
130#else
131
1327: movs xl, xl, lsl #1
133 mov ip, ip, lsr #1
134 bcc 7b
135
136#endif
137
138 @ Current remainder is now 1. It is worthless to compare with
139 @ divisor at this point since divisor can not be smaller than 3 here.
140 @ If possible, branch for another shift in the division loop.
141 @ If no bit position left then we are done.
142 movs ip, ip, lsr #1
143 mov xh, #1
144 bne 4b
145 mov pc, lr
146
1478: @ Division by a power of 2: determine what that divisor order is
148 @ then simply shift values around
149
150#if __LINUX_ARM_ARCH__ >= 5
151
152 clz ip, r4
153 rsb ip, ip, #31
154
155#else
156
157 mov yl, r4
158 cmp r4, #(1 << 16)
159 mov ip, #0
160 movhs yl, yl, lsr #16
161 movhs ip, #16
162
163 cmp yl, #(1 << 8)
164 movhs yl, yl, lsr #8
165 addhs ip, ip, #8
166
167 cmp yl, #(1 << 4)
168 movhs yl, yl, lsr #4
169 addhs ip, ip, #4
170
171 cmp yl, #(1 << 2)
172 addhi ip, ip, #3
173 addls ip, ip, yl, lsr #1
174
175#endif
176
177 mov yh, xh, lsr ip
178 mov yl, xl, lsr ip
179 rsb ip, ip, #32
180 orr yl, yl, xh, lsl ip
181 mov xh, xl, lsl ip
182 mov xh, xh, lsr ip
183 mov pc, lr
184
185 @ eq -> division by 1: obvious enough...
1869: moveq yl, xl
187 moveq yh, xh
188 moveq xh, #0
189 moveq pc, lr
190
191 @ Division by 0:
192 str lr, [sp, #-4]!
193 bl __div0
194
195 @ as wrong as it could be...
196 mov yl, #0
197 mov yh, #0
198 mov xh, #0
199 ldr pc, [sp], #4
200
diff --git a/arch/arm/lib/ecard.S b/arch/arm/lib/ecard.S
new file mode 100644
index 000000000000..fb7b602a6f76
--- /dev/null
+++ b/arch/arm/lib/ecard.S
@@ -0,0 +1,45 @@
1/*
2 * linux/arch/arm/lib/ecard.S
3 *
4 * Copyright (C) 1995, 1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * 27/03/03 Ian Molton Clean up CONFIG_CPU
11 *
12 */
13#include <linux/linkage.h>
14#include <asm/assembler.h>
15#include <asm/hardware.h>
16
17#define CPSR2SPSR(rt) \
18 mrs rt, cpsr; \
19 msr spsr_cxsf, rt
20
21@ Purpose: call an expansion card loader to read bytes.
22@ Proto : char read_loader(int offset, char *card_base, char *loader);
23@ Returns: byte read
24
25ENTRY(ecard_loader_read)
26 stmfd sp!, {r4 - r12, lr}
27 mov r11, r1
28 mov r1, r0
29 CPSR2SPSR(r0)
30 mov lr, pc
31 mov pc, r2
32 LOADREGS(fd, sp!, {r4 - r12, pc})
33
34@ Purpose: call an expansion card loader to reset the card
35@ Proto : void read_loader(int card_base, char *loader);
36@ Returns: byte read
37
38ENTRY(ecard_loader_reset)
39 stmfd sp!, {r4 - r12, lr}
40 mov r11, r0
41 CPSR2SPSR(r0)
42 mov lr, pc
43 add pc, r1, #8
44 LOADREGS(fd, sp!, {r4 - r12, pc})
45
diff --git a/arch/arm/lib/findbit.S b/arch/arm/lib/findbit.S
new file mode 100644
index 000000000000..f055d56ea68a
--- /dev/null
+++ b/arch/arm/lib/findbit.S
@@ -0,0 +1,168 @@
1/*
2 * linux/arch/arm/lib/findbit.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * 16th March 2001 - John Ripley <jripley@sonicblue.com>
11 * Fixed so that "size" is an exclusive not an inclusive quantity.
12 * All users of these functions expect exclusive sizes, and may
13 * also call with zero size.
14 * Reworked by rmk.
15 */
16#include <linux/linkage.h>
17#include <asm/assembler.h>
18 .text
19
20/*
21 * Purpose : Find a 'zero' bit
22 * Prototype: int find_first_zero_bit(void *addr, unsigned int maxbit);
23 */
24ENTRY(_find_first_zero_bit_le)
25 teq r1, #0
26 beq 3f
27 mov r2, #0
281: ldrb r3, [r0, r2, lsr #3]
29 eors r3, r3, #0xff @ invert bits
30 bne .found @ any now set - found zero bit
31 add r2, r2, #8 @ next bit pointer
322: cmp r2, r1 @ any more?
33 blo 1b
343: mov r0, r1 @ no free bits
35 RETINSTR(mov,pc,lr)
36
37/*
38 * Purpose : Find next 'zero' bit
39 * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
40 */
41ENTRY(_find_next_zero_bit_le)
42 teq r1, #0
43 beq 3b
44 ands ip, r2, #7
45 beq 1b @ If new byte, goto old routine
46 ldrb r3, [r0, r2, lsr #3]
47 eor r3, r3, #0xff @ now looking for a 1 bit
48 movs r3, r3, lsr ip @ shift off unused bits
49 bne .found
50 orr r2, r2, #7 @ if zero, then no bits here
51 add r2, r2, #1 @ align bit pointer
52 b 2b @ loop for next bit
53
54/*
55 * Purpose : Find a 'one' bit
56 * Prototype: int find_first_bit(const unsigned long *addr, unsigned int maxbit);
57 */
58ENTRY(_find_first_bit_le)
59 teq r1, #0
60 beq 3f
61 mov r2, #0
621: ldrb r3, [r0, r2, lsr #3]
63 movs r3, r3
64 bne .found @ any now set - found zero bit
65 add r2, r2, #8 @ next bit pointer
662: cmp r2, r1 @ any more?
67 blo 1b
683: mov r0, r1 @ no free bits
69 RETINSTR(mov,pc,lr)
70
71/*
72 * Purpose : Find next 'one' bit
73 * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
74 */
75ENTRY(_find_next_bit_le)
76 teq r1, #0
77 beq 3b
78 ands ip, r2, #7
79 beq 1b @ If new byte, goto old routine
80 ldrb r3, [r0, r2, lsr #3]
81 movs r3, r3, lsr ip @ shift off unused bits
82 bne .found
83 orr r2, r2, #7 @ if zero, then no bits here
84 add r2, r2, #1 @ align bit pointer
85 b 2b @ loop for next bit
86
87#ifdef __ARMEB__
88
89ENTRY(_find_first_zero_bit_be)
90 teq r1, #0
91 beq 3f
92 mov r2, #0
931: eor r3, r2, #0x18 @ big endian byte ordering
94 ldrb r3, [r0, r3, lsr #3]
95 eors r3, r3, #0xff @ invert bits
96 bne .found @ any now set - found zero bit
97 add r2, r2, #8 @ next bit pointer
982: cmp r2, r1 @ any more?
99 blo 1b
1003: mov r0, r1 @ no free bits
101 RETINSTR(mov,pc,lr)
102
103ENTRY(_find_next_zero_bit_be)
104 teq r1, #0
105 beq 3b
106 ands ip, r2, #7
107 beq 1b @ If new byte, goto old routine
108 eor r3, r2, #0x18 @ big endian byte ordering
109 ldrb r3, [r0, r3, lsr #3]
110 eor r3, r3, #0xff @ now looking for a 1 bit
111 movs r3, r3, lsr ip @ shift off unused bits
112 bne .found
113 orr r2, r2, #7 @ if zero, then no bits here
114 add r2, r2, #1 @ align bit pointer
115 b 2b @ loop for next bit
116
117ENTRY(_find_first_bit_be)
118 teq r1, #0
119 beq 3f
120 mov r2, #0
1211: eor r3, r2, #0x18 @ big endian byte ordering
122 ldrb r3, [r0, r3, lsr #3]
123 movs r3, r3
124 bne .found @ any now set - found zero bit
125 add r2, r2, #8 @ next bit pointer
1262: cmp r2, r1 @ any more?
127 blo 1b
1283: mov r0, r1 @ no free bits
129 RETINSTR(mov,pc,lr)
130
131ENTRY(_find_next_bit_be)
132 teq r1, #0
133 beq 3b
134 ands ip, r2, #7
135 beq 1b @ If new byte, goto old routine
136 eor r3, r2, #0x18 @ big endian byte ordering
137 ldrb r3, [r0, r3, lsr #3]
138 movs r3, r3, lsr ip @ shift off unused bits
139 bne .found
140 orr r2, r2, #7 @ if zero, then no bits here
141 add r2, r2, #1 @ align bit pointer
142 b 2b @ loop for next bit
143
144#endif
145
146/*
147 * One or more bits in the LSB of r3 are assumed to be set.
148 */
149.found:
150#if __LINUX_ARM_ARCH__ >= 5
151 rsb r1, r3, #0
152 and r3, r3, r1
153 clz r3, r3
154 rsb r3, r3, #31
155 add r0, r2, r3
156#else
157 tst r3, #0x0f
158 addeq r2, r2, #4
159 movne r3, r3, lsl #4
160 tst r3, #0x30
161 addeq r2, r2, #2
162 movne r3, r3, lsl #2
163 tst r3, #0x40
164 addeq r2, r2, #1
165 mov r0, r2
166#endif
167 RETINSTR(mov,pc,lr)
168
diff --git a/arch/arm/lib/floppydma.S b/arch/arm/lib/floppydma.S
new file mode 100644
index 000000000000..617150b1baef
--- /dev/null
+++ b/arch/arm/lib/floppydma.S
@@ -0,0 +1,32 @@
1/*
2 * linux/arch/arm/lib/floppydma.S
3 *
4 * Copyright (C) 1995, 1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12 .text
13
14 .global floppy_fiqin_end
15ENTRY(floppy_fiqin_start)
16 subs r9, r9, #1
17 ldrgtb r12, [r11, #-4]
18 ldrleb r12, [r11], #0
19 strb r12, [r10], #1
20 subs pc, lr, #4
21floppy_fiqin_end:
22
23 .global floppy_fiqout_end
24ENTRY(floppy_fiqout_start)
25 subs r9, r9, #1
26 ldrgeb r12, [r10], #1
27 movlt r12, #0
28 strleb r12, [r11], #0
29 subles pc, lr, #4
30 strb r12, [r11, #-4]
31 subs pc, lr, #4
32floppy_fiqout_end:
diff --git a/arch/arm/lib/gcclib.h b/arch/arm/lib/gcclib.h
new file mode 100644
index 000000000000..65314a3d9e27
--- /dev/null
+++ b/arch/arm/lib/gcclib.h
@@ -0,0 +1,25 @@
1/* gcclib.h -- definitions for various functions 'borrowed' from gcc-2.95.3 */
2/* I Molton 29/07/01 */
3
4#define BITS_PER_UNIT 8
5#define SI_TYPE_SIZE (sizeof (SItype) * BITS_PER_UNIT)
6
7typedef unsigned int UQItype __attribute__ ((mode (QI)));
8typedef int SItype __attribute__ ((mode (SI)));
9typedef unsigned int USItype __attribute__ ((mode (SI)));
10typedef int DItype __attribute__ ((mode (DI)));
11typedef int word_type __attribute__ ((mode (__word__)));
12typedef unsigned int UDItype __attribute__ ((mode (DI)));
13
14#ifdef __ARMEB__
15 struct DIstruct {SItype high, low;};
16#else
17 struct DIstruct {SItype low, high;};
18#endif
19
20typedef union
21{
22 struct DIstruct s;
23 DItype ll;
24} DIunion;
25
diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S
new file mode 100644
index 000000000000..64aa6f4fe5e4
--- /dev/null
+++ b/arch/arm/lib/getuser.S
@@ -0,0 +1,78 @@
1/*
2 * linux/arch/arm/lib/getuser.S
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Idea from x86 version, (C) Copyright 1998 Linus Torvalds
11 *
12 * These functions have a non-standard call interface to make them more
13 * efficient, especially as they return an error value in addition to
14 * the "real" return value.
15 *
16 * __get_user_X
17 *
18 * Inputs: r0 contains the address
19 * Outputs: r0 is the error code
20 * r2, r3 contains the zero-extended value
21 * lr corrupted
22 *
23 * No other registers must be altered. (see include/asm-arm/uaccess.h
24 * for specific ASM register usage).
25 *
26 * Note that ADDR_LIMIT is either 0 or 0xc0000000.
27 * Note also that it is intended that __get_user_bad is not global.
28 */
29#include <asm/constants.h>
30#include <asm/thread_info.h>
31#include <asm/errno.h>
32
33 .global __get_user_1
34__get_user_1:
351: ldrbt r2, [r0]
36 mov r0, #0
37 mov pc, lr
38
39 .global __get_user_2
40__get_user_2:
412: ldrbt r2, [r0], #1
423: ldrbt r3, [r0]
43#ifndef __ARMEB__
44 orr r2, r2, r3, lsl #8
45#else
46 orr r2, r3, r2, lsl #8
47#endif
48 mov r0, #0
49 mov pc, lr
50
51 .global __get_user_4
52__get_user_4:
534: ldrt r2, [r0]
54 mov r0, #0
55 mov pc, lr
56
57 .global __get_user_8
58__get_user_8:
595: ldrt r2, [r0], #4
606: ldrt r3, [r0]
61 mov r0, #0
62 mov pc, lr
63
64__get_user_bad_8:
65 mov r3, #0
66__get_user_bad:
67 mov r2, #0
68 mov r0, #-EFAULT
69 mov pc, lr
70
71.section __ex_table, "a"
72 .long 1b, __get_user_bad
73 .long 2b, __get_user_bad
74 .long 3b, __get_user_bad
75 .long 4b, __get_user_bad
76 .long 5b, __get_user_bad_8
77 .long 6b, __get_user_bad_8
78.previous
diff --git a/arch/arm/lib/io-acorn.S b/arch/arm/lib/io-acorn.S
new file mode 100644
index 000000000000..3aacd01d40e1
--- /dev/null
+++ b/arch/arm/lib/io-acorn.S
@@ -0,0 +1,32 @@
1/*
2 * linux/arch/arm/lib/io-acorn.S
3 *
4 * Copyright (C) 1995, 1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * 27/03/03 Ian Molton Clean up CONFIG_CPU
11 *
12 */
13#include <linux/linkage.h>
14#include <asm/assembler.h>
15#include <asm/hardware.h>
16
17 .text
18 .align
19
20.iosl_warning:
21 .ascii "<4>insl/outsl not implemented, called from %08lX\0"
22 .align
23
24/*
25 * These make no sense on Acorn machines.
26 * Print a warning message.
27 */
28ENTRY(insl)
29ENTRY(outsl)
30 adr r0, .iosl_warning
31 mov r1, lr
32 b printk
diff --git a/arch/arm/lib/io-readsb.S b/arch/arm/lib/io-readsb.S
new file mode 100644
index 000000000000..081ef749298a
--- /dev/null
+++ b/arch/arm/lib/io-readsb.S
@@ -0,0 +1,122 @@
1/*
2 * linux/arch/arm/lib/io-readsb.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12
13.insb_align: rsb ip, ip, #4
14 cmp ip, r2
15 movgt ip, r2
16 cmp ip, #2
17 ldrb r3, [r0]
18 strb r3, [r1], #1
19 ldrgeb r3, [r0]
20 strgeb r3, [r1], #1
21 ldrgtb r3, [r0]
22 strgtb r3, [r1], #1
23 subs r2, r2, ip
24 bne .insb_aligned
25
26ENTRY(__raw_readsb)
27 teq r2, #0 @ do we have to check for the zero len?
28 moveq pc, lr
29 ands ip, r1, #3
30 bne .insb_align
31
32.insb_aligned: stmfd sp!, {r4 - r6, lr}
33
34 subs r2, r2, #16
35 bmi .insb_no_16
36
37.insb_16_lp: ldrb r3, [r0]
38 ldrb r4, [r0]
39 ldrb r5, [r0]
40 mov r3, r3, put_byte_0
41 ldrb r6, [r0]
42 orr r3, r3, r4, put_byte_1
43 ldrb r4, [r0]
44 orr r3, r3, r5, put_byte_2
45 ldrb r5, [r0]
46 orr r3, r3, r6, put_byte_3
47 ldrb r6, [r0]
48 mov r4, r4, put_byte_0
49 ldrb ip, [r0]
50 orr r4, r4, r5, put_byte_1
51 ldrb r5, [r0]
52 orr r4, r4, r6, put_byte_2
53 ldrb r6, [r0]
54 orr r4, r4, ip, put_byte_3
55 ldrb ip, [r0]
56 mov r5, r5, put_byte_0
57 ldrb lr, [r0]
58 orr r5, r5, r6, put_byte_1
59 ldrb r6, [r0]
60 orr r5, r5, ip, put_byte_2
61 ldrb ip, [r0]
62 orr r5, r5, lr, put_byte_3
63 ldrb lr, [r0]
64 mov r6, r6, put_byte_0
65 orr r6, r6, ip, put_byte_1
66 ldrb ip, [r0]
67 orr r6, r6, lr, put_byte_2
68 orr r6, r6, ip, put_byte_3
69 stmia r1!, {r3 - r6}
70
71 subs r2, r2, #16
72 bpl .insb_16_lp
73
74 tst r2, #15
75 LOADREGS(eqfd, sp!, {r4 - r6, pc})
76
77.insb_no_16: tst r2, #8
78 beq .insb_no_8
79
80 ldrb r3, [r0]
81 ldrb r4, [r0]
82 ldrb r5, [r0]
83 mov r3, r3, put_byte_0
84 ldrb r6, [r0]
85 orr r3, r3, r4, put_byte_1
86 ldrb r4, [r0]
87 orr r3, r3, r5, put_byte_2
88 ldrb r5, [r0]
89 orr r3, r3, r6, put_byte_3
90 ldrb r6, [r0]
91 mov r4, r4, put_byte_0
92 ldrb ip, [r0]
93 orr r4, r4, r5, put_byte_1
94 orr r4, r4, r6, put_byte_2
95 orr r4, r4, ip, put_byte_3
96 stmia r1!, {r3, r4}
97
98.insb_no_8: tst r2, #4
99 beq .insb_no_4
100
101 ldrb r3, [r0]
102 ldrb r4, [r0]
103 ldrb r5, [r0]
104 ldrb r6, [r0]
105 mov r3, r3, put_byte_0
106 orr r3, r3, r4, put_byte_1
107 orr r3, r3, r5, put_byte_2
108 orr r3, r3, r6, put_byte_3
109 str r3, [r1], #4
110
111.insb_no_4: ands r2, r2, #3
112 LOADREGS(eqfd, sp!, {r4 - r6, pc})
113
114 cmp r2, #2
115 ldrb r3, [r0]
116 strb r3, [r1], #1
117 ldrgeb r3, [r0]
118 strgeb r3, [r1], #1
119 ldrgtb r3, [r0]
120 strgtb r3, [r1]
121
122 LOADREGS(fd, sp!, {r4 - r6, pc})
diff --git a/arch/arm/lib/io-readsl.S b/arch/arm/lib/io-readsl.S
new file mode 100644
index 000000000000..75a9121cb23f
--- /dev/null
+++ b/arch/arm/lib/io-readsl.S
@@ -0,0 +1,78 @@
1/*
2 * linux/arch/arm/lib/io-readsl.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12
13ENTRY(__raw_readsl)
14 teq r2, #0 @ do we have to check for the zero len?
15 moveq pc, lr
16 ands ip, r1, #3
17 bne 3f
18
19 subs r2, r2, #4
20 bmi 2f
21 stmfd sp!, {r4, lr}
221: ldr r3, [r0, #0]
23 ldr r4, [r0, #0]
24 ldr ip, [r0, #0]
25 ldr lr, [r0, #0]
26 subs r2, r2, #4
27 stmia r1!, {r3, r4, ip, lr}
28 bpl 1b
29 ldmfd sp!, {r4, lr}
302: movs r2, r2, lsl #31
31 ldrcs r3, [r0, #0]
32 ldrcs ip, [r0, #0]
33 stmcsia r1!, {r3, ip}
34 ldrne r3, [r0, #0]
35 strne r3, [r1, #0]
36 mov pc, lr
37
383: ldr r3, [r0]
39 cmp ip, #2
40 mov ip, r3, get_byte_0
41 strb ip, [r1], #1
42 bgt 6f
43 mov ip, r3, get_byte_1
44 strb ip, [r1], #1
45 beq 5f
46 mov ip, r3, get_byte_2
47 strb ip, [r1], #1
48
494: subs r2, r2, #1
50 mov ip, r3, pull #24
51 ldrne r3, [r0]
52 orrne ip, ip, r3, push #8
53 strne ip, [r1], #4
54 bne 4b
55 b 8f
56
575: subs r2, r2, #1
58 mov ip, r3, pull #16
59 ldrne r3, [r0]
60 orrne ip, ip, r3, push #16
61 strne ip, [r1], #4
62 bne 5b
63 b 7f
64
656: subs r2, r2, #1
66 mov ip, r3, pull #8
67 ldrne r3, [r0]
68 orrne ip, ip, r3, push #24
69 strne ip, [r1], #4
70 bne 6b
71
72 mov r3, ip, get_byte_2
73 strb r3, [r1, #2]
747: mov r3, ip, get_byte_1
75 strb r3, [r1, #1]
768: mov r3, ip, get_byte_0
77 strb r3, [r1, #0]
78 mov pc, lr
diff --git a/arch/arm/lib/io-readsw-armv3.S b/arch/arm/lib/io-readsw-armv3.S
new file mode 100644
index 000000000000..476cf7f8a633
--- /dev/null
+++ b/arch/arm/lib/io-readsw-armv3.S
@@ -0,0 +1,107 @@
1/*
2 * linux/arch/arm/lib/io-readsw-armv3.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12#include <asm/hardware.h>
13
14.insw_bad_alignment:
15 adr r0, .insw_bad_align_msg
16 mov r2, lr
17 b panic
18.insw_bad_align_msg:
19 .asciz "insw: bad buffer alignment (0x%p, lr=0x%08lX)\n"
20 .align
21
22.insw_align: tst r1, #1
23 bne .insw_bad_alignment
24
25 ldr r3, [r0]
26 strb r3, [r1], #1
27 mov r3, r3, lsr #8
28 strb r3, [r1], #1
29
30 subs r2, r2, #1
31 RETINSTR(moveq, pc, lr)
32
33ENTRY(__raw_readsw)
34 teq r2, #0 @ do we have to check for the zero len?
35 moveq pc, lr
36 tst r1, #3
37 bne .insw_align
38
39.insw_aligned: mov ip, #0xff
40 orr ip, ip, ip, lsl #8
41 stmfd sp!, {r4, r5, r6, lr}
42
43 subs r2, r2, #8
44 bmi .no_insw_8
45
46.insw_8_lp: ldr r3, [r0]
47 and r3, r3, ip
48 ldr r4, [r0]
49 orr r3, r3, r4, lsl #16
50
51 ldr r4, [r0]
52 and r4, r4, ip
53 ldr r5, [r0]
54 orr r4, r4, r5, lsl #16
55
56 ldr r5, [r0]
57 and r5, r5, ip
58 ldr r6, [r0]
59 orr r5, r5, r6, lsl #16
60
61 ldr r6, [r0]
62 and r6, r6, ip
63 ldr lr, [r0]
64 orr r6, r6, lr, lsl #16
65
66 stmia r1!, {r3 - r6}
67
68 subs r2, r2, #8
69 bpl .insw_8_lp
70
71 tst r2, #7
72 LOADREGS(eqfd, sp!, {r4, r5, r6, pc})
73
74.no_insw_8: tst r2, #4
75 beq .no_insw_4
76
77 ldr r3, [r0]
78 and r3, r3, ip
79 ldr r4, [r0]
80 orr r3, r3, r4, lsl #16
81
82 ldr r4, [r0]
83 and r4, r4, ip
84 ldr r5, [r0]
85 orr r4, r4, r5, lsl #16
86
87 stmia r1!, {r3, r4}
88
89.no_insw_4: tst r2, #2
90 beq .no_insw_2
91
92 ldr r3, [r0]
93 and r3, r3, ip
94 ldr r4, [r0]
95 orr r3, r3, r4, lsl #16
96
97 str r3, [r1], #4
98
99.no_insw_2: tst r2, #1
100 ldrne r3, [r0]
101 strneb r3, [r1], #1
102 movne r3, r3, lsr #8
103 strneb r3, [r1]
104
105 LOADREGS(fd, sp!, {r4, r5, r6, pc})
106
107
diff --git a/arch/arm/lib/io-readsw-armv4.S b/arch/arm/lib/io-readsw-armv4.S
new file mode 100644
index 000000000000..c92b66ecbe86
--- /dev/null
+++ b/arch/arm/lib/io-readsw-armv4.S
@@ -0,0 +1,130 @@
1/*
2 * linux/arch/arm/lib/io-readsw-armv4.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12
13 .macro pack, rd, hw1, hw2
14#ifndef __ARMEB__
15 orr \rd, \hw1, \hw2, lsl #16
16#else
17 orr \rd, \hw2, \hw1, lsl #16
18#endif
19 .endm
20
21.insw_align: movs ip, r1, lsl #31
22 bne .insw_noalign
23 ldrh ip, [r0]
24 sub r2, r2, #1
25 strh ip, [r1], #2
26
27ENTRY(__raw_readsw)
28 teq r2, #0
29 moveq pc, lr
30 tst r1, #3
31 bne .insw_align
32
33 stmfd sp!, {r4, r5, lr}
34
35 subs r2, r2, #8
36 bmi .no_insw_8
37
38.insw_8_lp: ldrh r3, [r0]
39 ldrh r4, [r0]
40 pack r3, r3, r4
41
42 ldrh r4, [r0]
43 ldrh r5, [r0]
44 pack r4, r4, r5
45
46 ldrh r5, [r0]
47 ldrh ip, [r0]
48 pack r5, r5, ip
49
50 ldrh ip, [r0]
51 ldrh lr, [r0]
52 pack ip, ip, lr
53
54 subs r2, r2, #8
55 stmia r1!, {r3 - r5, ip}
56 bpl .insw_8_lp
57
58.no_insw_8: tst r2, #4
59 beq .no_insw_4
60
61 ldrh r3, [r0]
62 ldrh r4, [r0]
63 pack r3, r3, r4
64
65 ldrh r4, [r0]
66 ldrh ip, [r0]
67 pack r4, r4, ip
68
69 stmia r1!, {r3, r4}
70
71.no_insw_4: movs r2, r2, lsl #31
72 bcc .no_insw_2
73
74 ldrh r3, [r0]
75 ldrh ip, [r0]
76 pack r3, r3, ip
77 str r3, [r1], #4
78
79.no_insw_2: ldrneh r3, [r0]
80 strneh r3, [r1]
81
82 ldmfd sp!, {r4, r5, pc}
83
84#ifdef __ARMEB__
85#define _BE_ONLY_(code...) code
86#define _LE_ONLY_(code...)
87#define push_hbyte0 lsr #8
88#define pull_hbyte1 lsl #24
89#else
90#define _BE_ONLY_(code...)
91#define _LE_ONLY_(code...) code
92#define push_hbyte0 lsl #24
93#define pull_hbyte1 lsr #8
94#endif
95
96.insw_noalign: stmfd sp!, {r4, lr}
97 ldrccb ip, [r1, #-1]!
98 bcc 1f
99
100 ldrh ip, [r0]
101 sub r2, r2, #1
102 _BE_ONLY_( mov ip, ip, ror #8 )
103 strb ip, [r1], #1
104 _LE_ONLY_( mov ip, ip, lsr #8 )
105 _BE_ONLY_( mov ip, ip, lsr #24 )
106
1071: subs r2, r2, #2
108 bmi 3f
109 _BE_ONLY_( mov ip, ip, lsl #24 )
110
1112: ldrh r3, [r0]
112 ldrh r4, [r0]
113 subs r2, r2, #2
114 orr ip, ip, r3, lsl #8
115 orr ip, ip, r4, push_hbyte0
116 str ip, [r1], #4
117 mov ip, r4, pull_hbyte1
118 bpl 2b
119
120 _BE_ONLY_( mov ip, ip, lsr #24 )
121
1223: tst r2, #1
123 strb ip, [r1], #1
124 ldrneh ip, [r0]
125 _BE_ONLY_( movne ip, ip, ror #8 )
126 strneb ip, [r1], #1
127 _LE_ONLY_( movne ip, ip, lsr #8 )
128 _BE_ONLY_( movne ip, ip, lsr #24 )
129 strneb ip, [r1]
130 ldmfd sp!, {r4, pc}
diff --git a/arch/arm/lib/io-shark.c b/arch/arm/lib/io-shark.c
new file mode 100644
index 000000000000..108d4573e970
--- /dev/null
+++ b/arch/arm/lib/io-shark.c
@@ -0,0 +1,83 @@
1/*
2 * linux/arch/arm/lib/io-shark.c
3 *
4 * by Alexander Schulz
5 *
6 * derived from:
7 * linux/arch/arm/lib/io-ebsa.S
8 * Copyright (C) 1995, 1996 Russell King
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14#include <linux/kernel.h>
15
16#include <asm/io.h>
17
18void print_warning(void)
19{
20 printk(KERN_WARNING "ins?/outs? not implemented on this architecture\n");
21}
22
23void insl(unsigned int port, void *to, int len)
24{
25 print_warning();
26}
27
28void insb(unsigned int port, void *to, int len)
29{
30 print_warning();
31}
32
33void outsl(unsigned int port, const void *from, int len)
34{
35 print_warning();
36}
37
38void outsb(unsigned int port, const void *from, int len)
39{
40 print_warning();
41}
42
43/* these should be in assembler again */
44
45/*
46 * Purpose: read a block of data from a hardware register to memory.
47 * Proto : insw(int from_port, void *to, int len_in_words);
48 * Proto : inswb(int from_port, void *to, int len_in_bytes);
49 * Notes : increment to
50 */
51
52void insw(unsigned int port, void *to, int len)
53{
54 int i;
55
56 for (i = 0; i < len; i++)
57 ((unsigned short *) to)[i] = inw(port);
58}
59
60void inswb(unsigned int port, void *to, int len)
61{
62 insw(port, to, len >> 2);
63}
64
65/*
66 * Purpose: write a block of data from memory to a hardware register.
67 * Proto : outsw(int to_reg, void *from, int len_in_words);
68 * Proto : outswb(int to_reg, void *from, int len_in_bytes);
69 * Notes : increments from
70 */
71
72void outsw(unsigned int port, const void *from, int len)
73{
74 int i;
75
76 for (i = 0; i < len; i++)
77 outw(((unsigned short *) from)[i], port);
78}
79
80void outswb(unsigned int port, const void *from, int len)
81{
82 outsw(port, from, len >> 2);
83}
diff --git a/arch/arm/lib/io-writesb.S b/arch/arm/lib/io-writesb.S
new file mode 100644
index 000000000000..70b2561bdb09
--- /dev/null
+++ b/arch/arm/lib/io-writesb.S
@@ -0,0 +1,92 @@
1/*
2 * linux/arch/arm/lib/io-writesb.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12
13 .macro outword, rd
14#ifndef __ARMEB__
15 strb \rd, [r0]
16 mov \rd, \rd, lsr #8
17 strb \rd, [r0]
18 mov \rd, \rd, lsr #8
19 strb \rd, [r0]
20 mov \rd, \rd, lsr #8
21 strb \rd, [r0]
22#else
23 mov lr, \rd, lsr #24
24 strb lr, [r0]
25 mov lr, \rd, lsr #16
26 strb lr, [r0]
27 mov lr, \rd, lsr #8
28 strb lr, [r0]
29 strb \rd, [r0]
30#endif
31 .endm
32
33.outsb_align: rsb ip, ip, #4
34 cmp ip, r2
35 movgt ip, r2
36 cmp ip, #2
37 ldrb r3, [r1], #1
38 strb r3, [r0]
39 ldrgeb r3, [r1], #1
40 strgeb r3, [r0]
41 ldrgtb r3, [r1], #1
42 strgtb r3, [r0]
43 subs r2, r2, ip
44 bne .outsb_aligned
45
46ENTRY(__raw_writesb)
47 teq r2, #0 @ do we have to check for the zero len?
48 moveq pc, lr
49 ands ip, r1, #3
50 bne .outsb_align
51
52.outsb_aligned: stmfd sp!, {r4, r5, lr}
53
54 subs r2, r2, #16
55 bmi .outsb_no_16
56
57.outsb_16_lp: ldmia r1!, {r3, r4, r5, ip}
58 outword r3
59 outword r4
60 outword r5
61 outword ip
62 subs r2, r2, #16
63 bpl .outsb_16_lp
64
65 tst r2, #15
66 LOADREGS(eqfd, sp!, {r4, r5, pc})
67
68.outsb_no_16: tst r2, #8
69 beq .outsb_no_8
70
71 ldmia r1!, {r3, r4}
72 outword r3
73 outword r4
74
75.outsb_no_8: tst r2, #4
76 beq .outsb_no_4
77
78 ldr r3, [r1], #4
79 outword r3
80
81.outsb_no_4: ands r2, r2, #3
82 LOADREGS(eqfd, sp!, {r4, r5, pc})
83
84 cmp r2, #2
85 ldrb r3, [r1], #1
86 strb r3, [r0]
87 ldrgeb r3, [r1], #1
88 strgeb r3, [r0]
89 ldrgtb r3, [r1]
90 strgtb r3, [r0]
91
92 LOADREGS(fd, sp!, {r4, r5, pc})
diff --git a/arch/arm/lib/io-writesl.S b/arch/arm/lib/io-writesl.S
new file mode 100644
index 000000000000..f8f14dd227ca
--- /dev/null
+++ b/arch/arm/lib/io-writesl.S
@@ -0,0 +1,66 @@
1/*
2 * linux/arch/arm/lib/io-writesl.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12
13ENTRY(__raw_writesl)
14 teq r2, #0 @ do we have to check for the zero len?
15 moveq pc, lr
16 ands ip, r1, #3
17 bne 3f
18
19 subs r2, r2, #4
20 bmi 2f
21 stmfd sp!, {r4, lr}
221: ldmia r1!, {r3, r4, ip, lr}
23 subs r2, r2, #4
24 str r3, [r0, #0]
25 str r4, [r0, #0]
26 str ip, [r0, #0]
27 str lr, [r0, #0]
28 bpl 1b
29 ldmfd sp!, {r4, lr}
302: movs r2, r2, lsl #31
31 ldmcsia r1!, {r3, ip}
32 strcs r3, [r0, #0]
33 ldrne r3, [r1, #0]
34 strcs ip, [r0, #0]
35 strne r3, [r0, #0]
36 mov pc, lr
37
383: bic r1, r1, #3
39 ldr r3, [r1], #4
40 cmp ip, #2
41 blt 5f
42 bgt 6f
43
444: mov ip, r3, pull #16
45 ldr r3, [r1], #4
46 subs r2, r2, #1
47 orr ip, ip, r3, push #16
48 str ip, [r0]
49 bne 4b
50 mov pc, lr
51
525: mov ip, r3, pull #8
53 ldr r3, [r1], #4
54 subs r2, r2, #1
55 orr ip, ip, r3, push #24
56 str ip, [r0]
57 bne 5b
58 mov pc, lr
59
606: mov ip, r3, pull #24
61 ldr r3, [r1], #4
62 subs r2, r2, #1
63 orr ip, ip, r3, push #8
64 str ip, [r0]
65 bne 6b
66 mov pc, lr
diff --git a/arch/arm/lib/io-writesw-armv3.S b/arch/arm/lib/io-writesw-armv3.S
new file mode 100644
index 000000000000..950e7e310f1a
--- /dev/null
+++ b/arch/arm/lib/io-writesw-armv3.S
@@ -0,0 +1,127 @@
1/*
2 * linux/arch/arm/lib/io-writesw-armv3.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12#include <asm/hardware.h>
13
14.outsw_bad_alignment:
15 adr r0, .outsw_bad_align_msg
16 mov r2, lr
17 b panic
18.outsw_bad_align_msg:
19 .asciz "outsw: bad buffer alignment (0x%p, lr=0x%08lX)\n"
20 .align
21
22.outsw_align: tst r1, #1
23 bne .outsw_bad_alignment
24
25 add r1, r1, #2
26
27 ldr r3, [r1, #-4]
28 mov r3, r3, lsr #16
29 orr r3, r3, r3, lsl #16
30 str r3, [r0]
31 subs r2, r2, #1
32 RETINSTR(moveq, pc, lr)
33
34ENTRY(__raw_writesw)
35 teq r2, #0 @ do we have to check for the zero len?
36 moveq pc, lr
37 tst r1, #3
38 bne .outsw_align
39
40.outsw_aligned: stmfd sp!, {r4, r5, r6, lr}
41
42 subs r2, r2, #8
43 bmi .no_outsw_8
44
45.outsw_8_lp: ldmia r1!, {r3, r4, r5, r6}
46
47 mov ip, r3, lsl #16
48 orr ip, ip, ip, lsr #16
49 str ip, [r0]
50
51 mov ip, r3, lsr #16
52 orr ip, ip, ip, lsl #16
53 str ip, [r0]
54
55 mov ip, r4, lsl #16
56 orr ip, ip, ip, lsr #16
57 str ip, [r0]
58
59 mov ip, r4, lsr #16
60 orr ip, ip, ip, lsl #16
61 str ip, [r0]
62
63 mov ip, r5, lsl #16
64 orr ip, ip, ip, lsr #16
65 str ip, [r0]
66
67 mov ip, r5, lsr #16
68 orr ip, ip, ip, lsl #16
69 str ip, [r0]
70
71 mov ip, r6, lsl #16
72 orr ip, ip, ip, lsr #16
73 str ip, [r0]
74
75 mov ip, r6, lsr #16
76 orr ip, ip, ip, lsl #16
77 str ip, [r0]
78
79 subs r2, r2, #8
80 bpl .outsw_8_lp
81
82 tst r2, #7
83 LOADREGS(eqfd, sp!, {r4, r5, r6, pc})
84
85.no_outsw_8: tst r2, #4
86 beq .no_outsw_4
87
88 ldmia r1!, {r3, r4}
89
90 mov ip, r3, lsl #16
91 orr ip, ip, ip, lsr #16
92 str ip, [r0]
93
94 mov ip, r3, lsr #16
95 orr ip, ip, ip, lsl #16
96 str ip, [r0]
97
98 mov ip, r4, lsl #16
99 orr ip, ip, ip, lsr #16
100 str ip, [r0]
101
102 mov ip, r4, lsr #16
103 orr ip, ip, ip, lsl #16
104 str ip, [r0]
105
106.no_outsw_4: tst r2, #2
107 beq .no_outsw_2
108
109 ldr r3, [r1], #4
110
111 mov ip, r3, lsl #16
112 orr ip, ip, ip, lsr #16
113 str ip, [r0]
114
115 mov ip, r3, lsr #16
116 orr ip, ip, ip, lsl #16
117 str ip, [r0]
118
119.no_outsw_2: tst r2, #1
120
121 ldrne r3, [r1]
122
123 movne ip, r3, lsl #16
124 orrne ip, ip, ip, lsr #16
125 strne ip, [r0]
126
127 LOADREGS(fd, sp!, {r4, r5, r6, pc})
diff --git a/arch/arm/lib/io-writesw-armv4.S b/arch/arm/lib/io-writesw-armv4.S
new file mode 100644
index 000000000000..6d1d7c27806e
--- /dev/null
+++ b/arch/arm/lib/io-writesw-armv4.S
@@ -0,0 +1,95 @@
1/*
2 * linux/arch/arm/lib/io-writesw-armv4.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12
13 .macro outword, rd
14#ifndef __ARMEB__
15 strh \rd, [r0]
16 mov \rd, \rd, lsr #16
17 strh \rd, [r0]
18#else
19 mov lr, \rd, lsr #16
20 strh lr, [r0]
21 strh \rd, [r0]
22#endif
23 .endm
24
25.outsw_align: movs ip, r1, lsl #31
26 bne .outsw_noalign
27
28 ldrh r3, [r1], #2
29 sub r2, r2, #1
30 strh r3, [r0]
31
32ENTRY(__raw_writesw)
33 teq r2, #0
34 moveq pc, lr
35 ands r3, r1, #3
36 bne .outsw_align
37
38 stmfd sp!, {r4, r5, lr}
39
40 subs r2, r2, #8
41 bmi .no_outsw_8
42
43.outsw_8_lp: ldmia r1!, {r3, r4, r5, ip}
44 subs r2, r2, #8
45 outword r3
46 outword r4
47 outword r5
48 outword ip
49 bpl .outsw_8_lp
50
51.no_outsw_8: tst r2, #4
52 beq .no_outsw_4
53
54 ldmia r1!, {r3, ip}
55 outword r3
56 outword ip
57
58.no_outsw_4: movs r2, r2, lsl #31
59 bcc .no_outsw_2
60
61 ldr r3, [r1], #4
62 outword r3
63
64.no_outsw_2: ldrneh r3, [r1]
65 strneh r3, [r0]
66
67 ldmfd sp!, {r4, r5, pc}
68
69#ifdef __ARMEB__
70#define pull_hbyte0 lsl #8
71#define push_hbyte1 lsr #24
72#else
73#define pull_hbyte0 lsr #24
74#define push_hbyte1 lsl #8
75#endif
76
77.outsw_noalign: ldr r3, [r1, -r3]!
78 subcs r2, r2, #1
79 bcs 2f
80 subs r2, r2, #2
81 bmi 3f
82
831: mov ip, r3, lsr #8
84 strh ip, [r0]
852: mov ip, r3, pull_hbyte0
86 ldr r3, [r1, #4]!
87 subs r2, r2, #2
88 orr ip, ip, r3, push_hbyte1
89 strh ip, [r0]
90 bpl 2b
91
923: tst r2, #1
932: movne ip, r3, lsr #8
94 strneh ip, [r0]
95 mov pc, lr
diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S
new file mode 100644
index 000000000000..59026029d017
--- /dev/null
+++ b/arch/arm/lib/lib1funcs.S
@@ -0,0 +1,314 @@
1/*
2 * linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
3 *
4 * Author: Nicolas Pitre <nico@cam.org>
5 * - contributed to gcc-3.4 on Sep 30, 2003
6 * - adapted for the Linux kernel on Oct 2, 2003
7 */
8
9/* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
10
11This file is free software; you can redistribute it and/or modify it
12under the terms of the GNU General Public License as published by the
13Free Software Foundation; either version 2, or (at your option) any
14later version.
15
16In addition to the permissions in the GNU General Public License, the
17Free Software Foundation gives you unlimited permission to link the
18compiled version of this file into combinations with other programs,
19and to distribute those combinations without any restriction coming
20from the use of this file. (The General Public License restrictions
21do apply in other respects; for example, they cover modification of
22the file, and distribution when not linked into a combine
23executable.)
24
25This file is distributed in the hope that it will be useful, but
26WITHOUT ANY WARRANTY; without even the implied warranty of
27MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28General Public License for more details.
29
30You should have received a copy of the GNU General Public License
31along with this program; see the file COPYING. If not, write to
32the Free Software Foundation, 59 Temple Place - Suite 330,
33Boston, MA 02111-1307, USA. */
34
35
36#include <linux/linkage.h>
37#include <asm/assembler.h>
38
39
40.macro ARM_DIV_BODY dividend, divisor, result, curbit
41
42#if __LINUX_ARM_ARCH__ >= 5
43
44 clz \curbit, \divisor
45 clz \result, \dividend
46 sub \result, \curbit, \result
47 mov \curbit, #1
48 mov \divisor, \divisor, lsl \result
49 mov \curbit, \curbit, lsl \result
50 mov \result, #0
51
52#else
53
54 @ Initially shift the divisor left 3 bits if possible,
55 @ set curbit accordingly. This allows for curbit to be located
56 @ at the left end of each 4 bit nibbles in the division loop
57 @ to save one loop in most cases.
58 tst \divisor, #0xe0000000
59 moveq \divisor, \divisor, lsl #3
60 moveq \curbit, #8
61 movne \curbit, #1
62
63 @ Unless the divisor is very big, shift it up in multiples of
64 @ four bits, since this is the amount of unwinding in the main
65 @ division loop. Continue shifting until the divisor is
66 @ larger than the dividend.
671: cmp \divisor, #0x10000000
68 cmplo \divisor, \dividend
69 movlo \divisor, \divisor, lsl #4
70 movlo \curbit, \curbit, lsl #4
71 blo 1b
72
73 @ For very big divisors, we must shift it a bit at a time, or
74 @ we will be in danger of overflowing.
751: cmp \divisor, #0x80000000
76 cmplo \divisor, \dividend
77 movlo \divisor, \divisor, lsl #1
78 movlo \curbit, \curbit, lsl #1
79 blo 1b
80
81 mov \result, #0
82
83#endif
84
85 @ Division loop
861: cmp \dividend, \divisor
87 subhs \dividend, \dividend, \divisor
88 orrhs \result, \result, \curbit
89 cmp \dividend, \divisor, lsr #1
90 subhs \dividend, \dividend, \divisor, lsr #1
91 orrhs \result, \result, \curbit, lsr #1
92 cmp \dividend, \divisor, lsr #2
93 subhs \dividend, \dividend, \divisor, lsr #2
94 orrhs \result, \result, \curbit, lsr #2
95 cmp \dividend, \divisor, lsr #3
96 subhs \dividend, \dividend, \divisor, lsr #3
97 orrhs \result, \result, \curbit, lsr #3
98 cmp \dividend, #0 @ Early termination?
99 movnes \curbit, \curbit, lsr #4 @ No, any more bits to do?
100 movne \divisor, \divisor, lsr #4
101 bne 1b
102
103.endm
104
105
106.macro ARM_DIV2_ORDER divisor, order
107
108#if __LINUX_ARM_ARCH__ >= 5
109
110 clz \order, \divisor
111 rsb \order, \order, #31
112
113#else
114
115 cmp \divisor, #(1 << 16)
116 movhs \divisor, \divisor, lsr #16
117 movhs \order, #16
118 movlo \order, #0
119
120 cmp \divisor, #(1 << 8)
121 movhs \divisor, \divisor, lsr #8
122 addhs \order, \order, #8
123
124 cmp \divisor, #(1 << 4)
125 movhs \divisor, \divisor, lsr #4
126 addhs \order, \order, #4
127
128 cmp \divisor, #(1 << 2)
129 addhi \order, \order, #3
130 addls \order, \order, \divisor, lsr #1
131
132#endif
133
134.endm
135
136
137.macro ARM_MOD_BODY dividend, divisor, order, spare
138
139#if __LINUX_ARM_ARCH__ >= 5
140
141 clz \order, \divisor
142 clz \spare, \dividend
143 sub \order, \order, \spare
144 mov \divisor, \divisor, lsl \order
145
146#else
147
148 mov \order, #0
149
150 @ Unless the divisor is very big, shift it up in multiples of
151 @ four bits, since this is the amount of unwinding in the main
152 @ division loop. Continue shifting until the divisor is
153 @ larger than the dividend.
1541: cmp \divisor, #0x10000000
155 cmplo \divisor, \dividend
156 movlo \divisor, \divisor, lsl #4
157 addlo \order, \order, #4
158 blo 1b
159
160 @ For very big divisors, we must shift it a bit at a time, or
161 @ we will be in danger of overflowing.
1621: cmp \divisor, #0x80000000
163 cmplo \divisor, \dividend
164 movlo \divisor, \divisor, lsl #1
165 addlo \order, \order, #1
166 blo 1b
167
168#endif
169
170 @ Perform all needed substractions to keep only the reminder.
171 @ Do comparisons in batch of 4 first.
172 subs \order, \order, #3 @ yes, 3 is intended here
173 blt 2f
174
1751: cmp \dividend, \divisor
176 subhs \dividend, \dividend, \divisor
177 cmp \dividend, \divisor, lsr #1
178 subhs \dividend, \dividend, \divisor, lsr #1
179 cmp \dividend, \divisor, lsr #2
180 subhs \dividend, \dividend, \divisor, lsr #2
181 cmp \dividend, \divisor, lsr #3
182 subhs \dividend, \dividend, \divisor, lsr #3
183 cmp \dividend, #1
184 mov \divisor, \divisor, lsr #4
185 subges \order, \order, #4
186 bge 1b
187
188 tst \order, #3
189 teqne \dividend, #0
190 beq 5f
191
192 @ Either 1, 2 or 3 comparison/substractions are left.
1932: cmn \order, #2
194 blt 4f
195 beq 3f
196 cmp \dividend, \divisor
197 subhs \dividend, \dividend, \divisor
198 mov \divisor, \divisor, lsr #1
1993: cmp \dividend, \divisor
200 subhs \dividend, \dividend, \divisor
201 mov \divisor, \divisor, lsr #1
2024: cmp \dividend, \divisor
203 subhs \dividend, \dividend, \divisor
2045:
205.endm
206
207
208ENTRY(__udivsi3)
209
210 subs r2, r1, #1
211 moveq pc, lr
212 bcc Ldiv0
213 cmp r0, r1
214 bls 11f
215 tst r1, r2
216 beq 12f
217
218 ARM_DIV_BODY r0, r1, r2, r3
219
220 mov r0, r2
221 mov pc, lr
222
22311: moveq r0, #1
224 movne r0, #0
225 mov pc, lr
226
22712: ARM_DIV2_ORDER r1, r2
228
229 mov r0, r0, lsr r2
230 mov pc, lr
231
232
233ENTRY(__umodsi3)
234
235 subs r2, r1, #1 @ compare divisor with 1
236 bcc Ldiv0
237 cmpne r0, r1 @ compare dividend with divisor
238 moveq r0, #0
239 tsthi r1, r2 @ see if divisor is power of 2
240 andeq r0, r0, r2
241 movls pc, lr
242
243 ARM_MOD_BODY r0, r1, r2, r3
244
245 mov pc, lr
246
247
248ENTRY(__divsi3)
249
250 cmp r1, #0
251 eor ip, r0, r1 @ save the sign of the result.
252 beq Ldiv0
253 rsbmi r1, r1, #0 @ loops below use unsigned.
254 subs r2, r1, #1 @ division by 1 or -1 ?
255 beq 10f
256 movs r3, r0
257 rsbmi r3, r0, #0 @ positive dividend value
258 cmp r3, r1
259 bls 11f
260 tst r1, r2 @ divisor is power of 2 ?
261 beq 12f
262
263 ARM_DIV_BODY r3, r1, r0, r2
264
265 cmp ip, #0
266 rsbmi r0, r0, #0
267 mov pc, lr
268
26910: teq ip, r0 @ same sign ?
270 rsbmi r0, r0, #0
271 mov pc, lr
272
27311: movlo r0, #0
274 moveq r0, ip, asr #31
275 orreq r0, r0, #1
276 mov pc, lr
277
27812: ARM_DIV2_ORDER r1, r2
279
280 cmp ip, #0
281 mov r0, r3, lsr r2
282 rsbmi r0, r0, #0
283 mov pc, lr
284
285
286ENTRY(__modsi3)
287
288 cmp r1, #0
289 beq Ldiv0
290 rsbmi r1, r1, #0 @ loops below use unsigned.
291 movs ip, r0 @ preserve sign of dividend
292 rsbmi r0, r0, #0 @ if negative make positive
293 subs r2, r1, #1 @ compare divisor with 1
294 cmpne r0, r1 @ compare dividend with divisor
295 moveq r0, #0
296 tsthi r1, r2 @ see if divisor is power of 2
297 andeq r0, r0, r2
298 bls 10f
299
300 ARM_MOD_BODY r0, r1, r2, r3
301
30210: cmp ip, #0
303 rsbmi r0, r0, #0
304 mov pc, lr
305
306
307Ldiv0:
308
309 str lr, [sp, #-4]!
310 bl __div0
311 mov r0, #0 @ About as wrong as it could be.
312 ldr pc, [sp], #4
313
314
diff --git a/arch/arm/lib/longlong.h b/arch/arm/lib/longlong.h
new file mode 100644
index 000000000000..179eea4edc35
--- /dev/null
+++ b/arch/arm/lib/longlong.h
@@ -0,0 +1,183 @@
1/* longlong.h -- based on code from gcc-2.95.3
2
3 definitions for mixed size 32/64 bit arithmetic.
4 Copyright (C) 1991, 92, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
5
6 This definition file is free software; you can redistribute it
7 and/or modify it under the terms of the GNU General Public
8 License as published by the Free Software Foundation; either
9 version 2, or (at your option) any later version.
10
11 This definition file is distributed in the hope that it will be
12 useful, but WITHOUT ANY WARRANTY; without even the implied
13 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 See the GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21/* Borrowed from GCC 2.95.3, I Molton 29/07/01 */
22
23#ifndef SI_TYPE_SIZE
24#define SI_TYPE_SIZE 32
25#endif
26
27#define __BITS4 (SI_TYPE_SIZE / 4)
28#define __ll_B (1L << (SI_TYPE_SIZE / 2))
29#define __ll_lowpart(t) ((USItype) (t) % __ll_B)
30#define __ll_highpart(t) ((USItype) (t) / __ll_B)
31
32/* Define auxiliary asm macros.
33
34 1) umul_ppmm(high_prod, low_prod, multipler, multiplicand)
35 multiplies two USItype integers MULTIPLER and MULTIPLICAND,
36 and generates a two-part USItype product in HIGH_PROD and
37 LOW_PROD.
38
39 2) __umulsidi3(a,b) multiplies two USItype integers A and B,
40 and returns a UDItype product. This is just a variant of umul_ppmm.
41
42 3) udiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
43 denominator) divides a two-word unsigned integer, composed by the
44 integers HIGH_NUMERATOR and LOW_NUMERATOR, by DENOMINATOR and
45 places the quotient in QUOTIENT and the remainder in REMAINDER.
46 HIGH_NUMERATOR must be less than DENOMINATOR for correct operation.
47 If, in addition, the most significant bit of DENOMINATOR must be 1,
48 then the pre-processor symbol UDIV_NEEDS_NORMALIZATION is defined to 1.
49
50 4) sdiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
51 denominator). Like udiv_qrnnd but the numbers are signed. The
52 quotient is rounded towards 0.
53
54 5) count_leading_zeros(count, x) counts the number of zero-bits from
55 the msb to the first non-zero bit. This is the number of steps X
56 needs to be shifted left to set the msb. Undefined for X == 0.
57
58 6) add_ssaaaa(high_sum, low_sum, high_addend_1, low_addend_1,
59 high_addend_2, low_addend_2) adds two two-word unsigned integers,
60 composed by HIGH_ADDEND_1 and LOW_ADDEND_1, and HIGH_ADDEND_2 and
61 LOW_ADDEND_2 respectively. The result is placed in HIGH_SUM and
62 LOW_SUM. Overflow (i.e. carry out) is not stored anywhere, and is
63 lost.
64
65 7) sub_ddmmss(high_difference, low_difference, high_minuend,
66 low_minuend, high_subtrahend, low_subtrahend) subtracts two
67 two-word unsigned integers, composed by HIGH_MINUEND_1 and
68 LOW_MINUEND_1, and HIGH_SUBTRAHEND_2 and LOW_SUBTRAHEND_2
69 respectively. The result is placed in HIGH_DIFFERENCE and
70 LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere,
71 and is lost.
72
73 If any of these macros are left undefined for a particular CPU,
74 C macros are used. */
75
76#if defined (__arm__)
77#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
78 __asm__ ("adds %1, %4, %5 \n\
79 adc %0, %2, %3" \
80 : "=r" ((USItype) (sh)), \
81 "=&r" ((USItype) (sl)) \
82 : "%r" ((USItype) (ah)), \
83 "rI" ((USItype) (bh)), \
84 "%r" ((USItype) (al)), \
85 "rI" ((USItype) (bl)))
86#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
87 __asm__ ("subs %1, %4, %5 \n\
88 sbc %0, %2, %3" \
89 : "=r" ((USItype) (sh)), \
90 "=&r" ((USItype) (sl)) \
91 : "r" ((USItype) (ah)), \
92 "rI" ((USItype) (bh)), \
93 "r" ((USItype) (al)), \
94 "rI" ((USItype) (bl)))
95#define umul_ppmm(xh, xl, a, b) \
96{register USItype __t0, __t1, __t2; \
97 __asm__ ("%@ Inlined umul_ppmm \n\
98 mov %2, %5, lsr #16 \n\
99 mov %0, %6, lsr #16 \n\
100 bic %3, %5, %2, lsl #16 \n\
101 bic %4, %6, %0, lsl #16 \n\
102 mul %1, %3, %4 \n\
103 mul %4, %2, %4 \n\
104 mul %3, %0, %3 \n\
105 mul %0, %2, %0 \n\
106 adds %3, %4, %3 \n\
107 addcs %0, %0, #65536 \n\
108 adds %1, %1, %3, lsl #16 \n\
109 adc %0, %0, %3, lsr #16" \
110 : "=&r" ((USItype) (xh)), \
111 "=r" ((USItype) (xl)), \
112 "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \
113 : "r" ((USItype) (a)), \
114 "r" ((USItype) (b)));}
115#define UMUL_TIME 20
116#define UDIV_TIME 100
117#endif /* __arm__ */
118
119#define __umulsidi3(u, v) \
120 ({DIunion __w; \
121 umul_ppmm (__w.s.high, __w.s.low, u, v); \
122 __w.ll; })
123
124#define __udiv_qrnnd_c(q, r, n1, n0, d) \
125 do { \
126 USItype __d1, __d0, __q1, __q0; \
127 USItype __r1, __r0, __m; \
128 __d1 = __ll_highpart (d); \
129 __d0 = __ll_lowpart (d); \
130 \
131 __r1 = (n1) % __d1; \
132 __q1 = (n1) / __d1; \
133 __m = (USItype) __q1 * __d0; \
134 __r1 = __r1 * __ll_B | __ll_highpart (n0); \
135 if (__r1 < __m) \
136 { \
137 __q1--, __r1 += (d); \
138 if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */\
139 if (__r1 < __m) \
140 __q1--, __r1 += (d); \
141 } \
142 __r1 -= __m; \
143 \
144 __r0 = __r1 % __d1; \
145 __q0 = __r1 / __d1; \
146 __m = (USItype) __q0 * __d0; \
147 __r0 = __r0 * __ll_B | __ll_lowpart (n0); \
148 if (__r0 < __m) \
149 { \
150 __q0--, __r0 += (d); \
151 if (__r0 >= (d)) \
152 if (__r0 < __m) \
153 __q0--, __r0 += (d); \
154 } \
155 __r0 -= __m; \
156 \
157 (q) = (USItype) __q1 * __ll_B | __q0; \
158 (r) = __r0; \
159 } while (0)
160
161#define UDIV_NEEDS_NORMALIZATION 1
162#define udiv_qrnnd __udiv_qrnnd_c
163
164#define count_leading_zeros(count, x) \
165 do { \
166 USItype __xr = (x); \
167 USItype __a; \
168 \
169 if (SI_TYPE_SIZE <= 32) \
170 { \
171 __a = __xr < ((USItype)1<<2*__BITS4) \
172 ? (__xr < ((USItype)1<<__BITS4) ? 0 : __BITS4) \
173 : (__xr < ((USItype)1<<3*__BITS4) ? 2*__BITS4 : 3*__BITS4); \
174 } \
175 else \
176 { \
177 for (__a = SI_TYPE_SIZE - 8; __a > 0; __a -= 8) \
178 if (((__xr >> __a) & 0xff) != 0) \
179 break; \
180 } \
181 \
182 (count) = SI_TYPE_SIZE - (__clz_tab[__xr >> __a] + __a); \
183 } while (0)
diff --git a/arch/arm/lib/lshrdi3.c b/arch/arm/lib/lshrdi3.c
new file mode 100644
index 000000000000..b666f1bad451
--- /dev/null
+++ b/arch/arm/lib/lshrdi3.c
@@ -0,0 +1,61 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34DItype
35__lshrdi3 (DItype u, word_type b)
36{
37 DIunion w;
38 word_type bm;
39 DIunion uu;
40
41 if (b == 0)
42 return u;
43
44 uu.ll = u;
45
46 bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
47 if (bm <= 0)
48 {
49 w.s.high = 0;
50 w.s.low = (USItype)uu.s.high >> -bm;
51 }
52 else
53 {
54 USItype carries = (USItype)uu.s.high << bm;
55 w.s.high = (USItype)uu.s.high >> b;
56 w.s.low = ((USItype)uu.s.low >> b) | carries;
57 }
58
59 return w.ll;
60}
61
diff --git a/arch/arm/lib/memchr.S b/arch/arm/lib/memchr.S
new file mode 100644
index 000000000000..ac34fe55d21a
--- /dev/null
+++ b/arch/arm/lib/memchr.S
@@ -0,0 +1,25 @@
1/*
2 * linux/arch/arm/lib/memchr.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ASM optimised string functions
11 */
12#include <linux/linkage.h>
13#include <asm/assembler.h>
14
15 .text
16 .align 5
17ENTRY(memchr)
181: subs r2, r2, #1
19 bmi 2f
20 ldrb r3, [r0], #1
21 teq r3, r1
22 bne 1b
23 sub r0, r0, #1
242: movne r0, #0
25 RETINSTR(mov,pc,lr)
diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
new file mode 100644
index 000000000000..f5a593ceb8cc
--- /dev/null
+++ b/arch/arm/lib/memcpy.S
@@ -0,0 +1,393 @@
1/*
2 * linux/arch/arm/lib/memcpy.S
3 *
4 * Copyright (C) 1995-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ASM optimised string functions
11 */
12#include <linux/linkage.h>
13#include <asm/assembler.h>
14
15 .text
16
17#define ENTER \
18 mov ip,sp ;\
19 stmfd sp!,{r0,r4-r9,fp,ip,lr,pc} ;\
20 sub fp,ip,#4
21
22#define EXIT \
23 LOADREGS(ea, fp, {r0, r4 - r9, fp, sp, pc})
24
25#define EXITEQ \
26 LOADREGS(eqea, fp, {r0, r4 - r9, fp, sp, pc})
27
28/*
29 * Prototype: void memcpy(void *to,const void *from,unsigned long n);
30 */
31ENTRY(memcpy)
32ENTRY(memmove)
33 ENTER
34 cmp r1, r0
35 bcc 23f
36 subs r2, r2, #4
37 blt 6f
38 PLD( pld [r1, #0] )
39 ands ip, r0, #3
40 bne 7f
41 ands ip, r1, #3
42 bne 8f
43
441: subs r2, r2, #8
45 blt 5f
46 subs r2, r2, #20
47 blt 4f
48 PLD( pld [r1, #28] )
49 PLD( subs r2, r2, #64 )
50 PLD( blt 3f )
512: PLD( pld [r1, #60] )
52 PLD( pld [r1, #92] )
53 ldmia r1!, {r3 - r9, ip}
54 subs r2, r2, #32
55 stmgeia r0!, {r3 - r9, ip}
56 ldmgeia r1!, {r3 - r9, ip}
57 subges r2, r2, #32
58 stmia r0!, {r3 - r9, ip}
59 bge 2b
603: PLD( ldmia r1!, {r3 - r9, ip} )
61 PLD( adds r2, r2, #32 )
62 PLD( stmgeia r0!, {r3 - r9, ip} )
63 PLD( ldmgeia r1!, {r3 - r9, ip} )
64 PLD( subges r2, r2, #32 )
65 PLD( stmia r0!, {r3 - r9, ip} )
664: cmn r2, #16
67 ldmgeia r1!, {r3 - r6}
68 subge r2, r2, #16
69 stmgeia r0!, {r3 - r6}
70 adds r2, r2, #20
71 ldmgeia r1!, {r3 - r5}
72 subge r2, r2, #12
73 stmgeia r0!, {r3 - r5}
745: adds r2, r2, #8
75 blt 6f
76 subs r2, r2, #4
77 ldrlt r3, [r1], #4
78 ldmgeia r1!, {r4, r5}
79 subge r2, r2, #4
80 strlt r3, [r0], #4
81 stmgeia r0!, {r4, r5}
82
836: adds r2, r2, #4
84 EXITEQ
85 cmp r2, #2
86 ldrb r3, [r1], #1
87 ldrgeb r4, [r1], #1
88 ldrgtb r5, [r1], #1
89 strb r3, [r0], #1
90 strgeb r4, [r0], #1
91 strgtb r5, [r0], #1
92 EXIT
93
947: rsb ip, ip, #4
95 cmp ip, #2
96 ldrb r3, [r1], #1
97 ldrgeb r4, [r1], #1
98 ldrgtb r5, [r1], #1
99 strb r3, [r0], #1
100 strgeb r4, [r0], #1
101 strgtb r5, [r0], #1
102 subs r2, r2, ip
103 blt 6b
104 ands ip, r1, #3
105 beq 1b
106
1078: bic r1, r1, #3
108 ldr r7, [r1], #4
109 cmp ip, #2
110 bgt 18f
111 beq 13f
112 cmp r2, #12
113 blt 11f
114 PLD( pld [r1, #12] )
115 sub r2, r2, #12
116 PLD( subs r2, r2, #32 )
117 PLD( blt 10f )
118 PLD( pld [r1, #28] )
1199: PLD( pld [r1, #44] )
12010: mov r3, r7, pull #8
121 ldmia r1!, {r4 - r7}
122 subs r2, r2, #16
123 orr r3, r3, r4, push #24
124 mov r4, r4, pull #8
125 orr r4, r4, r5, push #24
126 mov r5, r5, pull #8
127 orr r5, r5, r6, push #24
128 mov r6, r6, pull #8
129 orr r6, r6, r7, push #24
130 stmia r0!, {r3 - r6}
131 bge 9b
132 PLD( cmn r2, #32 )
133 PLD( bge 10b )
134 PLD( add r2, r2, #32 )
135 adds r2, r2, #12
136 blt 12f
13711: mov r3, r7, pull #8
138 ldr r7, [r1], #4
139 subs r2, r2, #4
140 orr r3, r3, r7, push #24
141 str r3, [r0], #4
142 bge 11b
14312: sub r1, r1, #3
144 b 6b
145
14613: cmp r2, #12
147 blt 16f
148 PLD( pld [r1, #12] )
149 sub r2, r2, #12
150 PLD( subs r2, r2, #32 )
151 PLD( blt 15f )
152 PLD( pld [r1, #28] )
15314: PLD( pld [r1, #44] )
15415: mov r3, r7, pull #16
155 ldmia r1!, {r4 - r7}
156 subs r2, r2, #16
157 orr r3, r3, r4, push #16
158 mov r4, r4, pull #16
159 orr r4, r4, r5, push #16
160 mov r5, r5, pull #16
161 orr r5, r5, r6, push #16
162 mov r6, r6, pull #16
163 orr r6, r6, r7, push #16
164 stmia r0!, {r3 - r6}
165 bge 14b
166 PLD( cmn r2, #32 )
167 PLD( bge 15b )
168 PLD( add r2, r2, #32 )
169 adds r2, r2, #12
170 blt 17f
17116: mov r3, r7, pull #16
172 ldr r7, [r1], #4
173 subs r2, r2, #4
174 orr r3, r3, r7, push #16
175 str r3, [r0], #4
176 bge 16b
17717: sub r1, r1, #2
178 b 6b
179
18018: cmp r2, #12
181 blt 21f
182 PLD( pld [r1, #12] )
183 sub r2, r2, #12
184 PLD( subs r2, r2, #32 )
185 PLD( blt 20f )
186 PLD( pld [r1, #28] )
18719: PLD( pld [r1, #44] )
18820: mov r3, r7, pull #24
189 ldmia r1!, {r4 - r7}
190 subs r2, r2, #16
191 orr r3, r3, r4, push #8
192 mov r4, r4, pull #24
193 orr r4, r4, r5, push #8
194 mov r5, r5, pull #24
195 orr r5, r5, r6, push #8
196 mov r6, r6, pull #24
197 orr r6, r6, r7, push #8
198 stmia r0!, {r3 - r6}
199 bge 19b
200 PLD( cmn r2, #32 )
201 PLD( bge 20b )
202 PLD( add r2, r2, #32 )
203 adds r2, r2, #12
204 blt 22f
20521: mov r3, r7, pull #24
206 ldr r7, [r1], #4
207 subs r2, r2, #4
208 orr r3, r3, r7, push #8
209 str r3, [r0], #4
210 bge 21b
21122: sub r1, r1, #1
212 b 6b
213
214
21523: add r1, r1, r2
216 add r0, r0, r2
217 subs r2, r2, #4
218 blt 29f
219 PLD( pld [r1, #-4] )
220 ands ip, r0, #3
221 bne 30f
222 ands ip, r1, #3
223 bne 31f
224
22524: subs r2, r2, #8
226 blt 28f
227 subs r2, r2, #20
228 blt 27f
229 PLD( pld [r1, #-32] )
230 PLD( subs r2, r2, #64 )
231 PLD( blt 26f )
23225: PLD( pld [r1, #-64] )
233 PLD( pld [r1, #-96] )
234 ldmdb r1!, {r3 - r9, ip}
235 subs r2, r2, #32
236 stmgedb r0!, {r3 - r9, ip}
237 ldmgedb r1!, {r3 - r9, ip}
238 subges r2, r2, #32
239 stmdb r0!, {r3 - r9, ip}
240 bge 25b
24126: PLD( ldmdb r1!, {r3 - r9, ip} )
242 PLD( adds r2, r2, #32 )
243 PLD( stmgedb r0!, {r3 - r9, ip} )
244 PLD( ldmgedb r1!, {r3 - r9, ip} )
245 PLD( subges r2, r2, #32 )
246 PLD( stmdb r0!, {r3 - r9, ip} )
24727: cmn r2, #16
248 ldmgedb r1!, {r3 - r6}
249 subge r2, r2, #16
250 stmgedb r0!, {r3 - r6}
251 adds r2, r2, #20
252 ldmgedb r1!, {r3 - r5}
253 subge r2, r2, #12
254 stmgedb r0!, {r3 - r5}
25528: adds r2, r2, #8
256 blt 29f
257 subs r2, r2, #4
258 ldrlt r3, [r1, #-4]!
259 ldmgedb r1!, {r4, r5}
260 subge r2, r2, #4
261 strlt r3, [r0, #-4]!
262 stmgedb r0!, {r4, r5}
263
26429: adds r2, r2, #4
265 EXITEQ
266 cmp r2, #2
267 ldrb r3, [r1, #-1]!
268 ldrgeb r4, [r1, #-1]!
269 ldrgtb r5, [r1, #-1]!
270 strb r3, [r0, #-1]!
271 strgeb r4, [r0, #-1]!
272 strgtb r5, [r0, #-1]!
273 EXIT
274
27530: cmp ip, #2
276 ldrb r3, [r1, #-1]!
277 ldrgeb r4, [r1, #-1]!
278 ldrgtb r5, [r1, #-1]!
279 strb r3, [r0, #-1]!
280 strgeb r4, [r0, #-1]!
281 strgtb r5, [r0, #-1]!
282 subs r2, r2, ip
283 blt 29b
284 ands ip, r1, #3
285 beq 24b
286
28731: bic r1, r1, #3
288 ldr r3, [r1], #0
289 cmp ip, #2
290 blt 41f
291 beq 36f
292 cmp r2, #12
293 blt 34f
294 PLD( pld [r1, #-16] )
295 sub r2, r2, #12
296 PLD( subs r2, r2, #32 )
297 PLD( blt 33f )
298 PLD( pld [r1, #-32] )
29932: PLD( pld [r1, #-48] )
30033: mov r7, r3, push #8
301 ldmdb r1!, {r3, r4, r5, r6}
302 subs r2, r2, #16
303 orr r7, r7, r6, pull #24
304 mov r6, r6, push #8
305 orr r6, r6, r5, pull #24
306 mov r5, r5, push #8
307 orr r5, r5, r4, pull #24
308 mov r4, r4, push #8
309 orr r4, r4, r3, pull #24
310 stmdb r0!, {r4, r5, r6, r7}
311 bge 32b
312 PLD( cmn r2, #32 )
313 PLD( bge 33b )
314 PLD( add r2, r2, #32 )
315 adds r2, r2, #12
316 blt 35f
31734: mov ip, r3, push #8
318 ldr r3, [r1, #-4]!
319 subs r2, r2, #4
320 orr ip, ip, r3, pull #24
321 str ip, [r0, #-4]!
322 bge 34b
32335: add r1, r1, #3
324 b 29b
325
32636: cmp r2, #12
327 blt 39f
328 PLD( pld [r1, #-16] )
329 sub r2, r2, #12
330 PLD( subs r2, r2, #32 )
331 PLD( blt 38f )
332 PLD( pld [r1, #-32] )
33337: PLD( pld [r1, #-48] )
33438: mov r7, r3, push #16
335 ldmdb r1!, {r3, r4, r5, r6}
336 subs r2, r2, #16
337 orr r7, r7, r6, pull #16
338 mov r6, r6, push #16
339 orr r6, r6, r5, pull #16
340 mov r5, r5, push #16
341 orr r5, r5, r4, pull #16
342 mov r4, r4, push #16
343 orr r4, r4, r3, pull #16
344 stmdb r0!, {r4, r5, r6, r7}
345 bge 37b
346 PLD( cmn r2, #32 )
347 PLD( bge 38b )
348 PLD( add r2, r2, #32 )
349 adds r2, r2, #12
350 blt 40f
35139: mov ip, r3, push #16
352 ldr r3, [r1, #-4]!
353 subs r2, r2, #4
354 orr ip, ip, r3, pull #16
355 str ip, [r0, #-4]!
356 bge 39b
35740: add r1, r1, #2
358 b 29b
359
36041: cmp r2, #12
361 blt 44f
362 PLD( pld [r1, #-16] )
363 sub r2, r2, #12
364 PLD( subs r2, r2, #32 )
365 PLD( blt 43f )
366 PLD( pld [r1, #-32] )
36742: PLD( pld [r1, #-48] )
36843: mov r7, r3, push #24
369 ldmdb r1!, {r3, r4, r5, r6}
370 subs r2, r2, #16
371 orr r7, r7, r6, pull #8
372 mov r6, r6, push #24
373 orr r6, r6, r5, pull #8
374 mov r5, r5, push #24
375 orr r5, r5, r4, pull #8
376 mov r4, r4, push #24
377 orr r4, r4, r3, pull #8
378 stmdb r0!, {r4, r5, r6, r7}
379 bge 42b
380 PLD( cmn r2, #32 )
381 PLD( bge 43b )
382 PLD( add r2, r2, #32 )
383 adds r2, r2, #12
384 blt 45f
38544: mov ip, r3, push #24
386 ldr r3, [r1, #-4]!
387 subs r2, r2, #4
388 orr ip, ip, r3, pull #8
389 str ip, [r0, #-4]!
390 bge 44b
39145: add r1, r1, #1
392 b 29b
393
diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S
new file mode 100644
index 000000000000..a1795f599937
--- /dev/null
+++ b/arch/arm/lib/memset.S
@@ -0,0 +1,80 @@
1/*
2 * linux/arch/arm/lib/memset.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ASM optimised string functions
11 */
12#include <linux/linkage.h>
13#include <asm/assembler.h>
14
15 .text
16 .align 5
17 .word 0
18
191: subs r2, r2, #4 @ 1 do we have enough
20 blt 5f @ 1 bytes to align with?
21 cmp r3, #2 @ 1
22 strltb r1, [r0], #1 @ 1
23 strleb r1, [r0], #1 @ 1
24 strb r1, [r0], #1 @ 1
25 add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3))
26/*
27 * The pointer is now aligned and the length is adjusted. Try doing the
28 * memzero again.
29 */
30
31ENTRY(memset)
32 ands r3, r0, #3 @ 1 unaligned?
33 bne 1b @ 1
34/*
35 * we know that the pointer in r0 is aligned to a word boundary.
36 */
37 orr r1, r1, r1, lsl #8
38 orr r1, r1, r1, lsl #16
39 mov r3, r1
40 cmp r2, #16
41 blt 4f
42/*
43 * We need an extra register for this loop - save the return address and
44 * use the LR
45 */
46 str lr, [sp, #-4]!
47 mov ip, r1
48 mov lr, r1
49
502: subs r2, r2, #64
51 stmgeia r0!, {r1, r3, ip, lr} @ 64 bytes at a time.
52 stmgeia r0!, {r1, r3, ip, lr}
53 stmgeia r0!, {r1, r3, ip, lr}
54 stmgeia r0!, {r1, r3, ip, lr}
55 bgt 2b
56 LOADREGS(eqfd, sp!, {pc}) @ Now <64 bytes to go.
57/*
58 * No need to correct the count; we're only testing bits from now on
59 */
60 tst r2, #32
61 stmneia r0!, {r1, r3, ip, lr}
62 stmneia r0!, {r1, r3, ip, lr}
63 tst r2, #16
64 stmneia r0!, {r1, r3, ip, lr}
65 ldr lr, [sp], #4
66
674: tst r2, #8
68 stmneia r0!, {r1, r3}
69 tst r2, #4
70 strne r1, [r0], #4
71/*
72 * When we get here, we've got less than 4 bytes to zero. We
73 * may have an unaligned pointer as well.
74 */
755: tst r2, #2
76 strneb r1, [r0], #1
77 strneb r1, [r0], #1
78 tst r2, #1
79 strneb r1, [r0], #1
80 RETINSTR(mov,pc,lr)
diff --git a/arch/arm/lib/memzero.S b/arch/arm/lib/memzero.S
new file mode 100644
index 000000000000..51ccc60160fd
--- /dev/null
+++ b/arch/arm/lib/memzero.S
@@ -0,0 +1,80 @@
1/*
2 * linux/arch/arm/lib/memzero.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12
13 .text
14 .align 5
15 .word 0
16/*
17 * Align the pointer in r0. r3 contains the number of bytes that we are
18 * mis-aligned by, and r1 is the number of bytes. If r1 < 4, then we
19 * don't bother; we use byte stores instead.
20 */
211: subs r1, r1, #4 @ 1 do we have enough
22 blt 5f @ 1 bytes to align with?
23 cmp r3, #2 @ 1
24 strltb r2, [r0], #1 @ 1
25 strleb r2, [r0], #1 @ 1
26 strb r2, [r0], #1 @ 1
27 add r1, r1, r3 @ 1 (r1 = r1 - (4 - r3))
28/*
29 * The pointer is now aligned and the length is adjusted. Try doing the
30 * memzero again.
31 */
32
33ENTRY(__memzero)
34 mov r2, #0 @ 1
35 ands r3, r0, #3 @ 1 unaligned?
36 bne 1b @ 1
37/*
38 * r3 = 0, and we know that the pointer in r0 is aligned to a word boundary.
39 */
40 cmp r1, #16 @ 1 we can skip this chunk if we
41 blt 4f @ 1 have < 16 bytes
42/*
43 * We need an extra register for this loop - save the return address and
44 * use the LR
45 */
46 str lr, [sp, #-4]! @ 1
47 mov ip, r2 @ 1
48 mov lr, r2 @ 1
49
503: subs r1, r1, #64 @ 1 write 32 bytes out per loop
51 stmgeia r0!, {r2, r3, ip, lr} @ 4
52 stmgeia r0!, {r2, r3, ip, lr} @ 4
53 stmgeia r0!, {r2, r3, ip, lr} @ 4
54 stmgeia r0!, {r2, r3, ip, lr} @ 4
55 bgt 3b @ 1
56 LOADREGS(eqfd, sp!, {pc}) @ 1/2 quick exit
57/*
58 * No need to correct the count; we're only testing bits from now on
59 */
60 tst r1, #32 @ 1
61 stmneia r0!, {r2, r3, ip, lr} @ 4
62 stmneia r0!, {r2, r3, ip, lr} @ 4
63 tst r1, #16 @ 1 16 bytes or more?
64 stmneia r0!, {r2, r3, ip, lr} @ 4
65 ldr lr, [sp], #4 @ 1
66
674: tst r1, #8 @ 1 8 bytes or more?
68 stmneia r0!, {r2, r3} @ 2
69 tst r1, #4 @ 1 4 bytes or more?
70 strne r2, [r0], #4 @ 1
71/*
72 * When we get here, we've got less than 4 bytes to zero. We
73 * may have an unaligned pointer as well.
74 */
755: tst r1, #2 @ 1 2 bytes or more?
76 strneb r2, [r0], #1 @ 1
77 strneb r2, [r0], #1 @ 1
78 tst r1, #1 @ 1 a byte left over
79 strneb r2, [r0], #1 @ 1
80 RETINSTR(mov,pc,lr) @ 1
diff --git a/arch/arm/lib/muldi3.c b/arch/arm/lib/muldi3.c
new file mode 100644
index 000000000000..44d611b1cfdb
--- /dev/null
+++ b/arch/arm/lib/muldi3.c
@@ -0,0 +1,77 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34#define umul_ppmm(xh, xl, a, b) \
35{register USItype __t0, __t1, __t2; \
36 __asm__ ("%@ Inlined umul_ppmm \n\
37 mov %2, %5, lsr #16 \n\
38 mov %0, %6, lsr #16 \n\
39 bic %3, %5, %2, lsl #16 \n\
40 bic %4, %6, %0, lsl #16 \n\
41 mul %1, %3, %4 \n\
42 mul %4, %2, %4 \n\
43 mul %3, %0, %3 \n\
44 mul %0, %2, %0 \n\
45 adds %3, %4, %3 \n\
46 addcs %0, %0, #65536 \n\
47 adds %1, %1, %3, lsl #16 \n\
48 adc %0, %0, %3, lsr #16" \
49 : "=&r" ((USItype) (xh)), \
50 "=r" ((USItype) (xl)), \
51 "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \
52 : "r" ((USItype) (a)), \
53 "r" ((USItype) (b)));}
54
55
56#define __umulsidi3(u, v) \
57 ({DIunion __w; \
58 umul_ppmm (__w.s.high, __w.s.low, u, v); \
59 __w.ll; })
60
61
62DItype
63__muldi3 (DItype u, DItype v)
64{
65 DIunion w;
66 DIunion uu, vv;
67
68 uu.ll = u,
69 vv.ll = v;
70
71 w.ll = __umulsidi3 (uu.s.low, vv.s.low);
72 w.s.high += ((USItype) uu.s.low * (USItype) vv.s.high
73 + (USItype) uu.s.high * (USItype) vv.s.low);
74
75 return w.ll;
76}
77
diff --git a/arch/arm/lib/putuser.S b/arch/arm/lib/putuser.S
new file mode 100644
index 000000000000..b09398d95aac
--- /dev/null
+++ b/arch/arm/lib/putuser.S
@@ -0,0 +1,76 @@
1/*
2 * linux/arch/arm/lib/putuser.S
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Idea from x86 version, (C) Copyright 1998 Linus Torvalds
11 *
12 * These functions have a non-standard call interface to make
13 * them more efficient, especially as they return an error
14 * value in addition to the "real" return value.
15 *
16 * __put_user_X
17 *
18 * Inputs: r0 contains the address
19 * r2, r3 contains the value
20 * Outputs: r0 is the error code
21 * lr corrupted
22 *
23 * No other registers must be altered. (see include/asm-arm/uaccess.h
24 * for specific ASM register usage).
25 *
26 * Note that ADDR_LIMIT is either 0 or 0xc0000000
27 * Note also that it is intended that __put_user_bad is not global.
28 */
29#include <asm/constants.h>
30#include <asm/thread_info.h>
31#include <asm/errno.h>
32
33 .global __put_user_1
34__put_user_1:
351: strbt r2, [r0]
36 mov r0, #0
37 mov pc, lr
38
39 .global __put_user_2
40__put_user_2:
41 mov ip, r2, lsr #8
42#ifndef __ARMEB__
432: strbt r2, [r0], #1
443: strbt ip, [r0]
45#else
462: strbt ip, [r0], #1
473: strbt r2, [r0]
48#endif
49 mov r0, #0
50 mov pc, lr
51
52 .global __put_user_4
53__put_user_4:
544: strt r2, [r0]
55 mov r0, #0
56 mov pc, lr
57
58 .global __put_user_8
59__put_user_8:
605: strt r2, [r0], #4
616: strt r3, [r0]
62 mov r0, #0
63 mov pc, lr
64
65__put_user_bad:
66 mov r0, #-EFAULT
67 mov pc, lr
68
69.section __ex_table, "a"
70 .long 1b, __put_user_bad
71 .long 2b, __put_user_bad
72 .long 3b, __put_user_bad
73 .long 4b, __put_user_bad
74 .long 5b, __put_user_bad
75 .long 6b, __put_user_bad
76.previous
diff --git a/arch/arm/lib/setbit.S b/arch/arm/lib/setbit.S
new file mode 100644
index 000000000000..8f337df5d99b
--- /dev/null
+++ b/arch/arm/lib/setbit.S
@@ -0,0 +1,29 @@
1/*
2 * linux/arch/arm/lib/setbit.S
3 *
4 * Copyright (C) 1995-1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12 .text
13
14/*
15 * Purpose : Function to set a bit
16 * Prototype: int set_bit(int bit, void *addr)
17 */
18ENTRY(_set_bit_be)
19 eor r0, r0, #0x18 @ big endian byte ordering
20ENTRY(_set_bit_le)
21 and r2, r0, #7
22 mov r3, #1
23 mov r3, r3, lsl r2
24 save_and_disable_irqs ip, r2
25 ldrb r2, [r1, r0, lsr #3]
26 orr r2, r2, r3
27 strb r2, [r1, r0, lsr #3]
28 restore_irqs ip
29 RETINSTR(mov,pc,lr)
diff --git a/arch/arm/lib/strchr.S b/arch/arm/lib/strchr.S
new file mode 100644
index 000000000000..5b9b493733fc
--- /dev/null
+++ b/arch/arm/lib/strchr.S
@@ -0,0 +1,26 @@
1/*
2 * linux/arch/arm/lib/strchr.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ASM optimised string functions
11 */
12#include <linux/linkage.h>
13#include <asm/assembler.h>
14
15 .text
16 .align 5
17ENTRY(strchr)
18 and r1, r1, #0xff
191: ldrb r2, [r0], #1
20 teq r2, r1
21 teqne r2, #0
22 bne 1b
23 teq r2, r1
24 movne r0, #0
25 subeq r0, r0, #1
26 RETINSTR(mov,pc,lr)
diff --git a/arch/arm/lib/strncpy_from_user.S b/arch/arm/lib/strncpy_from_user.S
new file mode 100644
index 000000000000..629cc8775276
--- /dev/null
+++ b/arch/arm/lib/strncpy_from_user.S
@@ -0,0 +1,43 @@
1/*
2 * linux/arch/arm/lib/strncpy_from_user.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12#include <asm/errno.h>
13
14 .text
15 .align 5
16
17/*
18 * Copy a string from user space to kernel space.
19 * r0 = dst, r1 = src, r2 = byte length
20 * returns the number of characters copied (strlen of copied string),
21 * -EFAULT on exception, or "len" if we fill the whole buffer
22 */
23ENTRY(__arch_strncpy_from_user)
24 save_lr
25 mov ip, r1
261: subs r2, r2, #1
27USER( ldrplbt r3, [r1], #1)
28 bmi 2f
29 strb r3, [r0], #1
30 teq r3, #0
31 bne 1b
32 sub r1, r1, #1 @ take NUL character out of count
332: sub r0, r1, ip
34 restore_pc
35
36 .section .fixup,"ax"
37 .align 0
389001: mov r3, #0
39 strb r3, [r0, #0] @ null terminate
40 mov r0, #-EFAULT
41 restore_pc
42 .previous
43
diff --git a/arch/arm/lib/strnlen_user.S b/arch/arm/lib/strnlen_user.S
new file mode 100644
index 000000000000..67bcd8268128
--- /dev/null
+++ b/arch/arm/lib/strnlen_user.S
@@ -0,0 +1,40 @@
1/*
2 * linux/arch/arm/lib/strnlen_user.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12#include <asm/errno.h>
13
14 .text
15 .align 5
16
17/* Prototype: unsigned long __arch_strnlen_user(const char *str, long n)
18 * Purpose : get length of a string in user memory
19 * Params : str - address of string in user memory
20 * Returns : length of string *including terminator*
21 * or zero on exception, or n + 1 if too long
22 */
23ENTRY(__arch_strnlen_user)
24 save_lr
25 mov r2, r0
261:
27USER( ldrbt r3, [r0], #1)
28 teq r3, #0
29 beq 2f
30 subs r1, r1, #1
31 bne 1b
32 add r0, r0, #1
332: sub r0, r0, r2
34 restore_pc
35
36 .section .fixup,"ax"
37 .align 0
389001: mov r0, #0
39 restore_pc
40 .previous
diff --git a/arch/arm/lib/strrchr.S b/arch/arm/lib/strrchr.S
new file mode 100644
index 000000000000..fa923f026f15
--- /dev/null
+++ b/arch/arm/lib/strrchr.S
@@ -0,0 +1,25 @@
1/*
2 * linux/arch/arm/lib/strrchr.S
3 *
4 * Copyright (C) 1995-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ASM optimised string functions
11 */
12#include <linux/linkage.h>
13#include <asm/assembler.h>
14
15 .text
16 .align 5
17ENTRY(strrchr)
18 mov r3, #0
191: ldrb r2, [r0], #1
20 teq r2, r1
21 subeq r3, r0, #1
22 teq r2, #0
23 bne 1b
24 mov r0, r3
25 RETINSTR(mov,pc,lr)
diff --git a/arch/arm/lib/testchangebit.S b/arch/arm/lib/testchangebit.S
new file mode 100644
index 000000000000..4aba4676b984
--- /dev/null
+++ b/arch/arm/lib/testchangebit.S
@@ -0,0 +1,29 @@
1/*
2 * linux/arch/arm/lib/testchangebit.S
3 *
4 * Copyright (C) 1995-1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12 .text
13
14ENTRY(_test_and_change_bit_be)
15 eor r0, r0, #0x18 @ big endian byte ordering
16ENTRY(_test_and_change_bit_le)
17 add r1, r1, r0, lsr #3
18 and r3, r0, #7
19 mov r0, #1
20 save_and_disable_irqs ip, r2
21 ldrb r2, [r1]
22 tst r2, r0, lsl r3
23 eor r2, r2, r0, lsl r3
24 strb r2, [r1]
25 restore_irqs ip
26 moveq r0, #0
27 RETINSTR(mov,pc,lr)
28
29
diff --git a/arch/arm/lib/testclearbit.S b/arch/arm/lib/testclearbit.S
new file mode 100644
index 000000000000..e07c5bd24307
--- /dev/null
+++ b/arch/arm/lib/testclearbit.S
@@ -0,0 +1,29 @@
1/*
2 * linux/arch/arm/lib/testclearbit.S
3 *
4 * Copyright (C) 1995-1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12 .text
13
14ENTRY(_test_and_clear_bit_be)
15 eor r0, r0, #0x18 @ big endian byte ordering
16ENTRY(_test_and_clear_bit_le)
17 add r1, r1, r0, lsr #3 @ Get byte offset
18 and r3, r0, #7 @ Get bit offset
19 mov r0, #1
20 save_and_disable_irqs ip, r2
21 ldrb r2, [r1]
22 tst r2, r0, lsl r3
23 bic r2, r2, r0, lsl r3
24 strb r2, [r1]
25 restore_irqs ip
26 moveq r0, #0
27 RETINSTR(mov,pc,lr)
28
29
diff --git a/arch/arm/lib/testsetbit.S b/arch/arm/lib/testsetbit.S
new file mode 100644
index 000000000000..a570fc74cddd
--- /dev/null
+++ b/arch/arm/lib/testsetbit.S
@@ -0,0 +1,29 @@
1/*
2 * linux/arch/arm/lib/testsetbit.S
3 *
4 * Copyright (C) 1995-1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12 .text
13
14ENTRY(_test_and_set_bit_be)
15 eor r0, r0, #0x18 @ big endian byte ordering
16ENTRY(_test_and_set_bit_le)
17 add r1, r1, r0, lsr #3 @ Get byte offset
18 and r3, r0, #7 @ Get bit offset
19 mov r0, #1
20 save_and_disable_irqs ip, r2
21 ldrb r2, [r1]
22 tst r2, r0, lsl r3
23 orr r2, r2, r0, lsl r3
24 strb r2, [r1]
25 restore_irqs ip
26 moveq r0, #0
27 RETINSTR(mov,pc,lr)
28
29
diff --git a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S
new file mode 100644
index 000000000000..d3ed0636c008
--- /dev/null
+++ b/arch/arm/lib/uaccess.S
@@ -0,0 +1,697 @@
1/*
2 * linux/arch/arm/lib/uaccess.S
3 *
4 * Copyright (C) 1995, 1996,1997,1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Routines to block copy data to/from user memory
11 * These are highly optimised both for the 4k page size
12 * and for various alignments.
13 */
14#include <linux/linkage.h>
15#include <asm/assembler.h>
16#include <asm/errno.h>
17
18 .text
19
20#define PAGE_SHIFT 12
21
22/* Prototype: int __arch_copy_to_user(void *to, const char *from, size_t n)
23 * Purpose : copy a block to user memory from kernel memory
24 * Params : to - user memory
25 * : from - kernel memory
26 * : n - number of bytes to copy
27 * Returns : Number of bytes NOT copied.
28 */
29
30.c2u_dest_not_aligned:
31 rsb ip, ip, #4
32 cmp ip, #2
33 ldrb r3, [r1], #1
34USER( strbt r3, [r0], #1) @ May fault
35 ldrgeb r3, [r1], #1
36USER( strgebt r3, [r0], #1) @ May fault
37 ldrgtb r3, [r1], #1
38USER( strgtbt r3, [r0], #1) @ May fault
39 sub r2, r2, ip
40 b .c2u_dest_aligned
41
42ENTRY(__arch_copy_to_user)
43 stmfd sp!, {r2, r4 - r7, lr}
44 cmp r2, #4
45 blt .c2u_not_enough
46 PLD( pld [r1, #0] )
47 PLD( pld [r0, #0] )
48 ands ip, r0, #3
49 bne .c2u_dest_not_aligned
50.c2u_dest_aligned:
51
52 ands ip, r1, #3
53 bne .c2u_src_not_aligned
54/*
55 * Seeing as there has to be at least 8 bytes to copy, we can
56 * copy one word, and force a user-mode page fault...
57 */
58
59.c2u_0fupi: subs r2, r2, #4
60 addmi ip, r2, #4
61 bmi .c2u_0nowords
62 ldr r3, [r1], #4
63USER( strt r3, [r0], #4) @ May fault
64 mov ip, r0, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction
65 rsb ip, ip, #0
66 movs ip, ip, lsr #32 - PAGE_SHIFT
67 beq .c2u_0fupi
68/*
69 * ip = max no. of bytes to copy before needing another "strt" insn
70 */
71 cmp r2, ip
72 movlt ip, r2
73 sub r2, r2, ip
74 subs ip, ip, #32
75 blt .c2u_0rem8lp
76 PLD( pld [r1, #28] )
77 PLD( pld [r0, #28] )
78 PLD( subs ip, ip, #64 )
79 PLD( blt .c2u_0cpynopld )
80 PLD( pld [r1, #60] )
81 PLD( pld [r0, #60] )
82
83.c2u_0cpy8lp:
84 PLD( pld [r1, #92] )
85 PLD( pld [r0, #92] )
86.c2u_0cpynopld: ldmia r1!, {r3 - r6}
87 stmia r0!, {r3 - r6} @ Shouldnt fault
88 ldmia r1!, {r3 - r6}
89 subs ip, ip, #32
90 stmia r0!, {r3 - r6} @ Shouldnt fault
91 bpl .c2u_0cpy8lp
92 PLD( cmn ip, #64 )
93 PLD( bge .c2u_0cpynopld )
94 PLD( add ip, ip, #64 )
95
96.c2u_0rem8lp: cmn ip, #16
97 ldmgeia r1!, {r3 - r6}
98 stmgeia r0!, {r3 - r6} @ Shouldnt fault
99 tst ip, #8
100 ldmneia r1!, {r3 - r4}
101 stmneia r0!, {r3 - r4} @ Shouldnt fault
102 tst ip, #4
103 ldrne r3, [r1], #4
104 strnet r3, [r0], #4 @ Shouldnt fault
105 ands ip, ip, #3
106 beq .c2u_0fupi
107.c2u_0nowords: teq ip, #0
108 beq .c2u_finished
109.c2u_nowords: cmp ip, #2
110 ldrb r3, [r1], #1
111USER( strbt r3, [r0], #1) @ May fault
112 ldrgeb r3, [r1], #1
113USER( strgebt r3, [r0], #1) @ May fault
114 ldrgtb r3, [r1], #1
115USER( strgtbt r3, [r0], #1) @ May fault
116 b .c2u_finished
117
118.c2u_not_enough:
119 movs ip, r2
120 bne .c2u_nowords
121.c2u_finished: mov r0, #0
122 LOADREGS(fd,sp!,{r2, r4 - r7, pc})
123
124.c2u_src_not_aligned:
125 bic r1, r1, #3
126 ldr r7, [r1], #4
127 cmp ip, #2
128 bgt .c2u_3fupi
129 beq .c2u_2fupi
130.c2u_1fupi: subs r2, r2, #4
131 addmi ip, r2, #4
132 bmi .c2u_1nowords
133 mov r3, r7, pull #8
134 ldr r7, [r1], #4
135 orr r3, r3, r7, push #24
136USER( strt r3, [r0], #4) @ May fault
137 mov ip, r0, lsl #32 - PAGE_SHIFT
138 rsb ip, ip, #0
139 movs ip, ip, lsr #32 - PAGE_SHIFT
140 beq .c2u_1fupi
141 cmp r2, ip
142 movlt ip, r2
143 sub r2, r2, ip
144 subs ip, ip, #16
145 blt .c2u_1rem8lp
146 PLD( pld [r1, #12] )
147 PLD( pld [r0, #12] )
148 PLD( subs ip, ip, #32 )
149 PLD( blt .c2u_1cpynopld )
150 PLD( pld [r1, #28] )
151 PLD( pld [r0, #28] )
152
153.c2u_1cpy8lp:
154 PLD( pld [r1, #44] )
155 PLD( pld [r0, #44] )
156.c2u_1cpynopld: mov r3, r7, pull #8
157 ldmia r1!, {r4 - r7}
158 subs ip, ip, #16
159 orr r3, r3, r4, push #24
160 mov r4, r4, pull #8
161 orr r4, r4, r5, push #24
162 mov r5, r5, pull #8
163 orr r5, r5, r6, push #24
164 mov r6, r6, pull #8
165 orr r6, r6, r7, push #24
166 stmia r0!, {r3 - r6} @ Shouldnt fault
167 bpl .c2u_1cpy8lp
168 PLD( cmn ip, #32 )
169 PLD( bge .c2u_1cpynopld )
170 PLD( add ip, ip, #32 )
171
172.c2u_1rem8lp: tst ip, #8
173 movne r3, r7, pull #8
174 ldmneia r1!, {r4, r7}
175 orrne r3, r3, r4, push #24
176 movne r4, r4, pull #8
177 orrne r4, r4, r7, push #24
178 stmneia r0!, {r3 - r4} @ Shouldnt fault
179 tst ip, #4
180 movne r3, r7, pull #8
181 ldrne r7, [r1], #4
182 orrne r3, r3, r7, push #24
183 strnet r3, [r0], #4 @ Shouldnt fault
184 ands ip, ip, #3
185 beq .c2u_1fupi
186.c2u_1nowords: mov r3, r7, get_byte_1
187 teq ip, #0
188 beq .c2u_finished
189 cmp ip, #2
190USER( strbt r3, [r0], #1) @ May fault
191 movge r3, r7, get_byte_2
192USER( strgebt r3, [r0], #1) @ May fault
193 movgt r3, r7, get_byte_3
194USER( strgtbt r3, [r0], #1) @ May fault
195 b .c2u_finished
196
197.c2u_2fupi: subs r2, r2, #4
198 addmi ip, r2, #4
199 bmi .c2u_2nowords
200 mov r3, r7, pull #16
201 ldr r7, [r1], #4
202 orr r3, r3, r7, push #16
203USER( strt r3, [r0], #4) @ May fault
204 mov ip, r0, lsl #32 - PAGE_SHIFT
205 rsb ip, ip, #0
206 movs ip, ip, lsr #32 - PAGE_SHIFT
207 beq .c2u_2fupi
208 cmp r2, ip
209 movlt ip, r2
210 sub r2, r2, ip
211 subs ip, ip, #16
212 blt .c2u_2rem8lp
213 PLD( pld [r1, #12] )
214 PLD( pld [r0, #12] )
215 PLD( subs ip, ip, #32 )
216 PLD( blt .c2u_2cpynopld )
217 PLD( pld [r1, #28] )
218 PLD( pld [r0, #28] )
219
220.c2u_2cpy8lp:
221 PLD( pld [r1, #44] )
222 PLD( pld [r0, #44] )
223.c2u_2cpynopld: mov r3, r7, pull #16
224 ldmia r1!, {r4 - r7}
225 subs ip, ip, #16
226 orr r3, r3, r4, push #16
227 mov r4, r4, pull #16
228 orr r4, r4, r5, push #16
229 mov r5, r5, pull #16
230 orr r5, r5, r6, push #16
231 mov r6, r6, pull #16
232 orr r6, r6, r7, push #16
233 stmia r0!, {r3 - r6} @ Shouldnt fault
234 bpl .c2u_2cpy8lp
235 PLD( cmn ip, #32 )
236 PLD( bge .c2u_2cpynopld )
237 PLD( add ip, ip, #32 )
238
239.c2u_2rem8lp: tst ip, #8
240 movne r3, r7, pull #16
241 ldmneia r1!, {r4, r7}
242 orrne r3, r3, r4, push #16
243 movne r4, r4, pull #16
244 orrne r4, r4, r7, push #16
245 stmneia r0!, {r3 - r4} @ Shouldnt fault
246 tst ip, #4
247 movne r3, r7, pull #16
248 ldrne r7, [r1], #4
249 orrne r3, r3, r7, push #16
250 strnet r3, [r0], #4 @ Shouldnt fault
251 ands ip, ip, #3
252 beq .c2u_2fupi
253.c2u_2nowords: mov r3, r7, get_byte_2
254 teq ip, #0
255 beq .c2u_finished
256 cmp ip, #2
257USER( strbt r3, [r0], #1) @ May fault
258 movge r3, r7, get_byte_3
259USER( strgebt r3, [r0], #1) @ May fault
260 ldrgtb r3, [r1], #0
261USER( strgtbt r3, [r0], #1) @ May fault
262 b .c2u_finished
263
264.c2u_3fupi: subs r2, r2, #4
265 addmi ip, r2, #4
266 bmi .c2u_3nowords
267 mov r3, r7, pull #24
268 ldr r7, [r1], #4
269 orr r3, r3, r7, push #8
270USER( strt r3, [r0], #4) @ May fault
271 mov ip, r0, lsl #32 - PAGE_SHIFT
272 rsb ip, ip, #0
273 movs ip, ip, lsr #32 - PAGE_SHIFT
274 beq .c2u_3fupi
275 cmp r2, ip
276 movlt ip, r2
277 sub r2, r2, ip
278 subs ip, ip, #16
279 blt .c2u_3rem8lp
280 PLD( pld [r1, #12] )
281 PLD( pld [r0, #12] )
282 PLD( subs ip, ip, #32 )
283 PLD( blt .c2u_3cpynopld )
284 PLD( pld [r1, #28] )
285 PLD( pld [r0, #28] )
286
287.c2u_3cpy8lp:
288 PLD( pld [r1, #44] )
289 PLD( pld [r0, #44] )
290.c2u_3cpynopld: mov r3, r7, pull #24
291 ldmia r1!, {r4 - r7}
292 subs ip, ip, #16
293 orr r3, r3, r4, push #8
294 mov r4, r4, pull #24
295 orr r4, r4, r5, push #8
296 mov r5, r5, pull #24
297 orr r5, r5, r6, push #8
298 mov r6, r6, pull #24
299 orr r6, r6, r7, push #8
300 stmia r0!, {r3 - r6} @ Shouldnt fault
301 bpl .c2u_3cpy8lp
302 PLD( cmn ip, #32 )
303 PLD( bge .c2u_3cpynopld )
304 PLD( add ip, ip, #32 )
305
306.c2u_3rem8lp: tst ip, #8
307 movne r3, r7, pull #24
308 ldmneia r1!, {r4, r7}
309 orrne r3, r3, r4, push #8
310 movne r4, r4, pull #24
311 orrne r4, r4, r7, push #8
312 stmneia r0!, {r3 - r4} @ Shouldnt fault
313 tst ip, #4
314 movne r3, r7, pull #24
315 ldrne r7, [r1], #4
316 orrne r3, r3, r7, push #8
317 strnet r3, [r0], #4 @ Shouldnt fault
318 ands ip, ip, #3
319 beq .c2u_3fupi
320.c2u_3nowords: mov r3, r7, get_byte_3
321 teq ip, #0
322 beq .c2u_finished
323 cmp ip, #2
324USER( strbt r3, [r0], #1) @ May fault
325 ldrgeb r3, [r1], #1
326USER( strgebt r3, [r0], #1) @ May fault
327 ldrgtb r3, [r1], #0
328USER( strgtbt r3, [r0], #1) @ May fault
329 b .c2u_finished
330
331 .section .fixup,"ax"
332 .align 0
3339001: LOADREGS(fd,sp!, {r0, r4 - r7, pc})
334 .previous
335
336/* Prototype: unsigned long __arch_copy_from_user(void *to,const void *from,unsigned long n);
337 * Purpose : copy a block from user memory to kernel memory
338 * Params : to - kernel memory
339 * : from - user memory
340 * : n - number of bytes to copy
341 * Returns : Number of bytes NOT copied.
342 */
343.cfu_dest_not_aligned:
344 rsb ip, ip, #4
345 cmp ip, #2
346USER( ldrbt r3, [r1], #1) @ May fault
347 strb r3, [r0], #1
348USER( ldrgebt r3, [r1], #1) @ May fault
349 strgeb r3, [r0], #1
350USER( ldrgtbt r3, [r1], #1) @ May fault
351 strgtb r3, [r0], #1
352 sub r2, r2, ip
353 b .cfu_dest_aligned
354
355ENTRY(__arch_copy_from_user)
356 stmfd sp!, {r0, r2, r4 - r7, lr}
357 cmp r2, #4
358 blt .cfu_not_enough
359 PLD( pld [r1, #0] )
360 PLD( pld [r0, #0] )
361 ands ip, r0, #3
362 bne .cfu_dest_not_aligned
363.cfu_dest_aligned:
364 ands ip, r1, #3
365 bne .cfu_src_not_aligned
366/*
367 * Seeing as there has to be at least 8 bytes to copy, we can
368 * copy one word, and force a user-mode page fault...
369 */
370
371.cfu_0fupi: subs r2, r2, #4
372 addmi ip, r2, #4
373 bmi .cfu_0nowords
374USER( ldrt r3, [r1], #4)
375 str r3, [r0], #4
376 mov ip, r1, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction
377 rsb ip, ip, #0
378 movs ip, ip, lsr #32 - PAGE_SHIFT
379 beq .cfu_0fupi
380/*
381 * ip = max no. of bytes to copy before needing another "strt" insn
382 */
383 cmp r2, ip
384 movlt ip, r2
385 sub r2, r2, ip
386 subs ip, ip, #32
387 blt .cfu_0rem8lp
388 PLD( pld [r1, #28] )
389 PLD( pld [r0, #28] )
390 PLD( subs ip, ip, #64 )
391 PLD( blt .cfu_0cpynopld )
392 PLD( pld [r1, #60] )
393 PLD( pld [r0, #60] )
394
395.cfu_0cpy8lp:
396 PLD( pld [r1, #92] )
397 PLD( pld [r0, #92] )
398.cfu_0cpynopld: ldmia r1!, {r3 - r6} @ Shouldnt fault
399 stmia r0!, {r3 - r6}
400 ldmia r1!, {r3 - r6} @ Shouldnt fault
401 subs ip, ip, #32
402 stmia r0!, {r3 - r6}
403 bpl .cfu_0cpy8lp
404 PLD( cmn ip, #64 )
405 PLD( bge .cfu_0cpynopld )
406 PLD( add ip, ip, #64 )
407
408.cfu_0rem8lp: cmn ip, #16
409 ldmgeia r1!, {r3 - r6} @ Shouldnt fault
410 stmgeia r0!, {r3 - r6}
411 tst ip, #8
412 ldmneia r1!, {r3 - r4} @ Shouldnt fault
413 stmneia r0!, {r3 - r4}
414 tst ip, #4
415 ldrnet r3, [r1], #4 @ Shouldnt fault
416 strne r3, [r0], #4
417 ands ip, ip, #3
418 beq .cfu_0fupi
419.cfu_0nowords: teq ip, #0
420 beq .cfu_finished
421.cfu_nowords: cmp ip, #2
422USER( ldrbt r3, [r1], #1) @ May fault
423 strb r3, [r0], #1
424USER( ldrgebt r3, [r1], #1) @ May fault
425 strgeb r3, [r0], #1
426USER( ldrgtbt r3, [r1], #1) @ May fault
427 strgtb r3, [r0], #1
428 b .cfu_finished
429
430.cfu_not_enough:
431 movs ip, r2
432 bne .cfu_nowords
433.cfu_finished: mov r0, #0
434 add sp, sp, #8
435 LOADREGS(fd,sp!,{r4 - r7, pc})
436
437.cfu_src_not_aligned:
438 bic r1, r1, #3
439USER( ldrt r7, [r1], #4) @ May fault
440 cmp ip, #2
441 bgt .cfu_3fupi
442 beq .cfu_2fupi
443.cfu_1fupi: subs r2, r2, #4
444 addmi ip, r2, #4
445 bmi .cfu_1nowords
446 mov r3, r7, pull #8
447USER( ldrt r7, [r1], #4) @ May fault
448 orr r3, r3, r7, push #24
449 str r3, [r0], #4
450 mov ip, r1, lsl #32 - PAGE_SHIFT
451 rsb ip, ip, #0
452 movs ip, ip, lsr #32 - PAGE_SHIFT
453 beq .cfu_1fupi
454 cmp r2, ip
455 movlt ip, r2
456 sub r2, r2, ip
457 subs ip, ip, #16
458 blt .cfu_1rem8lp
459 PLD( pld [r1, #12] )
460 PLD( pld [r0, #12] )
461 PLD( subs ip, ip, #32 )
462 PLD( blt .cfu_1cpynopld )
463 PLD( pld [r1, #28] )
464 PLD( pld [r0, #28] )
465
466.cfu_1cpy8lp:
467 PLD( pld [r1, #44] )
468 PLD( pld [r0, #44] )
469.cfu_1cpynopld: mov r3, r7, pull #8
470 ldmia r1!, {r4 - r7} @ Shouldnt fault
471 subs ip, ip, #16
472 orr r3, r3, r4, push #24
473 mov r4, r4, pull #8
474 orr r4, r4, r5, push #24
475 mov r5, r5, pull #8
476 orr r5, r5, r6, push #24
477 mov r6, r6, pull #8
478 orr r6, r6, r7, push #24
479 stmia r0!, {r3 - r6}
480 bpl .cfu_1cpy8lp
481 PLD( cmn ip, #32 )
482 PLD( bge .cfu_1cpynopld )
483 PLD( add ip, ip, #32 )
484
485.cfu_1rem8lp: tst ip, #8
486 movne r3, r7, pull #8
487 ldmneia r1!, {r4, r7} @ Shouldnt fault
488 orrne r3, r3, r4, push #24
489 movne r4, r4, pull #8
490 orrne r4, r4, r7, push #24
491 stmneia r0!, {r3 - r4}
492 tst ip, #4
493 movne r3, r7, pull #8
494USER( ldrnet r7, [r1], #4) @ May fault
495 orrne r3, r3, r7, push #24
496 strne r3, [r0], #4
497 ands ip, ip, #3
498 beq .cfu_1fupi
499.cfu_1nowords: mov r3, r7, get_byte_1
500 teq ip, #0
501 beq .cfu_finished
502 cmp ip, #2
503 strb r3, [r0], #1
504 movge r3, r7, get_byte_2
505 strgeb r3, [r0], #1
506 movgt r3, r7, get_byte_3
507 strgtb r3, [r0], #1
508 b .cfu_finished
509
510.cfu_2fupi: subs r2, r2, #4
511 addmi ip, r2, #4
512 bmi .cfu_2nowords
513 mov r3, r7, pull #16
514USER( ldrt r7, [r1], #4) @ May fault
515 orr r3, r3, r7, push #16
516 str r3, [r0], #4
517 mov ip, r1, lsl #32 - PAGE_SHIFT
518 rsb ip, ip, #0
519 movs ip, ip, lsr #32 - PAGE_SHIFT
520 beq .cfu_2fupi
521 cmp r2, ip
522 movlt ip, r2
523 sub r2, r2, ip
524 subs ip, ip, #16
525 blt .cfu_2rem8lp
526 PLD( pld [r1, #12] )
527 PLD( pld [r0, #12] )
528 PLD( subs ip, ip, #32 )
529 PLD( blt .cfu_2cpynopld )
530 PLD( pld [r1, #28] )
531 PLD( pld [r0, #28] )
532
533.cfu_2cpy8lp:
534 PLD( pld [r1, #44] )
535 PLD( pld [r0, #44] )
536.cfu_2cpynopld: mov r3, r7, pull #16
537 ldmia r1!, {r4 - r7} @ Shouldnt fault
538 subs ip, ip, #16
539 orr r3, r3, r4, push #16
540 mov r4, r4, pull #16
541 orr r4, r4, r5, push #16
542 mov r5, r5, pull #16
543 orr r5, r5, r6, push #16
544 mov r6, r6, pull #16
545 orr r6, r6, r7, push #16
546 stmia r0!, {r3 - r6}
547 bpl .cfu_2cpy8lp
548 PLD( cmn ip, #32 )
549 PLD( bge .cfu_2cpynopld )
550 PLD( add ip, ip, #32 )
551
552.cfu_2rem8lp: tst ip, #8
553 movne r3, r7, pull #16
554 ldmneia r1!, {r4, r7} @ Shouldnt fault
555 orrne r3, r3, r4, push #16
556 movne r4, r4, pull #16
557 orrne r4, r4, r7, push #16
558 stmneia r0!, {r3 - r4}
559 tst ip, #4
560 movne r3, r7, pull #16
561USER( ldrnet r7, [r1], #4) @ May fault
562 orrne r3, r3, r7, push #16
563 strne r3, [r0], #4
564 ands ip, ip, #3
565 beq .cfu_2fupi
566.cfu_2nowords: mov r3, r7, get_byte_2
567 teq ip, #0
568 beq .cfu_finished
569 cmp ip, #2
570 strb r3, [r0], #1
571 movge r3, r7, get_byte_3
572 strgeb r3, [r0], #1
573USER( ldrgtbt r3, [r1], #0) @ May fault
574 strgtb r3, [r0], #1
575 b .cfu_finished
576
577.cfu_3fupi: subs r2, r2, #4
578 addmi ip, r2, #4
579 bmi .cfu_3nowords
580 mov r3, r7, pull #24
581USER( ldrt r7, [r1], #4) @ May fault
582 orr r3, r3, r7, push #8
583 str r3, [r0], #4
584 mov ip, r1, lsl #32 - PAGE_SHIFT
585 rsb ip, ip, #0
586 movs ip, ip, lsr #32 - PAGE_SHIFT
587 beq .cfu_3fupi
588 cmp r2, ip
589 movlt ip, r2
590 sub r2, r2, ip
591 subs ip, ip, #16
592 blt .cfu_3rem8lp
593 PLD( pld [r1, #12] )
594 PLD( pld [r0, #12] )
595 PLD( subs ip, ip, #32 )
596 PLD( blt .cfu_3cpynopld )
597 PLD( pld [r1, #28] )
598 PLD( pld [r0, #28] )
599
600.cfu_3cpy8lp:
601 PLD( pld [r1, #44] )
602 PLD( pld [r0, #44] )
603.cfu_3cpynopld: mov r3, r7, pull #24
604 ldmia r1!, {r4 - r7} @ Shouldnt fault
605 orr r3, r3, r4, push #8
606 mov r4, r4, pull #24
607 orr r4, r4, r5, push #8
608 mov r5, r5, pull #24
609 orr r5, r5, r6, push #8
610 mov r6, r6, pull #24
611 orr r6, r6, r7, push #8
612 stmia r0!, {r3 - r6}
613 subs ip, ip, #16
614 bpl .cfu_3cpy8lp
615 PLD( cmn ip, #32 )
616 PLD( bge .cfu_3cpynopld )
617 PLD( add ip, ip, #32 )
618
619.cfu_3rem8lp: tst ip, #8
620 movne r3, r7, pull #24
621 ldmneia r1!, {r4, r7} @ Shouldnt fault
622 orrne r3, r3, r4, push #8
623 movne r4, r4, pull #24
624 orrne r4, r4, r7, push #8
625 stmneia r0!, {r3 - r4}
626 tst ip, #4
627 movne r3, r7, pull #24
628USER( ldrnet r7, [r1], #4) @ May fault
629 orrne r3, r3, r7, push #8
630 strne r3, [r0], #4
631 ands ip, ip, #3
632 beq .cfu_3fupi
633.cfu_3nowords: mov r3, r7, get_byte_3
634 teq ip, #0
635 beq .cfu_finished
636 cmp ip, #2
637 strb r3, [r0], #1
638USER( ldrgebt r3, [r1], #1) @ May fault
639 strgeb r3, [r0], #1
640USER( ldrgtbt r3, [r1], #1) @ May fault
641 strgtb r3, [r0], #1
642 b .cfu_finished
643
644 .section .fixup,"ax"
645 .align 0
646 /*
647 * We took an exception. r0 contains a pointer to
648 * the byte not copied.
649 */
6509001: ldr r2, [sp], #4 @ void *to
651 sub r2, r0, r2 @ bytes copied
652 ldr r1, [sp], #4 @ unsigned long count
653 subs r4, r1, r2 @ bytes left to copy
654 movne r1, r4
655 blne __memzero
656 mov r0, r4
657 LOADREGS(fd,sp!, {r4 - r7, pc})
658 .previous
659
660/* Prototype: int __arch_clear_user(void *addr, size_t sz)
661 * Purpose : clear some user memory
662 * Params : addr - user memory address to clear
663 * : sz - number of bytes to clear
664 * Returns : number of bytes NOT cleared
665 */
666ENTRY(__arch_clear_user)
667 stmfd sp!, {r1, lr}
668 mov r2, #0
669 cmp r1, #4
670 blt 2f
671 ands ip, r0, #3
672 beq 1f
673 cmp ip, #2
674USER( strbt r2, [r0], #1)
675USER( strlebt r2, [r0], #1)
676USER( strltbt r2, [r0], #1)
677 rsb ip, ip, #4
678 sub r1, r1, ip @ 7 6 5 4 3 2 1
6791: subs r1, r1, #8 @ -1 -2 -3 -4 -5 -6 -7
680USER( strplt r2, [r0], #4)
681USER( strplt r2, [r0], #4)
682 bpl 1b
683 adds r1, r1, #4 @ 3 2 1 0 -1 -2 -3
684USER( strplt r2, [r0], #4)
6852: tst r1, #2 @ 1x 1x 0x 0x 1x 1x 0x
686USER( strnebt r2, [r0], #1)
687USER( strnebt r2, [r0], #1)
688 tst r1, #1 @ x1 x0 x1 x0 x1 x0 x1
689USER( strnebt r2, [r0], #1)
690 mov r0, #0
691 LOADREGS(fd,sp!, {r1, pc})
692
693 .section .fixup,"ax"
694 .align 0
6959001: LOADREGS(fd,sp!, {r0, pc})
696 .previous
697
diff --git a/arch/arm/lib/ucmpdi2.c b/arch/arm/lib/ucmpdi2.c
new file mode 100644
index 000000000000..6c6ae63efa02
--- /dev/null
+++ b/arch/arm/lib/ucmpdi2.c
@@ -0,0 +1,51 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34word_type
35__ucmpdi2 (DItype a, DItype b)
36{
37 DIunion au, bu;
38
39 au.ll = a, bu.ll = b;
40
41 if ((USItype) au.s.high < (USItype) bu.s.high)
42 return 0;
43 else if ((USItype) au.s.high > (USItype) bu.s.high)
44 return 2;
45 if ((USItype) au.s.low < (USItype) bu.s.low)
46 return 0;
47 else if ((USItype) au.s.low > (USItype) bu.s.low)
48 return 2;
49 return 1;
50}
51
diff --git a/arch/arm/lib/udivdi3.c b/arch/arm/lib/udivdi3.c
new file mode 100644
index 000000000000..d25195f673f4
--- /dev/null
+++ b/arch/arm/lib/udivdi3.c
@@ -0,0 +1,242 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33#include "longlong.h"
34
35static const UQItype __clz_tab[] =
36{
37 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
38 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
39 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
40 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
41 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
42 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
43 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
44 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
45};
46
47UDItype
48__udivmoddi4 (UDItype n, UDItype d, UDItype *rp)
49{
50 DIunion ww;
51 DIunion nn, dd;
52 DIunion rr;
53 USItype d0, d1, n0, n1, n2;
54 USItype q0, q1;
55 USItype b, bm;
56
57 nn.ll = n;
58 dd.ll = d;
59
60 d0 = dd.s.low;
61 d1 = dd.s.high;
62 n0 = nn.s.low;
63 n1 = nn.s.high;
64
65 if (d1 == 0)
66 {
67 if (d0 > n1)
68 {
69 /* 0q = nn / 0D */
70
71 count_leading_zeros (bm, d0);
72
73 if (bm != 0)
74 {
75 /* Normalize, i.e. make the most significant bit of the
76 denominator set. */
77
78 d0 = d0 << bm;
79 n1 = (n1 << bm) | (n0 >> (SI_TYPE_SIZE - bm));
80 n0 = n0 << bm;
81 }
82
83 udiv_qrnnd (q0, n0, n1, n0, d0);
84 q1 = 0;
85
86 /* Remainder in n0 >> bm. */
87 }
88 else
89 {
90 /* qq = NN / 0d */
91
92 if (d0 == 0)
93 d0 = 1 / d0; /* Divide intentionally by zero. */
94
95 count_leading_zeros (bm, d0);
96
97 if (bm == 0)
98 {
99 /* From (n1 >= d0) /\ (the most significant bit of d0 is set),
100 conclude (the most significant bit of n1 is set) /\ (the
101 leading quotient digit q1 = 1).
102
103 This special case is necessary, not an optimization.
104 (Shifts counts of SI_TYPE_SIZE are undefined.) */
105
106 n1 -= d0;
107 q1 = 1;
108 }
109 else
110 {
111 /* Normalize. */
112
113 b = SI_TYPE_SIZE - bm;
114
115 d0 = d0 << bm;
116 n2 = n1 >> b;
117 n1 = (n1 << bm) | (n0 >> b);
118 n0 = n0 << bm;
119
120 udiv_qrnnd (q1, n1, n2, n1, d0);
121 }
122
123 /* n1 != d0... */
124
125 udiv_qrnnd (q0, n0, n1, n0, d0);
126
127 /* Remainder in n0 >> bm. */
128 }
129
130 if (rp != 0)
131 {
132 rr.s.low = n0 >> bm;
133 rr.s.high = 0;
134 *rp = rr.ll;
135 }
136 }
137 else
138 {
139 if (d1 > n1)
140 {
141 /* 00 = nn / DD */
142
143 q0 = 0;
144 q1 = 0;
145
146 /* Remainder in n1n0. */
147 if (rp != 0)
148 {
149 rr.s.low = n0;
150 rr.s.high = n1;
151 *rp = rr.ll;
152 }
153 }
154 else
155 {
156 /* 0q = NN / dd */
157
158 count_leading_zeros (bm, d1);
159 if (bm == 0)
160 {
161 /* From (n1 >= d1) /\ (the most significant bit of d1 is set),
162 conclude (the most significant bit of n1 is set) /\ (the
163 quotient digit q0 = 0 or 1).
164
165 This special case is necessary, not an optimization. */
166
167 /* The condition on the next line takes advantage of that
168 n1 >= d1 (true due to program flow). */
169 if (n1 > d1 || n0 >= d0)
170 {
171 q0 = 1;
172 sub_ddmmss (n1, n0, n1, n0, d1, d0);
173 }
174 else
175 q0 = 0;
176
177 q1 = 0;
178
179 if (rp != 0)
180 {
181 rr.s.low = n0;
182 rr.s.high = n1;
183 *rp = rr.ll;
184 }
185 }
186 else
187 {
188 USItype m1, m0;
189 /* Normalize. */
190
191 b = SI_TYPE_SIZE - bm;
192
193 d1 = (d1 << bm) | (d0 >> b);
194 d0 = d0 << bm;
195 n2 = n1 >> b;
196 n1 = (n1 << bm) | (n0 >> b);
197 n0 = n0 << bm;
198
199 udiv_qrnnd (q0, n1, n2, n1, d1);
200 umul_ppmm (m1, m0, q0, d0);
201
202 if (m1 > n1 || (m1 == n1 && m0 > n0))
203 {
204 q0--;
205 sub_ddmmss (m1, m0, m1, m0, d1, d0);
206 }
207
208 q1 = 0;
209
210 /* Remainder in (n1n0 - m1m0) >> bm. */
211 if (rp != 0)
212 {
213 sub_ddmmss (n1, n0, n1, n0, m1, m0);
214 rr.s.low = (n1 << b) | (n0 >> bm);
215 rr.s.high = n1 >> bm;
216 *rp = rr.ll;
217 }
218 }
219 }
220 }
221
222 ww.s.low = q0;
223 ww.s.high = q1;
224 return ww.ll;
225}
226
227UDItype
228__udivdi3 (UDItype n, UDItype d)
229{
230 return __udivmoddi4 (n, d, (UDItype *) 0);
231}
232
233UDItype
234__umoddi3 (UDItype u, UDItype v)
235{
236 UDItype w;
237
238 (void) __udivmoddi4 (u ,v, &w);
239
240 return w;
241}
242
diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
new file mode 100644
index 000000000000..f6e676322ca9
--- /dev/null
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -0,0 +1,71 @@
1if ARCH_CLPS711X
2
3menu "CLPS711X/EP721X Implementations"
4
5config ARCH_AUTCPU12
6 bool "AUTCPU12"
7 help
8 Say Y if you intend to run the kernel on the autronix autcpu12
9 board. This board is based on a Cirrus Logic CS89712.
10
11config ARCH_CDB89712
12 bool "CDB89712"
13 help
14 This is an evaluation board from Cirrus for the CS89712 processor.
15 The board includes 2 serial ports, Ethernet, IRDA, and expansion
16 headers. It comes with 16 MB SDRAM and 8 MB flash ROM.
17
18config ARCH_CEIVA
19 bool "CEIVA"
20 help
21 Say Y here if you intend to run this kernel on the Ceiva/Polaroid
22 PhotoMax Digital Picture Frame.
23
24config ARCH_CLEP7312
25 bool "CLEP7312"
26
27config ARCH_EDB7211
28 bool "EDB7211"
29 help
30 Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211
31 evaluation board.
32
33config ARCH_P720T
34 bool "P720T"
35 help
36 Say Y here if you intend to run this kernel on the ARM Prospector
37 720T.
38
39config ARCH_FORTUNET
40 bool "FORTUNET"
41
42# XXX Maybe these should indicate register compatibility
43# instead of being mutually exclusive.
44config ARCH_EP7211
45 bool
46 depends on ARCH_EDB7211
47 default y
48
49config ARCH_EP7212
50 bool
51 depends on ARCH_P720T || ARCH_CEIVA
52 default y
53
54config EP72XX_ROM_BOOT
55 bool "EP72xx ROM boot"
56 depends on ARCH_EP7211 || ARCH_EP7212
57 ---help---
58 If you say Y here, your CLPS711x-based kernel will use the bootstrap
59 mode memory map instead of the normal memory map.
60
61 Processors derived from the Cirrus CLPS-711X core support two boot
62 modes. Normal mode boots from the external memory device at CS0.
63 Bootstrap mode rearranges parts of the memory map, placing an
64 internal 128 byte bootstrap ROM at CS0. This option performs the
65 address map changes required to support booting in this mode.
66
67 You almost surely want to say N here.
68
69endmenu
70
71endif
diff --git a/arch/arm/mach-clps711x/Makefile b/arch/arm/mach-clps711x/Makefile
new file mode 100644
index 000000000000..4a197315f0cf
--- /dev/null
+++ b/arch/arm/mach-clps711x/Makefile
@@ -0,0 +1,20 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := irq.o mm.o time.o
8obj-m :=
9obj-n :=
10obj- :=
11
12obj-$(CONFIG_ARCH_CEIVA) += ceiva.o
13obj-$(CONFIG_ARCH_AUTCPU12) += autcpu12.o
14obj-$(CONFIG_ARCH_CDB89712) += cdb89712.o
15obj-$(CONFIG_ARCH_CLEP7312) += clep7312.o
16obj-$(CONFIG_ARCH_EDB7211) += edb7211-arch.o edb7211-mm.o
17obj-$(CONFIG_ARCH_FORTUNET) += fortunet.o
18obj-$(CONFIG_ARCH_P720T) += p720t.o
19leds-$(CONFIG_ARCH_P720T) += p720t-leds.o
20obj-$(CONFIG_LEDS) += $(leds-y)
diff --git a/arch/arm/mach-clps711x/Makefile.boot b/arch/arm/mach-clps711x/Makefile.boot
new file mode 100644
index 000000000000..d3d29339e149
--- /dev/null
+++ b/arch/arm/mach-clps711x/Makefile.boot
@@ -0,0 +1,7 @@
1# The standard locations for stuff on CLPS711x type processors
2 zreladdr-y := 0xc0028000
3params_phys-y := 0xc0000100
4# Should probably have some agreement on these...
5initrd_phys-$(CONFIG_ARCH_P720T) := 0xc0400000
6initrd_phys-$(CONFIG_ARCH_CDB89712) := 0x00700000
7
diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c
new file mode 100644
index 000000000000..c106704a2c34
--- /dev/null
+++ b/arch/arm/mach-clps711x/autcpu12.c
@@ -0,0 +1,69 @@
1/*
2 * linux/arch/arm/mach-clps711x/autcpu12.c
3 *
4 * (c) 2001 Thomas Gleixner, autronix automation <gleixner@autronix.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/types.h>
23#include <linux/string.h>
24#include <linux/mm.h>
25
26#include <asm/hardware.h>
27#include <asm/sizes.h>
28#include <asm/io.h>
29#include <asm/setup.h>
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/pgtable.h>
33#include <asm/page.h>
34
35#include <asm/mach/map.h>
36#include <asm/arch/autcpu12.h>
37
38#include "common.h"
39
40/*
41 * The on-chip registers are given a size of 1MB so that a section can
42 * be used to map them; this saves a page table. This is the place to
43 * add mappings for ROM, expansion memory, PCMCIA, etc. (if static
44 * mappings are chosen for those areas).
45 *
46*/
47
48static struct map_desc autcpu12_io_desc[] __initdata = {
49 /* virtual, physical, length, type */
50 /* memory-mapped extra io and CS8900A Ethernet chip */
51 /* ethernet chip */
52 { AUTCPU12_VIRT_CS8900A, AUTCPU12_PHYS_CS8900A, SZ_1M, MT_DEVICE }
53};
54
55void __init autcpu12_map_io(void)
56{
57 clps711x_map_io();
58 iotable_init(autcpu12_io_desc, ARRAY_SIZE(autcpu12_io_desc));
59}
60
61MACHINE_START(AUTCPU12, "autronix autcpu12")
62 MAINTAINER("Thomas Gleixner")
63 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
64 BOOT_PARAMS(0xc0020000)
65 MAPIO(autcpu12_map_io)
66 INITIRQ(clps711x_init_irq)
67 .timer = &clps711x_timer,
68MACHINE_END
69
diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c
new file mode 100644
index 000000000000..7664f9cf83b8
--- /dev/null
+++ b/arch/arm/mach-clps711x/cdb89712.c
@@ -0,0 +1,58 @@
1/*
2 * linux/arch/arm/mach-clps711x/cdb89712.c
3 *
4 * Copyright (C) 2000-2001 Deep Blue Solutions Ltd
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/types.h>
23#include <linux/string.h>
24#include <linux/mm.h>
25
26#include <asm/hardware.h>
27#include <asm/io.h>
28#include <asm/pgtable.h>
29#include <asm/page.h>
30#include <asm/setup.h>
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33#include <asm/mach/map.h>
34
35#include "common.h"
36
37/*
38 * Map the CS89712 Ethernet port. That should be moved to the
39 * ethernet driver, perhaps.
40 */
41static struct map_desc cdb89712_io_desc[] __initdata = {
42 { ETHER_BASE, ETHER_START, ETHER_SIZE, MT_DEVICE }
43};
44
45static void __init cdb89712_map_io(void)
46{
47 clps711x_map_io();
48 iotable_init(cdb89712_io_desc, ARRAY_SIZE(cdb89712_io_desc));
49}
50
51MACHINE_START(CDB89712, "Cirrus-CDB89712")
52 MAINTAINER("Ray Lehtiniemi")
53 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
54 BOOT_PARAMS(0xc0000100)
55 MAPIO(cdb89712_map_io)
56 INITIRQ(clps711x_init_irq)
57 .timer = &clps711x_timer,
58MACHINE_END
diff --git a/arch/arm/mach-clps711x/ceiva.c b/arch/arm/mach-clps711x/ceiva.c
new file mode 100644
index 000000000000..e4093be3c4cb
--- /dev/null
+++ b/arch/arm/mach-clps711x/ceiva.c
@@ -0,0 +1,62 @@
1/*
2 * linux/arch/arm/mach-clps711x/arch-ceiva.c
3 *
4 * Copyright (C) 2002, Rob Scott <rscott@mtrob.fdns.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/init.h>
21#include <linux/types.h>
22#include <linux/string.h>
23
24#include <asm/setup.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28#include <linux/kernel.h>
29
30#include <asm/hardware.h>
31#include <asm/page.h>
32#include <asm/pgtable.h>
33#include <asm/sizes.h>
34
35#include <asm/mach/map.h>
36
37#include "common.h"
38
39static struct map_desc ceiva_io_desc[] __initdata = {
40 /* virtual, physical, length, type */
41
42 /* SED1355 controlled video RAM & registers */
43 { CEIVA_VIRT_SED1355, CEIVA_PHYS_SED1355, SZ_2M, MT_DEVICE }
44
45};
46
47
48static void __init ceiva_map_io(void)
49{
50 clps711x_map_io();
51 iotable_init(ceiva_io_desc, ARRAY_SIZE(ceiva_io_desc));
52}
53
54
55MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame")
56 MAINTAINER("Rob Scott")
57 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
58 BOOT_PARAMS(0xc0000100)
59 MAPIO(ceiva_map_io)
60 INITIRQ(clps711x_init_irq)
61 .timer = &clps711x_timer,
62MACHINE_END
diff --git a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c
new file mode 100644
index 000000000000..9ca21cb481ba
--- /dev/null
+++ b/arch/arm/mach-clps711x/clep7312.c
@@ -0,0 +1,48 @@
1/*
2 * linux/arch/arm/mach-clps711x/clep7312.c
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#include <linux/init.h>
19#include <linux/types.h>
20#include <linux/string.h>
21
22#include <asm/setup.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25
26#include "common.h"
27
28static void __init
29fixup_clep7312(struct machine_desc *desc, struct tag *tags,
30 char **cmdline, struct meminfo *mi)
31{
32 mi->nr_banks=1;
33 mi->bank[0].start = 0xc0000000;
34 mi->bank[0].size = 0x01000000;
35 mi->bank[0].node = 0;
36}
37
38
39MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
40 MAINTAINER("Nobody")
41 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
42 BOOT_PARAMS(0xc0000100)
43 FIXUP(fixup_clep7312)
44 MAPIO(clps711x_map_io)
45 INITIRQ(clps711x_init_irq)
46 .timer = &clps711x_timer,
47MACHINE_END
48
diff --git a/arch/arm/mach-clps711x/common.h b/arch/arm/mach-clps711x/common.h
new file mode 100644
index 000000000000..2b8b801f1dc3
--- /dev/null
+++ b/arch/arm/mach-clps711x/common.h
@@ -0,0 +1,11 @@
1/*
2 * linux/arch/arm/mach-clps711x/common.h
3 *
4 * Common bits.
5 */
6
7struct sys_timer;
8
9extern void clps711x_map_io(void);
10extern void clps711x_init_irq(void);
11extern struct sys_timer clps711x_timer;
diff --git a/arch/arm/mach-clps711x/dma.c b/arch/arm/mach-clps711x/dma.c
new file mode 100644
index 000000000000..af5a4de38eac
--- /dev/null
+++ b/arch/arm/mach-clps711x/dma.c
@@ -0,0 +1,27 @@
1/*
2 * linux/arch/arm/mach-clps711x/dma.c
3 *
4 * Copyright (C) 2000 Deep Blue Solutions Ltd
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/init.h>
21
22#include <asm/dma.h>
23#include <asm/mach/dma.h>
24
25void __init arch_dma_init(dma_t *dma)
26{
27}
diff --git a/arch/arm/mach-clps711x/edb7211-arch.c b/arch/arm/mach-clps711x/edb7211-arch.c
new file mode 100644
index 000000000000..c6c46324a2e3
--- /dev/null
+++ b/arch/arm/mach-clps711x/edb7211-arch.c
@@ -0,0 +1,61 @@
1/*
2 * linux/arch/arm/mach-clps711x/arch-edb7211.c
3 *
4 * Copyright (C) 2000, 2001 Blue Mug, Inc. All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/init.h>
21#include <linux/types.h>
22#include <linux/string.h>
23
24#include <asm/setup.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28#include "common.h"
29
30extern void edb7211_map_io(void);
31
32static void __init
33fixup_edb7211(struct machine_desc *desc, struct tag *tags,
34 char **cmdline, struct meminfo *mi)
35{
36 /*
37 * Bank start addresses are not present in the information
38 * passed in from the boot loader. We could potentially
39 * detect them, but instead we hard-code them.
40 *
41 * Banks sizes _are_ present in the param block, but we're
42 * not using that information yet.
43 */
44 mi->bank[0].start = 0xc0000000;
45 mi->bank[0].size = 8*1024*1024;
46 mi->bank[0].node = 0;
47 mi->bank[1].start = 0xc1000000;
48 mi->bank[1].size = 8*1024*1024;
49 mi->bank[1].node = 1;
50 mi->nr_banks = 2;
51}
52
53MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
54 MAINTAINER("Jon McClintock")
55 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
56 BOOT_PARAMS(0xc0020100) /* 0xc0000000 - 0xc001ffff can be video RAM */
57 FIXUP(fixup_edb7211)
58 MAPIO(edb7211_map_io)
59 INITIRQ(clps711x_init_irq)
60 .timer = &clps711x_timer,
61MACHINE_END
diff --git a/arch/arm/mach-clps711x/edb7211-mm.c b/arch/arm/mach-clps711x/edb7211-mm.c
new file mode 100644
index 000000000000..7fd7b01822d0
--- /dev/null
+++ b/arch/arm/mach-clps711x/edb7211-mm.c
@@ -0,0 +1,70 @@
1/*
2 * linux/arch/arm/mach-clps711x/mm.c
3 *
4 * Extra MM routines for the EDB7211 board
5 *
6 * Copyright (C) 2000, 2001 Blue Mug, Inc. All Rights Reserved.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#include <linux/kernel.h>
23#include <linux/init.h>
24
25#include <asm/hardware.h>
26#include <asm/page.h>
27#include <asm/pgtable.h>
28#include <asm/sizes.h>
29
30#include <asm/mach/map.h>
31
32extern void clps711x_map_io(void);
33
34/*
35 * The on-chip registers are given a size of 1MB so that a section can
36 * be used to map them; this saves a page table. This is the place to
37 * add mappings for ROM, expansion memory, PCMCIA, etc. (if static
38 * mappings are chosen for those areas).
39 *
40 * Here is a physical memory map (to be fleshed out later):
41 *
42 * Physical Address Size Description
43 * ----------------- ----- ---------------------------------
44 * c0000000-c001ffff 128KB reserved for video RAM [1]
45 * c0020000-c0023fff 16KB parameters (see Documentation/arm/Setup)
46 * c0024000-c0027fff 16KB swapper_pg_dir (task 0 page directory)
47 * c0028000-... kernel image (TEXTADDR)
48 *
49 * [1] Unused pages should be given back to the VM; they are not yet.
50 * The parameter block should also be released (not sure if this
51 * happens).
52 */
53static struct map_desc edb7211_io_desc[] __initdata = {
54 /* virtual, physical, length, type */
55
56 /* memory-mapped extra keyboard row and CS8900A Ethernet chip */
57 { EP7211_VIRT_EXTKBD, EP7211_PHYS_EXTKBD, SZ_1M, MT_DEVICE },
58 { EP7211_VIRT_CS8900A, EP7211_PHYS_CS8900A, SZ_1M, MT_DEVICE },
59
60 /* flash banks */
61 { EP7211_VIRT_FLASH1, EP7211_PHYS_FLASH1, SZ_8M, MT_DEVICE },
62 { EP7211_VIRT_FLASH2, EP7211_PHYS_FLASH2, SZ_8M, MT_DEVICE }
63};
64
65void __init edb7211_map_io(void)
66{
67 clps711x_map_io();
68 iotable_init(edb7211_io_desc, ARRAY_SIZE(edb7211_io_desc));
69}
70
diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c
new file mode 100644
index 000000000000..c1c5b8e01549
--- /dev/null
+++ b/arch/arm/mach-clps711x/fortunet.c
@@ -0,0 +1,85 @@
1/*
2 * linux/arch/arm/mach-clps711x/fortunet.c
3 *
4 * Derived from linux/arch/arm/mach-integrator/arch.c
5 *
6 * Copyright (C) 2000 Deep Blue Solutions Ltd
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#include <linux/config.h>
23#include <linux/types.h>
24#include <linux/init.h>
25#include <linux/initrd.h>
26
27#include <asm/hardware.h>
28#include <asm/irq.h>
29#include <asm/setup.h>
30#include <asm/mach-types.h>
31
32#include <asm/mach/arch.h>
33
34#include "common.h"
35
36struct meminfo memmap = {
37 .nr_banks = 1,
38 .bank = {
39 {
40 .start = 0xC0000000,
41 .size = 0x01000000,
42 .node = 0
43 },
44 },
45};
46
47typedef struct tag_IMAGE_PARAMS
48{
49 int ramdisk_ok;
50 int ramdisk_address;
51 int ramdisk_size;
52 int ram_size;
53 int extra_param_type;
54 int extra_param_ptr;
55 int command_line;
56} IMAGE_PARAMS;
57
58#define IMAGE_PARAMS_PHYS 0xC01F0000
59
60static void __init
61fortunet_fixup(struct machine_desc *desc, struct tag *tags,
62 char **cmdline, struct meminfo *mi)
63{
64 IMAGE_PARAMS *ip = phys_to_virt(IMAGE_PARAMS_PHYS);
65 *cmdline = phys_to_virt(ip->command_line);
66#ifdef CONFIG_BLK_DEV_INITRD
67 if(ip->ramdisk_ok)
68 {
69 initrd_start = __phys_to_virt(ip->ramdisk_address);
70 initrd_end = initrd_start + ip->ramdisk_size;
71 }
72#endif
73 memmap.bank[0].size = ip->ram_size;
74 *mi = memmap;
75}
76
77MACHINE_START(FORTUNET, "ARM-FortuNet")
78 MAINTAINER("FortuNet Inc.")
79 BOOT_MEM(0xc0000000, 0x80000000, 0xf0000000)
80 BOOT_PARAMS(0x00000000)
81 FIXUP(fortunet_fixup)
82 MAPIO(clps711x_map_io)
83 INITIRQ(clps711x_init_irq)
84 .timer = &clps711x_timer,
85MACHINE_END
diff --git a/arch/arm/mach-clps711x/irq.c b/arch/arm/mach-clps711x/irq.c
new file mode 100644
index 000000000000..7ee926e5bad2
--- /dev/null
+++ b/arch/arm/mach-clps711x/irq.c
@@ -0,0 +1,143 @@
1/*
2 * linux/arch/arm/mach-clps711x/irq.c
3 *
4 * Copyright (C) 2000 Deep Blue Solutions Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/init.h>
21#include <linux/list.h>
22
23#include <asm/mach/irq.h>
24#include <asm/hardware.h>
25#include <asm/io.h>
26#include <asm/irq.h>
27
28#include <asm/hardware/clps7111.h>
29
30static void int1_mask(unsigned int irq)
31{
32 u32 intmr1;
33
34 intmr1 = clps_readl(INTMR1);
35 intmr1 &= ~(1 << irq);
36 clps_writel(intmr1, INTMR1);
37}
38
39static void int1_ack(unsigned int irq)
40{
41 u32 intmr1;
42
43 intmr1 = clps_readl(INTMR1);
44 intmr1 &= ~(1 << irq);
45 clps_writel(intmr1, INTMR1);
46
47 switch (irq) {
48 case IRQ_CSINT: clps_writel(0, COEOI); break;
49 case IRQ_TC1OI: clps_writel(0, TC1EOI); break;
50 case IRQ_TC2OI: clps_writel(0, TC2EOI); break;
51 case IRQ_RTCMI: clps_writel(0, RTCEOI); break;
52 case IRQ_TINT: clps_writel(0, TEOI); break;
53 case IRQ_UMSINT: clps_writel(0, UMSEOI); break;
54 }
55}
56
57static void int1_unmask(unsigned int irq)
58{
59 u32 intmr1;
60
61 intmr1 = clps_readl(INTMR1);
62 intmr1 |= 1 << irq;
63 clps_writel(intmr1, INTMR1);
64}
65
66static struct irqchip int1_chip = {
67 .ack = int1_ack,
68 .mask = int1_mask,
69 .unmask = int1_unmask,
70};
71
72static void int2_mask(unsigned int irq)
73{
74 u32 intmr2;
75
76 intmr2 = clps_readl(INTMR2);
77 intmr2 &= ~(1 << (irq - 16));
78 clps_writel(intmr2, INTMR2);
79}
80
81static void int2_ack(unsigned int irq)
82{
83 u32 intmr2;
84
85 intmr2 = clps_readl(INTMR2);
86 intmr2 &= ~(1 << (irq - 16));
87 clps_writel(intmr2, INTMR2);
88
89 switch (irq) {
90 case IRQ_KBDINT: clps_writel(0, KBDEOI); break;
91 }
92}
93
94static void int2_unmask(unsigned int irq)
95{
96 u32 intmr2;
97
98 intmr2 = clps_readl(INTMR2);
99 intmr2 |= 1 << (irq - 16);
100 clps_writel(intmr2, INTMR2);
101}
102
103static struct irqchip int2_chip = {
104 .ack = int2_ack,
105 .mask = int2_mask,
106 .unmask = int2_unmask,
107};
108
109void __init clps711x_init_irq(void)
110{
111 unsigned int i;
112
113 for (i = 0; i < NR_IRQS; i++) {
114 if (INT1_IRQS & (1 << i)) {
115 set_irq_handler(i, do_level_IRQ);
116 set_irq_chip(i, &int1_chip);
117 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
118 }
119 if (INT2_IRQS & (1 << i)) {
120 set_irq_handler(i, do_level_IRQ);
121 set_irq_chip(i, &int2_chip);
122 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
123 }
124 }
125
126 /*
127 * Disable interrupts
128 */
129 clps_writel(0, INTMR1);
130 clps_writel(0, INTMR2);
131
132 /*
133 * Clear down any pending interrupts
134 */
135 clps_writel(0, COEOI);
136 clps_writel(0, TC1EOI);
137 clps_writel(0, TC2EOI);
138 clps_writel(0, RTCEOI);
139 clps_writel(0, TEOI);
140 clps_writel(0, UMSEOI);
141 clps_writel(0, SYNCIO);
142 clps_writel(0, KBDEOI);
143}
diff --git a/arch/arm/mach-clps711x/mm.c b/arch/arm/mach-clps711x/mm.c
new file mode 100644
index 000000000000..120b7cac84b5
--- /dev/null
+++ b/arch/arm/mach-clps711x/mm.c
@@ -0,0 +1,43 @@
1/*
2 * linux/arch/arm/mach-clps711x/mm.c
3 *
4 * Generic MM setup for the CLPS711x-based machines.
5 *
6 * Copyright (C) 2001 Deep Blue Solutions Ltd
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#include <linux/kernel.h>
23#include <linux/mm.h>
24#include <linux/init.h>
25#include <linux/bootmem.h>
26
27#include <asm/hardware.h>
28#include <asm/pgtable.h>
29#include <asm/page.h>
30#include <asm/mach/map.h>
31#include <asm/hardware/clps7111.h>
32
33/*
34 * This maps the generic CLPS711x registers
35 */
36static struct map_desc clps711x_io_desc[] __initdata = {
37 { CLPS7111_VIRT_BASE, CLPS7111_PHYS_BASE, 1048576, MT_DEVICE }
38};
39
40void __init clps711x_map_io(void)
41{
42 iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc));
43}
diff --git a/arch/arm/mach-clps711x/p720t-leds.c b/arch/arm/mach-clps711x/p720t-leds.c
new file mode 100644
index 000000000000..4915b3524963
--- /dev/null
+++ b/arch/arm/mach-clps711x/p720t-leds.c
@@ -0,0 +1,67 @@
1/*
2 * linux/arch/arm/mach-clps711x/leds.c
3 *
4 * Integrator LED control routines
5 *
6 * Copyright (C) 2000 Deep Blue Solutions Ltd
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#include <linux/kernel.h>
23#include <linux/init.h>
24
25#include <asm/hardware.h>
26#include <asm/io.h>
27#include <asm/leds.h>
28#include <asm/system.h>
29#include <asm/mach-types.h>
30
31#include <asm/hardware/clps7111.h>
32#include <asm/hardware/ep7212.h>
33
34static void p720t_leds_event(led_event_t ledevt)
35{
36 unsigned long flags;
37 u32 pddr;
38
39 local_irq_save(flags);
40 switch(ledevt) {
41 case led_idle_start:
42 break;
43
44 case led_idle_end:
45 break;
46
47 case led_timer:
48 pddr = clps_readb(PDDR);
49 clps_writeb(pddr ^ 1, PDDR);
50 break;
51
52 default:
53 break;
54 }
55
56 local_irq_restore(flags);
57}
58
59static int __init leds_init(void)
60{
61 if (machine_is_p720t())
62 leds_event = p720t_leds_event;
63
64 return 0;
65}
66
67arch_initcall(leds_init);
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
new file mode 100644
index 000000000000..29269df054f5
--- /dev/null
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -0,0 +1,115 @@
1/*
2 * linux/arch/arm/mach-clps711x/p720t.c
3 *
4 * Copyright (C) 2000-2001 Deep Blue Solutions Ltd
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/config.h>
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/types.h>
24#include <linux/string.h>
25#include <linux/mm.h>
26
27#include <asm/hardware.h>
28#include <asm/io.h>
29#include <asm/pgtable.h>
30#include <asm/page.h>
31#include <asm/setup.h>
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34#include <asm/mach/map.h>
35#include <asm/arch/syspld.h>
36
37#include "common.h"
38
39/*
40 * Map the P720T system PLD. It occupies two address spaces:
41 * SYSPLD_PHYS_BASE and SYSPLD_PHYS_BASE + 0x00400000
42 * We map both here.
43 */
44static struct map_desc p720t_io_desc[] __initdata = {
45 { SYSPLD_VIRT_BASE, SYSPLD_PHYS_BASE, 1048576, MT_DEVICE },
46 { 0xfe400000, 0x10400000, 1048576, MT_DEVICE }
47};
48
49static void __init
50fixup_p720t(struct machine_desc *desc, struct tag *tag,
51 char **cmdline, struct meminfo *mi)
52{
53 /*
54 * Our bootloader doesn't setup any tags (yet).
55 */
56 if (tag->hdr.tag != ATAG_CORE) {
57 tag->hdr.tag = ATAG_CORE;
58 tag->hdr.size = tag_size(tag_core);
59 tag->u.core.flags = 0;
60 tag->u.core.pagesize = PAGE_SIZE;
61 tag->u.core.rootdev = 0x0100;
62
63 tag = tag_next(tag);
64 tag->hdr.tag = ATAG_MEM;
65 tag->hdr.size = tag_size(tag_mem32);
66 tag->u.mem.size = 4096;
67 tag->u.mem.start = PHYS_OFFSET;
68
69 tag = tag_next(tag);
70 tag->hdr.tag = ATAG_NONE;
71 tag->hdr.size = 0;
72 }
73}
74
75static void __init p720t_map_io(void)
76{
77 clps711x_map_io();
78 iotable_init(p720t_io_desc, ARRAY_SIZE(p720t_io_desc));
79}
80
81MACHINE_START(P720T, "ARM-Prospector720T")
82 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd")
83 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
84 BOOT_PARAMS(0xc0000100)
85 FIXUP(fixup_p720t)
86 MAPIO(p720t_map_io)
87 INITIRQ(clps711x_init_irq)
88 .timer = &clps711x_timer,
89MACHINE_END
90
91static int p720t_hw_init(void)
92{
93 /*
94 * Power down as much as possible in case we don't
95 * have the drivers loaded.
96 */
97 PLD_LCDEN = 0;
98 PLD_PWR &= ~(PLD_S4_ON|PLD_S3_ON|PLD_S2_ON|PLD_S1_ON);
99
100 PLD_KBD = 0;
101 PLD_IO = 0;
102 PLD_IRDA = 0;
103 PLD_CODEC = 0;
104 PLD_TCH = 0;
105 PLD_SPI = 0;
106#ifndef CONFIG_DEBUG_LL
107 PLD_COM2 = 0;
108 PLD_COM1 = 0;
109#endif
110
111 return 0;
112}
113
114__initcall(p720t_hw_init);
115
diff --git a/arch/arm/mach-clps711x/time.c b/arch/arm/mach-clps711x/time.c
new file mode 100644
index 000000000000..383d4e0c6e35
--- /dev/null
+++ b/arch/arm/mach-clps711x/time.c
@@ -0,0 +1,85 @@
1/*
2 * linux/arch/arm/mach-clps711x/time.c
3 *
4 * Copyright (C) 2001 Deep Blue Solutions Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#include <linux/timex.h>
20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/sched.h>
23
24#include <asm/hardware.h>
25#include <asm/irq.h>
26#include <asm/leds.h>
27#include <asm/io.h>
28#include <asm/hardware/clps7111.h>
29
30#include <asm/mach/time.h>
31
32
33/*
34 * gettimeoffset() returns time since last timer tick, in usecs.
35 *
36 * 'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
37 * 'tick' is usecs per jiffy.
38 */
39static unsigned long clps711x_gettimeoffset(void)
40{
41 unsigned long hwticks;
42 hwticks = LATCH - (clps_readl(TC2D) & 0xffff); /* since last underflow */
43 return (hwticks * (tick_nsec / 1000)) / LATCH;
44}
45
46/*
47 * IRQ handler for the timer
48 */
49static irqreturn_t
50p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
51{
52 write_seqlock(&xtime_lock);
53 timer_tick(regs);
54 write_sequnlock(&xtime_lock);
55 return IRQ_HANDLED;
56}
57
58static struct irqaction clps711x_timer_irq = {
59 .name = "CLPS711x Timer Tick",
60 .flags = SA_INTERRUPT,
61 .handler = p720t_timer_interrupt
62};
63
64static void __init clps711x_timer_init(void)
65{
66 struct timespec tv;
67 unsigned int syscon;
68
69 syscon = clps_readl(SYSCON1);
70 syscon |= SYSCON1_TC2S | SYSCON1_TC2M;
71 clps_writel(syscon, SYSCON1);
72
73 clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */
74
75 setup_irq(IRQ_TC2OI, &clps711x_timer_irq);
76
77 tv.tv_nsec = 0;
78 tv.tv_sec = clps_readl(RTCDR);
79 do_settimeofday(&tv);
80}
81
82struct sys_timer clps711x_timer = {
83 .init = clps711x_timer_init,
84 .offset = clps711x_gettimeoffset,
85};
diff --git a/arch/arm/mach-clps7500/Makefile b/arch/arm/mach-clps7500/Makefile
new file mode 100644
index 000000000000..4bd8ebd70e7b
--- /dev/null
+++ b/arch/arm/mach-clps7500/Makefile
@@ -0,0 +1,11 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := core.o
8obj-m :=
9obj-n :=
10obj- :=
11
diff --git a/arch/arm/mach-clps7500/Makefile.boot b/arch/arm/mach-clps7500/Makefile.boot
new file mode 100644
index 000000000000..fe16506c1540
--- /dev/null
+++ b/arch/arm/mach-clps7500/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-y := 0x10008000
2
diff --git a/arch/arm/mach-clps7500/core.c b/arch/arm/mach-clps7500/core.c
new file mode 100644
index 000000000000..fdfededfd96f
--- /dev/null
+++ b/arch/arm/mach-clps7500/core.c
@@ -0,0 +1,374 @@
1/*
2 * linux/arch/arm/mach-clps7500/core.c
3 *
4 * Copyright (C) 1998 Russell King
5 * Copyright (C) 1999 Nexus Electronics Ltd
6 *
7 * Extra MM routines for CL7500 architecture
8 */
9#include <linux/kernel.h>
10#include <linux/types.h>
11#include <linux/interrupt.h>
12#include <linux/list.h>
13#include <linux/sched.h>
14#include <linux/init.h>
15#include <linux/device.h>
16#include <linux/serial_8250.h>
17
18#include <asm/mach/arch.h>
19#include <asm/mach/map.h>
20#include <asm/mach/irq.h>
21#include <asm/mach/time.h>
22
23#include <asm/hardware.h>
24#include <asm/hardware/iomd.h>
25#include <asm/io.h>
26#include <asm/irq.h>
27#include <asm/mach-types.h>
28
29static void cl7500_ack_irq_a(unsigned int irq)
30{
31 unsigned int val, mask;
32
33 mask = 1 << irq;
34 val = iomd_readb(IOMD_IRQMASKA);
35 iomd_writeb(val & ~mask, IOMD_IRQMASKA);
36 iomd_writeb(mask, IOMD_IRQCLRA);
37}
38
39static void cl7500_mask_irq_a(unsigned int irq)
40{
41 unsigned int val, mask;
42
43 mask = 1 << irq;
44 val = iomd_readb(IOMD_IRQMASKA);
45 iomd_writeb(val & ~mask, IOMD_IRQMASKA);
46}
47
48static void cl7500_unmask_irq_a(unsigned int irq)
49{
50 unsigned int val, mask;
51
52 mask = 1 << irq;
53 val = iomd_readb(IOMD_IRQMASKA);
54 iomd_writeb(val | mask, IOMD_IRQMASKA);
55}
56
57static struct irqchip clps7500_a_chip = {
58 .ack = cl7500_ack_irq_a,
59 .mask = cl7500_mask_irq_a,
60 .unmask = cl7500_unmask_irq_a,
61};
62
63static void cl7500_mask_irq_b(unsigned int irq)
64{
65 unsigned int val, mask;
66
67 mask = 1 << (irq & 7);
68 val = iomd_readb(IOMD_IRQMASKB);
69 iomd_writeb(val & ~mask, IOMD_IRQMASKB);
70}
71
72static void cl7500_unmask_irq_b(unsigned int irq)
73{
74 unsigned int val, mask;
75
76 mask = 1 << (irq & 7);
77 val = iomd_readb(IOMD_IRQMASKB);
78 iomd_writeb(val | mask, IOMD_IRQMASKB);
79}
80
81static struct irqchip clps7500_b_chip = {
82 .ack = cl7500_mask_irq_b,
83 .mask = cl7500_mask_irq_b,
84 .unmask = cl7500_unmask_irq_b,
85};
86
87static void cl7500_mask_irq_c(unsigned int irq)
88{
89 unsigned int val, mask;
90
91 mask = 1 << (irq & 7);
92 val = iomd_readb(IOMD_IRQMASKC);
93 iomd_writeb(val & ~mask, IOMD_IRQMASKC);
94}
95
96static void cl7500_unmask_irq_c(unsigned int irq)
97{
98 unsigned int val, mask;
99
100 mask = 1 << (irq & 7);
101 val = iomd_readb(IOMD_IRQMASKC);
102 iomd_writeb(val | mask, IOMD_IRQMASKC);
103}
104
105static struct irqchip clps7500_c_chip = {
106 .ack = cl7500_mask_irq_c,
107 .mask = cl7500_mask_irq_c,
108 .unmask = cl7500_unmask_irq_c,
109};
110
111static void cl7500_mask_irq_d(unsigned int irq)
112{
113 unsigned int val, mask;
114
115 mask = 1 << (irq & 7);
116 val = iomd_readb(IOMD_IRQMASKD);
117 iomd_writeb(val & ~mask, IOMD_IRQMASKD);
118}
119
120static void cl7500_unmask_irq_d(unsigned int irq)
121{
122 unsigned int val, mask;
123
124 mask = 1 << (irq & 7);
125 val = iomd_readb(IOMD_IRQMASKD);
126 iomd_writeb(val | mask, IOMD_IRQMASKD);
127}
128
129static struct irqchip clps7500_d_chip = {
130 .ack = cl7500_mask_irq_d,
131 .mask = cl7500_mask_irq_d,
132 .unmask = cl7500_unmask_irq_d,
133};
134
135static void cl7500_mask_irq_dma(unsigned int irq)
136{
137 unsigned int val, mask;
138
139 mask = 1 << (irq & 7);
140 val = iomd_readb(IOMD_DMAMASK);
141 iomd_writeb(val & ~mask, IOMD_DMAMASK);
142}
143
144static void cl7500_unmask_irq_dma(unsigned int irq)
145{
146 unsigned int val, mask;
147
148 mask = 1 << (irq & 7);
149 val = iomd_readb(IOMD_DMAMASK);
150 iomd_writeb(val | mask, IOMD_DMAMASK);
151}
152
153static struct irqchip clps7500_dma_chip = {
154 .ack = cl7500_mask_irq_dma,
155 .mask = cl7500_mask_irq_dma,
156 .unmask = cl7500_unmask_irq_dma,
157};
158
159static void cl7500_mask_irq_fiq(unsigned int irq)
160{
161 unsigned int val, mask;
162
163 mask = 1 << (irq & 7);
164 val = iomd_readb(IOMD_FIQMASK);
165 iomd_writeb(val & ~mask, IOMD_FIQMASK);
166}
167
168static void cl7500_unmask_irq_fiq(unsigned int irq)
169{
170 unsigned int val, mask;
171
172 mask = 1 << (irq & 7);
173 val = iomd_readb(IOMD_FIQMASK);
174 iomd_writeb(val | mask, IOMD_FIQMASK);
175}
176
177static struct irqchip clps7500_fiq_chip = {
178 .ack = cl7500_mask_irq_fiq,
179 .mask = cl7500_mask_irq_fiq,
180 .unmask = cl7500_unmask_irq_fiq,
181};
182
183static void cl7500_no_action(unsigned int irq)
184{
185}
186
187static struct irqchip clps7500_no_chip = {
188 .ack = cl7500_no_action,
189 .mask = cl7500_no_action,
190 .unmask = cl7500_no_action,
191};
192
193static struct irqaction irq_isa = { no_action, 0, CPU_MASK_NONE, "isa", NULL, NULL };
194
195static void __init clps7500_init_irq(void)
196{
197 unsigned int irq, flags;
198
199 iomd_writeb(0, IOMD_IRQMASKA);
200 iomd_writeb(0, IOMD_IRQMASKB);
201 iomd_writeb(0, IOMD_FIQMASK);
202 iomd_writeb(0, IOMD_DMAMASK);
203
204 for (irq = 0; irq < NR_IRQS; irq++) {
205 flags = IRQF_VALID;
206
207 if (irq <= 6 || (irq >= 9 && irq <= 15) ||
208 (irq >= 48 && irq <= 55))
209 flags |= IRQF_PROBE;
210
211 switch (irq) {
212 case 0 ... 7:
213 set_irq_chip(irq, &clps7500_a_chip);
214 set_irq_handler(irq, do_level_IRQ);
215 set_irq_flags(irq, flags);
216 break;
217
218 case 8 ... 15:
219 set_irq_chip(irq, &clps7500_b_chip);
220 set_irq_handler(irq, do_level_IRQ);
221 set_irq_flags(irq, flags);
222 break;
223
224 case 16 ... 22:
225 set_irq_chip(irq, &clps7500_dma_chip);
226 set_irq_handler(irq, do_level_IRQ);
227 set_irq_flags(irq, flags);
228 break;
229
230 case 24 ... 31:
231 set_irq_chip(irq, &clps7500_c_chip);
232 set_irq_handler(irq, do_level_IRQ);
233 set_irq_flags(irq, flags);
234 break;
235
236 case 40 ... 47:
237 set_irq_chip(irq, &clps7500_d_chip);
238 set_irq_handler(irq, do_level_IRQ);
239 set_irq_flags(irq, flags);
240 break;
241
242 case 48 ... 55:
243 set_irq_chip(irq, &clps7500_no_chip);
244 set_irq_handler(irq, do_level_IRQ);
245 set_irq_flags(irq, flags);
246 break;
247
248 case 64 ... 72:
249 set_irq_chip(irq, &clps7500_fiq_chip);
250 set_irq_handler(irq, do_level_IRQ);
251 set_irq_flags(irq, flags);
252 break;
253 }
254 }
255
256 setup_irq(IRQ_ISA, &irq_isa);
257}
258
259static struct map_desc cl7500_io_desc[] __initdata = {
260 { IO_BASE, IO_START, IO_SIZE, MT_DEVICE }, /* IO space */
261 { ISA_BASE, ISA_START, ISA_SIZE, MT_DEVICE }, /* ISA space */
262 { FLASH_BASE, FLASH_START, FLASH_SIZE, MT_DEVICE }, /* Flash */
263 { LED_BASE, LED_START, LED_SIZE, MT_DEVICE } /* LED */
264};
265
266static void __init clps7500_map_io(void)
267{
268 iotable_init(cl7500_io_desc, ARRAY_SIZE(cl7500_io_desc));
269}
270
271extern void ioctime_init(void);
272extern unsigned long ioc_timer_gettimeoffset(void);
273
274static irqreturn_t
275clps7500_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
276{
277 write_seqlock(&xtime_lock);
278
279 timer_tick(regs);
280
281 /* Why not using do_leds interface?? */
282 {
283 /* Twinkle the lights. */
284 static int count, state = 0xff00;
285 if (count-- == 0) {
286 state ^= 0x100;
287 count = 25;
288 *((volatile unsigned int *)LED_ADDRESS) = state;
289 }
290 }
291
292 write_sequnlock(&xtime_lock);
293
294 return IRQ_HANDLED;
295}
296
297static struct irqaction clps7500_timer_irq = {
298 .name = "CLPS7500 Timer Tick",
299 .flags = SA_INTERRUPT,
300 .handler = clps7500_timer_interrupt
301};
302
303/*
304 * Set up timer interrupt.
305 */
306static void __init clps7500_timer_init(void)
307{
308 ioctime_init();
309 setup_irq(IRQ_TIMER, &clps7500_timer_irq);
310}
311
312static struct sys_timer clps7500_timer = {
313 .init = clps7500_timer_init,
314 .offset = ioc_timer_gettimeoffset,
315};
316
317static struct plat_serial8250_port serial_platform_data[] = {
318 {
319 .mapbase = 0x03010fe0,
320 .irq = 10,
321 .uartclk = 1843200,
322 .regshift = 2,
323 .iotype = UPIO_MEM,
324 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
325 },
326 {
327 .mapbase = 0x03010be0,
328 .irq = 0,
329 .uartclk = 1843200,
330 .regshift = 2,
331 .iotype = UPIO_MEM,
332 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
333 },
334 {
335 .iobase = ISASLOT_IO + 0x2e8,
336 .irq = 41,
337 .uartclk = 1843200,
338 .regshift = 0,
339 .iotype = UPIO_PORT,
340 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
341 },
342 {
343 .iobase = ISASLOT_IO + 0x3e8,
344 .irq = 40,
345 .uartclk = 1843200,
346 .regshift = 0,
347 .iotype = UPIO_PORT,
348 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
349 },
350 { },
351};
352
353static struct platform_device serial_device = {
354 .name = "serial8250",
355 .id = 0,
356 .dev = {
357 .platform_data = serial_platform_data,
358 },
359};
360
361static void __init clps7500_init(void)
362{
363 platform_device_register(&serial_device);
364}
365
366MACHINE_START(CLPS7500, "CL-PS7500")
367 MAINTAINER("Philip Blundell")
368 BOOT_MEM(0x10000000, 0x03000000, 0xe0000000)
369 MAPIO(clps7500_map_io)
370 INITIRQ(clps7500_init_irq)
371 .init_machine = clps7500_init,
372 .timer = &clps7500_timer,
373MACHINE_END
374
diff --git a/arch/arm/mach-ebsa110/Makefile b/arch/arm/mach-ebsa110/Makefile
new file mode 100644
index 000000000000..6520ac835802
--- /dev/null
+++ b/arch/arm/mach-ebsa110/Makefile
@@ -0,0 +1,12 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := core.o io.o
8obj-m :=
9obj-n :=
10obj- :=
11
12obj-$(CONFIG_LEDS) += leds.o
diff --git a/arch/arm/mach-ebsa110/Makefile.boot b/arch/arm/mach-ebsa110/Makefile.boot
new file mode 100644
index 000000000000..232126044935
--- /dev/null
+++ b/arch/arm/mach-ebsa110/Makefile.boot
@@ -0,0 +1,4 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000400
3initrd_phys-y := 0x00800000
4
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c
new file mode 100644
index 000000000000..ef362d44949d
--- /dev/null
+++ b/arch/arm/mach-ebsa110/core.c
@@ -0,0 +1,245 @@
1/*
2 * linux/arch/arm/mach-ebsa110/core.c
3 *
4 * Copyright (C) 1998-2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Extra MM routines for the EBSA-110 architecture
11 */
12#include <linux/kernel.h>
13#include <linux/mm.h>
14#include <linux/interrupt.h>
15#include <linux/serial_8250.h>
16#include <linux/init.h>
17
18#include <asm/hardware.h>
19#include <asm/irq.h>
20#include <asm/io.h>
21#include <asm/setup.h>
22#include <asm/mach-types.h>
23#include <asm/pgtable.h>
24#include <asm/page.h>
25#include <asm/system.h>
26
27#include <asm/mach/arch.h>
28#include <asm/mach/irq.h>
29#include <asm/mach/map.h>
30
31#include <asm/mach/time.h>
32
33#define IRQ_MASK 0xfe000000 /* read */
34#define IRQ_MSET 0xfe000000 /* write */
35#define IRQ_STAT 0xff000000 /* read */
36#define IRQ_MCLR 0xff000000 /* write */
37
38static void ebsa110_mask_irq(unsigned int irq)
39{
40 __raw_writeb(1 << irq, IRQ_MCLR);
41}
42
43static void ebsa110_unmask_irq(unsigned int irq)
44{
45 __raw_writeb(1 << irq, IRQ_MSET);
46}
47
48static struct irqchip ebsa110_irq_chip = {
49 .ack = ebsa110_mask_irq,
50 .mask = ebsa110_mask_irq,
51 .unmask = ebsa110_unmask_irq,
52};
53
54static void __init ebsa110_init_irq(void)
55{
56 unsigned long flags;
57 unsigned int irq;
58
59 local_irq_save(flags);
60 __raw_writeb(0xff, IRQ_MCLR);
61 __raw_writeb(0x55, IRQ_MSET);
62 __raw_writeb(0x00, IRQ_MSET);
63 if (__raw_readb(IRQ_MASK) != 0x55)
64 while (1);
65 __raw_writeb(0xff, IRQ_MCLR); /* clear all interrupt enables */
66 local_irq_restore(flags);
67
68 for (irq = 0; irq < NR_IRQS; irq++) {
69 set_irq_chip(irq, &ebsa110_irq_chip);
70 set_irq_handler(irq, do_level_IRQ);
71 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
72 }
73}
74
75static struct map_desc ebsa110_io_desc[] __initdata = {
76 /*
77 * sparse external-decode ISAIO space
78 */
79 { IRQ_STAT, TRICK4_PHYS, PGDIR_SIZE, MT_DEVICE }, /* IRQ_STAT/IRQ_MCLR */
80 { IRQ_MASK, TRICK3_PHYS, PGDIR_SIZE, MT_DEVICE }, /* IRQ_MASK/IRQ_MSET */
81 { SOFT_BASE, TRICK1_PHYS, PGDIR_SIZE, MT_DEVICE }, /* SOFT_BASE */
82 { PIT_BASE, TRICK0_PHYS, PGDIR_SIZE, MT_DEVICE }, /* PIT_BASE */
83
84 /*
85 * self-decode ISAIO space
86 */
87 { ISAIO_BASE, ISAIO_PHYS, ISAIO_SIZE, MT_DEVICE },
88 { ISAMEM_BASE, ISAMEM_PHYS, ISAMEM_SIZE, MT_DEVICE }
89};
90
91static void __init ebsa110_map_io(void)
92{
93 iotable_init(ebsa110_io_desc, ARRAY_SIZE(ebsa110_io_desc));
94}
95
96
97#define PIT_CTRL (PIT_BASE + 0x0d)
98#define PIT_T2 (PIT_BASE + 0x09)
99#define PIT_T1 (PIT_BASE + 0x05)
100#define PIT_T0 (PIT_BASE + 0x01)
101
102/*
103 * This is the rate at which your MCLK signal toggles (in Hz)
104 * This was measured on a 10 digit frequency counter sampling
105 * over 1 second.
106 */
107#define MCLK 47894000
108
109/*
110 * This is the rate at which the PIT timers get clocked
111 */
112#define CLKBY7 (MCLK / 7)
113
114/*
115 * This is the counter value. We tick at 200Hz on this platform.
116 */
117#define COUNT ((CLKBY7 + (HZ / 2)) / HZ)
118
119/*
120 * Get the time offset from the system PIT. Note that if we have missed an
121 * interrupt, then the PIT counter will roll over (ie, be negative).
122 * This actually works out to be convenient.
123 */
124static unsigned long ebsa110_gettimeoffset(void)
125{
126 unsigned long offset, count;
127
128 __raw_writeb(0x40, PIT_CTRL);
129 count = __raw_readb(PIT_T1);
130 count |= __raw_readb(PIT_T1) << 8;
131
132 /*
133 * If count > COUNT, make the number negative.
134 */
135 if (count > COUNT)
136 count |= 0xffff0000;
137
138 offset = COUNT;
139 offset -= count;
140
141 /*
142 * `offset' is in units of timer counts. Convert
143 * offset to units of microseconds.
144 */
145 offset = offset * (1000000 / HZ) / COUNT;
146
147 return offset;
148}
149
150static irqreturn_t
151ebsa110_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
152{
153 u32 count;
154
155 write_seqlock(&xtime_lock);
156
157 /* latch and read timer 1 */
158 __raw_writeb(0x40, PIT_CTRL);
159 count = __raw_readb(PIT_T1);
160 count |= __raw_readb(PIT_T1) << 8;
161
162 count += COUNT;
163
164 __raw_writeb(count & 0xff, PIT_T1);
165 __raw_writeb(count >> 8, PIT_T1);
166
167 timer_tick(regs);
168
169 write_sequnlock(&xtime_lock);
170
171 return IRQ_HANDLED;
172}
173
174static struct irqaction ebsa110_timer_irq = {
175 .name = "EBSA110 Timer Tick",
176 .flags = SA_INTERRUPT,
177 .handler = ebsa110_timer_interrupt
178};
179
180/*
181 * Set up timer interrupt.
182 */
183static void __init ebsa110_timer_init(void)
184{
185 /*
186 * Timer 1, mode 2, LSB/MSB
187 */
188 __raw_writeb(0x70, PIT_CTRL);
189 __raw_writeb(COUNT & 0xff, PIT_T1);
190 __raw_writeb(COUNT >> 8, PIT_T1);
191
192 setup_irq(IRQ_EBSA110_TIMER0, &ebsa110_timer_irq);
193}
194
195static struct sys_timer ebsa110_timer = {
196 .init = ebsa110_timer_init,
197 .offset = ebsa110_gettimeoffset,
198};
199
200static struct plat_serial8250_port serial_platform_data[] = {
201 {
202 .iobase = 0x3f8,
203 .irq = 1,
204 .uartclk = 1843200,
205 .regshift = 0,
206 .iotype = UPIO_PORT,
207 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
208 },
209 {
210 .iobase = 0x2f8,
211 .irq = 2,
212 .uartclk = 1843200,
213 .regshift = 0,
214 .iotype = UPIO_PORT,
215 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
216 },
217 { },
218};
219
220static struct platform_device serial_device = {
221 .name = "serial8250",
222 .id = 0,
223 .dev = {
224 .platform_data = serial_platform_data,
225 },
226};
227
228static int __init ebsa110_init(void)
229{
230 return platform_device_register(&serial_device);
231}
232
233arch_initcall(ebsa110_init);
234
235MACHINE_START(EBSA110, "EBSA110")
236 MAINTAINER("Russell King")
237 BOOT_MEM(0x00000000, 0xe0000000, 0xe0000000)
238 BOOT_PARAMS(0x00000400)
239 DISABLE_PARPORT(0)
240 DISABLE_PARPORT(2)
241 SOFT_REBOOT
242 MAPIO(ebsa110_map_io)
243 INITIRQ(ebsa110_init_irq)
244 .timer = &ebsa110_timer,
245MACHINE_END
diff --git a/arch/arm/mach-ebsa110/io.c b/arch/arm/mach-ebsa110/io.c
new file mode 100644
index 000000000000..ef7eb5dc91bd
--- /dev/null
+++ b/arch/arm/mach-ebsa110/io.c
@@ -0,0 +1,378 @@
1/*
2 * linux/arch/arm/mach-ebsa110/isamem.c
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * Perform "ISA" memory and IO accesses. The EBSA110 has some "peculiarities"
7 * in the way it handles accesses to odd IO ports on 16-bit devices. These
8 * devices have their D0-D15 lines connected to the processors D0-D15 lines.
9 * Since they expect all byte IO operations to be performed on D0-D7, and the
10 * StrongARM expects to transfer the byte to these odd addresses on D8-D15,
11 * we must use a trick to get the required behaviour.
12 *
13 * The trick employed here is to use long word stores to odd address -1. The
14 * glue logic picks this up as a "trick" access, and asserts the LSB of the
15 * peripherals address bus, thereby accessing the odd IO port. Meanwhile, the
16 * StrongARM transfers its data on D0-D7 as expected.
17 *
18 * Things get more interesting on the pass-1 EBSA110 - the PCMCIA controller
19 * wiring was screwed in such a way that it had limited memory space access.
20 * Luckily, the work-around for this is not too horrible. See
21 * __isamem_convert_addr for the details.
22 */
23#include <linux/module.h>
24#include <linux/kernel.h>
25#include <linux/types.h>
26
27#include <asm/io.h>
28#include <asm/page.h>
29
30static void __iomem *__isamem_convert_addr(void __iomem *addr)
31{
32 u32 ret, a = (u32 __force) addr;
33
34 /*
35 * The PCMCIA controller is wired up as follows:
36 * +---------+---------+---------+---------+---------+---------+
37 * PCMCIA | 2 2 2 2 | 1 1 1 1 | 1 1 1 1 | 1 1 | | |
38 * | 3 2 1 0 | 9 8 7 6 | 5 4 3 2 | 1 0 9 8 | 7 6 5 4 | 3 2 1 0 |
39 * +---------+---------+---------+---------+---------+---------+
40 * CPU | 2 2 2 2 | 2 1 1 1 | 1 1 1 1 | 1 1 1 | | |
41 * | 4 3 2 1 | 0 9 9 8 | 7 6 5 4 | 3 2 0 9 | 8 7 6 5 | 4 3 2 x |
42 * +---------+---------+---------+---------+---------+---------+
43 *
44 * This means that we can access PCMCIA regions as follows:
45 * 0x*10000 -> 0x*1ffff
46 * 0x*70000 -> 0x*7ffff
47 * 0x*90000 -> 0x*9ffff
48 * 0x*f0000 -> 0x*fffff
49 */
50 ret = (a & 0xf803fe) << 1;
51 ret |= (a & 0x03fc00) << 2;
52
53 ret += 0xe8000000;
54
55 if ((a & 0x20000) == (a & 0x40000) >> 1)
56 return (void __iomem *)ret;
57
58 BUG();
59 return NULL;
60}
61
62/*
63 * read[bwl] and write[bwl]
64 */
65u8 __readb(void __iomem *addr)
66{
67 void __iomem *a = __isamem_convert_addr(addr);
68 u32 ret;
69
70 if ((unsigned long)addr & 1)
71 ret = __raw_readl(a);
72 else
73 ret = __raw_readb(a);
74 return ret;
75}
76
77u16 __readw(void __iomem *addr)
78{
79 void __iomem *a = __isamem_convert_addr(addr);
80
81 if ((unsigned long)addr & 1)
82 BUG();
83
84 return __raw_readw(a);
85}
86
87u32 __readl(void __iomem *addr)
88{
89 void __iomem *a = __isamem_convert_addr(addr);
90 u32 ret;
91
92 if ((unsigned long)addr & 3)
93 BUG();
94
95 ret = __raw_readw(a);
96 ret |= __raw_readw(a + 4) << 16;
97 return ret;
98}
99
100EXPORT_SYMBOL(__readb);
101EXPORT_SYMBOL(__readw);
102EXPORT_SYMBOL(__readl);
103
104void __writeb(u8 val, void __iomem *addr)
105{
106 void __iomem *a = __isamem_convert_addr(addr);
107
108 if ((unsigned long)addr & 1)
109 __raw_writel(val, a);
110 else
111 __raw_writeb(val, a);
112}
113
114void __writew(u16 val, void __iomem *addr)
115{
116 void __iomem *a = __isamem_convert_addr(addr);
117
118 if ((unsigned long)addr & 1)
119 BUG();
120
121 __raw_writew(val, a);
122}
123
124void __writel(u32 val, void __iomem *addr)
125{
126 void __iomem *a = __isamem_convert_addr(addr);
127
128 if ((unsigned long)addr & 3)
129 BUG();
130
131 __raw_writew(val, a);
132 __raw_writew(val >> 16, a + 4);
133}
134
135EXPORT_SYMBOL(__writeb);
136EXPORT_SYMBOL(__writew);
137EXPORT_SYMBOL(__writel);
138
139#define SUPERIO_PORT(p) \
140 (((p) >> 3) == (0x3f8 >> 3) || \
141 ((p) >> 3) == (0x2f8 >> 3) || \
142 ((p) >> 3) == (0x378 >> 3))
143
144/*
145 * We're addressing an 8 or 16-bit peripheral which tranfers
146 * odd addresses on the low ISA byte lane.
147 */
148u8 __inb8(unsigned int port)
149{
150 u32 ret;
151
152 /*
153 * The SuperIO registers use sane addressing techniques...
154 */
155 if (SUPERIO_PORT(port))
156 ret = __raw_readb((void __iomem *)ISAIO_BASE + (port << 2));
157 else {
158 void __iomem *a = (void __iomem *)ISAIO_BASE + ((port & ~1) << 1);
159
160 /*
161 * Shame nothing else does
162 */
163 if (port & 1)
164 ret = __raw_readl(a);
165 else
166 ret = __raw_readb(a);
167 }
168 return ret;
169}
170
171/*
172 * We're addressing a 16-bit peripheral which transfers odd
173 * addresses on the high ISA byte lane.
174 */
175u8 __inb16(unsigned int port)
176{
177 unsigned int offset;
178
179 /*
180 * The SuperIO registers use sane addressing techniques...
181 */
182 if (SUPERIO_PORT(port))
183 offset = port << 2;
184 else
185 offset = (port & ~1) << 1 | (port & 1);
186
187 return __raw_readb((void __iomem *)ISAIO_BASE + offset);
188}
189
190u16 __inw(unsigned int port)
191{
192 unsigned int offset;
193
194 /*
195 * The SuperIO registers use sane addressing techniques...
196 */
197 if (SUPERIO_PORT(port))
198 offset = port << 2;
199 else {
200 offset = port << 1;
201 BUG_ON(port & 1);
202 }
203 return __raw_readw((void __iomem *)ISAIO_BASE + offset);
204}
205
206/*
207 * Fake a 32-bit read with two 16-bit reads. Needed for 3c589.
208 */
209u32 __inl(unsigned int port)
210{
211 void __iomem *a;
212
213 if (SUPERIO_PORT(port) || port & 3)
214 BUG();
215
216 a = (void __iomem *)ISAIO_BASE + ((port & ~1) << 1);
217
218 return __raw_readw(a) | __raw_readw(a + 4) << 16;
219}
220
221EXPORT_SYMBOL(__inb8);
222EXPORT_SYMBOL(__inb16);
223EXPORT_SYMBOL(__inw);
224EXPORT_SYMBOL(__inl);
225
226void __outb8(u8 val, unsigned int port)
227{
228 /*
229 * The SuperIO registers use sane addressing techniques...
230 */
231 if (SUPERIO_PORT(port))
232 __raw_writeb(val, (void __iomem *)ISAIO_BASE + (port << 2));
233 else {
234 void __iomem *a = (void __iomem *)ISAIO_BASE + ((port & ~1) << 1);
235
236 /*
237 * Shame nothing else does
238 */
239 if (port & 1)
240 __raw_writel(val, a);
241 else
242 __raw_writeb(val, a);
243 }
244}
245
246void __outb16(u8 val, unsigned int port)
247{
248 unsigned int offset;
249
250 /*
251 * The SuperIO registers use sane addressing techniques...
252 */
253 if (SUPERIO_PORT(port))
254 offset = port << 2;
255 else
256 offset = (port & ~1) << 1 | (port & 1);
257
258 __raw_writeb(val, (void __iomem *)ISAIO_BASE + offset);
259}
260
261void __outw(u16 val, unsigned int port)
262{
263 unsigned int offset;
264
265 /*
266 * The SuperIO registers use sane addressing techniques...
267 */
268 if (SUPERIO_PORT(port))
269 offset = port << 2;
270 else {
271 offset = port << 1;
272 BUG_ON(port & 1);
273 }
274 __raw_writew(val, (void __iomem *)ISAIO_BASE + offset);
275}
276
277void __outl(u32 val, unsigned int port)
278{
279 BUG();
280}
281
282EXPORT_SYMBOL(__outb8);
283EXPORT_SYMBOL(__outb16);
284EXPORT_SYMBOL(__outw);
285EXPORT_SYMBOL(__outl);
286
287void outsb(unsigned int port, const void *from, int len)
288{
289 u32 off;
290
291 if (SUPERIO_PORT(port))
292 off = port << 2;
293 else {
294 off = (port & ~1) << 1;
295 if (port & 1)
296 BUG();
297 }
298
299 __raw_writesb((void __iomem *)ISAIO_BASE + off, from, len);
300}
301
302void insb(unsigned int port, void *from, int len)
303{
304 u32 off;
305
306 if (SUPERIO_PORT(port))
307 off = port << 2;
308 else {
309 off = (port & ~1) << 1;
310 if (port & 1)
311 BUG();
312 }
313
314 __raw_readsb((void __iomem *)ISAIO_BASE + off, from, len);
315}
316
317EXPORT_SYMBOL(outsb);
318EXPORT_SYMBOL(insb);
319
320void outsw(unsigned int port, const void *from, int len)
321{
322 u32 off;
323
324 if (SUPERIO_PORT(port))
325 off = port << 2;
326 else {
327 off = (port & ~1) << 1;
328 if (port & 1)
329 BUG();
330 }
331
332 __raw_writesw((void __iomem *)ISAIO_BASE + off, from, len);
333}
334
335void insw(unsigned int port, void *from, int len)
336{
337 u32 off;
338
339 if (SUPERIO_PORT(port))
340 off = port << 2;
341 else {
342 off = (port & ~1) << 1;
343 if (port & 1)
344 BUG();
345 }
346
347 __raw_readsw((void __iomem *)ISAIO_BASE + off, from, len);
348}
349
350EXPORT_SYMBOL(outsw);
351EXPORT_SYMBOL(insw);
352
353/*
354 * We implement these as 16-bit insw/outsw, mainly for
355 * 3c589 cards.
356 */
357void outsl(unsigned int port, const void *from, int len)
358{
359 u32 off = port << 1;
360
361 if (SUPERIO_PORT(port) || port & 3)
362 BUG();
363
364 __raw_writesw((void __iomem *)ISAIO_BASE + off, from, len << 1);
365}
366
367void insl(unsigned int port, void *from, int len)
368{
369 u32 off = port << 1;
370
371 if (SUPERIO_PORT(port) || port & 3)
372 BUG();
373
374 __raw_readsw((void __iomem *)ISAIO_BASE + off, from, len << 1);
375}
376
377EXPORT_SYMBOL(outsl);
378EXPORT_SYMBOL(insl);
diff --git a/arch/arm/mach-ebsa110/leds.c b/arch/arm/mach-ebsa110/leds.c
new file mode 100644
index 000000000000..3bc8c5e708e6
--- /dev/null
+++ b/arch/arm/mach-ebsa110/leds.c
@@ -0,0 +1,51 @@
1/*
2 * linux/arch/arm/mach-ebsa110/leds.c
3 *
4 * Copyright (C) 1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * EBSA-110 LED control routines. We use the led as follows:
11 *
12 * - Red - toggles state every 50 timer interrupts
13 */
14#include <linux/module.h>
15#include <linux/spinlock.h>
16#include <linux/init.h>
17
18#include <asm/hardware.h>
19#include <asm/leds.h>
20#include <asm/system.h>
21#include <asm/mach-types.h>
22
23static spinlock_t leds_lock;
24
25static void ebsa110_leds_event(led_event_t ledevt)
26{
27 unsigned long flags;
28
29 spin_lock_irqsave(&leds_lock, flags);
30
31 switch(ledevt) {
32 case led_timer:
33 *(volatile unsigned char *)SOFT_BASE ^= 128;
34 break;
35
36 default:
37 break;
38 }
39
40 spin_unlock_irqrestore(&leds_lock, flags);
41}
42
43static int __init leds_init(void)
44{
45 if (machine_is_ebsa110())
46 leds_event = ebsa110_leds_event;
47
48 return 0;
49}
50
51__initcall(leds_init);
diff --git a/arch/arm/mach-epxa10db/Kconfig b/arch/arm/mach-epxa10db/Kconfig
new file mode 100644
index 000000000000..55d896dd4950
--- /dev/null
+++ b/arch/arm/mach-epxa10db/Kconfig
@@ -0,0 +1,23 @@
1if ARCH_CAMELOT
2
3menu "Epxa10db"
4
5comment "PLD hotswap support"
6
7config PLD
8 bool
9 default y
10
11config PLD_HOTSWAP
12 bool "Support for PLD device hotplugging (experimental)"
13 depends on EXPERIMENTAL
14 help
15 This enables support for the dynamic loading and configuration of
16 compatible drivers when the contents of the PLD are changed. This
17 is still experimental and requires configuration tools which are
18 not yet generally available. Say N here. You must enable the kernel
19 module loader for this feature to work.
20
21endmenu
22
23endif
diff --git a/arch/arm/mach-epxa10db/Makefile b/arch/arm/mach-epxa10db/Makefile
new file mode 100644
index 000000000000..24fbd7d3a3c1
--- /dev/null
+++ b/arch/arm/mach-epxa10db/Makefile
@@ -0,0 +1,11 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := arch.o irq.o mm.o time.o
8obj-m :=
9obj-n :=
10obj- :=
11
diff --git a/arch/arm/mach-epxa10db/Makefile.boot b/arch/arm/mach-epxa10db/Makefile.boot
new file mode 100644
index 000000000000..28bec7d3fc88
--- /dev/null
+++ b/arch/arm/mach-epxa10db/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-y := 0x00008000
2
diff --git a/arch/arm/mach-epxa10db/arch.c b/arch/arm/mach-epxa10db/arch.c
new file mode 100644
index 000000000000..1b40340e8a21
--- /dev/null
+++ b/arch/arm/mach-epxa10db/arch.c
@@ -0,0 +1,72 @@
1/*
2 * linux/arch/arm/mach-epxa10db/arch.c
3 *
4 * Copyright (C) 2000 Deep Blue Solutions Ltd
5 * Copyright (C) 2001 Altera Corporation
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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#include <linux/types.h>
22#include <linux/init.h>
23#include <linux/serial_8250.h>
24
25#include <asm/hardware.h>
26#include <asm/setup.h>
27#include <asm/mach-types.h>
28
29#include <asm/mach/arch.h>
30
31static struct plat_serial8250_port serial_platform_data[] = {
32 {
33 .iobase = 0x3f8,
34 .irq = IRQ_UARTINT0,
35#error FIXME
36 .uartclk = 0,
37 .regshift = 0,
38 .iotype = UPIO_PORT,
39 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
40 },
41 {
42 .iobase = 0x2f8,
43 .irq = IRQ_UARTINT1,
44#error FIXME
45 .uartclk = 0,
46 .regshift = 0,
47 .iotype = UPIO_PORT,
48 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
49 },
50 { },
51};
52
53static struct platform_device serial_device = {
54 .name = "serial8250",
55 .id = 0,
56 .dev = {
57 .platform_data = serial_platform_data,
58 },
59};
60
61extern void epxa10db_map_io(void);
62extern void epxa10db_init_irq(void);
63extern struct sys_timer epxa10db_timer;
64
65MACHINE_START(CAMELOT, "Altera Epxa10db")
66 MAINTAINER("Altera Corporation")
67 BOOT_MEM(0x00000000, 0x7fffc000, 0xffffc000)
68 MAPIO(epxa10db_map_io)
69 INITIRQ(epxa10db_init_irq)
70 .timer = &epxa10db_timer,
71MACHINE_END
72
diff --git a/arch/arm/mach-epxa10db/dma.c b/arch/arm/mach-epxa10db/dma.c
new file mode 100644
index 000000000000..0151e9f1c066
--- /dev/null
+++ b/arch/arm/mach-epxa10db/dma.c
@@ -0,0 +1,28 @@
1/*
2 * linux/arch/arm/mach-epxa10db/dma.c
3 *
4 * Copyright (C) 1999 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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#include <linux/init.h>
22
23#include <asm/dma.h>
24#include <asm/mach/dma.h>
25
26void __init arch_dma_init(dma_t *dma)
27{
28}
diff --git a/arch/arm/mach-epxa10db/irq.c b/arch/arm/mach-epxa10db/irq.c
new file mode 100644
index 000000000000..9bf927e13309
--- /dev/null
+++ b/arch/arm/mach-epxa10db/irq.c
@@ -0,0 +1,82 @@
1/*
2 * linux/arch/arm/mach-epxa10db/irq.c
3 *
4 * Copyright (C) 2001 Altera Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/init.h>
21#include <linux/ioport.h>
22#include <linux/stddef.h>
23#include <linux/timer.h>
24#include <linux/list.h>
25#include <asm/io.h>
26#include <asm/hardware.h>
27#include <asm/irq.h>
28#include <asm/mach/irq.h>
29#include <asm/arch/platform.h>
30#include <asm/arch/int_ctrl00.h>
31
32
33static void epxa_mask_irq(unsigned int irq)
34{
35 writel(1 << irq, INT_MC(IO_ADDRESS(EXC_INT_CTRL00_BASE)));
36}
37
38static void epxa_unmask_irq(unsigned int irq)
39{
40 writel(1 << irq, INT_MS(IO_ADDRESS(EXC_INT_CTRL00_BASE)));
41}
42
43
44static struct irqchip epxa_irq_chip = {
45 .ack = epxa_mask_irq,
46 .mask = epxa_mask_irq,
47 .unmask = epxa_unmask_irq,
48};
49
50static struct resource irq_resource = {
51 .name = "irq_handler",
52 .start = IO_ADDRESS(EXC_INT_CTRL00_BASE),
53 .end = IO_ADDRESS(INT_PRIORITY_FC(EXC_INT_CTRL00_BASE))+4,
54};
55
56void __init epxa10db_init_irq(void)
57{
58 unsigned int i;
59
60 request_resource(&iomem_resource, &irq_resource);
61
62 /*
63 * This bit sets up the interrupt controller using
64 * the 6 PLD interrupts mode (the default) each
65 * irqs is assigned a priority which is the same
66 * as its interrupt number. This scheme is used because
67 * its easy, but you may want to change it depending
68 * on the contents of your PLD
69 */
70
71 writel(3,INT_MODE(IO_ADDRESS(EXC_INT_CTRL00_BASE)));
72 for (i = 0; i < NR_IRQS; i++){
73 writel(i+1, INT_PRIORITY_P0(IO_ADDRESS(EXC_INT_CTRL00_BASE)) + (4*i));
74 set_irq_chip(i,&epxa_irq_chip);
75 set_irq_handler(i,do_level_IRQ);
76 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
77 }
78
79 /* Disable all interrupts */
80 writel(-1,INT_MC(IO_ADDRESS(EXC_INT_CTRL00_BASE)));
81
82}
diff --git a/arch/arm/mach-epxa10db/mm.c b/arch/arm/mach-epxa10db/mm.c
new file mode 100644
index 000000000000..2aa57fa46da3
--- /dev/null
+++ b/arch/arm/mach-epxa10db/mm.c
@@ -0,0 +1,45 @@
1/*
2 * linux/arch/arm/mach-epxa10db/mm.c
3 *
4 * MM routines for Altera'a Epxa10db board
5 *
6 * Copyright (C) 2001 Altera Corporation
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#include <linux/kernel.h>
23#include <linux/init.h>
24
25#include <asm/hardware.h>
26#include <asm/io.h>
27#include <asm/sizes.h>
28
29#include <asm/mach/map.h>
30
31/* Page table mapping for I/O region */
32
33static struct map_desc epxa10db_io_desc[] __initdata = {
34 { IO_ADDRESS(EXC_REGISTERS_BASE), EXC_REGISTERS_BASE, SZ_16K, MT_DEVICE },
35 { IO_ADDRESS(EXC_PLD_BLOCK0_BASE), EXC_PLD_BLOCK0_BASE, SZ_16K, MT_DEVICE },
36 { IO_ADDRESS(EXC_PLD_BLOCK1_BASE), EXC_PLD_BLOCK1_BASE, SZ_16K, MT_DEVICE },
37 { IO_ADDRESS(EXC_PLD_BLOCK2_BASE), EXC_PLD_BLOCK2_BASE, SZ_16K, MT_DEVICE },
38 { IO_ADDRESS(EXC_PLD_BLOCK3_BASE), EXC_PLD_BLOCK3_BASE, SZ_16K, MT_DEVICE },
39 { FLASH_VADDR(EXC_EBI_BLOCK0_BASE), EXC_EBI_BLOCK0_BASE, SZ_16M, MT_DEVICE }
40};
41
42void __init epxa10db_map_io(void)
43{
44 iotable_init(epxa10db_io_desc, ARRAY_SIZE(epxa10db_io_desc));
45}
diff --git a/arch/arm/mach-epxa10db/time.c b/arch/arm/mach-epxa10db/time.c
new file mode 100644
index 000000000000..1b991f3cc3c6
--- /dev/null
+++ b/arch/arm/mach-epxa10db/time.c
@@ -0,0 +1,78 @@
1/*
2 * linux/arch/arm/mach-epxa10db/time.c
3 *
4 * Copyright (C) 2000 Deep Blue Solutions
5 * Copyright (C) 2001 Altera Corporation
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/interrupt.h>
14#include <linux/sched.h>
15
16#include <asm/hardware.h>
17#include <asm/system.h>
18#include <asm/leds.h>
19
20#include <asm/mach/time.h>
21
22#define TIMER00_TYPE (volatile unsigned int*)
23#include <asm/arch/timer00.h>
24
25static int epxa10db_set_rtc(void)
26{
27 return 1;
28}
29
30static int epxa10db_rtc_init(void)
31{
32 set_rtc = epxa10db_set_rtc;
33
34 return 0;
35}
36
37__initcall(epxa10db_rtc_init);
38
39
40/*
41 * IRQ handler for the timer
42 */
43static irqreturn_t
44epxa10db_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
45{
46 write_seqlock(&xtime_lock);
47
48 // ...clear the interrupt
49 *TIMER0_CR(IO_ADDRESS(EXC_TIMER00_BASE))|=TIMER0_CR_CI_MSK;
50
51 timer_tick(regs);
52 write_sequnlock(&xtime_lock);
53
54 return IRQ_HANDLED;
55}
56
57static struct irqaction epxa10db_timer_irq = {
58 .name = "Excalibur Timer Tick",
59 .flags = SA_INTERRUPT,
60 .handler = epxa10db_timer_interrupt
61};
62
63/*
64 * Set up timer interrupt, and return the current time in seconds.
65 */
66static void __init epxa10db_timer_init(void)
67{
68 /* Start the timer */
69 *TIMER0_LIMIT(IO_ADDRESS(EXC_TIMER00_BASE))=(unsigned int)(EXC_AHB2_CLK_FREQUENCY/200);
70 *TIMER0_PRESCALE(IO_ADDRESS(EXC_TIMER00_BASE))=1;
71 *TIMER0_CR(IO_ADDRESS(EXC_TIMER00_BASE))=TIMER0_CR_IE_MSK | TIMER0_CR_S_MSK;
72
73 setup_irq(IRQ_TIMER0, &epxa10db_timer_irq);
74}
75
76struct sys_timer epxa10db_timer = {
77 .init = epxa10db_timer_init,
78};
diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig
new file mode 100644
index 000000000000..1090c680b6dd
--- /dev/null
+++ b/arch/arm/mach-footbridge/Kconfig
@@ -0,0 +1,80 @@
1if ARCH_FOOTBRIDGE
2
3menu "Footbridge Implementations"
4
5config ARCH_CATS
6 bool "CATS"
7 select FOOTBRIDGE_HOST
8 help
9 Say Y here if you intend to run this kernel on the CATS.
10
11 Saying N will reduce the size of the Footbridge kernel.
12
13config ARCH_PERSONAL_SERVER
14 bool "Compaq Personal Server"
15 select FOOTBRIDGE_HOST
16 ---help---
17 Say Y here if you intend to run this kernel on the Compaq
18 Personal Server.
19
20 Saying N will reduce the size of the Footbridge kernel.
21
22 The Compaq Personal Server is not available for purchase.
23 There are no product plans beyond the current research
24 prototypes at this time. Information is available at:
25
26 <http://www.crl.hpl.hp.com/projects/personalserver/>
27
28 If you have any questions or comments about the Compaq Personal
29 Server, send e-mail to <skiff@crl.dec.com>.
30
31config ARCH_EBSA285_ADDIN
32 bool "EBSA285 (addin mode)"
33 select ARCH_EBSA285
34 select FOOTBRIDGE_ADDIN
35 help
36 Say Y here if you intend to run this kernel on the EBSA285 card
37 in addin mode.
38
39 Saying N will reduce the size of the Footbridge kernel.
40
41config ARCH_EBSA285_HOST
42 bool "EBSA285 (host mode)"
43 select ARCH_EBSA285
44 select FOOTBRIDGE_HOST
45 help
46 Say Y here if you intend to run this kernel on the EBSA285 card
47 in host ("central function") mode.
48
49 Saying N will reduce the size of the Footbridge kernel.
50
51config ARCH_NETWINDER
52 bool "NetWinder"
53 select FOOTBRIDGE_HOST
54 help
55 Say Y here if you intend to run this kernel on the Rebel.COM
56 NetWinder. Information about this machine can be found at:
57
58 <http://www.netwinder.org/>
59
60 Saying N will reduce the size of the Footbridge kernel.
61
62endmenu
63
64# Footbridge support
65config FOOTBRIDGE
66 bool
67
68# Footbridge in host mode
69config FOOTBRIDGE_HOST
70 bool
71
72# Footbridge in addin mode
73config FOOTBRIDGE_ADDIN
74 bool
75
76# EBSA285 board in either host or addin mode
77config ARCH_EBSA285
78 bool
79
80endif
diff --git a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile
new file mode 100644
index 000000000000..0694ad6b6476
--- /dev/null
+++ b/arch/arm/mach-footbridge/Makefile
@@ -0,0 +1,30 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := common.o dc21285.o dma.o isa-irq.o time.o
8obj-m :=
9obj-n :=
10obj- :=
11
12pci-$(CONFIG_ARCH_CATS) += cats-pci.o
13pci-$(CONFIG_ARCH_EBSA285_HOST) += ebsa285-pci.o
14pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o
15pci-$(CONFIG_ARCH_PERSONAL_SERVER) += personal-pci.o
16
17leds-$(CONFIG_ARCH_CO285) += ebsa285-leds.o
18leds-$(CONFIG_ARCH_EBSA285) += ebsa285-leds.o
19leds-$(CONFIG_ARCH_NETWINDER) += netwinder-leds.o
20
21obj-$(CONFIG_ARCH_CATS) += cats-hw.o isa-timer.o
22obj-$(CONFIG_ARCH_CO285) += co285.o dc21285-timer.o
23obj-$(CONFIG_ARCH_EBSA285) += ebsa285.o dc21285-timer.o
24obj-$(CONFIG_ARCH_NETWINDER) += netwinder-hw.o isa-timer.o
25obj-$(CONFIG_ARCH_PERSONAL_SERVER) += personal.o dc21285-timer.o
26
27obj-$(CONFIG_PCI) +=$(pci-y)
28obj-$(CONFIG_LEDS) +=$(leds-y)
29
30obj-$(CONFIG_ISA) += isa.o
diff --git a/arch/arm/mach-footbridge/Makefile.boot b/arch/arm/mach-footbridge/Makefile.boot
new file mode 100644
index 000000000000..c7e75acfe6c9
--- /dev/null
+++ b/arch/arm/mach-footbridge/Makefile.boot
@@ -0,0 +1,4 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000
4
diff --git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c
new file mode 100644
index 000000000000..d1ced86c379c
--- /dev/null
+++ b/arch/arm/mach-footbridge/cats-hw.c
@@ -0,0 +1,95 @@
1/*
2 * linux/arch/arm/mach-footbridge/cats-hw.c
3 *
4 * CATS machine fixup
5 *
6 * Copyright (C) 1998, 1999 Russell King, Phil Blundell
7 */
8#include <linux/ioport.h>
9#include <linux/kernel.h>
10#include <linux/init.h>
11#include <linux/tty.h>
12
13#include <asm/hardware/dec21285.h>
14#include <asm/io.h>
15#include <asm/mach-types.h>
16#include <asm/setup.h>
17
18#include <asm/mach/arch.h>
19
20#include "common.h"
21
22#define CFG_PORT 0x370
23#define INDEX_PORT (CFG_PORT)
24#define DATA_PORT (CFG_PORT + 1)
25
26static int __init cats_hw_init(void)
27{
28 if (machine_is_cats()) {
29 /* Set Aladdin to CONFIGURE mode */
30 outb(0x51, CFG_PORT);
31 outb(0x23, CFG_PORT);
32
33 /* Select logical device 3 */
34 outb(0x07, INDEX_PORT);
35 outb(0x03, DATA_PORT);
36
37 /* Set parallel port to DMA channel 3, ECP+EPP1.9,
38 enable EPP timeout */
39 outb(0x74, INDEX_PORT);
40 outb(0x03, DATA_PORT);
41
42 outb(0xf0, INDEX_PORT);
43 outb(0x0f, DATA_PORT);
44
45 outb(0xf1, INDEX_PORT);
46 outb(0x07, DATA_PORT);
47
48 /* Select logical device 4 */
49 outb(0x07, INDEX_PORT);
50 outb(0x04, DATA_PORT);
51
52 /* UART1 high speed mode */
53 outb(0xf0, INDEX_PORT);
54 outb(0x02, DATA_PORT);
55
56 /* Select logical device 5 */
57 outb(0x07, INDEX_PORT);
58 outb(0x05, DATA_PORT);
59
60 /* UART2 high speed mode */
61 outb(0xf0, INDEX_PORT);
62 outb(0x02, DATA_PORT);
63
64 /* Set Aladdin to RUN mode */
65 outb(0xbb, CFG_PORT);
66 }
67
68 return 0;
69}
70
71__initcall(cats_hw_init);
72
73/*
74 * CATS uses soft-reboot by default, since
75 * hard reboots fail on early boards.
76 */
77static void __init
78fixup_cats(struct machine_desc *desc, struct tag *tags,
79 char **cmdline, struct meminfo *mi)
80{
81 ORIG_VIDEO_LINES = 25;
82 ORIG_VIDEO_POINTS = 16;
83 ORIG_Y = 24;
84}
85
86MACHINE_START(CATS, "Chalice-CATS")
87 MAINTAINER("Philip Blundell")
88 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
89 BOOT_PARAMS(0x00000100)
90 SOFT_REBOOT
91 FIXUP(fixup_cats)
92 MAPIO(footbridge_map_io)
93 INITIRQ(footbridge_init_irq)
94 .timer = &isa_timer,
95MACHINE_END
diff --git a/arch/arm/mach-footbridge/cats-pci.c b/arch/arm/mach-footbridge/cats-pci.c
new file mode 100644
index 000000000000..4f984fde7375
--- /dev/null
+++ b/arch/arm/mach-footbridge/cats-pci.c
@@ -0,0 +1,55 @@
1/*
2 * linux/arch/arm/mach-footbridge/cats-pci.c
3 *
4 * PCI bios-type initialisation for PCI machines
5 *
6 * Bits taken from various places.
7 */
8#include <linux/kernel.h>
9#include <linux/pci.h>
10#include <linux/init.h>
11
12#include <asm/irq.h>
13#include <asm/mach/pci.h>
14#include <asm/mach-types.h>
15
16/* cats host-specific stuff */
17static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };
18
19static int __init cats_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
20{
21 if (dev->irq >= 128)
22 return dev->irq & 0x1f;
23
24 if (dev->irq >= 1 && dev->irq <= 4)
25 return irqmap_cats[dev->irq - 1];
26
27 if (dev->irq != 0)
28 printk("PCI: device %02x:%02x has unknown irq line %x\n",
29 dev->bus->number, dev->devfn, dev->irq);
30
31 return -1;
32}
33
34/*
35 * why not the standard PCI swizzle? does this prevent 4-port tulip
36 * cards being used (ie, pci-pci bridge based cards)?
37 */
38static struct hw_pci cats_pci __initdata = {
39 .swizzle = NULL,
40 .map_irq = cats_map_irq,
41 .nr_controllers = 1,
42 .setup = dc21285_setup,
43 .scan = dc21285_scan_bus,
44 .preinit = dc21285_preinit,
45 .postinit = dc21285_postinit,
46};
47
48static int cats_pci_init(void)
49{
50 if (machine_is_cats())
51 pci_common_init(&cats_pci);
52 return 0;
53}
54
55subsys_initcall(cats_pci_init);
diff --git a/arch/arm/mach-footbridge/co285.c b/arch/arm/mach-footbridge/co285.c
new file mode 100644
index 000000000000..e1541914fdcd
--- /dev/null
+++ b/arch/arm/mach-footbridge/co285.c
@@ -0,0 +1,38 @@
1/*
2 * linux/arch/arm/mach-footbridge/co285.c
3 *
4 * CO285 machine fixup
5 */
6#include <linux/init.h>
7
8#include <asm/hardware/dec21285.h>
9#include <asm/mach-types.h>
10
11#include <asm/mach/arch.h>
12
13#include "common.h"
14
15static void __init
16fixup_coebsa285(struct machine_desc *desc, struct tag *tags,
17 char **cmdline, struct meminfo *mi)
18{
19 extern unsigned long boot_memory_end;
20 extern char boot_command_line[];
21
22 mi->nr_banks = 1;
23 mi->bank[0].start = PHYS_OFFSET;
24 mi->bank[0].size = boot_memory_end;
25 mi->bank[0].node = 0;
26
27 *cmdline = boot_command_line;
28}
29
30MACHINE_START(CO285, "co-EBSA285")
31 MAINTAINER("Mark van Doesburg")
32 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0x7cf00000)
33 FIXUP(fixup_coebsa285)
34 MAPIO(footbridge_map_io)
35 INITIRQ(footbridge_init_irq)
36 .timer = &footbridge_timer,
37MACHINE_END
38
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c
new file mode 100644
index 000000000000..eb8238c1ef06
--- /dev/null
+++ b/arch/arm/mach-footbridge/common.c
@@ -0,0 +1,205 @@
1/*
2 * linux/arch/arm/mach-footbridge/common.c
3 *
4 * Copyright (C) 1998-2000 Russell King, Dave Gilbert.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/config.h>
11#include <linux/module.h>
12#include <linux/types.h>
13#include <linux/mm.h>
14#include <linux/ioport.h>
15#include <linux/list.h>
16#include <linux/init.h>
17
18#include <asm/pgtable.h>
19#include <asm/page.h>
20#include <asm/irq.h>
21#include <asm/io.h>
22#include <asm/mach-types.h>
23#include <asm/setup.h>
24#include <asm/hardware/dec21285.h>
25
26#include <asm/mach/irq.h>
27#include <asm/mach/map.h>
28
29#include "common.h"
30
31extern void __init isa_init_irq(unsigned int irq);
32
33unsigned int mem_fclk_21285 = 50000000;
34
35EXPORT_SYMBOL(mem_fclk_21285);
36
37static int __init parse_tag_memclk(const struct tag *tag)
38{
39 mem_fclk_21285 = tag->u.memclk.fmemclk;
40 return 0;
41}
42
43__tagtable(ATAG_MEMCLK, parse_tag_memclk);
44
45/*
46 * Footbridge IRQ translation table
47 * Converts from our IRQ numbers into FootBridge masks
48 */
49static const int fb_irq_mask[] = {
50 IRQ_MASK_UART_RX, /* 0 */
51 IRQ_MASK_UART_TX, /* 1 */
52 IRQ_MASK_TIMER1, /* 2 */
53 IRQ_MASK_TIMER2, /* 3 */
54 IRQ_MASK_TIMER3, /* 4 */
55 IRQ_MASK_IN0, /* 5 */
56 IRQ_MASK_IN1, /* 6 */
57 IRQ_MASK_IN2, /* 7 */
58 IRQ_MASK_IN3, /* 8 */
59 IRQ_MASK_DOORBELLHOST, /* 9 */
60 IRQ_MASK_DMA1, /* 10 */
61 IRQ_MASK_DMA2, /* 11 */
62 IRQ_MASK_PCI, /* 12 */
63 IRQ_MASK_SDRAMPARITY, /* 13 */
64 IRQ_MASK_I2OINPOST, /* 14 */
65 IRQ_MASK_PCI_ABORT, /* 15 */
66 IRQ_MASK_PCI_SERR, /* 16 */
67 IRQ_MASK_DISCARD_TIMER, /* 17 */
68 IRQ_MASK_PCI_DPERR, /* 18 */
69 IRQ_MASK_PCI_PERR, /* 19 */
70};
71
72static void fb_mask_irq(unsigned int irq)
73{
74 *CSR_IRQ_DISABLE = fb_irq_mask[_DC21285_INR(irq)];
75}
76
77static void fb_unmask_irq(unsigned int irq)
78{
79 *CSR_IRQ_ENABLE = fb_irq_mask[_DC21285_INR(irq)];
80}
81
82static struct irqchip fb_chip = {
83 .ack = fb_mask_irq,
84 .mask = fb_mask_irq,
85 .unmask = fb_unmask_irq,
86};
87
88static void __init __fb_init_irq(void)
89{
90 unsigned int irq;
91
92 /*
93 * setup DC21285 IRQs
94 */
95 *CSR_IRQ_DISABLE = -1;
96 *CSR_FIQ_DISABLE = -1;
97
98 for (irq = _DC21285_IRQ(0); irq < _DC21285_IRQ(20); irq++) {
99 set_irq_chip(irq, &fb_chip);
100 set_irq_handler(irq, do_level_IRQ);
101 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
102 }
103}
104
105void __init footbridge_init_irq(void)
106{
107 __fb_init_irq();
108
109 if (!footbridge_cfn_mode())
110 return;
111
112 if (machine_is_ebsa285())
113 /* The following is dependent on which slot
114 * you plug the Southbridge card into. We
115 * currently assume that you plug it into
116 * the right-hand most slot.
117 */
118 isa_init_irq(IRQ_PCI);
119
120 if (machine_is_cats())
121 isa_init_irq(IRQ_IN2);
122
123 if (machine_is_netwinder())
124 isa_init_irq(IRQ_IN3);
125}
126
127/*
128 * Common mapping for all systems. Note that the outbound write flush is
129 * commented out since there is a "No Fix" problem with it. Not mapping
130 * it means that we have extra bullet protection on our feet.
131 */
132static struct map_desc fb_common_io_desc[] __initdata = {
133 { ARMCSR_BASE, DC21285_ARMCSR_BASE, ARMCSR_SIZE, MT_DEVICE },
134 { XBUS_BASE, 0x40000000, XBUS_SIZE, MT_DEVICE }
135};
136
137/*
138 * The mapping when the footbridge is in host mode. We don't map any of
139 * this when we are in add-in mode.
140 */
141static struct map_desc ebsa285_host_io_desc[] __initdata = {
142#if defined(CONFIG_ARCH_FOOTBRIDGE) && defined(CONFIG_FOOTBRIDGE_HOST)
143 { PCIMEM_BASE, DC21285_PCI_MEM, PCIMEM_SIZE, MT_DEVICE },
144 { PCICFG0_BASE, DC21285_PCI_TYPE_0_CONFIG, PCICFG0_SIZE, MT_DEVICE },
145 { PCICFG1_BASE, DC21285_PCI_TYPE_1_CONFIG, PCICFG1_SIZE, MT_DEVICE },
146 { PCIIACK_BASE, DC21285_PCI_IACK, PCIIACK_SIZE, MT_DEVICE },
147 { PCIO_BASE, DC21285_PCI_IO, PCIO_SIZE, MT_DEVICE }
148#endif
149};
150
151/*
152 * The CO-ebsa285 mapping.
153 */
154static struct map_desc co285_io_desc[] __initdata = {
155#ifdef CONFIG_ARCH_CO285
156 { PCIO_BASE, DC21285_PCI_IO, PCIO_SIZE, MT_DEVICE },
157 { PCIMEM_BASE, DC21285_PCI_MEM, PCIMEM_SIZE, MT_DEVICE }
158#endif
159};
160
161void __init footbridge_map_io(void)
162{
163 /*
164 * Set up the common mapping first; we need this to
165 * determine whether we're in host mode or not.
166 */
167 iotable_init(fb_common_io_desc, ARRAY_SIZE(fb_common_io_desc));
168
169 /*
170 * Now, work out what we've got to map in addition on this
171 * platform.
172 */
173 if (machine_is_co285())
174 iotable_init(co285_io_desc, ARRAY_SIZE(co285_io_desc));
175 if (footbridge_cfn_mode())
176 iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc));
177}
178
179#ifdef CONFIG_FOOTBRIDGE_ADDIN
180
181/*
182 * These two functions convert virtual addresses to PCI addresses and PCI
183 * addresses to virtual addresses. Note that it is only legal to use these
184 * on memory obtained via get_zeroed_page or kmalloc.
185 */
186unsigned long __virt_to_bus(unsigned long res)
187{
188 WARN_ON(res < PAGE_OFFSET || res >= (unsigned long)high_memory);
189
190 return (res - PAGE_OFFSET) + (*CSR_PCISDRAMBASE & 0xfffffff0);
191}
192EXPORT_SYMBOL(__virt_to_bus);
193
194unsigned long __bus_to_virt(unsigned long res)
195{
196 res -= (*CSR_PCISDRAMBASE & 0xfffffff0);
197 res += PAGE_OFFSET;
198
199 WARN_ON(res < PAGE_OFFSET || res >= (unsigned long)high_memory);
200
201 return res;
202}
203EXPORT_SYMBOL(__bus_to_virt);
204
205#endif
diff --git a/arch/arm/mach-footbridge/common.h b/arch/arm/mach-footbridge/common.h
new file mode 100644
index 000000000000..580e31bbc711
--- /dev/null
+++ b/arch/arm/mach-footbridge/common.h
@@ -0,0 +1,9 @@
1
2extern struct sys_timer footbridge_timer;
3extern struct sys_timer isa_timer;
4
5extern void isa_rtc_init(void);
6
7extern void footbridge_map_io(void);
8extern void footbridge_init_irq(void);
9
diff --git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c
new file mode 100644
index 000000000000..580e1d4bce08
--- /dev/null
+++ b/arch/arm/mach-footbridge/dc21285-timer.c
@@ -0,0 +1,68 @@
1/*
2 * linux/arch/arm/mach-footbridge/dc21285-timer.c
3 *
4 * Copyright (C) 1998 Russell King.
5 * Copyright (C) 1998 Phil Blundell
6 */
7#include <linux/init.h>
8#include <linux/interrupt.h>
9
10#include <asm/irq.h>
11
12#include <asm/hardware/dec21285.h>
13#include <asm/mach/time.h>
14
15#include "common.h"
16
17/*
18 * Footbridge timer 1 support.
19 */
20static unsigned long timer1_latch;
21
22static unsigned long timer1_gettimeoffset (void)
23{
24 unsigned long value = timer1_latch - *CSR_TIMER1_VALUE;
25
26 return ((tick_nsec / 1000) * value) / timer1_latch;
27}
28
29static irqreturn_t
30timer1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
31{
32 write_seqlock(&xtime_lock);
33
34 *CSR_TIMER1_CLR = 0;
35
36 timer_tick(regs);
37
38 write_sequnlock(&xtime_lock);
39
40 return IRQ_HANDLED;
41}
42
43static struct irqaction footbridge_timer_irq = {
44 .name = "Timer1 timer tick",
45 .handler = timer1_interrupt,
46 .flags = SA_INTERRUPT,
47};
48
49/*
50 * Set up timer interrupt.
51 */
52static void __init footbridge_timer_init(void)
53{
54 isa_rtc_init();
55
56 timer1_latch = (mem_fclk_21285 + 8 * HZ) / (16 * HZ);
57
58 *CSR_TIMER1_CLR = 0;
59 *CSR_TIMER1_LOAD = timer1_latch;
60 *CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16;
61
62 setup_irq(IRQ_TIMER1, &footbridge_timer_irq);
63}
64
65struct sys_timer footbridge_timer = {
66 .init = footbridge_timer_init,
67 .offset = timer1_gettimeoffset,
68};
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
new file mode 100644
index 000000000000..e79884eea1f7
--- /dev/null
+++ b/arch/arm/mach-footbridge/dc21285.c
@@ -0,0 +1,384 @@
1/*
2 * linux/arch/arm/kernel/dec21285.c: PCI functions for DC21285
3 *
4 * Copyright (C) 1998-2001 Russell King
5 * Copyright (C) 1998-2000 Phil Blundell
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/kernel.h>
12#include <linux/pci.h>
13#include <linux/ptrace.h>
14#include <linux/interrupt.h>
15#include <linux/mm.h>
16#include <linux/slab.h>
17#include <linux/init.h>
18#include <linux/ioport.h>
19
20#include <asm/io.h>
21#include <asm/irq.h>
22#include <asm/system.h>
23#include <asm/mach/pci.h>
24#include <asm/hardware/dec21285.h>
25
26#define MAX_SLOTS 21
27
28#define PCICMD_ABORT ((PCI_STATUS_REC_MASTER_ABORT| \
29 PCI_STATUS_REC_TARGET_ABORT)<<16)
30
31#define PCICMD_ERROR_BITS ((PCI_STATUS_DETECTED_PARITY | \
32 PCI_STATUS_REC_MASTER_ABORT | \
33 PCI_STATUS_REC_TARGET_ABORT | \
34 PCI_STATUS_PARITY) << 16)
35
36extern int setup_arm_irq(int, struct irqaction *);
37extern void pcibios_report_status(u_int status_mask, int warn);
38extern void register_isa_ports(unsigned int, unsigned int, unsigned int);
39
40static unsigned long
41dc21285_base_address(struct pci_bus *bus, unsigned int devfn)
42{
43 unsigned long addr = 0;
44
45 if (bus->number == 0) {
46 if (PCI_SLOT(devfn) == 0)
47 /*
48 * For devfn 0, point at the 21285
49 */
50 addr = ARMCSR_BASE;
51 else {
52 devfn -= 1 << 3;
53
54 if (devfn < PCI_DEVFN(MAX_SLOTS, 0))
55 addr = PCICFG0_BASE | 0xc00000 | (devfn << 8);
56 }
57 } else
58 addr = PCICFG1_BASE | (bus->number << 16) | (devfn << 8);
59
60 return addr;
61}
62
63static int
64dc21285_read_config(struct pci_bus *bus, unsigned int devfn, int where,
65 int size, u32 *value)
66{
67 unsigned long addr = dc21285_base_address(bus, devfn);
68 u32 v = 0xffffffff;
69
70 if (addr)
71 switch (size) {
72 case 1:
73 asm("ldr%?b %0, [%1, %2]"
74 : "=r" (v) : "r" (addr), "r" (where));
75 break;
76 case 2:
77 asm("ldr%?h %0, [%1, %2]"
78 : "=r" (v) : "r" (addr), "r" (where));
79 break;
80 case 4:
81 asm("ldr%? %0, [%1, %2]"
82 : "=r" (v) : "r" (addr), "r" (where));
83 break;
84 }
85
86 *value = v;
87
88 v = *CSR_PCICMD;
89 if (v & PCICMD_ABORT) {
90 *CSR_PCICMD = v & (0xffff|PCICMD_ABORT);
91 return -1;
92 }
93
94 return PCIBIOS_SUCCESSFUL;
95}
96
97static int
98dc21285_write_config(struct pci_bus *bus, unsigned int devfn, int where,
99 int size, u32 value)
100{
101 unsigned long addr = dc21285_base_address(bus, devfn);
102 u32 v;
103
104 if (addr)
105 switch (size) {
106 case 1:
107 asm("str%?b %0, [%1, %2]"
108 : : "r" (value), "r" (addr), "r" (where));
109 break;
110 case 2:
111 asm("str%?h %0, [%1, %2]"
112 : : "r" (value), "r" (addr), "r" (where));
113 break;
114 case 4:
115 asm("str%? %0, [%1, %2]"
116 : : "r" (value), "r" (addr), "r" (where));
117 break;
118 }
119
120 v = *CSR_PCICMD;
121 if (v & PCICMD_ABORT) {
122 *CSR_PCICMD = v & (0xffff|PCICMD_ABORT);
123 return -1;
124 }
125
126 return PCIBIOS_SUCCESSFUL;
127}
128
129static struct pci_ops dc21285_ops = {
130 .read = dc21285_read_config,
131 .write = dc21285_write_config,
132};
133
134static struct timer_list serr_timer;
135static struct timer_list perr_timer;
136
137static void dc21285_enable_error(unsigned long __data)
138{
139 switch (__data) {
140 case IRQ_PCI_SERR:
141 del_timer(&serr_timer);
142 break;
143
144 case IRQ_PCI_PERR:
145 del_timer(&perr_timer);
146 break;
147 }
148
149 enable_irq(__data);
150}
151
152/*
153 * Warn on PCI errors.
154 */
155static irqreturn_t dc21285_abort_irq(int irq, void *dev_id, struct pt_regs *regs)
156{
157 unsigned int cmd;
158 unsigned int status;
159
160 cmd = *CSR_PCICMD;
161 status = cmd >> 16;
162 cmd = cmd & 0xffff;
163
164 if (status & PCI_STATUS_REC_MASTER_ABORT) {
165 printk(KERN_DEBUG "PCI: master abort, pc=0x%08lx\n",
166 instruction_pointer(regs));
167 cmd |= PCI_STATUS_REC_MASTER_ABORT << 16;
168 }
169
170 if (status & PCI_STATUS_REC_TARGET_ABORT) {
171 printk(KERN_DEBUG "PCI: target abort: ");
172 pcibios_report_status(PCI_STATUS_REC_MASTER_ABORT |
173 PCI_STATUS_SIG_TARGET_ABORT |
174 PCI_STATUS_REC_TARGET_ABORT, 1);
175 printk("\n");
176
177 cmd |= PCI_STATUS_REC_TARGET_ABORT << 16;
178 }
179
180 *CSR_PCICMD = cmd;
181
182 return IRQ_HANDLED;
183}
184
185static irqreturn_t dc21285_serr_irq(int irq, void *dev_id, struct pt_regs *regs)
186{
187 struct timer_list *timer = dev_id;
188 unsigned int cntl;
189
190 printk(KERN_DEBUG "PCI: system error received: ");
191 pcibios_report_status(PCI_STATUS_SIG_SYSTEM_ERROR, 1);
192 printk("\n");
193
194 cntl = *CSR_SA110_CNTL & 0xffffdf07;
195 *CSR_SA110_CNTL = cntl | SA110_CNTL_RXSERR;
196
197 /*
198 * back off this interrupt
199 */
200 disable_irq(irq);
201 timer->expires = jiffies + HZ;
202 add_timer(timer);
203
204 return IRQ_HANDLED;
205}
206
207static irqreturn_t dc21285_discard_irq(int irq, void *dev_id, struct pt_regs *regs)
208{
209 printk(KERN_DEBUG "PCI: discard timer expired\n");
210 *CSR_SA110_CNTL &= 0xffffde07;
211
212 return IRQ_HANDLED;
213}
214
215static irqreturn_t dc21285_dparity_irq(int irq, void *dev_id, struct pt_regs *regs)
216{
217 unsigned int cmd;
218
219 printk(KERN_DEBUG "PCI: data parity error detected: ");
220 pcibios_report_status(PCI_STATUS_PARITY | PCI_STATUS_DETECTED_PARITY, 1);
221 printk("\n");
222
223 cmd = *CSR_PCICMD & 0xffff;
224 *CSR_PCICMD = cmd | 1 << 24;
225
226 return IRQ_HANDLED;
227}
228
229static irqreturn_t dc21285_parity_irq(int irq, void *dev_id, struct pt_regs *regs)
230{
231 struct timer_list *timer = dev_id;
232 unsigned int cmd;
233
234 printk(KERN_DEBUG "PCI: parity error detected: ");
235 pcibios_report_status(PCI_STATUS_PARITY | PCI_STATUS_DETECTED_PARITY, 1);
236 printk("\n");
237
238 cmd = *CSR_PCICMD & 0xffff;
239 *CSR_PCICMD = cmd | 1 << 31;
240
241 /*
242 * back off this interrupt
243 */
244 disable_irq(irq);
245 timer->expires = jiffies + HZ;
246 add_timer(timer);
247
248 return IRQ_HANDLED;
249}
250
251int __init dc21285_setup(int nr, struct pci_sys_data *sys)
252{
253 struct resource *res;
254
255 if (nr || !footbridge_cfn_mode())
256 return 0;
257
258 res = kmalloc(sizeof(struct resource) * 2, GFP_KERNEL);
259 if (!res) {
260 printk("out of memory for root bus resources");
261 return 0;
262 }
263
264 memset(res, 0, sizeof(struct resource) * 2);
265
266 res[0].flags = IORESOURCE_MEM;
267 res[0].name = "Footbridge non-prefetch";
268 res[1].flags = IORESOURCE_MEM | IORESOURCE_PREFETCH;
269 res[1].name = "Footbridge prefetch";
270
271 allocate_resource(&iomem_resource, &res[1], 0x20000000,
272 0xa0000000, 0xffffffff, 0x20000000, NULL, NULL);
273 allocate_resource(&iomem_resource, &res[0], 0x40000000,
274 0x80000000, 0xffffffff, 0x40000000, NULL, NULL);
275
276 sys->resource[0] = &ioport_resource;
277 sys->resource[1] = &res[0];
278 sys->resource[2] = &res[1];
279 sys->mem_offset = DC21285_PCI_MEM;
280
281 return 1;
282}
283
284struct pci_bus * __init dc21285_scan_bus(int nr, struct pci_sys_data *sys)
285{
286 return pci_scan_bus(0, &dc21285_ops, sys);
287}
288
289void __init dc21285_preinit(void)
290{
291 unsigned int mem_size, mem_mask;
292 int cfn_mode;
293
294 mem_size = (unsigned int)high_memory - PAGE_OFFSET;
295 for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1)
296 if (mem_mask >= mem_size)
297 break;
298
299 /*
300 * These registers need to be set up whether we're the
301 * central function or not.
302 */
303 *CSR_SDRAMBASEMASK = (mem_mask - 1) & 0x0ffc0000;
304 *CSR_SDRAMBASEOFFSET = 0;
305 *CSR_ROMBASEMASK = 0x80000000;
306 *CSR_CSRBASEMASK = 0;
307 *CSR_CSRBASEOFFSET = 0;
308 *CSR_PCIADDR_EXTN = 0;
309
310 cfn_mode = __footbridge_cfn_mode();
311
312 printk(KERN_INFO "PCI: DC21285 footbridge, revision %02lX, in "
313 "%s mode\n", *CSR_CLASSREV & 0xff, cfn_mode ?
314 "central function" : "addin");
315
316 if (footbridge_cfn_mode()) {
317 /*
318 * Clear any existing errors - we aren't
319 * interested in historical data...
320 */
321 *CSR_SA110_CNTL = (*CSR_SA110_CNTL & 0xffffde07) |
322 SA110_CNTL_RXSERR;
323 *CSR_PCICMD = (*CSR_PCICMD & 0xffff) | PCICMD_ERROR_BITS;
324 }
325
326 init_timer(&serr_timer);
327 init_timer(&perr_timer);
328
329 serr_timer.data = IRQ_PCI_SERR;
330 serr_timer.function = dc21285_enable_error;
331 perr_timer.data = IRQ_PCI_PERR;
332 perr_timer.function = dc21285_enable_error;
333
334 /*
335 * We don't care if these fail.
336 */
337 request_irq(IRQ_PCI_SERR, dc21285_serr_irq, SA_INTERRUPT,
338 "PCI system error", &serr_timer);
339 request_irq(IRQ_PCI_PERR, dc21285_parity_irq, SA_INTERRUPT,
340 "PCI parity error", &perr_timer);
341 request_irq(IRQ_PCI_ABORT, dc21285_abort_irq, SA_INTERRUPT,
342 "PCI abort", NULL);
343 request_irq(IRQ_DISCARD_TIMER, dc21285_discard_irq, SA_INTERRUPT,
344 "Discard timer", NULL);
345 request_irq(IRQ_PCI_DPERR, dc21285_dparity_irq, SA_INTERRUPT,
346 "PCI data parity", NULL);
347
348 if (cfn_mode) {
349 static struct resource csrio;
350
351 csrio.flags = IORESOURCE_IO;
352 csrio.name = "Footbridge";
353
354 allocate_resource(&ioport_resource, &csrio, 128,
355 0xff00, 0xffff, 128, NULL, NULL);
356
357 /*
358 * Map our SDRAM at a known address in PCI space, just in case
359 * the firmware had other ideas. Using a nonzero base is
360 * necessary, since some VGA cards forcefully use PCI addresses
361 * in the range 0x000a0000 to 0x000c0000. (eg, S3 cards).
362 */
363 *CSR_PCICSRBASE = 0xf4000000;
364 *CSR_PCICSRIOBASE = csrio.start;
365 *CSR_PCISDRAMBASE = __virt_to_bus(PAGE_OFFSET);
366 *CSR_PCIROMBASE = 0;
367 *CSR_PCICMD = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
368 PCI_COMMAND_INVALIDATE | PCICMD_ERROR_BITS;
369 } else if (footbridge_cfn_mode() != 0) {
370 /*
371 * If we are not compiled to accept "add-in" mode, then
372 * we are using a constant virt_to_bus translation which
373 * can not hope to cater for the way the host BIOS has
374 * set up the machine.
375 */
376 panic("PCI: this kernel is compiled for central "
377 "function mode only");
378 }
379}
380
381void __init dc21285_postinit(void)
382{
383 register_isa_ports(DC21285_PCI_MEM, DC21285_PCI_IO, 0);
384}
diff --git a/arch/arm/mach-footbridge/dma.c b/arch/arm/mach-footbridge/dma.c
new file mode 100644
index 000000000000..a6b1396b0951
--- /dev/null
+++ b/arch/arm/mach-footbridge/dma.c
@@ -0,0 +1,54 @@
1/*
2 * linux/arch/arm/kernel/dma-ebsa285.c
3 *
4 * Copyright (C) 1998 Phil Blundell
5 *
6 * DMA functions specific to EBSA-285/CATS architectures
7 *
8 * Changelog:
9 * 09-Nov-1998 RMK Split out ISA DMA functions to dma-isa.c
10 * 17-Mar-1999 RMK Allow any EBSA285-like architecture to have
11 * ISA DMA controllers.
12 */
13#include <linux/config.h>
14#include <linux/init.h>
15
16#include <asm/dma.h>
17#include <asm/io.h>
18
19#include <asm/mach/dma.h>
20#include <asm/hardware/dec21285.h>
21
22#if 0
23static int fb_dma_request(dmach_t channel, dma_t *dma)
24{
25 return -EINVAL;
26}
27
28static void fb_dma_enable(dmach_t channel, dma_t *dma)
29{
30}
31
32static void fb_dma_disable(dmach_t channel, dma_t *dma)
33{
34}
35
36static struct dma_ops fb_dma_ops = {
37 .type = "fb",
38 .request = fb_dma_request,
39 .enable = fb_dma_enable,
40 .disable = fb_dma_disable,
41};
42#endif
43
44void __init arch_dma_init(dma_t *dma)
45{
46#if 0
47 dma[_DC21285_DMA(0)].d_ops = &fb_dma_ops;
48 dma[_DC21285_DMA(1)].d_ops = &fb_dma_ops;
49#endif
50#ifdef CONFIG_ISA_DMA
51 if (footbridge_cfn_mode())
52 isa_init_dma(dma + _ISA_DMA(0));
53#endif
54}
diff --git a/arch/arm/mach-footbridge/ebsa285-leds.c b/arch/arm/mach-footbridge/ebsa285-leds.c
new file mode 100644
index 000000000000..2c7c3630401b
--- /dev/null
+++ b/arch/arm/mach-footbridge/ebsa285-leds.c
@@ -0,0 +1,140 @@
1/*
2 * linux/arch/arm/mach-footbridge/ebsa285-leds.c
3 *
4 * Copyright (C) 1998-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 * EBSA-285 control routines.
10 *
11 * The EBSA-285 uses the leds as follows:
12 * - Green - toggles state every 50 timer interrupts
13 * - Amber - On if system is not idle
14 * - Red - currently unused
15 *
16 * Changelog:
17 * 02-05-1999 RMK Various cleanups
18 */
19#include <linux/config.h>
20#include <linux/module.h>
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/spinlock.h>
24
25#include <asm/hardware.h>
26#include <asm/leds.h>
27#include <asm/mach-types.h>
28#include <asm/system.h>
29
30#define LED_STATE_ENABLED 1
31#define LED_STATE_CLAIMED 2
32static char led_state;
33static char hw_led_state;
34
35static DEFINE_SPINLOCK(leds_lock);
36
37static void ebsa285_leds_event(led_event_t evt)
38{
39 unsigned long flags;
40
41 spin_lock_irqsave(&leds_lock, flags);
42
43 switch (evt) {
44 case led_start:
45 hw_led_state = XBUS_LED_RED | XBUS_LED_GREEN;
46#ifndef CONFIG_LEDS_CPU
47 hw_led_state |= XBUS_LED_AMBER;
48#endif
49 led_state |= LED_STATE_ENABLED;
50 break;
51
52 case led_stop:
53 led_state &= ~LED_STATE_ENABLED;
54 break;
55
56 case led_claim:
57 led_state |= LED_STATE_CLAIMED;
58 hw_led_state = XBUS_LED_RED | XBUS_LED_GREEN | XBUS_LED_AMBER;
59 break;
60
61 case led_release:
62 led_state &= ~LED_STATE_CLAIMED;
63 hw_led_state = XBUS_LED_RED | XBUS_LED_GREEN | XBUS_LED_AMBER;
64 break;
65
66#ifdef CONFIG_LEDS_TIMER
67 case led_timer:
68 if (!(led_state & LED_STATE_CLAIMED))
69 hw_led_state ^= XBUS_LED_GREEN;
70 break;
71#endif
72
73#ifdef CONFIG_LEDS_CPU
74 case led_idle_start:
75 if (!(led_state & LED_STATE_CLAIMED))
76 hw_led_state |= XBUS_LED_AMBER;
77 break;
78
79 case led_idle_end:
80 if (!(led_state & LED_STATE_CLAIMED))
81 hw_led_state &= ~XBUS_LED_AMBER;
82 break;
83#endif
84
85 case led_halted:
86 if (!(led_state & LED_STATE_CLAIMED))
87 hw_led_state &= ~XBUS_LED_RED;
88 break;
89
90 case led_green_on:
91 if (led_state & LED_STATE_CLAIMED)
92 hw_led_state &= ~XBUS_LED_GREEN;
93 break;
94
95 case led_green_off:
96 if (led_state & LED_STATE_CLAIMED)
97 hw_led_state |= XBUS_LED_GREEN;
98 break;
99
100 case led_amber_on:
101 if (led_state & LED_STATE_CLAIMED)
102 hw_led_state &= ~XBUS_LED_AMBER;
103 break;
104
105 case led_amber_off:
106 if (led_state & LED_STATE_CLAIMED)
107 hw_led_state |= XBUS_LED_AMBER;
108 break;
109
110 case led_red_on:
111 if (led_state & LED_STATE_CLAIMED)
112 hw_led_state &= ~XBUS_LED_RED;
113 break;
114
115 case led_red_off:
116 if (led_state & LED_STATE_CLAIMED)
117 hw_led_state |= XBUS_LED_RED;
118 break;
119
120 default:
121 break;
122 }
123
124 if (led_state & LED_STATE_ENABLED)
125 *XBUS_LEDS = hw_led_state;
126
127 spin_unlock_irqrestore(&leds_lock, flags);
128}
129
130static int __init leds_init(void)
131{
132 if (machine_is_ebsa285() || machine_is_co285())
133 leds_event = ebsa285_leds_event;
134
135 leds_event(led_start);
136
137 return 0;
138}
139
140__initcall(leds_init);
diff --git a/arch/arm/mach-footbridge/ebsa285-pci.c b/arch/arm/mach-footbridge/ebsa285-pci.c
new file mode 100644
index 000000000000..720c0bac1702
--- /dev/null
+++ b/arch/arm/mach-footbridge/ebsa285-pci.c
@@ -0,0 +1,48 @@
1/*
2 * linux/arch/arm/mach-footbridge/ebsa285-pci.c
3 *
4 * PCI bios-type initialisation for PCI machines
5 *
6 * Bits taken from various places.
7 */
8#include <linux/kernel.h>
9#include <linux/pci.h>
10#include <linux/init.h>
11
12#include <asm/irq.h>
13#include <asm/mach/pci.h>
14#include <asm/mach-types.h>
15
16static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };
17
18static int __init ebsa285_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
19{
20 if (dev->vendor == PCI_VENDOR_ID_CONTAQ &&
21 dev->device == PCI_DEVICE_ID_CONTAQ_82C693)
22 switch (PCI_FUNC(dev->devfn)) {
23 case 1: return 14;
24 case 2: return 15;
25 case 3: return 12;
26 }
27
28 return irqmap_ebsa285[(slot + pin) & 3];
29}
30
31static struct hw_pci ebsa285_pci __initdata = {
32 .swizzle = pci_std_swizzle,
33 .map_irq = ebsa285_map_irq,
34 .nr_controllers = 1,
35 .setup = dc21285_setup,
36 .scan = dc21285_scan_bus,
37 .preinit = dc21285_preinit,
38 .postinit = dc21285_postinit,
39};
40
41static int __init ebsa285_init_pci(void)
42{
43 if (machine_is_ebsa285())
44 pci_common_init(&ebsa285_pci);
45 return 0;
46}
47
48subsys_initcall(ebsa285_init_pci);
diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c
new file mode 100644
index 000000000000..d0931f5a63c8
--- /dev/null
+++ b/arch/arm/mach-footbridge/ebsa285.c
@@ -0,0 +1,24 @@
1/*
2 * linux/arch/arm/mach-footbridge/ebsa285.c
3 *
4 * EBSA285 machine fixup
5 */
6#include <linux/init.h>
7
8#include <asm/hardware/dec21285.h>
9#include <asm/mach-types.h>
10
11#include <asm/mach/arch.h>
12
13#include "common.h"
14
15MACHINE_START(EBSA285, "EBSA285")
16 MAINTAINER("Russell King")
17 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
18 BOOT_PARAMS(0x00000100)
19 VIDEO(0x000a0000, 0x000bffff)
20 MAPIO(footbridge_map_io)
21 INITIRQ(footbridge_init_irq)
22 .timer = &footbridge_timer,
23MACHINE_END
24
diff --git a/arch/arm/mach-footbridge/isa-irq.c b/arch/arm/mach-footbridge/isa-irq.c
new file mode 100644
index 000000000000..b21016070ea3
--- /dev/null
+++ b/arch/arm/mach-footbridge/isa-irq.c
@@ -0,0 +1,168 @@
1/*
2 * linux/arch/arm/mach-footbridge/irq.c
3 *
4 * Copyright (C) 1996-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Changelog:
11 * 22-Aug-1998 RMK Restructured IRQ routines
12 * 03-Sep-1998 PJB Merged CATS support
13 * 20-Jan-1998 RMK Started merge of EBSA286, CATS and NetWinder
14 * 26-Jan-1999 PJB Don't use IACK on CATS
15 * 16-Mar-1999 RMK Added autodetect of ISA PICs
16 */
17#include <linux/ioport.h>
18#include <linux/interrupt.h>
19#include <linux/list.h>
20#include <linux/init.h>
21
22#include <asm/mach/irq.h>
23
24#include <asm/hardware.h>
25#include <asm/hardware/dec21285.h>
26#include <asm/irq.h>
27#include <asm/io.h>
28#include <asm/mach-types.h>
29
30static void isa_mask_pic_lo_irq(unsigned int irq)
31{
32 unsigned int mask = 1 << (irq & 7);
33
34 outb(inb(PIC_MASK_LO) | mask, PIC_MASK_LO);
35}
36
37static void isa_ack_pic_lo_irq(unsigned int irq)
38{
39 unsigned int mask = 1 << (irq & 7);
40
41 outb(inb(PIC_MASK_LO) | mask, PIC_MASK_LO);
42 outb(0x20, PIC_LO);
43}
44
45static void isa_unmask_pic_lo_irq(unsigned int irq)
46{
47 unsigned int mask = 1 << (irq & 7);
48
49 outb(inb(PIC_MASK_LO) & ~mask, PIC_MASK_LO);
50}
51
52static struct irqchip isa_lo_chip = {
53 .ack = isa_ack_pic_lo_irq,
54 .mask = isa_mask_pic_lo_irq,
55 .unmask = isa_unmask_pic_lo_irq,
56};
57
58static void isa_mask_pic_hi_irq(unsigned int irq)
59{
60 unsigned int mask = 1 << (irq & 7);
61
62 outb(inb(PIC_MASK_HI) | mask, PIC_MASK_HI);
63}
64
65static void isa_ack_pic_hi_irq(unsigned int irq)
66{
67 unsigned int mask = 1 << (irq & 7);
68
69 outb(inb(PIC_MASK_HI) | mask, PIC_MASK_HI);
70 outb(0x62, PIC_LO);
71 outb(0x20, PIC_HI);
72}
73
74static void isa_unmask_pic_hi_irq(unsigned int irq)
75{
76 unsigned int mask = 1 << (irq & 7);
77
78 outb(inb(PIC_MASK_HI) & ~mask, PIC_MASK_HI);
79}
80
81static struct irqchip isa_hi_chip = {
82 .ack = isa_ack_pic_hi_irq,
83 .mask = isa_mask_pic_hi_irq,
84 .unmask = isa_unmask_pic_hi_irq,
85};
86
87static void
88isa_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
89{
90 unsigned int isa_irq = *(unsigned char *)PCIIACK_BASE;
91
92 if (isa_irq < _ISA_IRQ(0) || isa_irq >= _ISA_IRQ(16)) {
93 do_bad_IRQ(isa_irq, desc, regs);
94 return;
95 }
96
97 desc = irq_desc + isa_irq;
98 desc->handle(isa_irq, desc, regs);
99}
100
101static struct irqaction irq_cascade = { .handler = no_action, .name = "cascade", };
102static struct resource pic1_resource = { "pic1", 0x20, 0x3f };
103static struct resource pic2_resource = { "pic2", 0xa0, 0xbf };
104
105void __init isa_init_irq(unsigned int host_irq)
106{
107 unsigned int irq;
108
109 /*
110 * Setup, and then probe for an ISA PIC
111 * If the PIC is not there, then we
112 * ignore the PIC.
113 */
114 outb(0x11, PIC_LO);
115 outb(_ISA_IRQ(0), PIC_MASK_LO); /* IRQ number */
116 outb(0x04, PIC_MASK_LO); /* Slave on Ch2 */
117 outb(0x01, PIC_MASK_LO); /* x86 */
118 outb(0xf5, PIC_MASK_LO); /* pattern: 11110101 */
119
120 outb(0x11, PIC_HI);
121 outb(_ISA_IRQ(8), PIC_MASK_HI); /* IRQ number */
122 outb(0x02, PIC_MASK_HI); /* Slave on Ch1 */
123 outb(0x01, PIC_MASK_HI); /* x86 */
124 outb(0xfa, PIC_MASK_HI); /* pattern: 11111010 */
125
126 outb(0x0b, PIC_LO);
127 outb(0x0b, PIC_HI);
128
129 if (inb(PIC_MASK_LO) == 0xf5 && inb(PIC_MASK_HI) == 0xfa) {
130 outb(0xff, PIC_MASK_LO);/* mask all IRQs */
131 outb(0xff, PIC_MASK_HI);/* mask all IRQs */
132 } else {
133 printk(KERN_INFO "IRQ: ISA PIC not found\n");
134 host_irq = (unsigned int)-1;
135 }
136
137 if (host_irq != (unsigned int)-1) {
138 for (irq = _ISA_IRQ(0); irq < _ISA_IRQ(8); irq++) {
139 set_irq_chip(irq, &isa_lo_chip);
140 set_irq_handler(irq, do_level_IRQ);
141 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
142 }
143
144 for (irq = _ISA_IRQ(8); irq < _ISA_IRQ(16); irq++) {
145 set_irq_chip(irq, &isa_hi_chip);
146 set_irq_handler(irq, do_level_IRQ);
147 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
148 }
149
150 request_resource(&ioport_resource, &pic1_resource);
151 request_resource(&ioport_resource, &pic2_resource);
152 setup_irq(IRQ_ISA_CASCADE, &irq_cascade);
153
154 set_irq_chained_handler(host_irq, isa_irq_handler);
155
156 /*
157 * On the NetWinder, don't automatically
158 * enable ISA IRQ11 when it is requested.
159 * There appears to be a missing pull-up
160 * resistor on this line.
161 */
162 if (machine_is_netwinder())
163 set_irq_flags(_ISA_IRQ(11), IRQF_VALID |
164 IRQF_PROBE | IRQF_NOAUTOEN);
165 }
166}
167
168
diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c
new file mode 100644
index 000000000000..a4fefa0bb5a1
--- /dev/null
+++ b/arch/arm/mach-footbridge/isa-timer.c
@@ -0,0 +1,94 @@
1/*
2 * linux/arch/arm/mach-footbridge/isa-timer.c
3 *
4 * Copyright (C) 1998 Russell King.
5 * Copyright (C) 1998 Phil Blundell
6 */
7#include <linux/init.h>
8#include <linux/interrupt.h>
9
10#include <asm/io.h>
11#include <asm/irq.h>
12
13#include <asm/mach/time.h>
14
15#include "common.h"
16
17/*
18 * ISA timer tick support
19 */
20#define mSEC_10_from_14 ((14318180 + 100) / 200)
21
22static unsigned long isa_gettimeoffset(void)
23{
24 int count;
25
26 static int count_p = (mSEC_10_from_14/6); /* for the first call after boot */
27 static unsigned long jiffies_p = 0;
28
29 /*
30 * cache volatile jiffies temporarily; we have IRQs turned off.
31 */
32 unsigned long jiffies_t;
33
34 /* timer count may underflow right here */
35 outb_p(0x00, 0x43); /* latch the count ASAP */
36
37 count = inb_p(0x40); /* read the latched count */
38
39 /*
40 * We do this guaranteed double memory access instead of a _p
41 * postfix in the previous port access. Wheee, hackady hack
42 */
43 jiffies_t = jiffies;
44
45 count |= inb_p(0x40) << 8;
46
47 /* Detect timer underflows. If we haven't had a timer tick since
48 the last time we were called, and time is apparently going
49 backwards, the counter must have wrapped during this routine. */
50 if ((jiffies_t == jiffies_p) && (count > count_p))
51 count -= (mSEC_10_from_14/6);
52 else
53 jiffies_p = jiffies_t;
54
55 count_p = count;
56
57 count = (((mSEC_10_from_14/6)-1) - count) * (tick_nsec / 1000);
58 count = (count + (mSEC_10_from_14/6)/2) / (mSEC_10_from_14/6);
59
60 return count;
61}
62
63static irqreturn_t
64isa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
65{
66 write_seqlock(&xtime_lock);
67 timer_tick(regs);
68 write_sequnlock(&xtime_lock);
69 return IRQ_HANDLED;
70}
71
72static struct irqaction isa_timer_irq = {
73 .name = "ISA timer tick",
74 .handler = isa_timer_interrupt,
75 .flags = SA_INTERRUPT,
76};
77
78static void __init isa_timer_init(void)
79{
80 isa_rtc_init();
81
82 /* enable PIT timer */
83 /* set for periodic (4) and LSB/MSB write (0x30) */
84 outb(0x34, 0x43);
85 outb((mSEC_10_from_14/6) & 0xFF, 0x40);
86 outb((mSEC_10_from_14/6) >> 8, 0x40);
87
88 setup_irq(IRQ_ISA_TIMER, &isa_timer_irq);
89}
90
91struct sys_timer isa_timer = {
92 .init = isa_timer_init,
93 .offset = isa_gettimeoffset,
94};
diff --git a/arch/arm/mach-footbridge/isa.c b/arch/arm/mach-footbridge/isa.c
new file mode 100644
index 000000000000..aa3a1fef563e
--- /dev/null
+++ b/arch/arm/mach-footbridge/isa.c
@@ -0,0 +1,48 @@
1/*
2 * linux/arch/arm/mach-footbridge/isa.c
3 *
4 * Copyright (C) 2004 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/init.h>
11#include <linux/serial_8250.h>
12
13#include <asm/irq.h>
14
15static struct plat_serial8250_port serial_platform_data[] = {
16 {
17 .iobase = 0x3f8,
18 .irq = IRQ_ISA_UART,
19 .uartclk = 1843200,
20 .regshift = 0,
21 .iotype = UPIO_PORT,
22 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
23 },
24 {
25 .iobase = 0x2f8,
26 .irq = IRQ_ISA_UART2,
27 .uartclk = 1843200,
28 .regshift = 0,
29 .iotype = UPIO_PORT,
30 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
31 },
32 { },
33};
34
35static struct platform_device serial_device = {
36 .name = "serial8250",
37 .id = 0,
38 .dev = {
39 .platform_data = serial_platform_data,
40 },
41};
42
43static int __init footbridge_isa_init(void)
44{
45 return platform_device_register(&serial_device);
46}
47
48arch_initcall(footbridge_isa_init);
diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c
new file mode 100644
index 000000000000..1e1dfd79f4fe
--- /dev/null
+++ b/arch/arm/mach-footbridge/netwinder-hw.c
@@ -0,0 +1,660 @@
1/*
2 * linux/arch/arm/mach-footbridge/netwinder-hw.c
3 *
4 * Netwinder machine fixup
5 *
6 * Copyright (C) 1998, 1999 Russell King, Phil Blundell
7 */
8#include <linux/config.h>
9#include <linux/module.h>
10#include <linux/ioport.h>
11#include <linux/kernel.h>
12#include <linux/delay.h>
13#include <linux/init.h>
14
15#include <asm/hardware/dec21285.h>
16#include <asm/io.h>
17#include <asm/leds.h>
18#include <asm/mach-types.h>
19#include <asm/setup.h>
20
21#include <asm/mach/arch.h>
22
23#include "common.h"
24
25#define IRDA_IO_BASE 0x180
26#define GP1_IO_BASE 0x338
27#define GP2_IO_BASE 0x33a
28
29
30#ifdef CONFIG_LEDS
31#define DEFAULT_LEDS 0
32#else
33#define DEFAULT_LEDS GPIO_GREEN_LED
34#endif
35
36/*
37 * Winbond WB83977F accessibility stuff
38 */
39static inline void wb977_open(void)
40{
41 outb(0x87, 0x370);
42 outb(0x87, 0x370);
43}
44
45static inline void wb977_close(void)
46{
47 outb(0xaa, 0x370);
48}
49
50static inline void wb977_wb(int reg, int val)
51{
52 outb(reg, 0x370);
53 outb(val, 0x371);
54}
55
56static inline void wb977_ww(int reg, int val)
57{
58 outb(reg, 0x370);
59 outb(val >> 8, 0x371);
60 outb(reg + 1, 0x370);
61 outb(val & 255, 0x371);
62}
63
64#define wb977_device_select(dev) wb977_wb(0x07, dev)
65#define wb977_device_disable() wb977_wb(0x30, 0x00)
66#define wb977_device_enable() wb977_wb(0x30, 0x01)
67
68/*
69 * This is a lock for accessing ports GP1_IO_BASE and GP2_IO_BASE
70 */
71DEFINE_SPINLOCK(gpio_lock);
72
73static unsigned int current_gpio_op;
74static unsigned int current_gpio_io;
75static unsigned int current_cpld;
76
77void gpio_modify_op(int mask, int set)
78{
79 unsigned int new_gpio, changed;
80
81 new_gpio = (current_gpio_op & ~mask) | set;
82 changed = new_gpio ^ current_gpio_op;
83 current_gpio_op = new_gpio;
84
85 if (changed & 0xff)
86 outb(new_gpio, GP1_IO_BASE);
87 if (changed & 0xff00)
88 outb(new_gpio >> 8, GP2_IO_BASE);
89}
90
91static inline void __gpio_modify_io(int mask, int in)
92{
93 unsigned int new_gpio, changed;
94 int port;
95
96 new_gpio = (current_gpio_io & ~mask) | in;
97 changed = new_gpio ^ current_gpio_io;
98 current_gpio_io = new_gpio;
99
100 changed >>= 1;
101 new_gpio >>= 1;
102
103 wb977_device_select(7);
104
105 for (port = 0xe1; changed && port < 0xe8; changed >>= 1) {
106 wb977_wb(port, new_gpio & 1);
107
108 port += 1;
109 new_gpio >>= 1;
110 }
111
112 wb977_device_select(8);
113
114 for (port = 0xe8; changed && port < 0xec; changed >>= 1) {
115 wb977_wb(port, new_gpio & 1);
116
117 port += 1;
118 new_gpio >>= 1;
119 }
120}
121
122void gpio_modify_io(int mask, int in)
123{
124 /* Open up the SuperIO chip */
125 wb977_open();
126
127 __gpio_modify_io(mask, in);
128
129 /* Close up the EFER gate */
130 wb977_close();
131}
132
133int gpio_read(void)
134{
135 return inb(GP1_IO_BASE) | inb(GP2_IO_BASE) << 8;
136}
137
138/*
139 * Initialise the Winbond W83977F global registers
140 */
141static inline void wb977_init_global(void)
142{
143 /*
144 * Enable R/W config registers
145 */
146 wb977_wb(0x26, 0x40);
147
148 /*
149 * Power down FDC (not used)
150 */
151 wb977_wb(0x22, 0xfe);
152
153 /*
154 * GP12, GP11, CIRRX, IRRXH, GP10
155 */
156 wb977_wb(0x2a, 0xc1);
157
158 /*
159 * GP23, GP22, GP21, GP20, GP13
160 */
161 wb977_wb(0x2b, 0x6b);
162
163 /*
164 * GP17, GP16, GP15, GP14
165 */
166 wb977_wb(0x2c, 0x55);
167}
168
169/*
170 * Initialise the Winbond W83977F printer port
171 */
172static inline void wb977_init_printer(void)
173{
174 wb977_device_select(1);
175
176 /*
177 * mode 1 == EPP
178 */
179 wb977_wb(0xf0, 0x01);
180}
181
182/*
183 * Initialise the Winbond W83977F keyboard controller
184 */
185static inline void wb977_init_keyboard(void)
186{
187 wb977_device_select(5);
188
189 /*
190 * Keyboard controller address
191 */
192 wb977_ww(0x60, 0x0060);
193 wb977_ww(0x62, 0x0064);
194
195 /*
196 * Keyboard IRQ 1, active high, edge trigger
197 */
198 wb977_wb(0x70, 1);
199 wb977_wb(0x71, 0x02);
200
201 /*
202 * Mouse IRQ 5, active high, edge trigger
203 */
204 wb977_wb(0x72, 5);
205 wb977_wb(0x73, 0x02);
206
207 /*
208 * KBC 8MHz
209 */
210 wb977_wb(0xf0, 0x40);
211
212 /*
213 * Enable device
214 */
215 wb977_device_enable();
216}
217
218/*
219 * Initialise the Winbond W83977F Infra-Red device
220 */
221static inline void wb977_init_irda(void)
222{
223 wb977_device_select(6);
224
225 /*
226 * IR base address
227 */
228 wb977_ww(0x60, IRDA_IO_BASE);
229
230 /*
231 * IRDA IRQ 6, active high, edge trigger
232 */
233 wb977_wb(0x70, 6);
234 wb977_wb(0x71, 0x02);
235
236 /*
237 * RX DMA - ISA DMA 0
238 */
239 wb977_wb(0x74, 0x00);
240
241 /*
242 * TX DMA - Disable Tx DMA
243 */
244 wb977_wb(0x75, 0x04);
245
246 /*
247 * Append CRC, Enable bank selection
248 */
249 wb977_wb(0xf0, 0x03);
250
251 /*
252 * Enable device
253 */
254 wb977_device_enable();
255}
256
257/*
258 * Initialise Winbond W83977F general purpose IO
259 */
260static inline void wb977_init_gpio(void)
261{
262 unsigned long flags;
263
264 /*
265 * Set up initial I/O definitions
266 */
267 current_gpio_io = -1;
268 __gpio_modify_io(-1, GPIO_DONE | GPIO_WDTIMER);
269
270 wb977_device_select(7);
271
272 /*
273 * Group1 base address
274 */
275 wb977_ww(0x60, GP1_IO_BASE);
276 wb977_ww(0x62, 0);
277 wb977_ww(0x64, 0);
278
279 /*
280 * GP10 (Orage button) IRQ 10, active high, edge trigger
281 */
282 wb977_wb(0x70, 10);
283 wb977_wb(0x71, 0x02);
284
285 /*
286 * GP10: Debounce filter enabled, IRQ, input
287 */
288 wb977_wb(0xe0, 0x19);
289
290 /*
291 * Enable Group1
292 */
293 wb977_device_enable();
294
295 wb977_device_select(8);
296
297 /*
298 * Group2 base address
299 */
300 wb977_ww(0x60, GP2_IO_BASE);
301
302 /*
303 * Clear watchdog timer regs
304 * - timer disable
305 */
306 wb977_wb(0xf2, 0x00);
307
308 /*
309 * - disable LED, no mouse nor keyboard IRQ
310 */
311 wb977_wb(0xf3, 0x00);
312
313 /*
314 * - timer counting, disable power LED, disable timeouot
315 */
316 wb977_wb(0xf4, 0x00);
317
318 /*
319 * Enable group2
320 */
321 wb977_device_enable();
322
323 /*
324 * Set Group1/Group2 outputs
325 */
326 spin_lock_irqsave(&gpio_lock, flags);
327 gpio_modify_op(-1, GPIO_RED_LED | GPIO_FAN);
328 spin_unlock_irqrestore(&gpio_lock, flags);
329}
330
331/*
332 * Initialise the Winbond W83977F chip.
333 */
334static void __init wb977_init(void)
335{
336 request_region(0x370, 2, "W83977AF configuration");
337
338 /*
339 * Open up the SuperIO chip
340 */
341 wb977_open();
342
343 /*
344 * Initialise the global registers
345 */
346 wb977_init_global();
347
348 /*
349 * Initialise the various devices in
350 * the multi-IO chip.
351 */
352 wb977_init_printer();
353 wb977_init_keyboard();
354 wb977_init_irda();
355 wb977_init_gpio();
356
357 /*
358 * Close up the EFER gate
359 */
360 wb977_close();
361}
362
363void cpld_modify(int mask, int set)
364{
365 int msk;
366
367 current_cpld = (current_cpld & ~mask) | set;
368
369 gpio_modify_io(GPIO_DATA | GPIO_IOCLK | GPIO_IOLOAD, 0);
370 gpio_modify_op(GPIO_IOLOAD, 0);
371
372 for (msk = 8; msk; msk >>= 1) {
373 int bit = current_cpld & msk;
374
375 gpio_modify_op(GPIO_DATA | GPIO_IOCLK, bit ? GPIO_DATA : 0);
376 gpio_modify_op(GPIO_IOCLK, GPIO_IOCLK);
377 }
378
379 gpio_modify_op(GPIO_IOCLK|GPIO_DATA, 0);
380 gpio_modify_op(GPIO_IOLOAD|GPIO_DSCLK, GPIO_IOLOAD|GPIO_DSCLK);
381 gpio_modify_op(GPIO_IOLOAD, 0);
382}
383
384static void __init cpld_init(void)
385{
386 unsigned long flags;
387
388 spin_lock_irqsave(&gpio_lock, flags);
389 cpld_modify(-1, CPLD_UNMUTE | CPLD_7111_DISABLE);
390 spin_unlock_irqrestore(&gpio_lock, flags);
391}
392
393static unsigned char rwa_unlock[] __initdata =
394{ 0x00, 0x00, 0x6a, 0xb5, 0xda, 0xed, 0xf6, 0xfb, 0x7d, 0xbe, 0xdf, 0x6f, 0x37, 0x1b,
395 0x0d, 0x86, 0xc3, 0x61, 0xb0, 0x58, 0x2c, 0x16, 0x8b, 0x45, 0xa2, 0xd1, 0xe8, 0x74,
396 0x3a, 0x9d, 0xce, 0xe7, 0x73, 0x39 };
397
398#ifndef DEBUG
399#define dprintk(x...)
400#else
401#define dprintk(x...) printk(x)
402#endif
403
404#define WRITE_RWA(r,v) do { outb((r), 0x279); udelay(10); outb((v), 0xa79); } while (0)
405
406static inline void rwa010_unlock(void)
407{
408 int i;
409
410 WRITE_RWA(2, 2);
411 mdelay(10);
412
413 for (i = 0; i < sizeof(rwa_unlock); i++) {
414 outb(rwa_unlock[i], 0x279);
415 udelay(10);
416 }
417}
418
419static inline void rwa010_read_ident(void)
420{
421 unsigned char si[9];
422 int i, j;
423
424 WRITE_RWA(3, 0);
425 WRITE_RWA(0, 128);
426
427 outb(1, 0x279);
428
429 mdelay(1);
430
431 dprintk("Identifier: ");
432 for (i = 0; i < 9; i++) {
433 si[i] = 0;
434 for (j = 0; j < 8; j++) {
435 int bit;
436 udelay(250);
437 inb(0x203);
438 udelay(250);
439 bit = inb(0x203);
440 dprintk("%02X ", bit);
441 bit = (bit == 0xaa) ? 1 : 0;
442 si[i] |= bit << j;
443 }
444 dprintk("(%02X) ", si[i]);
445 }
446 dprintk("\n");
447}
448
449static inline void rwa010_global_init(void)
450{
451 WRITE_RWA(6, 2); // Assign a card no = 2
452
453 dprintk("Card no = %d\n", inb(0x203));
454
455 /* disable the modem section of the chip */
456 WRITE_RWA(7, 3);
457 WRITE_RWA(0x30, 0);
458
459 /* disable the cdrom section of the chip */
460 WRITE_RWA(7, 4);
461 WRITE_RWA(0x30, 0);
462
463 /* disable the MPU-401 section of the chip */
464 WRITE_RWA(7, 2);
465 WRITE_RWA(0x30, 0);
466}
467
468static inline void rwa010_game_port_init(void)
469{
470 int i;
471
472 WRITE_RWA(7, 5);
473
474 dprintk("Slider base: ");
475 WRITE_RWA(0x61, 1);
476 i = inb(0x203);
477
478 WRITE_RWA(0x60, 2);
479 dprintk("%02X%02X (201)\n", inb(0x203), i);
480
481 WRITE_RWA(0x30, 1);
482}
483
484static inline void rwa010_waveartist_init(int base, int irq, int dma)
485{
486 int i;
487
488 WRITE_RWA(7, 0);
489
490 dprintk("WaveArtist base: ");
491 WRITE_RWA(0x61, base & 255);
492 i = inb(0x203);
493
494 WRITE_RWA(0x60, base >> 8);
495 dprintk("%02X%02X (%X),", inb(0x203), i, base);
496
497 WRITE_RWA(0x70, irq);
498 dprintk(" irq: %d (%d),", inb(0x203), irq);
499
500 WRITE_RWA(0x74, dma);
501 dprintk(" dma: %d (%d)\n", inb(0x203), dma);
502
503 WRITE_RWA(0x30, 1);
504}
505
506static inline void rwa010_soundblaster_init(int sb_base, int al_base, int irq, int dma)
507{
508 int i;
509
510 WRITE_RWA(7, 1);
511
512 dprintk("SoundBlaster base: ");
513 WRITE_RWA(0x61, sb_base & 255);
514 i = inb(0x203);
515
516 WRITE_RWA(0x60, sb_base >> 8);
517 dprintk("%02X%02X (%X),", inb(0x203), i, sb_base);
518
519 dprintk(" irq: ");
520 WRITE_RWA(0x70, irq);
521 dprintk("%d (%d),", inb(0x203), irq);
522
523 dprintk(" 8-bit DMA: ");
524 WRITE_RWA(0x74, dma);
525 dprintk("%d (%d)\n", inb(0x203), dma);
526
527 dprintk("AdLib base: ");
528 WRITE_RWA(0x63, al_base & 255);
529 i = inb(0x203);
530
531 WRITE_RWA(0x62, al_base >> 8);
532 dprintk("%02X%02X (%X)\n", inb(0x203), i, al_base);
533
534 WRITE_RWA(0x30, 1);
535}
536
537static void rwa010_soundblaster_reset(void)
538{
539 int i;
540
541 outb(1, 0x226);
542 udelay(3);
543 outb(0, 0x226);
544
545 for (i = 0; i < 5; i++) {
546 if (inb(0x22e) & 0x80)
547 break;
548 mdelay(1);
549 }
550 if (i == 5)
551 printk("SoundBlaster: DSP reset failed\n");
552
553 dprintk("SoundBlaster DSP reset: %02X (AA)\n", inb(0x22a));
554
555 for (i = 0; i < 5; i++) {
556 if ((inb(0x22c) & 0x80) == 0)
557 break;
558 mdelay(1);
559 }
560
561 if (i == 5)
562 printk("SoundBlaster: DSP not ready\n");
563 else {
564 outb(0xe1, 0x22c);
565
566 dprintk("SoundBlaster DSP id: ");
567 i = inb(0x22a);
568 udelay(1);
569 i |= inb(0x22a) << 8;
570 dprintk("%04X\n", i);
571
572 for (i = 0; i < 5; i++) {
573 if ((inb(0x22c) & 0x80) == 0)
574 break;
575 mdelay(1);
576 }
577
578 if (i == 5)
579 printk("SoundBlaster: could not turn speaker off\n");
580
581 outb(0xd3, 0x22c);
582 }
583
584 /* turn on OPL3 */
585 outb(5, 0x38a);
586 outb(1, 0x38b);
587}
588
589static void __init rwa010_init(void)
590{
591 rwa010_unlock();
592 rwa010_read_ident();
593 rwa010_global_init();
594 rwa010_game_port_init();
595 rwa010_waveartist_init(0x250, 3, 7);
596 rwa010_soundblaster_init(0x220, 0x388, 3, 1);
597 rwa010_soundblaster_reset();
598}
599
600EXPORT_SYMBOL(gpio_lock);
601EXPORT_SYMBOL(gpio_modify_op);
602EXPORT_SYMBOL(gpio_modify_io);
603EXPORT_SYMBOL(cpld_modify);
604
605/*
606 * Initialise any other hardware after we've got the PCI bus
607 * initialised. We may need the PCI bus to talk to this other
608 * hardware.
609 */
610static int __init nw_hw_init(void)
611{
612 if (machine_is_netwinder()) {
613 unsigned long flags;
614
615 wb977_init();
616 cpld_init();
617 rwa010_init();
618
619 spin_lock_irqsave(&gpio_lock, flags);
620 gpio_modify_op(GPIO_RED_LED|GPIO_GREEN_LED, DEFAULT_LEDS);
621 spin_unlock_irqrestore(&gpio_lock, flags);
622 }
623 return 0;
624}
625
626__initcall(nw_hw_init);
627
628/*
629 * Older NeTTroms either do not provide a parameters
630 * page, or they don't supply correct information in
631 * the parameter page.
632 */
633static void __init
634fixup_netwinder(struct machine_desc *desc, struct tag *tags,
635 char **cmdline, struct meminfo *mi)
636{
637#ifdef CONFIG_ISAPNP
638 extern int isapnp_disable;
639
640 /*
641 * We must not use the kernels ISAPnP code
642 * on the NetWinder - it will reset the settings
643 * for the WaveArtist chip and render it inoperable.
644 */
645 isapnp_disable = 1;
646#endif
647}
648
649MACHINE_START(NETWINDER, "Rebel-NetWinder")
650 MAINTAINER("Russell King/Rebel.com")
651 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
652 BOOT_PARAMS(0x00000100)
653 VIDEO(0x000a0000, 0x000bffff)
654 DISABLE_PARPORT(0)
655 DISABLE_PARPORT(2)
656 FIXUP(fixup_netwinder)
657 MAPIO(footbridge_map_io)
658 INITIRQ(footbridge_init_irq)
659 .timer = &isa_timer,
660MACHINE_END
diff --git a/arch/arm/mach-footbridge/netwinder-leds.c b/arch/arm/mach-footbridge/netwinder-leds.c
new file mode 100644
index 000000000000..7451fc07b85a
--- /dev/null
+++ b/arch/arm/mach-footbridge/netwinder-leds.c
@@ -0,0 +1,141 @@
1/*
2 * linux/arch/arm/mach-footbridge/netwinder-leds.c
3 *
4 * Copyright (C) 1998-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * NetWinder LED control routines.
11 *
12 * The Netwinder uses the leds as follows:
13 * - Green - toggles state every 50 timer interrupts
14 * - Red - On if the system is not idle
15 *
16 * Changelog:
17 * 02-05-1999 RMK Various cleanups
18 */
19#include <linux/config.h>
20#include <linux/module.h>
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/spinlock.h>
24
25#include <asm/hardware.h>
26#include <asm/leds.h>
27#include <asm/mach-types.h>
28#include <asm/system.h>
29
30#define LED_STATE_ENABLED 1
31#define LED_STATE_CLAIMED 2
32static char led_state;
33static char hw_led_state;
34
35static DEFINE_SPINLOCK(leds_lock);
36extern spinlock_t gpio_lock;
37
38static void netwinder_leds_event(led_event_t evt)
39{
40 unsigned long flags;
41
42 spin_lock_irqsave(&leds_lock, flags);
43
44 switch (evt) {
45 case led_start:
46 led_state |= LED_STATE_ENABLED;
47 hw_led_state = GPIO_GREEN_LED;
48 break;
49
50 case led_stop:
51 led_state &= ~LED_STATE_ENABLED;
52 break;
53
54 case led_claim:
55 led_state |= LED_STATE_CLAIMED;
56 hw_led_state = 0;
57 break;
58
59 case led_release:
60 led_state &= ~LED_STATE_CLAIMED;
61 hw_led_state = 0;
62 break;
63
64#ifdef CONFIG_LEDS_TIMER
65 case led_timer:
66 if (!(led_state & LED_STATE_CLAIMED))
67 hw_led_state ^= GPIO_GREEN_LED;
68 break;
69#endif
70
71#ifdef CONFIG_LEDS_CPU
72 case led_idle_start:
73 if (!(led_state & LED_STATE_CLAIMED))
74 hw_led_state &= ~GPIO_RED_LED;
75 break;
76
77 case led_idle_end:
78 if (!(led_state & LED_STATE_CLAIMED))
79 hw_led_state |= GPIO_RED_LED;
80 break;
81#endif
82
83 case led_halted:
84 if (!(led_state & LED_STATE_CLAIMED))
85 hw_led_state |= GPIO_RED_LED;
86 break;
87
88 case led_green_on:
89 if (led_state & LED_STATE_CLAIMED)
90 hw_led_state |= GPIO_GREEN_LED;
91 break;
92
93 case led_green_off:
94 if (led_state & LED_STATE_CLAIMED)
95 hw_led_state &= ~GPIO_GREEN_LED;
96 break;
97
98 case led_amber_on:
99 if (led_state & LED_STATE_CLAIMED)
100 hw_led_state |= GPIO_GREEN_LED | GPIO_RED_LED;
101 break;
102
103 case led_amber_off:
104 if (led_state & LED_STATE_CLAIMED)
105 hw_led_state &= ~(GPIO_GREEN_LED | GPIO_RED_LED);
106 break;
107
108 case led_red_on:
109 if (led_state & LED_STATE_CLAIMED)
110 hw_led_state |= GPIO_RED_LED;
111 break;
112
113 case led_red_off:
114 if (led_state & LED_STATE_CLAIMED)
115 hw_led_state &= ~GPIO_RED_LED;
116 break;
117
118 default:
119 break;
120 }
121
122 spin_unlock_irqrestore(&leds_lock, flags);
123
124 if (led_state & LED_STATE_ENABLED) {
125 spin_lock_irqsave(&gpio_lock, flags);
126 gpio_modify_op(GPIO_RED_LED | GPIO_GREEN_LED, hw_led_state);
127 spin_unlock_irqrestore(&gpio_lock, flags);
128 }
129}
130
131static int __init leds_init(void)
132{
133 if (machine_is_netwinder())
134 leds_event = netwinder_leds_event;
135
136 leds_event(led_start);
137
138 return 0;
139}
140
141__initcall(leds_init);
diff --git a/arch/arm/mach-footbridge/netwinder-pci.c b/arch/arm/mach-footbridge/netwinder-pci.c
new file mode 100644
index 000000000000..e263d6d54a0f
--- /dev/null
+++ b/arch/arm/mach-footbridge/netwinder-pci.c
@@ -0,0 +1,62 @@
1/*
2 * linux/arch/arm/mach-footbridge/netwinder-pci.c
3 *
4 * PCI bios-type initialisation for PCI machines
5 *
6 * Bits taken from various places.
7 */
8#include <linux/kernel.h>
9#include <linux/pci.h>
10#include <linux/init.h>
11
12#include <asm/irq.h>
13#include <asm/mach/pci.h>
14#include <asm/mach-types.h>
15
16/*
17 * We now use the slot ID instead of the device identifiers to select
18 * which interrupt is routed where.
19 */
20static int __init netwinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
21{
22 switch (slot) {
23 case 0: /* host bridge */
24 return 0;
25
26 case 9: /* CyberPro */
27 return IRQ_NETWINDER_VGA;
28
29 case 10: /* DC21143 */
30 return IRQ_NETWINDER_ETHER100;
31
32 case 12: /* Winbond 553 */
33 return IRQ_ISA_HARDDISK1;
34
35 case 13: /* Winbond 89C940F */
36 return IRQ_NETWINDER_ETHER10;
37
38 default:
39 printk(KERN_ERR "PCI: unknown device in slot %s\n",
40 pci_name(dev));
41 return 0;
42 }
43}
44
45static struct hw_pci netwinder_pci __initdata = {
46 .swizzle = pci_std_swizzle,
47 .map_irq = netwinder_map_irq,
48 .nr_controllers = 1,
49 .setup = dc21285_setup,
50 .scan = dc21285_scan_bus,
51 .preinit = dc21285_preinit,
52 .postinit = dc21285_postinit,
53};
54
55static int __init netwinder_pci_init(void)
56{
57 if (machine_is_netwinder())
58 pci_common_init(&netwinder_pci);
59 return 0;
60}
61
62subsys_initcall(netwinder_pci_init);
diff --git a/arch/arm/mach-footbridge/personal-pci.c b/arch/arm/mach-footbridge/personal-pci.c
new file mode 100644
index 000000000000..d5fca95afdad
--- /dev/null
+++ b/arch/arm/mach-footbridge/personal-pci.c
@@ -0,0 +1,56 @@
1/*
2 * linux/arch/arm/mach-footbridge/personal-pci.c
3 *
4 * PCI bios-type initialisation for PCI machines
5 *
6 * Bits taken from various places.
7 */
8#include <linux/kernel.h>
9#include <linux/pci.h>
10#include <linux/init.h>
11
12#include <asm/irq.h>
13#include <asm/mach/pci.h>
14#include <asm/mach-types.h>
15
16static int irqmap_personal_server[] __initdata = {
17 IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0,
18 IRQ_DOORBELLHOST, IRQ_DMA1, IRQ_DMA2, IRQ_PCI
19};
20
21static int __init personal_server_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
22{
23 unsigned char line;
24
25 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &line);
26
27 if (line > 0x40 && line <= 0x5f) {
28 /* line corresponds to the bit controlling this interrupt
29 * in the footbridge. Ignore the first 8 interrupt bits,
30 * look up the rest in the map. IN0 is bit number 8
31 */
32 return irqmap_personal_server[(line & 0x1f) - 8];
33 } else if (line == 0) {
34 /* no interrupt */
35 return 0;
36 } else
37 return irqmap_personal_server[(line - 1) & 3];
38}
39
40static struct hw_pci personal_server_pci __initdata = {
41 .map_irq = personal_server_map_irq,
42 .nr_controllers = 1,
43 .setup = dc21285_setup,
44 .scan = dc21285_scan_bus,
45 .preinit = dc21285_preinit,
46 .postinit = dc21285_postinit,
47};
48
49static int __init personal_pci_init(void)
50{
51 if (machine_is_personal_server())
52 pci_common_init(&personal_server_pci);
53 return 0;
54}
55
56subsys_initcall(personal_pci_init);
diff --git a/arch/arm/mach-footbridge/personal.c b/arch/arm/mach-footbridge/personal.c
new file mode 100644
index 000000000000..415086d7bbee
--- /dev/null
+++ b/arch/arm/mach-footbridge/personal.c
@@ -0,0 +1,23 @@
1/*
2 * linux/arch/arm/mach-footbridge/personal.c
3 *
4 * Personal server (Skiff) machine fixup
5 */
6#include <linux/init.h>
7
8#include <asm/hardware/dec21285.h>
9#include <asm/mach-types.h>
10
11#include <asm/mach/arch.h>
12
13#include "common.h"
14
15MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer")
16 MAINTAINER("Jamey Hicks / George France")
17 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
18 BOOT_PARAMS(0x00000100)
19 MAPIO(footbridge_map_io)
20 INITIRQ(footbridge_init_irq)
21 .timer = &footbridge_timer,
22MACHINE_END
23
diff --git a/arch/arm/mach-footbridge/time.c b/arch/arm/mach-footbridge/time.c
new file mode 100644
index 000000000000..2c64a0b0502e
--- /dev/null
+++ b/arch/arm/mach-footbridge/time.c
@@ -0,0 +1,180 @@
1/*
2 * linux/include/asm-arm/arch-ebsa285/time.h
3 *
4 * Copyright (C) 1998 Russell King.
5 * Copyright (C) 1998 Phil Blundell
6 *
7 * CATS has a real-time clock, though the evaluation board doesn't.
8 *
9 * Changelog:
10 * 21-Mar-1998 RMK Created
11 * 27-Aug-1998 PJB CATS support
12 * 28-Dec-1998 APH Made leds optional
13 * 20-Jan-1999 RMK Started merge of EBSA285, CATS and NetWinder
14 * 16-Mar-1999 RMK More support for EBSA285-like machines with RTCs in
15 */
16
17#define RTC_PORT(x) (rtc_base+(x))
18#define RTC_ALWAYS_BCD 0
19
20#include <linux/timex.h>
21#include <linux/init.h>
22#include <linux/sched.h>
23#include <linux/mc146818rtc.h>
24#include <linux/bcd.h>
25
26#include <asm/hardware.h>
27#include <asm/io.h>
28
29#include <asm/mach/time.h>
30#include "common.h"
31
32static int rtc_base;
33
34static unsigned long __init get_isa_cmos_time(void)
35{
36 unsigned int year, mon, day, hour, min, sec;
37 int i;
38
39 // check to see if the RTC makes sense.....
40 if ((CMOS_READ(RTC_VALID) & RTC_VRT) == 0)
41 return mktime(1970, 1, 1, 0, 0, 0);
42
43 /* The Linux interpretation of the CMOS clock register contents:
44 * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
45 * RTC registers show the second which has precisely just started.
46 * Let's hope other operating systems interpret the RTC the same way.
47 */
48 /* read RTC exactly on falling edge of update flag */
49 for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
50 if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
51 break;
52
53 for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */
54 if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
55 break;
56
57 do { /* Isn't this overkill ? UIP above should guarantee consistency */
58 sec = CMOS_READ(RTC_SECONDS);
59 min = CMOS_READ(RTC_MINUTES);
60 hour = CMOS_READ(RTC_HOURS);
61 day = CMOS_READ(RTC_DAY_OF_MONTH);
62 mon = CMOS_READ(RTC_MONTH);
63 year = CMOS_READ(RTC_YEAR);
64 } while (sec != CMOS_READ(RTC_SECONDS));
65
66 if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
67 BCD_TO_BIN(sec);
68 BCD_TO_BIN(min);
69 BCD_TO_BIN(hour);
70 BCD_TO_BIN(day);
71 BCD_TO_BIN(mon);
72 BCD_TO_BIN(year);
73 }
74 if ((year += 1900) < 1970)
75 year += 100;
76 return mktime(year, mon, day, hour, min, sec);
77}
78
79static int set_isa_cmos_time(void)
80{
81 int retval = 0;
82 int real_seconds, real_minutes, cmos_minutes;
83 unsigned char save_control, save_freq_select;
84 unsigned long nowtime = xtime.tv_sec;
85
86 save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */
87 CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
88
89 save_freq_select = CMOS_READ(RTC_FREQ_SELECT); /* stop and reset prescaler */
90 CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
91
92 cmos_minutes = CMOS_READ(RTC_MINUTES);
93 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
94 BCD_TO_BIN(cmos_minutes);
95
96 /*
97 * since we're only adjusting minutes and seconds,
98 * don't interfere with hour overflow. This avoids
99 * messing with unknown time zones but requires your
100 * RTC not to be off by more than 15 minutes
101 */
102 real_seconds = nowtime % 60;
103 real_minutes = nowtime / 60;
104 if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
105 real_minutes += 30; /* correct for half hour time zone */
106 real_minutes %= 60;
107
108 if (abs(real_minutes - cmos_minutes) < 30) {
109 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
110 BIN_TO_BCD(real_seconds);
111 BIN_TO_BCD(real_minutes);
112 }
113 CMOS_WRITE(real_seconds,RTC_SECONDS);
114 CMOS_WRITE(real_minutes,RTC_MINUTES);
115 } else
116 retval = -1;
117
118 /* The following flags have to be released exactly in this order,
119 * otherwise the DS12887 (popular MC146818A clone with integrated
120 * battery and quartz) will not reset the oscillator and will not
121 * update precisely 500 ms later. You won't find this mentioned in
122 * the Dallas Semiconductor data sheets, but who believes data
123 * sheets anyway ... -- Markus Kuhn
124 */
125 CMOS_WRITE(save_control, RTC_CONTROL);
126 CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
127
128 return retval;
129}
130
131void __init isa_rtc_init(void)
132{
133 if (machine_is_co285() ||
134 machine_is_personal_server())
135 /*
136 * Add-in 21285s shouldn't access the RTC
137 */
138 rtc_base = 0;
139 else
140 rtc_base = 0x70;
141
142 if (rtc_base) {
143 int reg_d, reg_b;
144
145 /*
146 * Probe for the RTC.
147 */
148 reg_d = CMOS_READ(RTC_REG_D);
149
150 /*
151 * make sure the divider is set
152 */
153 CMOS_WRITE(RTC_REF_CLCK_32KHZ, RTC_REG_A);
154
155 /*
156 * Set control reg B
157 * (24 hour mode, update enabled)
158 */
159 reg_b = CMOS_READ(RTC_REG_B) & 0x7f;
160 reg_b |= 2;
161 CMOS_WRITE(reg_b, RTC_REG_B);
162
163 if ((CMOS_READ(RTC_REG_A) & 0x7f) == RTC_REF_CLCK_32KHZ &&
164 CMOS_READ(RTC_REG_B) == reg_b) {
165 struct timespec tv;
166
167 /*
168 * We have a RTC. Check the battery
169 */
170 if ((reg_d & 0x80) == 0)
171 printk(KERN_WARNING "RTC: *** warning: CMOS battery bad\n");
172
173 tv.tv_nsec = 0;
174 tv.tv_sec = get_isa_cmos_time();
175 do_settimeofday(&tv);
176 set_rtc = set_isa_cmos_time;
177 } else
178 rtc_base = 0;
179 }
180}
diff --git a/arch/arm/mach-h720x/Kconfig b/arch/arm/mach-h720x/Kconfig
new file mode 100644
index 000000000000..9b6982efbd22
--- /dev/null
+++ b/arch/arm/mach-h720x/Kconfig
@@ -0,0 +1,38 @@
1if ARCH_H720X
2
3menu "h720x Implementations"
4
5config ARCH_H7201
6 bool "gms30c7201"
7 depends on ARCH_H720X
8 select CPU_H7201
9 help
10 Say Y here if you are using the Hynix GMS30C7201 Reference Board
11
12config ARCH_H7202
13 bool "hms30c7202"
14 select CPU_H7202
15 depends on ARCH_H720X
16 help
17 Say Y here if you are using the Hynix HMS30C7202 Reference Board
18
19endmenu
20
21config CPU_H7201
22 bool
23 help
24 Select code specific to h7201 variants
25
26config CPU_H7202
27 bool
28 help
29 Select code specific to h7202 variants
30config H7202_SERIAL23
31 depends on CPU_H7202
32 bool "Use serial ports 2+3"
33 help
34 Say Y here if you wish to use serial ports 2+3. They share their
35 pins with the keyboard matrix controller, so you have to decide.
36
37
38endif
diff --git a/arch/arm/mach-h720x/Makefile b/arch/arm/mach-h720x/Makefile
new file mode 100644
index 000000000000..e4cf728948eb
--- /dev/null
+++ b/arch/arm/mach-h720x/Makefile
@@ -0,0 +1,16 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Common support
6obj-y := common.o
7obj-m :=
8obj-n :=
9obj- :=
10
11# Specific board support
12
13obj-$(CONFIG_ARCH_H7201) += h7201-eval.o
14obj-$(CONFIG_ARCH_H7202) += h7202-eval.o
15obj-$(CONFIG_CPU_H7201) += cpu-h7201.o
16obj-$(CONFIG_CPU_H7202) += cpu-h7202.o
diff --git a/arch/arm/mach-h720x/Makefile.boot b/arch/arm/mach-h720x/Makefile.boot
new file mode 100644
index 000000000000..52984017bd91
--- /dev/null
+++ b/arch/arm/mach-h720x/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-$(CONFIG_ARCH_H720X) := 0x40008000
2
diff --git a/arch/arm/mach-h720x/common.c b/arch/arm/mach-h720x/common.c
new file mode 100644
index 000000000000..96aa3af70d86
--- /dev/null
+++ b/arch/arm/mach-h720x/common.c
@@ -0,0 +1,247 @@
1/*
2 * linux/arch/arm/mach-h720x/common.c
3 *
4 * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de>
5 * 2003 Robert Schwebel <r.schwebel@pengutronix.de>
6 * 2004 Sascha Hauer <s.hauer@pengutronix.de>
7 *
8 * common stuff for Hynix h720x processors
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 */
15
16#include <linux/sched.h>
17#include <linux/slab.h>
18#include <linux/mman.h>
19#include <linux/init.h>
20#include <linux/interrupt.h>
21
22#include <asm/page.h>
23#include <asm/pgtable.h>
24#include <asm/dma.h>
25#include <asm/io.h>
26#include <asm/hardware.h>
27#include <asm/irq.h>
28#include <asm/mach/irq.h>
29#include <asm/mach/map.h>
30#include <asm/arch/irqs.h>
31
32#include <asm/mach/dma.h>
33
34#if 0
35#define IRQDBG(args...) printk(args)
36#else
37#define IRQDBG(args...) do {} while(0)
38#endif
39
40void __init arch_dma_init(dma_t *dma)
41{
42}
43
44/*
45 * Return usecs since last timer reload
46 * (timercount * (usecs perjiffie)) / (ticks per jiffie)
47 */
48unsigned long h720x_gettimeoffset(void)
49{
50 return (CPU_REG (TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH;
51}
52
53/*
54 * mask Global irq's
55 */
56static void mask_global_irq (unsigned int irq )
57{
58 CPU_REG (IRQC_VIRT, IRQC_IER) &= ~(1 << irq);
59}
60
61/*
62 * unmask Global irq's
63 */
64static void unmask_global_irq (unsigned int irq )
65{
66 CPU_REG (IRQC_VIRT, IRQC_IER) |= (1 << irq);
67}
68
69
70/*
71 * ack GPIO irq's
72 * Ack only for edge triggered int's valid
73 */
74static void inline ack_gpio_irq(u32 irq)
75{
76 u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq));
77 u32 bit = IRQ_TO_BIT(irq);
78 if ( (CPU_REG (reg_base, GPIO_EDGE) & bit))
79 CPU_REG (reg_base, GPIO_CLR) = bit;
80}
81
82/*
83 * mask GPIO irq's
84 */
85static void inline mask_gpio_irq(u32 irq)
86{
87 u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq));
88 u32 bit = IRQ_TO_BIT(irq);
89 CPU_REG (reg_base, GPIO_MASK) &= ~bit;
90}
91
92/*
93 * unmask GPIO irq's
94 */
95static void inline unmask_gpio_irq(u32 irq)
96{
97 u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq));
98 u32 bit = IRQ_TO_BIT(irq);
99 CPU_REG (reg_base, GPIO_MASK) |= bit;
100}
101
102static void
103h720x_gpio_handler(unsigned int mask, unsigned int irq,
104 struct irqdesc *desc, struct pt_regs *regs)
105{
106 IRQDBG("%s irq: %d\n",__FUNCTION__,irq);
107 desc = irq_desc + irq;
108 while (mask) {
109 if (mask & 1) {
110 IRQDBG("handling irq %d\n", irq);
111 desc->handle(irq, desc, regs);
112 }
113 irq++;
114 desc++;
115 mask >>= 1;
116 }
117}
118
119static void
120h720x_gpioa_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
121 struct pt_regs *regs)
122{
123 unsigned int mask, irq;
124
125 mask = CPU_REG(GPIO_A_VIRT,GPIO_STAT);
126 irq = IRQ_CHAINED_GPIOA(0);
127 IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq);
128 h720x_gpio_handler(mask, irq, desc, regs);
129}
130
131static void
132h720x_gpiob_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
133 struct pt_regs *regs)
134{
135 unsigned int mask, irq;
136 mask = CPU_REG(GPIO_B_VIRT,GPIO_STAT);
137 irq = IRQ_CHAINED_GPIOB(0);
138 IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq);
139 h720x_gpio_handler(mask, irq, desc, regs);
140}
141
142static void
143h720x_gpioc_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
144 struct pt_regs *regs)
145{
146 unsigned int mask, irq;
147
148 mask = CPU_REG(GPIO_C_VIRT,GPIO_STAT);
149 irq = IRQ_CHAINED_GPIOC(0);
150 IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq);
151 h720x_gpio_handler(mask, irq, desc, regs);
152}
153
154static void
155h720x_gpiod_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
156 struct pt_regs *regs)
157{
158 unsigned int mask, irq;
159
160 mask = CPU_REG(GPIO_D_VIRT,GPIO_STAT);
161 irq = IRQ_CHAINED_GPIOD(0);
162 IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq);
163 h720x_gpio_handler(mask, irq, desc, regs);
164}
165
166#ifdef CONFIG_CPU_H7202
167static void
168h720x_gpioe_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
169 struct pt_regs *regs)
170{
171 unsigned int mask, irq;
172
173 mask = CPU_REG(GPIO_E_VIRT,GPIO_STAT);
174 irq = IRQ_CHAINED_GPIOE(0);
175 IRQDBG("%s mask: 0x%08x irq: %d\n",__FUNCTION__,mask,irq);
176 h720x_gpio_handler(mask, irq, desc, regs);
177}
178#endif
179
180static struct irqchip h720x_global_chip = {
181 .ack = mask_global_irq,
182 .mask = mask_global_irq,
183 .unmask = unmask_global_irq,
184};
185
186static struct irqchip h720x_gpio_chip = {
187 .ack = ack_gpio_irq,
188 .mask = mask_gpio_irq,
189 .unmask = unmask_gpio_irq,
190};
191
192/*
193 * Initialize IRQ's, mask all, enable multiplexed irq's
194 */
195void __init h720x_init_irq (void)
196{
197 int irq;
198
199 /* Mask global irq's */
200 CPU_REG (IRQC_VIRT, IRQC_IER) = 0x0;
201
202 /* Mask all multiplexed irq's */
203 CPU_REG (GPIO_A_VIRT, GPIO_MASK) = 0x0;
204 CPU_REG (GPIO_B_VIRT, GPIO_MASK) = 0x0;
205 CPU_REG (GPIO_C_VIRT, GPIO_MASK) = 0x0;
206 CPU_REG (GPIO_D_VIRT, GPIO_MASK) = 0x0;
207
208 /* Initialize global IRQ's, fast path */
209 for (irq = 0; irq < NR_GLBL_IRQS; irq++) {
210 set_irq_chip(irq, &h720x_global_chip);
211 set_irq_handler(irq, do_level_IRQ);
212 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
213 }
214
215 /* Initialize multiplexed IRQ's, slow path */
216 for (irq = IRQ_CHAINED_GPIOA(0) ; irq <= IRQ_CHAINED_GPIOD(31); irq++) {
217 set_irq_chip(irq, &h720x_gpio_chip);
218 set_irq_handler(irq, do_edge_IRQ);
219 set_irq_flags(irq, IRQF_VALID );
220 }
221 set_irq_chained_handler(IRQ_GPIOA, h720x_gpioa_demux_handler);
222 set_irq_chained_handler(IRQ_GPIOB, h720x_gpiob_demux_handler);
223 set_irq_chained_handler(IRQ_GPIOC, h720x_gpioc_demux_handler);
224 set_irq_chained_handler(IRQ_GPIOD, h720x_gpiod_demux_handler);
225
226#ifdef CONFIG_CPU_H7202
227 for (irq = IRQ_CHAINED_GPIOE(0) ; irq <= IRQ_CHAINED_GPIOE(31); irq++) {
228 set_irq_chip(irq, &h720x_gpio_chip);
229 set_irq_handler(irq, do_edge_IRQ);
230 set_irq_flags(irq, IRQF_VALID );
231 }
232 set_irq_chained_handler(IRQ_GPIOE, h720x_gpioe_demux_handler);
233#endif
234
235 /* Enable multiplexed irq's */
236 CPU_REG (IRQC_VIRT, IRQC_IER) = IRQ_ENA_MUX;
237}
238
239static struct map_desc h720x_io_desc[] __initdata = {
240 { IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE },
241};
242
243/* Initialize io tables */
244void __init h720x_map_io(void)
245{
246 iotable_init(h720x_io_desc,ARRAY_SIZE(h720x_io_desc));
247}
diff --git a/arch/arm/mach-h720x/common.h b/arch/arm/mach-h720x/common.h
new file mode 100644
index 000000000000..d8798dbc44f8
--- /dev/null
+++ b/arch/arm/mach-h720x/common.h
@@ -0,0 +1,29 @@
1/*
2 * linux/arch/arm/mach-h720x/common.h
3 *
4 * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de>
5 * 2003 Robert Schwebel <r.schwebel@pengutronix.de>
6 * 2004 Sascha Hauer <s.hauer@pengutronix.de>
7 *
8 * Architecture specific stuff for Hynix GMS30C7201 development board
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 */
15
16extern unsigned long h720x_gettimeoffset(void);
17extern void __init h720x_init_irq (void);
18extern void __init h720x_map_io(void);
19
20#ifdef CONFIG_ARCH_H7202
21extern struct sys_timer h7202_timer;
22extern void __init init_hw_h7202(void);
23extern void __init h7202_init_irq (void);
24extern void __init h7202_init_time(void);
25#endif
26
27#ifdef CONFIG_ARCH_H7201
28extern struct sys_timer h7201_timer;
29#endif
diff --git a/arch/arm/mach-h720x/cpu-h7201.c b/arch/arm/mach-h720x/cpu-h7201.c
new file mode 100644
index 000000000000..743656881ed6
--- /dev/null
+++ b/arch/arm/mach-h720x/cpu-h7201.c
@@ -0,0 +1,64 @@
1/*
2 * linux/arch/arm/mach-h720x/cpu-h7201.c
3 *
4 * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de>
5 * 2003 Robert Schwebel <r.schwebel@pengutronix.de>
6 * 2004 Sascha Hauer <s.hauer@pengutronix.de>
7 *
8 * processor specific stuff for the Hynix h7201
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 */
15
16#include <linux/init.h>
17#include <linux/interrupt.h>
18#include <linux/module.h>
19#include <asm/types.h>
20#include <asm/hardware.h>
21#include <asm/irq.h>
22#include <asm/arch/irqs.h>
23#include <asm/mach/irq.h>
24#include <asm/mach/time.h>
25#include "common.h"
26/*
27 * Timer interrupt handler
28 */
29static irqreturn_t
30h7201_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
31{
32 write_seqlock(&xtime_lock);
33
34 CPU_REG (TIMER_VIRT, TIMER_TOPSTAT);
35 timer_tick(regs);
36
37 write_sequnlock(&xtime_lock);
38
39 return IRQ_HANDLED;
40}
41
42static struct irqaction h7201_timer_irq = {
43 .name = "h7201 Timer Tick",
44 .flags = SA_INTERRUPT,
45 .handler = h7201_timer_interrupt
46};
47
48/*
49 * Setup TIMER0 as system timer
50 */
51void __init h7201_init_time(void)
52{
53 CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
54 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
55 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
56 CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT;
57
58 setup_irq(IRQ_TIMER0, &h7201_timer_irq);
59}
60
61struct sys_timer h7201_timer = {
62 .init = h7201_init_time,
63 .offset = h720x_gettimeoffset,
64};
diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c
new file mode 100644
index 000000000000..21b8fb6122cd
--- /dev/null
+++ b/arch/arm/mach-h720x/cpu-h7202.c
@@ -0,0 +1,228 @@
1/*
2 * linux/arch/arm/mach-h720x/cpu-h7202.c
3 *
4 * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de>
5 * 2003 Robert Schwebel <r.schwebel@pengutronix.de>
6 * 2004 Sascha Hauer <s.hauer@pengutronix.de>
7 *
8 * processor specific stuff for the Hynix h7202
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 */
15
16#include <linux/init.h>
17#include <linux/interrupt.h>
18#include <linux/module.h>
19#include <asm/types.h>
20#include <asm/hardware.h>
21#include <asm/irq.h>
22#include <asm/arch/irqs.h>
23#include <asm/mach/irq.h>
24#include <asm/mach/time.h>
25#include <linux/device.h>
26#include <linux/serial_8250.h>
27#include "common.h"
28
29static struct resource h7202ps2_resources[] = {
30 [0] = {
31 .start = 0x8002c000,
32 .end = 0x8002c040,
33 .flags = IORESOURCE_MEM,
34 },
35 [1] = {
36 .start = IRQ_PS2,
37 .end = IRQ_PS2,
38 .flags = IORESOURCE_IRQ,
39 },
40};
41
42static struct platform_device h7202ps2_device = {
43 .name = "h7202ps2",
44 .id = -1,
45 .num_resources = ARRAY_SIZE(h7202ps2_resources),
46 .resource = h7202ps2_resources,
47};
48
49static struct plat_serial8250_port serial_platform_data[] = {
50 {
51 .membase = (void*)SERIAL0_VIRT,
52 .mapbase = SERIAL0_BASE,
53 .irq = IRQ_UART0,
54 .uartclk = 2*1843200,
55 .regshift = 2,
56 .iotype = UPIO_MEM,
57 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
58 },
59 {
60 .membase = (void*)SERIAL1_VIRT,
61 .mapbase = SERIAL1_BASE,
62 .irq = IRQ_UART1,
63 .uartclk = 2*1843200,
64 .regshift = 2,
65 .iotype = UPIO_MEM,
66 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
67 },
68#ifdef CONFIG_H7202_SERIAL23
69 {
70 .membase = (void*)SERIAL2_VIRT,
71 .mapbase = SERIAL2_BASE,
72 .irq = IRQ_UART2,
73 .uartclk = 2*1843200,
74 .regshift = 2,
75 .iotype = UPIO_MEM,
76 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
77 },
78 {
79 .membase = (void*)SERIAL3_VIRT,
80 .mapbase = SERIAL3_BASE,
81 .irq = IRQ_UART3,
82 .uartclk = 2*1843200,
83 .regshift = 2,
84 .iotype = UPIO_MEM,
85 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
86 },
87#endif
88 { },
89};
90
91static struct platform_device serial_device = {
92 .name = "serial8250",
93 .id = 0,
94 .dev = {
95 .platform_data = serial_platform_data,
96 },
97};
98
99static struct platform_device *devices[] __initdata = {
100 &h7202ps2_device,
101 &serial_device,
102};
103
104/* Although we have two interrupt lines for the timers, we only have one
105 * status register which clears all pending timer interrupts on reading. So
106 * we have to handle all timer interrupts in one place.
107 */
108static void
109h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
110 struct pt_regs *regs)
111{
112 unsigned int mask, irq;
113
114 mask = CPU_REG (TIMER_VIRT, TIMER_TOPSTAT);
115
116 if ( mask & TSTAT_T0INT ) {
117 write_seqlock(&xtime_lock);
118 timer_tick(regs);
119 write_sequnlock(&xtime_lock);
120 if( mask == TSTAT_T0INT )
121 return;
122 }
123
124 mask >>= 1;
125 irq = IRQ_TIMER1;
126 desc = irq_desc + irq;
127 while (mask) {
128 if (mask & 1)
129 desc->handle(irq, desc, regs);
130 irq++;
131 desc++;
132 mask >>= 1;
133 }
134}
135
136/*
137 * Timer interrupt handler
138 */
139static irqreturn_t
140h7202_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
141{
142 h7202_timerx_demux_handler(0, NULL, regs);
143 return IRQ_HANDLED;
144}
145
146/*
147 * mask multiplexed timer irq's
148 */
149static void inline mask_timerx_irq (u32 irq)
150{
151 unsigned int bit;
152 bit = 2 << ((irq == IRQ_TIMER64B) ? 4 : (irq - IRQ_TIMER1));
153 CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) &= ~bit;
154}
155
156/*
157 * unmask multiplexed timer irq's
158 */
159static void inline unmask_timerx_irq (u32 irq)
160{
161 unsigned int bit;
162 bit = 2 << ((irq == IRQ_TIMER64B) ? 4 : (irq - IRQ_TIMER1));
163 CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) |= bit;
164}
165
166static struct irqchip h7202_timerx_chip = {
167 .ack = mask_timerx_irq,
168 .mask = mask_timerx_irq,
169 .unmask = unmask_timerx_irq,
170};
171
172static struct irqaction h7202_timer_irq = {
173 .name = "h7202 Timer Tick",
174 .flags = SA_INTERRUPT,
175 .handler = h7202_timer_interrupt
176};
177
178/*
179 * Setup TIMER0 as system timer
180 */
181void __init h7202_init_time(void)
182{
183 CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
184 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
185 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
186 CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT;
187
188 setup_irq(IRQ_TIMER0, &h7202_timer_irq);
189}
190
191struct sys_timer h7202_timer = {
192 .init = h7202_init_time,
193 .offset = h720x_gettimeoffset,
194};
195
196void __init h7202_init_irq (void)
197{
198 int irq;
199
200 CPU_REG (GPIO_E_VIRT, GPIO_MASK) = 0x0;
201
202 for (irq = IRQ_TIMER1;
203 irq < IRQ_CHAINED_TIMERX(NR_TIMERX_IRQS); irq++) {
204 mask_timerx_irq(irq);
205 set_irq_chip(irq, &h7202_timerx_chip);
206 set_irq_handler(irq, do_edge_IRQ);
207 set_irq_flags(irq, IRQF_VALID );
208 }
209 set_irq_chained_handler(IRQ_TIMERX, h7202_timerx_demux_handler);
210
211 h720x_init_irq();
212}
213
214void __init init_hw_h7202(void)
215{
216 /* Enable clocks */
217 CPU_REG (PMU_BASE, PMU_PLL_CTRL) |= PLL_2_EN | PLL_1_EN | PLL_3_MUTE;
218
219 CPU_REG (SERIAL0_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN;
220 CPU_REG (SERIAL1_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN;
221#ifdef CONFIG_H7202_SERIAL23
222 CPU_REG (SERIAL2_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN;
223 CPU_REG (SERIAL3_VIRT, SERIAL_ENABLE) = SERIAL_ENABLE_EN;
224 CPU_IO (GPIO_AMULSEL) = AMULSEL_USIN2 | AMULSEL_USOUT2 |
225 AMULSEL_USIN3 | AMULSEL_USOUT3;
226#endif
227 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
228}
diff --git a/arch/arm/mach-h720x/h7201-eval.c b/arch/arm/mach-h720x/h7201-eval.c
new file mode 100644
index 000000000000..9b24b9b0db15
--- /dev/null
+++ b/arch/arm/mach-h720x/h7201-eval.c
@@ -0,0 +1,39 @@
1/*
2 * linux/arch/arm/mach-h720x/h7201-eval.c
3 *
4 * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de>
5 * 2003 Robert Schwebel <r.schwebel@pengutronix.de>
6 * 2004 Sascha Hauer <s.hauer@pengutronix.de>
7 *
8 * Architecture specific stuff for Hynix GMS30C7201 development board
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 */
15
16#include <linux/config.h>
17#include <linux/init.h>
18#include <linux/kernel.h>
19#include <linux/types.h>
20#include <linux/string.h>
21#include <linux/device.h>
22
23#include <asm/setup.h>
24#include <asm/types.h>
25#include <asm/mach-types.h>
26#include <asm/page.h>
27#include <asm/pgtable.h>
28#include <asm/mach/arch.h>
29#include <asm/hardware.h>
30#include "common.h"
31
32MACHINE_START(H7201, "Hynix GMS30C7201")
33 MAINTAINER("Robert Schwebel, Pengutronix")
34 BOOT_MEM(0x40000000, 0x80000000, 0xf0000000)
35 BOOT_PARAMS(0xc0001000)
36 MAPIO(h720x_map_io)
37 INITIRQ(h720x_init_irq)
38 .timer = &h7201_timer,
39MACHINE_END
diff --git a/arch/arm/mach-h720x/h7202-eval.c b/arch/arm/mach-h720x/h7202-eval.c
new file mode 100644
index 000000000000..3456a00d5f5c
--- /dev/null
+++ b/arch/arm/mach-h720x/h7202-eval.c
@@ -0,0 +1,81 @@
1/*
2 * linux/arch/arm/mach-h720x/h7202-eval.c
3 *
4 * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de>
5 * 2003 Robert Schwebel <r.schwebel@pengutronix.de>
6 * 2004 Sascha Hauer <s.hauer@pengutronix.de>
7 *
8 * Architecture specific stuff for Hynix HMS30C7202 development board
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 */
15
16#include <linux/config.h>
17#include <linux/init.h>
18#include <linux/kernel.h>
19#include <linux/types.h>
20#include <linux/string.h>
21#include <linux/device.h>
22
23#include <asm/setup.h>
24#include <asm/types.h>
25#include <asm/mach-types.h>
26#include <asm/page.h>
27#include <asm/pgtable.h>
28#include <asm/mach/arch.h>
29#include <asm/hardware.h>
30#include "common.h"
31
32static struct resource cirrus_resources[] = {
33 [0] = {
34 .start = ETH0_PHYS + 0x300,
35 .end = ETH0_PHYS + 0x300 + 0x10,
36 .flags = IORESOURCE_MEM,
37 },
38 [1] = {
39 .start = IRQ_CHAINED_GPIOB(8),
40 .end = IRQ_CHAINED_GPIOB(8),
41 .flags = IORESOURCE_IRQ,
42 },
43};
44
45static struct platform_device cirrus_device = {
46 .name = "cirrus-cs89x0",
47 .id = -1,
48 .num_resources = ARRAY_SIZE(cirrus_resources),
49 .resource = cirrus_resources,
50};
51
52static struct platform_device *devices[] __initdata = {
53 &cirrus_device,
54};
55
56/*
57 * Hardware init. This is called early in initcalls
58 * Place pin inits here. So you avoid adding ugly
59 * #ifdef stuff to common drivers.
60 * Use this only, if your bootloader is not able
61 * to initialize the pins proper.
62 */
63static void __init init_eval_h7202(void)
64{
65 init_hw_h7202();
66 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
67
68 /* Enable interrupt on portb bit 8 (ethernet) */
69 CPU_REG (GPIO_B_VIRT, GPIO_POL) &= ~(1 << 8);
70 CPU_REG (GPIO_B_VIRT, GPIO_EN) |= (1 << 8);
71}
72
73MACHINE_START(H7202, "Hynix HMS30C7202")
74 MAINTAINER("Robert Schwebel, Pengutronix")
75 BOOT_MEM(0x40000000, 0x80000000, 0xf0000000)
76 BOOT_PARAMS(0x40000100)
77 MAPIO(h720x_map_io)
78 INITIRQ(h7202_init_irq)
79 .timer = &h7202_timer,
80 INIT_MACHINE(init_eval_h7202)
81MACHINE_END
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
new file mode 100644
index 000000000000..ec85813ee5dc
--- /dev/null
+++ b/arch/arm/mach-imx/Kconfig
@@ -0,0 +1,10 @@
1menu "IMX Implementations"
2 depends on ARCH_IMX
3
4config ARCH_MX1ADS
5 bool "mx1ads"
6 depends on ARCH_IMX
7 help
8 Say Y here if you are using the Motorola MX1ADS board
9
10endmenu
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
new file mode 100644
index 000000000000..0b27d79f2efd
--- /dev/null
+++ b/arch/arm/mach-imx/Makefile
@@ -0,0 +1,19 @@
1#
2# Makefile for the linux kernel.
3#
4# Note! Dependencies are done automagically by 'make dep', which also
5# removes any old dependencies. DON'T put your own dependencies here
6# unless it's something special (ie not a .c file).
7
8# Object file lists.
9
10obj-y += irq.o time.o dma.o generic.o
11
12# Specific board support
13obj-$(CONFIG_ARCH_MX1ADS) += mx1ads.o
14
15# Support for blinky lights
16led-y := leds.o
17
18obj-$(CONFIG_LEDS) += $(led-y)
19led-$(CONFIG_ARCH_MX1ADS) += leds-mx1ads.o
diff --git a/arch/arm/mach-imx/Makefile.boot b/arch/arm/mach-imx/Makefile.boot
new file mode 100644
index 000000000000..fd72ce5b8081
--- /dev/null
+++ b/arch/arm/mach-imx/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-$(CONFIG_ARCH_MX1ADS) := 0x08008000
2
diff --git a/arch/arm/mach-imx/dma.c b/arch/arm/mach-imx/dma.c
new file mode 100644
index 000000000000..71a59e196166
--- /dev/null
+++ b/arch/arm/mach-imx/dma.c
@@ -0,0 +1,203 @@
1/*
2 * linux/arch/arm/mach-imx/dma.c
3 *
4 * imx DMA registration and IRQ dispatching
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * 03/03/2004 Sascha Hauer <sascha@saschahauer.de>
11 * initial version heavily inspired by
12 * linux/arch/arm/mach-pxa/dma.c
13 */
14
15#include <linux/module.h>
16#include <linux/init.h>
17#include <linux/kernel.h>
18#include <linux/interrupt.h>
19#include <linux/errno.h>
20
21#include <asm/system.h>
22#include <asm/irq.h>
23#include <asm/hardware.h>
24#include <asm/dma.h>
25
26static struct dma_channel {
27 char *name;
28 void (*irq_handler) (int, void *, struct pt_regs *);
29 void (*err_handler) (int, void *, struct pt_regs *);
30 void *data;
31} dma_channels[11];
32
33/* set err_handler to NULL to have the standard info-only error handler */
34int
35imx_request_dma(char *name, imx_dma_prio prio,
36 void (*irq_handler) (int, void *, struct pt_regs *),
37 void (*err_handler) (int, void *, struct pt_regs *), void *data)
38{
39 unsigned long flags;
40 int i, found = 0;
41
42 /* basic sanity checks */
43 if (!name || !irq_handler)
44 return -EINVAL;
45
46 local_irq_save(flags);
47
48 /* try grabbing a DMA channel with the requested priority */
49 for (i = prio; i < prio + (prio == DMA_PRIO_LOW) ? 8 : 4; i++) {
50 if (!dma_channels[i].name) {
51 found = 1;
52 break;
53 }
54 }
55
56 if (!found) {
57 /* requested prio group is full, try hier priorities */
58 for (i = prio - 1; i >= 0; i--) {
59 if (!dma_channels[i].name) {
60 found = 1;
61 break;
62 }
63 }
64 }
65
66 if (found) {
67 DIMR &= ~(1 << i);
68 dma_channels[i].name = name;
69 dma_channels[i].irq_handler = irq_handler;
70 dma_channels[i].err_handler = err_handler;
71 dma_channels[i].data = data;
72 } else {
73 printk(KERN_WARNING "No more available DMA channels for %s\n",
74 name);
75 i = -ENODEV;
76 }
77
78 local_irq_restore(flags);
79 return i;
80}
81
82void
83imx_free_dma(int dma_ch)
84{
85 unsigned long flags;
86
87 if (!dma_channels[dma_ch].name) {
88 printk(KERN_CRIT
89 "%s: trying to free channel %d which is already freed\n",
90 __FUNCTION__, dma_ch);
91 return;
92 }
93
94 local_irq_save(flags);
95 DIMR &= ~(1 << dma_ch);
96 dma_channels[dma_ch].name = NULL;
97 local_irq_restore(flags);
98}
99
100static irqreturn_t
101dma_err_handler(int irq, void *dev_id, struct pt_regs *regs)
102{
103 int i, disr = DISR;
104 struct dma_channel *channel;
105 unsigned int err_mask = DBTOSR | DRTOSR | DSESR | DBOSR;
106
107 DISR = disr;
108 for (i = 0; i < 11; i++) {
109 channel = &dma_channels[i];
110
111 if ( (err_mask & 1<<i) && channel->name && channel->err_handler) {
112 channel->err_handler(i, channel->data, regs);
113 continue;
114 }
115
116 if (DBTOSR & (1 << i)) {
117 printk(KERN_WARNING
118 "Burst timeout on channel %d (%s)\n",
119 i, channel->name);
120 DBTOSR |= (1 << i);
121 }
122 if (DRTOSR & (1 << i)) {
123 printk(KERN_WARNING
124 "Request timeout on channel %d (%s)\n",
125 i, channel->name);
126 DRTOSR |= (1 << i);
127 }
128 if (DSESR & (1 << i)) {
129 printk(KERN_WARNING
130 "Transfer timeout on channel %d (%s)\n",
131 i, channel->name);
132 DSESR |= (1 << i);
133 }
134 if (DBOSR & (1 << i)) {
135 printk(KERN_WARNING
136 "Buffer overflow timeout on channel %d (%s)\n",
137 i, channel->name);
138 DBOSR |= (1 << i);
139 }
140 }
141 return IRQ_HANDLED;
142}
143
144static irqreturn_t
145dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
146{
147 int i, disr = DISR;
148
149 DISR = disr;
150 for (i = 0; i < 11; i++) {
151 if (disr & (1 << i)) {
152 struct dma_channel *channel = &dma_channels[i];
153 if (channel->name && channel->irq_handler) {
154 channel->irq_handler(i, channel->data, regs);
155 } else {
156 /*
157 * IRQ for an unregistered DMA channel:
158 * let's clear the interrupts and disable it.
159 */
160 printk(KERN_WARNING
161 "spurious IRQ for DMA channel %d\n", i);
162 }
163 }
164 }
165 return IRQ_HANDLED;
166}
167
168static int __init
169imx_dma_init(void)
170{
171 int ret;
172
173 /* reset DMA module */
174 DCR = DCR_DRST;
175
176 ret = request_irq(DMA_INT, dma_irq_handler, 0, "DMA", NULL);
177 if (ret) {
178 printk(KERN_CRIT "Wow! Can't register IRQ for DMA\n");
179 return ret;
180 }
181
182 ret = request_irq(DMA_ERR, dma_err_handler, 0, "DMA", NULL);
183 if (ret) {
184 printk(KERN_CRIT "Wow! Can't register ERRIRQ for DMA\n");
185 free_irq(DMA_INT, NULL);
186 }
187
188 /* enable DMA module */
189 DCR = DCR_DEN;
190
191 /* clear all interrupts */
192 DISR = 0x3ff;
193
194 /* enable interrupts */
195 DIMR = 0;
196
197 return ret;
198}
199
200arch_initcall(imx_dma_init);
201
202EXPORT_SYMBOL(imx_request_dma);
203EXPORT_SYMBOL(imx_free_dma);
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c
new file mode 100644
index 000000000000..54377d0f578c
--- /dev/null
+++ b/arch/arm/mach-imx/generic.c
@@ -0,0 +1,274 @@
1/*
2 * arch/arm/mach-imx/generic.c
3 *
4 * author: Sascha Hauer
5 * Created: april 20th, 2004
6 * Copyright: Synertronixx GmbH
7 *
8 * Common code for i.MX machines
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25#include <linux/device.h>
26#include <linux/init.h>
27#include <linux/kernel.h>
28#include <linux/module.h>
29#include <asm/hardware.h>
30
31#include <asm/mach/map.h>
32
33void imx_gpio_mode(int gpio_mode)
34{
35 unsigned int pin = gpio_mode & GPIO_PIN_MASK;
36 unsigned int port = (gpio_mode & GPIO_PORT_MASK) >> 5;
37 unsigned int ocr = (gpio_mode & GPIO_OCR_MASK) >> 10;
38 unsigned int tmp;
39
40 /* Pullup enable */
41 if(gpio_mode & GPIO_PUEN)
42 PUEN(port) |= (1<<pin);
43 else
44 PUEN(port) &= ~(1<<pin);
45
46 /* Data direction */
47 if(gpio_mode & GPIO_OUT)
48 DDIR(port) |= 1<<pin;
49 else
50 DDIR(port) &= ~(1<<pin);
51
52 /* Primary / alternate function */
53 if(gpio_mode & GPIO_AF)
54 GPR(port) |= (1<<pin);
55 else
56 GPR(port) &= ~(1<<pin);
57
58 /* use as gpio? */
59 if( ocr == 3 )
60 GIUS(port) |= (1<<pin);
61 else
62 GIUS(port) &= ~(1<<pin);
63
64 /* Output / input configuration */
65 /* FIXME: I'm not very sure about OCR and ICONF, someone
66 * should have a look over it
67 */
68 if(pin<16) {
69 tmp = OCR1(port);
70 tmp &= ~( 3<<(pin*2));
71 tmp |= (ocr << (pin*2));
72 OCR1(port) = tmp;
73
74 if( gpio_mode & GPIO_AOUT )
75 ICONFA1(port) &= ~( 3<<(pin*2));
76 if( gpio_mode & GPIO_BOUT )
77 ICONFB1(port) &= ~( 3<<(pin*2));
78 } else {
79 tmp = OCR2(port);
80 tmp &= ~( 3<<((pin-16)*2));
81 tmp |= (ocr << ((pin-16)*2));
82 OCR2(port) = tmp;
83
84 if( gpio_mode & GPIO_AOUT )
85 ICONFA2(port) &= ~( 3<<((pin-16)*2));
86 if( gpio_mode & GPIO_BOUT )
87 ICONFB2(port) &= ~( 3<<((pin-16)*2));
88 }
89}
90
91EXPORT_SYMBOL(imx_gpio_mode);
92
93/*
94 * get the system pll clock in Hz
95 *
96 * mfi + mfn / (mfd +1)
97 * f = 2 * f_ref * --------------------
98 * pd + 1
99 */
100static unsigned int imx_decode_pll(unsigned int pll)
101{
102 u32 mfi = (pll >> 10) & 0xf;
103 u32 mfn = pll & 0x3ff;
104 u32 mfd = (pll >> 16) & 0x3ff;
105 u32 pd = (pll >> 26) & 0xf;
106 u32 f_ref = (CSCR & CSCR_SYSTEM_SEL) ? 16000000 : (CLK32 * 512);
107
108 mfi = mfi <= 5 ? 5 : mfi;
109
110 return (2 * (f_ref>>10) * ( (mfi<<10) + (mfn<<10) / (mfd+1) )) / (pd+1);
111}
112
113unsigned int imx_get_system_clk(void)
114{
115 return imx_decode_pll(SPCTL0);
116}
117EXPORT_SYMBOL(imx_get_system_clk);
118
119unsigned int imx_get_mcu_clk(void)
120{
121 return imx_decode_pll(MPCTL0);
122}
123EXPORT_SYMBOL(imx_get_mcu_clk);
124
125/*
126 * get peripheral clock 1 ( UART[12], Timer[12], PWM )
127 */
128unsigned int imx_get_perclk1(void)
129{
130 return imx_get_system_clk() / (((PCDR) & 0xf)+1);
131}
132EXPORT_SYMBOL(imx_get_perclk1);
133
134/*
135 * get peripheral clock 2 ( LCD, SD, SPI[12] )
136 */
137unsigned int imx_get_perclk2(void)
138{
139 return imx_get_system_clk() / (((PCDR>>4) & 0xf)+1);
140}
141EXPORT_SYMBOL(imx_get_perclk2);
142
143/*
144 * get peripheral clock 3 ( SSI )
145 */
146unsigned int imx_get_perclk3(void)
147{
148 return imx_get_system_clk() / (((PCDR>>16) & 0x7f)+1);
149}
150EXPORT_SYMBOL(imx_get_perclk3);
151
152/*
153 * get hclk ( SDRAM, CSI, Memory Stick, I2C, DMA )
154 */
155unsigned int imx_get_hclk(void)
156{
157 return imx_get_system_clk() / (((CSCR>>10) & 0xf)+1);
158}
159EXPORT_SYMBOL(imx_get_hclk);
160
161static struct resource imx_mmc_resources[] = {
162 [0] = {
163 .start = 0x00214000,
164 .end = 0x002140FF,
165 .flags = IORESOURCE_MEM,
166 },
167 [1] = {
168 .start = (SDHC_INT),
169 .end = (SDHC_INT),
170 .flags = IORESOURCE_IRQ,
171 },
172};
173
174static struct platform_device imx_mmc_device = {
175 .name = "imx-mmc",
176 .id = 0,
177 .num_resources = ARRAY_SIZE(imx_mmc_resources),
178 .resource = imx_mmc_resources,
179};
180
181static struct resource imx_uart1_resources[] = {
182 [0] = {
183 .start = 0x00206000,
184 .end = 0x002060FF,
185 .flags = IORESOURCE_MEM,
186 },
187 [1] = {
188 .start = (UART1_MINT_RX),
189 .end = (UART1_MINT_RX),
190 .flags = IORESOURCE_IRQ,
191 },
192 [2] = {
193 .start = (UART1_MINT_TX),
194 .end = (UART1_MINT_TX),
195 .flags = IORESOURCE_IRQ,
196 },
197};
198
199static struct platform_device imx_uart1_device = {
200 .name = "imx-uart",
201 .id = 0,
202 .num_resources = ARRAY_SIZE(imx_uart1_resources),
203 .resource = imx_uart1_resources,
204};
205
206static struct resource imx_uart2_resources[] = {
207 [0] = {
208 .start = 0x00207000,
209 .end = 0x002070FF,
210 .flags = IORESOURCE_MEM,
211 },
212 [1] = {
213 .start = (UART2_MINT_RX),
214 .end = (UART2_MINT_RX),
215 .flags = IORESOURCE_IRQ,
216 },
217 [2] = {
218 .start = (UART2_MINT_TX),
219 .end = (UART2_MINT_TX),
220 .flags = IORESOURCE_IRQ,
221 },
222};
223
224static struct platform_device imx_uart2_device = {
225 .name = "imx-uart",
226 .id = 1,
227 .num_resources = ARRAY_SIZE(imx_uart2_resources),
228 .resource = imx_uart2_resources,
229};
230
231static struct resource imxfb_resources[] = {
232 [0] = {
233 .start = 0x00205000,
234 .end = 0x002050FF,
235 .flags = IORESOURCE_MEM,
236 },
237 [1] = {
238 .start = LCDC_INT,
239 .end = LCDC_INT,
240 .flags = IORESOURCE_IRQ,
241 },
242};
243
244static struct platform_device imxfb_device = {
245 .name = "imx-fb",
246 .id = 0,
247 .num_resources = ARRAY_SIZE(imxfb_resources),
248 .resource = imxfb_resources,
249};
250
251static struct platform_device *devices[] __initdata = {
252 &imx_mmc_device,
253 &imxfb_device,
254 &imx_uart1_device,
255 &imx_uart2_device,
256};
257
258static struct map_desc imx_io_desc[] __initdata = {
259 /* virtual physical length type */
260 {IMX_IO_BASE, IMX_IO_PHYS, IMX_IO_SIZE, MT_DEVICE},
261};
262
263void __init
264imx_map_io(void)
265{
266 iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc));
267}
268
269static int __init imx_init(void)
270{
271 return platform_add_devices(devices, ARRAY_SIZE(devices));
272}
273
274subsys_initcall(imx_init);
diff --git a/arch/arm/mach-imx/generic.h b/arch/arm/mach-imx/generic.h
new file mode 100644
index 000000000000..e91003e4bef3
--- /dev/null
+++ b/arch/arm/mach-imx/generic.h
@@ -0,0 +1,16 @@
1/*
2 * linux/arch/arm/mach-imx/generic.h
3 *
4 * Author: Sascha Hauer <sascha@saschahauer.de>
5 * Copyright: Synertronixx GmbH
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12extern void __init imx_map_io(void);
13extern void __init imx_init_irq(void);
14
15struct sys_timer;
16extern struct sys_timer imx_timer;
diff --git a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c
new file mode 100644
index 000000000000..0c2713426dfd
--- /dev/null
+++ b/arch/arm/mach-imx/irq.c
@@ -0,0 +1,252 @@
1/*
2 * linux/arch/arm/mach-imx/irq.c
3 *
4 * Copyright (C) 1999 ARM Limited
5 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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 * 03/03/2004 Sascha Hauer <sascha@saschahauer.de>
22 * Copied from the motorola bsp package and added gpio demux
23 * interrupt handler
24 */
25
26#include <linux/init.h>
27#include <linux/list.h>
28#include <linux/timer.h>
29
30#include <asm/hardware.h>
31#include <asm/irq.h>
32#include <asm/io.h>
33
34#include <asm/mach/irq.h>
35
36/*
37 *
38 * We simply use the ENABLE DISABLE registers inside of the IMX
39 * to turn on/off specific interrupts. FIXME- We should
40 * also add support for the accelerated interrupt controller
41 * by putting offets to irq jump code in the appropriate
42 * places.
43 *
44 */
45
46#define INTENNUM_OFF 0x8
47#define INTDISNUM_OFF 0xC
48
49#define VA_AITC_BASE IO_ADDRESS(IMX_AITC_BASE)
50#define IMX_AITC_INTDISNUM (VA_AITC_BASE + INTDISNUM_OFF)
51#define IMX_AITC_INTENNUM (VA_AITC_BASE + INTENNUM_OFF)
52
53#if 0
54#define DEBUG_IRQ(fmt...) printk(fmt)
55#else
56#define DEBUG_IRQ(fmt...) do { } while (0)
57#endif
58
59static void
60imx_mask_irq(unsigned int irq)
61{
62 __raw_writel(irq, IMX_AITC_INTDISNUM);
63}
64
65static void
66imx_unmask_irq(unsigned int irq)
67{
68 __raw_writel(irq, IMX_AITC_INTENNUM);
69}
70
71static int
72imx_gpio_irq_type(unsigned int _irq, unsigned int type)
73{
74 unsigned int irq_type = 0, irq, reg, bit;
75
76 irq = _irq - IRQ_GPIOA(0);
77 reg = irq >> 5;
78 bit = 1 << (irq % 32);
79
80 if (type == IRQT_PROBE) {
81 /* Don't mess with enabled GPIOs using preconfigured edges or
82 GPIOs set to alternate function during probe */
83 /* TODO: support probe */
84// if ((GPIO_IRQ_rising_edge[idx] | GPIO_IRQ_falling_edge[idx]) &
85// GPIO_bit(gpio))
86// return 0;
87// if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2)))
88// return 0;
89// type = __IRQT_RISEDGE | __IRQT_FALEDGE;
90 }
91
92 GIUS(reg) |= bit;
93 DDIR(reg) &= ~(bit);
94
95 DEBUG_IRQ("setting type of irq %d to ", _irq);
96
97 if (type & __IRQT_RISEDGE) {
98 DEBUG_IRQ("rising edges\n");
99 irq_type = 0x0;
100 }
101 if (type & __IRQT_FALEDGE) {
102 DEBUG_IRQ("falling edges\n");
103 irq_type = 0x1;
104 }
105 if (type & __IRQT_LOWLVL) {
106 DEBUG_IRQ("low level\n");
107 irq_type = 0x3;
108 }
109 if (type & __IRQT_HIGHLVL) {
110 DEBUG_IRQ("high level\n");
111 irq_type = 0x2;
112 }
113
114 if (irq % 32 < 16) {
115 ICR1(reg) = (ICR1(reg) & ~(0x3 << ((irq % 16) * 2))) |
116 (irq_type << ((irq % 16) * 2));
117 } else {
118 ICR2(reg) = (ICR2(reg) & ~(0x3 << ((irq % 16) * 2))) |
119 (irq_type << ((irq % 16) * 2));
120 }
121
122 return 0;
123
124}
125
126static void
127imx_gpio_ack_irq(unsigned int irq)
128{
129 DEBUG_IRQ("%s: irq %d\n", __FUNCTION__, irq);
130 ISR(IRQ_TO_REG(irq)) |= 1 << ((irq - IRQ_GPIOA(0)) % 32);
131}
132
133static void
134imx_gpio_mask_irq(unsigned int irq)
135{
136 DEBUG_IRQ("%s: irq %d\n", __FUNCTION__, irq);
137 IMR(IRQ_TO_REG(irq)) &= ~( 1 << ((irq - IRQ_GPIOA(0)) % 32));
138}
139
140static void
141imx_gpio_unmask_irq(unsigned int irq)
142{
143 DEBUG_IRQ("%s: irq %d\n", __FUNCTION__, irq);
144 IMR(IRQ_TO_REG(irq)) |= 1 << ((irq - IRQ_GPIOA(0)) % 32);
145}
146
147static void
148imx_gpio_handler(unsigned int mask, unsigned int irq,
149 struct irqdesc *desc, struct pt_regs *regs)
150{
151 desc = irq_desc + irq;
152 while (mask) {
153 if (mask & 1) {
154 DEBUG_IRQ("handling irq %d\n", irq);
155 desc->handle(irq, desc, regs);
156 }
157 irq++;
158 desc++;
159 mask >>= 1;
160 }
161}
162
163static void
164imx_gpioa_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
165 struct pt_regs *regs)
166{
167 unsigned int mask, irq;
168
169 mask = ISR(0);
170 irq = IRQ_GPIOA(0);
171 imx_gpio_handler(mask, irq, desc, regs);
172}
173
174static void
175imx_gpiob_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
176 struct pt_regs *regs)
177{
178 unsigned int mask, irq;
179
180 mask = ISR(1);
181 irq = IRQ_GPIOB(0);
182 imx_gpio_handler(mask, irq, desc, regs);
183}
184
185static void
186imx_gpioc_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
187 struct pt_regs *regs)
188{
189 unsigned int mask, irq;
190
191 mask = ISR(2);
192 irq = IRQ_GPIOC(0);
193 imx_gpio_handler(mask, irq, desc, regs);
194}
195
196static void
197imx_gpiod_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
198 struct pt_regs *regs)
199{
200 unsigned int mask, irq;
201
202 mask = ISR(3);
203 irq = IRQ_GPIOD(0);
204 imx_gpio_handler(mask, irq, desc, regs);
205}
206
207static struct irqchip imx_internal_chip = {
208 .ack = imx_mask_irq,
209 .mask = imx_mask_irq,
210 .unmask = imx_unmask_irq,
211};
212
213static struct irqchip imx_gpio_chip = {
214 .ack = imx_gpio_ack_irq,
215 .mask = imx_gpio_mask_irq,
216 .unmask = imx_gpio_unmask_irq,
217 .type = imx_gpio_irq_type,
218};
219
220void __init
221imx_init_irq(void)
222{
223 unsigned int irq;
224
225 DEBUG_IRQ("Initializing imx interrupts\n");
226
227 /* Mask all interrupts initially */
228 IMR(0) = 0;
229 IMR(1) = 0;
230 IMR(2) = 0;
231 IMR(3) = 0;
232
233 for (irq = 0; irq < IMX_IRQS; irq++) {
234 set_irq_chip(irq, &imx_internal_chip);
235 set_irq_handler(irq, do_level_IRQ);
236 set_irq_flags(irq, IRQF_VALID);
237 }
238
239 for (irq = IRQ_GPIOA(0); irq < IRQ_GPIOD(32); irq++) {
240 set_irq_chip(irq, &imx_gpio_chip);
241 set_irq_handler(irq, do_edge_IRQ);
242 set_irq_flags(irq, IRQF_VALID);
243 }
244
245 set_irq_chained_handler(GPIO_INT_PORTA, imx_gpioa_demux_handler);
246 set_irq_chained_handler(GPIO_INT_PORTB, imx_gpiob_demux_handler);
247 set_irq_chained_handler(GPIO_INT_PORTC, imx_gpioc_demux_handler);
248 set_irq_chained_handler(GPIO_INT_PORTD, imx_gpiod_demux_handler);
249
250 /* Disable all interrupts initially. */
251 /* In IMX this is done in the bootloader. */
252}
diff --git a/arch/arm/mach-imx/leds-mx1ads.c b/arch/arm/mach-imx/leds-mx1ads.c
new file mode 100644
index 000000000000..e6399b06e4a4
--- /dev/null
+++ b/arch/arm/mach-imx/leds-mx1ads.c
@@ -0,0 +1,54 @@
1/*
2 * linux/arch/arm/mach-imx/leds-mx1ads.c
3 *
4 * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
5 *
6 * Original (leds-footbridge.c) by Russell King
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <asm/hardware.h>
17#include <asm/system.h>
18#include <asm/io.h>
19#include <asm/leds.h>
20#include <asm/mach-types.h>
21#include "leds.h"
22
23/*
24 * The MX1ADS Board has only one usable LED,
25 * so select only the timer led or the
26 * cpu usage led
27 */
28void
29mx1ads_leds_event(led_event_t ledevt)
30{
31 unsigned long flags;
32
33 local_irq_save(flags);
34
35 switch (ledevt) {
36#ifdef CONFIG_LEDS_CPU
37 case led_idle_start:
38 DR(0) &= ~(1<<2);
39 break;
40
41 case led_idle_end:
42 DR(0) |= 1<<2;
43 break;
44#endif
45
46#ifdef CONFIG_LEDS_TIMER
47 case led_timer:
48 DR(0) ^= 1<<2;
49#endif
50 default:
51 break;
52 }
53 local_irq_restore(flags);
54}
diff --git a/arch/arm/mach-imx/leds.c b/arch/arm/mach-imx/leds.c
new file mode 100644
index 000000000000..471c1db7c57f
--- /dev/null
+++ b/arch/arm/mach-imx/leds.c
@@ -0,0 +1,31 @@
1/*
2 * linux/arch/arm/mach-imx/leds.h
3 *
4 * Copyright (C) 2004 Sascha Hauer <sascha@saschahauer.de>
5 *
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15
16#include <asm/leds.h>
17#include <asm/mach-types.h>
18
19#include "leds.h"
20
21static int __init
22leds_init(void)
23{
24 if (machine_is_mx1ads()) {
25 leds_event = mx1ads_leds_event;
26 }
27
28 return 0;
29}
30
31__initcall(leds_init);
diff --git a/arch/arm/mach-imx/leds.h b/arch/arm/mach-imx/leds.h
new file mode 100644
index 000000000000..83fa21e795a9
--- /dev/null
+++ b/arch/arm/mach-imx/leds.h
@@ -0,0 +1,9 @@
1/*
2 * include/asm-arm/arch-imx/leds.h
3 *
4 * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
5 *
6 * blinky lights for IMX-based systems
7 *
8 */
9extern void mx1ads_leds_event(led_event_t evt);
diff --git a/arch/arm/mach-imx/mx1ads.c b/arch/arm/mach-imx/mx1ads.c
new file mode 100644
index 000000000000..625dd01c2578
--- /dev/null
+++ b/arch/arm/mach-imx/mx1ads.c
@@ -0,0 +1,88 @@
1/*
2 * arch/arm/mach-imx/mx1ads.c
3 *
4 * Initially based on:
5 * linux-2.6.7-imx/arch/arm/mach-imx/scb9328.c
6 * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
7 *
8 * 2004 (c) MontaVista Software, Inc.
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
13 */
14
15#include <linux/device.h>
16#include <linux/init.h>
17#include <asm/system.h>
18#include <asm/hardware.h>
19#include <asm/irq.h>
20#include <asm/pgtable.h>
21#include <asm/page.h>
22
23#include <asm/mach/map.h>
24#include <asm/mach-types.h>
25
26#include <asm/mach/arch.h>
27#include <linux/interrupt.h>
28#include "generic.h"
29#include <asm/serial.h>
30
31static struct resource mx1ads_resources[] = {
32 [0] = {
33 .start = IMX_CS4_VIRT,
34 .end = IMX_CS4_VIRT + 16,
35 .flags = IORESOURCE_MEM,
36 },
37 [1] = {
38 .start = 13,
39 .end = 13,
40 .flags = IORESOURCE_IRQ,
41 },
42};
43
44static struct platform_device mx1ads_device = {
45 .name = "mx1ads",
46 .num_resources = ARRAY_SIZE(mx1ads_resources),
47 .resource = mx1ads_resources,
48};
49
50static struct platform_device *devices[] __initdata = {
51 &mx1ads_device,
52};
53
54static void __init
55mx1ads_init(void)
56{
57#ifdef CONFIG_LEDS
58 imx_gpio_mode(GPIO_PORTA | GPIO_OUT | GPIO_GPIO | 2);
59#endif
60 platform_add_devices(devices, ARRAY_SIZE(devices));
61}
62
63static struct map_desc mx1ads_io_desc[] __initdata = {
64 /* virtual physical length type */
65 {IMX_CS0_VIRT, IMX_CS0_PHYS, IMX_CS0_SIZE, MT_DEVICE},
66 {IMX_CS1_VIRT, IMX_CS1_PHYS, IMX_CS1_SIZE, MT_DEVICE},
67 {IMX_CS2_VIRT, IMX_CS2_PHYS, IMX_CS2_SIZE, MT_DEVICE},
68 {IMX_CS3_VIRT, IMX_CS3_PHYS, IMX_CS3_SIZE, MT_DEVICE},
69 {IMX_CS4_VIRT, IMX_CS4_PHYS, IMX_CS4_SIZE, MT_DEVICE},
70 {IMX_CS5_VIRT, IMX_CS5_PHYS, IMX_CS5_SIZE, MT_DEVICE},
71};
72
73static void __init
74mx1ads_map_io(void)
75{
76 imx_map_io();
77 iotable_init(mx1ads_io_desc, ARRAY_SIZE(mx1ads_io_desc));
78}
79
80MACHINE_START(MX1ADS, "Motorola MX1ADS")
81 MAINTAINER("Sascha Hauer, Pengutronix")
82 BOOT_MEM(0x08000000, 0x00200000, 0xe0200000)
83 BOOT_PARAMS(0x08000100)
84 MAPIO(mx1ads_map_io)
85 INITIRQ(imx_init_irq)
86 .timer = &imx_timer,
87 INIT_MACHINE(mx1ads_init)
88MACHINE_END
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
new file mode 100644
index 000000000000..11f1e56c36bc
--- /dev/null
+++ b/arch/arm/mach-imx/time.c
@@ -0,0 +1,101 @@
1/*
2 * linux/arch/arm/mach-imx/time.c
3 *
4 * Copyright (C) 2000-2001 Deep Blue Solutions
5 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/config.h>
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/init.h>
15#include <linux/interrupt.h>
16#include <linux/time.h>
17
18#include <asm/hardware.h>
19#include <asm/io.h>
20#include <asm/leds.h>
21#include <asm/irq.h>
22#include <asm/mach/time.h>
23
24/* Use timer 1 as system timer */
25#define TIMER_BASE IMX_TIM1_BASE
26
27/*
28 * Returns number of us since last clock interrupt. Note that interrupts
29 * will have been disabled by do_gettimeoffset()
30 */
31static unsigned long imx_gettimeoffset(void)
32{
33 unsigned long ticks;
34
35 /*
36 * Get the current number of ticks. Note that there is a race
37 * condition between us reading the timer and checking for
38 * an interrupt. We get around this by ensuring that the
39 * counter has not reloaded between our two reads.
40 */
41 ticks = IMX_TCN(TIMER_BASE);
42
43 /*
44 * Interrupt pending? If so, we've reloaded once already.
45 */
46 if (IMX_TSTAT(TIMER_BASE) & TSTAT_COMP)
47 ticks += LATCH;
48
49 /*
50 * Convert the ticks to usecs
51 */
52 return (1000000 / CLK32) * ticks;
53}
54
55/*
56 * IRQ handler for the timer
57 */
58static irqreturn_t
59imx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
60{
61 write_seqlock(&xtime_lock);
62
63 /* clear the interrupt */
64 if (IMX_TSTAT(TIMER_BASE))
65 IMX_TSTAT(TIMER_BASE) = 0;
66
67 timer_tick(regs);
68 write_sequnlock(&xtime_lock);
69
70 return IRQ_HANDLED;
71}
72
73static struct irqaction imx_timer_irq = {
74 .name = "i.MX Timer Tick",
75 .flags = SA_INTERRUPT,
76 .handler = imx_timer_interrupt
77};
78
79/*
80 * Set up timer interrupt, and return the current time in seconds.
81 */
82static void __init imx_timer_init(void)
83{
84 /*
85 * Initialise to a known state (all timers off, and timing reset)
86 */
87 IMX_TCTL(TIMER_BASE) = 0;
88 IMX_TPRER(TIMER_BASE) = 0;
89 IMX_TCMP(TIMER_BASE) = LATCH - 1;
90 IMX_TCTL(TIMER_BASE) = TCTL_CLK_32 | TCTL_IRQEN | TCTL_TEN;
91
92 /*
93 * Make irqs happen for the system timer
94 */
95 setup_irq(TIM1_INT, &imx_timer_irq);
96}
97
98struct sys_timer imx_timer = {
99 .init = imx_timer_init,
100 .offset = imx_gettimeoffset,
101};
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig
new file mode 100644
index 000000000000..df97d16390e3
--- /dev/null
+++ b/arch/arm/mach-integrator/Kconfig
@@ -0,0 +1,33 @@
1if ARCH_INTEGRATOR
2
3menu "Integrator Options"
4
5config ARCH_INTEGRATOR_AP
6 bool "Support Integrator/AP and Integrator/PP2 platforms"
7 help
8 Include support for the ARM(R) Integrator/AP and
9 Integrator/PP2 platforms.
10
11config ARCH_INTEGRATOR_CP
12 bool "Support Integrator/CP platform"
13 select ARCH_CINTEGRATOR
14 help
15 Include support for the ARM(R) Integrator CP platform.
16
17config ARCH_CINTEGRATOR
18 bool
19
20config INTEGRATOR_IMPD1
21 tristate "Include support for Integrator/IM-PD1"
22 depends on ARCH_INTEGRATOR_AP
23 help
24 The IM-PD1 is an add-on logic module for the Integrator which
25 allows ARM(R) Ltd PrimeCells to be developed and evaluated.
26 The IM-PD1 can be found on the Integrator/PP2 platform.
27
28 To compile this driver as a module, choose M here: the
29 module will be called impd1.
30
31endmenu
32
33endif
diff --git a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile
new file mode 100644
index 000000000000..158daaf9e3b0
--- /dev/null
+++ b/arch/arm/mach-integrator/Makefile
@@ -0,0 +1,14 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := clock.o core.o lm.o time.o
8obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o
9obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o
10
11obj-$(CONFIG_LEDS) += leds.o
12obj-$(CONFIG_PCI) += pci_v3.o pci.o
13obj-$(CONFIG_CPU_FREQ_INTEGRATOR) += cpu.o
14obj-$(CONFIG_INTEGRATOR_IMPD1) += impd1.o
diff --git a/arch/arm/mach-integrator/Makefile.boot b/arch/arm/mach-integrator/Makefile.boot
new file mode 100644
index 000000000000..c7e75acfe6c9
--- /dev/null
+++ b/arch/arm/mach-integrator/Makefile.boot
@@ -0,0 +1,4 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000
4
diff --git a/arch/arm/mach-integrator/clock.c b/arch/arm/mach-integrator/clock.c
new file mode 100644
index 000000000000..56200594db3c
--- /dev/null
+++ b/arch/arm/mach-integrator/clock.c
@@ -0,0 +1,141 @@
1/*
2 * linux/arch/arm/mach-integrator/clock.c
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/list.h>
14#include <linux/errno.h>
15#include <linux/err.h>
16
17#include <asm/semaphore.h>
18#include <asm/hardware/clock.h>
19#include <asm/hardware/icst525.h>
20
21#include "clock.h"
22
23static LIST_HEAD(clocks);
24static DECLARE_MUTEX(clocks_sem);
25
26struct clk *clk_get(struct device *dev, const char *id)
27{
28 struct clk *p, *clk = ERR_PTR(-ENOENT);
29
30 down(&clocks_sem);
31 list_for_each_entry(p, &clocks, node) {
32 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
33 clk = p;
34 break;
35 }
36 }
37 up(&clocks_sem);
38
39 return clk;
40}
41EXPORT_SYMBOL(clk_get);
42
43void clk_put(struct clk *clk)
44{
45 module_put(clk->owner);
46}
47EXPORT_SYMBOL(clk_put);
48
49int clk_enable(struct clk *clk)
50{
51 return 0;
52}
53EXPORT_SYMBOL(clk_enable);
54
55void clk_disable(struct clk *clk)
56{
57}
58EXPORT_SYMBOL(clk_disable);
59
60int clk_use(struct clk *clk)
61{
62 return 0;
63}
64EXPORT_SYMBOL(clk_use);
65
66void clk_unuse(struct clk *clk)
67{
68}
69EXPORT_SYMBOL(clk_unuse);
70
71unsigned long clk_get_rate(struct clk *clk)
72{
73 return clk->rate;
74}
75EXPORT_SYMBOL(clk_get_rate);
76
77long clk_round_rate(struct clk *clk, unsigned long rate)
78{
79 struct icst525_vco vco;
80
81 vco = icst525_khz_to_vco(clk->params, rate / 1000);
82 return icst525_khz(clk->params, vco) * 1000;
83}
84EXPORT_SYMBOL(clk_round_rate);
85
86int clk_set_rate(struct clk *clk, unsigned long rate)
87{
88 int ret = -EIO;
89 if (clk->setvco) {
90 struct icst525_vco vco;
91
92 vco = icst525_khz_to_vco(clk->params, rate / 1000);
93 clk->rate = icst525_khz(clk->params, vco) * 1000;
94
95 printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n",
96 clk->name, vco.s, vco.r, vco.v);
97
98 clk->setvco(clk, vco);
99 ret = 0;
100 }
101 return 0;
102}
103EXPORT_SYMBOL(clk_set_rate);
104
105/*
106 * These are fixed clocks.
107 */
108static struct clk kmi_clk = {
109 .name = "KMIREFCLK",
110 .rate = 24000000,
111};
112
113static struct clk uart_clk = {
114 .name = "UARTCLK",
115 .rate = 14745600,
116};
117
118int clk_register(struct clk *clk)
119{
120 down(&clocks_sem);
121 list_add(&clk->node, &clocks);
122 up(&clocks_sem);
123 return 0;
124}
125EXPORT_SYMBOL(clk_register);
126
127void clk_unregister(struct clk *clk)
128{
129 down(&clocks_sem);
130 list_del(&clk->node);
131 up(&clocks_sem);
132}
133EXPORT_SYMBOL(clk_unregister);
134
135static int __init clk_init(void)
136{
137 clk_register(&kmi_clk);
138 clk_register(&uart_clk);
139 return 0;
140}
141arch_initcall(clk_init);
diff --git a/arch/arm/mach-integrator/clock.h b/arch/arm/mach-integrator/clock.h
new file mode 100644
index 000000000000..09e6328ceba9
--- /dev/null
+++ b/arch/arm/mach-integrator/clock.h
@@ -0,0 +1,25 @@
1/*
2 * linux/arch/arm/mach-integrator/clock.h
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11struct module;
12struct icst525_params;
13
14struct clk {
15 struct list_head node;
16 unsigned long rate;
17 struct module *owner;
18 const char *name;
19 const struct icst525_params *params;
20 void *data;
21 void (*setvco)(struct clk *, struct icst525_vco vco);
22};
23
24int clk_register(struct clk *clk);
25void clk_unregister(struct clk *clk);
diff --git a/arch/arm/mach-integrator/common.h b/arch/arm/mach-integrator/common.h
new file mode 100644
index 000000000000..609c49de3d47
--- /dev/null
+++ b/arch/arm/mach-integrator/common.h
@@ -0,0 +1,2 @@
1extern void integrator_time_init(unsigned long, unsigned int);
2extern unsigned long integrator_gettimeoffset(void);
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
new file mode 100644
index 000000000000..86c50c3889b7
--- /dev/null
+++ b/arch/arm/mach-integrator/core.c
@@ -0,0 +1,271 @@
1/*
2 * linux/arch/arm/mach-integrator/core.c
3 *
4 * Copyright (C) 2000-2003 Deep Blue Solutions Ltd
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, as
8 * published by the Free Software Foundation.
9 */
10#include <linux/types.h>
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/device.h>
14#include <linux/spinlock.h>
15#include <linux/interrupt.h>
16#include <linux/sched.h>
17
18#include <asm/hardware.h>
19#include <asm/irq.h>
20#include <asm/io.h>
21#include <asm/hardware/amba.h>
22#include <asm/arch/cm.h>
23#include <asm/system.h>
24#include <asm/leds.h>
25#include <asm/mach/time.h>
26
27#include "common.h"
28
29static struct amba_device rtc_device = {
30 .dev = {
31 .bus_id = "mb:15",
32 },
33 .res = {
34 .start = INTEGRATOR_RTC_BASE,
35 .end = INTEGRATOR_RTC_BASE + SZ_4K - 1,
36 .flags = IORESOURCE_MEM,
37 },
38 .irq = { IRQ_RTCINT, NO_IRQ },
39 .periphid = 0x00041030,
40};
41
42static struct amba_device uart0_device = {
43 .dev = {
44 .bus_id = "mb:16",
45 },
46 .res = {
47 .start = INTEGRATOR_UART0_BASE,
48 .end = INTEGRATOR_UART0_BASE + SZ_4K - 1,
49 .flags = IORESOURCE_MEM,
50 },
51 .irq = { IRQ_UARTINT0, NO_IRQ },
52 .periphid = 0x0041010,
53};
54
55static struct amba_device uart1_device = {
56 .dev = {
57 .bus_id = "mb:17",
58 },
59 .res = {
60 .start = INTEGRATOR_UART1_BASE,
61 .end = INTEGRATOR_UART1_BASE + SZ_4K - 1,
62 .flags = IORESOURCE_MEM,
63 },
64 .irq = { IRQ_UARTINT1, NO_IRQ },
65 .periphid = 0x0041010,
66};
67
68static struct amba_device kmi0_device = {
69 .dev = {
70 .bus_id = "mb:18",
71 },
72 .res = {
73 .start = KMI0_BASE,
74 .end = KMI0_BASE + SZ_4K - 1,
75 .flags = IORESOURCE_MEM,
76 },
77 .irq = { IRQ_KMIINT0, NO_IRQ },
78 .periphid = 0x00041050,
79};
80
81static struct amba_device kmi1_device = {
82 .dev = {
83 .bus_id = "mb:19",
84 },
85 .res = {
86 .start = KMI1_BASE,
87 .end = KMI1_BASE + SZ_4K - 1,
88 .flags = IORESOURCE_MEM,
89 },
90 .irq = { IRQ_KMIINT1, NO_IRQ },
91 .periphid = 0x00041050,
92};
93
94static struct amba_device *amba_devs[] __initdata = {
95 &rtc_device,
96 &uart0_device,
97 &uart1_device,
98 &kmi0_device,
99 &kmi1_device,
100};
101
102static int __init integrator_init(void)
103{
104 int i;
105
106 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
107 struct amba_device *d = amba_devs[i];
108 amba_device_register(d, &iomem_resource);
109 }
110
111 return 0;
112}
113
114arch_initcall(integrator_init);
115
116#define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET
117
118static DEFINE_SPINLOCK(cm_lock);
119
120/**
121 * cm_control - update the CM_CTRL register.
122 * @mask: bits to change
123 * @set: bits to set
124 */
125void cm_control(u32 mask, u32 set)
126{
127 unsigned long flags;
128 u32 val;
129
130 spin_lock_irqsave(&cm_lock, flags);
131 val = readl(CM_CTRL) & ~mask;
132 writel(val | set, CM_CTRL);
133 spin_unlock_irqrestore(&cm_lock, flags);
134}
135
136EXPORT_SYMBOL(cm_control);
137
138/*
139 * Where is the timer (VA)?
140 */
141#define TIMER0_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000000)
142#define TIMER1_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000100)
143#define TIMER2_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000200)
144#define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE)
145
146/*
147 * How long is the timer interval?
148 */
149#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
150#if TIMER_INTERVAL >= 0x100000
151#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)
152#elif TIMER_INTERVAL >= 0x10000
153#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)
154#else
155#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
156#endif
157
158/*
159 * What does it look like?
160 */
161typedef struct TimerStruct {
162 unsigned long TimerLoad;
163 unsigned long TimerValue;
164 unsigned long TimerControl;
165 unsigned long TimerClear;
166} TimerStruct_t;
167
168static unsigned long timer_reload;
169
170/*
171 * Returns number of ms since last clock interrupt. Note that interrupts
172 * will have been disabled by do_gettimeoffset()
173 */
174unsigned long integrator_gettimeoffset(void)
175{
176 volatile TimerStruct_t *timer1 = (TimerStruct_t *)TIMER1_VA_BASE;
177 unsigned long ticks1, ticks2, status;
178
179 /*
180 * Get the current number of ticks. Note that there is a race
181 * condition between us reading the timer and checking for
182 * an interrupt. We get around this by ensuring that the
183 * counter has not reloaded between our two reads.
184 */
185 ticks2 = timer1->TimerValue & 0xffff;
186 do {
187 ticks1 = ticks2;
188 status = __raw_readl(VA_IC_BASE + IRQ_RAW_STATUS);
189 ticks2 = timer1->TimerValue & 0xffff;
190 } while (ticks2 > ticks1);
191
192 /*
193 * Number of ticks since last interrupt.
194 */
195 ticks1 = timer_reload - ticks2;
196
197 /*
198 * Interrupt pending? If so, we've reloaded once already.
199 */
200 if (status & (1 << IRQ_TIMERINT1))
201 ticks1 += timer_reload;
202
203 /*
204 * Convert the ticks to usecs
205 */
206 return TICKS2USECS(ticks1);
207}
208
209/*
210 * IRQ handler for the timer
211 */
212static irqreturn_t
213integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
214{
215 volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE;
216
217 write_seqlock(&xtime_lock);
218
219 // ...clear the interrupt
220 timer1->TimerClear = 1;
221
222 timer_tick(regs);
223
224 write_sequnlock(&xtime_lock);
225
226 return IRQ_HANDLED;
227}
228
229static struct irqaction integrator_timer_irq = {
230 .name = "Integrator Timer Tick",
231 .flags = SA_INTERRUPT,
232 .handler = integrator_timer_interrupt
233};
234
235/*
236 * Set up timer interrupt, and return the current time in seconds.
237 */
238void __init integrator_time_init(unsigned long reload, unsigned int ctrl)
239{
240 volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE;
241 volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE;
242 volatile TimerStruct_t *timer2 = (volatile TimerStruct_t *)TIMER2_VA_BASE;
243 unsigned int timer_ctrl = 0x80 | 0x40; /* periodic */
244
245 timer_reload = reload;
246 timer_ctrl |= ctrl;
247
248 if (timer_reload > 0x100000) {
249 timer_reload >>= 8;
250 timer_ctrl |= 0x08; /* /256 */
251 } else if (timer_reload > 0x010000) {
252 timer_reload >>= 4;
253 timer_ctrl |= 0x04; /* /16 */
254 }
255
256 /*
257 * Initialise to a known state (all timers off)
258 */
259 timer0->TimerControl = 0;
260 timer1->TimerControl = 0;
261 timer2->TimerControl = 0;
262
263 timer1->TimerLoad = timer_reload;
264 timer1->TimerValue = timer_reload;
265 timer1->TimerControl = timer_ctrl;
266
267 /*
268 * Make irqs happen for the system timer
269 */
270 setup_irq(IRQ_TIMERINT1, &integrator_timer_irq);
271}
diff --git a/arch/arm/mach-integrator/cpu.c b/arch/arm/mach-integrator/cpu.c
new file mode 100644
index 000000000000..71c58bff304c
--- /dev/null
+++ b/arch/arm/mach-integrator/cpu.c
@@ -0,0 +1,221 @@
1/*
2 * linux/arch/arm/mach-integrator/cpu.c
3 *
4 * Copyright (C) 2001-2002 Deep Blue Solutions Ltd.
5 *
6 * $Id: cpu.c,v 1.6 2002/07/18 13:58:51 rmk Exp $
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * CPU support functions
13 */
14#include <linux/module.h>
15#include <linux/types.h>
16#include <linux/kernel.h>
17#include <linux/cpufreq.h>
18#include <linux/slab.h>
19#include <linux/sched.h>
20#include <linux/smp.h>
21#include <linux/init.h>
22
23#include <asm/hardware.h>
24#include <asm/io.h>
25#include <asm/mach-types.h>
26#include <asm/hardware/icst525.h>
27
28static struct cpufreq_driver integrator_driver;
29
30#define CM_ID (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_ID_OFFSET)
31#define CM_OSC (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_OSC_OFFSET)
32#define CM_STAT (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_STAT_OFFSET)
33#define CM_LOCK (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET)
34
35static const struct icst525_params lclk_params = {
36 .ref = 24000,
37 .vco_max = 320000,
38 .vd_min = 8,
39 .vd_max = 132,
40 .rd_min = 24,
41 .rd_max = 24,
42};
43
44static const struct icst525_params cclk_params = {
45 .ref = 24000,
46 .vco_max = 320000,
47 .vd_min = 12,
48 .vd_max = 160,
49 .rd_min = 24,
50 .rd_max = 24,
51};
52
53/*
54 * Validate the speed policy.
55 */
56static int integrator_verify_policy(struct cpufreq_policy *policy)
57{
58 struct icst525_vco vco;
59
60 cpufreq_verify_within_limits(policy,
61 policy->cpuinfo.min_freq,
62 policy->cpuinfo.max_freq);
63
64 vco = icst525_khz_to_vco(&cclk_params, policy->max);
65 policy->max = icst525_khz(&cclk_params, vco);
66
67 vco = icst525_khz_to_vco(&cclk_params, policy->min);
68 policy->min = icst525_khz(&cclk_params, vco);
69
70 cpufreq_verify_within_limits(policy,
71 policy->cpuinfo.min_freq,
72 policy->cpuinfo.max_freq);
73
74 return 0;
75}
76
77
78static int integrator_set_target(struct cpufreq_policy *policy,
79 unsigned int target_freq,
80 unsigned int relation)
81{
82 cpumask_t cpus_allowed;
83 int cpu = policy->cpu;
84 struct icst525_vco vco;
85 struct cpufreq_freqs freqs;
86 u_int cm_osc;
87
88 /*
89 * Save this threads cpus_allowed mask.
90 */
91 cpus_allowed = current->cpus_allowed;
92
93 /*
94 * Bind to the specified CPU. When this call returns,
95 * we should be running on the right CPU.
96 */
97 set_cpus_allowed(current, cpumask_of_cpu(cpu));
98 BUG_ON(cpu != smp_processor_id());
99
100 /* get current setting */
101 cm_osc = __raw_readl(CM_OSC);
102
103 if (machine_is_integrator()) {
104 vco.s = (cm_osc >> 8) & 7;
105 } else if (machine_is_cintegrator()) {
106 vco.s = 1;
107 }
108 vco.v = cm_osc & 255;
109 vco.r = 22;
110 freqs.old = icst525_khz(&cclk_params, vco);
111
112 /* icst525_khz_to_vco rounds down -- so we need the next
113 * larger freq in case of CPUFREQ_RELATION_L.
114 */
115 if (relation == CPUFREQ_RELATION_L)
116 target_freq += 999;
117 if (target_freq > policy->max)
118 target_freq = policy->max;
119 vco = icst525_khz_to_vco(&cclk_params, target_freq);
120 freqs.new = icst525_khz(&cclk_params, vco);
121
122 freqs.cpu = policy->cpu;
123
124 if (freqs.old == freqs.new) {
125 set_cpus_allowed(current, cpus_allowed);
126 return 0;
127 }
128
129 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
130
131 cm_osc = __raw_readl(CM_OSC);
132
133 if (machine_is_integrator()) {
134 cm_osc &= 0xfffff800;
135 cm_osc |= vco.s << 8;
136 } else if (machine_is_cintegrator()) {
137 cm_osc &= 0xffffff00;
138 }
139 cm_osc |= vco.v;
140
141 __raw_writel(0xa05f, CM_LOCK);
142 __raw_writel(cm_osc, CM_OSC);
143 __raw_writel(0, CM_LOCK);
144
145 /*
146 * Restore the CPUs allowed mask.
147 */
148 set_cpus_allowed(current, cpus_allowed);
149
150 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
151
152 return 0;
153}
154
155static unsigned int integrator_get(unsigned int cpu)
156{
157 cpumask_t cpus_allowed;
158 unsigned int current_freq;
159 u_int cm_osc;
160 struct icst525_vco vco;
161
162 cpus_allowed = current->cpus_allowed;
163
164 set_cpus_allowed(current, cpumask_of_cpu(cpu));
165 BUG_ON(cpu != smp_processor_id());
166
167 /* detect memory etc. */
168 cm_osc = __raw_readl(CM_OSC);
169
170 if (machine_is_integrator()) {
171 vco.s = (cm_osc >> 8) & 7;
172 } else if (machine_is_cintegrator()) {
173 vco.s = 1;
174 }
175 vco.v = cm_osc & 255;
176 vco.r = 22;
177
178 current_freq = icst525_khz(&cclk_params, vco); /* current freq */
179
180 set_cpus_allowed(current, cpus_allowed);
181
182 return current_freq;
183}
184
185static int integrator_cpufreq_init(struct cpufreq_policy *policy)
186{
187
188 /* set default policy and cpuinfo */
189 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
190 policy->cpuinfo.max_freq = 160000;
191 policy->cpuinfo.min_freq = 12000;
192 policy->cpuinfo.transition_latency = 1000000; /* 1 ms, assumed */
193 policy->cur = policy->min = policy->max = integrator_get(policy->cpu);
194
195 return 0;
196}
197
198static struct cpufreq_driver integrator_driver = {
199 .verify = integrator_verify_policy,
200 .target = integrator_set_target,
201 .get = integrator_get,
202 .init = integrator_cpufreq_init,
203 .name = "integrator",
204};
205
206static int __init integrator_cpu_init(void)
207{
208 return cpufreq_register_driver(&integrator_driver);
209}
210
211static void __exit integrator_cpu_exit(void)
212{
213 cpufreq_unregister_driver(&integrator_driver);
214}
215
216MODULE_AUTHOR ("Russell M. King");
217MODULE_DESCRIPTION ("cpufreq driver for ARM Integrator CPUs");
218MODULE_LICENSE ("GPL");
219
220module_init(integrator_cpu_init);
221module_exit(integrator_cpu_exit);
diff --git a/arch/arm/mach-integrator/dma.c b/arch/arm/mach-integrator/dma.c
new file mode 100644
index 000000000000..aae6f23cd72b
--- /dev/null
+++ b/arch/arm/mach-integrator/dma.c
@@ -0,0 +1,35 @@
1/*
2 * linux/arch/arm/mach-integrator/dma.c
3 *
4 * Copyright (C) 1999 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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#include <linux/slab.h>
22#include <linux/mman.h>
23#include <linux/init.h>
24
25#include <asm/page.h>
26#include <asm/pgtable.h>
27#include <asm/dma.h>
28#include <asm/io.h>
29#include <asm/hardware.h>
30
31#include <asm/mach/dma.h>
32
33void __init arch_dma_init(dma_t *dma)
34{
35}
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c
new file mode 100644
index 000000000000..c3c2f17d030e
--- /dev/null
+++ b/arch/arm/mach-integrator/impd1.c
@@ -0,0 +1,475 @@
1/*
2 * linux/arch/arm/mach-integrator/impd1.c
3 *
4 * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This file provides the core support for the IM-PD1 module.
11 *
12 * Module / boot parameters.
13 * lmid=n impd1.lmid=n - set the logic module position in stack to 'n'
14 */
15#include <linux/module.h>
16#include <linux/moduleparam.h>
17#include <linux/init.h>
18#include <linux/device.h>
19#include <linux/errno.h>
20#include <linux/mm.h>
21
22#include <asm/io.h>
23#include <asm/hardware/icst525.h>
24#include <asm/hardware/amba.h>
25#include <asm/hardware/amba_clcd.h>
26#include <asm/arch/lm.h>
27#include <asm/arch/impd1.h>
28#include <asm/sizes.h>
29
30#include "clock.h"
31
32static int module_id;
33
34module_param_named(lmid, module_id, int, 0444);
35MODULE_PARM_DESC(lmid, "logic module stack position");
36
37struct impd1_module {
38 void __iomem *base;
39 struct clk vcos[2];
40};
41
42static const struct icst525_params impd1_vco_params = {
43 .ref = 24000, /* 24 MHz */
44 .vco_max = 200000, /* 200 MHz */
45 .vd_min = 12,
46 .vd_max = 519,
47 .rd_min = 3,
48 .rd_max = 120,
49};
50
51static void impd1_setvco(struct clk *clk, struct icst525_vco vco)
52{
53 struct impd1_module *impd1 = clk->data;
54 int vconr = clk - impd1->vcos;
55 u32 val;
56
57 val = vco.v | (vco.r << 9) | (vco.s << 16);
58
59 writel(0xa05f, impd1->base + IMPD1_LOCK);
60 switch (vconr) {
61 case 0:
62 writel(val, impd1->base + IMPD1_OSC1);
63 break;
64 case 1:
65 writel(val, impd1->base + IMPD1_OSC2);
66 break;
67 }
68 writel(0, impd1->base + IMPD1_LOCK);
69
70#if DEBUG
71 vco.v = val & 0x1ff;
72 vco.r = (val >> 9) & 0x7f;
73 vco.s = (val >> 16) & 7;
74
75 pr_debug("IM-PD1: VCO%d clock is %ld kHz\n",
76 vconr, icst525_khz(&impd1_vco_params, vco));
77#endif
78}
79
80void impd1_tweak_control(struct device *dev, u32 mask, u32 val)
81{
82 struct impd1_module *impd1 = dev_get_drvdata(dev);
83 u32 cur;
84
85 val &= mask;
86 cur = readl(impd1->base + IMPD1_CTRL) & ~mask;
87 writel(cur | val, impd1->base + IMPD1_CTRL);
88}
89
90EXPORT_SYMBOL(impd1_tweak_control);
91
92/*
93 * CLCD support
94 */
95#define PANEL PROSPECTOR
96
97#define LTM10C209 1
98#define PROSPECTOR 2
99#define SVGA 3
100#define VGA 4
101
102#if PANEL == VGA
103#define PANELTYPE vga
104static struct clcd_panel vga = {
105 .mode = {
106 .name = "VGA",
107 .refresh = 60,
108 .xres = 640,
109 .yres = 480,
110 .pixclock = 39721,
111 .left_margin = 40,
112 .right_margin = 24,
113 .upper_margin = 32,
114 .lower_margin = 11,
115 .hsync_len = 96,
116 .vsync_len = 2,
117 .sync = 0,
118 .vmode = FB_VMODE_NONINTERLACED,
119 },
120 .width = -1,
121 .height = -1,
122 .tim2 = TIM2_BCD | TIM2_IPC,
123 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
124 .connector = IMPD1_CTRL_DISP_VGA,
125 .bpp = 16,
126 .grayscale = 0,
127};
128
129#elif PANEL == SVGA
130#define PANELTYPE svga
131static struct clcd_panel svga = {
132 .mode = {
133 .name = "SVGA",
134 .refresh = 0,
135 .xres = 800,
136 .yres = 600,
137 .pixclock = 27778,
138 .left_margin = 20,
139 .right_margin = 20,
140 .upper_margin = 5,
141 .lower_margin = 5,
142 .hsync_len = 164,
143 .vsync_len = 62,
144 .sync = 0,
145 .vmode = FB_VMODE_NONINTERLACED,
146 },
147 .width = -1,
148 .height = -1,
149 .tim2 = TIM2_BCD,
150 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
151 .connector = IMPD1_CTRL_DISP_VGA,
152 .bpp = 16,
153 .grayscale = 0,
154};
155
156#elif PANEL == PROSPECTOR
157#define PANELTYPE prospector
158static struct clcd_panel prospector = {
159 .mode = {
160 .name = "PROSPECTOR",
161 .refresh = 0,
162 .xres = 640,
163 .yres = 480,
164 .pixclock = 40000,
165 .left_margin = 33,
166 .right_margin = 64,
167 .upper_margin = 36,
168 .lower_margin = 7,
169 .hsync_len = 64,
170 .vsync_len = 25,
171 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
172 .vmode = FB_VMODE_NONINTERLACED,
173 },
174 .width = -1,
175 .height = -1,
176 .tim2 = TIM2_BCD,
177 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
178 .fixedtimings = 1,
179 .connector = IMPD1_CTRL_DISP_LCD,
180 .bpp = 16,
181 .grayscale = 0,
182};
183
184#elif PANEL == LTM10C209
185#define PANELTYPE ltm10c209
186/*
187 * Untested.
188 */
189static struct clcd_panel ltm10c209 = {
190 .mode = {
191 .name = "LTM10C209",
192 .refresh = 0,
193 .xres = 640,
194 .yres = 480,
195 .pixclock = 40000,
196 .left_margin = 20,
197 .right_margin = 20,
198 .upper_margin = 19,
199 .lower_margin = 19,
200 .hsync_len = 20,
201 .vsync_len = 10,
202 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
203 .vmode = FB_VMODE_NONINTERLACED,
204 },
205 .width = -1,
206 .height = -1,
207 .tim2 = TIM2_BCD,
208 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
209 .fixedtimings = 1,
210 .connector = IMPD1_CTRL_DISP_LCD,
211 .bpp = 16,
212 .grayscale = 0,
213};
214#endif
215
216/*
217 * Disable all display connectors on the interface module.
218 */
219static void impd1fb_clcd_disable(struct clcd_fb *fb)
220{
221 impd1_tweak_control(fb->dev->dev.parent, IMPD1_CTRL_DISP_MASK, 0);
222}
223
224/*
225 * Enable the relevant connector on the interface module.
226 */
227static void impd1fb_clcd_enable(struct clcd_fb *fb)
228{
229 impd1_tweak_control(fb->dev->dev.parent, IMPD1_CTRL_DISP_MASK,
230 fb->panel->connector | IMPD1_CTRL_DISP_ENABLE);
231}
232
233static int impd1fb_clcd_setup(struct clcd_fb *fb)
234{
235 unsigned long framebase = fb->dev->res.start + 0x01000000;
236 unsigned long framesize = SZ_1M;
237 int ret = 0;
238
239 fb->panel = &PANELTYPE;
240
241 if (!request_mem_region(framebase, framesize, "clcd framebuffer")) {
242 printk(KERN_ERR "IM-PD1: unable to reserve framebuffer\n");
243 return -EBUSY;
244 }
245
246 fb->fb.screen_base = ioremap(framebase, framesize);
247 if (!fb->fb.screen_base) {
248 printk(KERN_ERR "IM-PD1: unable to map framebuffer\n");
249 ret = -ENOMEM;
250 goto free_buffer;
251 }
252
253 fb->fb.fix.smem_start = framebase;
254 fb->fb.fix.smem_len = framesize;
255
256 return 0;
257
258 free_buffer:
259 release_mem_region(framebase, framesize);
260 return ret;
261}
262
263static int impd1fb_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
264{
265 unsigned long start, size;
266
267 start = vma->vm_pgoff + (fb->fb.fix.smem_start >> PAGE_SHIFT);
268 size = vma->vm_end - vma->vm_start;
269
270 return remap_pfn_range(vma, vma->vm_start, start, size,
271 vma->vm_page_prot);
272}
273
274static void impd1fb_clcd_remove(struct clcd_fb *fb)
275{
276 iounmap(fb->fb.screen_base);
277 release_mem_region(fb->fb.fix.smem_start, fb->fb.fix.smem_len);
278}
279
280static struct clcd_board impd1_clcd_data = {
281 .name = "IM-PD/1",
282 .check = clcdfb_check,
283 .decode = clcdfb_decode,
284 .disable = impd1fb_clcd_disable,
285 .enable = impd1fb_clcd_enable,
286 .setup = impd1fb_clcd_setup,
287 .mmap = impd1fb_clcd_mmap,
288 .remove = impd1fb_clcd_remove,
289};
290
291struct impd1_device {
292 unsigned long offset;
293 unsigned int irq[2];
294 unsigned int id;
295 void *platform_data;
296};
297
298static struct impd1_device impd1_devs[] = {
299 {
300 .offset = 0x03000000,
301 .id = 0x00041190,
302 }, {
303 .offset = 0x00100000,
304 .irq = { 1 },
305 .id = 0x00141011,
306 }, {
307 .offset = 0x00200000,
308 .irq = { 2 },
309 .id = 0x00141011,
310 }, {
311 .offset = 0x00300000,
312 .irq = { 3 },
313 .id = 0x00041022,
314 }, {
315 .offset = 0x00400000,
316 .irq = { 4 },
317 .id = 0x00041061,
318 }, {
319 .offset = 0x00500000,
320 .irq = { 5 },
321 .id = 0x00041061,
322 }, {
323 .offset = 0x00600000,
324 .irq = { 6 },
325 .id = 0x00041130,
326 }, {
327 .offset = 0x00700000,
328 .irq = { 7, 8 },
329 .id = 0x00041181,
330 }, {
331 .offset = 0x00800000,
332 .irq = { 9 },
333 .id = 0x00041041,
334 }, {
335 .offset = 0x01000000,
336 .irq = { 11 },
337 .id = 0x00041110,
338 .platform_data = &impd1_clcd_data,
339 }
340};
341
342static const char *impd1_vconames[2] = {
343 "CLCDCLK",
344 "AUXVCO2",
345};
346
347static int impd1_probe(struct lm_device *dev)
348{
349 struct impd1_module *impd1;
350 int i, ret;
351
352 if (dev->id != module_id)
353 return -EINVAL;
354
355 if (!request_mem_region(dev->resource.start, SZ_4K, "LM registers"))
356 return -EBUSY;
357
358 impd1 = kmalloc(sizeof(struct impd1_module), GFP_KERNEL);
359 if (!impd1) {
360 ret = -ENOMEM;
361 goto release_lm;
362 }
363 memset(impd1, 0, sizeof(struct impd1_module));
364
365 impd1->base = ioremap(dev->resource.start, SZ_4K);
366 if (!impd1->base) {
367 ret = -ENOMEM;
368 goto free_impd1;
369 }
370
371 lm_set_drvdata(dev, impd1);
372
373 printk("IM-PD1 found at 0x%08lx\n", dev->resource.start);
374
375 for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) {
376 impd1->vcos[i].owner = THIS_MODULE,
377 impd1->vcos[i].name = impd1_vconames[i],
378 impd1->vcos[i].params = &impd1_vco_params,
379 impd1->vcos[i].data = impd1,
380 impd1->vcos[i].setvco = impd1_setvco;
381
382 clk_register(&impd1->vcos[i]);
383 }
384
385 for (i = 0; i < ARRAY_SIZE(impd1_devs); i++) {
386 struct impd1_device *idev = impd1_devs + i;
387 struct amba_device *d;
388 unsigned long pc_base;
389
390 pc_base = dev->resource.start + idev->offset;
391
392 d = kmalloc(sizeof(struct amba_device), GFP_KERNEL);
393 if (!d)
394 continue;
395
396 memset(d, 0, sizeof(struct amba_device));
397
398 snprintf(d->dev.bus_id, sizeof(d->dev.bus_id),
399 "lm%x:%5.5lx", dev->id, idev->offset >> 12);
400
401 d->dev.parent = &dev->dev;
402 d->res.start = dev->resource.start + idev->offset;
403 d->res.end = d->res.start + SZ_4K - 1;
404 d->res.flags = IORESOURCE_MEM;
405 d->irq[0] = dev->irq;
406 d->irq[1] = dev->irq;
407 d->periphid = idev->id;
408 d->dev.platform_data = idev->platform_data;
409
410 ret = amba_device_register(d, &dev->resource);
411 if (ret) {
412 printk("unable to register device %s: %d\n",
413 d->dev.bus_id, ret);
414 kfree(d);
415 }
416 }
417
418 return 0;
419
420 free_impd1:
421 if (impd1 && impd1->base)
422 iounmap(impd1->base);
423 if (impd1)
424 kfree(impd1);
425 release_lm:
426 release_mem_region(dev->resource.start, SZ_4K);
427 return ret;
428}
429
430static void impd1_remove(struct lm_device *dev)
431{
432 struct impd1_module *impd1 = lm_get_drvdata(dev);
433 struct list_head *l, *n;
434 int i;
435
436 list_for_each_safe(l, n, &dev->dev.children) {
437 struct device *d = list_to_dev(l);
438
439 device_unregister(d);
440 }
441
442 for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++)
443 clk_unregister(&impd1->vcos[i]);
444
445 lm_set_drvdata(dev, NULL);
446
447 iounmap(impd1->base);
448 kfree(impd1);
449 release_mem_region(dev->resource.start, SZ_4K);
450}
451
452static struct lm_driver impd1_driver = {
453 .drv = {
454 .name = "impd1",
455 },
456 .probe = impd1_probe,
457 .remove = impd1_remove,
458};
459
460static int __init impd1_init(void)
461{
462 return lm_driver_register(&impd1_driver);
463}
464
465static void __exit impd1_exit(void)
466{
467 lm_driver_unregister(&impd1_driver);
468}
469
470module_init(impd1_init);
471module_exit(impd1_exit);
472
473MODULE_LICENSE("GPL");
474MODULE_DESCRIPTION("Integrator/IM-PD1 logic module core driver");
475MODULE_AUTHOR("Deep Blue Solutions Ltd");
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
new file mode 100644
index 000000000000..91ba9fd79c87
--- /dev/null
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -0,0 +1,302 @@
1/*
2 * linux/arch/arm/mach-integrator/integrator_ap.c
3 *
4 * Copyright (C) 2000-2003 Deep Blue Solutions Ltd
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/types.h>
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/list.h>
24#include <linux/device.h>
25#include <linux/slab.h>
26#include <linux/string.h>
27#include <linux/sysdev.h>
28
29#include <asm/hardware.h>
30#include <asm/io.h>
31#include <asm/irq.h>
32#include <asm/setup.h>
33#include <asm/mach-types.h>
34#include <asm/hardware/amba.h>
35#include <asm/hardware/amba_kmi.h>
36
37#include <asm/arch/lm.h>
38
39#include <asm/mach/arch.h>
40#include <asm/mach/flash.h>
41#include <asm/mach/irq.h>
42#include <asm/mach/map.h>
43#include <asm/mach/time.h>
44
45#include "common.h"
46
47/*
48 * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx
49 * is the (PA >> 12).
50 *
51 * Setup a VA for the Integrator interrupt controller (for header #0,
52 * just for now).
53 */
54#define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE)
55#define VA_SC_BASE IO_ADDRESS(INTEGRATOR_SC_BASE)
56#define VA_EBI_BASE IO_ADDRESS(INTEGRATOR_EBI_BASE)
57#define VA_CMIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_IC_OFFSET
58
59/*
60 * Logical Physical
61 * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M)
62 * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M)
63 * ed000000 62000000 PCI V3 regs PHYS_PCI_V3_BASE (max 64k)
64 * ee000000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M)
65 * ef000000 Cache flush
66 * f1000000 10000000 Core module registers
67 * f1100000 11000000 System controller registers
68 * f1200000 12000000 EBI registers
69 * f1300000 13000000 Counter/Timer
70 * f1400000 14000000 Interrupt controller
71 * f1600000 16000000 UART 0
72 * f1700000 17000000 UART 1
73 * f1a00000 1a000000 Debug LEDs
74 * f1b00000 1b000000 GPIO
75 */
76
77static struct map_desc ap_io_desc[] __initdata = {
78 { IO_ADDRESS(INTEGRATOR_HDR_BASE), INTEGRATOR_HDR_BASE, SZ_4K, MT_DEVICE },
79 { IO_ADDRESS(INTEGRATOR_SC_BASE), INTEGRATOR_SC_BASE, SZ_4K, MT_DEVICE },
80 { IO_ADDRESS(INTEGRATOR_EBI_BASE), INTEGRATOR_EBI_BASE, SZ_4K, MT_DEVICE },
81 { IO_ADDRESS(INTEGRATOR_CT_BASE), INTEGRATOR_CT_BASE, SZ_4K, MT_DEVICE },
82 { IO_ADDRESS(INTEGRATOR_IC_BASE), INTEGRATOR_IC_BASE, SZ_4K, MT_DEVICE },
83 { IO_ADDRESS(INTEGRATOR_UART0_BASE), INTEGRATOR_UART0_BASE, SZ_4K, MT_DEVICE },
84 { IO_ADDRESS(INTEGRATOR_UART1_BASE), INTEGRATOR_UART1_BASE, SZ_4K, MT_DEVICE },
85 { IO_ADDRESS(INTEGRATOR_DBG_BASE), INTEGRATOR_DBG_BASE, SZ_4K, MT_DEVICE },
86 { IO_ADDRESS(INTEGRATOR_GPIO_BASE), INTEGRATOR_GPIO_BASE, SZ_4K, MT_DEVICE },
87 { PCI_MEMORY_VADDR, PHYS_PCI_MEM_BASE, SZ_16M, MT_DEVICE },
88 { PCI_CONFIG_VADDR, PHYS_PCI_CONFIG_BASE, SZ_16M, MT_DEVICE },
89 { PCI_V3_VADDR, PHYS_PCI_V3_BASE, SZ_64K, MT_DEVICE },
90 { PCI_IO_VADDR, PHYS_PCI_IO_BASE, SZ_64K, MT_DEVICE }
91};
92
93static void __init ap_map_io(void)
94{
95 iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc));
96}
97
98#define INTEGRATOR_SC_VALID_INT 0x003fffff
99
100static void sc_mask_irq(unsigned int irq)
101{
102 writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_CLEAR);
103}
104
105static void sc_unmask_irq(unsigned int irq)
106{
107 writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_SET);
108}
109
110static struct irqchip sc_chip = {
111 .ack = sc_mask_irq,
112 .mask = sc_mask_irq,
113 .unmask = sc_unmask_irq,
114};
115
116static void __init ap_init_irq(void)
117{
118 unsigned int i;
119
120 /* Disable all interrupts initially. */
121 /* Do the core module ones */
122 writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR);
123
124 /* do the header card stuff next */
125 writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR);
126 writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR);
127
128 for (i = 0; i < NR_IRQS; i++) {
129 if (((1 << i) & INTEGRATOR_SC_VALID_INT) != 0) {
130 set_irq_chip(i, &sc_chip);
131 set_irq_handler(i, do_level_IRQ);
132 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
133 }
134 }
135}
136
137#ifdef CONFIG_PM
138static unsigned long ic_irq_enable;
139
140static int irq_suspend(struct sys_device *dev, pm_message_t state)
141{
142 ic_irq_enable = readl(VA_IC_BASE + IRQ_ENABLE);
143 return 0;
144}
145
146static int irq_resume(struct sys_device *dev)
147{
148 /* disable all irq sources */
149 writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR);
150 writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR);
151 writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR);
152
153 writel(ic_irq_enable, VA_IC_BASE + IRQ_ENABLE_SET);
154 return 0;
155}
156#else
157#define irq_suspend NULL
158#define irq_resume NULL
159#endif
160
161static struct sysdev_class irq_class = {
162 set_kset_name("irq"),
163 .suspend = irq_suspend,
164 .resume = irq_resume,
165};
166
167static struct sys_device irq_device = {
168 .id = 0,
169 .cls = &irq_class,
170};
171
172static int __init irq_init_sysfs(void)
173{
174 int ret = sysdev_class_register(&irq_class);
175 if (ret == 0)
176 ret = sysdev_register(&irq_device);
177 return ret;
178}
179
180device_initcall(irq_init_sysfs);
181
182/*
183 * Flash handling.
184 */
185#define SC_CTRLC (VA_SC_BASE + INTEGRATOR_SC_CTRLC_OFFSET)
186#define SC_CTRLS (VA_SC_BASE + INTEGRATOR_SC_CTRLS_OFFSET)
187#define EBI_CSR1 (VA_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET)
188#define EBI_LOCK (VA_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET)
189
190static int ap_flash_init(void)
191{
192 u32 tmp;
193
194 writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, SC_CTRLC);
195
196 tmp = readl(EBI_CSR1) | INTEGRATOR_EBI_WRITE_ENABLE;
197 writel(tmp, EBI_CSR1);
198
199 if (!(readl(EBI_CSR1) & INTEGRATOR_EBI_WRITE_ENABLE)) {
200 writel(0xa05f, EBI_LOCK);
201 writel(tmp, EBI_CSR1);
202 writel(0, EBI_LOCK);
203 }
204 return 0;
205}
206
207static void ap_flash_exit(void)
208{
209 u32 tmp;
210
211 writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, SC_CTRLC);
212
213 tmp = readl(EBI_CSR1) & ~INTEGRATOR_EBI_WRITE_ENABLE;
214 writel(tmp, EBI_CSR1);
215
216 if (readl(EBI_CSR1) & INTEGRATOR_EBI_WRITE_ENABLE) {
217 writel(0xa05f, EBI_LOCK);
218 writel(tmp, EBI_CSR1);
219 writel(0, EBI_LOCK);
220 }
221}
222
223static void ap_flash_set_vpp(int on)
224{
225 unsigned long reg = on ? SC_CTRLS : SC_CTRLC;
226
227 writel(INTEGRATOR_SC_CTRL_nFLVPPEN, reg);
228}
229
230static struct flash_platform_data ap_flash_data = {
231 .map_name = "cfi_probe",
232 .width = 4,
233 .init = ap_flash_init,
234 .exit = ap_flash_exit,
235 .set_vpp = ap_flash_set_vpp,
236};
237
238static struct resource cfi_flash_resource = {
239 .start = INTEGRATOR_FLASH_BASE,
240 .end = INTEGRATOR_FLASH_BASE + INTEGRATOR_FLASH_SIZE - 1,
241 .flags = IORESOURCE_MEM,
242};
243
244static struct platform_device cfi_flash_device = {
245 .name = "armflash",
246 .id = 0,
247 .dev = {
248 .platform_data = &ap_flash_data,
249 },
250 .num_resources = 1,
251 .resource = &cfi_flash_resource,
252};
253
254static void __init ap_init(void)
255{
256 unsigned long sc_dec;
257 int i;
258
259 platform_device_register(&cfi_flash_device);
260
261 sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET);
262 for (i = 0; i < 4; i++) {
263 struct lm_device *lmdev;
264
265 if ((sc_dec & (16 << i)) == 0)
266 continue;
267
268 lmdev = kmalloc(sizeof(struct lm_device), GFP_KERNEL);
269 if (!lmdev)
270 continue;
271
272 memset(lmdev, 0, sizeof(struct lm_device));
273
274 lmdev->resource.start = 0xc0000000 + 0x10000000 * i;
275 lmdev->resource.end = lmdev->resource.start + 0x0fffffff;
276 lmdev->resource.flags = IORESOURCE_MEM;
277 lmdev->irq = IRQ_AP_EXPINT0 + i;
278 lmdev->id = i;
279
280 lm_device_register(lmdev);
281 }
282}
283
284static void __init ap_init_timer(void)
285{
286 integrator_time_init(1000000 * TICKS_PER_uSEC / HZ, 0);
287}
288
289static struct sys_timer ap_timer = {
290 .init = ap_init_timer,
291 .offset = integrator_gettimeoffset,
292};
293
294MACHINE_START(INTEGRATOR, "ARM-Integrator")
295 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd")
296 BOOT_MEM(0x00000000, 0x16000000, 0xf1600000)
297 BOOT_PARAMS(0x00000100)
298 MAPIO(ap_map_io)
299 INITIRQ(ap_init_irq)
300 .timer = &ap_timer,
301 INIT_MACHINE(ap_init)
302MACHINE_END
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
new file mode 100644
index 000000000000..68e15c36e336
--- /dev/null
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -0,0 +1,528 @@
1/*
2 * linux/arch/arm/mach-integrator/integrator_cp.c
3 *
4 * Copyright (C) 2003 Deep Blue Solutions Ltd
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License.
9 */
10#include <linux/types.h>
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/list.h>
14#include <linux/device.h>
15#include <linux/dma-mapping.h>
16#include <linux/slab.h>
17#include <linux/string.h>
18#include <linux/sysdev.h>
19
20#include <asm/hardware.h>
21#include <asm/io.h>
22#include <asm/irq.h>
23#include <asm/setup.h>
24#include <asm/mach-types.h>
25#include <asm/hardware/amba.h>
26#include <asm/hardware/amba_kmi.h>
27#include <asm/hardware/amba_clcd.h>
28#include <asm/hardware/icst525.h>
29
30#include <asm/arch/cm.h>
31#include <asm/arch/lm.h>
32
33#include <asm/mach/arch.h>
34#include <asm/mach/flash.h>
35#include <asm/mach/irq.h>
36#include <asm/mach/mmc.h>
37#include <asm/mach/map.h>
38#include <asm/mach/time.h>
39
40#include "common.h"
41#include "clock.h"
42
43#define INTCP_PA_MMC_BASE 0x1c000000
44#define INTCP_PA_AACI_BASE 0x1d000000
45
46#define INTCP_PA_FLASH_BASE 0x24000000
47#define INTCP_FLASH_SIZE SZ_32M
48
49#define INTCP_PA_CLCD_BASE 0xc0000000
50
51#define INTCP_VA_CIC_BASE 0xf1000040
52#define INTCP_VA_PIC_BASE 0xf1400000
53#define INTCP_VA_SIC_BASE 0xfca00000
54
55#define INTCP_PA_ETH_BASE 0xc8000000
56#define INTCP_ETH_SIZE 0x10
57
58#define INTCP_VA_CTRL_BASE 0xfcb00000
59#define INTCP_FLASHPROG 0x04
60#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0)
61#define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1)
62
63/*
64 * Logical Physical
65 * f1000000 10000000 Core module registers
66 * f1100000 11000000 System controller registers
67 * f1200000 12000000 EBI registers
68 * f1300000 13000000 Counter/Timer
69 * f1400000 14000000 Interrupt controller
70 * f1600000 16000000 UART 0
71 * f1700000 17000000 UART 1
72 * f1a00000 1a000000 Debug LEDs
73 * f1b00000 1b000000 GPIO
74 */
75
76static struct map_desc intcp_io_desc[] __initdata = {
77 { IO_ADDRESS(INTEGRATOR_HDR_BASE), INTEGRATOR_HDR_BASE, SZ_4K, MT_DEVICE },
78 { IO_ADDRESS(INTEGRATOR_SC_BASE), INTEGRATOR_SC_BASE, SZ_4K, MT_DEVICE },
79 { IO_ADDRESS(INTEGRATOR_EBI_BASE), INTEGRATOR_EBI_BASE, SZ_4K, MT_DEVICE },
80 { IO_ADDRESS(INTEGRATOR_CT_BASE), INTEGRATOR_CT_BASE, SZ_4K, MT_DEVICE },
81 { IO_ADDRESS(INTEGRATOR_IC_BASE), INTEGRATOR_IC_BASE, SZ_4K, MT_DEVICE },
82 { IO_ADDRESS(INTEGRATOR_UART0_BASE), INTEGRATOR_UART0_BASE, SZ_4K, MT_DEVICE },
83 { IO_ADDRESS(INTEGRATOR_UART1_BASE), INTEGRATOR_UART1_BASE, SZ_4K, MT_DEVICE },
84 { IO_ADDRESS(INTEGRATOR_DBG_BASE), INTEGRATOR_DBG_BASE, SZ_4K, MT_DEVICE },
85 { IO_ADDRESS(INTEGRATOR_GPIO_BASE), INTEGRATOR_GPIO_BASE, SZ_4K, MT_DEVICE },
86 { 0xfc900000, 0xc9000000, SZ_4K, MT_DEVICE },
87 { 0xfca00000, 0xca000000, SZ_4K, MT_DEVICE },
88 { 0xfcb00000, 0xcb000000, SZ_4K, MT_DEVICE },
89};
90
91static void __init intcp_map_io(void)
92{
93 iotable_init(intcp_io_desc, ARRAY_SIZE(intcp_io_desc));
94}
95
96#define cic_writel __raw_writel
97#define cic_readl __raw_readl
98#define pic_writel __raw_writel
99#define pic_readl __raw_readl
100#define sic_writel __raw_writel
101#define sic_readl __raw_readl
102
103static void cic_mask_irq(unsigned int irq)
104{
105 irq -= IRQ_CIC_START;
106 cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR);
107}
108
109static void cic_unmask_irq(unsigned int irq)
110{
111 irq -= IRQ_CIC_START;
112 cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_SET);
113}
114
115static struct irqchip cic_chip = {
116 .ack = cic_mask_irq,
117 .mask = cic_mask_irq,
118 .unmask = cic_unmask_irq,
119};
120
121static void pic_mask_irq(unsigned int irq)
122{
123 irq -= IRQ_PIC_START;
124 pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR);
125}
126
127static void pic_unmask_irq(unsigned int irq)
128{
129 irq -= IRQ_PIC_START;
130 pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_SET);
131}
132
133static struct irqchip pic_chip = {
134 .ack = pic_mask_irq,
135 .mask = pic_mask_irq,
136 .unmask = pic_unmask_irq,
137};
138
139static void sic_mask_irq(unsigned int irq)
140{
141 irq -= IRQ_SIC_START;
142 sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR);
143}
144
145static void sic_unmask_irq(unsigned int irq)
146{
147 irq -= IRQ_SIC_START;
148 sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_SET);
149}
150
151static struct irqchip sic_chip = {
152 .ack = sic_mask_irq,
153 .mask = sic_mask_irq,
154 .unmask = sic_unmask_irq,
155};
156
157static void
158sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
159{
160 unsigned long status = sic_readl(INTCP_VA_SIC_BASE + IRQ_STATUS);
161
162 if (status == 0) {
163 do_bad_IRQ(irq, desc, regs);
164 return;
165 }
166
167 do {
168 irq = ffs(status) - 1;
169 status &= ~(1 << irq);
170
171 irq += IRQ_SIC_START;
172
173 desc = irq_desc + irq;
174 desc->handle(irq, desc, regs);
175 } while (status);
176}
177
178static void __init intcp_init_irq(void)
179{
180 unsigned int i;
181
182 /*
183 * Disable all interrupt sources
184 */
185 pic_writel(0xffffffff, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR);
186 pic_writel(0xffffffff, INTCP_VA_PIC_BASE + FIQ_ENABLE_CLEAR);
187
188 for (i = IRQ_PIC_START; i <= IRQ_PIC_END; i++) {
189 if (i == 11)
190 i = 22;
191 if (i == IRQ_CP_CPPLDINT)
192 i++;
193 if (i == 29)
194 break;
195 set_irq_chip(i, &pic_chip);
196 set_irq_handler(i, do_level_IRQ);
197 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
198 }
199
200 cic_writel(0xffffffff, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR);
201 cic_writel(0xffffffff, INTCP_VA_CIC_BASE + FIQ_ENABLE_CLEAR);
202
203 for (i = IRQ_CIC_START; i <= IRQ_CIC_END; i++) {
204 set_irq_chip(i, &cic_chip);
205 set_irq_handler(i, do_level_IRQ);
206 set_irq_flags(i, IRQF_VALID);
207 }
208
209 sic_writel(0x00000fff, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR);
210 sic_writel(0x00000fff, INTCP_VA_SIC_BASE + FIQ_ENABLE_CLEAR);
211
212 for (i = IRQ_SIC_START; i <= IRQ_SIC_END; i++) {
213 set_irq_chip(i, &sic_chip);
214 set_irq_handler(i, do_level_IRQ);
215 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
216 }
217
218 set_irq_handler(IRQ_CP_CPPLDINT, sic_handle_irq);
219 pic_unmask_irq(IRQ_CP_CPPLDINT);
220}
221
222/*
223 * Clock handling
224 */
225#define CM_LOCK (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET)
226#define CM_AUXOSC (IO_ADDRESS(INTEGRATOR_HDR_BASE)+0x1c)
227
228static const struct icst525_params cp_auxvco_params = {
229 .ref = 24000,
230 .vco_max = 320000,
231 .vd_min = 8,
232 .vd_max = 263,
233 .rd_min = 3,
234 .rd_max = 65,
235};
236
237static void cp_auxvco_set(struct clk *clk, struct icst525_vco vco)
238{
239 u32 val;
240
241 val = readl(CM_AUXOSC) & ~0x7ffff;
242 val |= vco.v | (vco.r << 9) | (vco.s << 16);
243
244 writel(0xa05f, CM_LOCK);
245 writel(val, CM_AUXOSC);
246 writel(0, CM_LOCK);
247}
248
249static struct clk cp_clcd_clk = {
250 .name = "CLCDCLK",
251 .params = &cp_auxvco_params,
252 .setvco = cp_auxvco_set,
253};
254
255static struct clk cp_mmci_clk = {
256 .name = "MCLK",
257 .rate = 14745600,
258};
259
260/*
261 * Flash handling.
262 */
263static int intcp_flash_init(void)
264{
265 u32 val;
266
267 val = readl(INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
268 val |= CINTEGRATOR_FLASHPROG_FLWREN;
269 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
270
271 return 0;
272}
273
274static void intcp_flash_exit(void)
275{
276 u32 val;
277
278 val = readl(INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
279 val &= ~(CINTEGRATOR_FLASHPROG_FLVPPEN|CINTEGRATOR_FLASHPROG_FLWREN);
280 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
281}
282
283static void intcp_flash_set_vpp(int on)
284{
285 u32 val;
286
287 val = readl(INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
288 if (on)
289 val |= CINTEGRATOR_FLASHPROG_FLVPPEN;
290 else
291 val &= ~CINTEGRATOR_FLASHPROG_FLVPPEN;
292 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
293}
294
295static struct flash_platform_data intcp_flash_data = {
296 .map_name = "cfi_probe",
297 .width = 4,
298 .init = intcp_flash_init,
299 .exit = intcp_flash_exit,
300 .set_vpp = intcp_flash_set_vpp,
301};
302
303static struct resource intcp_flash_resource = {
304 .start = INTCP_PA_FLASH_BASE,
305 .end = INTCP_PA_FLASH_BASE + INTCP_FLASH_SIZE - 1,
306 .flags = IORESOURCE_MEM,
307};
308
309static struct platform_device intcp_flash_device = {
310 .name = "armflash",
311 .id = 0,
312 .dev = {
313 .platform_data = &intcp_flash_data,
314 },
315 .num_resources = 1,
316 .resource = &intcp_flash_resource,
317};
318
319static struct resource smc91x_resources[] = {
320 [0] = {
321 .start = INTCP_PA_ETH_BASE,
322 .end = INTCP_PA_ETH_BASE + INTCP_ETH_SIZE - 1,
323 .flags = IORESOURCE_MEM,
324 },
325 [1] = {
326 .start = IRQ_CP_ETHINT,
327 .end = IRQ_CP_ETHINT,
328 .flags = IORESOURCE_IRQ,
329 },
330};
331
332static struct platform_device smc91x_device = {
333 .name = "smc91x",
334 .id = 0,
335 .num_resources = ARRAY_SIZE(smc91x_resources),
336 .resource = smc91x_resources,
337};
338
339static struct platform_device *intcp_devs[] __initdata = {
340 &intcp_flash_device,
341 &smc91x_device,
342};
343
344/*
345 * It seems that the card insertion interrupt remains active after
346 * we've acknowledged it. We therefore ignore the interrupt, and
347 * rely on reading it from the SIC. This also means that we must
348 * clear the latched interrupt.
349 */
350static unsigned int mmc_status(struct device *dev)
351{
352 unsigned int status = readl(0xfca00004);
353 writel(8, 0xfcb00008);
354
355 return status & 8;
356}
357
358static struct mmc_platform_data mmc_data = {
359 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
360 .status = mmc_status,
361};
362
363static struct amba_device mmc_device = {
364 .dev = {
365 .bus_id = "mb:1c",
366 .platform_data = &mmc_data,
367 },
368 .res = {
369 .start = INTCP_PA_MMC_BASE,
370 .end = INTCP_PA_MMC_BASE + SZ_4K - 1,
371 .flags = IORESOURCE_MEM,
372 },
373 .irq = { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 },
374 .periphid = 0,
375};
376
377static struct amba_device aaci_device = {
378 .dev = {
379 .bus_id = "mb:1d",
380 },
381 .res = {
382 .start = INTCP_PA_AACI_BASE,
383 .end = INTCP_PA_AACI_BASE + SZ_4K - 1,
384 .flags = IORESOURCE_MEM,
385 },
386 .irq = { IRQ_CP_AACIINT, NO_IRQ },
387 .periphid = 0,
388};
389
390
391/*
392 * CLCD support
393 */
394static struct clcd_panel vga = {
395 .mode = {
396 .name = "VGA",
397 .refresh = 60,
398 .xres = 640,
399 .yres = 480,
400 .pixclock = 39721,
401 .left_margin = 40,
402 .right_margin = 24,
403 .upper_margin = 32,
404 .lower_margin = 11,
405 .hsync_len = 96,
406 .vsync_len = 2,
407 .sync = 0,
408 .vmode = FB_VMODE_NONINTERLACED,
409 },
410 .width = -1,
411 .height = -1,
412 .tim2 = TIM2_BCD | TIM2_IPC,
413 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
414 .bpp = 16,
415 .grayscale = 0,
416};
417
418/*
419 * Ensure VGA is selected.
420 */
421static void cp_clcd_enable(struct clcd_fb *fb)
422{
423 cm_control(CM_CTRL_LCDMUXSEL_MASK, CM_CTRL_LCDMUXSEL_VGA);
424}
425
426static unsigned long framesize = SZ_1M;
427
428static int cp_clcd_setup(struct clcd_fb *fb)
429{
430 dma_addr_t dma;
431
432 fb->panel = &vga;
433
434 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize,
435 &dma, GFP_KERNEL);
436 if (!fb->fb.screen_base) {
437 printk(KERN_ERR "CLCD: unable to map framebuffer\n");
438 return -ENOMEM;
439 }
440
441 fb->fb.fix.smem_start = dma;
442 fb->fb.fix.smem_len = framesize;
443
444 return 0;
445}
446
447static int cp_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
448{
449 return dma_mmap_writecombine(&fb->dev->dev, vma,
450 fb->fb.screen_base,
451 fb->fb.fix.smem_start,
452 fb->fb.fix.smem_len);
453}
454
455static void cp_clcd_remove(struct clcd_fb *fb)
456{
457 dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
458 fb->fb.screen_base, fb->fb.fix.smem_start);
459}
460
461static struct clcd_board clcd_data = {
462 .name = "Integrator/CP",
463 .check = clcdfb_check,
464 .decode = clcdfb_decode,
465 .enable = cp_clcd_enable,
466 .setup = cp_clcd_setup,
467 .mmap = cp_clcd_mmap,
468 .remove = cp_clcd_remove,
469};
470
471static struct amba_device clcd_device = {
472 .dev = {
473 .bus_id = "mb:c0",
474 .coherent_dma_mask = ~0,
475 .platform_data = &clcd_data,
476 },
477 .res = {
478 .start = INTCP_PA_CLCD_BASE,
479 .end = INTCP_PA_CLCD_BASE + SZ_4K - 1,
480 .flags = IORESOURCE_MEM,
481 },
482 .dma_mask = ~0,
483 .irq = { IRQ_CP_CLCDCINT, NO_IRQ },
484 .periphid = 0,
485};
486
487static struct amba_device *amba_devs[] __initdata = {
488 &mmc_device,
489 &aaci_device,
490 &clcd_device,
491};
492
493static void __init intcp_init(void)
494{
495 int i;
496
497 clk_register(&cp_clcd_clk);
498 clk_register(&cp_mmci_clk);
499
500 platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs));
501
502 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
503 struct amba_device *d = amba_devs[i];
504 amba_device_register(d, &iomem_resource);
505 }
506}
507
508#define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable */
509
510static void __init intcp_timer_init(void)
511{
512 integrator_time_init(1000000 / HZ, TIMER_CTRL_IE);
513}
514
515static struct sys_timer cp_timer = {
516 .init = intcp_timer_init,
517 .offset = integrator_gettimeoffset,
518};
519
520MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
521 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd")
522 BOOT_MEM(0x00000000, 0x16000000, 0xf1600000)
523 BOOT_PARAMS(0x00000100)
524 MAPIO(intcp_map_io)
525 INITIRQ(intcp_init_irq)
526 .timer = &cp_timer,
527 INIT_MACHINE(intcp_init)
528MACHINE_END
diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c
new file mode 100644
index 000000000000..9d182b77b312
--- /dev/null
+++ b/arch/arm/mach-integrator/leds.c
@@ -0,0 +1,88 @@
1/*
2 * linux/arch/arm/mach-integrator/leds.c
3 *
4 * Integrator/AP and Integrator/CP LED control routines
5 *
6 * Copyright (C) 1999 ARM Limited
7 * Copyright (C) 2000 Deep Blue Solutions Ltd
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23#include <linux/kernel.h>
24#include <linux/init.h>
25
26#include <asm/hardware.h>
27#include <asm/io.h>
28#include <asm/leds.h>
29#include <asm/system.h>
30#include <asm/mach-types.h>
31#include <asm/arch/cm.h>
32
33static int saved_leds;
34
35static void integrator_leds_event(led_event_t ledevt)
36{
37 unsigned long flags;
38 const unsigned int dbg_base = IO_ADDRESS(INTEGRATOR_DBG_BASE);
39 unsigned int update_alpha_leds;
40
41 // yup, change the LEDs
42 local_irq_save(flags);
43 update_alpha_leds = 0;
44
45 switch(ledevt) {
46 case led_idle_start:
47 cm_control(CM_CTRL_LED, 0);
48 break;
49
50 case led_idle_end:
51 cm_control(CM_CTRL_LED, CM_CTRL_LED);
52 break;
53
54 case led_timer:
55 saved_leds ^= GREEN_LED;
56 update_alpha_leds = 1;
57 break;
58
59 case led_red_on:
60 saved_leds |= RED_LED;
61 update_alpha_leds = 1;
62 break;
63
64 case led_red_off:
65 saved_leds &= ~RED_LED;
66 update_alpha_leds = 1;
67 break;
68
69 default:
70 break;
71 }
72
73 if (update_alpha_leds) {
74 while (__raw_readl(dbg_base + INTEGRATOR_DBG_ALPHA_OFFSET) & 1);
75 __raw_writel(saved_leds, dbg_base + INTEGRATOR_DBG_LEDS_OFFSET);
76 }
77 local_irq_restore(flags);
78}
79
80static int __init leds_init(void)
81{
82 if (machine_is_integrator() || machine_is_cintegrator())
83 leds_event = integrator_leds_event;
84
85 return 0;
86}
87
88__initcall(leds_init);
diff --git a/arch/arm/mach-integrator/lm.c b/arch/arm/mach-integrator/lm.c
new file mode 100644
index 000000000000..c5f19d160598
--- /dev/null
+++ b/arch/arm/mach-integrator/lm.c
@@ -0,0 +1,96 @@
1/*
2 * linux/arch/arm/mach-integrator/lm.c
3 *
4 * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/module.h>
11#include <linux/init.h>
12#include <linux/device.h>
13
14#include <asm/arch/lm.h>
15
16#define to_lm_device(d) container_of(d, struct lm_device, dev)
17#define to_lm_driver(d) container_of(d, struct lm_driver, drv)
18
19static int lm_match(struct device *dev, struct device_driver *drv)
20{
21 return 1;
22}
23
24static struct bus_type lm_bustype = {
25 .name = "logicmodule",
26 .match = lm_match,
27// .suspend = lm_suspend,
28// .resume = lm_resume,
29};
30
31static int __init lm_init(void)
32{
33 return bus_register(&lm_bustype);
34}
35
36postcore_initcall(lm_init);
37
38static int lm_bus_probe(struct device *dev)
39{
40 struct lm_device *lmdev = to_lm_device(dev);
41 struct lm_driver *lmdrv = to_lm_driver(dev->driver);
42
43 return lmdrv->probe(lmdev);
44}
45
46static int lm_bus_remove(struct device *dev)
47{
48 struct lm_device *lmdev = to_lm_device(dev);
49 struct lm_driver *lmdrv = to_lm_driver(dev->driver);
50
51 lmdrv->remove(lmdev);
52 return 0;
53}
54
55int lm_driver_register(struct lm_driver *drv)
56{
57 drv->drv.bus = &lm_bustype;
58 drv->drv.probe = lm_bus_probe;
59 drv->drv.remove = lm_bus_remove;
60
61 return driver_register(&drv->drv);
62}
63
64void lm_driver_unregister(struct lm_driver *drv)
65{
66 driver_unregister(&drv->drv);
67}
68
69static void lm_device_release(struct device *dev)
70{
71 struct lm_device *d = to_lm_device(dev);
72
73 kfree(d);
74}
75
76int lm_device_register(struct lm_device *dev)
77{
78 int ret;
79
80 dev->dev.release = lm_device_release;
81 dev->dev.bus = &lm_bustype;
82
83 snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), "lm%d", dev->id);
84 dev->resource.name = dev->dev.bus_id;
85
86 ret = request_resource(&iomem_resource, &dev->resource);
87 if (ret == 0) {
88 ret = device_register(&dev->dev);
89 if (ret)
90 release_resource(&dev->resource);
91 }
92 return ret;
93}
94
95EXPORT_SYMBOL(lm_driver_register);
96EXPORT_SYMBOL(lm_driver_unregister);
diff --git a/arch/arm/mach-integrator/pci.c b/arch/arm/mach-integrator/pci.c
new file mode 100644
index 000000000000..394ec9261c4e
--- /dev/null
+++ b/arch/arm/mach-integrator/pci.c
@@ -0,0 +1,132 @@
1/*
2 * linux/arch/arm/mach-integrator/pci-integrator.c
3 *
4 * Copyright (C) 1999 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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 * PCI functions for Integrator
23 */
24#include <linux/kernel.h>
25#include <linux/pci.h>
26#include <linux/ptrace.h>
27#include <linux/interrupt.h>
28#include <linux/init.h>
29
30#include <asm/irq.h>
31#include <asm/system.h>
32#include <asm/mach/pci.h>
33#include <asm/mach-types.h>
34
35/*
36 * A small note about bridges and interrupts. The DECchip 21050 (and
37 * later) adheres to the PCI-PCI bridge specification. This says that
38 * the interrupts on the other side of a bridge are swizzled in the
39 * following manner:
40 *
41 * Dev Interrupt Interrupt
42 * Pin on Pin on
43 * Device Connector
44 *
45 * 4 A A
46 * B B
47 * C C
48 * D D
49 *
50 * 5 A B
51 * B C
52 * C D
53 * D A
54 *
55 * 6 A C
56 * B D
57 * C A
58 * D B
59 *
60 * 7 A D
61 * B A
62 * C B
63 * D C
64 *
65 * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A.
66 * Thus, each swizzle is ((pin-1) + (device#-4)) % 4
67 *
68 * The following code swizzles for exactly one bridge.
69 */
70static inline int bridge_swizzle(int pin, unsigned int slot)
71{
72 return (pin + slot) & 3;
73}
74
75/*
76 * This routine handles multiple bridges.
77 */
78static u8 __init integrator_swizzle(struct pci_dev *dev, u8 *pinp)
79{
80 int pin = *pinp;
81
82 if (pin == 0)
83 pin = 1;
84
85 pin -= 1;
86 while (dev->bus->self) {
87 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
88 /*
89 * move up the chain of bridges, swizzling as we go.
90 */
91 dev = dev->bus->self;
92 }
93 *pinp = pin + 1;
94
95 return PCI_SLOT(dev->devfn);
96}
97
98static int irq_tab[4] __initdata = {
99 IRQ_AP_PCIINT0, IRQ_AP_PCIINT1, IRQ_AP_PCIINT2, IRQ_AP_PCIINT3
100};
101
102/*
103 * map the specified device/slot/pin to an IRQ. This works out such
104 * that slot 9 pin 1 is INT0, pin 2 is INT1, and slot 10 pin 1 is INT1.
105 */
106static int __init integrator_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
107{
108 int intnr = ((slot - 9) + (pin - 1)) & 3;
109
110 return irq_tab[intnr];
111}
112
113extern void pci_v3_init(void *);
114
115static struct hw_pci integrator_pci __initdata = {
116 .swizzle = integrator_swizzle,
117 .map_irq = integrator_map_irq,
118 .setup = pci_v3_setup,
119 .nr_controllers = 1,
120 .scan = pci_v3_scan_bus,
121 .preinit = pci_v3_preinit,
122 .postinit = pci_v3_postinit,
123};
124
125static int __init integrator_pci_init(void)
126{
127 if (machine_is_integrator())
128 pci_common_init(&integrator_pci);
129 return 0;
130}
131
132subsys_initcall(integrator_pci_init);
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
new file mode 100644
index 000000000000..229a63a525cd
--- /dev/null
+++ b/arch/arm/mach-integrator/pci_v3.c
@@ -0,0 +1,604 @@
1/*
2 * linux/arch/arm/mach-integrator/pci_v3.c
3 *
4 * PCI functions for V3 host PCI bridge
5 *
6 * Copyright (C) 1999 ARM Limited
7 * Copyright (C) 2000-2001 Deep Blue Solutions Ltd
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23#include <linux/config.h>
24#include <linux/kernel.h>
25#include <linux/pci.h>
26#include <linux/ptrace.h>
27#include <linux/slab.h>
28#include <linux/ioport.h>
29#include <linux/interrupt.h>
30#include <linux/spinlock.h>
31#include <linux/init.h>
32
33#include <asm/hardware.h>
34#include <asm/io.h>
35#include <asm/irq.h>
36#include <asm/system.h>
37#include <asm/mach/pci.h>
38
39#include <asm/hardware/pci_v3.h>
40
41/*
42 * The V3 PCI interface chip in Integrator provides several windows from
43 * local bus memory into the PCI memory areas. Unfortunately, there
44 * are not really enough windows for our usage, therefore we reuse
45 * one of the windows for access to PCI configuration space. The
46 * memory map is as follows:
47 *
48 * Local Bus Memory Usage
49 *
50 * 40000000 - 4FFFFFFF PCI memory. 256M non-prefetchable
51 * 50000000 - 5FFFFFFF PCI memory. 256M prefetchable
52 * 60000000 - 60FFFFFF PCI IO. 16M
53 * 61000000 - 61FFFFFF PCI Configuration. 16M
54 *
55 * There are three V3 windows, each described by a pair of V3 registers.
56 * These are LB_BASE0/LB_MAP0, LB_BASE1/LB_MAP1 and LB_BASE2/LB_MAP2.
57 * Base0 and Base1 can be used for any type of PCI memory access. Base2
58 * can be used either for PCI I/O or for I20 accesses. By default, uHAL
59 * uses this only for PCI IO space.
60 *
61 * Normally these spaces are mapped using the following base registers:
62 *
63 * Usage Local Bus Memory Base/Map registers used
64 *
65 * Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0
66 * Mem 50000000 - 5FFFFFFF LB_BASE1/LB_MAP1
67 * IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2
68 * Cfg 61000000 - 61FFFFFF
69 *
70 * This means that I20 and PCI configuration space accesses will fail.
71 * When PCI configuration accesses are needed (via the uHAL PCI
72 * configuration space primitives) we must remap the spaces as follows:
73 *
74 * Usage Local Bus Memory Base/Map registers used
75 *
76 * Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0
77 * Mem 50000000 - 5FFFFFFF LB_BASE0/LB_MAP0
78 * IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2
79 * Cfg 61000000 - 61FFFFFF LB_BASE1/LB_MAP1
80 *
81 * To make this work, the code depends on overlapping windows working.
82 * The V3 chip translates an address by checking its range within
83 * each of the BASE/MAP pairs in turn (in ascending register number
84 * order). It will use the first matching pair. So, for example,
85 * if the same address is mapped by both LB_BASE0/LB_MAP0 and
86 * LB_BASE1/LB_MAP1, the V3 will use the translation from
87 * LB_BASE0/LB_MAP0.
88 *
89 * To allow PCI Configuration space access, the code enlarges the
90 * window mapped by LB_BASE0/LB_MAP0 from 256M to 512M. This occludes
91 * the windows currently mapped by LB_BASE1/LB_MAP1 so that it can
92 * be remapped for use by configuration cycles.
93 *
94 * At the end of the PCI Configuration space accesses,
95 * LB_BASE1/LB_MAP1 is reset to map PCI Memory. Finally the window
96 * mapped by LB_BASE0/LB_MAP0 is reduced in size from 512M to 256M to
97 * reveal the now restored LB_BASE1/LB_MAP1 window.
98 *
99 * NOTE: We do not set up I2O mapping. I suspect that this is only
100 * for an intelligent (target) device. Using I2O disables most of
101 * the mappings into PCI memory.
102 */
103
104// V3 access routines
105#define v3_writeb(o,v) __raw_writeb(v, PCI_V3_VADDR + (unsigned int)(o))
106#define v3_readb(o) (__raw_readb(PCI_V3_VADDR + (unsigned int)(o)))
107
108#define v3_writew(o,v) __raw_writew(v, PCI_V3_VADDR + (unsigned int)(o))
109#define v3_readw(o) (__raw_readw(PCI_V3_VADDR + (unsigned int)(o)))
110
111#define v3_writel(o,v) __raw_writel(v, PCI_V3_VADDR + (unsigned int)(o))
112#define v3_readl(o) (__raw_readl(PCI_V3_VADDR + (unsigned int)(o)))
113
114/*============================================================================
115 *
116 * routine: uHALir_PCIMakeConfigAddress()
117 *
118 * parameters: bus = which bus
119 * device = which device
120 * function = which function
121 * offset = configuration space register we are interested in
122 *
123 * description: this routine will generate a platform dependent config
124 * address.
125 *
126 * calls: none
127 *
128 * returns: configuration address to play on the PCI bus
129 *
130 * To generate the appropriate PCI configuration cycles in the PCI
131 * configuration address space, you present the V3 with the following pattern
132 * (which is very nearly a type 1 (except that the lower two bits are 00 and
133 * not 01). In order for this mapping to work you need to set up one of
134 * the local to PCI aperatures to 16Mbytes in length translating to
135 * PCI configuration space starting at 0x0000.0000.
136 *
137 * PCI configuration cycles look like this:
138 *
139 * Type 0:
140 *
141 * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1
142 * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0
143 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
144 * | | |D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|0|
145 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
146 *
147 * 31:11 Device select bit.
148 * 10:8 Function number
149 * 7:2 Register number
150 *
151 * Type 1:
152 *
153 * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1
154 * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0
155 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
156 * | | | | | | | | | | |B|B|B|B|B|B|B|B|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|1|
157 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
158 *
159 * 31:24 reserved
160 * 23:16 bus number (8 bits = 128 possible buses)
161 * 15:11 Device number (5 bits)
162 * 10:8 function number
163 * 7:2 register number
164 *
165 */
166static DEFINE_SPINLOCK(v3_lock);
167
168#define PCI_BUS_NONMEM_START 0x00000000
169#define PCI_BUS_NONMEM_SIZE SZ_256M
170
171#define PCI_BUS_PREMEM_START PCI_BUS_NONMEM_START + PCI_BUS_NONMEM_SIZE
172#define PCI_BUS_PREMEM_SIZE SZ_256M
173
174#if PCI_BUS_NONMEM_START & 0x000fffff
175#error PCI_BUS_NONMEM_START must be megabyte aligned
176#endif
177#if PCI_BUS_PREMEM_START & 0x000fffff
178#error PCI_BUS_PREMEM_START must be megabyte aligned
179#endif
180
181#undef V3_LB_BASE_PREFETCH
182#define V3_LB_BASE_PREFETCH 0
183
184static unsigned long v3_open_config_window(struct pci_bus *bus,
185 unsigned int devfn, int offset)
186{
187 unsigned int address, mapaddress, busnr;
188
189 busnr = bus->number;
190
191 /*
192 * Trap out illegal values
193 */
194 if (offset > 255)
195 BUG();
196 if (busnr > 255)
197 BUG();
198 if (devfn > 255)
199 BUG();
200
201 if (busnr == 0) {
202 int slot = PCI_SLOT(devfn);
203
204 /*
205 * local bus segment so need a type 0 config cycle
206 *
207 * build the PCI configuration "address" with one-hot in
208 * A31-A11
209 *
210 * mapaddress:
211 * 3:1 = config cycle (101)
212 * 0 = PCI A1 & A0 are 0 (0)
213 */
214 address = PCI_FUNC(devfn) << 8;
215 mapaddress = V3_LB_MAP_TYPE_CONFIG;
216
217 if (slot > 12)
218 /*
219 * high order bits are handled by the MAP register
220 */
221 mapaddress |= 1 << (slot - 5);
222 else
223 /*
224 * low order bits handled directly in the address
225 */
226 address |= 1 << (slot + 11);
227 } else {
228 /*
229 * not the local bus segment so need a type 1 config cycle
230 *
231 * address:
232 * 23:16 = bus number
233 * 15:11 = slot number (7:3 of devfn)
234 * 10:8 = func number (2:0 of devfn)
235 *
236 * mapaddress:
237 * 3:1 = config cycle (101)
238 * 0 = PCI A1 & A0 from host bus (1)
239 */
240 mapaddress = V3_LB_MAP_TYPE_CONFIG | V3_LB_MAP_AD_LOW_EN;
241 address = (busnr << 16) | (devfn << 8);
242 }
243
244 /*
245 * Set up base0 to see all 512Mbytes of memory space (not
246 * prefetchable), this frees up base1 for re-use by
247 * configuration memory
248 */
249 v3_writel(V3_LB_BASE0, v3_addr_to_lb_base(PHYS_PCI_MEM_BASE) |
250 V3_LB_BASE_ADR_SIZE_512MB | V3_LB_BASE_ENABLE);
251
252 /*
253 * Set up base1/map1 to point into configuration space.
254 */
255 v3_writel(V3_LB_BASE1, v3_addr_to_lb_base(PHYS_PCI_CONFIG_BASE) |
256 V3_LB_BASE_ADR_SIZE_16MB | V3_LB_BASE_ENABLE);
257 v3_writew(V3_LB_MAP1, mapaddress);
258
259 return PCI_CONFIG_VADDR + address + offset;
260}
261
262static void v3_close_config_window(void)
263{
264 /*
265 * Reassign base1 for use by prefetchable PCI memory
266 */
267 v3_writel(V3_LB_BASE1, v3_addr_to_lb_base(PHYS_PCI_MEM_BASE + SZ_256M) |
268 V3_LB_BASE_ADR_SIZE_256MB | V3_LB_BASE_PREFETCH |
269 V3_LB_BASE_ENABLE);
270 v3_writew(V3_LB_MAP1, v3_addr_to_lb_map(PCI_BUS_PREMEM_START) |
271 V3_LB_MAP_TYPE_MEM_MULTIPLE);
272
273 /*
274 * And shrink base0 back to a 256M window (NOTE: MAP0 already correct)
275 */
276 v3_writel(V3_LB_BASE0, v3_addr_to_lb_base(PHYS_PCI_MEM_BASE) |
277 V3_LB_BASE_ADR_SIZE_256MB | V3_LB_BASE_ENABLE);
278}
279
280static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where,
281 int size, u32 *val)
282{
283 unsigned long addr;
284 unsigned long flags;
285 u32 v;
286
287 spin_lock_irqsave(&v3_lock, flags);
288 addr = v3_open_config_window(bus, devfn, where);
289
290 switch (size) {
291 case 1:
292 v = __raw_readb(addr);
293 break;
294
295 case 2:
296 v = __raw_readw(addr);
297 break;
298
299 default:
300 v = __raw_readl(addr);
301 break;
302 }
303
304 v3_close_config_window();
305 spin_unlock_irqrestore(&v3_lock, flags);
306
307 *val = v;
308 return PCIBIOS_SUCCESSFUL;
309}
310
311static int v3_write_config(struct pci_bus *bus, unsigned int devfn, int where,
312 int size, u32 val)
313{
314 unsigned long addr;
315 unsigned long flags;
316
317 spin_lock_irqsave(&v3_lock, flags);
318 addr = v3_open_config_window(bus, devfn, where);
319
320 switch (size) {
321 case 1:
322 __raw_writeb((u8)val, addr);
323 __raw_readb(addr);
324 break;
325
326 case 2:
327 __raw_writew((u16)val, addr);
328 __raw_readw(addr);
329 break;
330
331 case 4:
332 __raw_writel(val, addr);
333 __raw_readl(addr);
334 break;
335 }
336
337 v3_close_config_window();
338 spin_unlock_irqrestore(&v3_lock, flags);
339
340 return PCIBIOS_SUCCESSFUL;
341}
342
343static struct pci_ops pci_v3_ops = {
344 .read = v3_read_config,
345 .write = v3_write_config,
346};
347
348static struct resource non_mem = {
349 .name = "PCI non-prefetchable",
350 .start = PHYS_PCI_MEM_BASE + PCI_BUS_NONMEM_START,
351 .end = PHYS_PCI_MEM_BASE + PCI_BUS_NONMEM_START + PCI_BUS_NONMEM_SIZE - 1,
352 .flags = IORESOURCE_MEM,
353};
354
355static struct resource pre_mem = {
356 .name = "PCI prefetchable",
357 .start = PHYS_PCI_MEM_BASE + PCI_BUS_PREMEM_START,
358 .end = PHYS_PCI_MEM_BASE + PCI_BUS_PREMEM_START + PCI_BUS_PREMEM_SIZE - 1,
359 .flags = IORESOURCE_MEM | IORESOURCE_PREFETCH,
360};
361
362static int __init pci_v3_setup_resources(struct resource **resource)
363{
364 if (request_resource(&iomem_resource, &non_mem)) {
365 printk(KERN_ERR "PCI: unable to allocate non-prefetchable "
366 "memory region\n");
367 return -EBUSY;
368 }
369 if (request_resource(&iomem_resource, &pre_mem)) {
370 release_resource(&non_mem);
371 printk(KERN_ERR "PCI: unable to allocate prefetchable "
372 "memory region\n");
373 return -EBUSY;
374 }
375
376 /*
377 * bus->resource[0] is the IO resource for this bus
378 * bus->resource[1] is the mem resource for this bus
379 * bus->resource[2] is the prefetch mem resource for this bus
380 */
381 resource[0] = &ioport_resource;
382 resource[1] = &non_mem;
383 resource[2] = &pre_mem;
384
385 return 1;
386}
387
388/*
389 * These don't seem to be implemented on the Integrator I have, which
390 * means I can't get additional information on the reason for the pm2fb
391 * problems. I suppose I'll just have to mind-meld with the machine. ;)
392 */
393#define SC_PCI (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_PCIENABLE_OFFSET)
394#define SC_LBFADDR (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x20)
395#define SC_LBFCODE (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x24)
396
397static int
398v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
399{
400 unsigned long pc = instruction_pointer(regs);
401 unsigned long instr = *(unsigned long *)pc;
402#if 0
403 char buf[128];
404
405 sprintf(buf, "V3 fault: addr 0x%08lx, FSR 0x%03x, PC 0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x ISTAT=%02x\n",
406 addr, fsr, pc, instr, __raw_readl(SC_LBFADDR), __raw_readl(SC_LBFCODE) & 255,
407 v3_readb(V3_LB_ISTAT));
408 printk(KERN_DEBUG "%s", buf);
409 printascii(buf);
410#endif
411
412 v3_writeb(V3_LB_ISTAT, 0);
413 __raw_writel(3, SC_PCI);
414
415 /*
416 * If the instruction being executed was a read,
417 * make it look like it read all-ones.
418 */
419 if ((instr & 0x0c100000) == 0x04100000) {
420 int reg = (instr >> 12) & 15;
421 unsigned long val;
422
423 if (instr & 0x00400000)
424 val = 255;
425 else
426 val = -1;
427
428 regs->uregs[reg] = val;
429 regs->ARM_pc += 4;
430 return 0;
431 }
432
433 if ((instr & 0x0e100090) == 0x00100090) {
434 int reg = (instr >> 12) & 15;
435
436 regs->uregs[reg] = -1;
437 regs->ARM_pc += 4;
438 return 0;
439 }
440
441 return 1;
442}
443
444static irqreturn_t v3_irq(int irq, void *devid, struct pt_regs *regs)
445{
446#ifdef CONFIG_DEBUG_LL
447 unsigned long pc = instruction_pointer(regs);
448 unsigned long instr = *(unsigned long *)pc;
449 char buf[128];
450
451 sprintf(buf, "V3 int %d: pc=0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x ISTAT=%02x\n", irq,
452 pc, instr, __raw_readl(SC_LBFADDR), __raw_readl(SC_LBFCODE) & 255,
453 v3_readb(V3_LB_ISTAT));
454 printascii(buf);
455#endif
456
457 v3_writew(V3_PCI_STAT, 0xf000);
458 v3_writeb(V3_LB_ISTAT, 0);
459 __raw_writel(3, SC_PCI);
460
461#ifdef CONFIG_DEBUG_LL
462 /*
463 * If the instruction being executed was a read,
464 * make it look like it read all-ones.
465 */
466 if ((instr & 0x0c100000) == 0x04100000) {
467 int reg = (instr >> 16) & 15;
468 sprintf(buf, " reg%d = %08lx\n", reg, regs->uregs[reg]);
469 printascii(buf);
470 }
471#endif
472 return IRQ_HANDLED;
473}
474
475int __init pci_v3_setup(int nr, struct pci_sys_data *sys)
476{
477 int ret = 0;
478
479 if (nr == 0) {
480 sys->mem_offset = PHYS_PCI_MEM_BASE;
481 ret = pci_v3_setup_resources(sys->resource);
482 }
483
484 return ret;
485}
486
487struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *sys)
488{
489 return pci_scan_bus(sys->busnr, &pci_v3_ops, sys);
490}
491
492/*
493 * V3_LB_BASE? - local bus address
494 * V3_LB_MAP? - pci bus address
495 */
496void __init pci_v3_preinit(void)
497{
498 unsigned long flags;
499 unsigned int temp;
500 int ret;
501
502 /*
503 * Hook in our fault handler for PCI errors
504 */
505 hook_fault_code(4, v3_pci_fault, SIGBUS, "external abort on linefetch");
506 hook_fault_code(6, v3_pci_fault, SIGBUS, "external abort on linefetch");
507 hook_fault_code(8, v3_pci_fault, SIGBUS, "external abort on non-linefetch");
508 hook_fault_code(10, v3_pci_fault, SIGBUS, "external abort on non-linefetch");
509
510 spin_lock_irqsave(&v3_lock, flags);
511
512 /*
513 * Unlock V3 registers, but only if they were previously locked.
514 */
515 if (v3_readw(V3_SYSTEM) & V3_SYSTEM_M_LOCK)
516 v3_writew(V3_SYSTEM, 0xa05f);
517
518 /*
519 * Setup window 0 - PCI non-prefetchable memory
520 * Local: 0x40000000 Bus: 0x00000000 Size: 256MB
521 */
522 v3_writel(V3_LB_BASE0, v3_addr_to_lb_base(PHYS_PCI_MEM_BASE) |
523 V3_LB_BASE_ADR_SIZE_256MB | V3_LB_BASE_ENABLE);
524 v3_writew(V3_LB_MAP0, v3_addr_to_lb_map(PCI_BUS_NONMEM_START) |
525 V3_LB_MAP_TYPE_MEM);
526
527 /*
528 * Setup window 1 - PCI prefetchable memory
529 * Local: 0x50000000 Bus: 0x10000000 Size: 256MB
530 */
531 v3_writel(V3_LB_BASE1, v3_addr_to_lb_base(PHYS_PCI_MEM_BASE + SZ_256M) |
532 V3_LB_BASE_ADR_SIZE_256MB | V3_LB_BASE_PREFETCH |
533 V3_LB_BASE_ENABLE);
534 v3_writew(V3_LB_MAP1, v3_addr_to_lb_map(PCI_BUS_PREMEM_START) |
535 V3_LB_MAP_TYPE_MEM_MULTIPLE);
536
537 /*
538 * Setup window 2 - PCI IO
539 */
540 v3_writel(V3_LB_BASE2, v3_addr_to_lb_base2(PHYS_PCI_IO_BASE) |
541 V3_LB_BASE_ENABLE);
542 v3_writew(V3_LB_MAP2, v3_addr_to_lb_map2(0));
543
544 /*
545 * Disable PCI to host IO cycles
546 */
547 temp = v3_readw(V3_PCI_CFG) & ~V3_PCI_CFG_M_I2O_EN;
548 temp |= V3_PCI_CFG_M_IO_REG_DIS | V3_PCI_CFG_M_IO_DIS;
549 v3_writew(V3_PCI_CFG, temp);
550
551 printk(KERN_DEBUG "FIFO_CFG: %04x FIFO_PRIO: %04x\n",
552 v3_readw(V3_FIFO_CFG), v3_readw(V3_FIFO_PRIORITY));
553
554 /*
555 * Set the V3 FIFO such that writes have higher priority than
556 * reads, and local bus write causes local bus read fifo flush.
557 * Same for PCI.
558 */
559 v3_writew(V3_FIFO_PRIORITY, 0x0a0a);
560
561 /*
562 * Re-lock the system register.
563 */
564 temp = v3_readw(V3_SYSTEM) | V3_SYSTEM_M_LOCK;
565 v3_writew(V3_SYSTEM, temp);
566
567 /*
568 * Clear any error conditions, and enable write errors.
569 */
570 v3_writeb(V3_LB_ISTAT, 0);
571 v3_writew(V3_LB_CFG, v3_readw(V3_LB_CFG) | (1 << 10));
572 v3_writeb(V3_LB_IMASK, 0x28);
573 __raw_writel(3, SC_PCI);
574
575 /*
576 * Grab the PCI error interrupt.
577 */
578 ret = request_irq(IRQ_AP_V3INT, v3_irq, 0, "V3", NULL);
579 if (ret)
580 printk(KERN_ERR "PCI: unable to grab PCI error "
581 "interrupt: %d\n", ret);
582
583 spin_unlock_irqrestore(&v3_lock, flags);
584}
585
586void __init pci_v3_postinit(void)
587{
588 unsigned int pci_cmd;
589
590 pci_cmd = PCI_COMMAND_MEMORY |
591 PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE;
592
593 v3_writew(V3_PCI_CMD, pci_cmd);
594
595 v3_writeb(V3_LB_ISTAT, ~0x40);
596 v3_writeb(V3_LB_IMASK, 0x68);
597
598#if 0
599 ret = request_irq(IRQ_AP_LBUSTIMEOUT, lb_timeout, 0, "bus timeout", NULL);
600 if (ret)
601 printk(KERN_ERR "PCI: unable to grab local bus timeout "
602 "interrupt: %d\n", ret);
603#endif
604}
diff --git a/arch/arm/mach-integrator/time.c b/arch/arm/mach-integrator/time.c
new file mode 100644
index 000000000000..20729de2af28
--- /dev/null
+++ b/arch/arm/mach-integrator/time.c
@@ -0,0 +1,213 @@
1/*
2 * linux/arch/arm/mach-integrator/time.c
3 *
4 * Copyright (C) 2000-2001 Deep Blue Solutions Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/module.h>
11#include <linux/kernel.h>
12#include <linux/time.h>
13#include <linux/mc146818rtc.h>
14#include <linux/interrupt.h>
15#include <linux/init.h>
16#include <linux/device.h>
17
18#include <asm/hardware/amba.h>
19#include <asm/hardware.h>
20#include <asm/io.h>
21#include <asm/uaccess.h>
22#include <asm/rtc.h>
23
24#include <asm/mach/time.h>
25
26#define RTC_DR (0)
27#define RTC_MR (4)
28#define RTC_STAT (8)
29#define RTC_EOI (8)
30#define RTC_LR (12)
31#define RTC_CR (16)
32#define RTC_CR_MIE (1 << 0)
33
34extern int (*set_rtc)(void);
35static void __iomem *rtc_base;
36
37static int integrator_set_rtc(void)
38{
39 __raw_writel(xtime.tv_sec, rtc_base + RTC_LR);
40 return 1;
41}
42
43static void rtc_read_alarm(struct rtc_wkalrm *alrm)
44{
45 rtc_time_to_tm(readl(rtc_base + RTC_MR), &alrm->time);
46}
47
48static int rtc_set_alarm(struct rtc_wkalrm *alrm)
49{
50 unsigned long time;
51 int ret;
52
53 ret = rtc_tm_to_time(&alrm->time, &time);
54 if (ret == 0)
55 writel(time, rtc_base + RTC_MR);
56 return ret;
57}
58
59static void rtc_read_time(struct rtc_time *tm)
60{
61 rtc_time_to_tm(readl(rtc_base + RTC_DR), tm);
62}
63
64/*
65 * Set the RTC time. Unfortunately, we can't accurately set
66 * the point at which the counter updates.
67 *
68 * Also, since RTC_LR is transferred to RTC_CR on next rising
69 * edge of the 1Hz clock, we must write the time one second
70 * in advance.
71 */
72static int rtc_set_time(struct rtc_time *tm)
73{
74 unsigned long time;
75 int ret;
76
77 ret = rtc_tm_to_time(tm, &time);
78 if (ret == 0)
79 writel(time + 1, rtc_base + RTC_LR);
80
81 return ret;
82}
83
84static struct rtc_ops rtc_ops = {
85 .owner = THIS_MODULE,
86 .read_time = rtc_read_time,
87 .set_time = rtc_set_time,
88 .read_alarm = rtc_read_alarm,
89 .set_alarm = rtc_set_alarm,
90};
91
92static irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
93{
94 writel(0, rtc_base + RTC_EOI);
95 return IRQ_HANDLED;
96}
97
98static int rtc_probe(struct amba_device *dev, void *id)
99{
100 int ret;
101
102 if (rtc_base)
103 return -EBUSY;
104
105 ret = amba_request_regions(dev, NULL);
106 if (ret)
107 goto out;
108
109 rtc_base = ioremap(dev->res.start, SZ_4K);
110 if (!rtc_base) {
111 ret = -ENOMEM;
112 goto res_out;
113 }
114
115 __raw_writel(0, rtc_base + RTC_CR);
116 __raw_writel(0, rtc_base + RTC_EOI);
117
118 xtime.tv_sec = __raw_readl(rtc_base + RTC_DR);
119
120 ret = request_irq(dev->irq[0], rtc_interrupt, SA_INTERRUPT,
121 "rtc-pl030", dev);
122 if (ret)
123 goto map_out;
124
125 ret = register_rtc(&rtc_ops);
126 if (ret)
127 goto irq_out;
128
129 set_rtc = integrator_set_rtc;
130 return 0;
131
132 irq_out:
133 free_irq(dev->irq[0], dev);
134 map_out:
135 iounmap(rtc_base);
136 rtc_base = NULL;
137 res_out:
138 amba_release_regions(dev);
139 out:
140 return ret;
141}
142
143static int rtc_remove(struct amba_device *dev)
144{
145 set_rtc = NULL;
146
147 writel(0, rtc_base + RTC_CR);
148
149 free_irq(dev->irq[0], dev);
150 unregister_rtc(&rtc_ops);
151
152 iounmap(rtc_base);
153 rtc_base = NULL;
154 amba_release_regions(dev);
155
156 return 0;
157}
158
159static struct timespec rtc_delta;
160
161static int rtc_suspend(struct amba_device *dev, pm_message_t state)
162{
163 struct timespec rtc;
164
165 rtc.tv_sec = readl(rtc_base + RTC_DR);
166 rtc.tv_nsec = 0;
167 save_time_delta(&rtc_delta, &rtc);
168
169 return 0;
170}
171
172static int rtc_resume(struct amba_device *dev)
173{
174 struct timespec rtc;
175
176 rtc.tv_sec = readl(rtc_base + RTC_DR);
177 rtc.tv_nsec = 0;
178 restore_time_delta(&rtc_delta, &rtc);
179
180 return 0;
181}
182
183static struct amba_id rtc_ids[] = {
184 {
185 .id = 0x00041030,
186 .mask = 0x000fffff,
187 },
188 { 0, 0 },
189};
190
191static struct amba_driver rtc_driver = {
192 .drv = {
193 .name = "rtc-pl030",
194 },
195 .probe = rtc_probe,
196 .remove = rtc_remove,
197 .suspend = rtc_suspend,
198 .resume = rtc_resume,
199 .id_table = rtc_ids,
200};
201
202static int __init integrator_rtc_init(void)
203{
204 return amba_driver_register(&rtc_driver);
205}
206
207static void __exit integrator_rtc_exit(void)
208{
209 amba_driver_unregister(&rtc_driver);
210}
211
212module_init(integrator_rtc_init);
213module_exit(integrator_rtc_exit);
diff --git a/arch/arm/mach-iop3xx/Kconfig b/arch/arm/mach-iop3xx/Kconfig
new file mode 100644
index 000000000000..2bfe8c729f9f
--- /dev/null
+++ b/arch/arm/mach-iop3xx/Kconfig
@@ -0,0 +1,63 @@
1if ARCH_IOP3XX
2
3menu "IOP3xx Implementation Options"
4
5comment "IOP3xx Platform Types"
6
7config ARCH_IQ80321
8 bool "Enable support for IQ80321"
9 select ARCH_IOP321
10 help
11 Say Y here if you want to run your kernel on the Intel IQ80321
12 evaluation kit for the IOP321 chipset.
13
14config ARCH_IQ31244
15 bool "Enable support for IQ31244"
16 select ARCH_IOP321
17 help
18 Say Y here if you want to run your kernel on the Intel IQ31244
19 evaluation kit for the IOP321 chipset.
20
21config ARCH_IQ80331
22 bool "Enable support for IQ80331"
23 select ARCH_IOP331
24 help
25 Say Y here if you want to run your kernel on the Intel IQ80331
26 evaluation kit for the IOP331 chipset.
27
28config MACH_IQ80332
29 bool "Enable support for IQ80332"
30 select ARCH_IOP331
31 help
32 Say Y here if you want to run your kernel on the Intel IQ80332
33 evaluation kit for the IOP332 chipset
34
35config ARCH_EP80219
36 bool "Enable support for EP80219"
37 select ARCH_IOP321
38 select ARCH_IQ31244
39
40# Which IOP variant are we running?
41config ARCH_IOP321
42 bool
43 help
44 The IQ80321 uses the IOP321 variant.
45 The IQ31244 and EP80219 uses the IOP321 variant.
46
47config ARCH_IOP331
48 bool
49 default ARCH_IQ80331
50 help
51 The IQ80331, IQ80332, and IQ80333 uses the IOP331 variant.
52
53comment "IOP3xx Chipset Features"
54
55config IOP331_STEPD
56 bool "Chip stepping D of the IOP80331 processor or IOP80333"
57 depends on (ARCH_IOP331)
58 help
59 Say Y here if you have StepD of the IOP80331 or IOP8033
60 based platforms.
61
62endmenu
63endif
diff --git a/arch/arm/mach-iop3xx/Makefile b/arch/arm/mach-iop3xx/Makefile
new file mode 100644
index 000000000000..b17eb1f46102
--- /dev/null
+++ b/arch/arm/mach-iop3xx/Makefile
@@ -0,0 +1,23 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := common.o
8
9obj-m :=
10obj-n :=
11obj- :=
12
13obj-$(CONFIG_ARCH_IOP321) += iop321-setup.o iop321-irq.o iop321-pci.o iop321-time.o
14
15obj-$(CONFIG_ARCH_IOP331) += iop331-setup.o iop331-irq.o iop331-pci.o iop331-time.o
16
17obj-$(CONFIG_ARCH_IQ80321) += iq80321-mm.o iq80321-pci.o
18
19obj-$(CONFIG_ARCH_IQ31244) += iq31244-mm.o iq31244-pci.o
20
21obj-$(CONFIG_ARCH_IQ80331) += iq80331-mm.o iq80331-pci.o
22
23obj-$(CONFIG_MACH_IQ80332) += iq80332-mm.o iq80332-pci.o
diff --git a/arch/arm/mach-iop3xx/Makefile.boot b/arch/arm/mach-iop3xx/Makefile.boot
new file mode 100644
index 000000000000..6387aa20461b
--- /dev/null
+++ b/arch/arm/mach-iop3xx/Makefile.boot
@@ -0,0 +1,9 @@
1 zreladdr-y := 0xa0008000
2params_phys-y := 0xa0000100
3initrd_phys-y := 0xa0800000
4ifeq ($(CONFIG_ARCH_IOP331),y)
5 zreladdr-y := 0x00008000
6params_phys-y := 0x00000100
7initrd_phys-y := 0x00800000
8endif
9
diff --git a/arch/arm/mach-iop3xx/common.c b/arch/arm/mach-iop3xx/common.c
new file mode 100644
index 000000000000..bda7394ec06c
--- /dev/null
+++ b/arch/arm/mach-iop3xx/common.c
@@ -0,0 +1,74 @@
1/*
2 * arch/arm/mach-iop3xx/common.c
3 *
4 * Common routines shared across all IOP3xx implementations
5 *
6 * Author: Deepak Saxena <dsaxena@mvista.com>
7 *
8 * Copyright 2003 (c) MontaVista, Software, Inc.
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
13 */
14
15#include <linux/config.h>
16#include <linux/delay.h>
17#include <asm/hardware.h>
18
19/*
20 * Shared variables
21 */
22unsigned long iop3xx_pcibios_min_io = 0;
23unsigned long iop3xx_pcibios_min_mem = 0;
24
25#ifdef CONFIG_ARCH_EP80219
26#include <linux/kernel.h>
27/*
28 * Default power-off for EP80219
29 */
30#include <asm/mach-types.h>
31
32static inline void ep80219_send_to_pic(__u8 c) {
33}
34
35void ep80219_power_off(void)
36{
37 /*
38 * This function will send a SHUTDOWN_COMPLETE message to the PIC controller
39 * over I2C. We are not using the i2c subsystem since we are going to power
40 * off and it may be removed
41 */
42
43 /* Send the Address byte w/ the start condition */
44 *IOP321_IDBR1 = 0x60;
45 *IOP321_ICR1 = 0xE9;
46 mdelay(1);
47
48 /* Send the START_MSG byte w/ no start or stop condition */
49 *IOP321_IDBR1 = 0x0F;
50 *IOP321_ICR1 = 0xE8;
51 mdelay(1);
52
53 /* Send the SHUTDOWN_COMPLETE Message ID byte w/ no start or stop condition */
54 *IOP321_IDBR1 = 0x03;
55 *IOP321_ICR1 = 0xE8;
56 mdelay(1);
57
58 /* Send an ignored byte w/ stop condition */
59 *IOP321_IDBR1 = 0x00;
60 *IOP321_ICR1 = 0xEA;
61
62 while (1) ;
63}
64
65#include <linux/init.h>
66#include <linux/pm.h>
67
68static int __init ep80219_init(void)
69{
70 pm_power_off = ep80219_power_off;
71 return 0;
72}
73arch_initcall(ep80219_init);
74#endif
diff --git a/arch/arm/mach-iop3xx/iop321-irq.c b/arch/arm/mach-iop3xx/iop321-irq.c
new file mode 100644
index 000000000000..d42aae6aef03
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iop321-irq.c
@@ -0,0 +1,96 @@
1/*
2 * linux/arch/arm/mach-iop3xx/iop321-irq.c
3 *
4 * Generic IOP321 IRQ handling functionality
5 *
6 * Author: Rory Bolt <rorybolt@pacbell.net>
7 * Copyright (C) 2002 Rory Bolt
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * Added IOP3XX chipset and IQ80321 board masking code.
14 *
15 */
16#include <linux/init.h>
17#include <linux/interrupt.h>
18#include <linux/list.h>
19
20#include <asm/mach/irq.h>
21#include <asm/irq.h>
22#include <asm/hardware.h>
23
24#include <asm/mach-types.h>
25
26static u32 iop321_mask /* = 0 */;
27
28static inline void intctl_write(u32 val)
29{
30 asm volatile("mcr p6,0,%0,c0,c0,0"::"r" (val));
31}
32
33static inline void intstr_write(u32 val)
34{
35 asm volatile("mcr p6,0,%0,c4,c0,0"::"r" (val));
36}
37
38static void
39iop321_irq_mask (unsigned int irq)
40{
41
42 iop321_mask &= ~(1 << (irq - IOP321_IRQ_OFS));
43
44 intctl_write(iop321_mask);
45}
46
47static void
48iop321_irq_unmask (unsigned int irq)
49{
50 iop321_mask |= (1 << (irq - IOP321_IRQ_OFS));
51
52 intctl_write(iop321_mask);
53}
54
55struct irqchip ext_chip = {
56 .ack = iop321_irq_mask,
57 .mask = iop321_irq_mask,
58 .unmask = iop321_irq_unmask,
59};
60
61void __init iop321_init_irq(void)
62{
63 unsigned int i, tmp;
64
65 /* Enable access to coprocessor 6 for dealing with IRQs.
66 * From RMK:
67 * Basically, the Intel documentation here is poor. It appears that
68 * you need to set the bit to be able to access the coprocessor from
69 * SVC mode. Whether that allows access from user space or not is
70 * unclear.
71 */
72 asm volatile (
73 "mrc p15, 0, %0, c15, c1, 0\n\t"
74 "orr %0, %0, %1\n\t"
75 "mcr p15, 0, %0, c15, c1, 0\n\t"
76 /* The action is delayed, so we have to do this: */
77 "mrc p15, 0, %0, c15, c1, 0\n\t"
78 "mov %0, %0\n\t"
79 "sub pc, pc, #4"
80 : "=r" (tmp) : "i" (1 << 6) );
81
82 intctl_write(0); // disable all interrupts
83 intstr_write(0); // treat all as IRQ
84 if(machine_is_iq80321() ||
85 machine_is_iq31244()) // all interrupts are inputs to chip
86 *IOP321_PCIIRSR = 0x0f;
87
88 for(i = IOP321_IRQ_OFS; i < NR_IOP321_IRQS; i++)
89 {
90 set_irq_chip(i, &ext_chip);
91 set_irq_handler(i, do_level_IRQ);
92 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
93
94 }
95}
96
diff --git a/arch/arm/mach-iop3xx/iop321-pci.c b/arch/arm/mach-iop3xx/iop321-pci.c
new file mode 100644
index 000000000000..8ba6a0e23134
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iop321-pci.c
@@ -0,0 +1,220 @@
1/*
2 * arch/arm/mach-iop3xx/iop321-pci.c
3 *
4 * PCI support for the Intel IOP321 chipset
5 *
6 * Author: Rory Bolt <rorybolt@pacbell.net>
7 * Copyright (C) 2002 Rory Bolt
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14#include <linux/kernel.h>
15#include <linux/pci.h>
16#include <linux/slab.h>
17#include <linux/mm.h>
18#include <linux/init.h>
19#include <linux/ioport.h>
20
21#include <asm/io.h>
22#include <asm/irq.h>
23#include <asm/system.h>
24#include <asm/hardware.h>
25#include <asm/mach/pci.h>
26
27#include <asm/arch/iop321.h>
28
29// #define DEBUG
30
31#ifdef DEBUG
32#define DBG(x...) printk(x)
33#else
34#define DBG(x...) do { } while (0)
35#endif
36
37/*
38 * This routine builds either a type0 or type1 configuration command. If the
39 * bus is on the 80321 then a type0 made, else a type1 is created.
40 */
41static u32 iop321_cfg_address(struct pci_bus *bus, int devfn, int where)
42{
43 struct pci_sys_data *sys = bus->sysdata;
44 u32 addr;
45
46 if (sys->busnr == bus->number)
47 addr = 1 << (PCI_SLOT(devfn) + 16) | (PCI_SLOT(devfn) << 11);
48 else
49 addr = bus->number << 16 | PCI_SLOT(devfn) << 11 | 1;
50
51 addr |= PCI_FUNC(devfn) << 8 | (where & ~3);
52
53 return addr;
54}
55
56/*
57 * This routine checks the status of the last configuration cycle. If an error
58 * was detected it returns a 1, else it returns a 0. The errors being checked
59 * are parity, master abort, target abort (master and target). These types of
60 * errors occure during a config cycle where there is no device, like during
61 * the discovery stage.
62 */
63static int iop321_pci_status(void)
64{
65 unsigned int status;
66 int ret = 0;
67
68 /*
69 * Check the status registers.
70 */
71 status = *IOP321_ATUSR;
72 if (status & 0xf900)
73 {
74 DBG("\t\t\tPCI: P0 - status = 0x%08x\n", status);
75 *IOP321_ATUSR = status & 0xf900;
76 ret = 1;
77 }
78 status = *IOP321_ATUISR;
79 if (status & 0x679f)
80 {
81 DBG("\t\t\tPCI: P1 - status = 0x%08x\n", status);
82 *IOP321_ATUISR = status & 0x679f;
83 ret = 1;
84 }
85 return ret;
86}
87
88/*
89 * Simply write the address register and read the configuration
90 * data. Note that the 4 nop's ensure that we are able to handle
91 * a delayed abort (in theory.)
92 */
93static inline u32 iop321_read(unsigned long addr)
94{
95 u32 val;
96
97 __asm__ __volatile__(
98 "str %1, [%2]\n\t"
99 "ldr %0, [%3]\n\t"
100 "nop\n\t"
101 "nop\n\t"
102 "nop\n\t"
103 "nop\n\t"
104 : "=r" (val)
105 : "r" (addr), "r" (IOP321_OCCAR), "r" (IOP321_OCCDR));
106
107 return val;
108}
109
110/*
111 * The read routines must check the error status of the last configuration
112 * cycle. If there was an error, the routine returns all hex f's.
113 */
114static int
115iop321_read_config(struct pci_bus *bus, unsigned int devfn, int where,
116 int size, u32 *value)
117{
118 unsigned long addr = iop321_cfg_address(bus, devfn, where);
119 u32 val = iop321_read(addr) >> ((where & 3) * 8);
120
121 if( iop321_pci_status() )
122 val = 0xffffffff;
123
124 *value = val;
125
126 return PCIBIOS_SUCCESSFUL;
127}
128
129static int
130iop321_write_config(struct pci_bus *bus, unsigned int devfn, int where,
131 int size, u32 value)
132{
133 unsigned long addr = iop321_cfg_address(bus, devfn, where);
134 u32 val;
135
136 if (size != 4) {
137 val = iop321_read(addr);
138 if (!iop321_pci_status() == 0)
139 return PCIBIOS_SUCCESSFUL;
140
141 where = (where & 3) * 8;
142
143 if (size == 1)
144 val &= ~(0xff << where);
145 else
146 val &= ~(0xffff << where);
147
148 *IOP321_OCCDR = val | value << where;
149 } else {
150 asm volatile(
151 "str %1, [%2]\n\t"
152 "str %0, [%3]\n\t"
153 "nop\n\t"
154 "nop\n\t"
155 "nop\n\t"
156 "nop\n\t"
157 :
158 : "r" (value), "r" (addr),
159 "r" (IOP321_OCCAR), "r" (IOP321_OCCDR));
160 }
161
162 return PCIBIOS_SUCCESSFUL;
163}
164
165static struct pci_ops iop321_ops = {
166 .read = iop321_read_config,
167 .write = iop321_write_config,
168};
169
170/*
171 * When a PCI device does not exist during config cycles, the 80200 gets a
172 * bus error instead of returning 0xffffffff. This handler simply returns.
173 */
174int
175iop321_pci_abort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
176{
177 DBG("PCI abort: address = 0x%08lx fsr = 0x%03x PC = 0x%08lx LR = 0x%08lx\n",
178 addr, fsr, regs->ARM_pc, regs->ARM_lr);
179
180 /*
181 * If it was an imprecise abort, then we need to correct the
182 * return address to be _after_ the instruction.
183 */
184 if (fsr & (1 << 10))
185 regs->ARM_pc += 4;
186
187 return 0;
188}
189
190/*
191 * Scan an IOP321 PCI bus. sys->bus defines which bus we scan.
192 */
193struct pci_bus *iop321_scan_bus(int nr, struct pci_sys_data *sys)
194{
195 return pci_scan_bus(sys->busnr, &iop321_ops, sys);
196}
197
198void iop321_init(void)
199{
200 DBG("PCI: Intel 80321 PCI init code.\n");
201 DBG("ATU: IOP321_ATUCMD=0x%04x\n", *IOP321_ATUCMD);
202 DBG("ATU: IOP321_OMWTVR0=0x%04x, IOP321_OIOWTVR=0x%04x\n",
203 *IOP321_OMWTVR0,
204 *IOP321_OIOWTVR);
205 DBG("ATU: IOP321_ATUCR=0x%08x\n", *IOP321_ATUCR);
206 DBG("ATU: IOP321_IABAR0=0x%08x IOP321_IALR0=0x%08x IOP321_IATVR0=%08x\n",
207 *IOP321_IABAR0, *IOP321_IALR0, *IOP321_IATVR0);
208 DBG("ATU: IOP321_OMWTVR0=0x%08x\n", *IOP321_OMWTVR0);
209 DBG("ATU: IOP321_IABAR1=0x%08x IOP321_IALR1=0x%08x\n",
210 *IOP321_IABAR1, *IOP321_IALR1);
211 DBG("ATU: IOP321_ERBAR=0x%08x IOP321_ERLR=0x%08x IOP321_ERTVR=%08x\n",
212 *IOP321_ERBAR, *IOP321_ERLR, *IOP321_ERTVR);
213 DBG("ATU: IOP321_IABAR2=0x%08x IOP321_IALR2=0x%08x IOP321_IATVR2=%08x\n",
214 *IOP321_IABAR2, *IOP321_IALR2, *IOP321_IATVR2);
215 DBG("ATU: IOP321_IABAR3=0x%08x IOP321_IALR3=0x%08x IOP321_IATVR3=%08x\n",
216 *IOP321_IABAR3, *IOP321_IALR3, *IOP321_IATVR3);
217
218 hook_fault_code(16+6, iop321_pci_abort, SIGBUS, "imprecise external abort");
219}
220
diff --git a/arch/arm/mach-iop3xx/iop321-setup.c b/arch/arm/mach-iop3xx/iop321-setup.c
new file mode 100644
index 000000000000..bf23e0fd2843
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iop321-setup.c
@@ -0,0 +1,169 @@
1/*
2 * linux/arch/arm/mach-iop3xx/iop321-setup.c
3 *
4 * Author: Nicolas Pitre <nico@cam.org>
5 * Copyright (C) 2001 MontaVista Software, Inc.
6 * Copyright (C) 2004 Intel Corporation.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13#include <linux/mm.h>
14#include <linux/init.h>
15#include <linux/config.h>
16#include <linux/init.h>
17#include <linux/major.h>
18#include <linux/fs.h>
19#include <linux/device.h>
20#include <linux/serial.h>
21#include <linux/tty.h>
22#include <linux/serial_core.h>
23
24#include <asm/io.h>
25#include <asm/pgtable.h>
26#include <asm/page.h>
27#include <asm/mach/map.h>
28#include <asm/setup.h>
29#include <asm/system.h>
30#include <asm/memory.h>
31#include <asm/hardware.h>
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34
35#define IOP321_UART_XTAL 1843200
36
37/*
38 * Standard IO mapping for all IOP321 based systems
39 */
40static struct map_desc iop321_std_desc[] __initdata = {
41 /* virtual physical length type */
42
43 /* mem mapped registers */
44 { IOP321_VIRT_MEM_BASE, IOP321_PHYS_MEM_BASE, 0x00002000, MT_DEVICE },
45
46 /* PCI IO space */
47 { IOP321_PCI_LOWER_IO_VA, IOP321_PCI_LOWER_IO_PA, IOP321_PCI_IO_WINDOW_SIZE, MT_DEVICE }
48};
49
50#ifdef CONFIG_ARCH_IQ80321
51#define UARTBASE IQ80321_UART
52#define IRQ_UART IRQ_IQ80321_UART
53#endif
54
55#ifdef CONFIG_ARCH_IQ31244
56#define UARTBASE IQ31244_UART
57#define IRQ_UART IRQ_IQ31244_UART
58#endif
59
60static struct uart_port iop321_serial_ports[] = {
61 {
62 .membase = (char*)(UARTBASE),
63 .mapbase = (UARTBASE),
64 .irq = IRQ_UART,
65 .flags = UPF_SKIP_TEST,
66 .iotype = UPIO_MEM,
67 .regshift = 0,
68 .uartclk = IOP321_UART_XTAL,
69 .line = 0,
70 .type = PORT_16550A,
71 .fifosize = 16
72 }
73};
74
75static struct resource iop32x_i2c_0_resources[] = {
76 [0] = {
77 .start = 0xfffff680,
78 .end = 0xfffff698,
79 .flags = IORESOURCE_MEM,
80 },
81 [1] = {
82 .start = IRQ_IOP321_I2C_0,
83 .end = IRQ_IOP321_I2C_0,
84 .flags = IORESOURCE_IRQ
85 }
86};
87
88static struct resource iop32x_i2c_1_resources[] = {
89 [0] = {
90 .start = 0xfffff6a0,
91 .end = 0xfffff6b8,
92 .flags = IORESOURCE_MEM,
93 },
94 [1] = {
95 .start = IRQ_IOP321_I2C_1,
96 .end = IRQ_IOP321_I2C_1,
97 .flags = IORESOURCE_IRQ
98 }
99};
100
101static struct platform_device iop32x_i2c_0_controller = {
102 .name = "IOP3xx-I2C",
103 .id = 0,
104 .num_resources = 2,
105 .resource = iop32x_i2c_0_resources
106};
107
108static struct platform_device iop32x_i2c_1_controller = {
109 .name = "IOP3xx-I2C",
110 .id = 1,
111 .num_resources = 2,
112 .resource = iop32x_i2c_1_resources
113};
114
115static struct platform_device *iop32x_devices[] __initdata = {
116 &iop32x_i2c_0_controller,
117 &iop32x_i2c_1_controller
118};
119
120void __init iop32x_init(void)
121{
122 if(iop_is_321())
123 {
124 platform_add_devices(iop32x_devices,
125 ARRAY_SIZE(iop32x_devices));
126 }
127}
128
129void __init iop321_map_io(void)
130{
131 iotable_init(iop321_std_desc, ARRAY_SIZE(iop321_std_desc));
132 early_serial_setup(&iop321_serial_ports[0]);
133}
134
135#ifdef CONFIG_ARCH_IQ80321
136extern void iq80321_map_io(void);
137extern struct sys_timer iop321_timer;
138extern void iop321_init_time(void);
139#endif
140
141#ifdef CONFIG_ARCH_IQ31244
142extern void iq31244_map_io(void);
143extern struct sys_timer iop321_timer;
144extern void iop321_init_time(void);
145#endif
146
147#if defined(CONFIG_ARCH_IQ80321)
148MACHINE_START(IQ80321, "Intel IQ80321")
149 MAINTAINER("Intel Corporation")
150 BOOT_MEM(PHYS_OFFSET, IQ80321_UART, IQ80321_UART)
151 MAPIO(iq80321_map_io)
152 INITIRQ(iop321_init_irq)
153 .timer = &iop321_timer,
154 BOOT_PARAMS(0xa0000100)
155 INIT_MACHINE(iop32x_init)
156MACHINE_END
157#elif defined(CONFIG_ARCH_IQ31244)
158MACHINE_START(IQ31244, "Intel IQ31244")
159 MAINTAINER("Intel Corp.")
160 BOOT_MEM(PHYS_OFFSET, IQ31244_UART, IQ31244_UART)
161 MAPIO(iq31244_map_io)
162 INITIRQ(iop321_init_irq)
163 .timer = &iop321_timer,
164 BOOT_PARAMS(0xa0000100)
165 INIT_MACHINE(iop32x_init)
166MACHINE_END
167#else
168#error No machine descriptor defined for this IOP3XX implementation
169#endif
diff --git a/arch/arm/mach-iop3xx/iop321-time.c b/arch/arm/mach-iop3xx/iop321-time.c
new file mode 100644
index 000000000000..9b7dd64d1b8f
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iop321-time.c
@@ -0,0 +1,109 @@
1/*
2 * arch/arm/mach-iop3xx/iop321-time.c
3 *
4 * Timer code for IOP321 based systems
5 *
6 * Author: Deepak Saxena <dsaxena@mvista.com>
7 *
8 * Copyright 2002-2003 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#include <linux/kernel.h>
17#include <linux/interrupt.h>
18#include <linux/time.h>
19#include <linux/init.h>
20#include <linux/timex.h>
21
22#include <asm/hardware.h>
23#include <asm/io.h>
24#include <asm/irq.h>
25#include <asm/uaccess.h>
26#include <asm/mach-types.h>
27#include <asm/mach/irq.h>
28#include <asm/mach/time.h>
29
30#define IOP321_TIME_SYNC 0
31
32static inline unsigned long get_elapsed(void)
33{
34 return LATCH - *IOP321_TU_TCR0;
35}
36
37static unsigned long iop321_gettimeoffset(void)
38{
39 unsigned long elapsed, usec;
40 u32 tisr1, tisr2;
41
42 /*
43 * If an interrupt was pending before we read the timer,
44 * we've already wrapped. Factor this into the time.
45 * If an interrupt was pending after we read the timer,
46 * it may have wrapped between checking the interrupt
47 * status and reading the timer. Re-read the timer to
48 * be sure its value is after the wrap.
49 */
50
51 asm volatile("mrc p6, 0, %0, c6, c1, 0" : "=r" (tisr1));
52 elapsed = get_elapsed();
53 asm volatile("mrc p6, 0, %0, c6, c1, 0" : "=r" (tisr2));
54
55 if(tisr1 & 1)
56 elapsed += LATCH;
57 else if (tisr2 & 1)
58 elapsed = LATCH + get_elapsed();
59
60 /*
61 * Now convert them to usec.
62 */
63 usec = (unsigned long)(elapsed * (tick_nsec / 1000)) / LATCH;
64
65 return usec;
66}
67
68static irqreturn_t
69iop321_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
70{
71 u32 tisr;
72
73 write_seqlock(&xtime_lock);
74
75 asm volatile("mrc p6, 0, %0, c6, c1, 0" : "=r" (tisr));
76 tisr |= 1;
77 asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (tisr));
78
79 timer_tick(regs);
80
81 write_sequnlock(&xtime_lock);
82
83 return IRQ_HANDLED;
84}
85
86static struct irqaction iop321_timer_irq = {
87 .name = "IOP321 Timer Tick",
88 .handler = iop321_timer_interrupt,
89 .flags = SA_INTERRUPT
90};
91
92static void __init iop321_timer_init(void)
93{
94 u32 timer_ctl;
95
96 setup_irq(IRQ_IOP321_TIMER0, &iop321_timer_irq);
97
98 timer_ctl = IOP321_TMR_EN | IOP321_TMR_PRIVILEGED | IOP321_TMR_RELOAD |
99 IOP321_TMR_RATIO_1_1;
100
101 asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (LATCH));
102
103 asm volatile("mcr p6, 0, %0, c0, c1, 0" : : "r" (timer_ctl));
104}
105
106struct sys_timer iop321_timer = {
107 .init = &iop321_timer_init,
108 .offset = iop321_gettimeoffset,
109};
diff --git a/arch/arm/mach-iop3xx/iop331-irq.c b/arch/arm/mach-iop3xx/iop331-irq.c
new file mode 100644
index 000000000000..f4d4321737a4
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iop331-irq.c
@@ -0,0 +1,127 @@
1/*
2 * linux/arch/arm/mach-iop3xx/iop331-irq.c
3 *
4 * Generic IOP331 IRQ handling functionality
5 *
6 * Author: Dave Jiang <dave.jiang@intel.com>
7 * Copyright (C) 2003 Intel Corp.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 *
14 */
15#include <linux/init.h>
16#include <linux/interrupt.h>
17#include <linux/list.h>
18
19#include <asm/mach/irq.h>
20#include <asm/irq.h>
21#include <asm/hardware.h>
22
23#include <asm/mach-types.h>
24
25static u32 iop331_mask0 = 0;
26static u32 iop331_mask1 = 0;
27
28static inline void intctl_write0(u32 val)
29{
30 // INTCTL0
31 asm volatile("mcr p6,0,%0,c0,c0,0"::"r" (val));
32}
33
34static inline void intctl_write1(u32 val)
35{
36 // INTCTL1
37 asm volatile("mcr p6,0,%0,c1,c0,0"::"r" (val));
38}
39
40static inline void intstr_write0(u32 val)
41{
42 // INTSTR0
43 asm volatile("mcr p6,0,%0,c2,c0,0"::"r" (val));
44}
45
46static inline void intstr_write1(u32 val)
47{
48 // INTSTR1
49 asm volatile("mcr p6,0,%0,c3,c0,0"::"r" (val));
50}
51
52static void
53iop331_irq_mask1 (unsigned int irq)
54{
55 iop331_mask0 &= ~(1 << (irq - IOP331_IRQ_OFS));
56 intctl_write0(iop331_mask0);
57}
58
59static void
60iop331_irq_mask2 (unsigned int irq)
61{
62 iop331_mask1 &= ~(1 << (irq - IOP331_IRQ_OFS - 32));
63 intctl_write1(iop331_mask1);
64}
65
66static void
67iop331_irq_unmask1(unsigned int irq)
68{
69 iop331_mask0 |= (1 << (irq - IOP331_IRQ_OFS));
70 intctl_write0(iop331_mask0);
71}
72
73static void
74iop331_irq_unmask2(unsigned int irq)
75{
76 iop331_mask1 |= (1 << (irq - IOP331_IRQ_OFS - 32));
77 intctl_write1(iop331_mask1);
78}
79
80struct irqchip iop331_irqchip1 = {
81 .ack = iop331_irq_mask1,
82 .mask = iop331_irq_mask1,
83 .unmask = iop331_irq_unmask1,
84};
85
86struct irqchip iop331_irqchip2 = {
87 .ack = iop331_irq_mask2,
88 .mask = iop331_irq_mask2,
89 .unmask = iop331_irq_unmask2,
90};
91
92void __init iop331_init_irq(void)
93{
94 unsigned int i, tmp;
95
96 /* Enable access to coprocessor 6 for dealing with IRQs.
97 * From RMK:
98 * Basically, the Intel documentation here is poor. It appears that
99 * you need to set the bit to be able to access the coprocessor from
100 * SVC mode. Whether that allows access from user space or not is
101 * unclear.
102 */
103 asm volatile (
104 "mrc p15, 0, %0, c15, c1, 0\n\t"
105 "orr %0, %0, %1\n\t"
106 "mcr p15, 0, %0, c15, c1, 0\n\t"
107 /* The action is delayed, so we have to do this: */
108 "mrc p15, 0, %0, c15, c1, 0\n\t"
109 "mov %0, %0\n\t"
110 "sub pc, pc, #4"
111 : "=r" (tmp) : "i" (1 << 6) );
112
113 intctl_write0(0); // disable all interrupts
114 intctl_write1(0);
115 intstr_write0(0); // treat all as IRQ
116 intstr_write1(0);
117 if(machine_is_iq80331()) // all interrupts are inputs to chip
118 *IOP331_PCIIRSR = 0x0f;
119
120 for(i = IOP331_IRQ_OFS; i < NR_IOP331_IRQS; i++)
121 {
122 set_irq_chip(i, (i < 32) ? &iop331_irqchip1 : &iop331_irqchip2);
123 set_irq_handler(i, do_level_IRQ);
124 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
125 }
126}
127
diff --git a/arch/arm/mach-iop3xx/iop331-pci.c b/arch/arm/mach-iop3xx/iop331-pci.c
new file mode 100644
index 000000000000..44dd213b48a3
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iop331-pci.c
@@ -0,0 +1,222 @@
1/*
2 * arch/arm/mach-iop3xx/iop331-pci.c
3 *
4 * PCI support for the Intel IOP331 chipset
5 *
6 * Author: Dave Jiang (dave.jiang@intel.com)
7 * Copyright (C) 2003, 2004 Intel Corp.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14#include <linux/kernel.h>
15#include <linux/pci.h>
16#include <linux/slab.h>
17#include <linux/mm.h>
18#include <linux/init.h>
19#include <linux/ioport.h>
20
21#include <asm/io.h>
22#include <asm/irq.h>
23#include <asm/system.h>
24#include <asm/hardware.h>
25#include <asm/mach/pci.h>
26
27#include <asm/arch/iop331.h>
28
29#undef DEBUG
30#undef DEBUG1
31
32#ifdef DEBUG
33#define DBG(x...) printk(x)
34#else
35#define DBG(x...) do { } while (0)
36#endif
37
38#ifdef DEBUG1
39#define DBG1(x...) printk(x)
40#else
41#define DBG1(x...) do { } while (0)
42#endif
43
44/*
45 * This routine builds either a type0 or type1 configuration command. If the
46 * bus is on the 80331 then a type0 made, else a type1 is created.
47 */
48static u32 iop331_cfg_address(struct pci_bus *bus, int devfn, int where)
49{
50 struct pci_sys_data *sys = bus->sysdata;
51 u32 addr;
52
53 if (sys->busnr == bus->number)
54 addr = 1 << (PCI_SLOT(devfn) + 16) | (PCI_SLOT(devfn) << 11);
55 else
56 addr = bus->number << 16 | PCI_SLOT(devfn) << 11 | 1;
57
58 addr |= PCI_FUNC(devfn) << 8 | (where & ~3);
59
60 return addr;
61}
62
63/*
64 * This routine checks the status of the last configuration cycle. If an error
65 * was detected it returns a 1, else it returns a 0. The errors being checked
66 * are parity, master abort, target abort (master and target). These types of
67 * errors occure during a config cycle where there is no device, like during
68 * the discovery stage.
69 */
70static int iop331_pci_status(void)
71{
72 unsigned int status;
73 int ret = 0;
74
75 /*
76 * Check the status registers.
77 */
78 status = *IOP331_ATUSR;
79 if (status & 0xf900)
80 {
81 DBG("\t\t\tPCI: P0 - status = 0x%08x\n", status);
82 *IOP331_ATUSR = status & 0xf900;
83 ret = 1;
84 }
85 status = *IOP331_ATUISR;
86 if (status & 0x679f)
87 {
88 DBG("\t\t\tPCI: P1 - status = 0x%08x\n", status);
89 *IOP331_ATUISR = status & 0x679f;
90 ret = 1;
91 }
92 return ret;
93}
94
95/*
96 * Simply write the address register and read the configuration
97 * data. Note that the 4 nop's ensure that we are able to handle
98 * a delayed abort (in theory.)
99 */
100static inline u32 iop331_read(unsigned long addr)
101{
102 u32 val;
103
104 __asm__ __volatile__(
105 "str %1, [%2]\n\t"
106 "ldr %0, [%3]\n\t"
107 "nop\n\t"
108 "nop\n\t"
109 "nop\n\t"
110 "nop\n\t"
111 : "=r" (val)
112 : "r" (addr), "r" (IOP331_OCCAR), "r" (IOP331_OCCDR));
113
114 return val;
115}
116
117/*
118 * The read routines must check the error status of the last configuration
119 * cycle. If there was an error, the routine returns all hex f's.
120 */
121static int
122iop331_read_config(struct pci_bus *bus, unsigned int devfn, int where,
123 int size, u32 *value)
124{
125 unsigned long addr = iop331_cfg_address(bus, devfn, where);
126 u32 val = iop331_read(addr) >> ((where & 3) * 8);
127
128 if( iop331_pci_status() )
129 val = 0xffffffff;
130
131 *value = val;
132
133 return PCIBIOS_SUCCESSFUL;
134}
135
136static int
137iop331_write_config(struct pci_bus *bus, unsigned int devfn, int where,
138 int size, u32 value)
139{
140 unsigned long addr = iop331_cfg_address(bus, devfn, where);
141 u32 val;
142
143 if (size != 4) {
144 val = iop331_read(addr);
145 if (!iop331_pci_status() == 0)
146 return PCIBIOS_SUCCESSFUL;
147
148 where = (where & 3) * 8;
149
150 if (size == 1)
151 val &= ~(0xff << where);
152 else
153 val &= ~(0xffff << where);
154
155 *IOP331_OCCDR = val | value << where;
156 } else {
157 asm volatile(
158 "str %1, [%2]\n\t"
159 "str %0, [%3]\n\t"
160 "nop\n\t"
161 "nop\n\t"
162 "nop\n\t"
163 "nop\n\t"
164 :
165 : "r" (value), "r" (addr),
166 "r" (IOP331_OCCAR), "r" (IOP331_OCCDR));
167 }
168
169 return PCIBIOS_SUCCESSFUL;
170}
171
172static struct pci_ops iop331_ops = {
173 .read = iop331_read_config,
174 .write = iop331_write_config,
175};
176
177/*
178 * When a PCI device does not exist during config cycles, the XScale gets a
179 * bus error instead of returning 0xffffffff. This handler simply returns.
180 */
181int
182iop331_pci_abort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
183{
184 DBG("PCI abort: address = 0x%08lx fsr = 0x%03x PC = 0x%08lx LR = 0x%08lx\n",
185 addr, fsr, regs->ARM_pc, regs->ARM_lr);
186
187 /*
188 * If it was an imprecise abort, then we need to correct the
189 * return address to be _after_ the instruction.
190 */
191 if (fsr & (1 << 10))
192 regs->ARM_pc += 4;
193
194 return 0;
195}
196
197/*
198 * Scan an IOP331 PCI bus. sys->bus defines which bus we scan.
199 */
200struct pci_bus *iop331_scan_bus(int nr, struct pci_sys_data *sys)
201{
202 return pci_scan_bus(sys->busnr, &iop331_ops, sys);
203}
204
205void iop331_init(void)
206{
207 DBG1("PCI: Intel 80331 PCI init code.\n");
208 DBG1("\tATU: IOP331_ATUCMD=0x%04x\n", *IOP331_ATUCMD);
209 DBG1("\tATU: IOP331_OMWTVR0=0x%04x, IOP331_OIOWTVR=0x%04x\n",
210 *IOP331_OMWTVR0,
211 *IOP331_OIOWTVR);
212 DBG1("\tATU: IOP331_OMWTVR1=0x%04x\n", *IOP331_OMWTVR1);
213 DBG1("\tATU: IOP331_ATUCR=0x%08x\n", *IOP331_ATUCR);
214 DBG1("\tATU: IOP331_IABAR0=0x%08x IOP331_IALR0=0x%08x IOP331_IATVR0=%08x\n", *IOP331_IABAR0, *IOP331_IALR0, *IOP331_IATVR0);
215 DBG1("\tATU: IOP31_IABAR1=0x%08x IOP331_IALR1=0x%08x\n", *IOP331_IABAR1, *IOP331_IALR1);
216 DBG1("\tATU: IOP331_ERBAR=0x%08x IOP331_ERLR=0x%08x IOP331_ERTVR=%08x\n", *IOP331_ERBAR, *IOP331_ERLR, *IOP331_ERTVR);
217 DBG1("\tATU: IOP331_IABAR2=0x%08x IOP331_IALR2=0x%08x IOP331_IATVR2=%08x\n", *IOP331_IABAR2, *IOP331_IALR2, *IOP331_IATVR2);
218 DBG1("\tATU: IOP331_IABAR3=0x%08x IOP331_IALR3=0x%08x IOP331_IATVR3=%08x\n", *IOP331_IABAR3, *IOP331_IALR3, *IOP331_IATVR3);
219
220 hook_fault_code(16+6, iop331_pci_abort, SIGBUS, "imprecise external abort");
221}
222
diff --git a/arch/arm/mach-iop3xx/iop331-setup.c b/arch/arm/mach-iop3xx/iop331-setup.c
new file mode 100644
index 000000000000..622e7914819a
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iop331-setup.c
@@ -0,0 +1,177 @@
1/*
2 * linux/arch/arm/mach-iop3xx/iop331-setup.c
3 *
4 * Author: Dave Jiang (dave.jiang@intel.com)
5 * Copyright (C) 2004 Intel Corporation.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12#include <linux/mm.h>
13#include <linux/init.h>
14#include <linux/config.h>
15#include <linux/init.h>
16#include <linux/major.h>
17#include <linux/fs.h>
18#include <linux/device.h>
19#include <linux/serial.h>
20#include <linux/tty.h>
21#include <linux/serial_core.h>
22
23#include <asm/io.h>
24#include <asm/pgtable.h>
25#include <asm/page.h>
26#include <asm/mach/map.h>
27#include <asm/setup.h>
28#include <asm/system.h>
29#include <asm/memory.h>
30#include <asm/hardware.h>
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33
34#define IOP331_UART_XTAL 33334000
35
36/*
37 * Standard IO mapping for all IOP331 based systems
38 */
39static struct map_desc iop331_std_desc[] __initdata = {
40 /* virtual physical length type */
41
42 /* mem mapped registers */
43 { IOP331_VIRT_MEM_BASE, IOP331_PHYS_MEM_BASE, 0x00002000, MT_DEVICE },
44
45 /* PCI IO space */
46 { IOP331_PCI_LOWER_IO_VA, IOP331_PCI_LOWER_IO_PA, IOP331_PCI_IO_WINDOW_SIZE, MT_DEVICE }
47};
48
49static struct uart_port iop331_serial_ports[] = {
50 {
51 .membase = (char*)(IOP331_UART0_VIRT),
52 .mapbase = (IOP331_UART0_PHYS),
53 .irq = IRQ_IOP331_UART0,
54 .flags = UPF_SKIP_TEST,
55 .iotype = UPIO_MEM,
56 .regshift = 2,
57 .uartclk = IOP331_UART_XTAL,
58 .line = 0,
59 .type = PORT_XSCALE,
60 .fifosize = 32
61 } , {
62 .membase = (char*)(IOP331_UART1_VIRT),
63 .mapbase = (IOP331_UART1_PHYS),
64 .irq = IRQ_IOP331_UART1,
65 .flags = UPF_SKIP_TEST,
66 .iotype = UPIO_MEM,
67 .regshift = 2,
68 .uartclk = IOP331_UART_XTAL,
69 .line = 1,
70 .type = PORT_XSCALE,
71 .fifosize = 32
72 }
73};
74
75static struct resource iop33x_i2c_0_resources[] = {
76 [0] = {
77 .start = 0xfffff680,
78 .end = 0xfffff698,
79 .flags = IORESOURCE_MEM,
80 },
81 [1] = {
82 .start = IRQ_IOP331_I2C_0,
83 .end = IRQ_IOP331_I2C_0,
84 .flags = IORESOURCE_IRQ
85 }
86};
87
88static struct resource iop33x_i2c_1_resources[] = {
89 [0] = {
90 .start = 0xfffff6a0,
91 .end = 0xfffff6b8,
92 .flags = IORESOURCE_MEM,
93 },
94 [1] = {
95 .start = IRQ_IOP331_I2C_1,
96 .end = IRQ_IOP331_I2C_1,
97 .flags = IORESOURCE_IRQ
98 }
99};
100
101static struct platform_device iop33x_i2c_0_controller = {
102 .name = "IOP3xx-I2C",
103 .id = 0,
104 .num_resources = 2,
105 .resource = iop33x_i2c_0_resources
106};
107
108static struct platform_device iop33x_i2c_1_controller = {
109 .name = "IOP3xx-I2C",
110 .id = 1,
111 .num_resources = 2,
112 .resource = iop33x_i2c_1_resources
113};
114
115static struct platform_device *iop33x_devices[] __initdata = {
116 &iop33x_i2c_0_controller,
117 &iop33x_i2c_1_controller
118};
119
120void __init iop33x_init(void)
121{
122 if(iop_is_331())
123 {
124 platform_add_devices(iop33x_devices,
125 ARRAY_SIZE(iop33x_devices));
126 }
127}
128
129void __init iop331_map_io(void)
130{
131 iotable_init(iop331_std_desc, ARRAY_SIZE(iop331_std_desc));
132 early_serial_setup(&iop331_serial_ports[0]);
133 early_serial_setup(&iop331_serial_ports[1]);
134}
135
136#ifdef CONFIG_ARCH_IOP331
137extern void iop331_init_irq(void);
138extern struct sys_timer iop331_timer;
139#endif
140
141#ifdef CONFIG_ARCH_IQ80331
142extern void iq80331_map_io(void);
143#endif
144
145#ifdef CONFIG_MACH_IQ80332
146extern void iq80332_map_io(void);
147#endif
148
149#if defined(CONFIG_ARCH_IQ80331)
150MACHINE_START(IQ80331, "Intel IQ80331")
151 MAINTAINER("Intel Corp.")
152 BOOT_MEM(PHYS_OFFSET, 0xfefff000, 0xfffff000) // virtual, physical
153 //BOOT_MEM(PHYS_OFFSET, IOP331_UART0_VIRT, IOP331_UART0_PHYS)
154 MAPIO(iq80331_map_io)
155 INITIRQ(iop331_init_irq)
156 .timer = &iop331_timer,
157 BOOT_PARAMS(0x0100)
158 INIT_MACHINE(iop33x_init)
159MACHINE_END
160
161#elif defined(CONFIG_MACH_IQ80332)
162MACHINE_START(IQ80332, "Intel IQ80332")
163 MAINTAINER("Intel Corp.")
164 BOOT_MEM(PHYS_OFFSET, 0xfefff000, 0xfffff000) // virtual, physical
165 //BOOT_MEM(PHYS_OFFSET, IOP331_UART0_VIRT, IOP331_UART0_PHYS)
166 MAPIO(iq80332_map_io)
167 INITIRQ(iop331_init_irq)
168 .timer = &iop331_timer,
169 BOOT_PARAMS(0x0100)
170 INIT_MACHINE(iop33x_init)
171MACHINE_END
172
173#else
174#error No machine descriptor defined for this IOP3XX implementation
175#endif
176
177
diff --git a/arch/arm/mach-iop3xx/iop331-time.c b/arch/arm/mach-iop3xx/iop331-time.c
new file mode 100644
index 000000000000..e01696769263
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iop331-time.c
@@ -0,0 +1,107 @@
1/*
2 * arch/arm/mach-iop3xx/iop331-time.c
3 *
4 * Timer code for IOP331 based systems
5 *
6 * Author: Dave Jiang <dave.jiang@intel.com>
7 *
8 * Copyright 2003 Intel Corp.
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/kernel.h>
17#include <linux/interrupt.h>
18#include <linux/time.h>
19#include <linux/init.h>
20#include <linux/timex.h>
21
22#include <asm/hardware.h>
23#include <asm/io.h>
24#include <asm/irq.h>
25#include <asm/uaccess.h>
26#include <asm/mach-types.h>
27#include <asm/mach/irq.h>
28#include <asm/mach/time.h>
29
30static inline unsigned long get_elapsed(void)
31{
32 return LATCH - *IOP331_TU_TCR0;
33}
34
35static unsigned long iop331_gettimeoffset(void)
36{
37 unsigned long elapsed, usec;
38 u32 tisr1, tisr2;
39
40 /*
41 * If an interrupt was pending before we read the timer,
42 * we've already wrapped. Factor this into the time.
43 * If an interrupt was pending after we read the timer,
44 * it may have wrapped between checking the interrupt
45 * status and reading the timer. Re-read the timer to
46 * be sure its value is after the wrap.
47 */
48
49 asm volatile("mrc p6, 0, %0, c6, c1, 0" : "=r" (tisr1));
50 elapsed = get_elapsed();
51 asm volatile("mrc p6, 0, %0, c6, c1, 0" : "=r" (tisr2));
52
53 if(tisr1 & 1)
54 elapsed += LATCH;
55 else if (tisr2 & 1)
56 elapsed = LATCH + get_elapsed();
57
58 /*
59 * Now convert them to usec.
60 */
61 usec = (unsigned long)(elapsed * (tick_nsec / 1000)) / LATCH;
62
63 return usec;
64}
65
66static irqreturn_t
67iop331_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
68{
69 u32 tisr;
70
71 write_seqlock(&xtime_lock);
72
73 asm volatile("mrc p6, 0, %0, c6, c1, 0" : "=r" (tisr));
74 tisr |= 1;
75 asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (tisr));
76
77 timer_tick(regs);
78
79 write_sequnlock(&xtime_lock);
80 return IRQ_HANDLED;
81}
82
83static struct irqaction iop331_timer_irq = {
84 .name = "IOP331 Timer Tick",
85 .handler = iop331_timer_interrupt,
86 .flags = SA_INTERRUPT
87};
88
89static void __init iop331_timer_init(void)
90{
91 u32 timer_ctl;
92
93 setup_irq(IRQ_IOP331_TIMER0, &iop331_timer_irq);
94
95 timer_ctl = IOP331_TMR_EN | IOP331_TMR_PRIVILEGED | IOP331_TMR_RELOAD |
96 IOP331_TMR_RATIO_1_1;
97
98 asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (LATCH));
99
100 asm volatile("mcr p6, 0, %0, c0, c1, 0" : : "r" (timer_ctl));
101
102}
103
104struct sys_timer iop331_timer = {
105 .init = iop331_timer_init,
106 .offset = iop331_gettimeoffset,
107};
diff --git a/arch/arm/mach-iop3xx/iq31244-mm.c b/arch/arm/mach-iop3xx/iq31244-mm.c
new file mode 100644
index 000000000000..b01042f7de71
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iq31244-mm.c
@@ -0,0 +1,44 @@
1/*
2 * linux/arch/arm/mach-iop3xx/mm.c
3 *
4 * Low level memory initialization for iq80321 platform
5 *
6 * Author: Rory Bolt <rorybolt@pacbell.net>
7 * Copyright (C) 2002 Rory Bolt
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/mm.h>
17#include <linux/init.h>
18
19#include <asm/io.h>
20#include <asm/pgtable.h>
21#include <asm/page.h>
22
23#include <asm/mach/map.h>
24#include <asm/mach-types.h>
25
26
27/*
28 * IQ80321 specific IO mappings
29 *
30 * We use RedBoot's setup for the onboard devices.
31 */
32static struct map_desc iq31244_io_desc[] __initdata = {
33 /* virtual physical length type */
34
35 /* on-board devices */
36 { IQ31244_UART, IQ31244_UART, 0x00100000, MT_DEVICE }
37};
38
39void __init iq31244_map_io(void)
40{
41 iop321_map_io();
42
43 iotable_init(iq31244_io_desc, ARRAY_SIZE(iq31244_io_desc));
44}
diff --git a/arch/arm/mach-iop3xx/iq31244-pci.c b/arch/arm/mach-iop3xx/iq31244-pci.c
new file mode 100644
index 000000000000..f997daa800bf
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iq31244-pci.c
@@ -0,0 +1,129 @@
1/*
2 * arch/arm/mach-iop3xx/iq80321-pci.c
3 *
4 * PCI support for the Intel IQ80321 reference board
5 *
6 * Author: Rory Bolt <rorybolt@pacbell.net>
7 * Copyright (C) 2002 Rory Bolt
8 * Copyright (C) 2004 Intel Corp.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14#include <linux/kernel.h>
15#include <linux/pci.h>
16#include <linux/init.h>
17
18#include <asm/hardware.h>
19#include <asm/irq.h>
20#include <asm/mach/pci.h>
21#include <asm/mach-types.h>
22
23/*
24 * The following macro is used to lookup irqs in a standard table
25 * format for those systems that do not already have PCI
26 * interrupts properly routed. We assume 1 <= pin <= 4
27 */
28#define PCI_IRQ_TABLE_LOOKUP(minid,maxid) \
29({ int _ctl_ = -1; \
30 unsigned int _idsel = idsel - minid; \
31 if (_idsel <= maxid) \
32 _ctl_ = pci_irq_table[_idsel][pin-1]; \
33 _ctl_; })
34
35#define INTA IRQ_IQ31244_INTA
36#define INTB IRQ_IQ31244_INTB
37#define INTC IRQ_IQ31244_INTC
38#define INTD IRQ_IQ31244_INTD
39
40#define INTE IRQ_IQ31244_I82546
41
42static inline int __init
43iq31244_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
44{
45 static int pci_irq_table[][4] = {
46 /*
47 * PCI IDSEL/INTPIN->INTLINE
48 * A B C D
49 */
50#ifdef CONFIG_ARCH_EP80219
51 {INTB, INTB, INTB, INTB}, /* CFlash */
52 {INTE, INTE, INTE, INTE}, /* 82551 Pro 100 */
53 {INTD, INTD, INTD, INTD}, /* PCI-X Slot */
54 {INTC, INTC, INTC, INTC}, /* SATA */
55#else
56 {INTB, INTB, INTB, INTB}, /* CFlash */
57 {INTC, INTC, INTC, INTC}, /* SATA */
58 {INTD, INTD, INTD, INTD}, /* PCI-X Slot */
59 {INTE, INTE, INTE, INTE}, /* 82546 GigE */
60#endif // CONFIG_ARCH_EP80219
61 };
62
63 BUG_ON(pin < 1 || pin > 4);
64
65 return PCI_IRQ_TABLE_LOOKUP(0, 7);
66}
67
68static int iq31244_setup(int nr, struct pci_sys_data *sys)
69{
70 struct resource *res;
71
72 if(nr != 0)
73 return 0;
74
75 res = kmalloc(sizeof(struct resource) * 2, GFP_KERNEL);
76 if (!res)
77 panic("PCI: unable to alloc resources");
78
79 memset(res, 0, sizeof(struct resource) * 2);
80
81 res[0].start = IOP321_PCI_LOWER_IO_VA;
82 res[0].end = IOP321_PCI_UPPER_IO_VA;
83 res[0].name = "IQ31244 PCI I/O Space";
84 res[0].flags = IORESOURCE_IO;
85
86 res[1].start = IOP321_PCI_LOWER_MEM_PA;
87 res[1].end = IOP321_PCI_UPPER_MEM_PA;
88 res[1].name = "IQ31244 PCI Memory Space";
89 res[1].flags = IORESOURCE_MEM;
90
91 request_resource(&ioport_resource, &res[0]);
92 request_resource(&iomem_resource, &res[1]);
93
94 sys->mem_offset = IOP321_PCI_MEM_OFFSET;
95 sys->io_offset = IOP321_PCI_IO_OFFSET;
96
97 sys->resource[0] = &res[0];
98 sys->resource[1] = &res[1];
99 sys->resource[2] = NULL;
100
101 return 1;
102}
103
104static void iq31244_preinit(void)
105{
106 iop321_init();
107}
108
109static struct hw_pci iq31244_pci __initdata = {
110 .swizzle = pci_std_swizzle,
111 .nr_controllers = 1,
112 .setup = iq31244_setup,
113 .scan = iop321_scan_bus,
114 .preinit = iq31244_preinit,
115 .map_irq = iq31244_map_irq
116};
117
118static int __init iq31244_pci_init(void)
119{
120 if (machine_is_iq31244())
121 pci_common_init(&iq31244_pci);
122 return 0;
123}
124
125subsys_initcall(iq31244_pci_init);
126
127
128
129
diff --git a/arch/arm/mach-iop3xx/iq80321-mm.c b/arch/arm/mach-iop3xx/iq80321-mm.c
new file mode 100644
index 000000000000..1580c7ed2b9d
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iq80321-mm.c
@@ -0,0 +1,44 @@
1/*
2 * linux/arch/arm/mach-iop3xx/mm.c
3 *
4 * Low level memory initialization for iq80321 platform
5 *
6 * Author: Rory Bolt <rorybolt@pacbell.net>
7 * Copyright (C) 2002 Rory Bolt
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/mm.h>
17#include <linux/init.h>
18
19#include <asm/io.h>
20#include <asm/pgtable.h>
21#include <asm/page.h>
22
23#include <asm/mach/map.h>
24#include <asm/mach-types.h>
25
26
27/*
28 * IQ80321 specific IO mappings
29 *
30 * We use RedBoot's setup for the onboard devices.
31 */
32static struct map_desc iq80321_io_desc[] __initdata = {
33 /* virtual physical length type */
34
35 /* on-board devices */
36 { IQ80321_UART, IQ80321_UART, 0x00100000, MT_DEVICE }
37};
38
39void __init iq80321_map_io(void)
40{
41 iop321_map_io();
42
43 iotable_init(iq80321_io_desc, ARRAY_SIZE(iq80321_io_desc));
44}
diff --git a/arch/arm/mach-iop3xx/iq80321-pci.c b/arch/arm/mach-iop3xx/iq80321-pci.c
new file mode 100644
index 000000000000..79fea3d20b66
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iq80321-pci.c
@@ -0,0 +1,123 @@
1/*
2 * arch/arm/mach-iop3xx/iq80321-pci.c
3 *
4 * PCI support for the Intel IQ80321 reference board
5 *
6 * Author: Rory Bolt <rorybolt@pacbell.net>
7 * Copyright (C) 2002 Rory Bolt
8 * Copyright (C) 2004 Intel Corp.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14#include <linux/kernel.h>
15#include <linux/pci.h>
16#include <linux/init.h>
17
18#include <asm/hardware.h>
19#include <asm/irq.h>
20#include <asm/mach/pci.h>
21#include <asm/mach-types.h>
22
23/*
24 * The following macro is used to lookup irqs in a standard table
25 * format for those systems that do not already have PCI
26 * interrupts properly routed. We assume 1 <= pin <= 4
27 */
28#define PCI_IRQ_TABLE_LOOKUP(minid,maxid) \
29({ int _ctl_ = -1; \
30 unsigned int _idsel = idsel - minid; \
31 if (_idsel <= maxid) \
32 _ctl_ = pci_irq_table[_idsel][pin-1]; \
33 _ctl_; })
34
35#define INTA IRQ_IQ80321_INTA
36#define INTB IRQ_IQ80321_INTB
37#define INTC IRQ_IQ80321_INTC
38#define INTD IRQ_IQ80321_INTD
39
40#define INTE IRQ_IQ80321_I82544
41
42static inline int __init
43iq80321_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
44{
45 static int pci_irq_table[][4] = {
46 /*
47 * PCI IDSEL/INTPIN->INTLINE
48 * A B C D
49 */
50 {INTE, INTE, INTE, INTE}, /* Gig-E */
51 {-1, -1, -1, -1}, /* Unused */
52 {INTC, INTD, INTA, INTB}, /* PCI-X Slot */
53 {-1, -1, -1, -1},
54 };
55
56 BUG_ON(pin < 1 || pin > 4);
57
58// return PCI_IRQ_TABLE_LOOKUP(4, 7);
59 return pci_irq_table[idsel%4][pin-1];
60}
61
62static int iq80321_setup(int nr, struct pci_sys_data *sys)
63{
64 struct resource *res;
65
66 if(nr != 0)
67 return 0;
68
69 res = kmalloc(sizeof(struct resource) * 2, GFP_KERNEL);
70 if (!res)
71 panic("PCI: unable to alloc resources");
72
73 memset(res, 0, sizeof(struct resource) * 2);
74
75 res[0].start = IOP321_PCI_LOWER_IO_VA;
76 res[0].end = IOP321_PCI_UPPER_IO_VA;
77 res[0].name = "IQ80321 PCI I/O Space";
78 res[0].flags = IORESOURCE_IO;
79
80 res[1].start = IOP321_PCI_LOWER_MEM_PA;
81 res[1].end = IOP321_PCI_UPPER_MEM_PA;
82 res[1].name = "IQ80321 PCI Memory Space";
83 res[1].flags = IORESOURCE_MEM;
84
85 request_resource(&ioport_resource, &res[0]);
86 request_resource(&iomem_resource, &res[1]);
87
88 sys->mem_offset = IOP321_PCI_MEM_OFFSET;
89 sys->io_offset = IOP321_PCI_IO_OFFSET;
90
91 sys->resource[0] = &res[0];
92 sys->resource[1] = &res[1];
93 sys->resource[2] = NULL;
94
95 return 1;
96}
97
98static void iq80321_preinit(void)
99{
100 iop321_init();
101}
102
103static struct hw_pci iq80321_pci __initdata = {
104 .swizzle = pci_std_swizzle,
105 .nr_controllers = 1,
106 .setup = iq80321_setup,
107 .scan = iop321_scan_bus,
108 .preinit = iq80321_preinit,
109 .map_irq = iq80321_map_irq
110};
111
112static int __init iq80321_pci_init(void)
113{
114 if (machine_is_iq80321())
115 pci_common_init(&iq80321_pci);
116 return 0;
117}
118
119subsys_initcall(iq80321_pci_init);
120
121
122
123
diff --git a/arch/arm/mach-iop3xx/iq80331-mm.c b/arch/arm/mach-iop3xx/iq80331-mm.c
new file mode 100644
index 000000000000..ee8c333e115f
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iq80331-mm.c
@@ -0,0 +1,36 @@
1/*
2 * linux/arch/arm/mach-iop3xx/mm.c
3 *
4 * Low level memory initialization for iq80331 platform
5 *
6 * Author: Dave Jiang <dave.jiang@intel.com>
7 * Copyright (C) 2003 Intel Corp.
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/mm.h>
17#include <linux/init.h>
18
19#include <asm/io.h>
20#include <asm/pgtable.h>
21#include <asm/page.h>
22
23#include <asm/mach/map.h>
24#include <asm/mach-types.h>
25
26
27/*
28 * IQ80331 specific IO mappings
29 *
30 * We use RedBoot's setup for the onboard devices.
31 */
32
33void __init iq80331_map_io(void)
34{
35 iop331_map_io();
36}
diff --git a/arch/arm/mach-iop3xx/iq80331-pci.c b/arch/arm/mach-iop3xx/iq80331-pci.c
new file mode 100644
index 000000000000..f37a0e26b466
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iq80331-pci.c
@@ -0,0 +1,119 @@
1/*
2 * arch/arm/mach-iop3xx/iq80331-pci.c
3 *
4 * PCI support for the Intel IQ80331 reference board
5 *
6 * Author: Dave Jiang <dave.jiang@intel.com>
7 * Copyright (C) 2003, 2004 Intel Corp.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/init.h>
16
17#include <asm/hardware.h>
18#include <asm/irq.h>
19#include <asm/mach/pci.h>
20#include <asm/mach-types.h>
21
22/*
23 * The following macro is used to lookup irqs in a standard table
24 * format for those systems that do not already have PCI
25 * interrupts properly routed. We assume 1 <= pin <= 4
26 */
27#define PCI_IRQ_TABLE_LOOKUP(minid,maxid) \
28({ int _ctl_ = -1; \
29 unsigned int _idsel = idsel - minid; \
30 if (_idsel <= maxid) \
31 _ctl_ = pci_irq_table[_idsel][pin-1]; \
32 _ctl_; })
33
34#define INTA IRQ_IQ80331_INTA
35#define INTB IRQ_IQ80331_INTB
36#define INTC IRQ_IQ80331_INTC
37#define INTD IRQ_IQ80331_INTD
38
39//#define INTE IRQ_IQ80331_I82544
40
41static inline int __init
42iq80331_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
43{
44 static int pci_irq_table[][4] = {
45 /*
46 * PCI IDSEL/INTPIN->INTLINE
47 * A B C D
48 */
49 {INTB, INTC, INTD, INTA}, /* PCI-X Slot */
50 {INTC, INTC, INTC, INTC}, /* GigE */
51 };
52
53 BUG_ON(pin < 1 || pin > 4);
54
55 return PCI_IRQ_TABLE_LOOKUP(1, 7);
56}
57
58static int iq80331_setup(int nr, struct pci_sys_data *sys)
59{
60 struct resource *res;
61
62 if(nr != 0)
63 return 0;
64
65 res = kmalloc(sizeof(struct resource) * 2, GFP_KERNEL);
66 if (!res)
67 panic("PCI: unable to alloc resources");
68
69 memset(res, 0, sizeof(struct resource) * 2);
70
71 res[0].start = IOP331_PCI_LOWER_IO_VA;
72 res[0].end = IOP331_PCI_UPPER_IO_VA;
73 res[0].name = "IQ80331 PCI I/O Space";
74 res[0].flags = IORESOURCE_IO;
75
76 res[1].start = IOP331_PCI_LOWER_MEM_PA;
77 res[1].end = IOP331_PCI_UPPER_MEM_PA;
78 res[1].name = "IQ80331 PCI Memory Space";
79 res[1].flags = IORESOURCE_MEM;
80
81 request_resource(&ioport_resource, &res[0]);
82 request_resource(&iomem_resource, &res[1]);
83
84 sys->mem_offset = IOP331_PCI_MEM_OFFSET;
85 sys->io_offset = IOP331_PCI_IO_OFFSET;
86
87 sys->resource[0] = &res[0];
88 sys->resource[1] = &res[1];
89 sys->resource[2] = NULL;
90
91 return 1;
92}
93
94static void iq80331_preinit(void)
95{
96 iop331_init();
97}
98
99static struct hw_pci iq80331_pci __initdata = {
100 .swizzle = pci_std_swizzle,
101 .nr_controllers = 1,
102 .setup = iq80331_setup,
103 .scan = iop331_scan_bus,
104 .preinit = iq80331_preinit,
105 .map_irq = iq80331_map_irq
106};
107
108static int __init iq80331_pci_init(void)
109{
110 if (machine_is_iq80331())
111 pci_common_init(&iq80331_pci);
112 return 0;
113}
114
115subsys_initcall(iq80331_pci_init);
116
117
118
119
diff --git a/arch/arm/mach-iop3xx/iq80332-mm.c b/arch/arm/mach-iop3xx/iq80332-mm.c
new file mode 100644
index 000000000000..084afcdfb1eb
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iq80332-mm.c
@@ -0,0 +1,36 @@
1/*
2 * linux/arch/arm/mach-iop3xx/mm.c
3 *
4 * Low level memory initialization for iq80332 platform
5 *
6 * Author: Dave Jiang <dave.jiang@intel.com>
7 * Copyright (C) 2004 Intel Corp.
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/mm.h>
17#include <linux/init.h>
18
19#include <asm/io.h>
20#include <asm/pgtable.h>
21#include <asm/page.h>
22
23#include <asm/mach/map.h>
24#include <asm/mach-types.h>
25
26
27/*
28 * IQ80332 specific IO mappings
29 *
30 * We use RedBoot's setup for the onboard devices.
31 */
32
33void __init iq80332_map_io(void)
34{
35 iop331_map_io();
36}
diff --git a/arch/arm/mach-iop3xx/iq80332-pci.c b/arch/arm/mach-iop3xx/iq80332-pci.c
new file mode 100644
index 000000000000..b9807aa2aade
--- /dev/null
+++ b/arch/arm/mach-iop3xx/iq80332-pci.c
@@ -0,0 +1,125 @@
1/*
2 * arch/arm/mach-iop3xx/iq80332-pci.c
3 *
4 * PCI support for the Intel IQ80332 reference board
5 *
6 * Author: Dave Jiang <dave.jiang@intel.com>
7 * Copyright (C) 2004 Intel Corp.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/init.h>
16
17#include <asm/hardware.h>
18#include <asm/irq.h>
19#include <asm/mach/pci.h>
20#include <asm/mach-types.h>
21
22/*
23 * The following macro is used to lookup irqs in a standard table
24 * format for those systems that do not already have PCI
25 * interrupts properly routed. We assume 1 <= pin <= 4
26 */
27#define PCI_IRQ_TABLE_LOOKUP(minid,maxid) \
28({ int _ctl_ = -1; \
29 unsigned int _idsel = idsel - minid; \
30 if (_idsel <= maxid) \
31 _ctl_ = pci_irq_table[_idsel][pin-1]; \
32 _ctl_; })
33
34#define INTA IRQ_IQ80332_INTA
35#define INTB IRQ_IQ80332_INTB
36#define INTC IRQ_IQ80332_INTC
37#define INTD IRQ_IQ80332_INTD
38
39//#define INTE IRQ_IQ80332_I82544
40
41static inline int __init
42iq80332_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
43{
44 static int pci_irq_table[][8] = {
45 /*
46 * PCI IDSEL/INTPIN->INTLINE
47 * A B C D
48 */
49 {-1, -1, -1, -1},
50 {-1, -1, -1, -1},
51 {-1, -1, -1, -1},
52 {INTA, INTB, INTC, INTD}, /* PCI-X Slot */
53 {-1, -1, -1, -1},
54 {INTC, INTC, INTC, INTC}, /* GigE */
55 {-1, -1, -1, -1},
56 {-1, -1, -1, -1},
57 };
58
59 BUG_ON(pin < 1 || pin > 4);
60
61 return PCI_IRQ_TABLE_LOOKUP(1, 7);
62}
63
64static int iq80332_setup(int nr, struct pci_sys_data *sys)
65{
66 struct resource *res;
67
68 if(nr != 0)
69 return 0;
70
71 res = kmalloc(sizeof(struct resource) * 2, GFP_KERNEL);
72 if (!res)
73 panic("PCI: unable to alloc resources");
74
75 memset(res, 0, sizeof(struct resource) * 2);
76
77 res[0].start = IOP331_PCI_LOWER_IO_VA;
78 res[0].end = IOP331_PCI_UPPER_IO_VA;
79 res[0].name = "IQ80332 PCI I/O Space";
80 res[0].flags = IORESOURCE_IO;
81
82 res[1].start = IOP331_PCI_LOWER_MEM_PA;
83 res[1].end = IOP331_PCI_UPPER_MEM_PA;
84 res[1].name = "IQ80332 PCI Memory Space";
85 res[1].flags = IORESOURCE_MEM;
86
87 request_resource(&ioport_resource, &res[0]);
88 request_resource(&iomem_resource, &res[1]);
89
90 sys->mem_offset = IOP331_PCI_MEM_OFFSET;
91 sys->io_offset = IOP331_PCI_IO_OFFSET;
92
93 sys->resource[0] = &res[0];
94 sys->resource[1] = &res[1];
95 sys->resource[2] = NULL;
96
97 return 1;
98}
99
100static void iq80332_preinit(void)
101{
102 iop331_init();
103}
104
105static struct hw_pci iq80332_pci __initdata = {
106 .swizzle = pci_std_swizzle,
107 .nr_controllers = 1,
108 .setup = iq80332_setup,
109 .scan = iop331_scan_bus,
110 .preinit = iq80332_preinit,
111 .map_irq = iq80332_map_irq
112};
113
114static int __init iq80332_pci_init(void)
115{
116 if (machine_is_iq80332())
117 pci_common_init(&iq80332_pci);
118 return 0;
119}
120
121subsys_initcall(iq80332_pci_init);
122
123
124
125
diff --git a/arch/arm/mach-ixp2000/Kconfig b/arch/arm/mach-ixp2000/Kconfig
new file mode 100644
index 000000000000..9361e05f6fa3
--- /dev/null
+++ b/arch/arm/mach-ixp2000/Kconfig
@@ -0,0 +1,59 @@
1
2if ARCH_IXP2000
3
4config ARCH_SUPPORTS_BIG_ENDIAN
5 bool
6 default y
7
8menu "Intel IXP2400/2800 Implementation Options"
9
10comment "IXP2400/2800 Platforms"
11
12config ARCH_ENP2611
13 bool "Support Radisys ENP-2611"
14 help
15 Say 'Y' here if you want your kernel to support the Radisys
16 ENP2611 PCI network processing card. For more information on
17 this card, see <file:Documentation/arm/ENP2611>.
18
19config ARCH_IXDP2400
20 bool "Support Intel IXDP2400"
21 help
22 Say 'Y' here if you want your kernel to support the Intel
23 IXDP2400 reference platform. For more information on
24 this platform, see <file:Documentation/arm/IXP2000>.
25
26config ARCH_IXDP2800
27 bool "Support Intel IXDP2800"
28 help
29 Say 'Y' here if you want your kernel to support the Intel
30 IXDP2800 reference platform. For more information on
31 this platform, see <file:Documentation/arm/IXP2000>.
32
33config ARCH_IXDP2X00
34 bool
35 depends on ARCH_IXDP2400 || ARCH_IXDP2800
36 default y
37
38config ARCH_IXDP2401
39 bool "Support Intel IXDP2401"
40 help
41 Say 'Y' here if you want your kernel to support the Intel
42 IXDP2401 reference platform. For more information on
43 this platform, see <file:Documentation/arm/IXP2000>.
44
45config ARCH_IXDP2801
46 bool "Support Intel IXDP2801"
47 help
48 Say 'Y' here if you want your kernel to support the Intel
49 IXDP2801 reference platform. For more information on
50 this platform, see <file:Documentation/arm/IXP2000>.
51
52config ARCH_IXDP2X01
53 bool
54 depends on ARCH_IXDP2401 || ARCH_IXDP2801
55 default y
56
57endmenu
58
59endif
diff --git a/arch/arm/mach-ixp2000/Makefile b/arch/arm/mach-ixp2000/Makefile
new file mode 100644
index 000000000000..1e6139d42a92
--- /dev/null
+++ b/arch/arm/mach-ixp2000/Makefile
@@ -0,0 +1,14 @@
1#
2# Makefile for the linux kernel.
3#
4obj-y := core.o pci.o
5obj-m :=
6obj-n :=
7obj- :=
8
9obj-$(CONFIG_ARCH_ENP2611) += enp2611.o
10obj-$(CONFIG_ARCH_IXDP2400) += ixdp2400.o
11obj-$(CONFIG_ARCH_IXDP2800) += ixdp2800.o
12obj-$(CONFIG_ARCH_IXDP2X00) += ixdp2x00.o
13obj-$(CONFIG_ARCH_IXDP2X01) += ixdp2x01.o
14
diff --git a/arch/arm/mach-ixp2000/Makefile.boot b/arch/arm/mach-ixp2000/Makefile.boot
new file mode 100644
index 000000000000..d84c5807a43d
--- /dev/null
+++ b/arch/arm/mach-ixp2000/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
new file mode 100644
index 000000000000..4f3c3d5c781c
--- /dev/null
+++ b/arch/arm/mach-ixp2000/core.c
@@ -0,0 +1,390 @@
1/*
2 * arch/arm/mach-ixp2000/common.c
3 *
4 * Common routines used by all IXP2400/2800 based platforms.
5 *
6 * Author: Deepak Saxena <dsaxena@plexity.net>
7 *
8 * Copyright 2004 (C) MontaVista Software, Inc.
9 *
10 * Based on work Copyright (C) 2002-2003 Intel Corporation
11 *
12 * This file is licensed under the terms of the GNU General Public
13 * License version 2. This program is licensed "as is" without any
14 * warranty of any kind, whether express or implied.
15 */
16
17#include <linux/config.h>
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/spinlock.h>
21#include <linux/sched.h>
22#include <linux/interrupt.h>
23#include <linux/serial.h>
24#include <linux/tty.h>
25#include <linux/bitops.h>
26#include <linux/serial_core.h>
27#include <linux/mm.h>
28
29#include <asm/types.h>
30#include <asm/setup.h>
31#include <asm/memory.h>
32#include <asm/hardware.h>
33#include <asm/mach-types.h>
34#include <asm/irq.h>
35#include <asm/system.h>
36#include <asm/tlbflush.h>
37#include <asm/pgtable.h>
38
39#include <asm/mach/map.h>
40#include <asm/mach/time.h>
41#include <asm/mach/irq.h>
42
43static DEFINE_SPINLOCK(ixp2000_slowport_lock);
44static unsigned long ixp2000_slowport_irq_flags;
45
46/*************************************************************************
47 * Slowport access routines
48 *************************************************************************/
49void ixp2000_acquire_slowport(struct slowport_cfg *new_cfg, struct slowport_cfg *old_cfg)
50{
51
52 spin_lock_irqsave(&ixp2000_slowport_lock, ixp2000_slowport_irq_flags);
53
54 old_cfg->CCR = *IXP2000_SLOWPORT_CCR;
55 old_cfg->WTC = *IXP2000_SLOWPORT_WTC2;
56 old_cfg->RTC = *IXP2000_SLOWPORT_RTC2;
57 old_cfg->PCR = *IXP2000_SLOWPORT_PCR;
58 old_cfg->ADC = *IXP2000_SLOWPORT_ADC;
59
60 ixp2000_reg_write(IXP2000_SLOWPORT_CCR, new_cfg->CCR);
61 ixp2000_reg_write(IXP2000_SLOWPORT_WTC2, new_cfg->WTC);
62 ixp2000_reg_write(IXP2000_SLOWPORT_RTC2, new_cfg->RTC);
63 ixp2000_reg_write(IXP2000_SLOWPORT_PCR, new_cfg->PCR);
64 ixp2000_reg_write(IXP2000_SLOWPORT_ADC, new_cfg->ADC);
65}
66
67void ixp2000_release_slowport(struct slowport_cfg *old_cfg)
68{
69 ixp2000_reg_write(IXP2000_SLOWPORT_CCR, old_cfg->CCR);
70 ixp2000_reg_write(IXP2000_SLOWPORT_WTC2, old_cfg->WTC);
71 ixp2000_reg_write(IXP2000_SLOWPORT_RTC2, old_cfg->RTC);
72 ixp2000_reg_write(IXP2000_SLOWPORT_PCR, old_cfg->PCR);
73 ixp2000_reg_write(IXP2000_SLOWPORT_ADC, old_cfg->ADC);
74
75 spin_unlock_irqrestore(&ixp2000_slowport_lock,
76 ixp2000_slowport_irq_flags);
77}
78
79/*************************************************************************
80 * Chip specific mappings shared by all IXP2000 systems
81 *************************************************************************/
82static struct map_desc ixp2000_io_desc[] __initdata = {
83 {
84 .virtual = IXP2000_CAP_VIRT_BASE,
85 .physical = IXP2000_CAP_PHYS_BASE,
86 .length = IXP2000_CAP_SIZE,
87 .type = MT_DEVICE
88 }, {
89 .virtual = IXP2000_INTCTL_VIRT_BASE,
90 .physical = IXP2000_INTCTL_PHYS_BASE,
91 .length = IXP2000_INTCTL_SIZE,
92 .type = MT_DEVICE
93 }, {
94 .virtual = IXP2000_PCI_CREG_VIRT_BASE,
95 .physical = IXP2000_PCI_CREG_PHYS_BASE,
96 .length = IXP2000_PCI_CREG_SIZE,
97 .type = MT_DEVICE
98 }, {
99 .virtual = IXP2000_PCI_CSR_VIRT_BASE,
100 .physical = IXP2000_PCI_CSR_PHYS_BASE,
101 .length = IXP2000_PCI_CSR_SIZE,
102 .type = MT_DEVICE
103 }, {
104 .virtual = IXP2000_PCI_IO_VIRT_BASE,
105 .physical = IXP2000_PCI_IO_PHYS_BASE,
106 .length = IXP2000_PCI_IO_SIZE,
107 .type = MT_DEVICE
108 }, {
109 .virtual = IXP2000_PCI_CFG0_VIRT_BASE,
110 .physical = IXP2000_PCI_CFG0_PHYS_BASE,
111 .length = IXP2000_PCI_CFG0_SIZE,
112 .type = MT_DEVICE
113 }, {
114 .virtual = IXP2000_PCI_CFG1_VIRT_BASE,
115 .physical = IXP2000_PCI_CFG1_PHYS_BASE,
116 .length = IXP2000_PCI_CFG1_SIZE,
117 .type = MT_DEVICE
118 }
119};
120
121static struct uart_port ixp2000_serial_port = {
122 .membase = (char *)(IXP2000_UART_VIRT_BASE + 3),
123 .mapbase = IXP2000_UART_PHYS_BASE + 3,
124 .irq = IRQ_IXP2000_UART,
125 .flags = UPF_SKIP_TEST,
126 .iotype = UPIO_MEM,
127 .regshift = 2,
128 .uartclk = 50000000,
129 .line = 0,
130 .type = PORT_XSCALE,
131 .fifosize = 16
132};
133
134void __init ixp2000_map_io(void)
135{
136 extern unsigned int processor_id;
137
138 /*
139 * On IXP2400 CPUs we need to use MT_IXP2000_DEVICE for
140 * tweaking the PMDs so XCB=101. On IXP2800s we use the normal
141 * PMD flags.
142 */
143 if ((processor_id & 0xfffffff0) == 0x69054190) {
144 int i;
145
146 printk(KERN_INFO "Enabling IXP2400 erratum #66 workaround\n");
147
148 for(i=0;i<ARRAY_SIZE(ixp2000_io_desc);i++)
149 ixp2000_io_desc[i].type = MT_IXP2000_DEVICE;
150 }
151
152 iotable_init(ixp2000_io_desc, ARRAY_SIZE(ixp2000_io_desc));
153 early_serial_setup(&ixp2000_serial_port);
154
155 /* Set slowport to 8-bit mode. */
156 ixp2000_reg_write(IXP2000_SLOWPORT_FRM, 1);
157}
158
159/*************************************************************************
160 * Timer-tick functions for IXP2000
161 *************************************************************************/
162static unsigned ticks_per_jiffy;
163static unsigned ticks_per_usec;
164static unsigned next_jiffy_time;
165
166unsigned long ixp2000_gettimeoffset (void)
167{
168 unsigned long offset;
169
170 offset = next_jiffy_time - *IXP2000_T4_CSR;
171
172 return offset / ticks_per_usec;
173}
174
175static int ixp2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
176{
177 write_seqlock(&xtime_lock);
178
179 /* clear timer 1 */
180 ixp2000_reg_write(IXP2000_T1_CLR, 1);
181
182 while ((next_jiffy_time - *IXP2000_T4_CSR) > ticks_per_jiffy) {
183 timer_tick(regs);
184 next_jiffy_time -= ticks_per_jiffy;
185 }
186
187 write_sequnlock(&xtime_lock);
188
189 return IRQ_HANDLED;
190}
191
192static struct irqaction ixp2000_timer_irq = {
193 .name = "IXP2000 Timer Tick",
194 .flags = SA_INTERRUPT,
195 .handler = ixp2000_timer_interrupt
196};
197
198void __init ixp2000_init_time(unsigned long tick_rate)
199{
200 ixp2000_reg_write(IXP2000_T1_CLR, 0);
201 ixp2000_reg_write(IXP2000_T4_CLR, 0);
202
203 ticks_per_jiffy = (tick_rate + HZ/2) / HZ;
204 ticks_per_usec = tick_rate / 1000000;
205
206 ixp2000_reg_write(IXP2000_T1_CLD, ticks_per_jiffy - 1);
207 ixp2000_reg_write(IXP2000_T1_CTL, (1 << 7));
208
209 /*
210 * We use T4 as a monotonic counter to track missed jiffies
211 */
212 ixp2000_reg_write(IXP2000_T4_CLD, -1);
213 ixp2000_reg_write(IXP2000_T4_CTL, (1 << 7));
214 next_jiffy_time = 0xffffffff;
215
216 /* register for interrupt */
217 setup_irq(IRQ_IXP2000_TIMER1, &ixp2000_timer_irq);
218}
219
220/*************************************************************************
221 * GPIO helpers
222 *************************************************************************/
223static unsigned long GPIO_IRQ_rising_edge;
224static unsigned long GPIO_IRQ_falling_edge;
225static unsigned long GPIO_IRQ_level_low;
226static unsigned long GPIO_IRQ_level_high;
227
228void gpio_line_config(int line, int style)
229{
230 unsigned long flags;
231
232 local_irq_save(flags);
233
234 if(style == GPIO_OUT) {
235 /* if it's an output, it ain't an interrupt anymore */
236 ixp2000_reg_write(IXP2000_GPIO_PDSR, (1 << line));
237 GPIO_IRQ_falling_edge &= ~(1 << line);
238 GPIO_IRQ_rising_edge &= ~(1 << line);
239 GPIO_IRQ_level_low &= ~(1 << line);
240 GPIO_IRQ_level_high &= ~(1 << line);
241 ixp2000_reg_write(IXP2000_GPIO_FEDR, GPIO_IRQ_falling_edge);
242 ixp2000_reg_write(IXP2000_GPIO_REDR, GPIO_IRQ_rising_edge);
243 ixp2000_reg_write(IXP2000_GPIO_LSHR, GPIO_IRQ_level_high);
244 ixp2000_reg_write(IXP2000_GPIO_LSLR, GPIO_IRQ_level_low);
245 irq_desc[line+IRQ_IXP2000_GPIO0].valid = 0;
246 } else if(style == GPIO_IN) {
247 ixp2000_reg_write(IXP2000_GPIO_PDCR, (1 << line));
248 }
249
250 local_irq_restore(flags);
251}
252
253
254/*************************************************************************
255 * IRQ handling IXP2000
256 *************************************************************************/
257static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
258{
259 int i;
260 unsigned long status = *IXP2000_GPIO_INST;
261
262 for (i = 0; i <= 7; i++) {
263 if (status & (1<<i)) {
264 desc = irq_desc + i + IRQ_IXP2000_GPIO0;
265 desc->handle(i + IRQ_IXP2000_GPIO0, desc, regs);
266 }
267 }
268}
269
270static void ixp2000_GPIO_irq_mask_ack(unsigned int irq)
271{
272 ixp2000_reg_write(IXP2000_GPIO_INCR, (1 << (irq - IRQ_IXP2000_GPIO0)));
273 ixp2000_reg_write(IXP2000_GPIO_INST, (1 << (irq - IRQ_IXP2000_GPIO0)));
274}
275
276static void ixp2000_GPIO_irq_mask(unsigned int irq)
277{
278 ixp2000_reg_write(IXP2000_GPIO_INCR, (1 << (irq - IRQ_IXP2000_GPIO0)));
279}
280
281static void ixp2000_GPIO_irq_unmask(unsigned int irq)
282{
283 ixp2000_reg_write(IXP2000_GPIO_INSR, (1 << (irq - IRQ_IXP2000_GPIO0)));
284}
285
286static struct irqchip ixp2000_GPIO_irq_chip = {
287 .ack = ixp2000_GPIO_irq_mask_ack,
288 .mask = ixp2000_GPIO_irq_mask,
289 .unmask = ixp2000_GPIO_irq_unmask
290};
291
292static void ixp2000_pci_irq_mask(unsigned int irq)
293{
294 unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE;
295 if (irq == IRQ_IXP2000_PCIA)
296 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp & ~(1 << 26)));
297 else if (irq == IRQ_IXP2000_PCIB)
298 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp & ~(1 << 27)));
299}
300
301static void ixp2000_pci_irq_unmask(unsigned int irq)
302{
303 unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE;
304 if (irq == IRQ_IXP2000_PCIA)
305 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 26)));
306 else if (irq == IRQ_IXP2000_PCIB)
307 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 27)));
308}
309
310static struct irqchip ixp2000_pci_irq_chip = {
311 .ack = ixp2000_pci_irq_mask,
312 .mask = ixp2000_pci_irq_mask,
313 .unmask = ixp2000_pci_irq_unmask
314};
315
316static void ixp2000_irq_mask(unsigned int irq)
317{
318 ixp2000_reg_write(IXP2000_IRQ_ENABLE_CLR, (1 << irq));
319}
320
321static void ixp2000_irq_unmask(unsigned int irq)
322{
323 ixp2000_reg_write(IXP2000_IRQ_ENABLE_SET, (1 << irq));
324}
325
326static struct irqchip ixp2000_irq_chip = {
327 .ack = ixp2000_irq_mask,
328 .mask = ixp2000_irq_mask,
329 .unmask = ixp2000_irq_unmask
330};
331
332void __init ixp2000_init_irq(void)
333{
334 int irq;
335
336 /*
337 * Mask all sources
338 */
339 ixp2000_reg_write(IXP2000_IRQ_ENABLE_CLR, 0xffffffff);
340 ixp2000_reg_write(IXP2000_FIQ_ENABLE_CLR, 0xffffffff);
341
342 /* clear all GPIO edge/level detects */
343 ixp2000_reg_write(IXP2000_GPIO_REDR, 0);
344 ixp2000_reg_write(IXP2000_GPIO_FEDR, 0);
345 ixp2000_reg_write(IXP2000_GPIO_LSHR, 0);
346 ixp2000_reg_write(IXP2000_GPIO_LSLR, 0);
347 ixp2000_reg_write(IXP2000_GPIO_INCR, -1);
348
349 /* clear PCI interrupt sources */
350 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, 0);
351
352 /*
353 * Certain bits in the IRQ status register of the
354 * IXP2000 are reserved. Instead of trying to map
355 * things non 1:1 from bit position to IRQ number,
356 * we mark the reserved IRQs as invalid. This makes
357 * our mask/unmask code much simpler.
358 */
359 for (irq = IRQ_IXP2000_SOFT_INT; irq <= IRQ_IXP2000_THDB3; irq++) {
360 if((1 << irq) & IXP2000_VALID_IRQ_MASK) {
361 set_irq_chip(irq, &ixp2000_irq_chip);
362 set_irq_handler(irq, do_level_IRQ);
363 set_irq_flags(irq, IRQF_VALID);
364 } else set_irq_flags(irq, 0);
365 }
366
367 /*
368 * GPIO IRQs are invalid until someone sets the interrupt mode
369 * by calling gpio_line_set();
370 */
371 for (irq = IRQ_IXP2000_GPIO0; irq <= IRQ_IXP2000_GPIO7; irq++) {
372 set_irq_chip(irq, &ixp2000_GPIO_irq_chip);
373 set_irq_handler(irq, do_level_IRQ);
374 set_irq_flags(irq, 0);
375 }
376 set_irq_chained_handler(IRQ_IXP2000_GPIO, ixp2000_GPIO_irq_handler);
377
378 /*
379 * Enable PCI irqs. The actual PCI[AB] decoding is done in
380 * entry-macro.S, so we don't need a chained handler for the
381 * PCI interrupt source.
382 */
383 ixp2000_reg_write(IXP2000_IRQ_ENABLE_SET, (1 << IRQ_IXP2000_PCI));
384 for (irq = IRQ_IXP2000_PCIA; irq <= IRQ_IXP2000_PCIB; irq++) {
385 set_irq_chip(irq, &ixp2000_pci_irq_chip);
386 set_irq_handler(irq, do_level_IRQ);
387 set_irq_flags(irq, IRQF_VALID);
388 }
389}
390
diff --git a/arch/arm/mach-ixp2000/enp2611.c b/arch/arm/mach-ixp2000/enp2611.c
new file mode 100644
index 000000000000..04b38bcf9aac
--- /dev/null
+++ b/arch/arm/mach-ixp2000/enp2611.c
@@ -0,0 +1,220 @@
1/*
2 * arch/arm/mach-ixp2000/enp2611.c
3 *
4 * Radisys ENP-2611 support.
5 *
6 * Created 2004 by Lennert Buytenhek from the ixdp2x01 code. The
7 * original version carries the following notices:
8 *
9 * Original Author: Andrzej Mialkowski <andrzej.mialkowski@intel.com>
10 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
11 *
12 * Copyright (C) 2002-2003 Intel Corp.
13 * Copyright (C) 2003-2004 MontaVista Software, Inc.
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 */
20
21#include <linux/config.h>
22#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/mm.h>
25#include <linux/sched.h>
26#include <linux/interrupt.h>
27#include <linux/bitops.h>
28#include <linux/pci.h>
29#include <linux/ioport.h>
30#include <linux/slab.h>
31#include <linux/delay.h>
32#include <linux/serial.h>
33#include <linux/tty.h>
34#include <linux/serial_core.h>
35#include <linux/device.h>
36
37#include <asm/io.h>
38#include <asm/irq.h>
39#include <asm/pgtable.h>
40#include <asm/page.h>
41#include <asm/system.h>
42#include <asm/hardware.h>
43#include <asm/mach-types.h>
44
45#include <asm/mach/pci.h>
46#include <asm/mach/map.h>
47#include <asm/mach/irq.h>
48#include <asm/mach/time.h>
49#include <asm/mach/arch.h>
50#include <asm/mach/flash.h>
51
52/*************************************************************************
53 * ENP-2611 timer tick configuration
54 *************************************************************************/
55static void __init enp2611_timer_init(void)
56{
57 ixp2000_init_time(50 * 1000 * 1000);
58}
59
60static struct sys_timer enp2611_timer = {
61 .init = enp2611_timer_init,
62 .offset = ixp2000_gettimeoffset,
63};
64
65
66/*************************************************************************
67 * ENP-2611 PCI
68 *************************************************************************/
69static int enp2611_pci_setup(int nr, struct pci_sys_data *sys)
70{
71 sys->mem_offset = 0xe0000000;
72 ixp2000_pci_setup(nr, sys);
73 return 1;
74}
75
76static void __init enp2611_pci_preinit(void)
77{
78 ixp2000_reg_write(IXP2000_PCI_ADDR_EXT, 0x00100000);
79 ixp2000_pci_preinit();
80}
81
82static inline int enp2611_pci_valid_device(struct pci_bus *bus,
83 unsigned int devfn)
84{
85 /* The 82559 ethernet controller appears at both PCI:1:0:0 and
86 * PCI:1:2:0, so let's pretend the second one isn't there.
87 */
88 if (bus->number == 0x01 && devfn == 0x10)
89 return 0;
90
91 return 1;
92}
93
94static int enp2611_pci_read_config(struct pci_bus *bus, unsigned int devfn,
95 int where, int size, u32 *value)
96{
97 if (enp2611_pci_valid_device(bus, devfn))
98 return ixp2000_pci_read_config(bus, devfn, where, size, value);
99
100 return PCIBIOS_DEVICE_NOT_FOUND;
101}
102
103static int enp2611_pci_write_config(struct pci_bus *bus, unsigned int devfn,
104 int where, int size, u32 value)
105{
106 if (enp2611_pci_valid_device(bus, devfn))
107 return ixp2000_pci_write_config(bus, devfn, where, size, value);
108
109 return PCIBIOS_DEVICE_NOT_FOUND;
110}
111
112static struct pci_ops enp2611_pci_ops = {
113 .read = enp2611_pci_read_config,
114 .write = enp2611_pci_write_config
115};
116
117static struct pci_bus * __init enp2611_pci_scan_bus(int nr,
118 struct pci_sys_data *sys)
119{
120 return pci_scan_bus(sys->busnr, &enp2611_pci_ops, sys);
121}
122
123static int __init enp2611_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
124{
125 int irq;
126
127 if (dev->bus->number == 0 && PCI_SLOT(dev->devfn) == 0) {
128 /* IXP2400. */
129 irq = IRQ_IXP2000_PCIA;
130 } else if (dev->bus->number == 0 && PCI_SLOT(dev->devfn) == 1) {
131 /* 21555 non-transparent bridge. */
132 irq = IRQ_IXP2000_PCIB;
133 } else if (dev->bus->number == 0 && PCI_SLOT(dev->devfn) == 4) {
134 /* PCI2050B transparent bridge. */
135 irq = -1;
136 } else if (dev->bus->number == 1 && PCI_SLOT(dev->devfn) == 0) {
137 /* 82559 ethernet. */
138 irq = IRQ_IXP2000_PCIA;
139 } else if (dev->bus->number == 1 && PCI_SLOT(dev->devfn) == 1) {
140 /* SPI-3 option board. */
141 irq = IRQ_IXP2000_PCIB;
142 } else {
143 printk(KERN_ERR "enp2611_pci_map_irq() called for unknown "
144 "device PCI:%d:%d:%d\n", dev->bus->number,
145 PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
146 irq = -1;
147 }
148
149 return irq;
150}
151
152struct hw_pci enp2611_pci __initdata = {
153 .nr_controllers = 1,
154 .setup = enp2611_pci_setup,
155 .preinit = enp2611_pci_preinit,
156 .scan = enp2611_pci_scan_bus,
157 .map_irq = enp2611_pci_map_irq,
158};
159
160int __init enp2611_pci_init(void)
161{
162 if (machine_is_enp2611())
163 pci_common_init(&enp2611_pci);
164
165 return 0;
166}
167
168subsys_initcall(enp2611_pci_init);
169
170
171/*************************************************************************
172 * ENP-2611 Machine Intialization
173 *************************************************************************/
174static struct flash_platform_data enp2611_flash_platform_data = {
175 .map_name = "cfi_probe",
176 .width = 1,
177};
178
179static struct ixp2000_flash_data enp2611_flash_data = {
180 .platform_data = &enp2611_flash_platform_data,
181 .nr_banks = 1
182};
183
184static struct resource enp2611_flash_resource = {
185 .start = 0xc4000000,
186 .end = 0xc4000000 + 0x00ffffff,
187 .flags = IORESOURCE_MEM,
188};
189
190static struct platform_device enp2611_flash = {
191 .name = "IXP2000-Flash",
192 .id = 0,
193 .dev = {
194 .platform_data = &enp2611_flash_data,
195 },
196 .num_resources = 1,
197 .resource = &enp2611_flash_resource,
198};
199
200static struct platform_device *enp2611_devices[] __initdata = {
201 &enp2611_flash
202};
203
204static void __init enp2611_init_machine(void)
205{
206 platform_add_devices(enp2611_devices, ARRAY_SIZE(enp2611_devices));
207}
208
209
210MACHINE_START(ENP2611, "Radisys ENP-2611 PCI network processor board")
211 MAINTAINER("Lennert Buytenhek <buytenh@wantstofly.org>")
212 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE)
213 BOOT_PARAMS(0x00000100)
214 MAPIO(ixp2000_map_io)
215 INITIRQ(ixp2000_init_irq)
216 .timer = &enp2611_timer,
217 INIT_MACHINE(enp2611_init_machine)
218MACHINE_END
219
220
diff --git a/arch/arm/mach-ixp2000/ixdp2400.c b/arch/arm/mach-ixp2000/ixdp2400.c
new file mode 100644
index 000000000000..df3ff26c8cdd
--- /dev/null
+++ b/arch/arm/mach-ixp2000/ixdp2400.c
@@ -0,0 +1,179 @@
1/*
2 * arch/arm/mach-ixp2000/ixdp2400.c
3 *
4 * IXDP2400 platform support
5 *
6 * Original Author: Naeem Afzal <naeem.m.afzal@intel.com>
7 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
8 *
9 * Copyright (C) 2002 Intel Corp.
10 * Copyright (C) 2003-2004 MontaVista Software, Inc.
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#include <linux/config.h>
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/mm.h>
21#include <linux/sched.h>
22#include <linux/interrupt.h>
23#include <linux/device.h>
24#include <linux/bitops.h>
25#include <linux/pci.h>
26#include <linux/ioport.h>
27#include <linux/slab.h>
28#include <linux/delay.h>
29
30#include <asm/io.h>
31#include <asm/irq.h>
32#include <asm/pgtable.h>
33#include <asm/page.h>
34#include <asm/system.h>
35#include <asm/hardware.h>
36#include <asm/mach-types.h>
37
38#include <asm/mach/pci.h>
39#include <asm/mach/map.h>
40#include <asm/mach/irq.h>
41#include <asm/mach/time.h>
42#include <asm/mach/flash.h>
43#include <asm/mach/arch.h>
44
45/*************************************************************************
46 * IXDP2400 timer tick
47 *************************************************************************/
48static void __init ixdp2400_timer_init(void)
49{
50 int numerator, denominator;
51 int denom_array[] = {2, 4, 8, 16, 1, 2, 4, 8};
52
53 numerator = (*(IXDP2400_CPLD_SYS_CLK_M) & 0xFF) *2;
54 denominator = denom_array[(*(IXDP2400_CPLD_SYS_CLK_N) & 0x7)];
55
56 ixp2000_init_time(((3125000 * numerator) / (denominator)) / 2);
57}
58
59static struct sys_timer ixdp2400_timer = {
60 .init = ixdp2400_timer_init,
61 .offset = ixp2000_gettimeoffset,
62};
63
64/*************************************************************************
65 * IXDP2400 PCI
66 *************************************************************************/
67void __init ixdp2400_pci_preinit(void)
68{
69 ixp2000_reg_write(IXP2000_PCI_ADDR_EXT, 0x00100000);
70 ixp2000_pci_preinit();
71}
72
73int ixdp2400_pci_setup(int nr, struct pci_sys_data *sys)
74{
75 sys->mem_offset = 0xe0000000;
76
77 ixp2000_pci_setup(nr, sys);
78
79 return 1;
80}
81
82static int __init ixdp2400_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
83{
84 if (ixdp2x00_master_npu()) {
85
86 /*
87 * Root bus devices. Slave NPU is only one with interrupt.
88 * Everything else, we just return -1 b/c nothing else
89 * on the root bus has interrupts.
90 */
91 if(!dev->bus->self) {
92 if(dev->devfn == IXDP2X00_SLAVE_NPU_DEVFN )
93 return IRQ_IXDP2400_INGRESS_NPU;
94
95 return -1;
96 }
97
98 /*
99 * Bridge behind the PMC slot.
100 * NOTE: Only INTA from the PMC slot is routed. VERY BAD.
101 */
102 if(dev->bus->self->devfn == IXDP2X00_PMC_DEVFN &&
103 dev->bus->parent->self->devfn == IXDP2X00_P2P_DEVFN &&
104 !dev->bus->parent->self->bus->parent)
105 return IRQ_IXDP2400_PMC;
106
107 /*
108 * Device behind the first bridge
109 */
110 if(dev->bus->self->devfn == IXDP2X00_P2P_DEVFN) {
111 switch(dev->devfn) {
112 case IXDP2400_MASTER_ENET_DEVFN:
113 return IRQ_IXDP2400_ENET;
114
115 case IXDP2400_MEDIA_DEVFN:
116 return IRQ_IXDP2400_MEDIA_PCI;
117
118 case IXDP2400_SWITCH_FABRIC_DEVFN:
119 return IRQ_IXDP2400_SF_PCI;
120
121 case IXDP2X00_PMC_DEVFN:
122 return IRQ_IXDP2400_PMC;
123 }
124 }
125
126 return -1;
127 } else return IRQ_IXP2000_PCIB; /* Slave NIC interrupt */
128}
129
130
131static void ixdp2400_pci_postinit(void)
132{
133 struct pci_dev *dev;
134
135 if (ixdp2x00_master_npu()) {
136 dev = pci_find_slot(1, IXDP2400_SLAVE_ENET_DEVFN);
137 pci_remove_bus_device(dev);
138 } else {
139 dev = pci_find_slot(1, IXDP2400_MASTER_ENET_DEVFN);
140 pci_remove_bus_device(dev);
141
142 ixdp2x00_slave_pci_postinit();
143 }
144}
145
146static struct hw_pci ixdp2400_pci __initdata = {
147 .nr_controllers = 1,
148 .setup = ixdp2400_pci_setup,
149 .preinit = ixdp2400_pci_preinit,
150 .postinit = ixdp2400_pci_postinit,
151 .scan = ixp2000_pci_scan_bus,
152 .map_irq = ixdp2400_pci_map_irq,
153};
154
155int __init ixdp2400_pci_init(void)
156{
157 if (machine_is_ixdp2400())
158 pci_common_init(&ixdp2400_pci);
159
160 return 0;
161}
162
163subsys_initcall(ixdp2400_pci_init);
164
165void ixdp2400_init_irq(void)
166{
167 ixdp2x00_init_irq(IXDP2400_CPLD_INT_STAT, IXDP2400_CPLD_INT_MASK, IXDP2400_NR_IRQS);
168}
169
170MACHINE_START(IXDP2400, "Intel IXDP2400 Development Platform")
171 MAINTAINER("MontaVista Software, Inc.")
172 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE)
173 BOOT_PARAMS(0x00000100)
174 MAPIO(ixdp2x00_map_io)
175 INITIRQ(ixdp2400_init_irq)
176 .timer = &ixdp2400_timer,
177 INIT_MACHINE(ixdp2x00_init_machine)
178MACHINE_END
179
diff --git a/arch/arm/mach-ixp2000/ixdp2800.c b/arch/arm/mach-ixp2000/ixdp2800.c
new file mode 100644
index 000000000000..c4683aaff84a
--- /dev/null
+++ b/arch/arm/mach-ixp2000/ixdp2800.c
@@ -0,0 +1,180 @@
1/*
2 * arch/arm/mach-ixp2000/ixdp2800.c
3 *
4 * IXDP2800 platform support
5 *
6 * Original Author: Jeffrey Daly <jeffrey.daly@intel.com>
7 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
8 *
9 * Copyright (C) 2002 Intel Corp.
10 * Copyright (C) 2003-2004 MontaVista Software, Inc.
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#include <linux/config.h>
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/mm.h>
21#include <linux/sched.h>
22#include <linux/interrupt.h>
23#include <linux/device.h>
24#include <linux/bitops.h>
25#include <linux/pci.h>
26#include <linux/ioport.h>
27#include <linux/slab.h>
28#include <linux/delay.h>
29
30#include <asm/io.h>
31#include <asm/irq.h>
32#include <asm/pgtable.h>
33#include <asm/page.h>
34#include <asm/system.h>
35#include <asm/hardware.h>
36#include <asm/mach-types.h>
37
38#include <asm/mach/pci.h>
39#include <asm/mach/map.h>
40#include <asm/mach/irq.h>
41#include <asm/mach/time.h>
42#include <asm/mach/flash.h>
43#include <asm/mach/arch.h>
44
45
46void ixdp2400_init_irq(void)
47{
48 ixdp2x00_init_irq(IXDP2800_CPLD_INT_STAT, IXDP2800_CPLD_INT_MASK, IXDP2400_NR_IRQS);
49}
50
51/*************************************************************************
52 * IXDP2800 timer tick
53 *************************************************************************/
54
55static void __init ixdp2800_timer_init(void)
56{
57 ixp2000_init_time(50000000);
58}
59
60static struct sys_timer ixdp2800_timer = {
61 .init = ixdp2800_timer_init,
62 .offset = ixp2000_gettimeoffset,
63};
64
65/*************************************************************************
66 * IXDP2800 PCI
67 *************************************************************************/
68void __init ixdp2800_pci_preinit(void)
69{
70 printk("ixdp2x00_pci_preinit called\n");
71
72 *IXP2000_PCI_ADDR_EXT = 0x0000e000;
73
74 *IXP2000_PCI_DRAM_BASE_ADDR_MASK = (0x40000000 - 1) & ~0xfffff;
75 *IXP2000_PCI_SRAM_BASE_ADDR_MASK = (0x2000000 - 1) & ~0x3ffff;
76
77 ixp2000_pci_preinit();
78}
79
80int ixdp2800_pci_setup(int nr, struct pci_sys_data *sys)
81{
82 sys->mem_offset = 0x00000000;
83
84 ixp2000_pci_setup(nr, sys);
85
86 return 1;
87}
88
89static int __init ixdp2800_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
90{
91 if (ixdp2x00_master_npu()) {
92
93 /*
94 * Root bus devices. Slave NPU is only one with interrupt.
95 * Everything else, we just return -1 which is invalid.
96 */
97 if(!dev->bus->self) {
98 if(dev->devfn == IXDP2X00_SLAVE_NPU_DEVFN )
99 return IRQ_IXDP2800_INGRESS_NPU;
100
101 return -1;
102 }
103
104 /*
105 * Bridge behind the PMC slot.
106 */
107 if(dev->bus->self->devfn == IXDP2X00_PMC_DEVFN &&
108 dev->bus->parent->self->devfn == IXDP2X00_P2P_DEVFN &&
109 !dev->bus->parent->self->bus->parent)
110 return IRQ_IXDP2800_PMC;
111
112 /*
113 * Device behind the first bridge
114 */
115 if(dev->bus->self->devfn == IXDP2X00_P2P_DEVFN) {
116 switch(dev->devfn) {
117 case IXDP2X00_PMC_DEVFN:
118 return IRQ_IXDP2800_PMC;
119
120 case IXDP2800_MASTER_ENET_DEVFN:
121 return IRQ_IXDP2800_EGRESS_ENET;
122
123 case IXDP2800_SWITCH_FABRIC_DEVFN:
124 return IRQ_IXDP2800_FABRIC;
125 }
126 }
127
128 return -1;
129 } else return IRQ_IXP2000_PCIB; /* Slave NIC interrupt */
130}
131
132static void ixdp2800_pci_postinit(void)
133{
134 struct pci_dev *dev;
135
136 if (ixdp2x00_master_npu()) {
137 dev = pci_find_slot(1, IXDP2800_SLAVE_ENET_DEVFN);
138 pci_remove_bus_device(dev);
139 } else {
140 dev = pci_find_slot(1, IXDP2800_MASTER_ENET_DEVFN);
141 pci_remove_bus_device(dev);
142
143 ixdp2x00_slave_pci_postinit();
144 }
145}
146
147struct hw_pci ixdp2800_pci __initdata = {
148 .nr_controllers = 1,
149 .setup = ixdp2800_pci_setup,
150 .preinit = ixdp2800_pci_preinit,
151 .postinit = ixdp2800_pci_postinit,
152 .scan = ixp2000_pci_scan_bus,
153 .map_irq = ixdp2800_pci_map_irq,
154};
155
156int __init ixdp2800_pci_init(void)
157{
158 if (machine_is_ixdp2800())
159 pci_common_init(&ixdp2800_pci);
160
161 return 0;
162}
163
164subsys_initcall(ixdp2800_pci_init);
165
166void ixdp2800_init_irq(void)
167{
168 ixdp2x00_init_irq(IXDP2800_CPLD_INT_STAT, IXDP2800_CPLD_INT_MASK, IXDP2800_NR_IRQS);
169}
170
171MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform")
172 MAINTAINER("MontaVista Software, Inc.")
173 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE)
174 BOOT_PARAMS(0x00000100)
175 MAPIO(ixdp2x00_map_io)
176 INITIRQ(ixdp2800_init_irq)
177 .timer = &ixdp2800_timer,
178 INIT_MACHINE(ixdp2x00_init_machine)
179MACHINE_END
180
diff --git a/arch/arm/mach-ixp2000/ixdp2x00.c b/arch/arm/mach-ixp2000/ixdp2x00.c
new file mode 100644
index 000000000000..21c41fe15b99
--- /dev/null
+++ b/arch/arm/mach-ixp2000/ixdp2x00.c
@@ -0,0 +1,304 @@
1/*
2 * arch/arm/mach-ixp2000/ixdp2x00.c
3 *
4 * Code common to IXDP2400 and IXDP2800 platforms.
5 *
6 * Original Author: Naeem Afzal <naeem.m.afzal@intel.com>
7 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
8 *
9 * Copyright (C) 2002 Intel Corp.
10 * Copyright (C) 2003-2004 MontaVista Software, Inc.
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#include <linux/config.h>
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/mm.h>
21#include <linux/sched.h>
22#include <linux/interrupt.h>
23#include <linux/device.h>
24#include <linux/bitops.h>
25#include <linux/pci.h>
26#include <linux/ioport.h>
27#include <linux/slab.h>
28#include <linux/delay.h>
29
30#include <asm/io.h>
31#include <asm/irq.h>
32#include <asm/pgtable.h>
33#include <asm/page.h>
34#include <asm/system.h>
35#include <asm/hardware.h>
36#include <asm/mach-types.h>
37
38#include <asm/mach/pci.h>
39#include <asm/mach/map.h>
40#include <asm/mach/irq.h>
41#include <asm/mach/time.h>
42#include <asm/mach/flash.h>
43#include <asm/mach/arch.h>
44
45/*************************************************************************
46 * IXDP2x00 IRQ Initialization
47 *************************************************************************/
48static volatile unsigned long *board_irq_mask;
49static volatile unsigned long *board_irq_stat;
50static unsigned long board_irq_count;
51
52#ifdef CONFIG_ARCH_IXDP2400
53/*
54 * Slowport configuration for accessing CPLD registers on IXDP2x00
55 */
56static struct slowport_cfg slowport_cpld_cfg = {
57 .CCR = SLOWPORT_CCR_DIV_2,
58 .WTC = 0x00000070,
59 .RTC = 0x00000070,
60 .PCR = SLOWPORT_MODE_FLASH,
61 .ADC = SLOWPORT_ADDR_WIDTH_24 | SLOWPORT_DATA_WIDTH_8
62};
63#endif
64
65static void ixdp2x00_irq_mask(unsigned int irq)
66{
67 unsigned long dummy;
68 static struct slowport_cfg old_cfg;
69
70 /*
71 * This is ugly in common code but really don't know
72 * of a better way to handle it. :(
73 */
74#ifdef CONFIG_ARCH_IXDP2400
75 if (machine_is_ixdp2400())
76 ixp2000_acquire_slowport(&slowport_cpld_cfg, &old_cfg);
77#endif
78
79 dummy = *board_irq_mask;
80 dummy |= IXP2000_BOARD_IRQ_MASK(irq);
81 ixp2000_reg_write(board_irq_mask, dummy);
82
83#ifdef CONFIG_ARCH_IXDP2400
84 if (machine_is_ixdp2400())
85 ixp2000_release_slowport(&old_cfg);
86#endif
87}
88
89static void ixdp2x00_irq_unmask(unsigned int irq)
90{
91 unsigned long dummy;
92 static struct slowport_cfg old_cfg;
93
94#ifdef CONFIG_ARCH_IXDP2400
95 if (machine_is_ixdp2400())
96 ixp2000_acquire_slowport(&slowport_cpld_cfg, &old_cfg);
97#endif
98
99 dummy = *board_irq_mask;
100 dummy &= ~IXP2000_BOARD_IRQ_MASK(irq);
101 ixp2000_reg_write(board_irq_mask, dummy);
102
103 if (machine_is_ixdp2400())
104 ixp2000_release_slowport(&old_cfg);
105}
106
107static void ixdp2x00_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
108{
109 volatile u32 ex_interrupt = 0;
110 static struct slowport_cfg old_cfg;
111 int i;
112
113 desc->chip->mask(irq);
114
115#ifdef CONFIG_ARCH_IXDP2400
116 if (machine_is_ixdp2400())
117 ixp2000_acquire_slowport(&slowport_cpld_cfg, &old_cfg);
118#endif
119 ex_interrupt = *board_irq_stat & 0xff;
120 if (machine_is_ixdp2400())
121 ixp2000_release_slowport(&old_cfg);
122
123 if(!ex_interrupt) {
124 printk(KERN_ERR "Spurious IXDP2x00 CPLD interrupt!\n");
125 return;
126 }
127
128 for(i = 0; i < board_irq_count; i++) {
129 if(ex_interrupt & (1 << i)) {
130 struct irqdesc *cpld_desc;
131 int cpld_irq = IXP2000_BOARD_IRQ(0) + i;
132 cpld_desc = irq_desc + cpld_irq;
133 cpld_desc->handle(cpld_irq, cpld_desc, regs);
134 }
135 }
136
137 desc->chip->unmask(irq);
138}
139
140static struct irqchip ixdp2x00_cpld_irq_chip = {
141 .ack = ixdp2x00_irq_mask,
142 .mask = ixdp2x00_irq_mask,
143 .unmask = ixdp2x00_irq_unmask
144};
145
146void ixdp2x00_init_irq(volatile unsigned long *stat_reg, volatile unsigned long *mask_reg, unsigned long nr_irqs)
147{
148 unsigned int irq;
149
150 ixp2000_init_irq();
151
152 if (!ixdp2x00_master_npu())
153 return;
154
155 board_irq_stat = stat_reg;
156 board_irq_mask = mask_reg;
157 board_irq_count = nr_irqs;
158
159 *board_irq_mask = 0xffffffff;
160
161 for(irq = IXP2000_BOARD_IRQ(0); irq < IXP2000_BOARD_IRQ(board_irq_count); irq++) {
162 set_irq_chip(irq, &ixdp2x00_cpld_irq_chip);
163 set_irq_handler(irq, do_level_IRQ);
164 set_irq_flags(irq, IRQF_VALID);
165 }
166
167 /* Hook into PCI interrupt */
168 set_irq_chained_handler(IRQ_IXP2000_PCIB, &ixdp2x00_irq_handler);
169}
170
171/*************************************************************************
172 * IXDP2x00 memory map
173 *************************************************************************/
174static struct map_desc ixdp2x00_io_desc __initdata = {
175 .virtual = IXDP2X00_VIRT_CPLD_BASE,
176 .physical = IXDP2X00_PHYS_CPLD_BASE,
177 .length = IXDP2X00_CPLD_SIZE,
178 .type = MT_DEVICE
179};
180
181void __init ixdp2x00_map_io(void)
182{
183 ixp2000_map_io();
184
185 iotable_init(&ixdp2x00_io_desc, 1);
186}
187
188/*************************************************************************
189 * IXDP2x00-common PCI init
190 *
191 * The IXDP2[48]00 has a horrid PCI bus layout. Basically the board
192 * contains two NPUs (ingress and egress) connected over PCI, both running
193 * instances of the kernel. So far so good. Peers on the PCI bus running
194 * Linux is a common design in telecom systems. The problem is that instead
195 * of all the devices being controlled by a single host, different
196 * devices are controlles by different NPUs on the same bus, leading to
197 * multiple hosts on the bus. The exact bus layout looks like:
198 *
199 * Bus 0
200 * Master NPU <-------------------+-------------------> Slave NPU
201 * |
202 * |
203 * P2P
204 * |
205 *
206 * Bus 1 |
207 * <--+------+---------+---------+------+-->
208 * | | | | |
209 * | | | | |
210 * ... Dev PMC Media Eth0 Eth1 ...
211 *
212 * The master controlls all but Eth1, which is controlled by the
213 * slave. What this means is that the both the master and the slave
214 * have to scan the bus, but only one of them can enumerate the bus.
215 * In addition, after the bus is scanned, each kernel must remove
216 * the device(s) it does not control from the PCI dev list otherwise
217 * a driver on each NPU will try to manage it and we will have horrible
218 * conflicts. Oh..and the slave NPU needs to see the master NPU
219 * for Intel's drivers to work properly. Closed source drivers...
220 *
221 * The way we deal with this is fairly simple but ugly:
222 *
223 * 1) Let master scan and enumerate the bus completely.
224 * 2) Master deletes Eth1 from device list.
225 * 3) Slave scans bus and then deletes all but Eth1 (Eth0 on slave)
226 * from device list.
227 * 4) Find HW designers and LART them.
228 *
229 * The boards also do not do normal PCI IRQ routing, or any sort of
230 * sensical swizzling, so we just need to check where on the bus a
231 * device sits and figure out to which CPLD pin the interrupt is routed.
232 * See ixdp2[48]00.c files.
233 *
234 *************************************************************************/
235void ixdp2x00_slave_pci_postinit(void)
236{
237 struct pci_dev *dev;
238
239 /*
240 * Remove PMC device is there is one
241 */
242 if((dev = pci_find_slot(1, IXDP2X00_PMC_DEVFN)))
243 pci_remove_bus_device(dev);
244
245 dev = pci_find_slot(0, IXDP2X00_21555_DEVFN);
246 pci_remove_bus_device(dev);
247}
248
249/**************************************************************************
250 * IXDP2x00 Machine Setup
251 *************************************************************************/
252static struct flash_platform_data ixdp2x00_platform_data = {
253 .map_name = "cfi_probe",
254 .width = 1,
255};
256
257static struct ixp2000_flash_data ixdp2x00_flash_data = {
258 .platform_data = &ixdp2x00_platform_data,
259 .nr_banks = 1
260};
261
262static struct resource ixdp2x00_flash_resource = {
263 .start = 0xc4000000,
264 .end = 0xc4000000 + 0x00ffffff,
265 .flags = IORESOURCE_MEM,
266};
267
268static struct platform_device ixdp2x00_flash = {
269 .name = "IXP2000-Flash",
270 .id = 0,
271 .dev = {
272 .platform_data = &ixdp2x00_flash_data,
273 },
274 .num_resources = 1,
275 .resource = &ixdp2x00_flash_resource,
276};
277
278static struct ixp2000_i2c_pins ixdp2x00_i2c_gpio_pins = {
279 .sda_pin = IXDP2X00_GPIO_SDA,
280 .scl_pin = IXDP2X00_GPIO_SCL,
281};
282
283static struct platform_device ixdp2x00_i2c_controller = {
284 .name = "IXP2000-I2C",
285 .id = 0,
286 .dev = {
287 .platform_data = &ixdp2x00_i2c_gpio_pins,
288 },
289 .num_resources = 0
290};
291
292static struct platform_device *ixdp2x00_devices[] __initdata = {
293 &ixdp2x00_flash,
294 &ixdp2x00_i2c_controller
295};
296
297void __init ixdp2x00_init_machine(void)
298{
299 gpio_line_set(IXDP2X00_GPIO_I2C_ENABLE, 1);
300 gpio_line_config(IXDP2X00_GPIO_I2C_ENABLE, GPIO_OUT);
301
302 platform_add_devices(ixdp2x00_devices, ARRAY_SIZE(ixdp2x00_devices));
303}
304
diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c
new file mode 100644
index 000000000000..e94dace3d412
--- /dev/null
+++ b/arch/arm/mach-ixp2000/ixdp2x01.c
@@ -0,0 +1,400 @@
1/*
2 * arch/arm/mach-ixp2000/ixdp2x01.c
3 *
4 * Code common to Intel IXDP2401 and IXDP2801 platforms
5 *
6 * Original Author: Andrzej Mialkowski <andrzej.mialkowski@intel.com>
7 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
8 *
9 * Copyright (C) 2002-2003 Intel Corp.
10 * Copyright (C) 2003-2004 MontaVista Software, Inc.
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
18#include <linux/config.h>
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/mm.h>
22#include <linux/sched.h>
23#include <linux/interrupt.h>
24#include <linux/bitops.h>
25#include <linux/pci.h>
26#include <linux/ioport.h>
27#include <linux/slab.h>
28#include <linux/delay.h>
29#include <linux/serial.h>
30#include <linux/tty.h>
31#include <linux/serial_core.h>
32#include <linux/device.h>
33
34#include <asm/io.h>
35#include <asm/irq.h>
36#include <asm/pgtable.h>
37#include <asm/page.h>
38#include <asm/system.h>
39#include <asm/hardware.h>
40#include <asm/mach-types.h>
41
42#include <asm/mach/pci.h>
43#include <asm/mach/map.h>
44#include <asm/mach/irq.h>
45#include <asm/mach/time.h>
46#include <asm/mach/arch.h>
47#include <asm/mach/flash.h>
48
49/*************************************************************************
50 * IXDP2x01 IRQ Handling
51 *************************************************************************/
52static void ixdp2x01_irq_mask(unsigned int irq)
53{
54 ixp2000_reg_write(IXDP2X01_INT_MASK_SET_REG,
55 IXP2000_BOARD_IRQ_MASK(irq));
56}
57
58static void ixdp2x01_irq_unmask(unsigned int irq)
59{
60 ixp2000_reg_write(IXDP2X01_INT_MASK_CLR_REG,
61 IXP2000_BOARD_IRQ_MASK(irq));
62}
63
64static u32 valid_irq_mask;
65
66static void ixdp2x01_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
67{
68 u32 ex_interrupt;
69 int i;
70
71 desc->chip->mask(irq);
72
73 ex_interrupt = *IXDP2X01_INT_STAT_REG & valid_irq_mask;
74
75 if (!ex_interrupt) {
76 printk(KERN_ERR "Spurious IXDP2X01 CPLD interrupt!\n");
77 return;
78 }
79
80 for (i = 0; i < IXP2000_BOARD_IRQS; i++) {
81 if (ex_interrupt & (1 << i)) {
82 struct irqdesc *cpld_desc;
83 int cpld_irq = IXP2000_BOARD_IRQ(0) + i;
84 cpld_desc = irq_desc + cpld_irq;
85 cpld_desc->handle(cpld_irq, cpld_desc, regs);
86 }
87 }
88
89 desc->chip->unmask(irq);
90}
91
92static struct irqchip ixdp2x01_irq_chip = {
93 .mask = ixdp2x01_irq_mask,
94 .ack = ixdp2x01_irq_mask,
95 .unmask = ixdp2x01_irq_unmask
96};
97
98/*
99 * We only do anything if we are the master NPU on the board.
100 * The slave NPU only has the ethernet chip going directly to
101 * the PCIB interrupt input.
102 */
103void __init ixdp2x01_init_irq(void)
104{
105 int irq = 0;
106
107 /* initialize chip specific interrupts */
108 ixp2000_init_irq();
109
110 if (machine_is_ixdp2401())
111 valid_irq_mask = IXDP2401_VALID_IRQ_MASK;
112 else
113 valid_irq_mask = IXDP2801_VALID_IRQ_MASK;
114
115 /* Mask all interrupts from CPLD, disable simulation */
116 ixp2000_reg_write(IXDP2X01_INT_MASK_SET_REG, 0xffffffff);
117 ixp2000_reg_write(IXDP2X01_INT_SIM_REG, 0);
118
119 for (irq = NR_IXP2000_IRQS; irq < NR_IXDP2X01_IRQS; irq++) {
120 if (irq & valid_irq_mask) {
121 set_irq_chip(irq, &ixdp2x01_irq_chip);
122 set_irq_handler(irq, do_level_IRQ);
123 set_irq_flags(irq, IRQF_VALID);
124 } else {
125 set_irq_flags(irq, 0);
126 }
127 }
128
129 /* Hook into PCI interrupts */
130 set_irq_chained_handler(IRQ_IXP2000_PCIB, &ixdp2x01_irq_handler);
131}
132
133
134/*************************************************************************
135 * IXDP2x01 memory map and serial ports
136 *************************************************************************/
137static struct map_desc ixdp2x01_io_desc __initdata = {
138 .virtual = IXDP2X01_VIRT_CPLD_BASE,
139 .physical = IXDP2X01_PHYS_CPLD_BASE,
140 .length = IXDP2X01_CPLD_REGION_SIZE,
141 .type = MT_DEVICE
142};
143
144static struct uart_port ixdp2x01_serial_ports[2] = {
145 {
146 .membase = (char *)(IXDP2X01_UART1_VIRT_BASE),
147 .mapbase = (unsigned long)IXDP2X01_UART1_PHYS_BASE,
148 .irq = IRQ_IXDP2X01_UART1,
149 .flags = UPF_SKIP_TEST,
150 .iotype = UPIO_MEM32,
151 .regshift = 2,
152 .uartclk = IXDP2X01_UART_CLK,
153 .line = 1,
154 .type = PORT_16550A,
155 .fifosize = 16
156 }, {
157 .membase = (char *)(IXDP2X01_UART2_VIRT_BASE),
158 .mapbase = (unsigned long)IXDP2X01_UART2_PHYS_BASE,
159 .irq = IRQ_IXDP2X01_UART2,
160 .flags = UPF_SKIP_TEST,
161 .iotype = UPIO_MEM32,
162 .regshift = 2,
163 .uartclk = IXDP2X01_UART_CLK,
164 .line = 2,
165 .type = PORT_16550A,
166 .fifosize = 16
167 },
168};
169
170static void __init ixdp2x01_map_io(void)
171{
172 ixp2000_map_io();
173
174 iotable_init(&ixdp2x01_io_desc, 1);
175
176 early_serial_setup(&ixdp2x01_serial_ports[0]);
177 early_serial_setup(&ixdp2x01_serial_ports[1]);
178}
179
180
181/*************************************************************************
182 * IXDP2x01 timer tick configuration
183 *************************************************************************/
184static unsigned int ixdp2x01_clock;
185
186static int __init ixdp2x01_clock_setup(char *str)
187{
188 ixdp2x01_clock = simple_strtoul(str, NULL, 10);
189
190 return 1;
191}
192
193__setup("ixdp2x01_clock=", ixdp2x01_clock_setup);
194
195static void __init ixdp2x01_timer_init(void)
196{
197 if (!ixdp2x01_clock)
198 ixdp2x01_clock = 50000000;
199
200 ixp2000_init_time(ixdp2x01_clock);
201}
202
203static struct sys_timer ixdp2x01_timer = {
204 .init = ixdp2x01_timer_init,
205 .offset = ixp2000_gettimeoffset,
206};
207
208/*************************************************************************
209 * IXDP2x01 PCI
210 *************************************************************************/
211void __init ixdp2x01_pci_preinit(void)
212{
213 ixp2000_reg_write(IXP2000_PCI_ADDR_EXT, 0x00000000);
214 ixp2000_pci_preinit();
215}
216
217#define DEVPIN(dev, pin) ((pin) | ((dev) << 3))
218
219static int __init ixdp2x01_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
220{
221 u8 bus = dev->bus->number;
222 u32 devpin = DEVPIN(PCI_SLOT(dev->devfn), pin);
223 struct pci_bus *tmp_bus = dev->bus;
224
225 /* Primary bus, no interrupts here */
226 if (bus == 0) {
227 return -1;
228 }
229
230 /* Lookup first leaf in bus tree */
231 while ((tmp_bus->parent != NULL) && (tmp_bus->parent->parent != NULL)) {
232 tmp_bus = tmp_bus->parent;
233 }
234
235 /* Select between known bridges */
236 switch (tmp_bus->self->devfn | (tmp_bus->self->bus->number << 8)) {
237 /* Device is located after first MB bridge */
238 case 0x0008:
239 if (tmp_bus == dev->bus) {
240 /* Device is located directy after first MB bridge */
241 switch (devpin) {
242 case DEVPIN(1, 1): /* Onboard 82546 ch 0 */
243 if (machine_is_ixdp2401())
244 return IRQ_IXDP2401_INTA_82546;
245 return -1;
246 case DEVPIN(1, 2): /* Onboard 82546 ch 1 */
247 if (machine_is_ixdp2401())
248 return IRQ_IXDP2401_INTB_82546;
249 return -1;
250 case DEVPIN(0, 1): /* PMC INTA# */
251 return IRQ_IXDP2X01_SPCI_PMC_INTA;
252 case DEVPIN(0, 2): /* PMC INTB# */
253 return IRQ_IXDP2X01_SPCI_PMC_INTB;
254 case DEVPIN(0, 3): /* PMC INTC# */
255 return IRQ_IXDP2X01_SPCI_PMC_INTC;
256 case DEVPIN(0, 4): /* PMC INTD# */
257 return IRQ_IXDP2X01_SPCI_PMC_INTD;
258 }
259 }
260 break;
261 case 0x0010:
262 if (tmp_bus == dev->bus) {
263 /* Device is located directy after second MB bridge */
264 /* Secondary bus of second bridge */
265 switch (devpin) {
266 case DEVPIN(0, 1): /* DB#0 */
267 return IRQ_IXDP2X01_SPCI_DB_0;
268 case DEVPIN(1, 1): /* DB#1 */
269 return IRQ_IXDP2X01_SPCI_DB_1;
270 }
271 } else {
272 /* Device is located indirectly after second MB bridge */
273 /* Not supported now */
274 }
275 break;
276 }
277
278 return -1;
279}
280
281
282static int ixdp2x01_pci_setup(int nr, struct pci_sys_data *sys)
283{
284 sys->mem_offset = 0xe0000000;
285
286 if (machine_is_ixdp2801())
287 sys->mem_offset -= ((*IXP2000_PCI_ADDR_EXT & 0xE000) << 16);
288
289 return ixp2000_pci_setup(nr, sys);
290}
291
292struct hw_pci ixdp2x01_pci __initdata = {
293 .nr_controllers = 1,
294 .setup = ixdp2x01_pci_setup,
295 .preinit = ixdp2x01_pci_preinit,
296 .scan = ixp2000_pci_scan_bus,
297 .map_irq = ixdp2x01_pci_map_irq,
298};
299
300int __init ixdp2x01_pci_init(void)
301{
302
303 pci_common_init(&ixdp2x01_pci);
304 return 0;
305}
306
307subsys_initcall(ixdp2x01_pci_init);
308
309/*************************************************************************
310 * IXDP2x01 Machine Intialization
311 *************************************************************************/
312static struct flash_platform_data ixdp2x01_flash_platform_data = {
313 .map_name = "cfi_probe",
314 .width = 1,
315};
316
317static unsigned long ixdp2x01_flash_bank_setup(unsigned long ofs)
318{
319 ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
320 ((ofs >> IXDP2X01_FLASH_WINDOW_BITS) | IXDP2X01_CPLD_FLASH_INTERN));
321 return (ofs & IXDP2X01_FLASH_WINDOW_MASK);
322}
323
324static struct ixp2000_flash_data ixdp2x01_flash_data = {
325 .platform_data = &ixdp2x01_flash_platform_data,
326 .bank_setup = ixdp2x01_flash_bank_setup
327};
328
329static struct resource ixdp2x01_flash_resource = {
330 .start = 0xc4000000,
331 .end = 0xc4000000 + 0x01ffffff,
332 .flags = IORESOURCE_MEM,
333};
334
335static struct platform_device ixdp2x01_flash = {
336 .name = "IXP2000-Flash",
337 .id = 0,
338 .dev = {
339 .platform_data = &ixdp2x01_flash_data,
340 },
341 .num_resources = 1,
342 .resource = &ixdp2x01_flash_resource,
343};
344
345static struct ixp2000_i2c_pins ixdp2x01_i2c_gpio_pins = {
346 .sda_pin = IXDP2X01_GPIO_SDA,
347 .scl_pin = IXDP2X01_GPIO_SCL,
348};
349
350static struct platform_device ixdp2x01_i2c_controller = {
351 .name = "IXP2000-I2C",
352 .id = 0,
353 .dev = {
354 .platform_data = &ixdp2x01_i2c_gpio_pins,
355 },
356 .num_resources = 0
357};
358
359static struct platform_device *ixdp2x01_devices[] __initdata = {
360 &ixdp2x01_flash,
361 &ixdp2x01_i2c_controller
362};
363
364static void __init ixdp2x01_init_machine(void)
365{
366 ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
367 (IXDP2X01_CPLD_FLASH_BANK_MASK | IXDP2X01_CPLD_FLASH_INTERN));
368
369 ixdp2x01_flash_data.nr_banks =
370 ((*IXDP2X01_CPLD_FLASH_REG & IXDP2X01_CPLD_FLASH_BANK_MASK) + 1);
371
372 platform_add_devices(ixdp2x01_devices, ARRAY_SIZE(ixdp2x01_devices));
373}
374
375
376#ifdef CONFIG_ARCH_IXDP2401
377MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform")
378 MAINTAINER("MontaVista Software, Inc.")
379 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE)
380 BOOT_PARAMS(0x00000100)
381 MAPIO(ixdp2x01_map_io)
382 INITIRQ(ixdp2x01_init_irq)
383 .timer = &ixdp2x01_timer,
384 INIT_MACHINE(ixdp2x01_init_machine)
385MACHINE_END
386#endif
387
388#ifdef CONFIG_ARCH_IXDP2801
389MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform")
390 MAINTAINER("MontaVista Software, Inc.")
391 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE)
392 BOOT_PARAMS(0x00000100)
393 MAPIO(ixdp2x01_map_io)
394 INITIRQ(ixdp2x01_init_irq)
395 .timer = &ixdp2x01_timer,
396 INIT_MACHINE(ixdp2x01_init_machine)
397MACHINE_END
398#endif
399
400
diff --git a/arch/arm/mach-ixp2000/pci.c b/arch/arm/mach-ixp2000/pci.c
new file mode 100644
index 000000000000..831f8ffb6b61
--- /dev/null
+++ b/arch/arm/mach-ixp2000/pci.c
@@ -0,0 +1,235 @@
1/*
2 * arch/arm/mach-ixp2000/pci.c
3 *
4 * PCI routines for IXDP2400/IXDP2800 boards
5 *
6 * Original Author: Naeem Afzal <naeem.m.afzal@intel.com>
7 * Maintained by: Deepak Saxena <dsaxena@plexity.net>
8 *
9 * Copyright 2002 Intel Corp.
10 * Copyright (C) 2003-2004 MontaVista Software, Inc.
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
18#include <linux/sched.h>
19#include <linux/kernel.h>
20#include <linux/pci.h>
21#include <linux/interrupt.h>
22#include <linux/mm.h>
23#include <linux/init.h>
24#include <linux/ioport.h>
25#include <linux/slab.h>
26#include <linux/delay.h>
27
28#include <asm/io.h>
29#include <asm/irq.h>
30#include <asm/system.h>
31#include <asm/mach-types.h>
32#include <asm/hardware.h>
33
34#include <asm/mach/pci.h>
35
36static int pci_master_aborts = 0;
37
38static int clear_master_aborts(void);
39
40static u32 *
41ixp2000_pci_config_addr(unsigned int bus_nr, unsigned int devfn, int where)
42{
43 u32 *paddress;
44
45 if (PCI_SLOT(devfn) > 7)
46 return 0;
47
48 /* Must be dword aligned */
49 where &= ~3;
50
51 /*
52 * For top bus, generate type 0, else type 1
53 */
54 if (!bus_nr) {
55 /* only bits[23:16] are used for IDSEL */
56 paddress = (u32 *) (IXP2000_PCI_CFG0_VIRT_BASE
57 | (1 << (PCI_SLOT(devfn) + 16))
58 | (PCI_FUNC(devfn) << 8) | where);
59 } else {
60 paddress = (u32 *) (IXP2000_PCI_CFG1_VIRT_BASE
61 | (bus_nr << 16)
62 | (PCI_SLOT(devfn) << 11)
63 | (PCI_FUNC(devfn) << 8) | where);
64 }
65
66 return paddress;
67}
68
69/*
70 * Mask table, bits to mask for quantity of size 1, 2 or 4 bytes.
71 * 0 and 3 are not valid indexes...
72 */
73static u32 bytemask[] = {
74 /*0*/ 0,
75 /*1*/ 0xff,
76 /*2*/ 0xffff,
77 /*3*/ 0,
78 /*4*/ 0xffffffff,
79};
80
81
82int ixp2000_pci_read_config(struct pci_bus *bus, unsigned int devfn, int where,
83 int size, u32 *value)
84{
85 u32 n;
86 u32 *addr;
87
88 n = where % 4;
89
90 addr = ixp2000_pci_config_addr(bus->number, devfn, where);
91 if (!addr)
92 return PCIBIOS_DEVICE_NOT_FOUND;
93
94 pci_master_aborts = 0;
95 *value = (*addr >> (8*n)) & bytemask[size];
96 if (pci_master_aborts) {
97 pci_master_aborts = 0;
98 *value = 0xffffffff;
99 return PCIBIOS_DEVICE_NOT_FOUND;
100 }
101
102 return PCIBIOS_SUCCESSFUL;
103}
104
105/*
106 * We don't do error checks by callling clear_master_aborts() b/c the
107 * assumption is that the caller did a read first to make sure a device
108 * exists.
109 */
110int ixp2000_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where,
111 int size, u32 value)
112{
113 u32 mask;
114 u32 *addr;
115 u32 temp;
116
117 mask = ~(bytemask[size] << ((where % 0x4) * 8));
118 addr = ixp2000_pci_config_addr(bus->number, devfn, where);
119 if (!addr)
120 return PCIBIOS_DEVICE_NOT_FOUND;
121 temp = (u32) (value) << ((where % 0x4) * 8);
122 *addr = (*addr & mask) | temp;
123
124 clear_master_aborts();
125
126 return PCIBIOS_SUCCESSFUL;
127}
128
129
130static struct pci_ops ixp2000_pci_ops = {
131 .read = ixp2000_pci_read_config,
132 .write = ixp2000_pci_write_config
133};
134
135struct pci_bus *ixp2000_pci_scan_bus(int nr, struct pci_sys_data *sysdata)
136{
137 return pci_scan_bus(sysdata->busnr, &ixp2000_pci_ops, sysdata);
138}
139
140
141int ixp2000_pci_abort_handler(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
142{
143
144 volatile u32 temp;
145 unsigned long flags;
146
147 pci_master_aborts = 1;
148
149 local_irq_save(flags);
150 temp = *(IXP2000_PCI_CONTROL);
151 if (temp & ((1 << 8) | (1 << 5))) {
152 ixp2000_reg_write(IXP2000_PCI_CONTROL, temp);
153 }
154
155 temp = *(IXP2000_PCI_CMDSTAT);
156 if (temp & (1 << 29)) {
157 while (temp & (1 << 29)) {
158 ixp2000_reg_write(IXP2000_PCI_CMDSTAT, temp);
159 temp = *(IXP2000_PCI_CMDSTAT);
160 }
161 }
162 local_irq_restore(flags);
163
164 /*
165 * If it was an imprecise abort, then we need to correct the
166 * return address to be _after_ the instruction.
167 */
168 if (fsr & (1 << 10))
169 regs->ARM_pc += 4;
170
171 return 0;
172}
173
174int
175clear_master_aborts(void)
176{
177 volatile u32 temp;
178 unsigned long flags;
179
180 local_irq_save(flags);
181 temp = *(IXP2000_PCI_CONTROL);
182 if (temp & ((1 << 8) | (1 << 5))) {
183 ixp2000_reg_write(IXP2000_PCI_CONTROL, temp);
184 }
185
186 temp = *(IXP2000_PCI_CMDSTAT);
187 if (temp & (1 << 29)) {
188 while (temp & (1 << 29)) {
189 ixp2000_reg_write(IXP2000_PCI_CMDSTAT, temp);
190 temp = *(IXP2000_PCI_CMDSTAT);
191 }
192 }
193 local_irq_restore(flags);
194
195 return 0;
196}
197
198void __init
199ixp2000_pci_preinit(void)
200{
201 hook_fault_code(16+6, ixp2000_pci_abort_handler, SIGBUS,
202 "PCI config cycle to non-existent device");
203}
204
205
206/*
207 * IXP2000 systems often have large resource requirements, so we just
208 * use our own resource space.
209 */
210static struct resource ixp2000_pci_mem_space = {
211 .start = 0x00000000,
212 .end = 0xffffffff,
213 .flags = IORESOURCE_MEM,
214 .name = "PCI Mem Space"
215};
216
217static struct resource ixp2000_pci_io_space = {
218 .start = 0x00000000,
219 .end = 0xffffffff,
220 .flags = IORESOURCE_IO,
221 .name = "PCI I/O Space"
222};
223
224int ixp2000_pci_setup(int nr, struct pci_sys_data *sys)
225{
226 if (nr >= 1)
227 return 0;
228
229 sys->resource[0] = &ixp2000_pci_io_space;
230 sys->resource[1] = &ixp2000_pci_mem_space;
231 sys->resource[2] = NULL;
232
233 return 1;
234}
235
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
new file mode 100644
index 000000000000..aacb5f9200ea
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -0,0 +1,127 @@
1if ARCH_IXP4XX
2
3config ARCH_SUPPORTS_BIG_ENDIAN
4 bool
5 default y
6
7menu "Intel IXP4xx Implementation Options"
8
9comment "IXP4xx Platforms"
10
11config ARCH_AVILA
12 bool "Avila"
13 help
14 Say 'Y' here if you want your kernel to support the Gateworks
15 Avila Network Platform. For more information on this platform,
16 see <file:Documentation/arm/IXP4xx>.
17
18config ARCH_ADI_COYOTE
19 bool "Coyote"
20 help
21 Say 'Y' here if you want your kernel to support the ADI
22 Engineering Coyote Gateway Reference Platform. For more
23 information on this platform, see <file:Documentation/arm/IXP4xx>.
24
25config ARCH_IXDP425
26 bool "IXDP425"
27 help
28 Say 'Y' here if you want your kernel to support Intel's
29 IXDP425 Development Platform (Also known as Richfield).
30 For more information on this platform, see <file:Documentation/arm/IXP4xx>.
31
32config MACH_IXDPG425
33 bool "IXDPG425"
34 help
35 Say 'Y' here if you want your kernel to support Intel's
36 IXDPG425 Development Platform (Also known as Montajade).
37 For more information on this platform, see <file:Documentation/arm/IXP4xx>.
38
39config MACH_IXDP465
40 bool "IXDP465"
41 help
42 Say 'Y' here if you want your kernel to support Intel's
43 IXDP465 Development Platform (Also known as BMP).
44 For more information on this platform, see Documentation/arm/IXP4xx.
45
46
47#
48# IXCDP1100 is the exact same HW as IXDP425, but with a different machine
49# number from the bootloader due to marketing monkeys, so we just enable it
50# by default if IXDP425 is enabled.
51#
52config ARCH_IXCDP1100
53 bool
54 depends on ARCH_IXDP425
55 default y
56
57config ARCH_PRPMC1100
58 bool "PrPMC1100"
59 help
60 Say 'Y' here if you want your kernel to support the Motorola
61 PrPCM1100 Processor Mezanine Module. For more information on
62 this platform, see <file:Documentation/arm/IXP4xx>.
63
64#
65# Avila and IXDP share the same source for now. Will change in future
66#
67config ARCH_IXDP4XX
68 bool
69 depends on ARCH_IXDP425 || ARCH_AVILA || MACH_IXDP465
70 default y
71
72#
73# Certain registers and IRQs are only enabled if supporting IXP465 CPUs
74#
75config CPU_IXP46X
76 bool
77 depends on MACH_IXDP465
78 default y
79
80config MACH_GTWX5715
81 bool "Gemtek WX5715 (Linksys WRV54G)"
82 depends on ARCH_IXP4XX
83 help
84 This board is currently inside the Linksys WRV54G Gateways.
85
86 IXP425 - 266mhz
87 32mb SDRAM
88 8mb Flash
89 miniPCI slot 0 does not have a card connector soldered to the board
90 miniPCI slot 1 has an ISL3880 802.11g card (Prism54)
91 npe0 is connected to a Kendin KS8995M Switch (4 ports)
92 npe1 is the "wan" port
93 "Console" UART is available on J11 as console
94 "High Speed" UART is n/c (as far as I can tell)
95 20 Pin ARM/Xscale JTAG interface on J2
96
97
98comment "IXP4xx Options"
99
100config IXP4XX_INDIRECT_PCI
101 bool "Use indirect PCI memory access"
102 help
103 IXP4xx provides two methods of accessing PCI memory space:
104
105 1) A direct mapped window from 0x48000000 to 0x4bffffff (64MB).
106 To access PCI via this space, we simply ioremap() the BAR
107 into the kernel and we can use the standard read[bwl]/write[bwl]
108 macros. This is the preferred method due to speed but it
109 limits the system to just 64MB of PCI memory. This can be
110 problamatic if using video cards and other memory-heavy devices.
111
112 2) If > 64MB of memory space is required, the IXP4xx can be
113 configured to use indirect registers to access PCI This allows
114 for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus.
115 The disadvantadge of this is that every PCI access requires
116 three local register accesses plus a spinlock, but in some
117 cases the performance hit is acceptable. In addition, you cannot
118 mmap() PCI devices in this case due to the indirect nature
119 of the PCI window.
120
121 By default, the direct method is used. Choose this option if you
122 need to use the indirect method instead. If you don't know
123 what you need, leave this option unselected.
124
125endmenu
126
127endif
diff --git a/arch/arm/mach-ixp4xx/Makefile b/arch/arm/mach-ixp4xx/Makefile
new file mode 100644
index 000000000000..ddecbda4a633
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/Makefile
@@ -0,0 +1,11 @@
1#
2# Makefile for the linux kernel.
3#
4
5obj-y += common.o common-pci.o
6
7obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o ixdp425-setup.o
8obj-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o coyote-setup.o
9obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o coyote-setup.o
10obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o gtwx5715-setup.o
11
diff --git a/arch/arm/mach-ixp4xx/Makefile.boot b/arch/arm/mach-ixp4xx/Makefile.boot
new file mode 100644
index 000000000000..d84c5807a43d
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
new file mode 100644
index 000000000000..94bcdb933e41
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -0,0 +1,527 @@
1/*
2 * arch/arm/mach-ixp4xx/common-pci.c
3 *
4 * IXP4XX PCI routines for all platforms
5 *
6 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
7 *
8 * Copyright (C) 2002 Intel Corporation.
9 * Copyright (C) 2003 Greg Ungerer <gerg@snapgear.com>
10 * Copyright (C) 2003-2004 MontaVista Software, Inc.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 *
16 */
17
18#include <linux/sched.h>
19#include <linux/kernel.h>
20#include <linux/pci.h>
21#include <linux/interrupt.h>
22#include <linux/mm.h>
23#include <linux/init.h>
24#include <linux/ioport.h>
25#include <linux/slab.h>
26#include <linux/delay.h>
27#include <linux/device.h>
28#include <asm/dma-mapping.h>
29
30#include <asm/io.h>
31#include <asm/irq.h>
32#include <asm/sizes.h>
33#include <asm/system.h>
34#include <asm/mach/pci.h>
35#include <asm/hardware.h>
36
37
38/*
39 * IXP4xx PCI read function is dependent on whether we are
40 * running A0 or B0 (AppleGate) silicon.
41 */
42int (*ixp4xx_pci_read)(u32 addr, u32 cmd, u32* data);
43
44/*
45 * Base address for PCI regsiter region
46 */
47unsigned long ixp4xx_pci_reg_base = 0;
48
49/*
50 * PCI cfg an I/O routines are done by programming a
51 * command/byte enable register, and then read/writing
52 * the data from a data regsiter. We need to ensure
53 * these transactions are atomic or we will end up
54 * with corrupt data on the bus or in a driver.
55 */
56static DEFINE_SPINLOCK(ixp4xx_pci_lock);
57
58/*
59 * Read from PCI config space
60 */
61static void crp_read(u32 ad_cbe, u32 *data)
62{
63 unsigned long flags;
64 spin_lock_irqsave(&ixp4xx_pci_lock, flags);
65 *PCI_CRP_AD_CBE = ad_cbe;
66 *data = *PCI_CRP_RDATA;
67 spin_unlock_irqrestore(&ixp4xx_pci_lock, flags);
68}
69
70/*
71 * Write to PCI config space
72 */
73static void crp_write(u32 ad_cbe, u32 data)
74{
75 unsigned long flags;
76 spin_lock_irqsave(&ixp4xx_pci_lock, flags);
77 *PCI_CRP_AD_CBE = CRP_AD_CBE_WRITE | ad_cbe;
78 *PCI_CRP_WDATA = data;
79 spin_unlock_irqrestore(&ixp4xx_pci_lock, flags);
80}
81
82static inline int check_master_abort(void)
83{
84 /* check Master Abort bit after access */
85 unsigned long isr = *PCI_ISR;
86
87 if (isr & PCI_ISR_PFE) {
88 /* make sure the Master Abort bit is reset */
89 *PCI_ISR = PCI_ISR_PFE;
90 pr_debug("%s failed\n", __FUNCTION__);
91 return 1;
92 }
93
94 return 0;
95}
96
97int ixp4xx_pci_read_errata(u32 addr, u32 cmd, u32* data)
98{
99 unsigned long flags;
100 int retval = 0;
101 int i;
102
103 spin_lock_irqsave(&ixp4xx_pci_lock, flags);
104
105 *PCI_NP_AD = addr;
106
107 /*
108 * PCI workaround - only works if NP PCI space reads have
109 * no side effects!!! Read 8 times. last one will be good.
110 */
111 for (i = 0; i < 8; i++) {
112 *PCI_NP_CBE = cmd;
113 *data = *PCI_NP_RDATA;
114 *data = *PCI_NP_RDATA;
115 }
116
117 if(check_master_abort())
118 retval = 1;
119
120 spin_unlock_irqrestore(&ixp4xx_pci_lock, flags);
121 return retval;
122}
123
124int ixp4xx_pci_read_no_errata(u32 addr, u32 cmd, u32* data)
125{
126 unsigned long flags;
127 int retval = 0;
128
129 spin_lock_irqsave(&ixp4xx_pci_lock, flags);
130
131 *PCI_NP_AD = addr;
132
133 /* set up and execute the read */
134 *PCI_NP_CBE = cmd;
135
136 /* the result of the read is now in NP_RDATA */
137 *data = *PCI_NP_RDATA;
138
139 if(check_master_abort())
140 retval = 1;
141
142 spin_unlock_irqrestore(&ixp4xx_pci_lock, flags);
143 return retval;
144}
145
146int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data)
147{
148 unsigned long flags;
149 int retval = 0;
150
151 spin_lock_irqsave(&ixp4xx_pci_lock, flags);
152
153 *PCI_NP_AD = addr;
154
155 /* set up the write */
156 *PCI_NP_CBE = cmd;
157
158 /* execute the write by writing to NP_WDATA */
159 *PCI_NP_WDATA = data;
160
161 if(check_master_abort())
162 retval = 1;
163
164 spin_unlock_irqrestore(&ixp4xx_pci_lock, flags);
165 return retval;
166}
167
168static u32 ixp4xx_config_addr(u8 bus_num, u16 devfn, int where)
169{
170 u32 addr;
171 if (!bus_num) {
172 /* type 0 */
173 addr = BIT(32-PCI_SLOT(devfn)) | ((PCI_FUNC(devfn)) << 8) |
174 (where & ~3);
175 } else {
176 /* type 1 */
177 addr = (bus_num << 16) | ((PCI_SLOT(devfn)) << 11) |
178 ((PCI_FUNC(devfn)) << 8) | (where & ~3) | 1;
179 }
180 return addr;
181}
182
183/*
184 * Mask table, bits to mask for quantity of size 1, 2 or 4 bytes.
185 * 0 and 3 are not valid indexes...
186 */
187static u32 bytemask[] = {
188 /*0*/ 0,
189 /*1*/ 0xff,
190 /*2*/ 0xffff,
191 /*3*/ 0,
192 /*4*/ 0xffffffff,
193};
194
195static u32 local_byte_lane_enable_bits(u32 n, int size)
196{
197 if (size == 1)
198 return (0xf & ~BIT(n)) << CRP_AD_CBE_BESL;
199 if (size == 2)
200 return (0xf & ~(BIT(n) | BIT(n+1))) << CRP_AD_CBE_BESL;
201 if (size == 4)
202 return 0;
203 return 0xffffffff;
204}
205
206static int local_read_config(int where, int size, u32 *value)
207{
208 u32 n, data;
209 pr_debug("local_read_config from %d size %d\n", where, size);
210 n = where % 4;
211 crp_read(where & ~3, &data);
212 *value = (data >> (8*n)) & bytemask[size];
213 pr_debug("local_read_config read %#x\n", *value);
214 return PCIBIOS_SUCCESSFUL;
215}
216
217static int local_write_config(int where, int size, u32 value)
218{
219 u32 n, byte_enables, data;
220 pr_debug("local_write_config %#x to %d size %d\n", value, where, size);
221 n = where % 4;
222 byte_enables = local_byte_lane_enable_bits(n, size);
223 if (byte_enables == 0xffffffff)
224 return PCIBIOS_BAD_REGISTER_NUMBER;
225 data = value << (8*n);
226 crp_write((where & ~3) | byte_enables, data);
227 return PCIBIOS_SUCCESSFUL;
228}
229
230static u32 byte_lane_enable_bits(u32 n, int size)
231{
232 if (size == 1)
233 return (0xf & ~BIT(n)) << 4;
234 if (size == 2)
235 return (0xf & ~(BIT(n) | BIT(n+1))) << 4;
236 if (size == 4)
237 return 0;
238 return 0xffffffff;
239}
240
241static int ixp4xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
242{
243 u32 n, byte_enables, addr, data;
244 u8 bus_num = bus->number;
245
246 pr_debug("read_config from %d size %d dev %d:%d:%d\n", where, size,
247 bus_num, PCI_SLOT(devfn), PCI_FUNC(devfn));
248
249 *value = 0xffffffff;
250 n = where % 4;
251 byte_enables = byte_lane_enable_bits(n, size);
252 if (byte_enables == 0xffffffff)
253 return PCIBIOS_BAD_REGISTER_NUMBER;
254
255 addr = ixp4xx_config_addr(bus_num, devfn, where);
256 if (ixp4xx_pci_read(addr, byte_enables | NP_CMD_CONFIGREAD, &data))
257 return PCIBIOS_DEVICE_NOT_FOUND;
258
259 *value = (data >> (8*n)) & bytemask[size];
260 pr_debug("read_config_byte read %#x\n", *value);
261 return PCIBIOS_SUCCESSFUL;
262}
263
264static int ixp4xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
265{
266 u32 n, byte_enables, addr, data;
267 u8 bus_num = bus->number;
268
269 pr_debug("write_config_byte %#x to %d size %d dev %d:%d:%d\n", value, where,
270 size, bus_num, PCI_SLOT(devfn), PCI_FUNC(devfn));
271
272 n = where % 4;
273 byte_enables = byte_lane_enable_bits(n, size);
274 if (byte_enables == 0xffffffff)
275 return PCIBIOS_BAD_REGISTER_NUMBER;
276
277 addr = ixp4xx_config_addr(bus_num, devfn, where);
278 data = value << (8*n);
279 if (ixp4xx_pci_write(addr, byte_enables | NP_CMD_CONFIGWRITE, data))
280 return PCIBIOS_DEVICE_NOT_FOUND;
281
282 return PCIBIOS_SUCCESSFUL;
283}
284
285struct pci_ops ixp4xx_ops = {
286 .read = ixp4xx_pci_read_config,
287 .write = ixp4xx_pci_write_config,
288};
289
290/*
291 * PCI abort handler
292 */
293static int abort_handler(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
294{
295 u32 isr, status;
296
297 isr = *PCI_ISR;
298 local_read_config(PCI_STATUS, 2, &status);
299 pr_debug("PCI: abort_handler addr = %#lx, isr = %#x, "
300 "status = %#x\n", addr, isr, status);
301
302 /* make sure the Master Abort bit is reset */
303 *PCI_ISR = PCI_ISR_PFE;
304 status |= PCI_STATUS_REC_MASTER_ABORT;
305 local_write_config(PCI_STATUS, 2, status);
306
307 /*
308 * If it was an imprecise abort, then we need to correct the
309 * return address to be _after_ the instruction.
310 */
311 if (fsr & (1 << 10))
312 regs->ARM_pc += 4;
313
314 return 0;
315}
316
317
318/*
319 * Setup DMA mask to 64MB on PCI devices. Ignore all other devices.
320 */
321static int ixp4xx_pci_platform_notify(struct device *dev)
322{
323 if(dev->bus == &pci_bus_type) {
324 *dev->dma_mask = SZ_64M - 1;
325 dev->coherent_dma_mask = SZ_64M - 1;
326 dmabounce_register_dev(dev, 2048, 4096);
327 }
328 return 0;
329}
330
331static int ixp4xx_pci_platform_notify_remove(struct device *dev)
332{
333 if(dev->bus == &pci_bus_type) {
334 dmabounce_unregister_dev(dev);
335 }
336 return 0;
337}
338
339int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
340{
341 return (dev->bus == &pci_bus_type ) && ((dma_addr + size) >= SZ_64M);
342}
343
344void __init ixp4xx_pci_preinit(void)
345{
346 unsigned long processor_id;
347
348 asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :);
349
350 /*
351 * Determine which PCI read method to use.
352 * Rev 0 IXP425 requires workaround.
353 */
354 if (!(processor_id & 0xf) && !cpu_is_ixp46x()) {
355 printk("PCI: IXP42x A0 silicon detected - "
356 "PCI Non-Prefetch Workaround Enabled\n");
357 ixp4xx_pci_read = ixp4xx_pci_read_errata;
358 } else
359 ixp4xx_pci_read = ixp4xx_pci_read_no_errata;
360
361
362 /* hook in our fault handler for PCI errors */
363 hook_fault_code(16+6, abort_handler, SIGBUS, "imprecise external abort");
364
365 pr_debug("setup PCI-AHB(inbound) and AHB-PCI(outbound) address mappings\n");
366
367 /*
368 * We use identity AHB->PCI address translation
369 * in the 0x48000000 to 0x4bffffff address space
370 */
371 *PCI_PCIMEMBASE = 0x48494A4B;
372
373 /*
374 * We also use identity PCI->AHB address translation
375 * in 4 16MB BARs that begin at the physical memory start
376 */
377 *PCI_AHBMEMBASE = (PHYS_OFFSET & 0xFF000000) +
378 ((PHYS_OFFSET & 0xFF000000) >> 8) +
379 ((PHYS_OFFSET & 0xFF000000) >> 16) +
380 ((PHYS_OFFSET & 0xFF000000) >> 24) +
381 0x00010203;
382
383 if (*PCI_CSR & PCI_CSR_HOST) {
384 printk("PCI: IXP4xx is host\n");
385
386 pr_debug("setup BARs in controller\n");
387
388 /*
389 * We configure the PCI inbound memory windows to be
390 * 1:1 mapped to SDRAM
391 */
392 local_write_config(PCI_BASE_ADDRESS_0, 4, PHYS_OFFSET + 0x00000000);
393 local_write_config(PCI_BASE_ADDRESS_1, 4, PHYS_OFFSET + 0x01000000);
394 local_write_config(PCI_BASE_ADDRESS_2, 4, PHYS_OFFSET + 0x02000000);
395 local_write_config(PCI_BASE_ADDRESS_3, 4, PHYS_OFFSET + 0x03000000);
396
397 /*
398 * Enable CSR window at 0xff000000.
399 */
400 local_write_config(PCI_BASE_ADDRESS_4, 4, 0xff000008);
401
402 /*
403 * Enable the IO window to be way up high, at 0xfffffc00
404 */
405 local_write_config(PCI_BASE_ADDRESS_5, 4, 0xfffffc01);
406 } else {
407 printk("PCI: IXP4xx is target - No bus scan performed\n");
408 }
409
410 printk("PCI: IXP4xx Using %s access for memory space\n",
411#ifndef CONFIG_IXP4XX_INDIRECT_PCI
412 "direct"
413#else
414 "indirect"
415#endif
416 );
417
418 pr_debug("clear error bits in ISR\n");
419 *PCI_ISR = PCI_ISR_PSE | PCI_ISR_PFE | PCI_ISR_PPE | PCI_ISR_AHBE;
420
421 /*
422 * Set Initialize Complete in PCI Control Register: allow IXP4XX to
423 * respond to PCI configuration cycles. Specify that the AHB bus is
424 * operating in big endian mode. Set up byte lane swapping between
425 * little-endian PCI and the big-endian AHB bus
426 */
427#ifdef __ARMEB__
428 *PCI_CSR = PCI_CSR_IC | PCI_CSR_ABE | PCI_CSR_PDS | PCI_CSR_ADS;
429#else
430 *PCI_CSR = PCI_CSR_IC;
431#endif
432
433 pr_debug("DONE\n");
434}
435
436int ixp4xx_setup(int nr, struct pci_sys_data *sys)
437{
438 struct resource *res;
439
440 if (nr >= 1)
441 return 0;
442
443 res = kmalloc(sizeof(*res) * 2, GFP_KERNEL);
444 if (res == NULL) {
445 /*
446 * If we're out of memory this early, something is wrong,
447 * so we might as well catch it here.
448 */
449 panic("PCI: unable to allocate resources?\n");
450 }
451 memset(res, 0, sizeof(*res) * 2);
452
453 local_write_config(PCI_COMMAND, 2, PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
454
455 res[0].name = "PCI I/O Space";
456 res[0].start = 0x00001000;
457 res[0].end = 0xffff0000;
458 res[0].flags = IORESOURCE_IO;
459
460 res[1].name = "PCI Memory Space";
461 res[1].start = 0x48000000;
462#ifndef CONFIG_IXP4XX_INDIRECT_PCI
463 res[1].end = 0x4bffffff;
464#else
465 res[1].end = 0x4fffffff;
466#endif
467 res[1].flags = IORESOURCE_MEM;
468
469 request_resource(&ioport_resource, &res[0]);
470 request_resource(&iomem_resource, &res[1]);
471
472 sys->resource[0] = &res[0];
473 sys->resource[1] = &res[1];
474 sys->resource[2] = NULL;
475
476 platform_notify = ixp4xx_pci_platform_notify;
477 platform_notify_remove = ixp4xx_pci_platform_notify_remove;
478
479 return 1;
480}
481
482struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys)
483{
484 return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys);
485}
486
487/*
488 * We override these so we properly do dmabounce otherwise drivers
489 * are able to set the dma_mask to 0xffffffff and we can no longer
490 * trap bounces. :(
491 *
492 * We just return true on everyhing except for < 64MB in which case
493 * we will fail miseralby and die since we can't handle that case.
494 */
495int
496pci_set_dma_mask(struct pci_dev *dev, u64 mask)
497{
498 if (mask >= SZ_64M - 1 )
499 return 0;
500
501 return -EIO;
502}
503
504int
505pci_dac_set_dma_mask(struct pci_dev *dev, u64 mask)
506{
507 if (mask >= SZ_64M - 1 )
508 return 0;
509
510 return -EIO;
511}
512
513int
514pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
515{
516 if (mask >= SZ_64M - 1 )
517 return 0;
518
519 return -EIO;
520}
521
522EXPORT_SYMBOL(pci_set_dma_mask);
523EXPORT_SYMBOL(pci_dac_set_dma_mask);
524EXPORT_SYMBOL(pci_set_consistent_dma_mask);
525EXPORT_SYMBOL(ixp4xx_pci_read);
526EXPORT_SYMBOL(ixp4xx_pci_write);
527
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
new file mode 100644
index 000000000000..267ba02d77dc
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -0,0 +1,353 @@
1/*
2 * arch/arm/mach-ixp4xx/common.c
3 *
4 * Generic code shared across all IXP4XX platforms
5 *
6 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
7 *
8 * Copyright 2002 (c) Intel Corporation
9 * Copyright 2003-2004 (c) MontaVista, Software, Inc.
10 *
11 * This file is licensed under the terms of the GNU General Public
12 * License version 2. This program is licensed "as is" without any
13 * warranty of any kind, whether express or implied.
14 */
15
16#include <linux/config.h>
17#include <linux/kernel.h>
18#include <linux/mm.h>
19#include <linux/init.h>
20#include <linux/serial.h>
21#include <linux/sched.h>
22#include <linux/tty.h>
23#include <linux/serial_core.h>
24#include <linux/bootmem.h>
25#include <linux/interrupt.h>
26#include <linux/bitops.h>
27#include <linux/time.h>
28#include <linux/timex.h>
29
30#include <asm/hardware.h>
31#include <asm/uaccess.h>
32#include <asm/io.h>
33#include <asm/pgtable.h>
34#include <asm/page.h>
35#include <asm/irq.h>
36
37#include <asm/mach/map.h>
38#include <asm/mach/irq.h>
39#include <asm/mach/time.h>
40
41enum ixp4xx_irq_type {
42 IXP4XX_IRQ_LEVEL, IXP4XX_IRQ_EDGE
43};
44static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type);
45
46/*************************************************************************
47 * GPIO acces functions
48 *************************************************************************/
49
50/*
51 * Configure GPIO line for input, interrupt, or output operation
52 *
53 * TODO: Enable/disable the irq_desc based on interrupt or output mode.
54 * TODO: Should these be named ixp4xx_gpio_?
55 */
56void gpio_line_config(u8 line, u32 style)
57{
58 static const int gpio2irq[] = {
59 6, 7, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29
60 };
61 u32 enable;
62 volatile u32 *int_reg;
63 u32 int_style;
64 enum ixp4xx_irq_type irq_type;
65
66 enable = *IXP4XX_GPIO_GPOER;
67
68 if (style & IXP4XX_GPIO_OUT) {
69 enable &= ~((1) << line);
70 } else if (style & IXP4XX_GPIO_IN) {
71 enable |= ((1) << line);
72
73 switch (style & IXP4XX_GPIO_INTSTYLE_MASK)
74 {
75 case (IXP4XX_GPIO_ACTIVE_HIGH):
76 int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH;
77 irq_type = IXP4XX_IRQ_LEVEL;
78 break;
79 case (IXP4XX_GPIO_ACTIVE_LOW):
80 int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW;
81 irq_type = IXP4XX_IRQ_LEVEL;
82 break;
83 case (IXP4XX_GPIO_RISING_EDGE):
84 int_style = IXP4XX_GPIO_STYLE_RISING_EDGE;
85 irq_type = IXP4XX_IRQ_EDGE;
86 break;
87 case (IXP4XX_GPIO_FALLING_EDGE):
88 int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE;
89 irq_type = IXP4XX_IRQ_EDGE;
90 break;
91 case (IXP4XX_GPIO_TRANSITIONAL):
92 int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL;
93 irq_type = IXP4XX_IRQ_EDGE;
94 break;
95 default:
96 int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH;
97 irq_type = IXP4XX_IRQ_LEVEL;
98 break;
99 }
100
101 if (style & IXP4XX_GPIO_INTSTYLE_MASK)
102 ixp4xx_config_irq(gpio2irq[line], irq_type);
103
104 if (line >= 8) { /* pins 8-15 */
105 line -= 8;
106 int_reg = IXP4XX_GPIO_GPIT2R;
107 }
108 else { /* pins 0-7 */
109 int_reg = IXP4XX_GPIO_GPIT1R;
110 }
111
112 /* Clear the style for the appropriate pin */
113 *int_reg &= ~(IXP4XX_GPIO_STYLE_CLEAR <<
114 (line * IXP4XX_GPIO_STYLE_SIZE));
115
116 /* Set the new style */
117 *int_reg |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE));
118 }
119
120 *IXP4XX_GPIO_GPOER = enable;
121}
122
123EXPORT_SYMBOL(gpio_line_config);
124
125/*************************************************************************
126 * IXP4xx chipset I/O mapping
127 *************************************************************************/
128static struct map_desc ixp4xx_io_desc[] __initdata = {
129 { /* UART, Interrupt ctrl, GPIO, timers, NPEs, MACs, USB .... */
130 .virtual = IXP4XX_PERIPHERAL_BASE_VIRT,
131 .physical = IXP4XX_PERIPHERAL_BASE_PHYS,
132 .length = IXP4XX_PERIPHERAL_REGION_SIZE,
133 .type = MT_DEVICE
134 }, { /* Expansion Bus Config Registers */
135 .virtual = IXP4XX_EXP_CFG_BASE_VIRT,
136 .physical = IXP4XX_EXP_CFG_BASE_PHYS,
137 .length = IXP4XX_EXP_CFG_REGION_SIZE,
138 .type = MT_DEVICE
139 }, { /* PCI Registers */
140 .virtual = IXP4XX_PCI_CFG_BASE_VIRT,
141 .physical = IXP4XX_PCI_CFG_BASE_PHYS,
142 .length = IXP4XX_PCI_CFG_REGION_SIZE,
143 .type = MT_DEVICE
144 }
145};
146
147void __init ixp4xx_map_io(void)
148{
149 iotable_init(ixp4xx_io_desc, ARRAY_SIZE(ixp4xx_io_desc));
150}
151
152
153/*************************************************************************
154 * IXP4xx chipset IRQ handling
155 *
156 * TODO: GPIO IRQs should be marked invalid until the user of the IRQ
157 * (be it PCI or something else) configures that GPIO line
158 * as an IRQ.
159 **************************************************************************/
160static void ixp4xx_irq_mask(unsigned int irq)
161{
162 if (cpu_is_ixp46x() && irq >= 32)
163 *IXP4XX_ICMR2 &= ~(1 << (irq - 32));
164 else
165 *IXP4XX_ICMR &= ~(1 << irq);
166}
167
168static void ixp4xx_irq_unmask(unsigned int irq)
169{
170 if (cpu_is_ixp46x() && irq >= 32)
171 *IXP4XX_ICMR2 |= (1 << (irq - 32));
172 else
173 *IXP4XX_ICMR |= (1 << irq);
174}
175
176static void ixp4xx_irq_ack(unsigned int irq)
177{
178 static int irq2gpio[32] = {
179 -1, -1, -1, -1, -1, -1, 0, 1,
180 -1, -1, -1, -1, -1, -1, -1, -1,
181 -1, -1, -1, 2, 3, 4, 5, 6,
182 7, 8, 9, 10, 11, 12, -1, -1,
183 };
184 int line = (irq < 32) ? irq2gpio[irq] : -1;
185
186 if (line >= 0)
187 gpio_line_isr_clear(line);
188}
189
190/*
191 * Level triggered interrupts on GPIO lines can only be cleared when the
192 * interrupt condition disappears.
193 */
194static void ixp4xx_irq_level_unmask(unsigned int irq)
195{
196 ixp4xx_irq_ack(irq);
197 ixp4xx_irq_unmask(irq);
198}
199
200static struct irqchip ixp4xx_irq_level_chip = {
201 .ack = ixp4xx_irq_mask,
202 .mask = ixp4xx_irq_mask,
203 .unmask = ixp4xx_irq_level_unmask,
204};
205
206static struct irqchip ixp4xx_irq_edge_chip = {
207 .ack = ixp4xx_irq_ack,
208 .mask = ixp4xx_irq_mask,
209 .unmask = ixp4xx_irq_unmask,
210};
211
212static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type)
213{
214 switch (type) {
215 case IXP4XX_IRQ_LEVEL:
216 set_irq_chip(irq, &ixp4xx_irq_level_chip);
217 set_irq_handler(irq, do_level_IRQ);
218 break;
219 case IXP4XX_IRQ_EDGE:
220 set_irq_chip(irq, &ixp4xx_irq_edge_chip);
221 set_irq_handler(irq, do_edge_IRQ);
222 break;
223 }
224 set_irq_flags(irq, IRQF_VALID);
225}
226
227void __init ixp4xx_init_irq(void)
228{
229 int i = 0;
230
231 /* Route all sources to IRQ instead of FIQ */
232 *IXP4XX_ICLR = 0x0;
233
234 /* Disable all interrupt */
235 *IXP4XX_ICMR = 0x0;
236
237 if (cpu_is_ixp46x()) {
238 /* Route upper 32 sources to IRQ instead of FIQ */
239 *IXP4XX_ICLR2 = 0x00;
240
241 /* Disable upper 32 interrupts */
242 *IXP4XX_ICMR2 = 0x00;
243 }
244
245 /* Default to all level triggered */
246 for(i = 0; i < NR_IRQS; i++)
247 ixp4xx_config_irq(i, IXP4XX_IRQ_LEVEL);
248}
249
250
251/*************************************************************************
252 * IXP4xx timer tick
253 * We use OS timer1 on the CPU for the timer tick and the timestamp
254 * counter as a source of real clock ticks to account for missed jiffies.
255 *************************************************************************/
256
257static unsigned volatile last_jiffy_time;
258
259#define CLOCK_TICKS_PER_USEC ((CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC)
260
261/* IRQs are disabled before entering here from do_gettimeofday() */
262static unsigned long ixp4xx_gettimeoffset(void)
263{
264 u32 elapsed;
265
266 elapsed = *IXP4XX_OSTS - last_jiffy_time;
267
268 return elapsed / CLOCK_TICKS_PER_USEC;
269}
270
271static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
272{
273 write_seqlock(&xtime_lock);
274
275 /* Clear Pending Interrupt by writing '1' to it */
276 *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
277
278 /*
279 * Catch up with the real idea of time
280 */
281 while ((*IXP4XX_OSTS - last_jiffy_time) > LATCH) {
282 timer_tick(regs);
283 last_jiffy_time += LATCH;
284 }
285
286 write_sequnlock(&xtime_lock);
287
288 return IRQ_HANDLED;
289}
290
291static struct irqaction ixp4xx_timer_irq = {
292 .name = "IXP4xx Timer Tick",
293 .flags = SA_INTERRUPT,
294 .handler = ixp4xx_timer_interrupt
295};
296
297static void __init ixp4xx_timer_init(void)
298{
299 /* Clear Pending Interrupt by writing '1' to it */
300 *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
301
302 /* Setup the Timer counter value */
303 *IXP4XX_OSRT1 = (LATCH & ~IXP4XX_OST_RELOAD_MASK) | IXP4XX_OST_ENABLE;
304
305 /* Reset time-stamp counter */
306 *IXP4XX_OSTS = 0;
307 last_jiffy_time = 0;
308
309 /* Connect the interrupt handler and enable the interrupt */
310 setup_irq(IRQ_IXP4XX_TIMER1, &ixp4xx_timer_irq);
311}
312
313struct sys_timer ixp4xx_timer = {
314 .init = ixp4xx_timer_init,
315 .offset = ixp4xx_gettimeoffset,
316};
317
318static struct resource ixp46x_i2c_resources[] = {
319 [0] = {
320 .start = 0xc8011000,
321 .end = 0xc801101c,
322 .flags = IORESOURCE_MEM,
323 },
324 [1] = {
325 .start = IRQ_IXP4XX_I2C,
326 .end = IRQ_IXP4XX_I2C,
327 .flags = IORESOURCE_IRQ
328 }
329};
330
331/*
332 * I2C controller. The IXP46x uses the same block as the IOP3xx, so
333 * we just use the same device name.
334 */
335static struct platform_device ixp46x_i2c_controller = {
336 .name = "IOP3xx-I2C",
337 .id = 0,
338 .num_resources = 2,
339 .resource = ixp46x_i2c_resources
340};
341
342static struct platform_device *ixp46x_devices[] __initdata = {
343 &ixp46x_i2c_controller
344};
345
346void __init ixp4xx_sys_init(void)
347{
348 if (cpu_is_ixp46x()) {
349 platform_add_devices(ixp46x_devices,
350 ARRAY_SIZE(ixp46x_devices));
351 }
352}
353
diff --git a/arch/arm/mach-ixp4xx/coyote-pci.c b/arch/arm/mach-ixp4xx/coyote-pci.c
new file mode 100644
index 000000000000..afafb42ae129
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/coyote-pci.c
@@ -0,0 +1,70 @@
1/*
2 * arch/arch/mach-ixp4xx/coyote-pci.c
3 *
4 * PCI setup routines for ADI Engineering Coyote platform
5 *
6 * Copyright (C) 2002 Jungo Software Technologies.
7 * Copyright (C) 2003 MontaVista Softwrae, Inc.
8 *
9 * Maintainer: Deepak Saxena <dsaxena@mvista.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 version 2 as
13 * published by the Free Software Foundation.
14 *
15 */
16
17#include <linux/kernel.h>
18#include <linux/pci.h>
19#include <linux/init.h>
20
21#include <asm/mach-types.h>
22#include <asm/hardware.h>
23#include <asm/irq.h>
24
25#include <asm/mach/pci.h>
26
27extern void ixp4xx_pci_preinit(void);
28extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
29extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
30
31void __init coyote_pci_preinit(void)
32{
33 gpio_line_config(COYOTE_PCI_SLOT0_PIN,
34 IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW);
35
36 gpio_line_config(COYOTE_PCI_SLOT1_PIN,
37 IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW);
38
39 gpio_line_isr_clear(COYOTE_PCI_SLOT0_PIN);
40 gpio_line_isr_clear(COYOTE_PCI_SLOT1_PIN);
41
42 ixp4xx_pci_preinit();
43}
44
45static int __init coyote_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
46{
47 if (slot == COYOTE_PCI_SLOT0_DEVID)
48 return IRQ_COYOTE_PCI_SLOT0;
49 else if (slot == COYOTE_PCI_SLOT1_DEVID)
50 return IRQ_COYOTE_PCI_SLOT1;
51 else return -1;
52}
53
54struct hw_pci coyote_pci __initdata = {
55 .nr_controllers = 1,
56 .preinit = coyote_pci_preinit,
57 .swizzle = pci_std_swizzle,
58 .setup = ixp4xx_setup,
59 .scan = ixp4xx_scan_bus,
60 .map_irq = coyote_map_irq,
61};
62
63int __init coyote_pci_init(void)
64{
65 if (machine_is_adi_coyote())
66 pci_common_init(&coyote_pci);
67 return 0;
68}
69
70subsys_initcall(coyote_pci_init);
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
new file mode 100644
index 000000000000..8a05a1227e5f
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -0,0 +1,130 @@
1/*
2 * arch/arm/mach-ixp4xx/coyote-setup.c
3 *
4 * Board setup for ADI Engineering and IXDGP425 boards
5 *
6 * Copyright (C) 2003-2005 MontaVista Software, Inc.
7 *
8 * Author: Deepak Saxena <dsaxena@plexity.net>
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/device.h>
14#include <linux/serial.h>
15#include <linux/tty.h>
16#include <linux/serial_8250.h>
17
18#include <asm/types.h>
19#include <asm/setup.h>
20#include <asm/memory.h>
21#include <asm/hardware.h>
22#include <asm/irq.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25#include <asm/mach/flash.h>
26
27void __init coyote_map_io(void)
28{
29 ixp4xx_map_io();
30}
31
32static struct flash_platform_data coyote_flash_data = {
33 .map_name = "cfi_probe",
34 .width = 2,
35};
36
37static struct resource coyote_flash_resource = {
38 .start = COYOTE_FLASH_BASE,
39 .end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE,
40 .flags = IORESOURCE_MEM,
41};
42
43static struct platform_device coyote_flash = {
44 .name = "IXP4XX-Flash",
45 .id = 0,
46 .dev = {
47 .platform_data = &coyote_flash_data,
48 },
49 .num_resources = 1,
50 .resource = &coyote_flash_resource,
51};
52
53static struct resource coyote_uart_resource = {
54 .start = IXP4XX_UART2_BASE_PHYS,
55 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
56 .flags = IORESOURCE_MEM,
57};
58
59static struct plat_serial8250_port coyote_uart_data = {
60 .mapbase = IXP4XX_UART2_BASE_PHYS,
61 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
62 .irq = IRQ_IXP4XX_UART2,
63 .flags = UPF_BOOT_AUTOCONF,
64 .iotype = UPIO_MEM,
65 .regshift = 2,
66 .uartclk = IXP4XX_UART_XTAL,
67};
68
69static struct platform_device coyote_uart = {
70 .name = "serial8250",
71 .id = 0,
72 .dev = {
73 .platform_data = &coyote_uart_data,
74 },
75 .num_resources = 1,
76 .resource = &coyote_uart_resource,
77};
78
79static struct platform_device *coyote_devices[] __initdata = {
80 &coyote_flash,
81 &coyote_uart
82};
83
84static void __init coyote_init(void)
85{
86 *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
87 *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
88
89 if (machine_is_ixdpg425()) {
90 coyote_uart_data.membase =
91 (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET);
92 coyote_uart_data.mapbase = IXP4XX_UART1_BASE_PHYS;
93 coyote_uart_data.irq = IRQ_IXP4XX_UART1;
94 }
95
96
97 ixp4xx_sys_init();
98 platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices));
99}
100
101#ifdef CONFIG_ARCH_ADI_COYOTE
102MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
103 MAINTAINER("MontaVista Software, Inc.")
104 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
105 IXP4XX_PERIPHERAL_BASE_VIRT)
106 MAPIO(coyote_map_io)
107 INITIRQ(ixp4xx_init_irq)
108 .timer = &ixp4xx_timer,
109 BOOT_PARAMS(0x0100)
110 INIT_MACHINE(coyote_init)
111MACHINE_END
112#endif
113
114/*
115 * IXDPG425 is identical to Coyote except for which serial port
116 * is connected.
117 */
118#ifdef CONFIG_MACH_IXDPG425
119MACHINE_START(IXDPG425, "Intel IXDPG425")
120 MAINTAINER("MontaVista Software, Inc.")
121 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
122 IXP4XX_PERIPHERAL_BASE_VIRT)
123 MAPIO(coyote_map_io)
124 INITIRQ(ixp4xx_init_irq)
125 .timer = &ixp4xx_timer,
126 BOOT_PARAMS(0x0100)
127 INIT_MACHINE(coyote_init)
128MACHINE_END
129#endif
130
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-pci.c b/arch/arm/mach-ixp4xx/gtwx5715-pci.c
new file mode 100644
index 000000000000..b18035824e3e
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/gtwx5715-pci.c
@@ -0,0 +1,101 @@
1/*
2 * arch/arm/mach-ixp4xx/gtwx5715-pci.c
3 *
4 * Gemtek GTWX5715 (Linksys WRV54G) board setup
5 *
6 * Copyright (C) 2004 George T. Joseph
7 * Derived from Coyote
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 *
23 */
24
25#include <linux/pci.h>
26#include <linux/init.h>
27#include <linux/delay.h>
28#include <asm/mach-types.h>
29#include <asm/hardware.h>
30#include <asm/irq.h>
31#include <asm/arch/gtwx5715.h>
32#include <asm/mach/pci.h>
33
34extern void ixp4xx_pci_preinit(void);
35extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
36extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
37
38 /*
39 * The exact GPIO pins and IRQs are defined in arch-ixp4xx/gtwx5715.h
40 * Slot 0 isn't actually populated with a card connector but
41 * we initialize it anyway in case a future version has the
42 * slot populated or someone with good soldering skills has
43 * some free time.
44 */
45
46
47static void gtwx5715_init_gpio(u8 pin, u32 style)
48{
49 gpio_line_config(pin, style | IXP4XX_GPIO_ACTIVE_LOW);
50
51 if (style & IXP4XX_GPIO_IN) gpio_line_isr_clear(pin);
52}
53
54void __init gtwx5715_pci_preinit(void)
55{
56 gtwx5715_init_gpio(GTWX5715_PCI_SLOT0_INTA_GPIO, IXP4XX_GPIO_IN);
57 gtwx5715_init_gpio(GTWX5715_PCI_SLOT1_INTA_GPIO, IXP4XX_GPIO_IN);
58
59 ixp4xx_pci_preinit();
60}
61
62
63static int __init gtwx5715_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
64{
65 int rc;
66 static int gtwx5715_irqmap
67 [GTWX5715_PCI_SLOT_COUNT]
68 [GTWX5715_PCI_INT_PIN_COUNT] = {
69 {GTWX5715_PCI_SLOT0_INTA_IRQ, GTWX5715_PCI_SLOT0_INTB_IRQ},
70 {GTWX5715_PCI_SLOT1_INTA_IRQ, GTWX5715_PCI_SLOT1_INTB_IRQ},
71};
72
73 if (slot >= GTWX5715_PCI_SLOT_COUNT ||
74 pin >= GTWX5715_PCI_INT_PIN_COUNT) rc = -1;
75 else
76 rc = gtwx5715_irqmap[slot][pin-1];
77
78 printk("%s: Mapped slot %d pin %d to IRQ %d\n", __FUNCTION__,slot, pin, rc);
79 return(rc);
80}
81
82struct hw_pci gtwx5715_pci __initdata = {
83 .nr_controllers = 1,
84 .preinit = gtwx5715_pci_preinit,
85 .swizzle = pci_std_swizzle,
86 .setup = ixp4xx_setup,
87 .scan = ixp4xx_scan_bus,
88 .map_irq = gtwx5715_map_irq,
89};
90
91int __init gtwx5715_pci_init(void)
92{
93 if (machine_is_gtwx5715())
94 {
95 pci_common_init(&gtwx5715_pci);
96 }
97
98 return 0;
99}
100
101subsys_initcall(gtwx5715_pci_init);
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
new file mode 100644
index 000000000000..e77c86efd21d
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -0,0 +1,153 @@
1/*
2 * arch/arm/mach-ixp4xx/gtwx5715-setup.c
3 *
4 * Gemtek GTWX5715 (Linksys WRV54G) board settup
5 *
6 * Copyright (C) 2004 George T. Joseph
7 * Derived from Coyote
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 *
23 */
24
25#include <linux/init.h>
26#include <linux/device.h>
27#include <linux/serial.h>
28#include <linux/tty.h>
29#include <linux/serial_8250.h>
30
31#include <asm/types.h>
32#include <asm/setup.h>
33#include <asm/memory.h>
34#include <asm/hardware.h>
35#include <asm/irq.h>
36#include <asm/mach-types.h>
37#include <asm/mach/arch.h>
38#include <asm/mach/flash.h>
39#include <asm/arch/gtwx5715.h>
40
41/*
42 * Xscale UART registers are 32 bits wide with only the least
43 * significant 8 bits having any meaning. From a configuration
44 * perspective, this means 2 things...
45 *
46 * Setting .regshift = 2 so that the standard 16550 registers
47 * line up on every 4th byte.
48 *
49 * Shifting the register start virtual address +3 bytes when
50 * compiled big-endian. Since register writes are done on a
51 * single byte basis, if the shift isn't done the driver will
52 * write the value into the most significant byte of the register,
53 * which is ignored, instead of the least significant.
54 */
55
56#ifdef __ARMEB__
57#define REG_OFFSET 3
58#else
59#define REG_OFFSET 0
60#endif
61
62/*
63 * Only the second or "console" uart is connected on the gtwx5715.
64 */
65
66static struct resource gtwx5715_uart_resources[] = {
67 {
68 .start = IXP4XX_UART2_BASE_PHYS,
69 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
70 .flags = IORESOURCE_MEM,
71 },
72 {
73 .start = IRQ_IXP4XX_UART2,
74 .end = IRQ_IXP4XX_UART2,
75 .flags = IORESOURCE_IRQ,
76 },
77 { },
78};
79
80
81static struct plat_serial8250_port gtwx5715_uart_platform_data[] = {
82 {
83 .mapbase = IXP4XX_UART2_BASE_PHYS,
84 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
85 .irq = IRQ_IXP4XX_UART2,
86 .flags = UPF_BOOT_AUTOCONF,
87 .iotype = UPIO_MEM,
88 .regshift = 2,
89 .uartclk = IXP4XX_UART_XTAL,
90 },
91 { },
92};
93
94static struct platform_device gtwx5715_uart_device = {
95 .name = "serial8250",
96 .id = 0,
97 .dev = {
98 .platform_data = gtwx5715_uart_platform_data,
99 },
100 .num_resources = 2,
101 .resource = gtwx5715_uart_resources,
102};
103
104
105void __init gtwx5715_map_io(void)
106{
107 ixp4xx_map_io();
108}
109
110static struct flash_platform_data gtwx5715_flash_data = {
111 .map_name = "cfi_probe",
112 .width = 2,
113};
114
115static struct resource gtwx5715_flash_resource = {
116 .start = GTWX5715_FLASH_BASE,
117 .end = GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE,
118 .flags = IORESOURCE_MEM,
119};
120
121static struct platform_device gtwx5715_flash = {
122 .name = "IXP4XX-Flash",
123 .id = 0,
124 .dev = {
125 .platform_data = &gtwx5715_flash_data,
126 },
127 .num_resources = 1,
128 .resource = &gtwx5715_flash_resource,
129};
130
131static struct platform_device *gtwx5715_devices[] __initdata = {
132 &gtwx5715_uart_device,
133 &gtwx5715_flash,
134};
135
136static void __init gtwx5715_init(void)
137{
138 platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices));
139}
140
141
142MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
143 MAINTAINER("George Joseph")
144 BOOT_MEM(PHYS_OFFSET, IXP4XX_UART2_BASE_PHYS,
145 IXP4XX_UART2_BASE_VIRT)
146 MAPIO(gtwx5715_map_io)
147 INITIRQ(ixp4xx_init_irq)
148 .timer = &ixp4xx_timer,
149 BOOT_PARAMS(0x0100)
150 INIT_MACHINE(gtwx5715_init)
151MACHINE_END
152
153
diff --git a/arch/arm/mach-ixp4xx/ixdp425-pci.c b/arch/arm/mach-ixp4xx/ixdp425-pci.c
new file mode 100644
index 000000000000..c2ab9ebb5980
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c
@@ -0,0 +1,84 @@
1/*
2 * arch/arm/mach-ixp4xx/ixdp425-pci.c
3 *
4 * IXDP425 board-level PCI initialization
5 *
6 * Copyright (C) 2002 Intel Corporation.
7 * Copyright (C) 2003-2004 MontaVista Software, Inc.
8 *
9 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
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 version 2 as
13 * published by the Free Software Foundation.
14 *
15 */
16
17#include <linux/kernel.h>
18#include <linux/config.h>
19#include <linux/pci.h>
20#include <linux/init.h>
21#include <linux/delay.h>
22
23#include <asm/mach/pci.h>
24#include <asm/irq.h>
25#include <asm/hardware.h>
26#include <asm/mach-types.h>
27
28void __init ixdp425_pci_preinit(void)
29{
30 gpio_line_config(IXDP425_PCI_INTA_PIN,
31 IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW);
32 gpio_line_config(IXDP425_PCI_INTB_PIN,
33 IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW);
34 gpio_line_config(IXDP425_PCI_INTC_PIN,
35 IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW);
36 gpio_line_config(IXDP425_PCI_INTD_PIN,
37 IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW);
38
39 gpio_line_isr_clear(IXDP425_PCI_INTA_PIN);
40 gpio_line_isr_clear(IXDP425_PCI_INTB_PIN);
41 gpio_line_isr_clear(IXDP425_PCI_INTC_PIN);
42 gpio_line_isr_clear(IXDP425_PCI_INTD_PIN);
43
44 ixp4xx_pci_preinit();
45}
46
47static int __init ixdp425_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
48{
49 static int pci_irq_table[IXDP425_PCI_IRQ_LINES] = {
50 IRQ_IXDP425_PCI_INTA,
51 IRQ_IXDP425_PCI_INTB,
52 IRQ_IXDP425_PCI_INTC,
53 IRQ_IXDP425_PCI_INTD
54 };
55
56 int irq = -1;
57
58 if (slot >= 1 && slot <= IXDP425_PCI_MAX_DEV &&
59 pin >= 1 && pin <= IXDP425_PCI_IRQ_LINES) {
60 irq = pci_irq_table[(slot + pin - 2) % 4];
61 }
62
63 return irq;
64}
65
66struct hw_pci ixdp425_pci __initdata = {
67 .nr_controllers = 1,
68 .preinit = ixdp425_pci_preinit,
69 .swizzle = pci_std_swizzle,
70 .setup = ixp4xx_setup,
71 .scan = ixp4xx_scan_bus,
72 .map_irq = ixdp425_map_irq,
73};
74
75int __init ixdp425_pci_init(void)
76{
77 if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
78 machine_is_avila() || machine_is_ixdp465())
79 pci_common_init(&ixdp425_pci);
80 return 0;
81}
82
83subsys_initcall(ixdp425_pci_init);
84
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
new file mode 100644
index 000000000000..77346c1f676b
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -0,0 +1,181 @@
1/*
2 * arch/arm/mach-ixp4xx/ixdp425-setup.c
3 *
4 * IXDP425/IXCDP1100 board-setup
5 *
6 * Copyright (C) 2003-2005 MontaVista Software, Inc.
7 *
8 * Author: Deepak Saxena <dsaxena@plexity.net>
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/device.h>
14#include <linux/serial.h>
15#include <linux/tty.h>
16#include <linux/serial_8250.h>
17
18#include <asm/types.h>
19#include <asm/setup.h>
20#include <asm/memory.h>
21#include <asm/hardware.h>
22#include <asm/mach-types.h>
23#include <asm/irq.h>
24#include <asm/mach/arch.h>
25#include <asm/mach/flash.h>
26
27void __init ixdp425_map_io(void)
28{
29 ixp4xx_map_io();
30}
31
32static struct flash_platform_data ixdp425_flash_data = {
33 .map_name = "cfi_probe",
34 .width = 2,
35};
36
37static struct resource ixdp425_flash_resource = {
38 .start = IXDP425_FLASH_BASE,
39 .end = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE,
40 .flags = IORESOURCE_MEM,
41};
42
43static struct platform_device ixdp425_flash = {
44 .name = "IXP4XX-Flash",
45 .id = 0,
46 .dev = {
47 .platform_data = &ixdp425_flash_data,
48 },
49 .num_resources = 1,
50 .resource = &ixdp425_flash_resource,
51};
52
53static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = {
54 .sda_pin = IXDP425_SDA_PIN,
55 .scl_pin = IXDP425_SCL_PIN,
56};
57
58static struct platform_device ixdp425_i2c_controller = {
59 .name = "IXP4XX-I2C",
60 .id = 0,
61 .dev = {
62 .platform_data = &ixdp425_i2c_gpio_pins,
63 },
64 .num_resources = 0
65};
66
67static struct resource ixdp425_uart_resources[] = {
68 {
69 .start = IXP4XX_UART1_BASE_PHYS,
70 .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
71 .flags = IORESOURCE_MEM
72 },
73 {
74 .start = IXP4XX_UART2_BASE_PHYS,
75 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
76 .flags = IORESOURCE_MEM
77 }
78};
79
80static struct plat_serial8250_port ixdp425_uart_data[] = {
81 {
82 .mapbase = IXP4XX_UART1_BASE_PHYS,
83 .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
84 .irq = IRQ_IXP4XX_UART1,
85 .flags = UPF_BOOT_AUTOCONF,
86 .iotype = UPIO_MEM,
87 .regshift = 2,
88 .uartclk = IXP4XX_UART_XTAL,
89 },
90 {
91 .mapbase = IXP4XX_UART2_BASE_PHYS,
92 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
93 .irq = IRQ_IXP4XX_UART1,
94 .flags = UPF_BOOT_AUTOCONF,
95 .iotype = UPIO_MEM,
96 .regshift = 2,
97 .uartclk = IXP4XX_UART_XTAL,
98 }
99};
100
101static struct platform_device ixdp425_uart = {
102 .name = "serial8250",
103 .id = 0,
104 .dev.platform_data = ixdp425_uart_data,
105 .num_resources = 2,
106 .resource = ixdp425_uart_resources
107};
108
109static struct platform_device *ixdp425_devices[] __initdata = {
110 &ixdp425_i2c_controller,
111 &ixdp425_flash,
112 &ixdp425_uart
113};
114
115
116static void __init ixdp425_init(void)
117{
118 ixp4xx_sys_init();
119
120 /*
121 * IXP465 has 32MB window
122 */
123 if (machine_is_ixdp465()) {
124 ixdp425_flash_resource.end += IXDP425_FLASH_SIZE;
125 }
126
127 platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
128}
129
130MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
131 MAINTAINER("MontaVista Software, Inc.")
132 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
133 IXP4XX_PERIPHERAL_BASE_VIRT)
134 MAPIO(ixdp425_map_io)
135 INITIRQ(ixp4xx_init_irq)
136 .timer = &ixp4xx_timer,
137 BOOT_PARAMS(0x0100)
138 INIT_MACHINE(ixdp425_init)
139MACHINE_END
140
141MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
142 MAINTAINER("MontaVista Software, Inc.")
143 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
144 IXP4XX_PERIPHERAL_BASE_VIRT)
145 MAPIO(ixdp425_map_io)
146 INITIRQ(ixp4xx_init_irq)
147 .timer = &ixp4xx_timer,
148 BOOT_PARAMS(0x0100)
149 INIT_MACHINE(ixdp425_init)
150MACHINE_END
151
152MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
153 MAINTAINER("MontaVista Software, Inc.")
154 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
155 IXP4XX_PERIPHERAL_BASE_VIRT)
156 MAPIO(ixdp425_map_io)
157 INITIRQ(ixp4xx_init_irq)
158 .timer = &ixp4xx_timer,
159 BOOT_PARAMS(0x0100)
160 INIT_MACHINE(ixdp425_init)
161MACHINE_END
162
163/*
164 * Avila is functionally equivalent to IXDP425 except that it adds
165 * a CF IDE slot hanging off the expansion bus. When we have a
166 * driver for IXP4xx CF IDE with driver model support we'll move
167 * Avila to it's own setup file.
168 */
169#ifdef CONFIG_ARCH_AVILA
170MACHINE_START(AVILA, "Gateworks Avila Network Platform")
171 MAINTAINER("Deepak Saxena <dsaxena@plexity.net>")
172 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
173 IXP4XX_PERIPHERAL_BASE_VIRT)
174 MAPIO(ixdp425_map_io)
175 INITIRQ(ixp4xx_init_irq)
176 .timer = &ixp4xx_timer,
177 BOOT_PARAMS(0x0100)
178 INIT_MACHINE(ixdp425_init)
179MACHINE_END
180#endif
181
diff --git a/arch/arm/mach-ixp4xx/ixdpg425-pci.c b/arch/arm/mach-ixp4xx/ixdpg425-pci.c
new file mode 100644
index 000000000000..ce4563f00676
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/ixdpg425-pci.c
@@ -0,0 +1,66 @@
1/*
2 * arch/arch/mach-ixp4xx/ixdpg425-pci.c
3 *
4 * PCI setup routines for Intel IXDPG425 Platform
5 *
6 * Copyright (C) 2004 MontaVista Softwrae, Inc.
7 *
8 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 */
15
16#include <linux/kernel.h>
17#include <linux/pci.h>
18#include <linux/init.h>
19
20#include <asm/mach-types.h>
21#include <asm/hardware.h>
22#include <asm/irq.h>
23
24#include <asm/mach/pci.h>
25
26extern void ixp4xx_pci_preinit(void);
27extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
28extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
29
30void __init ixdpg425_pci_preinit(void)
31{
32 gpio_line_config(6, IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW);
33 gpio_line_config(7, IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW);
34
35 gpio_line_isr_clear(6);
36 gpio_line_isr_clear(7);
37
38 ixp4xx_pci_preinit();
39}
40
41static int __init ixdpg425_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
42{
43 if (slot == 12 || slot == 13)
44 return IRQ_IXP4XX_GPIO7;
45 else if (slot == 14)
46 return IRQ_IXP4XX_GPIO6;
47 else return -1;
48}
49
50struct hw_pci ixdpg425_pci __initdata = {
51 .nr_controllers = 1,
52 .preinit = ixdpg425_pci_preinit,
53 .swizzle = pci_std_swizzle,
54 .setup = ixp4xx_setup,
55 .scan = ixp4xx_scan_bus,
56 .map_irq = ixdpg425_map_irq,
57};
58
59int __init ixdpg425_pci_init(void)
60{
61 if (machine_is_ixdpg425())
62 pci_common_init(&ixdpg425_pci);
63 return 0;
64}
65
66subsys_initcall(ixdpg425_pci_init);
diff --git a/arch/arm/mach-l7200/Makefile b/arch/arm/mach-l7200/Makefile
new file mode 100644
index 000000000000..4bd8ebd70e7b
--- /dev/null
+++ b/arch/arm/mach-l7200/Makefile
@@ -0,0 +1,11 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := core.o
8obj-m :=
9obj-n :=
10obj- :=
11
diff --git a/arch/arm/mach-l7200/Makefile.boot b/arch/arm/mach-l7200/Makefile.boot
new file mode 100644
index 000000000000..6c72ecbe6b64
--- /dev/null
+++ b/arch/arm/mach-l7200/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-y := 0xf0008000
2
diff --git a/arch/arm/mach-l7200/core.c b/arch/arm/mach-l7200/core.c
new file mode 100644
index 000000000000..606ca95f8217
--- /dev/null
+++ b/arch/arm/mach-l7200/core.c
@@ -0,0 +1,89 @@
1/*
2 * linux/arch/arm/mm/mm-lusl7200.c
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Extra MM routines for L7200 architecture
7 */
8#include <linux/kernel.h>
9#include <linux/init.h>
10
11#include <asm/hardware.h>
12#include <asm/page.h>
13
14#include <asm/mach/map.h>
15#include <asm/arch/hardware.h>
16
17/*
18 * IRQ base register
19 */
20#define IRQ_BASE (IO_BASE_2 + 0x1000)
21
22/*
23 * Normal IRQ registers
24 */
25#define IRQ_STATUS (*(volatile unsigned long *) (IRQ_BASE + 0x000))
26#define IRQ_RAWSTATUS (*(volatile unsigned long *) (IRQ_BASE + 0x004))
27#define IRQ_ENABLE (*(volatile unsigned long *) (IRQ_BASE + 0x008))
28#define IRQ_ENABLECLEAR (*(volatile unsigned long *) (IRQ_BASE + 0x00c))
29#define IRQ_SOFT (*(volatile unsigned long *) (IRQ_BASE + 0x010))
30#define IRQ_SOURCESEL (*(volatile unsigned long *) (IRQ_BASE + 0x018))
31
32/*
33 * Fast IRQ registers
34 */
35#define FIQ_STATUS (*(volatile unsigned long *) (IRQ_BASE + 0x100))
36#define FIQ_RAWSTATUS (*(volatile unsigned long *) (IRQ_BASE + 0x104))
37#define FIQ_ENABLE (*(volatile unsigned long *) (IRQ_BASE + 0x108))
38#define FIQ_ENABLECLEAR (*(volatile unsigned long *) (IRQ_BASE + 0x10c))
39#define FIQ_SOFT (*(volatile unsigned long *) (IRQ_BASE + 0x110))
40#define FIQ_SOURCESEL (*(volatile unsigned long *) (IRQ_BASE + 0x118))
41
42static void l7200_mask_irq(unsigned int irq)
43{
44 IRQ_ENABLECLEAR = 1 << irq;
45}
46
47static void l7200_unmask_irq(unsigned int irq)
48{
49 IRQ_ENABLE = 1 << irq;
50}
51
52static void __init l7200_init_irq(void)
53{
54 int irq;
55
56 IRQ_ENABLECLEAR = 0xffffffff; /* clear all interrupt enables */
57 FIQ_ENABLECLEAR = 0xffffffff; /* clear all fast interrupt enables */
58
59 for (irq = 0; irq < NR_IRQS; irq++) {
60 irq_desc[irq].valid = 1;
61 irq_desc[irq].probe_ok = 1;
62 irq_desc[irq].mask_ack = l7200_mask_irq;
63 irq_desc[irq].mask = l7200_mask_irq;
64 irq_desc[irq].unmask = l7200_unmask_irq;
65 }
66
67 init_FIQ();
68}
69
70static struct map_desc l7200_io_desc[] __initdata = {
71 { IO_BASE, IO_START, IO_SIZE, MT_DEVICE },
72 { IO_BASE_2, IO_START_2, IO_SIZE_2, MT_DEVICE },
73 { AUX_BASE, AUX_START, AUX_SIZE, MT_DEVICE },
74 { FLASH1_BASE, FLASH1_START, FLASH1_SIZE, MT_DEVICE },
75 { FLASH2_BASE, FLASH2_START, FLASH2_SIZE, MT_DEVICE }
76};
77
78static void __init l7200_map_io(void)
79{
80 iotable_init(l7200_io_desc, ARRAY_SIZE(l7200_io_desc));
81}
82
83MACHINE_START(L7200, "LinkUp Systems L7200")
84 MAINTAINER("Steve Hill / Scott McConnell")
85 BOOT_MEM(0xf0000000, 0x80040000, 0xd0000000)
86 MAPIO(l7200_map_io)
87 INITIRQ(l7200_init_irq)
88MACHINE_END
89
diff --git a/arch/arm/mach-lh7a40x/Kconfig b/arch/arm/mach-lh7a40x/Kconfig
new file mode 100644
index 000000000000..8a17867a6a24
--- /dev/null
+++ b/arch/arm/mach-lh7a40x/Kconfig
@@ -0,0 +1,70 @@
1if ARCH_LH7A40X
2
3menu "LH7A40X Implementations"
4
5config MACH_KEV7A400
6 bool "KEV7A400"
7 select ARCH_LH7A400
8 help
9 Say Y here if you are using the Sharp KEV7A400 development
10 board. This hardware is discontinued, so I'd be very
11 suprised if you wanted this option.
12
13config MACH_LPD7A400
14 bool "LPD7A400 Card Engine"
15 select ARCH_LH7A400
16# select IDE_POLL
17 help
18 Say Y here if you are using Logic Product Development's
19 LPD7A400 CardEngine. For the time being, the LPD7A400 and
20 LPD7A404 options are mutually exclusive.
21
22config MACH_LPD7A404
23 bool "LPD7A404 Card Engine"
24 select ARCH_LH7A404
25# select IDE_POLL
26 help
27 Say Y here if you are using Logic Product Development's
28 LPD7A404 CardEngine. For the time being, the LPD7A400 and
29 LPD7A404 options are mutually exclusive.
30
31config ARCH_LH7A400
32 bool
33
34config ARCH_LH7A404
35 bool
36
37config LH7A40X_CONTIGMEM
38 bool "Disable NUMA Support"
39 depends on ARCH_LH7A40X
40 help
41 Say Y here if your bootloader sets the SROMLL bit(s) in
42 the SDRAM controller, organizing memory as a contiguous
43 array. This option will disable CONFIG_DISCONTIGMEM and
44 force the kernel to manage all memory in one node.
45
46 Setting this option incorrectly may prevent the kernel from
47 booting. It is OK to leave it N.
48
49 For more information, consult
50 <file:Documentation/arm/Sharp-LH/SDRAM>.
51
52config LH7A40X_ONE_BANK_PER_NODE
53 bool "Optimize NUMA Node Tables for Size"
54 depends on ARCH_LH7A40X && !LH7A40X_CONTIGMEM
55 help
56 Say Y here to produce compact memory node tables. By
57 default pairs of adjacent physical RAM banks are managed
58 together in a single node, incurring some wasted overhead
59 in the node tables, however also maintaining compatibility
60 with systems where physical memory is truly contiguous.
61
62 Setting this option incorrectly may prevent the kernel from
63 booting. It is OK to leave it N.
64
65 For more information, consult
66 <file:Documentation/arm/Sharp-LH/SDRAM>.
67
68endmenu
69
70endif
diff --git a/arch/arm/mach-lh7a40x/Makefile b/arch/arm/mach-lh7a40x/Makefile
new file mode 100644
index 000000000000..e90512dbc2d6
--- /dev/null
+++ b/arch/arm/mach-lh7a40x/Makefile
@@ -0,0 +1,14 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := time.o
8obj-$(CONFIG_MACH_KEV7A400) += arch-kev7a400.o irq-lh7a400.o
9obj-$(CONFIG_MACH_LPD7A400) += arch-lpd7a40x.o irq-lh7a400.o
10obj-$(CONFIG_MACH_LPD7A404) += arch-lpd7a40x.o irq-lh7a404.o
11
12obj-m :=
13obj-n :=
14obj- :=
diff --git a/arch/arm/mach-lh7a40x/Makefile.boot b/arch/arm/mach-lh7a40x/Makefile.boot
new file mode 100644
index 000000000000..af941be076eb
--- /dev/null
+++ b/arch/arm/mach-lh7a40x/Makefile.boot
@@ -0,0 +1,4 @@
1 zreladdr-y := 0xc0008000
2params_phys-y := 0xc0000100
3initrd_phys-y := 0xc4000000
4
diff --git a/arch/arm/mach-lh7a40x/arch-kev7a400.c b/arch/arm/mach-lh7a40x/arch-kev7a400.c
new file mode 100644
index 000000000000..be5d17fe9dcb
--- /dev/null
+++ b/arch/arm/mach-lh7a40x/arch-kev7a400.c
@@ -0,0 +1,111 @@
1/* arch/arm/mach-lh7a40x/arch-kev7a400.c
2 *
3 * Copyright (C) 2004 Logic Product Development
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 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/tty.h>
12#include <linux/init.h>
13#include <linux/device.h>
14#include <linux/interrupt.h>
15
16#include <asm/hardware.h>
17#include <asm/setup.h>
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <asm/irq.h>
21#include <asm/mach/irq.h>
22#include <asm/mach/map.h>
23
24#include "common.h"
25
26 /* This function calls the board specific IRQ initialization function. */
27
28static struct map_desc kev7a400_io_desc[] __initdata = {
29 { IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE },
30 { CPLD_VIRT, CPLD_PHYS, CPLD_SIZE, MT_DEVICE },
31};
32
33void __init kev7a400_map_io(void)
34{
35 iotable_init (kev7a400_io_desc, ARRAY_SIZE (kev7a400_io_desc));
36}
37
38static u16 CPLD_IRQ_mask; /* Mask for CPLD IRQs, 1 == unmasked */
39
40static void kev7a400_ack_cpld_irq (u32 irq)
41{
42 CPLD_CL_INT = 1 << (irq - IRQ_KEV7A400_CPLD);
43}
44
45static void kev7a400_mask_cpld_irq (u32 irq)
46{
47 CPLD_IRQ_mask &= ~(1 << (irq - IRQ_KEV7A400_CPLD));
48 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask;
49}
50
51static void kev7a400_unmask_cpld_irq (u32 irq)
52{
53 CPLD_IRQ_mask |= 1 << (irq - IRQ_KEV7A400_CPLD);
54 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask;
55}
56
57static struct irqchip kev7a400_cpld_chip = {
58 .ack = kev7a400_ack_cpld_irq,
59 .mask = kev7a400_mask_cpld_irq,
60 .unmask = kev7a400_unmask_cpld_irq,
61};
62
63
64static void kev7a400_cpld_handler (unsigned int irq, struct irqdesc *desc,
65 struct pt_regs *regs)
66{
67 u32 mask = CPLD_LATCHED_INTS;
68 irq = IRQ_KEV7A400_CPLD;
69 for (; mask; mask >>= 1, ++irq) {
70 if (mask & 1)
71 desc[irq].handle (irq, desc, regs);
72 }
73}
74
75void __init lh7a40x_init_board_irq (void)
76{
77 int irq;
78
79 for (irq = IRQ_KEV7A400_CPLD;
80 irq < IRQ_KEV7A400_CPLD + NR_IRQ_BOARD; ++irq) {
81 set_irq_chip (irq, &kev7a400_cpld_chip);
82 set_irq_handler (irq, do_edge_IRQ);
83 set_irq_flags (irq, IRQF_VALID);
84 }
85 set_irq_chained_handler (IRQ_CPLD, kev7a400_cpld_handler);
86
87 /* Clear all CPLD interrupts */
88 CPLD_CL_INT = 0xff; /* CPLD_INTR_MMC_CD | CPLD_INTR_ETH_INT; */
89
90 GPIO_GPIOINTEN = 0; /* Disable all GPIO interrupts */
91 barrier();
92
93#if 0
94 GPIO_INTTYPE1
95 = (GPIO_INTR_PCC1_CD | GPIO_INTR_PCC1_CD); /* Edge trig. */
96 GPIO_INTTYPE2 = 0; /* Falling edge & low-level */
97 GPIO_GPIOFEOI = 0xff; /* Clear all GPIO interrupts */
98 GPIO_GPIOINTEN = 0xff; /* Enable all GPIO interrupts */
99
100 init_FIQ();
101#endif
102}
103
104MACHINE_START (KEV7A400, "Sharp KEV7a400")
105 MAINTAINER ("Marc Singer")
106 BOOT_MEM (0xc0000000, 0x80000000, io_p2v (0x80000000))
107 BOOT_PARAMS (0xc0000100)
108 MAPIO (kev7a400_map_io)
109 INITIRQ (lh7a400_init_irq)
110 .timer = &lh7a40x_timer,
111MACHINE_END
diff --git a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
new file mode 100644
index 000000000000..c823447a150f
--- /dev/null
+++ b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
@@ -0,0 +1,286 @@
1/* arch/arm/mach-lh7a40x/arch-lpd7a40x.c
2 *
3 * Copyright (C) 2004 Logic Product Development
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 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/tty.h>
12#include <linux/init.h>
13#include <linux/device.h>
14#include <linux/interrupt.h>
15
16#include <asm/hardware.h>
17#include <asm/setup.h>
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <asm/irq.h>
21#include <asm/mach/irq.h>
22#include <asm/mach/map.h>
23
24#include "common.h"
25
26static struct resource smc91x_resources[] = {
27 [0] = {
28 .start = CPLD00_PHYS,
29 .end = CPLD00_PHYS + CPLD00_SIZE - 1, /* Only needs 16B */
30 .flags = IORESOURCE_MEM,
31 },
32
33 [1] = {
34 .start = IRQ_LPD7A40X_ETH_INT,
35 .end = IRQ_LPD7A40X_ETH_INT,
36 .flags = IORESOURCE_IRQ,
37 },
38
39};
40
41static struct platform_device smc91x_device = {
42 .name = "smc91x",
43 .id = 0,
44 .num_resources = ARRAY_SIZE(smc91x_resources),
45 .resource = smc91x_resources,
46};
47
48static struct resource lh7a40x_usbclient_resources[] = {
49 [0] = {
50 .start = USB_PHYS,
51 .end = (USB_PHYS + 0xFF),
52 .flags = IORESOURCE_MEM,
53 },
54 [1] = {
55 .start = IRQ_USBINTR,
56 .end = IRQ_USBINTR,
57 .flags = IORESOURCE_IRQ,
58 },
59};
60
61static u64 lh7a40x_usbclient_dma_mask = 0xffffffffUL;
62
63static struct platform_device lh7a40x_usbclient_device = {
64 .name = "lh7a40x_udc",
65 .id = 0,
66 .dev = {
67 .dma_mask = &lh7a40x_usbclient_dma_mask,
68 .coherent_dma_mask = 0xffffffffUL,
69 },
70 .num_resources = ARRAY_SIZE (lh7a40x_usbclient_resources),
71 .resource = lh7a40x_usbclient_resources,
72};
73
74#if defined (CONFIG_ARCH_LH7A404)
75
76static struct resource lh7a404_usbhost_resources [] = {
77 [0] = {
78 .start = USBH_PHYS,
79 .end = (USBH_PHYS + 0xFF),
80 .flags = IORESOURCE_MEM,
81 },
82 [1] = {
83 .start = IRQ_USHINTR,
84 .end = IRQ_USHINTR,
85 .flags = IORESOURCE_IRQ,
86 },
87};
88
89static u64 lh7a404_usbhost_dma_mask = 0xffffffffUL;
90
91static struct platform_device lh7a404_usbhost_device = {
92 .name = "lh7a404-ohci",
93 .id = 0,
94 .dev = {
95 .dma_mask = &lh7a404_usbhost_dma_mask,
96 .coherent_dma_mask = 0xffffffffUL,
97 },
98 .num_resources = ARRAY_SIZE (lh7a404_usbhost_resources),
99 .resource = lh7a404_usbhost_resources,
100};
101
102#endif
103
104static struct platform_device *lpd7a40x_devs[] __initdata = {
105 &smc91x_device,
106 &lh7a40x_usbclient_device,
107#if defined (CONFIG_ARCH_LH7A404)
108 &lh7a404_usbhost_device,
109#endif
110};
111
112extern void lpd7a400_map_io (void);
113
114static void __init lpd7a40x_init (void)
115{
116 CPLD_CONTROL |= (1<<6); /* Mask USB1 connection IRQ */
117 CPLD_CONTROL &= ~(0
118 | (1<<1) /* Disable LCD */
119 | (1<<0) /* Enable WLAN */
120 );
121
122 platform_add_devices (lpd7a40x_devs, ARRAY_SIZE (lpd7a40x_devs));
123}
124
125static void lh7a40x_ack_cpld_irq (u32 irq)
126{
127 /* CPLD doesn't have ack capability */
128}
129
130static void lh7a40x_mask_cpld_irq (u32 irq)
131{
132 switch (irq) {
133 case IRQ_LPD7A40X_ETH_INT:
134 CPLD_INTERRUPTS = CPLD_INTERRUPTS | 0x4;
135 break;
136 case IRQ_LPD7A400_TS:
137 CPLD_INTERRUPTS = CPLD_INTERRUPTS | 0x8;
138 break;
139 }
140}
141
142static void lh7a40x_unmask_cpld_irq (u32 irq)
143{
144 switch (irq) {
145 case IRQ_LPD7A40X_ETH_INT:
146 CPLD_INTERRUPTS = CPLD_INTERRUPTS & ~ 0x4;
147 break;
148 case IRQ_LPD7A400_TS:
149 CPLD_INTERRUPTS = CPLD_INTERRUPTS & ~ 0x8;
150 break;
151 }
152}
153
154static struct irqchip lpd7a40x_cpld_chip = {
155 .ack = lh7a40x_ack_cpld_irq,
156 .mask = lh7a40x_mask_cpld_irq,
157 .unmask = lh7a40x_unmask_cpld_irq,
158};
159
160static void lpd7a40x_cpld_handler (unsigned int irq, struct irqdesc *desc,
161 struct pt_regs *regs)
162{
163 unsigned int mask = CPLD_INTERRUPTS;
164
165 desc->chip->ack (irq);
166
167 if ((mask & 0x1) == 0) /* WLAN */
168 IRQ_DISPATCH (IRQ_LPD7A40X_ETH_INT);
169
170 if ((mask & 0x2) == 0) /* Touch */
171 IRQ_DISPATCH (IRQ_LPD7A400_TS);
172
173 desc->chip->unmask (irq); /* Level-triggered need this */
174}
175
176
177void __init lh7a40x_init_board_irq (void)
178{
179 int irq;
180
181 /* Rev A (v2.8): PF0, PF1, PF2, and PF3 are available IRQs.
182 PF7 supports the CPLD.
183 Rev B (v3.4): PF0, PF1, and PF2 are available IRQs.
184 PF3 supports the CPLD.
185 (Some) LPD7A404 prerelease boards report a version
186 number of 0x16, but we force an override since the
187 hardware is of the newer variety.
188 */
189
190 unsigned char cpld_version = CPLD_REVISION;
191 int pinCPLD = (cpld_version == 0x28) ? 7 : 3;
192
193#if defined CONFIG_MACH_LPD7A404
194 cpld_version = 0x34; /* Coerce LPD7A404 to RevB */
195#endif
196
197 /* First, configure user controlled GPIOF interrupts */
198
199 GPIO_PFDD &= ~0x0f; /* PF0-3 are inputs */
200 GPIO_INTTYPE1 &= ~0x0f; /* PF0-3 are level triggered */
201 GPIO_INTTYPE2 &= ~0x0f; /* PF0-3 are active low */
202 barrier ();
203 GPIO_GPIOFINTEN |= 0x0f; /* Enable PF0, PF1, PF2, and PF3 IRQs */
204
205 /* Then, configure CPLD interrupt */
206
207 CPLD_INTERRUPTS = 0x9c; /* Disable all CPLD interrupts */
208 GPIO_PFDD &= ~(1 << pinCPLD); /* Make input */
209 GPIO_INTTYPE1 |= (1 << pinCPLD); /* Edge triggered */
210 GPIO_INTTYPE2 &= ~(1 << pinCPLD); /* Active low */
211 barrier ();
212 GPIO_GPIOFINTEN |= (1 << pinCPLD); /* Enable */
213
214 /* Cascade CPLD interrupts */
215
216 for (irq = IRQ_BOARD_START;
217 irq < IRQ_BOARD_START + NR_IRQ_BOARD; ++irq) {
218 set_irq_chip (irq, &lpd7a40x_cpld_chip);
219 set_irq_handler (irq, do_edge_IRQ);
220 set_irq_flags (irq, IRQF_VALID);
221 }
222
223 set_irq_chained_handler ((cpld_version == 0x28)
224 ? IRQ_CPLD_V28
225 : IRQ_CPLD_V34,
226 lpd7a40x_cpld_handler);
227}
228
229static struct map_desc lpd7a400_io_desc[] __initdata = {
230 { IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE },
231 /* Mapping added to work around chip select problems */
232 { IOBARRIER_VIRT, IOBARRIER_PHYS, IOBARRIER_SIZE, MT_DEVICE },
233 { CF_VIRT, CF_PHYS, CF_SIZE, MT_DEVICE },
234 /* This mapping is redundant since the smc driver performs another. */
235/* { CPLD00_VIRT, CPLD00_PHYS, CPLD00_SIZE, MT_DEVICE }, */
236 { CPLD02_VIRT, CPLD02_PHYS, CPLD02_SIZE, MT_DEVICE },
237 { CPLD06_VIRT, CPLD06_PHYS, CPLD06_SIZE, MT_DEVICE },
238 { CPLD08_VIRT, CPLD08_PHYS, CPLD08_SIZE, MT_DEVICE },
239 { CPLD0C_VIRT, CPLD0C_PHYS, CPLD0C_SIZE, MT_DEVICE },
240 { CPLD0E_VIRT, CPLD0E_PHYS, CPLD0E_SIZE, MT_DEVICE },
241 { CPLD10_VIRT, CPLD10_PHYS, CPLD10_SIZE, MT_DEVICE },
242 { CPLD12_VIRT, CPLD12_PHYS, CPLD12_SIZE, MT_DEVICE },
243 { CPLD14_VIRT, CPLD14_PHYS, CPLD14_SIZE, MT_DEVICE },
244 { CPLD16_VIRT, CPLD16_PHYS, CPLD16_SIZE, MT_DEVICE },
245 { CPLD18_VIRT, CPLD18_PHYS, CPLD18_SIZE, MT_DEVICE },
246 { CPLD1A_VIRT, CPLD1A_PHYS, CPLD1A_SIZE, MT_DEVICE },
247};
248
249void __init
250lpd7a400_map_io(void)
251{
252 iotable_init (lpd7a400_io_desc, ARRAY_SIZE (lpd7a400_io_desc));
253
254 /* Fixup (improve) Static Memory Controller settings */
255 SMC_BCR0 = 0x200039af; /* Boot Flash */
256 SMC_BCR6 = 0x1000fbe0; /* CPLD */
257 SMC_BCR7 = 0x1000b2c2; /* Compact Flash */
258}
259
260#ifdef CONFIG_MACH_LPD7A400
261
262MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10")
263 MAINTAINER ("Marc Singer")
264 BOOT_MEM (0xc0000000, 0x80000000, io_p2v (0x80000000))
265 BOOT_PARAMS (0xc0000100)
266 MAPIO (lpd7a400_map_io)
267 INITIRQ (lh7a400_init_irq)
268 .timer = &lh7a40x_timer,
269 INIT_MACHINE (lpd7a40x_init)
270MACHINE_END
271
272#endif
273
274#ifdef CONFIG_MACH_LPD7A404
275
276MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10")
277 MAINTAINER ("Marc Singer")
278 BOOT_MEM (0xc0000000, 0x80000000, io_p2v (0x80000000))
279 BOOT_PARAMS (0xc0000100)
280 MAPIO (lpd7a400_map_io)
281 INITIRQ (lh7a404_init_irq)
282 .timer = &lh7a40x_timer,
283 INIT_MACHINE (lpd7a40x_init)
284MACHINE_END
285
286#endif
diff --git a/arch/arm/mach-lh7a40x/common.h b/arch/arm/mach-lh7a40x/common.h
new file mode 100644
index 000000000000..beda7c2602fb
--- /dev/null
+++ b/arch/arm/mach-lh7a40x/common.h
@@ -0,0 +1,16 @@
1/* arch/arm/mach-lh7a40x/common.h
2 *
3 * Copyright (C) 2004 Marc Singer
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 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11extern struct sys_timer lh7a40x_timer;
12
13extern void lh7a400_init_irq (void);
14extern void lh7a404_init_irq (void);
15
16#define IRQ_DISPATCH(irq) irq_desc[irq].handle ((irq), &irq_desc[irq], regs)
diff --git a/arch/arm/mach-lh7a40x/irq-kev7a400.c b/arch/arm/mach-lh7a40x/irq-kev7a400.c
new file mode 100644
index 000000000000..691bb09232a5
--- /dev/null
+++ b/arch/arm/mach-lh7a40x/irq-kev7a400.c
@@ -0,0 +1,92 @@
1/* arch/arm/mach-lh7a40x/irq-kev7a400.c
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
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 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/interrupt.h>
12#include <linux/init.h>
13
14#include <asm/irq.h>
15#include <asm/mach/irq.h>
16#include <asm/mach/hardware.h>
17#include <asm/mach/irqs.h>
18
19
20 /* KEV7a400 CPLD IRQ handling */
21
22static u16 CPLD_IRQ_mask; /* Mask for CPLD IRQs, 1 == unmasked */
23
24static void
25lh7a400_ack_cpld_irq (u32 irq)
26{
27 CPLD_CL_INT = 1 << (irq - IRQ_KEV7A400_CPLD);
28}
29
30static void
31lh7a400_mask_cpld_irq (u32 irq)
32{
33 CPLD_IRQ_mask &= ~(1 << (irq - IRQ_KEV7A400_CPLD));
34 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask;
35}
36
37static void
38lh7a400_unmask_cpld_irq (u32 irq)
39{
40 CPLD_IRQ_mask |= 1 << (irq - IRQ_KEV7A400_CPLD);
41 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask;
42}
43
44static struct
45irqchip lh7a400_cpld_chip = {
46 .ack = lh7a400_ack_cpld_irq,
47 .mask = lh7a400_mask_cpld_irq,
48 .unmask = lh7a400_unmask_cpld_irq,
49};
50
51static void
52lh7a400_cpld_handler (unsigned int irq, struct irqdesc *desc,
53 struct pt_regs *regs)
54{
55 u32 mask = CPLD_LATCHED_INTS;
56 irq = IRQ_KEV_7A400_CPLD;
57 for (; mask; mask >>= 1, ++irq) {
58 if (mask & 1)
59 desc[irq].handle (irq, desc, regs);
60 }
61}
62
63 /* IRQ initialization */
64
65void __init
66lh7a400_init_board_irq (void)
67{
68 int irq;
69
70 for (irq = IRQ_KEV7A400_CPLD;
71 irq < IRQ_KEV7A400_CPLD + NR_IRQ_KEV7A400_CPLD; ++irq) {
72 set_irq_chip (irq, &lh7a400_cpld_chip);
73 set_irq_handler (irq, do_edge_IRQ);
74 set_irq_flags (irq, IRQF_VALID);
75 }
76 set_irq_chained_handler (IRQ_CPLD, kev7a400_cpld_handler);
77
78 /* Clear all CPLD interrupts */
79 CPLD_CL_INT = 0xff; /* CPLD_INTR_MMC_CD | CPLD_INTR_ETH_INT; */
80
81 /* *** FIXME CF enabled in ide-probe.c */
82
83 GPIO_GPIOINTEN = 0; /* Disable all GPIO interrupts */
84 barrier();
85 GPIO_INTTYPE1
86 = (GPIO_INTR_PCC1_CD | GPIO_INTR_PCC1_CD); /* Edge trig. */
87 GPIO_INTTYPE2 = 0; /* Falling edge & low-level */
88 GPIO_GPIOFEOI = 0xff; /* Clear all GPIO interrupts */
89 GPIO_GPIOINTEN = 0xff; /* Enable all GPIO interrupts */
90
91 init_FIQ();
92}
diff --git a/arch/arm/mach-lh7a40x/irq-lh7a400.c b/arch/arm/mach-lh7a40x/irq-lh7a400.c
new file mode 100644
index 000000000000..f334d81c2cd8
--- /dev/null
+++ b/arch/arm/mach-lh7a40x/irq-lh7a400.c
@@ -0,0 +1,90 @@
1/* arch/arm/mach-lh7a40x/irq-lh7a400.c
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
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 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/init.h>
12#include <linux/module.h>
13#include <linux/interrupt.h>
14#include <linux/ptrace.h>
15
16#include <asm/hardware.h>
17#include <asm/irq.h>
18#include <asm/mach/irq.h>
19#include <asm/arch/irq.h>
20#include <asm/arch/irqs.h>
21
22
23 /* CPU IRQ handling */
24
25static void lh7a400_mask_irq (u32 irq)
26{
27 INTC_INTENC = (1 << irq);
28}
29
30static void lh7a400_unmask_irq (u32 irq)
31{
32 INTC_INTENS = (1 << irq);
33}
34
35static void lh7a400_ack_gpio_irq (u32 irq)
36{
37 GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (irq));
38 INTC_INTENC = (1 << irq);
39}
40
41static struct irqchip lh7a400_internal_chip = {
42 .ack = lh7a400_mask_irq, /* Level triggering -> mask is ack */
43 .mask = lh7a400_mask_irq,
44 .unmask = lh7a400_unmask_irq,
45};
46
47static struct irqchip lh7a400_gpio_chip = {
48 .ack = lh7a400_ack_gpio_irq,
49 .mask = lh7a400_mask_irq,
50 .unmask = lh7a400_unmask_irq,
51};
52
53
54 /* IRQ initialization */
55
56void __init lh7a400_init_irq (void)
57{
58 int irq;
59
60 INTC_INTENC = 0xffffffff; /* Disable all interrupts */
61 GPIO_GPIOFINTEN = 0x00; /* Disable all GPIOF interrupts */
62 barrier ();
63
64 for (irq = 0; irq < NR_IRQS; ++irq) {
65 switch (irq) {
66 case IRQ_GPIO0INTR:
67 case IRQ_GPIO1INTR:
68 case IRQ_GPIO2INTR:
69 case IRQ_GPIO3INTR:
70 case IRQ_GPIO4INTR:
71 case IRQ_GPIO5INTR:
72 case IRQ_GPIO6INTR:
73 case IRQ_GPIO7INTR:
74 set_irq_chip (irq, &lh7a400_gpio_chip);
75 set_irq_handler (irq, do_level_IRQ); /* OK default */
76 break;
77 default:
78 set_irq_chip (irq, &lh7a400_internal_chip);
79 set_irq_handler (irq, do_level_IRQ);
80 }
81 set_irq_flags (irq, IRQF_VALID);
82 }
83
84 lh7a40x_init_board_irq ();
85
86/* *** FIXME: the LH7a400 does use FIQ interrupts in some cases. For
87 the time being, these are not initialized. */
88
89/* init_FIQ(); */
90}
diff --git a/arch/arm/mach-lh7a40x/irq-lh7a404.c b/arch/arm/mach-lh7a40x/irq-lh7a404.c
new file mode 100644
index 000000000000..122fadabc97d
--- /dev/null
+++ b/arch/arm/mach-lh7a40x/irq-lh7a404.c
@@ -0,0 +1,158 @@
1/* arch/arm/mach-lh7a40x/irq-lh7a404.c
2 *
3 * Copyright (C) 2004 Logic Product Development
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 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/init.h>
12#include <linux/module.h>
13#include <linux/interrupt.h>
14#include <linux/ptrace.h>
15
16#include <asm/hardware.h>
17#include <asm/irq.h>
18#include <asm/mach/irq.h>
19#include <asm/arch/irq.h>
20#include <asm/arch/irqs.h>
21
22#define USE_PRIORITIES
23
24/* See Documentation/arm/Sharp-LH/VectoredInterruptController for more
25 * information on using the vectored interrupt controller's
26 * prioritizing feature. */
27
28static unsigned char irq_pri_vic1[] = {
29#if defined (USE_PRIORITIES)
30IRQ_GPIO3INTR,
31#endif
32};
33static unsigned char irq_pri_vic2[] = {
34#if defined (USE_PRIORITIES)
35 IRQ_T3UI, IRQ_GPIO7INTR,
36 IRQ_UART1INTR, IRQ_UART2INTR, IRQ_UART3INTR,
37#endif
38};
39
40 /* CPU IRQ handling */
41
42static void lh7a404_vic1_mask_irq (u32 irq)
43{
44 VIC1_INTENCLR = (1 << irq);
45}
46
47static void lh7a404_vic1_unmask_irq (u32 irq)
48{
49 VIC1_INTEN = (1 << irq);
50}
51
52static void lh7a404_vic2_mask_irq (u32 irq)
53{
54 VIC2_INTENCLR = (1 << (irq - 32));
55}
56
57static void lh7a404_vic2_unmask_irq (u32 irq)
58{
59 VIC2_INTEN = (1 << (irq - 32));
60}
61
62static void lh7a404_vic1_ack_gpio_irq (u32 irq)
63{
64 GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (irq));
65 VIC1_INTENCLR = (1 << irq);
66}
67
68static void lh7a404_vic2_ack_gpio_irq (u32 irq)
69{
70 GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (irq));
71 VIC2_INTENCLR = (1 << irq);
72}
73
74static struct irqchip lh7a404_vic1_chip = {
75 .ack = lh7a404_vic1_mask_irq, /* Because level-triggered */
76 .mask = lh7a404_vic1_mask_irq,
77 .unmask = lh7a404_vic1_unmask_irq,
78};
79
80static struct irqchip lh7a404_vic2_chip = {
81 .ack = lh7a404_vic2_mask_irq, /* Because level-triggered */
82 .mask = lh7a404_vic2_mask_irq,
83 .unmask = lh7a404_vic2_unmask_irq,
84};
85
86static struct irqchip lh7a404_gpio_vic1_chip = {
87 .ack = lh7a404_vic1_ack_gpio_irq,
88 .mask = lh7a404_vic1_mask_irq,
89 .unmask = lh7a404_vic1_unmask_irq,
90};
91
92static struct irqchip lh7a404_gpio_vic2_chip = {
93 .ack = lh7a404_vic2_ack_gpio_irq,
94 .mask = lh7a404_vic2_mask_irq,
95 .unmask = lh7a404_vic2_unmask_irq,
96};
97
98 /* IRQ initialization */
99
100void __init lh7a404_init_irq (void)
101{
102 int irq;
103
104 VIC1_INTENCLR = 0xffffffff;
105 VIC2_INTENCLR = 0xffffffff;
106 VIC1_INTSEL = 0; /* All IRQs */
107 VIC2_INTSEL = 0; /* All IRQs */
108 VIC1_NVADDR = VA_VIC1DEFAULT;
109 VIC2_NVADDR = VA_VIC2DEFAULT;
110 VIC1_VECTADDR = 0;
111 VIC2_VECTADDR = 0;
112
113 GPIO_GPIOFINTEN = 0x00; /* Disable all GPIOF interrupts */
114 barrier ();
115
116 /* Install prioritized interrupts, if there are any. */
117 /* The | 0x20*/
118 for (irq = 0; irq < 16; ++irq) {
119 (&VIC1_VAD0)[irq]
120 = (irq < ARRAY_SIZE (irq_pri_vic1))
121 ? (irq_pri_vic1[irq] | VA_VECTORED) : 0;
122 (&VIC1_VECTCNTL0)[irq]
123 = (irq < ARRAY_SIZE (irq_pri_vic1))
124 ? (irq_pri_vic1[irq] | VIC_CNTL_ENABLE) : 0;
125 (&VIC2_VAD0)[irq]
126 = (irq < ARRAY_SIZE (irq_pri_vic2))
127 ? (irq_pri_vic2[irq] | VA_VECTORED) : 0;
128 (&VIC2_VECTCNTL0)[irq]
129 = (irq < ARRAY_SIZE (irq_pri_vic2))
130 ? (irq_pri_vic2[irq] | VIC_CNTL_ENABLE) : 0;
131 }
132
133 for (irq = 0; irq < NR_IRQS; ++irq) {
134 switch (irq) {
135 case IRQ_GPIO0INTR:
136 case IRQ_GPIO1INTR:
137 case IRQ_GPIO2INTR:
138 case IRQ_GPIO3INTR:
139 case IRQ_GPIO4INTR:
140 case IRQ_GPIO5INTR:
141 case IRQ_GPIO6INTR:
142 case IRQ_GPIO7INTR:
143 set_irq_chip (irq, irq < 32
144 ? &lh7a404_gpio_vic1_chip
145 : &lh7a404_gpio_vic2_chip);
146 set_irq_handler (irq, do_level_IRQ); /* OK default */
147 break;
148 default:
149 set_irq_chip (irq, irq < 32
150 ? &lh7a404_vic1_chip
151 : &lh7a404_vic2_chip);
152 set_irq_handler (irq, do_level_IRQ);
153 }
154 set_irq_flags (irq, IRQF_VALID);
155 }
156
157 lh7a40x_init_board_irq ();
158}
diff --git a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c b/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
new file mode 100644
index 000000000000..6262d449120c
--- /dev/null
+++ b/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
@@ -0,0 +1,128 @@
1/* arch/arm/mach-lh7a40x/irq-lpd7a40x.c
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 * Copyright (C) 2004 Logic Product Development
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 * version 2 as published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/init.h>
13#include <linux/module.h>
14#include <linux/interrupt.h>
15#include <linux/ptrace.h>
16
17#include <asm/hardware.h>
18#include <asm/irq.h>
19#include <asm/mach/irq.h>
20#include <asm/arch/irqs.h>
21
22
23static void lh7a40x_ack_cpld_irq (u32 irq)
24{
25 /* CPLD doesn't have ack capability */
26}
27
28static void lh7a40x_mask_cpld_irq (u32 irq)
29{
30 switch (irq) {
31 case IRQ_LPD7A40X_ETH_INT:
32 CPLD_INTERRUPTS = CPLD_INTERRUPTS | 0x4;
33 break;
34 case IRQ_LPD7A400_TS:
35 CPLD_INTERRUPTS = CPLD_INTERRUPTS | 0x8;
36 break;
37 }
38}
39
40static void lh7a40x_unmask_cpld_irq (u32 irq)
41{
42 switch (irq) {
43 case IRQ_LPD7A40X_ETH_INT:
44 CPLD_INTERRUPTS = CPLD_INTERRUPTS & ~ 0x4;
45 break;
46 case IRQ_LPD7A400_TS:
47 CPLD_INTERRUPTS = CPLD_INTERRUPTS & ~ 0x8;
48 break;
49 }
50}
51
52static struct irqchip lh7a40x_cpld_chip = {
53 .ack = lh7a40x_ack_cpld_irq,
54 .mask = lh7a40x_mask_cpld_irq,
55 .unmask = lh7a40x_unmask_cpld_irq,
56};
57
58static void lh7a40x_cpld_handler (unsigned int irq, struct irqdesc *desc,
59 struct pt_regs *regs)
60{
61 unsigned int mask = CPLD_INTERRUPTS;
62
63 desc->chip->ack (irq);
64
65 if ((mask & 0x1) == 0) /* WLAN */
66 IRQ_DISPATCH (IRQ_LPD7A40X_ETH_INT);
67
68 if ((mask & 0x2) == 0) /* Touch */
69 IRQ_DISPATCH (IRQ_LPD7A400_TS);
70
71 desc->chip->unmask (irq); /* Level-triggered need this */
72}
73
74
75 /* IRQ initialization */
76
77void __init lh7a40x_init_board_irq (void)
78{
79 int irq;
80
81 /* Rev A (v2.8): PF0, PF1, PF2, and PF3 are available IRQs.
82 PF7 supports the CPLD.
83 Rev B (v3.4): PF0, PF1, and PF2 are available IRQs.
84 PF3 supports the CPLD.
85 (Some) LPD7A404 prerelease boards report a version
86 number of 0x16, but we force an override since the
87 hardware is of the newer variety.
88 */
89
90 unsigned char cpld_version = CPLD_REVISION;
91 int pinCPLD;
92
93#if defined CONFIG_MACH_LPD7A404
94 cpld_version = 0x34; /* Override, for now */
95#endif
96 pinCPLD = (cpld_version == 0x28) ? 7 : 3;
97
98 /* First, configure user controlled GPIOF interrupts */
99
100 GPIO_PFDD &= ~0x0f; /* PF0-3 are inputs */
101 GPIO_INTTYPE1 &= ~0x0f; /* PF0-3 are level triggered */
102 GPIO_INTTYPE2 &= ~0x0f; /* PF0-3 are active low */
103 barrier ();
104 GPIO_GPIOFINTEN |= 0x0f; /* Enable PF0, PF1, PF2, and PF3 IRQs */
105
106 /* Then, configure CPLD interrupt */
107
108 CPLD_INTERRUPTS = 0x0c; /* Disable all CPLD interrupts */
109 GPIO_PFDD &= ~(1 << pinCPLD); /* Make input */
110 GPIO_INTTYPE1 |= (1 << pinCPLD); /* Edge triggered */
111 GPIO_INTTYPE2 &= ~(1 << pinCPLD); /* Active low */
112 barrier ();
113 GPIO_GPIOFINTEN |= (1 << pinCPLD); /* Enable */
114
115 /* Cascade CPLD interrupts */
116
117 for (irq = IRQ_BOARD_START;
118 irq < IRQ_BOARD_START + NR_IRQ_BOARD; ++irq) {
119 set_irq_chip (irq, &lh7a40x_cpld_chip);
120 set_irq_handler (irq, do_edge_IRQ);
121 set_irq_flags (irq, IRQF_VALID);
122 }
123
124 set_irq_chained_handler ((cpld_version == 0x28)
125 ? IRQ_CPLD_V28
126 : IRQ_CPLD_V34,
127 lh7a40x_cpld_handler);
128}
diff --git a/arch/arm/mach-lh7a40x/time.c b/arch/arm/mach-lh7a40x/time.c
new file mode 100644
index 000000000000..51e1c814b400
--- /dev/null
+++ b/arch/arm/mach-lh7a40x/time.c
@@ -0,0 +1,75 @@
1/*
2 * arch/arm/mach-lh7a40x/time.c
3 *
4 * Copyright (C) 2004 Logic Product Development
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 * version 2 as published by the Free Software Foundation.
9 *
10 */
11#include <linux/config.h>
12#include <linux/module.h>
13#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <linux/time.h>
16
17#include <asm/hardware.h>
18#include <asm/io.h>
19#include <asm/irq.h>
20#include <asm/leds.h>
21
22#include <asm/mach/time.h>
23#include "common.h"
24
25#if HZ < 100
26# define TIMER_CONTROL TIMER_CONTROL2
27# define TIMER_LOAD TIMER_LOAD2
28# define TIMER_CONSTANT (508469/HZ)
29# define TIMER_MODE (TIMER_C_ENABLE | TIMER_C_PERIODIC | TIMER_C_508KHZ)
30# define TIMER_EOI TIMER_EOI2
31# define TIMER_IRQ IRQ_T2UI
32#else
33# define TIMER_CONTROL TIMER_CONTROL3
34# define TIMER_LOAD TIMER_LOAD3
35# define TIMER_CONSTANT (3686400/HZ)
36# define TIMER_MODE (TIMER_C_ENABLE | TIMER_C_PERIODIC)
37# define TIMER_EOI TIMER_EOI3
38# define TIMER_IRQ IRQ_T3UI
39#endif
40
41static irqreturn_t
42lh7a40x_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
43{
44 write_seqlock(&xtime_lock);
45
46 TIMER_EOI = 0;
47 timer_tick(regs);
48
49 write_sequnlock(&xtime_lock);
50
51 return IRQ_HANDLED;
52}
53
54static struct irqaction lh7a40x_timer_irq = {
55 .name = "LHA740x Timer Tick",
56 .flags = SA_INTERRUPT,
57 .handler = lh7a40x_timer_interrupt
58};
59
60static void __init lh7a40x_timer_init(void)
61{
62 /* Stop/disable all timers */
63 TIMER_CONTROL1 = 0;
64 TIMER_CONTROL2 = 0;
65 TIMER_CONTROL3 = 0;
66
67 setup_irq (TIMER_IRQ, &lh7a40x_timer_irq);
68
69 TIMER_LOAD = TIMER_CONSTANT;
70 TIMER_CONTROL = TIMER_MODE;
71}
72
73struct sys_timer lh7a40x_timer = {
74 .init = &lh7a40x_timer_init,
75};
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
new file mode 100644
index 000000000000..9e42efa66b2b
--- /dev/null
+++ b/arch/arm/mach-omap/Kconfig
@@ -0,0 +1,221 @@
1if ARCH_OMAP
2
3menu "TI OMAP Implementations"
4
5comment "OMAP Core Type"
6
7config ARCH_OMAP730
8 depends on ARCH_OMAP
9 bool "OMAP730 Based System"
10 select ARCH_OMAP_OTG
11
12config ARCH_OMAP1510
13 depends on ARCH_OMAP
14 default y
15 bool "OMAP1510 Based System"
16
17config ARCH_OMAP16XX
18 depends on ARCH_OMAP
19 bool "OMAP16XX Based System"
20 select ARCH_OMAP_OTG
21
22config ARCH_OMAP_OTG
23 bool
24
25comment "OMAP Board Type"
26
27config MACH_OMAP_INNOVATOR
28 bool "TI Innovator"
29 depends on ARCH_OMAP1510 || ARCH_OMAP16XX
30 help
31 TI OMAP 1510 or 1610 Innovator board support. Say Y here if you
32 have such a board.
33
34config MACH_OMAP_H2
35 bool "TI H2 Support"
36 depends on ARCH_OMAP16XX
37 help
38 TI OMAP 1610/1611B H2 board support. Say Y here if you have such
39 a board.
40
41config MACH_OMAP_H3
42 bool "TI H3 Support"
43 depends on ARCH_OMAP16XX
44 help
45 TI OMAP 1710 H3 board support. Say Y here if you have such
46 a board.
47
48config MACH_OMAP_H4
49 bool "TI H4 Support"
50 depends on ARCH_OMAP16XX
51 help
52 TI OMAP 1610 H4 board support. Say Y here if you have such
53 a board.
54
55config MACH_OMAP_OSK
56 bool "TI OSK Support"
57 depends on ARCH_OMAP16XX
58 help
59 TI OMAP 5912 OSK (OMAP Starter Kit) board support. Say Y here
60 if you have such a board.
61
62config MACH_OMAP_PERSEUS2
63 bool "TI Perseus2"
64 depends on ARCH_OMAP730
65 help
66 Support for TI OMAP 730 Perseus2 board. Say Y here if you have such
67 a board.
68
69config MACH_VOICEBLUE
70 bool "Voiceblue"
71 depends on ARCH_OMAP1510
72 help
73 Support for Voiceblue GSM/VoIP gateway. Say Y here if you have such
74 board.
75
76config MACH_NETSTAR
77 bool "NetStar"
78 depends on ARCH_OMAP1510
79 help
80 Support for NetStar PBX. Say Y here if you have such a board.
81
82config MACH_OMAP_GENERIC
83 bool "Generic OMAP board"
84 depends on ARCH_OMAP1510 || ARCH_OMAP16XX
85 help
86 Support for generic OMAP-1510, 1610 or 1710 board with
87 no FPGA. Can be used as template for porting Linux to
88 custom OMAP boards. Say Y here if you have a custom
89 board.
90
91comment "OMAP Feature Selections"
92
93#config OMAP_BOOT_TAG
94# bool "OMAP bootloader information passing"
95# depends on ARCH_OMAP
96# default n
97# help
98# Say Y, if you have a bootloader which passes information
99# about your board and its peripheral configuration.
100
101config OMAP_MUX
102 bool "OMAP multiplexing support"
103 depends on ARCH_OMAP
104 default y
105 help
106 Pin multiplexing support for OMAP boards. If your bootloader
107 sets the multiplexing correctly, say N. Otherwise, or if unsure,
108 say Y.
109
110config OMAP_MUX_DEBUG
111 bool "Multiplexing debug output"
112 depends on OMAP_MUX
113 default n
114 help
115 Makes the multiplexing functions print out a lot of debug info.
116 This is useful if you want to find out the correct values of the
117 multiplexing registers.
118
119config OMAP_MUX_WARNINGS
120 bool "Warn about pins the bootloader didn't set up"
121 depends on OMAP_MUX
122 default y
123 help
124 Choose Y here to warn whenever driver initialization logic needs
125 to change the pin multiplexing setup. When there are no warnings
126 printed, it's safe to deselect OMAP_MUX for your product.
127
128choice
129 prompt "System timer"
130 default OMAP_MPU_TIMER
131
132config OMAP_MPU_TIMER
133 bool "Use mpu timer"
134 help
135 Select this option if you want to use the OMAP mpu timer. This
136 timer provides more intra-tick resolution than the 32KHz timer,
137 but consumes more power.
138
139config OMAP_32K_TIMER
140 bool "Use 32KHz timer"
141 depends on ARCH_OMAP16XX
142 help
143 Select this option if you want to enable the OMAP 32KHz timer.
144 This timer saves power compared to the OMAP_MPU_TIMER, and has
145 support for no tick during idle. The 32KHz timer provides less
146 intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is
147 currently only available for OMAP-16xx.
148
149endchoice
150
151config OMAP_32K_TIMER_HZ
152 int "Kernel internal timer frequency for 32KHz timer"
153 range 32 1024
154 depends on OMAP_32K_TIMER
155 default "128"
156 help
157 Kernel internal timer frequency should be a divisor of 32768,
158 such as 64 or 128.
159
160choice
161 prompt "Low-level debug console UART"
162 depends on ARCH_OMAP
163 default OMAP_LL_DEBUG_UART1
164
165config OMAP_LL_DEBUG_UART1
166 bool "UART1"
167
168config OMAP_LL_DEBUG_UART2
169 bool "UART2"
170
171config OMAP_LL_DEBUG_UART3
172 bool "UART3"
173
174endchoice
175
176config OMAP_ARM_195MHZ
177 bool "OMAP ARM 195 MHz CPU"
178 depends on ARCH_OMAP730
179 help
180 Enable 195MHz clock for OMAP CPU. If unsure, say N.
181
182config OMAP_ARM_192MHZ
183 bool "OMAP ARM 192 MHz CPU"
184 depends on ARCH_OMAP16XX
185 help
186 Enable 192MHz clock for OMAP CPU. If unsure, say N.
187
188config OMAP_ARM_182MHZ
189 bool "OMAP ARM 182 MHz CPU"
190 depends on ARCH_OMAP730
191 help
192 Enable 182MHz clock for OMAP CPU. If unsure, say N.
193
194config OMAP_ARM_168MHZ
195 bool "OMAP ARM 168 MHz CPU"
196 depends on ARCH_OMAP1510 || ARCH_OMAP16XX || ARCH_OMAP730
197 help
198 Enable 168MHz clock for OMAP CPU. If unsure, say N.
199
200config OMAP_ARM_120MHZ
201 bool "OMAP ARM 120 MHz CPU"
202 depends on ARCH_OMAP1510 || ARCH_OMAP16XX || ARCH_OMAP730
203 help
204 Enable 120MHz clock for OMAP CPU. If unsure, say N.
205
206config OMAP_ARM_60MHZ
207 bool "OMAP ARM 60 MHz CPU"
208 depends on ARCH_OMAP1510 || ARCH_OMAP16XX || ARCH_OMAP730
209 default y
210 help
211 Enable 60MHz clock for OMAP CPU. If unsure, say Y.
212
213config OMAP_ARM_30MHZ
214 bool "OMAP ARM 30 MHz CPU"
215 depends on ARCH_OMAP1510 || ARCH_OMAP16XX || ARCH_OMAP730
216 help
217 Enable 30MHz clock for OMAP CPU. If unsure, say N.
218
219endmenu
220
221endif
diff --git a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile
new file mode 100644
index 000000000000..4cafb11d2c02
--- /dev/null
+++ b/arch/arm/mach-omap/Makefile
@@ -0,0 +1,40 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Common support
6obj-y := common.o time.o irq.o dma.o clock.o mux.o gpio.o mcbsp.o usb.o
7obj-m :=
8obj-n :=
9obj- :=
10led-y := leds.o
11
12# Specific board support
13obj-$(CONFIG_MACH_OMAP_H2) += board-h2.o
14obj-$(CONFIG_MACH_OMAP_INNOVATOR) += board-innovator.o
15obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
16obj-$(CONFIG_MACH_OMAP_PERSEUS2) += board-perseus2.o
17obj-$(CONFIG_MACH_OMAP_OSK) += board-osk.o
18obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o
19obj-$(CONFIG_MACH_VOICEBLUE) += board-voiceblue.o
20obj-$(CONFIG_MACH_NETSTAR) += board-netstar.o
21
22# OCPI interconnect support for 1710, 1610 and 5912
23obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
24
25# LEDs support
26led-$(CONFIG_MACH_OMAP_H2) += leds-h2p2-debug.o
27led-$(CONFIG_MACH_OMAP_INNOVATOR) += leds-innovator.o
28led-$(CONFIG_MACH_OMAP_PERSEUS2) += leds-h2p2-debug.o
29obj-$(CONFIG_LEDS) += $(led-y)
30
31# Power Management
32obj-$(CONFIG_PM) += pm.o sleep.o
33
34ifeq ($(CONFIG_ARCH_OMAP1510),y)
35# Innovator-1510 FPGA
36obj-$(CONFIG_MACH_OMAP_INNOVATOR) += fpga.o
37endif
38
39# kgdb support
40obj-$(CONFIG_KGDB_SERIAL) += kgdb-serial.o
diff --git a/arch/arm/mach-omap/Makefile.boot b/arch/arm/mach-omap/Makefile.boot
new file mode 100644
index 000000000000..fee1a6a15b54
--- /dev/null
+++ b/arch/arm/mach-omap/Makefile.boot
@@ -0,0 +1,4 @@
1 zreladdr-y := 0x10008000
2params_phys-y := 0x10000100
3initrd_phys-y := 0x10800000
4
diff --git a/arch/arm/mach-omap/board-generic.c b/arch/arm/mach-omap/board-generic.c
new file mode 100644
index 000000000000..2102a2cd1013
--- /dev/null
+++ b/arch/arm/mach-omap/board-generic.c
@@ -0,0 +1,98 @@
1/*
2 * linux/arch/arm/mach-omap/board-generic.c
3 *
4 * Modified from board-innovator1510.c
5 *
6 * Code for generic OMAP board. Should work on many OMAP systems where
7 * the device drivers take care of all the necessary hardware initialization.
8 * Do not put any board specific code to this file; create a new machine
9 * type if you need custom low-level initializations.
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 version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/device.h>
19
20#include <asm/hardware.h>
21#include <asm/mach-types.h>
22#include <asm/mach/arch.h>
23#include <asm/mach/map.h>
24
25#include <asm/arch/gpio.h>
26#include <asm/arch/mux.h>
27#include <asm/arch/usb.h>
28#include <asm/arch/board.h>
29
30#include "common.h"
31
32static int __initdata generic_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1};
33
34static void __init omap_generic_init_irq(void)
35{
36 omap_init_irq();
37}
38
39/* assume no Mini-AB port */
40
41#ifdef CONFIG_ARCH_OMAP1510
42static struct omap_usb_config generic1510_usb_config __initdata = {
43 .register_host = 1,
44 .register_dev = 1,
45 .hmc_mode = 16,
46 .pins[0] = 3,
47};
48#endif
49
50#if defined(CONFIG_ARCH_OMAP16XX)
51static struct omap_usb_config generic1610_usb_config __initdata = {
52 .register_host = 1,
53 .register_dev = 1,
54 .hmc_mode = 16,
55 .pins[0] = 6,
56};
57#endif
58
59static struct omap_board_config_kernel generic_config[] = {
60 { OMAP_TAG_USB, NULL },
61};
62
63static void __init omap_generic_init(void)
64{
65 /*
66 * Make sure the serial ports are muxed on at this point.
67 * You have to mux them off in device drivers later on
68 * if not needed.
69 */
70#ifdef CONFIG_ARCH_OMAP1510
71 if (cpu_is_omap1510()) {
72 generic_config[0].data = &generic1510_usb_config;
73 }
74#endif
75#if defined(CONFIG_ARCH_OMAP16XX)
76 if (!cpu_is_omap1510()) {
77 generic_config[0].data = &generic1610_usb_config;
78 }
79#endif
80 omap_board_config = generic_config;
81 omap_board_config_size = ARRAY_SIZE(generic_config);
82 omap_serial_init(generic_serial_ports);
83}
84
85static void __init omap_generic_map_io(void)
86{
87 omap_map_io();
88}
89
90MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
91 MAINTAINER("Tony Lindgren <tony@atomide.com>")
92 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
93 BOOT_PARAMS(0x10000100)
94 MAPIO(omap_generic_map_io)
95 INITIRQ(omap_generic_init_irq)
96 INIT_MACHINE(omap_generic_init)
97 .timer = &omap_timer,
98MACHINE_END
diff --git a/arch/arm/mach-omap/board-h2.c b/arch/arm/mach-omap/board-h2.c
new file mode 100644
index 000000000000..1f067830d1fc
--- /dev/null
+++ b/arch/arm/mach-omap/board-h2.c
@@ -0,0 +1,187 @@
1/*
2 * linux/arch/arm/mach-omap/board-h2.c
3 *
4 * Board specific inits for OMAP-1610 H2
5 *
6 * Copyright (C) 2001 RidgeRun, Inc.
7 * Author: Greg Lonnon <glonnon@ridgerun.com>
8 *
9 * Copyright (C) 2002 MontaVista Software, Inc.
10 *
11 * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6
12 * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com>
13 *
14 * H2 specific changes and cleanup
15 * Copyright (C) 2004 Nokia Corporation by Imre Deak <imre.deak@nokia.com>
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 */
21
22#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/device.h>
25#include <linux/delay.h>
26#include <linux/mtd/mtd.h>
27#include <linux/mtd/partitions.h>
28
29#include <asm/hardware.h>
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/flash.h>
33#include <asm/mach/map.h>
34
35#include <asm/arch/gpio.h>
36#include <asm/arch/tc.h>
37#include <asm/arch/usb.h>
38
39#include "common.h"
40
41extern int omap_gpio_init(void);
42
43static int __initdata h2_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1};
44
45static struct mtd_partition h2_partitions[] = {
46 /* bootloader (U-Boot, etc) in first sector */
47 {
48 .name = "bootloader",
49 .offset = 0,
50 .size = SZ_128K,
51 .mask_flags = MTD_WRITEABLE, /* force read-only */
52 },
53 /* bootloader params in the next sector */
54 {
55 .name = "params",
56 .offset = MTDPART_OFS_APPEND,
57 .size = SZ_128K,
58 .mask_flags = 0,
59 },
60 /* kernel */
61 {
62 .name = "kernel",
63 .offset = MTDPART_OFS_APPEND,
64 .size = SZ_2M,
65 .mask_flags = 0
66 },
67 /* file system */
68 {
69 .name = "filesystem",
70 .offset = MTDPART_OFS_APPEND,
71 .size = MTDPART_SIZ_FULL,
72 .mask_flags = 0
73 }
74};
75
76static struct flash_platform_data h2_flash_data = {
77 .map_name = "cfi_probe",
78 .width = 2,
79 .parts = h2_partitions,
80 .nr_parts = ARRAY_SIZE(h2_partitions),
81};
82
83static struct resource h2_flash_resource = {
84 .start = OMAP_CS2B_PHYS,
85 .end = OMAP_CS2B_PHYS + OMAP_CS2B_SIZE - 1,
86 .flags = IORESOURCE_MEM,
87};
88
89static struct platform_device h2_flash_device = {
90 .name = "omapflash",
91 .id = 0,
92 .dev = {
93 .platform_data = &h2_flash_data,
94 },
95 .num_resources = 1,
96 .resource = &h2_flash_resource,
97};
98
99static struct resource h2_smc91x_resources[] = {
100 [0] = {
101 .start = OMAP1610_ETHR_START, /* Physical */
102 .end = OMAP1610_ETHR_START + 0xf,
103 .flags = IORESOURCE_MEM,
104 },
105 [1] = {
106 .start = OMAP_GPIO_IRQ(0),
107 .end = OMAP_GPIO_IRQ(0),
108 .flags = IORESOURCE_IRQ,
109 },
110};
111
112static struct platform_device h2_smc91x_device = {
113 .name = "smc91x",
114 .id = 0,
115 .num_resources = ARRAY_SIZE(h2_smc91x_resources),
116 .resource = h2_smc91x_resources,
117};
118
119static struct platform_device *h2_devices[] __initdata = {
120 &h2_flash_device,
121 &h2_smc91x_device,
122};
123
124static void __init h2_init_smc91x(void)
125{
126 if ((omap_request_gpio(0)) < 0) {
127 printk("Error requesting gpio 0 for smc91x irq\n");
128 return;
129 }
130 omap_set_gpio_edge_ctrl(0, OMAP_GPIO_FALLING_EDGE);
131}
132
133void h2_init_irq(void)
134{
135 omap_init_irq();
136 omap_gpio_init();
137 h2_init_smc91x();
138}
139
140static struct omap_usb_config h2_usb_config __initdata = {
141 /* usb1 has a Mini-AB port and external isp1301 transceiver */
142 .otg = 2,
143
144#ifdef CONFIG_USB_GADGET_OMAP
145 .hmc_mode = 19, // 0:host(off) 1:dev|otg 2:disabled
146 // .hmc_mode = 21, // 0:host(off) 1:dev(loopback) 2:host(loopback)
147#elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
148 /* needs OTG cable, or NONSTANDARD (B-to-MiniB) */
149 .hmc_mode = 20, // 1:dev|otg(off) 1:host 2:disabled
150#endif
151
152 .pins[1] = 3,
153};
154
155static struct omap_mmc_config h2_mmc_config __initdata = {
156 .mmc_blocks = 1,
157 .mmc1_power_pin = -1, /* tps65010 gpio3 */
158 .mmc1_switch_pin = OMAP_MPUIO(1),
159};
160
161static struct omap_board_config_kernel h2_config[] = {
162 { OMAP_TAG_USB, &h2_usb_config },
163 { OMAP_TAG_MMC, &h2_mmc_config },
164};
165
166static void __init h2_init(void)
167{
168 platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
169 omap_board_config = h2_config;
170 omap_board_config_size = ARRAY_SIZE(h2_config);
171}
172
173static void __init h2_map_io(void)
174{
175 omap_map_io();
176 omap_serial_init(h2_serial_ports);
177}
178
179MACHINE_START(OMAP_H2, "TI-H2")
180 MAINTAINER("Imre Deak <imre.deak@nokia.com>")
181 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
182 BOOT_PARAMS(0x10000100)
183 MAPIO(h2_map_io)
184 INITIRQ(h2_init_irq)
185 INIT_MACHINE(h2_init)
186 .timer = &omap_timer,
187MACHINE_END
diff --git a/arch/arm/mach-omap/board-h3.c b/arch/arm/mach-omap/board-h3.c
new file mode 100644
index 000000000000..486a5a006c9a
--- /dev/null
+++ b/arch/arm/mach-omap/board-h3.c
@@ -0,0 +1,205 @@
1/*
2 * linux/arch/arm/mach-omap/board-h3.c
3 *
4 * This file contains OMAP1710 H3 specific code.
5 *
6 * Copyright (C) 2004 Texas Instruments, Inc.
7 * Copyright (C) 2002 MontaVista Software, Inc.
8 * Copyright (C) 2001 RidgeRun, Inc.
9 * Author: RidgeRun, Inc.
10 * Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <linux/config.h>
18#include <linux/types.h>
19#include <linux/init.h>
20#include <linux/major.h>
21#include <linux/kernel.h>
22#include <linux/device.h>
23#include <linux/errno.h>
24#include <linux/mtd/mtd.h>
25#include <linux/mtd/partitions.h>
26
27#include <asm/setup.h>
28#include <asm/page.h>
29#include <asm/hardware.h>
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/flash.h>
33#include <asm/mach/map.h>
34
35#include <asm/arch/gpio.h>
36#include <asm/arch/irqs.h>
37#include <asm/arch/mux.h>
38#include <asm/arch/tc.h>
39#include <asm/arch/usb.h>
40
41#include "common.h"
42
43extern int omap_gpio_init(void);
44
45static int __initdata h3_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1};
46
47static struct mtd_partition h3_partitions[] = {
48 /* bootloader (U-Boot, etc) in first sector */
49 {
50 .name = "bootloader",
51 .offset = 0,
52 .size = SZ_128K,
53 .mask_flags = MTD_WRITEABLE, /* force read-only */
54 },
55 /* bootloader params in the next sector */
56 {
57 .name = "params",
58 .offset = MTDPART_OFS_APPEND,
59 .size = SZ_128K,
60 .mask_flags = 0,
61 },
62 /* kernel */
63 {
64 .name = "kernel",
65 .offset = MTDPART_OFS_APPEND,
66 .size = SZ_2M,
67 .mask_flags = 0
68 },
69 /* file system */
70 {
71 .name = "filesystem",
72 .offset = MTDPART_OFS_APPEND,
73 .size = MTDPART_SIZ_FULL,
74 .mask_flags = 0
75 }
76};
77
78static struct flash_platform_data h3_flash_data = {
79 .map_name = "cfi_probe",
80 .width = 2,
81 .parts = h3_partitions,
82 .nr_parts = ARRAY_SIZE(h3_partitions),
83};
84
85static struct resource h3_flash_resource = {
86 .start = OMAP_CS2B_PHYS,
87 .end = OMAP_CS2B_PHYS + OMAP_CS2B_SIZE - 1,
88 .flags = IORESOURCE_MEM,
89};
90
91static struct platform_device flash_device = {
92 .name = "omapflash",
93 .id = 0,
94 .dev = {
95 .platform_data = &h3_flash_data,
96 },
97 .num_resources = 1,
98 .resource = &h3_flash_resource,
99};
100
101static struct resource smc91x_resources[] = {
102 [0] = {
103 .start = OMAP1710_ETHR_START, /* Physical */
104 .end = OMAP1710_ETHR_START + 0xf,
105 .flags = IORESOURCE_MEM,
106 },
107 [1] = {
108 .start = OMAP_GPIO_IRQ(40),
109 .end = OMAP_GPIO_IRQ(40),
110 .flags = IORESOURCE_IRQ,
111 },
112};
113
114static struct platform_device smc91x_device = {
115 .name = "smc91x",
116 .id = 0,
117 .num_resources = ARRAY_SIZE(smc91x_resources),
118 .resource = smc91x_resources,
119};
120
121#define GPTIMER_BASE 0xFFFB1400
122#define GPTIMER_REGS(x) (0xFFFB1400 + (x * 0x800))
123#define GPTIMER_REGS_SIZE 0x46
124
125static struct resource intlat_resources[] = {
126 [0] = {
127 .start = GPTIMER_REGS(0), /* Physical */
128 .end = GPTIMER_REGS(0) + GPTIMER_REGS_SIZE,
129 .flags = IORESOURCE_MEM,
130 },
131 [1] = {
132 .start = INT_1610_GPTIMER1,
133 .end = INT_1610_GPTIMER1,
134 .flags = IORESOURCE_IRQ,
135 },
136};
137
138static struct platform_device intlat_device = {
139 .name = "omap_intlat",
140 .id = 0,
141 .num_resources = ARRAY_SIZE(intlat_resources),
142 .resource = intlat_resources,
143};
144
145static struct platform_device *devices[] __initdata = {
146 &flash_device,
147 &smc91x_device,
148 &intlat_device,
149};
150
151static struct omap_usb_config h3_usb_config __initdata = {
152 /* usb1 has a Mini-AB port and external isp1301 transceiver */
153 .otg = 2,
154
155#ifdef CONFIG_USB_GADGET_OMAP
156 .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */
157#elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
158 /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */
159 .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */
160#endif
161
162 .pins[1] = 3,
163};
164
165static struct omap_board_config_kernel h3_config[] = {
166 { OMAP_TAG_USB, &h3_usb_config },
167};
168
169static void __init h3_init(void)
170{
171 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
172}
173
174static void __init h3_init_smc91x(void)
175{
176 omap_cfg_reg(W15_1710_GPIO40);
177 if (omap_request_gpio(40) < 0) {
178 printk("Error requesting gpio 40 for smc91x irq\n");
179 return;
180 }
181 omap_set_gpio_edge_ctrl(40, OMAP_GPIO_FALLING_EDGE);
182}
183
184void h3_init_irq(void)
185{
186 omap_init_irq();
187 omap_gpio_init();
188 h3_init_smc91x();
189}
190
191static void __init h3_map_io(void)
192{
193 omap_map_io();
194 omap_serial_init(h3_serial_ports);
195}
196
197MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
198 MAINTAINER("Texas Instruments, Inc.")
199 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
200 BOOT_PARAMS(0x10000100)
201 MAPIO(h3_map_io)
202 INITIRQ(h3_init_irq)
203 INIT_MACHINE(h3_init)
204 .timer = &omap_timer,
205MACHINE_END
diff --git a/arch/arm/mach-omap/board-innovator.c b/arch/arm/mach-omap/board-innovator.c
new file mode 100644
index 000000000000..57cf4da88d55
--- /dev/null
+++ b/arch/arm/mach-omap/board-innovator.c
@@ -0,0 +1,280 @@
1/*
2 * linux/arch/arm/mach-omap/board-innovator.c
3 *
4 * Board specific inits for OMAP-1510 and OMAP-1610 Innovator
5 *
6 * Copyright (C) 2001 RidgeRun, Inc.
7 * Author: Greg Lonnon <glonnon@ridgerun.com>
8 *
9 * Copyright (C) 2002 MontaVista Software, Inc.
10 *
11 * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6
12 * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/device.h>
22#include <linux/delay.h>
23#include <linux/mtd/mtd.h>
24#include <linux/mtd/partitions.h>
25
26#include <asm/hardware.h>
27#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/flash.h>
30#include <asm/mach/map.h>
31
32#include <asm/arch/fpga.h>
33#include <asm/arch/gpio.h>
34#include <asm/arch/tc.h>
35#include <asm/arch/usb.h>
36
37#include "common.h"
38
39static int __initdata innovator_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1};
40
41static struct mtd_partition innovator_partitions[] = {
42 /* bootloader (U-Boot, etc) in first sector */
43 {
44 .name = "bootloader",
45 .offset = 0,
46 .size = SZ_128K,
47 .mask_flags = MTD_WRITEABLE, /* force read-only */
48 },
49 /* bootloader params in the next sector */
50 {
51 .name = "params",
52 .offset = MTDPART_OFS_APPEND,
53 .size = SZ_128K,
54 .mask_flags = 0,
55 },
56 /* kernel */
57 {
58 .name = "kernel",
59 .offset = MTDPART_OFS_APPEND,
60 .size = SZ_2M,
61 .mask_flags = 0
62 },
63 /* rest of flash1 is a file system */
64 {
65 .name = "rootfs",
66 .offset = MTDPART_OFS_APPEND,
67 .size = SZ_16M - SZ_2M - 2 * SZ_128K,
68 .mask_flags = 0
69 },
70 /* file system */
71 {
72 .name = "filesystem",
73 .offset = MTDPART_OFS_APPEND,
74 .size = MTDPART_SIZ_FULL,
75 .mask_flags = 0
76 }
77};
78
79static struct flash_platform_data innovator_flash_data = {
80 .map_name = "cfi_probe",
81 .width = 2,
82 .parts = innovator_partitions,
83 .nr_parts = ARRAY_SIZE(innovator_partitions),
84};
85
86static struct resource innovator_flash_resource = {
87 .start = OMAP_CS0_PHYS,
88 .end = OMAP_CS0_PHYS + SZ_32M - 1,
89 .flags = IORESOURCE_MEM,
90};
91
92static struct platform_device innovator_flash_device = {
93 .name = "omapflash",
94 .id = 0,
95 .dev = {
96 .platform_data = &innovator_flash_data,
97 },
98 .num_resources = 1,
99 .resource = &innovator_flash_resource,
100};
101
102#ifdef CONFIG_ARCH_OMAP1510
103
104/* Only FPGA needs to be mapped here. All others are done with ioremap */
105static struct map_desc innovator1510_io_desc[] __initdata = {
106{ OMAP1510_FPGA_BASE, OMAP1510_FPGA_START, OMAP1510_FPGA_SIZE,
107 MT_DEVICE },
108};
109
110static struct resource innovator1510_smc91x_resources[] = {
111 [0] = {
112 .start = OMAP1510_FPGA_ETHR_START, /* Physical */
113 .end = OMAP1510_FPGA_ETHR_START + 0xf,
114 .flags = IORESOURCE_MEM,
115 },
116 [1] = {
117 .start = OMAP1510_INT_ETHER,
118 .end = OMAP1510_INT_ETHER,
119 .flags = IORESOURCE_IRQ,
120 },
121};
122
123static struct platform_device innovator1510_smc91x_device = {
124 .name = "smc91x",
125 .id = 0,
126 .num_resources = ARRAY_SIZE(innovator1510_smc91x_resources),
127 .resource = innovator1510_smc91x_resources,
128};
129
130static struct platform_device *innovator1510_devices[] __initdata = {
131 &innovator_flash_device,
132 &innovator1510_smc91x_device,
133};
134
135#endif /* CONFIG_ARCH_OMAP1510 */
136
137#ifdef CONFIG_ARCH_OMAP16XX
138
139static struct resource innovator1610_smc91x_resources[] = {
140 [0] = {
141 .start = INNOVATOR1610_ETHR_START, /* Physical */
142 .end = INNOVATOR1610_ETHR_START + 0xf,
143 .flags = IORESOURCE_MEM,
144 },
145 [1] = {
146 .start = OMAP_GPIO_IRQ(0),
147 .end = OMAP_GPIO_IRQ(0),
148 .flags = IORESOURCE_IRQ,
149 },
150};
151
152static struct platform_device innovator1610_smc91x_device = {
153 .name = "smc91x",
154 .id = 0,
155 .num_resources = ARRAY_SIZE(innovator1610_smc91x_resources),
156 .resource = innovator1610_smc91x_resources,
157};
158
159static struct platform_device *innovator1610_devices[] __initdata = {
160 &innovator_flash_device,
161 &innovator1610_smc91x_device,
162};
163
164#endif /* CONFIG_ARCH_OMAP16XX */
165
166static void __init innovator_init_smc91x(void)
167{
168 if (cpu_is_omap1510()) {
169 fpga_write(fpga_read(OMAP1510_FPGA_RST) & ~1,
170 OMAP1510_FPGA_RST);
171 udelay(750);
172 } else {
173 if ((omap_request_gpio(0)) < 0) {
174 printk("Error requesting gpio 0 for smc91x irq\n");
175 return;
176 }
177 omap_set_gpio_edge_ctrl(0, OMAP_GPIO_RISING_EDGE);
178 }
179}
180
181void innovator_init_irq(void)
182{
183 omap_init_irq();
184 omap_gpio_init();
185#ifdef CONFIG_ARCH_OMAP1510
186 if (cpu_is_omap1510()) {
187 omap1510_fpga_init_irq();
188 }
189#endif
190 innovator_init_smc91x();
191}
192
193#ifdef CONFIG_ARCH_OMAP1510
194static struct omap_usb_config innovator1510_usb_config __initdata = {
195 /* for bundled non-standard host and peripheral cables */
196 .hmc_mode = 4,
197
198 .register_host = 1,
199 .pins[1] = 6,
200 .pins[2] = 6, /* Conflicts with UART2 */
201
202 .register_dev = 1,
203 .pins[0] = 2,
204};
205#endif
206
207#ifdef CONFIG_ARCH_OMAP16XX
208static struct omap_usb_config h2_usb_config __initdata = {
209 /* usb1 has a Mini-AB port and external isp1301 transceiver */
210 .otg = 2,
211
212#ifdef CONFIG_USB_GADGET_OMAP
213 .hmc_mode = 19, // 0:host(off) 1:dev|otg 2:disabled
214 // .hmc_mode = 21, // 0:host(off) 1:dev(loopback) 2:host(loopback)
215#elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
216 /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */
217 .hmc_mode = 20, // 1:dev|otg(off) 1:host 2:disabled
218#endif
219
220 .pins[1] = 3,
221};
222#endif
223
224static struct omap_board_config_kernel innovator_config[] = {
225 { OMAP_TAG_USB, NULL },
226};
227
228static void __init innovator_init(void)
229{
230#ifdef CONFIG_ARCH_OMAP1510
231 if (cpu_is_omap1510()) {
232 platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices));
233 }
234#endif
235#ifdef CONFIG_ARCH_OMAP16XX
236 if (!cpu_is_omap1510()) {
237 platform_add_devices(innovator1610_devices, ARRAY_SIZE(innovator1610_devices));
238 }
239#endif
240
241#ifdef CONFIG_ARCH_OMAP1510
242 if (cpu_is_omap1510())
243 innovator_config[0].data = &innovator1510_usb_config;
244#endif
245#ifdef CONFIG_ARCH_OMAP16XX
246 if (cpu_is_omap1610())
247 innovator_config[0].data = &h2_usb_config;
248#endif
249 omap_board_config = innovator_config;
250 omap_board_config_size = ARRAY_SIZE(innovator_config);
251}
252
253static void __init innovator_map_io(void)
254{
255 omap_map_io();
256
257#ifdef CONFIG_ARCH_OMAP1510
258 if (cpu_is_omap1510()) {
259 iotable_init(innovator1510_io_desc, ARRAY_SIZE(innovator1510_io_desc));
260 udelay(10); /* Delay needed for FPGA */
261
262 /* Dump the Innovator FPGA rev early - useful info for support. */
263 printk("Innovator FPGA Rev %d.%d Board Rev %d\n",
264 fpga_read(OMAP1510_FPGA_REV_HIGH),
265 fpga_read(OMAP1510_FPGA_REV_LOW),
266 fpga_read(OMAP1510_FPGA_BOARD_REV));
267 }
268#endif
269 omap_serial_init(innovator_serial_ports);
270}
271
272MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
273 MAINTAINER("MontaVista Software, Inc.")
274 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
275 BOOT_PARAMS(0x10000100)
276 MAPIO(innovator_map_io)
277 INITIRQ(innovator_init_irq)
278 INIT_MACHINE(innovator_init)
279 .timer = &omap_timer,
280MACHINE_END
diff --git a/arch/arm/mach-omap/board-netstar.c b/arch/arm/mach-omap/board-netstar.c
new file mode 100644
index 000000000000..54acbd215c4b
--- /dev/null
+++ b/arch/arm/mach-omap/board-netstar.c
@@ -0,0 +1,151 @@
1/*
2 * Modified from board-generic.c
3 *
4 * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz>
5 *
6 * Code for Netstar OMAP board.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/delay.h>
14#include <linux/device.h>
15#include <linux/interrupt.h>
16#include <linux/init.h>
17#include <linux/kernel.h>
18#include <linux/notifier.h>
19#include <linux/reboot.h>
20
21#include <asm/hardware.h>
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25
26#include <asm/arch/gpio.h>
27#include <asm/arch/mux.h>
28#include <asm/arch/usb.h>
29
30#include "common.h"
31
32extern void __init omap_init_time(void);
33extern int omap_gpio_init(void);
34
35static struct resource netstar_smc91x_resources[] = {
36 [0] = {
37 .start = OMAP_CS1_PHYS + 0x300,
38 .end = OMAP_CS1_PHYS + 0x300 + 16,
39 .flags = IORESOURCE_MEM,
40 },
41 [1] = {
42 .start = OMAP_GPIO_IRQ(8),
43 .end = OMAP_GPIO_IRQ(8),
44 .flags = IORESOURCE_IRQ,
45 },
46};
47
48static struct platform_device netstar_smc91x_device = {
49 .name = "smc91x",
50 .id = 0,
51 .num_resources = ARRAY_SIZE(netstar_smc91x_resources),
52 .resource = netstar_smc91x_resources,
53};
54
55static struct platform_device *netstar_devices[] __initdata = {
56 &netstar_smc91x_device,
57};
58
59static void __init netstar_init_irq(void)
60{
61 omap_init_irq();
62 omap_gpio_init();
63}
64
65static void __init netstar_init(void)
66{
67 /* green LED */
68 omap_request_gpio(4);
69 omap_set_gpio_direction(4, 0);
70 /* smc91x reset */
71 omap_request_gpio(7);
72 omap_set_gpio_direction(7, 0);
73 omap_set_gpio_dataout(7, 1);
74 udelay(2); /* wait at least 100ns */
75 omap_set_gpio_dataout(7, 0);
76 mdelay(50); /* 50ms until PHY ready */
77 /* smc91x interrupt pin */
78 omap_request_gpio(8);
79 omap_set_gpio_edge_ctrl(8, OMAP_GPIO_RISING_EDGE);
80
81 omap_request_gpio(12);
82 omap_request_gpio(13);
83 omap_request_gpio(14);
84 omap_request_gpio(15);
85 omap_set_gpio_edge_ctrl(12, OMAP_GPIO_FALLING_EDGE);
86 omap_set_gpio_edge_ctrl(13, OMAP_GPIO_FALLING_EDGE);
87 omap_set_gpio_edge_ctrl(14, OMAP_GPIO_FALLING_EDGE);
88 omap_set_gpio_edge_ctrl(15, OMAP_GPIO_FALLING_EDGE);
89
90 platform_add_devices(netstar_devices, ARRAY_SIZE(netstar_devices));
91
92 /* Switch on green LED */
93 omap_set_gpio_dataout(4, 0);
94 /* Switch off red LED */
95 omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */
96 omap_writeb(0x80, OMAP_LPG1_LCR);
97}
98
99static int __initdata omap_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1};
100
101static void __init netstar_map_io(void)
102{
103 omap_map_io();
104 omap_serial_init(omap_serial_ports);
105}
106
107#define MACHINE_PANICED 1
108#define MACHINE_REBOOTING 2
109#define MACHINE_REBOOT 4
110static unsigned long machine_state;
111
112static int panic_event(struct notifier_block *this, unsigned long event,
113 void *ptr)
114{
115 if (test_and_set_bit(MACHINE_PANICED, &machine_state))
116 return NOTIFY_DONE;
117
118 /* Switch off green LED */
119 omap_set_gpio_dataout(4, 1);
120 /* Flash red LED */
121 omap_writeb(0x78, OMAP_LPG1_LCR);
122 omap_writeb(0x01, OMAP_LPG1_PMR); /* Enable clock */
123
124 return NOTIFY_DONE;
125}
126
127static struct notifier_block panic_block = {
128 .notifier_call = panic_event,
129};
130
131static int __init netstar_late_init(void)
132{
133 /* TODO: Setup front panel switch here */
134
135 /* Setup panic notifier */
136 notifier_chain_register(&panic_notifier_list, &panic_block);
137
138 return 0;
139}
140
141postcore_initcall(netstar_late_init);
142
143MACHINE_START(NETSTAR, "NetStar OMAP5910")
144 MAINTAINER("Ladislav Michl <michl@2n.cz>")
145 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
146 BOOT_PARAMS(0x10000100)
147 MAPIO(netstar_map_io)
148 INITIRQ(netstar_init_irq)
149 INIT_MACHINE(netstar_init)
150 .timer = &omap_timer,
151MACHINE_END
diff --git a/arch/arm/mach-omap/board-osk.c b/arch/arm/mach-omap/board-osk.c
new file mode 100644
index 000000000000..a951fc82459b
--- /dev/null
+++ b/arch/arm/mach-omap/board-osk.c
@@ -0,0 +1,169 @@
1/*
2 * linux/arch/arm/mach-omap/board-osk.c
3 *
4 * Board specific init for OMAP5912 OSK
5 *
6 * Written by Dirk Behme <dirk.behme@de.bosch.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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#include <linux/kernel.h>
30#include <linux/init.h>
31#include <linux/device.h>
32
33#include <asm/hardware.h>
34#include <asm/mach-types.h>
35#include <asm/mach/arch.h>
36#include <asm/mach/map.h>
37
38#include <asm/arch/gpio.h>
39#include <asm/arch/usb.h>
40#include <asm/arch/mux.h>
41#include <asm/arch/tc.h>
42
43#include "common.h"
44
45static struct map_desc osk5912_io_desc[] __initdata = {
46{ OMAP_OSK_NOR_FLASH_BASE, OMAP_OSK_NOR_FLASH_START, OMAP_OSK_NOR_FLASH_SIZE,
47 MT_DEVICE },
48};
49
50static int __initdata osk_serial_ports[OMAP_MAX_NR_PORTS] = {1, 0, 0};
51
52static struct resource osk5912_smc91x_resources[] = {
53 [0] = {
54 .start = OMAP_OSK_ETHR_START, /* Physical */
55 .end = OMAP_OSK_ETHR_START + 0xf,
56 .flags = IORESOURCE_MEM,
57 },
58 [1] = {
59 .start = OMAP_GPIO_IRQ(0),
60 .end = OMAP_GPIO_IRQ(0),
61 .flags = IORESOURCE_IRQ,
62 },
63};
64
65static struct platform_device osk5912_smc91x_device = {
66 .name = "smc91x",
67 .id = -1,
68 .num_resources = ARRAY_SIZE(osk5912_smc91x_resources),
69 .resource = osk5912_smc91x_resources,
70};
71
72static struct resource osk5912_cf_resources[] = {
73 [0] = {
74 .start = OMAP_GPIO_IRQ(62),
75 .end = OMAP_GPIO_IRQ(62),
76 .flags = IORESOURCE_IRQ,
77 },
78};
79
80static struct platform_device osk5912_cf_device = {
81 .name = "omap_cf",
82 .id = -1,
83 .dev = {
84 .platform_data = (void *) 2 /* CS2 */,
85 },
86 .num_resources = ARRAY_SIZE(osk5912_cf_resources),
87 .resource = osk5912_cf_resources,
88};
89
90static struct platform_device *osk5912_devices[] __initdata = {
91 &osk5912_smc91x_device,
92 &osk5912_cf_device,
93};
94
95static void __init osk_init_smc91x(void)
96{
97 if ((omap_request_gpio(0)) < 0) {
98 printk("Error requesting gpio 0 for smc91x irq\n");
99 return;
100 }
101 omap_set_gpio_edge_ctrl(0, OMAP_GPIO_RISING_EDGE);
102
103 /* Check EMIFS wait states to fix errors with SMC_GET_PKT_HDR */
104 EMIFS_CCS(1) |= 0x2;
105}
106
107static void __init osk_init_cf(void)
108{
109 omap_cfg_reg(M7_1610_GPIO62);
110 if ((omap_request_gpio(62)) < 0) {
111 printk("Error requesting gpio 62 for CF irq\n");
112 return;
113 }
114 /* it's really active-low */
115 omap_set_gpio_edge_ctrl(62, OMAP_GPIO_FALLING_EDGE);
116}
117
118void osk_init_irq(void)
119{
120 omap_init_irq();
121 omap_gpio_init();
122 osk_init_smc91x();
123 osk_init_cf();
124}
125
126static struct omap_usb_config osk_usb_config __initdata = {
127 /* has usb host connector (A) ... for development it can also
128 * be used, with a NONSTANDARD gender-bending cable/dongle, as
129 * a peripheral.
130 */
131#ifdef CONFIG_USB_GADGET_OMAP
132 .register_dev = 1,
133 .hmc_mode = 0,
134#else
135 .register_host = 1,
136 .hmc_mode = 16,
137 .rwc = 1,
138#endif
139 .pins[0] = 2,
140};
141
142static struct omap_board_config_kernel osk_config[] = {
143 { OMAP_TAG_USB, &osk_usb_config },
144};
145
146static void __init osk_init(void)
147{
148 platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices));
149 omap_board_config = osk_config;
150 omap_board_config_size = ARRAY_SIZE(osk_config);
151 USB_TRANSCEIVER_CTRL_REG |= (3 << 1);
152}
153
154static void __init osk_map_io(void)
155{
156 omap_map_io();
157 iotable_init(osk5912_io_desc, ARRAY_SIZE(osk5912_io_desc));
158 omap_serial_init(osk_serial_ports);
159}
160
161MACHINE_START(OMAP_OSK, "TI-OSK")
162 MAINTAINER("Dirk Behme <dirk.behme@de.bosch.com>")
163 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
164 BOOT_PARAMS(0x10000100)
165 MAPIO(osk_map_io)
166 INITIRQ(osk_init_irq)
167 INIT_MACHINE(osk_init)
168 .timer = &omap_timer,
169MACHINE_END
diff --git a/arch/arm/mach-omap/board-perseus2.c b/arch/arm/mach-omap/board-perseus2.c
new file mode 100644
index 000000000000..64515aeb49cf
--- /dev/null
+++ b/arch/arm/mach-omap/board-perseus2.c
@@ -0,0 +1,189 @@
1/*
2 * linux/arch/arm/mach-omap/board-perseus2.c
3 *
4 * Modified from board-generic.c
5 *
6 * Original OMAP730 support by Jean Pihet <j-pihet@ti.com>
7 * Updated for 2.6 by Kevin Hilman <kjh@hilman.org>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/device.h>
17#include <linux/delay.h>
18#include <linux/mtd/mtd.h>
19#include <linux/mtd/partitions.h>
20
21#include <asm/hardware.h>
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/flash.h>
25#include <asm/mach/map.h>
26
27#include <asm/arch/gpio.h>
28#include <asm/arch/mux.h>
29#include <asm/arch/fpga.h>
30
31#include "common.h"
32
33static struct resource smc91x_resources[] = {
34 [0] = {
35 .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */
36 .end = H2P2_DBG_FPGA_ETHR_START + 0xf,
37 .flags = IORESOURCE_MEM,
38 },
39 [1] = {
40 .start = INT_730_MPU_EXT_NIRQ,
41 .end = 0,
42 .flags = IORESOURCE_IRQ,
43 },
44};
45
46static int __initdata p2_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 0};
47
48static struct mtd_partition p2_partitions[] = {
49 /* bootloader (U-Boot, etc) in first sector */
50 {
51 .name = "bootloader",
52 .offset = 0,
53 .size = SZ_128K,
54 .mask_flags = MTD_WRITEABLE, /* force read-only */
55 },
56 /* bootloader params in the next sector */
57 {
58 .name = "params",
59 .offset = MTDPART_OFS_APPEND,
60 .size = SZ_128K,
61 .mask_flags = 0,
62 },
63 /* kernel */
64 {
65 .name = "kernel",
66 .offset = MTDPART_OFS_APPEND,
67 .size = SZ_2M,
68 .mask_flags = 0
69 },
70 /* rest of flash is a file system */
71 {
72 .name = "rootfs",
73 .offset = MTDPART_OFS_APPEND,
74 .size = MTDPART_SIZ_FULL,
75 .mask_flags = 0
76 },
77};
78
79static struct flash_platform_data p2_flash_data = {
80 .map_name = "cfi_probe",
81 .width = 2,
82 .parts = p2_partitions,
83 .nr_parts = ARRAY_SIZE(p2_partitions),
84};
85
86static struct resource p2_flash_resource = {
87 .start = OMAP_FLASH_0_START,
88 .end = OMAP_FLASH_0_START + OMAP_FLASH_0_SIZE - 1,
89 .flags = IORESOURCE_MEM,
90};
91
92static struct platform_device p2_flash_device = {
93 .name = "omapflash",
94 .id = 0,
95 .dev = {
96 .platform_data = &p2_flash_data,
97 },
98 .num_resources = 1,
99 .resource = &p2_flash_resource,
100};
101
102static struct platform_device smc91x_device = {
103 .name = "smc91x",
104 .id = 0,
105 .num_resources = ARRAY_SIZE(smc91x_resources),
106 .resource = smc91x_resources,
107};
108
109static struct platform_device *devices[] __initdata = {
110 &p2_flash_device,
111 &smc91x_device,
112};
113
114static void __init omap_perseus2_init(void)
115{
116 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
117}
118
119static void __init perseus2_init_smc91x(void)
120{
121 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
122 mdelay(50);
123 fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1,
124 H2P2_DBG_FPGA_LAN_RESET);
125 mdelay(50);
126}
127
128void omap_perseus2_init_irq(void)
129{
130 omap_init_irq();
131 omap_gpio_init();
132 perseus2_init_smc91x();
133}
134
135/* Only FPGA needs to be mapped here. All others are done with ioremap */
136static struct map_desc omap_perseus2_io_desc[] __initdata = {
137 {H2P2_DBG_FPGA_BASE, H2P2_DBG_FPGA_START, H2P2_DBG_FPGA_SIZE,
138 MT_DEVICE},
139};
140
141static void __init omap_perseus2_map_io(void)
142{
143 omap_map_io();
144 iotable_init(omap_perseus2_io_desc,
145 ARRAY_SIZE(omap_perseus2_io_desc));
146
147 /* Early, board-dependent init */
148
149 /*
150 * Hold GSM Reset until needed
151 */
152 omap_writew(omap_readw(OMAP730_DSP_M_CTL) & ~1, OMAP730_DSP_M_CTL);
153
154 /*
155 * UARTs -> done automagically by 8250 driver
156 */
157
158 /*
159 * CSx timings, GPIO Mux ... setup
160 */
161
162 /* Flash: CS0 timings setup */
163 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_0);
164 omap_writel(0x00000088, OMAP730_FLASH_ACFG_0);
165
166 /*
167 * Ethernet support trough the debug board
168 * CS1 timings setup
169 */
170 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_1);
171 omap_writel(0x00000000, OMAP730_FLASH_ACFG_1);
172
173 /*
174 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
175 * It is used as the Ethernet controller interrupt
176 */
177 omap_writel(omap_readl(OMAP730_IO_CONF_9) & 0x1FFFFFFF, OMAP730_IO_CONF_9);
178 omap_serial_init(p2_serial_ports);
179}
180
181MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
182 MAINTAINER("Kevin Hilman <kjh@hilman.org>")
183 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
184 BOOT_PARAMS(0x10000100)
185 MAPIO(omap_perseus2_map_io)
186 INITIRQ(omap_perseus2_init_irq)
187 INIT_MACHINE(omap_perseus2_init)
188 .timer = &omap_timer,
189MACHINE_END
diff --git a/arch/arm/mach-omap/board-voiceblue.c b/arch/arm/mach-omap/board-voiceblue.c
new file mode 100644
index 000000000000..f1a5bffac666
--- /dev/null
+++ b/arch/arm/mach-omap/board-voiceblue.c
@@ -0,0 +1,256 @@
1/*
2 * linux/arch/arm/mach-omap/board-voiceblue.c
3 *
4 * Modified from board-generic.c
5 *
6 * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz>
7 *
8 * Code for OMAP5910 based VoiceBlue board (VoIP to GSM gateway).
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/delay.h>
16#include <linux/device.h>
17#include <linux/interrupt.h>
18#include <linux/init.h>
19#include <linux/kernel.h>
20#include <linux/notifier.h>
21#include <linux/reboot.h>
22#include <linux/serial_8250.h>
23#include <linux/serial_reg.h>
24
25#include <asm/hardware.h>
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29
30#include <asm/arch/gpio.h>
31#include <asm/arch/tc.h>
32#include <asm/arch/mux.h>
33#include <asm/arch/usb.h>
34
35#include "common.h"
36
37extern void omap_init_time(void);
38extern int omap_gpio_init(void);
39
40static struct plat_serial8250_port voiceblue_ports[] = {
41 {
42 .mapbase = (unsigned long)(OMAP_CS1_PHYS + 0x40000),
43 .irq = OMAP_GPIO_IRQ(12),
44 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
45 .iotype = UPIO_MEM,
46 .regshift = 1,
47 .uartclk = 3686400,
48 },
49 {
50 .mapbase = (unsigned long)(OMAP_CS1_PHYS + 0x50000),
51 .irq = OMAP_GPIO_IRQ(13),
52 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
53 .iotype = UPIO_MEM,
54 .regshift = 1,
55 .uartclk = 3686400,
56 },
57 {
58 .mapbase = (unsigned long)(OMAP_CS1_PHYS + 0x60000),
59 .irq = OMAP_GPIO_IRQ(14),
60 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
61 .iotype = UPIO_MEM,
62 .regshift = 1,
63 .uartclk = 3686400,
64 },
65 {
66 .mapbase = (unsigned long)(OMAP_CS1_PHYS + 0x70000),
67 .irq = OMAP_GPIO_IRQ(15),
68 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
69 .iotype = UPIO_MEM,
70 .regshift = 1,
71 .uartclk = 3686400,
72 },
73 { },
74};
75
76static struct platform_device serial_device = {
77 .name = "serial8250",
78 .id = 1,
79 .dev = {
80 .platform_data = voiceblue_ports,
81 },
82};
83
84static int __init ext_uart_init(void)
85{
86 return platform_device_register(&serial_device);
87}
88arch_initcall(ext_uart_init);
89
90static struct resource voiceblue_smc91x_resources[] = {
91 [0] = {
92 .start = OMAP_CS2_PHYS + 0x300,
93 .end = OMAP_CS2_PHYS + 0x300 + 16,
94 .flags = IORESOURCE_MEM,
95 },
96 [1] = {
97 .start = OMAP_GPIO_IRQ(8),
98 .end = OMAP_GPIO_IRQ(8),
99 .flags = IORESOURCE_IRQ,
100 },
101};
102
103static struct platform_device voiceblue_smc91x_device = {
104 .name = "smc91x",
105 .id = 0,
106 .num_resources = ARRAY_SIZE(voiceblue_smc91x_resources),
107 .resource = voiceblue_smc91x_resources,
108};
109
110static struct platform_device *voiceblue_devices[] __initdata = {
111 &voiceblue_smc91x_device,
112};
113
114static struct omap_usb_config voiceblue_usb_config __initdata = {
115 .hmc_mode = 3,
116 .register_host = 1,
117 .register_dev = 1,
118 .pins[0] = 2,
119 .pins[1] = 6,
120 .pins[2] = 6,
121};
122
123static struct omap_board_config_kernel voiceblue_config[] = {
124 { OMAP_TAG_USB, &voiceblue_usb_config },
125};
126
127static void __init voiceblue_init_irq(void)
128{
129 omap_init_irq();
130 omap_gpio_init();
131}
132
133static void __init voiceblue_init(void)
134{
135 /* There is a good chance board is going up, so enable Power LED
136 * (it is connected through invertor) */
137 omap_writeb(0x00, OMAP_LPG1_LCR);
138 /* Watchdog */
139 omap_request_gpio(0);
140 /* smc91x reset */
141 omap_request_gpio(7);
142 omap_set_gpio_direction(7, 0);
143 omap_set_gpio_dataout(7, 1);
144 udelay(2); /* wait at least 100ns */
145 omap_set_gpio_dataout(7, 0);
146 mdelay(50); /* 50ms until PHY ready */
147 /* smc91x interrupt pin */
148 omap_request_gpio(8);
149 omap_set_gpio_edge_ctrl(8, OMAP_GPIO_RISING_EDGE);
150 /* 16C554 reset*/
151 omap_request_gpio(6);
152 omap_set_gpio_direction(6, 0);
153 omap_set_gpio_dataout(6, 0);
154 /* 16C554 interrupt pins */
155 omap_request_gpio(12);
156 omap_request_gpio(13);
157 omap_request_gpio(14);
158 omap_request_gpio(15);
159 omap_set_gpio_edge_ctrl(12, OMAP_GPIO_RISING_EDGE);
160 omap_set_gpio_edge_ctrl(13, OMAP_GPIO_RISING_EDGE);
161 omap_set_gpio_edge_ctrl(14, OMAP_GPIO_RISING_EDGE);
162 omap_set_gpio_edge_ctrl(15, OMAP_GPIO_RISING_EDGE);
163
164 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
165 omap_board_config = voiceblue_config;
166 omap_board_config_size = ARRAY_SIZE(voiceblue_config);
167}
168
169static int __initdata omap_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1};
170
171static void __init voiceblue_map_io(void)
172{
173 omap_map_io();
174 omap_serial_init(omap_serial_ports);
175}
176
177#define MACHINE_PANICED 1
178#define MACHINE_REBOOTING 2
179#define MACHINE_REBOOT 4
180static unsigned long machine_state;
181
182static int panic_event(struct notifier_block *this, unsigned long event,
183 void *ptr)
184{
185 if (test_and_set_bit(MACHINE_PANICED, &machine_state))
186 return NOTIFY_DONE;
187
188 /* Flash Power LED
189 * (TODO: Enable clock right way (enabled in bootloader already)) */
190 omap_writeb(0x78, OMAP_LPG1_LCR);
191
192 return NOTIFY_DONE;
193}
194
195static struct notifier_block panic_block = {
196 .notifier_call = panic_event,
197};
198
199static int __init setup_notifier(void)
200{
201 /* Setup panic notifier */
202 notifier_chain_register(&panic_notifier_list, &panic_block);
203
204 return 0;
205}
206
207postcore_initcall(setup_notifier);
208
209static int wdt_gpio_state;
210
211void voiceblue_wdt_enable(void)
212{
213 omap_set_gpio_direction(0, 0);
214 omap_set_gpio_dataout(0, 0);
215 omap_set_gpio_dataout(0, 1);
216 omap_set_gpio_dataout(0, 0);
217 wdt_gpio_state = 0;
218}
219
220void voiceblue_wdt_disable(void)
221{
222 omap_set_gpio_dataout(0, 0);
223 omap_set_gpio_dataout(0, 1);
224 omap_set_gpio_dataout(0, 0);
225 omap_set_gpio_direction(0, 1);
226}
227
228void voiceblue_wdt_ping(void)
229{
230 if (test_bit(MACHINE_REBOOT, &machine_state))
231 return;
232
233 wdt_gpio_state = !wdt_gpio_state;
234 omap_set_gpio_dataout(0, wdt_gpio_state);
235}
236
237void voiceblue_reset(void)
238{
239 set_bit(MACHINE_REBOOT, &machine_state);
240 voiceblue_wdt_enable();
241 while (1) ;
242}
243
244EXPORT_SYMBOL(voiceblue_wdt_enable);
245EXPORT_SYMBOL(voiceblue_wdt_disable);
246EXPORT_SYMBOL(voiceblue_wdt_ping);
247
248MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
249 MAINTAINER("Ladislav Michl <michl@2n.cz>")
250 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
251 BOOT_PARAMS(0x10000100)
252 MAPIO(voiceblue_map_io)
253 INITIRQ(voiceblue_init_irq)
254 INIT_MACHINE(voiceblue_init)
255 .timer = &omap_timer,
256MACHINE_END
diff --git a/arch/arm/mach-omap/clock.c b/arch/arm/mach-omap/clock.c
new file mode 100644
index 000000000000..e91186b5341a
--- /dev/null
+++ b/arch/arm/mach-omap/clock.c
@@ -0,0 +1,1076 @@
1/*
2 * linux/arch/arm/mach-omap/clock.c
3 *
4 * Copyright (C) 2004 Nokia corporation
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/list.h>
14#include <linux/errno.h>
15#include <linux/err.h>
16
17#include <asm/semaphore.h>
18#include <asm/hardware/clock.h>
19#include <asm/arch/board.h>
20#include <asm/arch/usb.h>
21
22#include "clock.h"
23
24static LIST_HEAD(clocks);
25static DECLARE_MUTEX(clocks_sem);
26static DEFINE_SPINLOCK(clockfw_lock);
27static void propagate_rate(struct clk * clk);
28/* External clock (MCLK & BCLK) functions */
29static int set_ext_clk_rate(struct clk * clk, unsigned long rate);
30static long round_ext_clk_rate(struct clk * clk, unsigned long rate);
31static void init_ext_clk(struct clk * clk);
32/* MPU virtual clock functions */
33static int select_table_rate(struct clk * clk, unsigned long rate);
34static long round_to_table_rate(struct clk * clk, unsigned long rate);
35void clk_setdpll(__u16, __u16);
36
37struct mpu_rate rate_table[] = {
38 /* MPU MHz, xtal MHz, dpll1 MHz, CKCTL, DPLL_CTL
39 * armdiv, dspdiv, dspmmu, tcdiv, perdiv, lcddiv
40 */
41#if defined(CONFIG_OMAP_ARM_216MHZ)
42 { 216000000, 12000000, 216000000, 0x050d, 0x2910 }, /* 1/1/2/2/2/8 */
43#endif
44#if defined(CONFIG_OMAP_ARM_195MHZ)
45 { 195000000, 13000000, 195000000, 0x050e, 0x2790 }, /* 1/1/2/2/4/8 */
46#endif
47#if defined(CONFIG_OMAP_ARM_192MHZ)
48 { 192000000, 19200000, 192000000, 0x050f, 0x2510 }, /* 1/1/2/2/8/8 */
49 { 192000000, 12000000, 192000000, 0x050f, 0x2810 }, /* 1/1/2/2/8/8 */
50 { 96000000, 12000000, 192000000, 0x055f, 0x2810 }, /* 2/2/2/2/8/8 */
51 { 48000000, 12000000, 192000000, 0x0ccf, 0x2810 }, /* 4/4/4/4/8/8 */
52 { 24000000, 12000000, 192000000, 0x0fff, 0x2810 }, /* 8/8/8/8/8/8 */
53#endif
54#if defined(CONFIG_OMAP_ARM_182MHZ)
55 { 182000000, 13000000, 182000000, 0x050e, 0x2710 }, /* 1/1/2/2/4/8 */
56#endif
57#if defined(CONFIG_OMAP_ARM_168MHZ)
58 { 168000000, 12000000, 168000000, 0x010f, 0x2710 }, /* 1/1/1/2/8/8 */
59#endif
60#if defined(CONFIG_OMAP_ARM_150MHZ)
61 { 150000000, 12000000, 150000000, 0x150a, 0x2cb0 }, /* 0/0/1/1/2/2 */
62#endif
63#if defined(CONFIG_OMAP_ARM_120MHZ)
64 { 120000000, 12000000, 120000000, 0x010a, 0x2510 }, /* 1/1/1/2/4/4 */
65#endif
66#if defined(CONFIG_OMAP_ARM_96MHZ)
67 { 96000000, 12000000, 96000000, 0x0005, 0x2410 }, /* 1/1/1/1/2/2 */
68#endif
69#if defined(CONFIG_OMAP_ARM_60MHZ)
70 { 60000000, 12000000, 60000000, 0x0005, 0x2290 }, /* 1/1/1/1/2/2 */
71#endif
72#if defined(CONFIG_OMAP_ARM_30MHZ)
73 { 30000000, 12000000, 60000000, 0x0555, 0x2290 }, /* 2/2/2/2/2/2 */
74#endif
75 { 0, 0, 0, 0, 0 },
76};
77
78
79static void ckctl_recalc(struct clk * clk)
80{
81 int dsor;
82
83 /* Calculate divisor encoded as 2-bit exponent */
84 dsor = 1 << (3 & (omap_readw(ARM_CKCTL) >> clk->rate_offset));
85 if (unlikely(clk->rate == clk->parent->rate / dsor))
86 return; /* No change, quick exit */
87 clk->rate = clk->parent->rate / dsor;
88
89 if (unlikely(clk->flags & RATE_PROPAGATES))
90 propagate_rate(clk);
91}
92
93
94static void followparent_recalc(struct clk * clk)
95{
96 clk->rate = clk->parent->rate;
97}
98
99
100static void watchdog_recalc(struct clk * clk)
101{
102 clk->rate = clk->parent->rate / 14;
103}
104
105
106static struct clk ck_ref = {
107 .name = "ck_ref",
108 .rate = 12000000,
109 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
110 ALWAYS_ENABLED,
111};
112
113static struct clk ck_dpll1 = {
114 .name = "ck_dpll1",
115 .parent = &ck_ref,
116 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
117 RATE_PROPAGATES | ALWAYS_ENABLED,
118};
119
120static struct clk ck_dpll1out = {
121 .name = "ck_dpll1out",
122 .parent = &ck_dpll1,
123 .flags = CLOCK_IN_OMAP16XX,
124 .enable_reg = ARM_IDLECT2,
125 .enable_bit = EN_CKOUT_ARM,
126 .recalc = &followparent_recalc,
127};
128
129static struct clk arm_ck = {
130 .name = "arm_ck",
131 .parent = &ck_dpll1,
132 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
133 RATE_CKCTL | RATE_PROPAGATES | ALWAYS_ENABLED,
134 .rate_offset = CKCTL_ARMDIV_OFFSET,
135 .recalc = &ckctl_recalc,
136};
137
138static struct clk armper_ck = {
139 .name = "armper_ck",
140 .parent = &ck_dpll1,
141 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
142 RATE_CKCTL,
143 .enable_reg = ARM_IDLECT2,
144 .enable_bit = EN_PERCK,
145 .rate_offset = CKCTL_PERDIV_OFFSET,
146 .recalc = &ckctl_recalc,
147};
148
149static struct clk arm_gpio_ck = {
150 .name = "arm_gpio_ck",
151 .parent = &ck_dpll1,
152 .flags = CLOCK_IN_OMAP1510,
153 .enable_reg = ARM_IDLECT2,
154 .enable_bit = EN_GPIOCK,
155 .recalc = &followparent_recalc,
156};
157
158static struct clk armxor_ck = {
159 .name = "armxor_ck",
160 .parent = &ck_ref,
161 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX,
162 .enable_reg = ARM_IDLECT2,
163 .enable_bit = EN_XORPCK,
164 .recalc = &followparent_recalc,
165};
166
167static struct clk armtim_ck = {
168 .name = "armtim_ck",
169 .parent = &ck_ref,
170 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX,
171 .enable_reg = ARM_IDLECT2,
172 .enable_bit = EN_TIMCK,
173 .recalc = &followparent_recalc,
174};
175
176static struct clk armwdt_ck = {
177 .name = "armwdt_ck",
178 .parent = &ck_ref,
179 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX,
180 .enable_reg = ARM_IDLECT2,
181 .enable_bit = EN_WDTCK,
182 .recalc = &watchdog_recalc,
183};
184
185static struct clk arminth_ck16xx = {
186 .name = "arminth_ck",
187 .parent = &arm_ck,
188 .flags = CLOCK_IN_OMAP16XX,
189 .recalc = &followparent_recalc,
190 /* Note: On 16xx the frequency can be divided by 2 by programming
191 * ARM_CKCTL:ARM_INTHCK_SEL(14) to 1
192 *
193 * 1510 version is in TC clocks.
194 */
195};
196
197static struct clk dsp_ck = {
198 .name = "dsp_ck",
199 .parent = &ck_dpll1,
200 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
201 RATE_CKCTL,
202 .enable_reg = ARM_CKCTL,
203 .enable_bit = EN_DSPCK,
204 .rate_offset = CKCTL_DSPDIV_OFFSET,
205 .recalc = &ckctl_recalc,
206};
207
208static struct clk dspmmu_ck = {
209 .name = "dspmmu_ck",
210 .parent = &ck_dpll1,
211 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
212 RATE_CKCTL | ALWAYS_ENABLED,
213 .rate_offset = CKCTL_DSPMMUDIV_OFFSET,
214 .recalc = &ckctl_recalc,
215};
216
217static struct clk tc_ck = {
218 .name = "tc_ck",
219 .parent = &ck_dpll1,
220 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP730 |
221 RATE_CKCTL | RATE_PROPAGATES | ALWAYS_ENABLED,
222 .rate_offset = CKCTL_TCDIV_OFFSET,
223 .recalc = &ckctl_recalc,
224};
225
226static struct clk arminth_ck1510 = {
227 .name = "arminth_ck",
228 .parent = &tc_ck,
229 .flags = CLOCK_IN_OMAP1510,
230 .recalc = &followparent_recalc,
231 /* Note: On 1510 the frequency follows TC_CK
232 *
233 * 16xx version is in MPU clocks.
234 */
235};
236
237static struct clk tipb_ck = {
238 .name = "tibp_ck",
239 .parent = &tc_ck,
240 .flags = CLOCK_IN_OMAP1510,
241 .recalc = &followparent_recalc,
242};
243
244static struct clk l3_ocpi_ck = {
245 .name = "l3_ocpi_ck",
246 .parent = &tc_ck,
247 .flags = CLOCK_IN_OMAP16XX,
248 .enable_reg = ARM_IDLECT3,
249 .enable_bit = EN_OCPI_CK,
250 .recalc = &followparent_recalc,
251};
252
253static struct clk tc1_ck = {
254 .name = "tc1_ck",
255 .parent = &tc_ck,
256 .flags = CLOCK_IN_OMAP16XX,
257 .enable_reg = ARM_IDLECT3,
258 .enable_bit = EN_TC1_CK,
259 .recalc = &followparent_recalc,
260};
261
262static struct clk tc2_ck = {
263 .name = "tc2_ck",
264 .parent = &tc_ck,
265 .flags = CLOCK_IN_OMAP16XX,
266 .enable_reg = ARM_IDLECT3,
267 .enable_bit = EN_TC2_CK,
268 .recalc = &followparent_recalc,
269};
270
271static struct clk dma_ck = {
272 .name = "dma_ck",
273 .parent = &tc_ck,
274 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX,
275 .recalc = &followparent_recalc,
276};
277
278static struct clk dma_lcdfree_ck = {
279 .name = "dma_lcdfree_ck",
280 .parent = &tc_ck,
281 .flags = CLOCK_IN_OMAP16XX,
282 .recalc = &followparent_recalc,
283};
284
285static struct clk api_ck = {
286 .name = "api_ck",
287 .parent = &tc_ck,
288 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX,
289 .enable_reg = ARM_IDLECT2,
290 .enable_bit = EN_APICK,
291 .recalc = &followparent_recalc,
292};
293
294static struct clk lb_ck = {
295 .name = "lb_ck",
296 .parent = &tc_ck,
297 .flags = CLOCK_IN_OMAP1510,
298 .enable_reg = ARM_IDLECT2,
299 .enable_bit = EN_LBCK,
300 .recalc = &followparent_recalc,
301};
302
303static struct clk rhea1_ck = {
304 .name = "rhea1_ck",
305 .parent = &tc_ck,
306 .flags = CLOCK_IN_OMAP16XX,
307 .recalc = &followparent_recalc,
308};
309
310static struct clk rhea2_ck = {
311 .name = "rhea2_ck",
312 .parent = &tc_ck,
313 .flags = CLOCK_IN_OMAP16XX,
314 .recalc = &followparent_recalc,
315};
316
317static struct clk lcd_ck = {
318 .name = "lcd_ck",
319 .parent = &ck_dpll1,
320 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP730 |
321 RATE_CKCTL,
322 .enable_reg = ARM_IDLECT2,
323 .enable_bit = EN_LCDCK,
324 .rate_offset = CKCTL_LCDDIV_OFFSET,
325 .recalc = &ckctl_recalc,
326};
327
328static struct clk uart1_ck = {
329 .name = "uart1_ck",
330 /* Direct from ULPD, no parent */
331 .rate = 48000000,
332 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
333 RATE_FIXED | ENABLE_REG_32BIT,
334 .enable_reg = MOD_CONF_CTRL_0,
335 .enable_bit = 29,
336 /* (Only on 1510)
337 * The "enable bit" actually chooses between 48MHz and 12MHz.
338 */
339};
340
341static struct clk uart2_ck = {
342 .name = "uart2_ck",
343 /* Direct from ULPD, no parent */
344 .rate = 48000000,
345 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
346 RATE_FIXED | ENABLE_REG_32BIT,
347 .enable_reg = MOD_CONF_CTRL_0,
348 .enable_bit = 30,
349 /* (for both 1510 and 16xx)
350 * The "enable bit" actually chooses between 48MHz and 12MHz/32kHz.
351 */
352};
353
354static struct clk uart3_ck = {
355 .name = "uart3_ck",
356 /* Direct from ULPD, no parent */
357 .rate = 48000000,
358 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
359 RATE_FIXED | ENABLE_REG_32BIT,
360 .enable_reg = MOD_CONF_CTRL_0,
361 .enable_bit = 31,
362 /* (Only on 1510)
363 * The "enable bit" actually chooses between 48MHz and 12MHz.
364 */
365};
366
367static struct clk usb_clko = { /* 6 MHz output on W4_USB_CLKO */
368 .name = "usb_clko",
369 /* Direct from ULPD, no parent */
370 .rate = 6000000,
371 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
372 RATE_FIXED | ENABLE_REG_32BIT,
373 .enable_reg = ULPD_CLOCK_CTRL,
374 .enable_bit = USB_MCLK_EN_BIT,
375};
376
377static struct clk usb_hhc_ck1510 = {
378 .name = "usb_hhc_ck",
379 /* Direct from ULPD, no parent */
380 .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */
381 .flags = CLOCK_IN_OMAP1510 |
382 RATE_FIXED | ENABLE_REG_32BIT,
383 .enable_reg = MOD_CONF_CTRL_0,
384 .enable_bit = USB_HOST_HHC_UHOST_EN,
385};
386
387static struct clk usb_hhc_ck16xx = {
388 .name = "usb_hhc_ck",
389 /* Direct from ULPD, no parent */
390 .rate = 48000000,
391 /* OTG_SYSCON_2.OTG_PADEN == 0 (not 1510-compatible) */
392 .flags = CLOCK_IN_OMAP16XX |
393 RATE_FIXED | ENABLE_REG_32BIT,
394 .enable_reg = OTG_BASE + 0x08 /* OTG_SYSCON_2 */,
395 .enable_bit = 8 /* UHOST_EN */,
396};
397
398static struct clk mclk_1510 = {
399 .name = "mclk",
400 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
401 .rate = 12000000,
402 .flags = CLOCK_IN_OMAP1510 | RATE_FIXED,
403};
404
405static struct clk mclk_16xx = {
406 .name = "mclk",
407 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
408 .flags = CLOCK_IN_OMAP16XX,
409 .enable_reg = COM_CLK_DIV_CTRL_SEL,
410 .enable_bit = COM_ULPD_PLL_CLK_REQ,
411 .set_rate = &set_ext_clk_rate,
412 .round_rate = &round_ext_clk_rate,
413 .init = &init_ext_clk,
414};
415
416static struct clk bclk_1510 = {
417 .name = "bclk",
418 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
419 .rate = 12000000,
420 .flags = CLOCK_IN_OMAP1510 | RATE_FIXED,
421};
422
423static struct clk bclk_16xx = {
424 .name = "bclk",
425 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
426 .flags = CLOCK_IN_OMAP16XX,
427 .enable_reg = SWD_CLK_DIV_CTRL_SEL,
428 .enable_bit = SWD_ULPD_PLL_CLK_REQ,
429 .set_rate = &set_ext_clk_rate,
430 .round_rate = &round_ext_clk_rate,
431 .init = &init_ext_clk,
432};
433
434static struct clk mmc1_ck = {
435 .name = "mmc1_ck",
436 /* Functional clock is direct from ULPD, interface clock is ARMPER */
437 .parent = &armper_ck,
438 .rate = 48000000,
439 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
440 RATE_FIXED | ENABLE_REG_32BIT,
441 .enable_reg = MOD_CONF_CTRL_0,
442 .enable_bit = 23,
443};
444
445static struct clk mmc2_ck = {
446 .name = "mmc2_ck",
447 /* Functional clock is direct from ULPD, interface clock is ARMPER */
448 .parent = &armper_ck,
449 .rate = 48000000,
450 .flags = CLOCK_IN_OMAP16XX |
451 RATE_FIXED | ENABLE_REG_32BIT,
452 .enable_reg = MOD_CONF_CTRL_0,
453 .enable_bit = 20,
454};
455
456static struct clk virtual_ck_mpu = {
457 .name = "mpu",
458 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
459 VIRTUAL_CLOCK | ALWAYS_ENABLED,
460 .parent = &arm_ck, /* Is smarter alias for */
461 .recalc = &followparent_recalc,
462 .set_rate = &select_table_rate,
463 .round_rate = &round_to_table_rate,
464};
465
466
467static struct clk * onchip_clks[] = {
468 /* non-ULPD clocks */
469 &ck_ref,
470 &ck_dpll1,
471 /* CK_GEN1 clocks */
472 &ck_dpll1out,
473 &arm_ck,
474 &armper_ck,
475 &arm_gpio_ck,
476 &armxor_ck,
477 &armtim_ck,
478 &armwdt_ck,
479 &arminth_ck1510, &arminth_ck16xx,
480 /* CK_GEN2 clocks */
481 &dsp_ck,
482 &dspmmu_ck,
483 /* CK_GEN3 clocks */
484 &tc_ck,
485 &tipb_ck,
486 &l3_ocpi_ck,
487 &tc1_ck,
488 &tc2_ck,
489 &dma_ck,
490 &dma_lcdfree_ck,
491 &api_ck,
492 &lb_ck,
493 &rhea1_ck,
494 &rhea2_ck,
495 &lcd_ck,
496 /* ULPD clocks */
497 &uart1_ck,
498 &uart2_ck,
499 &uart3_ck,
500 &usb_clko,
501 &usb_hhc_ck1510, &usb_hhc_ck16xx,
502 &mclk_1510, &mclk_16xx,
503 &bclk_1510, &bclk_16xx,
504 &mmc1_ck,
505 &mmc2_ck,
506 /* Virtual clocks */
507 &virtual_ck_mpu,
508};
509
510struct clk *clk_get(struct device *dev, const char *id)
511{
512 struct clk *p, *clk = ERR_PTR(-ENOENT);
513
514 down(&clocks_sem);
515 list_for_each_entry(p, &clocks, node) {
516 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
517 clk = p;
518 break;
519 }
520 }
521 up(&clocks_sem);
522
523 return clk;
524}
525EXPORT_SYMBOL(clk_get);
526
527
528void clk_put(struct clk *clk)
529{
530 if (clk && !IS_ERR(clk))
531 module_put(clk->owner);
532}
533EXPORT_SYMBOL(clk_put);
534
535
536int __clk_enable(struct clk *clk)
537{
538 __u16 regval16;
539 __u32 regval32;
540
541 if (clk->flags & ALWAYS_ENABLED)
542 return 0;
543
544 if (unlikely(clk->enable_reg == 0)) {
545 printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
546 clk->name);
547 return 0;
548 }
549
550 if (clk->flags & ENABLE_REG_32BIT) {
551 regval32 = omap_readl(clk->enable_reg);
552 regval32 |= (1 << clk->enable_bit);
553 omap_writel(regval32, clk->enable_reg);
554 } else {
555 regval16 = omap_readw(clk->enable_reg);
556 regval16 |= (1 << clk->enable_bit);
557 omap_writew(regval16, clk->enable_reg);
558 }
559
560 return 0;
561}
562
563
564void __clk_disable(struct clk *clk)
565{
566 __u16 regval16;
567 __u32 regval32;
568
569 if (clk->enable_reg == 0)
570 return;
571
572 if (clk->flags & ENABLE_REG_32BIT) {
573 regval32 = omap_readl(clk->enable_reg);
574 regval32 &= ~(1 << clk->enable_bit);
575 omap_writel(regval32, clk->enable_reg);
576 } else {
577 regval16 = omap_readw(clk->enable_reg);
578 regval16 &= ~(1 << clk->enable_bit);
579 omap_writew(regval16, clk->enable_reg);
580 }
581}
582
583
584void __clk_unuse(struct clk *clk)
585{
586 if (clk->usecount > 0 && !(--clk->usecount)) {
587 __clk_disable(clk);
588 if (likely(clk->parent))
589 __clk_unuse(clk->parent);
590 }
591}
592
593
594int __clk_use(struct clk *clk)
595{
596 int ret = 0;
597 if (clk->usecount++ == 0) {
598 if (likely(clk->parent))
599 ret = __clk_use(clk->parent);
600
601 if (unlikely(ret != 0)) {
602 clk->usecount--;
603 return ret;
604 }
605
606 ret = __clk_enable(clk);
607
608 if (unlikely(ret != 0) && clk->parent) {
609 __clk_unuse(clk->parent);
610 clk->usecount--;
611 }
612 }
613
614 return ret;
615}
616
617
618int clk_enable(struct clk *clk)
619{
620 unsigned long flags;
621 int ret;
622
623 spin_lock_irqsave(&clockfw_lock, flags);
624 ret = __clk_enable(clk);
625 spin_unlock_irqrestore(&clockfw_lock, flags);
626 return ret;
627}
628EXPORT_SYMBOL(clk_enable);
629
630
631void clk_disable(struct clk *clk)
632{
633 unsigned long flags;
634
635 spin_lock_irqsave(&clockfw_lock, flags);
636 __clk_disable(clk);
637 spin_unlock_irqrestore(&clockfw_lock, flags);
638}
639EXPORT_SYMBOL(clk_disable);
640
641
642int clk_use(struct clk *clk)
643{
644 unsigned long flags;
645 int ret = 0;
646
647 spin_lock_irqsave(&clockfw_lock, flags);
648 ret = __clk_use(clk);
649 spin_unlock_irqrestore(&clockfw_lock, flags);
650 return ret;
651}
652EXPORT_SYMBOL(clk_use);
653
654
655void clk_unuse(struct clk *clk)
656{
657 unsigned long flags;
658
659 spin_lock_irqsave(&clockfw_lock, flags);
660 __clk_unuse(clk);
661 spin_unlock_irqrestore(&clockfw_lock, flags);
662}
663EXPORT_SYMBOL(clk_unuse);
664
665
666int clk_get_usecount(struct clk *clk)
667{
668 return clk->usecount;
669}
670EXPORT_SYMBOL(clk_get_usecount);
671
672
673unsigned long clk_get_rate(struct clk *clk)
674{
675 return clk->rate;
676}
677EXPORT_SYMBOL(clk_get_rate);
678
679
680static __u16 verify_ckctl_value(__u16 newval)
681{
682 /* This function checks for following limitations set
683 * by the hardware (all conditions must be true):
684 * DSPMMU_CK == DSP_CK or DSPMMU_CK == DSP_CK/2
685 * ARM_CK >= TC_CK
686 * DSP_CK >= TC_CK
687 * DSPMMU_CK >= TC_CK
688 *
689 * In addition following rules are enforced:
690 * LCD_CK <= TC_CK
691 * ARMPER_CK <= TC_CK
692 *
693 * However, maximum frequencies are not checked for!
694 */
695 __u8 per_exp;
696 __u8 lcd_exp;
697 __u8 arm_exp;
698 __u8 dsp_exp;
699 __u8 tc_exp;
700 __u8 dspmmu_exp;
701
702 per_exp = (newval >> CKCTL_PERDIV_OFFSET) & 3;
703 lcd_exp = (newval >> CKCTL_LCDDIV_OFFSET) & 3;
704 arm_exp = (newval >> CKCTL_ARMDIV_OFFSET) & 3;
705 dsp_exp = (newval >> CKCTL_DSPDIV_OFFSET) & 3;
706 tc_exp = (newval >> CKCTL_TCDIV_OFFSET) & 3;
707 dspmmu_exp = (newval >> CKCTL_DSPMMUDIV_OFFSET) & 3;
708
709 if (dspmmu_exp < dsp_exp)
710 dspmmu_exp = dsp_exp;
711 if (dspmmu_exp > dsp_exp+1)
712 dspmmu_exp = dsp_exp+1;
713 if (tc_exp < arm_exp)
714 tc_exp = arm_exp;
715 if (tc_exp < dspmmu_exp)
716 tc_exp = dspmmu_exp;
717 if (tc_exp > lcd_exp)
718 lcd_exp = tc_exp;
719 if (tc_exp > per_exp)
720 per_exp = tc_exp;
721
722 newval &= 0xf000;
723 newval |= per_exp << CKCTL_PERDIV_OFFSET;
724 newval |= lcd_exp << CKCTL_LCDDIV_OFFSET;
725 newval |= arm_exp << CKCTL_ARMDIV_OFFSET;
726 newval |= dsp_exp << CKCTL_DSPDIV_OFFSET;
727 newval |= tc_exp << CKCTL_TCDIV_OFFSET;
728 newval |= dspmmu_exp << CKCTL_DSPMMUDIV_OFFSET;
729
730 return newval;
731}
732
733
734static int calc_dsor_exp(struct clk *clk, unsigned long rate)
735{
736 /* Note: If target frequency is too low, this function will return 4,
737 * which is invalid value. Caller must check for this value and act
738 * accordingly.
739 *
740 * Note: This function does not check for following limitations set
741 * by the hardware (all conditions must be true):
742 * DSPMMU_CK == DSP_CK or DSPMMU_CK == DSP_CK/2
743 * ARM_CK >= TC_CK
744 * DSP_CK >= TC_CK
745 * DSPMMU_CK >= TC_CK
746 */
747 unsigned long realrate;
748 struct clk * parent;
749 unsigned dsor_exp;
750
751 if (unlikely(!(clk->flags & RATE_CKCTL)))
752 return -EINVAL;
753
754 parent = clk->parent;
755 if (unlikely(parent == 0))
756 return -EIO;
757
758 realrate = parent->rate;
759 for (dsor_exp=0; dsor_exp<4; dsor_exp++) {
760 if (realrate <= rate)
761 break;
762
763 realrate /= 2;
764 }
765
766 return dsor_exp;
767}
768
769long clk_round_rate(struct clk *clk, unsigned long rate)
770{
771 int dsor_exp;
772
773 if (clk->flags & RATE_FIXED)
774 return clk->rate;
775
776 if (clk->flags & RATE_CKCTL) {
777 dsor_exp = calc_dsor_exp(clk, rate);
778 if (dsor_exp < 0)
779 return dsor_exp;
780 if (dsor_exp > 3)
781 dsor_exp = 3;
782 return clk->parent->rate / (1 << dsor_exp);
783 }
784
785 if(clk->round_rate != 0)
786 return clk->round_rate(clk, rate);
787
788 return clk->rate;
789}
790EXPORT_SYMBOL(clk_round_rate);
791
792
793static void propagate_rate(struct clk * clk)
794{
795 struct clk ** clkp;
796
797 for (clkp = onchip_clks; clkp < onchip_clks+ARRAY_SIZE(onchip_clks); clkp++) {
798 if (likely((*clkp)->parent != clk)) continue;
799 if (likely((*clkp)->recalc))
800 (*clkp)->recalc(*clkp);
801 }
802}
803
804
805static int select_table_rate(struct clk * clk, unsigned long rate)
806{
807 /* Find the highest supported frequency <= rate and switch to it */
808 struct mpu_rate * ptr;
809
810 if (clk != &virtual_ck_mpu)
811 return -EINVAL;
812
813 for (ptr = rate_table; ptr->rate; ptr++) {
814 if (ptr->xtal != ck_ref.rate)
815 continue;
816
817 /* DPLL1 cannot be reprogrammed without risking system crash */
818 if (likely(ck_dpll1.rate!=0) && ptr->pll_rate != ck_dpll1.rate)
819 continue;
820
821 /* Can check only after xtal frequency check */
822 if (ptr->rate <= rate)
823 break;
824 }
825
826 if (!ptr->rate)
827 return -EINVAL;
828
829 if (unlikely(ck_dpll1.rate == 0)) {
830 omap_writew(ptr->dpllctl_val, DPLL_CTL);
831 ck_dpll1.rate = ptr->pll_rate;
832 }
833 omap_writew(ptr->ckctl_val, ARM_CKCTL);
834 propagate_rate(&ck_dpll1);
835 return 0;
836}
837
838
839static long round_to_table_rate(struct clk * clk, unsigned long rate)
840{
841 /* Find the highest supported frequency <= rate */
842 struct mpu_rate * ptr;
843 long highest_rate;
844
845 if (clk != &virtual_ck_mpu)
846 return -EINVAL;
847
848 highest_rate = -EINVAL;
849
850 for (ptr = rate_table; ptr->rate; ptr++) {
851 if (ptr->xtal != ck_ref.rate)
852 continue;
853
854 highest_rate = ptr->rate;
855
856 /* Can check only after xtal frequency check */
857 if (ptr->rate <= rate)
858 break;
859 }
860
861 return highest_rate;
862}
863
864
865int clk_set_rate(struct clk *clk, unsigned long rate)
866{
867 int ret = -EINVAL;
868 int dsor_exp;
869 __u16 regval;
870 unsigned long flags;
871
872 if (clk->flags & RATE_CKCTL) {
873 dsor_exp = calc_dsor_exp(clk, rate);
874 if (dsor_exp > 3)
875 dsor_exp = -EINVAL;
876 if (dsor_exp < 0)
877 return dsor_exp;
878
879 spin_lock_irqsave(&clockfw_lock, flags);
880 regval = omap_readw(ARM_CKCTL);
881 regval &= ~(3 << clk->rate_offset);
882 regval |= dsor_exp << clk->rate_offset;
883 regval = verify_ckctl_value(regval);
884 omap_writew(regval, ARM_CKCTL);
885 clk->rate = clk->parent->rate / (1 << dsor_exp);
886 spin_unlock_irqrestore(&clockfw_lock, flags);
887 ret = 0;
888 } else if(clk->set_rate != 0) {
889 spin_lock_irqsave(&clockfw_lock, flags);
890 ret = clk->set_rate(clk, rate);
891 spin_unlock_irqrestore(&clockfw_lock, flags);
892 }
893
894 if (unlikely(ret == 0 && (clk->flags & RATE_PROPAGATES)))
895 propagate_rate(clk);
896
897 return ret;
898}
899EXPORT_SYMBOL(clk_set_rate);
900
901
902static unsigned calc_ext_dsor(unsigned long rate)
903{
904 unsigned dsor;
905
906 /* MCLK and BCLK divisor selection is not linear:
907 * freq = 96MHz / dsor
908 *
909 * RATIO_SEL range: dsor <-> RATIO_SEL
910 * 0..6: (RATIO_SEL+2) <-> (dsor-2)
911 * 6..48: (8+(RATIO_SEL-6)*2) <-> ((dsor-8)/2+6)
912 * Minimum dsor is 2 and maximum is 96. Odd divisors starting from 9
913 * can not be used.
914 */
915 for (dsor = 2; dsor < 96; ++dsor) {
916 if ((dsor & 1) && dsor > 8)
917 continue;
918 if (rate >= 96000000 / dsor)
919 break;
920 }
921 return dsor;
922}
923
924
925static int set_ext_clk_rate(struct clk * clk, unsigned long rate)
926{
927 unsigned dsor;
928 __u16 ratio_bits;
929
930 dsor = calc_ext_dsor(rate);
931 clk->rate = 96000000 / dsor;
932 if (dsor > 8)
933 ratio_bits = ((dsor - 8) / 2 + 6) << 2;
934 else
935 ratio_bits = (dsor - 2) << 2;
936
937 ratio_bits |= omap_readw(clk->enable_reg) & ~0xfd;
938 omap_writew(ratio_bits, clk->enable_reg);
939
940 return 0;
941}
942
943
944static long round_ext_clk_rate(struct clk * clk, unsigned long rate)
945{
946 return 96000000 / calc_ext_dsor(rate);
947}
948
949
950static void init_ext_clk(struct clk * clk)
951{
952 unsigned dsor;
953 __u16 ratio_bits;
954
955 /* Determine current rate and ensure clock is based on 96MHz APLL */
956 ratio_bits = omap_readw(clk->enable_reg) & ~1;
957 omap_writew(ratio_bits, clk->enable_reg);
958
959 ratio_bits = (ratio_bits & 0xfc) >> 2;
960 if (ratio_bits > 6)
961 dsor = (ratio_bits - 6) * 2 + 8;
962 else
963 dsor = ratio_bits + 2;
964
965 clk-> rate = 96000000 / dsor;
966}
967
968
969int clk_register(struct clk *clk)
970{
971 down(&clocks_sem);
972 list_add(&clk->node, &clocks);
973 if (clk->init)
974 clk->init(clk);
975 up(&clocks_sem);
976 return 0;
977}
978EXPORT_SYMBOL(clk_register);
979
980void clk_unregister(struct clk *clk)
981{
982 down(&clocks_sem);
983 list_del(&clk->node);
984 up(&clocks_sem);
985}
986EXPORT_SYMBOL(clk_unregister);
987
988
989
990int __init clk_init(void)
991{
992 struct clk ** clkp;
993 const struct omap_clock_config *info;
994 int crystal_type = 0; /* Default 12 MHz */
995
996 for (clkp = onchip_clks; clkp < onchip_clks+ARRAY_SIZE(onchip_clks); clkp++) {
997 if (((*clkp)->flags &CLOCK_IN_OMAP1510) && cpu_is_omap1510()) {
998 clk_register(*clkp);
999 continue;
1000 }
1001
1002 if (((*clkp)->flags &CLOCK_IN_OMAP16XX) && cpu_is_omap16xx()) {
1003 clk_register(*clkp);
1004 continue;
1005 }
1006
1007 if (((*clkp)->flags &CLOCK_IN_OMAP730) && cpu_is_omap730()) {
1008 clk_register(*clkp);
1009 continue;
1010 }
1011 }
1012
1013 info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config);
1014 if (info != NULL) {
1015 if (!cpu_is_omap1510())
1016 crystal_type = info->system_clock_type;
1017 }
1018
1019#if defined(CONFIG_ARCH_OMAP730)
1020 ck_ref.rate = 13000000;
1021#elif defined(CONFIG_ARCH_OMAP16XX)
1022 if (crystal_type == 2)
1023 ck_ref.rate = 19200000;
1024#endif
1025
1026 /* We want to be in syncronous scalable mode */
1027 omap_writew(0x1000, ARM_SYSST);
1028
1029 /* Find the highest supported frequency and enable it */
1030 if (select_table_rate(&virtual_ck_mpu, ~0)) {
1031 printk(KERN_ERR "System frequencies not set. Check your config.\n");
1032 /* Guess sane values (60MHz) */
1033 omap_writew(0x2290, DPLL_CTL);
1034 omap_writew(0x1005, ARM_CKCTL);
1035 ck_dpll1.rate = 60000000;
1036 propagate_rate(&ck_dpll1);
1037 printk(KERN_INFO "Clocking rate (xtal/DPLL1/MPU): %ld/%ld/%ld\n",
1038 ck_ref.rate, ck_dpll1.rate, arm_ck.rate);
1039 }
1040
1041 /* Cache rates for clocks connected to ck_ref (not dpll1) */
1042 propagate_rate(&ck_ref);
1043
1044#ifdef CONFIG_MACH_OMAP_PERSEUS2
1045 /* Select slicer output as OMAP input clock */
1046 omap_writew(omap_readw(OMAP730_PCC_UPLD_CTRL) & ~0x1, OMAP730_PCC_UPLD_CTRL);
1047#endif
1048
1049 /* Turn off DSP and ARM_TIMXO. Make sure ARM_INTHCK is not divided */
1050 omap_writew(omap_readw(ARM_CKCTL) & 0x0fff, ARM_CKCTL);
1051
1052 /* Put DSP/MPUI into reset until needed */
1053 omap_writew(0, ARM_RSTCT1);
1054 omap_writew(1, ARM_RSTCT2);
1055 omap_writew(0x400, ARM_IDLECT1);
1056
1057 /*
1058 * According to OMAP5910 Erratum SYS_DMA_1, bit DMACK_REQ (bit 8)
1059 * of the ARM_IDLECT2 register must be set to zero. The power-on
1060 * default value of this bit is one.
1061 */
1062 omap_writew(0x0000, ARM_IDLECT2); /* Turn LCD clock off also */
1063
1064 /*
1065 * Only enable those clocks we will need, let the drivers
1066 * enable other clocks as necessary
1067 */
1068 clk_use(&armper_ck);
1069 clk_use(&armxor_ck);
1070 clk_use(&armtim_ck);
1071
1072 if (cpu_is_omap1510())
1073 clk_enable(&arm_gpio_ck);
1074
1075 return 0;
1076}
diff --git a/arch/arm/mach-omap/clock.h b/arch/arm/mach-omap/clock.h
new file mode 100644
index 000000000000..08c0ddde1835
--- /dev/null
+++ b/arch/arm/mach-omap/clock.h
@@ -0,0 +1,112 @@
1/*
2 * linux/arch/arm/mach-omap/clock.h
3 *
4 * Copyright (C) 2004 Nokia corporation
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ARCH_ARM_OMAP_CLOCK_H
14#define __ARCH_ARM_OMAP_CLOCK_H
15
16struct module;
17
18struct clk {
19 struct list_head node;
20 struct module *owner;
21 const char *name;
22 struct clk *parent;
23 unsigned long rate;
24 __s8 usecount;
25 __u16 flags;
26 __u32 enable_reg;
27 __u8 enable_bit;
28 __u8 rate_offset;
29 void (*recalc)(struct clk *);
30 int (*set_rate)(struct clk *, unsigned long);
31 long (*round_rate)(struct clk *, unsigned long);
32 void (*init)(struct clk *);
33};
34
35
36struct mpu_rate {
37 unsigned long rate;
38 unsigned long xtal;
39 unsigned long pll_rate;
40 __u16 ckctl_val;
41 __u16 dpllctl_val;
42};
43
44
45/* Clock flags */
46#define RATE_CKCTL 1
47#define RATE_FIXED 2
48#define RATE_PROPAGATES 4
49#define VIRTUAL_CLOCK 8
50#define ALWAYS_ENABLED 16
51#define ENABLE_REG_32BIT 32
52#define CLOCK_IN_OMAP16XX 64
53#define CLOCK_IN_OMAP1510 128
54#define CLOCK_IN_OMAP730 256
55
56/* ARM_CKCTL bit shifts */
57#define CKCTL_PERDIV_OFFSET 0
58#define CKCTL_LCDDIV_OFFSET 2
59#define CKCTL_ARMDIV_OFFSET 4
60#define CKCTL_DSPDIV_OFFSET 6
61#define CKCTL_TCDIV_OFFSET 8
62#define CKCTL_DSPMMUDIV_OFFSET 10
63/*#define ARM_TIMXO 12*/
64#define EN_DSPCK 13
65/*#define ARM_INTHCK_SEL 14*/ /* Divide-by-2 for mpu inth_ck */
66
67/* ARM_IDLECT1 bit shifts */
68/*#define IDLWDT_ARM 0*/
69/*#define IDLXORP_ARM 1*/
70/*#define IDLPER_ARM 2*/
71/*#define IDLLCD_ARM 3*/
72/*#define IDLLB_ARM 4*/
73/*#define IDLHSAB_ARM 5*/
74/*#define IDLIF_ARM 6*/
75/*#define IDLDPLL_ARM 7*/
76/*#define IDLAPI_ARM 8*/
77/*#define IDLTIM_ARM 9*/
78/*#define SETARM_IDLE 11*/
79
80/* ARM_IDLECT2 bit shifts */
81#define EN_WDTCK 0
82#define EN_XORPCK 1
83#define EN_PERCK 2
84#define EN_LCDCK 3
85#define EN_LBCK 4 /* Not on 1610/1710 */
86/*#define EN_HSABCK 5*/
87#define EN_APICK 6
88#define EN_TIMCK 7
89#define DMACK_REQ 8
90#define EN_GPIOCK 9 /* Not on 1610/1710 */
91/*#define EN_LBFREECK 10*/
92#define EN_CKOUT_ARM 11
93
94/* ARM_IDLECT3 bit shifts */
95#define EN_OCPI_CK 0
96#define EN_TC1_CK 2
97#define EN_TC2_CK 4
98
99/* Various register defines for clock controls scattered around OMAP chip */
100#define USB_MCLK_EN_BIT 4 /* In ULPD_CLKC_CTRL */
101#define USB_HOST_HHC_UHOST_EN 9 /* In MOD_CONF_CTRL_0 */
102#define SWD_ULPD_PLL_CLK_REQ 1 /* In SWD_CLK_DIV_CTRL_SEL */
103#define COM_ULPD_PLL_CLK_REQ 1 /* In COM_CLK_DIV_CTRL_SEL */
104#define SWD_CLK_DIV_CTRL_SEL 0xfffe0874
105#define COM_CLK_DIV_CTRL_SEL 0xfffe0878
106
107
108int clk_register(struct clk *clk);
109void clk_unregister(struct clk *clk);
110int clk_init(void);
111
112#endif
diff --git a/arch/arm/mach-omap/common.c b/arch/arm/mach-omap/common.c
new file mode 100644
index 000000000000..265cde48586f
--- /dev/null
+++ b/arch/arm/mach-omap/common.c
@@ -0,0 +1,549 @@
1/*
2 * linux/arch/arm/mach-omap/common.c
3 *
4 * Code common to all OMAP machines.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/config.h>
11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/delay.h>
15#include <linux/pm.h>
16#include <linux/console.h>
17#include <linux/serial.h>
18#include <linux/tty.h>
19#include <linux/serial_8250.h>
20#include <linux/serial_reg.h>
21
22#include <asm/hardware.h>
23#include <asm/system.h>
24#include <asm/pgtable.h>
25#include <asm/mach/map.h>
26#include <asm/hardware/clock.h>
27#include <asm/io.h>
28#include <asm/mach-types.h>
29
30#include <asm/arch/board.h>
31#include <asm/arch/mux.h>
32#include <asm/arch/fpga.h>
33
34#include "clock.h"
35
36#define DEBUG 1
37
38struct omap_id {
39 u16 jtag_id; /* Used to determine OMAP type */
40 u8 die_rev; /* Processor revision */
41 u32 omap_id; /* OMAP revision */
42 u32 type; /* Cpu id bits [31:08], cpu class bits [07:00] */
43};
44
45/* Register values to detect the OMAP version */
46static struct omap_id omap_ids[] __initdata = {
47 { .jtag_id = 0x355f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300100},
48 { .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300300},
49 { .jtag_id = 0xb470, .die_rev = 0x0, .omap_id = 0x03310100, .type = 0x15100000},
50 { .jtag_id = 0xb576, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x16100000},
51 { .jtag_id = 0xb576, .die_rev = 0x2, .omap_id = 0x03320100, .type = 0x16110000},
52 { .jtag_id = 0xb576, .die_rev = 0x3, .omap_id = 0x03320100, .type = 0x16100c00},
53 { .jtag_id = 0xb576, .die_rev = 0x0, .omap_id = 0x03320200, .type = 0x16100d00},
54 { .jtag_id = 0xb613, .die_rev = 0x0, .omap_id = 0x03320300, .type = 0x1610ef00},
55 { .jtag_id = 0xb613, .die_rev = 0x0, .omap_id = 0x03320300, .type = 0x1610ef00},
56 { .jtag_id = 0xb576, .die_rev = 0x1, .omap_id = 0x03320100, .type = 0x16110000},
57 { .jtag_id = 0xb58c, .die_rev = 0x2, .omap_id = 0x03320200, .type = 0x16110b00},
58 { .jtag_id = 0xb58c, .die_rev = 0x3, .omap_id = 0x03320200, .type = 0x16110c00},
59 { .jtag_id = 0xb65f, .die_rev = 0x0, .omap_id = 0x03320400, .type = 0x16212300},
60 { .jtag_id = 0xb65f, .die_rev = 0x1, .omap_id = 0x03320400, .type = 0x16212300},
61 { .jtag_id = 0xb65f, .die_rev = 0x1, .omap_id = 0x03320500, .type = 0x16212300},
62 { .jtag_id = 0xb5f7, .die_rev = 0x0, .omap_id = 0x03330000, .type = 0x17100000},
63 { .jtag_id = 0xb5f7, .die_rev = 0x1, .omap_id = 0x03330100, .type = 0x17100000},
64 { .jtag_id = 0xb5f7, .die_rev = 0x2, .omap_id = 0x03330100, .type = 0x17100000},
65};
66
67/*
68 * Get OMAP type from PROD_ID.
69 * 1710 has the PROD_ID in bits 15:00, not in 16:01 as documented in TRM.
70 * 1510 PROD_ID is empty, and 1610 PROD_ID does not make sense.
71 * Undocumented register in TEST BLOCK is used as fallback; This seems to
72 * work on 1510, 1610 & 1710. The official way hopefully will work in future
73 * processors.
74 */
75static u16 __init omap_get_jtag_id(void)
76{
77 u32 prod_id, omap_id;
78
79 prod_id = omap_readl(OMAP_PRODUCTION_ID_1);
80 omap_id = omap_readl(OMAP32_ID_1);
81
82 /* Check for unusable OMAP_PRODUCTION_ID_1 on 1611B/5912 and 730 */
83 if (((prod_id >> 20) == 0) || (prod_id == omap_id))
84 prod_id = 0;
85 else
86 prod_id &= 0xffff;
87
88 if (prod_id)
89 return prod_id;
90
91 /* Use OMAP32_ID_1 as fallback */
92 prod_id = ((omap_id >> 12) & 0xffff);
93
94 return prod_id;
95}
96
97/*
98 * Get OMAP revision from DIE_REV.
99 * Early 1710 processors may have broken OMAP_DIE_ID, it contains PROD_ID.
100 * Undocumented register in the TEST BLOCK is used as fallback.
101 * REVISIT: This does not seem to work on 1510
102 */
103static u8 __init omap_get_die_rev(void)
104{
105 u32 die_rev;
106
107 die_rev = omap_readl(OMAP_DIE_ID_1);
108
109 /* Check for broken OMAP_DIE_ID on early 1710 */
110 if (((die_rev >> 12) & 0xffff) == omap_get_jtag_id())
111 die_rev = 0;
112
113 die_rev = (die_rev >> 17) & 0xf;
114 if (die_rev)
115 return die_rev;
116
117 die_rev = (omap_readl(OMAP32_ID_1) >> 28) & 0xf;
118
119 return die_rev;
120}
121
122static void __init omap_check_revision(void)
123{
124 int i;
125 u16 jtag_id;
126 u8 die_rev;
127 u32 omap_id;
128 u8 cpu_type;
129
130 jtag_id = omap_get_jtag_id();
131 die_rev = omap_get_die_rev();
132 omap_id = omap_readl(OMAP32_ID_0);
133
134#ifdef DEBUG
135 printk("OMAP_DIE_ID_0: 0x%08x\n", omap_readl(OMAP_DIE_ID_0));
136 printk("OMAP_DIE_ID_1: 0x%08x DIE_REV: %i\n",
137 omap_readl(OMAP_DIE_ID_1),
138 (omap_readl(OMAP_DIE_ID_1) >> 17) & 0xf);
139 printk("OMAP_PRODUCTION_ID_0: 0x%08x\n", omap_readl(OMAP_PRODUCTION_ID_0));
140 printk("OMAP_PRODUCTION_ID_1: 0x%08x JTAG_ID: 0x%04x\n",
141 omap_readl(OMAP_PRODUCTION_ID_1),
142 omap_readl(OMAP_PRODUCTION_ID_1) & 0xffff);
143 printk("OMAP32_ID_0: 0x%08x\n", omap_readl(OMAP32_ID_0));
144 printk("OMAP32_ID_1: 0x%08x\n", omap_readl(OMAP32_ID_1));
145 printk("JTAG_ID: 0x%04x DIE_REV: %i\n", jtag_id, die_rev);
146#endif
147
148 system_serial_high = omap_readl(OMAP_DIE_ID_0);
149 system_serial_low = omap_readl(OMAP_DIE_ID_1);
150
151 /* First check only the major version in a safe way */
152 for (i = 0; i < ARRAY_SIZE(omap_ids); i++) {
153 if (jtag_id == (omap_ids[i].jtag_id)) {
154 system_rev = omap_ids[i].type;
155 break;
156 }
157 }
158
159 /* Check if we can find the die revision */
160 for (i = 0; i < ARRAY_SIZE(omap_ids); i++) {
161 if (jtag_id == omap_ids[i].jtag_id && die_rev == omap_ids[i].die_rev) {
162 system_rev = omap_ids[i].type;
163 break;
164 }
165 }
166
167 /* Finally check also the omap_id */
168 for (i = 0; i < ARRAY_SIZE(omap_ids); i++) {
169 if (jtag_id == omap_ids[i].jtag_id
170 && die_rev == omap_ids[i].die_rev
171 && omap_id == omap_ids[i].omap_id) {
172 system_rev = omap_ids[i].type;
173 break;
174 }
175 }
176
177 /* Add the cpu class info (7xx, 15xx, 16xx, 24xx) */
178 cpu_type = system_rev >> 24;
179
180 switch (cpu_type) {
181 case 0x07:
182 system_rev |= 0x07;
183 break;
184 case 0x15:
185 system_rev |= 0x15;
186 break;
187 case 0x16:
188 case 0x17:
189 system_rev |= 0x16;
190 break;
191 case 0x24:
192 system_rev |= 0x24;
193 break;
194 default:
195 printk("Unknown OMAP cpu type: 0x%02x\n", cpu_type);
196 }
197
198 printk("OMAP%04x", system_rev >> 16);
199 if ((system_rev >> 8) & 0xff)
200 printk("%x", (system_rev >> 8) & 0xff);
201 printk(" revision %i handled as %02xxx id: %08x%08x\n",
202 die_rev, system_rev & 0xff, system_serial_low,
203 system_serial_high);
204}
205
206/*
207 * ----------------------------------------------------------------------------
208 * OMAP I/O mapping
209 *
210 * The machine specific code may provide the extra mapping besides the
211 * default mapping provided here.
212 * ----------------------------------------------------------------------------
213 */
214
215static struct map_desc omap_io_desc[] __initdata = {
216 { IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE },
217};
218
219#ifdef CONFIG_ARCH_OMAP730
220static struct map_desc omap730_io_desc[] __initdata = {
221 { OMAP730_DSP_BASE, OMAP730_DSP_START, OMAP730_DSP_SIZE, MT_DEVICE },
222 { OMAP730_DSPREG_BASE, OMAP730_DSPREG_START, OMAP730_DSPREG_SIZE, MT_DEVICE },
223 { OMAP730_SRAM_BASE, OMAP730_SRAM_START, OMAP730_SRAM_SIZE, MT_DEVICE }
224};
225#endif
226
227#ifdef CONFIG_ARCH_OMAP1510
228static struct map_desc omap1510_io_desc[] __initdata = {
229 { OMAP1510_DSP_BASE, OMAP1510_DSP_START, OMAP1510_DSP_SIZE, MT_DEVICE },
230 { OMAP1510_DSPREG_BASE, OMAP1510_DSPREG_START, OMAP1510_DSPREG_SIZE, MT_DEVICE },
231 { OMAP1510_SRAM_BASE, OMAP1510_SRAM_START, OMAP1510_SRAM_SIZE, MT_DEVICE }
232};
233#endif
234
235#if defined(CONFIG_ARCH_OMAP16XX)
236static struct map_desc omap1610_io_desc[] __initdata = {
237 { OMAP16XX_DSP_BASE, OMAP16XX_DSP_START, OMAP16XX_DSP_SIZE, MT_DEVICE },
238 { OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_START, OMAP16XX_DSPREG_SIZE, MT_DEVICE },
239 { OMAP16XX_SRAM_BASE, OMAP16XX_SRAM_START, OMAP1610_SRAM_SIZE, MT_DEVICE }
240};
241
242static struct map_desc omap5912_io_desc[] __initdata = {
243 { OMAP16XX_DSP_BASE, OMAP16XX_DSP_START, OMAP16XX_DSP_SIZE, MT_DEVICE },
244 { OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_START, OMAP16XX_DSPREG_SIZE, MT_DEVICE },
245/*
246 * The OMAP5912 has 250kByte internal SRAM. Because the mapping is baseed on page
247 * size (4kByte), it seems that the last 2kByte (=0x800) of the 250kByte are not mapped.
248 * Add additional 2kByte (0x800) so that the last page is mapped and the last 2kByte
249 * can be used.
250 */
251 { OMAP16XX_SRAM_BASE, OMAP16XX_SRAM_START, OMAP5912_SRAM_SIZE + 0x800, MT_DEVICE }
252};
253#endif
254
255static int initialized = 0;
256
257static void __init _omap_map_io(void)
258{
259 initialized = 1;
260
261 /* We have to initialize the IO space mapping before we can run
262 * cpu_is_omapxxx() macros. */
263 iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc));
264 omap_check_revision();
265
266#ifdef CONFIG_ARCH_OMAP730
267 if (cpu_is_omap730()) {
268 iotable_init(omap730_io_desc, ARRAY_SIZE(omap730_io_desc));
269 }
270#endif
271#ifdef CONFIG_ARCH_OMAP1510
272 if (cpu_is_omap1510()) {
273 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc));
274 }
275#endif
276#if defined(CONFIG_ARCH_OMAP16XX)
277 if (cpu_is_omap1610() || cpu_is_omap1710()) {
278 iotable_init(omap1610_io_desc, ARRAY_SIZE(omap1610_io_desc));
279 }
280 if (cpu_is_omap5912()) {
281 iotable_init(omap5912_io_desc, ARRAY_SIZE(omap5912_io_desc));
282 }
283#endif
284
285 /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
286 * on a Posted Write in the TIPB Bridge".
287 */
288 omap_writew(0x0, MPU_PUBLIC_TIPB_CNTL);
289 omap_writew(0x0, MPU_PRIVATE_TIPB_CNTL);
290
291 /* Must init clocks early to assure that timer interrupt works
292 */
293 clk_init();
294}
295
296/*
297 * This should only get called from board specific init
298 */
299void omap_map_io(void)
300{
301 if (!initialized)
302 _omap_map_io();
303}
304
305static inline unsigned int omap_serial_in(struct plat_serial8250_port *up,
306 int offset)
307{
308 offset <<= up->regshift;
309 return (unsigned int)__raw_readb(up->membase + offset);
310}
311
312static inline void omap_serial_outp(struct plat_serial8250_port *p, int offset,
313 int value)
314{
315 offset <<= p->regshift;
316 __raw_writeb(value, p->membase + offset);
317}
318
319/*
320 * Internal UARTs need to be initialized for the 8250 autoconfig to work
321 * properly. Note that the TX watermark initialization may not be needed
322 * once the 8250.c watermark handling code is merged.
323 */
324static void __init omap_serial_reset(struct plat_serial8250_port *p)
325{
326 omap_serial_outp(p, UART_OMAP_MDR1, 0x07); /* disable UART */
327 omap_serial_outp(p, UART_OMAP_SCR, 0x08); /* TX watermark */
328 omap_serial_outp(p, UART_OMAP_MDR1, 0x00); /* enable UART */
329
330 if (!cpu_is_omap1510()) {
331 omap_serial_outp(p, UART_OMAP_SYSC, 0x01);
332 while (!(omap_serial_in(p, UART_OMAP_SYSC) & 0x01));
333 }
334}
335
336static struct plat_serial8250_port serial_platform_data[] = {
337 {
338 .membase = (char*)IO_ADDRESS(OMAP_UART1_BASE),
339 .mapbase = (unsigned long)OMAP_UART1_BASE,
340 .irq = INT_UART1,
341 .flags = UPF_BOOT_AUTOCONF,
342 .iotype = UPIO_MEM,
343 .regshift = 2,
344 .uartclk = OMAP16XX_BASE_BAUD * 16,
345 },
346 {
347 .membase = (char*)IO_ADDRESS(OMAP_UART2_BASE),
348 .mapbase = (unsigned long)OMAP_UART2_BASE,
349 .irq = INT_UART2,
350 .flags = UPF_BOOT_AUTOCONF,
351 .iotype = UPIO_MEM,
352 .regshift = 2,
353 .uartclk = OMAP16XX_BASE_BAUD * 16,
354 },
355 {
356 .membase = (char*)IO_ADDRESS(OMAP_UART3_BASE),
357 .mapbase = (unsigned long)OMAP_UART3_BASE,
358 .irq = INT_UART3,
359 .flags = UPF_BOOT_AUTOCONF,
360 .iotype = UPIO_MEM,
361 .regshift = 2,
362 .uartclk = OMAP16XX_BASE_BAUD * 16,
363 },
364 { },
365};
366
367static struct platform_device serial_device = {
368 .name = "serial8250",
369 .id = 0,
370 .dev = {
371 .platform_data = serial_platform_data,
372 },
373};
374
375/*
376 * Note that on Innovator-1510 UART2 pins conflict with USB2.
377 * By default UART2 does not work on Innovator-1510 if you have
378 * USB OHCI enabled. To use UART2, you must disable USB2 first.
379 */
380void __init omap_serial_init(int ports[OMAP_MAX_NR_PORTS])
381{
382 int i;
383
384 if (cpu_is_omap730()) {
385 serial_platform_data[0].regshift = 0;
386 serial_platform_data[1].regshift = 0;
387 serial_platform_data[0].irq = INT_730_UART_MODEM_1;
388 serial_platform_data[1].irq = INT_730_UART_MODEM_IRDA_2;
389 }
390
391 if (cpu_is_omap1510()) {
392 serial_platform_data[0].uartclk = OMAP1510_BASE_BAUD * 16;
393 serial_platform_data[1].uartclk = OMAP1510_BASE_BAUD * 16;
394 serial_platform_data[2].uartclk = OMAP1510_BASE_BAUD * 16;
395 }
396
397 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
398 unsigned char reg;
399
400 if (ports[i] == 0) {
401 serial_platform_data[i].membase = 0;
402 serial_platform_data[i].mapbase = 0;
403 continue;
404 }
405
406 switch (i) {
407 case 0:
408 if (cpu_is_omap1510()) {
409 omap_cfg_reg(UART1_TX);
410 omap_cfg_reg(UART1_RTS);
411 if (machine_is_omap_innovator()) {
412 reg = fpga_read(OMAP1510_FPGA_POWER);
413 reg |= OMAP1510_FPGA_PCR_COM1_EN;
414 fpga_write(reg, OMAP1510_FPGA_POWER);
415 udelay(10);
416 }
417 }
418 break;
419 case 1:
420 if (cpu_is_omap1510()) {
421 omap_cfg_reg(UART2_TX);
422 omap_cfg_reg(UART2_RTS);
423 if (machine_is_omap_innovator()) {
424 reg = fpga_read(OMAP1510_FPGA_POWER);
425 reg |= OMAP1510_FPGA_PCR_COM2_EN;
426 fpga_write(reg, OMAP1510_FPGA_POWER);
427 udelay(10);
428 }
429 }
430 break;
431 case 2:
432 if (cpu_is_omap1510()) {
433 omap_cfg_reg(UART3_TX);
434 omap_cfg_reg(UART3_RX);
435 }
436 if (cpu_is_omap1710()) {
437 clk_enable(clk_get(0, "uart3_ck"));
438 }
439 break;
440 }
441 omap_serial_reset(&serial_platform_data[i]);
442 }
443}
444
445static int __init omap_init(void)
446{
447 return platform_device_register(&serial_device);
448}
449arch_initcall(omap_init);
450
451#define NO_LENGTH_CHECK 0xffffffff
452
453extern int omap_bootloader_tag_len;
454extern u8 omap_bootloader_tag[];
455
456struct omap_board_config_kernel *omap_board_config;
457int omap_board_config_size = 0;
458
459static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
460{
461 struct omap_board_config_kernel *kinfo = NULL;
462 int i;
463
464#ifdef CONFIG_OMAP_BOOT_TAG
465 struct omap_board_config_entry *info = NULL;
466
467 if (omap_bootloader_tag_len > 4)
468 info = (struct omap_board_config_entry *) omap_bootloader_tag;
469 while (info != NULL) {
470 u8 *next;
471
472 if (info->tag == tag) {
473 if (skip == 0)
474 break;
475 skip--;
476 }
477
478 if ((info->len & 0x03) != 0) {
479 /* We bail out to avoid an alignment fault */
480 printk(KERN_ERR "OMAP peripheral config: Length (%d) not word-aligned (tag %04x)\n",
481 info->len, info->tag);
482 return NULL;
483 }
484 next = (u8 *) info + sizeof(*info) + info->len;
485 if (next >= omap_bootloader_tag + omap_bootloader_tag_len)
486 info = NULL;
487 else
488 info = (struct omap_board_config_entry *) next;
489 }
490 if (info != NULL) {
491 /* Check the length as a lame attempt to check for
492 * binary inconsistancy. */
493 if (len != NO_LENGTH_CHECK) {
494 /* Word-align len */
495 if (len & 0x03)
496 len = (len + 3) & ~0x03;
497 if (info->len != len) {
498 printk(KERN_ERR "OMAP peripheral config: Length mismatch with tag %x (want %d, got %d)\n",
499 tag, len, info->len);
500 return NULL;
501 }
502 }
503 if (len_out != NULL)
504 *len_out = info->len;
505 return info->data;
506 }
507#endif
508 /* Try to find the config from the board-specific structures
509 * in the kernel. */
510 for (i = 0; i < omap_board_config_size; i++) {
511 if (omap_board_config[i].tag == tag) {
512 kinfo = &omap_board_config[i];
513 break;
514 }
515 }
516 if (kinfo == NULL)
517 return NULL;
518 return kinfo->data;
519}
520
521const void *__omap_get_config(u16 tag, size_t len, int nr)
522{
523 return get_config(tag, len, nr, NULL);
524}
525EXPORT_SYMBOL(__omap_get_config);
526
527const void *omap_get_var_config(u16 tag, size_t *len)
528{
529 return get_config(tag, NO_LENGTH_CHECK, 0, len);
530}
531EXPORT_SYMBOL(omap_get_var_config);
532
533static int __init omap_add_serial_console(void)
534{
535 const struct omap_uart_config *info;
536
537 info = omap_get_config(OMAP_TAG_UART, struct omap_uart_config);
538 if (info != NULL && info->console_uart) {
539 static char speed[11], *opt = NULL;
540
541 if (info->console_speed) {
542 snprintf(speed, sizeof(speed), "%u", info->console_speed);
543 opt = speed;
544 }
545 return add_preferred_console("ttyS", info->console_uart - 1, opt);
546 }
547 return 0;
548}
549console_initcall(omap_add_serial_console);
diff --git a/arch/arm/mach-omap/common.h b/arch/arm/mach-omap/common.h
new file mode 100644
index 000000000000..9f62858c0df4
--- /dev/null
+++ b/arch/arm/mach-omap/common.h
@@ -0,0 +1,36 @@
1/*
2 * linux/arch/arm/mach-omap/common.h
3 *
4 * Header for code common to all OMAP machines.
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
15 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
18 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26
27#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
28#define __ARCH_ARM_MACH_OMAP_COMMON_H
29
30struct sys_timer;
31
32extern void omap_map_io(void);
33extern struct sys_timer omap_timer;
34extern void omap_serial_init(int ports[]);
35
36#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
diff --git a/arch/arm/mach-omap/dma.c b/arch/arm/mach-omap/dma.c
new file mode 100644
index 000000000000..7a9ebe80d6f8
--- /dev/null
+++ b/arch/arm/mach-omap/dma.c
@@ -0,0 +1,1086 @@
1/*
2 * linux/arch/arm/omap/dma.c
3 *
4 * Copyright (C) 2003 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
6 * DMA channel linking for 1610 by Samuel Ortiz <samuel.ortiz@nokia.com>
7 * Graphics DMA and LCD DMA graphics tranformations
8 * by Imre Deak <imre.deak@nokia.com>
9 * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc.
10 *
11 * Support functions for the OMAP internal DMA channels.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 *
17 */
18
19#include <linux/module.h>
20#include <linux/init.h>
21#include <linux/sched.h>
22#include <linux/spinlock.h>
23#include <linux/errno.h>
24#include <linux/interrupt.h>
25
26#include <asm/system.h>
27#include <asm/irq.h>
28#include <asm/hardware.h>
29#include <asm/dma.h>
30#include <asm/io.h>
31
32#include <asm/arch/tc.h>
33
34#define OMAP_DMA_ACTIVE 0x01
35
36#define OMAP_DMA_CCR_EN (1 << 7)
37
38#define OMAP_FUNC_MUX_ARM_BASE (0xfffe1000 + 0xec)
39
40static int enable_1510_mode = 0;
41
42struct omap_dma_lch {
43 int next_lch;
44 int dev_id;
45 u16 saved_csr;
46 u16 enabled_irqs;
47 const char *dev_name;
48 void (* callback)(int lch, u16 ch_status, void *data);
49 void *data;
50 long flags;
51};
52
53static int dma_chan_count;
54
55static spinlock_t dma_chan_lock;
56static struct omap_dma_lch dma_chan[OMAP_LOGICAL_DMA_CH_COUNT];
57
58const static u8 dma_irq[OMAP_LOGICAL_DMA_CH_COUNT] = {
59 INT_DMA_CH0_6, INT_DMA_CH1_7, INT_DMA_CH2_8, INT_DMA_CH3,
60 INT_DMA_CH4, INT_DMA_CH5, INT_1610_DMA_CH6, INT_1610_DMA_CH7,
61 INT_1610_DMA_CH8, INT_1610_DMA_CH9, INT_1610_DMA_CH10,
62 INT_1610_DMA_CH11, INT_1610_DMA_CH12, INT_1610_DMA_CH13,
63 INT_1610_DMA_CH14, INT_1610_DMA_CH15, INT_DMA_LCD
64};
65
66static inline int get_gdma_dev(int req)
67{
68 u32 reg = OMAP_FUNC_MUX_ARM_BASE + ((req - 1) / 5) * 4;
69 int shift = ((req - 1) % 5) * 6;
70
71 return ((omap_readl(reg) >> shift) & 0x3f) + 1;
72}
73
74static inline void set_gdma_dev(int req, int dev)
75{
76 u32 reg = OMAP_FUNC_MUX_ARM_BASE + ((req - 1) / 5) * 4;
77 int shift = ((req - 1) % 5) * 6;
78 u32 l;
79
80 l = omap_readl(reg);
81 l &= ~(0x3f << shift);
82 l |= (dev - 1) << shift;
83 omap_writel(l, reg);
84}
85
86static void clear_lch_regs(int lch)
87{
88 int i;
89 u32 lch_base = OMAP_DMA_BASE + lch * 0x40;
90
91 for (i = 0; i < 0x2c; i += 2)
92 omap_writew(0, lch_base + i);
93}
94
95void omap_set_dma_priority(int dst_port, int priority)
96{
97 unsigned long reg;
98 u32 l;
99
100 switch (dst_port) {
101 case OMAP_DMA_PORT_OCP_T1: /* FFFECC00 */
102 reg = OMAP_TC_OCPT1_PRIOR;
103 break;
104 case OMAP_DMA_PORT_OCP_T2: /* FFFECCD0 */
105 reg = OMAP_TC_OCPT2_PRIOR;
106 break;
107 case OMAP_DMA_PORT_EMIFF: /* FFFECC08 */
108 reg = OMAP_TC_EMIFF_PRIOR;
109 break;
110 case OMAP_DMA_PORT_EMIFS: /* FFFECC04 */
111 reg = OMAP_TC_EMIFS_PRIOR;
112 break;
113 default:
114 BUG();
115 return;
116 }
117 l = omap_readl(reg);
118 l &= ~(0xf << 8);
119 l |= (priority & 0xf) << 8;
120 omap_writel(l, reg);
121}
122
123void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
124 int frame_count, int sync_mode)
125{
126 u16 w;
127
128 w = omap_readw(OMAP_DMA_CSDP(lch));
129 w &= ~0x03;
130 w |= data_type;
131 omap_writew(w, OMAP_DMA_CSDP(lch));
132
133 w = omap_readw(OMAP_DMA_CCR(lch));
134 w &= ~(1 << 5);
135 if (sync_mode == OMAP_DMA_SYNC_FRAME)
136 w |= 1 << 5;
137 omap_writew(w, OMAP_DMA_CCR(lch));
138
139 w = omap_readw(OMAP_DMA_CCR2(lch));
140 w &= ~(1 << 2);
141 if (sync_mode == OMAP_DMA_SYNC_BLOCK)
142 w |= 1 << 2;
143 omap_writew(w, OMAP_DMA_CCR2(lch));
144
145 omap_writew(elem_count, OMAP_DMA_CEN(lch));
146 omap_writew(frame_count, OMAP_DMA_CFN(lch));
147
148}
149void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
150{
151 u16 w;
152
153 BUG_ON(omap_dma_in_1510_mode());
154
155 w = omap_readw(OMAP_DMA_CCR2(lch)) & ~0x03;
156 switch (mode) {
157 case OMAP_DMA_CONSTANT_FILL:
158 w |= 0x01;
159 break;
160 case OMAP_DMA_TRANSPARENT_COPY:
161 w |= 0x02;
162 break;
163 case OMAP_DMA_COLOR_DIS:
164 break;
165 default:
166 BUG();
167 }
168 omap_writew(w, OMAP_DMA_CCR2(lch));
169
170 w = omap_readw(OMAP_DMA_LCH_CTRL(lch)) & ~0x0f;
171 /* Default is channel type 2D */
172 if (mode) {
173 omap_writew((u16)color, OMAP_DMA_COLOR_L(lch));
174 omap_writew((u16)(color >> 16), OMAP_DMA_COLOR_U(lch));
175 w |= 1; /* Channel type G */
176 }
177 omap_writew(w, OMAP_DMA_LCH_CTRL(lch));
178}
179
180
181void omap_set_dma_src_params(int lch, int src_port, int src_amode,
182 unsigned long src_start)
183{
184 u16 w;
185
186 w = omap_readw(OMAP_DMA_CSDP(lch));
187 w &= ~(0x1f << 2);
188 w |= src_port << 2;
189 omap_writew(w, OMAP_DMA_CSDP(lch));
190
191 w = omap_readw(OMAP_DMA_CCR(lch));
192 w &= ~(0x03 << 12);
193 w |= src_amode << 12;
194 omap_writew(w, OMAP_DMA_CCR(lch));
195
196 omap_writew(src_start >> 16, OMAP_DMA_CSSA_U(lch));
197 omap_writew(src_start, OMAP_DMA_CSSA_L(lch));
198}
199
200void omap_set_dma_src_index(int lch, int eidx, int fidx)
201{
202 omap_writew(eidx, OMAP_DMA_CSEI(lch));
203 omap_writew(fidx, OMAP_DMA_CSFI(lch));
204}
205
206void omap_set_dma_src_data_pack(int lch, int enable)
207{
208 u16 w;
209
210 w = omap_readw(OMAP_DMA_CSDP(lch)) & ~(1 << 6);
211 w |= enable ? (1 << 6) : 0;
212 omap_writew(w, OMAP_DMA_CSDP(lch));
213}
214
215void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
216{
217 u16 w;
218
219 w = omap_readw(OMAP_DMA_CSDP(lch)) & ~(0x03 << 7);
220 switch (burst_mode) {
221 case OMAP_DMA_DATA_BURST_DIS:
222 break;
223 case OMAP_DMA_DATA_BURST_4:
224 w |= (0x01 << 7);
225 break;
226 case OMAP_DMA_DATA_BURST_8:
227 /* not supported by current hardware
228 * w |= (0x03 << 7);
229 * fall through
230 */
231 default:
232 BUG();
233 }
234 omap_writew(w, OMAP_DMA_CSDP(lch));
235}
236
237void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
238 unsigned long dest_start)
239{
240 u16 w;
241
242 w = omap_readw(OMAP_DMA_CSDP(lch));
243 w &= ~(0x1f << 9);
244 w |= dest_port << 9;
245 omap_writew(w, OMAP_DMA_CSDP(lch));
246
247 w = omap_readw(OMAP_DMA_CCR(lch));
248 w &= ~(0x03 << 14);
249 w |= dest_amode << 14;
250 omap_writew(w, OMAP_DMA_CCR(lch));
251
252 omap_writew(dest_start >> 16, OMAP_DMA_CDSA_U(lch));
253 omap_writew(dest_start, OMAP_DMA_CDSA_L(lch));
254}
255
256void omap_set_dma_dest_index(int lch, int eidx, int fidx)
257{
258 omap_writew(eidx, OMAP_DMA_CDEI(lch));
259 omap_writew(fidx, OMAP_DMA_CDFI(lch));
260}
261
262void omap_set_dma_dest_data_pack(int lch, int enable)
263{
264 u16 w;
265
266 w = omap_readw(OMAP_DMA_CSDP(lch)) & ~(1 << 13);
267 w |= enable ? (1 << 13) : 0;
268 omap_writew(w, OMAP_DMA_CSDP(lch));
269}
270
271void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
272{
273 u16 w;
274
275 w = omap_readw(OMAP_DMA_CSDP(lch)) & ~(0x03 << 14);
276 switch (burst_mode) {
277 case OMAP_DMA_DATA_BURST_DIS:
278 break;
279 case OMAP_DMA_DATA_BURST_4:
280 w |= (0x01 << 14);
281 break;
282 case OMAP_DMA_DATA_BURST_8:
283 w |= (0x03 << 14);
284 break;
285 default:
286 printk(KERN_ERR "Invalid DMA burst mode\n");
287 BUG();
288 return;
289 }
290 omap_writew(w, OMAP_DMA_CSDP(lch));
291}
292
293static inline void init_intr(int lch)
294{
295 u16 w;
296
297 /* Read CSR to make sure it's cleared. */
298 w = omap_readw(OMAP_DMA_CSR(lch));
299 /* Enable some nice interrupts. */
300 omap_writew(dma_chan[lch].enabled_irqs, OMAP_DMA_CICR(lch));
301 dma_chan[lch].flags |= OMAP_DMA_ACTIVE;
302}
303
304static inline void enable_lnk(int lch)
305{
306 u16 w;
307
308 /* Clear the STOP_LNK bits */
309 w = omap_readw(OMAP_DMA_CLNK_CTRL(lch));
310 w &= ~(1 << 14);
311 omap_writew(w, OMAP_DMA_CLNK_CTRL(lch));
312
313 /* And set the ENABLE_LNK bits */
314 if (dma_chan[lch].next_lch != -1)
315 omap_writew(dma_chan[lch].next_lch | (1 << 15),
316 OMAP_DMA_CLNK_CTRL(lch));
317}
318
319static inline void disable_lnk(int lch)
320{
321 u16 w;
322
323 /* Disable interrupts */
324 omap_writew(0, OMAP_DMA_CICR(lch));
325
326 /* Set the STOP_LNK bit */
327 w = omap_readw(OMAP_DMA_CLNK_CTRL(lch));
328 w |= (1 << 14);
329 w = omap_writew(w, OMAP_DMA_CLNK_CTRL(lch));
330
331 dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE;
332}
333
334void omap_start_dma(int lch)
335{
336 u16 w;
337
338 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
339 int next_lch, cur_lch;
340 char dma_chan_link_map[OMAP_LOGICAL_DMA_CH_COUNT];
341
342 dma_chan_link_map[lch] = 1;
343 /* Set the link register of the first channel */
344 enable_lnk(lch);
345
346 memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map));
347 cur_lch = dma_chan[lch].next_lch;
348 do {
349 next_lch = dma_chan[cur_lch].next_lch;
350
351 /* The loop case: we've been here already */
352 if (dma_chan_link_map[cur_lch])
353 break;
354 /* Mark the current channel */
355 dma_chan_link_map[cur_lch] = 1;
356
357 enable_lnk(cur_lch);
358 init_intr(cur_lch);
359
360 cur_lch = next_lch;
361 } while (next_lch != -1);
362 }
363
364 init_intr(lch);
365
366 w = omap_readw(OMAP_DMA_CCR(lch));
367 w |= OMAP_DMA_CCR_EN;
368 omap_writew(w, OMAP_DMA_CCR(lch));
369 dma_chan[lch].flags |= OMAP_DMA_ACTIVE;
370}
371
372void omap_stop_dma(int lch)
373{
374 u16 w;
375
376 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
377 int next_lch, cur_lch = lch;
378 char dma_chan_link_map[OMAP_LOGICAL_DMA_CH_COUNT];
379
380 memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map));
381 do {
382 /* The loop case: we've been here already */
383 if (dma_chan_link_map[cur_lch])
384 break;
385 /* Mark the current channel */
386 dma_chan_link_map[cur_lch] = 1;
387
388 disable_lnk(cur_lch);
389
390 next_lch = dma_chan[cur_lch].next_lch;
391 cur_lch = next_lch;
392 } while (next_lch != -1);
393
394 return;
395 }
396 /* Disable all interrupts on the channel */
397 omap_writew(0, OMAP_DMA_CICR(lch));
398
399 w = omap_readw(OMAP_DMA_CCR(lch));
400 w &= ~OMAP_DMA_CCR_EN;
401 omap_writew(w, OMAP_DMA_CCR(lch));
402 dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE;
403}
404
405void omap_enable_dma_irq(int lch, u16 bits)
406{
407 dma_chan[lch].enabled_irqs |= bits;
408}
409
410void omap_disable_dma_irq(int lch, u16 bits)
411{
412 dma_chan[lch].enabled_irqs &= ~bits;
413}
414
415static int dma_handle_ch(int ch)
416{
417 u16 csr;
418
419 if (enable_1510_mode && ch >= 6) {
420 csr = dma_chan[ch].saved_csr;
421 dma_chan[ch].saved_csr = 0;
422 } else
423 csr = omap_readw(OMAP_DMA_CSR(ch));
424 if (enable_1510_mode && ch <= 2 && (csr >> 7) != 0) {
425 dma_chan[ch + 6].saved_csr = csr >> 7;
426 csr &= 0x7f;
427 }
428 if (!csr)
429 return 0;
430 if (unlikely(dma_chan[ch].dev_id == -1)) {
431 printk(KERN_WARNING "Spurious interrupt from DMA channel %d (CSR %04x)\n",
432 ch, csr);
433 return 0;
434 }
435 if (unlikely(csr & OMAP_DMA_TOUT_IRQ))
436 printk(KERN_WARNING "DMA timeout with device %d\n", dma_chan[ch].dev_id);
437 if (unlikely(csr & OMAP_DMA_DROP_IRQ))
438 printk(KERN_WARNING "DMA synchronization event drop occurred with device %d\n",
439 dma_chan[ch].dev_id);
440 if (likely(csr & OMAP_DMA_BLOCK_IRQ))
441 dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE;
442 if (likely(dma_chan[ch].callback != NULL))
443 dma_chan[ch].callback(ch, csr, dma_chan[ch].data);
444 return 1;
445}
446
447static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
448{
449 int ch = ((int) dev_id) - 1;
450 int handled = 0;
451
452 for (;;) {
453 int handled_now = 0;
454
455 handled_now += dma_handle_ch(ch);
456 if (enable_1510_mode && dma_chan[ch + 6].saved_csr)
457 handled_now += dma_handle_ch(ch + 6);
458 if (!handled_now)
459 break;
460 handled += handled_now;
461 }
462
463 return handled ? IRQ_HANDLED : IRQ_NONE;
464}
465
466int omap_request_dma(int dev_id, const char *dev_name,
467 void (* callback)(int lch, u16 ch_status, void *data),
468 void *data, int *dma_ch_out)
469{
470 int ch, free_ch = -1;
471 unsigned long flags;
472 struct omap_dma_lch *chan;
473
474 spin_lock_irqsave(&dma_chan_lock, flags);
475 for (ch = 0; ch < dma_chan_count; ch++) {
476 if (free_ch == -1 && dma_chan[ch].dev_id == -1) {
477 free_ch = ch;
478 if (dev_id == 0)
479 break;
480 }
481 }
482 if (free_ch == -1) {
483 spin_unlock_irqrestore(&dma_chan_lock, flags);
484 return -EBUSY;
485 }
486 chan = dma_chan + free_ch;
487 chan->dev_id = dev_id;
488 clear_lch_regs(free_ch);
489 spin_unlock_irqrestore(&dma_chan_lock, flags);
490
491 chan->dev_id = dev_id;
492 chan->dev_name = dev_name;
493 chan->callback = callback;
494 chan->data = data;
495 chan->enabled_irqs = OMAP_DMA_TOUT_IRQ | OMAP_DMA_DROP_IRQ | OMAP_DMA_BLOCK_IRQ;
496
497 if (cpu_is_omap16xx()) {
498 /* If the sync device is set, configure it dynamically. */
499 if (dev_id != 0) {
500 set_gdma_dev(free_ch + 1, dev_id);
501 dev_id = free_ch + 1;
502 }
503 /* Disable the 1510 compatibility mode and set the sync device
504 * id. */
505 omap_writew(dev_id | (1 << 10), OMAP_DMA_CCR(free_ch));
506 } else {
507 omap_writew(dev_id, OMAP_DMA_CCR(free_ch));
508 }
509 *dma_ch_out = free_ch;
510
511 return 0;
512}
513
514void omap_free_dma(int ch)
515{
516 unsigned long flags;
517
518 spin_lock_irqsave(&dma_chan_lock, flags);
519 if (dma_chan[ch].dev_id == -1) {
520 printk("omap_dma: trying to free nonallocated DMA channel %d\n", ch);
521 spin_unlock_irqrestore(&dma_chan_lock, flags);
522 return;
523 }
524 dma_chan[ch].dev_id = -1;
525 spin_unlock_irqrestore(&dma_chan_lock, flags);
526
527 /* Disable all DMA interrupts for the channel. */
528 omap_writew(0, OMAP_DMA_CICR(ch));
529 /* Make sure the DMA transfer is stopped. */
530 omap_writew(0, OMAP_DMA_CCR(ch));
531}
532
533int omap_dma_in_1510_mode(void)
534{
535 return enable_1510_mode;
536}
537
538/*
539 * lch_queue DMA will start right after lch_head one is finished.
540 * For this DMA link to start, you still need to start (see omap_start_dma)
541 * the first one. That will fire up the entire queue.
542 */
543void omap_dma_link_lch (int lch_head, int lch_queue)
544{
545 if (omap_dma_in_1510_mode()) {
546 printk(KERN_ERR "DMA linking is not supported in 1510 mode\n");
547 BUG();
548 return;
549 }
550
551 if ((dma_chan[lch_head].dev_id == -1) ||
552 (dma_chan[lch_queue].dev_id == -1)) {
553 printk(KERN_ERR "omap_dma: trying to link non requested channels\n");
554 dump_stack();
555 }
556
557 dma_chan[lch_head].next_lch = lch_queue;
558}
559
560/*
561 * Once the DMA queue is stopped, we can destroy it.
562 */
563void omap_dma_unlink_lch (int lch_head, int lch_queue)
564{
565 if (omap_dma_in_1510_mode()) {
566 printk(KERN_ERR "DMA linking is not supported in 1510 mode\n");
567 BUG();
568 return;
569 }
570
571 if (dma_chan[lch_head].next_lch != lch_queue ||
572 dma_chan[lch_head].next_lch == -1) {
573 printk(KERN_ERR "omap_dma: trying to unlink non linked channels\n");
574 dump_stack();
575 }
576
577
578 if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) ||
579 (dma_chan[lch_head].flags & OMAP_DMA_ACTIVE)) {
580 printk(KERN_ERR "omap_dma: You need to stop the DMA channels before unlinking\n");
581 dump_stack();
582 }
583
584 dma_chan[lch_head].next_lch = -1;
585}
586
587
588static struct lcd_dma_info {
589 spinlock_t lock;
590 int reserved;
591 void (* callback)(u16 status, void *data);
592 void *cb_data;
593
594 int active;
595 unsigned long addr, size;
596 int rotate, data_type, xres, yres;
597 int vxres;
598 int mirror;
599 int xscale, yscale;
600 int ext_ctrl;
601 int src_port;
602 int single_transfer;
603} lcd_dma;
604
605void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
606 int data_type)
607{
608 lcd_dma.addr = addr;
609 lcd_dma.data_type = data_type;
610 lcd_dma.xres = fb_xres;
611 lcd_dma.yres = fb_yres;
612}
613
614void omap_set_lcd_dma_src_port(int port)
615{
616 lcd_dma.src_port = port;
617}
618
619void omap_set_lcd_dma_ext_controller(int external)
620{
621 lcd_dma.ext_ctrl = external;
622}
623
624void omap_set_lcd_dma_single_transfer(int single)
625{
626 lcd_dma.single_transfer = single;
627}
628
629
630void omap_set_lcd_dma_b1_rotation(int rotate)
631{
632 if (omap_dma_in_1510_mode()) {
633 printk(KERN_ERR "DMA rotation is not supported in 1510 mode\n");
634 BUG();
635 return;
636 }
637 lcd_dma.rotate = rotate;
638}
639
640void omap_set_lcd_dma_b1_mirror(int mirror)
641{
642 if (omap_dma_in_1510_mode()) {
643 printk(KERN_ERR "DMA mirror is not supported in 1510 mode\n");
644 BUG();
645 }
646 lcd_dma.mirror = mirror;
647}
648
649void omap_set_lcd_dma_b1_vxres(unsigned long vxres)
650{
651 if (omap_dma_in_1510_mode()) {
652 printk(KERN_ERR "DMA virtual resulotion is not supported "
653 "in 1510 mode\n");
654 BUG();
655 }
656 lcd_dma.vxres = vxres;
657}
658
659void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale)
660{
661 if (omap_dma_in_1510_mode()) {
662 printk(KERN_ERR "DMA scale is not supported in 1510 mode\n");
663 BUG();
664 }
665 lcd_dma.xscale = xscale;
666 lcd_dma.yscale = yscale;
667}
668
669static void set_b1_regs(void)
670{
671 unsigned long top, bottom;
672 int es;
673 u16 w;
674 unsigned long en, fn;
675 long ei, fi;
676 unsigned long vxres;
677 unsigned int xscale, yscale;
678
679 switch (lcd_dma.data_type) {
680 case OMAP_DMA_DATA_TYPE_S8:
681 es = 1;
682 break;
683 case OMAP_DMA_DATA_TYPE_S16:
684 es = 2;
685 break;
686 case OMAP_DMA_DATA_TYPE_S32:
687 es = 4;
688 break;
689 default:
690 BUG();
691 return;
692 }
693
694 vxres = lcd_dma.vxres ? lcd_dma.vxres : lcd_dma.xres;
695 xscale = lcd_dma.xscale ? lcd_dma.xscale : 1;
696 yscale = lcd_dma.yscale ? lcd_dma.yscale : 1;
697 BUG_ON(vxres < lcd_dma.xres);
698#define PIXADDR(x,y) (lcd_dma.addr + ((y) * vxres * yscale + (x) * xscale) * es)
699#define PIXSTEP(sx, sy, dx, dy) (PIXADDR(dx, dy) - PIXADDR(sx, sy) - es + 1)
700 switch (lcd_dma.rotate) {
701 case 0:
702 if (!lcd_dma.mirror) {
703 top = PIXADDR(0, 0);
704 bottom = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
705 /* 1510 DMA requires the bottom address to be 2 more
706 * than the actual last memory access location. */
707 if (omap_dma_in_1510_mode() &&
708 lcd_dma.data_type == OMAP_DMA_DATA_TYPE_S32)
709 bottom += 2;
710 ei = PIXSTEP(0, 0, 1, 0);
711 fi = PIXSTEP(lcd_dma.xres - 1, 0, 0, 1);
712 } else {
713 top = PIXADDR(lcd_dma.xres - 1, 0);
714 bottom = PIXADDR(0, lcd_dma.yres - 1);
715 ei = PIXSTEP(1, 0, 0, 0);
716 fi = PIXSTEP(0, 0, lcd_dma.xres - 1, 1);
717 }
718 en = lcd_dma.xres;
719 fn = lcd_dma.yres;
720 break;
721 case 90:
722 if (!lcd_dma.mirror) {
723 top = PIXADDR(0, lcd_dma.yres - 1);
724 bottom = PIXADDR(lcd_dma.xres - 1, 0);
725 ei = PIXSTEP(0, 1, 0, 0);
726 fi = PIXSTEP(0, 0, 1, lcd_dma.yres - 1);
727 } else {
728 top = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
729 bottom = PIXADDR(0, 0);
730 ei = PIXSTEP(0, 1, 0, 0);
731 fi = PIXSTEP(1, 0, 0, lcd_dma.yres - 1);
732 }
733 en = lcd_dma.yres;
734 fn = lcd_dma.xres;
735 break;
736 case 180:
737 if (!lcd_dma.mirror) {
738 top = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
739 bottom = PIXADDR(0, 0);
740 ei = PIXSTEP(1, 0, 0, 0);
741 fi = PIXSTEP(0, 1, lcd_dma.xres - 1, 0);
742 } else {
743 top = PIXADDR(0, lcd_dma.yres - 1);
744 bottom = PIXADDR(lcd_dma.xres - 1, 0);
745 ei = PIXSTEP(0, 0, 1, 0);
746 fi = PIXSTEP(lcd_dma.xres - 1, 1, 0, 0);
747 }
748 en = lcd_dma.xres;
749 fn = lcd_dma.yres;
750 break;
751 case 270:
752 if (!lcd_dma.mirror) {
753 top = PIXADDR(lcd_dma.xres - 1, 0);
754 bottom = PIXADDR(0, lcd_dma.yres - 1);
755 ei = PIXSTEP(0, 0, 0, 1);
756 fi = PIXSTEP(1, lcd_dma.yres - 1, 0, 0);
757 } else {
758 top = PIXADDR(0, 0);
759 bottom = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
760 ei = PIXSTEP(0, 0, 0, 1);
761 fi = PIXSTEP(0, lcd_dma.yres - 1, 1, 0);
762 }
763 en = lcd_dma.yres;
764 fn = lcd_dma.xres;
765 break;
766 default:
767 BUG();
768 return; /* Supress warning about uninitialized vars */
769 }
770
771 if (omap_dma_in_1510_mode()) {
772 omap_writew(top >> 16, OMAP1510_DMA_LCD_TOP_F1_U);
773 omap_writew(top, OMAP1510_DMA_LCD_TOP_F1_L);
774 omap_writew(bottom >> 16, OMAP1510_DMA_LCD_BOT_F1_U);
775 omap_writew(bottom, OMAP1510_DMA_LCD_BOT_F1_L);
776
777 return;
778 }
779
780 /* 1610 regs */
781 omap_writew(top >> 16, OMAP1610_DMA_LCD_TOP_B1_U);
782 omap_writew(top, OMAP1610_DMA_LCD_TOP_B1_L);
783 omap_writew(bottom >> 16, OMAP1610_DMA_LCD_BOT_B1_U);
784 omap_writew(bottom, OMAP1610_DMA_LCD_BOT_B1_L);
785
786 omap_writew(en, OMAP1610_DMA_LCD_SRC_EN_B1);
787 omap_writew(fn, OMAP1610_DMA_LCD_SRC_FN_B1);
788
789 w = omap_readw(OMAP1610_DMA_LCD_CSDP);
790 w &= ~0x03;
791 w |= lcd_dma.data_type;
792 omap_writew(w, OMAP1610_DMA_LCD_CSDP);
793
794 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
795 /* Always set the source port as SDRAM for now*/
796 w &= ~(0x03 << 6);
797 if (lcd_dma.ext_ctrl)
798 w |= 1 << 8;
799 else
800 w &= ~(1 << 8);
801 if (lcd_dma.callback != NULL)
802 w |= 1 << 1; /* Block interrupt enable */
803 else
804 w &= ~(1 << 1);
805 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
806
807 if (!(lcd_dma.rotate || lcd_dma.mirror ||
808 lcd_dma.vxres || lcd_dma.xscale || lcd_dma.yscale))
809 return;
810
811 w = omap_readw(OMAP1610_DMA_LCD_CCR);
812 /* Set the double-indexed addressing mode */
813 w |= (0x03 << 12);
814 omap_writew(w, OMAP1610_DMA_LCD_CCR);
815
816 omap_writew(ei, OMAP1610_DMA_LCD_SRC_EI_B1);
817 omap_writew(fi >> 16, OMAP1610_DMA_LCD_SRC_FI_B1_U);
818 omap_writew(fi, OMAP1610_DMA_LCD_SRC_FI_B1_L);
819}
820
821static irqreturn_t lcd_dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
822{
823 u16 w;
824
825 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
826 if (unlikely(!(w & (1 << 3)))) {
827 printk(KERN_WARNING "Spurious LCD DMA IRQ\n");
828 return IRQ_NONE;
829 }
830 /* Ack the IRQ */
831 w |= (1 << 3);
832 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
833 lcd_dma.active = 0;
834 if (lcd_dma.callback != NULL)
835 lcd_dma.callback(w, lcd_dma.cb_data);
836
837 return IRQ_HANDLED;
838}
839
840int omap_request_lcd_dma(void (* callback)(u16 status, void *data),
841 void *data)
842{
843 spin_lock_irq(&lcd_dma.lock);
844 if (lcd_dma.reserved) {
845 spin_unlock_irq(&lcd_dma.lock);
846 printk(KERN_ERR "LCD DMA channel already reserved\n");
847 BUG();
848 return -EBUSY;
849 }
850 lcd_dma.reserved = 1;
851 spin_unlock_irq(&lcd_dma.lock);
852 lcd_dma.callback = callback;
853 lcd_dma.cb_data = data;
854 lcd_dma.active = 0;
855 lcd_dma.single_transfer = 0;
856 lcd_dma.rotate = 0;
857 lcd_dma.vxres = 0;
858 lcd_dma.mirror = 0;
859 lcd_dma.xscale = 0;
860 lcd_dma.yscale = 0;
861 lcd_dma.ext_ctrl = 0;
862 lcd_dma.src_port = 0;
863
864 return 0;
865}
866
867void omap_free_lcd_dma(void)
868{
869 spin_lock(&lcd_dma.lock);
870 if (!lcd_dma.reserved) {
871 spin_unlock(&lcd_dma.lock);
872 printk(KERN_ERR "LCD DMA is not reserved\n");
873 BUG();
874 return;
875 }
876 if (!enable_1510_mode)
877 omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) & ~1, OMAP1610_DMA_LCD_CCR);
878 lcd_dma.reserved = 0;
879 spin_unlock(&lcd_dma.lock);
880}
881
882void omap_enable_lcd_dma(void)
883{
884 u16 w;
885
886 /* Set the Enable bit only if an external controller is
887 * connected. Otherwise the OMAP internal controller will
888 * start the transfer when it gets enabled.
889 */
890 if (enable_1510_mode || !lcd_dma.ext_ctrl)
891 return;
892 w = omap_readw(OMAP1610_DMA_LCD_CCR);
893 w |= 1 << 7;
894 omap_writew(w, OMAP1610_DMA_LCD_CCR);
895 lcd_dma.active = 1;
896}
897
898void omap_setup_lcd_dma(void)
899{
900 BUG_ON(lcd_dma.active);
901 if (!enable_1510_mode) {
902 /* Set some reasonable defaults */
903 omap_writew(0x5440, OMAP1610_DMA_LCD_CCR);
904 omap_writew(0x9102, OMAP1610_DMA_LCD_CSDP);
905 omap_writew(0x0004, OMAP1610_DMA_LCD_LCH_CTRL);
906 }
907 set_b1_regs();
908 if (!enable_1510_mode) {
909 u16 w;
910
911 w = omap_readw(OMAP1610_DMA_LCD_CCR);
912 /* If DMA was already active set the end_prog bit to have
913 * the programmed register set loaded into the active
914 * register set.
915 */
916 w |= 1 << 11; /* End_prog */
917 if (!lcd_dma.single_transfer)
918 w |= (3 << 8); /* Auto_init, repeat */
919 omap_writew(w, OMAP1610_DMA_LCD_CCR);
920 }
921}
922
923void omap_stop_lcd_dma(void)
924{
925 lcd_dma.active = 0;
926 if (!enable_1510_mode && lcd_dma.ext_ctrl)
927 omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) & ~(1 << 7),
928 OMAP1610_DMA_LCD_CCR);
929}
930
931/*
932 * Clears any DMA state so the DMA engine is ready to restart with new buffers
933 * through omap_start_dma(). Any buffers in flight are discarded.
934 */
935void omap_clear_dma(int lch)
936{
937 unsigned long flags;
938 int status;
939
940 local_irq_save(flags);
941 omap_writew(omap_readw(OMAP_DMA_CCR(lch)) & ~OMAP_DMA_CCR_EN,
942 OMAP_DMA_CCR(lch));
943 status = OMAP_DMA_CSR(lch); /* clear pending interrupts */
944 local_irq_restore(flags);
945}
946
947/*
948 * Returns current physical source address for the given DMA channel.
949 * If the channel is running the caller must disable interrupts prior calling
950 * this function and process the returned value before re-enabling interrupt to
951 * prevent races with the interrupt handler. Note that in continuous mode there
952 * is a chance for CSSA_L register overflow inbetween the two reads resulting
953 * in incorrect return value.
954 */
955dma_addr_t omap_get_dma_src_pos(int lch)
956{
957 return (dma_addr_t) (OMAP_DMA_CSSA_L(lch) |
958 (OMAP_DMA_CSSA_U(lch) << 16));
959}
960
961/*
962 * Returns current physical destination address for the given DMA channel.
963 * If the channel is running the caller must disable interrupts prior calling
964 * this function and process the returned value before re-enabling interrupt to
965 * prevent races with the interrupt handler. Note that in continuous mode there
966 * is a chance for CDSA_L register overflow inbetween the two reads resulting
967 * in incorrect return value.
968 */
969dma_addr_t omap_get_dma_dst_pos(int lch)
970{
971 return (dma_addr_t) (OMAP_DMA_CDSA_L(lch) |
972 (OMAP_DMA_CDSA_U(lch) << 16));
973}
974
975static int __init omap_init_dma(void)
976{
977 int ch, r;
978
979 if (cpu_is_omap1510()) {
980 printk(KERN_INFO "DMA support for OMAP1510 initialized\n");
981 dma_chan_count = 9;
982 enable_1510_mode = 1;
983 } else if (cpu_is_omap16xx() || cpu_is_omap730()) {
984 printk(KERN_INFO "OMAP DMA hardware version %d\n",
985 omap_readw(OMAP_DMA_HW_ID));
986 printk(KERN_INFO "DMA capabilities: %08x:%08x:%04x:%04x:%04x\n",
987 (omap_readw(OMAP_DMA_CAPS_0_U) << 16) | omap_readw(OMAP_DMA_CAPS_0_L),
988 (omap_readw(OMAP_DMA_CAPS_1_U) << 16) | omap_readw(OMAP_DMA_CAPS_1_L),
989 omap_readw(OMAP_DMA_CAPS_2), omap_readw(OMAP_DMA_CAPS_3),
990 omap_readw(OMAP_DMA_CAPS_4));
991 if (!enable_1510_mode) {
992 u16 w;
993
994 /* Disable OMAP 3.0/3.1 compatibility mode. */
995 w = omap_readw(OMAP_DMA_GSCR);
996 w |= 1 << 3;
997 omap_writew(w, OMAP_DMA_GSCR);
998 dma_chan_count = 16;
999 } else
1000 dma_chan_count = 9;
1001 } else {
1002 dma_chan_count = 0;
1003 return 0;
1004 }
1005
1006 memset(&lcd_dma, 0, sizeof(lcd_dma));
1007 spin_lock_init(&lcd_dma.lock);
1008 spin_lock_init(&dma_chan_lock);
1009 memset(&dma_chan, 0, sizeof(dma_chan));
1010
1011 for (ch = 0; ch < dma_chan_count; ch++) {
1012 dma_chan[ch].dev_id = -1;
1013 dma_chan[ch].next_lch = -1;
1014
1015 if (ch >= 6 && enable_1510_mode)
1016 continue;
1017
1018 /* request_irq() doesn't like dev_id (ie. ch) being zero,
1019 * so we have to kludge around this. */
1020 r = request_irq(dma_irq[ch], dma_irq_handler, 0, "DMA",
1021 (void *) (ch + 1));
1022 if (r != 0) {
1023 int i;
1024
1025 printk(KERN_ERR "unable to request IRQ %d for DMA (error %d)\n",
1026 dma_irq[ch], r);
1027 for (i = 0; i < ch; i++)
1028 free_irq(dma_irq[i], (void *) (i + 1));
1029 return r;
1030 }
1031 }
1032 r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0, "LCD DMA", NULL);
1033 if (r != 0) {
1034 int i;
1035
1036 printk(KERN_ERR "unable to request IRQ for LCD DMA (error %d)\n", r);
1037 for (i = 0; i < dma_chan_count; i++)
1038 free_irq(dma_irq[i], (void *) (i + 1));
1039 return r;
1040 }
1041 return 0;
1042}
1043
1044arch_initcall(omap_init_dma);
1045
1046
1047EXPORT_SYMBOL(omap_get_dma_src_pos);
1048EXPORT_SYMBOL(omap_get_dma_dst_pos);
1049EXPORT_SYMBOL(omap_clear_dma);
1050EXPORT_SYMBOL(omap_set_dma_priority);
1051EXPORT_SYMBOL(omap_request_dma);
1052EXPORT_SYMBOL(omap_free_dma);
1053EXPORT_SYMBOL(omap_start_dma);
1054EXPORT_SYMBOL(omap_stop_dma);
1055EXPORT_SYMBOL(omap_enable_dma_irq);
1056EXPORT_SYMBOL(omap_disable_dma_irq);
1057
1058EXPORT_SYMBOL(omap_set_dma_transfer_params);
1059EXPORT_SYMBOL(omap_set_dma_color_mode);
1060
1061EXPORT_SYMBOL(omap_set_dma_src_params);
1062EXPORT_SYMBOL(omap_set_dma_src_index);
1063EXPORT_SYMBOL(omap_set_dma_src_data_pack);
1064EXPORT_SYMBOL(omap_set_dma_src_burst_mode);
1065
1066EXPORT_SYMBOL(omap_set_dma_dest_params);
1067EXPORT_SYMBOL(omap_set_dma_dest_index);
1068EXPORT_SYMBOL(omap_set_dma_dest_data_pack);
1069EXPORT_SYMBOL(omap_set_dma_dest_burst_mode);
1070
1071EXPORT_SYMBOL(omap_dma_link_lch);
1072EXPORT_SYMBOL(omap_dma_unlink_lch);
1073
1074EXPORT_SYMBOL(omap_request_lcd_dma);
1075EXPORT_SYMBOL(omap_free_lcd_dma);
1076EXPORT_SYMBOL(omap_enable_lcd_dma);
1077EXPORT_SYMBOL(omap_setup_lcd_dma);
1078EXPORT_SYMBOL(omap_stop_lcd_dma);
1079EXPORT_SYMBOL(omap_set_lcd_dma_b1);
1080EXPORT_SYMBOL(omap_set_lcd_dma_single_transfer);
1081EXPORT_SYMBOL(omap_set_lcd_dma_ext_controller);
1082EXPORT_SYMBOL(omap_set_lcd_dma_b1_rotation);
1083EXPORT_SYMBOL(omap_set_lcd_dma_b1_vxres);
1084EXPORT_SYMBOL(omap_set_lcd_dma_b1_scale);
1085EXPORT_SYMBOL(omap_set_lcd_dma_b1_mirror);
1086
diff --git a/arch/arm/mach-omap/fpga.c b/arch/arm/mach-omap/fpga.c
new file mode 100644
index 000000000000..7c08f6c2e1d0
--- /dev/null
+++ b/arch/arm/mach-omap/fpga.c
@@ -0,0 +1,188 @@
1/*
2 * linux/arch/arm/mach-omap/fpga.c
3 *
4 * Interrupt handler for OMAP-1510 Innovator FPGA
5 *
6 * Copyright (C) 2001 RidgeRun, Inc.
7 * Author: Greg Lonnon <glonnon@ridgerun.com>
8 *
9 * Copyright (C) 2002 MontaVista Software, Inc.
10 *
11 * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6
12 * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#include <linux/config.h>
20#include <linux/types.h>
21#include <linux/init.h>
22#include <linux/kernel.h>
23#include <linux/device.h>
24#include <linux/errno.h>
25
26#include <asm/hardware.h>
27#include <asm/io.h>
28#include <asm/irq.h>
29#include <asm/mach/irq.h>
30
31#include <asm/arch/fpga.h>
32#include <asm/arch/gpio.h>
33
34static void fpga_mask_irq(unsigned int irq)
35{
36 irq -= OMAP1510_IH_FPGA_BASE;
37
38 if (irq < 8)
39 __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO)
40 & ~(1 << irq)), OMAP1510_FPGA_IMR_LO);
41 else if (irq < 16)
42 __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_HI)
43 & ~(1 << (irq - 8))), OMAP1510_FPGA_IMR_HI);
44 else
45 __raw_writeb((__raw_readb(INNOVATOR_FPGA_IMR2)
46 & ~(1 << (irq - 16))), INNOVATOR_FPGA_IMR2);
47}
48
49
50static inline u32 get_fpga_unmasked_irqs(void)
51{
52 return
53 ((__raw_readb(OMAP1510_FPGA_ISR_LO) &
54 __raw_readb(OMAP1510_FPGA_IMR_LO))) |
55 ((__raw_readb(OMAP1510_FPGA_ISR_HI) &
56 __raw_readb(OMAP1510_FPGA_IMR_HI)) << 8) |
57 ((__raw_readb(INNOVATOR_FPGA_ISR2) &
58 __raw_readb(INNOVATOR_FPGA_IMR2)) << 16);
59}
60
61
62static void fpga_ack_irq(unsigned int irq)
63{
64 /* Don't need to explicitly ACK FPGA interrupts */
65}
66
67static void fpga_unmask_irq(unsigned int irq)
68{
69 irq -= OMAP1510_IH_FPGA_BASE;
70
71 if (irq < 8)
72 __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) | (1 << irq)),
73 OMAP1510_FPGA_IMR_LO);
74 else if (irq < 16)
75 __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_HI)
76 | (1 << (irq - 8))), OMAP1510_FPGA_IMR_HI);
77 else
78 __raw_writeb((__raw_readb(INNOVATOR_FPGA_IMR2)
79 | (1 << (irq - 16))), INNOVATOR_FPGA_IMR2);
80}
81
82static void fpga_mask_ack_irq(unsigned int irq)
83{
84 fpga_mask_irq(irq);
85 fpga_ack_irq(irq);
86}
87
88void innovator_fpga_IRQ_demux(unsigned int irq, struct irqdesc *desc,
89 struct pt_regs *regs)
90{
91 struct irqdesc *d;
92 u32 stat;
93 int fpga_irq;
94
95 stat = get_fpga_unmasked_irqs();
96
97 if (!stat)
98 return;
99
100 for (fpga_irq = OMAP1510_IH_FPGA_BASE;
101 (fpga_irq < (OMAP1510_IH_FPGA_BASE + NR_FPGA_IRQS)) && stat;
102 fpga_irq++, stat >>= 1) {
103 if (stat & 1) {
104 d = irq_desc + fpga_irq;
105 d->handle(fpga_irq, d, regs);
106 }
107 }
108}
109
110static struct irqchip omap_fpga_irq_ack = {
111 .ack = fpga_mask_ack_irq,
112 .mask = fpga_mask_irq,
113 .unmask = fpga_unmask_irq,
114};
115
116
117static struct irqchip omap_fpga_irq = {
118 .ack = fpga_ack_irq,
119 .mask = fpga_mask_irq,
120 .unmask = fpga_unmask_irq,
121};
122
123/*
124 * All of the FPGA interrupt request inputs except for the touchscreen are
125 * edge-sensitive; the touchscreen is level-sensitive. The edge-sensitive
126 * interrupts are acknowledged as a side-effect of reading the interrupt
127 * status register from the FPGA. The edge-sensitive interrupt inputs
128 * cause a problem with level interrupt requests, such as Ethernet. The
129 * problem occurs when a level interrupt request is asserted while its
130 * interrupt input is masked in the FPGA, which results in a missed
131 * interrupt.
132 *
133 * In an attempt to workaround the problem with missed interrupts, the
134 * mask_ack routine for all of the FPGA interrupts has been changed from
135 * fpga_mask_ack_irq() to fpga_ack_irq() so that the specific FPGA interrupt
136 * being serviced is left unmasked. We can do this because the FPGA cascade
137 * interrupt is installed with the SA_INTERRUPT flag, which leaves all
138 * interrupts masked at the CPU while an FPGA interrupt handler executes.
139 *
140 * Limited testing indicates that this workaround appears to be effective
141 * for the smc9194 Ethernet driver used on the Innovator. It should work
142 * on other FPGA interrupts as well, but any drivers that explicitly mask
143 * interrupts at the interrupt controller via disable_irq/enable_irq
144 * could pose a problem.
145 */
146void omap1510_fpga_init_irq(void)
147{
148 int i;
149
150 __raw_writeb(0, OMAP1510_FPGA_IMR_LO);
151 __raw_writeb(0, OMAP1510_FPGA_IMR_HI);
152 __raw_writeb(0, INNOVATOR_FPGA_IMR2);
153
154 for (i = OMAP1510_IH_FPGA_BASE; i < (OMAP1510_IH_FPGA_BASE + NR_FPGA_IRQS); i++) {
155
156 if (i == OMAP1510_INT_FPGA_TS) {
157 /*
158 * The touchscreen interrupt is level-sensitive, so
159 * we'll use the regular mask_ack routine for it.
160 */
161 set_irq_chip(i, &omap_fpga_irq_ack);
162 }
163 else {
164 /*
165 * All FPGA interrupts except the touchscreen are
166 * edge-sensitive, so we won't mask them.
167 */
168 set_irq_chip(i, &omap_fpga_irq);
169 }
170
171 set_irq_handler(i, do_edge_IRQ);
172 set_irq_flags(i, IRQF_VALID);
173 }
174
175 /*
176 * The FPGA interrupt line is connected to GPIO13. Claim this pin for
177 * the ARM.
178 *
179 * NOTE: For general GPIO/MPUIO access and interrupts, please see
180 * gpio.[ch]
181 */
182 omap_request_gpio(13);
183 omap_set_gpio_direction(13, 1);
184 omap_set_gpio_edge_ctrl(13, OMAP_GPIO_RISING_EDGE);
185 set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux);
186}
187
188EXPORT_SYMBOL(omap1510_fpga_init_irq);
diff --git a/arch/arm/mach-omap/gpio.c b/arch/arm/mach-omap/gpio.c
new file mode 100644
index 000000000000..9045dfd469ad
--- /dev/null
+++ b/arch/arm/mach-omap/gpio.c
@@ -0,0 +1,762 @@
1/*
2 * linux/arch/arm/mach-omap/gpio.c
3 *
4 * Support functions for OMAP GPIO
5 *
6 * Copyright (C) 2003 Nokia Corporation
7 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/config.h>
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/sched.h>
18#include <linux/interrupt.h>
19#include <linux/ptrace.h>
20
21#include <asm/hardware.h>
22#include <asm/irq.h>
23#include <asm/arch/irqs.h>
24#include <asm/arch/gpio.h>
25#include <asm/mach/irq.h>
26
27#include <asm/io.h>
28
29/*
30 * OMAP1510 GPIO registers
31 */
32#define OMAP1510_GPIO_BASE 0xfffce000
33#define OMAP1510_GPIO_DATA_INPUT 0x00
34#define OMAP1510_GPIO_DATA_OUTPUT 0x04
35#define OMAP1510_GPIO_DIR_CONTROL 0x08
36#define OMAP1510_GPIO_INT_CONTROL 0x0c
37#define OMAP1510_GPIO_INT_MASK 0x10
38#define OMAP1510_GPIO_INT_STATUS 0x14
39#define OMAP1510_GPIO_PIN_CONTROL 0x18
40
41#define OMAP1510_IH_GPIO_BASE 64
42
43/*
44 * OMAP1610 specific GPIO registers
45 */
46#define OMAP1610_GPIO1_BASE 0xfffbe400
47#define OMAP1610_GPIO2_BASE 0xfffbec00
48#define OMAP1610_GPIO3_BASE 0xfffbb400
49#define OMAP1610_GPIO4_BASE 0xfffbbc00
50#define OMAP1610_GPIO_REVISION 0x0000
51#define OMAP1610_GPIO_SYSCONFIG 0x0010
52#define OMAP1610_GPIO_SYSSTATUS 0x0014
53#define OMAP1610_GPIO_IRQSTATUS1 0x0018
54#define OMAP1610_GPIO_IRQENABLE1 0x001c
55#define OMAP1610_GPIO_DATAIN 0x002c
56#define OMAP1610_GPIO_DATAOUT 0x0030
57#define OMAP1610_GPIO_DIRECTION 0x0034
58#define OMAP1610_GPIO_EDGE_CTRL1 0x0038
59#define OMAP1610_GPIO_EDGE_CTRL2 0x003c
60#define OMAP1610_GPIO_CLEAR_IRQENABLE1 0x009c
61#define OMAP1610_GPIO_CLEAR_DATAOUT 0x00b0
62#define OMAP1610_GPIO_SET_IRQENABLE1 0x00dc
63#define OMAP1610_GPIO_SET_DATAOUT 0x00f0
64
65/*
66 * OMAP730 specific GPIO registers
67 */
68#define OMAP730_GPIO1_BASE 0xfffbc000
69#define OMAP730_GPIO2_BASE 0xfffbc800
70#define OMAP730_GPIO3_BASE 0xfffbd000
71#define OMAP730_GPIO4_BASE 0xfffbd800
72#define OMAP730_GPIO5_BASE 0xfffbe000
73#define OMAP730_GPIO6_BASE 0xfffbe800
74#define OMAP730_GPIO_DATA_INPUT 0x00
75#define OMAP730_GPIO_DATA_OUTPUT 0x04
76#define OMAP730_GPIO_DIR_CONTROL 0x08
77#define OMAP730_GPIO_INT_CONTROL 0x0c
78#define OMAP730_GPIO_INT_MASK 0x10
79#define OMAP730_GPIO_INT_STATUS 0x14
80
81#define OMAP_MPUIO_MASK (~OMAP_MAX_GPIO_LINES & 0xff)
82
83struct gpio_bank {
84 u32 base;
85 u16 irq;
86 u16 virtual_irq_start;
87 u8 method;
88 u32 reserved_map;
89 spinlock_t lock;
90};
91
92#define METHOD_MPUIO 0
93#define METHOD_GPIO_1510 1
94#define METHOD_GPIO_1610 2
95#define METHOD_GPIO_730 3
96
97#if defined(CONFIG_ARCH_OMAP16XX)
98static struct gpio_bank gpio_bank_1610[5] = {
99 { OMAP_MPUIO_BASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO},
100 { OMAP1610_GPIO1_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1610 },
101 { OMAP1610_GPIO2_BASE, INT_1610_GPIO_BANK2, IH_GPIO_BASE + 16, METHOD_GPIO_1610 },
102 { OMAP1610_GPIO3_BASE, INT_1610_GPIO_BANK3, IH_GPIO_BASE + 32, METHOD_GPIO_1610 },
103 { OMAP1610_GPIO4_BASE, INT_1610_GPIO_BANK4, IH_GPIO_BASE + 48, METHOD_GPIO_1610 },
104};
105#endif
106
107#ifdef CONFIG_ARCH_OMAP1510
108static struct gpio_bank gpio_bank_1510[2] = {
109 { OMAP_MPUIO_BASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO },
110 { OMAP1510_GPIO_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1510 }
111};
112#endif
113
114#ifdef CONFIG_ARCH_OMAP730
115static struct gpio_bank gpio_bank_730[7] = {
116 { OMAP_MPUIO_BASE, INT_730_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO },
117 { OMAP730_GPIO1_BASE, INT_730_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_730 },
118 { OMAP730_GPIO2_BASE, INT_730_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_730 },
119 { OMAP730_GPIO3_BASE, INT_730_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_730 },
120 { OMAP730_GPIO4_BASE, INT_730_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_730 },
121 { OMAP730_GPIO5_BASE, INT_730_GPIO_BANK5, IH_GPIO_BASE + 128, METHOD_GPIO_730 },
122 { OMAP730_GPIO6_BASE, INT_730_GPIO_BANK6, IH_GPIO_BASE + 160, METHOD_GPIO_730 },
123};
124#endif
125
126static struct gpio_bank *gpio_bank;
127static int gpio_bank_count;
128
129static inline struct gpio_bank *get_gpio_bank(int gpio)
130{
131#ifdef CONFIG_ARCH_OMAP1510
132 if (cpu_is_omap1510()) {
133 if (OMAP_GPIO_IS_MPUIO(gpio))
134 return &gpio_bank[0];
135 return &gpio_bank[1];
136 }
137#endif
138#if defined(CONFIG_ARCH_OMAP16XX)
139 if (cpu_is_omap16xx()) {
140 if (OMAP_GPIO_IS_MPUIO(gpio))
141 return &gpio_bank[0];
142 return &gpio_bank[1 + (gpio >> 4)];
143 }
144#endif
145#ifdef CONFIG_ARCH_OMAP730
146 if (cpu_is_omap730()) {
147 if (OMAP_GPIO_IS_MPUIO(gpio))
148 return &gpio_bank[0];
149 return &gpio_bank[1 + (gpio >> 5)];
150 }
151#endif
152}
153
154static inline int get_gpio_index(int gpio)
155{
156 if (cpu_is_omap730())
157 return gpio & 0x1f;
158 else
159 return gpio & 0x0f;
160}
161
162static inline int gpio_valid(int gpio)
163{
164 if (gpio < 0)
165 return -1;
166 if (OMAP_GPIO_IS_MPUIO(gpio)) {
167 if ((gpio & OMAP_MPUIO_MASK) > 16)
168 return -1;
169 return 0;
170 }
171#ifdef CONFIG_ARCH_OMAP1510
172 if (cpu_is_omap1510() && gpio < 16)
173 return 0;
174#endif
175#if defined(CONFIG_ARCH_OMAP16XX)
176 if ((cpu_is_omap16xx()) && gpio < 64)
177 return 0;
178#endif
179#ifdef CONFIG_ARCH_OMAP730
180 if (cpu_is_omap730() && gpio < 192)
181 return 0;
182#endif
183 return -1;
184}
185
186static int check_gpio(int gpio)
187{
188 if (unlikely(gpio_valid(gpio)) < 0) {
189 printk(KERN_ERR "omap-gpio: invalid GPIO %d\n", gpio);
190 dump_stack();
191 return -1;
192 }
193 return 0;
194}
195
196static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
197{
198 u32 reg = bank->base;
199 u32 l;
200
201 switch (bank->method) {
202 case METHOD_MPUIO:
203 reg += OMAP_MPUIO_IO_CNTL;
204 break;
205 case METHOD_GPIO_1510:
206 reg += OMAP1510_GPIO_DIR_CONTROL;
207 break;
208 case METHOD_GPIO_1610:
209 reg += OMAP1610_GPIO_DIRECTION;
210 break;
211 case METHOD_GPIO_730:
212 reg += OMAP730_GPIO_DIR_CONTROL;
213 break;
214 }
215 l = __raw_readl(reg);
216 if (is_input)
217 l |= 1 << gpio;
218 else
219 l &= ~(1 << gpio);
220 __raw_writel(l, reg);
221}
222
223void omap_set_gpio_direction(int gpio, int is_input)
224{
225 struct gpio_bank *bank;
226
227 if (check_gpio(gpio) < 0)
228 return;
229 bank = get_gpio_bank(gpio);
230 spin_lock(&bank->lock);
231 _set_gpio_direction(bank, get_gpio_index(gpio), is_input);
232 spin_unlock(&bank->lock);
233}
234
235static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
236{
237 u32 reg = bank->base;
238 u32 l = 0;
239
240 switch (bank->method) {
241 case METHOD_MPUIO:
242 reg += OMAP_MPUIO_OUTPUT;
243 l = __raw_readl(reg);
244 if (enable)
245 l |= 1 << gpio;
246 else
247 l &= ~(1 << gpio);
248 break;
249 case METHOD_GPIO_1510:
250 reg += OMAP1510_GPIO_DATA_OUTPUT;
251 l = __raw_readl(reg);
252 if (enable)
253 l |= 1 << gpio;
254 else
255 l &= ~(1 << gpio);
256 break;
257 case METHOD_GPIO_1610:
258 if (enable)
259 reg += OMAP1610_GPIO_SET_DATAOUT;
260 else
261 reg += OMAP1610_GPIO_CLEAR_DATAOUT;
262 l = 1 << gpio;
263 break;
264 case METHOD_GPIO_730:
265 reg += OMAP730_GPIO_DATA_OUTPUT;
266 l = __raw_readl(reg);
267 if (enable)
268 l |= 1 << gpio;
269 else
270 l &= ~(1 << gpio);
271 break;
272 default:
273 BUG();
274 return;
275 }
276 __raw_writel(l, reg);
277}
278
279void omap_set_gpio_dataout(int gpio, int enable)
280{
281 struct gpio_bank *bank;
282
283 if (check_gpio(gpio) < 0)
284 return;
285 bank = get_gpio_bank(gpio);
286 spin_lock(&bank->lock);
287 _set_gpio_dataout(bank, get_gpio_index(gpio), enable);
288 spin_unlock(&bank->lock);
289}
290
291int omap_get_gpio_datain(int gpio)
292{
293 struct gpio_bank *bank;
294 u32 reg;
295
296 if (check_gpio(gpio) < 0)
297 return -1;
298 bank = get_gpio_bank(gpio);
299 reg = bank->base;
300 switch (bank->method) {
301 case METHOD_MPUIO:
302 reg += OMAP_MPUIO_INPUT_LATCH;
303 break;
304 case METHOD_GPIO_1510:
305 reg += OMAP1510_GPIO_DATA_INPUT;
306 break;
307 case METHOD_GPIO_1610:
308 reg += OMAP1610_GPIO_DATAIN;
309 break;
310 case METHOD_GPIO_730:
311 reg += OMAP730_GPIO_DATA_INPUT;
312 break;
313 default:
314 BUG();
315 return -1;
316 }
317 return (__raw_readl(reg) & (1 << get_gpio_index(gpio))) != 0;
318}
319
320static void _set_gpio_edge_ctrl(struct gpio_bank *bank, int gpio, int edge)
321{
322 u32 reg = bank->base;
323 u32 l;
324
325 switch (bank->method) {
326 case METHOD_MPUIO:
327 reg += OMAP_MPUIO_GPIO_INT_EDGE;
328 l = __raw_readl(reg);
329 if (edge == OMAP_GPIO_RISING_EDGE)
330 l |= 1 << gpio;
331 else
332 l &= ~(1 << gpio);
333 __raw_writel(l, reg);
334 break;
335 case METHOD_GPIO_1510:
336 reg += OMAP1510_GPIO_INT_CONTROL;
337 l = __raw_readl(reg);
338 if (edge == OMAP_GPIO_RISING_EDGE)
339 l |= 1 << gpio;
340 else
341 l &= ~(1 << gpio);
342 __raw_writel(l, reg);
343 break;
344 case METHOD_GPIO_1610:
345 edge &= 0x03;
346 if (gpio & 0x08)
347 reg += OMAP1610_GPIO_EDGE_CTRL2;
348 else
349 reg += OMAP1610_GPIO_EDGE_CTRL1;
350 gpio &= 0x07;
351 l = __raw_readl(reg);
352 l &= ~(3 << (gpio << 1));
353 l |= edge << (gpio << 1);
354 __raw_writel(l, reg);
355 break;
356 case METHOD_GPIO_730:
357 reg += OMAP730_GPIO_INT_CONTROL;
358 l = __raw_readl(reg);
359 if (edge == OMAP_GPIO_RISING_EDGE)
360 l |= 1 << gpio;
361 else
362 l &= ~(1 << gpio);
363 __raw_writel(l, reg);
364 break;
365 default:
366 BUG();
367 return;
368 }
369}
370
371void omap_set_gpio_edge_ctrl(int gpio, int edge)
372{
373 struct gpio_bank *bank;
374
375 if (check_gpio(gpio) < 0)
376 return;
377 bank = get_gpio_bank(gpio);
378 spin_lock(&bank->lock);
379 _set_gpio_edge_ctrl(bank, get_gpio_index(gpio), edge);
380 spin_unlock(&bank->lock);
381}
382
383
384static int _get_gpio_edge_ctrl(struct gpio_bank *bank, int gpio)
385{
386 u32 reg = bank->base, l;
387
388 switch (bank->method) {
389 case METHOD_MPUIO:
390 l = __raw_readl(reg + OMAP_MPUIO_GPIO_INT_EDGE);
391 return (l & (1 << gpio)) ?
392 OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
393 case METHOD_GPIO_1510:
394 l = __raw_readl(reg + OMAP1510_GPIO_INT_CONTROL);
395 return (l & (1 << gpio)) ?
396 OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
397 case METHOD_GPIO_1610:
398 if (gpio & 0x08)
399 reg += OMAP1610_GPIO_EDGE_CTRL2;
400 else
401 reg += OMAP1610_GPIO_EDGE_CTRL1;
402 return (__raw_readl(reg) >> ((gpio & 0x07) << 1)) & 0x03;
403 case METHOD_GPIO_730:
404 l = __raw_readl(reg + OMAP730_GPIO_INT_CONTROL);
405 return (l & (1 << gpio)) ?
406 OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
407 default:
408 BUG();
409 return -1;
410 }
411}
412
413static void _clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask)
414{
415 u32 reg = bank->base;
416
417 switch (bank->method) {
418 case METHOD_MPUIO:
419 /* MPUIO irqstatus is reset by reading the status register,
420 * so do nothing here */
421 return;
422 case METHOD_GPIO_1510:
423 reg += OMAP1510_GPIO_INT_STATUS;
424 break;
425 case METHOD_GPIO_1610:
426 reg += OMAP1610_GPIO_IRQSTATUS1;
427 break;
428 case METHOD_GPIO_730:
429 reg += OMAP730_GPIO_INT_STATUS;
430 break;
431 default:
432 BUG();
433 return;
434 }
435 __raw_writel(gpio_mask, reg);
436}
437
438static inline void _clear_gpio_irqstatus(struct gpio_bank *bank, int gpio)
439{
440 _clear_gpio_irqbank(bank, 1 << get_gpio_index(gpio));
441}
442
443static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enable)
444{
445 u32 reg = bank->base;
446 u32 l;
447
448 switch (bank->method) {
449 case METHOD_MPUIO:
450 reg += OMAP_MPUIO_GPIO_MASKIT;
451 l = __raw_readl(reg);
452 if (enable)
453 l &= ~(gpio_mask);
454 else
455 l |= gpio_mask;
456 break;
457 case METHOD_GPIO_1510:
458 reg += OMAP1510_GPIO_INT_MASK;
459 l = __raw_readl(reg);
460 if (enable)
461 l &= ~(gpio_mask);
462 else
463 l |= gpio_mask;
464 break;
465 case METHOD_GPIO_1610:
466 if (enable)
467 reg += OMAP1610_GPIO_SET_IRQENABLE1;
468 else
469 reg += OMAP1610_GPIO_CLEAR_IRQENABLE1;
470 l = gpio_mask;
471 break;
472 case METHOD_GPIO_730:
473 reg += OMAP730_GPIO_INT_MASK;
474 l = __raw_readl(reg);
475 if (enable)
476 l &= ~(gpio_mask);
477 else
478 l |= gpio_mask;
479 break;
480 default:
481 BUG();
482 return;
483 }
484 __raw_writel(l, reg);
485}
486
487static inline void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable)
488{
489 _enable_gpio_irqbank(bank, 1 << get_gpio_index(gpio), enable);
490}
491
492int omap_request_gpio(int gpio)
493{
494 struct gpio_bank *bank;
495
496 if (check_gpio(gpio) < 0)
497 return -EINVAL;
498
499 bank = get_gpio_bank(gpio);
500 spin_lock(&bank->lock);
501 if (unlikely(bank->reserved_map & (1 << get_gpio_index(gpio)))) {
502 printk(KERN_ERR "omap-gpio: GPIO %d is already reserved!\n", gpio);
503 dump_stack();
504 spin_unlock(&bank->lock);
505 return -1;
506 }
507 bank->reserved_map |= (1 << get_gpio_index(gpio));
508#ifdef CONFIG_ARCH_OMAP1510
509 if (bank->method == METHOD_GPIO_1510) {
510 u32 reg;
511
512 /* Claim the pin for the ARM */
513 reg = bank->base + OMAP1510_GPIO_PIN_CONTROL;
514 __raw_writel(__raw_readl(reg) | (1 << get_gpio_index(gpio)), reg);
515 }
516#endif
517 spin_unlock(&bank->lock);
518
519 return 0;
520}
521
522void omap_free_gpio(int gpio)
523{
524 struct gpio_bank *bank;
525
526 if (check_gpio(gpio) < 0)
527 return;
528 bank = get_gpio_bank(gpio);
529 spin_lock(&bank->lock);
530 if (unlikely(!(bank->reserved_map & (1 << get_gpio_index(gpio))))) {
531 printk(KERN_ERR "omap-gpio: GPIO %d wasn't reserved!\n", gpio);
532 dump_stack();
533 spin_unlock(&bank->lock);
534 return;
535 }
536 bank->reserved_map &= ~(1 << get_gpio_index(gpio));
537 _set_gpio_direction(bank, get_gpio_index(gpio), 1);
538 _set_gpio_irqenable(bank, gpio, 0);
539 _clear_gpio_irqstatus(bank, gpio);
540 spin_unlock(&bank->lock);
541}
542
543/*
544 * We need to unmask the GPIO bank interrupt as soon as possible to
545 * avoid missing GPIO interrupts for other lines in the bank.
546 * Then we need to mask-read-clear-unmask the triggered GPIO lines
547 * in the bank to avoid missing nested interrupts for a GPIO line.
548 * If we wait to unmask individual GPIO lines in the bank after the
549 * line's interrupt handler has been run, we may miss some nested
550 * interrupts.
551 */
552static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
553 struct pt_regs *regs)
554{
555 u32 isr_reg = 0;
556 u32 isr;
557 unsigned int gpio_irq;
558 struct gpio_bank *bank;
559
560 desc->chip->ack(irq);
561
562 bank = (struct gpio_bank *) desc->data;
563 if (bank->method == METHOD_MPUIO)
564 isr_reg = bank->base + OMAP_MPUIO_GPIO_INT;
565#ifdef CONFIG_ARCH_OMAP1510
566 if (bank->method == METHOD_GPIO_1510)
567 isr_reg = bank->base + OMAP1510_GPIO_INT_STATUS;
568#endif
569#if defined(CONFIG_ARCH_OMAP16XX)
570 if (bank->method == METHOD_GPIO_1610)
571 isr_reg = bank->base + OMAP1610_GPIO_IRQSTATUS1;
572#endif
573#ifdef CONFIG_ARCH_OMAP730
574 if (bank->method == METHOD_GPIO_730)
575 isr_reg = bank->base + OMAP730_GPIO_INT_STATUS;
576#endif
577
578 isr = __raw_readl(isr_reg);
579 _enable_gpio_irqbank(bank, isr, 0);
580 _clear_gpio_irqbank(bank, isr);
581 _enable_gpio_irqbank(bank, isr, 1);
582 desc->chip->unmask(irq);
583
584 if (unlikely(!isr))
585 return;
586
587 gpio_irq = bank->virtual_irq_start;
588 for (; isr != 0; isr >>= 1, gpio_irq++) {
589 struct irqdesc *d;
590 if (!(isr & 1))
591 continue;
592 d = irq_desc + gpio_irq;
593 d->handle(gpio_irq, d, regs);
594 }
595}
596
597static void gpio_ack_irq(unsigned int irq)
598{
599 unsigned int gpio = irq - IH_GPIO_BASE;
600 struct gpio_bank *bank = get_gpio_bank(gpio);
601
602 _clear_gpio_irqstatus(bank, gpio);
603}
604
605static void gpio_mask_irq(unsigned int irq)
606{
607 unsigned int gpio = irq - IH_GPIO_BASE;
608 struct gpio_bank *bank = get_gpio_bank(gpio);
609
610 _set_gpio_irqenable(bank, gpio, 0);
611}
612
613static void gpio_unmask_irq(unsigned int irq)
614{
615 unsigned int gpio = irq - IH_GPIO_BASE;
616 struct gpio_bank *bank = get_gpio_bank(gpio);
617
618 if (_get_gpio_edge_ctrl(bank, get_gpio_index(gpio)) == OMAP_GPIO_NO_EDGE) {
619 printk(KERN_ERR "OMAP GPIO %d: trying to enable GPIO IRQ while no edge is set\n",
620 gpio);
621 _set_gpio_edge_ctrl(bank, get_gpio_index(gpio), OMAP_GPIO_RISING_EDGE);
622 }
623 _set_gpio_irqenable(bank, gpio, 1);
624}
625
626static void mpuio_ack_irq(unsigned int irq)
627{
628 /* The ISR is reset automatically, so do nothing here. */
629}
630
631static void mpuio_mask_irq(unsigned int irq)
632{
633 unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE);
634 struct gpio_bank *bank = get_gpio_bank(gpio);
635
636 _set_gpio_irqenable(bank, gpio, 0);
637}
638
639static void mpuio_unmask_irq(unsigned int irq)
640{
641 unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE);
642 struct gpio_bank *bank = get_gpio_bank(gpio);
643
644 _set_gpio_irqenable(bank, gpio, 1);
645}
646
647static struct irqchip gpio_irq_chip = {
648 .ack = gpio_ack_irq,
649 .mask = gpio_mask_irq,
650 .unmask = gpio_unmask_irq,
651};
652
653static struct irqchip mpuio_irq_chip = {
654 .ack = mpuio_ack_irq,
655 .mask = mpuio_mask_irq,
656 .unmask = mpuio_unmask_irq
657};
658
659static int initialized = 0;
660
661static int __init _omap_gpio_init(void)
662{
663 int i;
664 struct gpio_bank *bank;
665
666 initialized = 1;
667
668#ifdef CONFIG_ARCH_OMAP1510
669 if (cpu_is_omap1510()) {
670 printk(KERN_INFO "OMAP1510 GPIO hardware\n");
671 gpio_bank_count = 2;
672 gpio_bank = gpio_bank_1510;
673 }
674#endif
675#if defined(CONFIG_ARCH_OMAP16XX)
676 if (cpu_is_omap16xx()) {
677 int rev;
678
679 gpio_bank_count = 5;
680 gpio_bank = gpio_bank_1610;
681 rev = omap_readw(gpio_bank[1].base + OMAP1610_GPIO_REVISION);
682 printk(KERN_INFO "OMAP GPIO hardware version %d.%d\n",
683 (rev >> 4) & 0x0f, rev & 0x0f);
684 }
685#endif
686#ifdef CONFIG_ARCH_OMAP730
687 if (cpu_is_omap730()) {
688 printk(KERN_INFO "OMAP730 GPIO hardware\n");
689 gpio_bank_count = 7;
690 gpio_bank = gpio_bank_730;
691 }
692#endif
693 for (i = 0; i < gpio_bank_count; i++) {
694 int j, gpio_count = 16;
695
696 bank = &gpio_bank[i];
697 bank->reserved_map = 0;
698 bank->base = IO_ADDRESS(bank->base);
699 spin_lock_init(&bank->lock);
700 if (bank->method == METHOD_MPUIO) {
701 omap_writew(0xFFFF, OMAP_MPUIO_BASE + OMAP_MPUIO_GPIO_MASKIT);
702 }
703#ifdef CONFIG_ARCH_OMAP1510
704 if (bank->method == METHOD_GPIO_1510) {
705 __raw_writew(0xffff, bank->base + OMAP1510_GPIO_INT_MASK);
706 __raw_writew(0x0000, bank->base + OMAP1510_GPIO_INT_STATUS);
707 }
708#endif
709#if defined(CONFIG_ARCH_OMAP16XX)
710 if (bank->method == METHOD_GPIO_1610) {
711 __raw_writew(0x0000, bank->base + OMAP1610_GPIO_IRQENABLE1);
712 __raw_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1);
713 }
714#endif
715#ifdef CONFIG_ARCH_OMAP730
716 if (bank->method == METHOD_GPIO_730) {
717 __raw_writel(0xffffffff, bank->base + OMAP730_GPIO_INT_MASK);
718 __raw_writel(0x00000000, bank->base + OMAP730_GPIO_INT_STATUS);
719
720 gpio_count = 32; /* 730 has 32-bit GPIOs */
721 }
722#endif
723 for (j = bank->virtual_irq_start;
724 j < bank->virtual_irq_start + gpio_count; j++) {
725 if (bank->method == METHOD_MPUIO)
726 set_irq_chip(j, &mpuio_irq_chip);
727 else
728 set_irq_chip(j, &gpio_irq_chip);
729 set_irq_handler(j, do_simple_IRQ);
730 set_irq_flags(j, IRQF_VALID);
731 }
732 set_irq_chained_handler(bank->irq, gpio_irq_handler);
733 set_irq_data(bank->irq, bank);
734 }
735
736 /* Enable system clock for GPIO module.
737 * The CAM_CLK_CTRL *is* really the right place. */
738 if (cpu_is_omap1610() || cpu_is_omap1710())
739 omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04, ULPD_CAM_CLK_CTRL);
740
741 return 0;
742}
743
744/*
745 * This may get called early from board specific init
746 */
747int omap_gpio_init(void)
748{
749 if (!initialized)
750 return _omap_gpio_init();
751 else
752 return 0;
753}
754
755EXPORT_SYMBOL(omap_request_gpio);
756EXPORT_SYMBOL(omap_free_gpio);
757EXPORT_SYMBOL(omap_set_gpio_direction);
758EXPORT_SYMBOL(omap_set_gpio_dataout);
759EXPORT_SYMBOL(omap_get_gpio_datain);
760EXPORT_SYMBOL(omap_set_gpio_edge_ctrl);
761
762arch_initcall(omap_gpio_init);
diff --git a/arch/arm/mach-omap/irq.c b/arch/arm/mach-omap/irq.c
new file mode 100644
index 000000000000..f01c99266a86
--- /dev/null
+++ b/arch/arm/mach-omap/irq.c
@@ -0,0 +1,219 @@
1/*
2 * linux/arch/arm/mach-omap/irq.c
3 *
4 * Interrupt handler for all OMAP boards
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 * Written by Tony Lindgren <tony@atomide.com>
8 * Major cleanups by Juha Yrjölä <juha.yrjola@nokia.com>
9 *
10 * Completely re-written to support various OMAP chips with bank specific
11 * interrupt handlers.
12 *
13 * Some snippets of the code taken from the older OMAP interrupt handler
14 * Copyright (C) 2001 RidgeRun, Inc. Greg Lonnon <glonnon@ridgerun.com>
15 *
16 * GPIO interrupt handler moved to gpio.c by Juha Yrjola
17 *
18 * This program is free software; you can redistribute it and/or modify it
19 * under the terms of the GNU General Public License as published by the
20 * Free Software Foundation; either version 2 of the License, or (at your
21 * option) any later version.
22 *
23 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
24 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
26 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
29 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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
39#include <linux/config.h>
40#include <linux/init.h>
41#include <linux/module.h>
42#include <linux/sched.h>
43#include <linux/interrupt.h>
44#include <linux/ptrace.h>
45
46#include <asm/hardware.h>
47#include <asm/irq.h>
48#include <asm/mach/irq.h>
49#include <asm/arch/gpio.h>
50
51#include <asm/io.h>
52
53#define IRQ_BANK(irq) ((irq) >> 5)
54#define IRQ_BIT(irq) ((irq) & 0x1f)
55
56struct omap_irq_bank {
57 unsigned long base_reg;
58 unsigned long trigger_map;
59};
60
61static unsigned int irq_bank_count = 0;
62static struct omap_irq_bank *irq_banks;
63
64static inline unsigned int irq_bank_readl(int bank, int offset)
65{
66 return omap_readl(irq_banks[bank].base_reg + offset);
67}
68
69static inline void irq_bank_writel(unsigned long value, int bank, int offset)
70{
71 omap_writel(value, irq_banks[bank].base_reg + offset);
72}
73
74static void omap_ack_irq(unsigned int irq)
75{
76 if (irq > 31)
77 omap_writel(0x1, OMAP_IH2_BASE + IRQ_CONTROL_REG_OFFSET);
78
79 omap_writel(0x1, OMAP_IH1_BASE + IRQ_CONTROL_REG_OFFSET);
80}
81
82static void omap_mask_irq(unsigned int irq)
83{
84 int bank = IRQ_BANK(irq);
85 u32 l;
86
87 l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
88 l |= 1 << IRQ_BIT(irq);
89 omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
90}
91
92static void omap_unmask_irq(unsigned int irq)
93{
94 int bank = IRQ_BANK(irq);
95 u32 l;
96
97 l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
98 l &= ~(1 << IRQ_BIT(irq));
99 omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
100}
101
102static void omap_mask_ack_irq(unsigned int irq)
103{
104 omap_mask_irq(irq);
105 omap_ack_irq(irq);
106}
107
108/*
109 * Allows tuning the IRQ type and priority
110 *
111 * NOTE: There is currently no OMAP fiq handler for Linux. Read the
112 * mailing list threads on FIQ handlers if you are planning to
113 * add a FIQ handler for OMAP.
114 */
115static void omap_irq_set_cfg(int irq, int fiq, int priority, int trigger)
116{
117 signed int bank;
118 unsigned long val, offset;
119
120 bank = IRQ_BANK(irq);
121 /* FIQ is only available on bank 0 interrupts */
122 fiq = bank ? 0 : (fiq & 0x1);
123 val = fiq | ((priority & 0x1f) << 2) | ((trigger & 0x1) << 1);
124 offset = IRQ_ILR0_REG_OFFSET + IRQ_BIT(irq) * 0x4;
125 irq_bank_writel(val, bank, offset);
126}
127
128#ifdef CONFIG_ARCH_OMAP730
129static struct omap_irq_bank omap730_irq_banks[] = {
130 { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3f8e22f },
131 { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb9c1f2 },
132 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0x800040f3 },
133};
134#endif
135
136#ifdef CONFIG_ARCH_OMAP1510
137static struct omap_irq_bank omap1510_irq_banks[] = {
138 { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3febfff },
139 { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xffbfffed },
140};
141#endif
142
143#if defined(CONFIG_ARCH_OMAP16XX)
144
145static struct omap_irq_bank omap1610_irq_banks[] = {
146 { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3fefe8f },
147 { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb7c1fd },
148 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0xfffff7ff },
149 { .base_reg = OMAP_IH2_BASE + 0x200, .trigger_map = 0xffffffff },
150};
151#endif
152
153static struct irqchip omap_irq_chip = {
154 .ack = omap_mask_ack_irq,
155 .mask = omap_mask_irq,
156 .unmask = omap_unmask_irq,
157};
158
159void __init omap_init_irq(void)
160{
161 int i, j;
162
163#ifdef CONFIG_ARCH_OMAP730
164 if (cpu_is_omap730()) {
165 irq_banks = omap730_irq_banks;
166 irq_bank_count = ARRAY_SIZE(omap730_irq_banks);
167 }
168#endif
169#ifdef CONFIG_ARCH_OMAP1510
170 if (cpu_is_omap1510()) {
171 irq_banks = omap1510_irq_banks;
172 irq_bank_count = ARRAY_SIZE(omap1510_irq_banks);
173 }
174#endif
175#if defined(CONFIG_ARCH_OMAP16XX)
176 if (cpu_is_omap16xx()) {
177 irq_banks = omap1610_irq_banks;
178 irq_bank_count = ARRAY_SIZE(omap1610_irq_banks);
179 }
180#endif
181 printk("Total of %i interrupts in %i interrupt banks\n",
182 irq_bank_count * 32, irq_bank_count);
183
184 /* Mask and clear all interrupts */
185 for (i = 0; i < irq_bank_count; i++) {
186 irq_bank_writel(~0x0, i, IRQ_MIR_REG_OFFSET);
187 irq_bank_writel(0x0, i, IRQ_ITR_REG_OFFSET);
188 }
189
190 /* Clear any pending interrupts */
191 irq_bank_writel(0x03, 0, IRQ_CONTROL_REG_OFFSET);
192 irq_bank_writel(0x03, 1, IRQ_CONTROL_REG_OFFSET);
193
194 /* Enable interrupts in global mask */
195 if (cpu_is_omap730()) {
196 irq_bank_writel(0x0, 0, IRQ_GMR_REG_OFFSET);
197 }
198
199 /* Install the interrupt handlers for each bank */
200 for (i = 0; i < irq_bank_count; i++) {
201 for (j = i * 32; j < (i + 1) * 32; j++) {
202 int irq_trigger;
203
204 irq_trigger = irq_banks[i].trigger_map >> IRQ_BIT(j);
205 omap_irq_set_cfg(j, 0, 0, irq_trigger);
206
207 set_irq_chip(j, &omap_irq_chip);
208 set_irq_handler(j, do_level_IRQ);
209 set_irq_flags(j, IRQF_VALID);
210 }
211 }
212
213 /* Unmask level 2 handler */
214 if (cpu_is_omap730()) {
215 omap_unmask_irq(INT_730_IH2_IRQ);
216 } else {
217 omap_unmask_irq(INT_IH2_IRQ);
218 }
219}
diff --git a/arch/arm/mach-omap/leds-h2p2-debug.c b/arch/arm/mach-omap/leds-h2p2-debug.c
new file mode 100644
index 000000000000..6e98290cca5c
--- /dev/null
+++ b/arch/arm/mach-omap/leds-h2p2-debug.c
@@ -0,0 +1,144 @@
1/*
2 * linux/arch/arm/mach-omap/leds-h2p2-debug.c
3 *
4 * Copyright 2003 by Texas Instruments Incorporated
5 *
6 * There are 16 LEDs on the debug board (all green); four may be used
7 * for logical 'green', 'amber', 'red', and 'blue' (after "claiming").
8 *
9 * The "surfer" expansion board and H2 sample board also have two-color
10 * green+red LEDs (in parallel), used here for timer and idle indicators.
11 */
12#include <linux/config.h>
13#include <linux/init.h>
14#include <linux/kernel_stat.h>
15#include <linux/sched.h>
16#include <linux/version.h>
17
18#include <asm/io.h>
19#include <asm/hardware.h>
20#include <asm/leds.h>
21#include <asm/system.h>
22
23#include <asm/arch/fpga.h>
24#include <asm/arch/gpio.h>
25
26#include "leds.h"
27
28
29#define GPIO_LED_RED 3
30#define GPIO_LED_GREEN OMAP_MPUIO(4)
31
32
33#define LED_STATE_ENABLED 0x01
34#define LED_STATE_CLAIMED 0x02
35#define LED_TIMER_ON 0x04
36
37#define GPIO_IDLE GPIO_LED_GREEN
38#define GPIO_TIMER GPIO_LED_RED
39
40
41void h2p2_dbg_leds_event(led_event_t evt)
42{
43 unsigned long flags;
44
45 static struct h2p2_dbg_fpga __iomem *fpga;
46 static u16 led_state, hw_led_state;
47
48 local_irq_save(flags);
49
50 if (!(led_state & LED_STATE_ENABLED) && evt != led_start)
51 goto done;
52
53 switch (evt) {
54 case led_start:
55 if (!fpga)
56 fpga = ioremap(H2P2_DBG_FPGA_START,
57 H2P2_DBG_FPGA_SIZE);
58 if (fpga) {
59 led_state |= LED_STATE_ENABLED;
60 __raw_writew(~0, &fpga->leds);
61 }
62 break;
63
64 case led_stop:
65 case led_halted:
66 /* all leds off during suspend or shutdown */
67 omap_set_gpio_dataout(GPIO_TIMER, 0);
68 omap_set_gpio_dataout(GPIO_IDLE, 0);
69 __raw_writew(~0, &fpga->leds);
70 led_state &= ~LED_STATE_ENABLED;
71 if (evt == led_halted) {
72 iounmap(fpga);
73 fpga = NULL;
74 }
75 goto done;
76
77 case led_claim:
78 led_state |= LED_STATE_CLAIMED;
79 hw_led_state = 0;
80 break;
81
82 case led_release:
83 led_state &= ~LED_STATE_CLAIMED;
84 break;
85
86#ifdef CONFIG_LEDS_TIMER
87 case led_timer:
88 led_state ^= LED_TIMER_ON;
89 omap_set_gpio_dataout(GPIO_TIMER, led_state & LED_TIMER_ON);
90 goto done;
91#endif
92
93#ifdef CONFIG_LEDS_CPU
94 case led_idle_start:
95 omap_set_gpio_dataout(GPIO_IDLE, 1);
96 goto done;
97
98 case led_idle_end:
99 omap_set_gpio_dataout(GPIO_IDLE, 0);
100 goto done;
101#endif
102
103 case led_green_on:
104 hw_led_state |= H2P2_DBG_FPGA_LED_GREEN;
105 break;
106 case led_green_off:
107 hw_led_state &= ~H2P2_DBG_FPGA_LED_GREEN;
108 break;
109
110 case led_amber_on:
111 hw_led_state |= H2P2_DBG_FPGA_LED_AMBER;
112 break;
113 case led_amber_off:
114 hw_led_state &= ~H2P2_DBG_FPGA_LED_AMBER;
115 break;
116
117 case led_red_on:
118 hw_led_state |= H2P2_DBG_FPGA_LED_RED;
119 break;
120 case led_red_off:
121 hw_led_state &= ~H2P2_DBG_FPGA_LED_RED;
122 break;
123
124 case led_blue_on:
125 hw_led_state |= H2P2_DBG_FPGA_LED_BLUE;
126 break;
127 case led_blue_off:
128 hw_led_state &= ~H2P2_DBG_FPGA_LED_BLUE;
129 break;
130
131 default:
132 break;
133 }
134
135
136 /*
137 * Actually burn the LEDs
138 */
139 if (led_state & LED_STATE_CLAIMED)
140 __raw_writew(~hw_led_state, &fpga->leds);
141
142done:
143 local_irq_restore(flags);
144}
diff --git a/arch/arm/mach-omap/leds-innovator.c b/arch/arm/mach-omap/leds-innovator.c
new file mode 100644
index 000000000000..8043b7d0f66e
--- /dev/null
+++ b/arch/arm/mach-omap/leds-innovator.c
@@ -0,0 +1,103 @@
1/*
2 * linux/arch/arm/mach-omap/leds-innovator.c
3 */
4#include <linux/config.h>
5#include <linux/init.h>
6
7#include <asm/hardware.h>
8#include <asm/leds.h>
9#include <asm/system.h>
10
11#include "leds.h"
12
13
14#define LED_STATE_ENABLED 1
15#define LED_STATE_CLAIMED 2
16
17static unsigned int led_state;
18static unsigned int hw_led_state;
19
20void innovator_leds_event(led_event_t evt)
21{
22 unsigned long flags;
23
24 local_irq_save(flags);
25
26 switch (evt) {
27 case led_start:
28 hw_led_state = 0;
29 led_state = LED_STATE_ENABLED;
30 break;
31
32 case led_stop:
33 led_state &= ~LED_STATE_ENABLED;
34 hw_led_state = 0;
35 break;
36
37 case led_claim:
38 led_state |= LED_STATE_CLAIMED;
39 hw_led_state = 0;
40 break;
41
42 case led_release:
43 led_state &= ~LED_STATE_CLAIMED;
44 hw_led_state = 0;
45 break;
46
47#ifdef CONFIG_LEDS_TIMER
48 case led_timer:
49 if (!(led_state & LED_STATE_CLAIMED))
50 hw_led_state ^= 0;
51 break;
52#endif
53
54#ifdef CONFIG_LEDS_CPU
55 case led_idle_start:
56 if (!(led_state & LED_STATE_CLAIMED))
57 hw_led_state |= 0;
58 break;
59
60 case led_idle_end:
61 if (!(led_state & LED_STATE_CLAIMED))
62 hw_led_state &= ~0;
63 break;
64#endif
65
66 case led_halted:
67 break;
68
69 case led_green_on:
70 if (led_state & LED_STATE_CLAIMED)
71 hw_led_state &= ~0;
72 break;
73
74 case led_green_off:
75 if (led_state & LED_STATE_CLAIMED)
76 hw_led_state |= 0;
77 break;
78
79 case led_amber_on:
80 break;
81
82 case led_amber_off:
83 break;
84
85 case led_red_on:
86 if (led_state & LED_STATE_CLAIMED)
87 hw_led_state &= ~0;
88 break;
89
90 case led_red_off:
91 if (led_state & LED_STATE_CLAIMED)
92 hw_led_state |= 0;
93 break;
94
95 default:
96 break;
97 }
98
99 if (led_state & LED_STATE_ENABLED)
100 ;
101
102 local_irq_restore(flags);
103}
diff --git a/arch/arm/mach-omap/leds-osk.c b/arch/arm/mach-omap/leds-osk.c
new file mode 100644
index 000000000000..f5177f430793
--- /dev/null
+++ b/arch/arm/mach-omap/leds-osk.c
@@ -0,0 +1,198 @@
1/*
2 * linux/arch/arm/mach-omap/leds-osk.c
3 *
4 * LED driver for OSK, and optionally Mistral QVGA, boards
5 */
6#include <linux/config.h>
7#include <linux/init.h>
8#include <linux/workqueue.h>
9
10#include <asm/hardware.h>
11#include <asm/leds.h>
12#include <asm/system.h>
13
14#include <asm/arch/gpio.h>
15#include <asm/arch/tps65010.h>
16
17#include "leds.h"
18
19
20#define LED_STATE_ENABLED (1 << 0)
21#define LED_STATE_CLAIMED (1 << 1)
22static u8 led_state;
23
24#define GREEN_LED (1 << 0) /* TPS65010 LED1 */
25#define AMBER_LED (1 << 1) /* TPS65010 LED2 */
26#define RED_LED (1 << 2) /* TPS65010 GPIO2 */
27#define TIMER_LED (1 << 3) /* Mistral board */
28#define IDLE_LED (1 << 4) /* Mistral board */
29static u8 hw_led_state;
30
31
32/* TPS65010 leds are changed using i2c -- from a task context.
33 * Using one of these for the "idle" LED would be impractical...
34 */
35#define TPS_LEDS (GREEN_LED | RED_LED | AMBER_LED)
36
37static u8 tps_leds_change;
38
39static void tps_work(void *unused)
40{
41 for (;;) {
42 u8 leds;
43
44 local_irq_disable();
45 leds = tps_leds_change;
46 tps_leds_change = 0;
47 local_irq_enable();
48
49 if (!leds)
50 break;
51
52 /* careful: the set_led() value is on/off/blink */
53 if (leds & GREEN_LED)
54 tps65010_set_led(LED1, !!(hw_led_state & GREEN_LED));
55 if (leds & AMBER_LED)
56 tps65010_set_led(LED2, !!(hw_led_state & AMBER_LED));
57
58 /* the gpio led doesn't have that issue */
59 if (leds & RED_LED)
60 tps65010_set_gpio_out_value(GPIO2,
61 !(hw_led_state & RED_LED));
62 }
63}
64
65static DECLARE_WORK(work, tps_work, NULL);
66
67#ifdef CONFIG_FB_OMAP
68
69/* For now, all system indicators require the Mistral board, since that
70 * LED can be manipulated without a task context. This LED is either red,
71 * or green, but not both; it can't give the full "disco led" effect.
72 */
73
74#define GPIO_LED_RED 3
75#define GPIO_LED_GREEN OMAP_MPUIO(4)
76
77static void mistral_setled(void)
78{
79 int red = 0;
80 int green = 0;
81
82 if (hw_led_state & TIMER_LED)
83 red = 1;
84 else if (hw_led_state & IDLE_LED)
85 green = 1;
86 // else both sides are disabled
87
88 omap_set_gpio_dataout(GPIO_LED_GREEN, green);
89 omap_set_gpio_dataout(GPIO_LED_RED, red);
90}
91
92#endif
93
94void osk_leds_event(led_event_t evt)
95{
96 unsigned long flags;
97 u16 leds;
98
99 local_irq_save(flags);
100
101 if (!(led_state & LED_STATE_ENABLED) && evt != led_start)
102 goto done;
103
104 leds = hw_led_state;
105 switch (evt) {
106 case led_start:
107 led_state |= LED_STATE_ENABLED;
108 hw_led_state = 0;
109 leds = ~0;
110 break;
111
112 case led_halted:
113 case led_stop:
114 led_state &= ~LED_STATE_ENABLED;
115 hw_led_state = 0;
116 // NOTE: work may still be pending!!
117 break;
118
119 case led_claim:
120 led_state |= LED_STATE_CLAIMED;
121 hw_led_state = 0;
122 leds = ~0;
123 break;
124
125 case led_release:
126 led_state &= ~LED_STATE_CLAIMED;
127 hw_led_state = 0;
128 break;
129
130#ifdef CONFIG_FB_OMAP
131
132#ifdef CONFIG_LEDS_TIMER
133 case led_timer:
134 hw_led_state ^= TIMER_LED;
135 mistral_setled();
136 break;
137#endif
138
139#ifdef CONFIG_LEDS_CPU
140 case led_idle_start:
141 hw_led_state |= IDLE_LED;
142 mistral_setled();
143 break;
144
145 case led_idle_end:
146 hw_led_state &= ~IDLE_LED;
147 mistral_setled();
148 break;
149#endif
150
151#endif /* CONFIG_FB_OMAP */
152
153 /* "green" == tps LED1 (leftmost, normally power-good)
154 * works only with DC adapter, not on battery power!
155 */
156 case led_green_on:
157 if (led_state & LED_STATE_CLAIMED)
158 hw_led_state |= GREEN_LED;
159 break;
160 case led_green_off:
161 if (led_state & LED_STATE_CLAIMED)
162 hw_led_state &= ~GREEN_LED;
163 break;
164
165 /* "amber" == tps LED2 (middle) */
166 case led_amber_on:
167 if (led_state & LED_STATE_CLAIMED)
168 hw_led_state |= AMBER_LED;
169 break;
170 case led_amber_off:
171 if (led_state & LED_STATE_CLAIMED)
172 hw_led_state &= ~AMBER_LED;
173 break;
174
175 /* "red" == LED on tps gpio3 (rightmost) */
176 case led_red_on:
177 if (led_state & LED_STATE_CLAIMED)
178 hw_led_state |= RED_LED;
179 break;
180 case led_red_off:
181 if (led_state & LED_STATE_CLAIMED)
182 hw_led_state &= ~RED_LED;
183 break;
184
185 default:
186 break;
187 }
188
189 leds ^= hw_led_state;
190 leds &= TPS_LEDS;
191 if (leds && (led_state & LED_STATE_CLAIMED)) {
192 tps_leds_change |= leds;
193 schedule_work(&work);
194 }
195
196done:
197 local_irq_restore(flags);
198}
diff --git a/arch/arm/mach-omap/leds.c b/arch/arm/mach-omap/leds.c
new file mode 100644
index 000000000000..8ab21fe98e1b
--- /dev/null
+++ b/arch/arm/mach-omap/leds.c
@@ -0,0 +1,61 @@
1/*
2 * linux/arch/arm/mach-omap/leds.c
3 *
4 * OMAP LEDs dispatcher
5 */
6#include <linux/kernel.h>
7#include <linux/init.h>
8
9#include <asm/leds.h>
10#include <asm/mach-types.h>
11
12#include <asm/arch/gpio.h>
13#include <asm/arch/mux.h>
14
15#include "leds.h"
16
17static int __init
18omap_leds_init(void)
19{
20 if (machine_is_omap_innovator())
21 leds_event = innovator_leds_event;
22
23 else if (machine_is_omap_h2() || machine_is_omap_perseus2())
24 leds_event = h2p2_dbg_leds_event;
25
26 else if (machine_is_omap_osk())
27 leds_event = osk_leds_event;
28
29 else
30 return -1;
31
32 if (machine_is_omap_h2()
33 || machine_is_omap_perseus2()
34 || machine_is_omap_osk()) {
35
36 /* LED1/LED2 pins can be used as GPIO (as done here), or by
37 * the LPG (works even in deep sleep!), to drive a bicolor
38 * LED on the H2 sample board, and another on the H2/P2
39 * "surfer" expansion board.
40 *
41 * The same pins drive a LED on the OSK Mistral board, but
42 * that's a different kind of LED (just one color at a time).
43 */
44 omap_cfg_reg(P18_1610_GPIO3);
45 if (omap_request_gpio(3) == 0)
46 omap_set_gpio_direction(3, 0);
47 else
48 printk(KERN_WARNING "LED: can't get GPIO3/red?\n");
49
50 omap_cfg_reg(MPUIO4);
51 if (omap_request_gpio(OMAP_MPUIO(4)) == 0)
52 omap_set_gpio_direction(OMAP_MPUIO(4), 0);
53 else
54 printk(KERN_WARNING "LED: can't get MPUIO4/green?\n");
55 }
56
57 leds_event(led_start);
58 return 0;
59}
60
61__initcall(omap_leds_init);
diff --git a/arch/arm/mach-omap/leds.h b/arch/arm/mach-omap/leds.h
new file mode 100644
index 000000000000..a1e9fedc376c
--- /dev/null
+++ b/arch/arm/mach-omap/leds.h
@@ -0,0 +1,3 @@
1extern void innovator_leds_event(led_event_t evt);
2extern void h2p2_dbg_leds_event(led_event_t evt);
3extern void osk_leds_event(led_event_t evt);
diff --git a/arch/arm/mach-omap/mcbsp.c b/arch/arm/mach-omap/mcbsp.c
new file mode 100644
index 000000000000..7c4ad7713091
--- /dev/null
+++ b/arch/arm/mach-omap/mcbsp.c
@@ -0,0 +1,685 @@
1/*
2 * linux/arch/arm/omap/mcbsp.c
3 *
4 * Copyright (C) 2004 Nokia Corporation
5 * Author: Samuel Ortiz <samuel.ortiz@nokia.com>
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Multichannel mode not supported.
13 */
14
15#include <linux/module.h>
16#include <linux/init.h>
17#include <linux/device.h>
18#include <linux/wait.h>
19#include <linux/completion.h>
20#include <linux/interrupt.h>
21#include <linux/err.h>
22
23#include <asm/delay.h>
24#include <asm/io.h>
25#include <asm/irq.h>
26
27#include <asm/arch/dma.h>
28#include <asm/arch/mux.h>
29#include <asm/arch/irqs.h>
30#include <asm/arch/mcbsp.h>
31
32#include <asm/hardware/clock.h>
33
34#ifdef CONFIG_MCBSP_DEBUG
35#define DBG(x...) printk(x)
36#else
37#define DBG(x...) do { } while (0)
38#endif
39
40struct omap_mcbsp {
41 u32 io_base;
42 u8 id;
43 u8 free;
44 omap_mcbsp_word_length rx_word_length;
45 omap_mcbsp_word_length tx_word_length;
46
47 /* IRQ based TX/RX */
48 int rx_irq;
49 int tx_irq;
50
51 /* DMA stuff */
52 u8 dma_rx_sync;
53 short dma_rx_lch;
54 u8 dma_tx_sync;
55 short dma_tx_lch;
56
57 /* Completion queues */
58 struct completion tx_irq_completion;
59 struct completion rx_irq_completion;
60 struct completion tx_dma_completion;
61 struct completion rx_dma_completion;
62
63 spinlock_t lock;
64};
65
66static struct omap_mcbsp mcbsp[OMAP_MAX_MCBSP_COUNT];
67static struct clk *mcbsp_dsp_ck = 0;
68static struct clk *mcbsp_api_ck = 0;
69
70
71static void omap_mcbsp_dump_reg(u8 id)
72{
73 DBG("**** MCBSP%d regs ****\n", mcbsp[id].id);
74 DBG("DRR2: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, DRR2));
75 DBG("DRR1: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, DRR1));
76 DBG("DXR2: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, DXR2));
77 DBG("DXR1: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, DXR1));
78 DBG("SPCR2: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, SPCR2));
79 DBG("SPCR1: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, SPCR1));
80 DBG("RCR2: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, RCR2));
81 DBG("RCR1: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, RCR1));
82 DBG("XCR2: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, XCR2));
83 DBG("XCR1: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, XCR1));
84 DBG("SRGR2: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, SRGR2));
85 DBG("SRGR1: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, SRGR1));
86 DBG("PCR0: 0x%04x\n", OMAP_MCBSP_READ(mcbsp[id].io_base, PCR0));
87 DBG("***********************\n");
88}
89
90
91static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
92{
93 struct omap_mcbsp * mcbsp_tx = (struct omap_mcbsp *)(dev_id);
94
95 DBG("TX IRQ callback : 0x%x\n", OMAP_MCBSP_READ(mcbsp_tx->io_base, SPCR2));
96
97 complete(&mcbsp_tx->tx_irq_completion);
98 return IRQ_HANDLED;
99}
100
101static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
102{
103 struct omap_mcbsp * mcbsp_rx = (struct omap_mcbsp *)(dev_id);
104
105 DBG("RX IRQ callback : 0x%x\n", OMAP_MCBSP_READ(mcbsp_rx->io_base, SPCR2));
106
107 complete(&mcbsp_rx->rx_irq_completion);
108 return IRQ_HANDLED;
109}
110
111
112static void omap_mcbsp_tx_dma_callback(int lch, u16 ch_status, void *data)
113{
114 struct omap_mcbsp * mcbsp_dma_tx = (struct omap_mcbsp *)(data);
115
116 DBG("TX DMA callback : 0x%x\n", OMAP_MCBSP_READ(mcbsp_dma_tx->io_base, SPCR2));
117
118 /* We can free the channels */
119 omap_free_dma(mcbsp_dma_tx->dma_tx_lch);
120 mcbsp_dma_tx->dma_tx_lch = -1;
121
122 complete(&mcbsp_dma_tx->tx_dma_completion);
123}
124
125static void omap_mcbsp_rx_dma_callback(int lch, u16 ch_status, void *data)
126{
127 struct omap_mcbsp * mcbsp_dma_rx = (struct omap_mcbsp *)(data);
128
129 DBG("RX DMA callback : 0x%x\n", OMAP_MCBSP_READ(mcbsp_dma_rx->io_base, SPCR2));
130
131 /* We can free the channels */
132 omap_free_dma(mcbsp_dma_rx->dma_rx_lch);
133 mcbsp_dma_rx->dma_rx_lch = -1;
134
135 complete(&mcbsp_dma_rx->rx_dma_completion);
136}
137
138
139/*
140 * omap_mcbsp_config simply write a config to the
141 * appropriate McBSP.
142 * You either call this function or set the McBSP registers
143 * by yourself before calling omap_mcbsp_start().
144 */
145
146void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config)
147{
148 u32 io_base = mcbsp[id].io_base;
149
150 DBG("OMAP-McBSP: McBSP%d io_base: 0x%8x\n", id+1, io_base);
151
152 /* We write the given config */
153 OMAP_MCBSP_WRITE(io_base, SPCR2, config->spcr2);
154 OMAP_MCBSP_WRITE(io_base, SPCR1, config->spcr1);
155 OMAP_MCBSP_WRITE(io_base, RCR2, config->rcr2);
156 OMAP_MCBSP_WRITE(io_base, RCR1, config->rcr1);
157 OMAP_MCBSP_WRITE(io_base, XCR2, config->xcr2);
158 OMAP_MCBSP_WRITE(io_base, XCR1, config->xcr1);
159 OMAP_MCBSP_WRITE(io_base, SRGR2, config->srgr2);
160 OMAP_MCBSP_WRITE(io_base, SRGR1, config->srgr1);
161 OMAP_MCBSP_WRITE(io_base, MCR2, config->mcr2);
162 OMAP_MCBSP_WRITE(io_base, MCR1, config->mcr1);
163 OMAP_MCBSP_WRITE(io_base, PCR0, config->pcr0);
164}
165
166
167
168static int omap_mcbsp_check(unsigned int id)
169{
170 if (cpu_is_omap730()) {
171 if (id > OMAP_MAX_MCBSP_COUNT - 1) {
172 printk(KERN_ERR "OMAP-McBSP: McBSP%d doesn't exist\n", id + 1);
173 return -1;
174 }
175 return 0;
176 }
177
178 if (cpu_is_omap1510() || cpu_is_omap1610() || cpu_is_omap1710()) {
179 if (id > OMAP_MAX_MCBSP_COUNT) {
180 printk(KERN_ERR "OMAP-McBSP: McBSP%d doesn't exist\n", id + 1);
181 return -1;
182 }
183 return 0;
184 }
185
186 return -1;
187}
188
189#define EN_XORPCK 1
190#define DSP_RSTCT2 0xe1008014
191
192static void omap_mcbsp_dsp_request(void)
193{
194 if (cpu_is_omap1510() || cpu_is_omap1610() || cpu_is_omap1710()) {
195 omap_writew((omap_readw(ARM_RSTCT1) | (1 << 1) | (1 << 2)),
196 ARM_RSTCT1);
197 clk_enable(mcbsp_dsp_ck);
198 clk_enable(mcbsp_api_ck);
199
200 /* enable 12MHz clock to mcbsp 1 & 3 */
201 __raw_writew(__raw_readw(DSP_IDLECT2) | (1 << EN_XORPCK),
202 DSP_IDLECT2);
203 __raw_writew(__raw_readw(DSP_RSTCT2) | 1 | 1 << 1,
204 DSP_RSTCT2);
205 }
206}
207
208static void omap_mcbsp_dsp_free(void)
209{
210 /* Useless for now */
211}
212
213
214int omap_mcbsp_request(unsigned int id)
215{
216 int err;
217
218 if (omap_mcbsp_check(id) < 0)
219 return -EINVAL;
220
221 /*
222 * On 1510, 1610 and 1710, McBSP1 and McBSP3
223 * are DSP public peripherals.
224 */
225 if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3)
226 omap_mcbsp_dsp_request();
227
228 spin_lock(&mcbsp[id].lock);
229 if (!mcbsp[id].free) {
230 printk (KERN_ERR "OMAP-McBSP: McBSP%d is currently in use\n", id + 1);
231 spin_unlock(&mcbsp[id].lock);
232 return -1;
233 }
234
235 mcbsp[id].free = 0;
236 spin_unlock(&mcbsp[id].lock);
237
238 /* We need to get IRQs here */
239 err = request_irq(mcbsp[id].tx_irq, omap_mcbsp_tx_irq_handler, 0,
240 "McBSP",
241 (void *) (&mcbsp[id]));
242 if (err != 0) {
243 printk(KERN_ERR "OMAP-McBSP: Unable to request TX IRQ %d for McBSP%d\n",
244 mcbsp[id].tx_irq, mcbsp[id].id);
245 return err;
246 }
247
248 init_completion(&(mcbsp[id].tx_irq_completion));
249
250
251 err = request_irq(mcbsp[id].rx_irq, omap_mcbsp_rx_irq_handler, 0,
252 "McBSP",
253 (void *) (&mcbsp[id]));
254 if (err != 0) {
255 printk(KERN_ERR "OMAP-McBSP: Unable to request RX IRQ %d for McBSP%d\n",
256 mcbsp[id].rx_irq, mcbsp[id].id);
257 free_irq(mcbsp[id].tx_irq, (void *) (&mcbsp[id]));
258 return err;
259 }
260
261 init_completion(&(mcbsp[id].rx_irq_completion));
262 return 0;
263
264}
265
266void omap_mcbsp_free(unsigned int id)
267{
268 if (omap_mcbsp_check(id) < 0)
269 return;
270
271 if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3)
272 omap_mcbsp_dsp_free();
273
274 spin_lock(&mcbsp[id].lock);
275 if (mcbsp[id].free) {
276 printk (KERN_ERR "OMAP-McBSP: McBSP%d was not reserved\n", id + 1);
277 spin_unlock(&mcbsp[id].lock);
278 return;
279 }
280
281 mcbsp[id].free = 1;
282 spin_unlock(&mcbsp[id].lock);
283
284 /* Free IRQs */
285 free_irq(mcbsp[id].rx_irq, (void *) (&mcbsp[id]));
286 free_irq(mcbsp[id].tx_irq, (void *) (&mcbsp[id]));
287}
288
289/*
290 * Here we start the McBSP, by enabling the sample
291 * generator, both transmitter and receivers,
292 * and the frame sync.
293 */
294void omap_mcbsp_start(unsigned int id)
295{
296 u32 io_base;
297 u16 w;
298
299 if (omap_mcbsp_check(id) < 0)
300 return;
301
302 io_base = mcbsp[id].io_base;
303
304 mcbsp[id].rx_word_length = ((OMAP_MCBSP_READ(io_base, RCR1) >> 5) & 0x7);
305 mcbsp[id].tx_word_length = ((OMAP_MCBSP_READ(io_base, XCR1) >> 5) & 0x7);
306
307 /* Start the sample generator */
308 w = OMAP_MCBSP_READ(io_base, SPCR2);
309 OMAP_MCBSP_WRITE(io_base, SPCR2, w | (1 << 6));
310
311 /* Enable transmitter and receiver */
312 w = OMAP_MCBSP_READ(io_base, SPCR2);
313 OMAP_MCBSP_WRITE(io_base, SPCR2, w | 1);
314
315 w = OMAP_MCBSP_READ(io_base, SPCR1);
316 OMAP_MCBSP_WRITE(io_base, SPCR1, w | 1);
317
318 udelay(100);
319
320 /* Start frame sync */
321 w = OMAP_MCBSP_READ(io_base, SPCR2);
322 OMAP_MCBSP_WRITE(io_base, SPCR2, w | (1 << 7));
323
324 /* Dump McBSP Regs */
325 omap_mcbsp_dump_reg(id);
326
327}
328
329void omap_mcbsp_stop(unsigned int id)
330{
331 u32 io_base;
332 u16 w;
333
334 if (omap_mcbsp_check(id) < 0)
335 return;
336
337 io_base = mcbsp[id].io_base;
338
339 /* Reset transmitter */
340 w = OMAP_MCBSP_READ(io_base, SPCR2);
341 OMAP_MCBSP_WRITE(io_base, SPCR2, w & ~(1));
342
343 /* Reset receiver */
344 w = OMAP_MCBSP_READ(io_base, SPCR1);
345 OMAP_MCBSP_WRITE(io_base, SPCR1, w & ~(1));
346
347 /* Reset the sample rate generator */
348 w = OMAP_MCBSP_READ(io_base, SPCR2);
349 OMAP_MCBSP_WRITE(io_base, SPCR2, w & ~(1 << 6));
350}
351
352
353/*
354 * IRQ based word transmission.
355 */
356void omap_mcbsp_xmit_word(unsigned int id, u32 word)
357{
358 u32 io_base;
359 omap_mcbsp_word_length word_length = mcbsp[id].tx_word_length;
360
361 if (omap_mcbsp_check(id) < 0)
362 return;
363
364 io_base = mcbsp[id].io_base;
365
366 wait_for_completion(&(mcbsp[id].tx_irq_completion));
367
368 if (word_length > OMAP_MCBSP_WORD_16)
369 OMAP_MCBSP_WRITE(io_base, DXR2, word >> 16);
370 OMAP_MCBSP_WRITE(io_base, DXR1, word & 0xffff);
371}
372
373u32 omap_mcbsp_recv_word(unsigned int id)
374{
375 u32 io_base;
376 u16 word_lsb, word_msb = 0;
377 omap_mcbsp_word_length word_length = mcbsp[id].rx_word_length;
378
379 if (omap_mcbsp_check(id) < 0)
380 return -EINVAL;
381
382 io_base = mcbsp[id].io_base;
383
384 wait_for_completion(&(mcbsp[id].rx_irq_completion));
385
386 if (word_length > OMAP_MCBSP_WORD_16)
387 word_msb = OMAP_MCBSP_READ(io_base, DRR2);
388 word_lsb = OMAP_MCBSP_READ(io_base, DRR1);
389
390 return (word_lsb | (word_msb << 16));
391}
392
393
394/*
395 * Simple DMA based buffer rx/tx routines.
396 * Nothing fancy, just a single buffer tx/rx through DMA.
397 * The DMA resources are released once the transfer is done.
398 * For anything fancier, you should use your own customized DMA
399 * routines and callbacks.
400 */
401int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length)
402{
403 int dma_tx_ch;
404
405 if (omap_mcbsp_check(id) < 0)
406 return -EINVAL;
407
408 if (omap_request_dma(mcbsp[id].dma_tx_sync, "McBSP TX", omap_mcbsp_tx_dma_callback,
409 &mcbsp[id],
410 &dma_tx_ch)) {
411 printk("OMAP-McBSP: Unable to request DMA channel for McBSP%d TX. Trying IRQ based TX\n", id+1);
412 return -EAGAIN;
413 }
414 mcbsp[id].dma_tx_lch = dma_tx_ch;
415
416 DBG("TX DMA on channel %d\n", dma_tx_ch);
417
418 init_completion(&(mcbsp[id].tx_dma_completion));
419
420 omap_set_dma_transfer_params(mcbsp[id].dma_tx_lch,
421 OMAP_DMA_DATA_TYPE_S16,
422 length >> 1, 1,
423 OMAP_DMA_SYNC_ELEMENT);
424
425 omap_set_dma_dest_params(mcbsp[id].dma_tx_lch,
426 OMAP_DMA_PORT_TIPB,
427 OMAP_DMA_AMODE_CONSTANT,
428 mcbsp[id].io_base + OMAP_MCBSP_REG_DXR1);
429
430 omap_set_dma_src_params(mcbsp[id].dma_tx_lch,
431 OMAP_DMA_PORT_EMIFF,
432 OMAP_DMA_AMODE_POST_INC,
433 buffer);
434
435 omap_start_dma(mcbsp[id].dma_tx_lch);
436 wait_for_completion(&(mcbsp[id].tx_dma_completion));
437 return 0;
438}
439
440
441int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length)
442{
443 int dma_rx_ch;
444
445 if (omap_mcbsp_check(id) < 0)
446 return -EINVAL;
447
448 if (omap_request_dma(mcbsp[id].dma_rx_sync, "McBSP RX", omap_mcbsp_rx_dma_callback,
449 &mcbsp[id],
450 &dma_rx_ch)) {
451 printk("Unable to request DMA channel for McBSP%d RX. Trying IRQ based RX\n", id+1);
452 return -EAGAIN;
453 }
454 mcbsp[id].dma_rx_lch = dma_rx_ch;
455
456 DBG("RX DMA on channel %d\n", dma_rx_ch);
457
458 init_completion(&(mcbsp[id].rx_dma_completion));
459
460 omap_set_dma_transfer_params(mcbsp[id].dma_rx_lch,
461 OMAP_DMA_DATA_TYPE_S16,
462 length >> 1, 1,
463 OMAP_DMA_SYNC_ELEMENT);
464
465 omap_set_dma_src_params(mcbsp[id].dma_rx_lch,
466 OMAP_DMA_PORT_TIPB,
467 OMAP_DMA_AMODE_CONSTANT,
468 mcbsp[id].io_base + OMAP_MCBSP_REG_DRR1);
469
470 omap_set_dma_dest_params(mcbsp[id].dma_rx_lch,
471 OMAP_DMA_PORT_EMIFF,
472 OMAP_DMA_AMODE_POST_INC,
473 buffer);
474
475 omap_start_dma(mcbsp[id].dma_rx_lch);
476 wait_for_completion(&(mcbsp[id].rx_dma_completion));
477 return 0;
478}
479
480
481/*
482 * SPI wrapper.
483 * Since SPI setup is much simpler than the generic McBSP one,
484 * this wrapper just need an omap_mcbsp_spi_cfg structure as an input.
485 * Once this is done, you can call omap_mcbsp_start().
486 */
487void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg)
488{
489 struct omap_mcbsp_reg_cfg mcbsp_cfg;
490
491 if (omap_mcbsp_check(id) < 0)
492 return;
493
494 memset(&mcbsp_cfg, 0, sizeof(struct omap_mcbsp_reg_cfg));
495
496 /* SPI has only one frame */
497 mcbsp_cfg.rcr1 |= (RWDLEN1(spi_cfg->word_length) | RFRLEN1(0));
498 mcbsp_cfg.xcr1 |= (XWDLEN1(spi_cfg->word_length) | XFRLEN1(0));
499
500 /* Clock stop mode */
501 if (spi_cfg->clk_stp_mode == OMAP_MCBSP_CLK_STP_MODE_NO_DELAY)
502 mcbsp_cfg.spcr1 |= (1 << 12);
503 else
504 mcbsp_cfg.spcr1 |= (3 << 11);
505
506 /* Set clock parities */
507 if (spi_cfg->rx_clock_polarity == OMAP_MCBSP_CLK_RISING)
508 mcbsp_cfg.pcr0 |= CLKRP;
509 else
510 mcbsp_cfg.pcr0 &= ~CLKRP;
511
512 if (spi_cfg->tx_clock_polarity == OMAP_MCBSP_CLK_RISING)
513 mcbsp_cfg.pcr0 &= ~CLKXP;
514 else
515 mcbsp_cfg.pcr0 |= CLKXP;
516
517 /* Set SCLKME to 0 and CLKSM to 1 */
518 mcbsp_cfg.pcr0 &= ~SCLKME;
519 mcbsp_cfg.srgr2 |= CLKSM;
520
521 /* Set FSXP */
522 if (spi_cfg->fsx_polarity == OMAP_MCBSP_FS_ACTIVE_HIGH)
523 mcbsp_cfg.pcr0 &= ~FSXP;
524 else
525 mcbsp_cfg.pcr0 |= FSXP;
526
527 if (spi_cfg->spi_mode == OMAP_MCBSP_SPI_MASTER) {
528 mcbsp_cfg.pcr0 |= CLKXM;
529 mcbsp_cfg.srgr1 |= CLKGDV(spi_cfg->clk_div -1);
530 mcbsp_cfg.pcr0 |= FSXM;
531 mcbsp_cfg.srgr2 &= ~FSGM;
532 mcbsp_cfg.xcr2 |= XDATDLY(1);
533 mcbsp_cfg.rcr2 |= RDATDLY(1);
534 }
535 else {
536 mcbsp_cfg.pcr0 &= ~CLKXM;
537 mcbsp_cfg.srgr1 |= CLKGDV(1);
538 mcbsp_cfg.pcr0 &= ~FSXM;
539 mcbsp_cfg.xcr2 &= ~XDATDLY(3);
540 mcbsp_cfg.rcr2 &= ~RDATDLY(3);
541 }
542
543 mcbsp_cfg.xcr2 &= ~XPHASE;
544 mcbsp_cfg.rcr2 &= ~RPHASE;
545
546 omap_mcbsp_config(id, &mcbsp_cfg);
547}
548
549
550/*
551 * McBSP1 and McBSP3 are directly mapped on 1610 and 1510.
552 * 730 has only 2 McBSP, and both of them are MPU peripherals.
553 */
554struct omap_mcbsp_info {
555 u32 virt_base;
556 u8 dma_rx_sync, dma_tx_sync;
557 u16 rx_irq, tx_irq;
558};
559
560#ifdef CONFIG_ARCH_OMAP730
561static const struct omap_mcbsp_info mcbsp_730[] = {
562 [0] = { .virt_base = io_p2v(OMAP730_MCBSP1_BASE),
563 .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
564 .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
565 .rx_irq = INT_730_McBSP1RX,
566 .tx_irq = INT_730_McBSP1TX },
567 [1] = { .virt_base = io_p2v(OMAP730_MCBSP2_BASE),
568 .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
569 .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
570 .rx_irq = INT_730_McBSP2RX,
571 .tx_irq = INT_730_McBSP2TX },
572};
573#endif
574
575#ifdef CONFIG_ARCH_OMAP1510
576static const struct omap_mcbsp_info mcbsp_1510[] = {
577 [0] = { .virt_base = OMAP1510_MCBSP1_BASE,
578 .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
579 .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
580 .rx_irq = INT_McBSP1RX,
581 .tx_irq = INT_McBSP1TX },
582 [1] = { .virt_base = io_p2v(OMAP1510_MCBSP2_BASE),
583 .dma_rx_sync = OMAP_DMA_MCBSP2_RX,
584 .dma_tx_sync = OMAP_DMA_MCBSP2_TX,
585 .rx_irq = INT_1510_SPI_RX,
586 .tx_irq = INT_1510_SPI_TX },
587 [2] = { .virt_base = OMAP1510_MCBSP3_BASE,
588 .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
589 .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
590 .rx_irq = INT_McBSP3RX,
591 .tx_irq = INT_McBSP3TX },
592};
593#endif
594
595#if defined(CONFIG_ARCH_OMAP16XX)
596static const struct omap_mcbsp_info mcbsp_1610[] = {
597 [0] = { .virt_base = OMAP1610_MCBSP1_BASE,
598 .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
599 .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
600 .rx_irq = INT_McBSP1RX,
601 .tx_irq = INT_McBSP1TX },
602 [1] = { .virt_base = io_p2v(OMAP1610_MCBSP2_BASE),
603 .dma_rx_sync = OMAP_DMA_MCBSP2_RX,
604 .dma_tx_sync = OMAP_DMA_MCBSP2_TX,
605 .rx_irq = INT_1610_McBSP2_RX,
606 .tx_irq = INT_1610_McBSP2_TX },
607 [2] = { .virt_base = OMAP1610_MCBSP3_BASE,
608 .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
609 .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
610 .rx_irq = INT_McBSP3RX,
611 .tx_irq = INT_McBSP3TX },
612};
613#endif
614
615static int __init omap_mcbsp_init(void)
616{
617 int mcbsp_count = 0, i;
618 static const struct omap_mcbsp_info *mcbsp_info;
619
620 printk("Initializing OMAP McBSP system\n");
621
622 mcbsp_dsp_ck = clk_get(0, "dsp_ck");
623 if (IS_ERR(mcbsp_dsp_ck)) {
624 printk(KERN_ERR "mcbsp: could not acquire dsp_ck handle.\n");
625 return PTR_ERR(mcbsp_dsp_ck);
626 }
627 mcbsp_api_ck = clk_get(0, "api_ck");
628 if (IS_ERR(mcbsp_dsp_ck)) {
629 printk(KERN_ERR "mcbsp: could not acquire api_ck handle.\n");
630 return PTR_ERR(mcbsp_api_ck);
631 }
632
633#ifdef CONFIG_ARCH_OMAP730
634 if (cpu_is_omap730()) {
635 mcbsp_info = mcbsp_730;
636 mcbsp_count = ARRAY_SIZE(mcbsp_730);
637 }
638#endif
639#ifdef CONFIG_ARCH_OMAP1510
640 if (cpu_is_omap1510()) {
641 mcbsp_info = mcbsp_1510;
642 mcbsp_count = ARRAY_SIZE(mcbsp_1510);
643 }
644#endif
645#if defined(CONFIG_ARCH_OMAP16XX)
646 if (cpu_is_omap1610() || cpu_is_omap1710()) {
647 mcbsp_info = mcbsp_1610;
648 mcbsp_count = ARRAY_SIZE(mcbsp_1610);
649 }
650#endif
651 for (i = 0; i < OMAP_MAX_MCBSP_COUNT ; i++) {
652 if (i >= mcbsp_count) {
653 mcbsp[i].io_base = 0;
654 mcbsp[i].free = 0;
655 continue;
656 }
657 mcbsp[i].id = i + 1;
658 mcbsp[i].free = 1;
659 mcbsp[i].dma_tx_lch = -1;
660 mcbsp[i].dma_rx_lch = -1;
661
662 mcbsp[i].io_base = mcbsp_info[i].virt_base;
663 mcbsp[i].tx_irq = mcbsp_info[i].tx_irq;
664 mcbsp[i].rx_irq = mcbsp_info[i].rx_irq;
665 mcbsp[i].dma_rx_sync = mcbsp_info[i].dma_rx_sync;
666 mcbsp[i].dma_tx_sync = mcbsp_info[i].dma_tx_sync;
667 spin_lock_init(&mcbsp[i].lock);
668 }
669
670 return 0;
671}
672
673
674arch_initcall(omap_mcbsp_init);
675
676EXPORT_SYMBOL(omap_mcbsp_config);
677EXPORT_SYMBOL(omap_mcbsp_request);
678EXPORT_SYMBOL(omap_mcbsp_free);
679EXPORT_SYMBOL(omap_mcbsp_start);
680EXPORT_SYMBOL(omap_mcbsp_stop);
681EXPORT_SYMBOL(omap_mcbsp_xmit_word);
682EXPORT_SYMBOL(omap_mcbsp_recv_word);
683EXPORT_SYMBOL(omap_mcbsp_xmit_buffer);
684EXPORT_SYMBOL(omap_mcbsp_recv_buffer);
685EXPORT_SYMBOL(omap_mcbsp_set_spi_mode);
diff --git a/arch/arm/mach-omap/mux.c b/arch/arm/mach-omap/mux.c
new file mode 100644
index 000000000000..bcf3c6e5ecd0
--- /dev/null
+++ b/arch/arm/mach-omap/mux.c
@@ -0,0 +1,163 @@
1/*
2 * linux/arch/arm/mach-omap/mux.c
3 *
4 * Utility to set the Omap MUX and PULL_DWN registers from a table in mux.h
5 *
6 * Copyright (C) 2003 Nokia Corporation
7 *
8 * Written by Tony Lindgren <tony.lindgren@nokia.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25#include <linux/config.h>
26#include <linux/module.h>
27#include <linux/init.h>
28#include <asm/system.h>
29#include <asm/io.h>
30#include <linux/spinlock.h>
31
32#define __MUX_C__
33#include <asm/arch/mux.h>
34
35#ifdef CONFIG_OMAP_MUX
36
37/*
38 * Sets the Omap MUX and PULL_DWN registers based on the table
39 */
40int __init_or_module
41omap_cfg_reg(const reg_cfg_t reg_cfg)
42{
43 static DEFINE_SPINLOCK(mux_spin_lock);
44
45 unsigned long flags;
46 reg_cfg_set *cfg;
47 unsigned int reg_orig = 0, reg = 0, pu_pd_orig = 0, pu_pd = 0,
48 pull_orig = 0, pull = 0;
49 unsigned int mask, warn = 0;
50
51 if (reg_cfg > ARRAY_SIZE(reg_cfg_table)) {
52 printk(KERN_ERR "MUX: reg_cfg %d\n", reg_cfg);
53 return -EINVAL;
54 }
55
56 cfg = &reg_cfg_table[reg_cfg];
57
58 /*
59 * We do a pretty long section here with lock on, but pin muxing
60 * should only happen on driver init for each driver, so it's not time
61 * critical.
62 */
63 spin_lock_irqsave(&mux_spin_lock, flags);
64
65 /* Check the mux register in question */
66 if (cfg->mux_reg) {
67 unsigned tmp1, tmp2;
68
69 reg_orig = omap_readl(cfg->mux_reg);
70
71 /* The mux registers always seem to be 3 bits long */
72 mask = (0x7 << cfg->mask_offset);
73 tmp1 = reg_orig & mask;
74 reg = reg_orig & ~mask;
75
76 tmp2 = (cfg->mask << cfg->mask_offset);
77 reg |= tmp2;
78
79 if (tmp1 != tmp2)
80 warn = 1;
81
82 omap_writel(reg, cfg->mux_reg);
83 }
84
85 /* Check for pull up or pull down selection on 1610 */
86 if (!cpu_is_omap1510()) {
87 if (cfg->pu_pd_reg && cfg->pull_val) {
88 pu_pd_orig = omap_readl(cfg->pu_pd_reg);
89 mask = 1 << cfg->pull_bit;
90
91 if (cfg->pu_pd_val) {
92 if (!(pu_pd_orig & mask))
93 warn = 1;
94 /* Use pull up */
95 pu_pd = pu_pd_orig | mask;
96 } else {
97 if (pu_pd_orig & mask)
98 warn = 1;
99 /* Use pull down */
100 pu_pd = pu_pd_orig & ~mask;
101 }
102 omap_writel(pu_pd, cfg->pu_pd_reg);
103 }
104 }
105
106 /* Check for an associated pull down register */
107 if (cfg->pull_reg) {
108 pull_orig = omap_readl(cfg->pull_reg);
109 mask = 1 << cfg->pull_bit;
110
111 if (cfg->pull_val) {
112 if (pull_orig & mask)
113 warn = 1;
114 /* Low bit = pull enabled */
115 pull = pull_orig & ~mask;
116 } else {
117 if (!(pull_orig & mask))
118 warn = 1;
119 /* High bit = pull disabled */
120 pull = pull_orig | mask;
121 }
122
123 omap_writel(pull, cfg->pull_reg);
124 }
125
126 if (warn) {
127#ifdef CONFIG_OMAP_MUX_WARNINGS
128 printk(KERN_WARNING "MUX: initialized %s\n", cfg->name);
129#endif
130 }
131
132#ifdef CONFIG_OMAP_MUX_DEBUG
133 if (cfg->debug || warn) {
134 printk("MUX: Setting register %s\n", cfg->name);
135 printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n",
136 cfg->mux_reg_name, cfg->mux_reg, reg_orig, reg);
137
138 if (!cpu_is_omap1510()) {
139 if (cfg->pu_pd_reg && cfg->pull_val) {
140 printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n",
141 cfg->pu_pd_name, cfg->pu_pd_reg,
142 pu_pd_orig, pu_pd);
143 }
144 }
145
146 if (cfg->pull_reg)
147 printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n",
148 cfg->pull_name, cfg->pull_reg, pull_orig, pull);
149 }
150#endif
151
152 spin_unlock_irqrestore(&mux_spin_lock, flags);
153
154#ifdef CONFIG_OMAP_MUX_ERRORS
155 return warn ? -ETXTBSY : 0;
156#else
157 return 0;
158#endif
159}
160
161EXPORT_SYMBOL(omap_cfg_reg);
162
163#endif /* CONFIG_OMAP_MUX */
diff --git a/arch/arm/mach-omap/ocpi.c b/arch/arm/mach-omap/ocpi.c
new file mode 100644
index 000000000000..c9ced134a75d
--- /dev/null
+++ b/arch/arm/mach-omap/ocpi.c
@@ -0,0 +1,114 @@
1/*
2 * linux/arch/arm/mach-omap/ocpi.c
3 *
4 * Minimal OCP bus support for omap16xx
5 *
6 * Copyright (C) 2003 - 2005 Nokia Corporation
7 * Written by Tony Lindgren <tony@atomide.com>
8 *
9 * Modified for clock framework by Paul Mundt <paul.mundt@nokia.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#include <linux/config.h>
27#include <linux/module.h>
28#include <linux/version.h>
29#include <linux/types.h>
30#include <linux/errno.h>
31#include <linux/kernel.h>
32#include <linux/init.h>
33#include <linux/spinlock.h>
34#include <linux/err.h>
35
36#include <asm/io.h>
37#include <asm/hardware/clock.h>
38#include <asm/arch/hardware.h>
39
40#define OCPI_BASE 0xfffec320
41#define OCPI_FAULT (OCPI_BASE + 0x00)
42#define OCPI_CMD_FAULT (OCPI_BASE + 0x04)
43#define OCPI_SINT0 (OCPI_BASE + 0x08)
44#define OCPI_TABORT (OCPI_BASE + 0x0c)
45#define OCPI_SINT1 (OCPI_BASE + 0x10)
46#define OCPI_PROT (OCPI_BASE + 0x14)
47#define OCPI_SEC (OCPI_BASE + 0x18)
48
49/* USB OHCI OCPI access error registers */
50#define HOSTUEADDR 0xfffba0e0
51#define HOSTUESTATUS 0xfffba0e4
52
53static struct clk *ocpi_ck;
54
55/*
56 * Enables device access to OMAP buses via the OCPI bridge
57 * FIXME: Add locking
58 */
59int ocpi_enable(void)
60{
61 unsigned int val;
62
63 if (!cpu_is_omap16xx())
64 return -ENODEV;
65
66 /* Make sure there's clock for OCPI */
67 clk_enable(ocpi_ck);
68
69 /* Enable access for OHCI in OCPI */
70 val = omap_readl(OCPI_PROT);
71 val &= ~0xff;
72 //val &= (1 << 0); /* Allow access only to EMIFS */
73 omap_writel(val, OCPI_PROT);
74
75 val = omap_readl(OCPI_SEC);
76 val &= ~0xff;
77 omap_writel(val, OCPI_SEC);
78
79 return 0;
80}
81EXPORT_SYMBOL(ocpi_enable);
82
83static int __init omap_ocpi_init(void)
84{
85 if (!cpu_is_omap16xx())
86 return -ENODEV;
87
88 ocpi_ck = clk_get(NULL, "l3_ocpi_ck");
89 if (IS_ERR(ocpi_ck))
90 return PTR_ERR(ocpi_ck);
91
92 clk_use(ocpi_ck);
93 ocpi_enable();
94 printk("OMAP OCPI interconnect driver loaded\n");
95
96 return 0;
97}
98
99static void __exit omap_ocpi_exit(void)
100{
101 /* REVISIT: Disable OCPI */
102
103 if (!cpu_is_omap16xx())
104 return;
105
106 clk_unuse(ocpi_ck);
107 clk_put(ocpi_ck);
108}
109
110MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
111MODULE_DESCRIPTION("OMAP OCPI bus controller module");
112MODULE_LICENSE("GPL");
113module_init(omap_ocpi_init);
114module_exit(omap_ocpi_exit);
diff --git a/arch/arm/mach-omap/pm.c b/arch/arm/mach-omap/pm.c
new file mode 100644
index 000000000000..00fac155df2a
--- /dev/null
+++ b/arch/arm/mach-omap/pm.c
@@ -0,0 +1,628 @@
1/*
2 * linux/arch/arm/mach-omap/pm.c
3 *
4 * OMAP Power Management Routines
5 *
6 * Original code for the SA11x0:
7 * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com>
8 *
9 * Modified for the PXA250 by Nicolas Pitre:
10 * Copyright (c) 2002 Monta Vista Software, Inc.
11 *
12 * Modified for the OMAP1510 by David Singleton:
13 * Copyright (c) 2002 Monta Vista Software, Inc.
14 *
15 * Cleanup 2004 for OMAP1510/1610 by Dirk Behme <dirk.behme@de.bosch.com>
16 *
17 * This program is free software; you can redistribute it and/or modify it
18 * under the terms of the GNU General Public License as published by the
19 * Free Software Foundation; either version 2 of the License, or (at your
20 * option) any later version.
21 *
22 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
25 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
28 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
29 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * You should have received a copy of the GNU General Public License along
34 * with this program; if not, write to the Free Software Foundation, Inc.,
35 * 675 Mass Ave, Cambridge, MA 02139, USA.
36 */
37
38#include <linux/pm.h>
39#include <linux/sched.h>
40#include <linux/proc_fs.h>
41#include <linux/pm.h>
42
43#include <asm/io.h>
44#include <asm/mach-types.h>
45#include <asm/arch/omap16xx.h>
46#include <asm/arch/pm.h>
47#include <asm/arch/mux.h>
48#include <asm/arch/tc.h>
49#include <asm/arch/tps65010.h>
50
51#include "clock.h"
52
53static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
54static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE];
55static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE];
56static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE];
57
58/*
59 * Let's power down on idle, but only if we are really
60 * idle, because once we start down the path of
61 * going idle we continue to do idle even if we get
62 * a clock tick interrupt . .
63 */
64void omap_pm_idle(void)
65{
66 int (*func_ptr)(void) = 0;
67 unsigned int mask32 = 0;
68
69 /*
70 * If the DSP is being used let's just idle the CPU, the overhead
71 * to wake up from Big Sleep is big, milliseconds versus micro
72 * seconds for wait for interrupt.
73 */
74
75 local_irq_disable();
76 local_fiq_disable();
77 if (need_resched()) {
78 local_fiq_enable();
79 local_irq_enable();
80 return;
81 }
82 mask32 = omap_readl(ARM_SYSST);
83 local_fiq_enable();
84 local_irq_enable();
85
86#if defined(CONFIG_OMAP_32K_TIMER) && defined(CONFIG_NO_IDLE_HZ)
87 /* Override timer to use VST for the next cycle */
88 omap_32k_timer_next_vst_interrupt();
89#endif
90
91 if ((mask32 & DSP_IDLE) == 0) {
92 __asm__ volatile ("mcr p15, 0, r0, c7, c0, 4");
93 } else {
94
95 if (cpu_is_omap1510()) {
96 func_ptr = (void *)(OMAP1510_SRAM_IDLE_SUSPEND);
97 } else if (cpu_is_omap1610() || cpu_is_omap1710()) {
98 func_ptr = (void *)(OMAP1610_SRAM_IDLE_SUSPEND);
99 } else if (cpu_is_omap5912()) {
100 func_ptr = (void *)(OMAP5912_SRAM_IDLE_SUSPEND);
101 }
102
103 func_ptr();
104 }
105}
106
107/*
108 * Configuration of the wakeup event is board specific. For the
109 * moment we put it into this helper function. Later it may move
110 * to board specific files.
111 */
112static void omap_pm_wakeup_setup(void)
113{
114 /*
115 * Enable ARM XOR clock and release peripheral from reset by
116 * writing 1 to PER_EN bit in ARM_RSTCT2, this is required
117 * for UART configuration to use UART2 to wake up.
118 */
119
120 omap_writel(omap_readl(ARM_IDLECT2) | ENABLE_XORCLK, ARM_IDLECT2);
121 omap_writel(omap_readl(ARM_RSTCT2) | PER_EN, ARM_RSTCT2);
122 omap_writew(MODEM_32K_EN, ULPD_CLOCK_CTRL);
123
124 /*
125 * Turn off all interrupts except L1-2nd level cascade,
126 * and the L2 wakeup interrupts: keypad and UART2.
127 */
128
129 omap_writel(~IRQ_LEVEL2, OMAP_IH1_MIR);
130
131 if (cpu_is_omap1510()) {
132 omap_writel(~(IRQ_UART2 | IRQ_KEYBOARD), OMAP_IH2_MIR);
133 }
134
135 if (cpu_is_omap16xx()) {
136 omap_writel(~(IRQ_UART2 | IRQ_KEYBOARD), OMAP_IH2_0_MIR);
137
138 omap_writel(~0x0, OMAP_IH2_1_MIR);
139 omap_writel(~0x0, OMAP_IH2_2_MIR);
140 omap_writel(~0x0, OMAP_IH2_3_MIR);
141 }
142
143 /* New IRQ agreement */
144 omap_writel(1, OMAP_IH1_CONTROL);
145
146 /* external PULL to down, bit 22 = 0 */
147 omap_writel(omap_readl(PULL_DWN_CTRL_2) & ~(1<<22), PULL_DWN_CTRL_2);
148}
149
150void omap_pm_suspend(void)
151{
152 unsigned int mask32 = 0;
153 unsigned long arg0 = 0, arg1 = 0;
154 int (*func_ptr)(unsigned short, unsigned short) = 0;
155 unsigned short save_dsp_idlect2;
156
157 printk("PM: OMAP%x is entering deep sleep now ...\n", system_rev);
158
159 if (machine_is_omap_osk()) {
160 /* Stop LED1 (D9) blink */
161 tps65010_set_led(LED1, OFF);
162 }
163
164 /*
165 * Step 1: turn off interrupts
166 */
167
168 local_irq_disable();
169 local_fiq_disable();
170
171 /*
172 * Step 2: save registers
173 *
174 * The omap is a strange/beautiful device. The caches, memory
175 * and register state are preserved across power saves.
176 * We have to save and restore very little register state to
177 * idle the omap.
178 *
179 * Save interrupt, MPUI, ARM and UPLD control registers.
180 */
181
182 if (cpu_is_omap1510()) {
183 MPUI1510_SAVE(OMAP_IH1_MIR);
184 MPUI1510_SAVE(OMAP_IH2_MIR);
185 MPUI1510_SAVE(MPUI_CTRL);
186 MPUI1510_SAVE(MPUI_DSP_BOOT_CONFIG);
187 MPUI1510_SAVE(MPUI_DSP_API_CONFIG);
188 MPUI1510_SAVE(EMIFS_CONFIG);
189 MPUI1510_SAVE(EMIFF_SDRAM_CONFIG);
190 } else if (cpu_is_omap16xx()) {
191 MPUI1610_SAVE(OMAP_IH1_MIR);
192 MPUI1610_SAVE(OMAP_IH2_0_MIR);
193 MPUI1610_SAVE(OMAP_IH2_1_MIR);
194 MPUI1610_SAVE(OMAP_IH2_2_MIR);
195 MPUI1610_SAVE(OMAP_IH2_3_MIR);
196 MPUI1610_SAVE(MPUI_CTRL);
197 MPUI1610_SAVE(MPUI_DSP_BOOT_CONFIG);
198 MPUI1610_SAVE(MPUI_DSP_API_CONFIG);
199 MPUI1610_SAVE(EMIFS_CONFIG);
200 MPUI1610_SAVE(EMIFF_SDRAM_CONFIG);
201 }
202
203 ARM_SAVE(ARM_CKCTL);
204 ARM_SAVE(ARM_IDLECT1);
205 ARM_SAVE(ARM_IDLECT2);
206 ARM_SAVE(ARM_EWUPCT);
207 ARM_SAVE(ARM_RSTCT1);
208 ARM_SAVE(ARM_RSTCT2);
209 ARM_SAVE(ARM_SYSST);
210 ULPD_SAVE(ULPD_CLOCK_CTRL);
211 ULPD_SAVE(ULPD_STATUS_REQ);
212
213 /*
214 * Step 3: LOW_PWR signal enabling
215 *
216 * Allow the LOW_PWR signal to be visible on MPUIO5 ball.
217 */
218 if (cpu_is_omap1510()) {
219 /* POWER_CTRL_REG = 0x1 (LOW_POWER is available) */
220 omap_writew(omap_readw(ULPD_POWER_CTRL) |
221 OMAP1510_ULPD_LOW_POWER_REQ, ULPD_POWER_CTRL);
222 } else if (cpu_is_omap16xx()) {
223 /* POWER_CTRL_REG = 0x1 (LOW_POWER is available) */
224 omap_writew(omap_readw(ULPD_POWER_CTRL) |
225 OMAP1610_ULPD_LOW_POWER_REQ, ULPD_POWER_CTRL);
226 }
227
228 /* configure LOW_PWR pin */
229 omap_cfg_reg(T20_1610_LOW_PWR);
230
231 /*
232 * Step 4: OMAP DSP Shutdown
233 */
234
235 /* Set DSP_RST = 1 and DSP_EN = 0, put DSP block into reset */
236 omap_writel((omap_readl(ARM_RSTCT1) | DSP_RST) & ~DSP_ENABLE,
237 ARM_RSTCT1);
238
239 /* Set DSP boot mode to DSP-IDLE, DSP_BOOT_MODE = 0x2 */
240 omap_writel(DSP_IDLE_MODE, MPUI_DSP_BOOT_CONFIG);
241
242 /* Set EN_DSPCK = 0, stop DSP block clock */
243 omap_writel(omap_readl(ARM_CKCTL) & ~DSP_CLOCK_ENABLE, ARM_CKCTL);
244
245 /* Stop any DSP domain clocks */
246 omap_writel(omap_readl(ARM_IDLECT2) | (1<<EN_APICK), ARM_IDLECT2);
247 save_dsp_idlect2 = __raw_readw(DSP_IDLECT2);
248 __raw_writew(0, DSP_IDLECT2);
249
250 /*
251 * Step 5: Wakeup Event Setup
252 */
253
254 omap_pm_wakeup_setup();
255
256 /*
257 * Step 6a: ARM and Traffic controller shutdown
258 *
259 * Step 6 starts here with clock and watchdog disable
260 */
261
262 /* stop clocks */
263 mask32 = omap_readl(ARM_IDLECT2);
264 mask32 &= ~(1<<EN_WDTCK); /* bit 0 -> 0 (WDT clock) */
265 mask32 |= (1<<EN_XORPCK); /* bit 1 -> 1 (XORPCK clock) */
266 mask32 &= ~(1<<EN_PERCK); /* bit 2 -> 0 (MPUPER_CK clock) */
267 mask32 &= ~(1<<EN_LCDCK); /* bit 3 -> 0 (LCDC clock) */
268 mask32 &= ~(1<<EN_LBCK); /* bit 4 -> 0 (local bus clock) */
269 mask32 |= (1<<EN_APICK); /* bit 6 -> 1 (MPUI clock) */
270 mask32 &= ~(1<<EN_TIMCK); /* bit 7 -> 0 (MPU timer clock) */
271 mask32 &= ~(1<<DMACK_REQ); /* bit 8 -> 0 (DMAC clock) */
272 mask32 &= ~(1<<EN_GPIOCK); /* bit 9 -> 0 (GPIO clock) */
273 omap_writel(mask32, ARM_IDLECT2);
274
275 /* disable ARM watchdog */
276 omap_writel(0x00F5, OMAP_WDT_TIMER_MODE);
277 omap_writel(0x00A0, OMAP_WDT_TIMER_MODE);
278
279 /*
280 * Step 6b: ARM and Traffic controller shutdown
281 *
282 * Step 6 continues here. Prepare jump to power management
283 * assembly code in internal SRAM.
284 *
285 * Since the omap_cpu_suspend routine has been copied to
286 * SRAM, we'll do an indirect procedure call to it and pass the
287 * contents of arm_idlect1 and arm_idlect2 so it can restore
288 * them when it wakes up and it will return.
289 */
290
291 arg0 = arm_sleep_save[ARM_SLEEP_SAVE_ARM_IDLECT1];
292 arg1 = arm_sleep_save[ARM_SLEEP_SAVE_ARM_IDLECT2];
293
294 if (cpu_is_omap1510()) {
295 func_ptr = (void *)(OMAP1510_SRAM_API_SUSPEND);
296 } else if (cpu_is_omap1610() || cpu_is_omap1710()) {
297 func_ptr = (void *)(OMAP1610_SRAM_API_SUSPEND);
298 } else if (cpu_is_omap5912()) {
299 func_ptr = (void *)(OMAP5912_SRAM_API_SUSPEND);
300 }
301
302 /*
303 * Step 6c: ARM and Traffic controller shutdown
304 *
305 * Jump to assembly code. The processor will stay there
306 * until wake up.
307 */
308
309 func_ptr(arg0, arg1);
310
311 /*
312 * If we are here, processor is woken up!
313 */
314
315 if (cpu_is_omap1510()) {
316 /* POWER_CTRL_REG = 0x0 (LOW_POWER is disabled) */
317 omap_writew(omap_readw(ULPD_POWER_CTRL) &
318 ~OMAP1510_ULPD_LOW_POWER_REQ, ULPD_POWER_CTRL);
319 } else if (cpu_is_omap16xx()) {
320 /* POWER_CTRL_REG = 0x0 (LOW_POWER is disabled) */
321 omap_writew(omap_readw(ULPD_POWER_CTRL) &
322 ~OMAP1610_ULPD_LOW_POWER_REQ, ULPD_POWER_CTRL);
323 }
324
325
326 /* Restore DSP clocks */
327 omap_writel(omap_readl(ARM_IDLECT2) | (1<<EN_APICK), ARM_IDLECT2);
328 __raw_writew(save_dsp_idlect2, DSP_IDLECT2);
329 ARM_RESTORE(ARM_IDLECT2);
330
331 /*
332 * Restore ARM state, except ARM_IDLECT1/2 which omap_cpu_suspend did
333 */
334
335 ARM_RESTORE(ARM_CKCTL);
336 ARM_RESTORE(ARM_EWUPCT);
337 ARM_RESTORE(ARM_RSTCT1);
338 ARM_RESTORE(ARM_RSTCT2);
339 ARM_RESTORE(ARM_SYSST);
340 ULPD_RESTORE(ULPD_CLOCK_CTRL);
341 ULPD_RESTORE(ULPD_STATUS_REQ);
342
343 if (cpu_is_omap1510()) {
344 MPUI1510_RESTORE(MPUI_CTRL);
345 MPUI1510_RESTORE(MPUI_DSP_BOOT_CONFIG);
346 MPUI1510_RESTORE(MPUI_DSP_API_CONFIG);
347 MPUI1510_RESTORE(EMIFS_CONFIG);
348 MPUI1510_RESTORE(EMIFF_SDRAM_CONFIG);
349 MPUI1510_RESTORE(OMAP_IH1_MIR);
350 MPUI1510_RESTORE(OMAP_IH2_MIR);
351 } else if (cpu_is_omap16xx()) {
352 MPUI1610_RESTORE(MPUI_CTRL);
353 MPUI1610_RESTORE(MPUI_DSP_BOOT_CONFIG);
354 MPUI1610_RESTORE(MPUI_DSP_API_CONFIG);
355 MPUI1610_RESTORE(EMIFS_CONFIG);
356 MPUI1610_RESTORE(EMIFF_SDRAM_CONFIG);
357
358 MPUI1610_RESTORE(OMAP_IH1_MIR);
359 MPUI1610_RESTORE(OMAP_IH2_0_MIR);
360 MPUI1610_RESTORE(OMAP_IH2_1_MIR);
361 MPUI1610_RESTORE(OMAP_IH2_2_MIR);
362 MPUI1610_RESTORE(OMAP_IH2_3_MIR);
363 }
364
365 /*
366 * Reenable interrupts
367 */
368
369 local_irq_enable();
370 local_fiq_enable();
371
372 printk("PM: OMAP%x is re-starting from deep sleep...\n", system_rev);
373
374 if (machine_is_omap_osk()) {
375 /* Let LED1 (D9) blink again */
376 tps65010_set_led(LED1, BLINK);
377 }
378}
379
380#if defined(DEBUG) && defined(CONFIG_PROC_FS)
381static int g_read_completed;
382
383/*
384 * Read system PM registers for debugging
385 */
386static int omap_pm_read_proc(
387 char *page_buffer,
388 char **my_first_byte,
389 off_t virtual_start,
390 int length,
391 int *eof,
392 void *data)
393{
394 int my_buffer_offset = 0;
395 char * const my_base = page_buffer;
396
397 ARM_SAVE(ARM_CKCTL);
398 ARM_SAVE(ARM_IDLECT1);
399 ARM_SAVE(ARM_IDLECT2);
400 ARM_SAVE(ARM_EWUPCT);
401 ARM_SAVE(ARM_RSTCT1);
402 ARM_SAVE(ARM_RSTCT2);
403 ARM_SAVE(ARM_SYSST);
404
405 ULPD_SAVE(ULPD_IT_STATUS);
406 ULPD_SAVE(ULPD_CLOCK_CTRL);
407 ULPD_SAVE(ULPD_SOFT_REQ);
408 ULPD_SAVE(ULPD_STATUS_REQ);
409 ULPD_SAVE(ULPD_DPLL_CTRL);
410 ULPD_SAVE(ULPD_POWER_CTRL);
411
412 if (cpu_is_omap1510()) {
413 MPUI1510_SAVE(MPUI_CTRL);
414 MPUI1510_SAVE(MPUI_DSP_STATUS);
415 MPUI1510_SAVE(MPUI_DSP_BOOT_CONFIG);
416 MPUI1510_SAVE(MPUI_DSP_API_CONFIG);
417 MPUI1510_SAVE(EMIFF_SDRAM_CONFIG);
418 MPUI1510_SAVE(EMIFS_CONFIG);
419 } else if (cpu_is_omap16xx()) {
420 MPUI1610_SAVE(MPUI_CTRL);
421 MPUI1610_SAVE(MPUI_DSP_STATUS);
422 MPUI1610_SAVE(MPUI_DSP_BOOT_CONFIG);
423 MPUI1610_SAVE(MPUI_DSP_API_CONFIG);
424 MPUI1610_SAVE(EMIFF_SDRAM_CONFIG);
425 MPUI1610_SAVE(EMIFS_CONFIG);
426 }
427
428 if (virtual_start == 0) {
429 g_read_completed = 0;
430
431 my_buffer_offset += sprintf(my_base + my_buffer_offset,
432 "ARM_CKCTL_REG: 0x%-8x \n"
433 "ARM_IDLECT1_REG: 0x%-8x \n"
434 "ARM_IDLECT2_REG: 0x%-8x \n"
435 "ARM_EWUPCT_REG: 0x%-8x \n"
436 "ARM_RSTCT1_REG: 0x%-8x \n"
437 "ARM_RSTCT2_REG: 0x%-8x \n"
438 "ARM_SYSST_REG: 0x%-8x \n"
439 "ULPD_IT_STATUS_REG: 0x%-4x \n"
440 "ULPD_CLOCK_CTRL_REG: 0x%-4x \n"
441 "ULPD_SOFT_REQ_REG: 0x%-4x \n"
442 "ULPD_DPLL_CTRL_REG: 0x%-4x \n"
443 "ULPD_STATUS_REQ_REG: 0x%-4x \n"
444 "ULPD_POWER_CTRL_REG: 0x%-4x \n",
445 ARM_SHOW(ARM_CKCTL),
446 ARM_SHOW(ARM_IDLECT1),
447 ARM_SHOW(ARM_IDLECT2),
448 ARM_SHOW(ARM_EWUPCT),
449 ARM_SHOW(ARM_RSTCT1),
450 ARM_SHOW(ARM_RSTCT2),
451 ARM_SHOW(ARM_SYSST),
452 ULPD_SHOW(ULPD_IT_STATUS),
453 ULPD_SHOW(ULPD_CLOCK_CTRL),
454 ULPD_SHOW(ULPD_SOFT_REQ),
455 ULPD_SHOW(ULPD_DPLL_CTRL),
456 ULPD_SHOW(ULPD_STATUS_REQ),
457 ULPD_SHOW(ULPD_POWER_CTRL));
458
459 if (cpu_is_omap1510()) {
460 my_buffer_offset += sprintf(my_base + my_buffer_offset,
461 "MPUI1510_CTRL_REG 0x%-8x \n"
462 "MPUI1510_DSP_STATUS_REG: 0x%-8x \n"
463 "MPUI1510_DSP_BOOT_CONFIG_REG: 0x%-8x \n"
464 "MPUI1510_DSP_API_CONFIG_REG: 0x%-8x \n"
465 "MPUI1510_SDRAM_CONFIG_REG: 0x%-8x \n"
466 "MPUI1510_EMIFS_CONFIG_REG: 0x%-8x \n",
467 MPUI1510_SHOW(MPUI_CTRL),
468 MPUI1510_SHOW(MPUI_DSP_STATUS),
469 MPUI1510_SHOW(MPUI_DSP_BOOT_CONFIG),
470 MPUI1510_SHOW(MPUI_DSP_API_CONFIG),
471 MPUI1510_SHOW(EMIFF_SDRAM_CONFIG),
472 MPUI1510_SHOW(EMIFS_CONFIG));
473 } else if (cpu_is_omap16xx()) {
474 my_buffer_offset += sprintf(my_base + my_buffer_offset,
475 "MPUI1610_CTRL_REG 0x%-8x \n"
476 "MPUI1610_DSP_STATUS_REG: 0x%-8x \n"
477 "MPUI1610_DSP_BOOT_CONFIG_REG: 0x%-8x \n"
478 "MPUI1610_DSP_API_CONFIG_REG: 0x%-8x \n"
479 "MPUI1610_SDRAM_CONFIG_REG: 0x%-8x \n"
480 "MPUI1610_EMIFS_CONFIG_REG: 0x%-8x \n",
481 MPUI1610_SHOW(MPUI_CTRL),
482 MPUI1610_SHOW(MPUI_DSP_STATUS),
483 MPUI1610_SHOW(MPUI_DSP_BOOT_CONFIG),
484 MPUI1610_SHOW(MPUI_DSP_API_CONFIG),
485 MPUI1610_SHOW(EMIFF_SDRAM_CONFIG),
486 MPUI1610_SHOW(EMIFS_CONFIG));
487 }
488
489 g_read_completed++;
490 } else if (g_read_completed >= 1) {
491 *eof = 1;
492 return 0;
493 }
494 g_read_completed++;
495
496 *my_first_byte = page_buffer;
497 return my_buffer_offset;
498}
499
500static void omap_pm_init_proc(void)
501{
502 struct proc_dir_entry *entry;
503
504 entry = create_proc_read_entry("driver/omap_pm",
505 S_IWUSR | S_IRUGO, NULL,
506 omap_pm_read_proc, 0);
507}
508
509#endif /* DEBUG && CONFIG_PROC_FS */
510
511/*
512 * omap_pm_prepare - Do preliminary suspend work.
513 * @state: suspend state we're entering.
514 *
515 */
516//#include <asm/arch/hardware.h>
517
518static int omap_pm_prepare(suspend_state_t state)
519{
520 int error = 0;
521
522 switch (state)
523 {
524 case PM_SUSPEND_STANDBY:
525 case PM_SUSPEND_MEM:
526 break;
527
528 case PM_SUSPEND_DISK:
529 return -ENOTSUPP;
530
531 default:
532 return -EINVAL;
533 }
534
535 return error;
536}
537
538
539/*
540 * omap_pm_enter - Actually enter a sleep state.
541 * @state: State we're entering.
542 *
543 */
544
545static int omap_pm_enter(suspend_state_t state)
546{
547 switch (state)
548 {
549 case PM_SUSPEND_STANDBY:
550 case PM_SUSPEND_MEM:
551 omap_pm_suspend();
552 break;
553
554 case PM_SUSPEND_DISK:
555 return -ENOTSUPP;
556
557 default:
558 return -EINVAL;
559 }
560
561 return 0;
562}
563
564
565/**
566 * omap_pm_finish - Finish up suspend sequence.
567 * @state: State we're coming out of.
568 *
569 * This is called after we wake back up (or if entering the sleep state
570 * failed).
571 */
572
573static int omap_pm_finish(suspend_state_t state)
574{
575 return 0;
576}
577
578
579struct pm_ops omap_pm_ops ={
580 .pm_disk_mode = 0,
581 .prepare = omap_pm_prepare,
582 .enter = omap_pm_enter,
583 .finish = omap_pm_finish,
584};
585
586static int __init omap_pm_init(void)
587{
588 printk("Power Management for TI OMAP.\n");
589 pm_idle = omap_pm_idle;
590 /*
591 * We copy the assembler sleep/wakeup routines to SRAM.
592 * These routines need to be in SRAM as that's the only
593 * memory the MPU can see when it wakes up.
594 */
595
596#ifdef CONFIG_ARCH_OMAP1510
597 if (cpu_is_omap1510()) {
598 memcpy((void *)OMAP1510_SRAM_IDLE_SUSPEND,
599 omap1510_idle_loop_suspend,
600 omap1510_idle_loop_suspend_sz);
601 memcpy((void *)OMAP1510_SRAM_API_SUSPEND, omap1510_cpu_suspend,
602 omap1510_cpu_suspend_sz);
603 } else
604#endif
605 if (cpu_is_omap1610() || cpu_is_omap1710()) {
606 memcpy((void *)OMAP1610_SRAM_IDLE_SUSPEND,
607 omap1610_idle_loop_suspend,
608 omap1610_idle_loop_suspend_sz);
609 memcpy((void *)OMAP1610_SRAM_API_SUSPEND, omap1610_cpu_suspend,
610 omap1610_cpu_suspend_sz);
611 } else if (cpu_is_omap5912()) {
612 memcpy((void *)OMAP5912_SRAM_IDLE_SUSPEND,
613 omap1610_idle_loop_suspend,
614 omap1610_idle_loop_suspend_sz);
615 memcpy((void *)OMAP5912_SRAM_API_SUSPEND, omap1610_cpu_suspend,
616 omap1610_cpu_suspend_sz);
617 }
618
619 pm_set_ops(&omap_pm_ops);
620
621#if defined(DEBUG) && defined(CONFIG_PROC_FS)
622 omap_pm_init_proc();
623#endif
624
625 return 0;
626}
627__initcall(omap_pm_init);
628
diff --git a/arch/arm/mach-omap/sleep.S b/arch/arm/mach-omap/sleep.S
new file mode 100644
index 000000000000..4d426d105828
--- /dev/null
+++ b/arch/arm/mach-omap/sleep.S
@@ -0,0 +1,314 @@
1/*
2 * linux/arch/arm/mach-omap/sleep.S
3 *
4 * Low-level OMAP1510/1610 sleep/wakeUp support
5 *
6 * Initial SA1110 code:
7 * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com>
8 *
9 * Adapted for PXA by Nicolas Pitre:
10 * Copyright (c) 2002 Monta Vista Software, Inc.
11 *
12 * Support for OMAP1510/1610 by Dirk Behme <dirk.behme@de.bosch.com>
13 *
14 * This program is free software; you can redistribute it and/or modify it
15 * under the terms of the GNU General Public License as published by the
16 * Free Software Foundation; either version 2 of the License, or (at your
17 * option) any later version.
18 *
19 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
20 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
22 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
25 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 * You should have received a copy of the GNU General Public License along
31 * with this program; if not, write to the Free Software Foundation, Inc.,
32 * 675 Mass Ave, Cambridge, MA 02139, USA.
33 */
34
35#include <linux/config.h>
36#include <linux/linkage.h>
37#include <asm/assembler.h>
38#include <asm/arch/io.h>
39#include <asm/arch/pm.h>
40
41 .text
42
43/*
44 * Forces OMAP into idle state
45 *
46 * omapXXXX_idle_loop_suspend()
47 *
48 * Note: This code get's copied to internal SRAM at boot. When the OMAP
49 * wakes up it continues execution at the point it went to sleep.
50 *
51 * Note: Because of slightly different configuration values we have
52 * processor specific functions here.
53 */
54
55#ifdef CONFIG_ARCH_OMAP1510
56ENTRY(omap1510_idle_loop_suspend)
57
58 stmfd sp!, {r0 - r12, lr} @ save registers on stack
59
60 @ load base address of ARM_IDLECT1 and ARM_IDLECT2
61 mov r4, #CLKGEN_REG_ASM_BASE & 0xff000000
62 orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x00ff0000
63 orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x0000ff00
64
65 @ turn off clock domains
66 @ get ARM_IDLECT2 into r2
67 ldrh r2, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
68 mov r5, #OMAP1510_IDLE_CLOCK_DOMAINS & 0xff
69 orr r5,r5, #OMAP1510_IDLE_CLOCK_DOMAINS & 0xff00
70 strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
71
72 @ request ARM idle
73 @ get ARM_IDLECT1 into r1
74 ldrh r1, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff]
75 orr r3, r1, #OMAP1510_IDLE_LOOP_REQUEST & 0xffff
76 strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff]
77
78 mov r5, #IDLE_WAIT_CYCLES & 0xff
79 orr r5, r5, #IDLE_WAIT_CYCLES & 0xff00
80l_1510: subs r5, r5, #1
81 bne l_1510
82/*
83 * Let's wait for the next clock tick to wake us up.
84 */
85 mov r0, #0
86 mcr p15, 0, r0, c7, c0, 4 @ wait for interrupt
87/*
88 * omap1510_idle_loop_suspend()'s resume point.
89 *
90 * It will just start executing here, so we'll restore stuff from the
91 * stack, reset the ARM_IDLECT1 and ARM_IDLECT2.
92 */
93
94 @ restore ARM_IDLECT1 and ARM_IDLECT2 and return
95 @ r1 has ARM_IDLECT1 and r2 still has ARM_IDLECT2
96 strh r2, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
97 strh r1, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff]
98
99 ldmfd sp!, {r0 - r12, pc} @ restore regs and return
100
101ENTRY(omap1510_idle_loop_suspend_sz)
102 .word . - omap1510_idle_loop_suspend
103#endif /* CONFIG_ARCH_OMAP1510 */
104
105#if defined(CONFIG_ARCH_OMAP16XX)
106ENTRY(omap1610_idle_loop_suspend)
107
108 stmfd sp!, {r0 - r12, lr} @ save registers on stack
109
110 @ load base address of ARM_IDLECT1 and ARM_IDLECT2
111 mov r4, #CLKGEN_REG_ASM_BASE & 0xff000000
112 orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x00ff0000
113 orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x0000ff00
114
115 @ turn off clock domains
116 @ get ARM_IDLECT2 into r2
117 ldrh r2, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
118 mov r5, #OMAP1610_IDLE_CLOCK_DOMAINS & 0xff
119 orr r5,r5, #OMAP1610_IDLE_CLOCK_DOMAINS & 0xff00
120 strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
121
122 @ request ARM idle
123 @ get ARM_IDLECT1 into r1
124 ldrh r1, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff]
125 orr r3, r1, #OMAP1610_IDLE_LOOP_REQUEST & 0xffff
126 strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff]
127
128 mov r5, #IDLE_WAIT_CYCLES & 0xff
129 orr r5, r5, #IDLE_WAIT_CYCLES & 0xff00
130l_1610: subs r5, r5, #1
131 bne l_1610
132/*
133 * Let's wait for the next clock tick to wake us up.
134 */
135 mov r0, #0
136 mcr p15, 0, r0, c7, c0, 4 @ wait for interrupt
137/*
138 * omap1610_idle_loop_suspend()'s resume point.
139 *
140 * It will just start executing here, so we'll restore stuff from the
141 * stack, reset the ARM_IDLECT1 and ARM_IDLECT2.
142 */
143
144 @ restore ARM_IDLECT1 and ARM_IDLECT2 and return
145 @ r1 has ARM_IDLECT1 and r2 still has ARM_IDLECT2
146 strh r2, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
147 strh r1, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff]
148
149 ldmfd sp!, {r0 - r12, pc} @ restore regs and return
150
151ENTRY(omap1610_idle_loop_suspend_sz)
152 .word . - omap1610_idle_loop_suspend
153#endif /* CONFIG_ARCH_OMAP16XX */
154
155/*
156 * Forces OMAP into deep sleep state
157 *
158 * omapXXXX_cpu_suspend()
159 *
160 * The values of the registers ARM_IDLECT1 and ARM_IDLECT2 are passed
161 * as arg0 and arg1 from caller. arg0 is stored in register r0 and arg1
162 * in register r1.
163 *
164 * Note: This code get's copied to internal SRAM at boot. When the OMAP
165 * wakes up it continues execution at the point it went to sleep.
166 *
167 * Note: Because of errata work arounds we have processor specific functions
168 * here. They are mostly the same, but slightly different.
169 *
170 */
171
172#ifdef CONFIG_ARCH_OMAP1510
173ENTRY(omap1510_cpu_suspend)
174
175 @ save registers on stack
176 stmfd sp!, {r0 - r12, lr}
177
178 @ load base address of Traffic Controller
179 mov r4, #TCMIF_ASM_BASE & 0xff000000
180 orr r4, r4, #TCMIF_ASM_BASE & 0x00ff0000
181 orr r4, r4, #TCMIF_ASM_BASE & 0x0000ff00
182
183 @ work around errata of OMAP1510 PDE bit for TC shut down
184 @ clear PDE bit
185 ldr r5, [r4, #EMIFS_CONFIG_ASM_OFFSET & 0xff]
186 bic r5, r5, #PDE_BIT & 0xff
187 str r5, [r4, #EMIFS_CONFIG_ASM_OFFSET & 0xff]
188
189 @ set PWD_EN bit
190 and r5, r5, #PWD_EN_BIT & 0xff
191 str r5, [r4, #EMIFS_CONFIG_ASM_OFFSET & 0xff]
192
193 @ prepare to put SDRAM into self-refresh manually
194 ldr r5, [r4, #EMIFF_SDRAM_CONFIG_ASM_OFFSET & 0xff]
195 orr r5, r5, #SELF_REFRESH_MODE & 0xff000000
196 orr r5, r5, #SELF_REFRESH_MODE & 0x000000ff
197 str r5, [r4, #EMIFF_SDRAM_CONFIG_ASM_OFFSET & 0xff]
198
199 @ prepare to put EMIFS to Sleep
200 ldr r5, [r4, #EMIFS_CONFIG_ASM_OFFSET & 0xff]
201 orr r5, r5, #IDLE_EMIFS_REQUEST & 0xff
202 str r5, [r4, #EMIFS_CONFIG_ASM_OFFSET & 0xff]
203
204 @ load base address of ARM_IDLECT1 and ARM_IDLECT2
205 mov r4, #CLKGEN_REG_ASM_BASE & 0xff000000
206 orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x00ff0000
207 orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x0000ff00
208
209 @ turn off clock domains
210 mov r5, #OMAP1510_IDLE_CLOCK_DOMAINS & 0xff
211 orr r5,r5, #OMAP1510_IDLE_CLOCK_DOMAINS & 0xff00
212 strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
213
214 @ request ARM idle
215 mov r3, #OMAP1510_DEEP_SLEEP_REQUEST & 0xff
216 orr r3, r3, #OMAP1510_DEEP_SLEEP_REQUEST & 0xff00
217 strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff]
218
219 mov r5, #IDLE_WAIT_CYCLES & 0xff
220 orr r5, r5, #IDLE_WAIT_CYCLES & 0xff00
221l_1510_2:
222 subs r5, r5, #1
223 bne l_1510_2
224/*
225 * Let's wait for the next wake up event to wake us up. r0 can't be
226 * used here because r0 holds ARM_IDLECT1
227 */
228 mov r2, #0
229 mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt
230/*
231 * omap1510_cpu_suspend()'s resume point.
232 *
233 * It will just start executing here, so we'll restore stuff from the
234 * stack, reset the ARM_IDLECT1 and ARM_IDLECT2.
235 */
236 strh r1, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
237 strh r0, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff]
238
239 @ restore regs and return
240 ldmfd sp!, {r0 - r12, pc}
241
242ENTRY(omap1510_cpu_suspend_sz)
243 .word . - omap1510_cpu_suspend
244#endif /* CONFIG_ARCH_OMAP1510 */
245
246#if defined(CONFIG_ARCH_OMAP16XX)
247ENTRY(omap1610_cpu_suspend)
248
249 @ save registers on stack
250 stmfd sp!, {r0 - r12, lr}
251
252 @ load base address of Traffic Controller
253 mov r4, #TCMIF_ASM_BASE & 0xff000000
254 orr r4, r4, #TCMIF_ASM_BASE & 0x00ff0000
255 orr r4, r4, #TCMIF_ASM_BASE & 0x0000ff00
256
257 @ prepare to put SDRAM into self-refresh manually
258 ldr r5, [r4, #EMIFF_SDRAM_CONFIG_ASM_OFFSET & 0xff]
259 orr r5, r5, #SELF_REFRESH_MODE & 0xff000000
260 orr r5, r5, #SELF_REFRESH_MODE & 0x000000ff
261 str r5, [r4, #EMIFF_SDRAM_CONFIG_ASM_OFFSET & 0xff]
262
263 @ prepare to put EMIFS to Sleep
264 ldr r5, [r4, #EMIFS_CONFIG_ASM_OFFSET & 0xff]
265 orr r5, r5, #IDLE_EMIFS_REQUEST & 0xff
266 str r5, [r4, #EMIFS_CONFIG_ASM_OFFSET & 0xff]
267
268 @ load base address of ARM_IDLECT1 and ARM_IDLECT2
269 mov r4, #CLKGEN_REG_ASM_BASE & 0xff000000
270 orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x00ff0000
271 orr r4, r4, #CLKGEN_REG_ASM_BASE & 0x0000ff00
272
273 @ turn off clock domains
274 mov r5, #OMAP1610_IDLE_CLOCK_DOMAINS & 0xff
275 orr r5,r5, #OMAP1610_IDLE_CLOCK_DOMAINS & 0xff00
276 strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
277
278 @ work around errata of OMAP1610/5912. Enable (!) peripheral
279 @ clock to let the chip go into deep sleep
280 ldrh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
281 orr r5,r5, #EN_PERCK_BIT & 0xff
282 strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
283
284 @ request ARM idle
285 mov r3, #OMAP1610_DEEP_SLEEP_REQUEST & 0xff
286 orr r3, r3, #OMAP1610_DEEP_SLEEP_REQUEST & 0xff00
287 strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff]
288
289 mov r5, #IDLE_WAIT_CYCLES & 0xff
290 orr r5, r5, #IDLE_WAIT_CYCLES & 0xff00
291l_1610_2:
292 subs r5, r5, #1
293 bne l_1610_2
294/*
295 * Let's wait for the next wake up event to wake us up. r0 can't be
296 * used here because r0 holds ARM_IDLECT1
297 */
298 mov r2, #0
299 mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt
300/*
301 * omap1610_cpu_suspend()'s resume point.
302 *
303 * It will just start executing here, so we'll restore stuff from the
304 * stack, reset the ARM_IDLECT1 and ARM_IDLECT2.
305 */
306 strh r1, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
307 strh r0, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff]
308
309 @ restore regs and return
310 ldmfd sp!, {r0 - r12, pc}
311
312ENTRY(omap1610_cpu_suspend_sz)
313 .word . - omap1610_cpu_suspend
314#endif /* CONFIG_ARCH_OMAP16XX */
diff --git a/arch/arm/mach-omap/time.c b/arch/arm/mach-omap/time.c
new file mode 100644
index 000000000000..4205fdcb632c
--- /dev/null
+++ b/arch/arm/mach-omap/time.c
@@ -0,0 +1,384 @@
1/*
2 * linux/arch/arm/mach-omap/time.c
3 *
4 * OMAP Timers
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 * Partial timer rewrite and additional VST timer support by
8 * Tony Lindgen <tony@atomide.com> and
9 * Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
10 *
11 * MPU timer code based on the older MPU timer code for OMAP
12 * Copyright (C) 2000 RidgeRun, Inc.
13 * Author: Greg Lonnon <glonnon@ridgerun.com>
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 *
20 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
21 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
23 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * You should have received a copy of the GNU General Public License along
32 * with this program; if not, write to the Free Software Foundation, Inc.,
33 * 675 Mass Ave, Cambridge, MA 02139, USA.
34 */
35
36#include <linux/config.h>
37#include <linux/kernel.h>
38#include <linux/init.h>
39#include <linux/delay.h>
40#include <linux/interrupt.h>
41#include <linux/sched.h>
42#include <linux/spinlock.h>
43
44#include <asm/system.h>
45#include <asm/hardware.h>
46#include <asm/io.h>
47#include <asm/leds.h>
48#include <asm/irq.h>
49#include <asm/mach/irq.h>
50#include <asm/mach/time.h>
51
52struct sys_timer omap_timer;
53
54#ifdef CONFIG_OMAP_MPU_TIMER
55
56/*
57 * ---------------------------------------------------------------------------
58 * MPU timer
59 * ---------------------------------------------------------------------------
60 */
61#define OMAP_MPU_TIMER1_BASE (0xfffec500)
62#define OMAP_MPU_TIMER2_BASE (0xfffec600)
63#define OMAP_MPU_TIMER3_BASE (0xfffec700)
64#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE
65#define OMAP_MPU_TIMER_OFFSET 0x100
66
67#define MPU_TIMER_FREE (1 << 6)
68#define MPU_TIMER_CLOCK_ENABLE (1 << 5)
69#define MPU_TIMER_AR (1 << 1)
70#define MPU_TIMER_ST (1 << 0)
71
72/* cycles to nsec conversions taken from arch/i386/kernel/timers/timer_tsc.c,
73 * converted to use kHz by Kevin Hilman */
74/* convert from cycles(64bits) => nanoseconds (64bits)
75 * basic equation:
76 * ns = cycles / (freq / ns_per_sec)
77 * ns = cycles * (ns_per_sec / freq)
78 * ns = cycles * (10^9 / (cpu_khz * 10^3))
79 * ns = cycles * (10^6 / cpu_khz)
80 *
81 * Then we use scaling math (suggested by george at mvista.com) to get:
82 * ns = cycles * (10^6 * SC / cpu_khz / SC
83 * ns = cycles * cyc2ns_scale / SC
84 *
85 * And since SC is a constant power of two, we can convert the div
86 * into a shift.
87 * -johnstul at us.ibm.com "math is hard, lets go shopping!"
88 */
89static unsigned long cyc2ns_scale;
90#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
91
92static inline void set_cyc2ns_scale(unsigned long cpu_khz)
93{
94 cyc2ns_scale = (1000000 << CYC2NS_SCALE_FACTOR)/cpu_khz;
95}
96
97static inline unsigned long long cycles_2_ns(unsigned long long cyc)
98{
99 return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
100}
101
102/*
103 * MPU_TICKS_PER_SEC must be an even number, otherwise machinecycles_to_usecs
104 * will break. On P2, the timer count rate is 6.5 MHz after programming PTV
105 * with 0. This divides the 13MHz input by 2, and is undocumented.
106 */
107#ifdef CONFIG_MACH_OMAP_PERSEUS2
108/* REVISIT: This ifdef construct should be replaced by a query to clock
109 * framework to see if timer base frequency is 12.0, 13.0 or 19.2 MHz.
110 */
111#define MPU_TICKS_PER_SEC (13000000 / 2)
112#else
113#define MPU_TICKS_PER_SEC (12000000 / 2)
114#endif
115
116#define MPU_TIMER_TICK_PERIOD ((MPU_TICKS_PER_SEC / HZ) - 1)
117
118typedef struct {
119 u32 cntl; /* CNTL_TIMER, R/W */
120 u32 load_tim; /* LOAD_TIM, W */
121 u32 read_tim; /* READ_TIM, R */
122} omap_mpu_timer_regs_t;
123
124#define omap_mpu_timer_base(n) \
125((volatile omap_mpu_timer_regs_t*)IO_ADDRESS(OMAP_MPU_TIMER_BASE + \
126 (n)*OMAP_MPU_TIMER_OFFSET))
127
128static inline unsigned long omap_mpu_timer_read(int nr)
129{
130 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
131 return timer->read_tim;
132}
133
134static inline void omap_mpu_timer_start(int nr, unsigned long load_val)
135{
136 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
137
138 timer->cntl = MPU_TIMER_CLOCK_ENABLE;
139 udelay(1);
140 timer->load_tim = load_val;
141 udelay(1);
142 timer->cntl = (MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_AR | MPU_TIMER_ST);
143}
144
145unsigned long omap_mpu_timer_ticks_to_usecs(unsigned long nr_ticks)
146{
147 unsigned long long nsec;
148
149 nsec = cycles_2_ns((unsigned long long)nr_ticks);
150 return (unsigned long)nsec / 1000;
151}
152
153/*
154 * Last processed system timer interrupt
155 */
156static unsigned long omap_mpu_timer_last = 0;
157
158/*
159 * Returns elapsed usecs since last system timer interrupt
160 */
161static unsigned long omap_mpu_timer_gettimeoffset(void)
162{
163 unsigned long now = 0 - omap_mpu_timer_read(0);
164 unsigned long elapsed = now - omap_mpu_timer_last;
165
166 return omap_mpu_timer_ticks_to_usecs(elapsed);
167}
168
169/*
170 * Elapsed time between interrupts is calculated using timer0.
171 * Latency during the interrupt is calculated using timer1.
172 * Both timer0 and timer1 are counting at 6MHz (P2 6.5MHz).
173 */
174static irqreturn_t omap_mpu_timer_interrupt(int irq, void *dev_id,
175 struct pt_regs *regs)
176{
177 unsigned long now, latency;
178
179 write_seqlock(&xtime_lock);
180 now = 0 - omap_mpu_timer_read(0);
181 latency = MPU_TICKS_PER_SEC / HZ - omap_mpu_timer_read(1);
182 omap_mpu_timer_last = now - latency;
183 timer_tick(regs);
184 write_sequnlock(&xtime_lock);
185
186 return IRQ_HANDLED;
187}
188
189static struct irqaction omap_mpu_timer_irq = {
190 .name = "mpu timer",
191 .flags = SA_INTERRUPT,
192 .handler = omap_mpu_timer_interrupt
193};
194
195static unsigned long omap_mpu_timer1_overflows;
196static irqreturn_t omap_mpu_timer1_interrupt(int irq, void *dev_id,
197 struct pt_regs *regs)
198{
199 omap_mpu_timer1_overflows++;
200 return IRQ_HANDLED;
201}
202
203static struct irqaction omap_mpu_timer1_irq = {
204 .name = "mpu timer1 overflow",
205 .flags = SA_INTERRUPT,
206 .handler = omap_mpu_timer1_interrupt
207};
208
209static __init void omap_init_mpu_timer(void)
210{
211 set_cyc2ns_scale(MPU_TICKS_PER_SEC / 1000);
212 omap_timer.offset = omap_mpu_timer_gettimeoffset;
213 setup_irq(INT_TIMER1, &omap_mpu_timer1_irq);
214 setup_irq(INT_TIMER2, &omap_mpu_timer_irq);
215 omap_mpu_timer_start(0, 0xffffffff);
216 omap_mpu_timer_start(1, MPU_TIMER_TICK_PERIOD);
217}
218
219/*
220 * Scheduler clock - returns current time in nanosec units.
221 */
222unsigned long long sched_clock(void)
223{
224 unsigned long ticks = 0 - omap_mpu_timer_read(0);
225 unsigned long long ticks64;
226
227 ticks64 = omap_mpu_timer1_overflows;
228 ticks64 <<= 32;
229 ticks64 |= ticks;
230
231 return cycles_2_ns(ticks64);
232}
233#endif /* CONFIG_OMAP_MPU_TIMER */
234
235#ifdef CONFIG_OMAP_32K_TIMER
236
237#ifdef CONFIG_ARCH_OMAP1510
238#error OMAP 32KHz timer does not currently work on 1510!
239#endif
240
241/*
242 * ---------------------------------------------------------------------------
243 * 32KHz OS timer
244 *
245 * This currently works only on 16xx, as 1510 does not have the continuous
246 * 32KHz synchronous timer. The 32KHz synchronous timer is used to keep track
247 * of time in addition to the 32KHz OS timer. Using only the 32KHz OS timer
248 * on 1510 would be possible, but the timer would not be as accurate as
249 * with the 32KHz synchronized timer.
250 * ---------------------------------------------------------------------------
251 */
252#define OMAP_32K_TIMER_BASE 0xfffb9000
253#define OMAP_32K_TIMER_CR 0x08
254#define OMAP_32K_TIMER_TVR 0x00
255#define OMAP_32K_TIMER_TCR 0x04
256
257#define OMAP_32K_TICKS_PER_HZ (32768 / HZ)
258
259/*
260 * TRM says 1 / HZ = ( TVR + 1) / 32768, so TRV = (32768 / HZ) - 1
261 * so with HZ = 100, TVR = 327.68.
262 */
263#define OMAP_32K_TIMER_TICK_PERIOD ((32768 / HZ) - 1)
264#define MAX_SKIP_JIFFIES 25
265#define TIMER_32K_SYNCHRONIZED 0xfffbc410
266
267#define JIFFIES_TO_HW_TICKS(nr_jiffies, clock_rate) \
268 (((nr_jiffies) * (clock_rate)) / HZ)
269
270static inline void omap_32k_timer_write(int val, int reg)
271{
272 omap_writew(val, reg + OMAP_32K_TIMER_BASE);
273}
274
275static inline unsigned long omap_32k_timer_read(int reg)
276{
277 return omap_readl(reg + OMAP_32K_TIMER_BASE) & 0xffffff;
278}
279
280/*
281 * The 32KHz synchronized timer is an additional timer on 16xx.
282 * It is always running.
283 */
284static inline unsigned long omap_32k_sync_timer_read(void)
285{
286 return omap_readl(TIMER_32K_SYNCHRONIZED);
287}
288
289static inline void omap_32k_timer_start(unsigned long load_val)
290{
291 omap_32k_timer_write(load_val, OMAP_32K_TIMER_TVR);
292 omap_32k_timer_write(0x0f, OMAP_32K_TIMER_CR);
293}
294
295static inline void omap_32k_timer_stop(void)
296{
297 omap_32k_timer_write(0x0, OMAP_32K_TIMER_CR);
298}
299
300/*
301 * Rounds down to nearest usec
302 */
303static inline unsigned long omap_32k_ticks_to_usecs(unsigned long ticks_32k)
304{
305 return (ticks_32k * 5*5*5*5*5*5) >> 9;
306}
307
308static unsigned long omap_32k_last_tick = 0;
309
310/*
311 * Returns elapsed usecs since last 32k timer interrupt
312 */
313static unsigned long omap_32k_timer_gettimeoffset(void)
314{
315 unsigned long now = omap_32k_sync_timer_read();
316 return omap_32k_ticks_to_usecs(now - omap_32k_last_tick);
317}
318
319/*
320 * Timer interrupt for 32KHz timer. When dynamic tick is enabled, this
321 * function is also called from other interrupts to remove latency
322 * issues with dynamic tick. In the dynamic tick case, we need to lock
323 * with irqsave.
324 */
325static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id,
326 struct pt_regs *regs)
327{
328 unsigned long flags;
329 unsigned long now;
330
331 write_seqlock_irqsave(&xtime_lock, flags);
332 now = omap_32k_sync_timer_read();
333
334 while (now - omap_32k_last_tick >= OMAP_32K_TICKS_PER_HZ) {
335 omap_32k_last_tick += OMAP_32K_TICKS_PER_HZ;
336 timer_tick(regs);
337 }
338
339 /* Restart timer so we don't drift off due to modulo or dynamic tick.
340 * By default we program the next timer to be continuous to avoid
341 * latencies during high system load. During dynamic tick operation the
342 * continuous timer can be overridden from pm_idle to be longer.
343 */
344 omap_32k_timer_start(omap_32k_last_tick + OMAP_32K_TICKS_PER_HZ - now);
345 write_sequnlock_irqrestore(&xtime_lock, flags);
346
347 return IRQ_HANDLED;
348}
349
350static struct irqaction omap_32k_timer_irq = {
351 .name = "32KHz timer",
352 .flags = SA_INTERRUPT,
353 .handler = omap_32k_timer_interrupt
354};
355
356static __init void omap_init_32k_timer(void)
357{
358 setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
359 omap_timer.offset = omap_32k_timer_gettimeoffset;
360 omap_32k_last_tick = omap_32k_sync_timer_read();
361 omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD);
362}
363#endif /* CONFIG_OMAP_32K_TIMER */
364
365/*
366 * ---------------------------------------------------------------------------
367 * Timer initialization
368 * ---------------------------------------------------------------------------
369 */
370void __init omap_timer_init(void)
371{
372#if defined(CONFIG_OMAP_MPU_TIMER)
373 omap_init_mpu_timer();
374#elif defined(CONFIG_OMAP_32K_TIMER)
375 omap_init_32k_timer();
376#else
377#error No system timer selected in Kconfig!
378#endif
379}
380
381struct sys_timer omap_timer = {
382 .init = omap_timer_init,
383 .offset = NULL, /* Initialized later */
384};
diff --git a/arch/arm/mach-omap/usb.c b/arch/arm/mach-omap/usb.c
new file mode 100644
index 000000000000..6e805d451d0e
--- /dev/null
+++ b/arch/arm/mach-omap/usb.c
@@ -0,0 +1,594 @@
1/*
2 * arch/arm/mach-omap/usb.c -- platform level USB initialization
3 *
4 * Copyright (C) 2004 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#undef DEBUG
22
23#include <linux/config.h>
24#include <linux/module.h>
25#include <linux/kernel.h>
26#include <linux/types.h>
27#include <linux/errno.h>
28#include <linux/init.h>
29#include <linux/device.h>
30#include <linux/usb_otg.h>
31
32#include <asm/io.h>
33#include <asm/irq.h>
34#include <asm/system.h>
35#include <asm/hardware.h>
36#include <asm/mach-types.h>
37
38#include <asm/arch/mux.h>
39#include <asm/arch/usb.h>
40#include <asm/arch/board.h>
41
42/* These routines should handle the standard chip-specific modes
43 * for usb0/1/2 ports, covering basic mux and transceiver setup.
44 * Call omap_usb_init() once, from INIT_MACHINE().
45 *
46 * Some board-*.c files will need to set up additional mux options,
47 * like for suspend handling, vbus sensing, GPIOs, and the D+ pullup.
48 */
49
50/* TESTED ON:
51 * - 1611B H2 (with usb1 mini-AB) using standard Mini-B or OTG cables
52 * - 5912 OSK OHCI (with usb0 standard-A), standard A-to-B cables
53 * - 5912 OSK UDC, with *nonstandard* A-to-A cable
54 * - 1510 Innovator UDC with bundled usb0 cable
55 * - 1510 Innovator OHCI with bundled usb1/usb2 cable
56 * - 1510 Innovator OHCI with custom usb0 cable, feeding 5V VBUS
57 * - 1710 custom development board using alternate pin group
58 * - 1710 H3 (with usb1 mini-AB) using standard Mini-B or OTG cables
59 */
60
61/*-------------------------------------------------------------------------*/
62
63#ifdef CONFIG_ARCH_OMAP_OTG
64
65static struct otg_transceiver *xceiv;
66
67/**
68 * otg_get_transceiver - find the (single) OTG transceiver driver
69 *
70 * Returns the transceiver driver, after getting a refcount to it; or
71 * null if there is no such transceiver. The caller is responsible for
72 * releasing that count.
73 */
74struct otg_transceiver *otg_get_transceiver(void)
75{
76 if (xceiv)
77 get_device(xceiv->dev);
78 return xceiv;
79}
80EXPORT_SYMBOL(otg_get_transceiver);
81
82int otg_set_transceiver(struct otg_transceiver *x)
83{
84 if (xceiv && x)
85 return -EBUSY;
86 xceiv = x;
87 return 0;
88}
89EXPORT_SYMBOL(otg_set_transceiver);
90
91#endif
92
93/*-------------------------------------------------------------------------*/
94
95static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device)
96{
97 u32 syscon1 = 0;
98
99 if (nwires == 0) {
100 if (!cpu_is_omap15xx()) {
101 /* pulldown D+/D- */
102 USB_TRANSCEIVER_CTRL_REG &= ~(3 << 1);
103 }
104 return 0;
105 }
106
107 if (is_device)
108 omap_cfg_reg(W4_USB_PUEN);
109
110 /* internal transceiver */
111 if (nwires == 2) {
112 // omap_cfg_reg(P9_USB_DP);
113 // omap_cfg_reg(R8_USB_DM);
114
115 if (cpu_is_omap15xx()) {
116 /* This works on 1510-Innovator */
117 return 0;
118 }
119
120 /* NOTES:
121 * - peripheral should configure VBUS detection!
122 * - only peripherals may use the internal D+/D- pulldowns
123 * - OTG support on this port not yet written
124 */
125
126 USB_TRANSCEIVER_CTRL_REG &= ~(7 << 4);
127 if (!is_device)
128 USB_TRANSCEIVER_CTRL_REG |= (3 << 1);
129
130 return 3 << 16;
131 }
132
133 /* alternate pin config, external transceiver */
134 if (cpu_is_omap15xx()) {
135 printk(KERN_ERR "no usb0 alt pin config on 15xx\n");
136 return 0;
137 }
138
139 omap_cfg_reg(V6_USB0_TXD);
140 omap_cfg_reg(W9_USB0_TXEN);
141 omap_cfg_reg(W5_USB0_SE0);
142
143 /* NOTE: SPEED and SUSP aren't configured here */
144
145 if (nwires != 3)
146 omap_cfg_reg(Y5_USB0_RCV);
147 if (nwires != 6)
148 USB_TRANSCEIVER_CTRL_REG &= ~CONF_USB2_UNI_R;
149
150 switch (nwires) {
151 case 3:
152 syscon1 = 2;
153 break;
154 case 4:
155 syscon1 = 1;
156 break;
157 case 6:
158 syscon1 = 3;
159 omap_cfg_reg(AA9_USB0_VP);
160 omap_cfg_reg(R9_USB0_VM);
161 USB_TRANSCEIVER_CTRL_REG |= CONF_USB2_UNI_R;
162 break;
163 default:
164 printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
165 0, nwires);
166 }
167 return syscon1 << 16;
168}
169
170static u32 __init omap_usb1_init(unsigned nwires)
171{
172 u32 syscon1 = 0;
173
174 if (nwires != 6 && !cpu_is_omap15xx())
175 USB_TRANSCEIVER_CTRL_REG &= ~CONF_USB1_UNI_R;
176 if (nwires == 0)
177 return 0;
178
179 /* external transceiver */
180 omap_cfg_reg(USB1_TXD);
181 omap_cfg_reg(USB1_TXEN);
182 if (cpu_is_omap15xx()) {
183 omap_cfg_reg(USB1_SEO);
184 omap_cfg_reg(USB1_SPEED);
185 // SUSP
186 } else if (cpu_is_omap1610() || cpu_is_omap5912()) {
187 omap_cfg_reg(W13_1610_USB1_SE0);
188 omap_cfg_reg(R13_1610_USB1_SPEED);
189 // SUSP
190 } else if (cpu_is_omap1710()) {
191 omap_cfg_reg(R13_1710_USB1_SE0);
192 // SUSP
193 } else {
194 pr_debug("usb unrecognized\n");
195 }
196 if (nwires != 3)
197 omap_cfg_reg(USB1_RCV);
198
199 switch (nwires) {
200 case 3:
201 syscon1 = 2;
202 break;
203 case 4:
204 syscon1 = 1;
205 break;
206 case 6:
207 syscon1 = 3;
208 omap_cfg_reg(USB1_VP);
209 omap_cfg_reg(USB1_VM);
210 if (!cpu_is_omap15xx())
211 USB_TRANSCEIVER_CTRL_REG |= CONF_USB1_UNI_R;
212 break;
213 default:
214 printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
215 1, nwires);
216 }
217 return syscon1 << 20;
218}
219
220static u32 __init omap_usb2_init(unsigned nwires, unsigned alt_pingroup)
221{
222 u32 syscon1 = 0;
223
224 /* NOTE erratum: must leave USB2_UNI_R set if usb0 in use */
225 if (alt_pingroup || nwires == 0)
226 return 0;
227 if (nwires != 6 && !cpu_is_omap15xx())
228 USB_TRANSCEIVER_CTRL_REG &= ~CONF_USB2_UNI_R;
229
230 /* external transceiver */
231 if (cpu_is_omap15xx()) {
232 omap_cfg_reg(USB2_TXD);
233 omap_cfg_reg(USB2_TXEN);
234 omap_cfg_reg(USB2_SEO);
235 if (nwires != 3)
236 omap_cfg_reg(USB2_RCV);
237 /* there is no USB2_SPEED */
238 } else if (cpu_is_omap16xx()) {
239 omap_cfg_reg(V6_USB2_TXD);
240 omap_cfg_reg(W9_USB2_TXEN);
241 omap_cfg_reg(W5_USB2_SE0);
242 if (nwires != 3)
243 omap_cfg_reg(Y5_USB2_RCV);
244 // FIXME omap_cfg_reg(USB2_SPEED);
245 } else {
246 pr_debug("usb unrecognized\n");
247 }
248 // omap_cfg_reg(USB2_SUSP);
249
250 switch (nwires) {
251 case 3:
252 syscon1 = 2;
253 break;
254 case 4:
255 syscon1 = 1;
256 break;
257 case 6:
258 syscon1 = 3;
259 if (cpu_is_omap15xx()) {
260 omap_cfg_reg(USB2_VP);
261 omap_cfg_reg(USB2_VM);
262 } else {
263 omap_cfg_reg(AA9_USB2_VP);
264 omap_cfg_reg(R9_USB2_VM);
265 USB_TRANSCEIVER_CTRL_REG |= CONF_USB2_UNI_R;
266 }
267 break;
268 default:
269 printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
270 2, nwires);
271 }
272 return syscon1 << 24;
273}
274
275/*-------------------------------------------------------------------------*/
276
277#if defined(CONFIG_USB_GADGET_OMAP) || \
278 defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) || \
279 (defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG))
280static void usb_release(struct device *dev)
281{
282 /* normally not freed */
283}
284#endif
285
286#ifdef CONFIG_USB_GADGET_OMAP
287
288static struct resource udc_resources[] = {
289 /* order is significant! */
290 { /* registers */
291 .start = IO_ADDRESS(UDC_BASE),
292 .end = IO_ADDRESS(UDC_BASE + 0xff),
293 .flags = IORESOURCE_MEM,
294 }, { /* general IRQ */
295 .start = IH2_BASE + 20,
296 .flags = IORESOURCE_IRQ,
297 }, { /* PIO IRQ */
298 .start = IH2_BASE + 30,
299 .flags = IORESOURCE_IRQ,
300 }, { /* SOF IRQ */
301 .start = IH2_BASE + 29,
302 .flags = IORESOURCE_IRQ,
303 },
304};
305
306static u64 udc_dmamask = ~(u32)0;
307
308static struct platform_device udc_device = {
309 .name = "omap_udc",
310 .id = -1,
311 .dev = {
312 .release = usb_release,
313 .dma_mask = &udc_dmamask,
314 .coherent_dma_mask = 0xffffffff,
315 },
316 .num_resources = ARRAY_SIZE(udc_resources),
317 .resource = udc_resources,
318};
319
320#endif
321
322#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
323
324/* The dmamask must be set for OHCI to work */
325static u64 ohci_dmamask = ~(u32)0;
326
327static struct resource ohci_resources[] = {
328 {
329 .start = OMAP_OHCI_BASE,
330 .end = OMAP_OHCI_BASE + 4096,
331 .flags = IORESOURCE_MEM,
332 },
333 {
334 .start = INT_USB_HHC_1,
335 .flags = IORESOURCE_IRQ,
336 },
337};
338
339static struct platform_device ohci_device = {
340 .name = "ohci",
341 .id = -1,
342 .dev = {
343 .release = usb_release,
344 .dma_mask = &ohci_dmamask,
345 .coherent_dma_mask = 0xffffffff,
346 },
347 .num_resources = ARRAY_SIZE(ohci_resources),
348 .resource = ohci_resources,
349};
350
351#endif
352
353#if defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG)
354
355static struct resource otg_resources[] = {
356 /* order is significant! */
357 {
358 .start = IO_ADDRESS(OTG_BASE),
359 .end = IO_ADDRESS(OTG_BASE + 0xff),
360 .flags = IORESOURCE_MEM,
361 }, {
362 .start = IH2_BASE + 8,
363 .flags = IORESOURCE_IRQ,
364 },
365};
366
367static struct platform_device otg_device = {
368 .name = "omap_otg",
369 .id = -1,
370 .dev = {
371 .release = usb_release,
372 },
373 .num_resources = ARRAY_SIZE(otg_resources),
374 .resource = otg_resources,
375};
376
377#endif
378
379/*-------------------------------------------------------------------------*/
380
381#define ULPD_CLOCK_CTRL_REG __REG16(ULPD_CLOCK_CTRL)
382#define ULPD_SOFT_REQ_REG __REG16(ULPD_SOFT_REQ)
383
384
385// FIXME correct answer depends on hmc_mode,
386// as does any nonzero value for config->otg port number
387#ifdef CONFIG_USB_GADGET_OMAP
388#define is_usb0_device(config) 1
389#else
390#define is_usb0_device(config) 0
391#endif
392
393/*-------------------------------------------------------------------------*/
394
395#ifdef CONFIG_ARCH_OMAP_OTG
396
397void __init
398omap_otg_init(struct omap_usb_config *config)
399{
400 u32 syscon = OTG_SYSCON_1_REG & 0xffff;
401 int status;
402 int alt_pingroup = 0;
403
404 /* NOTE: no bus or clock setup (yet?) */
405
406 syscon = OTG_SYSCON_1_REG & 0xffff;
407 if (!(syscon & OTG_RESET_DONE))
408 pr_debug("USB resets not complete?\n");
409
410 // OTG_IRQ_EN_REG = 0;
411
412 /* pin muxing and transceiver pinouts */
413 if (config->pins[0] > 2) /* alt pingroup 2 */
414 alt_pingroup = 1;
415 syscon |= omap_usb0_init(config->pins[0], is_usb0_device(config));
416 syscon |= omap_usb1_init(config->pins[1]);
417 syscon |= omap_usb2_init(config->pins[2], alt_pingroup);
418 pr_debug("OTG_SYSCON_1_REG = %08x\n", syscon);
419 OTG_SYSCON_1_REG = syscon;
420
421 syscon = config->hmc_mode;
422 syscon |= USBX_SYNCHRO | (4 << 16) /* B_ASE0_BRST */;
423#ifdef CONFIG_USB_OTG
424 if (config->otg)
425 syscon |= OTG_EN;
426#endif
427 pr_debug("USB_TRANSCEIVER_CTRL_REG = %03x\n", USB_TRANSCEIVER_CTRL_REG);
428 pr_debug("OTG_SYSCON_2_REG = %08x\n", syscon);
429 OTG_SYSCON_2_REG = syscon;
430
431 printk("USB: hmc %d", config->hmc_mode);
432 if (alt_pingroup)
433 printk(", usb2 alt %d wires", config->pins[2]);
434 else if (config->pins[0])
435 printk(", usb0 %d wires%s", config->pins[0],
436 is_usb0_device(config) ? " (dev)" : "");
437 if (config->pins[1])
438 printk(", usb1 %d wires", config->pins[1]);
439 if (!alt_pingroup && config->pins[2])
440 printk(", usb2 %d wires", config->pins[2]);
441 if (config->otg)
442 printk(", Mini-AB on usb%d", config->otg - 1);
443 printk("\n");
444
445 /* leave USB clocks/controllers off until needed */
446 ULPD_SOFT_REQ_REG &= ~SOFT_USB_CLK_REQ;
447 ULPD_CLOCK_CTRL_REG &= ~USB_MCLK_EN;
448 ULPD_CLOCK_CTRL_REG |= DIS_USB_PVCI_CLK;
449 syscon = OTG_SYSCON_1_REG;
450 syscon |= HST_IDLE_EN|DEV_IDLE_EN|OTG_IDLE_EN;
451
452#ifdef CONFIG_USB_GADGET_OMAP
453 if (config->otg || config->register_dev) {
454 syscon &= ~DEV_IDLE_EN;
455 udc_device.dev.platform_data = config;
456 /* FIXME patch IRQ numbers for omap730 */
457 status = platform_device_register(&udc_device);
458 if (status)
459 pr_debug("can't register UDC device, %d\n", status);
460 }
461#endif
462
463#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
464 if (config->otg || config->register_host) {
465 syscon &= ~HST_IDLE_EN;
466 ohci_device.dev.platform_data = config;
467 if (cpu_is_omap730())
468 ohci_resources[1].start = INT_730_USB_HHC_1;
469 status = platform_device_register(&ohci_device);
470 if (status)
471 pr_debug("can't register OHCI device, %d\n", status);
472 }
473#endif
474
475#ifdef CONFIG_USB_OTG
476 if (config->otg) {
477 syscon &= ~OTG_IDLE_EN;
478 otg_device.dev.platform_data = config;
479 if (cpu_is_omap730())
480 otg_resources[1].start = INT_730_USB_OTG;
481 status = platform_device_register(&otg_device);
482 if (status)
483 pr_debug("can't register OTG device, %d\n", status);
484 }
485#endif
486 pr_debug("OTG_SYSCON_1_REG = %08x\n", syscon);
487 OTG_SYSCON_1_REG = syscon;
488
489 status = 0;
490}
491
492#else
493static inline void omap_otg_init(struct omap_usb_config *config) {}
494#endif
495
496/*-------------------------------------------------------------------------*/
497
498#ifdef CONFIG_ARCH_OMAP1510
499
500#define ULPD_DPLL_CTRL_REG __REG16(ULPD_DPLL_CTRL)
501#define DPLL_IOB (1 << 13)
502#define DPLL_PLL_ENABLE (1 << 4)
503#define DPLL_LOCK (1 << 0)
504
505#define ULPD_APLL_CTRL_REG __REG16(ULPD_APLL_CTRL)
506#define APLL_NDPLL_SWITCH (1 << 0)
507
508
509static void __init omap_1510_usb_init(struct omap_usb_config *config)
510{
511 int status;
512 unsigned int val;
513
514 omap_usb0_init(config->pins[0], is_usb0_device(config));
515 omap_usb1_init(config->pins[1]);
516 omap_usb2_init(config->pins[2], 0);
517
518 val = omap_readl(MOD_CONF_CTRL_0) & ~(0x3f << 1);
519 val |= (config->hmc_mode << 1);
520 omap_writel(val, MOD_CONF_CTRL_0);
521
522 printk("USB: hmc %d", config->hmc_mode);
523 if (config->pins[0])
524 printk(", usb0 %d wires%s", config->pins[0],
525 is_usb0_device(config) ? " (dev)" : "");
526 if (config->pins[1])
527 printk(", usb1 %d wires", config->pins[1]);
528 if (config->pins[2])
529 printk(", usb2 %d wires", config->pins[2]);
530 printk("\n");
531
532 /* use DPLL for 48 MHz function clock */
533 pr_debug("APLL %04x DPLL %04x REQ %04x\n", ULPD_APLL_CTRL_REG,
534 ULPD_DPLL_CTRL_REG, ULPD_SOFT_REQ_REG);
535 ULPD_APLL_CTRL_REG &= ~APLL_NDPLL_SWITCH;
536 ULPD_DPLL_CTRL_REG |= DPLL_IOB | DPLL_PLL_ENABLE;
537 ULPD_SOFT_REQ_REG |= SOFT_UDC_REQ | SOFT_DPLL_REQ;
538 while (!(ULPD_DPLL_CTRL_REG & DPLL_LOCK))
539 cpu_relax();
540
541#ifdef CONFIG_USB_GADGET_OMAP
542 if (config->register_dev) {
543 udc_device.dev.platform_data = config;
544 status = platform_device_register(&udc_device);
545 if (status)
546 pr_debug("can't register UDC device, %d\n", status);
547 /* udc driver gates 48MHz by D+ pullup */
548 }
549#endif
550
551#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
552 if (config->register_host) {
553 ohci_device.dev.platform_data = config;
554 status = platform_device_register(&ohci_device);
555 if (status)
556 pr_debug("can't register OHCI device, %d\n", status);
557 /* hcd explicitly gates 48MHz */
558 }
559#endif
560}
561
562#else
563static inline void omap_1510_usb_init(struct omap_usb_config *config) {}
564#endif
565
566/*-------------------------------------------------------------------------*/
567
568static struct omap_usb_config platform_data;
569
570static int __init
571omap_usb_init(void)
572{
573 const struct omap_usb_config *config;
574
575 config = omap_get_config(OMAP_TAG_USB, struct omap_usb_config);
576 if (config == NULL) {
577 printk(KERN_ERR "USB: No board-specific "
578 "platform config found\n");
579 return -ENODEV;
580 }
581 platform_data = *config;
582
583 if (cpu_is_omap730() || cpu_is_omap16xx())
584 omap_otg_init(&platform_data);
585 else if (cpu_is_omap15xx())
586 omap_1510_usb_init(&platform_data);
587 else {
588 printk(KERN_ERR "USB: No init for your chip yet\n");
589 return -ENODEV;
590 }
591 return 0;
592}
593
594subsys_initcall(omap_usb_init);
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
new file mode 100644
index 000000000000..405a55f2287c
--- /dev/null
+++ b/arch/arm/mach-pxa/Kconfig
@@ -0,0 +1,77 @@
1if ARCH_PXA
2
3menu "Intel PXA2xx Implementations"
4
5choice
6 prompt "Select target board"
7
8config ARCH_LUBBOCK
9 bool "Intel DBPXA250 Development Platform"
10 select PXA25x
11 select SA1111
12
13config MACH_MAINSTONE
14 bool "Intel HCDDBBVA0 Development Platform"
15 select PXA27x
16 select IWMMXT
17
18config ARCH_PXA_IDP
19 bool "Accelent Xscale IDP"
20 select PXA25x
21
22config PXA_SHARPSL
23 bool "SHARP SL-5600 and SL-C7xx Models"
24 select PXA25x
25 select SHARP_SCOOP
26 select SHARP_PARAM
27 help
28 Say Y here if you intend to run this kernel on a
29 Sharp SL-5600 (Poodle), Sharp SL-C700 (Corgi),
30 SL-C750 (Shepherd) or a Sharp SL-C760 (Husky)
31 handheld computer.
32
33endchoice
34
35endmenu
36
37config MACH_POODLE
38 bool "Enable Sharp SL-5600 (Poodle) Support"
39 depends PXA_SHARPSL
40 select SHARP_LOCOMO
41
42config MACH_CORGI
43 bool "Enable Sharp SL-C700 (Corgi) Support"
44 depends PXA_SHARPSL
45 select PXA_SHARP_C7xx
46
47config MACH_SHEPHERD
48 bool "Enable Sharp SL-C750 (Shepherd) Support"
49 depends PXA_SHARPSL
50 select PXA_SHARP_C7xx
51
52config MACH_HUSKY
53 bool "Enable Sharp SL-C760 (Husky) Support"
54 depends PXA_SHARPSL
55 select PXA_SHARP_C7xx
56
57config PXA25x
58 bool
59 help
60 Select code specific to PXA21x/25x/26x variants
61
62config PXA27x
63 bool
64 help
65 Select code specific to PXA27x variants
66
67config IWMMXT
68 bool
69 help
70 Enable support for iWMMXt
71
72config PXA_SHARP_C7xx
73 bool
74 help
75 Enable support for all Sharp C7xx models
76
77endif
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
new file mode 100644
index 000000000000..c4e6d2523585
--- /dev/null
+++ b/arch/arm/mach-pxa/Makefile
@@ -0,0 +1,26 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Common support (must be linked before board specific support)
6obj-y += generic.o irq.o dma.o time.o
7obj-$(CONFIG_PXA25x) += pxa25x.o
8obj-$(CONFIG_PXA27x) += pxa27x.o
9
10# Specific board support
11obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
12obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
13obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
14obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o ssp.o
15obj-$(CONFIG_MACH_POODLE) += poodle.o
16
17# Support for blinky lights
18led-y := leds.o
19led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o
20led-$(CONFIG_MACH_MAINSTONE) += leds-mainstone.o
21led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o
22
23obj-$(CONFIG_LEDS) += $(led-y)
24
25# Misc features
26obj-$(CONFIG_PM) += pm.o sleep.o
diff --git a/arch/arm/mach-pxa/Makefile.boot b/arch/arm/mach-pxa/Makefile.boot
new file mode 100644
index 000000000000..1ead67178eca
--- /dev/null
+++ b/arch/arm/mach-pxa/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-y := 0xa0008000
2
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
new file mode 100644
index 000000000000..f691cf77d390
--- /dev/null
+++ b/arch/arm/mach-pxa/corgi.c
@@ -0,0 +1,320 @@
1/*
2 * Support for Sharp SL-C7xx PDAs
3 * Models: SL-C700 (Corgi), SL-C750 (Shepherd), SL-C760 (Husky)
4 *
5 * Copyright (c) 2004-2005 Richard Purdie
6 *
7 * Based on Sharp's 2.4 kernel patches/lubbock.c
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/device.h>
18#include <linux/major.h>
19#include <linux/fs.h>
20#include <linux/interrupt.h>
21#include <linux/mmc/host.h>
22
23#include <asm/setup.h>
24#include <asm/memory.h>
25#include <asm/mach-types.h>
26#include <asm/hardware.h>
27#include <asm/irq.h>
28#include <asm/io.h>
29
30#include <asm/mach/arch.h>
31#include <asm/mach/map.h>
32#include <asm/mach/irq.h>
33
34#include <asm/arch/pxa-regs.h>
35#include <asm/arch/irq.h>
36#include <asm/arch/mmc.h>
37#include <asm/arch/udc.h>
38#include <asm/arch/corgi.h>
39
40#include <asm/mach/sharpsl_param.h>
41#include <asm/hardware/scoop.h>
42#include <video/w100fb.h>
43
44#include "generic.h"
45
46
47/*
48 * Corgi SCOOP Device
49 */
50static struct resource corgi_scoop_resources[] = {
51 [0] = {
52 .start = 0x10800000,
53 .end = 0x10800fff,
54 .flags = IORESOURCE_MEM,
55 },
56};
57
58static struct scoop_config corgi_scoop_setup = {
59 .io_dir = CORGI_SCOOP_IO_DIR,
60 .io_out = CORGI_SCOOP_IO_OUT,
61};
62
63struct platform_device corgiscoop_device = {
64 .name = "sharp-scoop",
65 .id = -1,
66 .dev = {
67 .platform_data = &corgi_scoop_setup,
68 },
69 .num_resources = ARRAY_SIZE(corgi_scoop_resources),
70 .resource = corgi_scoop_resources,
71};
72
73
74/*
75 * Corgi SSP Device
76 *
77 * Set the parent as the scoop device because a lot of SSP devices
78 * also use scoop functions and this makes the power up/down order
79 * work correctly.
80 */
81static struct platform_device corgissp_device = {
82 .name = "corgi-ssp",
83 .dev = {
84 .parent = &corgiscoop_device.dev,
85 },
86 .id = -1,
87};
88
89
90/*
91 * Corgi w100 Frame Buffer Device
92 */
93static struct w100fb_mach_info corgi_fb_info = {
94 .w100fb_ssp_send = corgi_ssp_lcdtg_send,
95 .comadj = -1,
96 .phadadj = -1,
97};
98
99static struct resource corgi_fb_resources[] = {
100 [0] = {
101 .start = 0x08000000,
102 .end = 0x08ffffff,
103 .flags = IORESOURCE_MEM,
104 },
105};
106
107static struct platform_device corgifb_device = {
108 .name = "w100fb",
109 .id = -1,
110 .dev = {
111 .platform_data = &corgi_fb_info,
112 .parent = &corgissp_device.dev,
113 },
114 .num_resources = ARRAY_SIZE(corgi_fb_resources),
115 .resource = corgi_fb_resources,
116};
117
118
119/*
120 * Corgi Backlight Device
121 */
122static struct platform_device corgibl_device = {
123 .name = "corgi-bl",
124 .dev = {
125 .parent = &corgifb_device.dev,
126 },
127 .id = -1,
128};
129
130
131/*
132 * MMC/SD Device
133 *
134 * The card detect interrupt isn't debounced so we delay it by HZ/4
135 * to give the card a chance to fully insert/eject.
136 */
137static struct mmc_detect {
138 struct timer_list detect_timer;
139 void *devid;
140} mmc_detect;
141
142static void mmc_detect_callback(unsigned long data)
143{
144 mmc_detect_change(mmc_detect.devid);
145}
146
147static irqreturn_t corgi_mmc_detect_int(int irq, void *devid, struct pt_regs *regs)
148{
149 mmc_detect.devid=devid;
150 mod_timer(&mmc_detect.detect_timer, jiffies + HZ/4);
151 return IRQ_HANDLED;
152}
153
154static int corgi_mci_init(struct device *dev, irqreturn_t (*unused_detect_int)(int, void *, struct pt_regs *), void *data)
155{
156 int err;
157
158 /* setup GPIO for PXA25x MMC controller */
159 pxa_gpio_mode(GPIO6_MMCCLK_MD);
160 pxa_gpio_mode(GPIO8_MMCCS0_MD);
161 pxa_gpio_mode(CORGI_GPIO_nSD_DETECT | GPIO_IN);
162 pxa_gpio_mode(CORGI_GPIO_SD_PWR | GPIO_OUT);
163
164 init_timer(&mmc_detect.detect_timer);
165 mmc_detect.detect_timer.function = mmc_detect_callback;
166 mmc_detect.detect_timer.data = (unsigned long) &mmc_detect;
167
168 err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_mmc_detect_int, SA_INTERRUPT,
169 "MMC card detect", data);
170 if (err) {
171 printk(KERN_ERR "corgi_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
172 return -1;
173 }
174
175 set_irq_type(CORGI_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);
176
177 return 0;
178}
179
180static void corgi_mci_setpower(struct device *dev, unsigned int vdd)
181{
182 struct pxamci_platform_data* p_d = dev->platform_data;
183
184 if (( 1 << vdd) & p_d->ocr_mask) {
185 printk(KERN_DEBUG "%s: on\n", __FUNCTION__);
186 GPSR1 = GPIO_bit(CORGI_GPIO_SD_PWR);
187 } else {
188 printk(KERN_DEBUG "%s: off\n", __FUNCTION__);
189 GPCR1 = GPIO_bit(CORGI_GPIO_SD_PWR);
190 }
191}
192
193static void corgi_mci_exit(struct device *dev, void *data)
194{
195 free_irq(CORGI_IRQ_GPIO_nSD_DETECT, data);
196 del_timer(&mmc_detect.detect_timer);
197}
198
199static struct pxamci_platform_data corgi_mci_platform_data = {
200 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
201 .init = corgi_mci_init,
202 .setpower = corgi_mci_setpower,
203 .exit = corgi_mci_exit,
204};
205
206
207/*
208 * USB Device Controller
209 */
210static void corgi_udc_command(int cmd)
211{
212 switch(cmd) {
213 case PXA2XX_UDC_CMD_CONNECT:
214 GPSR(CORGI_GPIO_USB_PULLUP) = GPIO_bit(CORGI_GPIO_USB_PULLUP);
215 break;
216 case PXA2XX_UDC_CMD_DISCONNECT:
217 GPCR(CORGI_GPIO_USB_PULLUP) = GPIO_bit(CORGI_GPIO_USB_PULLUP);
218 break;
219 }
220}
221
222static struct pxa2xx_udc_mach_info udc_info __initdata = {
223 /* no connect GPIO; corgi can't tell connection status */
224 .udc_command = corgi_udc_command,
225};
226
227
228static struct platform_device *devices[] __initdata = {
229 &corgiscoop_device,
230 &corgissp_device,
231 &corgifb_device,
232 &corgibl_device,
233};
234
235static void __init corgi_init(void)
236{
237 corgi_fb_info.comadj=sharpsl_param.comadj;
238 corgi_fb_info.phadadj=sharpsl_param.phadadj;
239
240 pxa_gpio_mode(CORGI_GPIO_USB_PULLUP | GPIO_OUT);
241 pxa_set_udc_info(&udc_info);
242 pxa_set_mci_info(&corgi_mci_platform_data);
243
244 platform_add_devices(devices, ARRAY_SIZE(devices));
245}
246
247static void __init fixup_corgi(struct machine_desc *desc,
248 struct tag *tags, char **cmdline, struct meminfo *mi)
249{
250 sharpsl_save_param();
251 mi->nr_banks=1;
252 mi->bank[0].start = 0xa0000000;
253 mi->bank[0].node = 0;
254 if (machine_is_corgi())
255 mi->bank[0].size = (32*1024*1024);
256 else
257 mi->bank[0].size = (64*1024*1024);
258}
259
260static void __init corgi_init_irq(void)
261{
262 pxa_init_irq();
263}
264
265static struct map_desc corgi_io_desc[] __initdata = {
266/* virtual physical length */
267/* { 0xf1000000, 0x08000000, 0x01000000, MT_DEVICE },*/ /* LCDC (readable for Qt driver) */
268/* { 0xef700000, 0x10800000, 0x00001000, MT_DEVICE },*/ /* SCOOP */
269 { 0xef800000, 0x00000000, 0x00800000, MT_DEVICE }, /* Boot Flash */
270};
271
272static void __init corgi_map_io(void)
273{
274 pxa_map_io();
275 iotable_init(corgi_io_desc,ARRAY_SIZE(corgi_io_desc));
276
277 /* setup sleep mode values */
278 PWER = 0x00000002;
279 PFER = 0x00000000;
280 PRER = 0x00000002;
281 PGSR0 = 0x0158C000;
282 PGSR1 = 0x00FF0080;
283 PGSR2 = 0x0001C004;
284 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
285 PCFR |= PCFR_OPDE;
286}
287
288#ifdef CONFIG_MACH_CORGI
289MACHINE_START(CORGI, "SHARP Corgi")
290 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
291 FIXUP(fixup_corgi)
292 MAPIO(corgi_map_io)
293 INITIRQ(corgi_init_irq)
294 .init_machine = corgi_init,
295 .timer = &pxa_timer,
296MACHINE_END
297#endif
298
299#ifdef CONFIG_MACH_SHEPHERD
300MACHINE_START(SHEPHERD, "SHARP Shepherd")
301 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
302 FIXUP(fixup_corgi)
303 MAPIO(corgi_map_io)
304 INITIRQ(corgi_init_irq)
305 .init_machine = corgi_init,
306 .timer = &pxa_timer,
307MACHINE_END
308#endif
309
310#ifdef CONFIG_MACH_HUSKY
311MACHINE_START(HUSKY, "SHARP Husky")
312 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
313 FIXUP(fixup_corgi)
314 MAPIO(corgi_map_io)
315 INITIRQ(corgi_init_irq)
316 .init_machine = corgi_init,
317 .timer = &pxa_timer,
318MACHINE_END
319#endif
320
diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
new file mode 100644
index 000000000000..8ccffba0018f
--- /dev/null
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -0,0 +1,248 @@
1/*
2 * SSP control code for Sharp Corgi devices
3 *
4 * Copyright (c) 2004 Richard Purdie
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/module.h>
13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/slab.h>
17#include <linux/delay.h>
18#include <linux/device.h>
19#include <asm/hardware.h>
20
21#include <asm/arch/ssp.h>
22#include <asm/arch/corgi.h>
23#include <asm/arch/pxa-regs.h>
24
25static spinlock_t corgi_ssp_lock = SPIN_LOCK_UNLOCKED;
26static struct ssp_dev corgi_ssp_dev;
27static struct ssp_state corgi_ssp_state;
28
29/*
30 * There are three devices connected to the SSP interface:
31 * 1. A touchscreen controller (TI ADS7846 compatible)
32 * 2. An LCD contoller (with some Backlight functionality)
33 * 3. A battery moinitoring IC (Maxim MAX1111)
34 *
35 * Each device uses a different speed/mode of communication.
36 *
37 * The touchscreen is very sensitive and the most frequently used
38 * so the port is left configured for this.
39 *
40 * Devices are selected using Chip Selects on GPIOs.
41 */
42
43/*
44 * ADS7846 Routines
45 */
46unsigned long corgi_ssp_ads7846_putget(ulong data)
47{
48 unsigned long ret,flag;
49
50 spin_lock_irqsave(&corgi_ssp_lock, flag);
51 GPCR0 = GPIO_bit(CORGI_GPIO_ADS7846_CS);
52
53 ssp_write_word(&corgi_ssp_dev,data);
54 ret = ssp_read_word(&corgi_ssp_dev);
55
56 GPSR0 = GPIO_bit(CORGI_GPIO_ADS7846_CS);
57 spin_unlock_irqrestore(&corgi_ssp_lock, flag);
58
59 return ret;
60}
61
62/*
63 * NOTE: These functions should always be called in interrupt context
64 * and use the _lock and _unlock functions. They are very time sensitive.
65 */
66void corgi_ssp_ads7846_lock(void)
67{
68 spin_lock(&corgi_ssp_lock);
69 GPCR0 = GPIO_bit(CORGI_GPIO_ADS7846_CS);
70}
71
72void corgi_ssp_ads7846_unlock(void)
73{
74 GPSR0 = GPIO_bit(CORGI_GPIO_ADS7846_CS);
75 spin_unlock(&corgi_ssp_lock);
76}
77
78void corgi_ssp_ads7846_put(ulong data)
79{
80 ssp_write_word(&corgi_ssp_dev,data);
81}
82
83unsigned long corgi_ssp_ads7846_get(void)
84{
85 return ssp_read_word(&corgi_ssp_dev);
86}
87
88EXPORT_SYMBOL(corgi_ssp_ads7846_putget);
89EXPORT_SYMBOL(corgi_ssp_ads7846_lock);
90EXPORT_SYMBOL(corgi_ssp_ads7846_unlock);
91EXPORT_SYMBOL(corgi_ssp_ads7846_put);
92EXPORT_SYMBOL(corgi_ssp_ads7846_get);
93
94
95/*
96 * LCD/Backlight Routines
97 */
98unsigned long corgi_ssp_dac_put(ulong data)
99{
100 unsigned long flag;
101
102 spin_lock_irqsave(&corgi_ssp_lock, flag);
103 GPCR0 = GPIO_bit(CORGI_GPIO_LCDCON_CS);
104
105 ssp_disable(&corgi_ssp_dev);
106 ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), SSCR1_SPH, 0, SSCR0_SerClkDiv(76));
107 ssp_enable(&corgi_ssp_dev);
108
109 ssp_write_word(&corgi_ssp_dev,data);
110 /* Read null data back from device to prevent SSP overflow */
111 ssp_read_word(&corgi_ssp_dev);
112
113 ssp_disable(&corgi_ssp_dev);
114 ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(2));
115 ssp_enable(&corgi_ssp_dev);
116 GPSR0 = GPIO_bit(CORGI_GPIO_LCDCON_CS);
117 spin_unlock_irqrestore(&corgi_ssp_lock, flag);
118
119 return 0;
120}
121
122void corgi_ssp_lcdtg_send(u8 adrs, u8 data)
123{
124 corgi_ssp_dac_put(((adrs & 0x07) << 5) | (data & 0x1f));
125}
126
127void corgi_ssp_blduty_set(int duty)
128{
129 corgi_ssp_lcdtg_send(0x02,duty);
130}
131
132EXPORT_SYMBOL(corgi_ssp_lcdtg_send);
133EXPORT_SYMBOL(corgi_ssp_blduty_set);
134
135/*
136 * Max1111 Routines
137 */
138int corgi_ssp_max1111_get(ulong data)
139{
140 unsigned long flag;
141 int voltage,voltage1,voltage2;
142
143 spin_lock_irqsave(&corgi_ssp_lock, flag);
144 GPCR0 = GPIO_bit(CORGI_GPIO_MAX1111_CS);
145 ssp_disable(&corgi_ssp_dev);
146 ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), 0, 0, SSCR0_SerClkDiv(8));
147 ssp_enable(&corgi_ssp_dev);
148
149 udelay(1);
150
151 /* TB1/RB1 */
152 ssp_write_word(&corgi_ssp_dev,data);
153 ssp_read_word(&corgi_ssp_dev); /* null read */
154
155 /* TB12/RB2 */
156 ssp_write_word(&corgi_ssp_dev,0);
157 voltage1=ssp_read_word(&corgi_ssp_dev);
158
159 /* TB13/RB3*/
160 ssp_write_word(&corgi_ssp_dev,0);
161 voltage2=ssp_read_word(&corgi_ssp_dev);
162
163 ssp_disable(&corgi_ssp_dev);
164 ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(2));
165 ssp_enable(&corgi_ssp_dev);
166 GPSR0 = GPIO_bit(CORGI_GPIO_MAX1111_CS);
167 spin_unlock_irqrestore(&corgi_ssp_lock, flag);
168
169 if (voltage1 & 0xc0 || voltage2 & 0x3f)
170 voltage = -1;
171 else
172 voltage = ((voltage1 << 2) & 0xfc) | ((voltage2 >> 6) & 0x03);
173
174 return voltage;
175}
176
177EXPORT_SYMBOL(corgi_ssp_max1111_get);
178
179/*
180 * Support Routines
181 */
182int __init corgi_ssp_probe(struct device *dev)
183{
184 int ret;
185
186 /* Chip Select - Disable All */
187 GPDR0 |= GPIO_bit(CORGI_GPIO_LCDCON_CS); /* output */
188 GPSR0 = GPIO_bit(CORGI_GPIO_LCDCON_CS); /* High - Disable LCD Control/Timing Gen */
189 GPDR0 |= GPIO_bit(CORGI_GPIO_MAX1111_CS); /* output */
190 GPSR0 = GPIO_bit(CORGI_GPIO_MAX1111_CS); /* High - Disable MAX1111*/
191 GPDR0 |= GPIO_bit(CORGI_GPIO_ADS7846_CS); /* output */
192 GPSR0 = GPIO_bit(CORGI_GPIO_ADS7846_CS); /* High - Disable ADS7846*/
193
194 ret=ssp_init(&corgi_ssp_dev,1);
195
196 if (ret)
197 printk(KERN_ERR "Unable to register SSP handler!\n");
198 else {
199 ssp_disable(&corgi_ssp_dev);
200 ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(2));
201 ssp_enable(&corgi_ssp_dev);
202 }
203
204 return ret;
205}
206
207static int corgi_ssp_remove(struct device *dev)
208{
209 ssp_exit(&corgi_ssp_dev);
210 return 0;
211}
212
213static int corgi_ssp_suspend(struct device *dev, pm_message_t state, u32 level)
214{
215 if (level == SUSPEND_POWER_DOWN) {
216 ssp_flush(&corgi_ssp_dev);
217 ssp_save_state(&corgi_ssp_dev,&corgi_ssp_state);
218 }
219 return 0;
220}
221
222static int corgi_ssp_resume(struct device *dev, u32 level)
223{
224 if (level == RESUME_POWER_ON) {
225 GPSR0 = GPIO_bit(CORGI_GPIO_LCDCON_CS); /* High - Disable LCD Control/Timing Gen */
226 GPSR0 = GPIO_bit(CORGI_GPIO_MAX1111_CS); /* High - Disable MAX1111*/
227 GPSR0 = GPIO_bit(CORGI_GPIO_ADS7846_CS); /* High - Disable ADS7846*/
228 ssp_restore_state(&corgi_ssp_dev,&corgi_ssp_state);
229 ssp_enable(&corgi_ssp_dev);
230 }
231 return 0;
232}
233
234static struct device_driver corgissp_driver = {
235 .name = "corgi-ssp",
236 .bus = &platform_bus_type,
237 .probe = corgi_ssp_probe,
238 .remove = corgi_ssp_remove,
239 .suspend = corgi_ssp_suspend,
240 .resume = corgi_ssp_resume,
241};
242
243int __init corgi_ssp_init(void)
244{
245 return driver_register(&corgissp_driver);
246}
247
248arch_initcall(corgi_ssp_init);
diff --git a/arch/arm/mach-pxa/dma.c b/arch/arm/mach-pxa/dma.c
new file mode 100644
index 000000000000..458112b21e25
--- /dev/null
+++ b/arch/arm/mach-pxa/dma.c
@@ -0,0 +1,133 @@
1/*
2 * linux/arch/arm/mach-pxa/dma.c
3 *
4 * PXA DMA registration and IRQ dispatching
5 *
6 * Author: Nicolas Pitre
7 * Created: Nov 15, 2001
8 * Copyright: MontaVista Software Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/module.h>
16#include <linux/init.h>
17#include <linux/kernel.h>
18#include <linux/interrupt.h>
19#include <linux/errno.h>
20
21#include <asm/system.h>
22#include <asm/irq.h>
23#include <asm/hardware.h>
24#include <asm/dma.h>
25
26#include <asm/arch/pxa-regs.h>
27
28static struct dma_channel {
29 char *name;
30 void (*irq_handler)(int, void *, struct pt_regs *);
31 void *data;
32} dma_channels[PXA_DMA_CHANNELS];
33
34
35int pxa_request_dma (char *name, pxa_dma_prio prio,
36 void (*irq_handler)(int, void *, struct pt_regs *),
37 void *data)
38{
39 unsigned long flags;
40 int i, found = 0;
41
42 /* basic sanity checks */
43 if (!name || !irq_handler)
44 return -EINVAL;
45
46 local_irq_save(flags);
47
48 /* try grabbing a DMA channel with the requested priority */
49 for (i = prio; i < prio + PXA_DMA_NBCH(prio); i++) {
50 if (!dma_channels[i].name) {
51 found = 1;
52 break;
53 }
54 }
55
56 if (!found) {
57 /* requested prio group is full, try hier priorities */
58 for (i = prio-1; i >= 0; i--) {
59 if (!dma_channels[i].name) {
60 found = 1;
61 break;
62 }
63 }
64 }
65
66 if (found) {
67 DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
68 dma_channels[i].name = name;
69 dma_channels[i].irq_handler = irq_handler;
70 dma_channels[i].data = data;
71 } else {
72 printk (KERN_WARNING "No more available DMA channels for %s\n", name);
73 i = -ENODEV;
74 }
75
76 local_irq_restore(flags);
77 return i;
78}
79
80void pxa_free_dma (int dma_ch)
81{
82 unsigned long flags;
83
84 if (!dma_channels[dma_ch].name) {
85 printk (KERN_CRIT
86 "%s: trying to free channel %d which is already freed\n",
87 __FUNCTION__, dma_ch);
88 return;
89 }
90
91 local_irq_save(flags);
92 DCSR(dma_ch) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
93 dma_channels[dma_ch].name = NULL;
94 local_irq_restore(flags);
95}
96
97static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
98{
99 int i, dint = DINT;
100
101 for (i = 0; i < PXA_DMA_CHANNELS; i++) {
102 if (dint & (1 << i)) {
103 struct dma_channel *channel = &dma_channels[i];
104 if (channel->name && channel->irq_handler) {
105 channel->irq_handler(i, channel->data, regs);
106 } else {
107 /*
108 * IRQ for an unregistered DMA channel:
109 * let's clear the interrupts and disable it.
110 */
111 printk (KERN_WARNING "spurious IRQ for DMA channel %d\n", i);
112 DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
113 }
114 }
115 }
116 return IRQ_HANDLED;
117}
118
119static int __init pxa_dma_init (void)
120{
121 int ret;
122
123 ret = request_irq (IRQ_DMA, dma_irq_handler, 0, "DMA", NULL);
124 if (ret)
125 printk (KERN_CRIT "Wow! Can't register IRQ for DMA\n");
126 return ret;
127}
128
129arch_initcall(pxa_dma_init);
130
131EXPORT_SYMBOL(pxa_request_dma);
132EXPORT_SYMBOL(pxa_free_dma);
133
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
new file mode 100644
index 000000000000..b1575b8dc1cd
--- /dev/null
+++ b/arch/arm/mach-pxa/generic.c
@@ -0,0 +1,237 @@
1/*
2 * linux/arch/arm/mach-pxa/generic.c
3 *
4 * Author: Nicolas Pitre
5 * Created: Jun 15, 2001
6 * Copyright: MontaVista Software Inc.
7 *
8 * Code common to all PXA machines.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * Since this file should be linked before any other machine specific file,
15 * the __initcall() here will be executed first. This serves as default
16 * initialization stuff for PXA machines which can be overridden later if
17 * need be.
18 */
19#include <linux/module.h>
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/delay.h>
23#include <linux/device.h>
24#include <linux/ioport.h>
25#include <linux/pm.h>
26
27#include <asm/hardware.h>
28#include <asm/irq.h>
29#include <asm/system.h>
30#include <asm/pgtable.h>
31#include <asm/mach/map.h>
32
33#include <asm/arch/pxa-regs.h>
34#include <asm/arch/udc.h>
35#include <asm/arch/pxafb.h>
36#include <asm/arch/mmc.h>
37
38#include "generic.h"
39
40/*
41 * Handy function to set GPIO alternate functions
42 */
43
44void pxa_gpio_mode(int gpio_mode)
45{
46 unsigned long flags;
47 int gpio = gpio_mode & GPIO_MD_MASK_NR;
48 int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8;
49 int gafr;
50
51 local_irq_save(flags);
52 if (gpio_mode & GPIO_DFLT_LOW)
53 GPCR(gpio) = GPIO_bit(gpio);
54 else if (gpio_mode & GPIO_DFLT_HIGH)
55 GPSR(gpio) = GPIO_bit(gpio);
56 if (gpio_mode & GPIO_MD_MASK_DIR)
57 GPDR(gpio) |= GPIO_bit(gpio);
58 else
59 GPDR(gpio) &= ~GPIO_bit(gpio);
60 gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2));
61 GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2));
62 local_irq_restore(flags);
63}
64
65EXPORT_SYMBOL(pxa_gpio_mode);
66
67/*
68 * Routine to safely enable or disable a clock in the CKEN
69 */
70void pxa_set_cken(int clock, int enable)
71{
72 unsigned long flags;
73 local_irq_save(flags);
74
75 if (enable)
76 CKEN |= clock;
77 else
78 CKEN &= ~clock;
79
80 local_irq_restore(flags);
81}
82
83EXPORT_SYMBOL(pxa_set_cken);
84
85/*
86 * Intel PXA2xx internal register mapping.
87 *
88 * Note 1: not all PXA2xx variants implement all those addresses.
89 *
90 * Note 2: virtual 0xfffe0000-0xffffffff is reserved for the vector table
91 * and cache flush area.
92 */
93static struct map_desc standard_io_desc[] __initdata = {
94 /* virtual physical length type */
95 { 0xf2000000, 0x40000000, 0x02000000, MT_DEVICE }, /* Devs */
96 { 0xf4000000, 0x44000000, 0x00100000, MT_DEVICE }, /* LCD */
97 { 0xf6000000, 0x48000000, 0x00100000, MT_DEVICE }, /* Mem Ctl */
98 { 0xf8000000, 0x4c000000, 0x00100000, MT_DEVICE }, /* USB host */
99 { 0xfa000000, 0x50000000, 0x00100000, MT_DEVICE }, /* Camera */
100 { 0xfe000000, 0x58000000, 0x00100000, MT_DEVICE }, /* IMem ctl */
101 { 0xff000000, 0x00000000, 0x00100000, MT_DEVICE } /* UNCACHED_PHYS_0 */
102};
103
104void __init pxa_map_io(void)
105{
106 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
107 get_clk_frequency_khz(1);
108}
109
110
111static struct resource pxamci_resources[] = {
112 [0] = {
113 .start = 0x41100000,
114 .end = 0x41100fff,
115 .flags = IORESOURCE_MEM,
116 },
117 [1] = {
118 .start = IRQ_MMC,
119 .end = IRQ_MMC,
120 .flags = IORESOURCE_IRQ,
121 },
122};
123
124static u64 pxamci_dmamask = 0xffffffffUL;
125
126static struct platform_device pxamci_device = {
127 .name = "pxa2xx-mci",
128 .id = -1,
129 .dev = {
130 .dma_mask = &pxamci_dmamask,
131 .coherent_dma_mask = 0xffffffff,
132 },
133 .num_resources = ARRAY_SIZE(pxamci_resources),
134 .resource = pxamci_resources,
135};
136
137void __init pxa_set_mci_info(struct pxamci_platform_data *info)
138{
139 pxamci_device.dev.platform_data = info;
140}
141
142
143static struct pxa2xx_udc_mach_info pxa_udc_info;
144
145void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info)
146{
147 memcpy(&pxa_udc_info, info, sizeof *info);
148}
149
150static struct resource pxa2xx_udc_resources[] = {
151 [0] = {
152 .start = 0x40600000,
153 .end = 0x4060ffff,
154 .flags = IORESOURCE_MEM,
155 },
156 [1] = {
157 .start = IRQ_USB,
158 .end = IRQ_USB,
159 .flags = IORESOURCE_IRQ,
160 },
161};
162
163static u64 udc_dma_mask = ~(u32)0;
164
165static struct platform_device udc_device = {
166 .name = "pxa2xx-udc",
167 .id = -1,
168 .resource = pxa2xx_udc_resources,
169 .num_resources = ARRAY_SIZE(pxa2xx_udc_resources),
170 .dev = {
171 .platform_data = &pxa_udc_info,
172 .dma_mask = &udc_dma_mask,
173 }
174};
175
176static struct pxafb_mach_info pxa_fb_info;
177
178void __init set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info)
179{
180 memcpy(&pxa_fb_info,hard_pxa_fb_info,sizeof(struct pxafb_mach_info));
181}
182
183static struct resource pxafb_resources[] = {
184 [0] = {
185 .start = 0x44000000,
186 .end = 0x4400ffff,
187 .flags = IORESOURCE_MEM,
188 },
189 [1] = {
190 .start = IRQ_LCD,
191 .end = IRQ_LCD,
192 .flags = IORESOURCE_IRQ,
193 },
194};
195
196static u64 fb_dma_mask = ~(u64)0;
197
198static struct platform_device pxafb_device = {
199 .name = "pxa2xx-fb",
200 .id = -1,
201 .dev = {
202 .platform_data = &pxa_fb_info,
203 .dma_mask = &fb_dma_mask,
204 .coherent_dma_mask = 0xffffffff,
205 },
206 .num_resources = ARRAY_SIZE(pxafb_resources),
207 .resource = pxafb_resources,
208};
209
210static struct platform_device ffuart_device = {
211 .name = "pxa2xx-uart",
212 .id = 0,
213};
214static struct platform_device btuart_device = {
215 .name = "pxa2xx-uart",
216 .id = 1,
217};
218static struct platform_device stuart_device = {
219 .name = "pxa2xx-uart",
220 .id = 2,
221};
222
223static struct platform_device *devices[] __initdata = {
224 &pxamci_device,
225 &udc_device,
226 &pxafb_device,
227 &ffuart_device,
228 &btuart_device,
229 &stuart_device,
230};
231
232static int __init pxa_init(void)
233{
234 return platform_add_devices(devices, ARRAY_SIZE(devices));
235}
236
237subsys_initcall(pxa_init);
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
new file mode 100644
index 000000000000..e54a8dd63c17
--- /dev/null
+++ b/arch/arm/mach-pxa/generic.h
@@ -0,0 +1,24 @@
1/*
2 * linux/arch/arm/mach-pxa/generic.h
3 *
4 * Author: Nicolas Pitre
5 * Copyright: MontaVista Software Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12struct sys_timer;
13
14extern struct sys_timer pxa_timer;
15extern void __init pxa_map_io(void);
16extern void __init pxa_init_irq(void);
17
18extern unsigned int get_clk_frequency_khz(int info);
19
20#define SET_BANK(__nr,__start,__size) \
21 mi->bank[__nr].start = (__start), \
22 mi->bank[__nr].size = (__size), \
23 mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27)
24
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
new file mode 100644
index 000000000000..c5a66bf4d3d5
--- /dev/null
+++ b/arch/arm/mach-pxa/idp.c
@@ -0,0 +1,190 @@
1/*
2 * linux/arch/arm/mach-pxa/idp.c
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Copyright (c) 2001 Cliff Brake, Accelent Systems Inc.
9 *
10 * 2001-09-13: Cliff Brake <cbrake@accelent.com>
11 * Initial code
12 *
13 * 2005-02-15: Cliff Brake <cliff.brake@gmail.com>
14 * <http://www.vibren.com> <http://bec-systems.com>
15 * Updated for 2.6 kernel
16 *
17 */
18
19#include <linux/init.h>
20#include <linux/interrupt.h>
21#include <linux/device.h>
22#include <linux/fb.h>
23
24#include <asm/setup.h>
25#include <asm/memory.h>
26#include <asm/mach-types.h>
27#include <asm/hardware.h>
28#include <asm/irq.h>
29
30#include <asm/mach/arch.h>
31#include <asm/mach/map.h>
32
33#include <asm/arch/pxa-regs.h>
34#include <asm/arch/idp.h>
35#include <asm/arch/pxafb.h>
36#include <asm/arch/bitfield.h>
37#include <asm/arch/mmc.h>
38
39#include "generic.h"
40
41/* TODO:
42 * - add pxa2xx_audio_ops_t device structure
43 * - Ethernet interrupt
44 */
45
46static struct resource smc91x_resources[] = {
47 [0] = {
48 .start = (IDP_ETH_PHYS + 0x300),
49 .end = (IDP_ETH_PHYS + 0xfffff),
50 .flags = IORESOURCE_MEM,
51 },
52 [1] = {
53 .start = IRQ_GPIO(4),
54 .end = IRQ_GPIO(4),
55 .flags = IORESOURCE_IRQ,
56 }
57};
58
59static struct platform_device smc91x_device = {
60 .name = "smc91x",
61 .id = 0,
62 .num_resources = ARRAY_SIZE(smc91x_resources),
63 .resource = smc91x_resources,
64};
65
66static void idp_backlight_power(int on)
67{
68 if (on) {
69 IDP_CPLD_LCD |= (1<<1);
70 } else {
71 IDP_CPLD_LCD &= ~(1<<1);
72 }
73}
74
75static void idp_vlcd(int on)
76{
77 if (on) {
78 IDP_CPLD_LCD |= (1<<2);
79 } else {
80 IDP_CPLD_LCD &= ~(1<<2);
81 }
82}
83
84static void idp_lcd_power(int on)
85{
86 if (on) {
87 IDP_CPLD_LCD |= (1<<0);
88 } else {
89 IDP_CPLD_LCD &= ~(1<<0);
90 }
91
92 /* call idp_vlcd for now as core driver does not support
93 * both power and vlcd hooks. Note, this is not technically
94 * the correct sequence, but seems to work. Disclaimer:
95 * this may eventually damage the display.
96 */
97
98 idp_vlcd(on);
99}
100
101static struct pxafb_mach_info sharp_lm8v31 __initdata = {
102 .pixclock = 270000,
103 .xres = 640,
104 .yres = 480,
105 .bpp = 16,
106 .hsync_len = 1,
107 .left_margin = 3,
108 .right_margin = 3,
109 .vsync_len = 1,
110 .upper_margin = 0,
111 .lower_margin = 0,
112 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
113 .cmap_greyscale = 0,
114 .cmap_inverse = 0,
115 .cmap_static = 0,
116 .lccr0 = LCCR0_SDS,
117 .lccr3 = LCCR3_PCP | LCCR3_Acb(255),
118 .pxafb_backlight_power = &idp_backlight_power,
119 .pxafb_lcd_power = &idp_lcd_power
120};
121
122static int idp_mci_init(struct device *dev, irqreturn_t (*idp_detect_int)(int, void *, struct pt_regs *), void *data)
123{
124 /* setup GPIO for PXA25x MMC controller */
125 pxa_gpio_mode(GPIO6_MMCCLK_MD);
126 pxa_gpio_mode(GPIO8_MMCCS0_MD);
127
128 return 0;
129}
130
131static struct pxamci_platform_data idp_mci_platform_data = {
132 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
133 .init = idp_mci_init,
134};
135
136static void __init idp_init(void)
137{
138 printk("idp_init()\n");
139
140 platform_device_register(&smc91x_device);
141 //platform_device_register(&mst_audio_device);
142 set_pxa_fb_info(&sharp_lm8v31);
143 pxa_set_mci_info(&idp_mci_platform_data);
144}
145
146static void __init idp_init_irq(void)
147{
148
149 pxa_init_irq();
150
151 set_irq_type(TOUCH_PANEL_IRQ, TOUCH_PANEL_IRQ_EDGE);
152}
153
154static struct map_desc idp_io_desc[] __initdata = {
155 /* virtual physical length type */
156
157 { IDP_COREVOLT_VIRT,
158 IDP_COREVOLT_PHYS,
159 IDP_COREVOLT_SIZE,
160 MT_DEVICE },
161 { IDP_CPLD_VIRT,
162 IDP_CPLD_PHYS,
163 IDP_CPLD_SIZE,
164 MT_DEVICE }
165};
166
167static void __init idp_map_io(void)
168{
169 pxa_map_io();
170 iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc));
171
172 // serial ports 2 & 3
173 pxa_gpio_mode(GPIO42_BTRXD_MD);
174 pxa_gpio_mode(GPIO43_BTTXD_MD);
175 pxa_gpio_mode(GPIO44_BTCTS_MD);
176 pxa_gpio_mode(GPIO45_BTRTS_MD);
177 pxa_gpio_mode(GPIO46_STRXD_MD);
178 pxa_gpio_mode(GPIO47_STTXD_MD);
179
180}
181
182
183MACHINE_START(PXA_IDP, "Vibren PXA255 IDP")
184 MAINTAINER("Vibren Technologies")
185 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
186 MAPIO(idp_map_io)
187 INITIRQ(idp_init_irq)
188 .timer = &pxa_timer,
189 INIT_MACHINE(idp_init)
190MACHINE_END
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
new file mode 100644
index 000000000000..f3cac43124a5
--- /dev/null
+++ b/arch/arm/mach-pxa/irq.c
@@ -0,0 +1,313 @@
1/*
2 * linux/arch/arm/mach-pxa/irq.c
3 *
4 * Generic PXA IRQ handling, GPIO IRQ demultiplexing, etc.
5 *
6 * Author: Nicolas Pitre
7 * Created: Jun 15, 2001
8 * Copyright: MontaVista Software Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/interrupt.h>
18#include <linux/ptrace.h>
19
20#include <asm/hardware.h>
21#include <asm/irq.h>
22#include <asm/mach/irq.h>
23#include <asm/arch/pxa-regs.h>
24
25#include "generic.h"
26
27
28/*
29 * This is for peripheral IRQs internal to the PXA chip.
30 */
31
32static void pxa_mask_low_irq(unsigned int irq)
33{
34 ICMR &= ~(1 << (irq + PXA_IRQ_SKIP));
35}
36
37static void pxa_unmask_low_irq(unsigned int irq)
38{
39 ICMR |= (1 << (irq + PXA_IRQ_SKIP));
40}
41
42static struct irqchip pxa_internal_chip_low = {
43 .ack = pxa_mask_low_irq,
44 .mask = pxa_mask_low_irq,
45 .unmask = pxa_unmask_low_irq,
46};
47
48#if PXA_INTERNAL_IRQS > 32
49
50/*
51 * This is for the second set of internal IRQs as found on the PXA27x.
52 */
53
54static void pxa_mask_high_irq(unsigned int irq)
55{
56 ICMR2 &= ~(1 << (irq - 32 + PXA_IRQ_SKIP));
57}
58
59static void pxa_unmask_high_irq(unsigned int irq)
60{
61 ICMR2 |= (1 << (irq - 32 + PXA_IRQ_SKIP));
62}
63
64static struct irqchip pxa_internal_chip_high = {
65 .ack = pxa_mask_high_irq,
66 .mask = pxa_mask_high_irq,
67 .unmask = pxa_unmask_high_irq,
68};
69
70#endif
71
72/*
73 * PXA GPIO edge detection for IRQs:
74 * IRQs are generated on Falling-Edge, Rising-Edge, or both.
75 * Use this instead of directly setting GRER/GFER.
76 */
77
78static long GPIO_IRQ_rising_edge[4];
79static long GPIO_IRQ_falling_edge[4];
80static long GPIO_IRQ_mask[4];
81
82static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
83{
84 int gpio, idx;
85
86 gpio = IRQ_TO_GPIO(irq);
87 idx = gpio >> 5;
88
89 if (type == IRQT_PROBE) {
90 /* Don't mess with enabled GPIOs using preconfigured edges or
91 GPIOs set to alternate function during probe */
92 if ((GPIO_IRQ_rising_edge[idx] | GPIO_IRQ_falling_edge[idx]) &
93 GPIO_bit(gpio))
94 return 0;
95 if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2)))
96 return 0;
97 type = __IRQT_RISEDGE | __IRQT_FALEDGE;
98 }
99
100 /* printk(KERN_DEBUG "IRQ%d (GPIO%d): ", irq, gpio); */
101
102 pxa_gpio_mode(gpio | GPIO_IN);
103
104 if (type & __IRQT_RISEDGE) {
105 /* printk("rising "); */
106 __set_bit (gpio, GPIO_IRQ_rising_edge);
107 } else
108 __clear_bit (gpio, GPIO_IRQ_rising_edge);
109
110 if (type & __IRQT_FALEDGE) {
111 /* printk("falling "); */
112 __set_bit (gpio, GPIO_IRQ_falling_edge);
113 } else
114 __clear_bit (gpio, GPIO_IRQ_falling_edge);
115
116 /* printk("edges\n"); */
117
118 GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
119 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
120 return 0;
121}
122
123/*
124 * GPIO IRQs must be acknowledged. This is for GPIO 0 and 1.
125 */
126
127static void pxa_ack_low_gpio(unsigned int irq)
128{
129 GEDR0 = (1 << (irq - IRQ_GPIO0));
130}
131
132static struct irqchip pxa_low_gpio_chip = {
133 .ack = pxa_ack_low_gpio,
134 .mask = pxa_mask_low_irq,
135 .unmask = pxa_unmask_low_irq,
136 .type = pxa_gpio_irq_type,
137};
138
139/*
140 * Demux handler for GPIO>=2 edge detect interrupts
141 */
142
143static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
144 struct pt_regs *regs)
145{
146 unsigned int mask;
147 int loop;
148
149 do {
150 loop = 0;
151
152 mask = GEDR0 & ~3;
153 if (mask) {
154 GEDR0 = mask;
155 irq = IRQ_GPIO(2);
156 desc = irq_desc + irq;
157 mask >>= 2;
158 do {
159 if (mask & 1)
160 desc->handle(irq, desc, regs);
161 irq++;
162 desc++;
163 mask >>= 1;
164 } while (mask);
165 loop = 1;
166 }
167
168 mask = GEDR1;
169 if (mask) {
170 GEDR1 = mask;
171 irq = IRQ_GPIO(32);
172 desc = irq_desc + irq;
173 do {
174 if (mask & 1)
175 desc->handle(irq, desc, regs);
176 irq++;
177 desc++;
178 mask >>= 1;
179 } while (mask);
180 loop = 1;
181 }
182
183 mask = GEDR2;
184 if (mask) {
185 GEDR2 = mask;
186 irq = IRQ_GPIO(64);
187 desc = irq_desc + irq;
188 do {
189 if (mask & 1)
190 desc->handle(irq, desc, regs);
191 irq++;
192 desc++;
193 mask >>= 1;
194 } while (mask);
195 loop = 1;
196 }
197
198#if PXA_LAST_GPIO >= 96
199 mask = GEDR3;
200 if (mask) {
201 GEDR3 = mask;
202 irq = IRQ_GPIO(96);
203 desc = irq_desc + irq;
204 do {
205 if (mask & 1)
206 desc->handle(irq, desc, regs);
207 irq++;
208 desc++;
209 mask >>= 1;
210 } while (mask);
211 loop = 1;
212 }
213#endif
214 } while (loop);
215}
216
217static void pxa_ack_muxed_gpio(unsigned int irq)
218{
219 int gpio = irq - IRQ_GPIO(2) + 2;
220 GEDR(gpio) = GPIO_bit(gpio);
221}
222
223static void pxa_mask_muxed_gpio(unsigned int irq)
224{
225 int gpio = irq - IRQ_GPIO(2) + 2;
226 __clear_bit(gpio, GPIO_IRQ_mask);
227 GRER(gpio) &= ~GPIO_bit(gpio);
228 GFER(gpio) &= ~GPIO_bit(gpio);
229}
230
231static void pxa_unmask_muxed_gpio(unsigned int irq)
232{
233 int gpio = irq - IRQ_GPIO(2) + 2;
234 int idx = gpio >> 5;
235 __set_bit(gpio, GPIO_IRQ_mask);
236 GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
237 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
238}
239
240static struct irqchip pxa_muxed_gpio_chip = {
241 .ack = pxa_ack_muxed_gpio,
242 .mask = pxa_mask_muxed_gpio,
243 .unmask = pxa_unmask_muxed_gpio,
244 .type = pxa_gpio_irq_type,
245};
246
247
248void __init pxa_init_irq(void)
249{
250 int irq;
251
252 /* disable all IRQs */
253 ICMR = 0;
254
255 /* all IRQs are IRQ, not FIQ */
256 ICLR = 0;
257
258 /* clear all GPIO edge detects */
259 GFER0 = 0;
260 GFER1 = 0;
261 GFER2 = 0;
262 GRER0 = 0;
263 GRER1 = 0;
264 GRER2 = 0;
265 GEDR0 = GEDR0;
266 GEDR1 = GEDR1;
267 GEDR2 = GEDR2;
268
269#ifdef CONFIG_PXA27x
270 /* And similarly for the extra regs on the PXA27x */
271 ICMR2 = 0;
272 ICLR2 = 0;
273 GFER3 = 0;
274 GRER3 = 0;
275 GEDR3 = GEDR3;
276#endif
277
278 /* only unmasked interrupts kick us out of idle */
279 ICCR = 1;
280
281 /* GPIO 0 and 1 must have their mask bit always set */
282 GPIO_IRQ_mask[0] = 3;
283
284 for (irq = PXA_IRQ(PXA_IRQ_SKIP); irq <= PXA_IRQ(31); irq++) {
285 set_irq_chip(irq, &pxa_internal_chip_low);
286 set_irq_handler(irq, do_level_IRQ);
287 set_irq_flags(irq, IRQF_VALID);
288 }
289
290#if PXA_INTERNAL_IRQS > 32
291 for (irq = PXA_IRQ(32); irq < PXA_IRQ(PXA_INTERNAL_IRQS); irq++) {
292 set_irq_chip(irq, &pxa_internal_chip_high);
293 set_irq_handler(irq, do_level_IRQ);
294 set_irq_flags(irq, IRQF_VALID);
295 }
296#endif
297
298 for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
299 set_irq_chip(irq, &pxa_low_gpio_chip);
300 set_irq_handler(irq, do_edge_IRQ);
301 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
302 }
303
304 for (irq = IRQ_GPIO(2); irq <= IRQ_GPIO(PXA_LAST_GPIO); irq++) {
305 set_irq_chip(irq, &pxa_muxed_gpio_chip);
306 set_irq_handler(irq, do_edge_IRQ);
307 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
308 }
309
310 /* Install handler for GPIO>=2 edge detect interrupts */
311 set_irq_chip(IRQ_GPIO_2_x, &pxa_internal_chip_low);
312 set_irq_chained_handler(IRQ_GPIO_2_x, pxa_gpio_demux_handler);
313}
diff --git a/arch/arm/mach-pxa/leds-idp.c b/arch/arm/mach-pxa/leds-idp.c
new file mode 100644
index 000000000000..5eba6ea0b0f7
--- /dev/null
+++ b/arch/arm/mach-pxa/leds-idp.c
@@ -0,0 +1,117 @@
1/*
2 * linux/arch/arm/mach-pxa/leds-idp.c
3 *
4 * Copyright (C) 2000 John Dorsey <john+@cs.cmu.edu>
5 *
6 * Copyright (c) 2001 Jeff Sutherland <jeffs@accelent.com>
7 *
8 * Original (leds-footbridge.c) by Russell King
9 *
10 * Macros for actual LED manipulation should be in machine specific
11 * files in this 'mach' directory.
12 */
13
14
15#include <linux/config.h>
16#include <linux/init.h>
17
18#include <asm/hardware.h>
19#include <asm/leds.h>
20#include <asm/system.h>
21
22#include <asm/arch/pxa-regs.h>
23#include <asm/arch/idp.h>
24
25#include "leds.h"
26
27#define LED_STATE_ENABLED 1
28#define LED_STATE_CLAIMED 2
29
30static unsigned int led_state;
31static unsigned int hw_led_state;
32
33void idp_leds_event(led_event_t evt)
34{
35 unsigned long flags;
36
37 local_irq_save(flags);
38
39 switch (evt) {
40 case led_start:
41 hw_led_state = IDP_HB_LED | IDP_BUSY_LED;
42 led_state = LED_STATE_ENABLED;
43 break;
44
45 case led_stop:
46 led_state &= ~LED_STATE_ENABLED;
47 break;
48
49 case led_claim:
50 led_state |= LED_STATE_CLAIMED;
51 hw_led_state = IDP_HB_LED | IDP_BUSY_LED;
52 break;
53
54 case led_release:
55 led_state &= ~LED_STATE_CLAIMED;
56 hw_led_state = IDP_HB_LED | IDP_BUSY_LED;
57 break;
58
59#ifdef CONFIG_LEDS_TIMER
60 case led_timer:
61 if (!(led_state & LED_STATE_CLAIMED))
62 hw_led_state ^= IDP_HB_LED;
63 break;
64#endif
65
66#ifdef CONFIG_LEDS_CPU
67 case led_idle_start:
68 if (!(led_state & LED_STATE_CLAIMED))
69 hw_led_state &= ~IDP_BUSY_LED;
70 break;
71
72 case led_idle_end:
73 if (!(led_state & LED_STATE_CLAIMED))
74 hw_led_state |= IDP_BUSY_LED;
75 break;
76#endif
77
78 case led_halted:
79 break;
80
81 case led_green_on:
82 if (led_state & LED_STATE_CLAIMED)
83 hw_led_state |= IDP_HB_LED;
84 break;
85
86 case led_green_off:
87 if (led_state & LED_STATE_CLAIMED)
88 hw_led_state &= ~IDP_HB_LED;
89 break;
90
91 case led_amber_on:
92 break;
93
94 case led_amber_off:
95 break;
96
97 case led_red_on:
98 if (led_state & LED_STATE_CLAIMED)
99 hw_led_state |= IDP_BUSY_LED;
100 break;
101
102 case led_red_off:
103 if (led_state & LED_STATE_CLAIMED)
104 hw_led_state &= ~IDP_BUSY_LED;
105 break;
106
107 default:
108 break;
109 }
110
111 if (led_state & LED_STATE_ENABLED)
112 IDP_CPLD_LED_CONTROL = ( (IDP_CPLD_LED_CONTROL | IDP_LEDS_MASK) & ~hw_led_state);
113 else
114 IDP_CPLD_LED_CONTROL |= IDP_LEDS_MASK;
115
116 local_irq_restore(flags);
117}
diff --git a/arch/arm/mach-pxa/leds-lubbock.c b/arch/arm/mach-pxa/leds-lubbock.c
new file mode 100644
index 000000000000..05cf56059a0f
--- /dev/null
+++ b/arch/arm/mach-pxa/leds-lubbock.c
@@ -0,0 +1,126 @@
1/*
2 * linux/arch/arm/mach-pxa/leds-lubbock.c
3 *
4 * Copyright (C) 2000 John Dorsey <john+@cs.cmu.edu>
5 *
6 * Copyright (c) 2001 Jeff Sutherland <jeffs@accelent.com>
7 *
8 * Original (leds-footbridge.c) by Russell King
9 *
10 * Major surgery on April 2004 by Nicolas Pitre for less global
11 * namespace collision. Mostly adapted the Mainstone version.
12 */
13
14#include <linux/config.h>
15#include <linux/init.h>
16
17#include <asm/hardware.h>
18#include <asm/leds.h>
19#include <asm/system.h>
20#include <asm/arch/pxa-regs.h>
21#include <asm/arch/lubbock.h>
22
23#include "leds.h"
24
25/*
26 * 8 discrete leds available for general use:
27 *
28 * Note: bits [15-8] are used to enable/blank the 8 7 segment hex displays
29 * so be sure to not monkey with them here.
30 */
31
32#define D28 (1 << 0)
33#define D27 (1 << 1)
34#define D26 (1 << 2)
35#define D25 (1 << 3)
36#define D24 (1 << 4)
37#define D23 (1 << 5)
38#define D22 (1 << 6)
39#define D21 (1 << 7)
40
41#define LED_STATE_ENABLED 1
42#define LED_STATE_CLAIMED 2
43
44static unsigned int led_state;
45static unsigned int hw_led_state;
46
47void lubbock_leds_event(led_event_t evt)
48{
49 unsigned long flags;
50
51 local_irq_save(flags);
52
53 switch (evt) {
54 case led_start:
55 hw_led_state = 0;
56 led_state = LED_STATE_ENABLED;
57 break;
58
59 case led_stop:
60 led_state &= ~LED_STATE_ENABLED;
61 break;
62
63 case led_claim:
64 led_state |= LED_STATE_CLAIMED;
65 hw_led_state = 0;
66 break;
67
68 case led_release:
69 led_state &= ~LED_STATE_CLAIMED;
70 hw_led_state = 0;
71 break;
72
73#ifdef CONFIG_LEDS_TIMER
74 case led_timer:
75 hw_led_state ^= D26;
76 break;
77#endif
78
79#ifdef CONFIG_LEDS_CPU
80 case led_idle_start:
81 hw_led_state &= ~D27;
82 break;
83
84 case led_idle_end:
85 hw_led_state |= D27;
86 break;
87#endif
88
89 case led_halted:
90 break;
91
92 case led_green_on:
93 hw_led_state |= D21;
94 break;
95
96 case led_green_off:
97 hw_led_state &= ~D21;
98 break;
99
100 case led_amber_on:
101 hw_led_state |= D22;
102 break;
103
104 case led_amber_off:
105 hw_led_state &= ~D22;
106 break;
107
108 case led_red_on:
109 hw_led_state |= D23;
110 break;
111
112 case led_red_off:
113 hw_led_state &= ~D23;
114 break;
115
116 default:
117 break;
118 }
119
120 if (led_state & LED_STATE_ENABLED)
121 LUB_DISC_BLNK_LED = (LUB_DISC_BLNK_LED | 0xff) & ~hw_led_state;
122 else
123 LUB_DISC_BLNK_LED |= 0xff;
124
125 local_irq_restore(flags);
126}
diff --git a/arch/arm/mach-pxa/leds-mainstone.c b/arch/arm/mach-pxa/leds-mainstone.c
new file mode 100644
index 000000000000..bbd3f87a9fc2
--- /dev/null
+++ b/arch/arm/mach-pxa/leds-mainstone.c
@@ -0,0 +1,121 @@
1/*
2 * linux/arch/arm/mach-pxa/leds-mainstone.c
3 *
4 * Author: Nicolas Pitre
5 * Created: Nov 05, 2002
6 * Copyright: MontaVista Software Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/config.h>
14#include <linux/init.h>
15
16#include <asm/hardware.h>
17#include <asm/leds.h>
18#include <asm/system.h>
19
20#include <asm/arch/pxa-regs.h>
21#include <asm/arch/mainstone.h>
22
23#include "leds.h"
24
25
26/* 8 discrete leds available for general use: */
27#define D28 (1 << 0)
28#define D27 (1 << 1)
29#define D26 (1 << 2)
30#define D25 (1 << 3)
31#define D24 (1 << 4)
32#define D23 (1 << 5)
33#define D22 (1 << 6)
34#define D21 (1 << 7)
35
36#define LED_STATE_ENABLED 1
37#define LED_STATE_CLAIMED 2
38
39static unsigned int led_state;
40static unsigned int hw_led_state;
41
42void mainstone_leds_event(led_event_t evt)
43{
44 unsigned long flags;
45
46 local_irq_save(flags);
47
48 switch (evt) {
49 case led_start:
50 hw_led_state = 0;
51 led_state = LED_STATE_ENABLED;
52 break;
53
54 case led_stop:
55 led_state &= ~LED_STATE_ENABLED;
56 break;
57
58 case led_claim:
59 led_state |= LED_STATE_CLAIMED;
60 hw_led_state = 0;
61 break;
62
63 case led_release:
64 led_state &= ~LED_STATE_CLAIMED;
65 hw_led_state = 0;
66 break;
67
68#ifdef CONFIG_LEDS_TIMER
69 case led_timer:
70 hw_led_state ^= D26;
71 break;
72#endif
73
74#ifdef CONFIG_LEDS_CPU
75 case led_idle_start:
76 hw_led_state &= ~D27;
77 break;
78
79 case led_idle_end:
80 hw_led_state |= D27;
81 break;
82#endif
83
84 case led_halted:
85 break;
86
87 case led_green_on:
88 hw_led_state |= D21;;
89 break;
90
91 case led_green_off:
92 hw_led_state &= ~D21;
93 break;
94
95 case led_amber_on:
96 hw_led_state |= D22;;
97 break;
98
99 case led_amber_off:
100 hw_led_state &= ~D22;
101 break;
102
103 case led_red_on:
104 hw_led_state |= D23;;
105 break;
106
107 case led_red_off:
108 hw_led_state &= ~D23;
109 break;
110
111 default:
112 break;
113 }
114
115 if (led_state & LED_STATE_ENABLED)
116 MST_LEDCTRL = (MST_LEDCTRL | 0xff) & ~hw_led_state;
117 else
118 MST_LEDCTRL |= 0xff;
119
120 local_irq_restore(flags);
121}
diff --git a/arch/arm/mach-pxa/leds.c b/arch/arm/mach-pxa/leds.c
new file mode 100644
index 000000000000..bbe4d5f6afaa
--- /dev/null
+++ b/arch/arm/mach-pxa/leds.c
@@ -0,0 +1,32 @@
1/*
2 * linux/arch/arm/mach-pxa/leds.c
3 *
4 * xscale LEDs dispatcher
5 *
6 * Copyright (C) 2001 Nicolas Pitre
7 *
8 * Copyright (c) 2001 Jeff Sutherland, Accelent Systems Inc.
9 */
10#include <linux/compiler.h>
11#include <linux/init.h>
12
13#include <asm/leds.h>
14#include <asm/mach-types.h>
15
16#include "leds.h"
17
18static int __init
19pxa_leds_init(void)
20{
21 if (machine_is_lubbock())
22 leds_event = lubbock_leds_event;
23 if (machine_is_mainstone())
24 leds_event = mainstone_leds_event;
25 if (machine_is_pxa_idp())
26 leds_event = idp_leds_event;
27
28 leds_event(led_start);
29 return 0;
30}
31
32core_initcall(pxa_leds_init);
diff --git a/arch/arm/mach-pxa/leds.h b/arch/arm/mach-pxa/leds.h
new file mode 100644
index 000000000000..d98f6e93c12b
--- /dev/null
+++ b/arch/arm/mach-pxa/leds.h
@@ -0,0 +1,12 @@
1/*
2 * include/asm-arm/arch-pxa/leds.h
3 *
4 * Copyright (c) 2001 Jeff Sutherland, Accelent Systems Inc.
5 *
6 * blinky lights for various PXA-based systems:
7 *
8 */
9
10extern void idp_leds_event(led_event_t evt);
11extern void lubbock_leds_event(led_event_t evt);
12extern void mainstone_leds_event(led_event_t evt);
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
new file mode 100644
index 000000000000..dd012d6e2f5c
--- /dev/null
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -0,0 +1,247 @@
1/*
2 * linux/arch/arm/mach-pxa/lubbock.c
3 *
4 * Support for the Intel DBPXA250 Development Platform.
5 *
6 * Author: Nicolas Pitre
7 * Created: Jun 15, 2001
8 * Copyright: MontaVista Software Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14#include <linux/module.h>
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/device.h>
18#include <linux/major.h>
19#include <linux/fb.h>
20#include <linux/interrupt.h>
21
22#include <asm/setup.h>
23#include <asm/memory.h>
24#include <asm/mach-types.h>
25#include <asm/hardware.h>
26#include <asm/irq.h>
27
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30#include <asm/mach/irq.h>
31
32#include <asm/hardware/sa1111.h>
33
34#include <asm/arch/pxa-regs.h>
35#include <asm/arch/lubbock.h>
36#include <asm/arch/udc.h>
37#include <asm/arch/pxafb.h>
38#include <asm/arch/mmc.h>
39
40#include "generic.h"
41
42
43#define LUB_MISC_WR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x080)
44
45void lubbock_set_misc_wr(unsigned int mask, unsigned int set)
46{
47 unsigned long flags;
48
49 local_irq_save(flags);
50 LUB_MISC_WR = (LUB_MISC_WR & ~mask) | (set & mask);
51 local_irq_restore(flags);
52}
53EXPORT_SYMBOL(lubbock_set_misc_wr);
54
55static unsigned long lubbock_irq_enabled;
56
57static void lubbock_mask_irq(unsigned int irq)
58{
59 int lubbock_irq = (irq - LUBBOCK_IRQ(0));
60 LUB_IRQ_MASK_EN = (lubbock_irq_enabled &= ~(1 << lubbock_irq));
61}
62
63static void lubbock_unmask_irq(unsigned int irq)
64{
65 int lubbock_irq = (irq - LUBBOCK_IRQ(0));
66 /* the irq can be acknowledged only if deasserted, so it's done here */
67 LUB_IRQ_SET_CLR &= ~(1 << lubbock_irq);
68 LUB_IRQ_MASK_EN = (lubbock_irq_enabled |= (1 << lubbock_irq));
69}
70
71static struct irqchip lubbock_irq_chip = {
72 .ack = lubbock_mask_irq,
73 .mask = lubbock_mask_irq,
74 .unmask = lubbock_unmask_irq,
75};
76
77static void lubbock_irq_handler(unsigned int irq, struct irqdesc *desc,
78 struct pt_regs *regs)
79{
80 unsigned long pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled;
81 do {
82 GEDR(0) = GPIO_bit(0); /* clear our parent irq */
83 if (likely(pending)) {
84 irq = LUBBOCK_IRQ(0) + __ffs(pending);
85 desc = irq_desc + irq;
86 desc->handle(irq, desc, regs);
87 }
88 pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled;
89 } while (pending);
90}
91
92static void __init lubbock_init_irq(void)
93{
94 int irq;
95
96 pxa_init_irq();
97
98 /* setup extra lubbock irqs */
99 for (irq = LUBBOCK_IRQ(0); irq <= LUBBOCK_LAST_IRQ; irq++) {
100 set_irq_chip(irq, &lubbock_irq_chip);
101 set_irq_handler(irq, do_level_IRQ);
102 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
103 }
104
105 set_irq_chained_handler(IRQ_GPIO(0), lubbock_irq_handler);
106 set_irq_type(IRQ_GPIO(0), IRQT_FALLING);
107}
108
109static int lubbock_udc_is_connected(void)
110{
111 return (LUB_MISC_RD & (1 << 9)) == 0;
112}
113
114static struct pxa2xx_udc_mach_info udc_info __initdata = {
115 .udc_is_connected = lubbock_udc_is_connected,
116 // no D+ pullup; lubbock can't connect/disconnect in software
117};
118
119static struct resource sa1111_resources[] = {
120 [0] = {
121 .start = 0x10000000,
122 .end = 0x10001fff,
123 .flags = IORESOURCE_MEM,
124 },
125 [1] = {
126 .start = LUBBOCK_SA1111_IRQ,
127 .end = LUBBOCK_SA1111_IRQ,
128 .flags = IORESOURCE_IRQ,
129 },
130};
131
132static struct platform_device sa1111_device = {
133 .name = "sa1111",
134 .id = -1,
135 .num_resources = ARRAY_SIZE(sa1111_resources),
136 .resource = sa1111_resources,
137};
138
139static struct resource smc91x_resources[] = {
140 [0] = {
141 .name = "smc91x-regs",
142 .start = 0x0c000000,
143 .end = 0x0c0fffff,
144 .flags = IORESOURCE_MEM,
145 },
146 [1] = {
147 .start = LUBBOCK_ETH_IRQ,
148 .end = LUBBOCK_ETH_IRQ,
149 .flags = IORESOURCE_IRQ,
150 },
151 [2] = {
152 .name = "smc91x-attrib",
153 .start = 0x0e000000,
154 .end = 0x0e0fffff,
155 .flags = IORESOURCE_MEM,
156 },
157};
158
159static struct platform_device smc91x_device = {
160 .name = "smc91x",
161 .id = -1,
162 .num_resources = ARRAY_SIZE(smc91x_resources),
163 .resource = smc91x_resources,
164};
165
166static struct platform_device *devices[] __initdata = {
167 &sa1111_device,
168 &smc91x_device,
169};
170
171static struct pxafb_mach_info sharp_lm8v31 __initdata = {
172 .pixclock = 270000,
173 .xres = 640,
174 .yres = 480,
175 .bpp = 16,
176 .hsync_len = 1,
177 .left_margin = 3,
178 .right_margin = 3,
179 .vsync_len = 1,
180 .upper_margin = 0,
181 .lower_margin = 0,
182 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
183 .cmap_greyscale = 0,
184 .cmap_inverse = 0,
185 .cmap_static = 0,
186 .lccr0 = LCCR0_SDS,
187 .lccr3 = LCCR3_PCP | LCCR3_Acb(255),
188};
189
190static int lubbock_mci_init(struct device *dev, irqreturn_t (*lubbock_detect_int)(int, void *, struct pt_regs *), void *data)
191{
192 /* setup GPIO for PXA25x MMC controller */
193 pxa_gpio_mode(GPIO6_MMCCLK_MD);
194 pxa_gpio_mode(GPIO8_MMCCS0_MD);
195
196 return 0;
197}
198
199static struct pxamci_platform_data lubbock_mci_platform_data = {
200 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
201 .init = lubbock_mci_init,
202};
203
204static void __init lubbock_init(void)
205{
206 pxa_set_udc_info(&udc_info);
207 set_pxa_fb_info(&sharp_lm8v31);
208 pxa_set_mci_info(&lubbock_mci_platform_data);
209 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
210}
211
212static struct map_desc lubbock_io_desc[] __initdata = {
213 { LUBBOCK_FPGA_VIRT, LUBBOCK_FPGA_PHYS, 0x00100000, MT_DEVICE }, /* CPLD */
214};
215
216static void __init lubbock_map_io(void)
217{
218 pxa_map_io();
219 iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc));
220
221 /* This enables the BTUART */
222 pxa_gpio_mode(GPIO42_BTRXD_MD);
223 pxa_gpio_mode(GPIO43_BTTXD_MD);
224 pxa_gpio_mode(GPIO44_BTCTS_MD);
225 pxa_gpio_mode(GPIO45_BTRTS_MD);
226
227 /* This is for the SMC chip select */
228 pxa_gpio_mode(GPIO79_nCS_3_MD);
229
230 /* setup sleep mode values */
231 PWER = 0x00000002;
232 PFER = 0x00000000;
233 PRER = 0x00000002;
234 PGSR0 = 0x00008000;
235 PGSR1 = 0x003F0202;
236 PGSR2 = 0x0001C000;
237 PCFR |= PCFR_OPDE;
238}
239
240MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
241 MAINTAINER("MontaVista Software Inc.")
242 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
243 MAPIO(lubbock_map_io)
244 INITIRQ(lubbock_init_irq)
245 .timer = &pxa_timer,
246 INIT_MACHINE(lubbock_init)
247MACHINE_END
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
new file mode 100644
index 000000000000..3f952237ae3d
--- /dev/null
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -0,0 +1,316 @@
1/*
2 * linux/arch/arm/mach-pxa/mainstone.c
3 *
4 * Support for the Intel HCDDBBVA0 Development Platform.
5 * (go figure how they came up with such name...)
6 *
7 * Author: Nicolas Pitre
8 * Created: Nov 05, 2002
9 * Copyright: MontaVista Software Inc.
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 version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/init.h>
17#include <linux/device.h>
18#include <linux/interrupt.h>
19#include <linux/sched.h>
20#include <linux/bitops.h>
21#include <linux/fb.h>
22
23#include <asm/types.h>
24#include <asm/setup.h>
25#include <asm/memory.h>
26#include <asm/mach-types.h>
27#include <asm/hardware.h>
28#include <asm/irq.h>
29
30#include <asm/mach/arch.h>
31#include <asm/mach/map.h>
32#include <asm/mach/irq.h>
33
34#include <asm/arch/pxa-regs.h>
35#include <asm/arch/mainstone.h>
36#include <asm/arch/audio.h>
37#include <asm/arch/pxafb.h>
38#include <asm/arch/mmc.h>
39
40#include "generic.h"
41
42
43static unsigned long mainstone_irq_enabled;
44
45static void mainstone_mask_irq(unsigned int irq)
46{
47 int mainstone_irq = (irq - MAINSTONE_IRQ(0));
48 MST_INTMSKENA = (mainstone_irq_enabled &= ~(1 << mainstone_irq));
49}
50
51static void mainstone_unmask_irq(unsigned int irq)
52{
53 int mainstone_irq = (irq - MAINSTONE_IRQ(0));
54 /* the irq can be acknowledged only if deasserted, so it's done here */
55 MST_INTSETCLR &= ~(1 << mainstone_irq);
56 MST_INTMSKENA = (mainstone_irq_enabled |= (1 << mainstone_irq));
57}
58
59static struct irqchip mainstone_irq_chip = {
60 .ack = mainstone_mask_irq,
61 .mask = mainstone_mask_irq,
62 .unmask = mainstone_unmask_irq,
63};
64
65
66static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc,
67 struct pt_regs *regs)
68{
69 unsigned long pending = MST_INTSETCLR & mainstone_irq_enabled;
70 do {
71 GEDR(0) = GPIO_bit(0); /* clear useless edge notification */
72 if (likely(pending)) {
73 irq = MAINSTONE_IRQ(0) + __ffs(pending);
74 desc = irq_desc + irq;
75 desc->handle(irq, desc, regs);
76 }
77 pending = MST_INTSETCLR & mainstone_irq_enabled;
78 } while (pending);
79}
80
81static void __init mainstone_init_irq(void)
82{
83 int irq;
84
85 pxa_init_irq();
86
87 /* setup extra Mainstone irqs */
88 for(irq = MAINSTONE_IRQ(0); irq <= MAINSTONE_IRQ(15); irq++) {
89 set_irq_chip(irq, &mainstone_irq_chip);
90 set_irq_handler(irq, do_level_IRQ);
91 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
92 }
93 set_irq_flags(MAINSTONE_IRQ(8), 0);
94 set_irq_flags(MAINSTONE_IRQ(12), 0);
95
96 MST_INTMSKENA = 0;
97 MST_INTSETCLR = 0;
98
99 set_irq_chained_handler(IRQ_GPIO(0), mainstone_irq_handler);
100 set_irq_type(IRQ_GPIO(0), IRQT_FALLING);
101}
102
103
104static struct resource smc91x_resources[] = {
105 [0] = {
106 .start = (MST_ETH_PHYS + 0x300),
107 .end = (MST_ETH_PHYS + 0xfffff),
108 .flags = IORESOURCE_MEM,
109 },
110 [1] = {
111 .start = MAINSTONE_IRQ(3),
112 .end = MAINSTONE_IRQ(3),
113 .flags = IORESOURCE_IRQ,
114 }
115};
116
117static struct platform_device smc91x_device = {
118 .name = "smc91x",
119 .id = 0,
120 .num_resources = ARRAY_SIZE(smc91x_resources),
121 .resource = smc91x_resources,
122};
123
124static int mst_audio_startup(snd_pcm_substream_t *substream, void *priv)
125{
126 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
127 MST_MSCWR2 &= ~MST_MSCWR2_AC97_SPKROFF;
128 return 0;
129}
130
131static void mst_audio_shutdown(snd_pcm_substream_t *substream, void *priv)
132{
133 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
134 MST_MSCWR2 |= MST_MSCWR2_AC97_SPKROFF;
135}
136
137static long mst_audio_suspend_mask;
138
139static void mst_audio_suspend(void *priv)
140{
141 mst_audio_suspend_mask = MST_MSCWR2;
142 MST_MSCWR2 |= MST_MSCWR2_AC97_SPKROFF;
143}
144
145static void mst_audio_resume(void *priv)
146{
147 MST_MSCWR2 &= mst_audio_suspend_mask | ~MST_MSCWR2_AC97_SPKROFF;
148}
149
150static pxa2xx_audio_ops_t mst_audio_ops = {
151 .startup = mst_audio_startup,
152 .shutdown = mst_audio_shutdown,
153 .suspend = mst_audio_suspend,
154 .resume = mst_audio_resume,
155};
156
157static struct platform_device mst_audio_device = {
158 .name = "pxa2xx-ac97",
159 .id = -1,
160 .dev = { .platform_data = &mst_audio_ops },
161};
162
163static void mainstone_backlight_power(int on)
164{
165 if (on) {
166 pxa_gpio_mode(GPIO16_PWM0_MD);
167 pxa_set_cken(CKEN0_PWM0, 1);
168 PWM_CTRL0 = 0;
169 PWM_PWDUTY0 = 0x3ff;
170 PWM_PERVAL0 = 0x3ff;
171 } else {
172 PWM_CTRL0 = 0;
173 PWM_PWDUTY0 = 0x0;
174 PWM_PERVAL0 = 0x3FF;
175 pxa_set_cken(CKEN0_PWM0, 0);
176 }
177}
178
179static struct pxafb_mach_info toshiba_ltm04c380k __initdata = {
180 .pixclock = 50000,
181 .xres = 640,
182 .yres = 480,
183 .bpp = 16,
184 .hsync_len = 1,
185 .left_margin = 0x9f,
186 .right_margin = 1,
187 .vsync_len = 44,
188 .upper_margin = 0,
189 .lower_margin = 0,
190 .sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT,
191 .lccr0 = LCCR0_Act,
192 .lccr3 = LCCR3_PCP,
193 .pxafb_backlight_power = mainstone_backlight_power,
194};
195
196static struct pxafb_mach_info toshiba_ltm035a776c __initdata = {
197 .pixclock = 110000,
198 .xres = 240,
199 .yres = 320,
200 .bpp = 16,
201 .hsync_len = 4,
202 .left_margin = 8,
203 .right_margin = 20,
204 .vsync_len = 3,
205 .upper_margin = 1,
206 .lower_margin = 10,
207 .sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT,
208 .lccr0 = LCCR0_Act,
209 .lccr3 = LCCR3_PCP,
210 .pxafb_backlight_power = mainstone_backlight_power,
211};
212
213static int mainstone_mci_init(struct device *dev, irqreturn_t (*mstone_detect_int)(int, void *, struct pt_regs *), void *data)
214{
215 int err;
216
217 /*
218 * setup GPIO for PXA27x MMC controller
219 */
220 pxa_gpio_mode(GPIO32_MMCCLK_MD);
221 pxa_gpio_mode(GPIO112_MMCCMD_MD);
222 pxa_gpio_mode(GPIO92_MMCDAT0_MD);
223 pxa_gpio_mode(GPIO109_MMCDAT1_MD);
224 pxa_gpio_mode(GPIO110_MMCDAT2_MD);
225 pxa_gpio_mode(GPIO111_MMCDAT3_MD);
226
227 /* make sure SD/Memory Stick multiplexer's signals
228 * are routed to MMC controller
229 */
230 MST_MSCWR1 &= ~MST_MSCWR1_MS_SEL;
231
232 err = request_irq(MAINSTONE_MMC_IRQ, mstone_detect_int, SA_INTERRUPT,
233 "MMC card detect", data);
234 if (err) {
235 printk(KERN_ERR "mainstone_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
236 return -1;
237 }
238
239 return 0;
240}
241
242static void mainstone_mci_setpower(struct device *dev, unsigned int vdd)
243{
244 struct pxamci_platform_data* p_d = dev->platform_data;
245
246 if (( 1 << vdd) & p_d->ocr_mask) {
247 printk(KERN_DEBUG "%s: on\n", __FUNCTION__);
248 MST_MSCWR1 |= MST_MSCWR1_MMC_ON;
249 MST_MSCWR1 &= ~MST_MSCWR1_MS_SEL;
250 } else {
251 printk(KERN_DEBUG "%s: off\n", __FUNCTION__);
252 MST_MSCWR1 &= ~MST_MSCWR1_MMC_ON;
253 }
254}
255
256static void mainstone_mci_exit(struct device *dev, void *data)
257{
258 free_irq(MAINSTONE_MMC_IRQ, data);
259}
260
261static struct pxamci_platform_data mainstone_mci_platform_data = {
262 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
263 .init = mainstone_mci_init,
264 .setpower = mainstone_mci_setpower,
265 .exit = mainstone_mci_exit,
266};
267
268static void __init mainstone_init(void)
269{
270 /*
271 * On Mainstone, we route AC97_SYSCLK via GPIO45 to
272 * the audio daughter card
273 */
274 pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD);
275
276 platform_device_register(&smc91x_device);
277 platform_device_register(&mst_audio_device);
278
279 /* reading Mainstone's "Virtual Configuration Register"
280 might be handy to select LCD type here */
281 if (0)
282 set_pxa_fb_info(&toshiba_ltm04c380k);
283 else
284 set_pxa_fb_info(&toshiba_ltm035a776c);
285
286 pxa_set_mci_info(&mainstone_mci_platform_data);
287}
288
289
290static struct map_desc mainstone_io_desc[] __initdata = {
291 { MST_FPGA_VIRT, MST_FPGA_PHYS, 0x00100000, MT_DEVICE }, /* CPLD */
292};
293
294static void __init mainstone_map_io(void)
295{
296 pxa_map_io();
297 iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc));
298
299 /* initialize sleep mode regs (wake-up sources, etc) */
300 PGSR0 = 0x00008800;
301 PGSR1 = 0x00000002;
302 PGSR2 = 0x0001FC00;
303 PGSR3 = 0x00001F81;
304 PWER = 0xC0000002;
305 PRER = 0x00000002;
306 PFER = 0x00000002;
307}
308
309MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
310 MAINTAINER("MontaVista Software Inc.")
311 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
312 MAPIO(mainstone_map_io)
313 INITIRQ(mainstone_init_irq)
314 .timer = &pxa_timer,
315 INIT_MACHINE(mainstone_init)
316MACHINE_END
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
new file mode 100644
index 000000000000..82a4bf34c251
--- /dev/null
+++ b/arch/arm/mach-pxa/pm.c
@@ -0,0 +1,227 @@
1/*
2 * PXA250/210 Power Management Routines
3 *
4 * Original code for the SA11x0:
5 * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com>
6 *
7 * Modified for the PXA250 by Nicolas Pitre:
8 * Copyright (c) 2002 Monta Vista Software, Inc.
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 */
13#include <linux/config.h>
14#include <linux/init.h>
15#include <linux/suspend.h>
16#include <linux/errno.h>
17#include <linux/time.h>
18
19#include <asm/hardware.h>
20#include <asm/memory.h>
21#include <asm/system.h>
22#include <asm/arch/pxa-regs.h>
23#include <asm/arch/lubbock.h>
24#include <asm/mach/time.h>
25
26
27/*
28 * Debug macros
29 */
30#undef DEBUG
31
32extern void pxa_cpu_suspend(void);
33extern void pxa_cpu_resume(void);
34
35#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
36#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
37
38#define RESTORE_GPLEVEL(n) do { \
39 GPSR##n = sleep_save[SLEEP_SAVE_GPLR##n]; \
40 GPCR##n = ~sleep_save[SLEEP_SAVE_GPLR##n]; \
41} while (0)
42
43/*
44 * List of global PXA peripheral registers to preserve.
45 * More ones like CP and general purpose register values are preserved
46 * with the stack pointer in sleep.S.
47 */
48enum { SLEEP_SAVE_START = 0,
49
50 SLEEP_SAVE_GPLR0, SLEEP_SAVE_GPLR1, SLEEP_SAVE_GPLR2, SLEEP_SAVE_GPLR3,
51 SLEEP_SAVE_GPDR0, SLEEP_SAVE_GPDR1, SLEEP_SAVE_GPDR2, SLEEP_SAVE_GPDR3,
52 SLEEP_SAVE_GRER0, SLEEP_SAVE_GRER1, SLEEP_SAVE_GRER2, SLEEP_SAVE_GRER3,
53 SLEEP_SAVE_GFER0, SLEEP_SAVE_GFER1, SLEEP_SAVE_GFER2, SLEEP_SAVE_GFER3,
54 SLEEP_SAVE_PGSR0, SLEEP_SAVE_PGSR1, SLEEP_SAVE_PGSR2, SLEEP_SAVE_PGSR3,
55
56 SLEEP_SAVE_GAFR0_L, SLEEP_SAVE_GAFR0_U,
57 SLEEP_SAVE_GAFR1_L, SLEEP_SAVE_GAFR1_U,
58 SLEEP_SAVE_GAFR2_L, SLEEP_SAVE_GAFR2_U,
59 SLEEP_SAVE_GAFR3_L, SLEEP_SAVE_GAFR3_U,
60
61 SLEEP_SAVE_PSTR,
62
63 SLEEP_SAVE_ICMR,
64 SLEEP_SAVE_CKEN,
65
66 SLEEP_SAVE_CKSUM,
67
68 SLEEP_SAVE_SIZE
69};
70
71
72static int pxa_pm_enter(suspend_state_t state)
73{
74 unsigned long sleep_save[SLEEP_SAVE_SIZE];
75 unsigned long checksum = 0;
76 struct timespec delta, rtc;
77 int i;
78
79 if (state != PM_SUSPEND_MEM)
80 return -EINVAL;
81
82#ifdef CONFIG_IWMMXT
83 /* force any iWMMXt context to ram **/
84 iwmmxt_task_disable(NULL);
85#endif
86
87 /* preserve current time */
88 rtc.tv_sec = RCNR;
89 rtc.tv_nsec = 0;
90 save_time_delta(&delta, &rtc);
91
92 SAVE(GPLR0); SAVE(GPLR1); SAVE(GPLR2);
93 SAVE(GPDR0); SAVE(GPDR1); SAVE(GPDR2);
94 SAVE(GRER0); SAVE(GRER1); SAVE(GRER2);
95 SAVE(GFER0); SAVE(GFER1); SAVE(GFER2);
96 SAVE(PGSR0); SAVE(PGSR1); SAVE(PGSR2);
97
98 SAVE(GAFR0_L); SAVE(GAFR0_U);
99 SAVE(GAFR1_L); SAVE(GAFR1_U);
100 SAVE(GAFR2_L); SAVE(GAFR2_U);
101
102#ifdef CONFIG_PXA27x
103 SAVE(GPLR3); SAVE(GPDR3); SAVE(GRER3); SAVE(GFER3); SAVE(PGSR3);
104 SAVE(GAFR3_L); SAVE(GAFR3_U);
105#endif
106
107 SAVE(ICMR);
108 ICMR = 0;
109
110 SAVE(CKEN);
111 CKEN = 0;
112
113 SAVE(PSTR);
114
115 /* Note: wake up source are set up in each machine specific files */
116
117 /* clear GPIO transition detect bits */
118 GEDR0 = GEDR0; GEDR1 = GEDR1; GEDR2 = GEDR2;
119#ifdef CONFIG_PXA27x
120 GEDR3 = GEDR3;
121#endif
122
123 /* Clear sleep reset status */
124 RCSR = RCSR_SMR;
125
126 /* set resume return address */
127 PSPR = virt_to_phys(pxa_cpu_resume);
128
129 /* before sleeping, calculate and save a checksum */
130 for (i = 0; i < SLEEP_SAVE_SIZE - 1; i++)
131 checksum += sleep_save[i];
132 sleep_save[SLEEP_SAVE_CKSUM] = checksum;
133
134 /* *** go zzz *** */
135 pxa_cpu_suspend();
136
137 /* after sleeping, validate the checksum */
138 checksum = 0;
139 for (i = 0; i < SLEEP_SAVE_SIZE - 1; i++)
140 checksum += sleep_save[i];
141
142 /* if invalid, display message and wait for a hardware reset */
143 if (checksum != sleep_save[SLEEP_SAVE_CKSUM]) {
144#ifdef CONFIG_ARCH_LUBBOCK
145 LUB_HEXLED = 0xbadbadc5;
146#endif
147 while (1)
148 pxa_cpu_suspend();
149 }
150
151 /* ensure not to come back here if it wasn't intended */
152 PSPR = 0;
153
154 /* restore registers */
155 RESTORE(GAFR0_L); RESTORE(GAFR0_U);
156 RESTORE(GAFR1_L); RESTORE(GAFR1_U);
157 RESTORE(GAFR2_L); RESTORE(GAFR2_U);
158 RESTORE_GPLEVEL(0); RESTORE_GPLEVEL(1); RESTORE_GPLEVEL(2);
159 RESTORE(GPDR0); RESTORE(GPDR1); RESTORE(GPDR2);
160 RESTORE(GRER0); RESTORE(GRER1); RESTORE(GRER2);
161 RESTORE(GFER0); RESTORE(GFER1); RESTORE(GFER2);
162 RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2);
163
164#ifdef CONFIG_PXA27x
165 RESTORE(GAFR3_L); RESTORE(GAFR3_U); RESTORE_GPLEVEL(3);
166 RESTORE(GPDR3); RESTORE(GRER3); RESTORE(GFER3); RESTORE(PGSR3);
167#endif
168
169 PSSR = PSSR_RDH | PSSR_PH;
170
171 RESTORE(CKEN);
172
173 ICLR = 0;
174 ICCR = 1;
175 RESTORE(ICMR);
176
177 RESTORE(PSTR);
178
179 /* restore current time */
180 rtc.tv_sec = RCNR;
181 restore_time_delta(&delta, &rtc);
182
183#ifdef DEBUG
184 printk(KERN_DEBUG "*** made it back from resume\n");
185#endif
186
187 return 0;
188}
189
190unsigned long sleep_phys_sp(void *sp)
191{
192 return virt_to_phys(sp);
193}
194
195/*
196 * Called after processes are frozen, but before we shut down devices.
197 */
198static int pxa_pm_prepare(suspend_state_t state)
199{
200 return 0;
201}
202
203/*
204 * Called after devices are re-setup, but before processes are thawed.
205 */
206static int pxa_pm_finish(suspend_state_t state)
207{
208 return 0;
209}
210
211/*
212 * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk.
213 */
214static struct pm_ops pxa_pm_ops = {
215 .pm_disk_mode = PM_DISK_FIRMWARE,
216 .prepare = pxa_pm_prepare,
217 .enter = pxa_pm_enter,
218 .finish = pxa_pm_finish,
219};
220
221static int __init pxa_pm_init(void)
222{
223 pm_set_ops(&pxa_pm_ops);
224 return 0;
225}
226
227late_initcall(pxa_pm_init);
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
new file mode 100644
index 000000000000..b6c746ea3830
--- /dev/null
+++ b/arch/arm/mach-pxa/poodle.c
@@ -0,0 +1,189 @@
1/*
2 * linux/arch/arm/mach-pxa/poodle.c
3 *
4 * Support for the SHARP Poodle Board.
5 *
6 * Based on:
7 * linux/arch/arm/mach-pxa/lubbock.c Author: Nicolas Pitre
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * Change Log
14 * 12-Dec-2002 Sharp Corporation for Poodle
15 * John Lenz <lenz@cs.wisc.edu> updates to 2.6
16 */
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/device.h>
20#include <linux/fb.h>
21
22#include <asm/hardware.h>
23#include <asm/mach-types.h>
24#include <asm/irq.h>
25#include <asm/setup.h>
26
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/irq.h>
30
31#include <asm/arch/pxa-regs.h>
32#include <asm/arch/irq.h>
33#include <asm/arch/poodle.h>
34#include <asm/arch/pxafb.h>
35
36#include <asm/hardware/scoop.h>
37#include <asm/hardware/locomo.h>
38#include <asm/mach/sharpsl_param.h>
39
40#include "generic.h"
41
42static struct resource poodle_scoop_resources[] = {
43 [0] = {
44 .start = 0x10800000,
45 .end = 0x10800fff,
46 .flags = IORESOURCE_MEM,
47 },
48};
49
50static struct scoop_config poodle_scoop_setup = {
51 .io_dir = POODLE_SCOOP_IO_DIR,
52 .io_out = POODLE_SCOOP_IO_OUT,
53};
54
55struct platform_device poodle_scoop_device = {
56 .name = "sharp-scoop",
57 .id = -1,
58 .dev = {
59 .platform_data = &poodle_scoop_setup,
60 },
61 .num_resources = ARRAY_SIZE(poodle_scoop_resources),
62 .resource = poodle_scoop_resources,
63};
64
65
66/* LoCoMo device */
67static struct resource locomo_resources[] = {
68 [0] = {
69 .start = 0x10000000,
70 .end = 0x10001fff,
71 .flags = IORESOURCE_MEM,
72 },
73 [1] = {
74 .start = IRQ_GPIO(10),
75 .end = IRQ_GPIO(10),
76 .flags = IORESOURCE_IRQ,
77 },
78};
79
80static struct platform_device locomo_device = {
81 .name = "locomo",
82 .id = 0,
83 .num_resources = ARRAY_SIZE(locomo_resources),
84 .resource = locomo_resources,
85};
86
87/* PXAFB device */
88static struct pxafb_mach_info poodle_fb_info __initdata = {
89 .pixclock = 144700,
90
91 .xres = 320,
92 .yres = 240,
93 .bpp = 16,
94
95 .hsync_len = 7,
96 .left_margin = 11,
97 .right_margin = 30,
98
99 .vsync_len = 2,
100 .upper_margin = 2,
101 .lower_margin = 0,
102 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
103
104 .lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
105 .lccr3 = 0,
106
107 .pxafb_backlight_power = NULL,
108 .pxafb_lcd_power = NULL,
109};
110
111static struct platform_device *devices[] __initdata = {
112 &locomo_device,
113 &poodle_scoop_device,
114};
115
116static void __init poodle_init(void)
117{
118 int ret = 0;
119
120 /* cpu initialize */
121 /* Pgsr Register */
122 PGSR0 = 0x0146dd80;
123 PGSR1 = 0x03bf0890;
124 PGSR2 = 0x0001c000;
125
126 /* Alternate Register */
127 GAFR0_L = 0x01001000;
128 GAFR0_U = 0x591a8010;
129 GAFR1_L = 0x900a8451;
130 GAFR1_U = 0xaaa5aaaa;
131 GAFR2_L = 0x8aaaaaaa;
132 GAFR2_U = 0x00000002;
133
134 /* Direction Register */
135 GPDR0 = 0xd3f0904c;
136 GPDR1 = 0xfcffb7d3;
137 GPDR2 = 0x0001ffff;
138
139 /* Output Register */
140 GPCR0 = 0x00000000;
141 GPCR1 = 0x00000000;
142 GPCR2 = 0x00000000;
143
144 GPSR0 = 0x00400000;
145 GPSR1 = 0x00000000;
146 GPSR2 = 0x00000000;
147
148 set_pxa_fb_info(&poodle_fb_info);
149
150 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
151 if (ret) {
152 printk(KERN_WARNING "poodle: Unable to register LoCoMo device\n");
153 }
154}
155
156static void __init fixup_poodle(struct machine_desc *desc,
157 struct tag *tags, char **cmdline, struct meminfo *mi)
158{
159 sharpsl_save_param();
160}
161
162static struct map_desc poodle_io_desc[] __initdata = {
163 /* virtual physical length */
164 { 0xef800000, 0x00000000, 0x00800000, MT_DEVICE }, /* Boot Flash */
165};
166
167static void __init poodle_map_io(void)
168{
169 pxa_map_io();
170 iotable_init(poodle_io_desc, ARRAY_SIZE(poodle_io_desc));
171
172 /* setup sleep mode values */
173 PWER = 0x00000002;
174 PFER = 0x00000000;
175 PRER = 0x00000002;
176 PGSR0 = 0x00008000;
177 PGSR1 = 0x003F0202;
178 PGSR2 = 0x0001C000;
179 PCFR |= PCFR_OPDE;
180}
181
182MACHINE_START(POODLE, "SHARP Poodle")
183 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
184 FIXUP(fixup_poodle)
185 MAPIO(poodle_map_io)
186 INITIRQ(pxa_init_irq)
187 .timer = &pxa_timer,
188 .init_machine = poodle_init,
189MACHINE_END
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
new file mode 100644
index 000000000000..e887b7175ef3
--- /dev/null
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -0,0 +1,104 @@
1/*
2 * linux/arch/arm/mach-pxa/pxa25x.c
3 *
4 * Author: Nicolas Pitre
5 * Created: Jun 15, 2001
6 * Copyright: MontaVista Software Inc.
7 *
8 * Code specific to PXA21x/25x/26x variants.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * Since this file should be linked before any other machine specific file,
15 * the __initcall() here will be executed first. This serves as default
16 * initialization stuff for PXA machines which can be overridden later if
17 * need be.
18 */
19#include <linux/module.h>
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/pm.h>
23
24#include <asm/hardware.h>
25#include <asm/arch/pxa-regs.h>
26
27#include "generic.h"
28
29/*
30 * Various clock factors driven by the CCCR register.
31 */
32
33/* Crystal Frequency to Memory Frequency Multiplier (L) */
34static unsigned char L_clk_mult[32] = { 0, 27, 32, 36, 40, 45, 0, };
35
36/* Memory Frequency to Run Mode Frequency Multiplier (M) */
37static unsigned char M_clk_mult[4] = { 0, 1, 2, 4 };
38
39/* Run Mode Frequency to Turbo Mode Frequency Multiplier (N) */
40/* Note: we store the value N * 2 here. */
41static unsigned char N2_clk_mult[8] = { 0, 0, 2, 3, 4, 0, 6, 0 };
42
43/* Crystal clock */
44#define BASE_CLK 3686400
45
46/*
47 * Get the clock frequency as reflected by CCCR and the turbo flag.
48 * We assume these values have been applied via a fcs.
49 * If info is not 0 we also display the current settings.
50 */
51unsigned int get_clk_frequency_khz(int info)
52{
53 unsigned long cccr, turbo;
54 unsigned int l, L, m, M, n2, N;
55
56 cccr = CCCR;
57 asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (turbo) );
58
59 l = L_clk_mult[(cccr >> 0) & 0x1f];
60 m = M_clk_mult[(cccr >> 5) & 0x03];
61 n2 = N2_clk_mult[(cccr >> 7) & 0x07];
62
63 L = l * BASE_CLK;
64 M = m * L;
65 N = n2 * M / 2;
66
67 if(info)
68 {
69 L += 5000;
70 printk( KERN_INFO "Memory clock: %d.%02dMHz (*%d)\n",
71 L / 1000000, (L % 1000000) / 10000, l );
72 M += 5000;
73 printk( KERN_INFO "Run Mode clock: %d.%02dMHz (*%d)\n",
74 M / 1000000, (M % 1000000) / 10000, m );
75 N += 5000;
76 printk( KERN_INFO "Turbo Mode clock: %d.%02dMHz (*%d.%d, %sactive)\n",
77 N / 1000000, (N % 1000000) / 10000, n2 / 2, (n2 % 2) * 5,
78 (turbo & 1) ? "" : "in" );
79 }
80
81 return (turbo & 1) ? (N/1000) : (M/1000);
82}
83
84EXPORT_SYMBOL(get_clk_frequency_khz);
85
86/*
87 * Return the current memory clock frequency in units of 10kHz
88 */
89unsigned int get_memclk_frequency_10khz(void)
90{
91 return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK / 10000;
92}
93
94EXPORT_SYMBOL(get_memclk_frequency_10khz);
95
96/*
97 * Return the current LCD clock frequency in units of 10kHz
98 */
99unsigned int get_lcdclk_frequency_10khz(void)
100{
101 return get_memclk_frequency_10khz();
102}
103
104EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
new file mode 100644
index 000000000000..7e863afefb53
--- /dev/null
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -0,0 +1,163 @@
1/*
2 * linux/arch/arm/mach-pxa/pxa27x.c
3 *
4 * Author: Nicolas Pitre
5 * Created: Nov 05, 2002
6 * Copyright: MontaVista Software Inc.
7 *
8 * Code specific to PXA27x aka Bulverde.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14#include <linux/config.h>
15#include <linux/module.h>
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/pm.h>
19#include <linux/device.h>
20
21#include <asm/hardware.h>
22#include <asm/irq.h>
23#include <asm/arch/pxa-regs.h>
24
25#include "generic.h"
26
27/* Crystal clock: 13MHz */
28#define BASE_CLK 13000000
29
30/*
31 * Get the clock frequency as reflected by CCSR and the turbo flag.
32 * We assume these values have been applied via a fcs.
33 * If info is not 0 we also display the current settings.
34 */
35unsigned int get_clk_frequency_khz( int info)
36{
37 unsigned long ccsr, clkcfg;
38 unsigned int l, L, m, M, n2, N, S;
39 int cccr_a, t, ht, b;
40
41 ccsr = CCSR;
42 cccr_a = CCCR & (1 << 25);
43
44 /* Read clkcfg register: it has turbo, b, half-turbo (and f) */
45 asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg) );
46 t = clkcfg & (1 << 1);
47 ht = clkcfg & (1 << 2);
48 b = clkcfg & (1 << 3);
49
50 l = ccsr & 0x1f;
51 n2 = (ccsr>>7) & 0xf;
52 m = (l <= 10) ? 1 : (l <= 20) ? 2 : 4;
53
54 L = l * BASE_CLK;
55 N = (L * n2) / 2;
56 M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2));
57 S = (b) ? L : (L/2);
58
59 if (info) {
60 printk( KERN_INFO "Run Mode clock: %d.%02dMHz (*%d)\n",
61 L / 1000000, (L % 1000000) / 10000, l );
62 printk( KERN_INFO "Turbo Mode clock: %d.%02dMHz (*%d.%d, %sactive)\n",
63 N / 1000000, (N % 1000000)/10000, n2 / 2, (n2 % 2)*5,
64 (t) ? "" : "in" );
65 printk( KERN_INFO "Memory clock: %d.%02dMHz (/%d)\n",
66 M / 1000000, (M % 1000000) / 10000, m );
67 printk( KERN_INFO "System bus clock: %d.%02dMHz \n",
68 S / 1000000, (S % 1000000) / 10000 );
69 }
70
71 return (t) ? (N/1000) : (L/1000);
72}
73
74/*
75 * Return the current mem clock frequency in units of 10kHz as
76 * reflected by CCCR[A], B, and L
77 */
78unsigned int get_memclk_frequency_10khz(void)
79{
80 unsigned long ccsr, clkcfg;
81 unsigned int l, L, m, M;
82 int cccr_a, b;
83
84 ccsr = CCSR;
85 cccr_a = CCCR & (1 << 25);
86
87 /* Read clkcfg register: it has turbo, b, half-turbo (and f) */
88 asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg) );
89 b = clkcfg & (1 << 3);
90
91 l = ccsr & 0x1f;
92 m = (l <= 10) ? 1 : (l <= 20) ? 2 : 4;
93
94 L = l * BASE_CLK;
95 M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2));
96
97 return (M / 10000);
98}
99
100/*
101 * Return the current LCD clock frequency in units of 10kHz as
102 */
103unsigned int get_lcdclk_frequency_10khz(void)
104{
105 unsigned long ccsr;
106 unsigned int l, L, k, K;
107
108 ccsr = CCSR;
109
110 l = ccsr & 0x1f;
111 k = (l <= 7) ? 1 : (l <= 16) ? 2 : 4;
112
113 L = l * BASE_CLK;
114 K = L / k;
115
116 return (K / 10000);
117}
118
119EXPORT_SYMBOL(get_clk_frequency_khz);
120EXPORT_SYMBOL(get_memclk_frequency_10khz);
121EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
122
123
124/*
125 * device registration specific to PXA27x.
126 */
127
128static u64 pxa27x_dmamask = 0xffffffffUL;
129
130static struct resource pxa27x_ohci_resources[] = {
131 [0] = {
132 .start = 0x4C000000,
133 .end = 0x4C00ff6f,
134 .flags = IORESOURCE_MEM,
135 },
136 [1] = {
137 .start = IRQ_USBH1,
138 .end = IRQ_USBH1,
139 .flags = IORESOURCE_IRQ,
140 },
141};
142
143static struct platform_device ohci_device = {
144 .name = "pxa27x-ohci",
145 .id = -1,
146 .dev = {
147 .dma_mask = &pxa27x_dmamask,
148 .coherent_dma_mask = 0xffffffff,
149 },
150 .num_resources = ARRAY_SIZE(pxa27x_ohci_resources),
151 .resource = pxa27x_ohci_resources,
152};
153
154static struct platform_device *devices[] __initdata = {
155 &ohci_device,
156};
157
158static int __init pxa27x_init(void)
159{
160 return platform_add_devices(devices, ARRAY_SIZE(devices));
161}
162
163subsys_initcall(pxa27x_init);
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
new file mode 100644
index 000000000000..16cad2c2497c
--- /dev/null
+++ b/arch/arm/mach-pxa/sleep.S
@@ -0,0 +1,194 @@
1/*
2 * Low-level PXA250/210 sleep/wakeUp support
3 *
4 * Initial SA1110 code:
5 * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com>
6 *
7 * Adapted for PXA by Nicolas Pitre:
8 * Copyright (c) 2002 Monta Vista Software, Inc.
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 */
13
14#include <linux/config.h>
15#include <linux/linkage.h>
16#include <asm/assembler.h>
17#include <asm/hardware.h>
18
19#include <asm/arch/pxa-regs.h>
20
21 .text
22
23/*
24 * pxa_cpu_suspend()
25 *
26 * Forces CPU into sleep state
27 */
28
29ENTRY(pxa_cpu_suspend)
30
31 mra r2, r3, acc0
32 stmfd sp!, {r2 - r12, lr} @ save registers on stack
33
34 @ get coprocessor registers
35 mrc p14, 0, r3, c6, c0, 0 @ clock configuration, for turbo mode
36 mrc p15, 0, r4, c15, c1, 0 @ CP access reg
37 mrc p15, 0, r5, c13, c0, 0 @ PID
38 mrc p15, 0, r6, c3, c0, 0 @ domain ID
39 mrc p15, 0, r7, c2, c0, 0 @ translation table base addr
40 mrc p15, 0, r8, c1, c1, 0 @ auxiliary control reg
41 mrc p15, 0, r9, c1, c0, 0 @ control reg
42
43 bic r3, r3, #2 @ clear frequency change bit
44
45 @ store them plus current virtual stack ptr on stack
46 mov r10, sp
47 stmfd sp!, {r3 - r10}
48
49 @ preserve phys address of stack
50 mov r0, sp
51 bl sleep_phys_sp
52 ldr r1, =sleep_save_sp
53 str r0, [r1]
54
55 @ clean data cache
56 bl xscale_flush_kern_cache_all
57
58 @ Put the processor to sleep
59 @ (also workaround for sighting 28071)
60
61 @ prepare value for sleep mode
62 mov r1, #3 @ sleep mode
63
64 @ prepare to put SDRAM into self-refresh manually
65 ldr r4, =MDREFR
66 ldr r5, [r4]
67 orr r5, r5, #MDREFR_SLFRSH
68
69 @ prepare pointer to physical address 0 (virtual mapping in generic.c)
70 mov r2, #UNCACHED_PHYS_0
71
72 @ Intel PXA255 Specification Update notes problems
73 @ about suspending with PXBus operating above 133MHz
74 @ (see Errata 31, GPIO output signals, ... unpredictable in sleep
75 @
76 @ We keep the change-down close to the actual suspend on SDRAM
77 @ as possible to eliminate messing about with the refresh clock
78 @ as the system will restore with the original speed settings
79 @
80 @ Ben Dooks, 13-Sep-2004
81
82 ldr r6, =CCCR
83 ldr r8, [r6] @ keep original value for resume
84
85 @ ensure x1 for run and turbo mode with memory clock
86 bic r7, r8, #CCCR_M_MASK | CCCR_N_MASK
87 orr r7, r7, #(1<<5) | (2<<7)
88
89 @ check that the memory frequency is within limits
90 and r14, r7, #CCCR_L_MASK
91 teq r14, #1
92 bicne r7, r7, #CCCR_L_MASK
93 orrne r7, r7, #1 @@ 99.53MHz
94
95 @ get ready for the change
96
97 @ note, turbo is not preserved over sleep so there is no
98 @ point in preserving it here. we save it on the stack with the
99 @ other CP registers instead.
100 mov r0, #0
101 mcr p14, 0, r0, c6, c0, 0
102 orr r0, r0, #2 @ initiate change bit
103
104 @ align execution to a cache line
105 b 1f
106
107 .ltorg
108 .align 5
1091:
110
111 @ All needed values are now in registers.
112 @ These last instructions should be in cache
113
114 @ initiate the frequency change...
115 str r7, [r6]
116 mcr p14, 0, r0, c6, c0, 0
117
118 @ restore the original cpu speed value for resume
119 str r8, [r6]
120
121 @ put SDRAM into self-refresh
122 str r5, [r4]
123
124 @ force address lines low by reading at physical address 0
125 ldr r3, [r2]
126
127 @ enter sleep mode
128 mcr p14, 0, r1, c7, c0, 0
129
13020: b 20b @ loop waiting for sleep
131
132/*
133 * cpu_pxa_resume()
134 *
135 * entry point from bootloader into kernel during resume
136 *
137 * Note: Yes, part of the following code is located into the .data section.
138 * This is to allow sleep_save_sp to be accessed with a relative load
139 * while we can't rely on any MMU translation. We could have put
140 * sleep_save_sp in the .text section as well, but some setups might
141 * insist on it to be truly read-only.
142 */
143
144 .data
145 .align 5
146ENTRY(pxa_cpu_resume)
147 mov r0, #PSR_I_BIT | PSR_F_BIT | MODE_SVC @ set SVC, irqs off
148 msr cpsr_c, r0
149
150 ldr r0, sleep_save_sp @ stack phys addr
151 ldr r2, =resume_after_mmu @ its absolute virtual address
152 ldmfd r0, {r3 - r9, sp} @ CP regs + virt stack ptr
153
154 mov r1, #0
155 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
156 mcr p15, 0, r1, c7, c7, 0 @ invalidate I & D caches, BTB
157
158#ifdef CONFIG_XSCALE_CACHE_ERRATA
159 bic r9, r9, #0x0004 @ see cpu_xscale_proc_init
160#endif
161
162 mcr p14, 0, r3, c6, c0, 0 @ clock configuration, turbo mode.
163 mcr p15, 0, r4, c15, c1, 0 @ CP access reg
164 mcr p15, 0, r5, c13, c0, 0 @ PID
165 mcr p15, 0, r6, c3, c0, 0 @ domain ID
166 mcr p15, 0, r7, c2, c0, 0 @ translation table base addr
167 mcr p15, 0, r8, c1, c1, 0 @ auxiliary control reg
168 b resume_turn_on_mmu @ cache align execution
169
170 .align 5
171resume_turn_on_mmu:
172 mcr p15, 0, r9, c1, c0, 0 @ turn on MMU, caches, etc.
173
174 @ Let us ensure we jump to resume_after_mmu only when the mcr above
175 @ actually took effect. They call it the "cpwait" operation.
176 mrc p15, 0, r1, c2, c0, 0 @ queue a dependency on CP15
177 sub pc, r2, r1, lsr #32 @ jump to virtual addr
178 nop
179 nop
180 nop
181
182sleep_save_sp:
183 .word 0 @ preserve stack phys ptr here
184
185 .text
186resume_after_mmu:
187#ifdef CONFIG_XSCALE_CACHE_ERRATA
188 bl cpu_xscale_proc_init
189#endif
190 ldmfd sp!, {r2, r3}
191 mar acc0, r2, r3
192 ldmfd sp!, {r4 - r12, pc} @ return to caller
193
194
diff --git a/arch/arm/mach-pxa/ssp.c b/arch/arm/mach-pxa/ssp.c
new file mode 100644
index 000000000000..4d826c021315
--- /dev/null
+++ b/arch/arm/mach-pxa/ssp.c
@@ -0,0 +1,363 @@
1/*
2 * linux/arch/arm/mach-pxa/ssp.c
3 *
4 * based on linux/arch/arm/mach-sa1100/ssp.c by Russell King
5 *
6 * Copyright (C) 2003 Russell King.
7 * Copyright (C) 2003 Wolfson Microelectronics PLC
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * PXA2xx SSP driver. This provides the generic core for simple
14 * IO-based SSP applications and allows easy port setup for DMA access.
15 *
16 * Author: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
17 *
18 * Revision history:
19 * 22nd Aug 2003 Initial version.
20 * 20th Dec 2004 Added ssp_config for changing port config without
21 * closing the port.
22 */
23
24#include <linux/module.h>
25#include <linux/kernel.h>
26#include <linux/sched.h>
27#include <linux/slab.h>
28#include <linux/errno.h>
29#include <linux/interrupt.h>
30#include <linux/ioport.h>
31#include <linux/init.h>
32#include <asm/io.h>
33#include <asm/irq.h>
34#include <asm/hardware.h>
35#include <asm/arch/ssp.h>
36#include <asm/arch/pxa-regs.h>
37
38#define PXA_SSP_PORTS 3
39
40static DECLARE_MUTEX(sem);
41static int use_count[PXA_SSP_PORTS] = {0, 0, 0};
42
43static irqreturn_t ssp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
44{
45 struct ssp_dev *dev = (struct ssp_dev*) dev_id;
46 unsigned int status = SSSR_P(dev->port);
47
48 SSSR_P(dev->port) = status; /* clear status bits */
49
50 if (status & SSSR_ROR)
51 printk(KERN_WARNING "SSP(%d): receiver overrun\n", dev->port);
52
53 if (status & SSSR_TUR)
54 printk(KERN_WARNING "SSP(%d): transmitter underrun\n", dev->port);
55
56 if (status & SSSR_BCE)
57 printk(KERN_WARNING "SSP(%d): bit count error\n", dev->port);
58
59 return IRQ_HANDLED;
60}
61
62/**
63 * ssp_write_word - write a word to the SSP port
64 * @data: 32-bit, MSB justified data to write.
65 *
66 * Wait for a free entry in the SSP transmit FIFO, and write a data
67 * word to the SSP port.
68 *
69 * The caller is expected to perform the necessary locking.
70 *
71 * Returns:
72 * %-ETIMEDOUT timeout occurred (for future)
73 * 0 success
74 */
75int ssp_write_word(struct ssp_dev *dev, u32 data)
76{
77 while (!(SSSR_P(dev->port) & SSSR_TNF))
78 cpu_relax();
79
80 SSDR_P(dev->port) = data;
81
82 return 0;
83}
84
85/**
86 * ssp_read_word - read a word from the SSP port
87 *
88 * Wait for a data word in the SSP receive FIFO, and return the
89 * received data. Data is LSB justified.
90 *
91 * Note: Currently, if data is not expected to be received, this
92 * function will wait for ever.
93 *
94 * The caller is expected to perform the necessary locking.
95 *
96 * Returns:
97 * %-ETIMEDOUT timeout occurred (for future)
98 * 32-bit data success
99 */
100int ssp_read_word(struct ssp_dev *dev)
101{
102 while (!(SSSR_P(dev->port) & SSSR_RNE))
103 cpu_relax();
104
105 return SSDR_P(dev->port);
106}
107
108/**
109 * ssp_flush - flush the transmit and receive FIFOs
110 *
111 * Wait for the SSP to idle, and ensure that the receive FIFO
112 * is empty.
113 *
114 * The caller is expected to perform the necessary locking.
115 */
116void ssp_flush(struct ssp_dev *dev)
117{
118 do {
119 while (SSSR_P(dev->port) & SSSR_RNE) {
120 (void) SSDR_P(dev->port);
121 }
122 } while (SSSR_P(dev->port) & SSSR_BSY);
123}
124
125/**
126 * ssp_enable - enable the SSP port
127 *
128 * Turn on the SSP port.
129 */
130void ssp_enable(struct ssp_dev *dev)
131{
132 SSCR0_P(dev->port) |= SSCR0_SSE;
133}
134
135/**
136 * ssp_disable - shut down the SSP port
137 *
138 * Turn off the SSP port, optionally powering it down.
139 */
140void ssp_disable(struct ssp_dev *dev)
141{
142 SSCR0_P(dev->port) &= ~SSCR0_SSE;
143}
144
145/**
146 * ssp_save_state - save the SSP configuration
147 * @ssp: pointer to structure to save SSP configuration
148 *
149 * Save the configured SSP state for suspend.
150 */
151void ssp_save_state(struct ssp_dev *dev, struct ssp_state *ssp)
152{
153 ssp->cr0 = SSCR0_P(dev->port);
154 ssp->cr1 = SSCR1_P(dev->port);
155 ssp->to = SSTO_P(dev->port);
156 ssp->psp = SSPSP_P(dev->port);
157
158 SSCR0_P(dev->port) &= ~SSCR0_SSE;
159}
160
161/**
162 * ssp_restore_state - restore a previously saved SSP configuration
163 * @ssp: pointer to configuration saved by ssp_save_state
164 *
165 * Restore the SSP configuration saved previously by ssp_save_state.
166 */
167void ssp_restore_state(struct ssp_dev *dev, struct ssp_state *ssp)
168{
169 SSSR_P(dev->port) = SSSR_ROR | SSSR_TUR | SSSR_BCE;
170
171 SSCR0_P(dev->port) = ssp->cr0 & ~SSCR0_SSE;
172 SSCR1_P(dev->port) = ssp->cr1;
173 SSTO_P(dev->port) = ssp->to;
174 SSPSP_P(dev->port) = ssp->psp;
175
176 SSCR0_P(dev->port) = ssp->cr0;
177}
178
179/**
180 * ssp_config - configure SSP port settings
181 * @mode: port operating mode
182 * @flags: port config flags
183 * @psp_flags: port PSP config flags
184 * @speed: port speed
185 *
186 * Port MUST be disabled by ssp_disable before making any config changes.
187 */
188int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed)
189{
190 dev->mode = mode;
191 dev->flags = flags;
192 dev->psp_flags = psp_flags;
193 dev->speed = speed;
194
195 /* set up port type, speed, port settings */
196 SSCR0_P(dev->port) = (dev->speed | dev->mode);
197 SSCR1_P(dev->port) = dev->flags;
198 SSPSP_P(dev->port) = dev->psp_flags;
199
200 return 0;
201}
202
203/**
204 * ssp_init - setup the SSP port
205 *
206 * initialise and claim resources for the SSP port.
207 *
208 * Returns:
209 * %-ENODEV if the SSP port is unavailable
210 * %-EBUSY if the resources are already in use
211 * %0 on success
212 */
213int ssp_init(struct ssp_dev *dev, u32 port)
214{
215 int ret, irq;
216
217 if (port > PXA_SSP_PORTS || port == 0)
218 return -ENODEV;
219
220 down(&sem);
221 if (use_count[port - 1]) {
222 up(&sem);
223 return -EBUSY;
224 }
225 use_count[port - 1]++;
226
227 if (!request_mem_region(__PREG(SSCR0_P(port)), 0x2c, "SSP")) {
228 use_count[port - 1]--;
229 up(&sem);
230 return -EBUSY;
231 }
232
233 switch (port) {
234 case 1:
235 irq = IRQ_SSP;
236 break;
237#if defined (CONFIG_PXA27x)
238 case 2:
239 irq = IRQ_SSP2;
240 break;
241 case 3:
242 irq = IRQ_SSP3;
243 break;
244#else
245 case 2:
246 irq = IRQ_NSSP;
247 break;
248 case 3:
249 irq = IRQ_ASSP;
250 break;
251#endif
252 default:
253 return -ENODEV;
254 }
255
256 dev->port = port;
257
258 ret = request_irq(irq, ssp_interrupt, 0, "SSP", dev);
259 if (ret)
260 goto out_region;
261
262 /* turn on SSP port clock */
263 switch (dev->port) {
264#if defined (CONFIG_PXA27x)
265 case 1:
266 pxa_set_cken(CKEN23_SSP1, 1);
267 break;
268 case 2:
269 pxa_set_cken(CKEN3_SSP2, 1);
270 break;
271 case 3:
272 pxa_set_cken(CKEN4_SSP3, 1);
273 break;
274#else
275 case 1:
276 pxa_set_cken(CKEN3_SSP, 1);
277 break;
278 case 2:
279 pxa_set_cken(CKEN9_NSSP, 1);
280 break;
281 case 3:
282 pxa_set_cken(CKEN10_ASSP, 1);
283 break;
284#endif
285 }
286
287 up(&sem);
288 return 0;
289
290out_region:
291 release_mem_region(__PREG(SSCR0_P(port)), 0x2c);
292 use_count[port - 1]--;
293 up(&sem);
294 return ret;
295}
296
297/**
298 * ssp_exit - undo the effects of ssp_init
299 *
300 * release and free resources for the SSP port.
301 */
302void ssp_exit(struct ssp_dev *dev)
303{
304 int irq;
305
306 down(&sem);
307 SSCR0_P(dev->port) &= ~SSCR0_SSE;
308
309 /* find irq, save power and turn off SSP port clock */
310 switch (dev->port) {
311#if defined (CONFIG_PXA27x)
312 case 1:
313 irq = IRQ_SSP;
314 pxa_set_cken(CKEN23_SSP1, 0);
315 break;
316 case 2:
317 irq = IRQ_SSP2;
318 pxa_set_cken(CKEN3_SSP2, 0);
319 break;
320 case 3:
321 irq = IRQ_SSP3;
322 pxa_set_cken(CKEN4_SSP3, 0);
323 break;
324#else
325 case 1:
326 irq = IRQ_SSP;
327 pxa_set_cken(CKEN3_SSP, 0);
328 break;
329 case 2:
330 irq = IRQ_NSSP;
331 pxa_set_cken(CKEN9_NSSP, 0);
332 break;
333 case 3:
334 irq = IRQ_ASSP;
335 pxa_set_cken(CKEN10_ASSP, 0);
336 break;
337#endif
338 default:
339 printk(KERN_WARNING "SSP: tried to close invalid port\n");
340 return;
341 }
342
343 free_irq(irq, dev);
344 release_mem_region(__PREG(SSCR0_P(dev->port)), 0x2c);
345 use_count[dev->port - 1]--;
346 up(&sem);
347}
348
349EXPORT_SYMBOL(ssp_write_word);
350EXPORT_SYMBOL(ssp_read_word);
351EXPORT_SYMBOL(ssp_flush);
352EXPORT_SYMBOL(ssp_enable);
353EXPORT_SYMBOL(ssp_disable);
354EXPORT_SYMBOL(ssp_save_state);
355EXPORT_SYMBOL(ssp_restore_state);
356EXPORT_SYMBOL(ssp_init);
357EXPORT_SYMBOL(ssp_exit);
358EXPORT_SYMBOL(ssp_config);
359
360MODULE_DESCRIPTION("PXA SSP driver");
361MODULE_AUTHOR("Liam Girdwood");
362MODULE_LICENSE("GPL");
363
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
new file mode 100644
index 000000000000..473fb6173f72
--- /dev/null
+++ b/arch/arm/mach-pxa/time.c
@@ -0,0 +1,164 @@
1/*
2 * arch/arm/mach-pxa/time.c
3 *
4 * Author: Nicolas Pitre
5 * Created: Jun 15, 2001
6 * Copyright: MontaVista Software Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/config.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/delay.h>
17#include <linux/interrupt.h>
18#include <linux/time.h>
19#include <linux/signal.h>
20#include <linux/errno.h>
21#include <linux/sched.h>
22
23#include <asm/system.h>
24#include <asm/hardware.h>
25#include <asm/io.h>
26#include <asm/leds.h>
27#include <asm/irq.h>
28#include <asm/mach/irq.h>
29#include <asm/mach/time.h>
30#include <asm/arch/pxa-regs.h>
31
32
33static inline unsigned long pxa_get_rtc_time(void)
34{
35 return RCNR;
36}
37
38static int pxa_set_rtc(void)
39{
40 unsigned long current_time = xtime.tv_sec;
41
42 if (RTSR & RTSR_ALE) {
43 /* make sure not to forward the clock over an alarm */
44 unsigned long alarm = RTAR;
45 if (current_time >= alarm && alarm >= RCNR)
46 return -ERESTARTSYS;
47 }
48 RCNR = current_time;
49 return 0;
50}
51
52/* IRQs are disabled before entering here from do_gettimeofday() */
53static unsigned long pxa_gettimeoffset (void)
54{
55 long ticks_to_match, elapsed, usec;
56
57 /* Get ticks before next timer match */
58 ticks_to_match = OSMR0 - OSCR;
59
60 /* We need elapsed ticks since last match */
61 elapsed = LATCH - ticks_to_match;
62
63 /* don't get fooled by the workaround in pxa_timer_interrupt() */
64 if (elapsed <= 0)
65 return 0;
66
67 /* Now convert them to usec */
68 usec = (unsigned long)(elapsed * (tick_nsec / 1000))/LATCH;
69
70 return usec;
71}
72
73static irqreturn_t
74pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
75{
76 int next_match;
77
78 write_seqlock(&xtime_lock);
79
80 /* Loop until we get ahead of the free running timer.
81 * This ensures an exact clock tick count and time accuracy.
82 * IRQs are disabled inside the loop to ensure coherence between
83 * lost_ticks (updated in do_timer()) and the match reg value, so we
84 * can use do_gettimeofday() from interrupt handlers.
85 *
86 * HACK ALERT: it seems that the PXA timer regs aren't updated right
87 * away in all cases when a write occurs. We therefore compare with
88 * 8 instead of 0 in the while() condition below to avoid missing a
89 * match if OSCR has already reached the next OSMR value.
90 * Experience has shown that up to 6 ticks are needed to work around
91 * this problem, but let's use 8 to be conservative. Note that this
92 * affect things only when the timer IRQ has been delayed by nearly
93 * exactly one tick period which should be a pretty rare event.
94 */
95 do {
96 timer_tick(regs);
97 OSSR = OSSR_M0; /* Clear match on timer 0 */
98 next_match = (OSMR0 += LATCH);
99 } while( (signed long)(next_match - OSCR) <= 8 );
100
101 write_sequnlock(&xtime_lock);
102
103 return IRQ_HANDLED;
104}
105
106static struct irqaction pxa_timer_irq = {
107 .name = "PXA Timer Tick",
108 .flags = SA_INTERRUPT,
109 .handler = pxa_timer_interrupt
110};
111
112static void __init pxa_timer_init(void)
113{
114 struct timespec tv;
115
116 set_rtc = pxa_set_rtc;
117
118 tv.tv_nsec = 0;
119 tv.tv_sec = pxa_get_rtc_time();
120 do_settimeofday(&tv);
121
122 OSMR0 = 0; /* set initial match at 0 */
123 OSSR = 0xf; /* clear status on all timers */
124 setup_irq(IRQ_OST0, &pxa_timer_irq);
125 OIER |= OIER_E0; /* enable match on timer 0 to cause interrupts */
126 OSCR = 0; /* initialize free-running timer, force first match */
127}
128
129#ifdef CONFIG_PM
130static unsigned long osmr[4], oier;
131
132static void pxa_timer_suspend(void)
133{
134 osmr[0] = OSMR0;
135 osmr[1] = OSMR1;
136 osmr[2] = OSMR2;
137 osmr[3] = OSMR3;
138 oier = OIER;
139}
140
141static void pxa_timer_resume(void)
142{
143 OSMR0 = osmr[0];
144 OSMR1 = osmr[1];
145 OSMR2 = osmr[2];
146 OSMR3 = osmr[3];
147 OIER = oier;
148
149 /*
150 * OSMR0 is the system timer: make sure OSCR is sufficiently behind
151 */
152 OSCR = OSMR0 - LATCH;
153}
154#else
155#define pxa_timer_suspend NULL
156#define pxa_timer_resume NULL
157#endif
158
159struct sys_timer pxa_timer = {
160 .init = pxa_timer_init,
161 .suspend = pxa_timer_suspend,
162 .resume = pxa_timer_resume,
163 .offset = pxa_gettimeoffset,
164};
diff --git a/arch/arm/mach-rpc/Makefile b/arch/arm/mach-rpc/Makefile
new file mode 100644
index 000000000000..aa77bc9efbbb
--- /dev/null
+++ b/arch/arm/mach-rpc/Makefile
@@ -0,0 +1,11 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := dma.o irq.o riscpc.o
8obj-m :=
9obj-n :=
10obj- :=
11
diff --git a/arch/arm/mach-rpc/Makefile.boot b/arch/arm/mach-rpc/Makefile.boot
new file mode 100644
index 000000000000..9c9e7685ec7c
--- /dev/null
+++ b/arch/arm/mach-rpc/Makefile.boot
@@ -0,0 +1,4 @@
1 zreladdr-y := 0x10008000
2params_phys-y := 0x10000100
3initrd_phys-y := 0x18000000
4
diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c
new file mode 100644
index 000000000000..bc0747439fb3
--- /dev/null
+++ b/arch/arm/mach-rpc/dma.c
@@ -0,0 +1,338 @@
1/*
2 * linux/arch/arm/mach-rpc/dma.c
3 *
4 * Copyright (C) 1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * DMA functions specific to RiscPC architecture
11 */
12#include <linux/slab.h>
13#include <linux/mman.h>
14#include <linux/init.h>
15#include <linux/interrupt.h>
16#include <linux/pci.h>
17
18#include <asm/page.h>
19#include <asm/dma.h>
20#include <asm/fiq.h>
21#include <asm/io.h>
22#include <asm/irq.h>
23#include <asm/hardware.h>
24#include <asm/uaccess.h>
25
26#include <asm/mach/dma.h>
27#include <asm/hardware/iomd.h>
28
29#if 0
30typedef enum {
31 dma_size_8 = 1,
32 dma_size_16 = 2,
33 dma_size_32 = 4,
34 dma_size_128 = 16
35} dma_size_t;
36#endif
37
38#define TRANSFER_SIZE 2
39
40#define CURA (0)
41#define ENDA (IOMD_IO0ENDA - IOMD_IO0CURA)
42#define CURB (IOMD_IO0CURB - IOMD_IO0CURA)
43#define ENDB (IOMD_IO0ENDB - IOMD_IO0CURA)
44#define CR (IOMD_IO0CR - IOMD_IO0CURA)
45#define ST (IOMD_IO0ST - IOMD_IO0CURA)
46
47static void iomd_get_next_sg(struct scatterlist *sg, dma_t *dma)
48{
49 unsigned long end, offset, flags = 0;
50
51 if (dma->sg) {
52 sg->dma_address = dma->sg->dma_address;
53 offset = sg->dma_address & ~PAGE_MASK;
54
55 end = offset + dma->sg->length;
56
57 if (end > PAGE_SIZE)
58 end = PAGE_SIZE;
59
60 if (offset + TRANSFER_SIZE >= end)
61 flags |= DMA_END_L;
62
63 sg->length = end - TRANSFER_SIZE;
64
65 dma->sg->length -= end - offset;
66 dma->sg->dma_address += end - offset;
67
68 if (dma->sg->length == 0) {
69 if (dma->sgcount > 1) {
70 dma->sg++;
71 dma->sgcount--;
72 } else {
73 dma->sg = NULL;
74 flags |= DMA_END_S;
75 }
76 }
77 } else {
78 flags = DMA_END_S | DMA_END_L;
79 sg->dma_address = 0;
80 sg->length = 0;
81 }
82
83 sg->length |= flags;
84}
85
86static irqreturn_t iomd_dma_handle(int irq, void *dev_id, struct pt_regs *regs)
87{
88 dma_t *dma = (dma_t *)dev_id;
89 unsigned long base = dma->dma_base;
90
91 do {
92 unsigned int status;
93
94 status = iomd_readb(base + ST);
95 if (!(status & DMA_ST_INT))
96 return IRQ_HANDLED;
97
98 if ((dma->state ^ status) & DMA_ST_AB)
99 iomd_get_next_sg(&dma->cur_sg, dma);
100
101 switch (status & (DMA_ST_OFL | DMA_ST_AB)) {
102 case DMA_ST_OFL: /* OIA */
103 case DMA_ST_AB: /* .IB */
104 iomd_writel(dma->cur_sg.dma_address, base + CURA);
105 iomd_writel(dma->cur_sg.length, base + ENDA);
106 dma->state = DMA_ST_AB;
107 break;
108
109 case DMA_ST_OFL | DMA_ST_AB: /* OIB */
110 case 0: /* .IA */
111 iomd_writel(dma->cur_sg.dma_address, base + CURB);
112 iomd_writel(dma->cur_sg.length, base + ENDB);
113 dma->state = 0;
114 break;
115 }
116
117 if (status & DMA_ST_OFL &&
118 dma->cur_sg.length == (DMA_END_S|DMA_END_L))
119 break;
120 } while (1);
121
122 dma->state = ~DMA_ST_AB;
123 disable_irq(irq);
124
125 return IRQ_HANDLED;
126}
127
128static int iomd_request_dma(dmach_t channel, dma_t *dma)
129{
130 return request_irq(dma->dma_irq, iomd_dma_handle,
131 SA_INTERRUPT, dma->device_id, dma);
132}
133
134static void iomd_free_dma(dmach_t channel, dma_t *dma)
135{
136 free_irq(dma->dma_irq, dma);
137}
138
139static void iomd_enable_dma(dmach_t channel, dma_t *dma)
140{
141 unsigned long dma_base = dma->dma_base;
142 unsigned int ctrl = TRANSFER_SIZE | DMA_CR_E;
143
144 if (dma->invalid) {
145 dma->invalid = 0;
146
147 /*
148 * Cope with ISA-style drivers which expect cache
149 * coherence.
150 */
151 if (!dma->using_sg) {
152 dma->buf.dma_address = pci_map_single(NULL,
153 dma->buf.__address, dma->buf.length,
154 dma->dma_mode == DMA_MODE_READ ?
155 PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE);
156 }
157
158 iomd_writeb(DMA_CR_C, dma_base + CR);
159 dma->state = DMA_ST_AB;
160 }
161
162 if (dma->dma_mode == DMA_MODE_READ)
163 ctrl |= DMA_CR_D;
164
165 iomd_writeb(ctrl, dma_base + CR);
166 enable_irq(dma->dma_irq);
167}
168
169static void iomd_disable_dma(dmach_t channel, dma_t *dma)
170{
171 unsigned long dma_base = dma->dma_base;
172 unsigned long flags;
173
174 local_irq_save(flags);
175 if (dma->state != ~DMA_ST_AB)
176 disable_irq(dma->dma_irq);
177 iomd_writeb(0, dma_base + CR);
178 local_irq_restore(flags);
179}
180
181static int iomd_set_dma_speed(dmach_t channel, dma_t *dma, int cycle)
182{
183 int tcr, speed;
184
185 if (cycle < 188)
186 speed = 3;
187 else if (cycle <= 250)
188 speed = 2;
189 else if (cycle < 438)
190 speed = 1;
191 else
192 speed = 0;
193
194 tcr = iomd_readb(IOMD_DMATCR);
195 speed &= 3;
196
197 switch (channel) {
198 case DMA_0:
199 tcr = (tcr & ~0x03) | speed;
200 break;
201
202 case DMA_1:
203 tcr = (tcr & ~0x0c) | (speed << 2);
204 break;
205
206 case DMA_2:
207 tcr = (tcr & ~0x30) | (speed << 4);
208 break;
209
210 case DMA_3:
211 tcr = (tcr & ~0xc0) | (speed << 6);
212 break;
213
214 default:
215 break;
216 }
217
218 iomd_writeb(tcr, IOMD_DMATCR);
219
220 return speed;
221}
222
223static struct dma_ops iomd_dma_ops = {
224 .type = "IOMD",
225 .request = iomd_request_dma,
226 .free = iomd_free_dma,
227 .enable = iomd_enable_dma,
228 .disable = iomd_disable_dma,
229 .setspeed = iomd_set_dma_speed,
230};
231
232static struct fiq_handler fh = {
233 .name = "floppydma"
234};
235
236static void floppy_enable_dma(dmach_t channel, dma_t *dma)
237{
238 void *fiqhandler_start;
239 unsigned int fiqhandler_length;
240 struct pt_regs regs;
241
242 if (dma->using_sg)
243 BUG();
244
245 if (dma->dma_mode == DMA_MODE_READ) {
246 extern unsigned char floppy_fiqin_start, floppy_fiqin_end;
247 fiqhandler_start = &floppy_fiqin_start;
248 fiqhandler_length = &floppy_fiqin_end - &floppy_fiqin_start;
249 } else {
250 extern unsigned char floppy_fiqout_start, floppy_fiqout_end;
251 fiqhandler_start = &floppy_fiqout_start;
252 fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start;
253 }
254
255 regs.ARM_r9 = dma->buf.length;
256 regs.ARM_r10 = (unsigned long)dma->buf.__address;
257 regs.ARM_fp = (unsigned long)FLOPPYDMA_BASE;
258
259 if (claim_fiq(&fh)) {
260 printk("floppydma: couldn't claim FIQ.\n");
261 return;
262 }
263
264 set_fiq_handler(fiqhandler_start, fiqhandler_length);
265 set_fiq_regs(&regs);
266 enable_fiq(dma->dma_irq);
267}
268
269static void floppy_disable_dma(dmach_t channel, dma_t *dma)
270{
271 disable_fiq(dma->dma_irq);
272 release_fiq(&fh);
273}
274
275static int floppy_get_residue(dmach_t channel, dma_t *dma)
276{
277 struct pt_regs regs;
278 get_fiq_regs(&regs);
279 return regs.ARM_r9;
280}
281
282static struct dma_ops floppy_dma_ops = {
283 .type = "FIQDMA",
284 .enable = floppy_enable_dma,
285 .disable = floppy_disable_dma,
286 .residue = floppy_get_residue,
287};
288
289/*
290 * This is virtual DMA - we don't need anything here.
291 */
292static void sound_enable_disable_dma(dmach_t channel, dma_t *dma)
293{
294}
295
296static struct dma_ops sound_dma_ops = {
297 .type = "VIRTUAL",
298 .enable = sound_enable_disable_dma,
299 .disable = sound_enable_disable_dma,
300};
301
302void __init arch_dma_init(dma_t *dma)
303{
304 iomd_writeb(0, IOMD_IO0CR);
305 iomd_writeb(0, IOMD_IO1CR);
306 iomd_writeb(0, IOMD_IO2CR);
307 iomd_writeb(0, IOMD_IO3CR);
308
309 iomd_writeb(0xa0, IOMD_DMATCR);
310
311 dma[DMA_0].dma_base = IOMD_IO0CURA;
312 dma[DMA_0].dma_irq = IRQ_DMA0;
313 dma[DMA_0].d_ops = &iomd_dma_ops;
314 dma[DMA_1].dma_base = IOMD_IO1CURA;
315 dma[DMA_1].dma_irq = IRQ_DMA1;
316 dma[DMA_1].d_ops = &iomd_dma_ops;
317 dma[DMA_2].dma_base = IOMD_IO2CURA;
318 dma[DMA_2].dma_irq = IRQ_DMA2;
319 dma[DMA_2].d_ops = &iomd_dma_ops;
320 dma[DMA_3].dma_base = IOMD_IO3CURA;
321 dma[DMA_3].dma_irq = IRQ_DMA3;
322 dma[DMA_3].d_ops = &iomd_dma_ops;
323 dma[DMA_S0].dma_base = IOMD_SD0CURA;
324 dma[DMA_S0].dma_irq = IRQ_DMAS0;
325 dma[DMA_S0].d_ops = &iomd_dma_ops;
326 dma[DMA_S1].dma_base = IOMD_SD1CURA;
327 dma[DMA_S1].dma_irq = IRQ_DMAS1;
328 dma[DMA_S1].d_ops = &iomd_dma_ops;
329 dma[DMA_VIRTUAL_FLOPPY].dma_irq = FIQ_FLOPPYDATA;
330 dma[DMA_VIRTUAL_FLOPPY].d_ops = &floppy_dma_ops;
331 dma[DMA_VIRTUAL_SOUND].d_ops = &sound_dma_ops;
332
333 /*
334 * Setup DMA channels 2,3 to be for podules
335 * and channels 0,1 for internal devices
336 */
337 iomd_writeb(DMA_EXT_IO3|DMA_EXT_IO2, IOMD_DMAEXT);
338}
diff --git a/arch/arm/mach-rpc/irq.c b/arch/arm/mach-rpc/irq.c
new file mode 100644
index 000000000000..56b2716f8cf5
--- /dev/null
+++ b/arch/arm/mach-rpc/irq.c
@@ -0,0 +1,162 @@
1#include <linux/init.h>
2#include <linux/list.h>
3
4#include <asm/mach/irq.h>
5#include <asm/hardware/iomd.h>
6#include <asm/irq.h>
7#include <asm/io.h>
8
9static void iomd_ack_irq_a(unsigned int irq)
10{
11 unsigned int val, mask;
12
13 mask = 1 << irq;
14 val = iomd_readb(IOMD_IRQMASKA);
15 iomd_writeb(val & ~mask, IOMD_IRQMASKA);
16 iomd_writeb(mask, IOMD_IRQCLRA);
17}
18
19static void iomd_mask_irq_a(unsigned int irq)
20{
21 unsigned int val, mask;
22
23 mask = 1 << irq;
24 val = iomd_readb(IOMD_IRQMASKA);
25 iomd_writeb(val & ~mask, IOMD_IRQMASKA);
26}
27
28static void iomd_unmask_irq_a(unsigned int irq)
29{
30 unsigned int val, mask;
31
32 mask = 1 << irq;
33 val = iomd_readb(IOMD_IRQMASKA);
34 iomd_writeb(val | mask, IOMD_IRQMASKA);
35}
36
37static struct irqchip iomd_a_chip = {
38 .ack = iomd_ack_irq_a,
39 .mask = iomd_mask_irq_a,
40 .unmask = iomd_unmask_irq_a,
41};
42
43static void iomd_mask_irq_b(unsigned int irq)
44{
45 unsigned int val, mask;
46
47 mask = 1 << (irq & 7);
48 val = iomd_readb(IOMD_IRQMASKB);
49 iomd_writeb(val & ~mask, IOMD_IRQMASKB);
50}
51
52static void iomd_unmask_irq_b(unsigned int irq)
53{
54 unsigned int val, mask;
55
56 mask = 1 << (irq & 7);
57 val = iomd_readb(IOMD_IRQMASKB);
58 iomd_writeb(val | mask, IOMD_IRQMASKB);
59}
60
61static struct irqchip iomd_b_chip = {
62 .ack = iomd_mask_irq_b,
63 .mask = iomd_mask_irq_b,
64 .unmask = iomd_unmask_irq_b,
65};
66
67static void iomd_mask_irq_dma(unsigned int irq)
68{
69 unsigned int val, mask;
70
71 mask = 1 << (irq & 7);
72 val = iomd_readb(IOMD_DMAMASK);
73 iomd_writeb(val & ~mask, IOMD_DMAMASK);
74}
75
76static void iomd_unmask_irq_dma(unsigned int irq)
77{
78 unsigned int val, mask;
79
80 mask = 1 << (irq & 7);
81 val = iomd_readb(IOMD_DMAMASK);
82 iomd_writeb(val | mask, IOMD_DMAMASK);
83}
84
85static struct irqchip iomd_dma_chip = {
86 .ack = iomd_mask_irq_dma,
87 .mask = iomd_mask_irq_dma,
88 .unmask = iomd_unmask_irq_dma,
89};
90
91static void iomd_mask_irq_fiq(unsigned int irq)
92{
93 unsigned int val, mask;
94
95 mask = 1 << (irq & 7);
96 val = iomd_readb(IOMD_FIQMASK);
97 iomd_writeb(val & ~mask, IOMD_FIQMASK);
98}
99
100static void iomd_unmask_irq_fiq(unsigned int irq)
101{
102 unsigned int val, mask;
103
104 mask = 1 << (irq & 7);
105 val = iomd_readb(IOMD_FIQMASK);
106 iomd_writeb(val | mask, IOMD_FIQMASK);
107}
108
109static struct irqchip iomd_fiq_chip = {
110 .ack = iomd_mask_irq_fiq,
111 .mask = iomd_mask_irq_fiq,
112 .unmask = iomd_unmask_irq_fiq,
113};
114
115void __init rpc_init_irq(void)
116{
117 unsigned int irq, flags;
118
119 iomd_writeb(0, IOMD_IRQMASKA);
120 iomd_writeb(0, IOMD_IRQMASKB);
121 iomd_writeb(0, IOMD_FIQMASK);
122 iomd_writeb(0, IOMD_DMAMASK);
123
124 for (irq = 0; irq < NR_IRQS; irq++) {
125 flags = IRQF_VALID;
126
127 if (irq <= 6 || (irq >= 9 && irq <= 15))
128 flags |= IRQF_PROBE;
129
130 if (irq == 21 || (irq >= 16 && irq <= 19) ||
131 irq == IRQ_KEYBOARDTX)
132 flags |= IRQF_NOAUTOEN;
133
134 switch (irq) {
135 case 0 ... 7:
136 set_irq_chip(irq, &iomd_a_chip);
137 set_irq_handler(irq, do_level_IRQ);
138 set_irq_flags(irq, flags);
139 break;
140
141 case 8 ... 15:
142 set_irq_chip(irq, &iomd_b_chip);
143 set_irq_handler(irq, do_level_IRQ);
144 set_irq_flags(irq, flags);
145 break;
146
147 case 16 ... 21:
148 set_irq_chip(irq, &iomd_dma_chip);
149 set_irq_handler(irq, do_level_IRQ);
150 set_irq_flags(irq, flags);
151 break;
152
153 case 64 ... 71:
154 set_irq_chip(irq, &iomd_fiq_chip);
155 set_irq_flags(irq, IRQF_VALID);
156 break;
157 }
158 }
159
160 init_FIQ();
161}
162
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
new file mode 100644
index 000000000000..815c53225cd8
--- /dev/null
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -0,0 +1,179 @@
1/*
2 * linux/arch/arm/mach-rpc/riscpc.c
3 *
4 * Copyright (C) 1998-2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Architecture specific fixups.
11 */
12#include <linux/kernel.h>
13#include <linux/tty.h>
14#include <linux/delay.h>
15#include <linux/pm.h>
16#include <linux/init.h>
17#include <linux/sched.h>
18#include <linux/device.h>
19#include <linux/serial_8250.h>
20
21#include <asm/elf.h>
22#include <asm/io.h>
23#include <asm/mach-types.h>
24#include <asm/hardware.h>
25#include <asm/page.h>
26#include <asm/domain.h>
27#include <asm/setup.h>
28
29#include <asm/mach/map.h>
30#include <asm/mach/arch.h>
31#include <asm/mach/time.h>
32
33extern void rpc_init_irq(void);
34
35extern unsigned int vram_size;
36
37#if 0
38
39unsigned int memc_ctrl_reg;
40unsigned int number_mfm_drives;
41
42static int __init parse_tag_acorn(const struct tag *tag)
43{
44 memc_ctrl_reg = tag->u.acorn.memc_control_reg;
45 number_mfm_drives = tag->u.acorn.adfsdrives;
46
47 switch (tag->u.acorn.vram_pages) {
48 case 512:
49 vram_size += PAGE_SIZE * 256;
50 case 256:
51 vram_size += PAGE_SIZE * 256;
52 default:
53 break;
54 }
55#if 0
56 if (vram_size) {
57 desc->video_start = 0x02000000;
58 desc->video_end = 0x02000000 + vram_size;
59 }
60#endif
61 return 0;
62}
63
64__tagtable(ATAG_ACORN, parse_tag_acorn);
65
66#endif
67
68static struct map_desc rpc_io_desc[] __initdata = {
69 { SCREEN_BASE, SCREEN_START, 2*1048576, MT_DEVICE }, /* VRAM */
70 { (u32)IO_BASE, IO_START, IO_SIZE , MT_DEVICE }, /* IO space */
71 { EASI_BASE, EASI_START, EASI_SIZE, MT_DEVICE } /* EASI space */
72};
73
74static void __init rpc_map_io(void)
75{
76 iotable_init(rpc_io_desc, ARRAY_SIZE(rpc_io_desc));
77
78 /*
79 * Turn off floppy.
80 */
81 outb(0xc, 0x3f2);
82
83 /*
84 * RiscPC can't handle half-word loads and stores
85 */
86 elf_hwcap &= ~HWCAP_HALF;
87}
88
89static struct resource acornfb_resources[] = {
90 { /* VIDC */
91 .start = 0x03400000,
92 .end = 0x035fffff,
93 .flags = IORESOURCE_MEM,
94 }, {
95 .start = IRQ_VSYNCPULSE,
96 .end = IRQ_VSYNCPULSE,
97 .flags = IORESOURCE_IRQ,
98 },
99};
100
101static struct platform_device acornfb_device = {
102 .name = "acornfb",
103 .id = -1,
104 .dev = {
105 .coherent_dma_mask = 0xffffffff,
106 },
107 .num_resources = ARRAY_SIZE(acornfb_resources),
108 .resource = acornfb_resources,
109};
110
111static struct resource iomd_resources[] = {
112 {
113 .start = 0x03200000,
114 .end = 0x0320ffff,
115 .flags = IORESOURCE_MEM,
116 },
117};
118
119static struct platform_device iomd_device = {
120 .name = "iomd",
121 .id = -1,
122 .num_resources = ARRAY_SIZE(iomd_resources),
123 .resource = iomd_resources,
124};
125
126static struct platform_device kbd_device = {
127 .name = "kart",
128 .id = -1,
129 .dev = {
130 .parent = &iomd_device.dev,
131 },
132};
133
134static struct plat_serial8250_port serial_platform_data[] = {
135 {
136 .mapbase = 0x03010fe0,
137 .irq = 10,
138 .uartclk = 1843200,
139 .regshift = 2,
140 .iotype = UPIO_MEM,
141 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
142 },
143 { },
144};
145
146static struct platform_device serial_device = {
147 .name = "serial8250",
148 .id = 0,
149 .dev = {
150 .platform_data = serial_platform_data,
151 },
152};
153
154static struct platform_device *devs[] __initdata = {
155 &iomd_device,
156 &kbd_device,
157 &serial_device,
158 &acornfb_device,
159};
160
161static int __init rpc_init(void)
162{
163 return platform_add_devices(devs, ARRAY_SIZE(devs));
164}
165
166arch_initcall(rpc_init);
167
168extern struct sys_timer ioc_timer;
169
170MACHINE_START(RISCPC, "Acorn-RiscPC")
171 MAINTAINER("Russell King")
172 BOOT_MEM(0x10000000, 0x03000000, 0xe0000000)
173 BOOT_PARAMS(0x10000100)
174 DISABLE_PARPORT(0)
175 DISABLE_PARPORT(1)
176 MAPIO(rpc_map_io)
177 INITIRQ(rpc_init_irq)
178 .timer = &ioc_timer,
179MACHINE_END
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
new file mode 100644
index 000000000000..534df0c6c770
--- /dev/null
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -0,0 +1,169 @@
1if ARCH_S3C2410
2
3menu "S3C24XX Implementations"
4
5config ARCH_BAST
6 bool "Simtec Electronics BAST (EB2410ITX)"
7 select CPU_S3C2410
8 help
9 Say Y here if you are using the Simtec Electronics EB2410ITX
10 development board (also known as BAST)
11
12 Product page: <http://www.simtec.co.uk/products/EB2410ITX/>.
13
14config ARCH_H1940
15 bool "IPAQ H1940"
16 select CPU_S3C2410
17 help
18 Say Y here if you are using the HP IPAQ H1940
19
20 <http://www.handhelds.org/projects/h1940.html>.
21
22config MACH_N30
23 bool "Acer N30"
24 select CPU_S3C2410
25 help
26 Say Y here if you are using the Acer N30
27
28 <http://zoo.weinigel.se/n30>.
29
30config ARCH_SMDK2410
31 bool "SMDK2410/A9M2410"
32 select CPU_S3C2410
33 help
34 Say Y here if you are using the SMDK2410 or the derived module A9M2410
35 <http://www.fsforth.de>
36
37config ARCH_S3C2440
38 bool "SMDK2440"
39 select CPU_S3C2440
40 help
41 Say Y here if you are using the SMDK2440.
42
43config MACH_VR1000
44 bool "Thorcom VR1000"
45 select CPU_S3C2410
46 help
47 Say Y here if you are using the Thorcom VR1000 board.
48
49 This linux port is currently being maintained by Simtec, on behalf
50 of Thorcom. Any queries, please contact Thorcom first.
51
52config MACH_RX3715
53 bool "HP iPAQ rx3715"
54 select CPU_S3C2440
55 help
56 Say Y here if you are using the HP iPAQ rx3715.
57
58 See <http://www.handhelds.org/projects/rx3715.html> for more
59 information on this project
60
61config MACH_OTOM
62 bool "NexVision OTOM Board"
63 select CPU_S3C2410
64 help
65 Say Y here if you are using the Nex Vision OTOM board
66
67config MACH_NEXCODER_2440
68 bool "NexVision NEXCODER 2440 Light Board"
69 select CPU_S3C2440
70 help
71 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board
72
73endmenu
74
75config CPU_S3C2410
76 bool
77 depends on ARCH_S3C2410
78 help
79 Support for S3C2410 and S3C2410A family from the S3C24XX line
80 of Samsung Mobile CPUs.
81
82config CPU_S3C2440
83 bool
84 depends on ARCH_S3C2410
85 help
86 Support for S3C2440 Samsung Mobile CPU based systems.
87
88comment "S3C2410 Boot"
89
90config S3C2410_BOOT_WATCHDOG
91 bool "S3C2410 Initialisation watchdog"
92 depends on ARCH_S3C2410 && S3C2410_WATCHDOG
93 help
94 Say y to enable the watchdog during the kernel decompression
95 stage. If the kernel fails to uncompress, then the watchdog
96 will trigger a reset and the system should restart.
97
98 Although this uses the same hardware unit as the kernel watchdog
99 driver, it is not a replacement for it. If you use this option,
100 you will have to use the watchdg driver to either stop the timeout
101 or restart it. If you do not, then your kernel will reboot after
102 startup.
103
104 The driver uses a fixed timeout value, so the exact time till the
105 system resets depends on the value of PCLK. The timeout on an
106 200MHz s3c2410 should be about 30 seconds.
107
108comment "S3C2410 Setup"
109
110config S3C2410_DMA
111 bool "S3C2410 DMA support"
112 depends on ARCH_S3C2410
113 help
114 S3C2410 DMA support. This is needed for drivers like sound which
115 use the S3C2410's DMA system to move data to and from the
116 peripheral blocks.
117
118config S3C2410_DMA_DEBUG
119 bool "S3C2410 DMA support debug"
120 depends on ARCH_S3C2410 && S3C2410_DMA
121 help
122 Enable debugging output for the DMA code. This option sends info
123 to the kernel log, at priority KERN_DEBUG.
124
125 Note, it is easy to create and fill the log buffer in a small
126 amount of time, as well as using an significant percentage of
127 the CPU time doing so.
128
129
130config S3C2410_PM_DEBUG
131 bool "S3C2410 PM Suspend debug"
132 depends on ARCH_S3C2410 && PM
133 help
134 Say Y here if you want verbose debugging from the PM Suspend and
135 Resume code. See `Documentation/arm/Samsing-S3C24XX/Suspend.txt`
136 for more information.
137
138config S3C2410_PM_CHECK
139 bool "S3C2410 PM Suspend Memory CRC"
140 depends on ARCH_S3C2410 && PM && CRC32
141 help
142 Enable the PM code's memory area checksum over sleep. This option
143 will generate CRCs of all blocks of memory, and store them before
144 going to sleep. The blocks are then checked on resume for any
145 errors.
146
147config S3C2410_PM_CHECK_CHUNKSIZE
148 int "S3C2410 PM Suspend CRC Chunksize (KiB)"
149 depends on ARCH_S3C2410 && PM && S3C2410_PM_CHECK
150 default 64
151 help
152 Set the chunksize in Kilobytes of the CRC for checking memory
153 corruption over suspend and resume. A smaller value will mean that
154 the CRC data block will take more memory, but wil identify any
155 faults with better precision.
156
157config S3C2410_LOWLEVEL_UART_PORT
158 int "S3C2410 UART to use for low-level messages"
159 default 0
160 help
161 Choice of which UART port to use for the low-level messages,
162 such as the `Uncompressing...` at start time. The value of
163 this configuration should be between zero and two. The port
164 must have been initialised by the boot-loader before use.
165
166 Note, this does not affect the port used by the debug messages,
167 which is a separate configuration.
168
169endif
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
new file mode 100644
index 000000000000..7c379aad5d62
--- /dev/null
+++ b/arch/arm/mach-s3c2410/Makefile
@@ -0,0 +1,36 @@
1
2#
3# Makefile for the linux kernel.
4#
5
6# Object file lists.
7
8obj-y := cpu.o irq.o time.o gpio.o clock.o devs.o
9obj-m :=
10obj-n :=
11obj- :=
12
13# S3C2410 support files
14
15obj-$(CONFIG_CPU_S3C2410) += s3c2410.o
16obj-$(CONFIG_S3C2410_DMA) += dma.o
17
18# Power Management support
19
20obj-$(CONFIG_PM) += pm.o sleep.o
21
22# S3C2440 support
23
24obj-$(CONFIG_CPU_S3C2440) += s3c2440.o s3c2440-dsc.o
25
26# machine specific support
27
28obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o
29obj-$(CONFIG_ARCH_H1940) += mach-h1940.o
30obj-$(CONFIG_MACH_N30) += mach-n30.o
31obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o
32obj-$(CONFIG_ARCH_S3C2440) += mach-smdk2440.o
33obj-$(CONFIG_MACH_VR1000) += mach-vr1000.o usb-simtec.o
34obj-$(CONFIG_MACH_RX3715) += mach-rx3715.o
35obj-$(CONFIG_MACH_OTOM) += mach-otom.o
36obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
diff --git a/arch/arm/mach-s3c2410/Makefile.boot b/arch/arm/mach-s3c2410/Makefile.boot
new file mode 100644
index 000000000000..7dab2a0325b5
--- /dev/null
+++ b/arch/arm/mach-s3c2410/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x30008000
2params_phys-y := 0x30000100
3
diff --git a/arch/arm/mach-s3c2410/bast-irq.c b/arch/arm/mach-s3c2410/bast-irq.c
new file mode 100644
index 000000000000..5e5bbe893cbb
--- /dev/null
+++ b/arch/arm/mach-s3c2410/bast-irq.c
@@ -0,0 +1,132 @@
1/* linux/arch/arm/mach-s3c2410/bast-irq.c
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 * Modifications:
23 * 08-Jan-2003 BJD Moved from central IRQ code
24 */
25
26
27#include <linux/init.h>
28#include <linux/module.h>
29#include <linux/ioport.h>
30#include <linux/ptrace.h>
31#include <linux/sysdev.h>
32
33#include <asm/hardware.h>
34#include <asm/irq.h>
35#include <asm/io.h>
36
37#include <asm/mach/irq.h>
38#include <asm/hardware/s3c2410/irq.h>
39
40#if 0
41#include <asm/debug-ll.h>
42#endif
43
44#define irqdbf(x...)
45#define irqdbf2(x...)
46
47
48/* handle PC104 ISA interrupts from the system CPLD */
49
50/* table of ISA irq nos to the relevant mask... zero means
51 * the irq is not implemented
52*/
53static unsigned char bast_pc104_irqmasks[] = {
54 0, /* 0 */
55 0, /* 1 */
56 0, /* 2 */
57 1, /* 3 */
58 0, /* 4 */
59 2, /* 5 */
60 0, /* 6 */
61 4, /* 7 */
62 0, /* 8 */
63 0, /* 9 */
64 8, /* 10 */
65 0, /* 11 */
66 0, /* 12 */
67 0, /* 13 */
68 0, /* 14 */
69 0, /* 15 */
70};
71
72static unsigned char bast_pc104_irqs[] = { 3, 5, 7, 10 };
73
74static void
75bast_pc104_mask(unsigned int irqno)
76{
77 unsigned long temp;
78
79 temp = __raw_readb(BAST_VA_PC104_IRQMASK);
80 temp &= ~bast_pc104_irqmasks[irqno];
81 __raw_writeb(temp, BAST_VA_PC104_IRQMASK);
82
83 if (temp == 0)
84 bast_extint_mask(IRQ_ISA);
85}
86
87static void
88bast_pc104_ack(unsigned int irqno)
89{
90 bast_extint_ack(IRQ_ISA);
91}
92
93static void
94bast_pc104_unmask(unsigned int irqno)
95{
96 unsigned long temp;
97
98 temp = __raw_readb(BAST_VA_PC104_IRQMASK);
99 temp |= bast_pc104_irqmasks[irqno];
100 __raw_writeb(temp, BAST_VA_PC104_IRQMASK);
101
102 bast_extint_unmask(IRQ_ISA);
103}
104
105static struct bast_pc104_chip = {
106 .mask = bast_pc104_mask,
107 .unmask = bast_pc104_unmask,
108 .ack = bast_pc104_ack
109};
110
111static void
112bast_irq_pc104_demux(unsigned int irq,
113 struct irqdesc *desc,
114 struct pt_regs *regs)
115{
116 unsigned int stat;
117 unsigned int irqno;
118 int i;
119
120 stat = __raw_readb(BAST_VA_PC104_IRQREQ) & 0xf;
121
122 for (i = 0; i < 4 && stat != 0; i++) {
123 if (stat & 1) {
124 irqno = bast_pc104_irqs[i];
125 desc = irq_desc + irqno;
126
127 desc->handle(irqno, desc, regs);
128 }
129
130 stat >>= 1;
131 }
132}
diff --git a/arch/arm/mach-s3c2410/bast.h b/arch/arm/mach-s3c2410/bast.h
new file mode 100644
index 000000000000..e5d03311752c
--- /dev/null
+++ b/arch/arm/mach-s3c2410/bast.h
@@ -0,0 +1,2 @@
1
2extern void bast_init_irq(void);
diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c
new file mode 100644
index 000000000000..e23f534d4e1d
--- /dev/null
+++ b/arch/arm/mach-s3c2410/clock.c
@@ -0,0 +1,507 @@
1/* linux/arch/arm/mach-s3c2410/clock.c
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 Clock control support
7 *
8 * Based on, and code from linux/arch/arm/mach-versatile/clock.c
9 **
10 ** Copyright (C) 2004 ARM Limited.
11 ** Written by Deep Blue Solutions Limited.
12 *
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (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, MA 02111-1307 USA
27*/
28
29#include <linux/init.h>
30#include <linux/module.h>
31#include <linux/kernel.h>
32#include <linux/list.h>
33#include <linux/errno.h>
34#include <linux/err.h>
35#include <linux/device.h>
36#include <linux/sysdev.h>
37
38#include <linux/interrupt.h>
39#include <linux/ioport.h>
40
41#include <asm/hardware.h>
42#include <asm/atomic.h>
43#include <asm/irq.h>
44#include <asm/io.h>
45
46#include <asm/hardware/clock.h>
47#include <asm/arch/regs-clock.h>
48
49#include "clock.h"
50#include "cpu.h"
51
52/* clock information */
53
54static LIST_HEAD(clocks);
55static DECLARE_MUTEX(clocks_sem);
56
57/* old functions */
58
59void inline s3c24xx_clk_enable(unsigned int clocks, unsigned int enable)
60{
61 unsigned long clkcon;
62 unsigned long flags;
63
64 local_irq_save(flags);
65
66 clkcon = __raw_readl(S3C2410_CLKCON);
67 clkcon &= ~clocks;
68
69 if (enable)
70 clkcon |= clocks;
71
72 /* ensure none of the special function bits set */
73 clkcon &= ~(S3C2410_CLKCON_IDLE|S3C2410_CLKCON_POWER);
74
75 __raw_writel(clkcon, S3C2410_CLKCON);
76
77 local_irq_restore(flags);
78}
79
80/* enable and disable calls for use with the clk struct */
81
82static int clk_null_enable(struct clk *clk, int enable)
83{
84 return 0;
85}
86
87int s3c24xx_clkcon_enable(struct clk *clk, int enable)
88{
89 s3c24xx_clk_enable(clk->ctrlbit, enable);
90 return 0;
91}
92
93/* Clock API calls */
94
95struct clk *clk_get(struct device *dev, const char *id)
96{
97 struct clk *p;
98 struct clk *clk = ERR_PTR(-ENOENT);
99 int idno;
100
101 idno = (dev == NULL) ? -1 : to_platform_device(dev)->id;
102
103 down(&clocks_sem);
104
105 list_for_each_entry(p, &clocks, list) {
106 if (p->id == idno &&
107 strcmp(id, p->name) == 0 &&
108 try_module_get(p->owner)) {
109 clk = p;
110 break;
111 }
112 }
113
114 /* check for the case where a device was supplied, but the
115 * clock that was being searched for is not device specific */
116
117 if (IS_ERR(clk)) {
118 list_for_each_entry(p, &clocks, list) {
119 if (p->id == -1 && strcmp(id, p->name) == 0 &&
120 try_module_get(p->owner)) {
121 clk = p;
122 break;
123 }
124 }
125 }
126
127 up(&clocks_sem);
128 return clk;
129}
130
131void clk_put(struct clk *clk)
132{
133 module_put(clk->owner);
134}
135
136int clk_enable(struct clk *clk)
137{
138 if (IS_ERR(clk))
139 return -EINVAL;
140
141 return (clk->enable)(clk, 1);
142}
143
144void clk_disable(struct clk *clk)
145{
146 if (!IS_ERR(clk))
147 (clk->enable)(clk, 0);
148}
149
150
151int clk_use(struct clk *clk)
152{
153 atomic_inc(&clk->used);
154 return 0;
155}
156
157
158void clk_unuse(struct clk *clk)
159{
160 atomic_dec(&clk->used);
161}
162
163unsigned long clk_get_rate(struct clk *clk)
164{
165 if (IS_ERR(clk))
166 return 0;
167
168 if (clk->rate != 0)
169 return clk->rate;
170
171 while (clk->parent != NULL && clk->rate == 0)
172 clk = clk->parent;
173
174 return clk->rate;
175}
176
177long clk_round_rate(struct clk *clk, unsigned long rate)
178{
179 return rate;
180}
181
182int clk_set_rate(struct clk *clk, unsigned long rate)
183{
184 return -EINVAL;
185}
186
187struct clk *clk_get_parent(struct clk *clk)
188{
189 return clk->parent;
190}
191
192EXPORT_SYMBOL(clk_get);
193EXPORT_SYMBOL(clk_put);
194EXPORT_SYMBOL(clk_enable);
195EXPORT_SYMBOL(clk_disable);
196EXPORT_SYMBOL(clk_use);
197EXPORT_SYMBOL(clk_unuse);
198EXPORT_SYMBOL(clk_get_rate);
199EXPORT_SYMBOL(clk_round_rate);
200EXPORT_SYMBOL(clk_set_rate);
201EXPORT_SYMBOL(clk_get_parent);
202
203/* base clocks */
204
205static struct clk clk_xtal = {
206 .name = "xtal",
207 .id = -1,
208 .rate = 0,
209 .parent = NULL,
210 .ctrlbit = 0,
211};
212
213static struct clk clk_f = {
214 .name = "fclk",
215 .id = -1,
216 .rate = 0,
217 .parent = NULL,
218 .ctrlbit = 0,
219};
220
221static struct clk clk_h = {
222 .name = "hclk",
223 .id = -1,
224 .rate = 0,
225 .parent = NULL,
226 .ctrlbit = 0,
227};
228
229static struct clk clk_p = {
230 .name = "pclk",
231 .id = -1,
232 .rate = 0,
233 .parent = NULL,
234 .ctrlbit = 0,
235};
236
237/* clocks that could be registered by external code */
238
239struct clk s3c24xx_dclk0 = {
240 .name = "dclk0",
241 .id = -1,
242};
243
244struct clk s3c24xx_dclk1 = {
245 .name = "dclk1",
246 .id = -1,
247};
248
249struct clk s3c24xx_clkout0 = {
250 .name = "clkout0",
251 .id = -1,
252};
253
254struct clk s3c24xx_clkout1 = {
255 .name = "clkout1",
256 .id = -1,
257};
258
259struct clk s3c24xx_uclk = {
260 .name = "uclk",
261 .id = -1,
262};
263
264
265/* clock definitions */
266
267static struct clk init_clocks[] = {
268 { .name = "nand",
269 .id = -1,
270 .parent = &clk_h,
271 .enable = s3c24xx_clkcon_enable,
272 .ctrlbit = S3C2410_CLKCON_NAND
273 },
274 { .name = "lcd",
275 .id = -1,
276 .parent = &clk_h,
277 .enable = s3c24xx_clkcon_enable,
278 .ctrlbit = S3C2410_CLKCON_LCDC
279 },
280 { .name = "usb-host",
281 .id = -1,
282 .parent = &clk_h,
283 .enable = s3c24xx_clkcon_enable,
284 .ctrlbit = S3C2410_CLKCON_USBH
285 },
286 { .name = "usb-device",
287 .id = -1,
288 .parent = &clk_h,
289 .enable = s3c24xx_clkcon_enable,
290 .ctrlbit = S3C2410_CLKCON_USBD
291 },
292 { .name = "timers",
293 .id = -1,
294 .parent = &clk_p,
295 .enable = s3c24xx_clkcon_enable,
296 .ctrlbit = S3C2410_CLKCON_PWMT
297 },
298 { .name = "sdi",
299 .id = -1,
300 .parent = &clk_p,
301 .enable = s3c24xx_clkcon_enable,
302 .ctrlbit = S3C2410_CLKCON_SDI
303 },
304 { .name = "uart",
305 .id = 0,
306 .parent = &clk_p,
307 .enable = s3c24xx_clkcon_enable,
308 .ctrlbit = S3C2410_CLKCON_UART0
309 },
310 { .name = "uart",
311 .id = 1,
312 .parent = &clk_p,
313 .enable = s3c24xx_clkcon_enable,
314 .ctrlbit = S3C2410_CLKCON_UART1
315 },
316 { .name = "uart",
317 .id = 2,
318 .parent = &clk_p,
319 .enable = s3c24xx_clkcon_enable,
320 .ctrlbit = S3C2410_CLKCON_UART2
321 },
322 { .name = "gpio",
323 .id = -1,
324 .parent = &clk_p,
325 .enable = s3c24xx_clkcon_enable,
326 .ctrlbit = S3C2410_CLKCON_GPIO
327 },
328 { .name = "rtc",
329 .id = -1,
330 .parent = &clk_p,
331 .enable = s3c24xx_clkcon_enable,
332 .ctrlbit = S3C2410_CLKCON_RTC
333 },
334 { .name = "adc",
335 .id = -1,
336 .parent = &clk_p,
337 .enable = s3c24xx_clkcon_enable,
338 .ctrlbit = S3C2410_CLKCON_ADC
339 },
340 { .name = "i2c",
341 .id = -1,
342 .parent = &clk_p,
343 .enable = s3c24xx_clkcon_enable,
344 .ctrlbit = S3C2410_CLKCON_IIC
345 },
346 { .name = "iis",
347 .id = -1,
348 .parent = &clk_p,
349 .enable = s3c24xx_clkcon_enable,
350 .ctrlbit = S3C2410_CLKCON_IIS
351 },
352 { .name = "spi",
353 .id = -1,
354 .parent = &clk_p,
355 .enable = s3c24xx_clkcon_enable,
356 .ctrlbit = S3C2410_CLKCON_SPI
357 },
358 { .name = "watchdog",
359 .id = -1,
360 .parent = &clk_p,
361 .ctrlbit = 0
362 }
363};
364
365/* initialise the clock system */
366
367int s3c24xx_register_clock(struct clk *clk)
368{
369 clk->owner = THIS_MODULE;
370 atomic_set(&clk->used, 0);
371
372 if (clk->enable == NULL)
373 clk->enable = clk_null_enable;
374
375 /* add to the list of available clocks */
376
377 down(&clocks_sem);
378 list_add(&clk->list, &clocks);
379 up(&clocks_sem);
380
381 return 0;
382}
383
384/* initalise all the clocks */
385
386int __init s3c24xx_setup_clocks(unsigned long xtal,
387 unsigned long fclk,
388 unsigned long hclk,
389 unsigned long pclk)
390{
391 struct clk *clkp = init_clocks;
392 int ptr;
393 int ret;
394
395 printk(KERN_INFO "S3C2410 Clocks, (c) 2004 Simtec Electronics\n");
396
397 /* initialise the main system clocks */
398
399 clk_xtal.rate = xtal;
400
401 clk_h.rate = hclk;
402 clk_p.rate = pclk;
403 clk_f.rate = fclk;
404
405 /* it looks like just setting the register here is not good
406 * enough, and causes the odd hang at initial boot time, so
407 * do all of them indivdually.
408 *
409 * I think disabling the LCD clock if the LCD is active is
410 * very dangerous, and therefore the bootloader should be
411 * careful to not enable the LCD clock if it is not needed.
412 *
413 * and of course, this looks neater
414 */
415
416 s3c24xx_clk_enable(S3C2410_CLKCON_NAND, 0);
417 s3c24xx_clk_enable(S3C2410_CLKCON_USBH, 0);
418 s3c24xx_clk_enable(S3C2410_CLKCON_USBD, 0);
419 s3c24xx_clk_enable(S3C2410_CLKCON_ADC, 0);
420 s3c24xx_clk_enable(S3C2410_CLKCON_IIC, 0);
421 s3c24xx_clk_enable(S3C2410_CLKCON_SPI, 0);
422
423 /* assume uart clocks are correctly setup */
424
425 /* register our clocks */
426
427 if (s3c24xx_register_clock(&clk_xtal) < 0)
428 printk(KERN_ERR "failed to register master xtal\n");
429
430 if (s3c24xx_register_clock(&clk_f) < 0)
431 printk(KERN_ERR "failed to register cpu fclk\n");
432
433 if (s3c24xx_register_clock(&clk_h) < 0)
434 printk(KERN_ERR "failed to register cpu hclk\n");
435
436 if (s3c24xx_register_clock(&clk_p) < 0)
437 printk(KERN_ERR "failed to register cpu pclk\n");
438
439 /* register clocks from clock array */
440
441 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) {
442 ret = s3c24xx_register_clock(clkp);
443 if (ret < 0) {
444 printk(KERN_ERR "Failed to register clock %s (%d)\n",
445 clkp->name, ret);
446 }
447 }
448
449 return 0;
450}
451
452/* S3C2440 extended clock support */
453
454#ifdef CONFIG_CPU_S3C2440
455
456static struct clk s3c2440_clk_upll = {
457 .name = "upll",
458 .id = -1,
459};
460
461static struct clk s3c2440_clk_cam = {
462 .name = "camif",
463 .parent = &clk_h,
464 .id = -1,
465 .enable = s3c24xx_clkcon_enable,
466 .ctrlbit = S3C2440_CLKCON_CAMERA,
467};
468
469static struct clk s3c2440_clk_ac97 = {
470 .name = "ac97",
471 .parent = &clk_p,
472 .id = -1,
473 .enable = s3c24xx_clkcon_enable,
474 .ctrlbit = S3C2440_CLKCON_CAMERA,
475};
476
477static int s3c2440_clk_add(struct sys_device *sysdev)
478{
479 unsigned long upllcon = __raw_readl(S3C2410_UPLLCON);
480
481 s3c2440_clk_upll.rate = s3c2410_get_pll(upllcon, clk_xtal.rate) * 2;
482
483 printk("S3C2440: Clock Support, UPLL %ld.%03ld MHz\n",
484 print_mhz(s3c2440_clk_upll.rate));
485
486 s3c24xx_register_clock(&s3c2440_clk_ac97);
487 s3c24xx_register_clock(&s3c2440_clk_cam);
488 s3c24xx_register_clock(&s3c2440_clk_upll);
489
490 clk_disable(&s3c2440_clk_ac97);
491 clk_disable(&s3c2440_clk_cam);
492
493 return 0;
494}
495
496static struct sysdev_driver s3c2440_clk_driver = {
497 .add = s3c2440_clk_add,
498};
499
500static int s3c24xx_clk_driver(void)
501{
502 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver);
503}
504
505arch_initcall(s3c24xx_clk_driver);
506
507#endif /* CONFIG_CPU_S3C2440 */
diff --git a/arch/arm/mach-s3c2410/clock.h b/arch/arm/mach-s3c2410/clock.h
new file mode 100644
index 000000000000..7953b6f397b9
--- /dev/null
+++ b/arch/arm/mach-s3c2410/clock.h
@@ -0,0 +1,44 @@
1/*
2 * linux/arch/arm/mach-s3c2410/clock.h
3 *
4 * Copyright (c) 2004-2005 Simtec Electronics
5 * http://www.simtec.co.uk/products/SWLINUX/
6 * Written by Ben Dooks, <ben@simtec.co.uk>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13struct clk {
14 struct list_head list;
15 struct module *owner;
16 struct clk *parent;
17 const char *name;
18 int id;
19 atomic_t used;
20 unsigned long rate;
21 unsigned long ctrlbit;
22 int (*enable)(struct clk *, int enable);
23};
24
25/* other clocks which may be registered by board support */
26
27extern struct clk s3c24xx_dclk0;
28extern struct clk s3c24xx_dclk1;
29extern struct clk s3c24xx_clkout0;
30extern struct clk s3c24xx_clkout1;
31extern struct clk s3c24xx_uclk;
32
33/* exports for arch/arm/mach-s3c2410
34 *
35 * Please DO NOT use these outside of arch/arm/mach-s3c2410
36*/
37
38extern int s3c24xx_clkcon_enable(struct clk *clk, int enable);
39extern int s3c24xx_register_clock(struct clk *clk);
40
41extern int s3c24xx_setup_clocks(unsigned long xtal,
42 unsigned long fclk,
43 unsigned long hclk,
44 unsigned long pclk);
diff --git a/arch/arm/mach-s3c2410/cpu.c b/arch/arm/mach-s3c2410/cpu.c
new file mode 100644
index 000000000000..ca366e9e264d
--- /dev/null
+++ b/arch/arm/mach-s3c2410/cpu.c
@@ -0,0 +1,241 @@
1/* linux/arch/arm/mach-s3c2410/cpu.c
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/SWLINUX/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX CPU Support
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22*/
23
24
25#include <linux/init.h>
26#include <linux/module.h>
27#include <linux/interrupt.h>
28#include <linux/ioport.h>
29#include <linux/device.h>
30
31#include <asm/hardware.h>
32#include <asm/irq.h>
33#include <asm/io.h>
34#include <asm/delay.h>
35
36#include <asm/mach/arch.h>
37#include <asm/mach/map.h>
38
39#include <asm/arch/regs-gpio.h>
40
41#include "cpu.h"
42#include "clock.h"
43#include "s3c2410.h"
44#include "s3c2440.h"
45
46struct cpu_table {
47 unsigned long idcode;
48 unsigned long idmask;
49 void (*map_io)(struct map_desc *mach_desc, int size);
50 void (*init_uarts)(struct s3c2410_uartcfg *cfg, int no);
51 void (*init_clocks)(int xtal);
52 int (*init)(void);
53 const char *name;
54};
55
56/* table of supported CPUs */
57
58static const char name_s3c2410[] = "S3C2410";
59static const char name_s3c2440[] = "S3C2440";
60static const char name_s3c2410a[] = "S3C2410A";
61static const char name_s3c2440a[] = "S3C2440A";
62
63static struct cpu_table cpu_ids[] __initdata = {
64 {
65 .idcode = 0x32410000,
66 .idmask = 0xffffffff,
67 .map_io = s3c2410_map_io,
68 .init_clocks = s3c2410_init_clocks,
69 .init_uarts = s3c2410_init_uarts,
70 .init = s3c2410_init,
71 .name = name_s3c2410
72 },
73 {
74 .idcode = 0x32410002,
75 .idmask = 0xffffffff,
76 .map_io = s3c2410_map_io,
77 .init_clocks = s3c2410_init_clocks,
78 .init_uarts = s3c2410_init_uarts,
79 .init = s3c2410_init,
80 .name = name_s3c2410a
81 },
82 {
83 .idcode = 0x32440000,
84 .idmask = 0xffffffff,
85 .map_io = s3c2440_map_io,
86 .init_clocks = s3c2440_init_clocks,
87 .init_uarts = s3c2440_init_uarts,
88 .init = s3c2440_init,
89 .name = name_s3c2440
90 },
91 {
92 .idcode = 0x32440001,
93 .idmask = 0xffffffff,
94 .map_io = s3c2440_map_io,
95 .init_clocks = s3c2440_init_clocks,
96 .init_uarts = s3c2440_init_uarts,
97 .init = s3c2440_init,
98 .name = name_s3c2440a
99 }
100};
101
102/* minimal IO mapping */
103
104static struct map_desc s3c_iodesc[] __initdata = {
105 IODESC_ENT(GPIO),
106 IODESC_ENT(IRQ),
107 IODESC_ENT(MEMCTRL),
108 IODESC_ENT(UART)
109};
110
111
112static struct cpu_table *
113s3c_lookup_cpu(unsigned long idcode)
114{
115 struct cpu_table *tab;
116 int count;
117
118 tab = cpu_ids;
119 for (count = 0; count < ARRAY_SIZE(cpu_ids); count++, tab++) {
120 if ((idcode & tab->idmask) == tab->idcode)
121 return tab;
122 }
123
124 return NULL;
125}
126
127/* board information */
128
129static struct s3c24xx_board *board;
130
131void s3c24xx_set_board(struct s3c24xx_board *b)
132{
133 int i;
134
135 board = b;
136
137 if (b->clocks_count != 0) {
138 struct clk **ptr = b->clocks;;
139
140 for (i = b->clocks_count; i > 0; i--, ptr++)
141 s3c24xx_register_clock(*ptr);
142 }
143}
144
145/* cpu information */
146
147static struct cpu_table *cpu;
148
149void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
150{
151 unsigned long idcode;
152
153 /* initialise the io descriptors we need for initialisation */
154 iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));
155
156 idcode = __raw_readl(S3C2410_GSTATUS1);
157 cpu = s3c_lookup_cpu(idcode);
158
159 if (cpu == NULL) {
160 printk(KERN_ERR "Unknown CPU type 0x%08lx\n", idcode);
161 panic("Unknown S3C24XX CPU");
162 }
163
164 if (cpu->map_io == NULL || cpu->init == NULL) {
165 printk(KERN_ERR "CPU %s support not enabled\n", cpu->name);
166 panic("Unsupported S3C24XX CPU");
167 }
168
169 printk("CPU %s (id 0x%08lx)\n", cpu->name, idcode);
170
171 (cpu->map_io)(mach_desc, size);
172}
173
174/* s3c24xx_init_clocks
175 *
176 * Initialise the clock subsystem and associated information from the
177 * given master crystal value.
178 *
179 * xtal = 0 -> use default PLL crystal value (normally 12MHz)
180 * != 0 -> PLL crystal value in Hz
181*/
182
183void __init s3c24xx_init_clocks(int xtal)
184{
185 if (xtal == 0)
186 xtal = 12*1000*1000;
187
188 if (cpu == NULL)
189 panic("s3c24xx_init_clocks: no cpu setup?\n");
190
191 if (cpu->init_clocks == NULL)
192 panic("s3c24xx_init_clocks: cpu has no clock init\n");
193 else
194 (cpu->init_clocks)(xtal);
195}
196
197void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
198{
199 if (cpu == NULL)
200 return;
201
202 if (cpu->init_uarts == NULL) {
203 printk(KERN_ERR "s3c24xx_init_uarts: cpu has no uart init\n");
204 } else
205 (cpu->init_uarts)(cfg, no);
206}
207
208static int __init s3c_arch_init(void)
209{
210 int ret;
211
212 // do the correct init for cpu
213
214 if (cpu == NULL)
215 panic("s3c_arch_init: NULL cpu\n");
216
217 ret = (cpu->init)();
218 if (ret != 0)
219 return ret;
220
221 if (board != NULL) {
222 struct platform_device **ptr = board->devices;
223 int i;
224
225 for (i = 0; i < board->devices_count; i++, ptr++) {
226 ret = platform_device_register(*ptr);
227
228 if (ret) {
229 printk(KERN_ERR "s3c24xx: failed to add board device %s (%d) @%p\n", (*ptr)->name, ret, *ptr);
230 }
231 }
232
233 /* mask any error, we may not need all these board
234 * devices */
235 ret = 0;
236 }
237
238 return ret;
239}
240
241arch_initcall(s3c_arch_init);
diff --git a/arch/arm/mach-s3c2410/cpu.h b/arch/arm/mach-s3c2410/cpu.h
new file mode 100644
index 000000000000..478c15c0e36a
--- /dev/null
+++ b/arch/arm/mach-s3c2410/cpu.h
@@ -0,0 +1,69 @@
1/* arch/arm/mach-s3c2410/cpu.h
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for S3C24XX CPU support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13 * 24-Aug-2004 BJD Start of generic S3C24XX support
14 * 18-Oct-2004 BJD Moved board struct into this file
15 * 04-Jan-2005 BJD New uart initialisation
16 * 10-Jan-2005 BJD Moved generic init here, specific to cpu headers
17 * 14-Jan-2005 BJD Added s3c24xx_init_clocks() call
18 * 10-Mar-2005 LCVR Changed S3C2410_{VA,SZ} to S3C24XX_{VA,SZ} & IODESC_ENT
19 * 14-Mar-2005 BJD Updated for __iomem
20*/
21
22/* todo - fix when rmk changes iodescs to use `void __iomem *` */
23
24#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, S3C2410_PA_##x, S3C24XX_SZ_##x, MT_DEVICE }
25
26#ifndef MHZ
27#define MHZ (1000*1000)
28#endif
29
30#define print_mhz(m) ((m) / MHZ), ((m / 1000) % 1000)
31
32/* forward declaration */
33struct s3c2410_uartcfg;
34struct map_desc;
35
36/* core initialisation functions */
37
38extern void s3c24xx_init_irq(void);
39
40extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
41
42extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
43
44extern void s3c24xx_init_clocks(int xtal);
45
46/* the board structure is used at first initialsation time
47 * to get info such as the devices to register for this
48 * board. This is done because platfrom_add_devices() cannot
49 * be called from the map_io entry.
50*/
51
52struct s3c24xx_board {
53 struct platform_device **devices;
54 unsigned int devices_count;
55
56 struct clk **clocks;
57 unsigned int clocks_count;
58};
59
60extern void s3c24xx_set_board(struct s3c24xx_board *board);
61
62/* timer for 2410/2440 */
63
64struct sys_timer;
65extern struct sys_timer s3c24xx_timer;
66
67/* system device classes */
68
69extern struct sysdev_class s3c2440_sysclass;
diff --git a/arch/arm/mach-s3c2410/devs.c b/arch/arm/mach-s3c2410/devs.c
new file mode 100644
index 000000000000..64792f678668
--- /dev/null
+++ b/arch/arm/mach-s3c2410/devs.c
@@ -0,0 +1,485 @@
1/* linux/arch/arm/mach-s3c2410/devs.c
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Base S3C2410 platform device definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13 * 10-Mar-2005 LCVR Changed S3C2410_{VA,SZ} to S3C24XX_{VA,SZ}
14 * 10-Feb-2005 BJD Added camera from guillaume.gourat@nexvision.tv
15 * 29-Aug-2004 BJD Added timers 0 through 3
16 * 29-Aug-2004 BJD Changed index of devices we only have one of to -1
17 * 21-Aug-2004 BJD Added IRQ_TICK to RTC resources
18 * 18-Aug-2004 BJD Created initial version
19*/
20
21#include <linux/kernel.h>
22#include <linux/types.h>
23#include <linux/interrupt.h>
24#include <linux/list.h>
25#include <linux/timer.h>
26#include <linux/init.h>
27#include <linux/device.h>
28
29#include <asm/mach/arch.h>
30#include <asm/mach/map.h>
31#include <asm/mach/irq.h>
32
33#include <asm/hardware.h>
34#include <asm/io.h>
35#include <asm/irq.h>
36
37#include <asm/arch/regs-serial.h>
38
39#include "devs.h"
40
41/* Serial port registrations */
42
43struct platform_device *s3c24xx_uart_devs[3];
44
45/* USB Host Controller */
46
47static struct resource s3c_usb_resource[] = {
48 [0] = {
49 .start = S3C2410_PA_USBHOST,
50 .end = S3C2410_PA_USBHOST + S3C24XX_SZ_USBHOST,
51 .flags = IORESOURCE_MEM,
52 },
53 [1] = {
54 .start = IRQ_USBH,
55 .end = IRQ_USBH,
56 .flags = IORESOURCE_IRQ,
57 }
58};
59
60static u64 s3c_device_usb_dmamask = 0xffffffffUL;
61
62struct platform_device s3c_device_usb = {
63 .name = "s3c2410-ohci",
64 .id = -1,
65 .num_resources = ARRAY_SIZE(s3c_usb_resource),
66 .resource = s3c_usb_resource,
67 .dev = {
68 .dma_mask = &s3c_device_usb_dmamask,
69 .coherent_dma_mask = 0xffffffffUL
70 }
71};
72
73EXPORT_SYMBOL(s3c_device_usb);
74
75/* LCD Controller */
76
77static struct resource s3c_lcd_resource[] = {
78 [0] = {
79 .start = S3C2410_PA_LCD,
80 .end = S3C2410_PA_LCD + S3C24XX_SZ_LCD,
81 .flags = IORESOURCE_MEM,
82 },
83 [1] = {
84 .start = IRQ_LCD,
85 .end = IRQ_LCD,
86 .flags = IORESOURCE_IRQ,
87 }
88
89};
90
91static u64 s3c_device_lcd_dmamask = 0xffffffffUL;
92
93struct platform_device s3c_device_lcd = {
94 .name = "s3c2410-lcd",
95 .id = -1,
96 .num_resources = ARRAY_SIZE(s3c_lcd_resource),
97 .resource = s3c_lcd_resource,
98 .dev = {
99 .dma_mask = &s3c_device_lcd_dmamask,
100 .coherent_dma_mask = 0xffffffffUL
101 }
102};
103
104EXPORT_SYMBOL(s3c_device_lcd);
105
106/* NAND Controller */
107
108static struct resource s3c_nand_resource[] = {
109 [0] = {
110 .start = S3C2410_PA_NAND,
111 .end = S3C2410_PA_NAND + S3C24XX_SZ_NAND,
112 .flags = IORESOURCE_MEM,
113 }
114};
115
116struct platform_device s3c_device_nand = {
117 .name = "s3c2410-nand",
118 .id = -1,
119 .num_resources = ARRAY_SIZE(s3c_nand_resource),
120 .resource = s3c_nand_resource,
121};
122
123EXPORT_SYMBOL(s3c_device_nand);
124
125/* USB Device (Gadget)*/
126
127static struct resource s3c_usbgadget_resource[] = {
128 [0] = {
129 .start = S3C2410_PA_USBDEV,
130 .end = S3C2410_PA_USBDEV + S3C24XX_SZ_USBDEV,
131 .flags = IORESOURCE_MEM,
132 },
133 [1] = {
134 .start = IRQ_USBD,
135 .end = IRQ_USBD,
136 .flags = IORESOURCE_IRQ,
137 }
138
139};
140
141struct platform_device s3c_device_usbgadget = {
142 .name = "s3c2410-usbgadget",
143 .id = -1,
144 .num_resources = ARRAY_SIZE(s3c_usbgadget_resource),
145 .resource = s3c_usbgadget_resource,
146};
147
148EXPORT_SYMBOL(s3c_device_usbgadget);
149
150/* Watchdog */
151
152static struct resource s3c_wdt_resource[] = {
153 [0] = {
154 .start = S3C2410_PA_WATCHDOG,
155 .end = S3C2410_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG,
156 .flags = IORESOURCE_MEM,
157 },
158 [1] = {
159 .start = IRQ_WDT,
160 .end = IRQ_WDT,
161 .flags = IORESOURCE_IRQ,
162 }
163
164};
165
166struct platform_device s3c_device_wdt = {
167 .name = "s3c2410-wdt",
168 .id = -1,
169 .num_resources = ARRAY_SIZE(s3c_wdt_resource),
170 .resource = s3c_wdt_resource,
171};
172
173EXPORT_SYMBOL(s3c_device_wdt);
174
175/* I2C */
176
177static struct resource s3c_i2c_resource[] = {
178 [0] = {
179 .start = S3C2410_PA_IIC,
180 .end = S3C2410_PA_IIC + S3C24XX_SZ_IIC,
181 .flags = IORESOURCE_MEM,
182 },
183 [1] = {
184 .start = IRQ_IIC,
185 .end = IRQ_IIC,
186 .flags = IORESOURCE_IRQ,
187 }
188
189};
190
191struct platform_device s3c_device_i2c = {
192 .name = "s3c2410-i2c",
193 .id = -1,
194 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
195 .resource = s3c_i2c_resource,
196};
197
198EXPORT_SYMBOL(s3c_device_i2c);
199
200/* IIS */
201
202static struct resource s3c_iis_resource[] = {
203 [0] = {
204 .start = S3C2410_PA_IIS,
205 .end = S3C2410_PA_IIS + S3C24XX_SZ_IIS,
206 .flags = IORESOURCE_MEM,
207 }
208};
209
210static u64 s3c_device_iis_dmamask = 0xffffffffUL;
211
212struct platform_device s3c_device_iis = {
213 .name = "s3c2410-iis",
214 .id = -1,
215 .num_resources = ARRAY_SIZE(s3c_iis_resource),
216 .resource = s3c_iis_resource,
217 .dev = {
218 .dma_mask = &s3c_device_iis_dmamask,
219 .coherent_dma_mask = 0xffffffffUL
220 }
221};
222
223EXPORT_SYMBOL(s3c_device_iis);
224
225/* RTC */
226
227static struct resource s3c_rtc_resource[] = {
228 [0] = {
229 .start = S3C2410_PA_RTC,
230 .end = S3C2410_PA_RTC + 0xff,
231 .flags = IORESOURCE_MEM,
232 },
233 [1] = {
234 .start = IRQ_RTC,
235 .end = IRQ_RTC,
236 .flags = IORESOURCE_IRQ,
237 },
238 [2] = {
239 .start = IRQ_TICK,
240 .end = IRQ_TICK,
241 .flags = IORESOURCE_IRQ
242 }
243};
244
245struct platform_device s3c_device_rtc = {
246 .name = "s3c2410-rtc",
247 .id = -1,
248 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
249 .resource = s3c_rtc_resource,
250};
251
252EXPORT_SYMBOL(s3c_device_rtc);
253
254/* ADC */
255
256static struct resource s3c_adc_resource[] = {
257 [0] = {
258 .start = S3C2410_PA_ADC,
259 .end = S3C2410_PA_ADC + S3C24XX_SZ_ADC,
260 .flags = IORESOURCE_MEM,
261 },
262 [1] = {
263 .start = IRQ_TC,
264 .end = IRQ_ADC,
265 .flags = IORESOURCE_IRQ,
266 }
267
268};
269
270struct platform_device s3c_device_adc = {
271 .name = "s3c2410-adc",
272 .id = -1,
273 .num_resources = ARRAY_SIZE(s3c_adc_resource),
274 .resource = s3c_adc_resource,
275};
276
277/* SDI */
278
279static struct resource s3c_sdi_resource[] = {
280 [0] = {
281 .start = S3C2410_PA_SDI,
282 .end = S3C2410_PA_SDI + S3C24XX_SZ_SDI,
283 .flags = IORESOURCE_MEM,
284 },
285 [1] = {
286 .start = IRQ_SDI,
287 .end = IRQ_SDI,
288 .flags = IORESOURCE_IRQ,
289 }
290
291};
292
293struct platform_device s3c_device_sdi = {
294 .name = "s3c2410-sdi",
295 .id = -1,
296 .num_resources = ARRAY_SIZE(s3c_sdi_resource),
297 .resource = s3c_sdi_resource,
298};
299
300EXPORT_SYMBOL(s3c_device_sdi);
301
302/* SPI (0) */
303
304static struct resource s3c_spi0_resource[] = {
305 [0] = {
306 .start = S3C2410_PA_SPI,
307 .end = S3C2410_PA_SPI + 0x1f,
308 .flags = IORESOURCE_MEM,
309 },
310 [1] = {
311 .start = IRQ_SPI0,
312 .end = IRQ_SPI0,
313 .flags = IORESOURCE_IRQ,
314 }
315
316};
317
318struct platform_device s3c_device_spi0 = {
319 .name = "s3c2410-spi",
320 .id = 0,
321 .num_resources = ARRAY_SIZE(s3c_spi0_resource),
322 .resource = s3c_spi0_resource,
323};
324
325EXPORT_SYMBOL(s3c_device_spi0);
326
327/* SPI (1) */
328
329static struct resource s3c_spi1_resource[] = {
330 [0] = {
331 .start = S3C2410_PA_SPI + 0x20,
332 .end = S3C2410_PA_SPI + 0x20 + 0x1f,
333 .flags = IORESOURCE_MEM,
334 },
335 [1] = {
336 .start = IRQ_SPI1,
337 .end = IRQ_SPI1,
338 .flags = IORESOURCE_IRQ,
339 }
340
341};
342
343struct platform_device s3c_device_spi1 = {
344 .name = "s3c2410-spi",
345 .id = 1,
346 .num_resources = ARRAY_SIZE(s3c_spi1_resource),
347 .resource = s3c_spi1_resource,
348};
349
350EXPORT_SYMBOL(s3c_device_spi1);
351
352/* pwm timer blocks */
353
354static struct resource s3c_timer0_resource[] = {
355 [0] = {
356 .start = S3C2410_PA_TIMER + 0x0C,
357 .end = S3C2410_PA_TIMER + 0x0C + 0xB,
358 .flags = IORESOURCE_MEM,
359 },
360 [1] = {
361 .start = IRQ_TIMER0,
362 .end = IRQ_TIMER0,
363 .flags = IORESOURCE_IRQ,
364 }
365
366};
367
368struct platform_device s3c_device_timer0 = {
369 .name = "s3c2410-timer",
370 .id = 0,
371 .num_resources = ARRAY_SIZE(s3c_timer0_resource),
372 .resource = s3c_timer0_resource,
373};
374
375EXPORT_SYMBOL(s3c_device_timer0);
376
377/* timer 1 */
378
379static struct resource s3c_timer1_resource[] = {
380 [0] = {
381 .start = S3C2410_PA_TIMER + 0x18,
382 .end = S3C2410_PA_TIMER + 0x23,
383 .flags = IORESOURCE_MEM,
384 },
385 [1] = {
386 .start = IRQ_TIMER1,
387 .end = IRQ_TIMER1,
388 .flags = IORESOURCE_IRQ,
389 }
390
391};
392
393struct platform_device s3c_device_timer1 = {
394 .name = "s3c2410-timer",
395 .id = 1,
396 .num_resources = ARRAY_SIZE(s3c_timer1_resource),
397 .resource = s3c_timer1_resource,
398};
399
400EXPORT_SYMBOL(s3c_device_timer1);
401
402/* timer 2 */
403
404static struct resource s3c_timer2_resource[] = {
405 [0] = {
406 .start = S3C2410_PA_TIMER + 0x24,
407 .end = S3C2410_PA_TIMER + 0x2F,
408 .flags = IORESOURCE_MEM,
409 },
410 [1] = {
411 .start = IRQ_TIMER2,
412 .end = IRQ_TIMER2,
413 .flags = IORESOURCE_IRQ,
414 }
415
416};
417
418struct platform_device s3c_device_timer2 = {
419 .name = "s3c2410-timer",
420 .id = 2,
421 .num_resources = ARRAY_SIZE(s3c_timer2_resource),
422 .resource = s3c_timer2_resource,
423};
424
425EXPORT_SYMBOL(s3c_device_timer2);
426
427/* timer 3 */
428
429static struct resource s3c_timer3_resource[] = {
430 [0] = {
431 .start = S3C2410_PA_TIMER + 0x30,
432 .end = S3C2410_PA_TIMER + 0x3B,
433 .flags = IORESOURCE_MEM,
434 },
435 [1] = {
436 .start = IRQ_TIMER3,
437 .end = IRQ_TIMER3,
438 .flags = IORESOURCE_IRQ,
439 }
440
441};
442
443struct platform_device s3c_device_timer3 = {
444 .name = "s3c2410-timer",
445 .id = 3,
446 .num_resources = ARRAY_SIZE(s3c_timer3_resource),
447 .resource = s3c_timer3_resource,
448};
449
450EXPORT_SYMBOL(s3c_device_timer3);
451
452#ifdef CONFIG_CPU_S3C2440
453
454/* Camif Controller */
455
456static struct resource s3c_camif_resource[] = {
457 [0] = {
458 .start = S3C2440_PA_CAMIF,
459 .end = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF,
460 .flags = IORESOURCE_MEM,
461 },
462 [1] = {
463 .start = IRQ_CAM,
464 .end = IRQ_CAM,
465 .flags = IORESOURCE_IRQ,
466 }
467
468};
469
470static u64 s3c_device_camif_dmamask = 0xffffffffUL;
471
472struct platform_device s3c_device_camif = {
473 .name = "s3c2440-camif",
474 .id = -1,
475 .num_resources = ARRAY_SIZE(s3c_camif_resource),
476 .resource = s3c_camif_resource,
477 .dev = {
478 .dma_mask = &s3c_device_camif_dmamask,
479 .coherent_dma_mask = 0xffffffffUL
480 }
481};
482
483EXPORT_SYMBOL(s3c_device_camif);
484
485#endif // CONFIG_CPU_S32440
diff --git a/arch/arm/mach-s3c2410/devs.h b/arch/arm/mach-s3c2410/devs.h
new file mode 100644
index 000000000000..d6328f96728b
--- /dev/null
+++ b/arch/arm/mach-s3c2410/devs.h
@@ -0,0 +1,48 @@
1/* arch/arm/mach-s3c2410/devs.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for s3c2410 standard platform devices
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13 * 18-Aug-2004 BJD Created initial version
14 * 27-Aug-2004 BJD Added timers 0 through 3
15 * 10-Feb-2005 BJD Added camera from guillaume.gourat@nexvision.tv
16*/
17#include <linux/config.h>
18
19extern struct platform_device *s3c24xx_uart_devs[];
20
21extern struct platform_device s3c_device_usb;
22extern struct platform_device s3c_device_lcd;
23extern struct platform_device s3c_device_wdt;
24extern struct platform_device s3c_device_i2c;
25extern struct platform_device s3c_device_iis;
26extern struct platform_device s3c_device_rtc;
27extern struct platform_device s3c_device_adc;
28extern struct platform_device s3c_device_sdi;
29
30extern struct platform_device s3c_device_spi0;
31extern struct platform_device s3c_device_spi1;
32
33extern struct platform_device s3c_device_nand;
34
35extern struct platform_device s3c_device_timer0;
36extern struct platform_device s3c_device_timer1;
37extern struct platform_device s3c_device_timer2;
38extern struct platform_device s3c_device_timer3;
39
40extern struct platform_device s3c_device_usbgadget;
41
42/* s3c2440 specific devices */
43
44#ifdef CONFIG_CPU_S3C2440
45
46extern struct platform_device s3c_device_camif;
47
48#endif
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
new file mode 100644
index 000000000000..bc229fab86d4
--- /dev/null
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -0,0 +1,1210 @@
1/* linux/arch/arm/mach-bast/dma.c
2 *
3 * (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 DMA core
7 *
8 * http://www.simtec.co.uk/products/EB2410ITX/
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * Changelog:
15 * 27-Feb-2005 BJD Added kmem cache for dma descriptors
16 * 18-Nov-2004 BJD Removed error for loading onto stopped channel
17 * 10-Nov-2004 BJD Ensure all external symbols exported for modules
18 * 10-Nov-2004 BJD Use sys_device and sysdev_class for power management
19 * 08-Aug-2004 BJD Apply rmk's suggestions
20 * 21-Jul-2004 BJD Ported to linux 2.6
21 * 12-Jul-2004 BJD Finished re-write and change of API
22 * 06-Jul-2004 BJD Rewrote dma code to try and cope with various problems
23 * 23-May-2003 BJD Created file
24 * 19-Aug-2003 BJD Cleanup, header fix, added URL
25 *
26 * This file is based on the Sangwook Lee/Samsung patches, re-written due
27 * to various ommisions from the code (such as flexible dma configuration)
28 * for use with the BAST system board.
29 *
30 * The re-write is pretty much complete, and should be good enough for any
31 * possible DMA function
32 */
33
34#include <linux/config.h>
35
36#ifdef CONFIG_S3C2410_DMA_DEBUG
37#define DEBUG
38#endif
39
40#include <linux/module.h>
41#include <linux/init.h>
42#include <linux/sched.h>
43#include <linux/spinlock.h>
44#include <linux/interrupt.h>
45#include <linux/sysdev.h>
46#include <linux/slab.h>
47#include <linux/errno.h>
48#include <linux/delay.h>
49
50#include <asm/system.h>
51#include <asm/irq.h>
52#include <asm/hardware.h>
53#include <asm/io.h>
54#include <asm/dma.h>
55
56#include <asm/mach/dma.h>
57#include <asm/arch/map.h>
58
59/* io map for dma */
60static void __iomem *dma_base;
61static kmem_cache_t *dma_kmem;
62
63/* dma channel state information */
64s3c2410_dma_chan_t s3c2410_chans[S3C2410_DMA_CHANNELS];
65
66/* debugging functions */
67
68#define BUF_MAGIC (0xcafebabe)
69
70#define dmawarn(fmt...) printk(KERN_DEBUG fmt)
71
72#define dma_regaddr(chan, reg) ((chan)->regs + (reg))
73
74#if 1
75#define dma_wrreg(chan, reg, val) writel((val), (chan)->regs + (reg))
76#else
77static inline void
78dma_wrreg(s3c2410_dma_chan_t *chan, int reg, unsigned long val)
79{
80 pr_debug("writing %08x to register %08x\n",(unsigned int)val,reg);
81 writel(val, dma_regaddr(chan, reg));
82}
83
84#endif
85
86#define dma_rdreg(chan, reg) readl((chan)->regs + (reg))
87
88/* captured register state for debug */
89
90struct s3c2410_dma_regstate {
91 unsigned long dcsrc;
92 unsigned long disrc;
93 unsigned long dstat;
94 unsigned long dcon;
95 unsigned long dmsktrig;
96};
97
98#ifdef CONFIG_S3C2410_DMA_DEBUG
99
100/* dmadbg_showregs
101 *
102 * simple debug routine to print the current state of the dma registers
103*/
104
105static void
106dmadbg_capture(s3c2410_dma_chan_t *chan, struct s3c2410_dma_regstate *regs)
107{
108 regs->dcsrc = dma_rdreg(chan, S3C2410_DMA_DCSRC);
109 regs->disrc = dma_rdreg(chan, S3C2410_DMA_DISRC);
110 regs->dstat = dma_rdreg(chan, S3C2410_DMA_DSTAT);
111 regs->dcon = dma_rdreg(chan, S3C2410_DMA_DCON);
112 regs->dmsktrig = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
113}
114
115static void
116dmadbg_showregs(const char *fname, int line, s3c2410_dma_chan_t *chan,
117 struct s3c2410_dma_regstate *regs)
118{
119 printk(KERN_DEBUG "dma%d: %s:%d: DCSRC=%08lx, DISRC=%08lx, DSTAT=%08lx DMT=%02lx, DCON=%08lx\n",
120 chan->number, fname, line,
121 regs->dcsrc, regs->disrc, regs->dstat, regs->dmsktrig,
122 regs->dcon);
123}
124
125static void
126dmadbg_showchan(const char *fname, int line, s3c2410_dma_chan_t *chan)
127{
128 struct s3c2410_dma_regstate state;
129
130 dmadbg_capture(chan, &state);
131
132 printk(KERN_DEBUG "dma%d: %s:%d: ls=%d, cur=%p, %p %p\n",
133 chan->number, fname, line, chan->load_state,
134 chan->curr, chan->next, chan->end);
135
136 dmadbg_showregs(fname, line, chan, &state);
137}
138
139#define dbg_showregs(chan) dmadbg_showregs(__FUNCTION__, __LINE__, (chan))
140#define dbg_showchan(chan) dmadbg_showchan(__FUNCTION__, __LINE__, (chan))
141#else
142#define dbg_showregs(chan) do { } while(0)
143#define dbg_showchan(chan) do { } while(0)
144#endif /* CONFIG_S3C2410_DMA_DEBUG */
145
146#define check_channel(chan) \
147 do { if ((chan) >= S3C2410_DMA_CHANNELS) { \
148 printk(KERN_ERR "%s: invalid channel %d\n", __FUNCTION__, (chan)); \
149 return -EINVAL; \
150 } } while(0)
151
152
153/* s3c2410_dma_stats_timeout
154 *
155 * Update DMA stats from timeout info
156*/
157
158static void
159s3c2410_dma_stats_timeout(s3c2410_dma_stats_t *stats, int val)
160{
161 if (stats == NULL)
162 return;
163
164 if (val > stats->timeout_longest)
165 stats->timeout_longest = val;
166 if (val < stats->timeout_shortest)
167 stats->timeout_shortest = val;
168
169 stats->timeout_avg += val;
170}
171
172/* s3c2410_dma_waitforload
173 *
174 * wait for the DMA engine to load a buffer, and update the state accordingly
175*/
176
177static int
178s3c2410_dma_waitforload(s3c2410_dma_chan_t *chan, int line)
179{
180 int timeout = chan->load_timeout;
181 int took;
182
183 if (chan->load_state != S3C2410_DMALOAD_1LOADED) {
184 printk(KERN_ERR "dma%d: s3c2410_dma_waitforload() called in loadstate %d from line %d\n", chan->number, chan->load_state, line);
185 return 0;
186 }
187
188 if (chan->stats != NULL)
189 chan->stats->loads++;
190
191 while (--timeout > 0) {
192 if ((dma_rdreg(chan, S3C2410_DMA_DSTAT) << (32-20)) != 0) {
193 took = chan->load_timeout - timeout;
194
195 s3c2410_dma_stats_timeout(chan->stats, took);
196
197 switch (chan->load_state) {
198 case S3C2410_DMALOAD_1LOADED:
199 chan->load_state = S3C2410_DMALOAD_1RUNNING;
200 break;
201
202 default:
203 printk(KERN_ERR "dma%d: unknown load_state in s3c2410_dma_waitforload() %d\n", chan->number, chan->load_state);
204 }
205
206 return 1;
207 }
208 }
209
210 if (chan->stats != NULL) {
211 chan->stats->timeout_failed++;
212 }
213
214 return 0;
215}
216
217
218
219/* s3c2410_dma_loadbuffer
220 *
221 * load a buffer, and update the channel state
222*/
223
224static inline int
225s3c2410_dma_loadbuffer(s3c2410_dma_chan_t *chan,
226 s3c2410_dma_buf_t *buf)
227{
228 unsigned long reload;
229
230 pr_debug("s3c2410_chan_loadbuffer: loading buff %p (0x%08lx,0x%06x)\n",
231 buf, (unsigned long)buf->data, buf->size);
232
233 if (buf == NULL) {
234 dmawarn("buffer is NULL\n");
235 return -EINVAL;
236 }
237
238 /* check the state of the channel before we do anything */
239
240 if (chan->load_state == S3C2410_DMALOAD_1LOADED) {
241 dmawarn("load_state is S3C2410_DMALOAD_1LOADED\n");
242 }
243
244 if (chan->load_state == S3C2410_DMALOAD_1LOADED_1RUNNING) {
245 dmawarn("state is S3C2410_DMALOAD_1LOADED_1RUNNING\n");
246 }
247
248 /* it would seem sensible if we are the last buffer to not bother
249 * with the auto-reload bit, so that the DMA engine will not try
250 * and load another transfer after this one has finished...
251 */
252 if (chan->load_state == S3C2410_DMALOAD_NONE) {
253 pr_debug("load_state is none, checking for noreload (next=%p)\n",
254 buf->next);
255 reload = (buf->next == NULL) ? S3C2410_DCON_NORELOAD : 0;
256 } else {
257 pr_debug("load_state is %d => autoreload\n", chan->load_state);
258 reload = S3C2410_DCON_AUTORELOAD;
259 }
260
261 writel(buf->data, chan->addr_reg);
262
263 dma_wrreg(chan, S3C2410_DMA_DCON,
264 chan->dcon | reload | (buf->size/chan->xfer_unit));
265
266 chan->next = buf->next;
267
268 /* update the state of the channel */
269
270 switch (chan->load_state) {
271 case S3C2410_DMALOAD_NONE:
272 chan->load_state = S3C2410_DMALOAD_1LOADED;
273 break;
274
275 case S3C2410_DMALOAD_1RUNNING:
276 chan->load_state = S3C2410_DMALOAD_1LOADED_1RUNNING;
277 break;
278
279 default:
280 dmawarn("dmaload: unknown state %d in loadbuffer\n",
281 chan->load_state);
282 break;
283 }
284
285 return 0;
286}
287
288/* s3c2410_dma_call_op
289 *
290 * small routine to call the op routine with the given op if it has been
291 * registered
292*/
293
294static void
295s3c2410_dma_call_op(s3c2410_dma_chan_t *chan, s3c2410_chan_op_t op)
296{
297 if (chan->op_fn != NULL) {
298 (chan->op_fn)(chan, op);
299 }
300}
301
302/* s3c2410_dma_buffdone
303 *
304 * small wrapper to check if callback routine needs to be called, and
305 * if so, call it
306*/
307
308static inline void
309s3c2410_dma_buffdone(s3c2410_dma_chan_t *chan, s3c2410_dma_buf_t *buf,
310 s3c2410_dma_buffresult_t result)
311{
312 pr_debug("callback_fn=%p, buf=%p, id=%p, size=%d, result=%d\n",
313 chan->callback_fn, buf, buf->id, buf->size, result);
314
315 if (chan->callback_fn != NULL) {
316 (chan->callback_fn)(chan, buf->id, buf->size, result);
317 }
318}
319
320/* s3c2410_dma_start
321 *
322 * start a dma channel going
323*/
324
325static int s3c2410_dma_start(s3c2410_dma_chan_t *chan)
326{
327 unsigned long tmp;
328 unsigned long flags;
329
330 pr_debug("s3c2410_start_dma: channel=%d\n", chan->number);
331
332 local_irq_save(flags);
333
334 if (chan->state == S3C2410_DMA_RUNNING) {
335 pr_debug("s3c2410_start_dma: already running (%d)\n", chan->state);
336 local_irq_restore(flags);
337 return 0;
338 }
339
340 chan->state = S3C2410_DMA_RUNNING;
341
342 /* check wether there is anything to load, and if not, see
343 * if we can find anything to load
344 */
345
346 if (chan->load_state == S3C2410_DMALOAD_NONE) {
347 if (chan->next == NULL) {
348 printk(KERN_ERR "dma%d: channel has nothing loaded\n",
349 chan->number);
350 chan->state = S3C2410_DMA_IDLE;
351 local_irq_restore(flags);
352 return -EINVAL;
353 }
354
355 s3c2410_dma_loadbuffer(chan, chan->next);
356 }
357
358 dbg_showchan(chan);
359
360 /* enable the channel */
361
362 if (!chan->irq_enabled) {
363 enable_irq(chan->irq);
364 chan->irq_enabled = 1;
365 }
366
367 /* start the channel going */
368
369 tmp = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
370 tmp &= ~S3C2410_DMASKTRIG_STOP;
371 tmp |= S3C2410_DMASKTRIG_ON;
372 dma_wrreg(chan, S3C2410_DMA_DMASKTRIG, tmp);
373
374 pr_debug("wrote %08lx to DMASKTRIG\n", tmp);
375
376#if 0
377 /* the dma buffer loads should take care of clearing the AUTO
378 * reloading feature */
379 tmp = dma_rdreg(chan, S3C2410_DMA_DCON);
380 tmp &= ~S3C2410_DCON_NORELOAD;
381 dma_wrreg(chan, S3C2410_DMA_DCON, tmp);
382#endif
383
384 s3c2410_dma_call_op(chan, S3C2410_DMAOP_START);
385
386 dbg_showchan(chan);
387
388 local_irq_restore(flags);
389 return 0;
390}
391
392/* s3c2410_dma_canload
393 *
394 * work out if we can queue another buffer into the DMA engine
395*/
396
397static int
398s3c2410_dma_canload(s3c2410_dma_chan_t *chan)
399{
400 if (chan->load_state == S3C2410_DMALOAD_NONE ||
401 chan->load_state == S3C2410_DMALOAD_1RUNNING)
402 return 1;
403
404 return 0;
405}
406
407
408/* s3c2410_dma_enqueue
409 *
410 * queue an given buffer for dma transfer.
411 *
412 * id the device driver's id information for this buffer
413 * data the physical address of the buffer data
414 * size the size of the buffer in bytes
415 *
416 * If the channel is not running, then the flag S3C2410_DMAF_AUTOSTART
417 * is checked, and if set, the channel is started. If this flag isn't set,
418 * then an error will be returned.
419 *
420 * It is possible to queue more than one DMA buffer onto a channel at
421 * once, and the code will deal with the re-loading of the next buffer
422 * when necessary.
423*/
424
425int s3c2410_dma_enqueue(unsigned int channel, void *id,
426 dma_addr_t data, int size)
427{
428 s3c2410_dma_chan_t *chan = &s3c2410_chans[channel];
429 s3c2410_dma_buf_t *buf;
430 unsigned long flags;
431
432 check_channel(channel);
433
434 pr_debug("%s: id=%p, data=%08x, size=%d\n",
435 __FUNCTION__, id, (unsigned int)data, size);
436
437 buf = kmem_cache_alloc(dma_kmem, GFP_ATOMIC);
438 if (buf == NULL) {
439 pr_debug("%s: out of memory (%d alloc)\n",
440 __FUNCTION__, sizeof(*buf));
441 return -ENOMEM;
442 }
443
444 pr_debug("%s: new buffer %p\n", __FUNCTION__, buf);
445
446 //dbg_showchan(chan);
447
448 buf->next = NULL;
449 buf->data = buf->ptr = data;
450 buf->size = size;
451 buf->id = id;
452 buf->magic = BUF_MAGIC;
453
454 local_irq_save(flags);
455
456 if (chan->curr == NULL) {
457 /* we've got nothing loaded... */
458 pr_debug("%s: buffer %p queued onto empty channel\n",
459 __FUNCTION__, buf);
460
461 chan->curr = buf;
462 chan->end = buf;
463 chan->next = NULL;
464 } else {
465 pr_debug("dma%d: %s: buffer %p queued onto non-empty channel\n",
466 chan->number, __FUNCTION__, buf);
467
468 if (chan->end == NULL)
469 pr_debug("dma%d: %s: %p not empty, and chan->end==NULL?\n",
470 chan->number, __FUNCTION__, chan);
471
472 chan->end->next = buf;
473 chan->end = buf;
474 }
475
476 /* if necessary, update the next buffer field */
477 if (chan->next == NULL)
478 chan->next = buf;
479
480 /* check to see if we can load a buffer */
481 if (chan->state == S3C2410_DMA_RUNNING) {
482 if (chan->load_state == S3C2410_DMALOAD_1LOADED && 1) {
483 if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
484 printk(KERN_ERR "dma%d: loadbuffer:"
485 "timeout loading buffer\n",
486 chan->number);
487 dbg_showchan(chan);
488 local_irq_restore(flags);
489 return -EINVAL;
490 }
491 }
492
493 while (s3c2410_dma_canload(chan) && chan->next != NULL) {
494 s3c2410_dma_loadbuffer(chan, chan->next);
495 }
496 } else if (chan->state == S3C2410_DMA_IDLE) {
497 if (chan->flags & S3C2410_DMAF_AUTOSTART) {
498 s3c2410_dma_ctrl(chan->number, S3C2410_DMAOP_START);
499 }
500 }
501
502 local_irq_restore(flags);
503 return 0;
504}
505
506EXPORT_SYMBOL(s3c2410_dma_enqueue);
507
508static inline void
509s3c2410_dma_freebuf(s3c2410_dma_buf_t *buf)
510{
511 int magicok = (buf->magic == BUF_MAGIC);
512
513 buf->magic = -1;
514
515 if (magicok) {
516 kmem_cache_free(dma_kmem, buf);
517 } else {
518 printk("s3c2410_dma_freebuf: buff %p with bad magic\n", buf);
519 }
520}
521
522/* s3c2410_dma_lastxfer
523 *
524 * called when the system is out of buffers, to ensure that the channel
525 * is prepared for shutdown.
526*/
527
528static inline void
529s3c2410_dma_lastxfer(s3c2410_dma_chan_t *chan)
530{
531 pr_debug("dma%d: s3c2410_dma_lastxfer: load_state %d\n",
532 chan->number, chan->load_state);
533
534 switch (chan->load_state) {
535 case S3C2410_DMALOAD_NONE:
536 break;
537
538 case S3C2410_DMALOAD_1LOADED:
539 if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
540 /* flag error? */
541 printk(KERN_ERR "dma%d: timeout waiting for load\n",
542 chan->number);
543 return;
544 }
545 break;
546
547 default:
548 pr_debug("dma%d: lastxfer: unhandled load_state %d with no next",
549 chan->number, chan->load_state);
550 return;
551
552 }
553
554 /* hopefully this'll shut the damned thing up after the transfer... */
555 dma_wrreg(chan, S3C2410_DMA_DCON, chan->dcon | S3C2410_DCON_NORELOAD);
556}
557
558
559#define dmadbg2(x...)
560
561static irqreturn_t
562s3c2410_dma_irq(int irq, void *devpw, struct pt_regs *regs)
563{
564 s3c2410_dma_chan_t *chan = (s3c2410_dma_chan_t *)devpw;
565 s3c2410_dma_buf_t *buf;
566
567 buf = chan->curr;
568
569 dbg_showchan(chan);
570
571 /* modify the channel state */
572
573 switch (chan->load_state) {
574 case S3C2410_DMALOAD_1RUNNING:
575 /* TODO - if we are running only one buffer, we probably
576 * want to reload here, and then worry about the buffer
577 * callback */
578
579 chan->load_state = S3C2410_DMALOAD_NONE;
580 break;
581
582 case S3C2410_DMALOAD_1LOADED:
583 /* iirc, we should go back to NONE loaded here, we
584 * had a buffer, and it was never verified as being
585 * loaded.
586 */
587
588 chan->load_state = S3C2410_DMALOAD_NONE;
589 break;
590
591 case S3C2410_DMALOAD_1LOADED_1RUNNING:
592 /* we'll worry about checking to see if another buffer is
593 * ready after we've called back the owner. This should
594 * ensure we do not wait around too long for the DMA
595 * engine to start the next transfer
596 */
597
598 chan->load_state = S3C2410_DMALOAD_1LOADED;
599 break;
600
601 case S3C2410_DMALOAD_NONE:
602 printk(KERN_ERR "dma%d: IRQ with no loaded buffer?\n",
603 chan->number);
604 break;
605
606 default:
607 printk(KERN_ERR "dma%d: IRQ in invalid load_state %d\n",
608 chan->number, chan->load_state);
609 break;
610 }
611
612 if (buf != NULL) {
613 /* update the chain to make sure that if we load any more
614 * buffers when we call the callback function, things should
615 * work properly */
616
617 chan->curr = buf->next;
618 buf->next = NULL;
619
620 if (buf->magic != BUF_MAGIC) {
621 printk(KERN_ERR "dma%d: %s: buf %p incorrect magic\n",
622 chan->number, __FUNCTION__, buf);
623 return IRQ_HANDLED;
624 }
625
626 s3c2410_dma_buffdone(chan, buf, S3C2410_RES_OK);
627
628 /* free resouces */
629 s3c2410_dma_freebuf(buf);
630 } else {
631 }
632
633 if (chan->next != NULL) {
634 unsigned long flags;
635
636 switch (chan->load_state) {
637 case S3C2410_DMALOAD_1RUNNING:
638 /* don't need to do anything for this state */
639 break;
640
641 case S3C2410_DMALOAD_NONE:
642 /* can load buffer immediately */
643 break;
644
645 case S3C2410_DMALOAD_1LOADED:
646 if (s3c2410_dma_waitforload(chan, __LINE__) == 0) {
647 /* flag error? */
648 printk(KERN_ERR "dma%d: timeout waiting for load\n",
649 chan->number);
650 return IRQ_HANDLED;
651 }
652
653 break;
654
655 case S3C2410_DMALOAD_1LOADED_1RUNNING:
656 goto no_load;
657
658 default:
659 printk(KERN_ERR "dma%d: unknown load_state in irq, %d\n",
660 chan->number, chan->load_state);
661 return IRQ_HANDLED;
662 }
663
664 local_irq_save(flags);
665 s3c2410_dma_loadbuffer(chan, chan->next);
666 local_irq_restore(flags);
667 } else {
668 s3c2410_dma_lastxfer(chan);
669
670 /* see if we can stop this channel.. */
671 if (chan->load_state == S3C2410_DMALOAD_NONE) {
672 pr_debug("dma%d: end of transfer, stopping channel (%ld)\n",
673 chan->number, jiffies);
674 s3c2410_dma_ctrl(chan->number, S3C2410_DMAOP_STOP);
675 }
676 }
677
678 no_load:
679 return IRQ_HANDLED;
680}
681
682
683
684/* s3c2410_request_dma
685 *
686 * get control of an dma channel
687*/
688
689int s3c2410_dma_request(unsigned int channel, s3c2410_dma_client_t *client,
690 void *dev)
691{
692 s3c2410_dma_chan_t *chan = &s3c2410_chans[channel];
693 unsigned long flags;
694 int err;
695
696 pr_debug("dma%d: s3c2410_request_dma: client=%s, dev=%p\n",
697 channel, client->name, dev);
698
699 check_channel(channel);
700
701 local_irq_save(flags);
702
703 dbg_showchan(chan);
704
705 if (chan->in_use) {
706 if (client != chan->client) {
707 printk(KERN_ERR "dma%d: already in use\n", channel);
708 local_irq_restore(flags);
709 return -EBUSY;
710 } else {
711 printk(KERN_ERR "dma%d: client already has channel\n", channel);
712 }
713 }
714
715 chan->client = client;
716 chan->in_use = 1;
717
718 if (!chan->irq_claimed) {
719 pr_debug("dma%d: %s : requesting irq %d\n",
720 channel, __FUNCTION__, chan->irq);
721
722 err = request_irq(chan->irq, s3c2410_dma_irq, SA_INTERRUPT,
723 client->name, (void *)chan);
724
725 if (err) {
726 chan->in_use = 0;
727 local_irq_restore(flags);
728
729 printk(KERN_ERR "%s: cannot get IRQ %d for DMA %d\n",
730 client->name, chan->irq, chan->number);
731 return err;
732 }
733
734 chan->irq_claimed = 1;
735 chan->irq_enabled = 1;
736 }
737
738 local_irq_restore(flags);
739
740 /* need to setup */
741
742 pr_debug("%s: channel initialised, %p\n", __FUNCTION__, chan);
743
744 return 0;
745}
746
747EXPORT_SYMBOL(s3c2410_dma_request);
748
749/* s3c2410_dma_free
750 *
751 * release the given channel back to the system, will stop and flush
752 * any outstanding transfers, and ensure the channel is ready for the
753 * next claimant.
754 *
755 * Note, although a warning is currently printed if the freeing client
756 * info is not the same as the registrant's client info, the free is still
757 * allowed to go through.
758*/
759
760int s3c2410_dma_free(dmach_t channel, s3c2410_dma_client_t *client)
761{
762 s3c2410_dma_chan_t *chan = &s3c2410_chans[channel];
763 unsigned long flags;
764
765 check_channel(channel);
766
767 local_irq_save(flags);
768
769
770 if (chan->client != client) {
771 printk(KERN_WARNING "dma%d: possible free from different client (channel %p, passed %p)\n",
772 channel, chan->client, client);
773 }
774
775 /* sort out stopping and freeing the channel */
776
777 if (chan->state != S3C2410_DMA_IDLE) {
778 pr_debug("%s: need to stop dma channel %p\n",
779 __FUNCTION__, chan);
780
781 /* possibly flush the channel */
782 s3c2410_dma_ctrl(channel, S3C2410_DMAOP_STOP);
783 }
784
785 chan->client = NULL;
786 chan->in_use = 0;
787
788 local_irq_restore(flags);
789
790 return 0;
791}
792
793EXPORT_SYMBOL(s3c2410_dma_free);
794
795static int s3c2410_dma_dostop(s3c2410_dma_chan_t *chan)
796{
797 unsigned long tmp;
798 unsigned long flags;
799
800 pr_debug("%s:\n", __FUNCTION__);
801
802 dbg_showchan(chan);
803
804 local_irq_save(flags);
805
806 s3c2410_dma_call_op(chan, S3C2410_DMAOP_STOP);
807
808 tmp = dma_rdreg(chan, S3C2410_DMA_DMASKTRIG);
809 tmp |= S3C2410_DMASKTRIG_STOP;
810 dma_wrreg(chan, S3C2410_DMA_DMASKTRIG, tmp);
811
812#if 0
813 /* should also clear interrupts, according to WinCE BSP */
814 tmp = dma_rdreg(chan, S3C2410_DMA_DCON);
815 tmp |= S3C2410_DCON_NORELOAD;
816 dma_wrreg(chan, S3C2410_DMA_DCON, tmp);
817#endif
818
819 chan->state = S3C2410_DMA_IDLE;
820 chan->load_state = S3C2410_DMALOAD_NONE;
821
822 local_irq_restore(flags);
823
824 return 0;
825}
826
827/* s3c2410_dma_flush
828 *
829 * stop the channel, and remove all current and pending transfers
830*/
831
832static int s3c2410_dma_flush(s3c2410_dma_chan_t *chan)
833{
834 s3c2410_dma_buf_t *buf, *next;
835 unsigned long flags;
836
837 pr_debug("%s:\n", __FUNCTION__);
838
839 local_irq_save(flags);
840
841 if (chan->state != S3C2410_DMA_IDLE) {
842 pr_debug("%s: stopping channel...\n", __FUNCTION__ );
843 s3c2410_dma_ctrl(chan->number, S3C2410_DMAOP_STOP);
844 }
845
846 buf = chan->curr;
847 if (buf == NULL)
848 buf = chan->next;
849
850 chan->curr = chan->next = chan->end = NULL;
851
852 if (buf != NULL) {
853 for ( ; buf != NULL; buf = next) {
854 next = buf->next;
855
856 pr_debug("%s: free buffer %p, next %p\n",
857 __FUNCTION__, buf, buf->next);
858
859 s3c2410_dma_buffdone(chan, buf, S3C2410_RES_ABORT);
860 s3c2410_dma_freebuf(buf);
861 }
862 }
863
864 local_irq_restore(flags);
865
866 return 0;
867}
868
869
870int
871s3c2410_dma_ctrl(dmach_t channel, s3c2410_chan_op_t op)
872{
873 s3c2410_dma_chan_t *chan = &s3c2410_chans[channel];
874
875 check_channel(channel);
876
877 switch (op) {
878 case S3C2410_DMAOP_START:
879 return s3c2410_dma_start(chan);
880
881 case S3C2410_DMAOP_STOP:
882 return s3c2410_dma_dostop(chan);
883
884 case S3C2410_DMAOP_PAUSE:
885 return -ENOENT;
886
887 case S3C2410_DMAOP_RESUME:
888 return -ENOENT;
889
890 case S3C2410_DMAOP_FLUSH:
891 return s3c2410_dma_flush(chan);
892
893 case S3C2410_DMAOP_TIMEOUT:
894 return 0;
895
896 }
897
898 return -ENOENT; /* unknown, don't bother */
899}
900
901EXPORT_SYMBOL(s3c2410_dma_ctrl);
902
903/* DMA configuration for each channel
904 *
905 * DISRCC -> source of the DMA (AHB,APB)
906 * DISRC -> source address of the DMA
907 * DIDSTC -> destination of the DMA (AHB,APD)
908 * DIDST -> destination address of the DMA
909*/
910
911/* s3c2410_dma_config
912 *
913 * xfersize: size of unit in bytes (1,2,4)
914 * dcon: base value of the DCONx register
915*/
916
917int s3c2410_dma_config(dmach_t channel,
918 int xferunit,
919 int dcon)
920{
921 s3c2410_dma_chan_t *chan = &s3c2410_chans[channel];
922
923 pr_debug("%s: chan=%d, xfer_unit=%d, dcon=%08x\n",
924 __FUNCTION__, channel, xferunit, dcon);
925
926 check_channel(channel);
927
928 switch (xferunit) {
929 case 1:
930 dcon |= S3C2410_DCON_BYTE;
931 break;
932
933 case 2:
934 dcon |= S3C2410_DCON_HALFWORD;
935 break;
936
937 case 4:
938 dcon |= S3C2410_DCON_WORD;
939 break;
940
941 default:
942 pr_debug("%s: bad transfer size %d\n", __FUNCTION__, xferunit);
943 return -EINVAL;
944 }
945
946 dcon |= S3C2410_DCON_HWTRIG;
947 dcon |= S3C2410_DCON_INTREQ;
948
949 pr_debug("%s: dcon now %08x\n", __FUNCTION__, dcon);
950
951 chan->dcon = dcon;
952 chan->xfer_unit = xferunit;
953
954 return 0;
955}
956
957EXPORT_SYMBOL(s3c2410_dma_config);
958
959int s3c2410_dma_setflags(dmach_t channel, unsigned int flags)
960{
961 s3c2410_dma_chan_t *chan = &s3c2410_chans[channel];
962
963 check_channel(channel);
964
965 pr_debug("%s: chan=%p, flags=%08x\n", __FUNCTION__, chan, flags);
966
967 chan->flags = flags;
968
969 return 0;
970}
971
972EXPORT_SYMBOL(s3c2410_dma_setflags);
973
974
975/* do we need to protect the settings of the fields from
976 * irq?
977*/
978
979int s3c2410_dma_set_opfn(dmach_t channel, s3c2410_dma_opfn_t rtn)
980{
981 s3c2410_dma_chan_t *chan = &s3c2410_chans[channel];
982
983 check_channel(channel);
984
985 pr_debug("%s: chan=%p, op rtn=%p\n", __FUNCTION__, chan, rtn);
986
987 chan->op_fn = rtn;
988
989 return 0;
990}
991
992EXPORT_SYMBOL(s3c2410_dma_set_opfn);
993
994int s3c2410_dma_set_buffdone_fn(dmach_t channel, s3c2410_dma_cbfn_t rtn)
995{
996 s3c2410_dma_chan_t *chan = &s3c2410_chans[channel];
997
998 check_channel(channel);
999
1000 pr_debug("%s: chan=%p, callback rtn=%p\n", __FUNCTION__, chan, rtn);
1001
1002 chan->callback_fn = rtn;
1003
1004 return 0;
1005}
1006
1007EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn);
1008
1009/* s3c2410_dma_devconfig
1010 *
1011 * configure the dma source/destination hardware type and address
1012 *
1013 * source: S3C2410_DMASRC_HW: source is hardware
1014 * S3C2410_DMASRC_MEM: source is memory
1015 *
1016 * hwcfg: the value for xxxSTCn register,
1017 * bit 0: 0=increment pointer, 1=leave pointer
1018 * bit 1: 0=soucre is AHB, 1=soucre is APB
1019 *
1020 * devaddr: physical address of the source
1021*/
1022
1023int s3c2410_dma_devconfig(int channel,
1024 s3c2410_dmasrc_t source,
1025 int hwcfg,
1026 unsigned long devaddr)
1027{
1028 s3c2410_dma_chan_t *chan = &s3c2410_chans[channel];
1029
1030 check_channel(channel);
1031
1032 pr_debug("%s: source=%d, hwcfg=%08x, devaddr=%08lx\n",
1033 __FUNCTION__, (int)source, hwcfg, devaddr);
1034
1035 chan->source = source;
1036 chan->dev_addr = devaddr;
1037
1038 switch (source) {
1039 case S3C2410_DMASRC_HW:
1040 /* source is hardware */
1041 pr_debug("%s: hw source, devaddr=%08lx, hwcfg=%d\n",
1042 __FUNCTION__, devaddr, hwcfg);
1043 dma_wrreg(chan, S3C2410_DMA_DISRCC, hwcfg & 3);
1044 dma_wrreg(chan, S3C2410_DMA_DISRC, devaddr);
1045 dma_wrreg(chan, S3C2410_DMA_DIDSTC, (0<<1) | (0<<0));
1046
1047 chan->addr_reg = dma_regaddr(chan, S3C2410_DMA_DIDST);
1048 return 0;
1049
1050 case S3C2410_DMASRC_MEM:
1051 /* source is memory */
1052 pr_debug( "%s: mem source, devaddr=%08lx, hwcfg=%d\n",
1053 __FUNCTION__, devaddr, hwcfg);
1054 dma_wrreg(chan, S3C2410_DMA_DISRCC, (0<<1) | (0<<0));
1055 dma_wrreg(chan, S3C2410_DMA_DIDST, devaddr);
1056 dma_wrreg(chan, S3C2410_DMA_DIDSTC, hwcfg & 3);
1057
1058 chan->addr_reg = dma_regaddr(chan, S3C2410_DMA_DISRC);
1059 return 0;
1060 }
1061
1062 printk(KERN_ERR "dma%d: invalid source type (%d)\n", channel, source);
1063 return -EINVAL;
1064}
1065
1066EXPORT_SYMBOL(s3c2410_dma_devconfig);
1067
1068/* s3c2410_dma_getposition
1069 *
1070 * returns the current transfer points for the dma source and destination
1071*/
1072
1073int s3c2410_dma_getposition(dmach_t channel, dma_addr_t *src, dma_addr_t *dst)
1074{
1075 s3c2410_dma_chan_t *chan = &s3c2410_chans[channel];
1076
1077 check_channel(channel);
1078
1079 if (src != NULL)
1080 *src = dma_rdreg(chan, S3C2410_DMA_DCSRC);
1081
1082 if (dst != NULL)
1083 *dst = dma_rdreg(chan, S3C2410_DMA_DCDST);
1084
1085 return 0;
1086}
1087
1088EXPORT_SYMBOL(s3c2410_dma_getposition);
1089
1090
1091/* system device class */
1092
1093#ifdef CONFIG_PM
1094
1095static int s3c2410_dma_suspend(struct sys_device *dev, pm_message_t state)
1096{
1097 s3c2410_dma_chan_t *cp = container_of(dev, s3c2410_dma_chan_t, dev);
1098
1099 printk(KERN_DEBUG "suspending dma channel %d\n", cp->number);
1100
1101 if (dma_rdreg(cp, S3C2410_DMA_DMASKTRIG) & S3C2410_DMASKTRIG_ON) {
1102 /* the dma channel is still working, which is probably
1103 * a bad thing to do over suspend/resume. We stop the
1104 * channel and assume that the client is either going to
1105 * retry after resume, or that it is broken.
1106 */
1107
1108 printk(KERN_INFO "dma: stopping channel %d due to suspend\n",
1109 cp->number);
1110
1111 s3c2410_dma_dostop(cp);
1112 }
1113
1114 return 0;
1115}
1116
1117static int s3c2410_dma_resume(struct sys_device *dev)
1118{
1119 return 0;
1120}
1121
1122#else
1123#define s3c2410_dma_suspend NULL
1124#define s3c2410_dma_resume NULL
1125#endif /* CONFIG_PM */
1126
1127static struct sysdev_class dma_sysclass = {
1128 set_kset_name("s3c24xx-dma"),
1129 .suspend = s3c2410_dma_suspend,
1130 .resume = s3c2410_dma_resume,
1131};
1132
1133/* kmem cache implementation */
1134
1135static void s3c2410_dma_cache_ctor(void *p, kmem_cache_t *c, unsigned long f)
1136{
1137 memset(p, 0, sizeof(s3c2410_dma_buf_t));
1138}
1139
1140
1141/* initialisation code */
1142
1143static int __init s3c2410_init_dma(void)
1144{
1145 s3c2410_dma_chan_t *cp;
1146 int channel;
1147 int ret;
1148
1149 printk("S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics\n");
1150
1151 dma_base = ioremap(S3C2410_PA_DMA, 0x200);
1152 if (dma_base == NULL) {
1153 printk(KERN_ERR "dma failed to remap register block\n");
1154 return -ENOMEM;
1155 }
1156
1157 ret = sysdev_class_register(&dma_sysclass);
1158 if (ret != 0) {
1159 printk(KERN_ERR "dma sysclass registration failed\n");
1160 goto err;
1161 }
1162
1163 dma_kmem = kmem_cache_create("dma_desc", sizeof(s3c2410_dma_buf_t), 0,
1164 SLAB_HWCACHE_ALIGN,
1165 s3c2410_dma_cache_ctor, NULL);
1166
1167 if (dma_kmem == NULL) {
1168 printk(KERN_ERR "dma failed to make kmem cache\n");
1169 ret = -ENOMEM;
1170 goto err;
1171 }
1172
1173 for (channel = 0; channel < S3C2410_DMA_CHANNELS; channel++) {
1174 cp = &s3c2410_chans[channel];
1175
1176 memset(cp, 0, sizeof(s3c2410_dma_chan_t));
1177
1178 /* dma channel irqs are in order.. */
1179 cp->number = channel;
1180 cp->irq = channel + IRQ_DMA0;
1181 cp->regs = dma_base + (channel*0x40);
1182
1183 /* point current stats somewhere */
1184 cp->stats = &cp->stats_store;
1185 cp->stats_store.timeout_shortest = LONG_MAX;
1186
1187 /* basic channel configuration */
1188
1189 cp->load_timeout = 1<<18;
1190
1191 /* register system device */
1192
1193 cp->dev.cls = &dma_sysclass;
1194 cp->dev.id = channel;
1195 ret = sysdev_register(&cp->dev);
1196
1197 printk("DMA channel %d at %p, irq %d\n",
1198 cp->number, cp->regs, cp->irq);
1199 }
1200
1201 return 0;
1202
1203 err:
1204 kmem_cache_destroy(dma_kmem);
1205 iounmap(dma_base);
1206 dma_base = NULL;
1207 return ret;
1208}
1209
1210__initcall(s3c2410_init_dma);
diff --git a/arch/arm/mach-s3c2410/gpio.c b/arch/arm/mach-s3c2410/gpio.c
new file mode 100644
index 000000000000..94f1776cf312
--- /dev/null
+++ b/arch/arm/mach-s3c2410/gpio.c
@@ -0,0 +1,213 @@
1/* linux/arch/arm/mach-s3c2410/gpio.c
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 GPIO support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 * Changelog
23 * 13-Sep-2004 BJD Implemented change of MISCCR
24 * 14-Sep-2004 BJD Added getpin call
25 * 14-Sep-2004 BJD Fixed bug in setpin() call
26 * 30-Sep-2004 BJD Fixed cfgpin() mask bug
27 * 01-Oct-2004 BJD Added getcfg() to get pin configuration
28 * 01-Oct-2004 BJD Fixed mask bug in pullup() call
29 * 01-Oct-2004 BJD Added getirq() to turn pin into irqno
30 * 04-Oct-2004 BJD Added irq filter controls for GPIO
31 * 05-Nov-2004 BJD EXPORT_SYMBOL() added for all code
32 * 13-Mar-2005 BJD Updates for __iomem
33 */
34
35
36#include <linux/kernel.h>
37#include <linux/init.h>
38#include <linux/module.h>
39#include <linux/interrupt.h>
40#include <linux/ioport.h>
41
42#include <asm/hardware.h>
43#include <asm/irq.h>
44#include <asm/io.h>
45
46#include <asm/arch/regs-gpio.h>
47
48void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function)
49{
50 void __iomem *base = S3C2410_GPIO_BASE(pin);
51 unsigned long mask;
52 unsigned long con;
53 unsigned long flags;
54
55 if (pin < S3C2410_GPIO_BANKB) {
56 mask = 1 << S3C2410_GPIO_OFFSET(pin);
57 } else {
58 mask = 3 << S3C2410_GPIO_OFFSET(pin)*2;
59 }
60
61 local_irq_save(flags);
62
63 con = __raw_readl(base + 0x00);
64 con &= ~mask;
65 con |= function;
66
67 __raw_writel(con, base + 0x00);
68
69 local_irq_restore(flags);
70}
71
72EXPORT_SYMBOL(s3c2410_gpio_cfgpin);
73
74unsigned int s3c2410_gpio_getcfg(unsigned int pin)
75{
76 void __iomem *base = S3C2410_GPIO_BASE(pin);
77 unsigned long mask;
78
79 if (pin < S3C2410_GPIO_BANKB) {
80 mask = 1 << S3C2410_GPIO_OFFSET(pin);
81 } else {
82 mask = 3 << S3C2410_GPIO_OFFSET(pin)*2;
83 }
84
85 return __raw_readl(base) & mask;
86}
87
88EXPORT_SYMBOL(s3c2410_gpio_getcfg);
89
90void s3c2410_gpio_pullup(unsigned int pin, unsigned int to)
91{
92 void __iomem *base = S3C2410_GPIO_BASE(pin);
93 unsigned long offs = S3C2410_GPIO_OFFSET(pin);
94 unsigned long flags;
95 unsigned long up;
96
97 if (pin < S3C2410_GPIO_BANKB)
98 return;
99
100 local_irq_save(flags);
101
102 up = __raw_readl(base + 0x08);
103 up &= ~(1L << offs);
104 up |= to << offs;
105 __raw_writel(up, base + 0x08);
106
107 local_irq_restore(flags);
108}
109
110EXPORT_SYMBOL(s3c2410_gpio_pullup);
111
112void s3c2410_gpio_setpin(unsigned int pin, unsigned int to)
113{
114 void __iomem *base = S3C2410_GPIO_BASE(pin);
115 unsigned long offs = S3C2410_GPIO_OFFSET(pin);
116 unsigned long flags;
117 unsigned long dat;
118
119 local_irq_save(flags);
120
121 dat = __raw_readl(base + 0x04);
122 dat &= ~(1 << offs);
123 dat |= to << offs;
124 __raw_writel(dat, base + 0x04);
125
126 local_irq_restore(flags);
127}
128
129EXPORT_SYMBOL(s3c2410_gpio_setpin);
130
131unsigned int s3c2410_gpio_getpin(unsigned int pin)
132{
133 void __iomem *base = S3C2410_GPIO_BASE(pin);
134 unsigned long offs = S3C2410_GPIO_OFFSET(pin);
135
136 return __raw_readl(base + 0x04) & (1<< offs);
137}
138
139EXPORT_SYMBOL(s3c2410_gpio_getpin);
140
141unsigned int s3c2410_modify_misccr(unsigned int clear, unsigned int change)
142{
143 unsigned long flags;
144 unsigned long misccr;
145
146 local_irq_save(flags);
147 misccr = __raw_readl(S3C2410_MISCCR);
148 misccr &= ~clear;
149 misccr ^= change;
150 __raw_writel(misccr, S3C2410_MISCCR);
151 local_irq_restore(flags);
152
153 return misccr;
154}
155
156EXPORT_SYMBOL(s3c2410_modify_misccr);
157
158int s3c2410_gpio_getirq(unsigned int pin)
159{
160 if (pin < S3C2410_GPF0 || pin > S3C2410_GPG15_EINT23)
161 return -1; /* not valid interrupts */
162
163 if (pin < S3C2410_GPG0 && pin > S3C2410_GPF7)
164 return -1; /* not valid pin */
165
166 if (pin < S3C2410_GPF4)
167 return (pin - S3C2410_GPF0) + IRQ_EINT0;
168
169 if (pin < S3C2410_GPG0)
170 return (pin - S3C2410_GPF4) + IRQ_EINT4;
171
172 return (pin - S3C2410_GPG0) + IRQ_EINT8;
173}
174
175EXPORT_SYMBOL(s3c2410_gpio_getirq);
176
177int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
178 unsigned int config)
179{
180 void __iomem *reg = S3C2410_EINFLT0;
181 unsigned long flags;
182 unsigned long val;
183
184 if (pin < S3C2410_GPG8 || pin > S3C2410_GPG15)
185 return -1;
186
187 config &= 0xff;
188
189 pin -= S3C2410_GPG8_EINT16;
190 reg += pin & ~3;
191
192 local_irq_save(flags);
193
194 /* update filter width and clock source */
195
196 val = __raw_readl(reg);
197 val &= ~(0xff << ((pin & 3) * 8));
198 val |= config << ((pin & 3) * 8);
199 __raw_writel(val, reg);
200
201 /* update filter enable */
202
203 val = __raw_readl(S3C2410_EXTINT2);
204 val &= ~(1 << ((pin * 4) + 3));
205 val |= on << ((pin * 4) + 3);
206 __raw_writel(val, S3C2410_EXTINT2);
207
208 local_irq_restore(flags);
209
210 return 0;
211}
212
213EXPORT_SYMBOL(s3c2410_gpio_irqfilter);
diff --git a/arch/arm/mach-s3c2410/irq.c b/arch/arm/mach-s3c2410/irq.c
new file mode 100644
index 000000000000..b668c48f4399
--- /dev/null
+++ b/arch/arm/mach-s3c2410/irq.c
@@ -0,0 +1,966 @@
1/* linux/arch/arm/mach-s3c2410/irq.c
2 *
3 * Copyright (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * Changelog:
21 *
22 * 22-Jul-2004 Ben Dooks <ben@simtec.co.uk>
23 * Fixed compile warnings
24 *
25 * 22-Jul-2004 Roc Wu <cooloney@yahoo.com.cn>
26 * Fixed s3c_extirq_type
27 *
28 * 21-Jul-2004 Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
29 * Addition of ADC/TC demux
30 *
31 * 04-Oct-2004 Klaus Fetscher <k.fetscher@fetron.de>
32 * Fix for set_irq_type() on low EINT numbers
33 *
34 * 05-Oct-2004 Ben Dooks <ben@simtec.co.uk>
35 * Tidy up KF's patch and sort out new release
36 *
37 * 05-Oct-2004 Ben Dooks <ben@simtec.co.uk>
38 * Add support for power management controls
39 *
40 * 04-Nov-2004 Ben Dooks
41 * Fix standard IRQ wake for EINT0..4 and RTC
42 *
43 * 22-Feb-2004 Ben Dooks
44 * Fixed edge-triggering on ADC IRQ
45*/
46
47#include <linux/init.h>
48#include <linux/module.h>
49#include <linux/interrupt.h>
50#include <linux/ioport.h>
51#include <linux/ptrace.h>
52#include <linux/sysdev.h>
53
54#include <asm/hardware.h>
55#include <asm/irq.h>
56#include <asm/io.h>
57
58#include <asm/mach/irq.h>
59
60#include <asm/arch/regs-irq.h>
61#include <asm/arch/regs-gpio.h>
62
63#include "cpu.h"
64#include "pm.h"
65
66#define irqdbf(x...)
67#define irqdbf2(x...)
68
69#define EXTINT_OFF (IRQ_EINT4 - 4)
70
71/* wakeup irq control */
72
73#ifdef CONFIG_PM
74
75/* state for IRQs over sleep */
76
77/* default is to allow for EINT0..EINT15, and IRQ_RTC as wakeup sources
78 *
79 * set bit to 1 in allow bitfield to enable the wakeup settings on it
80*/
81
82unsigned long s3c_irqwake_intallow = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL;
83unsigned long s3c_irqwake_intmask = 0xffffffffL;
84unsigned long s3c_irqwake_eintallow = 0x0000fff0L;
85unsigned long s3c_irqwake_eintmask = 0xffffffffL;
86
87static int
88s3c_irq_wake(unsigned int irqno, unsigned int state)
89{
90 unsigned long irqbit = 1 << (irqno - IRQ_EINT0);
91
92 if (!(s3c_irqwake_intallow & irqbit))
93 return -ENOENT;
94
95 printk(KERN_INFO "wake %s for irq %d\n",
96 state ? "enabled" : "disabled", irqno);
97
98 if (!state)
99 s3c_irqwake_intmask |= irqbit;
100 else
101 s3c_irqwake_intmask &= ~irqbit;
102
103 return 0;
104}
105
106static int
107s3c_irqext_wake(unsigned int irqno, unsigned int state)
108{
109 unsigned long bit = 1L << (irqno - EXTINT_OFF);
110
111 if (!(s3c_irqwake_eintallow & bit))
112 return -ENOENT;
113
114 printk(KERN_INFO "wake %s for irq %d\n",
115 state ? "enabled" : "disabled", irqno);
116
117 if (!state)
118 s3c_irqwake_eintmask |= bit;
119 else
120 s3c_irqwake_eintmask &= ~bit;
121
122 return 0;
123}
124
125#else
126#define s3c_irqext_wake NULL
127#define s3c_irq_wake NULL
128#endif
129
130
131static void
132s3c_irq_mask(unsigned int irqno)
133{
134 unsigned long mask;
135
136 irqno -= IRQ_EINT0;
137
138 mask = __raw_readl(S3C2410_INTMSK);
139 mask |= 1UL << irqno;
140 __raw_writel(mask, S3C2410_INTMSK);
141}
142
143static inline void
144s3c_irq_ack(unsigned int irqno)
145{
146 unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
147
148 __raw_writel(bitval, S3C2410_SRCPND);
149 __raw_writel(bitval, S3C2410_INTPND);
150}
151
152static inline void
153s3c_irq_maskack(unsigned int irqno)
154{
155 unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
156 unsigned long mask;
157
158 mask = __raw_readl(S3C2410_INTMSK);
159 __raw_writel(mask|bitval, S3C2410_INTMSK);
160
161 __raw_writel(bitval, S3C2410_SRCPND);
162 __raw_writel(bitval, S3C2410_INTPND);
163}
164
165
166static void
167s3c_irq_unmask(unsigned int irqno)
168{
169 unsigned long mask;
170
171 if (irqno != IRQ_TIMER4 && irqno != IRQ_EINT8t23)
172 irqdbf2("s3c_irq_unmask %d\n", irqno);
173
174 irqno -= IRQ_EINT0;
175
176 mask = __raw_readl(S3C2410_INTMSK);
177 mask &= ~(1UL << irqno);
178 __raw_writel(mask, S3C2410_INTMSK);
179}
180
181static struct irqchip s3c_irq_level_chip = {
182 .ack = s3c_irq_maskack,
183 .mask = s3c_irq_mask,
184 .unmask = s3c_irq_unmask,
185 .wake = s3c_irq_wake
186};
187
188static struct irqchip s3c_irq_chip = {
189 .ack = s3c_irq_ack,
190 .mask = s3c_irq_mask,
191 .unmask = s3c_irq_unmask,
192 .wake = s3c_irq_wake
193};
194
195/* S3C2410_EINTMASK
196 * S3C2410_EINTPEND
197 */
198
199static void
200s3c_irqext_mask(unsigned int irqno)
201{
202 unsigned long mask;
203
204 irqno -= EXTINT_OFF;
205
206 mask = __raw_readl(S3C2410_EINTMASK);
207 mask |= ( 1UL << irqno);
208 __raw_writel(mask, S3C2410_EINTMASK);
209
210 if (irqno <= (IRQ_EINT7 - EXTINT_OFF)) {
211 /* check to see if all need masking */
212
213 if ((mask & (0xf << 4)) == (0xf << 4)) {
214 /* all masked, mask the parent */
215 s3c_irq_mask(IRQ_EINT4t7);
216 }
217 } else {
218 /* todo: the same check as above for the rest of the irq regs...*/
219
220 }
221}
222
223static void
224s3c_irqext_ack(unsigned int irqno)
225{
226 unsigned long req;
227 unsigned long bit;
228 unsigned long mask;
229
230 bit = 1UL << (irqno - EXTINT_OFF);
231
232
233 mask = __raw_readl(S3C2410_EINTMASK);
234
235 __raw_writel(bit, S3C2410_EINTPEND);
236
237 req = __raw_readl(S3C2410_EINTPEND);
238 req &= ~mask;
239
240 /* not sure if we should be acking the parent irq... */
241
242 if (irqno <= IRQ_EINT7 ) {
243 if ((req & 0xf0) == 0)
244 s3c_irq_ack(IRQ_EINT4t7);
245 } else {
246 if ((req >> 8) == 0)
247 s3c_irq_ack(IRQ_EINT8t23);
248 }
249}
250
251static void
252s3c_irqext_unmask(unsigned int irqno)
253{
254 unsigned long mask;
255
256 irqno -= EXTINT_OFF;
257
258 mask = __raw_readl(S3C2410_EINTMASK);
259 mask &= ~( 1UL << irqno);
260 __raw_writel(mask, S3C2410_EINTMASK);
261
262 s3c_irq_unmask((irqno <= (IRQ_EINT7 - EXTINT_OFF)) ? IRQ_EINT4t7 : IRQ_EINT8t23);
263}
264
265static int
266s3c_irqext_type(unsigned int irq, unsigned int type)
267{
268 void __iomem *extint_reg;
269 void __iomem *gpcon_reg;
270 unsigned long gpcon_offset, extint_offset;
271 unsigned long newvalue = 0, value;
272
273 if ((irq >= IRQ_EINT0) && (irq <= IRQ_EINT3))
274 {
275 gpcon_reg = S3C2410_GPFCON;
276 extint_reg = S3C2410_EXTINT0;
277 gpcon_offset = (irq - IRQ_EINT0) * 2;
278 extint_offset = (irq - IRQ_EINT0) * 4;
279 }
280 else if ((irq >= IRQ_EINT4) && (irq <= IRQ_EINT7))
281 {
282 gpcon_reg = S3C2410_GPFCON;
283 extint_reg = S3C2410_EXTINT0;
284 gpcon_offset = (irq - (EXTINT_OFF)) * 2;
285 extint_offset = (irq - (EXTINT_OFF)) * 4;
286 }
287 else if ((irq >= IRQ_EINT8) && (irq <= IRQ_EINT15))
288 {
289 gpcon_reg = S3C2410_GPGCON;
290 extint_reg = S3C2410_EXTINT1;
291 gpcon_offset = (irq - IRQ_EINT8) * 2;
292 extint_offset = (irq - IRQ_EINT8) * 4;
293 }
294 else if ((irq >= IRQ_EINT16) && (irq <= IRQ_EINT23))
295 {
296 gpcon_reg = S3C2410_GPGCON;
297 extint_reg = S3C2410_EXTINT2;
298 gpcon_offset = (irq - IRQ_EINT8) * 2;
299 extint_offset = (irq - IRQ_EINT16) * 4;
300 } else
301 return -1;
302
303 /* Set the GPIO to external interrupt mode */
304 value = __raw_readl(gpcon_reg);
305 value = (value & ~(3 << gpcon_offset)) | (0x02 << gpcon_offset);
306 __raw_writel(value, gpcon_reg);
307
308 /* Set the external interrupt to pointed trigger type */
309 switch (type)
310 {
311 case IRQT_NOEDGE:
312 printk(KERN_WARNING "No edge setting!\n");
313 break;
314
315 case IRQT_RISING:
316 newvalue = S3C2410_EXTINT_RISEEDGE;
317 break;
318
319 case IRQT_FALLING:
320 newvalue = S3C2410_EXTINT_FALLEDGE;
321 break;
322
323 case IRQT_BOTHEDGE:
324 newvalue = S3C2410_EXTINT_BOTHEDGE;
325 break;
326
327 case IRQT_LOW:
328 newvalue = S3C2410_EXTINT_LOWLEV;
329 break;
330
331 case IRQT_HIGH:
332 newvalue = S3C2410_EXTINT_HILEV;
333 break;
334
335 default:
336 printk(KERN_ERR "No such irq type %d", type);
337 return -1;
338 }
339
340 value = __raw_readl(extint_reg);
341 value = (value & ~(7 << extint_offset)) | (newvalue << extint_offset);
342 __raw_writel(value, extint_reg);
343
344 return 0;
345}
346
347static struct irqchip s3c_irqext_chip = {
348 .mask = s3c_irqext_mask,
349 .unmask = s3c_irqext_unmask,
350 .ack = s3c_irqext_ack,
351 .type = s3c_irqext_type,
352 .wake = s3c_irqext_wake
353};
354
355static struct irqchip s3c_irq_eint0t4 = {
356 .ack = s3c_irq_ack,
357 .mask = s3c_irq_mask,
358 .unmask = s3c_irq_unmask,
359 .wake = s3c_irq_wake,
360 .type = s3c_irqext_type,
361};
362
363/* mask values for the parent registers for each of the interrupt types */
364
365#define INTMSK_UART0 (1UL << (IRQ_UART0 - IRQ_EINT0))
366#define INTMSK_UART1 (1UL << (IRQ_UART1 - IRQ_EINT0))
367#define INTMSK_UART2 (1UL << (IRQ_UART2 - IRQ_EINT0))
368#define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0))
369#define INTMSK_LCD (1UL << (IRQ_LCD - IRQ_EINT0))
370
371static inline void
372s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
373 int subcheck)
374{
375 unsigned long mask;
376 unsigned long submask;
377
378 submask = __raw_readl(S3C2410_INTSUBMSK);
379 mask = __raw_readl(S3C2410_INTMSK);
380
381 submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
382
383 /* check to see if we need to mask the parent IRQ */
384
385 if ((submask & subcheck) == subcheck) {
386 __raw_writel(mask | parentbit, S3C2410_INTMSK);
387 }
388
389 /* write back masks */
390 __raw_writel(submask, S3C2410_INTSUBMSK);
391
392}
393
394static inline void
395s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
396{
397 unsigned long mask;
398 unsigned long submask;
399
400 submask = __raw_readl(S3C2410_INTSUBMSK);
401 mask = __raw_readl(S3C2410_INTMSK);
402
403 submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
404 mask &= ~parentbit;
405
406 /* write back masks */
407 __raw_writel(submask, S3C2410_INTSUBMSK);
408 __raw_writel(mask, S3C2410_INTMSK);
409}
410
411
412static inline void
413s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group)
414{
415 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
416
417 s3c_irqsub_mask(irqno, parentmask, group);
418
419 __raw_writel(bit, S3C2410_SUBSRCPND);
420
421 /* only ack parent if we've got all the irqs (seems we must
422 * ack, all and hope that the irq system retriggers ok when
423 * the interrupt goes off again)
424 */
425
426 if (1) {
427 __raw_writel(parentmask, S3C2410_SRCPND);
428 __raw_writel(parentmask, S3C2410_INTPND);
429 }
430}
431
432static inline void
433s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group)
434{
435 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
436
437 __raw_writel(bit, S3C2410_SUBSRCPND);
438
439 /* only ack parent if we've got all the irqs (seems we must
440 * ack, all and hope that the irq system retriggers ok when
441 * the interrupt goes off again)
442 */
443
444 if (1) {
445 __raw_writel(parentmask, S3C2410_SRCPND);
446 __raw_writel(parentmask, S3C2410_INTPND);
447 }
448}
449
450/* UART0 */
451
452static void
453s3c_irq_uart0_mask(unsigned int irqno)
454{
455 s3c_irqsub_mask(irqno, INTMSK_UART0, 7);
456}
457
458static void
459s3c_irq_uart0_unmask(unsigned int irqno)
460{
461 s3c_irqsub_unmask(irqno, INTMSK_UART0);
462}
463
464static void
465s3c_irq_uart0_ack(unsigned int irqno)
466{
467 s3c_irqsub_maskack(irqno, INTMSK_UART0, 7);
468}
469
470static struct irqchip s3c_irq_uart0 = {
471 .mask = s3c_irq_uart0_mask,
472 .unmask = s3c_irq_uart0_unmask,
473 .ack = s3c_irq_uart0_ack,
474};
475
476/* UART1 */
477
478static void
479s3c_irq_uart1_mask(unsigned int irqno)
480{
481 s3c_irqsub_mask(irqno, INTMSK_UART1, 7 << 3);
482}
483
484static void
485s3c_irq_uart1_unmask(unsigned int irqno)
486{
487 s3c_irqsub_unmask(irqno, INTMSK_UART1);
488}
489
490static void
491s3c_irq_uart1_ack(unsigned int irqno)
492{
493 s3c_irqsub_maskack(irqno, INTMSK_UART1, 7 << 3);
494}
495
496static struct irqchip s3c_irq_uart1 = {
497 .mask = s3c_irq_uart1_mask,
498 .unmask = s3c_irq_uart1_unmask,
499 .ack = s3c_irq_uart1_ack,
500};
501
502/* UART2 */
503
504static void
505s3c_irq_uart2_mask(unsigned int irqno)
506{
507 s3c_irqsub_mask(irqno, INTMSK_UART2, 7 << 6);
508}
509
510static void
511s3c_irq_uart2_unmask(unsigned int irqno)
512{
513 s3c_irqsub_unmask(irqno, INTMSK_UART2);
514}
515
516static void
517s3c_irq_uart2_ack(unsigned int irqno)
518{
519 s3c_irqsub_maskack(irqno, INTMSK_UART2, 7 << 6);
520}
521
522static struct irqchip s3c_irq_uart2 = {
523 .mask = s3c_irq_uart2_mask,
524 .unmask = s3c_irq_uart2_unmask,
525 .ack = s3c_irq_uart2_ack,
526};
527
528/* ADC and Touchscreen */
529
530static void
531s3c_irq_adc_mask(unsigned int irqno)
532{
533 s3c_irqsub_mask(irqno, INTMSK_ADCPARENT, 3 << 9);
534}
535
536static void
537s3c_irq_adc_unmask(unsigned int irqno)
538{
539 s3c_irqsub_unmask(irqno, INTMSK_ADCPARENT);
540}
541
542static void
543s3c_irq_adc_ack(unsigned int irqno)
544{
545 s3c_irqsub_ack(irqno, INTMSK_ADCPARENT, 3 << 9);
546}
547
548static struct irqchip s3c_irq_adc = {
549 .mask = s3c_irq_adc_mask,
550 .unmask = s3c_irq_adc_unmask,
551 .ack = s3c_irq_adc_ack,
552};
553
554/* irq demux for adc */
555static void s3c_irq_demux_adc(unsigned int irq,
556 struct irqdesc *desc,
557 struct pt_regs *regs)
558{
559 unsigned int subsrc, submsk;
560 unsigned int offset = 9;
561 struct irqdesc *mydesc;
562
563 /* read the current pending interrupts, and the mask
564 * for what it is available */
565
566 subsrc = __raw_readl(S3C2410_SUBSRCPND);
567 submsk = __raw_readl(S3C2410_INTSUBMSK);
568
569 subsrc &= ~submsk;
570 subsrc >>= offset;
571 subsrc &= 3;
572
573 if (subsrc != 0) {
574 if (subsrc & 1) {
575 mydesc = irq_desc + IRQ_TC;
576 mydesc->handle( IRQ_TC, mydesc, regs);
577 }
578 if (subsrc & 2) {
579 mydesc = irq_desc + IRQ_ADC;
580 mydesc->handle(IRQ_ADC, mydesc, regs);
581 }
582 }
583}
584
585static void s3c_irq_demux_uart(unsigned int start,
586 struct pt_regs *regs)
587{
588 unsigned int subsrc, submsk;
589 unsigned int offset = start - IRQ_S3CUART_RX0;
590 struct irqdesc *desc;
591
592 /* read the current pending interrupts, and the mask
593 * for what it is available */
594
595 subsrc = __raw_readl(S3C2410_SUBSRCPND);
596 submsk = __raw_readl(S3C2410_INTSUBMSK);
597
598 irqdbf2("s3c_irq_demux_uart: start=%d (%d), subsrc=0x%08x,0x%08x\n",
599 start, offset, subsrc, submsk);
600
601 subsrc &= ~submsk;
602 subsrc >>= offset;
603 subsrc &= 7;
604
605 if (subsrc != 0) {
606 desc = irq_desc + start;
607
608 if (subsrc & 1)
609 desc->handle(start, desc, regs);
610
611 desc++;
612
613 if (subsrc & 2)
614 desc->handle(start+1, desc, regs);
615
616 desc++;
617
618 if (subsrc & 4)
619 desc->handle(start+2, desc, regs);
620 }
621}
622
623/* uart demux entry points */
624
625static void
626s3c_irq_demux_uart0(unsigned int irq,
627 struct irqdesc *desc,
628 struct pt_regs *regs)
629{
630 irq = irq;
631 s3c_irq_demux_uart(IRQ_S3CUART_RX0, regs);
632}
633
634static void
635s3c_irq_demux_uart1(unsigned int irq,
636 struct irqdesc *desc,
637 struct pt_regs *regs)
638{
639 irq = irq;
640 s3c_irq_demux_uart(IRQ_S3CUART_RX1, regs);
641}
642
643static void
644s3c_irq_demux_uart2(unsigned int irq,
645 struct irqdesc *desc,
646 struct pt_regs *regs)
647{
648 irq = irq;
649 s3c_irq_demux_uart(IRQ_S3CUART_RX2, regs);
650}
651
652
653/* s3c24xx_init_irq
654 *
655 * Initialise S3C2410 IRQ system
656*/
657
658void __init s3c24xx_init_irq(void)
659{
660 unsigned long pend;
661 unsigned long last;
662 int irqno;
663 int i;
664
665 irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");
666
667 /* first, clear all interrupts pending... */
668
669 last = 0;
670 for (i = 0; i < 4; i++) {
671 pend = __raw_readl(S3C2410_EINTPEND);
672
673 if (pend == 0 || pend == last)
674 break;
675
676 __raw_writel(pend, S3C2410_EINTPEND);
677 printk("irq: clearing pending ext status %08x\n", (int)pend);
678 last = pend;
679 }
680
681 last = 0;
682 for (i = 0; i < 4; i++) {
683 pend = __raw_readl(S3C2410_INTPND);
684
685 if (pend == 0 || pend == last)
686 break;
687
688 __raw_writel(pend, S3C2410_SRCPND);
689 __raw_writel(pend, S3C2410_INTPND);
690 printk("irq: clearing pending status %08x\n", (int)pend);
691 last = pend;
692 }
693
694 last = 0;
695 for (i = 0; i < 4; i++) {
696 pend = __raw_readl(S3C2410_SUBSRCPND);
697
698 if (pend == 0 || pend == last)
699 break;
700
701 printk("irq: clearing subpending status %08x\n", (int)pend);
702 __raw_writel(pend, S3C2410_SUBSRCPND);
703 last = pend;
704 }
705
706 /* register the main interrupts */
707
708 irqdbf("s3c2410_init_irq: registering s3c2410 interrupt handlers\n");
709
710 for (irqno = IRQ_BATT_FLT; irqno <= IRQ_ADCPARENT; irqno++) {
711 /* set all the s3c2410 internal irqs */
712
713 switch (irqno) {
714 /* deal with the special IRQs (cascaded) */
715
716 case IRQ_UART0:
717 case IRQ_UART1:
718 case IRQ_UART2:
719 case IRQ_LCD:
720 case IRQ_ADCPARENT:
721 set_irq_chip(irqno, &s3c_irq_level_chip);
722 set_irq_handler(irqno, do_level_IRQ);
723 break;
724
725 case IRQ_RESERVED6:
726 case IRQ_RESERVED24:
727 /* no IRQ here */
728 break;
729
730 default:
731 //irqdbf("registering irq %d (s3c irq)\n", irqno);
732 set_irq_chip(irqno, &s3c_irq_chip);
733 set_irq_handler(irqno, do_edge_IRQ);
734 set_irq_flags(irqno, IRQF_VALID);
735 }
736 }
737
738 /* setup the cascade irq handlers */
739
740 set_irq_chained_handler(IRQ_UART0, s3c_irq_demux_uart0);
741 set_irq_chained_handler(IRQ_UART1, s3c_irq_demux_uart1);
742 set_irq_chained_handler(IRQ_UART2, s3c_irq_demux_uart2);
743 set_irq_chained_handler(IRQ_ADCPARENT, s3c_irq_demux_adc);
744
745
746 /* external interrupts */
747
748 for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) {
749 irqdbf("registering irq %d (ext int)\n", irqno);
750 set_irq_chip(irqno, &s3c_irq_eint0t4);
751 set_irq_handler(irqno, do_edge_IRQ);
752 set_irq_flags(irqno, IRQF_VALID);
753 }
754
755 for (irqno = IRQ_EINT4; irqno <= IRQ_EINT23; irqno++) {
756 irqdbf("registering irq %d (extended s3c irq)\n", irqno);
757 set_irq_chip(irqno, &s3c_irqext_chip);
758 set_irq_handler(irqno, do_edge_IRQ);
759 set_irq_flags(irqno, IRQF_VALID);
760 }
761
762 /* register the uart interrupts */
763
764 irqdbf("s3c2410: registering external interrupts\n");
765
766 for (irqno = IRQ_S3CUART_RX0; irqno <= IRQ_S3CUART_ERR0; irqno++) {
767 irqdbf("registering irq %d (s3c uart0 irq)\n", irqno);
768 set_irq_chip(irqno, &s3c_irq_uart0);
769 set_irq_handler(irqno, do_level_IRQ);
770 set_irq_flags(irqno, IRQF_VALID);
771 }
772
773 for (irqno = IRQ_S3CUART_RX1; irqno <= IRQ_S3CUART_ERR1; irqno++) {
774 irqdbf("registering irq %d (s3c uart1 irq)\n", irqno);
775 set_irq_chip(irqno, &s3c_irq_uart1);
776 set_irq_handler(irqno, do_level_IRQ);
777 set_irq_flags(irqno, IRQF_VALID);
778 }
779
780 for (irqno = IRQ_S3CUART_RX2; irqno <= IRQ_S3CUART_ERR2; irqno++) {
781 irqdbf("registering irq %d (s3c uart2 irq)\n", irqno);
782 set_irq_chip(irqno, &s3c_irq_uart2);
783 set_irq_handler(irqno, do_level_IRQ);
784 set_irq_flags(irqno, IRQF_VALID);
785 }
786
787 for (irqno = IRQ_TC; irqno <= IRQ_ADC; irqno++) {
788 irqdbf("registering irq %d (s3c adc irq)\n", irqno);
789 set_irq_chip(irqno, &s3c_irq_adc);
790 set_irq_handler(irqno, do_edge_IRQ);
791 set_irq_flags(irqno, IRQF_VALID);
792 }
793
794 irqdbf("s3c2410: registered interrupt handlers\n");
795}
796
797/* s3c2440 irq code
798*/
799
800#ifdef CONFIG_CPU_S3C2440
801
802/* WDT/AC97 */
803
804static void s3c_irq_demux_wdtac97(unsigned int irq,
805 struct irqdesc *desc,
806 struct pt_regs *regs)
807{
808 unsigned int subsrc, submsk;
809 struct irqdesc *mydesc;
810
811 /* read the current pending interrupts, and the mask
812 * for what it is available */
813
814 subsrc = __raw_readl(S3C2410_SUBSRCPND);
815 submsk = __raw_readl(S3C2410_INTSUBMSK);
816
817 subsrc &= ~submsk;
818 subsrc >>= 13;
819 subsrc &= 3;
820
821 if (subsrc != 0) {
822 if (subsrc & 1) {
823 mydesc = irq_desc + IRQ_S3C2440_WDT;
824 mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
825 }
826 if (subsrc & 2) {
827 mydesc = irq_desc + IRQ_S3C2440_AC97;
828 mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
829 }
830 }
831}
832
833
834#define INTMSK_WDT (1UL << (IRQ_WDT - IRQ_EINT0))
835
836static void
837s3c_irq_wdtac97_mask(unsigned int irqno)
838{
839 s3c_irqsub_mask(irqno, INTMSK_WDT, 3<<13);
840}
841
842static void
843s3c_irq_wdtac97_unmask(unsigned int irqno)
844{
845 s3c_irqsub_unmask(irqno, INTMSK_WDT);
846}
847
848static void
849s3c_irq_wdtac97_ack(unsigned int irqno)
850{
851 s3c_irqsub_maskack(irqno, INTMSK_WDT, 3<<13);
852}
853
854static struct irqchip s3c_irq_wdtac97 = {
855 .mask = s3c_irq_wdtac97_mask,
856 .unmask = s3c_irq_wdtac97_unmask,
857 .ack = s3c_irq_wdtac97_ack,
858};
859
860/* camera irq */
861
862static void s3c_irq_demux_cam(unsigned int irq,
863 struct irqdesc *desc,
864 struct pt_regs *regs)
865{
866 unsigned int subsrc, submsk;
867 struct irqdesc *mydesc;
868
869 /* read the current pending interrupts, and the mask
870 * for what it is available */
871
872 subsrc = __raw_readl(S3C2410_SUBSRCPND);
873 submsk = __raw_readl(S3C2410_INTSUBMSK);
874
875 subsrc &= ~submsk;
876 subsrc >>= 11;
877 subsrc &= 3;
878
879 if (subsrc != 0) {
880 if (subsrc & 1) {
881 mydesc = irq_desc + IRQ_S3C2440_CAM_C;
882 mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
883 }
884 if (subsrc & 2) {
885 mydesc = irq_desc + IRQ_S3C2440_CAM_P;
886 mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
887 }
888 }
889}
890
891#define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0))
892
893static void
894s3c_irq_cam_mask(unsigned int irqno)
895{
896 s3c_irqsub_mask(irqno, INTMSK_CAM, 3<<11);
897}
898
899static void
900s3c_irq_cam_unmask(unsigned int irqno)
901{
902 s3c_irqsub_unmask(irqno, INTMSK_CAM);
903}
904
905static void
906s3c_irq_cam_ack(unsigned int irqno)
907{
908 s3c_irqsub_maskack(irqno, INTMSK_CAM, 3<<11);
909}
910
911static struct irqchip s3c_irq_cam = {
912 .mask = s3c_irq_cam_mask,
913 .unmask = s3c_irq_cam_unmask,
914 .ack = s3c_irq_cam_ack,
915};
916
917static int s3c2440_irq_add(struct sys_device *sysdev)
918{
919 unsigned int irqno;
920
921 printk("S3C2440: IRQ Support\n");
922
923 set_irq_chip(IRQ_NFCON, &s3c_irq_level_chip);
924 set_irq_handler(IRQ_NFCON, do_level_IRQ);
925 set_irq_flags(IRQ_NFCON, IRQF_VALID);
926
927 /* add new chained handler for wdt, ac7 */
928
929 set_irq_chip(IRQ_WDT, &s3c_irq_level_chip);
930 set_irq_handler(IRQ_WDT, do_level_IRQ);
931 set_irq_chained_handler(IRQ_WDT, s3c_irq_demux_wdtac97);
932
933 for (irqno = IRQ_S3C2440_WDT; irqno <= IRQ_S3C2440_AC97; irqno++) {
934 set_irq_chip(irqno, &s3c_irq_wdtac97);
935 set_irq_handler(irqno, do_level_IRQ);
936 set_irq_flags(irqno, IRQF_VALID);
937 }
938
939 /* add chained handler for camera */
940
941 set_irq_chip(IRQ_CAM, &s3c_irq_level_chip);
942 set_irq_handler(IRQ_CAM, do_level_IRQ);
943 set_irq_chained_handler(IRQ_CAM, s3c_irq_demux_cam);
944
945 for (irqno = IRQ_S3C2440_CAM_C; irqno <= IRQ_S3C2440_CAM_P; irqno++) {
946 set_irq_chip(irqno, &s3c_irq_cam);
947 set_irq_handler(irqno, do_level_IRQ);
948 set_irq_flags(irqno, IRQF_VALID);
949 }
950
951 return 0;
952}
953
954static struct sysdev_driver s3c2440_irq_driver = {
955 .add = s3c2440_irq_add,
956};
957
958static int s3c24xx_irq_driver(void)
959{
960 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver);
961}
962
963arch_initcall(s3c24xx_irq_driver);
964
965#endif /* CONFIG_CPU_S3C2440 */
966
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
new file mode 100644
index 000000000000..3bb97eb6e693
--- /dev/null
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -0,0 +1,409 @@
1/* linux/arch/arm/mach-s3c2410/mach-bast.c
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13 * 14-Sep-2004 BJD USB power control
14 * 20-Aug-2004 BJD Added s3c2410_board struct
15 * 18-Aug-2004 BJD Added platform devices from default set
16 * 16-May-2003 BJD Created initial version
17 * 16-Aug-2003 BJD Fixed header files and copyright, added URL
18 * 05-Sep-2003 BJD Moved to v2.6 kernel
19 * 06-Jan-2003 BJD Updates for <arch/map.h>
20 * 18-Jan-2003 BJD Added serial port configuration
21 * 05-Oct-2004 BJD Power management code
22 * 04-Nov-2004 BJD Updated serial port clocks
23 * 04-Jan-2005 BJD New uart init call
24 * 10-Jan-2005 BJD Removed include of s3c2410.h
25 * 14-Jan-2005 BJD Add support for muitlple NAND devices
26 * 03-Mar-2005 BJD Ensured that bast-cpld.h is included
27 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
28 * 14-Mar-2006 BJD Updated for __iomem changes
29*/
30
31#include <linux/kernel.h>
32#include <linux/types.h>
33#include <linux/interrupt.h>
34#include <linux/list.h>
35#include <linux/timer.h>
36#include <linux/init.h>
37#include <linux/device.h>
38
39#include <asm/mach/arch.h>
40#include <asm/mach/map.h>
41#include <asm/mach/irq.h>
42
43#include <asm/arch/bast-map.h>
44#include <asm/arch/bast-irq.h>
45#include <asm/arch/bast-cpld.h>
46
47#include <asm/hardware.h>
48#include <asm/io.h>
49#include <asm/irq.h>
50#include <asm/mach-types.h>
51
52//#include <asm/debug-ll.h>
53#include <asm/arch/regs-serial.h>
54#include <asm/arch/regs-gpio.h>
55#include <asm/arch/regs-mem.h>
56#include <asm/arch/nand.h>
57
58#include <linux/mtd/mtd.h>
59#include <linux/mtd/nand.h>
60#include <linux/mtd/nand_ecc.h>
61#include <linux/mtd/partitions.h>
62
63#include "clock.h"
64#include "devs.h"
65#include "cpu.h"
66#include "usb-simtec.h"
67#include "pm.h"
68
69#define COPYRIGHT ", (c) 2004-2005 Simtec Electronics"
70
71/* macros for virtual address mods for the io space entries */
72#define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5)
73#define VA_C4(item) ((unsigned long)(item) + BAST_VAM_CS4)
74#define VA_C3(item) ((unsigned long)(item) + BAST_VAM_CS3)
75#define VA_C2(item) ((unsigned long)(item) + BAST_VAM_CS2)
76
77/* macros to modify the physical addresses for io space */
78
79#define PA_CS2(item) ((item) + S3C2410_CS2)
80#define PA_CS3(item) ((item) + S3C2410_CS3)
81#define PA_CS4(item) ((item) + S3C2410_CS4)
82#define PA_CS5(item) ((item) + S3C2410_CS5)
83
84static struct map_desc bast_iodesc[] __initdata = {
85 /* ISA IO areas */
86
87 { (u32)S3C24XX_VA_ISA_BYTE, PA_CS2(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
88 { (u32)S3C24XX_VA_ISA_WORD, PA_CS3(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
89
90 /* we could possibly compress the next set down into a set of smaller tables
91 * pagetables, but that would mean using an L2 section, and it still means
92 * we cannot actually feed the same register to an LDR due to 16K spacing
93 */
94
95 /* bast CPLD control registers, and external interrupt controls */
96 { (u32)BAST_VA_CTRL1, BAST_PA_CTRL1, SZ_1M, MT_DEVICE },
97 { (u32)BAST_VA_CTRL2, BAST_PA_CTRL2, SZ_1M, MT_DEVICE },
98 { (u32)BAST_VA_CTRL3, BAST_PA_CTRL3, SZ_1M, MT_DEVICE },
99 { (u32)BAST_VA_CTRL4, BAST_PA_CTRL4, SZ_1M, MT_DEVICE },
100
101 /* PC104 IRQ mux */
102 { (u32)BAST_VA_PC104_IRQREQ, BAST_PA_PC104_IRQREQ, SZ_1M, MT_DEVICE },
103 { (u32)BAST_VA_PC104_IRQRAW, BAST_PA_PC104_IRQRAW, SZ_1M, MT_DEVICE },
104 { (u32)BAST_VA_PC104_IRQMASK, BAST_PA_PC104_IRQMASK, SZ_1M, MT_DEVICE },
105
106 /* peripheral space... one for each of fast/slow/byte/16bit */
107 /* note, ide is only decoded in word space, even though some registers
108 * are only 8bit */
109
110 /* slow, byte */
111 { VA_C2(BAST_VA_ISAIO), PA_CS2(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
112 { VA_C2(BAST_VA_ISAMEM), PA_CS2(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
113 { VA_C2(BAST_VA_ASIXNET), PA_CS3(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
114 { VA_C2(BAST_VA_SUPERIO), PA_CS2(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
115 { VA_C2(BAST_VA_DM9000), PA_CS2(BAST_PA_DM9000), SZ_1M, MT_DEVICE },
116 { VA_C2(BAST_VA_IDEPRI), PA_CS3(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE },
117 { VA_C2(BAST_VA_IDESEC), PA_CS3(BAST_PA_IDESEC), SZ_1M, MT_DEVICE },
118 { VA_C2(BAST_VA_IDEPRIAUX), PA_CS3(BAST_PA_IDEPRIAUX), SZ_1M, MT_DEVICE },
119 { VA_C2(BAST_VA_IDESECAUX), PA_CS3(BAST_PA_IDESECAUX), SZ_1M, MT_DEVICE },
120
121 /* slow, word */
122 { VA_C3(BAST_VA_ISAIO), PA_CS3(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
123 { VA_C3(BAST_VA_ISAMEM), PA_CS3(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
124 { VA_C3(BAST_VA_ASIXNET), PA_CS3(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
125 { VA_C3(BAST_VA_SUPERIO), PA_CS3(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
126 { VA_C3(BAST_VA_DM9000), PA_CS3(BAST_PA_DM9000), SZ_1M, MT_DEVICE },
127 { VA_C3(BAST_VA_IDEPRI), PA_CS3(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE },
128 { VA_C3(BAST_VA_IDESEC), PA_CS3(BAST_PA_IDESEC), SZ_1M, MT_DEVICE },
129 { VA_C3(BAST_VA_IDEPRIAUX), PA_CS3(BAST_PA_IDEPRIAUX), SZ_1M, MT_DEVICE },
130 { VA_C3(BAST_VA_IDESECAUX), PA_CS3(BAST_PA_IDESECAUX), SZ_1M, MT_DEVICE },
131
132 /* fast, byte */
133 { VA_C4(BAST_VA_ISAIO), PA_CS4(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
134 { VA_C4(BAST_VA_ISAMEM), PA_CS4(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
135 { VA_C4(BAST_VA_ASIXNET), PA_CS5(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
136 { VA_C4(BAST_VA_SUPERIO), PA_CS4(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
137 { VA_C4(BAST_VA_DM9000), PA_CS4(BAST_PA_DM9000), SZ_1M, MT_DEVICE },
138 { VA_C4(BAST_VA_IDEPRI), PA_CS5(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE },
139 { VA_C4(BAST_VA_IDESEC), PA_CS5(BAST_PA_IDESEC), SZ_1M, MT_DEVICE },
140 { VA_C4(BAST_VA_IDEPRIAUX), PA_CS5(BAST_PA_IDEPRIAUX), SZ_1M, MT_DEVICE },
141 { VA_C4(BAST_VA_IDESECAUX), PA_CS5(BAST_PA_IDESECAUX), SZ_1M, MT_DEVICE },
142
143 /* fast, word */
144 { VA_C5(BAST_VA_ISAIO), PA_CS5(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
145 { VA_C5(BAST_VA_ISAMEM), PA_CS5(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
146 { VA_C5(BAST_VA_ASIXNET), PA_CS5(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
147 { VA_C5(BAST_VA_SUPERIO), PA_CS5(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
148 { VA_C5(BAST_VA_DM9000), PA_CS5(BAST_PA_DM9000), SZ_1M, MT_DEVICE },
149 { VA_C5(BAST_VA_IDEPRI), PA_CS5(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE },
150 { VA_C5(BAST_VA_IDESEC), PA_CS5(BAST_PA_IDESEC), SZ_1M, MT_DEVICE },
151 { VA_C5(BAST_VA_IDEPRIAUX), PA_CS5(BAST_PA_IDEPRIAUX), SZ_1M, MT_DEVICE },
152 { VA_C5(BAST_VA_IDESECAUX), PA_CS5(BAST_PA_IDESECAUX), SZ_1M, MT_DEVICE },
153};
154
155#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
156#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
157#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
158
159static struct s3c24xx_uart_clksrc bast_serial_clocks[] = {
160 [0] = {
161 .name = "uclk",
162 .divisor = 1,
163 .min_baud = 0,
164 .max_baud = 0,
165 },
166 [1] = {
167 .name = "pclk",
168 .divisor = 1,
169 .min_baud = 0,
170 .max_baud = 0.
171 }
172};
173
174
175static struct s3c2410_uartcfg bast_uartcfgs[] = {
176 [0] = {
177 .hwport = 0,
178 .flags = 0,
179 .ucon = UCON,
180 .ulcon = ULCON,
181 .ufcon = UFCON,
182 .clocks = bast_serial_clocks,
183 .clocks_size = ARRAY_SIZE(bast_serial_clocks)
184 },
185 [1] = {
186 .hwport = 1,
187 .flags = 0,
188 .ucon = UCON,
189 .ulcon = ULCON,
190 .ufcon = UFCON,
191 .clocks = bast_serial_clocks,
192 .clocks_size = ARRAY_SIZE(bast_serial_clocks)
193 },
194 /* port 2 is not actually used */
195 [2] = {
196 .hwport = 2,
197 .flags = 0,
198 .ucon = UCON,
199 .ulcon = ULCON,
200 .ufcon = UFCON,
201 .clocks = bast_serial_clocks,
202 .clocks_size = ARRAY_SIZE(bast_serial_clocks)
203 }
204};
205
206/* NOR Flash on BAST board */
207
208static struct resource bast_nor_resource[] = {
209 [0] = {
210 .start = S3C2410_CS1 + 0x4000000,
211 .end = S3C2410_CS1 + 0x4000000 + (32*1024*1024) - 1,
212 .flags = IORESOURCE_MEM,
213 }
214};
215
216static struct platform_device bast_device_nor = {
217 .name = "bast-nor",
218 .id = -1,
219 .num_resources = ARRAY_SIZE(bast_nor_resource),
220 .resource = bast_nor_resource,
221};
222
223/* NAND Flash on BAST board */
224
225
226static int smartmedia_map[] = { 0 };
227static int chip0_map[] = { 1 };
228static int chip1_map[] = { 2 };
229static int chip2_map[] = { 3 };
230
231struct mtd_partition bast_default_nand_part[] = {
232 [0] = {
233 .name = "Boot Agent",
234 .size = SZ_16K,
235 .offset = 0
236 },
237 [1] = {
238 .name = "/boot",
239 .size = SZ_4M - SZ_16K,
240 .offset = SZ_16K,
241 },
242 [2] = {
243 .name = "user",
244 .offset = SZ_4M,
245 .size = MTDPART_SIZ_FULL,
246 }
247};
248
249/* the bast has 4 selectable slots for nand-flash, the three
250 * on-board chip areas, as well as the external SmartMedia
251 * slot.
252 *
253 * Note, there is no current hot-plug support for the SmartMedia
254 * socket.
255*/
256
257static struct s3c2410_nand_set bast_nand_sets[] = {
258 [0] = {
259 .name = "SmartMedia",
260 .nr_chips = 1,
261 .nr_map = smartmedia_map,
262 .nr_partitions = ARRAY_SIZE(bast_default_nand_part),
263 .partitions = bast_default_nand_part
264 },
265 [1] = {
266 .name = "chip0",
267 .nr_chips = 1,
268 .nr_map = chip0_map,
269 .nr_partitions = ARRAY_SIZE(bast_default_nand_part),
270 .partitions = bast_default_nand_part
271 },
272 [2] = {
273 .name = "chip1",
274 .nr_chips = 1,
275 .nr_map = chip1_map,
276 .nr_partitions = ARRAY_SIZE(bast_default_nand_part),
277 .partitions = bast_default_nand_part
278 },
279 [3] = {
280 .name = "chip2",
281 .nr_chips = 1,
282 .nr_map = chip2_map,
283 .nr_partitions = ARRAY_SIZE(bast_default_nand_part),
284 .partitions = bast_default_nand_part
285 }
286};
287
288static void bast_nand_select(struct s3c2410_nand_set *set, int slot)
289{
290 unsigned int tmp;
291
292 slot = set->nr_map[slot] & 3;
293
294 pr_debug("bast_nand: selecting slot %d (set %p,%p)\n",
295 slot, set, set->nr_map);
296
297 tmp = __raw_readb(BAST_VA_CTRL2);
298 tmp &= BAST_CPLD_CTLR2_IDERST;
299 tmp |= slot;
300 tmp |= BAST_CPLD_CTRL2_WNAND;
301
302 pr_debug("bast_nand: ctrl2 now %02x\n", tmp);
303
304 __raw_writeb(tmp, BAST_VA_CTRL2);
305}
306
307static struct s3c2410_platform_nand bast_nand_info = {
308 .tacls = 80,
309 .twrph0 = 80,
310 .twrph1 = 80,
311 .nr_sets = ARRAY_SIZE(bast_nand_sets),
312 .sets = bast_nand_sets,
313 .select_chip = bast_nand_select,
314};
315
316
317/* Standard BAST devices */
318
319static struct platform_device *bast_devices[] __initdata = {
320 &s3c_device_usb,
321 &s3c_device_lcd,
322 &s3c_device_wdt,
323 &s3c_device_i2c,
324 &s3c_device_iis,
325 &s3c_device_rtc,
326 &s3c_device_nand,
327 &bast_device_nor
328};
329
330static struct clk *bast_clocks[] = {
331 &s3c24xx_dclk0,
332 &s3c24xx_dclk1,
333 &s3c24xx_clkout0,
334 &s3c24xx_clkout1,
335 &s3c24xx_uclk,
336};
337
338static struct s3c24xx_board bast_board __initdata = {
339 .devices = bast_devices,
340 .devices_count = ARRAY_SIZE(bast_devices),
341 .clocks = bast_clocks,
342 .clocks_count = ARRAY_SIZE(bast_clocks)
343};
344
345void __init bast_map_io(void)
346{
347 /* initialise the clocks */
348
349 s3c24xx_dclk0.parent = NULL;
350 s3c24xx_dclk0.rate = 12*1000*1000;
351
352 s3c24xx_dclk1.parent = NULL;
353 s3c24xx_dclk1.rate = 24*1000*1000;
354
355 s3c24xx_clkout0.parent = &s3c24xx_dclk0;
356 s3c24xx_clkout1.parent = &s3c24xx_dclk1;
357
358 s3c24xx_uclk.parent = &s3c24xx_clkout1;
359
360 s3c_device_nand.dev.platform_data = &bast_nand_info;
361
362 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
363 s3c24xx_init_clocks(0);
364 s3c24xx_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs));
365 s3c24xx_set_board(&bast_board);
366 usb_simtec_init();
367}
368
369void __init bast_init_irq(void)
370{
371 s3c24xx_init_irq();
372}
373
374#ifdef CONFIG_PM
375
376/* bast_init_machine
377 *
378 * enable the power management functions for the EB2410ITX
379*/
380
381static __init void bast_init_machine(void)
382{
383 unsigned long gstatus4;
384
385 printk(KERN_INFO "BAST Power Manangement" COPYRIGHT "\n");
386
387 gstatus4 = (__raw_readl(S3C2410_BANKCON7) & 0x3) << 30;
388 gstatus4 |= (__raw_readl(S3C2410_BANKCON6) & 0x3) << 28;
389 gstatus4 |= (__raw_readl(S3C2410_BANKSIZE) & S3C2410_BANKSIZE_MASK);
390
391 __raw_writel(gstatus4, S3C2410_GSTATUS4);
392
393 s3c2410_pm_init();
394}
395
396#else
397#define bast_init_machine NULL
398#endif
399
400
401MACHINE_START(BAST, "Simtec-BAST")
402 MAINTAINER("Ben Dooks <ben@simtec.co.uk>")
403 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART)
404 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
405 MAPIO(bast_map_io)
406 INITIRQ(bast_init_irq)
407 .init_machine = bast_init_machine,
408 .timer = &s3c24xx_timer,
409MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
new file mode 100644
index 000000000000..2924afc068a4
--- /dev/null
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -0,0 +1,126 @@
1/* linux/arch/arm/mach-s3c2410/mach-h1940.c
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://www.handhelds.org/projects/h1940.html
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13 * 16-May-2003 BJD Created initial version
14 * 16-Aug-2003 BJD Fixed header files and copyright, added URL
15 * 05-Sep-2003 BJD Moved to v2.6 kernel
16 * 06-Jan-2003 BJD Updates for <arch/map.h>
17 * 18-Jan-2003 BJD Added serial port configuration
18 * 17-Feb-2003 BJD Copied to mach-ipaq.c
19 * 21-Aug-2004 BJD Added struct s3c2410_board
20 * 04-Sep-2004 BJD Changed uart init, renamed ipaq_ -> h1940_
21 * 18-Oct-2004 BJD Updated new board structure name
22 * 04-Nov-2004 BJD Change for new serial clock
23 * 04-Jan-2005 BJD Updated uart init call
24 * 10-Jan-2005 BJD Removed include of s3c2410.h
25 * 14-Jan-2005 BJD Added clock init
26 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
27*/
28
29#include <linux/kernel.h>
30#include <linux/types.h>
31#include <linux/interrupt.h>
32#include <linux/list.h>
33#include <linux/timer.h>
34#include <linux/init.h>
35
36#include <asm/mach/arch.h>
37#include <asm/mach/map.h>
38#include <asm/mach/irq.h>
39
40#include <asm/hardware.h>
41#include <asm/hardware/iomd.h>
42#include <asm/io.h>
43#include <asm/irq.h>
44#include <asm/mach-types.h>
45
46//#include <asm/debug-ll.h>
47#include <asm/arch/regs-serial.h>
48
49#include <linux/serial_core.h>
50
51#include "clock.h"
52#include "devs.h"
53#include "cpu.h"
54
55static struct map_desc h1940_iodesc[] __initdata = {
56 /* nothing here yet */
57};
58
59#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
60#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
61#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
62
63static struct s3c2410_uartcfg h1940_uartcfgs[] = {
64 [0] = {
65 .hwport = 0,
66 .flags = 0,
67 .ucon = 0x3c5,
68 .ulcon = 0x03,
69 .ufcon = 0x51,
70 },
71 [1] = {
72 .hwport = 1,
73 .flags = 0,
74 .ucon = 0x245,
75 .ulcon = 0x03,
76 .ufcon = 0x00,
77 },
78 /* IR port */
79 [2] = {
80 .hwport = 2,
81 .flags = 0,
82 .uart_flags = UPF_CONS_FLOW,
83 .ucon = 0x3c5,
84 .ulcon = 0x43,
85 .ufcon = 0x51,
86 }
87};
88
89
90
91
92static struct platform_device *h1940_devices[] __initdata = {
93 &s3c_device_usb,
94 &s3c_device_lcd,
95 &s3c_device_wdt,
96 &s3c_device_i2c,
97 &s3c_device_iis,
98};
99
100static struct s3c24xx_board h1940_board __initdata = {
101 .devices = h1940_devices,
102 .devices_count = ARRAY_SIZE(h1940_devices)
103};
104
105void __init h1940_map_io(void)
106{
107 s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc));
108 s3c24xx_init_clocks(0);
109 s3c24xx_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs));
110 s3c24xx_set_board(&h1940_board);
111}
112
113void __init h1940_init_irq(void)
114{
115 s3c24xx_init_irq();
116
117}
118
119MACHINE_START(H1940, "IPAQ-H1940")
120 MAINTAINER("Ben Dooks <ben@fluff.org>")
121 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART)
122 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
123 MAPIO(h1940_map_io)
124 INITIRQ(h1940_init_irq)
125 .timer = &s3c24xx_timer,
126MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
new file mode 100644
index 000000000000..bd15998c129b
--- /dev/null
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -0,0 +1,155 @@
1/* linux/arch/arm/mach-s3c2410/mach-n30.c
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Copyright (c) 2005 Christer Weinigel <christer@weinigel.se>
7 *
8 * There is a wiki with more information about the n30 port at
9 * http://handhelds.org/moin/moin.cgi/AcerN30Documentation .
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 version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#include <linux/kernel.h>
17#include <linux/types.h>
18#include <linux/interrupt.h>
19#include <linux/list.h>
20#include <linux/timer.h>
21#include <linux/init.h>
22#include <linux/delay.h>
23#include <linux/device.h>
24#include <linux/kthread.h>
25
26#include <asm/mach/arch.h>
27#include <asm/mach/map.h>
28#include <asm/mach/irq.h>
29
30#include <asm/hardware.h>
31#include <asm/hardware/iomd.h>
32#include <asm/io.h>
33#include <asm/irq.h>
34#include <asm/mach-types.h>
35
36#include <asm/arch/regs-serial.h>
37#include <asm/arch/regs-gpio.h>
38#include <asm/arch/iic.h>
39
40#include <linux/serial_core.h>
41
42#include "s3c2410.h"
43#include "clock.h"
44#include "devs.h"
45#include "cpu.h"
46
47static struct map_desc n30_iodesc[] __initdata = {
48 /* nothing here yet */
49};
50
51static struct s3c2410_uartcfg n30_uartcfgs[] = {
52 /* Normal serial port */
53 [0] = {
54 .hwport = 0,
55 .flags = 0,
56 .ucon = 0x2c5,
57 .ulcon = 0x03,
58 .ufcon = 0x51,
59 },
60 /* IR port */
61 [1] = {
62 .hwport = 1,
63 .flags = 0,
64 .uart_flags = UPF_CONS_FLOW,
65 .ucon = 0x2c5,
66 .ulcon = 0x43,
67 .ufcon = 0x51,
68 },
69 /* The BlueTooth controller is connected to port 2 */
70 [2] = {
71 .hwport = 2,
72 .flags = 0,
73 .ucon = 0x2c5,
74 .ulcon = 0x03,
75 .ufcon = 0x51,
76 },
77};
78
79static struct platform_device *n30_devices[] __initdata = {
80 &s3c_device_usb,
81 &s3c_device_lcd,
82 &s3c_device_wdt,
83 &s3c_device_i2c,
84 &s3c_device_iis,
85 &s3c_device_usbgadget,
86};
87
88static struct s3c2410_platform_i2c n30_i2ccfg = {
89 .flags = 0,
90 .slave_addr = 0x10,
91 .bus_freq = 10*1000,
92 .max_freq = 10*1000,
93};
94
95static struct s3c24xx_board n30_board __initdata = {
96 .devices = n30_devices,
97 .devices_count = ARRAY_SIZE(n30_devices)
98};
99
100void __init n30_map_io(void)
101{
102 s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc));
103 s3c24xx_init_clocks(0);
104 s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs));
105 s3c24xx_set_board(&n30_board);
106}
107
108void __init n30_init_irq(void)
109{
110 s3c24xx_init_irq();
111}
112
113
114static int n30_usbstart_thread(void *unused)
115{
116 /* Turn off suspend on both USB ports, and switch the
117 * selectable USB port to USB device mode. */
118 writel(readl(S3C2410_MISCCR) & ~0x00003008, S3C2410_MISCCR);
119
120 /* Turn off the D+ pull up for 3 seconds so that the USB host
121 * at the other end will do a rescan of the USB bus. */
122 s3c2410_gpio_setpin(S3C2410_GPB3, 0);
123
124 msleep_interruptible(3*HZ);
125
126 s3c2410_gpio_setpin(S3C2410_GPB3, 1);
127
128 return 0;
129}
130
131
132void __init n30_init(void)
133{
134 s3c_device_i2c.dev.platform_data = &n30_i2ccfg;
135
136 kthread_run(n30_usbstart_thread, NULL, "n30_usbstart");
137}
138
139MACHINE_START(N30, "Acer-N30")
140 MAINTAINER("Christer Weinigel <christer@weinigel.se>, Ben Dooks <ben-linux@fluff.org>")
141 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART)
142 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
143
144 .timer = &s3c24xx_timer,
145 .init_machine = n30_init,
146 .init_irq = n30_init_irq,
147 .map_io = n30_map_io,
148MACHINE_END
149
150/*
151 Local variables:
152 compile-command: "make ARCH=arm CROSS_COMPILE=/usr/local/arm/3.3.2/bin/arm-linux- -k -C ../../.."
153 c-basic-offset: 8
154 End:
155*/
diff --git a/arch/arm/mach-s3c2410/mach-nexcoder.c b/arch/arm/mach-s3c2410/mach-nexcoder.c
new file mode 100644
index 000000000000..70487bf4b71e
--- /dev/null
+++ b/arch/arm/mach-s3c2410/mach-nexcoder.c
@@ -0,0 +1,156 @@
1/* linux/arch/arm/mach-s3c2410/mach-nexcoder.c
2 *
3 * Copyright (c) 2004 Nex Vision
4 * Guillaume GOURAT <guillaume.gourat@nexvision.tv>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Modifications:
11 * 15-10-2004 GG Created initial version
12 * 12-03-2005 BJD Updated for release
13 */
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/interrupt.h>
18#include <linux/list.h>
19#include <linux/timer.h>
20#include <linux/init.h>
21#include <linux/string.h>
22#include <linux/device.h>
23
24#include <linux/mtd/map.h>
25
26#include <asm/mach/arch.h>
27#include <asm/mach/map.h>
28#include <asm/mach/irq.h>
29
30#include <asm/setup.h>
31#include <asm/hardware.h>
32#include <asm/io.h>
33#include <asm/irq.h>
34#include <asm/mach-types.h>
35
36//#include <asm/debug-ll.h>
37#include <asm/arch/regs-gpio.h>
38#include <asm/arch/regs-serial.h>
39
40#include "s3c2410.h"
41#include "s3c2440.h"
42#include "clock.h"
43#include "devs.h"
44#include "cpu.h"
45
46static struct map_desc nexcoder_iodesc[] __initdata = {
47 /* nothing here yet */
48};
49
50#define UCON S3C2410_UCON_DEFAULT
51#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
52#define UFCON S3C2410_UFCON_RXTRIG12 | S3C2410_UFCON_FIFOMODE
53
54static struct s3c2410_uartcfg nexcoder_uartcfgs[] = {
55 [0] = {
56 .hwport = 0,
57 .flags = 0,
58 .ucon = UCON,
59 .ulcon = ULCON,
60 .ufcon = UFCON,
61 },
62 [1] = {
63 .hwport = 1,
64 .flags = 0,
65 .ucon = UCON,
66 .ulcon = ULCON,
67 .ufcon = UFCON,
68 },
69 [2] = {
70 .hwport = 2,
71 .flags = 0,
72 .ucon = UCON,
73 .ulcon = ULCON,
74 .ufcon = UFCON,
75 }
76};
77
78/* NOR Flash on NexVision NexCoder 2440 board */
79
80static struct resource nexcoder_nor_resource[] = {
81 [0] = {
82 .start = S3C2410_CS0,
83 .end = S3C2410_CS0 + (8*1024*1024) - 1,
84 .flags = IORESOURCE_MEM,
85 }
86};
87
88static struct map_info nexcoder_nor_map = {
89 .bankwidth = 2,
90};
91
92static struct platform_device nexcoder_device_nor = {
93 .name = "mtd-flash",
94 .id = -1,
95 .num_resources = ARRAY_SIZE(nexcoder_nor_resource),
96 .resource = nexcoder_nor_resource,
97 .dev =
98 {
99 .platform_data = &nexcoder_nor_map,
100 }
101};
102
103/* Standard Nexcoder devices */
104
105static struct platform_device *nexcoder_devices[] __initdata = {
106 &s3c_device_usb,
107 &s3c_device_lcd,
108 &s3c_device_wdt,
109 &s3c_device_i2c,
110 &s3c_device_iis,
111 &s3c_device_rtc,
112 &s3c_device_camif,
113 &s3c_device_spi0,
114 &s3c_device_spi1,
115 &nexcoder_device_nor,
116};
117
118static struct s3c24xx_board nexcoder_board __initdata = {
119 .devices = nexcoder_devices,
120 .devices_count = ARRAY_SIZE(nexcoder_devices),
121};
122
123
124static void __init nexcoder_sensorboard_init(void)
125{
126 // Initialize SCCB bus
127 s3c2410_gpio_setpin(S3C2410_GPE14, 1); // IICSCL
128 s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_OUTP);
129 s3c2410_gpio_setpin(S3C2410_GPE15, 1); // IICSDA
130 s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_OUTP);
131
132 // Power up the sensor board
133 s3c2410_gpio_setpin(S3C2410_GPF1, 1);
134 s3c2410_gpio_cfgpin(S3C2410_GPF1, S3C2410_GPF1_OUTP); // CAM_GPIO7 => nLDO_PWRDN
135 s3c2410_gpio_setpin(S3C2410_GPF2, 0);
136 s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); // CAM_GPIO6 => CAM_PWRDN
137}
138
139void __init nexcoder_map_io(void)
140{
141 s3c24xx_init_io(nexcoder_iodesc, ARRAY_SIZE(nexcoder_iodesc));
142 s3c24xx_init_clocks(0);
143 s3c24xx_init_uarts(nexcoder_uartcfgs, ARRAY_SIZE(nexcoder_uartcfgs));
144 s3c24xx_set_board(&nexcoder_board);
145 nexcoder_sensorboard_init();
146}
147
148
149MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
150 MAINTAINER("Guillaume GOURAT <guillaume.gourat@nexvision.tv>")
151 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART)
152 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
153 .map_io = nexcoder_map_io,
154 .init_irq = s3c24xx_init_irq,
155 .timer = &s3c24xx_timer,
156MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-otom.c b/arch/arm/mach-s3c2410/mach-otom.c
new file mode 100644
index 000000000000..67d8ce8fb00f
--- /dev/null
+++ b/arch/arm/mach-s3c2410/mach-otom.c
@@ -0,0 +1,124 @@
1/* linux/arch/arm/mach-s3c2410/mach-otom.c
2 *
3 * Copyright (c) 2004 Nex Vision
4 * Guillaume GOURAT <guillaume.gourat@nexvision.fr>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/init.h>
18#include <linux/device.h>
19
20#include <asm/mach/arch.h>
21#include <asm/mach/map.h>
22#include <asm/mach/irq.h>
23
24#include <asm/arch/otom-map.h>
25
26#include <asm/hardware.h>
27#include <asm/io.h>
28#include <asm/irq.h>
29#include <asm/mach-types.h>
30
31#include <asm/arch/regs-serial.h>
32#include <asm/arch/regs-gpio.h>
33
34#include "s3c2410.h"
35#include "clock.h"
36#include "devs.h"
37#include "cpu.h"
38
39static struct map_desc otom11_iodesc[] __initdata = {
40 /* Device area */
41 { (u32)OTOM_VA_CS8900A_BASE, OTOM_PA_CS8900A_BASE, SZ_16M, MT_DEVICE },
42};
43
44#define UCON S3C2410_UCON_DEFAULT
45#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
46#define UFCON S3C2410_UFCON_RXTRIG12 | S3C2410_UFCON_FIFOMODE
47
48static struct s3c2410_uartcfg otom11_uartcfgs[] = {
49 [0] = {
50 .hwport = 0,
51 .flags = 0,
52 .ucon = UCON,
53 .ulcon = ULCON,
54 .ufcon = UFCON,
55 },
56 [1] = {
57 .hwport = 1,
58 .flags = 0,
59 .ucon = UCON,
60 .ulcon = ULCON,
61 .ufcon = UFCON,
62 },
63 /* port 2 is not actually used */
64 [2] = {
65 .hwport = 2,
66 .flags = 0,
67 .ucon = UCON,
68 .ulcon = ULCON,
69 .ufcon = UFCON,
70 }
71};
72
73/* NOR Flash on NexVision OTOM board */
74
75static struct resource otom_nor_resource[] = {
76 [0] = {
77 .start = S3C2410_CS0,
78 .end = S3C2410_CS0 + (4*1024*1024) - 1,
79 .flags = IORESOURCE_MEM,
80 }
81};
82
83static struct platform_device otom_device_nor = {
84 .name = "mtd-flash",
85 .id = -1,
86 .num_resources = ARRAY_SIZE(otom_nor_resource),
87 .resource = otom_nor_resource,
88};
89
90/* Standard OTOM devices */
91
92static struct platform_device *otom11_devices[] __initdata = {
93 &s3c_device_usb,
94 &s3c_device_lcd,
95 &s3c_device_wdt,
96 &s3c_device_i2c,
97 &s3c_device_iis,
98 &s3c_device_rtc,
99 &otom_device_nor,
100};
101
102static struct s3c24xx_board otom11_board __initdata = {
103 .devices = otom11_devices,
104 .devices_count = ARRAY_SIZE(otom11_devices)
105};
106
107
108void __init otom11_map_io(void)
109{
110 s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc));
111 s3c24xx_init_clocks(0);
112 s3c24xx_init_uarts(otom11_uartcfgs, ARRAY_SIZE(otom11_uartcfgs));
113 s3c24xx_set_board(&otom11_board);
114}
115
116
117MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
118 MAINTAINER("Guillaume GOURAT <guillaume.gourat@nexvision.tv>")
119 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART)
120 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
121 .map_io = otom11_map_io,
122 .init_irq = s3c24xx_init_irq,
123 .timer = &s3c24xx_timer,
124MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-rx3715.c b/arch/arm/mach-s3c2410/mach-rx3715.c
new file mode 100644
index 000000000000..f8d3a9784e71
--- /dev/null
+++ b/arch/arm/mach-s3c2410/mach-rx3715.c
@@ -0,0 +1,141 @@
1/* linux/arch/arm/mach-s3c2410/mach-rx3715.c
2 *
3 * Copyright (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://www.handhelds.org/projects/rx3715.html
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13 * 16-Sep-2004 BJD Copied from mach-h1940.c
14 * 25-Oct-2004 BJD Updates for 2.6.10-rc1
15 * 10-Jan-2005 BJD Removed include of s3c2410.h s3c2440.h
16 * 14-Jan-2005 BJD Added new clock init
17 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
18 * 14-Mar-2005 BJD Fixed __iomem warnings
19*/
20
21#include <linux/kernel.h>
22#include <linux/types.h>
23#include <linux/interrupt.h>
24#include <linux/list.h>
25#include <linux/timer.h>
26#include <linux/init.h>
27#include <linux/tty.h>
28#include <linux/console.h>
29#include <linux/serial_core.h>
30#include <linux/serial.h>
31
32#include <asm/mach/arch.h>
33#include <asm/mach/map.h>
34#include <asm/mach/irq.h>
35
36#include <asm/hardware.h>
37#include <asm/hardware/iomd.h>
38#include <asm/io.h>
39#include <asm/irq.h>
40#include <asm/mach-types.h>
41
42#include <asm/arch/regs-serial.h>
43#include <asm/arch/regs-gpio.h>
44
45#include "clock.h"
46#include "devs.h"
47#include "cpu.h"
48#include "pm.h"
49
50static struct map_desc rx3715_iodesc[] __initdata = {
51 /* dump ISA space somewhere unused */
52
53 { (u32)S3C24XX_VA_ISA_WORD, S3C2410_CS3, SZ_16M, MT_DEVICE },
54 { (u32)S3C24XX_VA_ISA_BYTE, S3C2410_CS3, SZ_16M, MT_DEVICE },
55};
56
57
58static struct s3c24xx_uart_clksrc rx3715_serial_clocks[] = {
59 [0] = {
60 .name = "fclk",
61 .divisor = 0,
62 .min_baud = 0,
63 .max_baud = 0,
64 }
65};
66
67static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
68 [0] = {
69 .hwport = 0,
70 .flags = 0,
71 .ucon = 0x3c5,
72 .ulcon = 0x03,
73 .ufcon = 0x51,
74 .clocks = rx3715_serial_clocks,
75 .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
76 },
77 [1] = {
78 .hwport = 1,
79 .flags = 0,
80 .ucon = 0x3c5,
81 .ulcon = 0x03,
82 .ufcon = 0x00,
83 .clocks = rx3715_serial_clocks,
84 .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
85 },
86 /* IR port */
87 [2] = {
88 .hwport = 2,
89 .uart_flags = UPF_CONS_FLOW,
90 .ucon = 0x3c5,
91 .ulcon = 0x43,
92 .ufcon = 0x51,
93 .clocks = rx3715_serial_clocks,
94 .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
95 }
96};
97
98static struct platform_device *rx3715_devices[] __initdata = {
99 &s3c_device_usb,
100 &s3c_device_lcd,
101 &s3c_device_wdt,
102 &s3c_device_i2c,
103 &s3c_device_iis,
104};
105
106static struct s3c24xx_board rx3715_board __initdata = {
107 .devices = rx3715_devices,
108 .devices_count = ARRAY_SIZE(rx3715_devices)
109};
110
111void __init rx3715_map_io(void)
112{
113 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
114 s3c24xx_init_clocks(16934000);
115 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
116 s3c24xx_set_board(&rx3715_board);
117}
118
119void __init rx3715_init_irq(void)
120{
121 s3c24xx_init_irq();
122}
123
124#ifdef CONFIG_PM
125static void __init rx3715_init_machine(void)
126{
127 s3c2410_pm_init();
128}
129#else
130#define rx3715_init_machine NULL
131#endif
132
133MACHINE_START(RX3715, "IPAQ-RX3715")
134 MAINTAINER("Ben Dooks <ben@fluff.org>")
135 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART)
136 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
137 MAPIO(rx3715_map_io)
138 INITIRQ(rx3715_init_irq)
139 INIT_MACHINE(rx3715_init_machine)
140 .timer = &s3c24xx_timer,
141MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c
new file mode 100644
index 000000000000..c1a4a1420ea0
--- /dev/null
+++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
@@ -0,0 +1,123 @@
1/***********************************************************************
2 *
3 * linux/arch/arm/mach-s3c2410/mach-smdk2410.c
4 *
5 * Copyright (C) 2004 by FS Forth-Systeme GmbH
6 * All rights reserved.
7 *
8 * $Id: mach-smdk2410.c,v 1.1 2004/05/11 14:15:38 mpietrek Exp $
9 * @Author: Jonas Dietsche
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 as
13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (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,
24 * MA 02111-1307 USA
25 *
26 * @History:
27 * derived from linux/arch/arm/mach-s3c2410/mach-bast.c, written by
28 * Ben Dooks <ben@simtec.co.uk>
29 *
30 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
31 *
32 ***********************************************************************/
33
34#include <linux/kernel.h>
35#include <linux/types.h>
36#include <linux/interrupt.h>
37#include <linux/list.h>
38#include <linux/timer.h>
39#include <linux/init.h>
40
41#include <asm/mach/arch.h>
42#include <asm/mach/map.h>
43#include <asm/mach/irq.h>
44
45#include <asm/hardware.h>
46#include <asm/io.h>
47#include <asm/irq.h>
48#include <asm/mach-types.h>
49
50#include <asm/arch/regs-serial.h>
51
52#include "devs.h"
53#include "cpu.h"
54
55static struct map_desc smdk2410_iodesc[] __initdata = {
56 /* nothing here yet */
57};
58
59#define UCON S3C2410_UCON_DEFAULT
60#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
61#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
62
63static struct s3c2410_uartcfg smdk2410_uartcfgs[] = {
64 [0] = {
65 .hwport = 0,
66 .flags = 0,
67 .ucon = UCON,
68 .ulcon = ULCON,
69 .ufcon = UFCON,
70 },
71 [1] = {
72 .hwport = 1,
73 .flags = 0,
74 .ucon = UCON,
75 .ulcon = ULCON,
76 .ufcon = UFCON,
77 },
78 [2] = {
79 .hwport = 2,
80 .flags = 0,
81 .ucon = UCON,
82 .ulcon = ULCON,
83 .ufcon = UFCON,
84 }
85};
86
87static struct platform_device *smdk2410_devices[] __initdata = {
88 &s3c_device_usb,
89 &s3c_device_lcd,
90 &s3c_device_wdt,
91 &s3c_device_i2c,
92 &s3c_device_iis,
93};
94
95static struct s3c24xx_board smdk2410_board __initdata = {
96 .devices = smdk2410_devices,
97 .devices_count = ARRAY_SIZE(smdk2410_devices)
98};
99
100void __init smdk2410_map_io(void)
101{
102 s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));
103 s3c24xx_init_clocks(0);
104 s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
105 s3c24xx_set_board(&smdk2410_board);
106}
107
108void __init smdk2410_init_irq(void)
109{
110 s3c24xx_init_irq();
111}
112
113MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
114 * to SMDK2410 */
115 MAINTAINER("Jonas Dietsche")
116 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART)
117 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
118 MAPIO(smdk2410_map_io)
119 INITIRQ(smdk2410_init_irq)
120 .timer = &s3c24xx_timer,
121MACHINE_END
122
123
diff --git a/arch/arm/mach-s3c2410/mach-smdk2440.c b/arch/arm/mach-s3c2410/mach-smdk2440.c
new file mode 100644
index 000000000000..7857176d9bcb
--- /dev/null
+++ b/arch/arm/mach-s3c2410/mach-smdk2440.c
@@ -0,0 +1,135 @@
1/* linux/arch/arm/mach-s3c2410/mach-smdk2440.c
2 *
3 * Copyright (c) 2004,2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://www.fluff.org/ben/smdk2440/
7 *
8 * Thanks to Dimity Andric and TomTom for the loan of an SMDK2440.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * Modifications:
15 * 01-Nov-2004 BJD Initial version
16 * 12-Nov-2004 BJD Updated for release
17 * 04-Jan-2005 BJD Fixes for pre-release
18 * 22-Feb-2005 BJD Updated for 2.6.11-rc5 relesa
19 * 10-Mar-2005 LCVR Replaced S3C2410_VA by S3C24XX_VA
20 * 14-Mar-2005 BJD void __iomem fixes
21*/
22
23#include <linux/kernel.h>
24#include <linux/types.h>
25#include <linux/interrupt.h>
26#include <linux/list.h>
27#include <linux/timer.h>
28#include <linux/init.h>
29
30#include <asm/mach/arch.h>
31#include <asm/mach/map.h>
32#include <asm/mach/irq.h>
33
34#include <asm/hardware.h>
35#include <asm/hardware/iomd.h>
36#include <asm/io.h>
37#include <asm/irq.h>
38#include <asm/mach-types.h>
39
40//#include <asm/debug-ll.h>
41#include <asm/arch/regs-serial.h>
42#include <asm/arch/regs-gpio.h>
43#include <asm/arch/idle.h>
44
45#include "s3c2410.h"
46#include "s3c2440.h"
47#include "clock.h"
48#include "devs.h"
49#include "cpu.h"
50#include "pm.h"
51
52static struct map_desc smdk2440_iodesc[] __initdata = {
53 /* ISA IO Space map (memory space selected by A24) */
54
55 { (u32)S3C24XX_VA_ISA_WORD, S3C2410_CS2, SZ_16M, MT_DEVICE },
56 { (u32)S3C24XX_VA_ISA_BYTE, S3C2410_CS2, SZ_16M, MT_DEVICE },
57};
58
59#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
60#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
61#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
62
63static struct s3c2410_uartcfg smdk2440_uartcfgs[] = {
64 [0] = {
65 .hwport = 0,
66 .flags = 0,
67 .ucon = 0x3c5,
68 .ulcon = 0x03,
69 .ufcon = 0x51,
70 },
71 [1] = {
72 .hwport = 1,
73 .flags = 0,
74 .ucon = 0x3c5,
75 .ulcon = 0x03,
76 .ufcon = 0x51,
77 },
78 /* IR port */
79 [2] = {
80 .hwport = 2,
81 .flags = 0,
82 .ucon = 0x3c5,
83 .ulcon = 0x43,
84 .ufcon = 0x51,
85 }
86};
87
88static struct platform_device *smdk2440_devices[] __initdata = {
89 &s3c_device_usb,
90 &s3c_device_lcd,
91 &s3c_device_wdt,
92 &s3c_device_i2c,
93 &s3c_device_iis,
94};
95
96static struct s3c24xx_board smdk2440_board __initdata = {
97 .devices = smdk2440_devices,
98 .devices_count = ARRAY_SIZE(smdk2440_devices)
99};
100
101void __init smdk2440_map_io(void)
102{
103 s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
104 s3c24xx_init_clocks(16934400);
105 s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
106 s3c24xx_set_board(&smdk2440_board);
107}
108
109void __init smdk2440_machine_init(void)
110{
111 /* Configure the LEDs (even if we have no LED support)*/
112
113 s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP);
114 s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
115 s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP);
116 s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP);
117
118 s3c2410_gpio_setpin(S3C2410_GPF4, 0);
119 s3c2410_gpio_setpin(S3C2410_GPF5, 0);
120 s3c2410_gpio_setpin(S3C2410_GPF6, 0);
121 s3c2410_gpio_setpin(S3C2410_GPF7, 0);
122
123 s3c2410_pm_init();
124}
125
126MACHINE_START(S3C2440, "SMDK2440")
127 MAINTAINER("Ben Dooks <ben@fluff.org>")
128 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART)
129 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
130
131 .init_irq = s3c24xx_init_irq,
132 .map_io = smdk2440_map_io,
133 .init_machine = smdk2440_machine_init,
134 .timer = &s3c24xx_timer,
135MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
new file mode 100644
index 000000000000..5512146b1ce4
--- /dev/null
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -0,0 +1,317 @@
1/* linux/arch/arm/mach-s3c2410/mach-vr1000.c
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Machine support for Thorcom VR1000 board. Designed for Thorcom by
7 * Simtec Electronics, http://www.simtec.co.uk/
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * Modifications:
14 * 14-Sep-2004 BJD USB Power control
15 * 04-Sep-2004 BJD Added new uart init, and io init
16 * 21-Aug-2004 BJD Added struct s3c2410_board
17 * 06-Aug-2004 BJD Fixed call to time initialisation
18 * 05-Apr-2004 BJD Copied to make mach-vr1000.c
19 * 18-Oct-2004 BJD Updated board struct
20 * 04-Nov-2004 BJD Clock and serial configuration update
21 *
22 * 04-Jan-2005 BJD Updated uart init call
23 * 10-Jan-2005 BJD Removed include of s3c2410.h
24 * 14-Jan-2005 BJD Added clock init
25 * 15-Jan-2005 BJD Add serial port device definition
26 * 20-Jan-2005 BJD Use UPF_IOREMAP for ports
27 * 10-Feb-2005 BJD Added power-off capability
28 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
29 * 14-Mar-2006 BJD void __iomem fixes
30*/
31
32#include <linux/kernel.h>
33#include <linux/types.h>
34#include <linux/interrupt.h>
35#include <linux/list.h>
36#include <linux/timer.h>
37#include <linux/init.h>
38
39#include <linux/serial.h>
40#include <linux/tty.h>
41#include <linux/serial_8250.h>
42#include <linux/serial_reg.h>
43
44#include <asm/mach/arch.h>
45#include <asm/mach/map.h>
46#include <asm/mach/irq.h>
47
48#include <asm/arch/bast-map.h>
49#include <asm/arch/vr1000-map.h>
50#include <asm/arch/vr1000-irq.h>
51#include <asm/arch/vr1000-cpld.h>
52
53#include <asm/hardware.h>
54#include <asm/io.h>
55#include <asm/irq.h>
56#include <asm/mach-types.h>
57
58#include <asm/arch/regs-serial.h>
59#include <asm/arch/regs-gpio.h>
60
61#include "clock.h"
62#include "devs.h"
63#include "cpu.h"
64#include "usb-simtec.h"
65
66/* macros for virtual address mods for the io space entries */
67#define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5)
68#define VA_C4(item) ((unsigned long)(item) + BAST_VAM_CS4)
69#define VA_C3(item) ((unsigned long)(item) + BAST_VAM_CS3)
70#define VA_C2(item) ((unsigned long)(item) + BAST_VAM_CS2)
71
72/* macros to modify the physical addresses for io space */
73
74#define PA_CS2(item) ((item) + S3C2410_CS2)
75#define PA_CS3(item) ((item) + S3C2410_CS3)
76#define PA_CS4(item) ((item) + S3C2410_CS4)
77#define PA_CS5(item) ((item) + S3C2410_CS5)
78
79static struct map_desc vr1000_iodesc[] __initdata = {
80 /* ISA IO areas */
81
82 { (u32)S3C24XX_VA_ISA_BYTE, PA_CS2(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
83 { (u32)S3C24XX_VA_ISA_WORD, PA_CS3(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
84
85 /* we could possibly compress the next set down into a set of smaller tables
86 * pagetables, but that would mean using an L2 section, and it still means
87 * we cannot actually feed the same register to an LDR due to 16K spacing
88 */
89
90 /* bast CPLD control registers, and external interrupt controls */
91 { (u32)VR1000_VA_CTRL1, VR1000_PA_CTRL1, SZ_1M, MT_DEVICE },
92 { (u32)VR1000_VA_CTRL2, VR1000_PA_CTRL2, SZ_1M, MT_DEVICE },
93 { (u32)VR1000_VA_CTRL3, VR1000_PA_CTRL3, SZ_1M, MT_DEVICE },
94 { (u32)VR1000_VA_CTRL4, VR1000_PA_CTRL4, SZ_1M, MT_DEVICE },
95
96 /* peripheral space... one for each of fast/slow/byte/16bit */
97 /* note, ide is only decoded in word space, even though some registers
98 * are only 8bit */
99
100 /* slow, byte */
101 { VA_C2(VR1000_VA_DM9000), PA_CS2(VR1000_PA_DM9000), SZ_1M, MT_DEVICE },
102 { VA_C2(VR1000_VA_IDEPRI), PA_CS3(VR1000_PA_IDEPRI), SZ_1M, MT_DEVICE },
103 { VA_C2(VR1000_VA_IDESEC), PA_CS3(VR1000_PA_IDESEC), SZ_1M, MT_DEVICE },
104 { VA_C2(VR1000_VA_IDEPRIAUX), PA_CS3(VR1000_PA_IDEPRIAUX), SZ_1M, MT_DEVICE },
105 { VA_C2(VR1000_VA_IDESECAUX), PA_CS3(VR1000_PA_IDESECAUX), SZ_1M, MT_DEVICE },
106
107 /* slow, word */
108 { VA_C3(VR1000_VA_DM9000), PA_CS3(VR1000_PA_DM9000), SZ_1M, MT_DEVICE },
109 { VA_C3(VR1000_VA_IDEPRI), PA_CS3(VR1000_PA_IDEPRI), SZ_1M, MT_DEVICE },
110 { VA_C3(VR1000_VA_IDESEC), PA_CS3(VR1000_PA_IDESEC), SZ_1M, MT_DEVICE },
111 { VA_C3(VR1000_VA_IDEPRIAUX), PA_CS3(VR1000_PA_IDEPRIAUX), SZ_1M, MT_DEVICE },
112 { VA_C3(VR1000_VA_IDESECAUX), PA_CS3(VR1000_PA_IDESECAUX), SZ_1M, MT_DEVICE },
113
114 /* fast, byte */
115 { VA_C4(VR1000_VA_DM9000), PA_CS4(VR1000_PA_DM9000), SZ_1M, MT_DEVICE },
116 { VA_C4(VR1000_VA_IDEPRI), PA_CS5(VR1000_PA_IDEPRI), SZ_1M, MT_DEVICE },
117 { VA_C4(VR1000_VA_IDESEC), PA_CS5(VR1000_PA_IDESEC), SZ_1M, MT_DEVICE },
118 { VA_C4(VR1000_VA_IDEPRIAUX), PA_CS5(VR1000_PA_IDEPRIAUX), SZ_1M, MT_DEVICE },
119 { VA_C4(VR1000_VA_IDESECAUX), PA_CS5(VR1000_PA_IDESECAUX), SZ_1M, MT_DEVICE },
120
121 /* fast, word */
122 { VA_C5(VR1000_VA_DM9000), PA_CS5(VR1000_PA_DM9000), SZ_1M, MT_DEVICE },
123 { VA_C5(VR1000_VA_IDEPRI), PA_CS5(VR1000_PA_IDEPRI), SZ_1M, MT_DEVICE },
124 { VA_C5(VR1000_VA_IDESEC), PA_CS5(VR1000_PA_IDESEC), SZ_1M, MT_DEVICE },
125 { VA_C5(VR1000_VA_IDEPRIAUX), PA_CS5(VR1000_PA_IDEPRIAUX), SZ_1M, MT_DEVICE },
126 { VA_C5(VR1000_VA_IDESECAUX), PA_CS5(VR1000_PA_IDESECAUX), SZ_1M, MT_DEVICE },
127};
128
129#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
130#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
131#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
132
133/* uart clock source(s) */
134
135static struct s3c24xx_uart_clksrc vr1000_serial_clocks[] = {
136 [0] = {
137 .name = "uclk",
138 .divisor = 1,
139 .min_baud = 0,
140 .max_baud = 0,
141 },
142 [1] = {
143 .name = "pclk",
144 .divisor = 1,
145 .min_baud = 0,
146 .max_baud = 0.
147 }
148};
149
150static struct s3c2410_uartcfg vr1000_uartcfgs[] = {
151 [0] = {
152 .hwport = 0,
153 .flags = 0,
154 .ucon = UCON,
155 .ulcon = ULCON,
156 .ufcon = UFCON,
157 .clocks = vr1000_serial_clocks,
158 .clocks_size = ARRAY_SIZE(vr1000_serial_clocks),
159 },
160 [1] = {
161 .hwport = 1,
162 .flags = 0,
163 .ucon = UCON,
164 .ulcon = ULCON,
165 .ufcon = UFCON,
166 .clocks = vr1000_serial_clocks,
167 .clocks_size = ARRAY_SIZE(vr1000_serial_clocks),
168 },
169 /* port 2 is not actually used */
170 [2] = {
171 .hwport = 2,
172 .flags = 0,
173 .ucon = UCON,
174 .ulcon = ULCON,
175 .ufcon = UFCON,
176 .clocks = vr1000_serial_clocks,
177 .clocks_size = ARRAY_SIZE(vr1000_serial_clocks),
178
179 }
180};
181
182/* definitions for the vr1000 extra 16550 serial ports */
183
184#define VR1000_BAUDBASE (3692307)
185
186#define VR1000_SERIAL_MAPBASE(x) (VR1000_PA_SERIAL + 0x80 + ((x) << 5))
187
188static struct plat_serial8250_port serial_platform_data[] = {
189 [0] = {
190 .mapbase = VR1000_SERIAL_MAPBASE(0),
191 .irq = IRQ_VR1000_SERIAL + 0,
192 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
193 .iotype = UPIO_MEM,
194 .regshift = 0,
195 .uartclk = VR1000_BAUDBASE,
196 },
197 [1] = {
198 .mapbase = VR1000_SERIAL_MAPBASE(1),
199 .irq = IRQ_VR1000_SERIAL + 1,
200 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
201 .iotype = UPIO_MEM,
202 .regshift = 0,
203 .uartclk = VR1000_BAUDBASE,
204 },
205 [2] = {
206 .mapbase = VR1000_SERIAL_MAPBASE(2),
207 .irq = IRQ_VR1000_SERIAL + 2,
208 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
209 .iotype = UPIO_MEM,
210 .regshift = 0,
211 .uartclk = VR1000_BAUDBASE,
212 },
213 [3] = {
214 .mapbase = VR1000_SERIAL_MAPBASE(3),
215 .irq = IRQ_VR1000_SERIAL + 3,
216 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
217 .iotype = UPIO_MEM,
218 .regshift = 0,
219 .uartclk = VR1000_BAUDBASE,
220 },
221 { },
222};
223
224static struct platform_device serial_device = {
225 .name = "serial8250",
226 .id = 0,
227 .dev = {
228 .platform_data = serial_platform_data,
229 },
230};
231
232/* MTD NOR Flash */
233
234static struct resource vr1000_nor_resource[] = {
235 [0] = {
236 .start = S3C2410_CS1 + 0x4000000,
237 .end = S3C2410_CS1 + 0x4000000 + SZ_16M - 1,
238 .flags = IORESOURCE_MEM,
239 }
240};
241
242static struct platform_device vr1000_nor = {
243 .name = "bast-nor",
244 .id = -1,
245 .num_resources = ARRAY_SIZE(vr1000_nor_resource),
246 .resource = vr1000_nor_resource,
247};
248
249
250static struct platform_device *vr1000_devices[] __initdata = {
251 &s3c_device_usb,
252 &s3c_device_lcd,
253 &s3c_device_wdt,
254 &s3c_device_i2c,
255 &s3c_device_iis,
256 &serial_device,
257 &vr1000_nor,
258};
259
260static struct clk *vr1000_clocks[] = {
261 &s3c24xx_dclk0,
262 &s3c24xx_dclk1,
263 &s3c24xx_clkout0,
264 &s3c24xx_clkout1,
265 &s3c24xx_uclk,
266};
267
268static struct s3c24xx_board vr1000_board __initdata = {
269 .devices = vr1000_devices,
270 .devices_count = ARRAY_SIZE(vr1000_devices),
271 .clocks = vr1000_clocks,
272 .clocks_count = ARRAY_SIZE(vr1000_clocks),
273};
274
275static void vr1000_power_off(void)
276{
277 s3c2410_gpio_cfgpin(S3C2410_GPB9, S3C2410_GPB9_OUTP);
278 s3c2410_gpio_setpin(S3C2410_GPB9, 1);
279}
280
281void __init vr1000_map_io(void)
282{
283 /* initialise clock sources */
284
285 s3c24xx_dclk0.parent = NULL;
286 s3c24xx_dclk0.rate = 12*1000*1000;
287
288 s3c24xx_dclk1.parent = NULL;
289 s3c24xx_dclk1.rate = 3692307;
290
291 s3c24xx_clkout0.parent = &s3c24xx_dclk0;
292 s3c24xx_clkout1.parent = &s3c24xx_dclk1;
293
294 s3c24xx_uclk.parent = &s3c24xx_clkout1;
295
296 pm_power_off = vr1000_power_off;
297
298 s3c24xx_init_io(vr1000_iodesc, ARRAY_SIZE(vr1000_iodesc));
299 s3c24xx_init_clocks(0);
300 s3c24xx_init_uarts(vr1000_uartcfgs, ARRAY_SIZE(vr1000_uartcfgs));
301 s3c24xx_set_board(&vr1000_board);
302 usb_simtec_init();
303}
304
305void __init vr1000_init_irq(void)
306{
307 s3c24xx_init_irq();
308}
309
310MACHINE_START(VR1000, "Thorcom-VR1000")
311 MAINTAINER("Ben Dooks <ben@simtec.co.uk>")
312 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART)
313 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
314 MAPIO(vr1000_map_io)
315 INITIRQ(vr1000_init_irq)
316 .timer = &s3c24xx_timer,
317MACHINE_END
diff --git a/arch/arm/mach-s3c2410/pm.c b/arch/arm/mach-s3c2410/pm.c
new file mode 100644
index 000000000000..13a48ee77484
--- /dev/null
+++ b/arch/arm/mach-s3c2410/pm.c
@@ -0,0 +1,672 @@
1/* linux/arch/arm/mach-s3c2410/pm.c
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 Power Manager (Suspend-To-RAM) support
7 *
8 * See Documentation/arm/Samsung-S3C24XX/Suspend.txt for more information
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 * Parts based on arch/arm/mach-pxa/pm.c
25 *
26 * Thanks to Dimitry Andric for debugging
27 *
28 * Modifications:
29 * 10-Mar-2005 LCVR Changed S3C2410_VA_UART to S3C24XX_VA_UART
30*/
31
32#include <linux/config.h>
33#include <linux/init.h>
34#include <linux/suspend.h>
35#include <linux/errno.h>
36#include <linux/time.h>
37#include <linux/interrupt.h>
38#include <linux/crc32.h>
39#include <linux/ioport.h>
40#include <linux/delay.h>
41
42#include <asm/hardware.h>
43#include <asm/io.h>
44
45#include <asm/arch/regs-serial.h>
46#include <asm/arch/regs-clock.h>
47#include <asm/arch/regs-gpio.h>
48#include <asm/arch/regs-mem.h>
49#include <asm/arch/regs-irq.h>
50
51#include <asm/mach/time.h>
52
53#include "pm.h"
54
55/* for external use */
56
57unsigned long s3c_pm_flags;
58
59/* cache functions from arch/arm/mm/proc-arm920.S */
60
61extern void arm920_flush_kern_cache_all(void);
62
63#define PFX "s3c24xx-pm: "
64
65static struct sleep_save core_save[] = {
66 SAVE_ITEM(S3C2410_LOCKTIME),
67 SAVE_ITEM(S3C2410_CLKCON),
68
69 /* we restore the timings here, with the proviso that the board
70 * brings the system up in an slower, or equal frequency setting
71 * to the original system.
72 *
73 * if we cannot guarantee this, then things are going to go very
74 * wrong here, as we modify the refresh and both pll settings.
75 */
76
77 SAVE_ITEM(S3C2410_BWSCON),
78 SAVE_ITEM(S3C2410_BANKCON0),
79 SAVE_ITEM(S3C2410_BANKCON1),
80 SAVE_ITEM(S3C2410_BANKCON2),
81 SAVE_ITEM(S3C2410_BANKCON3),
82 SAVE_ITEM(S3C2410_BANKCON4),
83 SAVE_ITEM(S3C2410_BANKCON5),
84
85 SAVE_ITEM(S3C2410_CLKDIVN),
86 SAVE_ITEM(S3C2410_MPLLCON),
87 SAVE_ITEM(S3C2410_UPLLCON),
88 SAVE_ITEM(S3C2410_CLKSLOW),
89 SAVE_ITEM(S3C2410_REFRESH),
90};
91
92/* this lot should be really saved by the IRQ code */
93static struct sleep_save irq_save[] = {
94 SAVE_ITEM(S3C2410_EXTINT0),
95 SAVE_ITEM(S3C2410_EXTINT1),
96 SAVE_ITEM(S3C2410_EXTINT2),
97 SAVE_ITEM(S3C2410_EINFLT0),
98 SAVE_ITEM(S3C2410_EINFLT1),
99 SAVE_ITEM(S3C2410_EINFLT2),
100 SAVE_ITEM(S3C2410_EINFLT3),
101 SAVE_ITEM(S3C2410_EINTMASK),
102 SAVE_ITEM(S3C2410_INTMSK)
103};
104
105static struct sleep_save gpio_save[] = {
106 SAVE_ITEM(S3C2410_GPACON),
107 SAVE_ITEM(S3C2410_GPADAT),
108
109 SAVE_ITEM(S3C2410_GPBCON),
110 SAVE_ITEM(S3C2410_GPBDAT),
111 SAVE_ITEM(S3C2410_GPBUP),
112
113 SAVE_ITEM(S3C2410_GPCCON),
114 SAVE_ITEM(S3C2410_GPCDAT),
115 SAVE_ITEM(S3C2410_GPCUP),
116
117 SAVE_ITEM(S3C2410_GPDCON),
118 SAVE_ITEM(S3C2410_GPDDAT),
119 SAVE_ITEM(S3C2410_GPDUP),
120
121 SAVE_ITEM(S3C2410_GPECON),
122 SAVE_ITEM(S3C2410_GPEDAT),
123 SAVE_ITEM(S3C2410_GPEUP),
124
125 SAVE_ITEM(S3C2410_GPFCON),
126 SAVE_ITEM(S3C2410_GPFDAT),
127 SAVE_ITEM(S3C2410_GPFUP),
128
129 SAVE_ITEM(S3C2410_GPGCON),
130 SAVE_ITEM(S3C2410_GPGDAT),
131 SAVE_ITEM(S3C2410_GPGUP),
132
133 SAVE_ITEM(S3C2410_GPHCON),
134 SAVE_ITEM(S3C2410_GPHDAT),
135 SAVE_ITEM(S3C2410_GPHUP),
136
137 SAVE_ITEM(S3C2410_DCLKCON),
138};
139
140#ifdef CONFIG_S3C2410_PM_DEBUG
141
142#define SAVE_UART(va) \
143 SAVE_ITEM((va) + S3C2410_ULCON), \
144 SAVE_ITEM((va) + S3C2410_UCON), \
145 SAVE_ITEM((va) + S3C2410_UFCON), \
146 SAVE_ITEM((va) + S3C2410_UMCON), \
147 SAVE_ITEM((va) + S3C2410_UBRDIV)
148
149static struct sleep_save uart_save[] = {
150 SAVE_UART(S3C24XX_VA_UART0),
151 SAVE_UART(S3C24XX_VA_UART1),
152#ifndef CONFIG_CPU_S3C2400
153 SAVE_UART(S3C24XX_VA_UART2),
154#endif
155};
156
157/* debug
158 *
159 * we send the debug to printascii() to allow it to be seen if the
160 * system never wakes up from the sleep
161*/
162
163extern void printascii(const char *);
164
165static void pm_dbg(const char *fmt, ...)
166{
167 va_list va;
168 char buff[256];
169
170 va_start(va, fmt);
171 vsprintf(buff, fmt, va);
172 va_end(va);
173
174 printascii(buff);
175}
176
177static void s3c2410_pm_debug_init(void)
178{
179 unsigned long tmp = __raw_readl(S3C2410_CLKCON);
180
181 /* re-start uart clocks */
182 tmp |= S3C2410_CLKCON_UART0;
183 tmp |= S3C2410_CLKCON_UART1;
184 tmp |= S3C2410_CLKCON_UART2;
185
186 __raw_writel(tmp, S3C2410_CLKCON);
187 udelay(10);
188}
189
190#define DBG(fmt...) pm_dbg(fmt)
191#else
192#define DBG(fmt...) printk(KERN_DEBUG fmt)
193
194#define s3c2410_pm_debug_init() do { } while(0)
195
196static struct sleep_save uart_save[] = {};
197#endif
198
199#if defined(CONFIG_S3C2410_PM_CHECK) && CONFIG_S3C2410_PM_CHECK_CHUNKSIZE != 0
200
201/* suspend checking code...
202 *
203 * this next area does a set of crc checks over all the installed
204 * memory, so the system can verify if the resume was ok.
205 *
206 * CONFIG_S3C2410_PM_CHECK_CHUNKSIZE defines the block-size for the CRC,
207 * increasing it will mean that the area corrupted will be less easy to spot,
208 * and reducing the size will cause the CRC save area to grow
209*/
210
211#define CHECK_CHUNKSIZE (CONFIG_S3C2410_PM_CHECK_CHUNKSIZE * 1024)
212
213static u32 crc_size; /* size needed for the crc block */
214static u32 *crcs; /* allocated over suspend/resume */
215
216typedef u32 *(run_fn_t)(struct resource *ptr, u32 *arg);
217
218/* s3c2410_pm_run_res
219 *
220 * go thorugh the given resource list, and look for system ram
221*/
222
223static void s3c2410_pm_run_res(struct resource *ptr, run_fn_t fn, u32 *arg)
224{
225 while (ptr != NULL) {
226 if (ptr->child != NULL)
227 s3c2410_pm_run_res(ptr->child, fn, arg);
228
229 if ((ptr->flags & IORESOURCE_MEM) &&
230 strcmp(ptr->name, "System RAM") == 0) {
231 DBG("Found system RAM at %08lx..%08lx\n",
232 ptr->start, ptr->end);
233 arg = (fn)(ptr, arg);
234 }
235
236 ptr = ptr->sibling;
237 }
238}
239
240static void s3c2410_pm_run_sysram(run_fn_t fn, u32 *arg)
241{
242 s3c2410_pm_run_res(&iomem_resource, fn, arg);
243}
244
245static u32 *s3c2410_pm_countram(struct resource *res, u32 *val)
246{
247 u32 size = (u32)(res->end - res->start)+1;
248
249 size += CHECK_CHUNKSIZE-1;
250 size /= CHECK_CHUNKSIZE;
251
252 DBG("Area %08lx..%08lx, %d blocks\n", res->start, res->end, size);
253
254 *val += size * sizeof(u32);
255 return val;
256}
257
258/* s3c2410_pm_prepare_check
259 *
260 * prepare the necessary information for creating the CRCs. This
261 * must be done before the final save, as it will require memory
262 * allocating, and thus touching bits of the kernel we do not
263 * know about.
264*/
265
266static void s3c2410_pm_check_prepare(void)
267{
268 crc_size = 0;
269
270 s3c2410_pm_run_sysram(s3c2410_pm_countram, &crc_size);
271
272 DBG("s3c2410_pm_prepare_check: %u checks needed\n", crc_size);
273
274 crcs = kmalloc(crc_size+4, GFP_KERNEL);
275 if (crcs == NULL)
276 printk(KERN_ERR "Cannot allocated CRC save area\n");
277}
278
279static u32 *s3c2410_pm_makecheck(struct resource *res, u32 *val)
280{
281 unsigned long addr, left;
282
283 for (addr = res->start; addr < res->end;
284 addr += CHECK_CHUNKSIZE) {
285 left = res->end - addr;
286
287 if (left > CHECK_CHUNKSIZE)
288 left = CHECK_CHUNKSIZE;
289
290 *val = crc32_le(~0, phys_to_virt(addr), left);
291 val++;
292 }
293
294 return val;
295}
296
297/* s3c2410_pm_check_store
298 *
299 * compute the CRC values for the memory blocks before the final
300 * sleep.
301*/
302
303static void s3c2410_pm_check_store(void)
304{
305 if (crcs != NULL)
306 s3c2410_pm_run_sysram(s3c2410_pm_makecheck, crcs);
307}
308
309/* in_region
310 *
311 * return TRUE if the area defined by ptr..ptr+size contatins the
312 * what..what+whatsz
313*/
314
315static inline int in_region(void *ptr, int size, void *what, size_t whatsz)
316{
317 if ((what+whatsz) < ptr)
318 return 0;
319
320 if (what > (ptr+size))
321 return 0;
322
323 return 1;
324}
325
326static u32 *s3c2410_pm_runcheck(struct resource *res, u32 *val)
327{
328 void *save_at = phys_to_virt(s3c2410_sleep_save_phys);
329 unsigned long addr;
330 unsigned long left;
331 void *ptr;
332 u32 calc;
333
334 for (addr = res->start; addr < res->end;
335 addr += CHECK_CHUNKSIZE) {
336 left = res->end - addr;
337
338 if (left > CHECK_CHUNKSIZE)
339 left = CHECK_CHUNKSIZE;
340
341 ptr = phys_to_virt(addr);
342
343 if (in_region(ptr, left, crcs, crc_size)) {
344 DBG("skipping %08lx, has crc block in\n", addr);
345 goto skip_check;
346 }
347
348 if (in_region(ptr, left, save_at, 32*4 )) {
349 DBG("skipping %08lx, has save block in\n", addr);
350 goto skip_check;
351 }
352
353 /* calculate and check the checksum */
354
355 calc = crc32_le(~0, ptr, left);
356 if (calc != *val) {
357 printk(KERN_ERR PFX "Restore CRC error at "
358 "%08lx (%08x vs %08x)\n", addr, calc, *val);
359
360 DBG("Restore CRC error at %08lx (%08x vs %08x)\n",
361 addr, calc, *val);
362 }
363
364 skip_check:
365 val++;
366 }
367
368 return val;
369}
370
371/* s3c2410_pm_check_restore
372 *
373 * check the CRCs after the restore event and free the memory used
374 * to hold them
375*/
376
377static void s3c2410_pm_check_restore(void)
378{
379 if (crcs != NULL) {
380 s3c2410_pm_run_sysram(s3c2410_pm_runcheck, crcs);
381 kfree(crcs);
382 crcs = NULL;
383 }
384}
385
386#else
387
388#define s3c2410_pm_check_prepare() do { } while(0)
389#define s3c2410_pm_check_restore() do { } while(0)
390#define s3c2410_pm_check_store() do { } while(0)
391#endif
392
393/* helper functions to save and restore register state */
394
395void s3c2410_pm_do_save(struct sleep_save *ptr, int count)
396{
397 for (; count > 0; count--, ptr++) {
398 ptr->val = __raw_readl(ptr->reg);
399 DBG("saved %p value %08lx\n", ptr->reg, ptr->val);
400 }
401}
402
403/* s3c2410_pm_do_restore
404 *
405 * restore the system from the given list of saved registers
406 *
407 * Note, we do not use DBG() in here, as the system may not have
408 * restore the UARTs state yet
409*/
410
411void s3c2410_pm_do_restore(struct sleep_save *ptr, int count)
412{
413 for (; count > 0; count--, ptr++) {
414 printk(KERN_DEBUG "restore %p (restore %08lx, was %08x)\n",
415 ptr->reg, ptr->val, __raw_readl(ptr->reg));
416
417 __raw_writel(ptr->val, ptr->reg);
418 }
419}
420
421/* s3c2410_pm_do_restore_core
422 *
423 * similar to s3c2410_pm_do_restore_core
424 *
425 * WARNING: Do not put any debug in here that may effect memory or use
426 * peripherals, as things may be changing!
427*/
428
429static void s3c2410_pm_do_restore_core(struct sleep_save *ptr, int count)
430{
431 for (; count > 0; count--, ptr++) {
432 __raw_writel(ptr->val, ptr->reg);
433 }
434}
435
436/* s3c2410_pm_show_resume_irqs
437 *
438 * print any IRQs asserted at resume time (ie, we woke from)
439*/
440
441static void s3c2410_pm_show_resume_irqs(int start, unsigned long which,
442 unsigned long mask)
443{
444 int i;
445
446 which &= ~mask;
447
448 for (i = 0; i <= 31; i++) {
449 if ((which) & (1L<<i)) {
450 DBG("IRQ %d asserted at resume\n", start+i);
451 }
452 }
453}
454
455/* s3c2410_pm_check_resume_pin
456 *
457 * check to see if the pin is configured correctly for sleep mode, and
458 * make any necessary adjustments if it is not
459*/
460
461static void s3c2410_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs)
462{
463 unsigned long irqstate;
464 unsigned long pinstate;
465 int irq = s3c2410_gpio_getirq(pin);
466
467 if (irqoffs < 4)
468 irqstate = s3c_irqwake_intmask & (1L<<irqoffs);
469 else
470 irqstate = s3c_irqwake_eintmask & (1L<<irqoffs);
471
472 pinstate = s3c2410_gpio_getcfg(pin);
473 pinstate >>= S3C2410_GPIO_OFFSET(pin)*2;
474
475 if (!irqstate) {
476 if (pinstate == 0x02)
477 DBG("Leaving IRQ %d (pin %d) enabled\n", irq, pin);
478 } else {
479 if (pinstate == 0x02) {
480 DBG("Disabling IRQ %d (pin %d)\n", irq, pin);
481 s3c2410_gpio_cfgpin(pin, 0x00);
482 }
483 }
484}
485
486/* s3c2410_pm_configure_extint
487 *
488 * configure all external interrupt pins
489*/
490
491static void s3c2410_pm_configure_extint(void)
492{
493 int pin;
494
495 /* for each of the external interrupts (EINT0..EINT15) we
496 * need to check wether it is an external interrupt source,
497 * and then configure it as an input if it is not
498 */
499
500 for (pin = S3C2410_GPF0; pin <= S3C2410_GPF7; pin++) {
501 s3c2410_pm_check_resume_pin(pin, pin - S3C2410_GPF0);
502 }
503
504 for (pin = S3C2410_GPG0; pin <= S3C2410_GPG7; pin++) {
505 s3c2410_pm_check_resume_pin(pin, (pin - S3C2410_GPG0)+8);
506 }
507}
508
509#define any_allowed(mask, allow) (((mask) & (allow)) != (allow))
510
511/* s3c2410_pm_enter
512 *
513 * central control for sleep/resume process
514*/
515
516static int s3c2410_pm_enter(suspend_state_t state)
517{
518 unsigned long regs_save[16];
519 unsigned long tmp;
520
521 /* ensure the debug is initialised (if enabled) */
522
523 s3c2410_pm_debug_init();
524
525 DBG("s3c2410_pm_enter(%d)\n", state);
526
527 if (state != PM_SUSPEND_MEM) {
528 printk(KERN_ERR PFX "error: only PM_SUSPEND_MEM supported\n");
529 return -EINVAL;
530 }
531
532 /* check if we have anything to wake-up with... bad things seem
533 * to happen if you suspend with no wakeup (system will often
534 * require a full power-cycle)
535 */
536
537 if (!any_allowed(s3c_irqwake_intmask, s3c_irqwake_intallow) &&
538 !any_allowed(s3c_irqwake_eintmask, s3c_irqwake_eintallow)) {
539 printk(KERN_ERR PFX "No sources enabled for wake-up!\n");
540 printk(KERN_ERR PFX "Aborting sleep\n");
541 return -EINVAL;
542 }
543
544 /* prepare check area if configured */
545
546 s3c2410_pm_check_prepare();
547
548 /* store the physical address of the register recovery block */
549
550 s3c2410_sleep_save_phys = virt_to_phys(regs_save);
551
552 DBG("s3c2410_sleep_save_phys=0x%08lx\n", s3c2410_sleep_save_phys);
553
554 /* ensure at least GESTATUS3 has the resume address */
555
556 __raw_writel(virt_to_phys(s3c2410_cpu_resume), S3C2410_GSTATUS3);
557
558 DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3));
559 DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4));
560
561 /* save all necessary core registers not covered by the drivers */
562
563 s3c2410_pm_do_save(gpio_save, ARRAY_SIZE(gpio_save));
564 s3c2410_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
565 s3c2410_pm_do_save(core_save, ARRAY_SIZE(core_save));
566 s3c2410_pm_do_save(uart_save, ARRAY_SIZE(uart_save));
567
568 /* set the irq configuration for wake */
569
570 s3c2410_pm_configure_extint();
571
572 DBG("sleep: irq wakeup masks: %08lx,%08lx\n",
573 s3c_irqwake_intmask, s3c_irqwake_eintmask);
574
575 __raw_writel(s3c_irqwake_intmask, S3C2410_INTMSK);
576 __raw_writel(s3c_irqwake_eintmask, S3C2410_EINTMASK);
577
578 /* ack any outstanding external interrupts before we go to sleep */
579
580 __raw_writel(__raw_readl(S3C2410_EINTPEND), S3C2410_EINTPEND);
581
582 /* flush cache back to ram */
583
584 arm920_flush_kern_cache_all();
585
586 s3c2410_pm_check_store();
587
588 // need to make some form of time-delta
589
590 /* send the cpu to sleep... */
591
592 __raw_writel(0x00, S3C2410_CLKCON); /* turn off clocks over sleep */
593
594 s3c2410_cpu_suspend(regs_save);
595
596 /* unset the return-from-sleep flag, to ensure reset */
597
598 tmp = __raw_readl(S3C2410_GSTATUS2);
599 tmp &= S3C2410_GSTATUS2_OFFRESET;
600 __raw_writel(tmp, S3C2410_GSTATUS2);
601
602 /* restore the system state */
603
604 s3c2410_pm_do_restore_core(core_save, ARRAY_SIZE(core_save));
605 s3c2410_pm_do_restore(gpio_save, ARRAY_SIZE(gpio_save));
606 s3c2410_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
607 s3c2410_pm_do_restore(uart_save, ARRAY_SIZE(uart_save));
608
609 s3c2410_pm_debug_init();
610
611 /* check what irq (if any) restored the system */
612
613 DBG("post sleep: IRQs 0x%08x, 0x%08x\n",
614 __raw_readl(S3C2410_SRCPND),
615 __raw_readl(S3C2410_EINTPEND));
616
617 s3c2410_pm_show_resume_irqs(IRQ_EINT0, __raw_readl(S3C2410_SRCPND),
618 s3c_irqwake_intmask);
619
620 s3c2410_pm_show_resume_irqs(IRQ_EINT4-4, __raw_readl(S3C2410_EINTPEND),
621 s3c_irqwake_eintmask);
622
623 DBG("post sleep, preparing to return\n");
624
625 s3c2410_pm_check_restore();
626
627 /* ok, let's return from sleep */
628
629 DBG("S3C2410 PM Resume (post-restore)\n");
630 return 0;
631}
632
633/*
634 * Called after processes are frozen, but before we shut down devices.
635 */
636static int s3c2410_pm_prepare(suspend_state_t state)
637{
638 return 0;
639}
640
641/*
642 * Called after devices are re-setup, but before processes are thawed.
643 */
644static int s3c2410_pm_finish(suspend_state_t state)
645{
646 return 0;
647}
648
649/*
650 * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk.
651 */
652static struct pm_ops s3c2410_pm_ops = {
653 .pm_disk_mode = PM_DISK_FIRMWARE,
654 .prepare = s3c2410_pm_prepare,
655 .enter = s3c2410_pm_enter,
656 .finish = s3c2410_pm_finish,
657};
658
659/* s3c2410_pm_init
660 *
661 * Attach the power management functions. This should be called
662 * from the board specific initialisation if the board supports
663 * it.
664*/
665
666int __init s3c2410_pm_init(void)
667{
668 printk("S3C2410 Power Management, (c) 2004 Simtec Electronics\n");
669
670 pm_set_ops(&s3c2410_pm_ops);
671 return 0;
672}
diff --git a/arch/arm/mach-s3c2410/pm.h b/arch/arm/mach-s3c2410/pm.h
new file mode 100644
index 000000000000..7a5e714c7386
--- /dev/null
+++ b/arch/arm/mach-s3c2410/pm.h
@@ -0,0 +1,59 @@
1/* linux/arch/arm/mach-s3c2410/pm.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Written by Ben Dooks, <ben@simtec.co.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11/* s3c2410_pm_init
12 *
13 * called from board at initialisation time to setup the power
14 * management
15*/
16
17#ifdef CONFIG_PM
18
19extern __init int s3c2410_pm_init(void);
20
21#else
22
23static inline int s3c2410_pm_init(void)
24{
25 return 0;
26}
27#endif
28
29/* configuration for the IRQ mask over sleep */
30extern unsigned long s3c_irqwake_intmask;
31extern unsigned long s3c_irqwake_eintmask;
32
33/* IRQ masks for IRQs allowed to go to sleep (see irq.c) */
34extern unsigned long s3c_irqwake_intallow;
35extern unsigned long s3c_irqwake_eintallow;
36
37/* Flags for PM Control */
38
39extern unsigned long s3c_pm_flags;
40
41/* from sleep.S */
42
43extern void s3c2410_cpu_suspend(unsigned long *saveblk);
44extern void s3c2410_cpu_resume(void);
45
46extern unsigned long s3c2410_sleep_save_phys;
47
48/* sleep save info */
49
50struct sleep_save {
51 void __iomem *reg;
52 unsigned long val;
53};
54
55#define SAVE_ITEM(x) \
56 { .reg = (x) }
57
58extern void s3c2410_pm_do_save(struct sleep_save *ptr, int count);
59extern void s3c2410_pm_do_restore(struct sleep_save *ptr, int count);
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c
new file mode 100644
index 000000000000..ff2f25409e44
--- /dev/null
+++ b/arch/arm/mach-s3c2410/s3c2410.c
@@ -0,0 +1,200 @@
1/* linux/arch/arm/mach-s3c2410/s3c2410.c
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13 * 16-May-2003 BJD Created initial version
14 * 16-Aug-2003 BJD Fixed header files and copyright, added URL
15 * 05-Sep-2003 BJD Moved to kernel v2.6
16 * 18-Jan-2004 BJD Added serial port configuration
17 * 21-Aug-2004 BJD Added new struct s3c2410_board handler
18 * 28-Sep-2004 BJD Updates for new serial port bits
19 * 04-Nov-2004 BJD Updated UART configuration process
20 * 10-Jan-2005 BJD Removed s3c2410_clock_tick_rate
21*/
22
23#include <linux/kernel.h>
24#include <linux/types.h>
25#include <linux/interrupt.h>
26#include <linux/list.h>
27#include <linux/timer.h>
28#include <linux/init.h>
29#include <linux/device.h>
30
31#include <asm/mach/arch.h>
32#include <asm/mach/map.h>
33#include <asm/mach/irq.h>
34
35#include <asm/hardware.h>
36#include <asm/io.h>
37#include <asm/irq.h>
38
39#include <asm/arch/regs-clock.h>
40#include <asm/arch/regs-serial.h>
41
42#include "s3c2410.h"
43#include "cpu.h"
44#include "clock.h"
45
46/* Initial IO mappings */
47
48static struct map_desc s3c2410_iodesc[] __initdata = {
49 IODESC_ENT(USBHOST),
50 IODESC_ENT(CLKPWR),
51 IODESC_ENT(LCD),
52 IODESC_ENT(UART),
53 IODESC_ENT(TIMER),
54 IODESC_ENT(ADC),
55 IODESC_ENT(WATCHDOG)
56};
57
58static struct resource s3c_uart0_resource[] = {
59 [0] = {
60 .start = S3C2410_PA_UART0,
61 .end = S3C2410_PA_UART0 + 0x3fff,
62 .flags = IORESOURCE_MEM,
63 },
64 [1] = {
65 .start = IRQ_S3CUART_RX0,
66 .end = IRQ_S3CUART_ERR0,
67 .flags = IORESOURCE_IRQ,
68 }
69
70};
71
72static struct resource s3c_uart1_resource[] = {
73 [0] = {
74 .start = S3C2410_PA_UART1,
75 .end = S3C2410_PA_UART1 + 0x3fff,
76 .flags = IORESOURCE_MEM,
77 },
78 [1] = {
79 .start = IRQ_S3CUART_RX1,
80 .end = IRQ_S3CUART_ERR1,
81 .flags = IORESOURCE_IRQ,
82 }
83};
84
85static struct resource s3c_uart2_resource[] = {
86 [0] = {
87 .start = S3C2410_PA_UART2,
88 .end = S3C2410_PA_UART2 + 0x3fff,
89 .flags = IORESOURCE_MEM,
90 },
91 [1] = {
92 .start = IRQ_S3CUART_RX2,
93 .end = IRQ_S3CUART_ERR2,
94 .flags = IORESOURCE_IRQ,
95 }
96};
97
98/* our uart devices */
99
100static struct platform_device s3c_uart0 = {
101 .name = "s3c2410-uart",
102 .id = 0,
103 .num_resources = ARRAY_SIZE(s3c_uart0_resource),
104 .resource = s3c_uart0_resource,
105};
106
107
108static struct platform_device s3c_uart1 = {
109 .name = "s3c2410-uart",
110 .id = 1,
111 .num_resources = ARRAY_SIZE(s3c_uart1_resource),
112 .resource = s3c_uart1_resource,
113};
114
115static struct platform_device s3c_uart2 = {
116 .name = "s3c2410-uart",
117 .id = 2,
118 .num_resources = ARRAY_SIZE(s3c_uart2_resource),
119 .resource = s3c_uart2_resource,
120};
121
122static struct platform_device *uart_devices[] __initdata = {
123 &s3c_uart0,
124 &s3c_uart1,
125 &s3c_uart2
126};
127
128/* store our uart devices for the serial driver console */
129struct platform_device *s3c2410_uart_devices[3];
130
131static int s3c2410_uart_count = 0;
132
133/* uart registration process */
134
135void __init s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no)
136{
137 struct platform_device *platdev;
138 int uart;
139
140 for (uart = 0; uart < no; uart++, cfg++) {
141 platdev = uart_devices[cfg->hwport];
142
143 s3c24xx_uart_devs[uart] = platdev;
144 platdev->dev.platform_data = cfg;
145 }
146
147 s3c2410_uart_count = uart;
148}
149
150/* s3c2410_map_io
151 *
152 * register the standard cpu IO areas, and any passed in from the
153 * machine specific initialisation.
154*/
155
156void __init s3c2410_map_io(struct map_desc *mach_desc, int mach_size)
157{
158 /* register our io-tables */
159
160 iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc));
161 iotable_init(mach_desc, mach_size);
162}
163
164void __init s3c2410_init_clocks(int xtal)
165{
166 unsigned long tmp;
167 unsigned long fclk;
168 unsigned long hclk;
169 unsigned long pclk;
170
171 /* now we've got our machine bits initialised, work out what
172 * clocks we've got */
173
174 fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON), xtal);
175
176 tmp = __raw_readl(S3C2410_CLKDIVN);
177
178 /* work out clock scalings */
179
180 hclk = fclk / ((tmp & S3C2410_CLKDIVN_HDIVN) ? 2 : 1);
181 pclk = hclk / ((tmp & S3C2410_CLKDIVN_PDIVN) ? 2 : 1);
182
183 /* print brieft summary of clocks, etc */
184
185 printk("S3C2410: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n",
186 print_mhz(fclk), print_mhz(hclk), print_mhz(pclk));
187
188 /* initialise the clocks here, to allow other things like the
189 * console to use them
190 */
191
192 s3c24xx_setup_clocks(xtal, fclk, hclk, pclk);
193}
194
195int __init s3c2410_init(void)
196{
197 printk("S3C2410: Initialising architecture\n");
198
199 return platform_add_devices(s3c24xx_uart_devs, s3c2410_uart_count);
200}
diff --git a/arch/arm/mach-s3c2410/s3c2410.h b/arch/arm/mach-s3c2410/s3c2410.h
new file mode 100644
index 000000000000..4d5312a48209
--- /dev/null
+++ b/arch/arm/mach-s3c2410/s3c2410.h
@@ -0,0 +1,37 @@
1/* arch/arm/mach-s3c2410/s3c2410.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for s3c2410 machine directory
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13 * 18-Aug-2004 BJD Created initial version
14 * 20-Aug-2004 BJD Added s3c2410_board struct
15 * 04-Sep-2004 BJD Added s3c2410_init_uarts() call
16 * 17-Oct-2004 BJD Moved board out to cpu
17 * 04-Jan-2005 BJD Changed uart init
18 * 10-Jan-2005 BJD Removed timer to cpu.h, moved 2410 specific bits here
19 * 14-Jan-2005 BJD Added s3c2410_init_clocks call
20*/
21
22#ifdef CONFIG_CPU_S3C2410
23
24extern int s3c2410_init(void);
25
26extern void s3c2410_map_io(struct map_desc *mach_desc, int size);
27
28extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no);
29
30extern void s3c2410_init_clocks(int xtal);
31
32#else
33#define s3c2410_init_clocks NULL
34#define s3c2410_init_uarts NULL
35#define s3c2410_map_io NULL
36#define s3c2410_init NULL
37#endif
diff --git a/arch/arm/mach-s3c2410/s3c2440-dsc.c b/arch/arm/mach-s3c2410/s3c2440-dsc.c
new file mode 100644
index 000000000000..16fa2a3b38fa
--- /dev/null
+++ b/arch/arm/mach-s3c2410/s3c2440-dsc.c
@@ -0,0 +1,59 @@
1/* linux/arch/arm/mach-s3c2410/s3c2440-dsc.c
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Samsung S3C2440 Drive Strength Control support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13 * 29-Aug-2004 BJD Start of drive-strength control
14 * 09-Nov-2004 BJD Added symbol export
15 * 11-Jan-2005 BJD Include fix
16*/
17
18#include <linux/kernel.h>
19#include <linux/types.h>
20#include <linux/interrupt.h>
21#include <linux/init.h>
22#include <linux/module.h>
23
24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
26#include <asm/mach/irq.h>
27
28#include <asm/hardware.h>
29#include <asm/io.h>
30#include <asm/irq.h>
31
32#include <asm/arch/regs-gpio.h>
33#include <asm/arch/regs-dsc.h>
34
35#include "cpu.h"
36#include "s3c2440.h"
37
38int s3c2440_set_dsc(unsigned int pin, unsigned int value)
39{
40 void __iomem *base;
41 unsigned long val;
42 unsigned long flags;
43 unsigned long mask;
44
45 base = (pin & S3C2440_SELECT_DSC1) ? S3C2440_DSC1 : S3C2440_DSC0;
46 mask = 3 << S3C2440_DSC_GETSHIFT(pin);
47
48 local_irq_save(flags);
49
50 val = __raw_readl(base);
51 val &= ~mask;
52 val |= value & mask;
53 __raw_writel(val, base);
54
55 local_irq_restore(flags);
56 return 0;
57}
58
59EXPORT_SYMBOL(s3c2440_set_dsc);
diff --git a/arch/arm/mach-s3c2410/s3c2440.c b/arch/arm/mach-s3c2410/s3c2440.c
new file mode 100644
index 000000000000..9a8cc5ae2255
--- /dev/null
+++ b/arch/arm/mach-s3c2410/s3c2440.c
@@ -0,0 +1,281 @@
1/* linux/arch/arm/mach-s3c2410/s3c2440.c
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Samsung S3C2440 Mobile CPU support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13 * 24-Aug-2004 BJD Start of s3c2440 support
14 * 12-Oct-2004 BJD Moved clock info out to clock.c
15 * 01-Nov-2004 BJD Fixed clock build code
16 * 09-Nov-2004 BJD Added sysdev for power management
17 * 04-Nov-2004 BJD New serial registration
18 * 15-Nov-2004 BJD Rename the i2c device for the s3c2440
19 * 14-Jan-2005 BJD Moved clock init code into seperate function
20 * 14-Jan-2005 BJD Removed un-used clock bits
21*/
22
23#include <linux/kernel.h>
24#include <linux/types.h>
25#include <linux/interrupt.h>
26#include <linux/list.h>
27#include <linux/timer.h>
28#include <linux/init.h>
29#include <linux/device.h>
30#include <linux/sysdev.h>
31
32#include <asm/mach/arch.h>
33#include <asm/mach/map.h>
34#include <asm/mach/irq.h>
35
36#include <asm/hardware.h>
37#include <asm/io.h>
38#include <asm/irq.h>
39#include <asm/hardware/clock.h>
40
41#include <asm/arch/regs-clock.h>
42#include <asm/arch/regs-serial.h>
43#include <asm/arch/regs-gpio.h>
44#include <asm/arch/regs-gpioj.h>
45#include <asm/arch/regs-dsc.h>
46
47#include "s3c2440.h"
48#include "clock.h"
49#include "devs.h"
50#include "cpu.h"
51#include "pm.h"
52
53
54static struct map_desc s3c2440_iodesc[] __initdata = {
55 IODESC_ENT(USBHOST),
56 IODESC_ENT(CLKPWR),
57 IODESC_ENT(LCD),
58 IODESC_ENT(TIMER),
59 IODESC_ENT(ADC),
60 IODESC_ENT(WATCHDOG),
61};
62
63static struct resource s3c_uart0_resource[] = {
64 [0] = {
65 .start = S3C2410_PA_UART0,
66 .end = S3C2410_PA_UART0 + 0x3fff,
67 .flags = IORESOURCE_MEM,
68 },
69 [1] = {
70 .start = IRQ_S3CUART_RX0,
71 .end = IRQ_S3CUART_ERR0,
72 .flags = IORESOURCE_IRQ,
73 }
74
75};
76
77static struct resource s3c_uart1_resource[] = {
78 [0] = {
79 .start = S3C2410_PA_UART1,
80 .end = S3C2410_PA_UART1 + 0x3fff,
81 .flags = IORESOURCE_MEM,
82 },
83 [1] = {
84 .start = IRQ_S3CUART_RX1,
85 .end = IRQ_S3CUART_ERR1,
86 .flags = IORESOURCE_IRQ,
87 }
88};
89
90static struct resource s3c_uart2_resource[] = {
91 [0] = {
92 .start = S3C2410_PA_UART2,
93 .end = S3C2410_PA_UART2 + 0x3fff,
94 .flags = IORESOURCE_MEM,
95 },
96 [1] = {
97 .start = IRQ_S3CUART_RX2,
98 .end = IRQ_S3CUART_ERR2,
99 .flags = IORESOURCE_IRQ,
100 }
101};
102
103/* our uart devices */
104
105static struct platform_device s3c_uart0 = {
106 .name = "s3c2440-uart",
107 .id = 0,
108 .num_resources = ARRAY_SIZE(s3c_uart0_resource),
109 .resource = s3c_uart0_resource,
110};
111
112static struct platform_device s3c_uart1 = {
113 .name = "s3c2440-uart",
114 .id = 1,
115 .num_resources = ARRAY_SIZE(s3c_uart1_resource),
116 .resource = s3c_uart1_resource,
117};
118
119static struct platform_device s3c_uart2 = {
120 .name = "s3c2440-uart",
121 .id = 2,
122 .num_resources = ARRAY_SIZE(s3c_uart2_resource),
123 .resource = s3c_uart2_resource,
124};
125
126static struct platform_device *uart_devices[] __initdata = {
127 &s3c_uart0,
128 &s3c_uart1,
129 &s3c_uart2
130};
131
132/* uart initialisation */
133
134static int __initdata s3c2440_uart_count;
135
136void __init s3c2440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
137{
138 struct platform_device *platdev;
139 int uart;
140
141 for (uart = 0; uart < no; uart++, cfg++) {
142 platdev = uart_devices[cfg->hwport];
143
144 s3c24xx_uart_devs[uart] = platdev;
145 platdev->dev.platform_data = cfg;
146 }
147
148 s3c2440_uart_count = uart;
149}
150
151
152#ifdef CONFIG_PM
153
154struct sleep_save s3c2440_sleep[] = {
155 SAVE_ITEM(S3C2440_DSC0),
156 SAVE_ITEM(S3C2440_DSC1),
157 SAVE_ITEM(S3C2440_GPJDAT),
158 SAVE_ITEM(S3C2440_GPJCON),
159 SAVE_ITEM(S3C2440_GPJUP)
160};
161
162static int s3c2440_suspend(struct sys_device *dev, pm_message_t state)
163{
164 s3c2410_pm_do_save(s3c2440_sleep, ARRAY_SIZE(s3c2440_sleep));
165 return 0;
166}
167
168static int s3c2440_resume(struct sys_device *dev)
169{
170 s3c2410_pm_do_restore(s3c2440_sleep, ARRAY_SIZE(s3c2440_sleep));
171 return 0;
172}
173
174#else
175#define s3c2440_suspend NULL
176#define s3c2440_resume NULL
177#endif
178
179struct sysdev_class s3c2440_sysclass = {
180 set_kset_name("s3c2440-core"),
181 .suspend = s3c2440_suspend,
182 .resume = s3c2440_resume
183};
184
185static struct sys_device s3c2440_sysdev = {
186 .cls = &s3c2440_sysclass,
187};
188
189void __init s3c2440_map_io(struct map_desc *mach_desc, int size)
190{
191 /* register our io-tables */
192
193 iotable_init(s3c2440_iodesc, ARRAY_SIZE(s3c2440_iodesc));
194 iotable_init(mach_desc, size);
195 /* rename any peripherals used differing from the s3c2410 */
196
197 s3c_device_i2c.name = "s3c2440-i2c";
198
199 /* change irq for watchdog */
200
201 s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT;
202 s3c_device_wdt.resource[1].end = IRQ_S3C2440_WDT;
203}
204
205void __init s3c2440_init_clocks(int xtal)
206{
207 unsigned long clkdiv;
208 unsigned long camdiv;
209 unsigned long hclk, fclk, pclk;
210 int hdiv = 1;
211
212 /* now we've got our machine bits initialised, work out what
213 * clocks we've got */
214
215 fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON), xtal) * 2;
216
217 clkdiv = __raw_readl(S3C2410_CLKDIVN);
218 camdiv = __raw_readl(S3C2440_CAMDIVN);
219
220 /* work out clock scalings */
221
222 switch (clkdiv & S3C2440_CLKDIVN_HDIVN_MASK) {
223 case S3C2440_CLKDIVN_HDIVN_1:
224 hdiv = 1;
225 break;
226
227 case S3C2440_CLKDIVN_HDIVN_2:
228 hdiv = 1;
229 break;
230
231 case S3C2440_CLKDIVN_HDIVN_4_8:
232 hdiv = (camdiv & S3C2440_CAMDIVN_HCLK4_HALF) ? 8 : 4;
233 break;
234
235 case S3C2440_CLKDIVN_HDIVN_3_6:
236 hdiv = (camdiv & S3C2440_CAMDIVN_HCLK3_HALF) ? 6 : 3;
237 break;
238 }
239
240 hclk = fclk / hdiv;
241 pclk = hclk / ((clkdiv & S3C2440_CLKDIVN_PDIVN)? 2:1);
242
243 /* print brief summary of clocks, etc */
244
245 printk("S3C2440: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n",
246 print_mhz(fclk), print_mhz(hclk), print_mhz(pclk));
247
248 /* initialise the clocks here, to allow other things like the
249 * console to use them, and to add new ones after the initialisation
250 */
251
252 s3c24xx_setup_clocks(xtal, fclk, hclk, pclk);
253}
254
255/* need to register class before we actually register the device, and
256 * we also need to ensure that it has been initialised before any of the
257 * drivers even try to use it (even if not on an s3c2440 based system)
258 * as a driver which may support both 2410 and 2440 may try and use it.
259*/
260
261int __init s3c2440_core_init(void)
262{
263 return sysdev_class_register(&s3c2440_sysclass);
264}
265
266core_initcall(s3c2440_core_init);
267
268int __init s3c2440_init(void)
269{
270 int ret;
271
272 printk("S3C2440: Initialising architecture\n");
273
274 ret = sysdev_register(&s3c2440_sysdev);
275 if (ret != 0)
276 printk(KERN_ERR "failed to register sysdev for s3c2440\n");
277 else
278 ret = platform_add_devices(s3c24xx_uart_devs, s3c2440_uart_count);
279
280 return ret;
281}
diff --git a/arch/arm/mach-s3c2410/s3c2440.h b/arch/arm/mach-s3c2410/s3c2440.h
new file mode 100644
index 000000000000..29cb6df65a48
--- /dev/null
+++ b/arch/arm/mach-s3c2410/s3c2440.h
@@ -0,0 +1,35 @@
1/* arch/arm/mach-s3c2410/s3c2440.h
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for s3c2440 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13 * 24-Aug-2004 BJD Start of S3C2440 CPU support
14 * 04-Nov-2004 BJD Added s3c2440_init_uarts()
15 * 04-Jan-2005 BJD Moved uart init to cpu code
16 * 10-Jan-2005 BJD Moved 2440 specific init here
17 * 14-Jan-2005 BJD Split the clock initialisation code
18*/
19
20#ifdef CONFIG_CPU_S3C2440
21
22extern int s3c2440_init(void);
23
24extern void s3c2440_map_io(struct map_desc *mach_desc, int size);
25
26extern void s3c2440_init_uarts(struct s3c2410_uartcfg *cfg, int no);
27
28extern void s3c2440_init_clocks(int xtal);
29
30#else
31#define s3c2440_init_clocks NULL
32#define s3c2440_init_uarts NULL
33#define s3c2440_map_io NULL
34#define s3c2440_init NULL
35#endif
diff --git a/arch/arm/mach-s3c2410/sleep.S b/arch/arm/mach-s3c2410/sleep.S
new file mode 100644
index 000000000000..61768dac7fee
--- /dev/null
+++ b/arch/arm/mach-s3c2410/sleep.S
@@ -0,0 +1,180 @@
1/* linux/arch/arm/mach-s3c2410/sleep.S
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 Power Manager (Suspend-To-RAM) support
7 *
8 * Based on PXA/SA1100 sleep code by:
9 * Nicolas Pitre, (c) 2002 Monta Vista Software Inc
10 * Cliff Brake, (c) 2001
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25*/
26
27#include <linux/config.h>
28#include <linux/linkage.h>
29#include <asm/assembler.h>
30#include <asm/hardware.h>
31#include <asm/arch/map.h>
32
33#include <asm/arch/regs-gpio.h>
34#include <asm/arch/regs-clock.h>
35#include <asm/arch/regs-mem.h>
36#include <asm/arch/regs-serial.h>
37
38/* CONFIG_DEBUG_RESUME is dangerous if your bootloader does not
39 * reset the UART configuration, only enable if you really need this!
40*/
41//#define CONFIG_DEBUG_RESUME
42
43 .text
44
45 /* s3c2410_cpu_suspend
46 *
47 * put the cpu into sleep mode
48 *
49 * entry:
50 * r0 = sleep save block
51 */
52
53ENTRY(s3c2410_cpu_suspend)
54 stmfd sp!, { r4 - r12, lr }
55
56 @@ store co-processor registers
57
58 mrc p15, 0, r4, c15, c1, 0 @ CP access register
59 mrc p15, 0, r5, c13, c0, 0 @ PID
60 mrc p15, 0, r6, c3, c0, 0 @ Domain ID
61 mrc p15, 0, r7, c2, c0, 0 @ translation table base address
62 mrc p15, 0, r8, c2, c0, 0 @ auxiliary control register
63 mrc p15, 0, r9, c1, c0, 0 @ control register
64
65 stmia r0, { r4 - r13 }
66
67 @@ flush the caches to ensure everything is back out to
68 @@ SDRAM before the core powers down
69
70 bl arm920_flush_kern_cache_all
71
72 @@ prepare cpu to sleep
73
74 ldr r4, =S3C2410_REFRESH
75 ldr r5, =S3C2410_MISCCR
76 ldr r6, =S3C2410_CLKCON
77 ldr r7, [ r4 ] @ get REFRESH (and ensure in TLB)
78 ldr r8, [ r5 ] @ get MISCCR (and ensure in TLB)
79 ldr r9, [ r6 ] @ get CLKCON (and ensure in TLB)
80
81 orr r7, r7, #S3C2410_REFRESH_SELF @ SDRAM sleep command
82 orr r8, r8, #S3C2410_MISCCR_SDSLEEP @ SDRAM power-down signals
83 orr r9, r9, #S3C2410_CLKCON_POWER @ power down command
84
85 teq pc, #0 @ first as a trial-run to load cache
86 bl s3c2410_do_sleep
87 teq r0, r0 @ now do it for real
88 b s3c2410_do_sleep @
89
90 @@ align next bit of code to cache line
91 .align 8
92s3c2410_do_sleep:
93 streq r7, [ r4 ] @ SDRAM sleep command
94 streq r8, [ r5 ] @ SDRAM power-down config
95 streq r9, [ r6 ] @ CPU sleep
961: beq 1b
97 mov pc, r14
98
99 @@ return to the caller, after having the MMU
100 @@ turned on, this restores the last bits from the
101 @@ stack
102resume_with_mmu:
103 ldmfd sp!, { r4 - r12, pc }
104
105 .ltorg
106
107 @@ the next bits sit in the .data segment, even though they
108 @@ happen to be code... the s3c2410_sleep_save_phys needs to be
109 @@ accessed by the resume code before it can restore the MMU.
110 @@ This means that the variable has to be close enough for the
111 @@ code to read it... since the .text segment needs to be RO,
112 @@ the data segment can be the only place to put this code.
113
114 .data
115
116 .global s3c2410_sleep_save_phys
117s3c2410_sleep_save_phys:
118 .word 0
119
120 /* s3c2410_cpu_resume
121 *
122 * resume code entry for bootloader to call
123 *
124 * we must put this code here in the data segment as we have no
125 * other way of restoring the stack pointer after sleep, and we
126 * must not write to the code segment (code is read-only)
127 */
128
129ENTRY(s3c2410_cpu_resume)
130 mov r0, #PSR_I_BIT | PSR_F_BIT | MODE_SVC
131 msr cpsr_c, r0
132
133 @@ load UART to allow us to print the two characters for
134 @@ resume debug
135
136 mov r2, #S3C2410_PA_UART & 0xff000000
137 orr r2, r2, #S3C2410_PA_UART & 0xff000
138
139#if 0
140 /* SMDK2440 LED set */
141 mov r14, #S3C2410_PA_GPIO
142 ldr r12, [ r14, #0x54 ]
143 bic r12, r12, #3<<4
144 orr r12, r12, #1<<7
145 str r12, [ r14, #0x54 ]
146#endif
147
148#ifdef CONFIG_DEBUG_RESUME
149 mov r3, #'L'
150 strb r3, [ r2, #S3C2410_UTXH ]
1511001:
152 ldrb r14, [ r3, #S3C2410_UTRSTAT ]
153 tst r14, #S3C2410_UTRSTAT_TXE
154 beq 1001b
155#endif /* CONFIG_DEBUG_RESUME */
156
157 mov r1, #0
158 mcr p15, 0, r1, c8, c7, 0 @@ invalidate I & D TLBs
159 mcr p15, 0, r1, c7, c7, 0 @@ invalidate I & D caches
160
161 ldr r0, s3c2410_sleep_save_phys @ address of restore block
162 ldmia r0, { r4 - r13 }
163
164 mcr p15, 0, r4, c15, c1, 0 @ CP access register
165 mcr p15, 0, r5, c13, c0, 0 @ PID
166 mcr p15, 0, r6, c3, c0, 0 @ Domain ID
167 mcr p15, 0, r7, c2, c0, 0 @ translation table base
168 mcr p15, 0, r8, c1, c1, 0 @ auxilliary control
169
170#ifdef CONFIG_DEBUG_RESUME
171 mov r3, #'R'
172 strb r3, [ r2, #S3C2410_UTXH ]
173#endif
174
175 ldr r2, =resume_with_mmu
176 mcr p15, 0, r9, c1, c0, 0 @ turn on MMU, etc
177 nop @ second-to-last before mmu
178 mov pc, r2 @ go back to virtual address
179
180 .ltorg
diff --git a/arch/arm/mach-s3c2410/time.c b/arch/arm/mach-s3c2410/time.c
new file mode 100644
index 000000000000..179f0e031af4
--- /dev/null
+++ b/arch/arm/mach-s3c2410/time.c
@@ -0,0 +1,256 @@
1/* linux/arch/arm/mach-s3c2410/time.c
2 *
3 * Copyright (C) 2003-2005 Simtec Electronics
4 * Ben Dooks, <ben@simtec.co.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/config.h>
22#include <linux/kernel.h>
23#include <linux/sched.h>
24#include <linux/init.h>
25#include <linux/interrupt.h>
26#include <linux/err.h>
27
28#include <asm/system.h>
29#include <asm/leds.h>
30#include <asm/mach-types.h>
31
32#include <asm/io.h>
33#include <asm/irq.h>
34#include <asm/arch/map.h>
35#include <asm/arch/regs-timer.h>
36#include <asm/arch/regs-irq.h>
37#include <asm/mach/time.h>
38#include <asm/hardware/clock.h>
39
40#include "clock.h"
41
42static unsigned long timer_startval;
43static unsigned long timer_usec_ticks;
44
45#define TIMER_USEC_SHIFT 16
46
47/* we use the shifted arithmetic to work out the ratio of timer ticks
48 * to usecs, as often the peripheral clock is not a nice even multiple
49 * of 1MHz.
50 *
51 * shift of 14 and 15 are too low for the 12MHz, 16 seems to be ok
52 * for the current HZ value of 200 without producing overflows.
53 *
54 * Original patch by Dimitry Andric, updated by Ben Dooks
55*/
56
57
58/* timer_mask_usec_ticks
59 *
60 * given a clock and divisor, make the value to pass into timer_ticks_to_usec
61 * to scale the ticks into usecs
62*/
63
64static inline unsigned long
65timer_mask_usec_ticks(unsigned long scaler, unsigned long pclk)
66{
67 unsigned long den = pclk / 1000;
68
69 return ((1000 << TIMER_USEC_SHIFT) * scaler + (den >> 1)) / den;
70}
71
72/* timer_ticks_to_usec
73 *
74 * convert timer ticks to usec.
75*/
76
77static inline unsigned long timer_ticks_to_usec(unsigned long ticks)
78{
79 unsigned long res;
80
81 res = ticks * timer_usec_ticks;
82 res += 1 << (TIMER_USEC_SHIFT - 4); /* round up slightly */
83
84 return res >> TIMER_USEC_SHIFT;
85}
86
87/***
88 * Returns microsecond since last clock interrupt. Note that interrupts
89 * will have been disabled by do_gettimeoffset()
90 * IRQs are disabled before entering here from do_gettimeofday()
91 */
92
93#define SRCPND_TIMER4 (1<<(IRQ_TIMER4 - IRQ_EINT0))
94
95static unsigned long s3c2410_gettimeoffset (void)
96{
97 unsigned long tdone;
98 unsigned long irqpend;
99 unsigned long tval;
100
101 /* work out how many ticks have gone since last timer interrupt */
102
103 tval = __raw_readl(S3C2410_TCNTO(4));
104 tdone = timer_startval - tval;
105
106 /* check to see if there is an interrupt pending */
107
108 irqpend = __raw_readl(S3C2410_SRCPND);
109 if (irqpend & SRCPND_TIMER4) {
110 /* re-read the timer, and try and fix up for the missed
111 * interrupt. Note, the interrupt may go off before the
112 * timer has re-loaded from wrapping.
113 */
114
115 tval = __raw_readl(S3C2410_TCNTO(4));
116 tdone = timer_startval - tval;
117
118 if (tval != 0)
119 tdone += timer_startval;
120 }
121
122 return timer_ticks_to_usec(tdone);
123}
124
125
126/*
127 * IRQ handler for the timer
128 */
129static irqreturn_t
130s3c2410_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
131{
132 write_seqlock(&xtime_lock);
133 timer_tick(regs);
134 write_sequnlock(&xtime_lock);
135 return IRQ_HANDLED;
136}
137
138static struct irqaction s3c2410_timer_irq = {
139 .name = "S3C2410 Timer Tick",
140 .flags = SA_INTERRUPT,
141 .handler = s3c2410_timer_interrupt
142};
143
144/*
145 * Set up timer interrupt, and return the current time in seconds.
146 *
147 * Currently we only use timer4, as it is the only timer which has no
148 * other function that can be exploited externally
149 */
150static void s3c2410_timer_setup (void)
151{
152 unsigned long tcon;
153 unsigned long tcnt;
154 unsigned long tcfg1;
155 unsigned long tcfg0;
156
157 tcnt = 0xffff; /* default value for tcnt */
158
159 /* read the current timer configuration bits */
160
161 tcon = __raw_readl(S3C2410_TCON);
162 tcfg1 = __raw_readl(S3C2410_TCFG1);
163 tcfg0 = __raw_readl(S3C2410_TCFG0);
164
165 /* configure the system for whichever machine is in use */
166
167 if (machine_is_bast() || machine_is_vr1000()) {
168 /* timer is at 12MHz, scaler is 1 */
169 timer_usec_ticks = timer_mask_usec_ticks(1, 12000000);
170 tcnt = 12000000 / HZ;
171
172 tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK;
173 tcfg1 |= S3C2410_TCFG1_MUX4_TCLK1;
174 } else {
175 unsigned long pclk;
176 struct clk *clk;
177
178 /* for the h1940 (and others), we use the pclk from the core
179 * to generate the timer values. since values around 50 to
180 * 70MHz are not values we can directly generate the timer
181 * value from, we need to pre-scale and divide before using it.
182 *
183 * for instance, using 50.7MHz and dividing by 6 gives 8.45MHz
184 * (8.45 ticks per usec)
185 */
186
187 /* this is used as default if no other timer can be found */
188
189 clk = clk_get(NULL, "timers");
190 if (IS_ERR(clk))
191 panic("failed to get clock for system timer");
192
193 clk_use(clk);
194 clk_enable(clk);
195
196 pclk = clk_get_rate(clk);
197
198 /* configure clock tick */
199
200 timer_usec_ticks = timer_mask_usec_ticks(6, pclk);
201
202 tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK;
203 tcfg1 |= S3C2410_TCFG1_MUX4_DIV2;
204
205 tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK;
206 tcfg0 |= ((6 - 1) / 2) << S3C2410_TCFG_PRESCALER1_SHIFT;
207
208 tcnt = (pclk / 6) / HZ;
209 }
210
211 /* timers reload after counting zero, so reduce the count by 1 */
212
213 tcnt--;
214
215 printk("timer tcon=%08lx, tcnt %04lx, tcfg %08lx,%08lx, usec %08lx\n",
216 tcon, tcnt, tcfg0, tcfg1, timer_usec_ticks);
217
218 /* check to see if timer is within 16bit range... */
219 if (tcnt > 0xffff) {
220 panic("setup_timer: HZ is too small, cannot configure timer!");
221 return;
222 }
223
224 __raw_writel(tcfg1, S3C2410_TCFG1);
225 __raw_writel(tcfg0, S3C2410_TCFG0);
226
227 timer_startval = tcnt;
228 __raw_writel(tcnt, S3C2410_TCNTB(4));
229
230 /* ensure timer is stopped... */
231
232 tcon &= ~(7<<20);
233 tcon |= S3C2410_TCON_T4RELOAD;
234 tcon |= S3C2410_TCON_T4MANUALUPD;
235
236 __raw_writel(tcon, S3C2410_TCON);
237 __raw_writel(tcnt, S3C2410_TCNTB(4));
238 __raw_writel(tcnt, S3C2410_TCMPB(4));
239
240 /* start the timer running */
241 tcon |= S3C2410_TCON_T4START;
242 tcon &= ~S3C2410_TCON_T4MANUALUPD;
243 __raw_writel(tcon, S3C2410_TCON);
244}
245
246static void __init s3c2410_timer_init (void)
247{
248 s3c2410_timer_setup();
249 setup_irq(IRQ_TIMER4, &s3c2410_timer_irq);
250}
251
252struct sys_timer s3c24xx_timer = {
253 .init = s3c2410_timer_init,
254 .offset = s3c2410_gettimeoffset,
255 .resume = s3c2410_timer_setup
256};
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c
new file mode 100644
index 000000000000..7f2b61362976
--- /dev/null
+++ b/arch/arm/mach-s3c2410/usb-simtec.c
@@ -0,0 +1,113 @@
1/* linux/arch/arm/mach-s3c2410/usb-simtec.c
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/
7 *
8 * Simtec BAST and Thorcom VR1000 USB port support functions
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * Modifications:
15 * 14-Sep-2004 BJD Created
16 * 18-Oct-2004 BJD Cleanups, and added code to report OC cleared
17*/
18
19#define DEBUG
20
21#include <linux/kernel.h>
22#include <linux/types.h>
23#include <linux/interrupt.h>
24#include <linux/list.h>
25#include <linux/timer.h>
26#include <linux/init.h>
27#include <linux/device.h>
28
29#include <asm/mach/arch.h>
30#include <asm/mach/map.h>
31#include <asm/mach/irq.h>
32
33#include <asm/arch/bast-map.h>
34#include <asm/arch/bast-irq.h>
35#include <asm/arch/usb-control.h>
36#include <asm/arch/regs-gpio.h>
37
38#include <asm/hardware.h>
39#include <asm/io.h>
40#include <asm/irq.h>
41#include <asm/mach-types.h>
42
43#include "devs.h"
44#include "usb-simtec.h"
45
46/* control power and monitor over-current events on various Simtec
47 * designed boards.
48*/
49
50static void
51usb_simtec_powercontrol(int port, int to)
52{
53 pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to);
54
55 if (port == 1)
56 s3c2410_gpio_setpin(S3C2410_GPB4, to ? 0:1);
57}
58
59static irqreturn_t
60usb_simtec_ocirq(int irq, void *pw, struct pt_regs *regs)
61{
62 struct s3c2410_hcd_info *info = (struct s3c2410_hcd_info *)pw;
63
64 if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) {
65 pr_debug("usb_simtec: over-current irq (oc detected)\n");
66 s3c2410_report_oc(info, 3);
67 } else {
68 pr_debug("usb_simtec: over-current irq (oc cleared)\n");
69 s3c2410_report_oc(info, 0);
70 }
71
72 return IRQ_HANDLED;
73}
74
75static void usb_simtec_enableoc(struct s3c2410_hcd_info *info, int on)
76{
77 int ret;
78
79 if (on) {
80 ret = request_irq(IRQ_USBOC, usb_simtec_ocirq, SA_INTERRUPT,
81 "USB Over-current", info);
82 if (ret != 0) {
83 printk(KERN_ERR "failed to request usb oc irq\n");
84 }
85
86 set_irq_type(IRQ_USBOC, IRQT_BOTHEDGE);
87 } else {
88 free_irq(IRQ_USBOC, info);
89 }
90}
91
92static struct s3c2410_hcd_info usb_simtec_info = {
93 .port[0] = {
94 .flags = S3C_HCDFLG_USED
95 },
96 .port[1] = {
97 .flags = S3C_HCDFLG_USED
98 },
99
100 .power_control = usb_simtec_powercontrol,
101 .enable_oc = usb_simtec_enableoc,
102};
103
104
105int usb_simtec_init(void)
106{
107 printk("USB Power Control, (c) 2004 Simtec Electronics\n");
108 s3c_device_usb.dev.platform_data = &usb_simtec_info;
109
110 s3c2410_gpio_cfgpin(S3C2410_GPB4, S3C2410_GPB4_OUTP);
111 s3c2410_gpio_setpin(S3C2410_GPB4, 1);
112 return 0;
113}
diff --git a/arch/arm/mach-s3c2410/usb-simtec.h b/arch/arm/mach-s3c2410/usb-simtec.h
new file mode 100644
index 000000000000..92c0cc83aeec
--- /dev/null
+++ b/arch/arm/mach-s3c2410/usb-simtec.h
@@ -0,0 +1,19 @@
1/* linux/arch/arm/mach-s3c2410/usb-simtec.c
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/
7 *
8 * Simtec BAST and Thorcom VR1000 USB port support functions
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * Modifications:
15 * 20-Aug-2004 BJD Created
16*/
17
18extern int usb_simtec_init(void);
19
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
new file mode 100644
index 000000000000..50cde576dadf
--- /dev/null
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -0,0 +1,162 @@
1if ARCH_SA1100
2
3menu "SA11x0 Implementations"
4
5config SA1100_ASSABET
6 bool "Assabet"
7 help
8 Say Y here if you are using the Intel(R) StrongARM(R) SA-1110
9 Microprocessor Development Board (also known as the Assabet).
10
11config ASSABET_NEPONSET
12 bool "Include support for Neponset"
13 depends on SA1100_ASSABET
14 select SA1111
15 help
16 Say Y here if you are using the Intel(R) StrongARM(R) SA-1110
17 Microprocessor Development Board (Assabet) with the SA-1111
18 Development Board (Nepon).
19
20config SA1100_CERF
21 bool "CerfBoard"
22 help
23 The Intrinsyc CerfBoard is based on the StrongARM 1110 (Discontinued).
24 More information is available at:
25 <http://www.intrinsyc.com/products/cerfboard/>.
26
27 Say Y if configuring for an Intrinsyc CerfBoard.
28 Say N otherwise.
29
30choice
31 prompt "Cerf Flash available"
32 depends on SA1100_CERF
33 default SA1100_CERF_FLASH_8MB
34
35config SA1100_CERF_FLASH_8MB
36 bool "8MB"
37
38config SA1100_CERF_FLASH_16MB
39 bool "16MB"
40
41config SA1100_CERF_FLASH_32MB
42 bool "32MB"
43
44endchoice
45
46config SA1100_COLLIE
47 bool "Sharp Zaurus SL5500"
48 select SHARP_LOCOMO
49 select SHARP_SCOOP
50 select SHARP_PARAM
51 help
52 Say Y here to support the Sharp Zaurus SL5500 PDAs.
53
54config SA1100_H3100
55 bool "Compaq iPAQ H3100"
56 help
57 Say Y here if you intend to run this kernel on the Compaq iPAQ
58 H3100 handheld computer. Information about this machine and the
59 Linux port to this machine can be found at:
60
61 <http://www.handhelds.org/Compaq/index.html#iPAQ_H3100>
62 <http://www.compaq.com/products/handhelds/pocketpc/>
63
64config SA1100_H3600
65 bool "Compaq iPAQ H3600/H3700"
66 help
67 Say Y here if you intend to run this kernel on the Compaq iPAQ
68 H3600 handheld computer. Information about this machine and the
69 Linux port to this machine can be found at:
70
71 <http://www.handhelds.org/Compaq/index.html#iPAQ_H3600>
72 <http://www.compaq.com/products/handhelds/pocketpc/>
73
74config SA1100_H3800
75 bool "Compaq iPAQ H3800"
76 help
77 Say Y here if you intend to run this kernel on the Compaq iPAQ H3800
78 series handheld computer. Information about this machine and the
79 Linux port to this machine can be found at:
80
81 <http://www.handhelds.org/Compaq/index.html#iPAQ_H3800>
82 <http://www.compaq.com/products/handhelds/pocketpc/>
83
84config SA1100_H3XXX
85 bool
86 depends on SA1100_H3100 || SA1100_H3600 || SA1100_H3800
87 default y
88
89config SA1100_BADGE4
90 bool "HP Labs BadgePAD 4"
91 select SA1111
92 help
93 Say Y here if you want to build a kernel for the HP Laboratories
94 BadgePAD 4.
95
96config SA1100_JORNADA720
97 bool "HP Jornada 720"
98 select SA1111
99 help
100 Say Y here if you want to build a kernel for the HP Jornada 720
101 handheld computer. See <http://www.hp.com/jornada/products/720>
102 for details.
103
104config SA1100_HACKKIT
105 bool "HackKit Core CPU Board"
106 help
107 Say Y here to support the HackKit Core CPU Board
108 <http://hackkit.eletztrick.de>;
109
110config SA1100_LART
111 bool "LART"
112 help
113 Say Y here if you are using the Linux Advanced Radio Terminal
114 (also known as the LART). See <http://www.lart.tudelft.nl/> for
115 information on the LART.
116
117config SA1100_PLEB
118 bool "PLEB"
119 help
120 Say Y here if you are using version 1 of the Portable Linux
121 Embedded Board (also known as PLEB).
122 See <http://www.disy.cse.unsw.edu.au/Hardware/PLEB/>
123 for more information.
124
125config SA1100_SHANNON
126 bool "Shannon"
127 help
128 The Shannon (also known as a Tuxscreen, and also as a IS2630) was a
129 limited edition webphone produced by Philips. The Shannon is a SA1100
130 platform with a 640x480 LCD, touchscreen, CIR keyboard, PCMCIA slots,
131 and a telco interface.
132
133config SA1100_SIMPAD
134 bool "Simpad"
135 help
136 The SIEMENS webpad SIMpad is based on the StrongARM 1110. There
137 are two different versions CL4 and SL4. CL4 has 32MB RAM and 16MB
138 FLASH. The SL4 version got 64 MB RAM and 32 MB FLASH and a
139 PCMCIA-Slot. The version for the Germany Telecom (DTAG) is the same
140 like CL4 in additional it has a PCMCIA-Slot. For more information
141 visit <http://www.my-siemens.com/> or <http://www.siemens.ch/>.
142
143config SA1100_SSP
144 tristate "Generic PIO SSP"
145 help
146 Say Y here to enable support for the generic PIO SSP driver.
147 This isn't for audio support, but for attached sensors and
148 other devices, eg for BadgePAD 4 sensor support, or Jornada
149 720 touchscreen support.
150
151config H3600_SLEEVE
152 tristate "Compaq iPAQ Handheld sleeve support"
153 depends on SA1100_H3600
154 help
155 Choose this option to enable support for extension packs (sleeves)
156 for the Compaq iPAQ H3XXX series of handheld computers. This option
157 is required for the CF, PCMCIA, Bluetooth and GSM/GPRS extension
158 packs.
159
160endmenu
161
162endif
diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile
new file mode 100644
index 000000000000..e4a4a3e8aa8f
--- /dev/null
+++ b/arch/arm/mach-sa1100/Makefile
@@ -0,0 +1,53 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Common support
6obj-y := generic.o irq.o dma.o time.o
7obj-m :=
8obj-n :=
9obj- :=
10led-y := leds.o
11
12obj-$(CONFIG_CPU_FREQ_SA1100) += cpu-sa1100.o
13obj-$(CONFIG_CPU_FREQ_SA1110) += cpu-sa1110.o
14
15# Specific board support
16obj-$(CONFIG_SA1100_ASSABET) += assabet.o
17led-$(CONFIG_SA1100_ASSABET) += leds-assabet.o
18obj-$(CONFIG_ASSABET_NEPONSET) += neponset.o
19
20obj-$(CONFIG_SA1100_BADGE4) += badge4.o
21led-$(CONFIG_SA1100_BADGE4) += leds-badge4.o
22
23obj-$(CONFIG_SA1100_CERF) += cerf.o
24led-$(CONFIG_SA1100_CERF) += leds-cerf.o
25
26obj-$(CONFIG_SA1100_COLLIE) += collie.o
27
28obj-$(CONFIG_SA1100_H3600) += h3600.o
29
30obj-$(CONFIG_SA1100_HACKKIT) += hackkit.o
31led-$(CONFIG_SA1100_HACKKIT) += leds-hackkit.o
32
33obj-$(CONFIG_SA1100_JORNADA720) += jornada720.o
34
35obj-$(CONFIG_SA1100_LART) += lart.o
36led-$(CONFIG_SA1100_LART) += leds-lart.o
37
38obj-$(CONFIG_SA1100_PLEB) += pleb.o
39
40obj-$(CONFIG_SA1100_SHANNON) += shannon.o
41
42obj-$(CONFIG_SA1100_SIMPAD) += simpad.o
43led-$(CONFIG_SA1100_SIMPAD) += leds-simpad.o
44
45# LEDs support
46obj-$(CONFIG_LEDS) += $(led-y)
47
48# SA1110 USB client support
49#obj-$(CONFIG_SA1100_USB) += usb/
50
51# Miscelaneous functions
52obj-$(CONFIG_PM) += pm.o sleep.o
53obj-$(CONFIG_SA1100_SSP) += ssp.o
diff --git a/arch/arm/mach-sa1100/Makefile.boot b/arch/arm/mach-sa1100/Makefile.boot
new file mode 100644
index 000000000000..a56ad0417cf2
--- /dev/null
+++ b/arch/arm/mach-sa1100/Makefile.boot
@@ -0,0 +1,7 @@
1 zreladdr-y := 0xc0008000
2ifeq ($(CONFIG_ARCH_SA1100),y)
3 zreladdr-$(CONFIG_SA1111) := 0xc0208000
4endif
5params_phys-y := 0xc0000100
6initrd_phys-y := 0xc0800000
7
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
new file mode 100644
index 000000000000..bedf88fafe08
--- /dev/null
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -0,0 +1,441 @@
1/*
2 * linux/arch/arm/mach-sa1100/assabet.c
3 *
4 * Author: Nicolas Pitre
5 *
6 * This file contains all Assabet-specific tweaks.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/config.h>
13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/module.h>
16#include <linux/errno.h>
17#include <linux/ioport.h>
18#include <linux/serial_core.h>
19#include <linux/mtd/mtd.h>
20#include <linux/mtd/partitions.h>
21#include <linux/delay.h>
22#include <linux/mm.h>
23
24#include <asm/hardware.h>
25#include <asm/mach-types.h>
26#include <asm/irq.h>
27#include <asm/setup.h>
28#include <asm/page.h>
29#include <asm/pgtable.h>
30#include <asm/tlbflush.h>
31
32#include <asm/mach/arch.h>
33#include <asm/mach/flash.h>
34#include <asm/mach/irda.h>
35#include <asm/mach/map.h>
36#include <asm/mach/serial_sa1100.h>
37#include <asm/arch/assabet.h>
38
39#include "generic.h"
40
41#define ASSABET_BCR_DB1110 \
42 (ASSABET_BCR_SPK_OFF | ASSABET_BCR_QMUTE | \
43 ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \
44 ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \
45 ASSABET_BCR_IRDA_MD0)
46
47#define ASSABET_BCR_DB1111 \
48 (ASSABET_BCR_SPK_OFF | ASSABET_BCR_QMUTE | \
49 ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \
50 ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \
51 ASSABET_BCR_CF_BUS_OFF | ASSABET_BCR_STEREO_LB | \
52 ASSABET_BCR_IRDA_MD0 | ASSABET_BCR_CF_RST)
53
54unsigned long SCR_value = ASSABET_SCR_INIT;
55EXPORT_SYMBOL(SCR_value);
56
57static unsigned long BCR_value = ASSABET_BCR_DB1110;
58
59void ASSABET_BCR_frob(unsigned int mask, unsigned int val)
60{
61 unsigned long flags;
62
63 local_irq_save(flags);
64 BCR_value = (BCR_value & ~mask) | val;
65 ASSABET_BCR = BCR_value;
66 local_irq_restore(flags);
67}
68
69EXPORT_SYMBOL(ASSABET_BCR_frob);
70
71static void assabet_backlight_power(int on)
72{
73#ifndef ASSABET_PAL_VIDEO
74 if (on)
75 ASSABET_BCR_set(ASSABET_BCR_LIGHT_ON);
76 else
77#endif
78 ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
79}
80
81/*
82 * Turn on/off the backlight. When turning the backlight on,
83 * we wait 500us after turning it on so we don't cause the
84 * supplies to droop when we enable the LCD controller (and
85 * cause a hard reset.)
86 */
87static void assabet_lcd_power(int on)
88{
89#ifndef ASSABET_PAL_VIDEO
90 if (on) {
91 ASSABET_BCR_set(ASSABET_BCR_LCD_ON);
92 udelay(500);
93 } else
94#endif
95 ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
96}
97
98
99/*
100 * Assabet flash support code.
101 */
102
103#ifdef ASSABET_REV_4
104/*
105 * Phase 4 Assabet has two 28F160B3 flash parts in bank 0:
106 */
107static struct mtd_partition assabet_partitions[] = {
108 {
109 .name = "bootloader",
110 .size = 0x00020000,
111 .offset = 0,
112 .mask_flags = MTD_WRITEABLE,
113 }, {
114 .name = "bootloader params",
115 .size = 0x00020000,
116 .offset = MTDPART_OFS_APPEND,
117 .mask_flags = MTD_WRITEABLE,
118 }, {
119 .name = "jffs",
120 .size = MTDPART_SIZ_FULL,
121 .offset = MTDPART_OFS_APPEND,
122 }
123};
124#else
125/*
126 * Phase 5 Assabet has two 28F128J3A flash parts in bank 0:
127 */
128static struct mtd_partition assabet_partitions[] = {
129 {
130 .name = "bootloader",
131 .size = 0x00040000,
132 .offset = 0,
133 .mask_flags = MTD_WRITEABLE,
134 }, {
135 .name = "bootloader params",
136 .size = 0x00040000,
137 .offset = MTDPART_OFS_APPEND,
138 .mask_flags = MTD_WRITEABLE,
139 }, {
140 .name = "jffs",
141 .size = MTDPART_SIZ_FULL,
142 .offset = MTDPART_OFS_APPEND,
143 }
144};
145#endif
146
147static struct flash_platform_data assabet_flash_data = {
148 .map_name = "cfi_probe",
149 .parts = assabet_partitions,
150 .nr_parts = ARRAY_SIZE(assabet_partitions),
151};
152
153static struct resource assabet_flash_resources[] = {
154 {
155 .start = SA1100_CS0_PHYS,
156 .end = SA1100_CS0_PHYS + SZ_32M - 1,
157 .flags = IORESOURCE_MEM,
158 }, {
159 .start = SA1100_CS1_PHYS,
160 .end = SA1100_CS1_PHYS + SZ_32M - 1,
161 .flags = IORESOURCE_MEM,
162 }
163};
164
165
166/*
167 * Assabet IrDA support code.
168 */
169
170static int assabet_irda_set_power(struct device *dev, unsigned int state)
171{
172 static unsigned int bcr_state[4] = {
173 ASSABET_BCR_IRDA_MD0,
174 ASSABET_BCR_IRDA_MD1|ASSABET_BCR_IRDA_MD0,
175 ASSABET_BCR_IRDA_MD1,
176 0
177 };
178
179 if (state < 4) {
180 state = bcr_state[state];
181 ASSABET_BCR_clear(state ^ (ASSABET_BCR_IRDA_MD1|
182 ASSABET_BCR_IRDA_MD0));
183 ASSABET_BCR_set(state);
184 }
185 return 0;
186}
187
188static void assabet_irda_set_speed(struct device *dev, unsigned int speed)
189{
190 if (speed < 4000000)
191 ASSABET_BCR_clear(ASSABET_BCR_IRDA_FSEL);
192 else
193 ASSABET_BCR_set(ASSABET_BCR_IRDA_FSEL);
194}
195
196static struct irda_platform_data assabet_irda_data = {
197 .set_power = assabet_irda_set_power,
198 .set_speed = assabet_irda_set_speed,
199};
200
201static void __init assabet_init(void)
202{
203 /*
204 * Ensure that the power supply is in "high power" mode.
205 */
206 GPDR |= GPIO_GPIO16;
207 GPSR = GPIO_GPIO16;
208
209 /*
210 * Ensure that these pins are set as outputs and are driving
211 * logic 0. This ensures that we won't inadvertently toggle
212 * the WS latch in the CPLD, and we don't float causing
213 * excessive power drain. --rmk
214 */
215 GPDR |= GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM;
216 GPCR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM;
217
218 /*
219 * Set up registers for sleep mode.
220 */
221 PWER = PWER_GPIO0;
222 PGSR = 0;
223 PCFR = 0;
224 PSDR = 0;
225 PPDR |= PPC_TXD3 | PPC_TXD1;
226 PPSR |= PPC_TXD3 | PPC_TXD1;
227
228 sa1100fb_lcd_power = assabet_lcd_power;
229 sa1100fb_backlight_power = assabet_backlight_power;
230
231 if (machine_has_neponset()) {
232 /*
233 * Angel sets this, but other bootloaders may not.
234 *
235 * This must precede any driver calls to BCR_set()
236 * or BCR_clear().
237 */
238 ASSABET_BCR = BCR_value = ASSABET_BCR_DB1111;
239
240#ifndef CONFIG_ASSABET_NEPONSET
241 printk( "Warning: Neponset detected but full support "
242 "hasn't been configured in the kernel\n" );
243#endif
244 }
245
246 sa11x0_set_flash_data(&assabet_flash_data, assabet_flash_resources,
247 ARRAY_SIZE(assabet_flash_resources));
248 sa11x0_set_irda_data(&assabet_irda_data);
249}
250
251/*
252 * On Assabet, we must probe for the Neponset board _before_
253 * paging_init() has occurred to actually determine the amount
254 * of RAM available. To do so, we map the appropriate IO section
255 * in the page table here in order to access GPIO registers.
256 */
257static void __init map_sa1100_gpio_regs( void )
258{
259 unsigned long phys = __PREG(GPLR) & PMD_MASK;
260 unsigned long virt = io_p2v(phys);
261 int prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO);
262 pmd_t *pmd;
263
264 pmd = pmd_offset(pgd_offset_k(virt), virt);
265 *pmd = __pmd(phys | prot);
266 flush_pmd_entry(pmd);
267}
268
269/*
270 * Read System Configuration "Register"
271 * (taken from "Intel StrongARM SA-1110 Microprocessor Development Board
272 * User's Guide", section 4.4.1)
273 *
274 * This same scan is performed in arch/arm/boot/compressed/head-sa1100.S
275 * to set up the serial port for decompression status messages. We
276 * repeat it here because the kernel may not be loaded as a zImage, and
277 * also because it's a hassle to communicate the SCR value to the kernel
278 * from the decompressor.
279 *
280 * Note that IRQs are guaranteed to be disabled.
281 */
282static void __init get_assabet_scr(void)
283{
284 unsigned long scr, i;
285
286 GPDR |= 0x3fc; /* Configure GPIO 9:2 as outputs */
287 GPSR = 0x3fc; /* Write 0xFF to GPIO 9:2 */
288 GPDR &= ~(0x3fc); /* Configure GPIO 9:2 as inputs */
289 for(i = 100; i--; scr = GPLR); /* Read GPIO 9:2 */
290 GPDR |= 0x3fc; /* restore correct pin direction */
291 scr &= 0x3fc; /* save as system configuration byte. */
292 SCR_value = scr;
293}
294
295static void __init
296fixup_assabet(struct machine_desc *desc, struct tag *tags,
297 char **cmdline, struct meminfo *mi)
298{
299 /* This must be done before any call to machine_has_neponset() */
300 map_sa1100_gpio_regs();
301 get_assabet_scr();
302
303 if (machine_has_neponset())
304 printk("Neponset expansion board detected\n");
305}
306
307
308static void assabet_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
309{
310 if (port->mapbase == _Ser1UTCR0) {
311 if (state)
312 ASSABET_BCR_clear(ASSABET_BCR_RS232EN |
313 ASSABET_BCR_COM_RTS |
314 ASSABET_BCR_COM_DTR);
315 else
316 ASSABET_BCR_set(ASSABET_BCR_RS232EN |
317 ASSABET_BCR_COM_RTS |
318 ASSABET_BCR_COM_DTR);
319 }
320}
321
322/*
323 * Assabet uses COM_RTS and COM_DTR for both UART1 (com port)
324 * and UART3 (radio module). We only handle them for UART1 here.
325 */
326static void assabet_set_mctrl(struct uart_port *port, u_int mctrl)
327{
328 if (port->mapbase == _Ser1UTCR0) {
329 u_int set = 0, clear = 0;
330
331 if (mctrl & TIOCM_RTS)
332 clear |= ASSABET_BCR_COM_RTS;
333 else
334 set |= ASSABET_BCR_COM_RTS;
335
336 if (mctrl & TIOCM_DTR)
337 clear |= ASSABET_BCR_COM_DTR;
338 else
339 set |= ASSABET_BCR_COM_DTR;
340
341 ASSABET_BCR_clear(clear);
342 ASSABET_BCR_set(set);
343 }
344}
345
346static u_int assabet_get_mctrl(struct uart_port *port)
347{
348 u_int ret = 0;
349 u_int bsr = ASSABET_BSR;
350
351 /* need 2 reads to read current value */
352 bsr = ASSABET_BSR;
353
354 if (port->mapbase == _Ser1UTCR0) {
355 if (bsr & ASSABET_BSR_COM_DCD)
356 ret |= TIOCM_CD;
357 if (bsr & ASSABET_BSR_COM_CTS)
358 ret |= TIOCM_CTS;
359 if (bsr & ASSABET_BSR_COM_DSR)
360 ret |= TIOCM_DSR;
361 } else if (port->mapbase == _Ser3UTCR0) {
362 if (bsr & ASSABET_BSR_RAD_DCD)
363 ret |= TIOCM_CD;
364 if (bsr & ASSABET_BSR_RAD_CTS)
365 ret |= TIOCM_CTS;
366 if (bsr & ASSABET_BSR_RAD_DSR)
367 ret |= TIOCM_DSR;
368 if (bsr & ASSABET_BSR_RAD_RI)
369 ret |= TIOCM_RI;
370 } else {
371 ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
372 }
373
374 return ret;
375}
376
377static struct sa1100_port_fns assabet_port_fns __initdata = {
378 .set_mctrl = assabet_set_mctrl,
379 .get_mctrl = assabet_get_mctrl,
380 .pm = assabet_uart_pm,
381};
382
383static struct map_desc assabet_io_desc[] __initdata = {
384 /* virtual physical length type */
385 { 0xf1000000, 0x12000000, 0x00100000, MT_DEVICE }, /* Board Control Register */
386 { 0xf2800000, 0x4b800000, 0x00800000, MT_DEVICE } /* MQ200 */
387};
388
389static void __init assabet_map_io(void)
390{
391 sa1100_map_io();
392 iotable_init(assabet_io_desc, ARRAY_SIZE(assabet_io_desc));
393
394 /*
395 * Set SUS bit in SDCR0 so serial port 1 functions.
396 * Its called GPCLKR0 in my SA1110 manual.
397 */
398 Ser1SDCR0 |= SDCR0_SUS;
399
400 if (machine_has_neponset()) {
401#ifdef CONFIG_ASSABET_NEPONSET
402 extern void neponset_map_io(void);
403
404 /*
405 * We map Neponset registers even if it isn't present since
406 * many drivers will try to probe their stuff (and fail).
407 * This is still more friendly than a kernel paging request
408 * crash.
409 */
410 neponset_map_io();
411#endif
412 } else {
413 sa1100_register_uart_fns(&assabet_port_fns);
414 }
415
416 /*
417 * When Neponset is attached, the first UART should be
418 * UART3. That's what Angel is doing and many documents
419 * are stating this.
420 *
421 * We do the Neponset mapping even if Neponset support
422 * isn't compiled in so the user will still get something on
423 * the expected physical serial port.
424 *
425 * We no longer do this; not all boot loaders support it,
426 * and UART3 appears to be somewhat unreliable with blob.
427 */
428 sa1100_register_uart(0, 1);
429 sa1100_register_uart(2, 3);
430}
431
432
433MACHINE_START(ASSABET, "Intel-Assabet")
434 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
435 BOOT_PARAMS(0xc0000100)
436 FIXUP(fixup_assabet)
437 MAPIO(assabet_map_io)
438 INITIRQ(sa1100_init_irq)
439 .timer = &sa1100_timer,
440 .init_machine = assabet_init,
441MACHINE_END
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
new file mode 100644
index 000000000000..6a60b497ab42
--- /dev/null
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -0,0 +1,293 @@
1/*
2 * linux/arch/arm/mach-sa1100/badge4.c
3 *
4 * BadgePAD 4 specific initialization
5 *
6 * Tim Connors <connors@hpl.hp.com>
7 * Christopher Hoover <ch@hpl.hp.com>
8 *
9 * Copyright (C) 2002 Hewlett-Packard Company
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 version 2 as
13 * published by the Free Software Foundation.
14 *
15 */
16#include <linux/module.h>
17#include <linux/init.h>
18#include <linux/kernel.h>
19#include <linux/device.h>
20#include <linux/delay.h>
21#include <linux/tty.h>
22#include <linux/mtd/mtd.h>
23#include <linux/mtd/partitions.h>
24#include <linux/errno.h>
25
26#include <asm/hardware.h>
27#include <asm/mach-types.h>
28#include <asm/setup.h>
29#include <asm/arch/irqs.h>
30
31#include <asm/mach/arch.h>
32#include <asm/mach/flash.h>
33#include <asm/mach/map.h>
34#include <asm/hardware/sa1111.h>
35#include <asm/mach/serial_sa1100.h>
36
37#include <asm/arch/badge4.h>
38
39#include "generic.h"
40
41static struct resource sa1111_resources[] = {
42 [0] = {
43 .start = BADGE4_SA1111_BASE,
44 .end = BADGE4_SA1111_BASE + 0x00001fff,
45 .flags = IORESOURCE_MEM,
46 },
47 [1] = {
48 .start = BADGE4_IRQ_GPIO_SA1111,
49 .end = BADGE4_IRQ_GPIO_SA1111,
50 .flags = IORESOURCE_IRQ,
51 },
52};
53
54static u64 sa1111_dmamask = 0xffffffffUL;
55
56static struct platform_device sa1111_device = {
57 .name = "sa1111",
58 .id = 0,
59 .dev = {
60 .dma_mask = &sa1111_dmamask,
61 .coherent_dma_mask = 0xffffffff,
62 },
63 .num_resources = ARRAY_SIZE(sa1111_resources),
64 .resource = sa1111_resources,
65};
66
67static struct platform_device *devices[] __initdata = {
68 &sa1111_device,
69};
70
71static int __init badge4_sa1111_init(void)
72{
73 /*
74 * Ensure that the memory bus request/grant signals are setup,
75 * and the grant is held in its inactive state
76 */
77 sa1110_mb_disable();
78
79 /*
80 * Probe for SA1111.
81 */
82 return platform_add_devices(devices, ARRAY_SIZE(devices));
83}
84
85
86/*
87 * 1 x Intel 28F320C3 Advanced+ Boot Block Flash (32 Mi bit)
88 * Eight 4 KiW Parameter Bottom Blocks (64 KiB)
89 * Sixty-three 32 KiW Main Blocks (4032 Ki b)
90 *
91 * <or>
92 *
93 * 1 x Intel 28F640C3 Advanced+ Boot Block Flash (64 Mi bit)
94 * Eight 4 KiW Parameter Bottom Blocks (64 KiB)
95 * One-hundred-twenty-seven 32 KiW Main Blocks (8128 Ki b)
96 */
97static struct mtd_partition badge4_partitions[] = {
98 {
99 .name = "BLOB boot loader",
100 .offset = 0,
101 .size = 0x0000A000
102 }, {
103 .name = "params",
104 .offset = MTDPART_OFS_APPEND,
105 .size = 0x00006000
106 }, {
107 .name = "root",
108 .offset = MTDPART_OFS_APPEND,
109 .size = MTDPART_SIZ_FULL
110 }
111};
112
113static struct flash_platform_data badge4_flash_data = {
114 .map_name = "cfi_probe",
115 .parts = badge4_partitions,
116 .nr_parts = ARRAY_SIZE(badge4_partitions),
117};
118
119static struct resource badge4_flash_resource = {
120 .start = SA1100_CS0_PHYS,
121 .end = SA1100_CS0_PHYS + SZ_64M - 1,
122 .flags = IORESOURCE_MEM,
123};
124
125static int five_v_on __initdata = 0;
126
127static int __init five_v_on_setup(char *ignore)
128{
129 five_v_on = 1;
130 return 1;
131}
132__setup("five_v_on", five_v_on_setup);
133
134
135static int __init badge4_init(void)
136{
137 int ret;
138
139 if (!machine_is_badge4())
140 return -ENODEV;
141
142 /* LCD */
143 GPCR = (BADGE4_GPIO_LGP2 | BADGE4_GPIO_LGP3 |
144 BADGE4_GPIO_LGP4 | BADGE4_GPIO_LGP5 |
145 BADGE4_GPIO_LGP6 | BADGE4_GPIO_LGP7 |
146 BADGE4_GPIO_LGP8 | BADGE4_GPIO_LGP9 |
147 BADGE4_GPIO_GPA_VID | BADGE4_GPIO_GPB_VID |
148 BADGE4_GPIO_GPC_VID);
149 GPDR &= ~BADGE4_GPIO_INT_VID;
150 GPDR |= (BADGE4_GPIO_LGP2 | BADGE4_GPIO_LGP3 |
151 BADGE4_GPIO_LGP4 | BADGE4_GPIO_LGP5 |
152 BADGE4_GPIO_LGP6 | BADGE4_GPIO_LGP7 |
153 BADGE4_GPIO_LGP8 | BADGE4_GPIO_LGP9 |
154 BADGE4_GPIO_GPA_VID | BADGE4_GPIO_GPB_VID |
155 BADGE4_GPIO_GPC_VID);
156
157 /* SDRAM SPD i2c */
158 GPCR = (BADGE4_GPIO_SDSDA | BADGE4_GPIO_SDSCL);
159 GPDR |= (BADGE4_GPIO_SDSDA | BADGE4_GPIO_SDSCL);
160
161 /* uart */
162 GPCR = (BADGE4_GPIO_UART_HS1 | BADGE4_GPIO_UART_HS2);
163 GPDR |= (BADGE4_GPIO_UART_HS1 | BADGE4_GPIO_UART_HS2);
164
165 /* CPLD muxsel0 input for mux/adc chip select */
166 GPCR = BADGE4_GPIO_MUXSEL0;
167 GPDR |= BADGE4_GPIO_MUXSEL0;
168
169 /* test points: J5, J6 as inputs, J7 outputs */
170 GPDR &= ~(BADGE4_GPIO_TESTPT_J5 | BADGE4_GPIO_TESTPT_J6);
171 GPCR = BADGE4_GPIO_TESTPT_J7;
172 GPDR |= BADGE4_GPIO_TESTPT_J7;
173
174 /* 5V supply rail. */
175 GPCR = BADGE4_GPIO_PCMEN5V; /* initially off */
176 GPDR |= BADGE4_GPIO_PCMEN5V;
177
178 /* CPLD sdram type inputs; set up by blob */
179 //GPDR |= (BADGE4_GPIO_SDTYP1 | BADGE4_GPIO_SDTYP0);
180 printk(KERN_DEBUG __FILE__ ": SDRAM CPLD typ1=%d typ0=%d\n",
181 !!(GPLR & BADGE4_GPIO_SDTYP1),
182 !!(GPLR & BADGE4_GPIO_SDTYP0));
183
184 /* SA1111 reset pin; set up by blob */
185 //GPSR = BADGE4_GPIO_SA1111_NRST;
186 //GPDR |= BADGE4_GPIO_SA1111_NRST;
187
188
189 /* power management cruft */
190 PGSR = 0;
191 PWER = 0;
192 PCFR = 0;
193 PSDR = 0;
194
195 PWER |= PWER_GPIO26; /* wake up on an edge from TESTPT_J5 */
196 PWER |= PWER_RTC; /* wake up if rtc fires */
197
198 /* drive sa1111_nrst during sleep */
199 PGSR |= BADGE4_GPIO_SA1111_NRST;
200 /* drive CPLD as is during sleep */
201 PGSR |= (GPLR & (BADGE4_GPIO_SDTYP0|BADGE4_GPIO_SDTYP1));
202
203
204 /* Now bring up the SA-1111. */
205 ret = badge4_sa1111_init();
206 if (ret < 0)
207 printk(KERN_ERR
208 "%s: SA-1111 initialization failed (%d)\n",
209 __FUNCTION__, ret);
210
211
212 /* maybe turn on 5v0 from the start */
213 badge4_set_5V(BADGE4_5V_INITIALLY, five_v_on);
214
215 sa11x0_set_flash_data(&badge4_flash_data, &badge4_flash_resource, 1);
216
217 return 0;
218}
219
220arch_initcall(badge4_init);
221
222
223static unsigned badge4_5V_bitmap = 0;
224
225void badge4_set_5V(unsigned subsystem, int on)
226{
227 unsigned long flags;
228 unsigned old_5V_bitmap;
229
230 local_irq_save(flags);
231
232 old_5V_bitmap = badge4_5V_bitmap;
233
234 if (on) {
235 badge4_5V_bitmap |= subsystem;
236 } else {
237 badge4_5V_bitmap &= ~subsystem;
238 }
239
240 /* detect on->off and off->on transitions */
241 if ((!old_5V_bitmap) && (badge4_5V_bitmap)) {
242 /* was off, now on */
243 printk(KERN_INFO "%s: enabling 5V supply rail\n", __FUNCTION__);
244 GPSR = BADGE4_GPIO_PCMEN5V;
245 } else if ((old_5V_bitmap) && (!badge4_5V_bitmap)) {
246 /* was on, now off */
247 printk(KERN_INFO "%s: disabling 5V supply rail\n", __FUNCTION__);
248 GPCR = BADGE4_GPIO_PCMEN5V;
249 }
250
251 local_irq_restore(flags);
252}
253EXPORT_SYMBOL(badge4_set_5V);
254
255
256static struct map_desc badge4_io_desc[] __initdata = {
257 /* virtual physical length type */
258 {0xf1000000, 0x08000000, 0x00100000, MT_DEVICE },/* SRAM bank 1 */
259 {0xf2000000, 0x10000000, 0x00100000, MT_DEVICE },/* SRAM bank 2 */
260 {0xf4000000, 0x48000000, 0x00100000, MT_DEVICE } /* SA-1111 */
261};
262
263static void
264badge4_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
265{
266 if (!state) {
267 Ser1SDCR0 |= SDCR0_UART;
268 }
269}
270
271static struct sa1100_port_fns badge4_port_fns __initdata = {
272 //.get_mctrl = badge4_get_mctrl,
273 //.set_mctrl = badge4_set_mctrl,
274 .pm = badge4_uart_pm,
275};
276
277static void __init badge4_map_io(void)
278{
279 sa1100_map_io();
280 iotable_init(badge4_io_desc, ARRAY_SIZE(badge4_io_desc));
281
282 sa1100_register_uart_fns(&badge4_port_fns);
283 sa1100_register_uart(0, 3);
284 sa1100_register_uart(1, 1);
285}
286
287MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
288 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
289 BOOT_PARAMS(0xc0000100)
290 MAPIO(badge4_map_io)
291 INITIRQ(sa1100_init_irq)
292 .timer = &sa1100_timer,
293MACHINE_END
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
new file mode 100644
index 000000000000..f8edde5e7cbf
--- /dev/null
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -0,0 +1,132 @@
1/*
2 * linux/arch/arm/mach-sa1100/cerf.c
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Apr-2003 : Removed some old PDA crud [FB]
9 * Oct-2003 : Added uart2 resource [FB]
10 * Jan-2004 : Removed io map for flash [FB]
11 */
12
13#include <linux/config.h>
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/tty.h>
17#include <linux/device.h>
18#include <linux/mtd/mtd.h>
19#include <linux/mtd/partitions.h>
20
21#include <asm/irq.h>
22#include <asm/hardware.h>
23#include <asm/setup.h>
24
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27#include <asm/mach/flash.h>
28#include <asm/mach/map.h>
29#include <asm/mach/serial_sa1100.h>
30
31#include <asm/arch/cerf.h>
32#include "generic.h"
33
34static struct resource cerfuart2_resources[] = {
35 [0] = {
36 .start = 0x80030000,
37 .end = 0x8003ffff,
38 .flags = IORESOURCE_MEM,
39 },
40};
41
42static struct platform_device cerfuart2_device = {
43 .name = "sa11x0-uart",
44 .id = 2,
45 .num_resources = ARRAY_SIZE(cerfuart2_resources),
46 .resource = cerfuart2_resources,
47};
48
49static struct platform_device *cerf_devices[] __initdata = {
50 &cerfuart2_device,
51};
52
53#ifdef CONFIG_SA1100_CERF_FLASH_32MB
54# define CERF_FLASH_SIZE 0x02000000
55#elif defined CONFIG_SA1100_CERF_FLASH_16MB
56# define CERF_FLASH_SIZE 0x01000000
57#elif defined CONFIG_SA1100_CERF_FLASH_8MB
58# define CERF_FLASH_SIZE 0x00800000
59#else
60# error "Undefined flash size for CERF"
61#endif
62
63static struct mtd_partition cerf_partitions[] = {
64 {
65 .name = "Bootloader",
66 .size = 0x00020000,
67 .offset = 0x00000000,
68 }, {
69 .name = "Params",
70 .size = 0x00040000,
71 .offset = 0x00020000,
72 }, {
73 .name = "Kernel",
74 .size = 0x00100000,
75 .offset = 0x00060000,
76 }, {
77 .name = "Filesystem",
78 .size = CERF_FLASH_SIZE-0x00160000,
79 .offset = 0x00160000,
80 }
81};
82
83static struct flash_platform_data cerf_flash_data = {
84 .map_name = "cfi_probe",
85 .parts = cerf_partitions,
86 .nr_parts = ARRAY_SIZE(cerf_partitions),
87};
88
89static struct resource cerf_flash_resource = {
90 .start = SA1100_CS0_PHYS,
91 .end = SA1100_CS0_PHYS + SZ_32M - 1,
92 .flags = IORESOURCE_MEM,
93};
94
95static void __init cerf_init_irq(void)
96{
97 sa1100_init_irq();
98 set_irq_type(CERF_ETH_IRQ, IRQT_RISING);
99}
100
101static struct map_desc cerf_io_desc[] __initdata = {
102 /* virtual physical length type */
103 { 0xf0000000, 0x08000000, 0x00100000, MT_DEVICE } /* Crystal Ethernet Chip */
104};
105
106static void __init cerf_map_io(void)
107{
108 sa1100_map_io();
109 iotable_init(cerf_io_desc, ARRAY_SIZE(cerf_io_desc));
110
111 sa1100_register_uart(0, 3);
112 sa1100_register_uart(1, 2); /* disable this and the uart2 device for sa1100_fir */
113 sa1100_register_uart(2, 1);
114
115 /* set some GPDR bits here while it's safe */
116 GPDR |= CERF_GPIO_CF_RESET;
117}
118
119static void __init cerf_init(void)
120{
121 platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
122 sa11x0_set_flash_data(&cerf_flash_data, &cerf_flash_resource, 1);
123}
124
125MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
126 MAINTAINER("support@intrinsyc.com")
127 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
128 MAPIO(cerf_map_io)
129 INITIRQ(cerf_init_irq)
130 .timer = &sa1100_timer,
131 .init_machine = cerf_init,
132MACHINE_END
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
new file mode 100644
index 000000000000..99287890d396
--- /dev/null
+++ b/arch/arm/mach-sa1100/collie.c
@@ -0,0 +1,192 @@
1/*
2 * linux/arch/arm/mach-sa1100/collie.c
3 *
4 * May be copied or modified under the terms of the GNU General Public
5 * License. See linux/COPYING for more information.
6 *
7 * This file contains all Collie-specific tweaks.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * ChangeLog:
14 * 03-06-2004 John Lenz <jelenz@wisc.edu>
15 * 06-04-2002 Chris Larson <kergoth@digitalnemesis.net>
16 * 04-16-2001 Lineo Japan,Inc. ...
17 */
18
19#include <linux/config.h>
20#include <linux/init.h>
21#include <linux/kernel.h>
22#include <linux/tty.h>
23#include <linux/delay.h>
24#include <linux/device.h>
25#include <linux/mtd/mtd.h>
26#include <linux/mtd/partitions.h>
27#include <linux/timer.h>
28
29#include <asm/hardware.h>
30#include <asm/mach-types.h>
31#include <asm/irq.h>
32#include <asm/setup.h>
33#include <asm/arch/collie.h>
34
35#include <asm/mach/arch.h>
36#include <asm/mach/flash.h>
37#include <asm/mach/map.h>
38#include <asm/mach/serial_sa1100.h>
39
40#include <asm/hardware/scoop.h>
41#include <asm/mach/sharpsl_param.h>
42#include <asm/hardware/locomo.h>
43
44#include "generic.h"
45
46static struct resource collie_scoop_resources[] = {
47 [0] = {
48 .start = 0x40800000,
49 .end = 0x40800fff,
50 .flags = IORESOURCE_MEM,
51 },
52};
53
54static struct scoop_config collie_scoop_setup = {
55 .io_dir = COLLIE_SCOOP_IO_DIR,
56 .io_out = COLLIE_SCOOP_IO_OUT,
57};
58
59struct platform_device colliescoop_device = {
60 .name = "sharp-scoop",
61 .id = -1,
62 .dev = {
63 .platform_data = &collie_scoop_setup,
64 },
65 .num_resources = ARRAY_SIZE(collie_scoop_resources),
66 .resource = collie_scoop_resources,
67};
68
69
70static struct resource locomo_resources[] = {
71 [0] = {
72 .start = 0x40000000,
73 .end = 0x40001fff,
74 .flags = IORESOURCE_MEM,
75 },
76 [1] = {
77 .start = IRQ_GPIO25,
78 .end = IRQ_GPIO25,
79 .flags = IORESOURCE_IRQ,
80 },
81};
82
83static struct platform_device locomo_device = {
84 .name = "locomo",
85 .id = 0,
86 .num_resources = ARRAY_SIZE(locomo_resources),
87 .resource = locomo_resources,
88};
89
90static struct platform_device *devices[] __initdata = {
91 &locomo_device,
92 &colliescoop_device,
93};
94
95static struct mtd_partition collie_partitions[] = {
96 {
97 .name = "bootloader",
98 .offset = 0,
99 .size = 0x000C0000,
100 .mask_flags = MTD_WRITEABLE
101 }, {
102 .name = "kernel",
103 .offset = MTDPART_OFS_APPEND,
104 .size = 0x00100000,
105 }, {
106 .name = "rootfs",
107 .offset = MTDPART_OFS_APPEND,
108 .size = 0x00e20000,
109 }
110};
111
112static void collie_set_vpp(int vpp)
113{
114 write_scoop_reg(SCOOP_GPCR, read_scoop_reg(SCOOP_GPCR) | COLLIE_SCP_VPEN);
115 if (vpp) {
116 write_scoop_reg(SCOOP_GPWR, read_scoop_reg(SCOOP_GPWR) | COLLIE_SCP_VPEN);
117 } else {
118 write_scoop_reg(SCOOP_GPWR, read_scoop_reg(SCOOP_GPWR) & ~COLLIE_SCP_VPEN);
119 }
120}
121
122static struct flash_platform_data collie_flash_data = {
123 .map_name = "cfi_probe",
124 .set_vpp = collie_set_vpp,
125 .parts = collie_partitions,
126 .nr_parts = ARRAY_SIZE(collie_partitions),
127};
128
129static struct resource collie_flash_resources[] = {
130 {
131 .start = SA1100_CS0_PHYS,
132 .end = SA1100_CS0_PHYS + SZ_32M - 1,
133 .flags = IORESOURCE_MEM,
134 }
135};
136
137static void __init collie_init(void)
138{
139 int ret = 0;
140
141 /* cpu initialize */
142 GAFR = ( GPIO_SSP_TXD | \
143 GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SSP_CLK | GPIO_TIC_ACK | \
144 GPIO_32_768kHz );
145
146 GPDR = ( GPIO_LDD8 | GPIO_LDD9 | GPIO_LDD10 | GPIO_LDD11 | GPIO_LDD12 | \
147 GPIO_LDD13 | GPIO_LDD14 | GPIO_LDD15 | GPIO_SSP_TXD | \
148 GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SDLC_SCLK | \
149 GPIO_SDLC_AAF | GPIO_UART_SCLK1 | GPIO_32_768kHz );
150 GPLR = GPIO_GPIO18;
151
152 // PPC pin setting
153 PPDR = ( PPC_LDD0 | PPC_LDD1 | PPC_LDD2 | PPC_LDD3 | PPC_LDD4 | PPC_LDD5 | \
154 PPC_LDD6 | PPC_LDD7 | PPC_L_PCLK | PPC_L_LCLK | PPC_L_FCLK | PPC_L_BIAS | \
155 PPC_TXD1 | PPC_TXD2 | PPC_RXD2 | PPC_TXD3 | PPC_TXD4 | PPC_SCLK | PPC_SFRM );
156
157 PSDR = ( PPC_RXD1 | PPC_RXD2 | PPC_RXD3 | PPC_RXD4 );
158
159 GAFR |= GPIO_32_768kHz;
160 GPDR |= GPIO_32_768kHz;
161 TUCR = TUCR_32_768kHz;
162
163 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
164 if (ret) {
165 printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");
166 }
167
168 sa11x0_set_flash_data(&collie_flash_data, collie_flash_resources,
169 ARRAY_SIZE(collie_flash_resources));
170
171 sharpsl_save_param();
172}
173
174static struct map_desc collie_io_desc[] __initdata = {
175 /* virtual physical length type */
176 {0xe8000000, 0x00000000, 0x02000000, MT_DEVICE}, /* 32M main flash (cs0) */
177 {0xea000000, 0x08000000, 0x02000000, MT_DEVICE}, /* 32M boot flash (cs1) */
178};
179
180static void __init collie_map_io(void)
181{
182 sa1100_map_io();
183 iotable_init(collie_io_desc, ARRAY_SIZE(collie_io_desc));
184}
185
186MACHINE_START(COLLIE, "Sharp-Collie")
187 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
188 MAPIO(collie_map_io)
189 INITIRQ(sa1100_init_irq)
190 .timer = &sa1100_timer,
191 .init_machine = collie_init,
192MACHINE_END
diff --git a/arch/arm/mach-sa1100/cpu-sa1100.c b/arch/arm/mach-sa1100/cpu-sa1100.c
new file mode 100644
index 000000000000..6435b2e48ffa
--- /dev/null
+++ b/arch/arm/mach-sa1100/cpu-sa1100.c
@@ -0,0 +1,249 @@
1/*
2 * cpu-sa1100.c: clock scaling for the SA1100
3 *
4 * Copyright (C) 2000 2001, The Delft University of Technology
5 *
6 * Authors:
7 * - Johan Pouwelse (J.A.Pouwelse@its.tudelft.nl): initial version
8 * - Erik Mouw (J.A.K.Mouw@its.tudelft.nl):
9 * - major rewrite for linux-2.3.99
10 * - rewritten for the more generic power management scheme in
11 * linux-2.4.5-rmk1
12 *
13 * This software has been developed while working on the LART
14 * computing board (http://www.lart.tudelft.nl/), which is
15 * sponsored by the Mobile Multi-media Communications
16 * (http://www.mmc.tudelft.nl/) and Ubiquitous Communications
17 * (http://www.ubicom.tudelft.nl/) projects.
18 *
19 * The authors can be reached at:
20 *
21 * Erik Mouw
22 * Information and Communication Theory Group
23 * Faculty of Information Technology and Systems
24 * Delft University of Technology
25 * P.O. Box 5031
26 * 2600 GA Delft
27 * The Netherlands
28 *
29 *
30 * This program is free software; you can redistribute it and/or modify
31 * it under the terms of the GNU General Public License as published by
32 * the Free Software Foundation; either version 2 of the License, or
33 * (at your option) any later version.
34 *
35 * This program is distributed in the hope that it will be useful,
36 * but WITHOUT ANY WARRANTY; without even the implied warranty of
37 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 * GNU General Public License for more details.
39 *
40 * You should have received a copy of the GNU General Public License
41 * along with this program; if not, write to the Free Software
42 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
43 *
44 *
45 * Theory of operations
46 * ====================
47 *
48 * Clock scaling can be used to lower the power consumption of the CPU
49 * core. This will give you a somewhat longer running time.
50 *
51 * The SA-1100 has a single register to change the core clock speed:
52 *
53 * PPCR 0x90020014 PLL config
54 *
55 * However, the DRAM timings are closely related to the core clock
56 * speed, so we need to change these, too. The used registers are:
57 *
58 * MDCNFG 0xA0000000 DRAM config
59 * MDCAS0 0xA0000004 Access waveform
60 * MDCAS1 0xA0000008 Access waveform
61 * MDCAS2 0xA000000C Access waveform
62 *
63 * Care must be taken to change the DRAM parameters the correct way,
64 * because otherwise the DRAM becomes unusable and the kernel will
65 * crash.
66 *
67 * The simple solution to avoid a kernel crash is to put the actual
68 * clock change in ROM and jump to that code from the kernel. The main
69 * disadvantage is that the ROM has to be modified, which is not
70 * possible on all SA-1100 platforms. Another disadvantage is that
71 * jumping to ROM makes clock switching unecessary complicated.
72 *
73 * The idea behind this driver is that the memory configuration can be
74 * changed while running from DRAM (even with interrupts turned on!)
75 * as long as all re-configuration steps yield a valid DRAM
76 * configuration. The advantages are clear: it will run on all SA-1100
77 * platforms, and the code is very simple.
78 *
79 * If you really want to understand what is going on in
80 * sa1100_update_dram_timings(), you'll have to read sections 8.2,
81 * 9.5.7.3, and 10.2 from the "Intel StrongARM SA-1100 Microprocessor
82 * Developers Manual" (available for free from Intel).
83 *
84 */
85
86#include <linux/kernel.h>
87#include <linux/types.h>
88#include <linux/init.h>
89#include <linux/cpufreq.h>
90
91#include <asm/hardware.h>
92
93#include "generic.h"
94
95typedef struct {
96 int speed;
97 u32 mdcnfg;
98 u32 mdcas0;
99 u32 mdcas1;
100 u32 mdcas2;
101} sa1100_dram_regs_t;
102
103
104static struct cpufreq_driver sa1100_driver;
105
106static sa1100_dram_regs_t sa1100_dram_settings[] =
107{
108 /* speed, mdcnfg, mdcas0, mdcas1, mdcas2 clock frequency */
109 { 59000, 0x00dc88a3, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 59.0 MHz */
110 { 73700, 0x011490a3, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 73.7 MHz */
111 { 88500, 0x014e90a3, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 88.5 MHz */
112 { 103200, 0x01889923, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 103.2 MHz */
113 { 118000, 0x01c29923, 0x9999998f, 0xfffffff9, 0xffffffff }, /* 118.0 MHz */
114 { 132700, 0x01fb2123, 0x9999998f, 0xfffffff9, 0xffffffff }, /* 132.7 MHz */
115 { 147500, 0x02352123, 0x3333330f, 0xfffffff3, 0xffffffff }, /* 147.5 MHz */
116 { 162200, 0x026b29a3, 0x38e38e1f, 0xfff8e38e, 0xffffffff }, /* 162.2 MHz */
117 { 176900, 0x02a329a3, 0x71c71c1f, 0xfff1c71c, 0xffffffff }, /* 176.9 MHz */
118 { 191700, 0x02dd31a3, 0xe38e383f, 0xffe38e38, 0xffffffff }, /* 191.7 MHz */
119 { 206400, 0x03153223, 0xc71c703f, 0xffc71c71, 0xffffffff }, /* 206.4 MHz */
120 { 221200, 0x034fba23, 0xc71c703f, 0xffc71c71, 0xffffffff }, /* 221.2 MHz */
121 { 235900, 0x03853a23, 0xe1e1e07f, 0xe1e1e1e1, 0xffffffe1 }, /* 235.9 MHz */
122 { 250700, 0x03bf3aa3, 0xc3c3c07f, 0xc3c3c3c3, 0xffffffc3 }, /* 250.7 MHz */
123 { 265400, 0x03f7c2a3, 0xc3c3c07f, 0xc3c3c3c3, 0xffffffc3 }, /* 265.4 MHz */
124 { 280200, 0x0431c2a3, 0x878780ff, 0x87878787, 0xffffff87 }, /* 280.2 MHz */
125 { 0, 0, 0, 0, 0 } /* last entry */
126};
127
128static void sa1100_update_dram_timings(int current_speed, int new_speed)
129{
130 sa1100_dram_regs_t *settings = sa1100_dram_settings;
131
132 /* find speed */
133 while (settings->speed != 0) {
134 if(new_speed == settings->speed)
135 break;
136
137 settings++;
138 }
139
140 if (settings->speed == 0) {
141 panic("%s: couldn't find dram setting for speed %d\n",
142 __FUNCTION__, new_speed);
143 }
144
145 /* No risk, no fun: run with interrupts on! */
146 if (new_speed > current_speed) {
147 /* We're going FASTER, so first relax the memory
148 * timings before changing the core frequency
149 */
150
151 /* Half the memory access clock */
152 MDCNFG |= MDCNFG_CDB2;
153
154 /* The order of these statements IS important, keep 8
155 * pulses!!
156 */
157 MDCAS2 = settings->mdcas2;
158 MDCAS1 = settings->mdcas1;
159 MDCAS0 = settings->mdcas0;
160 MDCNFG = settings->mdcnfg;
161 } else {
162 /* We're going SLOWER: first decrease the core
163 * frequency and then tighten the memory settings.
164 */
165
166 /* Half the memory access clock */
167 MDCNFG |= MDCNFG_CDB2;
168
169 /* The order of these statements IS important, keep 8
170 * pulses!!
171 */
172 MDCAS0 = settings->mdcas0;
173 MDCAS1 = settings->mdcas1;
174 MDCAS2 = settings->mdcas2;
175 MDCNFG = settings->mdcnfg;
176 }
177}
178
179static int sa1100_target(struct cpufreq_policy *policy,
180 unsigned int target_freq,
181 unsigned int relation)
182{
183 unsigned int cur = sa11x0_getspeed(0);
184 unsigned int new_ppcr;
185
186 struct cpufreq_freqs freqs;
187 switch(relation){
188 case CPUFREQ_RELATION_L:
189 new_ppcr = sa11x0_freq_to_ppcr(target_freq);
190 if (sa11x0_ppcr_to_freq(new_ppcr) > policy->max)
191 new_ppcr--;
192 break;
193 case CPUFREQ_RELATION_H:
194 new_ppcr = sa11x0_freq_to_ppcr(target_freq);
195 if ((sa11x0_ppcr_to_freq(new_ppcr) > target_freq) &&
196 (sa11x0_ppcr_to_freq(new_ppcr - 1) >= policy->min))
197 new_ppcr--;
198 break;
199 }
200
201 freqs.old = cur;
202 freqs.new = sa11x0_ppcr_to_freq(new_ppcr);
203 freqs.cpu = 0;
204
205 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
206
207 if (freqs.new > cur)
208 sa1100_update_dram_timings(cur, freqs.new);
209
210 PPCR = new_ppcr;
211
212 if (freqs.new < cur)
213 sa1100_update_dram_timings(cur, freqs.new);
214
215 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
216
217 return 0;
218}
219
220static int __init sa1100_cpu_init(struct cpufreq_policy *policy)
221{
222 if (policy->cpu != 0)
223 return -EINVAL;
224 policy->cur = policy->min = policy->max = sa11x0_getspeed(0);
225 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
226 policy->cpuinfo.min_freq = 59000;
227 policy->cpuinfo.max_freq = 287000;
228 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
229 return 0;
230}
231
232static struct cpufreq_driver sa1100_driver = {
233 .flags = CPUFREQ_STICKY,
234 .verify = sa11x0_verify_speed,
235 .target = sa1100_target,
236 .get = sa11x0_getspeed,
237 .init = sa1100_cpu_init,
238 .name = "sa1100",
239};
240
241static int __init sa1100_dram_init(void)
242{
243 if ((processor_id & CPU_SA1100_MASK) == CPU_SA1100_ID)
244 return cpufreq_register_driver(&sa1100_driver);
245 else
246 return -ENODEV;
247}
248
249arch_initcall(sa1100_dram_init);
diff --git a/arch/arm/mach-sa1100/cpu-sa1110.c b/arch/arm/mach-sa1100/cpu-sa1110.c
new file mode 100644
index 000000000000..8d2a89a2ea01
--- /dev/null
+++ b/arch/arm/mach-sa1100/cpu-sa1110.c
@@ -0,0 +1,367 @@
1/*
2 * linux/arch/arm/mach-sa1100/cpu-sa1110.c
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * $Id: cpu-sa1110.c,v 1.9 2002/07/06 16:53:18 rmk Exp $
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Note: there are two erratas that apply to the SA1110 here:
13 * 7 - SDRAM auto-power-up failure (rev A0)
14 * 13 - Corruption of internal register reads/writes following
15 * SDRAM reads (rev A0, B0, B1)
16 *
17 * We ignore rev. A0 and B0 devices; I don't think they're worth supporting.
18 */
19#include <linux/types.h>
20#include <linux/kernel.h>
21#include <linux/sched.h>
22#include <linux/cpufreq.h>
23#include <linux/delay.h>
24#include <linux/init.h>
25
26#include <asm/hardware.h>
27#include <asm/mach-types.h>
28#include <asm/io.h>
29#include <asm/system.h>
30
31#include "generic.h"
32
33#undef DEBUG
34
35static struct cpufreq_driver sa1110_driver;
36
37struct sdram_params {
38 u_char rows; /* bits */
39 u_char cas_latency; /* cycles */
40 u_char tck; /* clock cycle time (ns) */
41 u_char trcd; /* activate to r/w (ns) */
42 u_char trp; /* precharge to activate (ns) */
43 u_char twr; /* write recovery time (ns) */
44 u_short refresh; /* refresh time for array (us) */
45};
46
47struct sdram_info {
48 u_int mdcnfg;
49 u_int mdrefr;
50 u_int mdcas[3];
51};
52
53static struct sdram_params tc59sm716_cl2_params __initdata = {
54 .rows = 12,
55 .tck = 10,
56 .trcd = 20,
57 .trp = 20,
58 .twr = 10,
59 .refresh = 64000,
60 .cas_latency = 2,
61};
62
63static struct sdram_params tc59sm716_cl3_params __initdata = {
64 .rows = 12,
65 .tck = 8,
66 .trcd = 20,
67 .trp = 20,
68 .twr = 8,
69 .refresh = 64000,
70 .cas_latency = 3,
71};
72
73static struct sdram_params samsung_k4s641632d_tc75 __initdata = {
74 .rows = 14,
75 .tck = 9,
76 .trcd = 27,
77 .trp = 20,
78 .twr = 9,
79 .refresh = 64000,
80 .cas_latency = 3,
81};
82
83static struct sdram_params samsung_km416s4030ct __initdata = {
84 .rows = 13,
85 .tck = 8,
86 .trcd = 24, /* 3 CLKs */
87 .trp = 24, /* 3 CLKs */
88 .twr = 16, /* Trdl: 2 CLKs */
89 .refresh = 64000,
90 .cas_latency = 3,
91};
92
93static struct sdram_params wbond_w982516ah75l_cl3_params __initdata = {
94 .rows = 16,
95 .tck = 8,
96 .trcd = 20,
97 .trp = 20,
98 .twr = 8,
99 .refresh = 64000,
100 .cas_latency = 3,
101};
102
103static struct sdram_params sdram_params;
104
105/*
106 * Given a period in ns and frequency in khz, calculate the number of
107 * cycles of frequency in period. Note that we round up to the next
108 * cycle, even if we are only slightly over.
109 */
110static inline u_int ns_to_cycles(u_int ns, u_int khz)
111{
112 return (ns * khz + 999999) / 1000000;
113}
114
115/*
116 * Create the MDCAS register bit pattern.
117 */
118static inline void set_mdcas(u_int *mdcas, int delayed, u_int rcd)
119{
120 u_int shift;
121
122 rcd = 2 * rcd - 1;
123 shift = delayed + 1 + rcd;
124
125 mdcas[0] = (1 << rcd) - 1;
126 mdcas[0] |= 0x55555555 << shift;
127 mdcas[1] = mdcas[2] = 0x55555555 << (shift & 1);
128}
129
130static void
131sdram_calculate_timing(struct sdram_info *sd, u_int cpu_khz,
132 struct sdram_params *sdram)
133{
134 u_int mem_khz, sd_khz, trp, twr;
135
136 mem_khz = cpu_khz / 2;
137 sd_khz = mem_khz;
138
139 /*
140 * If SDCLK would invalidate the SDRAM timings,
141 * run SDCLK at half speed.
142 *
143 * CPU steppings prior to B2 must either run the memory at
144 * half speed or use delayed read latching (errata 13).
145 */
146 if ((ns_to_cycles(sdram->tck, sd_khz) > 1) ||
147 (CPU_REVISION < CPU_SA1110_B2 && sd_khz < 62000))
148 sd_khz /= 2;
149
150 sd->mdcnfg = MDCNFG & 0x007f007f;
151
152 twr = ns_to_cycles(sdram->twr, mem_khz);
153
154 /* trp should always be >1 */
155 trp = ns_to_cycles(sdram->trp, mem_khz) - 1;
156 if (trp < 1)
157 trp = 1;
158
159 sd->mdcnfg |= trp << 8;
160 sd->mdcnfg |= trp << 24;
161 sd->mdcnfg |= sdram->cas_latency << 12;
162 sd->mdcnfg |= sdram->cas_latency << 28;
163 sd->mdcnfg |= twr << 14;
164 sd->mdcnfg |= twr << 30;
165
166 sd->mdrefr = MDREFR & 0xffbffff0;
167 sd->mdrefr |= 7;
168
169 if (sd_khz != mem_khz)
170 sd->mdrefr |= MDREFR_K1DB2;
171
172 /* initial number of '1's in MDCAS + 1 */
173 set_mdcas(sd->mdcas, sd_khz >= 62000, ns_to_cycles(sdram->trcd, mem_khz));
174
175#ifdef DEBUG
176 printk("MDCNFG: %08x MDREFR: %08x MDCAS0: %08x MDCAS1: %08x MDCAS2: %08x\n",
177 sd->mdcnfg, sd->mdrefr, sd->mdcas[0], sd->mdcas[1], sd->mdcas[2]);
178#endif
179}
180
181/*
182 * Set the SDRAM refresh rate.
183 */
184static inline void sdram_set_refresh(u_int dri)
185{
186 MDREFR = (MDREFR & 0xffff000f) | (dri << 4);
187 (void) MDREFR;
188}
189
190/*
191 * Update the refresh period. We do this such that we always refresh
192 * the SDRAMs within their permissible period. The refresh period is
193 * always a multiple of the memory clock (fixed at cpu_clock / 2).
194 *
195 * FIXME: we don't currently take account of burst accesses here,
196 * but neither do Intels DM nor Angel.
197 */
198static void
199sdram_update_refresh(u_int cpu_khz, struct sdram_params *sdram)
200{
201 u_int ns_row = (sdram->refresh * 1000) >> sdram->rows;
202 u_int dri = ns_to_cycles(ns_row, cpu_khz / 2) / 32;
203
204#ifdef DEBUG
205 mdelay(250);
206 printk("new dri value = %d\n", dri);
207#endif
208
209 sdram_set_refresh(dri);
210}
211
212/*
213 * Ok, set the CPU frequency.
214 */
215static int sa1110_target(struct cpufreq_policy *policy,
216 unsigned int target_freq,
217 unsigned int relation)
218{
219 struct sdram_params *sdram = &sdram_params;
220 struct cpufreq_freqs freqs;
221 struct sdram_info sd;
222 unsigned long flags;
223 unsigned int ppcr, unused;
224
225 switch(relation){
226 case CPUFREQ_RELATION_L:
227 ppcr = sa11x0_freq_to_ppcr(target_freq);
228 if (sa11x0_ppcr_to_freq(ppcr) > policy->max)
229 ppcr--;
230 break;
231 case CPUFREQ_RELATION_H:
232 ppcr = sa11x0_freq_to_ppcr(target_freq);
233 if (ppcr && (sa11x0_ppcr_to_freq(ppcr) > target_freq) &&
234 (sa11x0_ppcr_to_freq(ppcr-1) >= policy->min))
235 ppcr--;
236 break;
237 default:
238 return -EINVAL;
239 }
240
241 freqs.old = sa11x0_getspeed(0);
242 freqs.new = sa11x0_ppcr_to_freq(ppcr);
243 freqs.cpu = 0;
244
245 sdram_calculate_timing(&sd, freqs.new, sdram);
246
247#if 0
248 /*
249 * These values are wrong according to the SA1110 documentation
250 * and errata, but they seem to work. Need to get a storage
251 * scope on to the SDRAM signals to work out why.
252 */
253 if (policy->max < 147500) {
254 sd.mdrefr |= MDREFR_K1DB2;
255 sd.mdcas[0] = 0xaaaaaa7f;
256 } else {
257 sd.mdrefr &= ~MDREFR_K1DB2;
258 sd.mdcas[0] = 0xaaaaaa9f;
259 }
260 sd.mdcas[1] = 0xaaaaaaaa;
261 sd.mdcas[2] = 0xaaaaaaaa;
262#endif
263
264 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
265
266 /*
267 * The clock could be going away for some time. Set the SDRAMs
268 * to refresh rapidly (every 64 memory clock cycles). To get
269 * through the whole array, we need to wait 262144 mclk cycles.
270 * We wait 20ms to be safe.
271 */
272 sdram_set_refresh(2);
273 if (!irqs_disabled()) {
274 set_current_state(TASK_UNINTERRUPTIBLE);
275 schedule_timeout(20 * HZ / 1000);
276 } else {
277 mdelay(20);
278 }
279
280 /*
281 * Reprogram the DRAM timings with interrupts disabled, and
282 * ensure that we are doing this within a complete cache line.
283 * This means that we won't access SDRAM for the duration of
284 * the programming.
285 */
286 local_irq_save(flags);
287 asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
288 udelay(10);
289 __asm__ __volatile__(" \n\
290 b 2f \n\
291 .align 5 \n\
2921: str %3, [%1, #0] @ MDCNFG \n\
293 str %4, [%1, #28] @ MDREFR \n\
294 str %5, [%1, #4] @ MDCAS0 \n\
295 str %6, [%1, #8] @ MDCAS1 \n\
296 str %7, [%1, #12] @ MDCAS2 \n\
297 str %8, [%2, #0] @ PPCR \n\
298 ldr %0, [%1, #0] \n\
299 b 3f \n\
3002: b 1b \n\
3013: nop \n\
302 nop"
303 : "=&r" (unused)
304 : "r" (&MDCNFG), "r" (&PPCR), "0" (sd.mdcnfg),
305 "r" (sd.mdrefr), "r" (sd.mdcas[0]),
306 "r" (sd.mdcas[1]), "r" (sd.mdcas[2]), "r" (ppcr));
307 local_irq_restore(flags);
308
309 /*
310 * Now, return the SDRAM refresh back to normal.
311 */
312 sdram_update_refresh(freqs.new, sdram);
313
314 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
315
316 return 0;
317}
318
319static int __init sa1110_cpu_init(struct cpufreq_policy *policy)
320{
321 if (policy->cpu != 0)
322 return -EINVAL;
323 policy->cur = policy->min = policy->max = sa11x0_getspeed(0);
324 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
325 policy->cpuinfo.min_freq = 59000;
326 policy->cpuinfo.max_freq = 287000;
327 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
328 return 0;
329}
330
331static struct cpufreq_driver sa1110_driver = {
332 .flags = CPUFREQ_STICKY,
333 .verify = sa11x0_verify_speed,
334 .target = sa1110_target,
335 .get = sa11x0_getspeed,
336 .init = sa1110_cpu_init,
337 .name = "sa1110",
338};
339
340static int __init sa1110_clk_init(void)
341{
342 struct sdram_params *sdram = NULL;
343
344 if (machine_is_assabet())
345 sdram = &tc59sm716_cl3_params;
346
347 if (machine_is_pt_system3())
348 sdram = &samsung_k4s641632d_tc75;
349
350 if (machine_is_h3100())
351 sdram = &samsung_km416s4030ct;
352
353 if (sdram) {
354 printk(KERN_DEBUG "SDRAM: tck: %d trcd: %d trp: %d"
355 " twr: %d refresh: %d cas_latency: %d\n",
356 sdram->tck, sdram->trcd, sdram->trp,
357 sdram->twr, sdram->refresh, sdram->cas_latency);
358
359 memcpy(&sdram_params, sdram, sizeof(sdram_params));
360
361 return cpufreq_register_driver(&sa1110_driver);
362 }
363
364 return 0;
365}
366
367arch_initcall(sa1110_clk_init);
diff --git a/arch/arm/mach-sa1100/dma.c b/arch/arm/mach-sa1100/dma.c
new file mode 100644
index 000000000000..be0e4427bec7
--- /dev/null
+++ b/arch/arm/mach-sa1100/dma.c
@@ -0,0 +1,348 @@
1/*
2 * arch/arm/kernel/dma-sa1100.c
3 *
4 * Support functions for the SA11x0 internal DMA channels.
5 *
6 * Copyright (C) 2000, 2001 by Nicolas Pitre
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/module.h>
14#include <linux/interrupt.h>
15#include <linux/init.h>
16#include <linux/spinlock.h>
17#include <linux/errno.h>
18
19#include <asm/system.h>
20#include <asm/irq.h>
21#include <asm/hardware.h>
22#include <asm/dma.h>
23
24
25#undef DEBUG
26#ifdef DEBUG
27#define DPRINTK( s, arg... ) printk( "dma<%p>: " s, regs , ##arg )
28#else
29#define DPRINTK( x... )
30#endif
31
32
33typedef struct {
34 const char *device_id; /* device name */
35 u_long device; /* this channel device, 0 if unused*/
36 dma_callback_t callback; /* to call when DMA completes */
37 void *data; /* ... with private data ptr */
38} sa1100_dma_t;
39
40static sa1100_dma_t dma_chan[SA1100_DMA_CHANNELS];
41
42static spinlock_t dma_list_lock;
43
44
45static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
46{
47 dma_regs_t *dma_regs = dev_id;
48 sa1100_dma_t *dma = dma_chan + (((u_int)dma_regs >> 5) & 7);
49 int status = dma_regs->RdDCSR;
50
51 if (status & (DCSR_ERROR)) {
52 printk(KERN_CRIT "DMA on \"%s\" caused an error\n", dma->device_id);
53 dma_regs->ClrDCSR = DCSR_ERROR;
54 }
55
56 dma_regs->ClrDCSR = status & (DCSR_DONEA | DCSR_DONEB);
57 if (dma->callback) {
58 if (status & DCSR_DONEA)
59 dma->callback(dma->data);
60 if (status & DCSR_DONEB)
61 dma->callback(dma->data);
62 }
63 return IRQ_HANDLED;
64}
65
66
67/**
68 * sa1100_request_dma - allocate one of the SA11x0's DMA chanels
69 * @device: The SA11x0 peripheral targeted by this request
70 * @device_id: An ascii name for the claiming device
71 * @callback: Function to be called when the DMA completes
72 * @data: A cookie passed back to the callback function
73 * @dma_regs: Pointer to the location of the allocated channel's identifier
74 *
75 * This function will search for a free DMA channel and returns the
76 * address of the hardware registers for that channel as the channel
77 * identifier. This identifier is written to the location pointed by
78 * @dma_regs. The list of possible values for @device are listed into
79 * linux/include/asm-arm/arch-sa1100/dma.h as a dma_device_t enum.
80 *
81 * Note that reading from a port and writing to the same port are
82 * actually considered as two different streams requiring separate
83 * DMA registrations.
84 *
85 * The @callback function is called from interrupt context when one
86 * of the two possible DMA buffers in flight has terminated. That
87 * function has to be small and efficient while posponing more complex
88 * processing to a lower priority execution context.
89 *
90 * If no channels are available, or if the desired @device is already in
91 * use by another DMA channel, then an error code is returned. This
92 * function must be called before any other DMA calls.
93 **/
94
95int sa1100_request_dma (dma_device_t device, const char *device_id,
96 dma_callback_t callback, void *data,
97 dma_regs_t **dma_regs)
98{
99 sa1100_dma_t *dma = NULL;
100 dma_regs_t *regs;
101 int i, err;
102
103 *dma_regs = NULL;
104
105 err = 0;
106 spin_lock(&dma_list_lock);
107 for (i = 0; i < SA1100_DMA_CHANNELS; i++) {
108 if (dma_chan[i].device == device) {
109 err = -EBUSY;
110 break;
111 } else if (!dma_chan[i].device && !dma) {
112 dma = &dma_chan[i];
113 }
114 }
115 if (!err) {
116 if (dma)
117 dma->device = device;
118 else
119 err = -ENOSR;
120 }
121 spin_unlock(&dma_list_lock);
122 if (err)
123 return err;
124
125 i = dma - dma_chan;
126 regs = (dma_regs_t *)&DDAR(i);
127 err = request_irq(IRQ_DMA0 + i, dma_irq_handler, SA_INTERRUPT,
128 device_id, regs);
129 if (err) {
130 printk(KERN_ERR
131 "%s: unable to request IRQ %d for %s\n",
132 __FUNCTION__, IRQ_DMA0 + i, device_id);
133 dma->device = 0;
134 return err;
135 }
136
137 *dma_regs = regs;
138 dma->device_id = device_id;
139 dma->callback = callback;
140 dma->data = data;
141
142 regs->ClrDCSR =
143 (DCSR_DONEA | DCSR_DONEB | DCSR_STRTA | DCSR_STRTB |
144 DCSR_IE | DCSR_ERROR | DCSR_RUN);
145 regs->DDAR = device;
146
147 return 0;
148}
149
150
151/**
152 * sa1100_free_dma - free a SA11x0 DMA channel
153 * @regs: identifier for the channel to free
154 *
155 * This clears all activities on a given DMA channel and releases it
156 * for future requests. The @regs identifier is provided by a
157 * successful call to sa1100_request_dma().
158 **/
159
160void sa1100_free_dma(dma_regs_t *regs)
161{
162 int i;
163
164 for (i = 0; i < SA1100_DMA_CHANNELS; i++)
165 if (regs == (dma_regs_t *)&DDAR(i))
166 break;
167 if (i >= SA1100_DMA_CHANNELS) {
168 printk(KERN_ERR "%s: bad DMA identifier\n", __FUNCTION__);
169 return;
170 }
171
172 if (!dma_chan[i].device) {
173 printk(KERN_ERR "%s: Trying to free free DMA\n", __FUNCTION__);
174 return;
175 }
176
177 regs->ClrDCSR =
178 (DCSR_DONEA | DCSR_DONEB | DCSR_STRTA | DCSR_STRTB |
179 DCSR_IE | DCSR_ERROR | DCSR_RUN);
180 free_irq(IRQ_DMA0 + i, regs);
181 dma_chan[i].device = 0;
182}
183
184
185/**
186 * sa1100_start_dma - submit a data buffer for DMA
187 * @regs: identifier for the channel to use
188 * @dma_ptr: buffer physical (or bus) start address
189 * @size: buffer size
190 *
191 * This function hands the given data buffer to the hardware for DMA
192 * access. If another buffer is already in flight then this buffer
193 * will be queued so the DMA engine will switch to it automatically
194 * when the previous one is done. The DMA engine is actually toggling
195 * between two buffers so at most 2 successful calls can be made before
196 * one of them terminates and the callback function is called.
197 *
198 * The @regs identifier is provided by a successful call to
199 * sa1100_request_dma().
200 *
201 * The @size must not be larger than %MAX_DMA_SIZE. If a given buffer
202 * is larger than that then it's the caller's responsibility to split
203 * it into smaller chunks and submit them separately. If this is the
204 * case then a @size of %CUT_DMA_SIZE is recommended to avoid ending
205 * up with too small chunks. The callback function can be used to chain
206 * submissions of buffer chunks.
207 *
208 * Error return values:
209 * %-EOVERFLOW: Given buffer size is too big.
210 * %-EBUSY: Both DMA buffers are already in use.
211 * %-EAGAIN: Both buffers were busy but one of them just completed
212 * but the interrupt handler has to execute first.
213 *
214 * This function returs 0 on success.
215 **/
216
217int sa1100_start_dma(dma_regs_t *regs, dma_addr_t dma_ptr, u_int size)
218{
219 unsigned long flags;
220 u_long status;
221 int ret;
222
223 if (dma_ptr & 3)
224 printk(KERN_WARNING "DMA: unaligned start address (0x%08lx)\n",
225 (unsigned long)dma_ptr);
226
227 if (size > MAX_DMA_SIZE)
228 return -EOVERFLOW;
229
230 local_irq_save(flags);
231 status = regs->RdDCSR;
232
233 /* If both DMA buffers are started, there's nothing else we can do. */
234 if ((status & (DCSR_STRTA | DCSR_STRTB)) == (DCSR_STRTA | DCSR_STRTB)) {
235 DPRINTK("start: st %#x busy\n", status);
236 ret = -EBUSY;
237 goto out;
238 }
239
240 if (((status & DCSR_BIU) && (status & DCSR_STRTB)) ||
241 (!(status & DCSR_BIU) && !(status & DCSR_STRTA))) {
242 if (status & DCSR_DONEA) {
243 /* give a chance for the interrupt to be processed */
244 ret = -EAGAIN;
245 goto out;
246 }
247 regs->DBSA = dma_ptr;
248 regs->DBTA = size;
249 regs->SetDCSR = DCSR_STRTA | DCSR_IE | DCSR_RUN;
250 DPRINTK("start a=%#x s=%d on A\n", dma_ptr, size);
251 } else {
252 if (status & DCSR_DONEB) {
253 /* give a chance for the interrupt to be processed */
254 ret = -EAGAIN;
255 goto out;
256 }
257 regs->DBSB = dma_ptr;
258 regs->DBTB = size;
259 regs->SetDCSR = DCSR_STRTB | DCSR_IE | DCSR_RUN;
260 DPRINTK("start a=%#x s=%d on B\n", dma_ptr, size);
261 }
262 ret = 0;
263
264out:
265 local_irq_restore(flags);
266 return ret;
267}
268
269
270/**
271 * sa1100_get_dma_pos - return current DMA position
272 * @regs: identifier for the channel to use
273 *
274 * This function returns the current physical (or bus) address for the
275 * given DMA channel. If the channel is running i.e. not in a stopped
276 * state then the caller must disable interrupts prior calling this
277 * function and process the returned value before re-enabling them to
278 * prevent races with the completion interrupt handler and the callback
279 * function. The validation of the returned value is the caller's
280 * responsibility as well -- the hardware seems to return out of range
281 * values when the DMA engine completes a buffer.
282 *
283 * The @regs identifier is provided by a successful call to
284 * sa1100_request_dma().
285 **/
286
287dma_addr_t sa1100_get_dma_pos(dma_regs_t *regs)
288{
289 int status;
290
291 /*
292 * We must determine whether buffer A or B is active.
293 * Two possibilities: either we are in the middle of
294 * a buffer, or the DMA controller just switched to the
295 * next toggle but the interrupt hasn't been serviced yet.
296 * The former case is straight forward. In the later case,
297 * we'll do like if DMA is just at the end of the previous
298 * toggle since all registers haven't been reset yet.
299 * This goes around the edge case and since we're always
300 * a little behind anyways it shouldn't make a big difference.
301 * If DMA has been stopped prior calling this then the
302 * position is exact.
303 */
304 status = regs->RdDCSR;
305 if ((!(status & DCSR_BIU) && (status & DCSR_STRTA)) ||
306 ( (status & DCSR_BIU) && !(status & DCSR_STRTB)))
307 return regs->DBSA;
308 else
309 return regs->DBSB;
310}
311
312
313/**
314 * sa1100_reset_dma - reset a DMA channel
315 * @regs: identifier for the channel to use
316 *
317 * This function resets and reconfigure the given DMA channel. This is
318 * particularly useful after a sleep/wakeup event.
319 *
320 * The @regs identifier is provided by a successful call to
321 * sa1100_request_dma().
322 **/
323
324void sa1100_reset_dma(dma_regs_t *regs)
325{
326 int i;
327
328 for (i = 0; i < SA1100_DMA_CHANNELS; i++)
329 if (regs == (dma_regs_t *)&DDAR(i))
330 break;
331 if (i >= SA1100_DMA_CHANNELS) {
332 printk(KERN_ERR "%s: bad DMA identifier\n", __FUNCTION__);
333 return;
334 }
335
336 regs->ClrDCSR =
337 (DCSR_DONEA | DCSR_DONEB | DCSR_STRTA | DCSR_STRTB |
338 DCSR_IE | DCSR_ERROR | DCSR_RUN);
339 regs->DDAR = dma_chan[i].device;
340}
341
342
343EXPORT_SYMBOL(sa1100_request_dma);
344EXPORT_SYMBOL(sa1100_free_dma);
345EXPORT_SYMBOL(sa1100_start_dma);
346EXPORT_SYMBOL(sa1100_get_dma_pos);
347EXPORT_SYMBOL(sa1100_reset_dma);
348
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
new file mode 100644
index 000000000000..95ae217be1bc
--- /dev/null
+++ b/arch/arm/mach-sa1100/generic.c
@@ -0,0 +1,419 @@
1/*
2 * linux/arch/arm/mach-sa1100/generic.c
3 *
4 * Author: Nicolas Pitre
5 *
6 * Code common to all SA11x0 machines.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/config.h>
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/delay.h>
17#include <linux/pm.h>
18#include <linux/cpufreq.h>
19#include <linux/ioport.h>
20
21#include <asm/div64.h>
22#include <asm/hardware.h>
23#include <asm/system.h>
24#include <asm/pgtable.h>
25#include <asm/mach/map.h>
26#include <asm/irq.h>
27
28#include "generic.h"
29
30#define NR_FREQS 16
31
32/*
33 * This table is setup for a 3.6864MHz Crystal.
34 */
35static const unsigned short cclk_frequency_100khz[NR_FREQS] = {
36 590, /* 59.0 MHz */
37 737, /* 73.7 MHz */
38 885, /* 88.5 MHz */
39 1032, /* 103.2 MHz */
40 1180, /* 118.0 MHz */
41 1327, /* 132.7 MHz */
42 1475, /* 147.5 MHz */
43 1622, /* 162.2 MHz */
44 1769, /* 176.9 MHz */
45 1917, /* 191.7 MHz */
46 2064, /* 206.4 MHz */
47 2212, /* 221.2 MHz */
48 2359, /* 235.9 MHz */
49 2507, /* 250.7 MHz */
50 2654, /* 265.4 MHz */
51 2802 /* 280.2 MHz */
52};
53
54#if defined(CONFIG_CPU_FREQ_SA1100) || defined(CONFIG_CPU_FREQ_SA1110)
55/* rounds up(!) */
56unsigned int sa11x0_freq_to_ppcr(unsigned int khz)
57{
58 int i;
59
60 khz /= 100;
61
62 for (i = 0; i < NR_FREQS; i++)
63 if (cclk_frequency_100khz[i] >= khz)
64 break;
65
66 return i;
67}
68
69unsigned int sa11x0_ppcr_to_freq(unsigned int idx)
70{
71 unsigned int freq = 0;
72 if (idx < NR_FREQS)
73 freq = cclk_frequency_100khz[idx] * 100;
74 return freq;
75}
76
77
78/* make sure that only the "userspace" governor is run -- anything else wouldn't make sense on
79 * this platform, anyway.
80 */
81int sa11x0_verify_speed(struct cpufreq_policy *policy)
82{
83 unsigned int tmp;
84 if (policy->cpu)
85 return -EINVAL;
86
87 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, policy->cpuinfo.max_freq);
88
89 /* make sure that at least one frequency is within the policy */
90 tmp = cclk_frequency_100khz[sa11x0_freq_to_ppcr(policy->min)] * 100;
91 if (tmp > policy->max)
92 policy->max = tmp;
93
94 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, policy->cpuinfo.max_freq);
95
96 return 0;
97}
98
99unsigned int sa11x0_getspeed(unsigned int cpu)
100{
101 if (cpu)
102 return 0;
103 return cclk_frequency_100khz[PPCR & 0xf] * 100;
104}
105
106#else
107/*
108 * We still need to provide this so building without cpufreq works.
109 */
110unsigned int cpufreq_get(unsigned int cpu)
111{
112 return cclk_frequency_100khz[PPCR & 0xf] * 100;
113}
114EXPORT_SYMBOL(cpufreq_get);
115#endif
116
117/*
118 * This is the SA11x0 sched_clock implementation. This has
119 * a resolution of 271ns, and a maximum value of 1165s.
120 * ( * 1E9 / 3686400 => * 78125 / 288)
121 */
122unsigned long long sched_clock(void)
123{
124 unsigned long long v;
125
126 v = (unsigned long long)OSCR * 78125;
127 do_div(v, 288);
128
129 return v;
130}
131
132/*
133 * Default power-off for SA1100
134 */
135static void sa1100_power_off(void)
136{
137 mdelay(100);
138 local_irq_disable();
139 /* disable internal oscillator, float CS lines */
140 PCFR = (PCFR_OPDE | PCFR_FP | PCFR_FS);
141 /* enable wake-up on GPIO0 (Assabet...) */
142 PWER = GFER = GRER = 1;
143 /*
144 * set scratchpad to zero, just in case it is used as a
145 * restart address by the bootloader.
146 */
147 PSPR = 0;
148 /* enter sleep mode */
149 PMCR = PMCR_SF;
150}
151
152static struct resource sa11x0udc_resources[] = {
153 [0] = {
154 .start = 0x80000000,
155 .end = 0x8000ffff,
156 .flags = IORESOURCE_MEM,
157 },
158};
159
160static u64 sa11x0udc_dma_mask = 0xffffffffUL;
161
162static struct platform_device sa11x0udc_device = {
163 .name = "sa11x0-udc",
164 .id = -1,
165 .dev = {
166 .dma_mask = &sa11x0udc_dma_mask,
167 .coherent_dma_mask = 0xffffffff,
168 },
169 .num_resources = ARRAY_SIZE(sa11x0udc_resources),
170 .resource = sa11x0udc_resources,
171};
172
173static struct resource sa11x0uart1_resources[] = {
174 [0] = {
175 .start = 0x80010000,
176 .end = 0x8001ffff,
177 .flags = IORESOURCE_MEM,
178 },
179};
180
181static struct platform_device sa11x0uart1_device = {
182 .name = "sa11x0-uart",
183 .id = 1,
184 .num_resources = ARRAY_SIZE(sa11x0uart1_resources),
185 .resource = sa11x0uart1_resources,
186};
187
188static struct resource sa11x0uart3_resources[] = {
189 [0] = {
190 .start = 0x80050000,
191 .end = 0x8005ffff,
192 .flags = IORESOURCE_MEM,
193 },
194};
195
196static struct platform_device sa11x0uart3_device = {
197 .name = "sa11x0-uart",
198 .id = 3,
199 .num_resources = ARRAY_SIZE(sa11x0uart3_resources),
200 .resource = sa11x0uart3_resources,
201};
202
203static struct resource sa11x0mcp_resources[] = {
204 [0] = {
205 .start = 0x80060000,
206 .end = 0x8006ffff,
207 .flags = IORESOURCE_MEM,
208 },
209};
210
211static u64 sa11x0mcp_dma_mask = 0xffffffffUL;
212
213static struct platform_device sa11x0mcp_device = {
214 .name = "sa11x0-mcp",
215 .id = -1,
216 .dev = {
217 .dma_mask = &sa11x0mcp_dma_mask,
218 .coherent_dma_mask = 0xffffffff,
219 },
220 .num_resources = ARRAY_SIZE(sa11x0mcp_resources),
221 .resource = sa11x0mcp_resources,
222};
223
224static struct resource sa11x0ssp_resources[] = {
225 [0] = {
226 .start = 0x80070000,
227 .end = 0x8007ffff,
228 .flags = IORESOURCE_MEM,
229 },
230};
231
232static u64 sa11x0ssp_dma_mask = 0xffffffffUL;
233
234static struct platform_device sa11x0ssp_device = {
235 .name = "sa11x0-ssp",
236 .id = -1,
237 .dev = {
238 .dma_mask = &sa11x0ssp_dma_mask,
239 .coherent_dma_mask = 0xffffffff,
240 },
241 .num_resources = ARRAY_SIZE(sa11x0ssp_resources),
242 .resource = sa11x0ssp_resources,
243};
244
245static struct resource sa11x0fb_resources[] = {
246 [0] = {
247 .start = 0xb0100000,
248 .end = 0xb010ffff,
249 .flags = IORESOURCE_MEM,
250 },
251 [1] = {
252 .start = IRQ_LCD,
253 .end = IRQ_LCD,
254 .flags = IORESOURCE_IRQ,
255 },
256};
257
258static struct platform_device sa11x0fb_device = {
259 .name = "sa11x0-fb",
260 .id = -1,
261 .dev = {
262 .coherent_dma_mask = 0xffffffff,
263 },
264 .num_resources = ARRAY_SIZE(sa11x0fb_resources),
265 .resource = sa11x0fb_resources,
266};
267
268static struct platform_device sa11x0pcmcia_device = {
269 .name = "sa11x0-pcmcia",
270 .id = -1,
271};
272
273static struct platform_device sa11x0mtd_device = {
274 .name = "flash",
275 .id = -1,
276};
277
278void sa11x0_set_flash_data(struct flash_platform_data *flash,
279 struct resource *res, int nr)
280{
281 sa11x0mtd_device.dev.platform_data = flash;
282 sa11x0mtd_device.resource = res;
283 sa11x0mtd_device.num_resources = nr;
284}
285
286static struct resource sa11x0ir_resources[] = {
287 {
288 .start = __PREG(Ser2UTCR0),
289 .end = __PREG(Ser2UTCR0) + 0x24 - 1,
290 .flags = IORESOURCE_MEM,
291 }, {
292 .start = __PREG(Ser2HSCR0),
293 .end = __PREG(Ser2HSCR0) + 0x1c - 1,
294 .flags = IORESOURCE_MEM,
295 }, {
296 .start = __PREG(Ser2HSCR2),
297 .end = __PREG(Ser2HSCR2) + 0x04 - 1,
298 .flags = IORESOURCE_MEM,
299 }, {
300 .start = IRQ_Ser2ICP,
301 .end = IRQ_Ser2ICP,
302 .flags = IORESOURCE_IRQ,
303 }
304};
305
306static struct platform_device sa11x0ir_device = {
307 .name = "sa11x0-ir",
308 .id = -1,
309 .num_resources = ARRAY_SIZE(sa11x0ir_resources),
310 .resource = sa11x0ir_resources,
311};
312
313void sa11x0_set_irda_data(struct irda_platform_data *irda)
314{
315 sa11x0ir_device.dev.platform_data = irda;
316}
317
318static struct platform_device *sa11x0_devices[] __initdata = {
319 &sa11x0udc_device,
320 &sa11x0uart1_device,
321 &sa11x0uart3_device,
322 &sa11x0mcp_device,
323 &sa11x0ssp_device,
324 &sa11x0pcmcia_device,
325 &sa11x0fb_device,
326 &sa11x0mtd_device,
327};
328
329static int __init sa1100_init(void)
330{
331 pm_power_off = sa1100_power_off;
332
333 if (sa11x0ir_device.dev.platform_data)
334 platform_device_register(&sa11x0ir_device);
335
336 return platform_add_devices(sa11x0_devices, ARRAY_SIZE(sa11x0_devices));
337}
338
339arch_initcall(sa1100_init);
340
341void (*sa1100fb_backlight_power)(int on);
342void (*sa1100fb_lcd_power)(int on);
343
344EXPORT_SYMBOL(sa1100fb_backlight_power);
345EXPORT_SYMBOL(sa1100fb_lcd_power);
346
347
348/*
349 * Common I/O mapping:
350 *
351 * Typically, static virtual address mappings are as follow:
352 *
353 * 0xf0000000-0xf3ffffff: miscellaneous stuff (CPLDs, etc.)
354 * 0xf4000000-0xf4ffffff: SA-1111
355 * 0xf5000000-0xf5ffffff: reserved (used by cache flushing area)
356 * 0xf6000000-0xfffeffff: reserved (internal SA1100 IO defined above)
357 * 0xffff0000-0xffff0fff: SA1100 exception vectors
358 * 0xffff2000-0xffff2fff: Minicache copy_user_page area
359 *
360 * Below 0xe8000000 is reserved for vm allocation.
361 *
362 * The machine specific code must provide the extra mapping beside the
363 * default mapping provided here.
364 */
365
366static struct map_desc standard_io_desc[] __initdata = {
367 /* virtual physical length type */
368 { 0xf8000000, 0x80000000, 0x00100000, MT_DEVICE }, /* PCM */
369 { 0xfa000000, 0x90000000, 0x00100000, MT_DEVICE }, /* SCM */
370 { 0xfc000000, 0xa0000000, 0x00100000, MT_DEVICE }, /* MER */
371 { 0xfe000000, 0xb0000000, 0x00200000, MT_DEVICE } /* LCD + DMA */
372};
373
374void __init sa1100_map_io(void)
375{
376 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
377}
378
379/*
380 * Disable the memory bus request/grant signals on the SA1110 to
381 * ensure that we don't receive spurious memory requests. We set
382 * the MBGNT signal false to ensure the SA1111 doesn't own the
383 * SDRAM bus.
384 */
385void __init sa1110_mb_disable(void)
386{
387 unsigned long flags;
388
389 local_irq_save(flags);
390
391 PGSR &= ~GPIO_MBGNT;
392 GPCR = GPIO_MBGNT;
393 GPDR = (GPDR & ~GPIO_MBREQ) | GPIO_MBGNT;
394
395 GAFR &= ~(GPIO_MBGNT | GPIO_MBREQ);
396
397 local_irq_restore(flags);
398}
399
400/*
401 * If the system is going to use the SA-1111 DMA engines, set up
402 * the memory bus request/grant pins.
403 */
404void __init sa1110_mb_enable(void)
405{
406 unsigned long flags;
407
408 local_irq_save(flags);
409
410 PGSR &= ~GPIO_MBGNT;
411 GPCR = GPIO_MBGNT;
412 GPDR = (GPDR & ~GPIO_MBREQ) | GPIO_MBGNT;
413
414 GAFR |= (GPIO_MBGNT | GPIO_MBREQ);
415 TUCR |= TUCR_MR;
416
417 local_irq_restore(flags);
418}
419
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
new file mode 100644
index 000000000000..bfe41da9923e
--- /dev/null
+++ b/arch/arm/mach-sa1100/generic.h
@@ -0,0 +1,38 @@
1/*
2 * linux/arch/arm/mach-sa1100/generic.h
3 *
4 * Author: Nicolas Pitre
5 */
6
7struct sys_timer;
8
9extern struct sys_timer sa1100_timer;
10extern void __init sa1100_map_io(void);
11extern void __init sa1100_init_irq(void);
12
13#define SET_BANK(__nr,__start,__size) \
14 mi->bank[__nr].start = (__start), \
15 mi->bank[__nr].size = (__size), \
16 mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27)
17
18extern void (*sa1100fb_backlight_power)(int on);
19extern void (*sa1100fb_lcd_power)(int on);
20
21extern void sa1110_mb_enable(void);
22extern void sa1110_mb_disable(void);
23
24struct cpufreq_policy;
25
26extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz);
27extern int sa11x0_verify_speed(struct cpufreq_policy *policy);
28extern unsigned int sa11x0_getspeed(unsigned int cpu);
29extern unsigned int sa11x0_ppcr_to_freq(unsigned int idx);
30
31struct flash_platform_data;
32struct resource;
33
34extern void sa11x0_set_flash_data(struct flash_platform_data *flash,
35 struct resource *res, int nr);
36
37struct irda_platform_data;
38void sa11x0_set_irda_data(struct irda_platform_data *irda);
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
new file mode 100644
index 000000000000..9788d3aefa73
--- /dev/null
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -0,0 +1,892 @@
1/*
2 * Hardware definitions for Compaq iPAQ H3xxx Handheld Computers
3 *
4 * Copyright 2000,1 Compaq Computer Corporation.
5 *
6 * Use consistent with the GNU GPL is permitted,
7 * provided that this copyright notice is
8 * preserved in its entirety in all copies and derived works.
9 *
10 * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
11 * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
12 * FITNESS FOR ANY PARTICULAR PURPOSE.
13 *
14 * Author: Jamey Hicks.
15 *
16 * History:
17 *
18 * 2001-10-?? Andrew Christian Added support for iPAQ H3800
19 * and abstracted EGPIO interface.
20 *
21 */
22#include <linux/config.h>
23#include <linux/module.h>
24#include <linux/init.h>
25#include <linux/kernel.h>
26#include <linux/tty.h>
27#include <linux/pm.h>
28#include <linux/device.h>
29#include <linux/mtd/mtd.h>
30#include <linux/mtd/partitions.h>
31#include <linux/serial_core.h>
32
33#include <asm/irq.h>
34#include <asm/hardware.h>
35#include <asm/mach-types.h>
36#include <asm/setup.h>
37
38#include <asm/mach/irq.h>
39#include <asm/mach/arch.h>
40#include <asm/mach/flash.h>
41#include <asm/mach/irda.h>
42#include <asm/mach/map.h>
43#include <asm/mach/serial_sa1100.h>
44
45#include <asm/arch/h3600.h>
46
47#if defined (CONFIG_SA1100_H3600) || defined (CONFIG_SA1100_H3100)
48#include <asm/arch/h3600_gpio.h>
49#endif
50
51#ifdef CONFIG_SA1100_H3800
52#include <asm/arch/h3600_asic.h>
53#endif
54
55#include "generic.h"
56
57struct ipaq_model_ops ipaq_model_ops;
58EXPORT_SYMBOL(ipaq_model_ops);
59
60static struct mtd_partition h3xxx_partitions[] = {
61 {
62 .name = "H3XXX boot firmware",
63 .size = 0x00040000,
64 .offset = 0,
65 .mask_flags = MTD_WRITEABLE, /* force read-only */
66 }, {
67#ifdef CONFIG_MTD_2PARTS_IPAQ
68 .name = "H3XXX root jffs2",
69 .size = MTDPART_SIZ_FULL,
70 .offset = 0x00040000,
71#else
72 .name = "H3XXX kernel",
73 .size = 0x00080000,
74 .offset = 0x00040000,
75 }, {
76 .name = "H3XXX params",
77 .size = 0x00040000,
78 .offset = 0x000C0000,
79 }, {
80#ifdef CONFIG_JFFS2_FS
81 .name = "H3XXX root jffs2",
82 .size = MTDPART_SIZ_FULL,
83 .offset = 0x00100000,
84#else
85 .name = "H3XXX initrd",
86 .size = 0x00100000,
87 .offset = 0x00100000,
88 }, {
89 .name = "H3XXX root cramfs",
90 .size = 0x00300000,
91 .offset = 0x00200000,
92 }, {
93 .name = "H3XXX usr cramfs",
94 .size = 0x00800000,
95 .offset = 0x00500000,
96 }, {
97 .name = "H3XXX usr local",
98 .size = MTDPART_SIZ_FULL,
99 .offset = 0x00d00000,
100#endif
101#endif
102 }
103};
104
105static void h3xxx_set_vpp(int vpp)
106{
107 assign_h3600_egpio(IPAQ_EGPIO_VPP_ON, vpp);
108}
109
110static struct flash_platform_data h3xxx_flash_data = {
111 .map_name = "cfi_probe",
112 .set_vpp = h3xxx_set_vpp,
113 .parts = h3xxx_partitions,
114 .nr_parts = ARRAY_SIZE(h3xxx_partitions),
115};
116
117static struct resource h3xxx_flash_resource = {
118 .start = SA1100_CS0_PHYS,
119 .end = SA1100_CS0_PHYS + SZ_32M - 1,
120 .flags = IORESOURCE_MEM,
121};
122
123/*
124 * This turns the IRDA power on or off on the Compaq H3600
125 */
126static int h3600_irda_set_power(struct device *dev, unsigned int state)
127{
128 assign_h3600_egpio( IPAQ_EGPIO_IR_ON, state );
129
130 return 0;
131}
132
133static void h3600_irda_set_speed(struct device *dev, int speed)
134{
135 if (speed < 4000000) {
136 clr_h3600_egpio(IPAQ_EGPIO_IR_FSEL);
137 } else {
138 set_h3600_egpio(IPAQ_EGPIO_IR_FSEL);
139 }
140}
141
142static struct irda_platform_data h3600_irda_data = {
143 .set_power = h3600_irda_set_power,
144 .set_speed = h3600_irda_set_speed,
145};
146
147static void h3xxx_mach_init(void)
148{
149 sa11x0_set_flash_data(&h3xxx_flash_data, &h3xxx_flash_resource, 1);
150 sa11x0_set_irda_data(&h3600_irda_data);
151}
152
153/*
154 * low-level UART features
155 */
156
157static void h3600_uart_set_mctrl(struct uart_port *port, u_int mctrl)
158{
159 if (port->mapbase == _Ser3UTCR0) {
160 if (mctrl & TIOCM_RTS)
161 GPCR = GPIO_H3600_COM_RTS;
162 else
163 GPSR = GPIO_H3600_COM_RTS;
164 }
165}
166
167static u_int h3600_uart_get_mctrl(struct uart_port *port)
168{
169 u_int ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
170
171 if (port->mapbase == _Ser3UTCR0) {
172 int gplr = GPLR;
173 /* DCD and CTS bits are inverted in GPLR by RS232 transceiver */
174 if (gplr & GPIO_H3600_COM_DCD)
175 ret &= ~TIOCM_CD;
176 if (gplr & GPIO_H3600_COM_CTS)
177 ret &= ~TIOCM_CTS;
178 }
179
180 return ret;
181}
182
183static void h3600_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
184{
185 if (port->mapbase == _Ser2UTCR0) { /* TODO: REMOVE THIS */
186 assign_h3600_egpio(IPAQ_EGPIO_IR_ON, !state);
187 } else if (port->mapbase == _Ser3UTCR0) {
188 assign_h3600_egpio(IPAQ_EGPIO_RS232_ON, !state);
189 }
190}
191
192/*
193 * Enable/Disable wake up events for this serial port.
194 * Obviously, we only support this on the normal COM port.
195 */
196static int h3600_uart_set_wake(struct uart_port *port, u_int enable)
197{
198 int err = -EINVAL;
199
200 if (port->mapbase == _Ser3UTCR0) {
201 if (enable)
202 PWER |= PWER_GPIO23 | PWER_GPIO25; /* DCD and CTS */
203 else
204 PWER &= ~(PWER_GPIO23 | PWER_GPIO25); /* DCD and CTS */
205 err = 0;
206 }
207 return err;
208}
209
210static struct sa1100_port_fns h3600_port_fns __initdata = {
211 .set_mctrl = h3600_uart_set_mctrl,
212 .get_mctrl = h3600_uart_get_mctrl,
213 .pm = h3600_uart_pm,
214 .set_wake = h3600_uart_set_wake,
215};
216
217/*
218 * helper for sa1100fb
219 */
220static void h3xxx_lcd_power(int enable)
221{
222 assign_h3600_egpio(IPAQ_EGPIO_LCD_POWER, enable);
223}
224
225static struct map_desc h3600_io_desc[] __initdata = {
226 /* virtual physical length type */
227 { H3600_BANK_2_VIRT, SA1100_CS2_PHYS, 0x02800000, MT_DEVICE }, /* static memory bank 2 CS#2 */
228 { H3600_BANK_4_VIRT, SA1100_CS4_PHYS, 0x00800000, MT_DEVICE }, /* static memory bank 4 CS#4 */
229 { H3600_EGPIO_VIRT, H3600_EGPIO_PHYS, 0x01000000, MT_DEVICE }, /* EGPIO 0 CS#5 */
230};
231
232/*
233 * Common map_io initialization
234 */
235
236static void __init h3xxx_map_io(void)
237{
238 sa1100_map_io();
239 iotable_init(h3600_io_desc, ARRAY_SIZE(h3600_io_desc));
240
241 sa1100_register_uart_fns(&h3600_port_fns);
242 sa1100_register_uart(0, 3); /* Common serial port */
243// sa1100_register_uart(1, 1); /* Microcontroller on 3100/3600 */
244
245 /* Ensure those pins are outputs and driving low */
246 PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
247 PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
248
249 /* Configure suspend conditions */
250 PGSR = 0;
251 PWER = PWER_GPIO0 | PWER_RTC;
252 PCFR = PCFR_OPDE;
253 PSDR = 0;
254
255 sa1100fb_lcd_power = h3xxx_lcd_power;
256}
257
258static __inline__ void do_blank(int setp)
259{
260 if (ipaq_model_ops.blank_callback)
261 ipaq_model_ops.blank_callback(1-setp);
262}
263
264/************************* H3100 *************************/
265
266#ifdef CONFIG_SA1100_H3100
267
268#define H3100_EGPIO (*(volatile unsigned int *)H3600_EGPIO_VIRT)
269static unsigned int h3100_egpio = 0;
270
271static void h3100_control_egpio(enum ipaq_egpio_type x, int setp)
272{
273 unsigned int egpio = 0;
274 long gpio = 0;
275 unsigned long flags;
276
277 switch (x) {
278 case IPAQ_EGPIO_LCD_POWER:
279 egpio |= EGPIO_H3600_LCD_ON;
280 gpio |= GPIO_H3100_LCD_3V_ON;
281 do_blank(setp);
282 break;
283 case IPAQ_EGPIO_LCD_ENABLE:
284 break;
285 case IPAQ_EGPIO_CODEC_NRESET:
286 egpio |= EGPIO_H3600_CODEC_NRESET;
287 break;
288 case IPAQ_EGPIO_AUDIO_ON:
289 gpio |= GPIO_H3100_AUD_PWR_ON
290 | GPIO_H3100_AUD_ON;
291 break;
292 case IPAQ_EGPIO_QMUTE:
293 gpio |= GPIO_H3100_QMUTE;
294 break;
295 case IPAQ_EGPIO_OPT_NVRAM_ON:
296 egpio |= EGPIO_H3600_OPT_NVRAM_ON;
297 break;
298 case IPAQ_EGPIO_OPT_ON:
299 egpio |= EGPIO_H3600_OPT_ON;
300 break;
301 case IPAQ_EGPIO_CARD_RESET:
302 egpio |= EGPIO_H3600_CARD_RESET;
303 break;
304 case IPAQ_EGPIO_OPT_RESET:
305 egpio |= EGPIO_H3600_OPT_RESET;
306 break;
307 case IPAQ_EGPIO_IR_ON:
308 gpio |= GPIO_H3100_IR_ON;
309 break;
310 case IPAQ_EGPIO_IR_FSEL:
311 gpio |= GPIO_H3100_IR_FSEL;
312 break;
313 case IPAQ_EGPIO_RS232_ON:
314 egpio |= EGPIO_H3600_RS232_ON;
315 break;
316 case IPAQ_EGPIO_VPP_ON:
317 egpio |= EGPIO_H3600_VPP_ON;
318 break;
319 }
320
321 if (egpio || gpio) {
322 local_irq_save(flags);
323 if (setp) {
324 h3100_egpio |= egpio;
325 GPSR = gpio;
326 } else {
327 h3100_egpio &= ~egpio;
328 GPCR = gpio;
329 }
330 H3100_EGPIO = h3100_egpio;
331 local_irq_restore(flags);
332 }
333}
334
335static unsigned long h3100_read_egpio(void)
336{
337 return h3100_egpio;
338}
339
340static int h3100_pm_callback(int req)
341{
342 if (ipaq_model_ops.pm_callback_aux)
343 return ipaq_model_ops.pm_callback_aux(req);
344 return 0;
345}
346
347static struct ipaq_model_ops h3100_model_ops __initdata = {
348 .generic_name = "3100",
349 .control = h3100_control_egpio,
350 .read = h3100_read_egpio,
351 .pm_callback = h3100_pm_callback
352};
353
354#define H3100_DIRECT_EGPIO (GPIO_H3100_BT_ON \
355 | GPIO_H3100_GPIO3 \
356 | GPIO_H3100_QMUTE \
357 | GPIO_H3100_LCD_3V_ON \
358 | GPIO_H3100_AUD_ON \
359 | GPIO_H3100_AUD_PWR_ON \
360 | GPIO_H3100_IR_ON \
361 | GPIO_H3100_IR_FSEL)
362
363static void __init h3100_map_io(void)
364{
365 h3xxx_map_io();
366
367 /* Initialize h3100-specific values here */
368 GPCR = 0x0fffffff; /* All outputs are set low by default */
369 GPDR = GPIO_H3600_COM_RTS | GPIO_H3600_L3_CLOCK |
370 GPIO_H3600_L3_MODE | GPIO_H3600_L3_DATA |
371 GPIO_H3600_CLK_SET1 | GPIO_H3600_CLK_SET0 |
372 H3100_DIRECT_EGPIO;
373
374 /* Older bootldrs put GPIO2-9 in alternate mode on the
375 assumption that they are used for video */
376 GAFR &= ~H3100_DIRECT_EGPIO;
377
378 H3100_EGPIO = h3100_egpio;
379 ipaq_model_ops = h3100_model_ops;
380}
381
382MACHINE_START(H3100, "Compaq iPAQ H3100")
383 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
384 BOOT_PARAMS(0xc0000100)
385 MAPIO(h3100_map_io)
386 INITIRQ(sa1100_init_irq)
387 .timer = &sa1100_timer,
388 .init_machine = h3xxx_mach_init,
389MACHINE_END
390
391#endif /* CONFIG_SA1100_H3100 */
392
393/************************* H3600 *************************/
394
395#ifdef CONFIG_SA1100_H3600
396
397#define H3600_EGPIO (*(volatile unsigned int *)H3600_EGPIO_VIRT)
398static unsigned int h3600_egpio = EGPIO_H3600_RS232_ON;
399
400static void h3600_control_egpio(enum ipaq_egpio_type x, int setp)
401{
402 unsigned int egpio = 0;
403 unsigned long flags;
404
405 switch (x) {
406 case IPAQ_EGPIO_LCD_POWER:
407 egpio |= EGPIO_H3600_LCD_ON |
408 EGPIO_H3600_LCD_PCI |
409 EGPIO_H3600_LCD_5V_ON |
410 EGPIO_H3600_LVDD_ON;
411 do_blank(setp);
412 break;
413 case IPAQ_EGPIO_LCD_ENABLE:
414 break;
415 case IPAQ_EGPIO_CODEC_NRESET:
416 egpio |= EGPIO_H3600_CODEC_NRESET;
417 break;
418 case IPAQ_EGPIO_AUDIO_ON:
419 egpio |= EGPIO_H3600_AUD_AMP_ON |
420 EGPIO_H3600_AUD_PWR_ON;
421 break;
422 case IPAQ_EGPIO_QMUTE:
423 egpio |= EGPIO_H3600_QMUTE;
424 break;
425 case IPAQ_EGPIO_OPT_NVRAM_ON:
426 egpio |= EGPIO_H3600_OPT_NVRAM_ON;
427 break;
428 case IPAQ_EGPIO_OPT_ON:
429 egpio |= EGPIO_H3600_OPT_ON;
430 break;
431 case IPAQ_EGPIO_CARD_RESET:
432 egpio |= EGPIO_H3600_CARD_RESET;
433 break;
434 case IPAQ_EGPIO_OPT_RESET:
435 egpio |= EGPIO_H3600_OPT_RESET;
436 break;
437 case IPAQ_EGPIO_IR_ON:
438 egpio |= EGPIO_H3600_IR_ON;
439 break;
440 case IPAQ_EGPIO_IR_FSEL:
441 egpio |= EGPIO_H3600_IR_FSEL;
442 break;
443 case IPAQ_EGPIO_RS232_ON:
444 egpio |= EGPIO_H3600_RS232_ON;
445 break;
446 case IPAQ_EGPIO_VPP_ON:
447 egpio |= EGPIO_H3600_VPP_ON;
448 break;
449 }
450
451 if (egpio) {
452 local_irq_save(flags);
453 if (setp)
454 h3600_egpio |= egpio;
455 else
456 h3600_egpio &= ~egpio;
457 H3600_EGPIO = h3600_egpio;
458 local_irq_restore(flags);
459 }
460}
461
462static unsigned long h3600_read_egpio(void)
463{
464 return h3600_egpio;
465}
466
467static int h3600_pm_callback(int req)
468{
469 if (ipaq_model_ops.pm_callback_aux)
470 return ipaq_model_ops.pm_callback_aux(req);
471 return 0;
472}
473
474static struct ipaq_model_ops h3600_model_ops __initdata = {
475 .generic_name = "3600",
476 .control = h3600_control_egpio,
477 .read = h3600_read_egpio,
478 .pm_callback = h3600_pm_callback
479};
480
481static void __init h3600_map_io(void)
482{
483 h3xxx_map_io();
484
485 /* Initialize h3600-specific values here */
486
487 GPCR = 0x0fffffff; /* All outputs are set low by default */
488 GPDR = GPIO_H3600_COM_RTS | GPIO_H3600_L3_CLOCK |
489 GPIO_H3600_L3_MODE | GPIO_H3600_L3_DATA |
490 GPIO_H3600_CLK_SET1 | GPIO_H3600_CLK_SET0 |
491 GPIO_LDD15 | GPIO_LDD14 | GPIO_LDD13 | GPIO_LDD12 |
492 GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8;
493
494 H3600_EGPIO = h3600_egpio; /* Maintains across sleep? */
495 ipaq_model_ops = h3600_model_ops;
496}
497
498MACHINE_START(H3600, "Compaq iPAQ H3600")
499 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
500 BOOT_PARAMS(0xc0000100)
501 MAPIO(h3600_map_io)
502 INITIRQ(sa1100_init_irq)
503 .timer = &sa1100_timer,
504 .init_machine = h3xxx_mach_init,
505MACHINE_END
506
507#endif /* CONFIG_SA1100_H3600 */
508
509#ifdef CONFIG_SA1100_H3800
510
511#define SET_ASIC1(x) \
512 do {if (setp) { H3800_ASIC1_GPIO_OUT |= (x); } else { H3800_ASIC1_GPIO_OUT &= ~(x); }} while(0)
513
514#define SET_ASIC2(x) \
515 do {if (setp) { H3800_ASIC2_GPIOPIOD |= (x); } else { H3800_ASIC2_GPIOPIOD &= ~(x); }} while(0)
516
517#define CLEAR_ASIC1(x) \
518 do {if (setp) { H3800_ASIC1_GPIO_OUT &= ~(x); } else { H3800_ASIC1_GPIO_OUT |= (x); }} while(0)
519
520#define CLEAR_ASIC2(x) \
521 do {if (setp) { H3800_ASIC2_GPIOPIOD &= ~(x); } else { H3800_ASIC2_GPIOPIOD |= (x); }} while(0)
522
523
524/*
525 On screen enable, we get
526
527 h3800_video_power_on(1)
528 LCD controller starts
529 h3800_video_lcd_enable(1)
530
531 On screen disable, we get
532
533 h3800_video_lcd_enable(0)
534 LCD controller stops
535 h3800_video_power_on(0)
536*/
537
538
539static void h3800_video_power_on(int setp)
540{
541 if (setp) {
542 H3800_ASIC1_GPIO_OUT |= GPIO1_LCD_ON;
543 msleep(30);
544 H3800_ASIC1_GPIO_OUT |= GPIO1_VGL_ON;
545 msleep(5);
546 H3800_ASIC1_GPIO_OUT |= GPIO1_VGH_ON;
547 msleep(50);
548 H3800_ASIC1_GPIO_OUT |= GPIO1_LCD_5V_ON;
549 msleep(5);
550 } else {
551 msleep(5);
552 H3800_ASIC1_GPIO_OUT &= ~GPIO1_LCD_5V_ON;
553 msleep(50);
554 H3800_ASIC1_GPIO_OUT &= ~GPIO1_VGL_ON;
555 msleep(5);
556 H3800_ASIC1_GPIO_OUT &= ~GPIO1_VGH_ON;
557 msleep(100);
558 H3800_ASIC1_GPIO_OUT &= ~GPIO1_LCD_ON;
559 }
560}
561
562static void h3800_video_lcd_enable(int setp)
563{
564 if (setp) {
565 msleep(17); // Wait one from before turning on
566 H3800_ASIC1_GPIO_OUT |= GPIO1_LCD_PCI;
567 } else {
568 H3800_ASIC1_GPIO_OUT &= ~GPIO1_LCD_PCI;
569 msleep(30); // Wait before turning off
570 }
571}
572
573
574static void h3800_control_egpio(enum ipaq_egpio_type x, int setp)
575{
576 switch (x) {
577 case IPAQ_EGPIO_LCD_POWER:
578 h3800_video_power_on(setp);
579 break;
580 case IPAQ_EGPIO_LCD_ENABLE:
581 h3800_video_lcd_enable(setp);
582 break;
583 case IPAQ_EGPIO_CODEC_NRESET:
584 case IPAQ_EGPIO_AUDIO_ON:
585 case IPAQ_EGPIO_QMUTE:
586 printk("%s: error - should not be called\n", __FUNCTION__);
587 break;
588 case IPAQ_EGPIO_OPT_NVRAM_ON:
589 SET_ASIC2(GPIO2_OPT_ON_NVRAM);
590 break;
591 case IPAQ_EGPIO_OPT_ON:
592 SET_ASIC2(GPIO2_OPT_ON);
593 break;
594 case IPAQ_EGPIO_CARD_RESET:
595 SET_ASIC2(GPIO2_OPT_PCM_RESET);
596 break;
597 case IPAQ_EGPIO_OPT_RESET:
598 SET_ASIC2(GPIO2_OPT_RESET);
599 break;
600 case IPAQ_EGPIO_IR_ON:
601 CLEAR_ASIC1(GPIO1_IR_ON_N);
602 break;
603 case IPAQ_EGPIO_IR_FSEL:
604 break;
605 case IPAQ_EGPIO_RS232_ON:
606 SET_ASIC1(GPIO1_RS232_ON);
607 break;
608 case IPAQ_EGPIO_VPP_ON:
609 H3800_ASIC2_FlashWP_VPP_ON = setp;
610 break;
611 }
612}
613
614static unsigned long h3800_read_egpio(void)
615{
616 return H3800_ASIC1_GPIO_OUT | (H3800_ASIC2_GPIOPIOD << 16);
617}
618
619/* We need to fix ASIC2 GPIO over suspend/resume. At the moment,
620 it doesn't appear that ASIC1 GPIO has the same problem */
621
622static int h3800_pm_callback(int req)
623{
624 static u16 asic1_data;
625 static u16 asic2_data;
626 int result = 0;
627
628 printk("%s %d\n", __FUNCTION__, req);
629
630 switch (req) {
631 case PM_RESUME:
632 MSC2 = (MSC2 & 0x0000ffff) | 0xE4510000; /* Set MSC2 correctly */
633
634 H3800_ASIC2_GPIOPIOD = asic2_data;
635 H3800_ASIC2_GPIODIR = GPIO2_PEN_IRQ
636 | GPIO2_SD_DETECT
637 | GPIO2_EAR_IN_N
638 | GPIO2_USB_DETECT_N
639 | GPIO2_SD_CON_SLT;
640
641 H3800_ASIC1_GPIO_OUT = asic1_data;
642
643 if (ipaq_model_ops.pm_callback_aux)
644 result = ipaq_model_ops.pm_callback_aux(req);
645 break;
646
647 case PM_SUSPEND:
648 if (ipaq_model_ops.pm_callback_aux &&
649 ((result = ipaq_model_ops.pm_callback_aux(req)) != 0))
650 return result;
651
652 asic1_data = H3800_ASIC1_GPIO_OUT;
653 asic2_data = H3800_ASIC2_GPIOPIOD;
654 break;
655 default:
656 printk("%s: unrecognized PM callback\n", __FUNCTION__);
657 break;
658 }
659 return result;
660}
661
662static struct ipaq_model_ops h3800_model_ops __initdata = {
663 .generic_name = "3800",
664 .control = h3800_control_egpio,
665 .read = h3800_read_egpio,
666 .pm_callback = h3800_pm_callback
667};
668
669#define MAX_ASIC_ISR_LOOPS 20
670
671/* The order of these is important - see #include <asm/arch/irqs.h> */
672static u32 kpio_irq_mask[] = {
673 KPIO_KEY_ALL,
674 KPIO_SPI_INT,
675 KPIO_OWM_INT,
676 KPIO_ADC_INT,
677 KPIO_UART_0_INT,
678 KPIO_UART_1_INT,
679 KPIO_TIMER_0_INT,
680 KPIO_TIMER_1_INT,
681 KPIO_TIMER_2_INT
682};
683
684static u32 gpio_irq_mask[] = {
685 GPIO2_PEN_IRQ,
686 GPIO2_SD_DETECT,
687 GPIO2_EAR_IN_N,
688 GPIO2_USB_DETECT_N,
689 GPIO2_SD_CON_SLT,
690};
691
692static void h3800_IRQ_demux(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
693{
694 int i;
695
696 if (0) printk("%s: interrupt received\n", __FUNCTION__);
697
698 desc->chip->ack(irq);
699
700 for (i = 0; i < MAX_ASIC_ISR_LOOPS && (GPLR & GPIO_H3800_ASIC); i++) {
701 u32 irq;
702 int j;
703
704 /* KPIO */
705 irq = H3800_ASIC2_KPIINTFLAG;
706 if (0) printk("%s KPIO 0x%08X\n", __FUNCTION__, irq);
707 for (j = 0; j < H3800_KPIO_IRQ_COUNT; j++)
708 if (irq & kpio_irq_mask[j])
709 do_edge_IRQ(H3800_KPIO_IRQ_COUNT + j, irq_desc + H3800_KPIO_IRQ_COUNT + j, regs);
710
711 /* GPIO2 */
712 irq = H3800_ASIC2_GPIINTFLAG;
713 if (0) printk("%s GPIO 0x%08X\n", __FUNCTION__, irq);
714 for (j = 0; j < H3800_GPIO_IRQ_COUNT; j++)
715 if (irq & gpio_irq_mask[j])
716 do_edge_IRQ(H3800_GPIO_IRQ_COUNT + j, irq_desc + H3800_GPIO_IRQ_COUNT + j , regs);
717 }
718
719 if (i >= MAX_ASIC_ISR_LOOPS)
720 printk("%s: interrupt processing overrun\n", __FUNCTION__);
721
722 /* For level-based interrupts */
723 desc->chip->unmask(irq);
724
725}
726
727static struct irqaction h3800_irq = {
728 .name = "h3800_asic",
729 .handler = h3800_IRQ_demux,
730 .flags = SA_INTERRUPT,
731};
732
733u32 kpio_int_shadow = 0;
734
735
736/* mask_ack <- IRQ is first serviced.
737 mask <- IRQ is disabled.
738 unmask <- IRQ is enabled
739
740 The INTCLR registers are poorly documented. I believe that writing
741 a "1" to the register clears the specific interrupt, but the documentation
742 indicates writing a "0" clears the interrupt. In any case, they shouldn't
743 be read (that's the INTFLAG register)
744 */
745
746static void h3800_mask_ack_kpio_irq(unsigned int irq)
747{
748 u32 mask = kpio_irq_mask[irq - H3800_KPIO_IRQ_START];
749 kpio_int_shadow &= ~mask;
750 H3800_ASIC2_KPIINTSTAT = kpio_int_shadow;
751 H3800_ASIC2_KPIINTCLR = mask;
752}
753
754static void h3800_mask_kpio_irq(unsigned int irq)
755{
756 u32 mask = kpio_irq_mask[irq - H3800_KPIO_IRQ_START];
757 kpio_int_shadow &= ~mask;
758 H3800_ASIC2_KPIINTSTAT = kpio_int_shadow;
759}
760
761static void h3800_unmask_kpio_irq(unsigned int irq)
762{
763 u32 mask = kpio_irq_mask[irq - H3800_KPIO_IRQ_START];
764 kpio_int_shadow |= mask;
765 H3800_ASIC2_KPIINTSTAT = kpio_int_shadow;
766}
767
768static void h3800_mask_ack_gpio_irq(unsigned int irq)
769{
770 u32 mask = gpio_irq_mask[irq - H3800_GPIO_IRQ_START];
771 H3800_ASIC2_GPIINTSTAT &= ~mask;
772 H3800_ASIC2_GPIINTCLR = mask;
773}
774
775static void h3800_mask_gpio_irq(unsigned int irq)
776{
777 u32 mask = gpio_irq_mask[irq - H3800_GPIO_IRQ_START];
778 H3800_ASIC2_GPIINTSTAT &= ~mask;
779 }
780
781static void h3800_unmask_gpio_irq(unsigned int irq)
782{
783 u32 mask = gpio_irq_mask[irq - H3800_GPIO_IRQ_START];
784 H3800_ASIC2_GPIINTSTAT |= mask;
785}
786
787static void __init h3800_init_irq(void)
788{
789 int i;
790
791 /* Initialize standard IRQs */
792 sa1100_init_irq();
793
794 /* Disable all IRQs and set up clock */
795 H3800_ASIC2_KPIINTSTAT = 0; /* Disable all interrupts */
796 H3800_ASIC2_GPIINTSTAT = 0;
797
798 H3800_ASIC2_KPIINTCLR = 0; /* Clear all KPIO interrupts */
799 H3800_ASIC2_GPIINTCLR = 0; /* Clear all GPIO interrupts */
800
801// H3800_ASIC2_KPIINTCLR = 0xffff; /* Clear all KPIO interrupts */
802// H3800_ASIC2_GPIINTCLR = 0xffff; /* Clear all GPIO interrupts */
803
804 H3800_ASIC2_CLOCK_Enable |= ASIC2_CLOCK_EX0; /* 32 kHZ crystal on */
805 H3800_ASIC2_INTR_ClockPrescale |= ASIC2_INTCPS_SET;
806 H3800_ASIC2_INTR_ClockPrescale = ASIC2_INTCPS_CPS(0x0e) | ASIC2_INTCPS_SET;
807 H3800_ASIC2_INTR_TimerSet = 1;
808
809#if 0
810 for (i = 0; i < H3800_KPIO_IRQ_COUNT; i++) {
811 int irq = i + H3800_KPIO_IRQ_START;
812 irq_desc[irq].valid = 1;
813 irq_desc[irq].probe_ok = 1;
814 set_irq_chip(irq, &h3800_kpio_irqchip);
815 }
816
817 for (i = 0; i < H3800_GPIO_IRQ_COUNT; i++) {
818 int irq = i + H3800_GPIO_IRQ_START;
819 irq_desc[irq].valid = 1;
820 irq_desc[irq].probe_ok = 1;
821 set_irq_chip(irq, &h3800_gpio_irqchip);
822 }
823#endif
824 set_irq_type(IRQ_GPIO_H3800_ASIC, IRQT_RISING);
825 set_irq_chained_handler(IRQ_GPIO_H3800_ASIC, &h3800_IRQ_demux);
826}
827
828
829#define ASIC1_OUTPUTS 0x7fff /* First 15 bits are used */
830
831static void __init h3800_map_io(void)
832{
833 h3xxx_map_io();
834
835 /* Add wakeup on AC plug/unplug */
836 PWER |= PWER_GPIO12;
837
838 /* Initialize h3800-specific values here */
839 GPCR = 0x0fffffff; /* All outputs are set low by default */
840 GAFR = GPIO_H3800_CLK_OUT |
841 GPIO_LDD15 | GPIO_LDD14 | GPIO_LDD13 | GPIO_LDD12 |
842 GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8;
843 GPDR = GPIO_H3800_CLK_OUT |
844 GPIO_H3600_COM_RTS | GPIO_H3600_L3_CLOCK |
845 GPIO_H3600_L3_MODE | GPIO_H3600_L3_DATA |
846 GPIO_LDD15 | GPIO_LDD14 | GPIO_LDD13 | GPIO_LDD12 |
847 GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8;
848 TUCR = TUCR_3_6864MHz; /* Seems to be used only for the Bluetooth UART */
849
850 /* Fix the memory bus */
851 MSC2 = (MSC2 & 0x0000ffff) | 0xE4510000;
852
853 /* Set up ASIC #1 */
854 H3800_ASIC1_GPIO_DIR = ASIC1_OUTPUTS; /* All outputs */
855 H3800_ASIC1_GPIO_MASK = ASIC1_OUTPUTS; /* No interrupts */
856 H3800_ASIC1_GPIO_SLEEP_MASK = ASIC1_OUTPUTS;
857 H3800_ASIC1_GPIO_SLEEP_DIR = ASIC1_OUTPUTS;
858 H3800_ASIC1_GPIO_SLEEP_OUT = GPIO1_EAR_ON_N;
859 H3800_ASIC1_GPIO_BATT_FAULT_DIR = ASIC1_OUTPUTS;
860 H3800_ASIC1_GPIO_BATT_FAULT_OUT = GPIO1_EAR_ON_N;
861
862 H3800_ASIC1_GPIO_OUT = GPIO1_IR_ON_N
863 | GPIO1_RS232_ON
864 | GPIO1_EAR_ON_N;
865
866 /* Set up ASIC #2 */
867 H3800_ASIC2_GPIOPIOD = GPIO2_IN_Y1_N | GPIO2_IN_X1_N;
868 H3800_ASIC2_GPOBFSTAT = GPIO2_IN_Y1_N | GPIO2_IN_X1_N;
869
870 H3800_ASIC2_GPIODIR = GPIO2_PEN_IRQ
871 | GPIO2_SD_DETECT
872 | GPIO2_EAR_IN_N
873 | GPIO2_USB_DETECT_N
874 | GPIO2_SD_CON_SLT;
875
876 /* TODO : Set sleep states & battery fault states */
877
878 /* Clear VPP Enable */
879 H3800_ASIC2_FlashWP_VPP_ON = 0;
880 ipaq_model_ops = h3800_model_ops;
881}
882
883MACHINE_START(H3800, "Compaq iPAQ H3800")
884 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
885 BOOT_PARAMS(0xc0000100)
886 MAPIO(h3800_map_io)
887 INITIRQ(h3800_init_irq)
888 .timer = &sa1100_timer,
889 .init_machine = h3xxx_mach_init,
890MACHINE_END
891
892#endif /* CONFIG_SA1100_H3800 */
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
new file mode 100644
index 000000000000..570841779714
--- /dev/null
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -0,0 +1,200 @@
1/*
2 * linux/arch/arm/mach-sa1100/hackkit.c
3 *
4 * Copyright (C) 2002 Stefan Eletzhofer <stefan.eletzhofer@eletztrick.de>
5 *
6 * This file contains all HackKit tweaks. Based on original work from
7 * Nicolas Pitre's assabet fixes
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/sched.h>
17#include <linux/tty.h>
18#include <linux/module.h>
19#include <linux/errno.h>
20#include <linux/cpufreq.h>
21#include <linux/serial_core.h>
22#include <linux/mtd/mtd.h>
23#include <linux/mtd/partitions.h>
24
25#include <asm/hardware.h>
26#include <asm/mach-types.h>
27#include <asm/setup.h>
28#include <asm/page.h>
29#include <asm/pgtable.h>
30#include <asm/irq.h>
31
32#include <asm/mach/arch.h>
33#include <asm/mach/flash.h>
34#include <asm/mach/map.h>
35#include <asm/mach/irq.h>
36#include <asm/mach/serial_sa1100.h>
37
38#include "generic.h"
39
40/**********************************************************************
41 * prototypes
42 */
43
44/* init funcs */
45static void __init hackkit_map_io(void);
46
47static u_int hackkit_get_mctrl(struct uart_port *port);
48static void hackkit_set_mctrl(struct uart_port *port, u_int mctrl);
49static void hackkit_uart_pm(struct uart_port *port, u_int state, u_int oldstate);
50
51/**********************************************************************
52 * global data
53 */
54
55/**********************************************************************
56 * static data
57 */
58
59static struct map_desc hackkit_io_desc[] __initdata = {
60 /* virtual physical length type */
61 { 0xe8000000, 0x00000000, 0x01000000, MT_DEVICE } /* Flash bank 0 */
62};
63
64static struct sa1100_port_fns hackkit_port_fns __initdata = {
65 .set_mctrl = hackkit_set_mctrl,
66 .get_mctrl = hackkit_get_mctrl,
67 .pm = hackkit_uart_pm,
68};
69
70/**********************************************************************
71 * Static functions
72 */
73
74static void __init hackkit_map_io(void)
75{
76 sa1100_map_io();
77 iotable_init(hackkit_io_desc, ARRAY_SIZE(hackkit_io_desc));
78
79 sa1100_register_uart_fns(&hackkit_port_fns);
80 sa1100_register_uart(0, 1); /* com port */
81 sa1100_register_uart(1, 2);
82 sa1100_register_uart(2, 3); /* radio module */
83
84 Ser1SDCR0 |= SDCR0_SUS;
85}
86
87/**
88 * hackkit_uart_pm - powermgmt callback function for system 3 UART
89 * @port: uart port structure
90 * @state: pm state
91 * @oldstate: old pm state
92 *
93 */
94static void hackkit_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
95{
96 /* TODO: switch on/off uart in powersave mode */
97}
98
99/*
100 * Note! this can be called from IRQ context.
101 * FIXME: No modem ctrl lines yet.
102 */
103static void hackkit_set_mctrl(struct uart_port *port, u_int mctrl)
104{
105#if 0
106 if (port->mapbase == _Ser1UTCR0) {
107 u_int set = 0, clear = 0;
108
109 if (mctrl & TIOCM_RTS)
110 set |= PT_CTRL2_RS1_RTS;
111 else
112 clear |= PT_CTRL2_RS1_RTS;
113
114 if (mctrl & TIOCM_DTR)
115 set |= PT_CTRL2_RS1_DTR;
116 else
117 clear |= PT_CTRL2_RS1_DTR;
118
119 PTCTRL2_clear(clear);
120 PTCTRL2_set(set);
121 }
122#endif
123}
124
125static u_int hackkit_get_mctrl(struct uart_port *port)
126{
127 u_int ret = 0;
128#if 0
129 u_int irqsr = PT_IRQSR;
130
131 /* need 2 reads to read current value */
132 irqsr = PT_IRQSR;
133
134 /* TODO: check IRQ source register for modem/com
135 status lines and set them correctly. */
136#endif
137
138 ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
139
140 return ret;
141}
142
143static struct mtd_partition hackkit_partitions[] = {
144 {
145 .name = "BLOB",
146 .size = 0x00040000,
147 .offset = 0x00000000,
148 .mask_flags = MTD_WRITEABLE, /* force read-only */
149 }, {
150 .name = "config",
151 .size = 0x00040000,
152 .offset = MTDPART_OFS_APPEND,
153 }, {
154 .name = "kernel",
155 .size = 0x00100000,
156 .offset = MTDPART_OFS_APPEND,
157 }, {
158 .name = "initrd",
159 .size = 0x00180000,
160 .offset = MTDPART_OFS_APPEND,
161 }, {
162 .name = "rootfs",
163 .size = 0x700000,
164 .offset = MTDPART_OFS_APPEND,
165 }, {
166 .name = "data",
167 .size = MTDPART_SIZ_FULL,
168 .offset = MTDPART_OFS_APPEND,
169 }
170};
171
172static struct flash_platform_data hackkit_flash_data = {
173 .map_name = "cfi_probe",
174 .parts = hackkit_partitions,
175 .nr_parts = ARRAY_SIZE(hackkit_partitions),
176};
177
178static struct resource hackkit_flash_resource = {
179 .start = SA1100_CS0_PHYS,
180 .end = SA1100_CS0_PHYS + SZ_32M,
181 .flags = IORESOURCE_MEM,
182};
183
184static void __init hackkit_init(void)
185{
186 sa11x0_set_flash_data(&hackkit_flash_data, &hackkit_flash_resource, 1);
187}
188
189/**********************************************************************
190 * Exported Functions
191 */
192
193MACHINE_START(HACKKIT, "HackKit Cpu Board")
194 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
195 BOOT_PARAMS(0xc0000100)
196 MAPIO(hackkit_map_io)
197 INITIRQ(sa1100_init_irq)
198 .timer = &sa1100_timer,
199 .init_machine = hackkit_init,
200MACHINE_END
diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c
new file mode 100644
index 000000000000..66a929cb7bc5
--- /dev/null
+++ b/arch/arm/mach-sa1100/irq.c
@@ -0,0 +1,332 @@
1/*
2 * linux/arch/arm/mach-sa1100/irq.c
3 *
4 * Copyright (C) 1999-2001 Nicolas Pitre
5 *
6 * Generic IRQ handling for the SA11x0, GPIO 11-27 IRQ demultiplexing.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/init.h>
13#include <linux/module.h>
14#include <linux/ioport.h>
15#include <linux/ptrace.h>
16#include <linux/sysdev.h>
17
18#include <asm/hardware.h>
19#include <asm/irq.h>
20#include <asm/mach/irq.h>
21
22#include "generic.h"
23
24
25/*
26 * SA1100 GPIO edge detection for IRQs:
27 * IRQs are generated on Falling-Edge, Rising-Edge, or both.
28 * Use this instead of directly setting GRER/GFER.
29 */
30static int GPIO_IRQ_rising_edge;
31static int GPIO_IRQ_falling_edge;
32static int GPIO_IRQ_mask = (1 << 11) - 1;
33
34/*
35 * To get the GPIO number from an IRQ number
36 */
37#define GPIO_11_27_IRQ(i) ((i) - 21)
38#define GPIO11_27_MASK(irq) (1 << GPIO_11_27_IRQ(irq))
39
40static int sa1100_gpio_type(unsigned int irq, unsigned int type)
41{
42 unsigned int mask;
43
44 if (irq <= 10)
45 mask = 1 << irq;
46 else
47 mask = GPIO11_27_MASK(irq);
48
49 if (type == IRQT_PROBE) {
50 if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask)
51 return 0;
52 type = __IRQT_RISEDGE | __IRQT_FALEDGE;
53 }
54
55 if (type & __IRQT_RISEDGE) {
56 GPIO_IRQ_rising_edge |= mask;
57 } else
58 GPIO_IRQ_rising_edge &= ~mask;
59 if (type & __IRQT_FALEDGE) {
60 GPIO_IRQ_falling_edge |= mask;
61 } else
62 GPIO_IRQ_falling_edge &= ~mask;
63
64 GRER = GPIO_IRQ_rising_edge & GPIO_IRQ_mask;
65 GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask;
66
67 return 0;
68}
69
70/*
71 * GPIO IRQs must be acknowledged. This is for IRQs from 0 to 10.
72 */
73static void sa1100_low_gpio_ack(unsigned int irq)
74{
75 GEDR = (1 << irq);
76}
77
78static void sa1100_low_gpio_mask(unsigned int irq)
79{
80 ICMR &= ~(1 << irq);
81}
82
83static void sa1100_low_gpio_unmask(unsigned int irq)
84{
85 ICMR |= 1 << irq;
86}
87
88static int sa1100_low_gpio_wake(unsigned int irq, unsigned int on)
89{
90 if (on)
91 PWER |= 1 << irq;
92 else
93 PWER &= ~(1 << irq);
94 return 0;
95}
96
97static struct irqchip sa1100_low_gpio_chip = {
98 .ack = sa1100_low_gpio_ack,
99 .mask = sa1100_low_gpio_mask,
100 .unmask = sa1100_low_gpio_unmask,
101 .type = sa1100_gpio_type,
102 .wake = sa1100_low_gpio_wake,
103};
104
105/*
106 * IRQ11 (GPIO11 through 27) handler. We enter here with the
107 * irq_controller_lock held, and IRQs disabled. Decode the IRQ
108 * and call the handler.
109 */
110static void
111sa1100_high_gpio_handler(unsigned int irq, struct irqdesc *desc,
112 struct pt_regs *regs)
113{
114 unsigned int mask;
115
116 mask = GEDR & 0xfffff800;
117 do {
118 /*
119 * clear down all currently active IRQ sources.
120 * We will be processing them all.
121 */
122 GEDR = mask;
123
124 irq = IRQ_GPIO11;
125 desc = irq_desc + irq;
126 mask >>= 11;
127 do {
128 if (mask & 1)
129 desc->handle(irq, desc, regs);
130 mask >>= 1;
131 irq++;
132 desc++;
133 } while (mask);
134
135 mask = GEDR & 0xfffff800;
136 } while (mask);
137}
138
139/*
140 * Like GPIO0 to 10, GPIO11-27 IRQs need to be handled specially.
141 * In addition, the IRQs are all collected up into one bit in the
142 * interrupt controller registers.
143 */
144static void sa1100_high_gpio_ack(unsigned int irq)
145{
146 unsigned int mask = GPIO11_27_MASK(irq);
147
148 GEDR = mask;
149}
150
151static void sa1100_high_gpio_mask(unsigned int irq)
152{
153 unsigned int mask = GPIO11_27_MASK(irq);
154
155 GPIO_IRQ_mask &= ~mask;
156
157 GRER &= ~mask;
158 GFER &= ~mask;
159}
160
161static void sa1100_high_gpio_unmask(unsigned int irq)
162{
163 unsigned int mask = GPIO11_27_MASK(irq);
164
165 GPIO_IRQ_mask |= mask;
166
167 GRER = GPIO_IRQ_rising_edge & GPIO_IRQ_mask;
168 GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask;
169}
170
171static int sa1100_high_gpio_wake(unsigned int irq, unsigned int on)
172{
173 if (on)
174 PWER |= GPIO11_27_MASK(irq);
175 else
176 PWER &= ~GPIO11_27_MASK(irq);
177 return 0;
178}
179
180static struct irqchip sa1100_high_gpio_chip = {
181 .ack = sa1100_high_gpio_ack,
182 .mask = sa1100_high_gpio_mask,
183 .unmask = sa1100_high_gpio_unmask,
184 .type = sa1100_gpio_type,
185 .wake = sa1100_high_gpio_wake,
186};
187
188/*
189 * We don't need to ACK IRQs on the SA1100 unless they're GPIOs
190 * this is for internal IRQs i.e. from 11 to 31.
191 */
192static void sa1100_mask_irq(unsigned int irq)
193{
194 ICMR &= ~(1 << irq);
195}
196
197static void sa1100_unmask_irq(unsigned int irq)
198{
199 ICMR |= (1 << irq);
200}
201
202static struct irqchip sa1100_normal_chip = {
203 .ack = sa1100_mask_irq,
204 .mask = sa1100_mask_irq,
205 .unmask = sa1100_unmask_irq,
206};
207
208static struct resource irq_resource = {
209 .name = "irqs",
210 .start = 0x90050000,
211 .end = 0x9005ffff,
212};
213
214static struct sa1100irq_state {
215 unsigned int saved;
216 unsigned int icmr;
217 unsigned int iclr;
218 unsigned int iccr;
219} sa1100irq_state;
220
221static int sa1100irq_suspend(struct sys_device *dev, pm_message_t state)
222{
223 struct sa1100irq_state *st = &sa1100irq_state;
224
225 st->saved = 1;
226 st->icmr = ICMR;
227 st->iclr = ICLR;
228 st->iccr = ICCR;
229
230 /*
231 * Disable all GPIO-based interrupts.
232 */
233 ICMR &= ~(IC_GPIO11_27|IC_GPIO10|IC_GPIO9|IC_GPIO8|IC_GPIO7|
234 IC_GPIO6|IC_GPIO5|IC_GPIO4|IC_GPIO3|IC_GPIO2|
235 IC_GPIO1|IC_GPIO0);
236
237 /*
238 * Set the appropriate edges for wakeup.
239 */
240 GRER = PWER & GPIO_IRQ_rising_edge;
241 GFER = PWER & GPIO_IRQ_falling_edge;
242
243 /*
244 * Clear any pending GPIO interrupts.
245 */
246 GEDR = GEDR;
247
248 return 0;
249}
250
251static int sa1100irq_resume(struct sys_device *dev)
252{
253 struct sa1100irq_state *st = &sa1100irq_state;
254
255 if (st->saved) {
256 ICCR = st->iccr;
257 ICLR = st->iclr;
258
259 GRER = GPIO_IRQ_rising_edge & GPIO_IRQ_mask;
260 GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask;
261
262 ICMR = st->icmr;
263 }
264 return 0;
265}
266
267static struct sysdev_class sa1100irq_sysclass = {
268 set_kset_name("sa11x0-irq"),
269 .suspend = sa1100irq_suspend,
270 .resume = sa1100irq_resume,
271};
272
273static struct sys_device sa1100irq_device = {
274 .id = 0,
275 .cls = &sa1100irq_sysclass,
276};
277
278static int __init sa1100irq_init_devicefs(void)
279{
280 sysdev_class_register(&sa1100irq_sysclass);
281 return sysdev_register(&sa1100irq_device);
282}
283
284device_initcall(sa1100irq_init_devicefs);
285
286void __init sa1100_init_irq(void)
287{
288 unsigned int irq;
289
290 request_resource(&iomem_resource, &irq_resource);
291
292 /* disable all IRQs */
293 ICMR = 0;
294
295 /* all IRQs are IRQ, not FIQ */
296 ICLR = 0;
297
298 /* clear all GPIO edge detects */
299 GFER = 0;
300 GRER = 0;
301 GEDR = -1;
302
303 /*
304 * Whatever the doc says, this has to be set for the wait-on-irq
305 * instruction to work... on a SA1100 rev 9 at least.
306 */
307 ICCR = 1;
308
309 for (irq = 0; irq <= 10; irq++) {
310 set_irq_chip(irq, &sa1100_low_gpio_chip);
311 set_irq_handler(irq, do_edge_IRQ);
312 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
313 }
314
315 for (irq = 12; irq <= 31; irq++) {
316 set_irq_chip(irq, &sa1100_normal_chip);
317 set_irq_handler(irq, do_level_IRQ);
318 set_irq_flags(irq, IRQF_VALID);
319 }
320
321 for (irq = 32; irq <= 48; irq++) {
322 set_irq_chip(irq, &sa1100_high_gpio_chip);
323 set_irq_handler(irq, do_edge_IRQ);
324 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
325 }
326
327 /*
328 * Install handler for GPIO 11-27 edge detect interrupts
329 */
330 set_irq_chip(IRQ_GPIO11_27, &sa1100_normal_chip);
331 set_irq_chained_handler(IRQ_GPIO11_27, sa1100_high_gpio_handler);
332}
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
new file mode 100644
index 000000000000..6be78291a878
--- /dev/null
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -0,0 +1,105 @@
1/*
2 * linux/arch/arm/mach-sa1100/jornada720.c
3 */
4
5#include <linux/init.h>
6#include <linux/kernel.h>
7#include <linux/tty.h>
8#include <linux/delay.h>
9#include <linux/device.h>
10#include <linux/ioport.h>
11
12#include <asm/hardware.h>
13#include <asm/hardware/sa1111.h>
14#include <asm/irq.h>
15#include <asm/mach-types.h>
16#include <asm/setup.h>
17
18#include <asm/mach/arch.h>
19#include <asm/mach/map.h>
20#include <asm/mach/serial_sa1100.h>
21
22#include "generic.h"
23
24
25#define JORTUCR_VAL 0x20000400
26
27static struct resource sa1111_resources[] = {
28 [0] = {
29 .start = 0x40000000,
30 .end = 0x40001fff,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .start = IRQ_GPIO1,
35 .end = IRQ_GPIO1,
36 .flags = IORESOURCE_IRQ,
37 },
38};
39
40static u64 sa1111_dmamask = 0xffffffffUL;
41
42static struct platform_device sa1111_device = {
43 .name = "sa1111",
44 .id = 0,
45 .dev = {
46 .dma_mask = &sa1111_dmamask,
47 .coherent_dma_mask = 0xffffffff,
48 },
49 .num_resources = ARRAY_SIZE(sa1111_resources),
50 .resource = sa1111_resources,
51};
52
53static struct platform_device *devices[] __initdata = {
54 &sa1111_device,
55};
56
57static int __init jornada720_init(void)
58{
59 int ret = -ENODEV;
60
61 if (machine_is_jornada720()) {
62 GPDR |= GPIO_GPIO20;
63 TUCR = JORTUCR_VAL; /* set the oscillator out to the SA-1101 */
64
65 GPSR = GPIO_GPIO20;
66 udelay(1);
67 GPCR = GPIO_GPIO20;
68 udelay(1);
69 GPSR = GPIO_GPIO20;
70 udelay(20);
71
72 /* LDD4 is speaker, LDD3 is microphone */
73 PPSR &= ~(PPC_LDD3 | PPC_LDD4);
74 PPDR |= PPC_LDD3 | PPC_LDD4;
75
76 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
77 }
78 return ret;
79}
80
81arch_initcall(jornada720_init);
82
83static struct map_desc jornada720_io_desc[] __initdata = {
84 /* virtual physical length type */
85 { 0xf0000000, 0x48000000, 0x00100000, MT_DEVICE }, /* Epson registers */
86 { 0xf1000000, 0x48200000, 0x00100000, MT_DEVICE }, /* Epson frame buffer */
87 { 0xf4000000, 0x40000000, 0x00100000, MT_DEVICE } /* SA-1111 */
88};
89
90static void __init jornada720_map_io(void)
91{
92 sa1100_map_io();
93 iotable_init(jornada720_io_desc, ARRAY_SIZE(jornada720_io_desc));
94
95 sa1100_register_uart(0, 3);
96 sa1100_register_uart(1, 1);
97}
98
99MACHINE_START(JORNADA720, "HP Jornada 720")
100 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
101 BOOT_PARAMS(0xc0000100)
102 MAPIO(jornada720_map_io)
103 INITIRQ(sa1100_init_irq)
104 .timer = &sa1100_timer,
105MACHINE_END
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
new file mode 100644
index 000000000000..51c08ccfb8db
--- /dev/null
+++ b/arch/arm/mach-sa1100/lart.c
@@ -0,0 +1,49 @@
1/*
2 * linux/arch/arm/mach-sa1100/lart.c
3 */
4
5#include <linux/init.h>
6#include <linux/kernel.h>
7#include <linux/tty.h>
8
9#include <asm/hardware.h>
10#include <asm/setup.h>
11#include <asm/mach-types.h>
12
13#include <asm/mach/arch.h>
14#include <asm/mach/map.h>
15#include <asm/mach/serial_sa1100.h>
16
17#include "generic.h"
18
19
20#warning "include/asm/arch-sa1100/ide.h needs fixing for lart"
21
22static struct map_desc lart_io_desc[] __initdata = {
23 /* virtual physical length type */
24 { 0xe8000000, 0x00000000, 0x00400000, MT_DEVICE }, /* main flash memory */
25 { 0xec000000, 0x08000000, 0x00400000, MT_DEVICE } /* main flash, alternative location */
26};
27
28static void __init lart_map_io(void)
29{
30 sa1100_map_io();
31 iotable_init(lart_io_desc, ARRAY_SIZE(lart_io_desc));
32
33 sa1100_register_uart(0, 3);
34 sa1100_register_uart(1, 1);
35 sa1100_register_uart(2, 2);
36
37 GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
38 GPDR |= GPIO_UART_TXD;
39 GPDR &= ~GPIO_UART_RXD;
40 PPAR |= PPAR_UPR;
41}
42
43MACHINE_START(LART, "LART")
44 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
45 BOOT_PARAMS(0xc0000100)
46 MAPIO(lart_map_io)
47 INITIRQ(sa1100_init_irq)
48 .timer = &sa1100_timer,
49MACHINE_END
diff --git a/arch/arm/mach-sa1100/leds-assabet.c b/arch/arm/mach-sa1100/leds-assabet.c
new file mode 100644
index 000000000000..e9aa9dff211a
--- /dev/null
+++ b/arch/arm/mach-sa1100/leds-assabet.c
@@ -0,0 +1,115 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds-assabet.c
3 *
4 * Copyright (C) 2000 John Dorsey <john+@cs.cmu.edu>
5 *
6 * Original (leds-footbridge.c) by Russell King
7 *
8 * Assabet uses the LEDs as follows:
9 * - Green - toggles state every 50 timer interrupts
10 * - Red - on if system is not idle
11 */
12#include <linux/config.h>
13#include <linux/init.h>
14
15#include <asm/hardware.h>
16#include <asm/leds.h>
17#include <asm/system.h>
18#include <asm/arch/assabet.h>
19
20#include "leds.h"
21
22
23#define LED_STATE_ENABLED 1
24#define LED_STATE_CLAIMED 2
25
26static unsigned int led_state;
27static unsigned int hw_led_state;
28
29#define ASSABET_BCR_LED_MASK (ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED)
30
31void assabet_leds_event(led_event_t evt)
32{
33 unsigned long flags;
34
35 local_irq_save(flags);
36
37 switch (evt) {
38 case led_start:
39 hw_led_state = ASSABET_BCR_LED_RED | ASSABET_BCR_LED_GREEN;
40 led_state = LED_STATE_ENABLED;
41 break;
42
43 case led_stop:
44 led_state &= ~LED_STATE_ENABLED;
45 hw_led_state = ASSABET_BCR_LED_RED | ASSABET_BCR_LED_GREEN;
46 ASSABET_BCR_frob(ASSABET_BCR_LED_MASK, hw_led_state);
47 break;
48
49 case led_claim:
50 led_state |= LED_STATE_CLAIMED;
51 hw_led_state = ASSABET_BCR_LED_RED | ASSABET_BCR_LED_GREEN;
52 break;
53
54 case led_release:
55 led_state &= ~LED_STATE_CLAIMED;
56 hw_led_state = ASSABET_BCR_LED_RED | ASSABET_BCR_LED_GREEN;
57 break;
58
59#ifdef CONFIG_LEDS_TIMER
60 case led_timer:
61 if (!(led_state & LED_STATE_CLAIMED))
62 hw_led_state ^= ASSABET_BCR_LED_GREEN;
63 break;
64#endif
65
66#ifdef CONFIG_LEDS_CPU
67 case led_idle_start:
68 if (!(led_state & LED_STATE_CLAIMED))
69 hw_led_state |= ASSABET_BCR_LED_RED;
70 break;
71
72 case led_idle_end:
73 if (!(led_state & LED_STATE_CLAIMED))
74 hw_led_state &= ~ASSABET_BCR_LED_RED;
75 break;
76#endif
77
78 case led_halted:
79 break;
80
81 case led_green_on:
82 if (led_state & LED_STATE_CLAIMED)
83 hw_led_state &= ~ASSABET_BCR_LED_GREEN;
84 break;
85
86 case led_green_off:
87 if (led_state & LED_STATE_CLAIMED)
88 hw_led_state |= ASSABET_BCR_LED_GREEN;
89 break;
90
91 case led_amber_on:
92 break;
93
94 case led_amber_off:
95 break;
96
97 case led_red_on:
98 if (led_state & LED_STATE_CLAIMED)
99 hw_led_state &= ~ASSABET_BCR_LED_RED;
100 break;
101
102 case led_red_off:
103 if (led_state & LED_STATE_CLAIMED)
104 hw_led_state |= ASSABET_BCR_LED_RED;
105 break;
106
107 default:
108 break;
109 }
110
111 if (led_state & LED_STATE_ENABLED)
112 ASSABET_BCR_frob(ASSABET_BCR_LED_MASK, hw_led_state);
113
114 local_irq_restore(flags);
115}
diff --git a/arch/arm/mach-sa1100/leds-badge4.c b/arch/arm/mach-sa1100/leds-badge4.c
new file mode 100644
index 000000000000..0a8f87bb6c4f
--- /dev/null
+++ b/arch/arm/mach-sa1100/leds-badge4.c
@@ -0,0 +1,112 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds-badge4.c
3 *
4 * Author: Christopher Hoover <ch@hpl.hp.com>
5 * Copyright (C) 2002 Hewlett-Packard Company
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#include <linux/config.h>
14#include <linux/init.h>
15
16#include <asm/hardware.h>
17#include <asm/leds.h>
18#include <asm/system.h>
19
20#include "leds.h"
21
22#define LED_STATE_ENABLED 1
23#define LED_STATE_CLAIMED 2
24
25static unsigned int led_state;
26static unsigned int hw_led_state;
27
28#define LED_RED GPIO_GPIO(7)
29#define LED_GREEN GPIO_GPIO(9)
30#define LED_MASK (LED_RED|LED_GREEN)
31
32#define LED_IDLE LED_GREEN
33#define LED_TIMER LED_RED
34
35void badge4_leds_event(led_event_t evt)
36{
37 unsigned long flags;
38
39 local_irq_save(flags);
40
41 switch (evt) {
42 case led_start:
43 GPDR |= LED_MASK;
44 hw_led_state = LED_MASK;
45 led_state = LED_STATE_ENABLED;
46 break;
47
48 case led_stop:
49 led_state &= ~LED_STATE_ENABLED;
50 break;
51
52 case led_claim:
53 led_state |= LED_STATE_CLAIMED;
54 hw_led_state = LED_MASK;
55 break;
56
57 case led_release:
58 led_state &= ~LED_STATE_CLAIMED;
59 hw_led_state = LED_MASK;
60 break;
61
62#ifdef CONFIG_LEDS_TIMER
63 case led_timer:
64 if (!(led_state & LED_STATE_CLAIMED))
65 hw_led_state ^= LED_TIMER;
66 break;
67#endif
68
69#ifdef CONFIG_LEDS_CPU
70 case led_idle_start:
71 /* LED off when system is idle */
72 if (!(led_state & LED_STATE_CLAIMED))
73 hw_led_state &= ~LED_IDLE;
74 break;
75
76 case led_idle_end:
77 if (!(led_state & LED_STATE_CLAIMED))
78 hw_led_state |= LED_IDLE;
79 break;
80#endif
81
82 case led_red_on:
83 if (!(led_state & LED_STATE_CLAIMED))
84 hw_led_state &= ~LED_RED;
85 break;
86
87 case led_red_off:
88 if (!(led_state & LED_STATE_CLAIMED))
89 hw_led_state |= LED_RED;
90 break;
91
92 case led_green_on:
93 if (!(led_state & LED_STATE_CLAIMED))
94 hw_led_state &= ~LED_GREEN;
95 break;
96
97 case led_green_off:
98 if (!(led_state & LED_STATE_CLAIMED))
99 hw_led_state |= LED_GREEN;
100 break;
101
102 default:
103 break;
104 }
105
106 if (led_state & LED_STATE_ENABLED) {
107 GPSR = hw_led_state;
108 GPCR = hw_led_state ^ LED_MASK;
109 }
110
111 local_irq_restore(flags);
112}
diff --git a/arch/arm/mach-sa1100/leds-cerf.c b/arch/arm/mach-sa1100/leds-cerf.c
new file mode 100644
index 000000000000..f6635a2d0e83
--- /dev/null
+++ b/arch/arm/mach-sa1100/leds-cerf.c
@@ -0,0 +1,111 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds-cerf.c
3 *
4 * Author: ???
5 */
6#include <linux/config.h>
7#include <linux/init.h>
8
9#include <asm/hardware.h>
10#include <asm/leds.h>
11#include <asm/system.h>
12
13#include "leds.h"
14
15
16#define LED_STATE_ENABLED 1
17#define LED_STATE_CLAIMED 2
18
19static unsigned int led_state;
20static unsigned int hw_led_state;
21
22#define LED_D0 GPIO_GPIO(0)
23#define LED_D1 GPIO_GPIO(1)
24#define LED_D2 GPIO_GPIO(2)
25#define LED_D3 GPIO_GPIO(3)
26#define LED_MASK (LED_D0|LED_D1|LED_D2|LED_D3)
27
28void cerf_leds_event(led_event_t evt)
29{
30 unsigned long flags;
31
32 local_irq_save(flags);
33
34 switch (evt) {
35 case led_start:
36 hw_led_state = LED_MASK;
37 led_state = LED_STATE_ENABLED;
38 break;
39
40 case led_stop:
41 led_state &= ~LED_STATE_ENABLED;
42 break;
43
44 case led_claim:
45 led_state |= LED_STATE_CLAIMED;
46 hw_led_state = LED_MASK;
47 break;
48 case led_release:
49 led_state &= ~LED_STATE_CLAIMED;
50 hw_led_state = LED_MASK;
51 break;
52
53#ifdef CONFIG_LEDS_TIMER
54 case led_timer:
55 if (!(led_state & LED_STATE_CLAIMED))
56 hw_led_state ^= LED_D0;
57 break;
58#endif
59
60#ifdef CONFIG_LEDS_CPU
61 case led_idle_start:
62 if (!(led_state & LED_STATE_CLAIMED))
63 hw_led_state &= ~LED_D1;
64 break;
65
66 case led_idle_end:
67 if (!(led_state & LED_STATE_CLAIMED))
68 hw_led_state |= LED_D1;
69 break;
70#endif
71 case led_green_on:
72 if (!(led_state & LED_STATE_CLAIMED))
73 hw_led_state &= ~LED_D2;
74 break;
75
76 case led_green_off:
77 if (!(led_state & LED_STATE_CLAIMED))
78 hw_led_state |= LED_D2;
79 break;
80
81 case led_amber_on:
82 if (!(led_state & LED_STATE_CLAIMED))
83 hw_led_state &= ~LED_D3;
84 break;
85
86 case led_amber_off:
87 if (!(led_state & LED_STATE_CLAIMED))
88 hw_led_state |= LED_D3;
89 break;
90
91 case led_red_on:
92 if (!(led_state & LED_STATE_CLAIMED))
93 hw_led_state &= ~LED_D1;
94 break;
95
96 case led_red_off:
97 if (!(led_state & LED_STATE_CLAIMED))
98 hw_led_state |= LED_D1;
99 break;
100
101 default:
102 break;
103 }
104
105 if (led_state & LED_STATE_ENABLED) {
106 GPSR = hw_led_state;
107 GPCR = hw_led_state ^ LED_MASK;
108 }
109
110 local_irq_restore(flags);
111}
diff --git a/arch/arm/mach-sa1100/leds-hackkit.c b/arch/arm/mach-sa1100/leds-hackkit.c
new file mode 100644
index 000000000000..2e5fa14aa4eb
--- /dev/null
+++ b/arch/arm/mach-sa1100/leds-hackkit.c
@@ -0,0 +1,113 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds-hackkit.c
3 *
4 * based on leds-lart.c
5 *
6 * (C) Erik Mouw (J.A.K.Mouw@its.tudelft.nl), April 21, 2000
7 * (C) Stefan Eletzhofer <stefan.eletzhofer@eletztrick.de>, 2002
8 *
9 * The HackKit has two leds (GPIO 22/23). The red led (gpio 22) is used
10 * as cpu led, the green one is used as timer led.
11 */
12#include <linux/config.h>
13#include <linux/init.h>
14
15#include <asm/hardware.h>
16#include <asm/leds.h>
17#include <asm/system.h>
18
19#include "leds.h"
20
21
22#define LED_STATE_ENABLED 1
23#define LED_STATE_CLAIMED 2
24
25static unsigned int led_state;
26static unsigned int hw_led_state;
27
28#define LED_GREEN GPIO_GPIO23
29#define LED_RED GPIO_GPIO22
30#define LED_MASK (LED_RED | LED_GREEN)
31
32void hackkit_leds_event(led_event_t evt)
33{
34 unsigned long flags;
35
36 local_irq_save(flags);
37
38 switch(evt) {
39 case led_start:
40 /* pin 22/23 are outputs */
41 GPDR |= LED_MASK;
42 hw_led_state = LED_MASK;
43 led_state = LED_STATE_ENABLED;
44 break;
45
46 case led_stop:
47 led_state &= ~LED_STATE_ENABLED;
48 break;
49
50 case led_claim:
51 led_state |= LED_STATE_CLAIMED;
52 hw_led_state = LED_MASK;
53 break;
54
55 case led_release:
56 led_state &= ~LED_STATE_CLAIMED;
57 hw_led_state = LED_MASK;
58 break;
59
60#ifdef CONFIG_LEDS_TIMER
61 case led_timer:
62 if (!(led_state & LED_STATE_CLAIMED))
63 hw_led_state ^= LED_GREEN;
64 break;
65#endif
66
67#ifdef CONFIG_LEDS_CPU
68 case led_idle_start:
69 /* The LART people like the LED to be off when the
70 system is idle... */
71 if (!(led_state & LED_STATE_CLAIMED))
72 hw_led_state &= ~LED_RED;
73 break;
74
75 case led_idle_end:
76 /* ... and on if the system is not idle */
77 if (!(led_state & LED_STATE_CLAIMED))
78 hw_led_state |= LED_RED;
79 break;
80#endif
81
82 case led_red_on:
83 if (led_state & LED_STATE_CLAIMED)
84 hw_led_state &= ~LED_RED;
85 break;
86
87 case led_red_off:
88 if (led_state & LED_STATE_CLAIMED)
89 hw_led_state |= LED_RED;
90 break;
91
92 case led_green_on:
93 if (led_state & LED_STATE_CLAIMED)
94 hw_led_state &= ~LED_GREEN;
95 break;
96
97 case led_green_off:
98 if (led_state & LED_STATE_CLAIMED)
99 hw_led_state |= LED_GREEN;
100 break;
101
102 default:
103 break;
104 }
105
106 /* Now set the GPIO state, or nothing will happen at all */
107 if (led_state & LED_STATE_ENABLED) {
108 GPSR = hw_led_state;
109 GPCR = hw_led_state ^ LED_MASK;
110 }
111
112 local_irq_restore(flags);
113}
diff --git a/arch/arm/mach-sa1100/leds-lart.c b/arch/arm/mach-sa1100/leds-lart.c
new file mode 100644
index 000000000000..187501490713
--- /dev/null
+++ b/arch/arm/mach-sa1100/leds-lart.c
@@ -0,0 +1,102 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds-lart.c
3 *
4 * (C) Erik Mouw (J.A.K.Mouw@its.tudelft.nl), April 21, 2000
5 *
6 * LART uses the LED as follows:
7 * - GPIO23 is the LED, on if system is not idle
8 * You can use both CONFIG_LEDS_CPU and CONFIG_LEDS_TIMER at the same
9 * time, but in that case the timer events will still dictate the
10 * pace of the LED.
11 */
12#include <linux/config.h>
13#include <linux/init.h>
14
15#include <asm/hardware.h>
16#include <asm/leds.h>
17#include <asm/system.h>
18
19#include "leds.h"
20
21
22#define LED_STATE_ENABLED 1
23#define LED_STATE_CLAIMED 2
24
25static unsigned int led_state;
26static unsigned int hw_led_state;
27
28#define LED_23 GPIO_GPIO23
29#define LED_MASK (LED_23)
30
31void lart_leds_event(led_event_t evt)
32{
33 unsigned long flags;
34
35 local_irq_save(flags);
36
37 switch(evt) {
38 case led_start:
39 /* pin 23 is output pin */
40 GPDR |= LED_23;
41 hw_led_state = LED_MASK;
42 led_state = LED_STATE_ENABLED;
43 break;
44
45 case led_stop:
46 led_state &= ~LED_STATE_ENABLED;
47 break;
48
49 case led_claim:
50 led_state |= LED_STATE_CLAIMED;
51 hw_led_state = LED_MASK;
52 break;
53
54 case led_release:
55 led_state &= ~LED_STATE_CLAIMED;
56 hw_led_state = LED_MASK;
57 break;
58
59#ifdef CONFIG_LEDS_TIMER
60 case led_timer:
61 if (!(led_state & LED_STATE_CLAIMED))
62 hw_led_state ^= LED_23;
63 break;
64#endif
65
66#ifdef CONFIG_LEDS_CPU
67 case led_idle_start:
68 /* The LART people like the LED to be off when the
69 system is idle... */
70 if (!(led_state & LED_STATE_CLAIMED))
71 hw_led_state &= ~LED_23;
72 break;
73
74 case led_idle_end:
75 /* ... and on if the system is not idle */
76 if (!(led_state & LED_STATE_CLAIMED))
77 hw_led_state |= LED_23;
78 break;
79#endif
80
81 case led_red_on:
82 if (led_state & LED_STATE_CLAIMED)
83 hw_led_state &= ~LED_23;
84 break;
85
86 case led_red_off:
87 if (led_state & LED_STATE_CLAIMED)
88 hw_led_state |= LED_23;
89 break;
90
91 default:
92 break;
93 }
94
95 /* Now set the GPIO state, or nothing will happen at all */
96 if (led_state & LED_STATE_ENABLED) {
97 GPSR = hw_led_state;
98 GPCR = hw_led_state ^ LED_MASK;
99 }
100
101 local_irq_restore(flags);
102}
diff --git a/arch/arm/mach-sa1100/leds-simpad.c b/arch/arm/mach-sa1100/leds-simpad.c
new file mode 100644
index 000000000000..6a27a2d32206
--- /dev/null
+++ b/arch/arm/mach-sa1100/leds-simpad.c
@@ -0,0 +1,101 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds-simpad.c
3 *
4 * Author: Juergen Messerer <juergen.messerer@siemens.ch>
5 */
6#include <linux/config.h>
7#include <linux/init.h>
8
9#include <asm/hardware.h>
10#include <asm/leds.h>
11#include <asm/system.h>
12#include <asm/arch/simpad.h>
13
14#include "leds.h"
15
16
17#define LED_STATE_ENABLED 1
18#define LED_STATE_CLAIMED 2
19
20static unsigned int led_state;
21static unsigned int hw_led_state;
22
23#define LED_GREEN (1)
24#define LED_MASK (1)
25
26extern void set_cs3_bit(int value);
27extern void clear_cs3_bit(int value);
28
29void simpad_leds_event(led_event_t evt)
30{
31 switch (evt)
32 {
33 case led_start:
34 hw_led_state = LED_GREEN;
35 led_state = LED_STATE_ENABLED;
36 break;
37
38 case led_stop:
39 led_state &= ~LED_STATE_ENABLED;
40 break;
41
42 case led_claim:
43 led_state |= LED_STATE_CLAIMED;
44 hw_led_state = LED_GREEN;
45 break;
46
47 case led_release:
48 led_state &= ~LED_STATE_CLAIMED;
49 hw_led_state = LED_GREEN;
50 break;
51
52#ifdef CONFIG_LEDS_TIMER
53 case led_timer:
54 if (!(led_state & LED_STATE_CLAIMED))
55 hw_led_state ^= LED_GREEN;
56 break;
57#endif
58
59#ifdef CONFIG_LEDS_CPU
60 case led_idle_start:
61 break;
62
63 case led_idle_end:
64 break;
65#endif
66
67 case led_halted:
68 break;
69
70 case led_green_on:
71 if (led_state & LED_STATE_CLAIMED)
72 hw_led_state |= LED_GREEN;
73 break;
74
75 case led_green_off:
76 if (led_state & LED_STATE_CLAIMED)
77 hw_led_state &= ~LED_GREEN;
78 break;
79
80 case led_amber_on:
81 break;
82
83 case led_amber_off:
84 break;
85
86 case led_red_on:
87 break;
88
89 case led_red_off:
90 break;
91
92 default:
93 break;
94 }
95
96 if (led_state & LED_STATE_ENABLED)
97 set_cs3_bit(LED2_ON);
98 else
99 clear_cs3_bit(LED2_ON);
100}
101
diff --git a/arch/arm/mach-sa1100/leds.c b/arch/arm/mach-sa1100/leds.c
new file mode 100644
index 000000000000..4cf7c565aaed
--- /dev/null
+++ b/arch/arm/mach-sa1100/leds.c
@@ -0,0 +1,52 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds.c
3 *
4 * SA1100 LEDs dispatcher
5 *
6 * Copyright (C) 2001 Nicolas Pitre
7 */
8#include <linux/compiler.h>
9#include <linux/init.h>
10
11#include <asm/leds.h>
12#include <asm/mach-types.h>
13
14#include "leds.h"
15
16static int __init
17sa1100_leds_init(void)
18{
19 if (machine_is_assabet())
20 leds_event = assabet_leds_event;
21 if (machine_is_consus())
22 leds_event = consus_leds_event;
23 if (machine_is_badge4())
24 leds_event = badge4_leds_event;
25 if (machine_is_brutus())
26 leds_event = brutus_leds_event;
27 if (machine_is_cerf())
28 leds_event = cerf_leds_event;
29 if (machine_is_flexanet())
30 leds_event = flexanet_leds_event;
31 if (machine_is_graphicsclient())
32 leds_event = graphicsclient_leds_event;
33 if (machine_is_hackkit())
34 leds_event = hackkit_leds_event;
35 if (machine_is_lart())
36 leds_event = lart_leds_event;
37 if (machine_is_pfs168())
38 leds_event = pfs168_leds_event;
39 if (machine_is_graphicsmaster())
40 leds_event = graphicsmaster_leds_event;
41 if (machine_is_adsbitsy())
42 leds_event = adsbitsy_leds_event;
43 if (machine_is_pt_system3())
44 leds_event = system3_leds_event;
45 if (machine_is_simpad())
46 leds_event = simpad_leds_event; /* what about machine registry? including led, apm... -zecke */
47
48 leds_event(led_start);
49 return 0;
50}
51
52core_initcall(sa1100_leds_init);
diff --git a/arch/arm/mach-sa1100/leds.h b/arch/arm/mach-sa1100/leds.h
new file mode 100644
index 000000000000..68cc9f773d6d
--- /dev/null
+++ b/arch/arm/mach-sa1100/leds.h
@@ -0,0 +1,14 @@
1extern void assabet_leds_event(led_event_t evt);
2extern void badge4_leds_event(led_event_t evt);
3extern void consus_leds_event(led_event_t evt);
4extern void brutus_leds_event(led_event_t evt);
5extern void cerf_leds_event(led_event_t evt);
6extern void flexanet_leds_event(led_event_t evt);
7extern void graphicsclient_leds_event(led_event_t evt);
8extern void hackkit_leds_event(led_event_t evt);
9extern void lart_leds_event(led_event_t evt);
10extern void pfs168_leds_event(led_event_t evt);
11extern void graphicsmaster_leds_event(led_event_t evt);
12extern void adsbitsy_leds_event(led_event_t evt);
13extern void system3_leds_event(led_event_t evt);
14extern void simpad_leds_event(led_event_t evt);
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
new file mode 100644
index 000000000000..1405383463ea
--- /dev/null
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -0,0 +1,342 @@
1/*
2 * linux/arch/arm/mach-sa1100/neponset.c
3 *
4 */
5#include <linux/kernel.h>
6#include <linux/init.h>
7#include <linux/ptrace.h>
8#include <linux/tty.h>
9#include <linux/ioport.h>
10#include <linux/serial_core.h>
11#include <linux/device.h>
12#include <linux/slab.h>
13
14#include <asm/hardware.h>
15#include <asm/mach-types.h>
16#include <asm/irq.h>
17#include <asm/mach/map.h>
18#include <asm/mach/irq.h>
19#include <asm/mach/serial_sa1100.h>
20#include <asm/arch/assabet.h>
21#include <asm/arch/neponset.h>
22#include <asm/hardware/sa1111.h>
23#include <asm/sizes.h>
24
25/*
26 * Install handler for Neponset IRQ. Note that we have to loop here
27 * since the ETHERNET and USAR IRQs are level based, and we need to
28 * ensure that the IRQ signal is deasserted before returning. This
29 * is rather unfortunate.
30 */
31static void
32neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
33{
34 unsigned int irr;
35
36 while (1) {
37 struct irqdesc *d;
38
39 /*
40 * Acknowledge the parent IRQ.
41 */
42 desc->chip->ack(irq);
43
44 /*
45 * Read the interrupt reason register. Let's have all
46 * active IRQ bits high. Note: there is a typo in the
47 * Neponset user's guide for the SA1111 IRR level.
48 */
49 irr = IRR ^ (IRR_ETHERNET | IRR_USAR);
50
51 if ((irr & (IRR_ETHERNET | IRR_USAR | IRR_SA1111)) == 0)
52 break;
53
54 /*
55 * Since there is no individual mask, we have to
56 * mask the parent IRQ. This is safe, since we'll
57 * recheck the register for any pending IRQs.
58 */
59 if (irr & (IRR_ETHERNET | IRR_USAR)) {
60 desc->chip->mask(irq);
61
62 if (irr & IRR_ETHERNET) {
63 d = irq_desc + IRQ_NEPONSET_SMC9196;
64 d->handle(IRQ_NEPONSET_SMC9196, d, regs);
65 }
66
67 if (irr & IRR_USAR) {
68 d = irq_desc + IRQ_NEPONSET_USAR;
69 d->handle(IRQ_NEPONSET_USAR, d, regs);
70 }
71
72 desc->chip->unmask(irq);
73 }
74
75 if (irr & IRR_SA1111) {
76 d = irq_desc + IRQ_NEPONSET_SA1111;
77 d->handle(IRQ_NEPONSET_SA1111, d, regs);
78 }
79 }
80}
81
82static void neponset_set_mctrl(struct uart_port *port, u_int mctrl)
83{
84 u_int mdm_ctl0 = MDM_CTL_0;
85
86 if (port->mapbase == _Ser1UTCR0) {
87 if (mctrl & TIOCM_RTS)
88 mdm_ctl0 &= ~MDM_CTL0_RTS2;
89 else
90 mdm_ctl0 |= MDM_CTL0_RTS2;
91
92 if (mctrl & TIOCM_DTR)
93 mdm_ctl0 &= ~MDM_CTL0_DTR2;
94 else
95 mdm_ctl0 |= MDM_CTL0_DTR2;
96 } else if (port->mapbase == _Ser3UTCR0) {
97 if (mctrl & TIOCM_RTS)
98 mdm_ctl0 &= ~MDM_CTL0_RTS1;
99 else
100 mdm_ctl0 |= MDM_CTL0_RTS1;
101
102 if (mctrl & TIOCM_DTR)
103 mdm_ctl0 &= ~MDM_CTL0_DTR1;
104 else
105 mdm_ctl0 |= MDM_CTL0_DTR1;
106 }
107
108 MDM_CTL_0 = mdm_ctl0;
109}
110
111static u_int neponset_get_mctrl(struct uart_port *port)
112{
113 u_int ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
114 u_int mdm_ctl1 = MDM_CTL_1;
115
116 if (port->mapbase == _Ser1UTCR0) {
117 if (mdm_ctl1 & MDM_CTL1_DCD2)
118 ret &= ~TIOCM_CD;
119 if (mdm_ctl1 & MDM_CTL1_CTS2)
120 ret &= ~TIOCM_CTS;
121 if (mdm_ctl1 & MDM_CTL1_DSR2)
122 ret &= ~TIOCM_DSR;
123 } else if (port->mapbase == _Ser3UTCR0) {
124 if (mdm_ctl1 & MDM_CTL1_DCD1)
125 ret &= ~TIOCM_CD;
126 if (mdm_ctl1 & MDM_CTL1_CTS1)
127 ret &= ~TIOCM_CTS;
128 if (mdm_ctl1 & MDM_CTL1_DSR1)
129 ret &= ~TIOCM_DSR;
130 }
131
132 return ret;
133}
134
135static struct sa1100_port_fns neponset_port_fns __initdata = {
136 .set_mctrl = neponset_set_mctrl,
137 .get_mctrl = neponset_get_mctrl,
138};
139
140static int neponset_probe(struct device *dev)
141{
142 sa1100_register_uart_fns(&neponset_port_fns);
143
144 /*
145 * Install handler for GPIO25.
146 */
147 set_irq_type(IRQ_GPIO25, IRQT_RISING);
148 set_irq_chained_handler(IRQ_GPIO25, neponset_irq_handler);
149
150 /*
151 * We would set IRQ_GPIO25 to be a wake-up IRQ, but
152 * unfortunately something on the Neponset activates
153 * this IRQ on sleep (ethernet?)
154 */
155#if 0
156 enable_irq_wake(IRQ_GPIO25);
157#endif
158
159 /*
160 * Setup other Neponset IRQs. SA1111 will be done by the
161 * generic SA1111 code.
162 */
163 set_irq_handler(IRQ_NEPONSET_SMC9196, do_simple_IRQ);
164 set_irq_flags(IRQ_NEPONSET_SMC9196, IRQF_VALID | IRQF_PROBE);
165 set_irq_handler(IRQ_NEPONSET_USAR, do_simple_IRQ);
166 set_irq_flags(IRQ_NEPONSET_USAR, IRQF_VALID | IRQF_PROBE);
167
168 /*
169 * Disable GPIO 0/1 drivers so the buttons work on the module.
170 */
171 NCR_0 = NCR_GP01_OFF;
172
173 return 0;
174}
175
176#ifdef CONFIG_PM
177
178/*
179 * LDM power management.
180 */
181static int neponset_suspend(struct device *dev, pm_message_t state, u32 level)
182{
183 /*
184 * Save state.
185 */
186 if (level == SUSPEND_SAVE_STATE ||
187 level == SUSPEND_DISABLE ||
188 level == SUSPEND_POWER_DOWN) {
189 if (!dev->power.saved_state)
190 dev->power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL);
191 if (!dev->power.saved_state)
192 return -ENOMEM;
193
194 *(unsigned int *)dev->power.saved_state = NCR_0;
195 }
196
197 return 0;
198}
199
200static int neponset_resume(struct device *dev, u32 level)
201{
202 if (level == RESUME_RESTORE_STATE || level == RESUME_ENABLE) {
203 if (dev->power.saved_state) {
204 NCR_0 = *(unsigned int *)dev->power.saved_state;
205 kfree(dev->power.saved_state);
206 dev->power.saved_state = NULL;
207 }
208 }
209
210 return 0;
211}
212
213#else
214#define neponset_suspend NULL
215#define neponset_resume NULL
216#endif
217
218static struct device_driver neponset_device_driver = {
219 .name = "neponset",
220 .bus = &platform_bus_type,
221 .probe = neponset_probe,
222 .suspend = neponset_suspend,
223 .resume = neponset_resume,
224};
225
226static struct resource neponset_resources[] = {
227 [0] = {
228 .start = 0x10000000,
229 .end = 0x17ffffff,
230 .flags = IORESOURCE_MEM,
231 },
232};
233
234static struct platform_device neponset_device = {
235 .name = "neponset",
236 .id = 0,
237 .num_resources = ARRAY_SIZE(neponset_resources),
238 .resource = neponset_resources,
239};
240
241static struct resource sa1111_resources[] = {
242 [0] = {
243 .start = 0x40000000,
244 .end = 0x40001fff,
245 .flags = IORESOURCE_MEM,
246 },
247 [1] = {
248 .start = IRQ_NEPONSET_SA1111,
249 .end = IRQ_NEPONSET_SA1111,
250 .flags = IORESOURCE_IRQ,
251 },
252};
253
254static u64 sa1111_dmamask = 0xffffffffUL;
255
256static struct platform_device sa1111_device = {
257 .name = "sa1111",
258 .id = 0,
259 .dev = {
260 .dma_mask = &sa1111_dmamask,
261 .coherent_dma_mask = 0xffffffff,
262 },
263 .num_resources = ARRAY_SIZE(sa1111_resources),
264 .resource = sa1111_resources,
265};
266
267static struct resource smc91x_resources[] = {
268 [0] = {
269 .name = "smc91x-regs",
270 .start = SA1100_CS3_PHYS,
271 .end = SA1100_CS3_PHYS + 0x01ffffff,
272 .flags = IORESOURCE_MEM,
273 },
274 [1] = {
275 .start = IRQ_NEPONSET_SMC9196,
276 .end = IRQ_NEPONSET_SMC9196,
277 .flags = IORESOURCE_IRQ,
278 },
279 [2] = {
280 .name = "smc91x-attrib",
281 .start = SA1100_CS3_PHYS + 0x02000000,
282 .end = SA1100_CS3_PHYS + 0x03ffffff,
283 .flags = IORESOURCE_MEM,
284 },
285};
286
287static struct platform_device smc91x_device = {
288 .name = "smc91x",
289 .id = 0,
290 .num_resources = ARRAY_SIZE(smc91x_resources),
291 .resource = smc91x_resources,
292};
293
294static struct platform_device *devices[] __initdata = {
295 &neponset_device,
296 &sa1111_device,
297 &smc91x_device,
298};
299
300static int __init neponset_init(void)
301{
302 driver_register(&neponset_device_driver);
303
304 /*
305 * The Neponset is only present on the Assabet machine type.
306 */
307 if (!machine_is_assabet())
308 return -ENODEV;
309
310 /*
311 * Ensure that the memory bus request/grant signals are setup,
312 * and the grant is held in its inactive state, whether or not
313 * we actually have a Neponset attached.
314 */
315 sa1110_mb_disable();
316
317 if (!machine_has_neponset()) {
318 printk(KERN_DEBUG "Neponset expansion board not present\n");
319 return -ENODEV;
320 }
321
322 if (WHOAMI != 0x11) {
323 printk(KERN_WARNING "Neponset board detected, but "
324 "wrong ID: %02x\n", WHOAMI);
325 return -ENODEV;
326 }
327
328 return platform_add_devices(devices, ARRAY_SIZE(devices));
329}
330
331subsys_initcall(neponset_init);
332
333static struct map_desc neponset_io_desc[] __initdata = {
334 /* virtual physical length type */
335 { 0xf3000000, 0x10000000, SZ_1M, MT_DEVICE }, /* System Registers */
336 { 0xf4000000, 0x40000000, SZ_1M, MT_DEVICE } /* SA-1111 */
337};
338
339void __init neponset_map_io(void)
340{
341 iotable_init(neponset_io_desc, ARRAY_SIZE(neponset_io_desc));
342}
diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c
new file mode 100644
index 000000000000..5606bd71b024
--- /dev/null
+++ b/arch/arm/mach-sa1100/pleb.c
@@ -0,0 +1,154 @@
1/*
2 * linux/arch/arm/mach-sa1100/pleb.c
3 */
4
5#include <linux/init.h>
6#include <linux/kernel.h>
7#include <linux/tty.h>
8#include <linux/ioport.h>
9#include <linux/device.h>
10
11#include <linux/mtd/partitions.h>
12
13#include <asm/hardware.h>
14#include <asm/io.h>
15#include <asm/setup.h>
16#include <asm/mach-types.h>
17
18#include <asm/mach/arch.h>
19#include <asm/mach/map.h>
20#include <asm/mach/flash.h>
21#include <asm/mach/serial_sa1100.h>
22#include <asm/arch/irqs.h>
23
24#include "generic.h"
25
26
27/*
28 * Ethernet IRQ mappings
29 */
30
31#define PLEB_ETH0_P (0x20000300) /* Ethernet 0 in PCMCIA0 IO */
32#define PLEB_ETH0_V (0xf6000300)
33
34#define GPIO_ETH0_IRQ GPIO_GPIO(21)
35#define GPIO_ETH0_EN GPIO_GPIO(26)
36
37#define IRQ_GPIO_ETH0_IRQ IRQ_GPIO21
38
39static struct resource smc91x_resources[] = {
40 [0] = {
41 .start = PLEB_ETH0_P,
42 .end = PLEB_ETH0_P | 0x03ffffff,
43 .flags = IORESOURCE_MEM,
44 },
45#if 0 /* Autoprobe instead, to get rising/falling edge characteristic right */
46 [1] = {
47 .start = IRQ_GPIO_ETH0_IRQ,
48 .end = IRQ_GPIO_ETH0_IRQ,
49 .flags = IORESOURCE_IRQ,
50 },
51#endif
52};
53
54
55static struct platform_device smc91x_device = {
56 .name = "smc91x",
57 .id = 0,
58 .num_resources = ARRAY_SIZE(smc91x_resources),
59 .resource = smc91x_resources,
60};
61
62static struct platform_device *devices[] __initdata = {
63 &smc91x_device,
64};
65
66
67/*
68 * Pleb's memory map
69 * has flash memory (typically 4 or 8 meg) selected by
70 * the two SA1100 lowest chip select outputs.
71 */
72static struct resource pleb_flash_resources[] = {
73 [0] = {
74 .start = SA1100_CS0_PHYS,
75 .end = SA1100_CS0_PHYS + SZ_8M - 1,
76 .flags = IORESOURCE_MEM,
77 },
78 [1] = {
79 .start = SA1100_CS1_PHYS,
80 .end = SA1100_CS1_PHYS + SZ_8M - 1,
81 .flags = IORESOURCE_MEM,
82 }
83};
84
85
86static struct mtd_partition pleb_partitions[] = {
87 {
88 .name = "blob",
89 .offset = 0,
90 .size = 0x00020000,
91 }, {
92 .name = "kernel",
93 .offset = MTDPART_OFS_APPEND,
94 .size = 0x000e0000,
95 }, {
96 .name = "rootfs",
97 .offset = MTDPART_OFS_APPEND,
98 .size = 0x00300000,
99 }
100};
101
102
103static struct flash_platform_data pleb_flash_data = {
104 .map_name = "cfi_probe",
105 .parts = pleb_partitions,
106 .nr_parts = ARRAY_SIZE(pleb_partitions),
107};
108
109
110static void __init pleb_init(void)
111{
112 sa11x0_set_flash_data(&pleb_flash_data, pleb_flash_resources,
113 ARRAY_SIZE(pleb_flash_resources));
114
115
116 platform_add_devices(devices, ARRAY_SIZE(devices));
117}
118
119
120static void __init pleb_map_io(void)
121{
122 sa1100_map_io();
123
124 sa1100_register_uart(0, 3);
125 sa1100_register_uart(1, 1);
126
127 GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
128 GPDR |= GPIO_UART_TXD;
129 GPDR &= ~GPIO_UART_RXD;
130 PPAR |= PPAR_UPR;
131
132 /*
133 * Fix expansion memory timing for network card
134 */
135 MECR = ((2<<10) | (2<<5) | (2<<0));
136
137 /*
138 * Enable the SMC ethernet controller
139 */
140 GPDR |= GPIO_ETH0_EN; /* set to output */
141 GPCR = GPIO_ETH0_EN; /* clear MCLK (enable smc) */
142
143 GPDR &= ~GPIO_ETH0_IRQ;
144
145 set_irq_type(GPIO_ETH0_IRQ, IRQT_FALLING);
146}
147
148MACHINE_START(PLEB, "PLEB")
149 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
150 MAPIO(pleb_map_io)
151 INITIRQ(sa1100_init_irq)
152 .timer = &sa1100_timer,
153 .init_machine = pleb_init,
154MACHINE_END
diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c
new file mode 100644
index 000000000000..379ea5e3950f
--- /dev/null
+++ b/arch/arm/mach-sa1100/pm.c
@@ -0,0 +1,167 @@
1/*
2 * SA1100 Power Management Routines
3 *
4 * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com>
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 *
9 * History:
10 *
11 * 2001-02-06: Cliff Brake Initial code
12 *
13 * 2001-02-25: Sukjae Cho <sjcho@east.isi.edu> &
14 * Chester Kuo <chester@linux.org.tw>
15 * Save more value for the resume function! Support
16 * Bitsy/Assabet/Freebird board
17 *
18 * 2001-08-29: Nicolas Pitre <nico@cam.org>
19 * Cleaned up, pushed platform dependent stuff
20 * in the platform specific files.
21 *
22 * 2002-05-27: Nicolas Pitre Killed sleep.h and the kmalloced save array.
23 * Storage is local on the stack now.
24 */
25#include <linux/init.h>
26#include <linux/suspend.h>
27#include <linux/errno.h>
28#include <linux/time.h>
29
30#include <asm/hardware.h>
31#include <asm/memory.h>
32#include <asm/system.h>
33#include <asm/mach/time.h>
34
35extern void sa1100_cpu_suspend(void);
36extern void sa1100_cpu_resume(void);
37
38#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
39#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
40
41/*
42 * List of global SA11x0 peripheral registers to preserve.
43 * More ones like CP and general purpose register values are preserved
44 * on the stack and then the stack pointer is stored last in sleep.S.
45 */
46enum { SLEEP_SAVE_SP = 0,
47
48 SLEEP_SAVE_GPDR, SLEEP_SAVE_GAFR,
49 SLEEP_SAVE_PPDR, SLEEP_SAVE_PPSR, SLEEP_SAVE_PPAR, SLEEP_SAVE_PSDR,
50
51 SLEEP_SAVE_Ser1SDCR0,
52
53 SLEEP_SAVE_SIZE
54};
55
56
57static int sa11x0_pm_enter(suspend_state_t state)
58{
59 unsigned long gpio, sleep_save[SLEEP_SAVE_SIZE];
60 struct timespec delta, rtc;
61
62 if (state != PM_SUSPEND_MEM)
63 return -EINVAL;
64
65 /* preserve current time */
66 rtc.tv_sec = RCNR;
67 rtc.tv_nsec = 0;
68 save_time_delta(&delta, &rtc);
69 gpio = GPLR;
70
71 /* save vital registers */
72 SAVE(GPDR);
73 SAVE(GAFR);
74
75 SAVE(PPDR);
76 SAVE(PPSR);
77 SAVE(PPAR);
78 SAVE(PSDR);
79
80 SAVE(Ser1SDCR0);
81
82 /* Clear previous reset status */
83 RCSR = RCSR_HWR | RCSR_SWR | RCSR_WDR | RCSR_SMR;
84
85 /* set resume return address */
86 PSPR = virt_to_phys(sa1100_cpu_resume);
87
88 /* go zzz */
89 sa1100_cpu_suspend();
90
91 /*
92 * Ensure not to come back here if it wasn't intended
93 */
94 PSPR = 0;
95
96 /*
97 * Ensure interrupt sources are disabled; we will re-init
98 * the interrupt subsystem via the device manager.
99 */
100 ICLR = 0;
101 ICCR = 1;
102 ICMR = 0;
103
104 /* restore registers */
105 RESTORE(GPDR);
106 RESTORE(GAFR);
107
108 RESTORE(PPDR);
109 RESTORE(PPSR);
110 RESTORE(PPAR);
111 RESTORE(PSDR);
112
113 RESTORE(Ser1SDCR0);
114
115 GPSR = gpio;
116 GPCR = ~gpio;
117
118 /*
119 * Clear the peripheral sleep-hold bit.
120 */
121 PSSR = PSSR_PH;
122
123 /* restore current time */
124 rtc.tv_sec = RCNR;
125 restore_time_delta(&delta, &rtc);
126
127 return 0;
128}
129
130unsigned long sleep_phys_sp(void *sp)
131{
132 return virt_to_phys(sp);
133}
134
135/*
136 * Called after processes are frozen, but before we shut down devices.
137 */
138static int sa11x0_pm_prepare(suspend_state_t state)
139{
140 return 0;
141}
142
143/*
144 * Called after devices are re-setup, but before processes are thawed.
145 */
146static int sa11x0_pm_finish(suspend_state_t state)
147{
148 return 0;
149}
150
151/*
152 * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk.
153 */
154static struct pm_ops sa11x0_pm_ops = {
155 .pm_disk_mode = PM_DISK_FIRMWARE,
156 .prepare = sa11x0_pm_prepare,
157 .enter = sa11x0_pm_enter,
158 .finish = sa11x0_pm_finish,
159};
160
161static int __init sa11x0_pm_init(void)
162{
163 pm_set_ops(&sa11x0_pm_ops);
164 return 0;
165}
166
167late_initcall(sa11x0_pm_init);
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
new file mode 100644
index 000000000000..edddd559be02
--- /dev/null
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -0,0 +1,85 @@
1/*
2 * linux/arch/arm/mach-sa1100/shannon.c
3 */
4
5#include <linux/config.h>
6#include <linux/init.h>
7#include <linux/device.h>
8#include <linux/kernel.h>
9#include <linux/tty.h>
10#include <linux/mtd/mtd.h>
11#include <linux/mtd/partitions.h>
12
13#include <asm/hardware.h>
14#include <asm/mach-types.h>
15#include <asm/setup.h>
16
17#include <asm/mach/arch.h>
18#include <asm/mach/flash.h>
19#include <asm/mach/map.h>
20#include <asm/mach/serial_sa1100.h>
21#include <asm/arch/shannon.h>
22
23#include "generic.h"
24
25static struct mtd_partition shannon_partitions[] = {
26 {
27 .name = "BLOB boot loader",
28 .offset = 0,
29 .size = 0x20000
30 },
31 {
32 .name = "kernel",
33 .offset = MTDPART_OFS_APPEND,
34 .size = 0xe0000
35 },
36 {
37 .name = "initrd",
38 .offset = MTDPART_OFS_APPEND,
39 .size = MTDPART_SIZ_FULL
40 }
41};
42
43static struct flash_platform_data shannon_flash_data = {
44 .map_name = "cfi_probe",
45 .parts = shannon_partitions,
46 .nr_parts = ARRAY_SIZE(shannon_partitions),
47};
48
49static struct resource shannon_flash_resource = {
50 .start = SA1100_CS0_PHYS,
51 .end = SA1100_CS0_PHYS + SZ_4M - 1,
52 .flags = IORESOURCE_MEM,
53};
54
55static void __init shannon_init(void)
56{
57 sa11x0_set_flash_data(&shannon_flash_data, &shannon_flash_resource, 1);
58}
59
60static void __init shannon_map_io(void)
61{
62 sa1100_map_io();
63
64 sa1100_register_uart(0, 3);
65 sa1100_register_uart(1, 1);
66
67 Ser1SDCR0 |= SDCR0_SUS;
68 GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
69 GPDR |= GPIO_UART_TXD | SHANNON_GPIO_CODEC_RESET;
70 GPDR &= ~GPIO_UART_RXD;
71 PPAR |= PPAR_UPR;
72
73 /* reset the codec */
74 GPCR = SHANNON_GPIO_CODEC_RESET;
75 GPSR = SHANNON_GPIO_CODEC_RESET;
76}
77
78MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
79 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
80 BOOT_PARAMS(0xc0000100)
81 MAPIO(shannon_map_io)
82 INITIRQ(sa1100_init_irq)
83 .timer = &sa1100_timer,
84 .init_machine = shannon_init,
85MACHINE_END
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
new file mode 100644
index 000000000000..8d113d629867
--- /dev/null
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -0,0 +1,224 @@
1/*
2 * linux/arch/arm/mach-sa1100/simpad.c
3 */
4
5#include <linux/config.h>
6#include <linux/module.h>
7#include <linux/init.h>
8#include <linux/kernel.h>
9#include <linux/tty.h>
10#include <linux/proc_fs.h>
11#include <linux/string.h>
12#include <linux/pm.h>
13#include <linux/device.h>
14#include <linux/mtd/mtd.h>
15#include <linux/mtd/partitions.h>
16
17#include <asm/irq.h>
18#include <asm/hardware.h>
19#include <asm/setup.h>
20
21#include <asm/mach-types.h>
22#include <asm/mach/arch.h>
23#include <asm/mach/flash.h>
24#include <asm/mach/map.h>
25#include <asm/mach/serial_sa1100.h>
26#include <asm/arch/simpad.h>
27
28#include <linux/serial_core.h>
29#include <linux/ioport.h>
30#include <asm/io.h>
31
32#include "generic.h"
33
34long cs3_shadow;
35
36long get_cs3_shadow(void)
37{
38 return cs3_shadow;
39}
40
41void set_cs3(long value)
42{
43 *(CS3BUSTYPE *)(CS3_BASE) = cs3_shadow = value;
44}
45
46void set_cs3_bit(int value)
47{
48 cs3_shadow |= value;
49 *(CS3BUSTYPE *)(CS3_BASE) = cs3_shadow;
50}
51
52void clear_cs3_bit(int value)
53{
54 cs3_shadow &= ~value;
55 *(CS3BUSTYPE *)(CS3_BASE) = cs3_shadow;
56}
57
58EXPORT_SYMBOL(set_cs3_bit);
59EXPORT_SYMBOL(clear_cs3_bit);
60
61static struct map_desc simpad_io_desc[] __initdata = {
62 /* virtual physical length type */
63 /* MQ200 */
64 { 0xf2800000, 0x4b800000, 0x00800000, MT_DEVICE },
65 /* Paules CS3, write only */
66 { 0xf1000000, 0x18000000, 0x00100000, MT_DEVICE },
67};
68
69
70static void simpad_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
71{
72 if (port->mapbase == (u_int)&Ser1UTCR0) {
73 if (state)
74 {
75 clear_cs3_bit(RS232_ON);
76 clear_cs3_bit(DECT_POWER_ON);
77 }else
78 {
79 set_cs3_bit(RS232_ON);
80 set_cs3_bit(DECT_POWER_ON);
81 }
82 }
83}
84
85static struct sa1100_port_fns simpad_port_fns __initdata = {
86 .pm = simpad_uart_pm,
87};
88
89
90static struct mtd_partition simpad_partitions[] = {
91 {
92 .name = "SIMpad boot firmware",
93 .size = 0x00080000,
94 .offset = 0,
95 .mask_flags = MTD_WRITEABLE,
96 }, {
97 .name = "SIMpad kernel",
98 .size = 0x0010000,
99 .offset = MTDPART_OFS_APPEND,
100 }, {
101 .name = "SIMpad root jffs2",
102 .size = MTDPART_SIZ_FULL,
103 .offset = MTDPART_OFS_APPEND,
104 }
105};
106
107static struct flash_platform_data simpad_flash_data = {
108 .map_name = "cfi_probe",
109 .parts = simpad_partitions,
110 .nr_parts = ARRAY_SIZE(simpad_partitions),
111};
112
113
114static struct resource simpad_flash_resources [] = {
115 {
116 .start = SA1100_CS0_PHYS,
117 .end = SA1100_CS0_PHYS + SZ_16M -1,
118 .flags = IORESOURCE_MEM,
119 }, {
120 .start = SA1100_CS1_PHYS,
121 .end = SA1100_CS1_PHYS + SZ_16M -1,
122 .flags = IORESOURCE_MEM,
123 }
124};
125
126
127
128static void __init simpad_map_io(void)
129{
130 sa1100_map_io();
131
132 iotable_init(simpad_io_desc, ARRAY_SIZE(simpad_io_desc));
133
134 set_cs3_bit (EN1 | EN0 | LED2_ON | DISPLAY_ON | RS232_ON |
135 ENABLE_5V | RESET_SIMCARD | DECT_POWER_ON);
136
137
138 sa1100_register_uart_fns(&simpad_port_fns);
139 sa1100_register_uart(0, 3); /* serial interface */
140 sa1100_register_uart(1, 1); /* DECT */
141
142 // Reassign UART 1 pins
143 GAFR |= GPIO_UART_TXD | GPIO_UART_RXD;
144 GPDR |= GPIO_UART_TXD | GPIO_LDD13 | GPIO_LDD15;
145 GPDR &= ~GPIO_UART_RXD;
146 PPAR |= PPAR_UPR;
147
148 /*
149 * Set up registers for sleep mode.
150 */
151
152
153 PWER = PWER_GPIO0| PWER_RTC;
154 PGSR = 0x818;
155 PCFR = 0;
156 PSDR = 0;
157
158 sa11x0_set_flash_data(&simpad_flash_data, simpad_flash_resources,
159 ARRAY_SIZE(simpad_flash_resources));
160}
161
162static void simpad_power_off(void)
163{
164 local_irq_disable(); // was cli
165 set_cs3(0x800); /* only SD_MEDIAQ */
166
167 /* disable internal oscillator, float CS lines */
168 PCFR = (PCFR_OPDE | PCFR_FP | PCFR_FS);
169 /* enable wake-up on GPIO0 (Assabet...) */
170 PWER = GFER = GRER = 1;
171 /*
172 * set scratchpad to zero, just in case it is used as a
173 * restart address by the bootloader.
174 */
175 PSPR = 0;
176 PGSR = 0;
177 /* enter sleep mode */
178 PMCR = PMCR_SF;
179 while(1);
180
181 local_irq_enable(); /* we won't ever call it */
182
183
184}
185
186
187/*
188 * MediaQ Video Device
189 */
190static struct platform_device simpad_mq200fb = {
191 .name = "simpad-mq200",
192 .id = 0,
193};
194
195static struct platform_device *devices[] __initdata = {
196 &simpad_mq200fb
197};
198
199
200
201static int __init simpad_init(void)
202{
203 int ret;
204
205 pm_power_off = simpad_power_off;
206
207 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
208 if(ret)
209 printk(KERN_WARNING "simpad: Unable to register mq200 framebuffer device");
210
211 return 0;
212}
213
214arch_initcall(simpad_init);
215
216
217MACHINE_START(SIMPAD, "Simpad")
218 MAINTAINER("Holger Freyther")
219 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
220 BOOT_PARAMS(0xc0000100)
221 MAPIO(simpad_map_io)
222 INITIRQ(sa1100_init_irq)
223 .timer = &sa1100_timer,
224MACHINE_END
diff --git a/arch/arm/mach-sa1100/sleep.S b/arch/arm/mach-sa1100/sleep.S
new file mode 100644
index 000000000000..2fa1e289d177
--- /dev/null
+++ b/arch/arm/mach-sa1100/sleep.S
@@ -0,0 +1,215 @@
1/*
2 * SA11x0 Assembler Sleep/WakeUp Management Routines
3 *
4 * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com>
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 *
9 * History:
10 *
11 * 2001-02-06: Cliff Brake Initial code
12 *
13 * 2001-08-29: Nicolas Pitre Simplified.
14 *
15 * 2002-05-27: Nicolas Pitre Revisited, more cleanup and simplification.
16 * Storage is on the stack now.
17 */
18
19#include <linux/linkage.h>
20#include <asm/assembler.h>
21#include <asm/hardware.h>
22
23
24
25 .text
26
27
28
29/*
30 * sa1100_cpu_suspend()
31 *
32 * Causes sa11x0 to enter sleep state
33 *
34 */
35
36ENTRY(sa1100_cpu_suspend)
37
38 stmfd sp!, {r4 - r12, lr} @ save registers on stack
39
40 @ get coprocessor registers
41 mrc p15, 0, r4, c3, c0, 0 @ domain ID
42 mrc p15, 0, r5, c2, c0, 0 @ translation table base addr
43 mrc p15, 0, r6, c13, c0, 0 @ PID
44 mrc p15, 0, r7, c1, c0, 0 @ control reg
45
46 @ store them plus current virtual stack ptr on stack
47 mov r8, sp
48 stmfd sp!, {r4 - r8}
49
50 @ preserve phys address of stack
51 mov r0, sp
52 bl sleep_phys_sp
53 ldr r1, =sleep_save_sp
54 str r0, [r1]
55
56 @ clean data cache and invalidate WB
57 bl v4wb_flush_kern_cache_all
58
59 @ disable clock switching
60 mcr p15, 0, r1, c15, c2, 2
61
62 @ Adjust memory timing before lowering CPU clock
63 @ Clock speed adjustment without changing memory timing makes
64 @ CPU hang in some cases
65 ldr r0, =MDREFR
66 ldr r1, [r0]
67 orr r1, r1, #MDREFR_K1DB2
68 str r1, [r0]
69
70 @ delay 90us and set CPU PLL to lowest speed
71 @ fixes resume problem on high speed SA1110
72 mov r0, #90
73 bl __udelay
74 ldr r0, =PPCR
75 mov r1, #0
76 str r1, [r0]
77 mov r0, #90
78 bl __udelay
79
80 /*
81 * SA1110 SDRAM controller workaround. register values:
82 *
83 * r0 = &MSC0
84 * r1 = &MSC1
85 * r2 = &MSC2
86 * r3 = MSC0 value
87 * r4 = MSC1 value
88 * r5 = MSC2 value
89 * r6 = &MDREFR
90 * r7 = first MDREFR value
91 * r8 = second MDREFR value
92 * r9 = &MDCNFG
93 * r10 = MDCNFG value
94 * r11 = third MDREFR value
95 * r12 = &PMCR
96 * r13 = PMCR value (1)
97 */
98
99 ldr r0, =MSC0
100 ldr r1, =MSC1
101 ldr r2, =MSC2
102
103 ldr r3, [r0]
104 bic r3, r3, #FMsk(MSC_RT)
105 bic r3, r3, #FMsk(MSC_RT)<<16
106
107 ldr r4, [r1]
108 bic r4, r4, #FMsk(MSC_RT)
109 bic r4, r4, #FMsk(MSC_RT)<<16
110
111 ldr r5, [r2]
112 bic r5, r5, #FMsk(MSC_RT)
113 bic r5, r5, #FMsk(MSC_RT)<<16
114
115 ldr r6, =MDREFR
116
117 ldr r7, [r6]
118 bic r7, r7, #0x0000FF00
119 bic r7, r7, #0x000000F0
120 orr r8, r7, #MDREFR_SLFRSH
121
122 ldr r9, =MDCNFG
123 ldr r10, [r9]
124 bic r10, r10, #(MDCNFG_DE0+MDCNFG_DE1)
125 bic r10, r10, #(MDCNFG_DE2+MDCNFG_DE3)
126
127 bic r11, r8, #MDREFR_SLFRSH
128 bic r11, r11, #MDREFR_E1PIN
129
130 ldr r12, =PMCR
131
132 mov r13, #PMCR_SF
133
134 b sa1110_sdram_controller_fix
135
136 .align 5
137sa1110_sdram_controller_fix:
138
139 @ Step 1 clear RT field of all MSCx registers
140 str r3, [r0]
141 str r4, [r1]
142 str r5, [r2]
143
144 @ Step 2 clear DRI field in MDREFR
145 str r7, [r6]
146
147 @ Step 3 set SLFRSH bit in MDREFR
148 str r8, [r6]
149
150 @ Step 4 clear DE bis in MDCNFG
151 str r10, [r9]
152
153 @ Step 5 clear DRAM refresh control register
154 str r11, [r6]
155
156 @ Wow, now the hardware suspend request pins can be used, that makes them functional for
157 @ about 7 ns out of the entire time that the CPU is running!
158
159 @ Step 6 set force sleep bit in PMCR
160
161 str r13, [r12]
162
16320: b 20b @ loop waiting for sleep
164
165/*
166 * cpu_sa1100_resume()
167 *
168 * entry point from bootloader into kernel during resume
169 *
170 * Note: Yes, part of the following code is located into the .data section.
171 * This is to allow sleep_save_sp to be accessed with a relative load
172 * while we can't rely on any MMU translation. We could have put
173 * sleep_save_sp in the .text section as well, but some setups might
174 * insist on it to be truly read-only.
175 */
176
177 .data
178 .align 5
179ENTRY(sa1100_cpu_resume)
180 mov r0, #PSR_F_BIT | PSR_I_BIT | MODE_SVC
181 msr cpsr_c, r0 @ set SVC, irqs off
182
183 ldr r0, sleep_save_sp @ stack phys addr
184 ldr r2, =resume_after_mmu @ its absolute virtual address
185 ldmfd r0, {r4 - r7, sp} @ CP regs + virt stack ptr
186
187 mov r1, #0
188 mcr p15, 0, r1, c8, c7, 0 @ flush I+D TLBs
189 mcr p15, 0, r1, c7, c7, 0 @ flush I&D cache
190 mcr p15, 0, r1, c9, c0, 0 @ invalidate RB
191 mcr p15, 0, r1, c9, c0, 5 @ allow user space to use RB
192
193 mcr p15, 0, r4, c3, c0, 0 @ domain ID
194 mcr p15, 0, r5, c2, c0, 0 @ translation table base addr
195 mcr p15, 0, r6, c13, c0, 0 @ PID
196 b resume_turn_on_mmu @ cache align execution
197
198 .align 5
199resume_turn_on_mmu:
200 mcr p15, 0, r7, c1, c0, 0 @ turn on MMU, caches, etc.
201 nop
202 mov pc, r2 @ jump to virtual addr
203 nop
204 nop
205 nop
206
207sleep_save_sp:
208 .word 0 @ preserve stack phys ptr here
209
210 .text
211resume_after_mmu:
212 mcr p15, 0, r1, c15, c1, 2 @ enable clock switching
213 ldmfd sp!, {r4 - r12, pc} @ return to caller
214
215
diff --git a/arch/arm/mach-sa1100/ssp.c b/arch/arm/mach-sa1100/ssp.c
new file mode 100644
index 000000000000..1604dadf27fc
--- /dev/null
+++ b/arch/arm/mach-sa1100/ssp.c
@@ -0,0 +1,214 @@
1/*
2 * linux/arch/arm/mach-sa1100/ssp.c
3 *
4 * Copyright (C) 2003 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Generic SSP driver. This provides the generic core for simple
11 * IO-based SSP applications.
12 */
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/errno.h>
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/init.h>
20
21#include <asm/io.h>
22#include <asm/irq.h>
23#include <asm/hardware.h>
24#include <asm/hardware/ssp.h>
25
26static irqreturn_t ssp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
27{
28 unsigned int status = Ser4SSSR;
29
30 if (status & SSSR_ROR) {
31 printk(KERN_WARNING "SSP: receiver overrun\n");
32 }
33
34 Ser4SSSR = SSSR_ROR;
35
36 return status ? IRQ_HANDLED : IRQ_NONE;
37}
38
39/**
40 * ssp_write_word - write a word to the SSP port
41 * @data: 16-bit, MSB justified data to write.
42 *
43 * Wait for a free entry in the SSP transmit FIFO, and write a data
44 * word to the SSP port. Wait for the SSP port to start sending
45 * the data.
46 *
47 * The caller is expected to perform the necessary locking.
48 *
49 * Returns:
50 * %-ETIMEDOUT timeout occurred (for future)
51 * 0 success
52 */
53int ssp_write_word(u16 data)
54{
55 while (!(Ser4SSSR & SSSR_TNF))
56 cpu_relax();
57
58 Ser4SSDR = data;
59
60 while (!(Ser4SSSR & SSSR_BSY))
61 cpu_relax();
62
63 return 0;
64}
65
66/**
67 * ssp_read_word - read a word from the SSP port
68 *
69 * Wait for a data word in the SSP receive FIFO, and return the
70 * received data. Data is LSB justified.
71 *
72 * Note: Currently, if data is not expected to be received, this
73 * function will wait for ever.
74 *
75 * The caller is expected to perform the necessary locking.
76 *
77 * Returns:
78 * %-ETIMEDOUT timeout occurred (for future)
79 * 16-bit data success
80 */
81int ssp_read_word(void)
82{
83 while (!(Ser4SSSR & SSSR_RNE))
84 cpu_relax();
85
86 return Ser4SSDR;
87}
88
89/**
90 * ssp_flush - flush the transmit and receive FIFOs
91 *
92 * Wait for the SSP to idle, and ensure that the receive FIFO
93 * is empty.
94 *
95 * The caller is expected to perform the necessary locking.
96 */
97void ssp_flush(void)
98{
99 do {
100 while (Ser4SSSR & SSSR_RNE) {
101 (void) Ser4SSDR;
102 }
103 } while (Ser4SSSR & SSSR_BSY);
104}
105
106/**
107 * ssp_enable - enable the SSP port
108 *
109 * Turn on the SSP port.
110 */
111void ssp_enable(void)
112{
113 Ser4SSCR0 |= SSCR0_SSE;
114}
115
116/**
117 * ssp_disable - shut down the SSP port
118 *
119 * Turn off the SSP port, optionally powering it down.
120 */
121void ssp_disable(void)
122{
123 Ser4SSCR0 &= ~SSCR0_SSE;
124}
125
126/**
127 * ssp_save_state - save the SSP configuration
128 * @ssp: pointer to structure to save SSP configuration
129 *
130 * Save the configured SSP state for suspend.
131 */
132void ssp_save_state(struct ssp_state *ssp)
133{
134 ssp->cr0 = Ser4SSCR0;
135 ssp->cr1 = Ser4SSCR1;
136
137 Ser4SSCR0 &= ~SSCR0_SSE;
138}
139
140/**
141 * ssp_restore_state - restore a previously saved SSP configuration
142 * @ssp: pointer to configuration saved by ssp_save_state
143 *
144 * Restore the SSP configuration saved previously by ssp_save_state.
145 */
146void ssp_restore_state(struct ssp_state *ssp)
147{
148 Ser4SSSR = SSSR_ROR;
149
150 Ser4SSCR0 = ssp->cr0 & ~SSCR0_SSE;
151 Ser4SSCR1 = ssp->cr1;
152 Ser4SSCR0 = ssp->cr0;
153}
154
155/**
156 * ssp_init - setup the SSP port
157 *
158 * initialise and claim resources for the SSP port.
159 *
160 * Returns:
161 * %-ENODEV if the SSP port is unavailable
162 * %-EBUSY if the resources are already in use
163 * %0 on success
164 */
165int ssp_init(void)
166{
167 int ret;
168
169 if (!(PPAR & PPAR_SPR) && (Ser4MCCR0 & MCCR0_MCE))
170 return -ENODEV;
171
172 if (!request_mem_region(__PREG(Ser4SSCR0), 0x18, "SSP")) {
173 return -EBUSY;
174 }
175
176 Ser4SSSR = SSSR_ROR;
177
178 ret = request_irq(IRQ_Ser4SSP, ssp_interrupt, 0, "SSP", NULL);
179 if (ret)
180 goto out_region;
181
182 return 0;
183
184 out_region:
185 release_mem_region(__PREG(Ser4SSCR0), 0x18);
186 return ret;
187}
188
189/**
190 * ssp_exit - undo the effects of ssp_init
191 *
192 * release and free resources for the SSP port.
193 */
194void ssp_exit(void)
195{
196 Ser4SSCR0 &= ~SSCR0_SSE;
197
198 free_irq(IRQ_Ser4SSP, NULL);
199 release_mem_region(__PREG(Ser4SSCR0), 0x18);
200}
201
202MODULE_AUTHOR("Russell King");
203MODULE_DESCRIPTION("SA11x0 SSP PIO driver");
204MODULE_LICENSE("GPL");
205
206EXPORT_SYMBOL(ssp_write_word);
207EXPORT_SYMBOL(ssp_read_word);
208EXPORT_SYMBOL(ssp_flush);
209EXPORT_SYMBOL(ssp_enable);
210EXPORT_SYMBOL(ssp_disable);
211EXPORT_SYMBOL(ssp_save_state);
212EXPORT_SYMBOL(ssp_restore_state);
213EXPORT_SYMBOL(ssp_init);
214EXPORT_SYMBOL(ssp_exit);
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
new file mode 100644
index 000000000000..19b0c0fd6377
--- /dev/null
+++ b/arch/arm/mach-sa1100/time.c
@@ -0,0 +1,159 @@
1/*
2 * linux/arch/arm/mach-sa1100/time.c
3 *
4 * Copyright (C) 1998 Deborah Wallach.
5 * Twiddles (C) 1999 Hugo Fiennes <hugo@empeg.com>
6 *
7 * 2000/03/29 (C) Nicolas Pitre <nico@cam.org>
8 * Rewritten: big cleanup, much simpler, better HZ accuracy.
9 *
10 */
11#include <linux/init.h>
12#include <linux/errno.h>
13#include <linux/interrupt.h>
14#include <linux/timex.h>
15#include <linux/signal.h>
16
17#include <asm/mach/time.h>
18#include <asm/hardware.h>
19
20#define RTC_DEF_DIVIDER (32768 - 1)
21#define RTC_DEF_TRIM 0
22
23static unsigned long __init sa1100_get_rtc_time(void)
24{
25 /*
26 * According to the manual we should be able to let RTTR be zero
27 * and then a default diviser for a 32.768KHz clock is used.
28 * Apparently this doesn't work, at least for my SA1110 rev 5.
29 * If the clock divider is uninitialized then reset it to the
30 * default value to get the 1Hz clock.
31 */
32 if (RTTR == 0) {
33 RTTR = RTC_DEF_DIVIDER + (RTC_DEF_TRIM << 16);
34 printk(KERN_WARNING "Warning: uninitialized Real Time Clock\n");
35 /* The current RTC value probably doesn't make sense either */
36 RCNR = 0;
37 return 0;
38 }
39 return RCNR;
40}
41
42static int sa1100_set_rtc(void)
43{
44 unsigned long current_time = xtime.tv_sec;
45
46 if (RTSR & RTSR_ALE) {
47 /* make sure not to forward the clock over an alarm */
48 unsigned long alarm = RTAR;
49 if (current_time >= alarm && alarm >= RCNR)
50 return -ERESTARTSYS;
51 }
52 RCNR = current_time;
53 return 0;
54}
55
56/* IRQs are disabled before entering here from do_gettimeofday() */
57static unsigned long sa1100_gettimeoffset (void)
58{
59 unsigned long ticks_to_match, elapsed, usec;
60
61 /* Get ticks before next timer match */
62 ticks_to_match = OSMR0 - OSCR;
63
64 /* We need elapsed ticks since last match */
65 elapsed = LATCH - ticks_to_match;
66
67 /* Now convert them to usec */
68 usec = (unsigned long)(elapsed * (tick_nsec / 1000))/LATCH;
69
70 return usec;
71}
72
73/*
74 * We will be entered with IRQs enabled.
75 *
76 * Loop until we get ahead of the free running timer.
77 * This ensures an exact clock tick count and time accuracy.
78 * IRQs are disabled inside the loop to ensure coherence between
79 * lost_ticks (updated in do_timer()) and the match reg value, so we
80 * can use do_gettimeofday() from interrupt handlers.
81 */
82static irqreturn_t
83sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
84{
85 unsigned int next_match;
86
87 write_seqlock(&xtime_lock);
88
89 do {
90 timer_tick(regs);
91 OSSR = OSSR_M0; /* Clear match on timer 0 */
92 next_match = (OSMR0 += LATCH);
93 } while ((signed long)(next_match - OSCR) <= 0);
94
95 write_sequnlock(&xtime_lock);
96
97 return IRQ_HANDLED;
98}
99
100static struct irqaction sa1100_timer_irq = {
101 .name = "SA11xx Timer Tick",
102 .flags = SA_INTERRUPT,
103 .handler = sa1100_timer_interrupt
104};
105
106static void __init sa1100_timer_init(void)
107{
108 struct timespec tv;
109
110 set_rtc = sa1100_set_rtc;
111
112 tv.tv_nsec = 0;
113 tv.tv_sec = sa1100_get_rtc_time();
114 do_settimeofday(&tv);
115
116 OSMR0 = 0; /* set initial match at 0 */
117 OSSR = 0xf; /* clear status on all timers */
118 setup_irq(IRQ_OST0, &sa1100_timer_irq);
119 OIER |= OIER_E0; /* enable match on timer 0 to cause interrupts */
120 OSCR = 0; /* initialize free-running timer, force first match */
121}
122
123#ifdef CONFIG_PM
124unsigned long osmr[4], oier;
125
126static void sa1100_timer_suspend(void)
127{
128 osmr[0] = OSMR0;
129 osmr[1] = OSMR1;
130 osmr[2] = OSMR2;
131 osmr[3] = OSMR3;
132 oier = OIER;
133}
134
135static void sa1100_timer_resume(void)
136{
137 OSSR = 0x0f;
138 OSMR0 = osmr[0];
139 OSMR1 = osmr[1];
140 OSMR2 = osmr[2];
141 OSMR3 = osmr[3];
142 OIER = oier;
143
144 /*
145 * OSMR0 is the system timer: make sure OSCR is sufficiently behind
146 */
147 OSCR = OSMR0 - LATCH;
148}
149#else
150#define sa1100_timer_suspend NULL
151#define sa1100_timer_resume NULL
152#endif
153
154struct sys_timer sa1100_timer = {
155 .init = sa1100_timer_init,
156 .suspend = sa1100_timer_suspend,
157 .resume = sa1100_timer_resume,
158 .offset = sa1100_gettimeoffset,
159};
diff --git a/arch/arm/mach-shark/Makefile b/arch/arm/mach-shark/Makefile
new file mode 100644
index 000000000000..45be9b04e7ba
--- /dev/null
+++ b/arch/arm/mach-shark/Makefile
@@ -0,0 +1,12 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := core.o dma.o irq.o pci.o
8obj-m :=
9obj-n :=
10obj- :=
11
12obj-$(CONFIG_LEDS) += leds.o
diff --git a/arch/arm/mach-shark/Makefile.boot b/arch/arm/mach-shark/Makefile.boot
new file mode 100644
index 000000000000..4320f8b92771
--- /dev/null
+++ b/arch/arm/mach-shark/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-y := 0x08008000
2
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
new file mode 100644
index 000000000000..a9bc5d0dbd85
--- /dev/null
+++ b/arch/arm/mach-shark/core.c
@@ -0,0 +1,114 @@
1/*
2 * linux/arch/arm/mach-shark/arch.c
3 *
4 * Architecture specific stuff.
5 */
6#include <linux/kernel.h>
7#include <linux/init.h>
8#include <linux/interrupt.h>
9#include <linux/sched.h>
10#include <linux/serial_8250.h>
11
12#include <asm/setup.h>
13#include <asm/mach-types.h>
14#include <asm/io.h>
15#include <asm/leds.h>
16#include <asm/param.h>
17
18#include <asm/mach/map.h>
19#include <asm/mach/arch.h>
20#include <asm/mach/time.h>
21
22static struct plat_serial8250_port serial_platform_data[] = {
23 {
24 .iobase = 0x3f8,
25 .irq = 4,
26 .uartclk = 1843200,
27 .regshift = 2,
28 .iotype = UPIO_PORT,
29 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
30 },
31 {
32 .iobase = 0x2f8,
33 .irq = 3,
34 .uartclk = 1843200,
35 .regshift = 2,
36 .iotype = UPIO_PORT,
37 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
38 },
39 { },
40};
41
42static struct platform_device serial_device = {
43 .name = "serial8250",
44 .id = 0,
45 .dev = {
46 .platform_data = serial_platform_data,
47 },
48};
49
50static int __init shark_init(void)
51{
52 int ret;
53
54 if (machine_is_shark())
55 ret = platform_device_register(&serial_device);
56
57 return ret;
58}
59
60arch_initcall(shark_init);
61
62extern void shark_init_irq(void);
63
64static struct map_desc shark_io_desc[] __initdata = {
65 { IO_BASE , IO_START , IO_SIZE , MT_DEVICE }
66};
67
68static void __init shark_map_io(void)
69{
70 iotable_init(shark_io_desc, ARRAY_SIZE(shark_io_desc));
71}
72
73#define IRQ_TIMER 0
74#define HZ_TIME ((1193180 + HZ/2) / HZ)
75
76static irqreturn_t
77shark_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
78{
79 write_seqlock(&xtime_lock);
80 timer_tick(regs);
81 write_sequnlock(&xtime_lock);
82 return IRQ_HANDLED;
83}
84
85static struct irqaction shark_timer_irq = {
86 .name = "Shark Timer Tick",
87 .flags = SA_INTERRUPT,
88 .handler = shark_timer_interrupt
89};
90
91/*
92 * Set up timer interrupt, and return the current time in seconds.
93 */
94static void __init shark_timer_init(void)
95{
96 outb(0x34, 0x43); /* binary, mode 0, LSB/MSB, Ch 0 */
97 outb(HZ_TIME & 0xff, 0x40); /* LSB of count */
98 outb(HZ_TIME >> 8, 0x40);
99
100 setup_irq(IRQ_TIMER, &shark_timer_irq);
101}
102
103static struct sys_timer shark_timer = {
104 .init = shark_timer_init,
105};
106
107MACHINE_START(SHARK, "Shark")
108 MAINTAINER("Alexander Schulz")
109 BOOT_MEM(0x08000000, 0x40000000, 0xe0000000)
110 BOOT_PARAMS(0x08003000)
111 MAPIO(shark_map_io)
112 INITIRQ(shark_init_irq)
113 .timer = &shark_timer,
114MACHINE_END
diff --git a/arch/arm/mach-shark/dma.c b/arch/arm/mach-shark/dma.c
new file mode 100644
index 000000000000..835989a02918
--- /dev/null
+++ b/arch/arm/mach-shark/dma.c
@@ -0,0 +1,22 @@
1/*
2 * linux/arch/arm/mach-shark/dma.c
3 *
4 * by Alexander Schulz
5 *
6 * derived from:
7 * arch/arm/kernel/dma-ebsa285.c
8 * Copyright (C) 1998 Phil Blundell
9 */
10
11#include <linux/config.h>
12#include <linux/init.h>
13
14#include <asm/dma.h>
15#include <asm/mach/dma.h>
16
17void __init arch_dma_init(dma_t *dma)
18{
19#ifdef CONFIG_ISA_DMA
20 isa_init_dma(dma);
21#endif
22}
diff --git a/arch/arm/mach-shark/irq.c b/arch/arm/mach-shark/irq.c
new file mode 100644
index 000000000000..6cb67bd3dfd3
--- /dev/null
+++ b/arch/arm/mach-shark/irq.c
@@ -0,0 +1,109 @@
1/*
2 * linux/arch/arm/mach-shark/irq.c
3 *
4 * by Alexander Schulz
5 *
6 * derived from linux/arch/ppc/kernel/i8259.c and:
7 * include/asm-arm/arch-ebsa110/irq.h
8 * Copyright (C) 1996-1998 Russell King
9 */
10
11#include <linux/init.h>
12#include <linux/fs.h>
13#include <linux/ptrace.h>
14#include <linux/interrupt.h>
15
16#include <asm/irq.h>
17#include <asm/io.h>
18#include <asm/mach/irq.h>
19
20/*
21 * 8259A PIC functions to handle ISA devices:
22 */
23
24/*
25 * This contains the irq mask for both 8259A irq controllers,
26 * Let through the cascade-interrupt no. 2 (ff-(1<<2)==fb)
27 */
28static unsigned char cached_irq_mask[2] = { 0xfb, 0xff };
29
30/*
31 * These have to be protected by the irq controller spinlock
32 * before being called.
33 */
34static void shark_disable_8259A_irq(unsigned int irq)
35{
36 unsigned int mask;
37 if (irq<8) {
38 mask = 1 << irq;
39 cached_irq_mask[0] |= mask;
40 outb(cached_irq_mask[1],0xA1);
41 } else {
42 mask = 1 << (irq-8);
43 cached_irq_mask[1] |= mask;
44 outb(cached_irq_mask[0],0x21);
45 }
46}
47
48static void shark_enable_8259A_irq(unsigned int irq)
49{
50 unsigned int mask;
51 if (irq<8) {
52 mask = ~(1 << irq);
53 cached_irq_mask[0] &= mask;
54 outb(cached_irq_mask[0],0x21);
55 } else {
56 mask = ~(1 << (irq-8));
57 cached_irq_mask[1] &= mask;
58 outb(cached_irq_mask[1],0xA1);
59 }
60}
61
62static void shark_ack_8259A_irq(unsigned int irq){}
63
64static irqreturn_t bogus_int(int irq, void *dev_id, struct pt_regs *regs)
65{
66 printk("Got interrupt %i!\n",irq);
67 return IRQ_NONE;
68}
69
70static struct irqaction cascade;
71
72static struct irqchip fb_chip = {
73 .ack = shark_ack_8259A_irq,
74 .mask = shark_disable_8259A_irq,
75 .unmask = shark_enable_8259A_irq,
76};
77
78void __init shark_init_irq(void)
79{
80 int irq;
81
82 for (irq = 0; irq < NR_IRQS; irq++) {
83 set_irq_chip(irq, &fb_chip);
84 set_irq_handler(irq, do_edge_IRQ);
85 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
86 }
87
88 /* init master interrupt controller */
89 outb(0x11, 0x20); /* Start init sequence, edge triggered (level: 0x19)*/
90 outb(0x00, 0x21); /* Vector base */
91 outb(0x04, 0x21); /* Cascade (slave) on IRQ2 */
92 outb(0x03, 0x21); /* Select 8086 mode , auto eoi*/
93 outb(0x0A, 0x20);
94 /* init slave interrupt controller */
95 outb(0x11, 0xA0); /* Start init sequence, edge triggered */
96 outb(0x08, 0xA1); /* Vector base */
97 outb(0x02, 0xA1); /* Cascade (slave) on IRQ2 */
98 outb(0x03, 0xA1); /* Select 8086 mode, auto eoi */
99 outb(0x0A, 0xA0);
100 outb(cached_irq_mask[1],0xA1);
101 outb(cached_irq_mask[0],0x21);
102 //request_region(0x20,0x2,"pic1");
103 //request_region(0xA0,0x2,"pic2");
104
105 cascade.handler = bogus_int;
106 cascade.name = "cascade";
107 setup_irq(2,&cascade);
108}
109
diff --git a/arch/arm/mach-shark/leds.c b/arch/arm/mach-shark/leds.c
new file mode 100644
index 000000000000..7bdeb70a0c10
--- /dev/null
+++ b/arch/arm/mach-shark/leds.c
@@ -0,0 +1,163 @@
1/*
2 * arch/arm/kernel/leds-shark.c
3 * by Alexander Schulz
4 *
5 * derived from:
6 * arch/arm/kernel/leds-footbridge.c
7 * Copyright (C) 1998-1999 Russell King
8 *
9 * DIGITAL Shark LED control routines.
10 *
11 * The leds use is as follows:
12 * - Green front - toggles state every 50 timer interrupts
13 * - Amber front - Unused, this is a dual color led (Amber/Green)
14 * - Amber back - On if system is not idle
15 *
16 * Changelog:
17 */
18#include <linux/config.h>
19#include <linux/kernel.h>
20#include <linux/module.h>
21#include <linux/init.h>
22#include <linux/spinlock.h>
23#include <linux/ioport.h>
24
25#include <asm/hardware.h>
26#include <asm/leds.h>
27#include <asm/io.h>
28#include <asm/system.h>
29
30#define LED_STATE_ENABLED 1
31#define LED_STATE_CLAIMED 2
32static char led_state;
33static short hw_led_state;
34static short saved_state;
35
36static DEFINE_SPINLOCK(leds_lock);
37
38short sequoia_read(int addr) {
39 outw(addr,0x24);
40 return inw(0x26);
41}
42
43void sequoia_write(short value,short addr) {
44 outw(addr,0x24);
45 outw(value,0x26);
46}
47
48static void sequoia_leds_event(led_event_t evt)
49{
50 unsigned long flags;
51
52 spin_lock_irqsave(&leds_lock, flags);
53
54 hw_led_state = sequoia_read(0x09);
55
56 switch (evt) {
57 case led_start:
58 hw_led_state |= SEQUOIA_LED_GREEN;
59 hw_led_state |= SEQUOIA_LED_AMBER;
60#ifdef CONFIG_LEDS_CPU
61 hw_led_state |= SEQUOIA_LED_BACK;
62#else
63 hw_led_state &= ~SEQUOIA_LED_BACK;
64#endif
65 led_state |= LED_STATE_ENABLED;
66 break;
67
68 case led_stop:
69 hw_led_state &= ~SEQUOIA_LED_BACK;
70 hw_led_state |= SEQUOIA_LED_GREEN;
71 hw_led_state |= SEQUOIA_LED_AMBER;
72 led_state &= ~LED_STATE_ENABLED;
73 break;
74
75 case led_claim:
76 led_state |= LED_STATE_CLAIMED;
77 saved_state = hw_led_state;
78 hw_led_state &= ~SEQUOIA_LED_BACK;
79 hw_led_state |= SEQUOIA_LED_GREEN;
80 hw_led_state |= SEQUOIA_LED_AMBER;
81 break;
82
83 case led_release:
84 led_state &= ~LED_STATE_CLAIMED;
85 hw_led_state = saved_state;
86 break;
87
88#ifdef CONFIG_LEDS_TIMER
89 case led_timer:
90 if (!(led_state & LED_STATE_CLAIMED))
91 hw_led_state ^= SEQUOIA_LED_GREEN;
92 break;
93#endif
94
95#ifdef CONFIG_LEDS_CPU
96 case led_idle_start:
97 if (!(led_state & LED_STATE_CLAIMED))
98 hw_led_state &= ~SEQUOIA_LED_BACK;
99 break;
100
101 case led_idle_end:
102 if (!(led_state & LED_STATE_CLAIMED))
103 hw_led_state |= SEQUOIA_LED_BACK;
104 break;
105#endif
106
107 case led_green_on:
108 if (led_state & LED_STATE_CLAIMED)
109 hw_led_state &= ~SEQUOIA_LED_GREEN;
110 break;
111
112 case led_green_off:
113 if (led_state & LED_STATE_CLAIMED)
114 hw_led_state |= SEQUOIA_LED_GREEN;
115 break;
116
117 case led_amber_on:
118 if (led_state & LED_STATE_CLAIMED)
119 hw_led_state &= ~SEQUOIA_LED_AMBER;
120 break;
121
122 case led_amber_off:
123 if (led_state & LED_STATE_CLAIMED)
124 hw_led_state |= SEQUOIA_LED_AMBER;
125 break;
126
127 case led_red_on:
128 if (led_state & LED_STATE_CLAIMED)
129 hw_led_state |= SEQUOIA_LED_BACK;
130 break;
131
132 case led_red_off:
133 if (led_state & LED_STATE_CLAIMED)
134 hw_led_state &= ~SEQUOIA_LED_BACK;
135 break;
136
137 default:
138 break;
139 }
140
141 if (led_state & LED_STATE_ENABLED)
142 sequoia_write(hw_led_state,0x09);
143
144 spin_unlock_irqrestore(&leds_lock, flags);
145}
146
147static int __init leds_init(void)
148{
149 extern void (*leds_event)(led_event_t);
150 short temp;
151
152 leds_event = sequoia_leds_event;
153
154 /* Make LEDs independent of power-state */
155 request_region(0x24,4,"sequoia");
156 temp = sequoia_read(0x09);
157 temp |= 1<<10;
158 sequoia_write(temp,0x09);
159 leds_event(led_start);
160 return 0;
161}
162
163__initcall(leds_init);
diff --git a/arch/arm/mach-shark/pci.c b/arch/arm/mach-shark/pci.c
new file mode 100644
index 000000000000..37a7112d4117
--- /dev/null
+++ b/arch/arm/mach-shark/pci.c
@@ -0,0 +1,42 @@
1/*
2 * linux/arch/arm/mach-shark/pci.c
3 *
4 * PCI bios-type initialisation for PCI machines
5 *
6 * Bits taken from various places.
7 */
8#include <linux/kernel.h>
9#include <linux/pci.h>
10#include <linux/init.h>
11
12#include <asm/irq.h>
13#include <asm/mach/pci.h>
14#include <asm/mach-types.h>
15
16static int __init shark_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
17{
18 if (dev->bus->number == 0)
19 if (dev->devfn == 0) return 255;
20 else return 11;
21 else return 255;
22}
23
24extern void __init via82c505_preinit(void);
25
26static struct hw_pci shark_pci __initdata = {
27 .setup = via82c505_setup,
28 .swizzle = pci_std_swizzle,
29 .map_irq = shark_map_irq,
30 .nr_controllers = 1,
31 .scan = via82c505_scan_bus,
32 .preinit = via82c505_preinit,
33};
34
35static int __init shark_pci_init(void)
36{
37 if (machine_is_shark())
38 pci_common_init(&shark_pci);
39 return 0;
40}
41
42subsys_initcall(shark_pci_init);
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
new file mode 100644
index 000000000000..8d787f4c78e6
--- /dev/null
+++ b/arch/arm/mach-versatile/Kconfig
@@ -0,0 +1,16 @@
1menu "Versatile platform type"
2 depends on ARCH_VERSATILE
3
4config ARCH_VERSATILE_PB
5 bool "Support Versatile/PB platform"
6 default y
7 help
8 Include support for the ARM(R) Versatile/PB platform.
9
10config MACH_VERSATILE_AB
11 bool "Support Versatile/AB platform"
12 default n
13 help
14 Include support for the ARM(R) Versatile/AP platform.
15
16endmenu
diff --git a/arch/arm/mach-versatile/Makefile b/arch/arm/mach-versatile/Makefile
new file mode 100644
index 000000000000..5d608837757a
--- /dev/null
+++ b/arch/arm/mach-versatile/Makefile
@@ -0,0 +1,7 @@
1#
2# Makefile for the linux kernel.
3#
4
5obj-y := core.o clock.o
6obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o
7obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o
diff --git a/arch/arm/mach-versatile/Makefile.boot b/arch/arm/mach-versatile/Makefile.boot
new file mode 100644
index 000000000000..c7e75acfe6c9
--- /dev/null
+++ b/arch/arm/mach-versatile/Makefile.boot
@@ -0,0 +1,4 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000
4
diff --git a/arch/arm/mach-versatile/clock.c b/arch/arm/mach-versatile/clock.c
new file mode 100644
index 000000000000..48025c2b9987
--- /dev/null
+++ b/arch/arm/mach-versatile/clock.c
@@ -0,0 +1,145 @@
1/*
2 * linux/arch/arm/mach-versatile/clock.c
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/list.h>
14#include <linux/errno.h>
15#include <linux/err.h>
16
17#include <asm/semaphore.h>
18#include <asm/hardware/clock.h>
19#include <asm/hardware/icst307.h>
20
21#include "clock.h"
22
23static LIST_HEAD(clocks);
24static DECLARE_MUTEX(clocks_sem);
25
26struct clk *clk_get(struct device *dev, const char *id)
27{
28 struct clk *p, *clk = ERR_PTR(-ENOENT);
29
30 down(&clocks_sem);
31 list_for_each_entry(p, &clocks, node) {
32 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
33 clk = p;
34 break;
35 }
36 }
37 up(&clocks_sem);
38
39 return clk;
40}
41EXPORT_SYMBOL(clk_get);
42
43void clk_put(struct clk *clk)
44{
45 module_put(clk->owner);
46}
47EXPORT_SYMBOL(clk_put);
48
49int clk_enable(struct clk *clk)
50{
51 return 0;
52}
53EXPORT_SYMBOL(clk_enable);
54
55void clk_disable(struct clk *clk)
56{
57}
58EXPORT_SYMBOL(clk_disable);
59
60int clk_use(struct clk *clk)
61{
62 return 0;
63}
64EXPORT_SYMBOL(clk_use);
65
66void clk_unuse(struct clk *clk)
67{
68}
69EXPORT_SYMBOL(clk_unuse);
70
71unsigned long clk_get_rate(struct clk *clk)
72{
73 return clk->rate;
74}
75EXPORT_SYMBOL(clk_get_rate);
76
77long clk_round_rate(struct clk *clk, unsigned long rate)
78{
79 return rate;
80}
81EXPORT_SYMBOL(clk_round_rate);
82
83int clk_set_rate(struct clk *clk, unsigned long rate)
84{
85 int ret = -EIO;
86
87 if (clk->setvco) {
88 struct icst307_vco vco;
89
90 vco = icst307_khz_to_vco(clk->params, rate / 1000);
91 clk->rate = icst307_khz(clk->params, vco) * 1000;
92
93 printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n",
94 clk->name, vco.s, vco.r, vco.v);
95
96 clk->setvco(clk, vco);
97 ret = 0;
98 }
99 return ret;
100}
101EXPORT_SYMBOL(clk_set_rate);
102
103/*
104 * These are fixed clocks.
105 */
106static struct clk kmi_clk = {
107 .name = "KMIREFCLK",
108 .rate = 24000000,
109};
110
111static struct clk uart_clk = {
112 .name = "UARTCLK",
113 .rate = 24000000,
114};
115
116static struct clk mmci_clk = {
117 .name = "MCLK",
118 .rate = 33000000,
119};
120
121int clk_register(struct clk *clk)
122{
123 down(&clocks_sem);
124 list_add(&clk->node, &clocks);
125 up(&clocks_sem);
126 return 0;
127}
128EXPORT_SYMBOL(clk_register);
129
130void clk_unregister(struct clk *clk)
131{
132 down(&clocks_sem);
133 list_del(&clk->node);
134 up(&clocks_sem);
135}
136EXPORT_SYMBOL(clk_unregister);
137
138static int __init clk_init(void)
139{
140 clk_register(&kmi_clk);
141 clk_register(&uart_clk);
142 clk_register(&mmci_clk);
143 return 0;
144}
145arch_initcall(clk_init);
diff --git a/arch/arm/mach-versatile/clock.h b/arch/arm/mach-versatile/clock.h
new file mode 100644
index 000000000000..8b0b61dd17e4
--- /dev/null
+++ b/arch/arm/mach-versatile/clock.h
@@ -0,0 +1,25 @@
1/*
2 * linux/arch/arm/mach-versatile/clock.h
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11struct module;
12struct icst307_params;
13
14struct clk {
15 struct list_head node;
16 unsigned long rate;
17 struct module *owner;
18 const char *name;
19 const struct icst307_params *params;
20 void *data;
21 void (*setvco)(struct clk *, struct icst307_vco vco);
22};
23
24int clk_register(struct clk *clk);
25void clk_unregister(struct clk *clk);
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
new file mode 100644
index 000000000000..554e1bd30d6e
--- /dev/null
+++ b/arch/arm/mach-versatile/core.c
@@ -0,0 +1,918 @@
1/*
2 * linux/arch/arm/mach-versatile/core.c
3 *
4 * Copyright (C) 1999 - 2003 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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#include <linux/config.h>
22#include <linux/init.h>
23#include <linux/device.h>
24#include <linux/dma-mapping.h>
25#include <linux/sysdev.h>
26#include <linux/interrupt.h>
27
28#include <asm/system.h>
29#include <asm/hardware.h>
30#include <asm/io.h>
31#include <asm/irq.h>
32#include <asm/leds.h>
33#include <asm/mach-types.h>
34#include <asm/hardware/amba.h>
35#include <asm/hardware/amba_clcd.h>
36#include <asm/hardware/icst307.h>
37
38#include <asm/mach/arch.h>
39#include <asm/mach/flash.h>
40#include <asm/mach/irq.h>
41#include <asm/mach/time.h>
42#include <asm/mach/map.h>
43#include <asm/mach/mmc.h>
44
45#include "core.h"
46#include "clock.h"
47
48/*
49 * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx
50 * is the (PA >> 12).
51 *
52 * Setup a VA for the Versatile Vectored Interrupt Controller.
53 */
54#define VA_VIC_BASE IO_ADDRESS(VERSATILE_VIC_BASE)
55#define VA_SIC_BASE IO_ADDRESS(VERSATILE_SIC_BASE)
56
57static void vic_mask_irq(unsigned int irq)
58{
59 irq -= IRQ_VIC_START;
60 writel(1 << irq, VA_VIC_BASE + VIC_IRQ_ENABLE_CLEAR);
61}
62
63static void vic_unmask_irq(unsigned int irq)
64{
65 irq -= IRQ_VIC_START;
66 writel(1 << irq, VA_VIC_BASE + VIC_IRQ_ENABLE);
67}
68
69static struct irqchip vic_chip = {
70 .ack = vic_mask_irq,
71 .mask = vic_mask_irq,
72 .unmask = vic_unmask_irq,
73};
74
75static void sic_mask_irq(unsigned int irq)
76{
77 irq -= IRQ_SIC_START;
78 writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR);
79}
80
81static void sic_unmask_irq(unsigned int irq)
82{
83 irq -= IRQ_SIC_START;
84 writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_SET);
85}
86
87static struct irqchip sic_chip = {
88 .ack = sic_mask_irq,
89 .mask = sic_mask_irq,
90 .unmask = sic_unmask_irq,
91};
92
93static void
94sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
95{
96 unsigned long status = readl(VA_SIC_BASE + SIC_IRQ_STATUS);
97
98 if (status == 0) {
99 do_bad_IRQ(irq, desc, regs);
100 return;
101 }
102
103 do {
104 irq = ffs(status) - 1;
105 status &= ~(1 << irq);
106
107 irq += IRQ_SIC_START;
108
109 desc = irq_desc + irq;
110 desc->handle(irq, desc, regs);
111 } while (status);
112}
113
114#if 1
115#define IRQ_MMCI0A IRQ_VICSOURCE22
116#define IRQ_AACI IRQ_VICSOURCE24
117#define IRQ_ETH IRQ_VICSOURCE25
118#define PIC_MASK 0xFFD00000
119#else
120#define IRQ_MMCI0A IRQ_SIC_MMCI0A
121#define IRQ_AACI IRQ_SIC_AACI
122#define IRQ_ETH IRQ_SIC_ETH
123#define PIC_MASK 0
124#endif
125
126void __init versatile_init_irq(void)
127{
128 unsigned int i, value;
129
130 /* Disable all interrupts initially. */
131
132 writel(0, VA_VIC_BASE + VIC_INT_SELECT);
133 writel(0, VA_VIC_BASE + VIC_IRQ_ENABLE);
134 writel(~0, VA_VIC_BASE + VIC_IRQ_ENABLE_CLEAR);
135 writel(0, VA_VIC_BASE + VIC_IRQ_STATUS);
136 writel(0, VA_VIC_BASE + VIC_ITCR);
137 writel(~0, VA_VIC_BASE + VIC_IRQ_SOFT_CLEAR);
138
139 /*
140 * Make sure we clear all existing interrupts
141 */
142 writel(0, VA_VIC_BASE + VIC_VECT_ADDR);
143 for (i = 0; i < 19; i++) {
144 value = readl(VA_VIC_BASE + VIC_VECT_ADDR);
145 writel(value, VA_VIC_BASE + VIC_VECT_ADDR);
146 }
147
148 for (i = 0; i < 16; i++) {
149 value = readl(VA_VIC_BASE + VIC_VECT_CNTL0 + (i * 4));
150 writel(value | VICVectCntl_Enable | i, VA_VIC_BASE + VIC_VECT_CNTL0 + (i * 4));
151 }
152
153 writel(32, VA_VIC_BASE + VIC_DEF_VECT_ADDR);
154
155 for (i = IRQ_VIC_START; i <= IRQ_VIC_END; i++) {
156 if (i != IRQ_VICSOURCE31) {
157 set_irq_chip(i, &vic_chip);
158 set_irq_handler(i, do_level_IRQ);
159 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
160 }
161 }
162
163 set_irq_handler(IRQ_VICSOURCE31, sic_handle_irq);
164 vic_unmask_irq(IRQ_VICSOURCE31);
165
166 /* Do second interrupt controller */
167 writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR);
168
169 for (i = IRQ_SIC_START; i <= IRQ_SIC_END; i++) {
170 if ((PIC_MASK & (1 << (i - IRQ_SIC_START))) == 0) {
171 set_irq_chip(i, &sic_chip);
172 set_irq_handler(i, do_level_IRQ);
173 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
174 }
175 }
176
177 /*
178 * Interrupts on secondary controller from 0 to 8 are routed to
179 * source 31 on PIC.
180 * Interrupts from 21 to 31 are routed directly to the VIC on
181 * the corresponding number on primary controller. This is controlled
182 * by setting PIC_ENABLEx.
183 */
184 writel(PIC_MASK, VA_SIC_BASE + SIC_INT_PIC_ENABLE);
185}
186
187static struct map_desc versatile_io_desc[] __initdata = {
188 { IO_ADDRESS(VERSATILE_SYS_BASE), VERSATILE_SYS_BASE, SZ_4K, MT_DEVICE },
189 { IO_ADDRESS(VERSATILE_SIC_BASE), VERSATILE_SIC_BASE, SZ_4K, MT_DEVICE },
190 { IO_ADDRESS(VERSATILE_VIC_BASE), VERSATILE_VIC_BASE, SZ_4K, MT_DEVICE },
191 { IO_ADDRESS(VERSATILE_SCTL_BASE), VERSATILE_SCTL_BASE, SZ_4K * 9, MT_DEVICE },
192#ifdef CONFIG_MACH_VERSATILE_AB
193 { IO_ADDRESS(VERSATILE_GPIO0_BASE), VERSATILE_GPIO0_BASE, SZ_4K, MT_DEVICE },
194 { IO_ADDRESS(VERSATILE_IB2_BASE), VERSATILE_IB2_BASE, SZ_64M, MT_DEVICE },
195#endif
196#ifdef CONFIG_DEBUG_LL
197 { IO_ADDRESS(VERSATILE_UART0_BASE), VERSATILE_UART0_BASE, SZ_4K, MT_DEVICE },
198#endif
199#ifdef FIXME
200 { PCI_MEMORY_VADDR, PHYS_PCI_MEM_BASE, SZ_16M, MT_DEVICE },
201 { PCI_CONFIG_VADDR, PHYS_PCI_CONFIG_BASE, SZ_16M, MT_DEVICE },
202 { PCI_V3_VADDR, PHYS_PCI_V3_BASE, SZ_512K, MT_DEVICE },
203 { PCI_IO_VADDR, PHYS_PCI_IO_BASE, SZ_64K, MT_DEVICE },
204#endif
205};
206
207void __init versatile_map_io(void)
208{
209 iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc));
210}
211
212#define VERSATILE_REFCOUNTER (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET)
213
214/*
215 * This is the Versatile sched_clock implementation. This has
216 * a resolution of 41.7ns, and a maximum value of about 179s.
217 */
218unsigned long long sched_clock(void)
219{
220 unsigned long long v;
221
222 v = (unsigned long long)readl(VERSATILE_REFCOUNTER) * 125;
223 do_div(v, 3);
224
225 return v;
226}
227
228
229#define VERSATILE_FLASHCTRL (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET)
230
231static int versatile_flash_init(void)
232{
233 u32 val;
234
235 val = __raw_readl(VERSATILE_FLASHCTRL);
236 val &= ~VERSATILE_FLASHPROG_FLVPPEN;
237 __raw_writel(val, VERSATILE_FLASHCTRL);
238
239 return 0;
240}
241
242static void versatile_flash_exit(void)
243{
244 u32 val;
245
246 val = __raw_readl(VERSATILE_FLASHCTRL);
247 val &= ~VERSATILE_FLASHPROG_FLVPPEN;
248 __raw_writel(val, VERSATILE_FLASHCTRL);
249}
250
251static void versatile_flash_set_vpp(int on)
252{
253 u32 val;
254
255 val = __raw_readl(VERSATILE_FLASHCTRL);
256 if (on)
257 val |= VERSATILE_FLASHPROG_FLVPPEN;
258 else
259 val &= ~VERSATILE_FLASHPROG_FLVPPEN;
260 __raw_writel(val, VERSATILE_FLASHCTRL);
261}
262
263static struct flash_platform_data versatile_flash_data = {
264 .map_name = "cfi_probe",
265 .width = 4,
266 .init = versatile_flash_init,
267 .exit = versatile_flash_exit,
268 .set_vpp = versatile_flash_set_vpp,
269};
270
271static struct resource versatile_flash_resource = {
272 .start = VERSATILE_FLASH_BASE,
273 .end = VERSATILE_FLASH_BASE + VERSATILE_FLASH_SIZE,
274 .flags = IORESOURCE_MEM,
275};
276
277static struct platform_device versatile_flash_device = {
278 .name = "armflash",
279 .id = 0,
280 .dev = {
281 .platform_data = &versatile_flash_data,
282 },
283 .num_resources = 1,
284 .resource = &versatile_flash_resource,
285};
286
287static struct resource smc91x_resources[] = {
288 [0] = {
289 .start = VERSATILE_ETH_BASE,
290 .end = VERSATILE_ETH_BASE + SZ_64K - 1,
291 .flags = IORESOURCE_MEM,
292 },
293 [1] = {
294 .start = IRQ_ETH,
295 .end = IRQ_ETH,
296 .flags = IORESOURCE_IRQ,
297 },
298};
299
300static struct platform_device smc91x_device = {
301 .name = "smc91x",
302 .id = 0,
303 .num_resources = ARRAY_SIZE(smc91x_resources),
304 .resource = smc91x_resources,
305};
306
307#define VERSATILE_SYSMCI (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_MCI_OFFSET)
308
309unsigned int mmc_status(struct device *dev)
310{
311 struct amba_device *adev = container_of(dev, struct amba_device, dev);
312 u32 mask;
313
314 if (adev->res.start == VERSATILE_MMCI0_BASE)
315 mask = 1;
316 else
317 mask = 2;
318
319 return readl(VERSATILE_SYSMCI) & mask;
320}
321
322static struct mmc_platform_data mmc0_plat_data = {
323 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
324 .status = mmc_status,
325};
326
327/*
328 * Clock handling
329 */
330static const struct icst307_params versatile_oscvco_params = {
331 .ref = 24000,
332 .vco_max = 200000,
333 .vd_min = 4 + 8,
334 .vd_max = 511 + 8,
335 .rd_min = 1 + 2,
336 .rd_max = 127 + 2,
337};
338
339static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco)
340{
341 unsigned long sys_lock = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET;
342#if defined(CONFIG_ARCH_VERSATILE_PB)
343 unsigned long sys_osc = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC4_OFFSET;
344#elif defined(CONFIG_MACH_VERSATILE_AB)
345 unsigned long sys_osc = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC1_OFFSET;
346#endif
347 u32 val;
348
349 val = readl(sys_osc) & ~0x7ffff;
350 val |= vco.v | (vco.r << 9) | (vco.s << 16);
351
352 writel(0xa05f, sys_lock);
353 writel(val, sys_osc);
354 writel(0, sys_lock);
355}
356
357static struct clk versatile_clcd_clk = {
358 .name = "CLCDCLK",
359 .params = &versatile_oscvco_params,
360 .setvco = versatile_oscvco_set,
361};
362
363/*
364 * CLCD support.
365 */
366#define SYS_CLCD_MODE_MASK (3 << 0)
367#define SYS_CLCD_MODE_888 (0 << 0)
368#define SYS_CLCD_MODE_5551 (1 << 0)
369#define SYS_CLCD_MODE_565_RLSB (2 << 0)
370#define SYS_CLCD_MODE_565_BLSB (3 << 0)
371#define SYS_CLCD_NLCDIOON (1 << 2)
372#define SYS_CLCD_VDDPOSSWITCH (1 << 3)
373#define SYS_CLCD_PWR3V5SWITCH (1 << 4)
374#define SYS_CLCD_ID_MASK (0x1f << 8)
375#define SYS_CLCD_ID_SANYO_3_8 (0x00 << 8)
376#define SYS_CLCD_ID_UNKNOWN_8_4 (0x01 << 8)
377#define SYS_CLCD_ID_EPSON_2_2 (0x02 << 8)
378#define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8)
379#define SYS_CLCD_ID_VGA (0x1f << 8)
380
381static struct clcd_panel vga = {
382 .mode = {
383 .name = "VGA",
384 .refresh = 60,
385 .xres = 640,
386 .yres = 480,
387 .pixclock = 39721,
388 .left_margin = 40,
389 .right_margin = 24,
390 .upper_margin = 32,
391 .lower_margin = 11,
392 .hsync_len = 96,
393 .vsync_len = 2,
394 .sync = 0,
395 .vmode = FB_VMODE_NONINTERLACED,
396 },
397 .width = -1,
398 .height = -1,
399 .tim2 = TIM2_BCD | TIM2_IPC,
400 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
401 .bpp = 16,
402};
403
404static struct clcd_panel sanyo_3_8_in = {
405 .mode = {
406 .name = "Sanyo QVGA",
407 .refresh = 116,
408 .xres = 320,
409 .yres = 240,
410 .pixclock = 100000,
411 .left_margin = 6,
412 .right_margin = 6,
413 .upper_margin = 5,
414 .lower_margin = 5,
415 .hsync_len = 6,
416 .vsync_len = 6,
417 .sync = 0,
418 .vmode = FB_VMODE_NONINTERLACED,
419 },
420 .width = -1,
421 .height = -1,
422 .tim2 = TIM2_BCD,
423 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
424 .bpp = 16,
425};
426
427static struct clcd_panel sanyo_2_5_in = {
428 .mode = {
429 .name = "Sanyo QVGA Portrait",
430 .refresh = 116,
431 .xres = 240,
432 .yres = 320,
433 .pixclock = 100000,
434 .left_margin = 20,
435 .right_margin = 10,
436 .upper_margin = 2,
437 .lower_margin = 2,
438 .hsync_len = 10,
439 .vsync_len = 2,
440 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
441 .vmode = FB_VMODE_NONINTERLACED,
442 },
443 .width = -1,
444 .height = -1,
445 .tim2 = TIM2_IVS | TIM2_IHS | TIM2_IPC,
446 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
447 .bpp = 16,
448};
449
450static struct clcd_panel epson_2_2_in = {
451 .mode = {
452 .name = "Epson QCIF",
453 .refresh = 390,
454 .xres = 176,
455 .yres = 220,
456 .pixclock = 62500,
457 .left_margin = 3,
458 .right_margin = 2,
459 .upper_margin = 1,
460 .lower_margin = 0,
461 .hsync_len = 3,
462 .vsync_len = 2,
463 .sync = 0,
464 .vmode = FB_VMODE_NONINTERLACED,
465 },
466 .width = -1,
467 .height = -1,
468 .tim2 = TIM2_BCD | TIM2_IPC,
469 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
470 .bpp = 16,
471};
472
473/*
474 * Detect which LCD panel is connected, and return the appropriate
475 * clcd_panel structure. Note: we do not have any information on
476 * the required timings for the 8.4in panel, so we presently assume
477 * VGA timings.
478 */
479static struct clcd_panel *versatile_clcd_panel(void)
480{
481 unsigned long sys_clcd = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET;
482 struct clcd_panel *panel = &vga;
483 u32 val;
484
485 val = readl(sys_clcd) & SYS_CLCD_ID_MASK;
486 if (val == SYS_CLCD_ID_SANYO_3_8)
487 panel = &sanyo_3_8_in;
488 else if (val == SYS_CLCD_ID_SANYO_2_5)
489 panel = &sanyo_2_5_in;
490 else if (val == SYS_CLCD_ID_EPSON_2_2)
491 panel = &epson_2_2_in;
492 else if (val == SYS_CLCD_ID_VGA)
493 panel = &vga;
494 else {
495 printk(KERN_ERR "CLCD: unknown LCD panel ID 0x%08x, using VGA\n",
496 val);
497 panel = &vga;
498 }
499
500 return panel;
501}
502
503/*
504 * Disable all display connectors on the interface module.
505 */
506static void versatile_clcd_disable(struct clcd_fb *fb)
507{
508 unsigned long sys_clcd = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET;
509 u32 val;
510
511 val = readl(sys_clcd);
512 val &= ~SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
513 writel(val, sys_clcd);
514
515#ifdef CONFIG_MACH_VERSATILE_AB
516 /*
517 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off
518 */
519 if (fb->panel == &sanyo_2_5_in) {
520 unsigned long versatile_ib2_ctrl = IO_ADDRESS(VERSATILE_IB2_CTRL);
521 unsigned long ctrl;
522
523 ctrl = readl(versatile_ib2_ctrl);
524 ctrl &= ~0x01;
525 writel(ctrl, versatile_ib2_ctrl);
526 }
527#endif
528}
529
530/*
531 * Enable the relevant connector on the interface module.
532 */
533static void versatile_clcd_enable(struct clcd_fb *fb)
534{
535 unsigned long sys_clcd = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET;
536 u32 val;
537
538 val = readl(sys_clcd);
539 val &= ~SYS_CLCD_MODE_MASK;
540
541 switch (fb->fb.var.green.length) {
542 case 5:
543 val |= SYS_CLCD_MODE_5551;
544 break;
545 case 6:
546 val |= SYS_CLCD_MODE_565_BLSB;
547 break;
548 case 8:
549 val |= SYS_CLCD_MODE_888;
550 break;
551 }
552
553 /*
554 * Set the MUX
555 */
556 writel(val, sys_clcd);
557
558 /*
559 * And now enable the PSUs
560 */
561 val |= SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
562 writel(val, sys_clcd);
563
564#ifdef CONFIG_MACH_VERSATILE_AB
565 /*
566 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on
567 */
568 if (fb->panel == &sanyo_2_5_in) {
569 unsigned long versatile_ib2_ctrl = IO_ADDRESS(VERSATILE_IB2_CTRL);
570 unsigned long ctrl;
571
572 ctrl = readl(versatile_ib2_ctrl);
573 ctrl |= 0x01;
574 writel(ctrl, versatile_ib2_ctrl);
575 }
576#endif
577}
578
579static unsigned long framesize = SZ_1M;
580
581static int versatile_clcd_setup(struct clcd_fb *fb)
582{
583 dma_addr_t dma;
584
585 fb->panel = versatile_clcd_panel();
586
587 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize,
588 &dma, GFP_KERNEL);
589 if (!fb->fb.screen_base) {
590 printk(KERN_ERR "CLCD: unable to map framebuffer\n");
591 return -ENOMEM;
592 }
593
594 fb->fb.fix.smem_start = dma;
595 fb->fb.fix.smem_len = framesize;
596
597 return 0;
598}
599
600static int versatile_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
601{
602 return dma_mmap_writecombine(&fb->dev->dev, vma,
603 fb->fb.screen_base,
604 fb->fb.fix.smem_start,
605 fb->fb.fix.smem_len);
606}
607
608static void versatile_clcd_remove(struct clcd_fb *fb)
609{
610 dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
611 fb->fb.screen_base, fb->fb.fix.smem_start);
612}
613
614static struct clcd_board clcd_plat_data = {
615 .name = "Versatile",
616 .check = clcdfb_check,
617 .decode = clcdfb_decode,
618 .disable = versatile_clcd_disable,
619 .enable = versatile_clcd_enable,
620 .setup = versatile_clcd_setup,
621 .mmap = versatile_clcd_mmap,
622 .remove = versatile_clcd_remove,
623};
624
625#define AACI_IRQ { IRQ_AACI, NO_IRQ }
626#define AACI_DMA { 0x80, 0x81 }
627#define MMCI0_IRQ { IRQ_MMCI0A,IRQ_SIC_MMCI0B }
628#define MMCI0_DMA { 0x84, 0 }
629#define KMI0_IRQ { IRQ_SIC_KMI0, NO_IRQ }
630#define KMI0_DMA { 0, 0 }
631#define KMI1_IRQ { IRQ_SIC_KMI1, NO_IRQ }
632#define KMI1_DMA { 0, 0 }
633
634/*
635 * These devices are connected directly to the multi-layer AHB switch
636 */
637#define SMC_IRQ { NO_IRQ, NO_IRQ }
638#define SMC_DMA { 0, 0 }
639#define MPMC_IRQ { NO_IRQ, NO_IRQ }
640#define MPMC_DMA { 0, 0 }
641#define CLCD_IRQ { IRQ_CLCDINT, NO_IRQ }
642#define CLCD_DMA { 0, 0 }
643#define DMAC_IRQ { IRQ_DMAINT, NO_IRQ }
644#define DMAC_DMA { 0, 0 }
645
646/*
647 * These devices are connected via the core APB bridge
648 */
649#define SCTL_IRQ { NO_IRQ, NO_IRQ }
650#define SCTL_DMA { 0, 0 }
651#define WATCHDOG_IRQ { IRQ_WDOGINT, NO_IRQ }
652#define WATCHDOG_DMA { 0, 0 }
653#define GPIO0_IRQ { IRQ_GPIOINT0, NO_IRQ }
654#define GPIO0_DMA { 0, 0 }
655#define GPIO1_IRQ { IRQ_GPIOINT1, NO_IRQ }
656#define GPIO1_DMA { 0, 0 }
657#define RTC_IRQ { IRQ_RTCINT, NO_IRQ }
658#define RTC_DMA { 0, 0 }
659
660/*
661 * These devices are connected via the DMA APB bridge
662 */
663#define SCI_IRQ { IRQ_SCIINT, NO_IRQ }
664#define SCI_DMA { 7, 6 }
665#define UART0_IRQ { IRQ_UARTINT0, NO_IRQ }
666#define UART0_DMA { 15, 14 }
667#define UART1_IRQ { IRQ_UARTINT1, NO_IRQ }
668#define UART1_DMA { 13, 12 }
669#define UART2_IRQ { IRQ_UARTINT2, NO_IRQ }
670#define UART2_DMA { 11, 10 }
671#define SSP_IRQ { IRQ_SSPINT, NO_IRQ }
672#define SSP_DMA { 9, 8 }
673
674/* FPGA Primecells */
675AMBA_DEVICE(aaci, "fpga:04", AACI, NULL);
676AMBA_DEVICE(mmc0, "fpga:05", MMCI0, &mmc0_plat_data);
677AMBA_DEVICE(kmi0, "fpga:06", KMI0, NULL);
678AMBA_DEVICE(kmi1, "fpga:07", KMI1, NULL);
679
680/* DevChip Primecells */
681AMBA_DEVICE(smc, "dev:00", SMC, NULL);
682AMBA_DEVICE(mpmc, "dev:10", MPMC, NULL);
683AMBA_DEVICE(clcd, "dev:20", CLCD, &clcd_plat_data);
684AMBA_DEVICE(dmac, "dev:30", DMAC, NULL);
685AMBA_DEVICE(sctl, "dev:e0", SCTL, NULL);
686AMBA_DEVICE(wdog, "dev:e1", WATCHDOG, NULL);
687AMBA_DEVICE(gpio0, "dev:e4", GPIO0, NULL);
688AMBA_DEVICE(gpio1, "dev:e5", GPIO1, NULL);
689AMBA_DEVICE(rtc, "dev:e8", RTC, NULL);
690AMBA_DEVICE(sci0, "dev:f0", SCI, NULL);
691AMBA_DEVICE(uart0, "dev:f1", UART0, NULL);
692AMBA_DEVICE(uart1, "dev:f2", UART1, NULL);
693AMBA_DEVICE(uart2, "dev:f3", UART2, NULL);
694AMBA_DEVICE(ssp0, "dev:f4", SSP, NULL);
695
696static struct amba_device *amba_devs[] __initdata = {
697 &dmac_device,
698 &uart0_device,
699 &uart1_device,
700 &uart2_device,
701 &smc_device,
702 &mpmc_device,
703 &clcd_device,
704 &sctl_device,
705 &wdog_device,
706 &gpio0_device,
707 &gpio1_device,
708 &rtc_device,
709 &sci0_device,
710 &ssp0_device,
711 &aaci_device,
712 &mmc0_device,
713 &kmi0_device,
714 &kmi1_device,
715};
716
717#ifdef CONFIG_LEDS
718#define VA_LEDS_BASE (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_LED_OFFSET)
719
720static void versatile_leds_event(led_event_t ledevt)
721{
722 unsigned long flags;
723 u32 val;
724
725 local_irq_save(flags);
726 val = readl(VA_LEDS_BASE);
727
728 switch (ledevt) {
729 case led_idle_start:
730 val = val & ~VERSATILE_SYS_LED0;
731 break;
732
733 case led_idle_end:
734 val = val | VERSATILE_SYS_LED0;
735 break;
736
737 case led_timer:
738 val = val ^ VERSATILE_SYS_LED1;
739 break;
740
741 case led_halted:
742 val = 0;
743 break;
744
745 default:
746 break;
747 }
748
749 writel(val, VA_LEDS_BASE);
750 local_irq_restore(flags);
751}
752#endif /* CONFIG_LEDS */
753
754void __init versatile_init(void)
755{
756 int i;
757
758 clk_register(&versatile_clcd_clk);
759
760 platform_device_register(&versatile_flash_device);
761 platform_device_register(&smc91x_device);
762
763 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
764 struct amba_device *d = amba_devs[i];
765 amba_device_register(d, &iomem_resource);
766 }
767
768#ifdef CONFIG_LEDS
769 leds_event = versatile_leds_event;
770#endif
771}
772
773/*
774 * Where is the timer (VA)?
775 */
776#define TIMER0_VA_BASE IO_ADDRESS(VERSATILE_TIMER0_1_BASE)
777#define TIMER1_VA_BASE (IO_ADDRESS(VERSATILE_TIMER0_1_BASE) + 0x20)
778#define TIMER2_VA_BASE IO_ADDRESS(VERSATILE_TIMER2_3_BASE)
779#define TIMER3_VA_BASE (IO_ADDRESS(VERSATILE_TIMER2_3_BASE) + 0x20)
780#define VA_IC_BASE IO_ADDRESS(VERSATILE_VIC_BASE)
781
782/*
783 * How long is the timer interval?
784 */
785#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
786#if TIMER_INTERVAL >= 0x100000
787#define TIMER_RELOAD (TIMER_INTERVAL >> 8) /* Divide by 256 */
788#define TIMER_CTRL 0x88 /* Enable, Clock / 256 */
789#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)
790#elif TIMER_INTERVAL >= 0x10000
791#define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */
792#define TIMER_CTRL 0x84 /* Enable, Clock / 16 */
793#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)
794#else
795#define TIMER_RELOAD (TIMER_INTERVAL)
796#define TIMER_CTRL 0x80 /* Enable */
797#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
798#endif
799
800#define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable */
801
802/*
803 * What does it look like?
804 */
805typedef struct TimerStruct {
806 unsigned long TimerLoad;
807 unsigned long TimerValue;
808 unsigned long TimerControl;
809 unsigned long TimerClear;
810} TimerStruct_t;
811
812/*
813 * Returns number of ms since last clock interrupt. Note that interrupts
814 * will have been disabled by do_gettimeoffset()
815 */
816static unsigned long versatile_gettimeoffset(void)
817{
818 volatile TimerStruct_t *timer0 = (TimerStruct_t *)TIMER0_VA_BASE;
819 unsigned long ticks1, ticks2, status;
820
821 /*
822 * Get the current number of ticks. Note that there is a race
823 * condition between us reading the timer and checking for
824 * an interrupt. We get around this by ensuring that the
825 * counter has not reloaded between our two reads.
826 */
827 ticks2 = timer0->TimerValue & 0xffff;
828 do {
829 ticks1 = ticks2;
830 status = __raw_readl(VA_IC_BASE + VIC_IRQ_RAW_STATUS);
831 ticks2 = timer0->TimerValue & 0xffff;
832 } while (ticks2 > ticks1);
833
834 /*
835 * Number of ticks since last interrupt.
836 */
837 ticks1 = TIMER_RELOAD - ticks2;
838
839 /*
840 * Interrupt pending? If so, we've reloaded once already.
841 *
842 * FIXME: Need to check this is effectively timer 0 that expires
843 */
844 if (status & IRQMASK_TIMERINT0_1)
845 ticks1 += TIMER_RELOAD;
846
847 /*
848 * Convert the ticks to usecs
849 */
850 return TICKS2USECS(ticks1);
851}
852
853/*
854 * IRQ handler for the timer
855 */
856static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
857{
858 volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE;
859
860 write_seqlock(&xtime_lock);
861
862 // ...clear the interrupt
863 timer0->TimerClear = 1;
864
865 timer_tick(regs);
866
867 write_sequnlock(&xtime_lock);
868
869 return IRQ_HANDLED;
870}
871
872static struct irqaction versatile_timer_irq = {
873 .name = "Versatile Timer Tick",
874 .flags = SA_INTERRUPT,
875 .handler = versatile_timer_interrupt
876};
877
878/*
879 * Set up timer interrupt, and return the current time in seconds.
880 */
881static void __init versatile_timer_init(void)
882{
883 volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE;
884 volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE;
885 volatile TimerStruct_t *timer2 = (volatile TimerStruct_t *)TIMER2_VA_BASE;
886 volatile TimerStruct_t *timer3 = (volatile TimerStruct_t *)TIMER3_VA_BASE;
887
888 /*
889 * set clock frequency:
890 * VERSATILE_REFCLK is 32KHz
891 * VERSATILE_TIMCLK is 1MHz
892 */
893 *(volatile unsigned int *)IO_ADDRESS(VERSATILE_SCTL_BASE) |=
894 ((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) | (VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) |
895 (VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) | (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel));
896
897 /*
898 * Initialise to a known state (all timers off)
899 */
900 timer0->TimerControl = 0;
901 timer1->TimerControl = 0;
902 timer2->TimerControl = 0;
903 timer3->TimerControl = 0;
904
905 timer0->TimerLoad = TIMER_RELOAD;
906 timer0->TimerValue = TIMER_RELOAD;
907 timer0->TimerControl = TIMER_CTRL | 0x40 | TIMER_CTRL_IE; /* periodic + IE */
908
909 /*
910 * Make irqs happen for the system timer
911 */
912 setup_irq(IRQ_TIMERINT0_1, &versatile_timer_irq);
913}
914
915struct sys_timer versatile_timer = {
916 .init = versatile_timer_init,
917 .offset = versatile_gettimeoffset,
918};
diff --git a/arch/arm/mach-versatile/core.h b/arch/arm/mach-versatile/core.h
new file mode 100644
index 000000000000..588c20669d5d
--- /dev/null
+++ b/arch/arm/mach-versatile/core.h
@@ -0,0 +1,50 @@
1/*
2 * linux/arch/arm/mach-versatile/core.h
3 *
4 * Copyright (C) 2004 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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#ifndef __ASM_ARCH_VERSATILE_H
23#define __ASM_ARCH_VERSATILE_H
24
25#include <asm/hardware/amba.h>
26
27extern void __init versatile_init(void);
28extern void __init versatile_init_irq(void);
29extern void __init versatile_map_io(void);
30extern struct sys_timer versatile_timer;
31extern unsigned int mmc_status(struct device *dev);
32
33#define AMBA_DEVICE(name,busid,base,plat) \
34static struct amba_device name##_device = { \
35 .dev = { \
36 .coherent_dma_mask = ~0, \
37 .bus_id = busid, \
38 .platform_data = plat, \
39 }, \
40 .res = { \
41 .start = VERSATILE_##base##_BASE, \
42 .end = (VERSATILE_##base##_BASE) + SZ_4K - 1,\
43 .flags = IORESOURCE_MEM, \
44 }, \
45 .dma_mask = ~0, \
46 .irq = base##_IRQ, \
47 /* .dma = base##_DMA,*/ \
48}
49
50#endif
diff --git a/arch/arm/mach-versatile/versatile_ab.c b/arch/arm/mach-versatile/versatile_ab.c
new file mode 100644
index 000000000000..d332084586cf
--- /dev/null
+++ b/arch/arm/mach-versatile/versatile_ab.c
@@ -0,0 +1,45 @@
1/*
2 * linux/arch/arm/mach-versatile/versatile_ab.c
3 *
4 * Copyright (C) 2004 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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/config.h>
23#include <linux/init.h>
24#include <linux/device.h>
25#include <linux/sysdev.h>
26
27#include <asm/hardware.h>
28#include <asm/io.h>
29#include <asm/irq.h>
30#include <asm/mach-types.h>
31#include <asm/hardware/amba.h>
32
33#include <asm/mach/arch.h>
34
35#include "core.h"
36
37MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
38 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd")
39 BOOT_MEM(0x00000000, 0x101f1000, 0xf11f1000)
40 BOOT_PARAMS(0x00000100)
41 MAPIO(versatile_map_io)
42 INITIRQ(versatile_init_irq)
43 .timer = &versatile_timer,
44 INIT_MACHINE(versatile_init)
45MACHINE_END
diff --git a/arch/arm/mach-versatile/versatile_pb.c b/arch/arm/mach-versatile/versatile_pb.c
new file mode 100644
index 000000000000..2702099a68f3
--- /dev/null
+++ b/arch/arm/mach-versatile/versatile_pb.c
@@ -0,0 +1,109 @@
1/*
2 * linux/arch/arm/mach-versatile/versatile_pb.c
3 *
4 * Copyright (C) 2004 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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/config.h>
23#include <linux/init.h>
24#include <linux/device.h>
25#include <linux/sysdev.h>
26
27#include <asm/hardware.h>
28#include <asm/io.h>
29#include <asm/irq.h>
30#include <asm/mach-types.h>
31#include <asm/hardware/amba.h>
32
33#include <asm/mach/arch.h>
34#include <asm/mach/mmc.h>
35
36#include "core.h"
37
38#if 1
39#define IRQ_MMCI1A IRQ_VICSOURCE23
40#else
41#define IRQ_MMCI1A IRQ_SIC_MMCI1A
42#endif
43
44static struct mmc_platform_data mmc1_plat_data = {
45 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
46 .status = mmc_status,
47};
48
49#define UART3_IRQ { IRQ_SIC_UART3, NO_IRQ }
50#define UART3_DMA { 0x86, 0x87 }
51#define SCI1_IRQ { IRQ_SIC_SCI3, NO_IRQ }
52#define SCI1_DMA { 0x88, 0x89 }
53#define MMCI1_IRQ { IRQ_MMCI1A, IRQ_SIC_MMCI1B }
54#define MMCI1_DMA { 0x85, 0 }
55
56/*
57 * These devices are connected via the core APB bridge
58 */
59#define GPIO2_IRQ { IRQ_GPIOINT2, NO_IRQ }
60#define GPIO2_DMA { 0, 0 }
61#define GPIO3_IRQ { IRQ_GPIOINT3, NO_IRQ }
62#define GPIO3_DMA { 0, 0 }
63
64/*
65 * These devices are connected via the DMA APB bridge
66 */
67
68/* FPGA Primecells */
69AMBA_DEVICE(uart3, "fpga:09", UART3, NULL);
70AMBA_DEVICE(sci1, "fpga:0a", SCI1, NULL);
71AMBA_DEVICE(mmc1, "fpga:0b", MMCI1, &mmc1_plat_data);
72
73/* DevChip Primecells */
74AMBA_DEVICE(gpio2, "dev:e6", GPIO2, NULL);
75AMBA_DEVICE(gpio3, "dev:e7", GPIO3, NULL);
76
77static struct amba_device *amba_devs[] __initdata = {
78 &uart3_device,
79 &gpio2_device,
80 &gpio3_device,
81 &sci1_device,
82 &mmc1_device,
83};
84
85static int __init versatile_pb_init(void)
86{
87 int i;
88
89 if (machine_is_versatile_pb()) {
90 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
91 struct amba_device *d = amba_devs[i];
92 amba_device_register(d, &iomem_resource);
93 }
94 }
95
96 return 0;
97}
98
99arch_initcall(versatile_pb_init);
100
101MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
102 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd")
103 BOOT_MEM(0x00000000, 0x101f1000, 0xf11f1000)
104 BOOT_PARAMS(0x00000100)
105 MAPIO(versatile_map_io)
106 INITIRQ(versatile_init_irq)
107 .timer = &versatile_timer,
108 INIT_MACHINE(versatile_init)
109MACHINE_END
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
new file mode 100644
index 000000000000..5b670c9ac5ef
--- /dev/null
+++ b/arch/arm/mm/Kconfig
@@ -0,0 +1,411 @@
1comment "Processor Type"
2
3config CPU_32
4 bool
5 default y
6
7# Select CPU types depending on the architecture selected. This selects
8# which CPUs we support in the kernel image, and the compiler instruction
9# optimiser behaviour.
10
11# ARM610
12config CPU_ARM610
13 bool "Support ARM610 processor"
14 depends on ARCH_RPC
15 select CPU_32v3
16 select CPU_CACHE_V3
17 select CPU_CACHE_VIVT
18 select CPU_COPY_V3
19 select CPU_TLB_V3
20 help
21 The ARM610 is the successor to the ARM3 processor
22 and was produced by VLSI Technology Inc.
23
24 Say Y if you want support for the ARM610 processor.
25 Otherwise, say N.
26
27# ARM710
28config CPU_ARM710
29 bool "Support ARM710 processor" if !ARCH_CLPS7500 && ARCH_RPC
30 default y if ARCH_CLPS7500
31 select CPU_32v3
32 select CPU_CACHE_V3
33 select CPU_CACHE_VIVT
34 select CPU_COPY_V3
35 select CPU_TLB_V3
36 help
37 A 32-bit RISC microprocessor based on the ARM7 processor core
38 designed by Advanced RISC Machines Ltd. The ARM710 is the
39 successor to the ARM610 processor. It was released in
40 July 1994 by VLSI Technology Inc.
41
42 Say Y if you want support for the ARM710 processor.
43 Otherwise, say N.
44
45# ARM720T
46config CPU_ARM720T
47 bool "Support ARM720T processor" if !ARCH_CLPS711X && !ARCH_L7200 && !ARCH_CDB89712 && ARCH_INTEGRATOR
48 default y if ARCH_CLPS711X || ARCH_L7200 || ARCH_CDB89712 || ARCH_H720X
49 select CPU_32v4
50 select CPU_ABRT_LV4T
51 select CPU_CACHE_V4
52 select CPU_CACHE_VIVT
53 select CPU_COPY_V4WT
54 select CPU_TLB_V4WT
55 help
56 A 32-bit RISC processor with 8kByte Cache, Write Buffer and
57 MMU built around an ARM7TDMI core.
58
59 Say Y if you want support for the ARM720T processor.
60 Otherwise, say N.
61
62# ARM920T
63config CPU_ARM920T
64 bool "Support ARM920T processor" if !ARCH_S3C2410
65 depends on ARCH_INTEGRATOR || ARCH_S3C2410 || ARCH_IMX
66 default y if ARCH_S3C2410
67 select CPU_32v4
68 select CPU_ABRT_EV4T
69 select CPU_CACHE_V4WT
70 select CPU_CACHE_VIVT
71 select CPU_COPY_V4WB
72 select CPU_TLB_V4WBI
73 help
74 The ARM920T is licensed to be produced by numerous vendors,
75 and is used in the Maverick EP9312 and the Samsung S3C2410.
76
77 More information on the Maverick EP9312 at
78 <http://linuxdevices.com/products/PD2382866068.html>.
79
80 Say Y if you want support for the ARM920T processor.
81 Otherwise, say N.
82
83# ARM922T
84config CPU_ARM922T
85 bool "Support ARM922T processor" if ARCH_INTEGRATOR
86 depends on ARCH_CAMELOT || ARCH_LH7A40X || ARCH_INTEGRATOR
87 default y if ARCH_CAMELOT || ARCH_LH7A40X
88 select CPU_32v4
89 select CPU_ABRT_EV4T
90 select CPU_CACHE_V4WT
91 select CPU_CACHE_VIVT
92 select CPU_COPY_V4WB
93 select CPU_TLB_V4WBI
94 help
95 The ARM922T is a version of the ARM920T, but with smaller
96 instruction and data caches. It is used in Altera's
97 Excalibur XA device family.
98
99 Say Y if you want support for the ARM922T processor.
100 Otherwise, say N.
101
102# ARM925T
103config CPU_ARM925T
104 bool "Support ARM925T processor" if ARCH_OMAP
105 depends on ARCH_OMAP1510
106 default y if ARCH_OMAP1510
107 select CPU_32v4
108 select CPU_ABRT_EV4T
109 select CPU_CACHE_V4WT
110 select CPU_CACHE_VIVT
111 select CPU_COPY_V4WB
112 select CPU_TLB_V4WBI
113 help
114 The ARM925T is a mix between the ARM920T and ARM926T, but with
115 different instruction and data caches. It is used in TI's OMAP
116 device family.
117
118 Say Y if you want support for the ARM925T processor.
119 Otherwise, say N.
120
121# ARM926T
122config CPU_ARM926T
123 bool "Support ARM926T processor" if ARCH_INTEGRATOR
124 depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX
125 default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX
126 select CPU_32v5
127 select CPU_ABRT_EV5TJ
128 select CPU_CACHE_VIVT
129 select CPU_COPY_V4WB
130 select CPU_TLB_V4WBI
131 help
132 This is a variant of the ARM920. It has slightly different
133 instruction sequences for cache and TLB operations. Curiously,
134 there is no documentation on it at the ARM corporate website.
135
136 Say Y if you want support for the ARM926T processor.
137 Otherwise, say N.
138
139# ARM1020 - needs validating
140config CPU_ARM1020
141 bool "Support ARM1020T (rev 0) processor"
142 depends on ARCH_INTEGRATOR
143 select CPU_32v5
144 select CPU_ABRT_EV4T
145 select CPU_CACHE_V4WT
146 select CPU_CACHE_VIVT
147 select CPU_COPY_V4WB
148 select CPU_TLB_V4WBI
149 help
150 The ARM1020 is the 32K cached version of the ARM10 processor,
151 with an addition of a floating-point unit.
152
153 Say Y if you want support for the ARM1020 processor.
154 Otherwise, say N.
155
156# ARM1020E - needs validating
157config CPU_ARM1020E
158 bool "Support ARM1020E processor"
159 depends on ARCH_INTEGRATOR
160 select CPU_32v5
161 select CPU_ABRT_EV4T
162 select CPU_CACHE_V4WT
163 select CPU_CACHE_VIVT
164 select CPU_COPY_V4WB
165 select CPU_TLB_V4WBI
166 depends on n
167
168# ARM1022E
169config CPU_ARM1022
170 bool "Support ARM1022E processor"
171 depends on ARCH_INTEGRATOR
172 select CPU_32v5
173 select CPU_ABRT_EV4T
174 select CPU_CACHE_VIVT
175 select CPU_COPY_V4WB # can probably do better
176 select CPU_TLB_V4WBI
177 help
178 The ARM1022E is an implementation of the ARMv5TE architecture
179 based upon the ARM10 integer core with a 16KiB L1 Harvard cache,
180 embedded trace macrocell, and a floating-point unit.
181
182 Say Y if you want support for the ARM1022E processor.
183 Otherwise, say N.
184
185# ARM1026EJ-S
186config CPU_ARM1026
187 bool "Support ARM1026EJ-S processor"
188 depends on ARCH_INTEGRATOR
189 select CPU_32v5
190 select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10
191 select CPU_CACHE_VIVT
192 select CPU_COPY_V4WB # can probably do better
193 select CPU_TLB_V4WBI
194 help
195 The ARM1026EJ-S is an implementation of the ARMv5TEJ architecture
196 based upon the ARM10 integer core.
197
198 Say Y if you want support for the ARM1026EJ-S processor.
199 Otherwise, say N.
200
201# SA110
202config CPU_SA110
203 bool "Support StrongARM(R) SA-110 processor" if !ARCH_EBSA110 && !FOOTBRIDGE && !ARCH_TBOX && !ARCH_SHARK && !ARCH_NEXUSPCI && ARCH_RPC
204 default y if ARCH_EBSA110 || FOOTBRIDGE || ARCH_TBOX || ARCH_SHARK || ARCH_NEXUSPCI
205 select CPU_32v3 if ARCH_RPC
206 select CPU_32v4 if !ARCH_RPC
207 select CPU_ABRT_EV4
208 select CPU_CACHE_V4WB
209 select CPU_CACHE_VIVT
210 select CPU_COPY_V4WB
211 select CPU_TLB_V4WB
212 help
213 The Intel StrongARM(R) SA-110 is a 32-bit microprocessor and
214 is available at five speeds ranging from 100 MHz to 233 MHz.
215 More information is available at
216 <http://developer.intel.com/design/strong/sa110.htm>.
217
218 Say Y if you want support for the SA-110 processor.
219 Otherwise, say N.
220
221# SA1100
222config CPU_SA1100
223 bool
224 depends on ARCH_SA1100
225 default y
226 select CPU_32v4
227 select CPU_ABRT_EV4
228 select CPU_CACHE_V4WB
229 select CPU_CACHE_VIVT
230 select CPU_TLB_V4WB
231 select CPU_MINICACHE
232
233# XScale
234config CPU_XSCALE
235 bool
236 depends on ARCH_IOP3XX || ARCH_PXA || ARCH_IXP4XX || ARCH_IXP2000
237 default y
238 select CPU_32v5
239 select CPU_ABRT_EV5T
240 select CPU_CACHE_VIVT
241 select CPU_TLB_V4WBI
242 select CPU_MINICACHE
243
244# ARMv6
245config CPU_V6
246 bool "Support ARM V6 processor"
247 depends on ARCH_INTEGRATOR
248 select CPU_32v6
249 select CPU_ABRT_EV6
250 select CPU_CACHE_V6
251 select CPU_CACHE_VIPT
252 select CPU_COPY_V6
253 select CPU_TLB_V6
254
255# Figure out what processor architecture version we should be using.
256# This defines the compiler instruction set which depends on the machine type.
257config CPU_32v3
258 bool
259
260config CPU_32v4
261 bool
262
263config CPU_32v5
264 bool
265
266config CPU_32v6
267 bool
268
269# The abort model
270config CPU_ABRT_EV4
271 bool
272
273config CPU_ABRT_EV4T
274 bool
275
276config CPU_ABRT_LV4T
277 bool
278
279config CPU_ABRT_EV5T
280 bool
281
282config CPU_ABRT_EV5TJ
283 bool
284
285config CPU_ABRT_EV6
286 bool
287
288# The cache model
289config CPU_CACHE_V3
290 bool
291
292config CPU_CACHE_V4
293 bool
294
295config CPU_CACHE_V4WT
296 bool
297
298config CPU_CACHE_V4WB
299 bool
300
301config CPU_CACHE_V6
302 bool
303
304config CPU_CACHE_VIVT
305 bool
306
307config CPU_CACHE_VIPT
308 bool
309
310# The copy-page model
311config CPU_COPY_V3
312 bool
313
314config CPU_COPY_V4WT
315 bool
316
317config CPU_COPY_V4WB
318 bool
319
320config CPU_COPY_V6
321 bool
322
323# This selects the TLB model
324config CPU_TLB_V3
325 bool
326 help
327 ARM Architecture Version 3 TLB.
328
329config CPU_TLB_V4WT
330 bool
331 help
332 ARM Architecture Version 4 TLB with writethrough cache.
333
334config CPU_TLB_V4WB
335 bool
336 help
337 ARM Architecture Version 4 TLB with writeback cache.
338
339config CPU_TLB_V4WBI
340 bool
341 help
342 ARM Architecture Version 4 TLB with writeback cache and invalidate
343 instruction cache entry.
344
345config CPU_TLB_V6
346 bool
347
348config CPU_MINICACHE
349 bool
350 help
351 Processor has a minicache.
352
353comment "Processor Features"
354
355config ARM_THUMB
356 bool "Support Thumb user binaries"
357 depends on CPU_ARM720T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_V6
358 default y
359 help
360 Say Y if you want to include kernel support for running user space
361 Thumb binaries.
362
363 The Thumb instruction set is a compressed form of the standard ARM
364 instruction set resulting in smaller binaries at the expense of
365 slightly less efficient code.
366
367 If you don't know what this all is, saying Y is a safe choice.
368
369config CPU_BIG_ENDIAN
370 bool "Build big-endian kernel"
371 depends on ARCH_SUPPORTS_BIG_ENDIAN
372 help
373 Say Y if you plan on running a kernel in big-endian mode.
374 Note that your board must be properly built and your board
375 port must properly enable any big-endian related features
376 of your chipset/board/processor.
377
378config CPU_ICACHE_DISABLE
379 bool "Disable I-Cache"
380 depends on CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020
381 help
382 Say Y here to disable the processor instruction cache. Unless
383 you have a reason not to or are unsure, say N.
384
385config CPU_DCACHE_DISABLE
386 bool "Disable D-Cache"
387 depends on CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020
388 help
389 Say Y here to disable the processor data cache. Unless
390 you have a reason not to or are unsure, say N.
391
392config CPU_DCACHE_WRITETHROUGH
393 bool "Force write through D-cache"
394 depends on (CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020) && !CPU_DISABLE_DCACHE
395 default y if CPU_ARM925T
396 help
397 Say Y here to use the data cache in writethrough mode. Unless you
398 specifically require this or are unsure, say N.
399
400config CPU_CACHE_ROUND_ROBIN
401 bool "Round robin I and D cache replacement algorithm"
402 depends on (CPU_ARM926T || CPU_ARM1020) && (!CPU_ICACHE_DISABLE || !CPU_DCACHE_DISABLE)
403 help
404 Say Y here to use the predictable round-robin cache replacement
405 policy. Unless you specifically require this or are unsure, say N.
406
407config CPU_BPREDICT_DISABLE
408 bool "Disable branch prediction"
409 depends on CPU_ARM1020
410 help
411 Say Y here to disable branch prediction. If unsure, say N.
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
new file mode 100644
index 000000000000..ccf316c11e02
--- /dev/null
+++ b/arch/arm/mm/Makefile
@@ -0,0 +1,56 @@
1#
2# Makefile for the linux arm-specific parts of the memory manager.
3#
4
5obj-y := consistent.o extable.o fault-armv.o \
6 fault.o flush.o init.o ioremap.o mmap.o \
7 mm-armv.o
8
9obj-$(CONFIG_MODULES) += proc-syms.o
10
11obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o
12obj-$(CONFIG_DISCONTIGMEM) += discontig.o
13
14obj-$(CONFIG_CPU_ABRT_EV4) += abort-ev4.o
15obj-$(CONFIG_CPU_ABRT_EV4T) += abort-ev4t.o
16obj-$(CONFIG_CPU_ABRT_LV4T) += abort-lv4t.o
17obj-$(CONFIG_CPU_ABRT_EV5T) += abort-ev5t.o
18obj-$(CONFIG_CPU_ABRT_EV5TJ) += abort-ev5tj.o
19obj-$(CONFIG_CPU_ABRT_EV6) += abort-ev6.o
20
21obj-$(CONFIG_CPU_CACHE_V3) += cache-v3.o
22obj-$(CONFIG_CPU_CACHE_V4) += cache-v4.o
23obj-$(CONFIG_CPU_CACHE_V4WT) += cache-v4wt.o
24obj-$(CONFIG_CPU_CACHE_V4WB) += cache-v4wb.o
25obj-$(CONFIG_CPU_CACHE_V6) += cache-v6.o
26
27obj-$(CONFIG_CPU_COPY_V3) += copypage-v3.o
28obj-$(CONFIG_CPU_COPY_V4WT) += copypage-v4wt.o
29obj-$(CONFIG_CPU_COPY_V4WB) += copypage-v4wb.o
30obj-$(CONFIG_CPU_COPY_V6) += copypage-v6.o mmu.o
31obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o
32obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o
33
34obj-$(CONFIG_CPU_MINICACHE) += minicache.o
35
36obj-$(CONFIG_CPU_TLB_V3) += tlb-v3.o
37obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o
38obj-$(CONFIG_CPU_TLB_V4WB) += tlb-v4wb.o
39obj-$(CONFIG_CPU_TLB_V4WBI) += tlb-v4wbi.o
40obj-$(CONFIG_CPU_TLB_V6) += tlb-v6.o
41
42obj-$(CONFIG_CPU_ARM610) += proc-arm6_7.o
43obj-$(CONFIG_CPU_ARM710) += proc-arm6_7.o
44obj-$(CONFIG_CPU_ARM720T) += proc-arm720.o
45obj-$(CONFIG_CPU_ARM920T) += proc-arm920.o
46obj-$(CONFIG_CPU_ARM922T) += proc-arm922.o
47obj-$(CONFIG_CPU_ARM925T) += proc-arm925.o
48obj-$(CONFIG_CPU_ARM926T) += proc-arm926.o
49obj-$(CONFIG_CPU_ARM1020) += proc-arm1020.o
50obj-$(CONFIG_CPU_ARM1020E) += proc-arm1020e.o
51obj-$(CONFIG_CPU_ARM1022) += proc-arm1022.o
52obj-$(CONFIG_CPU_ARM1026) += proc-arm1026.o
53obj-$(CONFIG_CPU_SA110) += proc-sa110.o
54obj-$(CONFIG_CPU_SA1100) += proc-sa1100.o
55obj-$(CONFIG_CPU_XSCALE) += proc-xscale.o
56obj-$(CONFIG_CPU_V6) += proc-v6.o blockops.o
diff --git a/arch/arm/mm/abort-ev4.S b/arch/arm/mm/abort-ev4.S
new file mode 100644
index 000000000000..4f18f9e87bae
--- /dev/null
+++ b/arch/arm/mm/abort-ev4.S
@@ -0,0 +1,30 @@
1#include <linux/linkage.h>
2#include <asm/assembler.h>
3/*
4 * Function: v4_early_abort
5 *
6 * Params : r2 = address of aborted instruction
7 * : r3 = saved SPSR
8 *
9 * Returns : r0 = address of abort
10 * : r1 = FSR, bit 11 = write
11 * : r2-r8 = corrupted
12 * : r9 = preserved
13 * : sp = pointer to registers
14 *
15 * Purpose : obtain information about current aborted instruction.
16 * Note: we read user space. This means we might cause a data
17 * abort here if the I-TLB and D-TLB aren't seeing the same
18 * picture. Unfortunately, this does happen. We live with it.
19 */
20 .align 5
21ENTRY(v4_early_abort)
22 mrc p15, 0, r1, c5, c0, 0 @ get FSR
23 mrc p15, 0, r0, c6, c0, 0 @ get FAR
24 ldr r3, [r2] @ read aborted ARM instruction
25 bic r1, r1, #1 << 11 | 1 << 10 @ clear bits 11 and 10 of FSR
26 tst r3, #1 << 20 @ L = 1 -> write?
27 orreq r1, r1, #1 << 11 @ yes.
28 mov pc, lr
29
30
diff --git a/arch/arm/mm/abort-ev4t.S b/arch/arm/mm/abort-ev4t.S
new file mode 100644
index 000000000000..b6282548f922
--- /dev/null
+++ b/arch/arm/mm/abort-ev4t.S
@@ -0,0 +1,30 @@
1#include <linux/linkage.h>
2#include <asm/assembler.h>
3#include "abort-macro.S"
4/*
5 * Function: v4t_early_abort
6 *
7 * Params : r2 = address of aborted instruction
8 * : r3 = saved SPSR
9 *
10 * Returns : r0 = address of abort
11 * : r1 = FSR, bit 11 = write
12 * : r2-r8 = corrupted
13 * : r9 = preserved
14 * : sp = pointer to registers
15 *
16 * Purpose : obtain information about current aborted instruction.
17 * Note: we read user space. This means we might cause a data
18 * abort here if the I-TLB and D-TLB aren't seeing the same
19 * picture. Unfortunately, this does happen. We live with it.
20 */
21 .align 5
22ENTRY(v4t_early_abort)
23 mrc p15, 0, r1, c5, c0, 0 @ get FSR
24 mrc p15, 0, r0, c6, c0, 0 @ get FAR
25 do_thumb_abort
26 ldreq r3, [r2] @ read aborted ARM instruction
27 bic r1, r1, #1 << 11 | 1 << 10 @ clear bits 11 and 10 of FSR
28 tst r3, #1 << 20 @ check write
29 orreq r1, r1, #1 << 11
30 mov pc, lr
diff --git a/arch/arm/mm/abort-ev5t.S b/arch/arm/mm/abort-ev5t.S
new file mode 100644
index 000000000000..02251b526c0d
--- /dev/null
+++ b/arch/arm/mm/abort-ev5t.S
@@ -0,0 +1,31 @@
1#include <linux/linkage.h>
2#include <asm/assembler.h>
3#include "abort-macro.S"
4/*
5 * Function: v5t_early_abort
6 *
7 * Params : r2 = address of aborted instruction
8 * : r3 = saved SPSR
9 *
10 * Returns : r0 = address of abort
11 * : r1 = FSR, bit 11 = write
12 * : r2-r8 = corrupted
13 * : r9 = preserved
14 * : sp = pointer to registers
15 *
16 * Purpose : obtain information about current aborted instruction.
17 * Note: we read user space. This means we might cause a data
18 * abort here if the I-TLB and D-TLB aren't seeing the same
19 * picture. Unfortunately, this does happen. We live with it.
20 */
21 .align 5
22ENTRY(v5t_early_abort)
23 mrc p15, 0, r1, c5, c0, 0 @ get FSR
24 mrc p15, 0, r0, c6, c0, 0 @ get FAR
25 do_thumb_abort
26 ldreq r3, [r2] @ read aborted ARM instruction
27 bic r1, r1, #1 << 11 @ clear bits 11 of FSR
28 do_ldrd_abort
29 tst r3, #1 << 20 @ check write
30 orreq r1, r1, #1 << 11
31 mov pc, lr
diff --git a/arch/arm/mm/abort-ev5tj.S b/arch/arm/mm/abort-ev5tj.S
new file mode 100644
index 000000000000..bce68d601c8b
--- /dev/null
+++ b/arch/arm/mm/abort-ev5tj.S
@@ -0,0 +1,35 @@
1#include <linux/linkage.h>
2#include <asm/assembler.h>
3#include "abort-macro.S"
4/*
5 * Function: v5tj_early_abort
6 *
7 * Params : r2 = address of aborted instruction
8 * : r3 = saved SPSR
9 *
10 * Returns : r0 = address of abort
11 * : r1 = FSR, bit 11 = write
12 * : r2-r8 = corrupted
13 * : r9 = preserved
14 * : sp = pointer to registers
15 *
16 * Purpose : obtain information about current aborted instruction.
17 * Note: we read user space. This means we might cause a data
18 * abort here if the I-TLB and D-TLB aren't seeing the same
19 * picture. Unfortunately, this does happen. We live with it.
20 */
21 .align 5
22ENTRY(v5tj_early_abort)
23 mrc p15, 0, r1, c5, c0, 0 @ get FSR
24 mrc p15, 0, r0, c6, c0, 0 @ get FAR
25 bic r1, r1, #1 << 11 | 1 << 10 @ clear bits 11 and 10 of FSR
26 tst r3, #PSR_J_BIT @ Java?
27 movne pc, lr
28 do_thumb_abort
29 ldreq r3, [r2] @ read aborted ARM instruction
30 do_ldrd_abort
31 tst r3, #1 << 20 @ L = 0 -> write
32 orreq r1, r1, #1 << 11 @ yes.
33 mov pc, lr
34
35
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S
new file mode 100644
index 000000000000..38b2cbb89beb
--- /dev/null
+++ b/arch/arm/mm/abort-ev6.S
@@ -0,0 +1,23 @@
1#include <linux/linkage.h>
2#include <asm/assembler.h>
3/*
4 * Function: v6_early_abort
5 *
6 * Params : r2 = address of aborted instruction
7 * : r3 = saved SPSR
8 *
9 * Returns : r0 = address of abort
10 * : r1 = FSR, bit 11 = write
11 * : r2-r8 = corrupted
12 * : r9 = preserved
13 * : sp = pointer to registers
14 *
15 * Purpose : obtain information about current aborted instruction.
16 */
17 .align 5
18ENTRY(v6_early_abort)
19 mrc p15, 0, r1, c5, c0, 0 @ get FSR
20 mrc p15, 0, r0, c6, c0, 0 @ get FAR
21 mov pc, lr
22
23
diff --git a/arch/arm/mm/abort-lv4t.S b/arch/arm/mm/abort-lv4t.S
new file mode 100644
index 000000000000..db743e510214
--- /dev/null
+++ b/arch/arm/mm/abort-lv4t.S
@@ -0,0 +1,220 @@
1#include <linux/linkage.h>
2#include <asm/assembler.h>
3/*
4 * Function: v4t_late_abort
5 *
6 * Params : r2 = address of aborted instruction
7 * : r3 = saved SPSR
8 *
9 * Returns : r0 = address of abort
10 * : r1 = FSR, bit 11 = write
11 * : r2-r8 = corrupted
12 * : r9 = preserved
13 * : sp = pointer to registers
14 *
15 * Purpose : obtain information about current aborted instruction.
16 * Note: we read user space. This means we might cause a data
17 * abort here if the I-TLB and D-TLB aren't seeing the same
18 * picture. Unfortunately, this does happen. We live with it.
19 */
20ENTRY(v4t_late_abort)
21 tst r3, #PSR_T_BIT @ check for thumb mode
22 mrc p15, 0, r1, c5, c0, 0 @ get FSR
23 mrc p15, 0, r0, c6, c0, 0 @ get FAR
24 bne .data_thumb_abort
25 ldr r8, [r2] @ read arm instruction
26 bic r1, r1, #1 << 11 | 1 << 10 @ clear bits 11 and 10 of FSR
27 tst r8, #1 << 20 @ L = 1 -> write?
28 orreq r1, r1, #1 << 11 @ yes.
29 and r7, r8, #15 << 24
30 add pc, pc, r7, lsr #22 @ Now branch to the relevant processing routine
31 nop
32
33/* 0 */ b .data_arm_lateldrhpost @ ldrh rd, [rn], #m/rm
34/* 1 */ b .data_arm_lateldrhpre @ ldrh rd, [rn, #m/rm]
35/* 2 */ b .data_unknown
36/* 3 */ b .data_unknown
37/* 4 */ b .data_arm_lateldrpostconst @ ldr rd, [rn], #m
38/* 5 */ b .data_arm_lateldrpreconst @ ldr rd, [rn, #m]
39/* 6 */ b .data_arm_lateldrpostreg @ ldr rd, [rn], rm
40/* 7 */ b .data_arm_lateldrprereg @ ldr rd, [rn, rm]
41/* 8 */ b .data_arm_ldmstm @ ldm*a rn, <rlist>
42/* 9 */ b .data_arm_ldmstm @ ldm*b rn, <rlist>
43/* a */ b .data_unknown
44/* b */ b .data_unknown
45/* c */ mov pc, lr @ ldc rd, [rn], #m @ Same as ldr rd, [rn], #m
46/* d */ mov pc, lr @ ldc rd, [rn, #m]
47/* e */ b .data_unknown
48/* f */
49.data_unknown: @ Part of jumptable
50 mov r0, r2
51 mov r1, r8
52 mov r2, sp
53 bl baddataabort
54 b ret_from_exception
55
56.data_arm_ldmstm:
57 tst r8, #1 << 21 @ check writeback bit
58 moveq pc, lr @ no writeback -> no fixup
59 mov r7, #0x11
60 orr r7, r7, #0x1100
61 and r6, r8, r7
62 and r2, r8, r7, lsl #1
63 add r6, r6, r2, lsr #1
64 and r2, r8, r7, lsl #2
65 add r6, r6, r2, lsr #2
66 and r2, r8, r7, lsl #3
67 add r6, r6, r2, lsr #3
68 add r6, r6, r6, lsr #8
69 add r6, r6, r6, lsr #4
70 and r6, r6, #15 @ r6 = no. of registers to transfer.
71 and r5, r8, #15 << 16 @ Extract 'n' from instruction
72 ldr r7, [sp, r5, lsr #14] @ Get register 'Rn'
73 tst r8, #1 << 23 @ Check U bit
74 subne r7, r7, r6, lsl #2 @ Undo increment
75 addeq r7, r7, r6, lsl #2 @ Undo decrement
76 str r7, [sp, r5, lsr #14] @ Put register 'Rn'
77 mov pc, lr
78
79.data_arm_lateldrhpre:
80 tst r8, #1 << 21 @ Check writeback bit
81 moveq pc, lr @ No writeback -> no fixup
82.data_arm_lateldrhpost:
83 and r5, r8, #0x00f @ get Rm / low nibble of immediate value
84 tst r8, #1 << 22 @ if (immediate offset)
85 andne r6, r8, #0xf00 @ { immediate high nibble
86 orrne r6, r5, r6, lsr #4 @ combine nibbles } else
87 ldreq r6, [sp, r5, lsl #2] @ { load Rm value }
88.data_arm_apply_r6_and_rn:
89 and r5, r8, #15 << 16 @ Extract 'n' from instruction
90 ldr r7, [sp, r5, lsr #14] @ Get register 'Rn'
91 tst r8, #1 << 23 @ Check U bit
92 subne r7, r7, r6 @ Undo incrmenet
93 addeq r7, r7, r6 @ Undo decrement
94 str r7, [sp, r5, lsr #14] @ Put register 'Rn'
95 mov pc, lr
96
97.data_arm_lateldrpreconst:
98 tst r8, #1 << 21 @ check writeback bit
99 moveq pc, lr @ no writeback -> no fixup
100.data_arm_lateldrpostconst:
101 movs r2, r8, lsl #20 @ Get offset
102 moveq pc, lr @ zero -> no fixup
103 and r5, r8, #15 << 16 @ Extract 'n' from instruction
104 ldr r7, [sp, r5, lsr #14] @ Get register 'Rn'
105 tst r8, #1 << 23 @ Check U bit
106 subne r7, r7, r2, lsr #20 @ Undo increment
107 addeq r7, r7, r2, lsr #20 @ Undo decrement
108 str r7, [sp, r5, lsr #14] @ Put register 'Rn'
109 mov pc, lr
110
111.data_arm_lateldrprereg:
112 tst r8, #1 << 21 @ check writeback bit
113 moveq pc, lr @ no writeback -> no fixup
114.data_arm_lateldrpostreg:
115 and r7, r8, #15 @ Extract 'm' from instruction
116 ldr r6, [sp, r7, lsl #2] @ Get register 'Rm'
117 mov r5, r8, lsr #7 @ get shift count
118 ands r5, r5, #31
119 and r7, r8, #0x70 @ get shift type
120 orreq r7, r7, #8 @ shift count = 0
121 add pc, pc, r7
122 nop
123
124 mov r6, r6, lsl r5 @ 0: LSL #!0
125 b .data_arm_apply_r6_and_rn
126 b .data_arm_apply_r6_and_rn @ 1: LSL #0
127 nop
128 b .data_unknown @ 2: MUL?
129 nop
130 b .data_unknown @ 3: MUL?
131 nop
132 mov r6, r6, lsr r5 @ 4: LSR #!0
133 b .data_arm_apply_r6_and_rn
134 mov r6, r6, lsr #32 @ 5: LSR #32
135 b .data_arm_apply_r6_and_rn
136 b .data_unknown @ 6: MUL?
137 nop
138 b .data_unknown @ 7: MUL?
139 nop
140 mov r6, r6, asr r5 @ 8: ASR #!0
141 b .data_arm_apply_r6_and_rn
142 mov r6, r6, asr #32 @ 9: ASR #32
143 b .data_arm_apply_r6_and_rn
144 b .data_unknown @ A: MUL?
145 nop
146 b .data_unknown @ B: MUL?
147 nop
148 mov r6, r6, ror r5 @ C: ROR #!0
149 b .data_arm_apply_r6_and_rn
150 mov r6, r6, rrx @ D: RRX
151 b .data_arm_apply_r6_and_rn
152 b .data_unknown @ E: MUL?
153 nop
154 b .data_unknown @ F: MUL?
155
156.data_thumb_abort:
157 ldrh r8, [r2] @ read instruction
158 tst r8, #1 << 11 @ L = 1 -> write?
159 orreq r1, r1, #1 << 8 @ yes
160 and r7, r8, #15 << 12
161 add pc, pc, r7, lsr #10 @ lookup in table
162 nop
163
164/* 0 */ b .data_unknown
165/* 1 */ b .data_unknown
166/* 2 */ b .data_unknown
167/* 3 */ b .data_unknown
168/* 4 */ b .data_unknown
169/* 5 */ b .data_thumb_reg
170/* 6 */ mov pc, lr
171/* 7 */ mov pc, lr
172/* 8 */ mov pc, lr
173/* 9 */ mov pc, lr
174/* A */ b .data_unknown
175/* B */ b .data_thumb_pushpop
176/* C */ b .data_thumb_ldmstm
177/* D */ b .data_unknown
178/* E */ b .data_unknown
179/* F */ b .data_unknown
180
181.data_thumb_reg:
182 tst r8, #1 << 9
183 moveq pc, lr
184 tst r8, #1 << 10 @ If 'S' (signed) bit is set
185 movne r1, #0 @ it must be a load instr
186 mov pc, lr
187
188.data_thumb_pushpop:
189 tst r8, #1 << 10
190 beq .data_unknown
191 and r6, r8, #0x55 @ hweight8(r8) + R bit
192 and r2, r8, #0xaa
193 add r6, r6, r2, lsr #1
194 and r2, r6, #0xcc
195 and r6, r6, #0x33
196 add r6, r6, r2, lsr #2
197 movs r7, r8, lsr #9 @ C = r8 bit 8 (R bit)
198 adc r6, r6, r6, lsr #4 @ high + low nibble + R bit
199 and r6, r6, #15 @ number of regs to transfer
200 ldr r7, [sp, #13 << 2]
201 tst r8, #1 << 11
202 addeq r7, r7, r6, lsl #2 @ increment SP if PUSH
203 subne r7, r7, r6, lsl #2 @ decrement SP if POP
204 str r7, [sp, #13 << 2]
205 mov pc, lr
206
207.data_thumb_ldmstm:
208 and r6, r8, #0x55 @ hweight8(r8)
209 and r2, r8, #0xaa
210 add r6, r6, r2, lsr #1
211 and r2, r6, #0xcc
212 and r6, r6, #0x33
213 add r6, r6, r2, lsr #2
214 add r6, r6, r6, lsr #4
215 and r5, r8, #7 << 8
216 ldr r7, [sp, r5, lsr #6]
217 and r6, r6, #15 @ number of regs to transfer
218 sub r7, r7, r6, lsl #2 @ always decrement
219 str r7, [sp, r5, lsr #6]
220 mov pc, lr
diff --git a/arch/arm/mm/abort-macro.S b/arch/arm/mm/abort-macro.S
new file mode 100644
index 000000000000..d7cb1bfa51a4
--- /dev/null
+++ b/arch/arm/mm/abort-macro.S
@@ -0,0 +1,42 @@
1/*
2 * The ARM LDRD and Thumb LDRSB instructions use bit 20/11 (ARM/Thumb)
3 * differently than every other instruction, so it is set to 0 (write)
4 * even though the instructions are read instructions. This means that
5 * during an abort the instructions will be treated as a write and the
6 * handler will raise a signal from unwriteable locations if they
7 * fault. We have to specifically check for these instructions
8 * from the abort handlers to treat them properly.
9 *
10 */
11
12 .macro do_thumb_abort
13 tst r3, #PSR_T_BIT
14 beq not_thumb
15 ldrh r3, [r2] @ Read aborted Thumb instruction
16 and r3, r3, # 0xfe00 @ Mask opcode field
17 cmp r3, # 0x5600 @ Is it ldrsb?
18 orreq r3, r3, #1 << 11 @ Set L-bit if yes
19 tst r3, #1 << 11 @ L = 0 -> write
20 orreq r1, r1, #1 << 11 @ yes.
21 mov pc, lr
22not_thumb:
23 .endm
24
25/*
26 * We check for the following insturction encoding for LDRD.
27 *
28 * [27:25] == 0
29 * [7:4] == 1101
30 * [20] == 0
31 */
32 .macro do_ldrd_abort
33 tst r3, #0x0e000000 @ [27:25] == 0
34 bne not_ldrd
35 and r2, r3, #0x000000f0 @ [7:4] == 1101
36 cmp r2, #0x000000d0
37 bne not_ldrd
38 tst r3, #1 << 20 @ [20] == 0
39 moveq pc, lr
40not_ldrd:
41 .endm
42
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
new file mode 100644
index 000000000000..81f4a8a2d34b
--- /dev/null
+++ b/arch/arm/mm/alignment.c
@@ -0,0 +1,756 @@
1/*
2 * linux/arch/arm/mm/alignment.c
3 *
4 * Copyright (C) 1995 Linus Torvalds
5 * Modifications for ARM processor (c) 1995-2001 Russell King
6 * Thumb aligment fault fixups (c) 2004 MontaVista Software, Inc.
7 * - Adapted from gdb/sim/arm/thumbemu.c -- Thumb instruction emulation.
8 * Copyright (C) 1996, Cygnus Software Technologies Ltd.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14#include <linux/config.h>
15#include <linux/compiler.h>
16#include <linux/kernel.h>
17#include <linux/errno.h>
18#include <linux/string.h>
19#include <linux/ptrace.h>
20#include <linux/proc_fs.h>
21#include <linux/init.h>
22
23#include <asm/uaccess.h>
24#include <asm/unaligned.h>
25
26#include "fault.h"
27
28/*
29 * 32-bit misaligned trap handler (c) 1998 San Mehat (CCC) -July 1998
30 * /proc/sys/debug/alignment, modified and integrated into
31 * Linux 2.1 by Russell King
32 *
33 * Speed optimisations and better fault handling by Russell King.
34 *
35 * *** NOTE ***
36 * This code is not portable to processors with late data abort handling.
37 */
38#define CODING_BITS(i) (i & 0x0e000000)
39
40#define LDST_I_BIT(i) (i & (1 << 26)) /* Immediate constant */
41#define LDST_P_BIT(i) (i & (1 << 24)) /* Preindex */
42#define LDST_U_BIT(i) (i & (1 << 23)) /* Add offset */
43#define LDST_W_BIT(i) (i & (1 << 21)) /* Writeback */
44#define LDST_L_BIT(i) (i & (1 << 20)) /* Load */
45
46#define LDST_P_EQ_U(i) ((((i) ^ ((i) >> 1)) & (1 << 23)) == 0)
47
48#define LDSTH_I_BIT(i) (i & (1 << 22)) /* half-word immed */
49#define LDM_S_BIT(i) (i & (1 << 22)) /* write CPSR from SPSR */
50
51#define RN_BITS(i) ((i >> 16) & 15) /* Rn */
52#define RD_BITS(i) ((i >> 12) & 15) /* Rd */
53#define RM_BITS(i) (i & 15) /* Rm */
54
55#define REGMASK_BITS(i) (i & 0xffff)
56#define OFFSET_BITS(i) (i & 0x0fff)
57
58#define IS_SHIFT(i) (i & 0x0ff0)
59#define SHIFT_BITS(i) ((i >> 7) & 0x1f)
60#define SHIFT_TYPE(i) (i & 0x60)
61#define SHIFT_LSL 0x00
62#define SHIFT_LSR 0x20
63#define SHIFT_ASR 0x40
64#define SHIFT_RORRRX 0x60
65
66static unsigned long ai_user;
67static unsigned long ai_sys;
68static unsigned long ai_skipped;
69static unsigned long ai_half;
70static unsigned long ai_word;
71static unsigned long ai_multi;
72static int ai_usermode;
73
74#ifdef CONFIG_PROC_FS
75static const char *usermode_action[] = {
76 "ignored",
77 "warn",
78 "fixup",
79 "fixup+warn",
80 "signal",
81 "signal+warn"
82};
83
84static int
85proc_alignment_read(char *page, char **start, off_t off, int count, int *eof,
86 void *data)
87{
88 char *p = page;
89 int len;
90
91 p += sprintf(p, "User:\t\t%lu\n", ai_user);
92 p += sprintf(p, "System:\t\t%lu\n", ai_sys);
93 p += sprintf(p, "Skipped:\t%lu\n", ai_skipped);
94 p += sprintf(p, "Half:\t\t%lu\n", ai_half);
95 p += sprintf(p, "Word:\t\t%lu\n", ai_word);
96 p += sprintf(p, "Multi:\t\t%lu\n", ai_multi);
97 p += sprintf(p, "User faults:\t%i (%s)\n", ai_usermode,
98 usermode_action[ai_usermode]);
99
100 len = (p - page) - off;
101 if (len < 0)
102 len = 0;
103
104 *eof = (len <= count) ? 1 : 0;
105 *start = page + off;
106
107 return len;
108}
109
110static int proc_alignment_write(struct file *file, const char __user *buffer,
111 unsigned long count, void *data)
112{
113 char mode;
114
115 if (count > 0) {
116 if (get_user(mode, buffer))
117 return -EFAULT;
118 if (mode >= '0' && mode <= '5')
119 ai_usermode = mode - '0';
120 }
121 return count;
122}
123
124#endif /* CONFIG_PROC_FS */
125
126union offset_union {
127 unsigned long un;
128 signed long sn;
129};
130
131#define TYPE_ERROR 0
132#define TYPE_FAULT 1
133#define TYPE_LDST 2
134#define TYPE_DONE 3
135
136#ifdef __ARMEB__
137#define BE 1
138#define FIRST_BYTE_16 "mov %1, %1, ror #8\n"
139#define FIRST_BYTE_32 "mov %1, %1, ror #24\n"
140#define NEXT_BYTE "ror #24"
141#else
142#define BE 0
143#define FIRST_BYTE_16
144#define FIRST_BYTE_32
145#define NEXT_BYTE "lsr #8"
146#endif
147
148#define __get8_unaligned_check(ins,val,addr,err) \
149 __asm__( \
150 "1: "ins" %1, [%2], #1\n" \
151 "2:\n" \
152 " .section .fixup,\"ax\"\n" \
153 " .align 2\n" \
154 "3: mov %0, #1\n" \
155 " b 2b\n" \
156 " .previous\n" \
157 " .section __ex_table,\"a\"\n" \
158 " .align 3\n" \
159 " .long 1b, 3b\n" \
160 " .previous\n" \
161 : "=r" (err), "=&r" (val), "=r" (addr) \
162 : "0" (err), "2" (addr))
163
164#define __get16_unaligned_check(ins,val,addr) \
165 do { \
166 unsigned int err = 0, v, a = addr; \
167 __get8_unaligned_check(ins,v,a,err); \
168 val = v << ((BE) ? 8 : 0); \
169 __get8_unaligned_check(ins,v,a,err); \
170 val |= v << ((BE) ? 0 : 8); \
171 if (err) \
172 goto fault; \
173 } while (0)
174
175#define get16_unaligned_check(val,addr) \
176 __get16_unaligned_check("ldrb",val,addr)
177
178#define get16t_unaligned_check(val,addr) \
179 __get16_unaligned_check("ldrbt",val,addr)
180
181#define __get32_unaligned_check(ins,val,addr) \
182 do { \
183 unsigned int err = 0, v, a = addr; \
184 __get8_unaligned_check(ins,v,a,err); \
185 val = v << ((BE) ? 24 : 0); \
186 __get8_unaligned_check(ins,v,a,err); \
187 val |= v << ((BE) ? 16 : 8); \
188 __get8_unaligned_check(ins,v,a,err); \
189 val |= v << ((BE) ? 8 : 16); \
190 __get8_unaligned_check(ins,v,a,err); \
191 val |= v << ((BE) ? 0 : 24); \
192 if (err) \
193 goto fault; \
194 } while (0)
195
196#define get32_unaligned_check(val,addr) \
197 __get32_unaligned_check("ldrb",val,addr)
198
199#define get32t_unaligned_check(val,addr) \
200 __get32_unaligned_check("ldrbt",val,addr)
201
202#define __put16_unaligned_check(ins,val,addr) \
203 do { \
204 unsigned int err = 0, v = val, a = addr; \
205 __asm__( FIRST_BYTE_16 \
206 "1: "ins" %1, [%2], #1\n" \
207 " mov %1, %1, "NEXT_BYTE"\n" \
208 "2: "ins" %1, [%2]\n" \
209 "3:\n" \
210 " .section .fixup,\"ax\"\n" \
211 " .align 2\n" \
212 "4: mov %0, #1\n" \
213 " b 3b\n" \
214 " .previous\n" \
215 " .section __ex_table,\"a\"\n" \
216 " .align 3\n" \
217 " .long 1b, 4b\n" \
218 " .long 2b, 4b\n" \
219 " .previous\n" \
220 : "=r" (err), "=&r" (v), "=&r" (a) \
221 : "0" (err), "1" (v), "2" (a)); \
222 if (err) \
223 goto fault; \
224 } while (0)
225
226#define put16_unaligned_check(val,addr) \
227 __put16_unaligned_check("strb",val,addr)
228
229#define put16t_unaligned_check(val,addr) \
230 __put16_unaligned_check("strbt",val,addr)
231
232#define __put32_unaligned_check(ins,val,addr) \
233 do { \
234 unsigned int err = 0, v = val, a = addr; \
235 __asm__( FIRST_BYTE_32 \
236 "1: "ins" %1, [%2], #1\n" \
237 " mov %1, %1, "NEXT_BYTE"\n" \
238 "2: "ins" %1, [%2], #1\n" \
239 " mov %1, %1, "NEXT_BYTE"\n" \
240 "3: "ins" %1, [%2], #1\n" \
241 " mov %1, %1, "NEXT_BYTE"\n" \
242 "4: "ins" %1, [%2]\n" \
243 "5:\n" \
244 " .section .fixup,\"ax\"\n" \
245 " .align 2\n" \
246 "6: mov %0, #1\n" \
247 " b 5b\n" \
248 " .previous\n" \
249 " .section __ex_table,\"a\"\n" \
250 " .align 3\n" \
251 " .long 1b, 6b\n" \
252 " .long 2b, 6b\n" \
253 " .long 3b, 6b\n" \
254 " .long 4b, 6b\n" \
255 " .previous\n" \
256 : "=r" (err), "=&r" (v), "=&r" (a) \
257 : "0" (err), "1" (v), "2" (a)); \
258 if (err) \
259 goto fault; \
260 } while (0)
261
262#define put32_unaligned_check(val,addr) \
263 __put32_unaligned_check("strb", val, addr)
264
265#define put32t_unaligned_check(val,addr) \
266 __put32_unaligned_check("strbt", val, addr)
267
268static void
269do_alignment_finish_ldst(unsigned long addr, unsigned long instr, struct pt_regs *regs, union offset_union offset)
270{
271 if (!LDST_U_BIT(instr))
272 offset.un = -offset.un;
273
274 if (!LDST_P_BIT(instr))
275 addr += offset.un;
276
277 if (!LDST_P_BIT(instr) || LDST_W_BIT(instr))
278 regs->uregs[RN_BITS(instr)] = addr;
279}
280
281static int
282do_alignment_ldrhstrh(unsigned long addr, unsigned long instr, struct pt_regs *regs)
283{
284 unsigned int rd = RD_BITS(instr);
285
286 if ((instr & 0x01f00ff0) == 0x01000090)
287 goto swp;
288
289 if ((instr & 0x90) != 0x90 || (instr & 0x60) == 0)
290 goto bad;
291
292 ai_half += 1;
293
294 if (user_mode(regs))
295 goto user;
296
297 if (LDST_L_BIT(instr)) {
298 unsigned long val;
299 get16_unaligned_check(val, addr);
300
301 /* signed half-word? */
302 if (instr & 0x40)
303 val = (signed long)((signed short) val);
304
305 regs->uregs[rd] = val;
306 } else
307 put16_unaligned_check(regs->uregs[rd], addr);
308
309 return TYPE_LDST;
310
311 user:
312 if (LDST_L_BIT(instr)) {
313 unsigned long val;
314 get16t_unaligned_check(val, addr);
315
316 /* signed half-word? */
317 if (instr & 0x40)
318 val = (signed long)((signed short) val);
319
320 regs->uregs[rd] = val;
321 } else
322 put16t_unaligned_check(regs->uregs[rd], addr);
323
324 return TYPE_LDST;
325
326 swp:
327 printk(KERN_ERR "Alignment trap: not handling swp instruction\n");
328 bad:
329 return TYPE_ERROR;
330
331 fault:
332 return TYPE_FAULT;
333}
334
335static int
336do_alignment_ldrstr(unsigned long addr, unsigned long instr, struct pt_regs *regs)
337{
338 unsigned int rd = RD_BITS(instr);
339
340 ai_word += 1;
341
342 if ((!LDST_P_BIT(instr) && LDST_W_BIT(instr)) || user_mode(regs))
343 goto trans;
344
345 if (LDST_L_BIT(instr)) {
346 unsigned int val;
347 get32_unaligned_check(val, addr);
348 regs->uregs[rd] = val;
349 } else
350 put32_unaligned_check(regs->uregs[rd], addr);
351 return TYPE_LDST;
352
353 trans:
354 if (LDST_L_BIT(instr)) {
355 unsigned int val;
356 get32t_unaligned_check(val, addr);
357 regs->uregs[rd] = val;
358 } else
359 put32t_unaligned_check(regs->uregs[rd], addr);
360 return TYPE_LDST;
361
362 fault:
363 return TYPE_FAULT;
364}
365
366/*
367 * LDM/STM alignment handler.
368 *
369 * There are 4 variants of this instruction:
370 *
371 * B = rn pointer before instruction, A = rn pointer after instruction
372 * ------ increasing address ----->
373 * | | r0 | r1 | ... | rx | |
374 * PU = 01 B A
375 * PU = 11 B A
376 * PU = 00 A B
377 * PU = 10 A B
378 */
379static int
380do_alignment_ldmstm(unsigned long addr, unsigned long instr, struct pt_regs *regs)
381{
382 unsigned int rd, rn, correction, nr_regs, regbits;
383 unsigned long eaddr, newaddr;
384
385 if (LDM_S_BIT(instr))
386 goto bad;
387
388 correction = 4; /* processor implementation defined */
389 regs->ARM_pc += correction;
390
391 ai_multi += 1;
392
393 /* count the number of registers in the mask to be transferred */
394 nr_regs = hweight16(REGMASK_BITS(instr)) * 4;
395
396 rn = RN_BITS(instr);
397 newaddr = eaddr = regs->uregs[rn];
398
399 if (!LDST_U_BIT(instr))
400 nr_regs = -nr_regs;
401 newaddr += nr_regs;
402 if (!LDST_U_BIT(instr))
403 eaddr = newaddr;
404
405 if (LDST_P_EQ_U(instr)) /* U = P */
406 eaddr += 4;
407
408 /*
409 * For alignment faults on the ARM922T/ARM920T the MMU makes
410 * the FSR (and hence addr) equal to the updated base address
411 * of the multiple access rather than the restored value.
412 * Switch this message off if we've got a ARM92[02], otherwise
413 * [ls]dm alignment faults are noisy!
414 */
415#if !(defined CONFIG_CPU_ARM922T) && !(defined CONFIG_CPU_ARM920T)
416 /*
417 * This is a "hint" - we already have eaddr worked out by the
418 * processor for us.
419 */
420 if (addr != eaddr) {
421 printk(KERN_ERR "LDMSTM: PC = %08lx, instr = %08lx, "
422 "addr = %08lx, eaddr = %08lx\n",
423 instruction_pointer(regs), instr, addr, eaddr);
424 show_regs(regs);
425 }
426#endif
427
428 if (user_mode(regs)) {
429 for (regbits = REGMASK_BITS(instr), rd = 0; regbits;
430 regbits >>= 1, rd += 1)
431 if (regbits & 1) {
432 if (LDST_L_BIT(instr)) {
433 unsigned int val;
434 get32t_unaligned_check(val, eaddr);
435 regs->uregs[rd] = val;
436 } else
437 put32t_unaligned_check(regs->uregs[rd], eaddr);
438 eaddr += 4;
439 }
440 } else {
441 for (regbits = REGMASK_BITS(instr), rd = 0; regbits;
442 regbits >>= 1, rd += 1)
443 if (regbits & 1) {
444 if (LDST_L_BIT(instr)) {
445 unsigned int val;
446 get32_unaligned_check(val, eaddr);
447 regs->uregs[rd] = val;
448 } else
449 put32_unaligned_check(regs->uregs[rd], eaddr);
450 eaddr += 4;
451 }
452 }
453
454 if (LDST_W_BIT(instr))
455 regs->uregs[rn] = newaddr;
456 if (!LDST_L_BIT(instr) || !(REGMASK_BITS(instr) & (1 << 15)))
457 regs->ARM_pc -= correction;
458 return TYPE_DONE;
459
460fault:
461 regs->ARM_pc -= correction;
462 return TYPE_FAULT;
463
464bad:
465 printk(KERN_ERR "Alignment trap: not handling ldm with s-bit set\n");
466 return TYPE_ERROR;
467}
468
469/*
470 * Convert Thumb ld/st instruction forms to equivalent ARM instructions so
471 * we can reuse ARM userland alignment fault fixups for Thumb.
472 *
473 * This implementation was initially based on the algorithm found in
474 * gdb/sim/arm/thumbemu.c. It is basically just a code reduction of same
475 * to convert only Thumb ld/st instruction forms to equivalent ARM forms.
476 *
477 * NOTES:
478 * 1. Comments below refer to ARM ARM DDI0100E Thumb Instruction sections.
479 * 2. If for some reason we're passed an non-ld/st Thumb instruction to
480 * decode, we return 0xdeadc0de. This should never happen under normal
481 * circumstances but if it does, we've got other problems to deal with
482 * elsewhere and we obviously can't fix those problems here.
483 */
484
485static unsigned long
486thumb2arm(u16 tinstr)
487{
488 u32 L = (tinstr & (1<<11)) >> 11;
489
490 switch ((tinstr & 0xf800) >> 11) {
491 /* 6.5.1 Format 1: */
492 case 0x6000 >> 11: /* 7.1.52 STR(1) */
493 case 0x6800 >> 11: /* 7.1.26 LDR(1) */
494 case 0x7000 >> 11: /* 7.1.55 STRB(1) */
495 case 0x7800 >> 11: /* 7.1.30 LDRB(1) */
496 return 0xe5800000 |
497 ((tinstr & (1<<12)) << (22-12)) | /* fixup */
498 (L<<20) | /* L==1? */
499 ((tinstr & (7<<0)) << (12-0)) | /* Rd */
500 ((tinstr & (7<<3)) << (16-3)) | /* Rn */
501 ((tinstr & (31<<6)) >> /* immed_5 */
502 (6 - ((tinstr & (1<<12)) ? 0 : 2)));
503 case 0x8000 >> 11: /* 7.1.57 STRH(1) */
504 case 0x8800 >> 11: /* 7.1.32 LDRH(1) */
505 return 0xe1c000b0 |
506 (L<<20) | /* L==1? */
507 ((tinstr & (7<<0)) << (12-0)) | /* Rd */
508 ((tinstr & (7<<3)) << (16-3)) | /* Rn */
509 ((tinstr & (7<<6)) >> (6-1)) | /* immed_5[2:0] */
510 ((tinstr & (3<<9)) >> (9-8)); /* immed_5[4:3] */
511
512 /* 6.5.1 Format 2: */
513 case 0x5000 >> 11:
514 case 0x5800 >> 11:
515 {
516 static const u32 subset[8] = {
517 0xe7800000, /* 7.1.53 STR(2) */
518 0xe18000b0, /* 7.1.58 STRH(2) */
519 0xe7c00000, /* 7.1.56 STRB(2) */
520 0xe19000d0, /* 7.1.34 LDRSB */
521 0xe7900000, /* 7.1.27 LDR(2) */
522 0xe19000b0, /* 7.1.33 LDRH(2) */
523 0xe7d00000, /* 7.1.31 LDRB(2) */
524 0xe19000f0 /* 7.1.35 LDRSH */
525 };
526 return subset[(tinstr & (7<<9)) >> 9] |
527 ((tinstr & (7<<0)) << (12-0)) | /* Rd */
528 ((tinstr & (7<<3)) << (16-3)) | /* Rn */
529 ((tinstr & (7<<6)) >> (6-0)); /* Rm */
530 }
531
532 /* 6.5.1 Format 3: */
533 case 0x4800 >> 11: /* 7.1.28 LDR(3) */
534 /* NOTE: This case is not technically possible. We're
535 * loading 32-bit memory data via PC relative
536 * addressing mode. So we can and should eliminate
537 * this case. But I'll leave it here for now.
538 */
539 return 0xe59f0000 |
540 ((tinstr & (7<<8)) << (12-8)) | /* Rd */
541 ((tinstr & 255) << (2-0)); /* immed_8 */
542
543 /* 6.5.1 Format 4: */
544 case 0x9000 >> 11: /* 7.1.54 STR(3) */
545 case 0x9800 >> 11: /* 7.1.29 LDR(4) */
546 return 0xe58d0000 |
547 (L<<20) | /* L==1? */
548 ((tinstr & (7<<8)) << (12-8)) | /* Rd */
549 ((tinstr & 255) << 2); /* immed_8 */
550
551 /* 6.6.1 Format 1: */
552 case 0xc000 >> 11: /* 7.1.51 STMIA */
553 case 0xc800 >> 11: /* 7.1.25 LDMIA */
554 {
555 u32 Rn = (tinstr & (7<<8)) >> 8;
556 u32 W = ((L<<Rn) & (tinstr&255)) ? 0 : 1<<21;
557
558 return 0xe8800000 | W | (L<<20) | (Rn<<16) |
559 (tinstr&255);
560 }
561
562 /* 6.6.1 Format 2: */
563 case 0xb000 >> 11: /* 7.1.48 PUSH */
564 case 0xb800 >> 11: /* 7.1.47 POP */
565 if ((tinstr & (3 << 9)) == 0x0400) {
566 static const u32 subset[4] = {
567 0xe92d0000, /* STMDB sp!,{registers} */
568 0xe92d4000, /* STMDB sp!,{registers,lr} */
569 0xe8bd0000, /* LDMIA sp!,{registers} */
570 0xe8bd8000 /* LDMIA sp!,{registers,pc} */
571 };
572 return subset[(L<<1) | ((tinstr & (1<<8)) >> 8)] |
573 (tinstr & 255); /* register_list */
574 }
575 /* Else fall through for illegal instruction case */
576
577 default:
578 return 0xdeadc0de;
579 }
580}
581
582static int
583do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
584{
585 union offset_union offset;
586 unsigned long instr = 0, instrptr;
587 int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs);
588 unsigned int type;
589 mm_segment_t fs;
590 unsigned int fault;
591 u16 tinstr = 0;
592
593 instrptr = instruction_pointer(regs);
594
595 fs = get_fs();
596 set_fs(KERNEL_DS);
597 if thumb_mode(regs) {
598 fault = __get_user(tinstr, (u16 *)(instrptr & ~1));
599 if (!(fault))
600 instr = thumb2arm(tinstr);
601 } else
602 fault = __get_user(instr, (u32 *)instrptr);
603 set_fs(fs);
604
605 if (fault) {
606 type = TYPE_FAULT;
607 goto bad_or_fault;
608 }
609
610 if (user_mode(regs))
611 goto user;
612
613 ai_sys += 1;
614
615 fixup:
616
617 regs->ARM_pc += thumb_mode(regs) ? 2 : 4;
618
619 switch (CODING_BITS(instr)) {
620 case 0x00000000: /* ldrh or strh */
621 if (LDSTH_I_BIT(instr))
622 offset.un = (instr & 0xf00) >> 4 | (instr & 15);
623 else
624 offset.un = regs->uregs[RM_BITS(instr)];
625 handler = do_alignment_ldrhstrh;
626 break;
627
628 case 0x04000000: /* ldr or str immediate */
629 offset.un = OFFSET_BITS(instr);
630 handler = do_alignment_ldrstr;
631 break;
632
633 case 0x06000000: /* ldr or str register */
634 offset.un = regs->uregs[RM_BITS(instr)];
635
636 if (IS_SHIFT(instr)) {
637 unsigned int shiftval = SHIFT_BITS(instr);
638
639 switch(SHIFT_TYPE(instr)) {
640 case SHIFT_LSL:
641 offset.un <<= shiftval;
642 break;
643
644 case SHIFT_LSR:
645 offset.un >>= shiftval;
646 break;
647
648 case SHIFT_ASR:
649 offset.sn >>= shiftval;
650 break;
651
652 case SHIFT_RORRRX:
653 if (shiftval == 0) {
654 offset.un >>= 1;
655 if (regs->ARM_cpsr & PSR_C_BIT)
656 offset.un |= 1 << 31;
657 } else
658 offset.un = offset.un >> shiftval |
659 offset.un << (32 - shiftval);
660 break;
661 }
662 }
663 handler = do_alignment_ldrstr;
664 break;
665
666 case 0x08000000: /* ldm or stm */
667 handler = do_alignment_ldmstm;
668 break;
669
670 default:
671 goto bad;
672 }
673
674 type = handler(addr, instr, regs);
675
676 if (type == TYPE_ERROR || type == TYPE_FAULT)
677 goto bad_or_fault;
678
679 if (type == TYPE_LDST)
680 do_alignment_finish_ldst(addr, instr, regs, offset);
681
682 return 0;
683
684 bad_or_fault:
685 if (type == TYPE_ERROR)
686 goto bad;
687 regs->ARM_pc -= thumb_mode(regs) ? 2 : 4;
688 /*
689 * We got a fault - fix it up, or die.
690 */
691 do_bad_area(current, current->mm, addr, fsr, regs);
692 return 0;
693
694 bad:
695 /*
696 * Oops, we didn't handle the instruction.
697 */
698 printk(KERN_ERR "Alignment trap: not handling instruction "
699 "%0*lx at [<%08lx>]\n",
700 thumb_mode(regs) ? 4 : 8,
701 thumb_mode(regs) ? tinstr : instr, instrptr);
702 ai_skipped += 1;
703 return 1;
704
705 user:
706 ai_user += 1;
707
708 if (ai_usermode & 1)
709 printk("Alignment trap: %s (%d) PC=0x%08lx Instr=0x%0*lx "
710 "Address=0x%08lx FSR 0x%03x\n", current->comm,
711 current->pid, instrptr,
712 thumb_mode(regs) ? 4 : 8,
713 thumb_mode(regs) ? tinstr : instr,
714 addr, fsr);
715
716 if (ai_usermode & 2)
717 goto fixup;
718
719 if (ai_usermode & 4)
720 force_sig(SIGBUS, current);
721 else
722 set_cr(cr_no_alignment);
723
724 return 0;
725}
726
727/*
728 * This needs to be done after sysctl_init, otherwise sys/ will be
729 * overwritten. Actually, this shouldn't be in sys/ at all since
730 * it isn't a sysctl, and it doesn't contain sysctl information.
731 * We now locate it in /proc/cpu/alignment instead.
732 */
733static int __init alignment_init(void)
734{
735#ifdef CONFIG_PROC_FS
736 struct proc_dir_entry *res;
737
738 res = proc_mkdir("cpu", NULL);
739 if (!res)
740 return -ENOMEM;
741
742 res = create_proc_entry("alignment", S_IWUSR | S_IRUGO, res);
743 if (!res)
744 return -ENOMEM;
745
746 res->read_proc = proc_alignment_read;
747 res->write_proc = proc_alignment_write;
748#endif
749
750 hook_fault_code(1, do_alignment, SIGILL, "alignment exception");
751 hook_fault_code(3, do_alignment, SIGILL, "alignment exception");
752
753 return 0;
754}
755
756fs_initcall(alignment_init);
diff --git a/arch/arm/mm/blockops.c b/arch/arm/mm/blockops.c
new file mode 100644
index 000000000000..806c6eeb1b0c
--- /dev/null
+++ b/arch/arm/mm/blockops.c
@@ -0,0 +1,184 @@
1#include <linux/kernel.h>
2#include <linux/init.h>
3#include <linux/errno.h>
4#include <linux/mm.h>
5
6#include <asm/memory.h>
7#include <asm/ptrace.h>
8#include <asm/cacheflush.h>
9#include <asm/traps.h>
10
11extern struct cpu_cache_fns blk_cache_fns;
12
13#define HARVARD_CACHE
14
15/*
16 * blk_flush_kern_dcache_page(kaddr)
17 *
18 * Ensure that the data held in the page kaddr is written back
19 * to the page in question.
20 *
21 * - kaddr - kernel address (guaranteed to be page aligned)
22 */
23static void __attribute__((naked))
24blk_flush_kern_dcache_page(void *kaddr)
25{
26 asm(
27 "add r1, r0, %0 \n\
281: .word 0xec401f0e @ mcrr p15, 0, r0, r1, c14, 0 @ blocking \n\
29 mov r0, #0 \n\
30 mcr p15, 0, r0, c7, c5, 0 \n\
31 mcr p15, 0, r0, c7, c10, 4 \n\
32 mov pc, lr"
33 :
34 : "I" (PAGE_SIZE));
35}
36
37/*
38 * blk_dma_inv_range(start,end)
39 *
40 * Invalidate the data cache within the specified region; we will
41 * be performing a DMA operation in this region and we want to
42 * purge old data in the cache.
43 *
44 * - start - virtual start address of region
45 * - end - virtual end address of region
46 */
47static void __attribute__((naked))
48blk_dma_inv_range_unified(unsigned long start, unsigned long end)
49{
50 asm(
51 "tst r0, %0 \n\
52 mcrne p15, 0, r0, c7, c11, 1 @ clean unified line \n\
53 tst r1, %0 \n\
54 mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line\n\
55 .word 0xec401f06 @ mcrr p15, 0, r1, r0, c6, 0 @ blocking \n\
56 mov r0, #0 \n\
57 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer \n\
58 mov pc, lr"
59 :
60 : "I" (L1_CACHE_BYTES - 1));
61}
62
63static void __attribute__((naked))
64blk_dma_inv_range_harvard(unsigned long start, unsigned long end)
65{
66 asm(
67 "tst r0, %0 \n\
68 mcrne p15, 0, r0, c7, c10, 1 @ clean D line \n\
69 tst r1, %0 \n\
70 mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D line \n\
71 .word 0xec401f06 @ mcrr p15, 0, r1, r0, c6, 0 @ blocking \n\
72 mov r0, #0 \n\
73 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer \n\
74 mov pc, lr"
75 :
76 : "I" (L1_CACHE_BYTES - 1));
77}
78
79/*
80 * blk_dma_clean_range(start,end)
81 * - start - virtual start address of region
82 * - end - virtual end address of region
83 */
84static void __attribute__((naked))
85blk_dma_clean_range(unsigned long start, unsigned long end)
86{
87 asm(
88 ".word 0xec401f0c @ mcrr p15, 0, r1, r0, c12, 0 @ blocking \n\
89 mov r0, #0 \n\
90 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer \n\
91 mov pc, lr");
92}
93
94/*
95 * blk_dma_flush_range(start,end)
96 * - start - virtual start address of region
97 * - end - virtual end address of region
98 */
99static void __attribute__((naked))
100blk_dma_flush_range(unsigned long start, unsigned long end)
101{
102 asm(
103 ".word 0xec401f0e @ mcrr p15, 0, r1, r0, c14, 0 @ blocking \n\
104 mov pc, lr");
105}
106
107static int blockops_trap(struct pt_regs *regs, unsigned int instr)
108{
109 regs->ARM_r4 |= regs->ARM_r2;
110 regs->ARM_pc += 4;
111 return 0;
112}
113
114static char *func[] = {
115 "Prefetch data range",
116 "Clean+Invalidate data range",
117 "Clean data range",
118 "Invalidate data range",
119 "Invalidate instr range"
120};
121
122static struct undef_hook blockops_hook __initdata = {
123 .instr_mask = 0x0fffffd0,
124 .instr_val = 0x0c401f00,
125 .cpsr_mask = PSR_T_BIT,
126 .cpsr_val = 0,
127 .fn = blockops_trap,
128};
129
130static int __init blockops_check(void)
131{
132 register unsigned int err asm("r4") = 0;
133 unsigned int err_pos = 1;
134 unsigned int cache_type;
135 int i;
136
137 asm("mrc p15, 0, %0, c0, c0, 1" : "=r" (cache_type));
138
139 printk("Checking V6 block cache operations:\n");
140 register_undef_hook(&blockops_hook);
141
142 __asm__ ("mov r0, %0\n\t"
143 "mov r1, %1\n\t"
144 "mov r2, #1\n\t"
145 ".word 0xec401f2c @ mcrr p15, 0, r1, r0, c12, 2\n\t"
146 "mov r2, #2\n\t"
147 ".word 0xec401f0e @ mcrr p15, 0, r1, r0, c14, 0\n\t"
148 "mov r2, #4\n\t"
149 ".word 0xec401f0c @ mcrr p15, 0, r1, r0, c12, 0\n\t"
150 "mov r2, #8\n\t"
151 ".word 0xec401f06 @ mcrr p15, 0, r1, r0, c6, 0\n\t"
152 "mov r2, #16\n\t"
153 ".word 0xec401f05 @ mcrr p15, 0, r1, r0, c5, 0\n\t"
154 :
155 : "r" (PAGE_OFFSET), "r" (PAGE_OFFSET + 128)
156 : "r0", "r1", "r2");
157
158 unregister_undef_hook(&blockops_hook);
159
160 for (i = 0; i < ARRAY_SIZE(func); i++, err_pos <<= 1)
161 printk("%30s: %ssupported\n", func[i], err & err_pos ? "not " : "");
162
163 if ((err & 8) == 0) {
164 printk(" --> Using %s block cache invalidate\n",
165 cache_type & (1 << 24) ? "harvard" : "unified");
166 if (cache_type & (1 << 24))
167 cpu_cache.dma_inv_range = blk_dma_inv_range_harvard;
168 else
169 cpu_cache.dma_inv_range = blk_dma_inv_range_unified;
170 }
171 if ((err & 4) == 0) {
172 printk(" --> Using block cache clean\n");
173 cpu_cache.dma_clean_range = blk_dma_clean_range;
174 }
175 if ((err & 2) == 0) {
176 printk(" --> Using block cache clean+invalidate\n");
177 cpu_cache.dma_flush_range = blk_dma_flush_range;
178 cpu_cache.flush_kern_dcache_page = blk_flush_kern_dcache_page;
179 }
180
181 return 0;
182}
183
184__initcall(blockops_check);
diff --git a/arch/arm/mm/cache-v3.S b/arch/arm/mm/cache-v3.S
new file mode 100644
index 000000000000..e1994788cf0e
--- /dev/null
+++ b/arch/arm/mm/cache-v3.S
@@ -0,0 +1,137 @@
1/*
2 * linux/arch/arm/mm/cache-v3.S
3 *
4 * Copyright (C) 1997-2002 Russell king
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <linux/init.h>
12#include <asm/hardware.h>
13#include <asm/page.h>
14#include "proc-macros.S"
15
16/*
17 * flush_user_cache_all()
18 *
19 * Invalidate all cache entries in a particular address
20 * space.
21 *
22 * - mm - mm_struct describing address space
23 */
24ENTRY(v3_flush_user_cache_all)
25 /* FALLTHROUGH */
26/*
27 * flush_kern_cache_all()
28 *
29 * Clean and invalidate the entire cache.
30 */
31ENTRY(v3_flush_kern_cache_all)
32 /* FALLTHROUGH */
33
34/*
35 * flush_user_cache_range(start, end, flags)
36 *
37 * Invalidate a range of cache entries in the specified
38 * address space.
39 *
40 * - start - start address (may not be aligned)
41 * - end - end address (exclusive, may not be aligned)
42 * - flags - vma_area_struct flags describing address space
43 */
44ENTRY(v3_flush_user_cache_range)
45 mov ip, #0
46 mcreq p15, 0, ip, c7, c0, 0 @ flush ID cache
47 mov pc, lr
48
49/*
50 * coherent_kern_range(start, end)
51 *
52 * Ensure coherency between the Icache and the Dcache in the
53 * region described by start. If you have non-snooping
54 * Harvard caches, you need to implement this function.
55 *
56 * - start - virtual start address
57 * - end - virtual end address
58 */
59ENTRY(v3_coherent_kern_range)
60 /* FALLTHROUGH */
61
62/*
63 * coherent_user_range(start, end)
64 *
65 * Ensure coherency between the Icache and the Dcache in the
66 * region described by start. If you have non-snooping
67 * Harvard caches, you need to implement this function.
68 *
69 * - start - virtual start address
70 * - end - virtual end address
71 */
72ENTRY(v3_coherent_user_range)
73 mov pc, lr
74
75/*
76 * flush_kern_dcache_page(void *page)
77 *
78 * Ensure no D cache aliasing occurs, either with itself or
79 * the I cache
80 *
81 * - addr - page aligned address
82 */
83ENTRY(v3_flush_kern_dcache_page)
84 /* FALLTHROUGH */
85
86/*
87 * dma_inv_range(start, end)
88 *
89 * Invalidate (discard) the specified virtual address range.
90 * May not write back any entries. If 'start' or 'end'
91 * are not cache line aligned, those lines must be written
92 * back.
93 *
94 * - start - virtual start address
95 * - end - virtual end address
96 */
97ENTRY(v3_dma_inv_range)
98 /* FALLTHROUGH */
99
100/*
101 * dma_flush_range(start, end)
102 *
103 * Clean and invalidate the specified virtual address range.
104 *
105 * - start - virtual start address
106 * - end - virtual end address
107 */
108ENTRY(v3_dma_flush_range)
109 mov r0, #0
110 mcr p15, 0, r0, c7, c0, 0 @ flush ID cache
111 /* FALLTHROUGH */
112
113/*
114 * dma_clean_range(start, end)
115 *
116 * Clean (write back) the specified virtual address range.
117 *
118 * - start - virtual start address
119 * - end - virtual end address
120 */
121ENTRY(v3_dma_clean_range)
122 mov pc, lr
123
124 __INITDATA
125
126 .type v3_cache_fns, #object
127ENTRY(v3_cache_fns)
128 .long v3_flush_kern_cache_all
129 .long v3_flush_user_cache_all
130 .long v3_flush_user_cache_range
131 .long v3_coherent_kern_range
132 .long v3_coherent_user_range
133 .long v3_flush_kern_dcache_page
134 .long v3_dma_inv_range
135 .long v3_dma_clean_range
136 .long v3_dma_flush_range
137 .size v3_cache_fns, . - v3_cache_fns
diff --git a/arch/arm/mm/cache-v4.S b/arch/arm/mm/cache-v4.S
new file mode 100644
index 000000000000..b8ad5d58ebe2
--- /dev/null
+++ b/arch/arm/mm/cache-v4.S
@@ -0,0 +1,139 @@
1/*
2 * linux/arch/arm/mm/cache-v4.S
3 *
4 * Copyright (C) 1997-2002 Russell king
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <linux/init.h>
12#include <asm/hardware.h>
13#include <asm/page.h>
14#include "proc-macros.S"
15
16/*
17 * flush_user_cache_all()
18 *
19 * Invalidate all cache entries in a particular address
20 * space.
21 *
22 * - mm - mm_struct describing address space
23 */
24ENTRY(v4_flush_user_cache_all)
25 /* FALLTHROUGH */
26/*
27 * flush_kern_cache_all()
28 *
29 * Clean and invalidate the entire cache.
30 */
31ENTRY(v4_flush_kern_cache_all)
32 mov r0, #0
33 mcr p15, 0, r0, c7, c7, 0 @ flush ID cache
34 mov pc, lr
35
36/*
37 * flush_user_cache_range(start, end, flags)
38 *
39 * Invalidate a range of cache entries in the specified
40 * address space.
41 *
42 * - start - start address (may not be aligned)
43 * - end - end address (exclusive, may not be aligned)
44 * - flags - vma_area_struct flags describing address space
45 */
46ENTRY(v4_flush_user_cache_range)
47 mov ip, #0
48 mcreq p15, 0, ip, c7, c7, 0 @ flush ID cache
49 mov pc, lr
50
51/*
52 * coherent_kern_range(start, end)
53 *
54 * Ensure coherency between the Icache and the Dcache in the
55 * region described by start. If you have non-snooping
56 * Harvard caches, you need to implement this function.
57 *
58 * - start - virtual start address
59 * - end - virtual end address
60 */
61ENTRY(v4_coherent_kern_range)
62 /* FALLTHROUGH */
63
64/*
65 * coherent_user_range(start, end)
66 *
67 * Ensure coherency between the Icache and the Dcache in the
68 * region described by start. If you have non-snooping
69 * Harvard caches, you need to implement this function.
70 *
71 * - start - virtual start address
72 * - end - virtual end address
73 */
74ENTRY(v4_coherent_user_range)
75 mov pc, lr
76
77/*
78 * flush_kern_dcache_page(void *page)
79 *
80 * Ensure no D cache aliasing occurs, either with itself or
81 * the I cache
82 *
83 * - addr - page aligned address
84 */
85ENTRY(v4_flush_kern_dcache_page)
86 /* FALLTHROUGH */
87
88/*
89 * dma_inv_range(start, end)
90 *
91 * Invalidate (discard) the specified virtual address range.
92 * May not write back any entries. If 'start' or 'end'
93 * are not cache line aligned, those lines must be written
94 * back.
95 *
96 * - start - virtual start address
97 * - end - virtual end address
98 */
99ENTRY(v4_dma_inv_range)
100 /* FALLTHROUGH */
101
102/*
103 * dma_flush_range(start, end)
104 *
105 * Clean and invalidate the specified virtual address range.
106 *
107 * - start - virtual start address
108 * - end - virtual end address
109 */
110ENTRY(v4_dma_flush_range)
111 mov r0, #0
112 mcr p15, 0, r0, c7, c7, 0 @ flush ID cache
113 /* FALLTHROUGH */
114
115/*
116 * dma_clean_range(start, end)
117 *
118 * Clean (write back) the specified virtual address range.
119 *
120 * - start - virtual start address
121 * - end - virtual end address
122 */
123ENTRY(v4_dma_clean_range)
124 mov pc, lr
125
126 __INITDATA
127
128 .type v4_cache_fns, #object
129ENTRY(v4_cache_fns)
130 .long v4_flush_kern_cache_all
131 .long v4_flush_user_cache_all
132 .long v4_flush_user_cache_range
133 .long v4_coherent_kern_range
134 .long v4_coherent_user_range
135 .long v4_flush_kern_dcache_page
136 .long v4_dma_inv_range
137 .long v4_dma_clean_range
138 .long v4_dma_flush_range
139 .size v4_cache_fns, . - v4_cache_fns
diff --git a/arch/arm/mm/cache-v4wb.S b/arch/arm/mm/cache-v4wb.S
new file mode 100644
index 000000000000..5c4055b62d97
--- /dev/null
+++ b/arch/arm/mm/cache-v4wb.S
@@ -0,0 +1,216 @@
1/*
2 * linux/arch/arm/mm/cache-v4wb.S
3 *
4 * Copyright (C) 1997-2002 Russell king
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/config.h>
11#include <linux/linkage.h>
12#include <linux/init.h>
13#include <asm/hardware.h>
14#include <asm/page.h>
15#include "proc-macros.S"
16
17/*
18 * The size of one data cache line.
19 */
20#define CACHE_DLINESIZE 32
21
22/*
23 * The total size of the data cache.
24 */
25#if defined(CONFIG_CPU_SA110)
26# define CACHE_DSIZE 16384
27#elif defined(CONFIG_CPU_SA1100)
28# define CACHE_DSIZE 8192
29#else
30# error Unknown cache size
31#endif
32
33/*
34 * This is the size at which it becomes more efficient to
35 * clean the whole cache, rather than using the individual
36 * cache line maintainence instructions.
37 *
38 * Size Clean (ticks) Dirty (ticks)
39 * 4096 21 20 21 53 55 54
40 * 8192 40 41 40 106 100 102
41 * 16384 77 77 76 140 140 138
42 * 32768 150 149 150 214 216 212 <---
43 * 65536 296 297 296 351 358 361
44 * 131072 591 591 591 656 657 651
45 * Whole 132 136 132 221 217 207 <---
46 */
47#define CACHE_DLIMIT (CACHE_DSIZE * 4)
48
49/*
50 * flush_user_cache_all()
51 *
52 * Clean and invalidate all cache entries in a particular address
53 * space.
54 */
55ENTRY(v4wb_flush_user_cache_all)
56 /* FALLTHROUGH */
57/*
58 * flush_kern_cache_all()
59 *
60 * Clean and invalidate the entire cache.
61 */
62ENTRY(v4wb_flush_kern_cache_all)
63 mov ip, #0
64 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
65__flush_whole_cache:
66 mov r0, #FLUSH_BASE
67 add r1, r0, #CACHE_DSIZE
681: ldr r2, [r0], #32
69 cmp r0, r1
70 blo 1b
71 mcr p15, 0, ip, c7, c10, 4 @ drain write buffer
72 mov pc, lr
73
74/*
75 * flush_user_cache_range(start, end, flags)
76 *
77 * Invalidate a range of cache entries in the specified
78 * address space.
79 *
80 * - start - start address (inclusive, page aligned)
81 * - end - end address (exclusive, page aligned)
82 * - flags - vma_area_struct flags describing address space
83 */
84ENTRY(v4wb_flush_user_cache_range)
85 sub r3, r1, r0 @ calculate total size
86 tst r2, #VM_EXEC @ executable region?
87 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
88
89 cmp r3, #CACHE_DLIMIT @ total size >= limit?
90 bhs __flush_whole_cache @ flush whole D cache
91
921: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
93 mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
94 add r0, r0, #CACHE_DLINESIZE
95 cmp r0, r1
96 blo 1b
97 tst r2, #VM_EXEC
98 mcrne p15, 0, ip, c7, c10, 4 @ drain write buffer
99 mov pc, lr
100
101/*
102 * flush_kern_dcache_page(void *page)
103 *
104 * Ensure no D cache aliasing occurs, either with itself or
105 * the I cache
106 *
107 * - addr - page aligned address
108 */
109ENTRY(v4wb_flush_kern_dcache_page)
110 add r1, r0, #PAGE_SZ
111 /* fall through */
112
113/*
114 * coherent_kern_range(start, end)
115 *
116 * Ensure coherency between the Icache and the Dcache in the
117 * region described by start. If you have non-snooping
118 * Harvard caches, you need to implement this function.
119 *
120 * - start - virtual start address
121 * - end - virtual end address
122 */
123ENTRY(v4wb_coherent_kern_range)
124 /* fall through */
125
126/*
127 * coherent_user_range(start, end)
128 *
129 * Ensure coherency between the Icache and the Dcache in the
130 * region described by start. If you have non-snooping
131 * Harvard caches, you need to implement this function.
132 *
133 * - start - virtual start address
134 * - end - virtual end address
135 */
136ENTRY(v4wb_coherent_user_range)
137 bic r0, r0, #CACHE_DLINESIZE - 1
1381: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
139 mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
140 add r0, r0, #CACHE_DLINESIZE
141 cmp r0, r1
142 blo 1b
143 mov ip, #0
144 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
145 mcr p15, 0, ip, c7, c10, 4 @ drain WB
146 mov pc, lr
147
148
149/*
150 * dma_inv_range(start, end)
151 *
152 * Invalidate (discard) the specified virtual address range.
153 * May not write back any entries. If 'start' or 'end'
154 * are not cache line aligned, those lines must be written
155 * back.
156 *
157 * - start - virtual start address
158 * - end - virtual end address
159 */
160ENTRY(v4wb_dma_inv_range)
161 tst r0, #CACHE_DLINESIZE - 1
162 bic r0, r0, #CACHE_DLINESIZE - 1
163 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
164 tst r1, #CACHE_DLINESIZE - 1
165 mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
1661: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
167 add r0, r0, #CACHE_DLINESIZE
168 cmp r0, r1
169 blo 1b
170 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
171 mov pc, lr
172
173/*
174 * dma_clean_range(start, end)
175 *
176 * Clean (write back) the specified virtual address range.
177 *
178 * - start - virtual start address
179 * - end - virtual end address
180 */
181ENTRY(v4wb_dma_clean_range)
182 bic r0, r0, #CACHE_DLINESIZE - 1
1831: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
184 add r0, r0, #CACHE_DLINESIZE
185 cmp r0, r1
186 blo 1b
187 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
188 mov pc, lr
189
190/*
191 * dma_flush_range(start, end)
192 *
193 * Clean and invalidate the specified virtual address range.
194 *
195 * - start - virtual start address
196 * - end - virtual end address
197 *
198 * This is actually the same as v4wb_coherent_kern_range()
199 */
200 .globl v4wb_dma_flush_range
201 .set v4wb_dma_flush_range, v4wb_coherent_kern_range
202
203 __INITDATA
204
205 .type v4wb_cache_fns, #object
206ENTRY(v4wb_cache_fns)
207 .long v4wb_flush_kern_cache_all
208 .long v4wb_flush_user_cache_all
209 .long v4wb_flush_user_cache_range
210 .long v4wb_coherent_kern_range
211 .long v4wb_coherent_user_range
212 .long v4wb_flush_kern_dcache_page
213 .long v4wb_dma_inv_range
214 .long v4wb_dma_clean_range
215 .long v4wb_dma_flush_range
216 .size v4wb_cache_fns, . - v4wb_cache_fns
diff --git a/arch/arm/mm/cache-v4wt.S b/arch/arm/mm/cache-v4wt.S
new file mode 100644
index 000000000000..9bcabd86c6f3
--- /dev/null
+++ b/arch/arm/mm/cache-v4wt.S
@@ -0,0 +1,188 @@
1/*
2 * linux/arch/arm/mm/cache-v4wt.S
3 *
4 * Copyright (C) 1997-2002 Russell king
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ARMv4 write through cache operations support.
11 *
12 * We assume that the write buffer is not enabled.
13 */
14#include <linux/linkage.h>
15#include <linux/init.h>
16#include <asm/hardware.h>
17#include <asm/page.h>
18#include "proc-macros.S"
19
20/*
21 * The size of one data cache line.
22 */
23#define CACHE_DLINESIZE 32
24
25/*
26 * The number of data cache segments.
27 */
28#define CACHE_DSEGMENTS 8
29
30/*
31 * The number of lines in a cache segment.
32 */
33#define CACHE_DENTRIES 64
34
35/*
36 * This is the size at which it becomes more efficient to
37 * clean the whole cache, rather than using the individual
38 * cache line maintainence instructions.
39 *
40 * *** This needs benchmarking
41 */
42#define CACHE_DLIMIT 16384
43
44/*
45 * flush_user_cache_all()
46 *
47 * Invalidate all cache entries in a particular address
48 * space.
49 */
50ENTRY(v4wt_flush_user_cache_all)
51 /* FALLTHROUGH */
52/*
53 * flush_kern_cache_all()
54 *
55 * Clean and invalidate the entire cache.
56 */
57ENTRY(v4wt_flush_kern_cache_all)
58 mov r2, #VM_EXEC
59 mov ip, #0
60__flush_whole_cache:
61 tst r2, #VM_EXEC
62 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
63 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
64 mov pc, lr
65
66/*
67 * flush_user_cache_range(start, end, flags)
68 *
69 * Clean and invalidate a range of cache entries in the specified
70 * address space.
71 *
72 * - start - start address (inclusive, page aligned)
73 * - end - end address (exclusive, page aligned)
74 * - flags - vma_area_struct flags describing address space
75 */
76ENTRY(v4wt_flush_user_cache_range)
77 sub r3, r1, r0 @ calculate total size
78 cmp r3, #CACHE_DLIMIT
79 bhs __flush_whole_cache
80
811: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
82 tst r2, #VM_EXEC
83 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
84 add r0, r0, #CACHE_DLINESIZE
85 cmp r0, r1
86 blo 1b
87 mov pc, lr
88
89/*
90 * coherent_kern_range(start, end)
91 *
92 * Ensure coherency between the Icache and the Dcache in the
93 * region described by start. If you have non-snooping
94 * Harvard caches, you need to implement this function.
95 *
96 * - start - virtual start address
97 * - end - virtual end address
98 */
99ENTRY(v4wt_coherent_kern_range)
100 /* FALLTRHOUGH */
101
102/*
103 * coherent_user_range(start, end)
104 *
105 * Ensure coherency between the Icache and the Dcache in the
106 * region described by start. If you have non-snooping
107 * Harvard caches, you need to implement this function.
108 *
109 * - start - virtual start address
110 * - end - virtual end address
111 */
112ENTRY(v4wt_coherent_user_range)
113 bic r0, r0, #CACHE_DLINESIZE - 1
1141: mcr p15, 0, r0, c7, c5, 1 @ invalidate I entry
115 add r0, r0, #CACHE_DLINESIZE
116 cmp r0, r1
117 blo 1b
118 mov pc, lr
119
120/*
121 * flush_kern_dcache_page(void *page)
122 *
123 * Ensure no D cache aliasing occurs, either with itself or
124 * the I cache
125 *
126 * - addr - page aligned address
127 */
128ENTRY(v4wt_flush_kern_dcache_page)
129 mov r2, #0
130 mcr p15, 0, r2, c7, c5, 0 @ invalidate I cache
131 add r1, r0, #PAGE_SZ
132 /* fallthrough */
133
134/*
135 * dma_inv_range(start, end)
136 *
137 * Invalidate (discard) the specified virtual address range.
138 * May not write back any entries. If 'start' or 'end'
139 * are not cache line aligned, those lines must be written
140 * back.
141 *
142 * - start - virtual start address
143 * - end - virtual end address
144 */
145ENTRY(v4wt_dma_inv_range)
146 bic r0, r0, #CACHE_DLINESIZE - 1
1471: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
148 add r0, r0, #CACHE_DLINESIZE
149 cmp r0, r1
150 blo 1b
151 /* FALLTHROUGH */
152
153/*
154 * dma_clean_range(start, end)
155 *
156 * Clean the specified virtual address range.
157 *
158 * - start - virtual start address
159 * - end - virtual end address
160 */
161ENTRY(v4wt_dma_clean_range)
162 mov pc, lr
163
164/*
165 * dma_flush_range(start, end)
166 *
167 * Clean and invalidate the specified virtual address range.
168 *
169 * - start - virtual start address
170 * - end - virtual end address
171 */
172 .globl v4wt_dma_flush_range
173 .equ v4wt_dma_flush_range, v4wt_dma_inv_range
174
175 __INITDATA
176
177 .type v4wt_cache_fns, #object
178ENTRY(v4wt_cache_fns)
179 .long v4wt_flush_kern_cache_all
180 .long v4wt_flush_user_cache_all
181 .long v4wt_flush_user_cache_range
182 .long v4wt_coherent_kern_range
183 .long v4wt_coherent_user_range
184 .long v4wt_flush_kern_dcache_page
185 .long v4wt_dma_inv_range
186 .long v4wt_dma_clean_range
187 .long v4wt_dma_flush_range
188 .size v4wt_cache_fns, . - v4wt_cache_fns
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S
new file mode 100644
index 000000000000..85c10a71e7c6
--- /dev/null
+++ b/arch/arm/mm/cache-v6.S
@@ -0,0 +1,227 @@
1/*
2 * linux/arch/arm/mm/cache-v6.S
3 *
4 * Copyright (C) 2001 Deep Blue Solutions Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This is the "shell" of the ARMv6 processor support.
11 */
12#include <linux/linkage.h>
13#include <linux/init.h>
14#include <asm/assembler.h>
15
16#include "proc-macros.S"
17
18#define HARVARD_CACHE
19#define CACHE_LINE_SIZE 32
20#define D_CACHE_LINE_SIZE 32
21
22/*
23 * v6_flush_cache_all()
24 *
25 * Flush the entire cache.
26 *
27 * It is assumed that:
28 */
29ENTRY(v6_flush_kern_cache_all)
30 mov r0, #0
31#ifdef HARVARD_CACHE
32 mcr p15, 0, r0, c7, c14, 0 @ D cache clean+invalidate
33 mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate
34#else
35 mcr p15, 0, r0, c7, c15, 0 @ Cache clean+invalidate
36#endif
37 mov pc, lr
38
39/*
40 * v6_flush_cache_all()
41 *
42 * Flush all TLB entries in a particular address space
43 *
44 * - mm - mm_struct describing address space
45 */
46ENTRY(v6_flush_user_cache_all)
47 /*FALLTHROUGH*/
48
49/*
50 * v6_flush_cache_range(start, end, flags)
51 *
52 * Flush a range of TLB entries in the specified address space.
53 *
54 * - start - start address (may not be aligned)
55 * - end - end address (exclusive, may not be aligned)
56 * - flags - vm_area_struct flags describing address space
57 *
58 * It is assumed that:
59 * - we have a VIPT cache.
60 */
61ENTRY(v6_flush_user_cache_range)
62 mov pc, lr
63
64/*
65 * v6_coherent_kern_range(start,end)
66 *
67 * Ensure that the I and D caches are coherent within specified
68 * region. This is typically used when code has been written to
69 * a memory region, and will be executed.
70 *
71 * - start - virtual start address of region
72 * - end - virtual end address of region
73 *
74 * It is assumed that:
75 * - the Icache does not read data from the write buffer
76 */
77ENTRY(v6_coherent_kern_range)
78 /* FALLTHROUGH */
79
80/*
81 * v6_coherent_user_range(start,end)
82 *
83 * Ensure that the I and D caches are coherent within specified
84 * region. This is typically used when code has been written to
85 * a memory region, and will be executed.
86 *
87 * - start - virtual start address of region
88 * - end - virtual end address of region
89 *
90 * It is assumed that:
91 * - the Icache does not read data from the write buffer
92 */
93ENTRY(v6_coherent_user_range)
94 bic r0, r0, #CACHE_LINE_SIZE - 1
951:
96#ifdef HARVARD_CACHE
97 mcr p15, 0, r0, c7, c10, 1 @ clean D line
98 mcr p15, 0, r0, c7, c5, 1 @ invalidate I line
99#endif
100 mcr p15, 0, r0, c7, c5, 7 @ invalidate BTB entry
101 add r0, r0, #CACHE_LINE_SIZE
102 cmp r0, r1
103 blo 1b
104#ifdef HARVARD_CACHE
105 mov r0, #0
106 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
107#endif
108 mov pc, lr
109
110/*
111 * v6_flush_kern_dcache_page(kaddr)
112 *
113 * Ensure that the data held in the page kaddr is written back
114 * to the page in question.
115 *
116 * - kaddr - kernel address (guaranteed to be page aligned)
117 */
118ENTRY(v6_flush_kern_dcache_page)
119 add r1, r0, #PAGE_SZ
1201:
121#ifdef HARVARD_CACHE
122 mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D line
123#else
124 mcr p15, 0, r0, c7, c15, 1 @ clean & invalidate unified line
125#endif
126 add r0, r0, #D_CACHE_LINE_SIZE
127 cmp r0, r1
128 blo 1b
129#ifdef HARVARD_CACHE
130 mov r0, #0
131 mcr p15, 0, r0, c7, c10, 4
132#endif
133 mov pc, lr
134
135
136/*
137 * v6_dma_inv_range(start,end)
138 *
139 * Invalidate the data cache within the specified region; we will
140 * be performing a DMA operation in this region and we want to
141 * purge old data in the cache.
142 *
143 * - start - virtual start address of region
144 * - end - virtual end address of region
145 */
146ENTRY(v6_dma_inv_range)
147 tst r0, #D_CACHE_LINE_SIZE - 1
148 bic r0, r0, #D_CACHE_LINE_SIZE - 1
149#ifdef HARVARD_CACHE
150 mcrne p15, 0, r0, c7, c10, 1 @ clean D line
151#else
152 mcrne p15, 0, r0, c7, c11, 1 @ clean unified line
153#endif
154 tst r1, #D_CACHE_LINE_SIZE - 1
155 bic r1, r1, #D_CACHE_LINE_SIZE - 1
156#ifdef HARVARD_CACHE
157 mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D line
158#else
159 mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line
160#endif
1611:
162#ifdef HARVARD_CACHE
163 mcr p15, 0, r0, c7, c6, 1 @ invalidate D line
164#else
165 mcr p15, 0, r0, c7, c7, 1 @ invalidate unified line
166#endif
167 add r0, r0, #D_CACHE_LINE_SIZE
168 cmp r0, r1
169 blo 1b
170 mov r0, #0
171 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
172 mov pc, lr
173
174/*
175 * v6_dma_clean_range(start,end)
176 * - start - virtual start address of region
177 * - end - virtual end address of region
178 */
179ENTRY(v6_dma_clean_range)
180 bic r0, r0, #D_CACHE_LINE_SIZE - 1
1811:
182#ifdef HARVARD_CACHE
183 mcr p15, 0, r0, c7, c10, 1 @ clean D line
184#else
185 mcr p15, 0, r0, c7, c11, 1 @ clean unified line
186#endif
187 add r0, r0, #D_CACHE_LINE_SIZE
188 cmp r0, r1
189 blo 1b
190 mov r0, #0
191 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
192 mov pc, lr
193
194/*
195 * v6_dma_flush_range(start,end)
196 * - start - virtual start address of region
197 * - end - virtual end address of region
198 */
199ENTRY(v6_dma_flush_range)
200 bic r0, r0, #D_CACHE_LINE_SIZE - 1
2011:
202#ifdef HARVARD_CACHE
203 mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D line
204#else
205 mcr p15, 0, r0, c7, c15, 1 @ clean & invalidate line
206#endif
207 add r0, r0, #D_CACHE_LINE_SIZE
208 cmp r0, r1
209 blo 1b
210 mov r0, #0
211 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
212 mov pc, lr
213
214 __INITDATA
215
216 .type v6_cache_fns, #object
217ENTRY(v6_cache_fns)
218 .long v6_flush_kern_cache_all
219 .long v6_flush_user_cache_all
220 .long v6_flush_user_cache_range
221 .long v6_coherent_kern_range
222 .long v6_coherent_user_range
223 .long v6_flush_kern_dcache_page
224 .long v6_dma_inv_range
225 .long v6_dma_clean_range
226 .long v6_dma_flush_range
227 .size v6_cache_fns, . - v6_cache_fns
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c
new file mode 100644
index 000000000000..26356ce4da54
--- /dev/null
+++ b/arch/arm/mm/consistent.c
@@ -0,0 +1,451 @@
1/*
2 * linux/arch/arm/mm/consistent.c
3 *
4 * Copyright (C) 2000-2004 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * DMA uncached mapping support.
11 */
12#include <linux/module.h>
13#include <linux/mm.h>
14#include <linux/slab.h>
15#include <linux/errno.h>
16#include <linux/list.h>
17#include <linux/init.h>
18#include <linux/device.h>
19#include <linux/dma-mapping.h>
20
21#include <asm/cacheflush.h>
22#include <asm/io.h>
23#include <asm/tlbflush.h>
24
25#define CONSISTENT_BASE (0xffc00000)
26#define CONSISTENT_END (0xffe00000)
27#define CONSISTENT_OFFSET(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT)
28
29/*
30 * This is the page table (2MB) covering uncached, DMA consistent allocations
31 */
32static pte_t *consistent_pte;
33static DEFINE_SPINLOCK(consistent_lock);
34
35/*
36 * VM region handling support.
37 *
38 * This should become something generic, handling VM region allocations for
39 * vmalloc and similar (ioremap, module space, etc).
40 *
41 * I envisage vmalloc()'s supporting vm_struct becoming:
42 *
43 * struct vm_struct {
44 * struct vm_region region;
45 * unsigned long flags;
46 * struct page **pages;
47 * unsigned int nr_pages;
48 * unsigned long phys_addr;
49 * };
50 *
51 * get_vm_area() would then call vm_region_alloc with an appropriate
52 * struct vm_region head (eg):
53 *
54 * struct vm_region vmalloc_head = {
55 * .vm_list = LIST_HEAD_INIT(vmalloc_head.vm_list),
56 * .vm_start = VMALLOC_START,
57 * .vm_end = VMALLOC_END,
58 * };
59 *
60 * However, vmalloc_head.vm_start is variable (typically, it is dependent on
61 * the amount of RAM found at boot time.) I would imagine that get_vm_area()
62 * would have to initialise this each time prior to calling vm_region_alloc().
63 */
64struct vm_region {
65 struct list_head vm_list;
66 unsigned long vm_start;
67 unsigned long vm_end;
68 struct page *vm_pages;
69};
70
71static struct vm_region consistent_head = {
72 .vm_list = LIST_HEAD_INIT(consistent_head.vm_list),
73 .vm_start = CONSISTENT_BASE,
74 .vm_end = CONSISTENT_END,
75};
76
77static struct vm_region *
78vm_region_alloc(struct vm_region *head, size_t size, int gfp)
79{
80 unsigned long addr = head->vm_start, end = head->vm_end - size;
81 unsigned long flags;
82 struct vm_region *c, *new;
83
84 new = kmalloc(sizeof(struct vm_region), gfp);
85 if (!new)
86 goto out;
87
88 spin_lock_irqsave(&consistent_lock, flags);
89
90 list_for_each_entry(c, &head->vm_list, vm_list) {
91 if ((addr + size) < addr)
92 goto nospc;
93 if ((addr + size) <= c->vm_start)
94 goto found;
95 addr = c->vm_end;
96 if (addr > end)
97 goto nospc;
98 }
99
100 found:
101 /*
102 * Insert this entry _before_ the one we found.
103 */
104 list_add_tail(&new->vm_list, &c->vm_list);
105 new->vm_start = addr;
106 new->vm_end = addr + size;
107
108 spin_unlock_irqrestore(&consistent_lock, flags);
109 return new;
110
111 nospc:
112 spin_unlock_irqrestore(&consistent_lock, flags);
113 kfree(new);
114 out:
115 return NULL;
116}
117
118static struct vm_region *vm_region_find(struct vm_region *head, unsigned long addr)
119{
120 struct vm_region *c;
121
122 list_for_each_entry(c, &head->vm_list, vm_list) {
123 if (c->vm_start == addr)
124 goto out;
125 }
126 c = NULL;
127 out:
128 return c;
129}
130
131#ifdef CONFIG_HUGETLB_PAGE
132#error ARM Coherent DMA allocator does not (yet) support huge TLB
133#endif
134
135static void *
136__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, int gfp,
137 pgprot_t prot)
138{
139 struct page *page;
140 struct vm_region *c;
141 unsigned long order;
142 u64 mask = ISA_DMA_THRESHOLD, limit;
143
144 if (!consistent_pte) {
145 printk(KERN_ERR "%s: not initialised\n", __func__);
146 dump_stack();
147 return NULL;
148 }
149
150 if (dev) {
151 mask = dev->coherent_dma_mask;
152
153 /*
154 * Sanity check the DMA mask - it must be non-zero, and
155 * must be able to be satisfied by a DMA allocation.
156 */
157 if (mask == 0) {
158 dev_warn(dev, "coherent DMA mask is unset\n");
159 goto no_page;
160 }
161
162 if ((~mask) & ISA_DMA_THRESHOLD) {
163 dev_warn(dev, "coherent DMA mask %#llx is smaller "
164 "than system GFP_DMA mask %#llx\n",
165 mask, (unsigned long long)ISA_DMA_THRESHOLD);
166 goto no_page;
167 }
168 }
169
170 /*
171 * Sanity check the allocation size.
172 */
173 size = PAGE_ALIGN(size);
174 limit = (mask + 1) & ~mask;
175 if ((limit && size >= limit) ||
176 size >= (CONSISTENT_END - CONSISTENT_BASE)) {
177 printk(KERN_WARNING "coherent allocation too big "
178 "(requested %#x mask %#llx)\n", size, mask);
179 goto no_page;
180 }
181
182 order = get_order(size);
183
184 if (mask != 0xffffffff)
185 gfp |= GFP_DMA;
186
187 page = alloc_pages(gfp, order);
188 if (!page)
189 goto no_page;
190
191 /*
192 * Invalidate any data that might be lurking in the
193 * kernel direct-mapped region for device DMA.
194 */
195 {
196 unsigned long kaddr = (unsigned long)page_address(page);
197 memset(page_address(page), 0, size);
198 dmac_flush_range(kaddr, kaddr + size);
199 }
200
201 /*
202 * Allocate a virtual address in the consistent mapping region.
203 */
204 c = vm_region_alloc(&consistent_head, size,
205 gfp & ~(__GFP_DMA | __GFP_HIGHMEM));
206 if (c) {
207 pte_t *pte = consistent_pte + CONSISTENT_OFFSET(c->vm_start);
208 struct page *end = page + (1 << order);
209
210 c->vm_pages = page;
211
212 /*
213 * Set the "dma handle"
214 */
215 *handle = page_to_dma(dev, page);
216
217 do {
218 BUG_ON(!pte_none(*pte));
219
220 set_page_count(page, 1);
221 /*
222 * x86 does not mark the pages reserved...
223 */
224 SetPageReserved(page);
225 set_pte(pte, mk_pte(page, prot));
226 page++;
227 pte++;
228 } while (size -= PAGE_SIZE);
229
230 /*
231 * Free the otherwise unused pages.
232 */
233 while (page < end) {
234 set_page_count(page, 1);
235 __free_page(page);
236 page++;
237 }
238
239 return (void *)c->vm_start;
240 }
241
242 if (page)
243 __free_pages(page, order);
244 no_page:
245 *handle = ~0;
246 return NULL;
247}
248
249/*
250 * Allocate DMA-coherent memory space and return both the kernel remapped
251 * virtual and bus address for that space.
252 */
253void *
254dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, int gfp)
255{
256 return __dma_alloc(dev, size, handle, gfp,
257 pgprot_noncached(pgprot_kernel));
258}
259EXPORT_SYMBOL(dma_alloc_coherent);
260
261/*
262 * Allocate a writecombining region, in much the same way as
263 * dma_alloc_coherent above.
264 */
265void *
266dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, int gfp)
267{
268 return __dma_alloc(dev, size, handle, gfp,
269 pgprot_writecombine(pgprot_kernel));
270}
271EXPORT_SYMBOL(dma_alloc_writecombine);
272
273static int dma_mmap(struct device *dev, struct vm_area_struct *vma,
274 void *cpu_addr, dma_addr_t dma_addr, size_t size)
275{
276 unsigned long flags, user_size, kern_size;
277 struct vm_region *c;
278 int ret = -ENXIO;
279
280 user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
281
282 spin_lock_irqsave(&consistent_lock, flags);
283 c = vm_region_find(&consistent_head, (unsigned long)cpu_addr);
284 spin_unlock_irqrestore(&consistent_lock, flags);
285
286 if (c) {
287 unsigned long off = vma->vm_pgoff;
288
289 kern_size = (c->vm_end - c->vm_start) >> PAGE_SHIFT;
290
291 if (off < kern_size &&
292 user_size <= (kern_size - off)) {
293 vma->vm_flags |= VM_RESERVED;
294 ret = remap_pfn_range(vma, vma->vm_start,
295 page_to_pfn(c->vm_pages) + off,
296 user_size << PAGE_SHIFT,
297 vma->vm_page_prot);
298 }
299 }
300
301 return ret;
302}
303
304int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma,
305 void *cpu_addr, dma_addr_t dma_addr, size_t size)
306{
307 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
308 return dma_mmap(dev, vma, cpu_addr, dma_addr, size);
309}
310EXPORT_SYMBOL(dma_mmap_coherent);
311
312int dma_mmap_writecombine(struct device *dev, struct vm_area_struct *vma,
313 void *cpu_addr, dma_addr_t dma_addr, size_t size)
314{
315 vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
316 return dma_mmap(dev, vma, cpu_addr, dma_addr, size);
317}
318EXPORT_SYMBOL(dma_mmap_writecombine);
319
320/*
321 * free a page as defined by the above mapping.
322 */
323void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle)
324{
325 struct vm_region *c;
326 unsigned long flags, addr;
327 pte_t *ptep;
328
329 size = PAGE_ALIGN(size);
330
331 spin_lock_irqsave(&consistent_lock, flags);
332
333 c = vm_region_find(&consistent_head, (unsigned long)cpu_addr);
334 if (!c)
335 goto no_area;
336
337 if ((c->vm_end - c->vm_start) != size) {
338 printk(KERN_ERR "%s: freeing wrong coherent size (%ld != %d)\n",
339 __func__, c->vm_end - c->vm_start, size);
340 dump_stack();
341 size = c->vm_end - c->vm_start;
342 }
343
344 ptep = consistent_pte + CONSISTENT_OFFSET(c->vm_start);
345 addr = c->vm_start;
346 do {
347 pte_t pte = ptep_get_and_clear(&init_mm, addr, ptep);
348 unsigned long pfn;
349
350 ptep++;
351 addr += PAGE_SIZE;
352
353 if (!pte_none(pte) && pte_present(pte)) {
354 pfn = pte_pfn(pte);
355
356 if (pfn_valid(pfn)) {
357 struct page *page = pfn_to_page(pfn);
358
359 /*
360 * x86 does not mark the pages reserved...
361 */
362 ClearPageReserved(page);
363
364 __free_page(page);
365 continue;
366 }
367 }
368
369 printk(KERN_CRIT "%s: bad page in kernel page table\n",
370 __func__);
371 } while (size -= PAGE_SIZE);
372
373 flush_tlb_kernel_range(c->vm_start, c->vm_end);
374
375 list_del(&c->vm_list);
376
377 spin_unlock_irqrestore(&consistent_lock, flags);
378
379 kfree(c);
380 return;
381
382 no_area:
383 spin_unlock_irqrestore(&consistent_lock, flags);
384 printk(KERN_ERR "%s: trying to free invalid coherent area: %p\n",
385 __func__, cpu_addr);
386 dump_stack();
387}
388EXPORT_SYMBOL(dma_free_coherent);
389
390/*
391 * Initialise the consistent memory allocation.
392 */
393static int __init consistent_init(void)
394{
395 pgd_t *pgd;
396 pmd_t *pmd;
397 pte_t *pte;
398 int ret = 0;
399
400 spin_lock(&init_mm.page_table_lock);
401
402 do {
403 pgd = pgd_offset(&init_mm, CONSISTENT_BASE);
404 pmd = pmd_alloc(&init_mm, pgd, CONSISTENT_BASE);
405 if (!pmd) {
406 printk(KERN_ERR "%s: no pmd tables\n", __func__);
407 ret = -ENOMEM;
408 break;
409 }
410 WARN_ON(!pmd_none(*pmd));
411
412 pte = pte_alloc_kernel(&init_mm, pmd, CONSISTENT_BASE);
413 if (!pte) {
414 printk(KERN_ERR "%s: no pte tables\n", __func__);
415 ret = -ENOMEM;
416 break;
417 }
418
419 consistent_pte = pte;
420 } while (0);
421
422 spin_unlock(&init_mm.page_table_lock);
423
424 return ret;
425}
426
427core_initcall(consistent_init);
428
429/*
430 * Make an area consistent for devices.
431 */
432void consistent_sync(void *vaddr, size_t size, int direction)
433{
434 unsigned long start = (unsigned long)vaddr;
435 unsigned long end = start + size;
436
437 switch (direction) {
438 case DMA_FROM_DEVICE: /* invalidate only */
439 dmac_inv_range(start, end);
440 break;
441 case DMA_TO_DEVICE: /* writeback only */
442 dmac_clean_range(start, end);
443 break;
444 case DMA_BIDIRECTIONAL: /* writeback and invalidate */
445 dmac_flush_range(start, end);
446 break;
447 default:
448 BUG();
449 }
450}
451EXPORT_SYMBOL(consistent_sync);
diff --git a/arch/arm/mm/copypage-v3.S b/arch/arm/mm/copypage-v3.S
new file mode 100644
index 000000000000..4940f1908316
--- /dev/null
+++ b/arch/arm/mm/copypage-v3.S
@@ -0,0 +1,67 @@
1/*
2 * linux/arch/arm/lib/copypage.S
3 *
4 * Copyright (C) 1995-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ASM optimised string functions
11 */
12#include <linux/linkage.h>
13#include <linux/init.h>
14#include <asm/assembler.h>
15#include <asm/constants.h>
16
17 .text
18 .align 5
19/*
20 * ARMv3 optimised copy_user_page
21 *
22 * FIXME: do we need to handle cache stuff...
23 */
24ENTRY(v3_copy_user_page)
25 stmfd sp!, {r4, lr} @ 2
26 mov r2, #PAGE_SZ/64 @ 1
27 ldmia r1!, {r3, r4, ip, lr} @ 4+1
281: stmia r0!, {r3, r4, ip, lr} @ 4
29 ldmia r1!, {r3, r4, ip, lr} @ 4+1
30 stmia r0!, {r3, r4, ip, lr} @ 4
31 ldmia r1!, {r3, r4, ip, lr} @ 4+1
32 stmia r0!, {r3, r4, ip, lr} @ 4
33 ldmia r1!, {r3, r4, ip, lr} @ 4
34 subs r2, r2, #1 @ 1
35 stmia r0!, {r3, r4, ip, lr} @ 4
36 ldmneia r1!, {r3, r4, ip, lr} @ 4
37 bne 1b @ 1
38 LOADREGS(fd, sp!, {r4, pc}) @ 3
39
40 .align 5
41/*
42 * ARMv3 optimised clear_user_page
43 *
44 * FIXME: do we need to handle cache stuff...
45 */
46ENTRY(v3_clear_user_page)
47 str lr, [sp, #-4]!
48 mov r1, #PAGE_SZ/64 @ 1
49 mov r2, #0 @ 1
50 mov r3, #0 @ 1
51 mov ip, #0 @ 1
52 mov lr, #0 @ 1
531: stmia r0!, {r2, r3, ip, lr} @ 4
54 stmia r0!, {r2, r3, ip, lr} @ 4
55 stmia r0!, {r2, r3, ip, lr} @ 4
56 stmia r0!, {r2, r3, ip, lr} @ 4
57 subs r1, r1, #1 @ 1
58 bne 1b @ 1
59 ldr pc, [sp], #4
60
61 __INITDATA
62
63 .type v3_user_fns, #object
64ENTRY(v3_user_fns)
65 .long v3_clear_user_page
66 .long v3_copy_user_page
67 .size v3_user_fns, . - v3_user_fns
diff --git a/arch/arm/mm/copypage-v4mc.S b/arch/arm/mm/copypage-v4mc.S
new file mode 100644
index 000000000000..305af3dab3d8
--- /dev/null
+++ b/arch/arm/mm/copypage-v4mc.S
@@ -0,0 +1,80 @@
1/*
2 * linux/arch/arm/lib/copy_page-armv4mc.S
3 *
4 * Copyright (C) 1995-2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ASM optimised string functions
11 */
12#include <linux/linkage.h>
13#include <linux/init.h>
14#include <asm/constants.h>
15
16 .text
17 .align 5
18/*
19 * ARMv4 mini-dcache optimised copy_user_page
20 *
21 * We flush the destination cache lines just before we write the data into the
22 * corresponding address. Since the Dcache is read-allocate, this removes the
23 * Dcache aliasing issue. The writes will be forwarded to the write buffer,
24 * and merged as appropriate.
25 *
26 * Note: We rely on all ARMv4 processors implementing the "invalidate D line"
27 * instruction. If your processor does not supply this, you have to write your
28 * own copy_user_page that does the right thing.
29 */
30ENTRY(v4_mc_copy_user_page)
31 stmfd sp!, {r4, lr} @ 2
32 mov r4, r0
33 mov r0, r1
34 bl map_page_minicache
35 mov r1, #PAGE_SZ/64 @ 1
36 ldmia r0!, {r2, r3, ip, lr} @ 4
371: mcr p15, 0, r4, c7, c6, 1 @ 1 invalidate D line
38 stmia r4!, {r2, r3, ip, lr} @ 4
39 ldmia r0!, {r2, r3, ip, lr} @ 4+1
40 stmia r4!, {r2, r3, ip, lr} @ 4
41 ldmia r0!, {r2, r3, ip, lr} @ 4
42 mcr p15, 0, r4, c7, c6, 1 @ 1 invalidate D line
43 stmia r4!, {r2, r3, ip, lr} @ 4
44 ldmia r0!, {r2, r3, ip, lr} @ 4
45 subs r1, r1, #1 @ 1
46 stmia r4!, {r2, r3, ip, lr} @ 4
47 ldmneia r0!, {r2, r3, ip, lr} @ 4
48 bne 1b @ 1
49 ldmfd sp!, {r4, pc} @ 3
50
51 .align 5
52/*
53 * ARMv4 optimised clear_user_page
54 *
55 * Same story as above.
56 */
57ENTRY(v4_mc_clear_user_page)
58 str lr, [sp, #-4]!
59 mov r1, #PAGE_SZ/64 @ 1
60 mov r2, #0 @ 1
61 mov r3, #0 @ 1
62 mov ip, #0 @ 1
63 mov lr, #0 @ 1
641: mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line
65 stmia r0!, {r2, r3, ip, lr} @ 4
66 stmia r0!, {r2, r3, ip, lr} @ 4
67 mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line
68 stmia r0!, {r2, r3, ip, lr} @ 4
69 stmia r0!, {r2, r3, ip, lr} @ 4
70 subs r1, r1, #1 @ 1
71 bne 1b @ 1
72 ldr pc, [sp], #4
73
74 __INITDATA
75
76 .type v4_mc_user_fns, #object
77ENTRY(v4_mc_user_fns)
78 .long v4_mc_clear_user_page
79 .long v4_mc_copy_user_page
80 .size v4_mc_user_fns, . - v4_mc_user_fns
diff --git a/arch/arm/mm/copypage-v4wb.S b/arch/arm/mm/copypage-v4wb.S
new file mode 100644
index 000000000000..b94c345ceb94
--- /dev/null
+++ b/arch/arm/mm/copypage-v4wb.S
@@ -0,0 +1,79 @@
1/*
2 * linux/arch/arm/lib/copypage.S
3 *
4 * Copyright (C) 1995-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ASM optimised string functions
11 */
12#include <linux/linkage.h>
13#include <linux/init.h>
14#include <asm/constants.h>
15
16 .text
17 .align 5
18/*
19 * ARMv4 optimised copy_user_page
20 *
21 * We flush the destination cache lines just before we write the data into the
22 * corresponding address. Since the Dcache is read-allocate, this removes the
23 * Dcache aliasing issue. The writes will be forwarded to the write buffer,
24 * and merged as appropriate.
25 *
26 * Note: We rely on all ARMv4 processors implementing the "invalidate D line"
27 * instruction. If your processor does not supply this, you have to write your
28 * own copy_user_page that does the right thing.
29 */
30ENTRY(v4wb_copy_user_page)
31 stmfd sp!, {r4, lr} @ 2
32 mov r2, #PAGE_SZ/64 @ 1
33 ldmia r1!, {r3, r4, ip, lr} @ 4
341: mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line
35 stmia r0!, {r3, r4, ip, lr} @ 4
36 ldmia r1!, {r3, r4, ip, lr} @ 4+1
37 stmia r0!, {r3, r4, ip, lr} @ 4
38 ldmia r1!, {r3, r4, ip, lr} @ 4
39 mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line
40 stmia r0!, {r3, r4, ip, lr} @ 4
41 ldmia r1!, {r3, r4, ip, lr} @ 4
42 subs r2, r2, #1 @ 1
43 stmia r0!, {r3, r4, ip, lr} @ 4
44 ldmneia r1!, {r3, r4, ip, lr} @ 4
45 bne 1b @ 1
46 mcr p15, 0, r1, c7, c10, 4 @ 1 drain WB
47 ldmfd sp!, {r4, pc} @ 3
48
49 .align 5
50/*
51 * ARMv4 optimised clear_user_page
52 *
53 * Same story as above.
54 */
55ENTRY(v4wb_clear_user_page)
56 str lr, [sp, #-4]!
57 mov r1, #PAGE_SZ/64 @ 1
58 mov r2, #0 @ 1
59 mov r3, #0 @ 1
60 mov ip, #0 @ 1
61 mov lr, #0 @ 1
621: mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line
63 stmia r0!, {r2, r3, ip, lr} @ 4
64 stmia r0!, {r2, r3, ip, lr} @ 4
65 mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line
66 stmia r0!, {r2, r3, ip, lr} @ 4
67 stmia r0!, {r2, r3, ip, lr} @ 4
68 subs r1, r1, #1 @ 1
69 bne 1b @ 1
70 mcr p15, 0, r1, c7, c10, 4 @ 1 drain WB
71 ldr pc, [sp], #4
72
73 __INITDATA
74
75 .type v4wb_user_fns, #object
76ENTRY(v4wb_user_fns)
77 .long v4wb_clear_user_page
78 .long v4wb_copy_user_page
79 .size v4wb_user_fns, . - v4wb_user_fns
diff --git a/arch/arm/mm/copypage-v4wt.S b/arch/arm/mm/copypage-v4wt.S
new file mode 100644
index 000000000000..976793937a93
--- /dev/null
+++ b/arch/arm/mm/copypage-v4wt.S
@@ -0,0 +1,73 @@
1/*
2 * linux/arch/arm/lib/copypage-v4.S
3 *
4 * Copyright (C) 1995-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ASM optimised string functions
11 *
12 * This is for CPUs with a writethrough cache and 'flush ID cache' is
13 * the only supported cache operation.
14 */
15#include <linux/linkage.h>
16#include <linux/init.h>
17#include <asm/constants.h>
18
19 .text
20 .align 5
21/*
22 * ARMv4 optimised copy_user_page
23 *
24 * Since we have writethrough caches, we don't have to worry about
25 * dirty data in the cache. However, we do have to ensure that
26 * subsequent reads are up to date.
27 */
28ENTRY(v4wt_copy_user_page)
29 stmfd sp!, {r4, lr} @ 2
30 mov r2, #PAGE_SZ/64 @ 1
31 ldmia r1!, {r3, r4, ip, lr} @ 4
321: stmia r0!, {r3, r4, ip, lr} @ 4
33 ldmia r1!, {r3, r4, ip, lr} @ 4+1
34 stmia r0!, {r3, r4, ip, lr} @ 4
35 ldmia r1!, {r3, r4, ip, lr} @ 4
36 stmia r0!, {r3, r4, ip, lr} @ 4
37 ldmia r1!, {r3, r4, ip, lr} @ 4
38 subs r2, r2, #1 @ 1
39 stmia r0!, {r3, r4, ip, lr} @ 4
40 ldmneia r1!, {r3, r4, ip, lr} @ 4
41 bne 1b @ 1
42 mcr p15, 0, r2, c7, c7, 0 @ flush ID cache
43 ldmfd sp!, {r4, pc} @ 3
44
45 .align 5
46/*
47 * ARMv4 optimised clear_user_page
48 *
49 * Same story as above.
50 */
51ENTRY(v4wt_clear_user_page)
52 str lr, [sp, #-4]!
53 mov r1, #PAGE_SZ/64 @ 1
54 mov r2, #0 @ 1
55 mov r3, #0 @ 1
56 mov ip, #0 @ 1
57 mov lr, #0 @ 1
581: stmia r0!, {r2, r3, ip, lr} @ 4
59 stmia r0!, {r2, r3, ip, lr} @ 4
60 stmia r0!, {r2, r3, ip, lr} @ 4
61 stmia r0!, {r2, r3, ip, lr} @ 4
62 subs r1, r1, #1 @ 1
63 bne 1b @ 1
64 mcr p15, 0, r2, c7, c7, 0 @ flush ID cache
65 ldr pc, [sp], #4
66
67 __INITDATA
68
69 .type v4wt_user_fns, #object
70ENTRY(v4wt_user_fns)
71 .long v4wt_clear_user_page
72 .long v4wt_copy_user_page
73 .size v4wt_user_fns, . - v4wt_user_fns
diff --git a/arch/arm/mm/copypage-v6.c b/arch/arm/mm/copypage-v6.c
new file mode 100644
index 000000000000..694ac8208858
--- /dev/null
+++ b/arch/arm/mm/copypage-v6.c
@@ -0,0 +1,155 @@
1/*
2 * linux/arch/arm/mm/copypage-v6.c
3 *
4 * Copyright (C) 2002 Deep Blue Solutions Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/init.h>
11#include <linux/spinlock.h>
12#include <linux/mm.h>
13
14#include <asm/page.h>
15#include <asm/pgtable.h>
16#include <asm/shmparam.h>
17#include <asm/tlbflush.h>
18#include <asm/cacheflush.h>
19
20#if SHMLBA > 16384
21#error FIX ME
22#endif
23
24#define from_address (0xffff8000)
25#define from_pgprot PAGE_KERNEL
26#define to_address (0xffffc000)
27#define to_pgprot PAGE_KERNEL
28
29static pte_t *from_pte;
30static pte_t *to_pte;
31static DEFINE_SPINLOCK(v6_lock);
32
33#define DCACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT)
34
35/*
36 * Copy the user page. No aliasing to deal with so we can just
37 * attack the kernel's existing mapping of these pages.
38 */
39void v6_copy_user_page_nonaliasing(void *kto, const void *kfrom, unsigned long vaddr)
40{
41 copy_page(kto, kfrom);
42}
43
44/*
45 * Clear the user page. No aliasing to deal with so we can just
46 * attack the kernel's existing mapping of this page.
47 */
48void v6_clear_user_page_nonaliasing(void *kaddr, unsigned long vaddr)
49{
50 clear_page(kaddr);
51}
52
53/*
54 * Copy the page, taking account of the cache colour.
55 */
56void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vaddr)
57{
58 unsigned int offset = DCACHE_COLOUR(vaddr);
59 unsigned long from, to;
60
61 /*
62 * Discard data in the kernel mapping for the new page.
63 * FIXME: needs this MCRR to be supported.
64 */
65 __asm__("mcrr p15, 0, %1, %0, c6 @ 0xec401f06"
66 :
67 : "r" (kto),
68 "r" ((unsigned long)kto + PAGE_SIZE - L1_CACHE_BYTES)
69 : "cc");
70
71 /*
72 * Now copy the page using the same cache colour as the
73 * pages ultimate destination.
74 */
75 spin_lock(&v6_lock);
76
77 set_pte(from_pte + offset, pfn_pte(__pa(kfrom) >> PAGE_SHIFT, from_pgprot));
78 set_pte(to_pte + offset, pfn_pte(__pa(kto) >> PAGE_SHIFT, to_pgprot));
79
80 from = from_address + (offset << PAGE_SHIFT);
81 to = to_address + (offset << PAGE_SHIFT);
82
83 flush_tlb_kernel_page(from);
84 flush_tlb_kernel_page(to);
85
86 copy_page((void *)to, (void *)from);
87
88 spin_unlock(&v6_lock);
89}
90
91/*
92 * Clear the user page. We need to deal with the aliasing issues,
93 * so remap the kernel page into the same cache colour as the user
94 * page.
95 */
96void v6_clear_user_page_aliasing(void *kaddr, unsigned long vaddr)
97{
98 unsigned int offset = DCACHE_COLOUR(vaddr);
99 unsigned long to = to_address + (offset << PAGE_SHIFT);
100
101 /*
102 * Discard data in the kernel mapping for the new page
103 * FIXME: needs this MCRR to be supported.
104 */
105 __asm__("mcrr p15, 0, %1, %0, c6 @ 0xec401f06"
106 :
107 : "r" (kaddr),
108 "r" ((unsigned long)kaddr + PAGE_SIZE - L1_CACHE_BYTES)
109 : "cc");
110
111 /*
112 * Now clear the page using the same cache colour as
113 * the pages ultimate destination.
114 */
115 spin_lock(&v6_lock);
116
117 set_pte(to_pte + offset, pfn_pte(__pa(kaddr) >> PAGE_SHIFT, to_pgprot));
118 flush_tlb_kernel_page(to);
119 clear_page((void *)to);
120
121 spin_unlock(&v6_lock);
122}
123
124struct cpu_user_fns v6_user_fns __initdata = {
125 .cpu_clear_user_page = v6_clear_user_page_nonaliasing,
126 .cpu_copy_user_page = v6_copy_user_page_nonaliasing,
127};
128
129static int __init v6_userpage_init(void)
130{
131 if (cache_is_vipt_aliasing()) {
132 pgd_t *pgd;
133 pmd_t *pmd;
134
135 pgd = pgd_offset_k(from_address);
136 pmd = pmd_alloc(&init_mm, pgd, from_address);
137 if (!pmd)
138 BUG();
139 from_pte = pte_alloc_kernel(&init_mm, pmd, from_address);
140 if (!from_pte)
141 BUG();
142
143 to_pte = pte_alloc_kernel(&init_mm, pmd, to_address);
144 if (!to_pte)
145 BUG();
146
147 cpu_user.cpu_clear_user_page = v6_clear_user_page_aliasing;
148 cpu_user.cpu_copy_user_page = v6_copy_user_page_aliasing;
149 }
150
151 return 0;
152}
153
154__initcall(v6_userpage_init);
155
diff --git a/arch/arm/mm/copypage-xscale.S b/arch/arm/mm/copypage-xscale.S
new file mode 100644
index 000000000000..bb277316ef52
--- /dev/null
+++ b/arch/arm/mm/copypage-xscale.S
@@ -0,0 +1,113 @@
1/*
2 * linux/arch/arm/lib/copypage-xscale.S
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <linux/init.h>
12#include <asm/constants.h>
13
14/*
15 * General note:
16 * We don't really want write-allocate cache behaviour for these functions
17 * since that will just eat through 8K of the cache.
18 */
19
20 .text
21 .align 5
22/*
23 * XScale optimised copy_user_page
24 * r0 = destination
25 * r1 = source
26 * r2 = virtual user address of ultimate destination page
27 *
28 * The source page may have some clean entries in the cache already, but we
29 * can safely ignore them - break_cow() will flush them out of the cache
30 * if we eventually end up using our copied page.
31 *
32 * What we could do is use the mini-cache to buffer reads from the source
33 * page. We rely on the mini-cache being smaller than one page, so we'll
34 * cycle through the complete cache anyway.
35 */
36ENTRY(xscale_mc_copy_user_page)
37 stmfd sp!, {r4, r5, lr}
38 mov r5, r0
39 mov r0, r1
40 bl map_page_minicache
41 mov r1, r5
42 mov lr, #PAGE_SZ/64-1
43
44 /*
45 * Strangely enough, best performance is achieved
46 * when prefetching destination as well. (NP)
47 */
48 pld [r0, #0]
49 pld [r0, #32]
50 pld [r1, #0]
51 pld [r1, #32]
52
531: pld [r0, #64]
54 pld [r0, #96]
55 pld [r1, #64]
56 pld [r1, #96]
57
582: ldrd r2, [r0], #8
59 ldrd r4, [r0], #8
60 mov ip, r1
61 strd r2, [r1], #8
62 ldrd r2, [r0], #8
63 strd r4, [r1], #8
64 ldrd r4, [r0], #8
65 strd r2, [r1], #8
66 strd r4, [r1], #8
67 mcr p15, 0, ip, c7, c10, 1 @ clean D line
68 ldrd r2, [r0], #8
69 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
70 ldrd r4, [r0], #8
71 mov ip, r1
72 strd r2, [r1], #8
73 ldrd r2, [r0], #8
74 strd r4, [r1], #8
75 ldrd r4, [r0], #8
76 strd r2, [r1], #8
77 strd r4, [r1], #8
78 mcr p15, 0, ip, c7, c10, 1 @ clean D line
79 subs lr, lr, #1
80 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
81 bgt 1b
82 beq 2b
83
84 ldmfd sp!, {r4, r5, pc}
85
86 .align 5
87/*
88 * XScale optimised clear_user_page
89 * r0 = destination
90 * r1 = virtual user address of ultimate destination page
91 */
92ENTRY(xscale_mc_clear_user_page)
93 mov r1, #PAGE_SZ/32
94 mov r2, #0
95 mov r3, #0
961: mov ip, r0
97 strd r2, [r0], #8
98 strd r2, [r0], #8
99 strd r2, [r0], #8
100 strd r2, [r0], #8
101 mcr p15, 0, ip, c7, c10, 1 @ clean D line
102 subs r1, r1, #1
103 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
104 bne 1b
105 mov pc, lr
106
107 __INITDATA
108
109 .type xscale_mc_user_fns, #object
110ENTRY(xscale_mc_user_fns)
111 .long xscale_mc_clear_user_page
112 .long xscale_mc_copy_user_page
113 .size xscale_mc_user_fns, . - xscale_mc_user_fns
diff --git a/arch/arm/mm/discontig.c b/arch/arm/mm/discontig.c
new file mode 100644
index 000000000000..0d097bb1bc4d
--- /dev/null
+++ b/arch/arm/mm/discontig.c
@@ -0,0 +1,49 @@
1/*
2 * linux/arch/arm/mm/discontig.c
3 *
4 * Discontiguous memory support.
5 *
6 * Initial code: Copyright (C) 1999-2000 Nicolas Pitre
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/module.h>
14#include <linux/mm.h>
15#include <linux/init.h>
16#include <linux/bootmem.h>
17
18#if MAX_NUMNODES != 4 && MAX_NUMNODES != 16
19# error Fix Me Please
20#endif
21
22/*
23 * Our node_data structure for discontiguous memory.
24 */
25
26static bootmem_data_t node_bootmem_data[MAX_NUMNODES];
27
28pg_data_t discontig_node_data[MAX_NUMNODES] = {
29 { .bdata = &node_bootmem_data[0] },
30 { .bdata = &node_bootmem_data[1] },
31 { .bdata = &node_bootmem_data[2] },
32 { .bdata = &node_bootmem_data[3] },
33#if MAX_NUMNODES == 16
34 { .bdata = &node_bootmem_data[4] },
35 { .bdata = &node_bootmem_data[5] },
36 { .bdata = &node_bootmem_data[6] },
37 { .bdata = &node_bootmem_data[7] },
38 { .bdata = &node_bootmem_data[8] },
39 { .bdata = &node_bootmem_data[9] },
40 { .bdata = &node_bootmem_data[10] },
41 { .bdata = &node_bootmem_data[11] },
42 { .bdata = &node_bootmem_data[12] },
43 { .bdata = &node_bootmem_data[13] },
44 { .bdata = &node_bootmem_data[14] },
45 { .bdata = &node_bootmem_data[15] },
46#endif
47};
48
49EXPORT_SYMBOL(discontig_node_data);
diff --git a/arch/arm/mm/extable.c b/arch/arm/mm/extable.c
new file mode 100644
index 000000000000..9592c3ee4cb2
--- /dev/null
+++ b/arch/arm/mm/extable.c
@@ -0,0 +1,16 @@
1/*
2 * linux/arch/arm/mm/extable.c
3 */
4#include <linux/module.h>
5#include <asm/uaccess.h>
6
7int fixup_exception(struct pt_regs *regs)
8{
9 const struct exception_table_entry *fixup;
10
11 fixup = search_exception_tables(instruction_pointer(regs));
12 if (fixup)
13 regs->ARM_pc = fixup->fixup;
14
15 return fixup != NULL;
16}
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
new file mode 100644
index 000000000000..01967ddeef53
--- /dev/null
+++ b/arch/arm/mm/fault-armv.c
@@ -0,0 +1,223 @@
1/*
2 * linux/arch/arm/mm/fault-armv.c
3 *
4 * Copyright (C) 1995 Linus Torvalds
5 * Modifications for ARM processor (c) 1995-2002 Russell King
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/module.h>
12#include <linux/sched.h>
13#include <linux/kernel.h>
14#include <linux/mm.h>
15#include <linux/bitops.h>
16#include <linux/vmalloc.h>
17#include <linux/init.h>
18#include <linux/pagemap.h>
19
20#include <asm/cacheflush.h>
21#include <asm/pgtable.h>
22#include <asm/tlbflush.h>
23
24static unsigned long shared_pte_mask = L_PTE_CACHEABLE;
25
26/*
27 * We take the easy way out of this problem - we make the
28 * PTE uncacheable. However, we leave the write buffer on.
29 */
30static int adjust_pte(struct vm_area_struct *vma, unsigned long address)
31{
32 pgd_t *pgd;
33 pmd_t *pmd;
34 pte_t *pte, entry;
35 int ret = 0;
36
37 pgd = pgd_offset(vma->vm_mm, address);
38 if (pgd_none(*pgd))
39 goto no_pgd;
40 if (pgd_bad(*pgd))
41 goto bad_pgd;
42
43 pmd = pmd_offset(pgd, address);
44 if (pmd_none(*pmd))
45 goto no_pmd;
46 if (pmd_bad(*pmd))
47 goto bad_pmd;
48
49 pte = pte_offset_map(pmd, address);
50 entry = *pte;
51
52 /*
53 * If this page isn't present, or is already setup to
54 * fault (ie, is old), we can safely ignore any issues.
55 */
56 if (pte_present(entry) && pte_val(entry) & shared_pte_mask) {
57 flush_cache_page(vma, address, pte_pfn(entry));
58 pte_val(entry) &= ~shared_pte_mask;
59 set_pte(pte, entry);
60 flush_tlb_page(vma, address);
61 ret = 1;
62 }
63 pte_unmap(pte);
64 return ret;
65
66bad_pgd:
67 pgd_ERROR(*pgd);
68 pgd_clear(pgd);
69no_pgd:
70 return 0;
71
72bad_pmd:
73 pmd_ERROR(*pmd);
74 pmd_clear(pmd);
75no_pmd:
76 return 0;
77}
78
79static void
80make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page, int dirty)
81{
82 struct address_space *mapping = page_mapping(page);
83 struct mm_struct *mm = vma->vm_mm;
84 struct vm_area_struct *mpnt;
85 struct prio_tree_iter iter;
86 unsigned long offset;
87 pgoff_t pgoff;
88 int aliases = 0;
89
90 if (!mapping)
91 return;
92
93 pgoff = vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT);
94
95 /*
96 * If we have any shared mappings that are in the same mm
97 * space, then we need to handle them specially to maintain
98 * cache coherency.
99 */
100 flush_dcache_mmap_lock(mapping);
101 vma_prio_tree_foreach(mpnt, &iter, &mapping->i_mmap, pgoff, pgoff) {
102 /*
103 * If this VMA is not in our MM, we can ignore it.
104 * Note that we intentionally mask out the VMA
105 * that we are fixing up.
106 */
107 if (mpnt->vm_mm != mm || mpnt == vma)
108 continue;
109 if (!(mpnt->vm_flags & VM_MAYSHARE))
110 continue;
111 offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
112 aliases += adjust_pte(mpnt, mpnt->vm_start + offset);
113 }
114 flush_dcache_mmap_unlock(mapping);
115 if (aliases)
116 adjust_pte(vma, addr);
117 else
118 flush_cache_page(vma, addr, page_to_pfn(page));
119}
120
121/*
122 * Take care of architecture specific things when placing a new PTE into
123 * a page table, or changing an existing PTE. Basically, there are two
124 * things that we need to take care of:
125 *
126 * 1. If PG_dcache_dirty is set for the page, we need to ensure
127 * that any cache entries for the kernels virtual memory
128 * range are written back to the page.
129 * 2. If we have multiple shared mappings of the same space in
130 * an object, we need to deal with the cache aliasing issues.
131 *
132 * Note that the page_table_lock will be held.
133 */
134void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
135{
136 unsigned long pfn = pte_pfn(pte);
137 struct page *page;
138
139 if (!pfn_valid(pfn))
140 return;
141 page = pfn_to_page(pfn);
142 if (page_mapping(page)) {
143 int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags);
144
145 if (dirty) {
146 /*
147 * This is our first userspace mapping of this page.
148 * Ensure that the physical page is coherent with
149 * the kernel mapping.
150 *
151 * FIXME: only need to do this on VIVT and aliasing
152 * VIPT cache architectures. We can do that
153 * by choosing whether to set this bit...
154 */
155 __cpuc_flush_dcache_page(page_address(page));
156 }
157
158 if (cache_is_vivt())
159 make_coherent(vma, addr, page, dirty);
160 }
161}
162
163/*
164 * Check whether the write buffer has physical address aliasing
165 * issues. If it has, we need to avoid them for the case where
166 * we have several shared mappings of the same object in user
167 * space.
168 */
169static int __init check_writebuffer(unsigned long *p1, unsigned long *p2)
170{
171 register unsigned long zero = 0, one = 1, val;
172
173 local_irq_disable();
174 mb();
175 *p1 = one;
176 mb();
177 *p2 = zero;
178 mb();
179 val = *p1;
180 mb();
181 local_irq_enable();
182 return val != zero;
183}
184
185void __init check_writebuffer_bugs(void)
186{
187 struct page *page;
188 const char *reason;
189 unsigned long v = 1;
190
191 printk(KERN_INFO "CPU: Testing write buffer coherency: ");
192
193 page = alloc_page(GFP_KERNEL);
194 if (page) {
195 unsigned long *p1, *p2;
196 pgprot_t prot = __pgprot(L_PTE_PRESENT|L_PTE_YOUNG|
197 L_PTE_DIRTY|L_PTE_WRITE|
198 L_PTE_BUFFERABLE);
199
200 p1 = vmap(&page, 1, VM_IOREMAP, prot);
201 p2 = vmap(&page, 1, VM_IOREMAP, prot);
202
203 if (p1 && p2) {
204 v = check_writebuffer(p1, p2);
205 reason = "enabling work-around";
206 } else {
207 reason = "unable to map memory\n";
208 }
209
210 vunmap(p1);
211 vunmap(p2);
212 put_page(page);
213 } else {
214 reason = "unable to grab page\n";
215 }
216
217 if (v) {
218 printk("failed, %s\n", reason);
219 shared_pte_mask |= L_PTE_BUFFERABLE;
220 } else {
221 printk("ok\n");
222 }
223}
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
new file mode 100644
index 000000000000..29be1c018949
--- /dev/null
+++ b/arch/arm/mm/fault.c
@@ -0,0 +1,462 @@
1/*
2 * linux/arch/arm/mm/fault.c
3 *
4 * Copyright (C) 1995 Linus Torvalds
5 * Modifications for ARM processor (c) 1995-2004 Russell King
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/config.h>
12#include <linux/module.h>
13#include <linux/signal.h>
14#include <linux/ptrace.h>
15#include <linux/mm.h>
16#include <linux/init.h>
17
18#include <asm/system.h>
19#include <asm/pgtable.h>
20#include <asm/tlbflush.h>
21#include <asm/uaccess.h>
22
23#include "fault.h"
24
25/*
26 * This is useful to dump out the page tables associated with
27 * 'addr' in mm 'mm'.
28 */
29void show_pte(struct mm_struct *mm, unsigned long addr)
30{
31 pgd_t *pgd;
32
33 if (!mm)
34 mm = &init_mm;
35
36 printk(KERN_ALERT "pgd = %p\n", mm->pgd);
37 pgd = pgd_offset(mm, addr);
38 printk(KERN_ALERT "[%08lx] *pgd=%08lx", addr, pgd_val(*pgd));
39
40 do {
41 pmd_t *pmd;
42 pte_t *pte;
43
44 if (pgd_none(*pgd))
45 break;
46
47 if (pgd_bad(*pgd)) {
48 printk("(bad)");
49 break;
50 }
51
52 pmd = pmd_offset(pgd, addr);
53#if PTRS_PER_PMD != 1
54 printk(", *pmd=%08lx", pmd_val(*pmd));
55#endif
56
57 if (pmd_none(*pmd))
58 break;
59
60 if (pmd_bad(*pmd)) {
61 printk("(bad)");
62 break;
63 }
64
65#ifndef CONFIG_HIGHMEM
66 /* We must not map this if we have highmem enabled */
67 pte = pte_offset_map(pmd, addr);
68 printk(", *pte=%08lx", pte_val(*pte));
69 printk(", *ppte=%08lx", pte_val(pte[-PTRS_PER_PTE]));
70 pte_unmap(pte);
71#endif
72 } while(0);
73
74 printk("\n");
75}
76
77/*
78 * Oops. The kernel tried to access some page that wasn't present.
79 */
80static void
81__do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
82 struct pt_regs *regs)
83{
84 /*
85 * Are we prepared to handle this kernel fault?
86 */
87 if (fixup_exception(regs))
88 return;
89
90 /*
91 * No handler, we'll have to terminate things with extreme prejudice.
92 */
93 bust_spinlocks(1);
94 printk(KERN_ALERT
95 "Unable to handle kernel %s at virtual address %08lx\n",
96 (addr < PAGE_SIZE) ? "NULL pointer dereference" :
97 "paging request", addr);
98
99 show_pte(mm, addr);
100 die("Oops", regs, fsr);
101 bust_spinlocks(0);
102 do_exit(SIGKILL);
103}
104
105/*
106 * Something tried to access memory that isn't in our memory map..
107 * User mode accesses just cause a SIGSEGV
108 */
109static void
110__do_user_fault(struct task_struct *tsk, unsigned long addr,
111 unsigned int fsr, int code, struct pt_regs *regs)
112{
113 struct siginfo si;
114
115#ifdef CONFIG_DEBUG_USER
116 if (user_debug & UDBG_SEGV) {
117 printk(KERN_DEBUG "%s: unhandled page fault at 0x%08lx, code 0x%03x\n",
118 tsk->comm, addr, fsr);
119 show_pte(tsk->mm, addr);
120 show_regs(regs);
121 }
122#endif
123
124 tsk->thread.address = addr;
125 tsk->thread.error_code = fsr;
126 tsk->thread.trap_no = 14;
127 si.si_signo = SIGSEGV;
128 si.si_errno = 0;
129 si.si_code = code;
130 si.si_addr = (void __user *)addr;
131 force_sig_info(SIGSEGV, &si, tsk);
132}
133
134void
135do_bad_area(struct task_struct *tsk, struct mm_struct *mm, unsigned long addr,
136 unsigned int fsr, struct pt_regs *regs)
137{
138 /*
139 * If we are in kernel mode at this point, we
140 * have no context to handle this fault with.
141 */
142 if (user_mode(regs))
143 __do_user_fault(tsk, addr, fsr, SEGV_MAPERR, regs);
144 else
145 __do_kernel_fault(mm, addr, fsr, regs);
146}
147
148#define VM_FAULT_BADMAP (-20)
149#define VM_FAULT_BADACCESS (-21)
150
151static int
152__do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
153 struct task_struct *tsk)
154{
155 struct vm_area_struct *vma;
156 int fault, mask;
157
158 vma = find_vma(mm, addr);
159 fault = VM_FAULT_BADMAP;
160 if (!vma)
161 goto out;
162 if (vma->vm_start > addr)
163 goto check_stack;
164
165 /*
166 * Ok, we have a good vm_area for this
167 * memory access, so we can handle it.
168 */
169good_area:
170 if (fsr & (1 << 11)) /* write? */
171 mask = VM_WRITE;
172 else
173 mask = VM_READ|VM_EXEC;
174
175 fault = VM_FAULT_BADACCESS;
176 if (!(vma->vm_flags & mask))
177 goto out;
178
179 /*
180 * If for any reason at all we couldn't handle
181 * the fault, make sure we exit gracefully rather
182 * than endlessly redo the fault.
183 */
184survive:
185 fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, fsr & (1 << 11));
186
187 /*
188 * Handle the "normal" cases first - successful and sigbus
189 */
190 switch (fault) {
191 case VM_FAULT_MAJOR:
192 tsk->maj_flt++;
193 return fault;
194 case VM_FAULT_MINOR:
195 tsk->min_flt++;
196 case VM_FAULT_SIGBUS:
197 return fault;
198 }
199
200 if (tsk->pid != 1)
201 goto out;
202
203 /*
204 * If we are out of memory for pid1,
205 * sleep for a while and retry
206 */
207 yield();
208 goto survive;
209
210check_stack:
211 if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr))
212 goto good_area;
213out:
214 return fault;
215}
216
217static int
218do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
219{
220 struct task_struct *tsk;
221 struct mm_struct *mm;
222 int fault;
223
224 tsk = current;
225 mm = tsk->mm;
226
227 /*
228 * If we're in an interrupt or have no user
229 * context, we must not take the fault..
230 */
231 if (in_interrupt() || !mm)
232 goto no_context;
233
234 down_read(&mm->mmap_sem);
235 fault = __do_page_fault(mm, addr, fsr, tsk);
236 up_read(&mm->mmap_sem);
237
238 /*
239 * Handle the "normal" case first
240 */
241 if (fault > 0)
242 return 0;
243
244 /*
245 * We had some memory, but were unable to
246 * successfully fix up this page fault.
247 */
248 if (fault == 0)
249 goto do_sigbus;
250
251 /*
252 * If we are in kernel mode at this point, we
253 * have no context to handle this fault with.
254 */
255 if (!user_mode(regs))
256 goto no_context;
257
258 if (fault == VM_FAULT_OOM) {
259 /*
260 * We ran out of memory, or some other thing happened to
261 * us that made us unable to handle the page fault gracefully.
262 */
263 printk("VM: killing process %s\n", tsk->comm);
264 do_exit(SIGKILL);
265 } else
266 __do_user_fault(tsk, addr, fsr, fault == VM_FAULT_BADACCESS ?
267 SEGV_ACCERR : SEGV_MAPERR, regs);
268 return 0;
269
270
271/*
272 * We ran out of memory, or some other thing happened to us that made
273 * us unable to handle the page fault gracefully.
274 */
275do_sigbus:
276 /*
277 * Send a sigbus, regardless of whether we were in kernel
278 * or user mode.
279 */
280 tsk->thread.address = addr;
281 tsk->thread.error_code = fsr;
282 tsk->thread.trap_no = 14;
283 force_sig(SIGBUS, tsk);
284#ifdef CONFIG_DEBUG_USER
285 if (user_debug & UDBG_BUS) {
286 printk(KERN_DEBUG "%s: sigbus at 0x%08lx, pc=0x%08lx\n",
287 current->comm, addr, instruction_pointer(regs));
288 }
289#endif
290
291 /* Kernel mode? Handle exceptions or die */
292 if (user_mode(regs))
293 return 0;
294
295no_context:
296 __do_kernel_fault(mm, addr, fsr, regs);
297 return 0;
298}
299
300/*
301 * First Level Translation Fault Handler
302 *
303 * We enter here because the first level page table doesn't contain
304 * a valid entry for the address.
305 *
306 * If the address is in kernel space (>= TASK_SIZE), then we are
307 * probably faulting in the vmalloc() area.
308 *
309 * If the init_task's first level page tables contains the relevant
310 * entry, we copy the it to this task. If not, we send the process
311 * a signal, fixup the exception, or oops the kernel.
312 *
313 * NOTE! We MUST NOT take any locks for this case. We may be in an
314 * interrupt or a critical region, and should only copy the information
315 * from the master page table, nothing more.
316 */
317static int
318do_translation_fault(unsigned long addr, unsigned int fsr,
319 struct pt_regs *regs)
320{
321 struct task_struct *tsk;
322 unsigned int index;
323 pgd_t *pgd, *pgd_k;
324 pmd_t *pmd, *pmd_k;
325
326 if (addr < TASK_SIZE)
327 return do_page_fault(addr, fsr, regs);
328
329 index = pgd_index(addr);
330
331 /*
332 * FIXME: CP15 C1 is write only on ARMv3 architectures.
333 */
334 pgd = cpu_get_pgd() + index;
335 pgd_k = init_mm.pgd + index;
336
337 if (pgd_none(*pgd_k))
338 goto bad_area;
339
340 if (!pgd_present(*pgd))
341 set_pgd(pgd, *pgd_k);
342
343 pmd_k = pmd_offset(pgd_k, addr);
344 pmd = pmd_offset(pgd, addr);
345
346 if (pmd_none(*pmd_k))
347 goto bad_area;
348
349 copy_pmd(pmd, pmd_k);
350 return 0;
351
352bad_area:
353 tsk = current;
354
355 do_bad_area(tsk, tsk->active_mm, addr, fsr, regs);
356 return 0;
357}
358
359/*
360 * Some section permission faults need to be handled gracefully.
361 * They can happen due to a __{get,put}_user during an oops.
362 */
363static int
364do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
365{
366 struct task_struct *tsk = current;
367 do_bad_area(tsk, tsk->active_mm, addr, fsr, regs);
368 return 0;
369}
370
371/*
372 * This abort handler always returns "fault".
373 */
374static int
375do_bad(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
376{
377 return 1;
378}
379
380static struct fsr_info {
381 int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
382 int sig;
383 const char *name;
384} fsr_info[] = {
385 /*
386 * The following are the standard ARMv3 and ARMv4 aborts. ARMv5
387 * defines these to be "precise" aborts.
388 */
389 { do_bad, SIGSEGV, "vector exception" },
390 { do_bad, SIGILL, "alignment exception" },
391 { do_bad, SIGKILL, "terminal exception" },
392 { do_bad, SIGILL, "alignment exception" },
393 { do_bad, SIGBUS, "external abort on linefetch" },
394 { do_translation_fault, SIGSEGV, "section translation fault" },
395 { do_bad, SIGBUS, "external abort on linefetch" },
396 { do_page_fault, SIGSEGV, "page translation fault" },
397 { do_bad, SIGBUS, "external abort on non-linefetch" },
398 { do_bad, SIGSEGV, "section domain fault" },
399 { do_bad, SIGBUS, "external abort on non-linefetch" },
400 { do_bad, SIGSEGV, "page domain fault" },
401 { do_bad, SIGBUS, "external abort on translation" },
402 { do_sect_fault, SIGSEGV, "section permission fault" },
403 { do_bad, SIGBUS, "external abort on translation" },
404 { do_page_fault, SIGSEGV, "page permission fault" },
405 /*
406 * The following are "imprecise" aborts, which are signalled by bit
407 * 10 of the FSR, and may not be recoverable. These are only
408 * supported if the CPU abort handler supports bit 10.
409 */
410 { do_bad, SIGBUS, "unknown 16" },
411 { do_bad, SIGBUS, "unknown 17" },
412 { do_bad, SIGBUS, "unknown 18" },
413 { do_bad, SIGBUS, "unknown 19" },
414 { do_bad, SIGBUS, "lock abort" }, /* xscale */
415 { do_bad, SIGBUS, "unknown 21" },
416 { do_bad, SIGBUS, "imprecise external abort" }, /* xscale */
417 { do_bad, SIGBUS, "unknown 23" },
418 { do_bad, SIGBUS, "dcache parity error" }, /* xscale */
419 { do_bad, SIGBUS, "unknown 25" },
420 { do_bad, SIGBUS, "unknown 26" },
421 { do_bad, SIGBUS, "unknown 27" },
422 { do_bad, SIGBUS, "unknown 28" },
423 { do_bad, SIGBUS, "unknown 29" },
424 { do_bad, SIGBUS, "unknown 30" },
425 { do_bad, SIGBUS, "unknown 31" }
426};
427
428void __init
429hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *),
430 int sig, const char *name)
431{
432 if (nr >= 0 && nr < ARRAY_SIZE(fsr_info)) {
433 fsr_info[nr].fn = fn;
434 fsr_info[nr].sig = sig;
435 fsr_info[nr].name = name;
436 }
437}
438
439/*
440 * Dispatch a data abort to the relevant handler.
441 */
442asmlinkage void
443do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
444{
445 const struct fsr_info *inf = fsr_info + (fsr & 15) + ((fsr & (1 << 10)) >> 6);
446
447 if (!inf->fn(addr, fsr, regs))
448 return;
449
450 printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n",
451 inf->name, fsr, addr);
452 force_sig(inf->sig, current);
453 show_pte(current->mm, addr);
454 die_if_kernel("Oops", regs, 0);
455}
456
457asmlinkage void
458do_PrefetchAbort(unsigned long addr, struct pt_regs *regs)
459{
460 do_translation_fault(addr, 0, regs);
461}
462
diff --git a/arch/arm/mm/fault.h b/arch/arm/mm/fault.h
new file mode 100644
index 000000000000..73b59e83227f
--- /dev/null
+++ b/arch/arm/mm/fault.h
@@ -0,0 +1,6 @@
1void do_bad_area(struct task_struct *tsk, struct mm_struct *mm,
2 unsigned long addr, unsigned int fsr, struct pt_regs *regs);
3
4void show_pte(struct mm_struct *mm, unsigned long addr);
5
6unsigned long search_exception_table(unsigned long addr);
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
new file mode 100644
index 000000000000..c6de48d89503
--- /dev/null
+++ b/arch/arm/mm/flush.c
@@ -0,0 +1,94 @@
1/*
2 * linux/arch/arm/mm/flush.c
3 *
4 * Copyright (C) 1995-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/module.h>
11#include <linux/mm.h>
12#include <linux/pagemap.h>
13
14#include <asm/cacheflush.h>
15#include <asm/system.h>
16
17static void __flush_dcache_page(struct address_space *mapping, struct page *page)
18{
19 struct mm_struct *mm = current->active_mm;
20 struct vm_area_struct *mpnt;
21 struct prio_tree_iter iter;
22 pgoff_t pgoff;
23
24 /*
25 * Writeback any data associated with the kernel mapping of this
26 * page. This ensures that data in the physical page is mutually
27 * coherent with the kernels mapping.
28 */
29 __cpuc_flush_dcache_page(page_address(page));
30
31 /*
32 * If there's no mapping pointer here, then this page isn't
33 * visible to userspace yet, so there are no cache lines
34 * associated with any other aliases.
35 */
36 if (!mapping)
37 return;
38
39 /*
40 * There are possible user space mappings of this page:
41 * - VIVT cache: we need to also write back and invalidate all user
42 * data in the current VM view associated with this page.
43 * - aliasing VIPT: we only need to find one mapping of this page.
44 */
45 pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
46
47 flush_dcache_mmap_lock(mapping);
48 vma_prio_tree_foreach(mpnt, &iter, &mapping->i_mmap, pgoff, pgoff) {
49 unsigned long offset;
50
51 /*
52 * If this VMA is not in our MM, we can ignore it.
53 */
54 if (mpnt->vm_mm != mm)
55 continue;
56 if (!(mpnt->vm_flags & VM_MAYSHARE))
57 continue;
58 offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
59 flush_cache_page(mpnt, mpnt->vm_start + offset, page_to_pfn(page));
60 if (cache_is_vipt())
61 break;
62 }
63 flush_dcache_mmap_unlock(mapping);
64}
65
66/*
67 * Ensure cache coherency between kernel mapping and userspace mapping
68 * of this page.
69 *
70 * We have three cases to consider:
71 * - VIPT non-aliasing cache: fully coherent so nothing required.
72 * - VIVT: fully aliasing, so we need to handle every alias in our
73 * current VM view.
74 * - VIPT aliasing: need to handle one alias in our current VM view.
75 *
76 * If we need to handle aliasing:
77 * If the page only exists in the page cache and there are no user
78 * space mappings, we can be lazy and remember that we may have dirty
79 * kernel cache lines for later. Otherwise, we assume we have
80 * aliasing mappings.
81 */
82void flush_dcache_page(struct page *page)
83{
84 struct address_space *mapping = page_mapping(page);
85
86 if (cache_is_vipt_nonaliasing())
87 return;
88
89 if (mapping && !mapping_mapped(mapping))
90 set_bit(PG_dcache_dirty, &page->flags);
91 else
92 __flush_dcache_page(mapping, page);
93}
94EXPORT_SYMBOL(flush_dcache_page);
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
new file mode 100644
index 000000000000..41156c5370f7
--- /dev/null
+++ b/arch/arm/mm/init.c
@@ -0,0 +1,621 @@
1/*
2 * linux/arch/arm/mm/init.c
3 *
4 * Copyright (C) 1995-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/config.h>
11#include <linux/kernel.h>
12#include <linux/errno.h>
13#include <linux/ptrace.h>
14#include <linux/swap.h>
15#include <linux/init.h>
16#include <linux/bootmem.h>
17#include <linux/mman.h>
18#include <linux/nodemask.h>
19#include <linux/initrd.h>
20
21#include <asm/mach-types.h>
22#include <asm/hardware.h>
23#include <asm/setup.h>
24#include <asm/tlb.h>
25
26#include <asm/mach/arch.h>
27#include <asm/mach/map.h>
28
29#define TABLE_SIZE (2 * PTRS_PER_PTE * sizeof(pte_t))
30
31DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
32
33extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
34extern void _stext, _text, _etext, __data_start, _end, __init_begin, __init_end;
35extern unsigned long phys_initrd_start;
36extern unsigned long phys_initrd_size;
37
38/*
39 * The sole use of this is to pass memory configuration
40 * data from paging_init to mem_init.
41 */
42static struct meminfo meminfo __initdata = { 0, };
43
44/*
45 * empty_zero_page is a special page that is used for
46 * zero-initialized data and COW.
47 */
48struct page *empty_zero_page;
49
50void show_mem(void)
51{
52 int free = 0, total = 0, reserved = 0;
53 int shared = 0, cached = 0, slab = 0, node;
54
55 printk("Mem-info:\n");
56 show_free_areas();
57 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
58
59 for_each_online_node(node) {
60 struct page *page, *end;
61
62 page = NODE_MEM_MAP(node);
63 end = page + NODE_DATA(node)->node_spanned_pages;
64
65 do {
66 total++;
67 if (PageReserved(page))
68 reserved++;
69 else if (PageSwapCache(page))
70 cached++;
71 else if (PageSlab(page))
72 slab++;
73 else if (!page_count(page))
74 free++;
75 else
76 shared += page_count(page) - 1;
77 page++;
78 } while (page < end);
79 }
80
81 printk("%d pages of RAM\n", total);
82 printk("%d free pages\n", free);
83 printk("%d reserved pages\n", reserved);
84 printk("%d slab pages\n", slab);
85 printk("%d pages shared\n", shared);
86 printk("%d pages swap cached\n", cached);
87}
88
89struct node_info {
90 unsigned int start;
91 unsigned int end;
92 int bootmap_pages;
93};
94
95#define O_PFN_DOWN(x) ((x) >> PAGE_SHIFT)
96#define V_PFN_DOWN(x) O_PFN_DOWN(__pa(x))
97
98#define O_PFN_UP(x) (PAGE_ALIGN(x) >> PAGE_SHIFT)
99#define V_PFN_UP(x) O_PFN_UP(__pa(x))
100
101#define PFN_SIZE(x) ((x) >> PAGE_SHIFT)
102#define PFN_RANGE(s,e) PFN_SIZE(PAGE_ALIGN((unsigned long)(e)) - \
103 (((unsigned long)(s)) & PAGE_MASK))
104
105/*
106 * FIXME: We really want to avoid allocating the bootmap bitmap
107 * over the top of the initrd. Hopefully, this is located towards
108 * the start of a bank, so if we allocate the bootmap bitmap at
109 * the end, we won't clash.
110 */
111static unsigned int __init
112find_bootmap_pfn(int node, struct meminfo *mi, unsigned int bootmap_pages)
113{
114 unsigned int start_pfn, bank, bootmap_pfn;
115
116 start_pfn = V_PFN_UP(&_end);
117 bootmap_pfn = 0;
118
119 for (bank = 0; bank < mi->nr_banks; bank ++) {
120 unsigned int start, end;
121
122 if (mi->bank[bank].node != node)
123 continue;
124
125 start = O_PFN_UP(mi->bank[bank].start);
126 end = O_PFN_DOWN(mi->bank[bank].size +
127 mi->bank[bank].start);
128
129 if (end < start_pfn)
130 continue;
131
132 if (start < start_pfn)
133 start = start_pfn;
134
135 if (end <= start)
136 continue;
137
138 if (end - start >= bootmap_pages) {
139 bootmap_pfn = start;
140 break;
141 }
142 }
143
144 if (bootmap_pfn == 0)
145 BUG();
146
147 return bootmap_pfn;
148}
149
150/*
151 * Scan the memory info structure and pull out:
152 * - the end of memory
153 * - the number of nodes
154 * - the pfn range of each node
155 * - the number of bootmem bitmap pages
156 */
157static unsigned int __init
158find_memend_and_nodes(struct meminfo *mi, struct node_info *np)
159{
160 unsigned int i, bootmem_pages = 0, memend_pfn = 0;
161
162 for (i = 0; i < MAX_NUMNODES; i++) {
163 np[i].start = -1U;
164 np[i].end = 0;
165 np[i].bootmap_pages = 0;
166 }
167
168 for (i = 0; i < mi->nr_banks; i++) {
169 unsigned long start, end;
170 int node;
171
172 if (mi->bank[i].size == 0) {
173 /*
174 * Mark this bank with an invalid node number
175 */
176 mi->bank[i].node = -1;
177 continue;
178 }
179
180 node = mi->bank[i].node;
181
182 /*
183 * Make sure we haven't exceeded the maximum number of nodes
184 * that we have in this configuration. If we have, we're in
185 * trouble. (maybe we ought to limit, instead of bugging?)
186 */
187 if (node >= MAX_NUMNODES)
188 BUG();
189 node_set_online(node);
190
191 /*
192 * Get the start and end pfns for this bank
193 */
194 start = O_PFN_UP(mi->bank[i].start);
195 end = O_PFN_DOWN(mi->bank[i].start + mi->bank[i].size);
196
197 if (np[node].start > start)
198 np[node].start = start;
199
200 if (np[node].end < end)
201 np[node].end = end;
202
203 if (memend_pfn < end)
204 memend_pfn = end;
205 }
206
207 /*
208 * Calculate the number of pages we require to
209 * store the bootmem bitmaps.
210 */
211 for_each_online_node(i) {
212 if (np[i].end == 0)
213 continue;
214
215 np[i].bootmap_pages = bootmem_bootmap_pages(np[i].end -
216 np[i].start);
217 bootmem_pages += np[i].bootmap_pages;
218 }
219
220 high_memory = __va(memend_pfn << PAGE_SHIFT);
221
222 /*
223 * This doesn't seem to be used by the Linux memory
224 * manager any more. If we can get rid of it, we
225 * also get rid of some of the stuff above as well.
226 */
227 max_low_pfn = memend_pfn - O_PFN_DOWN(PHYS_OFFSET);
228 max_pfn = memend_pfn - O_PFN_DOWN(PHYS_OFFSET);
229
230 return bootmem_pages;
231}
232
233static int __init check_initrd(struct meminfo *mi)
234{
235 int initrd_node = -2;
236#ifdef CONFIG_BLK_DEV_INITRD
237 unsigned long end = phys_initrd_start + phys_initrd_size;
238
239 /*
240 * Make sure that the initrd is within a valid area of
241 * memory.
242 */
243 if (phys_initrd_size) {
244 unsigned int i;
245
246 initrd_node = -1;
247
248 for (i = 0; i < mi->nr_banks; i++) {
249 unsigned long bank_end;
250
251 bank_end = mi->bank[i].start + mi->bank[i].size;
252
253 if (mi->bank[i].start <= phys_initrd_start &&
254 end <= bank_end)
255 initrd_node = mi->bank[i].node;
256 }
257 }
258
259 if (initrd_node == -1) {
260 printk(KERN_ERR "initrd (0x%08lx - 0x%08lx) extends beyond "
261 "physical memory - disabling initrd\n",
262 phys_initrd_start, end);
263 phys_initrd_start = phys_initrd_size = 0;
264 }
265#endif
266
267 return initrd_node;
268}
269
270/*
271 * Reserve the various regions of node 0
272 */
273static __init void reserve_node_zero(unsigned int bootmap_pfn, unsigned int bootmap_pages)
274{
275 pg_data_t *pgdat = NODE_DATA(0);
276 unsigned long res_size = 0;
277
278 /*
279 * Register the kernel text and data with bootmem.
280 * Note that this can only be in node 0.
281 */
282#ifdef CONFIG_XIP_KERNEL
283 reserve_bootmem_node(pgdat, __pa(&__data_start), &_end - &__data_start);
284#else
285 reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext);
286#endif
287
288 /*
289 * Reserve the page tables. These are already in use,
290 * and can only be in node 0.
291 */
292 reserve_bootmem_node(pgdat, __pa(swapper_pg_dir),
293 PTRS_PER_PGD * sizeof(pgd_t));
294
295 /*
296 * And don't forget to reserve the allocator bitmap,
297 * which will be freed later.
298 */
299 reserve_bootmem_node(pgdat, bootmap_pfn << PAGE_SHIFT,
300 bootmap_pages << PAGE_SHIFT);
301
302 /*
303 * Hmm... This should go elsewhere, but we really really need to
304 * stop things allocating the low memory; ideally we need a better
305 * implementation of GFP_DMA which does not assume that DMA-able
306 * memory starts at zero.
307 */
308 if (machine_is_integrator() || machine_is_cintegrator())
309 res_size = __pa(swapper_pg_dir) - PHYS_OFFSET;
310
311 /*
312 * These should likewise go elsewhere. They pre-reserve the
313 * screen memory region at the start of main system memory.
314 */
315 if (machine_is_edb7211())
316 res_size = 0x00020000;
317 if (machine_is_p720t())
318 res_size = 0x00014000;
319
320#ifdef CONFIG_SA1111
321 /*
322 * Because of the SA1111 DMA bug, we want to preserve our
323 * precious DMA-able memory...
324 */
325 res_size = __pa(swapper_pg_dir) - PHYS_OFFSET;
326#endif
327 if (res_size)
328 reserve_bootmem_node(pgdat, PHYS_OFFSET, res_size);
329}
330
331/*
332 * Register all available RAM in this node with the bootmem allocator.
333 */
334static inline void free_bootmem_node_bank(int node, struct meminfo *mi)
335{
336 pg_data_t *pgdat = NODE_DATA(node);
337 int bank;
338
339 for (bank = 0; bank < mi->nr_banks; bank++)
340 if (mi->bank[bank].node == node)
341 free_bootmem_node(pgdat, mi->bank[bank].start,
342 mi->bank[bank].size);
343}
344
345/*
346 * Initialise the bootmem allocator for all nodes. This is called
347 * early during the architecture specific initialisation.
348 */
349static void __init bootmem_init(struct meminfo *mi)
350{
351 struct node_info node_info[MAX_NUMNODES], *np = node_info;
352 unsigned int bootmap_pages, bootmap_pfn, map_pg;
353 int node, initrd_node;
354
355 bootmap_pages = find_memend_and_nodes(mi, np);
356 bootmap_pfn = find_bootmap_pfn(0, mi, bootmap_pages);
357 initrd_node = check_initrd(mi);
358
359 map_pg = bootmap_pfn;
360
361 /*
362 * Initialise the bootmem nodes.
363 *
364 * What we really want to do is:
365 *
366 * unmap_all_regions_except_kernel();
367 * for_each_node_in_reverse_order(node) {
368 * map_node(node);
369 * allocate_bootmem_map(node);
370 * init_bootmem_node(node);
371 * free_bootmem_node(node);
372 * }
373 *
374 * but this is a 2.5-type change. For now, we just set
375 * the nodes up in reverse order.
376 *
377 * (we could also do with rolling bootmem_init and paging_init
378 * into one generic "memory_init" type function).
379 */
380 np += num_online_nodes() - 1;
381 for (node = num_online_nodes() - 1; node >= 0; node--, np--) {
382 /*
383 * If there are no pages in this node, ignore it.
384 * Note that node 0 must always have some pages.
385 */
386 if (np->end == 0 || !node_online(node)) {
387 if (node == 0)
388 BUG();
389 continue;
390 }
391
392 /*
393 * Initialise the bootmem allocator.
394 */
395 init_bootmem_node(NODE_DATA(node), map_pg, np->start, np->end);
396 free_bootmem_node_bank(node, mi);
397 map_pg += np->bootmap_pages;
398
399 /*
400 * If this is node 0, we need to reserve some areas ASAP -
401 * we may use bootmem on node 0 to setup the other nodes.
402 */
403 if (node == 0)
404 reserve_node_zero(bootmap_pfn, bootmap_pages);
405 }
406
407
408#ifdef CONFIG_BLK_DEV_INITRD
409 if (phys_initrd_size && initrd_node >= 0) {
410 reserve_bootmem_node(NODE_DATA(initrd_node), phys_initrd_start,
411 phys_initrd_size);
412 initrd_start = __phys_to_virt(phys_initrd_start);
413 initrd_end = initrd_start + phys_initrd_size;
414 }
415#endif
416
417 BUG_ON(map_pg != bootmap_pfn + bootmap_pages);
418}
419
420/*
421 * paging_init() sets up the page tables, initialises the zone memory
422 * maps, and sets up the zero page, bad page and bad page tables.
423 */
424void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
425{
426 void *zero_page;
427 int node;
428
429 bootmem_init(mi);
430
431 memcpy(&meminfo, mi, sizeof(meminfo));
432
433 /*
434 * allocate the zero page. Note that we count on this going ok.
435 */
436 zero_page = alloc_bootmem_low_pages(PAGE_SIZE);
437
438 /*
439 * initialise the page tables.
440 */
441 memtable_init(mi);
442 if (mdesc->map_io)
443 mdesc->map_io();
444 flush_tlb_all();
445
446 /*
447 * initialise the zones within each node
448 */
449 for_each_online_node(node) {
450 unsigned long zone_size[MAX_NR_ZONES];
451 unsigned long zhole_size[MAX_NR_ZONES];
452 struct bootmem_data *bdata;
453 pg_data_t *pgdat;
454 int i;
455
456 /*
457 * Initialise the zone size information.
458 */
459 for (i = 0; i < MAX_NR_ZONES; i++) {
460 zone_size[i] = 0;
461 zhole_size[i] = 0;
462 }
463
464 pgdat = NODE_DATA(node);
465 bdata = pgdat->bdata;
466
467 /*
468 * The size of this node has already been determined.
469 * If we need to do anything fancy with the allocation
470 * of this memory to the zones, now is the time to do
471 * it.
472 */
473 zone_size[0] = bdata->node_low_pfn -
474 (bdata->node_boot_start >> PAGE_SHIFT);
475
476 /*
477 * If this zone has zero size, skip it.
478 */
479 if (!zone_size[0])
480 continue;
481
482 /*
483 * For each bank in this node, calculate the size of the
484 * holes. holes = node_size - sum(bank_sizes_in_node)
485 */
486 zhole_size[0] = zone_size[0];
487 for (i = 0; i < mi->nr_banks; i++) {
488 if (mi->bank[i].node != node)
489 continue;
490
491 zhole_size[0] -= mi->bank[i].size >> PAGE_SHIFT;
492 }
493
494 /*
495 * Adjust the sizes according to any special
496 * requirements for this machine type.
497 */
498 arch_adjust_zones(node, zone_size, zhole_size);
499
500 free_area_init_node(node, pgdat, zone_size,
501 bdata->node_boot_start >> PAGE_SHIFT, zhole_size);
502 }
503
504 /*
505 * finish off the bad pages once
506 * the mem_map is initialised
507 */
508 memzero(zero_page, PAGE_SIZE);
509 empty_zero_page = virt_to_page(zero_page);
510 flush_dcache_page(empty_zero_page);
511}
512
513static inline void free_area(unsigned long addr, unsigned long end, char *s)
514{
515 unsigned int size = (end - addr) >> 10;
516
517 for (; addr < end; addr += PAGE_SIZE) {
518 struct page *page = virt_to_page(addr);
519 ClearPageReserved(page);
520 set_page_count(page, 1);
521 free_page(addr);
522 totalram_pages++;
523 }
524
525 if (size && s)
526 printk(KERN_INFO "Freeing %s memory: %dK\n", s, size);
527}
528
529/*
530 * mem_init() marks the free areas in the mem_map and tells us how much
531 * memory is free. This is done after various parts of the system have
532 * claimed their memory after the kernel image.
533 */
534void __init mem_init(void)
535{
536 unsigned int codepages, datapages, initpages;
537 int i, node;
538
539 codepages = &_etext - &_text;
540 datapages = &_end - &__data_start;
541 initpages = &__init_end - &__init_begin;
542
543#ifndef CONFIG_DISCONTIGMEM
544 max_mapnr = virt_to_page(high_memory) - mem_map;
545#endif
546
547 /*
548 * We may have non-contiguous memory.
549 */
550 if (meminfo.nr_banks != 1)
551 create_memmap_holes(&meminfo);
552
553 /* this will put all unused low memory onto the freelists */
554 for_each_online_node(node) {
555 pg_data_t *pgdat = NODE_DATA(node);
556
557 if (pgdat->node_spanned_pages != 0)
558 totalram_pages += free_all_bootmem_node(pgdat);
559 }
560
561#ifdef CONFIG_SA1111
562 /* now that our DMA memory is actually so designated, we can free it */
563 free_area(PAGE_OFFSET, (unsigned long)swapper_pg_dir, NULL);
564#endif
565
566 /*
567 * Since our memory may not be contiguous, calculate the
568 * real number of pages we have in this system
569 */
570 printk(KERN_INFO "Memory:");
571
572 num_physpages = 0;
573 for (i = 0; i < meminfo.nr_banks; i++) {
574 num_physpages += meminfo.bank[i].size >> PAGE_SHIFT;
575 printk(" %ldMB", meminfo.bank[i].size >> 20);
576 }
577
578 printk(" = %luMB total\n", num_physpages >> (20 - PAGE_SHIFT));
579 printk(KERN_NOTICE "Memory: %luKB available (%dK code, "
580 "%dK data, %dK init)\n",
581 (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
582 codepages >> 10, datapages >> 10, initpages >> 10);
583
584 if (PAGE_SIZE >= 16384 && num_physpages <= 128) {
585 extern int sysctl_overcommit_memory;
586 /*
587 * On a machine this small we won't get
588 * anywhere without overcommit, so turn
589 * it on by default.
590 */
591 sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
592 }
593}
594
595void free_initmem(void)
596{
597 if (!machine_is_integrator() && !machine_is_cintegrator()) {
598 free_area((unsigned long)(&__init_begin),
599 (unsigned long)(&__init_end),
600 "init");
601 }
602}
603
604#ifdef CONFIG_BLK_DEV_INITRD
605
606static int keep_initrd;
607
608void free_initrd_mem(unsigned long start, unsigned long end)
609{
610 if (!keep_initrd)
611 free_area(start, end, "initrd");
612}
613
614static int __init keepinitrd_setup(char *__unused)
615{
616 keep_initrd = 1;
617 return 1;
618}
619
620__setup("keepinitrd", keepinitrd_setup);
621#endif
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
new file mode 100644
index 000000000000..00bb8fd37a59
--- /dev/null
+++ b/arch/arm/mm/ioremap.c
@@ -0,0 +1,172 @@
1/*
2 * linux/arch/arm/mm/ioremap.c
3 *
4 * Re-map IO memory to kernel address space so that we can access it.
5 *
6 * (C) Copyright 1995 1996 Linus Torvalds
7 *
8 * Hacked for ARM by Phil Blundell <philb@gnu.org>
9 * Hacked to allow all architectures to build, and various cleanups
10 * by Russell King
11 *
12 * This allows a driver to remap an arbitrary region of bus memory into
13 * virtual space. One should *only* use readl, writel, memcpy_toio and
14 * so on with such remapped areas.
15 *
16 * Because the ARM only has a 32-bit address space we can't address the
17 * whole of the (physical) PCI space at once. PCI huge-mode addressing
18 * allows us to circumvent this restriction by splitting PCI space into
19 * two 2GB chunks and mapping only one at a time into processor memory.
20 * We use MMU protection domains to trap any attempt to access the bank
21 * that is not currently mapped. (This isn't fully implemented yet.)
22 */
23#include <linux/module.h>
24#include <linux/errno.h>
25#include <linux/mm.h>
26#include <linux/vmalloc.h>
27
28#include <asm/cacheflush.h>
29#include <asm/io.h>
30#include <asm/tlbflush.h>
31
32static inline void
33remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
34 unsigned long phys_addr, pgprot_t pgprot)
35{
36 unsigned long end;
37
38 address &= ~PMD_MASK;
39 end = address + size;
40 if (end > PMD_SIZE)
41 end = PMD_SIZE;
42 BUG_ON(address >= end);
43 do {
44 if (!pte_none(*pte))
45 goto bad;
46
47 set_pte(pte, pfn_pte(phys_addr >> PAGE_SHIFT, pgprot));
48 address += PAGE_SIZE;
49 phys_addr += PAGE_SIZE;
50 pte++;
51 } while (address && (address < end));
52 return;
53
54 bad:
55 printk("remap_area_pte: page already exists\n");
56 BUG();
57}
58
59static inline int
60remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,
61 unsigned long phys_addr, unsigned long flags)
62{
63 unsigned long end;
64 pgprot_t pgprot;
65
66 address &= ~PGDIR_MASK;
67 end = address + size;
68
69 if (end > PGDIR_SIZE)
70 end = PGDIR_SIZE;
71
72 phys_addr -= address;
73 BUG_ON(address >= end);
74
75 pgprot = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_WRITE | flags);
76 do {
77 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address);
78 if (!pte)
79 return -ENOMEM;
80 remap_area_pte(pte, address, end - address, address + phys_addr, pgprot);
81 address = (address + PMD_SIZE) & PMD_MASK;
82 pmd++;
83 } while (address && (address < end));
84 return 0;
85}
86
87static int
88remap_area_pages(unsigned long start, unsigned long phys_addr,
89 unsigned long size, unsigned long flags)
90{
91 unsigned long address = start;
92 unsigned long end = start + size;
93 int err = 0;
94 pgd_t * dir;
95
96 phys_addr -= address;
97 dir = pgd_offset(&init_mm, address);
98 BUG_ON(address >= end);
99 spin_lock(&init_mm.page_table_lock);
100 do {
101 pmd_t *pmd = pmd_alloc(&init_mm, dir, address);
102 if (!pmd) {
103 err = -ENOMEM;
104 break;
105 }
106 if (remap_area_pmd(pmd, address, end - address,
107 phys_addr + address, flags)) {
108 err = -ENOMEM;
109 break;
110 }
111
112 address = (address + PGDIR_SIZE) & PGDIR_MASK;
113 dir++;
114 } while (address && (address < end));
115
116 spin_unlock(&init_mm.page_table_lock);
117 flush_cache_vmap(start, end);
118 return err;
119}
120
121/*
122 * Remap an arbitrary physical address space into the kernel virtual
123 * address space. Needed when the kernel wants to access high addresses
124 * directly.
125 *
126 * NOTE! We need to allow non-page-aligned mappings too: we will obviously
127 * have to convert them into an offset in a page-aligned mapping, but the
128 * caller shouldn't need to know that small detail.
129 *
130 * 'flags' are the extra L_PTE_ flags that you want to specify for this
131 * mapping. See include/asm-arm/proc-armv/pgtable.h for more information.
132 */
133void __iomem *
134__ioremap(unsigned long phys_addr, size_t size, unsigned long flags,
135 unsigned long align)
136{
137 void * addr;
138 struct vm_struct * area;
139 unsigned long offset, last_addr;
140
141 /* Don't allow wraparound or zero size */
142 last_addr = phys_addr + size - 1;
143 if (!size || last_addr < phys_addr)
144 return NULL;
145
146 /*
147 * Mappings have to be page-aligned
148 */
149 offset = phys_addr & ~PAGE_MASK;
150 phys_addr &= PAGE_MASK;
151 size = PAGE_ALIGN(last_addr + 1) - phys_addr;
152
153 /*
154 * Ok, go for it..
155 */
156 area = get_vm_area(size, VM_IOREMAP);
157 if (!area)
158 return NULL;
159 addr = area->addr;
160 if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) {
161 vfree(addr);
162 return NULL;
163 }
164 return (void __iomem *) (offset + (char *)addr);
165}
166EXPORT_SYMBOL(__ioremap);
167
168void __iounmap(void __iomem *addr)
169{
170 vfree((void *) (PAGE_MASK & (unsigned long) addr));
171}
172EXPORT_SYMBOL(__iounmap);
diff --git a/arch/arm/mm/minicache.c b/arch/arm/mm/minicache.c
new file mode 100644
index 000000000000..dedf2ab01b2a
--- /dev/null
+++ b/arch/arm/mm/minicache.c
@@ -0,0 +1,73 @@
1/*
2 * linux/arch/arm/mm/minicache.c
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This handles the mini data cache, as found on SA11x0 and XScale
11 * processors. When we copy a user page page, we map it in such a way
12 * that accesses to this page will not touch the main data cache, but
13 * will be cached in the mini data cache. This prevents us thrashing
14 * the main data cache on page faults.
15 */
16#include <linux/init.h>
17#include <linux/mm.h>
18
19#include <asm/page.h>
20#include <asm/pgtable.h>
21#include <asm/tlbflush.h>
22
23/*
24 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
25 * specific hacks for copying pages efficiently.
26 */
27#define minicache_address (0xffff8000)
28#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
29 L_PTE_CACHEABLE)
30
31static pte_t *minicache_pte;
32
33/*
34 * Note that this is intended to be called only from the copy_user_page
35 * asm code; anything else will require special locking to prevent the
36 * mini-cache space being re-used. (Note: probably preempt unsafe).
37 *
38 * We rely on the fact that the minicache is 2K, and we'll be pushing
39 * 4K of data through it, so we don't actually have to specifically
40 * flush the minicache when we change the mapping.
41 *
42 * Note also: assert(PAGE_OFFSET <= virt < high_memory).
43 * Unsafe: preempt, kmap.
44 */
45unsigned long map_page_minicache(unsigned long virt)
46{
47 set_pte(minicache_pte, pfn_pte(__pa(virt) >> PAGE_SHIFT, minicache_pgprot));
48 flush_tlb_kernel_page(minicache_address);
49
50 return minicache_address;
51}
52
53static int __init minicache_init(void)
54{
55 pgd_t *pgd;
56 pmd_t *pmd;
57
58 spin_lock(&init_mm.page_table_lock);
59
60 pgd = pgd_offset_k(minicache_address);
61 pmd = pmd_alloc(&init_mm, pgd, minicache_address);
62 if (!pmd)
63 BUG();
64 minicache_pte = pte_alloc_kernel(&init_mm, pmd, minicache_address);
65 if (!minicache_pte)
66 BUG();
67
68 spin_unlock(&init_mm.page_table_lock);
69
70 return 0;
71}
72
73core_initcall(minicache_init);
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
new file mode 100644
index 000000000000..f5a87db8b498
--- /dev/null
+++ b/arch/arm/mm/mm-armv.c
@@ -0,0 +1,760 @@
1/*
2 * linux/arch/arm/mm/mm-armv.c
3 *
4 * Copyright (C) 1998-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Page table sludge for ARM v3 and v4 processor architectures.
11 */
12#include <linux/config.h>
13#include <linux/module.h>
14#include <linux/mm.h>
15#include <linux/init.h>
16#include <linux/bootmem.h>
17#include <linux/highmem.h>
18#include <linux/nodemask.h>
19
20#include <asm/pgalloc.h>
21#include <asm/page.h>
22#include <asm/io.h>
23#include <asm/setup.h>
24#include <asm/tlbflush.h>
25
26#include <asm/mach/map.h>
27
28#define CPOLICY_UNCACHED 0
29#define CPOLICY_BUFFERED 1
30#define CPOLICY_WRITETHROUGH 2
31#define CPOLICY_WRITEBACK 3
32#define CPOLICY_WRITEALLOC 4
33
34static unsigned int cachepolicy __initdata = CPOLICY_WRITEBACK;
35static unsigned int ecc_mask __initdata = 0;
36pgprot_t pgprot_kernel;
37
38EXPORT_SYMBOL(pgprot_kernel);
39
40struct cachepolicy {
41 const char policy[16];
42 unsigned int cr_mask;
43 unsigned int pmd;
44 unsigned int pte;
45};
46
47static struct cachepolicy cache_policies[] __initdata = {
48 {
49 .policy = "uncached",
50 .cr_mask = CR_W|CR_C,
51 .pmd = PMD_SECT_UNCACHED,
52 .pte = 0,
53 }, {
54 .policy = "buffered",
55 .cr_mask = CR_C,
56 .pmd = PMD_SECT_BUFFERED,
57 .pte = PTE_BUFFERABLE,
58 }, {
59 .policy = "writethrough",
60 .cr_mask = 0,
61 .pmd = PMD_SECT_WT,
62 .pte = PTE_CACHEABLE,
63 }, {
64 .policy = "writeback",
65 .cr_mask = 0,
66 .pmd = PMD_SECT_WB,
67 .pte = PTE_BUFFERABLE|PTE_CACHEABLE,
68 }, {
69 .policy = "writealloc",
70 .cr_mask = 0,
71 .pmd = PMD_SECT_WBWA,
72 .pte = PTE_BUFFERABLE|PTE_CACHEABLE,
73 }
74};
75
76/*
77 * These are useful for identifing cache coherency
78 * problems by allowing the cache or the cache and
79 * writebuffer to be turned off. (Note: the write
80 * buffer should not be on and the cache off).
81 */
82static void __init early_cachepolicy(char **p)
83{
84 int i;
85
86 for (i = 0; i < ARRAY_SIZE(cache_policies); i++) {
87 int len = strlen(cache_policies[i].policy);
88
89 if (memcmp(*p, cache_policies[i].policy, len) == 0) {
90 cachepolicy = i;
91 cr_alignment &= ~cache_policies[i].cr_mask;
92 cr_no_alignment &= ~cache_policies[i].cr_mask;
93 *p += len;
94 break;
95 }
96 }
97 if (i == ARRAY_SIZE(cache_policies))
98 printk(KERN_ERR "ERROR: unknown or unsupported cache policy\n");
99 flush_cache_all();
100 set_cr(cr_alignment);
101}
102
103static void __init early_nocache(char **__unused)
104{
105 char *p = "buffered";
106 printk(KERN_WARNING "nocache is deprecated; use cachepolicy=%s\n", p);
107 early_cachepolicy(&p);
108}
109
110static void __init early_nowrite(char **__unused)
111{
112 char *p = "uncached";
113 printk(KERN_WARNING "nowb is deprecated; use cachepolicy=%s\n", p);
114 early_cachepolicy(&p);
115}
116
117static void __init early_ecc(char **p)
118{
119 if (memcmp(*p, "on", 2) == 0) {
120 ecc_mask = PMD_PROTECTION;
121 *p += 2;
122 } else if (memcmp(*p, "off", 3) == 0) {
123 ecc_mask = 0;
124 *p += 3;
125 }
126}
127
128__early_param("nocache", early_nocache);
129__early_param("nowb", early_nowrite);
130__early_param("cachepolicy=", early_cachepolicy);
131__early_param("ecc=", early_ecc);
132
133static int __init noalign_setup(char *__unused)
134{
135 cr_alignment &= ~CR_A;
136 cr_no_alignment &= ~CR_A;
137 set_cr(cr_alignment);
138 return 1;
139}
140
141__setup("noalign", noalign_setup);
142
143#define FIRST_KERNEL_PGD_NR (FIRST_USER_PGD_NR + USER_PTRS_PER_PGD)
144
145/*
146 * need to get a 16k page for level 1
147 */
148pgd_t *get_pgd_slow(struct mm_struct *mm)
149{
150 pgd_t *new_pgd, *init_pgd;
151 pmd_t *new_pmd, *init_pmd;
152 pte_t *new_pte, *init_pte;
153
154 new_pgd = (pgd_t *)__get_free_pages(GFP_KERNEL, 2);
155 if (!new_pgd)
156 goto no_pgd;
157
158 memzero(new_pgd, FIRST_KERNEL_PGD_NR * sizeof(pgd_t));
159
160 init_pgd = pgd_offset_k(0);
161
162 if (!vectors_high()) {
163 /*
164 * This lock is here just to satisfy pmd_alloc and pte_lock
165 */
166 spin_lock(&mm->page_table_lock);
167
168 /*
169 * On ARM, first page must always be allocated since it
170 * contains the machine vectors.
171 */
172 new_pmd = pmd_alloc(mm, new_pgd, 0);
173 if (!new_pmd)
174 goto no_pmd;
175
176 new_pte = pte_alloc_map(mm, new_pmd, 0);
177 if (!new_pte)
178 goto no_pte;
179
180 init_pmd = pmd_offset(init_pgd, 0);
181 init_pte = pte_offset_map_nested(init_pmd, 0);
182 set_pte(new_pte, *init_pte);
183 pte_unmap_nested(init_pte);
184 pte_unmap(new_pte);
185
186 spin_unlock(&mm->page_table_lock);
187 }
188
189 /*
190 * Copy over the kernel and IO PGD entries
191 */
192 memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR,
193 (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t));
194
195 clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t));
196
197 return new_pgd;
198
199no_pte:
200 spin_unlock(&mm->page_table_lock);
201 pmd_free(new_pmd);
202 free_pages((unsigned long)new_pgd, 2);
203 return NULL;
204
205no_pmd:
206 spin_unlock(&mm->page_table_lock);
207 free_pages((unsigned long)new_pgd, 2);
208 return NULL;
209
210no_pgd:
211 return NULL;
212}
213
214void free_pgd_slow(pgd_t *pgd)
215{
216 pmd_t *pmd;
217 struct page *pte;
218
219 if (!pgd)
220 return;
221
222 /* pgd is always present and good */
223 pmd = (pmd_t *)pgd;
224 if (pmd_none(*pmd))
225 goto free;
226 if (pmd_bad(*pmd)) {
227 pmd_ERROR(*pmd);
228 pmd_clear(pmd);
229 goto free;
230 }
231
232 pte = pmd_page(*pmd);
233 pmd_clear(pmd);
234 dec_page_state(nr_page_table_pages);
235 pte_free(pte);
236 pmd_free(pmd);
237free:
238 free_pages((unsigned long) pgd, 2);
239}
240
241/*
242 * Create a SECTION PGD between VIRT and PHYS in domain
243 * DOMAIN with protection PROT. This operates on half-
244 * pgdir entry increments.
245 */
246static inline void
247alloc_init_section(unsigned long virt, unsigned long phys, int prot)
248{
249 pmd_t *pmdp;
250
251 pmdp = pmd_offset(pgd_offset_k(virt), virt);
252 if (virt & (1 << 20))
253 pmdp++;
254
255 *pmdp = __pmd(phys | prot);
256 flush_pmd_entry(pmdp);
257}
258
259/*
260 * Create a SUPER SECTION PGD between VIRT and PHYS with protection PROT
261 */
262static inline void
263alloc_init_supersection(unsigned long virt, unsigned long phys, int prot)
264{
265 int i;
266
267 for (i = 0; i < 16; i += 1) {
268 alloc_init_section(virt, phys & SUPERSECTION_MASK,
269 prot | PMD_SECT_SUPER);
270
271 virt += (PGDIR_SIZE / 2);
272 phys += (PGDIR_SIZE / 2);
273 }
274}
275
276/*
277 * Add a PAGE mapping between VIRT and PHYS in domain
278 * DOMAIN with protection PROT. Note that due to the
279 * way we map the PTEs, we must allocate two PTE_SIZE'd
280 * blocks - one for the Linux pte table, and one for
281 * the hardware pte table.
282 */
283static inline void
284alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, pgprot_t prot)
285{
286 pmd_t *pmdp;
287 pte_t *ptep;
288
289 pmdp = pmd_offset(pgd_offset_k(virt), virt);
290
291 if (pmd_none(*pmdp)) {
292 unsigned long pmdval;
293 ptep = alloc_bootmem_low_pages(2 * PTRS_PER_PTE *
294 sizeof(pte_t));
295
296 pmdval = __pa(ptep) | prot_l1;
297 pmdp[0] = __pmd(pmdval);
298 pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
299 flush_pmd_entry(pmdp);
300 }
301 ptep = pte_offset_kernel(pmdp, virt);
302
303 set_pte(ptep, pfn_pte(phys >> PAGE_SHIFT, prot));
304}
305
306/*
307 * Clear any PGD mapping. On a two-level page table system,
308 * the clearance is done by the middle-level functions (pmd)
309 * rather than the top-level (pgd) functions.
310 */
311static inline void clear_mapping(unsigned long virt)
312{
313 pmd_clear(pmd_offset(pgd_offset_k(virt), virt));
314}
315
316struct mem_types {
317 unsigned int prot_pte;
318 unsigned int prot_l1;
319 unsigned int prot_sect;
320 unsigned int domain;
321};
322
323static struct mem_types mem_types[] __initdata = {
324 [MT_DEVICE] = {
325 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
326 L_PTE_WRITE,
327 .prot_l1 = PMD_TYPE_TABLE,
328 .prot_sect = PMD_TYPE_SECT | PMD_SECT_UNCACHED |
329 PMD_SECT_AP_WRITE,
330 .domain = DOMAIN_IO,
331 },
332 [MT_CACHECLEAN] = {
333 .prot_sect = PMD_TYPE_SECT,
334 .domain = DOMAIN_KERNEL,
335 },
336 [MT_MINICLEAN] = {
337 .prot_sect = PMD_TYPE_SECT | PMD_SECT_MINICACHE,
338 .domain = DOMAIN_KERNEL,
339 },
340 [MT_LOW_VECTORS] = {
341 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
342 L_PTE_EXEC,
343 .prot_l1 = PMD_TYPE_TABLE,
344 .domain = DOMAIN_USER,
345 },
346 [MT_HIGH_VECTORS] = {
347 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
348 L_PTE_USER | L_PTE_EXEC,
349 .prot_l1 = PMD_TYPE_TABLE,
350 .domain = DOMAIN_USER,
351 },
352 [MT_MEMORY] = {
353 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
354 .domain = DOMAIN_KERNEL,
355 },
356 [MT_ROM] = {
357 .prot_sect = PMD_TYPE_SECT,
358 .domain = DOMAIN_KERNEL,
359 },
360 [MT_IXP2000_DEVICE] = { /* IXP2400 requires XCB=101 for on-chip I/O */
361 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
362 L_PTE_WRITE,
363 .prot_l1 = PMD_TYPE_TABLE,
364 .prot_sect = PMD_TYPE_SECT | PMD_SECT_UNCACHED |
365 PMD_SECT_AP_WRITE | PMD_SECT_BUFFERABLE |
366 PMD_SECT_TEX(1),
367 .domain = DOMAIN_IO,
368 }
369};
370
371/*
372 * Adjust the PMD section entries according to the CPU in use.
373 */
374static void __init build_mem_type_table(void)
375{
376 struct cachepolicy *cp;
377 unsigned int cr = get_cr();
378 int cpu_arch = cpu_architecture();
379 int i;
380
381#if defined(CONFIG_CPU_DCACHE_DISABLE)
382 if (cachepolicy > CPOLICY_BUFFERED)
383 cachepolicy = CPOLICY_BUFFERED;
384#elif defined(CONFIG_CPU_DCACHE_WRITETHROUGH)
385 if (cachepolicy > CPOLICY_WRITETHROUGH)
386 cachepolicy = CPOLICY_WRITETHROUGH;
387#endif
388 if (cpu_arch < CPU_ARCH_ARMv5) {
389 if (cachepolicy >= CPOLICY_WRITEALLOC)
390 cachepolicy = CPOLICY_WRITEBACK;
391 ecc_mask = 0;
392 }
393
394 if (cpu_arch <= CPU_ARCH_ARMv5) {
395 for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
396 if (mem_types[i].prot_l1)
397 mem_types[i].prot_l1 |= PMD_BIT4;
398 if (mem_types[i].prot_sect)
399 mem_types[i].prot_sect |= PMD_BIT4;
400 }
401 }
402
403 /*
404 * ARMv6 and above have extended page tables.
405 */
406 if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) {
407 /*
408 * bit 4 becomes XN which we must clear for the
409 * kernel memory mapping.
410 */
411 mem_types[MT_MEMORY].prot_sect &= ~PMD_BIT4;
412 mem_types[MT_ROM].prot_sect &= ~PMD_BIT4;
413 /*
414 * Mark cache clean areas read only from SVC mode
415 * and no access from userspace.
416 */
417 mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
418 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
419 }
420
421 cp = &cache_policies[cachepolicy];
422
423 if (cpu_arch >= CPU_ARCH_ARMv5) {
424 mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE;
425 mem_types[MT_HIGH_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE;
426 } else {
427 mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte;
428 mem_types[MT_HIGH_VECTORS].prot_pte |= cp->pte;
429 mem_types[MT_MINICLEAN].prot_sect &= ~PMD_SECT_TEX(1);
430 }
431
432 mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask;
433 mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask;
434 mem_types[MT_MEMORY].prot_sect |= ecc_mask | cp->pmd;
435 mem_types[MT_ROM].prot_sect |= cp->pmd;
436
437 for (i = 0; i < 16; i++) {
438 unsigned long v = pgprot_val(protection_map[i]);
439 v &= (~(PTE_BUFFERABLE|PTE_CACHEABLE)) | cp->pte;
440 protection_map[i] = __pgprot(v);
441 }
442
443 pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG |
444 L_PTE_DIRTY | L_PTE_WRITE |
445 L_PTE_EXEC | cp->pte);
446
447 switch (cp->pmd) {
448 case PMD_SECT_WT:
449 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_WT;
450 break;
451 case PMD_SECT_WB:
452 case PMD_SECT_WBWA:
453 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_WB;
454 break;
455 }
456 printk("Memory policy: ECC %sabled, Data cache %s\n",
457 ecc_mask ? "en" : "dis", cp->policy);
458}
459
460#define vectors_base() (vectors_high() ? 0xffff0000 : 0)
461
462/*
463 * Create the page directory entries and any necessary
464 * page tables for the mapping specified by `md'. We
465 * are able to cope here with varying sizes and address
466 * offsets, and we take full advantage of sections and
467 * supersections.
468 */
469static void __init create_mapping(struct map_desc *md)
470{
471 unsigned long virt, length;
472 int prot_sect, prot_l1, domain;
473 pgprot_t prot_pte;
474 long off;
475
476 if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) {
477 printk(KERN_WARNING "BUG: not creating mapping for "
478 "0x%08lx at 0x%08lx in user region\n",
479 md->physical, md->virtual);
480 return;
481 }
482
483 if ((md->type == MT_DEVICE || md->type == MT_ROM) &&
484 md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) {
485 printk(KERN_WARNING "BUG: mapping for 0x%08lx at 0x%08lx "
486 "overlaps vmalloc space\n",
487 md->physical, md->virtual);
488 }
489
490 domain = mem_types[md->type].domain;
491 prot_pte = __pgprot(mem_types[md->type].prot_pte);
492 prot_l1 = mem_types[md->type].prot_l1 | PMD_DOMAIN(domain);
493 prot_sect = mem_types[md->type].prot_sect | PMD_DOMAIN(domain);
494
495 virt = md->virtual;
496 off = md->physical - virt;
497 length = md->length;
498
499 if (mem_types[md->type].prot_l1 == 0 &&
500 (virt & 0xfffff || (virt + off) & 0xfffff || (virt + length) & 0xfffff)) {
501 printk(KERN_WARNING "BUG: map for 0x%08lx at 0x%08lx can not "
502 "be mapped using pages, ignoring.\n",
503 md->physical, md->virtual);
504 return;
505 }
506
507 while ((virt & 0xfffff || (virt + off) & 0xfffff) && length >= PAGE_SIZE) {
508 alloc_init_page(virt, virt + off, prot_l1, prot_pte);
509
510 virt += PAGE_SIZE;
511 length -= PAGE_SIZE;
512 }
513
514 /* N.B. ARMv6 supersections are only defined to work with domain 0.
515 * Since domain assignments can in fact be arbitrary, the
516 * 'domain == 0' check below is required to insure that ARMv6
517 * supersections are only allocated for domain 0 regardless
518 * of the actual domain assignments in use.
519 */
520 if (cpu_architecture() >= CPU_ARCH_ARMv6 && domain == 0) {
521 /* Align to supersection boundary */
522 while ((virt & ~SUPERSECTION_MASK || (virt + off) &
523 ~SUPERSECTION_MASK) && length >= (PGDIR_SIZE / 2)) {
524 alloc_init_section(virt, virt + off, prot_sect);
525
526 virt += (PGDIR_SIZE / 2);
527 length -= (PGDIR_SIZE / 2);
528 }
529
530 while (length >= SUPERSECTION_SIZE) {
531 alloc_init_supersection(virt, virt + off, prot_sect);
532
533 virt += SUPERSECTION_SIZE;
534 length -= SUPERSECTION_SIZE;
535 }
536 }
537
538 /*
539 * A section mapping covers half a "pgdir" entry.
540 */
541 while (length >= (PGDIR_SIZE / 2)) {
542 alloc_init_section(virt, virt + off, prot_sect);
543
544 virt += (PGDIR_SIZE / 2);
545 length -= (PGDIR_SIZE / 2);
546 }
547
548 while (length >= PAGE_SIZE) {
549 alloc_init_page(virt, virt + off, prot_l1, prot_pte);
550
551 virt += PAGE_SIZE;
552 length -= PAGE_SIZE;
553 }
554}
555
556/*
557 * In order to soft-boot, we need to insert a 1:1 mapping in place of
558 * the user-mode pages. This will then ensure that we have predictable
559 * results when turning the mmu off
560 */
561void setup_mm_for_reboot(char mode)
562{
563 unsigned long pmdval;
564 pgd_t *pgd;
565 pmd_t *pmd;
566 int i;
567 int cpu_arch = cpu_architecture();
568
569 if (current->mm && current->mm->pgd)
570 pgd = current->mm->pgd;
571 else
572 pgd = init_mm.pgd;
573
574 for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++) {
575 pmdval = (i << PGDIR_SHIFT) |
576 PMD_SECT_AP_WRITE | PMD_SECT_AP_READ |
577 PMD_TYPE_SECT;
578 if (cpu_arch <= CPU_ARCH_ARMv5)
579 pmdval |= PMD_BIT4;
580 pmd = pmd_offset(pgd + i, i << PGDIR_SHIFT);
581 pmd[0] = __pmd(pmdval);
582 pmd[1] = __pmd(pmdval + (1 << (PGDIR_SHIFT - 1)));
583 flush_pmd_entry(pmd);
584 }
585}
586
587extern void _stext, _etext;
588
589/*
590 * Setup initial mappings. We use the page we allocated for zero page to hold
591 * the mappings, which will get overwritten by the vectors in traps_init().
592 * The mappings must be in virtual address order.
593 */
594void __init memtable_init(struct meminfo *mi)
595{
596 struct map_desc *init_maps, *p, *q;
597 unsigned long address = 0;
598 int i;
599
600 build_mem_type_table();
601
602 init_maps = p = alloc_bootmem_low_pages(PAGE_SIZE);
603
604#ifdef CONFIG_XIP_KERNEL
605 p->physical = CONFIG_XIP_PHYS_ADDR & PMD_MASK;
606 p->virtual = (unsigned long)&_stext & PMD_MASK;
607 p->length = ((unsigned long)&_etext - p->virtual + ~PMD_MASK) & PMD_MASK;
608 p->type = MT_ROM;
609 p ++;
610#endif
611
612 for (i = 0; i < mi->nr_banks; i++) {
613 if (mi->bank[i].size == 0)
614 continue;
615
616 p->physical = mi->bank[i].start;
617 p->virtual = __phys_to_virt(p->physical);
618 p->length = mi->bank[i].size;
619 p->type = MT_MEMORY;
620 p ++;
621 }
622
623#ifdef FLUSH_BASE
624 p->physical = FLUSH_BASE_PHYS;
625 p->virtual = FLUSH_BASE;
626 p->length = PGDIR_SIZE;
627 p->type = MT_CACHECLEAN;
628 p ++;
629#endif
630
631#ifdef FLUSH_BASE_MINICACHE
632 p->physical = FLUSH_BASE_PHYS + PGDIR_SIZE;
633 p->virtual = FLUSH_BASE_MINICACHE;
634 p->length = PGDIR_SIZE;
635 p->type = MT_MINICLEAN;
636 p ++;
637#endif
638
639 /*
640 * Go through the initial mappings, but clear out any
641 * pgdir entries that are not in the description.
642 */
643 q = init_maps;
644 do {
645 if (address < q->virtual || q == p) {
646 clear_mapping(address);
647 address += PGDIR_SIZE;
648 } else {
649 create_mapping(q);
650
651 address = q->virtual + q->length;
652 address = (address + PGDIR_SIZE - 1) & PGDIR_MASK;
653
654 q ++;
655 }
656 } while (address != 0);
657
658 /*
659 * Create a mapping for the machine vectors at the high-vectors
660 * location (0xffff0000). If we aren't using high-vectors, also
661 * create a mapping at the low-vectors virtual address.
662 */
663 init_maps->physical = virt_to_phys(init_maps);
664 init_maps->virtual = 0xffff0000;
665 init_maps->length = PAGE_SIZE;
666 init_maps->type = MT_HIGH_VECTORS;
667 create_mapping(init_maps);
668
669 if (!vectors_high()) {
670 init_maps->virtual = 0;
671 init_maps->type = MT_LOW_VECTORS;
672 create_mapping(init_maps);
673 }
674
675 flush_cache_all();
676 flush_tlb_all();
677}
678
679/*
680 * Create the architecture specific mappings
681 */
682void __init iotable_init(struct map_desc *io_desc, int nr)
683{
684 int i;
685
686 for (i = 0; i < nr; i++)
687 create_mapping(io_desc + i);
688}
689
690static inline void
691free_memmap(int node, unsigned long start_pfn, unsigned long end_pfn)
692{
693 struct page *start_pg, *end_pg;
694 unsigned long pg, pgend;
695
696 /*
697 * Convert start_pfn/end_pfn to a struct page pointer.
698 */
699 start_pg = pfn_to_page(start_pfn);
700 end_pg = pfn_to_page(end_pfn);
701
702 /*
703 * Convert to physical addresses, and
704 * round start upwards and end downwards.
705 */
706 pg = PAGE_ALIGN(__pa(start_pg));
707 pgend = __pa(end_pg) & PAGE_MASK;
708
709 /*
710 * If there are free pages between these,
711 * free the section of the memmap array.
712 */
713 if (pg < pgend)
714 free_bootmem_node(NODE_DATA(node), pg, pgend - pg);
715}
716
717static inline void free_unused_memmap_node(int node, struct meminfo *mi)
718{
719 unsigned long bank_start, prev_bank_end = 0;
720 unsigned int i;
721
722 /*
723 * [FIXME] This relies on each bank being in address order. This
724 * may not be the case, especially if the user has provided the
725 * information on the command line.
726 */
727 for (i = 0; i < mi->nr_banks; i++) {
728 if (mi->bank[i].size == 0 || mi->bank[i].node != node)
729 continue;
730
731 bank_start = mi->bank[i].start >> PAGE_SHIFT;
732 if (bank_start < prev_bank_end) {
733 printk(KERN_ERR "MEM: unordered memory banks. "
734 "Not freeing memmap.\n");
735 break;
736 }
737
738 /*
739 * If we had a previous bank, and there is a space
740 * between the current bank and the previous, free it.
741 */
742 if (prev_bank_end && prev_bank_end != bank_start)
743 free_memmap(node, prev_bank_end, bank_start);
744
745 prev_bank_end = PAGE_ALIGN(mi->bank[i].start +
746 mi->bank[i].size) >> PAGE_SHIFT;
747 }
748}
749
750/*
751 * The mem_map array can get very big. Free
752 * the unused area of the memory map.
753 */
754void __init create_memmap_holes(struct meminfo *mi)
755{
756 int node;
757
758 for_each_online_node(node)
759 free_unused_memmap_node(node, mi);
760}
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
new file mode 100644
index 000000000000..32c4b0e35b37
--- /dev/null
+++ b/arch/arm/mm/mmap.c
@@ -0,0 +1,109 @@
1/*
2 * linux/arch/arm/mm/mmap.c
3 */
4#include <linux/config.h>
5#include <linux/fs.h>
6#include <linux/mm.h>
7#include <linux/mman.h>
8#include <linux/shm.h>
9
10#include <asm/system.h>
11
12#define COLOUR_ALIGN(addr,pgoff) \
13 ((((addr)+SHMLBA-1)&~(SHMLBA-1)) + \
14 (((pgoff)<<PAGE_SHIFT) & (SHMLBA-1)))
15
16/*
17 * We need to ensure that shared mappings are correctly aligned to
18 * avoid aliasing issues with VIPT caches. We need to ensure that
19 * a specific page of an object is always mapped at a multiple of
20 * SHMLBA bytes.
21 *
22 * We unconditionally provide this function for all cases, however
23 * in the VIVT case, we optimise out the alignment rules.
24 */
25unsigned long
26arch_get_unmapped_area(struct file *filp, unsigned long addr,
27 unsigned long len, unsigned long pgoff, unsigned long flags)
28{
29 struct mm_struct *mm = current->mm;
30 struct vm_area_struct *vma;
31 unsigned long start_addr;
32#ifdef CONFIG_CPU_V6
33 unsigned int cache_type;
34 int do_align = 0, aliasing = 0;
35
36 /*
37 * We only need to do colour alignment if either the I or D
38 * caches alias. This is indicated by bits 9 and 21 of the
39 * cache type register.
40 */
41 cache_type = read_cpuid(CPUID_CACHETYPE);
42 if (cache_type != read_cpuid(CPUID_ID)) {
43 aliasing = (cache_type | cache_type >> 12) & (1 << 11);
44 if (aliasing)
45 do_align = filp || flags & MAP_SHARED;
46 }
47#else
48#define do_align 0
49#define aliasing 0
50#endif
51
52 /*
53 * We should enforce the MAP_FIXED case. However, currently
54 * the generic kernel code doesn't allow us to handle this.
55 */
56 if (flags & MAP_FIXED) {
57 if (aliasing && flags & MAP_SHARED && addr & (SHMLBA - 1))
58 return -EINVAL;
59 return addr;
60 }
61
62 if (len > TASK_SIZE)
63 return -ENOMEM;
64
65 if (addr) {
66 if (do_align)
67 addr = COLOUR_ALIGN(addr, pgoff);
68 else
69 addr = PAGE_ALIGN(addr);
70
71 vma = find_vma(mm, addr);
72 if (TASK_SIZE - len >= addr &&
73 (!vma || addr + len <= vma->vm_start))
74 return addr;
75 }
76 start_addr = addr = mm->free_area_cache;
77
78full_search:
79 if (do_align)
80 addr = COLOUR_ALIGN(addr, pgoff);
81 else
82 addr = PAGE_ALIGN(addr);
83
84 for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
85 /* At this point: (!vma || addr < vma->vm_end). */
86 if (TASK_SIZE - len < addr) {
87 /*
88 * Start a new search - just in case we missed
89 * some holes.
90 */
91 if (start_addr != TASK_UNMAPPED_BASE) {
92 start_addr = addr = TASK_UNMAPPED_BASE;
93 goto full_search;
94 }
95 return -ENOMEM;
96 }
97 if (!vma || addr + len <= vma->vm_start) {
98 /*
99 * Remember the place where we stopped the search:
100 */
101 mm->free_area_cache = addr + len;
102 return addr;
103 }
104 addr = vma->vm_end;
105 if (do_align)
106 addr = COLOUR_ALIGN(addr, pgoff);
107 }
108}
109
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
new file mode 100644
index 000000000000..0d90227a0a32
--- /dev/null
+++ b/arch/arm/mm/mmu.c
@@ -0,0 +1,45 @@
1/*
2 * linux/arch/arm/mm/mmu.c
3 *
4 * Copyright (C) 2002-2003 Deep Blue Solutions Ltd, all rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/init.h>
11#include <linux/sched.h>
12#include <linux/mm.h>
13
14#include <asm/mmu_context.h>
15#include <asm/tlbflush.h>
16
17unsigned int cpu_last_asid = { 1 << ASID_BITS };
18
19/*
20 * We fork()ed a process, and we need a new context for the child
21 * to run in. We reserve version 0 for initial tasks so we will
22 * always allocate an ASID.
23 */
24void __init_new_context(struct task_struct *tsk, struct mm_struct *mm)
25{
26 mm->context.id = 0;
27}
28
29void __new_context(struct mm_struct *mm)
30{
31 unsigned int asid;
32
33 asid = ++cpu_last_asid;
34 if (asid == 0)
35 asid = cpu_last_asid = 1 << ASID_BITS;
36
37 /*
38 * If we've used up all our ASIDs, we need
39 * to start a new version and flush the TLB.
40 */
41 if ((asid & ~ASID_MASK) == 0)
42 flush_tlb_all();
43
44 mm->context.id = asid;
45}
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
new file mode 100644
index 000000000000..1f325231b9e4
--- /dev/null
+++ b/arch/arm/mm/proc-arm1020.S
@@ -0,0 +1,530 @@
1/*
2 * linux/arch/arm/mm/proc-arm1020.S: MMU functions for ARM1020
3 *
4 * Copyright (C) 2000 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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 * These are the low level assembler for performing cache and TLB
23 * functions on the arm1020.
24 *
25 * CONFIG_CPU_ARM1020_CPU_IDLE -> nohlt
26 */
27#include <linux/linkage.h>
28#include <linux/config.h>
29#include <linux/init.h>
30#include <asm/assembler.h>
31#include <asm/constants.h>
32#include <asm/pgtable.h>
33#include <asm/procinfo.h>
34#include <asm/ptrace.h>
35#include <asm/hardware.h>
36
37/*
38 * This is the maximum size of an area which will be invalidated
39 * using the single invalidate entry instructions. Anything larger
40 * than this, and we go for the whole cache.
41 *
42 * This value should be chosen such that we choose the cheapest
43 * alternative.
44 */
45#define MAX_AREA_SIZE 32768
46
47/*
48 * The size of one data cache line.
49 */
50#define CACHE_DLINESIZE 32
51
52/*
53 * The number of data cache segments.
54 */
55#define CACHE_DSEGMENTS 16
56
57/*
58 * The number of lines in a cache segment.
59 */
60#define CACHE_DENTRIES 64
61
62/*
63 * This is the size at which it becomes more efficient to
64 * clean the whole cache, rather than using the individual
65 * cache line maintainence instructions.
66 */
67#define CACHE_DLIMIT 32768
68
69 .text
70/*
71 * cpu_arm1020_proc_init()
72 */
73ENTRY(cpu_arm1020_proc_init)
74 mov pc, lr
75
76/*
77 * cpu_arm1020_proc_fin()
78 */
79ENTRY(cpu_arm1020_proc_fin)
80 stmfd sp!, {lr}
81 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
82 msr cpsr_c, ip
83 bl arm1020_flush_kern_cache_all
84 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
85 bic r0, r0, #0x1000 @ ...i............
86 bic r0, r0, #0x000e @ ............wca.
87 mcr p15, 0, r0, c1, c0, 0 @ disable caches
88 ldmfd sp!, {pc}
89
90/*
91 * cpu_arm1020_reset(loc)
92 *
93 * Perform a soft reset of the system. Put the CPU into the
94 * same state as it would be if it had been reset, and branch
95 * to what would be the reset vector.
96 *
97 * loc: location to jump to for soft reset
98 */
99 .align 5
100ENTRY(cpu_arm1020_reset)
101 mov ip, #0
102 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
103 mcr p15, 0, ip, c7, c10, 4 @ drain WB
104 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
105 mrc p15, 0, ip, c1, c0, 0 @ ctrl register
106 bic ip, ip, #0x000f @ ............wcam
107 bic ip, ip, #0x1100 @ ...i...s........
108 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
109 mov pc, r0
110
111/*
112 * cpu_arm1020_do_idle()
113 */
114 .align 5
115ENTRY(cpu_arm1020_do_idle)
116 mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
117 mov pc, lr
118
119/* ================================= CACHE ================================ */
120
121 .align 5
122/*
123 * flush_user_cache_all()
124 *
125 * Invalidate all cache entries in a particular address
126 * space.
127 */
128ENTRY(arm1020_flush_user_cache_all)
129 /* FALLTHROUGH */
130/*
131 * flush_kern_cache_all()
132 *
133 * Clean and invalidate the entire cache.
134 */
135ENTRY(arm1020_flush_kern_cache_all)
136 mov r2, #VM_EXEC
137 mov ip, #0
138__flush_whole_cache:
139#ifndef CONFIG_CPU_DCACHE_DISABLE
140 mcr p15, 0, ip, c7, c10, 4 @ drain WB
141 mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 16 segments
1421: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries
1432: mcr p15, 0, r3, c7, c14, 2 @ clean+invalidate D index
144 mcr p15, 0, ip, c7, c10, 4 @ drain WB
145 subs r3, r3, #1 << 26
146 bcs 2b @ entries 63 to 0
147 subs r1, r1, #1 << 5
148 bcs 1b @ segments 15 to 0
149#endif
150 tst r2, #VM_EXEC
151#ifndef CONFIG_CPU_ICACHE_DISABLE
152 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
153#endif
154 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
155 mov pc, lr
156
157/*
158 * flush_user_cache_range(start, end, flags)
159 *
160 * Invalidate a range of cache entries in the specified
161 * address space.
162 *
163 * - start - start address (inclusive)
164 * - end - end address (exclusive)
165 * - flags - vm_flags for this space
166 */
167ENTRY(arm1020_flush_user_cache_range)
168 mov ip, #0
169 sub r3, r1, r0 @ calculate total size
170 cmp r3, #CACHE_DLIMIT
171 bhs __flush_whole_cache
172
173#ifndef CONFIG_CPU_DCACHE_DISABLE
174 mcr p15, 0, ip, c7, c10, 4
1751: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
176 mcr p15, 0, ip, c7, c10, 4 @ drain WB
177 add r0, r0, #CACHE_DLINESIZE
178 cmp r0, r1
179 blo 1b
180#endif
181 tst r2, #VM_EXEC
182#ifndef CONFIG_CPU_ICACHE_DISABLE
183 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
184#endif
185 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
186 mov pc, lr
187
188/*
189 * coherent_kern_range(start, end)
190 *
191 * Ensure coherency between the Icache and the Dcache in the
192 * region described by start. If you have non-snooping
193 * Harvard caches, you need to implement this function.
194 *
195 * - start - virtual start address
196 * - end - virtual end address
197 */
198ENTRY(arm1020_coherent_kern_range)
199 /* FALLTRHOUGH */
200
201/*
202 * coherent_user_range(start, end)
203 *
204 * Ensure coherency between the Icache and the Dcache in the
205 * region described by start. If you have non-snooping
206 * Harvard caches, you need to implement this function.
207 *
208 * - start - virtual start address
209 * - end - virtual end address
210 */
211ENTRY(arm1020_coherent_user_range)
212 mov ip, #0
213 bic r0, r0, #CACHE_DLINESIZE - 1
214 mcr p15, 0, ip, c7, c10, 4
2151:
216#ifndef CONFIG_CPU_DCACHE_DISABLE
217 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
218 mcr p15, 0, ip, c7, c10, 4 @ drain WB
219#endif
220#ifndef CONFIG_CPU_ICACHE_DISABLE
221 mcr p15, 0, r0, c7, c5, 1 @ invalidate I entry
222#endif
223 add r0, r0, #CACHE_DLINESIZE
224 cmp r0, r1
225 blo 1b
226 mcr p15, 0, ip, c7, c10, 4 @ drain WB
227 mov pc, lr
228
229/*
230 * flush_kern_dcache_page(void *page)
231 *
232 * Ensure no D cache aliasing occurs, either with itself or
233 * the I cache
234 *
235 * - page - page aligned address
236 */
237ENTRY(arm1020_flush_kern_dcache_page)
238 mov ip, #0
239#ifndef CONFIG_CPU_DCACHE_DISABLE
240 add r1, r0, #PAGE_SZ
2411: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
242 mcr p15, 0, ip, c7, c10, 4 @ drain WB
243 add r0, r0, #CACHE_DLINESIZE
244 cmp r0, r1
245 blo 1b
246#endif
247 mcr p15, 0, ip, c7, c10, 4 @ drain WB
248 mov pc, lr
249
250/*
251 * dma_inv_range(start, end)
252 *
253 * Invalidate (discard) the specified virtual address range.
254 * May not write back any entries. If 'start' or 'end'
255 * are not cache line aligned, those lines must be written
256 * back.
257 *
258 * - start - virtual start address
259 * - end - virtual end address
260 *
261 * (same as v4wb)
262 */
263ENTRY(arm1020_dma_inv_range)
264 mov ip, #0
265#ifndef CONFIG_CPU_DCACHE_DISABLE
266 tst r0, #CACHE_DLINESIZE - 1
267 bic r0, r0, #CACHE_DLINESIZE - 1
268 mcrne p15, 0, ip, c7, c10, 4
269 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
270 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
271 tst r1, #CACHE_DLINESIZE - 1
272 mcrne p15, 0, ip, c7, c10, 4
273 mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
274 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
2751: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
276 add r0, r0, #CACHE_DLINESIZE
277 cmp r0, r1
278 blo 1b
279#endif
280 mcr p15, 0, ip, c7, c10, 4 @ drain WB
281 mov pc, lr
282
283/*
284 * dma_clean_range(start, end)
285 *
286 * Clean the specified virtual address range.
287 *
288 * - start - virtual start address
289 * - end - virtual end address
290 *
291 * (same as v4wb)
292 */
293ENTRY(arm1020_dma_clean_range)
294 mov ip, #0
295#ifndef CONFIG_CPU_DCACHE_DISABLE
296 bic r0, r0, #CACHE_DLINESIZE - 1
2971: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
298 mcr p15, 0, ip, c7, c10, 4 @ drain WB
299 add r0, r0, #CACHE_DLINESIZE
300 cmp r0, r1
301 blo 1b
302#endif
303 mcr p15, 0, ip, c7, c10, 4 @ drain WB
304 mov pc, lr
305
306/*
307 * dma_flush_range(start, end)
308 *
309 * Clean and invalidate the specified virtual address range.
310 *
311 * - start - virtual start address
312 * - end - virtual end address
313 */
314ENTRY(arm1020_dma_flush_range)
315 mov ip, #0
316#ifndef CONFIG_CPU_DCACHE_DISABLE
317 bic r0, r0, #CACHE_DLINESIZE - 1
318 mcr p15, 0, ip, c7, c10, 4
3191: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
320 mcr p15, 0, ip, c7, c10, 4 @ drain WB
321 add r0, r0, #CACHE_DLINESIZE
322 cmp r0, r1
323 blo 1b
324#endif
325 mcr p15, 0, ip, c7, c10, 4 @ drain WB
326 mov pc, lr
327
328ENTRY(arm1020_cache_fns)
329 .long arm1020_flush_kern_cache_all
330 .long arm1020_flush_user_cache_all
331 .long arm1020_flush_user_cache_range
332 .long arm1020_coherent_kern_range
333 .long arm1020_coherent_user_range
334 .long arm1020_flush_kern_dcache_page
335 .long arm1020_dma_inv_range
336 .long arm1020_dma_clean_range
337 .long arm1020_dma_flush_range
338
339 .align 5
340ENTRY(cpu_arm1020_dcache_clean_area)
341#ifndef CONFIG_CPU_DCACHE_DISABLE
342 mov ip, #0
3431: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
344 mcr p15, 0, ip, c7, c10, 4 @ drain WB
345 add r0, r0, #CACHE_DLINESIZE
346 subs r1, r1, #CACHE_DLINESIZE
347 bhi 1b
348#endif
349 mov pc, lr
350
351/* =============================== PageTable ============================== */
352
353/*
354 * cpu_arm1020_switch_mm(pgd)
355 *
356 * Set the translation base pointer to be as described by pgd.
357 *
358 * pgd: new page tables
359 */
360 .align 5
361ENTRY(cpu_arm1020_switch_mm)
362#ifndef CONFIG_CPU_DCACHE_DISABLE
363 mcr p15, 0, r3, c7, c10, 4
364 mov r1, #0xF @ 16 segments
3651: mov r3, #0x3F @ 64 entries
3662: mov ip, r3, LSL #26 @ shift up entry
367 orr ip, ip, r1, LSL #5 @ shift in/up index
368 mcr p15, 0, ip, c7, c14, 2 @ Clean & Inval DCache entry
369 mov ip, #0
370 mcr p15, 0, ip, c7, c10, 4
371 subs r3, r3, #1
372 cmp r3, #0
373 bge 2b @ entries 3F to 0
374 subs r1, r1, #1
375 cmp r1, #0
376 bge 1b @ segments 15 to 0
377
378#endif
379 mov r1, #0
380#ifndef CONFIG_CPU_ICACHE_DISABLE
381 mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache
382#endif
383 mcr p15, 0, r1, c7, c10, 4 @ drain WB
384 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
385 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
386 mov pc, lr
387
388/*
389 * cpu_arm1020_set_pte(ptep, pte)
390 *
391 * Set a PTE and flush it out
392 */
393 .align 5
394ENTRY(cpu_arm1020_set_pte)
395 str r1, [r0], #-2048 @ linux version
396
397 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
398
399 bic r2, r1, #PTE_SMALL_AP_MASK
400 bic r2, r2, #PTE_TYPE_MASK
401 orr r2, r2, #PTE_TYPE_SMALL
402
403 tst r1, #L_PTE_USER @ User?
404 orrne r2, r2, #PTE_SMALL_AP_URO_SRW
405
406 tst r1, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
407 orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
408
409 tst r1, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young?
410 movne r2, #0
411
412#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
413 eor r3, r1, #0x0a @ C & small page?
414 tst r3, #0x0b
415 biceq r2, r2, #4
416#endif
417 str r2, [r0] @ hardware version
418 mov r0, r0
419#ifndef CONFIG_CPU_DCACHE_DISABLE
420 mcr p15, 0, r0, c7, c10, 4
421 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
422#endif
423 mcr p15, 0, r0, c7, c10, 4 @ drain WB
424 mov pc, lr
425
426 __INIT
427
428 .type __arm1020_setup, #function
429__arm1020_setup:
430 mov r0, #0
431 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
432 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
433 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4
434 mrc p15, 0, r0, c1, c0 @ get control register v4
435 ldr r5, arm1020_cr1_clear
436 bic r0, r0, r5
437 ldr r5, arm1020_cr1_set
438 orr r0, r0, r5
439#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
440 orr r0, r0, #0x4000 @ .R.. .... .... ....
441#endif
442 mov pc, lr
443 .size __arm1020_setup, . - __arm1020_setup
444
445 /*
446 * R
447 * .RVI ZFRS BLDP WCAM
448 * .0.1 1001 ..11 0101 /* FIXME: why no V bit? */
449 */
450 .type arm1020_cr1_clear, #object
451 .type arm1020_cr1_set, #object
452arm1020_cr1_clear:
453 .word 0x593f
454arm1020_cr1_set:
455 .word 0x1935
456
457 __INITDATA
458
459/*
460 * Purpose : Function pointers used to access above functions - all calls
461 * come through these
462 */
463 .type arm1020_processor_functions, #object
464arm1020_processor_functions:
465 .word v4t_early_abort
466 .word cpu_arm1020_proc_init
467 .word cpu_arm1020_proc_fin
468 .word cpu_arm1020_reset
469 .word cpu_arm1020_do_idle
470 .word cpu_arm1020_dcache_clean_area
471 .word cpu_arm1020_switch_mm
472 .word cpu_arm1020_set_pte
473 .size arm1020_processor_functions, . - arm1020_processor_functions
474
475 .section ".rodata"
476
477 .type cpu_arch_name, #object
478cpu_arch_name:
479 .asciz "armv5t"
480 .size cpu_arch_name, . - cpu_arch_name
481
482 .type cpu_elf_name, #object
483cpu_elf_name:
484 .asciz "v5"
485 .size cpu_elf_name, . - cpu_elf_name
486
487 .type cpu_arm1020_name, #object
488cpu_arm1020_name:
489 .ascii "ARM1020"
490#ifndef CONFIG_CPU_ICACHE_DISABLE
491 .ascii "i"
492#endif
493#ifndef CONFIG_CPU_DCACHE_DISABLE
494 .ascii "d"
495#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
496 .ascii "(wt)"
497#else
498 .ascii "(wb)"
499#endif
500#endif
501#ifndef CONFIG_CPU_BPREDICT_DISABLE
502 .ascii "B"
503#endif
504#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
505 .ascii "RR"
506#endif
507 .ascii "\0"
508 .size cpu_arm1020_name, . - cpu_arm1020_name
509
510 .align
511
512 .section ".proc.info", #alloc, #execinstr
513
514 .type __arm1020_proc_info,#object
515__arm1020_proc_info:
516 .long 0x4104a200 @ ARM 1020T (Architecture v5T)
517 .long 0xff0ffff0
518 .long PMD_TYPE_SECT | \
519 PMD_SECT_AP_WRITE | \
520 PMD_SECT_AP_READ
521 b __arm1020_setup
522 .long cpu_arch_name
523 .long cpu_elf_name
524 .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB
525 .long cpu_arm1020_name
526 .long arm1020_processor_functions
527 .long v4wbi_tlb_fns
528 .long v4wb_user_fns
529 .long arm1020_cache_fns
530 .size __arm1020_proc_info, . - __arm1020_proc_info
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
new file mode 100644
index 000000000000..142a2c2d6f0b
--- /dev/null
+++ b/arch/arm/mm/proc-arm1020e.S
@@ -0,0 +1,513 @@
1/*
2 * linux/arch/arm/mm/proc-arm1020e.S: MMU functions for ARM1020
3 *
4 * Copyright (C) 2000 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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 * These are the low level assembler for performing cache and TLB
23 * functions on the arm1020e.
24 *
25 * CONFIG_CPU_ARM1020_CPU_IDLE -> nohlt
26 */
27#include <linux/linkage.h>
28#include <linux/config.h>
29#include <linux/init.h>
30#include <asm/assembler.h>
31#include <asm/constants.h>
32#include <asm/pgtable.h>
33#include <asm/procinfo.h>
34#include <asm/ptrace.h>
35#include <asm/hardware.h>
36
37/*
38 * This is the maximum size of an area which will be invalidated
39 * using the single invalidate entry instructions. Anything larger
40 * than this, and we go for the whole cache.
41 *
42 * This value should be chosen such that we choose the cheapest
43 * alternative.
44 */
45#define MAX_AREA_SIZE 32768
46
47/*
48 * The size of one data cache line.
49 */
50#define CACHE_DLINESIZE 32
51
52/*
53 * The number of data cache segments.
54 */
55#define CACHE_DSEGMENTS 16
56
57/*
58 * The number of lines in a cache segment.
59 */
60#define CACHE_DENTRIES 64
61
62/*
63 * This is the size at which it becomes more efficient to
64 * clean the whole cache, rather than using the individual
65 * cache line maintainence instructions.
66 */
67#define CACHE_DLIMIT 32768
68
69 .text
70/*
71 * cpu_arm1020e_proc_init()
72 */
73ENTRY(cpu_arm1020e_proc_init)
74 mov pc, lr
75
76/*
77 * cpu_arm1020e_proc_fin()
78 */
79ENTRY(cpu_arm1020e_proc_fin)
80 stmfd sp!, {lr}
81 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
82 msr cpsr_c, ip
83 bl arm1020e_flush_kern_cache_all
84 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
85 bic r0, r0, #0x1000 @ ...i............
86 bic r0, r0, #0x000e @ ............wca.
87 mcr p15, 0, r0, c1, c0, 0 @ disable caches
88 ldmfd sp!, {pc}
89
90/*
91 * cpu_arm1020e_reset(loc)
92 *
93 * Perform a soft reset of the system. Put the CPU into the
94 * same state as it would be if it had been reset, and branch
95 * to what would be the reset vector.
96 *
97 * loc: location to jump to for soft reset
98 */
99 .align 5
100ENTRY(cpu_arm1020e_reset)
101 mov ip, #0
102 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
103 mcr p15, 0, ip, c7, c10, 4 @ drain WB
104 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
105 mrc p15, 0, ip, c1, c0, 0 @ ctrl register
106 bic ip, ip, #0x000f @ ............wcam
107 bic ip, ip, #0x1100 @ ...i...s........
108 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
109 mov pc, r0
110
111/*
112 * cpu_arm1020e_do_idle()
113 */
114 .align 5
115ENTRY(cpu_arm1020e_do_idle)
116 mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
117 mov pc, lr
118
119/* ================================= CACHE ================================ */
120
121 .align 5
122/*
123 * flush_user_cache_all()
124 *
125 * Invalidate all cache entries in a particular address
126 * space.
127 */
128ENTRY(arm1020e_flush_user_cache_all)
129 /* FALLTHROUGH */
130/*
131 * flush_kern_cache_all()
132 *
133 * Clean and invalidate the entire cache.
134 */
135ENTRY(arm1020e_flush_kern_cache_all)
136 mov r2, #VM_EXEC
137 mov ip, #0
138__flush_whole_cache:
139#ifndef CONFIG_CPU_DCACHE_DISABLE
140 mcr p15, 0, ip, c7, c10, 4 @ drain WB
141 mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 16 segments
1421: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries
1432: mcr p15, 0, r3, c7, c14, 2 @ clean+invalidate D index
144 subs r3, r3, #1 << 26
145 bcs 2b @ entries 63 to 0
146 subs r1, r1, #1 << 5
147 bcs 1b @ segments 15 to 0
148#endif
149 tst r2, #VM_EXEC
150#ifndef CONFIG_CPU_ICACHE_DISABLE
151 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
152#endif
153 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
154 mov pc, lr
155
156/*
157 * flush_user_cache_range(start, end, flags)
158 *
159 * Invalidate a range of cache entries in the specified
160 * address space.
161 *
162 * - start - start address (inclusive)
163 * - end - end address (exclusive)
164 * - flags - vm_flags for this space
165 */
166ENTRY(arm1020e_flush_user_cache_range)
167 mov ip, #0
168 sub r3, r1, r0 @ calculate total size
169 cmp r3, #CACHE_DLIMIT
170 bhs __flush_whole_cache
171
172#ifndef CONFIG_CPU_DCACHE_DISABLE
1731: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
174 add r0, r0, #CACHE_DLINESIZE
175 cmp r0, r1
176 blo 1b
177#endif
178 tst r2, #VM_EXEC
179#ifndef CONFIG_CPU_ICACHE_DISABLE
180 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
181#endif
182 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
183 mov pc, lr
184
185/*
186 * coherent_kern_range(start, end)
187 *
188 * Ensure coherency between the Icache and the Dcache in the
189 * region described by start. If you have non-snooping
190 * Harvard caches, you need to implement this function.
191 *
192 * - start - virtual start address
193 * - end - virtual end address
194 */
195ENTRY(arm1020e_coherent_kern_range)
196 /* FALLTHROUGH */
197/*
198 * coherent_user_range(start, end)
199 *
200 * Ensure coherency between the Icache and the Dcache in the
201 * region described by start. If you have non-snooping
202 * Harvard caches, you need to implement this function.
203 *
204 * - start - virtual start address
205 * - end - virtual end address
206 */
207ENTRY(arm1020e_coherent_user_range)
208 mov ip, #0
209 bic r0, r0, #CACHE_DLINESIZE - 1
2101:
211#ifndef CONFIG_CPU_DCACHE_DISABLE
212 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
213#endif
214#ifndef CONFIG_CPU_ICACHE_DISABLE
215 mcr p15, 0, r0, c7, c5, 1 @ invalidate I entry
216#endif
217 add r0, r0, #CACHE_DLINESIZE
218 cmp r0, r1
219 blo 1b
220 mcr p15, 0, ip, c7, c10, 4 @ drain WB
221 mov pc, lr
222
223/*
224 * flush_kern_dcache_page(void *page)
225 *
226 * Ensure no D cache aliasing occurs, either with itself or
227 * the I cache
228 *
229 * - page - page aligned address
230 */
231ENTRY(arm1020e_flush_kern_dcache_page)
232 mov ip, #0
233#ifndef CONFIG_CPU_DCACHE_DISABLE
234 add r1, r0, #PAGE_SZ
2351: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
236 add r0, r0, #CACHE_DLINESIZE
237 cmp r0, r1
238 blo 1b
239#endif
240 mcr p15, 0, ip, c7, c10, 4 @ drain WB
241 mov pc, lr
242
243/*
244 * dma_inv_range(start, end)
245 *
246 * Invalidate (discard) the specified virtual address range.
247 * May not write back any entries. If 'start' or 'end'
248 * are not cache line aligned, those lines must be written
249 * back.
250 *
251 * - start - virtual start address
252 * - end - virtual end address
253 *
254 * (same as v4wb)
255 */
256ENTRY(arm1020e_dma_inv_range)
257 mov ip, #0
258#ifndef CONFIG_CPU_DCACHE_DISABLE
259 tst r0, #CACHE_DLINESIZE - 1
260 bic r0, r0, #CACHE_DLINESIZE - 1
261 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
262 tst r1, #CACHE_DLINESIZE - 1
263 mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
2641: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
265 add r0, r0, #CACHE_DLINESIZE
266 cmp r0, r1
267 blo 1b
268#endif
269 mcr p15, 0, ip, c7, c10, 4 @ drain WB
270 mov pc, lr
271
272/*
273 * dma_clean_range(start, end)
274 *
275 * Clean the specified virtual address range.
276 *
277 * - start - virtual start address
278 * - end - virtual end address
279 *
280 * (same as v4wb)
281 */
282ENTRY(arm1020e_dma_clean_range)
283 mov ip, #0
284#ifndef CONFIG_CPU_DCACHE_DISABLE
285 bic r0, r0, #CACHE_DLINESIZE - 1
2861: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
287 add r0, r0, #CACHE_DLINESIZE
288 cmp r0, r1
289 blo 1b
290#endif
291 mcr p15, 0, ip, c7, c10, 4 @ drain WB
292 mov pc, lr
293
294/*
295 * dma_flush_range(start, end)
296 *
297 * Clean and invalidate the specified virtual address range.
298 *
299 * - start - virtual start address
300 * - end - virtual end address
301 */
302ENTRY(arm1020e_dma_flush_range)
303 mov ip, #0
304#ifndef CONFIG_CPU_DCACHE_DISABLE
305 bic r0, r0, #CACHE_DLINESIZE - 1
3061: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
307 add r0, r0, #CACHE_DLINESIZE
308 cmp r0, r1
309 blo 1b
310#endif
311 mcr p15, 0, ip, c7, c10, 4 @ drain WB
312 mov pc, lr
313
314ENTRY(arm1020e_cache_fns)
315 .long arm1020e_flush_kern_cache_all
316 .long arm1020e_flush_user_cache_all
317 .long arm1020e_flush_user_cache_range
318 .long arm1020e_coherent_kern_range
319 .long arm1020e_coherent_user_range
320 .long arm1020e_flush_kern_dcache_page
321 .long arm1020e_dma_inv_range
322 .long arm1020e_dma_clean_range
323 .long arm1020e_dma_flush_range
324
325 .align 5
326ENTRY(cpu_arm1020e_dcache_clean_area)
327#ifndef CONFIG_CPU_DCACHE_DISABLE
328 mov ip, #0
3291: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
330 add r0, r0, #CACHE_DLINESIZE
331 subs r1, r1, #CACHE_DLINESIZE
332 bhi 1b
333#endif
334 mov pc, lr
335
336/* =============================== PageTable ============================== */
337
338/*
339 * cpu_arm1020e_switch_mm(pgd)
340 *
341 * Set the translation base pointer to be as described by pgd.
342 *
343 * pgd: new page tables
344 */
345 .align 5
346ENTRY(cpu_arm1020e_switch_mm)
347#ifndef CONFIG_CPU_DCACHE_DISABLE
348 mcr p15, 0, r3, c7, c10, 4
349 mov r1, #0xF @ 16 segments
3501: mov r3, #0x3F @ 64 entries
3512: mov ip, r3, LSL #26 @ shift up entry
352 orr ip, ip, r1, LSL #5 @ shift in/up index
353 mcr p15, 0, ip, c7, c14, 2 @ Clean & Inval DCache entry
354 mov ip, #0
355 subs r3, r3, #1
356 cmp r3, #0
357 bge 2b @ entries 3F to 0
358 subs r1, r1, #1
359 cmp r1, #0
360 bge 1b @ segments 15 to 0
361
362#endif
363 mov r1, #0
364#ifndef CONFIG_CPU_ICACHE_DISABLE
365 mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache
366#endif
367 mcr p15, 0, r1, c7, c10, 4 @ drain WB
368 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
369 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
370 mov pc, lr
371
372/*
373 * cpu_arm1020e_set_pte(ptep, pte)
374 *
375 * Set a PTE and flush it out
376 */
377 .align 5
378ENTRY(cpu_arm1020e_set_pte)
379 str r1, [r0], #-2048 @ linux version
380
381 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
382
383 bic r2, r1, #PTE_SMALL_AP_MASK
384 bic r2, r2, #PTE_TYPE_MASK
385 orr r2, r2, #PTE_TYPE_SMALL
386
387 tst r1, #L_PTE_USER @ User?
388 orrne r2, r2, #PTE_SMALL_AP_URO_SRW
389
390 tst r1, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
391 orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
392
393 tst r1, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young?
394 movne r2, #0
395
396#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
397 eor r3, r1, #0x0a @ C & small page?
398 tst r3, #0x0b
399 biceq r2, r2, #4
400#endif
401 str r2, [r0] @ hardware version
402 mov r0, r0
403#ifndef CONFIG_CPU_DCACHE_DISABLE
404 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
405#endif
406 mov pc, lr
407
408 __INIT
409
410 .type __arm1020e_setup, #function
411__arm1020e_setup:
412 mov r0, #0
413 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
414 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
415 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4
416 mrc p15, 0, r0, c1, c0 @ get control register v4
417 ldr r5, arm1020e_cr1_clear
418 bic r0, r0, r5
419 ldr r5, arm1020e_cr1_set
420 orr r0, r0, r5
421#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
422 orr r0, r0, #0x4000 @ .R.. .... .... ....
423#endif
424 mov pc, lr
425 .size __arm1020e_setup, . - __arm1020e_setup
426
427 /*
428 * R
429 * .RVI ZFRS BLDP WCAM
430 * .0.1 1001 ..11 0101 /* FIXME: why no V bit? */
431 */
432 .type arm1020e_cr1_clear, #object
433 .type arm1020e_cr1_set, #object
434arm1020e_cr1_clear:
435 .word 0x5f3f
436arm1020e_cr1_set:
437 .word 0x1935
438
439 __INITDATA
440
441/*
442 * Purpose : Function pointers used to access above functions - all calls
443 * come through these
444 */
445 .type arm1020e_processor_functions, #object
446arm1020e_processor_functions:
447 .word v4t_early_abort
448 .word cpu_arm1020e_proc_init
449 .word cpu_arm1020e_proc_fin
450 .word cpu_arm1020e_reset
451 .word cpu_arm1020e_do_idle
452 .word cpu_arm1020e_dcache_clean_area
453 .word cpu_arm1020e_switch_mm
454 .word cpu_arm1020e_set_pte
455 .size arm1020e_processor_functions, . - arm1020e_processor_functions
456
457 .section ".rodata"
458
459 .type cpu_arch_name, #object
460cpu_arch_name:
461 .asciz "armv5te"
462 .size cpu_arch_name, . - cpu_arch_name
463
464 .type cpu_elf_name, #object
465cpu_elf_name:
466 .asciz "v5"
467 .size cpu_elf_name, . - cpu_elf_name
468
469 .type cpu_arm1020e_name, #object
470cpu_arm1020e_name:
471 .ascii "ARM1020E"
472#ifndef CONFIG_CPU_ICACHE_DISABLE
473 .ascii "i"
474#endif
475#ifndef CONFIG_CPU_DCACHE_DISABLE
476 .ascii "d"
477#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
478 .ascii "(wt)"
479#else
480 .ascii "(wb)"
481#endif
482#endif
483#ifndef CONFIG_CPU_BPREDICT_DISABLE
484 .ascii "B"
485#endif
486#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
487 .ascii "RR"
488#endif
489 .ascii "\0"
490 .size cpu_arm1020e_name, . - cpu_arm1020e_name
491
492 .align
493
494 .section ".proc.info", #alloc, #execinstr
495
496 .type __arm1020e_proc_info,#object
497__arm1020e_proc_info:
498 .long 0x4105a200 @ ARM 1020TE (Architecture v5TE)
499 .long 0xff0ffff0
500 .long PMD_TYPE_SECT | \
501 PMD_BIT4 | \
502 PMD_SECT_AP_WRITE | \
503 PMD_SECT_AP_READ
504 b __arm1020e_setup
505 .long cpu_arch_name
506 .long cpu_elf_name
507 .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB | HWCAP_EDSP
508 .long cpu_arm1020e_name
509 .long arm1020e_processor_functions
510 .long v4wbi_tlb_fns
511 .long v4wb_user_fns
512 .long arm1020e_cache_fns
513 .size __arm1020e_proc_info, . - __arm1020e_proc_info
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S
new file mode 100644
index 000000000000..747ed963e1df
--- /dev/null
+++ b/arch/arm/mm/proc-arm1022.S
@@ -0,0 +1,495 @@
1/*
2 * linux/arch/arm/mm/proc-arm1022.S: MMU functions for ARM1022E
3 *
4 * Copyright (C) 2000 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 *
13 * These are the low level assembler for performing cache and TLB
14 * functions on the ARM1022E.
15 */
16#include <linux/linkage.h>
17#include <linux/config.h>
18#include <linux/init.h>
19#include <asm/assembler.h>
20#include <asm/constants.h>
21#include <asm/pgtable.h>
22#include <asm/procinfo.h>
23#include <asm/ptrace.h>
24
25/*
26 * This is the maximum size of an area which will be invalidated
27 * using the single invalidate entry instructions. Anything larger
28 * than this, and we go for the whole cache.
29 *
30 * This value should be chosen such that we choose the cheapest
31 * alternative.
32 */
33#define MAX_AREA_SIZE 32768
34
35/*
36 * The size of one data cache line.
37 */
38#define CACHE_DLINESIZE 32
39
40/*
41 * The number of data cache segments.
42 */
43#define CACHE_DSEGMENTS 16
44
45/*
46 * The number of lines in a cache segment.
47 */
48#define CACHE_DENTRIES 64
49
50/*
51 * This is the size at which it becomes more efficient to
52 * clean the whole cache, rather than using the individual
53 * cache line maintainence instructions.
54 */
55#define CACHE_DLIMIT 32768
56
57 .text
58/*
59 * cpu_arm1022_proc_init()
60 */
61ENTRY(cpu_arm1022_proc_init)
62 mov pc, lr
63
64/*
65 * cpu_arm1022_proc_fin()
66 */
67ENTRY(cpu_arm1022_proc_fin)
68 stmfd sp!, {lr}
69 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
70 msr cpsr_c, ip
71 bl arm1022_flush_kern_cache_all
72 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
73 bic r0, r0, #0x1000 @ ...i............
74 bic r0, r0, #0x000e @ ............wca.
75 mcr p15, 0, r0, c1, c0, 0 @ disable caches
76 ldmfd sp!, {pc}
77
78/*
79 * cpu_arm1022_reset(loc)
80 *
81 * Perform a soft reset of the system. Put the CPU into the
82 * same state as it would be if it had been reset, and branch
83 * to what would be the reset vector.
84 *
85 * loc: location to jump to for soft reset
86 */
87 .align 5
88ENTRY(cpu_arm1022_reset)
89 mov ip, #0
90 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
91 mcr p15, 0, ip, c7, c10, 4 @ drain WB
92 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
93 mrc p15, 0, ip, c1, c0, 0 @ ctrl register
94 bic ip, ip, #0x000f @ ............wcam
95 bic ip, ip, #0x1100 @ ...i...s........
96 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
97 mov pc, r0
98
99/*
100 * cpu_arm1022_do_idle()
101 */
102 .align 5
103ENTRY(cpu_arm1022_do_idle)
104 mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
105 mov pc, lr
106
107/* ================================= CACHE ================================ */
108
109 .align 5
110/*
111 * flush_user_cache_all()
112 *
113 * Invalidate all cache entries in a particular address
114 * space.
115 */
116ENTRY(arm1022_flush_user_cache_all)
117 /* FALLTHROUGH */
118/*
119 * flush_kern_cache_all()
120 *
121 * Clean and invalidate the entire cache.
122 */
123ENTRY(arm1022_flush_kern_cache_all)
124 mov r2, #VM_EXEC
125 mov ip, #0
126__flush_whole_cache:
127#ifndef CONFIG_CPU_DCACHE_DISABLE
128 mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 16 segments
1291: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries
1302: mcr p15, 0, r3, c7, c14, 2 @ clean+invalidate D index
131 subs r3, r3, #1 << 26
132 bcs 2b @ entries 63 to 0
133 subs r1, r1, #1 << 5
134 bcs 1b @ segments 15 to 0
135#endif
136 tst r2, #VM_EXEC
137#ifndef CONFIG_CPU_ICACHE_DISABLE
138 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
139#endif
140 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
141 mov pc, lr
142
143/*
144 * flush_user_cache_range(start, end, flags)
145 *
146 * Invalidate a range of cache entries in the specified
147 * address space.
148 *
149 * - start - start address (inclusive)
150 * - end - end address (exclusive)
151 * - flags - vm_flags for this space
152 */
153ENTRY(arm1022_flush_user_cache_range)
154 mov ip, #0
155 sub r3, r1, r0 @ calculate total size
156 cmp r3, #CACHE_DLIMIT
157 bhs __flush_whole_cache
158
159#ifndef CONFIG_CPU_DCACHE_DISABLE
1601: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
161 add r0, r0, #CACHE_DLINESIZE
162 cmp r0, r1
163 blo 1b
164#endif
165 tst r2, #VM_EXEC
166#ifndef CONFIG_CPU_ICACHE_DISABLE
167 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
168#endif
169 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
170 mov pc, lr
171
172/*
173 * coherent_kern_range(start, end)
174 *
175 * Ensure coherency between the Icache and the Dcache in the
176 * region described by start. If you have non-snooping
177 * Harvard caches, you need to implement this function.
178 *
179 * - start - virtual start address
180 * - end - virtual end address
181 */
182ENTRY(arm1022_coherent_kern_range)
183 /* FALLTHROUGH */
184
185/*
186 * coherent_user_range(start, end)
187 *
188 * Ensure coherency between the Icache and the Dcache in the
189 * region described by start. If you have non-snooping
190 * Harvard caches, you need to implement this function.
191 *
192 * - start - virtual start address
193 * - end - virtual end address
194 */
195ENTRY(arm1022_coherent_user_range)
196 mov ip, #0
197 bic r0, r0, #CACHE_DLINESIZE - 1
1981:
199#ifndef CONFIG_CPU_DCACHE_DISABLE
200 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
201#endif
202#ifndef CONFIG_CPU_ICACHE_DISABLE
203 mcr p15, 0, r0, c7, c5, 1 @ invalidate I entry
204#endif
205 add r0, r0, #CACHE_DLINESIZE
206 cmp r0, r1
207 blo 1b
208 mcr p15, 0, ip, c7, c10, 4 @ drain WB
209 mov pc, lr
210
211/*
212 * flush_kern_dcache_page(void *page)
213 *
214 * Ensure no D cache aliasing occurs, either with itself or
215 * the I cache
216 *
217 * - page - page aligned address
218 */
219ENTRY(arm1022_flush_kern_dcache_page)
220 mov ip, #0
221#ifndef CONFIG_CPU_DCACHE_DISABLE
222 add r1, r0, #PAGE_SZ
2231: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
224 add r0, r0, #CACHE_DLINESIZE
225 cmp r0, r1
226 blo 1b
227#endif
228 mcr p15, 0, ip, c7, c10, 4 @ drain WB
229 mov pc, lr
230
231/*
232 * dma_inv_range(start, end)
233 *
234 * Invalidate (discard) the specified virtual address range.
235 * May not write back any entries. If 'start' or 'end'
236 * are not cache line aligned, those lines must be written
237 * back.
238 *
239 * - start - virtual start address
240 * - end - virtual end address
241 *
242 * (same as v4wb)
243 */
244ENTRY(arm1022_dma_inv_range)
245 mov ip, #0
246#ifndef CONFIG_CPU_DCACHE_DISABLE
247 tst r0, #CACHE_DLINESIZE - 1
248 bic r0, r0, #CACHE_DLINESIZE - 1
249 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
250 tst r1, #CACHE_DLINESIZE - 1
251 mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
2521: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
253 add r0, r0, #CACHE_DLINESIZE
254 cmp r0, r1
255 blo 1b
256#endif
257 mcr p15, 0, ip, c7, c10, 4 @ drain WB
258 mov pc, lr
259
260/*
261 * dma_clean_range(start, end)
262 *
263 * Clean the specified virtual address range.
264 *
265 * - start - virtual start address
266 * - end - virtual end address
267 *
268 * (same as v4wb)
269 */
270ENTRY(arm1022_dma_clean_range)
271 mov ip, #0
272#ifndef CONFIG_CPU_DCACHE_DISABLE
273 bic r0, r0, #CACHE_DLINESIZE - 1
2741: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
275 add r0, r0, #CACHE_DLINESIZE
276 cmp r0, r1
277 blo 1b
278#endif
279 mcr p15, 0, ip, c7, c10, 4 @ drain WB
280 mov pc, lr
281
282/*
283 * dma_flush_range(start, end)
284 *
285 * Clean and invalidate the specified virtual address range.
286 *
287 * - start - virtual start address
288 * - end - virtual end address
289 */
290ENTRY(arm1022_dma_flush_range)
291 mov ip, #0
292#ifndef CONFIG_CPU_DCACHE_DISABLE
293 bic r0, r0, #CACHE_DLINESIZE - 1
2941: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
295 add r0, r0, #CACHE_DLINESIZE
296 cmp r0, r1
297 blo 1b
298#endif
299 mcr p15, 0, ip, c7, c10, 4 @ drain WB
300 mov pc, lr
301
302ENTRY(arm1022_cache_fns)
303 .long arm1022_flush_kern_cache_all
304 .long arm1022_flush_user_cache_all
305 .long arm1022_flush_user_cache_range
306 .long arm1022_coherent_kern_range
307 .long arm1022_coherent_user_range
308 .long arm1022_flush_kern_dcache_page
309 .long arm1022_dma_inv_range
310 .long arm1022_dma_clean_range
311 .long arm1022_dma_flush_range
312
313 .align 5
314ENTRY(cpu_arm1022_dcache_clean_area)
315#ifndef CONFIG_CPU_DCACHE_DISABLE
316 mov ip, #0
3171: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
318 add r0, r0, #CACHE_DLINESIZE
319 subs r1, r1, #CACHE_DLINESIZE
320 bhi 1b
321#endif
322 mov pc, lr
323
324/* =============================== PageTable ============================== */
325
326/*
327 * cpu_arm1022_switch_mm(pgd)
328 *
329 * Set the translation base pointer to be as described by pgd.
330 *
331 * pgd: new page tables
332 */
333 .align 5
334ENTRY(cpu_arm1022_switch_mm)
335#ifndef CONFIG_CPU_DCACHE_DISABLE
336 mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 16 segments
3371: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries
3382: mcr p15, 0, r3, c7, c14, 2 @ clean+invalidate D index
339 subs r3, r3, #1 << 26
340 bcs 2b @ entries 63 to 0
341 subs r1, r1, #1 << 5
342 bcs 1b @ segments 15 to 0
343#endif
344 mov r1, #0
345#ifndef CONFIG_CPU_ICACHE_DISABLE
346 mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache
347#endif
348 mcr p15, 0, r1, c7, c10, 4 @ drain WB
349 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
350 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
351 mov pc, lr
352
353/*
354 * cpu_arm1022_set_pte(ptep, pte)
355 *
356 * Set a PTE and flush it out
357 */
358 .align 5
359ENTRY(cpu_arm1022_set_pte)
360 str r1, [r0], #-2048 @ linux version
361
362 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
363
364 bic r2, r1, #PTE_SMALL_AP_MASK
365 bic r2, r2, #PTE_TYPE_MASK
366 orr r2, r2, #PTE_TYPE_SMALL
367
368 tst r1, #L_PTE_USER @ User?
369 orrne r2, r2, #PTE_SMALL_AP_URO_SRW
370
371 tst r1, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
372 orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
373
374 tst r1, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young?
375 movne r2, #0
376
377#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
378 eor r3, r1, #0x0a @ C & small page?
379 tst r3, #0x0b
380 biceq r2, r2, #4
381#endif
382 str r2, [r0] @ hardware version
383 mov r0, r0
384#ifndef CONFIG_CPU_DCACHE_DISABLE
385 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
386#endif
387 mov pc, lr
388
389 __INIT
390
391 .type __arm1022_setup, #function
392__arm1022_setup:
393 mov r0, #0
394 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
395 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
396 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4
397 mrc p15, 0, r0, c1, c0 @ get control register v4
398 ldr r5, arm1022_cr1_clear
399 bic r0, r0, r5
400 ldr r5, arm1022_cr1_set
401 orr r0, r0, r5
402#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
403 orr r0, r0, #0x4000 @ .R..............
404#endif
405 mov pc, lr
406 .size __arm1022_setup, . - __arm1022_setup
407
408 /*
409 * R
410 * .RVI ZFRS BLDP WCAM
411 * .011 1001 ..11 0101
412 *
413 */
414 .type arm1022_cr1_clear, #object
415 .type arm1022_cr1_set, #object
416arm1022_cr1_clear:
417 .word 0x7f3f
418arm1022_cr1_set:
419 .word 0x3935
420
421 __INITDATA
422
423/*
424 * Purpose : Function pointers used to access above functions - all calls
425 * come through these
426 */
427 .type arm1022_processor_functions, #object
428arm1022_processor_functions:
429 .word v4t_early_abort
430 .word cpu_arm1022_proc_init
431 .word cpu_arm1022_proc_fin
432 .word cpu_arm1022_reset
433 .word cpu_arm1022_do_idle
434 .word cpu_arm1022_dcache_clean_area
435 .word cpu_arm1022_switch_mm
436 .word cpu_arm1022_set_pte
437 .size arm1022_processor_functions, . - arm1022_processor_functions
438
439 .section ".rodata"
440
441 .type cpu_arch_name, #object
442cpu_arch_name:
443 .asciz "armv5te"
444 .size cpu_arch_name, . - cpu_arch_name
445
446 .type cpu_elf_name, #object
447cpu_elf_name:
448 .asciz "v5"
449 .size cpu_elf_name, . - cpu_elf_name
450
451 .type cpu_arm1022_name, #object
452cpu_arm1022_name:
453 .ascii "arm1022"
454#ifndef CONFIG_CPU_ICACHE_DISABLE
455 .ascii "i"
456#endif
457#ifndef CONFIG_CPU_DCACHE_DISABLE
458 .ascii "d"
459#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
460 .ascii "(wt)"
461#else
462 .ascii "(wb)"
463#endif
464#endif
465#ifndef CONFIG_CPU_BPREDICT_DISABLE
466 .ascii "B"
467#endif
468#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
469 .ascii "RR"
470#endif
471 .ascii "\0"
472 .size cpu_arm1022_name, . - cpu_arm1022_name
473
474 .align
475
476 .section ".proc.info", #alloc, #execinstr
477
478 .type __arm1022_proc_info,#object
479__arm1022_proc_info:
480 .long 0x4105a220 @ ARM 1022E (v5TE)
481 .long 0xff0ffff0
482 .long PMD_TYPE_SECT | \
483 PMD_BIT4 | \
484 PMD_SECT_AP_WRITE | \
485 PMD_SECT_AP_READ
486 b __arm1022_setup
487 .long cpu_arch_name
488 .long cpu_elf_name
489 .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB | HWCAP_EDSP
490 .long cpu_arm1022_name
491 .long arm1022_processor_functions
492 .long v4wbi_tlb_fns
493 .long v4wb_user_fns
494 .long arm1022_cache_fns
495 .size __arm1022_proc_info, . - __arm1022_proc_info
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S
new file mode 100644
index 000000000000..248110c9cf13
--- /dev/null
+++ b/arch/arm/mm/proc-arm1026.S
@@ -0,0 +1,491 @@
1/*
2 * linux/arch/arm/mm/proc-arm1026.S: MMU functions for ARM1026EJ-S
3 *
4 * Copyright (C) 2000 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 *
13 * These are the low level assembler for performing cache and TLB
14 * functions on the ARM1026EJ-S.
15 */
16#include <linux/linkage.h>
17#include <linux/config.h>
18#include <linux/init.h>
19#include <asm/assembler.h>
20#include <asm/constants.h>
21#include <asm/pgtable.h>
22#include <asm/procinfo.h>
23#include <asm/ptrace.h>
24
25/*
26 * This is the maximum size of an area which will be invalidated
27 * using the single invalidate entry instructions. Anything larger
28 * than this, and we go for the whole cache.
29 *
30 * This value should be chosen such that we choose the cheapest
31 * alternative.
32 */
33#define MAX_AREA_SIZE 32768
34
35/*
36 * The size of one data cache line.
37 */
38#define CACHE_DLINESIZE 32
39
40/*
41 * The number of data cache segments.
42 */
43#define CACHE_DSEGMENTS 16
44
45/*
46 * The number of lines in a cache segment.
47 */
48#define CACHE_DENTRIES 64
49
50/*
51 * This is the size at which it becomes more efficient to
52 * clean the whole cache, rather than using the individual
53 * cache line maintainence instructions.
54 */
55#define CACHE_DLIMIT 32768
56
57 .text
58/*
59 * cpu_arm1026_proc_init()
60 */
61ENTRY(cpu_arm1026_proc_init)
62 mov pc, lr
63
64/*
65 * cpu_arm1026_proc_fin()
66 */
67ENTRY(cpu_arm1026_proc_fin)
68 stmfd sp!, {lr}
69 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
70 msr cpsr_c, ip
71 bl arm1026_flush_kern_cache_all
72 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
73 bic r0, r0, #0x1000 @ ...i............
74 bic r0, r0, #0x000e @ ............wca.
75 mcr p15, 0, r0, c1, c0, 0 @ disable caches
76 ldmfd sp!, {pc}
77
78/*
79 * cpu_arm1026_reset(loc)
80 *
81 * Perform a soft reset of the system. Put the CPU into the
82 * same state as it would be if it had been reset, and branch
83 * to what would be the reset vector.
84 *
85 * loc: location to jump to for soft reset
86 */
87 .align 5
88ENTRY(cpu_arm1026_reset)
89 mov ip, #0
90 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
91 mcr p15, 0, ip, c7, c10, 4 @ drain WB
92 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
93 mrc p15, 0, ip, c1, c0, 0 @ ctrl register
94 bic ip, ip, #0x000f @ ............wcam
95 bic ip, ip, #0x1100 @ ...i...s........
96 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
97 mov pc, r0
98
99/*
100 * cpu_arm1026_do_idle()
101 */
102 .align 5
103ENTRY(cpu_arm1026_do_idle)
104 mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
105 mov pc, lr
106
107/* ================================= CACHE ================================ */
108
109 .align 5
110/*
111 * flush_user_cache_all()
112 *
113 * Invalidate all cache entries in a particular address
114 * space.
115 */
116ENTRY(arm1026_flush_user_cache_all)
117 /* FALLTHROUGH */
118/*
119 * flush_kern_cache_all()
120 *
121 * Clean and invalidate the entire cache.
122 */
123ENTRY(arm1026_flush_kern_cache_all)
124 mov r2, #VM_EXEC
125 mov ip, #0
126__flush_whole_cache:
127#ifndef CONFIG_CPU_DCACHE_DISABLE
1281: mrc p15, 0, r15, c7, c14, 3 @ test, clean, invalidate
129 bne 1b
130#endif
131 tst r2, #VM_EXEC
132#ifndef CONFIG_CPU_ICACHE_DISABLE
133 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
134#endif
135 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
136 mov pc, lr
137
138/*
139 * flush_user_cache_range(start, end, flags)
140 *
141 * Invalidate a range of cache entries in the specified
142 * address space.
143 *
144 * - start - start address (inclusive)
145 * - end - end address (exclusive)
146 * - flags - vm_flags for this space
147 */
148ENTRY(arm1026_flush_user_cache_range)
149 mov ip, #0
150 sub r3, r1, r0 @ calculate total size
151 cmp r3, #CACHE_DLIMIT
152 bhs __flush_whole_cache
153
154#ifndef CONFIG_CPU_DCACHE_DISABLE
1551: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
156 add r0, r0, #CACHE_DLINESIZE
157 cmp r0, r1
158 blo 1b
159#endif
160 tst r2, #VM_EXEC
161#ifndef CONFIG_CPU_ICACHE_DISABLE
162 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
163#endif
164 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
165 mov pc, lr
166
167/*
168 * coherent_kern_range(start, end)
169 *
170 * Ensure coherency between the Icache and the Dcache in the
171 * region described by start. If you have non-snooping
172 * Harvard caches, you need to implement this function.
173 *
174 * - start - virtual start address
175 * - end - virtual end address
176 */
177ENTRY(arm1026_coherent_kern_range)
178 /* FALLTHROUGH */
179/*
180 * coherent_user_range(start, end)
181 *
182 * Ensure coherency between the Icache and the Dcache in the
183 * region described by start. If you have non-snooping
184 * Harvard caches, you need to implement this function.
185 *
186 * - start - virtual start address
187 * - end - virtual end address
188 */
189ENTRY(arm1026_coherent_user_range)
190 mov ip, #0
191 bic r0, r0, #CACHE_DLINESIZE - 1
1921:
193#ifndef CONFIG_CPU_DCACHE_DISABLE
194 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
195#endif
196#ifndef CONFIG_CPU_ICACHE_DISABLE
197 mcr p15, 0, r0, c7, c5, 1 @ invalidate I entry
198#endif
199 add r0, r0, #CACHE_DLINESIZE
200 cmp r0, r1
201 blo 1b
202 mcr p15, 0, ip, c7, c10, 4 @ drain WB
203 mov pc, lr
204
205/*
206 * flush_kern_dcache_page(void *page)
207 *
208 * Ensure no D cache aliasing occurs, either with itself or
209 * the I cache
210 *
211 * - page - page aligned address
212 */
213ENTRY(arm1026_flush_kern_dcache_page)
214 mov ip, #0
215#ifndef CONFIG_CPU_DCACHE_DISABLE
216 add r1, r0, #PAGE_SZ
2171: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
218 add r0, r0, #CACHE_DLINESIZE
219 cmp r0, r1
220 blo 1b
221#endif
222 mcr p15, 0, ip, c7, c10, 4 @ drain WB
223 mov pc, lr
224
225/*
226 * dma_inv_range(start, end)
227 *
228 * Invalidate (discard) the specified virtual address range.
229 * May not write back any entries. If 'start' or 'end'
230 * are not cache line aligned, those lines must be written
231 * back.
232 *
233 * - start - virtual start address
234 * - end - virtual end address
235 *
236 * (same as v4wb)
237 */
238ENTRY(arm1026_dma_inv_range)
239 mov ip, #0
240#ifndef CONFIG_CPU_DCACHE_DISABLE
241 tst r0, #CACHE_DLINESIZE - 1
242 bic r0, r0, #CACHE_DLINESIZE - 1
243 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
244 tst r1, #CACHE_DLINESIZE - 1
245 mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
2461: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
247 add r0, r0, #CACHE_DLINESIZE
248 cmp r0, r1
249 blo 1b
250#endif
251 mcr p15, 0, ip, c7, c10, 4 @ drain WB
252 mov pc, lr
253
254/*
255 * dma_clean_range(start, end)
256 *
257 * Clean the specified virtual address range.
258 *
259 * - start - virtual start address
260 * - end - virtual end address
261 *
262 * (same as v4wb)
263 */
264ENTRY(arm1026_dma_clean_range)
265 mov ip, #0
266#ifndef CONFIG_CPU_DCACHE_DISABLE
267 bic r0, r0, #CACHE_DLINESIZE - 1
2681: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
269 add r0, r0, #CACHE_DLINESIZE
270 cmp r0, r1
271 blo 1b
272#endif
273 mcr p15, 0, ip, c7, c10, 4 @ drain WB
274 mov pc, lr
275
276/*
277 * dma_flush_range(start, end)
278 *
279 * Clean and invalidate the specified virtual address range.
280 *
281 * - start - virtual start address
282 * - end - virtual end address
283 */
284ENTRY(arm1026_dma_flush_range)
285 mov ip, #0
286#ifndef CONFIG_CPU_DCACHE_DISABLE
287 bic r0, r0, #CACHE_DLINESIZE - 1
2881: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
289 add r0, r0, #CACHE_DLINESIZE
290 cmp r0, r1
291 blo 1b
292#endif
293 mcr p15, 0, ip, c7, c10, 4 @ drain WB
294 mov pc, lr
295
296ENTRY(arm1026_cache_fns)
297 .long arm1026_flush_kern_cache_all
298 .long arm1026_flush_user_cache_all
299 .long arm1026_flush_user_cache_range
300 .long arm1026_coherent_kern_range
301 .long arm1026_coherent_user_range
302 .long arm1026_flush_kern_dcache_page
303 .long arm1026_dma_inv_range
304 .long arm1026_dma_clean_range
305 .long arm1026_dma_flush_range
306
307 .align 5
308ENTRY(cpu_arm1026_dcache_clean_area)
309#ifndef CONFIG_CPU_DCACHE_DISABLE
310 mov ip, #0
3111: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
312 add r0, r0, #CACHE_DLINESIZE
313 subs r1, r1, #CACHE_DLINESIZE
314 bhi 1b
315#endif
316 mov pc, lr
317
318/* =============================== PageTable ============================== */
319
320/*
321 * cpu_arm1026_switch_mm(pgd)
322 *
323 * Set the translation base pointer to be as described by pgd.
324 *
325 * pgd: new page tables
326 */
327 .align 5
328ENTRY(cpu_arm1026_switch_mm)
329 mov r1, #0
330#ifndef CONFIG_CPU_DCACHE_DISABLE
3311: mrc p15, 0, r15, c7, c14, 3 @ test, clean, invalidate
332 bne 1b
333#endif
334#ifndef CONFIG_CPU_ICACHE_DISABLE
335 mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache
336#endif
337 mcr p15, 0, r1, c7, c10, 4 @ drain WB
338 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
339 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
340 mov pc, lr
341
342/*
343 * cpu_arm1026_set_pte(ptep, pte)
344 *
345 * Set a PTE and flush it out
346 */
347 .align 5
348ENTRY(cpu_arm1026_set_pte)
349 str r1, [r0], #-2048 @ linux version
350
351 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
352
353 bic r2, r1, #PTE_SMALL_AP_MASK
354 bic r2, r2, #PTE_TYPE_MASK
355 orr r2, r2, #PTE_TYPE_SMALL
356
357 tst r1, #L_PTE_USER @ User?
358 orrne r2, r2, #PTE_SMALL_AP_URO_SRW
359
360 tst r1, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
361 orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
362
363 tst r1, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young?
364 movne r2, #0
365
366#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
367 eor r3, r1, #0x0a @ C & small page?
368 tst r3, #0x0b
369 biceq r2, r2, #4
370#endif
371 str r2, [r0] @ hardware version
372 mov r0, r0
373#ifndef CONFIG_CPU_DCACHE_DISABLE
374 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
375#endif
376 mov pc, lr
377
378
379 __INIT
380
381 .type __arm1026_setup, #function
382__arm1026_setup:
383 mov r0, #0
384 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
385 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
386 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4
387 mcr p15, 0, r4, c2, c0 @ load page table pointer
388#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
389 mov r0, #4 @ explicitly disable writeback
390 mcr p15, 7, r0, c15, c0, 0
391#endif
392 mrc p15, 0, r0, c1, c0 @ get control register v4
393 ldr r5, arm1026_cr1_clear
394 bic r0, r0, r5
395 ldr r5, arm1026_cr1_set
396 orr r0, r0, r5
397#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
398 orr r0, r0, #0x4000 @ .R.. .... .... ....
399#endif
400 mov pc, lr
401 .size __arm1026_setup, . - __arm1026_setup
402
403 /*
404 * R
405 * .RVI ZFRS BLDP WCAM
406 * .011 1001 ..11 0101
407 *
408 */
409 .type arm1026_cr1_clear, #object
410 .type arm1026_cr1_set, #object
411arm1026_cr1_clear:
412 .word 0x7f3f
413arm1026_cr1_set:
414 .word 0x3935
415
416 __INITDATA
417
418/*
419 * Purpose : Function pointers used to access above functions - all calls
420 * come through these
421 */
422 .type arm1026_processor_functions, #object
423arm1026_processor_functions:
424 .word v5t_early_abort
425 .word cpu_arm1026_proc_init
426 .word cpu_arm1026_proc_fin
427 .word cpu_arm1026_reset
428 .word cpu_arm1026_do_idle
429 .word cpu_arm1026_dcache_clean_area
430 .word cpu_arm1026_switch_mm
431 .word cpu_arm1026_set_pte
432 .size arm1026_processor_functions, . - arm1026_processor_functions
433
434 .section .rodata
435
436 .type cpu_arch_name, #object
437cpu_arch_name:
438 .asciz "armv5tej"
439 .size cpu_arch_name, . - cpu_arch_name
440
441 .type cpu_elf_name, #object
442cpu_elf_name:
443 .asciz "v5"
444 .size cpu_elf_name, . - cpu_elf_name
445 .align
446
447 .type cpu_arm1026_name, #object
448cpu_arm1026_name:
449 .ascii "ARM1026EJ-S"
450#ifndef CONFIG_CPU_ICACHE_DISABLE
451 .ascii "i"
452#endif
453#ifndef CONFIG_CPU_DCACHE_DISABLE
454 .ascii "d"
455#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
456 .ascii "(wt)"
457#else
458 .ascii "(wb)"
459#endif
460#endif
461#ifndef CONFIG_CPU_BPREDICT_DISABLE
462 .ascii "B"
463#endif
464#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
465 .ascii "RR"
466#endif
467 .ascii "\0"
468 .size cpu_arm1026_name, . - cpu_arm1026_name
469
470 .align
471
472 .section ".proc.info", #alloc, #execinstr
473
474 .type __arm1026_proc_info,#object
475__arm1026_proc_info:
476 .long 0x4106a260 @ ARM 1026EJ-S (v5TEJ)
477 .long 0xff0ffff0
478 .long PMD_TYPE_SECT | \
479 PMD_BIT4 | \
480 PMD_SECT_AP_WRITE | \
481 PMD_SECT_AP_READ
482 b __arm1026_setup
483 .long cpu_arch_name
484 .long cpu_elf_name
485 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_JAVA
486 .long cpu_arm1026_name
487 .long arm1026_processor_functions
488 .long v4wbi_tlb_fns
489 .long v4wb_user_fns
490 .long arm1026_cache_fns
491 .size __arm1026_proc_info, . - __arm1026_proc_info
diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S
new file mode 100644
index 000000000000..0ee214b824ff
--- /dev/null
+++ b/arch/arm/mm/proc-arm6_7.S
@@ -0,0 +1,404 @@
1/*
2 * linux/arch/arm/mm/proc-arm6,7.S
3 *
4 * Copyright (C) 1997-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * These are the low level assembler for performing cache and TLB
11 * functions on the ARM610 & ARM710.
12 */
13#include <linux/linkage.h>
14#include <linux/init.h>
15#include <asm/assembler.h>
16#include <asm/constants.h>
17#include <asm/pgtable.h>
18#include <asm/procinfo.h>
19#include <asm/ptrace.h>
20
21ENTRY(cpu_arm6_dcache_clean_area)
22ENTRY(cpu_arm7_dcache_clean_area)
23 mov pc, lr
24
25/*
26 * Function: arm6_7_data_abort ()
27 *
28 * Params : r2 = address of aborted instruction
29 * : sp = pointer to registers
30 *
31 * Purpose : obtain information about current aborted instruction
32 *
33 * Returns : r0 = address of abort
34 * : r1 = FSR
35 */
36
37ENTRY(cpu_arm7_data_abort)
38 mrc p15, 0, r1, c5, c0, 0 @ get FSR
39 mrc p15, 0, r0, c6, c0, 0 @ get FAR
40 ldr r8, [r0] @ read arm instruction
41 tst r8, #1 << 20 @ L = 1 -> write?
42 orreq r1, r1, #1 << 8 @ yes.
43 and r7, r8, #15 << 24
44 add pc, pc, r7, lsr #22 @ Now branch to the relevant processing routine
45 nop
46
47/* 0 */ b .data_unknown
48/* 1 */ mov pc, lr @ swp
49/* 2 */ b .data_unknown
50/* 3 */ b .data_unknown
51/* 4 */ b .data_arm_lateldrpostconst @ ldr rd, [rn], #m
52/* 5 */ b .data_arm_lateldrpreconst @ ldr rd, [rn, #m]
53/* 6 */ b .data_arm_lateldrpostreg @ ldr rd, [rn], rm
54/* 7 */ b .data_arm_lateldrprereg @ ldr rd, [rn, rm]
55/* 8 */ b .data_arm_ldmstm @ ldm*a rn, <rlist>
56/* 9 */ b .data_arm_ldmstm @ ldm*b rn, <rlist>
57/* a */ b .data_unknown
58/* b */ b .data_unknown
59/* c */ mov pc, lr @ ldc rd, [rn], #m @ Same as ldr rd, [rn], #m
60/* d */ mov pc, lr @ ldc rd, [rn, #m]
61/* e */ b .data_unknown
62/* f */
63.data_unknown: @ Part of jumptable
64 mov r0, r2
65 mov r1, r8
66 mov r2, sp
67 bl baddataabort
68 b ret_from_exception
69
70ENTRY(cpu_arm6_data_abort)
71 mrc p15, 0, r1, c5, c0, 0 @ get FSR
72 mrc p15, 0, r0, c6, c0, 0 @ get FAR
73 ldr r8, [r2] @ read arm instruction
74 tst r8, #1 << 20 @ L = 1 -> write?
75 orreq r1, r1, #1 << 8 @ yes.
76 and r7, r8, #14 << 24
77 teq r7, #8 << 24 @ was it ldm/stm
78 movne pc, lr
79
80.data_arm_ldmstm:
81 tst r8, #1 << 21 @ check writeback bit
82 moveq pc, lr @ no writeback -> no fixup
83 mov r7, #0x11
84 orr r7, r7, #0x1100
85 and r6, r8, r7
86 and r2, r8, r7, lsl #1
87 add r6, r6, r2, lsr #1
88 and r2, r8, r7, lsl #2
89 add r6, r6, r2, lsr #2
90 and r2, r8, r7, lsl #3
91 add r6, r6, r2, lsr #3
92 add r6, r6, r6, lsr #8
93 add r6, r6, r6, lsr #4
94 and r6, r6, #15 @ r6 = no. of registers to transfer.
95 and r5, r8, #15 << 16 @ Extract 'n' from instruction
96 ldr r7, [sp, r5, lsr #14] @ Get register 'Rn'
97 tst r8, #1 << 23 @ Check U bit
98 subne r7, r7, r6, lsl #2 @ Undo increment
99 addeq r7, r7, r6, lsl #2 @ Undo decrement
100 str r7, [sp, r5, lsr #14] @ Put register 'Rn'
101 mov pc, lr
102
103.data_arm_apply_r6_and_rn:
104 and r5, r8, #15 << 16 @ Extract 'n' from instruction
105 ldr r7, [sp, r5, lsr #14] @ Get register 'Rn'
106 tst r8, #1 << 23 @ Check U bit
107 subne r7, r7, r6 @ Undo incrmenet
108 addeq r7, r7, r6 @ Undo decrement
109 str r7, [sp, r5, lsr #14] @ Put register 'Rn'
110 mov pc, lr
111
112.data_arm_lateldrpreconst:
113 tst r8, #1 << 21 @ check writeback bit
114 moveq pc, lr @ no writeback -> no fixup
115.data_arm_lateldrpostconst:
116 movs r2, r8, lsl #20 @ Get offset
117 moveq pc, lr @ zero -> no fixup
118 and r5, r8, #15 << 16 @ Extract 'n' from instruction
119 ldr r7, [sp, r5, lsr #14] @ Get register 'Rn'
120 tst r8, #1 << 23 @ Check U bit
121 subne r7, r7, r2, lsr #20 @ Undo increment
122 addeq r7, r7, r2, lsr #20 @ Undo decrement
123 str r7, [sp, r5, lsr #14] @ Put register 'Rn'
124 mov pc, lr
125
126.data_arm_lateldrprereg:
127 tst r8, #1 << 21 @ check writeback bit
128 moveq pc, lr @ no writeback -> no fixup
129.data_arm_lateldrpostreg:
130 and r7, r8, #15 @ Extract 'm' from instruction
131 ldr r6, [sp, r7, lsl #2] @ Get register 'Rm'
132 mov r5, r8, lsr #7 @ get shift count
133 ands r5, r5, #31
134 and r7, r8, #0x70 @ get shift type
135 orreq r7, r7, #8 @ shift count = 0
136 add pc, pc, r7
137 nop
138
139 mov r6, r6, lsl r5 @ 0: LSL #!0
140 b .data_arm_apply_r6_and_rn
141 b .data_arm_apply_r6_and_rn @ 1: LSL #0
142 nop
143 b .data_unknown @ 2: MUL?
144 nop
145 b .data_unknown @ 3: MUL?
146 nop
147 mov r6, r6, lsr r5 @ 4: LSR #!0
148 b .data_arm_apply_r6_and_rn
149 mov r6, r6, lsr #32 @ 5: LSR #32
150 b .data_arm_apply_r6_and_rn
151 b .data_unknown @ 6: MUL?
152 nop
153 b .data_unknown @ 7: MUL?
154 nop
155 mov r6, r6, asr r5 @ 8: ASR #!0
156 b .data_arm_apply_r6_and_rn
157 mov r6, r6, asr #32 @ 9: ASR #32
158 b .data_arm_apply_r6_and_rn
159 b .data_unknown @ A: MUL?
160 nop
161 b .data_unknown @ B: MUL?
162 nop
163 mov r6, r6, ror r5 @ C: ROR #!0
164 b .data_arm_apply_r6_and_rn
165 mov r6, r6, rrx @ D: RRX
166 b .data_arm_apply_r6_and_rn
167 b .data_unknown @ E: MUL?
168 nop
169 b .data_unknown @ F: MUL?
170
171/*
172 * Function: arm6_7_proc_init (void)
173 * : arm6_7_proc_fin (void)
174 *
175 * Notes : This processor does not require these
176 */
177ENTRY(cpu_arm6_proc_init)
178ENTRY(cpu_arm7_proc_init)
179 mov pc, lr
180
181ENTRY(cpu_arm6_proc_fin)
182ENTRY(cpu_arm7_proc_fin)
183 mov r0, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
184 msr cpsr_c, r0
185 mov r0, #0x31 @ ....S..DP...M
186 mcr p15, 0, r0, c1, c0, 0 @ disable caches
187 mov pc, lr
188
189ENTRY(cpu_arm6_do_idle)
190ENTRY(cpu_arm7_do_idle)
191 mov pc, lr
192
193/*
194 * Function: arm6_7_switch_mm(unsigned long pgd_phys)
195 * Params : pgd_phys Physical address of page table
196 * Purpose : Perform a task switch, saving the old processes state, and restoring
197 * the new.
198 */
199ENTRY(cpu_arm6_switch_mm)
200ENTRY(cpu_arm7_switch_mm)
201 mov r1, #0
202 mcr p15, 0, r1, c7, c0, 0 @ flush cache
203 mcr p15, 0, r0, c2, c0, 0 @ update page table ptr
204 mcr p15, 0, r1, c5, c0, 0 @ flush TLBs
205 mov pc, lr
206
207/*
208 * Function: arm6_7_set_pte(pte_t *ptep, pte_t pte)
209 * Params : r0 = Address to set
210 * : r1 = value to set
211 * Purpose : Set a PTE and flush it out of any WB cache
212 */
213 .align 5
214ENTRY(cpu_arm6_set_pte)
215ENTRY(cpu_arm7_set_pte)
216 str r1, [r0], #-2048 @ linux version
217
218 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
219
220 bic r2, r1, #PTE_SMALL_AP_MASK
221 bic r2, r2, #PTE_TYPE_MASK
222 orr r2, r2, #PTE_TYPE_SMALL
223
224 tst r1, #L_PTE_USER @ User?
225 orrne r2, r2, #PTE_SMALL_AP_URO_SRW
226
227 tst r1, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
228 orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
229
230 tst r1, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young
231 movne r2, #0
232
233 str r2, [r0] @ hardware version
234 mov pc, lr
235
236/*
237 * Function: _arm6_7_reset
238 * Params : r0 = address to jump to
239 * Notes : This sets up everything for a reset
240 */
241ENTRY(cpu_arm6_reset)
242ENTRY(cpu_arm7_reset)
243 mov r1, #0
244 mcr p15, 0, r1, c7, c0, 0 @ flush cache
245 mcr p15, 0, r1, c5, c0, 0 @ flush TLB
246 mov r1, #0x30
247 mcr p15, 0, r1, c1, c0, 0 @ turn off MMU etc
248 mov pc, r0
249
250 __INIT
251
252 .type __arm6_setup, #function
253__arm6_setup: mov r0, #0
254 mcr p15, 0, r0, c7, c0 @ flush caches on v3
255 mcr p15, 0, r0, c5, c0 @ flush TLBs on v3
256 mov r0, #0x3d @ . ..RS BLDP WCAM
257 orr r0, r0, #0x100 @ . ..01 0011 1101
258 mov pc, lr
259 .size __arm6_setup, . - __arm6_setup
260
261 .type __arm7_setup, #function
262__arm7_setup: mov r0, #0
263 mcr p15, 0, r0, c7, c0 @ flush caches on v3
264 mcr p15, 0, r0, c5, c0 @ flush TLBs on v3
265 mcr p15, 0, r0, c3, c0 @ load domain access register
266 mov r0, #0x7d @ . ..RS BLDP WCAM
267 orr r0, r0, #0x100 @ . ..01 0111 1101
268 mov pc, lr
269 .size __arm7_setup, . - __arm7_setup
270
271 __INITDATA
272
273/*
274 * Purpose : Function pointers used to access above functions - all calls
275 * come through these
276 */
277 .type arm6_processor_functions, #object
278ENTRY(arm6_processor_functions)
279 .word cpu_arm6_data_abort
280 .word cpu_arm6_proc_init
281 .word cpu_arm6_proc_fin
282 .word cpu_arm6_reset
283 .word cpu_arm6_do_idle
284 .word cpu_arm6_dcache_clean_area
285 .word cpu_arm6_switch_mm
286 .word cpu_arm6_set_pte
287 .size arm6_processor_functions, . - arm6_processor_functions
288
289/*
290 * Purpose : Function pointers used to access above functions - all calls
291 * come through these
292 */
293 .type arm7_processor_functions, #object
294ENTRY(arm7_processor_functions)
295 .word cpu_arm7_data_abort
296 .word cpu_arm7_proc_init
297 .word cpu_arm7_proc_fin
298 .word cpu_arm7_reset
299 .word cpu_arm7_do_idle
300 .word cpu_arm7_dcache_clean_area
301 .word cpu_arm7_switch_mm
302 .word cpu_arm7_set_pte
303 .size arm7_processor_functions, . - arm7_processor_functions
304
305 .section ".rodata"
306
307 .type cpu_arch_name, #object
308cpu_arch_name: .asciz "armv3"
309 .size cpu_arch_name, . - cpu_arch_name
310
311 .type cpu_elf_name, #object
312cpu_elf_name: .asciz "v3"
313 .size cpu_elf_name, . - cpu_elf_name
314
315 .type cpu_arm6_name, #object
316cpu_arm6_name: .asciz "ARM6"
317 .size cpu_arm6_name, . - cpu_arm6_name
318
319 .type cpu_arm610_name, #object
320cpu_arm610_name:
321 .asciz "ARM610"
322 .size cpu_arm610_name, . - cpu_arm610_name
323
324 .type cpu_arm7_name, #object
325cpu_arm7_name: .asciz "ARM7"
326 .size cpu_arm7_name, . - cpu_arm7_name
327
328 .type cpu_arm710_name, #object
329cpu_arm710_name:
330 .asciz "ARM710"
331 .size cpu_arm710_name, . - cpu_arm710_name
332
333 .align
334
335 .section ".proc.info", #alloc, #execinstr
336
337 .type __arm6_proc_info, #object
338__arm6_proc_info:
339 .long 0x41560600
340 .long 0xfffffff0
341 .long 0x00000c1e
342 b __arm6_setup
343 .long cpu_arch_name
344 .long cpu_elf_name
345 .long HWCAP_SWP | HWCAP_26BIT
346 .long cpu_arm6_name
347 .long arm6_processor_functions
348 .long v3_tlb_fns
349 .long v3_user_fns
350 .long v3_cache_fns
351 .size __arm6_proc_info, . - __arm6_proc_info
352
353 .type __arm610_proc_info, #object
354__arm610_proc_info:
355 .long 0x41560610
356 .long 0xfffffff0
357 .long 0x00000c1e
358 b __arm6_setup
359 .long cpu_arch_name
360 .long cpu_elf_name
361 .long HWCAP_SWP | HWCAP_26BIT
362 .long cpu_arm610_name
363 .long arm6_processor_functions
364 .long v3_tlb_fns
365 .long v3_user_fns
366 .long v3_cache_fns
367 .size __arm610_proc_info, . - __arm610_proc_info
368
369 .type __arm7_proc_info, #object
370__arm7_proc_info:
371 .long 0x41007000
372 .long 0xffffff00
373 .long 0x00000c1e
374 b __arm7_setup
375 .long cpu_arch_name
376 .long cpu_elf_name
377 .long HWCAP_SWP | HWCAP_26BIT
378 .long cpu_arm7_name
379 .long arm7_processor_functions
380 .long v3_tlb_fns
381 .long v3_user_fns
382 .long v3_cache_fns
383 .size __arm7_proc_info, . - __arm7_proc_info
384
385 .type __arm710_proc_info, #object
386__arm710_proc_info:
387 .long 0x41007100
388 .long 0xfff8ff00
389 .long PMD_TYPE_SECT | \
390 PMD_SECT_BUFFERABLE | \
391 PMD_SECT_CACHEABLE | \
392 PMD_BIT4 | \
393 PMD_SECT_AP_WRITE | \
394 PMD_SECT_AP_READ
395 b __arm7_setup
396 .long cpu_arch_name
397 .long cpu_elf_name
398 .long HWCAP_SWP | HWCAP_26BIT
399 .long cpu_arm710_name
400 .long arm7_processor_functions
401 .long v3_tlb_fns
402 .long v3_user_fns
403 .long v3_cache_fns
404 .size __arm710_proc_info, . - __arm710_proc_info
diff --git a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S
new file mode 100644
index 000000000000..57cfa6a2f54f
--- /dev/null
+++ b/arch/arm/mm/proc-arm720.S
@@ -0,0 +1,267 @@
1/*
2 * linux/arch/arm/mm/proc-arm720.S: MMU functions for ARM720
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 * Rob Scott (rscott@mtrob.fdns.net)
6 * Copyright (C) 2000 ARM Limited, Deep Blue Solutions Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 *
23 * These are the low level assembler for performing cache and TLB
24 * functions on the ARM720T. The ARM720T has a writethrough IDC
25 * cache, so we don't need to clean it.
26 *
27 * Changelog:
28 * 05-09-2000 SJH Created by moving 720 specific functions
29 * out of 'proc-arm6,7.S' per RMK discussion
30 * 07-25-2000 SJH Added idle function.
31 * 08-25-2000 DBS Updated for integration of ARM Ltd version.
32 */
33#include <linux/linkage.h>
34#include <linux/init.h>
35#include <asm/assembler.h>
36#include <asm/constants.h>
37#include <asm/pgtable.h>
38#include <asm/procinfo.h>
39#include <asm/ptrace.h>
40#include <asm/hardware.h>
41
42/*
43 * Function: arm720_proc_init (void)
44 * : arm720_proc_fin (void)
45 *
46 * Notes : This processor does not require these
47 */
48ENTRY(cpu_arm720_dcache_clean_area)
49ENTRY(cpu_arm720_proc_init)
50 mov pc, lr
51
52ENTRY(cpu_arm720_proc_fin)
53 stmfd sp!, {lr}
54 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
55 msr cpsr_c, ip
56 mrc p15, 0, r0, c1, c0, 0
57 bic r0, r0, #0x1000 @ ...i............
58 bic r0, r0, #0x000e @ ............wca.
59 mcr p15, 0, r0, c1, c0, 0 @ disable caches
60 mcr p15, 0, r1, c7, c7, 0 @ invalidate cache
61 ldmfd sp!, {pc}
62
63/*
64 * Function: arm720_proc_do_idle(void)
65 * Params : r0 = unused
66 * Purpose : put the processer in proper idle mode
67 */
68ENTRY(cpu_arm720_do_idle)
69 mov pc, lr
70
71/*
72 * Function: arm720_switch_mm(unsigned long pgd_phys)
73 * Params : pgd_phys Physical address of page table
74 * Purpose : Perform a task switch, saving the old process' state and restoring
75 * the new.
76 */
77ENTRY(cpu_arm720_switch_mm)
78 mov r1, #0
79 mcr p15, 0, r1, c7, c7, 0 @ invalidate cache
80 mcr p15, 0, r0, c2, c0, 0 @ update page table ptr
81 mcr p15, 0, r1, c8, c7, 0 @ flush TLB (v4)
82 mov pc, lr
83
84/*
85 * Function: arm720_set_pte(pte_t *ptep, pte_t pte)
86 * Params : r0 = Address to set
87 * : r1 = value to set
88 * Purpose : Set a PTE and flush it out of any WB cache
89 */
90 .align 5
91ENTRY(cpu_arm720_set_pte)
92 str r1, [r0], #-2048 @ linux version
93
94 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
95
96 bic r2, r1, #PTE_SMALL_AP_MASK
97 bic r2, r2, #PTE_TYPE_MASK
98 orr r2, r2, #PTE_TYPE_SMALL
99
100 tst r1, #L_PTE_USER @ User?
101 orrne r2, r2, #PTE_SMALL_AP_URO_SRW
102
103 tst r1, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
104 orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
105
106 tst r1, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young
107 movne r2, #0
108
109 str r2, [r0] @ hardware version
110 mov pc, lr
111
112/*
113 * Function: arm720_reset
114 * Params : r0 = address to jump to
115 * Notes : This sets up everything for a reset
116 */
117ENTRY(cpu_arm720_reset)
118 mov ip, #0
119 mcr p15, 0, ip, c7, c7, 0 @ invalidate cache
120 mcr p15, 0, ip, c8, c7, 0 @ flush TLB (v4)
121 mrc p15, 0, ip, c1, c0, 0 @ get ctrl register
122 bic ip, ip, #0x000f @ ............wcam
123 bic ip, ip, #0x2100 @ ..v....s........
124 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
125 mov pc, r0
126
127 __INIT
128
129 .type __arm710_setup, #function
130__arm710_setup:
131 mov r0, #0
132 mcr p15, 0, r0, c7, c7, 0 @ invalidate caches
133 mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4)
134 mrc p15, 0, r0, c1, c0 @ get control register
135 ldr r5, arm710_cr1_clear
136 bic r0, r0, r5
137 ldr r5, arm710_cr1_set
138 orr r0, r0, r5
139 mov pc, lr @ __ret (head.S)
140 .size __arm710_setup, . - __arm710_setup
141
142 /*
143 * R
144 * .RVI ZFRS BLDP WCAM
145 * .... 0001 ..11 1101
146 *
147 */
148 .type arm710_cr1_clear, #object
149 .type arm710_cr1_set, #object
150arm710_cr1_clear:
151 .word 0x0f3f
152arm710_cr1_set:
153 .word 0x013d
154
155 .type __arm720_setup, #function
156__arm720_setup:
157 mov r0, #0
158 mcr p15, 0, r0, c7, c7, 0 @ invalidate caches
159 mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4)
160 mrc p15, 0, r0, c1, c0 @ get control register
161 ldr r5, arm720_cr1_clear
162 bic r0, r0, r5
163 ldr r5, arm720_cr1_set
164 orr r0, r0, r5
165 mov pc, lr @ __ret (head.S)
166 .size __arm720_setup, . - __arm720_setup
167
168 /*
169 * R
170 * .RVI ZFRS BLDP WCAM
171 * ..1. 1001 ..11 1101
172 *
173 */
174 .type arm720_cr1_clear, #object
175 .type arm720_cr1_set, #object
176arm720_cr1_clear:
177 .word 0x2f3f
178arm720_cr1_set:
179 .word 0x213d
180
181 __INITDATA
182
183/*
184 * Purpose : Function pointers used to access above functions - all calls
185 * come through these
186 */
187 .type arm720_processor_functions, #object
188ENTRY(arm720_processor_functions)
189 .word v4t_late_abort
190 .word cpu_arm720_proc_init
191 .word cpu_arm720_proc_fin
192 .word cpu_arm720_reset
193 .word cpu_arm720_do_idle
194 .word cpu_arm720_dcache_clean_area
195 .word cpu_arm720_switch_mm
196 .word cpu_arm720_set_pte
197 .size arm720_processor_functions, . - arm720_processor_functions
198
199 .section ".rodata"
200
201 .type cpu_arch_name, #object
202cpu_arch_name: .asciz "armv4t"
203 .size cpu_arch_name, . - cpu_arch_name
204
205 .type cpu_elf_name, #object
206cpu_elf_name: .asciz "v4"
207 .size cpu_elf_name, . - cpu_elf_name
208
209 .type cpu_arm710_name, #object
210cpu_arm710_name:
211 .asciz "ARM710T"
212 .size cpu_arm710_name, . - cpu_arm710_name
213
214 .type cpu_arm720_name, #object
215cpu_arm720_name:
216 .asciz "ARM720T"
217 .size cpu_arm720_name, . - cpu_arm720_name
218
219 .align
220
221/*
222 * See linux/include/asm-arm/procinfo.h for a definition of this structure.
223 */
224
225 .section ".proc.info", #alloc, #execinstr
226
227 .type __arm710_proc_info, #object
228__arm710_proc_info:
229 .long 0x41807100 @ cpu_val
230 .long 0xffffff00 @ cpu_mask
231 .long PMD_TYPE_SECT | \
232 PMD_SECT_BUFFERABLE | \
233 PMD_SECT_CACHEABLE | \
234 PMD_BIT4 | \
235 PMD_SECT_AP_WRITE | \
236 PMD_SECT_AP_READ
237 b __arm710_setup @ cpu_flush
238 .long cpu_arch_name @ arch_name
239 .long cpu_elf_name @ elf_name
240 .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB @ elf_hwcap
241 .long cpu_arm710_name @ name
242 .long arm720_processor_functions
243 .long v4_tlb_fns
244 .long v4wt_user_fns
245 .long v4_cache_fns
246 .size __arm710_proc_info, . - __arm710_proc_info
247
248 .type __arm720_proc_info, #object
249__arm720_proc_info:
250 .long 0x41807200 @ cpu_val
251 .long 0xffffff00 @ cpu_mask
252 .long PMD_TYPE_SECT | \
253 PMD_SECT_BUFFERABLE | \
254 PMD_SECT_CACHEABLE | \
255 PMD_BIT4 | \
256 PMD_SECT_AP_WRITE | \
257 PMD_SECT_AP_READ
258 b __arm720_setup @ cpu_flush
259 .long cpu_arch_name @ arch_name
260 .long cpu_elf_name @ elf_name
261 .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB @ elf_hwcap
262 .long cpu_arm720_name @ name
263 .long arm720_processor_functions
264 .long v4_tlb_fns
265 .long v4wt_user_fns
266 .long v4_cache_fns
267 .size __arm720_proc_info, . - __arm720_proc_info
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
new file mode 100644
index 000000000000..0f490a0fcb71
--- /dev/null
+++ b/arch/arm/mm/proc-arm920.S
@@ -0,0 +1,480 @@
1/*
2 * linux/arch/arm/mm/proc-arm920.S: MMU functions for ARM920
3 *
4 * Copyright (C) 1999,2000 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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 * These are the low level assembler for performing cache and TLB
23 * functions on the arm920.
24 *
25 * CONFIG_CPU_ARM920_CPU_IDLE -> nohlt
26 */
27#include <linux/linkage.h>
28#include <linux/config.h>
29#include <linux/init.h>
30#include <asm/assembler.h>
31#include <asm/pgtable.h>
32#include <asm/procinfo.h>
33#include <asm/hardware.h>
34#include <asm/page.h>
35#include <asm/ptrace.h>
36#include "proc-macros.S"
37
38/*
39 * The size of one data cache line.
40 */
41#define CACHE_DLINESIZE 32
42
43/*
44 * The number of data cache segments.
45 */
46#define CACHE_DSEGMENTS 8
47
48/*
49 * The number of lines in a cache segment.
50 */
51#define CACHE_DENTRIES 64
52
53/*
54 * This is the size at which it becomes more efficient to
55 * clean the whole cache, rather than using the individual
56 * cache line maintainence instructions.
57 */
58#define CACHE_DLIMIT 65536
59
60
61 .text
62/*
63 * cpu_arm920_proc_init()
64 */
65ENTRY(cpu_arm920_proc_init)
66 mov pc, lr
67
68/*
69 * cpu_arm920_proc_fin()
70 */
71ENTRY(cpu_arm920_proc_fin)
72 stmfd sp!, {lr}
73 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
74 msr cpsr_c, ip
75#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
76 bl arm920_flush_kern_cache_all
77#else
78 bl v4wt_flush_kern_cache_all
79#endif
80 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
81 bic r0, r0, #0x1000 @ ...i............
82 bic r0, r0, #0x000e @ ............wca.
83 mcr p15, 0, r0, c1, c0, 0 @ disable caches
84 ldmfd sp!, {pc}
85
86/*
87 * cpu_arm920_reset(loc)
88 *
89 * Perform a soft reset of the system. Put the CPU into the
90 * same state as it would be if it had been reset, and branch
91 * to what would be the reset vector.
92 *
93 * loc: location to jump to for soft reset
94 */
95 .align 5
96ENTRY(cpu_arm920_reset)
97 mov ip, #0
98 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
99 mcr p15, 0, ip, c7, c10, 4 @ drain WB
100 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
101 mrc p15, 0, ip, c1, c0, 0 @ ctrl register
102 bic ip, ip, #0x000f @ ............wcam
103 bic ip, ip, #0x1100 @ ...i...s........
104 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
105 mov pc, r0
106
107/*
108 * cpu_arm920_do_idle()
109 */
110 .align 5
111ENTRY(cpu_arm920_do_idle)
112 mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
113 mov pc, lr
114
115
116#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
117
118/*
119 * flush_user_cache_all()
120 *
121 * Invalidate all cache entries in a particular address
122 * space.
123 */
124ENTRY(arm920_flush_user_cache_all)
125 /* FALLTHROUGH */
126
127/*
128 * flush_kern_cache_all()
129 *
130 * Clean and invalidate the entire cache.
131 */
132ENTRY(arm920_flush_kern_cache_all)
133 mov r2, #VM_EXEC
134 mov ip, #0
135__flush_whole_cache:
136 mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 8 segments
1371: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries
1382: mcr p15, 0, r3, c7, c14, 2 @ clean+invalidate D index
139 subs r3, r3, #1 << 26
140 bcs 2b @ entries 63 to 0
141 subs r1, r1, #1 << 5
142 bcs 1b @ segments 7 to 0
143 tst r2, #VM_EXEC
144 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
145 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
146 mov pc, lr
147
148/*
149 * flush_user_cache_range(start, end, flags)
150 *
151 * Invalidate a range of cache entries in the specified
152 * address space.
153 *
154 * - start - start address (inclusive)
155 * - end - end address (exclusive)
156 * - flags - vm_flags for address space
157 */
158ENTRY(arm920_flush_user_cache_range)
159 mov ip, #0
160 sub r3, r1, r0 @ calculate total size
161 cmp r3, #CACHE_DLIMIT
162 bhs __flush_whole_cache
163
1641: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
165 tst r2, #VM_EXEC
166 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
167 add r0, r0, #CACHE_DLINESIZE
168 cmp r0, r1
169 blo 1b
170 tst r2, #VM_EXEC
171 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
172 mov pc, lr
173
174/*
175 * coherent_kern_range(start, end)
176 *
177 * Ensure coherency between the Icache and the Dcache in the
178 * region described by start, end. If you have non-snooping
179 * Harvard caches, you need to implement this function.
180 *
181 * - start - virtual start address
182 * - end - virtual end address
183 */
184ENTRY(arm920_coherent_kern_range)
185 /* FALLTHROUGH */
186
187/*
188 * coherent_user_range(start, end)
189 *
190 * Ensure coherency between the Icache and the Dcache in the
191 * region described by start, end. If you have non-snooping
192 * Harvard caches, you need to implement this function.
193 *
194 * - start - virtual start address
195 * - end - virtual end address
196 */
197ENTRY(arm920_coherent_user_range)
198 bic r0, r0, #CACHE_DLINESIZE - 1
1991: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
200 mcr p15, 0, r0, c7, c5, 1 @ invalidate I entry
201 add r0, r0, #CACHE_DLINESIZE
202 cmp r0, r1
203 blo 1b
204 mcr p15, 0, r0, c7, c10, 4 @ drain WB
205 mov pc, lr
206
207/*
208 * flush_kern_dcache_page(void *page)
209 *
210 * Ensure no D cache aliasing occurs, either with itself or
211 * the I cache
212 *
213 * - addr - page aligned address
214 */
215ENTRY(arm920_flush_kern_dcache_page)
216 add r1, r0, #PAGE_SZ
2171: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
218 add r0, r0, #CACHE_DLINESIZE
219 cmp r0, r1
220 blo 1b
221 mov r0, #0
222 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
223 mcr p15, 0, r0, c7, c10, 4 @ drain WB
224 mov pc, lr
225
226/*
227 * dma_inv_range(start, end)
228 *
229 * Invalidate (discard) the specified virtual address range.
230 * May not write back any entries. If 'start' or 'end'
231 * are not cache line aligned, those lines must be written
232 * back.
233 *
234 * - start - virtual start address
235 * - end - virtual end address
236 *
237 * (same as v4wb)
238 */
239ENTRY(arm920_dma_inv_range)
240 tst r0, #CACHE_DLINESIZE - 1
241 bic r0, r0, #CACHE_DLINESIZE - 1
242 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
243 tst r1, #CACHE_DLINESIZE - 1
244 mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
2451: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
246 add r0, r0, #CACHE_DLINESIZE
247 cmp r0, r1
248 blo 1b
249 mcr p15, 0, r0, c7, c10, 4 @ drain WB
250 mov pc, lr
251
252/*
253 * dma_clean_range(start, end)
254 *
255 * Clean the specified virtual address range.
256 *
257 * - start - virtual start address
258 * - end - virtual end address
259 *
260 * (same as v4wb)
261 */
262ENTRY(arm920_dma_clean_range)
263 bic r0, r0, #CACHE_DLINESIZE - 1
2641: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
265 add r0, r0, #CACHE_DLINESIZE
266 cmp r0, r1
267 blo 1b
268 mcr p15, 0, r0, c7, c10, 4 @ drain WB
269 mov pc, lr
270
271/*
272 * dma_flush_range(start, end)
273 *
274 * Clean and invalidate the specified virtual address range.
275 *
276 * - start - virtual start address
277 * - end - virtual end address
278 */
279ENTRY(arm920_dma_flush_range)
280 bic r0, r0, #CACHE_DLINESIZE - 1
2811: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
282 add r0, r0, #CACHE_DLINESIZE
283 cmp r0, r1
284 blo 1b
285 mcr p15, 0, r0, c7, c10, 4 @ drain WB
286 mov pc, lr
287
288ENTRY(arm920_cache_fns)
289 .long arm920_flush_kern_cache_all
290 .long arm920_flush_user_cache_all
291 .long arm920_flush_user_cache_range
292 .long arm920_coherent_kern_range
293 .long arm920_coherent_user_range
294 .long arm920_flush_kern_dcache_page
295 .long arm920_dma_inv_range
296 .long arm920_dma_clean_range
297 .long arm920_dma_flush_range
298
299#endif
300
301
302ENTRY(cpu_arm920_dcache_clean_area)
3031: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
304 add r0, r0, #CACHE_DLINESIZE
305 subs r1, r1, #CACHE_DLINESIZE
306 bhi 1b
307 mov pc, lr
308
309/* =============================== PageTable ============================== */
310
311/*
312 * cpu_arm920_switch_mm(pgd)
313 *
314 * Set the translation base pointer to be as described by pgd.
315 *
316 * pgd: new page tables
317 */
318 .align 5
319ENTRY(cpu_arm920_switch_mm)
320 mov ip, #0
321#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
322 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
323#else
324@ && 'Clean & Invalidate whole DCache'
325@ && Re-written to use Index Ops.
326@ && Uses registers r1, r3 and ip
327
328 mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 8 segments
3291: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries
3302: mcr p15, 0, r3, c7, c14, 2 @ clean & invalidate D index
331 subs r3, r3, #1 << 26
332 bcs 2b @ entries 63 to 0
333 subs r1, r1, #1 << 5
334 bcs 1b @ segments 7 to 0
335#endif
336 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
337 mcr p15, 0, ip, c7, c10, 4 @ drain WB
338 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
339 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
340 mov pc, lr
341
342/*
343 * cpu_arm920_set_pte(ptep, pte)
344 *
345 * Set a PTE and flush it out
346 */
347 .align 5
348ENTRY(cpu_arm920_set_pte)
349 str r1, [r0], #-2048 @ linux version
350
351 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
352
353 bic r2, r1, #PTE_SMALL_AP_MASK
354 bic r2, r2, #PTE_TYPE_MASK
355 orr r2, r2, #PTE_TYPE_SMALL
356
357 tst r1, #L_PTE_USER @ User?
358 orrne r2, r2, #PTE_SMALL_AP_URO_SRW
359
360 tst r1, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
361 orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
362
363 tst r1, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young?
364 movne r2, #0
365
366#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
367 eor r3, r2, #0x0a @ C & small page?
368 tst r3, #0x0b
369 biceq r2, r2, #4
370#endif
371 str r2, [r0] @ hardware version
372 mov r0, r0
373 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
374 mcr p15, 0, r0, c7, c10, 4 @ drain WB
375 mov pc, lr
376
377 __INIT
378
379 .type __arm920_setup, #function
380__arm920_setup:
381 mov r0, #0
382 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
383 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
384 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4
385 mrc p15, 0, r0, c1, c0 @ get control register v4
386 ldr r5, arm920_cr1_clear
387 bic r0, r0, r5
388 ldr r5, arm920_cr1_set
389 orr r0, r0, r5
390 mov pc, lr
391 .size __arm920_setup, . - __arm920_setup
392
393 /*
394 * R
395 * .RVI ZFRS BLDP WCAM
396 * ..11 0001 ..11 0101
397 *
398 */
399 .type arm920_cr1_clear, #object
400 .type arm920_cr1_set, #object
401arm920_cr1_clear:
402 .word 0x3f3f
403arm920_cr1_set:
404 .word 0x3135
405
406 __INITDATA
407
408/*
409 * Purpose : Function pointers used to access above functions - all calls
410 * come through these
411 */
412 .type arm920_processor_functions, #object
413arm920_processor_functions:
414 .word v4t_early_abort
415 .word cpu_arm920_proc_init
416 .word cpu_arm920_proc_fin
417 .word cpu_arm920_reset
418 .word cpu_arm920_do_idle
419 .word cpu_arm920_dcache_clean_area
420 .word cpu_arm920_switch_mm
421 .word cpu_arm920_set_pte
422 .size arm920_processor_functions, . - arm920_processor_functions
423
424 .section ".rodata"
425
426 .type cpu_arch_name, #object
427cpu_arch_name:
428 .asciz "armv4t"
429 .size cpu_arch_name, . - cpu_arch_name
430
431 .type cpu_elf_name, #object
432cpu_elf_name:
433 .asciz "v4"
434 .size cpu_elf_name, . - cpu_elf_name
435
436 .type cpu_arm920_name, #object
437cpu_arm920_name:
438 .ascii "ARM920T"
439#ifndef CONFIG_CPU_ICACHE_DISABLE
440 .ascii "i"
441#endif
442#ifndef CONFIG_CPU_DCACHE_DISABLE
443 .ascii "d"
444#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
445 .ascii "(wt)"
446#else
447 .ascii "(wb)"
448#endif
449#endif
450 .ascii "\0"
451 .size cpu_arm920_name, . - cpu_arm920_name
452
453 .align
454
455 .section ".proc.info", #alloc, #execinstr
456
457 .type __arm920_proc_info,#object
458__arm920_proc_info:
459 .long 0x41009200
460 .long 0xff00fff0
461 .long PMD_TYPE_SECT | \
462 PMD_SECT_BUFFERABLE | \
463 PMD_SECT_CACHEABLE | \
464 PMD_BIT4 | \
465 PMD_SECT_AP_WRITE | \
466 PMD_SECT_AP_READ
467 b __arm920_setup
468 .long cpu_arch_name
469 .long cpu_elf_name
470 .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB
471 .long cpu_arm920_name
472 .long arm920_processor_functions
473 .long v4wbi_tlb_fns
474 .long v4wb_user_fns
475#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
476 .long arm920_cache_fns
477#else
478 .long v4wt_cache_fns
479#endif
480 .size __arm920_proc_info, . - __arm920_proc_info
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S
new file mode 100644
index 000000000000..62bc34a139ee
--- /dev/null
+++ b/arch/arm/mm/proc-arm922.S
@@ -0,0 +1,484 @@
1/*
2 * linux/arch/arm/mm/proc-arm922.S: MMU functions for ARM922
3 *
4 * Copyright (C) 1999,2000 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd.
6 * Copyright (C) 2001 Altera Corporation
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 *
23 * These are the low level assembler for performing cache and TLB
24 * functions on the arm922.
25 *
26 * CONFIG_CPU_ARM922_CPU_IDLE -> nohlt
27 */
28#include <linux/linkage.h>
29#include <linux/config.h>
30#include <linux/init.h>
31#include <asm/assembler.h>
32#include <asm/pgtable.h>
33#include <asm/procinfo.h>
34#include <asm/hardware.h>
35#include <asm/page.h>
36#include <asm/ptrace.h>
37#include "proc-macros.S"
38
39/*
40 * The size of one data cache line.
41 */
42#define CACHE_DLINESIZE 32
43
44/*
45 * The number of data cache segments.
46 */
47#define CACHE_DSEGMENTS 4
48
49/*
50 * The number of lines in a cache segment.
51 */
52#define CACHE_DENTRIES 64
53
54/*
55 * This is the size at which it becomes more efficient to
56 * clean the whole cache, rather than using the individual
57 * cache line maintainence instructions. (I think this should
58 * be 32768).
59 */
60#define CACHE_DLIMIT 8192
61
62
63 .text
64/*
65 * cpu_arm922_proc_init()
66 */
67ENTRY(cpu_arm922_proc_init)
68 mov pc, lr
69
70/*
71 * cpu_arm922_proc_fin()
72 */
73ENTRY(cpu_arm922_proc_fin)
74 stmfd sp!, {lr}
75 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
76 msr cpsr_c, ip
77#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
78 bl arm922_flush_kern_cache_all
79#else
80 bl v4wt_flush_kern_cache_all
81#endif
82 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
83 bic r0, r0, #0x1000 @ ...i............
84 bic r0, r0, #0x000e @ ............wca.
85 mcr p15, 0, r0, c1, c0, 0 @ disable caches
86 ldmfd sp!, {pc}
87
88/*
89 * cpu_arm922_reset(loc)
90 *
91 * Perform a soft reset of the system. Put the CPU into the
92 * same state as it would be if it had been reset, and branch
93 * to what would be the reset vector.
94 *
95 * loc: location to jump to for soft reset
96 */
97 .align 5
98ENTRY(cpu_arm922_reset)
99 mov ip, #0
100 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
101 mcr p15, 0, ip, c7, c10, 4 @ drain WB
102 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
103 mrc p15, 0, ip, c1, c0, 0 @ ctrl register
104 bic ip, ip, #0x000f @ ............wcam
105 bic ip, ip, #0x1100 @ ...i...s........
106 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
107 mov pc, r0
108
109/*
110 * cpu_arm922_do_idle()
111 */
112 .align 5
113ENTRY(cpu_arm922_do_idle)
114 mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
115 mov pc, lr
116
117
118#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
119
120/*
121 * flush_user_cache_all()
122 *
123 * Clean and invalidate all cache entries in a particular
124 * address space.
125 */
126ENTRY(arm922_flush_user_cache_all)
127 /* FALLTHROUGH */
128
129/*
130 * flush_kern_cache_all()
131 *
132 * Clean and invalidate the entire cache.
133 */
134ENTRY(arm922_flush_kern_cache_all)
135 mov r2, #VM_EXEC
136 mov ip, #0
137__flush_whole_cache:
138 mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 8 segments
1391: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries
1402: mcr p15, 0, r3, c7, c14, 2 @ clean+invalidate D index
141 subs r3, r3, #1 << 26
142 bcs 2b @ entries 63 to 0
143 subs r1, r1, #1 << 5
144 bcs 1b @ segments 7 to 0
145 tst r2, #VM_EXEC
146 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
147 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
148 mov pc, lr
149
150/*
151 * flush_user_cache_range(start, end, flags)
152 *
153 * Clean and invalidate a range of cache entries in the
154 * specified address range.
155 *
156 * - start - start address (inclusive)
157 * - end - end address (exclusive)
158 * - flags - vm_flags describing address space
159 */
160ENTRY(arm922_flush_user_cache_range)
161 mov ip, #0
162 sub r3, r1, r0 @ calculate total size
163 cmp r3, #CACHE_DLIMIT
164 bhs __flush_whole_cache
165
1661: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
167 tst r2, #VM_EXEC
168 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
169 add r0, r0, #CACHE_DLINESIZE
170 cmp r0, r1
171 blo 1b
172 tst r2, #VM_EXEC
173 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
174 mov pc, lr
175
176/*
177 * coherent_kern_range(start, end)
178 *
179 * Ensure coherency between the Icache and the Dcache in the
180 * region described by start, end. If you have non-snooping
181 * Harvard caches, you need to implement this function.
182 *
183 * - start - virtual start address
184 * - end - virtual end address
185 */
186ENTRY(arm922_coherent_kern_range)
187 /* FALLTHROUGH */
188
189/*
190 * coherent_user_range(start, end)
191 *
192 * Ensure coherency between the Icache and the Dcache in the
193 * region described by start, end. If you have non-snooping
194 * Harvard caches, you need to implement this function.
195 *
196 * - start - virtual start address
197 * - end - virtual end address
198 */
199ENTRY(arm922_coherent_user_range)
200 bic r0, r0, #CACHE_DLINESIZE - 1
2011: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
202 mcr p15, 0, r0, c7, c5, 1 @ invalidate I entry
203 add r0, r0, #CACHE_DLINESIZE
204 cmp r0, r1
205 blo 1b
206 mcr p15, 0, r0, c7, c10, 4 @ drain WB
207 mov pc, lr
208
209/*
210 * flush_kern_dcache_page(void *page)
211 *
212 * Ensure no D cache aliasing occurs, either with itself or
213 * the I cache
214 *
215 * - addr - page aligned address
216 */
217ENTRY(arm922_flush_kern_dcache_page)
218 add r1, r0, #PAGE_SZ
2191: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
220 add r0, r0, #CACHE_DLINESIZE
221 cmp r0, r1
222 blo 1b
223 mov r0, #0
224 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
225 mcr p15, 0, r0, c7, c10, 4 @ drain WB
226 mov pc, lr
227
228/*
229 * dma_inv_range(start, end)
230 *
231 * Invalidate (discard) the specified virtual address range.
232 * May not write back any entries. If 'start' or 'end'
233 * are not cache line aligned, those lines must be written
234 * back.
235 *
236 * - start - virtual start address
237 * - end - virtual end address
238 *
239 * (same as v4wb)
240 */
241ENTRY(arm922_dma_inv_range)
242 tst r0, #CACHE_DLINESIZE - 1
243 bic r0, r0, #CACHE_DLINESIZE - 1
244 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
245 tst r1, #CACHE_DLINESIZE - 1
246 mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
2471: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
248 add r0, r0, #CACHE_DLINESIZE
249 cmp r0, r1
250 blo 1b
251 mcr p15, 0, r0, c7, c10, 4 @ drain WB
252 mov pc, lr
253
254/*
255 * dma_clean_range(start, end)
256 *
257 * Clean the specified virtual address range.
258 *
259 * - start - virtual start address
260 * - end - virtual end address
261 *
262 * (same as v4wb)
263 */
264ENTRY(arm922_dma_clean_range)
265 bic r0, r0, #CACHE_DLINESIZE - 1
2661: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
267 add r0, r0, #CACHE_DLINESIZE
268 cmp r0, r1
269 blo 1b
270 mcr p15, 0, r0, c7, c10, 4 @ drain WB
271 mov pc, lr
272
273/*
274 * dma_flush_range(start, end)
275 *
276 * Clean and invalidate the specified virtual address range.
277 *
278 * - start - virtual start address
279 * - end - virtual end address
280 */
281ENTRY(arm922_dma_flush_range)
282 bic r0, r0, #CACHE_DLINESIZE - 1
2831: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
284 add r0, r0, #CACHE_DLINESIZE
285 cmp r0, r1
286 blo 1b
287 mcr p15, 0, r0, c7, c10, 4 @ drain WB
288 mov pc, lr
289
290ENTRY(arm922_cache_fns)
291 .long arm922_flush_kern_cache_all
292 .long arm922_flush_user_cache_all
293 .long arm922_flush_user_cache_range
294 .long arm922_coherent_kern_range
295 .long arm922_coherent_user_range
296 .long arm922_flush_kern_dcache_page
297 .long arm922_dma_inv_range
298 .long arm922_dma_clean_range
299 .long arm922_dma_flush_range
300
301#endif
302
303
304ENTRY(cpu_arm922_dcache_clean_area)
305#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
3061: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
307 add r0, r0, #CACHE_DLINESIZE
308 subs r1, r1, #CACHE_DLINESIZE
309 bhi 1b
310#endif
311 mov pc, lr
312
313/* =============================== PageTable ============================== */
314
315/*
316 * cpu_arm922_switch_mm(pgd)
317 *
318 * Set the translation base pointer to be as described by pgd.
319 *
320 * pgd: new page tables
321 */
322 .align 5
323ENTRY(cpu_arm922_switch_mm)
324 mov ip, #0
325#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
326 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
327#else
328@ && 'Clean & Invalidate whole DCache'
329@ && Re-written to use Index Ops.
330@ && Uses registers r1, r3 and ip
331
332 mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 4 segments
3331: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries
3342: mcr p15, 0, r3, c7, c14, 2 @ clean & invalidate D index
335 subs r3, r3, #1 << 26
336 bcs 2b @ entries 63 to 0
337 subs r1, r1, #1 << 5
338 bcs 1b @ segments 7 to 0
339#endif
340 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
341 mcr p15, 0, ip, c7, c10, 4 @ drain WB
342 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
343 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
344 mov pc, lr
345
346/*
347 * cpu_arm922_set_pte(ptep, pte)
348 *
349 * Set a PTE and flush it out
350 */
351 .align 5
352ENTRY(cpu_arm922_set_pte)
353 str r1, [r0], #-2048 @ linux version
354
355 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
356
357 bic r2, r1, #PTE_SMALL_AP_MASK
358 bic r2, r2, #PTE_TYPE_MASK
359 orr r2, r2, #PTE_TYPE_SMALL
360
361 tst r1, #L_PTE_USER @ User?
362 orrne r2, r2, #PTE_SMALL_AP_URO_SRW
363
364 tst r1, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
365 orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
366
367 tst r1, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young?
368 movne r2, #0
369
370#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
371 eor r3, r2, #0x0a @ C & small page?
372 tst r3, #0x0b
373 biceq r2, r2, #4
374#endif
375 str r2, [r0] @ hardware version
376 mov r0, r0
377 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
378 mcr p15, 0, r0, c7, c10, 4 @ drain WB
379 mov pc, lr
380
381 __INIT
382
383 .type __arm922_setup, #function
384__arm922_setup:
385 mov r0, #0
386 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
387 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
388 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4
389 mrc p15, 0, r0, c1, c0 @ get control register v4
390 ldr r5, arm922_cr1_clear
391 bic r0, r0, r5
392 ldr r5, arm922_cr1_set
393 orr r0, r0, r5
394 mov pc, lr
395 .size __arm922_setup, . - __arm922_setup
396
397 /*
398 * R
399 * .RVI ZFRS BLDP WCAM
400 * ..11 0001 ..11 0101
401 *
402 */
403 .type arm922_cr1_clear, #object
404 .type arm922_cr1_set, #object
405arm922_cr1_clear:
406 .word 0x3f3f
407arm922_cr1_set:
408 .word 0x3135
409
410 __INITDATA
411
412/*
413 * Purpose : Function pointers used to access above functions - all calls
414 * come through these
415 */
416 .type arm922_processor_functions, #object
417arm922_processor_functions:
418 .word v4t_early_abort
419 .word cpu_arm922_proc_init
420 .word cpu_arm922_proc_fin
421 .word cpu_arm922_reset
422 .word cpu_arm922_do_idle
423 .word cpu_arm922_dcache_clean_area
424 .word cpu_arm922_switch_mm
425 .word cpu_arm922_set_pte
426 .size arm922_processor_functions, . - arm922_processor_functions
427
428 .section ".rodata"
429
430 .type cpu_arch_name, #object
431cpu_arch_name:
432 .asciz "armv4t"
433 .size cpu_arch_name, . - cpu_arch_name
434
435 .type cpu_elf_name, #object
436cpu_elf_name:
437 .asciz "v4"
438 .size cpu_elf_name, . - cpu_elf_name
439
440 .type cpu_arm922_name, #object
441cpu_arm922_name:
442 .ascii "ARM922T"
443#ifndef CONFIG_CPU_ICACHE_DISABLE
444 .ascii "i"
445#endif
446#ifndef CONFIG_CPU_DCACHE_DISABLE
447 .ascii "d"
448#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
449 .ascii "(wt)"
450#else
451 .ascii "(wb)"
452#endif
453#endif
454 .ascii "\0"
455 .size cpu_arm922_name, . - cpu_arm922_name
456
457 .align
458
459 .section ".proc.info", #alloc, #execinstr
460
461 .type __arm922_proc_info,#object
462__arm922_proc_info:
463 .long 0x41009220
464 .long 0xff00fff0
465 .long PMD_TYPE_SECT | \
466 PMD_SECT_BUFFERABLE | \
467 PMD_SECT_CACHEABLE | \
468 PMD_BIT4 | \
469 PMD_SECT_AP_WRITE | \
470 PMD_SECT_AP_READ
471 b __arm922_setup
472 .long cpu_arch_name
473 .long cpu_elf_name
474 .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB
475 .long cpu_arm922_name
476 .long arm922_processor_functions
477 .long v4wbi_tlb_fns
478 .long v4wb_user_fns
479#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
480 .long arm922_cache_fns
481#else
482 .long v4wt_cache_fns
483#endif
484 .size __arm922_proc_info, . - __arm922_proc_info
diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S
new file mode 100644
index 000000000000..ee49aa2ca781
--- /dev/null
+++ b/arch/arm/mm/proc-arm925.S
@@ -0,0 +1,562 @@
1/*
2 * linux/arch/arm/mm/arm925.S: MMU functions for ARM925
3 *
4 * Copyright (C) 1999,2000 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd.
6 * Copyright (C) 2002 RidgeRun, Inc.
7 * Copyright (C) 2002-2003 MontaVista Software, Inc.
8 *
9 * Update for Linux-2.6 and cache flush improvements
10 * Copyright (C) 2004 Nokia Corporation by Tony Lindgren <tony@atomide.com>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 *
27 * These are the low level assembler for performing cache and TLB
28 * functions on the arm925.
29 *
30 * CONFIG_CPU_ARM925_CPU_IDLE -> nohlt
31 *
32 * Some additional notes based on deciphering the TI TRM on OMAP-5910:
33 *
34 * NOTE1: The TI925T Configuration Register bit "D-cache clean and flush
35 * entry mode" must be 0 to flush the entries in both segments
36 * at once. This is the default value. See TRM 2-20 and 2-24 for
37 * more information.
38 *
39 * NOTE2: Default is the "D-cache clean and flush entry mode". It looks
40 * like the "Transparent mode" must be on for partial cache flushes
41 * to work in this mode. This mode only works with 16-bit external
42 * memory. See TRM 2-24 for more information.
43 *
44 * NOTE3: Write-back cache flushing seems to be flakey with devices using
45 * direct memory access, such as USB OHCI. The workaround is to use
46 * write-through cache with CONFIG_CPU_DCACHE_WRITETHROUGH (this is
47 * the default for OMAP-1510).
48 */
49
50#include <linux/linkage.h>
51#include <linux/config.h>
52#include <linux/init.h>
53#include <asm/assembler.h>
54#include <asm/pgtable.h>
55#include <asm/procinfo.h>
56#include <asm/hardware.h>
57#include <asm/page.h>
58#include <asm/ptrace.h>
59#include "proc-macros.S"
60
61/*
62 * The size of one data cache line.
63 */
64#define CACHE_DLINESIZE 16
65
66/*
67 * The number of data cache segments.
68 */
69#define CACHE_DSEGMENTS 2
70
71/*
72 * The number of lines in a cache segment.
73 */
74#define CACHE_DENTRIES 256
75
76/*
77 * This is the size at which it becomes more efficient to
78 * clean the whole cache, rather than using the individual
79 * cache line maintainence instructions.
80 */
81#define CACHE_DLIMIT 8192
82
83 .text
84/*
85 * cpu_arm925_proc_init()
86 */
87ENTRY(cpu_arm925_proc_init)
88 mov pc, lr
89
90/*
91 * cpu_arm925_proc_fin()
92 */
93ENTRY(cpu_arm925_proc_fin)
94 stmfd sp!, {lr}
95 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
96 msr cpsr_c, ip
97 bl arm925_flush_kern_cache_all
98 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
99 bic r0, r0, #0x1000 @ ...i............
100 bic r0, r0, #0x000e @ ............wca.
101 mcr p15, 0, r0, c1, c0, 0 @ disable caches
102 ldmfd sp!, {pc}
103
104/*
105 * cpu_arm925_reset(loc)
106 *
107 * Perform a soft reset of the system. Put the CPU into the
108 * same state as it would be if it had been reset, and branch
109 * to what would be the reset vector.
110 *
111 * loc: location to jump to for soft reset
112 */
113 .align 5
114ENTRY(cpu_arm925_reset)
115 /* Send software reset to MPU and DSP */
116 mov ip, #0xff000000
117 orr ip, ip, #0x00fe0000
118 orr ip, ip, #0x0000ce00
119 mov r4, #1
120 strh r4, [ip, #0x10]
121
122 mov ip, #0
123 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
124 mcr p15, 0, ip, c7, c10, 4 @ drain WB
125 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
126 mrc p15, 0, ip, c1, c0, 0 @ ctrl register
127 bic ip, ip, #0x000f @ ............wcam
128 bic ip, ip, #0x1100 @ ...i...s........
129 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
130 mov pc, r0
131
132/*
133 * cpu_arm925_do_idle()
134 *
135 * Called with IRQs disabled
136 */
137 .align 10
138ENTRY(cpu_arm925_do_idle)
139 mov r0, #0
140 mrc p15, 0, r1, c1, c0, 0 @ Read control register
141 mcr p15, 0, r0, c7, c10, 4 @ Drain write buffer
142 bic r2, r1, #1 << 12
143 mcr p15, 0, r2, c1, c0, 0 @ Disable I cache
144 mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
145 mcr p15, 0, r1, c1, c0, 0 @ Restore ICache enable
146 mov pc, lr
147
148/*
149 * flush_user_cache_all()
150 *
151 * Clean and invalidate all cache entries in a particular
152 * address space.
153 */
154ENTRY(arm925_flush_user_cache_all)
155 /* FALLTHROUGH */
156
157/*
158 * flush_kern_cache_all()
159 *
160 * Clean and invalidate the entire cache.
161 */
162ENTRY(arm925_flush_kern_cache_all)
163 mov r2, #VM_EXEC
164 mov ip, #0
165__flush_whole_cache:
166#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
167 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
168#else
169 /* Flush entries in both segments at once, see NOTE1 above */
170 mov r3, #(CACHE_DENTRIES - 1) << 4 @ 256 entries in segment
1712: mcr p15, 0, r3, c7, c14, 2 @ clean+invalidate D index
172 subs r3, r3, #1 << 4
173 bcs 2b @ entries 255 to 0
174#endif
175 tst r2, #VM_EXEC
176 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
177 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
178 mov pc, lr
179
180/*
181 * flush_user_cache_range(start, end, flags)
182 *
183 * Clean and invalidate a range of cache entries in the
184 * specified address range.
185 *
186 * - start - start address (inclusive)
187 * - end - end address (exclusive)
188 * - flags - vm_flags describing address space
189 */
190ENTRY(arm925_flush_user_cache_range)
191 mov ip, #0
192 sub r3, r1, r0 @ calculate total size
193 cmp r3, #CACHE_DLIMIT
194 bgt __flush_whole_cache
1951: tst r2, #VM_EXEC
196#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
197 mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
198 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
199 add r0, r0, #CACHE_DLINESIZE
200 mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
201 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
202 add r0, r0, #CACHE_DLINESIZE
203#else
204 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
205 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
206 add r0, r0, #CACHE_DLINESIZE
207 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
208 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
209 add r0, r0, #CACHE_DLINESIZE
210#endif
211 cmp r0, r1
212 blo 1b
213 tst r2, #VM_EXEC
214 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
215 mov pc, lr
216
217/*
218 * coherent_kern_range(start, end)
219 *
220 * Ensure coherency between the Icache and the Dcache in the
221 * region described by start, end. If you have non-snooping
222 * Harvard caches, you need to implement this function.
223 *
224 * - start - virtual start address
225 * - end - virtual end address
226 */
227ENTRY(arm925_coherent_kern_range)
228 /* FALLTHROUGH */
229
230/*
231 * coherent_user_range(start, end)
232 *
233 * Ensure coherency between the Icache and the Dcache in the
234 * region described by start, end. If you have non-snooping
235 * Harvard caches, you need to implement this function.
236 *
237 * - start - virtual start address
238 * - end - virtual end address
239 */
240ENTRY(arm925_coherent_user_range)
241 bic r0, r0, #CACHE_DLINESIZE - 1
2421: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
243 mcr p15, 0, r0, c7, c5, 1 @ invalidate I entry
244 add r0, r0, #CACHE_DLINESIZE
245 cmp r0, r1
246 blo 1b
247 mcr p15, 0, r0, c7, c10, 4 @ drain WB
248 mov pc, lr
249
250/*
251 * flush_kern_dcache_page(void *page)
252 *
253 * Ensure no D cache aliasing occurs, either with itself or
254 * the I cache
255 *
256 * - addr - page aligned address
257 */
258ENTRY(arm925_flush_kern_dcache_page)
259 add r1, r0, #PAGE_SZ
2601: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
261 add r0, r0, #CACHE_DLINESIZE
262 cmp r0, r1
263 blo 1b
264 mov r0, #0
265 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
266 mcr p15, 0, r0, c7, c10, 4 @ drain WB
267 mov pc, lr
268
269/*
270 * dma_inv_range(start, end)
271 *
272 * Invalidate (discard) the specified virtual address range.
273 * May not write back any entries. If 'start' or 'end'
274 * are not cache line aligned, those lines must be written
275 * back.
276 *
277 * - start - virtual start address
278 * - end - virtual end address
279 *
280 * (same as v4wb)
281 */
282ENTRY(arm925_dma_inv_range)
283#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
284 tst r0, #CACHE_DLINESIZE - 1
285 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
286 tst r1, #CACHE_DLINESIZE - 1
287 mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
288#endif
289 bic r0, r0, #CACHE_DLINESIZE - 1
2901: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
291 add r0, r0, #CACHE_DLINESIZE
292 cmp r0, r1
293 blo 1b
294 mcr p15, 0, r0, c7, c10, 4 @ drain WB
295 mov pc, lr
296
297/*
298 * dma_clean_range(start, end)
299 *
300 * Clean the specified virtual address range.
301 *
302 * - start - virtual start address
303 * - end - virtual end address
304 *
305 * (same as v4wb)
306 */
307ENTRY(arm925_dma_clean_range)
308#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
309 bic r0, r0, #CACHE_DLINESIZE - 1
3101: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
311 add r0, r0, #CACHE_DLINESIZE
312 cmp r0, r1
313 blo 1b
314#endif
315 mcr p15, 0, r0, c7, c10, 4 @ drain WB
316 mov pc, lr
317
318/*
319 * dma_flush_range(start, end)
320 *
321 * Clean and invalidate the specified virtual address range.
322 *
323 * - start - virtual start address
324 * - end - virtual end address
325 */
326ENTRY(arm925_dma_flush_range)
327 bic r0, r0, #CACHE_DLINESIZE - 1
3281:
329#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
330 mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
331#else
332 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
333#endif
334 add r0, r0, #CACHE_DLINESIZE
335 cmp r0, r1
336 blo 1b
337 mcr p15, 0, r0, c7, c10, 4 @ drain WB
338 mov pc, lr
339
340ENTRY(arm925_cache_fns)
341 .long arm925_flush_kern_cache_all
342 .long arm925_flush_user_cache_all
343 .long arm925_flush_user_cache_range
344 .long arm925_coherent_kern_range
345 .long arm925_coherent_user_range
346 .long arm925_flush_kern_dcache_page
347 .long arm925_dma_inv_range
348 .long arm925_dma_clean_range
349 .long arm925_dma_flush_range
350
351ENTRY(cpu_arm925_dcache_clean_area)
352#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
3531: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
354 add r0, r0, #CACHE_DLINESIZE
355 subs r1, r1, #CACHE_DLINESIZE
356 bhi 1b
357#endif
358 mcr p15, 0, r0, c7, c10, 4 @ drain WB
359 mov pc, lr
360
361/* =============================== PageTable ============================== */
362
363/*
364 * cpu_arm925_switch_mm(pgd)
365 *
366 * Set the translation base pointer to be as described by pgd.
367 *
368 * pgd: new page tables
369 */
370 .align 5
371ENTRY(cpu_arm925_switch_mm)
372 mov ip, #0
373#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
374 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
375#else
376 /* Flush entries in bothe segments at once, see NOTE1 above */
377 mov r3, #(CACHE_DENTRIES - 1) << 4 @ 256 entries in segment
3782: mcr p15, 0, r3, c7, c14, 2 @ clean & invalidate D index
379 subs r3, r3, #1 << 4
380 bcs 2b @ entries 255 to 0
381#endif
382 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
383 mcr p15, 0, ip, c7, c10, 4 @ drain WB
384 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
385 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
386 mov pc, lr
387
388/*
389 * cpu_arm925_set_pte(ptep, pte)
390 *
391 * Set a PTE and flush it out
392 */
393 .align 5
394ENTRY(cpu_arm925_set_pte)
395 str r1, [r0], #-2048 @ linux version
396
397 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
398
399 bic r2, r1, #PTE_SMALL_AP_MASK
400 bic r2, r2, #PTE_TYPE_MASK
401 orr r2, r2, #PTE_TYPE_SMALL
402
403 tst r1, #L_PTE_USER @ User?
404 orrne r2, r2, #PTE_SMALL_AP_URO_SRW
405
406 tst r1, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
407 orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
408
409 tst r1, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young?
410 movne r2, #0
411
412#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
413 eor r3, r2, #0x0a @ C & small page?
414 tst r3, #0x0b
415 biceq r2, r2, #4
416#endif
417 str r2, [r0] @ hardware version
418 mov r0, r0
419#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
420 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
421#endif
422 mcr p15, 0, r0, c7, c10, 4 @ drain WB
423 mov pc, lr
424
425 __INIT
426
427 .type __arm925_setup, #function
428__arm925_setup:
429 mov r0, #0
430#if defined(CONFIG_CPU_ICACHE_STREAMING_DISABLE)
431 orr r0,r0,#1 << 7
432#endif
433
434 /* Transparent on, D-cache clean & flush mode. See NOTE2 above */
435 orr r0,r0,#1 << 1 @ transparent mode on
436 mcr p15, 0, r0, c15, c1, 0 @ write TI config register
437
438 mov r0, #0
439 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
440 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
441 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4
442
443#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
444 mov r0, #4 @ disable write-back on caches explicitly
445 mcr p15, 7, r0, c15, c0, 0
446#endif
447
448 mrc p15, 0, r0, c1, c0 @ get control register v4
449 ldr r5, arm925_cr1_clear
450 bic r0, r0, r5
451 ldr r5, arm925_cr1_set
452 orr r0, r0, r5
453#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
454 orr r0, r0, #0x4000 @ .1.. .... .... ....
455#endif
456 mov pc, lr
457 .size __arm925_setup, . - __arm925_setup
458
459 /*
460 * R
461 * .RVI ZFRS BLDP WCAM
462 * .011 0001 ..11 1101
463 *
464 */
465 .type arm925_cr1_clear, #object
466 .type arm925_cr1_set, #object
467arm925_cr1_clear:
468 .word 0x7f3f
469arm925_cr1_set:
470 .word 0x313d
471
472 __INITDATA
473
474/*
475 * Purpose : Function pointers used to access above functions - all calls
476 * come through these
477 */
478 .type arm925_processor_functions, #object
479arm925_processor_functions:
480 .word v4t_early_abort
481 .word cpu_arm925_proc_init
482 .word cpu_arm925_proc_fin
483 .word cpu_arm925_reset
484 .word cpu_arm925_do_idle
485 .word cpu_arm925_dcache_clean_area
486 .word cpu_arm925_switch_mm
487 .word cpu_arm925_set_pte
488 .size arm925_processor_functions, . - arm925_processor_functions
489
490 .section ".rodata"
491
492 .type cpu_arch_name, #object
493cpu_arch_name:
494 .asciz "armv4t"
495 .size cpu_arch_name, . - cpu_arch_name
496
497 .type cpu_elf_name, #object
498cpu_elf_name:
499 .asciz "v4"
500 .size cpu_elf_name, . - cpu_elf_name
501
502 .type cpu_arm925_name, #object
503cpu_arm925_name:
504 .ascii "ARM925T"
505#ifndef CONFIG_CPU_ICACHE_DISABLE
506 .ascii "i"
507#endif
508#ifndef CONFIG_CPU_DCACHE_DISABLE
509 .ascii "d"
510#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
511 .ascii "(wt)"
512#else
513 .ascii "(wb)"
514#endif
515#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
516 .ascii "RR"
517#endif
518#endif
519 .ascii "\0"
520 .size cpu_arm925_name, . - cpu_arm925_name
521
522 .align
523
524 .section ".proc.info", #alloc, #execinstr
525
526 .type __arm925_proc_info,#object
527__arm925_proc_info:
528 .long 0x54029250
529 .long 0xfffffff0
530 .long PMD_TYPE_SECT | \
531 PMD_BIT4 | \
532 PMD_SECT_AP_WRITE | \
533 PMD_SECT_AP_READ
534 b __arm925_setup
535 .long cpu_arch_name
536 .long cpu_elf_name
537 .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB
538 .long cpu_arm925_name
539 .long arm925_processor_functions
540 .long v4wbi_tlb_fns
541 .long v4wb_user_fns
542 .long arm925_cache_fns
543 .size __arm925_proc_info, . - __arm925_proc_info
544
545 .type __arm915_proc_info,#object
546__arm915_proc_info:
547 .long 0x54029150
548 .long 0xfffffff0
549 .long PMD_TYPE_SECT | \
550 PMD_BIT4 | \
551 PMD_SECT_AP_WRITE | \
552 PMD_SECT_AP_READ
553 b __arm925_setup
554 .long cpu_arch_name
555 .long cpu_elf_name
556 .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB
557 .long cpu_arm925_name
558 .long arm925_processor_functions
559 .long v4wbi_tlb_fns
560 .long v4wb_user_fns
561 .long arm925_cache_fns
562 .size __arm925_proc_info, . - __arm925_proc_info
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
new file mode 100644
index 000000000000..bb95cc9fed03
--- /dev/null
+++ b/arch/arm/mm/proc-arm926.S
@@ -0,0 +1,495 @@
1/*
2 * linux/arch/arm/mm/proc-arm926.S: MMU functions for ARM926EJ-S
3 *
4 * Copyright (C) 1999-2001 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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 * These are the low level assembler for performing cache and TLB
23 * functions on the arm926.
24 *
25 * CONFIG_CPU_ARM926_CPU_IDLE -> nohlt
26 */
27#include <linux/linkage.h>
28#include <linux/config.h>
29#include <linux/init.h>
30#include <asm/assembler.h>
31#include <asm/pgtable.h>
32#include <asm/procinfo.h>
33#include <asm/hardware.h>
34#include <asm/page.h>
35#include <asm/ptrace.h>
36#include "proc-macros.S"
37
38/*
39 * This is the maximum size of an area which will be invalidated
40 * using the single invalidate entry instructions. Anything larger
41 * than this, and we go for the whole cache.
42 *
43 * This value should be chosen such that we choose the cheapest
44 * alternative.
45 */
46#define CACHE_DLIMIT 16384
47
48/*
49 * the cache line size of the I and D cache
50 */
51#define CACHE_DLINESIZE 32
52
53 .text
54/*
55 * cpu_arm926_proc_init()
56 */
57ENTRY(cpu_arm926_proc_init)
58 mov pc, lr
59
60/*
61 * cpu_arm926_proc_fin()
62 */
63ENTRY(cpu_arm926_proc_fin)
64 stmfd sp!, {lr}
65 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
66 msr cpsr_c, ip
67 bl arm926_flush_kern_cache_all
68 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
69 bic r0, r0, #0x1000 @ ...i............
70 bic r0, r0, #0x000e @ ............wca.
71 mcr p15, 0, r0, c1, c0, 0 @ disable caches
72 ldmfd sp!, {pc}
73
74/*
75 * cpu_arm926_reset(loc)
76 *
77 * Perform a soft reset of the system. Put the CPU into the
78 * same state as it would be if it had been reset, and branch
79 * to what would be the reset vector.
80 *
81 * loc: location to jump to for soft reset
82 */
83 .align 5
84ENTRY(cpu_arm926_reset)
85 mov ip, #0
86 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
87 mcr p15, 0, ip, c7, c10, 4 @ drain WB
88 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
89 mrc p15, 0, ip, c1, c0, 0 @ ctrl register
90 bic ip, ip, #0x000f @ ............wcam
91 bic ip, ip, #0x1100 @ ...i...s........
92 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
93 mov pc, r0
94
95/*
96 * cpu_arm926_do_idle()
97 *
98 * Called with IRQs disabled
99 */
100 .align 10
101ENTRY(cpu_arm926_do_idle)
102 mov r0, #0
103 mrc p15, 0, r1, c1, c0, 0 @ Read control register
104 mcr p15, 0, r0, c7, c10, 4 @ Drain write buffer
105 bic r2, r1, #1 << 12
106 mcr p15, 0, r2, c1, c0, 0 @ Disable I cache
107 mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
108 mcr p15, 0, r1, c1, c0, 0 @ Restore ICache enable
109 mov pc, lr
110
111/*
112 * flush_user_cache_all()
113 *
114 * Clean and invalidate all cache entries in a particular
115 * address space.
116 */
117ENTRY(arm926_flush_user_cache_all)
118 /* FALLTHROUGH */
119
120/*
121 * flush_kern_cache_all()
122 *
123 * Clean and invalidate the entire cache.
124 */
125ENTRY(arm926_flush_kern_cache_all)
126 mov r2, #VM_EXEC
127 mov ip, #0
128__flush_whole_cache:
129#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
130 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
131#else
1321: mrc p15, 0, r15, c7, c14, 3 @ test,clean,invalidate
133 bne 1b
134#endif
135 tst r2, #VM_EXEC
136 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
137 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
138 mov pc, lr
139
140/*
141 * flush_user_cache_range(start, end, flags)
142 *
143 * Clean and invalidate a range of cache entries in the
144 * specified address range.
145 *
146 * - start - start address (inclusive)
147 * - end - end address (exclusive)
148 * - flags - vm_flags describing address space
149 */
150ENTRY(arm926_flush_user_cache_range)
151 mov ip, #0
152 sub r3, r1, r0 @ calculate total size
153 cmp r3, #CACHE_DLIMIT
154 bgt __flush_whole_cache
1551: tst r2, #VM_EXEC
156#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
157 mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
158 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
159 add r0, r0, #CACHE_DLINESIZE
160 mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
161 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
162 add r0, r0, #CACHE_DLINESIZE
163#else
164 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
165 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
166 add r0, r0, #CACHE_DLINESIZE
167 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
168 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
169 add r0, r0, #CACHE_DLINESIZE
170#endif
171 cmp r0, r1
172 blo 1b
173 tst r2, #VM_EXEC
174 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
175 mov pc, lr
176
177/*
178 * coherent_kern_range(start, end)
179 *
180 * Ensure coherency between the Icache and the Dcache in the
181 * region described by start, end. If you have non-snooping
182 * Harvard caches, you need to implement this function.
183 *
184 * - start - virtual start address
185 * - end - virtual end address
186 */
187ENTRY(arm926_coherent_kern_range)
188 /* FALLTHROUGH */
189
190/*
191 * coherent_user_range(start, end)
192 *
193 * Ensure coherency between the Icache and the Dcache in the
194 * region described by start, end. If you have non-snooping
195 * Harvard caches, you need to implement this function.
196 *
197 * - start - virtual start address
198 * - end - virtual end address
199 */
200ENTRY(arm926_coherent_user_range)
201 bic r0, r0, #CACHE_DLINESIZE - 1
2021: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
203 mcr p15, 0, r0, c7, c5, 1 @ invalidate I entry
204 add r0, r0, #CACHE_DLINESIZE
205 cmp r0, r1
206 blo 1b
207 mcr p15, 0, r0, c7, c10, 4 @ drain WB
208 mov pc, lr
209
210/*
211 * flush_kern_dcache_page(void *page)
212 *
213 * Ensure no D cache aliasing occurs, either with itself or
214 * the I cache
215 *
216 * - addr - page aligned address
217 */
218ENTRY(arm926_flush_kern_dcache_page)
219 add r1, r0, #PAGE_SZ
2201: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
221 add r0, r0, #CACHE_DLINESIZE
222 cmp r0, r1
223 blo 1b
224 mov r0, #0
225 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
226 mcr p15, 0, r0, c7, c10, 4 @ drain WB
227 mov pc, lr
228
229/*
230 * dma_inv_range(start, end)
231 *
232 * Invalidate (discard) the specified virtual address range.
233 * May not write back any entries. If 'start' or 'end'
234 * are not cache line aligned, those lines must be written
235 * back.
236 *
237 * - start - virtual start address
238 * - end - virtual end address
239 *
240 * (same as v4wb)
241 */
242ENTRY(arm926_dma_inv_range)
243#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
244 tst r0, #CACHE_DLINESIZE - 1
245 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
246 tst r1, #CACHE_DLINESIZE - 1
247 mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
248#endif
249 bic r0, r0, #CACHE_DLINESIZE - 1
2501: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
251 add r0, r0, #CACHE_DLINESIZE
252 cmp r0, r1
253 blo 1b
254 mcr p15, 0, r0, c7, c10, 4 @ drain WB
255 mov pc, lr
256
257/*
258 * dma_clean_range(start, end)
259 *
260 * Clean the specified virtual address range.
261 *
262 * - start - virtual start address
263 * - end - virtual end address
264 *
265 * (same as v4wb)
266 */
267ENTRY(arm926_dma_clean_range)
268#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
269 bic r0, r0, #CACHE_DLINESIZE - 1
2701: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
271 add r0, r0, #CACHE_DLINESIZE
272 cmp r0, r1
273 blo 1b
274#endif
275 mcr p15, 0, r0, c7, c10, 4 @ drain WB
276 mov pc, lr
277
278/*
279 * dma_flush_range(start, end)
280 *
281 * Clean and invalidate the specified virtual address range.
282 *
283 * - start - virtual start address
284 * - end - virtual end address
285 */
286ENTRY(arm926_dma_flush_range)
287 bic r0, r0, #CACHE_DLINESIZE - 1
2881:
289#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
290 mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
291#else
292 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
293#endif
294 add r0, r0, #CACHE_DLINESIZE
295 cmp r0, r1
296 blo 1b
297 mcr p15, 0, r0, c7, c10, 4 @ drain WB
298 mov pc, lr
299
300ENTRY(arm926_cache_fns)
301 .long arm926_flush_kern_cache_all
302 .long arm926_flush_user_cache_all
303 .long arm926_flush_user_cache_range
304 .long arm926_coherent_kern_range
305 .long arm926_coherent_user_range
306 .long arm926_flush_kern_dcache_page
307 .long arm926_dma_inv_range
308 .long arm926_dma_clean_range
309 .long arm926_dma_flush_range
310
311ENTRY(cpu_arm926_dcache_clean_area)
312#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
3131: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
314 add r0, r0, #CACHE_DLINESIZE
315 subs r1, r1, #CACHE_DLINESIZE
316 bhi 1b
317#endif
318 mcr p15, 0, r0, c7, c10, 4 @ drain WB
319 mov pc, lr
320
321/* =============================== PageTable ============================== */
322
323/*
324 * cpu_arm926_switch_mm(pgd)
325 *
326 * Set the translation base pointer to be as described by pgd.
327 *
328 * pgd: new page tables
329 */
330 .align 5
331ENTRY(cpu_arm926_switch_mm)
332 mov ip, #0
333#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
334 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
335#else
336@ && 'Clean & Invalidate whole DCache'
3371: mrc p15, 0, r15, c7, c14, 3 @ test,clean,invalidate
338 bne 1b
339#endif
340 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
341 mcr p15, 0, ip, c7, c10, 4 @ drain WB
342 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
343 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
344 mov pc, lr
345
346/*
347 * cpu_arm926_set_pte(ptep, pte)
348 *
349 * Set a PTE and flush it out
350 */
351 .align 5
352ENTRY(cpu_arm926_set_pte)
353 str r1, [r0], #-2048 @ linux version
354
355 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
356
357 bic r2, r1, #PTE_SMALL_AP_MASK
358 bic r2, r2, #PTE_TYPE_MASK
359 orr r2, r2, #PTE_TYPE_SMALL
360
361 tst r1, #L_PTE_USER @ User?
362 orrne r2, r2, #PTE_SMALL_AP_URO_SRW
363
364 tst r1, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
365 orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
366
367 tst r1, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young?
368 movne r2, #0
369
370#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
371 eor r3, r2, #0x0a @ C & small page?
372 tst r3, #0x0b
373 biceq r2, r2, #4
374#endif
375 str r2, [r0] @ hardware version
376 mov r0, r0
377#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
378 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
379#endif
380 mcr p15, 0, r0, c7, c10, 4 @ drain WB
381 mov pc, lr
382
383 __INIT
384
385 .type __arm926_setup, #function
386__arm926_setup:
387 mov r0, #0
388 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
389 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
390 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4
391
392
393#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
394 mov r0, #4 @ disable write-back on caches explicitly
395 mcr p15, 7, r0, c15, c0, 0
396#endif
397
398 mrc p15, 0, r0, c1, c0 @ get control register v4
399 ldr r5, arm926_cr1_clear
400 bic r0, r0, r5
401 ldr r5, arm926_cr1_set
402 orr r0, r0, r5
403#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
404 orr r0, r0, #0x4000 @ .1.. .... .... ....
405#endif
406 mov pc, lr
407 .size __arm926_setup, . - __arm926_setup
408
409 /*
410 * R
411 * .RVI ZFRS BLDP WCAM
412 * .011 0001 ..11 0101
413 *
414 */
415 .type arm926_cr1_clear, #object
416 .type arm926_cr1_set, #object
417arm926_cr1_clear:
418 .word 0x7f3f
419arm926_cr1_set:
420 .word 0x3135
421
422 __INITDATA
423
424/*
425 * Purpose : Function pointers used to access above functions - all calls
426 * come through these
427 */
428 .type arm926_processor_functions, #object
429arm926_processor_functions:
430 .word v5tj_early_abort
431 .word cpu_arm926_proc_init
432 .word cpu_arm926_proc_fin
433 .word cpu_arm926_reset
434 .word cpu_arm926_do_idle
435 .word cpu_arm926_dcache_clean_area
436 .word cpu_arm926_switch_mm
437 .word cpu_arm926_set_pte
438 .size arm926_processor_functions, . - arm926_processor_functions
439
440 .section ".rodata"
441
442 .type cpu_arch_name, #object
443cpu_arch_name:
444 .asciz "armv5tej"
445 .size cpu_arch_name, . - cpu_arch_name
446
447 .type cpu_elf_name, #object
448cpu_elf_name:
449 .asciz "v5"
450 .size cpu_elf_name, . - cpu_elf_name
451
452 .type cpu_arm926_name, #object
453cpu_arm926_name:
454 .ascii "ARM926EJ-S"
455#ifndef CONFIG_CPU_ICACHE_DISABLE
456 .ascii "i"
457#endif
458#ifndef CONFIG_CPU_DCACHE_DISABLE
459 .ascii "d"
460#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
461 .ascii "(wt)"
462#else
463 .ascii "(wb)"
464#endif
465#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
466 .ascii "RR"
467#endif
468#endif
469 .ascii "\0"
470 .size cpu_arm926_name, . - cpu_arm926_name
471
472 .align
473
474 .section ".proc.info", #alloc, #execinstr
475
476 .type __arm926_proc_info,#object
477__arm926_proc_info:
478 .long 0x41069260 @ ARM926EJ-S (v5TEJ)
479 .long 0xff0ffff0
480 .long PMD_TYPE_SECT | \
481 PMD_SECT_BUFFERABLE | \
482 PMD_SECT_CACHEABLE | \
483 PMD_BIT4 | \
484 PMD_SECT_AP_WRITE | \
485 PMD_SECT_AP_READ
486 b __arm926_setup
487 .long cpu_arch_name
488 .long cpu_elf_name
489 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_JAVA
490 .long cpu_arm926_name
491 .long arm926_processor_functions
492 .long v4wbi_tlb_fns
493 .long v4wb_user_fns
494 .long arm926_cache_fns
495 .size __arm926_proc_info, . - __arm926_proc_info
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
new file mode 100644
index 000000000000..9137fe563599
--- /dev/null
+++ b/arch/arm/mm/proc-macros.S
@@ -0,0 +1,51 @@
1/*
2 * We need constants.h for:
3 * VMA_VM_MM
4 * VMA_VM_FLAGS
5 * VM_EXEC
6 */
7#include <asm/constants.h>
8#include <asm/thread_info.h>
9
10/*
11 * vma_vm_mm - get mm pointer from vma pointer (vma->vm_mm)
12 */
13 .macro vma_vm_mm, rd, rn
14 ldr \rd, [\rn, #VMA_VM_MM]
15 .endm
16
17/*
18 * vma_vm_flags - get vma->vm_flags
19 */
20 .macro vma_vm_flags, rd, rn
21 ldr \rd, [\rn, #VMA_VM_FLAGS]
22 .endm
23
24 .macro tsk_mm, rd, rn
25 ldr \rd, [\rn, #TI_TASK]
26 ldr \rd, [\rd, #TSK_ACTIVE_MM]
27 .endm
28
29/*
30 * act_mm - get current->active_mm
31 */
32 .macro act_mm, rd
33 bic \rd, sp, #8128
34 bic \rd, \rd, #63
35 ldr \rd, [\rd, #TI_TASK]
36 ldr \rd, [\rd, #TSK_ACTIVE_MM]
37 .endm
38
39/*
40 * mmid - get context id from mm pointer (mm->context.id)
41 */
42 .macro mmid, rd, rn
43 ldr \rd, [\rn, #MM_CONTEXT_ID]
44 .endm
45
46/*
47 * mask_asid - mask the ASID from the context ID
48 */
49 .macro asid, rd, rn
50 and \rd, \rn, #255
51 .endm
diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S
new file mode 100644
index 000000000000..360cae905692
--- /dev/null
+++ b/arch/arm/mm/proc-sa110.S
@@ -0,0 +1,272 @@
1/*
2 * linux/arch/arm/mm/proc-sa110.S
3 *
4 * Copyright (C) 1997-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * MMU functions for SA110
11 *
12 * These are the low level assembler for performing cache and TLB
13 * functions on the StrongARM-110.
14 */
15#include <linux/linkage.h>
16#include <linux/init.h>
17#include <asm/assembler.h>
18#include <asm/constants.h>
19#include <asm/procinfo.h>
20#include <asm/hardware.h>
21#include <asm/pgtable.h>
22#include <asm/ptrace.h>
23
24/*
25 * the cache line size of the I and D cache
26 */
27#define DCACHELINESIZE 32
28#define FLUSH_OFFSET 32768
29
30 .macro flush_110_dcache rd, ra, re
31 ldr \rd, =flush_base
32 ldr \ra, [\rd]
33 eor \ra, \ra, #FLUSH_OFFSET
34 str \ra, [\rd]
35 add \re, \ra, #16384 @ only necessary for 16k
361001: ldr \rd, [\ra], #DCACHELINESIZE
37 teq \re, \ra
38 bne 1001b
39 .endm
40
41 .data
42flush_base:
43 .long FLUSH_BASE
44 .text
45
46/*
47 * cpu_sa110_proc_init()
48 */
49ENTRY(cpu_sa110_proc_init)
50 mov r0, #0
51 mcr p15, 0, r0, c15, c1, 2 @ Enable clock switching
52 mov pc, lr
53
54/*
55 * cpu_sa110_proc_fin()
56 */
57ENTRY(cpu_sa110_proc_fin)
58 stmfd sp!, {lr}
59 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
60 msr cpsr_c, ip
61 bl v4wb_flush_kern_cache_all @ clean caches
621: mov r0, #0
63 mcr p15, 0, r0, c15, c2, 2 @ Disable clock switching
64 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
65 bic r0, r0, #0x1000 @ ...i............
66 bic r0, r0, #0x000e @ ............wca.
67 mcr p15, 0, r0, c1, c0, 0 @ disable caches
68 ldmfd sp!, {pc}
69
70/*
71 * cpu_sa110_reset(loc)
72 *
73 * Perform a soft reset of the system. Put the CPU into the
74 * same state as it would be if it had been reset, and branch
75 * to what would be the reset vector.
76 *
77 * loc: location to jump to for soft reset
78 */
79 .align 5
80ENTRY(cpu_sa110_reset)
81 mov ip, #0
82 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
83 mcr p15, 0, ip, c7, c10, 4 @ drain WB
84 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
85 mrc p15, 0, ip, c1, c0, 0 @ ctrl register
86 bic ip, ip, #0x000f @ ............wcam
87 bic ip, ip, #0x1100 @ ...i...s........
88 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
89 mov pc, r0
90
91/*
92 * cpu_sa110_do_idle(type)
93 *
94 * Cause the processor to idle
95 *
96 * type: call type:
97 * 0 = slow idle
98 * 1 = fast idle
99 * 2 = switch to slow processor clock
100 * 3 = switch to fast processor clock
101 */
102 .align 5
103
104ENTRY(cpu_sa110_do_idle)
105 mcr p15, 0, ip, c15, c2, 2 @ disable clock switching
106 ldr r1, =UNCACHEABLE_ADDR @ load from uncacheable loc
107 ldr r1, [r1, #0] @ force switch to MCLK
108 mov r0, r0 @ safety
109 mov r0, r0 @ safety
110 mov r0, r0 @ safety
111 mcr p15, 0, r0, c15, c8, 2 @ Wait for interrupt, cache aligned
112 mov r0, r0 @ safety
113 mov r0, r0 @ safety
114 mov r0, r0 @ safety
115 mcr p15, 0, r0, c15, c1, 2 @ enable clock switching
116 mov pc, lr
117
118/* ================================= CACHE ================================ */
119
120/*
121 * cpu_sa110_dcache_clean_area(addr,sz)
122 *
123 * Clean the specified entry of any caches such that the MMU
124 * translation fetches will obtain correct data.
125 *
126 * addr: cache-unaligned virtual address
127 */
128 .align 5
129ENTRY(cpu_sa110_dcache_clean_area)
1301: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
131 add r0, r0, #DCACHELINESIZE
132 subs r1, r1, #DCACHELINESIZE
133 bhi 1b
134 mov pc, lr
135
136/* =============================== PageTable ============================== */
137
138/*
139 * cpu_sa110_switch_mm(pgd)
140 *
141 * Set the translation base pointer to be as described by pgd.
142 *
143 * pgd: new page tables
144 */
145 .align 5
146ENTRY(cpu_sa110_switch_mm)
147 flush_110_dcache r3, ip, r1
148 mov r1, #0
149 mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache
150 mcr p15, 0, r1, c7, c10, 4 @ drain WB
151 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
152 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
153 mov pc, lr
154
155/*
156 * cpu_sa110_set_pte(ptep, pte)
157 *
158 * Set a PTE and flush it out
159 */
160 .align 5
161ENTRY(cpu_sa110_set_pte)
162 str r1, [r0], #-2048 @ linux version
163
164 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
165
166 bic r2, r1, #PTE_SMALL_AP_MASK
167 bic r2, r2, #PTE_TYPE_MASK
168 orr r2, r2, #PTE_TYPE_SMALL
169
170 tst r1, #L_PTE_USER @ User?
171 orrne r2, r2, #PTE_SMALL_AP_URO_SRW
172
173 tst r1, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
174 orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
175
176 tst r1, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young?
177 movne r2, #0
178
179 str r2, [r0] @ hardware version
180 mov r0, r0
181 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
182 mcr p15, 0, r0, c7, c10, 4 @ drain WB
183 mov pc, lr
184
185 __INIT
186
187 .type __sa110_setup, #function
188__sa110_setup:
189 mov r10, #0
190 mcr p15, 0, r10, c7, c7 @ invalidate I,D caches on v4
191 mcr p15, 0, r10, c7, c10, 4 @ drain write buffer on v4
192 mcr p15, 0, r10, c8, c7 @ invalidate I,D TLBs on v4
193 mrc p15, 0, r0, c1, c0 @ get control register v4
194 ldr r5, sa110_cr1_clear
195 bic r0, r0, r5
196 ldr r5, sa110_cr1_set
197 orr r0, r0, r5
198 mov pc, lr
199 .size __sa110_setup, . - __sa110_setup
200
201 /*
202 * R
203 * .RVI ZFRS BLDP WCAM
204 * ..01 0001 ..11 1101
205 *
206 */
207 .type sa110_cr1_clear, #object
208 .type sa110_cr1_set, #object
209sa110_cr1_clear:
210 .word 0x3f3f
211sa110_cr1_set:
212 .word 0x113d
213
214 __INITDATA
215
216/*
217 * Purpose : Function pointers used to access above functions - all calls
218 * come through these
219 */
220
221 .type sa110_processor_functions, #object
222ENTRY(sa110_processor_functions)
223 .word v4_early_abort
224 .word cpu_sa110_proc_init
225 .word cpu_sa110_proc_fin
226 .word cpu_sa110_reset
227 .word cpu_sa110_do_idle
228 .word cpu_sa110_dcache_clean_area
229 .word cpu_sa110_switch_mm
230 .word cpu_sa110_set_pte
231 .size sa110_processor_functions, . - sa110_processor_functions
232
233 .section ".rodata"
234
235 .type cpu_arch_name, #object
236cpu_arch_name:
237 .asciz "armv4"
238 .size cpu_arch_name, . - cpu_arch_name
239
240 .type cpu_elf_name, #object
241cpu_elf_name:
242 .asciz "v4"
243 .size cpu_elf_name, . - cpu_elf_name
244
245 .type cpu_sa110_name, #object
246cpu_sa110_name:
247 .asciz "StrongARM-110"
248 .size cpu_sa110_name, . - cpu_sa110_name
249
250 .align
251
252 .section ".proc.info", #alloc, #execinstr
253
254 .type __sa110_proc_info,#object
255__sa110_proc_info:
256 .long 0x4401a100
257 .long 0xfffffff0
258 .long PMD_TYPE_SECT | \
259 PMD_SECT_BUFFERABLE | \
260 PMD_SECT_CACHEABLE | \
261 PMD_SECT_AP_WRITE | \
262 PMD_SECT_AP_READ
263 b __sa110_setup
264 .long cpu_arch_name
265 .long cpu_elf_name
266 .long HWCAP_SWP | HWCAP_HALF | HWCAP_26BIT | HWCAP_FAST_MULT
267 .long cpu_sa110_name
268 .long sa110_processor_functions
269 .long v4wb_tlb_fns
270 .long v4wb_user_fns
271 .long v4wb_cache_fns
272 .size __sa110_proc_info, . - __sa110_proc_info
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S
new file mode 100644
index 000000000000..d447cd5f3dd9
--- /dev/null
+++ b/arch/arm/mm/proc-sa1100.S
@@ -0,0 +1,323 @@
1/*
2 * linux/arch/arm/mm/proc-sa1100.S
3 *
4 * Copyright (C) 1997-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * MMU functions for SA110
11 *
12 * These are the low level assembler for performing cache and TLB
13 * functions on the StrongARM-1100 and StrongARM-1110.
14 *
15 * Note that SA1100 and SA1110 share everything but their name and CPU ID.
16 *
17 * 12-jun-2000, Erik Mouw (J.A.K.Mouw@its.tudelft.nl):
18 * Flush the read buffer at context switches
19 */
20#include <linux/linkage.h>
21#include <linux/init.h>
22#include <asm/assembler.h>
23#include <asm/constants.h>
24#include <asm/procinfo.h>
25#include <asm/hardware.h>
26#include <asm/pgtable.h>
27
28/*
29 * the cache line size of the I and D cache
30 */
31#define DCACHELINESIZE 32
32#define FLUSH_OFFSET 32768
33
34 .macro flush_1100_dcache rd, ra, re
35 ldr \rd, =flush_base
36 ldr \ra, [\rd]
37 eor \ra, \ra, #FLUSH_OFFSET
38 str \ra, [\rd]
39 add \re, \ra, #8192 @ only necessary for 8k
401001: ldr \rd, [\ra], #DCACHELINESIZE
41 teq \re, \ra
42 bne 1001b
43#ifdef FLUSH_BASE_MINICACHE
44 add \ra, \ra, #FLUSH_BASE_MINICACHE - FLUSH_BASE
45 add \re, \ra, #512 @ only 512 bytes
461002: ldr \rd, [\ra], #DCACHELINESIZE
47 teq \re, \ra
48 bne 1002b
49#endif
50 .endm
51
52 .data
53flush_base:
54 .long FLUSH_BASE
55 .text
56
57 __INIT
58
59/*
60 * cpu_sa1100_proc_init()
61 */
62ENTRY(cpu_sa1100_proc_init)
63 mov r0, #0
64 mcr p15, 0, r0, c15, c1, 2 @ Enable clock switching
65 mcr p15, 0, r0, c9, c0, 5 @ Allow read-buffer operations from userland
66 mov pc, lr
67
68 .previous
69
70/*
71 * cpu_sa1100_proc_fin()
72 *
73 * Prepare the CPU for reset:
74 * - Disable interrupts
75 * - Clean and turn off caches.
76 */
77ENTRY(cpu_sa1100_proc_fin)
78 stmfd sp!, {lr}
79 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
80 msr cpsr_c, ip
81 flush_1100_dcache r0, r1, r2 @ clean caches
82 mov r0, #0
83 mcr p15, 0, r0, c15, c2, 2 @ Disable clock switching
84 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
85 bic r0, r0, #0x1000 @ ...i............
86 bic r0, r0, #0x000e @ ............wca.
87 mcr p15, 0, r0, c1, c0, 0 @ disable caches
88 ldmfd sp!, {pc}
89
90/*
91 * cpu_sa1100_reset(loc)
92 *
93 * Perform a soft reset of the system. Put the CPU into the
94 * same state as it would be if it had been reset, and branch
95 * to what would be the reset vector.
96 *
97 * loc: location to jump to for soft reset
98 */
99 .align 5
100ENTRY(cpu_sa1100_reset)
101 mov ip, #0
102 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
103 mcr p15, 0, ip, c7, c10, 4 @ drain WB
104 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
105 mrc p15, 0, ip, c1, c0, 0 @ ctrl register
106 bic ip, ip, #0x000f @ ............wcam
107 bic ip, ip, #0x1100 @ ...i...s........
108 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
109 mov pc, r0
110
111/*
112 * cpu_sa1100_do_idle(type)
113 *
114 * Cause the processor to idle
115 *
116 * type: call type:
117 * 0 = slow idle
118 * 1 = fast idle
119 * 2 = switch to slow processor clock
120 * 3 = switch to fast processor clock
121 */
122 .align 5
123ENTRY(cpu_sa1100_do_idle)
124 mov r0, r0 @ 4 nop padding
125 mov r0, r0
126 mov r0, r0
127 mov r0, r0 @ 4 nop padding
128 mov r0, r0
129 mov r0, r0
130 mov r0, #0
131 ldr r1, =UNCACHEABLE_ADDR @ ptr to uncacheable address
132 @ --- aligned to a cache line
133 mcr p15, 0, r0, c15, c2, 2 @ disable clock switching
134 ldr r1, [r1, #0] @ force switch to MCLK
135 mcr p15, 0, r0, c15, c8, 2 @ wait for interrupt
136 mov r0, r0 @ safety
137 mcr p15, 0, r0, c15, c1, 2 @ enable clock switching
138 mov pc, lr
139
140/* ================================= CACHE ================================ */
141
142/*
143 * cpu_sa1100_dcache_clean_area(addr,sz)
144 *
145 * Clean the specified entry of any caches such that the MMU
146 * translation fetches will obtain correct data.
147 *
148 * addr: cache-unaligned virtual address
149 */
150 .align 5
151ENTRY(cpu_sa1100_dcache_clean_area)
1521: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
153 add r0, r0, #DCACHELINESIZE
154 subs r1, r1, #DCACHELINESIZE
155 bhi 1b
156 mov pc, lr
157
158/* =============================== PageTable ============================== */
159
160/*
161 * cpu_sa1100_switch_mm(pgd)
162 *
163 * Set the translation base pointer to be as described by pgd.
164 *
165 * pgd: new page tables
166 */
167 .align 5
168ENTRY(cpu_sa1100_switch_mm)
169 flush_1100_dcache r3, ip, r1
170 mov ip, #0
171 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
172 mcr p15, 0, ip, c9, c0, 0 @ invalidate RB
173 mcr p15, 0, ip, c7, c10, 4 @ drain WB
174 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
175 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
176 mov pc, lr
177
178/*
179 * cpu_sa1100_set_pte(ptep, pte)
180 *
181 * Set a PTE and flush it out
182 */
183 .align 5
184ENTRY(cpu_sa1100_set_pte)
185 str r1, [r0], #-2048 @ linux version
186
187 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
188
189 bic r2, r1, #PTE_SMALL_AP_MASK
190 bic r2, r2, #PTE_TYPE_MASK
191 orr r2, r2, #PTE_TYPE_SMALL
192
193 tst r1, #L_PTE_USER @ User?
194 orrne r2, r2, #PTE_SMALL_AP_URO_SRW
195
196 tst r1, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
197 orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
198
199 tst r1, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young?
200 movne r2, #0
201
202 str r2, [r0] @ hardware version
203 mov r0, r0
204 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
205 mcr p15, 0, r0, c7, c10, 4 @ drain WB
206 mov pc, lr
207
208 __INIT
209
210 .type __sa1100_setup, #function
211__sa1100_setup:
212 mov r0, #0
213 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
214 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
215 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4
216 mrc p15, 0, r0, c1, c0 @ get control register v4
217 ldr r5, sa1100_cr1_clear
218 bic r0, r0, r5
219 ldr r5, sa1100_cr1_set
220 orr r0, r0, r5
221 mov pc, lr
222 .size __sa1100_setup, . - __sa1100_setup
223
224 /*
225 * R
226 * .RVI ZFRS BLDP WCAM
227 * ..11 0001 ..11 1101
228 *
229 */
230 .type sa1100_cr1_clear, #object
231 .type sa1100_cr1_set, #object
232sa1100_cr1_clear:
233 .word 0x3f3f
234sa1100_cr1_set:
235 .word 0x313d
236
237 __INITDATA
238
239/*
240 * Purpose : Function pointers used to access above functions - all calls
241 * come through these
242 */
243
244/*
245 * SA1100 and SA1110 share the same function calls
246 */
247 .type sa1100_processor_functions, #object
248ENTRY(sa1100_processor_functions)
249 .word v4_early_abort
250 .word cpu_sa1100_proc_init
251 .word cpu_sa1100_proc_fin
252 .word cpu_sa1100_reset
253 .word cpu_sa1100_do_idle
254 .word cpu_sa1100_dcache_clean_area
255 .word cpu_sa1100_switch_mm
256 .word cpu_sa1100_set_pte
257 .size sa1100_processor_functions, . - sa1100_processor_functions
258
259 .section ".rodata"
260
261 .type cpu_arch_name, #object
262cpu_arch_name:
263 .asciz "armv4"
264 .size cpu_arch_name, . - cpu_arch_name
265
266 .type cpu_elf_name, #object
267cpu_elf_name:
268 .asciz "v4"
269 .size cpu_elf_name, . - cpu_elf_name
270
271 .type cpu_sa1100_name, #object
272cpu_sa1100_name:
273 .asciz "StrongARM-1100"
274 .size cpu_sa1100_name, . - cpu_sa1100_name
275
276 .type cpu_sa1110_name, #object
277cpu_sa1110_name:
278 .asciz "StrongARM-1110"
279 .size cpu_sa1110_name, . - cpu_sa1110_name
280
281 .align
282
283 .section ".proc.info", #alloc, #execinstr
284
285 .type __sa1100_proc_info,#object
286__sa1100_proc_info:
287 .long 0x4401a110
288 .long 0xfffffff0
289 .long PMD_TYPE_SECT | \
290 PMD_SECT_BUFFERABLE | \
291 PMD_SECT_CACHEABLE | \
292 PMD_SECT_AP_WRITE | \
293 PMD_SECT_AP_READ
294 b __sa1100_setup
295 .long cpu_arch_name
296 .long cpu_elf_name
297 .long HWCAP_SWP | HWCAP_HALF | HWCAP_26BIT | HWCAP_FAST_MULT
298 .long cpu_sa1100_name
299 .long sa1100_processor_functions
300 .long v4wb_tlb_fns
301 .long v4_mc_user_fns
302 .long v4wb_cache_fns
303 .size __sa1100_proc_info, . - __sa1100_proc_info
304
305 .type __sa1110_proc_info,#object
306__sa1110_proc_info:
307 .long 0x6901b110
308 .long 0xfffffff0
309 .long PMD_TYPE_SECT | \
310 PMD_SECT_BUFFERABLE | \
311 PMD_SECT_CACHEABLE | \
312 PMD_SECT_AP_WRITE | \
313 PMD_SECT_AP_READ
314 b __sa1100_setup
315 .long cpu_arch_name
316 .long cpu_elf_name
317 .long HWCAP_SWP | HWCAP_HALF | HWCAP_26BIT | HWCAP_FAST_MULT
318 .long cpu_sa1110_name
319 .long sa1100_processor_functions
320 .long v4wb_tlb_fns
321 .long v4_mc_user_fns
322 .long v4wb_cache_fns
323 .size __sa1110_proc_info, . - __sa1110_proc_info
diff --git a/arch/arm/mm/proc-syms.c b/arch/arm/mm/proc-syms.c
new file mode 100644
index 000000000000..6c5f0fe578a5
--- /dev/null
+++ b/arch/arm/mm/proc-syms.c
@@ -0,0 +1,40 @@
1/*
2 * linux/arch/arm/mm/proc-syms.c
3 *
4 * Copyright (C) 2000-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/module.h>
11#include <linux/mm.h>
12
13#include <asm/cacheflush.h>
14#include <asm/proc-fns.h>
15#include <asm/tlbflush.h>
16
17#ifndef MULTI_CPU
18EXPORT_SYMBOL(cpu_dcache_clean_area);
19EXPORT_SYMBOL(cpu_set_pte);
20#else
21EXPORT_SYMBOL(processor);
22#endif
23
24#ifndef MULTI_CACHE
25EXPORT_SYMBOL(__cpuc_flush_kern_all);
26EXPORT_SYMBOL(__cpuc_flush_user_all);
27EXPORT_SYMBOL(__cpuc_flush_user_range);
28EXPORT_SYMBOL(__cpuc_coherent_kern_range);
29#else
30EXPORT_SYMBOL(cpu_cache);
31#endif
32
33/*
34 * No module should need to touch the TLB (and currently
35 * no modules do. We export this for "loadkernel" support
36 * (booting a new kernel from within a running kernel.)
37 */
38#ifdef MULTI_TLB
39EXPORT_SYMBOL(cpu_tlb);
40#endif
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
new file mode 100644
index 000000000000..0aa73d414783
--- /dev/null
+++ b/arch/arm/mm/proc-v6.S
@@ -0,0 +1,272 @@
1/*
2 * linux/arch/arm/mm/proc-v6.S
3 *
4 * Copyright (C) 2001 Deep Blue Solutions Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This is the "shell" of the ARMv6 processor support.
11 */
12#include <linux/linkage.h>
13#include <asm/assembler.h>
14#include <asm/constants.h>
15#include <asm/procinfo.h>
16#include <asm/pgtable.h>
17
18#include "proc-macros.S"
19
20#define D_CACHE_LINE_SIZE 32
21
22 .macro cpsie, flags
23 .ifc \flags, f
24 .long 0xf1080040
25 .exitm
26 .endif
27 .ifc \flags, i
28 .long 0xf1080080
29 .exitm
30 .endif
31 .ifc \flags, if
32 .long 0xf10800c0
33 .exitm
34 .endif
35 .err
36 .endm
37
38 .macro cpsid, flags
39 .ifc \flags, f
40 .long 0xf10c0040
41 .exitm
42 .endif
43 .ifc \flags, i
44 .long 0xf10c0080
45 .exitm
46 .endif
47 .ifc \flags, if
48 .long 0xf10c00c0
49 .exitm
50 .endif
51 .err
52 .endm
53
54ENTRY(cpu_v6_proc_init)
55 mov pc, lr
56
57ENTRY(cpu_v6_proc_fin)
58 mov pc, lr
59
60/*
61 * cpu_v6_reset(loc)
62 *
63 * Perform a soft reset of the system. Put the CPU into the
64 * same state as it would be if it had been reset, and branch
65 * to what would be the reset vector.
66 *
67 * - loc - location to jump to for soft reset
68 *
69 * It is assumed that:
70 */
71 .align 5
72ENTRY(cpu_v6_reset)
73 mov pc, r0
74
75/*
76 * cpu_v6_do_idle()
77 *
78 * Idle the processor (eg, wait for interrupt).
79 *
80 * IRQs are already disabled.
81 */
82ENTRY(cpu_v6_do_idle)
83 mcr p15, 0, r1, c7, c0, 4 @ wait for interrupt
84 mov pc, lr
85
86ENTRY(cpu_v6_dcache_clean_area)
87#ifndef TLB_CAN_READ_FROM_L1_CACHE
881: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
89 add r0, r0, #D_CACHE_LINE_SIZE
90 subs r1, r1, #D_CACHE_LINE_SIZE
91 bhi 1b
92#endif
93 mov pc, lr
94
95/*
96 * cpu_arm926_switch_mm(pgd_phys, tsk)
97 *
98 * Set the translation table base pointer to be pgd_phys
99 *
100 * - pgd_phys - physical address of new TTB
101 *
102 * It is assumed that:
103 * - we are not using split page tables
104 */
105ENTRY(cpu_v6_switch_mm)
106 mov r2, #0
107 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id
108 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
109 mcr p15, 0, r2, c7, c10, 4 @ drain write buffer
110 mcr p15, 0, r0, c2, c0, 0 @ set TTB 0
111 mcr p15, 0, r1, c13, c0, 1 @ set context ID
112 mov pc, lr
113
114#define nG (1 << 11)
115#define APX (1 << 9)
116#define AP1 (1 << 5)
117#define AP0 (1 << 4)
118#define XN (1 << 0)
119
120/*
121 * cpu_v6_set_pte(ptep, pte)
122 *
123 * Set a level 2 translation table entry.
124 *
125 * - ptep - pointer to level 2 translation table entry
126 * (hardware version is stored at -1024 bytes)
127 * - pte - PTE value to store
128 *
129 * Permissions:
130 * YUWD APX AP1 AP0 SVC User
131 * 0xxx 0 0 0 no acc no acc
132 * 100x 1 0 1 r/o no acc
133 * 10x0 1 0 1 r/o no acc
134 * 1011 0 0 1 r/w no acc
135 * 110x 1 1 0 r/o r/o
136 * 11x0 1 1 0 r/o r/o
137 * 1111 0 1 1 r/w r/w
138 */
139ENTRY(cpu_v6_set_pte)
140 str r1, [r0], #-2048 @ linux version
141
142 bic r2, r1, #0x00000ff0
143 bic r2, r2, #0x00000003
144 orr r2, r2, #AP0 | 2
145
146 tst r1, #L_PTE_WRITE
147 tstne r1, #L_PTE_DIRTY
148 orreq r2, r2, #APX
149
150 tst r1, #L_PTE_USER
151 orrne r2, r2, #AP1 | nG
152 tstne r2, #APX
153 eorne r2, r2, #AP0
154
155 tst r1, #L_PTE_YOUNG
156 biceq r2, r2, #APX | AP1 | AP0
157
158@ tst r1, #L_PTE_EXEC
159@ orreq r2, r2, #XN
160
161 tst r1, #L_PTE_PRESENT
162 moveq r2, #0
163
164 str r2, [r0]
165 mcr p15, 0, r0, c7, c10, 1 @ flush_pte
166 mov pc, lr
167
168
169
170
171cpu_v6_name:
172 .asciz "Some Random V6 Processor"
173 .align
174
175 .section ".text.init", #alloc, #execinstr
176
177/*
178 * __v6_setup
179 *
180 * Initialise TLB, Caches, and MMU state ready to switch the MMU
181 * on. Return in r0 the new CP15 C1 control register setting.
182 *
183 * We automatically detect if we have a Harvard cache, and use the
184 * Harvard cache control instructions insead of the unified cache
185 * control instructions.
186 *
187 * This should be able to cover all ARMv6 cores.
188 *
189 * It is assumed that:
190 * - cache type register is implemented
191 */
192__v6_setup:
193 mov r0, #0
194 mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache
195 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
196 mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache
197 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
198 mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs
199 mcr p15, 0, r0, c2, c0, 2 @ TTB control register
200 mcr p15, 0, r4, c2, c0, 1 @ load TTB1
201#ifdef CONFIG_VFP
202 mrc p15, 0, r0, c1, c0, 2
203 orr r0, r0, #(3 << 20)
204 mcr p15, 0, r0, c1, c0, 2 @ Enable full access to VFP
205#endif
206 mrc p15, 0, r0, c1, c0, 0 @ read control register
207 ldr r5, v6_cr1_clear @ get mask for bits to clear
208 bic r0, r0, r5 @ clear bits them
209 ldr r5, v6_cr1_set @ get mask for bits to set
210 orr r0, r0, r5 @ set them
211 mov pc, lr @ return to head.S:__ret
212
213 /*
214 * V X F I D LR
215 * .... ...E PUI. .T.T 4RVI ZFRS BLDP WCAM
216 * rrrr rrrx xxx0 0101 xxxx xxxx x111 xxxx < forced
217 * 0 110 0011 1.00 .111 1101 < we want
218 */
219 .type v6_cr1_clear, #object
220 .type v6_cr1_set, #object
221v6_cr1_clear:
222 .word 0x01e0fb7f
223v6_cr1_set:
224 .word 0x00c0387d
225
226 .type v6_processor_functions, #object
227ENTRY(v6_processor_functions)
228 .word v6_early_abort
229 .word cpu_v6_proc_init
230 .word cpu_v6_proc_fin
231 .word cpu_v6_reset
232 .word cpu_v6_do_idle
233 .word cpu_v6_dcache_clean_area
234 .word cpu_v6_switch_mm
235 .word cpu_v6_set_pte
236 .size v6_processor_functions, . - v6_processor_functions
237
238 .type cpu_arch_name, #object
239cpu_arch_name:
240 .asciz "armv6"
241 .size cpu_arch_name, . - cpu_arch_name
242
243 .type cpu_elf_name, #object
244cpu_elf_name:
245 .asciz "v6"
246 .size cpu_elf_name, . - cpu_elf_name
247 .align
248
249 .section ".proc.info", #alloc, #execinstr
250
251 /*
252 * Match any ARMv6 processor core.
253 */
254 .type __v6_proc_info, #object
255__v6_proc_info:
256 .long 0x0007b000
257 .long 0x0007f000
258 .long PMD_TYPE_SECT | \
259 PMD_SECT_BUFFERABLE | \
260 PMD_SECT_CACHEABLE | \
261 PMD_SECT_AP_WRITE | \
262 PMD_SECT_AP_READ
263 b __v6_setup
264 .long cpu_arch_name
265 .long cpu_elf_name
266 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_VFP|HWCAP_EDSP|HWCAP_JAVA
267 .long cpu_v6_name
268 .long v6_processor_functions
269 .long v6wbi_tlb_fns
270 .long v6_user_fns
271 .long v6_cache_fns
272 .size __v6_proc_info, . - __v6_proc_info
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
new file mode 100644
index 000000000000..2d977b4eeeab
--- /dev/null
+++ b/arch/arm/mm/proc-xscale.S
@@ -0,0 +1,934 @@
1/*
2 * linux/arch/arm/mm/proc-xscale.S
3 *
4 * Author: Nicolas Pitre
5 * Created: November 2000
6 * Copyright: (C) 2000, 2001 MontaVista Software Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * MMU functions for the Intel XScale CPUs
13 *
14 * 2001 Aug 21:
15 * some contributions by Brett Gaines <brett.w.gaines@intel.com>
16 * Copyright 2001 by Intel Corp.
17 *
18 * 2001 Sep 08:
19 * Completely revisited, many important fixes
20 * Nicolas Pitre <nico@cam.org>
21 */
22
23#include <linux/linkage.h>
24#include <linux/init.h>
25#include <asm/assembler.h>
26#include <asm/procinfo.h>
27#include <asm/hardware.h>
28#include <asm/pgtable.h>
29#include <asm/page.h>
30#include <asm/ptrace.h>
31#include "proc-macros.S"
32
33/*
34 * This is the maximum size of an area which will be flushed. If the area
35 * is larger than this, then we flush the whole cache
36 */
37#define MAX_AREA_SIZE 32768
38
39/*
40 * the cache line size of the I and D cache
41 */
42#define CACHELINESIZE 32
43
44/*
45 * the size of the data cache
46 */
47#define CACHESIZE 32768
48
49/*
50 * Virtual address used to allocate the cache when flushed
51 *
52 * This must be an address range which is _never_ used. It should
53 * apparently have a mapping in the corresponding page table for
54 * compatibility with future CPUs that _could_ require it. For instance we
55 * don't care.
56 *
57 * This must be aligned on a 2*CACHESIZE boundary. The code selects one of
58 * the 2 areas in alternance each time the clean_d_cache macro is used.
59 * Without this the XScale core exhibits cache eviction problems and no one
60 * knows why.
61 *
62 * Reminder: the vector table is located at 0xffff0000-0xffff0fff.
63 */
64#define CLEAN_ADDR 0xfffe0000
65
66/*
67 * This macro is used to wait for a CP15 write and is needed
68 * when we have to ensure that the last operation to the co-pro
69 * was completed before continuing with operation.
70 */
71 .macro cpwait, rd
72 mrc p15, 0, \rd, c2, c0, 0 @ arbitrary read of cp15
73 mov \rd, \rd @ wait for completion
74 sub pc, pc, #4 @ flush instruction pipeline
75 .endm
76
77 .macro cpwait_ret, lr, rd
78 mrc p15, 0, \rd, c2, c0, 0 @ arbitrary read of cp15
79 sub pc, \lr, \rd, LSR #32 @ wait for completion and
80 @ flush instruction pipeline
81 .endm
82
83/*
84 * This macro cleans the entire dcache using line allocate.
85 * The main loop has been unrolled to reduce loop overhead.
86 * rd and rs are two scratch registers.
87 */
88 .macro clean_d_cache, rd, rs
89 ldr \rs, =clean_addr
90 ldr \rd, [\rs]
91 eor \rd, \rd, #CACHESIZE
92 str \rd, [\rs]
93 add \rs, \rd, #CACHESIZE
941: mcr p15, 0, \rd, c7, c2, 5 @ allocate D cache line
95 add \rd, \rd, #CACHELINESIZE
96 mcr p15, 0, \rd, c7, c2, 5 @ allocate D cache line
97 add \rd, \rd, #CACHELINESIZE
98 mcr p15, 0, \rd, c7, c2, 5 @ allocate D cache line
99 add \rd, \rd, #CACHELINESIZE
100 mcr p15, 0, \rd, c7, c2, 5 @ allocate D cache line
101 add \rd, \rd, #CACHELINESIZE
102 teq \rd, \rs
103 bne 1b
104 .endm
105
106 .data
107clean_addr: .word CLEAN_ADDR
108
109 .text
110
111/*
112 * cpu_xscale_proc_init()
113 *
114 * Nothing too exciting at the moment
115 */
116ENTRY(cpu_xscale_proc_init)
117 mov pc, lr
118
119/*
120 * cpu_xscale_proc_fin()
121 */
122ENTRY(cpu_xscale_proc_fin)
123 str lr, [sp, #-4]!
124 mov r0, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
125 msr cpsr_c, r0
126 bl xscale_flush_kern_cache_all @ clean caches
127 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
128 bic r0, r0, #0x1800 @ ...IZ...........
129 bic r0, r0, #0x0006 @ .............CA.
130 mcr p15, 0, r0, c1, c0, 0 @ disable caches
131 ldr pc, [sp], #4
132
133/*
134 * cpu_xscale_reset(loc)
135 *
136 * Perform a soft reset of the system. Put the CPU into the
137 * same state as it would be if it had been reset, and branch
138 * to what would be the reset vector.
139 *
140 * loc: location to jump to for soft reset
141 */
142 .align 5
143ENTRY(cpu_xscale_reset)
144 mov r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
145 msr cpsr_c, r1 @ reset CPSR
146 mrc p15, 0, r1, c1, c0, 0 @ ctrl register
147 bic r1, r1, #0x0086 @ ........B....CA.
148 bic r1, r1, #0x3900 @ ..VIZ..S........
149 mcr p15, 0, r1, c1, c0, 0 @ ctrl register
150 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches & BTB
151 bic r1, r1, #0x0001 @ ...............M
152 mcr p15, 0, r1, c1, c0, 0 @ ctrl register
153 @ CAUTION: MMU turned off from this point. We count on the pipeline
154 @ already containing those two last instructions to survive.
155 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
156 mov pc, r0
157
158/*
159 * cpu_xscale_do_idle()
160 *
161 * Cause the processor to idle
162 *
163 * For now we do nothing but go to idle mode for every case
164 *
165 * XScale supports clock switching, but using idle mode support
166 * allows external hardware to react to system state changes.
167 */
168 .align 5
169
170ENTRY(cpu_xscale_do_idle)
171 mov r0, #1
172 mcr p14, 0, r0, c7, c0, 0 @ Go to IDLE
173 mov pc, lr
174
175/* ================================= CACHE ================================ */
176
177/*
178 * flush_user_cache_all()
179 *
180 * Invalidate all cache entries in a particular address
181 * space.
182 */
183ENTRY(xscale_flush_user_cache_all)
184 /* FALLTHROUGH */
185
186/*
187 * flush_kern_cache_all()
188 *
189 * Clean and invalidate the entire cache.
190 */
191ENTRY(xscale_flush_kern_cache_all)
192 mov r2, #VM_EXEC
193 mov ip, #0
194__flush_whole_cache:
195 clean_d_cache r0, r1
196 tst r2, #VM_EXEC
197 mcrne p15, 0, ip, c7, c5, 0 @ Invalidate I cache & BTB
198 mcrne p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
199 mov pc, lr
200
201/*
202 * flush_user_cache_range(start, end, vm_flags)
203 *
204 * Invalidate a range of cache entries in the specified
205 * address space.
206 *
207 * - start - start address (may not be aligned)
208 * - end - end address (exclusive, may not be aligned)
209 * - vma - vma_area_struct describing address space
210 */
211 .align 5
212ENTRY(xscale_flush_user_cache_range)
213 mov ip, #0
214 sub r3, r1, r0 @ calculate total size
215 cmp r3, #MAX_AREA_SIZE
216 bhs __flush_whole_cache
217
2181: tst r2, #VM_EXEC
219 mcrne p15, 0, r0, c7, c5, 1 @ Invalidate I cache line
220 mcr p15, 0, r0, c7, c10, 1 @ Clean D cache line
221 mcr p15, 0, r0, c7, c6, 1 @ Invalidate D cache line
222 add r0, r0, #CACHELINESIZE
223 cmp r0, r1
224 blo 1b
225 tst r2, #VM_EXEC
226 mcrne p15, 0, ip, c7, c5, 6 @ Invalidate BTB
227 mcrne p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
228 mov pc, lr
229
230/*
231 * coherent_kern_range(start, end)
232 *
233 * Ensure coherency between the Icache and the Dcache in the
234 * region described by start. If you have non-snooping
235 * Harvard caches, you need to implement this function.
236 *
237 * - start - virtual start address
238 * - end - virtual end address
239 *
240 * Note: single I-cache line invalidation isn't used here since
241 * it also trashes the mini I-cache used by JTAG debuggers.
242 */
243ENTRY(xscale_coherent_kern_range)
244 /* FALLTHROUGH */
245
246/*
247 * coherent_user_range(start, end)
248 *
249 * Ensure coherency between the Icache and the Dcache in the
250 * region described by start. If you have non-snooping
251 * Harvard caches, you need to implement this function.
252 *
253 * - start - virtual start address
254 * - end - virtual end address
255 *
256 * Note: single I-cache line invalidation isn't used here since
257 * it also trashes the mini I-cache used by JTAG debuggers.
258 */
259ENTRY(xscale_coherent_user_range)
260 bic r0, r0, #CACHELINESIZE - 1
2611: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
262 add r0, r0, #CACHELINESIZE
263 cmp r0, r1
264 blo 1b
265 mov r0, #0
266 mcr p15, 0, r0, c7, c5, 0 @ Invalidate I cache & BTB
267 mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer
268 mov pc, lr
269
270/*
271 * flush_kern_dcache_page(void *page)
272 *
273 * Ensure no D cache aliasing occurs, either with itself or
274 * the I cache
275 *
276 * - addr - page aligned address
277 */
278ENTRY(xscale_flush_kern_dcache_page)
279 add r1, r0, #PAGE_SZ
2801: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
281 mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
282 add r0, r0, #CACHELINESIZE
283 cmp r0, r1
284 blo 1b
285 mov r0, #0
286 mcr p15, 0, r0, c7, c5, 0 @ Invalidate I cache & BTB
287 mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer
288 mov pc, lr
289
290/*
291 * dma_inv_range(start, end)
292 *
293 * Invalidate (discard) the specified virtual address range.
294 * May not write back any entries. If 'start' or 'end'
295 * are not cache line aligned, those lines must be written
296 * back.
297 *
298 * - start - virtual start address
299 * - end - virtual end address
300 */
301ENTRY(xscale_dma_inv_range)
302 mrc p15, 0, r2, c0, c0, 0 @ read ID
303 eor r2, r2, #0x69000000
304 eor r2, r2, #0x00052000
305 bics r2, r2, #1
306 beq xscale_dma_flush_range
307
308 tst r0, #CACHELINESIZE - 1
309 bic r0, r0, #CACHELINESIZE - 1
310 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
311 tst r1, #CACHELINESIZE - 1
312 mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
3131: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
314 add r0, r0, #CACHELINESIZE
315 cmp r0, r1
316 blo 1b
317 mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer
318 mov pc, lr
319
320/*
321 * dma_clean_range(start, end)
322 *
323 * Clean the specified virtual address range.
324 *
325 * - start - virtual start address
326 * - end - virtual end address
327 */
328ENTRY(xscale_dma_clean_range)
329 bic r0, r0, #CACHELINESIZE - 1
3301: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
331 add r0, r0, #CACHELINESIZE
332 cmp r0, r1
333 blo 1b
334 mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer
335 mov pc, lr
336
337/*
338 * dma_flush_range(start, end)
339 *
340 * Clean and invalidate the specified virtual address range.
341 *
342 * - start - virtual start address
343 * - end - virtual end address
344 */
345ENTRY(xscale_dma_flush_range)
346 bic r0, r0, #CACHELINESIZE - 1
3471: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
348 mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
349 add r0, r0, #CACHELINESIZE
350 cmp r0, r1
351 blo 1b
352 mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer
353 mov pc, lr
354
355ENTRY(xscale_cache_fns)
356 .long xscale_flush_kern_cache_all
357 .long xscale_flush_user_cache_all
358 .long xscale_flush_user_cache_range
359 .long xscale_coherent_kern_range
360 .long xscale_coherent_user_range
361 .long xscale_flush_kern_dcache_page
362 .long xscale_dma_inv_range
363 .long xscale_dma_clean_range
364 .long xscale_dma_flush_range
365
366ENTRY(cpu_xscale_dcache_clean_area)
3671: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
368 add r0, r0, #CACHELINESIZE
369 subs r1, r1, #CACHELINESIZE
370 bhi 1b
371 mov pc, lr
372
373/* ================================ CACHE LOCKING============================
374 *
375 * The XScale MicroArchitecture implements support for locking entries into
376 * the data and instruction cache. The following functions implement the core
377 * low level instructions needed to accomplish the locking. The developer's
378 * manual states that the code that performs the locking must be in non-cached
379 * memory. To accomplish this, the code in xscale-cache-lock.c copies the
380 * following functions from the cache into a non-cached memory region that
381 * is allocated through consistent_alloc().
382 *
383 */
384 .align 5
385/*
386 * xscale_icache_lock
387 *
388 * r0: starting address to lock
389 * r1: end address to lock
390 */
391ENTRY(xscale_icache_lock)
392
393iLockLoop:
394 bic r0, r0, #CACHELINESIZE - 1
395 mcr p15, 0, r0, c9, c1, 0 @ lock into cache
396 cmp r0, r1 @ are we done?
397 add r0, r0, #CACHELINESIZE @ advance to next cache line
398 bls iLockLoop
399 mov pc, lr
400
401/*
402 * xscale_icache_unlock
403 */
404ENTRY(xscale_icache_unlock)
405 mcr p15, 0, r0, c9, c1, 1 @ Unlock icache
406 mov pc, lr
407
408/*
409 * xscale_dcache_lock
410 *
411 * r0: starting address to lock
412 * r1: end address to lock
413 */
414ENTRY(xscale_dcache_lock)
415 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
416 mov r2, #1
417 mcr p15, 0, r2, c9, c2, 0 @ Put dcache in lock mode
418 cpwait ip @ Wait for completion
419
420 mrs r2, cpsr
421 orr r3, r2, #PSR_F_BIT | PSR_I_BIT
422dLockLoop:
423 msr cpsr_c, r3
424 mcr p15, 0, r0, c7, c10, 1 @ Write back line if it is dirty
425 mcr p15, 0, r0, c7, c6, 1 @ Flush/invalidate line
426 msr cpsr_c, r2
427 ldr ip, [r0], #CACHELINESIZE @ Preload 32 bytes into cache from
428 @ location [r0]. Post-increment
429 @ r3 to next cache line
430 cmp r0, r1 @ Are we done?
431 bls dLockLoop
432
433 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
434 mov r2, #0
435 mcr p15, 0, r2, c9, c2, 0 @ Get out of lock mode
436 cpwait_ret lr, ip
437
438/*
439 * xscale_dcache_unlock
440 */
441ENTRY(xscale_dcache_unlock)
442 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
443 mcr p15, 0, ip, c9, c2, 1 @ Unlock cache
444 mov pc, lr
445
446/*
447 * Needed to determine the length of the code that needs to be copied.
448 */
449 .align 5
450ENTRY(xscale_cache_dummy)
451 mov pc, lr
452
453/* ================================ TLB LOCKING==============================
454 *
455 * The XScale MicroArchitecture implements support for locking entries into
456 * the Instruction and Data TLBs. The following functions provide the
457 * low level support for supporting these under Linux. xscale-lock.c
458 * implements some higher level management code. Most of the following
459 * is taken straight out of the Developer's Manual.
460 */
461
462/*
463 * Lock I-TLB entry
464 *
465 * r0: Virtual address to translate and lock
466 */
467 .align 5
468ENTRY(xscale_itlb_lock)
469 mrs r2, cpsr
470 orr r3, r2, #PSR_F_BIT | PSR_I_BIT
471 msr cpsr_c, r3 @ Disable interrupts
472 mcr p15, 0, r0, c8, c5, 1 @ Invalidate I-TLB entry
473 mcr p15, 0, r0, c10, c4, 0 @ Translate and lock
474 msr cpsr_c, r2 @ Restore interrupts
475 cpwait_ret lr, ip
476
477/*
478 * Lock D-TLB entry
479 *
480 * r0: Virtual address to translate and lock
481 */
482 .align 5
483ENTRY(xscale_dtlb_lock)
484 mrs r2, cpsr
485 orr r3, r2, #PSR_F_BIT | PSR_I_BIT
486 msr cpsr_c, r3 @ Disable interrupts
487 mcr p15, 0, r0, c8, c6, 1 @ Invalidate D-TLB entry
488 mcr p15, 0, r0, c10, c8, 0 @ Translate and lock
489 msr cpsr_c, r2 @ Restore interrupts
490 cpwait_ret lr, ip
491
492/*
493 * Unlock all I-TLB entries
494 */
495 .align 5
496ENTRY(xscale_itlb_unlock)
497 mcr p15, 0, ip, c10, c4, 1 @ Unlock I-TLB
498 mcr p15, 0, ip, c8, c5, 0 @ Invalidate I-TLB
499 cpwait_ret lr, ip
500
501/*
502 * Unlock all D-TLB entries
503 */
504ENTRY(xscale_dtlb_unlock)
505 mcr p15, 0, ip, c10, c8, 1 @ Unlock D-TBL
506 mcr p15, 0, ip, c8, c6, 0 @ Invalidate D-TLB
507 cpwait_ret lr, ip
508
509/* =============================== PageTable ============================== */
510
511#define PTE_CACHE_WRITE_ALLOCATE 0
512
513/*
514 * cpu_xscale_switch_mm(pgd)
515 *
516 * Set the translation base pointer to be as described by pgd.
517 *
518 * pgd: new page tables
519 */
520 .align 5
521ENTRY(cpu_xscale_switch_mm)
522 clean_d_cache r1, r2
523 mcr p15, 0, ip, c7, c5, 0 @ Invalidate I cache & BTB
524 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
525 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
526 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
527 cpwait_ret lr, ip
528
529/*
530 * cpu_xscale_set_pte(ptep, pte)
531 *
532 * Set a PTE and flush it out
533 *
534 * Errata 40: must set memory to write-through for user read-only pages.
535 */
536 .align 5
537ENTRY(cpu_xscale_set_pte)
538 str r1, [r0], #-2048 @ linux version
539
540 bic r2, r1, #0xff0
541 orr r2, r2, #PTE_TYPE_EXT @ extended page
542
543 eor r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
544
545 tst r3, #L_PTE_USER @ User?
546 orrne r2, r2, #PTE_EXT_AP_URO_SRW @ yes -> user r/o, system r/w
547
548 tst r3, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
549 orreq r2, r2, #PTE_EXT_AP_UNO_SRW @ yes -> user n/a, system r/w
550 @ combined with user -> user r/w
551
552 @
553 @ Handle the X bit. We want to set this bit for the minicache
554 @ (U = E = B = W = 0, C = 1) or when write allocate is enabled,
555 @ and we have a writeable, cacheable region. If we ignore the
556 @ U and E bits, we can allow user space to use the minicache as
557 @ well.
558 @
559 @ X = (C & ~W & ~B) | (C & W & B & write_allocate)
560 @
561 eor ip, r1, #L_PTE_CACHEABLE
562 tst ip, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE
563#if PTE_CACHE_WRITE_ALLOCATE
564 eorne ip, r1, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE
565 tstne ip, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE
566#endif
567 orreq r2, r2, #PTE_EXT_TEX(1)
568
569 @
570 @ Erratum 40: The B bit must be cleared for a user read-only
571 @ cacheable page.
572 @
573 @ B = B & ~(U & C & ~W)
574 @
575 and ip, r1, #L_PTE_USER | L_PTE_WRITE | L_PTE_CACHEABLE
576 teq ip, #L_PTE_USER | L_PTE_CACHEABLE
577 biceq r2, r2, #PTE_BUFFERABLE
578
579 tst r3, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young?
580 movne r2, #0 @ no -> fault
581
582 str r2, [r0] @ hardware version
583 mov ip, #0
584 mcr p15, 0, r0, c7, c10, 1 @ Clean D cache line
585 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
586 mov pc, lr
587
588
589 .ltorg
590
591 .align
592
593 __INIT
594
595 .type __xscale_setup, #function
596__xscale_setup:
597 mcr p15, 0, ip, c7, c7, 0 @ invalidate I, D caches & BTB
598 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
599 mcr p15, 0, ip, c8, c7, 0 @ invalidate I, D TLBs
600#ifdef CONFIG_IWMMXT
601 mov r0, #0 @ initially disallow access to CP0/CP1
602#else
603 mov r0, #1 @ Allow access to CP0
604#endif
605 orr r0, r0, #1 << 6 @ cp6 for IOP3xx and Bulverde
606 orr r0, r0, #1 << 13 @ Its undefined whether this
607 mcr p15, 0, r0, c15, c1, 0 @ affects USR or SVC modes
608 mrc p15, 0, r0, c1, c0, 0 @ get control register
609 ldr r5, xscale_cr1_clear
610 bic r0, r0, r5
611 ldr r5, xscale_cr1_set
612 orr r0, r0, r5
613 mov pc, lr
614 .size __xscale_setup, . - __xscale_setup
615
616 /*
617 * R
618 * .RVI ZFRS BLDP WCAM
619 * ..11 1.01 .... .101
620 *
621 */
622 .type xscale_cr1_clear, #object
623 .type xscale_cr1_set, #object
624xscale_cr1_clear:
625 .word 0x3b07
626xscale_cr1_set:
627 .word 0x3905
628
629 __INITDATA
630
631/*
632 * Purpose : Function pointers used to access above functions - all calls
633 * come through these
634 */
635
636 .type xscale_processor_functions, #object
637ENTRY(xscale_processor_functions)
638 .word v5t_early_abort
639 .word cpu_xscale_proc_init
640 .word cpu_xscale_proc_fin
641 .word cpu_xscale_reset
642 .word cpu_xscale_do_idle
643 .word cpu_xscale_dcache_clean_area
644 .word cpu_xscale_switch_mm
645 .word cpu_xscale_set_pte
646 .size xscale_processor_functions, . - xscale_processor_functions
647
648 .section ".rodata"
649
650 .type cpu_arch_name, #object
651cpu_arch_name:
652 .asciz "armv5te"
653 .size cpu_arch_name, . - cpu_arch_name
654
655 .type cpu_elf_name, #object
656cpu_elf_name:
657 .asciz "v5"
658 .size cpu_elf_name, . - cpu_elf_name
659
660 .type cpu_80200_name, #object
661cpu_80200_name:
662 .asciz "XScale-80200"
663 .size cpu_80200_name, . - cpu_80200_name
664
665 .type cpu_8032x_name, #object
666cpu_8032x_name:
667 .asciz "XScale-IOP8032x Family"
668 .size cpu_8032x_name, . - cpu_8032x_name
669
670 .type cpu_8033x_name, #object
671cpu_8033x_name:
672 .asciz "XScale-IOP8033x Family"
673 .size cpu_8033x_name, . - cpu_8033x_name
674
675 .type cpu_pxa250_name, #object
676cpu_pxa250_name:
677 .asciz "XScale-PXA250"
678 .size cpu_pxa250_name, . - cpu_pxa250_name
679
680 .type cpu_pxa210_name, #object
681cpu_pxa210_name:
682 .asciz "XScale-PXA210"
683 .size cpu_pxa210_name, . - cpu_pxa210_name
684
685 .type cpu_ixp42x_name, #object
686cpu_ixp42x_name:
687 .asciz "XScale-IXP42x Family"
688 .size cpu_ixp42x_name, . - cpu_ixp42x_name
689
690 .type cpu_ixp46x_name, #object
691cpu_ixp46x_name:
692 .asciz "XScale-IXP46x Family"
693 .size cpu_ixp46x_name, . - cpu_ixp46x_name
694
695 .type cpu_ixp2400_name, #object
696cpu_ixp2400_name:
697 .asciz "XScale-IXP2400"
698 .size cpu_ixp2400_name, . - cpu_ixp2400_name
699
700 .type cpu_ixp2800_name, #object
701cpu_ixp2800_name:
702 .asciz "XScale-IXP2800"
703 .size cpu_ixp2800_name, . - cpu_ixp2800_name
704
705 .type cpu_pxa255_name, #object
706cpu_pxa255_name:
707 .asciz "XScale-PXA255"
708 .size cpu_pxa255_name, . - cpu_pxa255_name
709
710 .type cpu_pxa270_name, #object
711cpu_pxa270_name:
712 .asciz "XScale-PXA270"
713 .size cpu_pxa270_name, . - cpu_pxa270_name
714
715 .align
716
717 .section ".proc.info", #alloc, #execinstr
718
719 .type __80200_proc_info,#object
720__80200_proc_info:
721 .long 0x69052000
722 .long 0xfffffff0
723 .long PMD_TYPE_SECT | \
724 PMD_SECT_BUFFERABLE | \
725 PMD_SECT_CACHEABLE | \
726 PMD_SECT_AP_WRITE | \
727 PMD_SECT_AP_READ
728 b __xscale_setup
729 .long cpu_arch_name
730 .long cpu_elf_name
731 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
732 .long cpu_80200_name
733 .long xscale_processor_functions
734 .long v4wbi_tlb_fns
735 .long xscale_mc_user_fns
736 .long xscale_cache_fns
737 .size __80200_proc_info, . - __80200_proc_info
738
739 .type __8032x_proc_info,#object
740__8032x_proc_info:
741 .long 0x69052420
742 .long 0xfffff5e0 @ mask should accomodate IOP80219 also
743 .long PMD_TYPE_SECT | \
744 PMD_SECT_BUFFERABLE | \
745 PMD_SECT_CACHEABLE | \
746 PMD_SECT_AP_WRITE | \
747 PMD_SECT_AP_READ
748 b __xscale_setup
749 .long cpu_arch_name
750 .long cpu_elf_name
751 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
752 .long cpu_8032x_name
753 .long xscale_processor_functions
754 .long v4wbi_tlb_fns
755 .long xscale_mc_user_fns
756 .long xscale_cache_fns
757 .size __8032x_proc_info, . - __8032x_proc_info
758
759 .type __8033x_proc_info,#object
760__8033x_proc_info:
761 .long 0x69054010
762 .long 0xffffff30
763 .long PMD_TYPE_SECT | \
764 PMD_SECT_BUFFERABLE | \
765 PMD_SECT_CACHEABLE | \
766 PMD_SECT_AP_WRITE | \
767 PMD_SECT_AP_READ
768 b __xscale_setup
769 .long cpu_arch_name
770 .long cpu_elf_name
771 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
772 .long cpu_8033x_name
773 .long xscale_processor_functions
774 .long v4wbi_tlb_fns
775 .long xscale_mc_user_fns
776 .long xscale_cache_fns
777 .size __8033x_proc_info, . - __8033x_proc_info
778
779 .type __pxa250_proc_info,#object
780__pxa250_proc_info:
781 .long 0x69052100
782 .long 0xfffff7f0
783 .long PMD_TYPE_SECT | \
784 PMD_SECT_BUFFERABLE | \
785 PMD_SECT_CACHEABLE | \
786 PMD_SECT_AP_WRITE | \
787 PMD_SECT_AP_READ
788 b __xscale_setup
789 .long cpu_arch_name
790 .long cpu_elf_name
791 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
792 .long cpu_pxa250_name
793 .long xscale_processor_functions
794 .long v4wbi_tlb_fns
795 .long xscale_mc_user_fns
796 .long xscale_cache_fns
797 .size __pxa250_proc_info, . - __pxa250_proc_info
798
799 .type __pxa210_proc_info,#object
800__pxa210_proc_info:
801 .long 0x69052120
802 .long 0xfffff3f0
803 .long PMD_TYPE_SECT | \
804 PMD_SECT_BUFFERABLE | \
805 PMD_SECT_CACHEABLE | \
806 PMD_SECT_AP_WRITE | \
807 PMD_SECT_AP_READ
808 b __xscale_setup
809 .long cpu_arch_name
810 .long cpu_elf_name
811 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
812 .long cpu_pxa210_name
813 .long xscale_processor_functions
814 .long v4wbi_tlb_fns
815 .long xscale_mc_user_fns
816 .long xscale_cache_fns
817 .size __pxa210_proc_info, . - __pxa210_proc_info
818
819 .type __ixp2400_proc_info, #object
820__ixp2400_proc_info:
821 .long 0x69054190
822 .long 0xfffffff0
823 .long PMD_TYPE_SECT | \
824 PMD_SECT_BUFFERABLE | \
825 PMD_SECT_CACHEABLE | \
826 PMD_SECT_AP_WRITE | \
827 PMD_SECT_AP_READ
828 b __xscale_setup
829 .long cpu_arch_name
830 .long cpu_elf_name
831 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
832 .long cpu_ixp2400_name
833 .long xscale_processor_functions
834 .long v4wbi_tlb_fns
835 .long xscale_mc_user_fns
836 .long xscale_cache_fns
837 .size __ixp2400_proc_info, . - __ixp2400_proc_info
838
839 .type __ixp2800_proc_info, #object
840__ixp2800_proc_info:
841 .long 0x690541a0
842 .long 0xfffffff0
843 .long PMD_TYPE_SECT | \
844 PMD_SECT_BUFFERABLE | \
845 PMD_SECT_CACHEABLE | \
846 PMD_SECT_AP_WRITE | \
847 PMD_SECT_AP_READ
848 b __xscale_setup
849 .long cpu_arch_name
850 .long cpu_elf_name
851 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
852 .long cpu_ixp2800_name
853 .long xscale_processor_functions
854 .long v4wbi_tlb_fns
855 .long xscale_mc_user_fns
856 .long xscale_cache_fns
857 .size __ixp2800_proc_info, . - __ixp2800_proc_info
858
859 .type __ixp42x_proc_info, #object
860__ixp42x_proc_info:
861 .long 0x690541c0
862 .long 0xffffffc0
863 .long PMD_TYPE_SECT | \
864 PMD_SECT_BUFFERABLE | \
865 PMD_SECT_CACHEABLE | \
866 PMD_SECT_AP_WRITE | \
867 PMD_SECT_AP_READ
868 b __xscale_setup
869 .long cpu_arch_name
870 .long cpu_elf_name
871 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
872 .long cpu_ixp42x_name
873 .long xscale_processor_functions
874 .long v4wbi_tlb_fns
875 .long xscale_mc_user_fns
876 .long xscale_cache_fns
877 .size __ixp42x_proc_info, . - __ixp42x_proc_info
878
879 .type __ixp46x_proc_info, #object
880__ixp46x_proc_info:
881 .long 0x69054200
882 .long 0xffffff00
883 .long 0x00000c0e
884 b __xscale_setup
885 .long cpu_arch_name
886 .long cpu_elf_name
887 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
888 .long cpu_ixp46x_name
889 .long xscale_processor_functions
890 .long v4wbi_tlb_fns
891 .long xscale_mc_user_fns
892 .long xscale_cache_fns
893 .size __ixp46x_proc_info, . - __ixp46x_proc_info
894
895 .type __pxa255_proc_info,#object
896__pxa255_proc_info:
897 .long 0x69052d00
898 .long 0xfffffff0
899 .long PMD_TYPE_SECT | \
900 PMD_SECT_BUFFERABLE | \
901 PMD_SECT_CACHEABLE | \
902 PMD_SECT_AP_WRITE | \
903 PMD_SECT_AP_READ
904 b __xscale_setup
905 .long cpu_arch_name
906 .long cpu_elf_name
907 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
908 .long cpu_pxa255_name
909 .long xscale_processor_functions
910 .long v4wbi_tlb_fns
911 .long xscale_mc_user_fns
912 .long xscale_cache_fns
913 .size __pxa255_proc_info, . - __pxa255_proc_info
914
915 .type __pxa270_proc_info,#object
916__pxa270_proc_info:
917 .long 0x69054110
918 .long 0xfffffff0
919 .long PMD_TYPE_SECT | \
920 PMD_SECT_BUFFERABLE | \
921 PMD_SECT_CACHEABLE | \
922 PMD_SECT_AP_WRITE | \
923 PMD_SECT_AP_READ
924 b __xscale_setup
925 .long cpu_arch_name
926 .long cpu_elf_name
927 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
928 .long cpu_pxa270_name
929 .long xscale_processor_functions
930 .long v4wbi_tlb_fns
931 .long xscale_mc_user_fns
932 .long xscale_cache_fns
933 .size __pxa270_proc_info, . - __pxa270_proc_info
934
diff --git a/arch/arm/mm/tlb-v3.S b/arch/arm/mm/tlb-v3.S
new file mode 100644
index 000000000000..44b0daeaff9b
--- /dev/null
+++ b/arch/arm/mm/tlb-v3.S
@@ -0,0 +1,52 @@
1/*
2 * linux/arch/arm/mm/tlbv3.S
3 *
4 * Copyright (C) 1997-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ARM architecture version 3 TLB handling functions.
11 *
12 * Processors: ARM610, ARM710.
13 */
14#include <linux/linkage.h>
15#include <linux/init.h>
16#include <asm/constants.h>
17#include <asm/tlbflush.h>
18#include "proc-macros.S"
19
20 .align 5
21/*
22 * v3_flush_user_tlb_range(start, end, mm)
23 *
24 * Invalidate a range of TLB entries in the specified address space.
25 *
26 * - start - range start address
27 * - end - range end address
28 * - mm - mm_struct describing address space
29 */
30 .align 5
31ENTRY(v3_flush_user_tlb_range)
32 vma_vm_mm r2, r2
33 act_mm r3 @ get current->active_mm
34 teq r2, r3 @ == mm ?
35 movne pc, lr @ no, we dont do anything
36ENTRY(v3_flush_kern_tlb_range)
37 bic r0, r0, #0x0ff
38 bic r0, r0, #0xf00
391: mcr p15, 0, r0, c6, c0, 0 @ invalidate TLB entry
40 add r0, r0, #PAGE_SZ
41 cmp r0, r1
42 blo 1b
43 mov pc, lr
44
45 __INITDATA
46
47 .type v3_tlb_fns, #object
48ENTRY(v3_tlb_fns)
49 .long v3_flush_user_tlb_range
50 .long v3_flush_kern_tlb_range
51 .long v3_tlb_flags
52 .size v3_tlb_fns, . - v3_tlb_fns
diff --git a/arch/arm/mm/tlb-v4.S b/arch/arm/mm/tlb-v4.S
new file mode 100644
index 000000000000..db82ee468248
--- /dev/null
+++ b/arch/arm/mm/tlb-v4.S
@@ -0,0 +1,65 @@
1/*
2 * linux/arch/arm/mm/tlbv4.S
3 *
4 * Copyright (C) 1997-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ARM architecture version 4 TLB handling functions.
11 * These assume a split I/D TLBs, and no write buffer.
12 *
13 * Processors: ARM720T
14 */
15#include <linux/linkage.h>
16#include <linux/init.h>
17#include <asm/constants.h>
18#include <asm/tlbflush.h>
19#include "proc-macros.S"
20
21 .align 5
22/*
23 * v4_flush_user_tlb_range(start, end, mm)
24 *
25 * Invalidate a range of TLB entries in the specified user address space.
26 *
27 * - start - range start address
28 * - end - range end address
29 * - mm - mm_struct describing address space
30 */
31 .align 5
32ENTRY(v4_flush_user_tlb_range)
33 vma_vm_mm ip, r2
34 act_mm r3 @ get current->active_mm
35 eors r3, ip, r3 @ == mm ?
36 movne pc, lr @ no, we dont do anything
37.v4_flush_kern_tlb_range:
38 bic r0, r0, #0x0ff
39 bic r0, r0, #0xf00
401: mcr p15, 0, r0, c8, c7, 1 @ invalidate TLB entry
41 add r0, r0, #PAGE_SZ
42 cmp r0, r1
43 blo 1b
44 mov pc, lr
45
46/*
47 * v4_flush_kern_tlb_range(start, end)
48 *
49 * Invalidate a range of TLB entries in the specified kernel
50 * address range.
51 *
52 * - start - virtual address (may not be aligned)
53 * - end - virtual address (may not be aligned)
54 */
55.globl v4_flush_kern_tlb_range
56.equ v4_flush_kern_tlb_range, .v4_flush_kern_tlb_range
57
58 __INITDATA
59
60 .type v4_tlb_fns, #object
61ENTRY(v4_tlb_fns)
62 .long v4_flush_user_tlb_range
63 .long v4_flush_kern_tlb_range
64 .long v4_tlb_flags
65 .size v4_tlb_fns, . - v4_tlb_fns
diff --git a/arch/arm/mm/tlb-v4wb.S b/arch/arm/mm/tlb-v4wb.S
new file mode 100644
index 000000000000..7908d5f1f130
--- /dev/null
+++ b/arch/arm/mm/tlb-v4wb.S
@@ -0,0 +1,77 @@
1/*
2 * linux/arch/arm/mm/tlbv4wb.S
3 *
4 * Copyright (C) 1997-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ARM architecture version 4 TLB handling functions.
11 * These assume a split I/D TLBs w/o I TLB entry, with a write buffer.
12 *
13 * Processors: SA110 SA1100 SA1110
14 */
15#include <linux/linkage.h>
16#include <linux/init.h>
17#include <asm/constants.h>
18#include <asm/tlbflush.h>
19#include "proc-macros.S"
20
21 .align 5
22/*
23 * v4wb_flush_user_tlb_range(start, end, mm)
24 *
25 * Invalidate a range of TLB entries in the specified address space.
26 *
27 * - start - range start address
28 * - end - range end address
29 * - mm - mm_struct describing address space
30 */
31 .align 5
32ENTRY(v4wb_flush_user_tlb_range)
33 vma_vm_mm ip, r2
34 act_mm r3 @ get current->active_mm
35 eors r3, ip, r3 @ == mm ?
36 movne pc, lr @ no, we dont do anything
37 vma_vm_flags r2, r2
38 mcr p15, 0, r3, c7, c10, 4 @ drain WB
39 tst r2, #VM_EXEC
40 mcrne p15, 0, r3, c8, c5, 0 @ invalidate I TLB
41 bic r0, r0, #0x0ff
42 bic r0, r0, #0xf00
431: mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
44 add r0, r0, #PAGE_SZ
45 cmp r0, r1
46 blo 1b
47 mov pc, lr
48
49/*
50 * v4_flush_kern_tlb_range(start, end)
51 *
52 * Invalidate a range of TLB entries in the specified kernel
53 * address range.
54 *
55 * - start - virtual address (may not be aligned)
56 * - end - virtual address (may not be aligned)
57 */
58ENTRY(v4wb_flush_kern_tlb_range)
59 mov r3, #0
60 mcr p15, 0, r3, c7, c10, 4 @ drain WB
61 bic r0, r0, #0x0ff
62 bic r0, r0, #0xf00
63 mcr p15, 0, r3, c8, c5, 0 @ invalidate I TLB
641: mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
65 add r0, r0, #PAGE_SZ
66 cmp r0, r1
67 blo 1b
68 mov pc, lr
69
70 __INITDATA
71
72 .type v4wb_tlb_fns, #object
73ENTRY(v4wb_tlb_fns)
74 .long v4wb_flush_user_tlb_range
75 .long v4wb_flush_kern_tlb_range
76 .long v4wb_tlb_flags
77 .size v4wb_tlb_fns, . - v4wb_tlb_fns
diff --git a/arch/arm/mm/tlb-v4wbi.S b/arch/arm/mm/tlb-v4wbi.S
new file mode 100644
index 000000000000..efbe94bbe1a7
--- /dev/null
+++ b/arch/arm/mm/tlb-v4wbi.S
@@ -0,0 +1,68 @@
1/*
2 * linux/arch/arm/mm/tlbv4wbi.S
3 *
4 * Copyright (C) 1997-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ARM architecture version 4 and version 5 TLB handling functions.
11 * These assume a split I/D TLBs, with a write buffer.
12 *
13 * Processors: ARM920 ARM922 ARM925 ARM926 XScale
14 */
15#include <linux/linkage.h>
16#include <linux/init.h>
17#include <asm/constants.h>
18#include <asm/tlbflush.h>
19#include "proc-macros.S"
20
21/*
22 * v4wb_flush_user_tlb_range(start, end, mm)
23 *
24 * Invalidate a range of TLB entries in the specified address space.
25 *
26 * - start - range start address
27 * - end - range end address
28 * - mm - mm_struct describing address space
29 */
30 .align 5
31ENTRY(v4wbi_flush_user_tlb_range)
32 vma_vm_mm ip, r2
33 act_mm r3 @ get current->active_mm
34 eors r3, ip, r3 @ == mm ?
35 movne pc, lr @ no, we dont do anything
36 mov r3, #0
37 mcr p15, 0, r3, c7, c10, 4 @ drain WB
38 vma_vm_flags r2, r2
39 bic r0, r0, #0x0ff
40 bic r0, r0, #0xf00
411: tst r2, #VM_EXEC
42 mcrne p15, 0, r0, c8, c5, 1 @ invalidate I TLB entry
43 mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
44 add r0, r0, #PAGE_SZ
45 cmp r0, r1
46 blo 1b
47 mov pc, lr
48
49ENTRY(v4wbi_flush_kern_tlb_range)
50 mov r3, #0
51 mcr p15, 0, r3, c7, c10, 4 @ drain WB
52 bic r0, r0, #0x0ff
53 bic r0, r0, #0xf00
541: mcr p15, 0, r0, c8, c5, 1 @ invalidate I TLB entry
55 mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
56 add r0, r0, #PAGE_SZ
57 cmp r0, r1
58 blo 1b
59 mov pc, lr
60
61 __INITDATA
62
63 .type v4wbi_tlb_fns, #object
64ENTRY(v4wbi_tlb_fns)
65 .long v4wbi_flush_user_tlb_range
66 .long v4wbi_flush_kern_tlb_range
67 .long v4wbi_tlb_flags
68 .size v4wbi_tlb_fns, . - v4wbi_tlb_fns
diff --git a/arch/arm/mm/tlb-v6.S b/arch/arm/mm/tlb-v6.S
new file mode 100644
index 000000000000..99ed26e78adf
--- /dev/null
+++ b/arch/arm/mm/tlb-v6.S
@@ -0,0 +1,92 @@
1/*
2 * linux/arch/arm/mm/tlb-v6.S
3 *
4 * Copyright (C) 1997-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ARM architecture version 6 TLB handling functions.
11 * These assume a split I/D TLB.
12 */
13#include <linux/linkage.h>
14#include <asm/constants.h>
15#include <asm/page.h>
16#include <asm/tlbflush.h>
17#include "proc-macros.S"
18
19#define HARVARD_TLB
20
21/*
22 * v6wbi_flush_user_tlb_range(start, end, vma)
23 *
24 * Invalidate a range of TLB entries in the specified address space.
25 *
26 * - start - start address (may not be aligned)
27 * - end - end address (exclusive, may not be aligned)
28 * - vma - vma_struct describing address range
29 *
30 * It is assumed that:
31 * - the "Invalidate single entry" instruction will invalidate
32 * both the I and the D TLBs on Harvard-style TLBs
33 */
34ENTRY(v6wbi_flush_user_tlb_range)
35 vma_vm_mm r3, r2 @ get vma->vm_mm
36 mov ip, #0
37 mmid r3, r3 @ get vm_mm->context.id
38 mcr p15, 0, ip, c7, c10, 4 @ drain write buffer
39 mov r0, r0, lsr #PAGE_SHIFT @ align address
40 mov r1, r1, lsr #PAGE_SHIFT
41 asid r3, r3 @ mask ASID
42 orr r0, r3, r0, lsl #PAGE_SHIFT @ Create initial MVA
43 mov r1, r1, lsl #PAGE_SHIFT
44 vma_vm_flags r2, r2 @ get vma->vm_flags
451:
46#ifdef HARVARD_TLB
47 mcr p15, 0, r0, c8, c6, 1 @ TLB invalidate D MVA (was 1)
48 tst r2, #VM_EXEC @ Executable area ?
49 mcrne p15, 0, r0, c8, c5, 1 @ TLB invalidate I MVA (was 1)
50#else
51 mcr p15, 0, r0, c8, c7, 1 @ TLB invalidate MVA (was 1)
52#endif
53 add r0, r0, #PAGE_SZ
54 cmp r0, r1
55 blo 1b
56 mov pc, lr
57
58/*
59 * v6wbi_flush_kern_tlb_range(start,end)
60 *
61 * Invalidate a range of kernel TLB entries
62 *
63 * - start - start address (may not be aligned)
64 * - end - end address (exclusive, may not be aligned)
65 */
66ENTRY(v6wbi_flush_kern_tlb_range)
67 mov r2, #0
68 mcr p15, 0, r2, c7, c10, 4 @ drain write buffer
69 mov r0, r0, lsr #PAGE_SHIFT @ align address
70 mov r1, r1, lsr #PAGE_SHIFT
71 mov r0, r0, lsl #PAGE_SHIFT
72 mov r1, r1, lsl #PAGE_SHIFT
731:
74#ifdef HARVARD_TLB
75 mcr p15, 0, r0, c8, c6, 1 @ TLB invalidate D MVA
76 mcr p15, 0, r0, c8, c5, 1 @ TLB invalidate I MVA
77#else
78 mcr p15, 0, r0, c8, c7, 1 @ TLB invalidate MVA
79#endif
80 add r0, r0, #PAGE_SZ
81 cmp r0, r1
82 blo 1b
83 mov pc, lr
84
85 .section ".text.init", #alloc, #execinstr
86
87 .type v6wbi_tlb_fns, #object
88ENTRY(v6wbi_tlb_fns)
89 .long v6wbi_flush_user_tlb_range
90 .long v6wbi_flush_kern_tlb_range
91 .long v6wbi_tlb_flags
92 .size v6wbi_tlb_fns, . - v6wbi_tlb_fns
diff --git a/arch/arm/nwfpe/ARM-gcc.h b/arch/arm/nwfpe/ARM-gcc.h
new file mode 100644
index 000000000000..e6598470b076
--- /dev/null
+++ b/arch/arm/nwfpe/ARM-gcc.h
@@ -0,0 +1,120 @@
1/*
2-------------------------------------------------------------------------------
3The macro `BITS64' can be defined to indicate that 64-bit integer types are
4supported by the compiler.
5-------------------------------------------------------------------------------
6*/
7#define BITS64
8
9/*
10-------------------------------------------------------------------------------
11Each of the following `typedef's defines the most convenient type that holds
12integers of at least as many bits as specified. For example, `uint8' should
13be the most convenient type that can hold unsigned integers of as many as
148 bits. The `flag' type must be able to hold either a 0 or 1. For most
15implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
16to the same as `int'.
17-------------------------------------------------------------------------------
18*/
19typedef char flag;
20typedef unsigned char uint8;
21typedef signed char int8;
22typedef int uint16;
23typedef int int16;
24typedef unsigned int uint32;
25typedef signed int int32;
26#ifdef BITS64
27typedef unsigned long long int bits64;
28typedef signed long long int sbits64;
29#endif
30
31/*
32-------------------------------------------------------------------------------
33Each of the following `typedef's defines a type that holds integers
34of _exactly_ the number of bits specified. For instance, for most
35implementation of C, `bits16' and `sbits16' should be `typedef'ed to
36`unsigned short int' and `signed short int' (or `short int'), respectively.
37-------------------------------------------------------------------------------
38*/
39typedef unsigned char bits8;
40typedef signed char sbits8;
41typedef unsigned short int bits16;
42typedef signed short int sbits16;
43typedef unsigned int bits32;
44typedef signed int sbits32;
45#ifdef BITS64
46typedef unsigned long long int uint64;
47typedef signed long long int int64;
48#endif
49
50#ifdef BITS64
51/*
52-------------------------------------------------------------------------------
53The `LIT64' macro takes as its argument a textual integer literal and if
54necessary ``marks'' the literal as having a 64-bit integer type. For
55example, the Gnu C Compiler (`gcc') requires that 64-bit literals be
56appended with the letters `LL' standing for `long long', which is `gcc's
57name for the 64-bit integer type. Some compilers may allow `LIT64' to be
58defined as the identity macro: `#define LIT64( a ) a'.
59-------------------------------------------------------------------------------
60*/
61#define LIT64( a ) a##LL
62#endif
63
64/*
65-------------------------------------------------------------------------------
66The macro `INLINE' can be used before functions that should be inlined. If
67a compiler does not support explicit inlining, this macro should be defined
68to be `static'.
69-------------------------------------------------------------------------------
70*/
71#define INLINE extern __inline__
72
73
74/* For use as a GCC soft-float library we need some special function names. */
75
76#ifdef __LIBFLOAT__
77
78/* Some 32-bit ops can be mapped straight across by just changing the name. */
79#define float32_add __addsf3
80#define float32_sub __subsf3
81#define float32_mul __mulsf3
82#define float32_div __divsf3
83#define int32_to_float32 __floatsisf
84#define float32_to_int32_round_to_zero __fixsfsi
85#define float32_to_uint32_round_to_zero __fixunssfsi
86
87/* These ones go through the glue code. To avoid namespace pollution
88 we rename the internal functions too. */
89#define float32_eq ___float32_eq
90#define float32_le ___float32_le
91#define float32_lt ___float32_lt
92
93/* All the 64-bit ops have to go through the glue, so we pull the same
94 trick. */
95#define float64_add ___float64_add
96#define float64_sub ___float64_sub
97#define float64_mul ___float64_mul
98#define float64_div ___float64_div
99#define int32_to_float64 ___int32_to_float64
100#define float64_to_int32_round_to_zero ___float64_to_int32_round_to_zero
101#define float64_to_uint32_round_to_zero ___float64_to_uint32_round_to_zero
102#define float64_to_float32 ___float64_to_float32
103#define float32_to_float64 ___float32_to_float64
104#define float64_eq ___float64_eq
105#define float64_le ___float64_le
106#define float64_lt ___float64_lt
107
108#if 0
109#define float64_add __adddf3
110#define float64_sub __subdf3
111#define float64_mul __muldf3
112#define float64_div __divdf3
113#define int32_to_float64 __floatsidf
114#define float64_to_int32_round_to_zero __fixdfsi
115#define float64_to_uint32_round_to_zero __fixunsdfsi
116#define float64_to_float32 __truncdfsf2
117#define float32_to_float64 __extendsfdf2
118#endif
119
120#endif
diff --git a/arch/arm/nwfpe/ChangeLog b/arch/arm/nwfpe/ChangeLog
new file mode 100644
index 000000000000..eeb5a7c5ff09
--- /dev/null
+++ b/arch/arm/nwfpe/ChangeLog
@@ -0,0 +1,91 @@
12003-03-22 Ralph Siemsen <ralphs@netwinder.org>
2 * Reformat all but softfloat files to get a consistent coding style.
3 Used "indent -kr -i8 -ts8 -sob -l132 -ss" and a few manual fixups.
4 * Removed dead code and fixed function protypes to match definitions.
5 * Consolidated use of (opcode && MASK_ARITHMETIC_OPCODE) >> 20.
6 * Make 80-bit precision a compile-time option. (1%)
7 * Only initialize FPE state once in repeat-FP situations. (6%)
8
92002-01-19 Russell King <rmk@arm.linux.org.uk>
10
11 * fpa11.h - Add documentation
12 - remove userRegisters pointer from this structure.
13 - add new method to obtain integer register values.
14 * softfloat.c - Remove float128
15 * softfloat.h - Remove float128
16 * softfloat-specialize - Remove float128
17
18 * The FPA11 structure is not a kernel-specific data structure.
19 It is used by users of ptrace to examine the values of the
20 floating point registers. Therefore, any changes to the
21 FPA11 structure (size or position of elements contained
22 within) have to be well thought out.
23
24 * Since 128-bit float requires the FPA11 structure to change
25 size, it has been removed. 128-bit float is currently unused,
26 and needs various things to be re-worked so that we won't
27 overflow the available space in the task structure.
28
29 * The changes are designed to break any patch that goes on top
30 of this code, so that the authors properly review their changes.
31
321999-08-19 Scott Bambrough <scottb@netwinder.org>
33
34 * fpmodule.c - Changed version number to 0.95
35 * fpa11.h - modified FPA11, FPREG structures
36 * fpa11.c - Changes due to FPA11, FPREG structure alterations.
37 * fpa11_cpdo.c - Changes due to FPA11, FPREG structure alterations.
38 * fpa11_cpdt.c - Changes due to FPA11, FPREG structure alterations.
39 * fpa11_cprt.c - Changes due to FPA11, FPREG structure alterations.
40 * single_cpdo.c - Changes due to FPA11, FPREG structure alterations.
41 * double_cpdo.c - Changes due to FPA11, FPREG structure alterations.
42 * extended_cpdo.c - Changes due to FPA11, FPREG structure alterations.
43
44 * I discovered several bugs. First and worst is that the kernel
45 passes in a pointer to the FPE's state area. This is defined
46 as a struct user_fp (see user.h). This pointer was cast to a
47 FPA11*. Unfortunately FPA11 and user_fp are of different sizes;
48 user_fp is smaller. This meant that the FPE scribbled on things
49 below its area, which is bad, as the area is in the thread_struct
50 embedded in the process task structure. Thus we were scribbling
51 over one of the most important structures in the entire OS.
52
53 * user_fp and FPA11 have now been harmonized. Most of the changes
54 in the above code were dereferencing problems due to moving the
55 register type out of FPREG, and getting rid of the union variable
56 fpvalue.
57
58 * Second I noticed resetFPA11 was not always being called for a
59 task. This should happen on the first floating point exception
60 that occurs. It is controlled by init_flag in FPA11. The
61 comment in the code beside init_flag state the kernel guarantees
62 this to be zero. Not so. I found that the kernel recycles task
63 structures, and that recycled ones may not have init_flag zeroed.
64 I couldn't even find anything that guarantees it is zeroed when
65 when the task structure is initially allocated. In any case
66 I now initialize the entire FPE state in the thread structure to
67 zero when allocated and recycled. See alloc_task_struct() and
68 flush_thread() in arch/arm/process.c. The change to
69 alloc_task_struct() may not be necessary, but I left it in for
70 completeness (better safe than sorry).
71
721998-11-23 Scott Bambrough <scottb@netwinder.org>
73
74 * README.FPE - fix typo in description of lfm/sfm instructions
75 * NOTES - Added file to describe known bugs/problems
76 * fpmodule.c - Changed version number to 0.94
77
781998-11-20 Scott Bambrough <scottb@netwinder.org>
79
80 * README.FPE - fix description of URD, NRM instructions
81 * TODO - remove URD, NRM instructions from TODO list
82 * single_cpdo.c - implement URD, NRM
83 * double_cpdo.c - implement URD, NRM
84 * extended_cpdo.c - implement URD, NRM
85
861998-11-19 Scott Bambrough <scottb@netwinder.org>
87
88 * ChangeLog - Added this file to track changes made.
89 * fpa11.c - added code to initialize register types to typeNone
90 * fpa11_cpdt.c - fixed bug in storeExtended (typeExtended changed to
91 typeDouble in switch statement)
diff --git a/arch/arm/nwfpe/Makefile b/arch/arm/nwfpe/Makefile
new file mode 100644
index 000000000000..ed7b26bf73f5
--- /dev/null
+++ b/arch/arm/nwfpe/Makefile
@@ -0,0 +1,13 @@
1#
2# Copyright (C) 1998, 1999, 2001 Philip Blundell
3#
4
5obj-$(CONFIG_FPE_NWFPE) += nwfpe.o
6
7nwfpe-y += fpa11.o fpa11_cpdo.o fpa11_cpdt.o \
8 fpa11_cprt.o fpmodule.o fpopcode.o \
9 softfloat.o single_cpdo.o double_cpdo.o
10
11nwfpe-$(CONFIG_FPE_NWFPE_XP) += extended_cpdo.o
12nwfpe-$(CONFIG_CPU_26) += entry26.o
13nwfpe-$(CONFIG_CPU_32) += entry.o
diff --git a/arch/arm/nwfpe/double_cpdo.c b/arch/arm/nwfpe/double_cpdo.c
new file mode 100644
index 000000000000..7ffd8cb9bc96
--- /dev/null
+++ b/arch/arm/nwfpe/double_cpdo.c
@@ -0,0 +1,167 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.COM, 1998,1999
4
5 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (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., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#include "fpa11.h"
23#include "softfloat.h"
24#include "fpopcode.h"
25
26union float64_components {
27 float64 f64;
28 unsigned int i[2];
29};
30
31float64 float64_exp(float64 Fm);
32float64 float64_ln(float64 Fm);
33float64 float64_sin(float64 rFm);
34float64 float64_cos(float64 rFm);
35float64 float64_arcsin(float64 rFm);
36float64 float64_arctan(float64 rFm);
37float64 float64_log(float64 rFm);
38float64 float64_tan(float64 rFm);
39float64 float64_arccos(float64 rFm);
40float64 float64_pow(float64 rFn, float64 rFm);
41float64 float64_pol(float64 rFn, float64 rFm);
42
43static float64 float64_rsf(float64 rFn, float64 rFm)
44{
45 return float64_sub(rFm, rFn);
46}
47
48static float64 float64_rdv(float64 rFn, float64 rFm)
49{
50 return float64_div(rFm, rFn);
51}
52
53static float64 (*const dyadic_double[16])(float64 rFn, float64 rFm) = {
54 [ADF_CODE >> 20] = float64_add,
55 [MUF_CODE >> 20] = float64_mul,
56 [SUF_CODE >> 20] = float64_sub,
57 [RSF_CODE >> 20] = float64_rsf,
58 [DVF_CODE >> 20] = float64_div,
59 [RDF_CODE >> 20] = float64_rdv,
60 [RMF_CODE >> 20] = float64_rem,
61
62 /* strictly, these opcodes should not be implemented */
63 [FML_CODE >> 20] = float64_mul,
64 [FDV_CODE >> 20] = float64_div,
65 [FRD_CODE >> 20] = float64_rdv,
66};
67
68static float64 float64_mvf(float64 rFm)
69{
70 return rFm;
71}
72
73static float64 float64_mnf(float64 rFm)
74{
75 union float64_components u;
76
77 u.f64 = rFm;
78#ifdef __ARMEB__
79 u.i[0] ^= 0x80000000;
80#else
81 u.i[1] ^= 0x80000000;
82#endif
83
84 return u.f64;
85}
86
87static float64 float64_abs(float64 rFm)
88{
89 union float64_components u;
90
91 u.f64 = rFm;
92#ifdef __ARMEB__
93 u.i[0] &= 0x7fffffff;
94#else
95 u.i[1] &= 0x7fffffff;
96#endif
97
98 return u.f64;
99}
100
101static float64 (*const monadic_double[16])(float64 rFm) = {
102 [MVF_CODE >> 20] = float64_mvf,
103 [MNF_CODE >> 20] = float64_mnf,
104 [ABS_CODE >> 20] = float64_abs,
105 [RND_CODE >> 20] = float64_round_to_int,
106 [URD_CODE >> 20] = float64_round_to_int,
107 [SQT_CODE >> 20] = float64_sqrt,
108 [NRM_CODE >> 20] = float64_mvf,
109};
110
111unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd)
112{
113 FPA11 *fpa11 = GET_FPA11();
114 float64 rFm;
115 unsigned int Fm, opc_mask_shift;
116
117 Fm = getFm(opcode);
118 if (CONSTANT_FM(opcode)) {
119 rFm = getDoubleConstant(Fm);
120 } else {
121 switch (fpa11->fType[Fm]) {
122 case typeSingle:
123 rFm = float32_to_float64(fpa11->fpreg[Fm].fSingle);
124 break;
125
126 case typeDouble:
127 rFm = fpa11->fpreg[Fm].fDouble;
128 break;
129
130 default:
131 return 0;
132 }
133 }
134
135 opc_mask_shift = (opcode & MASK_ARITHMETIC_OPCODE) >> 20;
136 if (!MONADIC_INSTRUCTION(opcode)) {
137 unsigned int Fn = getFn(opcode);
138 float64 rFn;
139
140 switch (fpa11->fType[Fn]) {
141 case typeSingle:
142 rFn = float32_to_float64(fpa11->fpreg[Fn].fSingle);
143 break;
144
145 case typeDouble:
146 rFn = fpa11->fpreg[Fn].fDouble;
147 break;
148
149 default:
150 return 0;
151 }
152
153 if (dyadic_double[opc_mask_shift]) {
154 rFd->fDouble = dyadic_double[opc_mask_shift](rFn, rFm);
155 } else {
156 return 0;
157 }
158 } else {
159 if (monadic_double[opc_mask_shift]) {
160 rFd->fDouble = monadic_double[opc_mask_shift](rFm);
161 } else {
162 return 0;
163 }
164 }
165
166 return 1;
167}
diff --git a/arch/arm/nwfpe/entry.S b/arch/arm/nwfpe/entry.S
new file mode 100644
index 000000000000..1dc13bc6d810
--- /dev/null
+++ b/arch/arm/nwfpe/entry.S
@@ -0,0 +1,119 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.COM, 1998
4 (c) 1998, 1999 Philip Blundell
5
6 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23/* This is the kernel's entry point into the floating point emulator.
24It is called from the kernel with code similar to this:
25
26 sub r4, r5, #4
27 ldrt r0, [r4] @ r0 = instruction
28 adrsvc al, r9, ret_from_exception @ r9 = normal FP return
29 adrsvc al, lr, fpundefinstr @ lr = undefined instr return
30
31 get_current_task r10
32 mov r8, #1
33 strb r8, [r10, #TSK_USED_MATH] @ set current->used_math
34 add r10, r10, #TSS_FPESAVE @ r10 = workspace
35 ldr r4, .LC2
36 ldr pc, [r4] @ Call FP emulator entry point
37
38The kernel expects the emulator to return via one of two possible
39points of return it passes to the emulator. The emulator, if
40successful in its emulation, jumps to ret_from_exception (passed in
41r9) and the kernel takes care of returning control from the trap to
42the user code. If the emulator is unable to emulate the instruction,
43it returns via _fpundefinstr (passed via lr) and the kernel halts the
44user program with a core dump.
45
46On entry to the emulator r10 points to an area of private FP workspace
47reserved in the thread structure for this process. This is where the
48emulator saves its registers across calls. The first word of this area
49is used as a flag to detect the first time a process uses floating point,
50so that the emulator startup cost can be avoided for tasks that don't
51want it.
52
53This routine does three things:
54
551) The kernel has created a struct pt_regs on the stack and saved the
56user registers into it. See /usr/include/asm/proc/ptrace.h for details.
57
582) It calls EmulateAll to emulate a floating point instruction.
59EmulateAll returns 1 if the emulation was successful, or 0 if not.
60
613) If an instruction has been emulated successfully, it looks ahead at
62the next instruction. If it is a floating point instruction, it
63executes the instruction, without returning to user space. In this
64way it repeatedly looks ahead and executes floating point instructions
65until it encounters a non floating point instruction, at which time it
66returns via _fpreturn.
67
68This is done to reduce the effect of the trap overhead on each
69floating point instructions. GCC attempts to group floating point
70instructions to allow the emulator to spread the cost of the trap over
71several floating point instructions. */
72
73 .globl nwfpe_enter
74nwfpe_enter:
75 mov r4, lr @ save the failure-return addresses
76 mov sl, sp @ we access the registers via 'sl'
77
78 ldr r5, [sp, #60] @ get contents of PC;
79emulate:
80 bl EmulateAll @ emulate the instruction
81 cmp r0, #0 @ was emulation successful
82 moveq pc, r4 @ no, return failure
83
84next:
85.Lx1: ldrt r6, [r5], #4 @ get the next instruction and
86 @ increment PC
87
88 and r2, r6, #0x0F000000 @ test for FP insns
89 teq r2, #0x0C000000
90 teqne r2, #0x0D000000
91 teqne r2, #0x0E000000
92 movne pc, r9 @ return ok if not a fp insn
93
94 str r5, [sp, #60] @ update PC copy in regs
95
96 mov r0, r6 @ save a copy
97 ldr r1, [sp, #64] @ fetch the condition codes
98 bl checkCondition @ check the condition
99 cmp r0, #0 @ r0 = 0 ==> condition failed
100
101 @ if condition code failed to match, next insn
102 beq next @ get the next instruction;
103
104 mov r0, r6 @ prepare for EmulateAll()
105 b emulate @ if r0 != 0, goto EmulateAll
106
107 @ We need to be prepared for the instructions at .Lx1 and .Lx2
108 @ to fault. Emit the appropriate exception gunk to fix things up.
109 @ ??? For some reason, faults can happen at .Lx2 even with a
110 @ plain LDR instruction. Weird, but it seems harmless.
111 .section .fixup,"ax"
112 .align 2
113.Lfix: mov pc, r9 @ let the user eat segfaults
114 .previous
115
116 .section __ex_table,"a"
117 .align 3
118 .long .Lx1, .Lfix
119 .previous
diff --git a/arch/arm/nwfpe/entry26.S b/arch/arm/nwfpe/entry26.S
new file mode 100644
index 000000000000..0ed38b0913db
--- /dev/null
+++ b/arch/arm/nwfpe/entry26.S
@@ -0,0 +1,112 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.COM, 1998
4 (c) Philip Blundell 1998-1999
5
6 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23#include <asm/constants.h>
24
25/* This is the kernel's entry point into the floating point emulator.
26It is called from the kernel with code similar to this:
27
28 mov fp, #0
29 teqp pc, #PSR_I_BIT | MODE_SVC
30 ldr r4, .LC2
31 ldr pc, [r4] @ Call FP module USR entry point
32
33The kernel expects the emulator to return via one of two possible
34points of return it passes to the emulator. The emulator, if
35successful in its emulation, jumps to ret_from_exception and the
36kernel takes care of returning control from the trap to the user code.
37If the emulator is unable to emulate the instruction, it returns to
38fpundefinstr and the kernel halts the user program with a core dump.
39
40This routine does four things:
41
421) It saves SP into a variable called userRegisters. The kernel has
43created a struct pt_regs on the stack and saved the user registers
44into it. See /usr/include/asm/proc/ptrace.h for details. The
45emulator code uses userRegisters as the base of an array of words from
46which the contents of the registers can be extracted.
47
482) It locates the FP emulator work area within the TSS structure and
49points `fpa11' to it.
50
513) It calls EmulateAll to emulate a floating point instruction.
52EmulateAll returns 1 if the emulation was successful, or 0 if not.
53
544) If an instruction has been emulated successfully, it looks ahead at
55the next instruction. If it is a floating point instruction, it
56executes the instruction, without returning to user space. In this
57way it repeatedly looks ahead and executes floating point instructions
58until it encounters a non floating point instruction, at which time it
59returns via _fpreturn.
60
61This is done to reduce the effect of the trap overhead on each
62floating point instructions. GCC attempts to group floating point
63instructions to allow the emulator to spread the cost of the trap over
64several floating point instructions. */
65
66 .globl nwfpe_enter
67nwfpe_enter:
68 mov sl, sp
69 ldr r5, [sp, #60] @ get contents of PC
70 bic r5, r5, #0xfc000003
71 ldr r0, [r5, #-4] @ get actual instruction into r0
72 bl EmulateAll @ emulate the instruction
731: cmp r0, #0 @ was emulation successful
74 beq fpundefinstr @ no, return failure
75
76next:
77.Lx1: ldrt r6, [r5], #4 @ get the next instruction and
78 @ increment PC
79
80 and r2, r6, #0x0F000000 @ test for FP insns
81 teq r2, #0x0C000000
82 teqne r2, #0x0D000000
83 teqne r2, #0x0E000000
84 bne ret_from_exception @ return ok if not a fp insn
85
86 ldr r9, [sp, #60] @ get new condition codes
87 and r9, r9, #0xfc000003
88 orr r7, r5, r9
89 str r7, [sp, #60] @ update PC copy in regs
90
91 mov r0, r6 @ save a copy
92 mov r1, r9 @ fetch the condition codes
93 bl checkCondition @ check the condition
94 cmp r0, #0 @ r0 = 0 ==> condition failed
95
96 @ if condition code failed to match, next insn
97 beq next @ get the next instruction;
98
99 mov r0, r6 @ prepare for EmulateAll()
100 adr lr, 1b
101 orr lr, lr, #3
102 b EmulateAll @ if r0 != 0, goto EmulateAll
103
104.Lret: b ret_from_exception @ let the user eat segfaults
105
106 @ We need to be prepared for the instruction at .Lx1 to fault.
107 @ Emit the appropriate exception gunk to fix things up.
108 .section __ex_table,"a"
109 .align 3
110 .long .Lx1
111 ldr lr, [lr, $(.Lret - .Lx1)/4]
112 .previous
diff --git a/arch/arm/nwfpe/extended_cpdo.c b/arch/arm/nwfpe/extended_cpdo.c
new file mode 100644
index 000000000000..c39f68a3449e
--- /dev/null
+++ b/arch/arm/nwfpe/extended_cpdo.c
@@ -0,0 +1,154 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.COM, 1998,1999
4
5 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (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., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#include "fpa11.h"
23#include "softfloat.h"
24#include "fpopcode.h"
25
26floatx80 floatx80_exp(floatx80 Fm);
27floatx80 floatx80_ln(floatx80 Fm);
28floatx80 floatx80_sin(floatx80 rFm);
29floatx80 floatx80_cos(floatx80 rFm);
30floatx80 floatx80_arcsin(floatx80 rFm);
31floatx80 floatx80_arctan(floatx80 rFm);
32floatx80 floatx80_log(floatx80 rFm);
33floatx80 floatx80_tan(floatx80 rFm);
34floatx80 floatx80_arccos(floatx80 rFm);
35floatx80 floatx80_pow(floatx80 rFn, floatx80 rFm);
36floatx80 floatx80_pol(floatx80 rFn, floatx80 rFm);
37
38static floatx80 floatx80_rsf(floatx80 rFn, floatx80 rFm)
39{
40 return floatx80_sub(rFm, rFn);
41}
42
43static floatx80 floatx80_rdv(floatx80 rFn, floatx80 rFm)
44{
45 return floatx80_div(rFm, rFn);
46}
47
48static floatx80 (*const dyadic_extended[16])(floatx80 rFn, floatx80 rFm) = {
49 [ADF_CODE >> 20] = floatx80_add,
50 [MUF_CODE >> 20] = floatx80_mul,
51 [SUF_CODE >> 20] = floatx80_sub,
52 [RSF_CODE >> 20] = floatx80_rsf,
53 [DVF_CODE >> 20] = floatx80_div,
54 [RDF_CODE >> 20] = floatx80_rdv,
55 [RMF_CODE >> 20] = floatx80_rem,
56
57 /* strictly, these opcodes should not be implemented */
58 [FML_CODE >> 20] = floatx80_mul,
59 [FDV_CODE >> 20] = floatx80_div,
60 [FRD_CODE >> 20] = floatx80_rdv,
61};
62
63static floatx80 floatx80_mvf(floatx80 rFm)
64{
65 return rFm;
66}
67
68static floatx80 floatx80_mnf(floatx80 rFm)
69{
70 rFm.high ^= 0x8000;
71 return rFm;
72}
73
74static floatx80 floatx80_abs(floatx80 rFm)
75{
76 rFm.high &= 0x7fff;
77 return rFm;
78}
79
80static floatx80 (*const monadic_extended[16])(floatx80 rFm) = {
81 [MVF_CODE >> 20] = floatx80_mvf,
82 [MNF_CODE >> 20] = floatx80_mnf,
83 [ABS_CODE >> 20] = floatx80_abs,
84 [RND_CODE >> 20] = floatx80_round_to_int,
85 [URD_CODE >> 20] = floatx80_round_to_int,
86 [SQT_CODE >> 20] = floatx80_sqrt,
87 [NRM_CODE >> 20] = floatx80_mvf,
88};
89
90unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd)
91{
92 FPA11 *fpa11 = GET_FPA11();
93 floatx80 rFm;
94 unsigned int Fm, opc_mask_shift;
95
96 Fm = getFm(opcode);
97 if (CONSTANT_FM(opcode)) {
98 rFm = getExtendedConstant(Fm);
99 } else {
100 switch (fpa11->fType[Fm]) {
101 case typeSingle:
102 rFm = float32_to_floatx80(fpa11->fpreg[Fm].fSingle);
103 break;
104
105 case typeDouble:
106 rFm = float64_to_floatx80(fpa11->fpreg[Fm].fDouble);
107 break;
108
109 case typeExtended:
110 rFm = fpa11->fpreg[Fm].fExtended;
111 break;
112
113 default:
114 return 0;
115 }
116 }
117
118 opc_mask_shift = (opcode & MASK_ARITHMETIC_OPCODE) >> 20;
119 if (!MONADIC_INSTRUCTION(opcode)) {
120 unsigned int Fn = getFn(opcode);
121 floatx80 rFn;
122
123 switch (fpa11->fType[Fn]) {
124 case typeSingle:
125 rFn = float32_to_floatx80(fpa11->fpreg[Fn].fSingle);
126 break;
127
128 case typeDouble:
129 rFn = float64_to_floatx80(fpa11->fpreg[Fn].fDouble);
130 break;
131
132 case typeExtended:
133 rFn = fpa11->fpreg[Fn].fExtended;
134 break;
135
136 default:
137 return 0;
138 }
139
140 if (dyadic_extended[opc_mask_shift]) {
141 rFd->fExtended = dyadic_extended[opc_mask_shift](rFn, rFm);
142 } else {
143 return 0;
144 }
145 } else {
146 if (monadic_extended[opc_mask_shift]) {
147 rFd->fExtended = monadic_extended[opc_mask_shift](rFm);
148 } else {
149 return 0;
150 }
151 }
152
153 return 1;
154}
diff --git a/arch/arm/nwfpe/fpa11.c b/arch/arm/nwfpe/fpa11.c
new file mode 100644
index 000000000000..bf61696865ec
--- /dev/null
+++ b/arch/arm/nwfpe/fpa11.c
@@ -0,0 +1,143 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.COM, 1998,1999
4 (c) Philip Blundell, 2001
5
6 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23#include "fpa11.h"
24#include "fpopcode.h"
25
26#include "fpmodule.h"
27#include "fpmodule.inl"
28
29#include <linux/config.h>
30#include <linux/compiler.h>
31#include <linux/string.h>
32#include <asm/system.h>
33
34/* forward declarations */
35unsigned int EmulateCPDO(const unsigned int);
36unsigned int EmulateCPDT(const unsigned int);
37unsigned int EmulateCPRT(const unsigned int);
38
39/* Reset the FPA11 chip. Called to initialize and reset the emulator. */
40static void resetFPA11(void)
41{
42 int i;
43 FPA11 *fpa11 = GET_FPA11();
44
45 /* initialize the register type array */
46 for (i = 0; i <= 7; i++) {
47 fpa11->fType[i] = typeNone;
48 }
49
50 /* FPSR: set system id to FP_EMULATOR, set AC, clear all other bits */
51 fpa11->fpsr = FP_EMULATOR | BIT_AC;
52}
53
54void SetRoundingMode(const unsigned int opcode)
55{
56 switch (opcode & MASK_ROUNDING_MODE) {
57 default:
58 case ROUND_TO_NEAREST:
59 float_rounding_mode = float_round_nearest_even;
60 break;
61
62 case ROUND_TO_PLUS_INFINITY:
63 float_rounding_mode = float_round_up;
64 break;
65
66 case ROUND_TO_MINUS_INFINITY:
67 float_rounding_mode = float_round_down;
68 break;
69
70 case ROUND_TO_ZERO:
71 float_rounding_mode = float_round_to_zero;
72 break;
73 }
74}
75
76void SetRoundingPrecision(const unsigned int opcode)
77{
78#ifdef CONFIG_FPE_NWFPE_XP
79 switch (opcode & MASK_ROUNDING_PRECISION) {
80 case ROUND_SINGLE:
81 floatx80_rounding_precision = 32;
82 break;
83
84 case ROUND_DOUBLE:
85 floatx80_rounding_precision = 64;
86 break;
87
88 case ROUND_EXTENDED:
89 floatx80_rounding_precision = 80;
90 break;
91
92 default:
93 floatx80_rounding_precision = 80;
94 }
95#endif
96}
97
98void nwfpe_init_fpa(union fp_state *fp)
99{
100 FPA11 *fpa11 = (FPA11 *)fp;
101#ifdef NWFPE_DEBUG
102 printk("NWFPE: setting up state.\n");
103#endif
104 memset(fpa11, 0, sizeof(FPA11));
105 resetFPA11();
106 SetRoundingMode(ROUND_TO_NEAREST);
107 SetRoundingPrecision(ROUND_EXTENDED);
108 fpa11->initflag = 1;
109}
110
111/* Emulate the instruction in the opcode. */
112unsigned int EmulateAll(unsigned int opcode)
113{
114 unsigned int code;
115
116#ifdef NWFPE_DEBUG
117 printk("NWFPE: emulating opcode %08x\n", opcode);
118#endif
119 code = opcode & 0x00000f00;
120 if (code == 0x00000100 || code == 0x00000200) {
121 /* For coprocessor 1 or 2 (FPA11) */
122 code = opcode & 0x0e000000;
123 if (code == 0x0e000000) {
124 if (opcode & 0x00000010) {
125 /* Emulate conversion opcodes. */
126 /* Emulate register transfer opcodes. */
127 /* Emulate comparison opcodes. */
128 return EmulateCPRT(opcode);
129 } else {
130 /* Emulate monadic arithmetic opcodes. */
131 /* Emulate dyadic arithmetic opcodes. */
132 return EmulateCPDO(opcode);
133 }
134 } else if (code == 0x0c000000) {
135 /* Emulate load/store opcodes. */
136 /* Emulate load/store multiple opcodes. */
137 return EmulateCPDT(opcode);
138 }
139 }
140
141 /* Invalid instruction detected. Return FALSE. */
142 return 0;
143}
diff --git a/arch/arm/nwfpe/fpa11.h b/arch/arm/nwfpe/fpa11.h
new file mode 100644
index 000000000000..45cc65426a22
--- /dev/null
+++ b/arch/arm/nwfpe/fpa11.h
@@ -0,0 +1,93 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.com, 1998-1999
4
5 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (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., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#ifndef __FPA11_H__
23#define __FPA11_H__
24
25#define GET_FPA11() ((FPA11 *)(&current_thread_info()->fpstate))
26
27/*
28 * The processes registers are always at the very top of the 8K
29 * stack+task struct. Use the same method as 'current' uses to
30 * reach them.
31 */
32register unsigned long *user_registers asm("sl");
33
34#define GET_USERREG() (user_registers)
35
36#include <linux/config.h>
37#include <linux/thread_info.h>
38
39/* includes */
40#include "fpsr.h" /* FP control and status register definitions */
41#include "milieu.h"
42#include "softfloat.h"
43
44#define typeNone 0x00
45#define typeSingle 0x01
46#define typeDouble 0x02
47#define typeExtended 0x03
48
49/*
50 * This must be no more and no less than 12 bytes.
51 */
52typedef union tagFPREG {
53 float32 fSingle;
54 float64 fDouble;
55#ifdef CONFIG_FPE_NWFPE_XP
56 floatx80 fExtended;
57#else
58 int padding[3];
59#endif
60} FPREG;
61
62/*
63 * FPA11 device model.
64 *
65 * This structure is exported to user space. Do not re-order.
66 * Only add new stuff to the end, and do not change the size of
67 * any element. Elements of this structure are used by user
68 * space, and must match struct user_fp in include/asm-arm/user.h.
69 * We include the byte offsets below for documentation purposes.
70 *
71 * The size of this structure and FPREG are checked by fpmodule.c
72 * on initialisation. If the rules have been broken, NWFPE will
73 * not initialise.
74 */
75typedef struct tagFPA11 {
76/* 0 */ FPREG fpreg[8]; /* 8 floating point registers */
77/* 96 */ FPSR fpsr; /* floating point status register */
78/* 100 */ FPCR fpcr; /* floating point control register */
79/* 104 */ unsigned char fType[8]; /* type of floating point value held in
80 floating point registers. One of
81 none, single, double or extended. */
82/* 112 */ int initflag; /* this is special. The kernel guarantees
83 to set it to 0 when a thread is launched,
84 so we can use it to detect whether this
85 instance of the emulator needs to be
86 initialised. */
87} FPA11;
88
89extern void SetRoundingMode(const unsigned int);
90extern void SetRoundingPrecision(const unsigned int);
91extern void nwfpe_init_fpa(union fp_state *fp);
92
93#endif
diff --git a/arch/arm/nwfpe/fpa11.inl b/arch/arm/nwfpe/fpa11.inl
new file mode 100644
index 000000000000..10c3caf2868f
--- /dev/null
+++ b/arch/arm/nwfpe/fpa11.inl
@@ -0,0 +1,51 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.COM, 1998,1999
4
5 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (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., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#include "fpa11.h"
23
24/* Read and write floating point status register */
25extern __inline__ unsigned int readFPSR(void)
26{
27 FPA11 *fpa11 = GET_FPA11();
28 return (fpa11->fpsr);
29}
30
31extern __inline__ void writeFPSR(FPSR reg)
32{
33 FPA11 *fpa11 = GET_FPA11();
34 /* the sysid byte in the status register is readonly */
35 fpa11->fpsr = (fpa11->fpsr & MASK_SYSID) | (reg & ~MASK_SYSID);
36}
37
38/* Read and write floating point control register */
39extern __inline__ FPCR readFPCR(void)
40{
41 FPA11 *fpa11 = GET_FPA11();
42 /* clear SB, AB and DA bits before returning FPCR */
43 return (fpa11->fpcr & ~MASK_RFC);
44}
45
46extern __inline__ void writeFPCR(FPCR reg)
47{
48 FPA11 *fpa11 = GET_FPA11();
49 fpa11->fpcr &= ~MASK_WFC; /* clear SB, AB and DA bits */
50 fpa11->fpcr |= (reg & MASK_WFC); /* write SB, AB and DA bits */
51}
diff --git a/arch/arm/nwfpe/fpa11_cpdo.c b/arch/arm/nwfpe/fpa11_cpdo.c
new file mode 100644
index 000000000000..1bea67437b6f
--- /dev/null
+++ b/arch/arm/nwfpe/fpa11_cpdo.c
@@ -0,0 +1,132 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.COM, 1998,1999
4 (c) Philip Blundell, 2001
5
6 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23#include <linux/config.h>
24#include "fpa11.h"
25#include "fpopcode.h"
26
27unsigned int SingleCPDO(const unsigned int opcode, FPREG * rFd);
28unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd);
29unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd);
30
31unsigned int EmulateCPDO(const unsigned int opcode)
32{
33 FPA11 *fpa11 = GET_FPA11();
34 FPREG *rFd;
35 unsigned int nType, nDest, nRc;
36
37 /* Get the destination size. If not valid let Linux perform
38 an invalid instruction trap. */
39 nDest = getDestinationSize(opcode);
40 if (typeNone == nDest)
41 return 0;
42
43 SetRoundingMode(opcode);
44
45 /* Compare the size of the operands in Fn and Fm.
46 Choose the largest size and perform operations in that size,
47 in order to make use of all the precision of the operands.
48 If Fm is a constant, we just grab a constant of a size
49 matching the size of the operand in Fn. */
50 if (MONADIC_INSTRUCTION(opcode))
51 nType = nDest;
52 else
53 nType = fpa11->fType[getFn(opcode)];
54
55 if (!CONSTANT_FM(opcode)) {
56 register unsigned int Fm = getFm(opcode);
57 if (nType < fpa11->fType[Fm]) {
58 nType = fpa11->fType[Fm];
59 }
60 }
61
62 rFd = &fpa11->fpreg[getFd(opcode)];
63
64 switch (nType) {
65 case typeSingle:
66 nRc = SingleCPDO(opcode, rFd);
67 break;
68 case typeDouble:
69 nRc = DoubleCPDO(opcode, rFd);
70 break;
71#ifdef CONFIG_FPE_NWFPE_XP
72 case typeExtended:
73 nRc = ExtendedCPDO(opcode, rFd);
74 break;
75#endif
76 default:
77 nRc = 0;
78 }
79
80 /* The CPDO functions used to always set the destination type
81 to be the same as their working size. */
82
83 if (nRc != 0) {
84 /* If the operation succeeded, check to see if the result in the
85 destination register is the correct size. If not force it
86 to be. */
87
88 fpa11->fType[getFd(opcode)] = nDest;
89
90#ifdef CONFIG_FPE_NWFPE_XP
91 if (nDest != nType) {
92 switch (nDest) {
93 case typeSingle:
94 {
95 if (typeDouble == nType)
96 rFd->fSingle = float64_to_float32(rFd->fDouble);
97 else
98 rFd->fSingle = floatx80_to_float32(rFd->fExtended);
99 }
100 break;
101
102 case typeDouble:
103 {
104 if (typeSingle == nType)
105 rFd->fDouble = float32_to_float64(rFd->fSingle);
106 else
107 rFd->fDouble = floatx80_to_float64(rFd->fExtended);
108 }
109 break;
110
111 case typeExtended:
112 {
113 if (typeSingle == nType)
114 rFd->fExtended = float32_to_floatx80(rFd->fSingle);
115 else
116 rFd->fExtended = float64_to_floatx80(rFd->fDouble);
117 }
118 break;
119 }
120 }
121#else
122 if (nDest != nType) {
123 if (nDest == typeSingle)
124 rFd->fSingle = float64_to_float32(rFd->fDouble);
125 else
126 rFd->fDouble = float32_to_float64(rFd->fSingle);
127 }
128#endif
129 }
130
131 return nRc;
132}
diff --git a/arch/arm/nwfpe/fpa11_cpdt.c b/arch/arm/nwfpe/fpa11_cpdt.c
new file mode 100644
index 000000000000..95fb63fa9d18
--- /dev/null
+++ b/arch/arm/nwfpe/fpa11_cpdt.c
@@ -0,0 +1,392 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.com, 1998-1999
4 (c) Philip Blundell, 1998, 2001
5
6 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23#include <linux/config.h>
24#include "fpa11.h"
25#include "softfloat.h"
26#include "fpopcode.h"
27#include "fpmodule.h"
28#include "fpmodule.inl"
29
30#include <asm/uaccess.h>
31
32static inline void loadSingle(const unsigned int Fn, const unsigned int __user *pMem)
33{
34 FPA11 *fpa11 = GET_FPA11();
35 fpa11->fType[Fn] = typeSingle;
36 get_user(fpa11->fpreg[Fn].fSingle, pMem);
37}
38
39static inline void loadDouble(const unsigned int Fn, const unsigned int __user *pMem)
40{
41 FPA11 *fpa11 = GET_FPA11();
42 unsigned int *p;
43 p = (unsigned int *) &fpa11->fpreg[Fn].fDouble;
44 fpa11->fType[Fn] = typeDouble;
45#ifdef __ARMEB__
46 get_user(p[0], &pMem[0]); /* sign & exponent */
47 get_user(p[1], &pMem[1]);
48#else
49 get_user(p[0], &pMem[1]);
50 get_user(p[1], &pMem[0]); /* sign & exponent */
51#endif
52}
53
54#ifdef CONFIG_FPE_NWFPE_XP
55static inline void loadExtended(const unsigned int Fn, const unsigned int __user *pMem)
56{
57 FPA11 *fpa11 = GET_FPA11();
58 unsigned int *p;
59 p = (unsigned int *) &fpa11->fpreg[Fn].fExtended;
60 fpa11->fType[Fn] = typeExtended;
61 get_user(p[0], &pMem[0]); /* sign & exponent */
62 get_user(p[1], &pMem[2]); /* ls bits */
63 get_user(p[2], &pMem[1]); /* ms bits */
64}
65#endif
66
67static inline void loadMultiple(const unsigned int Fn, const unsigned int __user *pMem)
68{
69 FPA11 *fpa11 = GET_FPA11();
70 register unsigned int *p;
71 unsigned long x;
72
73 p = (unsigned int *) &(fpa11->fpreg[Fn]);
74 get_user(x, &pMem[0]);
75 fpa11->fType[Fn] = (x >> 14) & 0x00000003;
76
77 switch (fpa11->fType[Fn]) {
78 case typeSingle:
79 case typeDouble:
80 {
81 get_user(p[0], &pMem[2]); /* Single */
82 get_user(p[1], &pMem[1]); /* double msw */
83 p[2] = 0; /* empty */
84 }
85 break;
86
87#ifdef CONFIG_FPE_NWFPE_XP
88 case typeExtended:
89 {
90 get_user(p[1], &pMem[2]);
91 get_user(p[2], &pMem[1]); /* msw */
92 p[0] = (x & 0x80003fff);
93 }
94 break;
95#endif
96 }
97}
98
99static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem)
100{
101 FPA11 *fpa11 = GET_FPA11();
102 union {
103 float32 f;
104 unsigned int i[1];
105 } val;
106
107 switch (fpa11->fType[Fn]) {
108 case typeDouble:
109 val.f = float64_to_float32(fpa11->fpreg[Fn].fDouble);
110 break;
111
112#ifdef CONFIG_FPE_NWFPE_XP
113 case typeExtended:
114 val.f = floatx80_to_float32(fpa11->fpreg[Fn].fExtended);
115 break;
116#endif
117
118 default:
119 val.f = fpa11->fpreg[Fn].fSingle;
120 }
121
122 put_user(val.i[0], pMem);
123}
124
125static inline void storeDouble(const unsigned int Fn, unsigned int __user *pMem)
126{
127 FPA11 *fpa11 = GET_FPA11();
128 union {
129 float64 f;
130 unsigned int i[2];
131 } val;
132
133 switch (fpa11->fType[Fn]) {
134 case typeSingle:
135 val.f = float32_to_float64(fpa11->fpreg[Fn].fSingle);
136 break;
137
138#ifdef CONFIG_FPE_NWFPE_XP
139 case typeExtended:
140 val.f = floatx80_to_float64(fpa11->fpreg[Fn].fExtended);
141 break;
142#endif
143
144 default:
145 val.f = fpa11->fpreg[Fn].fDouble;
146 }
147
148#ifdef __ARMEB__
149 put_user(val.i[0], &pMem[0]); /* msw */
150 put_user(val.i[1], &pMem[1]); /* lsw */
151#else
152 put_user(val.i[1], &pMem[0]); /* msw */
153 put_user(val.i[0], &pMem[1]); /* lsw */
154#endif
155}
156
157#ifdef CONFIG_FPE_NWFPE_XP
158static inline void storeExtended(const unsigned int Fn, unsigned int __user *pMem)
159{
160 FPA11 *fpa11 = GET_FPA11();
161 union {
162 floatx80 f;
163 unsigned int i[3];
164 } val;
165
166 switch (fpa11->fType[Fn]) {
167 case typeSingle:
168 val.f = float32_to_floatx80(fpa11->fpreg[Fn].fSingle);
169 break;
170
171 case typeDouble:
172 val.f = float64_to_floatx80(fpa11->fpreg[Fn].fDouble);
173 break;
174
175 default:
176 val.f = fpa11->fpreg[Fn].fExtended;
177 }
178
179 put_user(val.i[0], &pMem[0]); /* sign & exp */
180 put_user(val.i[1], &pMem[2]);
181 put_user(val.i[2], &pMem[1]); /* msw */
182}
183#endif
184
185static inline void storeMultiple(const unsigned int Fn, unsigned int __user *pMem)
186{
187 FPA11 *fpa11 = GET_FPA11();
188 register unsigned int nType, *p;
189
190 p = (unsigned int *) &(fpa11->fpreg[Fn]);
191 nType = fpa11->fType[Fn];
192
193 switch (nType) {
194 case typeSingle:
195 case typeDouble:
196 {
197 put_user(p[0], &pMem[2]); /* single */
198 put_user(p[1], &pMem[1]); /* double msw */
199 put_user(nType << 14, &pMem[0]);
200 }
201 break;
202
203#ifdef CONFIG_FPE_NWFPE_XP
204 case typeExtended:
205 {
206 put_user(p[2], &pMem[1]); /* msw */
207 put_user(p[1], &pMem[2]);
208 put_user((p[0] & 0x80003fff) | (nType << 14), &pMem[0]);
209 }
210 break;
211#endif
212 }
213}
214
215unsigned int PerformLDF(const unsigned int opcode)
216{
217 unsigned int __user *pBase, *pAddress, *pFinal;
218 unsigned int nRc = 1, write_back = WRITE_BACK(opcode);
219
220 pBase = (unsigned int __user *) readRegister(getRn(opcode));
221 if (REG_PC == getRn(opcode)) {
222 pBase += 2;
223 write_back = 0;
224 }
225
226 pFinal = pBase;
227 if (BIT_UP_SET(opcode))
228 pFinal += getOffset(opcode);
229 else
230 pFinal -= getOffset(opcode);
231
232 if (PREINDEXED(opcode))
233 pAddress = pFinal;
234 else
235 pAddress = pBase;
236
237 switch (opcode & MASK_TRANSFER_LENGTH) {
238 case TRANSFER_SINGLE:
239 loadSingle(getFd(opcode), pAddress);
240 break;
241 case TRANSFER_DOUBLE:
242 loadDouble(getFd(opcode), pAddress);
243 break;
244#ifdef CONFIG_FPE_NWFPE_XP
245 case TRANSFER_EXTENDED:
246 loadExtended(getFd(opcode), pAddress);
247 break;
248#endif
249 default:
250 nRc = 0;
251 }
252
253 if (write_back)
254 writeRegister(getRn(opcode), (unsigned long) pFinal);
255 return nRc;
256}
257
258unsigned int PerformSTF(const unsigned int opcode)
259{
260 unsigned int __user *pBase, *pAddress, *pFinal;
261 unsigned int nRc = 1, write_back = WRITE_BACK(opcode);
262
263 SetRoundingMode(ROUND_TO_NEAREST);
264
265 pBase = (unsigned int __user *) readRegister(getRn(opcode));
266 if (REG_PC == getRn(opcode)) {
267 pBase += 2;
268 write_back = 0;
269 }
270
271 pFinal = pBase;
272 if (BIT_UP_SET(opcode))
273 pFinal += getOffset(opcode);
274 else
275 pFinal -= getOffset(opcode);
276
277 if (PREINDEXED(opcode))
278 pAddress = pFinal;
279 else
280 pAddress = pBase;
281
282 switch (opcode & MASK_TRANSFER_LENGTH) {
283 case TRANSFER_SINGLE:
284 storeSingle(getFd(opcode), pAddress);
285 break;
286 case TRANSFER_DOUBLE:
287 storeDouble(getFd(opcode), pAddress);
288 break;
289#ifdef CONFIG_FPE_NWFPE_XP
290 case TRANSFER_EXTENDED:
291 storeExtended(getFd(opcode), pAddress);
292 break;
293#endif
294 default:
295 nRc = 0;
296 }
297
298 if (write_back)
299 writeRegister(getRn(opcode), (unsigned long) pFinal);
300 return nRc;
301}
302
303unsigned int PerformLFM(const unsigned int opcode)
304{
305 unsigned int __user *pBase, *pAddress, *pFinal;
306 unsigned int i, Fd, write_back = WRITE_BACK(opcode);
307
308 pBase = (unsigned int __user *) readRegister(getRn(opcode));
309 if (REG_PC == getRn(opcode)) {
310 pBase += 2;
311 write_back = 0;
312 }
313
314 pFinal = pBase;
315 if (BIT_UP_SET(opcode))
316 pFinal += getOffset(opcode);
317 else
318 pFinal -= getOffset(opcode);
319
320 if (PREINDEXED(opcode))
321 pAddress = pFinal;
322 else
323 pAddress = pBase;
324
325 Fd = getFd(opcode);
326 for (i = getRegisterCount(opcode); i > 0; i--) {
327 loadMultiple(Fd, pAddress);
328 pAddress += 3;
329 Fd++;
330 if (Fd == 8)
331 Fd = 0;
332 }
333
334 if (write_back)
335 writeRegister(getRn(opcode), (unsigned long) pFinal);
336 return 1;
337}
338
339unsigned int PerformSFM(const unsigned int opcode)
340{
341 unsigned int __user *pBase, *pAddress, *pFinal;
342 unsigned int i, Fd, write_back = WRITE_BACK(opcode);
343
344 pBase = (unsigned int __user *) readRegister(getRn(opcode));
345 if (REG_PC == getRn(opcode)) {
346 pBase += 2;
347 write_back = 0;
348 }
349
350 pFinal = pBase;
351 if (BIT_UP_SET(opcode))
352 pFinal += getOffset(opcode);
353 else
354 pFinal -= getOffset(opcode);
355
356 if (PREINDEXED(opcode))
357 pAddress = pFinal;
358 else
359 pAddress = pBase;
360
361 Fd = getFd(opcode);
362 for (i = getRegisterCount(opcode); i > 0; i--) {
363 storeMultiple(Fd, pAddress);
364 pAddress += 3;
365 Fd++;
366 if (Fd == 8)
367 Fd = 0;
368 }
369
370 if (write_back)
371 writeRegister(getRn(opcode), (unsigned long) pFinal);
372 return 1;
373}
374
375unsigned int EmulateCPDT(const unsigned int opcode)
376{
377 unsigned int nRc = 0;
378
379 if (LDF_OP(opcode)) {
380 nRc = PerformLDF(opcode);
381 } else if (LFM_OP(opcode)) {
382 nRc = PerformLFM(opcode);
383 } else if (STF_OP(opcode)) {
384 nRc = PerformSTF(opcode);
385 } else if (SFM_OP(opcode)) {
386 nRc = PerformSFM(opcode);
387 } else {
388 nRc = 0;
389 }
390
391 return nRc;
392}
diff --git a/arch/arm/nwfpe/fpa11_cprt.c b/arch/arm/nwfpe/fpa11_cprt.c
new file mode 100644
index 000000000000..db01fbc97216
--- /dev/null
+++ b/arch/arm/nwfpe/fpa11_cprt.c
@@ -0,0 +1,369 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.COM, 1998,1999
4 (c) Philip Blundell, 1999, 2001
5
6 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23#include <linux/config.h>
24#include "fpa11.h"
25#include "fpopcode.h"
26#include "fpa11.inl"
27#include "fpmodule.h"
28#include "fpmodule.inl"
29
30#ifdef CONFIG_FPE_NWFPE_XP
31extern flag floatx80_is_nan(floatx80);
32#endif
33extern flag float64_is_nan(float64);
34extern flag float32_is_nan(float32);
35
36void SetRoundingMode(const unsigned int opcode);
37
38unsigned int PerformFLT(const unsigned int opcode);
39unsigned int PerformFIX(const unsigned int opcode);
40
41static unsigned int PerformComparison(const unsigned int opcode);
42
43unsigned int EmulateCPRT(const unsigned int opcode)
44{
45
46 if (opcode & 0x800000) {
47 /* This is some variant of a comparison (PerformComparison
48 will sort out which one). Since most of the other CPRT
49 instructions are oddball cases of some sort or other it
50 makes sense to pull this out into a fast path. */
51 return PerformComparison(opcode);
52 }
53
54 /* Hint to GCC that we'd like a jump table rather than a load of CMPs */
55 switch ((opcode & 0x700000) >> 20) {
56 case FLT_CODE >> 20:
57 return PerformFLT(opcode);
58 break;
59 case FIX_CODE >> 20:
60 return PerformFIX(opcode);
61 break;
62
63 case WFS_CODE >> 20:
64 writeFPSR(readRegister(getRd(opcode)));
65 break;
66 case RFS_CODE >> 20:
67 writeRegister(getRd(opcode), readFPSR());
68 break;
69
70 default:
71 return 0;
72 }
73
74 return 1;
75}
76
77unsigned int PerformFLT(const unsigned int opcode)
78{
79 FPA11 *fpa11 = GET_FPA11();
80 SetRoundingMode(opcode);
81 SetRoundingPrecision(opcode);
82
83 switch (opcode & MASK_ROUNDING_PRECISION) {
84 case ROUND_SINGLE:
85 {
86 fpa11->fType[getFn(opcode)] = typeSingle;
87 fpa11->fpreg[getFn(opcode)].fSingle = int32_to_float32(readRegister(getRd(opcode)));
88 }
89 break;
90
91 case ROUND_DOUBLE:
92 {
93 fpa11->fType[getFn(opcode)] = typeDouble;
94 fpa11->fpreg[getFn(opcode)].fDouble = int32_to_float64(readRegister(getRd(opcode)));
95 }
96 break;
97
98#ifdef CONFIG_FPE_NWFPE_XP
99 case ROUND_EXTENDED:
100 {
101 fpa11->fType[getFn(opcode)] = typeExtended;
102 fpa11->fpreg[getFn(opcode)].fExtended = int32_to_floatx80(readRegister(getRd(opcode)));
103 }
104 break;
105#endif
106
107 default:
108 return 0;
109 }
110
111 return 1;
112}
113
114unsigned int PerformFIX(const unsigned int opcode)
115{
116 FPA11 *fpa11 = GET_FPA11();
117 unsigned int Fn = getFm(opcode);
118
119 SetRoundingMode(opcode);
120
121 switch (fpa11->fType[Fn]) {
122 case typeSingle:
123 {
124 writeRegister(getRd(opcode), float32_to_int32(fpa11->fpreg[Fn].fSingle));
125 }
126 break;
127
128 case typeDouble:
129 {
130 writeRegister(getRd(opcode), float64_to_int32(fpa11->fpreg[Fn].fDouble));
131 }
132 break;
133
134#ifdef CONFIG_FPE_NWFPE_XP
135 case typeExtended:
136 {
137 writeRegister(getRd(opcode), floatx80_to_int32(fpa11->fpreg[Fn].fExtended));
138 }
139 break;
140#endif
141
142 default:
143 return 0;
144 }
145
146 return 1;
147}
148
149/* This instruction sets the flags N, Z, C, V in the FPSR. */
150static unsigned int PerformComparison(const unsigned int opcode)
151{
152 FPA11 *fpa11 = GET_FPA11();
153 unsigned int Fn = getFn(opcode), Fm = getFm(opcode);
154 int e_flag = opcode & 0x400000; /* 1 if CxFE */
155 int n_flag = opcode & 0x200000; /* 1 if CNxx */
156 unsigned int flags = 0;
157
158#ifdef CONFIG_FPE_NWFPE_XP
159 floatx80 rFn, rFm;
160
161 /* Check for unordered condition and convert all operands to 80-bit
162 format.
163 ?? Might be some mileage in avoiding this conversion if possible.
164 Eg, if both operands are 32-bit, detect this and do a 32-bit
165 comparison (cheaper than an 80-bit one). */
166 switch (fpa11->fType[Fn]) {
167 case typeSingle:
168 //printk("single.\n");
169 if (float32_is_nan(fpa11->fpreg[Fn].fSingle))
170 goto unordered;
171 rFn = float32_to_floatx80(fpa11->fpreg[Fn].fSingle);
172 break;
173
174 case typeDouble:
175 //printk("double.\n");
176 if (float64_is_nan(fpa11->fpreg[Fn].fDouble))
177 goto unordered;
178 rFn = float64_to_floatx80(fpa11->fpreg[Fn].fDouble);
179 break;
180
181 case typeExtended:
182 //printk("extended.\n");
183 if (floatx80_is_nan(fpa11->fpreg[Fn].fExtended))
184 goto unordered;
185 rFn = fpa11->fpreg[Fn].fExtended;
186 break;
187
188 default:
189 return 0;
190 }
191
192 if (CONSTANT_FM(opcode)) {
193 //printk("Fm is a constant: #%d.\n",Fm);
194 rFm = getExtendedConstant(Fm);
195 if (floatx80_is_nan(rFm))
196 goto unordered;
197 } else {
198 //printk("Fm = r%d which contains a ",Fm);
199 switch (fpa11->fType[Fm]) {
200 case typeSingle:
201 //printk("single.\n");
202 if (float32_is_nan(fpa11->fpreg[Fm].fSingle))
203 goto unordered;
204 rFm = float32_to_floatx80(fpa11->fpreg[Fm].fSingle);
205 break;
206
207 case typeDouble:
208 //printk("double.\n");
209 if (float64_is_nan(fpa11->fpreg[Fm].fDouble))
210 goto unordered;
211 rFm = float64_to_floatx80(fpa11->fpreg[Fm].fDouble);
212 break;
213
214 case typeExtended:
215 //printk("extended.\n");
216 if (floatx80_is_nan(fpa11->fpreg[Fm].fExtended))
217 goto unordered;
218 rFm = fpa11->fpreg[Fm].fExtended;
219 break;
220
221 default:
222 return 0;
223 }
224 }
225
226 if (n_flag)
227 rFm.high ^= 0x8000;
228
229 /* test for less than condition */
230 if (floatx80_lt(rFn, rFm))
231 flags |= CC_NEGATIVE;
232
233 /* test for equal condition */
234 if (floatx80_eq(rFn, rFm))
235 flags |= CC_ZERO;
236
237 /* test for greater than or equal condition */
238 if (floatx80_lt(rFm, rFn))
239 flags |= CC_CARRY;
240
241#else
242 if (CONSTANT_FM(opcode)) {
243 /* Fm is a constant. Do the comparison in whatever precision
244 Fn happens to be stored in. */
245 if (fpa11->fType[Fn] == typeSingle) {
246 float32 rFm = getSingleConstant(Fm);
247 float32 rFn = fpa11->fpreg[Fn].fSingle;
248
249 if (float32_is_nan(rFn))
250 goto unordered;
251
252 if (n_flag)
253 rFm ^= 0x80000000;
254
255 /* test for less than condition */
256 if (float32_lt_nocheck(rFn, rFm))
257 flags |= CC_NEGATIVE;
258
259 /* test for equal condition */
260 if (float32_eq_nocheck(rFn, rFm))
261 flags |= CC_ZERO;
262
263 /* test for greater than or equal condition */
264 if (float32_lt_nocheck(rFm, rFn))
265 flags |= CC_CARRY;
266 } else {
267 float64 rFm = getDoubleConstant(Fm);
268 float64 rFn = fpa11->fpreg[Fn].fDouble;
269
270 if (float64_is_nan(rFn))
271 goto unordered;
272
273 if (n_flag)
274 rFm ^= 0x8000000000000000ULL;
275
276 /* test for less than condition */
277 if (float64_lt_nocheck(rFn, rFm))
278 flags |= CC_NEGATIVE;
279
280 /* test for equal condition */
281 if (float64_eq_nocheck(rFn, rFm))
282 flags |= CC_ZERO;
283
284 /* test for greater than or equal condition */
285 if (float64_lt_nocheck(rFm, rFn))
286 flags |= CC_CARRY;
287 }
288 } else {
289 /* Both operands are in registers. */
290 if (fpa11->fType[Fn] == typeSingle
291 && fpa11->fType[Fm] == typeSingle) {
292 float32 rFm = fpa11->fpreg[Fm].fSingle;
293 float32 rFn = fpa11->fpreg[Fn].fSingle;
294
295 if (float32_is_nan(rFn)
296 || float32_is_nan(rFm))
297 goto unordered;
298
299 if (n_flag)
300 rFm ^= 0x80000000;
301
302 /* test for less than condition */
303 if (float32_lt_nocheck(rFn, rFm))
304 flags |= CC_NEGATIVE;
305
306 /* test for equal condition */
307 if (float32_eq_nocheck(rFn, rFm))
308 flags |= CC_ZERO;
309
310 /* test for greater than or equal condition */
311 if (float32_lt_nocheck(rFm, rFn))
312 flags |= CC_CARRY;
313 } else {
314 /* Promote 32-bit operand to 64 bits. */
315 float64 rFm, rFn;
316
317 rFm = (fpa11->fType[Fm] == typeSingle) ?
318 float32_to_float64(fpa11->fpreg[Fm].fSingle)
319 : fpa11->fpreg[Fm].fDouble;
320
321 rFn = (fpa11->fType[Fn] == typeSingle) ?
322 float32_to_float64(fpa11->fpreg[Fn].fSingle)
323 : fpa11->fpreg[Fn].fDouble;
324
325 if (float64_is_nan(rFn)
326 || float64_is_nan(rFm))
327 goto unordered;
328
329 if (n_flag)
330 rFm ^= 0x8000000000000000ULL;
331
332 /* test for less than condition */
333 if (float64_lt_nocheck(rFn, rFm))
334 flags |= CC_NEGATIVE;
335
336 /* test for equal condition */
337 if (float64_eq_nocheck(rFn, rFm))
338 flags |= CC_ZERO;
339
340 /* test for greater than or equal condition */
341 if (float64_lt_nocheck(rFm, rFn))
342 flags |= CC_CARRY;
343 }
344 }
345
346#endif
347
348 writeConditionCodes(flags);
349
350 return 1;
351
352 unordered:
353 /* ?? The FPA data sheet is pretty vague about this, in particular
354 about whether the non-E comparisons can ever raise exceptions.
355 This implementation is based on a combination of what it says in
356 the data sheet, observation of how the Acorn emulator actually
357 behaves (and how programs expect it to) and guesswork. */
358 flags |= CC_OVERFLOW;
359 flags &= ~(CC_ZERO | CC_NEGATIVE);
360
361 if (BIT_AC & readFPSR())
362 flags |= CC_CARRY;
363
364 if (e_flag)
365 float_raise(float_flag_invalid);
366
367 writeConditionCodes(flags);
368 return 1;
369}
diff --git a/arch/arm/nwfpe/fpmodule.c b/arch/arm/nwfpe/fpmodule.c
new file mode 100644
index 000000000000..a806fea5c3ed
--- /dev/null
+++ b/arch/arm/nwfpe/fpmodule.c
@@ -0,0 +1,173 @@
1
2/*
3 NetWinder Floating Point Emulator
4 (c) Rebel.com, 1998-1999
5 (c) Philip Blundell, 1998-1999
6
7 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22*/
23
24#include "fpa11.h"
25
26#include <linux/module.h>
27#include <linux/version.h>
28#include <linux/config.h>
29
30/* XXX */
31#include <linux/errno.h>
32#include <linux/types.h>
33#include <linux/kernel.h>
34#include <linux/signal.h>
35#include <linux/sched.h>
36#include <linux/init.h>
37/* XXX */
38
39#include "softfloat.h"
40#include "fpopcode.h"
41#include "fpmodule.h"
42#include "fpa11.inl"
43
44/* kernel symbols required for signal handling */
45#ifdef CONFIG_FPE_NWFPE_XP
46#define NWFPE_BITS "extended"
47#else
48#define NWFPE_BITS "double"
49#endif
50
51#ifdef MODULE
52void fp_send_sig(unsigned long sig, struct task_struct *p, int priv);
53#else
54#define fp_send_sig send_sig
55#define kern_fp_enter fp_enter
56
57extern char fpe_type[];
58#endif
59
60/* kernel function prototypes required */
61void fp_setup(void);
62
63/* external declarations for saved kernel symbols */
64extern void (*kern_fp_enter)(void);
65extern void (*fp_init)(union fp_state *);
66
67/* Original value of fp_enter from kernel before patched by fpe_init. */
68static void (*orig_fp_enter)(void);
69static void (*orig_fp_init)(union fp_state *);
70
71/* forward declarations */
72extern void nwfpe_enter(void);
73
74static int __init fpe_init(void)
75{
76 if (sizeof(FPA11) > sizeof(union fp_state)) {
77 printk(KERN_ERR "nwfpe: bad structure size\n");
78 return -EINVAL;
79 }
80
81 if (sizeof(FPREG) != 12) {
82 printk(KERN_ERR "nwfpe: bad register size\n");
83 return -EINVAL;
84 }
85 if (fpe_type[0] && strcmp(fpe_type, "nwfpe"))
86 return 0;
87
88 /* Display title, version and copyright information. */
89 printk(KERN_WARNING "NetWinder Floating Point Emulator V0.97 ("
90 NWFPE_BITS " precision)\n");
91
92 /* Save pointer to the old FP handler and then patch ourselves in */
93 orig_fp_enter = kern_fp_enter;
94 orig_fp_init = fp_init;
95 kern_fp_enter = nwfpe_enter;
96 fp_init = nwfpe_init_fpa;
97
98 return 0;
99}
100
101static void __exit fpe_exit(void)
102{
103 /* Restore the values we saved earlier. */
104 kern_fp_enter = orig_fp_enter;
105 fp_init = orig_fp_init;
106}
107
108/*
109ScottB: November 4, 1998
110
111Moved this function out of softfloat-specialize into fpmodule.c.
112This effectively isolates all the changes required for integrating with the
113Linux kernel into fpmodule.c. Porting to NetBSD should only require modifying
114fpmodule.c to integrate with the NetBSD kernel (I hope!).
115
116[1/1/99: Not quite true any more unfortunately. There is Linux-specific
117code to access data in user space in some other source files at the
118moment (grep for get_user / put_user calls). --philb]
119
120float_exception_flags is a global variable in SoftFloat.
121
122This function is called by the SoftFloat routines to raise a floating
123point exception. We check the trap enable byte in the FPSR, and raise
124a SIGFPE exception if necessary. If not the relevant bits in the
125cumulative exceptions flag byte are set and we return.
126*/
127
128void float_raise(signed char flags)
129{
130 register unsigned int fpsr, cumulativeTraps;
131
132#ifdef CONFIG_DEBUG_USER
133 printk(KERN_DEBUG
134 "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n",
135 current->comm, current->pid, flags,
136 __builtin_return_address(0), GET_USERREG()[15]);
137#endif
138
139 /* Keep SoftFloat exception flags up to date. */
140 float_exception_flags |= flags;
141
142 /* Read fpsr and initialize the cumulativeTraps. */
143 fpsr = readFPSR();
144 cumulativeTraps = 0;
145
146 /* For each type of exception, the cumulative trap exception bit is only
147 set if the corresponding trap enable bit is not set. */
148 if ((!(fpsr & BIT_IXE)) && (flags & BIT_IXC))
149 cumulativeTraps |= BIT_IXC;
150 if ((!(fpsr & BIT_UFE)) && (flags & BIT_UFC))
151 cumulativeTraps |= BIT_UFC;
152 if ((!(fpsr & BIT_OFE)) && (flags & BIT_OFC))
153 cumulativeTraps |= BIT_OFC;
154 if ((!(fpsr & BIT_DZE)) && (flags & BIT_DZC))
155 cumulativeTraps |= BIT_DZC;
156 if ((!(fpsr & BIT_IOE)) && (flags & BIT_IOC))
157 cumulativeTraps |= BIT_IOC;
158
159 /* Set the cumulative exceptions flags. */
160 if (cumulativeTraps)
161 writeFPSR(fpsr | cumulativeTraps);
162
163 /* Raise an exception if necessary. */
164 if (fpsr & (flags << 16))
165 fp_send_sig(SIGFPE, current, 1);
166}
167
168module_init(fpe_init);
169module_exit(fpe_exit);
170
171MODULE_AUTHOR("Scott Bambrough <scottb@rebel.com>");
172MODULE_DESCRIPTION("NWFPE floating point emulator (" NWFPE_BITS " precision)");
173MODULE_LICENSE("GPL");
diff --git a/arch/arm/nwfpe/fpmodule.h b/arch/arm/nwfpe/fpmodule.h
new file mode 100644
index 000000000000..5c2e8e48544b
--- /dev/null
+++ b/arch/arm/nwfpe/fpmodule.h
@@ -0,0 +1,47 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.com, 1998-1999
4
5 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (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., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 27/03/03 Ian Molton Clean up CONFIG_CPU
22*/
23
24#ifndef __FPMODULE_H__
25#define __FPMODULE_H__
26
27#define REG_ORIG_R0 17
28#define REG_CPSR 16
29#define REG_PC 15
30#define REG_LR 14
31#define REG_SP 13
32#define REG_IP 12
33#define REG_FP 11
34#define REG_R10 10
35#define REG_R9 9
36#define REG_R9 9
37#define REG_R8 8
38#define REG_R7 7
39#define REG_R6 6
40#define REG_R5 5
41#define REG_R4 4
42#define REG_R3 3
43#define REG_R2 2
44#define REG_R1 1
45#define REG_R0 0
46
47#endif
diff --git a/arch/arm/nwfpe/fpmodule.inl b/arch/arm/nwfpe/fpmodule.inl
new file mode 100644
index 000000000000..e5f59e9a3022
--- /dev/null
+++ b/arch/arm/nwfpe/fpmodule.inl
@@ -0,0 +1,74 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.COM, 1998,1999
4
5 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (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., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22static inline unsigned long readRegister(const unsigned int nReg)
23{
24 /* Note: The CPU thinks it has dealt with the current instruction.
25 As a result the program counter has been advanced to the next
26 instruction, and points 4 bytes beyond the actual instruction
27 that caused the invalid instruction trap to occur. We adjust
28 for this in this routine. LDF/STF instructions with Rn = PC
29 depend on the PC being correct, as they use PC+8 in their
30 address calculations. */
31 unsigned long *userRegisters = GET_USERREG();
32 unsigned int val = userRegisters[nReg];
33 if (REG_PC == nReg)
34 val -= 4;
35 return val;
36}
37
38static inline void
39writeRegister(const unsigned int nReg, const unsigned long val)
40{
41 unsigned long *userRegisters = GET_USERREG();
42 userRegisters[nReg] = val;
43}
44
45static inline unsigned long readCPSR(void)
46{
47 return (readRegister(REG_CPSR));
48}
49
50static inline void writeCPSR(const unsigned long val)
51{
52 writeRegister(REG_CPSR, val);
53}
54
55static inline unsigned long readConditionCodes(void)
56{
57#ifdef __FPEM_TEST__
58 return (0);
59#else
60 return (readCPSR() & CC_MASK);
61#endif
62}
63
64static inline void writeConditionCodes(const unsigned long val)
65{
66 unsigned long *userRegisters = GET_USERREG();
67 unsigned long rval;
68 /*
69 * Operate directly on userRegisters since
70 * the CPSR may be the PC register itself.
71 */
72 rval = userRegisters[REG_CPSR] & ~CC_MASK;
73 userRegisters[REG_CPSR] = rval | (val & CC_MASK);
74}
diff --git a/arch/arm/nwfpe/fpopcode.c b/arch/arm/nwfpe/fpopcode.c
new file mode 100644
index 000000000000..4c9f5703148c
--- /dev/null
+++ b/arch/arm/nwfpe/fpopcode.c
@@ -0,0 +1,90 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.COM, 1998,1999
4
5 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (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., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#include <linux/config.h>
23#include "fpa11.h"
24#include "softfloat.h"
25#include "fpopcode.h"
26#include "fpsr.h"
27#include "fpmodule.h"
28#include "fpmodule.inl"
29
30#ifdef CONFIG_FPE_NWFPE_XP
31const floatx80 floatx80Constant[] = {
32 {0x0000, 0x0000000000000000ULL}, /* extended 0.0 */
33 {0x3fff, 0x8000000000000000ULL}, /* extended 1.0 */
34 {0x4000, 0x8000000000000000ULL}, /* extended 2.0 */
35 {0x4000, 0xc000000000000000ULL}, /* extended 3.0 */
36 {0x4001, 0x8000000000000000ULL}, /* extended 4.0 */
37 {0x4001, 0xa000000000000000ULL}, /* extended 5.0 */
38 {0x3ffe, 0x8000000000000000ULL}, /* extended 0.5 */
39 {0x4002, 0xa000000000000000ULL} /* extended 10.0 */
40};
41#endif
42
43const float64 float64Constant[] = {
44 0x0000000000000000ULL, /* double 0.0 */
45 0x3ff0000000000000ULL, /* double 1.0 */
46 0x4000000000000000ULL, /* double 2.0 */
47 0x4008000000000000ULL, /* double 3.0 */
48 0x4010000000000000ULL, /* double 4.0 */
49 0x4014000000000000ULL, /* double 5.0 */
50 0x3fe0000000000000ULL, /* double 0.5 */
51 0x4024000000000000ULL /* double 10.0 */
52};
53
54const float32 float32Constant[] = {
55 0x00000000, /* single 0.0 */
56 0x3f800000, /* single 1.0 */
57 0x40000000, /* single 2.0 */
58 0x40400000, /* single 3.0 */
59 0x40800000, /* single 4.0 */
60 0x40a00000, /* single 5.0 */
61 0x3f000000, /* single 0.5 */
62 0x41200000 /* single 10.0 */
63};
64
65/* condition code lookup table
66 index into the table is test code: EQ, NE, ... LT, GT, AL, NV
67 bit position in short is condition code: NZCV */
68static const unsigned short aCC[16] = {
69 0xF0F0, // EQ == Z set
70 0x0F0F, // NE
71 0xCCCC, // CS == C set
72 0x3333, // CC
73 0xFF00, // MI == N set
74 0x00FF, // PL
75 0xAAAA, // VS == V set
76 0x5555, // VC
77 0x0C0C, // HI == C set && Z clear
78 0xF3F3, // LS == C clear || Z set
79 0xAA55, // GE == (N==V)
80 0x55AA, // LT == (N!=V)
81 0x0A05, // GT == (!Z && (N==V))
82 0xF5FA, // LE == (Z || (N!=V))
83 0xFFFF, // AL always
84 0 // NV
85};
86
87unsigned int checkCondition(const unsigned int opcode, const unsigned int ccodes)
88{
89 return (aCC[opcode >> 28] >> (ccodes >> 28)) & 1;
90}
diff --git a/arch/arm/nwfpe/fpopcode.h b/arch/arm/nwfpe/fpopcode.h
new file mode 100644
index 000000000000..8035f4faafbf
--- /dev/null
+++ b/arch/arm/nwfpe/fpopcode.h
@@ -0,0 +1,479 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.COM, 1998,1999
4 (c) Philip Blundell, 2001
5
6 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23#ifndef __FPOPCODE_H__
24#define __FPOPCODE_H__
25
26#include <linux/config.h>
27
28/*
29ARM Floating Point Instruction Classes
30| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
31|c o n d|1 1 0 P|U|u|W|L| Rn |v| Fd |0|0|0|1| o f f s e t | CPDT
32|c o n d|1 1 0 P|U|w|W|L| Rn |x| Fd |0|0|1|0| o f f s e t | CPDT (copro 2)
33| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
34|c o n d|1 1 1 0|a|b|c|d|e| Fn |j| Fd |0|0|0|1|f|g|h|0|i| Fm | CPDO
35|c o n d|1 1 1 0|a|b|c|L|e| Fn | Rd |0|0|0|1|f|g|h|1|i| Fm | CPRT
36|c o n d|1 1 1 0|a|b|c|1|e| Fn |1|1|1|1|0|0|0|1|f|g|h|1|i| Fm | comparisons
37| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
38
39CPDT data transfer instructions
40 LDF, STF, LFM (copro 2), SFM (copro 2)
41
42CPDO dyadic arithmetic instructions
43 ADF, MUF, SUF, RSF, DVF, RDF,
44 POW, RPW, RMF, FML, FDV, FRD, POL
45
46CPDO monadic arithmetic instructions
47 MVF, MNF, ABS, RND, SQT, LOG, LGN, EXP,
48 SIN, COS, TAN, ASN, ACS, ATN, URD, NRM
49
50CPRT joint arithmetic/data transfer instructions
51 FIX (arithmetic followed by load/store)
52 FLT (load/store followed by arithmetic)
53 CMF, CNF CMFE, CNFE (comparisons)
54 WFS, RFS (write/read floating point status register)
55 WFC, RFC (write/read floating point control register)
56
57cond condition codes
58P pre/post index bit: 0 = postindex, 1 = preindex
59U up/down bit: 0 = stack grows down, 1 = stack grows up
60W write back bit: 1 = update base register (Rn)
61L load/store bit: 0 = store, 1 = load
62Rn base register
63Rd destination/source register
64Fd floating point destination register
65Fn floating point source register
66Fm floating point source register or floating point constant
67
68uv transfer length (TABLE 1)
69wx register count (TABLE 2)
70abcd arithmetic opcode (TABLES 3 & 4)
71ef destination size (rounding precision) (TABLE 5)
72gh rounding mode (TABLE 6)
73j dyadic/monadic bit: 0 = dyadic, 1 = monadic
74i constant bit: 1 = constant (TABLE 6)
75*/
76
77/*
78TABLE 1
79+-------------------------+---+---+---------+---------+
80| Precision | u | v | FPSR.EP | length |
81+-------------------------+---+---+---------+---------+
82| Single | 0 ü 0 | x | 1 words |
83| Double | 1 ü 1 | x | 2 words |
84| Extended | 1 ü 1 | x | 3 words |
85| Packed decimal | 1 ü 1 | 0 | 3 words |
86| Expanded packed decimal | 1 ü 1 | 1 | 4 words |
87+-------------------------+---+---+---------+---------+
88Note: x = don't care
89*/
90
91/*
92TABLE 2
93+---+---+---------------------------------+
94| w | x | Number of registers to transfer |
95+---+---+---------------------------------+
96| 0 ü 1 | 1 |
97| 1 ü 0 | 2 |
98| 1 ü 1 | 3 |
99| 0 ü 0 | 4 |
100+---+---+---------------------------------+
101*/
102
103/*
104TABLE 3: Dyadic Floating Point Opcodes
105+---+---+---+---+----------+-----------------------+-----------------------+
106| a | b | c | d | Mnemonic | Description | Operation |
107+---+---+---+---+----------+-----------------------+-----------------------+
108| 0 | 0 | 0 | 0 | ADF | Add | Fd := Fn + Fm |
109| 0 | 0 | 0 | 1 | MUF | Multiply | Fd := Fn * Fm |
110| 0 | 0 | 1 | 0 | SUF | Subtract | Fd := Fn - Fm |
111| 0 | 0 | 1 | 1 | RSF | Reverse subtract | Fd := Fm - Fn |
112| 0 | 1 | 0 | 0 | DVF | Divide | Fd := Fn / Fm |
113| 0 | 1 | 0 | 1 | RDF | Reverse divide | Fd := Fm / Fn |
114| 0 | 1 | 1 | 0 | POW | Power | Fd := Fn ^ Fm |
115| 0 | 1 | 1 | 1 | RPW | Reverse power | Fd := Fm ^ Fn |
116| 1 | 0 | 0 | 0 | RMF | Remainder | Fd := IEEE rem(Fn/Fm) |
117| 1 | 0 | 0 | 1 | FML | Fast Multiply | Fd := Fn * Fm |
118| 1 | 0 | 1 | 0 | FDV | Fast Divide | Fd := Fn / Fm |
119| 1 | 0 | 1 | 1 | FRD | Fast reverse divide | Fd := Fm / Fn |
120| 1 | 1 | 0 | 0 | POL | Polar angle (ArcTan2) | Fd := arctan2(Fn,Fm) |
121| 1 | 1 | 0 | 1 | | undefined instruction | trap |
122| 1 | 1 | 1 | 0 | | undefined instruction | trap |
123| 1 | 1 | 1 | 1 | | undefined instruction | trap |
124+---+---+---+---+----------+-----------------------+-----------------------+
125Note: POW, RPW, POL are deprecated, and are available for backwards
126 compatibility only.
127*/
128
129/*
130TABLE 4: Monadic Floating Point Opcodes
131+---+---+---+---+----------+-----------------------+-----------------------+
132| a | b | c | d | Mnemonic | Description | Operation |
133+---+---+---+---+----------+-----------------------+-----------------------+
134| 0 | 0 | 0 | 0 | MVF | Move | Fd := Fm |
135| 0 | 0 | 0 | 1 | MNF | Move negated | Fd := - Fm |
136| 0 | 0 | 1 | 0 | ABS | Absolute value | Fd := abs(Fm) |
137| 0 | 0 | 1 | 1 | RND | Round to integer | Fd := int(Fm) |
138| 0 | 1 | 0 | 0 | SQT | Square root | Fd := sqrt(Fm) |
139| 0 | 1 | 0 | 1 | LOG | Log base 10 | Fd := log10(Fm) |
140| 0 | 1 | 1 | 0 | LGN | Log base e | Fd := ln(Fm) |
141| 0 | 1 | 1 | 1 | EXP | Exponent | Fd := e ^ Fm |
142| 1 | 0 | 0 | 0 | SIN | Sine | Fd := sin(Fm) |
143| 1 | 0 | 0 | 1 | COS | Cosine | Fd := cos(Fm) |
144| 1 | 0 | 1 | 0 | TAN | Tangent | Fd := tan(Fm) |
145| 1 | 0 | 1 | 1 | ASN | Arc Sine | Fd := arcsin(Fm) |
146| 1 | 1 | 0 | 0 | ACS | Arc Cosine | Fd := arccos(Fm) |
147| 1 | 1 | 0 | 1 | ATN | Arc Tangent | Fd := arctan(Fm) |
148| 1 | 1 | 1 | 0 | URD | Unnormalized round | Fd := int(Fm) |
149| 1 | 1 | 1 | 1 | NRM | Normalize | Fd := norm(Fm) |
150+---+---+---+---+----------+-----------------------+-----------------------+
151Note: LOG, LGN, EXP, SIN, COS, TAN, ASN, ACS, ATN are deprecated, and are
152 available for backwards compatibility only.
153*/
154
155/*
156TABLE 5
157+-------------------------+---+---+
158| Rounding Precision | e | f |
159+-------------------------+---+---+
160| IEEE Single precision | 0 ü 0 |
161| IEEE Double precision | 0 ü 1 |
162| IEEE Extended precision | 1 ü 0 |
163| undefined (trap) | 1 ü 1 |
164+-------------------------+---+---+
165*/
166
167/*
168TABLE 5
169+---------------------------------+---+---+
170| Rounding Mode | g | h |
171+---------------------------------+---+---+
172| Round to nearest (default) | 0 ü 0 |
173| Round toward plus infinity | 0 ü 1 |
174| Round toward negative infinity | 1 ü 0 |
175| Round toward zero | 1 ü 1 |
176+---------------------------------+---+---+
177*/
178
179/*
180===
181=== Definitions for load and store instructions
182===
183*/
184
185/* bit masks */
186#define BIT_PREINDEX 0x01000000
187#define BIT_UP 0x00800000
188#define BIT_WRITE_BACK 0x00200000
189#define BIT_LOAD 0x00100000
190
191/* masks for load/store */
192#define MASK_CPDT 0x0c000000 /* data processing opcode */
193#define MASK_OFFSET 0x000000ff
194#define MASK_TRANSFER_LENGTH 0x00408000
195#define MASK_REGISTER_COUNT MASK_TRANSFER_LENGTH
196#define MASK_COPROCESSOR 0x00000f00
197
198/* Tests for transfer length */
199#define TRANSFER_SINGLE 0x00000000
200#define TRANSFER_DOUBLE 0x00008000
201#define TRANSFER_EXTENDED 0x00400000
202#define TRANSFER_PACKED MASK_TRANSFER_LENGTH
203
204/* Get the coprocessor number from the opcode. */
205#define getCoprocessorNumber(opcode) ((opcode & MASK_COPROCESSOR) >> 8)
206
207/* Get the offset from the opcode. */
208#define getOffset(opcode) (opcode & MASK_OFFSET)
209
210/* Tests for specific data transfer load/store opcodes. */
211#define TEST_OPCODE(opcode,mask) (((opcode) & (mask)) == (mask))
212
213#define LOAD_OP(opcode) TEST_OPCODE((opcode),MASK_CPDT | BIT_LOAD)
214#define STORE_OP(opcode) ((opcode & (MASK_CPDT | BIT_LOAD)) == MASK_CPDT)
215
216#define LDF_OP(opcode) (LOAD_OP(opcode) && (getCoprocessorNumber(opcode) == 1))
217#define LFM_OP(opcode) (LOAD_OP(opcode) && (getCoprocessorNumber(opcode) == 2))
218#define STF_OP(opcode) (STORE_OP(opcode) && (getCoprocessorNumber(opcode) == 1))
219#define SFM_OP(opcode) (STORE_OP(opcode) && (getCoprocessorNumber(opcode) == 2))
220
221#define PREINDEXED(opcode) ((opcode & BIT_PREINDEX) != 0)
222#define POSTINDEXED(opcode) ((opcode & BIT_PREINDEX) == 0)
223#define BIT_UP_SET(opcode) ((opcode & BIT_UP) != 0)
224#define BIT_UP_CLEAR(opcode) ((opcode & BIT_DOWN) == 0)
225#define WRITE_BACK(opcode) ((opcode & BIT_WRITE_BACK) != 0)
226#define LOAD(opcode) ((opcode & BIT_LOAD) != 0)
227#define STORE(opcode) ((opcode & BIT_LOAD) == 0)
228
229/*
230===
231=== Definitions for arithmetic instructions
232===
233*/
234/* bit masks */
235#define BIT_MONADIC 0x00008000
236#define BIT_CONSTANT 0x00000008
237
238#define CONSTANT_FM(opcode) ((opcode & BIT_CONSTANT) != 0)
239#define MONADIC_INSTRUCTION(opcode) ((opcode & BIT_MONADIC) != 0)
240
241/* instruction identification masks */
242#define MASK_CPDO 0x0e000000 /* arithmetic opcode */
243#define MASK_ARITHMETIC_OPCODE 0x00f08000
244#define MASK_DESTINATION_SIZE 0x00080080
245
246/* dyadic arithmetic opcodes. */
247#define ADF_CODE 0x00000000
248#define MUF_CODE 0x00100000
249#define SUF_CODE 0x00200000
250#define RSF_CODE 0x00300000
251#define DVF_CODE 0x00400000
252#define RDF_CODE 0x00500000
253#define POW_CODE 0x00600000
254#define RPW_CODE 0x00700000
255#define RMF_CODE 0x00800000
256#define FML_CODE 0x00900000
257#define FDV_CODE 0x00a00000
258#define FRD_CODE 0x00b00000
259#define POL_CODE 0x00c00000
260/* 0x00d00000 is an invalid dyadic arithmetic opcode */
261/* 0x00e00000 is an invalid dyadic arithmetic opcode */
262/* 0x00f00000 is an invalid dyadic arithmetic opcode */
263
264/* monadic arithmetic opcodes. */
265#define MVF_CODE 0x00008000
266#define MNF_CODE 0x00108000
267#define ABS_CODE 0x00208000
268#define RND_CODE 0x00308000
269#define SQT_CODE 0x00408000
270#define LOG_CODE 0x00508000
271#define LGN_CODE 0x00608000
272#define EXP_CODE 0x00708000
273#define SIN_CODE 0x00808000
274#define COS_CODE 0x00908000
275#define TAN_CODE 0x00a08000
276#define ASN_CODE 0x00b08000
277#define ACS_CODE 0x00c08000
278#define ATN_CODE 0x00d08000
279#define URD_CODE 0x00e08000
280#define NRM_CODE 0x00f08000
281
282/*
283===
284=== Definitions for register transfer and comparison instructions
285===
286*/
287
288#define MASK_CPRT 0x0e000010 /* register transfer opcode */
289#define MASK_CPRT_CODE 0x00f00000
290#define FLT_CODE 0x00000000
291#define FIX_CODE 0x00100000
292#define WFS_CODE 0x00200000
293#define RFS_CODE 0x00300000
294#define WFC_CODE 0x00400000
295#define RFC_CODE 0x00500000
296#define CMF_CODE 0x00900000
297#define CNF_CODE 0x00b00000
298#define CMFE_CODE 0x00d00000
299#define CNFE_CODE 0x00f00000
300
301/*
302===
303=== Common definitions
304===
305*/
306
307/* register masks */
308#define MASK_Rd 0x0000f000
309#define MASK_Rn 0x000f0000
310#define MASK_Fd 0x00007000
311#define MASK_Fm 0x00000007
312#define MASK_Fn 0x00070000
313
314/* condition code masks */
315#define CC_MASK 0xf0000000
316#define CC_NEGATIVE 0x80000000
317#define CC_ZERO 0x40000000
318#define CC_CARRY 0x20000000
319#define CC_OVERFLOW 0x10000000
320#define CC_EQ 0x00000000
321#define CC_NE 0x10000000
322#define CC_CS 0x20000000
323#define CC_HS CC_CS
324#define CC_CC 0x30000000
325#define CC_LO CC_CC
326#define CC_MI 0x40000000
327#define CC_PL 0x50000000
328#define CC_VS 0x60000000
329#define CC_VC 0x70000000
330#define CC_HI 0x80000000
331#define CC_LS 0x90000000
332#define CC_GE 0xa0000000
333#define CC_LT 0xb0000000
334#define CC_GT 0xc0000000
335#define CC_LE 0xd0000000
336#define CC_AL 0xe0000000
337#define CC_NV 0xf0000000
338
339/* rounding masks/values */
340#define MASK_ROUNDING_MODE 0x00000060
341#define ROUND_TO_NEAREST 0x00000000
342#define ROUND_TO_PLUS_INFINITY 0x00000020
343#define ROUND_TO_MINUS_INFINITY 0x00000040
344#define ROUND_TO_ZERO 0x00000060
345
346#define MASK_ROUNDING_PRECISION 0x00080080
347#define ROUND_SINGLE 0x00000000
348#define ROUND_DOUBLE 0x00000080
349#define ROUND_EXTENDED 0x00080000
350
351/* Get the condition code from the opcode. */
352#define getCondition(opcode) (opcode >> 28)
353
354/* Get the source register from the opcode. */
355#define getRn(opcode) ((opcode & MASK_Rn) >> 16)
356
357/* Get the destination floating point register from the opcode. */
358#define getFd(opcode) ((opcode & MASK_Fd) >> 12)
359
360/* Get the first source floating point register from the opcode. */
361#define getFn(opcode) ((opcode & MASK_Fn) >> 16)
362
363/* Get the second source floating point register from the opcode. */
364#define getFm(opcode) (opcode & MASK_Fm)
365
366/* Get the destination register from the opcode. */
367#define getRd(opcode) ((opcode & MASK_Rd) >> 12)
368
369/* Get the rounding mode from the opcode. */
370#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5)
371
372#ifdef CONFIG_FPE_NWFPE_XP
373static inline const floatx80 getExtendedConstant(const unsigned int nIndex)
374{
375 extern const floatx80 floatx80Constant[];
376 return floatx80Constant[nIndex];
377}
378#endif
379
380static inline const float64 getDoubleConstant(const unsigned int nIndex)
381{
382 extern const float64 float64Constant[];
383 return float64Constant[nIndex];
384}
385
386static inline const float32 getSingleConstant(const unsigned int nIndex)
387{
388 extern const float32 float32Constant[];
389 return float32Constant[nIndex];
390}
391
392static inline unsigned int getTransferLength(const unsigned int opcode)
393{
394 unsigned int nRc;
395
396 switch (opcode & MASK_TRANSFER_LENGTH) {
397 case 0x00000000:
398 nRc = 1;
399 break; /* single precision */
400 case 0x00008000:
401 nRc = 2;
402 break; /* double precision */
403 case 0x00400000:
404 nRc = 3;
405 break; /* extended precision */
406 default:
407 nRc = 0;
408 }
409
410 return (nRc);
411}
412
413static inline unsigned int getRegisterCount(const unsigned int opcode)
414{
415 unsigned int nRc;
416
417 switch (opcode & MASK_REGISTER_COUNT) {
418 case 0x00000000:
419 nRc = 4;
420 break;
421 case 0x00008000:
422 nRc = 1;
423 break;
424 case 0x00400000:
425 nRc = 2;
426 break;
427 case 0x00408000:
428 nRc = 3;
429 break;
430 default:
431 nRc = 0;
432 }
433
434 return (nRc);
435}
436
437static inline unsigned int getRoundingPrecision(const unsigned int opcode)
438{
439 unsigned int nRc;
440
441 switch (opcode & MASK_ROUNDING_PRECISION) {
442 case 0x00000000:
443 nRc = 1;
444 break;
445 case 0x00000080:
446 nRc = 2;
447 break;
448 case 0x00080000:
449 nRc = 3;
450 break;
451 default:
452 nRc = 0;
453 }
454
455 return (nRc);
456}
457
458static inline unsigned int getDestinationSize(const unsigned int opcode)
459{
460 unsigned int nRc;
461
462 switch (opcode & MASK_DESTINATION_SIZE) {
463 case 0x00000000:
464 nRc = typeSingle;
465 break;
466 case 0x00000080:
467 nRc = typeDouble;
468 break;
469 case 0x00080000:
470 nRc = typeExtended;
471 break;
472 default:
473 nRc = typeNone;
474 }
475
476 return (nRc);
477}
478
479#endif
diff --git a/arch/arm/nwfpe/fpsr.h b/arch/arm/nwfpe/fpsr.h
new file mode 100644
index 000000000000..859b300d89fd
--- /dev/null
+++ b/arch/arm/nwfpe/fpsr.h
@@ -0,0 +1,108 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.com, 1998-1999
4
5 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (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., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#ifndef __FPSR_H__
23#define __FPSR_H__
24
25/*
26The FPSR is a 32 bit register consisting of 4 parts, each exactly
27one byte.
28
29 SYSTEM ID
30 EXCEPTION TRAP ENABLE BYTE
31 SYSTEM CONTROL BYTE
32 CUMULATIVE EXCEPTION FLAGS BYTE
33
34The FPCR is a 32 bit register consisting of bit flags.
35*/
36
37/* SYSTEM ID
38------------
39Note: the system id byte is read only */
40
41typedef unsigned int FPSR; /* type for floating point status register */
42typedef unsigned int FPCR; /* type for floating point control register */
43
44#define MASK_SYSID 0xff000000
45#define BIT_HARDWARE 0x80000000
46#define FP_EMULATOR 0x01000000 /* System ID for emulator */
47#define FP_ACCELERATOR 0x81000000 /* System ID for FPA11 */
48
49/* EXCEPTION TRAP ENABLE BYTE
50----------------------------- */
51
52#define MASK_TRAP_ENABLE 0x00ff0000
53#define MASK_TRAP_ENABLE_STRICT 0x001f0000
54#define BIT_IXE 0x00100000 /* inexact exception enable */
55#define BIT_UFE 0x00080000 /* underflow exception enable */
56#define BIT_OFE 0x00040000 /* overflow exception enable */
57#define BIT_DZE 0x00020000 /* divide by zero exception enable */
58#define BIT_IOE 0x00010000 /* invalid operation exception enable */
59
60/* SYSTEM CONTROL BYTE
61---------------------- */
62
63#define MASK_SYSTEM_CONTROL 0x0000ff00
64#define MASK_TRAP_STRICT 0x00001f00
65
66#define BIT_AC 0x00001000 /* use alternative C-flag definition
67 for compares */
68#define BIT_EP 0x00000800 /* use expanded packed decimal format */
69#define BIT_SO 0x00000400 /* select synchronous operation of FPA */
70#define BIT_NE 0x00000200 /* NaN exception bit */
71#define BIT_ND 0x00000100 /* no denormalized numbers bit */
72
73/* CUMULATIVE EXCEPTION FLAGS BYTE
74---------------------------------- */
75
76#define MASK_EXCEPTION_FLAGS 0x000000ff
77#define MASK_EXCEPTION_FLAGS_STRICT 0x0000001f
78
79#define BIT_IXC 0x00000010 /* inexact exception flag */
80#define BIT_UFC 0x00000008 /* underflow exception flag */
81#define BIT_OFC 0x00000004 /* overfloat exception flag */
82#define BIT_DZC 0x00000002 /* divide by zero exception flag */
83#define BIT_IOC 0x00000001 /* invalid operation exception flag */
84
85/* Floating Point Control Register
86----------------------------------*/
87
88#define BIT_RU 0x80000000 /* rounded up bit */
89#define BIT_IE 0x10000000 /* inexact bit */
90#define BIT_MO 0x08000000 /* mantissa overflow bit */
91#define BIT_EO 0x04000000 /* exponent overflow bit */
92#define BIT_SB 0x00000800 /* store bounce */
93#define BIT_AB 0x00000400 /* arithmetic bounce */
94#define BIT_RE 0x00000200 /* rounding exception */
95#define BIT_DA 0x00000100 /* disable FPA */
96
97#define MASK_OP 0x00f08010 /* AU operation code */
98#define MASK_PR 0x00080080 /* AU precision */
99#define MASK_S1 0x00070000 /* AU source register 1 */
100#define MASK_S2 0x00000007 /* AU source register 2 */
101#define MASK_DS 0x00007000 /* AU destination register */
102#define MASK_RM 0x00000060 /* AU rounding mode */
103#define MASK_ALU 0x9cfff2ff /* only ALU can write these bits */
104#define MASK_RESET 0x00000d00 /* bits set on reset, all others cleared */
105#define MASK_WFC MASK_RESET
106#define MASK_RFC ~MASK_RESET
107
108#endif
diff --git a/arch/arm/nwfpe/milieu.h b/arch/arm/nwfpe/milieu.h
new file mode 100644
index 000000000000..a3892ab2dca4
--- /dev/null
+++ b/arch/arm/nwfpe/milieu.h
@@ -0,0 +1,48 @@
1
2/*
3===============================================================================
4
5This C header file is part of the SoftFloat IEC/IEEE Floating-point
6Arithmetic Package, Release 2.
7
8Written by John R. Hauser. This work was made possible in part by the
9International Computer Science Institute, located at Suite 600, 1947 Center
10Street, Berkeley, California 94704. Funding was partially provided by the
11National Science Foundation under grant MIP-9311980. The original version
12of this code was written as part of a project to build a fixed-point vector
13processor in collaboration with the University of California at Berkeley,
14overseen by Profs. Nelson Morgan and John Wawrzynek. More information
15is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
16arithmetic/softfloat.html'.
17
18THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
19has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
20TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
21PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
22AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
23
24Derivative works are acceptable, even for commercial purposes, so long as
25(1) they include prominent notice that the work is derivative, and (2) they
26include prominent notice akin to these three paragraphs for those parts of
27this code that are retained.
28
29===============================================================================
30*/
31
32/*
33-------------------------------------------------------------------------------
34Include common integer types and flags.
35-------------------------------------------------------------------------------
36*/
37#include "ARM-gcc.h"
38
39/*
40-------------------------------------------------------------------------------
41Symbolic Boolean literals.
42-------------------------------------------------------------------------------
43*/
44enum {
45 FALSE = 0,
46 TRUE = 1
47};
48
diff --git a/arch/arm/nwfpe/single_cpdo.c b/arch/arm/nwfpe/single_cpdo.c
new file mode 100644
index 000000000000..705808e88d9d
--- /dev/null
+++ b/arch/arm/nwfpe/single_cpdo.c
@@ -0,0 +1,124 @@
1/*
2 NetWinder Floating Point Emulator
3 (c) Rebel.COM, 1998,1999
4 (c) Philip Blundell, 2001
5
6 Direct questions, comments to Scott Bambrough <scottb@netwinder.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23#include "fpa11.h"
24#include "softfloat.h"
25#include "fpopcode.h"
26
27float32 float32_exp(float32 Fm);
28float32 float32_ln(float32 Fm);
29float32 float32_sin(float32 rFm);
30float32 float32_cos(float32 rFm);
31float32 float32_arcsin(float32 rFm);
32float32 float32_arctan(float32 rFm);
33float32 float32_log(float32 rFm);
34float32 float32_tan(float32 rFm);
35float32 float32_arccos(float32 rFm);
36float32 float32_pow(float32 rFn, float32 rFm);
37float32 float32_pol(float32 rFn, float32 rFm);
38
39static float32 float32_rsf(float32 rFn, float32 rFm)
40{
41 return float32_sub(rFm, rFn);
42}
43
44static float32 float32_rdv(float32 rFn, float32 rFm)
45{
46 return float32_div(rFm, rFn);
47}
48
49static float32 (*const dyadic_single[16])(float32 rFn, float32 rFm) = {
50 [ADF_CODE >> 20] = float32_add,
51 [MUF_CODE >> 20] = float32_mul,
52 [SUF_CODE >> 20] = float32_sub,
53 [RSF_CODE >> 20] = float32_rsf,
54 [DVF_CODE >> 20] = float32_div,
55 [RDF_CODE >> 20] = float32_rdv,
56 [RMF_CODE >> 20] = float32_rem,
57
58 [FML_CODE >> 20] = float32_mul,
59 [FDV_CODE >> 20] = float32_div,
60 [FRD_CODE >> 20] = float32_rdv,
61};
62
63static float32 float32_mvf(float32 rFm)
64{
65 return rFm;
66}
67
68static float32 float32_mnf(float32 rFm)
69{
70 return rFm ^ 0x80000000;
71}
72
73static float32 float32_abs(float32 rFm)
74{
75 return rFm & 0x7fffffff;
76}
77
78static float32 (*const monadic_single[16])(float32 rFm) = {
79 [MVF_CODE >> 20] = float32_mvf,
80 [MNF_CODE >> 20] = float32_mnf,
81 [ABS_CODE >> 20] = float32_abs,
82 [RND_CODE >> 20] = float32_round_to_int,
83 [URD_CODE >> 20] = float32_round_to_int,
84 [SQT_CODE >> 20] = float32_sqrt,
85 [NRM_CODE >> 20] = float32_mvf,
86};
87
88unsigned int SingleCPDO(const unsigned int opcode, FPREG * rFd)
89{
90 FPA11 *fpa11 = GET_FPA11();
91 float32 rFm;
92 unsigned int Fm, opc_mask_shift;
93
94 Fm = getFm(opcode);
95 if (CONSTANT_FM(opcode)) {
96 rFm = getSingleConstant(Fm);
97 } else if (fpa11->fType[Fm] == typeSingle) {
98 rFm = fpa11->fpreg[Fm].fSingle;
99 } else {
100 return 0;
101 }
102
103 opc_mask_shift = (opcode & MASK_ARITHMETIC_OPCODE) >> 20;
104 if (!MONADIC_INSTRUCTION(opcode)) {
105 unsigned int Fn = getFn(opcode);
106 float32 rFn;
107
108 if (fpa11->fType[Fn] == typeSingle &&
109 dyadic_single[opc_mask_shift]) {
110 rFn = fpa11->fpreg[Fn].fSingle;
111 rFd->fSingle = dyadic_single[opc_mask_shift](rFn, rFm);
112 } else {
113 return 0;
114 }
115 } else {
116 if (monadic_single[opc_mask_shift]) {
117 rFd->fSingle = monadic_single[opc_mask_shift](rFm);
118 } else {
119 return 0;
120 }
121 }
122
123 return 1;
124}
diff --git a/arch/arm/nwfpe/softfloat-macros b/arch/arm/nwfpe/softfloat-macros
new file mode 100644
index 000000000000..5469989f2c5e
--- /dev/null
+++ b/arch/arm/nwfpe/softfloat-macros
@@ -0,0 +1,740 @@
1
2/*
3===============================================================================
4
5This C source fragment is part of the SoftFloat IEC/IEEE Floating-point
6Arithmetic Package, Release 2.
7
8Written by John R. Hauser. This work was made possible in part by the
9International Computer Science Institute, located at Suite 600, 1947 Center
10Street, Berkeley, California 94704. Funding was partially provided by the
11National Science Foundation under grant MIP-9311980. The original version
12of this code was written as part of a project to build a fixed-point vector
13processor in collaboration with the University of California at Berkeley,
14overseen by Profs. Nelson Morgan and John Wawrzynek. More information
15is available through the web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
16arithmetic/softfloat.html'.
17
18THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
19has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
20TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
21PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
22AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
23
24Derivative works are acceptable, even for commercial purposes, so long as
25(1) they include prominent notice that the work is derivative, and (2) they
26include prominent notice akin to these three paragraphs for those parts of
27this code that are retained.
28
29===============================================================================
30*/
31
32/*
33-------------------------------------------------------------------------------
34Shifts `a' right by the number of bits given in `count'. If any nonzero
35bits are shifted off, they are ``jammed'' into the least significant bit of
36the result by setting the least significant bit to 1. The value of `count'
37can be arbitrarily large; in particular, if `count' is greater than 32, the
38result will be either 0 or 1, depending on whether `a' is zero or nonzero.
39The result is stored in the location pointed to by `zPtr'.
40-------------------------------------------------------------------------------
41*/
42INLINE void shift32RightJamming( bits32 a, int16 count, bits32 *zPtr )
43{
44 bits32 z;
45 if ( count == 0 ) {
46 z = a;
47 }
48 else if ( count < 32 ) {
49 z = ( a>>count ) | ( ( a<<( ( - count ) & 31 ) ) != 0 );
50 }
51 else {
52 z = ( a != 0 );
53 }
54 *zPtr = z;
55}
56
57/*
58-------------------------------------------------------------------------------
59Shifts `a' right by the number of bits given in `count'. If any nonzero
60bits are shifted off, they are ``jammed'' into the least significant bit of
61the result by setting the least significant bit to 1. The value of `count'
62can be arbitrarily large; in particular, if `count' is greater than 64, the
63result will be either 0 or 1, depending on whether `a' is zero or nonzero.
64The result is stored in the location pointed to by `zPtr'.
65-------------------------------------------------------------------------------
66*/
67INLINE void shift64RightJamming( bits64 a, int16 count, bits64 *zPtr )
68{
69 bits64 z;
70
71 __asm__("@shift64RightJamming -- start");
72 if ( count == 0 ) {
73 z = a;
74 }
75 else if ( count < 64 ) {
76 z = ( a>>count ) | ( ( a<<( ( - count ) & 63 ) ) != 0 );
77 }
78 else {
79 z = ( a != 0 );
80 }
81 __asm__("@shift64RightJamming -- end");
82 *zPtr = z;
83}
84
85/*
86-------------------------------------------------------------------------------
87Shifts the 128-bit value formed by concatenating `a0' and `a1' right by 64
88_plus_ the number of bits given in `count'. The shifted result is at most
8964 nonzero bits; this is stored at the location pointed to by `z0Ptr'. The
90bits shifted off form a second 64-bit result as follows: The _last_ bit
91shifted off is the most-significant bit of the extra result, and the other
9263 bits of the extra result are all zero if and only if _all_but_the_last_
93bits shifted off were all zero. This extra result is stored in the location
94pointed to by `z1Ptr'. The value of `count' can be arbitrarily large.
95 (This routine makes more sense if `a0' and `a1' are considered to form a
96fixed-point value with binary point between `a0' and `a1'. This fixed-point
97value is shifted right by the number of bits given in `count', and the
98integer part of the result is returned at the location pointed to by
99`z0Ptr'. The fractional part of the result may be slightly corrupted as
100described above, and is returned at the location pointed to by `z1Ptr'.)
101-------------------------------------------------------------------------------
102*/
103INLINE void
104 shift64ExtraRightJamming(
105 bits64 a0, bits64 a1, int16 count, bits64 *z0Ptr, bits64 *z1Ptr )
106{
107 bits64 z0, z1;
108 int8 negCount = ( - count ) & 63;
109
110 if ( count == 0 ) {
111 z1 = a1;
112 z0 = a0;
113 }
114 else if ( count < 64 ) {
115 z1 = ( a0<<negCount ) | ( a1 != 0 );
116 z0 = a0>>count;
117 }
118 else {
119 if ( count == 64 ) {
120 z1 = a0 | ( a1 != 0 );
121 }
122 else {
123 z1 = ( ( a0 | a1 ) != 0 );
124 }
125 z0 = 0;
126 }
127 *z1Ptr = z1;
128 *z0Ptr = z0;
129
130}
131
132/*
133-------------------------------------------------------------------------------
134Shifts the 128-bit value formed by concatenating `a0' and `a1' right by the
135number of bits given in `count'. Any bits shifted off are lost. The value
136of `count' can be arbitrarily large; in particular, if `count' is greater
137than 128, the result will be 0. The result is broken into two 64-bit pieces
138which are stored at the locations pointed to by `z0Ptr' and `z1Ptr'.
139-------------------------------------------------------------------------------
140*/
141INLINE void
142 shift128Right(
143 bits64 a0, bits64 a1, int16 count, bits64 *z0Ptr, bits64 *z1Ptr )
144{
145 bits64 z0, z1;
146 int8 negCount = ( - count ) & 63;
147
148 if ( count == 0 ) {
149 z1 = a1;
150 z0 = a0;
151 }
152 else if ( count < 64 ) {
153 z1 = ( a0<<negCount ) | ( a1>>count );
154 z0 = a0>>count;
155 }
156 else {
157 z1 = ( count < 64 ) ? ( a0>>( count & 63 ) ) : 0;
158 z0 = 0;
159 }
160 *z1Ptr = z1;
161 *z0Ptr = z0;
162
163}
164
165/*
166-------------------------------------------------------------------------------
167Shifts the 128-bit value formed by concatenating `a0' and `a1' right by the
168number of bits given in `count'. If any nonzero bits are shifted off, they
169are ``jammed'' into the least significant bit of the result by setting the
170least significant bit to 1. The value of `count' can be arbitrarily large;
171in particular, if `count' is greater than 128, the result will be either 0
172or 1, depending on whether the concatenation of `a0' and `a1' is zero or
173nonzero. The result is broken into two 64-bit pieces which are stored at
174the locations pointed to by `z0Ptr' and `z1Ptr'.
175-------------------------------------------------------------------------------
176*/
177INLINE void
178 shift128RightJamming(
179 bits64 a0, bits64 a1, int16 count, bits64 *z0Ptr, bits64 *z1Ptr )
180{
181 bits64 z0, z1;
182 int8 negCount = ( - count ) & 63;
183
184 if ( count == 0 ) {
185 z1 = a1;
186 z0 = a0;
187 }
188 else if ( count < 64 ) {
189 z1 = ( a0<<negCount ) | ( a1>>count ) | ( ( a1<<negCount ) != 0 );
190 z0 = a0>>count;
191 }
192 else {
193 if ( count == 64 ) {
194 z1 = a0 | ( a1 != 0 );
195 }
196 else if ( count < 128 ) {
197 z1 = ( a0>>( count & 63 ) ) | ( ( ( a0<<negCount ) | a1 ) != 0 );
198 }
199 else {
200 z1 = ( ( a0 | a1 ) != 0 );
201 }
202 z0 = 0;
203 }
204 *z1Ptr = z1;
205 *z0Ptr = z0;
206
207}
208
209/*
210-------------------------------------------------------------------------------
211Shifts the 192-bit value formed by concatenating `a0', `a1', and `a2' right
212by 64 _plus_ the number of bits given in `count'. The shifted result is
213at most 128 nonzero bits; these are broken into two 64-bit pieces which are
214stored at the locations pointed to by `z0Ptr' and `z1Ptr'. The bits shifted
215off form a third 64-bit result as follows: The _last_ bit shifted off is
216the most-significant bit of the extra result, and the other 63 bits of the
217extra result are all zero if and only if _all_but_the_last_ bits shifted off
218were all zero. This extra result is stored in the location pointed to by
219`z2Ptr'. The value of `count' can be arbitrarily large.
220 (This routine makes more sense if `a0', `a1', and `a2' are considered
221to form a fixed-point value with binary point between `a1' and `a2'. This
222fixed-point value is shifted right by the number of bits given in `count',
223and the integer part of the result is returned at the locations pointed to
224by `z0Ptr' and `z1Ptr'. The fractional part of the result may be slightly
225corrupted as described above, and is returned at the location pointed to by
226`z2Ptr'.)
227-------------------------------------------------------------------------------
228*/
229INLINE void
230 shift128ExtraRightJamming(
231 bits64 a0,
232 bits64 a1,
233 bits64 a2,
234 int16 count,
235 bits64 *z0Ptr,
236 bits64 *z1Ptr,
237 bits64 *z2Ptr
238 )
239{
240 bits64 z0, z1, z2;
241 int8 negCount = ( - count ) & 63;
242
243 if ( count == 0 ) {
244 z2 = a2;
245 z1 = a1;
246 z0 = a0;
247 }
248 else {
249 if ( count < 64 ) {
250 z2 = a1<<negCount;
251 z1 = ( a0<<negCount ) | ( a1>>count );
252 z0 = a0>>count;
253 }
254 else {
255 if ( count == 64 ) {
256 z2 = a1;
257 z1 = a0;
258 }
259 else {
260 a2 |= a1;
261 if ( count < 128 ) {
262 z2 = a0<<negCount;
263 z1 = a0>>( count & 63 );
264 }
265 else {
266 z2 = ( count == 128 ) ? a0 : ( a0 != 0 );
267 z1 = 0;
268 }
269 }
270 z0 = 0;
271 }
272 z2 |= ( a2 != 0 );
273 }
274 *z2Ptr = z2;
275 *z1Ptr = z1;
276 *z0Ptr = z0;
277
278}
279
280/*
281-------------------------------------------------------------------------------
282Shifts the 128-bit value formed by concatenating `a0' and `a1' left by the
283number of bits given in `count'. Any bits shifted off are lost. The value
284of `count' must be less than 64. The result is broken into two 64-bit
285pieces which are stored at the locations pointed to by `z0Ptr' and `z1Ptr'.
286-------------------------------------------------------------------------------
287*/
288INLINE void
289 shortShift128Left(
290 bits64 a0, bits64 a1, int16 count, bits64 *z0Ptr, bits64 *z1Ptr )
291{
292
293 *z1Ptr = a1<<count;
294 *z0Ptr =
295 ( count == 0 ) ? a0 : ( a0<<count ) | ( a1>>( ( - count ) & 63 ) );
296
297}
298
299/*
300-------------------------------------------------------------------------------
301Shifts the 192-bit value formed by concatenating `a0', `a1', and `a2' left
302by the number of bits given in `count'. Any bits shifted off are lost.
303The value of `count' must be less than 64. The result is broken into three
30464-bit pieces which are stored at the locations pointed to by `z0Ptr',
305`z1Ptr', and `z2Ptr'.
306-------------------------------------------------------------------------------
307*/
308INLINE void
309 shortShift192Left(
310 bits64 a0,
311 bits64 a1,
312 bits64 a2,
313 int16 count,
314 bits64 *z0Ptr,
315 bits64 *z1Ptr,
316 bits64 *z2Ptr
317 )
318{
319 bits64 z0, z1, z2;
320 int8 negCount;
321
322 z2 = a2<<count;
323 z1 = a1<<count;
324 z0 = a0<<count;
325 if ( 0 < count ) {
326 negCount = ( ( - count ) & 63 );
327 z1 |= a2>>negCount;
328 z0 |= a1>>negCount;
329 }
330 *z2Ptr = z2;
331 *z1Ptr = z1;
332 *z0Ptr = z0;
333
334}
335
336/*
337-------------------------------------------------------------------------------
338Adds the 128-bit value formed by concatenating `a0' and `a1' to the 128-bit
339value formed by concatenating `b0' and `b1'. Addition is modulo 2^128, so
340any carry out is lost. The result is broken into two 64-bit pieces which
341are stored at the locations pointed to by `z0Ptr' and `z1Ptr'.
342-------------------------------------------------------------------------------
343*/
344INLINE void
345 add128(
346 bits64 a0, bits64 a1, bits64 b0, bits64 b1, bits64 *z0Ptr, bits64 *z1Ptr )
347{
348 bits64 z1;
349
350 z1 = a1 + b1;
351 *z1Ptr = z1;
352 *z0Ptr = a0 + b0 + ( z1 < a1 );
353
354}
355
356/*
357-------------------------------------------------------------------------------
358Adds the 192-bit value formed by concatenating `a0', `a1', and `a2' to the
359192-bit value formed by concatenating `b0', `b1', and `b2'. Addition is
360modulo 2^192, so any carry out is lost. The result is broken into three
36164-bit pieces which are stored at the locations pointed to by `z0Ptr',
362`z1Ptr', and `z2Ptr'.
363-------------------------------------------------------------------------------
364*/
365INLINE void
366 add192(
367 bits64 a0,
368 bits64 a1,
369 bits64 a2,
370 bits64 b0,
371 bits64 b1,
372 bits64 b2,
373 bits64 *z0Ptr,
374 bits64 *z1Ptr,
375 bits64 *z2Ptr
376 )
377{
378 bits64 z0, z1, z2;
379 int8 carry0, carry1;
380
381 z2 = a2 + b2;
382 carry1 = ( z2 < a2 );
383 z1 = a1 + b1;
384 carry0 = ( z1 < a1 );
385 z0 = a0 + b0;
386 z1 += carry1;
387 z0 += ( z1 < carry1 );
388 z0 += carry0;
389 *z2Ptr = z2;
390 *z1Ptr = z1;
391 *z0Ptr = z0;
392
393}
394
395/*
396-------------------------------------------------------------------------------
397Subtracts the 128-bit value formed by concatenating `b0' and `b1' from the
398128-bit value formed by concatenating `a0' and `a1'. Subtraction is modulo
3992^128, so any borrow out (carry out) is lost. The result is broken into two
40064-bit pieces which are stored at the locations pointed to by `z0Ptr' and
401`z1Ptr'.
402-------------------------------------------------------------------------------
403*/
404INLINE void
405 sub128(
406 bits64 a0, bits64 a1, bits64 b0, bits64 b1, bits64 *z0Ptr, bits64 *z1Ptr )
407{
408
409 *z1Ptr = a1 - b1;
410 *z0Ptr = a0 - b0 - ( a1 < b1 );
411
412}
413
414/*
415-------------------------------------------------------------------------------
416Subtracts the 192-bit value formed by concatenating `b0', `b1', and `b2'
417from the 192-bit value formed by concatenating `a0', `a1', and `a2'.
418Subtraction is modulo 2^192, so any borrow out (carry out) is lost. The
419result is broken into three 64-bit pieces which are stored at the locations
420pointed to by `z0Ptr', `z1Ptr', and `z2Ptr'.
421-------------------------------------------------------------------------------
422*/
423INLINE void
424 sub192(
425 bits64 a0,
426 bits64 a1,
427 bits64 a2,
428 bits64 b0,
429 bits64 b1,
430 bits64 b2,
431 bits64 *z0Ptr,
432 bits64 *z1Ptr,
433 bits64 *z2Ptr
434 )
435{
436 bits64 z0, z1, z2;
437 int8 borrow0, borrow1;
438
439 z2 = a2 - b2;
440 borrow1 = ( a2 < b2 );
441 z1 = a1 - b1;
442 borrow0 = ( a1 < b1 );
443 z0 = a0 - b0;
444 z0 -= ( z1 < borrow1 );
445 z1 -= borrow1;
446 z0 -= borrow0;
447 *z2Ptr = z2;
448 *z1Ptr = z1;
449 *z0Ptr = z0;
450
451}
452
453/*
454-------------------------------------------------------------------------------
455Multiplies `a' by `b' to obtain a 128-bit product. The product is broken
456into two 64-bit pieces which are stored at the locations pointed to by
457`z0Ptr' and `z1Ptr'.
458-------------------------------------------------------------------------------
459*/
460INLINE void mul64To128( bits64 a, bits64 b, bits64 *z0Ptr, bits64 *z1Ptr )
461{
462 bits32 aHigh, aLow, bHigh, bLow;
463 bits64 z0, zMiddleA, zMiddleB, z1;
464
465 aLow = a;
466 aHigh = a>>32;
467 bLow = b;
468 bHigh = b>>32;
469 z1 = ( (bits64) aLow ) * bLow;
470 zMiddleA = ( (bits64) aLow ) * bHigh;
471 zMiddleB = ( (bits64) aHigh ) * bLow;
472 z0 = ( (bits64) aHigh ) * bHigh;
473 zMiddleA += zMiddleB;
474 z0 += ( ( (bits64) ( zMiddleA < zMiddleB ) )<<32 ) + ( zMiddleA>>32 );
475 zMiddleA <<= 32;
476 z1 += zMiddleA;
477 z0 += ( z1 < zMiddleA );
478 *z1Ptr = z1;
479 *z0Ptr = z0;
480
481}
482
483/*
484-------------------------------------------------------------------------------
485Multiplies the 128-bit value formed by concatenating `a0' and `a1' by `b' to
486obtain a 192-bit product. The product is broken into three 64-bit pieces
487which are stored at the locations pointed to by `z0Ptr', `z1Ptr', and
488`z2Ptr'.
489-------------------------------------------------------------------------------
490*/
491INLINE void
492 mul128By64To192(
493 bits64 a0,
494 bits64 a1,
495 bits64 b,
496 bits64 *z0Ptr,
497 bits64 *z1Ptr,
498 bits64 *z2Ptr
499 )
500{
501 bits64 z0, z1, z2, more1;
502
503 mul64To128( a1, b, &z1, &z2 );
504 mul64To128( a0, b, &z0, &more1 );
505 add128( z0, more1, 0, z1, &z0, &z1 );
506 *z2Ptr = z2;
507 *z1Ptr = z1;
508 *z0Ptr = z0;
509
510}
511
512/*
513-------------------------------------------------------------------------------
514Multiplies the 128-bit value formed by concatenating `a0' and `a1' to the
515128-bit value formed by concatenating `b0' and `b1' to obtain a 256-bit
516product. The product is broken into four 64-bit pieces which are stored at
517the locations pointed to by `z0Ptr', `z1Ptr', `z2Ptr', and `z3Ptr'.
518-------------------------------------------------------------------------------
519*/
520INLINE void
521 mul128To256(
522 bits64 a0,
523 bits64 a1,
524 bits64 b0,
525 bits64 b1,
526 bits64 *z0Ptr,
527 bits64 *z1Ptr,
528 bits64 *z2Ptr,
529 bits64 *z3Ptr
530 )
531{
532 bits64 z0, z1, z2, z3;
533 bits64 more1, more2;
534
535 mul64To128( a1, b1, &z2, &z3 );
536 mul64To128( a1, b0, &z1, &more2 );
537 add128( z1, more2, 0, z2, &z1, &z2 );
538 mul64To128( a0, b0, &z0, &more1 );
539 add128( z0, more1, 0, z1, &z0, &z1 );
540 mul64To128( a0, b1, &more1, &more2 );
541 add128( more1, more2, 0, z2, &more1, &z2 );
542 add128( z0, z1, 0, more1, &z0, &z1 );
543 *z3Ptr = z3;
544 *z2Ptr = z2;
545 *z1Ptr = z1;
546 *z0Ptr = z0;
547
548}
549
550/*
551-------------------------------------------------------------------------------
552Returns an approximation to the 64-bit integer quotient obtained by dividing
553`b' into the 128-bit value formed by concatenating `a0' and `a1'. The
554divisor `b' must be at least 2^63. If q is the exact quotient truncated
555toward zero, the approximation returned lies between q and q + 2 inclusive.
556If the exact quotient q is larger than 64 bits, the maximum positive 64-bit
557unsigned integer is returned.
558-------------------------------------------------------------------------------
559*/
560static bits64 estimateDiv128To64( bits64 a0, bits64 a1, bits64 b )
561{
562 bits64 b0, b1;
563 bits64 rem0, rem1, term0, term1;
564 bits64 z;
565 if ( b <= a0 ) return LIT64( 0xFFFFFFFFFFFFFFFF );
566 b0 = b>>32;
567 z = ( b0<<32 <= a0 ) ? LIT64( 0xFFFFFFFF00000000 ) : ( a0 / b0 )<<32;
568 mul64To128( b, z, &term0, &term1 );
569 sub128( a0, a1, term0, term1, &rem0, &rem1 );
570 while ( ( (sbits64) rem0 ) < 0 ) {
571 z -= LIT64( 0x100000000 );
572 b1 = b<<32;
573 add128( rem0, rem1, b0, b1, &rem0, &rem1 );
574 }
575 rem0 = ( rem0<<32 ) | ( rem1>>32 );
576 z |= ( b0<<32 <= rem0 ) ? 0xFFFFFFFF : rem0 / b0;
577 return z;
578
579}
580
581/*
582-------------------------------------------------------------------------------
583Returns an approximation to the square root of the 32-bit significand given
584by `a'. Considered as an integer, `a' must be at least 2^31. If bit 0 of
585`aExp' (the least significant bit) is 1, the integer returned approximates
5862^31*sqrt(`a'/2^31), where `a' is considered an integer. If bit 0 of `aExp'
587is 0, the integer returned approximates 2^31*sqrt(`a'/2^30). In either
588case, the approximation returned lies strictly within +/-2 of the exact
589value.
590-------------------------------------------------------------------------------
591*/
592static bits32 estimateSqrt32( int16 aExp, bits32 a )
593{
594 static const bits16 sqrtOddAdjustments[] = {
595 0x0004, 0x0022, 0x005D, 0x00B1, 0x011D, 0x019F, 0x0236, 0x02E0,
596 0x039C, 0x0468, 0x0545, 0x0631, 0x072B, 0x0832, 0x0946, 0x0A67
597 };
598 static const bits16 sqrtEvenAdjustments[] = {
599 0x0A2D, 0x08AF, 0x075A, 0x0629, 0x051A, 0x0429, 0x0356, 0x029E,
600 0x0200, 0x0179, 0x0109, 0x00AF, 0x0068, 0x0034, 0x0012, 0x0002
601 };
602 int8 index;
603 bits32 z;
604
605 index = ( a>>27 ) & 15;
606 if ( aExp & 1 ) {
607 z = 0x4000 + ( a>>17 ) - sqrtOddAdjustments[ index ];
608 z = ( ( a / z )<<14 ) + ( z<<15 );
609 a >>= 1;
610 }
611 else {
612 z = 0x8000 + ( a>>17 ) - sqrtEvenAdjustments[ index ];
613 z = a / z + z;
614 z = ( 0x20000 <= z ) ? 0xFFFF8000 : ( z<<15 );
615 if ( z <= a ) return (bits32) ( ( (sbits32) a )>>1 );
616 }
617 return ( (bits32) ( ( ( (bits64) a )<<31 ) / z ) ) + ( z>>1 );
618
619}
620
621/*
622-------------------------------------------------------------------------------
623Returns the number of leading 0 bits before the most-significant 1 bit
624of `a'. If `a' is zero, 32 is returned.
625-------------------------------------------------------------------------------
626*/
627static int8 countLeadingZeros32( bits32 a )
628{
629 static const int8 countLeadingZerosHigh[] = {
630 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
631 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
635 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
636 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
637 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
638 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
639 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
640 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
641 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
642 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
643 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
644 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
645 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
646 };
647 int8 shiftCount;
648
649 shiftCount = 0;
650 if ( a < 0x10000 ) {
651 shiftCount += 16;
652 a <<= 16;
653 }
654 if ( a < 0x1000000 ) {
655 shiftCount += 8;
656 a <<= 8;
657 }
658 shiftCount += countLeadingZerosHigh[ a>>24 ];
659 return shiftCount;
660
661}
662
663/*
664-------------------------------------------------------------------------------
665Returns the number of leading 0 bits before the most-significant 1 bit
666of `a'. If `a' is zero, 64 is returned.
667-------------------------------------------------------------------------------
668*/
669static int8 countLeadingZeros64( bits64 a )
670{
671 int8 shiftCount;
672
673 shiftCount = 0;
674 if ( a < ( (bits64) 1 )<<32 ) {
675 shiftCount += 32;
676 }
677 else {
678 a >>= 32;
679 }
680 shiftCount += countLeadingZeros32( a );
681 return shiftCount;
682
683}
684
685/*
686-------------------------------------------------------------------------------
687Returns 1 if the 128-bit value formed by concatenating `a0' and `a1'
688is equal to the 128-bit value formed by concatenating `b0' and `b1'.
689Otherwise, returns 0.
690-------------------------------------------------------------------------------
691*/
692INLINE flag eq128( bits64 a0, bits64 a1, bits64 b0, bits64 b1 )
693{
694
695 return ( a0 == b0 ) && ( a1 == b1 );
696
697}
698
699/*
700-------------------------------------------------------------------------------
701Returns 1 if the 128-bit value formed by concatenating `a0' and `a1' is less
702than or equal to the 128-bit value formed by concatenating `b0' and `b1'.
703Otherwise, returns 0.
704-------------------------------------------------------------------------------
705*/
706INLINE flag le128( bits64 a0, bits64 a1, bits64 b0, bits64 b1 )
707{
708
709 return ( a0 < b0 ) || ( ( a0 == b0 ) && ( a1 <= b1 ) );
710
711}
712
713/*
714-------------------------------------------------------------------------------
715Returns 1 if the 128-bit value formed by concatenating `a0' and `a1' is less
716than the 128-bit value formed by concatenating `b0' and `b1'. Otherwise,
717returns 0.
718-------------------------------------------------------------------------------
719*/
720INLINE flag lt128( bits64 a0, bits64 a1, bits64 b0, bits64 b1 )
721{
722
723 return ( a0 < b0 ) || ( ( a0 == b0 ) && ( a1 < b1 ) );
724
725}
726
727/*
728-------------------------------------------------------------------------------
729Returns 1 if the 128-bit value formed by concatenating `a0' and `a1' is
730not equal to the 128-bit value formed by concatenating `b0' and `b1'.
731Otherwise, returns 0.
732-------------------------------------------------------------------------------
733*/
734INLINE flag ne128( bits64 a0, bits64 a1, bits64 b0, bits64 b1 )
735{
736
737 return ( a0 != b0 ) || ( a1 != b1 );
738
739}
740
diff --git a/arch/arm/nwfpe/softfloat-specialize b/arch/arm/nwfpe/softfloat-specialize
new file mode 100644
index 000000000000..acf409144763
--- /dev/null
+++ b/arch/arm/nwfpe/softfloat-specialize
@@ -0,0 +1,366 @@
1
2/*
3===============================================================================
4
5This C source fragment is part of the SoftFloat IEC/IEEE Floating-point
6Arithmetic Package, Release 2.
7
8Written by John R. Hauser. This work was made possible in part by the
9International Computer Science Institute, located at Suite 600, 1947 Center
10Street, Berkeley, California 94704. Funding was partially provided by the
11National Science Foundation under grant MIP-9311980. The original version
12of this code was written as part of a project to build a fixed-point vector
13processor in collaboration with the University of California at Berkeley,
14overseen by Profs. Nelson Morgan and John Wawrzynek. More information
15is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
16arithmetic/softfloat.html'.
17
18THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
19has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
20TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
21PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
22AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
23
24Derivative works are acceptable, even for commercial purposes, so long as
25(1) they include prominent notice that the work is derivative, and (2) they
26include prominent notice akin to these three paragraphs for those parts of
27this code that are retained.
28
29===============================================================================
30*/
31
32/*
33-------------------------------------------------------------------------------
34Underflow tininess-detection mode, statically initialized to default value.
35(The declaration in `softfloat.h' must match the `int8' type here.)
36-------------------------------------------------------------------------------
37*/
38int8 float_detect_tininess = float_tininess_after_rounding;
39
40/*
41-------------------------------------------------------------------------------
42Raises the exceptions specified by `flags'. Floating-point traps can be
43defined here if desired. It is currently not possible for such a trap to
44substitute a result value. If traps are not implemented, this routine
45should be simply `float_exception_flags |= flags;'.
46
47ScottB: November 4, 1998
48Moved this function out of softfloat-specialize into fpmodule.c.
49This effectively isolates all the changes required for integrating with the
50Linux kernel into fpmodule.c. Porting to NetBSD should only require modifying
51fpmodule.c to integrate with the NetBSD kernel (I hope!).
52-------------------------------------------------------------------------------
53void float_raise( int8 flags )
54{
55 float_exception_flags |= flags;
56}
57*/
58
59/*
60-------------------------------------------------------------------------------
61Internal canonical NaN format.
62-------------------------------------------------------------------------------
63*/
64typedef struct {
65 flag sign;
66 bits64 high, low;
67} commonNaNT;
68
69/*
70-------------------------------------------------------------------------------
71The pattern for a default generated single-precision NaN.
72-------------------------------------------------------------------------------
73*/
74#define float32_default_nan 0xFFFFFFFF
75
76/*
77-------------------------------------------------------------------------------
78Returns 1 if the single-precision floating-point value `a' is a NaN;
79otherwise returns 0.
80-------------------------------------------------------------------------------
81*/
82flag float32_is_nan( float32 a )
83{
84
85 return ( 0xFF000000 < (bits32) ( a<<1 ) );
86
87}
88
89/*
90-------------------------------------------------------------------------------
91Returns 1 if the single-precision floating-point value `a' is a signaling
92NaN; otherwise returns 0.
93-------------------------------------------------------------------------------
94*/
95flag float32_is_signaling_nan( float32 a )
96{
97
98 return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF );
99
100}
101
102/*
103-------------------------------------------------------------------------------
104Returns the result of converting the single-precision floating-point NaN
105`a' to the canonical NaN format. If `a' is a signaling NaN, the invalid
106exception is raised.
107-------------------------------------------------------------------------------
108*/
109static commonNaNT float32ToCommonNaN( float32 a )
110{
111 commonNaNT z;
112
113 if ( float32_is_signaling_nan( a ) ) float_raise( float_flag_invalid );
114 z.sign = a>>31;
115 z.low = 0;
116 z.high = ( (bits64) a )<<41;
117 return z;
118
119}
120
121/*
122-------------------------------------------------------------------------------
123Returns the result of converting the canonical NaN `a' to the single-
124precision floating-point format.
125-------------------------------------------------------------------------------
126*/
127static float32 commonNaNToFloat32( commonNaNT a )
128{
129
130 return ( ( (bits32) a.sign )<<31 ) | 0x7FC00000 | ( a.high>>41 );
131
132}
133
134/*
135-------------------------------------------------------------------------------
136Takes two single-precision floating-point values `a' and `b', one of which
137is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a
138signaling NaN, the invalid exception is raised.
139-------------------------------------------------------------------------------
140*/
141static float32 propagateFloat32NaN( float32 a, float32 b )
142{
143 flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN;
144
145 aIsNaN = float32_is_nan( a );
146 aIsSignalingNaN = float32_is_signaling_nan( a );
147 bIsNaN = float32_is_nan( b );
148 bIsSignalingNaN = float32_is_signaling_nan( b );
149 a |= 0x00400000;
150 b |= 0x00400000;
151 if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid );
152 if ( aIsNaN ) {
153 return ( aIsSignalingNaN & bIsNaN ) ? b : a;
154 }
155 else {
156 return b;
157 }
158
159}
160
161/*
162-------------------------------------------------------------------------------
163The pattern for a default generated double-precision NaN.
164-------------------------------------------------------------------------------
165*/
166#define float64_default_nan LIT64( 0xFFFFFFFFFFFFFFFF )
167
168/*
169-------------------------------------------------------------------------------
170Returns 1 if the double-precision floating-point value `a' is a NaN;
171otherwise returns 0.
172-------------------------------------------------------------------------------
173*/
174flag float64_is_nan( float64 a )
175{
176
177 return ( LIT64( 0xFFE0000000000000 ) < (bits64) ( a<<1 ) );
178
179}
180
181/*
182-------------------------------------------------------------------------------
183Returns 1 if the double-precision floating-point value `a' is a signaling
184NaN; otherwise returns 0.
185-------------------------------------------------------------------------------
186*/
187flag float64_is_signaling_nan( float64 a )
188{
189
190 return
191 ( ( ( a>>51 ) & 0xFFF ) == 0xFFE )
192 && ( a & LIT64( 0x0007FFFFFFFFFFFF ) );
193
194}
195
196/*
197-------------------------------------------------------------------------------
198Returns the result of converting the double-precision floating-point NaN
199`a' to the canonical NaN format. If `a' is a signaling NaN, the invalid
200exception is raised.
201-------------------------------------------------------------------------------
202*/
203static commonNaNT float64ToCommonNaN( float64 a )
204{
205 commonNaNT z;
206
207 if ( float64_is_signaling_nan( a ) ) float_raise( float_flag_invalid );
208 z.sign = a>>63;
209 z.low = 0;
210 z.high = a<<12;
211 return z;
212
213}
214
215/*
216-------------------------------------------------------------------------------
217Returns the result of converting the canonical NaN `a' to the double-
218precision floating-point format.
219-------------------------------------------------------------------------------
220*/
221static float64 commonNaNToFloat64( commonNaNT a )
222{
223
224 return
225 ( ( (bits64) a.sign )<<63 )
226 | LIT64( 0x7FF8000000000000 )
227 | ( a.high>>12 );
228
229}
230
231/*
232-------------------------------------------------------------------------------
233Takes two double-precision floating-point values `a' and `b', one of which
234is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a
235signaling NaN, the invalid exception is raised.
236-------------------------------------------------------------------------------
237*/
238static float64 propagateFloat64NaN( float64 a, float64 b )
239{
240 flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN;
241
242 aIsNaN = float64_is_nan( a );
243 aIsSignalingNaN = float64_is_signaling_nan( a );
244 bIsNaN = float64_is_nan( b );
245 bIsSignalingNaN = float64_is_signaling_nan( b );
246 a |= LIT64( 0x0008000000000000 );
247 b |= LIT64( 0x0008000000000000 );
248 if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid );
249 if ( aIsNaN ) {
250 return ( aIsSignalingNaN & bIsNaN ) ? b : a;
251 }
252 else {
253 return b;
254 }
255
256}
257
258#ifdef FLOATX80
259
260/*
261-------------------------------------------------------------------------------
262The pattern for a default generated extended double-precision NaN. The
263`high' and `low' values hold the most- and least-significant bits,
264respectively.
265-------------------------------------------------------------------------------
266*/
267#define floatx80_default_nan_high 0xFFFF
268#define floatx80_default_nan_low LIT64( 0xFFFFFFFFFFFFFFFF )
269
270/*
271-------------------------------------------------------------------------------
272Returns 1 if the extended double-precision floating-point value `a' is a
273NaN; otherwise returns 0.
274-------------------------------------------------------------------------------
275*/
276flag floatx80_is_nan( floatx80 a )
277{
278
279 return ( ( a.high & 0x7FFF ) == 0x7FFF ) && (bits64) ( a.low<<1 );
280
281}
282
283/*
284-------------------------------------------------------------------------------
285Returns 1 if the extended double-precision floating-point value `a' is a
286signaling NaN; otherwise returns 0.
287-------------------------------------------------------------------------------
288*/
289flag floatx80_is_signaling_nan( floatx80 a )
290{
291 //register int lr;
292 bits64 aLow;
293
294 //__asm__("mov %0, lr" : : "g" (lr));
295 //fp_printk("floatx80_is_signalling_nan() called from 0x%08x\n",lr);
296 aLow = a.low & ~ LIT64( 0x4000000000000000 );
297 return
298 ( ( a.high & 0x7FFF ) == 0x7FFF )
299 && (bits64) ( aLow<<1 )
300 && ( a.low == aLow );
301
302}
303
304/*
305-------------------------------------------------------------------------------
306Returns the result of converting the extended double-precision floating-
307point NaN `a' to the canonical NaN format. If `a' is a signaling NaN, the
308invalid exception is raised.
309-------------------------------------------------------------------------------
310*/
311static commonNaNT floatx80ToCommonNaN( floatx80 a )
312{
313 commonNaNT z;
314
315 if ( floatx80_is_signaling_nan( a ) ) float_raise( float_flag_invalid );
316 z.sign = a.high>>15;
317 z.low = 0;
318 z.high = a.low<<1;
319 return z;
320
321}
322
323/*
324-------------------------------------------------------------------------------
325Returns the result of converting the canonical NaN `a' to the extended
326double-precision floating-point format.
327-------------------------------------------------------------------------------
328*/
329static floatx80 commonNaNToFloatx80( commonNaNT a )
330{
331 floatx80 z;
332
333 z.low = LIT64( 0xC000000000000000 ) | ( a.high>>1 );
334 z.high = ( ( (bits16) a.sign )<<15 ) | 0x7FFF;
335 return z;
336
337}
338
339/*
340-------------------------------------------------------------------------------
341Takes two extended double-precision floating-point values `a' and `b', one
342of which is a NaN, and returns the appropriate NaN result. If either `a' or
343`b' is a signaling NaN, the invalid exception is raised.
344-------------------------------------------------------------------------------
345*/
346static floatx80 propagateFloatx80NaN( floatx80 a, floatx80 b )
347{
348 flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN;
349
350 aIsNaN = floatx80_is_nan( a );
351 aIsSignalingNaN = floatx80_is_signaling_nan( a );
352 bIsNaN = floatx80_is_nan( b );
353 bIsSignalingNaN = floatx80_is_signaling_nan( b );
354 a.low |= LIT64( 0xC000000000000000 );
355 b.low |= LIT64( 0xC000000000000000 );
356 if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid );
357 if ( aIsNaN ) {
358 return ( aIsSignalingNaN & bIsNaN ) ? b : a;
359 }
360 else {
361 return b;
362 }
363
364}
365
366#endif
diff --git a/arch/arm/nwfpe/softfloat.c b/arch/arm/nwfpe/softfloat.c
new file mode 100644
index 000000000000..9d743ae29062
--- /dev/null
+++ b/arch/arm/nwfpe/softfloat.c
@@ -0,0 +1,3443 @@
1/*
2===============================================================================
3
4This C source file is part of the SoftFloat IEC/IEEE Floating-point
5Arithmetic Package, Release 2.
6
7Written by John R. Hauser. This work was made possible in part by the
8International Computer Science Institute, located at Suite 600, 1947 Center
9Street, Berkeley, California 94704. Funding was partially provided by the
10National Science Foundation under grant MIP-9311980. The original version
11of this code was written as part of a project to build a fixed-point vector
12processor in collaboration with the University of California at Berkeley,
13overseen by Profs. Nelson Morgan and John Wawrzynek. More information
14is available through the web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
15arithmetic/softfloat.html'.
16
17THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
18has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
19TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
20PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
21AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
22
23Derivative works are acceptable, even for commercial purposes, so long as
24(1) they include prominent notice that the work is derivative, and (2) they
25include prominent notice akin to these three paragraphs for those parts of
26this code that are retained.
27
28===============================================================================
29*/
30
31#include "fpa11.h"
32//#include "milieu.h"
33//#include "softfloat.h"
34
35/*
36-------------------------------------------------------------------------------
37Floating-point rounding mode, extended double-precision rounding precision,
38and exception flags.
39-------------------------------------------------------------------------------
40*/
41int8 float_rounding_mode = float_round_nearest_even;
42int8 floatx80_rounding_precision = 80;
43int8 float_exception_flags;
44
45/*
46-------------------------------------------------------------------------------
47Primitive arithmetic functions, including multi-word arithmetic, and
48division and square root approximations. (Can be specialized to target if
49desired.)
50-------------------------------------------------------------------------------
51*/
52#include "softfloat-macros"
53
54/*
55-------------------------------------------------------------------------------
56Functions and definitions to determine: (1) whether tininess for underflow
57is detected before or after rounding by default, (2) what (if anything)
58happens when exceptions are raised, (3) how signaling NaNs are distinguished
59from quiet NaNs, (4) the default generated quiet NaNs, and (5) how NaNs
60are propagated from function inputs to output. These details are target-
61specific.
62-------------------------------------------------------------------------------
63*/
64#include "softfloat-specialize"
65
66/*
67-------------------------------------------------------------------------------
68Takes a 64-bit fixed-point value `absZ' with binary point between bits 6
69and 7, and returns the properly rounded 32-bit integer corresponding to the
70input. If `zSign' is nonzero, the input is negated before being converted
71to an integer. Bit 63 of `absZ' must be zero. Ordinarily, the fixed-point
72input is simply rounded to an integer, with the inexact exception raised if
73the input cannot be represented exactly as an integer. If the fixed-point
74input is too large, however, the invalid exception is raised and the largest
75positive or negative integer is returned.
76-------------------------------------------------------------------------------
77*/
78static int32 roundAndPackInt32( flag zSign, bits64 absZ )
79{
80 int8 roundingMode;
81 flag roundNearestEven;
82 int8 roundIncrement, roundBits;
83 int32 z;
84
85 roundingMode = float_rounding_mode;
86 roundNearestEven = ( roundingMode == float_round_nearest_even );
87 roundIncrement = 0x40;
88 if ( ! roundNearestEven ) {
89 if ( roundingMode == float_round_to_zero ) {
90 roundIncrement = 0;
91 }
92 else {
93 roundIncrement = 0x7F;
94 if ( zSign ) {
95 if ( roundingMode == float_round_up ) roundIncrement = 0;
96 }
97 else {
98 if ( roundingMode == float_round_down ) roundIncrement = 0;
99 }
100 }
101 }
102 roundBits = absZ & 0x7F;
103 absZ = ( absZ + roundIncrement )>>7;
104 absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
105 z = absZ;
106 if ( zSign ) z = - z;
107 if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) {
108 float_exception_flags |= float_flag_invalid;
109 return zSign ? 0x80000000 : 0x7FFFFFFF;
110 }
111 if ( roundBits ) float_exception_flags |= float_flag_inexact;
112 return z;
113
114}
115
116/*
117-------------------------------------------------------------------------------
118Returns the fraction bits of the single-precision floating-point value `a'.
119-------------------------------------------------------------------------------
120*/
121INLINE bits32 extractFloat32Frac( float32 a )
122{
123
124 return a & 0x007FFFFF;
125
126}
127
128/*
129-------------------------------------------------------------------------------
130Returns the exponent bits of the single-precision floating-point value `a'.
131-------------------------------------------------------------------------------
132*/
133INLINE int16 extractFloat32Exp( float32 a )
134{
135
136 return ( a>>23 ) & 0xFF;
137
138}
139
140/*
141-------------------------------------------------------------------------------
142Returns the sign bit of the single-precision floating-point value `a'.
143-------------------------------------------------------------------------------
144*/
145#if 0 /* in softfloat.h */
146INLINE flag extractFloat32Sign( float32 a )
147{
148
149 return a>>31;
150
151}
152#endif
153
154/*
155-------------------------------------------------------------------------------
156Normalizes the subnormal single-precision floating-point value represented
157by the denormalized significand `aSig'. The normalized exponent and
158significand are stored at the locations pointed to by `zExpPtr' and
159`zSigPtr', respectively.
160-------------------------------------------------------------------------------
161*/
162static void
163 normalizeFloat32Subnormal( bits32 aSig, int16 *zExpPtr, bits32 *zSigPtr )
164{
165 int8 shiftCount;
166
167 shiftCount = countLeadingZeros32( aSig ) - 8;
168 *zSigPtr = aSig<<shiftCount;
169 *zExpPtr = 1 - shiftCount;
170
171}
172
173/*
174-------------------------------------------------------------------------------
175Packs the sign `zSign', exponent `zExp', and significand `zSig' into a
176single-precision floating-point value, returning the result. After being
177shifted into the proper positions, the three fields are simply added
178together to form the result. This means that any integer portion of `zSig'
179will be added into the exponent. Since a properly normalized significand
180will have an integer portion equal to 1, the `zExp' input should be 1 less
181than the desired result exponent whenever `zSig' is a complete, normalized
182significand.
183-------------------------------------------------------------------------------
184*/
185INLINE float32 packFloat32( flag zSign, int16 zExp, bits32 zSig )
186{
187#if 0
188 float32 f;
189 __asm__("@ packFloat32 \n\
190 mov %0, %1, asl #31 \n\
191 orr %0, %2, asl #23 \n\
192 orr %0, %3"
193 : /* no outputs */
194 : "g" (f), "g" (zSign), "g" (zExp), "g" (zSig)
195 : "cc");
196 return f;
197#else
198 return ( ( (bits32) zSign )<<31 ) + ( ( (bits32) zExp )<<23 ) + zSig;
199#endif
200}
201
202/*
203-------------------------------------------------------------------------------
204Takes an abstract floating-point value having sign `zSign', exponent `zExp',
205and significand `zSig', and returns the proper single-precision floating-
206point value corresponding to the abstract input. Ordinarily, the abstract
207value is simply rounded and packed into the single-precision format, with
208the inexact exception raised if the abstract input cannot be represented
209exactly. If the abstract value is too large, however, the overflow and
210inexact exceptions are raised and an infinity or maximal finite value is
211returned. If the abstract value is too small, the input value is rounded to
212a subnormal number, and the underflow and inexact exceptions are raised if
213the abstract input cannot be represented exactly as a subnormal single-
214precision floating-point number.
215 The input significand `zSig' has its binary point between bits 30
216and 29, which is 7 bits to the left of the usual location. This shifted
217significand must be normalized or smaller. If `zSig' is not normalized,
218`zExp' must be 0; in that case, the result returned is a subnormal number,
219and it must not require rounding. In the usual case that `zSig' is
220normalized, `zExp' must be 1 less than the ``true'' floating-point exponent.
221The handling of underflow and overflow follows the IEC/IEEE Standard for
222Binary Floating-point Arithmetic.
223-------------------------------------------------------------------------------
224*/
225static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig )
226{
227 int8 roundingMode;
228 flag roundNearestEven;
229 int8 roundIncrement, roundBits;
230 flag isTiny;
231
232 roundingMode = float_rounding_mode;
233 roundNearestEven = ( roundingMode == float_round_nearest_even );
234 roundIncrement = 0x40;
235 if ( ! roundNearestEven ) {
236 if ( roundingMode == float_round_to_zero ) {
237 roundIncrement = 0;
238 }
239 else {
240 roundIncrement = 0x7F;
241 if ( zSign ) {
242 if ( roundingMode == float_round_up ) roundIncrement = 0;
243 }
244 else {
245 if ( roundingMode == float_round_down ) roundIncrement = 0;
246 }
247 }
248 }
249 roundBits = zSig & 0x7F;
250 if ( 0xFD <= (bits16) zExp ) {
251 if ( ( 0xFD < zExp )
252 || ( ( zExp == 0xFD )
253 && ( (sbits32) ( zSig + roundIncrement ) < 0 ) )
254 ) {
255 float_raise( float_flag_overflow | float_flag_inexact );
256 return packFloat32( zSign, 0xFF, 0 ) - ( roundIncrement == 0 );
257 }
258 if ( zExp < 0 ) {
259 isTiny =
260 ( float_detect_tininess == float_tininess_before_rounding )
261 || ( zExp < -1 )
262 || ( zSig + roundIncrement < 0x80000000 );
263 shift32RightJamming( zSig, - zExp, &zSig );
264 zExp = 0;
265 roundBits = zSig & 0x7F;
266 if ( isTiny && roundBits ) float_raise( float_flag_underflow );
267 }
268 }
269 if ( roundBits ) float_exception_flags |= float_flag_inexact;
270 zSig = ( zSig + roundIncrement )>>7;
271 zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
272 if ( zSig == 0 ) zExp = 0;
273 return packFloat32( zSign, zExp, zSig );
274
275}
276
277/*
278-------------------------------------------------------------------------------
279Takes an abstract floating-point value having sign `zSign', exponent `zExp',
280and significand `zSig', and returns the proper single-precision floating-
281point value corresponding to the abstract input. This routine is just like
282`roundAndPackFloat32' except that `zSig' does not have to be normalized in
283any way. In all cases, `zExp' must be 1 less than the ``true'' floating-
284point exponent.
285-------------------------------------------------------------------------------
286*/
287static float32
288 normalizeRoundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig )
289{
290 int8 shiftCount;
291
292 shiftCount = countLeadingZeros32( zSig ) - 1;
293 return roundAndPackFloat32( zSign, zExp - shiftCount, zSig<<shiftCount );
294
295}
296
297/*
298-------------------------------------------------------------------------------
299Returns the fraction bits of the double-precision floating-point value `a'.
300-------------------------------------------------------------------------------
301*/
302INLINE bits64 extractFloat64Frac( float64 a )
303{
304
305 return a & LIT64( 0x000FFFFFFFFFFFFF );
306
307}
308
309/*
310-------------------------------------------------------------------------------
311Returns the exponent bits of the double-precision floating-point value `a'.
312-------------------------------------------------------------------------------
313*/
314INLINE int16 extractFloat64Exp( float64 a )
315{
316
317 return ( a>>52 ) & 0x7FF;
318
319}
320
321/*
322-------------------------------------------------------------------------------
323Returns the sign bit of the double-precision floating-point value `a'.
324-------------------------------------------------------------------------------
325*/
326#if 0 /* in softfloat.h */
327INLINE flag extractFloat64Sign( float64 a )
328{
329
330 return a>>63;
331
332}
333#endif
334
335/*
336-------------------------------------------------------------------------------
337Normalizes the subnormal double-precision floating-point value represented
338by the denormalized significand `aSig'. The normalized exponent and
339significand are stored at the locations pointed to by `zExpPtr' and
340`zSigPtr', respectively.
341-------------------------------------------------------------------------------
342*/
343static void
344 normalizeFloat64Subnormal( bits64 aSig, int16 *zExpPtr, bits64 *zSigPtr )
345{
346 int8 shiftCount;
347
348 shiftCount = countLeadingZeros64( aSig ) - 11;
349 *zSigPtr = aSig<<shiftCount;
350 *zExpPtr = 1 - shiftCount;
351
352}
353
354/*
355-------------------------------------------------------------------------------
356Packs the sign `zSign', exponent `zExp', and significand `zSig' into a
357double-precision floating-point value, returning the result. After being
358shifted into the proper positions, the three fields are simply added
359together to form the result. This means that any integer portion of `zSig'
360will be added into the exponent. Since a properly normalized significand
361will have an integer portion equal to 1, the `zExp' input should be 1 less
362than the desired result exponent whenever `zSig' is a complete, normalized
363significand.
364-------------------------------------------------------------------------------
365*/
366INLINE float64 packFloat64( flag zSign, int16 zExp, bits64 zSig )
367{
368
369 return ( ( (bits64) zSign )<<63 ) + ( ( (bits64) zExp )<<52 ) + zSig;
370
371}
372
373/*
374-------------------------------------------------------------------------------
375Takes an abstract floating-point value having sign `zSign', exponent `zExp',
376and significand `zSig', and returns the proper double-precision floating-
377point value corresponding to the abstract input. Ordinarily, the abstract
378value is simply rounded and packed into the double-precision format, with
379the inexact exception raised if the abstract input cannot be represented
380exactly. If the abstract value is too large, however, the overflow and
381inexact exceptions are raised and an infinity or maximal finite value is
382returned. If the abstract value is too small, the input value is rounded to
383a subnormal number, and the underflow and inexact exceptions are raised if
384the abstract input cannot be represented exactly as a subnormal double-
385precision floating-point number.
386 The input significand `zSig' has its binary point between bits 62
387and 61, which is 10 bits to the left of the usual location. This shifted
388significand must be normalized or smaller. If `zSig' is not normalized,
389`zExp' must be 0; in that case, the result returned is a subnormal number,
390and it must not require rounding. In the usual case that `zSig' is
391normalized, `zExp' must be 1 less than the ``true'' floating-point exponent.
392The handling of underflow and overflow follows the IEC/IEEE Standard for
393Binary Floating-point Arithmetic.
394-------------------------------------------------------------------------------
395*/
396static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig )
397{
398 int8 roundingMode;
399 flag roundNearestEven;
400 int16 roundIncrement, roundBits;
401 flag isTiny;
402
403 roundingMode = float_rounding_mode;
404 roundNearestEven = ( roundingMode == float_round_nearest_even );
405 roundIncrement = 0x200;
406 if ( ! roundNearestEven ) {
407 if ( roundingMode == float_round_to_zero ) {
408 roundIncrement = 0;
409 }
410 else {
411 roundIncrement = 0x3FF;
412 if ( zSign ) {
413 if ( roundingMode == float_round_up ) roundIncrement = 0;
414 }
415 else {
416 if ( roundingMode == float_round_down ) roundIncrement = 0;
417 }
418 }
419 }
420 roundBits = zSig & 0x3FF;
421 if ( 0x7FD <= (bits16) zExp ) {
422 if ( ( 0x7FD < zExp )
423 || ( ( zExp == 0x7FD )
424 && ( (sbits64) ( zSig + roundIncrement ) < 0 ) )
425 ) {
426 //register int lr = __builtin_return_address(0);
427 //printk("roundAndPackFloat64 called from 0x%08x\n",lr);
428 float_raise( float_flag_overflow | float_flag_inexact );
429 return packFloat64( zSign, 0x7FF, 0 ) - ( roundIncrement == 0 );
430 }
431 if ( zExp < 0 ) {
432 isTiny =
433 ( float_detect_tininess == float_tininess_before_rounding )
434 || ( zExp < -1 )
435 || ( zSig + roundIncrement < LIT64( 0x8000000000000000 ) );
436 shift64RightJamming( zSig, - zExp, &zSig );
437 zExp = 0;
438 roundBits = zSig & 0x3FF;
439 if ( isTiny && roundBits ) float_raise( float_flag_underflow );
440 }
441 }
442 if ( roundBits ) float_exception_flags |= float_flag_inexact;
443 zSig = ( zSig + roundIncrement )>>10;
444 zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven );
445 if ( zSig == 0 ) zExp = 0;
446 return packFloat64( zSign, zExp, zSig );
447
448}
449
450/*
451-------------------------------------------------------------------------------
452Takes an abstract floating-point value having sign `zSign', exponent `zExp',
453and significand `zSig', and returns the proper double-precision floating-
454point value corresponding to the abstract input. This routine is just like
455`roundAndPackFloat64' except that `zSig' does not have to be normalized in
456any way. In all cases, `zExp' must be 1 less than the ``true'' floating-
457point exponent.
458-------------------------------------------------------------------------------
459*/
460static float64
461 normalizeRoundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig )
462{
463 int8 shiftCount;
464
465 shiftCount = countLeadingZeros64( zSig ) - 1;
466 return roundAndPackFloat64( zSign, zExp - shiftCount, zSig<<shiftCount );
467
468}
469
470#ifdef FLOATX80
471
472/*
473-------------------------------------------------------------------------------
474Returns the fraction bits of the extended double-precision floating-point
475value `a'.
476-------------------------------------------------------------------------------
477*/
478INLINE bits64 extractFloatx80Frac( floatx80 a )
479{
480
481 return a.low;
482
483}
484
485/*
486-------------------------------------------------------------------------------
487Returns the exponent bits of the extended double-precision floating-point
488value `a'.
489-------------------------------------------------------------------------------
490*/
491INLINE int32 extractFloatx80Exp( floatx80 a )
492{
493
494 return a.high & 0x7FFF;
495
496}
497
498/*
499-------------------------------------------------------------------------------
500Returns the sign bit of the extended double-precision floating-point value
501`a'.
502-------------------------------------------------------------------------------
503*/
504INLINE flag extractFloatx80Sign( floatx80 a )
505{
506
507 return a.high>>15;
508
509}
510
511/*
512-------------------------------------------------------------------------------
513Normalizes the subnormal extended double-precision floating-point value
514represented by the denormalized significand `aSig'. The normalized exponent
515and significand are stored at the locations pointed to by `zExpPtr' and
516`zSigPtr', respectively.
517-------------------------------------------------------------------------------
518*/
519static void
520 normalizeFloatx80Subnormal( bits64 aSig, int32 *zExpPtr, bits64 *zSigPtr )
521{
522 int8 shiftCount;
523
524 shiftCount = countLeadingZeros64( aSig );
525 *zSigPtr = aSig<<shiftCount;
526 *zExpPtr = 1 - shiftCount;
527
528}
529
530/*
531-------------------------------------------------------------------------------
532Packs the sign `zSign', exponent `zExp', and significand `zSig' into an
533extended double-precision floating-point value, returning the result.
534-------------------------------------------------------------------------------
535*/
536INLINE floatx80 packFloatx80( flag zSign, int32 zExp, bits64 zSig )
537{
538 floatx80 z;
539
540 z.low = zSig;
541 z.high = ( ( (bits16) zSign )<<15 ) + zExp;
542 return z;
543
544}
545
546/*
547-------------------------------------------------------------------------------
548Takes an abstract floating-point value having sign `zSign', exponent `zExp',
549and extended significand formed by the concatenation of `zSig0' and `zSig1',
550and returns the proper extended double-precision floating-point value
551corresponding to the abstract input. Ordinarily, the abstract value is
552rounded and packed into the extended double-precision format, with the
553inexact exception raised if the abstract input cannot be represented
554exactly. If the abstract value is too large, however, the overflow and
555inexact exceptions are raised and an infinity or maximal finite value is
556returned. If the abstract value is too small, the input value is rounded to
557a subnormal number, and the underflow and inexact exceptions are raised if
558the abstract input cannot be represented exactly as a subnormal extended
559double-precision floating-point number.
560 If `roundingPrecision' is 32 or 64, the result is rounded to the same
561number of bits as single or double precision, respectively. Otherwise, the
562result is rounded to the full precision of the extended double-precision
563format.
564 The input significand must be normalized or smaller. If the input
565significand is not normalized, `zExp' must be 0; in that case, the result
566returned is a subnormal number, and it must not require rounding. The
567handling of underflow and overflow follows the IEC/IEEE Standard for Binary
568Floating-point Arithmetic.
569-------------------------------------------------------------------------------
570*/
571static floatx80
572 roundAndPackFloatx80(
573 int8 roundingPrecision, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1
574 )
575{
576 int8 roundingMode;
577 flag roundNearestEven, increment, isTiny;
578 int64 roundIncrement, roundMask, roundBits;
579
580 roundingMode = float_rounding_mode;
581 roundNearestEven = ( roundingMode == float_round_nearest_even );
582 if ( roundingPrecision == 80 ) goto precision80;
583 if ( roundingPrecision == 64 ) {
584 roundIncrement = LIT64( 0x0000000000000400 );
585 roundMask = LIT64( 0x00000000000007FF );
586 }
587 else if ( roundingPrecision == 32 ) {
588 roundIncrement = LIT64( 0x0000008000000000 );
589 roundMask = LIT64( 0x000000FFFFFFFFFF );
590 }
591 else {
592 goto precision80;
593 }
594 zSig0 |= ( zSig1 != 0 );
595 if ( ! roundNearestEven ) {
596 if ( roundingMode == float_round_to_zero ) {
597 roundIncrement = 0;
598 }
599 else {
600 roundIncrement = roundMask;
601 if ( zSign ) {
602 if ( roundingMode == float_round_up ) roundIncrement = 0;
603 }
604 else {
605 if ( roundingMode == float_round_down ) roundIncrement = 0;
606 }
607 }
608 }
609 roundBits = zSig0 & roundMask;
610 if ( 0x7FFD <= (bits32) ( zExp - 1 ) ) {
611 if ( ( 0x7FFE < zExp )
612 || ( ( zExp == 0x7FFE ) && ( zSig0 + roundIncrement < zSig0 ) )
613 ) {
614 goto overflow;
615 }
616 if ( zExp <= 0 ) {
617 isTiny =
618 ( float_detect_tininess == float_tininess_before_rounding )
619 || ( zExp < 0 )
620 || ( zSig0 <= zSig0 + roundIncrement );
621 shift64RightJamming( zSig0, 1 - zExp, &zSig0 );
622 zExp = 0;
623 roundBits = zSig0 & roundMask;
624 if ( isTiny && roundBits ) float_raise( float_flag_underflow );
625 if ( roundBits ) float_exception_flags |= float_flag_inexact;
626 zSig0 += roundIncrement;
627 if ( (sbits64) zSig0 < 0 ) zExp = 1;
628 roundIncrement = roundMask + 1;
629 if ( roundNearestEven && ( roundBits<<1 == roundIncrement ) ) {
630 roundMask |= roundIncrement;
631 }
632 zSig0 &= ~ roundMask;
633 return packFloatx80( zSign, zExp, zSig0 );
634 }
635 }
636 if ( roundBits ) float_exception_flags |= float_flag_inexact;
637 zSig0 += roundIncrement;
638 if ( zSig0 < roundIncrement ) {
639 ++zExp;
640 zSig0 = LIT64( 0x8000000000000000 );
641 }
642 roundIncrement = roundMask + 1;
643 if ( roundNearestEven && ( roundBits<<1 == roundIncrement ) ) {
644 roundMask |= roundIncrement;
645 }
646 zSig0 &= ~ roundMask;
647 if ( zSig0 == 0 ) zExp = 0;
648 return packFloatx80( zSign, zExp, zSig0 );
649 precision80:
650 increment = ( (sbits64) zSig1 < 0 );
651 if ( ! roundNearestEven ) {
652 if ( roundingMode == float_round_to_zero ) {
653 increment = 0;
654 }
655 else {
656 if ( zSign ) {
657 increment = ( roundingMode == float_round_down ) && zSig1;
658 }
659 else {
660 increment = ( roundingMode == float_round_up ) && zSig1;
661 }
662 }
663 }
664 if ( 0x7FFD <= (bits32) ( zExp - 1 ) ) {
665 if ( ( 0x7FFE < zExp )
666 || ( ( zExp == 0x7FFE )
667 && ( zSig0 == LIT64( 0xFFFFFFFFFFFFFFFF ) )
668 && increment
669 )
670 ) {
671 roundMask = 0;
672 overflow:
673 float_raise( float_flag_overflow | float_flag_inexact );
674 if ( ( roundingMode == float_round_to_zero )
675 || ( zSign && ( roundingMode == float_round_up ) )
676 || ( ! zSign && ( roundingMode == float_round_down ) )
677 ) {
678 return packFloatx80( zSign, 0x7FFE, ~ roundMask );
679 }
680 return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
681 }
682 if ( zExp <= 0 ) {
683 isTiny =
684 ( float_detect_tininess == float_tininess_before_rounding )
685 || ( zExp < 0 )
686 || ! increment
687 || ( zSig0 < LIT64( 0xFFFFFFFFFFFFFFFF ) );
688 shift64ExtraRightJamming( zSig0, zSig1, 1 - zExp, &zSig0, &zSig1 );
689 zExp = 0;
690 if ( isTiny && zSig1 ) float_raise( float_flag_underflow );
691 if ( zSig1 ) float_exception_flags |= float_flag_inexact;
692 if ( roundNearestEven ) {
693 increment = ( (sbits64) zSig1 < 0 );
694 }
695 else {
696 if ( zSign ) {
697 increment = ( roundingMode == float_round_down ) && zSig1;
698 }
699 else {
700 increment = ( roundingMode == float_round_up ) && zSig1;
701 }
702 }
703 if ( increment ) {
704 ++zSig0;
705 zSig0 &= ~ ( ( zSig1 + zSig1 == 0 ) & roundNearestEven );
706 if ( (sbits64) zSig0 < 0 ) zExp = 1;
707 }
708 return packFloatx80( zSign, zExp, zSig0 );
709 }
710 }
711 if ( zSig1 ) float_exception_flags |= float_flag_inexact;
712 if ( increment ) {
713 ++zSig0;
714 if ( zSig0 == 0 ) {
715 ++zExp;
716 zSig0 = LIT64( 0x8000000000000000 );
717 }
718 else {
719 zSig0 &= ~ ( ( zSig1 + zSig1 == 0 ) & roundNearestEven );
720 }
721 }
722 else {
723 if ( zSig0 == 0 ) zExp = 0;
724 }
725
726 return packFloatx80( zSign, zExp, zSig0 );
727}
728
729/*
730-------------------------------------------------------------------------------
731Takes an abstract floating-point value having sign `zSign', exponent
732`zExp', and significand formed by the concatenation of `zSig0' and `zSig1',
733and returns the proper extended double-precision floating-point value
734corresponding to the abstract input. This routine is just like
735`roundAndPackFloatx80' except that the input significand does not have to be
736normalized.
737-------------------------------------------------------------------------------
738*/
739static floatx80
740 normalizeRoundAndPackFloatx80(
741 int8 roundingPrecision, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1
742 )
743{
744 int8 shiftCount;
745
746 if ( zSig0 == 0 ) {
747 zSig0 = zSig1;
748 zSig1 = 0;
749 zExp -= 64;
750 }
751 shiftCount = countLeadingZeros64( zSig0 );
752 shortShift128Left( zSig0, zSig1, shiftCount, &zSig0, &zSig1 );
753 zExp -= shiftCount;
754 return
755 roundAndPackFloatx80( roundingPrecision, zSign, zExp, zSig0, zSig1 );
756
757}
758
759#endif
760
761/*
762-------------------------------------------------------------------------------
763Returns the result of converting the 32-bit two's complement integer `a' to
764the single-precision floating-point format. The conversion is performed
765according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
766-------------------------------------------------------------------------------
767*/
768float32 int32_to_float32( int32 a )
769{
770 flag zSign;
771
772 if ( a == 0 ) return 0;
773 if ( a == 0x80000000 ) return packFloat32( 1, 0x9E, 0 );
774 zSign = ( a < 0 );
775 return normalizeRoundAndPackFloat32( zSign, 0x9C, zSign ? - a : a );
776
777}
778
779/*
780-------------------------------------------------------------------------------
781Returns the result of converting the 32-bit two's complement integer `a' to
782the double-precision floating-point format. The conversion is performed
783according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
784-------------------------------------------------------------------------------
785*/
786float64 int32_to_float64( int32 a )
787{
788 flag aSign;
789 uint32 absA;
790 int8 shiftCount;
791 bits64 zSig;
792
793 if ( a == 0 ) return 0;
794 aSign = ( a < 0 );
795 absA = aSign ? - a : a;
796 shiftCount = countLeadingZeros32( absA ) + 21;
797 zSig = absA;
798 return packFloat64( aSign, 0x432 - shiftCount, zSig<<shiftCount );
799
800}
801
802#ifdef FLOATX80
803
804/*
805-------------------------------------------------------------------------------
806Returns the result of converting the 32-bit two's complement integer `a'
807to the extended double-precision floating-point format. The conversion
808is performed according to the IEC/IEEE Standard for Binary Floating-point
809Arithmetic.
810-------------------------------------------------------------------------------
811*/
812floatx80 int32_to_floatx80( int32 a )
813{
814 flag zSign;
815 uint32 absA;
816 int8 shiftCount;
817 bits64 zSig;
818
819 if ( a == 0 ) return packFloatx80( 0, 0, 0 );
820 zSign = ( a < 0 );
821 absA = zSign ? - a : a;
822 shiftCount = countLeadingZeros32( absA ) + 32;
823 zSig = absA;
824 return packFloatx80( zSign, 0x403E - shiftCount, zSig<<shiftCount );
825
826}
827
828#endif
829
830/*
831-------------------------------------------------------------------------------
832Returns the result of converting the single-precision floating-point value
833`a' to the 32-bit two's complement integer format. The conversion is
834performed according to the IEC/IEEE Standard for Binary Floating-point
835Arithmetic---which means in particular that the conversion is rounded
836according to the current rounding mode. If `a' is a NaN, the largest
837positive integer is returned. Otherwise, if the conversion overflows, the
838largest integer with the same sign as `a' is returned.
839-------------------------------------------------------------------------------
840*/
841int32 float32_to_int32( float32 a )
842{
843 flag aSign;
844 int16 aExp, shiftCount;
845 bits32 aSig;
846 bits64 zSig;
847
848 aSig = extractFloat32Frac( a );
849 aExp = extractFloat32Exp( a );
850 aSign = extractFloat32Sign( a );
851 if ( ( aExp == 0x7FF ) && aSig ) aSign = 0;
852 if ( aExp ) aSig |= 0x00800000;
853 shiftCount = 0xAF - aExp;
854 zSig = aSig;
855 zSig <<= 32;
856 if ( 0 < shiftCount ) shift64RightJamming( zSig, shiftCount, &zSig );
857 return roundAndPackInt32( aSign, zSig );
858
859}
860
861/*
862-------------------------------------------------------------------------------
863Returns the result of converting the single-precision floating-point value
864`a' to the 32-bit two's complement integer format. The conversion is
865performed according to the IEC/IEEE Standard for Binary Floating-point
866Arithmetic, except that the conversion is always rounded toward zero. If
867`a' is a NaN, the largest positive integer is returned. Otherwise, if the
868conversion overflows, the largest integer with the same sign as `a' is
869returned.
870-------------------------------------------------------------------------------
871*/
872int32 float32_to_int32_round_to_zero( float32 a )
873{
874 flag aSign;
875 int16 aExp, shiftCount;
876 bits32 aSig;
877 int32 z;
878
879 aSig = extractFloat32Frac( a );
880 aExp = extractFloat32Exp( a );
881 aSign = extractFloat32Sign( a );
882 shiftCount = aExp - 0x9E;
883 if ( 0 <= shiftCount ) {
884 if ( a == 0xCF000000 ) return 0x80000000;
885 float_raise( float_flag_invalid );
886 if ( ! aSign || ( ( aExp == 0xFF ) && aSig ) ) return 0x7FFFFFFF;
887 return 0x80000000;
888 }
889 else if ( aExp <= 0x7E ) {
890 if ( aExp | aSig ) float_exception_flags |= float_flag_inexact;
891 return 0;
892 }
893 aSig = ( aSig | 0x00800000 )<<8;
894 z = aSig>>( - shiftCount );
895 if ( (bits32) ( aSig<<( shiftCount & 31 ) ) ) {
896 float_exception_flags |= float_flag_inexact;
897 }
898 return aSign ? - z : z;
899
900}
901
902/*
903-------------------------------------------------------------------------------
904Returns the result of converting the single-precision floating-point value
905`a' to the double-precision floating-point format. The conversion is
906performed according to the IEC/IEEE Standard for Binary Floating-point
907Arithmetic.
908-------------------------------------------------------------------------------
909*/
910float64 float32_to_float64( float32 a )
911{
912 flag aSign;
913 int16 aExp;
914 bits32 aSig;
915
916 aSig = extractFloat32Frac( a );
917 aExp = extractFloat32Exp( a );
918 aSign = extractFloat32Sign( a );
919 if ( aExp == 0xFF ) {
920 if ( aSig ) return commonNaNToFloat64( float32ToCommonNaN( a ) );
921 return packFloat64( aSign, 0x7FF, 0 );
922 }
923 if ( aExp == 0 ) {
924 if ( aSig == 0 ) return packFloat64( aSign, 0, 0 );
925 normalizeFloat32Subnormal( aSig, &aExp, &aSig );
926 --aExp;
927 }
928 return packFloat64( aSign, aExp + 0x380, ( (bits64) aSig )<<29 );
929
930}
931
932#ifdef FLOATX80
933
934/*
935-------------------------------------------------------------------------------
936Returns the result of converting the single-precision floating-point value
937`a' to the extended double-precision floating-point format. The conversion
938is performed according to the IEC/IEEE Standard for Binary Floating-point
939Arithmetic.
940-------------------------------------------------------------------------------
941*/
942floatx80 float32_to_floatx80( float32 a )
943{
944 flag aSign;
945 int16 aExp;
946 bits32 aSig;
947
948 aSig = extractFloat32Frac( a );
949 aExp = extractFloat32Exp( a );
950 aSign = extractFloat32Sign( a );
951 if ( aExp == 0xFF ) {
952 if ( aSig ) return commonNaNToFloatx80( float32ToCommonNaN( a ) );
953 return packFloatx80( aSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
954 }
955 if ( aExp == 0 ) {
956 if ( aSig == 0 ) return packFloatx80( aSign, 0, 0 );
957 normalizeFloat32Subnormal( aSig, &aExp, &aSig );
958 }
959 aSig |= 0x00800000;
960 return packFloatx80( aSign, aExp + 0x3F80, ( (bits64) aSig )<<40 );
961
962}
963
964#endif
965
966/*
967-------------------------------------------------------------------------------
968Rounds the single-precision floating-point value `a' to an integer, and
969returns the result as a single-precision floating-point value. The
970operation is performed according to the IEC/IEEE Standard for Binary
971Floating-point Arithmetic.
972-------------------------------------------------------------------------------
973*/
974float32 float32_round_to_int( float32 a )
975{
976 flag aSign;
977 int16 aExp;
978 bits32 lastBitMask, roundBitsMask;
979 int8 roundingMode;
980 float32 z;
981
982 aExp = extractFloat32Exp( a );
983 if ( 0x96 <= aExp ) {
984 if ( ( aExp == 0xFF ) && extractFloat32Frac( a ) ) {
985 return propagateFloat32NaN( a, a );
986 }
987 return a;
988 }
989 if ( aExp <= 0x7E ) {
990 if ( (bits32) ( a<<1 ) == 0 ) return a;
991 float_exception_flags |= float_flag_inexact;
992 aSign = extractFloat32Sign( a );
993 switch ( float_rounding_mode ) {
994 case float_round_nearest_even:
995 if ( ( aExp == 0x7E ) && extractFloat32Frac( a ) ) {
996 return packFloat32( aSign, 0x7F, 0 );
997 }
998 break;
999 case float_round_down:
1000 return aSign ? 0xBF800000 : 0;
1001 case float_round_up:
1002 return aSign ? 0x80000000 : 0x3F800000;
1003 }
1004 return packFloat32( aSign, 0, 0 );
1005 }
1006 lastBitMask = 1;
1007 lastBitMask <<= 0x96 - aExp;
1008 roundBitsMask = lastBitMask - 1;
1009 z = a;
1010 roundingMode = float_rounding_mode;
1011 if ( roundingMode == float_round_nearest_even ) {
1012 z += lastBitMask>>1;
1013 if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask;
1014 }
1015 else if ( roundingMode != float_round_to_zero ) {
1016 if ( extractFloat32Sign( z ) ^ ( roundingMode == float_round_up ) ) {
1017 z += roundBitsMask;
1018 }
1019 }
1020 z &= ~ roundBitsMask;
1021 if ( z != a ) float_exception_flags |= float_flag_inexact;
1022 return z;
1023
1024}
1025
1026/*
1027-------------------------------------------------------------------------------
1028Returns the result of adding the absolute values of the single-precision
1029floating-point values `a' and `b'. If `zSign' is true, the sum is negated
1030before being returned. `zSign' is ignored if the result is a NaN. The
1031addition is performed according to the IEC/IEEE Standard for Binary
1032Floating-point Arithmetic.
1033-------------------------------------------------------------------------------
1034*/
1035static float32 addFloat32Sigs( float32 a, float32 b, flag zSign )
1036{
1037 int16 aExp, bExp, zExp;
1038 bits32 aSig, bSig, zSig;
1039 int16 expDiff;
1040
1041 aSig = extractFloat32Frac( a );
1042 aExp = extractFloat32Exp( a );
1043 bSig = extractFloat32Frac( b );
1044 bExp = extractFloat32Exp( b );
1045 expDiff = aExp - bExp;
1046 aSig <<= 6;
1047 bSig <<= 6;
1048 if ( 0 < expDiff ) {
1049 if ( aExp == 0xFF ) {
1050 if ( aSig ) return propagateFloat32NaN( a, b );
1051 return a;
1052 }
1053 if ( bExp == 0 ) {
1054 --expDiff;
1055 }
1056 else {
1057 bSig |= 0x20000000;
1058 }
1059 shift32RightJamming( bSig, expDiff, &bSig );
1060 zExp = aExp;
1061 }
1062 else if ( expDiff < 0 ) {
1063 if ( bExp == 0xFF ) {
1064 if ( bSig ) return propagateFloat32NaN( a, b );
1065 return packFloat32( zSign, 0xFF, 0 );
1066 }
1067 if ( aExp == 0 ) {
1068 ++expDiff;
1069 }
1070 else {
1071 aSig |= 0x20000000;
1072 }
1073 shift32RightJamming( aSig, - expDiff, &aSig );
1074 zExp = bExp;
1075 }
1076 else {
1077 if ( aExp == 0xFF ) {
1078 if ( aSig | bSig ) return propagateFloat32NaN( a, b );
1079 return a;
1080 }
1081 if ( aExp == 0 ) return packFloat32( zSign, 0, ( aSig + bSig )>>6 );
1082 zSig = 0x40000000 + aSig + bSig;
1083 zExp = aExp;
1084 goto roundAndPack;
1085 }
1086 aSig |= 0x20000000;
1087 zSig = ( aSig + bSig )<<1;
1088 --zExp;
1089 if ( (sbits32) zSig < 0 ) {
1090 zSig = aSig + bSig;
1091 ++zExp;
1092 }
1093 roundAndPack:
1094 return roundAndPackFloat32( zSign, zExp, zSig );
1095
1096}
1097
1098/*
1099-------------------------------------------------------------------------------
1100Returns the result of subtracting the absolute values of the single-
1101precision floating-point values `a' and `b'. If `zSign' is true, the
1102difference is negated before being returned. `zSign' is ignored if the
1103result is a NaN. The subtraction is performed according to the IEC/IEEE
1104Standard for Binary Floating-point Arithmetic.
1105-------------------------------------------------------------------------------
1106*/
1107static float32 subFloat32Sigs( float32 a, float32 b, flag zSign )
1108{
1109 int16 aExp, bExp, zExp;
1110 bits32 aSig, bSig, zSig;
1111 int16 expDiff;
1112
1113 aSig = extractFloat32Frac( a );
1114 aExp = extractFloat32Exp( a );
1115 bSig = extractFloat32Frac( b );
1116 bExp = extractFloat32Exp( b );
1117 expDiff = aExp - bExp;
1118 aSig <<= 7;
1119 bSig <<= 7;
1120 if ( 0 < expDiff ) goto aExpBigger;
1121 if ( expDiff < 0 ) goto bExpBigger;
1122 if ( aExp == 0xFF ) {
1123 if ( aSig | bSig ) return propagateFloat32NaN( a, b );
1124 float_raise( float_flag_invalid );
1125 return float32_default_nan;
1126 }
1127 if ( aExp == 0 ) {
1128 aExp = 1;
1129 bExp = 1;
1130 }
1131 if ( bSig < aSig ) goto aBigger;
1132 if ( aSig < bSig ) goto bBigger;
1133 return packFloat32( float_rounding_mode == float_round_down, 0, 0 );
1134 bExpBigger:
1135 if ( bExp == 0xFF ) {
1136 if ( bSig ) return propagateFloat32NaN( a, b );
1137 return packFloat32( zSign ^ 1, 0xFF, 0 );
1138 }
1139 if ( aExp == 0 ) {
1140 ++expDiff;
1141 }
1142 else {
1143 aSig |= 0x40000000;
1144 }
1145 shift32RightJamming( aSig, - expDiff, &aSig );
1146 bSig |= 0x40000000;
1147 bBigger:
1148 zSig = bSig - aSig;
1149 zExp = bExp;
1150 zSign ^= 1;
1151 goto normalizeRoundAndPack;
1152 aExpBigger:
1153 if ( aExp == 0xFF ) {
1154 if ( aSig ) return propagateFloat32NaN( a, b );
1155 return a;
1156 }
1157 if ( bExp == 0 ) {
1158 --expDiff;
1159 }
1160 else {
1161 bSig |= 0x40000000;
1162 }
1163 shift32RightJamming( bSig, expDiff, &bSig );
1164 aSig |= 0x40000000;
1165 aBigger:
1166 zSig = aSig - bSig;
1167 zExp = aExp;
1168 normalizeRoundAndPack:
1169 --zExp;
1170 return normalizeRoundAndPackFloat32( zSign, zExp, zSig );
1171
1172}
1173
1174/*
1175-------------------------------------------------------------------------------
1176Returns the result of adding the single-precision floating-point values `a'
1177and `b'. The operation is performed according to the IEC/IEEE Standard for
1178Binary Floating-point Arithmetic.
1179-------------------------------------------------------------------------------
1180*/
1181float32 float32_add( float32 a, float32 b )
1182{
1183 flag aSign, bSign;
1184
1185 aSign = extractFloat32Sign( a );
1186 bSign = extractFloat32Sign( b );
1187 if ( aSign == bSign ) {
1188 return addFloat32Sigs( a, b, aSign );
1189 }
1190 else {
1191 return subFloat32Sigs( a, b, aSign );
1192 }
1193
1194}
1195
1196/*
1197-------------------------------------------------------------------------------
1198Returns the result of subtracting the single-precision floating-point values
1199`a' and `b'. The operation is performed according to the IEC/IEEE Standard
1200for Binary Floating-point Arithmetic.
1201-------------------------------------------------------------------------------
1202*/
1203float32 float32_sub( float32 a, float32 b )
1204{
1205 flag aSign, bSign;
1206
1207 aSign = extractFloat32Sign( a );
1208 bSign = extractFloat32Sign( b );
1209 if ( aSign == bSign ) {
1210 return subFloat32Sigs( a, b, aSign );
1211 }
1212 else {
1213 return addFloat32Sigs( a, b, aSign );
1214 }
1215
1216}
1217
1218/*
1219-------------------------------------------------------------------------------
1220Returns the result of multiplying the single-precision floating-point values
1221`a' and `b'. The operation is performed according to the IEC/IEEE Standard
1222for Binary Floating-point Arithmetic.
1223-------------------------------------------------------------------------------
1224*/
1225float32 float32_mul( float32 a, float32 b )
1226{
1227 flag aSign, bSign, zSign;
1228 int16 aExp, bExp, zExp;
1229 bits32 aSig, bSig;
1230 bits64 zSig64;
1231 bits32 zSig;
1232
1233 aSig = extractFloat32Frac( a );
1234 aExp = extractFloat32Exp( a );
1235 aSign = extractFloat32Sign( a );
1236 bSig = extractFloat32Frac( b );
1237 bExp = extractFloat32Exp( b );
1238 bSign = extractFloat32Sign( b );
1239 zSign = aSign ^ bSign;
1240 if ( aExp == 0xFF ) {
1241 if ( aSig || ( ( bExp == 0xFF ) && bSig ) ) {
1242 return propagateFloat32NaN( a, b );
1243 }
1244 if ( ( bExp | bSig ) == 0 ) {
1245 float_raise( float_flag_invalid );
1246 return float32_default_nan;
1247 }
1248 return packFloat32( zSign, 0xFF, 0 );
1249 }
1250 if ( bExp == 0xFF ) {
1251 if ( bSig ) return propagateFloat32NaN( a, b );
1252 if ( ( aExp | aSig ) == 0 ) {
1253 float_raise( float_flag_invalid );
1254 return float32_default_nan;
1255 }
1256 return packFloat32( zSign, 0xFF, 0 );
1257 }
1258 if ( aExp == 0 ) {
1259 if ( aSig == 0 ) return packFloat32( zSign, 0, 0 );
1260 normalizeFloat32Subnormal( aSig, &aExp, &aSig );
1261 }
1262 if ( bExp == 0 ) {
1263 if ( bSig == 0 ) return packFloat32( zSign, 0, 0 );
1264 normalizeFloat32Subnormal( bSig, &bExp, &bSig );
1265 }
1266 zExp = aExp + bExp - 0x7F;
1267 aSig = ( aSig | 0x00800000 )<<7;
1268 bSig = ( bSig | 0x00800000 )<<8;
1269 shift64RightJamming( ( (bits64) aSig ) * bSig, 32, &zSig64 );
1270 zSig = zSig64;
1271 if ( 0 <= (sbits32) ( zSig<<1 ) ) {
1272 zSig <<= 1;
1273 --zExp;
1274 }
1275 return roundAndPackFloat32( zSign, zExp, zSig );
1276
1277}
1278
1279/*
1280-------------------------------------------------------------------------------
1281Returns the result of dividing the single-precision floating-point value `a'
1282by the corresponding value `b'. The operation is performed according to the
1283IEC/IEEE Standard for Binary Floating-point Arithmetic.
1284-------------------------------------------------------------------------------
1285*/
1286float32 float32_div( float32 a, float32 b )
1287{
1288 flag aSign, bSign, zSign;
1289 int16 aExp, bExp, zExp;
1290 bits32 aSig, bSig, zSig;
1291
1292 aSig = extractFloat32Frac( a );
1293 aExp = extractFloat32Exp( a );
1294 aSign = extractFloat32Sign( a );
1295 bSig = extractFloat32Frac( b );
1296 bExp = extractFloat32Exp( b );
1297 bSign = extractFloat32Sign( b );
1298 zSign = aSign ^ bSign;
1299 if ( aExp == 0xFF ) {
1300 if ( aSig ) return propagateFloat32NaN( a, b );
1301 if ( bExp == 0xFF ) {
1302 if ( bSig ) return propagateFloat32NaN( a, b );
1303 float_raise( float_flag_invalid );
1304 return float32_default_nan;
1305 }
1306 return packFloat32( zSign, 0xFF, 0 );
1307 }
1308 if ( bExp == 0xFF ) {
1309 if ( bSig ) return propagateFloat32NaN( a, b );
1310 return packFloat32( zSign, 0, 0 );
1311 }
1312 if ( bExp == 0 ) {
1313 if ( bSig == 0 ) {
1314 if ( ( aExp | aSig ) == 0 ) {
1315 float_raise( float_flag_invalid );
1316 return float32_default_nan;
1317 }
1318 float_raise( float_flag_divbyzero );
1319 return packFloat32( zSign, 0xFF, 0 );
1320 }
1321 normalizeFloat32Subnormal( bSig, &bExp, &bSig );
1322 }
1323 if ( aExp == 0 ) {
1324 if ( aSig == 0 ) return packFloat32( zSign, 0, 0 );
1325 normalizeFloat32Subnormal( aSig, &aExp, &aSig );
1326 }
1327 zExp = aExp - bExp + 0x7D;
1328 aSig = ( aSig | 0x00800000 )<<7;
1329 bSig = ( bSig | 0x00800000 )<<8;
1330 if ( bSig <= ( aSig + aSig ) ) {
1331 aSig >>= 1;
1332 ++zExp;
1333 }
1334 zSig = ( ( (bits64) aSig )<<32 ) / bSig;
1335 if ( ( zSig & 0x3F ) == 0 ) {
1336 zSig |= ( ( (bits64) bSig ) * zSig != ( (bits64) aSig )<<32 );
1337 }
1338 return roundAndPackFloat32( zSign, zExp, zSig );
1339
1340}
1341
1342/*
1343-------------------------------------------------------------------------------
1344Returns the remainder of the single-precision floating-point value `a'
1345with respect to the corresponding value `b'. The operation is performed
1346according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
1347-------------------------------------------------------------------------------
1348*/
1349float32 float32_rem( float32 a, float32 b )
1350{
1351 flag aSign, bSign, zSign;
1352 int16 aExp, bExp, expDiff;
1353 bits32 aSig, bSig;
1354 bits32 q;
1355 bits64 aSig64, bSig64, q64;
1356 bits32 alternateASig;
1357 sbits32 sigMean;
1358
1359 aSig = extractFloat32Frac( a );
1360 aExp = extractFloat32Exp( a );
1361 aSign = extractFloat32Sign( a );
1362 bSig = extractFloat32Frac( b );
1363 bExp = extractFloat32Exp( b );
1364 bSign = extractFloat32Sign( b );
1365 if ( aExp == 0xFF ) {
1366 if ( aSig || ( ( bExp == 0xFF ) && bSig ) ) {
1367 return propagateFloat32NaN( a, b );
1368 }
1369 float_raise( float_flag_invalid );
1370 return float32_default_nan;
1371 }
1372 if ( bExp == 0xFF ) {
1373 if ( bSig ) return propagateFloat32NaN( a, b );
1374 return a;
1375 }
1376 if ( bExp == 0 ) {
1377 if ( bSig == 0 ) {
1378 float_raise( float_flag_invalid );
1379 return float32_default_nan;
1380 }
1381 normalizeFloat32Subnormal( bSig, &bExp, &bSig );
1382 }
1383 if ( aExp == 0 ) {
1384 if ( aSig == 0 ) return a;
1385 normalizeFloat32Subnormal( aSig, &aExp, &aSig );
1386 }
1387 expDiff = aExp - bExp;
1388 aSig |= 0x00800000;
1389 bSig |= 0x00800000;
1390 if ( expDiff < 32 ) {
1391 aSig <<= 8;
1392 bSig <<= 8;
1393 if ( expDiff < 0 ) {
1394 if ( expDiff < -1 ) return a;
1395 aSig >>= 1;
1396 }
1397 q = ( bSig <= aSig );
1398 if ( q ) aSig -= bSig;
1399 if ( 0 < expDiff ) {
1400 q = ( ( (bits64) aSig )<<32 ) / bSig;
1401 q >>= 32 - expDiff;
1402 bSig >>= 2;
1403 aSig = ( ( aSig>>1 )<<( expDiff - 1 ) ) - bSig * q;
1404 }
1405 else {
1406 aSig >>= 2;
1407 bSig >>= 2;
1408 }
1409 }
1410 else {
1411 if ( bSig <= aSig ) aSig -= bSig;
1412 aSig64 = ( (bits64) aSig )<<40;
1413 bSig64 = ( (bits64) bSig )<<40;
1414 expDiff -= 64;
1415 while ( 0 < expDiff ) {
1416 q64 = estimateDiv128To64( aSig64, 0, bSig64 );
1417 q64 = ( 2 < q64 ) ? q64 - 2 : 0;
1418 aSig64 = - ( ( bSig * q64 )<<38 );
1419 expDiff -= 62;
1420 }
1421 expDiff += 64;
1422 q64 = estimateDiv128To64( aSig64, 0, bSig64 );
1423 q64 = ( 2 < q64 ) ? q64 - 2 : 0;
1424 q = q64>>( 64 - expDiff );
1425 bSig <<= 6;
1426 aSig = ( ( aSig64>>33 )<<( expDiff - 1 ) ) - bSig * q;
1427 }
1428 do {
1429 alternateASig = aSig;
1430 ++q;
1431 aSig -= bSig;
1432 } while ( 0 <= (sbits32) aSig );
1433 sigMean = aSig + alternateASig;
1434 if ( ( sigMean < 0 ) || ( ( sigMean == 0 ) && ( q & 1 ) ) ) {
1435 aSig = alternateASig;
1436 }
1437 zSign = ( (sbits32) aSig < 0 );
1438 if ( zSign ) aSig = - aSig;
1439 return normalizeRoundAndPackFloat32( aSign ^ zSign, bExp, aSig );
1440
1441}
1442
1443/*
1444-------------------------------------------------------------------------------
1445Returns the square root of the single-precision floating-point value `a'.
1446The operation is performed according to the IEC/IEEE Standard for Binary
1447Floating-point Arithmetic.
1448-------------------------------------------------------------------------------
1449*/
1450float32 float32_sqrt( float32 a )
1451{
1452 flag aSign;
1453 int16 aExp, zExp;
1454 bits32 aSig, zSig;
1455 bits64 rem, term;
1456
1457 aSig = extractFloat32Frac( a );
1458 aExp = extractFloat32Exp( a );
1459 aSign = extractFloat32Sign( a );
1460 if ( aExp == 0xFF ) {
1461 if ( aSig ) return propagateFloat32NaN( a, 0 );
1462 if ( ! aSign ) return a;
1463 float_raise( float_flag_invalid );
1464 return float32_default_nan;
1465 }
1466 if ( aSign ) {
1467 if ( ( aExp | aSig ) == 0 ) return a;
1468 float_raise( float_flag_invalid );
1469 return float32_default_nan;
1470 }
1471 if ( aExp == 0 ) {
1472 if ( aSig == 0 ) return 0;
1473 normalizeFloat32Subnormal( aSig, &aExp, &aSig );
1474 }
1475 zExp = ( ( aExp - 0x7F )>>1 ) + 0x7E;
1476 aSig = ( aSig | 0x00800000 )<<8;
1477 zSig = estimateSqrt32( aExp, aSig ) + 2;
1478 if ( ( zSig & 0x7F ) <= 5 ) {
1479 if ( zSig < 2 ) {
1480 zSig = 0xFFFFFFFF;
1481 }
1482 else {
1483 aSig >>= aExp & 1;
1484 term = ( (bits64) zSig ) * zSig;
1485 rem = ( ( (bits64) aSig )<<32 ) - term;
1486 while ( (sbits64) rem < 0 ) {
1487 --zSig;
1488 rem += ( ( (bits64) zSig )<<1 ) | 1;
1489 }
1490 zSig |= ( rem != 0 );
1491 }
1492 }
1493 shift32RightJamming( zSig, 1, &zSig );
1494 return roundAndPackFloat32( 0, zExp, zSig );
1495
1496}
1497
1498/*
1499-------------------------------------------------------------------------------
1500Returns 1 if the single-precision floating-point value `a' is equal to the
1501corresponding value `b', and 0 otherwise. The comparison is performed
1502according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
1503-------------------------------------------------------------------------------
1504*/
1505flag float32_eq( float32 a, float32 b )
1506{
1507
1508 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
1509 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
1510 ) {
1511 if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) {
1512 float_raise( float_flag_invalid );
1513 }
1514 return 0;
1515 }
1516 return ( a == b ) || ( (bits32) ( ( a | b )<<1 ) == 0 );
1517
1518}
1519
1520/*
1521-------------------------------------------------------------------------------
1522Returns 1 if the single-precision floating-point value `a' is less than or
1523equal to the corresponding value `b', and 0 otherwise. The comparison is
1524performed according to the IEC/IEEE Standard for Binary Floating-point
1525Arithmetic.
1526-------------------------------------------------------------------------------
1527*/
1528flag float32_le( float32 a, float32 b )
1529{
1530 flag aSign, bSign;
1531
1532 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
1533 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
1534 ) {
1535 float_raise( float_flag_invalid );
1536 return 0;
1537 }
1538 aSign = extractFloat32Sign( a );
1539 bSign = extractFloat32Sign( b );
1540 if ( aSign != bSign ) return aSign || ( (bits32) ( ( a | b )<<1 ) == 0 );
1541 return ( a == b ) || ( aSign ^ ( a < b ) );
1542
1543}
1544
1545/*
1546-------------------------------------------------------------------------------
1547Returns 1 if the single-precision floating-point value `a' is less than
1548the corresponding value `b', and 0 otherwise. The comparison is performed
1549according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
1550-------------------------------------------------------------------------------
1551*/
1552flag float32_lt( float32 a, float32 b )
1553{
1554 flag aSign, bSign;
1555
1556 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
1557 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
1558 ) {
1559 float_raise( float_flag_invalid );
1560 return 0;
1561 }
1562 aSign = extractFloat32Sign( a );
1563 bSign = extractFloat32Sign( b );
1564 if ( aSign != bSign ) return aSign && ( (bits32) ( ( a | b )<<1 ) != 0 );
1565 return ( a != b ) && ( aSign ^ ( a < b ) );
1566
1567}
1568
1569/*
1570-------------------------------------------------------------------------------
1571Returns 1 if the single-precision floating-point value `a' is equal to the
1572corresponding value `b', and 0 otherwise. The invalid exception is raised
1573if either operand is a NaN. Otherwise, the comparison is performed
1574according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
1575-------------------------------------------------------------------------------
1576*/
1577flag float32_eq_signaling( float32 a, float32 b )
1578{
1579
1580 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
1581 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
1582 ) {
1583 float_raise( float_flag_invalid );
1584 return 0;
1585 }
1586 return ( a == b ) || ( (bits32) ( ( a | b )<<1 ) == 0 );
1587
1588}
1589
1590/*
1591-------------------------------------------------------------------------------
1592Returns 1 if the single-precision floating-point value `a' is less than or
1593equal to the corresponding value `b', and 0 otherwise. Quiet NaNs do not
1594cause an exception. Otherwise, the comparison is performed according to the
1595IEC/IEEE Standard for Binary Floating-point Arithmetic.
1596-------------------------------------------------------------------------------
1597*/
1598flag float32_le_quiet( float32 a, float32 b )
1599{
1600 flag aSign, bSign;
1601 //int16 aExp, bExp;
1602
1603 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
1604 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
1605 ) {
1606 if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) {
1607 float_raise( float_flag_invalid );
1608 }
1609 return 0;
1610 }
1611 aSign = extractFloat32Sign( a );
1612 bSign = extractFloat32Sign( b );
1613 if ( aSign != bSign ) return aSign || ( (bits32) ( ( a | b )<<1 ) == 0 );
1614 return ( a == b ) || ( aSign ^ ( a < b ) );
1615
1616}
1617
1618/*
1619-------------------------------------------------------------------------------
1620Returns 1 if the single-precision floating-point value `a' is less than
1621the corresponding value `b', and 0 otherwise. Quiet NaNs do not cause an
1622exception. Otherwise, the comparison is performed according to the IEC/IEEE
1623Standard for Binary Floating-point Arithmetic.
1624-------------------------------------------------------------------------------
1625*/
1626flag float32_lt_quiet( float32 a, float32 b )
1627{
1628 flag aSign, bSign;
1629
1630 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
1631 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
1632 ) {
1633 if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) {
1634 float_raise( float_flag_invalid );
1635 }
1636 return 0;
1637 }
1638 aSign = extractFloat32Sign( a );
1639 bSign = extractFloat32Sign( b );
1640 if ( aSign != bSign ) return aSign && ( (bits32) ( ( a | b )<<1 ) != 0 );
1641 return ( a != b ) && ( aSign ^ ( a < b ) );
1642
1643}
1644
1645/*
1646-------------------------------------------------------------------------------
1647Returns the result of converting the double-precision floating-point value
1648`a' to the 32-bit two's complement integer format. The conversion is
1649performed according to the IEC/IEEE Standard for Binary Floating-point
1650Arithmetic---which means in particular that the conversion is rounded
1651according to the current rounding mode. If `a' is a NaN, the largest
1652positive integer is returned. Otherwise, if the conversion overflows, the
1653largest integer with the same sign as `a' is returned.
1654-------------------------------------------------------------------------------
1655*/
1656int32 float64_to_int32( float64 a )
1657{
1658 flag aSign;
1659 int16 aExp, shiftCount;
1660 bits64 aSig;
1661
1662 aSig = extractFloat64Frac( a );
1663 aExp = extractFloat64Exp( a );
1664 aSign = extractFloat64Sign( a );
1665 if ( ( aExp == 0x7FF ) && aSig ) aSign = 0;
1666 if ( aExp ) aSig |= LIT64( 0x0010000000000000 );
1667 shiftCount = 0x42C - aExp;
1668 if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig );
1669 return roundAndPackInt32( aSign, aSig );
1670
1671}
1672
1673/*
1674-------------------------------------------------------------------------------
1675Returns the result of converting the double-precision floating-point value
1676`a' to the 32-bit two's complement integer format. The conversion is
1677performed according to the IEC/IEEE Standard for Binary Floating-point
1678Arithmetic, except that the conversion is always rounded toward zero. If
1679`a' is a NaN, the largest positive integer is returned. Otherwise, if the
1680conversion overflows, the largest integer with the same sign as `a' is
1681returned.
1682-------------------------------------------------------------------------------
1683*/
1684int32 float64_to_int32_round_to_zero( float64 a )
1685{
1686 flag aSign;
1687 int16 aExp, shiftCount;
1688 bits64 aSig, savedASig;
1689 int32 z;
1690
1691 aSig = extractFloat64Frac( a );
1692 aExp = extractFloat64Exp( a );
1693 aSign = extractFloat64Sign( a );
1694 shiftCount = 0x433 - aExp;
1695 if ( shiftCount < 21 ) {
1696 if ( ( aExp == 0x7FF ) && aSig ) aSign = 0;
1697 goto invalid;
1698 }
1699 else if ( 52 < shiftCount ) {
1700 if ( aExp || aSig ) float_exception_flags |= float_flag_inexact;
1701 return 0;
1702 }
1703 aSig |= LIT64( 0x0010000000000000 );
1704 savedASig = aSig;
1705 aSig >>= shiftCount;
1706 z = aSig;
1707 if ( aSign ) z = - z;
1708 if ( ( z < 0 ) ^ aSign ) {
1709 invalid:
1710 float_exception_flags |= float_flag_invalid;
1711 return aSign ? 0x80000000 : 0x7FFFFFFF;
1712 }
1713 if ( ( aSig<<shiftCount ) != savedASig ) {
1714 float_exception_flags |= float_flag_inexact;
1715 }
1716 return z;
1717
1718}
1719
1720/*
1721-------------------------------------------------------------------------------
1722Returns the result of converting the double-precision floating-point value
1723`a' to the 32-bit two's complement unsigned integer format. The conversion
1724is performed according to the IEC/IEEE Standard for Binary Floating-point
1725Arithmetic---which means in particular that the conversion is rounded
1726according to the current rounding mode. If `a' is a NaN, the largest
1727positive integer is returned. Otherwise, if the conversion overflows, the
1728largest positive integer is returned.
1729-------------------------------------------------------------------------------
1730*/
1731int32 float64_to_uint32( float64 a )
1732{
1733 flag aSign;
1734 int16 aExp, shiftCount;
1735 bits64 aSig;
1736
1737 aSig = extractFloat64Frac( a );
1738 aExp = extractFloat64Exp( a );
1739 aSign = 0; //extractFloat64Sign( a );
1740 //if ( ( aExp == 0x7FF ) && aSig ) aSign = 0;
1741 if ( aExp ) aSig |= LIT64( 0x0010000000000000 );
1742 shiftCount = 0x42C - aExp;
1743 if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig );
1744 return roundAndPackInt32( aSign, aSig );
1745}
1746
1747/*
1748-------------------------------------------------------------------------------
1749Returns the result of converting the double-precision floating-point value
1750`a' to the 32-bit two's complement integer format. The conversion is
1751performed according to the IEC/IEEE Standard for Binary Floating-point
1752Arithmetic, except that the conversion is always rounded toward zero. If
1753`a' is a NaN, the largest positive integer is returned. Otherwise, if the
1754conversion overflows, the largest positive integer is returned.
1755-------------------------------------------------------------------------------
1756*/
1757int32 float64_to_uint32_round_to_zero( float64 a )
1758{
1759 flag aSign;
1760 int16 aExp, shiftCount;
1761 bits64 aSig, savedASig;
1762 int32 z;
1763
1764 aSig = extractFloat64Frac( a );
1765 aExp = extractFloat64Exp( a );
1766 aSign = extractFloat64Sign( a );
1767 shiftCount = 0x433 - aExp;
1768 if ( shiftCount < 21 ) {
1769 if ( ( aExp == 0x7FF ) && aSig ) aSign = 0;
1770 goto invalid;
1771 }
1772 else if ( 52 < shiftCount ) {
1773 if ( aExp || aSig ) float_exception_flags |= float_flag_inexact;
1774 return 0;
1775 }
1776 aSig |= LIT64( 0x0010000000000000 );
1777 savedASig = aSig;
1778 aSig >>= shiftCount;
1779 z = aSig;
1780 if ( aSign ) z = - z;
1781 if ( ( z < 0 ) ^ aSign ) {
1782 invalid:
1783 float_exception_flags |= float_flag_invalid;
1784 return aSign ? 0x80000000 : 0x7FFFFFFF;
1785 }
1786 if ( ( aSig<<shiftCount ) != savedASig ) {
1787 float_exception_flags |= float_flag_inexact;
1788 }
1789 return z;
1790}
1791
1792/*
1793-------------------------------------------------------------------------------
1794Returns the result of converting the double-precision floating-point value
1795`a' to the single-precision floating-point format. The conversion is
1796performed according to the IEC/IEEE Standard for Binary Floating-point
1797Arithmetic.
1798-------------------------------------------------------------------------------
1799*/
1800float32 float64_to_float32( float64 a )
1801{
1802 flag aSign;
1803 int16 aExp;
1804 bits64 aSig;
1805 bits32 zSig;
1806
1807 aSig = extractFloat64Frac( a );
1808 aExp = extractFloat64Exp( a );
1809 aSign = extractFloat64Sign( a );
1810 if ( aExp == 0x7FF ) {
1811 if ( aSig ) return commonNaNToFloat32( float64ToCommonNaN( a ) );
1812 return packFloat32( aSign, 0xFF, 0 );
1813 }
1814 shift64RightJamming( aSig, 22, &aSig );
1815 zSig = aSig;
1816 if ( aExp || zSig ) {
1817 zSig |= 0x40000000;
1818 aExp -= 0x381;
1819 }
1820 return roundAndPackFloat32( aSign, aExp, zSig );
1821
1822}
1823
1824#ifdef FLOATX80
1825
1826/*
1827-------------------------------------------------------------------------------
1828Returns the result of converting the double-precision floating-point value
1829`a' to the extended double-precision floating-point format. The conversion
1830is performed according to the IEC/IEEE Standard for Binary Floating-point
1831Arithmetic.
1832-------------------------------------------------------------------------------
1833*/
1834floatx80 float64_to_floatx80( float64 a )
1835{
1836 flag aSign;
1837 int16 aExp;
1838 bits64 aSig;
1839
1840 aSig = extractFloat64Frac( a );
1841 aExp = extractFloat64Exp( a );
1842 aSign = extractFloat64Sign( a );
1843 if ( aExp == 0x7FF ) {
1844 if ( aSig ) return commonNaNToFloatx80( float64ToCommonNaN( a ) );
1845 return packFloatx80( aSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
1846 }
1847 if ( aExp == 0 ) {
1848 if ( aSig == 0 ) return packFloatx80( aSign, 0, 0 );
1849 normalizeFloat64Subnormal( aSig, &aExp, &aSig );
1850 }
1851 return
1852 packFloatx80(
1853 aSign, aExp + 0x3C00, ( aSig | LIT64( 0x0010000000000000 ) )<<11 );
1854
1855}
1856
1857#endif
1858
1859/*
1860-------------------------------------------------------------------------------
1861Rounds the double-precision floating-point value `a' to an integer, and
1862returns the result as a double-precision floating-point value. The
1863operation is performed according to the IEC/IEEE Standard for Binary
1864Floating-point Arithmetic.
1865-------------------------------------------------------------------------------
1866*/
1867float64 float64_round_to_int( float64 a )
1868{
1869 flag aSign;
1870 int16 aExp;
1871 bits64 lastBitMask, roundBitsMask;
1872 int8 roundingMode;
1873 float64 z;
1874
1875 aExp = extractFloat64Exp( a );
1876 if ( 0x433 <= aExp ) {
1877 if ( ( aExp == 0x7FF ) && extractFloat64Frac( a ) ) {
1878 return propagateFloat64NaN( a, a );
1879 }
1880 return a;
1881 }
1882 if ( aExp <= 0x3FE ) {
1883 if ( (bits64) ( a<<1 ) == 0 ) return a;
1884 float_exception_flags |= float_flag_inexact;
1885 aSign = extractFloat64Sign( a );
1886 switch ( float_rounding_mode ) {
1887 case float_round_nearest_even:
1888 if ( ( aExp == 0x3FE ) && extractFloat64Frac( a ) ) {
1889 return packFloat64( aSign, 0x3FF, 0 );
1890 }
1891 break;
1892 case float_round_down:
1893 return aSign ? LIT64( 0xBFF0000000000000 ) : 0;
1894 case float_round_up:
1895 return
1896 aSign ? LIT64( 0x8000000000000000 ) : LIT64( 0x3FF0000000000000 );
1897 }
1898 return packFloat64( aSign, 0, 0 );
1899 }
1900 lastBitMask = 1;
1901 lastBitMask <<= 0x433 - aExp;
1902 roundBitsMask = lastBitMask - 1;
1903 z = a;
1904 roundingMode = float_rounding_mode;
1905 if ( roundingMode == float_round_nearest_even ) {
1906 z += lastBitMask>>1;
1907 if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask;
1908 }
1909 else if ( roundingMode != float_round_to_zero ) {
1910 if ( extractFloat64Sign( z ) ^ ( roundingMode == float_round_up ) ) {
1911 z += roundBitsMask;
1912 }
1913 }
1914 z &= ~ roundBitsMask;
1915 if ( z != a ) float_exception_flags |= float_flag_inexact;
1916 return z;
1917
1918}
1919
1920/*
1921-------------------------------------------------------------------------------
1922Returns the result of adding the absolute values of the double-precision
1923floating-point values `a' and `b'. If `zSign' is true, the sum is negated
1924before being returned. `zSign' is ignored if the result is a NaN. The
1925addition is performed according to the IEC/IEEE Standard for Binary
1926Floating-point Arithmetic.
1927-------------------------------------------------------------------------------
1928*/
1929static float64 addFloat64Sigs( float64 a, float64 b, flag zSign )
1930{
1931 int16 aExp, bExp, zExp;
1932 bits64 aSig, bSig, zSig;
1933 int16 expDiff;
1934
1935 aSig = extractFloat64Frac( a );
1936 aExp = extractFloat64Exp( a );
1937 bSig = extractFloat64Frac( b );
1938 bExp = extractFloat64Exp( b );
1939 expDiff = aExp - bExp;
1940 aSig <<= 9;
1941 bSig <<= 9;
1942 if ( 0 < expDiff ) {
1943 if ( aExp == 0x7FF ) {
1944 if ( aSig ) return propagateFloat64NaN( a, b );
1945 return a;
1946 }
1947 if ( bExp == 0 ) {
1948 --expDiff;
1949 }
1950 else {
1951 bSig |= LIT64( 0x2000000000000000 );
1952 }
1953 shift64RightJamming( bSig, expDiff, &bSig );
1954 zExp = aExp;
1955 }
1956 else if ( expDiff < 0 ) {
1957 if ( bExp == 0x7FF ) {
1958 if ( bSig ) return propagateFloat64NaN( a, b );
1959 return packFloat64( zSign, 0x7FF, 0 );
1960 }
1961 if ( aExp == 0 ) {
1962 ++expDiff;
1963 }
1964 else {
1965 aSig |= LIT64( 0x2000000000000000 );
1966 }
1967 shift64RightJamming( aSig, - expDiff, &aSig );
1968 zExp = bExp;
1969 }
1970 else {
1971 if ( aExp == 0x7FF ) {
1972 if ( aSig | bSig ) return propagateFloat64NaN( a, b );
1973 return a;
1974 }
1975 if ( aExp == 0 ) return packFloat64( zSign, 0, ( aSig + bSig )>>9 );
1976 zSig = LIT64( 0x4000000000000000 ) + aSig + bSig;
1977 zExp = aExp;
1978 goto roundAndPack;
1979 }
1980 aSig |= LIT64( 0x2000000000000000 );
1981 zSig = ( aSig + bSig )<<1;
1982 --zExp;
1983 if ( (sbits64) zSig < 0 ) {
1984 zSig = aSig + bSig;
1985 ++zExp;
1986 }
1987 roundAndPack:
1988 return roundAndPackFloat64( zSign, zExp, zSig );
1989
1990}
1991
1992/*
1993-------------------------------------------------------------------------------
1994Returns the result of subtracting the absolute values of the double-
1995precision floating-point values `a' and `b'. If `zSign' is true, the
1996difference is negated before being returned. `zSign' is ignored if the
1997result is a NaN. The subtraction is performed according to the IEC/IEEE
1998Standard for Binary Floating-point Arithmetic.
1999-------------------------------------------------------------------------------
2000*/
2001static float64 subFloat64Sigs( float64 a, float64 b, flag zSign )
2002{
2003 int16 aExp, bExp, zExp;
2004 bits64 aSig, bSig, zSig;
2005 int16 expDiff;
2006
2007 aSig = extractFloat64Frac( a );
2008 aExp = extractFloat64Exp( a );
2009 bSig = extractFloat64Frac( b );
2010 bExp = extractFloat64Exp( b );
2011 expDiff = aExp - bExp;
2012 aSig <<= 10;
2013 bSig <<= 10;
2014 if ( 0 < expDiff ) goto aExpBigger;
2015 if ( expDiff < 0 ) goto bExpBigger;
2016 if ( aExp == 0x7FF ) {
2017 if ( aSig | bSig ) return propagateFloat64NaN( a, b );
2018 float_raise( float_flag_invalid );
2019 return float64_default_nan;
2020 }
2021 if ( aExp == 0 ) {
2022 aExp = 1;
2023 bExp = 1;
2024 }
2025 if ( bSig < aSig ) goto aBigger;
2026 if ( aSig < bSig ) goto bBigger;
2027 return packFloat64( float_rounding_mode == float_round_down, 0, 0 );
2028 bExpBigger:
2029 if ( bExp == 0x7FF ) {
2030 if ( bSig ) return propagateFloat64NaN( a, b );
2031 return packFloat64( zSign ^ 1, 0x7FF, 0 );
2032 }
2033 if ( aExp == 0 ) {
2034 ++expDiff;
2035 }
2036 else {
2037 aSig |= LIT64( 0x4000000000000000 );
2038 }
2039 shift64RightJamming( aSig, - expDiff, &aSig );
2040 bSig |= LIT64( 0x4000000000000000 );
2041 bBigger:
2042 zSig = bSig - aSig;
2043 zExp = bExp;
2044 zSign ^= 1;
2045 goto normalizeRoundAndPack;
2046 aExpBigger:
2047 if ( aExp == 0x7FF ) {
2048 if ( aSig ) return propagateFloat64NaN( a, b );
2049 return a;
2050 }
2051 if ( bExp == 0 ) {
2052 --expDiff;
2053 }
2054 else {
2055 bSig |= LIT64( 0x4000000000000000 );
2056 }
2057 shift64RightJamming( bSig, expDiff, &bSig );
2058 aSig |= LIT64( 0x4000000000000000 );
2059 aBigger:
2060 zSig = aSig - bSig;
2061 zExp = aExp;
2062 normalizeRoundAndPack:
2063 --zExp;
2064 return normalizeRoundAndPackFloat64( zSign, zExp, zSig );
2065
2066}
2067
2068/*
2069-------------------------------------------------------------------------------
2070Returns the result of adding the double-precision floating-point values `a'
2071and `b'. The operation is performed according to the IEC/IEEE Standard for
2072Binary Floating-point Arithmetic.
2073-------------------------------------------------------------------------------
2074*/
2075float64 float64_add( float64 a, float64 b )
2076{
2077 flag aSign, bSign;
2078
2079 aSign = extractFloat64Sign( a );
2080 bSign = extractFloat64Sign( b );
2081 if ( aSign == bSign ) {
2082 return addFloat64Sigs( a, b, aSign );
2083 }
2084 else {
2085 return subFloat64Sigs( a, b, aSign );
2086 }
2087
2088}
2089
2090/*
2091-------------------------------------------------------------------------------
2092Returns the result of subtracting the double-precision floating-point values
2093`a' and `b'. The operation is performed according to the IEC/IEEE Standard
2094for Binary Floating-point Arithmetic.
2095-------------------------------------------------------------------------------
2096*/
2097float64 float64_sub( float64 a, float64 b )
2098{
2099 flag aSign, bSign;
2100
2101 aSign = extractFloat64Sign( a );
2102 bSign = extractFloat64Sign( b );
2103 if ( aSign == bSign ) {
2104 return subFloat64Sigs( a, b, aSign );
2105 }
2106 else {
2107 return addFloat64Sigs( a, b, aSign );
2108 }
2109
2110}
2111
2112/*
2113-------------------------------------------------------------------------------
2114Returns the result of multiplying the double-precision floating-point values
2115`a' and `b'. The operation is performed according to the IEC/IEEE Standard
2116for Binary Floating-point Arithmetic.
2117-------------------------------------------------------------------------------
2118*/
2119float64 float64_mul( float64 a, float64 b )
2120{
2121 flag aSign, bSign, zSign;
2122 int16 aExp, bExp, zExp;
2123 bits64 aSig, bSig, zSig0, zSig1;
2124
2125 aSig = extractFloat64Frac( a );
2126 aExp = extractFloat64Exp( a );
2127 aSign = extractFloat64Sign( a );
2128 bSig = extractFloat64Frac( b );
2129 bExp = extractFloat64Exp( b );
2130 bSign = extractFloat64Sign( b );
2131 zSign = aSign ^ bSign;
2132 if ( aExp == 0x7FF ) {
2133 if ( aSig || ( ( bExp == 0x7FF ) && bSig ) ) {
2134 return propagateFloat64NaN( a, b );
2135 }
2136 if ( ( bExp | bSig ) == 0 ) {
2137 float_raise( float_flag_invalid );
2138 return float64_default_nan;
2139 }
2140 return packFloat64( zSign, 0x7FF, 0 );
2141 }
2142 if ( bExp == 0x7FF ) {
2143 if ( bSig ) return propagateFloat64NaN( a, b );
2144 if ( ( aExp | aSig ) == 0 ) {
2145 float_raise( float_flag_invalid );
2146 return float64_default_nan;
2147 }
2148 return packFloat64( zSign, 0x7FF, 0 );
2149 }
2150 if ( aExp == 0 ) {
2151 if ( aSig == 0 ) return packFloat64( zSign, 0, 0 );
2152 normalizeFloat64Subnormal( aSig, &aExp, &aSig );
2153 }
2154 if ( bExp == 0 ) {
2155 if ( bSig == 0 ) return packFloat64( zSign, 0, 0 );
2156 normalizeFloat64Subnormal( bSig, &bExp, &bSig );
2157 }
2158 zExp = aExp + bExp - 0x3FF;
2159 aSig = ( aSig | LIT64( 0x0010000000000000 ) )<<10;
2160 bSig = ( bSig | LIT64( 0x0010000000000000 ) )<<11;
2161 mul64To128( aSig, bSig, &zSig0, &zSig1 );
2162 zSig0 |= ( zSig1 != 0 );
2163 if ( 0 <= (sbits64) ( zSig0<<1 ) ) {
2164 zSig0 <<= 1;
2165 --zExp;
2166 }
2167 return roundAndPackFloat64( zSign, zExp, zSig0 );
2168
2169}
2170
2171/*
2172-------------------------------------------------------------------------------
2173Returns the result of dividing the double-precision floating-point value `a'
2174by the corresponding value `b'. The operation is performed according to
2175the IEC/IEEE Standard for Binary Floating-point Arithmetic.
2176-------------------------------------------------------------------------------
2177*/
2178float64 float64_div( float64 a, float64 b )
2179{
2180 flag aSign, bSign, zSign;
2181 int16 aExp, bExp, zExp;
2182 bits64 aSig, bSig, zSig;
2183 bits64 rem0, rem1;
2184 bits64 term0, term1;
2185
2186 aSig = extractFloat64Frac( a );
2187 aExp = extractFloat64Exp( a );
2188 aSign = extractFloat64Sign( a );
2189 bSig = extractFloat64Frac( b );
2190 bExp = extractFloat64Exp( b );
2191 bSign = extractFloat64Sign( b );
2192 zSign = aSign ^ bSign;
2193 if ( aExp == 0x7FF ) {
2194 if ( aSig ) return propagateFloat64NaN( a, b );
2195 if ( bExp == 0x7FF ) {
2196 if ( bSig ) return propagateFloat64NaN( a, b );
2197 float_raise( float_flag_invalid );
2198 return float64_default_nan;
2199 }
2200 return packFloat64( zSign, 0x7FF, 0 );
2201 }
2202 if ( bExp == 0x7FF ) {
2203 if ( bSig ) return propagateFloat64NaN( a, b );
2204 return packFloat64( zSign, 0, 0 );
2205 }
2206 if ( bExp == 0 ) {
2207 if ( bSig == 0 ) {
2208 if ( ( aExp | aSig ) == 0 ) {
2209 float_raise( float_flag_invalid );
2210 return float64_default_nan;
2211 }
2212 float_raise( float_flag_divbyzero );
2213 return packFloat64( zSign, 0x7FF, 0 );
2214 }
2215 normalizeFloat64Subnormal( bSig, &bExp, &bSig );
2216 }
2217 if ( aExp == 0 ) {
2218 if ( aSig == 0 ) return packFloat64( zSign, 0, 0 );
2219 normalizeFloat64Subnormal( aSig, &aExp, &aSig );
2220 }
2221 zExp = aExp - bExp + 0x3FD;
2222 aSig = ( aSig | LIT64( 0x0010000000000000 ) )<<10;
2223 bSig = ( bSig | LIT64( 0x0010000000000000 ) )<<11;
2224 if ( bSig <= ( aSig + aSig ) ) {
2225 aSig >>= 1;
2226 ++zExp;
2227 }
2228 zSig = estimateDiv128To64( aSig, 0, bSig );
2229 if ( ( zSig & 0x1FF ) <= 2 ) {
2230 mul64To128( bSig, zSig, &term0, &term1 );
2231 sub128( aSig, 0, term0, term1, &rem0, &rem1 );
2232 while ( (sbits64) rem0 < 0 ) {
2233 --zSig;
2234 add128( rem0, rem1, 0, bSig, &rem0, &rem1 );
2235 }
2236 zSig |= ( rem1 != 0 );
2237 }
2238 return roundAndPackFloat64( zSign, zExp, zSig );
2239
2240}
2241
2242/*
2243-------------------------------------------------------------------------------
2244Returns the remainder of the double-precision floating-point value `a'
2245with respect to the corresponding value `b'. The operation is performed
2246according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
2247-------------------------------------------------------------------------------
2248*/
2249float64 float64_rem( float64 a, float64 b )
2250{
2251 flag aSign, bSign, zSign;
2252 int16 aExp, bExp, expDiff;
2253 bits64 aSig, bSig;
2254 bits64 q, alternateASig;
2255 sbits64 sigMean;
2256
2257 aSig = extractFloat64Frac( a );
2258 aExp = extractFloat64Exp( a );
2259 aSign = extractFloat64Sign( a );
2260 bSig = extractFloat64Frac( b );
2261 bExp = extractFloat64Exp( b );
2262 bSign = extractFloat64Sign( b );
2263 if ( aExp == 0x7FF ) {
2264 if ( aSig || ( ( bExp == 0x7FF ) && bSig ) ) {
2265 return propagateFloat64NaN( a, b );
2266 }
2267 float_raise( float_flag_invalid );
2268 return float64_default_nan;
2269 }
2270 if ( bExp == 0x7FF ) {
2271 if ( bSig ) return propagateFloat64NaN( a, b );
2272 return a;
2273 }
2274 if ( bExp == 0 ) {
2275 if ( bSig == 0 ) {
2276 float_raise( float_flag_invalid );
2277 return float64_default_nan;
2278 }
2279 normalizeFloat64Subnormal( bSig, &bExp, &bSig );
2280 }
2281 if ( aExp == 0 ) {
2282 if ( aSig == 0 ) return a;
2283 normalizeFloat64Subnormal( aSig, &aExp, &aSig );
2284 }
2285 expDiff = aExp - bExp;
2286 aSig = ( aSig | LIT64( 0x0010000000000000 ) )<<11;
2287 bSig = ( bSig | LIT64( 0x0010000000000000 ) )<<11;
2288 if ( expDiff < 0 ) {
2289 if ( expDiff < -1 ) return a;
2290 aSig >>= 1;
2291 }
2292 q = ( bSig <= aSig );
2293 if ( q ) aSig -= bSig;
2294 expDiff -= 64;
2295 while ( 0 < expDiff ) {
2296 q = estimateDiv128To64( aSig, 0, bSig );
2297 q = ( 2 < q ) ? q - 2 : 0;
2298 aSig = - ( ( bSig>>2 ) * q );
2299 expDiff -= 62;
2300 }
2301 expDiff += 64;
2302 if ( 0 < expDiff ) {
2303 q = estimateDiv128To64( aSig, 0, bSig );
2304 q = ( 2 < q ) ? q - 2 : 0;
2305 q >>= 64 - expDiff;
2306 bSig >>= 2;
2307 aSig = ( ( aSig>>1 )<<( expDiff - 1 ) ) - bSig * q;
2308 }
2309 else {
2310 aSig >>= 2;
2311 bSig >>= 2;
2312 }
2313 do {
2314 alternateASig = aSig;
2315 ++q;
2316 aSig -= bSig;
2317 } while ( 0 <= (sbits64) aSig );
2318 sigMean = aSig + alternateASig;
2319 if ( ( sigMean < 0 ) || ( ( sigMean == 0 ) && ( q & 1 ) ) ) {
2320 aSig = alternateASig;
2321 }
2322 zSign = ( (sbits64) aSig < 0 );
2323 if ( zSign ) aSig = - aSig;
2324 return normalizeRoundAndPackFloat64( aSign ^ zSign, bExp, aSig );
2325
2326}
2327
2328/*
2329-------------------------------------------------------------------------------
2330Returns the square root of the double-precision floating-point value `a'.
2331The operation is performed according to the IEC/IEEE Standard for Binary
2332Floating-point Arithmetic.
2333-------------------------------------------------------------------------------
2334*/
2335float64 float64_sqrt( float64 a )
2336{
2337 flag aSign;
2338 int16 aExp, zExp;
2339 bits64 aSig, zSig;
2340 bits64 rem0, rem1, term0, term1; //, shiftedRem;
2341 //float64 z;
2342
2343 aSig = extractFloat64Frac( a );
2344 aExp = extractFloat64Exp( a );
2345 aSign = extractFloat64Sign( a );
2346 if ( aExp == 0x7FF ) {
2347 if ( aSig ) return propagateFloat64NaN( a, a );
2348 if ( ! aSign ) return a;
2349 float_raise( float_flag_invalid );
2350 return float64_default_nan;
2351 }
2352 if ( aSign ) {
2353 if ( ( aExp | aSig ) == 0 ) return a;
2354 float_raise( float_flag_invalid );
2355 return float64_default_nan;
2356 }
2357 if ( aExp == 0 ) {
2358 if ( aSig == 0 ) return 0;
2359 normalizeFloat64Subnormal( aSig, &aExp, &aSig );
2360 }
2361 zExp = ( ( aExp - 0x3FF )>>1 ) + 0x3FE;
2362 aSig |= LIT64( 0x0010000000000000 );
2363 zSig = estimateSqrt32( aExp, aSig>>21 );
2364 zSig <<= 31;
2365 aSig <<= 9 - ( aExp & 1 );
2366 zSig = estimateDiv128To64( aSig, 0, zSig ) + zSig + 2;
2367 if ( ( zSig & 0x3FF ) <= 5 ) {
2368 if ( zSig < 2 ) {
2369 zSig = LIT64( 0xFFFFFFFFFFFFFFFF );
2370 }
2371 else {
2372 aSig <<= 2;
2373 mul64To128( zSig, zSig, &term0, &term1 );
2374 sub128( aSig, 0, term0, term1, &rem0, &rem1 );
2375 while ( (sbits64) rem0 < 0 ) {
2376 --zSig;
2377 shortShift128Left( 0, zSig, 1, &term0, &term1 );
2378 term1 |= 1;
2379 add128( rem0, rem1, term0, term1, &rem0, &rem1 );
2380 }
2381 zSig |= ( ( rem0 | rem1 ) != 0 );
2382 }
2383 }
2384 shift64RightJamming( zSig, 1, &zSig );
2385 return roundAndPackFloat64( 0, zExp, zSig );
2386
2387}
2388
2389/*
2390-------------------------------------------------------------------------------
2391Returns 1 if the double-precision floating-point value `a' is equal to the
2392corresponding value `b', and 0 otherwise. The comparison is performed
2393according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
2394-------------------------------------------------------------------------------
2395*/
2396flag float64_eq( float64 a, float64 b )
2397{
2398
2399 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
2400 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
2401 ) {
2402 if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) {
2403 float_raise( float_flag_invalid );
2404 }
2405 return 0;
2406 }
2407 return ( a == b ) || ( (bits64) ( ( a | b )<<1 ) == 0 );
2408
2409}
2410
2411/*
2412-------------------------------------------------------------------------------
2413Returns 1 if the double-precision floating-point value `a' is less than or
2414equal to the corresponding value `b', and 0 otherwise. The comparison is
2415performed according to the IEC/IEEE Standard for Binary Floating-point
2416Arithmetic.
2417-------------------------------------------------------------------------------
2418*/
2419flag float64_le( float64 a, float64 b )
2420{
2421 flag aSign, bSign;
2422
2423 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
2424 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
2425 ) {
2426 float_raise( float_flag_invalid );
2427 return 0;
2428 }
2429 aSign = extractFloat64Sign( a );
2430 bSign = extractFloat64Sign( b );
2431 if ( aSign != bSign ) return aSign || ( (bits64) ( ( a | b )<<1 ) == 0 );
2432 return ( a == b ) || ( aSign ^ ( a < b ) );
2433
2434}
2435
2436/*
2437-------------------------------------------------------------------------------
2438Returns 1 if the double-precision floating-point value `a' is less than
2439the corresponding value `b', and 0 otherwise. The comparison is performed
2440according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
2441-------------------------------------------------------------------------------
2442*/
2443flag float64_lt( float64 a, float64 b )
2444{
2445 flag aSign, bSign;
2446
2447 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
2448 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
2449 ) {
2450 float_raise( float_flag_invalid );
2451 return 0;
2452 }
2453 aSign = extractFloat64Sign( a );
2454 bSign = extractFloat64Sign( b );
2455 if ( aSign != bSign ) return aSign && ( (bits64) ( ( a | b )<<1 ) != 0 );
2456 return ( a != b ) && ( aSign ^ ( a < b ) );
2457
2458}
2459
2460/*
2461-------------------------------------------------------------------------------
2462Returns 1 if the double-precision floating-point value `a' is equal to the
2463corresponding value `b', and 0 otherwise. The invalid exception is raised
2464if either operand is a NaN. Otherwise, the comparison is performed
2465according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
2466-------------------------------------------------------------------------------
2467*/
2468flag float64_eq_signaling( float64 a, float64 b )
2469{
2470
2471 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
2472 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
2473 ) {
2474 float_raise( float_flag_invalid );
2475 return 0;
2476 }
2477 return ( a == b ) || ( (bits64) ( ( a | b )<<1 ) == 0 );
2478
2479}
2480
2481/*
2482-------------------------------------------------------------------------------
2483Returns 1 if the double-precision floating-point value `a' is less than or
2484equal to the corresponding value `b', and 0 otherwise. Quiet NaNs do not
2485cause an exception. Otherwise, the comparison is performed according to the
2486IEC/IEEE Standard for Binary Floating-point Arithmetic.
2487-------------------------------------------------------------------------------
2488*/
2489flag float64_le_quiet( float64 a, float64 b )
2490{
2491 flag aSign, bSign;
2492 //int16 aExp, bExp;
2493
2494 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
2495 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
2496 ) {
2497 if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) {
2498 float_raise( float_flag_invalid );
2499 }
2500 return 0;
2501 }
2502 aSign = extractFloat64Sign( a );
2503 bSign = extractFloat64Sign( b );
2504 if ( aSign != bSign ) return aSign || ( (bits64) ( ( a | b )<<1 ) == 0 );
2505 return ( a == b ) || ( aSign ^ ( a < b ) );
2506
2507}
2508
2509/*
2510-------------------------------------------------------------------------------
2511Returns 1 if the double-precision floating-point value `a' is less than
2512the corresponding value `b', and 0 otherwise. Quiet NaNs do not cause an
2513exception. Otherwise, the comparison is performed according to the IEC/IEEE
2514Standard for Binary Floating-point Arithmetic.
2515-------------------------------------------------------------------------------
2516*/
2517flag float64_lt_quiet( float64 a, float64 b )
2518{
2519 flag aSign, bSign;
2520
2521 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
2522 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
2523 ) {
2524 if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) {
2525 float_raise( float_flag_invalid );
2526 }
2527 return 0;
2528 }
2529 aSign = extractFloat64Sign( a );
2530 bSign = extractFloat64Sign( b );
2531 if ( aSign != bSign ) return aSign && ( (bits64) ( ( a | b )<<1 ) != 0 );
2532 return ( a != b ) && ( aSign ^ ( a < b ) );
2533
2534}
2535
2536#ifdef FLOATX80
2537
2538/*
2539-------------------------------------------------------------------------------
2540Returns the result of converting the extended double-precision floating-
2541point value `a' to the 32-bit two's complement integer format. The
2542conversion is performed according to the IEC/IEEE Standard for Binary
2543Floating-point Arithmetic---which means in particular that the conversion
2544is rounded according to the current rounding mode. If `a' is a NaN, the
2545largest positive integer is returned. Otherwise, if the conversion
2546overflows, the largest integer with the same sign as `a' is returned.
2547-------------------------------------------------------------------------------
2548*/
2549int32 floatx80_to_int32( floatx80 a )
2550{
2551 flag aSign;
2552 int32 aExp, shiftCount;
2553 bits64 aSig;
2554
2555 aSig = extractFloatx80Frac( a );
2556 aExp = extractFloatx80Exp( a );
2557 aSign = extractFloatx80Sign( a );
2558 if ( ( aExp == 0x7FFF ) && (bits64) ( aSig<<1 ) ) aSign = 0;
2559 shiftCount = 0x4037 - aExp;
2560 if ( shiftCount <= 0 ) shiftCount = 1;
2561 shift64RightJamming( aSig, shiftCount, &aSig );
2562 return roundAndPackInt32( aSign, aSig );
2563
2564}
2565
2566/*
2567-------------------------------------------------------------------------------
2568Returns the result of converting the extended double-precision floating-
2569point value `a' to the 32-bit two's complement integer format. The
2570conversion is performed according to the IEC/IEEE Standard for Binary
2571Floating-point Arithmetic, except that the conversion is always rounded
2572toward zero. If `a' is a NaN, the largest positive integer is returned.
2573Otherwise, if the conversion overflows, the largest integer with the same
2574sign as `a' is returned.
2575-------------------------------------------------------------------------------
2576*/
2577int32 floatx80_to_int32_round_to_zero( floatx80 a )
2578{
2579 flag aSign;
2580 int32 aExp, shiftCount;
2581 bits64 aSig, savedASig;
2582 int32 z;
2583
2584 aSig = extractFloatx80Frac( a );
2585 aExp = extractFloatx80Exp( a );
2586 aSign = extractFloatx80Sign( a );
2587 shiftCount = 0x403E - aExp;
2588 if ( shiftCount < 32 ) {
2589 if ( ( aExp == 0x7FFF ) && (bits64) ( aSig<<1 ) ) aSign = 0;
2590 goto invalid;
2591 }
2592 else if ( 63 < shiftCount ) {
2593 if ( aExp || aSig ) float_exception_flags |= float_flag_inexact;
2594 return 0;
2595 }
2596 savedASig = aSig;
2597 aSig >>= shiftCount;
2598 z = aSig;
2599 if ( aSign ) z = - z;
2600 if ( ( z < 0 ) ^ aSign ) {
2601 invalid:
2602 float_exception_flags |= float_flag_invalid;
2603 return aSign ? 0x80000000 : 0x7FFFFFFF;
2604 }
2605 if ( ( aSig<<shiftCount ) != savedASig ) {
2606 float_exception_flags |= float_flag_inexact;
2607 }
2608 return z;
2609
2610}
2611
2612/*
2613-------------------------------------------------------------------------------
2614Returns the result of converting the extended double-precision floating-
2615point value `a' to the single-precision floating-point format. The
2616conversion is performed according to the IEC/IEEE Standard for Binary
2617Floating-point Arithmetic.
2618-------------------------------------------------------------------------------
2619*/
2620float32 floatx80_to_float32( floatx80 a )
2621{
2622 flag aSign;
2623 int32 aExp;
2624 bits64 aSig;
2625
2626 aSig = extractFloatx80Frac( a );
2627 aExp = extractFloatx80Exp( a );
2628 aSign = extractFloatx80Sign( a );
2629 if ( aExp == 0x7FFF ) {
2630 if ( (bits64) ( aSig<<1 ) ) {
2631 return commonNaNToFloat32( floatx80ToCommonNaN( a ) );
2632 }
2633 return packFloat32( aSign, 0xFF, 0 );
2634 }
2635 shift64RightJamming( aSig, 33, &aSig );
2636 if ( aExp || aSig ) aExp -= 0x3F81;
2637 return roundAndPackFloat32( aSign, aExp, aSig );
2638
2639}
2640
2641/*
2642-------------------------------------------------------------------------------
2643Returns the result of converting the extended double-precision floating-
2644point value `a' to the double-precision floating-point format. The
2645conversion is performed according to the IEC/IEEE Standard for Binary
2646Floating-point Arithmetic.
2647-------------------------------------------------------------------------------
2648*/
2649float64 floatx80_to_float64( floatx80 a )
2650{
2651 flag aSign;
2652 int32 aExp;
2653 bits64 aSig, zSig;
2654
2655 aSig = extractFloatx80Frac( a );
2656 aExp = extractFloatx80Exp( a );
2657 aSign = extractFloatx80Sign( a );
2658 if ( aExp == 0x7FFF ) {
2659 if ( (bits64) ( aSig<<1 ) ) {
2660 return commonNaNToFloat64( floatx80ToCommonNaN( a ) );
2661 }
2662 return packFloat64( aSign, 0x7FF, 0 );
2663 }
2664 shift64RightJamming( aSig, 1, &zSig );
2665 if ( aExp || aSig ) aExp -= 0x3C01;
2666 return roundAndPackFloat64( aSign, aExp, zSig );
2667
2668}
2669
2670/*
2671-------------------------------------------------------------------------------
2672Rounds the extended double-precision floating-point value `a' to an integer,
2673and returns the result as an extended quadruple-precision floating-point
2674value. The operation is performed according to the IEC/IEEE Standard for
2675Binary Floating-point Arithmetic.
2676-------------------------------------------------------------------------------
2677*/
2678floatx80 floatx80_round_to_int( floatx80 a )
2679{
2680 flag aSign;
2681 int32 aExp;
2682 bits64 lastBitMask, roundBitsMask;
2683 int8 roundingMode;
2684 floatx80 z;
2685
2686 aExp = extractFloatx80Exp( a );
2687 if ( 0x403E <= aExp ) {
2688 if ( ( aExp == 0x7FFF ) && (bits64) ( extractFloatx80Frac( a )<<1 ) ) {
2689 return propagateFloatx80NaN( a, a );
2690 }
2691 return a;
2692 }
2693 if ( aExp <= 0x3FFE ) {
2694 if ( ( aExp == 0 )
2695 && ( (bits64) ( extractFloatx80Frac( a )<<1 ) == 0 ) ) {
2696 return a;
2697 }
2698 float_exception_flags |= float_flag_inexact;
2699 aSign = extractFloatx80Sign( a );
2700 switch ( float_rounding_mode ) {
2701 case float_round_nearest_even:
2702 if ( ( aExp == 0x3FFE ) && (bits64) ( extractFloatx80Frac( a )<<1 )
2703 ) {
2704 return
2705 packFloatx80( aSign, 0x3FFF, LIT64( 0x8000000000000000 ) );
2706 }
2707 break;
2708 case float_round_down:
2709 return
2710 aSign ?
2711 packFloatx80( 1, 0x3FFF, LIT64( 0x8000000000000000 ) )
2712 : packFloatx80( 0, 0, 0 );
2713 case float_round_up:
2714 return
2715 aSign ? packFloatx80( 1, 0, 0 )
2716 : packFloatx80( 0, 0x3FFF, LIT64( 0x8000000000000000 ) );
2717 }
2718 return packFloatx80( aSign, 0, 0 );
2719 }
2720 lastBitMask = 1;
2721 lastBitMask <<= 0x403E - aExp;
2722 roundBitsMask = lastBitMask - 1;
2723 z = a;
2724 roundingMode = float_rounding_mode;
2725 if ( roundingMode == float_round_nearest_even ) {
2726 z.low += lastBitMask>>1;
2727 if ( ( z.low & roundBitsMask ) == 0 ) z.low &= ~ lastBitMask;
2728 }
2729 else if ( roundingMode != float_round_to_zero ) {
2730 if ( extractFloatx80Sign( z ) ^ ( roundingMode == float_round_up ) ) {
2731 z.low += roundBitsMask;
2732 }
2733 }
2734 z.low &= ~ roundBitsMask;
2735 if ( z.low == 0 ) {
2736 ++z.high;
2737 z.low = LIT64( 0x8000000000000000 );
2738 }
2739 if ( z.low != a.low ) float_exception_flags |= float_flag_inexact;
2740 return z;
2741
2742}
2743
2744/*
2745-------------------------------------------------------------------------------
2746Returns the result of adding the absolute values of the extended double-
2747precision floating-point values `a' and `b'. If `zSign' is true, the sum is
2748negated before being returned. `zSign' is ignored if the result is a NaN.
2749The addition is performed according to the IEC/IEEE Standard for Binary
2750Floating-point Arithmetic.
2751-------------------------------------------------------------------------------
2752*/
2753static floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign )
2754{
2755 int32 aExp, bExp, zExp;
2756 bits64 aSig, bSig, zSig0, zSig1;
2757 int32 expDiff;
2758
2759 aSig = extractFloatx80Frac( a );
2760 aExp = extractFloatx80Exp( a );
2761 bSig = extractFloatx80Frac( b );
2762 bExp = extractFloatx80Exp( b );
2763 expDiff = aExp - bExp;
2764 if ( 0 < expDiff ) {
2765 if ( aExp == 0x7FFF ) {
2766 if ( (bits64) ( aSig<<1 ) ) return propagateFloatx80NaN( a, b );
2767 return a;
2768 }
2769 if ( bExp == 0 ) --expDiff;
2770 shift64ExtraRightJamming( bSig, 0, expDiff, &bSig, &zSig1 );
2771 zExp = aExp;
2772 }
2773 else if ( expDiff < 0 ) {
2774 if ( bExp == 0x7FFF ) {
2775 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b );
2776 return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
2777 }
2778 if ( aExp == 0 ) ++expDiff;
2779 shift64ExtraRightJamming( aSig, 0, - expDiff, &aSig, &zSig1 );
2780 zExp = bExp;
2781 }
2782 else {
2783 if ( aExp == 0x7FFF ) {
2784 if ( (bits64) ( ( aSig | bSig )<<1 ) ) {
2785 return propagateFloatx80NaN( a, b );
2786 }
2787 return a;
2788 }
2789 zSig1 = 0;
2790 zSig0 = aSig + bSig;
2791 if ( aExp == 0 ) {
2792 normalizeFloatx80Subnormal( zSig0, &zExp, &zSig0 );
2793 goto roundAndPack;
2794 }
2795 zExp = aExp;
2796 goto shiftRight1;
2797 }
2798
2799 zSig0 = aSig + bSig;
2800
2801 if ( (sbits64) zSig0 < 0 ) goto roundAndPack;
2802 shiftRight1:
2803 shift64ExtraRightJamming( zSig0, zSig1, 1, &zSig0, &zSig1 );
2804 zSig0 |= LIT64( 0x8000000000000000 );
2805 ++zExp;
2806 roundAndPack:
2807 return
2808 roundAndPackFloatx80(
2809 floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 );
2810
2811}
2812
2813/*
2814-------------------------------------------------------------------------------
2815Returns the result of subtracting the absolute values of the extended
2816double-precision floating-point values `a' and `b'. If `zSign' is true,
2817the difference is negated before being returned. `zSign' is ignored if the
2818result is a NaN. The subtraction is performed according to the IEC/IEEE
2819Standard for Binary Floating-point Arithmetic.
2820-------------------------------------------------------------------------------
2821*/
2822static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign )
2823{
2824 int32 aExp, bExp, zExp;
2825 bits64 aSig, bSig, zSig0, zSig1;
2826 int32 expDiff;
2827 floatx80 z;
2828
2829 aSig = extractFloatx80Frac( a );
2830 aExp = extractFloatx80Exp( a );
2831 bSig = extractFloatx80Frac( b );
2832 bExp = extractFloatx80Exp( b );
2833 expDiff = aExp - bExp;
2834 if ( 0 < expDiff ) goto aExpBigger;
2835 if ( expDiff < 0 ) goto bExpBigger;
2836 if ( aExp == 0x7FFF ) {
2837 if ( (bits64) ( ( aSig | bSig )<<1 ) ) {
2838 return propagateFloatx80NaN( a, b );
2839 }
2840 float_raise( float_flag_invalid );
2841 z.low = floatx80_default_nan_low;
2842 z.high = floatx80_default_nan_high;
2843 return z;
2844 }
2845 if ( aExp == 0 ) {
2846 aExp = 1;
2847 bExp = 1;
2848 }
2849 zSig1 = 0;
2850 if ( bSig < aSig ) goto aBigger;
2851 if ( aSig < bSig ) goto bBigger;
2852 return packFloatx80( float_rounding_mode == float_round_down, 0, 0 );
2853 bExpBigger:
2854 if ( bExp == 0x7FFF ) {
2855 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b );
2856 return packFloatx80( zSign ^ 1, 0x7FFF, LIT64( 0x8000000000000000 ) );
2857 }
2858 if ( aExp == 0 ) ++expDiff;
2859 shift128RightJamming( aSig, 0, - expDiff, &aSig, &zSig1 );
2860 bBigger:
2861 sub128( bSig, 0, aSig, zSig1, &zSig0, &zSig1 );
2862 zExp = bExp;
2863 zSign ^= 1;
2864 goto normalizeRoundAndPack;
2865 aExpBigger:
2866 if ( aExp == 0x7FFF ) {
2867 if ( (bits64) ( aSig<<1 ) ) return propagateFloatx80NaN( a, b );
2868 return a;
2869 }
2870 if ( bExp == 0 ) --expDiff;
2871 shift128RightJamming( bSig, 0, expDiff, &bSig, &zSig1 );
2872 aBigger:
2873 sub128( aSig, 0, bSig, zSig1, &zSig0, &zSig1 );
2874 zExp = aExp;
2875 normalizeRoundAndPack:
2876 return
2877 normalizeRoundAndPackFloatx80(
2878 floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 );
2879
2880}
2881
2882/*
2883-------------------------------------------------------------------------------
2884Returns the result of adding the extended double-precision floating-point
2885values `a' and `b'. The operation is performed according to the IEC/IEEE
2886Standard for Binary Floating-point Arithmetic.
2887-------------------------------------------------------------------------------
2888*/
2889floatx80 floatx80_add( floatx80 a, floatx80 b )
2890{
2891 flag aSign, bSign;
2892
2893 aSign = extractFloatx80Sign( a );
2894 bSign = extractFloatx80Sign( b );
2895 if ( aSign == bSign ) {
2896 return addFloatx80Sigs( a, b, aSign );
2897 }
2898 else {
2899 return subFloatx80Sigs( a, b, aSign );
2900 }
2901
2902}
2903
2904/*
2905-------------------------------------------------------------------------------
2906Returns the result of subtracting the extended double-precision floating-
2907point values `a' and `b'. The operation is performed according to the
2908IEC/IEEE Standard for Binary Floating-point Arithmetic.
2909-------------------------------------------------------------------------------
2910*/
2911floatx80 floatx80_sub( floatx80 a, floatx80 b )
2912{
2913 flag aSign, bSign;
2914
2915 aSign = extractFloatx80Sign( a );
2916 bSign = extractFloatx80Sign( b );
2917 if ( aSign == bSign ) {
2918 return subFloatx80Sigs( a, b, aSign );
2919 }
2920 else {
2921 return addFloatx80Sigs( a, b, aSign );
2922 }
2923
2924}
2925
2926/*
2927-------------------------------------------------------------------------------
2928Returns the result of multiplying the extended double-precision floating-
2929point values `a' and `b'. The operation is performed according to the
2930IEC/IEEE Standard for Binary Floating-point Arithmetic.
2931-------------------------------------------------------------------------------
2932*/
2933floatx80 floatx80_mul( floatx80 a, floatx80 b )
2934{
2935 flag aSign, bSign, zSign;
2936 int32 aExp, bExp, zExp;
2937 bits64 aSig, bSig, zSig0, zSig1;
2938 floatx80 z;
2939
2940 aSig = extractFloatx80Frac( a );
2941 aExp = extractFloatx80Exp( a );
2942 aSign = extractFloatx80Sign( a );
2943 bSig = extractFloatx80Frac( b );
2944 bExp = extractFloatx80Exp( b );
2945 bSign = extractFloatx80Sign( b );
2946 zSign = aSign ^ bSign;
2947 if ( aExp == 0x7FFF ) {
2948 if ( (bits64) ( aSig<<1 )
2949 || ( ( bExp == 0x7FFF ) && (bits64) ( bSig<<1 ) ) ) {
2950 return propagateFloatx80NaN( a, b );
2951 }
2952 if ( ( bExp | bSig ) == 0 ) goto invalid;
2953 return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
2954 }
2955 if ( bExp == 0x7FFF ) {
2956 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b );
2957 if ( ( aExp | aSig ) == 0 ) {
2958 invalid:
2959 float_raise( float_flag_invalid );
2960 z.low = floatx80_default_nan_low;
2961 z.high = floatx80_default_nan_high;
2962 return z;
2963 }
2964 return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
2965 }
2966 if ( aExp == 0 ) {
2967 if ( aSig == 0 ) return packFloatx80( zSign, 0, 0 );
2968 normalizeFloatx80Subnormal( aSig, &aExp, &aSig );
2969 }
2970 if ( bExp == 0 ) {
2971 if ( bSig == 0 ) return packFloatx80( zSign, 0, 0 );
2972 normalizeFloatx80Subnormal( bSig, &bExp, &bSig );
2973 }
2974 zExp = aExp + bExp - 0x3FFE;
2975 mul64To128( aSig, bSig, &zSig0, &zSig1 );
2976 if ( 0 < (sbits64) zSig0 ) {
2977 shortShift128Left( zSig0, zSig1, 1, &zSig0, &zSig1 );
2978 --zExp;
2979 }
2980 return
2981 roundAndPackFloatx80(
2982 floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 );
2983
2984}
2985
2986/*
2987-------------------------------------------------------------------------------
2988Returns the result of dividing the extended double-precision floating-point
2989value `a' by the corresponding value `b'. The operation is performed
2990according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
2991-------------------------------------------------------------------------------
2992*/
2993floatx80 floatx80_div( floatx80 a, floatx80 b )
2994{
2995 flag aSign, bSign, zSign;
2996 int32 aExp, bExp, zExp;
2997 bits64 aSig, bSig, zSig0, zSig1;
2998 bits64 rem0, rem1, rem2, term0, term1, term2;
2999 floatx80 z;
3000
3001 aSig = extractFloatx80Frac( a );
3002 aExp = extractFloatx80Exp( a );
3003 aSign = extractFloatx80Sign( a );
3004 bSig = extractFloatx80Frac( b );
3005 bExp = extractFloatx80Exp( b );
3006 bSign = extractFloatx80Sign( b );
3007 zSign = aSign ^ bSign;
3008 if ( aExp == 0x7FFF ) {
3009 if ( (bits64) ( aSig<<1 ) ) return propagateFloatx80NaN( a, b );
3010 if ( bExp == 0x7FFF ) {
3011 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b );
3012 goto invalid;
3013 }
3014 return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
3015 }
3016 if ( bExp == 0x7FFF ) {
3017 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b );
3018 return packFloatx80( zSign, 0, 0 );
3019 }
3020 if ( bExp == 0 ) {
3021 if ( bSig == 0 ) {
3022 if ( ( aExp | aSig ) == 0 ) {
3023 invalid:
3024 float_raise( float_flag_invalid );
3025 z.low = floatx80_default_nan_low;
3026 z.high = floatx80_default_nan_high;
3027 return z;
3028 }
3029 float_raise( float_flag_divbyzero );
3030 return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
3031 }
3032 normalizeFloatx80Subnormal( bSig, &bExp, &bSig );
3033 }
3034 if ( aExp == 0 ) {
3035 if ( aSig == 0 ) return packFloatx80( zSign, 0, 0 );
3036 normalizeFloatx80Subnormal( aSig, &aExp, &aSig );
3037 }
3038 zExp = aExp - bExp + 0x3FFE;
3039 rem1 = 0;
3040 if ( bSig <= aSig ) {
3041 shift128Right( aSig, 0, 1, &aSig, &rem1 );
3042 ++zExp;
3043 }
3044 zSig0 = estimateDiv128To64( aSig, rem1, bSig );
3045 mul64To128( bSig, zSig0, &term0, &term1 );
3046 sub128( aSig, rem1, term0, term1, &rem0, &rem1 );
3047 while ( (sbits64) rem0 < 0 ) {
3048 --zSig0;
3049 add128( rem0, rem1, 0, bSig, &rem0, &rem1 );
3050 }
3051 zSig1 = estimateDiv128To64( rem1, 0, bSig );
3052 if ( (bits64) ( zSig1<<1 ) <= 8 ) {
3053 mul64To128( bSig, zSig1, &term1, &term2 );
3054 sub128( rem1, 0, term1, term2, &rem1, &rem2 );
3055 while ( (sbits64) rem1 < 0 ) {
3056 --zSig1;
3057 add128( rem1, rem2, 0, bSig, &rem1, &rem2 );
3058 }
3059 zSig1 |= ( ( rem1 | rem2 ) != 0 );
3060 }
3061 return
3062 roundAndPackFloatx80(
3063 floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 );
3064
3065}
3066
3067/*
3068-------------------------------------------------------------------------------
3069Returns the remainder of the extended double-precision floating-point value
3070`a' with respect to the corresponding value `b'. The operation is performed
3071according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
3072-------------------------------------------------------------------------------
3073*/
3074floatx80 floatx80_rem( floatx80 a, floatx80 b )
3075{
3076 flag aSign, bSign, zSign;
3077 int32 aExp, bExp, expDiff;
3078 bits64 aSig0, aSig1, bSig;
3079 bits64 q, term0, term1, alternateASig0, alternateASig1;
3080 floatx80 z;
3081
3082 aSig0 = extractFloatx80Frac( a );
3083 aExp = extractFloatx80Exp( a );
3084 aSign = extractFloatx80Sign( a );
3085 bSig = extractFloatx80Frac( b );
3086 bExp = extractFloatx80Exp( b );
3087 bSign = extractFloatx80Sign( b );
3088 if ( aExp == 0x7FFF ) {
3089 if ( (bits64) ( aSig0<<1 )
3090 || ( ( bExp == 0x7FFF ) && (bits64) ( bSig<<1 ) ) ) {
3091 return propagateFloatx80NaN( a, b );
3092 }
3093 goto invalid;
3094 }
3095 if ( bExp == 0x7FFF ) {
3096 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b );
3097 return a;
3098 }
3099 if ( bExp == 0 ) {
3100 if ( bSig == 0 ) {
3101 invalid:
3102 float_raise( float_flag_invalid );
3103 z.low = floatx80_default_nan_low;
3104 z.high = floatx80_default_nan_high;
3105 return z;
3106 }
3107 normalizeFloatx80Subnormal( bSig, &bExp, &bSig );
3108 }
3109 if ( aExp == 0 ) {
3110 if ( (bits64) ( aSig0<<1 ) == 0 ) return a;
3111 normalizeFloatx80Subnormal( aSig0, &aExp, &aSig0 );
3112 }
3113 bSig |= LIT64( 0x8000000000000000 );
3114 zSign = aSign;
3115 expDiff = aExp - bExp;
3116 aSig1 = 0;
3117 if ( expDiff < 0 ) {
3118 if ( expDiff < -1 ) return a;
3119 shift128Right( aSig0, 0, 1, &aSig0, &aSig1 );
3120 expDiff = 0;
3121 }
3122 q = ( bSig <= aSig0 );
3123 if ( q ) aSig0 -= bSig;
3124 expDiff -= 64;
3125 while ( 0 < expDiff ) {
3126 q = estimateDiv128To64( aSig0, aSig1, bSig );
3127 q = ( 2 < q ) ? q - 2 : 0;
3128 mul64To128( bSig, q, &term0, &term1 );
3129 sub128( aSig0, aSig1, term0, term1, &aSig0, &aSig1 );
3130 shortShift128Left( aSig0, aSig1, 62, &aSig0, &aSig1 );
3131 expDiff -= 62;
3132 }
3133 expDiff += 64;
3134 if ( 0 < expDiff ) {
3135 q = estimateDiv128To64( aSig0, aSig1, bSig );
3136 q = ( 2 < q ) ? q - 2 : 0;
3137 q >>= 64 - expDiff;
3138 mul64To128( bSig, q<<( 64 - expDiff ), &term0, &term1 );
3139 sub128( aSig0, aSig1, term0, term1, &aSig0, &aSig1 );
3140 shortShift128Left( 0, bSig, 64 - expDiff, &term0, &term1 );
3141 while ( le128( term0, term1, aSig0, aSig1 ) ) {
3142 ++q;
3143 sub128( aSig0, aSig1, term0, term1, &aSig0, &aSig1 );
3144 }
3145 }
3146 else {
3147 term1 = 0;
3148 term0 = bSig;
3149 }
3150 sub128( term0, term1, aSig0, aSig1, &alternateASig0, &alternateASig1 );
3151 if ( lt128( alternateASig0, alternateASig1, aSig0, aSig1 )
3152 || ( eq128( alternateASig0, alternateASig1, aSig0, aSig1 )
3153 && ( q & 1 ) )
3154 ) {
3155 aSig0 = alternateASig0;
3156 aSig1 = alternateASig1;
3157 zSign = ! zSign;
3158 }
3159 return
3160 normalizeRoundAndPackFloatx80(
3161 80, zSign, bExp + expDiff, aSig0, aSig1 );
3162
3163}
3164
3165/*
3166-------------------------------------------------------------------------------
3167Returns the square root of the extended double-precision floating-point
3168value `a'. The operation is performed according to the IEC/IEEE Standard
3169for Binary Floating-point Arithmetic.
3170-------------------------------------------------------------------------------
3171*/
3172floatx80 floatx80_sqrt( floatx80 a )
3173{
3174 flag aSign;
3175 int32 aExp, zExp;
3176 bits64 aSig0, aSig1, zSig0, zSig1;
3177 bits64 rem0, rem1, rem2, rem3, term0, term1, term2, term3;
3178 bits64 shiftedRem0, shiftedRem1;
3179 floatx80 z;
3180
3181 aSig0 = extractFloatx80Frac( a );
3182 aExp = extractFloatx80Exp( a );
3183 aSign = extractFloatx80Sign( a );
3184 if ( aExp == 0x7FFF ) {
3185 if ( (bits64) ( aSig0<<1 ) ) return propagateFloatx80NaN( a, a );
3186 if ( ! aSign ) return a;
3187 goto invalid;
3188 }
3189 if ( aSign ) {
3190 if ( ( aExp | aSig0 ) == 0 ) return a;
3191 invalid:
3192 float_raise( float_flag_invalid );
3193 z.low = floatx80_default_nan_low;
3194 z.high = floatx80_default_nan_high;
3195 return z;
3196 }
3197 if ( aExp == 0 ) {
3198 if ( aSig0 == 0 ) return packFloatx80( 0, 0, 0 );
3199 normalizeFloatx80Subnormal( aSig0, &aExp, &aSig0 );
3200 }
3201 zExp = ( ( aExp - 0x3FFF )>>1 ) + 0x3FFF;
3202 zSig0 = estimateSqrt32( aExp, aSig0>>32 );
3203 zSig0 <<= 31;
3204 aSig1 = 0;
3205 shift128Right( aSig0, 0, ( aExp & 1 ) + 2, &aSig0, &aSig1 );
3206 zSig0 = estimateDiv128To64( aSig0, aSig1, zSig0 ) + zSig0 + 4;
3207 if ( 0 <= (sbits64) zSig0 ) zSig0 = LIT64( 0xFFFFFFFFFFFFFFFF );
3208 shortShift128Left( aSig0, aSig1, 2, &aSig0, &aSig1 );
3209 mul64To128( zSig0, zSig0, &term0, &term1 );
3210 sub128( aSig0, aSig1, term0, term1, &rem0, &rem1 );
3211 while ( (sbits64) rem0 < 0 ) {
3212 --zSig0;
3213 shortShift128Left( 0, zSig0, 1, &term0, &term1 );
3214 term1 |= 1;
3215 add128( rem0, rem1, term0, term1, &rem0, &rem1 );
3216 }
3217 shortShift128Left( rem0, rem1, 63, &shiftedRem0, &shiftedRem1 );
3218 zSig1 = estimateDiv128To64( shiftedRem0, shiftedRem1, zSig0 );
3219 if ( (bits64) ( zSig1<<1 ) <= 10 ) {
3220 if ( zSig1 == 0 ) zSig1 = 1;
3221 mul64To128( zSig0, zSig1, &term1, &term2 );
3222 shortShift128Left( term1, term2, 1, &term1, &term2 );
3223 sub128( rem1, 0, term1, term2, &rem1, &rem2 );
3224 mul64To128( zSig1, zSig1, &term2, &term3 );
3225 sub192( rem1, rem2, 0, 0, term2, term3, &rem1, &rem2, &rem3 );
3226 while ( (sbits64) rem1 < 0 ) {
3227 --zSig1;
3228 shortShift192Left( 0, zSig0, zSig1, 1, &term1, &term2, &term3 );
3229 term3 |= 1;
3230 add192(
3231 rem1, rem2, rem3, term1, term2, term3, &rem1, &rem2, &rem3 );
3232 }
3233 zSig1 |= ( ( rem1 | rem2 | rem3 ) != 0 );
3234 }
3235 return
3236 roundAndPackFloatx80(
3237 floatx80_rounding_precision, 0, zExp, zSig0, zSig1 );
3238
3239}
3240
3241/*
3242-------------------------------------------------------------------------------
3243Returns 1 if the extended double-precision floating-point value `a' is
3244equal to the corresponding value `b', and 0 otherwise. The comparison is
3245performed according to the IEC/IEEE Standard for Binary Floating-point
3246Arithmetic.
3247-------------------------------------------------------------------------------
3248*/
3249flag floatx80_eq( floatx80 a, floatx80 b )
3250{
3251
3252 if ( ( ( extractFloatx80Exp( a ) == 0x7FFF )
3253 && (bits64) ( extractFloatx80Frac( a )<<1 ) )
3254 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3255 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3256 ) {
3257 if ( floatx80_is_signaling_nan( a )
3258 || floatx80_is_signaling_nan( b ) ) {
3259 float_raise( float_flag_invalid );
3260 }
3261 return 0;
3262 }
3263 return
3264 ( a.low == b.low )
3265 && ( ( a.high == b.high )
3266 || ( ( a.low == 0 )
3267 && ( (bits16) ( ( a.high | b.high )<<1 ) == 0 ) )
3268 );
3269
3270}
3271
3272/*
3273-------------------------------------------------------------------------------
3274Returns 1 if the extended double-precision floating-point value `a' is
3275less than or equal to the corresponding value `b', and 0 otherwise. The
3276comparison is performed according to the IEC/IEEE Standard for Binary
3277Floating-point Arithmetic.
3278-------------------------------------------------------------------------------
3279*/
3280flag floatx80_le( floatx80 a, floatx80 b )
3281{
3282 flag aSign, bSign;
3283
3284 if ( ( ( extractFloatx80Exp( a ) == 0x7FFF )
3285 && (bits64) ( extractFloatx80Frac( a )<<1 ) )
3286 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3287 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3288 ) {
3289 float_raise( float_flag_invalid );
3290 return 0;
3291 }
3292 aSign = extractFloatx80Sign( a );
3293 bSign = extractFloatx80Sign( b );
3294 if ( aSign != bSign ) {
3295 return
3296 aSign
3297 || ( ( ( (bits16) ( ( a.high | b.high )<<1 ) ) | a.low | b.low )
3298 == 0 );
3299 }
3300 return
3301 aSign ? le128( b.high, b.low, a.high, a.low )
3302 : le128( a.high, a.low, b.high, b.low );
3303
3304}
3305
3306/*
3307-------------------------------------------------------------------------------
3308Returns 1 if the extended double-precision floating-point value `a' is
3309less than the corresponding value `b', and 0 otherwise. The comparison
3310is performed according to the IEC/IEEE Standard for Binary Floating-point
3311Arithmetic.
3312-------------------------------------------------------------------------------
3313*/
3314flag floatx80_lt( floatx80 a, floatx80 b )
3315{
3316 flag aSign, bSign;
3317
3318 if ( ( ( extractFloatx80Exp( a ) == 0x7FFF )
3319 && (bits64) ( extractFloatx80Frac( a )<<1 ) )
3320 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3321 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3322 ) {
3323 float_raise( float_flag_invalid );
3324 return 0;
3325 }
3326 aSign = extractFloatx80Sign( a );
3327 bSign = extractFloatx80Sign( b );
3328 if ( aSign != bSign ) {
3329 return
3330 aSign
3331 && ( ( ( (bits16) ( ( a.high | b.high )<<1 ) ) | a.low | b.low )
3332 != 0 );
3333 }
3334 return
3335 aSign ? lt128( b.high, b.low, a.high, a.low )
3336 : lt128( a.high, a.low, b.high, b.low );
3337
3338}
3339
3340/*
3341-------------------------------------------------------------------------------
3342Returns 1 if the extended double-precision floating-point value `a' is equal
3343to the corresponding value `b', and 0 otherwise. The invalid exception is
3344raised if either operand is a NaN. Otherwise, the comparison is performed
3345according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
3346-------------------------------------------------------------------------------
3347*/
3348flag floatx80_eq_signaling( floatx80 a, floatx80 b )
3349{
3350
3351 if ( ( ( extractFloatx80Exp( a ) == 0x7FFF )
3352 && (bits64) ( extractFloatx80Frac( a )<<1 ) )
3353 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3354 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3355 ) {
3356 float_raise( float_flag_invalid );
3357 return 0;
3358 }
3359 return
3360 ( a.low == b.low )
3361 && ( ( a.high == b.high )
3362 || ( ( a.low == 0 )
3363 && ( (bits16) ( ( a.high | b.high )<<1 ) == 0 ) )
3364 );
3365
3366}
3367
3368/*
3369-------------------------------------------------------------------------------
3370Returns 1 if the extended double-precision floating-point value `a' is less
3371than or equal to the corresponding value `b', and 0 otherwise. Quiet NaNs
3372do not cause an exception. Otherwise, the comparison is performed according
3373to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
3374-------------------------------------------------------------------------------
3375*/
3376flag floatx80_le_quiet( floatx80 a, floatx80 b )
3377{
3378 flag aSign, bSign;
3379
3380 if ( ( ( extractFloatx80Exp( a ) == 0x7FFF )
3381 && (bits64) ( extractFloatx80Frac( a )<<1 ) )
3382 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3383 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3384 ) {
3385 if ( floatx80_is_signaling_nan( a )
3386 || floatx80_is_signaling_nan( b ) ) {
3387 float_raise( float_flag_invalid );
3388 }
3389 return 0;
3390 }
3391 aSign = extractFloatx80Sign( a );
3392 bSign = extractFloatx80Sign( b );
3393 if ( aSign != bSign ) {
3394 return
3395 aSign
3396 || ( ( ( (bits16) ( ( a.high | b.high )<<1 ) ) | a.low | b.low )
3397 == 0 );
3398 }
3399 return
3400 aSign ? le128( b.high, b.low, a.high, a.low )
3401 : le128( a.high, a.low, b.high, b.low );
3402
3403}
3404
3405/*
3406-------------------------------------------------------------------------------
3407Returns 1 if the extended double-precision floating-point value `a' is less
3408than the corresponding value `b', and 0 otherwise. Quiet NaNs do not cause
3409an exception. Otherwise, the comparison is performed according to the
3410IEC/IEEE Standard for Binary Floating-point Arithmetic.
3411-------------------------------------------------------------------------------
3412*/
3413flag floatx80_lt_quiet( floatx80 a, floatx80 b )
3414{
3415 flag aSign, bSign;
3416
3417 if ( ( ( extractFloatx80Exp( a ) == 0x7FFF )
3418 && (bits64) ( extractFloatx80Frac( a )<<1 ) )
3419 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3420 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3421 ) {
3422 if ( floatx80_is_signaling_nan( a )
3423 || floatx80_is_signaling_nan( b ) ) {
3424 float_raise( float_flag_invalid );
3425 }
3426 return 0;
3427 }
3428 aSign = extractFloatx80Sign( a );
3429 bSign = extractFloatx80Sign( b );
3430 if ( aSign != bSign ) {
3431 return
3432 aSign
3433 && ( ( ( (bits16) ( ( a.high | b.high )<<1 ) ) | a.low | b.low )
3434 != 0 );
3435 }
3436 return
3437 aSign ? lt128( b.high, b.low, a.high, a.low )
3438 : lt128( a.high, a.low, b.high, b.low );
3439
3440}
3441
3442#endif
3443
diff --git a/arch/arm/nwfpe/softfloat.h b/arch/arm/nwfpe/softfloat.h
new file mode 100644
index 000000000000..1e1743173899
--- /dev/null
+++ b/arch/arm/nwfpe/softfloat.h
@@ -0,0 +1,278 @@
1
2/*
3===============================================================================
4
5This C header file is part of the SoftFloat IEC/IEEE Floating-point
6Arithmetic Package, Release 2.
7
8Written by John R. Hauser. This work was made possible in part by the
9International Computer Science Institute, located at Suite 600, 1947 Center
10Street, Berkeley, California 94704. Funding was partially provided by the
11National Science Foundation under grant MIP-9311980. The original version
12of this code was written as part of a project to build a fixed-point vector
13processor in collaboration with the University of California at Berkeley,
14overseen by Profs. Nelson Morgan and John Wawrzynek. More information
15is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
16arithmetic/softfloat.html'.
17
18THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
19has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
20TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
21PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
22AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
23
24Derivative works are acceptable, even for commercial purposes, so long as
25(1) they include prominent notice that the work is derivative, and (2) they
26include prominent notice akin to these three paragraphs for those parts of
27this code that are retained.
28
29===============================================================================
30*/
31
32#ifndef __SOFTFLOAT_H__
33#define __SOFTFLOAT_H__
34
35#include <linux/config.h>
36
37/*
38-------------------------------------------------------------------------------
39The macro `FLOATX80' must be defined to enable the extended double-precision
40floating-point format `floatx80'. If this macro is not defined, the
41`floatx80' type will not be defined, and none of the functions that either
42input or output the `floatx80' type will be defined.
43-------------------------------------------------------------------------------
44*/
45#ifdef CONFIG_FPE_NWFPE_XP
46#define FLOATX80
47#endif
48
49/*
50-------------------------------------------------------------------------------
51Software IEC/IEEE floating-point types.
52-------------------------------------------------------------------------------
53*/
54typedef unsigned long int float32;
55typedef unsigned long long float64;
56typedef struct {
57 unsigned short high;
58 unsigned long long low;
59} floatx80;
60
61/*
62-------------------------------------------------------------------------------
63Software IEC/IEEE floating-point underflow tininess-detection mode.
64-------------------------------------------------------------------------------
65*/
66extern signed char float_detect_tininess;
67enum {
68 float_tininess_after_rounding = 0,
69 float_tininess_before_rounding = 1
70};
71
72/*
73-------------------------------------------------------------------------------
74Software IEC/IEEE floating-point rounding mode.
75-------------------------------------------------------------------------------
76*/
77extern signed char float_rounding_mode;
78enum {
79 float_round_nearest_even = 0,
80 float_round_to_zero = 1,
81 float_round_down = 2,
82 float_round_up = 3
83};
84
85/*
86-------------------------------------------------------------------------------
87Software IEC/IEEE floating-point exception flags.
88-------------------------------------------------------------------------------
89extern signed char float_exception_flags;
90enum {
91 float_flag_inexact = 1,
92 float_flag_underflow = 2,
93 float_flag_overflow = 4,
94 float_flag_divbyzero = 8,
95 float_flag_invalid = 16
96};
97
98ScottB: November 4, 1998
99Changed the enumeration to match the bit order in the FPA11.
100*/
101
102extern signed char float_exception_flags;
103enum {
104 float_flag_invalid = 1,
105 float_flag_divbyzero = 2,
106 float_flag_overflow = 4,
107 float_flag_underflow = 8,
108 float_flag_inexact = 16
109};
110
111/*
112-------------------------------------------------------------------------------
113Routine to raise any or all of the software IEC/IEEE floating-point
114exception flags.
115-------------------------------------------------------------------------------
116*/
117void float_raise( signed char );
118
119/*
120-------------------------------------------------------------------------------
121Software IEC/IEEE integer-to-floating-point conversion routines.
122-------------------------------------------------------------------------------
123*/
124float32 int32_to_float32( signed int );
125float64 int32_to_float64( signed int );
126#ifdef FLOATX80
127floatx80 int32_to_floatx80( signed int );
128#endif
129
130/*
131-------------------------------------------------------------------------------
132Software IEC/IEEE single-precision conversion routines.
133-------------------------------------------------------------------------------
134*/
135signed int float32_to_int32( float32 );
136signed int float32_to_int32_round_to_zero( float32 );
137float64 float32_to_float64( float32 );
138#ifdef FLOATX80
139floatx80 float32_to_floatx80( float32 );
140#endif
141
142/*
143-------------------------------------------------------------------------------
144Software IEC/IEEE single-precision operations.
145-------------------------------------------------------------------------------
146*/
147float32 float32_round_to_int( float32 );
148float32 float32_add( float32, float32 );
149float32 float32_sub( float32, float32 );
150float32 float32_mul( float32, float32 );
151float32 float32_div( float32, float32 );
152float32 float32_rem( float32, float32 );
153float32 float32_sqrt( float32 );
154char float32_eq( float32, float32 );
155char float32_le( float32, float32 );
156char float32_lt( float32, float32 );
157char float32_eq_signaling( float32, float32 );
158char float32_le_quiet( float32, float32 );
159char float32_lt_quiet( float32, float32 );
160char float32_is_signaling_nan( float32 );
161
162/*
163-------------------------------------------------------------------------------
164Software IEC/IEEE double-precision conversion routines.
165-------------------------------------------------------------------------------
166*/
167signed int float64_to_int32( float64 );
168signed int float64_to_int32_round_to_zero( float64 );
169float32 float64_to_float32( float64 );
170#ifdef FLOATX80
171floatx80 float64_to_floatx80( float64 );
172#endif
173
174/*
175-------------------------------------------------------------------------------
176Software IEC/IEEE double-precision operations.
177-------------------------------------------------------------------------------
178*/
179float64 float64_round_to_int( float64 );
180float64 float64_add( float64, float64 );
181float64 float64_sub( float64, float64 );
182float64 float64_mul( float64, float64 );
183float64 float64_div( float64, float64 );
184float64 float64_rem( float64, float64 );
185float64 float64_sqrt( float64 );
186char float64_eq( float64, float64 );
187char float64_le( float64, float64 );
188char float64_lt( float64, float64 );
189char float64_eq_signaling( float64, float64 );
190char float64_le_quiet( float64, float64 );
191char float64_lt_quiet( float64, float64 );
192char float64_is_signaling_nan( float64 );
193
194#ifdef FLOATX80
195
196/*
197-------------------------------------------------------------------------------
198Software IEC/IEEE extended double-precision conversion routines.
199-------------------------------------------------------------------------------
200*/
201signed int floatx80_to_int32( floatx80 );
202signed int floatx80_to_int32_round_to_zero( floatx80 );
203float32 floatx80_to_float32( floatx80 );
204float64 floatx80_to_float64( floatx80 );
205
206/*
207-------------------------------------------------------------------------------
208Software IEC/IEEE extended double-precision rounding precision. Valid
209values are 32, 64, and 80.
210-------------------------------------------------------------------------------
211*/
212extern signed char floatx80_rounding_precision;
213
214/*
215-------------------------------------------------------------------------------
216Software IEC/IEEE extended double-precision operations.
217-------------------------------------------------------------------------------
218*/
219floatx80 floatx80_round_to_int( floatx80 );
220floatx80 floatx80_add( floatx80, floatx80 );
221floatx80 floatx80_sub( floatx80, floatx80 );
222floatx80 floatx80_mul( floatx80, floatx80 );
223floatx80 floatx80_div( floatx80, floatx80 );
224floatx80 floatx80_rem( floatx80, floatx80 );
225floatx80 floatx80_sqrt( floatx80 );
226char floatx80_eq( floatx80, floatx80 );
227char floatx80_le( floatx80, floatx80 );
228char floatx80_lt( floatx80, floatx80 );
229char floatx80_eq_signaling( floatx80, floatx80 );
230char floatx80_le_quiet( floatx80, floatx80 );
231char floatx80_lt_quiet( floatx80, floatx80 );
232char floatx80_is_signaling_nan( floatx80 );
233
234#endif
235
236static inline flag extractFloat32Sign(float32 a)
237{
238 return a >> 31;
239}
240
241static inline flag float32_eq_nocheck(float32 a, float32 b)
242{
243 return (a == b) || ((bits32) ((a | b) << 1) == 0);
244}
245
246static inline flag float32_lt_nocheck(float32 a, float32 b)
247{
248 flag aSign, bSign;
249
250 aSign = extractFloat32Sign(a);
251 bSign = extractFloat32Sign(b);
252 if (aSign != bSign)
253 return aSign && ((bits32) ((a | b) << 1) != 0);
254 return (a != b) && (aSign ^ (a < b));
255}
256
257static inline flag extractFloat64Sign(float64 a)
258{
259 return a >> 63;
260}
261
262static inline flag float64_eq_nocheck(float64 a, float64 b)
263{
264 return (a == b) || ((bits64) ((a | b) << 1) == 0);
265}
266
267static inline flag float64_lt_nocheck(float64 a, float64 b)
268{
269 flag aSign, bSign;
270
271 aSign = extractFloat64Sign(a);
272 bSign = extractFloat64Sign(b);
273 if (aSign != bSign)
274 return aSign && ((bits64) ((a | b) << 1) != 0);
275 return (a != b) && (aSign ^ (a < b));
276}
277
278#endif
diff --git a/arch/arm/oprofile/Kconfig b/arch/arm/oprofile/Kconfig
new file mode 100644
index 000000000000..19d37730b664
--- /dev/null
+++ b/arch/arm/oprofile/Kconfig
@@ -0,0 +1,23 @@
1
2menu "Profiling support"
3 depends on EXPERIMENTAL
4
5config PROFILING
6 bool "Profiling support (EXPERIMENTAL)"
7 help
8 Say Y here to enable the extended profiling support mechanisms used
9 by profilers such as OProfile.
10
11
12config OPROFILE
13 tristate "OProfile system profiling (EXPERIMENTAL)"
14 depends on PROFILING
15 help
16 OProfile is a profiling system capable of profiling the
17 whole system, include the kernel, kernel modules, libraries,
18 and applications.
19
20 If unsure, say N.
21
22endmenu
23
diff --git a/arch/arm/oprofile/Makefile b/arch/arm/oprofile/Makefile
new file mode 100644
index 000000000000..ba1a6e9f2b28
--- /dev/null
+++ b/arch/arm/oprofile/Makefile
@@ -0,0 +1,11 @@
1obj-$(CONFIG_OPROFILE) += oprofile.o
2
3DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
4 oprof.o cpu_buffer.o buffer_sync.o \
5 event_buffer.o oprofile_files.o \
6 oprofilefs.o oprofile_stats.o \
7 timer_int.o )
8
9oprofile-y := $(DRIVER_OBJS) init.o
10oprofile-$(CONFIG_CPU_XSCALE) += common.o op_model_xscale.o
11
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
new file mode 100644
index 000000000000..e57dde882898
--- /dev/null
+++ b/arch/arm/oprofile/common.c
@@ -0,0 +1,156 @@
1/**
2 * @file common.c
3 *
4 * @remark Copyright 2004 Oprofile Authors
5 * @remark Read the file COPYING
6 *
7 * @author Zwane Mwaikambo
8 */
9
10#include <linux/init.h>
11#include <linux/oprofile.h>
12#include <linux/errno.h>
13#include <asm/semaphore.h>
14#include <linux/sysdev.h>
15
16#include "op_counter.h"
17#include "op_arm_model.h"
18
19static struct op_arm_model_spec *pmu_model;
20static int pmu_enabled;
21static struct semaphore pmu_sem;
22
23static int pmu_start(void);
24static int pmu_setup(void);
25static void pmu_stop(void);
26static int pmu_create_files(struct super_block *, struct dentry *);
27
28#ifdef CONFIG_PM
29static int pmu_suspend(struct sys_device *dev, pm_message_t state)
30{
31 if (pmu_enabled)
32 pmu_stop();
33 return 0;
34}
35
36static int pmu_resume(struct sys_device *dev)
37{
38 if (pmu_enabled)
39 pmu_start();
40 return 0;
41}
42
43static struct sysdev_class oprofile_sysclass = {
44 set_kset_name("oprofile"),
45 .resume = pmu_resume,
46 .suspend = pmu_suspend,
47};
48
49static struct sys_device device_oprofile = {
50 .id = 0,
51 .cls = &oprofile_sysclass,
52};
53
54static int __init init_driverfs(void)
55{
56 int ret;
57
58 if (!(ret = sysdev_class_register(&oprofile_sysclass)))
59 ret = sysdev_register(&device_oprofile);
60
61 return ret;
62}
63
64static void exit_driverfs(void)
65{
66 sysdev_unregister(&device_oprofile);
67 sysdev_class_unregister(&oprofile_sysclass);
68}
69#else
70#define init_driverfs() do { } while (0)
71#define exit_driverfs() do { } while (0)
72#endif /* CONFIG_PM */
73
74struct op_counter_config counter_config[OP_MAX_COUNTER];
75
76static int pmu_create_files(struct super_block *sb, struct dentry *root)
77{
78 unsigned int i;
79
80 for (i = 0; i < pmu_model->num_counters; i++) {
81 struct dentry *dir;
82 char buf[2];
83
84 snprintf(buf, sizeof buf, "%d", i);
85 dir = oprofilefs_mkdir(sb, root, buf);
86 oprofilefs_create_ulong(sb, dir, "enabled", &counter_config[i].enabled);
87 oprofilefs_create_ulong(sb, dir, "event", &counter_config[i].event);
88 oprofilefs_create_ulong(sb, dir, "count", &counter_config[i].count);
89 oprofilefs_create_ulong(sb, dir, "unit_mask", &counter_config[i].unit_mask);
90 oprofilefs_create_ulong(sb, dir, "kernel", &counter_config[i].kernel);
91 oprofilefs_create_ulong(sb, dir, "user", &counter_config[i].user);
92 }
93
94 return 0;
95}
96
97static int pmu_setup(void)
98{
99 int ret;
100
101 spin_lock(&oprofilefs_lock);
102 ret = pmu_model->setup_ctrs();
103 spin_unlock(&oprofilefs_lock);
104 return ret;
105}
106
107static int pmu_start(void)
108{
109 int ret = -EBUSY;
110
111 down(&pmu_sem);
112 if (!pmu_enabled) {
113 ret = pmu_model->start();
114 pmu_enabled = !ret;
115 }
116 up(&pmu_sem);
117 return ret;
118}
119
120static void pmu_stop(void)
121{
122 down(&pmu_sem);
123 if (pmu_enabled)
124 pmu_model->stop();
125 pmu_enabled = 0;
126 up(&pmu_sem);
127}
128
129int __init pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec)
130{
131 init_MUTEX(&pmu_sem);
132
133 if (spec->init() < 0)
134 return -ENODEV;
135
136 pmu_model = spec;
137 init_driverfs();
138 ops->create_files = pmu_create_files;
139 ops->setup = pmu_setup;
140 ops->shutdown = pmu_stop;
141 ops->start = pmu_start;
142 ops->stop = pmu_stop;
143 ops->cpu_type = pmu_model->name;
144 printk(KERN_INFO "oprofile: using %s PMU\n", spec->name);
145
146 return 0;
147}
148
149void pmu_exit(void)
150{
151 if (pmu_model) {
152 exit_driverfs();
153 pmu_model = NULL;
154 }
155}
156
diff --git a/arch/arm/oprofile/init.c b/arch/arm/oprofile/init.c
new file mode 100644
index 000000000000..cce3d3015eb7
--- /dev/null
+++ b/arch/arm/oprofile/init.c
@@ -0,0 +1,31 @@
1/**
2 * @file init.c
3 *
4 * @remark Copyright 2004 Oprofile Authors
5 * @remark Read the file COPYING
6 *
7 * @author Zwane Mwaikambo
8 */
9
10#include <linux/oprofile.h>
11#include <linux/init.h>
12#include <linux/errno.h>
13#include "op_arm_model.h"
14
15int __init oprofile_arch_init(struct oprofile_operations *ops)
16{
17 int ret = -ENODEV;
18
19#ifdef CONFIG_CPU_XSCALE
20 ret = pmu_init(ops, &op_xscale_spec);
21#endif
22
23 return ret;
24}
25
26void oprofile_arch_exit(void)
27{
28#ifdef CONFIG_CPU_XSCALE
29 pmu_exit();
30#endif
31}
diff --git a/arch/arm/oprofile/op_arm_model.h b/arch/arm/oprofile/op_arm_model.h
new file mode 100644
index 000000000000..2d4caf4781ad
--- /dev/null
+++ b/arch/arm/oprofile/op_arm_model.h
@@ -0,0 +1,29 @@
1/**
2 * @file op_arm_model.h
3 * interface to ARM machine specific operations
4 *
5 * @remark Copyright 2004 Oprofile Authors
6 * @remark Read the file COPYING
7 *
8 * @author Zwane Mwaikambo
9 */
10
11#ifndef OP_ARM_MODEL_H
12#define OP_ARM_MODEL_H
13
14struct op_arm_model_spec {
15 int (*init)(void);
16 unsigned int num_counters;
17 int (*setup_ctrs)(void);
18 int (*start)(void);
19 void (*stop)(void);
20 char *name;
21};
22
23#ifdef CONFIG_CPU_XSCALE
24extern struct op_arm_model_spec op_xscale_spec;
25#endif
26
27extern int __init pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec);
28extern void pmu_exit(void);
29#endif /* OP_ARM_MODEL_H */
diff --git a/arch/arm/oprofile/op_counter.h b/arch/arm/oprofile/op_counter.h
new file mode 100644
index 000000000000..153c1d467f24
--- /dev/null
+++ b/arch/arm/oprofile/op_counter.h
@@ -0,0 +1,29 @@
1/**
2 * @file op_counter.h
3 *
4 * @remark Copyright 2004 Oprofile Authors
5 * @remark Read the file COPYING
6 *
7 * @author Zwane Mwaikambo
8 */
9
10#ifndef OP_COUNTER_H
11#define OP_COUNTER_H
12
13#define OP_MAX_COUNTER 5
14
15/* Per performance monitor configuration as set via
16 * oprofilefs.
17 */
18struct op_counter_config {
19 unsigned long count;
20 unsigned long enabled;
21 unsigned long event;
22 unsigned long unit_mask;
23 unsigned long kernel;
24 unsigned long user;
25};
26
27extern struct op_counter_config counter_config[];
28
29#endif /* OP_COUNTER_H */
diff --git a/arch/arm/oprofile/op_model_xscale.c b/arch/arm/oprofile/op_model_xscale.c
new file mode 100644
index 000000000000..e0f0b320d76c
--- /dev/null
+++ b/arch/arm/oprofile/op_model_xscale.c
@@ -0,0 +1,443 @@
1/**
2 * @file op_model_xscale.c
3 * XScale Performance Monitor Driver
4 *
5 * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com>
6 * @remark Copyright 2000-2004 MontaVista Software Inc
7 * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com>
8 * @remark Copyright 2004 Intel Corporation
9 * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk>
10 * @remark Copyright 2004 OProfile Authors
11 *
12 * @remark Read the file COPYING
13 *
14 * @author Zwane Mwaikambo
15 */
16
17/* #define DEBUG */
18#include <linux/types.h>
19#include <linux/errno.h>
20#include <linux/sched.h>
21#include <linux/oprofile.h>
22#include <linux/interrupt.h>
23#include <asm/irq.h>
24#include <asm/system.h>
25
26#include "op_counter.h"
27#include "op_arm_model.h"
28
29#define PMU_ENABLE 0x001 /* Enable counters */
30#define PMN_RESET 0x002 /* Reset event counters */
31#define CCNT_RESET 0x004 /* Reset clock counter */
32#define PMU_RESET (CCNT_RESET | PMN_RESET)
33#define PMU_CNT64 0x008 /* Make CCNT count every 64th cycle */
34
35/* TODO do runtime detection */
36#ifdef CONFIG_ARCH_IOP310
37#define XSCALE_PMU_IRQ IRQ_XS80200_PMU
38#endif
39#ifdef CONFIG_ARCH_IOP321
40#define XSCALE_PMU_IRQ IRQ_IOP321_CORE_PMU
41#endif
42#ifdef CONFIG_ARCH_IOP331
43#define XSCALE_PMU_IRQ IRQ_IOP331_CORE_PMU
44#endif
45#ifdef CONFIG_ARCH_PXA
46#define XSCALE_PMU_IRQ IRQ_PMU
47#endif
48
49/*
50 * Different types of events that can be counted by the XScale PMU
51 * as used by Oprofile userspace. Here primarily for documentation
52 * purposes.
53 */
54
55#define EVT_ICACHE_MISS 0x00
56#define EVT_ICACHE_NO_DELIVER 0x01
57#define EVT_DATA_STALL 0x02
58#define EVT_ITLB_MISS 0x03
59#define EVT_DTLB_MISS 0x04
60#define EVT_BRANCH 0x05
61#define EVT_BRANCH_MISS 0x06
62#define EVT_INSTRUCTION 0x07
63#define EVT_DCACHE_FULL_STALL 0x08
64#define EVT_DCACHE_FULL_STALL_CONTIG 0x09
65#define EVT_DCACHE_ACCESS 0x0A
66#define EVT_DCACHE_MISS 0x0B
67#define EVT_DCACE_WRITE_BACK 0x0C
68#define EVT_PC_CHANGED 0x0D
69#define EVT_BCU_REQUEST 0x10
70#define EVT_BCU_FULL 0x11
71#define EVT_BCU_DRAIN 0x12
72#define EVT_BCU_ECC_NO_ELOG 0x14
73#define EVT_BCU_1_BIT_ERR 0x15
74#define EVT_RMW 0x16
75/* EVT_CCNT is not hardware defined */
76#define EVT_CCNT 0xFE
77#define EVT_UNUSED 0xFF
78
79struct pmu_counter {
80 volatile unsigned long ovf;
81 unsigned long reset_counter;
82};
83
84enum { CCNT, PMN0, PMN1, PMN2, PMN3, MAX_COUNTERS };
85
86static struct pmu_counter results[MAX_COUNTERS];
87
88/*
89 * There are two versions of the PMU in current XScale processors
90 * with differing register layouts and number of performance counters.
91 * e.g. IOP321 is xsc1 whilst IOP331 is xsc2.
92 * We detect which register layout to use in xscale_detect_pmu()
93 */
94enum { PMU_XSC1, PMU_XSC2 };
95
96struct pmu_type {
97 int id;
98 char *name;
99 int num_counters;
100 unsigned int int_enable;
101 unsigned int cnt_ovf[MAX_COUNTERS];
102 unsigned int int_mask[MAX_COUNTERS];
103};
104
105static struct pmu_type pmu_parms[] = {
106 {
107 .id = PMU_XSC1,
108 .name = "arm/xscale1",
109 .num_counters = 3,
110 .int_mask = { [PMN0] = 0x10, [PMN1] = 0x20,
111 [CCNT] = 0x40 },
112 .cnt_ovf = { [CCNT] = 0x400, [PMN0] = 0x100,
113 [PMN1] = 0x200},
114 },
115 {
116 .id = PMU_XSC2,
117 .name = "arm/xscale2",
118 .num_counters = 5,
119 .int_mask = { [CCNT] = 0x01, [PMN0] = 0x02,
120 [PMN1] = 0x04, [PMN2] = 0x08,
121 [PMN3] = 0x10 },
122 .cnt_ovf = { [CCNT] = 0x01, [PMN0] = 0x02,
123 [PMN1] = 0x04, [PMN2] = 0x08,
124 [PMN3] = 0x10 },
125 },
126};
127
128static struct pmu_type *pmu;
129
130static void write_pmnc(u32 val)
131{
132 if (pmu->id == PMU_XSC1) {
133 /* upper 4bits and 7, 11 are write-as-0 */
134 val &= 0xffff77f;
135 __asm__ __volatile__ ("mcr p14, 0, %0, c0, c0, 0" : : "r" (val));
136 } else {
137 /* bits 4-23 are write-as-0, 24-31 are write ignored */
138 val &= 0xf;
139 __asm__ __volatile__ ("mcr p14, 0, %0, c0, c1, 0" : : "r" (val));
140 }
141}
142
143static u32 read_pmnc(void)
144{
145 u32 val;
146
147 if (pmu->id == PMU_XSC1)
148 __asm__ __volatile__ ("mrc p14, 0, %0, c0, c0, 0" : "=r" (val));
149 else {
150 __asm__ __volatile__ ("mrc p14, 0, %0, c0, c1, 0" : "=r" (val));
151 /* bits 1-2 and 4-23 are read-unpredictable */
152 val &= 0xff000009;
153 }
154
155 return val;
156}
157
158static u32 __xsc1_read_counter(int counter)
159{
160 u32 val = 0;
161
162 switch (counter) {
163 case CCNT:
164 __asm__ __volatile__ ("mrc p14, 0, %0, c1, c0, 0" : "=r" (val));
165 break;
166 case PMN0:
167 __asm__ __volatile__ ("mrc p14, 0, %0, c2, c0, 0" : "=r" (val));
168 break;
169 case PMN1:
170 __asm__ __volatile__ ("mrc p14, 0, %0, c3, c0, 0" : "=r" (val));
171 break;
172 }
173 return val;
174}
175
176static u32 __xsc2_read_counter(int counter)
177{
178 u32 val = 0;
179
180 switch (counter) {
181 case CCNT:
182 __asm__ __volatile__ ("mrc p14, 0, %0, c1, c1, 0" : "=r" (val));
183 break;
184 case PMN0:
185 __asm__ __volatile__ ("mrc p14, 0, %0, c0, c2, 0" : "=r" (val));
186 break;
187 case PMN1:
188 __asm__ __volatile__ ("mrc p14, 0, %0, c1, c2, 0" : "=r" (val));
189 break;
190 case PMN2:
191 __asm__ __volatile__ ("mrc p14, 0, %0, c2, c2, 0" : "=r" (val));
192 break;
193 case PMN3:
194 __asm__ __volatile__ ("mrc p14, 0, %0, c3, c2, 0" : "=r" (val));
195 break;
196 }
197 return val;
198}
199
200static u32 read_counter(int counter)
201{
202 u32 val;
203
204 if (pmu->id == PMU_XSC1)
205 val = __xsc1_read_counter(counter);
206 else
207 val = __xsc2_read_counter(counter);
208
209 return val;
210}
211
212static void __xsc1_write_counter(int counter, u32 val)
213{
214 switch (counter) {
215 case CCNT:
216 __asm__ __volatile__ ("mcr p14, 0, %0, c1, c0, 0" : : "r" (val));
217 break;
218 case PMN0:
219 __asm__ __volatile__ ("mcr p14, 0, %0, c2, c0, 0" : : "r" (val));
220 break;
221 case PMN1:
222 __asm__ __volatile__ ("mcr p14, 0, %0, c3, c0, 0" : : "r" (val));
223 break;
224 }
225}
226
227static void __xsc2_write_counter(int counter, u32 val)
228{
229 switch (counter) {
230 case CCNT:
231 __asm__ __volatile__ ("mcr p14, 0, %0, c1, c1, 0" : : "r" (val));
232 break;
233 case PMN0:
234 __asm__ __volatile__ ("mcr p14, 0, %0, c0, c2, 0" : : "r" (val));
235 break;
236 case PMN1:
237 __asm__ __volatile__ ("mcr p14, 0, %0, c1, c2, 0" : : "r" (val));
238 break;
239 case PMN2:
240 __asm__ __volatile__ ("mcr p14, 0, %0, c2, c2, 0" : : "r" (val));
241 break;
242 case PMN3:
243 __asm__ __volatile__ ("mcr p14, 0, %0, c3, c2, 0" : : "r" (val));
244 break;
245 }
246}
247
248static void write_counter(int counter, u32 val)
249{
250 if (pmu->id == PMU_XSC1)
251 __xsc1_write_counter(counter, val);
252 else
253 __xsc2_write_counter(counter, val);
254}
255
256static int xscale_setup_ctrs(void)
257{
258 u32 evtsel, pmnc;
259 int i;
260
261 for (i = CCNT; i < MAX_COUNTERS; i++) {
262 if (counter_config[i].enabled)
263 continue;
264
265 counter_config[i].event = EVT_UNUSED;
266 }
267
268 switch (pmu->id) {
269 case PMU_XSC1:
270 pmnc = (counter_config[PMN1].event << 20) | (counter_config[PMN0].event << 12);
271 pr_debug("xscale_setup_ctrs: pmnc: %#08x\n", pmnc);
272 write_pmnc(pmnc);
273 break;
274
275 case PMU_XSC2:
276 evtsel = counter_config[PMN0].event | (counter_config[PMN1].event << 8) |
277 (counter_config[PMN2].event << 16) | (counter_config[PMN3].event << 24);
278
279 pr_debug("xscale_setup_ctrs: evtsel %#08x\n", evtsel);
280 __asm__ __volatile__ ("mcr p14, 0, %0, c8, c1, 0" : : "r" (evtsel));
281 break;
282 }
283
284 for (i = CCNT; i < MAX_COUNTERS; i++) {
285 if (counter_config[i].event == EVT_UNUSED) {
286 counter_config[i].event = 0;
287 pmu->int_enable &= ~pmu->int_mask[i];
288 continue;
289 }
290
291 results[i].reset_counter = counter_config[i].count;
292 write_counter(i, -(u32)counter_config[i].count);
293 pmu->int_enable |= pmu->int_mask[i];
294 pr_debug("xscale_setup_ctrs: counter%d %#08x from %#08lx\n", i,
295 read_counter(i), counter_config[i].count);
296 }
297
298 return 0;
299}
300
301static void inline __xsc1_check_ctrs(void)
302{
303 int i;
304 u32 pmnc = read_pmnc();
305
306 /* NOTE: there's an A stepping errata that states if an overflow */
307 /* bit already exists and another occurs, the previous */
308 /* Overflow bit gets cleared. There's no workaround. */
309 /* Fixed in B stepping or later */
310
311 /* Write the value back to clear the overflow flags. Overflow */
312 /* flags remain in pmnc for use below */
313 write_pmnc(pmnc & ~PMU_ENABLE);
314
315 for (i = CCNT; i <= PMN1; i++) {
316 if (!(pmu->int_mask[i] & pmu->int_enable))
317 continue;
318
319 if (pmnc & pmu->cnt_ovf[i])
320 results[i].ovf++;
321 }
322}
323
324static void inline __xsc2_check_ctrs(void)
325{
326 int i;
327 u32 flag = 0, pmnc = read_pmnc();
328
329 pmnc &= ~PMU_ENABLE;
330 write_pmnc(pmnc);
331
332 /* read overflow flag register */
333 __asm__ __volatile__ ("mrc p14, 0, %0, c5, c1, 0" : "=r" (flag));
334
335 for (i = CCNT; i <= PMN3; i++) {
336 if (!(pmu->int_mask[i] & pmu->int_enable))
337 continue;
338
339 if (flag & pmu->cnt_ovf[i])
340 results[i].ovf++;
341 }
342
343 /* writeback clears overflow bits */
344 __asm__ __volatile__ ("mcr p14, 0, %0, c5, c1, 0" : : "r" (flag));
345}
346
347static irqreturn_t xscale_pmu_interrupt(int irq, void *arg, struct pt_regs *regs)
348{
349 int i;
350 u32 pmnc;
351
352 if (pmu->id == PMU_XSC1)
353 __xsc1_check_ctrs();
354 else
355 __xsc2_check_ctrs();
356
357 for (i = CCNT; i < MAX_COUNTERS; i++) {
358 if (!results[i].ovf)
359 continue;
360
361 write_counter(i, -(u32)results[i].reset_counter);
362 oprofile_add_sample(regs, i);
363 results[i].ovf--;
364 }
365
366 pmnc = read_pmnc() | PMU_ENABLE;
367 write_pmnc(pmnc);
368
369 return IRQ_HANDLED;
370}
371
372static void xscale_pmu_stop(void)
373{
374 u32 pmnc = read_pmnc();
375
376 pmnc &= ~PMU_ENABLE;
377 write_pmnc(pmnc);
378
379 free_irq(XSCALE_PMU_IRQ, results);
380}
381
382static int xscale_pmu_start(void)
383{
384 int ret;
385 u32 pmnc = read_pmnc();
386
387 ret = request_irq(XSCALE_PMU_IRQ, xscale_pmu_interrupt, SA_INTERRUPT,
388 "XScale PMU", (void *)results);
389
390 if (ret < 0) {
391 printk(KERN_ERR "oprofile: unable to request IRQ%d for XScale PMU\n",
392 XSCALE_PMU_IRQ);
393 return ret;
394 }
395
396 if (pmu->id == PMU_XSC1)
397 pmnc |= pmu->int_enable;
398 else {
399 __asm__ __volatile__ ("mcr p14, 0, %0, c4, c1, 0" : : "r" (pmu->int_enable));
400 pmnc &= ~PMU_CNT64;
401 }
402
403 pmnc |= PMU_ENABLE;
404 write_pmnc(pmnc);
405 pr_debug("xscale_pmu_start: pmnc: %#08x mask: %08x\n", pmnc, pmu->int_enable);
406 return 0;
407}
408
409static int xscale_detect_pmu(void)
410{
411 int ret = 0;
412 u32 id;
413
414 id = (read_cpuid(CPUID_ID) >> 13) & 0x7;
415
416 switch (id) {
417 case 1:
418 pmu = &pmu_parms[PMU_XSC1];
419 break;
420 case 2:
421 pmu = &pmu_parms[PMU_XSC2];
422 break;
423 default:
424 ret = -ENODEV;
425 break;
426 }
427
428 if (!ret) {
429 op_xscale_spec.name = pmu->name;
430 op_xscale_spec.num_counters = pmu->num_counters;
431 pr_debug("xscale_detect_pmu: detected %s PMU\n", pmu->name);
432 }
433
434 return ret;
435}
436
437struct op_arm_model_spec op_xscale_spec = {
438 .init = xscale_detect_pmu,
439 .setup_ctrs = xscale_setup_ctrs,
440 .start = xscale_pmu_start,
441 .stop = xscale_pmu_stop,
442};
443
diff --git a/arch/arm/tools/Makefile b/arch/arm/tools/Makefile
new file mode 100644
index 000000000000..c2a4993a724c
--- /dev/null
+++ b/arch/arm/tools/Makefile
@@ -0,0 +1,9 @@
1#
2# linux/arch/arm/tools/Makefile
3#
4# Copyright (C) 2001 Russell King
5#
6
7include/asm-arm/mach-types.h: $(src)/gen-mach-types $(src)/mach-types
8 @echo ' Generating $@'
9 $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
diff --git a/arch/arm/tools/gen-mach-types b/arch/arm/tools/gen-mach-types
new file mode 100644
index 000000000000..2f9c9b5dd260
--- /dev/null
+++ b/arch/arm/tools/gen-mach-types
@@ -0,0 +1,73 @@
1#!/bin/awk
2#
3# Awk script to generate include/asm-arm/mach-types.h
4#
5BEGIN { nr = 0 }
6/^#/ { next }
7/^[ ]*$/ { next }
8
9NF == 4 {
10 machine_is[nr] = "machine_is_"$1;
11 config[nr] = "CONFIG_"$2;
12 mach_type[nr] = "MACH_TYPE_"$3;
13 num[nr] = $4; nr++
14 }
15
16NF == 3 {
17 machine_is[nr] = "machine_is_"$1;
18 config[nr] = "CONFIG_"$2;
19 mach_type[nr] = "MACH_TYPE_"$3;
20 num[nr] = ""; nr++
21 }
22
23
24END {
25 printf("/*\n");
26 printf(" * This was automagically generated from %s!\n", FILENAME);
27 printf(" * Do NOT edit\n");
28 printf(" */\n\n");
29 printf("#ifndef __ASM_ARM_MACH_TYPE_H\n");
30 printf("#define __ASM_ARM_MACH_TYPE_H\n\n");
31 printf("#include <linux/config.h>\n\n");
32 printf("#ifndef __ASSEMBLY__\n");
33 printf("/* The type of machine we're running on */\n");
34 printf("extern unsigned int __machine_arch_type;\n");
35 printf("#endif\n\n");
36
37 printf("/* see arch/arm/kernel/arch.c for a description of these */\n");
38 for (i = 0; i < nr; i++)
39 if (num[i] ~ /..*/)
40 printf("#define %-30s %d\n", mach_type[i], num[i]);
41
42 printf("\n");
43
44 for (i = 0; i < nr; i++)
45 if (num[i] ~ /..*/) {
46 printf("#ifdef %s\n", config[i]);
47 printf("# ifdef machine_arch_type\n");
48 printf("# undef machine_arch_type\n");
49 printf("# define machine_arch_type\t__machine_arch_type\n");
50 printf("# else\n");
51 printf("# define machine_arch_type\t%s\n", mach_type[i]);
52 printf("# endif\n");
53 printf("# define %s()\t(machine_arch_type == %s)\n", machine_is[i], mach_type[i]);
54 printf("#else\n");
55 printf("# define %s()\t(0)\n", machine_is[i]);
56 printf("#endif\n\n");
57 }
58
59 printf("/*\n * These have not yet been registered\n */\n");
60 for (i = 0; i < nr; i++)
61 if (num[i] !~ /..*/)
62 printf("/* #define %-30s <<not registered>> */\n", mach_type[i]);
63
64 for (i = 0; i < nr; i++)
65 if (num[i] !~ /..*/) {
66 printf("#define %s()\t(0)\n", machine_is[i]);
67 }
68
69 printf("\n#ifndef machine_arch_type\n");
70 printf("#define machine_arch_type\t__machine_arch_type\n");
71 printf("#endif\n\n");
72 printf("#endif\n");
73 }
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
new file mode 100644
index 000000000000..30c1dfbb052f
--- /dev/null
+++ b/arch/arm/tools/mach-types
@@ -0,0 +1,726 @@
1# Database of machine macros and numbers
2#
3# This file is linux/arch/arm/tools/mach-types
4#
5# Please do not send patches to this file; it is automatically generated!
6# To add an entry into this database, please see Documentation/arm/README,
7# or contact rmk@arm.linux.org.uk
8#
9# Last update: Thu Mar 24 14:34:50 2005
10#
11# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
12#
13ebsa110 ARCH_EBSA110 EBSA110 0
14riscpc ARCH_RPC RISCPC 1
15nexuspci ARCH_NEXUSPCI NEXUSPCI 3
16ebsa285 ARCH_EBSA285 EBSA285 4
17netwinder ARCH_NETWINDER NETWINDER 5
18cats ARCH_CATS CATS 6
19tbox ARCH_TBOX TBOX 7
20co285 ARCH_CO285 CO285 8
21clps7110 ARCH_CLPS7110 CLPS7110 9
22archimedes ARCH_ARC ARCHIMEDES 10
23a5k ARCH_A5K A5K 11
24etoile ARCH_ETOILE ETOILE 12
25lacie_nas ARCH_LACIE_NAS LACIE_NAS 13
26clps7500 ARCH_CLPS7500 CLPS7500 14
27shark ARCH_SHARK SHARK 15
28brutus SA1100_BRUTUS BRUTUS 16
29personal_server ARCH_PERSONAL_SERVER PERSONAL_SERVER 17
30itsy SA1100_ITSY ITSY 18
31l7200 ARCH_L7200 L7200 19
32pleb SA1100_PLEB PLEB 20
33integrator ARCH_INTEGRATOR INTEGRATOR 21
34h3600 SA1100_H3600 H3600 22
35ixp1200 ARCH_IXP1200 IXP1200 23
36p720t ARCH_P720T P720T 24
37assabet SA1100_ASSABET ASSABET 25
38victor SA1100_VICTOR VICTOR 26
39lart SA1100_LART LART 27
40ranger SA1100_RANGER RANGER 28
41graphicsclient SA1100_GRAPHICSCLIENT GRAPHICSCLIENT 29
42xp860 SA1100_XP860 XP860 30
43cerf SA1100_CERF CERF 31
44nanoengine SA1100_NANOENGINE NANOENGINE 32
45fpic SA1100_FPIC FPIC 33
46extenex1 SA1100_EXTENEX1 EXTENEX1 34
47sherman SA1100_SHERMAN SHERMAN 35
48accelent_sa SA1100_ACCELENT ACCELENT_SA 36
49accelent_l7200 ARCH_L7200_ACCELENT ACCELENT_L7200 37
50netport SA1100_NETPORT NETPORT 38
51pangolin SA1100_PANGOLIN PANGOLIN 39
52yopy SA1100_YOPY YOPY 40
53coolidge SA1100_COOLIDGE COOLIDGE 41
54huw_webpanel SA1100_HUW_WEBPANEL HUW_WEBPANEL 42
55spotme ARCH_SPOTME SPOTME 43
56freebird ARCH_FREEBIRD FREEBIRD 44
57ti925 ARCH_TI925 TI925 45
58riscstation ARCH_RISCSTATION RISCSTATION 46
59cavy SA1100_CAVY CAVY 47
60jornada720 SA1100_JORNADA720 JORNADA720 48
61omnimeter SA1100_OMNIMETER OMNIMETER 49
62edb7211 ARCH_EDB7211 EDB7211 50
63citygo SA1100_CITYGO CITYGO 51
64pfs168 SA1100_PFS168 PFS168 52
65spot SA1100_SPOT SPOT 53
66flexanet SA1100_FLEXANET FLEXANET 54
67webpal ARCH_WEBPAL WEBPAL 55
68linpda SA1100_LINPDA LINPDA 56
69anakin ARCH_ANAKIN ANAKIN 57
70mvi SA1100_MVI MVI 58
71jupiter SA1100_JUPITER JUPITER 59
72psionw ARCH_PSIONW PSIONW 60
73aln SA1100_ALN ALN 61
74epxa ARCH_CAMELOT CAMELOT 62
75gds2200 SA1100_GDS2200 GDS2200 63
76psion_series7 SA1100_PSION_SERIES7 PSION_SERIES7 64
77xfile SA1100_XFILE XFILE 65
78accelent_ep9312 ARCH_ACCELENT_EP9312 ACCELENT_EP9312 66
79ic200 ARCH_IC200 IC200 67
80creditlart SA1100_CREDITLART CREDITLART 68
81htm SA1100_HTM HTM 69
82iq80310 ARCH_IQ80310 IQ80310 70
83freebot SA1100_FREEBOT FREEBOT 71
84entel ARCH_ENTEL ENTEL 72
85enp3510 ARCH_ENP3510 ENP3510 73
86trizeps SA1100_TRIZEPS TRIZEPS 74
87nesa SA1100_NESA NESA 75
88venus ARCH_VENUS VENUS 76
89tardis ARCH_TARDIS TARDIS 77
90mercury ARCH_MERCURY MERCURY 78
91empeg SA1100_EMPEG EMPEG 79
92adi_evb ARCH_I80200FCC I80200FCC 80
93itt_cpb SA1100_ITT_CPB ITT_CPB 81
94svc SA1100_SVC SVC 82
95alpha2 SA1100_ALPHA2 ALPHA2 84
96alpha1 SA1100_ALPHA1 ALPHA1 85
97netarm ARCH_NETARM NETARM 86
98simpad SA1100_SIMPAD SIMPAD 87
99pda1 ARCH_PDA1 PDA1 88
100lubbock ARCH_LUBBOCK LUBBOCK 89
101aniko ARCH_ANIKO ANIKO 90
102clep7212 ARCH_CLEP7212 CLEP7212 91
103cs89712 ARCH_CS89712 CS89712 92
104weararm SA1100_WEARARM WEARARM 93
105possio_px SA1100_POSSIO_PX POSSIO_PX 94
106sidearm SA1100_SIDEARM SIDEARM 95
107stork SA1100_STORK STORK 96
108shannon SA1100_SHANNON SHANNON 97
109ace ARCH_ACE ACE 98
110ballyarm SA1100_BALLYARM BALLYARM 99
111simputer SA1100_SIMPUTER SIMPUTER 100
112nexterm SA1100_NEXTERM NEXTERM 101
113sa1100_elf SA1100_SA1100_ELF SA1100_ELF 102
114gator SA1100_GATOR GATOR 103
115granite ARCH_GRANITE GRANITE 104
116consus SA1100_CONSUS CONSUS 105
117aaed2000 ARCH_AAED2000 AAED2000 106
118cdb89712 ARCH_CDB89712 CDB89712 107
119graphicsmaster SA1100_GRAPHICSMASTER GRAPHICSMASTER 108
120adsbitsy SA1100_ADSBITSY ADSBITSY 109
121pxa_idp ARCH_PXA_IDP PXA_IDP 110
122plce ARCH_PLCE PLCE 111
123pt_system3 SA1100_PT_SYSTEM3 PT_SYSTEM3 112
124murphy ARCH_MEDALB MEDALB 113
125eagle ARCH_EAGLE EAGLE 114
126dsc21 ARCH_DSC21 DSC21 115
127dsc24 ARCH_DSC24 DSC24 116
128ti5472 ARCH_TI5472 TI5472 117
129autcpu12 ARCH_AUTCPU12 AUTCPU12 118
130uengine ARCH_UENGINE UENGINE 119
131bluestem SA1100_BLUESTEM BLUESTEM 120
132xingu8 ARCH_XINGU8 XINGU8 121
133bushstb ARCH_BUSHSTB BUSHSTB 122
134epsilon1 SA1100_EPSILON1 EPSILON1 123
135balloon SA1100_BALLOON BALLOON 124
136puppy ARCH_PUPPY PUPPY 125
137elroy SA1100_ELROY ELROY 126
138gms720 ARCH_GMS720 GMS720 127
139s24x ARCH_S24X S24X 128
140jtel_clep7312 ARCH_JTEL_CLEP7312 JTEL_CLEP7312 129
141cx821xx ARCH_CX821XX CX821XX 130
142edb7312 ARCH_EDB7312 EDB7312 131
143bsa1110 SA1100_BSA1110 BSA1110 132
144powerpin ARCH_POWERPIN POWERPIN 133
145openarm ARCH_OPENARM OPENARM 134
146whitechapel SA1100_WHITECHAPEL WHITECHAPEL 135
147h3100 SA1100_H3100 H3100 136
148h3800 SA1100_H3800 H3800 137
149blue_v1 ARCH_BLUE_V1 BLUE_V1 138
150pxa_cerf ARCH_PXA_CERF PXA_CERF 139
151arm7tevb ARCH_ARM7TEVB ARM7TEVB 140
152d7400 SA1100_D7400 D7400 141
153piranha ARCH_PIRANHA PIRANHA 142
154sbcamelot SA1100_SBCAMELOT SBCAMELOT 143
155kings SA1100_KINGS KINGS 144
156smdk2400 ARCH_SMDK2400 SMDK2400 145
157collie SA1100_COLLIE COLLIE 146
158idr ARCH_IDR IDR 147
159badge4 SA1100_BADGE4 BADGE4 148
160webnet ARCH_WEBNET WEBNET 149
161d7300 SA1100_D7300 D7300 150
162cep SA1100_CEP CEP 151
163fortunet ARCH_FORTUNET FORTUNET 152
164vc547x ARCH_VC547X VC547X 153
165filewalker SA1100_FILEWALKER FILEWALKER 154
166netgateway SA1100_NETGATEWAY NETGATEWAY 155
167symbol2800 SA1100_SYMBOL2800 SYMBOL2800 156
168suns SA1100_SUNS SUNS 157
169frodo SA1100_FRODO FRODO 158
170ms301 SA1100_MACH_TYTE_MS301 MACH_TYTE_MS301 159
171mx1ads ARCH_MX1ADS MX1ADS 160
172h7201 ARCH_H7201 H7201 161
173h7202 ARCH_H7202 H7202 162
174amico ARCH_AMICO AMICO 163
175iam SA1100_IAM IAM 164
176tt530 SA1100_TT530 TT530 165
177sam2400 ARCH_SAM2400 SAM2400 166
178jornada56x SA1100_JORNADA56X JORNADA56X 167
179active SA1100_ACTIVE ACTIVE 168
180iq80321 ARCH_IQ80321 IQ80321 169
181wid SA1100_WID WID 170
182sabinal ARCH_SABINAL SABINAL 171
183ixp425_matacumbe ARCH_IXP425_MATACUMBE IXP425_MATACUMBE 172
184miniprint SA1100_MINIPRINT MINIPRINT 173
185adm510x ARCH_ADM510X ADM510X 174
186svs200 SA1100_SVS200 SVS200 175
187atg_tcu ARCH_ATG_TCU ATG_TCU 176
188jornada820 SA1100_JORNADA820 JORNADA820 177
189s3c44b0 ARCH_S3C44B0 S3C44B0 178
190margis2 ARCH_MARGIS2 MARGIS2 179
191ks8695 ARCH_KS8695 KS8695 180
192brh ARCH_BRH BRH 181
193s3c2410 ARCH_S3C2410 S3C2410 182
194possio_px30 ARCH_POSSIO_PX30 POSSIO_PX30 183
195s3c2800 ARCH_S3C2800 S3C2800 184
196fleetwood SA1100_FLEETWOOD FLEETWOOD 185
197omaha ARCH_OMAHA OMAHA 186
198ta7 ARCH_TA7 TA7 187
199nova SA1100_NOVA NOVA 188
200hmk ARCH_HMK HMK 189
201karo ARCH_KARO KARO 190
202fester SA1100_FESTER FESTER 191
203gpi ARCH_GPI GPI 192
204smdk2410 ARCH_SMDK2410 SMDK2410 193
205i519 ARCH_I519 I519 194
206nexio SA1100_NEXIO NEXIO 195
207bitbox SA1100_BITBOX BITBOX 196
208g200 SA1100_G200 G200 197
209gill SA1100_GILL GILL 198
210pxa_mercury ARCH_PXA_MERCURY PXA_MERCURY 199
211ceiva ARCH_CEIVA CEIVA 200
212fret SA1100_FRET FRET 201
213emailphone SA1100_EMAILPHONE EMAILPHONE 202
214h3900 ARCH_H3900 H3900 203
215pxa1 ARCH_PXA1 PXA1 204
216koan369 SA1100_KOAN369 KOAN369 205
217cogent ARCH_COGENT COGENT 206
218esl_simputer ARCH_ESL_SIMPUTER ESL_SIMPUTER 207
219esl_simputer_clr ARCH_ESL_SIMPUTER_CLR ESL_SIMPUTER_CLR 208
220esl_simputer_bw ARCH_ESL_SIMPUTER_BW ESL_SIMPUTER_BW 209
221hhp_cradle ARCH_HHP_CRADLE HHP_CRADLE 210
222he500 ARCH_HE500 HE500 211
223inhandelf2 SA1100_INHANDELF2 INHANDELF2 212
224inhandftip SA1100_INHANDFTIP INHANDFTIP 213
225dnp1110 SA1100_DNP1110 DNP1110 214
226pnp1110 SA1100_PNP1110 PNP1110 215
227csb226 ARCH_CSB226 CSB226 216
228arnold SA1100_ARNOLD ARNOLD 217
229voiceblue MACH_VOICEBLUE VOICEBLUE 218
230jz8028 ARCH_JZ8028 JZ8028 219
231h5400 ARCH_H5400 H5400 220
232forte SA1100_FORTE FORTE 221
233acam SA1100_ACAM ACAM 222
234abox SA1100_ABOX ABOX 223
235atmel ARCH_ATMEL ATMEL 224
236sitsang ARCH_SITSANG SITSANG 225
237cpu1110lcdnet SA1100_CPU1110LCDNET CPU1110LCDNET 226
238mpl_vcma9 ARCH_MPL_VCMA9 MPL_VCMA9 227
239opus_a1 ARCH_OPUS_A1 OPUS_A1 228
240daytona ARCH_DAYTONA DAYTONA 229
241killbear SA1100_KILLBEAR KILLBEAR 230
242yoho ARCH_YOHO YOHO 231
243jasper ARCH_JASPER JASPER 232
244dsc25 ARCH_DSC25 DSC25 233
245omap_innovator MACH_OMAP_INNOVATOR OMAP_INNOVATOR 234
246ramses ARCH_RAMSES RAMSES 235
247s28x ARCH_S28X S28X 236
248mport3 ARCH_MPORT3 MPORT3 237
249pxa_eagle250 ARCH_PXA_EAGLE250 PXA_EAGLE250 238
250pdb ARCH_PDB PDB 239
251blue_2g SA1100_BLUE_2G BLUE_2G 240
252bluearch SA1100_BLUEARCH BLUEARCH 241
253ixdp2400 ARCH_IXDP2400 IXDP2400 242
254ixdp2800 ARCH_IXDP2800 IXDP2800 243
255explorer SA1100_EXPLORER EXPLORER 244
256ixdp425 ARCH_IXDP425 IXDP425 245
257chimp ARCH_CHIMP CHIMP 246
258stork_nest ARCH_STORK_NEST STORK_NEST 247
259stork_egg ARCH_STORK_EGG STORK_EGG 248
260wismo SA1100_WISMO WISMO 249
261ezlinx ARCH_EZLINX EZLINX 250
262at91rm9200 ARCH_AT91RM9200 AT91RM9200 251
263orion ARCH_ORION ORION 252
264neptune ARCH_NEPTUNE NEPTUNE 253
265hackkit SA1100_HACKKIT HACKKIT 254
266pxa_wins30 ARCH_PXA_WINS30 PXA_WINS30 255
267lavinna SA1100_LAVINNA LAVINNA 256
268pxa_uengine ARCH_PXA_UENGINE PXA_UENGINE 257
269innokom ARCH_INNOKOM INNOKOM 258
270bms ARCH_BMS BMS 259
271ixcdp1100 ARCH_IXCDP1100 IXCDP1100 260
272prpmc1100 ARCH_PRPMC1100 PRPMC1100 261
273at91rm9200dk ARCH_AT91RM9200DK AT91RM9200DK 262
274armstick ARCH_ARMSTICK ARMSTICK 263
275armonie ARCH_ARMONIE ARMONIE 264
276mport1 ARCH_MPORT1 MPORT1 265
277s3c5410 ARCH_S3C5410 S3C5410 266
278zcp320a ARCH_ZCP320A ZCP320A 267
279i_box ARCH_I_BOX I_BOX 268
280stlc1502 ARCH_STLC1502 STLC1502 269
281siren ARCH_SIREN SIREN 270
282greenlake ARCH_GREENLAKE GREENLAKE 271
283argus ARCH_ARGUS ARGUS 272
284combadge SA1100_COMBADGE COMBADGE 273
285rokepxa ARCH_ROKEPXA ROKEPXA 274
286cintegrator ARCH_CINTEGRATOR CINTEGRATOR 275
287guidea07 ARCH_GUIDEA07 GUIDEA07 276
288tat257 ARCH_TAT257 TAT257 277
289igp2425 ARCH_IGP2425 IGP2425 278
290bluegrama ARCH_BLUEGRAMMA BLUEGRAMMA 279
291ipod ARCH_IPOD IPOD 280
292adsbitsyx ARCH_ADSBITSYX ADSBITSYX 281
293trizeps2 ARCH_TRIZEPS2 TRIZEPS2 282
294viper ARCH_VIPER VIPER 283
295adsbitsyplus SA1100_ADSBITSYPLUS ADSBITSYPLUS 284
296adsagc SA1100_ADSAGC ADSAGC 285
297stp7312 ARCH_STP7312 STP7312 286
298nx_phnx MACH_NX_PHNX NX_PHNX 287
299wep_ep250 ARCH_WEP_EP250 WEP_EP250 288
300inhandelf3 ARCH_INHANDELF3 INHANDELF3 289
301adi_coyote ARCH_ADI_COYOTE ADI_COYOTE 290
302iyonix ARCH_IYONIX IYONIX 291
303damicam1 ARCH_DAMICAM_SA1110 DAMICAM_SA1110 292
304meg03 ARCH_MEG03 MEG03 293
305pxa_whitechapel ARCH_PXA_WHITECHAPEL PXA_WHITECHAPEL 294
306nwsc ARCH_NWSC NWSC 295
307nwlarm ARCH_NWLARM NWLARM 296
308ixp425_mguard ARCH_IXP425_MGUARD IXP425_MGUARD 297
309pxa_netdcu4 ARCH_PXA_NETDCU4 PXA_NETDCU4 298
310ixdp2401 ARCH_IXDP2401 IXDP2401 299
311ixdp2801 ARCH_IXDP2801 IXDP2801 300
312zodiac ARCH_ZODIAC ZODIAC 301
313armmodul ARCH_ARMMODUL ARMMODUL 302
314ketop SA1100_KETOP KETOP 303
315av7200 ARCH_AV7200 AV7200 304
316arch_ti925 ARCH_ARCH_TI925 ARCH_TI925 305
317acq200 ARCH_ACQ200 ACQ200 306
318pt_dafit SA1100_PT_DAFIT PT_DAFIT 307
319ihba ARCH_IHBA IHBA 308
320quinque ARCH_QUINQUE QUINQUE 309
321nimbraone ARCH_NIMBRAONE NIMBRAONE 310
322nimbra29x ARCH_NIMBRA29X NIMBRA29X 311
323nimbra210 ARCH_NIMBRA210 NIMBRA210 312
324hhp_d95xx ARCH_HHP_D95XX HHP_D95XX 313
325labarm ARCH_LABARM LABARM 314
326m825xx ARCH_M825XX M825XX 315
327m7100 SA1100_M7100 M7100 316
328nipc2 ARCH_NIPC2 NIPC2 317
329fu7202 ARCH_FU7202 FU7202 318
330adsagx ARCH_ADSAGX ADSAGX 319
331pxa_pooh ARCH_PXA_POOH PXA_POOH 320
332bandon ARCH_BANDON BANDON 321
333pcm7210 ARCH_PCM7210 PCM7210 322
334nms9200 ARCH_NMS9200 NMS9200 323
335logodl ARCH_LOGODL LOGODL 324
336m7140 SA1100_M7140 M7140 325
337korebot ARCH_KOREBOT KOREBOT 326
338iq31244 ARCH_IQ31244 IQ31244 327
339koan393 SA1100_KOAN393 KOAN393 328
340inhandftip3 ARCH_INHANDFTIP3 INHANDFTIP3 329
341gonzo ARCH_GONZO GONZO 330
342bast ARCH_BAST BAST 331
343scanpass ARCH_SCANPASS SCANPASS 332
344ep7312_pooh ARCH_EP7312_POOH EP7312_POOH 333
345ta7s ARCH_TA7S TA7S 334
346ta7v ARCH_TA7V TA7V 335
347icarus SA1100_ICARUS ICARUS 336
348h1900 ARCH_H1900 H1900 337
349gemini SA1100_GEMINI GEMINI 338
350axim ARCH_AXIM AXIM 339
351audiotron ARCH_AUDIOTRON AUDIOTRON 340
352h2200 ARCH_H2200 H2200 341
353loox600 ARCH_LOOX600 LOOX600 342
354niop ARCH_NIOP NIOP 343
355dm310 ARCH_DM310 DM310 344
356seedpxa_c2 ARCH_SEEDPXA_C2 SEEDPXA_C2 345
357ixp4xx_mguardpci ARCH_IXP4XX_MGUARD_PCI IXP4XX_MGUARD_PCI 346
358h1940 ARCH_H1940 H1940 347
359scorpio ARCH_SCORPIO SCORPIO 348
360viva ARCH_VIVA VIVA 349
361pxa_xcard ARCH_PXA_XCARD PXA_XCARD 350
362csb335 ARCH_CSB335 CSB335 351
363ixrd425 ARCH_IXRD425 IXRD425 352
364iq80315 ARCH_IQ80315 IQ80315 353
365nmp7312 ARCH_NMP7312 NMP7312 354
366cx861xx ARCH_CX861XX CX861XX 355
367enp2611 ARCH_ENP2611 ENP2611 356
368xda SA1100_XDA XDA 357
369csir_ims ARCH_CSIR_IMS CSIR_IMS 358
370ixp421_dnaeeth ARCH_IXP421_DNAEETH IXP421_DNAEETH 359
371pocketserv9200 ARCH_POCKETSERV9200 POCKETSERV9200 360
372toto ARCH_TOTO TOTO 361
373s3c2440 ARCH_S3C2440 S3C2440 362
374ks8695p ARCH_KS8695P KS8695P 363
375se4000 ARCH_SE4000 SE4000 364
376quadriceps ARCH_QUADRICEPS QUADRICEPS 365
377bronco ARCH_BRONCO BRONCO 366
378esl_wireless_tab ARCH_ESL_WIRELESS_TABLETESL_WIRELESS_TABLET 367
379esl_sofcomp ARCH_ESL_SOFCOMP ESL_SOFCOMP 368
380s5c7375 ARCH_S5C7375 S5C7375 369
381spearhead ARCH_SPEARHEAD SPEARHEAD 370
382pantera ARCH_PANTERA PANTERA 371
383prayoglite ARCH_PRAYOGLITE PRAYOGLITE 372
384gumstix ARCH_GUMSTIK GUMSTIK 373
385rcube ARCH_RCUBE RCUBE 374
386rea_olv ARCH_REA_OLV REA_OLV 375
387pxa_iphone ARCH_PXA_IPHONE PXA_IPHONE 376
388s3c3410 ARCH_S3C3410 S3C3410 377
389espd_4510b ARCH_ESPD_4510B ESPD_4510B 378
390mp1x ARCH_MP1X MP1X 379
391at91rm9200tb ARCH_AT91RM9200TB AT91RM9200TB 380
392adsvgx ARCH_ADSVGX ADSVGX 381
393omap_h2 MACH_OMAP_H2 OMAP_H2 382
394pelee ARCH_PELEE PELEE 383
395e740 MACH_E740 E740 384
396iq80331 ARCH_IQ80331 IQ80331 385
397versatile_pb ARCH_VERSATILE_PB VERSATILE_PB 387
398kev7a400 MACH_KEV7A400 KEV7A400 388
399lpd7a400 MACH_LPD7A400 LPD7A400 389
400lpd7a404 MACH_LPD7A404 LPD7A404 390
401fujitsu_camelot ARCH_FUJITSU_CAMELOT FUJITSU_CAMELOT 391
402janus2m ARCH_JANUS2M JANUS2M 392
403embtf MACH_EMBTF EMBTF 393
404hpm MACH_HPM HPM 394
405smdk2410tk MACH_SMDK2410TK SMDK2410TK 395
406smdk2410aj MACH_SMDK2410AJ SMDK2410AJ 396
407streetracer MACH_STREETRACER STREETRACER 397
408eframe MACH_EFRAME EFRAME 398
409csb337 MACH_CSB337 CSB337 399
410pxa_lark MACH_PXA_LARK PXA_LARK 400
411pxa_pnp2110 MACH_PNP2110 PNP2110 401
412tcc72x MACH_TCC72X TCC72X 402
413altair MACH_ALTAIR ALTAIR 403
414kc3 MACH_KC3 KC3 404
415sinteftd MACH_SINTEFTD SINTEFTD 405
416mainstone MACH_MAINSTONE MAINSTONE 406
417aday4x MACH_ADAY4X ADAY4X 407
418lite300 MACH_LITE300 LITE300 408
419s5c7376 MACH_S5C7376 S5C7376 409
420mt02 MACH_MT02 MT02 410
421mport3s MACH_MPORT3S MPORT3S 411
422ra_alpha MACH_RA_ALPHA RA_ALPHA 412
423xcep MACH_XCEP XCEP 413
424arcom_mercury MACH_ARCOM_MERCURY ARCOM_MERCURY 414
425stargate MACH_STARGATE STARGATE 415
426armadilloj MACH_ARMADILLOJ ARMADILLOJ 416
427elroy_jack MACH_ELROY_JACK ELROY_JACK 417
428backend MACH_BACKEND BACKEND 418
429s5linbox MACH_S5LINBOX S5LINBOX 419
430nomadik MACH_NOMADIK NOMADIK 420
431ia_cpu_9200 MACH_IA_CPU_9200 IA_CPU_9200 421
432at91_bja1 MACH_AT91_BJA1 AT91_BJA1 422
433corgi MACH_CORGI CORGI 423
434poodle MACH_POODLE POODLE 424
435ten MACH_TEN TEN 425
436roverp5p MACH_ROVERP5P ROVERP5P 426
437sc2700 MACH_SC2700 SC2700 427
438ex_eagle MACH_EX_EAGLE EX_EAGLE 428
439nx_pxa12 MACH_NX_PXA12 NX_PXA12 429
440nx_pxa5 MACH_NX_PXA5 NX_PXA5 430
441blackboard2 MACH_BLACKBOARD2 BLACKBOARD2 431
442i819 MACH_I819 I819 432
443ixmb995e MACH_IXMB995E IXMB995E 433
444skyrider MACH_SKYRIDER SKYRIDER 434
445skyhawk MACH_SKYHAWK SKYHAWK 435
446enterprise MACH_ENTERPRISE ENTERPRISE 436
447dep2410 MACH_DEP2410 DEP2410 437
448armcore MACH_ARMCORE ARMCORE 438
449hobbit MACH_HOBBIT HOBBIT 439
450h7210 MACH_H7210 H7210 440
451pxa_netdcu5 MACH_PXA_NETDCU5 PXA_NETDCU5 441
452acc MACH_ACC ACC 442
453esl_sarva MACH_ESL_SARVA ESL_SARVA 443
454xm250 MACH_XM250 XM250 444
455t6tc1xb MACH_T6TC1XB T6TC1XB 445
456ess710 MACH_ESS710 ESS710 446
457mx3ads MACH_MX3ADS MX3ADS 447
458himalaya MACH_HIMALAYA HIMALAYA 448
459bolfenk MACH_BOLFENK BOLFENK 449
460at91rm9200kr MACH_AT91RM9200KR AT91RM9200KR 450
461edb9312 MACH_EDB9312 EDB9312 451
462omap_generic MACH_OMAP_GENERIC OMAP_GENERIC 452
463aximx3 MACH_AXIMX3 AXIMX3 453
464eb67xdip MACH_EB67XDIP EB67XDIP 454
465webtxs MACH_WEBTXS WEBTXS 455
466hawk MACH_HAWK HAWK 456
467ccat91sbc001 MACH_CCAT91SBC001 CCAT91SBC001 457
468expresso MACH_EXPRESSO EXPRESSO 458
469h4000 MACH_H4000 H4000 459
470dino MACH_DINO DINO 460
471ml675k MACH_ML675K ML675K 461
472edb9301 MACH_EDB9301 EDB9301 462
473edb9315 MACH_EDB9315 EDB9315 463
474reciva_tt MACH_RECIVA_TT RECIVA_TT 464
475cstcb01 MACH_CSTCB01 CSTCB01 465
476cstcb1 MACH_CSTCB1 CSTCB1 466
477shadwell MACH_SHADWELL SHADWELL 467
478goepel263 MACH_GOEPEL263 GOEPEL263 468
479acq100 MACH_ACQ100 ACQ100 469
480mx1fs2 MACH_MX1FS2 MX1FS2 470
481hiptop_g1 MACH_HIPTOP_G1 HIPTOP_G1 471
482sparky MACH_SPARKY SPARKY 472
483ns9750 MACH_NS9750 NS9750 473
484phoenix MACH_PHOENIX PHOENIX 474
485vr1000 MACH_VR1000 VR1000 475
486deisterpxa MACH_DEISTERPXA DEISTERPXA 476
487bcm1160 MACH_BCM1160 BCM1160 477
488pcm022 MACH_PCM022 PCM022 478
489adsgcx MACH_ADSGCX ADSGCX 479
490dreadnaught MACH_DREADNAUGHT DREADNAUGHT 480
491dm320 MACH_DM320 DM320 481
492markov MACH_MARKOV MARKOV 482
493cos7a400 MACH_COS7A400 COS7A400 483
494milano MACH_MILANO MILANO 484
495ue9328 MACH_UE9328 UE9328 485
496uex255 MACH_UEX255 UEX255 486
497ue2410 MACH_UE2410 UE2410 487
498a620 MACH_A620 A620 488
499ocelot MACH_OCELOT OCELOT 489
500cheetah MACH_CHEETAH CHEETAH 490
501omap_perseus2 MACH_OMAP_PERSEUS2 OMAP_PERSEUS2 491
502zvue MACH_ZVUE ZVUE 492
503roverp1 MACH_ROVERP1 ROVERP1 493
504asidial2 MACH_ASIDIAL2 ASIDIAL2 494
505s3c24a0 MACH_S3C24A0 S3C24A0 495
506e800 MACH_E800 E800 496
507e750 MACH_E750 E750 497
508s3c5500 MACH_S3C5500 S3C5500 498
509smdk5500 MACH_SMDK5500 SMDK5500 499
510signalsync MACH_SIGNALSYNC SIGNALSYNC 500
511nbc MACH_NBC NBC 501
512kodiak MACH_KODIAK KODIAK 502
513netbookpro MACH_NETBOOKPRO NETBOOKPRO 503
514hw90200 MACH_HW90200 HW90200 504
515condor MACH_CONDOR CONDOR 505
516cup MACH_CUP CUP 506
517kite MACH_KITE KITE 507
518scb9328 MACH_SCB9328 SCB9328 508
519omap_h3 MACH_OMAP_H3 OMAP_H3 509
520omap_h4 MACH_OMAP_H4 OMAP_H4 510
521n10 MACH_N10 N10 511
522montejade MACH_MONTAJADE MONTAJADE 512
523sg560 MACH_SG560 SG560 513
524dp1000 MACH_DP1000 DP1000 514
525omap_osk MACH_OMAP_OSK OMAP_OSK 515
526rg100v3 MACH_RG100V3 RG100V3 516
527mx2ads MACH_MX2ADS MX2ADS 517
528pxa_kilo MACH_PXA_KILO PXA_KILO 518
529ixp4xx_eagle MACH_IXP4XX_EAGLE IXP4XX_EAGLE 519
530tosa MACH_TOSA TOSA 520
531mb2520f MACH_MB2520F MB2520F 521
532emc1000 MACH_EMC1000 EMC1000 522
533tidsc25 MACH_TIDSC25 TIDSC25 523
534akcpmxl MACH_AKCPMXL AKCPMXL 524
535av3xx MACH_AV3XX AV3XX 525
536avila MACH_AVILA AVILA 526
537pxa_mpm10 MACH_PXA_MPM10 PXA_MPM10 527
538pxa_kyanite MACH_PXA_KYANITE PXA_KYANITE 528
539sgold MACH_SGOLD SGOLD 529
540oscar MACH_OSCAR OSCAR 530
541epxa4usb2 MACH_EPXA4USB2 EPXA4USB2 531
542xsengine MACH_XSENGINE XSENGINE 532
543ip600 MACH_IP600 IP600 533
544mcan2 MACH_MCAN2 MCAN2 534
545ddi_blueridge MACH_DDI_BLUERIDGE DDI_BLUERIDGE 535
546skyminder MACH_SKYMINDER SKYMINDER 536
547lpd79520 MACH_LPD79520 LPD79520 537
548edb9302 MACH_EDB9302 EDB9302 538
549hw90340 MACH_HW90340 HW90340 539
550cip_box MACH_CIP_BOX CIP_BOX 540
551ivpn MACH_IVPN IVPN 541
552rsoc2 MACH_RSOC2 RSOC2 542
553husky MACH_HUSKY HUSKY 543
554boxer MACH_BOXER BOXER 544
555shepherd MACH_SHEPHERD SHEPHERD 545
556aml42800aa MACH_AML42800AA AML42800AA 546
557ml674001 MACH_MACH_TYPE_ML674001 MACH_TYPE_ML674001 547
558lpc2294 MACH_LPC2294 LPC2294 548
559switchgrass MACH_SWITCHGRASS SWITCHGRASS 549
560ens_cmu MACH_ENS_CMU ENS_CMU 550
561mm6_sdb MACH_MM6_SDB MM6_SDB 551
562saturn MACH_SATURN SATURN 552
563argonplusevb MACH_ARGONPLUSEVB ARGONPLUSEVB 553
564scma11evb MACH_SCMA11EVB SCMA11EVB 554
565smdk2800 MACH_SMDK2800 SMDK2800 555
566mtwilson MACH_MTWILSON MTWILSON 556
567ziti MACH_ZITI ZITI 557
568grandfather MACH_GRANDFATHER GRANDFATHER 558
569tengine MACH_TENGINE TENGINE 559
570s3c2460 MACH_S3C2460 S3C2460 560
571pdm MACH_PDM PDM 561
572h4700 MACH_H4700 H4700 562
573h6300 MACH_H6300 H6300 563
574rz1700 MACH_RZ1700 RZ1700 564
575a716 MACH_A716 A716 565
576estk2440a MACH_ESTK2440A ESTK2440A 566
577atwixp425 MACH_ATWIXP425 ATWIXP425 567
578csb336 MACH_CSB336 CSB336 568
579rirm2 MACH_RIRM2 RIRM2 569
580cx23518 MACH_CX23518 CX23518 570
581cx2351x MACH_CX2351X CX2351X 571
582computime MACH_COMPUTIME COMPUTIME 572
583izarus MACH_IZARUS IZARUS 573
584pxa_rts MACH_RTS RTS 574
585se5100 MACH_SE5100 SE5100 575
586s3c2510 MACH_S3C2510 S3C2510 576
587csb437tl MACH_CSB437TL CSB437TL 577
588slauson MACH_SLAUSON SLAUSON 578
589pearlriver MACH_PEARLRIVER PEARLRIVER 579
590tdc_p210 MACH_TDC_P210 TDC_P210 580
591sg580 MACH_SG580 SG580 581
592wrsbcarm7 MACH_WRSBCARM7 WRSBCARM7 582
593ipd MACH_IPD IPD 583
594pxa_dnp2110 MACH_PXA_DNP2110 PXA_DNP2110 584
595xaeniax MACH_XAENIAX XAENIAX 585
596somn4250 MACH_SOMN4250 SOMN4250 586
597pleb2 MACH_PLEB2 PLEB2 587
598cornwallis MACH_CORNWALLIS CORNWALLIS 588
599gurney_drv MACH_GURNEY_DRV GURNEY_DRV 589
600chaffee MACH_CHAFFEE CHAFFEE 590
601rms101 MACH_RMS101 RMS101 591
602rx3715 MACH_RX3715 RX3715 592
603swift MACH_SWIFT SWIFT 593
604roverp7 MACH_ROVERP7 ROVERP7 594
605pr818s MACH_PR818S PR818S 595
606trxpro MACH_TRXPRO TRXPRO 596
607nslu2 MACH_NSLU2 NSLU2 597
608e400 MACH_E400 E400 598
609trab MACH_TRAB TRAB 599
610cmc_pu2 MACH_CMC_PU2 CMC_PU2 600
611fulcrum MACH_FULCRUM FULCRUM 601
612netgate42x MACH_NETGATE42X NETGATE42X 602
613str710 MACH_STR710 STR710 603
614ixdpg425 MACH_IXDPG425 IXDPG425 604
615tomtomgo MACH_TOMTOMGO TOMTOMGO 605
616versatile_ab MACH_VERSATILE_AB VERSATILE_AB 606
617edb9307 MACH_EDB9307 EDB9307 607
618sg565 MACH_SG565 SG565 608
619lpd79524 MACH_LPD79524 LPD79524 609
620lpd79525 MACH_LPD79525 LPD79525 610
621rms100 MACH_RMS100 RMS100 611
622kb9200 MACH_KB9200 KB9200 612
623sx1 MACH_SX1 SX1 613
624hms39c7092 MACH_HMS39C7092 HMS39C7092 614
625armadillo MACH_ARMADILLO ARMADILLO 615
626ipcu MACH_IPCU IPCU 616
627loox720 MACH_LOOX720 LOOX720 617
628ixdp465 MACH_IXDP465 IXDP465 618
629ixdp2351 MACH_IXDP2351 IXDP2351 619
630adsvix MACH_ADSVIX ADSVIX 620
631dm270 MACH_DM270 DM270 621
632socltplus MACH_SOCLTPLUS SOCLTPLUS 622
633ecia MACH_ECIA ECIA 623
634cm4008 MACH_CM4008 CM4008 624
635p2001 MACH_P2001 P2001 625
636twister MACH_TWISTER TWISTER 626
637mudshark MACH_MUDSHARK MUDSHARK 627
638hb2 MACH_HB2 HB2 628
639iq80332 MACH_IQ80332 IQ80332 629
640sendt MACH_SENDT SENDT 630
641mx2jazz MACH_MX2JAZZ MX2JAZZ 631
642multiio MACH_MULTIIO MULTIIO 632
643hrdisplay MACH_HRDISPLAY HRDISPLAY 633
644scma11bb MACH_SCMA11BB SCMA11BB 634
645trizeps3 MACH_TRIZEPS3 TRIZEPS3 635
646zefeerdza MACH_ZEFEERDZA ZEFEERDZA 636
647zefeerdzb MACH_ZEFEERDZB ZEFEERDZB 637
648zefeerdzg MACH_ZEFEERDZG ZEFEERDZG 638
649zefeerdzn MACH_ZEFEERDZN ZEFEERDZN 639
650zefeerdzq MACH_ZEFEERDZQ ZEFEERDZQ 640
651gtwx5715 MACH_GTWX5715 GTWX5715 641
652astro_jack MACH_ASTRO_JACK ASTRO_JACK 643
653tip03 MACH_TIP03 TIP03 644
654a9200ec MACH_A9200EC A9200EC 645
655pnx0105 MACH_PNX0105 PNX0105 646
656adcpoecpu MACH_ADCPOECPU ADCPOECPU 647
657csb637 MACH_CSB637 CSB637 648
658ml69q6203 MACH_ML69Q6203 ML69Q6203 649
659mb9200 MACH_MB9200 MB9200 650
660kulun MACH_KULUN KULUN 651
661snapper MACH_SNAPPER SNAPPER 652
662optima MACH_OPTIMA OPTIMA 653
663dlhsbc MACH_DLHSBC DLHSBC 654
664x30 MACH_X30 X30 655
665n30 MACH_N30 N30 656
666manga_ks8695 MACH_MANGA_KS8695 MANGA_KS8695 657
667ajax MACH_AJAX AJAX 658
668nec_mp900 MACH_NEC_MP900 NEC_MP900 659
669vvtk1000 MACH_VVTK1000 VVTK1000 661
670kafa MACH_KAFA KAFA 662
671vvtk3000 MACH_VVTK3000 VVTK3000 663
672pimx1 MACH_PIMX1 PIMX1 664
673ollie MACH_OLLIE OLLIE 665
674skymax MACH_SKYMAX SKYMAX 666
675jazz MACH_JAZZ JAZZ 667
676tel_t3 MACH_TEL_T3 TEL_T3 668
677aisino_fcr255 MACH_AISINO_FCR255 AISINO_FCR255 669
678btweb MACH_BTWEB BTWEB 670
679dbg_lh79520 MACH_DBG_LH79520 DBG_LH79520 671
680cm41xx MACH_CM41XX CM41XX 672
681ts72xx MACH_TS72XX TS72XX 673
682nggpxa MACH_NGGPXA NGGPXA 674
683csb535 MACH_CSB535 CSB535 675
684csb536 MACH_CSB536 CSB536 676
685pxa_trakpod MACH_PXA_TRAKPOD PXA_TRAKPOD 677
686praxis MACH_PRAXIS PRAXIS 678
687lh75411 MACH_LH75411 LH75411 679
688otom MACH_OTOM OTOM 680
689nexcoder_2440 MACH_NEXCODER_2440 NEXCODER_2440 681
690loox410 MACH_LOOX410 LOOX410 682
691westlake MACH_WESTLAKE WESTLAKE 683
692nsb MACH_NSB NSB 684
693esl_sarva_stn MACH_ESL_SARVA_STN ESL_SARVA_STN 685
694esl_sarva_tft MACH_ESL_SARVA_TFT ESL_SARVA_TFT 686
695esl_sarva_iad MACH_ESL_SARVA_IAD ESL_SARVA_IAD 687
696esl_sarva_acc MACH_ESL_SARVA_ACC ESL_SARVA_ACC 688
697typhoon MACH_TYPHOON TYPHOON 689
698cnav MACH_CNAV CNAV 690
699a730 MACH_A730 A730 691
700netstar MACH_NETSTAR NETSTAR 692
701supercon MACH_PHASEFALE_SUPERCON PHASEFALE_SUPERCON 693
702shiva1100 MACH_SHIVA1100 SHIVA1100 694
703etexsc MACH_ETEXSC ETEXSC 695
704ixdpg465 MACH_IXDPG465 IXDPG465 696
705a9m2410 MACH_A9M2410 A9M2410 697
706a9m2440 MACH_A9M2440 A9M2440 698
707a9m9750 MACH_A9M9750 A9M9750 699
708a9m9360 MACH_A9M9360 A9M9360 700
709unc90 MACH_UNC90 UNC90 701
710eco920 MACH_ECO920 ECO920 702
711satview MACH_SATVIEW SATVIEW 703
712roadrunner MACH_ROADRUNNER ROADRUNNER 704
713at91rm9200ek MACH_AT91RM9200EK AT91RM9200EK 705
714gp32 MACH_GP32 GP32 706
715gem MACH_GEM GEM 707
716i858 MACH_I858 I858 708
717hx2750 MACH_HX2750 HX2750 709
718zeusevb MACH_ZEUSEVB ZEUSEVB 710
719p700 MACH_P700 P700 711
720cpe MACH_CPE CPE 712
721spitz MACH_SPITZ SPITZ 713
722nimbra340 MACH_NIMBRA340 NIMBRA340 714
723lpc22xx MACH_LPC22XX LPC22XX 715
724omap_comet3 MACH_COMET3 COMET3 716
725omap_comet4 MACH_COMET4 COMET4 717
726csb625 MACH_CSB625 CSB625 718
diff --git a/arch/arm/vfp/Makefile b/arch/arm/vfp/Makefile
new file mode 100644
index 000000000000..afabac31dd1d
--- /dev/null
+++ b/arch/arm/vfp/Makefile
@@ -0,0 +1,12 @@
1#
2# linux/arch/arm/vfp/Makefile
3#
4# Copyright (C) 2001 ARM Limited
5#
6
7# EXTRA_CFLAGS := -DDEBUG
8# EXTRA_AFLAGS := -DDEBUG
9
10obj-y += vfp.o
11
12vfp-$(CONFIG_VFP) += entry.o vfpmodule.o vfphw.o vfpsingle.o vfpdouble.o
diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S
new file mode 100644
index 000000000000..e73c8deca592
--- /dev/null
+++ b/arch/arm/vfp/entry.S
@@ -0,0 +1,45 @@
1/*
2 * linux/arch/arm/vfp/entry.S
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Basic entry code, called from the kernel's undefined instruction trap.
12 * r0 = faulted instruction
13 * r5 = faulted PC+4
14 * r9 = successful return
15 * r10 = thread_info structure
16 * lr = failure return
17 */
18#include <linux/linkage.h>
19#include <linux/init.h>
20#include <asm/constants.h>
21#include <asm/vfpmacros.h>
22
23 .globl do_vfp
24do_vfp:
25 ldr r4, .LCvfp
26 add r10, r10, #TI_VFPSTATE @ r10 = workspace
27 ldr pc, [r4] @ call VFP entry point
28
29.LCvfp:
30 .word vfp_vector
31
32@ This code is called if the VFP does not exist. It needs to flag the
33@ failure to the VFP initialisation code.
34
35 __INIT
36 .globl vfp_testing_entry
37vfp_testing_entry:
38 ldr r0, VFP_arch_address
39 str r5, [r0] @ known non-zero value
40 mov pc, r9 @ we have handled the fault
41
42VFP_arch_address:
43 .word VFP_arch
44
45 __FINIT
diff --git a/arch/arm/vfp/vfp.h b/arch/arm/vfp/vfp.h
new file mode 100644
index 000000000000..55a02bc994a3
--- /dev/null
+++ b/arch/arm/vfp/vfp.h
@@ -0,0 +1,344 @@
1/*
2 * linux/arch/arm/vfp/vfp.h
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12static inline u32 vfp_shiftright32jamming(u32 val, unsigned int shift)
13{
14 if (shift) {
15 if (shift < 32)
16 val = val >> shift | ((val << (32 - shift)) != 0);
17 else
18 val = val != 0;
19 }
20 return val;
21}
22
23static inline u64 vfp_shiftright64jamming(u64 val, unsigned int shift)
24{
25 if (shift) {
26 if (shift < 64)
27 val = val >> shift | ((val << (64 - shift)) != 0);
28 else
29 val = val != 0;
30 }
31 return val;
32}
33
34static inline u32 vfp_hi64to32jamming(u64 val)
35{
36 u32 v;
37
38 asm(
39 "cmp %Q1, #1 @ vfp_hi64to32jamming\n\t"
40 "movcc %0, %R1\n\t"
41 "orrcs %0, %R1, #1"
42 : "=r" (v) : "r" (val) : "cc");
43
44 return v;
45}
46
47static inline void add128(u64 *resh, u64 *resl, u64 nh, u64 nl, u64 mh, u64 ml)
48{
49 asm( "adds %Q0, %Q2, %Q4\n\t"
50 "adcs %R0, %R2, %R4\n\t"
51 "adcs %Q1, %Q3, %Q5\n\t"
52 "adc %R1, %R3, %R5"
53 : "=r" (nl), "=r" (nh)
54 : "0" (nl), "1" (nh), "r" (ml), "r" (mh)
55 : "cc");
56 *resh = nh;
57 *resl = nl;
58}
59
60static inline void sub128(u64 *resh, u64 *resl, u64 nh, u64 nl, u64 mh, u64 ml)
61{
62 asm( "subs %Q0, %Q2, %Q4\n\t"
63 "sbcs %R0, %R2, %R4\n\t"
64 "sbcs %Q1, %Q3, %Q5\n\t"
65 "sbc %R1, %R3, %R5\n\t"
66 : "=r" (nl), "=r" (nh)
67 : "0" (nl), "1" (nh), "r" (ml), "r" (mh)
68 : "cc");
69 *resh = nh;
70 *resl = nl;
71}
72
73static inline void mul64to128(u64 *resh, u64 *resl, u64 n, u64 m)
74{
75 u32 nh, nl, mh, ml;
76 u64 rh, rma, rmb, rl;
77
78 nl = n;
79 ml = m;
80 rl = (u64)nl * ml;
81
82 nh = n >> 32;
83 rma = (u64)nh * ml;
84
85 mh = m >> 32;
86 rmb = (u64)nl * mh;
87 rma += rmb;
88
89 rh = (u64)nh * mh;
90 rh += ((u64)(rma < rmb) << 32) + (rma >> 32);
91
92 rma <<= 32;
93 rl += rma;
94 rh += (rl < rma);
95
96 *resl = rl;
97 *resh = rh;
98}
99
100static inline void shift64left(u64 *resh, u64 *resl, u64 n)
101{
102 *resh = n >> 63;
103 *resl = n << 1;
104}
105
106static inline u64 vfp_hi64multiply64(u64 n, u64 m)
107{
108 u64 rh, rl;
109 mul64to128(&rh, &rl, n, m);
110 return rh | (rl != 0);
111}
112
113static inline u64 vfp_estimate_div128to64(u64 nh, u64 nl, u64 m)
114{
115 u64 mh, ml, remh, reml, termh, terml, z;
116
117 if (nh >= m)
118 return ~0ULL;
119 mh = m >> 32;
120 z = (mh << 32 <= nh) ? 0xffffffff00000000ULL : (nh / mh) << 32;
121 mul64to128(&termh, &terml, m, z);
122 sub128(&remh, &reml, nh, nl, termh, terml);
123 ml = m << 32;
124 while ((s64)remh < 0) {
125 z -= 0x100000000ULL;
126 add128(&remh, &reml, remh, reml, mh, ml);
127 }
128 remh = (remh << 32) | (reml >> 32);
129 z |= (mh << 32 <= remh) ? 0xffffffff : remh / mh;
130 return z;
131}
132
133/*
134 * Operations on unpacked elements
135 */
136#define vfp_sign_negate(sign) (sign ^ 0x8000)
137
138/*
139 * Single-precision
140 */
141struct vfp_single {
142 s16 exponent;
143 u16 sign;
144 u32 significand;
145};
146
147extern s32 vfp_get_float(unsigned int reg);
148extern void vfp_put_float(unsigned int reg, s32 val);
149
150/*
151 * VFP_SINGLE_MANTISSA_BITS - number of bits in the mantissa
152 * VFP_SINGLE_EXPONENT_BITS - number of bits in the exponent
153 * VFP_SINGLE_LOW_BITS - number of low bits in the unpacked significand
154 * which are not propagated to the float upon packing.
155 */
156#define VFP_SINGLE_MANTISSA_BITS (23)
157#define VFP_SINGLE_EXPONENT_BITS (8)
158#define VFP_SINGLE_LOW_BITS (32 - VFP_SINGLE_MANTISSA_BITS - 2)
159#define VFP_SINGLE_LOW_BITS_MASK ((1 << VFP_SINGLE_LOW_BITS) - 1)
160
161/*
162 * The bit in an unpacked float which indicates that it is a quiet NaN
163 */
164#define VFP_SINGLE_SIGNIFICAND_QNAN (1 << (VFP_SINGLE_MANTISSA_BITS - 1 + VFP_SINGLE_LOW_BITS))
165
166/*
167 * Operations on packed single-precision numbers
168 */
169#define vfp_single_packed_sign(v) ((v) & 0x80000000)
170#define vfp_single_packed_negate(v) ((v) ^ 0x80000000)
171#define vfp_single_packed_abs(v) ((v) & ~0x80000000)
172#define vfp_single_packed_exponent(v) (((v) >> VFP_SINGLE_MANTISSA_BITS) & ((1 << VFP_SINGLE_EXPONENT_BITS) - 1))
173#define vfp_single_packed_mantissa(v) ((v) & ((1 << VFP_SINGLE_MANTISSA_BITS) - 1))
174
175/*
176 * Unpack a single-precision float. Note that this returns the magnitude
177 * of the single-precision float mantissa with the 1. if necessary,
178 * aligned to bit 30.
179 */
180static inline void vfp_single_unpack(struct vfp_single *s, s32 val)
181{
182 u32 significand;
183
184 s->sign = vfp_single_packed_sign(val) >> 16,
185 s->exponent = vfp_single_packed_exponent(val);
186
187 significand = (u32) val;
188 significand = (significand << (32 - VFP_SINGLE_MANTISSA_BITS)) >> 2;
189 if (s->exponent && s->exponent != 255)
190 significand |= 0x40000000;
191 s->significand = significand;
192}
193
194/*
195 * Re-pack a single-precision float. This assumes that the float is
196 * already normalised such that the MSB is bit 30, _not_ bit 31.
197 */
198static inline s32 vfp_single_pack(struct vfp_single *s)
199{
200 u32 val;
201 val = (s->sign << 16) +
202 (s->exponent << VFP_SINGLE_MANTISSA_BITS) +
203 (s->significand >> VFP_SINGLE_LOW_BITS);
204 return (s32)val;
205}
206
207#define VFP_NUMBER (1<<0)
208#define VFP_ZERO (1<<1)
209#define VFP_DENORMAL (1<<2)
210#define VFP_INFINITY (1<<3)
211#define VFP_NAN (1<<4)
212#define VFP_NAN_SIGNAL (1<<5)
213
214#define VFP_QNAN (VFP_NAN)
215#define VFP_SNAN (VFP_NAN|VFP_NAN_SIGNAL)
216
217static inline int vfp_single_type(struct vfp_single *s)
218{
219 int type = VFP_NUMBER;
220 if (s->exponent == 255) {
221 if (s->significand == 0)
222 type = VFP_INFINITY;
223 else if (s->significand & VFP_SINGLE_SIGNIFICAND_QNAN)
224 type = VFP_QNAN;
225 else
226 type = VFP_SNAN;
227 } else if (s->exponent == 0) {
228 if (s->significand == 0)
229 type |= VFP_ZERO;
230 else
231 type |= VFP_DENORMAL;
232 }
233 return type;
234}
235
236#ifndef DEBUG
237#define vfp_single_normaliseround(sd,vsd,fpscr,except,func) __vfp_single_normaliseround(sd,vsd,fpscr,except)
238u32 __vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exceptions);
239#else
240u32 vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exceptions, const char *func);
241#endif
242
243/*
244 * Double-precision
245 */
246struct vfp_double {
247 s16 exponent;
248 u16 sign;
249 u64 significand;
250};
251
252/*
253 * VFP_REG_ZERO is a special register number for vfp_get_double
254 * which returns (double)0.0. This is useful for the compare with
255 * zero instructions.
256 */
257#define VFP_REG_ZERO 16
258extern u64 vfp_get_double(unsigned int reg);
259extern void vfp_put_double(unsigned int reg, u64 val);
260
261#define VFP_DOUBLE_MANTISSA_BITS (52)
262#define VFP_DOUBLE_EXPONENT_BITS (11)
263#define VFP_DOUBLE_LOW_BITS (64 - VFP_DOUBLE_MANTISSA_BITS - 2)
264#define VFP_DOUBLE_LOW_BITS_MASK ((1 << VFP_DOUBLE_LOW_BITS) - 1)
265
266/*
267 * The bit in an unpacked double which indicates that it is a quiet NaN
268 */
269#define VFP_DOUBLE_SIGNIFICAND_QNAN (1ULL << (VFP_DOUBLE_MANTISSA_BITS - 1 + VFP_DOUBLE_LOW_BITS))
270
271/*
272 * Operations on packed single-precision numbers
273 */
274#define vfp_double_packed_sign(v) ((v) & (1ULL << 63))
275#define vfp_double_packed_negate(v) ((v) ^ (1ULL << 63))
276#define vfp_double_packed_abs(v) ((v) & ~(1ULL << 63))
277#define vfp_double_packed_exponent(v) (((v) >> VFP_DOUBLE_MANTISSA_BITS) & ((1 << VFP_DOUBLE_EXPONENT_BITS) - 1))
278#define vfp_double_packed_mantissa(v) ((v) & ((1ULL << VFP_DOUBLE_MANTISSA_BITS) - 1))
279
280/*
281 * Unpack a double-precision float. Note that this returns the magnitude
282 * of the double-precision float mantissa with the 1. if necessary,
283 * aligned to bit 62.
284 */
285static inline void vfp_double_unpack(struct vfp_double *s, s64 val)
286{
287 u64 significand;
288
289 s->sign = vfp_double_packed_sign(val) >> 48;
290 s->exponent = vfp_double_packed_exponent(val);
291
292 significand = (u64) val;
293 significand = (significand << (64 - VFP_DOUBLE_MANTISSA_BITS)) >> 2;
294 if (s->exponent && s->exponent != 2047)
295 significand |= (1ULL << 62);
296 s->significand = significand;
297}
298
299/*
300 * Re-pack a double-precision float. This assumes that the float is
301 * already normalised such that the MSB is bit 30, _not_ bit 31.
302 */
303static inline s64 vfp_double_pack(struct vfp_double *s)
304{
305 u64 val;
306 val = ((u64)s->sign << 48) +
307 ((u64)s->exponent << VFP_DOUBLE_MANTISSA_BITS) +
308 (s->significand >> VFP_DOUBLE_LOW_BITS);
309 return (s64)val;
310}
311
312static inline int vfp_double_type(struct vfp_double *s)
313{
314 int type = VFP_NUMBER;
315 if (s->exponent == 2047) {
316 if (s->significand == 0)
317 type = VFP_INFINITY;
318 else if (s->significand & VFP_DOUBLE_SIGNIFICAND_QNAN)
319 type = VFP_QNAN;
320 else
321 type = VFP_SNAN;
322 } else if (s->exponent == 0) {
323 if (s->significand == 0)
324 type |= VFP_ZERO;
325 else
326 type |= VFP_DENORMAL;
327 }
328 return type;
329}
330
331u32 vfp_double_normaliseround(int dd, struct vfp_double *vd, u32 fpscr, u32 exceptions, const char *func);
332
333/*
334 * System registers
335 */
336extern u32 vfp_get_sys(unsigned int reg);
337extern void vfp_put_sys(unsigned int reg, u32 val);
338
339u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand);
340
341/*
342 * A special flag to tell the normalisation code not to normalise.
343 */
344#define VFP_NAN_FLAG 0x100
diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c
new file mode 100644
index 000000000000..fa3053e84db5
--- /dev/null
+++ b/arch/arm/vfp/vfpdouble.c
@@ -0,0 +1,1186 @@
1/*
2 * linux/arch/arm/vfp/vfpdouble.c
3 *
4 * This code is derived in part from John R. Housers softfloat library, which
5 * carries the following notice:
6 *
7 * ===========================================================================
8 * This C source file is part of the SoftFloat IEC/IEEE Floating-point
9 * Arithmetic Package, Release 2.
10 *
11 * Written by John R. Hauser. This work was made possible in part by the
12 * International Computer Science Institute, located at Suite 600, 1947 Center
13 * Street, Berkeley, California 94704. Funding was partially provided by the
14 * National Science Foundation under grant MIP-9311980. The original version
15 * of this code was written as part of a project to build a fixed-point vector
16 * processor in collaboration with the University of California at Berkeley,
17 * overseen by Profs. Nelson Morgan and John Wawrzynek. More information
18 * is available through the web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
19 * arithmetic/softfloat.html'.
20 *
21 * THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
22 * has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
23 * TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
24 * PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
25 * AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
26 *
27 * Derivative works are acceptable, even for commercial purposes, so long as
28 * (1) they include prominent notice that the work is derivative, and (2) they
29 * include prominent notice akin to these three paragraphs for those parts of
30 * this code that are retained.
31 * ===========================================================================
32 */
33#include <linux/kernel.h>
34#include <linux/bitops.h>
35#include <asm/ptrace.h>
36#include <asm/vfp.h>
37
38#include "vfpinstr.h"
39#include "vfp.h"
40
41static struct vfp_double vfp_double_default_qnan = {
42 .exponent = 2047,
43 .sign = 0,
44 .significand = VFP_DOUBLE_SIGNIFICAND_QNAN,
45};
46
47static void vfp_double_dump(const char *str, struct vfp_double *d)
48{
49 pr_debug("VFP: %s: sign=%d exponent=%d significand=%016llx\n",
50 str, d->sign != 0, d->exponent, d->significand);
51}
52
53static void vfp_double_normalise_denormal(struct vfp_double *vd)
54{
55 int bits = 31 - fls(vd->significand >> 32);
56 if (bits == 31)
57 bits = 62 - fls(vd->significand);
58
59 vfp_double_dump("normalise_denormal: in", vd);
60
61 if (bits) {
62 vd->exponent -= bits - 1;
63 vd->significand <<= bits;
64 }
65
66 vfp_double_dump("normalise_denormal: out", vd);
67}
68
69u32 vfp_double_normaliseround(int dd, struct vfp_double *vd, u32 fpscr, u32 exceptions, const char *func)
70{
71 u64 significand, incr;
72 int exponent, shift, underflow;
73 u32 rmode;
74
75 vfp_double_dump("pack: in", vd);
76
77 /*
78 * Infinities and NaNs are a special case.
79 */
80 if (vd->exponent == 2047 && (vd->significand == 0 || exceptions))
81 goto pack;
82
83 /*
84 * Special-case zero.
85 */
86 if (vd->significand == 0) {
87 vd->exponent = 0;
88 goto pack;
89 }
90
91 exponent = vd->exponent;
92 significand = vd->significand;
93
94 shift = 32 - fls(significand >> 32);
95 if (shift == 32)
96 shift = 64 - fls(significand);
97 if (shift) {
98 exponent -= shift;
99 significand <<= shift;
100 }
101
102#ifdef DEBUG
103 vd->exponent = exponent;
104 vd->significand = significand;
105 vfp_double_dump("pack: normalised", vd);
106#endif
107
108 /*
109 * Tiny number?
110 */
111 underflow = exponent < 0;
112 if (underflow) {
113 significand = vfp_shiftright64jamming(significand, -exponent);
114 exponent = 0;
115#ifdef DEBUG
116 vd->exponent = exponent;
117 vd->significand = significand;
118 vfp_double_dump("pack: tiny number", vd);
119#endif
120 if (!(significand & ((1ULL << (VFP_DOUBLE_LOW_BITS + 1)) - 1)))
121 underflow = 0;
122 }
123
124 /*
125 * Select rounding increment.
126 */
127 incr = 0;
128 rmode = fpscr & FPSCR_RMODE_MASK;
129
130 if (rmode == FPSCR_ROUND_NEAREST) {
131 incr = 1ULL << VFP_DOUBLE_LOW_BITS;
132 if ((significand & (1ULL << (VFP_DOUBLE_LOW_BITS + 1))) == 0)
133 incr -= 1;
134 } else if (rmode == FPSCR_ROUND_TOZERO) {
135 incr = 0;
136 } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vd->sign != 0))
137 incr = (1ULL << (VFP_DOUBLE_LOW_BITS + 1)) - 1;
138
139 pr_debug("VFP: rounding increment = 0x%08llx\n", incr);
140
141 /*
142 * Is our rounding going to overflow?
143 */
144 if ((significand + incr) < significand) {
145 exponent += 1;
146 significand = (significand >> 1) | (significand & 1);
147 incr >>= 1;
148#ifdef DEBUG
149 vd->exponent = exponent;
150 vd->significand = significand;
151 vfp_double_dump("pack: overflow", vd);
152#endif
153 }
154
155 /*
156 * If any of the low bits (which will be shifted out of the
157 * number) are non-zero, the result is inexact.
158 */
159 if (significand & ((1 << (VFP_DOUBLE_LOW_BITS + 1)) - 1))
160 exceptions |= FPSCR_IXC;
161
162 /*
163 * Do our rounding.
164 */
165 significand += incr;
166
167 /*
168 * Infinity?
169 */
170 if (exponent >= 2046) {
171 exceptions |= FPSCR_OFC | FPSCR_IXC;
172 if (incr == 0) {
173 vd->exponent = 2045;
174 vd->significand = 0x7fffffffffffffffULL;
175 } else {
176 vd->exponent = 2047; /* infinity */
177 vd->significand = 0;
178 }
179 } else {
180 if (significand >> (VFP_DOUBLE_LOW_BITS + 1) == 0)
181 exponent = 0;
182 if (exponent || significand > 0x8000000000000000ULL)
183 underflow = 0;
184 if (underflow)
185 exceptions |= FPSCR_UFC;
186 vd->exponent = exponent;
187 vd->significand = significand >> 1;
188 }
189
190 pack:
191 vfp_double_dump("pack: final", vd);
192 {
193 s64 d = vfp_double_pack(vd);
194 pr_debug("VFP: %s: d(d%d)=%016llx exceptions=%08x\n", func,
195 dd, d, exceptions);
196 vfp_put_double(dd, d);
197 }
198 return exceptions & ~VFP_NAN_FLAG;
199}
200
201/*
202 * Propagate the NaN, setting exceptions if it is signalling.
203 * 'n' is always a NaN. 'm' may be a number, NaN or infinity.
204 */
205static u32
206vfp_propagate_nan(struct vfp_double *vdd, struct vfp_double *vdn,
207 struct vfp_double *vdm, u32 fpscr)
208{
209 struct vfp_double *nan;
210 int tn, tm = 0;
211
212 tn = vfp_double_type(vdn);
213
214 if (vdm)
215 tm = vfp_double_type(vdm);
216
217 if (fpscr & FPSCR_DEFAULT_NAN)
218 /*
219 * Default NaN mode - always returns a quiet NaN
220 */
221 nan = &vfp_double_default_qnan;
222 else {
223 /*
224 * Contemporary mode - select the first signalling
225 * NAN, or if neither are signalling, the first
226 * quiet NAN.
227 */
228 if (tn == VFP_SNAN || (tm != VFP_SNAN && tn == VFP_QNAN))
229 nan = vdn;
230 else
231 nan = vdm;
232 /*
233 * Make the NaN quiet.
234 */
235 nan->significand |= VFP_DOUBLE_SIGNIFICAND_QNAN;
236 }
237
238 *vdd = *nan;
239
240 /*
241 * If one was a signalling NAN, raise invalid operation.
242 */
243 return tn == VFP_SNAN || tm == VFP_SNAN ? FPSCR_IOC : VFP_NAN_FLAG;
244}
245
246/*
247 * Extended operations
248 */
249static u32 vfp_double_fabs(int dd, int unused, int dm, u32 fpscr)
250{
251 vfp_put_double(dd, vfp_double_packed_abs(vfp_get_double(dm)));
252 return 0;
253}
254
255static u32 vfp_double_fcpy(int dd, int unused, int dm, u32 fpscr)
256{
257 vfp_put_double(dd, vfp_get_double(dm));
258 return 0;
259}
260
261static u32 vfp_double_fneg(int dd, int unused, int dm, u32 fpscr)
262{
263 vfp_put_double(dd, vfp_double_packed_negate(vfp_get_double(dm)));
264 return 0;
265}
266
267static u32 vfp_double_fsqrt(int dd, int unused, int dm, u32 fpscr)
268{
269 struct vfp_double vdm, vdd;
270 int ret, tm;
271
272 vfp_double_unpack(&vdm, vfp_get_double(dm));
273 tm = vfp_double_type(&vdm);
274 if (tm & (VFP_NAN|VFP_INFINITY)) {
275 struct vfp_double *vdp = &vdd;
276
277 if (tm & VFP_NAN)
278 ret = vfp_propagate_nan(vdp, &vdm, NULL, fpscr);
279 else if (vdm.sign == 0) {
280 sqrt_copy:
281 vdp = &vdm;
282 ret = 0;
283 } else {
284 sqrt_invalid:
285 vdp = &vfp_double_default_qnan;
286 ret = FPSCR_IOC;
287 }
288 vfp_put_double(dd, vfp_double_pack(vdp));
289 return ret;
290 }
291
292 /*
293 * sqrt(+/- 0) == +/- 0
294 */
295 if (tm & VFP_ZERO)
296 goto sqrt_copy;
297
298 /*
299 * Normalise a denormalised number
300 */
301 if (tm & VFP_DENORMAL)
302 vfp_double_normalise_denormal(&vdm);
303
304 /*
305 * sqrt(<0) = invalid
306 */
307 if (vdm.sign)
308 goto sqrt_invalid;
309
310 vfp_double_dump("sqrt", &vdm);
311
312 /*
313 * Estimate the square root.
314 */
315 vdd.sign = 0;
316 vdd.exponent = ((vdm.exponent - 1023) >> 1) + 1023;
317 vdd.significand = (u64)vfp_estimate_sqrt_significand(vdm.exponent, vdm.significand >> 32) << 31;
318
319 vfp_double_dump("sqrt estimate1", &vdd);
320
321 vdm.significand >>= 1 + (vdm.exponent & 1);
322 vdd.significand += 2 + vfp_estimate_div128to64(vdm.significand, 0, vdd.significand);
323
324 vfp_double_dump("sqrt estimate2", &vdd);
325
326 /*
327 * And now adjust.
328 */
329 if ((vdd.significand & VFP_DOUBLE_LOW_BITS_MASK) <= 5) {
330 if (vdd.significand < 2) {
331 vdd.significand = ~0ULL;
332 } else {
333 u64 termh, terml, remh, reml;
334 vdm.significand <<= 2;
335 mul64to128(&termh, &terml, vdd.significand, vdd.significand);
336 sub128(&remh, &reml, vdm.significand, 0, termh, terml);
337 while ((s64)remh < 0) {
338 vdd.significand -= 1;
339 shift64left(&termh, &terml, vdd.significand);
340 terml |= 1;
341 add128(&remh, &reml, remh, reml, termh, terml);
342 }
343 vdd.significand |= (remh | reml) != 0;
344 }
345 }
346 vdd.significand = vfp_shiftright64jamming(vdd.significand, 1);
347
348 return vfp_double_normaliseround(dd, &vdd, fpscr, 0, "fsqrt");
349}
350
351/*
352 * Equal := ZC
353 * Less than := N
354 * Greater than := C
355 * Unordered := CV
356 */
357static u32 vfp_compare(int dd, int signal_on_qnan, int dm, u32 fpscr)
358{
359 s64 d, m;
360 u32 ret = 0;
361
362 m = vfp_get_double(dm);
363 if (vfp_double_packed_exponent(m) == 2047 && vfp_double_packed_mantissa(m)) {
364 ret |= FPSCR_C | FPSCR_V;
365 if (signal_on_qnan || !(vfp_double_packed_mantissa(m) & (1ULL << (VFP_DOUBLE_MANTISSA_BITS - 1))))
366 /*
367 * Signalling NaN, or signalling on quiet NaN
368 */
369 ret |= FPSCR_IOC;
370 }
371
372 d = vfp_get_double(dd);
373 if (vfp_double_packed_exponent(d) == 2047 && vfp_double_packed_mantissa(d)) {
374 ret |= FPSCR_C | FPSCR_V;
375 if (signal_on_qnan || !(vfp_double_packed_mantissa(d) & (1ULL << (VFP_DOUBLE_MANTISSA_BITS - 1))))
376 /*
377 * Signalling NaN, or signalling on quiet NaN
378 */
379 ret |= FPSCR_IOC;
380 }
381
382 if (ret == 0) {
383 if (d == m || vfp_double_packed_abs(d | m) == 0) {
384 /*
385 * equal
386 */
387 ret |= FPSCR_Z | FPSCR_C;
388 } else if (vfp_double_packed_sign(d ^ m)) {
389 /*
390 * different signs
391 */
392 if (vfp_double_packed_sign(d))
393 /*
394 * d is negative, so d < m
395 */
396 ret |= FPSCR_N;
397 else
398 /*
399 * d is positive, so d > m
400 */
401 ret |= FPSCR_C;
402 } else if ((vfp_double_packed_sign(d) != 0) ^ (d < m)) {
403 /*
404 * d < m
405 */
406 ret |= FPSCR_N;
407 } else if ((vfp_double_packed_sign(d) != 0) ^ (d > m)) {
408 /*
409 * d > m
410 */
411 ret |= FPSCR_C;
412 }
413 }
414
415 return ret;
416}
417
418static u32 vfp_double_fcmp(int dd, int unused, int dm, u32 fpscr)
419{
420 return vfp_compare(dd, 0, dm, fpscr);
421}
422
423static u32 vfp_double_fcmpe(int dd, int unused, int dm, u32 fpscr)
424{
425 return vfp_compare(dd, 1, dm, fpscr);
426}
427
428static u32 vfp_double_fcmpz(int dd, int unused, int dm, u32 fpscr)
429{
430 return vfp_compare(dd, 0, VFP_REG_ZERO, fpscr);
431}
432
433static u32 vfp_double_fcmpez(int dd, int unused, int dm, u32 fpscr)
434{
435 return vfp_compare(dd, 1, VFP_REG_ZERO, fpscr);
436}
437
438static u32 vfp_double_fcvts(int sd, int unused, int dm, u32 fpscr)
439{
440 struct vfp_double vdm;
441 struct vfp_single vsd;
442 int tm;
443 u32 exceptions = 0;
444
445 vfp_double_unpack(&vdm, vfp_get_double(dm));
446
447 tm = vfp_double_type(&vdm);
448
449 /*
450 * If we have a signalling NaN, signal invalid operation.
451 */
452 if (tm == VFP_SNAN)
453 exceptions = FPSCR_IOC;
454
455 if (tm & VFP_DENORMAL)
456 vfp_double_normalise_denormal(&vdm);
457
458 vsd.sign = vdm.sign;
459 vsd.significand = vfp_hi64to32jamming(vdm.significand);
460
461 /*
462 * If we have an infinity or a NaN, the exponent must be 255
463 */
464 if (tm & (VFP_INFINITY|VFP_NAN)) {
465 vsd.exponent = 255;
466 if (tm & VFP_NAN)
467 vsd.significand |= VFP_SINGLE_SIGNIFICAND_QNAN;
468 goto pack_nan;
469 } else if (tm & VFP_ZERO)
470 vsd.exponent = 0;
471 else
472 vsd.exponent = vdm.exponent - (1023 - 127);
473
474 return vfp_single_normaliseround(sd, &vsd, fpscr, exceptions, "fcvts");
475
476 pack_nan:
477 vfp_put_float(sd, vfp_single_pack(&vsd));
478 return exceptions;
479}
480
481static u32 vfp_double_fuito(int dd, int unused, int dm, u32 fpscr)
482{
483 struct vfp_double vdm;
484 u32 m = vfp_get_float(dm);
485
486 vdm.sign = 0;
487 vdm.exponent = 1023 + 63 - 1;
488 vdm.significand = (u64)m;
489
490 return vfp_double_normaliseround(dd, &vdm, fpscr, 0, "fuito");
491}
492
493static u32 vfp_double_fsito(int dd, int unused, int dm, u32 fpscr)
494{
495 struct vfp_double vdm;
496 u32 m = vfp_get_float(dm);
497
498 vdm.sign = (m & 0x80000000) >> 16;
499 vdm.exponent = 1023 + 63 - 1;
500 vdm.significand = vdm.sign ? -m : m;
501
502 return vfp_double_normaliseround(dd, &vdm, fpscr, 0, "fsito");
503}
504
505static u32 vfp_double_ftoui(int sd, int unused, int dm, u32 fpscr)
506{
507 struct vfp_double vdm;
508 u32 d, exceptions = 0;
509 int rmode = fpscr & FPSCR_RMODE_MASK;
510 int tm;
511
512 vfp_double_unpack(&vdm, vfp_get_double(dm));
513
514 /*
515 * Do we have a denormalised number?
516 */
517 tm = vfp_double_type(&vdm);
518 if (tm & VFP_DENORMAL)
519 exceptions |= FPSCR_IDC;
520
521 if (tm & VFP_NAN)
522 vdm.sign = 0;
523
524 if (vdm.exponent >= 1023 + 32) {
525 d = vdm.sign ? 0 : 0xffffffff;
526 exceptions = FPSCR_IOC;
527 } else if (vdm.exponent >= 1023 - 1) {
528 int shift = 1023 + 63 - vdm.exponent;
529 u64 rem, incr = 0;
530
531 /*
532 * 2^0 <= m < 2^32-2^8
533 */
534 d = (vdm.significand << 1) >> shift;
535 rem = vdm.significand << (65 - shift);
536
537 if (rmode == FPSCR_ROUND_NEAREST) {
538 incr = 0x8000000000000000ULL;
539 if ((d & 1) == 0)
540 incr -= 1;
541 } else if (rmode == FPSCR_ROUND_TOZERO) {
542 incr = 0;
543 } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vdm.sign != 0)) {
544 incr = ~0ULL;
545 }
546
547 if ((rem + incr) < rem) {
548 if (d < 0xffffffff)
549 d += 1;
550 else
551 exceptions |= FPSCR_IOC;
552 }
553
554 if (d && vdm.sign) {
555 d = 0;
556 exceptions |= FPSCR_IOC;
557 } else if (rem)
558 exceptions |= FPSCR_IXC;
559 } else {
560 d = 0;
561 if (vdm.exponent | vdm.significand) {
562 exceptions |= FPSCR_IXC;
563 if (rmode == FPSCR_ROUND_PLUSINF && vdm.sign == 0)
564 d = 1;
565 else if (rmode == FPSCR_ROUND_MINUSINF && vdm.sign) {
566 d = 0;
567 exceptions |= FPSCR_IOC;
568 }
569 }
570 }
571
572 pr_debug("VFP: ftoui: d(s%d)=%08x exceptions=%08x\n", sd, d, exceptions);
573
574 vfp_put_float(sd, d);
575
576 return exceptions;
577}
578
579static u32 vfp_double_ftouiz(int sd, int unused, int dm, u32 fpscr)
580{
581 return vfp_double_ftoui(sd, unused, dm, FPSCR_ROUND_TOZERO);
582}
583
584static u32 vfp_double_ftosi(int sd, int unused, int dm, u32 fpscr)
585{
586 struct vfp_double vdm;
587 u32 d, exceptions = 0;
588 int rmode = fpscr & FPSCR_RMODE_MASK;
589
590 vfp_double_unpack(&vdm, vfp_get_double(dm));
591 vfp_double_dump("VDM", &vdm);
592
593 /*
594 * Do we have denormalised number?
595 */
596 if (vfp_double_type(&vdm) & VFP_DENORMAL)
597 exceptions |= FPSCR_IDC;
598
599 if (vdm.exponent >= 1023 + 32) {
600 d = 0x7fffffff;
601 if (vdm.sign)
602 d = ~d;
603 exceptions |= FPSCR_IOC;
604 } else if (vdm.exponent >= 1023 - 1) {
605 int shift = 1023 + 63 - vdm.exponent; /* 58 */
606 u64 rem, incr = 0;
607
608 d = (vdm.significand << 1) >> shift;
609 rem = vdm.significand << (65 - shift);
610
611 if (rmode == FPSCR_ROUND_NEAREST) {
612 incr = 0x8000000000000000ULL;
613 if ((d & 1) == 0)
614 incr -= 1;
615 } else if (rmode == FPSCR_ROUND_TOZERO) {
616 incr = 0;
617 } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vdm.sign != 0)) {
618 incr = ~0ULL;
619 }
620
621 if ((rem + incr) < rem && d < 0xffffffff)
622 d += 1;
623 if (d > 0x7fffffff + (vdm.sign != 0)) {
624 d = 0x7fffffff + (vdm.sign != 0);
625 exceptions |= FPSCR_IOC;
626 } else if (rem)
627 exceptions |= FPSCR_IXC;
628
629 if (vdm.sign)
630 d = -d;
631 } else {
632 d = 0;
633 if (vdm.exponent | vdm.significand) {
634 exceptions |= FPSCR_IXC;
635 if (rmode == FPSCR_ROUND_PLUSINF && vdm.sign == 0)
636 d = 1;
637 else if (rmode == FPSCR_ROUND_MINUSINF && vdm.sign)
638 d = -1;
639 }
640 }
641
642 pr_debug("VFP: ftosi: d(s%d)=%08x exceptions=%08x\n", sd, d, exceptions);
643
644 vfp_put_float(sd, (s32)d);
645
646 return exceptions;
647}
648
649static u32 vfp_double_ftosiz(int dd, int unused, int dm, u32 fpscr)
650{
651 return vfp_double_ftosi(dd, unused, dm, FPSCR_ROUND_TOZERO);
652}
653
654
655static u32 (* const fop_extfns[32])(int dd, int unused, int dm, u32 fpscr) = {
656 [FEXT_TO_IDX(FEXT_FCPY)] = vfp_double_fcpy,
657 [FEXT_TO_IDX(FEXT_FABS)] = vfp_double_fabs,
658 [FEXT_TO_IDX(FEXT_FNEG)] = vfp_double_fneg,
659 [FEXT_TO_IDX(FEXT_FSQRT)] = vfp_double_fsqrt,
660 [FEXT_TO_IDX(FEXT_FCMP)] = vfp_double_fcmp,
661 [FEXT_TO_IDX(FEXT_FCMPE)] = vfp_double_fcmpe,
662 [FEXT_TO_IDX(FEXT_FCMPZ)] = vfp_double_fcmpz,
663 [FEXT_TO_IDX(FEXT_FCMPEZ)] = vfp_double_fcmpez,
664 [FEXT_TO_IDX(FEXT_FCVT)] = vfp_double_fcvts,
665 [FEXT_TO_IDX(FEXT_FUITO)] = vfp_double_fuito,
666 [FEXT_TO_IDX(FEXT_FSITO)] = vfp_double_fsito,
667 [FEXT_TO_IDX(FEXT_FTOUI)] = vfp_double_ftoui,
668 [FEXT_TO_IDX(FEXT_FTOUIZ)] = vfp_double_ftouiz,
669 [FEXT_TO_IDX(FEXT_FTOSI)] = vfp_double_ftosi,
670 [FEXT_TO_IDX(FEXT_FTOSIZ)] = vfp_double_ftosiz,
671};
672
673
674
675
676static u32
677vfp_double_fadd_nonnumber(struct vfp_double *vdd, struct vfp_double *vdn,
678 struct vfp_double *vdm, u32 fpscr)
679{
680 struct vfp_double *vdp;
681 u32 exceptions = 0;
682 int tn, tm;
683
684 tn = vfp_double_type(vdn);
685 tm = vfp_double_type(vdm);
686
687 if (tn & tm & VFP_INFINITY) {
688 /*
689 * Two infinities. Are they different signs?
690 */
691 if (vdn->sign ^ vdm->sign) {
692 /*
693 * different signs -> invalid
694 */
695 exceptions = FPSCR_IOC;
696 vdp = &vfp_double_default_qnan;
697 } else {
698 /*
699 * same signs -> valid
700 */
701 vdp = vdn;
702 }
703 } else if (tn & VFP_INFINITY && tm & VFP_NUMBER) {
704 /*
705 * One infinity and one number -> infinity
706 */
707 vdp = vdn;
708 } else {
709 /*
710 * 'n' is a NaN of some type
711 */
712 return vfp_propagate_nan(vdd, vdn, vdm, fpscr);
713 }
714 *vdd = *vdp;
715 return exceptions;
716}
717
718static u32
719vfp_double_add(struct vfp_double *vdd, struct vfp_double *vdn,
720 struct vfp_double *vdm, u32 fpscr)
721{
722 u32 exp_diff;
723 u64 m_sig;
724
725 if (vdn->significand & (1ULL << 63) ||
726 vdm->significand & (1ULL << 63)) {
727 pr_info("VFP: bad FP values in %s\n", __func__);
728 vfp_double_dump("VDN", vdn);
729 vfp_double_dump("VDM", vdm);
730 }
731
732 /*
733 * Ensure that 'n' is the largest magnitude number. Note that
734 * if 'n' and 'm' have equal exponents, we do not swap them.
735 * This ensures that NaN propagation works correctly.
736 */
737 if (vdn->exponent < vdm->exponent) {
738 struct vfp_double *t = vdn;
739 vdn = vdm;
740 vdm = t;
741 }
742
743 /*
744 * Is 'n' an infinity or a NaN? Note that 'm' may be a number,
745 * infinity or a NaN here.
746 */
747 if (vdn->exponent == 2047)
748 return vfp_double_fadd_nonnumber(vdd, vdn, vdm, fpscr);
749
750 /*
751 * We have two proper numbers, where 'vdn' is the larger magnitude.
752 *
753 * Copy 'n' to 'd' before doing the arithmetic.
754 */
755 *vdd = *vdn;
756
757 /*
758 * Align 'm' with the result.
759 */
760 exp_diff = vdn->exponent - vdm->exponent;
761 m_sig = vfp_shiftright64jamming(vdm->significand, exp_diff);
762
763 /*
764 * If the signs are different, we are really subtracting.
765 */
766 if (vdn->sign ^ vdm->sign) {
767 m_sig = vdn->significand - m_sig;
768 if ((s64)m_sig < 0) {
769 vdd->sign = vfp_sign_negate(vdd->sign);
770 m_sig = -m_sig;
771 }
772 } else {
773 m_sig += vdn->significand;
774 }
775 vdd->significand = m_sig;
776
777 return 0;
778}
779
780static u32
781vfp_double_multiply(struct vfp_double *vdd, struct vfp_double *vdn,
782 struct vfp_double *vdm, u32 fpscr)
783{
784 vfp_double_dump("VDN", vdn);
785 vfp_double_dump("VDM", vdm);
786
787 /*
788 * Ensure that 'n' is the largest magnitude number. Note that
789 * if 'n' and 'm' have equal exponents, we do not swap them.
790 * This ensures that NaN propagation works correctly.
791 */
792 if (vdn->exponent < vdm->exponent) {
793 struct vfp_double *t = vdn;
794 vdn = vdm;
795 vdm = t;
796 pr_debug("VFP: swapping M <-> N\n");
797 }
798
799 vdd->sign = vdn->sign ^ vdm->sign;
800
801 /*
802 * If 'n' is an infinity or NaN, handle it. 'm' may be anything.
803 */
804 if (vdn->exponent == 2047) {
805 if (vdn->significand || (vdm->exponent == 2047 && vdm->significand))
806 return vfp_propagate_nan(vdd, vdn, vdm, fpscr);
807 if ((vdm->exponent | vdm->significand) == 0) {
808 *vdd = vfp_double_default_qnan;
809 return FPSCR_IOC;
810 }
811 vdd->exponent = vdn->exponent;
812 vdd->significand = 0;
813 return 0;
814 }
815
816 /*
817 * If 'm' is zero, the result is always zero. In this case,
818 * 'n' may be zero or a number, but it doesn't matter which.
819 */
820 if ((vdm->exponent | vdm->significand) == 0) {
821 vdd->exponent = 0;
822 vdd->significand = 0;
823 return 0;
824 }
825
826 /*
827 * We add 2 to the destination exponent for the same reason
828 * as the addition case - though this time we have +1 from
829 * each input operand.
830 */
831 vdd->exponent = vdn->exponent + vdm->exponent - 1023 + 2;
832 vdd->significand = vfp_hi64multiply64(vdn->significand, vdm->significand);
833
834 vfp_double_dump("VDD", vdd);
835 return 0;
836}
837
838#define NEG_MULTIPLY (1 << 0)
839#define NEG_SUBTRACT (1 << 1)
840
841static u32
842vfp_double_multiply_accumulate(int dd, int dn, int dm, u32 fpscr, u32 negate, char *func)
843{
844 struct vfp_double vdd, vdp, vdn, vdm;
845 u32 exceptions;
846
847 vfp_double_unpack(&vdn, vfp_get_double(dn));
848 if (vdn.exponent == 0 && vdn.significand)
849 vfp_double_normalise_denormal(&vdn);
850
851 vfp_double_unpack(&vdm, vfp_get_double(dm));
852 if (vdm.exponent == 0 && vdm.significand)
853 vfp_double_normalise_denormal(&vdm);
854
855 exceptions = vfp_double_multiply(&vdp, &vdn, &vdm, fpscr);
856 if (negate & NEG_MULTIPLY)
857 vdp.sign = vfp_sign_negate(vdp.sign);
858
859 vfp_double_unpack(&vdn, vfp_get_double(dd));
860 if (negate & NEG_SUBTRACT)
861 vdn.sign = vfp_sign_negate(vdn.sign);
862
863 exceptions |= vfp_double_add(&vdd, &vdn, &vdp, fpscr);
864
865 return vfp_double_normaliseround(dd, &vdd, fpscr, exceptions, func);
866}
867
868/*
869 * Standard operations
870 */
871
872/*
873 * sd = sd + (sn * sm)
874 */
875static u32 vfp_double_fmac(int dd, int dn, int dm, u32 fpscr)
876{
877 return vfp_double_multiply_accumulate(dd, dn, dm, fpscr, 0, "fmac");
878}
879
880/*
881 * sd = sd - (sn * sm)
882 */
883static u32 vfp_double_fnmac(int dd, int dn, int dm, u32 fpscr)
884{
885 return vfp_double_multiply_accumulate(dd, dn, dm, fpscr, NEG_MULTIPLY, "fnmac");
886}
887
888/*
889 * sd = -sd + (sn * sm)
890 */
891static u32 vfp_double_fmsc(int dd, int dn, int dm, u32 fpscr)
892{
893 return vfp_double_multiply_accumulate(dd, dn, dm, fpscr, NEG_SUBTRACT, "fmsc");
894}
895
896/*
897 * sd = -sd - (sn * sm)
898 */
899static u32 vfp_double_fnmsc(int dd, int dn, int dm, u32 fpscr)
900{
901 return vfp_double_multiply_accumulate(dd, dn, dm, fpscr, NEG_SUBTRACT | NEG_MULTIPLY, "fnmsc");
902}
903
904/*
905 * sd = sn * sm
906 */
907static u32 vfp_double_fmul(int dd, int dn, int dm, u32 fpscr)
908{
909 struct vfp_double vdd, vdn, vdm;
910 u32 exceptions;
911
912 vfp_double_unpack(&vdn, vfp_get_double(dn));
913 if (vdn.exponent == 0 && vdn.significand)
914 vfp_double_normalise_denormal(&vdn);
915
916 vfp_double_unpack(&vdm, vfp_get_double(dm));
917 if (vdm.exponent == 0 && vdm.significand)
918 vfp_double_normalise_denormal(&vdm);
919
920 exceptions = vfp_double_multiply(&vdd, &vdn, &vdm, fpscr);
921 return vfp_double_normaliseround(dd, &vdd, fpscr, exceptions, "fmul");
922}
923
924/*
925 * sd = -(sn * sm)
926 */
927static u32 vfp_double_fnmul(int dd, int dn, int dm, u32 fpscr)
928{
929 struct vfp_double vdd, vdn, vdm;
930 u32 exceptions;
931
932 vfp_double_unpack(&vdn, vfp_get_double(dn));
933 if (vdn.exponent == 0 && vdn.significand)
934 vfp_double_normalise_denormal(&vdn);
935
936 vfp_double_unpack(&vdm, vfp_get_double(dm));
937 if (vdm.exponent == 0 && vdm.significand)
938 vfp_double_normalise_denormal(&vdm);
939
940 exceptions = vfp_double_multiply(&vdd, &vdn, &vdm, fpscr);
941 vdd.sign = vfp_sign_negate(vdd.sign);
942
943 return vfp_double_normaliseround(dd, &vdd, fpscr, exceptions, "fnmul");
944}
945
946/*
947 * sd = sn + sm
948 */
949static u32 vfp_double_fadd(int dd, int dn, int dm, u32 fpscr)
950{
951 struct vfp_double vdd, vdn, vdm;
952 u32 exceptions;
953
954 vfp_double_unpack(&vdn, vfp_get_double(dn));
955 if (vdn.exponent == 0 && vdn.significand)
956 vfp_double_normalise_denormal(&vdn);
957
958 vfp_double_unpack(&vdm, vfp_get_double(dm));
959 if (vdm.exponent == 0 && vdm.significand)
960 vfp_double_normalise_denormal(&vdm);
961
962 exceptions = vfp_double_add(&vdd, &vdn, &vdm, fpscr);
963
964 return vfp_double_normaliseround(dd, &vdd, fpscr, exceptions, "fadd");
965}
966
967/*
968 * sd = sn - sm
969 */
970static u32 vfp_double_fsub(int dd, int dn, int dm, u32 fpscr)
971{
972 struct vfp_double vdd, vdn, vdm;
973 u32 exceptions;
974
975 vfp_double_unpack(&vdn, vfp_get_double(dn));
976 if (vdn.exponent == 0 && vdn.significand)
977 vfp_double_normalise_denormal(&vdn);
978
979 vfp_double_unpack(&vdm, vfp_get_double(dm));
980 if (vdm.exponent == 0 && vdm.significand)
981 vfp_double_normalise_denormal(&vdm);
982
983 /*
984 * Subtraction is like addition, but with a negated operand.
985 */
986 vdm.sign = vfp_sign_negate(vdm.sign);
987
988 exceptions = vfp_double_add(&vdd, &vdn, &vdm, fpscr);
989
990 return vfp_double_normaliseround(dd, &vdd, fpscr, exceptions, "fsub");
991}
992
993/*
994 * sd = sn / sm
995 */
996static u32 vfp_double_fdiv(int dd, int dn, int dm, u32 fpscr)
997{
998 struct vfp_double vdd, vdn, vdm;
999 u32 exceptions = 0;
1000 int tm, tn;
1001
1002 vfp_double_unpack(&vdn, vfp_get_double(dn));
1003 vfp_double_unpack(&vdm, vfp_get_double(dm));
1004
1005 vdd.sign = vdn.sign ^ vdm.sign;
1006
1007 tn = vfp_double_type(&vdn);
1008 tm = vfp_double_type(&vdm);
1009
1010 /*
1011 * Is n a NAN?
1012 */
1013 if (tn & VFP_NAN)
1014 goto vdn_nan;
1015
1016 /*
1017 * Is m a NAN?
1018 */
1019 if (tm & VFP_NAN)
1020 goto vdm_nan;
1021
1022 /*
1023 * If n and m are infinity, the result is invalid
1024 * If n and m are zero, the result is invalid
1025 */
1026 if (tm & tn & (VFP_INFINITY|VFP_ZERO))
1027 goto invalid;
1028
1029 /*
1030 * If n is infinity, the result is infinity
1031 */
1032 if (tn & VFP_INFINITY)
1033 goto infinity;
1034
1035 /*
1036 * If m is zero, raise div0 exceptions
1037 */
1038 if (tm & VFP_ZERO)
1039 goto divzero;
1040
1041 /*
1042 * If m is infinity, or n is zero, the result is zero
1043 */
1044 if (tm & VFP_INFINITY || tn & VFP_ZERO)
1045 goto zero;
1046
1047 if (tn & VFP_DENORMAL)
1048 vfp_double_normalise_denormal(&vdn);
1049 if (tm & VFP_DENORMAL)
1050 vfp_double_normalise_denormal(&vdm);
1051
1052 /*
1053 * Ok, we have two numbers, we can perform division.
1054 */
1055 vdd.exponent = vdn.exponent - vdm.exponent + 1023 - 1;
1056 vdm.significand <<= 1;
1057 if (vdm.significand <= (2 * vdn.significand)) {
1058 vdn.significand >>= 1;
1059 vdd.exponent++;
1060 }
1061 vdd.significand = vfp_estimate_div128to64(vdn.significand, 0, vdm.significand);
1062 if ((vdd.significand & 0x1ff) <= 2) {
1063 u64 termh, terml, remh, reml;
1064 mul64to128(&termh, &terml, vdm.significand, vdd.significand);
1065 sub128(&remh, &reml, vdn.significand, 0, termh, terml);
1066 while ((s64)remh < 0) {
1067 vdd.significand -= 1;
1068 add128(&remh, &reml, remh, reml, 0, vdm.significand);
1069 }
1070 vdd.significand |= (reml != 0);
1071 }
1072 return vfp_double_normaliseround(dd, &vdd, fpscr, 0, "fdiv");
1073
1074 vdn_nan:
1075 exceptions = vfp_propagate_nan(&vdd, &vdn, &vdm, fpscr);
1076 pack:
1077 vfp_put_double(dd, vfp_double_pack(&vdd));
1078 return exceptions;
1079
1080 vdm_nan:
1081 exceptions = vfp_propagate_nan(&vdd, &vdm, &vdn, fpscr);
1082 goto pack;
1083
1084 zero:
1085 vdd.exponent = 0;
1086 vdd.significand = 0;
1087 goto pack;
1088
1089 divzero:
1090 exceptions = FPSCR_DZC;
1091 infinity:
1092 vdd.exponent = 2047;
1093 vdd.significand = 0;
1094 goto pack;
1095
1096 invalid:
1097 vfp_put_double(dd, vfp_double_pack(&vfp_double_default_qnan));
1098 return FPSCR_IOC;
1099}
1100
1101static u32 (* const fop_fns[16])(int dd, int dn, int dm, u32 fpscr) = {
1102 [FOP_TO_IDX(FOP_FMAC)] = vfp_double_fmac,
1103 [FOP_TO_IDX(FOP_FNMAC)] = vfp_double_fnmac,
1104 [FOP_TO_IDX(FOP_FMSC)] = vfp_double_fmsc,
1105 [FOP_TO_IDX(FOP_FNMSC)] = vfp_double_fnmsc,
1106 [FOP_TO_IDX(FOP_FMUL)] = vfp_double_fmul,
1107 [FOP_TO_IDX(FOP_FNMUL)] = vfp_double_fnmul,
1108 [FOP_TO_IDX(FOP_FADD)] = vfp_double_fadd,
1109 [FOP_TO_IDX(FOP_FSUB)] = vfp_double_fsub,
1110 [FOP_TO_IDX(FOP_FDIV)] = vfp_double_fdiv,
1111};
1112
1113#define FREG_BANK(x) ((x) & 0x0c)
1114#define FREG_IDX(x) ((x) & 3)
1115
1116u32 vfp_double_cpdo(u32 inst, u32 fpscr)
1117{
1118 u32 op = inst & FOP_MASK;
1119 u32 exceptions = 0;
1120 unsigned int dd = vfp_get_sd(inst);
1121 unsigned int dn = vfp_get_sn(inst);
1122 unsigned int dm = vfp_get_sm(inst);
1123 unsigned int vecitr, veclen, vecstride;
1124 u32 (*fop)(int, int, s32, u32);
1125
1126 veclen = fpscr & FPSCR_LENGTH_MASK;
1127 vecstride = (1 + ((fpscr & FPSCR_STRIDE_MASK) == FPSCR_STRIDE_MASK)) * 2;
1128
1129 /*
1130 * If destination bank is zero, vector length is always '1'.
1131 * ARM DDI0100F C5.1.3, C5.3.2.
1132 */
1133 if (FREG_BANK(dd) == 0)
1134 veclen = 0;
1135
1136 pr_debug("VFP: vecstride=%u veclen=%u\n", vecstride,
1137 (veclen >> FPSCR_LENGTH_BIT) + 1);
1138
1139 fop = (op == FOP_EXT) ? fop_extfns[dn] : fop_fns[FOP_TO_IDX(op)];
1140 if (!fop)
1141 goto invalid;
1142
1143 for (vecitr = 0; vecitr <= veclen; vecitr += 1 << FPSCR_LENGTH_BIT) {
1144 u32 except;
1145
1146 if (op == FOP_EXT)
1147 pr_debug("VFP: itr%d (d%u.%u) = op[%u] (d%u.%u)\n",
1148 vecitr >> FPSCR_LENGTH_BIT,
1149 dd >> 1, dd & 1, dn,
1150 dm >> 1, dm & 1);
1151 else
1152 pr_debug("VFP: itr%d (d%u.%u) = (d%u.%u) op[%u] (d%u.%u)\n",
1153 vecitr >> FPSCR_LENGTH_BIT,
1154 dd >> 1, dd & 1,
1155 dn >> 1, dn & 1,
1156 FOP_TO_IDX(op),
1157 dm >> 1, dm & 1);
1158
1159 except = fop(dd, dn, dm, fpscr);
1160 pr_debug("VFP: itr%d: exceptions=%08x\n",
1161 vecitr >> FPSCR_LENGTH_BIT, except);
1162
1163 exceptions |= except;
1164
1165 /*
1166 * This ensures that comparisons only operate on scalars;
1167 * comparisons always return with one FPSCR status bit set.
1168 */
1169 if (except & (FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V))
1170 break;
1171
1172 /*
1173 * CHECK: It appears to be undefined whether we stop when
1174 * we encounter an exception. We continue.
1175 */
1176
1177 dd = FREG_BANK(dd) + ((FREG_IDX(dd) + vecstride) & 6);
1178 dn = FREG_BANK(dn) + ((FREG_IDX(dn) + vecstride) & 6);
1179 if (FREG_BANK(dm) != 0)
1180 dm = FREG_BANK(dm) + ((FREG_IDX(dm) + vecstride) & 6);
1181 }
1182 return exceptions;
1183
1184 invalid:
1185 return ~0;
1186}
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
new file mode 100644
index 000000000000..de4ca1223c58
--- /dev/null
+++ b/arch/arm/vfp/vfphw.S
@@ -0,0 +1,215 @@
1/*
2 * linux/arch/arm/vfp/vfphw.S
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This code is called from the kernel's undefined instruction trap.
12 * r9 holds the return address for successful handling.
13 * lr holds the return address for unrecognised instructions.
14 * r10 points at the start of the private FP workspace in the thread structure
15 * sp points to a struct pt_regs (as defined in include/asm/proc/ptrace.h)
16 */
17#include <asm/thread_info.h>
18#include <asm/vfpmacros.h>
19#include "../kernel/entry-header.S"
20
21 .macro DBGSTR, str
22#ifdef DEBUG
23 stmfd sp!, {r0-r3, ip, lr}
24 add r0, pc, #4
25 bl printk
26 b 1f
27 .asciz "<7>VFP: \str\n"
28 .balign 4
291: ldmfd sp!, {r0-r3, ip, lr}
30#endif
31 .endm
32
33 .macro DBGSTR1, str, arg
34#ifdef DEBUG
35 stmfd sp!, {r0-r3, ip, lr}
36 mov r1, \arg
37 add r0, pc, #4
38 bl printk
39 b 1f
40 .asciz "<7>VFP: \str\n"
41 .balign 4
421: ldmfd sp!, {r0-r3, ip, lr}
43#endif
44 .endm
45
46 .macro DBGSTR3, str, arg1, arg2, arg3
47#ifdef DEBUG
48 stmfd sp!, {r0-r3, ip, lr}
49 mov r3, \arg3
50 mov r2, \arg2
51 mov r1, \arg1
52 add r0, pc, #4
53 bl printk
54 b 1f
55 .asciz "<7>VFP: \str\n"
56 .balign 4
571: ldmfd sp!, {r0-r3, ip, lr}
58#endif
59 .endm
60
61
62@ VFP hardware support entry point.
63@
64@ r0 = faulted instruction
65@ r2 = faulted PC+4
66@ r9 = successful return
67@ r10 = vfp_state union
68@ lr = failure return
69
70 .globl vfp_support_entry
71vfp_support_entry:
72 DBGSTR3 "instr %08x pc %08x state %p", r0, r2, r10
73
74 VFPFMRX r1, FPEXC @ Is the VFP enabled?
75 DBGSTR1 "fpexc %08x", r1
76 tst r1, #FPEXC_ENABLE
77 bne look_for_VFP_exceptions @ VFP is already enabled
78
79 DBGSTR1 "enable %x", r10
80 ldr r3, last_VFP_context_address
81 orr r1, r1, #FPEXC_ENABLE @ user FPEXC has the enable bit set
82 ldr r4, [r3] @ last_VFP_context pointer
83 bic r5, r1, #FPEXC_EXCEPTION @ make sure exceptions are disabled
84 cmp r4, r10
85 beq check_for_exception @ we are returning to the same
86 @ process, so the registers are
87 @ still there. In this case, we do
88 @ not want to drop a pending exception.
89
90 VFPFMXR FPEXC, r5 @ enable VFP, disable any pending
91 @ exceptions, so we can get at the
92 @ rest of it
93
94 @ Save out the current registers to the old thread state
95
96 DBGSTR1 "save old state %p", r4
97 cmp r4, #0
98 beq no_old_VFP_process
99 VFPFMRX r5, FPSCR @ current status
100 VFPFMRX r6, FPINST @ FPINST (always there, rev0 onwards)
101 tst r1, #FPEXC_FPV2 @ is there an FPINST2 to read?
102 VFPFMRX r8, FPINST2, NE @ FPINST2 if needed - avoids reading
103 @ nonexistant reg on rev0
104 VFPFSTMIA r4 @ save the working registers
105 add r4, r4, #8*16+4
106 stmia r4, {r1, r5, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2
107 @ and point r4 at the word at the
108 @ start of the register dump
109
110no_old_VFP_process:
111 DBGSTR1 "load state %p", r10
112 str r10, [r3] @ update the last_VFP_context pointer
113 @ Load the saved state back into the VFP
114 add r4, r10, #8*16+4
115 ldmia r4, {r1, r5, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2
116 VFPFLDMIA r10 @ reload the working registers while
117 @ FPEXC is in a safe state
118 tst r1, #FPEXC_FPV2 @ is there an FPINST2 to write?
119 VFPFMXR FPINST2, r8, NE @ FPINST2 if needed - avoids writing
120 @ nonexistant reg on rev0
121 VFPFMXR FPINST, r6
122 VFPFMXR FPSCR, r5 @ restore status
123
124check_for_exception:
125 tst r1, #FPEXC_EXCEPTION
126 bne process_exception @ might as well handle the pending
127 @ exception before retrying branch
128 @ out before setting an FPEXC that
129 @ stops us reading stuff
130 VFPFMXR FPEXC, r1 @ restore FPEXC last
131 sub r2, r2, #4
132 str r2, [sp, #S_PC] @ retry the instruction
133 mov pc, r9 @ we think we have handled things
134
135
136look_for_VFP_exceptions:
137 tst r1, #FPEXC_EXCEPTION
138 bne process_exception
139 VFPFMRX r5, FPSCR
140 tst r5, #FPSCR_IXE @ IXE doesn't set FPEXC_EXCEPTION !
141 bne process_exception
142
143 @ Fall into hand on to next handler - appropriate coproc instr
144 @ not recognised by VFP
145
146 DBGSTR "not VFP"
147 mov pc, lr
148
149process_exception:
150 DBGSTR "bounce"
151 sub r2, r2, #4
152 str r2, [sp, #S_PC] @ retry the instruction on exit from
153 @ the imprecise exception handling in
154 @ the support code
155 mov r2, sp @ nothing stacked - regdump is at TOS
156 mov lr, r9 @ setup for a return to the user code.
157
158 @ Now call the C code to package up the bounce to the support code
159 @ r0 holds the trigger instruction
160 @ r1 holds the FPEXC value
161 @ r2 pointer to register dump
162 b VFP9_bounce @ we have handled this - the support
163 @ code will raise an exception if
164 @ required. If not, the user code will
165 @ retry the faulted instruction
166
167last_VFP_context_address:
168 .word last_VFP_context
169
170 .globl vfp_get_float
171vfp_get_float:
172 add pc, pc, r0, lsl #3
173 mov r0, r0
174 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
175 mrc p10, 0, r0, c\dr, c0, 0 @ fmrs r0, s0
176 mov pc, lr
177 mrc p10, 0, r0, c\dr, c0, 4 @ fmrs r0, s1
178 mov pc, lr
179 .endr
180
181 .globl vfp_put_float
182vfp_put_float:
183 add pc, pc, r0, lsl #3
184 mov r0, r0
185 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
186 mcr p10, 0, r1, c\dr, c0, 0 @ fmsr r0, s0
187 mov pc, lr
188 mcr p10, 0, r1, c\dr, c0, 4 @ fmsr r0, s1
189 mov pc, lr
190 .endr
191
192 .globl vfp_get_double
193vfp_get_double:
194 mov r0, r0, lsr #1
195 add pc, pc, r0, lsl #3
196 mov r0, r0
197 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
198 mrrc p10, 1, r0, r1, c\dr @ fmrrd r0, r1, d\dr
199 mov pc, lr
200 .endr
201
202 @ virtual register 16 for compare with zero
203 mov r0, #0
204 mov r1, #0
205 mov pc, lr
206
207 .globl vfp_put_double
208vfp_put_double:
209 mov r0, r0, lsr #1
210 add pc, pc, r0, lsl #3
211 mov r0, r0
212 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
213 mcrr p10, 1, r1, r2, c\dr @ fmrrd r1, r2, d\dr
214 mov pc, lr
215 .endr
diff --git a/arch/arm/vfp/vfpinstr.h b/arch/arm/vfp/vfpinstr.h
new file mode 100644
index 000000000000..6c819aeae006
--- /dev/null
+++ b/arch/arm/vfp/vfpinstr.h
@@ -0,0 +1,88 @@
1/*
2 * linux/arch/arm/vfp/vfpinstr.h
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * VFP instruction masks.
12 */
13#define INST_CPRTDO(inst) (((inst) & 0x0f000000) == 0x0e000000)
14#define INST_CPRT(inst) ((inst) & (1 << 4))
15#define INST_CPRT_L(inst) ((inst) & (1 << 20))
16#define INST_CPRT_Rd(inst) (((inst) & (15 << 12)) >> 12)
17#define INST_CPRT_OP(inst) (((inst) >> 21) & 7)
18#define INST_CPNUM(inst) ((inst) & 0xf00)
19#define CPNUM(cp) ((cp) << 8)
20
21#define FOP_MASK (0x00b00040)
22#define FOP_FMAC (0x00000000)
23#define FOP_FNMAC (0x00000040)
24#define FOP_FMSC (0x00100000)
25#define FOP_FNMSC (0x00100040)
26#define FOP_FMUL (0x00200000)
27#define FOP_FNMUL (0x00200040)
28#define FOP_FADD (0x00300000)
29#define FOP_FSUB (0x00300040)
30#define FOP_FDIV (0x00800000)
31#define FOP_EXT (0x00b00040)
32
33#define FOP_TO_IDX(inst) ((inst & 0x00b00000) >> 20 | (inst & (1 << 6)) >> 4)
34
35#define FEXT_MASK (0x000f0080)
36#define FEXT_FCPY (0x00000000)
37#define FEXT_FABS (0x00000080)
38#define FEXT_FNEG (0x00010000)
39#define FEXT_FSQRT (0x00010080)
40#define FEXT_FCMP (0x00040000)
41#define FEXT_FCMPE (0x00040080)
42#define FEXT_FCMPZ (0x00050000)
43#define FEXT_FCMPEZ (0x00050080)
44#define FEXT_FCVT (0x00070080)
45#define FEXT_FUITO (0x00080000)
46#define FEXT_FSITO (0x00080080)
47#define FEXT_FTOUI (0x000c0000)
48#define FEXT_FTOUIZ (0x000c0080)
49#define FEXT_FTOSI (0x000d0000)
50#define FEXT_FTOSIZ (0x000d0080)
51
52#define FEXT_TO_IDX(inst) ((inst & 0x000f0000) >> 15 | (inst & (1 << 7)) >> 7)
53
54#define vfp_get_sd(inst) ((inst & 0x0000f000) >> 11 | (inst & (1 << 22)) >> 22)
55#define vfp_get_dd(inst) ((inst & 0x0000f000) >> 12)
56#define vfp_get_sm(inst) ((inst & 0x0000000f) << 1 | (inst & (1 << 5)) >> 5)
57#define vfp_get_dm(inst) ((inst & 0x0000000f))
58#define vfp_get_sn(inst) ((inst & 0x000f0000) >> 15 | (inst & (1 << 7)) >> 7)
59#define vfp_get_dn(inst) ((inst & 0x000f0000) >> 16)
60
61#define vfp_single(inst) (((inst) & 0x0000f00) == 0xa00)
62
63#define FPSCR_N (1 << 31)
64#define FPSCR_Z (1 << 30)
65#define FPSCR_C (1 << 29)
66#define FPSCR_V (1 << 28)
67
68/*
69 * Since we aren't building with -mfpu=vfp, we need to code
70 * these instructions using their MRC/MCR equivalents.
71 */
72#define vfpreg(_vfp_) #_vfp_
73
74#define fmrx(_vfp_) ({ \
75 u32 __v; \
76 asm("mrc%? p10, 7, %0, " vfpreg(_vfp_) ", cr0, 0 @ fmrx %0, " #_vfp_ \
77 : "=r" (__v)); \
78 __v; \
79 })
80
81#define fmxr(_vfp_,_var_) \
82 asm("mcr%? p10, 7, %0, " vfpreg(_vfp_) ", cr0, 0 @ fmxr " #_vfp_ ", %0" \
83 : : "r" (_var_))
84
85u32 vfp_single_cpdo(u32 inst, u32 fpscr);
86u32 vfp_single_cprt(u32 inst, u32 fpscr, struct pt_regs *regs);
87
88u32 vfp_double_cpdo(u32 inst, u32 fpscr);
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
new file mode 100644
index 000000000000..3aeedd2afc70
--- /dev/null
+++ b/arch/arm/vfp/vfpmodule.c
@@ -0,0 +1,288 @@
1/*
2 * linux/arch/arm/vfp/vfpmodule.c
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/module.h>
12#include <linux/config.h>
13#include <linux/types.h>
14#include <linux/kernel.h>
15#include <linux/signal.h>
16#include <linux/sched.h>
17#include <linux/init.h>
18#include <asm/vfp.h>
19
20#include "vfpinstr.h"
21#include "vfp.h"
22
23/*
24 * Our undef handlers (in entry.S)
25 */
26void vfp_testing_entry(void);
27void vfp_support_entry(void);
28
29void (*vfp_vector)(void) = vfp_testing_entry;
30union vfp_state *last_VFP_context;
31
32/*
33 * Dual-use variable.
34 * Used in startup: set to non-zero if VFP checks fail
35 * After startup, holds VFP architecture
36 */
37unsigned int VFP_arch;
38
39/*
40 * Per-thread VFP initialisation.
41 */
42void vfp_flush_thread(union vfp_state *vfp)
43{
44 memset(vfp, 0, sizeof(union vfp_state));
45
46 vfp->hard.fpexc = FPEXC_ENABLE;
47 vfp->hard.fpscr = FPSCR_ROUND_NEAREST;
48
49 /*
50 * Disable VFP to ensure we initialise it first.
51 */
52 fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_ENABLE);
53
54 /*
55 * Ensure we don't try to overwrite our newly initialised
56 * state information on the first fault.
57 */
58 if (last_VFP_context == vfp)
59 last_VFP_context = NULL;
60}
61
62/*
63 * Per-thread VFP cleanup.
64 */
65void vfp_release_thread(union vfp_state *vfp)
66{
67 if (last_VFP_context == vfp)
68 last_VFP_context = NULL;
69}
70
71/*
72 * Raise a SIGFPE for the current process.
73 * sicode describes the signal being raised.
74 */
75void vfp_raise_sigfpe(unsigned int sicode, struct pt_regs *regs)
76{
77 siginfo_t info;
78
79 memset(&info, 0, sizeof(info));
80
81 info.si_signo = SIGFPE;
82 info.si_code = sicode;
83 info.si_addr = (void *)(instruction_pointer(regs) - 4);
84
85 /*
86 * This is the same as NWFPE, because it's not clear what
87 * this is used for
88 */
89 current->thread.error_code = 0;
90 current->thread.trap_no = 6;
91
92 force_sig_info(SIGFPE, &info, current);
93}
94
95static void vfp_panic(char *reason)
96{
97 int i;
98
99 printk(KERN_ERR "VFP: Error: %s\n", reason);
100 printk(KERN_ERR "VFP: EXC 0x%08x SCR 0x%08x INST 0x%08x\n",
101 fmrx(FPEXC), fmrx(FPSCR), fmrx(FPINST));
102 for (i = 0; i < 32; i += 2)
103 printk(KERN_ERR "VFP: s%2u: 0x%08x s%2u: 0x%08x\n",
104 i, vfp_get_float(i), i+1, vfp_get_float(i+1));
105}
106
107/*
108 * Process bitmask of exception conditions.
109 */
110static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_regs *regs)
111{
112 int si_code = 0;
113
114 pr_debug("VFP: raising exceptions %08x\n", exceptions);
115
116 if (exceptions == (u32)-1) {
117 vfp_panic("unhandled bounce");
118 vfp_raise_sigfpe(0, regs);
119 return;
120 }
121
122 /*
123 * If any of the status flags are set, update the FPSCR.
124 * Comparison instructions always return at least one of
125 * these flags set.
126 */
127 if (exceptions & (FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V))
128 fpscr &= ~(FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V);
129
130 fpscr |= exceptions;
131
132 fmxr(FPSCR, fpscr);
133
134#define RAISE(stat,en,sig) \
135 if (exceptions & stat && fpscr & en) \
136 si_code = sig;
137
138 /*
139 * These are arranged in priority order, least to highest.
140 */
141 RAISE(FPSCR_IXC, FPSCR_IXE, FPE_FLTRES);
142 RAISE(FPSCR_UFC, FPSCR_UFE, FPE_FLTUND);
143 RAISE(FPSCR_OFC, FPSCR_OFE, FPE_FLTOVF);
144 RAISE(FPSCR_IOC, FPSCR_IOE, FPE_FLTINV);
145
146 if (si_code)
147 vfp_raise_sigfpe(si_code, regs);
148}
149
150/*
151 * Emulate a VFP instruction.
152 */
153static u32 vfp_emulate_instruction(u32 inst, u32 fpscr, struct pt_regs *regs)
154{
155 u32 exceptions = (u32)-1;
156
157 pr_debug("VFP: emulate: INST=0x%08x SCR=0x%08x\n", inst, fpscr);
158
159 if (INST_CPRTDO(inst)) {
160 if (!INST_CPRT(inst)) {
161 /*
162 * CPDO
163 */
164 if (vfp_single(inst)) {
165 exceptions = vfp_single_cpdo(inst, fpscr);
166 } else {
167 exceptions = vfp_double_cpdo(inst, fpscr);
168 }
169 } else {
170 /*
171 * A CPRT instruction can not appear in FPINST2, nor
172 * can it cause an exception. Therefore, we do not
173 * have to emulate it.
174 */
175 }
176 } else {
177 /*
178 * A CPDT instruction can not appear in FPINST2, nor can
179 * it cause an exception. Therefore, we do not have to
180 * emulate it.
181 */
182 }
183 return exceptions;
184}
185
186/*
187 * Package up a bounce condition.
188 */
189void VFP9_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
190{
191 u32 fpscr, orig_fpscr, exceptions, inst;
192
193 pr_debug("VFP: bounce: trigger %08x fpexc %08x\n", trigger, fpexc);
194
195 /*
196 * Enable access to the VFP so we can handle the bounce.
197 */
198 fmxr(FPEXC, fpexc & ~(FPEXC_EXCEPTION|FPEXC_INV|FPEXC_UFC|FPEXC_IOC));
199
200 orig_fpscr = fpscr = fmrx(FPSCR);
201
202 /*
203 * If we are running with inexact exceptions enabled, we need to
204 * emulate the trigger instruction. Note that as we're emulating
205 * the trigger instruction, we need to increment PC.
206 */
207 if (fpscr & FPSCR_IXE) {
208 regs->ARM_pc += 4;
209 goto emulate;
210 }
211
212 barrier();
213
214 /*
215 * Modify fpscr to indicate the number of iterations remaining
216 */
217 if (fpexc & FPEXC_EXCEPTION) {
218 u32 len;
219
220 len = fpexc + (1 << FPEXC_LENGTH_BIT);
221
222 fpscr &= ~FPSCR_LENGTH_MASK;
223 fpscr |= (len & FPEXC_LENGTH_MASK) << (FPSCR_LENGTH_BIT - FPEXC_LENGTH_BIT);
224 }
225
226 /*
227 * Handle the first FP instruction. We used to take note of the
228 * FPEXC bounce reason, but this appears to be unreliable.
229 * Emulate the bounced instruction instead.
230 */
231 inst = fmrx(FPINST);
232 exceptions = vfp_emulate_instruction(inst, fpscr, regs);
233 if (exceptions)
234 vfp_raise_exceptions(exceptions, inst, orig_fpscr, regs);
235
236 /*
237 * If there isn't a second FP instruction, exit now.
238 */
239 if (!(fpexc & FPEXC_FPV2))
240 return;
241
242 /*
243 * The barrier() here prevents fpinst2 being read
244 * before the condition above.
245 */
246 barrier();
247 trigger = fmrx(FPINST2);
248 fpscr = fmrx(FPSCR);
249
250 emulate:
251 exceptions = vfp_emulate_instruction(trigger, fpscr, regs);
252 if (exceptions)
253 vfp_raise_exceptions(exceptions, trigger, orig_fpscr, regs);
254}
255
256/*
257 * VFP support code initialisation.
258 */
259static int __init vfp_init(void)
260{
261 unsigned int vfpsid;
262
263 /*
264 * First check that there is a VFP that we can use.
265 * The handler is already setup to just log calls, so
266 * we just need to read the VFPSID register.
267 */
268 vfpsid = fmrx(FPSID);
269
270 printk(KERN_INFO "VFP support v0.3: ");
271 if (VFP_arch) {
272 printk("not present\n");
273 } else if (vfpsid & FPSID_NODOUBLE) {
274 printk("no double precision support\n");
275 } else {
276 VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */
277 printk("implementor %02x architecture %d part %02x variant %x rev %x\n",
278 (vfpsid & FPSID_IMPLEMENTER_MASK) >> FPSID_IMPLEMENTER_BIT,
279 (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT,
280 (vfpsid & FPSID_PART_MASK) >> FPSID_PART_BIT,
281 (vfpsid & FPSID_VARIANT_MASK) >> FPSID_VARIANT_BIT,
282 (vfpsid & FPSID_REV_MASK) >> FPSID_REV_BIT);
283 vfp_vector = vfp_support_entry;
284 }
285 return 0;
286}
287
288late_initcall(vfp_init);
diff --git a/arch/arm/vfp/vfpsingle.c b/arch/arm/vfp/vfpsingle.c
new file mode 100644
index 000000000000..6849fe35cb2e
--- /dev/null
+++ b/arch/arm/vfp/vfpsingle.c
@@ -0,0 +1,1224 @@
1/*
2 * linux/arch/arm/vfp/vfpsingle.c
3 *
4 * This code is derived in part from John R. Housers softfloat library, which
5 * carries the following notice:
6 *
7 * ===========================================================================
8 * This C source file is part of the SoftFloat IEC/IEEE Floating-point
9 * Arithmetic Package, Release 2.
10 *
11 * Written by John R. Hauser. This work was made possible in part by the
12 * International Computer Science Institute, located at Suite 600, 1947 Center
13 * Street, Berkeley, California 94704. Funding was partially provided by the
14 * National Science Foundation under grant MIP-9311980. The original version
15 * of this code was written as part of a project to build a fixed-point vector
16 * processor in collaboration with the University of California at Berkeley,
17 * overseen by Profs. Nelson Morgan and John Wawrzynek. More information
18 * is available through the web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
19 * arithmetic/softfloat.html'.
20 *
21 * THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
22 * has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
23 * TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
24 * PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
25 * AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
26 *
27 * Derivative works are acceptable, even for commercial purposes, so long as
28 * (1) they include prominent notice that the work is derivative, and (2) they
29 * include prominent notice akin to these three paragraphs for those parts of
30 * this code that are retained.
31 * ===========================================================================
32 */
33#include <linux/kernel.h>
34#include <linux/bitops.h>
35#include <asm/ptrace.h>
36#include <asm/vfp.h>
37
38#include "vfpinstr.h"
39#include "vfp.h"
40
41static struct vfp_single vfp_single_default_qnan = {
42 .exponent = 255,
43 .sign = 0,
44 .significand = VFP_SINGLE_SIGNIFICAND_QNAN,
45};
46
47static void vfp_single_dump(const char *str, struct vfp_single *s)
48{
49 pr_debug("VFP: %s: sign=%d exponent=%d significand=%08x\n",
50 str, s->sign != 0, s->exponent, s->significand);
51}
52
53static void vfp_single_normalise_denormal(struct vfp_single *vs)
54{
55 int bits = 31 - fls(vs->significand);
56
57 vfp_single_dump("normalise_denormal: in", vs);
58
59 if (bits) {
60 vs->exponent -= bits - 1;
61 vs->significand <<= bits;
62 }
63
64 vfp_single_dump("normalise_denormal: out", vs);
65}
66
67#ifndef DEBUG
68#define vfp_single_normaliseround(sd,vsd,fpscr,except,func) __vfp_single_normaliseround(sd,vsd,fpscr,except)
69u32 __vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exceptions)
70#else
71u32 vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exceptions, const char *func)
72#endif
73{
74 u32 significand, incr, rmode;
75 int exponent, shift, underflow;
76
77 vfp_single_dump("pack: in", vs);
78
79 /*
80 * Infinities and NaNs are a special case.
81 */
82 if (vs->exponent == 255 && (vs->significand == 0 || exceptions))
83 goto pack;
84
85 /*
86 * Special-case zero.
87 */
88 if (vs->significand == 0) {
89 vs->exponent = 0;
90 goto pack;
91 }
92
93 exponent = vs->exponent;
94 significand = vs->significand;
95
96 /*
97 * Normalise first. Note that we shift the significand up to
98 * bit 31, so we have VFP_SINGLE_LOW_BITS + 1 below the least
99 * significant bit.
100 */
101 shift = 32 - fls(significand);
102 if (shift < 32 && shift) {
103 exponent -= shift;
104 significand <<= shift;
105 }
106
107#ifdef DEBUG
108 vs->exponent = exponent;
109 vs->significand = significand;
110 vfp_single_dump("pack: normalised", vs);
111#endif
112
113 /*
114 * Tiny number?
115 */
116 underflow = exponent < 0;
117 if (underflow) {
118 significand = vfp_shiftright32jamming(significand, -exponent);
119 exponent = 0;
120#ifdef DEBUG
121 vs->exponent = exponent;
122 vs->significand = significand;
123 vfp_single_dump("pack: tiny number", vs);
124#endif
125 if (!(significand & ((1 << (VFP_SINGLE_LOW_BITS + 1)) - 1)))
126 underflow = 0;
127 }
128
129 /*
130 * Select rounding increment.
131 */
132 incr = 0;
133 rmode = fpscr & FPSCR_RMODE_MASK;
134
135 if (rmode == FPSCR_ROUND_NEAREST) {
136 incr = 1 << VFP_SINGLE_LOW_BITS;
137 if ((significand & (1 << (VFP_SINGLE_LOW_BITS + 1))) == 0)
138 incr -= 1;
139 } else if (rmode == FPSCR_ROUND_TOZERO) {
140 incr = 0;
141 } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vs->sign != 0))
142 incr = (1 << (VFP_SINGLE_LOW_BITS + 1)) - 1;
143
144 pr_debug("VFP: rounding increment = 0x%08x\n", incr);
145
146 /*
147 * Is our rounding going to overflow?
148 */
149 if ((significand + incr) < significand) {
150 exponent += 1;
151 significand = (significand >> 1) | (significand & 1);
152 incr >>= 1;
153#ifdef DEBUG
154 vs->exponent = exponent;
155 vs->significand = significand;
156 vfp_single_dump("pack: overflow", vs);
157#endif
158 }
159
160 /*
161 * If any of the low bits (which will be shifted out of the
162 * number) are non-zero, the result is inexact.
163 */
164 if (significand & ((1 << (VFP_SINGLE_LOW_BITS + 1)) - 1))
165 exceptions |= FPSCR_IXC;
166
167 /*
168 * Do our rounding.
169 */
170 significand += incr;
171
172 /*
173 * Infinity?
174 */
175 if (exponent >= 254) {
176 exceptions |= FPSCR_OFC | FPSCR_IXC;
177 if (incr == 0) {
178 vs->exponent = 253;
179 vs->significand = 0x7fffffff;
180 } else {
181 vs->exponent = 255; /* infinity */
182 vs->significand = 0;
183 }
184 } else {
185 if (significand >> (VFP_SINGLE_LOW_BITS + 1) == 0)
186 exponent = 0;
187 if (exponent || significand > 0x80000000)
188 underflow = 0;
189 if (underflow)
190 exceptions |= FPSCR_UFC;
191 vs->exponent = exponent;
192 vs->significand = significand >> 1;
193 }
194
195 pack:
196 vfp_single_dump("pack: final", vs);
197 {
198 s32 d = vfp_single_pack(vs);
199 pr_debug("VFP: %s: d(s%d)=%08x exceptions=%08x\n", func,
200 sd, d, exceptions);
201 vfp_put_float(sd, d);
202 }
203
204 return exceptions & ~VFP_NAN_FLAG;
205}
206
207/*
208 * Propagate the NaN, setting exceptions if it is signalling.
209 * 'n' is always a NaN. 'm' may be a number, NaN or infinity.
210 */
211static u32
212vfp_propagate_nan(struct vfp_single *vsd, struct vfp_single *vsn,
213 struct vfp_single *vsm, u32 fpscr)
214{
215 struct vfp_single *nan;
216 int tn, tm = 0;
217
218 tn = vfp_single_type(vsn);
219
220 if (vsm)
221 tm = vfp_single_type(vsm);
222
223 if (fpscr & FPSCR_DEFAULT_NAN)
224 /*
225 * Default NaN mode - always returns a quiet NaN
226 */
227 nan = &vfp_single_default_qnan;
228 else {
229 /*
230 * Contemporary mode - select the first signalling
231 * NAN, or if neither are signalling, the first
232 * quiet NAN.
233 */
234 if (tn == VFP_SNAN || (tm != VFP_SNAN && tn == VFP_QNAN))
235 nan = vsn;
236 else
237 nan = vsm;
238 /*
239 * Make the NaN quiet.
240 */
241 nan->significand |= VFP_SINGLE_SIGNIFICAND_QNAN;
242 }
243
244 *vsd = *nan;
245
246 /*
247 * If one was a signalling NAN, raise invalid operation.
248 */
249 return tn == VFP_SNAN || tm == VFP_SNAN ? FPSCR_IOC : VFP_NAN_FLAG;
250}
251
252
253/*
254 * Extended operations
255 */
256static u32 vfp_single_fabs(int sd, int unused, s32 m, u32 fpscr)
257{
258 vfp_put_float(sd, vfp_single_packed_abs(m));
259 return 0;
260}
261
262static u32 vfp_single_fcpy(int sd, int unused, s32 m, u32 fpscr)
263{
264 vfp_put_float(sd, m);
265 return 0;
266}
267
268static u32 vfp_single_fneg(int sd, int unused, s32 m, u32 fpscr)
269{
270 vfp_put_float(sd, vfp_single_packed_negate(m));
271 return 0;
272}
273
274static const u16 sqrt_oddadjust[] = {
275 0x0004, 0x0022, 0x005d, 0x00b1, 0x011d, 0x019f, 0x0236, 0x02e0,
276 0x039c, 0x0468, 0x0545, 0x0631, 0x072b, 0x0832, 0x0946, 0x0a67
277};
278
279static const u16 sqrt_evenadjust[] = {
280 0x0a2d, 0x08af, 0x075a, 0x0629, 0x051a, 0x0429, 0x0356, 0x029e,
281 0x0200, 0x0179, 0x0109, 0x00af, 0x0068, 0x0034, 0x0012, 0x0002
282};
283
284u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand)
285{
286 int index;
287 u32 z, a;
288
289 if ((significand & 0xc0000000) != 0x40000000) {
290 printk(KERN_WARNING "VFP: estimate_sqrt: invalid significand\n");
291 }
292
293 a = significand << 1;
294 index = (a >> 27) & 15;
295 if (exponent & 1) {
296 z = 0x4000 + (a >> 17) - sqrt_oddadjust[index];
297 z = ((a / z) << 14) + (z << 15);
298 a >>= 1;
299 } else {
300 z = 0x8000 + (a >> 17) - sqrt_evenadjust[index];
301 z = a / z + z;
302 z = (z >= 0x20000) ? 0xffff8000 : (z << 15);
303 if (z <= a)
304 return (s32)a >> 1;
305 }
306 return (u32)(((u64)a << 31) / z) + (z >> 1);
307}
308
309static u32 vfp_single_fsqrt(int sd, int unused, s32 m, u32 fpscr)
310{
311 struct vfp_single vsm, vsd;
312 int ret, tm;
313
314 vfp_single_unpack(&vsm, m);
315 tm = vfp_single_type(&vsm);
316 if (tm & (VFP_NAN|VFP_INFINITY)) {
317 struct vfp_single *vsp = &vsd;
318
319 if (tm & VFP_NAN)
320 ret = vfp_propagate_nan(vsp, &vsm, NULL, fpscr);
321 else if (vsm.sign == 0) {
322 sqrt_copy:
323 vsp = &vsm;
324 ret = 0;
325 } else {
326 sqrt_invalid:
327 vsp = &vfp_single_default_qnan;
328 ret = FPSCR_IOC;
329 }
330 vfp_put_float(sd, vfp_single_pack(vsp));
331 return ret;
332 }
333
334 /*
335 * sqrt(+/- 0) == +/- 0
336 */
337 if (tm & VFP_ZERO)
338 goto sqrt_copy;
339
340 /*
341 * Normalise a denormalised number
342 */
343 if (tm & VFP_DENORMAL)
344 vfp_single_normalise_denormal(&vsm);
345
346 /*
347 * sqrt(<0) = invalid
348 */
349 if (vsm.sign)
350 goto sqrt_invalid;
351
352 vfp_single_dump("sqrt", &vsm);
353
354 /*
355 * Estimate the square root.
356 */
357 vsd.sign = 0;
358 vsd.exponent = ((vsm.exponent - 127) >> 1) + 127;
359 vsd.significand = vfp_estimate_sqrt_significand(vsm.exponent, vsm.significand) + 2;
360
361 vfp_single_dump("sqrt estimate", &vsd);
362
363 /*
364 * And now adjust.
365 */
366 if ((vsd.significand & VFP_SINGLE_LOW_BITS_MASK) <= 5) {
367 if (vsd.significand < 2) {
368 vsd.significand = 0xffffffff;
369 } else {
370 u64 term;
371 s64 rem;
372 vsm.significand <<= !(vsm.exponent & 1);
373 term = (u64)vsd.significand * vsd.significand;
374 rem = ((u64)vsm.significand << 32) - term;
375
376 pr_debug("VFP: term=%016llx rem=%016llx\n", term, rem);
377
378 while (rem < 0) {
379 vsd.significand -= 1;
380 rem += ((u64)vsd.significand << 1) | 1;
381 }
382 vsd.significand |= rem != 0;
383 }
384 }
385 vsd.significand = vfp_shiftright32jamming(vsd.significand, 1);
386
387 return vfp_single_normaliseround(sd, &vsd, fpscr, 0, "fsqrt");
388}
389
390/*
391 * Equal := ZC
392 * Less than := N
393 * Greater than := C
394 * Unordered := CV
395 */
396static u32 vfp_compare(int sd, int signal_on_qnan, s32 m, u32 fpscr)
397{
398 s32 d;
399 u32 ret = 0;
400
401 d = vfp_get_float(sd);
402 if (vfp_single_packed_exponent(m) == 255 && vfp_single_packed_mantissa(m)) {
403 ret |= FPSCR_C | FPSCR_V;
404 if (signal_on_qnan || !(vfp_single_packed_mantissa(m) & (1 << (VFP_SINGLE_MANTISSA_BITS - 1))))
405 /*
406 * Signalling NaN, or signalling on quiet NaN
407 */
408 ret |= FPSCR_IOC;
409 }
410
411 if (vfp_single_packed_exponent(d) == 255 && vfp_single_packed_mantissa(d)) {
412 ret |= FPSCR_C | FPSCR_V;
413 if (signal_on_qnan || !(vfp_single_packed_mantissa(d) & (1 << (VFP_SINGLE_MANTISSA_BITS - 1))))
414 /*
415 * Signalling NaN, or signalling on quiet NaN
416 */
417 ret |= FPSCR_IOC;
418 }
419
420 if (ret == 0) {
421 if (d == m || vfp_single_packed_abs(d | m) == 0) {
422 /*
423 * equal
424 */
425 ret |= FPSCR_Z | FPSCR_C;
426 } else if (vfp_single_packed_sign(d ^ m)) {
427 /*
428 * different signs
429 */
430 if (vfp_single_packed_sign(d))
431 /*
432 * d is negative, so d < m
433 */
434 ret |= FPSCR_N;
435 else
436 /*
437 * d is positive, so d > m
438 */
439 ret |= FPSCR_C;
440 } else if ((vfp_single_packed_sign(d) != 0) ^ (d < m)) {
441 /*
442 * d < m
443 */
444 ret |= FPSCR_N;
445 } else if ((vfp_single_packed_sign(d) != 0) ^ (d > m)) {
446 /*
447 * d > m
448 */
449 ret |= FPSCR_C;
450 }
451 }
452 return ret;
453}
454
455static u32 vfp_single_fcmp(int sd, int unused, s32 m, u32 fpscr)
456{
457 return vfp_compare(sd, 0, m, fpscr);
458}
459
460static u32 vfp_single_fcmpe(int sd, int unused, s32 m, u32 fpscr)
461{
462 return vfp_compare(sd, 1, m, fpscr);
463}
464
465static u32 vfp_single_fcmpz(int sd, int unused, s32 m, u32 fpscr)
466{
467 return vfp_compare(sd, 0, 0, fpscr);
468}
469
470static u32 vfp_single_fcmpez(int sd, int unused, s32 m, u32 fpscr)
471{
472 return vfp_compare(sd, 1, 0, fpscr);
473}
474
475static u32 vfp_single_fcvtd(int dd, int unused, s32 m, u32 fpscr)
476{
477 struct vfp_single vsm;
478 struct vfp_double vdd;
479 int tm;
480 u32 exceptions = 0;
481
482 vfp_single_unpack(&vsm, m);
483
484 tm = vfp_single_type(&vsm);
485
486 /*
487 * If we have a signalling NaN, signal invalid operation.
488 */
489 if (tm == VFP_SNAN)
490 exceptions = FPSCR_IOC;
491
492 if (tm & VFP_DENORMAL)
493 vfp_single_normalise_denormal(&vsm);
494
495 vdd.sign = vsm.sign;
496 vdd.significand = (u64)vsm.significand << 32;
497
498 /*
499 * If we have an infinity or NaN, the exponent must be 2047.
500 */
501 if (tm & (VFP_INFINITY|VFP_NAN)) {
502 vdd.exponent = 2047;
503 if (tm & VFP_NAN)
504 vdd.significand |= VFP_DOUBLE_SIGNIFICAND_QNAN;
505 goto pack_nan;
506 } else if (tm & VFP_ZERO)
507 vdd.exponent = 0;
508 else
509 vdd.exponent = vsm.exponent + (1023 - 127);
510
511 /*
512 * Technically, if bit 0 of dd is set, this is an invalid
513 * instruction. However, we ignore this for efficiency.
514 */
515 return vfp_double_normaliseround(dd, &vdd, fpscr, exceptions, "fcvtd");
516
517 pack_nan:
518 vfp_put_double(dd, vfp_double_pack(&vdd));
519 return exceptions;
520}
521
522static u32 vfp_single_fuito(int sd, int unused, s32 m, u32 fpscr)
523{
524 struct vfp_single vs;
525
526 vs.sign = 0;
527 vs.exponent = 127 + 31 - 1;
528 vs.significand = (u32)m;
529
530 return vfp_single_normaliseround(sd, &vs, fpscr, 0, "fuito");
531}
532
533static u32 vfp_single_fsito(int sd, int unused, s32 m, u32 fpscr)
534{
535 struct vfp_single vs;
536
537 vs.sign = (m & 0x80000000) >> 16;
538 vs.exponent = 127 + 31 - 1;
539 vs.significand = vs.sign ? -m : m;
540
541 return vfp_single_normaliseround(sd, &vs, fpscr, 0, "fsito");
542}
543
544static u32 vfp_single_ftoui(int sd, int unused, s32 m, u32 fpscr)
545{
546 struct vfp_single vsm;
547 u32 d, exceptions = 0;
548 int rmode = fpscr & FPSCR_RMODE_MASK;
549 int tm;
550
551 vfp_single_unpack(&vsm, m);
552 vfp_single_dump("VSM", &vsm);
553
554 /*
555 * Do we have a denormalised number?
556 */
557 tm = vfp_single_type(&vsm);
558 if (tm & VFP_DENORMAL)
559 exceptions |= FPSCR_IDC;
560
561 if (tm & VFP_NAN)
562 vsm.sign = 0;
563
564 if (vsm.exponent >= 127 + 32) {
565 d = vsm.sign ? 0 : 0xffffffff;
566 exceptions = FPSCR_IOC;
567 } else if (vsm.exponent >= 127 - 1) {
568 int shift = 127 + 31 - vsm.exponent;
569 u32 rem, incr = 0;
570
571 /*
572 * 2^0 <= m < 2^32-2^8
573 */
574 d = (vsm.significand << 1) >> shift;
575 rem = vsm.significand << (33 - shift);
576
577 if (rmode == FPSCR_ROUND_NEAREST) {
578 incr = 0x80000000;
579 if ((d & 1) == 0)
580 incr -= 1;
581 } else if (rmode == FPSCR_ROUND_TOZERO) {
582 incr = 0;
583 } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vsm.sign != 0)) {
584 incr = ~0;
585 }
586
587 if ((rem + incr) < rem) {
588 if (d < 0xffffffff)
589 d += 1;
590 else
591 exceptions |= FPSCR_IOC;
592 }
593
594 if (d && vsm.sign) {
595 d = 0;
596 exceptions |= FPSCR_IOC;
597 } else if (rem)
598 exceptions |= FPSCR_IXC;
599 } else {
600 d = 0;
601 if (vsm.exponent | vsm.significand) {
602 exceptions |= FPSCR_IXC;
603 if (rmode == FPSCR_ROUND_PLUSINF && vsm.sign == 0)
604 d = 1;
605 else if (rmode == FPSCR_ROUND_MINUSINF && vsm.sign) {
606 d = 0;
607 exceptions |= FPSCR_IOC;
608 }
609 }
610 }
611
612 pr_debug("VFP: ftoui: d(s%d)=%08x exceptions=%08x\n", sd, d, exceptions);
613
614 vfp_put_float(sd, d);
615
616 return exceptions;
617}
618
619static u32 vfp_single_ftouiz(int sd, int unused, s32 m, u32 fpscr)
620{
621 return vfp_single_ftoui(sd, unused, m, FPSCR_ROUND_TOZERO);
622}
623
624static u32 vfp_single_ftosi(int sd, int unused, s32 m, u32 fpscr)
625{
626 struct vfp_single vsm;
627 u32 d, exceptions = 0;
628 int rmode = fpscr & FPSCR_RMODE_MASK;
629
630 vfp_single_unpack(&vsm, m);
631 vfp_single_dump("VSM", &vsm);
632
633 /*
634 * Do we have a denormalised number?
635 */
636 if (vfp_single_type(&vsm) & VFP_DENORMAL)
637 exceptions |= FPSCR_IDC;
638
639 if (vsm.exponent >= 127 + 32) {
640 /*
641 * m >= 2^31-2^7: invalid
642 */
643 d = 0x7fffffff;
644 if (vsm.sign)
645 d = ~d;
646 exceptions |= FPSCR_IOC;
647 } else if (vsm.exponent >= 127 - 1) {
648 int shift = 127 + 31 - vsm.exponent;
649 u32 rem, incr = 0;
650
651 /* 2^0 <= m <= 2^31-2^7 */
652 d = (vsm.significand << 1) >> shift;
653 rem = vsm.significand << (33 - shift);
654
655 if (rmode == FPSCR_ROUND_NEAREST) {
656 incr = 0x80000000;
657 if ((d & 1) == 0)
658 incr -= 1;
659 } else if (rmode == FPSCR_ROUND_TOZERO) {
660 incr = 0;
661 } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vsm.sign != 0)) {
662 incr = ~0;
663 }
664
665 if ((rem + incr) < rem && d < 0xffffffff)
666 d += 1;
667 if (d > 0x7fffffff + (vsm.sign != 0)) {
668 d = 0x7fffffff + (vsm.sign != 0);
669 exceptions |= FPSCR_IOC;
670 } else if (rem)
671 exceptions |= FPSCR_IXC;
672
673 if (vsm.sign)
674 d = -d;
675 } else {
676 d = 0;
677 if (vsm.exponent | vsm.significand) {
678 exceptions |= FPSCR_IXC;
679 if (rmode == FPSCR_ROUND_PLUSINF && vsm.sign == 0)
680 d = 1;
681 else if (rmode == FPSCR_ROUND_MINUSINF && vsm.sign)
682 d = -1;
683 }
684 }
685
686 pr_debug("VFP: ftosi: d(s%d)=%08x exceptions=%08x\n", sd, d, exceptions);
687
688 vfp_put_float(sd, (s32)d);
689
690 return exceptions;
691}
692
693static u32 vfp_single_ftosiz(int sd, int unused, s32 m, u32 fpscr)
694{
695 return vfp_single_ftosi(sd, unused, m, FPSCR_ROUND_TOZERO);
696}
697
698static u32 (* const fop_extfns[32])(int sd, int unused, s32 m, u32 fpscr) = {
699 [FEXT_TO_IDX(FEXT_FCPY)] = vfp_single_fcpy,
700 [FEXT_TO_IDX(FEXT_FABS)] = vfp_single_fabs,
701 [FEXT_TO_IDX(FEXT_FNEG)] = vfp_single_fneg,
702 [FEXT_TO_IDX(FEXT_FSQRT)] = vfp_single_fsqrt,
703 [FEXT_TO_IDX(FEXT_FCMP)] = vfp_single_fcmp,
704 [FEXT_TO_IDX(FEXT_FCMPE)] = vfp_single_fcmpe,
705 [FEXT_TO_IDX(FEXT_FCMPZ)] = vfp_single_fcmpz,
706 [FEXT_TO_IDX(FEXT_FCMPEZ)] = vfp_single_fcmpez,
707 [FEXT_TO_IDX(FEXT_FCVT)] = vfp_single_fcvtd,
708 [FEXT_TO_IDX(FEXT_FUITO)] = vfp_single_fuito,
709 [FEXT_TO_IDX(FEXT_FSITO)] = vfp_single_fsito,
710 [FEXT_TO_IDX(FEXT_FTOUI)] = vfp_single_ftoui,
711 [FEXT_TO_IDX(FEXT_FTOUIZ)] = vfp_single_ftouiz,
712 [FEXT_TO_IDX(FEXT_FTOSI)] = vfp_single_ftosi,
713 [FEXT_TO_IDX(FEXT_FTOSIZ)] = vfp_single_ftosiz,
714};
715
716
717
718
719
720static u32
721vfp_single_fadd_nonnumber(struct vfp_single *vsd, struct vfp_single *vsn,
722 struct vfp_single *vsm, u32 fpscr)
723{
724 struct vfp_single *vsp;
725 u32 exceptions = 0;
726 int tn, tm;
727
728 tn = vfp_single_type(vsn);
729 tm = vfp_single_type(vsm);
730
731 if (tn & tm & VFP_INFINITY) {
732 /*
733 * Two infinities. Are they different signs?
734 */
735 if (vsn->sign ^ vsm->sign) {
736 /*
737 * different signs -> invalid
738 */
739 exceptions = FPSCR_IOC;
740 vsp = &vfp_single_default_qnan;
741 } else {
742 /*
743 * same signs -> valid
744 */
745 vsp = vsn;
746 }
747 } else if (tn & VFP_INFINITY && tm & VFP_NUMBER) {
748 /*
749 * One infinity and one number -> infinity
750 */
751 vsp = vsn;
752 } else {
753 /*
754 * 'n' is a NaN of some type
755 */
756 return vfp_propagate_nan(vsd, vsn, vsm, fpscr);
757 }
758 *vsd = *vsp;
759 return exceptions;
760}
761
762static u32
763vfp_single_add(struct vfp_single *vsd, struct vfp_single *vsn,
764 struct vfp_single *vsm, u32 fpscr)
765{
766 u32 exp_diff, m_sig;
767
768 if (vsn->significand & 0x80000000 ||
769 vsm->significand & 0x80000000) {
770 pr_info("VFP: bad FP values in %s\n", __func__);
771 vfp_single_dump("VSN", vsn);
772 vfp_single_dump("VSM", vsm);
773 }
774
775 /*
776 * Ensure that 'n' is the largest magnitude number. Note that
777 * if 'n' and 'm' have equal exponents, we do not swap them.
778 * This ensures that NaN propagation works correctly.
779 */
780 if (vsn->exponent < vsm->exponent) {
781 struct vfp_single *t = vsn;
782 vsn = vsm;
783 vsm = t;
784 }
785
786 /*
787 * Is 'n' an infinity or a NaN? Note that 'm' may be a number,
788 * infinity or a NaN here.
789 */
790 if (vsn->exponent == 255)
791 return vfp_single_fadd_nonnumber(vsd, vsn, vsm, fpscr);
792
793 /*
794 * We have two proper numbers, where 'vsn' is the larger magnitude.
795 *
796 * Copy 'n' to 'd' before doing the arithmetic.
797 */
798 *vsd = *vsn;
799
800 /*
801 * Align both numbers.
802 */
803 exp_diff = vsn->exponent - vsm->exponent;
804 m_sig = vfp_shiftright32jamming(vsm->significand, exp_diff);
805
806 /*
807 * If the signs are different, we are really subtracting.
808 */
809 if (vsn->sign ^ vsm->sign) {
810 m_sig = vsn->significand - m_sig;
811 if ((s32)m_sig < 0) {
812 vsd->sign = vfp_sign_negate(vsd->sign);
813 m_sig = -m_sig;
814 } else if (m_sig == 0) {
815 vsd->sign = (fpscr & FPSCR_RMODE_MASK) ==
816 FPSCR_ROUND_MINUSINF ? 0x8000 : 0;
817 }
818 } else {
819 m_sig = vsn->significand + m_sig;
820 }
821 vsd->significand = m_sig;
822
823 return 0;
824}
825
826static u32
827vfp_single_multiply(struct vfp_single *vsd, struct vfp_single *vsn, struct vfp_single *vsm, u32 fpscr)
828{
829 vfp_single_dump("VSN", vsn);
830 vfp_single_dump("VSM", vsm);
831
832 /*
833 * Ensure that 'n' is the largest magnitude number. Note that
834 * if 'n' and 'm' have equal exponents, we do not swap them.
835 * This ensures that NaN propagation works correctly.
836 */
837 if (vsn->exponent < vsm->exponent) {
838 struct vfp_single *t = vsn;
839 vsn = vsm;
840 vsm = t;
841 pr_debug("VFP: swapping M <-> N\n");
842 }
843
844 vsd->sign = vsn->sign ^ vsm->sign;
845
846 /*
847 * If 'n' is an infinity or NaN, handle it. 'm' may be anything.
848 */
849 if (vsn->exponent == 255) {
850 if (vsn->significand || (vsm->exponent == 255 && vsm->significand))
851 return vfp_propagate_nan(vsd, vsn, vsm, fpscr);
852 if ((vsm->exponent | vsm->significand) == 0) {
853 *vsd = vfp_single_default_qnan;
854 return FPSCR_IOC;
855 }
856 vsd->exponent = vsn->exponent;
857 vsd->significand = 0;
858 return 0;
859 }
860
861 /*
862 * If 'm' is zero, the result is always zero. In this case,
863 * 'n' may be zero or a number, but it doesn't matter which.
864 */
865 if ((vsm->exponent | vsm->significand) == 0) {
866 vsd->exponent = 0;
867 vsd->significand = 0;
868 return 0;
869 }
870
871 /*
872 * We add 2 to the destination exponent for the same reason as
873 * the addition case - though this time we have +1 from each
874 * input operand.
875 */
876 vsd->exponent = vsn->exponent + vsm->exponent - 127 + 2;
877 vsd->significand = vfp_hi64to32jamming((u64)vsn->significand * vsm->significand);
878
879 vfp_single_dump("VSD", vsd);
880 return 0;
881}
882
883#define NEG_MULTIPLY (1 << 0)
884#define NEG_SUBTRACT (1 << 1)
885
886static u32
887vfp_single_multiply_accumulate(int sd, int sn, s32 m, u32 fpscr, u32 negate, char *func)
888{
889 struct vfp_single vsd, vsp, vsn, vsm;
890 u32 exceptions;
891 s32 v;
892
893 v = vfp_get_float(sn);
894 pr_debug("VFP: s%u = %08x\n", sn, v);
895 vfp_single_unpack(&vsn, v);
896 if (vsn.exponent == 0 && vsn.significand)
897 vfp_single_normalise_denormal(&vsn);
898
899 vfp_single_unpack(&vsm, m);
900 if (vsm.exponent == 0 && vsm.significand)
901 vfp_single_normalise_denormal(&vsm);
902
903 exceptions = vfp_single_multiply(&vsp, &vsn, &vsm, fpscr);
904 if (negate & NEG_MULTIPLY)
905 vsp.sign = vfp_sign_negate(vsp.sign);
906
907 v = vfp_get_float(sd);
908 pr_debug("VFP: s%u = %08x\n", sd, v);
909 vfp_single_unpack(&vsn, v);
910 if (negate & NEG_SUBTRACT)
911 vsn.sign = vfp_sign_negate(vsn.sign);
912
913 exceptions |= vfp_single_add(&vsd, &vsn, &vsp, fpscr);
914
915 return vfp_single_normaliseround(sd, &vsd, fpscr, exceptions, func);
916}
917
918/*
919 * Standard operations
920 */
921
922/*
923 * sd = sd + (sn * sm)
924 */
925static u32 vfp_single_fmac(int sd, int sn, s32 m, u32 fpscr)
926{
927 return vfp_single_multiply_accumulate(sd, sn, m, fpscr, 0, "fmac");
928}
929
930/*
931 * sd = sd - (sn * sm)
932 */
933static u32 vfp_single_fnmac(int sd, int sn, s32 m, u32 fpscr)
934{
935 return vfp_single_multiply_accumulate(sd, sn, m, fpscr, NEG_MULTIPLY, "fnmac");
936}
937
938/*
939 * sd = -sd + (sn * sm)
940 */
941static u32 vfp_single_fmsc(int sd, int sn, s32 m, u32 fpscr)
942{
943 return vfp_single_multiply_accumulate(sd, sn, m, fpscr, NEG_SUBTRACT, "fmsc");
944}
945
946/*
947 * sd = -sd - (sn * sm)
948 */
949static u32 vfp_single_fnmsc(int sd, int sn, s32 m, u32 fpscr)
950{
951 return vfp_single_multiply_accumulate(sd, sn, m, fpscr, NEG_SUBTRACT | NEG_MULTIPLY, "fnmsc");
952}
953
954/*
955 * sd = sn * sm
956 */
957static u32 vfp_single_fmul(int sd, int sn, s32 m, u32 fpscr)
958{
959 struct vfp_single vsd, vsn, vsm;
960 u32 exceptions;
961 s32 n = vfp_get_float(sn);
962
963 pr_debug("VFP: s%u = %08x\n", sn, n);
964
965 vfp_single_unpack(&vsn, n);
966 if (vsn.exponent == 0 && vsn.significand)
967 vfp_single_normalise_denormal(&vsn);
968
969 vfp_single_unpack(&vsm, m);
970 if (vsm.exponent == 0 && vsm.significand)
971 vfp_single_normalise_denormal(&vsm);
972
973 exceptions = vfp_single_multiply(&vsd, &vsn, &vsm, fpscr);
974 return vfp_single_normaliseround(sd, &vsd, fpscr, exceptions, "fmul");
975}
976
977/*
978 * sd = -(sn * sm)
979 */
980static u32 vfp_single_fnmul(int sd, int sn, s32 m, u32 fpscr)
981{
982 struct vfp_single vsd, vsn, vsm;
983 u32 exceptions;
984 s32 n = vfp_get_float(sn);
985
986 pr_debug("VFP: s%u = %08x\n", sn, n);
987
988 vfp_single_unpack(&vsn, n);
989 if (vsn.exponent == 0 && vsn.significand)
990 vfp_single_normalise_denormal(&vsn);
991
992 vfp_single_unpack(&vsm, m);
993 if (vsm.exponent == 0 && vsm.significand)
994 vfp_single_normalise_denormal(&vsm);
995
996 exceptions = vfp_single_multiply(&vsd, &vsn, &vsm, fpscr);
997 vsd.sign = vfp_sign_negate(vsd.sign);
998 return vfp_single_normaliseround(sd, &vsd, fpscr, exceptions, "fnmul");
999}
1000
1001/*
1002 * sd = sn + sm
1003 */
1004static u32 vfp_single_fadd(int sd, int sn, s32 m, u32 fpscr)
1005{
1006 struct vfp_single vsd, vsn, vsm;
1007 u32 exceptions;
1008 s32 n = vfp_get_float(sn);
1009
1010 pr_debug("VFP: s%u = %08x\n", sn, n);
1011
1012 /*
1013 * Unpack and normalise denormals.
1014 */
1015 vfp_single_unpack(&vsn, n);
1016 if (vsn.exponent == 0 && vsn.significand)
1017 vfp_single_normalise_denormal(&vsn);
1018
1019 vfp_single_unpack(&vsm, m);
1020 if (vsm.exponent == 0 && vsm.significand)
1021 vfp_single_normalise_denormal(&vsm);
1022
1023 exceptions = vfp_single_add(&vsd, &vsn, &vsm, fpscr);
1024
1025 return vfp_single_normaliseround(sd, &vsd, fpscr, exceptions, "fadd");
1026}
1027
1028/*
1029 * sd = sn - sm
1030 */
1031static u32 vfp_single_fsub(int sd, int sn, s32 m, u32 fpscr)
1032{
1033 /*
1034 * Subtraction is addition with one sign inverted.
1035 */
1036 return vfp_single_fadd(sd, sn, vfp_single_packed_negate(m), fpscr);
1037}
1038
1039/*
1040 * sd = sn / sm
1041 */
1042static u32 vfp_single_fdiv(int sd, int sn, s32 m, u32 fpscr)
1043{
1044 struct vfp_single vsd, vsn, vsm;
1045 u32 exceptions = 0;
1046 s32 n = vfp_get_float(sn);
1047 int tm, tn;
1048
1049 pr_debug("VFP: s%u = %08x\n", sn, n);
1050
1051 vfp_single_unpack(&vsn, n);
1052 vfp_single_unpack(&vsm, m);
1053
1054 vsd.sign = vsn.sign ^ vsm.sign;
1055
1056 tn = vfp_single_type(&vsn);
1057 tm = vfp_single_type(&vsm);
1058
1059 /*
1060 * Is n a NAN?
1061 */
1062 if (tn & VFP_NAN)
1063 goto vsn_nan;
1064
1065 /*
1066 * Is m a NAN?
1067 */
1068 if (tm & VFP_NAN)
1069 goto vsm_nan;
1070
1071 /*
1072 * If n and m are infinity, the result is invalid
1073 * If n and m are zero, the result is invalid
1074 */
1075 if (tm & tn & (VFP_INFINITY|VFP_ZERO))
1076 goto invalid;
1077
1078 /*
1079 * If n is infinity, the result is infinity
1080 */
1081 if (tn & VFP_INFINITY)
1082 goto infinity;
1083
1084 /*
1085 * If m is zero, raise div0 exception
1086 */
1087 if (tm & VFP_ZERO)
1088 goto divzero;
1089
1090 /*
1091 * If m is infinity, or n is zero, the result is zero
1092 */
1093 if (tm & VFP_INFINITY || tn & VFP_ZERO)
1094 goto zero;
1095
1096 if (tn & VFP_DENORMAL)
1097 vfp_single_normalise_denormal(&vsn);
1098 if (tm & VFP_DENORMAL)
1099 vfp_single_normalise_denormal(&vsm);
1100
1101 /*
1102 * Ok, we have two numbers, we can perform division.
1103 */
1104 vsd.exponent = vsn.exponent - vsm.exponent + 127 - 1;
1105 vsm.significand <<= 1;
1106 if (vsm.significand <= (2 * vsn.significand)) {
1107 vsn.significand >>= 1;
1108 vsd.exponent++;
1109 }
1110 vsd.significand = ((u64)vsn.significand << 32) / vsm.significand;
1111 if ((vsd.significand & 0x3f) == 0)
1112 vsd.significand |= ((u64)vsm.significand * vsd.significand != (u64)vsn.significand << 32);
1113
1114 return vfp_single_normaliseround(sd, &vsd, fpscr, 0, "fdiv");
1115
1116 vsn_nan:
1117 exceptions = vfp_propagate_nan(&vsd, &vsn, &vsm, fpscr);
1118 pack:
1119 vfp_put_float(sd, vfp_single_pack(&vsd));
1120 return exceptions;
1121
1122 vsm_nan:
1123 exceptions = vfp_propagate_nan(&vsd, &vsm, &vsn, fpscr);
1124 goto pack;
1125
1126 zero:
1127 vsd.exponent = 0;
1128 vsd.significand = 0;
1129 goto pack;
1130
1131 divzero:
1132 exceptions = FPSCR_DZC;
1133 infinity:
1134 vsd.exponent = 255;
1135 vsd.significand = 0;
1136 goto pack;
1137
1138 invalid:
1139 vfp_put_float(sd, vfp_single_pack(&vfp_single_default_qnan));
1140 return FPSCR_IOC;
1141}
1142
1143static u32 (* const fop_fns[16])(int sd, int sn, s32 m, u32 fpscr) = {
1144 [FOP_TO_IDX(FOP_FMAC)] = vfp_single_fmac,
1145 [FOP_TO_IDX(FOP_FNMAC)] = vfp_single_fnmac,
1146 [FOP_TO_IDX(FOP_FMSC)] = vfp_single_fmsc,
1147 [FOP_TO_IDX(FOP_FNMSC)] = vfp_single_fnmsc,
1148 [FOP_TO_IDX(FOP_FMUL)] = vfp_single_fmul,
1149 [FOP_TO_IDX(FOP_FNMUL)] = vfp_single_fnmul,
1150 [FOP_TO_IDX(FOP_FADD)] = vfp_single_fadd,
1151 [FOP_TO_IDX(FOP_FSUB)] = vfp_single_fsub,
1152 [FOP_TO_IDX(FOP_FDIV)] = vfp_single_fdiv,
1153};
1154
1155#define FREG_BANK(x) ((x) & 0x18)
1156#define FREG_IDX(x) ((x) & 7)
1157
1158u32 vfp_single_cpdo(u32 inst, u32 fpscr)
1159{
1160 u32 op = inst & FOP_MASK;
1161 u32 exceptions = 0;
1162 unsigned int sd = vfp_get_sd(inst);
1163 unsigned int sn = vfp_get_sn(inst);
1164 unsigned int sm = vfp_get_sm(inst);
1165 unsigned int vecitr, veclen, vecstride;
1166 u32 (*fop)(int, int, s32, u32);
1167
1168 veclen = fpscr & FPSCR_LENGTH_MASK;
1169 vecstride = 1 + ((fpscr & FPSCR_STRIDE_MASK) == FPSCR_STRIDE_MASK);
1170
1171 /*
1172 * If destination bank is zero, vector length is always '1'.
1173 * ARM DDI0100F C5.1.3, C5.3.2.
1174 */
1175 if (FREG_BANK(sd) == 0)
1176 veclen = 0;
1177
1178 pr_debug("VFP: vecstride=%u veclen=%u\n", vecstride,
1179 (veclen >> FPSCR_LENGTH_BIT) + 1);
1180
1181 fop = (op == FOP_EXT) ? fop_extfns[sn] : fop_fns[FOP_TO_IDX(op)];
1182 if (!fop)
1183 goto invalid;
1184
1185 for (vecitr = 0; vecitr <= veclen; vecitr += 1 << FPSCR_LENGTH_BIT) {
1186 s32 m = vfp_get_float(sm);
1187 u32 except;
1188
1189 if (op == FOP_EXT)
1190 pr_debug("VFP: itr%d (s%u) = op[%u] (s%u=%08x)\n",
1191 vecitr >> FPSCR_LENGTH_BIT, sd, sn, sm, m);
1192 else
1193 pr_debug("VFP: itr%d (s%u) = (s%u) op[%u] (s%u=%08x)\n",
1194 vecitr >> FPSCR_LENGTH_BIT, sd, sn,
1195 FOP_TO_IDX(op), sm, m);
1196
1197 except = fop(sd, sn, m, fpscr);
1198 pr_debug("VFP: itr%d: exceptions=%08x\n",
1199 vecitr >> FPSCR_LENGTH_BIT, except);
1200
1201 exceptions |= except;
1202
1203 /*
1204 * This ensures that comparisons only operate on scalars;
1205 * comparisons always return with one FPSCR status bit set.
1206 */
1207 if (except & (FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V))
1208 break;
1209
1210 /*
1211 * CHECK: It appears to be undefined whether we stop when
1212 * we encounter an exception. We continue.
1213 */
1214
1215 sd = FREG_BANK(sd) + ((FREG_IDX(sd) + vecstride) & 7);
1216 sn = FREG_BANK(sn) + ((FREG_IDX(sn) + vecstride) & 7);
1217 if (FREG_BANK(sm) != 0)
1218 sm = FREG_BANK(sm) + ((FREG_IDX(sm) + vecstride) & 7);
1219 }
1220 return exceptions;
1221
1222 invalid:
1223 return (u32)-1;
1224}