aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-arm
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-arm')
-rw-r--r--include/asm-arm/a.out.h39
-rw-r--r--include/asm-arm/apm.h65
-rw-r--r--include/asm-arm/arch-cl7500/acornfb.h34
-rw-r--r--include/asm-arm/arch-cl7500/debug-macro.S31
-rw-r--r--include/asm-arm/arch-cl7500/dma.h22
-rw-r--r--include/asm-arm/arch-cl7500/entry-macro.S3
-rw-r--r--include/asm-arm/arch-cl7500/hardware.h71
-rw-r--r--include/asm-arm/arch-cl7500/io.h253
-rw-r--r--include/asm-arm/arch-cl7500/irq.h32
-rw-r--r--include/asm-arm/arch-cl7500/irqs.h66
-rw-r--r--include/asm-arm/arch-cl7500/memory.h29
-rw-r--r--include/asm-arm/arch-cl7500/param.h5
-rw-r--r--include/asm-arm/arch-cl7500/system.h23
-rw-r--r--include/asm-arm/arch-cl7500/timex.h13
-rw-r--r--include/asm-arm/arch-cl7500/uncompress.h43
-rw-r--r--include/asm-arm/arch-cl7500/vmalloc.h15
-rw-r--r--include/asm-arm/arch-clps711x/autcpu12.h78
-rw-r--r--include/asm-arm/arch-clps711x/debug-macro.S46
-rw-r--r--include/asm-arm/arch-clps711x/dma.h28
-rw-r--r--include/asm-arm/arch-clps711x/entry-macro.S51
-rw-r--r--include/asm-arm/arch-clps711x/hardware.h238
-rw-r--r--include/asm-arm/arch-clps711x/io.h37
-rw-r--r--include/asm-arm/arch-clps711x/irqs.h53
-rw-r--r--include/asm-arm/arch-clps711x/memory.h128
-rw-r--r--include/asm-arm/arch-clps711x/param.h19
-rw-r--r--include/asm-arm/arch-clps711x/syspld.h121
-rw-r--r--include/asm-arm/arch-clps711x/system.h38
-rw-r--r--include/asm-arm/arch-clps711x/time.h48
-rw-r--r--include/asm-arm/arch-clps711x/timex.h23
-rw-r--r--include/asm-arm/arch-clps711x/uncompress.h67
-rw-r--r--include/asm-arm/arch-clps711x/vmalloc.h31
-rw-r--r--include/asm-arm/arch-ebsa110/debug-macro.S34
-rw-r--r--include/asm-arm/arch-ebsa110/dma.h19
-rw-r--r--include/asm-arm/arch-ebsa110/entry-macro.S33
-rw-r--r--include/asm-arm/arch-ebsa110/hardware.h66
-rw-r--r--include/asm-arm/arch-ebsa110/io.h78
-rw-r--r--include/asm-arm/arch-ebsa110/irqs.h20
-rw-r--r--include/asm-arm/arch-ebsa110/memory.h31
-rw-r--r--include/asm-arm/arch-ebsa110/param.h4
-rw-r--r--include/asm-arm/arch-ebsa110/system.h39
-rw-r--r--include/asm-arm/arch-ebsa110/timex.h19
-rw-r--r--include/asm-arm/arch-ebsa110/uncompress.h44
-rw-r--r--include/asm-arm/arch-ebsa110/vmalloc.h21
-rw-r--r--include/asm-arm/arch-ebsa285/debug-macro.S66
-rw-r--r--include/asm-arm/arch-ebsa285/dma.h30
-rw-r--r--include/asm-arm/arch-ebsa285/entry-macro.S105
-rw-r--r--include/asm-arm/arch-ebsa285/hardware.h139
-rw-r--r--include/asm-arm/arch-ebsa285/io.h45
-rw-r--r--include/asm-arm/arch-ebsa285/irqs.h98
-rw-r--r--include/asm-arm/arch-ebsa285/memory.h75
-rw-r--r--include/asm-arm/arch-ebsa285/param.h3
-rw-r--r--include/asm-arm/arch-ebsa285/system.h69
-rw-r--r--include/asm-arm/arch-ebsa285/timex.h18
-rw-r--r--include/asm-arm/arch-ebsa285/uncompress.h46
-rw-r--r--include/asm-arm/arch-ebsa285/vmalloc.h26
-rw-r--r--include/asm-arm/arch-epxa10db/debug-macro.S41
-rw-r--r--include/asm-arm/arch-epxa10db/dma.h28
-rw-r--r--include/asm-arm/arch-epxa10db/entry-macro.S25
-rw-r--r--include/asm-arm/arch-epxa10db/ether00.h482
-rw-r--r--include/asm-arm/arch-epxa10db/excalibur.h91
-rw-r--r--include/asm-arm/arch-epxa10db/hardware.h64
-rw-r--r--include/asm-arm/arch-epxa10db/int_ctrl00.h288
-rw-r--r--include/asm-arm/arch-epxa10db/io.h39
-rw-r--r--include/asm-arm/arch-epxa10db/irqs.h45
-rw-r--r--include/asm-arm/arch-epxa10db/memory.h38
-rw-r--r--include/asm-arm/arch-epxa10db/mode_ctrl00.h80
-rw-r--r--include/asm-arm/arch-epxa10db/param.h19
-rw-r--r--include/asm-arm/arch-epxa10db/platform.h7
-rw-r--r--include/asm-arm/arch-epxa10db/pld_conf00.h73
-rw-r--r--include/asm-arm/arch-epxa10db/system.h41
-rw-r--r--include/asm-arm/arch-epxa10db/tdkphy.h209
-rw-r--r--include/asm-arm/arch-epxa10db/timer00.h98
-rw-r--r--include/asm-arm/arch-epxa10db/timex.h26
-rw-r--r--include/asm-arm/arch-epxa10db/uart00.h181
-rw-r--r--include/asm-arm/arch-epxa10db/uncompress.h54
-rw-r--r--include/asm-arm/arch-epxa10db/vmalloc.h31
-rw-r--r--include/asm-arm/arch-h720x/boards.h53
-rw-r--r--include/asm-arm/arch-h720x/debug-macro.S40
-rw-r--r--include/asm-arm/arch-h720x/dma.h26
-rw-r--r--include/asm-arm/arch-h720x/entry-macro.S60
-rw-r--r--include/asm-arm/arch-h720x/h7201-regs.h67
-rw-r--r--include/asm-arm/arch-h720x/h7202-regs.h155
-rw-r--r--include/asm-arm/arch-h720x/hardware.h192
-rw-r--r--include/asm-arm/arch-h720x/io.h24
-rw-r--r--include/asm-arm/arch-h720x/irq.h14
-rw-r--r--include/asm-arm/arch-h720x/irqs.h116
-rw-r--r--include/asm-arm/arch-h720x/memory.h31
-rw-r--r--include/asm-arm/arch-h720x/param.h10
-rw-r--r--include/asm-arm/arch-h720x/system.h31
-rw-r--r--include/asm-arm/arch-h720x/timex.h15
-rw-r--r--include/asm-arm/arch-h720x/uncompress.h39
-rw-r--r--include/asm-arm/arch-h720x/vmalloc.h21
-rw-r--r--include/asm-arm/arch-imx/debug-macro.S34
-rw-r--r--include/asm-arm/arch-imx/dma.h71
-rw-r--r--include/asm-arm/arch-imx/entry-macro.S29
-rw-r--r--include/asm-arm/arch-imx/hardware.h99
-rw-r--r--include/asm-arm/arch-imx/imx-regs.h548
-rw-r--r--include/asm-arm/arch-imx/io.h28
-rw-r--r--include/asm-arm/arch-imx/irq.h20
-rw-r--r--include/asm-arm/arch-imx/irqs.h116
-rw-r--r--include/asm-arm/arch-imx/memory.h38
-rw-r--r--include/asm-arm/arch-imx/mx1ads.h36
-rw-r--r--include/asm-arm/arch-imx/param.h19
-rw-r--r--include/asm-arm/arch-imx/system.h40
-rw-r--r--include/asm-arm/arch-imx/timex.h27
-rw-r--r--include/asm-arm/arch-imx/uncompress.h78
-rw-r--r--include/asm-arm/arch-imx/vmalloc.h32
-rw-r--r--include/asm-arm/arch-integrator/bits.h61
-rw-r--r--include/asm-arm/arch-integrator/cm.h36
-rw-r--r--include/asm-arm/arch-integrator/debug-macro.S38
-rw-r--r--include/asm-arm/arch-integrator/dma.h28
-rw-r--r--include/asm-arm/arch-integrator/entry-macro.S36
-rw-r--r--include/asm-arm/arch-integrator/hardware.h57
-rw-r--r--include/asm-arm/arch-integrator/impd1.h18
-rw-r--r--include/asm-arm/arch-integrator/io.h29
-rw-r--r--include/asm-arm/arch-integrator/irqs.h82
-rw-r--r--include/asm-arm/arch-integrator/lm.h23
-rw-r--r--include/asm-arm/arch-integrator/memory.h39
-rw-r--r--include/asm-arm/arch-integrator/param.h19
-rw-r--r--include/asm-arm/arch-integrator/platform.h465
-rw-r--r--include/asm-arm/arch-integrator/system.h44
-rw-r--r--include/asm-arm/arch-integrator/timex.h26
-rw-r--r--include/asm-arm/arch-integrator/uncompress.h53
-rw-r--r--include/asm-arm/arch-integrator/vmalloc.h31
-rw-r--r--include/asm-arm/arch-iop3xx/debug-macro.S48
-rw-r--r--include/asm-arm/arch-iop3xx/dma.h16
-rw-r--r--include/asm-arm/arch-iop3xx/entry-macro.S56
-rw-r--r--include/asm-arm/arch-iop3xx/hardware.h57
-rw-r--r--include/asm-arm/arch-iop3xx/io.h20
-rw-r--r--include/asm-arm/arch-iop3xx/iop321-irqs.h100
-rw-r--r--include/asm-arm/arch-iop3xx/iop321.h345
-rw-r--r--include/asm-arm/arch-iop3xx/iop331-irqs.h136
-rw-r--r--include/asm-arm/arch-iop3xx/iop331.h363
-rw-r--r--include/asm-arm/arch-iop3xx/iq31244.h24
-rw-r--r--include/asm-arm/arch-iop3xx/iq80321.h24
-rw-r--r--include/asm-arm/arch-iop3xx/iq80331.h23
-rw-r--r--include/asm-arm/arch-iop3xx/iq80332.h23
-rw-r--r--include/asm-arm/arch-iop3xx/irqs.h21
-rw-r--r--include/asm-arm/arch-iop3xx/memory.h41
-rw-r--r--include/asm-arm/arch-iop3xx/param.h3
-rw-r--r--include/asm-arm/arch-iop3xx/system.h35
-rw-r--r--include/asm-arm/arch-iop3xx/timex.h21
-rw-r--r--include/asm-arm/arch-iop3xx/uncompress.h57
-rw-r--r--include/asm-arm/arch-iop3xx/vmalloc.h19
-rw-r--r--include/asm-arm/arch-ixp2000/debug-macro.S40
-rw-r--r--include/asm-arm/arch-ixp2000/dma.h18
-rw-r--r--include/asm-arm/arch-ixp2000/enp2611.h28
-rw-r--r--include/asm-arm/arch-ixp2000/entry-macro.S53
-rw-r--r--include/asm-arm/arch-ixp2000/gpio.h55
-rw-r--r--include/asm-arm/arch-ixp2000/hardware.h44
-rw-r--r--include/asm-arm/arch-ixp2000/io.h150
-rw-r--r--include/asm-arm/arch-ixp2000/irq.h13
-rw-r--r--include/asm-arm/arch-ixp2000/irqs.h174
-rw-r--r--include/asm-arm/arch-ixp2000/ixdp2x00.h93
-rw-r--r--include/asm-arm/arch-ixp2000/ixdp2x01.h57
-rw-r--r--include/asm-arm/arch-ixp2000/ixp2000-regs.h377
-rw-r--r--include/asm-arm/arch-ixp2000/memory.h34
-rw-r--r--include/asm-arm/arch-ixp2000/param.h3
-rw-r--r--include/asm-arm/arch-ixp2000/platform.h166
-rw-r--r--include/asm-arm/arch-ixp2000/system.h54
-rw-r--r--include/asm-arm/arch-ixp2000/timex.h13
-rw-r--r--include/asm-arm/arch-ixp2000/uncompress.h52
-rw-r--r--include/asm-arm/arch-ixp2000/vmalloc.h23
-rw-r--r--include/asm-arm/arch-ixp4xx/coyote.h36
-rw-r--r--include/asm-arm/arch-ixp4xx/debug-macro.S34
-rw-r--r--include/asm-arm/arch-ixp4xx/dma.h26
-rw-r--r--include/asm-arm/arch-ixp4xx/entry-macro.S39
-rw-r--r--include/asm-arm/arch-ixp4xx/gtwx5715.h120
-rw-r--r--include/asm-arm/arch-ixp4xx/hardware.h48
-rw-r--r--include/asm-arm/arch-ixp4xx/io.h388
-rw-r--r--include/asm-arm/arch-ixp4xx/irq.h13
-rw-r--r--include/asm-arm/arch-ixp4xx/irqs.h96
-rw-r--r--include/asm-arm/arch-ixp4xx/ixdp425.h38
-rw-r--r--include/asm-arm/arch-ixp4xx/ixp4xx-regs.h591
-rw-r--r--include/asm-arm/arch-ixp4xx/memory.h61
-rw-r--r--include/asm-arm/arch-ixp4xx/param.h3
-rw-r--r--include/asm-arm/arch-ixp4xx/platform.h126
-rw-r--r--include/asm-arm/arch-ixp4xx/prpmc1100.h33
-rw-r--r--include/asm-arm/arch-ixp4xx/system.h42
-rw-r--r--include/asm-arm/arch-ixp4xx/timex.h13
-rw-r--r--include/asm-arm/arch-ixp4xx/uncompress.h64
-rw-r--r--include/asm-arm/arch-ixp4xx/vmalloc.h17
-rw-r--r--include/asm-arm/arch-l7200/aux_reg.h28
-rw-r--r--include/asm-arm/arch-l7200/debug-macro.S40
-rw-r--r--include/asm-arm/arch-l7200/dma.h24
-rw-r--r--include/asm-arm/arch-l7200/entry-macro.S29
-rw-r--r--include/asm-arm/arch-l7200/gp_timers.h42
-rw-r--r--include/asm-arm/arch-l7200/gpio.h105
-rw-r--r--include/asm-arm/arch-l7200/hardware.h60
-rw-r--r--include/asm-arm/arch-l7200/io.h76
-rw-r--r--include/asm-arm/arch-l7200/irqs.h56
-rw-r--r--include/asm-arm/arch-l7200/memory.h23
-rw-r--r--include/asm-arm/arch-l7200/param.h19
-rw-r--r--include/asm-arm/arch-l7200/pmpcon.h46
-rw-r--r--include/asm-arm/arch-l7200/pmu.h125
-rw-r--r--include/asm-arm/arch-l7200/serial.h37
-rw-r--r--include/asm-arm/arch-l7200/serial_l7200.h101
-rw-r--r--include/asm-arm/arch-l7200/sib.h119
-rw-r--r--include/asm-arm/arch-l7200/sys-clock.h67
-rw-r--r--include/asm-arm/arch-l7200/system.h27
-rw-r--r--include/asm-arm/arch-l7200/time.h72
-rw-r--r--include/asm-arm/arch-l7200/timex.h20
-rw-r--r--include/asm-arm/arch-l7200/uncompress.h44
-rw-r--r--include/asm-arm/arch-l7200/vmalloc.h15
-rw-r--r--include/asm-arm/arch-lh7a40x/constants.h88
-rw-r--r--include/asm-arm/arch-lh7a40x/debug-macro.S39
-rw-r--r--include/asm-arm/arch-lh7a40x/dma.h17
-rw-r--r--include/asm-arm/arch-lh7a40x/entry-macro.S67
-rw-r--r--include/asm-arm/arch-lh7a40x/hardware.h58
-rw-r--r--include/asm-arm/arch-lh7a40x/io.h21
-rw-r--r--include/asm-arm/arch-lh7a40x/irq.h11
-rw-r--r--include/asm-arm/arch-lh7a40x/irqs.h196
-rw-r--r--include/asm-arm/arch-lh7a40x/memory.h94
-rw-r--r--include/asm-arm/arch-lh7a40x/param.h9
-rw-r--r--include/asm-arm/arch-lh7a40x/registers.h193
-rw-r--r--include/asm-arm/arch-lh7a40x/system.h19
-rw-r--r--include/asm-arm/arch-lh7a40x/timex.h17
-rw-r--r--include/asm-arm/arch-lh7a40x/uncompress.h43
-rw-r--r--include/asm-arm/arch-lh7a40x/vmalloc.h21
-rw-r--r--include/asm-arm/arch-omap/aic23.h112
-rw-r--r--include/asm-arm/arch-omap/board-h2.h47
-rw-r--r--include/asm-arm/arch-omap/board-h3.h49
-rw-r--r--include/asm-arm/arch-omap/board-h4.h35
-rw-r--r--include/asm-arm/arch-omap/board-innovator.h80
-rw-r--r--include/asm-arm/arch-omap/board-netstar.h19
-rw-r--r--include/asm-arm/arch-omap/board-osk.h41
-rw-r--r--include/asm-arm/arch-omap/board-perseus2.h58
-rw-r--r--include/asm-arm/arch-omap/board-voiceblue.h25
-rw-r--r--include/asm-arm/arch-omap/board.h126
-rw-r--r--include/asm-arm/arch-omap/cpu.h183
-rw-r--r--include/asm-arm/arch-omap/debug-macro.S45
-rw-r--r--include/asm-arm/arch-omap/dma.h264
-rw-r--r--include/asm-arm/arch-omap/entry-macro.S32
-rw-r--r--include/asm-arm/arch-omap/fpga.h196
-rw-r--r--include/asm-arm/arch-omap/gpio.h69
-rw-r--r--include/asm-arm/arch-omap/hardware.h324
-rw-r--r--include/asm-arm/arch-omap/io.h107
-rw-r--r--include/asm-arm/arch-omap/irqs.h255
-rw-r--r--include/asm-arm/arch-omap/mcbsp.h257
-rw-r--r--include/asm-arm/arch-omap/memory.h87
-rw-r--r--include/asm-arm/arch-omap/mux.h561
-rw-r--r--include/asm-arm/arch-omap/omap1510.h61
-rw-r--r--include/asm-arm/arch-omap/omap16xx.h187
-rw-r--r--include/asm-arm/arch-omap/omap730.h106
-rw-r--r--include/asm-arm/arch-omap/param.h8
-rw-r--r--include/asm-arm/arch-omap/pm.h229
-rw-r--r--include/asm-arm/arch-omap/system.h20
-rw-r--r--include/asm-arm/arch-omap/tc.h108
-rw-r--r--include/asm-arm/arch-omap/timex.h33
-rw-r--r--include/asm-arm/arch-omap/tps65010.h80
-rw-r--r--include/asm-arm/arch-omap/uncompress.h82
-rw-r--r--include/asm-arm/arch-omap/usb.h108
-rw-r--r--include/asm-arm/arch-omap/vmalloc.h33
-rw-r--r--include/asm-arm/arch-pxa/audio.h16
-rw-r--r--include/asm-arm/arch-pxa/bitfield.h113
-rw-r--r--include/asm-arm/arch-pxa/corgi.h120
-rw-r--r--include/asm-arm/arch-pxa/debug-macro.S36
-rw-r--r--include/asm-arm/arch-pxa/dma.h67
-rw-r--r--include/asm-arm/arch-pxa/entry-macro.S31
-rw-r--r--include/asm-arm/arch-pxa/hardware.h95
-rw-r--r--include/asm-arm/arch-pxa/idp.h200
-rw-r--r--include/asm-arm/arch-pxa/io.h19
-rw-r--r--include/asm-arm/arch-pxa/irq.h19
-rw-r--r--include/asm-arm/arch-pxa/irqs.h219
-rw-r--r--include/asm-arm/arch-pxa/lubbock.h40
-rw-r--r--include/asm-arm/arch-pxa/mainstone.h120
-rw-r--r--include/asm-arm/arch-pxa/memory.h76
-rw-r--r--include/asm-arm/arch-pxa/mmc.h19
-rw-r--r--include/asm-arm/arch-pxa/param.h3
-rw-r--r--include/asm-arm/arch-pxa/poodle.h70
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h2251
-rw-r--r--include/asm-arm/arch-pxa/pxafb.h68
-rw-r--r--include/asm-arm/arch-pxa/ssp.h47
-rw-r--r--include/asm-arm/arch-pxa/system.h34
-rw-r--r--include/asm-arm/arch-pxa/timex.h25
-rw-r--r--include/asm-arm/arch-pxa/udc.h18
-rw-r--r--include/asm-arm/arch-pxa/uncompress.h42
-rw-r--r--include/asm-arm/arch-pxa/vmalloc.h22
-rw-r--r--include/asm-arm/arch-rpc/acornfb.h140
-rw-r--r--include/asm-arm/arch-rpc/debug-macro.S35
-rw-r--r--include/asm-arm/arch-rpc/dma.h33
-rw-r--r--include/asm-arm/arch-rpc/entry-macro.S3
-rw-r--r--include/asm-arm/arch-rpc/hardware.h86
-rw-r--r--include/asm-arm/arch-rpc/io.h257
-rw-r--r--include/asm-arm/arch-rpc/irqs.h46
-rw-r--r--include/asm-arm/arch-rpc/memory.h33
-rw-r--r--include/asm-arm/arch-rpc/param.h3
-rw-r--r--include/asm-arm/arch-rpc/system.h27
-rw-r--r--include/asm-arm/arch-rpc/timex.h17
-rw-r--r--include/asm-arm/arch-rpc/uncompress.h155
-rw-r--r--include/asm-arm/arch-rpc/vmalloc.h21
-rw-r--r--include/asm-arm/arch-s3c2410/bast-cpld.h58
-rw-r--r--include/asm-arm/arch-s3c2410/bast-irq.h33
-rw-r--r--include/asm-arm/arch-s3c2410/bast-map.h150
-rw-r--r--include/asm-arm/arch-s3c2410/bast-pmu.h43
-rw-r--r--include/asm-arm/arch-s3c2410/debug-macro.S99
-rw-r--r--include/asm-arm/arch-s3c2410/dma.h376
-rw-r--r--include/asm-arm/arch-s3c2410/entry-macro.S119
-rw-r--r--include/asm-arm/arch-s3c2410/hardware.h105
-rw-r--r--include/asm-arm/arch-s3c2410/idle.h28
-rw-r--r--include/asm-arm/arch-s3c2410/iic.h36
-rw-r--r--include/asm-arm/arch-s3c2410/io.h196
-rw-r--r--include/asm-arm/arch-s3c2410/irqs.h126
-rw-r--r--include/asm-arm/arch-s3c2410/map.h192
-rw-r--r--include/asm-arm/arch-s3c2410/memory.h44
-rw-r--r--include/asm-arm/arch-s3c2410/nand.h48
-rw-r--r--include/asm-arm/arch-s3c2410/otom-map.h30
-rw-r--r--include/asm-arm/arch-s3c2410/param.h27
-rw-r--r--include/asm-arm/arch-s3c2410/regs-adc.h63
-rw-r--r--include/asm-arm/arch-s3c2410/regs-clock.h122
-rw-r--r--include/asm-arm/arch-s3c2410/regs-dsc.h183
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpio.h831
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpioj.h101
-rw-r--r--include/asm-arm/arch-s3c2410/regs-iic.h60
-rw-r--r--include/asm-arm/arch-s3c2410/regs-iis.h72
-rw-r--r--include/asm-arm/arch-s3c2410/regs-irq.h44
-rw-r--r--include/asm-arm/arch-s3c2410/regs-lcd.h114
-rw-r--r--include/asm-arm/arch-s3c2410/regs-mem.h212
-rw-r--r--include/asm-arm/arch-s3c2410/regs-nand.h43
-rw-r--r--include/asm-arm/arch-s3c2410/regs-rtc.h66
-rw-r--r--include/asm-arm/arch-s3c2410/regs-sdi.h118
-rw-r--r--include/asm-arm/arch-s3c2410/regs-serial.h209
-rw-r--r--include/asm-arm/arch-s3c2410/regs-spi.h56
-rw-r--r--include/asm-arm/arch-s3c2410/regs-timer.h113
-rw-r--r--include/asm-arm/arch-s3c2410/regs-udc.h164
-rw-r--r--include/asm-arm/arch-s3c2410/regs-watchdog.h46
-rw-r--r--include/asm-arm/arch-s3c2410/system.h90
-rw-r--r--include/asm-arm/arch-s3c2410/timex.h32
-rw-r--r--include/asm-arm/arch-s3c2410/uncompress.h158
-rw-r--r--include/asm-arm/arch-s3c2410/usb-control.h45
-rw-r--r--include/asm-arm/arch-s3c2410/vmalloc.h36
-rw-r--r--include/asm-arm/arch-s3c2410/vr1000-cpld.h22
-rw-r--r--include/asm-arm/arch-s3c2410/vr1000-irq.h30
-rw-r--r--include/asm-arm/arch-s3c2410/vr1000-map.h116
-rw-r--r--include/asm-arm/arch-sa1100/SA-1100.h2072
-rw-r--r--include/asm-arm/arch-sa1100/SA-1101.h925
-rw-r--r--include/asm-arm/arch-sa1100/SA-1111.h5
-rw-r--r--include/asm-arm/arch-sa1100/assabet.h106
-rw-r--r--include/asm-arm/arch-sa1100/badge4.h75
-rw-r--r--include/asm-arm/arch-sa1100/bitfield.h113
-rw-r--r--include/asm-arm/arch-sa1100/cerf.h29
-rw-r--r--include/asm-arm/arch-sa1100/collie.h85
-rw-r--r--include/asm-arm/arch-sa1100/debug-macro.S57
-rw-r--r--include/asm-arm/arch-sa1100/dma.h132
-rw-r--r--include/asm-arm/arch-sa1100/entry-macro.S41
-rw-r--r--include/asm-arm/arch-sa1100/h3600.h164
-rw-r--r--include/asm-arm/arch-sa1100/h3600_gpio.h540
-rw-r--r--include/asm-arm/arch-sa1100/hardware.h83
-rw-r--r--include/asm-arm/arch-sa1100/ide.h76
-rw-r--r--include/asm-arm/arch-sa1100/io.h23
-rw-r--r--include/asm-arm/arch-sa1100/irqs.h198
-rw-r--r--include/asm-arm/arch-sa1100/jornada720.h28
-rw-r--r--include/asm-arm/arch-sa1100/lart.h13
-rw-r--r--include/asm-arm/arch-sa1100/memory.h108
-rw-r--r--include/asm-arm/arch-sa1100/neponset.h74
-rw-r--r--include/asm-arm/arch-sa1100/param.h3
-rw-r--r--include/asm-arm/arch-sa1100/shannon.h43
-rw-r--r--include/asm-arm/arch-sa1100/simpad.h112
-rw-r--r--include/asm-arm/arch-sa1100/system.h22
-rw-r--r--include/asm-arm/arch-sa1100/timex.h12
-rw-r--r--include/asm-arm/arch-sa1100/uncompress.h53
-rw-r--r--include/asm-arm/arch-sa1100/vmalloc.h15
-rw-r--r--include/asm-arm/arch-shark/debug-macro.S31
-rw-r--r--include/asm-arm/arch-shark/dma.h18
-rw-r--r--include/asm-arm/arch-shark/entry-macro.S35
-rw-r--r--include/asm-arm/arch-shark/hardware.h57
-rw-r--r--include/asm-arm/arch-shark/io.h199
-rw-r--r--include/asm-arm/arch-shark/irqs.h13
-rw-r--r--include/asm-arm/arch-shark/memory.h42
-rw-r--r--include/asm-arm/arch-shark/param.h5
-rw-r--r--include/asm-arm/arch-shark/system.h28
-rw-r--r--include/asm-arm/arch-shark/timex.h7
-rw-r--r--include/asm-arm/arch-shark/uncompress.h60
-rw-r--r--include/asm-arm/arch-shark/vmalloc.h15
-rw-r--r--include/asm-arm/arch-versatile/debug-macro.S39
-rw-r--r--include/asm-arm/arch-versatile/dma.h27
-rw-r--r--include/asm-arm/arch-versatile/entry-macro.S35
-rw-r--r--include/asm-arm/arch-versatile/hardware.h45
-rw-r--r--include/asm-arm/arch-versatile/io.h29
-rw-r--r--include/asm-arm/arch-versatile/irqs.h211
-rw-r--r--include/asm-arm/arch-versatile/memory.h38
-rw-r--r--include/asm-arm/arch-versatile/param.h19
-rw-r--r--include/asm-arm/arch-versatile/platform.h510
-rw-r--r--include/asm-arm/arch-versatile/system.h51
-rw-r--r--include/asm-arm/arch-versatile/timex.h23
-rw-r--r--include/asm-arm/arch-versatile/uncompress.h52
-rw-r--r--include/asm-arm/arch-versatile/vmalloc.h33
-rw-r--r--include/asm-arm/assembler.h117
-rw-r--r--include/asm-arm/atomic.h165
-rw-r--r--include/asm-arm/bitops.h416
-rw-r--r--include/asm-arm/bug.h22
-rw-r--r--include/asm-arm/bugs.h17
-rw-r--r--include/asm-arm/byteorder.h33
-rw-r--r--include/asm-arm/cache.h15
-rw-r--r--include/asm-arm/cacheflush.h387
-rw-r--r--include/asm-arm/checksum.h160
-rw-r--r--include/asm-arm/cpu-multi32.h64
-rw-r--r--include/asm-arm/cpu-single.h44
-rw-r--r--include/asm-arm/cpu.h25
-rw-r--r--include/asm-arm/cputime.h6
-rw-r--r--include/asm-arm/current.h15
-rw-r--r--include/asm-arm/delay.h42
-rw-r--r--include/asm-arm/div64.h48
-rw-r--r--include/asm-arm/dma-mapping.h426
-rw-r--r--include/asm-arm/dma.h135
-rw-r--r--include/asm-arm/domain.h52
-rw-r--r--include/asm-arm/ecard.h298
-rw-r--r--include/asm-arm/elf.h133
-rw-r--r--include/asm-arm/errno.h6
-rw-r--r--include/asm-arm/fcntl.h87
-rw-r--r--include/asm-arm/fiq.h37
-rw-r--r--include/asm-arm/floppy.h144
-rw-r--r--include/asm-arm/fpstate.h74
-rw-r--r--include/asm-arm/glue.h114
-rw-r--r--include/asm-arm/hardirq.h32
-rw-r--r--include/asm-arm/hardware.h18
-rw-r--r--include/asm-arm/hardware/amba.h55
-rw-r--r--include/asm-arm/hardware/amba_clcd.h264
-rw-r--r--include/asm-arm/hardware/amba_kmi.h92
-rw-r--r--include/asm-arm/hardware/amba_serial.h156
-rw-r--r--include/asm-arm/hardware/clock.h121
-rw-r--r--include/asm-arm/hardware/clps7111.h184
-rw-r--r--include/asm-arm/hardware/cs89712.h49
-rw-r--r--include/asm-arm/hardware/dec21285.h148
-rw-r--r--include/asm-arm/hardware/entry-macro-iomd.S145
-rw-r--r--include/asm-arm/hardware/ep7211.h40
-rw-r--r--include/asm-arm/hardware/ep7212.h83
-rw-r--r--include/asm-arm/hardware/icst307.h38
-rw-r--r--include/asm-arm/hardware/icst525.h36
-rw-r--r--include/asm-arm/hardware/ioc.h72
-rw-r--r--include/asm-arm/hardware/iomd.h227
-rw-r--r--include/asm-arm/hardware/linkup-l1110.h48
-rw-r--r--include/asm-arm/hardware/locomo.h206
-rw-r--r--include/asm-arm/hardware/memc.h26
-rw-r--r--include/asm-arm/hardware/pci_v3.h186
-rw-r--r--include/asm-arm/hardware/sa1111.h602
-rw-r--r--include/asm-arm/hardware/scoop.h47
-rw-r--r--include/asm-arm/hardware/ssp.h28
-rw-r--r--include/asm-arm/hdreg.h1
-rw-r--r--include/asm-arm/ide.h36
-rw-r--r--include/asm-arm/io.h286
-rw-r--r--include/asm-arm/ioctl.h74
-rw-r--r--include/asm-arm/ioctls.h80
-rw-r--r--include/asm-arm/ipc.h1
-rw-r--r--include/asm-arm/ipcbuf.h29
-rw-r--r--include/asm-arm/irq.h51
-rw-r--r--include/asm-arm/kmap_types.h24
-rw-r--r--include/asm-arm/leds.h51
-rw-r--r--include/asm-arm/limits.h11
-rw-r--r--include/asm-arm/linkage.h7
-rw-r--r--include/asm-arm/local.h1
-rw-r--r--include/asm-arm/locks.h262
-rw-r--r--include/asm-arm/mach/arch.h92
-rw-r--r--include/asm-arm/mach/dma.h55
-rw-r--r--include/asm-arm/mach/flash.h34
-rw-r--r--include/asm-arm/mach/irda.h20
-rw-r--r--include/asm-arm/mach/irq.h127
-rw-r--r--include/asm-arm/mach/map.h33
-rw-r--r--include/asm-arm/mach/mmc.h15
-rw-r--r--include/asm-arm/mach/pci.h75
-rw-r--r--include/asm-arm/mach/serial_sa1100.h32
-rw-r--r--include/asm-arm/mach/sharpsl_param.h37
-rw-r--r--include/asm-arm/mach/time.h54
-rw-r--r--include/asm-arm/mc146818rtc.h28
-rw-r--r--include/asm-arm/memory.h200
-rw-r--r--include/asm-arm/mman.h43
-rw-r--r--include/asm-arm/mmu.h16
-rw-r--r--include/asm-arm/mmu_context.h96
-rw-r--r--include/asm-arm/mmzone.h30
-rw-r--r--include/asm-arm/module.h18
-rw-r--r--include/asm-arm/msgbuf.h31
-rw-r--r--include/asm-arm/namei.h25
-rw-r--r--include/asm-arm/numnodes.h24
-rw-r--r--include/asm-arm/nwflash.h9
-rw-r--r--include/asm-arm/page.h197
-rw-r--r--include/asm-arm/param.h36
-rw-r--r--include/asm-arm/parport.h18
-rw-r--r--include/asm-arm/pci.h59
-rw-r--r--include/asm-arm/percpu.h6
-rw-r--r--include/asm-arm/pgalloc.h130
-rw-r--r--include/asm-arm/pgtable.h433
-rw-r--r--include/asm-arm/poll.h26
-rw-r--r--include/asm-arm/posix_types.h81
-rw-r--r--include/asm-arm/proc-fns.h174
-rw-r--r--include/asm-arm/processor.h118
-rw-r--r--include/asm-arm/procinfo.h60
-rw-r--r--include/asm-arm/ptrace.h155
-rw-r--r--include/asm-arm/resource.h6
-rw-r--r--include/asm-arm/rtc.h46
-rw-r--r--include/asm-arm/scatterlist.h25
-rw-r--r--include/asm-arm/sections.h1
-rw-r--r--include/asm-arm/segment.h11
-rw-r--r--include/asm-arm/semaphore-helper.h84
-rw-r--r--include/asm-arm/semaphore.h106
-rw-r--r--include/asm-arm/sembuf.h25
-rw-r--r--include/asm-arm/serial.h19
-rw-r--r--include/asm-arm/setup.h218
-rw-r--r--include/asm-arm/shmbuf.h42
-rw-r--r--include/asm-arm/shmparam.h16
-rw-r--r--include/asm-arm/sigcontext.h34
-rw-r--r--include/asm-arm/siginfo.h6
-rw-r--r--include/asm-arm/signal.h194
-rw-r--r--include/asm-arm/sizes.h52
-rw-r--r--include/asm-arm/smp.h58
-rw-r--r--include/asm-arm/socket.h50
-rw-r--r--include/asm-arm/sockios.h12
-rw-r--r--include/asm-arm/spinlock.h169
-rw-r--r--include/asm-arm/stat.h94
-rw-r--r--include/asm-arm/statfs.h6
-rw-r--r--include/asm-arm/string.h43
-rw-r--r--include/asm-arm/suspend.h4
-rw-r--r--include/asm-arm/system.h390
-rw-r--r--include/asm-arm/termbits.h171
-rw-r--r--include/asm-arm/termios.h108
-rw-r--r--include/asm-arm/therm.h28
-rw-r--r--include/asm-arm/thread_info.h147
-rw-r--r--include/asm-arm/timex.h24
-rw-r--r--include/asm-arm/tlb.h102
-rw-r--r--include/asm-arm/tlbflush.h404
-rw-r--r--include/asm-arm/topology.h6
-rw-r--r--include/asm-arm/traps.h18
-rw-r--r--include/asm-arm/types.h62
-rw-r--r--include/asm-arm/uaccess.h438
-rw-r--r--include/asm-arm/ucontext.h12
-rw-r--r--include/asm-arm/unaligned.h191
-rw-r--r--include/asm-arm/unistd.h558
-rw-r--r--include/asm-arm/user.h84
-rw-r--r--include/asm-arm/vfp.h78
-rw-r--r--include/asm-arm/vfpmacros.h25
-rw-r--r--include/asm-arm/vga.h12
-rw-r--r--include/asm-arm/xor.h141
531 files changed, 48911 insertions, 0 deletions
diff --git a/include/asm-arm/a.out.h b/include/asm-arm/a.out.h
new file mode 100644
index 000000000000..3e5fe64c4394
--- /dev/null
+++ b/include/asm-arm/a.out.h
@@ -0,0 +1,39 @@
1#ifndef __ARM_A_OUT_H__
2#define __ARM_A_OUT_H__
3
4#include <linux/personality.h>
5#include <asm/types.h>
6
7struct exec
8{
9 __u32 a_info; /* Use macros N_MAGIC, etc for access */
10 __u32 a_text; /* length of text, in bytes */
11 __u32 a_data; /* length of data, in bytes */
12 __u32 a_bss; /* length of uninitialized data area for file, in bytes */
13 __u32 a_syms; /* length of symbol table data in file, in bytes */
14 __u32 a_entry; /* start address */
15 __u32 a_trsize; /* length of relocation info for text, in bytes */
16 __u32 a_drsize; /* length of relocation info for data, in bytes */
17};
18
19/*
20 * This is always the same
21 */
22#define N_TXTADDR(a) (0x00008000)
23
24#define N_TRSIZE(a) ((a).a_trsize)
25#define N_DRSIZE(a) ((a).a_drsize)
26#define N_SYMSIZE(a) ((a).a_syms)
27
28#define M_ARM 103
29
30#ifdef __KERNEL__
31#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \
32 TASK_SIZE : TASK_SIZE_26)
33#endif
34
35#ifndef LIBRARY_START_TEXT
36#define LIBRARY_START_TEXT (0x00c00000)
37#endif
38
39#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-arm/apm.h b/include/asm-arm/apm.h
new file mode 100644
index 000000000000..3a50eb759c28
--- /dev/null
+++ b/include/asm-arm/apm.h
@@ -0,0 +1,65 @@
1/* -*- linux-c -*-
2 *
3 * (C) 2003 zecke@handhelds.org
4 *
5 * GPL version 2
6 *
7 * based on arch/arm/kernel/apm.c
8 * factor out the information needed by architectures to provide
9 * apm status
10 *
11 *
12 */
13#ifndef ARM_ASM_SA1100_APM_H
14#define ARM_ASM_SA1100_APM_H
15
16#include <linux/config.h>
17#include <linux/apm_bios.h>
18
19/*
20 * This structure gets filled in by the machine specific 'get_power_status'
21 * implementation. Any fields which are not set default to a safe value.
22 */
23struct apm_power_info {
24 unsigned char ac_line_status;
25#define APM_AC_OFFLINE 0
26#define APM_AC_ONLINE 1
27#define APM_AC_BACKUP 2
28#define APM_AC_UNKNOWN 0xff
29
30 unsigned char battery_status;
31#define APM_BATTERY_STATUS_HIGH 0
32#define APM_BATTERY_STATUS_LOW 1
33#define APM_BATTERY_STATUS_CRITICAL 2
34#define APM_BATTERY_STATUS_CHARGING 3
35#define APM_BATTERY_STATUS_NOT_PRESENT 4
36#define APM_BATTERY_STATUS_UNKNOWN 0xff
37
38 unsigned char battery_flag;
39#define APM_BATTERY_FLAG_HIGH (1 << 0)
40#define APM_BATTERY_FLAG_LOW (1 << 1)
41#define APM_BATTERY_FLAG_CRITICAL (1 << 2)
42#define APM_BATTERY_FLAG_CHARGING (1 << 3)
43#define APM_BATTERY_FLAG_NOT_PRESENT (1 << 7)
44#define APM_BATTERY_FLAG_UNKNOWN 0xff
45
46 int battery_life;
47 int time;
48 int units;
49#define APM_UNITS_MINS 0
50#define APM_UNITS_SECS 1
51#define APM_UNITS_UNKNOWN -1
52
53};
54
55/*
56 * This allows machines to provide their own "apm get power status" function.
57 */
58extern void (*apm_get_power_status)(struct apm_power_info *);
59
60/*
61 * Queue an event (APM_SYS_SUSPEND or APM_CRITICAL_SUSPEND)
62 */
63void apm_queue_event(apm_event_t event);
64
65#endif
diff --git a/include/asm-arm/arch-cl7500/acornfb.h b/include/asm-arm/arch-cl7500/acornfb.h
new file mode 100644
index 000000000000..3867231a4470
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/acornfb.h
@@ -0,0 +1,34 @@
1#include <linux/config.h>
2#define acornfb_valid_pixrate(var) (var->pixclock >= 39325 && var->pixclock <= 40119)
3
4static inline void
5acornfb_vidc20_find_rates(struct vidc_timing *vidc,
6 struct fb_var_screeninfo *var)
7{
8 u_int bandwidth;
9
10 vidc->control |= VIDC20_CTRL_PIX_CK;
11
12 /* Calculate bandwidth */
13 bandwidth = var->pixclock * 8 / var->bits_per_pixel;
14
15 /* Encode bandwidth as VIDC20 setting */
16 if (bandwidth > 16667*2)
17 vidc->control |= VIDC20_CTRL_FIFO_16;
18 else if (bandwidth > 13333*2)
19 vidc->control |= VIDC20_CTRL_FIFO_20;
20 else if (bandwidth > 11111*2)
21 vidc->control |= VIDC20_CTRL_FIFO_24;
22 else
23 vidc->control |= VIDC20_CTRL_FIFO_28;
24
25 vidc->pll_ctl = 0x2020;
26}
27
28#ifdef CONFIG_CHRONTEL_7003
29#define acornfb_default_control() VIDC20_CTRL_PIX_HCLK
30#else
31#define acornfb_default_control() VIDC20_CTRL_PIX_VCLK
32#endif
33
34#define acornfb_default_econtrol() VIDC20_ECTL_DAC | VIDC20_ECTL_REG(3) | VIDC20_ECTL_ECK
diff --git a/include/asm-arm/arch-cl7500/debug-macro.S b/include/asm-arm/arch-cl7500/debug-macro.S
new file mode 100644
index 000000000000..a5d489d7955a
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/debug-macro.S
@@ -0,0 +1,31 @@
1/* linux/include/asm-arm/arch-cl7500/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .macro addruart,rx
15 mov \rx, #0xe0000000
16 orr \rx, \rx, #0x00010000
17 orr \rx, \rx, #0x00000be0
18 .endm
19
20 .macro senduart,rd,rx
21 strb \rd, [\rx]
22 .endm
23
24 .macro busyuart,rd,rx
25 .endm
26
27 .macro waituart,rd,rx
281001: ldrb \rd, [\rx, #0x14]
29 tst \rd, #0x20
30 beq 1001b
31 .endm
diff --git a/include/asm-arm/arch-cl7500/dma.h b/include/asm-arm/arch-cl7500/dma.h
new file mode 100644
index 000000000000..1d6a8829d327
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/dma.h
@@ -0,0 +1,22 @@
1/*
2 * linux/include/asm-arm/arch-cl7500/dma.h
3 *
4 * Copyright (C) 1999 Nexus Electronics Ltd.
5 */
6
7#ifndef __ASM_ARCH_DMA_H
8#define __ASM_ARCH_DMA_H
9
10/* DMA is not yet implemented! It should be the same as acorn, copy over.. */
11
12/*
13 * This is the maximum DMA address that can be DMAd to.
14 * There should not be more than (0xd0000000 - 0xc0000000)
15 * bytes of RAM.
16 */
17#define MAX_DMA_ADDRESS 0xd0000000
18#define MAX_DMA_CHANNELS 0
19
20#define DMA_S0 0
21
22#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-cl7500/entry-macro.S b/include/asm-arm/arch-cl7500/entry-macro.S
new file mode 100644
index 000000000000..686f413f82d6
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/entry-macro.S
@@ -0,0 +1,3 @@
1
2#include <asm/hardware/entry-macro-iomd.S>
3
diff --git a/include/asm-arm/arch-cl7500/hardware.h b/include/asm-arm/arch-cl7500/hardware.h
new file mode 100644
index 000000000000..2339b764f69f
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/hardware.h
@@ -0,0 +1,71 @@
1/*
2 * linux/include/asm-arm/arch-cl7500/hardware.h
3 *
4 * Copyright (C) 1996-1999 Russell King.
5 * Copyright (C) 1999 Nexus Electronics Ltd.
6 *
7 * This file contains the hardware definitions of the
8 * CL7500 evaluation board.
9 */
10#ifndef __ASM_ARCH_HARDWARE_H
11#define __ASM_ARCH_HARDWARE_H
12
13#include <asm/arch/memory.h>
14#include <asm/hardware/iomd.h>
15
16#ifdef __ASSEMBLY__
17#define IOMEM(x) x
18#else
19#define IOMEM(x) ((void __iomem *)(x))
20#endif
21
22/*
23 * What hardware must be present
24 */
25#define HAS_IOMD
26#define HAS_VIDC20
27
28/* Hardware addresses of major areas.
29 * *_START is the physical address
30 * *_SIZE is the size of the region
31 * *_BASE is the virtual address
32 */
33
34#define IO_START 0x03000000 /* I/O */
35#define IO_SIZE 0x01000000
36#define IO_BASE IOMEM(0xe0000000)
37
38#define ISA_START 0x0c000000 /* ISA */
39#define ISA_SIZE 0x00010000
40#define ISA_BASE 0xe1000000
41
42#define FLASH_START 0x01000000 /* XXX */
43#define FLASH_SIZE 0x01000000
44#define FLASH_BASE 0xe2000000
45
46#define LED_START 0x0302B000
47#define LED_SIZE 0x00001000
48#define LED_BASE 0xe3000000
49#define LED_ADDRESS (LED_BASE + 0xa00)
50
51/* Let's define SCREEN_START for CL7500, even though it's a lie. */
52#define SCREEN_START 0x02000000 /* VRAM */
53#define SCREEN_END 0xdfc00000
54#define SCREEN_BASE 0xdf800000
55
56#define FLUSH_BASE 0xdf000000
57
58#define VIDC_BASE (void __iomem *)0xe0400000
59#define IOMD_BASE IOMEM(0xe0200000)
60#define IOC_BASE IOMEM(0xe0200000)
61#define FLOPPYDMA_BASE IOMEM(0xe002a000)
62#define PCIO_BASE IOMEM(0xe0010000)
63
64#define FLUSH_BASE_PHYS 0x00000000 /* ROM */
65
66#define vidc_writel(val) __raw_writel(val, VIDC_BASE)
67
68/* in/out bias for the ISA slot region */
69#define ISASLOT_IO 0x80400000
70
71#endif
diff --git a/include/asm-arm/arch-cl7500/io.h b/include/asm-arm/arch-cl7500/io.h
new file mode 100644
index 000000000000..f0113bc75630
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/io.h
@@ -0,0 +1,253 @@
1/*
2 * linux/include/asm-arm/arch-cl7500/io.h
3 * from linux/include/asm-arm/arch-rpc/io.h
4 *
5 * Copyright (C) 1997 Russell King
6 *
7 * Modifications:
8 * 06-Dec-1997 RMK Created.
9 */
10#ifndef __ASM_ARM_ARCH_IO_H
11#define __ASM_ARM_ARCH_IO_H
12
13#define IO_SPACE_LIMIT 0xffffffff
14
15/*
16 * GCC is totally crap at loading/storing data. We try to persuade it
17 * to do the right thing by using these whereever possible instead of
18 * the above.
19 */
20#define __arch_base_getb(b,o) \
21 ({ \
22 unsigned int v, r = (b); \
23 __asm__ __volatile__( \
24 "ldrb %0, [%1, %2]" \
25 : "=r" (v) \
26 : "r" (r), "Ir" (o)); \
27 v; \
28 })
29
30#define __arch_base_getl(b,o) \
31 ({ \
32 unsigned int v, r = (b); \
33 __asm__ __volatile__( \
34 "ldr %0, [%1, %2]" \
35 : "=r" (v) \
36 : "r" (r), "Ir" (o)); \
37 v; \
38 })
39
40#define __arch_base_putb(v,b,o) \
41 ({ \
42 unsigned int r = (b); \
43 __asm__ __volatile__( \
44 "strb %0, [%1, %2]" \
45 : \
46 : "r" (v), "r" (r), "Ir" (o)); \
47 })
48
49#define __arch_base_putl(v,b,o) \
50 ({ \
51 unsigned int r = (b); \
52 __asm__ __volatile__( \
53 "str %0, [%1, %2]" \
54 : \
55 : "r" (v), "r" (r), "Ir" (o)); \
56 })
57
58/*
59 * We use two different types of addressing - PC style addresses, and ARM
60 * addresses. PC style accesses the PC hardware with the normal PC IO
61 * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
62 * and are translated to the start of IO. Note that all addresses are
63 * shifted left!
64 */
65#define __PORT_PCIO(x) (!((x) & 0x80000000))
66
67/*
68 * Dynamic IO functions - let the compiler
69 * optimize the expressions
70 */
71static inline void __outb (unsigned int value, unsigned int port)
72{
73 unsigned long temp;
74 __asm__ __volatile__(
75 "tst %2, #0x80000000\n\t"
76 "mov %0, %4\n\t"
77 "addeq %0, %0, %3\n\t"
78 "strb %1, [%0, %2, lsl #2] @ outb"
79 : "=&r" (temp)
80 : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
81 : "cc");
82}
83
84static inline void __outw (unsigned int value, unsigned int port)
85{
86 unsigned long temp;
87 __asm__ __volatile__(
88 "tst %2, #0x80000000\n\t"
89 "mov %0, %4\n\t"
90 "addeq %0, %0, %3\n\t"
91 "str %1, [%0, %2, lsl #2] @ outw"
92 : "=&r" (temp)
93 : "r" (value|value<<16), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
94 : "cc");
95}
96
97static inline void __outl (unsigned int value, unsigned int port)
98{
99 unsigned long temp;
100 __asm__ __volatile__(
101 "tst %2, #0x80000000\n\t"
102 "mov %0, %4\n\t"
103 "addeq %0, %0, %3\n\t"
104 "str %1, [%0, %2, lsl #2] @ outl"
105 : "=&r" (temp)
106 : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
107 : "cc");
108}
109
110#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
111static inline unsigned sz __in##fnsuffix (unsigned int port) \
112{ \
113 unsigned long temp, value; \
114 __asm__ __volatile__( \
115 "tst %2, #0x80000000\n\t" \
116 "mov %0, %4\n\t" \
117 "addeq %0, %0, %3\n\t" \
118 "ldr" instr " %1, [%0, %2, lsl #2] @ in" #fnsuffix \
119 : "=&r" (temp), "=r" (value) \
120 : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
121 : "cc"); \
122 return (unsigned sz)value; \
123}
124
125static inline unsigned int __ioaddr (unsigned int port) \
126{ \
127 if (__PORT_PCIO(port)) \
128 return (unsigned int)(PCIO_BASE + (port << 2)); \
129 else \
130 return (unsigned int)(IO_BASE + (port << 2)); \
131}
132
133#define DECLARE_IO(sz,fnsuffix,instr) \
134 DECLARE_DYN_IN(sz,fnsuffix,instr)
135
136DECLARE_IO(char,b,"b")
137DECLARE_IO(short,w,"")
138DECLARE_IO(int,l,"")
139
140#undef DECLARE_IO
141#undef DECLARE_DYN_IN
142
143/*
144 * Constant address IO functions
145 *
146 * These have to be macros for the 'J' constraint to work -
147 * +/-4096 immediate operand.
148 */
149#define __outbc(value,port) \
150({ \
151 if (__PORT_PCIO((port))) \
152 __asm__ __volatile__( \
153 "strb %0, [%1, %2] @ outbc" \
154 : : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
155 else \
156 __asm__ __volatile__( \
157 "strb %0, [%1, %2] @ outbc" \
158 : : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
159})
160
161#define __inbc(port) \
162({ \
163 unsigned char result; \
164 if (__PORT_PCIO((port))) \
165 __asm__ __volatile__( \
166 "ldrb %0, [%1, %2] @ inbc" \
167 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
168 else \
169 __asm__ __volatile__( \
170 "ldrb %0, [%1, %2] @ inbc" \
171 : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
172 result; \
173})
174
175#define __outwc(value,port) \
176({ \
177 unsigned long v = value; \
178 if (__PORT_PCIO((port))) \
179 __asm__ __volatile__( \
180 "str %0, [%1, %2] @ outwc" \
181 : : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
182 else \
183 __asm__ __volatile__( \
184 "str %0, [%1, %2] @ outwc" \
185 : : "r" (v|v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
186})
187
188#define __inwc(port) \
189({ \
190 unsigned short result; \
191 if (__PORT_PCIO((port))) \
192 __asm__ __volatile__( \
193 "ldr %0, [%1, %2] @ inwc" \
194 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
195 else \
196 __asm__ __volatile__( \
197 "ldr %0, [%1, %2] @ inwc" \
198 : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
199 result & 0xffff; \
200})
201
202#define __outlc(value,port) \
203({ \
204 unsigned long v = value; \
205 if (__PORT_PCIO((port))) \
206 __asm__ __volatile__( \
207 "str %0, [%1, %2] @ outlc" \
208 : : "r" (v), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
209 else \
210 __asm__ __volatile__( \
211 "str %0, [%1, %2] @ outlc" \
212 : : "r" (v), "r" (IO_BASE), "r" ((port) << 2)); \
213})
214
215#define __inlc(port) \
216({ \
217 unsigned long result; \
218 if (__PORT_PCIO((port))) \
219 __asm__ __volatile__( \
220 "ldr %0, [%1, %2] @ inlc" \
221 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
222 else \
223 __asm__ __volatile__( \
224 "ldr %0, [%1, %2] @ inlc" \
225 : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
226 result; \
227})
228
229#define __ioaddrc(port) \
230 (__PORT_PCIO((port)) ? PCIO_BASE + ((port) << 2) : IO_BASE + ((port) << 2))
231
232#define inb(p) (__builtin_constant_p((p)) ? __inbc(p) : __inb(p))
233#define inw(p) (__builtin_constant_p((p)) ? __inwc(p) : __inw(p))
234#define inl(p) (__builtin_constant_p((p)) ? __inlc(p) : __inl(p))
235#define outb(v,p) (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p))
236#define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))
237#define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))
238#define __ioaddr(p) (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p))
239/* the following macro is deprecated */
240#define ioaddr(port) __ioaddr((port))
241
242#define insb(p,d,l) __raw_readsb(__ioaddr(p),d,l)
243#define insw(p,d,l) __raw_readsw(__ioaddr(p),d,l)
244
245#define outsb(p,d,l) __raw_writesb(__ioaddr(p),d,l)
246#define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l)
247
248/*
249 * 1:1 mapping for ioremapped regions.
250 */
251#define __mem_pci(x) (x)
252
253#endif
diff --git a/include/asm-arm/arch-cl7500/irq.h b/include/asm-arm/arch-cl7500/irq.h
new file mode 100644
index 000000000000..4b286331f3f8
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/irq.h
@@ -0,0 +1,32 @@
1/*
2 * include/asm-arm/arch-cl7500/irq.h
3 *
4 * Copyright (C) 1996 Russell King
5 * Copyright (C) 1999, 2001 Nexus Electronics Ltd.
6 *
7 * Changelog:
8 * 10-10-1996 RMK Brought up to date with arch-sa110eval
9 * 22-08-1998 RMK Restructured IRQ routines
10 * 11-08-1999 PJB Created ARM7500 version, derived from RiscPC code
11 */
12
13#include <asm/hardware/iomd.h>
14#include <asm/io.h>
15
16static inline int fixup_irq(unsigned int irq)
17{
18 if (irq == IRQ_ISA) {
19 int isabits = *((volatile unsigned int *)0xe002b700);
20 if (isabits == 0) {
21 printk("Spurious ISA IRQ!\n");
22 return irq;
23 }
24 irq = IRQ_ISA_BASE;
25 while (!(isabits & 1)) {
26 irq++;
27 isabits >>= 1;
28 }
29 }
30
31 return irq;
32}
diff --git a/include/asm-arm/arch-cl7500/irqs.h b/include/asm-arm/arch-cl7500/irqs.h
new file mode 100644
index 000000000000..f20996eadf19
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/irqs.h
@@ -0,0 +1,66 @@
1/*
2 * linux/include/asm-arm/arch-cl7500/irqs.h
3 *
4 * Copyright (C) 1999 Nexus Electronics Ltd
5 */
6
7#define IRQ_INT2 0
8#define IRQ_INT1 2
9#define IRQ_VSYNCPULSE 3
10#define IRQ_POWERON 4
11#define IRQ_TIMER0 5
12#define IRQ_TIMER1 6
13#define IRQ_FORCE 7
14#define IRQ_INT8 8
15#define IRQ_ISA 9
16#define IRQ_INT6 10
17#define IRQ_INT5 11
18#define IRQ_INT4 12
19#define IRQ_INT3 13
20#define IRQ_KEYBOARDTX 14
21#define IRQ_KEYBOARDRX 15
22
23#define IRQ_DMA0 16
24#define IRQ_DMA1 17
25#define IRQ_DMA2 18
26#define IRQ_DMA3 19
27#define IRQ_DMAS0 20
28#define IRQ_DMAS1 21
29
30#define IRQ_IOP0 24
31#define IRQ_IOP1 25
32#define IRQ_IOP2 26
33#define IRQ_IOP3 27
34#define IRQ_IOP4 28
35#define IRQ_IOP5 29
36#define IRQ_IOP6 30
37#define IRQ_IOP7 31
38
39#define IRQ_MOUSERX 40
40#define IRQ_MOUSETX 41
41#define IRQ_ADC 42
42#define IRQ_EVENT1 43
43#define IRQ_EVENT2 44
44
45#define IRQ_ISA_BASE 48
46#define IRQ_ISA_3 48
47#define IRQ_ISA_4 49
48#define IRQ_ISA_5 50
49#define IRQ_ISA_7 51
50#define IRQ_ISA_9 52
51#define IRQ_ISA_10 53
52#define IRQ_ISA_11 54
53#define IRQ_ISA_14 55
54
55#define FIQ_INT9 0
56#define FIQ_INT5 1
57#define FIQ_INT6 4
58#define FIQ_INT8 6
59#define FIQ_FORCE 7
60
61/*
62 * This is the offset of the FIQ "IRQ" numbers
63 */
64#define FIQ_START 64
65
66#define IRQ_TIMER IRQ_TIMER0
diff --git a/include/asm-arm/arch-cl7500/memory.h b/include/asm-arm/arch-cl7500/memory.h
new file mode 100644
index 000000000000..9776bba8e585
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/memory.h
@@ -0,0 +1,29 @@
1/*
2 * linux/include/asm-arm/arch-cl7500/memory.h
3 *
4 * Copyright (c) 1996,1997,1998 Russell King.
5 *
6 * Changelog:
7 * 20-Oct-1996 RMK Created
8 * 31-Dec-1997 RMK Fixed definitions to reduce warnings
9 * 11-Jan-1998 RMK Uninlined to reduce hits on cache
10 * 08-Feb-1998 RMK Added __virt_to_bus and __bus_to_virt
11 * 21-Mar-1999 RMK Renamed to memory.h
12 * RMK Added TASK_SIZE and PAGE_OFFSET
13 */
14#ifndef __ASM_ARCH_MEMORY_H
15#define __ASM_ARCH_MEMORY_H
16
17/*
18 * Physical DRAM offset.
19 */
20#define PHYS_OFFSET (0x10000000UL)
21
22/*
23 * These are exactly the same on the RiscPC as the
24 * physical memory view.
25 */
26#define __virt_to_bus(x) __virt_to_phys(x)
27#define __bus_to_virt(x) __phys_to_virt(x)
28
29#endif
diff --git a/include/asm-arm/arch-cl7500/param.h b/include/asm-arm/arch-cl7500/param.h
new file mode 100644
index 000000000000..974bf69fbb1a
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/param.h
@@ -0,0 +1,5 @@
1/*
2 * linux/include/asm-arm/arch-cl7500/param.h
3 *
4 * Copyright (C) 1999 Nexus Electronics Ltd
5 */
diff --git a/include/asm-arm/arch-cl7500/system.h b/include/asm-arm/arch-cl7500/system.h
new file mode 100644
index 000000000000..a9505d6a74d7
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/system.h
@@ -0,0 +1,23 @@
1/*
2 * linux/include/asm-arm/arch-cl7500/system.h
3 *
4 * Copyright (c) 1999 Nexus Electronics Ltd.
5 */
6#ifndef __ASM_ARCH_SYSTEM_H
7#define __ASM_ARCH_SYSTEM_H
8
9#include <asm/hardware/iomd.h>
10#include <asm/io.h>
11
12static inline void arch_idle(void)
13{
14 iomd_writeb(0, IOMD_SUSMODE);
15}
16
17#define arch_reset(mode) \
18 do { \
19 iomd_writeb(0, IOMD_ROMCR0); \
20 cpu_reset(0); \
21 } while (0)
22
23#endif
diff --git a/include/asm-arm/arch-cl7500/timex.h b/include/asm-arm/arch-cl7500/timex.h
new file mode 100644
index 000000000000..8a4175fc0106
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/timex.h
@@ -0,0 +1,13 @@
1/*
2 * linux/include/asm-arm/arch-cl7500/timex.h
3 *
4 * CL7500 architecture timex specifications
5 *
6 * Copyright (C) 1999 Nexus Electronics Ltd
7 */
8
9/*
10 * On the ARM7500, the clock ticks at 2MHz.
11 */
12#define CLOCK_TICK_RATE 2000000
13
diff --git a/include/asm-arm/arch-cl7500/uncompress.h b/include/asm-arm/arch-cl7500/uncompress.h
new file mode 100644
index 000000000000..68601b3e3b95
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/uncompress.h
@@ -0,0 +1,43 @@
1/*
2 * linux/include/asm-arm/arch-cl7500/uncompress.h
3 *
4 * Copyright (C) 1999, 2000 Nexus Electronics Ltd.
5 */
6
7#define BASE 0x03010000
8#define SERBASE (BASE + (0x2f8 << 2))
9
10static __inline__ void putc(char c)
11{
12 while (!(*((volatile unsigned int *)(SERBASE + 0x14)) & 0x20));
13 *((volatile unsigned int *)(SERBASE)) = c;
14}
15
16/*
17 * This does not append a newline
18 */
19static void putstr(const char *s)
20{
21 while (*s) {
22 putc(*s);
23 if (*s == '\n')
24 putc('\r');
25 s++;
26 }
27}
28
29static __inline__ void arch_decomp_setup(void)
30{
31 int baud = 3686400 / (9600 * 32);
32
33 *((volatile unsigned int *)(SERBASE + 0xC)) = 0x80;
34 *((volatile unsigned int *)(SERBASE + 0x0)) = baud & 0xff;
35 *((volatile unsigned int *)(SERBASE + 0x4)) = (baud & 0xff00) >> 8;
36 *((volatile unsigned int *)(SERBASE + 0xC)) = 3; /* 8 bits */
37 *((volatile unsigned int *)(SERBASE + 0x10)) = 3; /* DTR, RTS */
38}
39
40/*
41 * nothing to do
42 */
43#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-cl7500/vmalloc.h b/include/asm-arm/arch-cl7500/vmalloc.h
new file mode 100644
index 000000000000..91883def4889
--- /dev/null
+++ b/include/asm-arm/arch-cl7500/vmalloc.h
@@ -0,0 +1,15 @@
1/*
2 * linux/include/asm-arm/arch-cl7500/vmalloc.h
3 */
4
5/*
6 * Just any arbitrary offset to the start of the vmalloc VM area: the
7 * current 8MB value just means that there will be a 8MB "hole" after the
8 * physical memory until the kernel virtual memory starts. That means that
9 * any out-of-bounds memory accesses will hopefully be caught.
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;)
12 */
13#define VMALLOC_OFFSET (8*1024*1024)
14#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
15#define VMALLOC_END (PAGE_OFFSET + 0x1c000000)
diff --git a/include/asm-arm/arch-clps711x/autcpu12.h b/include/asm-arm/arch-clps711x/autcpu12.h
new file mode 100644
index 000000000000..1588a365f610
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/autcpu12.h
@@ -0,0 +1,78 @@
1/*
2 * AUTCPU12 specific defines
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#ifndef __ASM_ARCH_AUTCPU12_H
21#define __ASM_ARCH_AUTCPU12_H
22
23/*
24 * The CS8900A ethernet chip has its I/O registers wired to chip select 2
25 * (nCS2). This is the mapping for it.
26 */
27#define AUTCPU12_PHYS_CS8900A CS2_PHYS_BASE /* physical */
28#define AUTCPU12_VIRT_CS8900A (0xfe000000) /* virtual */
29
30/*
31 * The flash bank is wired to chip select 0
32 */
33#define AUTCPU12_PHYS_FLASH CS0_PHYS_BASE /* physical */
34
35/* offset for device specific information structure */
36#define AUTCPU12_LCDINFO_OFFS (0x00010000)
37/*
38* Videomemory is the internal SRAM (CS 6)
39*/
40#define AUTCPU12_PHYS_VIDEO CS6_PHYS_BASE
41#define AUTCPU12_VIRT_VIDEO (0xfd000000)
42
43/*
44* All special IO's are tied to CS1
45*/
46#define AUTCPU12_PHYS_CHAR_LCD CS1_PHYS_BASE +0x00000000 /* physical */
47
48#define AUTCPU12_PHYS_NVRAM CS1_PHYS_BASE +0x02000000 /* physical */
49
50#define AUTCPU12_PHYS_CSAUX1 CS1_PHYS_BASE +0x04000000 /* physical */
51
52#define AUTCPU12_PHYS_SMC CS1_PHYS_BASE +0x06000000 /* physical */
53
54#define AUTCPU12_PHYS_CAN CS1_PHYS_BASE +0x08000000 /* physical */
55
56#define AUTCPU12_PHYS_TOUCH CS1_PHYS_BASE +0x0A000000 /* physical */
57
58#define AUTCPU12_PHYS_IO CS1_PHYS_BASE +0x0C000000 /* physical */
59
60#define AUTCPU12_PHYS_LPT CS1_PHYS_BASE +0x0E000000 /* physical */
61
62/*
63* defines for smartmedia card access
64*/
65#define AUTCPU12_SMC_RDY (1<<2)
66#define AUTCPU12_SMC_ALE (1<<3)
67#define AUTCPU12_SMC_CLE (1<<4)
68#define AUTCPU12_SMC_PORT_OFFSET PBDR
69#define AUTCPU12_SMC_SELECT_OFFSET 0x10
70/*
71* defines for lcd contrast
72*/
73#define AUTCPU12_DPOT_PORT_OFFSET PEDR
74#define AUTCPU12_DPOT_CS (1<<0)
75#define AUTCPU12_DPOT_CLK (1<<1)
76#define AUTCPU12_DPOT_UD (1<<2)
77
78#endif
diff --git a/include/asm-arm/arch-clps711x/debug-macro.S b/include/asm-arm/arch-clps711x/debug-macro.S
new file mode 100644
index 000000000000..bc0a5760722b
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/debug-macro.S
@@ -0,0 +1,46 @@
1/* linux/include/asm-arm/arch-clps711x/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 <asm/hardware/clps7111.h>
15
16 .macro addruart,rx
17 mrc p15, 0, \rx, c1, c0
18 tst \rx, #1 @ MMU enabled?
19 moveq \rx, #CLPS7111_PHYS_BASE
20 movne \rx, #CLPS7111_VIRT_BASE
21#ifndef CONFIG_DEBUG_CLPS711X_UART2
22 add \rx, \rx, #0x0000 @ UART1
23#else
24 add \rx, \rx, #0x1000 @ UART2
25#endif
26 .endm
27
28 .macro senduart,rd,rx
29 str \rd, [\rx, #0x0480] @ UARTDR
30 .endm
31
32 .macro waituart,rd,rx
331001: ldr \rd, [\rx, #0x0140] @ SYSFLGx
34 tst \rd, #1 << 11 @ UBUSYx
35 bne 1001b
36 .endm
37
38 .macro busyuart,rd,rx
39 tst \rx, #0x1000 @ UART2 does not have CTS here
40 bne 1002f
411001: ldr \rd, [\rx, #0x0140] @ SYSFLGx
42 tst \rd, #1 << 8 @ CTS
43 bne 1001b
441002:
45 .endm
46
diff --git a/include/asm-arm/arch-clps711x/dma.h b/include/asm-arm/arch-clps711x/dma.h
new file mode 100644
index 000000000000..3c4c5c843252
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/dma.h
@@ -0,0 +1,28 @@
1/*
2 * linux/include/asm-arm/arch-clps711x/dma.h
3 *
4 * Copyright (C) 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 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#ifndef __ASM_ARCH_DMA_H
21#define __ASM_ARCH_DMA_H
22
23#define MAX_DMA_ADDRESS 0xffffffff
24
25#define MAX_DMA_CHANNELS 0
26
27#endif /* _ASM_ARCH_DMA_H */
28
diff --git a/include/asm-arm/arch-clps711x/entry-macro.S b/include/asm-arm/arch-clps711x/entry-macro.S
new file mode 100644
index 000000000000..b31079a1d4a9
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/entry-macro.S
@@ -0,0 +1,51 @@
1/*
2 * include/asm-arm/arch-CLPS711x/entry-macro.S
3 *
4 * Low-level IRQ helper macros for CLPS711X-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#include <asm/hardware/clps7111.h>
11
12 .macro disable_fiq
13 .endm
14
15#if (INTSR2 - INTSR1) != (INTMR2 - INTMR1)
16#error INTSR stride != INTMR stride
17#endif
18
19 .macro get_irqnr_and_base, irqnr, stat, base, mask
20 mov \base, #CLPS7111_BASE
21 ldr \stat, [\base, #INTSR1]
22 ldr \mask, [\base, #INTMR1]
23 mov \irqnr, #4
24 mov \mask, \mask, lsl #16
25 and \stat, \stat, \mask, lsr #16
26 movs \stat, \stat, lsr #4
27 bne 1001f
28
29 add \base, \base, #INTSR2 - INTSR1
30 ldr \stat, [\base, #INTSR1]
31 ldr \mask, [\base, #INTMR1]
32 mov \irqnr, #16
33 mov \mask, \mask, lsl #16
34 and \stat, \stat, \mask, lsr #16
35
361001: tst \stat, #255
37 addeq \irqnr, \irqnr, #8
38 moveq \stat, \stat, lsr #8
39 tst \stat, #15
40 addeq \irqnr, \irqnr, #4
41 moveq \stat, \stat, lsr #4
42 tst \stat, #3
43 addeq \irqnr, \irqnr, #2
44 moveq \stat, \stat, lsr #2
45 tst \stat, #1
46 addeq \irqnr, \irqnr, #1
47 moveq \stat, \stat, lsr #1
48 tst \stat, #1 @ bit 0 should be set
49 .endm
50
51
diff --git a/include/asm-arm/arch-clps711x/hardware.h b/include/asm-arm/arch-clps711x/hardware.h
new file mode 100644
index 000000000000..1386871e1a5a
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/hardware.h
@@ -0,0 +1,238 @@
1/*
2 * linux/include/asm-arm/arch-clps711x/hardware.h
3 *
4 * This file contains the hardware definitions of the Prospector P720T.
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#ifndef __ASM_ARCH_HARDWARE_H
23#define __ASM_ARCH_HARDWARE_H
24
25#include <linux/config.h>
26
27#define CLPS7111_VIRT_BASE 0xff000000
28#define CLPS7111_BASE CLPS7111_VIRT_BASE
29
30/*
31 * The physical addresses that the external chip select signals map to is
32 * dependent on the setting of the nMEDCHG signal on EP7211 and EP7212
33 * processors. CONFIG_EP72XX_BOOT_ROM is only available if these
34 * processors are in use.
35 */
36#ifndef CONFIG_EP72XX_ROM_BOOT
37#define CS0_PHYS_BASE (0x00000000)
38#define CS1_PHYS_BASE (0x10000000)
39#define CS2_PHYS_BASE (0x20000000)
40#define CS3_PHYS_BASE (0x30000000)
41#define CS4_PHYS_BASE (0x40000000)
42#define CS5_PHYS_BASE (0x50000000)
43#define CS6_PHYS_BASE (0x60000000)
44#define CS7_PHYS_BASE (0x70000000)
45#else
46#define CS0_PHYS_BASE (0x70000000)
47#define CS1_PHYS_BASE (0x60000000)
48#define CS2_PHYS_BASE (0x50000000)
49#define CS3_PHYS_BASE (0x40000000)
50#define CS4_PHYS_BASE (0x30000000)
51#define CS5_PHYS_BASE (0x20000000)
52#define CS6_PHYS_BASE (0x10000000)
53#define CS7_PHYS_BASE (0x00000000)
54#endif
55
56#if defined (CONFIG_ARCH_EP7211)
57
58#define EP7211_VIRT_BASE CLPS7111_VIRT_BASE
59#define EP7211_BASE CLPS7111_VIRT_BASE
60#include <asm/hardware/ep7211.h>
61
62#elif defined (CONFIG_ARCH_EP7212)
63
64#define EP7212_VIRT_BASE CLPS7111_VIRT_BASE
65#define EP7212_BASE CLPS7111_VIRT_BASE
66#include <asm/hardware/ep7212.h>
67
68#endif
69
70#define SYSPLD_VIRT_BASE 0xfe000000
71#define SYSPLD_BASE SYSPLD_VIRT_BASE
72
73#ifndef __ASSEMBLER__
74
75#define PCIO_BASE IO_BASE
76
77#endif
78
79
80#if defined (CONFIG_ARCH_AUTCPU12)
81
82#define CS89712_VIRT_BASE CLPS7111_VIRT_BASE
83#define CS89712_BASE CLPS7111_VIRT_BASE
84
85#include <asm/hardware/clps7111.h>
86#include <asm/hardware/ep7212.h>
87#include <asm/hardware/cs89712.h>
88
89#endif
90
91
92#if defined (CONFIG_ARCH_CDB89712)
93
94#include <asm/hardware/clps7111.h>
95#include <asm/hardware/ep7212.h>
96#include <asm/hardware/cs89712.h>
97
98/* dynamic ioremap() areas */
99#define FLASH_START 0x00000000
100#define FLASH_SIZE 0x800000
101#define FLASH_WIDTH 4
102
103#define SRAM_START 0x60000000
104#define SRAM_SIZE 0xc000
105#define SRAM_WIDTH 4
106
107#define BOOTROM_START 0x70000000
108#define BOOTROM_SIZE 0x80
109#define BOOTROM_WIDTH 4
110
111
112/* static cdb89712_map_io() areas */
113#define REGISTER_START 0x80000000
114#define REGISTER_SIZE 0x4000
115#define REGISTER_BASE 0xff000000
116
117#define ETHER_START 0x20000000
118#define ETHER_SIZE 0x1000
119#define ETHER_BASE 0xfe000000
120
121#endif
122
123
124#if defined (CONFIG_ARCH_EDB7211)
125
126/*
127 * The extra 8 lines of the keyboard matrix are wired to chip select 3 (nCS3)
128 * and repeat across it. This is the mapping for it.
129 *
130 * In jumpered boot mode, nCS3 is mapped to 0x4000000, not 0x3000000. This
131 * was cause for much consternation and headscratching. This should probably
132 * be made a compile/run time kernel option.
133 */
134#define EP7211_PHYS_EXTKBD CS3_PHYS_BASE /* physical */
135
136#define EP7211_VIRT_EXTKBD (0xfd000000) /* virtual */
137
138
139/*
140 * The CS8900A ethernet chip has its I/O registers wired to chip select 2
141 * (nCS2). This is the mapping for it.
142 *
143 * In jumpered boot mode, nCS2 is mapped to 0x5000000, not 0x2000000. This
144 * was cause for much consternation and headscratching. This should probably
145 * be made a compile/run time kernel option.
146 */
147#define EP7211_PHYS_CS8900A CS2_PHYS_BASE /* physical */
148
149#define EP7211_VIRT_CS8900A (0xfc000000) /* virtual */
150
151
152/*
153 * The two flash banks are wired to chip selects 0 and 1. This is the mapping
154 * for them.
155 *
156 * nCS0 and nCS1 are at 0x70000000 and 0x60000000, respectively, when running
157 * in jumpered boot mode.
158 */
159#define EP7211_PHYS_FLASH1 CS0_PHYS_BASE /* physical */
160#define EP7211_PHYS_FLASH2 CS1_PHYS_BASE /* physical */
161
162#define EP7211_VIRT_FLASH1 (0xfa000000) /* virtual */
163#define EP7211_VIRT_FLASH2 (0xfb000000) /* virtual */
164
165#endif /* CONFIG_ARCH_EDB7211 */
166
167
168/*
169 * Relevant bits in port D, which controls power to the various parts of
170 * the LCD on the EDB7211.
171 */
172#define EDB_PD1_LCD_DC_DC_EN (1<<1)
173#define EDB_PD2_LCDEN (1<<2)
174#define EDB_PD3_LCDBL (1<<3)
175
176
177#if defined (CONFIG_ARCH_CEIVA)
178
179#define CEIVA_VIRT_BASE CLPS7111_VIRT_BASE
180#define CEIVA_BASE CLPS7111_VIRT_BASE
181
182#include <asm/hardware/clps7111.h>
183#include <asm/hardware/ep7212.h>
184
185
186/*
187 * The two flash banks are wired to chip selects 0 and 1. This is the mapping
188 * for them.
189 *
190 * nCS0 and nCS1 are at 0x70000000 and 0x60000000, respectively, when running
191 * in jumpered boot mode.
192 */
193#define CEIVA_PHYS_FLASH1 CS0_PHYS_BASE /* physical */
194#define CEIVA_PHYS_FLASH2 CS1_PHYS_BASE /* physical */
195
196#define CEIVA_VIRT_FLASH1 (0xfa000000) /* virtual */
197#define CEIVA_VIRT_FLASH2 (0xfb000000) /* virtual */
198
199#define CEIVA_FLASH_SIZE 0x100000
200#define CEIVA_FLASH_WIDTH 2
201
202#define SRAM_START 0x60000000
203#define SRAM_SIZE 0xc000
204#define SRAM_WIDTH 4
205
206#define BOOTROM_START 0x70000000
207#define BOOTROM_SIZE 0x80
208#define BOOTROM_WIDTH 4
209
210/*
211 * SED1355 LCD controller
212 */
213#define CEIVA_PHYS_SED1355 CS2_PHYS_BASE
214#define CEIVA_VIRT_SED1355 (0xfc000000)
215
216/*
217 * Relevant bits in port D, which controls power to the various parts of
218 * the LCD on the Ceiva Photo Max, and reset to the LCD controller.
219 */
220
221// Reset line to SED1355 (must be high to operate)
222#define CEIVA_PD1_LCDRST (1<<1)
223// LCD panel enable (set to one, to enable LCD)
224#define CEIVA_PD4_LCDEN (1<<4)
225// Backlight (set to one, to turn on backlight
226#define CEIVA_PD5_LCDBL (1<<5)
227
228/*
229 * Relevant bits in port B, which report the status of the buttons.
230 */
231
232// White button
233#define CEIVA_PB4_WHT_BTN (1<<4)
234// Black button
235#define CEIVA_PB0_BLK_BTN (1<<0)
236#endif // #if defined (CONFIG_ARCH_CEIVA)
237
238#endif
diff --git a/include/asm-arm/arch-clps711x/io.h b/include/asm-arm/arch-clps711x/io.h
new file mode 100644
index 000000000000..14d7e8da5453
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/io.h
@@ -0,0 +1,37 @@
1/*
2 * linux/include/asm-arm/arch-clps711x/io.h
3 *
4 * Copyright (C) 1999 ARM Limited
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#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22
23#define IO_SPACE_LIMIT 0xffffffff
24
25#define __io(a) ((void __iomem *)(a))
26#define __mem_pci(a) (a)
27#define __mem_isa(a) (a)
28
29/*
30 * We don't support ins[lb]/outs[lb]. Make them fault.
31 */
32#define __raw_readsb(p,d,l) do { *(int *)0 = 0; } while (0)
33#define __raw_readsl(p,d,l) do { *(int *)0 = 0; } while (0)
34#define __raw_writesb(p,d,l) do { *(int *)0 = 0; } while (0)
35#define __raw_writesl(p,d,l) do { *(int *)0 = 0; } while (0)
36
37#endif
diff --git a/include/asm-arm/arch-clps711x/irqs.h b/include/asm-arm/arch-clps711x/irqs.h
new file mode 100644
index 000000000000..76025dc87637
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/irqs.h
@@ -0,0 +1,53 @@
1/*
2 * linux/include/asm-arm/arch-clps711x/irqs.h
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
21/*
22 * Interrupts from INTSR1
23 */
24#define IRQ_CSINT 4
25#define IRQ_EINT1 5
26#define IRQ_EINT2 6
27#define IRQ_EINT3 7
28#define IRQ_TC1OI 8
29#define IRQ_TC2OI 9
30#define IRQ_RTCMI 10
31#define IRQ_TINT 11
32#define IRQ_UTXINT1 12
33#define IRQ_URXINT1 13
34#define IRQ_UMSINT 14
35#define IRQ_SSEOTI 15
36
37#define INT1_IRQS (0x0000fff0)
38#define INT1_ACK_IRQS (0x00004f10)
39
40/*
41 * Interrupts from INTSR2
42 */
43#define IRQ_KBDINT (16+0) /* bit 0 */
44#define IRQ_SS2RX (16+1) /* bit 1 */
45#define IRQ_SS2TX (16+2) /* bit 2 */
46#define IRQ_UTXINT2 (16+12) /* bit 12 */
47#define IRQ_URXINT2 (16+13) /* bit 13 */
48
49#define INT2_IRQS (0x30070000)
50#define INT2_ACK_IRQS (0x00010000)
51
52#define NR_IRQS 30
53
diff --git a/include/asm-arm/arch-clps711x/memory.h b/include/asm-arm/arch-clps711x/memory.h
new file mode 100644
index 000000000000..bd978947db42
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/memory.h
@@ -0,0 +1,128 @@
1/*
2 * linux/include/asm-arm/arch-clps711x/memory.h
3 *
4 * Copyright (C) 1999 ARM Limited
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#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H
22
23#include <linux/config.h>
24
25/*
26 * Physical DRAM offset.
27 */
28#define PHYS_OFFSET (0xc0000000UL)
29
30/*
31 * Virtual view <-> DMA view memory address translations
32 * virt_to_bus: Used to translate the virtual address to an
33 * address suitable to be passed to set_dma_addr
34 * bus_to_virt: Used to convert an address for DMA operations
35 * to an address that the kernel can use.
36 */
37
38#if defined(CONFIG_ARCH_CDB89712)
39
40#define __virt_to_bus(x) (x)
41#define __bus_to_virt(x) (x)
42
43#elif defined (CONFIG_ARCH_AUTCPU12)
44
45#define __virt_to_bus(x) (x)
46#define __bus_to_virt(x) (x)
47
48#else
49
50#define __virt_to_bus(x) ((x) - PAGE_OFFSET)
51#define __bus_to_virt(x) ((x) + PAGE_OFFSET)
52
53#endif
54
55
56/*
57 * Like the SA1100, the EDB7211 has a large gap between physical RAM
58 * banks. In 2.2, the Psion (CL-PS7110) port added custom support for
59 * discontiguous physical memory. In 2.4, we can use the standard
60 * Linux NUMA support.
61 *
62 * This is not necessary for EP7211 implementations with only one used
63 * memory bank. For those systems, simply undefine CONFIG_DISCONTIGMEM.
64 */
65
66#ifdef CONFIG_DISCONTIGMEM
67/*
68 * Because of the wide memory address space between physical RAM banks on the
69 * SA1100, it's much more convenient to use Linux's NUMA support to implement
70 * our memory map representation. Assuming all memory nodes have equal access
71 * characteristics, we then have generic discontiguous memory support.
72 *
73 * Of course, all this isn't mandatory for SA1100 implementations with only
74 * one used memory bank. For those, simply undefine CONFIG_DISCONTIGMEM.
75 *
76 * The nodes are matched with the physical memory bank addresses which are
77 * incidentally the same as virtual addresses.
78 *
79 * node 0: 0xc0000000 - 0xc7ffffff
80 * node 1: 0xc8000000 - 0xcfffffff
81 * node 2: 0xd0000000 - 0xd7ffffff
82 * node 3: 0xd8000000 - 0xdfffffff
83 */
84
85/*
86 * Given a kernel address, find the home node of the underlying memory.
87 */
88#define KVADDR_TO_NID(addr) \
89 (((unsigned long)(addr) - PAGE_OFFSET) >> NODE_MAX_MEM_SHIFT)
90
91/*
92 * Given a page frame number, convert it to a node id.
93 */
94#define PFN_TO_NID(pfn) \
95 (((pfn) - PHYS_PFN_OFFSET) >> (NODE_MAX_MEM_SHIFT - PAGE_SHIFT))
96
97/*
98 * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
99 * and returns the mem_map of that node.
100 */
101#define ADDR_TO_MAPBASE(kaddr) \
102 NODE_MEM_MAP(KVADDR_TO_NID((unsigned long)(kaddr)))
103
104#define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn))
105
106/*
107 * Given a kaddr, LOCAL_MAR_NR finds the owning node of the memory
108 * and returns the index corresponding to the appropriate page in the
109 * node's mem_map.
110 */
111#define LOCAL_MAP_NR(addr) \
112 (((unsigned long)(addr) & (NODE_MAX_MEM_SIZE - 1)) >> PAGE_SHIFT)
113
114/*
115 * The PS7211 allows up to 256MB max per DRAM bank, but the EDB7211
116 * uses only one of the two banks (bank #1). However, even within
117 * bank #1, memory is discontiguous.
118 *
119 * The EDB7211 has two 8MB DRAM areas with 8MB of empty space between
120 * them, so we use 24 for the node max shift to get 16MB node sizes.
121 */
122#define NODE_MAX_MEM_SHIFT 24
123#define NODE_MAX_MEM_SIZE (1<<NODE_MAX_MEM_SHIFT)
124
125#endif /* CONFIG_DISCONTIGMEM */
126
127#endif
128
diff --git a/include/asm-arm/arch-clps711x/param.h b/include/asm-arm/arch-clps711x/param.h
new file mode 100644
index 000000000000..86f6bd29623d
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/param.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-clps711x/param.h
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 */
diff --git a/include/asm-arm/arch-clps711x/syspld.h b/include/asm-arm/arch-clps711x/syspld.h
new file mode 100644
index 000000000000..960578a22a8e
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/syspld.h
@@ -0,0 +1,121 @@
1/*
2 * linux/include/asm-arm/arch-clps711x/syspld.h
3 *
4 * System Control PLD register definitions.
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#ifndef __ASM_ARCH_SYSPLD_H
23#define __ASM_ARCH_SYSPLD_H
24
25#define SYSPLD_PHYS_BASE (0x10000000)
26
27#ifndef __ASSEMBLY__
28#include <asm/types.h>
29
30#define SYSPLD_REG(type,off) (*(volatile type *)(SYSPLD_BASE + off))
31#else
32#define SYSPLD_REG(type,off) (off)
33#endif
34
35#define PLD_INT SYSPLD_REG(u32, 0x000000)
36#define PLD_INT_PENIRQ (1 << 5)
37#define PLD_INT_UCB_IRQ (1 << 1)
38#define PLD_INT_KBD_ATN (1 << 0) /* EINT1 */
39
40#define PLD_PWR SYSPLD_REG(u32, 0x000004)
41#define PLD_PWR_EXT (1 << 5)
42#define PLD_PWR_MODE (1 << 4) /* 1 = PWM, 0 = PFM */
43#define PLD_S4_ON (1 << 3) /* LCD bias voltage enable */
44#define PLD_S3_ON (1 << 2) /* LCD backlight enable */
45#define PLD_S2_ON (1 << 1) /* LCD 3V3 supply enable */
46#define PLD_S1_ON (1 << 0) /* LCD 3V supply enable */
47
48#define PLD_KBD SYSPLD_REG(u32, 0x000008)
49#define PLD_KBD_WAKE (1 << 1)
50#define PLD_KBD_EN (1 << 0)
51
52#define PLD_SPI SYSPLD_REG(u32, 0x00000c)
53#define PLD_SPI_EN (1 << 0)
54
55#define PLD_IO SYSPLD_REG(u32, 0x000010)
56#define PLD_IO_BOOTSEL (1 << 6) /* boot sel switch */
57#define PLD_IO_USER (1 << 5) /* user defined switch */
58#define PLD_IO_LED3 (1 << 4)
59#define PLD_IO_LED2 (1 << 3)
60#define PLD_IO_LED1 (1 << 2)
61#define PLD_IO_LED0 (1 << 1)
62#define PLD_IO_LEDEN (1 << 0)
63
64#define PLD_IRDA SYSPLD_REG(u32, 0x000014)
65#define PLD_IRDA_EN (1 << 0)
66
67#define PLD_COM2 SYSPLD_REG(u32, 0x000018)
68#define PLD_COM2_EN (1 << 0)
69
70#define PLD_COM1 SYSPLD_REG(u32, 0x00001c)
71#define PLD_COM1_EN (1 << 0)
72
73#define PLD_AUD SYSPLD_REG(u32, 0x000020)
74#define PLD_AUD_DIV1 (1 << 6)
75#define PLD_AUD_DIV0 (1 << 5)
76#define PLD_AUD_CLK_SEL1 (1 << 4)
77#define PLD_AUD_CLK_SEL0 (1 << 3)
78#define PLD_AUD_MIC_PWR (1 << 2)
79#define PLD_AUD_MIC_GAIN (1 << 1)
80#define PLD_AUD_CODEC_EN (1 << 0)
81
82#define PLD_CF SYSPLD_REG(u32, 0x000024)
83#define PLD_CF2_SLEEP (1 << 5)
84#define PLD_CF1_SLEEP (1 << 4)
85#define PLD_CF2_nPDREQ (1 << 3)
86#define PLD_CF1_nPDREQ (1 << 2)
87#define PLD_CF2_nIRQ (1 << 1)
88#define PLD_CF1_nIRQ (1 << 0)
89
90#define PLD_SDC SYSPLD_REG(u32, 0x000028)
91#define PLD_SDC_INT_EN (1 << 2)
92#define PLD_SDC_WP (1 << 1)
93#define PLD_SDC_CD (1 << 0)
94
95#define PLD_FPGA SYSPLD_REG(u32, 0x00002c)
96
97#define PLD_CODEC SYSPLD_REG(u32, 0x400000)
98#define PLD_CODEC_IRQ3 (1 << 4)
99#define PLD_CODEC_IRQ2 (1 << 3)
100#define PLD_CODEC_IRQ1 (1 << 2)
101#define PLD_CODEC_EN (1 << 0)
102
103#define PLD_BRITE SYSPLD_REG(u32, 0x400004)
104#define PLD_BRITE_UP (1 << 1)
105#define PLD_BRITE_DN (1 << 0)
106
107#define PLD_LCDEN SYSPLD_REG(u32, 0x400008)
108#define PLD_LCDEN_EN (1 << 0)
109
110#define PLD_ID SYSPLD_REG(u32, 0x40000c)
111
112#define PLD_TCH SYSPLD_REG(u32, 0x400010)
113#define PLD_TCH_PENIRQ (1 << 1)
114#define PLD_TCH_EN (1 << 0)
115
116#define PLD_GPIO SYSPLD_REG(u32, 0x400014)
117#define PLD_GPIO2 (1 << 2)
118#define PLD_GPIO1 (1 << 1)
119#define PLD_GPIO0 (1 << 0)
120
121#endif
diff --git a/include/asm-arm/arch-clps711x/system.h b/include/asm-arm/arch-clps711x/system.h
new file mode 100644
index 000000000000..2ab981fee37f
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/system.h
@@ -0,0 +1,38 @@
1/*
2 * linux/include/asm-arm/arch-clps711x/system.h
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#ifndef __ASM_ARCH_SYSTEM_H
21#define __ASM_ARCH_SYSTEM_H
22
23#include <asm/hardware/clps7111.h>
24
25static inline void arch_idle(void)
26{
27 clps_writel(1, HALT);
28 __asm__ __volatile__(
29 "mov r0, r0\n\
30 mov r0, r0");
31}
32
33static inline void arch_reset(char mode)
34{
35 cpu_reset(0);
36}
37
38#endif
diff --git a/include/asm-arm/arch-clps711x/time.h b/include/asm-arm/arch-clps711x/time.h
new file mode 100644
index 000000000000..9cb27cd4e6ae
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/time.h
@@ -0,0 +1,48 @@
1/*
2 * linux/include/asm-arm/arch-clps711x/time.h
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 <asm/leds.h>
21#include <asm/hardware/clps7111.h>
22
23extern void clps711x_setup_timer(void);
24
25/*
26 * IRQ handler for the timer
27 */
28static irqreturn_t
29p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
30{
31 do_leds();
32 do_timer(regs);
33#ifndef CONFIG_SMP
34 update_process_times(user_mode(regs));
35#endif
36 do_profile(regs);
37 return IRQ_HANDLED;
38}
39
40/*
41 * Set up timer interrupt, and return the current time in seconds.
42 */
43void __init time_init(void)
44{
45 clps711x_setup_timer();
46 timer_irq.handler = p720t_timer_interrupt;
47 setup_irq(IRQ_TC2OI, &timer_irq);
48}
diff --git a/include/asm-arm/arch-clps711x/timex.h b/include/asm-arm/arch-clps711x/timex.h
new file mode 100644
index 000000000000..dcbb381da3dd
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/timex.h
@@ -0,0 +1,23 @@
1/*
2 * linux/include/asm-arm/arch-clps711x/timex.h
3 *
4 * Prospector 720T architecture timex specifications
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
23#define CLOCK_TICK_RATE 512000
diff --git a/include/asm-arm/arch-clps711x/uncompress.h b/include/asm-arm/arch-clps711x/uncompress.h
new file mode 100644
index 000000000000..7d0ab791b16c
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/uncompress.h
@@ -0,0 +1,67 @@
1/*
2 * linux/include/asm-arm/arch-clps711x/uncompress.h
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/config.h>
21#include <asm/arch/io.h>
22#include <asm/arch/hardware.h>
23#include <asm/hardware/clps7111.h>
24
25#undef CLPS7111_BASE
26#define CLPS7111_BASE CLPS7111_PHYS_BASE
27
28#define barrier() __asm__ __volatile__("": : :"memory")
29#define __raw_readl(p) (*(unsigned long *)(p))
30#define __raw_writel(v,p) (*(unsigned long *)(p) = (v))
31
32#ifdef CONFIG_DEBUG_CLPS711X_UART2
33#define SYSFLGx SYSFLG2
34#define UARTDRx UARTDR2
35#else
36#define SYSFLGx SYSFLG1
37#define UARTDRx UARTDR1
38#endif
39
40/*
41 * This does not append a newline
42 */
43static void putstr(const char *s)
44{
45 char c;
46
47 while ((c = *s++) != '\0') {
48 while (clps_readl(SYSFLGx) & SYSFLG_UTXFF)
49 barrier();
50 clps_writel(c, UARTDRx);
51
52 if (c == '\n') {
53 while (clps_readl(SYSFLGx) & SYSFLG_UTXFF)
54 barrier();
55 clps_writel('\r', UARTDRx);
56 }
57 }
58 while (clps_readl(SYSFLGx) & SYSFLG_UBUSY)
59 barrier();
60}
61
62/*
63 * nothing to do
64 */
65#define arch_decomp_setup()
66
67#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-clps711x/vmalloc.h b/include/asm-arm/arch-clps711x/vmalloc.h
new file mode 100644
index 000000000000..42571ed5e493
--- /dev/null
+++ b/include/asm-arm/arch-clps711x/vmalloc.h
@@ -0,0 +1,31 @@
1/*
2 * linux/include/asm-arm/arch-clps711x/vmalloc.h
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
21/*
22 * Just any arbitrary offset to the start of the vmalloc VM area: the
23 * current 8MB value just means that there will be a 8MB "hole" after the
24 * physical memory until the kernel virtual memory starts. That means that
25 * any out-of-bounds memory accesses will hopefully be caught.
26 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
27 * area for the same reason. ;)
28 */
29#define VMALLOC_OFFSET (8*1024*1024)
30#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
31#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-ebsa110/debug-macro.S b/include/asm-arm/arch-ebsa110/debug-macro.S
new file mode 100644
index 000000000000..dcd03a40c502
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/debug-macro.S
@@ -0,0 +1,34 @@
1/* linux/include/asm-arm/arch-ebsa110/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .macro addruart,rx
15 mov \rx, #0xf0000000
16 orr \rx, \rx, #0x00000be0
17 .endm
18
19 .macro senduart,rd,rx
20 strb \rd, [\rx]
21 .endm
22
23 .macro busyuart,rd,rx
241002: ldrb \rd, [\rx, #0x14]
25 and \rd, \rd, #0x60
26 teq \rd, #0x60
27 bne 1002b
28 .endm
29
30 .macro waituart,rd,rx
311001: ldrb \rd, [\rx, #0x18]
32 tst \rd, #0x10
33 beq 1001b
34 .endm
diff --git a/include/asm-arm/arch-ebsa110/dma.h b/include/asm-arm/arch-ebsa110/dma.h
new file mode 100644
index 000000000000..d491776ac1cc
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/dma.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-ebsa110/dma.h
3 *
4 * Copyright (C) 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 * EBSA110 DMA definitions
11 */
12#ifndef __ASM_ARCH_DMA_H
13#define __ASM_ARCH_DMA_H
14
15#define MAX_DMA_ADDRESS 0xffffffff
16#define MAX_DMA_CHANNELS 0
17
18#endif /* _ASM_ARCH_DMA_H */
19
diff --git a/include/asm-arm/arch-ebsa110/entry-macro.S b/include/asm-arm/arch-ebsa110/entry-macro.S
new file mode 100644
index 000000000000..b12ca04f998c
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/entry-macro.S
@@ -0,0 +1,33 @@
1/*
2 * include/asm-arm/arch-ebsa110/entry-macro.S
3 *
4 * Low-level IRQ helper macros for ebsa110 platform.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11
12
13#define IRQ_STAT 0xff000000 /* read */
14
15 .macro disable_fiq
16 .endm
17
18 .macro get_irqnr_and_base, irqnr, stat, base, tmp
19 mov \base, #IRQ_STAT
20 ldrb \stat, [\base] @ get interrupts
21 mov \irqnr, #0
22 tst \stat, #15
23 addeq \irqnr, \irqnr, #4
24 moveq \stat, \stat, lsr #4
25 tst \stat, #3
26 addeq \irqnr, \irqnr, #2
27 moveq \stat, \stat, lsr #2
28 tst \stat, #1
29 addeq \irqnr, \irqnr, #1
30 moveq \stat, \stat, lsr #1
31 tst \stat, #1 @ bit 0 should be set
32 .endm
33
diff --git a/include/asm-arm/arch-ebsa110/hardware.h b/include/asm-arm/arch-ebsa110/hardware.h
new file mode 100644
index 000000000000..4e41c2358f4e
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/hardware.h
@@ -0,0 +1,66 @@
1/*
2 * linux/include/asm-arm/arch-ebsa110/hardware.h
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 * This file contains the hardware definitions of the EBSA-110.
11 */
12#ifndef __ASM_ARCH_HARDWARE_H
13#define __ASM_ARCH_HARDWARE_H
14
15/*
16 * The EBSA110 has a weird "ISA IO" region:
17 *
18 * Region 0 (addr = 0xf0000000 + io << 2)
19 * --------------------------------------------------------
20 * Physical region IO region
21 * f0000fe0 - f0000ffc 3f8 - 3ff ttyS0
22 * f0000e60 - f0000e64 398 - 399
23 * f0000de0 - f0000dfc 378 - 37f lp0
24 * f0000be0 - f0000bfc 2f8 - 2ff ttyS1
25 *
26 * Region 1 (addr = 0xf0000000 + (io & ~1) << 1 + (io & 1))
27 * --------------------------------------------------------
28 * Physical region IO region
29 * f00014f1 a79 pnp write data
30 * f00007c0 - f00007c1 3e0 - 3e1 pcmcia
31 * f00004f1 279 pnp address
32 * f0000440 - f000046c 220 - 236 eth0
33 * f0000405 203 pnp read data
34 */
35
36#define ISAMEM_PHYS 0xe0000000
37#define ISAMEM_SIZE 0x10000000
38
39#define ISAIO_PHYS 0xf0000000
40#define ISAIO_SIZE PGDIR_SIZE
41
42#define TRICK0_PHYS 0xf2000000
43#define TRICK1_PHYS 0xf2400000
44#define TRICK2_PHYS 0xf2800000
45#define TRICK3_PHYS 0xf2c00000
46#define TRICK4_PHYS 0xf3000000
47#define TRICK5_PHYS 0xf3400000
48#define TRICK6_PHYS 0xf3800000
49#define TRICK7_PHYS 0xf3c00000
50
51#define ISAMEM_BASE 0xe0000000
52#define ISAIO_BASE 0xf0000000
53
54#define PIT_BASE 0xfc000000
55#define SOFT_BASE 0xfd000000
56
57/*
58 * RAM definitions
59 */
60#define FLUSH_BASE_PHYS 0x40000000
61#define FLUSH_BASE 0xdf000000
62
63#define UNCACHEABLE_ADDR 0xff000000 /* IRQ_STAT */
64
65#endif
66
diff --git a/include/asm-arm/arch-ebsa110/io.h b/include/asm-arm/arch-ebsa110/io.h
new file mode 100644
index 000000000000..68e04c0bb3f7
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/io.h
@@ -0,0 +1,78 @@
1/*
2 * linux/include/asm-arm/arch-ebsa110/io.h
3 *
4 * Copyright (C) 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 * Modifications:
11 * 06-Dec-1997 RMK Created.
12 */
13#ifndef __ASM_ARM_ARCH_IO_H
14#define __ASM_ARM_ARCH_IO_H
15
16#define IO_SPACE_LIMIT 0xffff
17
18u8 __inb8(unsigned int port);
19void __outb8(u8 val, unsigned int port);
20
21u8 __inb16(unsigned int port);
22void __outb16(u8 val, unsigned int port);
23
24u16 __inw(unsigned int port);
25void __outw(u16 val, unsigned int port);
26
27u32 __inl(unsigned int port);
28void __outl(u32 val, unsigned int port);
29
30u8 __readb(void __iomem *addr);
31u16 __readw(void __iomem *addr);
32u32 __readl(void __iomem *addr);
33
34void __writeb(u8 val, void __iomem *addr);
35void __writew(u16 val, void __iomem *addr);
36void __writel(u32 val, void __iomem *addr);
37
38/*
39 * Argh, someone forgot the IOCS16 line. We therefore have to handle
40 * the byte stearing by selecting the correct byte IO functions here.
41 */
42#ifdef ISA_SIXTEEN_BIT_PERIPHERAL
43#define inb(p) __inb16(p)
44#define outb(v,p) __outb16(v,p)
45#else
46#define inb(p) __inb8(p)
47#define outb(v,p) __outb8(v,p)
48#endif
49
50#define inw(p) __inw(p)
51#define outw(v,p) __outw(v,p)
52
53#define inl(p) __inl(p)
54#define outl(v,p) __outl(v,p)
55
56#define readb(b) __readb(b)
57#define readw(b) __readw(b)
58#define readl(b) __readl(b)
59#define readb_relaxed(addr) readb(addr)
60#define readw_relaxed(addr) readw(addr)
61#define readl_relaxed(addr) readl(addr)
62
63#define writeb(v,b) __writeb(v,b)
64#define writew(v,b) __writew(v,b)
65#define writel(v,b) __writel(v,b)
66
67#define __arch_ioremap(cookie,sz,c,a) ((void __iomem *)(cookie))
68#define __arch_iounmap(cookie) do { } while (0)
69
70extern void insb(unsigned int port, void *buf, int sz);
71extern void insw(unsigned int port, void *buf, int sz);
72extern void insl(unsigned int port, void *buf, int sz);
73
74extern void outsb(unsigned int port, const void *buf, int sz);
75extern void outsw(unsigned int port, const void *buf, int sz);
76extern void outsl(unsigned int port, const void *buf, int sz);
77
78#endif
diff --git a/include/asm-arm/arch-ebsa110/irqs.h b/include/asm-arm/arch-ebsa110/irqs.h
new file mode 100644
index 000000000000..ded9bd9d7b8b
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/irqs.h
@@ -0,0 +1,20 @@
1/*
2 * linux/include/asm-arm/arch-ebsa110/irqs.h
3 *
4 * Copyright (C) 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
11#define NR_IRQS 8
12
13#define IRQ_EBSA110_PRINTER 0
14#define IRQ_EBSA110_COM1 1
15#define IRQ_EBSA110_COM2 2
16#define IRQ_EBSA110_ETHERNET 3
17#define IRQ_EBSA110_TIMER0 4
18#define IRQ_EBSA110_TIMER1 5
19#define IRQ_EBSA110_PCMCIA 6
20#define IRQ_EBSA110_IMMEDIATE 7
diff --git a/include/asm-arm/arch-ebsa110/memory.h b/include/asm-arm/arch-ebsa110/memory.h
new file mode 100644
index 000000000000..5a9493e12275
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/memory.h
@@ -0,0 +1,31 @@
1/*
2 * linux/include/asm-arm/arch-ebsa110/memory.h
3 *
4 * Copyright (C) 1996-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 * Changelog:
11 * 20-Oct-1996 RMK Created
12 * 31-Dec-1997 RMK Fixed definitions to reduce warnings
13 * 21-Mar-1999 RMK Renamed to memory.h
14 * RMK Moved TASK_SIZE and PAGE_OFFSET here
15 */
16#ifndef __ASM_ARCH_MEMORY_H
17#define __ASM_ARCH_MEMORY_H
18
19/*
20 * Physical DRAM offset.
21 */
22#define PHYS_OFFSET (0x00000000UL)
23
24/*
25 * We keep this 1:1 so that we don't interfere
26 * with the PCMCIA memory regions
27 */
28#define __virt_to_bus(x) (x)
29#define __bus_to_virt(x) (x)
30
31#endif
diff --git a/include/asm-arm/arch-ebsa110/param.h b/include/asm-arm/arch-ebsa110/param.h
new file mode 100644
index 000000000000..be19b08d1c75
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/param.h
@@ -0,0 +1,4 @@
1/*
2 * linux/include/asm-arm/arch-ebsa110/param.h
3 */
4#define HZ 200
diff --git a/include/asm-arm/arch-ebsa110/system.h b/include/asm-arm/arch-ebsa110/system.h
new file mode 100644
index 000000000000..d7c8fece0bc5
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/system.h
@@ -0,0 +1,39 @@
1/*
2 * linux/include/asm-arm/arch-ebsa110/system.h
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#ifndef __ASM_ARCH_SYSTEM_H
11#define __ASM_ARCH_SYSTEM_H
12
13/*
14 * EBSA110 idling methodology:
15 *
16 * We can not execute the "wait for interrupt" instruction since that
17 * will stop our MCLK signal (which provides the clock for the glue
18 * logic, and therefore the timer interrupt).
19 *
20 * Instead, we spin, polling the IRQ_STAT register for the occurrence
21 * of any interrupt with core clock down to the memory clock.
22 */
23static inline void arch_idle(void)
24{
25 const char *irq_stat = (char *)0xff000000;
26
27 /* disable clock switching */
28 asm volatile ("mcr p15, 0, ip, c15, c2, 2" : : : "cc");
29
30 /* wait for an interrupt to occur */
31 while (!*irq_stat);
32
33 /* enable clock switching */
34 asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
35}
36
37#define arch_reset(mode) cpu_reset(0x80000000)
38
39#endif
diff --git a/include/asm-arm/arch-ebsa110/timex.h b/include/asm-arm/arch-ebsa110/timex.h
new file mode 100644
index 000000000000..1e9ef045092b
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/timex.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-ebsa110/timex.h
3 *
4 * Copyright (C) 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 * EBSA110 architecture timex specifications
11 */
12
13/*
14 * On the EBSA, the clock ticks at weird rates.
15 * This is therefore not used to calculate the
16 * divisor.
17 */
18#define CLOCK_TICK_RATE 47894000
19
diff --git a/include/asm-arm/arch-ebsa110/uncompress.h b/include/asm-arm/arch-ebsa110/uncompress.h
new file mode 100644
index 000000000000..eee95581a923
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/uncompress.h
@@ -0,0 +1,44 @@
1/*
2 * linux/include/asm-arm/arch-ebsa110/uncompress.h
3 *
4 * Copyright (C) 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
11/*
12 * This does not append a newline
13 */
14static void putstr(const char *s)
15{
16 unsigned long tmp1, tmp2;
17 __asm__ __volatile__(
18 "ldrb %0, [%2], #1\n"
19" teq %0, #0\n"
20" beq 3f\n"
21"1: strb %0, [%3]\n"
22"2: ldrb %1, [%3, #0x14]\n"
23" and %1, %1, #0x60\n"
24" teq %1, #0x60\n"
25" bne 2b\n"
26" teq %0, #'\n'\n"
27" moveq %0, #'\r'\n"
28" beq 1b\n"
29" ldrb %0, [%2], #1\n"
30" teq %0, #0\n"
31" bne 1b\n"
32"3: ldrb %1, [%3, #0x14]\n"
33" and %1, %1, #0x60\n"
34" teq %1, #0x60\n"
35" bne 3b"
36 : "=&r" (tmp1), "=&r" (tmp2)
37 : "r" (s), "r" (0xf0000be0) : "cc");
38}
39
40/*
41 * nothing to do
42 */
43#define arch_decomp_setup()
44#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-ebsa110/vmalloc.h b/include/asm-arm/arch-ebsa110/vmalloc.h
new file mode 100644
index 000000000000..759659be109f
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/vmalloc.h
@@ -0,0 +1,21 @@
1/*
2 * linux/include/asm-arm/arch-ebsa110/vmalloc.h
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
11/*
12 * Just any arbitrary offset to the start of the vmalloc VM area: the
13 * current 8MB value just means that there will be a 8MB "hole" after the
14 * physical memory until the kernel virtual memory starts. That means that
15 * any out-of-bounds memory accesses will hopefully be caught.
16 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
17 * area for the same reason. ;)
18 */
19#define VMALLOC_OFFSET (8*1024*1024)
20#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
21#define VMALLOC_END (PAGE_OFFSET + 0x1f000000)
diff --git a/include/asm-arm/arch-ebsa285/debug-macro.S b/include/asm-arm/arch-ebsa285/debug-macro.S
new file mode 100644
index 000000000000..237853db6e2f
--- /dev/null
+++ b/include/asm-arm/arch-ebsa285/debug-macro.S
@@ -0,0 +1,66 @@
1/* linux/include/asm-arm/arch-ebsa285/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 <asm/hardware/dec21285.h>
15
16#ifndef CONFIG_DEBUG_DC21285_PORT
17 /* For NetWinder debugging */
18 .macro addruart,rx
19 mrc p15, 0, \rx, c1, c0
20 tst \rx, #1 @ MMU enabled?
21 moveq \rx, #0x7c000000 @ physical
22 movne \rx, #0xff000000 @ virtual
23 orr \rx, \rx, #0x000003f8
24 .endm
25
26 .macro senduart,rd,rx
27 strb \rd, [\rx]
28 .endm
29
30 .macro busyuart,rd,rx
311002: ldrb \rd, [\rx, #0x5]
32 and \rd, \rd, #0x60
33 teq \rd, #0x60
34 bne 1002b
35 .endm
36
37 .macro waituart,rd,rx
381001: ldrb \rd, [\rx, #0x6]
39 tst \rd, #0x10
40 beq 1001b
41 .endm
42#else
43 /* For EBSA285 debugging */
44 .equ dc21285_high, ARMCSR_BASE & 0xff000000
45 .equ dc21285_low, ARMCSR_BASE & 0x00ffffff
46
47 .macro addruart,rx
48 mov \rx, #dc21285_high
49 .if dc21285_low
50 orr \rx, \rx, #dc21285_low
51 .endif
52 .endm
53
54 .macro senduart,rd,rx
55 str \rd, [\rx, #0x160] @ UARTDR
56 .endm
57
58 .macro busyuart,rd,rx
591001: ldr \rd, [\rx, #0x178] @ UARTFLG
60 tst \rd, #1 << 3
61 bne 1001b
62 .endm
63
64 .macro waituart,rd,rx
65 .endm
66#endif
diff --git a/include/asm-arm/arch-ebsa285/dma.h b/include/asm-arm/arch-ebsa285/dma.h
new file mode 100644
index 000000000000..c43046eb8bc7
--- /dev/null
+++ b/include/asm-arm/arch-ebsa285/dma.h
@@ -0,0 +1,30 @@
1/*
2 * linux/include/asm-arm/arch-ebsa285/dma.h
3 *
4 * Architecture DMA routines
5 *
6 * Copyright (C) 1998,1999 Russell King
7 * Copyright (C) 1998,1999 Philip Blundell
8 */
9#ifndef __ASM_ARCH_DMA_H
10#define __ASM_ARCH_DMA_H
11
12/*
13 * This is the maximum DMA address that can be DMAd to.
14 */
15#define MAX_DMA_ADDRESS 0xffffffff
16
17/*
18 * The 21285 has two internal DMA channels; we call these 8 and 9.
19 * On CATS hardware we have an additional eight ISA dma channels
20 * numbered 0..7.
21 */
22#define _ISA_DMA(x) (0+(x))
23#define _DC21285_DMA(x) (8+(x))
24
25#define MAX_DMA_CHANNELS 10
26
27#define DMA_FLOPPY _ISA_DMA(2)
28#define DMA_ISA_CASCADE _ISA_DMA(4)
29
30#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-ebsa285/entry-macro.S b/include/asm-arm/arch-ebsa285/entry-macro.S
new file mode 100644
index 000000000000..db5729ff6349
--- /dev/null
+++ b/include/asm-arm/arch-ebsa285/entry-macro.S
@@ -0,0 +1,105 @@
1/*
2 * include/asm-arm/arch-footbridge/entry-macro.S
3 *
4 * Low-level IRQ helper macros for footbridge-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#include <asm/hardware/dec21285.h>
11
12 .macro disable_fiq
13 .endm
14
15 .equ dc21285_high, ARMCSR_BASE & 0xff000000
16 .equ dc21285_low, ARMCSR_BASE & 0x00ffffff
17
18 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
19 mov r4, #dc21285_high
20 .if dc21285_low
21 orr r4, r4, #dc21285_low
22 .endif
23 ldr \irqstat, [r4, #0x180] @ get interrupts
24
25 mov \irqnr, #IRQ_SDRAMPARITY
26 tst \irqstat, #IRQ_MASK_SDRAMPARITY
27 bne 1001f
28
29 tst \irqstat, #IRQ_MASK_UART_RX
30 movne \irqnr, #IRQ_CONRX
31 bne 1001f
32
33 tst \irqstat, #IRQ_MASK_DMA1
34 movne \irqnr, #IRQ_DMA1
35 bne 1001f
36
37 tst \irqstat, #IRQ_MASK_DMA2
38 movne \irqnr, #IRQ_DMA2
39 bne 1001f
40
41 tst \irqstat, #IRQ_MASK_IN0
42 movne \irqnr, #IRQ_IN0
43 bne 1001f
44
45 tst \irqstat, #IRQ_MASK_IN1
46 movne \irqnr, #IRQ_IN1
47 bne 1001f
48
49 tst \irqstat, #IRQ_MASK_IN2
50 movne \irqnr, #IRQ_IN2
51 bne 1001f
52
53 tst \irqstat, #IRQ_MASK_IN3
54 movne \irqnr, #IRQ_IN3
55 bne 1001f
56
57 tst \irqstat, #IRQ_MASK_PCI
58 movne \irqnr, #IRQ_PCI
59 bne 1001f
60
61 tst \irqstat, #IRQ_MASK_DOORBELLHOST
62 movne \irqnr, #IRQ_DOORBELLHOST
63 bne 1001f
64
65 tst \irqstat, #IRQ_MASK_I2OINPOST
66 movne \irqnr, #IRQ_I2OINPOST
67 bne 1001f
68
69 tst \irqstat, #IRQ_MASK_TIMER1
70 movne \irqnr, #IRQ_TIMER1
71 bne 1001f
72
73 tst \irqstat, #IRQ_MASK_TIMER2
74 movne \irqnr, #IRQ_TIMER2
75 bne 1001f
76
77 tst \irqstat, #IRQ_MASK_TIMER3
78 movne \irqnr, #IRQ_TIMER3
79 bne 1001f
80
81 tst \irqstat, #IRQ_MASK_UART_TX
82 movne \irqnr, #IRQ_CONTX
83 bne 1001f
84
85 tst \irqstat, #IRQ_MASK_PCI_ABORT
86 movne \irqnr, #IRQ_PCI_ABORT
87 bne 1001f
88
89 tst \irqstat, #IRQ_MASK_PCI_SERR
90 movne \irqnr, #IRQ_PCI_SERR
91 bne 1001f
92
93 tst \irqstat, #IRQ_MASK_DISCARD_TIMER
94 movne \irqnr, #IRQ_DISCARD_TIMER
95 bne 1001f
96
97 tst \irqstat, #IRQ_MASK_PCI_DPERR
98 movne \irqnr, #IRQ_PCI_DPERR
99 bne 1001f
100
101 tst \irqstat, #IRQ_MASK_PCI_PERR
102 movne \irqnr, #IRQ_PCI_PERR
1031001:
104 .endm
105
diff --git a/include/asm-arm/arch-ebsa285/hardware.h b/include/asm-arm/arch-ebsa285/hardware.h
new file mode 100644
index 000000000000..2ef2200f108c
--- /dev/null
+++ b/include/asm-arm/arch-ebsa285/hardware.h
@@ -0,0 +1,139 @@
1/*
2 * linux/include/asm-arm/arch-ebsa285/hardware.h
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 * This file contains the hardware definitions of the EBSA-285.
11 */
12#ifndef __ASM_ARCH_HARDWARE_H
13#define __ASM_ARCH_HARDWARE_H
14
15#include <linux/config.h>
16#include <asm/arch/memory.h>
17
18#ifdef CONFIG_ARCH_FOOTBRIDGE
19/* Virtual Physical Size
20 * 0xff800000 0x40000000 1MB X-Bus
21 * 0xff000000 0x7c000000 1MB PCI I/O space
22 * 0xfe000000 0x42000000 1MB CSR
23 * 0xfd000000 0x78000000 1MB Outbound write flush (not supported)
24 * 0xfc000000 0x79000000 1MB PCI IACK/special space
25 * 0xfb000000 0x7a000000 16MB PCI Config type 1
26 * 0xfa000000 0x7b000000 16MB PCI Config type 0
27 * 0xf9000000 0x50000000 1MB Cache flush
28 * 0xf0000000 0x80000000 16MB ISA memory
29 */
30#define XBUS_SIZE 0x00100000
31#define XBUS_BASE 0xff800000
32
33#define PCIO_SIZE 0x00100000
34#define PCIO_BASE 0xff000000
35
36#define ARMCSR_SIZE 0x00100000
37#define ARMCSR_BASE 0xfe000000
38
39#define WFLUSH_SIZE 0x00100000
40#define WFLUSH_BASE 0xfd000000
41
42#define PCIIACK_SIZE 0x00100000
43#define PCIIACK_BASE 0xfc000000
44
45#define PCICFG1_SIZE 0x01000000
46#define PCICFG1_BASE 0xfb000000
47
48#define PCICFG0_SIZE 0x01000000
49#define PCICFG0_BASE 0xfa000000
50
51#define FLUSH_SIZE 0x00100000
52#define FLUSH_BASE 0xf9000000
53
54#define PCIMEM_SIZE 0x01000000
55#define PCIMEM_BASE 0xf0000000
56
57#elif defined(CONFIG_ARCH_CO285)
58/*
59 * This is the COEBSA285 cut-down mapping
60 */
61#define PCIMEM_SIZE 0x80000000
62#define PCIMEM_BASE 0x80000000
63
64#define FLUSH_SIZE 0x00100000
65#define FLUSH_BASE 0x7e000000
66
67#define WFLUSH_SIZE 0x01000000
68#define WFLUSH_BASE 0x7d000000
69
70#define ARMCSR_SIZE 0x00100000
71#define ARMCSR_BASE 0x7cf00000
72
73#define XBUS_SIZE 0x00020000
74#define XBUS_BASE 0x7cee0000
75
76#define PCIO_SIZE 0x00010000
77#define PCIO_BASE 0x7ced0000
78
79#else
80
81#error "Undefined footbridge architecture"
82
83#endif
84
85#define XBUS_LEDS ((volatile unsigned char *)(XBUS_BASE + 0x12000))
86#define XBUS_LED_AMBER (1 << 0)
87#define XBUS_LED_GREEN (1 << 1)
88#define XBUS_LED_RED (1 << 2)
89#define XBUS_LED_TOGGLE (1 << 8)
90
91#define XBUS_SWITCH ((volatile unsigned char *)(XBUS_BASE + 0x12000))
92#define XBUS_SWITCH_SWITCH ((*XBUS_SWITCH) & 15)
93#define XBUS_SWITCH_J17_13 ((*XBUS_SWITCH) & (1 << 4))
94#define XBUS_SWITCH_J17_11 ((*XBUS_SWITCH) & (1 << 5))
95#define XBUS_SWITCH_J17_9 ((*XBUS_SWITCH) & (1 << 6))
96
97#define FLUSH_BASE_PHYS 0x50000000
98#define UNCACHEABLE_ADDR (ARMCSR_BASE + 0x108)
99
100
101/* PIC irq control */
102#define PIC_LO 0x20
103#define PIC_MASK_LO 0x21
104#define PIC_HI 0xA0
105#define PIC_MASK_HI 0xA1
106
107/* GPIO pins */
108#define GPIO_CCLK 0x800
109#define GPIO_DSCLK 0x400
110#define GPIO_E2CLK 0x200
111#define GPIO_IOLOAD 0x100
112#define GPIO_RED_LED 0x080
113#define GPIO_WDTIMER 0x040
114#define GPIO_DATA 0x020
115#define GPIO_IOCLK 0x010
116#define GPIO_DONE 0x008
117#define GPIO_FAN 0x004
118#define GPIO_GREEN_LED 0x002
119#define GPIO_RESET 0x001
120
121/* CPLD pins */
122#define CPLD_DS_ENABLE 8
123#define CPLD_7111_DISABLE 4
124#define CPLD_UNMUTE 2
125#define CPLD_FLASH_WR_ENABLE 1
126
127#ifndef __ASSEMBLY__
128extern void gpio_modify_op(int mask, int set);
129extern void gpio_modify_io(int mask, int in);
130extern int gpio_read(void);
131extern void cpld_modify(int mask, int set);
132#endif
133
134#define pcibios_assign_all_busses() 1
135
136#define PCIBIOS_MIN_IO 0x1000
137#define PCIBIOS_MIN_MEM 0x81000000
138
139#endif
diff --git a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h
new file mode 100644
index 000000000000..70576b17f922
--- /dev/null
+++ b/include/asm-arm/arch-ebsa285/io.h
@@ -0,0 +1,45 @@
1/*
2 * linux/include/asm-arm/arch-ebsa285/io.h
3 *
4 * Copyright (C) 1997-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 * Modifications:
11 * 06-12-1997 RMK Created.
12 * 07-04-1999 RMK Major cleanup
13 */
14#ifndef __ASM_ARM_ARCH_IO_H
15#define __ASM_ARM_ARCH_IO_H
16
17#define IO_SPACE_LIMIT 0xffff
18
19/*
20 * Translation of various region addresses to virtual addresses
21 */
22#define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
23#if 1
24#define __mem_pci(a) (a)
25#define __mem_isa(a) ((a) + PCIMEM_BASE)
26#else
27
28static inline void __iomem *___mem_pci(void __iomem *p)
29{
30 unsigned long a = (unsigned long)p;
31 BUG_ON(a <= 0xc0000000 || a >= 0xe0000000);
32 return p;
33}
34
35static inline void __iomem *___mem_isa(void __iomem *p)
36{
37 unsigned long a = (unsigned long)p;
38 BUG_ON(a >= 16*1048576);
39 return p + PCIMEM_BASE;
40}
41#define __mem_pci(a) ___mem_pci(a)
42#define __mem_isa(a) ___mem_isa(a)
43#endif
44
45#endif
diff --git a/include/asm-arm/arch-ebsa285/irqs.h b/include/asm-arm/arch-ebsa285/irqs.h
new file mode 100644
index 000000000000..3e766f1cecf1
--- /dev/null
+++ b/include/asm-arm/arch-ebsa285/irqs.h
@@ -0,0 +1,98 @@
1/*
2 * linux/include/asm-arm/arch-ebsa285/irqs.h
3 *
4 * Copyright (C) 1998 Russell King
5 * Copyright (C) 1998 Phil Blundell
6 *
7 * Changelog:
8 * 20-Jan-1998 RMK Started merge of EBSA286, CATS and NetWinder
9 * 01-Feb-1999 PJB ISA IRQs start at 0 not 16
10 */
11#include <asm/mach-types.h>
12
13#define NR_IRQS 36
14#define NR_DC21285_IRQS 16
15
16#define _ISA_IRQ(x) (0 + (x))
17#define _ISA_INR(x) ((x) - 0)
18#define _DC21285_IRQ(x) (16 + (x))
19#define _DC21285_INR(x) ((x) - 16)
20
21/*
22 * This is a list of all interrupts that the 21285
23 * can generate and we handle.
24 */
25#define IRQ_CONRX _DC21285_IRQ(0)
26#define IRQ_CONTX _DC21285_IRQ(1)
27#define IRQ_TIMER1 _DC21285_IRQ(2)
28#define IRQ_TIMER2 _DC21285_IRQ(3)
29#define IRQ_TIMER3 _DC21285_IRQ(4)
30#define IRQ_IN0 _DC21285_IRQ(5)
31#define IRQ_IN1 _DC21285_IRQ(6)
32#define IRQ_IN2 _DC21285_IRQ(7)
33#define IRQ_IN3 _DC21285_IRQ(8)
34#define IRQ_DOORBELLHOST _DC21285_IRQ(9)
35#define IRQ_DMA1 _DC21285_IRQ(10)
36#define IRQ_DMA2 _DC21285_IRQ(11)
37#define IRQ_PCI _DC21285_IRQ(12)
38#define IRQ_SDRAMPARITY _DC21285_IRQ(13)
39#define IRQ_I2OINPOST _DC21285_IRQ(14)
40#define IRQ_PCI_ABORT _DC21285_IRQ(15)
41#define IRQ_PCI_SERR _DC21285_IRQ(16)
42#define IRQ_DISCARD_TIMER _DC21285_IRQ(17)
43#define IRQ_PCI_DPERR _DC21285_IRQ(18)
44#define IRQ_PCI_PERR _DC21285_IRQ(19)
45
46#define IRQ_ISA_TIMER _ISA_IRQ(0)
47#define IRQ_ISA_KEYBOARD _ISA_IRQ(1)
48#define IRQ_ISA_CASCADE _ISA_IRQ(2)
49#define IRQ_ISA_UART2 _ISA_IRQ(3)
50#define IRQ_ISA_UART _ISA_IRQ(4)
51#define IRQ_ISA_FLOPPY _ISA_IRQ(6)
52#define IRQ_ISA_PRINTER _ISA_IRQ(7)
53#define IRQ_ISA_RTC_ALARM _ISA_IRQ(8)
54#define IRQ_ISA_2 _ISA_IRQ(9)
55#define IRQ_ISA_PS2MOUSE _ISA_IRQ(12)
56#define IRQ_ISA_HARDDISK1 _ISA_IRQ(14)
57#define IRQ_ISA_HARDDISK2 _ISA_IRQ(15)
58
59#define IRQ_MASK_UART_RX (1 << 2)
60#define IRQ_MASK_UART_TX (1 << 3)
61#define IRQ_MASK_TIMER1 (1 << 4)
62#define IRQ_MASK_TIMER2 (1 << 5)
63#define IRQ_MASK_TIMER3 (1 << 6)
64#define IRQ_MASK_IN0 (1 << 8)
65#define IRQ_MASK_IN1 (1 << 9)
66#define IRQ_MASK_IN2 (1 << 10)
67#define IRQ_MASK_IN3 (1 << 11)
68#define IRQ_MASK_DOORBELLHOST (1 << 15)
69#define IRQ_MASK_DMA1 (1 << 16)
70#define IRQ_MASK_DMA2 (1 << 17)
71#define IRQ_MASK_PCI (1 << 18)
72#define IRQ_MASK_SDRAMPARITY (1 << 24)
73#define IRQ_MASK_I2OINPOST (1 << 25)
74#define IRQ_MASK_PCI_ABORT ((1 << 29) | (1 << 30))
75#define IRQ_MASK_PCI_SERR (1 << 23)
76#define IRQ_MASK_DISCARD_TIMER (1 << 27)
77#define IRQ_MASK_PCI_DPERR (1 << 28)
78#define IRQ_MASK_PCI_PERR (1 << 31)
79
80/*
81 * Netwinder interrupt allocations
82 */
83#define IRQ_NETWINDER_ETHER10 IRQ_IN0
84#define IRQ_NETWINDER_ETHER100 IRQ_IN1
85#define IRQ_NETWINDER_VIDCOMP IRQ_IN2
86#define IRQ_NETWINDER_PS2MOUSE _ISA_IRQ(5)
87#define IRQ_NETWINDER_IR _ISA_IRQ(6)
88#define IRQ_NETWINDER_BUTTON _ISA_IRQ(10)
89#define IRQ_NETWINDER_VGA _ISA_IRQ(11)
90#define IRQ_NETWINDER_SOUND _ISA_IRQ(12)
91
92#undef RTC_IRQ
93#define RTC_IRQ IRQ_ISA_RTC_ALARM
94#define I8042_KBD_IRQ IRQ_ISA_KEYBOARD
95#define I8042_AUX_IRQ (machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)
96#define IRQ_FLOPPYDISK IRQ_ISA_FLOPPY
97
98#define irq_canonicalize(_i) (((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA_2 : _i)
diff --git a/include/asm-arm/arch-ebsa285/memory.h b/include/asm-arm/arch-ebsa285/memory.h
new file mode 100644
index 000000000000..d0466f9987d3
--- /dev/null
+++ b/include/asm-arm/arch-ebsa285/memory.h
@@ -0,0 +1,75 @@
1/*
2 * linux/include/asm-arm/arch-ebsa285/memory.h
3 *
4 * Copyright (C) 1996-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 * Changelog:
11 * 20-Oct-1996 RMK Created
12 * 31-Dec-1997 RMK Fixed definitions to reduce warnings.
13 * 17-May-1998 DAG Added __virt_to_bus and __bus_to_virt functions.
14 * 21-Nov-1998 RMK Changed __virt_to_bus and __bus_to_virt to macros.
15 * 21-Mar-1999 RMK Added PAGE_OFFSET for co285 architecture.
16 * Renamed to memory.h
17 * Moved PAGE_OFFSET and TASK_SIZE here
18 */
19#ifndef __ASM_ARCH_MEMORY_H
20#define __ASM_ARCH_MEMORY_H
21
22#include <linux/config.h>
23
24#if defined(CONFIG_FOOTBRIDGE_ADDIN)
25/*
26 * If we may be using add-in footbridge mode, then we must
27 * use the out-of-line translation that makes use of the
28 * PCI BAR
29 */
30#ifndef __ASSEMBLY__
31extern unsigned long __virt_to_bus(unsigned long);
32extern unsigned long __bus_to_virt(unsigned long);
33#endif
34
35#elif defined(CONFIG_FOOTBRIDGE_HOST)
36
37#define __virt_to_bus(x) ((x) - 0xe0000000)
38#define __bus_to_virt(x) ((x) + 0xe0000000)
39
40#else
41
42#error "Undefined footbridge mode"
43
44#endif
45
46#if defined(CONFIG_ARCH_FOOTBRIDGE)
47
48/* Task size and page offset at 3GB */
49#define TASK_SIZE (0xbf000000UL)
50#define PAGE_OFFSET (0xc0000000UL)
51
52#elif defined(CONFIG_ARCH_CO285)
53
54/* Task size and page offset at 1.5GB */
55#define TASK_SIZE (0x5f000000UL)
56#define PAGE_OFFSET (0x60000000UL)
57
58#else
59
60#error "Undefined footbridge architecture"
61
62#endif
63
64/*
65 * Physical DRAM offset.
66 */
67#define PHYS_OFFSET (0x00000000UL)
68
69/*
70 * This decides where the kernel will search for a free chunk of vm
71 * space during mmap's.
72 */
73#define TASK_UNMAPPED_BASE ((TASK_SIZE + 0x01000000) / 3)
74
75#endif
diff --git a/include/asm-arm/arch-ebsa285/param.h b/include/asm-arm/arch-ebsa285/param.h
new file mode 100644
index 000000000000..3827103b27a0
--- /dev/null
+++ b/include/asm-arm/arch-ebsa285/param.h
@@ -0,0 +1,3 @@
1/*
2 * linux/include/asm-arm/arch-ebsa285/param.h
3 */
diff --git a/include/asm-arm/arch-ebsa285/system.h b/include/asm-arm/arch-ebsa285/system.h
new file mode 100644
index 000000000000..bf91c695c4b5
--- /dev/null
+++ b/include/asm-arm/arch-ebsa285/system.h
@@ -0,0 +1,69 @@
1/*
2 * linux/include/asm-arm/arch-ebsa285/system.h
3 *
4 * Copyright (C) 1996-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#include <asm/hardware/dec21285.h>
11#include <asm/io.h>
12#include <asm/hardware.h>
13#include <asm/leds.h>
14#include <asm/mach-types.h>
15
16static inline void arch_idle(void)
17{
18 cpu_do_idle();
19}
20
21static inline void arch_reset(char mode)
22{
23 if (mode == 's') {
24 /*
25 * Jump into the ROM
26 */
27 cpu_reset(0x41000000);
28 } else {
29 if (machine_is_netwinder()) {
30 /* open up the SuperIO chip
31 */
32 outb(0x87, 0x370);
33 outb(0x87, 0x370);
34
35 /* aux function group 1 (logical device 7)
36 */
37 outb(0x07, 0x370);
38 outb(0x07, 0x371);
39
40 /* set GP16 for WD-TIMER output
41 */
42 outb(0xe6, 0x370);
43 outb(0x00, 0x371);
44
45 /* set a RED LED and toggle WD_TIMER for rebooting
46 */
47 outb(0xc4, 0x338);
48 } else {
49 /*
50 * Force the watchdog to do a CPU reset.
51 *
52 * After making sure that the watchdog is disabled
53 * (so we can change the timer registers) we first
54 * enable the timer to autoreload itself. Next, the
55 * timer interval is set really short and any
56 * current interrupt request is cleared (so we can
57 * see an edge transition). Finally, TIMER4 is
58 * enabled as the watchdog.
59 */
60 *CSR_SA110_CNTL &= ~(1 << 13);
61 *CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE |
62 TIMER_CNTL_AUTORELOAD |
63 TIMER_CNTL_DIV16;
64 *CSR_TIMER4_LOAD = 0x2;
65 *CSR_TIMER4_CLR = 0;
66 *CSR_SA110_CNTL |= (1 << 13);
67 }
68 }
69}
diff --git a/include/asm-arm/arch-ebsa285/timex.h b/include/asm-arm/arch-ebsa285/timex.h
new file mode 100644
index 000000000000..df60b3812d96
--- /dev/null
+++ b/include/asm-arm/arch-ebsa285/timex.h
@@ -0,0 +1,18 @@
1/*
2 * linux/include/asm-arm/arch-ebsa285/timex.h
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 * EBSA285 architecture timex specifications
11 */
12
13/*
14 * We assume a constant here; this satisfies the maths in linux/timex.h
15 * and linux/time.h. CLOCK_TICK_RATE is actually system dependent, but
16 * this must be a constant.
17 */
18#define CLOCK_TICK_RATE (50000000/16)
diff --git a/include/asm-arm/arch-ebsa285/uncompress.h b/include/asm-arm/arch-ebsa285/uncompress.h
new file mode 100644
index 000000000000..c2fd84e2d90e
--- /dev/null
+++ b/include/asm-arm/arch-ebsa285/uncompress.h
@@ -0,0 +1,46 @@
1/*
2 * linux/include/asm-arm/arch-ebsa285/uncompress.h
3 *
4 * Copyright (C) 1996-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#include <asm/mach-types.h>
11
12/*
13 * Note! This could cause problems on the NetWinder
14 */
15#define DC21285_BASE ((volatile unsigned int *)0x42000160)
16#define SER0_BASE ((volatile unsigned char *)0x7c0003f8)
17
18static __inline__ void putc(char c)
19{
20 if (machine_is_netwinder()) {
21 while ((SER0_BASE[5] & 0x60) != 0x60);
22 SER0_BASE[0] = c;
23 } else {
24 while (DC21285_BASE[6] & 8);
25 DC21285_BASE[0] = c;
26 }
27}
28
29/*
30 * This does not append a newline
31 */
32static void putstr(const char *s)
33{
34 while (*s) {
35 putc(*s);
36 if (*s == '\n')
37 putc('\r');
38 s++;
39 }
40}
41
42/*
43 * nothing to do
44 */
45#define arch_decomp_setup()
46#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-ebsa285/vmalloc.h b/include/asm-arm/arch-ebsa285/vmalloc.h
new file mode 100644
index 000000000000..def705a3c209
--- /dev/null
+++ b/include/asm-arm/arch-ebsa285/vmalloc.h
@@ -0,0 +1,26 @@
1/*
2 * linux/include/asm-arm/arch-ebsa285/vmalloc.h
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
9#include <linux/config.h>
10
11/*
12 * Just any arbitrary offset to the start of the vmalloc VM area: the
13 * current 8MB value just means that there will be a 8MB "hole" after the
14 * physical memory until the kernel virtual memory starts. That means that
15 * any out-of-bounds memory accesses will hopefully be caught.
16 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
17 * area for the same reason. ;)
18 */
19#define VMALLOC_OFFSET (8*1024*1024)
20#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
21
22#ifdef CONFIG_ARCH_FOOTBRIDGE
23#define VMALLOC_END (PAGE_OFFSET + 0x30000000)
24#else
25#define VMALLOC_END (PAGE_OFFSET + 0x20000000)
26#endif
diff --git a/include/asm-arm/arch-epxa10db/debug-macro.S b/include/asm-arm/arch-epxa10db/debug-macro.S
new file mode 100644
index 000000000000..1d11c51f498f
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/debug-macro.S
@@ -0,0 +1,41 @@
1/* linux/include/asm-arm/arch-epxa10db/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 <asm/arch/excalibur.h>
15#define UART00_TYPE
16#include <asm/arch/uart00.h>
17
18 .macro addruart,rx
19 mrc p15, 0, \rx, c1, c0
20 tst \rx, #1 @ MMU enabled?
21 ldr \rx, =EXC_UART00_BASE @ physical base address
22 orrne \rx, \rx, #0xff000000 @ virtual base
23 orrne \rx, \rx, #0x00f00000
24 .endm
25
26 .macro senduart,rd,rx
27 str \rd, [\rx, #UART_TD(0)]
28 .endm
29
30 .macro waituart,rd,rx
311001: ldr \rd, [\rx, #UART_TSR(0)]
32 and \rd, \rd, #UART_TSR_TX_LEVEL_MSK
33 cmp \rd, #15
34 beq 1001b
35 .endm
36
37 .macro busyuart,rd,rx
381001: ldr \rd, [\rx, #UART_TSR(0)]
39 ands \rd, \rd, #UART_TSR_TX_LEVEL_MSK
40 bne 1001b
41 .endm
diff --git a/include/asm-arm/arch-epxa10db/dma.h b/include/asm-arm/arch-epxa10db/dma.h
new file mode 100644
index 000000000000..5d97734d1077
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/dma.h
@@ -0,0 +1,28 @@
1/*
2 * linux/include/asm-arm/arch-camelot/dma.h
3 *
4 * Copyright (C) 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 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#ifndef __ASM_ARCH_DMA_H
21#define __ASM_ARCH_DMA_H
22
23#define MAX_DMA_ADDRESS 0xffffffff
24
25#define MAX_DMA_CHANNELS 0
26
27#endif /* _ASM_ARCH_DMA_H */
28
diff --git a/include/asm-arm/arch-epxa10db/entry-macro.S b/include/asm-arm/arch-epxa10db/entry-macro.S
new file mode 100644
index 000000000000..de6ae08334e2
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/entry-macro.S
@@ -0,0 +1,25 @@
1/*
2 * include/asm-arm/arch-epxa10db/entry-macro.S
3 *
4 * Low-level IRQ helper macros for epxa10db platform
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#include <asm/arch/platform.h>
11#undef IRQ_MODE /* same name defined in asm/proc/ptrace.h */
12#include <asm/arch/int_ctrl00.h>
13
14 .macro disable_fiq
15 .endm
16
17 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
18
19 ldr \irqstat, =INT_ID(IO_ADDRESS(EXC_INT_CTRL00_BASE))
20 ldr \irqnr,[\irqstat]
21 cmp \irqnr,#0
22 subne \irqnr,\irqnr,#1
23
24 .endm
25
diff --git a/include/asm-arm/arch-epxa10db/ether00.h b/include/asm-arm/arch-epxa10db/ether00.h
new file mode 100644
index 000000000000..b737b8aabe2f
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/ether00.h
@@ -0,0 +1,482 @@
1#ifndef __ETHER00_H
2#define __ETHER00_H
3
4
5
6/*
7 * Register definitions for the Ethernet MAC
8 */
9
10/*
11 * Copyright (c) Altera Corporation 2000.
12 * All rights reserved.
13 */
14
15/*
16* Structures for the DMA controller
17*/
18typedef struct fda_desc
19 {
20 struct fda_desc * FDNext;
21 long FDSystem;
22 long FDStat;
23 short FDLength;
24 short FDCtl;
25 }FDA_DESC;
26
27typedef struct buf_desc
28 {
29 char * BuffData;
30 short BuffLength;
31 char BDStat;
32 char BDCtl;
33 }BUF_DESC;
34
35/*
36* Control masks for the DMA controller
37*/
38#define FDCTL_BDCOUNT_MSK (0x1F)
39#define FDCTL_BDCOUNT_OFST (0)
40#define FDCTL_FRMOPT_MSK (0x7C00)
41#define FDCTL_FRMOPT_OFST (10)
42#define FDCTL_COWNSFD_MSK (0x8000)
43#define FDCTL_COWNSFD_OFST (15)
44
45#define BDCTL_RXBDSEQN_MSK (0x7F)
46#define BDCTL_RXBDSEQN_OFST (0)
47#define BDCTL_COWNSBD_MSK (0x80)
48#define BDCTL_COWNSBD_OFST (7)
49
50#define FDNEXT_EOL_MSK (0x1)
51#define FDNEXT_EOL_OFST (0)
52#define FDNEXT_EOL_POINTER_MSK (0xFFFFFFF0)
53#define FDNEXT_EOL_POINTER_OFST (4)
54
55#define ETHER_ARC_SIZE (21)
56
57/*
58* Register definitions and masks
59*/
60#define ETHER_DMA_CTL(base) (ETHER00_TYPE (base + 0x100))
61#define ETHER_DMA_CTL_DMBURST_OFST (2)
62#define ETHER_DMA_CTL_DMBURST_MSK (0x1FC)
63#define ETHER_DMA_CTL_POWRMGMNT_OFST (11)
64#define ETHER_DMA_CTL_POWRMGMNT_MSK (0x1000)
65#define ETHER_DMA_CTL_TXBIGE_OFST (14)
66#define ETHER_DMA_CTL_TXBIGE_MSK (0x4000)
67#define ETHER_DMA_CTL_RXBIGE_OFST (15)
68#define ETHER_DMA_CTL_RXBIGE_MSK (0x8000)
69#define ETHER_DMA_CTL_TXWAKEUP_OFST (16)
70#define ETHER_DMA_CTL_TXWAKEUP_MSK (0x10000)
71#define ETHER_DMA_CTL_SWINTREQ_OFST (17)
72#define ETHER_DMA_CTL_SWINTREQ_MSK (0x20000)
73#define ETHER_DMA_CTL_INTMASK_OFST (18)
74#define ETHER_DMA_CTL_INTMASK_MSK (0x40000)
75#define ETHER_DMA_CTL_M66ENSTAT_OFST (19)
76#define ETHER_DMA_CTL_M66ENSTAT_MSK (0x80000)
77#define ETHER_DMA_CTL_RMTXINIT_OFST (20)
78#define ETHER_DMA_CTL_RMTXINIT_MSK (0x100000)
79#define ETHER_DMA_CTL_RMRXINIT_OFST (21)
80#define ETHER_DMA_CTL_RMRXINIT_MSK (0x200000)
81#define ETHER_DMA_CTL_RXALIGN_OFST (22)
82#define ETHER_DMA_CTL_RXALIGN_MSK (0xC00000)
83#define ETHER_DMA_CTL_RMSWRQ_OFST (24)
84#define ETHER_DMA_CTL_RMSWRQ_MSK (0x1000000)
85#define ETHER_DMA_CTL_RMEMBANK_OFST (25)
86#define ETHER_DMA_CTL_RMEMBANK_MSK (0x2000000)
87
88#define ETHER_TXFRMPTR(base) (ETHER00_TYPE (base + 0x104))
89
90#define ETHER_TXTHRSH(base) (ETHER00_TYPE (base + 0x308))
91
92#define ETHER_TXPOLLCTR(base) (ETHER00_TYPE (base + 0x30c))
93
94#define ETHER_BLFRMPTR(base) (ETHER00_TYPE (base + 0x110))
95#define ETHER_BLFFRMPTR_EOL_OFST (0)
96#define ETHER_BLFFRMPTR_EOL_MSK (0x1)
97#define ETHER_BLFFRMPTR_ADDRESS_OFST (4)
98#define ETHER_BLFFRMPTR_ADDRESS_MSK (0xFFFFFFF0)
99
100#define ETHER_RXFRAGSIZE(base) (ETHER00_TYPE (base + 0x114))
101#define ETHER_RXFRAGSIZE_MINFRAG_OFST (2)
102#define ETHER_RXFRAGSIZE_MINFRAG_MSK (0xFFC)
103#define ETHER_RXFRAGSIZE_ENPACK_OFST (15)
104#define ETHER_RXFRAGSIZE_ENPACK_MSK (0x8000)
105
106#define ETHER_INT_EN(base) (ETHER00_TYPE (base + 0x118))
107#define ETHER_INT_EN_FDAEXEN_OFST (0)
108#define ETHER_INT_EN_FDAEXEN_MSK (0x1)
109#define ETHER_INT_EN_BLEXEN_OFST (1)
110#define ETHER_INT_EN_BLEXN_MSK (0x2)
111#define ETHER_INT_EN_STARGABTEN_OFST (2)
112#define ETHER_INT_EN_STARGABTEN_MSK (0x4)
113#define ETHER_INT_EN_RTARGABTEN_OFST (3)
114#define ETHER_INT_EN_RTARGABTEN_MSK (0x8)
115#define ETHER_INT_EN_RMASABTEN_OFST (4)
116#define ETHER_INT_EN_RMASABTEN_MSK (0x10)
117#define ETHER_INT_EN_SSYSERREN_OFST (5)
118#define ETHER_INT_EN_SSYSERREN_MSK (0x20)
119#define ETHER_INT_EN_DPARERREN_OFST (6)
120#define ETHER_INT_EN_DPARERREN_MSK (0x40)
121#define ETHER_INT_EN_EARNOTEN_OFST (7)
122#define ETHER_INT_EN_EARNOTEN_MSK (0x80)
123#define ETHER_INT_EN_DPARDEN_OFST (8)
124#define ETHER_INT_EN_DPARDEN_MSK (0x100)
125#define ETHER_INT_EN_DMPARERREN_OFST (9)
126#define ETHER_INT_EN_DMPARERREN_MSK (0x200)
127#define ETHER_INT_EN_TXCTLCMPEN_OFST (10)
128#define ETHER_INT_EN_TXCTLCMPEN_MSK (0x400)
129#define ETHER_INT_EN_NRABTEN_OFST (11)
130#define ETHER_INT_EN_NRABTEN_MSK (0x800)
131
132#define ETHER_FDA_BAS(base) (ETHER00_TYPE (base + 0x11C))
133#define ETHER_FDA_BAS_ADDRESS_OFST (4)
134#define ETHER_FDA_BAS_ADDRESS_MSK (0xFFFFFFF0)
135
136#define ETHER_FDA_LIM(base) (ETHER00_TYPE (base + 0x120))
137#define ETHER_FDA_LIM_COUNT_OFST (4)
138#define ETHER_FDA_LIM_COUNT_MSK (0xFFF0)
139
140#define ETHER_INT_SRC(base) (ETHER00_TYPE (base + 0x124))
141#define ETHER_INT_SRC_INTMACTX_OFST (0)
142#define ETHER_INT_SRC_INTMACTX_MSK (0x1)
143#define ETHER_INT_SRC_INTMACRX_OFST (1)
144#define ETHER_INT_SRC_INTMACRX_MSK (0x2)
145#define ETHER_INT_SRC_INTSBUS_OFST (2)
146#define ETHER_INT_SRC_INTSBUS_MSK (0x4)
147#define ETHER_INT_SRC_INTFDAEX_OFST (3)
148#define ETHER_INT_SRC_INTFDAEX_MSK (0x8)
149#define ETHER_INT_SRC_INTBLEX_OFST (4)
150#define ETHER_INT_SRC_INTBLEX_MSK (0x10)
151#define ETHER_INT_SRC_SWINT_OFST (5)
152#define ETHER_INT_SRC_SWINT_MSK (0x20)
153#define ETHER_INT_SRC_INTEARNOT_OFST (6)
154#define ETHER_INT_SRC_INTEARNOT_MSK (0x40)
155#define ETHER_INT_SRC_DMPARERR_OFST (7)
156#define ETHER_INT_SRC_DMPARERR_MSK (0x80)
157#define ETHER_INT_SRC_INTEXBD_OFST (8)
158#define ETHER_INT_SRC_INTEXBD_MSK (0x100)
159#define ETHER_INT_SRC_INTTXCTLCMP_OFST (9)
160#define ETHER_INT_SRC_INTTXCTLCMP_MSK (0x200)
161#define ETHER_INT_SRC_INTNRABT_OFST (10)
162#define ETHER_INT_SRC_INTNRABT_MSK (0x400)
163#define ETHER_INT_SRC_FDAEX_OFST (11)
164#define ETHER_INT_SRC_FDAEX_MSK (0x800)
165#define ETHER_INT_SRC_BLEX_OFST (12)
166#define ETHER_INT_SRC_BLEX_MSK (0x1000)
167#define ETHER_INT_SRC_DMPARERRSTAT_OFST (13)
168#define ETHER_INT_SRC_DMPARERRSTAT_MSK (0x2000)
169#define ETHER_INT_SRC_NRABT_OFST (14)
170#define ETHER_INT_SRC_NRABT_MSK (0x4000)
171#define ETHER_INT_SRC_INTLINK_OFST (15)
172#define ETHER_INT_SRC_INTLINK_MSK (0x8000)
173#define ETHER_INT_SRC_INTEXDEFER_OFST (16)
174#define ETHER_INT_SRC_INTEXDEFER_MSK (0x10000)
175#define ETHER_INT_SRC_INTRMON_OFST (17)
176#define ETHER_INT_SRC_INTRMON_MSK (0x20000)
177#define ETHER_INT_SRC_IRQ_MSK (0x83FF)
178
179#define ETHER_PAUSECNT(base) (ETHER00_TYPE (base + 0x40))
180#define ETHER_PAUSECNT_COUNT_OFST (0)
181#define ETHER_PAUSECNT_COUNT_MSK (0xFFFF)
182
183#define ETHER_REMPAUCNT(base) (ETHER00_TYPE (base + 0x44))
184#define ETHER_REMPAUCNT_COUNT_OFST (0)
185#define ETHER_REMPAUCNT_COUNT_MSK (0xFFFF)
186
187#define ETHER_TXCONFRMSTAT(base) (ETHER00_TYPE (base + 0x348))
188#define ETHER_TXCONFRMSTAT_TS_STAT_VALUE_OFST (0)
189#define ETHER_TXCONFRMSTAT_TS_STAT_VALUE_MSK (0x3FFFFF)
190
191#define ETHER_MAC_CTL(base) (ETHER00_TYPE (base + 0))
192#define ETHER_MAC_CTL_HALTREQ_OFST (0)
193#define ETHER_MAC_CTL_HALTREQ_MSK (0x1)
194#define ETHER_MAC_CTL_HALTIMM_OFST (1)
195#define ETHER_MAC_CTL_HALTIMM_MSK (0x2)
196#define ETHER_MAC_CTL_RESET_OFST (2)
197#define ETHER_MAC_CTL_RESET_MSK (0x4)
198#define ETHER_MAC_CTL_FULLDUP_OFST (3)
199#define ETHER_MAC_CTL_FULLDUP_MSK (0x8)
200#define ETHER_MAC_CTL_MACLOOP_OFST (4)
201#define ETHER_MAC_CTL_MACLOOP_MSK (0x10)
202#define ETHER_MAC_CTL_CONN_OFST (5)
203#define ETHER_MAC_CTL_CONN_MSK (0x60)
204#define ETHER_MAC_CTL_LOOP10_OFST (7)
205#define ETHER_MAC_CTL_LOOP10_MSK (0x80)
206#define ETHER_MAC_CTL_LNKCHG_OFST (8)
207#define ETHER_MAC_CTL_LNKCHG_MSK (0x100)
208#define ETHER_MAC_CTL_MISSROLL_OFST (10)
209#define ETHER_MAC_CTL_MISSROLL_MSK (0x400)
210#define ETHER_MAC_CTL_ENMISSROLL_OFST (13)
211#define ETHER_MAC_CTL_ENMISSROLL_MSK (0x2000)
212#define ETHER_MAC_CTL_LINK10_OFST (15)
213#define ETHER_MAC_CTL_LINK10_MSK (0x8000)
214
215#define ETHER_ARC_CTL(base) (ETHER00_TYPE (base + 0x4))
216#define ETHER_ARC_CTL_STATIONACC_OFST (0)
217#define ETHER_ARC_CTL_STATIONACC_MSK (0x1)
218#define ETHER_ARC_CTL_GROUPACC_OFST (1)
219#define ETHER_ARC_CTL_GROUPACC_MSK (0x2)
220#define ETHER_ARC_CTL_BROADACC_OFST (2)
221#define ETHER_ARC_CTL_BROADACC_MSK (0x4)
222#define ETHER_ARC_CTL_NEGARC_OFST (3)
223#define ETHER_ARC_CTL_NEGARC_MSK (0x8)
224#define ETHER_ARC_CTL_COMPEN_OFST (4)
225#define ETHER_ARC_CTL_COMPEN_MSK (0x10)
226
227#define ETHER_TX_CTL(base) (ETHER00_TYPE (base + 0x8))
228#define ETHER_TX_CTL_TXEN_OFST (0)
229#define ETHER_TX_CTL_TXEN_MSK (0x1)
230#define ETHER_TX_CTL_TXHALT_OFST (1)
231#define ETHER_TX_CTL_TXHALT_MSK (0x2)
232#define ETHER_TX_CTL_NOPAD_OFST (2)
233#define ETHER_TX_CTL_NOPAD_MSK (0x4)
234#define ETHER_TX_CTL_NOCRC_OFST (3)
235#define ETHER_TX_CTL_NOCRC_MSK (0x8)
236#define ETHER_TX_CTL_FBACK_OFST (4)
237#define ETHER_TX_CTL_FBACK_MSK (0x10)
238#define ETHER_TX_CTL_NOEXDEF_OFST (5)
239#define ETHER_TX_CTL_NOEXDEF_MSK (0x20)
240#define ETHER_TX_CTL_SDPAUSE_OFST (6)
241#define ETHER_TX_CTL_SDPAUSE_MSK (0x40)
242#define ETHER_TX_CTL_MII10_OFST (7)
243#define ETHER_TX_CTL_MII10_MSK (0x80)
244#define ETHER_TX_CTL_ENUNDER_OFST (8)
245#define ETHER_TX_CTL_ENUNDER_MSK (0x100)
246#define ETHER_TX_CTL_ENEXDEFER_OFST (9)
247#define ETHER_TX_CTL_ENEXDEFER_MSK (0x200)
248#define ETHER_TX_CTL_ENLCARR_OFST (10)
249#define ETHER_TX_CTL_ENLCARR_MSK (0x400)
250#define ETHER_TX_CTL_ENEXCOLL_OFST (11)
251#define ETHER_TX_CTL_ENEXCOLL_MSK (0x800)
252#define ETHER_TX_CTL_ENLATECOLL_OFST (12)
253#define ETHER_TX_CTL_ENLATECOLL_MSK (0x1000)
254#define ETHER_TX_CTL_ENTXPAR_OFST (13)
255#define ETHER_TX_CTL_ENTXPAR_MSK (0x2000)
256#define ETHER_TX_CTL_ENCOMP_OFST (14)
257#define ETHER_TX_CTL_ENCOMP_MSK (0x4000)
258
259#define ETHER_TX_STAT(base) (ETHER00_TYPE (base + 0xc))
260#define ETHER_TX_STAT_TXCOLL_OFST (0)
261#define ETHER_TX_STAT_TXCOLL_MSK (0xF)
262#define ETHER_TX_STAT_EXCOLL_OFST (4)
263#define ETHER_TX_STAT_EXCOLL_MSK (0x10)
264#define ETHER_TX_STAT_TXDEFER_OFST (5)
265#define ETHER_TX_STAT_TXDEFER_MSK (0x20)
266#define ETHER_TX_STAT_PAUSED_OFST (6)
267#define ETHER_TX_STAT_PAUSED_MSK (0x40)
268#define ETHER_TX_STAT_INTTX_OFST (7)
269#define ETHER_TX_STAT_INTTX_MSK (0x80)
270#define ETHER_TX_STAT_UNDER_OFST (8)
271#define ETHER_TX_STAT_UNDER_MSK (0x100)
272#define ETHER_TX_STAT_EXDEFER_OFST (9)
273#define ETHER_TX_STAT_EXDEFER_MSK (0x200)
274#define ETHER_TX_STAT_LCARR_OFST (10)
275#define ETHER_TX_STAT_LCARR_MSK (0x400)
276#define ETHER_TX_STAT_TX10STAT_OFST (11)
277#define ETHER_TX_STAT_TX10STAT_MSK (0x800)
278#define ETHER_TX_STAT_LATECOLL_OFST (12)
279#define ETHER_TX_STAT_LATECOLL_MSK (0x1000)
280#define ETHER_TX_STAT_TXPAR_OFST (13)
281#define ETHER_TX_STAT_TXPAR_MSK (0x2000)
282#define ETHER_TX_STAT_COMP_OFST (14)
283#define ETHER_TX_STAT_COMP_MSK (0x4000)
284#define ETHER_TX_STAT_TXHALTED_OFST (15)
285#define ETHER_TX_STAT_TXHALTED_MSK (0x8000)
286#define ETHER_TX_STAT_SQERR_OFST (16)
287#define ETHER_TX_STAT_SQERR_MSK (0x10000)
288#define ETHER_TX_STAT_TXMCAST_OFST (17)
289#define ETHER_TX_STAT_TXMCAST_MSK (0x20000)
290#define ETHER_TX_STAT_TXBCAST_OFST (18)
291#define ETHER_TX_STAT_TXBCAST_MSK (0x40000)
292#define ETHER_TX_STAT_VLAN_OFST (19)
293#define ETHER_TX_STAT_VLAN_MSK (0x80000)
294#define ETHER_TX_STAT_MACC_OFST (20)
295#define ETHER_TX_STAT_MACC_MSK (0x100000)
296#define ETHER_TX_STAT_TXPAUSE_OFST (21)
297#define ETHER_TX_STAT_TXPAUSE_MSK (0x200000)
298
299#define ETHER_RX_CTL(base) (ETHER00_TYPE (base + 0x10))
300#define ETHER_RX_CTL_RXEN_OFST (0)
301#define ETHER_RX_CTL_RXEN_MSK (0x1)
302#define ETHER_RX_CTL_RXHALT_OFST (1)
303#define ETHER_RX_CTL_RXHALT_MSK (0x2)
304#define ETHER_RX_CTL_LONGEN_OFST (2)
305#define ETHER_RX_CTL_LONGEN_MSK (0x4)
306#define ETHER_RX_CTL_SHORTEN_OFST (3)
307#define ETHER_RX_CTL_SHORTEN_MSK (0x8)
308#define ETHER_RX_CTL_STRIPCRC_OFST (4)
309#define ETHER_RX_CTL_STRIPCRC_MSK (0x10)
310#define ETHER_RX_CTL_PASSCTL_OFST (5)
311#define ETHER_RX_CTL_PASSCTL_MSK (0x20)
312#define ETHER_RX_CTL_IGNORECRC_OFST (6)
313#define ETHER_RX_CTL_IGNORECRC_MSK (0x40)
314#define ETHER_RX_CTL_ENALIGN_OFST (8)
315#define ETHER_RX_CTL_ENALIGN_MSK (0x100)
316#define ETHER_RX_CTL_ENCRCERR_OFST (9)
317#define ETHER_RX_CTL_ENCRCERR_MSK (0x200)
318#define ETHER_RX_CTL_ENOVER_OFST (10)
319#define ETHER_RX_CTL_ENOVER_MSK (0x400)
320#define ETHER_RX_CTL_ENLONGERR_OFST (11)
321#define ETHER_RX_CTL_ENLONGERR_MSK (0x800)
322#define ETHER_RX_CTL_ENRXPAR_OFST (13)
323#define ETHER_RX_CTL_ENRXPAR_MSK (0x2000)
324#define ETHER_RX_CTL_ENGOOD_OFST (14)
325#define ETHER_RX_CTL_ENGOOD_MSK (0x4000)
326
327#define ETHER_RX_STAT(base) (ETHER00_TYPE (base + 0x14))
328#define ETHER_RX_STAT_LENERR_OFST (4)
329#define ETHER_RX_STAT_LENERR_MSK (0x10)
330#define ETHER_RX_STAT_CTLRECD_OFST (5)
331#define ETHER_RX_STAT_CTLRECD_MSK (0x20)
332#define ETHER_RX_STAT_INTRX_OFST (6)
333#define ETHER_RX_STAT_INTRX_MSK (0x40)
334#define ETHER_RX_STAT_RX10STAT_OFST (7)
335#define ETHER_RX_STAT_RX10STAT_MSK (0x80)
336#define ETHER_RX_STAT_ALIGNERR_OFST (8)
337#define ETHER_RX_STAT_ALIGNERR_MSK (0x100)
338#define ETHER_RX_STAT_CRCERR_OFST (9)
339#define ETHER_RX_STAT_CRCERR_MSK (0x200)
340#define ETHER_RX_STAT_OVERFLOW_OFST (10)
341#define ETHER_RX_STAT_OVERFLOW_MSK (0x400)
342#define ETHER_RX_STAT_LONGERR_OFST (11)
343#define ETHER_RX_STAT_LONGERR_MSK (0x800)
344#define ETHER_RX_STAT_RXPAR_OFST (13)
345#define ETHER_RX_STAT_RXPAR_MSK (0x2000)
346#define ETHER_RX_STAT_GOOD_OFST (14)
347#define ETHER_RX_STAT_GOOD_MSK (0x4000)
348#define ETHER_RX_STAT_RXHALTED_OFST (15)
349#define ETHER_RX_STAT_RXHALTED_MSK (0x8000)
350#define ETHER_RX_STAT_RXMCAST_OFST (17)
351#define ETHER_RX_STAT_RXMCAST_MSK (0x10000)
352#define ETHER_RX_STAT_RXBCAST_OFST (18)
353#define ETHER_RX_STAT_RXBCAST_MSK (0x20000)
354#define ETHER_RX_STAT_RXVLAN_OFST (19)
355#define ETHER_RX_STAT_RXVLAN_MSK (0x40000)
356#define ETHER_RX_STAT_RXPAUSE_OFST (20)
357#define ETHER_RX_STAT_RXPAUSE_MSK (0x80000)
358#define ETHER_RX_STAT_ARCSTATUS_OFST (21)
359#define ETHER_RX_STAT_ARCSTATUS_MSK (0xF00000)
360#define ETHER_RX_STAT_ARCENT_OFST (25)
361#define ETHER_RX_STAT_ARCENT_MSK (0x1F000000)
362
363#define ETHER_MD_DATA(base) (ETHER00_TYPE (base + 0x18))
364
365#define ETHER_MD_CA(base) (ETHER00_TYPE (base + 0x1c))
366#define ETHER_MD_CA_ADDR_OFST (0)
367#define ETHER_MD_CA_ADDR_MSK (0x1F)
368#define ETHER_MD_CA_PHY_OFST (5)
369#define ETHER_MD_CA_PHY_MSK (0x3E0)
370#define ETHER_MD_CA_WR_OFST (10)
371#define ETHER_MD_CA_WR_MSK (0x400)
372#define ETHER_MD_CA_BUSY_OFST (11)
373#define ETHER_MD_CA_BUSY_MSK (0x800)
374#define ETHER_MD_CA_PRESUPP_OFST (12)
375#define ETHER_MD_CA_PRESUPP_MSK (0x1000)
376
377#define ETHER_ARC_ADR(base) (ETHER00_TYPE (base + 0x160))
378#define ETHER_ARC_ADR_ARC_LOC_OFST (2)
379#define ETHER_ARC_ADR_ARC_LOC_MSK (0xFFC)
380
381#define ETHER_ARC_DATA(base) (ETHER00_TYPE (base + 0x364))
382
383#define ETHER_ARC_ENA(base) (ETHER00_TYPE (base + 0x28))
384#define ETHER_ARC_ENA_MSK (0x1FFFFF)
385
386#define ETHER_PROM_CTL(base) (ETHER00_TYPE (base + 0x2c))
387#define ETHER_PROM_CTL_PROM_ADDR_OFST (0)
388#define ETHER_PROM_CTL_PROM_ADDR_MSK (0x3F)
389#define ETHER_PROM_CTL_OPCODE_OFST (13)
390#define ETHER_PROM_CTL_OPCODE_MSK (0x6000)
391#define ETHER_PROM_CTL_OPCODE_READ_MSK (0x4000)
392#define ETHER_PROM_CTL_OPCODE_WRITE_MSK (0x2000)
393#define ETHER_PROM_CTL_OPCODE_ERASE_MSK (0x6000)
394#define ETHER_PROM_CTL_ENABLE_MSK (0x0030)
395#define ETHER_PROM_CTL_DISABLE_MSK (0x0000)
396#define ETHER_PROM_CTL_BUSY_OFST (15)
397#define ETHER_PROM_CTL_BUSY_MSK (0x8000)
398
399#define ETHER_PROM_DATA(base) (ETHER00_TYPE (base + 0x30))
400
401#define ETHER_MISS_CNT(base) (ETHER00_TYPE (base + 0x3c))
402#define ETHER_MISS_CNT_COUNT_OFST (0)
403#define ETHER_MISS_CNT_COUNT_MSK (0xFFFF)
404
405#define ETHER_CNTDATA(base) (ETHER00_TYPE (base + 0x80))
406
407#define ETHER_CNTACC(base) (ETHER00_TYPE (base + 0x84))
408#define ETHER_CNTACC_ADDR_OFST (0)
409#define ETHER_CNTACC_ADDR_MSK (0xFF)
410#define ETHER_CNTACC_WRRDN_OFST (8)
411#define ETHER_CNTACC_WRRDN_MSK (0x100)
412#define ETHER_CNTACC_CLEAR_OFST (9)
413#define ETHER_CNTACC_CLEAR_MSK (0x200)
414
415#define ETHER_TXRMINTEN(base) (ETHER00_TYPE (base + 0x88))
416#define ETHER_TXRMINTEN_MSK (0x3FFFFFFF)
417
418#define ETHER_RXRMINTEN(base) (ETHER00_TYPE (base + 0x8C))
419#define ETHER_RXRMINTEN_MSK (0xFFFFFF)
420
421/*
422* RMON Registers
423*/
424#define RMON_COLLISION0 0x0
425#define RMON_COLLISION1 0x1
426#define RMON_COLLISION2 0x2
427#define RMON_COLLISION3 0x3
428#define RMON_COLLISION4 0x4
429#define RMON_COLLISION5 0x5
430#define RMON_COLLISION6 0x6
431#define RMON_COLLISION7 0x7
432#define RMON_COLLISION8 0x8
433#define RMON_COLLISION9 0x9
434#define RMON_COLLISION10 0xa
435#define RMON_COLLISION11 0xb
436#define RMON_COLLISION12 0xc
437#define RMON_COLLISION13 0xd
438#define RMON_COLLISION14 0xe
439#define RMON_COLLISION15 0xf
440#define RMON_COLLISION16 0x10
441#define RMON_FRAMES_WITH_DEFERRED_XMISSIONS 0x11
442#define RMON_LATE_COLLISIONS 0x12
443#define RMON_FRAMES_LOST_DUE_TO_MAC_XMIT 0x13
444#define RMON_CARRIER_SENSE_ERRORS 0x14
445#define RMON_FRAMES_WITH_EXCESSIVE_DEFERAL 0x15
446#define RMON_UNICAST_FRAMES_TRANSMITTED_OK 0x16
447#define RMON_MULTICAST_FRAMES_XMITTED_OK 0x17
448#define RMON_BROADCAST_FRAMES_XMITTED_OK 0x18
449#define RMON_SQE_TEST_ERRORS 0x19
450#define RMON_PAUSE_MACCTRL_FRAMES_XMITTED 0x1A
451#define RMON_MACCTRL_FRAMES_XMITTED 0x1B
452#define RMON_VLAN_FRAMES_XMITTED 0x1C
453#define RMON_OCTETS_XMITTED_OK 0x1D
454#define RMON_OCTETS_XMITTED_OK_HI 0x1E
455
456#define RMON_RX_PACKET_SIZES0 0x40
457#define RMON_RX_PACKET_SIZES1 0x41
458#define RMON_RX_PACKET_SIZES2 0x42
459#define RMON_RX_PACKET_SIZES3 0x43
460#define RMON_RX_PACKET_SIZES4 0x44
461#define RMON_RX_PACKET_SIZES5 0x45
462#define RMON_RX_PACKET_SIZES6 0x46
463#define RMON_RX_PACKET_SIZES7 0x47
464#define RMON_FRAME_CHECK_SEQUENCE_ERRORS 0x48
465#define RMON_ALIGNMENT_ERRORS 0x49
466#define RMON_FRAGMENTS 0x4A
467#define RMON_JABBERS 0x4B
468#define RMON_FRAMES_LOST_TO_INTMACRCVERR 0x4C
469#define RMON_UNICAST_FRAMES_RCVD_OK 0x4D
470#define RMON_MULTICAST_FRAMES_RCVD_OK 0x4E
471#define RMON_BROADCAST_FRAMES_RCVD_OK 0x4F
472#define RMON_IN_RANGE_LENGTH_ERRORS 0x50
473#define RMON_OUT_OF_RANGE_LENGTH_ERRORS 0x51
474#define RMON_VLAN_FRAMES_RCVD 0x52
475#define RMON_PAUSE_MAC_CTRL_FRAMES_RCVD 0x53
476#define RMON_MAC_CTRL_FRAMES_RCVD 0x54
477#define RMON_OCTETS_RCVD_OK 0x55
478#define RMON_OCTETS_RCVD_OK_HI 0x56
479#define RMON_OCTETS_RCVD_OTHER 0x57
480#define RMON_OCTETS_RCVD_OTHER_HI 0x58
481
482#endif /* __ETHER00_H */
diff --git a/include/asm-arm/arch-epxa10db/excalibur.h b/include/asm-arm/arch-epxa10db/excalibur.h
new file mode 100644
index 000000000000..5c91dd6d7822
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/excalibur.h
@@ -0,0 +1,91 @@
1/* megafunction wizard: %ARM-Based Excalibur%
2 GENERATION: STANDARD
3 VERSION: WM1.0
4 MODULE: ARM-Based Excalibur
5 PROJECT: excalibur
6 ============================================================
7 File Name: v:\embedded\linux\bootldr\excalibur.h
8 Megafunction Name(s): ARM-Based Excalibur
9 ============================================================
10
11 ************************************************************
12 THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
13 ************************************************************/
14
15#ifndef EXCALIBUR_H_INCLUDED
16#define EXCALIBUR_H_INCLUDED
17
18#define EXC_DEFINE_PROCESSOR_LITTLE_ENDIAN
19#define EXC_DEFINE_BOOT_FROM_FLASH
20
21#define EXC_INPUT_CLK_FREQUENCY (50000000)
22#define EXC_AHB1_CLK_FREQUENCY (150000000)
23#define EXC_AHB2_CLK_FREQUENCY (75000000)
24#define EXC_SDRAM_CLK_FREQUENCY (75000000)
25
26/* Registers Block */
27#define EXC_REGISTERS_BASE (0x7fffc000)
28#define EXC_MODE_CTRL00_BASE (EXC_REGISTERS_BASE + 0x000)
29#define EXC_IO_CTRL00_BASE (EXC_REGISTERS_BASE + 0x040)
30#define EXC_MMAP00_BASE (EXC_REGISTERS_BASE + 0x080)
31#define EXC_PLD_CONFIG00_BASE (EXC_REGISTERS_BASE + 0x140)
32#define EXC_TIMER00_BASE (EXC_REGISTERS_BASE + 0x200)
33#define EXC_INT_CTRL00_BASE (EXC_REGISTERS_BASE + 0xc00)
34#define EXC_CLOCK_CTRL00_BASE (EXC_REGISTERS_BASE + 0x300)
35#define EXC_WATCHDOG00_BASE (EXC_REGISTERS_BASE + 0xa00)
36#define EXC_UART00_BASE (EXC_REGISTERS_BASE + 0x280)
37#define EXC_EBI00_BASE (EXC_REGISTERS_BASE + 0x380)
38#define EXC_SDRAM00_BASE (EXC_REGISTERS_BASE + 0x400)
39#define EXC_AHB12_BRIDGE_CTRL00_BASE (EXC_REGISTERS_BASE + 0x800)
40#define EXC_PLD_STRIPE_BRIDGE_CTRL00_BASE (EXC_REGISTERS_BASE + 0x100)
41#define EXC_STRIPE_PLD_BRIDGE_CTRL00_BASE (EXC_REGISTERS_BASE + 0x100)
42
43#define EXC_REGISTERS_SIZE (0x00004000)
44
45/* EBI Block(s) */
46#define EXC_EBI_BLOCK0_BASE (0x40000000)
47#define EXC_EBI_BLOCK0_SIZE (0x00400000)
48#define EXC_EBI_BLOCK0_WIDTH (8)
49#define EXC_EBI_BLOCK0_NON_CACHEABLE
50#define EXC_EBI_BLOCK1_BASE (0x40400000)
51#define EXC_EBI_BLOCK1_SIZE (0x00400000)
52#define EXC_EBI_BLOCK1_WIDTH (16)
53#define EXC_EBI_BLOCK1_NON_CACHEABLE
54#define EXC_EBI_BLOCK2_BASE (0x40800000)
55#define EXC_EBI_BLOCK2_SIZE (0x00400000)
56#define EXC_EBI_BLOCK2_WIDTH (16)
57#define EXC_EBI_BLOCK2_NON_CACHEABLE
58#define EXC_EBI_BLOCK3_BASE (0x40c00000)
59#define EXC_EBI_BLOCK3_SIZE (0x00400000)
60#define EXC_EBI_BLOCK3_WIDTH (16)
61#define EXC_EBI_BLOCK3_NON_CACHEABLE
62
63/* SDRAM Block(s) */
64#define EXC_SDRAM_BLOCK0_BASE (0x00000000)
65#define EXC_SDRAM_BLOCK0_SIZE (0x04000000)
66#define EXC_SDRAM_BLOCK0_WIDTH (32)
67#define EXC_SDRAM_BLOCK1_BASE (0x04000000)
68#define EXC_SDRAM_BLOCK1_SIZE (0x04000000)
69#define EXC_SDRAM_BLOCK1_WIDTH (32)
70
71/* Single Port SRAM Block(s) */
72#define EXC_SPSRAM_BLOCK0_BASE (0x08000000)
73#define EXC_SPSRAM_BLOCK0_SIZE (0x00020000)
74#define EXC_SPSRAM_BLOCK1_BASE (0x08020000)
75#define EXC_SPSRAM_BLOCK1_SIZE (0x00020000)
76
77/* PLD Block(s) */
78#define EXC_PLD_BLOCK0_BASE (0x80000000)
79#define EXC_PLD_BLOCK0_SIZE (0x00004000)
80#define EXC_PLD_BLOCK0_NON_CACHEABLE
81#define EXC_PLD_BLOCK1_BASE (0xf000000)
82#define EXC_PLD_BLOCK1_SIZE (0x00004000)
83#define EXC_PLD_BLOCK1_NON_CACHEABLE
84#define EXC_PLD_BLOCK2_BASE (0x80008000)
85#define EXC_PLD_BLOCK2_SIZE (0x00004000)
86#define EXC_PLD_BLOCK2_NON_CACHEABLE
87#define EXC_PLD_BLOCK3_BASE (0x8000c000)
88#define EXC_PLD_BLOCK3_SIZE (0x00004000)
89#define EXC_PLD_BLOCK3_NON_CACHEABLE
90
91#endif
diff --git a/include/asm-arm/arch-epxa10db/hardware.h b/include/asm-arm/arch-epxa10db/hardware.h
new file mode 100644
index 000000000000..b992c2924a77
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/hardware.h
@@ -0,0 +1,64 @@
1/*
2 * linux/include/asm-arm/arch-epxa10/hardware.h
3 *
4 * This file contains the hardware definitions of the Integrator.
5 *
6 * Copyright (C) 1999 ARM Limited.
7 * Copyright (C) 2001 Altera Corporation
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#ifndef __ASM_ARCH_HARDWARE_H
24#define __ASM_ARCH_HARDWARE_H
25
26#include <asm/arch/platform.h>
27
28/*
29 * Where in virtual memory the IO devices (timers, system controllers
30 * and so on)
31 */
32#define IO_BASE 0xf0000000 // VA of IO
33#define IO_SIZE 0x10000000 // How much?
34#define IO_START EXC_REGISTERS_BASE // PA of IO
35/* macro to get at IO space when running virtually */
36#define IO_ADDRESS(x) ((x) | 0xf0000000)
37
38#define FLASH_VBASE 0xFE000000
39#define FLASH_SIZE 0x01000000
40#define FLASH_START EXC_EBI_BLOCK0_BASE
41#define FLASH_VADDR(x) ((x)|0xFE000000)
42/*
43 * Similar to above, but for PCI addresses (memory, IO, Config and the
44 * V3 chip itself). WARNING: this has to mirror definitions in platform.h
45 */
46#if 0
47#define PCI_MEMORY_VADDR 0xe8000000
48#define PCI_CONFIG_VADDR 0xec000000
49#define PCI_V3_VADDR 0xed000000
50#define PCI_IO_VADDR 0xee000000
51
52#define PCIO_BASE PCI_IO_VADDR
53#define PCIMEM_BASE PCI_MEMORY_VADDR
54
55
56#define pcibios_assign_all_busses() 1
57
58#define PCIBIOS_MIN_IO 0x6000
59#define PCIBIOS_MIN_MEM 0x00100000
60#endif
61
62
63#endif
64
diff --git a/include/asm-arm/arch-epxa10db/int_ctrl00.h b/include/asm-arm/arch-epxa10db/int_ctrl00.h
new file mode 100644
index 000000000000..23ec864c40bb
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/int_ctrl00.h
@@ -0,0 +1,288 @@
1/*
2 *
3 * This file contains the register definitions for the Excalibur
4 * Timer TIMER00.
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
23#ifndef __INT_CTRL00_H
24#define __INT_CTRL00_H
25
26#define INT_MS(base_addr) (INT_CTRL00_TYPE (base_addr + 0x00 ))
27#define INT_MS_FC_MSK (0x10000)
28#define INT_MS_FC_OFST (16)
29#define INT_MS_M1_MSK (0x8000)
30#define INT_MS_M1_OFST (15)
31#define INT_MS_M0_MSK (0x4000)
32#define INT_MS_M0_OFST (14)
33#define INT_MS_AE_MSK (0x2000)
34#define INT_MS_AE_OFST (13)
35#define INT_MS_PE_MSK (0x1000)
36#define INT_MS_PE_OFST (12)
37#define INT_MS_EE_MSK (0x0800)
38#define INT_MS_EE_OFST (11)
39#define INT_MS_PS_MSK (0x0400)
40#define INT_MS_PS_OFST (10)
41#define INT_MS_T1_MSK (0x0200)
42#define INT_MS_T1_OFST (9)
43#define INT_MS_T0_MSK (0x0100)
44#define INT_MS_T0_OFST (8)
45#define INT_MS_UA_MSK (0x0080)
46#define INT_MS_UA_OFST (7)
47#define INT_MS_IP_MSK (0x0040)
48#define INT_MS_IP_OFST (6)
49#define INT_MS_P5_MSK (0x0020)
50#define INT_MS_P5_OFST (5)
51#define INT_MS_P4_MSK (0x0010)
52#define INT_MS_P4_OFST (4)
53#define INT_MS_P3_MSK (0x0008)
54#define INT_MS_P3_OFST (3)
55#define INT_MS_P2_MSK (0x0004)
56#define INT_MS_P2_OFST (2)
57#define INT_MS_P1_MSK (0x0002)
58#define INT_MS_P1_OFST (1)
59#define INT_MS_P0_MSK (0x0001)
60#define INT_MS_P0_OFST (0)
61
62#define INT_MC(base_addr) (INT_CTRL00_TYPE (base_addr + 0x04 ))
63#define INT_MC_FC_MSK (0x10000)
64#define INT_MC_FC_OFST (16)
65#define INT_MC_M1_MSK (0x8000)
66#define INT_MC_M1_OFST (15)
67#define INT_MC_M0_MSK (0x4000)
68#define INT_MC_M0_OFST (14)
69#define INT_MC_AE_MSK (0x2000)
70#define INT_MC_AE_OFST (13)
71#define INT_MC_PE_MSK (0x1000)
72#define INT_MC_PE_OFST (12)
73#define INT_MC_EE_MSK (0x0800)
74#define INT_MC_EE_OFST (11)
75#define INT_MC_PS_MSK (0x0400)
76#define INT_MC_PS_OFST (10)
77#define INT_MC_T1_MSK (0x0200)
78#define INT_MC_T1_OFST (9)
79#define INT_MC_T0_MSK (0x0100)
80#define INT_MC_T0_OFST (8)
81#define INT_MC_UA_MSK (0x0080)
82#define INT_MC_UA_OFST (7)
83#define INT_MC_IP_MSK (0x0040)
84#define INT_MC_IP_OFST (6)
85#define INT_MC_P5_MSK (0x0020)
86#define INT_MC_P5_OFST (5)
87#define INT_MC_P4_MSK (0x0010)
88#define INT_MC_P4_OFST (4)
89#define INT_MC_P3_MSK (0x0008)
90#define INT_MC_P3_OFST (3)
91#define INT_MC_P2_MSK (0x0004)
92#define INT_MC_P2_OFST (2)
93#define INT_MC_P1_MSK (0x0002)
94#define INT_MC_P1_OFST (1)
95#define INT_MC_P0_MSK (0x0001)
96#define INT_MC_P0_OFST (0)
97
98#define INT_SS(base_addr) (INT_CTRL00_TYPE (base_addr + 0x08 ))
99#define INT_SS_FC_SSK (0x8000)
100#define INT_SS_FC_OFST (15)
101#define INT_SS_M1_SSK (0x8000)
102#define INT_SS_M1_OFST (15)
103#define INT_SS_M0_SSK (0x4000)
104#define INT_SS_M0_OFST (14)
105#define INT_SS_AE_SSK (0x2000)
106#define INT_SS_AE_OFST (13)
107#define INT_SS_PE_SSK (0x1000)
108#define INT_SS_PE_OFST (12)
109#define INT_SS_EE_SSK (0x0800)
110#define INT_SS_EE_OFST (11)
111#define INT_SS_PS_SSK (0x0400)
112#define INT_SS_PS_OFST (10)
113#define INT_SS_T1_SSK (0x0200)
114#define INT_SS_T1_OFST (9)
115#define INT_SS_T0_SSK (0x0100)
116#define INT_SS_T0_OFST (8)
117#define INT_SS_UA_SSK (0x0080)
118#define INT_SS_UA_OFST (7)
119#define INT_SS_IP_SSK (0x0040)
120#define INT_SS_IP_OFST (6)
121#define INT_SS_P5_SSK (0x0020)
122#define INT_SS_P5_OFST (5)
123#define INT_SS_P4_SSK (0x0010)
124#define INT_SS_P4_OFST (4)
125#define INT_SS_P3_SSK (0x0008)
126#define INT_SS_P3_OFST (3)
127#define INT_SS_P2_SSK (0x0004)
128#define INT_SS_P2_OFST (2)
129#define INT_SS_P1_SSK (0x0002)
130#define INT_SS_P1_OFST (1)
131#define INT_SS_P0_SSK (0x0001)
132#define INT_SS_P0_OFST (0)
133
134#define INT_RS(base_addr) (INT_CTRL00_TYPE (base_addr + 0x0C ))
135#define INT_RS_FC_RSK (0x10000)
136#define INT_RS_FC_OFST (16)
137#define INT_RS_M1_RSK (0x8000)
138#define INT_RS_M1_OFST (15)
139#define INT_RS_M0_RSK (0x4000)
140#define INT_RS_M0_OFST (14)
141#define INT_RS_AE_RSK (0x2000)
142#define INT_RS_AE_OFST (13)
143#define INT_RS_PE_RSK (0x1000)
144#define INT_RS_PE_OFST (12)
145#define INT_RS_EE_RSK (0x0800)
146#define INT_RS_EE_OFST (11)
147#define INT_RS_PS_RSK (0x0400)
148#define INT_RS_PS_OFST (10)
149#define INT_RS_T1_RSK (0x0200)
150#define INT_RS_T1_OFST (9)
151#define INT_RS_T0_RSK (0x0100)
152#define INT_RS_T0_OFST (8)
153#define INT_RS_UA_RSK (0x0080)
154#define INT_RS_UA_OFST (7)
155#define INT_RS_IP_RSK (0x0040)
156#define INT_RS_IP_OFST (6)
157#define INT_RS_P5_RSK (0x0020)
158#define INT_RS_P5_OFST (5)
159#define INT_RS_P4_RSK (0x0010)
160#define INT_RS_P4_OFST (4)
161#define INT_RS_P3_RSK (0x0008)
162#define INT_RS_P3_OFST (3)
163#define INT_RS_P2_RSK (0x0004)
164#define INT_RS_P2_OFST (2)
165#define INT_RS_P1_RSK (0x0002)
166#define INT_RS_P1_OFST (1)
167#define INT_RS_P0_RSK (0x0001)
168#define INT_RS_P0_OFST (0)
169
170#define INT_ID(base_addr) (INT_CTRL00_TYPE (base_addr + 0x10 ))
171#define INT_ID_ID_MSK (0x3F)
172#define INT_ID_ID_OFST (0)
173
174#define INT_PLD_PRIORITY(base_addr) (INT_CTRL00_TYPE (base_addr + 0x14 ))
175#define INT_PLD_PRIORITY_PRI_MSK (0x3F)
176#define INT_PLD_PRIORITY_PRI_OFST (0)
177#define INT_PLD_PRIORITY_GA_MSK (0x40)
178#define INT_PLD_PRIORITY_GA_OFST (6)
179
180#define INT_MODE(base_addr) (INT_CTRL00_TYPE (base_addr + 0x18 ))
181#define INT_MODE_MODE_MSK (0x3)
182#define INT_MODE_MODE_OFST (0)
183
184#define INT_PRIORITY_P0(base_addr) (INT_CTRL00_TYPE (base_addr + 0x80 ))
185#define INT_PRIORITY_P0_PRI_MSK (0x3F)
186#define INT_PRIORITY_P0_PRI_OFST (0)
187#define INT_PRIORITY_P0_FQ_MSK (0x40)
188#define INT_PRIORITY_P0_FQ_OFST (6)
189
190#define INT_PRIORITY_P1(base_addr) (INT_CTRL00_TYPE (base_addr + 0x84 ))
191#define INT_PRIORITY_P1_PRI_MSK (0x3F)
192#define INT_PRIORITY_P1_PRI_OFST (0)
193#define INT_PRIORITY_P1_FQ_MSK (0x40)
194#define INT_PRIORITY_P1_FQ_OFST (6)
195
196#define INT_PRIORITY_P2(base_addr) (INT_CTRL00_TYPE (base_addr + 0x88 ))
197#define INT_PRIORITY_P2_PRI_MSK (0x3F)
198#define INT_PRIORITY_P2_PRI_OFST (0)
199#define INT_PRIORITY_P2_FQ_MSK (0x40)
200#define INT_PRIORITY_P2_FQ_OFST (6)
201
202#define INT_PRIORITY_P3(base_addr) (INT_CTRL00_TYPE (base_addr + 0x8C ))
203#define INT_PRIORITY_P3_PRI_MSK (0x3F)
204#define INT_PRIORITY_P3_PRI_OFST (0)
205#define INT_PRIORITY_P3_FQ_MSK (0x40)
206#define INT_PRIORITY_P3_FQ_OFST (6)
207
208#define INT_PRIORITY_P4(base_addr) (INT_CTRL00_TYPE (base_addr + 0x90 ))
209#define INT_PRIORITY_P4_PRI_MSK (0x3F)
210#define INT_PRIORITY_P4_PRI_OFST (0)
211#define INT_PRIORITY_P4_FQ_MSK (0x40)
212#define INT_PRIORITY_P4_FQ_OFST (6)
213
214#define INT_PRIORITY_P5(base_addr) (INT_CTRL00_TYPE (base_addr + 0x94 ))
215#define INT_PRIORITY_P5_PRI_MSK (0x3F)
216#define INT_PRIORITY_P5_PRI_OFST (0)
217#define INT_PRIORITY_P5_FQ_MSK (0x40)
218#define INT_PRIORITY_P5_FQ_OFST (6)
219
220#define INT_PRIORITY_IP(base_addr) (INT_CTRL00_TYPE (base_addr + 0x94 ))
221#define INT_PRIORITY_IP_PRI_MSK (0x3F)
222#define INT_PRIORITY_IP_PRI_OFST (0)
223#define INT_PRIORITY_IP_FQ_MSK (0x40)
224#define INT_PRIORITY_IP_FQ_OFST (6)
225
226#define INT_PRIORITY_UA(base_addr) (INT_CTRL00_TYPE (base_addr + 0x9C ))
227#define INT_PRIORITY_UA_PRI_MSK (0x3F)
228#define INT_PRIORITY_UA_PRI_OFST (0)
229#define INT_PRIORITY_UA_FQ_MSK (0x40)
230#define INT_PRIORITY_UA_FQ_OFST (6)
231
232#define INT_PRIORITY_T0(base_addr) (INT_CTRL00_TYPE (base_addr + 0xA0 ))
233#define INT_PRIORITY_T0_PRI_MSK (0x3F)
234#define INT_PRIORITY_T0_PRI_OFST (0)
235#define INT_PRIORITY_T0_FQ_MSK (0x40)
236#define INT_PRIORITY_T0_FQ_OFST (6)
237
238#define INT_PRIORITY_T1(base_addr) (INT_CTRL00_TYPE (base_addr + 0xA4 ))
239#define INT_PRIORITY_T1_PRI_MSK (0x3F)
240#define INT_PRIORITY_T1_PRI_OFST (0)
241#define INT_PRIORITY_T1_FQ_MSK (0x40)
242#define INT_PRIORITY_T1_FQ_OFST (6)
243
244#define INT_PRIORITY_PS(base_addr) (INT_CTRL00_TYPE (base_addr + 0xA8 ))
245#define INT_PRIORITY_PS_PRI_MSK (0x3F)
246#define INT_PRIORITY_PS_PRI_OFST (0)
247#define INT_PRIORITY_PS_FQ_MSK (0x40)
248#define INT_PRIORITY_PS_FQ_OFST (6)
249
250#define INT_PRIORITY_EE(base_addr) (INT_CTRL00_TYPE (base_addr + 0xAC ))
251#define INT_PRIORITY_EE_PRI_MSK (0x3F)
252#define INT_PRIORITY_EE_PRI_OFST (0)
253#define INT_PRIORITY_EE_FQ_MSK (0x40)
254#define INT_PRIORITY_EE_FQ_OFST (6)
255
256#define INT_PRIORITY_PE(base_addr) (INT_CTRL00_TYPE (base_addr + 0xB0 ))
257#define INT_PRIORITY_PE_PRI_MSK (0x3F)
258#define INT_PRIORITY_PE_PRI_OFST (0)
259#define INT_PRIORITY_PE_FQ_MSK (0x40)
260#define INT_PRIORITY_PE_FQ_OFST (6)
261
262#define INT_PRIORITY_AE(base_addr) (INT_CTRL00_TYPE (base_addr + 0xB4 ))
263#define INT_PRIORITY_AE_PRI_MSK (0x3F)
264#define INT_PRIORITY_AE_PRI_OFST (0)
265#define INT_PRIORITY_AE_FQ_MSK (0x40)
266#define INT_PRIORITY_AE_FQ_OFST (6)
267
268#define INT_PRIORITY_M0(base_addr) (INT_CTRL00_TYPE (base_addr + 0xB8 ))
269#define INT_PRIORITY_M0_PRI_MSK (0x3F)
270#define INT_PRIORITY_M0_PRI_OFST (0)
271#define INT_PRIORITY_M0_FQ_MSK (0x40)
272#define INT_PRIORITY_M0_FQ_OFST (6)
273
274#define INT_PRIORITY_M1(base_addr) (INT_CTRL00_TYPE (base_addr + 0xBC ))
275#define INT_PRIORITY_M1_PRI_MSK (0x3F)
276#define INT_PRIORITY_M1_PRI_OFST (0)
277#define INT_PRIORITY_M1_FQ_MSK (0x40)
278#define INT_PRIORITY_M1_FQ_OFST (6)
279
280#define INT_PRIORITY_FC(base_addr) (INT_CTRL00_TYPE (base_addr + 0xC0 ))
281#define INT_PRIORITY_FC_PRI_MSK (0x3F)
282#define INT_PRIORITY_FC_PRI_OFST (0)
283#define INT_PRIORITY_FC_FQ_MSK (0x40)
284#define INT_PRIORITY_FC_FQ_OFST (6)
285
286#endif /* __INT_CTRL00_H */
287
288
diff --git a/include/asm-arm/arch-epxa10db/io.h b/include/asm-arm/arch-epxa10db/io.h
new file mode 100644
index 000000000000..1f0afa257621
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/io.h
@@ -0,0 +1,39 @@
1/*
2 * linux/include/asm-arm/arch-epxa10db/io.h
3 *
4 * Copyright (C) 1999 ARM Limited
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#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22
23#define IO_SPACE_LIMIT 0xffff
24
25
26/*
27 * Generic virtual read/write
28 */
29/*#define outsw __arch_writesw
30#define outsl __arch_writesl
31#define outsb __arch_writesb
32#define insb __arch_readsb
33#define insw __arch_readsw
34#define insl __arch_readsl*/
35
36#define __io(a) ((void __iomem *)(a))
37#define __mem_pci(a) (a)
38
39#endif
diff --git a/include/asm-arm/arch-epxa10db/irqs.h b/include/asm-arm/arch-epxa10db/irqs.h
new file mode 100644
index 000000000000..c3758a3b5d9d
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/irqs.h
@@ -0,0 +1,45 @@
1/*
2 * linux/include/asm-arm/arch-camelot/irqs.h
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
21/* Use the Excalibur chip definitions */
22#define INT_CTRL00_TYPE
23#include "asm/arch/int_ctrl00.h"
24
25
26#define IRQ_PLD0 INT_MS_P0_OFST
27#define IRQ_PLD1 INT_MS_P1_OFST
28#define IRQ_PLD2 INT_MS_P2_OFST
29#define IRQ_PLD3 INT_MS_P3_OFST
30#define IRQ_PLD4 INT_MS_P4_OFST
31#define IRQ_PLD5 INT_MS_P5_OFST
32#define IRQ_EXT INT_MS_IP_OFST
33#define IRQ_UART INT_MS_UA_OFST
34#define IRQ_TIMER0 INT_MS_T0_OFST
35#define IRQ_TIMER1 INT_MS_T1_OFST
36#define IRQ_PLL INT_MS_PLL_OFST
37#define IRQ_EBI INT_MS_EBI_OFST
38#define IRQ_STRIPE_BRIDGE INT_MS_PLL_OFST
39#define IRQ_AHB_BRIDGE INT_MS_PLL_OFST
40#define IRQ_COMMRX INT_MS_CR_OFST
41#define IRQ_COMMTX INT_MS_CT_OFST
42#define IRQ_FAST_COMM INT_MS_FC_OFST
43
44#define NR_IRQS (INT_MS_FC_OFST + 1)
45
diff --git a/include/asm-arm/arch-epxa10db/memory.h b/include/asm-arm/arch-epxa10db/memory.h
new file mode 100644
index 000000000000..3f86bf7f67f0
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/memory.h
@@ -0,0 +1,38 @@
1/*
2 * linux/include/asm-arm/arch-epxa10/memory.h
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#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H
22
23/*
24 * Physical DRAM offset.
25 */
26#define PHYS_OFFSET (0x00000000UL)
27
28/*
29 * Virtual view <-> DMA view memory address translations
30 * virt_to_bus: Used to translate the virtual address to an
31 * address suitable to be passed to set_dma_addr
32 * bus_to_virt: Used to convert an address for DMA operations
33 * to an address that the kernel can use.
34 */
35#define __virt_to_bus(x) (x - PAGE_OFFSET + /*SDRAM_BASE*/0)
36#define __bus_to_virt(x) (x - /*SDRAM_BASE*/0 + PAGE_OFFSET)
37
38#endif
diff --git a/include/asm-arm/arch-epxa10db/mode_ctrl00.h b/include/asm-arm/arch-epxa10db/mode_ctrl00.h
new file mode 100644
index 000000000000..d8a7efa12e19
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/mode_ctrl00.h
@@ -0,0 +1,80 @@
1#ifndef __MODE_CTRL00_H
2#define __MODE_CTRL00_H
3
4/*
5 * Register definitions for the reset and mode control
6 */
7
8/*
9 * Copyright (C) 2001 Altera Corporation
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
27
28#define BOOT_CR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR ))
29#define BOOT_CR_BF_MSK (0x1)
30#define BOOT_CR_BF_OFST (0)
31#define BOOT_CR_HM_MSK (0x2)
32#define BOOT_CR_HM_OFST (1)
33#define BOOT_CR_RE_MSK (0x4)
34#define BOOT_CR_RE_OFST (2)
35
36#define RESET_SR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x4 ))
37#define RESET_SR_WR_MSK (0x1)
38#define RESET_SR_WR_OFST (0)
39#define RESET_SR_CR_MSK (0x2)
40#define RESET_SR_CR_OFST (1)
41#define RESET_SR_JT_MSK (0x4)
42#define RESET_SR_JT_OFST (2)
43#define RESET_SR_ER_MSK (0x8)
44#define RESET_SR_ER_OFST (3)
45
46#define ID_CODE(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x08 ))
47
48#define SRAM0_SR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x20 ))
49#define SRAM0_SR_SIZE_MSK (0xFFFFF000)
50#define SRAM0_SR_SIZE_OFST (12)
51
52#define SRAM1_SR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x24 ))
53#define SRAM1_SR_SIZE_MSK (0xFFFFF000)
54#define SRAM1_SR_SIZE_OFST (12)
55
56#define DPSRAM0_SR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x30 ))
57
58#define DPSRAM0_SR_MODE_MSK (0xF)
59#define DPSRAM0_SR_MODE_OFST (0)
60#define DPSRAM0_SR_GLBL_MSK (0x30)
61#define DPSRAM0_SR_SIZE_MSK (0xFFFFF000)
62#define DPSRAM0_SR_SIZE_OFST (12)
63
64#define DPSRAM0_LCR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x34 ))
65#define DPSRAM0_LCR_LCKADDR_MSK (0x1FFE0)
66#define DPSRAM0_LCR_LCKADDR_OFST (4)
67
68#define DPSRAM1_SR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x38 ))
69#define DPSRAM1_SR_MODE_MSK (0xF)
70#define DPSRAM1_SR_MODE_OFST (0)
71#define DPSRAM1_SR_GLBL_MSK (0x30)
72#define DPSRAM1_SR_GLBL_OFST (4)
73#define DPSRAM1_SR_SIZE_MSK (0xFFFFF000)
74#define DPSRAM1_SR_SIZE_OFST (12)
75
76#define DPSRAM1_LCR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x3C ))
77#define DPSRAM1_LCR_LCKADDR_MSK (0x1FFE0)
78#define DPSRAM1_LCR_LCKADDR_OFST (4)
79
80#endif /* __MODE_CTRL00_H */
diff --git a/include/asm-arm/arch-epxa10db/param.h b/include/asm-arm/arch-epxa10db/param.h
new file mode 100644
index 000000000000..783dedd71c8f
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/param.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-epxa10db/param.h
3 *
4 * Copyright (C) 1999 ARM Limited
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 */
diff --git a/include/asm-arm/arch-epxa10db/platform.h b/include/asm-arm/arch-epxa10db/platform.h
new file mode 100644
index 000000000000..129bb0f212a0
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/platform.h
@@ -0,0 +1,7 @@
1#ifndef PLATFORM_H
2#define PLATFORM_H
3#include "excalibur.h"
4
5#define MAXIRQNUM 15
6#endif
7
diff --git a/include/asm-arm/arch-epxa10db/pld_conf00.h b/include/asm-arm/arch-epxa10db/pld_conf00.h
new file mode 100644
index 000000000000..7af2c38dacc6
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/pld_conf00.h
@@ -0,0 +1,73 @@
1#ifndef __PLD_CONF00_H
2#define __PLD_CONF00_H
3
4/*
5 * Register definitions for the PLD Configuration Logic
6 */
7
8/*
9 *
10 * This file contains the register definitions for the Excalibur
11 * Interrupt controller INT_CTRL00.
12 *
13 * Copyright (C) 2001 Altera Corporation
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 */
29
30#define CONFIG_CONTROL(BASE_ADDR) (PLD_CONF00_TYPE (BASE_ADDR))
31#define CONFIG_CONTROL_LK_MSK (0x1)
32#define CONFIG_CONTROL_LK_OFST (0)
33#define CONFIG_CONTROL_CO_MSK (0x2)
34#define CONFIG_CONTROL_CO_OFST (1)
35#define CONFIG_CONTROL_B_MSK (0x4)
36#define CONFIG_CONTROL_B_OFST (2)
37#define CONFIG_CONTROL_PC_MSK (0x8)
38#define CONFIG_CONTROL_PC_OFST (3)
39#define CONFIG_CONTROL_E_MSK (0x10)
40#define CONFIG_CONTROL_E_OFST (4)
41#define CONFIG_CONTROL_ES_MSK (0xE0)
42#define CONFIG_CONTROL_ES_OFST (5)
43#define CONFIG_CONTROL_ES_0_MSK (0x20)
44#define CONFIG_CONTROL_ES_1_MSK (0x40)
45#define CONFIG_CONTROL_ES_2_MSK (0x80)
46
47#define CONFIG_CONTROL_CLOCK(BASE_ADDR) (PLD_CONF00_TYPE (BASE_ADDR + 0x4 ))
48#define CONFIG_CONTROL_CLOCK_RATIO_MSK (0xFFFF)
49#define CONFIG_CONTROL_CLOCK_RATIO_OFST (0)
50
51#define CONFIG_CONTROL_DATA(BASE_ADDR) (PLD_CONF00_TYPE (BASE_ADDR + 0x8 ))
52#define CONFIG_CONTROL_DATA_MSK (0xFFFFFFFF)
53#define CONFIG_CONTROL_DATA_OFST (0)
54
55#define CONFIG_UNLOCK(BASE_ADDR) (PLD_CONF00_TYPE (BASE_ADDR + 0xC ))
56#define CONFIG_UNLOCK_MSK (0xFFFFFFFF)
57#define CONFIG_UNLOCK_OFST (0)
58
59#define CONFIG_UNLOCK_MAGIC (0x554E4C4B)
60
61#endif /* __PLD_CONF00_H */
62
63
64
65
66
67
68
69
70
71
72
73
diff --git a/include/asm-arm/arch-epxa10db/system.h b/include/asm-arm/arch-epxa10db/system.h
new file mode 100644
index 000000000000..345b092a1ed5
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/system.h
@@ -0,0 +1,41 @@
1/*
2 * linux/include/asm-arm/arch-epxa10db/system.h
3 *
4 * Copyright (C) 1999 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#ifndef __ASM_ARCH_SYSTEM_H
23#define __ASM_ARCH_SYSTEM_H
24
25#include <asm/arch/platform.h>
26
27static inline void arch_idle(void)
28{
29 /*
30 * This should do all the clock switching
31 * and wait for interrupt tricks
32 */
33 cpu_do_idle();
34}
35
36extern __inline__ void arch_reset(char mode)
37{
38 /* Hmm... We can probably do something with the watchdog... */
39}
40
41#endif
diff --git a/include/asm-arm/arch-epxa10db/tdkphy.h b/include/asm-arm/arch-epxa10db/tdkphy.h
new file mode 100644
index 000000000000..5e107bd4e109
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/tdkphy.h
@@ -0,0 +1,209 @@
1/*
2 * linux/drivers/tdkphy.h
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
21#ifndef __TDKPHY_H
22#define __TDKPHY_H
23
24/*
25 * Register definitions for the TDK 78Q2120 PHY
26 * which is on the Camelot board
27 */
28
29/*
30 * Copyright (c) Altera Corporation 2000.
31 * All rights reserved.
32 */
33#define PHY_CONTROL (0)
34#define PHY_CONTROL_COLT_MSK (0x80)
35#define PHY_CONTROL_COLT_OFST (7)
36#define PHY_CONTROL_DUPLEX_MSK (0x100)
37#define PHY_CONTROL_DUPLEX_OFST (8)
38#define PHY_CONTROL_RANEG_MSK (0x200)
39#define PHY_CONTROL_RANEG_OFST (9)
40#define PHY_CONTROL_ISO_MSK (0x400)
41#define PHY_CONTROL_ISO_OFST (10)
42#define PHY_CONTROL_PWRDN_MSK (0x800)
43#define PHY_CONTROL_PWRDN_OFST (11)
44#define PHY_CONTROL_ANEGEN_MSK (0x1000)
45#define PHY_CONTROL_ANEGEN_OFST (12)
46#define PHY_CONTROL_SPEEDSL_MSK (0x2000)
47#define PHY_CONTROL_SPEEDSL_OFST (13)
48#define PHY_CONTROL_LOOPBK_MSK (0x4000)
49#define PHY_CONTROL_LOOPBK_OFST (14)
50#define PHY_CONTROL_RESET_MSK (0x8000)
51#define PHY_CONTROL_RESET_OFST (15)
52
53#define PHY_STATUS (1)
54#define PHY_STATUS_ETXD_MSK (0x1)
55#define PHY_STATUS_EXTD_OFST (0)
56#define PHY_STATUS_JAB_MSK (0x2)
57#define PHY_STATUS_JAB_OFST (1)
58#define PHY_STATUS_LINK_MSK (0x4)
59#define PHY_STATUS_LINK_OFST (2)
60#define PHY_STATUS_ANEGA_MSK (0x8)
61#define PHY_STATUS_ANEGA_OFST (3)
62#define PHY_STATUS_RFAULT_MSK (0x10)
63#define PHY_STATUS_RFAULT_OFST (4)
64#define PHY_STATUS_ANEGC_MSK (0x20)
65#define PHY_STATUS_ANEGC_OFST (5)
66#define PHY_STATUS_10T_H_MSK (0x800)
67#define PHY_STATUS_10T_H_OFST (11)
68#define PHY_STATUS_10T_F_MSK (0x1000)
69#define PHY_STATUS_10T_F_OFST (12)
70#define PHY_STATUS_100_X_H_MSK (0x2000)
71#define PHY_STATUS_100_X_H_OFST (13)
72#define PHY_STATUS_100_X_F_MSK (0x4000)
73#define PHY_STATUS_100_X_F_OFST (14)
74#define PHY_STATUS_100T4_MSK (0x8000)
75#define PHY_STATUS_100T4_OFST (15)
76
77#define PHY_ID1 (2)
78#define PHY_ID1_OUI_MSK (0xFFFF)
79#define PHY_ID1_OUI_OFST (0)
80
81#define PHY_ID2 (3)
82#define PHY_ID2_RN_MSK (0xF)
83#define PHY_ID2_RN_OFST (0)
84#define PHY_ID2_MN_MSK (0x3F0)
85#define PHY_ID2_MN_OFST (4)
86#define PHY_ID2_OUI_MSK (0xFC00)
87#define PHY_ID2_OUI_OFST (10)
88
89#define PHY_AUTO_NEG_ADVERTISEMENT (4)
90#define PHY_AUTO_NEG_ADVERTISEMENT_SELECTOR_MSK (0x1F)
91#define PHY_AUTO_NEG_ADVERTISEMENT_SELECTOR_OFST (0)
92#define PHY_AUTO_NEG_ADVERTISEMENT_A0_MSK (0x20)
93#define PHY_AUTO_NEG_ADVERTISEMENT_A0_OFST (5)
94#define PHY_AUTO_NEG_ADVERTISEMENT_A1_MSK (0x40)
95#define PHY_AUTO_NEG_ADVERTISEMENT_A1_OFST (6)
96#define PHY_AUTO_NEG_ADVERTISEMENT_A2_MSK (0x80)
97#define PHY_AUTO_NEG_ADVERTISEMENT_A2_OFST (7)
98#define PHY_AUTO_NEG_ADVERTISEMENT_A3_MSK (0x100)
99#define PHY_AUTO_NEG_ADVERTISEMENT_A3_OFST (8)
100#define PHY_AUTO_NEG_ADVERTISEMENT_A4_MSK (0x200)
101#define PHY_AUTO_NEG_ADVERTISEMENT_A4_OFST (9)
102#define PHY_AUTO_NEG_ADVERTISEMENT_TAF_MSK (0x1FE0)
103#define PHY_AUTO_NEG_ADVERTISEMENT_TAF_OFST (5)
104#define PHY_AUTO_NEG_ADVERTISEMENT_RF_MSK (0x2000)
105#define PHY_AUTO_NEG_ADVERTISEMENT_RF_OFST (13)
106#define PHY_AUTO_NEG_ADVERTISEMENT_RSVD_MSK (0x4000)
107#define PHY_AUTO_NEG_ADVERTISEMENT_RVSD_OFST (14)
108#define PHY_AUTO_NEG_ADVERTISEMENT_NP_MSK (0x8000)
109#define PHY_AUTO_NEG_ADVERTISEMENT_NP_OFST (15)
110
111#define PHY_AUTO_NEG_LINK_PARTNER (5)
112#define PHY_AUTO_NEG_LINK_PARTNER_S4_MSK (0x1F)
113#define PHY_AUTO_NEG_LINK_PARTNER_S4_OFST (0)
114#define PHY_AUTO_NEG_LINK_PARTNER_A7_MSK (0x1FE0)
115#define PHY_AUTO_NEG_LINK_PARTNER_A7_OFST (5)
116#define PHY_AUTO_NEG_LINK_PARTNER_RF_MSK (0x2000)
117#define PHY_AUTO_NEG_LINK_PARTNER_RF_OFST (13)
118#define PHY_AUTO_NEG_LINK_PARTNER_ACK_MSK (0x4000)
119#define PHY_AUTO_NEG_LINK_PARTNER_ACK_OFST (14)
120#define PHY_AUTO_NEG_LINK_PARTNER_NP_MSK (0x8000)
121#define PHY_AUTO_NEG_LINK_PARTNER_NP_OFST (15)
122
123#define PHY_AUTO_NEG_EXPANSION (6)
124#define PHY_AUTO_NEG_EXPANSION_LPANEGA_MSK (0x1)
125#define PHY_AUTO_NEG_EXPANSION_LPANEGA_OFST (0)
126#define PHY_AUTO_NEG_EXPANSION_PRX_MSK (0x2)
127#define PHY_AUTO_NEG_EXPANSION_PRX_OFST (1)
128#define PHY_AUTO_NEG_EXPANSION_NPA_MSK (0x4)
129#define PHY_AUTO_NEG_EXPANSION_NPA_OFST (2)
130#define PHY_AUTO_NEG_EXPANSION_LPNPA_MSK (0x8)
131#define PHY_AUTO_NEG_EXPANSION_LPNPA_OFST (3)
132#define PHY_AUTO_NEG_EXPANSION_PDF_MSK (0x10)
133#define PHY_AUTO_NEG_EXPANSION_PDF_OFST (4)
134
135#define PHY_VENDOR_SPECIFIC (16)
136#define PHY_VENDOR_SPECIFIC_RXCC_MSK (0x1)
137#define PHY_VENDOR_SPECIFIC_RXCC_OFST (0)
138#define PHY_VENDOR_SPECIFIC_PCSBP_MSK (0x2)
139#define PHY_VENDOR_SPECIFIC_PCSBP_OFST (1)
140#define PHY_VENDOR_SPECIFIC_RVSPOL_MSK (0x10)
141#define PHY_VENDOR_SPECIFIC_RVSPOL_OFST (4)
142#define PHY_VENDOR_SPECIFIC_APOL_MSK (0x20)
143#define PHY_VENDOR_SPECIFIC_APOL_OFST (5)
144#define PHY_VENDOR_SPECIFIC_GPIO0_DIR_MSK (0x40)
145#define PHY_VENDOR_SPECIFIC_GPIO0_DIR_OFST (6)
146#define PHY_VENDOR_SPECIFIC_GPIO0_DAT_MSK (0x80)
147#define PHY_VENDOR_SPECIFIC_GPIO0_DAT_OFST (7)
148#define PHY_VENDOR_SPECIFIC_GPIO1_DIR_MSK (0x100)
149#define PHY_VENDOR_SPECIFIC_GPIO1_DIR_OFST (8)
150#define PHY_VENDOR_SPECIFIC_GPIO1_DAT_MSK (0x200)
151#define PHY_VENDOR_SPECIFIC_GPIO1_DAT_OFST (9)
152#define PHY_VENDOR_SPECIFIC_10BT_NATURAL_LOOPBACK_DAT_MSK (0x400)
153#define PHY_VENDOR_SPECIFIC_10BT_NATURAL_LOOPBACK_DAT_OFST (10)
154#define PHY_VENDOR_SPECIFIC_10BT_SQE_TEST_INHIBIT_MSK (0x800)
155#define PHY_VENDOR_SPECIFIC_10BT_SQE_TEST_INHIBIT_OFST (11)
156#define PHY_VENDOR_SPECIFIC_TXHIM_MSK (0x1000)
157#define PHY_VENDOR_SPECIFIC_TXHIM_OFST (12)
158#define PHY_VENDOR_SPECIFIC_INT_LEVEL_MSK (0x4000)
159#define PHY_VENDOR_SPECIFIC_INT_LEVEL_OFST (14)
160#define PHY_VENDOR_SPECIFIC_RPTR_MSK (0x8000)
161#define PHY_VENDOR_SPECIFIC_RPTR_OFST (15)
162
163#define PHY_IRQ_CONTROL (17)
164#define PHY_IRQ_CONTROL_ANEG_COMP_INT_MSK (0x1)
165#define PHY_IRQ_CONTROL_ANEG_COMP_INT_OFST (0)
166#define PHY_IRQ_CONTROL_RFAULT_INT_MSK (0x2)
167#define PHY_IRQ_CONTROL_RFAULT_INT_OFST (1)
168#define PHY_IRQ_CONTROL_LS_CHG_INT_MSK (0x4)
169#define PHY_IRQ_CONTROL_LS_CHG_INT_OFST (2)
170#define PHY_IRQ_CONTROL_LP_ACK_INT_MSK (0x8)
171#define PHY_IRQ_CONTROL_LP_ACK_INT_OFST (3)
172#define PHY_IRQ_CONTROL_PDF_INT_MSK (0x10)
173#define PHY_IRQ_CONTROL_PDF_INT_OFST (4)
174#define PHY_IRQ_CONTROL_PRX_INT_MSK (0x20)
175#define PHY_IRQ_CONTROL_PRX_INT_OFST (5)
176#define PHY_IRQ_CONTROL_RXER_INT_MSK (0x40)
177#define PHY_IRQ_CONTROL_RXER_INT_OFST (6)
178#define PHY_IRQ_CONTROL_JABBER_INT_MSK (0x80)
179#define PHY_IRQ_CONTROL_JABBER_INT_OFST (7)
180#define PHY_IRQ_CONTROL_ANEG_COMP_IE_MSK (0x100)
181#define PHY_IRQ_CONTROL_ANEG_COMP_IE_OFST (8)
182#define PHY_IRQ_CONTROL_RFAULT_IE_MSK (0x200)
183#define PHY_IRQ_CONTROL_RFAULT_IE_OFST (9)
184#define PHY_IRQ_CONTROL_LS_CHG_IE_MSK (0x400)
185#define PHY_IRQ_CONTROL_LS_CHG_IE_OFST (10)
186#define PHY_IRQ_CONTROL_LP_ACK_IE_MSK (0x800)
187#define PHY_IRQ_CONTROL_LP_ACK_IE_OFST (11)
188#define PHY_IRQ_CONTROL_PDF_IE_MSK (0x1000)
189#define PHY_IRQ_CONTROL_PDF_IE_OFST (12)
190#define PHY_IRQ_CONTROL_PRX_IE_MSK (0x2000)
191#define PHY_IRQ_CONTROL_PRX_IE_OFST (13)
192#define PHY_IRQ_CONTROL_RXER_IE_MSK (0x4000)
193#define PHY_IRQ_CONTROL_RXER_IE_OFST (14)
194#define PHY_IRQ_CONTROL_JABBER_IE_MSK (0x8000)
195#define PHY_IRQ_CONTROL_JABBER_IE_OFST (15)
196
197#define PHY_DIAGNOSTIC (18)
198#define PHY_DIAGNOSTIC_RX_LOCK_MSK (0x100)
199#define PHY_DIAGNOSTIC_RX_LOCK_OFST (8)
200#define PHY_DIAGNOSTIC_RX_PASS_MSK (0x200)
201#define PHY_DIAGNOSTIC_RX_PASS_OFST (9)
202#define PHY_DIAGNOSTIC_RATE_MSK (0x400)
203#define PHY_DIAGNOSTIC_RATE_OFST (10)
204#define PHY_DIAGNOSTIC_DPLX_MSK (0x800)
205#define PHY_DIAGNOSTIC_DPLX_OFST (11)
206#define PHY_DIAGNOSTIC_ANEGF_MSK (0x1000)
207#define PHY_DIAGNOSTIC_ANEGF_OFST (12)
208
209#endif /* __TDKPHY_H */
diff --git a/include/asm-arm/arch-epxa10db/timer00.h b/include/asm-arm/arch-epxa10db/timer00.h
new file mode 100644
index 000000000000..52a3fb58b59d
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/timer00.h
@@ -0,0 +1,98 @@
1/*
2 *
3 * This file contains the register definitions for the Excalibur
4 * Timer TIMER00.
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#ifndef __TIMER00_H
23#define __TIMER00_H
24
25/*
26 * Register definitions for the timers
27 */
28
29
30#define TIMER0_CR(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x00 ))
31#define TIMER0_CR_B_MSK (0x20)
32#define TIMER0_CR_B_OFST (0x5)
33#define TIMER0_CR_S_MSK (0x10)
34#define TIMER0_CR_S_OFST (0x4)
35#define TIMER0_CR_CI_MSK (0x08)
36#define TIMER0_CR_CI_OFST (0x3)
37#define TIMER0_CR_IE_MSK (0x04)
38#define TIMER0_CR_IE_OFST (0x2)
39#define TIMER0_CR_MODE_MSK (0x3)
40#define TIMER0_CR_MODE_OFST (0)
41#define TIMER0_CR_MODE_FREE (0)
42#define TIMER0_CR_MODE_ONE (1)
43#define TIMER0_CR_MODE_INTVL (2)
44
45#define TIMER0_SR(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x00 ))
46#define TIMER0_SR_B_MSK (0x20)
47#define TIMER0_SR_B_OFST (0x5)
48#define TIMER0_SR_S_MSK (0x10)
49#define TIMER0_SR_S_OFST (0x4)
50#define TIMER0_SR_CI_MSK (0x08)
51#define TIMER0_SR_CI_OFST (0x3)
52#define TIMER0_SR_IE_MSK (0x04)
53#define TIMER0_SR_IE_OFST (0x2)
54#define TIMER0_SR_MODE_MSK (0x3)
55#define TIMER0_SR_MODE_OFST (0)
56#define TIMER0_SR_MODE_FREE (0)
57#define TIMER0_SR_MODE_ONE (1)
58#define TIMER0_SR_MODE_INTVL (2)
59
60#define TIMER0_PRESCALE(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x010 ))
61#define TIMER0_LIMIT(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x020 ))
62#define TIMER0_READ(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x030 ))
63
64#define TIMER1_CR(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x40 ))
65#define TIMER1_CR_B_MSK (0x20)
66#define TIMER1_CR_B_OFST (0x5)
67#define TIMER1_CR_S_MSK (0x10)
68#define TIMER1_CR_S_OFST (0x4)
69#define TIMER1_CR_CI_MSK (0x08)
70#define TIMER1_CR_CI_OFST (0x3)
71#define TIMER1_CR_IE_MSK (0x04)
72#define TIMER1_CR_IE_OFST (0x2)
73#define TIMER1_CR_MODE_MSK (0x3)
74#define TIMER1_CR_MODE_OFST (0)
75#define TIMER1_CR_MODE_FREE (0)
76#define TIMER1_CR_MODE_ONE (1)
77#define TIMER1_CR_MODE_INTVL (2)
78
79#define TIMER1_SR(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x40 ))
80#define TIMER1_SR_B_MSK (0x20)
81#define TIMER1_SR_B_OFST (0x5)
82#define TIMER1_SR_S_MSK (0x10)
83#define TIMER1_SR_S_OFST (0x4)
84#define TIMER1_SR_CI_MSK (0x08)
85#define TIMER1_SR_CI_OFST (0x3)
86#define TIMER1_SR_IE_MSK (0x04)
87#define TIMER1_SR_IE_OFST (0x2)
88#define TIMER1_SR_MODE_MSK (0x3)
89#define TIMER1_SR_MODE_OFST (0)
90#define TIMER1_SR_MODE_FREE (0)
91#define TIMER1_SR_MODE_ONE (1)
92#define TIMER1_SR_MODE_INTVL (2)
93
94#define TIMER1_PRESCALE(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x050 ))
95#define TIMER1_LIMIT(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x060 ))
96#define TIMER1_READ(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x070 ))
97
98#endif /* __TIMER00_H */
diff --git a/include/asm-arm/arch-epxa10db/timex.h b/include/asm-arm/arch-epxa10db/timex.h
new file mode 100644
index 000000000000..b87a75fc9589
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/timex.h
@@ -0,0 +1,26 @@
1/*
2 * linux/include/asm-arm/arch-epxa10db/timex.h
3 *
4 * Excalibur timex specifications
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
23/*
24 * ??
25 */
26#define CLOCK_TICK_RATE (50000000 / 16)
diff --git a/include/asm-arm/arch-epxa10db/uart00.h b/include/asm-arm/arch-epxa10db/uart00.h
new file mode 100644
index 000000000000..5abd8914d68b
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/uart00.h
@@ -0,0 +1,181 @@
1/* *
2 * Copyright (C) 2001 Altera Corporation
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#ifndef __UART00_H
19#define __UART00_H
20
21/*
22 * Register definitions for the UART
23 */
24
25#define UART_TX_FIFO_SIZE (15)
26
27#define UART_RSR(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x00 ))
28#define UART_RSR_RX_LEVEL_MSK (0x1f)
29#define UART_RSR_RX_LEVEL_OFST (0)
30#define UART_RSR_RE_MSK (0x80)
31#define UART_RSR_RE_OFST (7)
32
33#define UART_RDS(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x04 ))
34#define UART_RDS_BI_MSK (0x8)
35#define UART_RDS_BI_OFST (4)
36#define UART_RDS_FE_MSK (0x4)
37#define UART_RDS_FE_OFST (2)
38#define UART_RDS_PE_MSK (0x2)
39#define UART_RDS_PE_OFST (1)
40#define UART_RDS_OE_MSK (0x1)
41#define UART_RDS_OE_OFST (0)
42
43#define UART_RD(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x08 ))
44#define UART_RD_RX_DATA_MSK (0xff)
45#define UART_RD_RX_DATA_OFST (0)
46
47#define UART_TSR(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x0c ))
48#define UART_TSR_TX_LEVEL_MSK (0x1f)
49#define UART_TSR_TX_LEVEL_OFST (0)
50#define UART_TSR_TXI_MSK (0x80)
51#define UART_TSR_TXI_OFST (7)
52
53#define UART_TD(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x10 ))
54#define UART_TD_TX_DATA_MSK (0xff)
55#define UART_TD_TX_DATA_OFST (0)
56
57#define UART_FCR(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x14 ))
58#define UART_FCR_RX_THR_MSK (0xd0)
59#define UART_FCR_RX_THR_OFST (5)
60#define UART_FCR_RX_THR_1 (0x00)
61#define UART_FCR_RX_THR_2 (0x20)
62#define UART_FCR_RX_THR_4 (0x40)
63#define UART_FCR_RX_THR_6 (0x60)
64#define UART_FCR_RX_THR_8 (0x80)
65#define UART_FCR_RX_THR_10 (0xa0)
66#define UART_FCR_RX_THR_12 (0xc0)
67#define UART_FCR_RX_THR_14 (0xd0)
68#define UART_FCR_TX_THR_MSK (0x1c)
69#define UART_FCR_TX_THR_OFST (2)
70#define UART_FCR_TX_THR_0 (0x00)
71#define UART_FCR_TX_THR_2 (0x04)
72#define UART_FCR_TX_THR_4 (0x08)
73#define UART_FCR_TX_THR_8 (0x0c)
74#define UART_FCR_TX_THR_10 (0x10)
75#define UART_FCR_TX_THR_12 (0x14)
76#define UART_FCR_TX_THR_14 (0x18)
77#define UART_FCR_TX_THR_15 (0x1c)
78#define UART_FCR_RC_MSK (0x02)
79#define UART_FCR_RC_OFST (1)
80#define UART_FCR_TC_MSK (0x01)
81#define UART_FCR_TC_OFST (0)
82
83#define UART_IES(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x18 ))
84#define UART_IES_ME_MSK (0x8)
85#define UART_IES_ME_OFST (3)
86#define UART_IES_TIE_MSK (0x4)
87#define UART_IES_TIE_OFST (2)
88#define UART_IES_TE_MSK (0x2)
89#define UART_IES_TE_OFST (1)
90#define UART_IES_RE_MSK (0x1)
91#define UART_IES_RE_OFST (0)
92
93#define UART_IEC(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x1c ))
94#define UART_IEC_ME_MSK (0x8)
95#define UART_IEC_ME_OFST (3)
96#define UART_IEC_TIE_MSK (0x4)
97#define UART_IEC_TIE_OFST (2)
98#define UART_IEC_TE_MSK (0x2)
99#define UART_IEC_TE_OFST (1)
100#define UART_IEC_RE_MSK (0x1)
101#define UART_IEC_RE_OFST (0)
102
103#define UART_ISR(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x20 ))
104#define UART_ISR_MI_MSK (0x8)
105#define UART_ISR_MI_OFST (3)
106#define UART_ISR_TII_MSK (0x4)
107#define UART_ISR_TII_OFST (2)
108#define UART_ISR_TI_MSK (0x2)
109#define UART_ISR_TI_OFST (1)
110#define UART_ISR_RI_MSK (0x1)
111#define UART_ISR_RI_OFST (0)
112
113#define UART_IID(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x24 ))
114#define UART_IID_IID_MSK (0x7)
115#define UART_IID_IID_OFST (0)
116
117#define UART_MC(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x28 ))
118#define UART_MC_OE_MSK (0x40)
119#define UART_MC_OE_OFST (6)
120#define UART_MC_SP_MSK (0x20)
121#define UART_MC_SP_OFST (5)
122#define UART_MC_EP_MSK (0x10)
123#define UART_MC_EP_OFST (4)
124#define UART_MC_PE_MSK (0x08)
125#define UART_MC_PE_OFST (3)
126#define UART_MC_ST_MSK (0x04)
127#define UART_MC_ST_ONE (0x0)
128#define UART_MC_ST_TWO (0x04)
129#define UART_MC_ST_OFST (2)
130#define UART_MC_CLS_MSK (0x03)
131#define UART_MC_CLS_OFST (0)
132#define UART_MC_CLS_CHARLEN_5 (0)
133#define UART_MC_CLS_CHARLEN_6 (1)
134#define UART_MC_CLS_CHARLEN_7 (2)
135#define UART_MC_CLS_CHARLEN_8 (3)
136
137#define UART_MCR(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x2c ))
138#define UART_MCR_AC_MSK (0x80)
139#define UART_MCR_AC_OFST (7)
140#define UART_MCR_AR_MSK (0x40)
141#define UART_MCR_AR_OFST (6)
142#define UART_MCR_BR_MSK (0x20)
143#define UART_MCR_BR_OFST (5)
144#define UART_MCR_LB_MSK (0x10)
145#define UART_MCR_LB_OFST (4)
146#define UART_MCR_DCD_MSK (0x08)
147#define UART_MCR_DCD_OFST (3)
148#define UART_MCR_RI_MSK (0x04)
149#define UART_MCR_RI_OFST (2)
150#define UART_MCR_DTR_MSK (0x02)
151#define UART_MCR_DTR_OFST (1)
152#define UART_MCR_RTS_MSK (0x01)
153#define UART_MCR_RTS_OFST (0)
154
155#define UART_MSR(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x30 ))
156#define UART_MSR_DCD_MSK (0x80)
157#define UART_MSR_DCD_OFST (7)
158#define UART_MSR_RI_MSK (0x40)
159#define UART_MSR_RI_OFST (6)
160#define UART_MSR_DSR_MSK (0x20)
161#define UART_MSR_DSR_OFST (5)
162#define UART_MSR_CTS_MSK (0x10)
163#define UART_MSR_CTS_OFST (4)
164#define UART_MSR_DDCD_MSK (0x08)
165#define UART_MSR_DDCD_OFST (3)
166#define UART_MSR_TERI_MSK (0x04)
167#define UART_MSR_TERI_OFST (2)
168#define UART_MSR_DDSR_MSK (0x02)
169#define UART_MSR_DDSR_OFST (1)
170#define UART_MSR_DCTS_MSK (0x01)
171#define UART_MSR_DCTS_OFST (0)
172
173#define UART_DIV_LO(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x34 ))
174#define UART_DIV_LO_DIV_MSK (0xff)
175#define UART_DIV_LO_DIV_OFST (0)
176
177#define UART_DIV_HI(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x38 ))
178#define UART_DIV_HI_DIV_MSK (0xff)
179#define UART_DIV_HI_DIV_OFST (0)
180
181#endif /* __UART00_H */
diff --git a/include/asm-arm/arch-epxa10db/uncompress.h b/include/asm-arm/arch-epxa10db/uncompress.h
new file mode 100644
index 000000000000..d33ad6a93749
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/uncompress.h
@@ -0,0 +1,54 @@
1/*
2 * linux/include/asm-arm/arch-epxa10db/uncompress.h
3 *
4 * Copyright (C) 1999 ARM Limited
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 "asm/arch/platform.h"
22#include "asm/arch/hardware.h"
23#define UART00_TYPE (volatile unsigned int*)
24#include "asm/arch/uart00.h"
25
26/*
27 * This does not append a newline
28 */
29static void putstr(const char *s)
30{
31 while (*s) {
32 while ((*UART_TSR(EXC_UART00_BASE) &
33 UART_TSR_TX_LEVEL_MSK)==15)
34 barrier();
35
36 *UART_TD(EXC_UART00_BASE) = *s;
37
38 if (*s == '\n') {
39 while ((*UART_TSR(EXC_UART00_BASE) &
40 UART_TSR_TX_LEVEL_MSK)==15)
41 barrier();
42
43 *UART_TD(EXC_UART00_BASE) = '\r';
44 }
45 s++;
46 }
47}
48
49/*
50 * nothing to do
51 */
52#define arch_decomp_setup()
53
54#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-epxa10db/vmalloc.h b/include/asm-arm/arch-epxa10db/vmalloc.h
new file mode 100644
index 000000000000..d31ef8584760
--- /dev/null
+++ b/include/asm-arm/arch-epxa10db/vmalloc.h
@@ -0,0 +1,31 @@
1/*
2 * linux/include/asm-arm/arch-epxa10db/vmalloc.h
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 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/*
22 * Just any arbitrary offset to the start of the vmalloc VM area: the
23 * current 8MB value just means that there will be a 8MB "hole" after the
24 * physical memory until the kernel virtual memory starts. That means that
25 * any out-of-bounds memory accesses will hopefully be caught.
26 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
27 * area for the same reason. ;)
28 */
29#define VMALLOC_OFFSET (8*1024*1024)
30#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
31#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-h720x/boards.h b/include/asm-arm/arch-h720x/boards.h
new file mode 100644
index 000000000000..8021f81f0742
--- /dev/null
+++ b/include/asm-arm/arch-h720x/boards.h
@@ -0,0 +1,53 @@
1/*
2 * linux/include/asm-arm/arch-h720x/boards.h
3 *
4 * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de>
5 * (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>
6 *
7 * This file contains the board specific defines for various devices
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#ifndef __ASM_ARCH_HARDWARE_INCMACH_H
15#error Do not include this file directly. Include asm/hardware.h instead !
16#endif
17
18/* Hynix H7202 developer board specific device defines */
19#ifdef CONFIG_ARCH_H7202
20
21/* FLASH */
22#define FLASH_VIRT 0xd0000000
23#define FLASH_PHYS 0x00000000
24#define FLASH_SIZE 0x02000000
25
26/* onboard LAN controller */
27# define ETH0_PHYS 0x08000000
28
29/* Touch screen defines */
30/* GPIO Port */
31#define PEN_GPIO GPIO_B_VIRT
32/* Bitmask for pen down interrupt */
33#define PEN_INT_BIT (1<<7)
34/* Bitmask for pen up interrupt */
35#define PEN_ENA_BIT (1<<6)
36/* pen up interrupt */
37#define IRQ_PEN IRQ_MUX_GPIOB(7)
38
39#endif
40
41/* Hynix H7201 developer board specific device defines */
42#if defined (CONFIG_ARCH_H7201)
43/* ROM DISK SPACE */
44#define ROM_DISK_BASE 0xc1800000
45#define ROM_DISK_START 0x41800000
46#define ROM_DISK_SIZE 0x00700000
47
48/* SRAM DISK SPACE */
49#define SRAM_DISK_BASE 0xf1000000
50#define SRAM_DISK_START 0x04000000
51#define SRAM_DISK_SIZE 0x00400000
52#endif
53
diff --git a/include/asm-arm/arch-h720x/debug-macro.S b/include/asm-arm/arch-h720x/debug-macro.S
new file mode 100644
index 000000000000..82822d362733
--- /dev/null
+++ b/include/asm-arm/arch-h720x/debug-macro.S
@@ -0,0 +1,40 @@
1/* linux/include/asm-arm/arch-h720x/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .equ io_virt, IO_BASE
15 .equ io_phys, IO_START
16
17 .macro addruart,rx
18 mrc p15, 0, \rx, c1, c0
19 tst \rx, #1 @ MMU enabled?
20 moveq \rx, #io_phys @ physical base address
21 movne \rx, #io_virt @ virtual address
22 add \rx, \rx, #0x00020000 @ UART1
23 .endm
24
25 .macro senduart,rd,rx
26 str \rd, [\rx, #0x0] @ UARTDR
27
28 .endm
29
30 .macro waituart,rd,rx
311001: ldr \rd, [\rx, #0x18] @ UARTFLG
32 tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full
33 bne 1001b
34 .endm
35
36 .macro busyuart,rd,rx
371001: ldr \rd, [\rx, #0x18] @ UARTFLG
38 tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy
39 bne 1001b
40 .endm
diff --git a/include/asm-arm/arch-h720x/dma.h b/include/asm-arm/arch-h720x/dma.h
new file mode 100644
index 000000000000..bfc6636679f7
--- /dev/null
+++ b/include/asm-arm/arch-h720x/dma.h
@@ -0,0 +1,26 @@
1/*
2 * linux/include/asm-arm/arch-h720x/dma.h
3 *
4 * Architecture DMA routes
5 *
6 * Copyright (C) 1997.1998 Russell King
7 */
8#ifndef __ASM_ARCH_DMA_H
9#define __ASM_ARCH_DMA_H
10
11/*
12 * This is the maximum DMA address that can be DMAd to.
13 * There should not be more than (0xd0000000 - 0xc0000000)
14 * bytes of RAM.
15 */
16#define MAX_DMA_ADDRESS 0xd0000000
17
18#if defined (CONFIG_CPU_H7201)
19#define MAX_DMA_CHANNELS 3
20#elif defined (CONFIG_CPU_H7202)
21#define MAX_DMA_CHANNELS 4
22#else
23#error processor definition missmatch
24#endif
25
26#endif /* __ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-h720x/entry-macro.S b/include/asm-arm/arch-h720x/entry-macro.S
new file mode 100644
index 000000000000..8f165648e2af
--- /dev/null
+++ b/include/asm-arm/arch-h720x/entry-macro.S
@@ -0,0 +1,60 @@
1/*
2 * include/asm-arm/arch-h720x/entry-macro.S
3 *
4 * Low-level IRQ helper macros for Hynix HMS720x based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11 .macro disable_fiq
12 .endm
13
14 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
15#if defined (CONFIG_CPU_H7201) || defined (CONFIG_CPU_H7202)
16 @ we could use the id register on H7202, but this is not
17 @ properly updated when we come back from asm_do_irq
18 @ without a previous return from interrupt
19 @ (see loops below in irq_svc, irq_usr)
20 @ We see unmasked pending ints only, as the masked pending ints
21 @ are not visible here
22
23 mov \base, #0xf0000000 @ base register
24 orr \base, \base, #0x24000 @ irqbase
25 ldr \irqstat, [\base, #0x04] @ get interrupt status
26#if defined (CONFIG_CPU_H7201)
27 ldr \tmp, =0x001fffff
28#else
29 mvn \tmp, #0xc0000000
30#endif
31 and \irqstat, \irqstat, \tmp @ mask out unused ints
32 mov \irqnr, #0
33
34 mov \tmp, #0xff00
35 orr \tmp, \tmp, #0xff
36 tst \irqstat, \tmp
37 addeq \irqnr, \irqnr, #16
38 moveq \irqstat, \irqstat, lsr #16
39 tst \irqstat, #255
40 addeq \irqnr, \irqnr, #8
41 moveq \irqstat, \irqstat, lsr #8
42 tst \irqstat, #15
43 addeq \irqnr, \irqnr, #4
44 moveq \irqstat, \irqstat, lsr #4
45 tst \irqstat, #3
46 addeq \irqnr, \irqnr, #2
47 moveq \irqstat, \irqstat, lsr #2
48 tst \irqstat, #1
49 addeq \irqnr, \irqnr, #1
50 moveq \irqstat, \irqstat, lsr #1
51 tst \irqstat, #1 @ bit 0 should be set
52 .endm
53
54 .macro irq_prio_table
55 .endm
56
57#else
58#error hynix processor selection missmatch
59#endif
60
diff --git a/include/asm-arm/arch-h720x/h7201-regs.h b/include/asm-arm/arch-h720x/h7201-regs.h
new file mode 100644
index 000000000000..49d4f6bd3080
--- /dev/null
+++ b/include/asm-arm/arch-h720x/h7201-regs.h
@@ -0,0 +1,67 @@
1/*
2 * linux/include/asm-arm/arch-h720x/h7201-regs.h
3 *
4 * Copyright (C) 2000 Jungjun Kim, Hynix Semiconductor Inc.
5 * (C) 2003 Thomas Gleixner <tglx@linutronix.de>
6 * (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>
7 * (C) 2004 Sascha Hauer <s.hauer@pengutronix.de>
8 *
9 * This file contains the hardware definitions of the h720x processors
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 * Do not add implementations specific defines here. This files contains
16 * only defines of the onchip peripherals. Add those defines to boards.h,
17 * which is included by this file.
18 */
19
20#define SERIAL2_VIRT (IO_VIRT + 0x50100)
21#define SERIAL3_VIRT (IO_VIRT + 0x50200)
22
23/*
24 * PCMCIA
25 */
26#define PCMCIA0_ATT_BASE 0xe5000000
27#define PCMCIA0_ATT_SIZE 0x00200000
28#define PCMCIA0_ATT_START 0x20000000
29#define PCMCIA0_MEM_BASE 0xe5200000
30#define PCMCIA0_MEM_SIZE 0x00200000
31#define PCMCIA0_MEM_START 0x24000000
32#define PCMCIA0_IO_BASE 0xe5400000
33#define PCMCIA0_IO_SIZE 0x00200000
34#define PCMCIA0_IO_START 0x28000000
35
36#define PCMCIA1_ATT_BASE 0xe5600000
37#define PCMCIA1_ATT_SIZE 0x00200000
38#define PCMCIA1_ATT_START 0x30000000
39#define PCMCIA1_MEM_BASE 0xe5800000
40#define PCMCIA1_MEM_SIZE 0x00200000
41#define PCMCIA1_MEM_START 0x34000000
42#define PCMCIA1_IO_BASE 0xe5a00000
43#define PCMCIA1_IO_SIZE 0x00200000
44#define PCMCIA1_IO_START 0x38000000
45
46#define PRIME3C_BASE 0xf0050000
47#define PRIME3C_SIZE 0x00001000
48#define PRIME3C_START 0x10000000
49
50/* VGA Controller */
51#define VGA_RAMBASE 0x50
52#define VGA_TIMING0 0x60
53#define VGA_TIMING1 0x64
54#define VGA_TIMING2 0x68
55#define VGA_TIMING3 0x6c
56
57#define LCD_CTRL_VGA_ENABLE 0x00000100
58#define LCD_CTRL_VGA_BPP_MASK 0x00000600
59#define LCD_CTRL_VGA_4BPP 0x00000000
60#define LCD_CTRL_VGA_8BPP 0x00000200
61#define LCD_CTRL_VGA_16BPP 0x00000300
62#define LCD_CTRL_SHARE_DMA 0x00000800
63#define LCD_CTRL_VDE 0x00100000
64#define LCD_CTRL_LPE 0x00400000 /* LCD Power enable */
65#define LCD_CTRL_BLE 0x00800000 /* LCD backlight enable */
66
67#define VGA_PALETTE_BASE (IO_VIRT + 0x10800)
diff --git a/include/asm-arm/arch-h720x/h7202-regs.h b/include/asm-arm/arch-h720x/h7202-regs.h
new file mode 100644
index 000000000000..43d8ba8a6013
--- /dev/null
+++ b/include/asm-arm/arch-h720x/h7202-regs.h
@@ -0,0 +1,155 @@
1/*
2 * linux/include/asm-arm/arch-h720x/h7202-regs.h
3 *
4 * Copyright (C) 2000 Jungjun Kim, Hynix Semiconductor Inc.
5 * (C) 2003 Thomas Gleixner <tglx@linutronix.de>
6 * (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>
7 * (C) 2004 Sascha Hauer <s.hauer@pengutronix.de>
8 *
9 * This file contains the hardware definitions of the h720x processors
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 * Do not add implementations specific defines here. This files contains
16 * only defines of the onchip peripherals. Add those defines to boards.h,
17 * which is included by this file.
18 */
19
20#define SERIAL2_OFS 0x2d000
21#define SERIAL2_BASE (IO_PHYS + SERIAL2_OFS)
22#define SERIAL2_VIRT (IO_VIRT + SERIAL2_OFS)
23#define SERIAL3_OFS 0x2e000
24#define SERIAL3_BASE (IO_PHYS + SERIAL3_OFS)
25#define SERIAL3_VIRT (IO_VIRT + SERIAL3_OFS)
26
27/* Matrix Keyboard Controller */
28#define KBD_VIRT (IO_VIRT + 0x22000)
29#define KBD_KBCR 0x00
30#define KBD_KBSC 0x04
31#define KBD_KBTR 0x08
32#define KBD_KBVR0 0x0C
33#define KBD_KBVR1 0x10
34#define KBD_KBSR 0x18
35
36#define KBD_KBCR_SCANENABLE (1 << 7)
37#define KBD_KBCR_NPOWERDOWN (1 << 2)
38#define KBD_KBCR_CLKSEL_MASK (3)
39#define KBD_KBCR_CLKSEL_PCLK2 0x0
40#define KBD_KBCR_CLKSEL_PCLK128 0x1
41#define KBD_KBCR_CLKSEL_PCLK256 0x2
42#define KBD_KBCR_CLKSEL_PCLK512 0x3
43
44#define KBD_KBSR_INTR (1 << 0)
45#define KBD_KBSR_WAKEUP (1 << 1)
46
47/* USB device controller */
48
49#define USBD_BASE (IO_VIRT + 0x12000)
50#define USBD_LENGTH 0x3C
51
52#define USBD_GCTRL 0x00
53#define USBD_EPCTRL 0x04
54#define USBD_INTMASK 0x08
55#define USBD_INTSTAT 0x0C
56#define USBD_PWR 0x10
57#define USBD_DMARXTX 0x14
58#define USBD_DEVID 0x18
59#define USBD_DEVCLASS 0x1C
60#define USBD_INTCLASS 0x20
61#define USBD_SETUP0 0x24
62#define USBD_SETUP1 0x28
63#define USBD_ENDP0RD 0x2C
64#define USBD_ENDP0WT 0x30
65#define USBD_ENDP1RD 0x34
66#define USBD_ENDP2WT 0x38
67
68/* PS/2 port */
69#define PSDATA 0x00
70#define PSSTAT 0x04
71#define PSSTAT_TXEMPTY (1<<0)
72#define PSSTAT_TXBUSY (1<<1)
73#define PSSTAT_RXFULL (1<<2)
74#define PSSTAT_RXBUSY (1<<3)
75#define PSSTAT_CLKIN (1<<4)
76#define PSSTAT_DATAIN (1<<5)
77#define PSSTAT_PARITY (1<<6)
78
79#define PSCONF 0x08
80#define PSCONF_ENABLE (1<<0)
81#define PSCONF_TXINTEN (1<<2)
82#define PSCONF_RXINTEN (1<<3)
83#define PSCONF_FORCECLKLOW (1<<4)
84#define PSCONF_FORCEDATLOW (1<<5)
85#define PSCONF_LCE (1<<6)
86
87#define PSINTR 0x0C
88#define PSINTR_TXINT (1<<0)
89#define PSINTR_RXINT (1<<1)
90#define PSINTR_PAR (1<<2)
91#define PSINTR_RXTO (1<<3)
92#define PSINTR_TXTO (1<<4)
93
94#define PSTDLO 0x10 /* clk low before start transmission */
95#define PSTPRI 0x14 /* PRI clock */
96#define PSTXMT 0x18 /* maximum transmission time */
97#define PSTREC 0x20 /* maximum receive time */
98#define PSPWDN 0x3c
99
100/* ADC converter */
101#define ADC_BASE (IO_VIRT + 0x29000)
102#define ADC_CR 0x00
103#define ADC_TSCTRL 0x04
104#define ADC_BT_CTRL 0x08
105#define ADC_MC_CTRL 0x0C
106#define ADC_STATUS 0x10
107
108/* ADC control register bits */
109#define ADC_CR_PW_CTRL 0x80
110#define ADC_CR_DIRECTC 0x04
111#define ADC_CR_CONTIME_NO 0x00
112#define ADC_CR_CONTIME_2 0x04
113#define ADC_CR_CONTIME_4 0x08
114#define ADC_CR_CONTIME_ADE 0x0c
115#define ADC_CR_LONGCALTIME 0x01
116
117/* ADC touch panel register bits */
118#define ADC_TSCTRL_ENABLE 0x80
119#define ADC_TSCTRL_INTR 0x40
120#define ADC_TSCTRL_SWBYPSS 0x20
121#define ADC_TSCTRL_SWINVT 0x10
122#define ADC_TSCTRL_S400 0x03
123#define ADC_TSCTRL_S200 0x02
124#define ADC_TSCTRL_S100 0x01
125#define ADC_TSCTRL_S50 0x00
126
127/* ADC Interrupt Status Register bits */
128#define ADC_STATUS_TS_BIT 0x80
129#define ADC_STATUS_MBT_BIT 0x40
130#define ADC_STATUS_BBT_BIT 0x20
131#define ADC_STATUS_MIC_BIT 0x10
132
133/* Touch data registers */
134#define ADC_TS_X0X1 0x30
135#define ADC_TS_X2X3 0x34
136#define ADC_TS_Y0Y1 0x38
137#define ADC_TS_Y2Y3 0x3c
138#define ADC_TS_X4X5 0x40
139#define ADC_TS_X6X7 0x44
140#define ADC_TS_Y4Y5 0x48
141#define ADC_TS_Y6Y7 0x50
142
143/* battery data */
144#define ADC_MB_DATA 0x54
145#define ADC_BB_DATA 0x58
146
147/* Sound data register */
148#define ADC_SD_DAT0 0x60
149#define ADC_SD_DAT1 0x64
150#define ADC_SD_DAT2 0x68
151#define ADC_SD_DAT3 0x6c
152#define ADC_SD_DAT4 0x70
153#define ADC_SD_DAT5 0x74
154#define ADC_SD_DAT6 0x78
155#define ADC_SD_DAT7 0x7c
diff --git a/include/asm-arm/arch-h720x/hardware.h b/include/asm-arm/arch-h720x/hardware.h
new file mode 100644
index 000000000000..dfb778906a9f
--- /dev/null
+++ b/include/asm-arm/arch-h720x/hardware.h
@@ -0,0 +1,192 @@
1/*
2 * linux/include/asm-arm/arch-h720x/hardware.h
3 *
4 * Copyright (C) 2000 Jungjun Kim, Hynix Semiconductor Inc.
5 * (C) 2003 Thomas Gleixner <tglx@linutronix.de>
6 * (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>
7 *
8 * This file contains the hardware definitions of the 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 * Do not add implementations specific defines here. This files contains
15 * only defines of the onchip peripherals. Add those defines to boards.h,
16 * which is included by this file.
17 */
18
19#ifndef __ASM_ARCH_HARDWARE_H
20#define __ASM_ARCH_HARDWARE_H
21
22#define IOCLK (3686400L)
23
24/* Onchip peripherals */
25
26#define IO_VIRT 0xf0000000 /* IO peripherals */
27#define IO_PHYS 0x80000000
28#define IO_SIZE 0x00050000
29
30#ifdef CONFIG_CPU_H7202
31#include "h7202-regs.h"
32#elif defined CONFIG_CPU_H7201
33#include "h7201-regs.h"
34#else
35#error machine definition mismatch
36#endif
37
38/* Macro to access the CPU IO */
39#define CPU_IO(x) (*(volatile u32*)(x))
40
41/* Macro to access general purpose regs (base, offset) */
42#define CPU_REG(x,y) CPU_IO(x+y)
43
44/* Macro to access irq related regs */
45#define IRQ_REG(x) CPU_REG(IRQC_VIRT,x)
46
47/* CPU registers */
48/* general purpose I/O */
49#define GPIO_VIRT(x) (IO_VIRT + 0x23000 + ((x)<<5))
50#define GPIO_A_VIRT (GPIO_VIRT(0))
51#define GPIO_B_VIRT (GPIO_VIRT(1))
52#define GPIO_C_VIRT (GPIO_VIRT(2))
53#define GPIO_D_VIRT (GPIO_VIRT(3))
54#define GPIO_E_VIRT (GPIO_VIRT(4))
55#define GPIO_AMULSEL (GPIO_VIRT(0) + 0xA4)
56
57#define AMULSEL_USIN2 (1<<5)
58#define AMULSEL_USOUT2 (1<<6)
59#define AMULSEL_USIN3 (1<<13)
60#define AMULSEL_USOUT3 (1<<14)
61#define AMULSEL_IRDIN (1<<15)
62#define AMULSEL_IRDOUT (1<<7)
63
64/* Register offsets general purpose I/O */
65#define GPIO_DATA 0x00
66#define GPIO_DIR 0x04
67#define GPIO_MASK 0x08
68#define GPIO_STAT 0x0C
69#define GPIO_EDGE 0x10
70#define GPIO_CLR 0x14
71#define GPIO_POL 0x18
72#define GPIO_EN 0x1C
73
74/*interrupt controller */
75#define IRQC_VIRT (IO_VIRT + 0x24000)
76/* register offset interrupt controller */
77#define IRQC_IER 0x00
78#define IRQC_ISR 0x04
79
80/* timer unit */
81#define TIMER_VIRT (IO_VIRT + 0x25000)
82/* Register offsets timer unit */
83#define TM0_PERIOD 0x00
84#define TM0_COUNT 0x08
85#define TM0_CTRL 0x10
86#define TM1_PERIOD 0x20
87#define TM1_COUNT 0x28
88#define TM1_CTRL 0x30
89#define TM2_PERIOD 0x40
90#define TM2_COUNT 0x48
91#define TM2_CTRL 0x50
92#define TIMER_TOPCTRL 0x60
93#define TIMER_TOPSTAT 0x64
94#define T64_COUNTL 0x80
95#define T64_COUNTH 0x84
96#define T64_CTRL 0x88
97#define T64_BASEL 0x94
98#define T64_BASEH 0x98
99/* Bitmaks timer unit TOPSTAT reg */
100#define TSTAT_T0INT 0x1
101#define TSTAT_T1INT 0x2
102#define TSTAT_T2INT 0x4
103#define TSTAT_T3INT 0x8
104/* Bit description of TMx_CTRL register */
105#define TM_START 0x1
106#define TM_REPEAT 0x2
107#define TM_RESET 0x4
108/* Bit description of TIMER_CTRL register */
109#define ENABLE_TM0_INTR 0x1
110#define ENABLE_TM1_INTR 0x2
111#define ENABLE_TM2_INTR 0x4
112#define TIMER_ENABLE_BIT 0x8
113#define ENABLE_TIMER64 0x10
114#define ENABLE_TIMER64_INT 0x20
115
116/* PMU & PLL */
117#define PMU_BASE (IO_VIRT + 0x1000)
118#define PMU_MODE 0x00
119#define PMU_STAT 0x20
120#define PMU_PLL_CTRL 0x28
121
122/* PMU Mode bits */
123#define PMU_MODE_SLOW 0x00
124#define PMU_MODE_RUN 0x01
125#define PMU_MODE_IDLE 0x02
126#define PMU_MODE_SLEEP 0x03
127#define PMU_MODE_INIT 0x04
128#define PMU_MODE_DEEPSLEEP 0x07
129#define PMU_MODE_WAKEUP 0x08
130
131/* PMU ... */
132#define PLL_2_EN 0x8000
133#define PLL_1_EN 0x4000
134#define PLL_3_MUTE 0x0080
135
136/* Control bits for PMU/ PLL */
137#define PMU_WARMRESET 0x00010000
138#define PLL_CTRL_MASK23 0x000080ff
139
140/* LCD Controller */
141#define LCD_BASE (IO_VIRT + 0x10000)
142#define LCD_CTRL 0x00
143#define LCD_STATUS 0x04
144#define LCD_STATUS_M 0x08
145#define LCD_INTERRUPT 0x0C
146#define LCD_DBAR 0x10
147#define LCD_DCAR 0x14
148#define LCD_TIMING0 0x20
149#define LCD_TIMING1 0x24
150#define LCD_TIMING2 0x28
151#define LCD_TEST 0x40
152
153/* LCD Control Bits */
154#define LCD_CTRL_LCD_ENABLE 0x00000001
155/* Bits per pixel */
156#define LCD_CTRL_LCD_BPP_MASK 0x00000006
157#define LCD_CTRL_LCD_4BPP 0x00000000
158#define LCD_CTRL_LCD_8BPP 0x00000002
159#define LCD_CTRL_LCD_16BPP 0x00000004
160#define LCD_CTRL_LCD_BW 0x00000008
161#define LCD_CTRL_LCD_TFT 0x00000010
162#define LCD_CTRL_BGR 0x00001000
163#define LCD_CTRL_LCD_VCOMP 0x00080000
164#define LCD_CTRL_LCD_MONO8 0x00200000
165#define LCD_CTRL_LCD_PWR 0x00400000
166#define LCD_CTRL_LCD_BLE 0x00800000
167#define LCD_CTRL_LDBUSEN 0x01000000
168
169/* Palette */
170#define LCD_PALETTE_BASE (IO_VIRT + 0x10400)
171
172/* Serial ports */
173#define SERIAL0_OFS 0x20000
174#define SERIAL0_VIRT (IO_VIRT + SERIAL0_OFS)
175#define SERIAL0_BASE (IO_PHYS + SERIAL0_OFS)
176
177#define SERIAL1_OFS 0x21000
178#define SERIAL1_VIRT (IO_VIRT + SERIAL1_OFS)
179#define SERIAL1_BASE (IO_PHYS + SERIAL1_OFS)
180
181#define SERIAL_ENABLE 0x30
182#define SERIAL_ENABLE_EN (1<<0)
183
184/* General defines to pacify gcc */
185#define PCIO_BASE (0) /* for inb, outb and friends */
186#define PCIO_VIRT PCIO_BASE
187
188#define __ASM_ARCH_HARDWARE_INCMACH_H
189#include "boards.h"
190#undef __ASM_ARCH_HARDWARE_INCMACH_H
191
192#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-h720x/io.h b/include/asm-arm/arch-h720x/io.h
new file mode 100644
index 000000000000..68814828c9a7
--- /dev/null
+++ b/include/asm-arm/arch-h720x/io.h
@@ -0,0 +1,24 @@
1/*
2 * linux/include/asm-arm/arch-h720x/io.h
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Changelog:
7 *
8 * 09-19-2001 JJKIM
9 * Created from linux/include/asm-arm/arch-l7200/io.h
10 *
11 * 03-27-2003 Robert Schwebel <r.schwebel@pengutronix.de>:
12 * re-unified header files for h720x
13 */
14#ifndef __ASM_ARM_ARCH_IO_H
15#define __ASM_ARM_ARCH_IO_H
16
17#include <asm/arch/hardware.h>
18
19#define IO_SPACE_LIMIT 0xffffffff
20
21#define __io(a) ((void __iomem *)(a))
22#define __mem_pci(a) (a)
23
24#endif
diff --git a/include/asm-arm/arch-h720x/irq.h b/include/asm-arm/arch-h720x/irq.h
new file mode 100644
index 000000000000..b3821e957aa4
--- /dev/null
+++ b/include/asm-arm/arch-h720x/irq.h
@@ -0,0 +1,14 @@
1/*
2 * include/asm-arm/arch-h720x/irq.h
3 *
4 * Copyright (C) 2000-2002 Jungjun Kim
5 * (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>
6 * (C) 2003 Thomas Gleixner <tglx@linutronix.de>
7 */
8
9#ifndef __ASM_ARCH_IRQ_H
10#define __ASM_ARCH_IRQ_H
11
12extern void __init h720x_init_irq (void);
13
14#endif /* __ASM_ARCH_IRQ_H */
diff --git a/include/asm-arm/arch-h720x/irqs.h b/include/asm-arm/arch-h720x/irqs.h
new file mode 100644
index 000000000000..8244413988be
--- /dev/null
+++ b/include/asm-arm/arch-h720x/irqs.h
@@ -0,0 +1,116 @@
1/*
2 * linux/include/asm-arm/arch-h720x/irqs.h
3 *
4 * Copyright (C) 2000 Jungjun Kim
5 * (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>
6 * (C) 2003 Thomas Gleixner <tglx@linutronix.de>
7 *
8 */
9
10#ifndef __ASM_ARCH_IRQS_H
11#define __ASM_ARCH_IRQS_H
12
13#if defined (CONFIG_CPU_H7201)
14
15#define IRQ_PMU 0 /* 0x000001 */
16#define IRQ_DMA 1 /* 0x000002 */
17#define IRQ_LCD 2 /* 0x000004 */
18#define IRQ_VGA 3 /* 0x000008 */
19#define IRQ_PCMCIA1 4 /* 0x000010 */
20#define IRQ_PCMCIA2 5 /* 0x000020 */
21#define IRQ_AFE 6 /* 0x000040 */
22#define IRQ_AIC 7 /* 0x000080 */
23#define IRQ_KEYBOARD 8 /* 0x000100 */
24#define IRQ_TIMER0 9 /* 0x000200 */
25#define IRQ_RTC 10 /* 0x000400 */
26#define IRQ_SOUND 11 /* 0x000800 */
27#define IRQ_USB 12 /* 0x001000 */
28#define IRQ_IrDA 13 /* 0x002000 */
29#define IRQ_UART0 14 /* 0x004000 */
30#define IRQ_UART1 15 /* 0x008000 */
31#define IRQ_SPI 16 /* 0x010000 */
32#define IRQ_GPIOA 17 /* 0x020000 */
33#define IRQ_GPIOB 18 /* 0x040000 */
34#define IRQ_GPIOC 19 /* 0x080000 */
35#define IRQ_GPIOD 20 /* 0x100000 */
36#define IRQ_CommRX 21 /* 0x200000 */
37#define IRQ_CommTX 22 /* 0x400000 */
38#define IRQ_Soft 23 /* 0x800000 */
39
40#define NR_GLBL_IRQS 24
41
42#define IRQ_CHAINED_GPIOA(x) (NR_GLBL_IRQS + x)
43#define IRQ_CHAINED_GPIOB(x) (IRQ_CHAINED_GPIOA(32) + x)
44#define IRQ_CHAINED_GPIOC(x) (IRQ_CHAINED_GPIOB(32) + x)
45#define IRQ_CHAINED_GPIOD(x) (IRQ_CHAINED_GPIOC(32) + x)
46#define NR_IRQS IRQ_CHAINED_GPIOD(32)
47
48/* Enable mask for multiplexed interrupts */
49#define IRQ_ENA_MUX (1<<IRQ_GPIOA) | (1<<IRQ_GPIOB) \
50 | (1<<IRQ_GPIOC) | (1<<IRQ_GPIOD)
51
52
53#elif defined (CONFIG_CPU_H7202)
54
55#define IRQ_PMU 0 /* 0x00000001 */
56#define IRQ_DMA 1 /* 0x00000002 */
57#define IRQ_LCD 2 /* 0x00000004 */
58#define IRQ_SOUND 3 /* 0x00000008 */
59#define IRQ_I2S 4 /* 0x00000010 */
60#define IRQ_USB 5 /* 0x00000020 */
61#define IRQ_MMC 6 /* 0x00000040 */
62#define IRQ_RTC 7 /* 0x00000080 */
63#define IRQ_UART0 8 /* 0x00000100 */
64#define IRQ_UART1 9 /* 0x00000200 */
65#define IRQ_UART2 10 /* 0x00000400 */
66#define IRQ_UART3 11 /* 0x00000800 */
67#define IRQ_KBD 12 /* 0x00001000 */
68#define IRQ_PS2 13 /* 0x00002000 */
69#define IRQ_AIC 14 /* 0x00004000 */
70#define IRQ_TIMER0 15 /* 0x00008000 */
71#define IRQ_TIMERX 16 /* 0x00010000 */
72#define IRQ_WDT 17 /* 0x00020000 */
73#define IRQ_CAN0 18 /* 0x00040000 */
74#define IRQ_CAN1 19 /* 0x00080000 */
75#define IRQ_EXT0 20 /* 0x00100000 */
76#define IRQ_EXT1 21 /* 0x00200000 */
77#define IRQ_GPIOA 22 /* 0x00400000 */
78#define IRQ_GPIOB 23 /* 0x00800000 */
79#define IRQ_GPIOC 24 /* 0x01000000 */
80#define IRQ_GPIOD 25 /* 0x02000000 */
81#define IRQ_GPIOE 26 /* 0x04000000 */
82#define IRQ_COMMRX 27 /* 0x08000000 */
83#define IRQ_COMMTX 28 /* 0x10000000 */
84#define IRQ_SMC 29 /* 0x20000000 */
85#define IRQ_Soft 30 /* 0x40000000 */
86#define IRQ_RESERVED1 31 /* 0x80000000 */
87#define NR_GLBL_IRQS 32
88
89#define NR_TIMERX_IRQS 3
90
91#define IRQ_CHAINED_GPIOA(x) (NR_GLBL_IRQS + x)
92#define IRQ_CHAINED_GPIOB(x) (IRQ_CHAINED_GPIOA(32) + x)
93#define IRQ_CHAINED_GPIOC(x) (IRQ_CHAINED_GPIOB(32) + x)
94#define IRQ_CHAINED_GPIOD(x) (IRQ_CHAINED_GPIOC(32) + x)
95#define IRQ_CHAINED_GPIOE(x) (IRQ_CHAINED_GPIOD(32) + x)
96#define IRQ_CHAINED_TIMERX(x) (IRQ_CHAINED_GPIOE(32) + x)
97#define IRQ_TIMER1 (IRQ_CHAINED_TIMERX(0))
98#define IRQ_TIMER2 (IRQ_CHAINED_TIMERX(1))
99#define IRQ_TIMER64B (IRQ_CHAINED_TIMERX(2))
100
101#define NR_IRQS (IRQ_CHAINED_TIMERX(NR_TIMERX_IRQS))
102
103/* Enable mask for multiplexed interrupts */
104#define IRQ_ENA_MUX (1<<IRQ_TIMERX) | (1<<IRQ_GPIOA) | (1<<IRQ_GPIOB) | \
105 (1<<IRQ_GPIOC) | (1<<IRQ_GPIOD) | (1<<IRQ_GPIOE) | \
106 (1<<IRQ_TIMERX)
107
108#else
109#error cpu definition mismatch
110#endif
111
112/* decode irq number to register number */
113#define IRQ_TO_REGNO(irq) ((irq - NR_GLBL_IRQS) >> 5)
114#define IRQ_TO_BIT(irq) (1 << ((irq - NR_GLBL_IRQS) % 32))
115
116#endif
diff --git a/include/asm-arm/arch-h720x/memory.h b/include/asm-arm/arch-h720x/memory.h
new file mode 100644
index 000000000000..5633447af268
--- /dev/null
+++ b/include/asm-arm/arch-h720x/memory.h
@@ -0,0 +1,31 @@
1/*
2 * linux/include/asm-arm/arch-h720x/memory.h
3 *
4 * Copyright (c) 2000 Jungjun Kim
5 *
6 */
7#ifndef __ASM_ARCH_MEMORY_H
8#define __ASM_ARCH_MEMORY_H
9
10/*
11 * Page offset:
12 * ( 0xc0000000UL )
13 */
14#define PHYS_OFFSET (0x40000000UL)
15
16/*
17 * Virtual view <-> DMA view memory address translations
18 * virt_to_bus: Used to translate the virtual address to an
19 * address suitable to be passed to set_dma_addr
20 * bus_to_virt: Used to convert an address for DMA operations
21 * to an address that the kernel can use.
22 *
23 * There is something to do here later !, Mar 2000, Jungjun Kim
24 */
25
26#define __virt_to_bus__is_a_macro
27#define __virt_to_bus(x) __virt_to_phys(x)
28#define __bus_to_virt__is_a_macro
29#define __bus_to_virt(x) __phys_to_virt(x)
30
31#endif
diff --git a/include/asm-arm/arch-h720x/param.h b/include/asm-arm/arch-h720x/param.h
new file mode 100644
index 000000000000..2b80235f9847
--- /dev/null
+++ b/include/asm-arm/arch-h720x/param.h
@@ -0,0 +1,10 @@
1/*
2 * linux/include/asm-arm/arch-h720x/param.h
3 *
4 * Copyright (C) 2000 Jungjun Kim
5 */
6
7#ifndef __ASM_ARCH_PARAM_H
8#define __ASM_ARCH_PARAM_H
9
10#endif
diff --git a/include/asm-arm/arch-h720x/system.h b/include/asm-arm/arch-h720x/system.h
new file mode 100644
index 000000000000..0b025e227ec2
--- /dev/null
+++ b/include/asm-arm/arch-h720x/system.h
@@ -0,0 +1,31 @@
1/*
2 * linux/arch/arm/mach-h720x/system.h
3 *
4 * Copyright (C) 2001-2002 Jungjun Kim, Hynix Semiconductor 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 version 2 as
8 * published by the Free Software Foundation.
9 * linux/include/asm-arm/arch-h720x/system.h
10 *
11 */
12
13#ifndef __ASM_ARCH_SYSTEM_H
14#define __ASM_ARCH_SYSTEM_H
15#include <asm/hardware.h>
16
17static void arch_idle(void)
18{
19 CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_IDLE;
20 __asm__ __volatile__(
21 "mov r0, r0\n\t"
22 "mov r0, r0");
23}
24
25
26static __inline__ void arch_reset(char mode)
27{
28 CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET;
29}
30
31#endif
diff --git a/include/asm-arm/arch-h720x/timex.h b/include/asm-arm/arch-h720x/timex.h
new file mode 100644
index 000000000000..48a391c4080f
--- /dev/null
+++ b/include/asm-arm/arch-h720x/timex.h
@@ -0,0 +1,15 @@
1/*
2 * linux/include/asm-arm/arch-h720x/timex.h
3 * Copyright (C) 2000 Jungjun Kim, Hynix Semiconductor Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#ifndef __ASM_ARCH_TIMEX
11#define __ASM_ARCH_TIMEX
12
13#define CLOCK_TICK_RATE 3686400
14
15#endif
diff --git a/include/asm-arm/arch-h720x/uncompress.h b/include/asm-arm/arch-h720x/uncompress.h
new file mode 100644
index 000000000000..2fffacf85a01
--- /dev/null
+++ b/include/asm-arm/arch-h720x/uncompress.h
@@ -0,0 +1,39 @@
1/*
2 * linux/include/asm-arm/arch-h720x/uncompress.h
3 *
4 * Copyright (C) 2001-2002 Jungjun Kim
5 */
6
7#ifndef __ASM_ARCH_UNCOMPRESS_H
8#define __ASM_ARCH_UNCOMPRESS_H
9
10#include <asm/arch/hardware.h>
11
12#define LSR 0x14
13#define TEMPTY 0x40
14
15static void putstr(const char *s)
16{
17 char c;
18 volatile unsigned char *p = (volatile unsigned char *)(IO_PHYS+0x20000);
19
20 while ( (c = *s++) != '\0') {
21 /* wait until transmit buffer is empty */
22 while((p[LSR] & TEMPTY) == 0x0);
23 /* write next character */
24 *p = c;
25
26 if(c == '\n') {
27 while((p[LSR] & TEMPTY) == 0x0);
28 *p = '\r';
29 }
30 }
31}
32
33/*
34 * nothing to do
35 */
36#define arch_decomp_setup()
37#define arch_decomp_wdog()
38
39#endif
diff --git a/include/asm-arm/arch-h720x/vmalloc.h b/include/asm-arm/arch-h720x/vmalloc.h
new file mode 100644
index 000000000000..4af523a5e189
--- /dev/null
+++ b/include/asm-arm/arch-h720x/vmalloc.h
@@ -0,0 +1,21 @@
1/*
2 * linux/include/asm-arm/arch-h720x/vmalloc.h
3 */
4
5#ifndef __ARCH_ARM_VMALLOC_H
6#define __ARCH_ARM_VMALLOC_H
7
8/*
9 * Just any arbitrary offset to the start of the vmalloc VM area: the
10 * current 8MB value just means that there will be a 8MB "hole" after the
11 * physical memory until the kernel virtual memory starts. That means that
12 * any out-of-bounds memory accesses will hopefully be caught.
13 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
14 * area for the same reason. ;)
15 */
16#define VMALLOC_OFFSET (8*1024*1024)
17#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
18#define VMALLOC_VMADDR(x) ((unsigned long)(x))
19#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
20
21#endif
diff --git a/include/asm-arm/arch-imx/debug-macro.S b/include/asm-arm/arch-imx/debug-macro.S
new file mode 100644
index 000000000000..83f552f7bcc1
--- /dev/null
+++ b/include/asm-arm/arch-imx/debug-macro.S
@@ -0,0 +1,34 @@
1/* linux/include/asm-arm/arch-imx/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled?
17 moveq \rx, #0x00000000 @ physical
18 movne \rx, #0xe0000000 @ virtual
19 orr \rx, \rx, #0x00200000
20 orr \rx, \rx, #0x00006000 @ UART1 offset
21 .endm
22
23 .macro senduart,rd,rx
24 str \rd, [\rx, #0x40] @ TXDATA
25 .endm
26
27 .macro waituart,rd,rx
28 .endm
29
30 .macro busyuart,rd,rx
311002: ldr \rd, [\rx, #0x98] @ SR2
32 tst \rd, #1 << 3 @ TXDC
33 beq 1002b @ wait until transmit done
34 .endm
diff --git a/include/asm-arm/arch-imx/dma.h b/include/asm-arm/arch-imx/dma.h
new file mode 100644
index 000000000000..dbdc01780413
--- /dev/null
+++ b/include/asm-arm/arch-imx/dma.h
@@ -0,0 +1,71 @@
1/*
2 * linux/include/asm-arm/imxads/dma.h
3 *
4 * Copyright (C) 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 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#ifndef __ASM_ARCH_DMA_H
21#define __ASM_ARCH_DMA_H
22
23#define MAX_DMA_ADDRESS 0xffffffff
24
25#define MAX_DMA_CHANNELS 0
26
27/*
28 * DMA registration
29 */
30
31typedef enum {
32 DMA_PRIO_HIGH = 0,
33 DMA_PRIO_MEDIUM = 3,
34 DMA_PRIO_LOW = 6
35} imx_dma_prio;
36
37int imx_request_dma(char *name, imx_dma_prio prio,
38 void (*irq_handler) (int, void *, struct pt_regs *),
39 void (*err_handler) (int, void *, struct pt_regs *),
40 void *data);
41
42void imx_free_dma(int dma_ch);
43
44
45#define DMA_REQ_UART3_T 2
46#define DMA_REQ_UART3_R 3
47#define DMA_REQ_SSI2_T 4
48#define DMA_REQ_SSI2_R 5
49#define DMA_REQ_CSI_STAT 6
50#define DMA_REQ_CSI_R 7
51#define DMA_REQ_MSHC 8
52#define DMA_REQ_DSPA_DCT_DOUT 9
53#define DMA_REQ_DSPA_DCT_DIN 10
54#define DMA_REQ_DSPA_MAC 11
55#define DMA_REQ_EXT 12
56#define DMA_REQ_SDHC 13
57#define DMA_REQ_SPI1_R 14
58#define DMA_REQ_SPI1_T 15
59#define DMA_REQ_SSI_T 16
60#define DMA_REQ_SSI_R 17
61#define DMA_REQ_ASP_DAC 18
62#define DMA_REQ_ASP_ADC 19
63#define DMA_REQ_USP_EP(x) (20+(x))
64#define DMA_REQ_SPI2_R 26
65#define DMA_REQ_SPI2_T 27
66#define DMA_REQ_UART2_T 28
67#define DMA_REQ_UART2_R 29
68#define DMA_REQ_UART1_T 30
69#define DMA_REQ_UART1_R 31
70
71#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-imx/entry-macro.S b/include/asm-arm/arch-imx/entry-macro.S
new file mode 100644
index 000000000000..b40ea7cf88ec
--- /dev/null
+++ b/include/asm-arm/arch-imx/entry-macro.S
@@ -0,0 +1,29 @@
1/*
2 * include/asm-arm/arch-imx/entry-macro.S
3 *
4 * Low-level IRQ helper macros for iMX-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10 .macro disable_fiq
11 .endm
12#define AITC_NIVECSR 0x40
13 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
14 ldr \irqstat, =IO_ADDRESS(IMX_AITC_BASE)
15 @ Load offset & priority of the highest priority
16 @ interrupt pending.
17 ldr \irqnr, [\irqstat, #AITC_NIVECSR]
18 @ Shift off the priority leaving the offset or
19 @ "interrupt number"
20 mov \irqnr, \irqnr, lsr #16
21 ldr \irqstat, =1 @ dummy compare
22 ldr \base, =0xFFFF // invalid interrupt
23 cmp \irqnr, \base
24 bne 1001f
25 ldr \irqstat, =0
261001:
27 tst \irqstat, #1 @ to make the condition code = TRUE
28 .endm
29
diff --git a/include/asm-arm/arch-imx/hardware.h b/include/asm-arm/arch-imx/hardware.h
new file mode 100644
index 000000000000..adffb6acf42a
--- /dev/null
+++ b/include/asm-arm/arch-imx/hardware.h
@@ -0,0 +1,99 @@
1/*
2 * linux/include/asm-arm/arch-imx/hardware.h
3 *
4 * Copyright (C) 1999 ARM Limited.
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#ifndef __ASM_ARCH_HARDWARE_H
21#define __ASM_ARCH_HARDWARE_H
22
23#include <asm/sizes.h>
24#include "imx-regs.h"
25
26#ifndef __ASSEMBLY__
27# define __REG(x) (*((volatile u32 *)IO_ADDRESS(x)))
28
29# define __REG2(x,y) (*(volatile u32 *)((u32)&__REG(x) + (y)))
30#endif
31
32/*
33 * Memory map
34 */
35
36#define IMX_IO_PHYS 0x00200000
37#define IMX_IO_SIZE 0x00100000
38#define IMX_IO_BASE 0xe0000000
39
40#define IMX_CS0_PHYS 0x10000000
41#define IMX_CS0_SIZE 0x02000000
42#define IMX_CS0_VIRT 0xe8000000
43
44#define IMX_CS1_PHYS 0x12000000
45#define IMX_CS1_SIZE 0x01000000
46#define IMX_CS1_VIRT 0xea000000
47
48#define IMX_CS2_PHYS 0x13000000
49#define IMX_CS2_SIZE 0x01000000
50#define IMX_CS2_VIRT 0xeb000000
51
52#define IMX_CS3_PHYS 0x14000000
53#define IMX_CS3_SIZE 0x01000000
54#define IMX_CS3_VIRT 0xec000000
55
56#define IMX_CS4_PHYS 0x15000000
57#define IMX_CS4_SIZE 0x01000000
58#define IMX_CS4_VIRT 0xed000000
59
60#define IMX_CS5_PHYS 0x16000000
61#define IMX_CS5_SIZE 0x01000000
62#define IMX_CS5_VIRT 0xee000000
63
64#define IMX_FB_VIRT 0xF1000000
65#define IMX_FB_SIZE (256*1024)
66
67/* macro to get at IO space when running virtually */
68#define IO_ADDRESS(x) ((x) | IMX_IO_BASE)
69
70#ifndef __ASSEMBLY__
71/*
72 * Handy routine to set GPIO functions
73 */
74extern void imx_gpio_mode( int gpio_mode );
75
76/* get frequencies in Hz */
77extern unsigned int imx_get_system_clk(void);
78extern unsigned int imx_get_mcu_clk(void);
79extern unsigned int imx_get_perclk1(void); /* UART[12], Timer[12], PWM */
80extern unsigned int imx_get_perclk2(void); /* LCD, SD, SPI[12] */
81extern unsigned int imx_get_perclk3(void); /* SSI */
82extern unsigned int imx_get_hclk(void); /* SDRAM, CSI, Memory Stick,*/
83 /* I2C, DMA */
84#endif
85
86#define MAXIRQNUM 62
87#define MAXFIQNUM 62
88#define MAXSWINUM 62
89
90/*
91 * Use SDRAM for memory
92 */
93#define MEM_SIZE 0x01000000
94
95#ifdef CONFIG_ARCH_MX1ADS
96#include "mx1ads.h"
97#endif
98
99#endif
diff --git a/include/asm-arm/arch-imx/imx-regs.h b/include/asm-arm/arch-imx/imx-regs.h
new file mode 100644
index 000000000000..f32c203952cf
--- /dev/null
+++ b/include/asm-arm/arch-imx/imx-regs.h
@@ -0,0 +1,548 @@
1#ifndef _IMX_REGS_H
2#define _IMX_REGS_H
3/* ------------------------------------------------------------------------
4 * Motorola IMX system registers
5 * ------------------------------------------------------------------------
6 *
7 */
8
9/*
10 * Register BASEs, based on OFFSETs
11 *
12 */
13#define IMX_AIPI1_BASE (0x00000 + IMX_IO_BASE)
14#define IMX_WDT_BASE (0x01000 + IMX_IO_BASE)
15#define IMX_TIM1_BASE (0x02000 + IMX_IO_BASE)
16#define IMX_TIM2_BASE (0x03000 + IMX_IO_BASE)
17#define IMX_RTC_BASE (0x04000 + IMX_IO_BASE)
18#define IMX_LCDC_BASE (0x05000 + IMX_IO_BASE)
19#define IMX_UART1_BASE (0x06000 + IMX_IO_BASE)
20#define IMX_UART2_BASE (0x07000 + IMX_IO_BASE)
21#define IMX_PWM_BASE (0x08000 + IMX_IO_BASE)
22#define IMX_DMAC_BASE (0x09000 + IMX_IO_BASE)
23#define IMX_AIPI2_BASE (0x10000 + IMX_IO_BASE)
24#define IMX_SIM_BASE (0x11000 + IMX_IO_BASE)
25#define IMX_USBD_BASE (0x12000 + IMX_IO_BASE)
26#define IMX_SPI1_BASE (0x13000 + IMX_IO_BASE)
27#define IMX_MMC_BASE (0x14000 + IMX_IO_BASE)
28#define IMX_ASP_BASE (0x15000 + IMX_IO_BASE)
29#define IMX_BTA_BASE (0x16000 + IMX_IO_BASE)
30#define IMX_I2C_BASE (0x17000 + IMX_IO_BASE)
31#define IMX_SSI_BASE (0x18000 + IMX_IO_BASE)
32#define IMX_SPI2_BASE (0x19000 + IMX_IO_BASE)
33#define IMX_MSHC_BASE (0x1A000 + IMX_IO_BASE)
34#define IMX_PLL_BASE (0x1B000 + IMX_IO_BASE)
35#define IMX_GPIO_BASE (0x1C000 + IMX_IO_BASE)
36#define IMX_EIM_BASE (0x20000 + IMX_IO_BASE)
37#define IMX_SDRAMC_BASE (0x21000 + IMX_IO_BASE)
38#define IMX_MMA_BASE (0x22000 + IMX_IO_BASE)
39#define IMX_AITC_BASE (0x23000 + IMX_IO_BASE)
40#define IMX_CSI_BASE (0x24000 + IMX_IO_BASE)
41
42/* PLL registers */
43#define CSCR __REG(IMX_PLL_BASE) /* Clock Source Control Register */
44#define CSCR_SYSTEM_SEL (1<<16)
45
46#define MPCTL0 __REG(IMX_PLL_BASE + 0x4) /* MCU PLL Control Register 0 */
47#define MPCTL1 __REG(IMX_PLL_BASE + 0x8) /* MCU PLL and System Clock Register 1 */
48#define SPCTL0 __REG(IMX_PLL_BASE + 0xc) /* System PLL Control Register 0 */
49#define SPCTL1 __REG(IMX_PLL_BASE + 0x10) /* System PLL Control Register 1 */
50#define PCDR __REG(IMX_PLL_BASE + 0x20) /* Peripheral Clock Divider Register */
51
52#define CSCR_MPLL_RESTART (1<<21)
53
54/*
55 * GPIO Module and I/O Multiplexer
56 * x = 0..3 for reg_A, reg_B, reg_C, reg_D
57 */
58#define DDIR(x) __REG2(IMX_GPIO_BASE + 0x00, ((x) & 3) << 8)
59#define OCR1(x) __REG2(IMX_GPIO_BASE + 0x04, ((x) & 3) << 8)
60#define OCR2(x) __REG2(IMX_GPIO_BASE + 0x08, ((x) & 3) << 8)
61#define ICONFA1(x) __REG2(IMX_GPIO_BASE + 0x0c, ((x) & 3) << 8)
62#define ICONFA2(x) __REG2(IMX_GPIO_BASE + 0x10, ((x) & 3) << 8)
63#define ICONFB1(x) __REG2(IMX_GPIO_BASE + 0x14, ((x) & 3) << 8)
64#define ICONFB2(x) __REG2(IMX_GPIO_BASE + 0x18, ((x) & 3) << 8)
65#define DR(x) __REG2(IMX_GPIO_BASE + 0x1c, ((x) & 3) << 8)
66#define GIUS(x) __REG2(IMX_GPIO_BASE + 0x20, ((x) & 3) << 8)
67#define SSR(x) __REG2(IMX_GPIO_BASE + 0x24, ((x) & 3) << 8)
68#define ICR1(x) __REG2(IMX_GPIO_BASE + 0x28, ((x) & 3) << 8)
69#define ICR2(x) __REG2(IMX_GPIO_BASE + 0x2c, ((x) & 3) << 8)
70#define IMR(x) __REG2(IMX_GPIO_BASE + 0x30, ((x) & 3) << 8)
71#define ISR(x) __REG2(IMX_GPIO_BASE + 0x34, ((x) & 3) << 8)
72#define GPR(x) __REG2(IMX_GPIO_BASE + 0x38, ((x) & 3) << 8)
73#define SWR(x) __REG2(IMX_GPIO_BASE + 0x3c, ((x) & 3) << 8)
74#define PUEN(x) __REG2(IMX_GPIO_BASE + 0x40, ((x) & 3) << 8)
75
76#define GPIO_PIN_MASK 0x1f
77#define GPIO_PORT_MASK (0x3 << 5)
78
79#define GPIO_PORTA (0<<5)
80#define GPIO_PORTB (1<<5)
81#define GPIO_PORTC (2<<5)
82#define GPIO_PORTD (3<<5)
83
84#define GPIO_OUT (1<<7)
85#define GPIO_IN (0<<7)
86#define GPIO_PUEN (1<<8)
87
88#define GPIO_PF (0<<9)
89#define GPIO_AF (1<<9)
90
91#define GPIO_OCR_MASK (3<<10)
92#define GPIO_AIN (0<<10)
93#define GPIO_BIN (1<<10)
94#define GPIO_CIN (2<<10)
95#define GPIO_GPIO (3<<10)
96
97#define GPIO_AOUT (1<<12)
98#define GPIO_BOUT (1<<13)
99
100/* assignements for GPIO alternate/primary functions */
101
102/* FIXME: This list is not completed. The correct directions are
103 * missing on some (many) pins
104 */
105#define PA0_PF_A24 ( GPIO_PORTA | GPIO_PF | 0 )
106#define PA0_AIN_SPI2_CLK ( GPIO_PORTA | GPIO_OUT | GPIO_AIN | 0 )
107#define PA0_AF_ETMTRACESYNC ( GPIO_PORTA | GPIO_AF | 0 )
108#define PA1_AOUT_SPI2_RXD ( GPIO_PORTA | GPIO_IN | GPIO_AOUT | 1 )
109#define PA1_PF_TIN ( GPIO_PORTA | GPIO_PF | 1 )
110#define PA2_PF_PWM0 ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 2 )
111#define PA3_PF_CSI_MCLK ( GPIO_PORTA | GPIO_PF | 3 )
112#define PA4_PF_CSI_D0 ( GPIO_PORTA | GPIO_PF | 4 )
113#define PA5_PF_CSI_D1 ( GPIO_PORTA | GPIO_PF | 5 )
114#define PA6_PF_CSI_D2 ( GPIO_PORTA | GPIO_PF | 6 )
115#define PA7_PF_CSI_D3 ( GPIO_PORTA | GPIO_PF | 7 )
116#define PA8_PF_CSI_D4 ( GPIO_PORTA | GPIO_PF | 8 )
117#define PA9_PF_CSI_D5 ( GPIO_PORTA | GPIO_PF | 9 )
118#define PA10_PF_CSI_D6 ( GPIO_PORTA | GPIO_PF | 10 )
119#define PA11_PF_CSI_D7 ( GPIO_PORTA | GPIO_PF | 11 )
120#define PA12_PF_CSI_VSYNC ( GPIO_PORTA | GPIO_PF | 12 )
121#define PA13_PF_CSI_HSYNC ( GPIO_PORTA | GPIO_PF | 13 )
122#define PA14_PF_CSI_PIXCLK ( GPIO_PORTA | GPIO_PF | 14 )
123#define PA15_PF_I2C_SDA ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 15 )
124#define PA16_PF_I2C_SCL ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 16 )
125#define PA17_AF_ETMTRACEPKT4 ( GPIO_PORTA | GPIO_AF | 17 )
126#define PA17_AIN_SPI2_SS ( GPIO_PORTA | GPIO_AIN | 17 )
127#define PA18_AF_ETMTRACEPKT5 ( GPIO_PORTA | GPIO_AF | 18 )
128#define PA19_AF_ETMTRACEPKT6 ( GPIO_PORTA | GPIO_AF | 19 )
129#define PA20_AF_ETMTRACEPKT7 ( GPIO_PORTA | GPIO_AF | 20 )
130#define PA21_PF_A0 ( GPIO_PORTA | GPIO_PF | 21 )
131#define PA22_PF_CS4 ( GPIO_PORTA | GPIO_PF | 22 )
132#define PA23_PF_CS5 ( GPIO_PORTA | GPIO_PF | 23 )
133#define PA24_PF_A16 ( GPIO_PORTA | GPIO_PF | 24 )
134#define PA24_AF_ETMTRACEPKT0 ( GPIO_PORTA | GPIO_AF | 24 )
135#define PA25_PF_A17 ( GPIO_PORTA | GPIO_PF | 25 )
136#define PA25_AF_ETMTRACEPKT1 ( GPIO_PORTA | GPIO_AF | 25 )
137#define PA26_PF_A18 ( GPIO_PORTA | GPIO_PF | 26 )
138#define PA26_AF_ETMTRACEPKT2 ( GPIO_PORTA | GPIO_AF | 26 )
139#define PA27_PF_A19 ( GPIO_PORTA | GPIO_PF | 27 )
140#define PA27_AF_ETMTRACEPKT3 ( GPIO_PORTA | GPIO_AF | 27 )
141#define PA28_PF_A20 ( GPIO_PORTA | GPIO_PF | 28 )
142#define PA28_AF_ETMPIPESTAT0 ( GPIO_PORTA | GPIO_AF | 28 )
143#define PA29_PF_A21 ( GPIO_PORTA | GPIO_PF | 29 )
144#define PA29_AF_ETMPIPESTAT1 ( GPIO_PORTA | GPIO_AF | 29 )
145#define PA30_PF_A22 ( GPIO_PORTA | GPIO_PF | 30 )
146#define PA30_AF_ETMPIPESTAT2 ( GPIO_PORTA | GPIO_AF | 30 )
147#define PA31_PF_A23 ( GPIO_PORTA | GPIO_PF | 31 )
148#define PA31_AF_ETMTRACECLK ( GPIO_PORTA | GPIO_AF | 31 )
149#define PB8_PF_SD_DAT0 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 8 )
150#define PB8_AF_MS_PIO ( GPIO_PORTB | GPIO_AF | 8 )
151#define PB9_PF_SD_DAT1 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 9 )
152#define PB9_AF_MS_PI1 ( GPIO_PORTB | GPIO_AF | 9 )
153#define PB10_PF_SD_DAT2 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10 )
154#define PB10_AF_MS_SCLKI ( GPIO_PORTB | GPIO_AF | 10 )
155#define PB11_PF_SD_DAT3 ( GPIO_PORTB | GPIO_PF | 11 )
156#define PB11_AF_MS_SDIO ( GPIO_PORTB | GPIO_AF | 11 )
157#define PB12_PF_SD_CLK ( GPIO_PORTB | GPIO_PF | 12 )
158#define PB12_AF_MS_SCLK0 ( GPIO_PORTB | GPIO_AF | 12 )
159#define PB13_PF_SD_CMD ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 13 )
160#define PB13_AF_MS_BS ( GPIO_PORTB | GPIO_AF | 13 )
161#define PB14_AF_SSI_RXFS ( GPIO_PORTB | GPIO_AF | 14 )
162#define PB15_AF_SSI_RXCLK ( GPIO_PORTB | GPIO_AF | 15 )
163#define PB16_AF_SSI_RXDAT ( GPIO_PORTB | GPIO_IN | GPIO_AF | 16 )
164#define PB17_AF_SSI_TXDAT ( GPIO_PORTB | GPIO_OUT | GPIO_AF | 17 )
165#define PB18_AF_SSI_TXFS ( GPIO_PORTB | GPIO_AF | 18 )
166#define PB19_AF_SSI_TXCLK ( GPIO_PORTB | GPIO_AF | 19 )
167#define PB20_PF_USBD_AFE ( GPIO_PORTB | GPIO_PF | 20 )
168#define PB21_PF_USBD_OE ( GPIO_PORTB | GPIO_PF | 21 )
169#define PB22_PFUSBD_RCV ( GPIO_PORTB | GPIO_PF | 22 )
170#define PB23_PF_USBD_SUSPND ( GPIO_PORTB | GPIO_PF | 23 )
171#define PB24_PF_USBD_VP ( GPIO_PORTB | GPIO_PF | 24 )
172#define PB25_PF_USBD_VM ( GPIO_PORTB | GPIO_PF | 25 )
173#define PB26_PF_USBD_VPO ( GPIO_PORTB | GPIO_PF | 26 )
174#define PB27_PF_USBD_VMO ( GPIO_PORTB | GPIO_PF | 27 )
175#define PB28_PF_UART2_CTS ( GPIO_PORTB | GPIO_OUT | GPIO_PF | 28 )
176#define PB29_PF_UART2_RTS ( GPIO_PORTB | GPIO_IN | GPIO_PF | 29 )
177#define PB30_PF_UART2_TXD ( GPIO_PORTB | GPIO_OUT | GPIO_PF | 30 )
178#define PB31_PF_UART2_RXD ( GPIO_PORTB | GPIO_IN | GPIO_PF | 31 )
179#define PC3_PF_SSI_RXFS ( GPIO_PORTC | GPIO_PF | 3 )
180#define PC4_PF_SSI_RXCLK ( GPIO_PORTC | GPIO_PF | 4 )
181#define PC5_PF_SSI_RXDAT ( GPIO_PORTC | GPIO_IN | GPIO_PF | 5 )
182#define PC6_PF_SSI_TXDAT ( GPIO_PORTC | GPIO_OUT | GPIO_PF | 6 )
183#define PC7_PF_SSI_TXFS ( GPIO_PORTC | GPIO_PF | 7 )
184#define PC8_PF_SSI_TXCLK ( GPIO_PORTC | GPIO_PF | 8 )
185#define PC9_PF_UART1_CTS ( GPIO_PORTC | GPIO_OUT | GPIO_PF | 9 )
186#define PC10_PF_UART1_RTS ( GPIO_PORTC | GPIO_IN | GPIO_PF | 10 )
187#define PC11_PF_UART1_TXD ( GPIO_PORTC | GPIO_OUT | GPIO_PF | 11 )
188#define PC12_PF_UART1_RXD ( GPIO_PORTC | GPIO_IN | GPIO_PF | 12 )
189#define PC13_PF_SPI1_SPI_RDY ( GPIO_PORTC | GPIO_PF | 13 )
190#define PC14_PF_SPI1_SCLK ( GPIO_PORTC | GPIO_PF | 14 )
191#define PC15_PF_SPI1_SS ( GPIO_PORTC | GPIO_PF | 15 )
192#define PC16_PF_SPI1_MISO ( GPIO_PORTC | GPIO_PF | 16 )
193#define PC17_PF_SPI1_MOSI ( GPIO_PORTC | GPIO_PF | 17 )
194#define PD6_PF_LSCLK ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 6 )
195#define PD7_PF_REV ( GPIO_PORTD | GPIO_PF | 7 )
196#define PD7_AF_UART2_DTR ( GPIO_PORTD | GPIO_IN | GPIO_AF | 7 )
197#define PD7_AIN_SPI2_SCLK ( GPIO_PORTD | GPIO_AIN | 7 )
198#define PD8_PF_CLS ( GPIO_PORTD | GPIO_PF | 8 )
199#define PD8_AF_UART2_DCD ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 8 )
200#define PD8_AIN_SPI2_SS ( GPIO_PORTD | GPIO_AIN | 8 )
201#define PD9_PF_PS ( GPIO_PORTD | GPIO_PF | 9 )
202#define PD9_AF_UART2_RI ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 9 )
203#define PD9_AOUT_SPI2_RXD ( GPIO_PORTD | GPIO_IN | GPIO_AOUT | 9 )
204#define PD10_PF_SPL_SPR ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 10 )
205#define PD10_AF_UART2_DSR ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 10 )
206#define PD10_AIN_SPI2_TXD ( GPIO_PORTD | GPIO_OUT | GPIO_AIN | 10 )
207#define PD11_PF_CONTRAST ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 11 )
208#define PD12_PF_ACD_OE ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 12 )
209#define PD13_PF_LP_HSYNC ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 13 )
210#define PD14_PF_FLM_VSYNC ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 14 )
211#define PD15_PF_LD0 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 15 )
212#define PD16_PF_LD1 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 16 )
213#define PD17_PF_LD2 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 17 )
214#define PD18_PF_LD3 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 18 )
215#define PD19_PF_LD4 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 19 )
216#define PD20_PF_LD5 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 20 )
217#define PD21_PF_LD6 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 21 )
218#define PD22_PF_LD7 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 22 )
219#define PD23_PF_LD8 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 23 )
220#define PD24_PF_LD9 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 24 )
221#define PD25_PF_LD10 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 25 )
222#define PD26_PF_LD11 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 26 )
223#define PD27_PF_LD12 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 27 )
224#define PD28_PF_LD13 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 28 )
225#define PD29_PF_LD14 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 29 )
226#define PD30_PF_LD15 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 30 )
227#define PD31_PF_TMR2OUT ( GPIO_PORTD | GPIO_PF | 31 )
228#define PD31_BIN_SPI2_TXD ( GPIO_PORTD | GPIO_BIN | 31 )
229
230/*
231 * DMA Controller
232 */
233#define DCR __REG(IMX_DMAC_BASE +0x00) /* DMA Control Register */
234#define DISR __REG(IMX_DMAC_BASE +0x04) /* DMA Interrupt status Register */
235#define DIMR __REG(IMX_DMAC_BASE +0x08) /* DMA Interrupt mask Register */
236#define DBTOSR __REG(IMX_DMAC_BASE +0x0c) /* DMA Burst timeout status Register */
237#define DRTOSR __REG(IMX_DMAC_BASE +0x10) /* DMA Request timeout Register */
238#define DSESR __REG(IMX_DMAC_BASE +0x14) /* DMA Transfer Error Status Register */
239#define DBOSR __REG(IMX_DMAC_BASE +0x18) /* DMA Buffer overflow status Register */
240#define DBTOCR __REG(IMX_DMAC_BASE +0x1c) /* DMA Burst timeout control Register */
241#define WSRA __REG(IMX_DMAC_BASE +0x40) /* W-Size Register A */
242#define XSRA __REG(IMX_DMAC_BASE +0x44) /* X-Size Register A */
243#define YSRA __REG(IMX_DMAC_BASE +0x48) /* Y-Size Register A */
244#define WSRB __REG(IMX_DMAC_BASE +0x4c) /* W-Size Register B */
245#define XSRB __REG(IMX_DMAC_BASE +0x50) /* X-Size Register B */
246#define YSRB __REG(IMX_DMAC_BASE +0x54) /* Y-Size Register B */
247#define SAR(x) __REG2( IMX_DMAC_BASE + 0x80, (x) << 6) /* Source Address Registers */
248#define DAR(x) __REG2( IMX_DMAC_BASE + 0x84, (x) << 6) /* Destination Address Registers */
249#define CNTR(x) __REG2( IMX_DMAC_BASE + 0x88, (x) << 6) /* Count Registers */
250#define CCR(x) __REG2( IMX_DMAC_BASE + 0x8c, (x) << 6) /* Control Registers */
251#define RSSR(x) __REG2( IMX_DMAC_BASE + 0x90, (x) << 6) /* Request source select Registers */
252#define BLR(x) __REG2( IMX_DMAC_BASE + 0x94, (x) << 6) /* Burst length Registers */
253#define RTOR(x) __REG2( IMX_DMAC_BASE + 0x98, (x) << 6) /* Request timeout Registers */
254#define BUCR(x) __REG2( IMX_DMAC_BASE + 0x98, (x) << 6) /* Bus Utilization Registers */
255
256#define DCR_DRST (1<<1)
257#define DCR_DEN (1<<0)
258#define DBTOCR_EN (1<<15)
259#define DBTOCR_CNT(x) ((x) & 0x7fff )
260#define CNTR_CNT(x) ((x) & 0xffffff )
261#define CCR_DMOD_LINEAR ( 0x0 << 12 )
262#define CCR_DMOD_2D ( 0x1 << 12 )
263#define CCR_DMOD_FIFO ( 0x2 << 12 )
264#define CCR_DMOD_EOBFIFO ( 0x3 << 12 )
265#define CCR_SMOD_LINEAR ( 0x0 << 10 )
266#define CCR_SMOD_2D ( 0x1 << 10 )
267#define CCR_SMOD_FIFO ( 0x2 << 10 )
268#define CCR_SMOD_EOBFIFO ( 0x3 << 10 )
269#define CCR_MDIR_DEC (1<<9)
270#define CCR_MSEL_B (1<<8)
271#define CCR_DSIZ_32 ( 0x0 << 6 )
272#define CCR_DSIZ_8 ( 0x1 << 6 )
273#define CCR_DSIZ_16 ( 0x2 << 6 )
274#define CCR_SSIZ_32 ( 0x0 << 4 )
275#define CCR_SSIZ_8 ( 0x1 << 4 )
276#define CCR_SSIZ_16 ( 0x2 << 4 )
277#define CCR_REN (1<<3)
278#define CCR_RPT (1<<2)
279#define CCR_FRC (1<<1)
280#define CCR_CEN (1<<0)
281#define RTOR_EN (1<<15)
282#define RTOR_CLK (1<<14)
283#define RTOR_PSC (1<<13)
284
285/*
286 * Interrupt controller
287 */
288
289#define IMX_INTCNTL __REG(IMX_AITC_BASE+0x00)
290#define INTCNTL_FIAD (1<<19)
291#define INTCNTL_NIAD (1<<20)
292
293#define IMX_NIMASK __REG(IMX_AITC_BASE+0x04)
294#define IMX_INTENNUM __REG(IMX_AITC_BASE+0x08)
295#define IMX_INTDISNUM __REG(IMX_AITC_BASE+0x0c)
296#define IMX_INTENABLEH __REG(IMX_AITC_BASE+0x10)
297#define IMX_INTENABLEL __REG(IMX_AITC_BASE+0x14)
298
299/*
300 * General purpose timers
301 */
302#define IMX_TCTL(x) __REG( 0x00 + (x))
303#define TCTL_SWR (1<<15)
304#define TCTL_FRR (1<<8)
305#define TCTL_CAP_RIS (1<<6)
306#define TCTL_CAP_FAL (2<<6)
307#define TCTL_CAP_RIS_FAL (3<<6)
308#define TCTL_OM (1<<5)
309#define TCTL_IRQEN (1<<4)
310#define TCTL_CLK_PCLK1 (1<<1)
311#define TCTL_CLK_PCLK1_16 (2<<1)
312#define TCTL_CLK_TIN (3<<1)
313#define TCTL_CLK_32 (4<<1)
314#define TCTL_TEN (1<<0)
315
316#define IMX_TPRER(x) __REG( 0x04 + (x))
317#define IMX_TCMP(x) __REG( 0x08 + (x))
318#define IMX_TCR(x) __REG( 0x0C + (x))
319#define IMX_TCN(x) __REG( 0x10 + (x))
320#define IMX_TSTAT(x) __REG( 0x14 + (x))
321#define TSTAT_CAPT (1<<1)
322#define TSTAT_COMP (1<<0)
323
324/*
325 * LCD Controller
326 */
327
328#define LCDC_SSA __REG(IMX_LCDC_BASE+0x00)
329
330#define LCDC_SIZE __REG(IMX_LCDC_BASE+0x04)
331#define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20)
332#define SIZE_YMAX(y) ( (y) & 0x1ff )
333
334#define LCDC_VPW __REG(IMX_LCDC_BASE+0x08)
335#define VPW_VPW(x) ( (x) & 0x3ff )
336
337#define LCDC_CPOS __REG(IMX_LCDC_BASE+0x0C)
338#define CPOS_CC1 (1<<31)
339#define CPOS_CC0 (1<<30)
340#define CPOS_OP (1<<28)
341#define CPOS_CXP(x) (((x) & 3ff) << 16)
342#define CPOS_CYP(y) ((y) & 0x1ff)
343
344#define LCDC_LCWHB __REG(IMX_LCDC_BASE+0x10)
345#define LCWHB_BK_EN (1<<31)
346#define LCWHB_CW(w) (((w) & 0x1f) << 24)
347#define LCWHB_CH(h) (((h) & 0x1f) << 16)
348#define LCWHB_BD(x) ((x) & 0xff)
349
350#define LCDC_LCHCC __REG(IMX_LCDC_BASE+0x14)
351#define LCHCC_CUR_COL_R(r) (((r) & 0x1f) << 11)
352#define LCHCC_CUR_COL_G(g) (((g) & 0x3f) << 5)
353#define LCHCC_CUR_COL_B(b) ((b) & 0x1f)
354
355#define LCDC_PCR __REG(IMX_LCDC_BASE+0x18)
356#define PCR_TFT (1<<31)
357#define PCR_COLOR (1<<30)
358#define PCR_PBSIZ_1 (0<<28)
359#define PCR_PBSIZ_2 (1<<28)
360#define PCR_PBSIZ_4 (2<<28)
361#define PCR_PBSIZ_8 (3<<28)
362#define PCR_BPIX_1 (0<<25)
363#define PCR_BPIX_2 (1<<25)
364#define PCR_BPIX_4 (2<<25)
365#define PCR_BPIX_8 (3<<25)
366#define PCR_BPIX_12 (4<<25)
367#define PCR_BPIX_16 (4<<25)
368#define PCR_PIXPOL (1<<24)
369#define PCR_FLMPOL (1<<23)
370#define PCR_LPPOL (1<<22)
371#define PCR_CLKPOL (1<<21)
372#define PCR_OEPOL (1<<20)
373#define PCR_SCLKIDLE (1<<19)
374#define PCR_END_SEL (1<<18)
375#define PCR_END_BYTE_SWAP (1<<17)
376#define PCR_REV_VS (1<<16)
377#define PCR_ACD_SEL (1<<15)
378#define PCR_ACD(x) (((x) & 0x7f) << 8)
379#define PCR_SCLK_SEL (1<<7)
380#define PCR_SHARP (1<<6)
381#define PCR_PCD(x) ((x) & 0x3f)
382
383#define LCDC_HCR __REG(IMX_LCDC_BASE+0x1C)
384#define HCR_H_WIDTH(x) (((x) & 0x3f) << 26)
385#define HCR_H_WAIT_1(x) (((x) & 0xff) << 8)
386#define HCR_H_WAIT_2(x) ((x) & 0xff)
387
388#define LCDC_VCR __REG(IMX_LCDC_BASE+0x20)
389#define VCR_V_WIDTH(x) (((x) & 0x3f) << 26)
390#define VCR_V_WAIT_1(x) (((x) & 0xff) << 8)
391#define VCR_V_WAIT_2(x) ((x) & 0xff)
392
393#define LCDC_POS __REG(IMX_LCDC_BASE+0x24)
394#define POS_POS(x) ((x) & 1f)
395
396#define LCDC_LSCR1 __REG(IMX_LCDC_BASE+0x28)
397#define LSCR1_PS_RISE_DELAY(x) (((x) & 0x7f) << 26)
398#define LSCR1_CLS_RISE_DELAY(x) (((x) & 0x3f) << 16)
399#define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8)
400#define LSCR1_GRAY2(x) (((x) & 0xf) << 4)
401#define LSCR1_GRAY1(x) (((x) & 0xf))
402
403#define LCDC_PWMR __REG(IMX_LCDC_BASE+0x2C)
404#define PWMR_CLS(x) (((x) & 0x1ff) << 16)
405#define PWMR_LDMSK (1<<15)
406#define PWMR_SCR1 (1<<10)
407#define PWMR_SCR0 (1<<9)
408#define PWMR_CC_EN (1<<8)
409#define PWMR_PW(x) ((x) & 0xff)
410
411#define LCDC_DMACR __REG(IMX_LCDC_BASE+0x30)
412#define DMACR_BURST (1<<31)
413#define DMACR_HM(x) (((x) & 0xf) << 16)
414#define DMACR_TM(x) ((x) &0xf)
415
416#define LCDC_RMCR __REG(IMX_LCDC_BASE+0x34)
417#define RMCR_LCDC_EN (1<<1)
418#define RMCR_SELF_REF (1<<0)
419
420#define LCDC_LCDICR __REG(IMX_LCDC_BASE+0x38)
421#define LCDICR_INT_SYN (1<<2)
422#define LCDICR_INT_CON (1)
423
424#define LCDC_LCDISR __REG(IMX_LCDC_BASE+0x40)
425#define LCDISR_UDR_ERR (1<<3)
426#define LCDISR_ERR_RES (1<<2)
427#define LCDISR_EOF (1<<1)
428#define LCDISR_BOF (1<<0)
429
430/*
431 * UART Module. Takes the UART base address as argument
432 */
433#define URXD0(x) __REG( 0x0 + (x)) /* Receiver Register */
434#define URTX0(x) __REG( 0x40 + (x)) /* Transmitter Register */
435#define UCR1(x) __REG( 0x80 + (x)) /* Control Register 1 */
436#define UCR2(x) __REG( 0x84 + (x)) /* Control Register 2 */
437#define UCR3(x) __REG( 0x88 + (x)) /* Control Register 3 */
438#define UCR4(x) __REG( 0x8c + (x)) /* Control Register 4 */
439#define UFCR(x) __REG( 0x90 + (x)) /* FIFO Control Register */
440#define USR1(x) __REG( 0x94 + (x)) /* Status Register 1 */
441#define USR2(x) __REG( 0x98 + (x)) /* Status Register 2 */
442#define UESC(x) __REG( 0x9c + (x)) /* Escape Character Register */
443#define UTIM(x) __REG( 0xa0 + (x)) /* Escape Timer Register */
444#define UBIR(x) __REG( 0xa4 + (x)) /* BRM Incremental Register */
445#define UBMR(x) __REG( 0xa8 + (x)) /* BRM Modulator Register */
446#define UBRC(x) __REG( 0xac + (x)) /* Baud Rate Count Register */
447#define BIPR1(x) __REG( 0xb0 + (x)) /* Incremental Preset Register 1 */
448#define BIPR2(x) __REG( 0xb4 + (x)) /* Incremental Preset Register 2 */
449#define BIPR3(x) __REG( 0xb8 + (x)) /* Incremental Preset Register 3 */
450#define BIPR4(x) __REG( 0xbc + (x)) /* Incremental Preset Register 4 */
451#define BMPR1(x) __REG( 0xc0 + (x)) /* BRM Modulator Register 1 */
452#define BMPR2(x) __REG( 0xc4 + (x)) /* BRM Modulator Register 2 */
453#define BMPR3(x) __REG( 0xc8 + (x)) /* BRM Modulator Register 3 */
454#define BMPR4(x) __REG( 0xcc + (x)) /* BRM Modulator Register 4 */
455#define UTS(x) __REG( 0xd0 + (x)) /* UART Test Register */
456
457/* UART Control Register Bit Fields.*/
458#define URXD_CHARRDY (1<<15)
459#define URXD_ERR (1<<14)
460#define URXD_OVRRUN (1<<13)
461#define URXD_FRMERR (1<<12)
462#define URXD_BRK (1<<11)
463#define URXD_PRERR (1<<10)
464#define UCR1_ADEN (1<<15) /* Auto dectect interrupt */
465#define UCR1_ADBR (1<<14) /* Auto detect baud rate */
466#define UCR1_TRDYEN (1<<13) /* Transmitter ready interrupt enable */
467#define UCR1_IDEN (1<<12) /* Idle condition interrupt */
468#define UCR1_RRDYEN (1<<9) /* Recv ready interrupt enable */
469#define UCR1_RDMAEN (1<<8) /* Recv ready DMA enable */
470#define UCR1_IREN (1<<7) /* Infrared interface enable */
471#define UCR1_TXMPTYEN (1<<6) /* Transimitter empty interrupt enable */
472#define UCR1_RTSDEN (1<<5) /* RTS delta interrupt enable */
473#define UCR1_SNDBRK (1<<4) /* Send break */
474#define UCR1_TDMAEN (1<<3) /* Transmitter ready DMA enable */
475#define UCR1_UARTCLKEN (1<<2) /* UART clock enabled */
476#define UCR1_DOZE (1<<1) /* Doze */
477#define UCR1_UARTEN (1<<0) /* UART enabled */
478#define UCR2_ESCI (1<<15) /* Escape seq interrupt enable */
479#define UCR2_IRTS (1<<14) /* Ignore RTS pin */
480#define UCR2_CTSC (1<<13) /* CTS pin control */
481#define UCR2_CTS (1<<12) /* Clear to send */
482#define UCR2_ESCEN (1<<11) /* Escape enable */
483#define UCR2_PREN (1<<8) /* Parity enable */
484#define UCR2_PROE (1<<7) /* Parity odd/even */
485#define UCR2_STPB (1<<6) /* Stop */
486#define UCR2_WS (1<<5) /* Word size */
487#define UCR2_RTSEN (1<<4) /* Request to send interrupt enable */
488#define UCR2_TXEN (1<<2) /* Transmitter enabled */
489#define UCR2_RXEN (1<<1) /* Receiver enabled */
490#define UCR2_SRST (1<<0) /* SW reset */
491#define UCR3_DTREN (1<<13) /* DTR interrupt enable */
492#define UCR3_PARERREN (1<<12) /* Parity enable */
493#define UCR3_FRAERREN (1<<11) /* Frame error interrupt enable */
494#define UCR3_DSR (1<<10) /* Data set ready */
495#define UCR3_DCD (1<<9) /* Data carrier detect */
496#define UCR3_RI (1<<8) /* Ring indicator */
497#define UCR3_TIMEOUTEN (1<<7) /* Timeout interrupt enable */
498#define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */
499#define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */
500#define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */
501#define UCR3_REF25 (1<<3) /* Ref freq 25 MHz */
502#define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz */
503#define UCR3_INVT (1<<1) /* Inverted Infrared transmission */
504#define UCR3_BPEN (1<<0) /* Preset registers enable */
505#define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */
506#define UCR4_INVR (1<<9) /* Inverted infrared reception */
507#define UCR4_ENIRI (1<<8) /* Serial infrared interrupt enable */
508#define UCR4_WKEN (1<<7) /* Wake interrupt enable */
509#define UCR4_REF16 (1<<6) /* Ref freq 16 MHz */
510#define UCR4_IRSC (1<<5) /* IR special case */
511#define UCR4_TCEN (1<<3) /* Transmit complete interrupt enable */
512#define UCR4_BKEN (1<<2) /* Break condition interrupt enable */
513#define UCR4_OREN (1<<1) /* Receiver overrun interrupt enable */
514#define UCR4_DREN (1<<0) /* Recv data ready interrupt enable */
515#define UFCR_RXTL_SHF 0 /* Receiver trigger level shift */
516#define UFCR_RFDIV (7<<7) /* Reference freq divider mask */
517#define UFCR_TXTL_SHF 10 /* Transmitter trigger level shift */
518#define USR1_PARITYERR (1<<15) /* Parity error interrupt flag */
519#define USR1_RTSS (1<<14) /* RTS pin status */
520#define USR1_TRDY (1<<13) /* Transmitter ready interrupt/dma flag */
521#define USR1_RTSD (1<<12) /* RTS delta */
522#define USR1_ESCF (1<<11) /* Escape seq interrupt flag */
523#define USR1_FRAMERR (1<<10) /* Frame error interrupt flag */
524#define USR1_RRDY (1<<9) /* Receiver ready interrupt/dma flag */
525#define USR1_TIMEOUT (1<<7) /* Receive timeout interrupt status */
526#define USR1_RXDS (1<<6) /* Receiver idle interrupt flag */
527#define USR1_AIRINT (1<<5) /* Async IR wake interrupt flag */
528#define USR1_AWAKE (1<<4) /* Aysnc wake interrupt flag */
529#define USR2_ADET (1<<15) /* Auto baud rate detect complete */
530#define USR2_TXFE (1<<14) /* Transmit buffer FIFO empty */
531#define USR2_DTRF (1<<13) /* DTR edge interrupt flag */
532#define USR2_IDLE (1<<12) /* Idle condition */
533#define USR2_IRINT (1<<8) /* Serial infrared interrupt flag */
534#define USR2_WAKE (1<<7) /* Wake */
535#define USR2_RTSF (1<<4) /* RTS edge interrupt flag */
536#define USR2_TXDC (1<<3) /* Transmitter complete */
537#define USR2_BRCD (1<<2) /* Break condition */
538#define USR2_ORE (1<<1) /* Overrun error */
539#define USR2_RDR (1<<0) /* Recv data ready */
540#define UTS_FRCPERR (1<<13) /* Force parity error */
541#define UTS_LOOP (1<<12) /* Loop tx and rx */
542#define UTS_TXEMPTY (1<<6) /* TxFIFO empty */
543#define UTS_RXEMPTY (1<<5) /* RxFIFO empty */
544#define UTS_TXFULL (1<<4) /* TxFIFO full */
545#define UTS_RXFULL (1<<3) /* RxFIFO full */
546#define UTS_SOFTRST (1<<0) /* Software reset */
547
548#endif // _IMX_REGS_H
diff --git a/include/asm-arm/arch-imx/io.h b/include/asm-arm/arch-imx/io.h
new file mode 100644
index 000000000000..28a4cca6a4cb
--- /dev/null
+++ b/include/asm-arm/arch-imx/io.h
@@ -0,0 +1,28 @@
1/*
2 * linux/include/asm-arm/arch-imxads/io.h
3 *
4 * Copyright (C) 1999 ARM Limited
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#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22
23#define IO_SPACE_LIMIT 0xffffffff
24
25#define __io(a) ((void __iomem *)(a))
26#define __mem_pci(a) (a)
27
28#endif
diff --git a/include/asm-arm/arch-imx/irq.h b/include/asm-arm/arch-imx/irq.h
new file mode 100644
index 000000000000..545e065d2325
--- /dev/null
+++ b/include/asm-arm/arch-imx/irq.h
@@ -0,0 +1,20 @@
1/*
2 * linux/include/asm-arm/arch-imxads/irq.h
3 *
4 * Copyright (C) 1999 ARM Limited
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#define fixup_irq(i) (i)
diff --git a/include/asm-arm/arch-imx/irqs.h b/include/asm-arm/arch-imx/irqs.h
new file mode 100644
index 000000000000..238197cfb9d9
--- /dev/null
+++ b/include/asm-arm/arch-imx/irqs.h
@@ -0,0 +1,116 @@
1/*
2 * linux/include/asm-arm/arch-imxads/irqs.h
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#ifndef __ARM_IRQS_H__
23#define __ARM_IRQS_H__
24
25/* Use the imx definitions */
26#include <asm/arch/hardware.h>
27
28/*
29 * IMX Interrupt numbers
30 *
31 */
32#define INT_SOFTINT 0
33#define CSI_INT 6
34#define DSPA_MAC_INT 7
35#define DSPA_INT 8
36#define COMP_INT 9
37#define MSHC_XINT 10
38#define GPIO_INT_PORTA 11
39#define GPIO_INT_PORTB 12
40#define GPIO_INT_PORTC 13
41#define LCDC_INT 14
42#define SIM_INT 15
43#define SIM_DATA_INT 16
44#define RTC_INT 17
45#define RTC_SAMINT 18
46#define UART2_MINT_PFERR 19
47#define UART2_MINT_RTS 20
48#define UART2_MINT_DTR 21
49#define UART2_MINT_UARTC 22
50#define UART2_MINT_TX 23
51#define UART2_MINT_RX 24
52#define UART1_MINT_PFERR 25
53#define UART1_MINT_RTS 26
54#define UART1_MINT_DTR 27
55#define UART1_MINT_UARTC 28
56#define UART1_MINT_TX 29
57#define UART1_MINT_RX 30
58#define VOICE_DAC_INT 31
59#define VOICE_ADC_INT 32
60#define PEN_DATA_INT 33
61#define PWM_INT 34
62#define SDHC_INT 35
63#define I2C_INT 39
64#define CSPI_INT 41
65#define SSI_TX_INT 42
66#define SSI_TX_ERR_INT 43
67#define SSI_RX_INT 44
68#define SSI_RX_ERR_INT 45
69#define TOUCH_INT 46
70#define USBD_INT0 47
71#define USBD_INT1 48
72#define USBD_INT2 49
73#define USBD_INT3 50
74#define USBD_INT4 51
75#define USBD_INT5 52
76#define USBD_INT6 53
77#define BTSYS_INT 55
78#define BTTIM_INT 56
79#define BTWUI_INT 57
80#define TIM2_INT 58
81#define TIM1_INT 59
82#define DMA_ERR 60
83#define DMA_INT 61
84#define GPIO_INT_PORTD 62
85
86#define IMX_IRQS (64)
87
88/* note: the IMX has four gpio ports (A-D), but only
89 * the following pins are connected to the outside
90 * world:
91 *
92 * PORT A: bits 0-31
93 * PORT B: bits 8-31
94 * PORT C: bits 3-17
95 * PORT D: bits 6-31
96 *
97 * We map these interrupts straight on. As a result we have
98 * several holes in the interrupt mapping. We do this for two
99 * reasons:
100 * - mapping the interrupts without holes would get
101 * far more complicated
102 * - Motorola could well decide to bring some processor
103 * with more pins connected
104 */
105
106#define IRQ_GPIOA(x) (IMX_IRQS + x)
107#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x)
108#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
109#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
110
111/* decode irq number to use with IMR(x), ISR(x) and friends */
112#define IRQ_TO_REG(irq) ((irq - IMX_IRQS) >> 5)
113
114#define NR_IRQS (IRQ_GPIOD(32) + 1)
115#define IRQ_GPIO(x)
116#endif
diff --git a/include/asm-arm/arch-imx/memory.h b/include/asm-arm/arch-imx/memory.h
new file mode 100644
index 000000000000..116a91fa14f1
--- /dev/null
+++ b/include/asm-arm/arch-imx/memory.h
@@ -0,0 +1,38 @@
1/*
2 * linux/include/asm-arm/arch-imx/memory.h
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#ifndef __ASM_ARCH_MMU_H
22#define __ASM_ARCH_MMU_H
23
24#define PHYS_OFFSET (0x08000000UL)
25
26/*
27 * Virtual view <-> DMA view memory address translations
28 * virt_to_bus: Used to translate the virtual address to an
29 * address suitable to be passed to set_dma_addr
30 * bus_to_virt: Used to convert an address for DMA operations
31 * to an address that the kernel can use.
32 */
33#define __virt_to_bus__is_a_macro
34#define __virt_to_bus(x) (x - PAGE_OFFSET + PHYS_OFFSET)
35#define __bus_to_virt__is_a_macro
36#define __bus_to_virt(x) (x - PHYS_OFFSET + PAGE_OFFSET)
37
38#endif
diff --git a/include/asm-arm/arch-imx/mx1ads.h b/include/asm-arm/arch-imx/mx1ads.h
new file mode 100644
index 000000000000..d90fa4b49ce1
--- /dev/null
+++ b/include/asm-arm/arch-imx/mx1ads.h
@@ -0,0 +1,36 @@
1/*
2 * linux/include/asm-arm/arch-imx/mx1ads.h
3 *
4 * Copyright (C) 2004 Robert Schwebel, Pengutronix
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
22#ifndef __ASM_ARCH_MX1ADS_H
23#define __ASM_ARCH_MX1ADS_H
24
25/* ------------------------------------------------------------------------ */
26/* Memory Map for the M9328MX1ADS (MX1ADS) Board */
27/* ------------------------------------------------------------------------ */
28
29#define MX1ADS_FLASH_PHYS 0x10000000
30#define MX1ADS_FLASH_SIZE (16*1024*1024)
31
32#define IMX_FB_PHYS (0x0C000000 - 0x40000)
33
34#define CLK32 32000
35
36#endif /* __ASM_ARCH_MX1ADS_H */
diff --git a/include/asm-arm/arch-imx/param.h b/include/asm-arm/arch-imx/param.h
new file mode 100644
index 000000000000..7c724f03333e
--- /dev/null
+++ b/include/asm-arm/arch-imx/param.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-imx/param.h
3 *
4 * Copyright (C) 1999 ARM Limited
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 */
diff --git a/include/asm-arm/arch-imx/system.h b/include/asm-arm/arch-imx/system.h
new file mode 100644
index 000000000000..c645fe9afb9d
--- /dev/null
+++ b/include/asm-arm/arch-imx/system.h
@@ -0,0 +1,40 @@
1/*
2 * linux/include/asm-arm/arch-imxads/system.h
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#ifndef __ASM_ARCH_SYSTEM_H
22#define __ASM_ARCH_SYSTEM_H
23
24static void
25arch_idle(void)
26{
27 /*
28 * This should do all the clock switching
29 * and wait for interrupt tricks
30 */
31 cpu_do_idle();
32}
33
34static inline void
35arch_reset(char mode)
36{
37 cpu_reset(0);
38}
39
40#endif
diff --git a/include/asm-arm/arch-imx/timex.h b/include/asm-arm/arch-imx/timex.h
new file mode 100644
index 000000000000..d65ab3cd5d5d
--- /dev/null
+++ b/include/asm-arm/arch-imx/timex.h
@@ -0,0 +1,27 @@
1/*
2 * linux/include/asm-arm/imx/timex.h
3 *
4 * Copyright (C) 1999 ARM Limited
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#ifndef __ASM_ARCH_TIMEX_H
22#define __ASM_ARCH_TIMEX_H
23
24#include <asm/arch/hardware.h>
25#define CLOCK_TICK_RATE (CLK32)
26
27#endif
diff --git a/include/asm-arm/arch-imx/uncompress.h b/include/asm-arm/arch-imx/uncompress.h
new file mode 100644
index 000000000000..096077f2750b
--- /dev/null
+++ b/include/asm-arm/arch-imx/uncompress.h
@@ -0,0 +1,78 @@
1/*
2 * linux/include/asm-arm/arch-imxads/uncompress.h
3 *
4 *
5 *
6 * Copyright (C) 1999 ARM Limited
7 * Copyright (C) Shane Nay (shane@minirl.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 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#define UART(x) (*(volatile unsigned long *)(serial_port + (x)))
25
26#define UART1_BASE 0x206000
27#define UART2_BASE 0x207000
28#define USR2 0x98
29#define USR2_TXFE (1<<14)
30#define TXR 0x40
31#define UCR1 0x80
32#define UCR1_UARTEN 1
33
34/*
35 * The following code assumes the serial port has already been
36 * initialized by the bootloader. We search for the first enabled
37 * port in the most probable order. If you didn't setup a port in
38 * your bootloader then nothing will appear (which might be desired).
39 *
40 * This does not append a newline
41 */
42static void
43putstr(const char *s)
44{
45 unsigned long serial_port;
46
47 do {
48 serial_port = UART1_BASE;
49 if ( UART(UCR1) & UCR1_UARTEN )
50 break;
51 serial_port = UART2_BASE;
52 if ( UART(UCR1) & UCR1_UARTEN )
53 break;
54 return;
55 } while(0);
56
57 while (*s) {
58 while ( !(UART(USR2) & USR2_TXFE) )
59 barrier();
60
61 UART(TXR) = *s;
62
63 if (*s == '\n') {
64 while ( !(UART(USR2) & USR2_TXFE) )
65 barrier();
66
67 UART(TXR) = '\r';
68 }
69 s++;
70 }
71}
72
73/*
74 * nothing to do
75 */
76#define arch_decomp_setup()
77
78#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-imx/vmalloc.h b/include/asm-arm/arch-imx/vmalloc.h
new file mode 100644
index 000000000000..252038f48163
--- /dev/null
+++ b/include/asm-arm/arch-imx/vmalloc.h
@@ -0,0 +1,32 @@
1/*
2 * linux/include/asm-arm/arch-imx/vmalloc.h
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 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/*
22 * Just any arbitrary offset to the start of the vmalloc VM area: the
23 * current 8MB value just means that there will be a 8MB "hole" after the
24 * physical memory until the kernel virtual memory starts. That means that
25 * any out-of-bounds memory accesses will hopefully be caught.
26 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
27 * area for the same reason. ;)
28 */
29#define VMALLOC_OFFSET (8*1024*1024)
30#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
31#define VMALLOC_VMADDR(x) ((unsigned long)(x))
32#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-integrator/bits.h b/include/asm-arm/arch-integrator/bits.h
new file mode 100644
index 000000000000..09b024e0496a
--- /dev/null
+++ b/include/asm-arm/arch-integrator/bits.h
@@ -0,0 +1,61 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 */
16/* DO NOT EDIT!! - this file automatically generated
17 * from .s file by awk -f s2h.awk
18 */
19/* Bit field definitions
20 * Copyright (C) ARM Limited 1998. All rights reserved.
21 */
22
23#ifndef __bits_h
24#define __bits_h 1
25
26#define BIT0 0x00000001
27#define BIT1 0x00000002
28#define BIT2 0x00000004
29#define BIT3 0x00000008
30#define BIT4 0x00000010
31#define BIT5 0x00000020
32#define BIT6 0x00000040
33#define BIT7 0x00000080
34#define BIT8 0x00000100
35#define BIT9 0x00000200
36#define BIT10 0x00000400
37#define BIT11 0x00000800
38#define BIT12 0x00001000
39#define BIT13 0x00002000
40#define BIT14 0x00004000
41#define BIT15 0x00008000
42#define BIT16 0x00010000
43#define BIT17 0x00020000
44#define BIT18 0x00040000
45#define BIT19 0x00080000
46#define BIT20 0x00100000
47#define BIT21 0x00200000
48#define BIT22 0x00400000
49#define BIT23 0x00800000
50#define BIT24 0x01000000
51#define BIT25 0x02000000
52#define BIT26 0x04000000
53#define BIT27 0x08000000
54#define BIT28 0x10000000
55#define BIT29 0x20000000
56#define BIT30 0x40000000
57#define BIT31 0x80000000
58
59#endif
60
61/* END */
diff --git a/include/asm-arm/arch-integrator/cm.h b/include/asm-arm/arch-integrator/cm.h
new file mode 100644
index 000000000000..d31c1a71f781
--- /dev/null
+++ b/include/asm-arm/arch-integrator/cm.h
@@ -0,0 +1,36 @@
1/*
2 * update the core module control register.
3 */
4void cm_control(u32, u32);
5
6#define CM_CTRL_LED (1 << 0)
7#define CM_CTRL_nMBDET (1 << 1)
8#define CM_CTRL_REMAP (1 << 2)
9#define CM_CTRL_RESET (1 << 3)
10
11/*
12 * Integrator/AP,PP2 specific
13 */
14#define CM_CTRL_HIGHVECTORS (1 << 4)
15#define CM_CTRL_BIGENDIAN (1 << 5)
16#define CM_CTRL_FASTBUS (1 << 6)
17#define CM_CTRL_SYNC (1 << 7)
18
19/*
20 * ARM926/946/966 Integrator/CP specific
21 */
22#define CM_CTRL_LCDBIASEN (1 << 8)
23#define CM_CTRL_LCDBIASUP (1 << 9)
24#define CM_CTRL_LCDBIASDN (1 << 10)
25#define CM_CTRL_LCDMUXSEL_MASK (7 << 11)
26#define CM_CTRL_LCDMUXSEL_GENLCD (1 << 11)
27#define CM_CTRL_LCDMUXSEL_SHARPLCD1 (3 << 11)
28#define CM_CTRL_LCDMUXSEL_SHARPLCD2 (4 << 11)
29#define CM_CTRL_LCDMUXSEL_VGA (7 << 11)
30#define CM_CTRL_LCDEN0 (1 << 14)
31#define CM_CTRL_LCDEN1 (1 << 15)
32#define CM_CTRL_STATIC1 (1 << 16)
33#define CM_CTRL_STATIC2 (1 << 17)
34#define CM_CTRL_STATIC (1 << 18)
35#define CM_CTRL_n24BITEN (1 << 19)
36#define CM_CTRL_EBIWP (1 << 20)
diff --git a/include/asm-arm/arch-integrator/debug-macro.S b/include/asm-arm/arch-integrator/debug-macro.S
new file mode 100644
index 000000000000..484a1aa47098
--- /dev/null
+++ b/include/asm-arm/arch-integrator/debug-macro.S
@@ -0,0 +1,38 @@
1/* linux/include/asm-arm/arch-integrator/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 <asm/hardware/amba_serial.h>
15
16 .macro addruart,rx
17 mrc p15, 0, \rx, c1, c0
18 tst \rx, #1 @ MMU enabled?
19 moveq \rx, #0x16000000 @ physical base address
20 movne \rx, #0xf0000000 @ virtual base
21 addne \rx, \rx, #0x16000000 >> 4
22 .endm
23
24 .macro senduart,rd,rx
25 strb \rd, [\rx, #UART01x_DR]
26 .endm
27
28 .macro waituart,rd,rx
291001: ldr \rd, [\rx, #0x18] @ UARTFLG
30 tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full
31 bne 1001b
32 .endm
33
34 .macro busyuart,rd,rx
351001: ldr \rd, [\rx, #0x18] @ UARTFLG
36 tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy
37 bne 1001b
38 .endm
diff --git a/include/asm-arm/arch-integrator/dma.h b/include/asm-arm/arch-integrator/dma.h
new file mode 100644
index 000000000000..7171792290bd
--- /dev/null
+++ b/include/asm-arm/arch-integrator/dma.h
@@ -0,0 +1,28 @@
1/*
2 * linux/include/asm-arm/arch-integrator/dma.h
3 *
4 * Copyright (C) 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 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#ifndef __ASM_ARCH_DMA_H
21#define __ASM_ARCH_DMA_H
22
23#define MAX_DMA_ADDRESS 0xffffffff
24
25#define MAX_DMA_CHANNELS 0
26
27#endif /* _ASM_ARCH_DMA_H */
28
diff --git a/include/asm-arm/arch-integrator/entry-macro.S b/include/asm-arm/arch-integrator/entry-macro.S
new file mode 100644
index 000000000000..44f7ee613194
--- /dev/null
+++ b/include/asm-arm/arch-integrator/entry-macro.S
@@ -0,0 +1,36 @@
1/*
2 * include/asm-arm/arch-integrator/entry-macro.S
3 *
4 * Low-level IRQ helper macros for Integrator platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11 .macro disable_fiq
12 .endm
13
14 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
15/* FIXME: should not be using soo many LDRs here */
16 ldr \base, =IO_ADDRESS(INTEGRATOR_IC_BASE)
17 mov \irqnr, #IRQ_PIC_START
18 ldr \irqstat, [\base, #IRQ_STATUS] @ get masked status
19 ldr \base, =IO_ADDRESS(INTEGRATOR_HDR_BASE)
20 teq \irqstat, #0
21 ldreq \irqstat, [\base, #(INTEGRATOR_HDR_IC_OFFSET+IRQ_STATUS)]
22 moveq \irqnr, #IRQ_CIC_START
23
241001: tst \irqstat, #15
25 bne 1002f
26 add \irqnr, \irqnr, #4
27 movs \irqstat, \irqstat, lsr #4
28 bne 1001b
291002: tst \irqstat, #1
30 bne 1003f
31 add \irqnr, \irqnr, #1
32 movs \irqstat, \irqstat, lsr #1
33 bne 1002b
341003: /* EQ will be set if no irqs pending */
35 .endm
36
diff --git a/include/asm-arm/arch-integrator/hardware.h b/include/asm-arm/arch-integrator/hardware.h
new file mode 100644
index 000000000000..be2716eeaa02
--- /dev/null
+++ b/include/asm-arm/arch-integrator/hardware.h
@@ -0,0 +1,57 @@
1/*
2 * linux/include/asm-arm/arch-integrator/hardware.h
3 *
4 * This file contains the hardware definitions of the Integrator.
5 *
6 * Copyright (C) 1999 ARM Limited.
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#ifndef __ASM_ARCH_HARDWARE_H
23#define __ASM_ARCH_HARDWARE_H
24
25#include <asm/sizes.h>
26#include <asm/arch/platform.h>
27
28/*
29 * Where in virtual memory the IO devices (timers, system controllers
30 * and so on)
31 */
32#define IO_BASE 0xF0000000 // VA of IO
33#define IO_SIZE 0x0B000000 // How much?
34#define IO_START INTEGRATOR_HDR_BASE // PA of IO
35
36/*
37 * Similar to above, but for PCI addresses (memory, IO, Config and the
38 * V3 chip itself). WARNING: this has to mirror definitions in platform.h
39 */
40#define PCI_MEMORY_VADDR 0xe8000000
41#define PCI_CONFIG_VADDR 0xec000000
42#define PCI_V3_VADDR 0xed000000
43#define PCI_IO_VADDR 0xee000000
44
45#define PCIO_BASE PCI_IO_VADDR
46#define PCIMEM_BASE PCI_MEMORY_VADDR
47
48/* macro to get at IO space when running virtually */
49#define IO_ADDRESS(x) (((x) >> 4) + IO_BASE)
50
51#define pcibios_assign_all_busses() 1
52
53#define PCIBIOS_MIN_IO 0x6000
54#define PCIBIOS_MIN_MEM 0x00100000
55
56#endif
57
diff --git a/include/asm-arm/arch-integrator/impd1.h b/include/asm-arm/arch-integrator/impd1.h
new file mode 100644
index 000000000000..d75de4b14237
--- /dev/null
+++ b/include/asm-arm/arch-integrator/impd1.h
@@ -0,0 +1,18 @@
1#define IMPD1_OSC1 0x00
2#define IMPD1_OSC2 0x04
3#define IMPD1_LOCK 0x08
4#define IMPD1_LEDS 0x0c
5#define IMPD1_INT 0x10
6#define IMPD1_SW 0x14
7#define IMPD1_CTRL 0x18
8
9#define IMPD1_CTRL_DISP_LCD (0 << 0)
10#define IMPD1_CTRL_DISP_VGA (1 << 0)
11#define IMPD1_CTRL_DISP_LCD1 (2 << 0)
12#define IMPD1_CTRL_DISP_ENABLE (1 << 2)
13#define IMPD1_CTRL_DISP_MASK (7 << 0)
14
15struct device;
16
17void impd1_tweak_control(struct device *dev, u32 mask, u32 val);
18
diff --git a/include/asm-arm/arch-integrator/io.h b/include/asm-arm/arch-integrator/io.h
new file mode 100644
index 000000000000..fbea8be67d26
--- /dev/null
+++ b/include/asm-arm/arch-integrator/io.h
@@ -0,0 +1,29 @@
1/*
2 * linux/include/asm-arm/arch-integrator/io.h
3 *
4 * Copyright (C) 1999 ARM Limited
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#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22
23#define IO_SPACE_LIMIT 0xffff
24
25#define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a)))
26#define __mem_pci(a) (a)
27#define __mem_isa(a) ((a) + PCI_MEMORY_VADDR)
28
29#endif
diff --git a/include/asm-arm/arch-integrator/irqs.h b/include/asm-arm/arch-integrator/irqs.h
new file mode 100644
index 000000000000..ba7b3afee445
--- /dev/null
+++ b/include/asm-arm/arch-integrator/irqs.h
@@ -0,0 +1,82 @@
1/*
2 * linux/include/asm-arm/arch-integrator/irqs.h
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/*
23 * Interrupt numbers
24 */
25#define IRQ_PIC_START 0
26#define IRQ_SOFTINT 0
27#define IRQ_UARTINT0 1
28#define IRQ_UARTINT1 2
29#define IRQ_KMIINT0 3
30#define IRQ_KMIINT1 4
31#define IRQ_TIMERINT0 5
32#define IRQ_TIMERINT1 6
33#define IRQ_TIMERINT2 7
34#define IRQ_RTCINT 8
35#define IRQ_AP_EXPINT0 9
36#define IRQ_AP_EXPINT1 10
37#define IRQ_AP_EXPINT2 11
38#define IRQ_AP_EXPINT3 12
39#define IRQ_AP_PCIINT0 13
40#define IRQ_AP_PCIINT1 14
41#define IRQ_AP_PCIINT2 15
42#define IRQ_AP_PCIINT3 16
43#define IRQ_AP_V3INT 17
44#define IRQ_AP_CPINT0 18
45#define IRQ_AP_CPINT1 19
46#define IRQ_AP_LBUSTIMEOUT 20
47#define IRQ_AP_APCINT 21
48#define IRQ_CP_CLCDCINT 22
49#define IRQ_CP_MMCIINT0 23
50#define IRQ_CP_MMCIINT1 24
51#define IRQ_CP_AACIINT 25
52#define IRQ_CP_CPPLDINT 26
53#define IRQ_CP_ETHINT 27
54#define IRQ_CP_TSPENINT 28
55#define IRQ_PIC_END 31
56
57#define IRQ_CIC_START 32
58#define IRQ_CM_SOFTINT 32
59#define IRQ_CM_COMMRX 33
60#define IRQ_CM_COMMTX 34
61#define IRQ_CIC_END 34
62
63/*
64 * IntegratorCP only
65 */
66#define IRQ_SIC_START 35
67#define IRQ_SIC_CP_SOFTINT 35
68#define IRQ_SIC_CP_RI0 36
69#define IRQ_SIC_CP_RI1 37
70#define IRQ_SIC_CP_CARDIN 38
71#define IRQ_SIC_CP_LMINT0 39
72#define IRQ_SIC_CP_LMINT1 40
73#define IRQ_SIC_CP_LMINT2 41
74#define IRQ_SIC_CP_LMINT3 42
75#define IRQ_SIC_CP_LMINT4 43
76#define IRQ_SIC_CP_LMINT5 44
77#define IRQ_SIC_CP_LMINT6 45
78#define IRQ_SIC_CP_LMINT7 46
79#define IRQ_SIC_END 46
80
81#define NR_IRQS 47
82
diff --git a/include/asm-arm/arch-integrator/lm.h b/include/asm-arm/arch-integrator/lm.h
new file mode 100644
index 000000000000..28186b6f2c09
--- /dev/null
+++ b/include/asm-arm/arch-integrator/lm.h
@@ -0,0 +1,23 @@
1
2struct lm_device {
3 struct device dev;
4 struct resource resource;
5 unsigned int irq;
6 unsigned int id;
7};
8
9struct lm_driver {
10 struct device_driver drv;
11 int (*probe)(struct lm_device *);
12 void (*remove)(struct lm_device *);
13 int (*suspend)(struct lm_device *, pm_message_t);
14 int (*resume)(struct lm_device *);
15};
16
17int lm_driver_register(struct lm_driver *drv);
18void lm_driver_unregister(struct lm_driver *drv);
19
20int lm_device_register(struct lm_device *dev);
21
22#define lm_get_drvdata(lm) dev_get_drvdata(&(lm)->dev)
23#define lm_set_drvdata(lm,d) dev_set_drvdata(&(lm)->dev, d)
diff --git a/include/asm-arm/arch-integrator/memory.h b/include/asm-arm/arch-integrator/memory.h
new file mode 100644
index 000000000000..2087ea7d28a9
--- /dev/null
+++ b/include/asm-arm/arch-integrator/memory.h
@@ -0,0 +1,39 @@
1/*
2 * linux/include/asm-arm/arch-integrator/memory.h
3 *
4 * Copyright (C) 1999 ARM Limited
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#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H
22
23/*
24 * Physical DRAM offset.
25 */
26#define PHYS_OFFSET (0x00000000UL)
27#define BUS_OFFSET (0x80000000UL)
28
29/*
30 * Virtual view <-> DMA view memory address translations
31 * virt_to_bus: Used to translate the virtual address to an
32 * address suitable to be passed to set_dma_addr
33 * bus_to_virt: Used to convert an address for DMA operations
34 * to an address that the kernel can use.
35 */
36#define __virt_to_bus(x) (x - PAGE_OFFSET + BUS_OFFSET)
37#define __bus_to_virt(x) (x - BUS_OFFSET + PAGE_OFFSET)
38
39#endif
diff --git a/include/asm-arm/arch-integrator/param.h b/include/asm-arm/arch-integrator/param.h
new file mode 100644
index 000000000000..afa582ff3717
--- /dev/null
+++ b/include/asm-arm/arch-integrator/param.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-integrator/param.h
3 *
4 * Copyright (C) 1999 ARM Limited
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 */
diff --git a/include/asm-arm/arch-integrator/platform.h b/include/asm-arm/arch-integrator/platform.h
new file mode 100644
index 000000000000..6b67e41669f4
--- /dev/null
+++ b/include/asm-arm/arch-integrator/platform.h
@@ -0,0 +1,465 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 */
16/* DO NOT EDIT!! - this file automatically generated
17 * from .s file by awk -f s2h.awk
18 */
19/**************************************************************************
20 * * Copyright © ARM Limited 1998. All rights reserved.
21 * ***********************************************************************/
22/* ************************************************************************
23 *
24 * Integrator address map
25 *
26 * NOTE: This is a multi-hosted header file for use with uHAL and
27 * supported debuggers.
28 *
29 * $Id: platform.s,v 1.32 2000/02/18 10:51:39 asims Exp $
30 *
31 * ***********************************************************************/
32
33#ifndef __address_h
34#define __address_h 1
35
36/* ========================================================================
37 * Integrator definitions
38 * ========================================================================
39 * ------------------------------------------------------------------------
40 * Memory definitions
41 * ------------------------------------------------------------------------
42 * Integrator memory map
43 *
44 */
45#define INTEGRATOR_BOOT_ROM_LO 0x00000000
46#define INTEGRATOR_BOOT_ROM_HI 0x20000000
47#define INTEGRATOR_BOOT_ROM_BASE INTEGRATOR_BOOT_ROM_HI /* Normal position */
48#define INTEGRATOR_BOOT_ROM_SIZE SZ_512K
49
50/*
51 * New Core Modules have different amounts of SSRAM, the amount of SSRAM
52 * fitted can be found in HDR_STAT.
53 *
54 * The symbol INTEGRATOR_SSRAM_SIZE is kept, however this now refers to
55 * the minimum amount of SSRAM fitted on any core module.
56 *
57 * New Core Modules also alias the SSRAM.
58 *
59 */
60#define INTEGRATOR_SSRAM_BASE 0x00000000
61#define INTEGRATOR_SSRAM_ALIAS_BASE 0x10800000
62#define INTEGRATOR_SSRAM_SIZE SZ_256K
63
64#define INTEGRATOR_FLASH_BASE 0x24000000
65#define INTEGRATOR_FLASH_SIZE SZ_32M
66
67#define INTEGRATOR_MBRD_SSRAM_BASE 0x28000000
68#define INTEGRATOR_MBRD_SSRAM_SIZE SZ_512K
69
70/*
71 * SDRAM is a SIMM therefore the size is not known.
72 *
73 */
74#define INTEGRATOR_SDRAM_BASE 0x00040000
75
76#define INTEGRATOR_SDRAM_ALIAS_BASE 0x80000000
77#define INTEGRATOR_HDR0_SDRAM_BASE 0x80000000
78#define INTEGRATOR_HDR1_SDRAM_BASE 0x90000000
79#define INTEGRATOR_HDR2_SDRAM_BASE 0xA0000000
80#define INTEGRATOR_HDR3_SDRAM_BASE 0xB0000000
81
82/*
83 * Logic expansion modules
84 *
85 */
86#define INTEGRATOR_LOGIC_MODULES_BASE 0xC0000000
87#define INTEGRATOR_LOGIC_MODULE0_BASE 0xC0000000
88#define INTEGRATOR_LOGIC_MODULE1_BASE 0xD0000000
89#define INTEGRATOR_LOGIC_MODULE2_BASE 0xE0000000
90#define INTEGRATOR_LOGIC_MODULE3_BASE 0xF0000000
91
92/* ------------------------------------------------------------------------
93 * Integrator header card registers
94 * ------------------------------------------------------------------------
95 *
96 */
97#define INTEGRATOR_HDR_ID_OFFSET 0x00
98#define INTEGRATOR_HDR_PROC_OFFSET 0x04
99#define INTEGRATOR_HDR_OSC_OFFSET 0x08
100#define INTEGRATOR_HDR_CTRL_OFFSET 0x0C
101#define INTEGRATOR_HDR_STAT_OFFSET 0x10
102#define INTEGRATOR_HDR_LOCK_OFFSET 0x14
103#define INTEGRATOR_HDR_SDRAM_OFFSET 0x20
104#define INTEGRATOR_HDR_INIT_OFFSET 0x24 /* CM9x6 */
105#define INTEGRATOR_HDR_IC_OFFSET 0x40
106#define INTEGRATOR_HDR_SPDBASE_OFFSET 0x100
107#define INTEGRATOR_HDR_SPDTOP_OFFSET 0x200
108
109#define INTEGRATOR_HDR_BASE 0x10000000
110#define INTEGRATOR_HDR_ID (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_ID_OFFSET)
111#define INTEGRATOR_HDR_PROC (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_PROC_OFFSET)
112#define INTEGRATOR_HDR_OSC (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_OSC_OFFSET)
113#define INTEGRATOR_HDR_CTRL (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_CTRL_OFFSET)
114#define INTEGRATOR_HDR_STAT (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_STAT_OFFSET)
115#define INTEGRATOR_HDR_LOCK (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_LOCK_OFFSET)
116#define INTEGRATOR_HDR_SDRAM (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_SDRAM_OFFSET)
117#define INTEGRATOR_HDR_INIT (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_INIT_OFFSET)
118#define INTEGRATOR_HDR_IC (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_IC_OFFSET)
119#define INTEGRATOR_HDR_SPDBASE (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_SPDBASE_OFFSET)
120#define INTEGRATOR_HDR_SPDTOP (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_SPDTOP_OFFSET)
121
122#define INTEGRATOR_HDR_CTRL_LED 0x01
123#define INTEGRATOR_HDR_CTRL_MBRD_DETECH 0x02
124#define INTEGRATOR_HDR_CTRL_REMAP 0x04
125#define INTEGRATOR_HDR_CTRL_RESET 0x08
126#define INTEGRATOR_HDR_CTRL_HIGHVECTORS 0x10
127#define INTEGRATOR_HDR_CTRL_BIG_ENDIAN 0x20
128#define INTEGRATOR_HDR_CTRL_FASTBUS 0x40
129#define INTEGRATOR_HDR_CTRL_SYNC 0x80
130
131#define INTEGRATOR_HDR_OSC_CORE_10MHz 0x102
132#define INTEGRATOR_HDR_OSC_CORE_15MHz 0x107
133#define INTEGRATOR_HDR_OSC_CORE_20MHz 0x10C
134#define INTEGRATOR_HDR_OSC_CORE_25MHz 0x111
135#define INTEGRATOR_HDR_OSC_CORE_30MHz 0x116
136#define INTEGRATOR_HDR_OSC_CORE_35MHz 0x11B
137#define INTEGRATOR_HDR_OSC_CORE_40MHz 0x120
138#define INTEGRATOR_HDR_OSC_CORE_45MHz 0x125
139#define INTEGRATOR_HDR_OSC_CORE_50MHz 0x12A
140#define INTEGRATOR_HDR_OSC_CORE_55MHz 0x12F
141#define INTEGRATOR_HDR_OSC_CORE_60MHz 0x134
142#define INTEGRATOR_HDR_OSC_CORE_65MHz 0x139
143#define INTEGRATOR_HDR_OSC_CORE_70MHz 0x13E
144#define INTEGRATOR_HDR_OSC_CORE_75MHz 0x143
145#define INTEGRATOR_HDR_OSC_CORE_80MHz 0x148
146#define INTEGRATOR_HDR_OSC_CORE_85MHz 0x14D
147#define INTEGRATOR_HDR_OSC_CORE_90MHz 0x152
148#define INTEGRATOR_HDR_OSC_CORE_95MHz 0x157
149#define INTEGRATOR_HDR_OSC_CORE_100MHz 0x15C
150#define INTEGRATOR_HDR_OSC_CORE_105MHz 0x161
151#define INTEGRATOR_HDR_OSC_CORE_110MHz 0x166
152#define INTEGRATOR_HDR_OSC_CORE_115MHz 0x16B
153#define INTEGRATOR_HDR_OSC_CORE_120MHz 0x170
154#define INTEGRATOR_HDR_OSC_CORE_125MHz 0x175
155#define INTEGRATOR_HDR_OSC_CORE_130MHz 0x17A
156#define INTEGRATOR_HDR_OSC_CORE_135MHz 0x17F
157#define INTEGRATOR_HDR_OSC_CORE_140MHz 0x184
158#define INTEGRATOR_HDR_OSC_CORE_145MHz 0x189
159#define INTEGRATOR_HDR_OSC_CORE_150MHz 0x18E
160#define INTEGRATOR_HDR_OSC_CORE_155MHz 0x193
161#define INTEGRATOR_HDR_OSC_CORE_160MHz 0x198
162#define INTEGRATOR_HDR_OSC_CORE_MASK 0x7FF
163
164#define INTEGRATOR_HDR_OSC_MEM_10MHz 0x10C000
165#define INTEGRATOR_HDR_OSC_MEM_15MHz 0x116000
166#define INTEGRATOR_HDR_OSC_MEM_20MHz 0x120000
167#define INTEGRATOR_HDR_OSC_MEM_25MHz 0x12A000
168#define INTEGRATOR_HDR_OSC_MEM_30MHz 0x134000
169#define INTEGRATOR_HDR_OSC_MEM_33MHz 0x13A000
170#define INTEGRATOR_HDR_OSC_MEM_40MHz 0x148000
171#define INTEGRATOR_HDR_OSC_MEM_50MHz 0x15C000
172#define INTEGRATOR_HDR_OSC_MEM_60MHz 0x170000
173#define INTEGRATOR_HDR_OSC_MEM_66MHz 0x17C000
174#define INTEGRATOR_HDR_OSC_MEM_MASK 0x7FF000
175
176#define INTEGRATOR_HDR_OSC_BUS_MODE_CM7x0 0x0
177#define INTEGRATOR_HDR_OSC_BUS_MODE_CM9x0 0x0800000
178#define INTEGRATOR_HDR_OSC_BUS_MODE_CM9x6 0x1000000
179#define INTEGRATOR_HDR_OSC_BUS_MODE_CM10x00 0x1800000
180#define INTEGRATOR_HDR_OSC_BUS_MODE_MASK 0x1800000
181
182#define INTEGRATOR_HDR_SDRAM_SPD_OK (1 << 5)
183
184
185/* ------------------------------------------------------------------------
186 * Integrator system registers
187 * ------------------------------------------------------------------------
188 *
189 */
190
191/*
192 * System Controller
193 *
194 */
195#define INTEGRATOR_SC_ID_OFFSET 0x00
196#define INTEGRATOR_SC_OSC_OFFSET 0x04
197#define INTEGRATOR_SC_CTRLS_OFFSET 0x08
198#define INTEGRATOR_SC_CTRLC_OFFSET 0x0C
199#define INTEGRATOR_SC_DEC_OFFSET 0x10
200#define INTEGRATOR_SC_ARB_OFFSET 0x14
201#define INTEGRATOR_SC_PCIENABLE_OFFSET 0x18
202#define INTEGRATOR_SC_LOCK_OFFSET 0x1C
203
204#define INTEGRATOR_SC_BASE 0x11000000
205#define INTEGRATOR_SC_ID (INTEGRATOR_SC_BASE + INTEGRATOR_SC_ID_OFFSET)
206#define INTEGRATOR_SC_OSC (INTEGRATOR_SC_BASE + INTEGRATOR_SC_OSC_OFFSET)
207#define INTEGRATOR_SC_CTRLS (INTEGRATOR_SC_BASE + INTEGRATOR_SC_CTRLS_OFFSET)
208#define INTEGRATOR_SC_CTRLC (INTEGRATOR_SC_BASE + INTEGRATOR_SC_CTRLC_OFFSET)
209#define INTEGRATOR_SC_DEC (INTEGRATOR_SC_BASE + INTEGRATOR_SC_DEC_OFFSET)
210#define INTEGRATOR_SC_ARB (INTEGRATOR_SC_BASE + INTEGRATOR_SC_ARB_OFFSET)
211#define INTEGRATOR_SC_PCIENABLE (INTEGRATOR_SC_BASE + INTEGRATOR_SC_PCIENABLE_OFFSET)
212#define INTEGRATOR_SC_LOCK (INTEGRATOR_SC_BASE + INTEGRATOR_SC_LOCK_OFFSET)
213
214#define INTEGRATOR_SC_OSC_SYS_10MHz 0x20
215#define INTEGRATOR_SC_OSC_SYS_15MHz 0x34
216#define INTEGRATOR_SC_OSC_SYS_20MHz 0x48
217#define INTEGRATOR_SC_OSC_SYS_25MHz 0x5C
218#define INTEGRATOR_SC_OSC_SYS_33MHz 0x7C
219#define INTEGRATOR_SC_OSC_SYS_MASK 0xFF
220
221#define INTEGRATOR_SC_OSC_PCI_25MHz 0x100
222#define INTEGRATOR_SC_OSC_PCI_33MHz 0x0
223#define INTEGRATOR_SC_OSC_PCI_MASK 0x100
224
225#define INTEGRATOR_SC_CTRL_SOFTRST (1 << 0)
226#define INTEGRATOR_SC_CTRL_nFLVPPEN (1 << 1)
227#define INTEGRATOR_SC_CTRL_nFLWP (1 << 2)
228#define INTEGRATOR_SC_CTRL_URTS0 (1 << 4)
229#define INTEGRATOR_SC_CTRL_UDTR0 (1 << 5)
230#define INTEGRATOR_SC_CTRL_URTS1 (1 << 6)
231#define INTEGRATOR_SC_CTRL_UDTR1 (1 << 7)
232
233/*
234 * External Bus Interface
235 *
236 */
237#define INTEGRATOR_EBI_BASE 0x12000000
238
239#define INTEGRATOR_EBI_CSR0_OFFSET 0x00
240#define INTEGRATOR_EBI_CSR1_OFFSET 0x04
241#define INTEGRATOR_EBI_CSR2_OFFSET 0x08
242#define INTEGRATOR_EBI_CSR3_OFFSET 0x0C
243#define INTEGRATOR_EBI_LOCK_OFFSET 0x20
244
245#define INTEGRATOR_EBI_CSR0 (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_CSR0_OFFSET)
246#define INTEGRATOR_EBI_CSR1 (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET)
247#define INTEGRATOR_EBI_CSR2 (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_CSR2_OFFSET)
248#define INTEGRATOR_EBI_CSR3 (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_CSR3_OFFSET)
249#define INTEGRATOR_EBI_LOCK (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET)
250
251#define INTEGRATOR_EBI_8_BIT 0x00
252#define INTEGRATOR_EBI_16_BIT 0x01
253#define INTEGRATOR_EBI_32_BIT 0x02
254#define INTEGRATOR_EBI_WRITE_ENABLE 0x04
255#define INTEGRATOR_EBI_SYNC 0x08
256#define INTEGRATOR_EBI_WS_2 0x00
257#define INTEGRATOR_EBI_WS_3 0x10
258#define INTEGRATOR_EBI_WS_4 0x20
259#define INTEGRATOR_EBI_WS_5 0x30
260#define INTEGRATOR_EBI_WS_6 0x40
261#define INTEGRATOR_EBI_WS_7 0x50
262#define INTEGRATOR_EBI_WS_8 0x60
263#define INTEGRATOR_EBI_WS_9 0x70
264#define INTEGRATOR_EBI_WS_10 0x80
265#define INTEGRATOR_EBI_WS_11 0x90
266#define INTEGRATOR_EBI_WS_12 0xA0
267#define INTEGRATOR_EBI_WS_13 0xB0
268#define INTEGRATOR_EBI_WS_14 0xC0
269#define INTEGRATOR_EBI_WS_15 0xD0
270#define INTEGRATOR_EBI_WS_16 0xE0
271#define INTEGRATOR_EBI_WS_17 0xF0
272
273
274#define INTEGRATOR_CT_BASE 0x13000000 /* Counter/Timers */
275#define INTEGRATOR_IC_BASE 0x14000000 /* Interrupt Controller */
276#define INTEGRATOR_RTC_BASE 0x15000000 /* Real Time Clock */
277#define INTEGRATOR_UART0_BASE 0x16000000 /* UART 0 */
278#define INTEGRATOR_UART1_BASE 0x17000000 /* UART 1 */
279#define INTEGRATOR_KBD_BASE 0x18000000 /* Keyboard */
280#define INTEGRATOR_MOUSE_BASE 0x19000000 /* Mouse */
281
282/*
283 * LED's & Switches
284 *
285 */
286#define INTEGRATOR_DBG_ALPHA_OFFSET 0x00
287#define INTEGRATOR_DBG_LEDS_OFFSET 0x04
288#define INTEGRATOR_DBG_SWITCH_OFFSET 0x08
289
290#define INTEGRATOR_DBG_BASE 0x1A000000
291#define INTEGRATOR_DBG_ALPHA (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_ALPHA_OFFSET)
292#define INTEGRATOR_DBG_LEDS (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_LEDS_OFFSET)
293#define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET)
294
295
296#define INTEGRATOR_GPIO_BASE 0x1B000000 /* GPIO */
297
298/* ------------------------------------------------------------------------
299 * KMI keyboard/mouse definitions
300 * ------------------------------------------------------------------------
301 */
302/* PS2 Keyboard interface */
303#define KMI0_BASE INTEGRATOR_KBD_BASE
304
305/* PS2 Mouse interface */
306#define KMI1_BASE INTEGRATOR_MOUSE_BASE
307
308/* KMI definitions are now in include/asm-arm/hardware/amba_kmi.h -- rmk */
309
310/* ------------------------------------------------------------------------
311 * Where in the memory map does PCI live?
312 * ------------------------------------------------------------------------
313 * This represents a fairly liberal usage of address space. Even though
314 * the V3 only has two windows (therefore we need to map stuff on the fly),
315 * we maintain the same addresses, even if they're not mapped.
316 *
317 */
318#define PHYS_PCI_MEM_BASE 0x40000000 /* 512M to xxx */
319/* unused 256M from A0000000-AFFFFFFF might be used for I2O ???
320 */
321#define PHYS_PCI_IO_BASE 0x60000000 /* 16M to xxx */
322/* unused (128-16)M from B1000000-B7FFFFFF
323 */
324#define PHYS_PCI_CONFIG_BASE 0x61000000 /* 16M to xxx */
325/* unused ((128-16)M - 64K) from XXX
326 */
327#define PHYS_PCI_V3_BASE 0x62000000
328
329#define PCI_DRAMSIZE INTEGRATOR_SSRAM_SIZE
330
331/* 'export' these to UHAL */
332#define UHAL_PCI_IO PCI_IO_BASE
333#define UHAL_PCI_MEM PCI_MEM_BASE
334#define UHAL_PCI_ALLOC_IO_BASE 0x00004000
335#define UHAL_PCI_ALLOC_MEM_BASE PCI_MEM_BASE
336#define UHAL_PCI_MAX_SLOT 20
337
338/* ========================================================================
339 * Start of uHAL definitions
340 * ========================================================================
341 */
342
343/* ------------------------------------------------------------------------
344 * Integrator Interrupt Controllers
345 * ------------------------------------------------------------------------
346 *
347 * Offsets from interrupt controller base
348 *
349 * System Controller interrupt controller base is
350 *
351 * INTEGRATOR_IC_BASE + (header_number << 6)
352 *
353 * Core Module interrupt controller base is
354 *
355 * INTEGRATOR_HDR_IC
356 *
357 */
358#define IRQ_STATUS 0
359#define IRQ_RAW_STATUS 0x04
360#define IRQ_ENABLE 0x08
361#define IRQ_ENABLE_SET 0x08
362#define IRQ_ENABLE_CLEAR 0x0C
363
364#define INT_SOFT_SET 0x10
365#define INT_SOFT_CLEAR 0x14
366
367#define FIQ_STATUS 0x20
368#define FIQ_RAW_STATUS 0x24
369#define FIQ_ENABLE 0x28
370#define FIQ_ENABLE_SET 0x28
371#define FIQ_ENABLE_CLEAR 0x2C
372
373
374/* ------------------------------------------------------------------------
375 * Interrupts
376 * ------------------------------------------------------------------------
377 *
378 *
379 * Each Core Module has two interrupts controllers, one on the core module
380 * itself and one in the system controller on the motherboard. The
381 * READ_INT macro in target.s reads both interrupt controllers and returns
382 * a 32 bit bitmask, bits 0 to 23 are interrupts from the system controller
383 * and bits 24 to 31 are from the core module.
384 *
385 * The following definitions relate to the bitmask returned by READ_INT.
386 *
387 */
388
389/* ------------------------------------------------------------------------
390 * LED's - The header LED is not accessible via the uHAL API
391 * ------------------------------------------------------------------------
392 *
393 */
394#define GREEN_LED 0x01
395#define YELLOW_LED 0x02
396#define RED_LED 0x04
397#define GREEN_LED_2 0x08
398#define ALL_LEDS 0x0F
399
400#define LED_BANK INTEGRATOR_DBG_LEDS
401
402/*
403 * Memory definitions - run uHAL out of SSRAM.
404 *
405 */
406#define uHAL_MEMORY_SIZE INTEGRATOR_SSRAM_SIZE
407
408/*
409 * Application Flash
410 *
411 */
412#define FLASH_BASE INTEGRATOR_FLASH_BASE
413#define FLASH_SIZE INTEGRATOR_FLASH_SIZE
414#define FLASH_END (FLASH_BASE + FLASH_SIZE - 1)
415#define FLASH_BLOCK_SIZE SZ_128K
416
417/*
418 * Boot Flash
419 *
420 */
421#define EPROM_BASE INTEGRATOR_BOOT_ROM_HI
422#define EPROM_SIZE INTEGRATOR_BOOT_ROM_SIZE
423#define EPROM_END (EPROM_BASE + EPROM_SIZE - 1)
424
425/*
426 * Clean base - dummy
427 *
428 */
429#define CLEAN_BASE EPROM_BASE
430
431/*
432 * Timer definitions
433 *
434 * Only use timer 1 & 2
435 * (both run at 24MHz and will need the clock divider set to 16).
436 *
437 * Timer 0 runs at bus frequency and therefore could vary and currently
438 * uHAL can't handle that.
439 *
440 */
441
442#define INTEGRATOR_TIMER0_BASE INTEGRATOR_CT_BASE
443#define INTEGRATOR_TIMER1_BASE (INTEGRATOR_CT_BASE + 0x100)
444#define INTEGRATOR_TIMER2_BASE (INTEGRATOR_CT_BASE + 0x200)
445
446#define MAX_TIMER 2
447#define MAX_PERIOD 699050
448#define TICKS_PER_uSEC 24
449
450/*
451 * These are useconds NOT ticks.
452 *
453 */
454#define mSEC_1 1000
455#define mSEC_5 (mSEC_1 * 5)
456#define mSEC_10 (mSEC_1 * 10)
457#define mSEC_25 (mSEC_1 * 25)
458#define SEC_1 (mSEC_1 * 1000)
459
460#define INTEGRATOR_CSR_BASE 0x10000000
461#define INTEGRATOR_CSR_SIZE 0x10000000
462
463#endif
464
465/* END */
diff --git a/include/asm-arm/arch-integrator/system.h b/include/asm-arm/arch-integrator/system.h
new file mode 100644
index 000000000000..8ea442237d20
--- /dev/null
+++ b/include/asm-arm/arch-integrator/system.h
@@ -0,0 +1,44 @@
1/*
2 * linux/include/asm-arm/arch-integrator/system.h
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#ifndef __ASM_ARCH_SYSTEM_H
22#define __ASM_ARCH_SYSTEM_H
23
24#include <asm/arch/cm.h>
25
26static inline void arch_idle(void)
27{
28 /*
29 * This should do all the clock switching
30 * and wait for interrupt tricks
31 */
32 cpu_do_idle();
33}
34
35static inline void arch_reset(char mode)
36{
37 /*
38 * To reset, we hit the on-board reset register
39 * in the system FPGA
40 */
41 cm_control(CM_CTRL_RESET, CM_CTRL_RESET);
42}
43
44#endif
diff --git a/include/asm-arm/arch-integrator/timex.h b/include/asm-arm/arch-integrator/timex.h
new file mode 100644
index 000000000000..87a762818ba2
--- /dev/null
+++ b/include/asm-arm/arch-integrator/timex.h
@@ -0,0 +1,26 @@
1/*
2 * linux/include/asm-arm/arch-integrator/timex.h
3 *
4 * Integrator architecture timex specifications
5 *
6 * Copyright (C) 1999 ARM Limited
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/*
24 * ??
25 */
26#define CLOCK_TICK_RATE (50000000 / 16)
diff --git a/include/asm-arm/arch-integrator/uncompress.h b/include/asm-arm/arch-integrator/uncompress.h
new file mode 100644
index 000000000000..3957402741d3
--- /dev/null
+++ b/include/asm-arm/arch-integrator/uncompress.h
@@ -0,0 +1,53 @@
1/*
2 * linux/include/asm-arm/arch-integrator/uncompress.h
3 *
4 * Copyright (C) 1999 ARM Limited
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#define AMBA_UART_DR (*(volatile unsigned char *)0x16000000)
22#define AMBA_UART_LCRH (*(volatile unsigned char *)0x16000008)
23#define AMBA_UART_LCRM (*(volatile unsigned char *)0x1600000c)
24#define AMBA_UART_LCRL (*(volatile unsigned char *)0x16000010)
25#define AMBA_UART_CR (*(volatile unsigned char *)0x16000014)
26#define AMBA_UART_FR (*(volatile unsigned char *)0x16000018)
27
28/*
29 * This does not append a newline
30 */
31static void putstr(const char *s)
32{
33 while (*s) {
34 while (AMBA_UART_FR & (1 << 5));
35
36 AMBA_UART_DR = *s;
37
38 if (*s == '\n') {
39 while (AMBA_UART_FR & (1 << 5));
40
41 AMBA_UART_DR = '\r';
42 }
43 s++;
44 }
45 while (AMBA_UART_FR & (1 << 3));
46}
47
48/*
49 * nothing to do
50 */
51#define arch_decomp_setup()
52
53#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-integrator/vmalloc.h b/include/asm-arm/arch-integrator/vmalloc.h
new file mode 100644
index 000000000000..50e9aee79486
--- /dev/null
+++ b/include/asm-arm/arch-integrator/vmalloc.h
@@ -0,0 +1,31 @@
1/*
2 * linux/include/asm-arm/arch-integrator/vmalloc.h
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 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/*
22 * Just any arbitrary offset to the start of the vmalloc VM area: the
23 * current 8MB value just means that there will be a 8MB "hole" after the
24 * physical memory until the kernel virtual memory starts. That means that
25 * any out-of-bounds memory accesses will hopefully be caught.
26 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
27 * area for the same reason. ;)
28 */
29#define VMALLOC_OFFSET (8*1024*1024)
30#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
31#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-iop3xx/debug-macro.S b/include/asm-arm/arch-iop3xx/debug-macro.S
new file mode 100644
index 000000000000..cc15f80ebd9a
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/debug-macro.S
@@ -0,0 +1,48 @@
1/* linux/include/asm-arm/arch-iop3xx/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .macro addruart,rx
15 mov \rx, #0xfe000000 @ physical
16#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244)
17 orr \rx, \rx, #0x00800000 @ location of the UART
18#elif defined(CONFIG_ARCH_IOP331)
19 mrc p15, 0, \rx, c1, c0
20 tst \rx, #1 @ MMU enabled?
21 moveq \rx, #0x000fe000 @ Physical Base
22 movne \rx, #0
23 orr \rx, \rx, #0xfe000000
24 orr \rx, \rx, #0x00f00000 @ Virtual Base
25 orr \rx, \rx, #0x00001700 @ location of the UART
26#else
27#error Unknown IOP3XX implementation
28#endif
29 .endm
30
31 .macro senduart,rd,rx
32 strb \rd, [\rx]
33 .endm
34
35 .macro busyuart,rd,rx
361002: ldrb \rd, [\rx, #0x5]
37 and \rd, \rd, #0x60
38 teq \rd, #0x60
39 bne 1002b
40 .endm
41
42 .macro waituart,rd,rx
43#if !defined(CONFIG_ARCH_IQ80321) || !defined(CONFIG_ARCH_IQ31244) || !defined(CONFIG_ARCH_IQ80331)
441001: ldrb \rd, [\rx, #0x6]
45 tst \rd, #0x10
46 beq 1001b
47#endif
48 .endm
diff --git a/include/asm-arm/arch-iop3xx/dma.h b/include/asm-arm/arch-iop3xx/dma.h
new file mode 100644
index 000000000000..797f9e6fc745
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/dma.h
@@ -0,0 +1,16 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/dma.h
3 *
4 * Copyright (C) 2004 Intel Corp.
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#ifndef _IOP3XX_DMA_H_P
12#define _IOP3XX_DMA_H_P
13
14#define MAX_DMA_ADDRESS 0xffffffff
15
16#endif /* _ASM_ARCH_DMA_H_P */
diff --git a/include/asm-arm/arch-iop3xx/entry-macro.S b/include/asm-arm/arch-iop3xx/entry-macro.S
new file mode 100644
index 000000000000..e2ce7f5467c8
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/entry-macro.S
@@ -0,0 +1,56 @@
1/*
2 * include/asm-arm/arch-iop3xx/entry-macro.S
3 *
4 * Low-level IRQ helper macros for IOP3xx-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#if defined(CONFIG_ARCH_IOP321)
12 .macro disable_fiq
13 .endm
14
15 /*
16 * Note: only deal with normal interrupts, not FIQ
17 */
18 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
19 mov \irqnr, #0
20 mrc p6, 0, \irqstat, c8, c0, 0 @ Read IINTSRC
21 cmp \irqstat, #0
22 beq 1001f
23 clz \irqnr, \irqstat
24 mov \base, #31
25 subs \irqnr,\base,\irqnr
26 add \irqnr,\irqnr,#IRQ_IOP321_DMA0_EOT
271001:
28 .endm
29
30#elif defined(CONFIG_ARCH_IOP331)
31 .macro disable_fiq
32 .endm
33
34 /*
35 * Note: only deal with normal interrupts, not FIQ
36 */
37 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
38 mov \irqnr, #0
39 mrc p6, 0, \irqstat, c4, c0, 0 @ Read IINTSRC0
40 cmp \irqstat, #0
41 bne 1002f
42 mrc p6, 0, \irqstat, c5, c0, 0 @ Read IINTSRC1
43 cmp \irqstat, #0
44 beq 1001f
45 clz \irqnr, \irqstat
46 rsbs \irqnr,\irqnr,#31 @ recommend by RMK
47 add \irqnr,\irqnr,#IRQ_IOP331_XINT8
48 b 1001f
491002: clz \irqnr, \irqstat
50 rsbs \irqnr,\irqnr,#31 @ recommend by RMK
51 add \irqnr,\irqnr,#IRQ_IOP331_DMA0_EOT
521001:
53 .endm
54
55#endif
56
diff --git a/include/asm-arm/arch-iop3xx/hardware.h b/include/asm-arm/arch-iop3xx/hardware.h
new file mode 100644
index 000000000000..3b138171d086
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/hardware.h
@@ -0,0 +1,57 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/hardware.h
3 */
4#ifndef __ASM_ARCH_HARDWARE_H
5#define __ASM_ARCH_HARDWARE_H
6
7#include <asm/types.h>
8
9/*
10 * Note about PCI IO space mappings
11 *
12 * To make IO space accesses efficient, we store virtual addresses in
13 * the IO resources.
14 *
15 * The PCI IO space is located at virtual 0xfe000000 from physical
16 * 0x90000000. The PCI BARs must be programmed with physical addresses,
17 * but when we read them, we convert them to virtual addresses. See
18 * arch/arm/mach-iop3xx/iop3xx-pci.c
19 */
20
21#define pcibios_assign_all_busses() 1
22
23
24/*
25 * The min PCI I/O and MEM space are dependent on what specific
26 * chipset/platform we are running on, so instead of hardcoding with
27 * #ifdefs, we just fill these in the platform level PCI init code.
28 */
29#ifndef __ASSEMBLY__
30extern unsigned long iop3xx_pcibios_min_io;
31extern unsigned long iop3xx_pcibios_min_mem;
32
33extern unsigned int processor_id;
34#endif
35
36/*
37 * We just set these to zero since they are really bogus anyways
38 */
39#define PCIBIOS_MIN_IO (iop3xx_pcibios_min_io)
40#define PCIBIOS_MIN_MEM (iop3xx_pcibios_min_mem)
41
42/*
43 * Generic chipset bits
44 *
45 */
46#include "iop321.h"
47#include "iop331.h"
48
49/*
50 * Board specific bits
51 */
52#include "iq80321.h"
53#include "iq31244.h"
54#include "iq80331.h"
55#include "iq80332.h"
56
57#endif /* _ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-iop3xx/io.h b/include/asm-arm/arch-iop3xx/io.h
new file mode 100644
index 000000000000..2761dfd8694d
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/io.h
@@ -0,0 +1,20 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/io.h
3 *
4 * Copyright (C) 2001 MontaVista Software, 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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARM_ARCH_IO_H
12#define __ASM_ARM_ARCH_IO_H
13
14#define IO_SPACE_LIMIT 0xffffffff
15
16#define __io(p) ((void __iomem *)(p))
17#define __mem_pci(a) (a)
18#define __mem_isa(a) (a)
19
20#endif
diff --git a/include/asm-arm/arch-iop3xx/iop321-irqs.h b/include/asm-arm/arch-iop3xx/iop321-irqs.h
new file mode 100644
index 000000000000..2fcc1654cb9d
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/iop321-irqs.h
@@ -0,0 +1,100 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/irqs.h
3 *
4 * Author: Rory Bolt <rorybolt@pacbell.net>
5 * Copyright: (C) 2002 Rory Bolt
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#ifndef _IOP321_IRQS_H_
13#define _IOP321_IRQS_H_
14
15/*
16 * IOP80321 chipset interrupts
17 */
18#define IOP321_IRQ_OFS 0
19#define IOP321_IRQ(x) (IOP321_IRQ_OFS + (x))
20
21/*
22 * On IRQ or FIQ register
23 */
24#define IRQ_IOP321_DMA0_EOT IOP321_IRQ(0)
25#define IRQ_IOP321_DMA0_EOC IOP321_IRQ(1)
26#define IRQ_IOP321_DMA1_EOT IOP321_IRQ(2)
27#define IRQ_IOP321_DMA1_EOC IOP321_IRQ(3)
28#define IRQ_IOP321_RSVD_4 IOP321_IRQ(4)
29#define IRQ_IOP321_RSVD_5 IOP321_IRQ(5)
30#define IRQ_IOP321_AA_EOT IOP321_IRQ(6)
31#define IRQ_IOP321_AA_EOC IOP321_IRQ(7)
32#define IRQ_IOP321_CORE_PMON IOP321_IRQ(8)
33#define IRQ_IOP321_TIMER0 IOP321_IRQ(9)
34#define IRQ_IOP321_TIMER1 IOP321_IRQ(10)
35#define IRQ_IOP321_I2C_0 IOP321_IRQ(11)
36#define IRQ_IOP321_I2C_1 IOP321_IRQ(12)
37#define IRQ_IOP321_MESSAGING IOP321_IRQ(13)
38#define IRQ_IOP321_ATU_BIST IOP321_IRQ(14)
39#define IRQ_IOP321_PERFMON IOP321_IRQ(15)
40#define IRQ_IOP321_CORE_PMU IOP321_IRQ(16)
41#define IRQ_IOP321_BIU_ERR IOP321_IRQ(17)
42#define IRQ_IOP321_ATU_ERR IOP321_IRQ(18)
43#define IRQ_IOP321_MCU_ERR IOP321_IRQ(19)
44#define IRQ_IOP321_DMA0_ERR IOP321_IRQ(20)
45#define IRQ_IOP321_DMA1_ERR IOP321_IRQ(21)
46#define IRQ_IOP321_RSVD_22 IOP321_IRQ(22)
47#define IRQ_IOP321_AA_ERR IOP321_IRQ(23)
48#define IRQ_IOP321_MSG_ERR IOP321_IRQ(24)
49#define IRQ_IOP321_SSP IOP321_IRQ(25)
50#define IRQ_IOP321_RSVD_26 IOP321_IRQ(26)
51#define IRQ_IOP321_XINT0 IOP321_IRQ(27)
52#define IRQ_IOP321_XINT1 IOP321_IRQ(28)
53#define IRQ_IOP321_XINT2 IOP321_IRQ(29)
54#define IRQ_IOP321_XINT3 IOP321_IRQ(30)
55#define IRQ_IOP321_HPI IOP321_IRQ(31)
56
57#define NR_IOP321_IRQS (IOP321_IRQ(31) + 1)
58
59#define NR_IRQS NR_IOP321_IRQS
60
61
62/*
63 * Interrupts available on the IQ80321 board
64 */
65
66/*
67 * On board devices
68 */
69#define IRQ_IQ80321_I82544 IRQ_IOP321_XINT0
70#define IRQ_IQ80321_UART IRQ_IOP321_XINT1
71
72/*
73 * PCI interrupts
74 */
75#define IRQ_IQ80321_INTA IRQ_IOP321_XINT0
76#define IRQ_IQ80321_INTB IRQ_IOP321_XINT1
77#define IRQ_IQ80321_INTC IRQ_IOP321_XINT2
78#define IRQ_IQ80321_INTD IRQ_IOP321_XINT3
79
80/*
81 * Interrupts on the IQ31244 board
82 */
83
84/*
85 * On board devices
86 */
87#define IRQ_IQ31244_UART IRQ_IOP321_XINT1
88#define IRQ_IQ31244_I82546 IRQ_IOP321_XINT0
89#define IRQ_IQ31244_SATA IRQ_IOP321_XINT2
90#define IRQ_IQ31244_PCIX_SLOT IRQ_IOP321_XINT3
91
92/*
93 * PCI interrupts
94 */
95#define IRQ_IQ31244_INTA IRQ_IOP321_XINT0
96#define IRQ_IQ31244_INTB IRQ_IOP321_XINT1
97#define IRQ_IQ31244_INTC IRQ_IOP321_XINT2
98#define IRQ_IQ31244_INTD IRQ_IOP321_XINT3
99
100#endif // _IOP321_IRQ_H_
diff --git a/include/asm-arm/arch-iop3xx/iop321.h b/include/asm-arm/arch-iop3xx/iop321.h
new file mode 100644
index 000000000000..200621ff3690
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/iop321.h
@@ -0,0 +1,345 @@
1/*
2 * linux/include/asm/arch-iop3xx/iop321.h
3 *
4 * Intel IOP321 Chip definitions
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
15#ifndef _IOP321_HW_H_
16#define _IOP321_HW_H_
17
18
19/*
20 * This is needed for mixed drivers that need to work on all
21 * IOP3xx variants but behave slightly differently on each.
22 */
23#ifndef __ASSEMBLY__
24#ifdef CONFIG_ARCH_IOP321
25#define iop_is_321() (((processor_id & 0xfffff5e0) == 0x69052420))
26#else
27#define iop_is_321() 0
28#endif
29#endif
30
31/*
32 * IOP321 I/O and Mem space regions for PCI autoconfiguration
33 */
34#define IOP321_PCI_IO_WINDOW_SIZE 0x00010000
35#define IOP321_PCI_LOWER_IO_PA 0x90000000
36#define IOP321_PCI_LOWER_IO_VA 0xfe000000
37#define IOP321_PCI_LOWER_IO_BA (*IOP321_OIOWTVR)
38#define IOP321_PCI_UPPER_IO_PA (IOP321_PCI_LOWER_IO_PA + IOP321_PCI_IO_WINDOW_SIZE - 1)
39#define IOP321_PCI_UPPER_IO_VA (IOP321_PCI_LOWER_IO_VA + IOP321_PCI_IO_WINDOW_SIZE - 1)
40#define IOP321_PCI_UPPER_IO_BA (IOP321_PCI_LOWER_IO_BA + IOP321_PCI_IO_WINDOW_SIZE - 1)
41#define IOP321_PCI_IO_OFFSET (IOP321_PCI_LOWER_IO_VA - IOP321_PCI_LOWER_IO_BA)
42
43//#define IOP321_PCI_MEM_WINDOW_SIZE (~*IOP321_IALR1 + 1)
44#define IOP321_PCI_MEM_WINDOW_SIZE 0x04000000 /* 64M outbound window */
45#define IOP321_PCI_LOWER_MEM_PA 0x80000000
46#define IOP321_PCI_LOWER_MEM_BA (*IOP321_OMWTVR0)
47#define IOP321_PCI_UPPER_MEM_PA (IOP321_PCI_LOWER_MEM_PA + IOP321_PCI_MEM_WINDOW_SIZE - 1)
48#define IOP321_PCI_UPPER_MEM_BA (IOP321_PCI_LOWER_MEM_BA + IOP321_PCI_MEM_WINDOW_SIZE - 1)
49#define IOP321_PCI_MEM_OFFSET (IOP321_PCI_LOWER_MEM_PA - IOP321_PCI_LOWER_MEM_BA)
50
51
52/*
53 * IOP321 chipset registers
54 */
55#define IOP321_VIRT_MEM_BASE 0xfeffe000 /* chip virtual mem address*/
56#define IOP321_PHYS_MEM_BASE 0xffffe000 /* chip physical memory address */
57#define IOP321_REG_ADDR(reg) (IOP321_VIRT_MEM_BASE | (reg))
58
59/* Reserved 0x00000000 through 0x000000FF */
60
61/* Address Translation Unit 0x00000100 through 0x000001FF */
62#define IOP321_ATUVID (volatile u16 *)IOP321_REG_ADDR(0x00000100)
63#define IOP321_ATUDID (volatile u16 *)IOP321_REG_ADDR(0x00000102)
64#define IOP321_ATUCMD (volatile u16 *)IOP321_REG_ADDR(0x00000104)
65#define IOP321_ATUSR (volatile u16 *)IOP321_REG_ADDR(0x00000106)
66#define IOP321_ATURID (volatile u8 *)IOP321_REG_ADDR(0x00000108)
67#define IOP321_ATUCCR (volatile u32 *)IOP321_REG_ADDR(0x00000109)
68#define IOP321_ATUCLSR (volatile u8 *)IOP321_REG_ADDR(0x0000010C)
69#define IOP321_ATULT (volatile u8 *)IOP321_REG_ADDR(0x0000010D)
70#define IOP321_ATUHTR (volatile u8 *)IOP321_REG_ADDR(0x0000010E)
71#define IOP321_ATUBIST (volatile u8 *)IOP321_REG_ADDR(0x0000010F)
72#define IOP321_IABAR0 (volatile u32 *)IOP321_REG_ADDR(0x00000110)
73#define IOP321_IAUBAR0 (volatile u32 *)IOP321_REG_ADDR(0x00000114)
74#define IOP321_IABAR1 (volatile u32 *)IOP321_REG_ADDR(0x00000118)
75#define IOP321_IAUBAR1 (volatile u32 *)IOP321_REG_ADDR(0x0000011C)
76#define IOP321_IABAR2 (volatile u32 *)IOP321_REG_ADDR(0x00000120)
77#define IOP321_IAUBAR2 (volatile u32 *)IOP321_REG_ADDR(0x00000124)
78#define IOP321_ASVIR (volatile u16 *)IOP321_REG_ADDR(0x0000012C)
79#define IOP321_ASIR (volatile u16 *)IOP321_REG_ADDR(0x0000012E)
80#define IOP321_ERBAR (volatile u32 *)IOP321_REG_ADDR(0x00000130)
81/* Reserved 0x00000134 through 0x0000013B */
82#define IOP321_ATUILR (volatile u8 *)IOP321_REG_ADDR(0x0000013C)
83#define IOP321_ATUIPR (volatile u8 *)IOP321_REG_ADDR(0x0000013D)
84#define IOP321_ATUMGNT (volatile u8 *)IOP321_REG_ADDR(0x0000013E)
85#define IOP321_ATUMLAT (volatile u8 *)IOP321_REG_ADDR(0x0000013F)
86#define IOP321_IALR0 (volatile u32 *)IOP321_REG_ADDR(0x00000140)
87#define IOP321_IATVR0 (volatile u32 *)IOP321_REG_ADDR(0x00000144)
88#define IOP321_ERLR (volatile u32 *)IOP321_REG_ADDR(0x00000148)
89#define IOP321_ERTVR (volatile u32 *)IOP321_REG_ADDR(0x0000014C)
90#define IOP321_IALR1 (volatile u32 *)IOP321_REG_ADDR(0x00000150)
91#define IOP321_IALR2 (volatile u32 *)IOP321_REG_ADDR(0x00000154)
92#define IOP321_IATVR2 (volatile u32 *)IOP321_REG_ADDR(0x00000158)
93#define IOP321_OIOWTVR (volatile u32 *)IOP321_REG_ADDR(0x0000015C)
94#define IOP321_OMWTVR0 (volatile u32 *)IOP321_REG_ADDR(0x00000160)
95#define IOP321_OUMWTVR0 (volatile u32 *)IOP321_REG_ADDR(0x00000164)
96#define IOP321_OMWTVR1 (volatile u32 *)IOP321_REG_ADDR(0x00000168)
97#define IOP321_OUMWTVR1 (volatile u32 *)IOP321_REG_ADDR(0x0000016C)
98/* Reserved 0x00000170 through 0x00000177*/
99#define IOP321_OUDWTVR (volatile u32 *)IOP321_REG_ADDR(0x00000178)
100/* Reserved 0x0000017C through 0x0000017F*/
101#define IOP321_ATUCR (volatile u32 *)IOP321_REG_ADDR(0x00000180)
102#define IOP321_PCSR (volatile u32 *)IOP321_REG_ADDR(0x00000184)
103#define IOP321_ATUISR (volatile u32 *)IOP321_REG_ADDR(0x00000188)
104#define IOP321_ATUIMR (volatile u32 *)IOP321_REG_ADDR(0x0000018C)
105#define IOP321_IABAR3 (volatile u32 *)IOP321_REG_ADDR(0x00000190)
106#define IOP321_IAUBAR3 (volatile u32 *)IOP321_REG_ADDR(0x00000194)
107#define IOP321_IALR3 (volatile u32 *)IOP321_REG_ADDR(0x00000198)
108#define IOP321_IATVR3 (volatile u32 *)IOP321_REG_ADDR(0x0000019C)
109/* Reserved 0x000001A0 through 0x000001A3*/
110#define IOP321_OCCAR (volatile u32 *)IOP321_REG_ADDR(0x000001A4)
111/* Reserved 0x000001A8 through 0x000001AB*/
112#define IOP321_OCCDR (volatile u32 *)IOP321_REG_ADDR(0x000001AC)
113/* Reserved 0x000001B0 through 0x000001BB*/
114#define IOP321_PDSCR (volatile u32 *)IOP321_REG_ADDR(0x000001BC)
115#define IOP321_PMCAPID (volatile u8 *)IOP321_REG_ADDR(0x000001C0)
116#define IOP321_PMNEXT (volatile u8 *)IOP321_REG_ADDR(0x000001C1)
117#define IOP321_APMCR (volatile u16 *)IOP321_REG_ADDR(0x000001C2)
118#define IOP321_APMCSR (volatile u16 *)IOP321_REG_ADDR(0x000001C4)
119/* Reserved 0x000001C6 through 0x000001DF */
120#define IOP321_PCIXCAPID (volatile u8 *)IOP321_REG_ADDR(0x000001E0)
121#define IOP321_PCIXNEXT (volatile u8 *)IOP321_REG_ADDR(0x000001E1)
122#define IOP321_PCIXCMD (volatile u16 *)IOP321_REG_ADDR(0x000001E2)
123#define IOP321_PCIXSR (volatile u32 *)IOP321_REG_ADDR(0x000001E4)
124#define IOP321_PCIIRSR (volatile u32 *)IOP321_REG_ADDR(0x000001EC)
125
126/* Messaging Unit 0x00000300 through 0x000003FF */
127
128/* Reserved 0x00000300 through 0x0000030c */
129#define IOP321_IMR0 (volatile u32 *)IOP321_REG_ADDR(0x00000310)
130#define IOP321_IMR1 (volatile u32 *)IOP321_REG_ADDR(0x00000314)
131#define IOP321_OMR0 (volatile u32 *)IOP321_REG_ADDR(0x00000318)
132#define IOP321_OMR1 (volatile u32 *)IOP321_REG_ADDR(0x0000031C)
133#define IOP321_IDR (volatile u32 *)IOP321_REG_ADDR(0x00000320)
134#define IOP321_IISR (volatile u32 *)IOP321_REG_ADDR(0x00000324)
135#define IOP321_IIMR (volatile u32 *)IOP321_REG_ADDR(0x00000328)
136#define IOP321_ODR (volatile u32 *)IOP321_REG_ADDR(0x0000032C)
137#define IOP321_OISR (volatile u32 *)IOP321_REG_ADDR(0x00000330)
138#define IOP321_OIMR (volatile u32 *)IOP321_REG_ADDR(0x00000334)
139/* Reserved 0x00000338 through 0x0000034F */
140#define IOP321_MUCR (volatile u32 *)IOP321_REG_ADDR(0x00000350)
141#define IOP321_QBAR (volatile u32 *)IOP321_REG_ADDR(0x00000354)
142/* Reserved 0x00000358 through 0x0000035C */
143#define IOP321_IFHPR (volatile u32 *)IOP321_REG_ADDR(0x00000360)
144#define IOP321_IFTPR (volatile u32 *)IOP321_REG_ADDR(0x00000364)
145#define IOP321_IPHPR (volatile u32 *)IOP321_REG_ADDR(0x00000368)
146#define IOP321_IPTPR (volatile u32 *)IOP321_REG_ADDR(0x0000036C)
147#define IOP321_OFHPR (volatile u32 *)IOP321_REG_ADDR(0x00000370)
148#define IOP321_OFTPR (volatile u32 *)IOP321_REG_ADDR(0x00000374)
149#define IOP321_OPHPR (volatile u32 *)IOP321_REG_ADDR(0x00000378)
150#define IOP321_OPTPR (volatile u32 *)IOP321_REG_ADDR(0x0000037C)
151#define IOP321_IAR (volatile u32 *)IOP321_REG_ADDR(0x00000380)
152
153#define IOP321_IIxR_MASK 0x7f /* masks all */
154#define IOP321_IIxR_IRI 0x40 /* RC Index Register Interrupt */
155#define IOP321_IIxR_OFQF 0x20 /* RC Output Free Q Full (ERROR) */
156#define IOP321_IIxR_ipq 0x10 /* RC Inbound Post Q (post) */
157#define IOP321_IIxR_ERRDI 0x08 /* RO Error Doorbell Interrupt */
158#define IOP321_IIxR_IDI 0x04 /* RO Inbound Doorbell Interrupt */
159#define IOP321_IIxR_IM1 0x02 /* RC Inbound Message 1 Interrupt */
160#define IOP321_IIxR_IM0 0x01 /* RC Inbound Message 0 Interrupt */
161
162/* Reserved 0x00000384 through 0x000003FF */
163
164/* DMA Controller 0x00000400 through 0x000004FF */
165#define IOP321_DMA0_CCR (volatile u32 *)IOP321_REG_ADDR(0x00000400)
166#define IOP321_DMA0_CSR (volatile u32 *)IOP321_REG_ADDR(0x00000404)
167#define IOP321_DMA0_DAR (volatile u32 *)IOP321_REG_ADDR(0x0000040C)
168#define IOP321_DMA0_NDAR (volatile u32 *)IOP321_REG_ADDR(0x00000410)
169#define IOP321_DMA0_PADR (volatile u32 *)IOP321_REG_ADDR(0x00000414)
170#define IOP321_DMA0_PUADR (volatile u32 *)IOP321_REG_ADDR(0x00000418)
171#define IOP321_DMA0_LADR (volatile u32 *)IOP321_REG_ADDR(0X0000041C)
172#define IOP321_DMA0_BCR (volatile u32 *)IOP321_REG_ADDR(0x00000420)
173#define IOP321_DMA0_DCR (volatile u32 *)IOP321_REG_ADDR(0x00000424)
174/* Reserved 0x00000428 through 0x0000043C */
175#define IOP321_DMA1_CCR (volatile u32 *)IOP321_REG_ADDR(0x00000440)
176#define IOP321_DMA1_CSR (volatile u32 *)IOP321_REG_ADDR(0x00000444)
177#define IOP321_DMA1_DAR (volatile u32 *)IOP321_REG_ADDR(0x0000044C)
178#define IOP321_DMA1_NDAR (volatile u32 *)IOP321_REG_ADDR(0x00000450)
179#define IOP321_DMA1_PADR (volatile u32 *)IOP321_REG_ADDR(0x00000454)
180#define IOP321_DMA1_PUADR (volatile u32 *)IOP321_REG_ADDR(0x00000458)
181#define IOP321_DMA1_LADR (volatile u32 *)IOP321_REG_ADDR(0x0000045C)
182#define IOP321_DMA1_BCR (volatile u32 *)IOP321_REG_ADDR(0x00000460)
183#define IOP321_DMA1_DCR (volatile u32 *)IOP321_REG_ADDR(0x00000464)
184/* Reserved 0x00000468 through 0x000004FF */
185
186/* Memory controller 0x00000500 through 0x0005FF */
187
188/* Peripheral bus interface unit 0x00000680 through 0x0006FF */
189#define IOP321_PBCR (volatile u32 *)IOP321_REG_ADDR(0x00000680)
190#define IOP321_PBISR (volatile u32 *)IOP321_REG_ADDR(0x00000684)
191#define IOP321_PBBAR0 (volatile u32 *)IOP321_REG_ADDR(0x00000688)
192#define IOP321_PBLR0 (volatile u32 *)IOP321_REG_ADDR(0x0000068C)
193#define IOP321_PBBAR1 (volatile u32 *)IOP321_REG_ADDR(0x00000690)
194#define IOP321_PBLR1 (volatile u32 *)IOP321_REG_ADDR(0x00000694)
195#define IOP321_PBBAR2 (volatile u32 *)IOP321_REG_ADDR(0x00000698)
196#define IOP321_PBLR2 (volatile u32 *)IOP321_REG_ADDR(0x0000069C)
197#define IOP321_PBBAR3 (volatile u32 *)IOP321_REG_ADDR(0x000006A0)
198#define IOP321_PBLR3 (volatile u32 *)IOP321_REG_ADDR(0x000006A4)
199#define IOP321_PBBAR4 (volatile u32 *)IOP321_REG_ADDR(0x000006A8)
200#define IOP321_PBLR4 (volatile u32 *)IOP321_REG_ADDR(0x000006AC)
201#define IOP321_PBBAR5 (volatile u32 *)IOP321_REG_ADDR(0x000006B0)
202#define IOP321_PBLR5 (volatile u32 *)IOP321_REG_ADDR(0x000006B4)
203#define IOP321_PBDSCR (volatile u32 *)IOP321_REG_ADDR(0x000006B8)
204/* Reserved 0x000006BC */
205#define IOP321_PMBR0 (volatile u32 *)IOP321_REG_ADDR(0x000006C0)
206/* Reserved 0x000006C4 through 0x000006DC */
207#define IOP321_PMBR1 (volatile u32 *)IOP321_REG_ADDR(0x000006E0)
208#define IOP321_PMBR2 (volatile u32 *)IOP321_REG_ADDR(0x000006E4)
209
210#define IOP321_PBCR_EN 0x1
211
212#define IOP321_PBISR_BOOR_ERR 0x1
213
214/* Peripheral performance monitoring unit 0x00000700 through 0x00077F */
215#define IOP321_GTMR (volatile u32 *)IOP321_REG_ADDR(0x00000700)
216#define IOP321_ESR (volatile u32 *)IOP321_REG_ADDR(0x00000704)
217#define IOP321_EMISR (volatile u32 *)IOP321_REG_ADDR(0x00000708)
218/* reserved 0x00000070c */
219#define IOP321_GTSR (volatile u32 *)IOP321_REG_ADDR(0x00000710)
220/* PERC0 DOESN'T EXIST - index from 1! */
221#define IOP321_PERCR0 (volatile u32 *)IOP321_REG_ADDR(0x00000710)
222
223#define IOP321_GTMR_NGCE 0x04 /* (Not) Global Counter Enable */
224
225/* Internal arbitration unit 0x00000780 through 0x0007BF */
226#define IOP321_IACR (volatile u32 *)IOP321_REG_ADDR(0x00000780)
227#define IOP321_MTTR1 (volatile u32 *)IOP321_REG_ADDR(0x00000784)
228#define IOP321_MTTR2 (volatile u32 *)IOP321_REG_ADDR(0x00000788)
229
230/* General Purpose I/O Registers */
231#define IOP321_GPOE (volatile u32 *)IOP321_REG_ADDR(0x000007C4)
232#define IOP321_GPID (volatile u32 *)IOP321_REG_ADDR(0x000007C8)
233#define IOP321_GPOD (volatile u32 *)IOP321_REG_ADDR(0x000007CC)
234
235/* Interrupt Controller */
236#define IOP321_INTCTL (volatile u32 *)IOP321_REG_ADDR(0x000007D0)
237#define IOP321_INTSTR (volatile u32 *)IOP321_REG_ADDR(0x000007D4)
238#define IOP321_IINTSRC (volatile u32 *)IOP321_REG_ADDR(0x000007D8)
239#define IOP321_FINTSRC (volatile u32 *)IOP321_REG_ADDR(0x000007DC)
240
241/* Timers */
242
243#define IOP321_TU_TMR0 (volatile u32 *)IOP321_REG_ADDR(0x000007E0)
244#define IOP321_TU_TMR1 (volatile u32 *)IOP321_REG_ADDR(0x000007E4)
245
246#ifdef CONFIG_ARCH_IQ80321
247#define IOP321_TICK_RATE 200000000 /* 200 MHz clock */
248#elif defined(CONFIG_ARCH_IQ31244)
249#define IOP321_TICK_RATE 198000000 /* 33.000 MHz crystal */
250#endif
251
252#ifdef CONFIG_ARCH_EP80219
253#undef IOP321_TICK_RATE
254#define IOP321_TICK_RATE 200000000 /* 33.333333 Mhz crystal */
255#endif
256
257#define IOP321_TMR_TC 0x01
258#define IOP321_TMR_EN 0x02
259#define IOP321_TMR_RELOAD 0x04
260#define IOP321_TMR_PRIVILEGED 0x09
261
262#define IOP321_TMR_RATIO_1_1 0x00
263#define IOP321_TMR_RATIO_4_1 0x10
264#define IOP321_TMR_RATIO_8_1 0x20
265#define IOP321_TMR_RATIO_16_1 0x30
266
267#define IOP321_TU_TCR0 (volatile u32 *)IOP321_REG_ADDR(0x000007E8)
268#define IOP321_TU_TCR1 (volatile u32 *)IOP321_REG_ADDR(0x000007EC)
269#define IOP321_TU_TRR0 (volatile u32 *)IOP321_REG_ADDR(0x000007F0)
270#define IOP321_TU_TRR1 (volatile u32 *)IOP321_REG_ADDR(0x000007F4)
271#define IOP321_TU_TISR (volatile u32 *)IOP321_REG_ADDR(0x000007F8)
272#define IOP321_TU_WDTCR (volatile u32 *)IOP321_REG_ADDR(0x000007FC)
273
274/* Application accelerator unit 0x00000800 - 0x000008FF */
275#define IOP321_AAU_ACR (volatile u32 *)IOP321_REG_ADDR(0x00000800)
276#define IOP321_AAU_ASR (volatile u32 *)IOP321_REG_ADDR(0x00000804)
277#define IOP321_AAU_ADAR (volatile u32 *)IOP321_REG_ADDR(0x00000808)
278#define IOP321_AAU_ANDAR (volatile u32 *)IOP321_REG_ADDR(0x0000080C)
279#define IOP321_AAU_SAR1 (volatile u32 *)IOP321_REG_ADDR(0x00000810)
280#define IOP321_AAU_SAR2 (volatile u32 *)IOP321_REG_ADDR(0x00000814)
281#define IOP321_AAU_SAR3 (volatile u32 *)IOP321_REG_ADDR(0x00000818)
282#define IOP321_AAU_SAR4 (volatile u32 *)IOP321_REG_ADDR(0x0000081C)
283#define IOP321_AAU_SAR5 (volatile u32 *)IOP321_REG_ADDR(0x0000082C)
284#define IOP321_AAU_SAR6 (volatile u32 *)IOP321_REG_ADDR(0x00000830)
285#define IOP321_AAU_SAR7 (volatile u32 *)IOP321_REG_ADDR(0x00000834)
286#define IOP321_AAU_SAR8 (volatile u32 *)IOP321_REG_ADDR(0x00000838)
287#define IOP321_AAU_SAR9 (volatile u32 *)IOP321_REG_ADDR(0x00000840)
288#define IOP321_AAU_SAR10 (volatile u32 *)IOP321_REG_ADDR(0x00000844)
289#define IOP321_AAU_SAR11 (volatile u32 *)IOP321_REG_ADDR(0x00000848)
290#define IOP321_AAU_SAR12 (volatile u32 *)IOP321_REG_ADDR(0x0000084C)
291#define IOP321_AAU_SAR13 (volatile u32 *)IOP321_REG_ADDR(0x00000850)
292#define IOP321_AAU_SAR14 (volatile u32 *)IOP321_REG_ADDR(0x00000854)
293#define IOP321_AAU_SAR15 (volatile u32 *)IOP321_REG_ADDR(0x00000858)
294#define IOP321_AAU_SAR16 (volatile u32 *)IOP321_REG_ADDR(0x0000085C)
295#define IOP321_AAU_SAR17 (volatile u32 *)IOP321_REG_ADDR(0x00000864)
296#define IOP321_AAU_SAR18 (volatile u32 *)IOP321_REG_ADDR(0x00000868)
297#define IOP321_AAU_SAR19 (volatile u32 *)IOP321_REG_ADDR(0x0000086C)
298#define IOP321_AAU_SAR20 (volatile u32 *)IOP321_REG_ADDR(0x00000870)
299#define IOP321_AAU_SAR21 (volatile u32 *)IOP321_REG_ADDR(0x00000874)
300#define IOP321_AAU_SAR22 (volatile u32 *)IOP321_REG_ADDR(0x00000878)
301#define IOP321_AAU_SAR23 (volatile u32 *)IOP321_REG_ADDR(0x0000087C)
302#define IOP321_AAU_SAR24 (volatile u32 *)IOP321_REG_ADDR(0x00000880)
303#define IOP321_AAU_SAR25 (volatile u32 *)IOP321_REG_ADDR(0x00000888)
304#define IOP321_AAU_SAR26 (volatile u32 *)IOP321_REG_ADDR(0x0000088C)
305#define IOP321_AAU_SAR27 (volatile u32 *)IOP321_REG_ADDR(0x00000890)
306#define IOP321_AAU_SAR28 (volatile u32 *)IOP321_REG_ADDR(0x00000894)
307#define IOP321_AAU_SAR29 (volatile u32 *)IOP321_REG_ADDR(0x00000898)
308#define IOP321_AAU_SAR30 (volatile u32 *)IOP321_REG_ADDR(0x0000089C)
309#define IOP321_AAU_SAR31 (volatile u32 *)IOP321_REG_ADDR(0x000008A0)
310#define IOP321_AAU_SAR32 (volatile u32 *)IOP321_REG_ADDR(0x000008A4)
311#define IOP321_AAU_DAR (volatile u32 *)IOP321_REG_ADDR(0x00000820)
312#define IOP321_AAU_ABCR (volatile u32 *)IOP321_REG_ADDR(0x00000824)
313#define IOP321_AAU_ADCR (volatile u32 *)IOP321_REG_ADDR(0x00000828)
314#define IOP321_AAU_EDCR0 (volatile u32 *)IOP321_REG_ADDR(0x0000083c)
315#define IOP321_AAU_EDCR1 (volatile u32 *)IOP321_REG_ADDR(0x00000860)
316#define IOP321_AAU_EDCR2 (volatile u32 *)IOP321_REG_ADDR(0x00000884)
317
318
319/* SSP serial port unit 0x00001600 - 0x0000167F */
320/* I2C bus interface unit 0x00001680 - 0x000016FF */
321#define IOP321_ICR0 (volatile u32 *)IOP321_REG_ADDR(0x00001680)
322#define IOP321_ISR0 (volatile u32 *)IOP321_REG_ADDR(0x00001684)
323#define IOP321_ISAR0 (volatile u32 *)IOP321_REG_ADDR(0x00001688)
324#define IOP321_IDBR0 (volatile u32 *)IOP321_REG_ADDR(0x0000168C)
325/* Reserved 0x00001690 */
326#define IOP321_IBMR0 (volatile u32 *)IOP321_REG_ADDR(0x00001694)
327/* Reserved 0x00001698 */
328/* Reserved 0x0000169C */
329#define IOP321_ICR1 (volatile u32 *)IOP321_REG_ADDR(0x000016A0)
330#define IOP321_ISR1 (volatile u32 *)IOP321_REG_ADDR(0x000016A4)
331#define IOP321_ISAR1 (volatile u32 *)IOP321_REG_ADDR(0x000016A8)
332#define IOP321_IDBR1 (volatile u32 *)IOP321_REG_ADDR(0x000016AC)
333#define IOP321_IBMR1 (volatile u32 *)IOP321_REG_ADDR(0x000016B4)
334/* Reserved 0x000016B8 through 0x000016FC */
335
336/* for I2C bit defs see drivers/i2c/i2c-iop3xx.h */
337
338
339#ifndef __ASSEMBLY__
340extern void iop321_map_io(void);
341extern void iop321_init_irq(void);
342extern void iop321_time_init(void);
343#endif
344
345#endif // _IOP321_HW_H_
diff --git a/include/asm-arm/arch-iop3xx/iop331-irqs.h b/include/asm-arm/arch-iop3xx/iop331-irqs.h
new file mode 100644
index 000000000000..8ff73d487222
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/iop331-irqs.h
@@ -0,0 +1,136 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/irqs.h
3 *
4 * Author: Dave Jiang (dave.jiang@intel.com)
5 * Copyright: (C) 2003 Intel Corp.
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#ifndef _IOP331_IRQS_H_
13#define _IOP331_IRQS_H_
14
15/*
16 * IOP80331 chipset interrupts
17 */
18#define IOP331_IRQ_OFS 0
19#define IOP331_IRQ(x) (IOP331_IRQ_OFS + (x))
20
21/*
22 * On IRQ or FIQ register
23 */
24#define IRQ_IOP331_DMA0_EOT IOP331_IRQ(0)
25#define IRQ_IOP331_DMA0_EOC IOP331_IRQ(1)
26#define IRQ_IOP331_DMA1_EOT IOP331_IRQ(2)
27#define IRQ_IOP331_DMA1_EOC IOP331_IRQ(3)
28#define IRQ_IOP331_RSVD_4 IOP331_IRQ(4)
29#define IRQ_IOP331_RSVD_5 IOP331_IRQ(5)
30#define IRQ_IOP331_AA_EOT IOP331_IRQ(6)
31#define IRQ_IOP331_AA_EOC IOP331_IRQ(7)
32#define IRQ_IOP331_TIMER0 IOP331_IRQ(8)
33#define IRQ_IOP331_TIMER1 IOP331_IRQ(9)
34#define IRQ_IOP331_I2C_0 IOP331_IRQ(10)
35#define IRQ_IOP331_I2C_1 IOP331_IRQ(11)
36#define IRQ_IOP331_MSG IOP331_IRQ(12)
37#define IRQ_IOP331_MSGIBQ IOP331_IRQ(13)
38#define IRQ_IOP331_ATU_BIST IOP331_IRQ(14)
39#define IRQ_IOP331_PERFMON IOP331_IRQ(15)
40#define IRQ_IOP331_CORE_PMU IOP331_IRQ(16)
41#define IRQ_IOP331_RSVD_17 IOP331_IRQ(17)
42#define IRQ_IOP331_RSVD_18 IOP331_IRQ(18)
43#define IRQ_IOP331_RSVD_19 IOP331_IRQ(19)
44#define IRQ_IOP331_RSVD_20 IOP331_IRQ(20)
45#define IRQ_IOP331_RSVD_21 IOP331_IRQ(21)
46#define IRQ_IOP331_RSVD_22 IOP331_IRQ(22)
47#define IRQ_IOP331_RSVD_23 IOP331_IRQ(23)
48#define IRQ_IOP331_XINT0 IOP331_IRQ(24)
49#define IRQ_IOP331_XINT1 IOP331_IRQ(25)
50#define IRQ_IOP331_XINT2 IOP331_IRQ(26)
51#define IRQ_IOP331_XINT3 IOP331_IRQ(27)
52#define IRQ_IOP331_RSVD_28 IOP331_IRQ(28)
53#define IRQ_IOP331_RSVD_29 IOP331_IRQ(29)
54#define IRQ_IOP331_RSVD_30 IOP331_IRQ(30)
55#define IRQ_IOP331_RSVD_31 IOP331_IRQ(31)
56#define IRQ_IOP331_XINT8 IOP331_IRQ(32) // 0
57#define IRQ_IOP331_XINT9 IOP331_IRQ(33) // 1
58#define IRQ_IOP331_XINT10 IOP331_IRQ(34) // 2
59#define IRQ_IOP331_XINT11 IOP331_IRQ(35) // 3
60#define IRQ_IOP331_XINT12 IOP331_IRQ(36) // 4
61#define IRQ_IOP331_XINT13 IOP331_IRQ(37) // 5
62#define IRQ_IOP331_XINT14 IOP331_IRQ(38) // 6
63#define IRQ_IOP331_XINT15 IOP331_IRQ(39) // 7
64#define IRQ_IOP331_RSVD_40 IOP331_IRQ(40) // 8
65#define IRQ_IOP331_RSVD_41 IOP331_IRQ(41) // 9
66#define IRQ_IOP331_RSVD_42 IOP331_IRQ(42) // 10
67#define IRQ_IOP331_RSVD_43 IOP331_IRQ(43) // 11
68#define IRQ_IOP331_RSVD_44 IOP331_IRQ(44) // 12
69#define IRQ_IOP331_RSVD_45 IOP331_IRQ(45) // 13
70#define IRQ_IOP331_RSVD_46 IOP331_IRQ(46) // 14
71#define IRQ_IOP331_RSVD_47 IOP331_IRQ(47) // 15
72#define IRQ_IOP331_RSVD_48 IOP331_IRQ(48) // 16
73#define IRQ_IOP331_RSVD_49 IOP331_IRQ(49) // 17
74#define IRQ_IOP331_RSVD_50 IOP331_IRQ(50) // 18
75#define IRQ_IOP331_UART0 IOP331_IRQ(51) // 19
76#define IRQ_IOP331_UART1 IOP331_IRQ(52) // 20
77#define IRQ_IOP331_PBIE IOP331_IRQ(53) // 21
78#define IRQ_IOP331_ATU_CRW IOP331_IRQ(54) // 22
79#define IRQ_IOP331_ATU_ERR IOP331_IRQ(55) // 23
80#define IRQ_IOP331_MCU_ERR IOP331_IRQ(56) // 24
81#define IRQ_IOP331_DMA0_ERR IOP331_IRQ(57) // 25
82#define IRQ_IOP331_DMA1_ERR IOP331_IRQ(58) // 26
83#define IRQ_IOP331_RSVD_59 IOP331_IRQ(59) // 27
84#define IRQ_IOP331_AA_ERR IOP331_IRQ(60) // 28
85#define IRQ_IOP331_RSVD_61 IOP331_IRQ(61) // 29
86#define IRQ_IOP331_MSG_ERR IOP331_IRQ(62) // 30
87#define IRQ_IOP331_HPI IOP331_IRQ(63) // 31
88
89#define NR_IOP331_IRQS (IOP331_IRQ(63) + 1)
90
91#define NR_IRQS NR_IOP331_IRQS
92
93
94#if defined(CONFIG_ARCH_IQ80331)
95/*
96 * Interrupts available on the IQ80331 board
97 */
98
99/*
100 * On board devices
101 */
102#define IRQ_IQ80331_I82544 IRQ_IOP331_XINT0
103#define IRQ_IQ80331_UART0 IRQ_IOP331_UART0
104#define IRQ_IQ80331_UART1 IRQ_IOP331_UART1
105
106/*
107 * PCI interrupts
108 */
109#define IRQ_IQ80331_INTA IRQ_IOP331_XINT0
110#define IRQ_IQ80331_INTB IRQ_IOP331_XINT1
111#define IRQ_IQ80331_INTC IRQ_IOP331_XINT2
112#define IRQ_IQ80331_INTD IRQ_IOP331_XINT3
113
114#elif defined(CONFIG_MACH_IQ80332)
115/*
116 * Interrupts available on the IQ80332 board
117 */
118
119/*
120 * On board devices
121 */
122#define IRQ_IQ80332_I82544 IRQ_IOP331_XINT0
123#define IRQ_IQ80332_UART0 IRQ_IOP331_UART0
124#define IRQ_IQ80332_UART1 IRQ_IOP331_UART1
125
126/*
127 * PCI interrupts
128 */
129#define IRQ_IQ80332_INTA IRQ_IOP331_XINT0
130#define IRQ_IQ80332_INTB IRQ_IOP331_XINT1
131#define IRQ_IQ80332_INTC IRQ_IOP331_XINT2
132#define IRQ_IQ80332_INTD IRQ_IOP331_XINT3
133
134#endif
135
136#endif // _IOP331_IRQ_H_
diff --git a/include/asm-arm/arch-iop3xx/iop331.h b/include/asm-arm/arch-iop3xx/iop331.h
new file mode 100644
index 000000000000..96adffd8bad2
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/iop331.h
@@ -0,0 +1,363 @@
1/*
2 * linux/include/asm/arch-iop3xx/iop331.h
3 *
4 * Intel IOP331 Chip definitions
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#ifndef _IOP331_HW_H_
15#define _IOP331_HW_H_
16
17
18/*
19 * This is needed for mixed drivers that need to work on all
20 * IOP3xx variants but behave slightly differently on each.
21 */
22#ifndef __ASSEMBLY__
23#ifdef CONFIG_ARCH_IOP331
24/*#define iop_is_331() ((processor_id & 0xffffffb0) == 0x69054090) */
25#define iop_is_331() ((processor_id & 0xffffff30) == 0x69054010)
26#else
27#define iop_is_331() 0
28#endif
29#endif
30
31/*
32 * IOP331 I/O and Mem space regions for PCI autoconfiguration
33 */
34#define IOP331_PCI_IO_WINDOW_SIZE 0x00010000
35#define IOP331_PCI_LOWER_IO_PA 0x90000000
36#define IOP331_PCI_LOWER_IO_VA 0xfe000000
37#define IOP331_PCI_LOWER_IO_BA (*IOP331_OIOWTVR)
38#define IOP331_PCI_UPPER_IO_PA (IOP331_PCI_LOWER_IO_PA + IOP331_PCI_IO_WINDOW_SIZE - 1)
39#define IOP331_PCI_UPPER_IO_VA (IOP331_PCI_LOWER_IO_VA + IOP331_PCI_IO_WINDOW_SIZE - 1)
40#define IOP331_PCI_UPPER_IO_BA (IOP331_PCI_LOWER_IO_BA + IOP331_PCI_IO_WINDOW_SIZE - 1)
41#define IOP331_PCI_IO_OFFSET (IOP331_PCI_LOWER_IO_VA - IOP331_PCI_LOWER_IO_BA)
42
43/* this can be 128M if OMWTVR1 is set */
44#define IOP331_PCI_MEM_WINDOW_SIZE 0x04000000 /* 64M outbound window */
45//#define IOP331_PCI_MEM_WINDOW_SIZE (~*IOP331_IALR1 + 1)
46#define IOP331_PCI_LOWER_MEM_PA 0x80000000
47#define IOP331_PCI_LOWER_MEM_BA (*IOP331_OMWTVR0)
48#define IOP331_PCI_UPPER_MEM_PA (IOP331_PCI_LOWER_MEM_PA + IOP331_PCI_MEM_WINDOW_SIZE - 1)
49#define IOP331_PCI_UPPER_MEM_BA (IOP331_PCI_LOWER_MEM_BA + IOP331_PCI_MEM_WINDOW_SIZE - 1)
50#define IOP331_PCI_MEM_OFFSET (IOP331_PCI_LOWER_MEM_PA - IOP331_PCI_LOWER_MEM_BA)
51
52/*
53 * IOP331 chipset registers
54 */
55#define IOP331_VIRT_MEM_BASE 0xfeffe000 /* chip virtual mem address*/
56#define IOP331_PHYS_MEM_BASE 0xffffe000 /* chip physical memory address */
57#define IOP331_REG_ADDR(reg) (IOP331_VIRT_MEM_BASE | (reg))
58
59/* Reserved 0x00000000 through 0x000000FF */
60
61/* Address Translation Unit 0x00000100 through 0x000001FF */
62#define IOP331_ATUVID (volatile u16 *)IOP331_REG_ADDR(0x00000100)
63#define IOP331_ATUDID (volatile u16 *)IOP331_REG_ADDR(0x00000102)
64#define IOP331_ATUCMD (volatile u16 *)IOP331_REG_ADDR(0x00000104)
65#define IOP331_ATUSR (volatile u16 *)IOP331_REG_ADDR(0x00000106)
66#define IOP331_ATURID (volatile u8 *)IOP331_REG_ADDR(0x00000108)
67#define IOP331_ATUCCR (volatile u32 *)IOP331_REG_ADDR(0x00000109)
68#define IOP331_ATUCLSR (volatile u8 *)IOP331_REG_ADDR(0x0000010C)
69#define IOP331_ATULT (volatile u8 *)IOP331_REG_ADDR(0x0000010D)
70#define IOP331_ATUHTR (volatile u8 *)IOP331_REG_ADDR(0x0000010E)
71#define IOP331_ATUBIST (volatile u8 *)IOP331_REG_ADDR(0x0000010F)
72#define IOP331_IABAR0 (volatile u32 *)IOP331_REG_ADDR(0x00000110)
73#define IOP331_IAUBAR0 (volatile u32 *)IOP331_REG_ADDR(0x00000114)
74#define IOP331_IABAR1 (volatile u32 *)IOP331_REG_ADDR(0x00000118)
75#define IOP331_IAUBAR1 (volatile u32 *)IOP331_REG_ADDR(0x0000011C)
76#define IOP331_IABAR2 (volatile u32 *)IOP331_REG_ADDR(0x00000120)
77#define IOP331_IAUBAR2 (volatile u32 *)IOP331_REG_ADDR(0x00000124)
78#define IOP331_ASVIR (volatile u16 *)IOP331_REG_ADDR(0x0000012C)
79#define IOP331_ASIR (volatile u16 *)IOP331_REG_ADDR(0x0000012E)
80#define IOP331_ERBAR (volatile u32 *)IOP331_REG_ADDR(0x00000130)
81#define IOP331_ATU_CAPPTR (volatile u32 *)IOP331_REG_ADDR(0x00000134)
82/* Reserved 0x00000138 through 0x0000013B */
83#define IOP331_ATUILR (volatile u8 *)IOP331_REG_ADDR(0x0000013C)
84#define IOP331_ATUIPR (volatile u8 *)IOP331_REG_ADDR(0x0000013D)
85#define IOP331_ATUMGNT (volatile u8 *)IOP331_REG_ADDR(0x0000013E)
86#define IOP331_ATUMLAT (volatile u8 *)IOP331_REG_ADDR(0x0000013F)
87#define IOP331_IALR0 (volatile u32 *)IOP331_REG_ADDR(0x00000140)
88#define IOP331_IATVR0 (volatile u32 *)IOP331_REG_ADDR(0x00000144)
89#define IOP331_ERLR (volatile u32 *)IOP331_REG_ADDR(0x00000148)
90#define IOP331_ERTVR (volatile u32 *)IOP331_REG_ADDR(0x0000014C)
91#define IOP331_IALR1 (volatile u32 *)IOP331_REG_ADDR(0x00000150)
92#define IOP331_IALR2 (volatile u32 *)IOP331_REG_ADDR(0x00000154)
93#define IOP331_IATVR2 (volatile u32 *)IOP331_REG_ADDR(0x00000158)
94#define IOP331_OIOWTVR (volatile u32 *)IOP331_REG_ADDR(0x0000015C)
95#define IOP331_OMWTVR0 (volatile u32 *)IOP331_REG_ADDR(0x00000160)
96#define IOP331_OUMWTVR0 (volatile u32 *)IOP331_REG_ADDR(0x00000164)
97#define IOP331_OMWTVR1 (volatile u32 *)IOP331_REG_ADDR(0x00000168)
98#define IOP331_OUMWTVR1 (volatile u32 *)IOP331_REG_ADDR(0x0000016C)
99/* Reserved 0x00000170 through 0x00000177*/
100#define IOP331_OUDWTVR (volatile u32 *)IOP331_REG_ADDR(0x00000178)
101/* Reserved 0x0000017C through 0x0000017F*/
102#define IOP331_ATUCR (volatile u32 *)IOP331_REG_ADDR(0x00000180)
103#define IOP331_PCSR (volatile u32 *)IOP331_REG_ADDR(0x00000184)
104#define IOP331_ATUISR (volatile u32 *)IOP331_REG_ADDR(0x00000188)
105#define IOP331_ATUIMR (volatile u32 *)IOP331_REG_ADDR(0x0000018C)
106#define IOP331_IABAR3 (volatile u32 *)IOP331_REG_ADDR(0x00000190)
107#define IOP331_IAUBAR3 (volatile u32 *)IOP331_REG_ADDR(0x00000194)
108#define IOP331_IALR3 (volatile u32 *)IOP331_REG_ADDR(0x00000198)
109#define IOP331_IATVR3 (volatile u32 *)IOP331_REG_ADDR(0x0000019C)
110/* Reserved 0x000001A0 through 0x000001A3*/
111#define IOP331_OCCAR (volatile u32 *)IOP331_REG_ADDR(0x000001A4)
112/* Reserved 0x000001A8 through 0x000001AB*/
113#define IOP331_OCCDR (volatile u32 *)IOP331_REG_ADDR(0x000001AC)
114/* Reserved 0x000001B0 through 0x000001BB*/
115#define IOP331_VPDCAPID (volatile u8 *)IOP331_REG_ADDR(0x000001B8)
116#define IOP331_VPDNXTP (volatile u8 *)IOP331_REG_ADDR(0x000001B9)
117#define IOP331_VPDAR (volatile u16 *)IOP331_REG_ADDR(0x000001BA)
118#define IOP331_VPDDR (volatile u32 *)IOP331_REG_ADDR(0x000001BC)
119#define IOP331_PMCAPID (volatile u8 *)IOP331_REG_ADDR(0x000001C0)
120#define IOP331_PMNEXT (volatile u8 *)IOP331_REG_ADDR(0x000001C1)
121#define IOP331_APMCR (volatile u16 *)IOP331_REG_ADDR(0x000001C2)
122#define IOP331_APMCSR (volatile u16 *)IOP331_REG_ADDR(0x000001C4)
123/* Reserved 0x000001C6 through 0x000001CF */
124#define IOP331_MSICAPID (volatile u8 *)IOP331_REG_ADDR(0x000001D0)
125#define IOP331_MSINXTP (volatile u8 *)IOP331_REG_ADDR(0x000001D1)
126#define IOP331_MSIMCR (volatile u16 *)IOP331_REG_ADDR(0x000001D2)
127#define IOP331_MSIMAR (volatile u32 *)IOP331_REG_ADDR(0x000001D4)
128#define IOP331_MSIMUAR (volatile u32 *)IOP331_REG_ADDR(0x000001D8)
129#define IOP331_MSIMDR (volatile u32 *)IOP331_REG_ADDR(0x000001DC)
130#define IOP331_PCIXCAPID (volatile u8 *)IOP331_REG_ADDR(0x000001E0)
131#define IOP331_PCIXNEXT (volatile u8 *)IOP331_REG_ADDR(0x000001E1)
132#define IOP331_PCIXCMD (volatile u16 *)IOP331_REG_ADDR(0x000001E2)
133#define IOP331_PCIXSR (volatile u32 *)IOP331_REG_ADDR(0x000001E4)
134#define IOP331_PCIIRSR (volatile u32 *)IOP331_REG_ADDR(0x000001EC)
135
136/* Messaging Unit 0x00000300 through 0x000003FF */
137
138/* Reserved 0x00000300 through 0x0000030c */
139#define IOP331_IMR0 (volatile u32 *)IOP331_REG_ADDR(0x00000310)
140#define IOP331_IMR1 (volatile u32 *)IOP331_REG_ADDR(0x00000314)
141#define IOP331_OMR0 (volatile u32 *)IOP331_REG_ADDR(0x00000318)
142#define IOP331_OMR1 (volatile u32 *)IOP331_REG_ADDR(0x0000031C)
143#define IOP331_IDR (volatile u32 *)IOP331_REG_ADDR(0x00000320)
144#define IOP331_IISR (volatile u32 *)IOP331_REG_ADDR(0x00000324)
145#define IOP331_IIMR (volatile u32 *)IOP331_REG_ADDR(0x00000328)
146#define IOP331_ODR (volatile u32 *)IOP331_REG_ADDR(0x0000032C)
147#define IOP331_OISR (volatile u32 *)IOP331_REG_ADDR(0x00000330)
148#define IOP331_OIMR (volatile u32 *)IOP331_REG_ADDR(0x00000334)
149/* Reserved 0x00000338 through 0x0000034F */
150#define IOP331_MUCR (volatile u32 *)IOP331_REG_ADDR(0x00000350)
151#define IOP331_QBAR (volatile u32 *)IOP331_REG_ADDR(0x00000354)
152/* Reserved 0x00000358 through 0x0000035C */
153#define IOP331_IFHPR (volatile u32 *)IOP331_REG_ADDR(0x00000360)
154#define IOP331_IFTPR (volatile u32 *)IOP331_REG_ADDR(0x00000364)
155#define IOP331_IPHPR (volatile u32 *)IOP331_REG_ADDR(0x00000368)
156#define IOP331_IPTPR (volatile u32 *)IOP331_REG_ADDR(0x0000036C)
157#define IOP331_OFHPR (volatile u32 *)IOP331_REG_ADDR(0x00000370)
158#define IOP331_OFTPR (volatile u32 *)IOP331_REG_ADDR(0x00000374)
159#define IOP331_OPHPR (volatile u32 *)IOP331_REG_ADDR(0x00000378)
160#define IOP331_OPTPR (volatile u32 *)IOP331_REG_ADDR(0x0000037C)
161#define IOP331_IAR (volatile u32 *)IOP331_REG_ADDR(0x00000380)
162/* Reserved 0x00000384 through 0x000003FF */
163
164/* DMA Controller 0x00000400 through 0x000004FF */
165#define IOP331_DMA0_CCR (volatile u32 *)IOP331_REG_ADDR(0x00000400)
166#define IOP331_DMA0_CSR (volatile u32 *)IOP331_REG_ADDR(0x00000404)
167#define IOP331_DMA0_DAR (volatile u32 *)IOP331_REG_ADDR(0x0000040C)
168#define IOP331_DMA0_NDAR (volatile u32 *)IOP331_REG_ADDR(0x00000410)
169#define IOP331_DMA0_PADR (volatile u32 *)IOP331_REG_ADDR(0x00000414)
170#define IOP331_DMA0_PUADR (volatile u32 *)IOP331_REG_ADDR(0x00000418)
171#define IOP331_DMA0_LADR (volatile u32 *)IOP331_REG_ADDR(0X0000041C)
172#define IOP331_DMA0_BCR (volatile u32 *)IOP331_REG_ADDR(0x00000420)
173#define IOP331_DMA0_DCR (volatile u32 *)IOP331_REG_ADDR(0x00000424)
174/* Reserved 0x00000428 through 0x0000043C */
175#define IOP331_DMA1_CCR (volatile u32 *)IOP331_REG_ADDR(0x00000440)
176#define IOP331_DMA1_CSR (volatile u32 *)IOP331_REG_ADDR(0x00000444)
177#define IOP331_DMA1_DAR (volatile u32 *)IOP331_REG_ADDR(0x0000044C)
178#define IOP331_DMA1_NDAR (volatile u32 *)IOP331_REG_ADDR(0x00000450)
179#define IOP331_DMA1_PADR (volatile u32 *)IOP331_REG_ADDR(0x00000454)
180#define IOP331_DMA1_PUADR (volatile u32 *)IOP331_REG_ADDR(0x00000458)
181#define IOP331_DMA1_LADR (volatile u32 *)IOP331_REG_ADDR(0x0000045C)
182#define IOP331_DMA1_BCR (volatile u32 *)IOP331_REG_ADDR(0x00000460)
183#define IOP331_DMA1_DCR (volatile u32 *)IOP331_REG_ADDR(0x00000464)
184/* Reserved 0x00000468 through 0x000004FF */
185
186/* Memory controller 0x00000500 through 0x0005FF */
187
188/* Peripheral bus interface unit 0x00000680 through 0x0006FF */
189#define IOP331_PBCR (volatile u32 *)IOP331_REG_ADDR(0x00000680)
190#define IOP331_PBISR (volatile u32 *)IOP331_REG_ADDR(0x00000684)
191#define IOP331_PBBAR0 (volatile u32 *)IOP331_REG_ADDR(0x00000688)
192#define IOP331_PBLR0 (volatile u32 *)IOP331_REG_ADDR(0x0000068C)
193#define IOP331_PBBAR1 (volatile u32 *)IOP331_REG_ADDR(0x00000690)
194#define IOP331_PBLR1 (volatile u32 *)IOP331_REG_ADDR(0x00000694)
195#define IOP331_PBBAR2 (volatile u32 *)IOP331_REG_ADDR(0x00000698)
196#define IOP331_PBLR2 (volatile u32 *)IOP331_REG_ADDR(0x0000069C)
197#define IOP331_PBBAR3 (volatile u32 *)IOP331_REG_ADDR(0x000006A0)
198#define IOP331_PBLR3 (volatile u32 *)IOP331_REG_ADDR(0x000006A4)
199#define IOP331_PBBAR4 (volatile u32 *)IOP331_REG_ADDR(0x000006A8)
200#define IOP331_PBLR4 (volatile u32 *)IOP331_REG_ADDR(0x000006AC)
201#define IOP331_PBBAR5 (volatile u32 *)IOP331_REG_ADDR(0x000006B0)
202#define IOP331_PBLR5 (volatile u32 *)IOP331_REG_ADDR(0x000006B4)
203#define IOP331_PBDSCR (volatile u32 *)IOP331_REG_ADDR(0x000006B8)
204/* Reserved 0x000006BC */
205#define IOP331_PMBR0 (volatile u32 *)IOP331_REG_ADDR(0x000006C0)
206/* Reserved 0x000006C4 through 0x000006DC */
207#define IOP331_PMBR1 (volatile u32 *)IOP331_REG_ADDR(0x000006E0)
208#define IOP331_PMBR2 (volatile u32 *)IOP331_REG_ADDR(0x000006E4)
209
210#define IOP331_PBCR_EN 0x1
211
212#define IOP331_PBISR_BOOR_ERR 0x1
213
214
215
216/* Peripheral performance monitoring unit 0x00000700 through 0x00077F */
217/* Internal arbitration unit 0x00000780 through 0x0007BF */
218
219/* Interrupt Controller */
220#define IOP331_INTCTL0 (volatile u32 *)IOP331_REG_ADDR(0x00000790)
221#define IOP331_INTCTL1 (volatile u32 *)IOP331_REG_ADDR(0x00000794)
222#define IOP331_INTSTR0 (volatile u32 *)IOP331_REG_ADDR(0x00000798)
223#define IOP331_INTSTR1 (volatile u32 *)IOP331_REG_ADDR(0x0000079C)
224#define IOP331_IINTSRC0 (volatile u32 *)IOP331_REG_ADDR(0x000007A0)
225#define IOP331_IINTSRC1 (volatile u32 *)IOP331_REG_ADDR(0x000007A4)
226#define IOP331_FINTSRC0 (volatile u32 *)IOP331_REG_ADDR(0x000007A8)
227#define IOP331_FINTSRC1 (volatile u32 *)IOP331_REG_ADDR(0x000007AC)
228#define IOP331_IPR0 (volatile u32 *)IOP331_REG_ADDR(0x000007B0)
229#define IOP331_IPR1 (volatile u32 *)IOP331_REG_ADDR(0x000007B4)
230#define IOP331_IPR2 (volatile u32 *)IOP331_REG_ADDR(0x000007B8)
231#define IOP331_IPR3 (volatile u32 *)IOP331_REG_ADDR(0x000007BC)
232#define IOP331_INTBASE (volatile u32 *)IOP331_REG_ADDR(0x000007C0)
233#define IOP331_INTSIZE (volatile u32 *)IOP331_REG_ADDR(0x000007C4)
234#define IOP331_IINTVEC (volatile u32 *)IOP331_REG_ADDR(0x000007C8)
235#define IOP331_FINTVEC (volatile u32 *)IOP331_REG_ADDR(0x000007CC)
236
237
238/* Timers */
239
240#define IOP331_TU_TMR0 (volatile u32 *)IOP331_REG_ADDR(0x000007D0)
241#define IOP331_TU_TMR1 (volatile u32 *)IOP331_REG_ADDR(0x000007D4)
242
243#define IOP331_TMR_TC 0x01
244#define IOP331_TMR_EN 0x02
245#define IOP331_TMR_RELOAD 0x04
246#define IOP331_TMR_PRIVILEGED 0x09
247
248#define IOP331_TMR_RATIO_1_1 0x00
249#define IOP331_TMR_RATIO_4_1 0x10
250#define IOP331_TMR_RATIO_8_1 0x20
251#define IOP331_TMR_RATIO_16_1 0x30
252
253#define IOP331_TU_TCR0 (volatile u32 *)IOP331_REG_ADDR(0x000007D8)
254#define IOP331_TU_TCR1 (volatile u32 *)IOP331_REG_ADDR(0x000007DC)
255#define IOP331_TU_TRR0 (volatile u32 *)IOP331_REG_ADDR(0x000007E0)
256#define IOP331_TU_TRR1 (volatile u32 *)IOP331_REG_ADDR(0x000007E4)
257#define IOP331_TU_TISR (volatile u32 *)IOP331_REG_ADDR(0x000007E8)
258#define IOP331_TU_WDTCR (volatile u32 *)IOP331_REG_ADDR(0x000007EC)
259
260#if defined(CONFIG_ARCH_IOP331)
261#define IOP331_TICK_RATE 266000000 /* 266 MHz IB clock */
262#endif
263
264#if defined(CONFIG_IOP331_STEPD) || defined(CONFIG_ARCH_IQ80333)
265#undef IOP331_TICK_RATE
266#define IOP331_TICK_RATE 333000000 /* 333 Mhz IB clock */
267#endif
268
269/* Application accelerator unit 0x00000800 - 0x000008FF */
270#define IOP331_AAU_ACR (volatile u32 *)IOP331_REG_ADDR(0x00000800)
271#define IOP331_AAU_ASR (volatile u32 *)IOP331_REG_ADDR(0x00000804)
272#define IOP331_AAU_ADAR (volatile u32 *)IOP331_REG_ADDR(0x00000808)
273#define IOP331_AAU_ANDAR (volatile u32 *)IOP331_REG_ADDR(0x0000080C)
274#define IOP331_AAU_SAR1 (volatile u32 *)IOP331_REG_ADDR(0x00000810)
275#define IOP331_AAU_SAR2 (volatile u32 *)IOP331_REG_ADDR(0x00000814)
276#define IOP331_AAU_SAR3 (volatile u32 *)IOP331_REG_ADDR(0x00000818)
277#define IOP331_AAU_SAR4 (volatile u32 *)IOP331_REG_ADDR(0x0000081C)
278#define IOP331_AAU_SAR5 (volatile u32 *)IOP331_REG_ADDR(0x0000082C)
279#define IOP331_AAU_SAR6 (volatile u32 *)IOP331_REG_ADDR(0x00000830)
280#define IOP331_AAU_SAR7 (volatile u32 *)IOP331_REG_ADDR(0x00000834)
281#define IOP331_AAU_SAR8 (volatile u32 *)IOP331_REG_ADDR(0x00000838)
282#define IOP331_AAU_SAR9 (volatile u32 *)IOP331_REG_ADDR(0x00000840)
283#define IOP331_AAU_SAR10 (volatile u32 *)IOP331_REG_ADDR(0x00000844)
284#define IOP331_AAU_SAR11 (volatile u32 *)IOP331_REG_ADDR(0x00000848)
285#define IOP331_AAU_SAR12 (volatile u32 *)IOP331_REG_ADDR(0x0000084C)
286#define IOP331_AAU_SAR13 (volatile u32 *)IOP331_REG_ADDR(0x00000850)
287#define IOP331_AAU_SAR14 (volatile u32 *)IOP331_REG_ADDR(0x00000854)
288#define IOP331_AAU_SAR15 (volatile u32 *)IOP331_REG_ADDR(0x00000858)
289#define IOP331_AAU_SAR16 (volatile u32 *)IOP331_REG_ADDR(0x0000085C)
290#define IOP331_AAU_SAR17 (volatile u32 *)IOP331_REG_ADDR(0x00000864)
291#define IOP331_AAU_SAR18 (volatile u32 *)IOP331_REG_ADDR(0x00000868)
292#define IOP331_AAU_SAR19 (volatile u32 *)IOP331_REG_ADDR(0x0000086C)
293#define IOP331_AAU_SAR20 (volatile u32 *)IOP331_REG_ADDR(0x00000870)
294#define IOP331_AAU_SAR21 (volatile u32 *)IOP331_REG_ADDR(0x00000874)
295#define IOP331_AAU_SAR22 (volatile u32 *)IOP331_REG_ADDR(0x00000878)
296#define IOP331_AAU_SAR23 (volatile u32 *)IOP331_REG_ADDR(0x0000087C)
297#define IOP331_AAU_SAR24 (volatile u32 *)IOP331_REG_ADDR(0x00000880)
298#define IOP331_AAU_SAR25 (volatile u32 *)IOP331_REG_ADDR(0x00000888)
299#define IOP331_AAU_SAR26 (volatile u32 *)IOP331_REG_ADDR(0x0000088C)
300#define IOP331_AAU_SAR27 (volatile u32 *)IOP331_REG_ADDR(0x00000890)
301#define IOP331_AAU_SAR28 (volatile u32 *)IOP331_REG_ADDR(0x00000894)
302#define IOP331_AAU_SAR29 (volatile u32 *)IOP331_REG_ADDR(0x00000898)
303#define IOP331_AAU_SAR30 (volatile u32 *)IOP331_REG_ADDR(0x0000089C)
304#define IOP331_AAU_SAR31 (volatile u32 *)IOP331_REG_ADDR(0x000008A0)
305#define IOP331_AAU_SAR32 (volatile u32 *)IOP331_REG_ADDR(0x000008A4)
306#define IOP331_AAU_DAR (volatile u32 *)IOP331_REG_ADDR(0x00000820)
307#define IOP331_AAU_ABCR (volatile u32 *)IOP331_REG_ADDR(0x00000824)
308#define IOP331_AAU_ADCR (volatile u32 *)IOP331_REG_ADDR(0x00000828)
309#define IOP331_AAU_EDCR0 (volatile u32 *)IOP331_REG_ADDR(0x0000083c)
310#define IOP331_AAU_EDCR1 (volatile u32 *)IOP331_REG_ADDR(0x00000860)
311#define IOP331_AAU_EDCR2 (volatile u32 *)IOP331_REG_ADDR(0x00000884)
312
313
314#define IOP331_SPDSCR (volatile u32 *)IOP331_REG_ADDR(0x000015C0)
315#define IOP331_PPDSCR (volatile u32 *)IOP331_REG_ADDR(0x000015C8)
316/* SSP serial port unit 0x00001600 - 0x0000167F */
317
318/* I2C bus interface unit 0x00001680 - 0x000016FF */
319/* for I2C bit defs see drivers/i2c/i2c-iop3xx.h */
320
321#define IOP331_ICR0 (volatile u32 *)IOP331_REG_ADDR(0x00001680)
322#define IOP331_ISR0 (volatile u32 *)IOP331_REG_ADDR(0x00001684)
323#define IOP331_ISAR0 (volatile u32 *)IOP331_REG_ADDR(0x00001688)
324#define IOP331_IDBR0 (volatile u32 *)IOP331_REG_ADDR(0x0000168C)
325/* Reserved 0x00001690 */
326#define IOP331_IBMR0 (volatile u32 *)IOP331_REG_ADDR(0x00001694)
327/* Reserved 0x00001698 */
328/* Reserved 0x0000169C */
329#define IOP331_ICR1 (volatile u32 *)IOP331_REG_ADDR(0x000016A0)
330#define IOP331_ISR1 (volatile u32 *)IOP331_REG_ADDR(0x000016A4)
331#define IOP331_ISAR1 (volatile u32 *)IOP331_REG_ADDR(0x000016A8)
332#define IOP331_IDBR1 (volatile u32 *)IOP331_REG_ADDR(0x000016AC)
333#define IOP331_IBMR1 (volatile u32 *)IOP331_REG_ADDR(0x000016B4)
334/* Reserved 0x000016B8 through 0x000016FF */
335
336/* 0x00001700 through 0x0000172C UART 0 */
337
338/* Reserved 0x00001730 through 0x0000173F */
339
340/* 0x00001740 through 0x0000176C UART 1 */
341
342#define IOP331_UART0_PHYS (IOP331_PHYS_MEM_BASE | 0x00001700) /* UART #1 physical */
343#define IOP331_UART1_PHYS (IOP331_PHYS_MEM_BASE | 0x00001740) /* UART #2 physical */
344#define IOP331_UART0_VIRT (IOP331_VIRT_MEM_BASE | 0x00001700) /* UART #1 virtual addr */
345#define IOP331_UART1_VIRT (IOP331_VIRT_MEM_BASE | 0x00001740) /* UART #2 virtual addr */
346
347/* Reserved 0x00001770 through 0x0000177F */
348
349/* General Purpose I/O Registers */
350#define IOP331_GPOE (volatile u32 *)IOP331_REG_ADDR(0x00001780)
351#define IOP331_GPID (volatile u32 *)IOP331_REG_ADDR(0x00001784)
352#define IOP331_GPOD (volatile u32 *)IOP331_REG_ADDR(0x00001788)
353
354/* Reserved 0x0000178c through 0x000019ff */
355
356
357#ifndef __ASSEMBLY__
358extern void iop331_map_io(void);
359extern void iop331_init_irq(void);
360extern void iop331_time_init(void);
361#endif
362
363#endif // _IOP331_HW_H_
diff --git a/include/asm-arm/arch-iop3xx/iq31244.h b/include/asm-arm/arch-iop3xx/iq31244.h
new file mode 100644
index 000000000000..4177cfa8100f
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/iq31244.h
@@ -0,0 +1,24 @@
1/*
2 * linux/include/asm/arch-iop3xx/iq31244.h
3 *
4 * Intel IQ31244 evaluation board registers
5 */
6
7#ifndef _IQ31244_H_
8#define _IQ31244_H_
9
10#define IQ31244_FLASHBASE 0xf0000000 /* Flash */
11#define IQ31244_FLASHSIZE 0x00800000
12#define IQ31244_FLASHWIDTH 2
13
14#define IQ31244_UART 0xfe800000 /* UART #1 */
15#define IQ31244_7SEG_1 0xfe840000 /* 7-Segment MSB */
16#define IQ31244_7SEG_0 0xfe850000 /* 7-Segment LSB (WO) */
17#define IQ31244_ROTARY_SW 0xfe8d0000 /* Rotary Switch */
18#define IQ31244_BATT_STAT 0xfe8f0000 /* Battery Status */
19
20#ifndef __ASSEMBLY__
21extern void iq31244_map_io(void);
22#endif
23
24#endif // _IQ31244_H_
diff --git a/include/asm-arm/arch-iop3xx/iq80321.h b/include/asm-arm/arch-iop3xx/iq80321.h
new file mode 100644
index 000000000000..cb8725979ffa
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/iq80321.h
@@ -0,0 +1,24 @@
1/*
2 * linux/include/asm/arch-iop3xx/iq80321.h
3 *
4 * Intel IQ80321 evaluation board registers
5 */
6
7#ifndef _IQ80321_H_
8#define _IQ80321_H_
9
10#define IQ80321_FLASHBASE 0xf0000000 /* Flash */
11#define IQ80321_FLASHSIZE 0x00800000
12#define IQ80321_FLASHWIDTH 1
13
14#define IQ80321_UART 0xfe800000 /* UART #1 */
15#define IQ80321_7SEG_1 0xfe840000 /* 7-Segment MSB */
16#define IQ80321_7SEG_0 0xfe850000 /* 7-Segment LSB (WO) */
17#define IQ80321_ROTARY_SW 0xfe8d0000 /* Rotary Switch */
18#define IQ80321_BATT_STAT 0xfe8f0000 /* Battery Status */
19
20#ifndef __ASSEMBLY__
21extern void iq80321_map_io(void);
22#endif
23
24#endif // _IQ80321_H_
diff --git a/include/asm-arm/arch-iop3xx/iq80331.h b/include/asm-arm/arch-iop3xx/iq80331.h
new file mode 100644
index 000000000000..0668e78d483e
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/iq80331.h
@@ -0,0 +1,23 @@
1/*
2 * linux/include/asm/arch-iop3xx/iq80331.h
3 *
4 * Intel IQ80331 evaluation board registers
5 */
6
7#ifndef _IQ80331_H_
8#define _IQ80331_H_
9
10#define IQ80331_FLASHBASE 0xc0000000 /* Flash */
11#define IQ80331_FLASHSIZE 0x00800000
12#define IQ80331_FLASHWIDTH 1
13
14#define IQ80331_7SEG_1 0xce840000 /* 7-Segment MSB */
15#define IQ80331_7SEG_0 0xce850000 /* 7-Segment LSB (WO) */
16#define IQ80331_ROTARY_SW 0xce8d0000 /* Rotary Switch */
17#define IQ80331_BATT_STAT 0xce8f0000 /* Battery Status */
18
19#ifndef __ASSEMBLY__
20extern void iq80331_map_io(void);
21#endif
22
23#endif // _IQ80331_H_
diff --git a/include/asm-arm/arch-iop3xx/iq80332.h b/include/asm-arm/arch-iop3xx/iq80332.h
new file mode 100644
index 000000000000..e5fff1775d1a
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/iq80332.h
@@ -0,0 +1,23 @@
1/*
2 * linux/include/asm/arch-iop3xx/iq80332.h
3 *
4 * Intel IQ80332 evaluation board registers
5 */
6
7#ifndef _IQ80332_H_
8#define _IQ80332_H_
9
10#define IQ80332_FLASHBASE 0xc0000000 /* Flash */
11#define IQ80332_FLASHSIZE 0x00800000
12#define IQ80332_FLASHWIDTH 1
13
14#define IQ80332_7SEG_1 0xce840000 /* 7-Segment MSB */
15#define IQ80332_7SEG_0 0xce850000 /* 7-Segment LSB (WO) */
16#define IQ80332_ROTARY_SW 0xce8d0000 /* Rotary Switch */
17#define IQ80332_BATT_STAT 0xce8f0000 /* Battery Status */
18
19#ifndef __ASSEMBLY__
20extern void iq80332_map_io(void);
21#endif
22
23#endif // _IQ80332_H_
diff --git a/include/asm-arm/arch-iop3xx/irqs.h b/include/asm-arm/arch-iop3xx/irqs.h
new file mode 100644
index 000000000000..b2c03f4c269c
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/irqs.h
@@ -0,0 +1,21 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/irqs.h
3 *
4 * Copyright: (C) 2001-2003 MontaVista Software 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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12/*
13 * Chipset-specific bits
14 */
15#ifdef CONFIG_ARCH_IOP321
16#include "iop321-irqs.h"
17#endif
18
19#ifdef CONFIG_ARCH_IOP331
20#include "iop331-irqs.h"
21#endif
diff --git a/include/asm-arm/arch-iop3xx/memory.h b/include/asm-arm/arch-iop3xx/memory.h
new file mode 100644
index 000000000000..dc4735cb0c10
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/memory.h
@@ -0,0 +1,41 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/memory.h
3 */
4
5#ifndef __ASM_ARCH_MEMORY_H
6#define __ASM_ARCH_MEMORY_H
7
8#include <linux/config.h>
9#include <asm/hardware.h>
10
11/*
12 * Physical DRAM offset.
13 */
14#ifndef CONFIG_ARCH_IOP331
15#define PHYS_OFFSET (0xa0000000UL)
16#else
17#define PHYS_OFFSET (0x00000000UL)
18#endif
19
20/*
21 * Virtual view <-> PCI DMA view memory address translations
22 * virt_to_bus: Used to translate the virtual address to an
23 * address suitable to be passed to set_dma_addr
24 * bus_to_virt: Used to convert an address for DMA operations
25 * to an address that the kernel can use.
26 */
27#if defined(CONFIG_ARCH_IOP321)
28
29#define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP321_IATVR2)) | ((*IOP321_IABAR2) & 0xfffffff0))
30#define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP321_IALR2)) | ( *IOP321_IATVR2)))
31
32#elif defined(CONFIG_ARCH_IOP331)
33
34#define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP331_IATVR2)) | ((*IOP331_IABAR2) & 0xfffffff0))
35#define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP331_IALR2)) | ( *IOP331_IATVR2)))
36
37#endif
38
39#define PFN_TO_NID(addr) (0)
40
41#endif
diff --git a/include/asm-arm/arch-iop3xx/param.h b/include/asm-arm/arch-iop3xx/param.h
new file mode 100644
index 000000000000..acf404e87358
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/param.h
@@ -0,0 +1,3 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/param.h
3 */
diff --git a/include/asm-arm/arch-iop3xx/system.h b/include/asm-arm/arch-iop3xx/system.h
new file mode 100644
index 000000000000..af6ae8cd36c9
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/system.h
@@ -0,0 +1,35 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/system.h
3 *
4 * Copyright (C) 2001 MontaVista Software, 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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11static inline void arch_idle(void)
12{
13 cpu_do_idle();
14}
15
16
17static inline void arch_reset(char mode)
18{
19#ifdef CONFIG_ARCH_IOP321
20 *IOP321_PCSR = 0x30;
21#endif
22
23#ifdef CONFIG_ARCH_IOP331
24 *IOP331_PCSR = 0x30;
25#endif
26
27 if ( 1 && mode == 's') {
28 /* Jump into ROM at address 0 */
29 cpu_reset(0);
30 } else {
31 /* No on-chip reset capability */
32 cpu_reset(0);
33 }
34}
35
diff --git a/include/asm-arm/arch-iop3xx/timex.h b/include/asm-arm/arch-iop3xx/timex.h
new file mode 100644
index 000000000000..d4187fe9a85a
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/timex.h
@@ -0,0 +1,21 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/timex.h
3 *
4 * IOP3xx architecture timex specifications
5 */
6#include <linux/config.h>
7
8
9#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244)
10
11#define CLOCK_TICK_RATE IOP321_TICK_RATE
12
13#elif defined(CONFIG_ARCH_IQ80331) || defined(CONFIG_MACH_IQ80332)
14
15#define CLOCK_TICK_RATE IOP331_TICK_RATE
16
17#else
18
19#error "No IOP3xx timex information for this architecture"
20
21#endif
diff --git a/include/asm-arm/arch-iop3xx/uncompress.h b/include/asm-arm/arch-iop3xx/uncompress.h
new file mode 100644
index 000000000000..82b88762c3cc
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/uncompress.h
@@ -0,0 +1,57 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/uncompress.h
3 */
4#include <linux/config.h>
5#include <asm/types.h>
6#include <asm/mach-types.h>
7#include <linux/serial_reg.h>
8#include <asm/hardware.h>
9
10#ifdef CONFIG_ARCH_IOP321
11#define UTYPE unsigned char *
12#elif defined(CONFIG_ARCH_IOP331)
13#define UTYPE u32 *
14#else
15#error "Missing IOP3xx arch type def"
16#endif
17
18static volatile UTYPE uart_base;
19
20#define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
21
22static __inline__ void putc(char c)
23{
24 while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE);
25 *uart_base = c;
26}
27
28/*
29 * This does not append a newline
30 */
31static void putstr(const char *s)
32{
33 while (*s) {
34 putc(*s);
35 if (*s == '\n')
36 putc('\r');
37 s++;
38 }
39}
40
41static __inline__ void __arch_decomp_setup(unsigned long arch_id)
42{
43 if(machine_is_iq80321())
44 uart_base = (volatile UTYPE)IQ80321_UART;
45 else if(machine_is_iq31244())
46 uart_base = (volatile UTYPE)IQ31244_UART;
47 else if(machine_is_iq80331() || machine_is_iq80332())
48 uart_base = (volatile UTYPE)IOP331_UART0_PHYS;
49 else
50 uart_base = (volatile UTYPE)0xfe800000;
51}
52
53/*
54 * nothing to do
55 */
56#define arch_decomp_setup() __arch_decomp_setup(arch_id)
57#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-iop3xx/vmalloc.h b/include/asm-arm/arch-iop3xx/vmalloc.h
new file mode 100644
index 000000000000..dc1d2a957164
--- /dev/null
+++ b/include/asm-arm/arch-iop3xx/vmalloc.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/vmalloc.h
3 */
4
5/*
6 * Just any arbitrary offset to the start of the vmalloc VM area: the
7 * current 8MB value just means that there will be a 8MB "hole" after the
8 * physical memory until the kernel virtual memory starts. That means that
9 * any out-of-bounds memory accesses will hopefully be caught.
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;)
12 */
13#define VMALLOC_OFFSET (8*1024*1024)
14#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
15#define VMALLOC_VMADDR(x) ((unsigned long)(x))
16//#define VMALLOC_END (0xe8000000)
17/* increase usable physical RAM to ~992M per RMK */
18#define VMALLOC_END (0xfe000000)
19
diff --git a/include/asm-arm/arch-ixp2000/debug-macro.S b/include/asm-arm/arch-ixp2000/debug-macro.S
new file mode 100644
index 000000000000..5631e0889861
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/debug-macro.S
@@ -0,0 +1,40 @@
1/* linux/include/asm-arm/arch-ixp2000/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled?
17 moveq \rx, #0xc0000000 @ Physical base
18 movne \rx, #0xfe000000 @ virtual base
19 orrne \rx, \rx, #0x00f00000
20 orr \rx, \rx, #0x00030000
21#ifdef __ARMEB__
22 orr \rx, \rx, #0x00000003
23#endif
24 .endm
25
26 .macro senduart,rd,rx
27 strb \rd, [\rx]
28 .endm
29
30 .macro busyuart,rd,rx
311002: ldrb \rd, [\rx, #0x14]
32 tst \rd, #0x20
33 beq 1002b
34 .endm
35
36 .macro waituart,rd,rx
37 nop
38 nop
39 nop
40 .endm
diff --git a/include/asm-arm/arch-ixp2000/dma.h b/include/asm-arm/arch-ixp2000/dma.h
new file mode 100644
index 000000000000..0fb3568a98dd
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/dma.h
@@ -0,0 +1,18 @@
1/*
2 * linux/include/asm-arm/arch-ixp2000/dma.h
3 *
4 * Copyright (C) 2002 Intel Corp.
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#ifndef __ASM_ARCH_DMA_H
11#define __ASM_ARCH_DMA_H
12
13#define MAX_DMA_ADDRESS 0xffffffff
14
15/* No DMA */
16#define MAX_DMA_CHANNELS 0
17
18#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-ixp2000/enp2611.h b/include/asm-arm/arch-ixp2000/enp2611.h
new file mode 100644
index 000000000000..31ae88674968
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/enp2611.h
@@ -0,0 +1,28 @@
1/*
2 * include/asm-arm/arch-ixp2000/enp2611.h
3 *
4 * Register and other defines for Radisys ENP-2611
5 *
6 * Created 2004 by Lennert Buytenhek from the ixdp2x01 code. The
7 * original version carries the following notices:
8 *
9 * Original Author: Naeem Afzal <naeem.m.afzal@intel.com>
10 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
11 *
12 * Copyright (C) 2002 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#ifndef __ENP2611_H
22#define __ENP2611_H
23
24#define ENP2611_GPIO_SCL 0x07
25#define ENP2611_GPIO_SDA 0x06
26
27
28#endif
diff --git a/include/asm-arm/arch-ixp2000/entry-macro.S b/include/asm-arm/arch-ixp2000/entry-macro.S
new file mode 100644
index 000000000000..e3a4e4121298
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/entry-macro.S
@@ -0,0 +1,53 @@
1/*
2 * include/asm-arm/arch-ixp2000/entry-macro.S
3 *
4 * Low-level IRQ helper macros for IXP2000-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11 .macro disable_fiq
12 .endm
13
14 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
15
16 mov \irqnr, #0x0 @clear out irqnr as default
17 mov \base, #0xfe000000
18 orr \base, \base, #0x00e00000
19 orr \base, \base, #0x08
20 ldr \irqstat, [\base] @ get interrupts
21
22 cmp \irqstat, #0
23 beq 1001f
24
25 clz \irqnr, \irqstat
26 mov \base, #31
27 subs \irqnr, \base, \irqnr
28
29 /*
30 * We handle PCIA and PCIB here so we don't have an
31 * extra layer of code just to check these two bits.
32 */
33 cmp \irqnr, #IRQ_IXP2000_PCI
34 bne 1001f
35
36 mov \base, #0xfe000000
37 orr \base, \base, #0x00c00000
38 orr \base, \base, #0x00000100
39 orr \base, \base, #0x00000058
40 ldr \irqstat, [\base]
41
42 mov \tmp, #(1<<26)
43 tst \irqstat, \tmp
44 movne \irqnr, #IRQ_IXP2000_PCIA
45 bne 1001f
46
47 mov \tmp, #(1<<27)
48 tst \irqstat, \tmp
49 movne \irqnr, #IRQ_IXP2000_PCIB
50
511001:
52 .endm
53
diff --git a/include/asm-arm/arch-ixp2000/gpio.h b/include/asm-arm/arch-ixp2000/gpio.h
new file mode 100644
index 000000000000..84634af5cc64
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/gpio.h
@@ -0,0 +1,55 @@
1/*
2 * include/asm-arm/arch-ixp2000/ixp2000-gpio.h
3 *
4 * Copyright (C) 2002 Intel 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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/*
12 * IXP2000 GPIO in/out, edge/level detection for IRQs:
13 * IRQs are generated on Falling-edge, Rising-Edge, Level-low, Level-High
14 * or both Falling-edge and Rising-edge.
15 * This must be called *before* the corresponding IRQ is registerd.
16 * Use this instead of directly setting the GPIO registers.
17 * GPIOs may also be used as GPIOs (e.g. for emulating i2c/smb)
18 */
19#ifndef _ASM_ARCH_IXP2000_GPIO_H_
20#define _ASM_ARCH_IXP2000_GPIO_H_
21
22#ifndef __ASSEMBLY__
23#define GPIO_OUT 0x0
24#define GPIO_IN 0x80
25
26#define IXP2000_GPIO_LOW 0
27#define IXP2000_GPIO_HIGH 1
28
29#define GPIO_NO_EDGES 0
30#define GPIO_FALLING_EDGE 1
31#define GPIO_RISING_EDGE 2
32#define GPIO_BOTH_EDGES 3
33#define GPIO_LEVEL_LOW 4
34#define GPIO_LEVEL_HIGH 8
35
36extern void set_GPIO_IRQ_edge(int gpio_nr, int edge);
37extern void set_GPIO_IRQ_level(int gpio_nr, int level);
38extern void gpio_line_config(int line, int style);
39
40static inline int gpio_line_get(int line)
41{
42 return (((*IXP2000_GPIO_PLR) >> line) & 1);
43}
44
45static inline void gpio_line_set(int line, int value)
46{
47 if (value == IXP2000_GPIO_HIGH) {
48 ixp_reg_write(IXP2000_GPIO_POSR, BIT(line));
49 } else if (value == IXP2000_GPIO_LOW)
50 ixp_reg_write(IXP2000_GPIO_POCR, BIT(line));
51}
52
53#endif /* !__ASSEMBLY__ */
54#endif /* ASM_ARCH_IXP2000_GPIO_H_ */
55
diff --git a/include/asm-arm/arch-ixp2000/hardware.h b/include/asm-arm/arch-ixp2000/hardware.h
new file mode 100644
index 000000000000..e7ea781c48aa
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/hardware.h
@@ -0,0 +1,44 @@
1/*
2 * linux/include/asm-arm/arch-ixp2000/hardware.h
3 *
4 * Hardware definitions for IXP2400/2800 based systems
5 *
6 * Original Author: Naeem M Afzal <naeem.m.afzal@intel.com>
7 *
8 * Maintainer: Deepak Saxena <dsaxena@mvista.com>
9 *
10 * Copyright (C) 2001-2002 Intel Corp.
11 * Copyright (C) 2003-2004 MontaVista Software, Inc.
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
17 */
18
19#ifndef __ASM_ARCH_HARDWARE_H__
20#define __ASM_ARCH_HARDWARE_H__
21
22/*
23 * This needs to be platform-specific?
24 */
25#define PCIBIOS_MIN_IO 0x00000000
26#define PCIBIOS_MIN_MEM 0x00000000
27
28#include "ixp2000-regs.h" /* Chipset Registers */
29
30#define pcibios_assign_all_busses() 0
31
32/*
33 * Platform helper functions
34 */
35#include "platform.h"
36
37/*
38 * Platform-specific bits
39 */
40#include "enp2611.h" /* ENP-2611 */
41#include "ixdp2x00.h" /* IXDP2400/2800 */
42#include "ixdp2x01.h" /* IXDP2401/2801 */
43
44#endif /* _ASM_ARCH_HARDWARE_H__ */
diff --git a/include/asm-arm/arch-ixp2000/io.h b/include/asm-arm/arch-ixp2000/io.h
new file mode 100644
index 000000000000..a8e3c2daefd6
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/io.h
@@ -0,0 +1,150 @@
1/*
2 * linux/include/asm-arm/arch-ixp2000/io.h
3 *
4 * Original Author: Naeem M Afzal <naeem.m.afzal@intel.com>
5 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
6 *
7 * Copyright (C) 2002 Intel Corp.
8 * Copyrgiht (C) 2003-2004 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#ifndef __ASM_ARM_ARCH_IO_H
16#define __ASM_ARM_ARCH_IO_H
17
18#define IO_SPACE_LIMIT 0xffffffff
19#define __mem_pci(a) (a)
20#define ___io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
21
22/*
23 * The IXP2400 before revision B0 asserts byte lanes for PCI I/O
24 * transactions the other way round (MEM transactions don't have this
25 * issue), so we need to override the standard functions. B0 and later
26 * have a bit that can be set to 1 to get the 'proper' behavior, but
27 * since that isn't available on the A? revisions we just keep doing
28 * things manually.
29 */
30#define alignb(addr) (void __iomem *)((unsigned long)addr ^ 3)
31#define alignw(addr) (void __iomem *)((unsigned long)addr ^ 2)
32
33#define outb(v,p) __raw_writeb((v),alignb(___io(p)))
34#define outw(v,p) __raw_writew((v),alignw(___io(p)))
35#define outl(v,p) __raw_writel((v),___io(p))
36
37#define inb(p) ({ unsigned int __v = __raw_readb(alignb(___io(p))); __v; })
38#define inw(p) \
39 ({ unsigned int __v = (__raw_readw(alignw(___io(p)))); __v; })
40#define inl(p) \
41 ({ unsigned int __v = (__raw_readl(___io(p))); __v; })
42
43#define outsb(p,d,l) __raw_writesb(alignb(___io(p)),d,l)
44#define outsw(p,d,l) __raw_writesw(alignw(___io(p)),d,l)
45#define outsl(p,d,l) __raw_writesl(___io(p),d,l)
46
47#define insb(p,d,l) __raw_readsb(alignb(___io(p)),d,l)
48#define insw(p,d,l) __raw_readsw(alignw(___io(p)),d,l)
49#define insl(p,d,l) __raw_readsl(___io(p),d,l)
50
51
52#ifdef CONFIG_ARCH_IXDP2X01
53/*
54 * This is an ugly hack but the CS8900 on the 2x01's does not sit in any sort
55 * of "I/O space" and is just direct mapped into a 32-bit-only addressable
56 * bus. The address space for this bus is such that we can't really easily
57 * make it contiguous to the PCI I/O address range, and it also does not
58 * need swapping like PCI addresses do (IXDP2x01 is a BE platform).
59 * B/C of this we can't use the standard in/out functions and need to
60 * runtime check if the incoming address is a PCI address or for
61 * the CS89x0.
62 */
63#undef inw
64#undef outw
65#undef insw
66#undef outsw
67
68#include <asm/mach-types.h>
69
70static inline void insw(u32 ptr, void *buf, int length)
71{
72 register volatile u32 *port = (volatile u32 *)ptr;
73
74 /*
75 * Is this cycle meant for the CS8900?
76 */
77 if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
78 ((port >= IXDP2X01_CS8900_VIRT_BASE) &&
79 (port <= IXDP2X01_CS8900_VIRT_END))) {
80 u8 *buf8 = (u8*)buf;
81 register u32 tmp32;
82
83 do {
84 tmp32 = *port;
85 *buf8++ = (u8)tmp32;
86 *buf8++ = (u8)(tmp32 >> 8);
87 } while(--length);
88
89 return;
90 }
91
92 __raw_readsw(alignw(___io(ptr)),buf,length);
93}
94
95static inline void outsw(u32 ptr, void *buf, int length)
96{
97 register volatile u32 *port = (volatile u32 *)ptr;
98
99 /*
100 * Is this cycle meant for the CS8900?
101 */
102 if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
103 ((port >= IXDP2X01_CS8900_VIRT_BASE) &&
104 (port <= IXDP2X01_CS8900_VIRT_END))) {
105 register u32 tmp32;
106 u8 *buf8 = (u8*)buf;
107 do {
108 tmp32 = *buf8++;
109 tmp32 |= (*buf8++) << 8;
110 *port = tmp32;
111 } while(--length);
112 return;
113 }
114
115 __raw_writesw(alignw(___io(ptr)),buf,length);
116}
117
118
119static inline u16 inw(u32 ptr)
120{
121 register volatile u32 *port = (volatile u32 *)ptr;
122
123 /*
124 * Is this cycle meant for the CS8900?
125 */
126 if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
127 ((port >= IXDP2X01_CS8900_VIRT_BASE) &&
128 (port <= IXDP2X01_CS8900_VIRT_END))) {
129 return (u16)(*port);
130 }
131
132 return __raw_readw(alignw(___io(ptr)));
133}
134
135static inline void outw(u16 value, u32 ptr)
136{
137 register volatile u32 *port = (volatile u32 *)ptr;
138
139 if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
140 ((port >= IXDP2X01_CS8900_VIRT_BASE) &&
141 (port <= IXDP2X01_CS8900_VIRT_END))) {
142 *port = value;
143 return;
144 }
145
146 __raw_writew((value),alignw(___io(ptr)));
147}
148#endif /* IXDP2x01 */
149
150#endif
diff --git a/include/asm-arm/arch-ixp2000/irq.h b/include/asm-arm/arch-ixp2000/irq.h
new file mode 100644
index 000000000000..ba00b23f9828
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/irq.h
@@ -0,0 +1,13 @@
1/*
2 * linux/include/asm-arm/arch-ixp2000/irq.h
3 *
4 * Copyright (C) 2002 Intel Corp.
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#define fixup_irq(irq) (irq)
12
13
diff --git a/include/asm-arm/arch-ixp2000/irqs.h b/include/asm-arm/arch-ixp2000/irqs.h
new file mode 100644
index 000000000000..0deb96c12adb
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/irqs.h
@@ -0,0 +1,174 @@
1/*
2 * linux/include/asm-arm/arch-ixp2000/irqs.h
3 *
4 * Original Author: Naeem Afzal <naeem.m.afzal@intel.com>
5 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
6 *
7 * Copyright (C) 2002 Intel Corp.
8 * Copyright (C) 2003-2004 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#ifndef _IRQS_H
16#define _IRQS_H
17
18/*
19 * Do NOT add #ifdef MACHINE_FOO in here.
20 * Simpy add your machine IRQs here and increase NR_IRQS if needed to
21 * hold your machine's IRQ table.
22 */
23
24/*
25 * Some interrupt numbers go unused b/c the IRQ mask/ummask/status
26 * register has those bit reserved. We just mark those interrupts
27 * as invalid and this allows us to do mask/unmask with a single
28 * shift operation instead of having to map the IRQ number to
29 * a HW IRQ number.
30 */
31#define IRQ_IXP2000_SOFT_INT 0 /* soft interrupt */
32#define IRQ_IXP2000_ERRSUM 1 /* OR of all bits in ErrorStatus reg*/
33#define IRQ_IXP2000_UART 2
34#define IRQ_IXP2000_GPIO 3
35#define IRQ_IXP2000_TIMER1 4
36#define IRQ_IXP2000_TIMER2 5
37#define IRQ_IXP2000_TIMER3 6
38#define IRQ_IXP2000_TIMER4 7
39#define IRQ_IXP2000_PMU 8
40#define IRQ_IXP2000_SPF 9 /* Slow port framer IRQ */
41#define IRQ_IXP2000_DMA1 10
42#define IRQ_IXP2000_DMA2 11
43#define IRQ_IXP2000_DMA3 12
44#define IRQ_IXP2000_PCI_DOORBELL 13
45#define IRQ_IXP2000_ME_ATTN 14
46#define IRQ_IXP2000_PCI 15 /* PCI INTA or INTB */
47#define IRQ_IXP2000_THDA0 16 /* thread 0-31A */
48#define IRQ_IXP2000_THDA1 17 /* thread 32-63A, IXP2800 only */
49#define IRQ_IXP2000_THDA2 18 /* thread 64-95A */
50#define IRQ_IXP2000_THDA3 19 /* thread 96-127A, IXP2800 only */
51#define IRQ_IXP2000_THDB0 24 /* thread 0-31B */
52#define IRQ_IXP2000_THDB1 25 /* thread 32-63B, IXP2800 only */
53#define IRQ_IXP2000_THDB2 26 /* thread 64-95B */
54#define IRQ_IXP2000_THDB3 27 /* thread 96-127B, IXP2800 only */
55
56/* define generic GPIOs */
57#define IRQ_IXP2000_GPIO0 32
58#define IRQ_IXP2000_GPIO1 33
59#define IRQ_IXP2000_GPIO2 34
60#define IRQ_IXP2000_GPIO3 35
61#define IRQ_IXP2000_GPIO4 36
62#define IRQ_IXP2000_GPIO5 37
63#define IRQ_IXP2000_GPIO6 38
64#define IRQ_IXP2000_GPIO7 39
65
66/* split off the 2 PCI sources */
67#define IRQ_IXP2000_PCIA 40
68#define IRQ_IXP2000_PCIB 41
69
70#define NR_IXP2000_IRQS 42
71
72#define IXP2000_BOARD_IRQ(x) (NR_IXP2000_IRQS + (x))
73
74#define IXP2000_BOARD_IRQ_MASK(irq) (1 << (irq - NR_IXP2000_IRQS))
75
76/*
77 * This allows for all the on-chip sources plus up to 32 CPLD based
78 * IRQs. Should be more than enough.
79 */
80#define IXP2000_BOARD_IRQS 32
81#define NR_IRQS (NR_IXP2000_IRQS + IXP2000_BOARD_IRQS)
82
83
84/*
85 * IXDP2400 specific IRQs
86 */
87#define IRQ_IXDP2400_INGRESS_NPU IXP2000_BOARD_IRQ(0)
88#define IRQ_IXDP2400_ENET IXP2000_BOARD_IRQ(1)
89#define IRQ_IXDP2400_MEDIA_PCI IXP2000_BOARD_IRQ(2)
90#define IRQ_IXDP2400_MEDIA_SP IXP2000_BOARD_IRQ(3)
91#define IRQ_IXDP2400_SF_PCI IXP2000_BOARD_IRQ(4)
92#define IRQ_IXDP2400_SF_SP IXP2000_BOARD_IRQ(5)
93#define IRQ_IXDP2400_PMC IXP2000_BOARD_IRQ(6)
94#define IRQ_IXDP2400_TVM IXP2000_BOARD_IRQ(7)
95
96#define NR_IXDP2400_IRQS ((IRQ_IXDP2400_TVM)+1)
97#define IXDP2400_NR_IRQS NR_IXDP2400_IRQS - NR_IXP2000_IRQS
98
99/* IXDP2800 specific IRQs */
100#define IRQ_IXDP2800_EGRESS_ENET IXP2000_BOARD_IRQ(0)
101#define IRQ_IXDP2800_INGRESS_NPU IXP2000_BOARD_IRQ(1)
102#define IRQ_IXDP2800_PMC IXP2000_BOARD_IRQ(2)
103#define IRQ_IXDP2800_FABRIC_PCI IXP2000_BOARD_IRQ(3)
104#define IRQ_IXDP2800_FABRIC IXP2000_BOARD_IRQ(4)
105#define IRQ_IXDP2800_MEDIA IXP2000_BOARD_IRQ(5)
106
107#define NR_IXDP2800_IRQS ((IRQ_IXDP2800_MEDIA)+1)
108#define IXDP2800_NR_IRQS NR_IXDP2800_IRQS - NR_IXP2000_IRQS
109
110/*
111 * IRQs on both IXDP2x01 boards
112 */
113#define IRQ_IXDP2X01_SPCI_DB_0 IXP2000_BOARD_IRQ(2)
114#define IRQ_IXDP2X01_SPCI_DB_1 IXP2000_BOARD_IRQ(3)
115#define IRQ_IXDP2X01_SPCI_PMC_INTA IXP2000_BOARD_IRQ(4)
116#define IRQ_IXDP2X01_SPCI_PMC_INTB IXP2000_BOARD_IRQ(5)
117#define IRQ_IXDP2X01_SPCI_PMC_INTC IXP2000_BOARD_IRQ(6)
118#define IRQ_IXDP2X01_SPCI_PMC_INTD IXP2000_BOARD_IRQ(7)
119#define IRQ_IXDP2X01_SPCI_FIC_INT IXP2000_BOARD_IRQ(8)
120#define IRQ_IXDP2X01_IPMI_FROM IXP2000_BOARD_IRQ(16)
121#define IRQ_IXDP2X01_125US IXP2000_BOARD_IRQ(17)
122#define IRQ_IXDP2X01_DB_0_ADD IXP2000_BOARD_IRQ(18)
123#define IRQ_IXDP2X01_DB_1_ADD IXP2000_BOARD_IRQ(19)
124#define IRQ_IXDP2X01_UART1 IXP2000_BOARD_IRQ(21)
125#define IRQ_IXDP2X01_UART2 IXP2000_BOARD_IRQ(22)
126#define IRQ_IXDP2X01_FIC_ADD_INT IXP2000_BOARD_IRQ(24)
127#define IRQ_IXDP2X01_CS8900 IXP2000_BOARD_IRQ(25)
128#define IRQ_IXDP2X01_BBSRAM IXP2000_BOARD_IRQ(26)
129
130#define IXDP2X01_VALID_IRQ_MASK ( \
131 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_SPCI_DB_0) | \
132 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_SPCI_DB_1) | \
133 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_SPCI_PMC_INTA) | \
134 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_SPCI_PMC_INTB) | \
135 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_SPCI_PMC_INTC) | \
136 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_SPCI_PMC_INTD) | \
137 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_SPCI_FIC_INT) | \
138 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_IPMI_FROM) | \
139 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_125US) | \
140 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_DB_0_ADD) | \
141 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_DB_1_ADD) | \
142 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_UART1) | \
143 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_UART2) | \
144 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_FIC_ADD_INT) | \
145 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_CS8900) | \
146 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2X01_BBSRAM) )
147
148/*
149 * IXDP2401 specific IRQs
150 */
151#define IRQ_IXDP2401_INTA_82546 IXP2000_BOARD_IRQ(0)
152#define IRQ_IXDP2401_INTB_82546 IXP2000_BOARD_IRQ(1)
153
154#define IXDP2401_VALID_IRQ_MASK ( \
155 IXDP2X01_VALID_IRQ_MASK | \
156 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2401_INTA_82546) |\
157 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2401_INTB_82546))
158
159/*
160 * IXDP2801-specific IRQs
161 */
162#define IRQ_IXDP2801_RIV IXP2000_BOARD_IRQ(0)
163#define IRQ_IXDP2801_CNFG_MEDIA IXP2000_BOARD_IRQ(27)
164#define IRQ_IXDP2801_CLOCK_REF IXP2000_BOARD_IRQ(28)
165
166#define IXDP2801_VALID_IRQ_MASK ( \
167 IXDP2X01_VALID_IRQ_MASK | \
168 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2801_RIV) |\
169 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2801_CNFG_MEDIA) |\
170 IXP2000_BOARD_IRQ_MASK(IRQ_IXDP2801_CLOCK_REF))
171
172#define NR_IXDP2X01_IRQS ((IRQ_IXDP2801_CLOCK_REF) + 1)
173
174#endif /*_IRQS_H*/
diff --git a/include/asm-arm/arch-ixp2000/ixdp2x00.h b/include/asm-arm/arch-ixp2000/ixdp2x00.h
new file mode 100644
index 000000000000..3a398dfbf125
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/ixdp2x00.h
@@ -0,0 +1,93 @@
1/*
2 * include/asm-arm/arch-ixp2000/ixdp2x00.h
3 *
4 * Register and other defines for IXDP2[48]00 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#ifndef _IXDP2X00_H_
18#define _IXDP2X00_H_
19
20/*
21 * On board CPLD memory map
22 */
23#define IXDP2X00_PHYS_CPLD_BASE 0xc7000000
24#define IXDP2X00_VIRT_CPLD_BASE 0xfafff000
25#define IXDP2X00_CPLD_SIZE 0x00001000
26
27
28#define IXDP2X00_CPLD_REG(x) \
29 (volatile unsigned long *)(IXDP2X00_VIRT_CPLD_BASE | x)
30
31/*
32 * IXDP2400 CPLD registers
33 */
34#define IXDP2400_CPLD_SYSLED IXDP2X00_CPLD_REG(0x0)
35#define IXDP2400_CPLD_DISP_DATA IXDP2X00_CPLD_REG(0x4)
36#define IXDP2400_CPLD_CLOCK_SPEED IXDP2X00_CPLD_REG(0x8)
37#define IXDP2400_CPLD_INT_STAT IXDP2X00_CPLD_REG(0xc)
38#define IXDP2400_CPLD_REV IXDP2X00_CPLD_REG(0x10)
39#define IXDP2400_CPLD_SYS_CLK_M IXDP2X00_CPLD_REG(0x14)
40#define IXDP2400_CPLD_SYS_CLK_N IXDP2X00_CPLD_REG(0x18)
41#define IXDP2400_CPLD_INT_MASK IXDP2X00_CPLD_REG(0x48)
42
43/*
44 * IXDP2800 CPLD registers
45 */
46#define IXDP2800_CPLD_INT_STAT IXDP2X00_CPLD_REG(0x0)
47#define IXDP2800_CPLD_INT_MASK IXDP2X00_CPLD_REG(0x140)
48
49
50#define IXDP2X00_GPIO_I2C_ENABLE 0x02
51#define IXDP2X00_GPIO_SCL 0x07
52#define IXDP2X00_GPIO_SDA 0x06
53
54/*
55 * PCI devfns for on-board devices. We need these to be able to
56 * properly translate IRQs and for device removal.
57 */
58#define IXDP2400_SLAVE_ENET_DEVFN 0x18 /* Bus 1 */
59#define IXDP2400_MASTER_ENET_DEVFN 0x20 /* Bus 1 */
60#define IXDP2400_MEDIA_DEVFN 0x28 /* Bus 1 */
61#define IXDP2400_SWITCH_FABRIC_DEVFN 0x30 /* Bus 1 */
62
63#define IXDP2800_SLAVE_ENET_DEVFN 0x20 /* Bus 1 */
64#define IXDP2800_MASTER_ENET_DEVFN 0x18 /* Bus 1 */
65#define IXDP2800_SWITCH_FABRIC_DEVFN 0x30 /* Bus 1 */
66
67#define IXDP2X00_P2P_DEVFN 0x20 /* Bus 0 */
68#define IXDP2X00_21555_DEVFN 0x30 /* Bus 0 */
69#define IXDP2X00_SLAVE_NPU_DEVFN 0x28 /* Bus 1 */
70#define IXDP2X00_PMC_DEVFN 0x38 /* Bus 1 */
71#define IXDP2X00_MASTER_NPU_DEVFN 0x38 /* Bus 1 */
72
73#ifndef __ASSEMBLY__
74/*
75 * Master NPU will always have flash and be PCI master.
76 * Slave NPU may or may not have flash but will never be PCI master.
77 */
78static inline unsigned int ixdp2x00_master_npu(void)
79{
80 return ((ixp2000_has_flash()) && (ixp2000_is_pcimaster()));
81}
82
83/*
84 * Helper functions used by ixdp2400 and ixdp2800 specific code
85 */
86void ixdp2x00_init_irq(volatile unsigned long*, volatile unsigned long *, unsigned long);
87void ixdp2x00_slave_pci_postinit(void);
88void ixdp2x00_init_machine(void);
89void ixdp2x00_map_io(void);
90
91#endif
92
93#endif /*_IXDP2X00_H_ */
diff --git a/include/asm-arm/arch-ixp2000/ixdp2x01.h b/include/asm-arm/arch-ixp2000/ixdp2x01.h
new file mode 100644
index 000000000000..b3a1bcda8d01
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/ixdp2x01.h
@@ -0,0 +1,57 @@
1/*
2 * include/asm-arm/arch-ixp2000/ixdp2x01.h
3 *
4 * Platform definitions for IXDP2X01 && IXDP2801 systems
5 *
6 * Author: Deepak Saxena <dsaxena@plexity.net>
7 *
8 * Copyright 2004 (c) MontaVista Software, Inc.
9 *
10 * Based on original code 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#ifndef __IXDP2X01_H__
18#define __IXDP2X01_H__
19
20#define IXDP2X01_PHYS_CPLD_BASE 0xc6024000
21#define IXDP2X01_VIRT_CPLD_BASE 0xfafff000
22#define IXDP2X01_CPLD_REGION_SIZE 0x00001000
23
24#define IXDP2X01_CPLD_VIRT_REG(reg) (volatile unsigned long*)(IXDP2X01_VIRT_CPLD_BASE | reg)
25#define IXDP2X01_CPLD_PHYS_REG(reg) (volatile u32*)(IXDP2X01_PHYS_CPLD_BASE | reg)
26
27#define IXDP2X01_UART1_VIRT_BASE IXDP2X01_CPLD_VIRT_REG(0x40)
28#define IXDP2X01_UART1_PHYS_BASE IXDP2X01_CPLD_PHYS_REG(0x40)
29
30#define IXDP2X01_UART2_VIRT_BASE IXDP2X01_CPLD_VIRT_REG(0x60)
31#define IXDP2X01_UART2_PHYS_BASE IXDP2X01_CPLD_PHYS_REG(0x60)
32
33#define IXDP2X01_CS8900_VIRT_BASE IXDP2X01_CPLD_VIRT_REG(0x80)
34#define IXDP2X01_CS8900_VIRT_END (IXDP2X01_CS8900_VIRT_BASE + 16)
35
36#define IXDP2X01_CPLD_RESET_REG IXDP2X01_CPLD_VIRT_REG(0x00)
37#define IXDP2X01_INT_MASK_SET_REG IXDP2X01_CPLD_VIRT_REG(0x08)
38#define IXDP2X01_INT_STAT_REG IXDP2X01_CPLD_VIRT_REG(0x0C)
39#define IXDP2X01_INT_RAW_REG IXDP2X01_CPLD_VIRT_REG(0x10)
40#define IXDP2X01_INT_MASK_CLR_REG IXDP2X01_INT_RAW_REG
41#define IXDP2X01_INT_SIM_REG IXDP2X01_CPLD_VIRT_REG(0x14)
42
43#define IXDP2X01_CPLD_FLASH_REG IXDP2X01_CPLD_VIRT_REG(0x20)
44
45#define IXDP2X01_CPLD_FLASH_INTERN 0x8000
46#define IXDP2X01_CPLD_FLASH_BANK_MASK 0xF
47#define IXDP2X01_FLASH_WINDOW_BITS 25
48#define IXDP2X01_FLASH_WINDOW_SIZE (1 << IXDP2X01_FLASH_WINDOW_BITS)
49#define IXDP2X01_FLASH_WINDOW_MASK (IXDP2X01_FLASH_WINDOW_SIZE - 1)
50
51#define IXDP2X01_UART_CLK 1843200
52
53#define IXDP2X01_GPIO_I2C_ENABLE 0x02
54#define IXDP2X01_GPIO_SCL 0x07
55#define IXDP2X01_GPIO_SDA 0x06
56
57#endif /* __IXDP2x01_H__ */
diff --git a/include/asm-arm/arch-ixp2000/ixp2000-regs.h b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
new file mode 100644
index 000000000000..6c56708d0ff0
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
@@ -0,0 +1,377 @@
1/*
2 * include/asm-arm/arch-ixp2000/ixp2000-regs.h
3 *
4 * Chipset register definitions for IXP2400/2800 based systems.
5 *
6 * Original Author: Naeem Afzal <naeem.m.afzal@intel.com>
7 *
8 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
9 *
10 * Copyright (C) 2002 Intel Corp.
11 * Copyright (C) 2003-2004 MontaVista Software, Inc.
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
17 */
18#ifndef _IXP2000_REGS_H_
19#define _IXP2000_REGS_H_
20
21/*
22 * Static I/O regions.
23 *
24 * Most of the registers are clumped in 4K regions spread throughout
25 * the 0xc0000000 -> 0xc0100000 address range, but we just map in
26 * the whole range using a single 1 MB section instead of small
27 * 4K pages. This has two advantages for us:
28 *
29 * 1) We use only one TLB entry for large number of on-chip I/O devices.
30 *
31 * 2) We can easily set the Section attributes to XCB=101 on the IXP2400
32 * as required per erratum #66. We accomplish this by using a
33 * new MT_IXP2000_DEVICE memory type with the bits set as required.
34 *
35 * CAP stands for CSR Access Proxy.
36 *
37 * If you change the virtual address of this mapping, please propagate
38 * the change to arch/arm/kernel/debug.S, which hardcodes the virtual
39 * address of the UART located in this region.
40 */
41
42#define IXP2000_CAP_PHYS_BASE 0xc0000000
43#define IXP2000_CAP_VIRT_BASE 0xfef00000
44#define IXP2000_CAP_SIZE 0x00100000
45
46/*
47 * Addresses for specific on-chip peripherals
48 */
49#define IXP2000_SLOWPORT_CSR_VIRT_BASE 0xfef80000
50#define IXP2000_GLOBAL_REG_VIRT_BASE 0xfef04000
51#define IXP2000_UART_PHYS_BASE 0xc0030000
52#define IXP2000_UART_VIRT_BASE 0xfef30000
53#define IXP2000_TIMER_VIRT_BASE 0xfef20000
54#define IXP2000_GPIO_VIRT_BASE 0Xfef10000
55
56/*
57 * Devices outside of the 0xc0000000 -> 0xc0100000 range. The virtual
58 * addresses of the INTCTL and PCI_CSR mappings are hardcoded in
59 * entry-macro.S, so if you ever change these please propagate
60 * the change.
61 */
62#define IXP2000_INTCTL_PHYS_BASE 0xd6000000
63#define IXP2000_INTCTL_VIRT_BASE 0xfee00000
64#define IXP2000_INTCTL_SIZE 0x00100000
65
66#define IXP2000_PCI_CREG_PHYS_BASE 0xde000000
67#define IXP2000_PCI_CREG_VIRT_BASE 0xfed00000
68#define IXP2000_PCI_CREG_SIZE 0x00100000
69
70#define IXP2000_PCI_CSR_PHYS_BASE 0xdf000000
71#define IXP2000_PCI_CSR_VIRT_BASE 0xfec00000
72#define IXP2000_PCI_CSR_SIZE 0x00100000
73
74#define IXP2000_PCI_IO_PHYS_BASE 0xd8000000
75#define IXP2000_PCI_IO_VIRT_BASE 0xfd000000
76#define IXP2000_PCI_IO_SIZE 0x01000000
77
78#define IXP2000_PCI_CFG0_PHYS_BASE 0xda000000
79#define IXP2000_PCI_CFG0_VIRT_BASE 0xfc000000
80#define IXP2000_PCI_CFG0_SIZE 0x01000000
81
82#define IXP2000_PCI_CFG1_PHYS_BASE 0xdb000000
83#define IXP2000_PCI_CFG1_VIRT_BASE 0xfb000000
84#define IXP2000_PCI_CFG1_SIZE 0x01000000
85
86/*
87 * Timers
88 */
89#define IXP2000_TIMER_REG(x) ((volatile unsigned long*)(IXP2000_TIMER_VIRT_BASE | (x)))
90/* Timer control */
91#define IXP2000_T1_CTL IXP2000_TIMER_REG(0x00)
92#define IXP2000_T2_CTL IXP2000_TIMER_REG(0x04)
93#define IXP2000_T3_CTL IXP2000_TIMER_REG(0x08)
94#define IXP2000_T4_CTL IXP2000_TIMER_REG(0x0c)
95/* Store initial value */
96#define IXP2000_T1_CLD IXP2000_TIMER_REG(0x10)
97#define IXP2000_T2_CLD IXP2000_TIMER_REG(0x14)
98#define IXP2000_T3_CLD IXP2000_TIMER_REG(0x18)
99#define IXP2000_T4_CLD IXP2000_TIMER_REG(0x1c)
100/* Read current value */
101#define IXP2000_T1_CSR IXP2000_TIMER_REG(0x20)
102#define IXP2000_T2_CSR IXP2000_TIMER_REG(0x24)
103#define IXP2000_T3_CSR IXP2000_TIMER_REG(0x28)
104#define IXP2000_T4_CSR IXP2000_TIMER_REG(0x2c)
105/* Clear associated timer interrupt */
106#define IXP2000_T1_CLR IXP2000_TIMER_REG(0x30)
107#define IXP2000_T2_CLR IXP2000_TIMER_REG(0x34)
108#define IXP2000_T3_CLR IXP2000_TIMER_REG(0x38)
109#define IXP2000_T4_CLR IXP2000_TIMER_REG(0x3c)
110/* Timer watchdog enable for T4 */
111#define IXP2000_TWDE IXP2000_TIMER_REG(0x40)
112
113#define WDT_ENABLE 0x00000001
114#define TIMER_DIVIDER_256 0x00000008
115#define TIMER_ENABLE 0x00000080
116#define IRQ_MASK_TIMER1 (1 << 4)
117
118/*
119 * Interrupt controller registers
120 */
121#define IXP2000_INTCTL_REG(x) (volatile unsigned long*)(IXP2000_INTCTL_VIRT_BASE | (x))
122#define IXP2000_IRQ_STATUS IXP2000_INTCTL_REG(0x08)
123#define IXP2000_IRQ_ENABLE IXP2000_INTCTL_REG(0x10)
124#define IXP2000_IRQ_ENABLE_SET IXP2000_INTCTL_REG(0x10)
125#define IXP2000_IRQ_ENABLE_CLR IXP2000_INTCTL_REG(0x18)
126#define IXP2000_FIQ_ENABLE_CLR IXP2000_INTCTL_REG(0x14)
127#define IXP2000_IRQ_ERR_STATUS IXP2000_INTCTL_REG(0x24)
128#define IXP2000_IRQ_ERR_ENABLE_SET IXP2000_INTCTL_REG(0x2c)
129#define IXP2000_FIQ_ERR_ENABLE_CLR IXP2000_INTCTL_REG(0x30)
130#define IXP2000_IRQ_ERR_ENABLE_CLR IXP2000_INTCTL_REG(0x34)
131#define IXP2000_IRQ_THD_RAW_STATUS_A_0 IXP2000_INTCTL_REG(0x60)
132#define IXP2000_IRQ_THD_RAW_STATUS_A_1 IXP2000_INTCTL_REG(0x64)
133#define IXP2000_IRQ_THD_RAW_STATUS_A_2 IXP2000_INTCTL_REG(0x68)
134#define IXP2000_IRQ_THD_RAW_STATUS_A_3 IXP2000_INTCTL_REG(0x6c)
135#define IXP2000_IRQ_THD_RAW_STATUS_B_0 IXP2000_INTCTL_REG(0x80)
136#define IXP2000_IRQ_THD_RAW_STATUS_B_1 IXP2000_INTCTL_REG(0x84)
137#define IXP2000_IRQ_THD_RAW_STATUS_B_2 IXP2000_INTCTL_REG(0x88)
138#define IXP2000_IRQ_THD_RAW_STATUS_B_3 IXP2000_INTCTL_REG(0x8c)
139#define IXP2000_IRQ_THD_ENABLE_SET_A_0 IXP2000_INTCTL_REG(0x160)
140#define IXP2000_IRQ_THD_ENABLE_SET_A_1 IXP2000_INTCTL_REG(0x164)
141#define IXP2000_IRQ_THD_ENABLE_SET_A_2 IXP2000_INTCTL_REG(0x168)
142#define IXP2000_IRQ_THD_ENABLE_SET_A_3 IXP2000_INTCTL_REG(0x16c)
143#define IXP2000_IRQ_THD_ENABLE_SET_B_0 IXP2000_INTCTL_REG(0x180)
144#define IXP2000_IRQ_THD_ENABLE_SET_B_1 IXP2000_INTCTL_REG(0x184)
145#define IXP2000_IRQ_THD_ENABLE_SET_B_2 IXP2000_INTCTL_REG(0x188)
146#define IXP2000_IRQ_THD_ENABLE_SET_B_3 IXP2000_INTCTL_REG(0x18c)
147#define IXP2000_IRQ_THD_ENABLE_CLEAR_A_0 IXP2000_INTCTL_REG(0x1e0)
148#define IXP2000_IRQ_THD_ENABLE_CLEAR_A_1 IXP2000_INTCTL_REG(0x1e4)
149#define IXP2000_IRQ_THD_ENABLE_CLEAR_A_2 IXP2000_INTCTL_REG(0x1e8)
150#define IXP2000_IRQ_THD_ENABLE_CLEAR_A_3 IXP2000_INTCTL_REG(0x1ec)
151#define IXP2000_IRQ_THD_ENABLE_CLEAR_B_0 IXP2000_INTCTL_REG(0x200)
152#define IXP2000_IRQ_THD_ENABLE_CLEAR_B_1 IXP2000_INTCTL_REG(0x204)
153#define IXP2000_IRQ_THD_ENABLE_CLEAR_B_2 IXP2000_INTCTL_REG(0x208)
154#define IXP2000_IRQ_THD_ENABLE_CLEAR_B_3 IXP2000_INTCTL_REG(0x20c)
155
156/*
157 * Mask of valid IRQs in the 32-bit IRQ register. We use
158 * this to mark certain IRQs as being invalid.
159 */
160#define IXP2000_VALID_IRQ_MASK 0x0f0fffff
161
162/*
163 * PCI config register access from core
164 */
165#define IXP2000_PCI_CREG(x) (volatile unsigned long*)(IXP2000_PCI_CREG_VIRT_BASE | (x))
166#define IXP2000_PCI_CMDSTAT IXP2000_PCI_CREG(0x04)
167#define IXP2000_PCI_CSR_BAR IXP2000_PCI_CREG(0x10)
168#define IXP2000_PCI_SRAM_BAR IXP2000_PCI_CREG(0x14)
169#define IXP2000_PCI_SDRAM_BAR IXP2000_PCI_CREG(0x18)
170
171/*
172 * PCI CSRs
173 */
174#define IXP2000_PCI_CSR(x) (volatile unsigned long*)(IXP2000_PCI_CSR_VIRT_BASE | (x))
175
176/*
177 * PCI outbound interrupts
178 */
179#define IXP2000_PCI_OUT_INT_STATUS IXP2000_PCI_CSR(0x30)
180#define IXP2000_PCI_OUT_INT_MASK IXP2000_PCI_CSR(0x34)
181/*
182 * PCI communications
183 */
184#define IXP2000_PCI_MAILBOX0 IXP2000_PCI_CSR(0x50)
185#define IXP2000_PCI_MAILBOX1 IXP2000_PCI_CSR(0x54)
186#define IXP2000_PCI_MAILBOX2 IXP2000_PCI_CSR(0x58)
187#define IXP2000_PCI_MAILBOX3 IXP2000_PCI_CSR(0x5C)
188#define IXP2000_XSCALE_DOORBELL IXP2000_PCI_CSR(0x60)
189#define IXP2000_XSCALE_DOORBELL_SETUP IXP2000_PCI_CSR(0x64)
190#define IXP2000_PCI_DOORBELL IXP2000_PCI_CSR(0x70)
191#define IXP2000_PCI_DOORBELL_SETUP IXP2000_PCI_CSR(0x74)
192
193/*
194 * DMA engines
195 */
196#define IXP2000_PCI_CH1_BYTE_CNT IXP2000_PCI_CSR(0x80)
197#define IXP2000_PCI_CH1_ADDR IXP2000_PCI_CSR(0x84)
198#define IXP2000_PCI_CH1_DRAM_ADDR IXP2000_PCI_CSR(0x88)
199#define IXP2000_PCI_CH1_DESC_PTR IXP2000_PCI_CSR(0x8C)
200#define IXP2000_PCI_CH1_CNTRL IXP2000_PCI_CSR(0x90)
201#define IXP2000_PCI_CH1_ME_PARAM IXP2000_PCI_CSR(0x94)
202#define IXP2000_PCI_CH2_BYTE_CNT IXP2000_PCI_CSR(0xA0)
203#define IXP2000_PCI_CH2_ADDR IXP2000_PCI_CSR(0xA4)
204#define IXP2000_PCI_CH2_DRAM_ADDR IXP2000_PCI_CSR(0xA8)
205#define IXP2000_PCI_CH2_DESC_PTR IXP2000_PCI_CSR(0xAC)
206#define IXP2000_PCI_CH2_CNTRL IXP2000_PCI_CSR(0xB0)
207#define IXP2000_PCI_CH2_ME_PARAM IXP2000_PCI_CSR(0xB4)
208#define IXP2000_PCI_CH3_BYTE_CNT IXP2000_PCI_CSR(0xC0)
209#define IXP2000_PCI_CH3_ADDR IXP2000_PCI_CSR(0xC4)
210#define IXP2000_PCI_CH3_DRAM_ADDR IXP2000_PCI_CSR(0xC8)
211#define IXP2000_PCI_CH3_DESC_PTR IXP2000_PCI_CSR(0xCC)
212#define IXP2000_PCI_CH3_CNTRL IXP2000_PCI_CSR(0xD0)
213#define IXP2000_PCI_CH3_ME_PARAM IXP2000_PCI_CSR(0xD4)
214#define IXP2000_DMA_INF_MODE IXP2000_PCI_CSR(0xE0)
215/*
216 * Size masks for BARs
217 */
218#define IXP2000_PCI_SRAM_BASE_ADDR_MASK IXP2000_PCI_CSR(0xFC)
219#define IXP2000_PCI_DRAM_BASE_ADDR_MASK IXP2000_PCI_CSR(0x100)
220/*
221 * Control and uEngine related
222 */
223#define IXP2000_PCI_CONTROL IXP2000_PCI_CSR(0x13C)
224#define IXP2000_PCI_ADDR_EXT IXP2000_PCI_CSR(0x140)
225#define IXP2000_PCI_ME_PUSH_STATUS IXP2000_PCI_CSR(0x148)
226#define IXP2000_PCI_ME_PUSH_EN IXP2000_PCI_CSR(0x14C)
227#define IXP2000_PCI_ERR_STATUS IXP2000_PCI_CSR(0x150)
228#define IXP2000_PCI_ERR_ENABLE IXP2000_PCI_CSR(0x154)
229/*
230 * Inbound PCI interrupt control
231 */
232#define IXP2000_PCI_XSCALE_INT_STATUS IXP2000_PCI_CSR(0x158)
233#define IXP2000_PCI_XSCALE_INT_ENABLE IXP2000_PCI_CSR(0x15C)
234
235#define IXP2000_PCICNTL_PNR (1<<17) /* PCI not Reset bit of PCI_CONTROL */
236#define IXP2000_PCICNTL_PCF (1<<28) /* PCI Centrolfunction bit */
237#define IXP2000_XSCALE_INT (1<<1) /* Interrupt from XScale to PCI */
238
239/* These are from the IRQ register in the PCI ISR register */
240#define PCI_CONTROL_BE_DEO (1 << 22) /* Big Endian Data Enable Out */
241#define PCI_CONTROL_BE_DEI (1 << 21) /* Big Endian Data Enable In */
242#define PCI_CONTROL_BE_BEO (1 << 20) /* Big Endian Byte Enable Out */
243#define PCI_CONTROL_BE_BEI (1 << 19) /* Big Endian Byte Enable In */
244#define PCI_CONTROL_PNR (1 << 17) /* PCI Not Reset bit */
245
246#define IXP2000_PCI_RST_REL (1 << 2)
247#define CFG_RST_DIR (*IXP2000_PCI_CONTROL & IXP2000_PCICNTL_PCF)
248#define CFG_PCI_BOOT_HOST (1 << 2)
249#define CFG_BOOT_PROM (1 << 1)
250
251/*
252 * SlowPort CSRs
253 *
254 * The slowport is used to access things like flash, SONET framer control
255 * ports, slave microprocessors, CPLDs, and others of chip memory mapped
256 * peripherals.
257 */
258#define SLOWPORT_CSR(x) (volatile unsigned long*)(IXP2000_SLOWPORT_CSR_VIRT_BASE | (x))
259
260#define IXP2000_SLOWPORT_CCR SLOWPORT_CSR(0x00)
261#define IXP2000_SLOWPORT_WTC1 SLOWPORT_CSR(0x04)
262#define IXP2000_SLOWPORT_WTC2 SLOWPORT_CSR(0x08)
263#define IXP2000_SLOWPORT_RTC1 SLOWPORT_CSR(0x0c)
264#define IXP2000_SLOWPORT_RTC2 SLOWPORT_CSR(0x10)
265#define IXP2000_SLOWPORT_FSR SLOWPORT_CSR(0x14)
266#define IXP2000_SLOWPORT_PCR SLOWPORT_CSR(0x18)
267#define IXP2000_SLOWPORT_ADC SLOWPORT_CSR(0x1C)
268#define IXP2000_SLOWPORT_FAC SLOWPORT_CSR(0x20)
269#define IXP2000_SLOWPORT_FRM SLOWPORT_CSR(0x24)
270#define IXP2000_SLOWPORT_FIN SLOWPORT_CSR(0x28)
271
272/*
273 * CCR values.
274 * The CCR configures the clock division for the slowport interface.
275 */
276#define SLOWPORT_CCR_DIV_1 0x00
277#define SLOWPORT_CCR_DIV_2 0x01
278#define SLOWPORT_CCR_DIV_4 0x02
279#define SLOWPORT_CCR_DIV_6 0x03
280#define SLOWPORT_CCR_DIV_8 0x04
281#define SLOWPORT_CCR_DIV_10 0x05
282#define SLOWPORT_CCR_DIV_12 0x06
283#define SLOWPORT_CCR_DIV_14 0x07
284#define SLOWPORT_CCR_DIV_16 0x08
285#define SLOWPORT_CCR_DIV_18 0x09
286#define SLOWPORT_CCR_DIV_20 0x0a
287#define SLOWPORT_CCR_DIV_22 0x0b
288#define SLOWPORT_CCR_DIV_24 0x0c
289#define SLOWPORT_CCR_DIV_26 0x0d
290#define SLOWPORT_CCR_DIV_28 0x0e
291#define SLOWPORT_CCR_DIV_30 0x0f
292
293/*
294 * PCR values. PCR configure the mode of the interface.
295 */
296#define SLOWPORT_MODE_FLASH 0x00
297#define SLOWPORT_MODE_LUCENT 0x01
298#define SLOWPORT_MODE_PMC_SIERRA 0x02
299#define SLOWPORT_MODE_INTEL_UP 0x03
300#define SLOWPORT_MODE_MOTOROLA_UP 0x04
301
302/*
303 * ADC values. Defines data and address bus widths.
304 */
305#define SLOWPORT_ADDR_WIDTH_8 0x00
306#define SLOWPORT_ADDR_WIDTH_16 0x01
307#define SLOWPORT_ADDR_WIDTH_24 0x02
308#define SLOWPORT_ADDR_WIDTH_32 0x03
309#define SLOWPORT_DATA_WIDTH_8 0x00
310#define SLOWPORT_DATA_WIDTH_16 0x10
311#define SLOWPORT_DATA_WIDTH_24 0x20
312#define SLOWPORT_DATA_WIDTH_32 0x30
313
314/*
315 * Masks and shifts for various fields in the WTC and RTC registers.
316 */
317#define SLOWPORT_WRTC_MASK_HD 0x0003
318#define SLOWPORT_WRTC_MASK_SU 0x003c
319#define SLOWPORT_WRTC_MASK_PW 0x03c0
320
321#define SLOWPORT_WRTC_SHIFT_HD 0x00
322#define SLOWPORT_WRTC_SHIFT_SU 0x02
323#define SLOWPORT_WRTC_SHFIT_PW 0x06
324
325
326/*
327 * GPIO registers & GPIO interface.
328 */
329#define IXP2000_GPIO_REG(x) ((volatile unsigned long*)(IXP2000_GPIO_VIRT_BASE+(x)))
330#define IXP2000_GPIO_PLR IXP2000_GPIO_REG(0x00)
331#define IXP2000_GPIO_PDPR IXP2000_GPIO_REG(0x04)
332#define IXP2000_GPIO_PDSR IXP2000_GPIO_REG(0x08)
333#define IXP2000_GPIO_PDCR IXP2000_GPIO_REG(0x0c)
334#define IXP2000_GPIO_POPR IXP2000_GPIO_REG(0x10)
335#define IXP2000_GPIO_POSR IXP2000_GPIO_REG(0x14)
336#define IXP2000_GPIO_POCR IXP2000_GPIO_REG(0x18)
337#define IXP2000_GPIO_REDR IXP2000_GPIO_REG(0x1c)
338#define IXP2000_GPIO_FEDR IXP2000_GPIO_REG(0x20)
339#define IXP2000_GPIO_EDSR IXP2000_GPIO_REG(0x24)
340#define IXP2000_GPIO_LSHR IXP2000_GPIO_REG(0x28)
341#define IXP2000_GPIO_LSLR IXP2000_GPIO_REG(0x2c)
342#define IXP2000_GPIO_LDSR IXP2000_GPIO_REG(0x30)
343#define IXP2000_GPIO_INER IXP2000_GPIO_REG(0x34)
344#define IXP2000_GPIO_INSR IXP2000_GPIO_REG(0x38)
345#define IXP2000_GPIO_INCR IXP2000_GPIO_REG(0x3c)
346#define IXP2000_GPIO_INST IXP2000_GPIO_REG(0x40)
347
348/*
349 * "Global" registers...whatever that's supposed to mean.
350 */
351#define GLOBAL_REG_BASE (IXP2000_GLOBAL_REG_VIRT_BASE + 0x0a00)
352#define GLOBAL_REG(x) (volatile unsigned long*)(GLOBAL_REG_BASE | (x))
353
354#define IXP2000_PROD_ID GLOBAL_REG(0x00)
355
356#define IXP2000_MAJ_PROD_TYPE_MASK 0x001F0000
357#define IXP2000_MAJ_PROD_TYPE_IXP2000 0x00000000
358#define IXP2000_MIN_PROD_TYPE_MASK 0x0000FF00
359#define IXP2000_MIN_PROD_TYPE_IXP2400 0x00000200
360#define IXP2000_MIN_PROD_TYPE_IXP2850 0x00000100
361#define IXP2000_MIN_PROD_TYPE_IXP2800 0x00000000
362#define IXP2000_MAJ_REV_MASK 0x000000F0
363#define IXP2000_MIN_REV_MASK 0x0000000F
364#define IXP2000_PROD_ID_MASK 0xFFFFFFFF
365
366#define IXP2000_MISC_CONTROL GLOBAL_REG(0x04)
367#define IXP2000_MSF_CLK_CNTRL GLOBAL_REG(0x08)
368#define IXP2000_RESET0 GLOBAL_REG(0x0c)
369#define IXP2000_RESET1 GLOBAL_REG(0x10)
370#define IXP2000_CCR GLOBAL_REG(0x14)
371#define IXP2000_STRAP_OPTIONS GLOBAL_REG(0x18)
372
373#define RSTALL (1 << 16)
374#define WDT_RESET_ENABLE 0x01000000
375
376
377#endif /* _IXP2000_H_ */
diff --git a/include/asm-arm/arch-ixp2000/memory.h b/include/asm-arm/arch-ixp2000/memory.h
new file mode 100644
index 000000000000..d0f415c6dae9
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/memory.h
@@ -0,0 +1,34 @@
1/*
2 * linux/include/asm-arm/arch-ixp2000/memory.h
3 *
4 * Copyright (c) 2002 Intel Corp.
5 * Copyright (c) 2003-2004 MontaVista Software, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H
15
16#define PHYS_OFFSET (0x00000000UL)
17
18/*
19 * Virtual view <-> DMA view memory address translations
20 * virt_to_bus: Used to translate the virtual address to an
21 * address suitable to be passed to set_dma_addr
22 * bus_to_virt: Used to convert an address for DMA operations
23 * to an address that the kernel can use.
24 */
25#include <asm/arch/ixp2000-regs.h>
26
27#define __virt_to_bus(v) \
28 (((__virt_to_phys(v) - 0x0) + (*IXP2000_PCI_SDRAM_BAR & 0xfffffff0)))
29
30#define __bus_to_virt(b) \
31 __phys_to_virt((((b - (*IXP2000_PCI_SDRAM_BAR & 0xfffffff0)) + 0x0)))
32
33#endif
34
diff --git a/include/asm-arm/arch-ixp2000/param.h b/include/asm-arm/arch-ixp2000/param.h
new file mode 100644
index 000000000000..2646d9e5919d
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/param.h
@@ -0,0 +1,3 @@
1/*
2 * linux/include/asm-arm/arch-ixp2000/param.h
3 */
diff --git a/include/asm-arm/arch-ixp2000/platform.h b/include/asm-arm/arch-ixp2000/platform.h
new file mode 100644
index 000000000000..509e44d528d8
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/platform.h
@@ -0,0 +1,166 @@
1/*
2 * include/asm-arm/arch-ixp2000/platform.h
3 *
4 * Various bits of code used by platform-level code.
5 *
6 * Author: Deepak Saxena <dsaxena@plexity.net>
7 *
8 * Copyright 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
16#ifndef __ASSEMBLY__
17
18/*
19 * The IXP2400 B0 silicon contains an erratum (#66) that causes writes
20 * to on-chip I/O register to not complete fully. What this means is
21 * that if you have a write to on-chip I/O followed by a back-to-back
22 * read or write, the first write will happen twice. OR...if it's
23 * not a back-to-back transaction, the read or write will generate
24 * incorrect data.
25 *
26 * The official work around for this is to set the on-chip I/O regions
27 * as XCB=101 and then force a read-back from the register.
28 *
29 */
30#if defined(CONFIG_ARCH_ENP2611) || defined(CONFIG_ARCH_IXDP2400) || defined(CONFIG_ARCH_IXDP2401)
31
32#include <asm/system.h> /* Pickup local_irq_ functions */
33
34static inline void ixp2000_reg_write(volatile unsigned long *reg, unsigned long val)
35{
36 volatile unsigned long dummy;
37 unsigned long flags;
38
39 local_irq_save(flags);
40 *reg = val;
41 barrier();
42 dummy = *reg;
43 local_irq_restore(flags);
44}
45#else
46#define ixp2000_reg_write(reg, val) (*reg = val)
47#endif /* IXDP2400 || IXDP2401 */
48
49/*
50 * Boards may multiplex different devices on the 2nd channel of
51 * the slowport interface that each need different configuration
52 * settings. For example, the IXDP2400 uses channel 2 on the interface
53 * to access the CPLD, the switch fabric card, and the media card. Each
54 * one needs a different mode so drivers must save/restore the mode
55 * before and after each operation.
56 *
57 * acquire_slowport(&your_config);
58 * ...
59 * do slowport operations
60 * ...
61 * release_slowport();
62 *
63 * Note that while you have the slowport, you are holding a spinlock,
64 * so your code should be written as if you explicitly acquired a lock.
65 *
66 * The configuration only affects device 2 on the slowport, so the
67 * MTD map driver does not acquire/release the slowport.
68 */
69struct slowport_cfg {
70 unsigned long CCR; /* Clock divide */
71 unsigned long WTC; /* Write Timing Control */
72 unsigned long RTC; /* Read Timing Control */
73 unsigned long PCR; /* Protocol Control Register */
74 unsigned long ADC; /* Address/Data Width Control */
75};
76
77
78void ixp2000_acquire_slowport(struct slowport_cfg *, struct slowport_cfg *);
79void ixp2000_release_slowport(struct slowport_cfg *);
80
81/*
82 * IXP2400 A0/A1 and IXP2800 A0/A1/A2 have broken slowport that requires
83 * tweaking of addresses in the MTD driver.
84 */
85static inline unsigned ixp2000_has_broken_slowport(void)
86{
87 unsigned long id = *IXP2000_PROD_ID;
88 unsigned long id_prod = id & (IXP2000_MAJ_PROD_TYPE_MASK |
89 IXP2000_MIN_PROD_TYPE_MASK);
90 return (((id_prod ==
91 /* fixed in IXP2400-B0 */
92 (IXP2000_MAJ_PROD_TYPE_IXP2000 |
93 IXP2000_MIN_PROD_TYPE_IXP2400)) &&
94 ((id & IXP2000_MAJ_REV_MASK) == 0)) ||
95 ((id_prod ==
96 /* fixed in IXP2800-B0 */
97 (IXP2000_MAJ_PROD_TYPE_IXP2000 |
98 IXP2000_MIN_PROD_TYPE_IXP2800)) &&
99 ((id & IXP2000_MAJ_REV_MASK) == 0)) ||
100 ((id_prod ==
101 /* fixed in IXP2850-B0 */
102 (IXP2000_MAJ_PROD_TYPE_IXP2000 |
103 IXP2000_MIN_PROD_TYPE_IXP2850)) &&
104 ((id & IXP2000_MAJ_REV_MASK) == 0)));
105}
106
107static inline unsigned int ixp2000_has_flash(void)
108{
109 return ((*IXP2000_STRAP_OPTIONS) & (CFG_BOOT_PROM));
110}
111
112static inline unsigned int ixp2000_is_pcimaster(void)
113{
114 return ((*IXP2000_STRAP_OPTIONS) & (CFG_PCI_BOOT_HOST));
115}
116
117void ixp2000_map_io(void);
118void ixp2000_init_irq(void);
119void ixp2000_init_time(unsigned long);
120unsigned long ixp2000_gettimeoffset(void);
121
122struct pci_sys_data;
123
124void ixp2000_pci_preinit(void);
125int ixp2000_pci_setup(int, struct pci_sys_data*);
126struct pci_bus* ixp2000_pci_scan_bus(int, struct pci_sys_data*);
127int ixp2000_pci_read_config(struct pci_bus*, unsigned int, int, int, u32 *);
128int ixp2000_pci_write_config(struct pci_bus*, unsigned int, int, int, u32);
129
130/*
131 * Several of the IXP2000 systems have banked flash so we need to extend the
132 * flash_platform_data structure with some private pointers
133 */
134struct ixp2000_flash_data {
135 struct flash_platform_data *platform_data;
136 int nr_banks;
137 unsigned long (*bank_setup)(unsigned long);
138};
139
140/*
141 * GPIO helper functions
142 */
143#define GPIO_IN 0
144#define GPIO_OUT 1
145
146extern void gpio_line_config(int line, int style);
147
148static inline int gpio_line_get(int line)
149{
150 return (((*IXP2000_GPIO_PLR) >> line) & 1);
151}
152
153static inline void gpio_line_set(int line, int value)
154{
155 if (value)
156 ixp2000_reg_write(IXP2000_GPIO_POSR, (1 << line));
157 else
158 ixp2000_reg_write(IXP2000_GPIO_POCR, (1 << line));
159}
160
161struct ixp2000_i2c_pins {
162 unsigned long sda_pin;
163 unsigned long scl_pin;
164};
165
166#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-arm/arch-ixp2000/system.h b/include/asm-arm/arch-ixp2000/system.h
new file mode 100644
index 000000000000..4f489cc0dfa5
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/system.h
@@ -0,0 +1,54 @@
1/*
2 * linux/include/asm-arm/arch-ixp2000/system.h
3 *
4 * Copyright (C) 2002 Intel Corp.
5 * Copyricht (C) 2003-2005 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
12#include <asm/hardware.h>
13#include <asm/mach-types.h>
14
15static inline void arch_idle(void)
16{
17 cpu_do_idle();
18}
19
20static inline void arch_reset(char mode)
21{
22 local_irq_disable();
23
24 /*
25 * Reset flash banking register so that we are pointing at
26 * RedBoot bank.
27 */
28 if (machine_is_ixdp2401()) {
29 *IXDP2X01_CPLD_FLASH_REG = ((0 >> IXDP2X01_FLASH_WINDOW_BITS)
30 | IXDP2X01_CPLD_FLASH_INTERN);
31 *IXDP2X01_CPLD_RESET_REG = 0xffffffff;
32 }
33
34 /*
35 * On IXDP2801 we need to write this magic sequence to the CPLD
36 * to cause a complete reset of the CPU and all external devices
37 * and moves the flash bank register back to 0.
38 */
39 if (machine_is_ixdp2801()) {
40 unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;
41 reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
42 *IXDP2X01_CPLD_RESET_REG = reset_reg;
43 mb();
44 *IXDP2X01_CPLD_RESET_REG = 0x80000000;
45 }
46
47 /*
48 * We do a reset all if we are PCI master. We could be a slave and we
49 * don't want to do anything funky on the PCI bus.
50 */
51 if (*IXP2000_STRAP_OPTIONS & CFG_PCI_BOOT_HOST) {
52 *(IXP2000_RESET0) |= (RSTALL);
53 }
54}
diff --git a/include/asm-arm/arch-ixp2000/timex.h b/include/asm-arm/arch-ixp2000/timex.h
new file mode 100644
index 000000000000..b78a183d4698
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/timex.h
@@ -0,0 +1,13 @@
1/*
2 * linux/include/asm-arm/arch-ixp2000/timex.h
3 *
4 * IXP2000 architecture timex specifications
5 */
6
7
8/*
9 * Default clock is 50MHz APB, but platform code can override this
10 */
11#define CLOCK_TICK_RATE 50000000
12
13
diff --git a/include/asm-arm/arch-ixp2000/uncompress.h b/include/asm-arm/arch-ixp2000/uncompress.h
new file mode 100644
index 000000000000..3d3d5b2ed6e9
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/uncompress.h
@@ -0,0 +1,52 @@
1/*
2 * linux/include/asm-arm/arch-ixp2000/uncompress.h
3 *
4 *
5 * Original Author: Naeem Afzal <naeem.m.afzal@intel.com>
6 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
7 *
8 * Copyright 2002 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
17#include <linux/serial_reg.h>
18
19#define UART_BASE 0xc0030000
20
21#define PHYS(x) ((volatile unsigned long *)(UART_BASE + x))
22
23#define UARTDR PHYS(0x00) /* Transmit reg dlab=0 */
24#define UARTDLL PHYS(0x00) /* Divisor Latch reg dlab=1*/
25#define UARTDLM PHYS(0x04) /* Divisor Latch reg dlab=1*/
26#define UARTIER PHYS(0x04) /* Interrupt enable reg */
27#define UARTFCR PHYS(0x08) /* FIFO control reg dlab =0*/
28#define UARTLCR PHYS(0x0c) /* Control reg */
29#define UARTSR PHYS(0x14) /* Status reg */
30
31
32static __inline__ void putc(char c)
33{
34 int j = 0x1000;
35
36 while (--j && !(*UARTSR & UART_LSR_THRE));
37 *UARTDR = c;
38}
39
40static void putstr(const char *s)
41{
42 while (*s)
43 {
44 putc(*s);
45 if (*s == '\n')
46 putc('\r');
47 s++;
48 }
49}
50
51#define arch_decomp_setup()
52#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-ixp2000/vmalloc.h b/include/asm-arm/arch-ixp2000/vmalloc.h
new file mode 100644
index 000000000000..2e4bcbcf31f0
--- /dev/null
+++ b/include/asm-arm/arch-ixp2000/vmalloc.h
@@ -0,0 +1,23 @@
1/*
2 * linux/include/asm-arm/arch-ixp2000/vmalloc.h
3 *
4 * Author: Naeem Afzal <naeem.m.afzal@intel.com>
5 *
6 * Copyright 2002 Intel Corp.
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 * Just any arbitrary offset to the start of the vmalloc VM area: the
14 * current 8MB value just means that there will be a 8MB "hole" after the
15 * physical memory until the kernel virtual memory starts. That means that
16 * any out-of-bounds memory accesses will hopefully be caught.
17 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
18 * area for the same reason. ;)
19 */
20#define VMALLOC_OFFSET (8*1024*1024)
21#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
22#define VMALLOC_VMADDR(x) ((unsigned long)(x))
23#define VMALLOC_END 0xfaffefff
diff --git a/include/asm-arm/arch-ixp4xx/coyote.h b/include/asm-arm/arch-ixp4xx/coyote.h
new file mode 100644
index 000000000000..dd0c2d2d8503
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/coyote.h
@@ -0,0 +1,36 @@
1/*
2 * include/asm-arm/arch-ixp4xx/coyote.h
3 *
4 * ADI Engineering platform specific definitions
5 *
6 * Author: Deepak Saxena <dsaxena@plexity.net>
7 *
8 * Copyright 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#ifndef __ASM_ARCH_HARDWARE_H__
16#error "Do not include this directly, instead #include <asm/hardware.h>"
17#endif
18
19#define COYOTE_FLASH_BASE IXP4XX_EXP_BUS_CS0_BASE_PHYS
20#define COYOTE_FLASH_SIZE IXP4XX_EXP_BUS_CSX_REGION_SIZE * 2
21
22/* PCI controller GPIO to IRQ pin mappings */
23#define COYOTE_PCI_SLOT0_PIN 6
24#define COYOTE_PCI_SLOT1_PIN 11
25
26#define COYOTE_PCI_SLOT0_DEVID 14
27#define COYOTE_PCI_SLOT1_DEVID 15
28
29#define COYOTE_IDE_BASE_PHYS IXP4XX_EXP_BUS_CS3_BASE_PHYS
30#define COYOTE_IDE_BASE_VIRT 0xFFFE1000
31#define COYOTE_IDE_REGION_SIZE 0x1000
32
33#define COYOTE_IDE_DATA_PORT 0xFFFE10E0
34#define COYOTE_IDE_CTRL_PORT 0xFFFE10FC
35#define COYOTE_IDE_ERROR_PORT 0xFFFE10E2
36
diff --git a/include/asm-arm/arch-ixp4xx/debug-macro.S b/include/asm-arm/arch-ixp4xx/debug-macro.S
new file mode 100644
index 000000000000..4499ae8e4b44
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/debug-macro.S
@@ -0,0 +1,34 @@
1/* linux/include/asm-arm/arch-ixp4xx/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .macro addruart,rx
14 mrc p15, 0, \rx, c1, c0
15 tst \rx, #1 @ MMU enabled?
16 moveq \rx, #0xc8000000
17 movne \rx, #0xff000000
18 add \rx,\rx,#3 @ Uart regs are at off set of 3 if
19 @ byte writes used - Big Endian.
20 .endm
21
22 .macro senduart,rd,rx
23 strb \rd, [\rx]
24 .endm
25
26 .macro waituart,rd,rx
271002: ldrb \rd, [\rx, #0x14]
28 and \rd, \rd, #0x60 @ check THRE and TEMT bits
29 teq \rd, #0x60
30 bne 1002b
31 .endm
32
33 .macro busyuart,rd,rx
34 .endm
diff --git a/include/asm-arm/arch-ixp4xx/dma.h b/include/asm-arm/arch-ixp4xx/dma.h
new file mode 100644
index 000000000000..312065dc0e7a
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/dma.h
@@ -0,0 +1,26 @@
1/*
2 * include/asm-arm/arch-ixp4xx/dma.h
3 *
4 * Copyright (C) 2001-2004 MontaVista Software, 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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11#ifndef __ASM_ARCH_DMA_H
12#define __ASM_ARCH_DMA_H
13
14#include <linux/config.h>
15#include <linux/device.h>
16#include <linux/pci.h>
17#include <asm/page.h>
18#include <asm/sizes.h>
19#include <asm/hardware.h>
20
21#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M)
22
23/* No DMA */
24#define MAX_DMA_CHANNELS 0
25
26#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-ixp4xx/entry-macro.S b/include/asm-arm/arch-ixp4xx/entry-macro.S
new file mode 100644
index 000000000000..455da64832de
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/entry-macro.S
@@ -0,0 +1,39 @@
1/*
2 * include/asm-arm/arch-ixp4xx/entry-macro.S
3 *
4 * Low-level IRQ helper macros for IXP4xx-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11 .macro disable_fiq
12 .endm
13
14 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
15 ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP_OFFSET)
16 ldr \irqstat, [\irqstat] @ get interrupts
17 cmp \irqstat, #0
18 beq 1001f
19 clz \irqnr, \irqstat
20 mov \base, #31
21 subs \irqnr, \base, \irqnr
22
231001:
24 /*
25 * IXP465 has an upper IRQ status register
26 */
27#if defined(CONFIG_CPU_IXP46X)
28 bne 1002f
29 ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET)
30 ldr \irqstat, [\irqstat] @ get upper interrupts
31 mov \irqnr, #63
32 clz \irqstat, \irqstat
33 cmp \irqstat, #32
34 subne \irqnr, \irqnr, \irqstat
351002:
36#endif
37 .endm
38
39
diff --git a/include/asm-arm/arch-ixp4xx/gtwx5715.h b/include/asm-arm/arch-ixp4xx/gtwx5715.h
new file mode 100644
index 000000000000..fc460af70627
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/gtwx5715.h
@@ -0,0 +1,120 @@
1/*
2 * include/asm-arm/arch-ixp4xx/gtwx5715.h
3 *
4 * Gemtek GTWX5715 Gateway (Linksys WRV54G)
5 *
6 * Copyright 2004 (c) George T. Joseph
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (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#ifndef __ASM_ARCH_HARDWARE_H__
24#error "Do not include this directly, instead #include <asm/hardware.h>"
25#endif
26#include "irqs.h"
27
28#define GTWX5715_GPIO0 0
29#define GTWX5715_GPIO1 1
30#define GTWX5715_GPIO2 2
31#define GTWX5715_GPIO3 3
32#define GTWX5715_GPIO4 4
33#define GTWX5715_GPIO5 5
34#define GTWX5715_GPIO6 6
35#define GTWX5715_GPIO7 7
36#define GTWX5715_GPIO8 8
37#define GTWX5715_GPIO9 9
38#define GTWX5715_GPIO10 10
39#define GTWX5715_GPIO11 11
40#define GTWX5715_GPIO12 12
41#define GTWX5715_GPIO13 13
42#define GTWX5715_GPIO14 14
43
44#define GTWX5715_GPIO0_IRQ IRQ_IXP4XX_GPIO0
45#define GTWX5715_GPIO1_IRQ IRQ_IXP4XX_GPIO1
46#define GTWX5715_GPIO2_IRQ IRQ_IXP4XX_GPIO2
47#define GTWX5715_GPIO3_IRQ IRQ_IXP4XX_GPIO3
48#define GTWX5715_GPIO4_IRQ IRQ_IXP4XX_GPIO4
49#define GTWX5715_GPIO5_IRQ IRQ_IXP4XX_GPIO5
50#define GTWX5715_GPIO6_IRQ IRQ_IXP4XX_GPIO6
51#define GTWX5715_GPIO7_IRQ IRQ_IXP4XX_GPIO7
52#define GTWX5715_GPIO8_IRQ IRQ_IXP4XX_GPIO8
53#define GTWX5715_GPIO9_IRQ IRQ_IXP4XX_GPIO9
54#define GTWX5715_GPIO10_IRQ IRQ_IXP4XX_GPIO10
55#define GTWX5715_GPIO11_IRQ IRQ_IXP4XX_GPIO11
56#define GTWX5715_GPIO12_IRQ IRQ_IXP4XX_GPIO12
57#define GTWX5715_GPIO13_IRQ IRQ_IXP4XX_SW_INT1
58#define GTWX5715_GPIO14_IRQ IRQ_IXP4XX_SW_INT2
59
60
61#define GTWX5715_FLASH_BASE IXP4XX_EXP_BUS_CS0_BASE_PHYS
62#define GTWX5715_FLASH_SIZE (0x00800000)
63
64/* PCI controller GPIO to IRQ pin mappings
65
66 INTA INTB
67SLOT 0 10 11
68SLOT 1 11 10
69
70*/
71
72#define GTWX5715_PCI_SLOT0_DEVID 0
73#define GTWX5715_PCI_SLOT0_INTA_GPIO GTWX5715_GPIO10
74#define GTWX5715_PCI_SLOT0_INTB_GPIO GTWX5715_GPIO11
75#define GTWX5715_PCI_SLOT0_INTA_IRQ GTWX5715_GPIO10_IRQ
76#define GTWX5715_PCI_SLOT0_INTB_IRQ GTWX5715_GPIO11_IRQ
77
78#define GTWX5715_PCI_SLOT1_DEVID 1
79#define GTWX5715_PCI_SLOT1_INTA_GPIO GTWX5715_GPIO11
80#define GTWX5715_PCI_SLOT1_INTB_GPIO GTWX5715_GPIO10
81#define GTWX5715_PCI_SLOT1_INTA_IRQ GTWX5715_GPIO11_IRQ
82#define GTWX5715_PCI_SLOT1_INTB_IRQ GTWX5715_GPIO10_IRQ
83
84#define GTWX5715_PCI_SLOT_COUNT 2
85#define GTWX5715_PCI_INT_PIN_COUNT 2
86
87/*
88 * GPIO 5,6,7 and12 are hard wired to the Kendin KS8995M Switch
89 * and operate as an SPI type interface. The details of the interface
90 * are available on Kendin/Micrel's web site.
91 */
92
93#define GTWX5715_KSSPI_SELECT GTWX5715_GPIO5
94#define GTWX5715_KSSPI_TXD GTWX5715_GPIO6
95#define GTWX5715_KSSPI_CLOCK GTWX5715_GPIO7
96#define GTWX5715_KSSPI_RXD GTWX5715_GPIO12
97
98/*
99 * The "reset" button is wired to GPIO 3.
100 * The GPIO is brought "low" when the button is pushed.
101 */
102
103#define GTWX5715_BUTTON_GPIO GTWX5715_GPIO3
104#define GTWX5715_BUTTON_IRQ GTWX5715_GPIO3_IRQ
105
106/*
107 * Board Label Front Label
108 * LED1 Power
109 * LED2 Wireless-G
110 * LED3 not populated but could be
111 * LED4 Internet
112 * LED5 - LED8 Controlled by KS8995M Switch
113 * LED9 DMZ
114 */
115
116#define GTWX5715_LED1_GPIO GTWX5715_GPIO2
117#define GTWX5715_LED2_GPIO GTWX5715_GPIO9
118#define GTWX5715_LED3_GPIO GTWX5715_GPIO8
119#define GTWX5715_LED4_GPIO GTWX5715_GPIO1
120#define GTWX5715_LED9_GPIO GTWX5715_GPIO4
diff --git a/include/asm-arm/arch-ixp4xx/hardware.h b/include/asm-arm/arch-ixp4xx/hardware.h
new file mode 100644
index 000000000000..4ac964b9078a
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/hardware.h
@@ -0,0 +1,48 @@
1/*
2 * include/asm-arm/arch-ixp4xx/hardware.h
3 *
4 * Copyright (C) 2002 Intel Corporation.
5 * Copyright (C) 2003-2004 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 */
12
13/*
14 * Hardware definitions for IXP4xx based systems
15 */
16
17#ifndef __ASM_ARCH_HARDWARE_H__
18#define __ASM_ARCH_HARDWARE_H__
19
20#define PCIBIOS_MIN_IO 0x00001000
21#define PCIBIOS_MIN_MEM 0x48000000
22
23/*
24 * We override the standard dma-mask routines for bouncing.
25 */
26#define HAVE_ARCH_PCI_SET_DMA_MASK
27
28#define pcibios_assign_all_busses() 1
29
30#if defined(CONFIG_CPU_IXP465) && !defined(__ASSEMBLY__)
31extern unsigned int processor_id;
32#define cpu_is_ixp465() ((processor_id & 0xffffffc0) == 0x69054200)
33#else
34#define cpu_is_ixp465() (0)
35#endif
36
37/* Register locations and bits */
38#include "ixp4xx-regs.h"
39
40/* Platform helper functions and definitions */
41#include "platform.h"
42
43/* Platform specific details */
44#include "ixdp425.h"
45#include "coyote.h"
46#include "prpmc1100.h"
47
48#endif /* _ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h
new file mode 100644
index 000000000000..c27b9d3079a7
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/io.h
@@ -0,0 +1,388 @@
1/*
2 * linux/include/asm-arm/arch-ixp4xx/io.h
3 *
4 * Author: Deepak Saxena <dsaxena@plexity.net>
5 *
6 * Copyright (C) 2002-2004 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#ifndef __ASM_ARM_ARCH_IO_H
14#define __ASM_ARM_ARCH_IO_H
15
16#include <asm/hardware.h>
17
18#define IO_SPACE_LIMIT 0xffff0000
19
20#define BIT(x) ((1)<<(x))
21
22
23extern int (*ixp4xx_pci_read)(u32 addr, u32 cmd, u32* data);
24extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
25
26
27/*
28 * IXP4xx provides two methods of accessing PCI memory space:
29 *
30 * 1) A direct mapped window from 0x48000000 to 0x4bffffff (64MB).
31 * To access PCI via this space, we simply ioremap() the BAR
32 * into the kernel and we can use the standard read[bwl]/write[bwl]
33 * macros. This is the preffered method due to speed but it
34 * limits the system to just 64MB of PCI memory. This can be
35 * problamatic if using video cards and other memory-heavy
36 * targets.
37 *
38 * 2) If > 64MB of memory space is required, the IXP4xx can be configured
39 * to use indirect registers to access PCI (as we do below for I/O
40 * transactions). This allows for up to 128MB (0x48000000 to 0x4fffffff)
41 * of memory on the bus. The disadvantadge of this is that every
42 * PCI access requires three local register accesses plus a spinlock,
43 * but in some cases the performance hit is acceptable. In addition,
44 * you cannot mmap() PCI devices in this case.
45 *
46 */
47#ifndef CONFIG_IXP4XX_INDIRECT_PCI
48
49#define __mem_pci(a) (a)
50
51#else
52
53#include <linux/mm.h>
54
55/*
56 * In the case of using indirect PCI, we simply return the actual PCI
57 * address and our read/write implementation use that to drive the
58 * access registers. If something outside of PCI is ioremap'd, we
59 * fallback to the default.
60 */
61static inline void __iomem *
62__ixp4xx_ioremap(unsigned long addr, size_t size, unsigned long flags, unsigned long align)
63{
64 extern void __iomem * __ioremap(unsigned long, size_t, unsigned long, unsigned long);
65 if((addr < 0x48000000) || (addr > 0x4fffffff))
66 return __ioremap(addr, size, flags, align);
67
68 return (void *)addr;
69}
70
71static inline void
72__ixp4xx_iounmap(void __iomem *addr)
73{
74 extern void __iounmap(void __iomem *addr);
75
76 if ((u32)addr >= VMALLOC_START)
77 __iounmap(addr);
78}
79
80#define __arch_ioremap(a, s, f, x) __ixp4xx_ioremap(a, s, f, x)
81#define __arch_iounmap(a) __ixp4xx_iounmap(a)
82
83#define writeb(p, v) __ixp4xx_writeb(p, v)
84#define writew(p, v) __ixp4xx_writew(p, v)
85#define writel(p, v) __ixp4xx_writel(p, v)
86
87#define writesb(p, v, l) __ixp4xx_writesb(p, v, l)
88#define writesw(p, v, l) __ixp4xx_writesw(p, v, l)
89#define writesl(p, v, l) __ixp4xx_writesl(p, v, l)
90
91#define readb(p) __ixp4xx_readb(p)
92#define readw(p) __ixp4xx_readw(p)
93#define readl(p) __ixp4xx_readl(p)
94
95#define readsb(p, v, l) __ixp4xx_readsb(p, v, l)
96#define readsw(p, v, l) __ixp4xx_readsw(p, v, l)
97#define readsl(p, v, l) __ixp4xx_readsl(p, v, l)
98
99static inline void
100__ixp4xx_writeb(u8 value, u32 addr)
101{
102 u32 n, byte_enables, data;
103
104 if (addr >= VMALLOC_START) {
105 __raw_writeb(value, addr);
106 return;
107 }
108
109 n = addr % 4;
110 byte_enables = (0xf & ~BIT(n)) << IXP4XX_PCI_NP_CBE_BESL;
111 data = value << (8*n);
112 ixp4xx_pci_write(addr, byte_enables | NP_CMD_MEMWRITE, data);
113}
114
115static inline void
116__ixp4xx_writesb(u32 bus_addr, u8 *vaddr, int count)
117{
118 while (count--)
119 writeb(*vaddr++, bus_addr);
120}
121
122static inline void
123__ixp4xx_writew(u16 value, u32 addr)
124{
125 u32 n, byte_enables, data;
126
127 if (addr >= VMALLOC_START) {
128 __raw_writew(value, addr);
129 return;
130 }
131
132 n = addr % 4;
133 byte_enables = (0xf & ~(BIT(n) | BIT(n+1))) << IXP4XX_PCI_NP_CBE_BESL;
134 data = value << (8*n);
135 ixp4xx_pci_write(addr, byte_enables | NP_CMD_MEMWRITE, data);
136}
137
138static inline void
139__ixp4xx_writesw(u32 bus_addr, u16 *vaddr, int count)
140{
141 while (count--)
142 writew(*vaddr++, bus_addr);
143}
144
145static inline void
146__ixp4xx_writel(u32 value, u32 addr)
147{
148 if (addr >= VMALLOC_START) {
149 __raw_writel(value, addr);
150 return;
151 }
152
153 ixp4xx_pci_write(addr, NP_CMD_MEMWRITE, value);
154}
155
156static inline void
157__ixp4xx_writesl(u32 bus_addr, u32 *vaddr, int count)
158{
159 while (count--)
160 writel(*vaddr++, bus_addr);
161}
162
163static inline unsigned char
164__ixp4xx_readb(u32 addr)
165{
166 u32 n, byte_enables, data;
167
168 if (addr >= VMALLOC_START)
169 return __raw_readb(addr);
170
171 n = addr % 4;
172 byte_enables = (0xf & ~BIT(n)) << IXP4XX_PCI_NP_CBE_BESL;
173 if (ixp4xx_pci_read(addr, byte_enables | NP_CMD_MEMREAD, &data))
174 return 0xff;
175
176 return data >> (8*n);
177}
178
179static inline void
180__ixp4xx_readsb(u32 bus_addr, u8 *vaddr, u32 count)
181{
182 while (count--)
183 *vaddr++ = readb(bus_addr);
184}
185
186static inline unsigned short
187__ixp4xx_readw(u32 addr)
188{
189 u32 n, byte_enables, data;
190
191 if (addr >= VMALLOC_START)
192 return __raw_readw(addr);
193
194 n = addr % 4;
195 byte_enables = (0xf & ~(BIT(n) | BIT(n+1))) << IXP4XX_PCI_NP_CBE_BESL;
196 if (ixp4xx_pci_read(addr, byte_enables | NP_CMD_MEMREAD, &data))
197 return 0xffff;
198
199 return data>>(8*n);
200}
201
202static inline void
203__ixp4xx_readsw(u32 bus_addr, u16 *vaddr, u32 count)
204{
205 while (count--)
206 *vaddr++ = readw(bus_addr);
207}
208
209static inline unsigned long
210__ixp4xx_readl(u32 addr)
211{
212 u32 data;
213
214 if (addr >= VMALLOC_START)
215 return __raw_readl(addr);
216
217 if (ixp4xx_pci_read(addr, NP_CMD_MEMREAD, &data))
218 return 0xffffffff;
219
220 return data;
221}
222
223static inline void
224__ixp4xx_readsl(u32 bus_addr, u32 *vaddr, u32 count)
225{
226 while (count--)
227 *vaddr++ = readl(bus_addr);
228}
229
230
231/*
232 * We can use the built-in functions b/c they end up calling writeb/readb
233 */
234#define memset_io(c,v,l) _memset_io((c),(v),(l))
235#define memcpy_fromio(a,c,l) _memcpy_fromio((a),(c),(l))
236#define memcpy_toio(c,a,l) _memcpy_toio((c),(a),(l))
237
238#define eth_io_copy_and_sum(s,c,l,b) \
239 eth_copy_and_sum((s),__mem_pci(c),(l),(b))
240
241static inline int
242check_signature(unsigned long bus_addr, const unsigned char *signature,
243 int length)
244{
245 int retval = 0;
246 do {
247 if (readb(bus_addr) != *signature)
248 goto out;
249 bus_addr++;
250 signature++;
251 length--;
252 } while (length);
253 retval = 1;
254out:
255 return retval;
256}
257
258#endif
259
260/*
261 * IXP4xx does not have a transparent cpu -> PCI I/O translation
262 * window. Instead, it has a set of registers that must be tweaked
263 * with the proper byte lanes, command types, and address for the
264 * transaction. This means that we need to override the default
265 * I/O functions.
266 */
267#define outb(p, v) __ixp4xx_outb(p, v)
268#define outw(p, v) __ixp4xx_outw(p, v)
269#define outl(p, v) __ixp4xx_outl(p, v)
270
271#define outsb(p, v, l) __ixp4xx_outsb(p, v, l)
272#define outsw(p, v, l) __ixp4xx_outsw(p, v, l)
273#define outsl(p, v, l) __ixp4xx_outsl(p, v, l)
274
275#define inb(p) __ixp4xx_inb(p)
276#define inw(p) __ixp4xx_inw(p)
277#define inl(p) __ixp4xx_inl(p)
278
279#define insb(p, v, l) __ixp4xx_insb(p, v, l)
280#define insw(p, v, l) __ixp4xx_insw(p, v, l)
281#define insl(p, v, l) __ixp4xx_insl(p, v, l)
282
283
284static inline void
285__ixp4xx_outb(u8 value, u32 addr)
286{
287 u32 n, byte_enables, data;
288 n = addr % 4;
289 byte_enables = (0xf & ~BIT(n)) << IXP4XX_PCI_NP_CBE_BESL;
290 data = value << (8*n);
291 ixp4xx_pci_write(addr, byte_enables | NP_CMD_IOWRITE, data);
292}
293
294static inline void
295__ixp4xx_outsb(u32 io_addr, const u8 *vaddr, u32 count)
296{
297 while (count--)
298 outb(*vaddr++, io_addr);
299}
300
301static inline void
302__ixp4xx_outw(u16 value, u32 addr)
303{
304 u32 n, byte_enables, data;
305 n = addr % 4;
306 byte_enables = (0xf & ~(BIT(n) | BIT(n+1))) << IXP4XX_PCI_NP_CBE_BESL;
307 data = value << (8*n);
308 ixp4xx_pci_write(addr, byte_enables | NP_CMD_IOWRITE, data);
309}
310
311static inline void
312__ixp4xx_outsw(u32 io_addr, const u16 *vaddr, u32 count)
313{
314 while (count--)
315 outw(cpu_to_le16(*vaddr++), io_addr);
316}
317
318static inline void
319__ixp4xx_outl(u32 value, u32 addr)
320{
321 ixp4xx_pci_write(addr, NP_CMD_IOWRITE, value);
322}
323
324static inline void
325__ixp4xx_outsl(u32 io_addr, const u32 *vaddr, u32 count)
326{
327 while (count--)
328 outl(*vaddr++, io_addr);
329}
330
331static inline u8
332__ixp4xx_inb(u32 addr)
333{
334 u32 n, byte_enables, data;
335 n = addr % 4;
336 byte_enables = (0xf & ~BIT(n)) << IXP4XX_PCI_NP_CBE_BESL;
337 if (ixp4xx_pci_read(addr, byte_enables | NP_CMD_IOREAD, &data))
338 return 0xff;
339
340 return data >> (8*n);
341}
342
343static inline void
344__ixp4xx_insb(u32 io_addr, u8 *vaddr, u32 count)
345{
346 while (count--)
347 *vaddr++ = inb(io_addr);
348}
349
350static inline u16
351__ixp4xx_inw(u32 addr)
352{
353 u32 n, byte_enables, data;
354 n = addr % 4;
355 byte_enables = (0xf & ~(BIT(n) | BIT(n+1))) << IXP4XX_PCI_NP_CBE_BESL;
356 if (ixp4xx_pci_read(addr, byte_enables | NP_CMD_IOREAD, &data))
357 return 0xffff;
358
359 return data>>(8*n);
360}
361
362static inline void
363__ixp4xx_insw(u32 io_addr, u16 *vaddr, u32 count)
364{
365 while (count--)
366 *vaddr++ = le16_to_cpu(inw(io_addr));
367}
368
369static inline u32
370__ixp4xx_inl(u32 addr)
371{
372 u32 data;
373 if (ixp4xx_pci_read(addr, NP_CMD_IOREAD, &data))
374 return 0xffffffff;
375
376 return data;
377}
378
379static inline void
380__ixp4xx_insl(u32 io_addr, u32 *vaddr, u32 count)
381{
382 while (count--)
383 *vaddr++ = inl(io_addr);
384}
385
386
387#endif // __ASM_ARM_ARCH_IO_H
388
diff --git a/include/asm-arm/arch-ixp4xx/irq.h b/include/asm-arm/arch-ixp4xx/irq.h
new file mode 100644
index 000000000000..87da70695f0a
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/irq.h
@@ -0,0 +1,13 @@
1/*
2 * irq.h
3 *
4 * Copyright (C) 2002 Intel 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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#define fixup_irq(irq) (irq)
13
diff --git a/include/asm-arm/arch-ixp4xx/irqs.h b/include/asm-arm/arch-ixp4xx/irqs.h
new file mode 100644
index 000000000000..ca808281c7f9
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/irqs.h
@@ -0,0 +1,96 @@
1/*
2 * include/asm-arm/arch-ixp4xx/irqs.h
3 *
4 * IRQ definitions for IXP4XX based systems
5 *
6 * Copyright (C) 2002 Intel Corporation.
7 * Copyright (C) 2003 MontaVista Software, Inc.
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#ifndef _ARCH_IXP4XX_IRQS_H_
16#define _ARCH_IXP4XX_IRQS_H_
17
18
19#define IRQ_IXP4XX_NPEA 0
20#define IRQ_IXP4XX_NPEB 1
21#define IRQ_IXP4XX_NPEC 2
22#define IRQ_IXP4XX_QM1 3
23#define IRQ_IXP4XX_QM2 4
24#define IRQ_IXP4XX_TIMER1 5
25#define IRQ_IXP4XX_GPIO0 6
26#define IRQ_IXP4XX_GPIO1 7
27#define IRQ_IXP4XX_PCI_INT 8
28#define IRQ_IXP4XX_PCI_DMA1 9
29#define IRQ_IXP4XX_PCI_DMA2 10
30#define IRQ_IXP4XX_TIMER2 11
31#define IRQ_IXP4XX_USB 12
32#define IRQ_IXP4XX_UART2 13
33#define IRQ_IXP4XX_TIMESTAMP 14
34#define IRQ_IXP4XX_UART1 15
35#define IRQ_IXP4XX_WDOG 16
36#define IRQ_IXP4XX_AHB_PMU 17
37#define IRQ_IXP4XX_XSCALE_PMU 18
38#define IRQ_IXP4XX_GPIO2 19
39#define IRQ_IXP4XX_GPIO3 20
40#define IRQ_IXP4XX_GPIO4 21
41#define IRQ_IXP4XX_GPIO5 22
42#define IRQ_IXP4XX_GPIO6 23
43#define IRQ_IXP4XX_GPIO7 24
44#define IRQ_IXP4XX_GPIO8 25
45#define IRQ_IXP4XX_GPIO9 26
46#define IRQ_IXP4XX_GPIO10 27
47#define IRQ_IXP4XX_GPIO11 28
48#define IRQ_IXP4XX_GPIO12 29
49#define IRQ_IXP4XX_SW_INT1 30
50#define IRQ_IXP4XX_SW_INT2 31
51#define IRQ_IXP4XX_USB_HOST 32
52#define IRQ_IXP4XX_I2C 33
53#define IRQ_IXP4XX_SSP 34
54#define IRQ_IXP4XX_TSYNC 35
55#define IRQ_IXP4XX_EAU_DONE 36
56#define IRQ_IXP4XX_SHA_DONE 37
57#define IRQ_IXP4XX_SWCP_PE 58
58#define IRQ_IXP4XX_QM_PE 60
59#define IRQ_IXP4XX_MCU_ECC 61
60#define IRQ_IXP4XX_EXP_PE 62
61
62/*
63 * Only first 32 sources are valid if running on IXP42x systems
64 */
65#ifndef CONFIG_CPU_IXP46X
66#define NR_IRQS 32
67#else
68#define NR_IRQS 64
69#endif
70
71#define XSCALE_PMU_IRQ (IRQ_IXP4XX_XSCALE_PMU)
72
73/*
74 * IXDP425 board IRQs
75 */
76#define IRQ_IXDP425_PCI_INTA IRQ_IXP4XX_GPIO11
77#define IRQ_IXDP425_PCI_INTB IRQ_IXP4XX_GPIO10
78#define IRQ_IXDP425_PCI_INTC IRQ_IXP4XX_GPIO9
79#define IRQ_IXDP425_PCI_INTD IRQ_IXP4XX_GPIO8
80
81/*
82 * PrPMC1100 Board IRQs
83 */
84#define IRQ_PRPMC1100_PCI_INTA IRQ_IXP4XX_GPIO11
85#define IRQ_PRPMC1100_PCI_INTB IRQ_IXP4XX_GPIO10
86#define IRQ_PRPMC1100_PCI_INTC IRQ_IXP4XX_GPIO9
87#define IRQ_PRPMC1100_PCI_INTD IRQ_IXP4XX_GPIO8
88
89/*
90 * ADI Coyote Board IRQs
91 */
92#define IRQ_COYOTE_PCI_SLOT0 IRQ_IXP4XX_GPIO6
93#define IRQ_COYOTE_PCI_SLOT1 IRQ_IXP4XX_GPIO11
94#define IRQ_COYOTE_IDE IRQ_IXP4XX_GPIO5
95
96#endif
diff --git a/include/asm-arm/arch-ixp4xx/ixdp425.h b/include/asm-arm/arch-ixp4xx/ixdp425.h
new file mode 100644
index 000000000000..7d21bf941379
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/ixdp425.h
@@ -0,0 +1,38 @@
1/*
2 * include/asm-arm/arch-ixp4xx/ixdp425.h
3 *
4 * IXDP425 platform specific definitions
5 *
6 * Author: Deepak Saxena <dsaxena@plexity.net>
7 *
8 * Copyright 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#ifndef __ASM_ARCH_HARDWARE_H__
16#error "Do not include this directly, instead #include <asm/hardware.h>"
17#endif
18
19#define IXDP425_FLASH_BASE IXP4XX_EXP_BUS_CS0_BASE_PHYS
20#define IXDP425_FLASH_SIZE IXP4XX_EXP_BUS_CSX_REGION_SIZE
21
22#define IXDP425_SDA_PIN 7
23#define IXDP425_SCL_PIN 6
24
25/*
26 * IXDP425 PCI IRQs
27 */
28#define IXDP425_PCI_MAX_DEV 4
29#define IXDP425_PCI_IRQ_LINES 4
30
31
32/* PCI controller GPIO to IRQ pin mappings */
33#define IXDP425_PCI_INTA_PIN 11
34#define IXDP425_PCI_INTB_PIN 10
35#define IXDP425_PCI_INTC_PIN 9
36#define IXDP425_PCI_INTD_PIN 8
37
38
diff --git a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
new file mode 100644
index 000000000000..8eeb1db6309d
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
@@ -0,0 +1,591 @@
1/*
2 * include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
3 *
4 * Register definitions for IXP4xx chipset. This file contains
5 * register location and bit definitions only. Platform specific
6 * definitions and helper function declarations are in platform.h
7 * and machine-name.h.
8 *
9 * Copyright (C) 2002 Intel Corporation.
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#ifndef __ASM_ARCH_HARDWARE_H__
19#error "Do not include this directly, instead #include <asm/hardware.h>"
20#endif
21
22#ifndef _ASM_ARM_IXP4XX_H_
23#define _ASM_ARM_IXP4XX_H_
24
25/*
26 * IXP4xx Linux Memory Map:
27 *
28 * Phy Size Virt Description
29 * =========================================================================
30 *
31 * 0x00000000 0x10000000(max) PAGE_OFFSET System RAM
32 *
33 * 0x48000000 0x04000000 ioremap'd PCI Memory Space
34 *
35 * 0x50000000 0x10000000 ioremap'd EXP BUS
36 *
37 * 0x6000000 0x00004000 ioremap'd QMgr
38 *
39 * 0xC0000000 0x00001000 0xffbfe000 PCI CFG
40 *
41 * 0xC4000000 0x00001000 0xffbfd000 EXP CFG
42 *
43 * 0xC8000000 0x0000C000 0xffbf2000 On-Chip Peripherals
44 */
45
46/*
47 * Queue Manager
48 */
49#define IXP4XX_QMGR_BASE_PHYS (0x60000000)
50
51/*
52 * Expansion BUS Configuration registers
53 */
54#define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000)
55#define IXP4XX_EXP_CFG_BASE_VIRT (0xFFBFD000)
56#define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000)
57
58/*
59 * PCI Config registers
60 */
61#define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000)
62#define IXP4XX_PCI_CFG_BASE_VIRT (0xFFBFE000)
63#define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000)
64
65/*
66 * Peripheral space
67 */
68#define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000)
69#define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBF2000)
70#define IXP4XX_PERIPHERAL_REGION_SIZE (0x0000C000)
71
72#define IXP4XX_EXP_CS0_OFFSET 0x00
73#define IXP4XX_EXP_CS1_OFFSET 0x04
74#define IXP4XX_EXP_CS2_OFFSET 0x08
75#define IXP4XX_EXP_CS3_OFFSET 0x0C
76#define IXP4XX_EXP_CS4_OFFSET 0x10
77#define IXP4XX_EXP_CS5_OFFSET 0x14
78#define IXP4XX_EXP_CS6_OFFSET 0x18
79#define IXP4XX_EXP_CS7_OFFSET 0x1C
80#define IXP4XX_EXP_CFG0_OFFSET 0x20
81#define IXP4XX_EXP_CFG1_OFFSET 0x24
82#define IXP4XX_EXP_CFG2_OFFSET 0x28
83#define IXP4XX_EXP_CFG3_OFFSET 0x2C
84
85/*
86 * Expansion Bus Controller registers.
87 */
88#define IXP4XX_EXP_REG(x) ((volatile u32 *)(IXP4XX_EXP_CFG_BASE_VIRT+(x)))
89
90#define IXP4XX_EXP_CS0 IXP4XX_EXP_REG(IXP4XX_EXP_CS0_OFFSET)
91#define IXP4XX_EXP_CS1 IXP4XX_EXP_REG(IXP4XX_EXP_CS1_OFFSET)
92#define IXP4XX_EXP_CS2 IXP4XX_EXP_REG(IXP4XX_EXP_CS2_OFFSET)
93#define IXP4XX_EXP_CS3 IXP4XX_EXP_REG(IXP4XX_EXP_CS3_OFFSET)
94#define IXP4XX_EXP_CS4 IXP4XX_EXP_REG(IXP4XX_EXP_CS4_OFFSET)
95#define IXP4XX_EXP_CS5 IXP4XX_EXP_REG(IXP4XX_EXP_CS5_OFFSET)
96#define IXP4XX_EXP_CS6 IXP4XX_EXP_REG(IXP4XX_EXP_CS6_OFFSET)
97#define IXP4XX_EXP_CS7 IXP4XX_EXP_REG(IXP4XX_EXP_CS7_OFFSET)
98
99#define IXP4XX_EXP_CFG0 IXP4XX_EXP_REG(IXP4XX_EXP_CFG0_OFFSET)
100#define IXP4XX_EXP_CFG1 IXP4XX_EXP_REG(IXP4XX_EXP_CFG1_OFFSET)
101#define IXP4XX_EXP_CFG2 IXP4XX_EXP_REG(IXP4XX_EXP_CFG2_OFFSET)
102#define IXP4XX_EXP_CFG3 IXP4XX_EXP_REG(IXP4XX_EXP_CFG3_OFFSET)
103
104
105/*
106 * Peripheral Space Register Region Base Addresses
107 */
108#define IXP4XX_UART1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x0000)
109#define IXP4XX_UART2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x1000)
110#define IXP4XX_PMU_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x2000)
111#define IXP4XX_INTC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x3000)
112#define IXP4XX_GPIO_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x4000)
113#define IXP4XX_TIMER_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x5000)
114#define IXP4XX_EthA_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x9000)
115#define IXP4XX_EthB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xA000)
116#define IXP4XX_USB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xB000)
117
118#define IXP4XX_UART1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x0000)
119#define IXP4XX_UART2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x1000)
120#define IXP4XX_PMU_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x2000)
121#define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000)
122#define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000)
123#define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000)
124#define IXP4XX_EthA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000)
125#define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000)
126#define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000)
127
128/*
129 * Constants to make it easy to access Interrupt Controller registers
130 */
131#define IXP4XX_ICPR_OFFSET 0x00 /* Interrupt Status */
132#define IXP4XX_ICMR_OFFSET 0x04 /* Interrupt Enable */
133#define IXP4XX_ICLR_OFFSET 0x08 /* Interrupt IRQ/FIQ Select */
134#define IXP4XX_ICIP_OFFSET 0x0C /* IRQ Status */
135#define IXP4XX_ICFP_OFFSET 0x10 /* FIQ Status */
136#define IXP4XX_ICHR_OFFSET 0x14 /* Interrupt Priority */
137#define IXP4XX_ICIH_OFFSET 0x18 /* IRQ Highest Pri Int */
138#define IXP4XX_ICFH_OFFSET 0x1C /* FIQ Highest Pri Int */
139
140/*
141 * IXP465-only
142 */
143#define IXP4XX_ICPR2_OFFSET 0x20 /* Interrupt Status 2 */
144#define IXP4XX_ICMR2_OFFSET 0x24 /* Interrupt Enable 2 */
145#define IXP4XX_ICLR2_OFFSET 0x28 /* Interrupt IRQ/FIQ Select 2 */
146#define IXP4XX_ICIP2_OFFSET 0x2C /* IRQ Status */
147#define IXP4XX_ICFP2_OFFSET 0x30 /* FIQ Status */
148#define IXP4XX_ICEEN_OFFSET 0x34 /* Error High Pri Enable */
149
150
151/*
152 * Interrupt Controller Register Definitions.
153 */
154
155#define IXP4XX_INTC_REG(x) ((volatile u32 *)(IXP4XX_INTC_BASE_VIRT+(x)))
156
157#define IXP4XX_ICPR IXP4XX_INTC_REG(IXP4XX_ICPR_OFFSET)
158#define IXP4XX_ICMR IXP4XX_INTC_REG(IXP4XX_ICMR_OFFSET)
159#define IXP4XX_ICLR IXP4XX_INTC_REG(IXP4XX_ICLR_OFFSET)
160#define IXP4XX_ICIP IXP4XX_INTC_REG(IXP4XX_ICIP_OFFSET)
161#define IXP4XX_ICFP IXP4XX_INTC_REG(IXP4XX_ICFP_OFFSET)
162#define IXP4XX_ICHR IXP4XX_INTC_REG(IXP4XX_ICHR_OFFSET)
163#define IXP4XX_ICIH IXP4XX_INTC_REG(IXP4XX_ICIH_OFFSET)
164#define IXP4XX_ICFH IXP4XX_INTC_REG(IXP4XX_ICFH_OFFSET)
165#define IXP4XX_ICPR2 IXP4XX_INTC_REG(IXP4XX_ICPR2_OFFSET)
166#define IXP4XX_ICMR2 IXP4XX_INTC_REG(IXP4XX_ICMR2_OFFSET)
167#define IXP4XX_ICLR2 IXP4XX_INTC_REG(IXP4XX_ICLR2_OFFSET)
168#define IXP4XX_ICIP2 IXP4XX_INTC_REG(IXP4XX_ICIP2_OFFSET)
169#define IXP4XX_ICFP2 IXP4XX_INTC_REG(IXP4XX_ICFP2_OFFSET)
170#define IXP4XX_ICEEN IXP4XX_INTC_REG(IXP4XX_ICEEN_OFFSET)
171
172/*
173 * Constants to make it easy to access GPIO registers
174 */
175#define IXP4XX_GPIO_GPOUTR_OFFSET 0x00
176#define IXP4XX_GPIO_GPOER_OFFSET 0x04
177#define IXP4XX_GPIO_GPINR_OFFSET 0x08
178#define IXP4XX_GPIO_GPISR_OFFSET 0x0C
179#define IXP4XX_GPIO_GPIT1R_OFFSET 0x10
180#define IXP4XX_GPIO_GPIT2R_OFFSET 0x14
181#define IXP4XX_GPIO_GPCLKR_OFFSET 0x18
182#define IXP4XX_GPIO_GPDBSELR_OFFSET 0x1C
183
184/*
185 * GPIO Register Definitions.
186 * [Only perform 32bit reads/writes]
187 */
188#define IXP4XX_GPIO_REG(x) ((volatile u32 *)(IXP4XX_GPIO_BASE_VIRT+(x)))
189
190#define IXP4XX_GPIO_GPOUTR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPOUTR_OFFSET)
191#define IXP4XX_GPIO_GPOER IXP4XX_GPIO_REG(IXP4XX_GPIO_GPOER_OFFSET)
192#define IXP4XX_GPIO_GPINR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPINR_OFFSET)
193#define IXP4XX_GPIO_GPISR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPISR_OFFSET)
194#define IXP4XX_GPIO_GPIT1R IXP4XX_GPIO_REG(IXP4XX_GPIO_GPIT1R_OFFSET)
195#define IXP4XX_GPIO_GPIT2R IXP4XX_GPIO_REG(IXP4XX_GPIO_GPIT2R_OFFSET)
196#define IXP4XX_GPIO_GPCLKR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPCLKR_OFFSET)
197#define IXP4XX_GPIO_GPDBSELR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPDBSELR_OFFSET)
198
199/*
200 * GPIO register bit definitions
201 */
202
203/* Interrupt styles
204 */
205#define IXP4XX_GPIO_STYLE_ACTIVE_HIGH 0x0
206#define IXP4XX_GPIO_STYLE_ACTIVE_LOW 0x1
207#define IXP4XX_GPIO_STYLE_RISING_EDGE 0x2
208#define IXP4XX_GPIO_STYLE_FALLING_EDGE 0x3
209#define IXP4XX_GPIO_STYLE_TRANSITIONAL 0x4
210
211/*
212 * Mask used to clear interrupt styles
213 */
214#define IXP4XX_GPIO_STYLE_CLEAR 0x7
215#define IXP4XX_GPIO_STYLE_SIZE 3
216
217/*
218 * Constants to make it easy to access Timer Control/Status registers
219 */
220#define IXP4XX_OSTS_OFFSET 0x00 /* Continious TimeStamp */
221#define IXP4XX_OST1_OFFSET 0x04 /* Timer 1 Timestamp */
222#define IXP4XX_OSRT1_OFFSET 0x08 /* Timer 1 Reload */
223#define IXP4XX_OST2_OFFSET 0x0C /* Timer 2 Timestamp */
224#define IXP4XX_OSRT2_OFFSET 0x10 /* Timer 2 Reload */
225#define IXP4XX_OSWT_OFFSET 0x14 /* Watchdog Timer */
226#define IXP4XX_OSWE_OFFSET 0x18 /* Watchdog Enable */
227#define IXP4XX_OSWK_OFFSET 0x1C /* Watchdog Key */
228#define IXP4XX_OSST_OFFSET 0x20 /* Timer Status */
229
230/*
231 * Operating System Timer Register Definitions.
232 */
233
234#define IXP4XX_TIMER_REG(x) ((volatile u32 *)(IXP4XX_TIMER_BASE_VIRT+(x)))
235
236#define IXP4XX_OSTS IXP4XX_TIMER_REG(IXP4XX_OSTS_OFFSET)
237#define IXP4XX_OST1 IXP4XX_TIMER_REG(IXP4XX_OST1_OFFSET)
238#define IXP4XX_OSRT1 IXP4XX_TIMER_REG(IXP4XX_OSRT1_OFFSET)
239#define IXP4XX_OST2 IXP4XX_TIMER_REG(IXP4XX_OST2_OFFSET)
240#define IXP4XX_OSRT2 IXP4XX_TIMER_REG(IXP4XX_OSRT2_OFFSET)
241#define IXP4XX_OSWT IXP4XX_TIMER_REG(IXP4XX_OSWT_OFFSET)
242#define IXP4XX_OSWE IXP4XX_TIMER_REG(IXP4XX_OSWE_OFFSET)
243#define IXP4XX_OSWK IXP4XX_TIMER_REG(IXP4XX_OSWK_OFFSET)
244#define IXP4XX_OSST IXP4XX_TIMER_REG(IXP4XX_OSST_OFFSET)
245
246/*
247 * Timer register values and bit definitions
248 */
249#define IXP4XX_OST_ENABLE 0x00000001
250#define IXP4XX_OST_ONE_SHOT 0x00000002
251/* Low order bits of reload value ignored */
252#define IXP4XX_OST_RELOAD_MASK 0x00000003
253#define IXP4XX_OST_DISABLED 0x00000000
254#define IXP4XX_OSST_TIMER_1_PEND 0x00000001
255#define IXP4XX_OSST_TIMER_2_PEND 0x00000002
256#define IXP4XX_OSST_TIMER_TS_PEND 0x00000004
257#define IXP4XX_OSST_TIMER_WDOG_PEND 0x00000008
258#define IXP4XX_OSST_TIMER_WARM_RESET 0x00000010
259
260#define IXP4XX_WDT_KEY 0x0000482E
261
262#define IXP4XX_WDT_RESET_ENABLE 0x00000001
263#define IXP4XX_WDT_IRQ_ENABLE 0x00000002
264#define IXP4XX_WDT_COUNT_ENABLE 0x00000004
265
266
267/*
268 * Constants to make it easy to access PCI Control/Status registers
269 */
270#define PCI_NP_AD_OFFSET 0x00
271#define PCI_NP_CBE_OFFSET 0x04
272#define PCI_NP_WDATA_OFFSET 0x08
273#define PCI_NP_RDATA_OFFSET 0x0c
274#define PCI_CRP_AD_CBE_OFFSET 0x10
275#define PCI_CRP_WDATA_OFFSET 0x14
276#define PCI_CRP_RDATA_OFFSET 0x18
277#define PCI_CSR_OFFSET 0x1c
278#define PCI_ISR_OFFSET 0x20
279#define PCI_INTEN_OFFSET 0x24
280#define PCI_DMACTRL_OFFSET 0x28
281#define PCI_AHBMEMBASE_OFFSET 0x2c
282#define PCI_AHBIOBASE_OFFSET 0x30
283#define PCI_PCIMEMBASE_OFFSET 0x34
284#define PCI_AHBDOORBELL_OFFSET 0x38
285#define PCI_PCIDOORBELL_OFFSET 0x3C
286#define PCI_ATPDMA0_AHBADDR_OFFSET 0x40
287#define PCI_ATPDMA0_PCIADDR_OFFSET 0x44
288#define PCI_ATPDMA0_LENADDR_OFFSET 0x48
289#define PCI_ATPDMA1_AHBADDR_OFFSET 0x4C
290#define PCI_ATPDMA1_PCIADDR_OFFSET 0x50
291#define PCI_ATPDMA1_LENADDR_OFFSET 0x54
292
293/*
294 * PCI Control/Status Registers
295 */
296#define IXP4XX_PCI_CSR(x) ((volatile u32 *)(IXP4XX_PCI_CFG_BASE_VIRT+(x)))
297
298#define PCI_NP_AD IXP4XX_PCI_CSR(PCI_NP_AD_OFFSET)
299#define PCI_NP_CBE IXP4XX_PCI_CSR(PCI_NP_CBE_OFFSET)
300#define PCI_NP_WDATA IXP4XX_PCI_CSR(PCI_NP_WDATA_OFFSET)
301#define PCI_NP_RDATA IXP4XX_PCI_CSR(PCI_NP_RDATA_OFFSET)
302#define PCI_CRP_AD_CBE IXP4XX_PCI_CSR(PCI_CRP_AD_CBE_OFFSET)
303#define PCI_CRP_WDATA IXP4XX_PCI_CSR(PCI_CRP_WDATA_OFFSET)
304#define PCI_CRP_RDATA IXP4XX_PCI_CSR(PCI_CRP_RDATA_OFFSET)
305#define PCI_CSR IXP4XX_PCI_CSR(PCI_CSR_OFFSET)
306#define PCI_ISR IXP4XX_PCI_CSR(PCI_ISR_OFFSET)
307#define PCI_INTEN IXP4XX_PCI_CSR(PCI_INTEN_OFFSET)
308#define PCI_DMACTRL IXP4XX_PCI_CSR(PCI_DMACTRL_OFFSET)
309#define PCI_AHBMEMBASE IXP4XX_PCI_CSR(PCI_AHBMEMBASE_OFFSET)
310#define PCI_AHBIOBASE IXP4XX_PCI_CSR(PCI_AHBIOBASE_OFFSET)
311#define PCI_PCIMEMBASE IXP4XX_PCI_CSR(PCI_PCIMEMBASE_OFFSET)
312#define PCI_AHBDOORBELL IXP4XX_PCI_CSR(PCI_AHBDOORBELL_OFFSET)
313#define PCI_PCIDOORBELL IXP4XX_PCI_CSR(PCI_PCIDOORBELL_OFFSET)
314#define PCI_ATPDMA0_AHBADDR IXP4XX_PCI_CSR(PCI_ATPDMA0_AHBADDR_OFFSET)
315#define PCI_ATPDMA0_PCIADDR IXP4XX_PCI_CSR(PCI_ATPDMA0_PCIADDR_OFFSET)
316#define PCI_ATPDMA0_LENADDR IXP4XX_PCI_CSR(PCI_ATPDMA0_LENADDR_OFFSET)
317#define PCI_ATPDMA1_AHBADDR IXP4XX_PCI_CSR(PCI_ATPDMA1_AHBADDR_OFFSET)
318#define PCI_ATPDMA1_PCIADDR IXP4XX_PCI_CSR(PCI_ATPDMA1_PCIADDR_OFFSET)
319#define PCI_ATPDMA1_LENADDR IXP4XX_PCI_CSR(PCI_ATPDMA1_LENADDR_OFFSET)
320
321/*
322 * PCI register values and bit definitions
323 */
324
325/* CSR bit definitions */
326#define PCI_CSR_HOST 0x00000001
327#define PCI_CSR_ARBEN 0x00000002
328#define PCI_CSR_ADS 0x00000004
329#define PCI_CSR_PDS 0x00000008
330#define PCI_CSR_ABE 0x00000010
331#define PCI_CSR_DBT 0x00000020
332#define PCI_CSR_ASE 0x00000100
333#define PCI_CSR_IC 0x00008000
334
335/* ISR (Interrupt status) Register bit definitions */
336#define PCI_ISR_PSE 0x00000001
337#define PCI_ISR_PFE 0x00000002
338#define PCI_ISR_PPE 0x00000004
339#define PCI_ISR_AHBE 0x00000008
340#define PCI_ISR_APDC 0x00000010
341#define PCI_ISR_PADC 0x00000020
342#define PCI_ISR_ADB 0x00000040
343#define PCI_ISR_PDB 0x00000080
344
345/* INTEN (Interrupt Enable) Register bit definitions */
346#define PCI_INTEN_PSE 0x00000001
347#define PCI_INTEN_PFE 0x00000002
348#define PCI_INTEN_PPE 0x00000004
349#define PCI_INTEN_AHBE 0x00000008
350#define PCI_INTEN_APDC 0x00000010
351#define PCI_INTEN_PADC 0x00000020
352#define PCI_INTEN_ADB 0x00000040
353#define PCI_INTEN_PDB 0x00000080
354
355/*
356 * Shift value for byte enable on NP cmd/byte enable register
357 */
358#define IXP4XX_PCI_NP_CBE_BESL 4
359
360/*
361 * PCI commands supported by NP access unit
362 */
363#define NP_CMD_IOREAD 0x2
364#define NP_CMD_IOWRITE 0x3
365#define NP_CMD_CONFIGREAD 0xa
366#define NP_CMD_CONFIGWRITE 0xb
367#define NP_CMD_MEMREAD 0x6
368#define NP_CMD_MEMWRITE 0x7
369
370/*
371 * Constants for CRP access into local config space
372 */
373#define CRP_AD_CBE_BESL 20
374#define CRP_AD_CBE_WRITE 0x00010000
375
376
377/*
378 * USB Device Controller
379 *
380 * These are used by the USB gadget driver, so they don't follow the
381 * IXP4XX_ naming convetions.
382 *
383 */
384# define IXP4XX_USB_REG(x) (*((volatile u32 *)(x)))
385
386/* UDC Undocumented - Reserved1 */
387#define UDC_RES1 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0004)
388/* UDC Undocumented - Reserved2 */
389#define UDC_RES2 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0008)
390/* UDC Undocumented - Reserved3 */
391#define UDC_RES3 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x000C)
392/* UDC Control Register */
393#define UDCCR IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0000)
394/* UDC Endpoint 0 Control/Status Register */
395#define UDCCS0 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0010)
396/* UDC Endpoint 1 (IN) Control/Status Register */
397#define UDCCS1 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0014)
398/* UDC Endpoint 2 (OUT) Control/Status Register */
399#define UDCCS2 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0018)
400/* UDC Endpoint 3 (IN) Control/Status Register */
401#define UDCCS3 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x001C)
402/* UDC Endpoint 4 (OUT) Control/Status Register */
403#define UDCCS4 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0020)
404/* UDC Endpoint 5 (Interrupt) Control/Status Register */
405#define UDCCS5 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0024)
406/* UDC Endpoint 6 (IN) Control/Status Register */
407#define UDCCS6 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0028)
408/* UDC Endpoint 7 (OUT) Control/Status Register */
409#define UDCCS7 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x002C)
410/* UDC Endpoint 8 (IN) Control/Status Register */
411#define UDCCS8 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0030)
412/* UDC Endpoint 9 (OUT) Control/Status Register */
413#define UDCCS9 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0034)
414/* UDC Endpoint 10 (Interrupt) Control/Status Register */
415#define UDCCS10 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0038)
416/* UDC Endpoint 11 (IN) Control/Status Register */
417#define UDCCS11 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x003C)
418/* UDC Endpoint 12 (OUT) Control/Status Register */
419#define UDCCS12 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0040)
420/* UDC Endpoint 13 (IN) Control/Status Register */
421#define UDCCS13 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0044)
422/* UDC Endpoint 14 (OUT) Control/Status Register */
423#define UDCCS14 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0048)
424/* UDC Endpoint 15 (Interrupt) Control/Status Register */
425#define UDCCS15 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x004C)
426/* UDC Frame Number Register High */
427#define UFNRH IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0060)
428/* UDC Frame Number Register Low */
429#define UFNRL IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0064)
430/* UDC Byte Count Reg 2 */
431#define UBCR2 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0068)
432/* UDC Byte Count Reg 4 */
433#define UBCR4 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x006c)
434/* UDC Byte Count Reg 7 */
435#define UBCR7 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0070)
436/* UDC Byte Count Reg 9 */
437#define UBCR9 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0074)
438/* UDC Byte Count Reg 12 */
439#define UBCR12 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0078)
440/* UDC Byte Count Reg 14 */
441#define UBCR14 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x007c)
442/* UDC Endpoint 0 Data Register */
443#define UDDR0 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0080)
444/* UDC Endpoint 1 Data Register */
445#define UDDR1 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0100)
446/* UDC Endpoint 2 Data Register */
447#define UDDR2 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0180)
448/* UDC Endpoint 3 Data Register */
449#define UDDR3 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0200)
450/* UDC Endpoint 4 Data Register */
451#define UDDR4 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0400)
452/* UDC Endpoint 5 Data Register */
453#define UDDR5 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x00A0)
454/* UDC Endpoint 6 Data Register */
455#define UDDR6 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0600)
456/* UDC Endpoint 7 Data Register */
457#define UDDR7 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0680)
458/* UDC Endpoint 8 Data Register */
459#define UDDR8 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0700)
460/* UDC Endpoint 9 Data Register */
461#define UDDR9 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0900)
462/* UDC Endpoint 10 Data Register */
463#define UDDR10 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x00C0)
464/* UDC Endpoint 11 Data Register */
465#define UDDR11 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0B00)
466/* UDC Endpoint 12 Data Register */
467#define UDDR12 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0B80)
468/* UDC Endpoint 13 Data Register */
469#define UDDR13 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0C00)
470/* UDC Endpoint 14 Data Register */
471#define UDDR14 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0E00)
472/* UDC Endpoint 15 Data Register */
473#define UDDR15 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x00E0)
474/* UDC Interrupt Control Register 0 */
475#define UICR0 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0050)
476/* UDC Interrupt Control Register 1 */
477#define UICR1 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0054)
478/* UDC Status Interrupt Register 0 */
479#define USIR0 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0058)
480/* UDC Status Interrupt Register 1 */
481#define USIR1 IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x005C)
482
483#define UDCCR_UDE (1 << 0) /* UDC enable */
484#define UDCCR_UDA (1 << 1) /* UDC active */
485#define UDCCR_RSM (1 << 2) /* Device resume */
486#define UDCCR_RESIR (1 << 3) /* Resume interrupt request */
487#define UDCCR_SUSIR (1 << 4) /* Suspend interrupt request */
488#define UDCCR_SRM (1 << 5) /* Suspend/resume interrupt mask */
489#define UDCCR_RSTIR (1 << 6) /* Reset interrupt request */
490#define UDCCR_REM (1 << 7) /* Reset interrupt mask */
491
492#define UDCCS0_OPR (1 << 0) /* OUT packet ready */
493#define UDCCS0_IPR (1 << 1) /* IN packet ready */
494#define UDCCS0_FTF (1 << 2) /* Flush Tx FIFO */
495#define UDCCS0_DRWF (1 << 3) /* Device remote wakeup feature */
496#define UDCCS0_SST (1 << 4) /* Sent stall */
497#define UDCCS0_FST (1 << 5) /* Force stall */
498#define UDCCS0_RNE (1 << 6) /* Receive FIFO no empty */
499#define UDCCS0_SA (1 << 7) /* Setup active */
500
501#define UDCCS_BI_TFS (1 << 0) /* Transmit FIFO service */
502#define UDCCS_BI_TPC (1 << 1) /* Transmit packet complete */
503#define UDCCS_BI_FTF (1 << 2) /* Flush Tx FIFO */
504#define UDCCS_BI_TUR (1 << 3) /* Transmit FIFO underrun */
505#define UDCCS_BI_SST (1 << 4) /* Sent stall */
506#define UDCCS_BI_FST (1 << 5) /* Force stall */
507#define UDCCS_BI_TSP (1 << 7) /* Transmit short packet */
508
509#define UDCCS_BO_RFS (1 << 0) /* Receive FIFO service */
510#define UDCCS_BO_RPC (1 << 1) /* Receive packet complete */
511#define UDCCS_BO_DME (1 << 3) /* DMA enable */
512#define UDCCS_BO_SST (1 << 4) /* Sent stall */
513#define UDCCS_BO_FST (1 << 5) /* Force stall */
514#define UDCCS_BO_RNE (1 << 6) /* Receive FIFO not empty */
515#define UDCCS_BO_RSP (1 << 7) /* Receive short packet */
516
517#define UDCCS_II_TFS (1 << 0) /* Transmit FIFO service */
518#define UDCCS_II_TPC (1 << 1) /* Transmit packet complete */
519#define UDCCS_II_FTF (1 << 2) /* Flush Tx FIFO */
520#define UDCCS_II_TUR (1 << 3) /* Transmit FIFO underrun */
521#define UDCCS_II_TSP (1 << 7) /* Transmit short packet */
522
523#define UDCCS_IO_RFS (1 << 0) /* Receive FIFO service */
524#define UDCCS_IO_RPC (1 << 1) /* Receive packet complete */
525#define UDCCS_IO_ROF (1 << 3) /* Receive overflow */
526#define UDCCS_IO_DME (1 << 3) /* DMA enable */
527#define UDCCS_IO_RNE (1 << 6) /* Receive FIFO not empty */
528#define UDCCS_IO_RSP (1 << 7) /* Receive short packet */
529
530#define UDCCS_INT_TFS (1 << 0) /* Transmit FIFO service */
531#define UDCCS_INT_TPC (1 << 1) /* Transmit packet complete */
532#define UDCCS_INT_FTF (1 << 2) /* Flush Tx FIFO */
533#define UDCCS_INT_TUR (1 << 3) /* Transmit FIFO underrun */
534#define UDCCS_INT_SST (1 << 4) /* Sent stall */
535#define UDCCS_INT_FST (1 << 5) /* Force stall */
536#define UDCCS_INT_TSP (1 << 7) /* Transmit short packet */
537
538#define UICR0_IM0 (1 << 0) /* Interrupt mask ep 0 */
539#define UICR0_IM1 (1 << 1) /* Interrupt mask ep 1 */
540#define UICR0_IM2 (1 << 2) /* Interrupt mask ep 2 */
541#define UICR0_IM3 (1 << 3) /* Interrupt mask ep 3 */
542#define UICR0_IM4 (1 << 4) /* Interrupt mask ep 4 */
543#define UICR0_IM5 (1 << 5) /* Interrupt mask ep 5 */
544#define UICR0_IM6 (1 << 6) /* Interrupt mask ep 6 */
545#define UICR0_IM7 (1 << 7) /* Interrupt mask ep 7 */
546
547#define UICR1_IM8 (1 << 0) /* Interrupt mask ep 8 */
548#define UICR1_IM9 (1 << 1) /* Interrupt mask ep 9 */
549#define UICR1_IM10 (1 << 2) /* Interrupt mask ep 10 */
550#define UICR1_IM11 (1 << 3) /* Interrupt mask ep 11 */
551#define UICR1_IM12 (1 << 4) /* Interrupt mask ep 12 */
552#define UICR1_IM13 (1 << 5) /* Interrupt mask ep 13 */
553#define UICR1_IM14 (1 << 6) /* Interrupt mask ep 14 */
554#define UICR1_IM15 (1 << 7) /* Interrupt mask ep 15 */
555
556#define USIR0_IR0 (1 << 0) /* Interrup request ep 0 */
557#define USIR0_IR1 (1 << 1) /* Interrup request ep 1 */
558#define USIR0_IR2 (1 << 2) /* Interrup request ep 2 */
559#define USIR0_IR3 (1 << 3) /* Interrup request ep 3 */
560#define USIR0_IR4 (1 << 4) /* Interrup request ep 4 */
561#define USIR0_IR5 (1 << 5) /* Interrup request ep 5 */
562#define USIR0_IR6 (1 << 6) /* Interrup request ep 6 */
563#define USIR0_IR7 (1 << 7) /* Interrup request ep 7 */
564
565#define USIR1_IR8 (1 << 0) /* Interrup request ep 8 */
566#define USIR1_IR9 (1 << 1) /* Interrup request ep 9 */
567#define USIR1_IR10 (1 << 2) /* Interrup request ep 10 */
568#define USIR1_IR11 (1 << 3) /* Interrup request ep 11 */
569#define USIR1_IR12 (1 << 4) /* Interrup request ep 12 */
570#define USIR1_IR13 (1 << 5) /* Interrup request ep 13 */
571#define USIR1_IR14 (1 << 6) /* Interrup request ep 14 */
572#define USIR1_IR15 (1 << 7) /* Interrup request ep 15 */
573
574#define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */
575
576#ifndef __ASSEMBLY__
577static inline int cpu_is_ixp46x(void)
578{
579#ifdef CONFIG_CPU_IXP46X
580 unsigned int processor_id;
581
582 asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :);
583
584 if ((processor_id & 0xffffff00) == 0x69054200)
585 return 1;
586#endif
587 return 0;
588}
589#endif
590
591#endif
diff --git a/include/asm-arm/arch-ixp4xx/memory.h b/include/asm-arm/arch-ixp4xx/memory.h
new file mode 100644
index 000000000000..d348548b592b
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/memory.h
@@ -0,0 +1,61 @@
1/*
2 * linux/include/asm-arm/arch-ixp4xx/memory.h
3 *
4 * Copyright (c) 2001-2004 MontaVista Software, Inc.
5 */
6
7#ifndef __ASM_ARCH_MEMORY_H
8#define __ASM_ARCH_MEMORY_H
9
10#include <asm/sizes.h>
11
12/*
13 * Physical DRAM offset.
14 */
15#define PHYS_OFFSET (0x00000000UL)
16
17#ifndef __ASSEMBLY__
18
19/*
20 * Only first 64MB of memory can be accessed via PCI.
21 * We use GFP_DMA to allocate safe buffers to do map/unmap.
22 * This is really ugly and we need a better way of specifying
23 * DMA-capable regions of memory.
24 */
25static inline void __arch_adjust_zones(int node, unsigned long *zone_size,
26 unsigned long *zhole_size)
27{
28 unsigned int sz = SZ_64M >> PAGE_SHIFT;
29
30 /*
31 * Only adjust if > 64M on current system
32 */
33 if (node || (zone_size[0] <= sz))
34 return;
35
36 zone_size[1] = zone_size[0] - sz;
37 zone_size[0] = sz;
38 zhole_size[1] = zhole_size[0];
39 zhole_size[0] = 0;
40}
41
42#define arch_adjust_zones(node, size, holes) \
43 __arch_adjust_zones(node, size, holes)
44
45#define ISA_DMA_THRESHOLD (SZ_64M - 1)
46
47#endif
48
49/*
50 * Virtual view <-> DMA view memory address translations
51 * virt_to_bus: Used to translate the virtual address to an
52 * address suitable to be passed to set_dma_addr
53 * bus_to_virt: Used to convert an address for DMA operations
54 * to an address that the kernel can use.
55 *
56 * These are dummies for now.
57 */
58#define __virt_to_bus(x) __virt_to_phys(x)
59#define __bus_to_virt(x) __phys_to_virt(x)
60
61#endif
diff --git a/include/asm-arm/arch-ixp4xx/param.h b/include/asm-arm/arch-ixp4xx/param.h
new file mode 100644
index 000000000000..8a757125e5e7
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/param.h
@@ -0,0 +1,3 @@
1/*
2 * linux/include/asm-arm/arch-ixp4xx/param.h
3 */
diff --git a/include/asm-arm/arch-ixp4xx/platform.h b/include/asm-arm/arch-ixp4xx/platform.h
new file mode 100644
index 000000000000..3a626c03ea26
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/platform.h
@@ -0,0 +1,126 @@
1/*
2 * include/asm-arm/arch-ixp4xx/platform.h
3 *
4 * Constants and functions that are useful to IXP4xx platform-specific code
5 * and device drivers.
6 *
7 * Copyright (C) 2004 MontaVista Software, Inc.
8 */
9
10#ifndef __ASM_ARCH_HARDWARE_H__
11#error "Do not include this directly, instead #include <asm/hardware.h>"
12#endif
13
14#ifndef __ASSEMBLY__
15
16#include <asm/types.h>
17
18#ifndef __ARMEB__
19#define REG_OFFSET 0
20#else
21#define REG_OFFSET 3
22#endif
23
24/*
25 * Expansion bus memory regions
26 */
27#define IXP4XX_EXP_BUS_BASE_PHYS (0x50000000)
28
29#define IXP4XX_EXP_BUS_CSX_REGION_SIZE (0x01000000)
30
31#define IXP4XX_EXP_BUS_CS0_BASE_PHYS (IXP4XX_EXP_BUS_BASE_PHYS + 0x00000000)
32#define IXP4XX_EXP_BUS_CS1_BASE_PHYS (IXP4XX_EXP_BUS_BASE_PHYS + 0x01000000)
33#define IXP4XX_EXP_BUS_CS2_BASE_PHYS (IXP4XX_EXP_BUS_BASE_PHYS + 0x02000000)
34#define IXP4XX_EXP_BUS_CS3_BASE_PHYS (IXP4XX_EXP_BUS_BASE_PHYS + 0x03000000)
35#define IXP4XX_EXP_BUS_CS4_BASE_PHYS (IXP4XX_EXP_BUS_BASE_PHYS + 0x04000000)
36#define IXP4XX_EXP_BUS_CS5_BASE_PHYS (IXP4XX_EXP_BUS_BASE_PHYS + 0x05000000)
37#define IXP4XX_EXP_BUS_CS6_BASE_PHYS (IXP4XX_EXP_BUS_BASE_PHYS + 0x06000000)
38#define IXP4XX_EXP_BUS_CS7_BASE_PHYS (IXP4XX_EXP_BUS_BASE_PHYS + 0x07000000)
39
40#define IXP4XX_FLASH_WRITABLE (0x2)
41#define IXP4XX_FLASH_DEFAULT (0xbcd23c40)
42#define IXP4XX_FLASH_WRITE (0xbcd23c42)
43
44/*
45 * Clock Speed Definitions.
46 */
47#define IXP4XX_PERIPHERAL_BUS_CLOCK (66) /* 66Mhzi APB BUS */
48#define IXP4XX_UART_XTAL 14745600
49
50/*
51 * The IXP4xx chips do not have an I2C unit, so GPIO lines are just
52 * used to
53 * Used as platform_data to provide GPIO pin information to the ixp42x
54 * I2C driver.
55 */
56struct ixp4xx_i2c_pins {
57 unsigned long sda_pin;
58 unsigned long scl_pin;
59};
60
61
62struct sys_timer;
63
64/*
65 * Functions used by platform-level setup code
66 */
67extern void ixp4xx_map_io(void);
68extern void ixp4xx_init_irq(void);
69extern void ixp4xx_sys_init(void);
70extern struct sys_timer ixp4xx_timer;
71extern void ixp4xx_pci_preinit(void);
72struct pci_sys_data;
73extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
74extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
75
76/*
77 * GPIO-functions
78 */
79/*
80 * The following converted to the real HW bits the gpio_line_config
81 */
82/* GPIO pin types */
83#define IXP4XX_GPIO_OUT 0x1
84#define IXP4XX_GPIO_IN 0x2
85
86#define IXP4XX_GPIO_INTSTYLE_MASK 0x7C /* Bits [6:2] define interrupt style */
87
88/*
89 * GPIO interrupt types.
90 */
91#define IXP4XX_GPIO_ACTIVE_HIGH 0x4 /* Default */
92#define IXP4XX_GPIO_ACTIVE_LOW 0x8
93#define IXP4XX_GPIO_RISING_EDGE 0x10
94#define IXP4XX_GPIO_FALLING_EDGE 0x20
95#define IXP4XX_GPIO_TRANSITIONAL 0x40
96
97/* GPIO signal types */
98#define IXP4XX_GPIO_LOW 0
99#define IXP4XX_GPIO_HIGH 1
100
101/* GPIO Clocks */
102#define IXP4XX_GPIO_CLK_0 14
103#define IXP4XX_GPIO_CLK_1 15
104
105extern void gpio_line_config(u8 line, u32 style);
106
107static inline void gpio_line_get(u8 line, int *value)
108{
109 *value = (*IXP4XX_GPIO_GPINR >> line) & 0x1;
110}
111
112static inline void gpio_line_set(u8 line, int value)
113{
114 if (value == IXP4XX_GPIO_HIGH)
115 *IXP4XX_GPIO_GPOUTR |= (1 << line);
116 else if (value == IXP4XX_GPIO_LOW)
117 *IXP4XX_GPIO_GPOUTR &= ~(1 << line);
118}
119
120static inline void gpio_line_isr_clear(u8 line)
121{
122 *IXP4XX_GPIO_GPISR = (1 << line);
123}
124
125#endif // __ASSEMBLY__
126
diff --git a/include/asm-arm/arch-ixp4xx/prpmc1100.h b/include/asm-arm/arch-ixp4xx/prpmc1100.h
new file mode 100644
index 000000000000..e2532ab7f48f
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/prpmc1100.h
@@ -0,0 +1,33 @@
1/*
2 * include/asm-arm/arch-ixp4xx/prpmc1100.h
3 *
4 * Motorolla PrPMC1100 platform specific definitions
5 *
6 * Author: Deepak Saxena <dsaxena@plexity.net>
7 *
8 * Copyright 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#ifndef __ASM_ARCH_HARDWARE_H__
16#error "Do not include this directly, instead #include <asm/hardware.h>"
17#endif
18
19#define PRPMC1100_FLASH_BASE IXP4XX_EXP_BUS_CS0_BASE_PHYS
20#define PRPMC1100_FLASH_SIZE IXP4XX_EXP_BUS_CSX_REGION_SIZE
21
22#define PRPMC1100_PCI_MIN_DEVID 10
23#define PRPMC1100_PCI_MAX_DEVID 16
24#define PRPMC1100_PCI_IRQ_LINES 4
25
26
27/* PCI controller GPIO to IRQ pin mappings */
28#define PRPMC1100_PCI_INTA_PIN 11
29#define PRPMC1100_PCI_INTB_PIN 10
30#define PRPMC1100_PCI_INTC_PIN 9
31#define PRPMC1100_PCI_INTD_PIN 8
32
33
diff --git a/include/asm-arm/arch-ixp4xx/system.h b/include/asm-arm/arch-ixp4xx/system.h
new file mode 100644
index 000000000000..73589aad8dd6
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/system.h
@@ -0,0 +1,42 @@
1/*
2 * include/asm-arm/arch-ixp4x//system.h
3 *
4 * Copyright (C) 2002 Intel 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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#include <asm/hardware.h>
13
14static inline void arch_idle(void)
15{
16#if 0
17 if (!hlt_counter)
18 cpu_do_idle(0);
19#endif
20}
21
22
23static inline void arch_reset(char mode)
24{
25 if ( 1 && mode == 's') {
26 /* Jump into ROM at address 0 */
27 cpu_reset(0);
28 } else {
29 /* Use on-chip reset capability */
30
31 /* set the "key" register to enable access to
32 * "timer" and "enable" registers
33 */
34 *IXP4XX_OSWK = IXP4XX_WDT_KEY;
35
36 /* write 0 to the timer register for an immediate reset */
37 *IXP4XX_OSWT = 0;
38
39 *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
40 }
41}
42
diff --git a/include/asm-arm/arch-ixp4xx/timex.h b/include/asm-arm/arch-ixp4xx/timex.h
new file mode 100644
index 000000000000..38c9d77d3727
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/timex.h
@@ -0,0 +1,13 @@
1/*
2 * linux/include/asm-arm/arch-ixp4xx/timex.h
3 *
4 */
5
6#include <asm/hardware.h>
7
8/*
9 * We use IXP425 General purpose timer for our timer needs, it runs at
10 * 66.66... MHz
11 */
12#define CLOCK_TICK_RATE (66666666)
13
diff --git a/include/asm-arm/arch-ixp4xx/uncompress.h b/include/asm-arm/arch-ixp4xx/uncompress.h
new file mode 100644
index 000000000000..960c35810a22
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/uncompress.h
@@ -0,0 +1,64 @@
1/*
2 * include/asm-arm/arch-ixp4xx/uncompress.h
3 *
4 * Copyright (C) 2002 Intel Corporation.
5 * Copyright (C) 2003-2004 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 */
12
13#ifndef _ARCH_UNCOMPRESS_H_
14#define _ARCH_UNCOMPRESS_H_
15
16#include <asm/hardware.h>
17#include <asm/mach-types.h>
18#include <linux/serial_reg.h>
19
20#define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
21
22static volatile u32* uart_base;
23
24static __inline__ void putc(char c)
25{
26 /* Check THRE and TEMT bits before we transmit the character.
27 */
28 while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE);
29 *uart_base = c;
30}
31
32/*
33 * This does not append a newline
34 */
35static void putstr(const char *s)
36{
37 while (*s)
38 {
39 putc(*s);
40 if (*s == '\n')
41 putc('\r');
42 s++;
43 }
44}
45
46static __inline__ void __arch_decomp_setup(unsigned long arch_id)
47{
48 /*
49 * Coyote and gtwx5715 only have UART2 connected
50 */
51 if (machine_is_adi_coyote() || machine_is_gtwx5715())
52 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
53 else
54 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
55}
56
57/*
58 * arch_id is a variable in decompress_kernel()
59 */
60#define arch_decomp_setup() __arch_decomp_setup(arch_id)
61
62#define arch_decomp_wdog()
63
64#endif
diff --git a/include/asm-arm/arch-ixp4xx/vmalloc.h b/include/asm-arm/arch-ixp4xx/vmalloc.h
new file mode 100644
index 000000000000..da46e560ad6f
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/vmalloc.h
@@ -0,0 +1,17 @@
1/*
2 * linux/include/asm-arm/arch-ixp4xx/vmalloc.h
3 */
4
5/*
6 * Just any arbitrary offset to the start of the vmalloc VM area: the
7 * current 8MB value just means that there will be a 8MB "hole" after the
8 * physical memory until the kernel virtual memory starts. That means that
9 * any out-of-bounds memory accesses will hopefully be caught.
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;)
12 */
13#define VMALLOC_OFFSET (8*1024*1024)
14#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
15#define VMALLOC_VMADDR(x) ((unsigned long)(x))
16#define VMALLOC_END (0xFF000000)
17
diff --git a/include/asm-arm/arch-l7200/aux_reg.h b/include/asm-arm/arch-l7200/aux_reg.h
new file mode 100644
index 000000000000..762cbc76c501
--- /dev/null
+++ b/include/asm-arm/arch-l7200/aux_reg.h
@@ -0,0 +1,28 @@
1/*
2 * linux/include/asm-arm/arch-l7200/aux_reg.h
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Changelog:
7 * 08-02-2000 SJH Created file
8 */
9#ifndef _ASM_ARCH_AUXREG_H
10#define _ASM_ARCH_AUXREG_H
11
12#include <asm/arch/hardware.h>
13
14#define l7200aux_reg *((volatile unsigned int *) (AUX_BASE))
15
16/*
17 * Auxillary register values
18 */
19#define AUX_CLEAR 0x00000000
20#define AUX_DIAG_LED_ON 0x00000002
21#define AUX_RTS_UART1 0x00000004
22#define AUX_DTR_UART1 0x00000008
23#define AUX_KBD_COLUMN_12_HIGH 0x00000010
24#define AUX_KBD_COLUMN_12_OFF 0x00000020
25#define AUX_KBD_COLUMN_13_HIGH 0x00000040
26#define AUX_KBD_COLUMN_13_OFF 0x00000080
27
28#endif
diff --git a/include/asm-arm/arch-l7200/debug-macro.S b/include/asm-arm/arch-l7200/debug-macro.S
new file mode 100644
index 000000000000..846473318e8b
--- /dev/null
+++ b/include/asm-arm/arch-l7200/debug-macro.S
@@ -0,0 +1,40 @@
1/* linux/include/asm-arm/arch-l7200/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .equ io_virt, IO_BASE
15 .equ io_phys, IO_START
16
17 .macro addruart,rx
18 mrc p15, 0, \rx, c1, c0
19 tst \rx, #1 @ MMU enabled?
20 moveq \rx, #io_phys @ physical base address
21 movne \rx, #io_virt @ virtual address
22 add \rx, \rx, #0x00044000 @ UART1
23@ add \rx, \rx, #0x00045000 @ UART2
24 .endm
25
26 .macro senduart,rd,rx
27 str \rd, [\rx, #0x0] @ UARTDR
28 .endm
29
30 .macro waituart,rd,rx
311001: ldr \rd, [\rx, #0x18] @ UARTFLG
32 tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full
33 bne 1001b
34 .endm
35
36 .macro busyuart,rd,rx
371001: ldr \rd, [\rx, #0x18] @ UARTFLG
38 tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy
39 bne 1001b
40 .endm
diff --git a/include/asm-arm/arch-l7200/dma.h b/include/asm-arm/arch-l7200/dma.h
new file mode 100644
index 000000000000..6595b386cfc9
--- /dev/null
+++ b/include/asm-arm/arch-l7200/dma.h
@@ -0,0 +1,24 @@
1/*
2 * linux/include/asm-arm/arch-l7200/dma.h
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Changelog:
7 * 08-29-2000 SJH Created
8 */
9#ifndef __ASM_ARCH_DMA_H
10#define __ASM_ARCH_DMA_H
11
12/* DMA is not yet implemented! It should be the same as acorn, copy over.. */
13
14/*
15 * This is the maximum DMA address that can be DMAd to.
16 * There should not be more than (0xd0000000 - 0xc0000000)
17 * bytes of RAM.
18 */
19#define MAX_DMA_ADDRESS 0xd0000000
20#define MAX_DMA_CHANNELS 0
21
22#define DMA_S0 0
23
24#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-l7200/entry-macro.S b/include/asm-arm/arch-l7200/entry-macro.S
new file mode 100644
index 000000000000..8b6342dc4be2
--- /dev/null
+++ b/include/asm-arm/arch-l7200/entry-macro.S
@@ -0,0 +1,29 @@
1/*
2 * include/asm-arm/arch-l7200/entry-macro.S
3 *
4 * Low-level IRQ helper macros for L7200-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#include <asm/hardware.h>
11
12 .equ irq_base_addr, IO_BASE_2
13
14 .macro disable_fiq
15 .endm
16
17 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
18 mov \irqstat, #irq_base_addr @ Virt addr IRQ regs
19 add \irqstat, \irqstat, #0x00001000 @ Status reg
20 ldr \irqstat, [\irqstat, #0] @ get interrupts
21 mov \irqnr, #0
221001: tst \irqstat, #1
23 addeq \irqnr, \irqnr, #1
24 moveq \irqstat, \irqstat, lsr #1
25 tsteq \irqnr, #32
26 beq 1001b
27 teq \irqnr, #32
28 .endm
29
diff --git a/include/asm-arm/arch-l7200/gp_timers.h b/include/asm-arm/arch-l7200/gp_timers.h
new file mode 100644
index 000000000000..6f20962df248
--- /dev/null
+++ b/include/asm-arm/arch-l7200/gp_timers.h
@@ -0,0 +1,42 @@
1/*
2 * linux/include/asm-arm/arch-l7200/gp_timers.h
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Changelog:
7 * 07-28-2000 SJH Created file
8 * 08-02-2000 SJH Used structure for registers
9 */
10#ifndef _ASM_ARCH_GPTIMERS_H
11#define _ASM_ARCH_GPTIMERS_H
12
13#include <asm/arch/hardware.h>
14
15/*
16 * Layout of L7200 general purpose timer registers
17 */
18struct GPT_Regs {
19 unsigned int TIMERLOAD;
20 unsigned int TIMERVALUE;
21 unsigned int TIMERCONTROL;
22 unsigned int TIMERCLEAR;
23};
24
25#define GPT_BASE (IO_BASE_2 + 0x3000)
26#define l7200_timer1_regs ((volatile struct GPT_Regs *) (GPT_BASE))
27#define l7200_timer2_regs ((volatile struct GPT_Regs *) (GPT_BASE + 0x20))
28
29/*
30 * General register values
31 */
32#define GPT_PRESCALE_1 0x00000000
33#define GPT_PRESCALE_16 0x00000004
34#define GPT_PRESCALE_256 0x00000008
35#define GPT_MODE_FREERUN 0x00000000
36#define GPT_MODE_PERIODIC 0x00000040
37#define GPT_ENABLE 0x00000080
38#define GPT_BZTOG 0x00000100
39#define GPT_BZMOD 0x00000200
40#define GPT_LOAD_MASK 0x0000ffff
41
42#endif
diff --git a/include/asm-arm/arch-l7200/gpio.h b/include/asm-arm/arch-l7200/gpio.h
new file mode 100644
index 000000000000..0b63e4239bdd
--- /dev/null
+++ b/include/asm-arm/arch-l7200/gpio.h
@@ -0,0 +1,105 @@
1/****************************************************************************/
2/*
3 * linux/include/asm-arm/arch-l7200/gpio.h
4 *
5 * Registers and helper functions for the L7200 Link-Up Systems
6 * GPIO.
7 *
8 * (C) Copyright 2000, S A McConnell (samcconn@cotw.com)
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file COPYING in the main directory of this archive for
12 * more details.
13 */
14
15/****************************************************************************/
16
17#define GPIO_OFF 0x00005000 /* Offset from IO_START to the GPIO reg's. */
18
19/* IO_START and IO_BASE are defined in hardware.h */
20
21#define GPIO_START (IO_START_2 + GPIO_OFF) /* Physical addr of the GPIO reg. */
22#define GPIO_BASE (IO_BASE_2 + GPIO_OFF) /* Virtual addr of the GPIO reg. */
23
24/* Offsets from the start of the GPIO for all the registers. */
25#define PADR_OFF 0x000
26#define PADDR_OFF 0x004
27#define PASBSR_OFF 0x008
28#define PAEENR_OFF 0x00c
29#define PAESNR_OFF 0x010
30#define PAESTR_OFF 0x014
31#define PAIMR_OFF 0x018
32#define PAINT_OFF 0x01c
33
34#define PBDR_OFF 0x020
35#define PBDDR_OFF 0x024
36#define PBSBSR_OFF 0x028
37#define PBIMR_OFF 0x038
38#define PBINT_OFF 0x03c
39
40#define PCDR_OFF 0x040
41#define PCDDR_OFF 0x044
42#define PCSBSR_OFF 0x048
43#define PCIMR_OFF 0x058
44#define PCINT_OFF 0x05c
45
46#define PDDR_OFF 0x060
47#define PDDDR_OFF 0x064
48#define PDSBSR_OFF 0x068
49#define PDEENR_OFF 0x06c
50#define PDESNR_OFF 0x070
51#define PDESTR_OFF 0x074
52#define PDIMR_OFF 0x078
53#define PDINT_OFF 0x07c
54
55#define PEDR_OFF 0x080
56#define PEDDR_OFF 0x084
57#define PESBSR_OFF 0x088
58#define PEEENR_OFF 0x08c
59#define PEESNR_OFF 0x090
60#define PEESTR_OFF 0x094
61#define PEIMR_OFF 0x098
62#define PEINT_OFF 0x09c
63
64/* Define the GPIO registers for use by device drivers and the kernel. */
65#define PADR (*(volatile unsigned long *)(GPIO_BASE+PADR_OFF))
66#define PADDR (*(volatile unsigned long *)(GPIO_BASE+PADDR_OFF))
67#define PASBSR (*(volatile unsigned long *)(GPIO_BASE+PASBSR_OFF))
68#define PAEENR (*(volatile unsigned long *)(GPIO_BASE+PAEENR_OFF))
69#define PAESNR (*(volatile unsigned long *)(GPIO_BASE+PAESNR_OFF))
70#define PAESTR (*(volatile unsigned long *)(GPIO_BASE+PAESTR_OFF))
71#define PAIMR (*(volatile unsigned long *)(GPIO_BASE+PAIMR_OFF))
72#define PAINT (*(volatile unsigned long *)(GPIO_BASE+PAINT_OFF))
73
74#define PBDR (*(volatile unsigned long *)(GPIO_BASE+PBDR_OFF))
75#define PBDDR (*(volatile unsigned long *)(GPIO_BASE+PBDDR_OFF))
76#define PBSBSR (*(volatile unsigned long *)(GPIO_BASE+PBSBSR_OFF))
77#define PBIMR (*(volatile unsigned long *)(GPIO_BASE+PBIMR_OFF))
78#define PBINT (*(volatile unsigned long *)(GPIO_BASE+PBINT_OFF))
79
80#define PCDR (*(volatile unsigned long *)(GPIO_BASE+PCDR_OFF))
81#define PCDDR (*(volatile unsigned long *)(GPIO_BASE+PCDDR_OFF))
82#define PCSBSR (*(volatile unsigned long *)(GPIO_BASE+PCSBSR_OFF))
83#define PCIMR (*(volatile unsigned long *)(GPIO_BASE+PCIMR_OFF))
84#define PCINT (*(volatile unsigned long *)(GPIO_BASE+PCINT_OFF))
85
86#define PDDR (*(volatile unsigned long *)(GPIO_BASE+PDDR_OFF))
87#define PDDDR (*(volatile unsigned long *)(GPIO_BASE+PDDDR_OFF))
88#define PDSBSR (*(volatile unsigned long *)(GPIO_BASE+PDSBSR_OFF))
89#define PDEENR (*(volatile unsigned long *)(GPIO_BASE+PDEENR_OFF))
90#define PDESNR (*(volatile unsigned long *)(GPIO_BASE+PDESNR_OFF))
91#define PDESTR (*(volatile unsigned long *)(GPIO_BASE+PDESTR_OFF))
92#define PDIMR (*(volatile unsigned long *)(GPIO_BASE+PDIMR_OFF))
93#define PDINT (*(volatile unsigned long *)(GPIO_BASE+PDINT_OFF))
94
95#define PEDR (*(volatile unsigned long *)(GPIO_BASE+PEDR_OFF))
96#define PEDDR (*(volatile unsigned long *)(GPIO_BASE+PEDDR_OFF))
97#define PESBSR (*(volatile unsigned long *)(GPIO_BASE+PESBSR_OFF))
98#define PEEENR (*(volatile unsigned long *)(GPIO_BASE+PEEENR_OFF))
99#define PEESNR (*(volatile unsigned long *)(GPIO_BASE+PEESNR_OFF))
100#define PEESTR (*(volatile unsigned long *)(GPIO_BASE+PEESTR_OFF))
101#define PEIMR (*(volatile unsigned long *)(GPIO_BASE+PEIMR_OFF))
102#define PEINT (*(volatile unsigned long *)(GPIO_BASE+PEINT_OFF))
103
104#define VEE_EN 0x02
105#define BACKLIGHT_EN 0x04
diff --git a/include/asm-arm/arch-l7200/hardware.h b/include/asm-arm/arch-l7200/hardware.h
new file mode 100644
index 000000000000..b755079befab
--- /dev/null
+++ b/include/asm-arm/arch-l7200/hardware.h
@@ -0,0 +1,60 @@
1/*
2 * linux/include/asm-arm/arch-l7200/hardware.h
3 *
4 * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
5 * Steve Hill (sjhill@cotw.com)
6 *
7 * This file contains the hardware definitions for the
8 * LinkUp Systems L7200 SOC development board.
9 *
10 * Changelog:
11 * 02-01-2000 RS Created L7200 version, derived from rpc code
12 * 03-21-2000 SJH Cleaned up file
13 * 04-21-2000 RS Changed mapping of I/O in virtual space
14 * 04-25-2000 SJH Removed unused symbols and such
15 * 05-05-2000 SJH Complete rewrite
16 * 07-31-2000 SJH Added undocumented debug auxillary port to
17 * get at last two columns for keyboard driver
18 */
19#ifndef __ASM_ARCH_HARDWARE_H
20#define __ASM_ARCH_HARDWARE_H
21
22/* Hardware addresses of major areas.
23 * *_START is the physical address
24 * *_SIZE is the size of the region
25 * *_BASE is the virtual address
26 */
27#define RAM_START 0xf0000000
28#define RAM_SIZE 0x02000000
29#define RAM_BASE 0xc0000000
30
31#define IO_START 0x80000000 /* I/O */
32#define IO_SIZE 0x01000000
33#define IO_BASE 0xd0000000
34
35#define IO_START_2 0x90000000 /* I/O */
36#define IO_SIZE_2 0x01000000
37#define IO_BASE_2 0xd1000000
38
39#define AUX_START 0x1a000000 /* AUX PORT */
40#define AUX_SIZE 0x01000000
41#define AUX_BASE 0xd2000000
42
43#define FLASH1_START 0x00000000 /* FLASH BANK 1 */
44#define FLASH1_SIZE 0x01000000
45#define FLASH1_BASE 0xd3000000
46
47#define FLASH2_START 0x10000000 /* FLASH BANK 2 */
48#define FLASH2_SIZE 0x01000000
49#define FLASH2_BASE 0xd4000000
50
51#define ISA_START 0x20000000 /* ISA */
52#define ISA_SIZE 0x20000000
53#define ISA_BASE 0xe0000000
54
55#define FLUSH_BASE_PHYS 0x40000000 /* ROM */
56#define FLUSH_BASE 0xdf000000
57
58#define PCIO_BASE IO_BASE
59
60#endif
diff --git a/include/asm-arm/arch-l7200/io.h b/include/asm-arm/arch-l7200/io.h
new file mode 100644
index 000000000000..fc012a39e2cb
--- /dev/null
+++ b/include/asm-arm/arch-l7200/io.h
@@ -0,0 +1,76 @@
1/*
2 * linux/include/asm-arm/arch-l7200/io.h
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Changelog:
7 * 03-21-2000 SJH Created from linux/include/asm-arm/arch-nexuspci/io.h
8 * 08-31-2000 SJH Added in IO functions necessary for new drivers
9 */
10#ifndef __ASM_ARM_ARCH_IO_H
11#define __ASM_ARM_ARCH_IO_H
12
13#include <asm/arch/hardware.h>
14
15#define IO_SPACE_LIMIT 0xffffffff
16
17/*
18 * There are not real ISA nor PCI buses, so we fake it.
19 */
20#define __io_pci(a) ((void __iomem *)(PCIO_BASE + (a)))
21#define __mem_pci(a) (a)
22#define __mem_isa(a) (a)
23
24#define __ioaddr(p) __io_pci(p)
25
26/*
27 * Generic virtual read/write
28 */
29#define __arch_getb(a) (*(volatile unsigned char *)(a))
30#define __arch_getl(a) (*(volatile unsigned int *)(a))
31
32static inline unsigned int __arch_getw(unsigned long a)
33{
34 unsigned int value;
35 __asm__ __volatile__("ldr%?h %0, [%1, #0] @ getw"
36 : "=&r" (value)
37 : "r" (a));
38 return value;
39}
40
41#define __arch_putb(v,a) (*(volatile unsigned char *)(a) = (v))
42#define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v))
43
44static inline void __arch_putw(unsigned int value, unsigned long a)
45{
46 __asm__ __volatile__("str%?h %0, [%1, #0] @ putw"
47 : : "r" (value), "r" (a));
48}
49
50/*
51 * Translated address IO functions
52 *
53 * IO address has already been translated to a virtual address
54 */
55#define outb_t(v,p) (*(volatile unsigned char *)(p) = (v))
56#define inb_t(p) (*(volatile unsigned char *)(p))
57#define outw_t(v,p) (*(volatile unsigned int *)(p) = (v))
58#define inw_t(p) (*(volatile unsigned int *)(p))
59#define outl_t(v,p) (*(volatile unsigned long *)(p) = (v))
60#define inl_t(p) (*(volatile unsigned long *)(p))
61
62/*
63 * FIXME - These are to allow for linking. On all the other
64 * ARM platforms, the entire IO space is contiguous.
65 * The 7200 has three separate IO spaces. The below
66 * macros will eventually become more involved. Use
67 * with caution and don't be surprised by kernel oopses!!!
68 */
69#define inb(p) inb_t(p)
70#define inw(p) inw_t(p)
71#define inl(p) inl_t(p)
72#define outb(v,p) outb_t(v,p)
73#define outw(v,p) outw_t(v,p)
74#define outl(v,p) outl_t(v,p)
75
76#endif
diff --git a/include/asm-arm/arch-l7200/irqs.h b/include/asm-arm/arch-l7200/irqs.h
new file mode 100644
index 000000000000..7120c016e29e
--- /dev/null
+++ b/include/asm-arm/arch-l7200/irqs.h
@@ -0,0 +1,56 @@
1/*
2 * include/asm-arm/arch-l7200/irqs.h
3 *
4 * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
5 * Steve Hill (sjhill@cotw.com)
6 *
7 * Changelog:
8 * 01-02-2000 RS Create l7200 version
9 * 03-28-2000 SJH Removed unused interrupt
10 * 07-28-2000 SJH Added pseudo-keyboard interrupt
11 */
12
13/*
14 * NOTE: The second timer (Timer 2) is used as the keyboard
15 * interrupt when the keyboard driver is enabled.
16 */
17
18#define NR_IRQS 32
19
20#define IRQ_STWDOG 0 /* Watchdog timer */
21#define IRQ_PROG 1 /* Programmable interrupt */
22#define IRQ_DEBUG_RX 2 /* Comm Rx debug */
23#define IRQ_DEBUG_TX 3 /* Comm Tx debug */
24#define IRQ_GCTC1 4 /* Timer 1 */
25#define IRQ_GCTC2 5 /* Timer 2 / Keyboard */
26#define IRQ_DMA 6 /* DMA controller */
27#define IRQ_CLCD 7 /* Color LCD controller */
28#define IRQ_SM_RX 8 /* Smart card */
29#define IRQ_SM_TX 9 /* Smart cart */
30#define IRQ_SM_RST 10 /* Smart card */
31#define IRQ_SIB 11 /* Serial Interface Bus */
32#define IRQ_MMC 12 /* MultiMediaCard */
33#define IRQ_SSP1 13 /* Synchronous Serial Port 1 */
34#define IRQ_SSP2 14 /* Synchronous Serial Port 1 */
35#define IRQ_SPI 15 /* SPI slave */
36#define IRQ_UART_1 16 /* UART 1 */
37#define IRQ_UART_2 17 /* UART 2 */
38#define IRQ_IRDA 18 /* IRDA */
39#define IRQ_RTC_TICK 19 /* Real Time Clock tick */
40#define IRQ_RTC_ALARM 20 /* Real Time Clock alarm */
41#define IRQ_GPIO 21 /* General Purpose IO */
42#define IRQ_GPIO_DMA 22 /* General Purpose IO, DMA */
43#define IRQ_M2M 23 /* Memory to memory DMA */
44#define IRQ_RESERVED 24 /* RESERVED, don't use */
45#define IRQ_INTF 25 /* External active low interrupt */
46#define IRQ_INT0 26 /* External active low interrupt */
47#define IRQ_INT1 27 /* External active low interrupt */
48#define IRQ_INT2 28 /* External active low interrupt */
49#define IRQ_UCB1200 29 /* Interrupt generated by UCB1200*/
50#define IRQ_BAT_LO 30 /* Low batery or external power */
51#define IRQ_MEDIA_CHG 31 /* Media change interrupt */
52
53/*
54 * This is the offset of the FIQ "IRQ" numbers
55 */
56#define FIQ_START 64
diff --git a/include/asm-arm/arch-l7200/memory.h b/include/asm-arm/arch-l7200/memory.h
new file mode 100644
index 000000000000..c5b9608cb137
--- /dev/null
+++ b/include/asm-arm/arch-l7200/memory.h
@@ -0,0 +1,23 @@
1/*
2 * linux/include/asm-arm/arch-l7200/memory.h
3 *
4 * Copyright (c) 2000 Steve Hill (sjhill@cotw.com)
5 * Copyright (c) 2000 Rob Scott (rscott@mtrob.fdns.net)
6 *
7 * Changelog:
8 * 03-13-2000 SJH Created
9 * 04-13-2000 RS Changed bus macros for new addr
10 * 05-03-2000 SJH Removed bus macros and fixed virt_to_phys macro
11 */
12#ifndef __ASM_ARCH_MEMORY_H
13#define __ASM_ARCH_MEMORY_H
14
15/*
16 * Physical DRAM offset on the L7200 SDB.
17 */
18#define PHYS_OFFSET (0xf0000000UL)
19
20#define __virt_to_bus(x) __virt_to_phys(x)
21#define __bus_to_virt(x) __phys_to_virt(x)
22
23#endif
diff --git a/include/asm-arm/arch-l7200/param.h b/include/asm-arm/arch-l7200/param.h
new file mode 100644
index 000000000000..9962a12ab158
--- /dev/null
+++ b/include/asm-arm/arch-l7200/param.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-l7200/param.h
3 *
4 * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
5 * Steve Hill (sjhill@cotw.com)
6 *
7 * This file contains the hardware definitions for the
8 * LinkUp Systems L7200 SOC development board.
9 *
10 * Changelog:
11 * 04-21-2000 RS Created L7200 version
12 * 04-25-2000 SJH Cleaned up file
13 * 05-03-2000 SJH Change comments and rate
14 */
15
16/*
17 * See 'time.h' for how the RTC HZ rate is set
18 */
19#define HZ 128
diff --git a/include/asm-arm/arch-l7200/pmpcon.h b/include/asm-arm/arch-l7200/pmpcon.h
new file mode 100644
index 000000000000..730056c194be
--- /dev/null
+++ b/include/asm-arm/arch-l7200/pmpcon.h
@@ -0,0 +1,46 @@
1/****************************************************************************/
2/*
3 * linux/include/asm-arm/arch-l7200/pmpcon.h
4 *
5 * Registers and helper functions for the L7200 Link-Up Systems
6 * DC/DC converter register.
7 *
8 * (C) Copyright 2000, S A McConnell (samcconn@cotw.com)
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file COPYING in the main directory of this archive for
12 * more details.
13 */
14
15/****************************************************************************/
16
17#define PMPCON_OFF 0x00006000 /* Offset from IO_START_2. */
18
19/* IO_START_2 and IO_BASE_2 are defined in hardware.h */
20
21#define PMPCON_START (IO_START_2 + PMPCON_OFF) /* Physical address of reg. */
22#define PMPCON_BASE (IO_BASE_2 + PMPCON_OFF) /* Virtual address of reg. */
23
24
25#define PMPCON (*(volatile unsigned int *)(PMPCON_BASE))
26
27#define PWM2_50CYCLE 0x800
28#define CONTRAST 0x9
29
30#define PWM1H (CONTRAST)
31#define PWM1L (CONTRAST << 4)
32
33#define PMPCON_VALUE (PWM2_50CYCLE | PWM1L | PWM1H)
34
35/* PMPCON = 0x811; // too light and fuzzy
36 * PMPCON = 0x844;
37 * PMPCON = 0x866; // better color poor depth
38 * PMPCON = 0x888; // Darker but better depth
39 * PMPCON = 0x899; // Darker even better depth
40 * PMPCON = 0x8aa; // too dark even better depth
41 * PMPCON = 0X8cc; // Way too dark
42 */
43
44/* As CONTRAST value increases the greater the depth perception and
45 * the darker the colors.
46 */
diff --git a/include/asm-arm/arch-l7200/pmu.h b/include/asm-arm/arch-l7200/pmu.h
new file mode 100644
index 000000000000..57faea76d1b3
--- /dev/null
+++ b/include/asm-arm/arch-l7200/pmu.h
@@ -0,0 +1,125 @@
1/****************************************************************************/
2/*
3 * linux/include/asm-arm/arch-l7200/pmu.h
4 *
5 * Registers and helper functions for the L7200 Link-Up Systems
6 * Power Management Unit (PMU).
7 *
8 * (C) Copyright 2000, S A McConnell (samcconn@cotw.com)
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file COPYING in the main directory of this archive for
12 * more details.
13 */
14
15/****************************************************************************/
16
17#define PMU_OFF 0x00050000 /* Offset from IO_START to the PMU registers. */
18
19/* IO_START and IO_BASE are defined in hardware.h */
20
21#define PMU_START (IO_START + PMU_OFF) /* Physical addr. of the PMU reg. */
22#define PMU_BASE (IO_BASE + PMU_OFF) /* Virtual addr. of the PMU reg. */
23
24
25/* Define the PMU registers for use by device drivers and the kernel. */
26
27typedef struct {
28 unsigned int CURRENT; /* Current configuration register */
29 unsigned int NEXT; /* Next configuration register */
30 unsigned int reserved;
31 unsigned int RUN; /* Run configuration register */
32 unsigned int COMM; /* Configuration command register */
33 unsigned int SDRAM; /* SDRAM configuration bypass register */
34} pmu_interface;
35
36#define PMU ((volatile pmu_interface *)(PMU_BASE))
37
38
39/* Macro's for reading the common register fields. */
40
41#define GET_TRANSOP(reg) ((reg >> 25) & 0x03) /* Bits 26-25 */
42#define GET_OSCEN(reg) ((reg >> 16) & 0x01)
43#define GET_OSCMUX(reg) ((reg >> 15) & 0x01)
44#define GET_PLLMUL(reg) ((reg >> 9) & 0x3f) /* Bits 14-9 */
45#define GET_PLLEN(reg) ((reg >> 8) & 0x01)
46#define GET_PLLMUX(reg) ((reg >> 7) & 0x01)
47#define GET_BCLK_DIV(reg) ((reg >> 3) & 0x03) /* Bits 4-3 */
48#define GET_SDRB_SEL(reg) ((reg >> 2) & 0x01)
49#define GET_SDRF_SEL(reg) ((reg >> 1) & 0x01)
50#define GET_FASTBUS(reg) (reg & 0x1)
51
52/* CFG_NEXT register */
53
54#define CFG_NEXT_CLOCKRECOVERY ((PMU->NEXT >> 18) & 0x7f) /* Bits 24-18 */
55#define CFG_NEXT_INTRET ((PMU->NEXT >> 17) & 0x01)
56#define CFG_NEXT_SDR_STOP ((PMU->NEXT >> 6) & 0x01)
57#define CFG_NEXT_SYSCLKEN ((PMU->NEXT >> 5) & 0x01)
58
59/* Useful field values that can be used to construct the
60 * CFG_NEXT and CFG_RUN registers.
61 */
62
63#define TRANSOP_NOP 0<<25 /* NOCHANGE_NOSTALL */
64#define NOCHANGE_STALL 1<<25
65#define CHANGE_NOSTALL 2<<25
66#define CHANGE_STALL 3<<25
67
68#define INTRET 1<<17
69#define OSCEN 1<<16
70#define OSCMUX 1<<15
71
72/* PLL frequencies */
73
74#define PLLMUL_0 0<<9 /* 3.6864 MHz */
75#define PLLMUL_1 1<<9 /* ?????? MHz */
76#define PLLMUL_5 5<<9 /* 18.432 MHz */
77#define PLLMUL_10 10<<9 /* 36.864 MHz */
78#define PLLMUL_18 18<<9 /* ?????? MHz */
79#define PLLMUL_20 20<<9 /* 73.728 MHz */
80#define PLLMUL_32 32<<9 /* ?????? MHz */
81#define PLLMUL_35 35<<9 /* 129.024 MHz */
82#define PLLMUL_36 36<<9 /* ?????? MHz */
83#define PLLMUL_39 39<<9 /* ?????? MHz */
84#define PLLMUL_40 40<<9 /* 147.456 MHz */
85
86/* Clock recovery times */
87
88#define CRCLOCK_1 1<<18
89#define CRCLOCK_2 2<<18
90#define CRCLOCK_4 4<<18
91#define CRCLOCK_8 8<<18
92#define CRCLOCK_16 16<<18
93#define CRCLOCK_32 32<<18
94#define CRCLOCK_63 63<<18
95#define CRCLOCK_127 127<<18
96
97#define PLLEN 1<<8
98#define PLLMUX 1<<7
99#define SDR_STOP 1<<6
100#define SYSCLKEN 1<<5
101
102#define BCLK_DIV_4 2<<3
103#define BCLK_DIV_2 1<<3
104#define BCLK_DIV_1 0<<3
105
106#define SDRB_SEL 1<<2
107#define SDRF_SEL 1<<1
108#define FASTBUS 1<<0
109
110
111/* CFG_SDRAM */
112
113#define SDRREFFQ 1<<0 /* Only if SDRSTOPRQ is not set. */
114#define SDRREFACK 1<<1 /* Read-only */
115#define SDRSTOPRQ 1<<2 /* Only if SDRREFFQ is not set. */
116#define SDRSTOPACK 1<<3 /* Read-only */
117#define PICEN 1<<4 /* Enable Co-procesor */
118#define PICTEST 1<<5
119
120#define GET_SDRREFFQ ((PMU->SDRAM >> 0) & 0x01)
121#define GET_SDRREFACK ((PMU->SDRAM >> 1) & 0x01) /* Read-only */
122#define GET_SDRSTOPRQ ((PMU->SDRAM >> 2) & 0x01)
123#define GET_SDRSTOPACK ((PMU->SDRAM >> 3) & 0x01) /* Read-only */
124#define GET_PICEN ((PMU->SDRAM >> 4) & 0x01)
125#define GET_PICTEST ((PMU->SDRAM >> 5) & 0x01)
diff --git a/include/asm-arm/arch-l7200/serial.h b/include/asm-arm/arch-l7200/serial.h
new file mode 100644
index 000000000000..defb8b7fca73
--- /dev/null
+++ b/include/asm-arm/arch-l7200/serial.h
@@ -0,0 +1,37 @@
1/*
2 * linux/include/asm-arm/arch-l7200/serial.h
3 *
4 * Copyright (c) 2000 Rob Scott (rscott@mtrob.fdns.net)
5 * Steve Hill (sjhill@cotw.com)
6 *
7 * Changelog:
8 * 03-20-2000 SJH Created
9 * 03-26-2000 SJH Added flags for serial ports
10 * 03-27-2000 SJH Corrected BASE_BAUD value
11 * 04-14-2000 RS Made register addr dependent on IO_BASE
12 * 05-03-2000 SJH Complete rewrite
13 * 05-09-2000 SJH Stripped out architecture specific serial stuff
14 * and placed it in a separate file
15 * 07-28-2000 SJH Moved base baud rate variable
16 */
17#ifndef __ASM_ARCH_SERIAL_H
18#define __ASM_ARCH_SERIAL_H
19
20/*
21 * This assumes you have a 3.6864 MHz clock for your UART.
22 */
23#define BASE_BAUD 3686400
24
25/*
26 * Standard COM flags
27 */
28#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
29
30#define STD_SERIAL_PORT_DEFNS \
31 /* MAGIC UART CLK PORT IRQ FLAGS */ \
32 { 0, BASE_BAUD, UART1_BASE, IRQ_UART_1, STD_COM_FLAGS }, /* ttyLU0 */ \
33 { 0, BASE_BAUD, UART2_BASE, IRQ_UART_2, STD_COM_FLAGS }, /* ttyLU1 */ \
34
35#define EXTRA_SERIAL_PORT_DEFNS
36
37#endif
diff --git a/include/asm-arm/arch-l7200/serial_l7200.h b/include/asm-arm/arch-l7200/serial_l7200.h
new file mode 100644
index 000000000000..238c595d97ea
--- /dev/null
+++ b/include/asm-arm/arch-l7200/serial_l7200.h
@@ -0,0 +1,101 @@
1/*
2 * linux/include/asm-arm/arch-l7200/serial_l7200.h
3 *
4 * Copyright (c) 2000 Steven Hill (sjhill@cotw.com)
5 *
6 * Changelog:
7 * 05-09-2000 SJH Created
8 */
9#ifndef __ASM_ARCH_SERIAL_L7200_H
10#define __ASM_ARCH_SERIAL_L7200_H
11
12#include <asm/arch/memory.h>
13
14/*
15 * This assumes you have a 3.6864 MHz clock for your UART.
16 */
17#define BASE_BAUD 3686400
18
19/*
20 * UART base register addresses
21 */
22#define UART1_BASE (IO_BASE + 0x00044000)
23#define UART2_BASE (IO_BASE + 0x00045000)
24
25/*
26 * UART register offsets
27 */
28#define UARTDR 0x00 /* Tx/Rx data */
29#define RXSTAT 0x04 /* Rx status */
30#define H_UBRLCR 0x08 /* mode register high */
31#define M_UBRLCR 0x0C /* mode reg mid (MSB of buad)*/
32#define L_UBRLCR 0x10 /* mode reg low (LSB of baud)*/
33#define UARTCON 0x14 /* control register */
34#define UARTFLG 0x18 /* flag register */
35#define UARTINTSTAT 0x1C /* FIFO IRQ status register */
36#define UARTINTMASK 0x20 /* FIFO IRQ mask register */
37
38/*
39 * UART baud rate register values
40 */
41#define BR_110 0x827
42#define BR_1200 0x06e
43#define BR_2400 0x05f
44#define BR_4800 0x02f
45#define BR_9600 0x017
46#define BR_14400 0x00f
47#define BR_19200 0x00b
48#define BR_38400 0x005
49#define BR_57600 0x003
50#define BR_76800 0x002
51#define BR_115200 0x001
52
53/*
54 * Receiver status register (RXSTAT) mask values
55 */
56#define RXSTAT_NO_ERR 0x00 /* No error */
57#define RXSTAT_FRM_ERR 0x01 /* Framing error */
58#define RXSTAT_PAR_ERR 0x02 /* Parity error */
59#define RXSTAT_OVR_ERR 0x04 /* Overrun error */
60
61/*
62 * High byte of UART bit rate and line control register (H_UBRLCR) values
63 */
64#define UBRLCR_BRK 0x01 /* generate break on tx */
65#define UBRLCR_PEN 0x02 /* enable parity */
66#define UBRLCR_PDIS 0x00 /* disable parity */
67#define UBRLCR_EVEN 0x04 /* 1= even parity,0 = odd parity */
68#define UBRLCR_STP2 0x08 /* transmit 2 stop bits */
69#define UBRLCR_FIFO 0x10 /* enable FIFO */
70#define UBRLCR_LEN5 0x60 /* word length5 */
71#define UBRLCR_LEN6 0x40 /* word length6 */
72#define UBRLCR_LEN7 0x20 /* word length7 */
73#define UBRLCR_LEN8 0x00 /* word length8 */
74
75/*
76 * UART control register (UARTCON) values
77 */
78#define UARTCON_UARTEN 0x01 /* Enable UART */
79#define UARTCON_DMAONERR 0x08 /* Mask RxDmaRq when errors occur */
80
81/*
82 * UART flag register (UARTFLG) mask values
83 */
84#define UARTFLG_UTXFF 0x20 /* Transmit FIFO full */
85#define UARTFLG_URXFE 0x10 /* Receiver FIFO empty */
86#define UARTFLG_UBUSY 0x08 /* Transmitter busy */
87#define UARTFLG_DCD 0x04 /* Data carrier detect */
88#define UARTFLG_DSR 0x02 /* Data set ready */
89#define UARTFLG_CTS 0x01 /* Clear to send */
90
91/*
92 * UART interrupt status/clear registers (UARTINTSTAT/CLR) values
93 */
94#define UART_TXINT 0x01 /* TX interrupt */
95#define UART_RXINT 0x02 /* RX interrupt */
96#define UART_RXERRINT 0x04 /* RX error interrupt */
97#define UART_MSINT 0x08 /* Modem Status interrupt */
98#define UART_UDINT 0x10 /* UART Disabled interrupt */
99#define UART_ALLIRQS 0x1f /* All interrupts */
100
101#endif
diff --git a/include/asm-arm/arch-l7200/sib.h b/include/asm-arm/arch-l7200/sib.h
new file mode 100644
index 000000000000..bf4364ee2535
--- /dev/null
+++ b/include/asm-arm/arch-l7200/sib.h
@@ -0,0 +1,119 @@
1/****************************************************************************/
2/*
3 * linux/include/asm-arm/arch-l7200/sib.h
4 *
5 * Registers and helper functions for the Serial Interface Bus.
6 *
7 * (C) Copyright 2000, S A McConnell (samcconn@cotw.com)
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file COPYING in the main directory of this archive for
11 * more details.
12 */
13
14/****************************************************************************/
15
16#define SIB_OFF 0x00040000 /* Offset from IO_START to the SIB reg's. */
17
18/* IO_START and IO_BASE are defined in hardware.h */
19
20#define SIB_START (IO_START + SIB_OFF) /* Physical addr of the SIB reg. */
21#define SIB_BASE (IO_BASE + SIB_OFF) /* Virtual addr of the SIB reg. */
22
23/* Offsets from the start of the SIB for all the registers. */
24
25/* Define the SIB registers for use by device drivers and the kernel. */
26
27typedef struct
28{
29 unsigned int MCCR; /* SIB Control Register Offset: 0x00 */
30 unsigned int RES1; /* Reserved Offset: 0x04 */
31 unsigned int MCDR0; /* SIB Data Register 0 Offset: 0x08 */
32 unsigned int MCDR1; /* SIB Data Register 1 Offset: 0x0c */
33 unsigned int MCDR2; /* SIB Data Register 2 (UCB1x00) Offset: 0x10 */
34 unsigned int RES2; /* Reserved Offset: 0x14 */
35 unsigned int MCSR; /* SIB Status Register Offset: 0x18 */
36} SIB_Interface;
37
38#define SIB ((volatile SIB_Interface *) (SIB_BASE))
39
40/* MCCR */
41
42#define INTERNAL_FREQ 9216000 /* Hertz */
43#define AUDIO_FREQ 5000 /* Hertz */
44#define TELECOM_FREQ 5000 /* Hertz */
45
46#define AUDIO_DIVIDE (INTERNAL_FREQ / (32 * AUDIO_FREQ))
47#define TELECOM_DIVIDE (INTERNAL_FREQ / (32 * TELECOM_FREQ))
48
49#define MCCR_ASD57 AUDIO_DIVIDE
50#define MCCR_TSD57 (TELECOM_DIVIDE << 8)
51#define MCCR_MCE (1 << 16) /* SIB enable */
52#define MCCR_ECS (1 << 17) /* External Clock Select */
53#define MCCR_ADM (1 << 18) /* A/D Data Sampling */
54#define MCCR_PMC (1 << 26) /* PIN Multiplexer Control */
55
56
57#define GET_ASD ((SIB->MCCR >> 0) & 0x3f) /* Audio Sample Rate Div. */
58#define GET_TSD ((SIB->MCCR >> 8) & 0x3f) /* Telcom Sample Rate Div. */
59#define GET_MCE ((SIB->MCCR >> 16) & 0x01) /* SIB Enable */
60#define GET_ECS ((SIB->MCCR >> 17) & 0x01) /* External Clock Select */
61#define GET_ADM ((SIB->MCCR >> 18) & 0x01) /* A/D Data Sampling Mode */
62#define GET_TTM ((SIB->MCCR >> 19) & 0x01) /* Telco Trans. FIFO I mask */
63#define GET_TRM ((SIB->MCCR >> 20) & 0x01) /* Telco Recv. FIFO I mask */
64#define GET_ATM ((SIB->MCCR >> 21) & 0x01) /* Audio Trans. FIFO I mask */
65#define GET_ARM ((SIB->MCCR >> 22) & 0x01) /* Audio Recv. FIFO I mask */
66#define GET_LBM ((SIB->MCCR >> 23) & 0x01) /* Loop Back Mode */
67#define GET_ECP ((SIB->MCCR >> 24) & 0x03) /* Extern. Clck Prescale sel */
68#define GET_PMC ((SIB->MCCR >> 26) & 0x01) /* PIN Multiplexer Control */
69#define GET_ERI ((SIB->MCCR >> 27) & 0x01) /* External Read Interrupt */
70#define GET_EWI ((SIB->MCCR >> 28) & 0x01) /* External Write Interrupt */
71
72/* MCDR0 */
73
74#define AUDIO_RECV ((SIB->MCDR0 >> 4) & 0xfff)
75#define AUDIO_WRITE(v) ((SIB->MCDR0 = (v & 0xfff) << 4))
76
77/* MCDR1 */
78
79#define TELECOM_RECV ((SIB->MCDR1 >> 2) & 032fff)
80#define TELECOM_WRITE(v) ((SIB->MCDR1 = (v & 0x3fff) << 2))
81
82
83/* MCSR */
84
85#define MCSR_ATU (1 << 4) /* Audio Transmit FIFO Underrun */
86#define MCSR_ARO (1 << 5) /* Audio Receive FIFO Underrun */
87#define MCSR_TTU (1 << 6) /* TELECOM Transmit FIFO Underrun */
88#define MCSR_TRO (1 << 7) /* TELECOM Receive FIFO Underrun */
89
90#define MCSR_CLEAR_UNDERUN_BITS (MCSR_ATU | MCSR_ARO | MCSR_TTU | MCSR_TRO)
91
92
93#define GET_ATS ((SIB->MCSR >> 0) & 0x01) /* Audio Transmit FIFO Service Req*/
94#define GET_ARS ((SIB->MCSR >> 1) & 0x01) /* Audio Recv FIFO Service Request*/
95#define GET_TTS ((SIB->MCSR >> 2) & 0x01) /* TELECOM Transmit FIFO Flag */
96#define GET_TRS ((SIB->MCSR >> 3) & 0x01) /* TELECOM Recv FIFO Service Req. */
97#define GET_ATU ((SIB->MCSR >> 4) & 0x01) /* Audio Transmit FIFO Underrun */
98#define GET_ARO ((SIB->MCSR >> 5) & 0x01) /* Audio Receive FIFO Underrun */
99#define GET_TTU ((SIB->MCSR >> 6) & 0x01) /* TELECOM Transmit FIFO Underrun */
100#define GET_TRO ((SIB->MCSR >> 7) & 0x01) /* TELECOM Receive FIFO Underrun */
101#define GET_ANF ((SIB->MCSR >> 8) & 0x01) /* Audio Transmit FIFO not full */
102#define GET_ANE ((SIB->MCSR >> 9) & 0x01) /* Audio Receive FIFO not empty */
103#define GET_TNF ((SIB->MCSR >> 10) & 0x01) /* Telecom Transmit FIFO not full */
104#define GET_TNE ((SIB->MCSR >> 11) & 0x01) /* Telecom Receive FIFO not empty */
105#define GET_CWC ((SIB->MCSR >> 12) & 0x01) /* Codec Write Complete */
106#define GET_CRC ((SIB->MCSR >> 13) & 0x01) /* Codec Read Complete */
107#define GET_ACE ((SIB->MCSR >> 14) & 0x01) /* Audio Codec Enabled */
108#define GET_TCE ((SIB->MCSR >> 15) & 0x01) /* Telecom Codec Enabled */
109
110/* MCDR2 */
111
112#define MCDR2_rW (1 << 16)
113
114#define WRITE_MCDR2(reg, data) (SIB->MCDR2 =((reg<<17)|MCDR2_rW|(data&0xffff)))
115#define MCDR2_WRITE_COMPLETE GET_CWC
116
117#define INITIATE_MCDR2_READ(reg) (SIB->MCDR2 = (reg << 17))
118#define MCDR2_READ_COMPLETE GET_CRC
119#define MCDR2_READ (SIB->MCDR2 & 0xffff)
diff --git a/include/asm-arm/arch-l7200/sys-clock.h b/include/asm-arm/arch-l7200/sys-clock.h
new file mode 100644
index 000000000000..771c774f4815
--- /dev/null
+++ b/include/asm-arm/arch-l7200/sys-clock.h
@@ -0,0 +1,67 @@
1/****************************************************************************/
2/*
3 * linux/include/asm-arm/arch-l7200/sys-clock.h
4 *
5 * Registers and helper functions for the L7200 Link-Up Systems
6 * System clocks.
7 *
8 * (C) Copyright 2000, S A McConnell (samcconn@cotw.com)
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file COPYING in the main directory of this archive for
12 * more details.
13 */
14
15/****************************************************************************/
16
17#define SYS_CLOCK_OFF 0x00050030 /* Offset from IO_START. */
18
19/* IO_START and IO_BASE are defined in hardware.h */
20
21#define SYS_CLOCK_START (IO_START + SYS_CLCOK_OFF) /* Physical address */
22#define SYS_CLOCK_BASE (IO_BASE + SYS_CLOCK_OFF) /* Virtual address */
23
24/* Define the interface to the SYS_CLOCK */
25
26typedef struct
27{
28 unsigned int ENABLE;
29 unsigned int ESYNC;
30 unsigned int SELECT;
31} sys_clock_interface;
32
33#define SYS_CLOCK ((volatile sys_clock_interface *)(SYS_CLOCK_BASE))
34
35//#define CLOCK_EN (*(volatile unsigned long *)(PMU_BASE+CLOCK_EN_OFF))
36//#define CLOCK_ESYNC (*(volatile unsigned long *)(PMU_BASE+CLOCK_ESYNC_OFF))
37//#define CLOCK_SEL (*(volatile unsigned long *)(PMU_BASE+CLOCK_SEL_OFF))
38
39/* SYS_CLOCK -> ENABLE */
40
41#define SYN_EN 1<<0
42#define B18M_EN 1<<1
43#define CLK3M6_EN 1<<2
44#define BUART_EN 1<<3
45#define CLK18MU_EN 1<<4
46#define FIR_EN 1<<5
47#define MIRN_EN 1<<6
48#define UARTM_EN 1<<7
49#define SIBADC_EN 1<<8
50#define ALTD_EN 1<<9
51#define CLCLK_EN 1<<10
52
53/* SYS_CLOCK -> SELECT */
54
55#define CLK18M_DIV 1<<0
56#define MIR_SEL 1<<1
57#define SSP_SEL 1<<4
58#define MM_DIV 1<<5
59#define MM_SEL 1<<6
60#define ADC_SEL_2 0<<7
61#define ADC_SEL_4 1<<7
62#define ADC_SEL_8 3<<7
63#define ADC_SEL_16 7<<7
64#define ADC_SEL_32 0x0f<<7
65#define ADC_SEL_64 0x1f<<7
66#define ADC_SEL_128 0x3f<<7
67#define ALTD_SEL 1<<13
diff --git a/include/asm-arm/arch-l7200/system.h b/include/asm-arm/arch-l7200/system.h
new file mode 100644
index 000000000000..cb4ff29059b8
--- /dev/null
+++ b/include/asm-arm/arch-l7200/system.h
@@ -0,0 +1,27 @@
1/*
2 * linux/include/asm-arm/arch-l7200/system.h
3 *
4 * Copyright (c) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Changelog
7 * 03-21-2000 SJH Created
8 * 04-26-2000 SJH Fixed functions
9 * 05-03-2000 SJH Removed usage of obsolete 'iomd.h'
10 * 05-31-2000 SJH Properly implemented 'arch_idle'
11 */
12#ifndef __ASM_ARCH_SYSTEM_H
13#define __ASM_ARCH_SYSTEM_H
14
15static inline void arch_idle(void)
16{
17 *(unsigned long *)(IO_BASE + 0x50004) = 1; /* idle mode */
18}
19
20static inline void arch_reset(char mode)
21{
22 if (mode == 's') {
23 cpu_reset(0);
24 }
25}
26
27#endif
diff --git a/include/asm-arm/arch-l7200/time.h b/include/asm-arm/arch-l7200/time.h
new file mode 100644
index 000000000000..7b98b533e63a
--- /dev/null
+++ b/include/asm-arm/arch-l7200/time.h
@@ -0,0 +1,72 @@
1/*
2 * linux/include/asm-arm/arch-l7200/time.h
3 *
4 * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
5 * Steve Hill (sjhill@cotw.com)
6 *
7 * Changelog:
8 * 01-02-2000 RS Created l7200 version, derived from rpc code
9 * 05-03-2000 SJH Complete rewrite
10 */
11#ifndef _ASM_ARCH_TIME_H
12#define _ASM_ARCH_TIME_H
13
14#include <asm/arch/irqs.h>
15
16/*
17 * RTC base register address
18 */
19#define RTC_BASE (IO_BASE_2 + 0x2000)
20
21/*
22 * RTC registers
23 */
24#define RTC_RTCDR (*(volatile unsigned char *) (RTC_BASE + 0x000))
25#define RTC_RTCMR (*(volatile unsigned char *) (RTC_BASE + 0x004))
26#define RTC_RTCS (*(volatile unsigned char *) (RTC_BASE + 0x008))
27#define RTC_RTCC (*(volatile unsigned char *) (RTC_BASE + 0x008))
28#define RTC_RTCDV (*(volatile unsigned char *) (RTC_BASE + 0x00c))
29#define RTC_RTCCR (*(volatile unsigned char *) (RTC_BASE + 0x010))
30
31/*
32 * RTCCR register values
33 */
34#define RTC_RATE_32 0x00 /* 32 Hz tick */
35#define RTC_RATE_64 0x10 /* 64 Hz tick */
36#define RTC_RATE_128 0x20 /* 128 Hz tick */
37#define RTC_RATE_256 0x30 /* 256 Hz tick */
38#define RTC_EN_ALARM 0x01 /* Enable alarm */
39#define RTC_EN_TIC 0x04 /* Enable counter */
40#define RTC_EN_STWDOG 0x08 /* Enable watchdog */
41
42/*
43 * Handler for RTC timer interrupt
44 */
45static irqreturn_t
46timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
47{
48 do_timer(regs);
49#ifndef CONFIG_SMP
50 update_process_times(user_mode(regs));
51#endif
52 do_profile(regs);
53 RTC_RTCC = 0; /* Clear interrupt */
54
55 return IRQ_HANDLED;
56}
57
58/*
59 * Set up RTC timer interrupt, and return the current time in seconds.
60 */
61void __init time_init(void)
62{
63 RTC_RTCC = 0; /* Clear interrupt */
64
65 timer_irq.handler = timer_interrupt;
66
67 setup_irq(IRQ_RTC_TICK, &timer_irq);
68
69 RTC_RTCCR = RTC_RATE_128 | RTC_EN_TIC; /* Set rate and enable timer */
70}
71
72#endif
diff --git a/include/asm-arm/arch-l7200/timex.h b/include/asm-arm/arch-l7200/timex.h
new file mode 100644
index 000000000000..3c3202620f00
--- /dev/null
+++ b/include/asm-arm/arch-l7200/timex.h
@@ -0,0 +1,20 @@
1/*
2 * linux/include/asm-arm/arch-l7200/timex.h
3 *
4 * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
5 * Steve Hill (sjhill@cotw.com)
6 *
7 * 04-21-2000 RS Created file
8 * 05-03-2000 SJH Tick rate was wrong
9 *
10 */
11
12/*
13 * On the ARM720T, clock ticks are set to 128 Hz.
14 *
15 * NOTE: The actual RTC value is set in 'time.h' which
16 * must be changed when choosing a different tick
17 * rate. The value of HZ in 'param.h' must also
18 * be changed to match below.
19 */
20#define CLOCK_TICK_RATE 128
diff --git a/include/asm-arm/arch-l7200/uncompress.h b/include/asm-arm/arch-l7200/uncompress.h
new file mode 100644
index 000000000000..1caa2b560f53
--- /dev/null
+++ b/include/asm-arm/arch-l7200/uncompress.h
@@ -0,0 +1,44 @@
1/*
2 * linux/include/asm-arm/arch-l7200/uncompress.h
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Changelog:
7 * 05-01-2000 SJH Created
8 * 05-13-2000 SJH Filled in function bodies
9 * 07-26-2000 SJH Removed hard coded buad rate
10 */
11
12#include <asm/hardware.h>
13
14#define IO_UART IO_START + 0x00044000
15
16#define __raw_writeb(v,p) (*(volatile unsigned char *)(p) = (v))
17#define __raw_readb(p) (*(volatile unsigned char *)(p))
18
19static __inline__ void putc(char c)
20{
21 while(__raw_readb(IO_UART + 0x18) & 0x20 ||
22 __raw_readb(IO_UART + 0x18) & 0x08);
23 __raw_writeb(c, IO_UART + 0x00);
24}
25
26static void putstr(const char *s)
27{
28 while (*s) {
29 if (*s == 10) { /* If a LF, add CR */
30 putc(10);
31 putc(13);
32 }
33 putc(*(s++));
34 }
35}
36
37static __inline__ void arch_decomp_setup(void)
38{
39 __raw_writeb(0x00, IO_UART + 0x08); /* Set HSB */
40 __raw_writeb(0x00, IO_UART + 0x20); /* Disable IRQs */
41 __raw_writeb(0x01, IO_UART + 0x14); /* Enable UART */
42}
43
44#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-l7200/vmalloc.h b/include/asm-arm/arch-l7200/vmalloc.h
new file mode 100644
index 000000000000..edeaebe1f14a
--- /dev/null
+++ b/include/asm-arm/arch-l7200/vmalloc.h
@@ -0,0 +1,15 @@
1/*
2 * linux/include/asm-arm/arch-l7200/vmalloc.h
3 */
4
5/*
6 * Just any arbitrary offset to the start of the vmalloc VM area: the
7 * current 8MB value just means that there will be a 8MB "hole" after the
8 * physical memory until the kernel virtual memory starts. That means that
9 * any out-of-bounds memory accesses will hopefully be caught.
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;)
12 */
13#define VMALLOC_OFFSET (8*1024*1024)
14#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
15#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-lh7a40x/constants.h b/include/asm-arm/arch-lh7a40x/constants.h
new file mode 100644
index 000000000000..52c1cb9c39c6
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/constants.h
@@ -0,0 +1,88 @@
1/* include/asm-arm/arch-lh7a40x/constants.h
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#ifndef __ASM_ARCH_CONSTANTS_H
13#define __ASM_ARCH_CONSTANTS_H
14
15#include <linux/config.h>
16
17/* Addressing constants */
18
19 /* SoC CPU IO addressing */
20#define IO_PHYS (0x80000000)
21#define IO_VIRT (0xf8000000)
22#define IO_SIZE (0x0000B000)
23
24#ifdef CONFIG_MACH_KEV7A400
25# define CPLD_PHYS (0x20000000)
26# define CPLD_VIRT (0xf2000000)
27# define CPLD_SIZE PAGE_SIZE
28#endif
29
30#if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404)
31
32# define IOBARRIER_PHYS 0xc0000000 /* Start of SDRAM */
33/*# define IOBARRIER_PHYS 0x00000000 */ /* Start of flash */
34# define IOBARRIER_VIRT 0xf0000000
35# define IOBARRIER_SIZE PAGE_SIZE
36
37# define CF_PHYS 0x60200000
38# define CF_VIRT 0xf6020000
39# define CF_SIZE (8*1024)
40
41 /* The IO mappings for the LPD CPLD are, unfortunately, sparse. */
42# define CPLDX_PHYS(x) (0x70000000 | ((x) << 20))
43# define CPLDX_VIRT(x) (0xf7000000 | ((x) << 16))
44# define CPLD00_PHYS CPLDX_PHYS (0x00) /* Wired LAN */
45# define CPLD00_VIRT CPLDX_VIRT (0x00)
46# define CPLD00_SIZE PAGE_SIZE
47# define CPLD02_PHYS CPLDX_PHYS (0x02)
48# define CPLD02_VIRT CPLDX_VIRT (0x02)
49# define CPLD02_SIZE PAGE_SIZE
50# define CPLD06_PHYS CPLDX_PHYS (0x06)
51# define CPLD06_VIRT CPLDX_VIRT (0x06)
52# define CPLD06_SIZE PAGE_SIZE
53# define CPLD08_PHYS CPLDX_PHYS (0x08)
54# define CPLD08_VIRT CPLDX_VIRT (0x08)
55# define CPLD08_SIZE PAGE_SIZE
56# define CPLD0C_PHYS CPLDX_PHYS (0x0c)
57# define CPLD0C_VIRT CPLDX_VIRT (0x0c)
58# define CPLD0C_SIZE PAGE_SIZE
59# define CPLD0E_PHYS CPLDX_PHYS (0x0e)
60# define CPLD0E_VIRT CPLDX_VIRT (0x0e)
61# define CPLD0E_SIZE PAGE_SIZE
62# define CPLD10_PHYS CPLDX_PHYS (0x10)
63# define CPLD10_VIRT CPLDX_VIRT (0x10)
64# define CPLD10_SIZE PAGE_SIZE
65# define CPLD12_PHYS CPLDX_PHYS (0x12)
66# define CPLD12_VIRT CPLDX_VIRT (0x12)
67# define CPLD12_SIZE PAGE_SIZE
68# define CPLD14_PHYS CPLDX_PHYS (0x14)
69# define CPLD14_VIRT CPLDX_VIRT (0x14)
70# define CPLD14_SIZE PAGE_SIZE
71# define CPLD16_PHYS CPLDX_PHYS (0x16)
72# define CPLD16_VIRT CPLDX_VIRT (0x16)
73# define CPLD16_SIZE PAGE_SIZE
74# define CPLD18_PHYS CPLDX_PHYS (0x18)
75# define CPLD18_VIRT CPLDX_VIRT (0x18)
76# define CPLD18_SIZE PAGE_SIZE
77# define CPLD1A_PHYS CPLDX_PHYS (0x1a)
78# define CPLD1A_VIRT CPLDX_VIRT (0x1a)
79# define CPLD1A_SIZE PAGE_SIZE
80#endif
81
82 /* Timing constants */
83
84#define XTAL_IN 14745600 /* 14.7456 MHz crystal */
85#define PLL_CLOCK (XTAL_IN * 21) /* 309 MHz PLL clock */
86#define MAX_HCLK_KHZ 100000 /* HCLK max limit ~100MHz */
87
88#endif /* __ASM_ARCH_CONSTANTS_H */
diff --git a/include/asm-arm/arch-lh7a40x/debug-macro.S b/include/asm-arm/arch-lh7a40x/debug-macro.S
new file mode 100644
index 000000000000..421dcd6a8506
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/debug-macro.S
@@ -0,0 +1,39 @@
1/* linux/include/asm-arm/arch-lh7a40x/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 @ It is not known if this will be appropriate for every 40x
15 @ board.
16
17 .macro addruart,rx
18 mrc p15, 0, \rx, c1, c0
19 tst \rx, #1 @ MMU enabled?
20 mov \rx, #0x00000700 @ offset from base
21 orreq \rx, \rx, #0x80000000 @ physical base
22 orrne \rx, \rx, #0xf8000000 @ virtual base
23 .endm
24
25 .macro senduart,rd,rx
26 strb \rd, [\rx] @ DATA
27 .endm
28
29 .macro busyuart,rd,rx @ spin while busy
301001: ldr \rd, [\rx, #0x10] @ STATUS
31 tst \rd, #1 << 3 @ BUSY (TX FIFO not empty)
32 bne 1001b @ yes, spin
33 .endm
34
35 .macro waituart,rd,rx @ wait for Tx FIFO room
361001: ldrb \rd, [\rx, #0x10] @ STATUS
37 tst \rd, #1 << 5 @ TXFF (TX FIFO full)
38 bne 1001b @ yes, spin
39 .endm
diff --git a/include/asm-arm/arch-lh7a40x/dma.h b/include/asm-arm/arch-lh7a40x/dma.h
new file mode 100644
index 000000000000..5797f01e1844
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/dma.h
@@ -0,0 +1,17 @@
1/* include/asm-arm/arch-lh7a40x/dma.h
2 *
3 * Copyright (C) 2003 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#ifndef __ASM_ARCH_DMA_H
12#define __ASM_ARCH_DMA_H
13
14#define MAX_DMA_ADDRESS 0xffffffff
15#define MAX_DMA_CHANNELS 0 /* All DMA is internal to CPU */
16
17#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-lh7a40x/entry-macro.S b/include/asm-arm/arch-lh7a40x/entry-macro.S
new file mode 100644
index 000000000000..865f396aa63c
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/entry-macro.S
@@ -0,0 +1,67 @@
1/*
2 * include/asm-arm/arch-lh7a40x/entry-macro.S
3 *
4 * Low-level IRQ helper macros for LH7A40x platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11# if defined (CONFIG_ARCH_LH7A400) && defined (CONFIG_ARCH_LH7A404)
12# error "LH7A400 and LH7A404 are mutually exclusive"
13# endif
14
15# if defined (CONFIG_ARCH_LH7A400)
16 .macro disable_fiq
17 .endm
18
19 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
20 mov \irqnr, #0
21 mov \base, #io_p2v(0x80000000) @ APB registers
22 ldr \irqstat, [\base, #0x500] @ PIC INTSR
23
241001: movs \irqstat, \irqstat, lsr #1 @ Shift into carry
25 bcs 1008f @ Bit set; irq found
26 add \irqnr, \irqnr, #1
27 bne 1001b @ Until no bits
28 b 1009f @ Nothing? Hmm.
291008: movs \irqstat, #1 @ Force !Z
301009:
31 .endm
32
33#elif defined(CONFIG_ARCH_LH7A404)
34
35 .macro disable_fiq
36 .endm
37
38 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
39 mov \irqnr, #0 @ VIC1 irq base
40 mov \base, #io_p2v(0x80000000) @ APB registers
41 add \base, \base, #0x8000
42 ldr \tmp, [\base, #0x0030] @ VIC1_VECTADDR
43 tst \tmp, #VA_VECTORED @ Direct vectored
44 bne 1002f
45 tst \tmp, #VA_VIC1DEFAULT @ Default vectored VIC1
46 ldrne \irqstat, [\base, #0] @ VIC1_IRQSTATUS
47 bne 1001f
48 add \base, \base, #(0xa000 - 0x8000)
49 ldr \tmp, [\base, #0x0030] @ VIC2_VECTADDR
50 tst \tmp, #VA_VECTORED @ Direct vectored
51 bne 1002f
52 ldr \irqstat, [\base, #0] @ VIC2_IRQSTATUS
53 mov \irqnr, #32 @ VIC2 irq base
54
551001: movs \irqstat, \irqstat, lsr #1 @ Shift into carry
56 bcs 1008f @ Bit set; irq found
57 add \irqnr, \irqnr, #1
58 bne 1001b @ Until no bits
59 b 1009f @ Nothing? Hmm.
601002: and \irqnr, \tmp, #0x3f @ Mask for valid bits
611008: movs \irqstat, #1 @ Force !Z
62 str \tmp, [\base, #0x0030] @ Clear vector
631009:
64 .endm
65#endif
66
67
diff --git a/include/asm-arm/arch-lh7a40x/hardware.h b/include/asm-arm/arch-lh7a40x/hardware.h
new file mode 100644
index 000000000000..aeb07c162e25
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/hardware.h
@@ -0,0 +1,58 @@
1/* include/asm-arm/arch-lh7a40x/hardware.h
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 *
5 * [ Substantially cribbed from include/asm-arm/arch-pxa/hardware.h ]
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 */
12
13#ifndef __ASM_ARCH_HARDWARE_H
14#define __ASM_ARCH_HARDWARE_H
15
16#define io_p2v(x) (0xf0000000 | (((x) & 0xfff00000) >> 4) | ((x) & 0x0000ffff))
17#define io_v2p(x) ( (((x) & 0x0fff0000) << 4) | ((x) & 0x0000ffff))
18
19#ifdef __ASSEMBLY__
20
21# define __REG(x) io_p2v(x)
22# define __PREG(x) io_v2p(x)
23
24#else
25
26# if 0
27# define __REG(x) (*((volatile u32 *)io_p2v(x)))
28# else
29/*
30 * This __REG() version gives the same results as the one above, except
31 * that we are fooling gcc somehow so it generates far better and smaller
32 * assembly code for access to contigous registers. It's a shame that gcc
33 * doesn't guess this by itself.
34 */
35#include <asm/types.h>
36typedef struct { volatile u32 offset[4096]; } __regbase;
37# define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2]
38# define __REG(x) __REGP(io_p2v(x))
39typedef struct { volatile u16 offset[4096]; } __regbase16;
40# define __REGP16(x) ((__regbase16 *)((x)&~4095))->offset[((x)&4095)>>1]
41# define __REG16(x) __REGP16(io_p2v(x))
42typedef struct { volatile u8 offset[4096]; } __regbase8;
43# define __REGP8(x) ((__regbase8 *)((x)&~4095))->offset[(x)&4095]
44# define __REG8(x) __REGP8(io_p2v(x))
45#endif
46
47/* Let's kick gcc's ass again... */
48# define __REG2(x,y) \
49 ( __builtin_constant_p(y) ? (__REG((x) + (y))) \
50 : (*(volatile u32 *)((u32)&__REG(x) + (y))) )
51
52# define __PREG(x) (io_v2p((u32)&(x)))
53
54#endif
55
56#include "registers.h"
57
58#endif /* _ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-lh7a40x/io.h b/include/asm-arm/arch-lh7a40x/io.h
new file mode 100644
index 000000000000..c13bdd9add92
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/io.h
@@ -0,0 +1,21 @@
1/* include/asm-arm/arch-lh7a40x/io.h
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#ifndef __ASM_ARCH_IO_H
12#define __ASM_ARCH_IO_H
13
14#define IO_SPACE_LIMIT 0xffffffff
15
16/* No ISA or PCI bus on this machine. */
17#define __io(a) ((void __iomem *)(a))
18#define __mem_pci(a) (a)
19#define __mem_isa(a) (a)
20
21#endif /* __ASM_ARCH_IO_H */
diff --git a/include/asm-arm/arch-lh7a40x/irq.h b/include/asm-arm/arch-lh7a40x/irq.h
new file mode 100644
index 000000000000..0f5f0b10f6ca
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/irq.h
@@ -0,0 +1,11 @@
1/* include/asm-arm/arch-lh7a40x/irq.h
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
11void __init lh7a40x_init_board_irq (void);
diff --git a/include/asm-arm/arch-lh7a40x/irqs.h b/include/asm-arm/arch-lh7a40x/irqs.h
new file mode 100644
index 000000000000..f91f3e59f3ab
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/irqs.h
@@ -0,0 +1,196 @@
1/* include/asm-arm/arch-lh7a40x/irqs.h
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/* It is to be seen whether or not we can build a kernel for more than
13 * one board. For the time being, these macros assume that we cannot.
14 * Thus, it is OK to ifdef machine/board specific IRQ assignments.
15 */
16
17
18#ifndef __ASM_ARCH_IRQS_H
19#define __ASM_ARCH_IRQS_H
20
21#include <linux/config.h>
22
23#define FIQ_START 80
24
25#if defined (CONFIG_ARCH_LH7A400)
26
27 /* FIQs */
28
29# define IRQ_GPIO0FIQ 0 /* GPIO External FIQ Interrupt on F0 */
30# define IRQ_BLINT 1 /* Battery Low */
31# define IRQ_WEINT 2 /* Watchdog Timer, WDT overflow */
32# define IRQ_MCINT 3 /* Media Change, MEDCHG pin rising */
33
34 /* IRQs */
35
36# define IRQ_CSINT 4 /* Audio Codec (ACI) */
37# define IRQ_GPIO1INTR 5 /* GPIO External IRQ Interrupt on F1 */
38# define IRQ_GPIO2INTR 6 /* GPIO External IRQ Interrupt on F2 */
39# define IRQ_GPIO3INTR 7 /* GPIO External IRQ Interrupt on F3 */
40# define IRQ_T1UI 8 /* Timer 1 underflow */
41# define IRQ_T2UI 9 /* Timer 2 underflow */
42# define IRQ_RTCMI 10
43# define IRQ_TINTR 11 /* Clock State Controller 64 Hz tick (CSC) */
44# define IRQ_UART1INTR 12
45# define IRQ_UART2INTR 13
46# define IRQ_LCDINTR 14
47# define IRQ_SSIEOT 15 /* Synchronous Serial Interface (SSI) */
48# define IRQ_UART3INTR 16
49# define IRQ_SCIINTR 17 /* Smart Card Interface (SCI) */
50# define IRQ_AACINTR 18 /* Advanced Audio Codec (AAC) */
51# define IRQ_MMCINTR 19 /* Multimedia Card (MMC) */
52# define IRQ_USBINTR 20
53# define IRQ_DMAINTR 21
54# define IRQ_T3UI 22 /* Timer 3 underflow */
55# define IRQ_GPIO4INTR 23 /* GPIO External IRQ Interrupt on F4 */
56# define IRQ_GPIO5INTR 24 /* GPIO External IRQ Interrupt on F5 */
57# define IRQ_GPIO6INTR 25 /* GPIO External IRQ Interrupt on F6 */
58# define IRQ_GPIO7INTR 26 /* GPIO External IRQ Interrupt on F7 */
59# define IRQ_BMIINTR 27 /* Battery Monitor Interface (BMI) */
60
61# define NR_IRQ_CPU 28 /* IRQs directly recognized by CPU */
62
63 /* Given IRQ, return GPIO interrupt number 0-7 */
64# define IRQ_TO_GPIO(i) ((i) \
65 - (((i) > IRQ_GPIO3INTR) ? IRQ_GPIO4INTR - IRQ_GPIO3INTR - 1 : 0)\
66 - (((i) > IRQ_GPIO0INTR) ? IRQ_GPIO1INTR - IRQ_GPIO0INTR - 1 : 0))
67
68#endif
69
70#if defined (CONFIG_ARCH_LH7A404)
71
72# define IRQ_BROWN 0 /* Brownout */
73# define IRQ_WDTINTR 1 /* Watchdog Timer */
74# define IRQ_COMMRX 2 /* ARM Comm Rx for Debug */
75# define IRQ_COMMTX 3 /* ARM Comm Tx for Debug */
76# define IRQ_T1UI 4 /* Timer 1 underflow */
77# define IRQ_T2UI 5 /* Timer 2 underflow */
78# define IRQ_CSINT 6 /* Codec Interrupt (shared by AAC on 404) */
79# define IRQ_DMAM2P0 7 /* -- DMA Memory to Peripheral */
80# define IRQ_DMAM2P1 8
81# define IRQ_DMAM2P2 9
82# define IRQ_DMAM2P3 10
83# define IRQ_DMAM2P4 11
84# define IRQ_DMAM2P5 12
85# define IRQ_DMAM2P6 13
86# define IRQ_DMAM2P7 14
87# define IRQ_DMAM2P8 15
88# define IRQ_DMAM2P9 16
89# define IRQ_DMAM2M0 17 /* -- DMA Memory to Memory */
90# define IRQ_DMAM2M1 18
91# define IRQ_GPIO0INTR 19 /* -- GPIOF Interrupt */
92# define IRQ_GPIO1INTR 20
93# define IRQ_GPIO2INTR 21
94# define IRQ_GPIO3INTR 22
95# define IRQ_SOFT_V1_23 23 /* -- Unassigned */
96# define IRQ_SOFT_V1_24 24
97# define IRQ_SOFT_V1_25 25
98# define IRQ_SOFT_V1_26 26
99# define IRQ_SOFT_V1_27 27
100# define IRQ_SOFT_V1_28 28
101# define IRQ_SOFT_V1_29 29
102# define IRQ_SOFT_V1_30 30
103# define IRQ_SOFT_V1_31 31
104
105# define IRQ_BLINT 32 /* Battery Low */
106# define IRQ_BMIINTR 33 /* Battery Monitor */
107# define IRQ_MCINTR 34 /* Media Change */
108# define IRQ_TINTR 35 /* 64Hz Tick */
109# define IRQ_WEINT 36 /* Watchdog Expired */
110# define IRQ_RTCMI 37 /* Real-time Clock Match */
111# define IRQ_UART1INTR 38 /* UART1 Interrupt (including error) */
112# define IRQ_UART1ERR 39 /* UART1 Error */
113# define IRQ_UART2INTR 40 /* UART2 Interrupt (including error) */
114# define IRQ_UART2ERR 41 /* UART2 Error */
115# define IRQ_UART3INTR 42 /* UART3 Interrupt (including error) */
116# define IRQ_UART3ERR 43 /* UART3 Error */
117# define IRQ_SCIINTR 44 /* Smart Card */
118# define IRQ_TSCINTR 45 /* Touchscreen */
119# define IRQ_KMIINTR 46 /* Keyboard/Mouse (PS/2) */
120# define IRQ_GPIO4INTR 47 /* -- GPIOF Interrupt */
121# define IRQ_GPIO5INTR 48
122# define IRQ_GPIO6INTR 49
123# define IRQ_GPIO7INTR 50
124# define IRQ_T3UI 51 /* Timer 3 underflow */
125# define IRQ_LCDINTR 52 /* LCD Controller */
126# define IRQ_SSPINTR 53 /* Synchronous Serial Port */
127# define IRQ_SDINTR 54 /* Secure Digital Port (MMC) */
128# define IRQ_USBINTR 55 /* USB Device Port */
129# define IRQ_USHINTR 56 /* USB Host Port */
130# define IRQ_SOFT_V2_25 57 /* -- Unassigned */
131# define IRQ_SOFT_V2_26 58
132# define IRQ_SOFT_V2_27 59
133# define IRQ_SOFT_V2_28 60
134# define IRQ_SOFT_V2_29 61
135# define IRQ_SOFT_V2_30 62
136# define IRQ_SOFT_V2_31 63
137
138# define NR_IRQ_CPU 64 /* IRQs directly recognized by CPU */
139
140 /* Given IRQ, return GPIO interrupt number 0-7 */
141# define IRQ_TO_GPIO(i) ((i) \
142 - (((i) > IRQ_GPIO3INTR) ? IRQ_GPIO4INTR - IRQ_GPIO3INTR - 1 : 0)\
143 - IRQ_GPIO0INTR)
144
145 /* Vector Address constants */
146# define VA_VECTORED 0x100 /* Set for vectored interrupt */
147# define VA_VIC1DEFAULT 0x200 /* Set as default VECTADDR for VIC1 */
148# define VA_VIC2DEFAULT 0x400 /* Set as default VECTADDR for VIC2 */
149
150#endif
151
152 /* IRQ aliases */
153
154#if !defined (IRQ_GPIO0INTR)
155# define IRQ_GPIO0INTR IRQ_GPIO0FIQ
156#endif
157#define IRQ_TICK IRQ_TINTR
158#define IRQ_PCC1_RDY IRQ_GPIO6INTR /* PCCard 1 ready */
159#define IRQ_PCC2_RDY IRQ_GPIO7INTR /* PCCard 2 ready */
160
161#ifdef CONFIG_MACH_KEV7A400
162# define IRQ_TS IRQ_GPIOFIQ /* Touchscreen */
163# define IRQ_CPLD IRQ_GPIO1INTR /* CPLD cascade */
164# define IRQ_PCC1_CD IRQ_GPIO_F2 /* PCCard 1 card detect */
165# define IRQ_PCC2_CD IRQ_GPIO_F3 /* PCCard 2 card detect */
166#endif
167
168#if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404)
169# define IRQ_CPLD_V28 IRQ_GPIO7INTR /* CPLD cascade through GPIO_PF7 */
170# define IRQ_CPLD_V34 IRQ_GPIO3INTR /* CPLD cascade through GPIO_PF3 */
171#endif
172
173 /* System specific IRQs */
174
175#define IRQ_BOARD_START NR_IRQ_CPU
176
177#ifdef CONFIG_MACH_KEV7A400
178# define IRQ_KEV7A400_CPLD IRQ_BOARD_START
179# define NR_IRQ_BOARD 5
180# define IRQ_KEV7A400_MMC_CD IRQ_KEV7A400_CPLD + 0 /* MMC Card Detect */
181# define IRQ_KEV7A400_RI2 IRQ_KEV7A400_CPLD + 1 /* Ring Indicator 2 */
182# define IRQ_KEV7A400_IDE_CF IRQ_KEV7A400_CPLD + 2 /* Compact Flash (?) */
183# define IRQ_KEV7A400_ETH_INT IRQ_KEV7A400_CPLD + 3 /* Ethernet chip */
184# define IRQ_KEV7A400_INT IRQ_KEV7A400_CPLD + 4
185#endif
186
187#if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404)
188# define IRQ_LPD7A40X_CPLD IRQ_BOARD_START
189# define NR_IRQ_BOARD 2
190# define IRQ_LPD7A40X_ETH_INT IRQ_LPD7A40X_CPLD + 0 /* Ethernet chip */
191# define IRQ_LPD7A400_TS IRQ_LPD7A40X_CPLD + 1 /* Touch screen */
192#endif
193
194#define NR_IRQS (NR_IRQ_CPU + NR_IRQ_BOARD)
195
196#endif
diff --git a/include/asm-arm/arch-lh7a40x/memory.h b/include/asm-arm/arch-lh7a40x/memory.h
new file mode 100644
index 000000000000..7e2fea372663
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/memory.h
@@ -0,0 +1,94 @@
1/* include/asm-arm/arch-lh7a40x/memory.h
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 * Refer to <file:Documentation/arm/Sharp-LH/SDRAM> for more information.
11 *
12 */
13
14#ifndef __ASM_ARCH_MEMORY_H
15#define __ASM_ARCH_MEMORY_H
16
17/*
18 * Physical DRAM offset.
19 */
20#define PHYS_OFFSET (0xc0000000UL)
21
22/*
23 * Virtual view <-> DMA view memory address translations
24 * virt_to_bus: Used to translate the virtual address to an
25 * address suitable to be passed to set_dma_addr
26 * bus_to_virt: Used to convert an address for DMA operations
27 * to an address that the kernel can use.
28 */
29#define __virt_to_bus(x) __virt_to_phys(x)
30#define __bus_to_virt(x) __phys_to_virt(x)
31
32#ifdef CONFIG_DISCONTIGMEM
33
34#define NODES_SHIFT 4 /* Up to 16 nodes */
35
36/*
37 * Given a kernel address, find the home node of the underlying memory.
38 */
39
40# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
41# define KVADDR_TO_NID(addr) \
42 ( ((((unsigned long) (addr) - PAGE_OFFSET) >> 24) & 1)\
43 | ((((unsigned long) (addr) - PAGE_OFFSET) >> 25) & ~1))
44# else /* 2 banks per node */
45# define KVADDR_TO_NID(addr) \
46 (((unsigned long) (addr) - PAGE_OFFSET) >> 26)
47# endif
48
49/*
50 * Given a page frame number, convert it to a node id.
51 */
52
53# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
54# define PFN_TO_NID(pfn) \
55 (((((pfn) - PHYS_PFN_OFFSET) >> (24 - PAGE_SHIFT)) & 1)\
56 | ((((pfn) - PHYS_PFN_OFFSET) >> (25 - PAGE_SHIFT)) & ~1))
57# else /* 2 banks per node */
58# define PFN_TO_NID(pfn) \
59 (((pfn) - PHYS_PFN_OFFSET) >> (26 - PAGE_SHIFT))
60#endif
61
62/*
63 * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
64 * and return the mem_map of that node.
65 */
66# define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr))
67
68/*
69 * Given a page frame number, find the owning node of the memory
70 * and return the mem_map of that node.
71 */
72# define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn))
73
74/*
75 * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
76 * and returns the index corresponding to the appropriate page in the
77 * node's mem_map.
78 */
79
80# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
81# define LOCAL_MAP_NR(addr) \
82 (((unsigned long)(addr) & 0x003fffff) >> PAGE_SHIFT)
83# else /* 2 banks per node */
84# define LOCAL_MAP_NR(addr) \
85 (((unsigned long)(addr) & 0x01ffffff) >> PAGE_SHIFT)
86# endif
87
88#else
89
90# define PFN_TO_NID(addr) (0)
91
92#endif
93
94#endif
diff --git a/include/asm-arm/arch-lh7a40x/param.h b/include/asm-arm/arch-lh7a40x/param.h
new file mode 100644
index 000000000000..acad0bc5deba
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/param.h
@@ -0,0 +1,9 @@
1/* include/asm-arm/arch-lh7a40x/param.h
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 */
diff --git a/include/asm-arm/arch-lh7a40x/registers.h b/include/asm-arm/arch-lh7a40x/registers.h
new file mode 100644
index 000000000000..2edb22e35450
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/registers.h
@@ -0,0 +1,193 @@
1/* include/asm-arm/arch-lh7a40x/registers.h
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/config.h>
13#include <asm/arch/constants.h>
14
15#ifndef __ASM_ARCH_REGISTERS_H
16#define __ASM_ARCH_REGISTERS_H
17
18
19 /* Physical register base addresses */
20
21#define AC97_PHYS (0x80000000) /* AC97 Controller */
22#define MMC_PHYS (0x80000100) /* Multimedia Card Controller */
23#define USB_PHYS (0x80000200) /* USB Client */
24#define SCI_PHYS (0x80000300) /* Secure Card Interface */
25#define CSC_PHYS (0x80000400) /* Clock/State Controller */
26#define INTC_PHYS (0x80000500) /* Interrupt Controller */
27#define UART1_PHYS (0x80000600) /* UART1 Controller */
28#define SIR_PHYS (0x80000600) /* IR Controller, same are UART1 */
29#define UART2_PHYS (0x80000700) /* UART2 Controller */
30#define UART3_PHYS (0x80000800) /* UART3 Controller */
31#define DCDC_PHYS (0x80000900) /* DC to DC Controller */
32#define ACI_PHYS (0x80000a00) /* Audio Codec Interface */
33#define SSP_PHYS (0x80000b00) /* Synchronous ... */
34#define TIMER_PHYS (0x80000c00) /* Timer Controller */
35#define RTC_PHYS (0x80000d00) /* Real-time Clock */
36#define GPIO_PHYS (0x80000e00) /* General Purpose IO */
37#define BMI_PHYS (0x80000f00) /* Battery Monitor Interface */
38#define WDT_PHYS (0x80001400) /* Watchdog Timer */
39#define SMC_PHYS (0x80002000) /* Static Memory Controller */
40#define SDRC_PHYS (0x80002400) /* SDRAM Controller */
41#define DMAC_PHYS (0x80002800) /* DMA Controller */
42#define CLCDC_PHYS (0x80003000) /* Color LCD Controller */
43
44 /* Physical registers of the LH7A404 */
45
46#define VIC1_PHYS (0x80008000) /* Vectored Interrupt Controller 1 */
47#define USBH_PHYS (0x80009000) /* USB OHCI host controller */
48#define VIC2_PHYS (0x8000a000) /* Vectored Interrupt Controller 2 */
49
50/*#define KBD_PHYS (0x80000e00) */
51/*#define LCDICP_PHYS (0x80001000) */
52
53
54 /* Clock/State Controller register */
55
56#define CSC_PWRCNT __REG(CSC_PHYS + 0x04) /* Power control */
57
58#define CSC_PWRCNT_USBH_EN (1<<28) /* USB Host power enable */
59
60
61 /* Interrupt Controller registers */
62
63#define INTC_INTSR __REG(INTC_PHYS + 0x00) /* Status */
64#define INTC_INTRSR __REG(INTC_PHYS + 0x04) /* Raw Status */
65#define INTC_INTENS __REG(INTC_PHYS + 0x08) /* Enable Set */
66#define INTC_INTENC __REG(INTC_PHYS + 0x0c) /* Enable Clear */
67
68
69 /* Vectored Interrupted Controller registers */
70
71#define VIC1_IRQSTATUS __REG(VIC1_PHYS + 0x00)
72#define VIC1_FIQSTATUS __REG(VIC1_PHYS + 0x04)
73#define VIC1_RAWINTR __REG(VIC1_PHYS + 0x08)
74#define VIC1_INTSEL __REG(VIC1_PHYS + 0x0c)
75#define VIC1_INTEN __REG(VIC1_PHYS + 0x10)
76#define VIC1_INTENCLR __REG(VIC1_PHYS + 0x14)
77#define VIC1_SOFTINT __REG(VIC1_PHYS + 0x18)
78#define VIC1_SOFTINTCLR __REG(VIC1_PHYS + 0x1c)
79#define VIC1_PROTECT __REG(VIC1_PHYS + 0x20)
80#define VIC1_VECTADDR __REG(VIC1_PHYS + 0x30)
81#define VIC1_NVADDR __REG(VIC1_PHYS + 0x34)
82#define VIC1_VAD0 __REG(VIC1_PHYS + 0x100)
83#define VIC1_VECTCNTL0 __REG(VIC1_PHYS + 0x200)
84#define VIC2_IRQSTATUS __REG(VIC2_PHYS + 0x00)
85#define VIC2_FIQSTATUS __REG(VIC2_PHYS + 0x04)
86#define VIC2_RAWINTR __REG(VIC2_PHYS + 0x08)
87#define VIC2_INTSEL __REG(VIC2_PHYS + 0x0c)
88#define VIC2_INTEN __REG(VIC2_PHYS + 0x10)
89#define VIC2_INTENCLR __REG(VIC2_PHYS + 0x14)
90#define VIC2_SOFTINT __REG(VIC2_PHYS + 0x18)
91#define VIC2_SOFTINTCLR __REG(VIC2_PHYS + 0x1c)
92#define VIC2_PROTECT __REG(VIC2_PHYS + 0x20)
93#define VIC2_VECTADDR __REG(VIC2_PHYS + 0x30)
94#define VIC2_NVADDR __REG(VIC2_PHYS + 0x34)
95#define VIC2_VAD0 __REG(VIC2_PHYS + 0x100)
96#define VIC2_VECTCNTL0 __REG(VIC2_PHYS + 0x200)
97
98#define VIC_CNTL_ENABLE (0x20)
99
100 /* USB Host registers (Open HCI compatible) */
101
102#define USBH_CMDSTATUS __REG(USBH_PHYS + 0x08)
103
104
105 /* GPIO registers */
106
107#define GPIO_INTTYPE1 __REG(GPIO_PHYS + 0x4c) /* Interrupt Type 1 (Edge) */
108#define GPIO_INTTYPE2 __REG(GPIO_PHYS + 0x50) /* Interrupt Type 2 */
109#define GPIO_GPIOFEOI __REG(GPIO_PHYS + 0x54) /* GPIO End-of-Interrupt */
110#define GPIO_GPIOINTEN __REG(GPIO_PHYS + 0x58) /* GPIO Interrupt Enable */
111#define GPIO_INTSTATUS __REG(GPIO_PHYS + 0x5c) /* GPIO Interrupt Status */
112
113
114 /* Static Memory Controller registers */
115
116#define SMC_BCR0 __REG(SMC_PHYS + 0x00) /* Bank 0 Configuration */
117#define SMC_BCR1 __REG(SMC_PHYS + 0x04) /* Bank 1 Configuration */
118#define SMC_BCR2 __REG(SMC_PHYS + 0x08) /* Bank 2 Configuration */
119#define SMC_BCR3 __REG(SMC_PHYS + 0x0C) /* Bank 3 Configuration */
120#define SMC_BCR6 __REG(SMC_PHYS + 0x18) /* Bank 6 Configuration */
121#define SMC_BCR7 __REG(SMC_PHYS + 0x1c) /* Bank 7 Configuration */
122
123
124#ifdef CONFIG_MACH_KEV7A400
125# define CPLD_RD_OPT_DIP_SW __REG16(CPLD_PHYS + 0x00) /* Read Option SW */
126# define CPLD_WR_IO_BRD_CTL __REG16(CPLD_PHYS + 0x00) /* Write Control */
127# define CPLD_RD_PB_KEYS __REG16(CPLD_PHYS + 0x02) /* Read Btn Keys */
128# define CPLD_LATCHED_INTS __REG16(CPLD_PHYS + 0x04) /* Read INTR stat. */
129# define CPLD_CL_INT __REG16(CPLD_PHYS + 0x04) /* Clear INTR stat */
130# define CPLD_BOOT_MMC_STATUS __REG16(CPLD_PHYS + 0x06) /* R/O */
131# define CPLD_RD_KPD_ROW_SENSE __REG16(CPLD_PHYS + 0x08)
132# define CPLD_WR_PB_INT_MASK __REG16(CPLD_PHYS + 0x08)
133# define CPLD_RD_BRD_DISP_SW __REG16(CPLD_PHYS + 0x0a)
134# define CPLD_WR_EXT_INT_MASK __REG16(CPLD_PHYS + 0x0a)
135# define CPLD_LCD_PWR_CNTL __REG16(CPLD_PHYS + 0x0c)
136# define CPLD_SEVEN_SEG __REG16(CPLD_PHYS + 0x0e) /* 7 seg. LED mask */
137
138#endif
139
140#if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404)
141# define CPLD_CONTROL __REG8(CPLD02_PHYS)
142# define CPLD_SPI_DATA __REG8(CPLD06_PHYS)
143# define CPLD_SPI_CONTROL __REG8(CPLD08_PHYS)
144# define CPLD_SPI_EEPROM __REG8(CPLD0A_PHYS)
145# define CPLD_INTERRUPTS __REG8(CPLD0C_PHYS) /* IRQ mask/status */
146# define CPLD_BOOT_MODE __REG8(CPLD0E_PHYS)
147# define CPLD_FLASH __REG8(CPLD10_PHYS)
148# define CPLD_POWER_MGMT __REG8(CPLD12_PHYS)
149# define CPLD_REVISION __REG8(CPLD14_PHYS)
150# define CPLD_GPIO_EXT __REG8(CPLD16_PHYS)
151# define CPLD_GPIO_DATA __REG8(CPLD18_PHYS)
152# define CPLD_GPIO_DIR __REG8(CPLD1A_PHYS)
153#endif
154
155
156 /* Timer registers */
157
158#define TIMER_LOAD1 __REG(TIMER_PHYS + 0x00) /* Timer 1 initial value */
159#define TIMER_VALUE1 __REG(TIMER_PHYS + 0x04) /* Timer 1 current value */
160#define TIMER_CONTROL1 __REG(TIMER_PHYS + 0x08) /* Timer 1 control word */
161#define TIMER_EOI1 __REG(TIMER_PHYS + 0x0c) /* Timer 1 interrupt clear */
162
163#define TIMER_LOAD2 __REG(TIMER_PHYS + 0x20) /* Timer 2 initial value */
164#define TIMER_VALUE2 __REG(TIMER_PHYS + 0x24) /* Timer 2 current value */
165#define TIMER_CONTROL2 __REG(TIMER_PHYS + 0x28) /* Timer 2 control word */
166#define TIMER_EOI2 __REG(TIMER_PHYS + 0x2c) /* Timer 2 interrupt clear */
167
168#define TIMER_BUZZCON __REG(TIMER_PHYS + 0x40) /* Buzzer configuration */
169
170#define TIMER_LOAD3 __REG(TIMER_PHYS + 0x80) /* Timer 3 initial value */
171#define TIMER_VALUE3 __REG(TIMER_PHYS + 0x84) /* Timer 3 current value */
172#define TIMER_CONTROL3 __REG(TIMER_PHYS + 0x88) /* Timer 3 control word */
173#define TIMER_EOI3 __REG(TIMER_PHYS + 0x8c) /* Timer 3 interrupt clear */
174
175#define TIMER_C_ENABLE (1<<7)
176#define TIMER_C_PERIODIC (1<<6)
177#define TIMER_C_FREERUNNING (0)
178#define TIMER_C_2KHZ (0x00) /* 1.986 kHz */
179#define TIMER_C_508KHZ (0x08)
180
181 /* GPIO registers */
182
183#define GPIO_PFDD __REG(GPIO_PHYS + 0x34) /* PF direction */
184#define GPIO_INTTYPE1 __REG(GPIO_PHYS + 0x4c) /* IRQ edge or lvl */
185#define GPIO_INTTYPE2 __REG(GPIO_PHYS + 0x50) /* IRQ activ hi/lo */
186#define GPIO_GPIOFEOI __REG(GPIO_PHYS + 0x54) /* GPIOF end of IRQ */
187#define GPIO_GPIOFINTEN __REG(GPIO_PHYS + 0x58) /* GPIOF IRQ enable */
188#define GPIO_INTSTATUS __REG(GPIO_PHYS + 0x5c) /* GPIOF IRQ latch */
189#define GPIO_RAWINTSTATUS __REG(GPIO_PHYS + 0x60) /* GPIOF IRQ raw */
190
191
192#endif /* _ASM_ARCH_REGISTERS_H */
193
diff --git a/include/asm-arm/arch-lh7a40x/system.h b/include/asm-arm/arch-lh7a40x/system.h
new file mode 100644
index 000000000000..e1df8aa460f2
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/system.h
@@ -0,0 +1,19 @@
1/* include/asm-arm/arch-lh7a40x/system.h
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
11static inline void arch_idle(void)
12{
13 cpu_do_idle ();
14}
15
16static inline void arch_reset(char mode)
17{
18 cpu_reset (0);
19}
diff --git a/include/asm-arm/arch-lh7a40x/timex.h b/include/asm-arm/arch-lh7a40x/timex.h
new file mode 100644
index 000000000000..fa726b670829
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/timex.h
@@ -0,0 +1,17 @@
1/* include/asm-arm/arch-lh7a40x/timex.h
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 <asm/arch/constants.h>
12
13#define CLOCK_TICK_RATE (PLL_CLOCK/6/16)
14
15/*
16#define CLOCK_TICK_RATE 3686400
17*/
diff --git a/include/asm-arm/arch-lh7a40x/uncompress.h b/include/asm-arm/arch-lh7a40x/uncompress.h
new file mode 100644
index 000000000000..ec8ab67122f3
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/uncompress.h
@@ -0,0 +1,43 @@
1/* include/asm-arm/arch-lh7a40x/uncompress.h
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 <asm/arch/registers.h>
12
13#ifndef UART_R_DATA
14# define UART_R_DATA (0x00)
15#endif
16#ifndef UART_R_STATUS
17# define UART_R_STATUS (0x10)
18#endif
19#define nTxRdy (0x20) /* Not TxReady (literally Tx FIFO full) */
20
21 /* Access UART with physical addresses before MMU is setup */
22#define UART_STATUS (*(volatile unsigned long*) (UART2_PHYS + UART_R_STATUS))
23#define UART_DATA (*(volatile unsigned long*) (UART2_PHYS + UART_R_DATA))
24
25static __inline__ void putc (char ch)
26{
27 while (UART_STATUS & nTxRdy)
28 ;
29 UART_DATA = ch;
30}
31
32static void putstr (const char* sz)
33{
34 for (; *sz; ++sz) {
35 putc (*sz);
36 if (*sz == '\n')
37 putc ('\r');
38 }
39}
40
41 /* NULL functions; we don't presently need them */
42#define arch_decomp_setup()
43#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-lh7a40x/vmalloc.h b/include/asm-arm/arch-lh7a40x/vmalloc.h
new file mode 100644
index 000000000000..5ac607925bea
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/vmalloc.h
@@ -0,0 +1,21 @@
1/* include/asm-arm/arch-lh7a40x/vmalloc.h
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/*
12 * Just any arbitrary offset to the start of the vmalloc VM area: the
13 * current 8MB value just means that there will be a 8MB "hole" after
14 * the physical memory until the kernel virtual memory starts. That
15 * means that any out-of-bounds memory accesses will hopefully be
16 * caught. The vmalloc() routines leaves a hole of 4kB (one page)
17 * between each vmalloced area for the same reason. ;)
18 */
19#define VMALLOC_OFFSET (8*1024*1024)
20#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
21#define VMALLOC_END (0xe8000000)
diff --git a/include/asm-arm/arch-omap/aic23.h b/include/asm-arm/arch-omap/aic23.h
new file mode 100644
index 000000000000..590bac25b7c4
--- /dev/null
+++ b/include/asm-arm/arch-omap/aic23.h
@@ -0,0 +1,112 @@
1/*
2 * linux/include/asm-arm/arch-omap/aic23.h
3 *
4 * Hardware definitions for TI TLV320AIC23 audio codec
5 *
6 * Copyright (C) 2002 RidgeRun, Inc.
7 * Author: Steve Johnson
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30#ifndef __ASM_ARCH_AIC23_H
31#define __ASM_ARCH_AIC23_H
32
33// Codec TLV320AIC23
34#define LEFT_LINE_VOLUME_ADDR 0x00
35#define RIGHT_LINE_VOLUME_ADDR 0x01
36#define LEFT_CHANNEL_VOLUME_ADDR 0x02
37#define RIGHT_CHANNEL_VOLUME_ADDR 0x03
38#define ANALOG_AUDIO_CONTROL_ADDR 0x04
39#define DIGITAL_AUDIO_CONTROL_ADDR 0x05
40#define POWER_DOWN_CONTROL_ADDR 0x06
41#define DIGITAL_AUDIO_FORMAT_ADDR 0x07
42#define SAMPLE_RATE_CONTROL_ADDR 0x08
43#define DIGITAL_INTERFACE_ACT_ADDR 0x09
44#define RESET_CONTROL_ADDR 0x0F
45
46// Left (right) line input volume control register
47#define LRS_ENABLED 0x0100
48#define LIM_MUTED 0x0080
49#define LIV_DEFAULT 0x0017
50#define LIV_MAX 0x001f
51#define LIV_MIN 0x0000
52
53// Left (right) channel headphone volume control register
54#define LZC_ON 0x0080
55#define LHV_DEFAULT 0x0079
56#define LHV_MAX 0x007f
57#define LHV_MIN 0x0000
58
59// Analog audio path control register
60#define STE_ENABLED 0x0020
61#define DAC_SELECTED 0x0010
62#define BYPASS_ON 0x0008
63#define INSEL_MIC 0x0004
64#define MICM_MUTED 0x0002
65#define MICB_20DB 0x0001
66
67// Digital audio path control register
68#define DACM_MUTE 0x0008
69#define DEEMP_32K 0x0002
70#define DEEMP_44K 0x0004
71#define DEEMP_48K 0x0006
72#define ADCHP_ON 0x0001
73
74// Power control down register
75#define DEVICE_POWER_OFF 0x0080
76#define CLK_OFF 0x0040
77#define OSC_OFF 0x0020
78#define OUT_OFF 0x0010
79#define DAC_OFF 0x0008
80#define ADC_OFF 0x0004
81#define MIC_OFF 0x0002
82#define LINE_OFF 0x0001
83
84// Digital audio interface register
85#define MS_MASTER 0x0040
86#define LRSWAP_ON 0x0020
87#define LRP_ON 0x0010
88#define IWL_16 0x0000
89#define IWL_20 0x0004
90#define IWL_24 0x0008
91#define IWL_32 0x000C
92#define FOR_I2S 0x0002
93#define FOR_DSP 0x0003
94
95// Sample rate control register
96#define CLKOUT_HALF 0x0080
97#define CLKIN_HALF 0x0040
98#define BOSR_384fs 0x0002 // BOSR_272fs when in USB mode
99#define USB_CLK_ON 0x0001
100#define SR_MASK 0xf
101#define CLKOUT_SHIFT 7
102#define CLKIN_SHIFT 6
103#define SR_SHIFT 2
104#define BOSR_SHIFT 1
105
106// Digital interface register
107#define ACT_ON 0x0001
108
109#define TLV320AIC23ID1 (0x1a) // cs low
110#define TLV320AIC23ID2 (0x1b) // cs high
111
112#endif /* __ASM_ARCH_AIC23_H */
diff --git a/include/asm-arm/arch-omap/board-h2.h b/include/asm-arm/arch-omap/board-h2.h
new file mode 100644
index 000000000000..60f002b72983
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-h2.h
@@ -0,0 +1,47 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-h2.h
3 *
4 * Hardware definitions for TI OMAP1610 H2 board.
5 *
6 * Cleanup for Linux-2.6 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#ifndef __ASM_ARCH_OMAP_H2_H
30#define __ASM_ARCH_OMAP_H2_H
31
32/* Placeholder for H2 specific defines */
33
34/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
35#define OMAP1610_ETHR_START 0x04000300
36
37/* Intel STRATA NOR flash at CS3 or CS2B(NAND Boot) */
38#define OMAP_NOR_FLASH_SIZE SZ_32M
39#define OMAP_NOR_FLASH_START1 0x0C000000 /* CS3 */
40#define OMAP_NOR_FLASH_START2 0x0A000000 /* CS2B */
41
42/* Samsung NAND flash at CS2B or CS3(NAND Boot) */
43#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */
44#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */
45
46#endif /* __ASM_ARCH_OMAP_H2_H */
47
diff --git a/include/asm-arm/arch-omap/board-h3.h b/include/asm-arm/arch-omap/board-h3.h
new file mode 100644
index 000000000000..e4d1cd231731
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-h3.h
@@ -0,0 +1,49 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-h3.h
3 *
4 * Copyright (C) 2001 RidgeRun, Inc.
5 * Copyright (C) 2004 Texas Instruments, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27#ifndef __ASM_ARCH_OMAP_H3_H
28#define __ASM_ARCH_OMAP_H3_H
29
30/* In OMAP1710 H3 the Ethernet is directly connected to CS1 */
31#define OMAP1710_ETHR_START 0x04000300
32
33/* Intel STRATA NOR flash at CS3 or CS2B(NAND Boot) */
34#define OMAP_NOR_FLASH_SIZE SZ_32M
35#define OMAP_NOR_FLASH_START1 0x0C000000 /* CS3 */
36#define OMAP_NOR_FLASH_START2 0x0A000000 /* CS2B */
37
38/* Samsung NAND flash at CS2B or CS3(NAND Boot) */
39#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */
40#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */
41
42#define MAXIRQNUM (IH_BOARD_BASE)
43#define MAXFIQNUM MAXIRQNUM
44#define MAXSWINUM MAXIRQNUM
45
46#define NR_IRQS (MAXIRQNUM + 1)
47
48
49#endif /* __ASM_ARCH_OMAP_H3_H */
diff --git a/include/asm-arm/arch-omap/board-h4.h b/include/asm-arm/arch-omap/board-h4.h
new file mode 100644
index 000000000000..79138dcfb4ac
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-h4.h
@@ -0,0 +1,35 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-h4.h
3 *
4 * Hardware definitions for TI OMAP1610 H4 board.
5 *
6 * Initial creation 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#ifndef __ASM_ARCH_OMAP_H4_H
30#define __ASM_ARCH_OMAP_H4_H
31
32/* Placeholder for H4 specific defines */
33
34#endif /* __ASM_ARCH_OMAP_H4_H */
35
diff --git a/include/asm-arm/arch-omap/board-innovator.h b/include/asm-arm/arch-omap/board-innovator.h
new file mode 100644
index 000000000000..0f1abaefe4de
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-innovator.h
@@ -0,0 +1,80 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-innovator.h
3 *
4 * Copyright (C) 2001 RidgeRun, Inc.
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#ifndef __ASM_ARCH_OMAP_INNOVATOR_H
27#define __ASM_ARCH_OMAP_INNOVATOR_H
28
29#if defined (CONFIG_ARCH_OMAP1510)
30
31#ifndef OMAP_SDRAM_DEVICE
32#define OMAP_SDRAM_DEVICE D256M_1X16_4B
33#endif
34
35#define OMAP1510P1_IMIF_PRI_VALUE 0x00
36#define OMAP1510P1_EMIFS_PRI_VALUE 0x00
37#define OMAP1510P1_EMIFF_PRI_VALUE 0x00
38
39/*
40 * These definitions define an area of FLASH set aside
41 * for the use of MTD/JFFS2. This is the area of flash
42 * that a JFFS2 filesystem will reside which is mounted
43 * at boot with the "root=/dev/mtdblock/0 rw"
44 * command line option. The flash address used here must
45 * fall within the legal range defined by rrload for storing
46 * the filesystem component. This address will be sufficiently
47 * deep into the overall flash range to avoid the other
48 * components also stored in flash such as the bootloader,
49 * the bootloader params, and the kernel.
50 * The SW2 settings for the map below are:
51 * 1 off, 2 off, 3 on, 4 off.
52 */
53
54/* Intel flash_0, partitioned as expected by rrload */
55#define OMAP_FLASH_0_BASE 0xD8000000
56#define OMAP_FLASH_0_START 0x00000000
57#define OMAP_FLASH_0_SIZE SZ_16M
58
59/* Intel flash_1, used for cramfs or other flash file systems */
60#define OMAP_FLASH_1_BASE 0xD9000000
61#define OMAP_FLASH_1_START 0x01000000
62#define OMAP_FLASH_1_SIZE SZ_16M
63
64#define NR_FPGA_IRQS 24
65#define NR_IRQS IH_BOARD_BASE + NR_FPGA_IRQS
66
67#ifndef __ASSEMBLY__
68void fpga_write(unsigned char val, int reg);
69unsigned char fpga_read(int reg);
70#endif
71
72#endif /* CONFIG_ARCH_OMAP1510 */
73
74#if defined (CONFIG_ARCH_OMAP16XX)
75
76/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
77#define INNOVATOR1610_ETHR_START 0x04000300
78
79#endif /* CONFIG_ARCH_OMAP1610 */
80#endif /* __ASM_ARCH_OMAP_INNOVATOR_H */
diff --git a/include/asm-arm/arch-omap/board-netstar.h b/include/asm-arm/arch-omap/board-netstar.h
new file mode 100644
index 000000000000..77cc0fb54d54
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-netstar.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz>
3 *
4 * Hardware definitions for OMAP5910 based NetStar board.
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#ifndef __ASM_ARCH_NETSTAR_H
12#define __ASM_ARCH_NETSTAR_H
13
14#include <asm/arch/tc.h>
15
16#define OMAP_NAND_FLASH_START1 OMAP_CS1_PHYS + (1 << 23)
17#define OMAP_NAND_FLASH_START2 OMAP_CS1_PHYS + (2 << 23)
18
19#endif /* __ASM_ARCH_NETSTAR_H */
diff --git a/include/asm-arm/arch-omap/board-osk.h b/include/asm-arm/arch-omap/board-osk.h
new file mode 100644
index 000000000000..aaa49a0fbd21
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-osk.h
@@ -0,0 +1,41 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-osk.h
3 *
4 * Hardware definitions for TI OMAP5912 OSK board.
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#ifndef __ASM_ARCH_OMAP_OSK_H
30#define __ASM_ARCH_OMAP_OSK_H
31
32/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
33#define OMAP_OSK_ETHR_START 0x04800300
34
35/* Micron NOR flash at CS3 mapped to address 0x0 if BM bit is 1 */
36#define OMAP_OSK_NOR_FLASH_BASE 0xD8000000
37#define OMAP_OSK_NOR_FLASH_SIZE SZ_32M
38#define OMAP_OSK_NOR_FLASH_START 0x00000000
39
40#endif /* __ASM_ARCH_OMAP_OSK_H */
41
diff --git a/include/asm-arm/arch-omap/board-perseus2.h b/include/asm-arm/arch-omap/board-perseus2.h
new file mode 100644
index 000000000000..0c224cc74fe4
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-perseus2.h
@@ -0,0 +1,58 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-perseus2.h
3 *
4 * Copyright 2003 by Texas Instruments Incorporated
5 * OMAP730 / Perseus2 support by Jean Pihet
6 *
7 * Copyright (C) 2001 RidgeRun, Inc. (http://www.ridgerun.com)
8 * Author: RidgeRun, 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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30#ifndef __ASM_ARCH_OMAP_PERSEUS2_H
31#define __ASM_ARCH_OMAP_PERSEUS2_H
32
33#include <asm/arch/fpga.h>
34
35#ifndef OMAP_SDRAM_DEVICE
36#define OMAP_SDRAM_DEVICE D256M_1X16_4B
37#endif
38
39/*
40 * These definitions define an area of FLASH set aside
41 * for the use of MTD/JFFS2. This is the area of flash
42 * that a JFFS2 filesystem will reside which is mounted
43 * at boot with the "root=/dev/mtdblock/0 rw"
44 * command line option.
45 */
46
47/* Intel flash_0, partitioned as expected by rrload */
48#define OMAP_FLASH_0_BASE 0xD8000000 /* VA */
49#define OMAP_FLASH_0_START 0x00000000 /* PA */
50#define OMAP_FLASH_0_SIZE SZ_32M
51
52#define MAXIRQNUM IH_BOARD_BASE
53#define MAXFIQNUM MAXIRQNUM
54#define MAXSWINUM MAXIRQNUM
55
56#define NR_IRQS (MAXIRQNUM + 1)
57
58#endif
diff --git a/include/asm-arm/arch-omap/board-voiceblue.h b/include/asm-arm/arch-omap/board-voiceblue.h
new file mode 100644
index 000000000000..33977b8956fb
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-voiceblue.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz>
3 *
4 * Hardware definitions for OMAP5910 based VoiceBlue board.
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#ifndef __ASM_ARCH_VOICEBLUE_H
12#define __ASM_ARCH_VOICEBLUE_H
13
14#if (EXTERNAL_MAX_NR_PORTS < 4)
15#undef EXTERNAL_MAX_NR_PORTS
16#define EXTERNAL_MAX_NR_PORTS 4
17#endif
18
19extern void voiceblue_wdt_enable(void);
20extern void voiceblue_wdt_disable(void);
21extern void voiceblue_wdt_ping(void);
22extern void voiceblue_reset(void);
23
24#endif /* __ASM_ARCH_VOICEBLUE_H */
25
diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h
new file mode 100644
index 000000000000..1cefd60b6f2a
--- /dev/null
+++ b/include/asm-arm/arch-omap/board.h
@@ -0,0 +1,126 @@
1/*
2 * linux/include/asm-arm/arch-omap/board.h
3 *
4 * Information structures for board-specific data
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
8 */
9
10#ifndef _OMAP_BOARD_H
11#define _OMAP_BOARD_H
12
13#include <linux/config.h>
14#include <linux/types.h>
15
16/* Different peripheral ids */
17#define OMAP_TAG_CLOCK 0x4f01
18#define OMAP_TAG_MMC 0x4f02
19#define OMAP_TAG_UART 0x4f03
20#define OMAP_TAG_USB 0x4f04
21#define OMAP_TAG_LCD 0x4f05
22#define OMAP_TAG_GPIO_SWITCH 0x4f06
23
24#define OMAP_TAG_BOOT_REASON 0x4f80
25#define OMAP_TAG_FLASH_PART 0x4f81
26
27struct omap_clock_config {
28 /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
29 u8 system_clock_type;
30};
31
32struct omap_mmc_config {
33 u8 mmc_blocks;
34 s16 mmc1_power_pin, mmc2_power_pin;
35 s16 mmc1_switch_pin, mmc2_switch_pin;
36};
37
38struct omap_uart_config {
39 u8 console_uart;
40 u32 console_speed;
41};
42
43struct omap_usb_config {
44 /* Configure drivers according to the connectors on your board:
45 * - "A" connector (rectagular)
46 * ... for host/OHCI use, set "register_host".
47 * - "B" connector (squarish) or "Mini-B"
48 * ... for device/gadget use, set "register_dev".
49 * - "Mini-AB" connector (very similar to Mini-B)
50 * ... for OTG use as device OR host, initialize "otg"
51 */
52 unsigned register_host:1;
53 unsigned register_dev:1;
54 u8 otg; /* port number, 1-based: usb1 == 2 */
55
56 u8 hmc_mode;
57
58 /* implicitly true if otg: host supports remote wakeup? */
59 u8 rwc;
60
61 /* signaling pins used to talk to transceiver on usbN:
62 * 0 == usbN unused
63 * 2 == usb0-only, using internal transceiver
64 * 3 == 3 wire bidirectional
65 * 4 == 4 wire bidirectional
66 * 6 == 6 wire unidirectional (or TLL)
67 */
68 u8 pins[3];
69};
70
71struct omap_lcd_config {
72 char panel_name[16];
73 char ctrl_name[16];
74};
75
76/* Cover:
77 * high -> closed
78 * low -> open
79 * Connection:
80 * high -> connected
81 * low -> disconnected
82 */
83#define OMAP_GPIO_SWITCH_TYPE_COVER 0x0000
84#define OMAP_GPIO_SWITCH_TYPE_CONNECTION 0x0001
85#define OMAP_GPIO_SWITCH_FLAG_INVERTED 0x0001
86struct omap_gpio_switch_config {
87 char name[12];
88 u16 gpio;
89 int flags:4;
90 int type:4;
91 int key_code:24; /* Linux key code */
92};
93
94struct omap_flash_part_config {
95 char part_table[0];
96};
97
98struct omap_boot_reason_config {
99 char reason_str[12];
100};
101
102
103struct omap_board_config_entry {
104 u16 tag;
105 u16 len;
106 u8 data[0];
107};
108
109struct omap_board_config_kernel {
110 u16 tag;
111 const void *data;
112};
113
114extern const void *__omap_get_config(u16 tag, size_t len, int nr);
115
116#define omap_get_config(tag, type) \
117 ((const type *) __omap_get_config((tag), sizeof(type), 0))
118#define omap_get_nr_config(tag, type, nr) \
119 ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
120
121extern const void *omap_get_var_config(u16 tag, size_t *len);
122
123extern struct omap_board_config_kernel *omap_board_config;
124extern int omap_board_config_size;
125
126#endif
diff --git a/include/asm-arm/arch-omap/cpu.h b/include/asm-arm/arch-omap/cpu.h
new file mode 100644
index 000000000000..e8786713ee5c
--- /dev/null
+++ b/include/asm-arm/arch-omap/cpu.h
@@ -0,0 +1,183 @@
1/*
2 * linux/include/asm-arm/arch-omap/cpu.h
3 *
4 * OMAP cpu type detection
5 *
6 * Copyright (C) 2004 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
26#ifndef __ASM_ARCH_OMAP_CPU_H
27#define __ASM_ARCH_OMAP_CPU_H
28
29extern unsigned int system_rev;
30
31#define OMAP_DIE_ID_0 0xfffe1800
32#define OMAP_DIE_ID_1 0xfffe1804
33#define OMAP_PRODUCTION_ID_0 0xfffe2000
34#define OMAP_PRODUCTION_ID_1 0xfffe2004
35#define OMAP32_ID_0 0xfffed400
36#define OMAP32_ID_1 0xfffed404
37
38/*
39 * Test if multicore OMAP support is needed
40 */
41#undef MULTI_OMAP
42#undef OMAP_NAME
43
44#ifdef CONFIG_ARCH_OMAP730
45# ifdef OMAP_NAME
46# undef MULTI_OMAP
47# define MULTI_OMAP
48# else
49# define OMAP_NAME omap730
50# endif
51#endif
52#ifdef CONFIG_ARCH_OMAP1510
53# ifdef OMAP_NAME
54# undef MULTI_OMAP
55# define MULTI_OMAP
56# else
57# define OMAP_NAME omap1510
58# endif
59#endif
60#ifdef CONFIG_ARCH_OMAP16XX
61# ifdef OMAP_NAME
62# undef MULTI_OMAP
63# define MULTI_OMAP
64# else
65# define OMAP_NAME omap1610
66# endif
67#endif
68#ifdef CONFIG_ARCH_OMAP16XX
69# ifdef OMAP_NAME
70# undef MULTI_OMAP
71# define MULTI_OMAP
72# else
73# define OMAP_NAME omap1710
74# endif
75#endif
76
77/*
78 * Generate various OMAP cpu specific macros, and cpu class
79 * specific macros
80 */
81#define GET_OMAP_TYPE ((system_rev >> 24) & 0xff)
82#define GET_OMAP_CLASS (system_rev & 0xff)
83
84#define IS_OMAP_TYPE(type, id) \
85static inline int is_omap ##type (void) \
86{ \
87 return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
88}
89
90#define IS_OMAP_CLASS(class, id) \
91static inline int is_omap ##class (void) \
92{ \
93 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
94}
95
96IS_OMAP_TYPE(730, 0x07)
97IS_OMAP_TYPE(1510, 0x15)
98IS_OMAP_TYPE(1610, 0x16)
99IS_OMAP_TYPE(5912, 0x16)
100IS_OMAP_TYPE(1710, 0x17)
101IS_OMAP_TYPE(2420, 0x24)
102
103IS_OMAP_CLASS(7xx, 0x07)
104IS_OMAP_CLASS(15xx, 0x15)
105IS_OMAP_CLASS(16xx, 0x16)
106IS_OMAP_CLASS(24xx, 0x24)
107
108/*
109 * Macros to group OMAP types into cpu classes.
110 * These can be used in most places.
111 * cpu_is_omap15xx(): True for 1510 and 5910
112 * cpu_is_omap16xx(): True for 1610, 5912 and 1710
113 */
114#if defined(MULTI_OMAP)
115# define cpu_is_omap7xx() is_omap7xx()
116# define cpu_is_omap15xx() is_omap15xx()
117# if !(defined(CONFIG_ARCH_OMAP1510) || defined(CONFIG_ARCH_OMAP730))
118# define cpu_is_omap16xx() 1
119# else
120# define cpu_is_omap16xx() is_omap16xx()
121# endif
122#else
123# if defined(CONFIG_ARCH_OMAP730)
124# define cpu_is_omap7xx() 1
125# else
126# define cpu_is_omap7xx() 0
127# endif
128# if defined(CONFIG_ARCH_OMAP1510)
129# define cpu_is_omap15xx() 1
130# else
131# define cpu_is_omap15xx() 0
132# endif
133# if defined(CONFIG_ARCH_OMAP16XX)
134# define cpu_is_omap16xx() 1
135# else
136# define cpu_is_omap16xx() 0
137# endif
138#endif
139
140#if defined(MULTI_OMAP)
141# define cpu_is_omap730() is_omap730()
142# define cpu_is_omap1510() is_omap1510()
143# define cpu_is_omap1610() is_omap1610()
144# define cpu_is_omap5912() is_omap5912()
145# define cpu_is_omap1710() is_omap1710()
146#else
147# if defined(CONFIG_ARCH_OMAP730)
148# define cpu_is_omap730() 1
149# else
150# define cpu_is_omap730() 0
151# endif
152# if defined(CONFIG_ARCH_OMAP1510)
153# define cpu_is_omap1510() 1
154# else
155# define cpu_is_omap1510() 0
156# endif
157# if defined(CONFIG_ARCH_OMAP16XX)
158# define cpu_is_omap1610() 1
159# else
160# define cpu_is_omap1610() 0
161# endif
162# if defined(CONFIG_ARCH_OMAP16XX)
163# define cpu_is_omap5912() 1
164# else
165# define cpu_is_omap5912() 0
166# endif
167# if defined(CONFIG_ARCH_OMAP16XX)
168# define cpu_is_omap1610() is_omap1610()
169# define cpu_is_omap5912() is_omap5912()
170# define cpu_is_omap1710() is_omap1710()
171# else
172# define cpu_is_omap1610() 0
173# define cpu_is_omap5912() 0
174# define cpu_is_omap1710() 0
175# endif
176# if defined(CONFIG_ARCH_OMAP2420)
177# define cpu_is_omap2420() 1
178# else
179# define cpu_is_omap2420() 0
180# endif
181#endif
182
183#endif
diff --git a/include/asm-arm/arch-omap/debug-macro.S b/include/asm-arm/arch-omap/debug-macro.S
new file mode 100644
index 000000000000..83bb458afd0b
--- /dev/null
+++ b/include/asm-arm/arch-omap/debug-macro.S
@@ -0,0 +1,45 @@
1/* linux/include/asm-arm/arch-omap/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled?
17 moveq \rx, #0xff000000 @ physical base address
18 movne \rx, #0xfe000000 @ virtual base
19 orr \rx, \rx, #0x00fb0000
20#ifdef CONFIG_OMAP_LL_DEBUG_UART3
21 orr \rx, \rx, #0x00009000 @ UART 3
22#endif
23#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
24 orr \rx, \rx, #0x00000800 @ UART 2 & 3
25#endif
26 .endm
27
28 .macro senduart,rd,rx
29 strb \rd, [\rx]
30 .endm
31
32 .macro busyuart,rd,rx
331001: ldrb \rd, [\rx, #(0x5 << 2)] @ OMAP-1510 and friends
34 and \rd, \rd, #0x60
35 teq \rd, #0x60
36 beq 1002f
37 ldrb \rd, [\rx, #(0x5 << 0)] @ OMAP-730 only
38 and \rd, \rd, #0x60
39 teq \rd, #0x60
40 bne 1001b
411002:
42 .endm
43
44 .macro waituart,rd,rx
45 .endm
diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h
new file mode 100644
index 000000000000..d785248377db
--- /dev/null
+++ b/include/asm-arm/arch-omap/dma.h
@@ -0,0 +1,264 @@
1/*
2 * linux/include/asm-arm/arch-omap/dma.h
3 *
4 * Copyright (C) 2003 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.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#ifndef __ASM_ARCH_DMA_H
22#define __ASM_ARCH_DMA_H
23
24#define MAX_DMA_ADDRESS 0xffffffff
25
26#define OMAP_LOGICAL_DMA_CH_COUNT 17
27
28#define OMAP_DMA_NO_DEVICE 0
29#define OMAP_DMA_MCSI1_TX 1
30#define OMAP_DMA_MCSI1_RX 2
31#define OMAP_DMA_I2C_RX 3
32#define OMAP_DMA_I2C_TX 4
33#define OMAP_DMA_EXT_NDMA_REQ 5
34#define OMAP_DMA_EXT_NDMA_REQ2 6
35#define OMAP_DMA_UWIRE_TX 7
36#define OMAP_DMA_MCBSP1_TX 8
37#define OMAP_DMA_MCBSP1_RX 9
38#define OMAP_DMA_MCBSP3_TX 10
39#define OMAP_DMA_MCBSP3_RX 11
40#define OMAP_DMA_UART1_TX 12
41#define OMAP_DMA_UART1_RX 13
42#define OMAP_DMA_UART2_TX 14
43#define OMAP_DMA_UART2_RX 15
44#define OMAP_DMA_MCBSP2_TX 16
45#define OMAP_DMA_MCBSP2_RX 17
46#define OMAP_DMA_UART3_TX 18
47#define OMAP_DMA_UART3_RX 19
48#define OMAP_DMA_CAMERA_IF_RX 20
49#define OMAP_DMA_MMC_TX 21
50#define OMAP_DMA_MMC_RX 22
51#define OMAP_DMA_NAND 23
52#define OMAP_DMA_IRQ_LCD_LINE 24
53#define OMAP_DMA_MEMORY_STICK 25
54#define OMAP_DMA_USB_W2FC_RX0 26
55#define OMAP_DMA_USB_W2FC_RX1 27
56#define OMAP_DMA_USB_W2FC_RX2 28
57#define OMAP_DMA_USB_W2FC_TX0 29
58#define OMAP_DMA_USB_W2FC_TX1 30
59#define OMAP_DMA_USB_W2FC_TX2 31
60
61/* These are only for 1610 */
62#define OMAP_DMA_CRYPTO_DES_IN 32
63#define OMAP_DMA_SPI_TX 33
64#define OMAP_DMA_SPI_RX 34
65#define OMAP_DMA_CRYPTO_HASH 35
66#define OMAP_DMA_CCP_ATTN 36
67#define OMAP_DMA_CCP_FIFO_NOT_EMPTY 37
68#define OMAP_DMA_CMT_APE_TX_CHAN_0 38
69#define OMAP_DMA_CMT_APE_RV_CHAN_0 39
70#define OMAP_DMA_CMT_APE_TX_CHAN_1 40
71#define OMAP_DMA_CMT_APE_RV_CHAN_1 41
72#define OMAP_DMA_CMT_APE_TX_CHAN_2 42
73#define OMAP_DMA_CMT_APE_RV_CHAN_2 43
74#define OMAP_DMA_CMT_APE_TX_CHAN_3 44
75#define OMAP_DMA_CMT_APE_RV_CHAN_3 45
76#define OMAP_DMA_CMT_APE_TX_CHAN_4 46
77#define OMAP_DMA_CMT_APE_RV_CHAN_4 47
78#define OMAP_DMA_CMT_APE_TX_CHAN_5 48
79#define OMAP_DMA_CMT_APE_RV_CHAN_5 49
80#define OMAP_DMA_CMT_APE_TX_CHAN_6 50
81#define OMAP_DMA_CMT_APE_RV_CHAN_6 51
82#define OMAP_DMA_CMT_APE_TX_CHAN_7 52
83#define OMAP_DMA_CMT_APE_RV_CHAN_7 53
84#define OMAP_DMA_MMC2_TX 54
85#define OMAP_DMA_MMC2_RX 55
86#define OMAP_DMA_CRYPTO_DES_OUT 56
87
88
89#define OMAP_DMA_BASE (0xfffed800)
90#define OMAP_DMA_GCR (OMAP_DMA_BASE + 0x400)
91#define OMAP_DMA_GSCR (OMAP_DMA_BASE + 0x404)
92#define OMAP_DMA_GRST (OMAP_DMA_BASE + 0x408)
93#define OMAP_DMA_HW_ID (OMAP_DMA_BASE + 0x442)
94#define OMAP_DMA_PCH2_ID (OMAP_DMA_BASE + 0x444)
95#define OMAP_DMA_PCH0_ID (OMAP_DMA_BASE + 0x446)
96#define OMAP_DMA_PCH1_ID (OMAP_DMA_BASE + 0x448)
97#define OMAP_DMA_PCHG_ID (OMAP_DMA_BASE + 0x44a)
98#define OMAP_DMA_PCHD_ID (OMAP_DMA_BASE + 0x44c)
99#define OMAP_DMA_CAPS_0_U (OMAP_DMA_BASE + 0x44e)
100#define OMAP_DMA_CAPS_0_L (OMAP_DMA_BASE + 0x450)
101#define OMAP_DMA_CAPS_1_U (OMAP_DMA_BASE + 0x452)
102#define OMAP_DMA_CAPS_1_L (OMAP_DMA_BASE + 0x454)
103#define OMAP_DMA_CAPS_2 (OMAP_DMA_BASE + 0x456)
104#define OMAP_DMA_CAPS_3 (OMAP_DMA_BASE + 0x458)
105#define OMAP_DMA_CAPS_4 (OMAP_DMA_BASE + 0x45a)
106#define OMAP_DMA_PCH2_SR (OMAP_DMA_BASE + 0x460)
107#define OMAP_DMA_PCH0_SR (OMAP_DMA_BASE + 0x480)
108#define OMAP_DMA_PCH1_SR (OMAP_DMA_BASE + 0x482)
109#define OMAP_DMA_PCHD_SR (OMAP_DMA_BASE + 0x4c0)
110
111#define OMAP1510_DMA_LCD_BASE (0xfffedb00)
112#define OMAP1510_DMA_LCD_CTRL (OMAP1510_DMA_LCD_BASE + 0x00)
113#define OMAP1510_DMA_LCD_TOP_F1_L (OMAP1510_DMA_LCD_BASE + 0x02)
114#define OMAP1510_DMA_LCD_TOP_F1_U (OMAP1510_DMA_LCD_BASE + 0x04)
115#define OMAP1510_DMA_LCD_BOT_F1_L (OMAP1510_DMA_LCD_BASE + 0x06)
116#define OMAP1510_DMA_LCD_BOT_F1_U (OMAP1510_DMA_LCD_BASE + 0x08)
117
118#define OMAP1610_DMA_LCD_BASE (0xfffee300)
119#define OMAP1610_DMA_LCD_CSDP (OMAP1610_DMA_LCD_BASE + 0xc0)
120#define OMAP1610_DMA_LCD_CCR (OMAP1610_DMA_LCD_BASE + 0xc2)
121#define OMAP1610_DMA_LCD_CTRL (OMAP1610_DMA_LCD_BASE + 0xc4)
122#define OMAP1610_DMA_LCD_TOP_B1_L (OMAP1610_DMA_LCD_BASE + 0xc8)
123#define OMAP1610_DMA_LCD_TOP_B1_U (OMAP1610_DMA_LCD_BASE + 0xca)
124#define OMAP1610_DMA_LCD_BOT_B1_L (OMAP1610_DMA_LCD_BASE + 0xcc)
125#define OMAP1610_DMA_LCD_BOT_B1_U (OMAP1610_DMA_LCD_BASE + 0xce)
126#define OMAP1610_DMA_LCD_TOP_B2_L (OMAP1610_DMA_LCD_BASE + 0xd0)
127#define OMAP1610_DMA_LCD_TOP_B2_U (OMAP1610_DMA_LCD_BASE + 0xd2)
128#define OMAP1610_DMA_LCD_BOT_B2_L (OMAP1610_DMA_LCD_BASE + 0xd4)
129#define OMAP1610_DMA_LCD_BOT_B2_U (OMAP1610_DMA_LCD_BASE + 0xd6)
130#define OMAP1610_DMA_LCD_SRC_EI_B1 (OMAP1610_DMA_LCD_BASE + 0xd8)
131#define OMAP1610_DMA_LCD_SRC_FI_B1_L (OMAP1610_DMA_LCD_BASE + 0xda)
132#define OMAP1610_DMA_LCD_SRC_EN_B1 (OMAP1610_DMA_LCD_BASE + 0xe0)
133#define OMAP1610_DMA_LCD_SRC_FN_B1 (OMAP1610_DMA_LCD_BASE + 0xe4)
134#define OMAP1610_DMA_LCD_LCH_CTRL (OMAP1610_DMA_LCD_BASE + 0xea)
135#define OMAP1610_DMA_LCD_SRC_FI_B1_U (OMAP1610_DMA_LCD_BASE + 0xf4)
136
137
138/* Every LCh has its own set of the registers below */
139#define OMAP_DMA_CSDP(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x00)
140#define OMAP_DMA_CCR(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x02)
141#define OMAP_DMA_CICR(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x04)
142#define OMAP_DMA_CSR(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x06)
143#define OMAP_DMA_CSSA_L(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x08)
144#define OMAP_DMA_CSSA_U(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x0a)
145#define OMAP_DMA_CDSA_L(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x0c)
146#define OMAP_DMA_CDSA_U(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x0e)
147#define OMAP_DMA_CEN(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x10)
148#define OMAP_DMA_CFN(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x12)
149#define OMAP_DMA_CSFI(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x14)
150#define OMAP_DMA_CSEI(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x16)
151#define OMAP_DMA_CSAC(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x18)
152#define OMAP_DMA_CDAC(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x1a)
153#define OMAP_DMA_CDEI(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x1c)
154#define OMAP_DMA_CDFI(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x1e)
155#define OMAP_DMA_COLOR_L(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x20)
156#define OMAP_DMA_COLOR_U(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x22)
157#define OMAP_DMA_CCR2(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x24)
158#define OMAP_DMA_CLNK_CTRL(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x28)
159#define OMAP_DMA_LCH_CTRL(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x2a)
160
161#define OMAP_DMA_TOUT_IRQ (1 << 0)
162#define OMAP_DMA_DROP_IRQ (1 << 1)
163#define OMAP_DMA_HALF_IRQ (1 << 2)
164#define OMAP_DMA_FRAME_IRQ (1 << 3)
165#define OMAP_DMA_LAST_IRQ (1 << 4)
166#define OMAP_DMA_BLOCK_IRQ (1 << 5)
167#define OMAP_DMA_SYNC_IRQ (1 << 6)
168
169#define OMAP_DMA_DATA_TYPE_S8 0x00
170#define OMAP_DMA_DATA_TYPE_S16 0x01
171#define OMAP_DMA_DATA_TYPE_S32 0x02
172
173#define OMAP_DMA_SYNC_ELEMENT 0x00
174#define OMAP_DMA_SYNC_FRAME 0x01
175#define OMAP_DMA_SYNC_BLOCK 0x02
176
177#define OMAP_DMA_PORT_EMIFF 0x00
178#define OMAP_DMA_PORT_EMIFS 0x01
179#define OMAP_DMA_PORT_OCP_T1 0x02
180#define OMAP_DMA_PORT_TIPB 0x03
181#define OMAP_DMA_PORT_OCP_T2 0x04
182#define OMAP_DMA_PORT_MPUI 0x05
183
184#define OMAP_DMA_AMODE_CONSTANT 0x00
185#define OMAP_DMA_AMODE_POST_INC 0x01
186#define OMAP_DMA_AMODE_SINGLE_IDX 0x02
187#define OMAP_DMA_AMODE_DOUBLE_IDX 0x03
188
189/* LCD DMA block numbers */
190enum {
191 OMAP_LCD_DMA_B1_TOP,
192 OMAP_LCD_DMA_B1_BOTTOM,
193 OMAP_LCD_DMA_B2_TOP,
194 OMAP_LCD_DMA_B2_BOTTOM
195};
196
197enum omap_dma_burst_mode {
198 OMAP_DMA_DATA_BURST_DIS = 0,
199 OMAP_DMA_DATA_BURST_4,
200 OMAP_DMA_DATA_BURST_8
201};
202
203enum omap_dma_color_mode {
204 OMAP_DMA_COLOR_DIS = 0,
205 OMAP_DMA_CONSTANT_FILL,
206 OMAP_DMA_TRANSPARENT_COPY
207};
208
209extern void omap_set_dma_priority(int dst_port, int priority);
210extern int omap_request_dma(int dev_id, const char *dev_name,
211 void (* callback)(int lch, u16 ch_status, void *data),
212 void *data, int *dma_ch);
213extern void omap_enable_dma_irq(int ch, u16 irq_bits);
214extern void omap_disable_dma_irq(int ch, u16 irq_bits);
215extern void omap_free_dma(int ch);
216extern void omap_start_dma(int lch);
217extern void omap_stop_dma(int lch);
218extern void omap_set_dma_transfer_params(int lch, int data_type,
219 int elem_count, int frame_count,
220 int sync_mode);
221extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode,
222 u32 color);
223
224extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
225 unsigned long src_start);
226extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
227extern void omap_set_dma_src_data_pack(int lch, int enable);
228extern void omap_set_dma_src_burst_mode(int lch,
229 enum omap_dma_burst_mode burst_mode);
230
231extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
232 unsigned long dest_start);
233extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
234extern void omap_set_dma_dest_data_pack(int lch, int enable);
235extern void omap_set_dma_dest_burst_mode(int lch,
236 enum omap_dma_burst_mode burst_mode);
237
238extern void omap_dma_link_lch (int lch_head, int lch_queue);
239extern void omap_dma_unlink_lch (int lch_head, int lch_queue);
240
241extern dma_addr_t omap_get_dma_src_pos(int lch);
242extern dma_addr_t omap_get_dma_dst_pos(int lch);
243extern void omap_clear_dma(int lch);
244
245/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */
246extern int omap_dma_in_1510_mode(void);
247
248/* LCD DMA functions */
249extern int omap_request_lcd_dma(void (* callback)(u16 status, void *data),
250 void *data);
251extern void omap_free_lcd_dma(void);
252extern void omap_setup_lcd_dma(void);
253extern void omap_enable_lcd_dma(void);
254extern void omap_stop_lcd_dma(void);
255extern void omap_set_lcd_dma_ext_controller(int external);
256extern void omap_set_lcd_dma_single_transfer(int single);
257extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
258 int data_type);
259extern void omap_set_lcd_dma_b1_rotation(int rotate);
260extern void omap_set_lcd_dma_b1_vxres(unsigned long vxres);
261extern void omap_set_lcd_dma_b1_mirror(int mirror);
262extern void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale);
263
264#endif /* __ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-omap/entry-macro.S b/include/asm-arm/arch-omap/entry-macro.S
new file mode 100644
index 000000000000..57b126889b98
--- /dev/null
+++ b/include/asm-arm/arch-omap/entry-macro.S
@@ -0,0 +1,32 @@
1/*
2 * include/asm-arm/arch-omap/entry-macro.S
3 *
4 * Low-level IRQ helper macros for OMAP-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11 .macro disable_fiq
12 .endm
13
14 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
15 ldr \base, =IO_ADDRESS(OMAP_IH1_BASE)
16 ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET]
17 ldr \tmp, [\base, #IRQ_MIR_REG_OFFSET]
18 mov \irqstat, #0xffffffff
19 bic \tmp, \irqstat, \tmp
20 tst \irqnr, \tmp
21 beq 1510f
22
23 ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
24 cmp \irqnr, #0
25 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
26 cmpeq \irqnr, #INT_IH2_IRQ
27 ldreq \base, =IO_ADDRESS(OMAP_IH2_BASE)
28 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
29 addeqs \irqnr, \irqnr, #32
301510:
31 .endm
32
diff --git a/include/asm-arm/arch-omap/fpga.h b/include/asm-arm/arch-omap/fpga.h
new file mode 100644
index 000000000000..676807dc50e1
--- /dev/null
+++ b/include/asm-arm/arch-omap/fpga.h
@@ -0,0 +1,196 @@
1/*
2 * linux/include/asm-arm/arch-omap/fpga.h
3 *
4 * Interrupt handler for OMAP-1510 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#ifndef __ASM_ARCH_OMAP_FPGA_H
20#define __ASM_ARCH_OMAP_FPGA_H
21
22#if defined(CONFIG_MACH_OMAP_INNOVATOR) && defined(CONFIG_ARCH_OMAP1510)
23extern void omap1510_fpga_init_irq(void);
24#else
25#define omap1510_fpga_init_irq() (0)
26#endif
27
28#define fpga_read(reg) __raw_readb(reg)
29#define fpga_write(val, reg) __raw_writeb(val, reg)
30
31/*
32 * ---------------------------------------------------------------------------
33 * H2/P2 Debug board FPGA
34 * ---------------------------------------------------------------------------
35 */
36/* maps in the FPGA registers and the ETHR registers */
37#define H2P2_DBG_FPGA_BASE 0xE8000000 /* VA */
38#define H2P2_DBG_FPGA_SIZE SZ_4K /* SIZE */
39#define H2P2_DBG_FPGA_START 0x04000000 /* PA */
40
41#define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300)
42#define H2P2_DBG_FPGA_FPGA_REV (H2P2_DBG_FPGA_BASE + 0x10) /* FPGA Revision */
43#define H2P2_DBG_FPGA_BOARD_REV (H2P2_DBG_FPGA_BASE + 0x12) /* Board Revision */
44#define H2P2_DBG_FPGA_GPIO (H2P2_DBG_FPGA_BASE + 0x14) /* GPIO outputs */
45#define H2P2_DBG_FPGA_LEDS (H2P2_DBG_FPGA_BASE + 0x16) /* LEDs outputs */
46#define H2P2_DBG_FPGA_MISC_INPUTS (H2P2_DBG_FPGA_BASE + 0x18) /* Misc inputs */
47#define H2P2_DBG_FPGA_LAN_STATUS (H2P2_DBG_FPGA_BASE + 0x1A) /* LAN Status line */
48#define H2P2_DBG_FPGA_LAN_RESET (H2P2_DBG_FPGA_BASE + 0x1C) /* LAN Reset line */
49
50/* NOTE: most boards don't have a static mapping for the FPGA ... */
51struct h2p2_dbg_fpga {
52 /* offset 0x00 */
53 u16 smc91x[8];
54 /* offset 0x10 */
55 u16 fpga_rev;
56 u16 board_rev;
57 u16 gpio_outputs;
58 u16 leds;
59 /* offset 0x18 */
60 u16 misc_inputs;
61 u16 lan_status;
62 u16 lan_reset;
63 u16 reserved0;
64 /* offset 0x20 */
65 u16 ps2_data;
66 u16 ps2_ctrl;
67 /* plus also 4 rs232 ports ... */
68};
69
70/* LEDs definition on debug board (16 LEDs, all physically green) */
71#define H2P2_DBG_FPGA_LED_GREEN (1 << 15)
72#define H2P2_DBG_FPGA_LED_AMBER (1 << 14)
73#define H2P2_DBG_FPGA_LED_RED (1 << 13)
74#define H2P2_DBG_FPGA_LED_BLUE (1 << 12)
75/* cpu0 load-meter LEDs */
76#define H2P2_DBG_FPGA_LOAD_METER (1 << 0) // A bit of fun on our board ...
77#define H2P2_DBG_FPGA_LOAD_METER_SIZE 11
78#define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1)
79
80
81/*
82 * ---------------------------------------------------------------------------
83 * OMAP-1510 FPGA
84 * ---------------------------------------------------------------------------
85 */
86#define OMAP1510_FPGA_BASE 0xE8000000 /* Virtual */
87#define OMAP1510_FPGA_SIZE SZ_4K
88#define OMAP1510_FPGA_START 0x08000000 /* Physical */
89
90/* Revision */
91#define OMAP1510_FPGA_REV_LOW (OMAP1510_FPGA_BASE + 0x0)
92#define OMAP1510_FPGA_REV_HIGH (OMAP1510_FPGA_BASE + 0x1)
93
94#define OMAP1510_FPGA_LCD_PANEL_CONTROL (OMAP1510_FPGA_BASE + 0x2)
95#define OMAP1510_FPGA_LED_DIGIT (OMAP1510_FPGA_BASE + 0x3)
96#define INNOVATOR_FPGA_HID_SPI (OMAP1510_FPGA_BASE + 0x4)
97#define OMAP1510_FPGA_POWER (OMAP1510_FPGA_BASE + 0x5)
98
99/* Interrupt status */
100#define OMAP1510_FPGA_ISR_LO (OMAP1510_FPGA_BASE + 0x6)
101#define OMAP1510_FPGA_ISR_HI (OMAP1510_FPGA_BASE + 0x7)
102
103/* Interrupt mask */
104#define OMAP1510_FPGA_IMR_LO (OMAP1510_FPGA_BASE + 0x8)
105#define OMAP1510_FPGA_IMR_HI (OMAP1510_FPGA_BASE + 0x9)
106
107/* Reset registers */
108#define OMAP1510_FPGA_HOST_RESET (OMAP1510_FPGA_BASE + 0xa)
109#define OMAP1510_FPGA_RST (OMAP1510_FPGA_BASE + 0xb)
110
111#define OMAP1510_FPGA_AUDIO (OMAP1510_FPGA_BASE + 0xc)
112#define OMAP1510_FPGA_DIP (OMAP1510_FPGA_BASE + 0xe)
113#define OMAP1510_FPGA_FPGA_IO (OMAP1510_FPGA_BASE + 0xf)
114#define OMAP1510_FPGA_UART1 (OMAP1510_FPGA_BASE + 0x14)
115#define OMAP1510_FPGA_UART2 (OMAP1510_FPGA_BASE + 0x15)
116#define OMAP1510_FPGA_OMAP1510_STATUS (OMAP1510_FPGA_BASE + 0x16)
117#define OMAP1510_FPGA_BOARD_REV (OMAP1510_FPGA_BASE + 0x18)
118#define OMAP1510P1_PPT_DATA (OMAP1510_FPGA_BASE + 0x100)
119#define OMAP1510P1_PPT_STATUS (OMAP1510_FPGA_BASE + 0x101)
120#define OMAP1510P1_PPT_CONTROL (OMAP1510_FPGA_BASE + 0x102)
121
122#define OMAP1510_FPGA_TOUCHSCREEN (OMAP1510_FPGA_BASE + 0x204)
123
124#define INNOVATOR_FPGA_INFO (OMAP1510_FPGA_BASE + 0x205)
125#define INNOVATOR_FPGA_LCD_BRIGHT_LO (OMAP1510_FPGA_BASE + 0x206)
126#define INNOVATOR_FPGA_LCD_BRIGHT_HI (OMAP1510_FPGA_BASE + 0x207)
127#define INNOVATOR_FPGA_LED_GRN_LO (OMAP1510_FPGA_BASE + 0x208)
128#define INNOVATOR_FPGA_LED_GRN_HI (OMAP1510_FPGA_BASE + 0x209)
129#define INNOVATOR_FPGA_LED_RED_LO (OMAP1510_FPGA_BASE + 0x20a)
130#define INNOVATOR_FPGA_LED_RED_HI (OMAP1510_FPGA_BASE + 0x20b)
131#define INNOVATOR_FPGA_CAM_USB_CONTROL (OMAP1510_FPGA_BASE + 0x20c)
132#define INNOVATOR_FPGA_EXP_CONTROL (OMAP1510_FPGA_BASE + 0x20d)
133#define INNOVATOR_FPGA_ISR2 (OMAP1510_FPGA_BASE + 0x20e)
134#define INNOVATOR_FPGA_IMR2 (OMAP1510_FPGA_BASE + 0x210)
135
136#define OMAP1510_FPGA_ETHR_START (OMAP1510_FPGA_START + 0x300)
137
138/*
139 * Power up Giga UART driver, turn on HID clock.
140 * Turn off BT power, since we're not using it and it
141 * draws power.
142 */
143#define OMAP1510_FPGA_RESET_VALUE 0x42
144
145#define OMAP1510_FPGA_PCR_IF_PD0 (1 << 7)
146#define OMAP1510_FPGA_PCR_COM2_EN (1 << 6)
147#define OMAP1510_FPGA_PCR_COM1_EN (1 << 5)
148#define OMAP1510_FPGA_PCR_EXP_PD0 (1 << 4)
149#define OMAP1510_FPGA_PCR_EXP_PD1 (1 << 3)
150#define OMAP1510_FPGA_PCR_48MHZ_CLK (1 << 2)
151#define OMAP1510_FPGA_PCR_4MHZ_CLK (1 << 1)
152#define OMAP1510_FPGA_PCR_RSRVD_BIT0 (1 << 0)
153
154/*
155 * Innovator/OMAP1510 FPGA HID register bit definitions
156 */
157#define OMAP1510_FPGA_HID_SCLK (1<<0) /* output */
158#define OMAP1510_FPGA_HID_MOSI (1<<1) /* output */
159#define OMAP1510_FPGA_HID_nSS (1<<2) /* output 0/1 chip idle/select */
160#define OMAP1510_FPGA_HID_nHSUS (1<<3) /* output 0/1 host active/suspended */
161#define OMAP1510_FPGA_HID_MISO (1<<4) /* input */
162#define OMAP1510_FPGA_HID_ATN (1<<5) /* input 0/1 chip idle/ATN */
163#define OMAP1510_FPGA_HID_rsrvd (1<<6)
164#define OMAP1510_FPGA_HID_RESETn (1<<7) /* output - 0/1 USAR reset/run */
165
166/* The FPGA IRQ is cascaded through GPIO_13 */
167#define OMAP1510_INT_FPGA (IH_GPIO_BASE + 13)
168
169/* IRQ Numbers for interrupts muxed through the FPGA */
170#define OMAP1510_IH_FPGA_BASE IH_BOARD_BASE
171#define OMAP1510_INT_FPGA_ATN (OMAP1510_IH_FPGA_BASE + 0)
172#define OMAP1510_INT_FPGA_ACK (OMAP1510_IH_FPGA_BASE + 1)
173#define OMAP1510_INT_FPGA2 (OMAP1510_IH_FPGA_BASE + 2)
174#define OMAP1510_INT_FPGA3 (OMAP1510_IH_FPGA_BASE + 3)
175#define OMAP1510_INT_FPGA4 (OMAP1510_IH_FPGA_BASE + 4)
176#define OMAP1510_INT_FPGA5 (OMAP1510_IH_FPGA_BASE + 5)
177#define OMAP1510_INT_FPGA6 (OMAP1510_IH_FPGA_BASE + 6)
178#define OMAP1510_INT_FPGA7 (OMAP1510_IH_FPGA_BASE + 7)
179#define OMAP1510_INT_FPGA8 (OMAP1510_IH_FPGA_BASE + 8)
180#define OMAP1510_INT_FPGA9 (OMAP1510_IH_FPGA_BASE + 9)
181#define OMAP1510_INT_FPGA10 (OMAP1510_IH_FPGA_BASE + 10)
182#define OMAP1510_INT_FPGA11 (OMAP1510_IH_FPGA_BASE + 11)
183#define OMAP1510_INT_FPGA12 (OMAP1510_IH_FPGA_BASE + 12)
184#define OMAP1510_INT_ETHER (OMAP1510_IH_FPGA_BASE + 13)
185#define OMAP1510_INT_FPGAUART1 (OMAP1510_IH_FPGA_BASE + 14)
186#define OMAP1510_INT_FPGAUART2 (OMAP1510_IH_FPGA_BASE + 15)
187#define OMAP1510_INT_FPGA_TS (OMAP1510_IH_FPGA_BASE + 16)
188#define OMAP1510_INT_FPGA17 (OMAP1510_IH_FPGA_BASE + 17)
189#define OMAP1510_INT_FPGA_CAM (OMAP1510_IH_FPGA_BASE + 18)
190#define OMAP1510_INT_FPGA_RTC_A (OMAP1510_IH_FPGA_BASE + 19)
191#define OMAP1510_INT_FPGA_RTC_B (OMAP1510_IH_FPGA_BASE + 20)
192#define OMAP1510_INT_FPGA_CD (OMAP1510_IH_FPGA_BASE + 21)
193#define OMAP1510_INT_FPGA22 (OMAP1510_IH_FPGA_BASE + 22)
194#define OMAP1510_INT_FPGA23 (OMAP1510_IH_FPGA_BASE + 23)
195
196#endif
diff --git a/include/asm-arm/arch-omap/gpio.h b/include/asm-arm/arch-omap/gpio.h
new file mode 100644
index 000000000000..fad2fc93ee70
--- /dev/null
+++ b/include/asm-arm/arch-omap/gpio.h
@@ -0,0 +1,69 @@
1/*
2 * linux/include/asm-arm/arch-omap/gpio.h
3 *
4 * OMAP GPIO handling defines and functions
5 *
6 * Copyright (C) 2003 Nokia Corporation
7 *
8 * Written by Juha Yrjölä <juha.yrjola@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
26#ifndef __ASM_ARCH_OMAP_GPIO_H
27#define __ASM_ARCH_OMAP_GPIO_H
28
29#include <asm/arch/hardware.h>
30#include <asm/arch/irqs.h>
31#include <asm/io.h>
32
33#define OMAP_MPUIO_BASE 0xfffb5000
34#define OMAP_MPUIO_INPUT_LATCH 0x00
35#define OMAP_MPUIO_OUTPUT 0x04
36#define OMAP_MPUIO_IO_CNTL 0x08
37#define OMAP_MPUIO_KBR_LATCH 0x10
38#define OMAP_MPUIO_KBC 0x14
39#define OMAP_MPUIO_GPIO_EVENT_MODE 0x18
40#define OMAP_MPUIO_GPIO_INT_EDGE 0x1c
41#define OMAP_MPUIO_KBD_INT 0x20
42#define OMAP_MPUIO_GPIO_INT 0x24
43#define OMAP_MPUIO_KBD_MASKIT 0x28
44#define OMAP_MPUIO_GPIO_MASKIT 0x2c
45#define OMAP_MPUIO_GPIO_DEBOUNCING 0x30
46#define OMAP_MPUIO_LATCH 0x34
47
48#define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr))
49#define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES)
50
51#define OMAP_GPIO_IRQ(nr) (OMAP_GPIO_IS_MPUIO(nr) ? \
52 IH_MPUIO_BASE + ((nr) & 0x0f) : \
53 IH_GPIO_BASE + ((nr) & 0x3f))
54
55/* For EDGECTRL */
56#define OMAP_GPIO_NO_EDGE 0x00
57#define OMAP_GPIO_FALLING_EDGE 0x01
58#define OMAP_GPIO_RISING_EDGE 0x02
59#define OMAP_GPIO_BOTH_EDGES 0x03
60
61extern int omap_gpio_init(void); /* Call from board init only */
62extern int omap_request_gpio(int gpio);
63extern void omap_free_gpio(int gpio);
64extern void omap_set_gpio_direction(int gpio, int is_input);
65extern void omap_set_gpio_dataout(int gpio, int enable);
66extern int omap_get_gpio_datain(int gpio);
67extern void omap_set_gpio_edge_ctrl(int gpio, int edge);
68
69#endif
diff --git a/include/asm-arm/arch-omap/hardware.h b/include/asm-arm/arch-omap/hardware.h
new file mode 100644
index 000000000000..37e06c782bdf
--- /dev/null
+++ b/include/asm-arm/arch-omap/hardware.h
@@ -0,0 +1,324 @@
1/*
2 * linux/include/asm-arm/arch-omap/hardware.h
3 *
4 * Hardware definitions for TI OMAP processors and boards
5 *
6 * NOTE: Please put device driver specific defines into a separate header
7 * file for each driver.
8 *
9 * Copyright (C) 2001 RidgeRun, Inc.
10 * Author: RidgeRun, Inc. Greg Lonnon <glonnon@ridgerun.com>
11 *
12 * Reorganized for Linux-2.6 by Tony Lindgren <tony@atomide.com>
13 * and Dirk Behme <dirk.behme@de.bosch.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#ifndef __ASM_ARCH_OMAP_HARDWARE_H
37#define __ASM_ARCH_OMAP_HARDWARE_H
38
39#include <asm/sizes.h>
40#include <linux/config.h>
41#ifndef __ASSEMBLER__
42#include <asm/types.h>
43#include <asm/arch/cpu.h>
44#endif
45#include <asm/arch/io.h>
46
47/*
48 * ---------------------------------------------------------------------------
49 * Common definitions for all OMAP processors
50 * NOTE: Put all processor or board specific parts to the special header
51 * files.
52 * ---------------------------------------------------------------------------
53 */
54
55/*
56 * ----------------------------------------------------------------------------
57 * Clocks
58 * ----------------------------------------------------------------------------
59 */
60#define CLKGEN_REG_BASE (0xfffece00)
61#define ARM_CKCTL (CLKGEN_REG_BASE + 0x0)
62#define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4)
63#define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8)
64#define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC)
65#define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10)
66#define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14)
67#define ARM_SYSST (CLKGEN_REG_BASE + 0x18)
68#define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24)
69
70#define CK_RATEF 1
71#define CK_IDLEF 2
72#define CK_ENABLEF 4
73#define CK_SELECTF 8
74#define SETARM_IDLE_SHIFT
75
76/* DPLL control registers */
77#define DPLL_CTL (0xfffecf00)
78
79/* DSP clock control */
80#define DSP_CONFIG_REG_BASE (0xe1008000)
81#define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4)
82#define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8)
83
84/*
85 * ---------------------------------------------------------------------------
86 * UPLD
87 * ---------------------------------------------------------------------------
88 */
89#define ULPD_REG_BASE (0xfffe0800)
90#define ULPD_IT_STATUS (ULPD_REG_BASE + 0x14)
91#define ULPD_CLOCK_CTRL (ULPD_REG_BASE + 0x30)
92# define DIS_USB_PVCI_CLK (1 << 5) /* no USB/FAC synch */
93# define USB_MCLK_EN (1 << 4) /* enable W4_USB_CLKO */
94#define ULPD_SOFT_REQ (ULPD_REG_BASE + 0x34)
95# define SOFT_UDC_REQ (1 << 4)
96# define SOFT_USB_CLK_REQ (1 << 3)
97# define SOFT_DPLL_REQ (1 << 0)
98#define ULPD_DPLL_CTRL (ULPD_REG_BASE + 0x3c)
99#define ULPD_STATUS_REQ (ULPD_REG_BASE + 0x40)
100#define ULPD_APLL_CTRL (ULPD_REG_BASE + 0x4c)
101#define ULPD_POWER_CTRL (ULPD_REG_BASE + 0x50)
102#define ULPD_SOFT_DISABLE_REQ_REG (ULPD_REG_BASE + 0x68)
103# define DIS_MMC2_DPLL_REQ (1 << 11)
104# define DIS_MMC1_DPLL_REQ (1 << 10)
105# define DIS_UART3_DPLL_REQ (1 << 9)
106# define DIS_UART2_DPLL_REQ (1 << 8)
107# define DIS_UART1_DPLL_REQ (1 << 7)
108# define DIS_USB_HOST_DPLL_REQ (1 << 6)
109#define ULPD_SDW_CLK_DIV_CTRL_SEL (ULPD_REG_BASE + 0x74)
110#define ULPD_CAM_CLK_CTRL (ULPD_REG_BASE + 0x7c)
111
112/*
113 * ---------------------------------------------------------------------------
114 * Watchdog timer
115 * ---------------------------------------------------------------------------
116 */
117
118/* Watchdog timer within the OMAP3.2 gigacell */
119#define OMAP_MPU_WATCHDOG_BASE (0xfffec800)
120#define OMAP_WDT_TIMER (OMAP_MPU_WATCHDOG_BASE + 0x0)
121#define OMAP_WDT_LOAD_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4)
122#define OMAP_WDT_READ_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4)
123#define OMAP_WDT_TIMER_MODE (OMAP_MPU_WATCHDOG_BASE + 0x8)
124
125/*
126 * ---------------------------------------------------------------------------
127 * Interrupts
128 * ---------------------------------------------------------------------------
129 */
130#define OMAP_IH1_BASE 0xfffecb00
131#define OMAP_IH2_BASE 0xfffe0000
132
133#define OMAP_IH1_ITR (OMAP_IH1_BASE + 0x00)
134#define OMAP_IH1_MIR (OMAP_IH1_BASE + 0x04)
135#define OMAP_IH1_SIR_IRQ (OMAP_IH1_BASE + 0x10)
136#define OMAP_IH1_SIR_FIQ (OMAP_IH1_BASE + 0x14)
137#define OMAP_IH1_CONTROL (OMAP_IH1_BASE + 0x18)
138#define OMAP_IH1_ILR0 (OMAP_IH1_BASE + 0x1c)
139#define OMAP_IH1_ISR (OMAP_IH1_BASE + 0x9c)
140
141#define OMAP_IH2_ITR (OMAP_IH2_BASE + 0x00)
142#define OMAP_IH2_MIR (OMAP_IH2_BASE + 0x04)
143#define OMAP_IH2_SIR_IRQ (OMAP_IH2_BASE + 0x10)
144#define OMAP_IH2_SIR_FIQ (OMAP_IH2_BASE + 0x14)
145#define OMAP_IH2_CONTROL (OMAP_IH2_BASE + 0x18)
146#define OMAP_IH2_ILR0 (OMAP_IH2_BASE + 0x1c)
147#define OMAP_IH2_ISR (OMAP_IH2_BASE + 0x9c)
148
149#define IRQ_ITR_REG_OFFSET 0x00
150#define IRQ_MIR_REG_OFFSET 0x04
151#define IRQ_SIR_IRQ_REG_OFFSET 0x10
152#define IRQ_SIR_FIQ_REG_OFFSET 0x14
153#define IRQ_CONTROL_REG_OFFSET 0x18
154#define IRQ_ISR_REG_OFFSET 0x9c
155#define IRQ_ILR0_REG_OFFSET 0x1c
156#define IRQ_GMR_REG_OFFSET 0xa0
157
158/*
159 * ----------------------------------------------------------------------------
160 * System control registers
161 * ----------------------------------------------------------------------------
162 */
163#define MOD_CONF_CTRL_0 0xfffe1080
164#define MOD_CONF_CTRL_1 0xfffe1110
165
166/*
167 * ----------------------------------------------------------------------------
168 * Pin multiplexing registers
169 * ----------------------------------------------------------------------------
170 */
171#define FUNC_MUX_CTRL_0 0xfffe1000
172#define FUNC_MUX_CTRL_1 0xfffe1004
173#define FUNC_MUX_CTRL_2 0xfffe1008
174#define COMP_MODE_CTRL_0 0xfffe100c
175#define FUNC_MUX_CTRL_3 0xfffe1010
176#define FUNC_MUX_CTRL_4 0xfffe1014
177#define FUNC_MUX_CTRL_5 0xfffe1018
178#define FUNC_MUX_CTRL_6 0xfffe101C
179#define FUNC_MUX_CTRL_7 0xfffe1020
180#define FUNC_MUX_CTRL_8 0xfffe1024
181#define FUNC_MUX_CTRL_9 0xfffe1028
182#define FUNC_MUX_CTRL_A 0xfffe102C
183#define FUNC_MUX_CTRL_B 0xfffe1030
184#define FUNC_MUX_CTRL_C 0xfffe1034
185#define FUNC_MUX_CTRL_D 0xfffe1038
186#define PULL_DWN_CTRL_0 0xfffe1040
187#define PULL_DWN_CTRL_1 0xfffe1044
188#define PULL_DWN_CTRL_2 0xfffe1048
189#define PULL_DWN_CTRL_3 0xfffe104c
190#define PULL_DWN_CTRL_4 0xfffe10ac
191
192/* OMAP-1610 specific multiplexing registers */
193#define FUNC_MUX_CTRL_E 0xfffe1090
194#define FUNC_MUX_CTRL_F 0xfffe1094
195#define FUNC_MUX_CTRL_10 0xfffe1098
196#define FUNC_MUX_CTRL_11 0xfffe109c
197#define FUNC_MUX_CTRL_12 0xfffe10a0
198#define PU_PD_SEL_0 0xfffe10b4
199#define PU_PD_SEL_1 0xfffe10b8
200#define PU_PD_SEL_2 0xfffe10bc
201#define PU_PD_SEL_3 0xfffe10c0
202#define PU_PD_SEL_4 0xfffe10c4
203
204/* Timer32K for 1610 and 1710*/
205#define OMAP_TIMER32K_BASE 0xFFFBC400
206
207/*
208 * ---------------------------------------------------------------------------
209 * TIPB bus interface
210 * ---------------------------------------------------------------------------
211 */
212#define TIPB_PUBLIC_CNTL_BASE 0xfffed300
213#define MPU_PUBLIC_TIPB_CNTL (TIPB_PUBLIC_CNTL_BASE + 0x8)
214#define TIPB_PRIVATE_CNTL_BASE 0xfffeca00
215#define MPU_PRIVATE_TIPB_CNTL (TIPB_PRIVATE_CNTL_BASE + 0x8)
216
217/*
218 * ----------------------------------------------------------------------------
219 * MPUI interface
220 * ----------------------------------------------------------------------------
221 */
222#define MPUI_BASE (0xfffec900)
223#define MPUI_CTRL (MPUI_BASE + 0x0)
224#define MPUI_DEBUG_ADDR (MPUI_BASE + 0x4)
225#define MPUI_DEBUG_DATA (MPUI_BASE + 0x8)
226#define MPUI_DEBUG_FLAG (MPUI_BASE + 0xc)
227#define MPUI_STATUS_REG (MPUI_BASE + 0x10)
228#define MPUI_DSP_STATUS (MPUI_BASE + 0x14)
229#define MPUI_DSP_BOOT_CONFIG (MPUI_BASE + 0x18)
230#define MPUI_DSP_API_CONFIG (MPUI_BASE + 0x1c)
231
232/*
233 * ----------------------------------------------------------------------------
234 * LED Pulse Generator
235 * ----------------------------------------------------------------------------
236 */
237#define OMAP_LPG1_BASE 0xfffbd000
238#define OMAP_LPG2_BASE 0xfffbd800
239#define OMAP_LPG1_LCR (OMAP_LPG1_BASE + 0x00)
240#define OMAP_LPG1_PMR (OMAP_LPG1_BASE + 0x04)
241#define OMAP_LPG2_LCR (OMAP_LPG2_BASE + 0x00)
242#define OMAP_LPG2_PMR (OMAP_LPG2_BASE + 0x04)
243
244#ifndef __ASSEMBLER__
245
246/*
247 * ---------------------------------------------------------------------------
248 * Serial ports
249 * ---------------------------------------------------------------------------
250 */
251#define OMAP_UART1_BASE (unsigned char *)0xfffb0000
252#define OMAP_UART2_BASE (unsigned char *)0xfffb0800
253#define OMAP_UART3_BASE (unsigned char *)0xfffb9800
254#define OMAP_MAX_NR_PORTS 3
255#define OMAP1510_BASE_BAUD (12000000/16)
256#define OMAP16XX_BASE_BAUD (48000000/16)
257
258#define is_omap_port(p) ({int __ret = 0; \
259 if (p == IO_ADDRESS(OMAP_UART1_BASE) || \
260 p == IO_ADDRESS(OMAP_UART2_BASE) || \
261 p == IO_ADDRESS(OMAP_UART3_BASE)) \
262 __ret = 1; \
263 __ret; \
264 })
265
266/*
267 * ---------------------------------------------------------------------------
268 * Processor specific defines
269 * ---------------------------------------------------------------------------
270 */
271#ifdef CONFIG_ARCH_OMAP730
272#include "omap730.h"
273#endif
274
275#ifdef CONFIG_ARCH_OMAP1510
276#include "omap1510.h"
277#endif
278
279#ifdef CONFIG_ARCH_OMAP16XX
280#include "omap16xx.h"
281#endif
282
283/*
284 * ---------------------------------------------------------------------------
285 * Board specific defines
286 * ---------------------------------------------------------------------------
287 */
288
289#ifdef CONFIG_MACH_OMAP_INNOVATOR
290#include "board-innovator.h"
291#endif
292
293#ifdef CONFIG_MACH_OMAP_H2
294#include "board-h2.h"
295#endif
296
297#ifdef CONFIG_MACH_OMAP_PERSEUS2
298#include "board-perseus2.h"
299#endif
300
301#ifdef CONFIG_MACH_OMAP_H3
302#include "board-h3.h"
303#endif
304
305#ifdef CONFIG_MACH_OMAP_H4
306#include "board-h4.h"
307#error "Support for H4 board not yet implemented."
308#endif
309
310#ifdef CONFIG_MACH_OMAP_OSK
311#include "board-osk.h"
312#endif
313
314#ifdef CONFIG_MACH_VOICEBLUE
315#include "board-voiceblue.h"
316#endif
317
318#ifdef CONFIG_MACH_NETSTAR
319#include "board-netstar.h"
320#endif
321
322#endif /* !__ASSEMBLER__ */
323
324#endif /* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h
new file mode 100644
index 000000000000..1c8c9fcc766e
--- /dev/null
+++ b/include/asm-arm/arch-omap/io.h
@@ -0,0 +1,107 @@
1/*
2 * linux/include/asm-arm/arch-omap/io.h
3 *
4 * IO definitions for TI OMAP processors and boards
5 *
6 * Copied from linux/include/asm-arm/arch-sa1100/io.h
7 * Copyright (C) 1997-1999 Russell King
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 *
29 * Modifications:
30 * 06-12-1997 RMK Created.
31 * 07-04-1999 RMK Major cleanup
32 */
33
34#ifndef __ASM_ARM_ARCH_IO_H
35#define __ASM_ARM_ARCH_IO_H
36
37#define IO_SPACE_LIMIT 0xffffffff
38
39/*
40 * We don't actually have real ISA nor PCI buses, but there is so many
41 * drivers out there that might just work if we fake them...
42 */
43#define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
44#define __mem_pci(a) (a)
45#define __mem_isa(a) (a)
46
47/*
48 * ----------------------------------------------------------------------------
49 * I/O mapping
50 * ----------------------------------------------------------------------------
51 */
52#define IO_PHYS 0xFFFB0000
53#define IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */
54#define IO_VIRT (IO_PHYS - IO_OFFSET)
55#define IO_SIZE 0x40000
56#define IO_ADDRESS(x) ((x) - IO_OFFSET)
57
58#define PCIO_BASE 0
59
60#define io_p2v(x) ((x) - IO_OFFSET)
61#define io_v2p(x) ((x) + IO_OFFSET)
62
63#ifndef __ASSEMBLER__
64
65/*
66 * Functions to access the OMAP IO region
67 *
68 * NOTE: - Use omap_read/write[bwl] for physical register addresses
69 * - Use __raw_read/write[bwl]() for virtual register addresses
70 * - Use IO_ADDRESS(phys_addr) to convert registers to virtual addresses
71 * - DO NOT use hardcoded virtual addresses to allow changing the
72 * IO address space again if needed
73 */
74#define omap_readb(a) (*(volatile unsigned char *)IO_ADDRESS(a))
75#define omap_readw(a) (*(volatile unsigned short *)IO_ADDRESS(a))
76#define omap_readl(a) (*(volatile unsigned int *)IO_ADDRESS(a))
77
78#define omap_writeb(v,a) (*(volatile unsigned char *)IO_ADDRESS(a) = (v))
79#define omap_writew(v,a) (*(volatile unsigned short *)IO_ADDRESS(a) = (v))
80#define omap_writel(v,a) (*(volatile unsigned int *)IO_ADDRESS(a) = (v))
81
82/* 16 bit uses LDRH/STRH, base +/- offset_8 */
83typedef struct { volatile u16 offset[256]; } __regbase16;
84#define __REGV16(vaddr) ((__regbase16 *)((vaddr)&~0xff)) \
85 ->offset[((vaddr)&0xff)>>1]
86#define __REG16(paddr) __REGV16(io_p2v(paddr))
87
88/* 8/32 bit uses LDR/STR, base +/- offset_12 */
89typedef struct { volatile u8 offset[4096]; } __regbase8;
90#define __REGV8(vaddr) ((__regbase8 *)((vaddr)&~4095)) \
91 ->offset[((vaddr)&4095)>>0]
92#define __REG8(paddr) __REGV8(io_p2v(paddr))
93
94typedef struct { volatile u32 offset[4096]; } __regbase32;
95#define __REGV32(vaddr) ((__regbase32 *)((vaddr)&~4095)) \
96 ->offset[((vaddr)&4095)>>2]
97#define __REG32(paddr) __REGV32(io_p2v(paddr))
98
99#else
100
101#define __REG8(paddr) io_p2v(paddr)
102#define __REG16(paddr) io_p2v(paddr)
103#define __REG32(paddr) io_p2v(paddr)
104
105#endif
106
107#endif
diff --git a/include/asm-arm/arch-omap/irqs.h b/include/asm-arm/arch-omap/irqs.h
new file mode 100644
index 000000000000..6701fd9e5f9b
--- /dev/null
+++ b/include/asm-arm/arch-omap/irqs.h
@@ -0,0 +1,255 @@
1/*
2 * linux/include/asm-arm/arch-omap/irqs.h
3 *
4 * Copyright (C) Greg Lonnon 2001
5 * Updated for OMAP-1610 by Tony Lindgren <tony@atomide.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 * NOTE: The interrupt vectors for the OMAP-1509, OMAP-1510, and OMAP-1610
22 * are different.
23 */
24
25#ifndef __ASM_ARCH_OMAP1510_IRQS_H
26#define __ASM_ARCH_OMAP1510_IRQS_H
27
28/*
29 * IRQ numbers for interrupt handler 1
30 *
31 * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below
32 *
33 */
34#define INT_IH2_IRQ 0
35#define INT_CAMERA 1
36#define INT_FIQ 3
37#define INT_RTDX 6
38#define INT_DSP_MMU_ABORT 7
39#define INT_HOST 8
40#define INT_ABORT 9
41#define INT_DSP_MAILBOX1 10
42#define INT_DSP_MAILBOX2 11
43#define INT_BRIDGE_PRIV 13
44#define INT_GPIO_BANK1 14
45#define INT_UART3 15
46#define INT_TIMER3 16
47#define INT_DMA_CH0_6 19
48#define INT_DMA_CH1_7 20
49#define INT_DMA_CH2_8 21
50#define INT_DMA_CH3 22
51#define INT_DMA_CH4 23
52#define INT_DMA_CH5 24
53#define INT_DMA_LCD 25
54#define INT_TIMER1 26
55#define INT_WD_TIMER 27
56#define INT_BRIDGE_PUB 28
57#define INT_TIMER2 30
58#define INT_LCD_CTRL 31
59
60/*
61 * OMAP-1510 specific IRQ numbers for interrupt handler 1
62 */
63#define INT_1510_RES2 2
64#define INT_1510_SPI_TX 4
65#define INT_1510_SPI_RX 5
66#define INT_1510_RES12 12
67#define INT_1510_LB_MMU 17
68#define INT_1510_RES18 18
69#define INT_1510_LOCAL_BUS 29
70
71/*
72 * OMAP-1610 specific IRQ numbers for interrupt handler 1
73 */
74#define INT_1610_IH2_FIQ 2
75#define INT_1610_McBSP2_TX 4
76#define INT_1610_McBSP2_RX 5
77#define INT_1610_LCD_LINE 12
78#define INT_1610_GPTIMER1 17
79#define INT_1610_GPTIMER2 18
80#define INT_1610_SSR_FIFO_0 29
81
82/*
83 * OMAP-730 specific IRQ numbers for interrupt handler 1
84 */
85#define INT_730_IH2_FIQ 0
86#define INT_730_IH2_IRQ 1
87#define INT_730_USB_NON_ISO 2
88#define INT_730_USB_ISO 3
89#define INT_730_ICR 4
90#define INT_730_EAC 5
91#define INT_730_GPIO_BANK1 6
92#define INT_730_GPIO_BANK2 7
93#define INT_730_GPIO_BANK3 8
94#define INT_730_McBSP2TX 10
95#define INT_730_McBSP2RX 11
96#define INT_730_McBSP2RX_OVF 12
97#define INT_730_LCD_LINE 14
98#define INT_730_GSM_PROTECT 15
99#define INT_730_TIMER3 16
100#define INT_730_GPIO_BANK5 17
101#define INT_730_GPIO_BANK6 18
102#define INT_730_SPGIO_WR 29
103
104/*
105 * IRQ numbers for interrupt handler 2
106 *
107 * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below
108 */
109#define IH2_BASE 32
110
111#define INT_KEYBOARD (1 + IH2_BASE)
112#define INT_uWireTX (2 + IH2_BASE)
113#define INT_uWireRX (3 + IH2_BASE)
114#define INT_I2C (4 + IH2_BASE)
115#define INT_MPUIO (5 + IH2_BASE)
116#define INT_USB_HHC_1 (6 + IH2_BASE)
117#define INT_McBSP3TX (10 + IH2_BASE)
118#define INT_McBSP3RX (11 + IH2_BASE)
119#define INT_McBSP1TX (12 + IH2_BASE)
120#define INT_McBSP1RX (13 + IH2_BASE)
121#define INT_UART1 (14 + IH2_BASE)
122#define INT_UART2 (15 + IH2_BASE)
123#define INT_BT_MCSI1TX (16 + IH2_BASE)
124#define INT_BT_MCSI1RX (17 + IH2_BASE)
125#define INT_USB_W2FC (20 + IH2_BASE)
126#define INT_1WIRE (21 + IH2_BASE)
127#define INT_OS_TIMER (22 + IH2_BASE)
128#define INT_MMC (23 + IH2_BASE)
129#define INT_GAUGE_32K (24 + IH2_BASE)
130#define INT_RTC_TIMER (25 + IH2_BASE)
131#define INT_RTC_ALARM (26 + IH2_BASE)
132#define INT_MEM_STICK (27 + IH2_BASE)
133#define INT_DSP_MMU (28 + IH2_BASE)
134
135/*
136 * OMAP-1510 specific IRQ numbers for interrupt handler 2
137 */
138#define INT_1510_OS_32kHz_TIMER (22 + IH2_BASE)
139#define INT_1510_COM_SPI_RO (31 + IH2_BASE)
140
141/*
142 * OMAP-1610 specific IRQ numbers for interrupt handler 2
143 */
144#define INT_1610_FAC (0 + IH2_BASE)
145#define INT_1610_USB_HHC_2 (7 + IH2_BASE)
146#define INT_1610_USB_OTG (8 + IH2_BASE)
147#define INT_1610_SoSSI (9 + IH2_BASE)
148#define INT_1610_SoSSI_MATCH (19 + IH2_BASE)
149#define INT_1610_McBSP2RX_OF (31 + IH2_BASE)
150#define INT_1610_STI (32 + IH2_BASE)
151#define INT_1610_STI_WAKEUP (33 + IH2_BASE)
152#define INT_1610_GPTIMER3 (34 + IH2_BASE)
153#define INT_1610_GPTIMER4 (35 + IH2_BASE)
154#define INT_1610_GPTIMER5 (36 + IH2_BASE)
155#define INT_1610_GPTIMER6 (37 + IH2_BASE)
156#define INT_1610_GPTIMER7 (38 + IH2_BASE)
157#define INT_1610_GPTIMER8 (39 + IH2_BASE)
158#define INT_1610_GPIO_BANK2 (40 + IH2_BASE)
159#define INT_1610_GPIO_BANK3 (41 + IH2_BASE)
160#define INT_1610_MMC2 (42 + IH2_BASE)
161#define INT_1610_CF (43 + IH2_BASE)
162#define INT_1610_GPIO_BANK4 (48 + IH2_BASE)
163#define INT_1610_SPI (49 + IH2_BASE)
164#define INT_1610_DMA_CH6 (53 + IH2_BASE)
165#define INT_1610_DMA_CH7 (54 + IH2_BASE)
166#define INT_1610_DMA_CH8 (55 + IH2_BASE)
167#define INT_1610_DMA_CH9 (56 + IH2_BASE)
168#define INT_1610_DMA_CH10 (57 + IH2_BASE)
169#define INT_1610_DMA_CH11 (58 + IH2_BASE)
170#define INT_1610_DMA_CH12 (59 + IH2_BASE)
171#define INT_1610_DMA_CH13 (60 + IH2_BASE)
172#define INT_1610_DMA_CH14 (61 + IH2_BASE)
173#define INT_1610_DMA_CH15 (62 + IH2_BASE)
174#define INT_1610_NAND (63 + IH2_BASE)
175
176/*
177 * OMAP-730 specific IRQ numbers for interrupt handler 2
178 */
179#define INT_730_HW_ERRORS (0 + IH2_BASE)
180#define INT_730_NFIQ_PWR_FAIL (1 + IH2_BASE)
181#define INT_730_CFCD (2 + IH2_BASE)
182#define INT_730_CFIREQ (3 + IH2_BASE)
183#define INT_730_I2C (4 + IH2_BASE)
184#define INT_730_PCC (5 + IH2_BASE)
185#define INT_730_MPU_EXT_NIRQ (6 + IH2_BASE)
186#define INT_730_SPI_100K_1 (7 + IH2_BASE)
187#define INT_730_SYREN_SPI (8 + IH2_BASE)
188#define INT_730_VLYNQ (9 + IH2_BASE)
189#define INT_730_GPIO_BANK4 (10 + IH2_BASE)
190#define INT_730_McBSP1TX (11 + IH2_BASE)
191#define INT_730_McBSP1RX (12 + IH2_BASE)
192#define INT_730_McBSP1RX_OF (13 + IH2_BASE)
193#define INT_730_UART_MODEM_IRDA_2 (14 + IH2_BASE)
194#define INT_730_UART_MODEM_1 (15 + IH2_BASE)
195#define INT_730_MCSI (16 + IH2_BASE)
196#define INT_730_uWireTX (17 + IH2_BASE)
197#define INT_730_uWireRX (18 + IH2_BASE)
198#define INT_730_SMC_CD (19 + IH2_BASE)
199#define INT_730_SMC_IREQ (20 + IH2_BASE)
200#define INT_730_HDQ_1WIRE (21 + IH2_BASE)
201#define INT_730_TIMER32K (22 + IH2_BASE)
202#define INT_730_MMC_SDIO (23 + IH2_BASE)
203#define INT_730_UPLD (24 + IH2_BASE)
204#define INT_730_USB_HHC_1 (27 + IH2_BASE)
205#define INT_730_USB_HHC_2 (28 + IH2_BASE)
206#define INT_730_USB_GENI (29 + IH2_BASE)
207#define INT_730_USB_OTG (30 + IH2_BASE)
208#define INT_730_CAMERA_IF (31 + IH2_BASE)
209#define INT_730_RNG (32 + IH2_BASE)
210#define INT_730_DUAL_MODE_TIMER (33 + IH2_BASE)
211#define INT_730_DBB_RF_EN (34 + IH2_BASE)
212#define INT_730_MPUIO_KEYPAD (35 + IH2_BASE)
213#define INT_730_SHA1_MD5 (36 + IH2_BASE)
214#define INT_730_SPI_100K_2 (37 + IH2_BASE)
215#define INT_730_RNG_IDLE (38 + IH2_BASE)
216#define INT_730_MPUIO (39 + IH2_BASE)
217#define INT_730_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE)
218#define INT_730_LLPC_OE_FALLING (41 + IH2_BASE)
219#define INT_730_LLPC_OE_RISING (42 + IH2_BASE)
220#define INT_730_LLPC_VSYNC (43 + IH2_BASE)
221#define INT_730_WAKE_UP_REQ (46 + IH2_BASE)
222#define INT_730_DMA_CH6 (53 + IH2_BASE)
223#define INT_730_DMA_CH7 (54 + IH2_BASE)
224#define INT_730_DMA_CH8 (55 + IH2_BASE)
225#define INT_730_DMA_CH9 (56 + IH2_BASE)
226#define INT_730_DMA_CH10 (57 + IH2_BASE)
227#define INT_730_DMA_CH11 (58 + IH2_BASE)
228#define INT_730_DMA_CH12 (59 + IH2_BASE)
229#define INT_730_DMA_CH13 (60 + IH2_BASE)
230#define INT_730_DMA_CH14 (61 + IH2_BASE)
231#define INT_730_DMA_CH15 (62 + IH2_BASE)
232#define INT_730_NAND (63 + IH2_BASE)
233
234/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and
235 * 16 MPUIO lines */
236#define OMAP_MAX_GPIO_LINES 192
237#define IH_GPIO_BASE (128 + IH2_BASE)
238#define IH_MPUIO_BASE (OMAP_MAX_GPIO_LINES + IH_GPIO_BASE)
239#define IH_BOARD_BASE (16 + IH_MPUIO_BASE)
240
241#ifndef __ASSEMBLY__
242extern void omap_init_irq(void);
243#endif
244
245/*
246 * The definition of NR_IRQS is in board-specific header file, which is
247 * included via hardware.h
248 */
249#include <asm/arch/hardware.h>
250
251#ifndef NR_IRQS
252#define NR_IRQS IH_BOARD_BASE
253#endif
254
255#endif
diff --git a/include/asm-arm/arch-omap/mcbsp.h b/include/asm-arm/arch-omap/mcbsp.h
new file mode 100644
index 000000000000..305bdeb16ab8
--- /dev/null
+++ b/include/asm-arm/arch-omap/mcbsp.h
@@ -0,0 +1,257 @@
1/*
2 * linux/include/asm-arm/arch-omap/gpio.h
3 *
4 * Defines for Multi-Channel Buffered Serial Port
5 *
6 * Copyright (C) 2002 RidgeRun, Inc.
7 * Author: Steve Johnson
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#ifndef __ASM_ARCH_OMAP_MCBSP_H
25#define __ASM_ARCH_OMAP_MCBSP_H
26
27#include <asm/arch/hardware.h>
28
29#define OMAP730_MCBSP1_BASE 0xfffb1000
30#define OMAP730_MCBSP2_BASE 0xfffb1800
31
32#define OMAP1510_MCBSP1_BASE 0xe1011800
33#define OMAP1510_MCBSP2_BASE 0xfffb1000
34#define OMAP1510_MCBSP3_BASE 0xe1017000
35
36#define OMAP1610_MCBSP1_BASE 0xe1011800
37#define OMAP1610_MCBSP2_BASE 0xfffb1000
38#define OMAP1610_MCBSP3_BASE 0xe1017000
39
40#define OMAP_MCBSP_REG_DRR2 0x00
41#define OMAP_MCBSP_REG_DRR1 0x02
42#define OMAP_MCBSP_REG_DXR2 0x04
43#define OMAP_MCBSP_REG_DXR1 0x06
44#define OMAP_MCBSP_REG_SPCR2 0x08
45#define OMAP_MCBSP_REG_SPCR1 0x0a
46#define OMAP_MCBSP_REG_RCR2 0x0c
47#define OMAP_MCBSP_REG_RCR1 0x0e
48#define OMAP_MCBSP_REG_XCR2 0x10
49#define OMAP_MCBSP_REG_XCR1 0x12
50#define OMAP_MCBSP_REG_SRGR2 0x14
51#define OMAP_MCBSP_REG_SRGR1 0x16
52#define OMAP_MCBSP_REG_MCR2 0x18
53#define OMAP_MCBSP_REG_MCR1 0x1a
54#define OMAP_MCBSP_REG_RCERA 0x1c
55#define OMAP_MCBSP_REG_RCERB 0x1e
56#define OMAP_MCBSP_REG_XCERA 0x20
57#define OMAP_MCBSP_REG_XCERB 0x22
58#define OMAP_MCBSP_REG_PCR0 0x24
59#define OMAP_MCBSP_REG_RCERC 0x26
60#define OMAP_MCBSP_REG_RCERD 0x28
61#define OMAP_MCBSP_REG_XCERC 0x2A
62#define OMAP_MCBSP_REG_XCERD 0x2C
63#define OMAP_MCBSP_REG_RCERE 0x2E
64#define OMAP_MCBSP_REG_RCERF 0x30
65#define OMAP_MCBSP_REG_XCERE 0x32
66#define OMAP_MCBSP_REG_XCERF 0x34
67#define OMAP_MCBSP_REG_RCERG 0x36
68#define OMAP_MCBSP_REG_RCERH 0x38
69#define OMAP_MCBSP_REG_XCERG 0x3A
70#define OMAP_MCBSP_REG_XCERH 0x3C
71
72#define OMAP_MAX_MCBSP_COUNT 3
73
74#define OMAP_MCBSP_READ(base, reg) __raw_readw((base) + OMAP_MCBSP_REG_##reg)
75#define OMAP_MCBSP_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MCBSP_REG_##reg)
76
77/************************** McBSP SPCR1 bit definitions ***********************/
78#define RRST 0x0001
79#define RRDY 0x0002
80#define RFULL 0x0004
81#define RSYNC_ERR 0x0008
82#define RINTM(value) ((value)<<4) /* bits 4:5 */
83#define ABIS 0x0040
84#define DXENA 0x0080
85#define CLKSTP(value) ((value)<<11) /* bits 11:12 */
86#define RJUST(value) ((value)<<13) /* bits 13:14 */
87#define DLB 0x8000
88
89/************************** McBSP SPCR2 bit definitions ***********************/
90#define XRST 0x0001
91#define XRDY 0x0002
92#define XEMPTY 0x0004
93#define XSYNC_ERR 0x0008
94#define XINTM(value) ((value)<<4) /* bits 4:5 */
95#define GRST 0x0040
96#define FRST 0x0080
97#define SOFT 0x0100
98#define FREE 0x0200
99
100/************************** McBSP PCR bit definitions *************************/
101#define CLKRP 0x0001
102#define CLKXP 0x0002
103#define FSRP 0x0004
104#define FSXP 0x0008
105#define DR_STAT 0x0010
106#define DX_STAT 0x0020
107#define CLKS_STAT 0x0040
108#define SCLKME 0x0080
109#define CLKRM 0x0100
110#define CLKXM 0x0200
111#define FSRM 0x0400
112#define FSXM 0x0800
113#define RIOEN 0x1000
114#define XIOEN 0x2000
115#define IDLE_EN 0x4000
116
117/************************** McBSP RCR1 bit definitions ************************/
118#define RWDLEN1(value) ((value)<<5) /* Bits 5:7 */
119#define RFRLEN1(value) ((value)<<8) /* Bits 8:14 */
120
121/************************** McBSP XCR1 bit definitions ************************/
122#define XWDLEN1(value) ((value)<<5) /* Bits 5:7 */
123#define XFRLEN1(value) ((value)<<8) /* Bits 8:14 */
124
125/*************************** McBSP RCR2 bit definitions ***********************/
126#define RDATDLY(value) (value) /* Bits 0:1 */
127#define RFIG 0x0004
128#define RCOMPAND(value) ((value)<<3) /* Bits 3:4 */
129#define RWDLEN2(value) ((value)<<5) /* Bits 5:7 */
130#define RFRLEN2(value) ((value)<<8) /* Bits 8:14 */
131#define RPHASE 0x8000
132
133/*************************** McBSP XCR2 bit definitions ***********************/
134#define XDATDLY(value) (value) /* Bits 0:1 */
135#define XFIG 0x0004
136#define XCOMPAND(value) ((value)<<3) /* Bits 3:4 */
137#define XWDLEN2(value) ((value)<<5) /* Bits 5:7 */
138#define XFRLEN2(value) ((value)<<8) /* Bits 8:14 */
139#define XPHASE 0x8000
140
141/************************* McBSP SRGR1 bit definitions ************************/
142#define CLKGDV(value) (value) /* Bits 0:7 */
143#define FWID(value) ((value)<<8) /* Bits 8:15 */
144
145/************************* McBSP SRGR2 bit definitions ************************/
146#define FPER(value) (value) /* Bits 0:11 */
147#define FSGM 0x1000
148#define CLKSM 0x2000
149#define CLKSP 0x4000
150#define GSYNC 0x8000
151
152/************************* McBSP MCR1 bit definitions *************************/
153#define RMCM 0x0001
154#define RCBLK(value) ((value)<<2) /* Bits 2:4 */
155#define RPABLK(value) ((value)<<5) /* Bits 5:6 */
156#define RPBBLK(value) ((value)<<7) /* Bits 7:8 */
157
158/************************* McBSP MCR2 bit definitions *************************/
159#define XMCM(value) (value) /* Bits 0:1 */
160#define XCBLK(value) ((value)<<2) /* Bits 2:4 */
161#define XPABLK(value) ((value)<<5) /* Bits 5:6 */
162#define XPBBLK(value) ((value)<<7) /* Bits 7:8 */
163
164
165/* we don't do multichannel for now */
166struct omap_mcbsp_reg_cfg {
167 u16 spcr2;
168 u16 spcr1;
169 u16 rcr2;
170 u16 rcr1;
171 u16 xcr2;
172 u16 xcr1;
173 u16 srgr2;
174 u16 srgr1;
175 u16 mcr2;
176 u16 mcr1;
177 u16 pcr0;
178 u16 rcerc;
179 u16 rcerd;
180 u16 xcerc;
181 u16 xcerd;
182 u16 rcere;
183 u16 rcerf;
184 u16 xcere;
185 u16 xcerf;
186 u16 rcerg;
187 u16 rcerh;
188 u16 xcerg;
189 u16 xcerh;
190};
191
192typedef enum {
193 OMAP_MCBSP1 = 0,
194 OMAP_MCBSP2,
195 OMAP_MCBSP3,
196} omap_mcbsp_id;
197
198typedef enum {
199 OMAP_MCBSP_WORD_8 = 0,
200 OMAP_MCBSP_WORD_12,
201 OMAP_MCBSP_WORD_16,
202 OMAP_MCBSP_WORD_20,
203 OMAP_MCBSP_WORD_24,
204 OMAP_MCBSP_WORD_32,
205} omap_mcbsp_word_length;
206
207typedef enum {
208 OMAP_MCBSP_CLK_RISING = 0,
209 OMAP_MCBSP_CLK_FALLING,
210} omap_mcbsp_clk_polarity;
211
212typedef enum {
213 OMAP_MCBSP_FS_ACTIVE_HIGH = 0,
214 OMAP_MCBSP_FS_ACTIVE_LOW,
215} omap_mcbsp_fs_polarity;
216
217typedef enum {
218 OMAP_MCBSP_CLK_STP_MODE_NO_DELAY = 0,
219 OMAP_MCBSP_CLK_STP_MODE_DELAY,
220} omap_mcbsp_clk_stp_mode;
221
222
223/******* SPI specific mode **********/
224typedef enum {
225 OMAP_MCBSP_SPI_MASTER = 0,
226 OMAP_MCBSP_SPI_SLAVE,
227} omap_mcbsp_spi_mode;
228
229struct omap_mcbsp_spi_cfg {
230 omap_mcbsp_spi_mode spi_mode;
231 omap_mcbsp_clk_polarity rx_clock_polarity;
232 omap_mcbsp_clk_polarity tx_clock_polarity;
233 omap_mcbsp_fs_polarity fsx_polarity;
234 u8 clk_div;
235 omap_mcbsp_clk_stp_mode clk_stp_mode;
236 omap_mcbsp_word_length word_length;
237};
238
239void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config);
240int omap_mcbsp_request(unsigned int id);
241void omap_mcbsp_free(unsigned int id);
242void omap_mcbsp_start(unsigned int id);
243void omap_mcbsp_stop(unsigned int id);
244void omap_mcbsp_xmit_word(unsigned int id, u32 word);
245u32 omap_mcbsp_recv_word(unsigned int id);
246
247int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length);
248int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length);
249
250/* SPI specific API */
251void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg);
252
253/* Polled read/write functions */
254int omap_mcbsp_pollread(unsigned int id, u16 * buf);
255int omap_mcbsp_pollwrite(unsigned int id, u16 buf);
256
257#endif
diff --git a/include/asm-arm/arch-omap/memory.h b/include/asm-arm/arch-omap/memory.h
new file mode 100644
index 000000000000..f6b57dd846a3
--- /dev/null
+++ b/include/asm-arm/arch-omap/memory.h
@@ -0,0 +1,87 @@
1/*
2 * linux/include/asm-arm/arch-omap/memory.h
3 *
4 * Memory map for OMAP-1510 and 1610
5 *
6 * Copyright (C) 2000 RidgeRun, Inc.
7 * Author: Greg Lonnon <glonnon@ridgerun.com>
8 *
9 * This file was derived from linux/include/asm-arm/arch-intergrator/memory.h
10 * Copyright (C) 1999 ARM Limited
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * You should have received a copy of the GNU General Public License along
29 * with this program; if not, write to the Free Software Foundation, Inc.,
30 * 675 Mass Ave, Cambridge, MA 02139, USA.
31 */
32
33#ifndef __ASM_ARCH_MEMORY_H
34#define __ASM_ARCH_MEMORY_H
35
36/*
37 * Physical DRAM offset.
38 */
39#define PHYS_OFFSET (0x10000000UL)
40
41/*
42 * OMAP-1510 Local Bus address offset
43 */
44#define OMAP1510_LB_OFFSET (0x30000000UL)
45
46/*
47 * Conversion between SDRAM and fake PCI bus, used by USB
48 * NOTE: Physical address must be converted to Local Bus address
49 * on OMAP-1510 only
50 */
51
52/*
53 * Bus address is physical address, except for OMAP-1510 Local Bus.
54 */
55#define __virt_to_bus(x) __virt_to_phys(x)
56#define __bus_to_virt(x) __phys_to_virt(x)
57
58/*
59 * OMAP-1510 bus address is translated into a Local Bus address if the
60 * OMAP bus type is lbus. We do the address translation based on the
61 * device overriding the defaults used in the dma-mapping API.
62 * Note that the is_lbus_device() test is not very efficient on 1510
63 * because of the strncmp().
64 */
65#ifdef CONFIG_ARCH_OMAP1510
66
67#define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET)
68#define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
69#define is_lbus_device(dev) (cpu_is_omap1510() && dev && (strncmp(dev->bus_id, "ohci", 4) == 0))
70
71#define __arch_page_to_dma(dev, page) ({is_lbus_device(dev) ? \
72 (dma_addr_t)virt_to_lbus(page_address(page)) : \
73 (dma_addr_t)__virt_to_bus(page_address(page));})
74
75#define __arch_dma_to_virt(dev, addr) ({is_lbus_device(dev) ? \
76 lbus_to_virt(addr) : \
77 __bus_to_virt(addr);})
78
79#define __arch_virt_to_dma(dev, addr) ({is_lbus_device(dev) ? \
80 virt_to_lbus(addr) : \
81 __virt_to_bus(addr);})
82
83#endif /* CONFIG_ARCH_OMAP1510 */
84
85#define PHYS_TO_NID(addr) (0)
86#endif
87
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h
new file mode 100644
index 000000000000..39f99decbb7b
--- /dev/null
+++ b/include/asm-arm/arch-omap/mux.h
@@ -0,0 +1,561 @@
1/*
2 * linux/include/asm-arm/arch-omap/mux.h
3 *
4 * Table of the Omap register configurations for the FUNC_MUX and
5 * PULL_DWN combinations.
6 *
7 * Copyright (C) 2003 Nokia Corporation
8 *
9 * Written by Tony Lindgren <tony.lindgren@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 * NOTE: Please use the following naming style for new pin entries.
26 * For example, W8_1610_MMC2_DAT0, where:
27 * - W8 = ball
28 * - 1610 = 1510 or 1610, none if common for both 1510 and 1610
29 * - MMC2_DAT0 = function
30 *
31 * Change log:
32 * Added entry for the I2C interface. (02Feb 2004)
33 * Copyright (C) 2004 Texas Instruments
34 *
35 * Added entry for the keypad and uwire CS1. (09Mar 2004)
36 * Copyright (C) 2004 Texas Instruments
37 *
38 */
39
40#ifndef __ASM_ARCH_MUX_H
41#define __ASM_ARCH_MUX_H
42
43#define PU_PD_SEL_NA 0 /* No pu_pd reg available */
44#define PULL_DWN_CTRL_NA 0 /* No pull-down control needed */
45
46#ifdef CONFIG_OMAP_MUX_DEBUG
47#define MUX_REG(reg, mode_offset, mode) .mux_reg_name = "FUNC_MUX_CTRL_"#reg, \
48 .mux_reg = FUNC_MUX_CTRL_##reg, \
49 .mask_offset = mode_offset, \
50 .mask = mode,
51
52#define PULL_REG(reg, bit, status) .pull_name = "PULL_DWN_CTRL_"#reg, \
53 .pull_reg = PULL_DWN_CTRL_##reg, \
54 .pull_bit = bit, \
55 .pull_val = status,
56
57#define PU_PD_REG(reg, status) .pu_pd_name = "PU_PD_SEL_"#reg, \
58 .pu_pd_reg = PU_PD_SEL_##reg, \
59 .pu_pd_val = status,
60
61#else
62
63#define MUX_REG(reg, mode_offset, mode) .mux_reg = FUNC_MUX_CTRL_##reg, \
64 .mask_offset = mode_offset, \
65 .mask = mode,
66
67#define PULL_REG(reg, bit, status) .pull_reg = PULL_DWN_CTRL_##reg, \
68 .pull_bit = bit, \
69 .pull_val = status,
70
71#define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, \
72 .pu_pd_val = status,
73
74#endif /* CONFIG_OMAP_MUX_DEBUG */
75
76#define MUX_CFG(desc, mux_reg, mode_offset, mode, \
77 pull_reg, pull_bit, pull_status, \
78 pu_pd_reg, pu_pd_status, debug_status) \
79{ \
80 .name = desc, \
81 .debug = debug_status, \
82 MUX_REG(mux_reg, mode_offset, mode) \
83 PULL_REG(pull_reg, pull_bit, pull_status) \
84 PU_PD_REG(pu_pd_reg, pu_pd_status) \
85},
86
87#define PULL_DISABLED 0
88#define PULL_ENABLED 1
89
90#define PULL_DOWN 0
91#define PULL_UP 1
92
93typedef struct {
94 char *name;
95 unsigned char busy;
96 unsigned char debug;
97
98 const char *mux_reg_name;
99 const unsigned int mux_reg;
100 const unsigned char mask_offset;
101 const unsigned char mask;
102
103 const char *pull_name;
104 const unsigned int pull_reg;
105 const unsigned char pull_val;
106 const unsigned char pull_bit;
107
108 const char *pu_pd_name;
109 const unsigned int pu_pd_reg;
110 const unsigned char pu_pd_val;
111} reg_cfg_set;
112
113/*
114 * Lookup table for FUNC_MUX and PULL_DWN register combinations for each
115 * device. See also reg_cfg_table below for the register values.
116 */
117typedef enum {
118 /* UART1 (BT_UART_GATING)*/
119 UART1_TX = 0,
120 UART1_RTS,
121
122 /* UART2 (COM_UART_GATING)*/
123 UART2_TX,
124 UART2_RX,
125 UART2_CTS,
126 UART2_RTS,
127
128 /* UART3 (GIGA_UART_GATING) */
129 UART3_TX,
130 UART3_RX,
131 UART3_CTS,
132 UART3_RTS,
133 UART3_CLKREQ,
134 UART3_BCLK, /* 12MHz clock out */
135 Y15_1610_UART3_RTS,
136
137 /* PWT & PWL */
138 PWT,
139 PWL,
140
141 /* USB master generic */
142 R18_USB_VBUS,
143 R18_1510_USB_GPIO0,
144 W4_USB_PUEN,
145 W4_USB_CLKO,
146 W4_USB_HIGHZ,
147 W4_GPIO58,
148
149 /* USB1 master */
150 USB1_SUSP,
151 USB1_SEO,
152 W13_1610_USB1_SE0,
153 USB1_TXEN,
154 USB1_TXD,
155 USB1_VP,
156 USB1_VM,
157 USB1_RCV,
158 USB1_SPEED,
159 R13_1610_USB1_SPEED,
160 R13_1710_USB1_SE0,
161
162 /* USB2 master */
163 USB2_SUSP,
164 USB2_VP,
165 USB2_TXEN,
166 USB2_VM,
167 USB2_RCV,
168 USB2_SEO,
169 USB2_TXD,
170
171 /* OMAP-1510 GPIO */
172 R18_1510_GPIO0,
173 R19_1510_GPIO1,
174 M14_1510_GPIO2,
175
176 /* OMAP1610 GPIO */
177 P18_1610_GPIO3,
178 Y15_1610_GPIO17,
179
180 /* OMAP-1710 GPIO */
181 R18_1710_GPIO0,
182 V2_1710_GPIO10,
183 N21_1710_GPIO14,
184 W15_1710_GPIO40,
185
186 /* MPUIO */
187 MPUIO2,
188 MPUIO4,
189 MPUIO5,
190 T20_1610_MPUIO5,
191 W11_1610_MPUIO6,
192 V10_1610_MPUIO7,
193 W11_1610_MPUIO9,
194 V10_1610_MPUIO10,
195 W10_1610_MPUIO11,
196 E20_1610_MPUIO13,
197 U20_1610_MPUIO14,
198 E19_1610_MPUIO15,
199
200 /* MCBSP2 */
201 MCBSP2_CLKR,
202 MCBSP2_CLKX,
203 MCBSP2_DR,
204 MCBSP2_DX,
205 MCBSP2_FSR,
206 MCBSP2_FSX,
207
208 /* MCBSP3 */
209 MCBSP3_CLKX,
210
211 /* Misc ballouts */
212 BALLOUT_V8_ARMIO3,
213
214 /* OMAP-1610 MMC2 */
215 W8_1610_MMC2_DAT0,
216 V8_1610_MMC2_DAT1,
217 W15_1610_MMC2_DAT2,
218 R10_1610_MMC2_DAT3,
219 Y10_1610_MMC2_CLK,
220 Y8_1610_MMC2_CMD,
221 V9_1610_MMC2_CMDDIR,
222 V5_1610_MMC2_DATDIR0,
223 W19_1610_MMC2_DATDIR1,
224 R18_1610_MMC2_CLKIN,
225
226 /* OMAP-1610 External Trace Interface */
227 M19_1610_ETM_PSTAT0,
228 L15_1610_ETM_PSTAT1,
229 L18_1610_ETM_PSTAT2,
230 L19_1610_ETM_D0,
231 J19_1610_ETM_D6,
232 J18_1610_ETM_D7,
233
234 /* OMAP-1610 GPIO */
235 P20_1610_GPIO4,
236 V9_1610_GPIO7,
237 W8_1610_GPIO9,
238 N19_1610_GPIO13,
239 P10_1610_GPIO22,
240 V5_1610_GPIO24,
241 AA20_1610_GPIO_41,
242 W19_1610_GPIO48,
243 M7_1610_GPIO62,
244
245 /* OMAP-1610 uWire */
246 V19_1610_UWIRE_SCLK,
247 U18_1610_UWIRE_SDI,
248 W21_1610_UWIRE_SDO,
249 N14_1610_UWIRE_CS0,
250 P15_1610_UWIRE_CS0,
251 N15_1610_UWIRE_CS1,
252
253 /* OMAP-1610 Flash */
254 L3_1610_FLASH_CS2B_OE,
255 M8_1610_FLASH_CS2B_WE,
256
257 /* First MMC */
258 MMC_CMD,
259 MMC_DAT1,
260 MMC_DAT2,
261 MMC_DAT0,
262 MMC_CLK,
263 MMC_DAT3,
264
265 /* OMAP-1710 MMC CMDDIR and DATDIR0 */
266 M15_1710_MMC_CLKI,
267 P19_1710_MMC_CMDDIR,
268 P20_1710_MMC_DATDIR0,
269
270 /* OMAP-1610 USB0 alternate pin configuration */
271 W9_USB0_TXEN,
272 AA9_USB0_VP,
273 Y5_USB0_RCV,
274 R9_USB0_VM,
275 V6_USB0_TXD,
276 W5_USB0_SE0,
277 V9_USB0_SPEED,
278 V9_USB0_SUSP,
279
280 /* USB2 */
281 W9_USB2_TXEN,
282 AA9_USB2_VP,
283 Y5_USB2_RCV,
284 R9_USB2_VM,
285 V6_USB2_TXD,
286 W5_USB2_SE0,
287
288 /* UART1 1610 */
289
290 R13_1610_UART1_TX,
291 V14_1610_UART1_RX,
292 R14_1610_UART1_CTS,
293 AA15_1610_UART1_RTS,
294
295 /* I2C OMAP-1610 */
296 I2C_SCL,
297 I2C_SDA,
298
299 /* Keypad */
300 F18_1610_KBC0,
301 D20_1610_KBC1,
302 D19_1610_KBC2,
303 E18_1610_KBC3,
304 C21_1610_KBC4,
305 G18_1610_KBR0,
306 F19_1610_KBR1,
307 H14_1610_KBR2,
308 E20_1610_KBR3,
309 E19_1610_KBR4,
310 N19_1610_KBR5,
311
312 /* Power management */
313 T20_1610_LOW_PWR,
314
315 /* MCLK Settings */
316 V5_1710_MCLK_ON,
317 V5_1710_MCLK_OFF,
318 R10_1610_MCLK_ON,
319 R10_1610_MCLK_OFF,
320
321 /* CompactFlash controller */
322 P11_1610_CF_CD2,
323 R11_1610_CF_IOIS16,
324 V10_1610_CF_IREQ,
325 W10_1610_CF_RESET,
326 W11_1610_CF_CD1,
327} reg_cfg_t;
328
329#if defined(__MUX_C__) && defined(CONFIG_OMAP_MUX)
330
331/*
332 * Table of various FUNC_MUX and PULL_DWN combinations for each device.
333 * See also reg_cfg_t above for the lookup table.
334 */
335static reg_cfg_set __initdata_or_module
336reg_cfg_table[] = {
337/*
338 * description mux mode mux pull pull pull pu_pd pu dbg
339 * reg offset mode reg bit ena reg
340 */
341MUX_CFG("UART1_TX", 9, 21, 1, 2, 3, 0, NA, 0, 0)
342MUX_CFG("UART1_RTS", 9, 12, 1, 2, 0, 0, NA, 0, 0)
343
344/* UART2 (COM_UART_GATING), conflicts with USB2 */
345MUX_CFG("UART2_TX", C, 27, 1, 3, 3, 0, NA, 0, 0)
346MUX_CFG("UART2_RX", C, 18, 0, 3, 1, 1, NA, 0, 0)
347MUX_CFG("UART2_CTS", C, 21, 0, 3, 1, 1, NA, 0, 0)
348MUX_CFG("UART2_RTS", C, 24, 1, 3, 2, 0, NA, 0, 0)
349
350/* UART3 (GIGA_UART_GATING) */
351MUX_CFG("UART3_TX", 6, 0, 1, 0, 30, 0, NA, 0, 0)
352MUX_CFG("UART3_RX", 6, 3, 0, 0, 31, 1, NA, 0, 0)
353MUX_CFG("UART3_CTS", 5, 12, 2, 0, 24, 0, NA, 0, 0)
354MUX_CFG("UART3_RTS", 5, 15, 2, 0, 25, 0, NA, 0, 0)
355MUX_CFG("UART3_CLKREQ", 9, 27, 0, 2, 5, 0, NA, 0, 0)
356MUX_CFG("UART3_BCLK", A, 0, 0, 2, 6, 0, NA, 0, 0)
357MUX_CFG("Y15_1610_UART3_RTS", A, 0, 1, 2, 6, 0, NA, 0, 0)
358
359/* PWT & PWL, conflicts with UART3 */
360MUX_CFG("PWT", 6, 0, 2, 0, 30, 0, NA, 0, 0)
361MUX_CFG("PWL", 6, 3, 1, 0, 31, 1, NA, 0, 0)
362
363/* USB internal master generic */
364MUX_CFG("R18_USB_VBUS", 7, 9, 2, 1, 11, 0, NA, 0, 1)
365MUX_CFG("R18_1510_USB_GPIO0", 7, 9, 0, 1, 11, 1, NA, 0, 1)
366/* works around erratum: W4_USB_PUEN and W4_USB_PUDIS are switched! */
367MUX_CFG("W4_USB_PUEN", D, 3, 3, 3, 5, 1, NA, 0, 1)
368MUX_CFG("W4_USB_CLKO", D, 3, 1, 3, 5, 0, NA, 0, 1)
369MUX_CFG("W4_USB_HIGHZ", D, 3, 4, 3, 5, 0, 3, 0, 1)
370MUX_CFG("W4_GPIO58", D, 3, 7, 3, 5, 0, 3, 0, 1)
371
372/* USB1 master */
373MUX_CFG("USB1_SUSP", 8, 27, 2, 1, 27, 0, NA, 0, 1)
374MUX_CFG("USB1_SE0", 9, 0, 2, 1, 28, 0, NA, 0, 1)
375MUX_CFG("W13_1610_USB1_SE0", 9, 0, 4, 1, 28, 0, NA, 0, 1)
376MUX_CFG("USB1_TXEN", 9, 3, 2, 1, 29, 0, NA, 0, 1)
377MUX_CFG("USB1_TXD", 9, 24, 1, 2, 4, 0, NA, 0, 1)
378MUX_CFG("USB1_VP", A, 3, 1, 2, 7, 0, NA, 0, 1)
379MUX_CFG("USB1_VM", A, 6, 1, 2, 8, 0, NA, 0, 1)
380MUX_CFG("USB1_RCV", A, 9, 1, 2, 9, 0, NA, 0, 1)
381MUX_CFG("USB1_SPEED", A, 12, 2, 2, 10, 0, NA, 0, 1)
382MUX_CFG("R13_1610_USB1_SPEED", A, 12, 5, 2, 10, 0, NA, 0, 1)
383MUX_CFG("R13_1710_USB1_SEO", A, 12, 5, 2, 10, 0, NA, 0, 1)
384
385/* USB2 master */
386MUX_CFG("USB2_SUSP", B, 3, 1, 2, 17, 0, NA, 0, 1)
387MUX_CFG("USB2_VP", B, 6, 1, 2, 18, 0, NA, 0, 1)
388MUX_CFG("USB2_TXEN", B, 9, 1, 2, 19, 0, NA, 0, 1)
389MUX_CFG("USB2_VM", C, 18, 1, 3, 0, 0, NA, 0, 1)
390MUX_CFG("USB2_RCV", C, 21, 1, 3, 1, 0, NA, 0, 1)
391MUX_CFG("USB2_SE0", C, 24, 2, 3, 2, 0, NA, 0, 1)
392MUX_CFG("USB2_TXD", C, 27, 2, 3, 3, 0, NA, 0, 1)
393
394/* OMAP-1510 GPIO */
395MUX_CFG("R18_1510_GPIO0", 7, 9, 0, 1, 11, 1, 0, 0, 1)
396MUX_CFG("R19_1510_GPIO1", 7, 6, 0, 1, 10, 1, 0, 0, 1)
397MUX_CFG("M14_1510_GPIO2", 7, 3, 0, 1, 9, 1, 0, 0, 1)
398
399/* OMAP1610 GPIO */
400MUX_CFG("P18_1610_GPIO3", 7, 0, 0, 1, 8, 0, NA, 0, 1)
401MUX_CFG("Y15_1610_GPIO17", A, 0, 7, 2, 6, 0, NA, 0, 1)
402
403/* OMAP-1710 GPIO */
404MUX_CFG("R18_1710_GPIO0", 7, 9, 0, 1, 11, 1, 1, 1, 1)
405MUX_CFG("V2_1710_GPIO10", F, 27, 1, 4, 3, 1, 4, 1, 1)
406MUX_CFG("N21_1710_GPIO14", 6, 9, 0, 1, 1, 1, 1, 1, 1)
407MUX_CFG("W15_1710_GPIO40", 9, 27, 7, 2, 5, 1, 2, 1, 1)
408
409/* MPUIO */
410MUX_CFG("MPUIO2", 7, 18, 0, 1, 1, 1, NA, 0, 1)
411MUX_CFG("MPUIO4", 7, 15, 0, 1, 13, 1, NA, 0, 1)
412MUX_CFG("MPUIO5", 7, 12, 0, 1, 12, 1, NA, 0, 1)
413
414MUX_CFG("T20_1610_MPUIO5", 7, 12, 0, 1, 12, 0, 3, 0, 1)
415MUX_CFG("W11_1610_MPUIO6", 10, 15, 2, 3, 8, 0, 3, 0, 1)
416MUX_CFG("V10_1610_MPUIO7", A, 24, 2, 2, 14, 0, 2, 0, 1)
417MUX_CFG("W11_1610_MPUIO9", 10, 15, 1, 3, 8, 0, 3, 0, 1)
418MUX_CFG("V10_1610_MPUIO10", A, 24, 1, 2, 14, 0, 2, 0, 1)
419MUX_CFG("W10_1610_MPUIO11", A, 18, 2, 2, 11, 0, 2, 0, 1)
420MUX_CFG("E20_1610_MPUIO13", 3, 21, 1, 0, 7, 0, 0, 0, 1)
421MUX_CFG("U20_1610_MPUIO14", 9, 6, 6, 0, 30, 0, 0, 0, 1)
422MUX_CFG("E19_1610_MPUIO15", 3, 18, 1, 0, 6, 0, 0, 0, 1)
423
424/* MCBSP2 */
425MUX_CFG("MCBSP2_CLKR", C, 6, 0, 2, 27, 1, NA, 0, 1)
426MUX_CFG("MCBSP2_CLKX", C, 9, 0, 2, 29, 1, NA, 0, 1)
427MUX_CFG("MCBSP2_DR", C, 0, 0, 2, 26, 1, NA, 0, 1)
428MUX_CFG("MCBSP2_DX", C, 15, 0, 2, 31, 1, NA, 0, 1)
429MUX_CFG("MCBSP2_FSR", C, 12, 0, 2, 30, 1, NA, 0, 1)
430MUX_CFG("MCBSP2_FSX", C, 3, 0, 2, 27, 1, NA, 0, 1)
431
432/* MCBSP3 NOTE: Mode must 1 for clock */
433MUX_CFG("MCBSP3_CLKX", 9, 3, 1, 1, 29, 0, NA, 0, 1)
434
435/* Misc ballouts */
436MUX_CFG("BALLOUT_V8_ARMIO3", B, 18, 0, 2, 25, 1, NA, 0, 1)
437
438/* OMAP-1610 MMC2 */
439MUX_CFG("W8_1610_MMC2_DAT0", B, 21, 6, 2, 23, 1, 2, 1, 1)
440MUX_CFG("V8_1610_MMC2_DAT1", B, 27, 6, 2, 25, 1, 2, 1, 1)
441MUX_CFG("W15_1610_MMC2_DAT2", 9, 12, 6, 2, 5, 1, 2, 1, 1)
442MUX_CFG("R10_1610_MMC2_DAT3", B, 18, 6, 2, 22, 1, 2, 1, 1)
443MUX_CFG("Y10_1610_MMC2_CLK", B, 3, 6, 2, 17, 0, 2, 0, 1)
444MUX_CFG("Y8_1610_MMC2_CMD", B, 24, 6, 2, 24, 1, 2, 1, 1)
445MUX_CFG("V9_1610_MMC2_CMDDIR", B, 12, 6, 2, 20, 0, 2, 1, 1)
446MUX_CFG("V5_1610_MMC2_DATDIR0", B, 15, 6, 2, 21, 0, 2, 1, 1)
447MUX_CFG("W19_1610_MMC2_DATDIR1", 8, 15, 6, 1, 23, 0, 1, 1, 1)
448MUX_CFG("R18_1610_MMC2_CLKIN", 7, 9, 6, 1, 11, 0, 1, 11, 1)
449
450/* OMAP-1610 External Trace Interface */
451MUX_CFG("M19_1610_ETM_PSTAT0", 5, 27, 1, 0, 29, 0, 0, 0, 1)
452MUX_CFG("L15_1610_ETM_PSTAT1", 5, 24, 1, 0, 28, 0, 0, 0, 1)
453MUX_CFG("L18_1610_ETM_PSTAT2", 5, 21, 1, 0, 27, 0, 0, 0, 1)
454MUX_CFG("L19_1610_ETM_D0", 5, 18, 1, 0, 26, 0, 0, 0, 1)
455MUX_CFG("J19_1610_ETM_D6", 5, 0, 1, 0, 20, 0, 0, 0, 1)
456MUX_CFG("J18_1610_ETM_D7", 5, 27, 1, 0, 19, 0, 0, 0, 1)
457
458/* OMAP-1610 GPIO */
459MUX_CFG("P20_1610_GPIO4", 6, 27, 0, 1, 7, 0, 1, 1, 1)
460MUX_CFG("V9_1610_GPIO7", B, 12, 1, 2, 20, 0, 2, 1, 1)
461MUX_CFG("W8_1610_GPIO9", B, 21, 0, 2, 23, 0, 2, 1, 1)
462MUX_CFG("N19_1610_GPIO13", 6, 12, 0, 1, 2, 0, 1, 1, 1)
463MUX_CFG("P10_1610_GPIO22", C, 0, 7, 2, 26, 0, 2, 1, 1)
464MUX_CFG("V5_1610_GPIO24", B, 15, 7, 2, 21, 0, 2, 1, 1)
465MUX_CFG("AA20_1610_GPIO_41", 9, 9, 7, 1, 31, 0, 1, 1, 1)
466MUX_CFG("W19_1610_GPIO48", 8, 15, 7, 1, 23, 1, 1, 0, 1)
467MUX_CFG("M7_1610_GPIO62", 10, 0, 0, 4, 24, 0, 4, 0, 1)
468
469/* OMAP-1610 uWire */
470MUX_CFG("V19_1610_UWIRE_SCLK", 8, 6, 0, 1, 20, 0, 1, 1, 1)
471MUX_CFG("U18_1610_UWIRE_SDI", 8, 0, 0, 1, 18, 0, 1, 1, 1)
472MUX_CFG("W21_1610_UWIRE_SDO", 8, 3, 0, 1, 19, 0, 1, 1, 1)
473MUX_CFG("N14_1610_UWIRE_CS0", 8, 9, 1, 1, 21, 0, 1, 1, 1)
474MUX_CFG("P15_1610_UWIRE_CS3", 8, 12, 1, 1, 22, 0, 1, 1, 1)
475MUX_CFG("N15_1610_UWIRE_CS1", 7, 18, 2, 1, 14, 0, NA, 0, 1)
476
477/* OMAP-1610 Flash */
478MUX_CFG("L3_1610_FLASH_CS2B_OE",10, 6, 1, NA, 0, 0, NA, 0, 1)
479MUX_CFG("M8_1610_FLASH_CS2B_WE",10, 3, 1, NA, 0, 0, NA, 0, 1)
480
481/* First MMC interface, same on 1510, 1610 and 1710 */
482MUX_CFG("MMC_CMD", A, 27, 0, 2, 15, 1, 2, 1, 1)
483MUX_CFG("MMC_DAT1", A, 24, 0, 2, 14, 1, 2, 1, 1)
484MUX_CFG("MMC_DAT2", A, 18, 0, 2, 12, 1, 2, 1, 1)
485MUX_CFG("MMC_DAT0", B, 0, 0, 2, 16, 1, 2, 1, 1)
486MUX_CFG("MMC_CLK", A, 21, 0, NA, 0, 0, NA, 0, 1)
487MUX_CFG("MMC_DAT3", 10, 15, 0, 3, 8, 1, 3, 1, 1)
488MUX_CFG("M15_1710_MMC_CLKI", 6, 21, 2, 0, 0, 0, NA, 0, 1)
489MUX_CFG("P19_1710_MMC_CMDDIR", 6, 24, 6, 0, 0, 0, NA, 0, 1)
490MUX_CFG("P20_1710_MMC_DATDIR0", 6, 27, 5, 0, 0, 0, NA, 0, 1)
491
492/* OMAP-1610 USB0 alternate configuration */
493MUX_CFG("W9_USB0_TXEN", B, 9, 5, 2, 19, 0, 2, 0, 1)
494MUX_CFG("AA9_USB0_VP", B, 6, 5, 2, 18, 0, 2, 0, 1)
495MUX_CFG("Y5_USB0_RCV", C, 21, 5, 3, 1, 0, 1, 0, 1)
496MUX_CFG("R9_USB0_VM", C, 18, 5, 3, 0, 0, 3, 0, 1)
497MUX_CFG("V6_USB0_TXD", C, 27, 5, 3, 3, 0, 3, 0, 1)
498MUX_CFG("W5_USB0_SE0", C, 24, 5, 3, 2, 0, 3, 0, 1)
499MUX_CFG("V9_USB0_SPEED", B, 12, 5, 2, 20, 0, 2, 0, 1)
500MUX_CFG("Y10_USB0_SUSP", B, 3, 5, 2, 17, 0, 2, 0, 1)
501
502/* USB2 interface */
503MUX_CFG("W9_USB2_TXEN", B, 9, 1, NA, 0, 0, NA, 0, 1)
504MUX_CFG("AA9_USB2_VP", B, 6, 1, NA, 0, 0, NA, 0, 1)
505MUX_CFG("Y5_USB2_RCV", C, 21, 1, NA, 0, 0, NA, 0, 1)
506MUX_CFG("R8_USB2_VM", C, 18, 1, NA, 0, 0, NA, 0, 1)
507MUX_CFG("V6_USB2_TXD", C, 27, 2, NA, 0, 0, NA, 0, 1)
508MUX_CFG("W5_USB2_SE0", C, 24, 2, NA, 0, 0, NA, 0, 1)
509
510
511/* UART1 */
512MUX_CFG("R13_1610_UART1_TX", A, 12, 6, 2, 10, 0, 2, 10, 1)
513MUX_CFG("V14_1610_UART1_RX", 9, 18, 0, 2, 2, 0, 2, 2, 1)
514MUX_CFG("R14_1610_UART1_CTS", 9, 15, 0, 2, 1, 0, 2, 1, 1)
515MUX_CFG("AA15_1610_UART1_RTS", 9, 12, 1, 2, 0, 0, 2, 0, 1)
516
517/* I2C interface */
518MUX_CFG("I2C_SCL", 7, 24, 0, NA, 0, 0, NA, 0, 0)
519MUX_CFG("I2C_SDA", 7, 27, 0, NA, 0, 0, NA, 0, 0)
520
521/* Keypad */
522MUX_CFG("F18_1610_KBC0", 3, 15, 0, 0, 5, 1, 0, 0, 0)
523MUX_CFG("D20_1610_KBC1", 3, 12, 0, 0, 4, 1, 0, 0, 0)
524MUX_CFG("D19_1610_KBC2", 3, 9, 0, 0, 3, 1, 0, 0, 0)
525MUX_CFG("E18_1610_KBC3", 3, 6, 0, 0, 2, 1, 0, 0, 0)
526MUX_CFG("C21_1610_KBC4", 3, 3, 0, 0, 1, 1, 0, 0, 0)
527MUX_CFG("G18_1610_KBR0", 4, 0, 0, 0, 10, 1, 0, 1, 0)
528MUX_CFG("F19_1610_KBR1", 3, 27, 0, 0, 9, 1, 0, 1, 0)
529MUX_CFG("H14_1610_KBR2", 3, 24, 0, 0, 8, 1, 0, 1, 0)
530MUX_CFG("E20_1610_KBR3", 3, 21, 0, 0, 7, 1, 0, 1, 0)
531MUX_CFG("E19_1610_KBR4", 3, 18, 0, 0, 6, 1, 0, 1, 0)
532MUX_CFG("N19_1610_KBR5", 6, 12, 1, 1, 2, 1, 1, 1, 0)
533
534/* Power management */
535MUX_CFG("T20_1610_LOW_PWR", 7, 12, 1, NA, 0, 0, NA, 0, 0)
536
537/* MCLK Settings */
538MUX_CFG("V5_1710_MCLK_ON", B, 15, 0, NA, 0, 0, NA, 0, 0)
539MUX_CFG("V5_1710_MCLK_OFF", B, 15, 6, NA, 0, 0, NA, 0, 0)
540MUX_CFG("R10_1610_MCLK_ON", B, 18, 0, NA, 22, 0, NA, 1, 0)
541MUX_CFG("R10_1610_MCLK_OFF", B, 18, 6, 2, 22, 1, 2, 1, 1)
542
543/* CompactFlash controller, conflicts with MMC1 */
544MUX_CFG("P11_1610_CF_CD2", A, 27, 3, 2, 15, 1, 2, 1, 1)
545MUX_CFG("R11_1610_CF_IOIS16", B, 0, 3, 2, 16, 1, 2, 1, 1)
546MUX_CFG("V10_1610_CF_IREQ", A, 24, 3, 2, 14, 0, 2, 0, 1)
547MUX_CFG("W10_1610_CF_RESET", A, 18, 3, 2, 12, 1, 2, 1, 1)
548MUX_CFG("W11_1610_CF_CD1", 10, 15, 3, 3, 8, 1, 3, 1, 1)
549};
550
551#endif /* __MUX_C__ */
552
553#ifdef CONFIG_OMAP_MUX
554/* setup pin muxing in Linux */
555extern int omap_cfg_reg(reg_cfg_t reg_cfg);
556#else
557/* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */
558static inline int omap_cfg_reg(reg_cfg_t reg_cfg) { return 0; }
559#endif
560
561#endif
diff --git a/include/asm-arm/arch-omap/omap1510.h b/include/asm-arm/arch-omap/omap1510.h
new file mode 100644
index 000000000000..f491a48ef2e1
--- /dev/null
+++ b/include/asm-arm/arch-omap/omap1510.h
@@ -0,0 +1,61 @@
1/* linux/include/asm-arm/arch-omap/omap1510.h
2 *
3 * Hardware definitions for TI OMAP1510 processor.
4 *
5 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __ASM_ARCH_OMAP1510_H
29#define __ASM_ARCH_OMAP1510_H
30
31/*
32 * ----------------------------------------------------------------------------
33 * Base addresses
34 * ----------------------------------------------------------------------------
35 */
36
37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
38
39#define OMAP1510_SRAM_BASE 0xD0000000
40#define OMAP1510_SRAM_SIZE (SZ_128K + SZ_64K)
41#define OMAP1510_SRAM_START 0x20000000
42
43#define OMAP1510_DSP_BASE 0xE0000000
44#define OMAP1510_DSP_SIZE 0x28000
45#define OMAP1510_DSP_START 0xE0000000
46
47#define OMAP1510_DSPREG_BASE 0xE1000000
48#define OMAP1510_DSPREG_SIZE SZ_128K
49#define OMAP1510_DSPREG_START 0xE1000000
50
51/*
52 * ----------------------------------------------------------------------------
53 * Memory used by power management
54 * ----------------------------------------------------------------------------
55 */
56
57#define OMAP1510_SRAM_IDLE_SUSPEND (OMAP1510_SRAM_BASE + OMAP1510_SRAM_SIZE - 0x200)
58#define OMAP1510_SRAM_API_SUSPEND (OMAP1510_SRAM_IDLE_SUSPEND + 0x100)
59
60#endif /* __ASM_ARCH_OMAP1510_H */
61
diff --git a/include/asm-arm/arch-omap/omap16xx.h b/include/asm-arm/arch-omap/omap16xx.h
new file mode 100644
index 000000000000..88b1fe43ae9e
--- /dev/null
+++ b/include/asm-arm/arch-omap/omap16xx.h
@@ -0,0 +1,187 @@
1/* linux/include/asm-arm/arch-omap/omap16xx.h
2 *
3 * Hardware definitions for TI OMAP1610/5912/1710 processors.
4 *
5 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __ASM_ARCH_OMAP16XX_H
29#define __ASM_ARCH_OMAP16XX_H
30
31/*
32 * ----------------------------------------------------------------------------
33 * Base addresses
34 * ----------------------------------------------------------------------------
35 */
36
37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
38
39#define OMAP16XX_SRAM_BASE 0xD0000000
40#define OMAP1610_SRAM_SIZE (SZ_16K)
41#define OMAP5912_SRAM_SIZE 0x3E800
42#define OMAP16XX_SRAM_START 0x20000000
43
44#define OMAP16XX_DSP_BASE 0xE0000000
45#define OMAP16XX_DSP_SIZE 0x28000
46#define OMAP16XX_DSP_START 0xE0000000
47
48#define OMAP16XX_DSPREG_BASE 0xE1000000
49#define OMAP16XX_DSPREG_SIZE SZ_128K
50#define OMAP16XX_DSPREG_START 0xE1000000
51
52/*
53 * ----------------------------------------------------------------------------
54 * Memory used by power management
55 * ----------------------------------------------------------------------------
56 */
57
58#define OMAP1610_SRAM_IDLE_SUSPEND (OMAP16XX_SRAM_BASE + OMAP1610_SRAM_SIZE - 0x200)
59#define OMAP1610_SRAM_API_SUSPEND (OMAP1610_SRAM_IDLE_SUSPEND + 0x100)
60#define OMAP5912_SRAM_IDLE_SUSPEND (OMAP16XX_SRAM_BASE + OMAP5912_SRAM_SIZE - 0x200)
61#define OMAP5912_SRAM_API_SUSPEND (OMAP5912_SRAM_IDLE_SUSPEND + 0x100)
62
63/*
64 * ---------------------------------------------------------------------------
65 * Interrupts
66 * ---------------------------------------------------------------------------
67 */
68#define OMAP_IH2_0_BASE (0xfffe0000)
69#define OMAP_IH2_1_BASE (0xfffe0100)
70#define OMAP_IH2_2_BASE (0xfffe0200)
71#define OMAP_IH2_3_BASE (0xfffe0300)
72
73#define OMAP_IH2_0_ITR (OMAP_IH2_0_BASE + 0x00)
74#define OMAP_IH2_0_MIR (OMAP_IH2_0_BASE + 0x04)
75#define OMAP_IH2_0_SIR_IRQ (OMAP_IH2_0_BASE + 0x10)
76#define OMAP_IH2_0_SIR_FIQ (OMAP_IH2_0_BASE + 0x14)
77#define OMAP_IH2_0_CONTROL (OMAP_IH2_0_BASE + 0x18)
78#define OMAP_IH2_0_ILR0 (OMAP_IH2_0_BASE + 0x1c)
79#define OMAP_IH2_0_ISR (OMAP_IH2_0_BASE + 0x9c)
80
81#define OMAP_IH2_1_ITR (OMAP_IH2_1_BASE + 0x00)
82#define OMAP_IH2_1_MIR (OMAP_IH2_1_BASE + 0x04)
83#define OMAP_IH2_1_SIR_IRQ (OMAP_IH2_1_BASE + 0x10)
84#define OMAP_IH2_1_SIR_FIQ (OMAP_IH2_1_BASE + 0x14)
85#define OMAP_IH2_1_CONTROL (OMAP_IH2_1_BASE + 0x18)
86#define OMAP_IH2_1_ILR1 (OMAP_IH2_1_BASE + 0x1c)
87#define OMAP_IH2_1_ISR (OMAP_IH2_1_BASE + 0x9c)
88
89#define OMAP_IH2_2_ITR (OMAP_IH2_2_BASE + 0x00)
90#define OMAP_IH2_2_MIR (OMAP_IH2_2_BASE + 0x04)
91#define OMAP_IH2_2_SIR_IRQ (OMAP_IH2_2_BASE + 0x10)
92#define OMAP_IH2_2_SIR_FIQ (OMAP_IH2_2_BASE + 0x14)
93#define OMAP_IH2_2_CONTROL (OMAP_IH2_2_BASE + 0x18)
94#define OMAP_IH2_2_ILR2 (OMAP_IH2_2_BASE + 0x1c)
95#define OMAP_IH2_2_ISR (OMAP_IH2_2_BASE + 0x9c)
96
97#define OMAP_IH2_3_ITR (OMAP_IH2_3_BASE + 0x00)
98#define OMAP_IH2_3_MIR (OMAP_IH2_3_BASE + 0x04)
99#define OMAP_IH2_3_SIR_IRQ (OMAP_IH2_3_BASE + 0x10)
100#define OMAP_IH2_3_SIR_FIQ (OMAP_IH2_3_BASE + 0x14)
101#define OMAP_IH2_3_CONTROL (OMAP_IH2_3_BASE + 0x18)
102#define OMAP_IH2_3_ILR3 (OMAP_IH2_3_BASE + 0x1c)
103#define OMAP_IH2_3_ISR (OMAP_IH2_3_BASE + 0x9c)
104
105/*
106 * ----------------------------------------------------------------------------
107 * Clocks
108 * ----------------------------------------------------------------------------
109 */
110#define OMAP16XX_ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24)
111
112/*
113 * ----------------------------------------------------------------------------
114 * Pin configuration registers
115 * ----------------------------------------------------------------------------
116 */
117#define OMAP16XX_CONF_VOLTAGE_VDDSHV6 (1 << 8)
118#define OMAP16XX_CONF_VOLTAGE_VDDSHV7 (1 << 9)
119#define OMAP16XX_CONF_VOLTAGE_VDDSHV8 (1 << 10)
120#define OMAP16XX_CONF_VOLTAGE_VDDSHV9 (1 << 11)
121#define OMAP16XX_SUBLVDS_CONF_VALID (1 << 13)
122
123/*
124 * ----------------------------------------------------------------------------
125 * System control registers
126 * ----------------------------------------------------------------------------
127 */
128#define OMAP1610_RESET_CONTROL 0xfffe1140
129
130/*
131 * ---------------------------------------------------------------------------
132 * TIPB bus interface
133 * ---------------------------------------------------------------------------
134 */
135#define TIPB_SWITCH_BASE (0xfffbc800)
136#define OMAP16XX_MMCSD2_SSW_MPU_CONF (TIPB_SWITCH_BASE + 0x160)
137
138/* UART3 Registers Maping through MPU bus */
139#define UART3_RHR (OMAP_UART3_BASE + 0)
140#define UART3_THR (OMAP_UART3_BASE + 0)
141#define UART3_DLL (OMAP_UART3_BASE + 0)
142#define UART3_IER (OMAP_UART3_BASE + 4)
143#define UART3_DLH (OMAP_UART3_BASE + 4)
144#define UART3_IIR (OMAP_UART3_BASE + 8)
145#define UART3_FCR (OMAP_UART3_BASE + 8)
146#define UART3_EFR (OMAP_UART3_BASE + 8)
147#define UART3_LCR (OMAP_UART3_BASE + 0x0C)
148#define UART3_MCR (OMAP_UART3_BASE + 0x10)
149#define UART3_XON1_ADDR1 (OMAP_UART3_BASE + 0x10)
150#define UART3_XON2_ADDR2 (OMAP_UART3_BASE + 0x14)
151#define UART3_LSR (OMAP_UART3_BASE + 0x14)
152#define UART3_TCR (OMAP_UART3_BASE + 0x18)
153#define UART3_MSR (OMAP_UART3_BASE + 0x18)
154#define UART3_XOFF1 (OMAP_UART3_BASE + 0x18)
155#define UART3_XOFF2 (OMAP_UART3_BASE + 0x1C)
156#define UART3_SPR (OMAP_UART3_BASE + 0x1C)
157#define UART3_TLR (OMAP_UART3_BASE + 0x1C)
158#define UART3_MDR1 (OMAP_UART3_BASE + 0x20)
159#define UART3_MDR2 (OMAP_UART3_BASE + 0x24)
160#define UART3_SFLSR (OMAP_UART3_BASE + 0x28)
161#define UART3_TXFLL (OMAP_UART3_BASE + 0x28)
162#define UART3_RESUME (OMAP_UART3_BASE + 0x2C)
163#define UART3_TXFLH (OMAP_UART3_BASE + 0x2C)
164#define UART3_SFREGL (OMAP_UART3_BASE + 0x30)
165#define UART3_RXFLL (OMAP_UART3_BASE + 0x30)
166#define UART3_SFREGH (OMAP_UART3_BASE + 0x34)
167#define UART3_RXFLH (OMAP_UART3_BASE + 0x34)
168#define UART3_BLR (OMAP_UART3_BASE + 0x38)
169#define UART3_ACREG (OMAP_UART3_BASE + 0x3C)
170#define UART3_DIV16 (OMAP_UART3_BASE + 0x3C)
171#define UART3_SCR (OMAP_UART3_BASE + 0x40)
172#define UART3_SSR (OMAP_UART3_BASE + 0x44)
173#define UART3_EBLR (OMAP_UART3_BASE + 0x48)
174#define UART3_OSC_12M_SEL (OMAP_UART3_BASE + 0x4C)
175#define UART3_MVR (OMAP_UART3_BASE + 0x50)
176
177/*
178 * ----------------------------------------------------------------------------
179 * Pulse-Width Light
180 * ----------------------------------------------------------------------------
181 */
182#define OMAP16XX_PWL_BASE (0xfffb5800)
183#define OMAP16XX_PWL_ENABLE (OMAP16XX_PWL_BASE + 0x00)
184#define OMAP16XX_PWL_CLK_ENABLE (OMAP16XX_PWL_BASE + 0x04)
185
186#endif /* __ASM_ARCH_OMAP16XX_H */
187
diff --git a/include/asm-arm/arch-omap/omap730.h b/include/asm-arm/arch-omap/omap730.h
new file mode 100644
index 000000000000..599ab00f5488
--- /dev/null
+++ b/include/asm-arm/arch-omap/omap730.h
@@ -0,0 +1,106 @@
1/* linux/include/asm-arm/arch-omap/omap730.h
2 *
3 * Hardware definitions for TI OMAP730 processor.
4 *
5 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __ASM_ARCH_OMAP730_H
29#define __ASM_ARCH_OMAP730_H
30
31/*
32 * ----------------------------------------------------------------------------
33 * Base addresses
34 * ----------------------------------------------------------------------------
35 */
36
37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
38
39#define OMAP730_SRAM_BASE 0xD0000000
40#define OMAP730_SRAM_SIZE (SZ_128K + SZ_64K + SZ_8K)
41#define OMAP730_SRAM_START 0x20000000
42
43#define OMAP730_DSP_BASE 0xE0000000
44#define OMAP730_DSP_SIZE 0x50000
45#define OMAP730_DSP_START 0xE0000000
46
47#define OMAP730_DSPREG_BASE 0xE1000000
48#define OMAP730_DSPREG_SIZE SZ_128K
49#define OMAP730_DSPREG_START 0xE1000000
50
51/*
52 * ----------------------------------------------------------------------------
53 * OMAP730 specific configuration registers
54 * ----------------------------------------------------------------------------
55 */
56#define OMAP730_CONFIG_BASE 0xfffe1000
57#define OMAP730_IO_CONF_0 0xfffe1070
58#define OMAP730_IO_CONF_1 0xfffe1074
59#define OMAP730_IO_CONF_2 0xfffe1078
60#define OMAP730_IO_CONF_3 0xfffe107c
61#define OMAP730_IO_CONF_4 0xfffe1080
62#define OMAP730_IO_CONF_5 0xfffe1084
63#define OMAP730_IO_CONF_6 0xfffe1088
64#define OMAP730_IO_CONF_7 0xfffe108c
65#define OMAP730_IO_CONF_8 0xfffe1090
66#define OMAP730_IO_CONF_9 0xfffe1094
67#define OMAP730_IO_CONF_10 0xfffe1098
68#define OMAP730_IO_CONF_11 0xfffe109c
69#define OMAP730_IO_CONF_12 0xfffe10a0
70#define OMAP730_IO_CONF_13 0xfffe10a4
71
72#define OMAP730_MODE_1 0xfffe1010
73#define OMAP730_MODE_2 0xfffe1014
74
75/* CSMI specials: in terms of base + offset */
76#define OMAP730_MODE2_OFFSET 0x14
77
78/*
79 * ----------------------------------------------------------------------------
80 * OMAP730 traffic controller configuration registers
81 * ----------------------------------------------------------------------------
82 */
83#define OMAP730_FLASH_CFG_0 0xfffecc10
84#define OMAP730_FLASH_ACFG_0 0xfffecc50
85#define OMAP730_FLASH_CFG_1 0xfffecc14
86#define OMAP730_FLASH_ACFG_1 0xfffecc54
87
88/*
89 * ----------------------------------------------------------------------------
90 * OMAP730 DSP control registers
91 * ----------------------------------------------------------------------------
92 */
93#define OMAP730_ICR_BASE 0xfffbb800
94#define OMAP730_DSP_M_CTL 0xfffbb804
95#define OMAP730_DSP_MMU_BASE 0xfffed200
96
97/*
98 * ----------------------------------------------------------------------------
99 * OMAP730 PCC_UPLD configuration registers
100 * ----------------------------------------------------------------------------
101 */
102#define OMAP730_PCC_UPLD_CTRL_BASE (0xfffe0900)
103#define OMAP730_PCC_UPLD_CTRL (OMAP730_PCC_UPLD_CTRL_BASE + 0x00)
104
105#endif /* __ASM_ARCH_OMAP730_H */
106
diff --git a/include/asm-arm/arch-omap/param.h b/include/asm-arm/arch-omap/param.h
new file mode 100644
index 000000000000..face9ad41e97
--- /dev/null
+++ b/include/asm-arm/arch-omap/param.h
@@ -0,0 +1,8 @@
1/*
2 * linux/include/asm-arm/arch-omap/param.h
3 *
4 */
5
6#ifdef CONFIG_OMAP_32K_TIMER_HZ
7#define HZ CONFIG_OMAP_32K_TIMER_HZ
8#endif
diff --git a/include/asm-arm/arch-omap/pm.h b/include/asm-arm/arch-omap/pm.h
new file mode 100644
index 000000000000..f209fc0953fb
--- /dev/null
+++ b/include/asm-arm/arch-omap/pm.h
@@ -0,0 +1,229 @@
1/*
2 * linux/include/asm/arch-omap/pm.h
3 *
4 * Header file for OMAP Power Management Routines
5 *
6 * Author: MontaVista Software, Inc.
7 * support@mvista.com
8 *
9 * Copyright 2002 MontaVista Software Inc.
10 *
11 * Cleanup 2004 for Linux 2.6 by Dirk Behme <dirk.behme@de.bosch.com>
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
17 *
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
19 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
21 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
24 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * You should have received a copy of the GNU General Public License along
30 * with this program; if not, write to the Free Software Foundation, Inc.,
31 * 675 Mass Ave, Cambridge, MA 02139, USA.
32 */
33
34#ifndef __ASM_ARCH_OMAP_PM_H
35#define __ASM_ARCH_OMAP_PM_H
36
37/*
38 * ----------------------------------------------------------------------------
39 * Register and offset definitions to be used in PM assembler code
40 * ----------------------------------------------------------------------------
41 */
42#define CLKGEN_REG_ASM_BASE io_p2v(0xfffece00)
43#define ARM_IDLECT1_ASM_OFFSET 0x04
44#define ARM_IDLECT2_ASM_OFFSET 0x08
45
46#define TCMIF_ASM_BASE io_p2v(0xfffecc00)
47#define EMIFS_CONFIG_ASM_OFFSET 0x0c
48#define EMIFF_SDRAM_CONFIG_ASM_OFFSET 0x20
49
50/*
51 * ----------------------------------------------------------------------------
52 * Powermanagement bitmasks
53 * ----------------------------------------------------------------------------
54 */
55#define IDLE_WAIT_CYCLES 0x00000fff
56#define PERIPHERAL_ENABLE 0x2
57
58#define SELF_REFRESH_MODE 0x0c000001
59#define IDLE_EMIFS_REQUEST 0xc
60#define MODEM_32K_EN 0x1
61#define PER_EN 0x1
62
63#define CPU_SUSPEND_SIZE 200
64#define ULPD_LOW_POWER_EN 0x0001
65
66#define DSP_IDLE_DELAY 10
67#define DSP_IDLE 0x0040
68#define DSP_RST 0x0004
69#define DSP_ENABLE 0x0002
70#define SUFFICIENT_DSP_RESET_TIME 1000
71#define DEFAULT_MPUI_CONFIG 0x05cf
72#define ENABLE_XORCLK 0x2
73#define DSP_CLOCK_ENABLE 0x2000
74#define DSP_IDLE_MODE 0x2
75#define TC_IDLE_REQUEST (0x0000000c)
76
77#define IRQ_LEVEL2 (1<<0)
78#define IRQ_KEYBOARD (1<<1)
79#define IRQ_UART2 (1<<15)
80
81#define PDE_BIT 0x08
82#define PWD_EN_BIT 0x04
83#define EN_PERCK_BIT 0x04
84
85#define OMAP1510_DEEP_SLEEP_REQUEST 0x0ec7
86#define OMAP1510_BIG_SLEEP_REQUEST 0x0cc5
87#define OMAP1510_IDLE_LOOP_REQUEST 0x0c00
88#define OMAP1510_IDLE_CLOCK_DOMAINS 0x2
89#define OMAP1510_ULPD_LOW_POWER_REQ 0x0001
90
91#define OMAP1610_DEEP_SLEEP_REQUEST 0x17c7
92#define OMAP1610_BIG_SLEEP_REQUEST TBD
93#define OMAP1610_IDLE_LOOP_REQUEST 0x0400
94#define OMAP1610_IDLE_CLOCK_DOMAINS 0x09c7
95#define OMAP1610_ULPD_LOW_POWER_REQ 0x3
96
97#ifndef OMAP1510_SRAM_IDLE_SUSPEND
98#define OMAP1510_SRAM_IDLE_SUSPEND 0
99#endif
100#ifndef OMAP1610_SRAM_IDLE_SUSPEND
101#define OMAP1610_SRAM_IDLE_SUSPEND 0
102#endif
103#ifndef OMAP5912_SRAM_IDLE_SUSPEND
104#define OMAP5912_SRAM_IDLE_SUSPEND 0
105#endif
106
107#ifndef OMAP1510_SRAM_API_SUSPEND
108#define OMAP1510_SRAM_API_SUSPEND 0
109#endif
110#ifndef OMAP1610_SRAM_API_SUSPEND
111#define OMAP1610_SRAM_API_SUSPEND 0
112#endif
113#ifndef OMAP5912_SRAM_API_SUSPEND
114#define OMAP5912_SRAM_API_SUSPEND 0
115#endif
116
117#if !defined(CONFIG_ARCH_OMAP1510) && \
118 !defined(CONFIG_ARCH_OMAP16XX)
119#error "Power management for this processor not implemented yet"
120#endif
121
122#ifndef __ASSEMBLER__
123extern void omap_pm_idle(void);
124extern void omap_pm_suspend(void);
125extern int omap1510_cpu_suspend(unsigned short, unsigned short);
126extern int omap1610_cpu_suspend(unsigned short, unsigned short);
127extern int omap1510_idle_loop_suspend(void);
128extern int omap1610_idle_loop_suspend(void);
129extern unsigned int omap1510_cpu_suspend_sz;
130extern unsigned int omap1510_idle_loop_suspend_sz;
131extern unsigned int omap1610_cpu_suspend_sz;
132extern unsigned int omap1610_idle_loop_suspend_sz;
133
134#define ARM_SAVE(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] = omap_readl(x)
135#define ARM_RESTORE(x) omap_writel((arm_sleep_save[ARM_SLEEP_SAVE_##x]), (x))
136#define ARM_SHOW(x) arm_sleep_save[ARM_SLEEP_SAVE_##x]
137
138#define ULPD_SAVE(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] = omap_readw(x)
139#define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x))
140#define ULPD_SHOW(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]
141
142#define MPUI1510_SAVE(x) mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x] = omap_readl(x)
143#define MPUI1510_RESTORE(x) omap_writel((mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x]), (x))
144#define MPUI1510_SHOW(x) mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x]
145
146#define MPUI1610_SAVE(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x] = omap_readl(x)
147#define MPUI1610_RESTORE(x) omap_writel((mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]), (x))
148#define MPUI1610_SHOW(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]
149
150/*
151 * List of global OMAP registers to preserve.
152 * More ones like CP and general purpose register values are preserved
153 * with the stack pointer in sleep.S.
154 */
155
156enum arm_save_state {
157 ARM_SLEEP_SAVE_START = 0,
158 /*
159 * MPU control registers 32 bits
160 */
161 ARM_SLEEP_SAVE_ARM_CKCTL,
162 ARM_SLEEP_SAVE_ARM_IDLECT1,
163 ARM_SLEEP_SAVE_ARM_IDLECT2,
164 ARM_SLEEP_SAVE_ARM_EWUPCT,
165 ARM_SLEEP_SAVE_ARM_RSTCT1,
166 ARM_SLEEP_SAVE_ARM_RSTCT2,
167 ARM_SLEEP_SAVE_ARM_SYSST,
168 ARM_SLEEP_SAVE_SIZE
169};
170
171enum ulpd_save_state {
172 ULPD_SLEEP_SAVE_START = 0,
173 /*
174 * ULPD registers 16 bits
175 */
176 ULPD_SLEEP_SAVE_ULPD_IT_STATUS,
177 ULPD_SLEEP_SAVE_ULPD_CLOCK_CTRL,
178 ULPD_SLEEP_SAVE_ULPD_SOFT_REQ,
179 ULPD_SLEEP_SAVE_ULPD_STATUS_REQ,
180 ULPD_SLEEP_SAVE_ULPD_DPLL_CTRL,
181 ULPD_SLEEP_SAVE_ULPD_POWER_CTRL,
182 ULPD_SLEEP_SAVE_SIZE
183};
184
185enum mpui1510_save_state {
186 MPUI1510_SLEEP_SAVE_START = 0,
187 /*
188 * MPUI registers 32 bits
189 */
190 MPUI1510_SLEEP_SAVE_MPUI_CTRL,
191 MPUI1510_SLEEP_SAVE_MPUI_DSP_BOOT_CONFIG,
192 MPUI1510_SLEEP_SAVE_MPUI_DSP_API_CONFIG,
193 MPUI1510_SLEEP_SAVE_MPUI_DSP_STATUS,
194 MPUI1510_SLEEP_SAVE_EMIFF_SDRAM_CONFIG,
195 MPUI1510_SLEEP_SAVE_EMIFS_CONFIG,
196 MPUI1510_SLEEP_SAVE_OMAP_IH1_MIR,
197 MPUI1510_SLEEP_SAVE_OMAP_IH2_MIR,
198#if defined(CONFIG_ARCH_OMAP1510)
199 MPUI1510_SLEEP_SAVE_SIZE
200#else
201 MPUI1510_SLEEP_SAVE_SIZE = 0
202#endif
203};
204
205enum mpui1610_save_state {
206 MPUI1610_SLEEP_SAVE_START = 0,
207 /*
208 * MPUI registers 32 bits
209 */
210 MPUI1610_SLEEP_SAVE_MPUI_CTRL,
211 MPUI1610_SLEEP_SAVE_MPUI_DSP_BOOT_CONFIG,
212 MPUI1610_SLEEP_SAVE_MPUI_DSP_API_CONFIG,
213 MPUI1610_SLEEP_SAVE_MPUI_DSP_STATUS,
214 MPUI1610_SLEEP_SAVE_EMIFF_SDRAM_CONFIG,
215 MPUI1610_SLEEP_SAVE_EMIFS_CONFIG,
216 MPUI1610_SLEEP_SAVE_OMAP_IH1_MIR,
217 MPUI1610_SLEEP_SAVE_OMAP_IH2_0_MIR,
218 MPUI1610_SLEEP_SAVE_OMAP_IH2_1_MIR,
219 MPUI1610_SLEEP_SAVE_OMAP_IH2_2_MIR,
220 MPUI1610_SLEEP_SAVE_OMAP_IH2_3_MIR,
221#if defined(CONFIG_ARCH_OMAP16XX)
222 MPUI1610_SLEEP_SAVE_SIZE
223#else
224 MPUI1610_SLEEP_SAVE_SIZE = 0
225#endif
226};
227
228#endif /* ASSEMBLER */
229#endif /* __ASM_ARCH_OMAP_PM_H */
diff --git a/include/asm-arm/arch-omap/system.h b/include/asm-arm/arch-omap/system.h
new file mode 100644
index 000000000000..17a2c4825f07
--- /dev/null
+++ b/include/asm-arm/arch-omap/system.h
@@ -0,0 +1,20 @@
1/*
2 * Copied from linux/include/asm-arm/arch-sa1100/system.h
3 * Copyright (c) 1999 Nicolas Pitre <nico@cam.org>
4 */
5#ifndef __ASM_ARCH_SYSTEM_H
6#define __ASM_ARCH_SYSTEM_H
7#include <linux/config.h>
8#include <asm/arch/hardware.h>
9
10static inline void arch_idle(void)
11{
12 cpu_do_idle();
13}
14
15static inline void arch_reset(char mode)
16{
17 omap_writew(1, ARM_RSTCT1);
18}
19
20#endif
diff --git a/include/asm-arm/arch-omap/tc.h b/include/asm-arm/arch-omap/tc.h
new file mode 100644
index 000000000000..8ded218cbea5
--- /dev/null
+++ b/include/asm-arm/arch-omap/tc.h
@@ -0,0 +1,108 @@
1/*
2 * linux/include/asm-arm/arch-omap/tc.h
3 *
4 * OMAP Traffic Controller
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 * Author: Imre Deak <imre.deak@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef __ASM_ARCH_TC_H
25#define __ASM_ARCH_TC_H
26
27#define TCMIF_BASE 0xfffecc00
28#define OMAP_TC_OCPT1_PRIOR (TCMIF_BASE + 0x00)
29#define OMAP_TC_EMIFS_PRIOR (TCMIF_BASE + 0x04)
30#define OMAP_TC_EMIFF_PRIOR (TCMIF_BASE + 0x08)
31#define EMIFS_CONFIG (TCMIF_BASE + 0x0c)
32#define EMIFS_CS0_CONFIG (TCMIF_BASE + 0x10)
33#define EMIFS_CS1_CONFIG (TCMIF_BASE + 0x14)
34#define EMIFS_CS2_CONFIG (TCMIF_BASE + 0x18)
35#define EMIFS_CS3_CONFIG (TCMIF_BASE + 0x1c)
36#define EMIFF_SDRAM_CONFIG (TCMIF_BASE + 0x20)
37#define EMIFF_MRS (TCMIF_BASE + 0x24)
38#define TC_TIMEOUT1 (TCMIF_BASE + 0x28)
39#define TC_TIMEOUT2 (TCMIF_BASE + 0x2c)
40#define TC_TIMEOUT3 (TCMIF_BASE + 0x30)
41#define TC_ENDIANISM (TCMIF_BASE + 0x34)
42#define EMIFF_SDRAM_CONFIG_2 (TCMIF_BASE + 0x3c)
43#define EMIF_CFG_DYNAMIC_WS (TCMIF_BASE + 0x40)
44#define EMIFS_ACS0 (TCMIF_BASE + 0x50)
45#define EMIFS_ACS1 (TCMIF_BASE + 0x54)
46#define EMIFS_ACS2 (TCMIF_BASE + 0x58)
47#define EMIFS_ACS3 (TCMIF_BASE + 0x5c)
48#define OMAP_TC_OCPT2_PRIOR (TCMIF_BASE + 0xd0)
49
50/* external EMIFS chipselect regions */
51#define OMAP_CS0_PHYS 0x00000000
52#define OMAP_CS0_SIZE SZ_64M
53
54#define OMAP_CS1_PHYS 0x04000000
55#define OMAP_CS1_SIZE SZ_64M
56
57#define OMAP_CS1A_PHYS OMAP_CS1_PHYS
58#define OMAP_CS1A_SIZE SZ_32M
59
60#define OMAP_CS1B_PHYS (OMAP_CS1A_PHYS + OMAP_CS1A_SIZE)
61#define OMAP_CS1B_SIZE SZ_32M
62
63#define OMAP_CS2_PHYS 0x08000000
64#define OMAP_CS2_SIZE SZ_64M
65
66#define OMAP_CS2A_PHYS OMAP_CS2_PHYS
67#define OMAP_CS2A_SIZE SZ_32M
68
69#define OMAP_CS2B_PHYS (OMAP_CS2A_PHYS + OMAP_CS2A_SIZE)
70#define OMAP_CS2B_SIZE SZ_32M
71
72#define OMAP_CS3_PHYS 0x0c000000
73#define OMAP_CS3_SIZE SZ_64M
74
75#ifndef __ASSEMBLER__
76
77/* EMIF Slow Interface Configuration Register */
78#define OMAP_EMIFS_CONFIG_REG __REG32(EMIFS_CONFIG)
79
80#define OMAP_EMIFS_CONFIG_FR (1 << 4)
81#define OMAP_EMIFS_CONFIG_PDE (1 << 3)
82#define OMAP_EMIFS_CONFIG_PWD_EN (1 << 2)
83#define OMAP_EMIFS_CONFIG_BM (1 << 1)
84#define OMAP_EMIFS_CONFIG_WP (1 << 0)
85
86#define EMIFS_CCS(n) __REG32(EMIFS_CS0_CONFIG + (4 * (n)))
87#define EMIFS_ACS(n) __REG32(EMIFS_ACS0 + (4 * (n)))
88
89/* Almost all documentation for chip and board memory maps assumes
90 * BM is clear. Most devel boards have a switch to control booting
91 * from NOR flash (using external chipselect 3) rather than mask ROM,
92 * which uses BM to interchange the physical CS0 and CS3 addresses.
93 */
94static inline u32 omap_cs0_phys(void)
95{
96 return (OMAP_EMIFS_CONFIG_REG & OMAP_EMIFS_CONFIG_BM)
97 ? OMAP_CS3_PHYS : 0;
98}
99
100static inline u32 omap_cs3_phys(void)
101{
102 return (OMAP_EMIFS_CONFIG_REG & OMAP_EMIFS_CONFIG_BM)
103 ? 0 : OMAP_CS3_PHYS;
104}
105
106#endif /* __ASSEMBLER__ */
107
108#endif /* __ASM_ARCH_TC_H */
diff --git a/include/asm-arm/arch-omap/timex.h b/include/asm-arm/arch-omap/timex.h
new file mode 100644
index 000000000000..b61ddb491e83
--- /dev/null
+++ b/include/asm-arm/arch-omap/timex.h
@@ -0,0 +1,33 @@
1/*
2 * linux/include/asm-arm/arch-omap/timex.h
3 *
4 * Copyright (C) 2000 RidgeRun, Inc.
5 * Author: Greg Lonnon <glonnon@ridgerun.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#if !defined(__ASM_ARCH_OMAP_TIMEX_H)
29#define __ASM_ARCH_OMAP_TIMEX_H
30
31#define CLOCK_TICK_RATE (HZ * 100000UL)
32
33#endif /* __ASM_ARCH_OMAP_TIMEX_H */
diff --git a/include/asm-arm/arch-omap/tps65010.h b/include/asm-arm/arch-omap/tps65010.h
new file mode 100644
index 000000000000..0f97bb2e8fce
--- /dev/null
+++ b/include/asm-arm/arch-omap/tps65010.h
@@ -0,0 +1,80 @@
1/* linux/include/asm-arm/arch-omap/tps65010.h
2 *
3 * Functions to access TPS65010 power management device.
4 *
5 * Copyright (C) 2004 Dirk Behme <dirk.behme@de.bosch.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __ASM_ARCH_TPS65010_H
29#define __ASM_ARCH_TPS65010_H
30
31/*
32 * ----------------------------------------------------------------------------
33 * Macros used by exported functions
34 * ----------------------------------------------------------------------------
35 */
36
37#define LED1 1
38#define LED2 2
39#define OFF 0
40#define ON 1
41#define BLINK 2
42#define GPIO1 1
43#define GPIO2 2
44#define GPIO3 3
45#define GPIO4 4
46#define LOW 0
47#define HIGH 1
48
49/*
50 * ----------------------------------------------------------------------------
51 * Exported functions
52 * ----------------------------------------------------------------------------
53 */
54
55/* Draw from VBUS:
56 * 0 mA -- DON'T DRAW (might supply power instead)
57 * 100 mA -- usb unit load (slowest charge rate)
58 * 500 mA -- usb high power (fast battery charge)
59 */
60extern int tps65010_set_vbus_draw(unsigned mA);
61
62/* tps65010_set_gpio_out_value parameter:
63 * gpio: GPIO1, GPIO2, GPIO3 or GPIO4
64 * value: LOW or HIGH
65 */
66extern int tps65010_set_gpio_out_value(unsigned gpio, unsigned value);
67
68/* tps65010_set_led parameter:
69 * led: LED1 or LED2
70 * mode: ON, OFF or BLINK
71 */
72extern int tps65010_set_led(unsigned led, unsigned mode);
73
74/* tps65010_set_low_pwr parameter:
75 * mode: ON or OFF
76 */
77extern int tps65010_set_low_pwr(unsigned mode);
78
79#endif /* __ASM_ARCH_TPS65010_H */
80
diff --git a/include/asm-arm/arch-omap/uncompress.h b/include/asm-arm/arch-omap/uncompress.h
new file mode 100644
index 000000000000..3e640aba8c20
--- /dev/null
+++ b/include/asm-arm/arch-omap/uncompress.h
@@ -0,0 +1,82 @@
1/*
2 * linux/include/asm-arm/arch-omap/uncompress.h
3 *
4 * Serial port stubs for kernel decompress status messages
5 *
6 * Initially based on:
7 * linux-2.4.15-rmk1-dsplinux1.6/include/asm-arm/arch-omap1510/uncompress.h
8 * Copyright (C) 2000 RidgeRun, Inc.
9 * Author: Greg Lonnon <glonnon@ridgerun.com>
10 *
11 * Rewritten by:
12 * Author: <source@mvista.com>
13 * 2004 (c) MontaVista Software, Inc.
14 *
15 * This file is licensed under the terms of the GNU General Public License
16 * version 2. This program is licensed "as is" without any warranty of any
17 * kind, whether express or implied.
18 */
19
20#include <linux/config.h>
21#include <linux/types.h>
22#include <linux/serial_reg.h>
23#include <asm/arch/hardware.h>
24
25unsigned int system_rev;
26
27#define UART_OMAP_MDR1 0x08 /* mode definition register */
28#define OMAP_ID_730 0x355F
29#define ID_MASK 0x7fff
30#define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0)
31#define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK
32
33static void
34putstr(const char *s)
35{
36 volatile u8 * uart = 0;
37 int shift;
38
39#ifdef CONFIG_OMAP_LL_DEBUG_UART3
40 uart = (volatile u8 *)(OMAP_UART3_BASE);
41#elif CONFIG_OMAP_LL_DEBUG_UART2
42 uart = (volatile u8 *)(OMAP_UART2_BASE);
43#else
44 uart = (volatile u8 *)(OMAP_UART1_BASE);
45#endif
46
47 /* Determine which serial port to use */
48 do {
49 /* MMU is not on, so cpu_is_omapXXXX() won't work here */
50 unsigned int omap_id = omap_get_id();
51
52 if (omap_id == OMAP_ID_730)
53 shift = 0;
54 else
55 shift = 2;
56
57 if (check_port(uart, shift))
58 break;
59 /* Silent boot if no serial ports are enabled. */
60 return;
61 } while (0);
62
63 /*
64 * Now, xmit each character
65 */
66 while (*s) {
67 while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
68 barrier();
69 uart[UART_TX << shift] = *s;
70 if (*s++ == '\n') {
71 while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
72 barrier();
73 uart[UART_TX << shift] = '\r';
74 }
75 }
76}
77
78/*
79 * nothing to do
80 */
81#define arch_decomp_setup()
82#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-omap/usb.h b/include/asm-arm/arch-omap/usb.h
new file mode 100644
index 000000000000..1438c6cef0ca
--- /dev/null
+++ b/include/asm-arm/arch-omap/usb.h
@@ -0,0 +1,108 @@
1// include/asm-arm/mach-omap/usb.h
2
3#ifndef __ASM_ARCH_OMAP_USB_H
4#define __ASM_ARCH_OMAP_USB_H
5
6#include <asm/arch/board.h>
7
8/*-------------------------------------------------------------------------*/
9
10#define OTG_BASE 0xfffb0400
11#define UDC_BASE 0xfffb4000
12#define OMAP_OHCI_BASE 0xfffba000
13
14/*-------------------------------------------------------------------------*/
15
16/*
17 * OTG and transceiver registers, for OMAPs starting with ARM926
18 */
19#define OTG_REG32(offset) __REG32(OTG_BASE + (offset))
20#define OTG_REG16(offset) __REG16(OTG_BASE + (offset))
21
22#define OTG_REV_REG OTG_REG32(0x00)
23#define OTG_SYSCON_1_REG OTG_REG32(0x04)
24# define USB2_TRX_MODE(w) (((w)>>24)&0x07)
25# define USB1_TRX_MODE(w) (((w)>>20)&0x07)
26# define USB0_TRX_MODE(w) (((w)>>16)&0x07)
27# define OTG_IDLE_EN (1 << 15)
28# define HST_IDLE_EN (1 << 14)
29# define DEV_IDLE_EN (1 << 13)
30# define OTG_RESET_DONE (1 << 2)
31#define OTG_SYSCON_2_REG OTG_REG32(0x08)
32# define OTG_EN (1 << 31)
33# define USBX_SYNCHRO (1 << 30)
34# define OTG_MST16 (1 << 29)
35# define SRP_GPDATA (1 << 28)
36# define SRP_GPDVBUS (1 << 27)
37# define SRP_GPUVBUS(w) (((w)>>24)&0x07)
38# define A_WAIT_VRISE(w) (((w)>>20)&0x07)
39# define B_ASE_BRST(w) (((w)>>16)&0x07)
40# define SRP_DPW (1 << 14)
41# define SRP_DATA (1 << 13)
42# define SRP_VBUS (1 << 12)
43# define OTG_PADEN (1 << 10)
44# define HMC_PADEN (1 << 9)
45# define UHOST_EN (1 << 8)
46# define HMC_TLLSPEED (1 << 7)
47# define HMC_TLLATTACH (1 << 6)
48# define OTG_HMC(w) (((w)>>0)&0x3f)
49#define OTG_CTRL_REG OTG_REG32(0x0c)
50# define OTG_ASESSVLD (1 << 20)
51# define OTG_BSESSEND (1 << 19)
52# define OTG_BSESSVLD (1 << 18)
53# define OTG_VBUSVLD (1 << 17)
54# define OTG_ID (1 << 16)
55# define OTG_DRIVER_SEL (1 << 15)
56# define OTG_A_SETB_HNPEN (1 << 12)
57# define OTG_A_BUSREQ (1 << 11)
58# define OTG_B_HNPEN (1 << 9)
59# define OTG_B_BUSREQ (1 << 8)
60# define OTG_BUSDROP (1 << 7)
61# define OTG_PULLDOWN (1 << 5)
62# define OTG_PULLUP (1 << 4)
63# define OTG_DRV_VBUS (1 << 3)
64# define OTG_PD_VBUS (1 << 2)
65# define OTG_PU_VBUS (1 << 1)
66# define OTG_PU_ID (1 << 0)
67#define OTG_IRQ_EN_REG OTG_REG16(0x10)
68# define DRIVER_SWITCH (1 << 15)
69# define A_VBUS_ERR (1 << 13)
70# define A_REQ_TMROUT (1 << 12)
71# define A_SRP_DETECT (1 << 11)
72# define B_HNP_FAIL (1 << 10)
73# define B_SRP_TMROUT (1 << 9)
74# define B_SRP_DONE (1 << 8)
75# define B_SRP_STARTED (1 << 7)
76# define OPRT_CHG (1 << 0)
77#define OTG_IRQ_SRC_REG OTG_REG16(0x14)
78 // same bits as in IRQ_EN
79#define OTG_OUTCTRL_REG OTG_REG16(0x18)
80# define OTGVPD (1 << 14)
81# define OTGVPU (1 << 13)
82# define OTGPUID (1 << 12)
83# define USB2VDR (1 << 10)
84# define USB2PDEN (1 << 9)
85# define USB2PUEN (1 << 8)
86# define USB1VDR (1 << 6)
87# define USB1PDEN (1 << 5)
88# define USB1PUEN (1 << 4)
89# define USB0VDR (1 << 2)
90# define USB0PDEN (1 << 1)
91# define USB0PUEN (1 << 0)
92#define OTG_TEST_REG OTG_REG16(0x20)
93#define OTG_VENDOR_CODE_REG OTG_REG32(0xfc)
94
95/*-------------------------------------------------------------------------*/
96
97#define USB_TRANSCEIVER_CTRL_REG __REG32(0xfffe1000 + 0x0064)
98# define CONF_USB2_UNI_R (1 << 8)
99# define CONF_USB1_UNI_R (1 << 7)
100# define CONF_USB_PORT0_R(x) (((x)>>4)&0x7)
101# define CONF_USB0_ISOLATE_R (1 << 3)
102# define CONF_USB_PWRDN_DM_R (1 << 2)
103# define CONF_USB_PWRDN_DP_R (1 << 1)
104
105
106
107
108#endif /* __ASM_ARCH_OMAP_USB_H */
diff --git a/include/asm-arm/arch-omap/vmalloc.h b/include/asm-arm/arch-omap/vmalloc.h
new file mode 100644
index 000000000000..c6a83581a2fc
--- /dev/null
+++ b/include/asm-arm/arch-omap/vmalloc.h
@@ -0,0 +1,33 @@
1/*
2 * linux/include/asm-arm/arch-omap/vmalloc.h
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 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/*
22 * Just any arbitrary offset to the start of the vmalloc VM area: the
23 * current 8MB value just means that there will be a 8MB "hole" after the
24 * physical memory until the kernel virtual memory starts. That means that
25 * any out-of-bounds memory accesses will hopefully be caught.
26 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
27 * area for the same reason. ;)
28 */
29#define VMALLOC_OFFSET (8*1024*1024)
30#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
31#define VMALLOC_VMADDR(x) ((unsigned long)(x))
32#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
33
diff --git a/include/asm-arm/arch-pxa/audio.h b/include/asm-arm/arch-pxa/audio.h
new file mode 100644
index 000000000000..60976f830e3f
--- /dev/null
+++ b/include/asm-arm/arch-pxa/audio.h
@@ -0,0 +1,16 @@
1#ifndef __ASM_ARCH_AUDIO_H__
2#define __ASM_ARCH_AUDIO_H__
3
4#include <sound/driver.h>
5#include <sound/core.h>
6#include <sound/pcm.h>
7
8typedef struct {
9 int (*startup)(snd_pcm_substream_t *, void *);
10 void (*shutdown)(snd_pcm_substream_t *, void *);
11 void (*suspend)(void *);
12 void (*resume)(void *);
13 void *priv;
14} pxa2xx_audio_ops_t;
15
16#endif
diff --git a/include/asm-arm/arch-pxa/bitfield.h b/include/asm-arm/arch-pxa/bitfield.h
new file mode 100644
index 000000000000..f1f0e3387d9c
--- /dev/null
+++ b/include/asm-arm/arch-pxa/bitfield.h
@@ -0,0 +1,113 @@
1/*
2 * FILE bitfield.h
3 *
4 * Version 1.1
5 * Author Copyright (c) Marc A. Viredaz, 1998
6 * DEC Western Research Laboratory, Palo Alto, CA
7 * Date April 1998 (April 1997)
8 * System Advanced RISC Machine (ARM)
9 * Language C or ARM Assembly
10 * Purpose Definition of macros to operate on bit fields.
11 */
12
13
14
15#ifndef __BITFIELD_H
16#define __BITFIELD_H
17
18#ifndef __ASSEMBLY__
19#define UData(Data) ((unsigned long) (Data))
20#else
21#define UData(Data) (Data)
22#endif
23
24
25/*
26 * MACRO: Fld
27 *
28 * Purpose
29 * The macro "Fld" encodes a bit field, given its size and its shift value
30 * with respect to bit 0.
31 *
32 * Note
33 * A more intuitive way to encode bit fields would have been to use their
34 * mask. However, extracting size and shift value information from a bit
35 * field's mask is cumbersome and might break the assembler (255-character
36 * line-size limit).
37 *
38 * Input
39 * Size Size of the bit field, in number of bits.
40 * Shft Shift value of the bit field with respect to bit 0.
41 *
42 * Output
43 * Fld Encoded bit field.
44 */
45
46#define Fld(Size, Shft) (((Size) << 16) + (Shft))
47
48
49/*
50 * MACROS: FSize, FShft, FMsk, FAlnMsk, F1stBit
51 *
52 * Purpose
53 * The macros "FSize", "FShft", "FMsk", "FAlnMsk", and "F1stBit" return
54 * the size, shift value, mask, aligned mask, and first bit of a
55 * bit field.
56 *
57 * Input
58 * Field Encoded bit field (using the macro "Fld").
59 *
60 * Output
61 * FSize Size of the bit field, in number of bits.
62 * FShft Shift value of the bit field with respect to bit 0.
63 * FMsk Mask for the bit field.
64 * FAlnMsk Mask for the bit field, aligned on bit 0.
65 * F1stBit First bit of the bit field.
66 */
67
68#define FSize(Field) ((Field) >> 16)
69#define FShft(Field) ((Field) & 0x0000FFFF)
70#define FMsk(Field) (((UData (1) << FSize (Field)) - 1) << FShft (Field))
71#define FAlnMsk(Field) ((UData (1) << FSize (Field)) - 1)
72#define F1stBit(Field) (UData (1) << FShft (Field))
73
74
75/*
76 * MACRO: FInsrt
77 *
78 * Purpose
79 * The macro "FInsrt" inserts a value into a bit field by shifting the
80 * former appropriately.
81 *
82 * Input
83 * Value Bit-field value.
84 * Field Encoded bit field (using the macro "Fld").
85 *
86 * Output
87 * FInsrt Bit-field value positioned appropriately.
88 */
89
90#define FInsrt(Value, Field) \
91 (UData (Value) << FShft (Field))
92
93
94/*
95 * MACRO: FExtr
96 *
97 * Purpose
98 * The macro "FExtr" extracts the value of a bit field by masking and
99 * shifting it appropriately.
100 *
101 * Input
102 * Data Data containing the bit-field to be extracted.
103 * Field Encoded bit field (using the macro "Fld").
104 *
105 * Output
106 * FExtr Bit-field value.
107 */
108
109#define FExtr(Data, Field) \
110 ((UData (Data) >> FShft (Field)) & FAlnMsk (Field))
111
112
113#endif /* __BITFIELD_H */
diff --git a/include/asm-arm/arch-pxa/corgi.h b/include/asm-arm/arch-pxa/corgi.h
new file mode 100644
index 000000000000..324db06b5dd4
--- /dev/null
+++ b/include/asm-arm/arch-pxa/corgi.h
@@ -0,0 +1,120 @@
1/*
2 * Hardware specific definitions for SL-C7xx series of PDAs
3 *
4 * Copyright (c) 2004-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#ifndef __ASM_ARCH_CORGI_H
14#define __ASM_ARCH_CORGI_H 1
15
16
17/*
18 * Corgi (Non Standard) GPIO Definitions
19 */
20#define CORGI_GPIO_KEY_INT (0) /* Keyboard Interrupt */
21#define CORGI_GPIO_AC_IN (1) /* Charger Detection */
22#define CORGI_GPIO_WAKEUP (3) /* System wakeup notification? */
23#define CORGI_GPIO_AK_INT (4) /* Headphone Jack Control Interrupt */
24#define CORGI_GPIO_TP_INT (5) /* Touch Panel Interrupt */
25#define CORGI_GPIO_nSD_WP (7) /* SD Write Protect? */
26#define CORGI_GPIO_nSD_DETECT (9) /* MMC/SD Card Detect */
27#define CORGI_GPIO_nSD_INT (10) /* SD Interrupt for SDIO? */
28#define CORGI_GPIO_MAIN_BAT_LOW (11) /* Main Battery Low Notification */
29#define CORGI_GPIO_BAT_COVER (11) /* Battery Cover Detect */
30#define CORGI_GPIO_LED_ORANGE (13) /* Orange LED Control */
31#define CORGI_GPIO_CF_CD (14) /* Compact Flash Card Detect */
32#define CORGI_GPIO_CHRG_FULL (16) /* Charging Complete Notification */
33#define CORGI_GPIO_CF_IRQ (17) /* Compact Flash Interrupt */
34#define CORGI_GPIO_LCDCON_CS (19) /* LCD Control Chip Select */
35#define CORGI_GPIO_MAX1111_CS (20) /* MAX1111 Chip Select */
36#define CORGI_GPIO_ADC_TEMP_ON (21) /* Select battery voltage or temperature */
37#define CORGI_GPIO_IR_ON (22) /* Enable IR Transciever */
38#define CORGI_GPIO_ADS7846_CS (24) /* ADS7846 Chip Select */
39#define CORGI_GPIO_SD_PWR (33) /* MMC/SD Power */
40#define CORGI_GPIO_CHRG_ON (38) /* Enable battery Charging */
41#define CORGI_GPIO_DISCHARGE_ON (42) /* Enable battery Discharge */
42#define CORGI_GPIO_CHRG_UKN (43) /* Unknown Charging (Bypass Control?) */
43#define CORGI_GPIO_HSYNC (44) /* LCD HSync Pulse */
44#define CORGI_GPIO_USB_PULLUP (45) /* USB show presence to host */
45
46
47/*
48 * Corgi Keyboard Definitions
49 */
50#define CORGI_KEY_STROBE_NUM (12)
51#define CORGI_KEY_SENSE_NUM (8)
52#define CORGI_GPIO_ALL_STROBE_BIT (0x00003ffc)
53#define CORGI_GPIO_HIGH_SENSE_BIT (0xfc000000)
54#define CORGI_GPIO_HIGH_SENSE_RSHIFT (26)
55#define CORGI_GPIO_LOW_SENSE_BIT (0x00000003)
56#define CORGI_GPIO_LOW_SENSE_LSHIFT (6)
57#define CORGI_GPIO_STROBE_BIT(a) GPIO_bit(66+(a))
58#define CORGI_GPIO_SENSE_BIT(a) GPIO_bit(58+(a))
59#define CORGI_GAFR_ALL_STROBE_BIT (0x0ffffff0)
60#define CORGI_GAFR_HIGH_SENSE_BIT (0xfff00000)
61#define CORGI_GAFR_LOW_SENSE_BIT (0x0000000f)
62#define CORGI_GPIO_KEY_SENSE(a) (58+(a))
63#define CORGI_GPIO_KEY_STROBE(a) (66+(a))
64
65
66/*
67 * Corgi Interrupts
68 */
69#define CORGI_IRQ_GPIO_KEY_INT IRQ_GPIO(0)
70#define CORGI_IRQ_GPIO_AC_IN IRQ_GPIO(1)
71#define CORGI_IRQ_GPIO_WAKEUP IRQ_GPIO(3)
72#define CORGI_IRQ_GPIO_AK_INT IRQ_GPIO(4)
73#define CORGI_IRQ_GPIO_TP_INT IRQ_GPIO(5)
74#define CORGI_IRQ_GPIO_nSD_DETECT IRQ_GPIO(9)
75#define CORGI_IRQ_GPIO_nSD_INT IRQ_GPIO(10)
76#define CORGI_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO(11)
77#define CORGI_IRQ_GPIO_CF_CD IRQ_GPIO(14)
78#define CORGI_IRQ_GPIO_CHRG_FULL IRQ_GPIO(16) /* Battery fully charged */
79#define CORGI_IRQ_GPIO_CF_IRQ IRQ_GPIO(17)
80#define CORGI_IRQ_GPIO_KEY_SENSE(a) IRQ_GPIO(58+(a)) /* Keyboard Sense lines */
81
82
83/*
84 * Corgi SCOOP GPIOs and Config
85 */
86#define CORGI_SCP_LED_GREEN SCOOP_GPCR_PA11
87#define CORGI_SCP_SWA SCOOP_GPCR_PA12 /* Hinge Switch A */
88#define CORGI_SCP_SWB SCOOP_GPCR_PA13 /* Hinge Switch B */
89#define CORGI_SCP_MUTE_L SCOOP_GPCR_PA14
90#define CORGI_SCP_MUTE_R SCOOP_GPCR_PA15
91#define CORGI_SCP_AKIN_PULLUP SCOOP_GPCR_PA16
92#define CORGI_SCP_APM_ON SCOOP_GPCR_PA17
93#define CORGI_SCP_BACKLIGHT_CONT SCOOP_GPCR_PA18
94#define CORGI_SCP_MIC_BIAS SCOOP_GPCR_PA19
95
96#define CORGI_SCOOP_IO_DIR ( CORGI_SCP_LED_GREEN | CORGI_SCP_MUTE_L | CORGI_SCP_MUTE_R | \
97 CORGI_SCP_AKIN_PULLUP | CORGI_SCP_APM_ON | CORGI_SCP_BACKLIGHT_CONT | \
98 CORGI_SCP_MIC_BIAS )
99#define CORGI_SCOOP_IO_OUT ( CORGI_SCP_MUTE_L | CORGI_SCP_MUTE_R )
100
101
102/*
103 * Shared data structures
104 */
105extern struct platform_device corgiscoop_device;
106
107/*
108 * External Functions
109 */
110extern unsigned long corgi_ssp_ads7846_putget(unsigned long);
111extern unsigned long corgi_ssp_ads7846_get(void);
112extern void corgi_ssp_ads7846_put(ulong data);
113extern void corgi_ssp_ads7846_lock(void);
114extern void corgi_ssp_ads7846_unlock(void);
115extern void corgi_ssp_lcdtg_send (u8 adrs, u8 data);
116extern void corgi_ssp_blduty_set(int duty);
117extern int corgi_ssp_max1111_get(ulong data);
118
119#endif /* __ASM_ARCH_CORGI_H */
120
diff --git a/include/asm-arm/arch-pxa/debug-macro.S b/include/asm-arm/arch-pxa/debug-macro.S
new file mode 100644
index 000000000000..f288e74b67c2
--- /dev/null
+++ b/include/asm-arm/arch-pxa/debug-macro.S
@@ -0,0 +1,36 @@
1/* linux/include/asm-arm/arch-pxa/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled?
17 moveq \rx, #0x40000000 @ physical
18 movne \rx, #io_p2v(0x40000000) @ virtual
19 orr \rx, \rx, #0x00100000
20 .endm
21
22 .macro senduart,rd,rx
23 str \rd, [\rx, #0]
24 .endm
25
26 .macro busyuart,rd,rx
271002: ldr \rd, [\rx, #0x14]
28 tst \rd, #(1 << 6)
29 beq 1002b
30 .endm
31
32 .macro waituart,rd,rx
331001: ldr \rd, [\rx, #0x14]
34 tst \rd, #(1 << 5)
35 beq 1001b
36 .endm
diff --git a/include/asm-arm/arch-pxa/dma.h b/include/asm-arm/arch-pxa/dma.h
new file mode 100644
index 000000000000..56db3d49bfc8
--- /dev/null
+++ b/include/asm-arm/arch-pxa/dma.h
@@ -0,0 +1,67 @@
1/*
2 * linux/include/asm-arm/arch-pxa/dma.h
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#ifndef __ASM_ARCH_DMA_H
13#define __ASM_ARCH_DMA_H
14
15#define MAX_DMA_ADDRESS 0xffffffff
16
17/* No DMA as the rest of the world see it */
18#define MAX_DMA_CHANNELS 0
19
20/*
21 * Descriptor structure for PXA's DMA engine
22 * Note: this structure must always be aligned to a 16-byte boundary.
23 */
24
25typedef struct pxa_dma_desc {
26 volatile u32 ddadr; /* Points to the next descriptor + flags */
27 volatile u32 dsadr; /* DSADR value for the current transfer */
28 volatile u32 dtadr; /* DTADR value for the current transfer */
29 volatile u32 dcmd; /* DCMD value for the current transfer */
30} pxa_dma_desc;
31
32#if defined(CONFIG_PXA27x)
33
34#define PXA_DMA_CHANNELS 32
35#define PXA_DMA_NBCH(prio) ((prio == DMA_PRIO_LOW) ? 16 : 8)
36
37typedef enum {
38 DMA_PRIO_HIGH = 0,
39 DMA_PRIO_MEDIUM = 8,
40 DMA_PRIO_LOW = 16
41} pxa_dma_prio;
42
43#elif defined(CONFIG_PXA25x)
44
45#define PXA_DMA_CHANNELS 16
46#define PXA_DMA_NBCH(prio) ((prio == DMA_PRIO_LOW) ? 8 : 4)
47
48typedef enum {
49 DMA_PRIO_HIGH = 0,
50 DMA_PRIO_MEDIUM = 4,
51 DMA_PRIO_LOW = 8
52} pxa_dma_prio;
53
54#endif
55
56/*
57 * DMA registration
58 */
59
60int pxa_request_dma (char *name,
61 pxa_dma_prio prio,
62 void (*irq_handler)(int, void *, struct pt_regs *),
63 void *data);
64
65void pxa_free_dma (int dma_ch);
66
67#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-pxa/entry-macro.S b/include/asm-arm/arch-pxa/entry-macro.S
new file mode 100644
index 000000000000..2abfc8bb3ee5
--- /dev/null
+++ b/include/asm-arm/arch-pxa/entry-macro.S
@@ -0,0 +1,31 @@
1/*
2 * include/asm-arm/arch-pxa/entry-macro.S
3 *
4 * Low-level IRQ helper macros for PXA-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11 .macro disable_fiq
12 .endm
13
14 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
15#ifdef CONFIG_PXA27x
16 mrc p6, 0, \irqstat, c0, c0, 0 @ ICIP
17 mrc p6, 0, \irqnr, c1, c0, 0 @ ICMR
18#else
19 mov \base, #io_p2v(0x40000000) @ IIR Ctl = 0x40d00000
20 add \base, \base, #0x00d00000
21 ldr \irqstat, [\base, #0] @ ICIP
22 ldr \irqnr, [\base, #4] @ ICMR
23#endif
24 ands \irqnr, \irqstat, \irqnr
25 beq 1001f
26 rsb \irqstat, \irqnr, #0
27 and \irqstat, \irqstat, \irqnr
28 clz \irqnr, \irqstat
29 rsb \irqnr, \irqnr, #(31 - PXA_IRQ_SKIP)
301001:
31 .endm
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h
new file mode 100644
index 000000000000..72b04d846a23
--- /dev/null
+++ b/include/asm-arm/arch-pxa/hardware.h
@@ -0,0 +1,95 @@
1/*
2 * linux/include/asm-arm/arch-pxa/hardware.h
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#ifndef __ASM_ARCH_HARDWARE_H
14#define __ASM_ARCH_HARDWARE_H
15
16/*
17 * We requires absolute addresses.
18 */
19#define PCIO_BASE 0
20
21/*
22 * Workarounds for at least 2 errata so far require this.
23 * The mapping is set in mach-pxa/generic.c.
24 */
25#define UNCACHED_PHYS_0 0xff000000
26#define UNCACHED_ADDR UNCACHED_PHYS_0
27
28/*
29 * Intel PXA2xx internal register mapping:
30 *
31 * 0x40000000 - 0x41ffffff <--> 0xf2000000 - 0xf3ffffff
32 * 0x44000000 - 0x45ffffff <--> 0xf4000000 - 0xf5ffffff
33 * 0x48000000 - 0x49ffffff <--> 0xf6000000 - 0xf7ffffff
34 * 0x4c000000 - 0x4dffffff <--> 0xf8000000 - 0xf9ffffff
35 * 0x50000000 - 0x51ffffff <--> 0xfa000000 - 0xfbffffff
36 * 0x54000000 - 0x55ffffff <--> 0xfc000000 - 0xfdffffff
37 * 0x58000000 - 0x59ffffff <--> 0xfe000000 - 0xffffffff
38 *
39 * Note that not all PXA2xx chips implement all those addresses, and the
40 * kernel only maps the minimum needed range of this mapping.
41 */
42#define io_p2v(x) (0xf2000000 + ((x) & 0x01ffffff) + (((x) & 0x1c000000) >> 1))
43#define io_v2p(x) (0x3c000000 + ((x) & 0x01ffffff) + (((x) & 0x0e000000) << 1))
44
45#ifndef __ASSEMBLY__
46
47#if 0
48# define __REG(x) (*((volatile u32 *)io_p2v(x)))
49#else
50/*
51 * This __REG() version gives the same results as the one above, except
52 * that we are fooling gcc somehow so it generates far better and smaller
53 * assembly code for access to contigous registers. It's a shame that gcc
54 * doesn't guess this by itself.
55 */
56#include <asm/types.h>
57typedef struct { volatile u32 offset[4096]; } __regbase;
58# define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2]
59# define __REG(x) __REGP(io_p2v(x))
60#endif
61
62/* With indexed regs we don't want to feed the index through io_p2v()
63 especially if it is a variable, otherwise horrible code will result. */
64# define __REG2(x,y) (*(volatile u32 *)((u32)&__REG(x) + (y)))
65
66# define __PREG(x) (io_v2p((u32)&(x)))
67
68#else
69
70# define __REG(x) io_p2v(x)
71# define __PREG(x) io_v2p(x)
72
73#endif
74
75#ifndef __ASSEMBLY__
76
77/*
78 * Handy routine to set GPIO alternate functions
79 */
80extern void pxa_gpio_mode( int gpio_mode );
81
82/*
83 * Routine to enable or disable CKEN
84 */
85extern void pxa_set_cken(int clock, int enable);
86
87/*
88 * return current memory and LCD clock frequency in units of 10kHz
89 */
90extern unsigned int get_memclk_frequency_10khz(void);
91extern unsigned int get_lcdclk_frequency_10khz(void);
92
93#endif
94
95#endif /* _ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-pxa/idp.h b/include/asm-arm/arch-pxa/idp.h
new file mode 100644
index 000000000000..e7ef497417bb
--- /dev/null
+++ b/include/asm-arm/arch-pxa/idp.h
@@ -0,0 +1,200 @@
1/*
2 * linux/include/asm-arm/arch-pxa/idp.h
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 * Changes for 2.6 kernel.
16 */
17
18#include <linux/config.h>
19
20/*
21 * Note: this file must be safe to include in assembly files
22 *
23 * Support for the Vibren PXA255 IDP requires rev04 or later
24 * IDP hardware.
25 */
26
27
28#define IDP_FLASH_PHYS (PXA_CS0_PHYS)
29#define IDP_ALT_FLASH_PHYS (PXA_CS1_PHYS)
30#define IDP_MEDIAQ_PHYS (PXA_CS3_PHYS)
31#define IDP_IDE_PHYS (PXA_CS5_PHYS + 0x03000000)
32#define IDP_ETH_PHYS (PXA_CS5_PHYS + 0x03400000)
33#define IDP_COREVOLT_PHYS (PXA_CS5_PHYS + 0x03800000)
34#define IDP_CPLD_PHYS (PXA_CS5_PHYS + 0x03C00000)
35
36
37/*
38 * virtual memory map
39 */
40
41#define IDP_COREVOLT_VIRT (0xf0000000)
42#define IDP_COREVOLT_SIZE (1*1024*1024)
43
44#define IDP_CPLD_VIRT (IDP_COREVOLT_VIRT + IDP_COREVOLT_SIZE)
45#define IDP_CPLD_SIZE (1*1024*1024)
46
47#if (IDP_CPLD_VIRT + IDP_CPLD_SIZE) > 0xfc000000
48#error Your custom IO space is getting a bit large !!
49#endif
50
51#define CPLD_P2V(x) ((x) - IDP_CPLD_PHYS + IDP_CPLD_VIRT)
52#define CPLD_V2P(x) ((x) - IDP_CPLD_VIRT + IDP_CPLD_PHYS)
53
54#ifndef __ASSEMBLY__
55# define __CPLD_REG(x) (*((volatile unsigned long *)CPLD_P2V(x)))
56#else
57# define __CPLD_REG(x) CPLD_P2V(x)
58#endif
59
60/* board level registers in the CPLD: (offsets from CPLD_VIRT) */
61
62#define _IDP_CPLD_REV (IDP_CPLD_PHYS + 0x00)
63#define _IDP_CPLD_PERIPH_PWR (IDP_CPLD_PHYS + 0x04)
64#define _IDP_CPLD_LED_CONTROL (IDP_CPLD_PHYS + 0x08)
65#define _IDP_CPLD_KB_COL_HIGH (IDP_CPLD_PHYS + 0x0C)
66#define _IDP_CPLD_KB_COL_LOW (IDP_CPLD_PHYS + 0x10)
67#define _IDP_CPLD_PCCARD_EN (IDP_CPLD_PHYS + 0x14)
68#define _IDP_CPLD_GPIOH_DIR (IDP_CPLD_PHYS + 0x18)
69#define _IDP_CPLD_GPIOH_VALUE (IDP_CPLD_PHYS + 0x1C)
70#define _IDP_CPLD_GPIOL_DIR (IDP_CPLD_PHYS + 0x20)
71#define _IDP_CPLD_GPIOL_VALUE (IDP_CPLD_PHYS + 0x24)
72#define _IDP_CPLD_PCCARD_PWR (IDP_CPLD_PHYS + 0x28)
73#define _IDP_CPLD_MISC_CTRL (IDP_CPLD_PHYS + 0x2C)
74#define _IDP_CPLD_LCD (IDP_CPLD_PHYS + 0x30)
75#define _IDP_CPLD_FLASH_WE (IDP_CPLD_PHYS + 0x34)
76
77#define _IDP_CPLD_KB_ROW (IDP_CPLD_PHYS + 0x50)
78#define _IDP_CPLD_PCCARD0_STATUS (IDP_CPLD_PHYS + 0x54)
79#define _IDP_CPLD_PCCARD1_STATUS (IDP_CPLD_PHYS + 0x58)
80#define _IDP_CPLD_MISC_STATUS (IDP_CPLD_PHYS + 0x5C)
81
82/* FPGA register virtual addresses */
83
84#define IDP_CPLD_REV __CPLD_REG(_IDP_CPLD_REV)
85#define IDP_CPLD_PERIPH_PWR __CPLD_REG(_IDP_CPLD_PERIPH_PWR)
86#define IDP_CPLD_LED_CONTROL __CPLD_REG(_IDP_CPLD_LED_CONTROL)
87#define IDP_CPLD_KB_COL_HIGH __CPLD_REG(_IDP_CPLD_KB_COL_HIGH)
88#define IDP_CPLD_KB_COL_LOW __CPLD_REG(_IDP_CPLD_KB_COL_LOW)
89#define IDP_CPLD_PCCARD_EN __CPLD_REG(_IDP_CPLD_PCCARD_EN)
90#define IDP_CPLD_GPIOH_DIR __CPLD_REG(_IDP_CPLD_GPIOH_DIR)
91#define IDP_CPLD_GPIOH_VALUE __CPLD_REG(_IDP_CPLD_GPIOH_VALUE)
92#define IDP_CPLD_GPIOL_DIR __CPLD_REG(_IDP_CPLD_GPIOL_DIR)
93#define IDP_CPLD_GPIOL_VALUE __CPLD_REG(_IDP_CPLD_GPIOL_VALUE)
94#define IDP_CPLD_PCCARD_PWR __CPLD_REG(_IDP_CPLD_PCCARD_PWR)
95#define IDP_CPLD_MISC_CTRL __CPLD_REG(_IDP_CPLD_MISC_CTRL)
96#define IDP_CPLD_LCD __CPLD_REG(_IDP_CPLD_LCD)
97#define IDP_CPLD_FLASH_WE __CPLD_REG(_IDP_CPLD_FLASH_WE)
98
99#define IDP_CPLD_KB_ROW __CPLD_REG(_IDP_CPLD_KB_ROW)
100#define IDP_CPLD_PCCARD0_STATUS __CPLD_REG(_IDP_CPLD_PCCARD0_STATUS)
101#define IDP_CPLD_PCCARD1_STATUS __CPLD_REG(_IDP_CPLD_PCCARD1_STATUS)
102#define IDP_CPLD_MISC_STATUS __CPLD_REG(_IDP_CPLD_MISC_STATUS)
103
104
105/*
106 * Bit masks for various registers
107 */
108
109// IDP_CPLD_PCCARD_PWR
110#define PCC0_PWR0 (1 << 0)
111#define PCC0_PWR1 (1 << 1)
112#define PCC0_PWR2 (1 << 2)
113#define PCC0_PWR3 (1 << 3)
114#define PCC1_PWR0 (1 << 4)
115#define PCC1_PWR1 (1 << 5)
116#define PCC1_PWR2 (1 << 6)
117#define PCC1_PWR3 (1 << 7)
118
119// IDP_CPLD_PCCARD_EN
120#define PCC0_RESET (1 << 6)
121#define PCC1_RESET (1 << 7)
122#define PCC0_ENABLE (1 << 0)
123#define PCC1_ENABLE (1 << 1)
124
125// IDP_CPLD_PCCARDx_STATUS
126#define _PCC_WRPROT (1 << 7) // 7-4 read as low true
127#define _PCC_RESET (1 << 6)
128#define _PCC_IRQ (1 << 5)
129#define _PCC_INPACK (1 << 4)
130#define PCC_BVD2 (1 << 3)
131#define PCC_BVD1 (1 << 2)
132#define PCC_VS2 (1 << 1)
133#define PCC_VS1 (1 << 0)
134
135#define PCC_DETECT(x) (GPLR(7 + (x)) & GPIO_bit(7 + (x)))
136
137/* A listing of interrupts used by external hardware devices */
138
139#define TOUCH_PANEL_IRQ IRQ_GPIO(5)
140#define IDE_IRQ IRQ_GPIO(21)
141
142#define TOUCH_PANEL_IRQ_EDGE IRQT_FALLING
143
144#define ETHERNET_IRQ IRQ_GPIO(4)
145#define ETHERNET_IRQ_EDGE IRQT_RISING
146
147#define IDE_IRQ_EDGE IRQT_RISING
148
149#define PCMCIA_S0_CD_VALID IRQ_GPIO(7)
150#define PCMCIA_S0_CD_VALID_EDGE IRQT_BOTHEDGE
151
152#define PCMCIA_S1_CD_VALID IRQ_GPIO(8)
153#define PCMCIA_S1_CD_VALID_EDGE IRQT_BOTHEDGE
154
155#define PCMCIA_S0_RDYINT IRQ_GPIO(19)
156#define PCMCIA_S1_RDYINT IRQ_GPIO(22)
157
158
159/*
160 * Macros for LED Driver
161 */
162
163/* leds 0 = ON */
164#define IDP_HB_LED (1<<5)
165#define IDP_BUSY_LED (1<<6)
166
167#define IDP_LEDS_MASK (IDP_HB_LED | IDP_BUSY_LED)
168
169/*
170 * macros for MTD driver
171 */
172
173#define FLASH_WRITE_PROTECT_DISABLE() ((IDP_CPLD_FLASH_WE) &= ~(0x1))
174#define FLASH_WRITE_PROTECT_ENABLE() ((IDP_CPLD_FLASH_WE) |= (0x1))
175
176/*
177 * macros for matrix keyboard driver
178 */
179
180#define KEYBD_MATRIX_NUMBER_INPUTS 7
181#define KEYBD_MATRIX_NUMBER_OUTPUTS 14
182
183#define KEYBD_MATRIX_INVERT_OUTPUT_LOGIC FALSE
184#define KEYBD_MATRIX_INVERT_INPUT_LOGIC FALSE
185
186#define KEYBD_MATRIX_SETTLING_TIME_US 100
187#define KEYBD_MATRIX_KEYSTATE_DEBOUNCE_CONSTANT 2
188
189#define KEYBD_MATRIX_SET_OUTPUTS(outputs) \
190{\
191 IDP_CPLD_KB_COL_LOW = outputs;\
192 IDP_CPLD_KB_COL_HIGH = outputs >> 7;\
193}
194
195#define KEYBD_MATRIX_GET_INPUTS(inputs) \
196{\
197 inputs = (IDP_CPLD_KB_ROW & 0x7f);\
198}
199
200
diff --git a/include/asm-arm/arch-pxa/io.h b/include/asm-arm/arch-pxa/io.h
new file mode 100644
index 000000000000..c3bdbe44e21f
--- /dev/null
+++ b/include/asm-arm/arch-pxa/io.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-pxa/io.h
3 *
4 * Copied from asm/arch/sa1100/io.h
5 */
6#ifndef __ASM_ARM_ARCH_IO_H
7#define __ASM_ARM_ARCH_IO_H
8
9#define IO_SPACE_LIMIT 0xffffffff
10
11/*
12 * We don't actually have real ISA nor PCI buses, but there is so many
13 * drivers out there that might just work if we fake them...
14 */
15#define __io(a) ((void __iomem *)(a))
16#define __mem_pci(a) (a)
17#define __mem_isa(a) (a)
18
19#endif
diff --git a/include/asm-arm/arch-pxa/irq.h b/include/asm-arm/arch-pxa/irq.h
new file mode 100644
index 000000000000..d770e4b37ae1
--- /dev/null
+++ b/include/asm-arm/arch-pxa/irq.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-pxa/irq.h
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#define fixup_irq(x) (x)
14
15/*
16 * This prototype is required for cascading of multiplexed interrupts.
17 * Since it doesn't exist elsewhere, we'll put it here for now.
18 */
19extern void do_IRQ(int irq, struct pt_regs *regs);
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h
new file mode 100644
index 000000000000..05c4b7027592
--- /dev/null
+++ b/include/asm-arm/arch-pxa/irqs.h
@@ -0,0 +1,219 @@
1/*
2 * linux/include/asm-arm/arch-pxa/irqs.h
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
15#ifdef CONFIG_PXA27x
16#define PXA_IRQ_SKIP 0
17#else
18#define PXA_IRQ_SKIP 7
19#endif
20
21#define PXA_IRQ(x) ((x) - PXA_IRQ_SKIP)
22
23#define IRQ_SSP3 PXA_IRQ(0) /* SSP3 service request */
24#define IRQ_MSL PXA_IRQ(1) /* MSL Interface interrupt */
25#define IRQ_USBH2 PXA_IRQ(2) /* USB Host interrupt 1 (OHCI) */
26#define IRQ_USBH1 PXA_IRQ(3) /* USB Host interrupt 2 (non-OHCI) */
27#define IRQ_KEYPAD PXA_IRQ(4) /* Key pad controller */
28#define IRQ_MEMSTK PXA_IRQ(5) /* Memory Stick interrupt */
29#define IRQ_PWRI2C PXA_IRQ(6) /* Power I2C interrupt */
30#define IRQ_HWUART PXA_IRQ(7) /* HWUART Transmit/Receive/Error (PXA26x) */
31#define IRQ_OST_4_11 PXA_IRQ(7) /* OS timer 4-11 matches (PXA27x) */
32#define IRQ_GPIO0 PXA_IRQ(8) /* GPIO0 Edge Detect */
33#define IRQ_GPIO1 PXA_IRQ(9) /* GPIO1 Edge Detect */
34#define IRQ_GPIO_2_x PXA_IRQ(10) /* GPIO[2-x] Edge Detect */
35#define IRQ_USB PXA_IRQ(11) /* USB Service */
36#define IRQ_PMU PXA_IRQ(12) /* Performance Monitoring Unit */
37#define IRQ_I2S PXA_IRQ(13) /* I2S Interrupt */
38#define IRQ_AC97 PXA_IRQ(14) /* AC97 Interrupt */
39#define IRQ_ASSP PXA_IRQ(15) /* Audio SSP Service Request (PXA25x) */
40#define IRQ_USIM PXA_IRQ(15) /* Smart Card interface interrupt (PXA27x) */
41#define IRQ_NSSP PXA_IRQ(16) /* Network SSP Service Request (PXA25x) */
42#define IRQ_SSP2 PXA_IRQ(16) /* SSP2 interrupt (PXA27x) */
43#define IRQ_LCD PXA_IRQ(17) /* LCD Controller Service Request */
44#define IRQ_I2C PXA_IRQ(18) /* I2C Service Request */
45#define IRQ_ICP PXA_IRQ(19) /* ICP Transmit/Receive/Error */
46#define IRQ_STUART PXA_IRQ(20) /* STUART Transmit/Receive/Error */
47#define IRQ_BTUART PXA_IRQ(21) /* BTUART Transmit/Receive/Error */
48#define IRQ_FFUART PXA_IRQ(22) /* FFUART Transmit/Receive/Error*/
49#define IRQ_MMC PXA_IRQ(23) /* MMC Status/Error Detection */
50#define IRQ_SSP PXA_IRQ(24) /* SSP Service Request */
51#define IRQ_DMA PXA_IRQ(25) /* DMA Channel Service Request */
52#define IRQ_OST0 PXA_IRQ(26) /* OS Timer match 0 */
53#define IRQ_OST1 PXA_IRQ(27) /* OS Timer match 1 */
54#define IRQ_OST2 PXA_IRQ(28) /* OS Timer match 2 */
55#define IRQ_OST3 PXA_IRQ(29) /* OS Timer match 3 */
56#define IRQ_RTC1Hz PXA_IRQ(30) /* RTC HZ Clock Tick */
57#define IRQ_RTCAlrm PXA_IRQ(31) /* RTC Alarm */
58
59#ifdef CONFIG_PXA27x
60#define IRQ_TPM PXA_IRQ(32) /* TPM interrupt */
61#define IRQ_CAMERA PXA_IRQ(33) /* Camera Interface */
62
63#define PXA_INTERNAL_IRQS 34
64#else
65#define PXA_INTERNAL_IRQS 32
66#endif
67
68#define GPIO_2_x_TO_IRQ(x) \
69 PXA_IRQ((x) - 2 + PXA_INTERNAL_IRQS)
70#define IRQ_GPIO(x) (((x) < 2) ? (IRQ_GPIO0 + (x)) : GPIO_2_x_TO_IRQ(x))
71
72#define IRQ_TO_GPIO_2_x(i) \
73 ((i) - IRQ_GPIO(2) + 2)
74#define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i))
75
76#if defined(CONFIG_PXA25x)
77#define PXA_LAST_GPIO 80
78#elif defined(CONFIG_PXA27x)
79#define PXA_LAST_GPIO 127
80#endif
81
82/*
83 * The next 16 interrupts are for board specific purposes. Since
84 * the kernel can only run on one machine at a time, we can re-use
85 * these. If you need more, increase IRQ_BOARD_END, but keep it
86 * within sensible limits.
87 */
88#define IRQ_BOARD_START (IRQ_GPIO(PXA_LAST_GPIO) + 1)
89#define IRQ_BOARD_END (IRQ_BOARD_START + 16)
90
91#define IRQ_SA1111_START (IRQ_BOARD_END)
92#define IRQ_GPAIN0 (IRQ_BOARD_END + 0)
93#define IRQ_GPAIN1 (IRQ_BOARD_END + 1)
94#define IRQ_GPAIN2 (IRQ_BOARD_END + 2)
95#define IRQ_GPAIN3 (IRQ_BOARD_END + 3)
96#define IRQ_GPBIN0 (IRQ_BOARD_END + 4)
97#define IRQ_GPBIN1 (IRQ_BOARD_END + 5)
98#define IRQ_GPBIN2 (IRQ_BOARD_END + 6)
99#define IRQ_GPBIN3 (IRQ_BOARD_END + 7)
100#define IRQ_GPBIN4 (IRQ_BOARD_END + 8)
101#define IRQ_GPBIN5 (IRQ_BOARD_END + 9)
102#define IRQ_GPCIN0 (IRQ_BOARD_END + 10)
103#define IRQ_GPCIN1 (IRQ_BOARD_END + 11)
104#define IRQ_GPCIN2 (IRQ_BOARD_END + 12)
105#define IRQ_GPCIN3 (IRQ_BOARD_END + 13)
106#define IRQ_GPCIN4 (IRQ_BOARD_END + 14)
107#define IRQ_GPCIN5 (IRQ_BOARD_END + 15)
108#define IRQ_GPCIN6 (IRQ_BOARD_END + 16)
109#define IRQ_GPCIN7 (IRQ_BOARD_END + 17)
110#define IRQ_MSTXINT (IRQ_BOARD_END + 18)
111#define IRQ_MSRXINT (IRQ_BOARD_END + 19)
112#define IRQ_MSSTOPERRINT (IRQ_BOARD_END + 20)
113#define IRQ_TPTXINT (IRQ_BOARD_END + 21)
114#define IRQ_TPRXINT (IRQ_BOARD_END + 22)
115#define IRQ_TPSTOPERRINT (IRQ_BOARD_END + 23)
116#define SSPXMTINT (IRQ_BOARD_END + 24)
117#define SSPRCVINT (IRQ_BOARD_END + 25)
118#define SSPROR (IRQ_BOARD_END + 26)
119#define AUDXMTDMADONEA (IRQ_BOARD_END + 32)
120#define AUDRCVDMADONEA (IRQ_BOARD_END + 33)
121#define AUDXMTDMADONEB (IRQ_BOARD_END + 34)
122#define AUDRCVDMADONEB (IRQ_BOARD_END + 35)
123#define AUDTFSR (IRQ_BOARD_END + 36)
124#define AUDRFSR (IRQ_BOARD_END + 37)
125#define AUDTUR (IRQ_BOARD_END + 38)
126#define AUDROR (IRQ_BOARD_END + 39)
127#define AUDDTS (IRQ_BOARD_END + 40)
128#define AUDRDD (IRQ_BOARD_END + 41)
129#define AUDSTO (IRQ_BOARD_END + 42)
130#define IRQ_USBPWR (IRQ_BOARD_END + 43)
131#define IRQ_HCIM (IRQ_BOARD_END + 44)
132#define IRQ_HCIBUFFACC (IRQ_BOARD_END + 45)
133#define IRQ_HCIRMTWKP (IRQ_BOARD_END + 46)
134#define IRQ_NHCIMFCIR (IRQ_BOARD_END + 47)
135#define IRQ_USB_PORT_RESUME (IRQ_BOARD_END + 48)
136#define IRQ_S0_READY_NINT (IRQ_BOARD_END + 49)
137#define IRQ_S1_READY_NINT (IRQ_BOARD_END + 50)
138#define IRQ_S0_CD_VALID (IRQ_BOARD_END + 51)
139#define IRQ_S1_CD_VALID (IRQ_BOARD_END + 52)
140#define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
141#define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
142
143#define IRQ_LOCOMO_START (IRQ_BOARD_END)
144#define IRQ_LOCOMO_KEY (IRQ_BOARD_END + 0)
145#define IRQ_LOCOMO_GPIO0 (IRQ_BOARD_END + 1)
146#define IRQ_LOCOMO_GPIO1 (IRQ_BOARD_END + 2)
147#define IRQ_LOCOMO_GPIO2 (IRQ_BOARD_END + 3)
148#define IRQ_LOCOMO_GPIO3 (IRQ_BOARD_END + 4)
149#define IRQ_LOCOMO_GPIO4 (IRQ_BOARD_END + 5)
150#define IRQ_LOCOMO_GPIO5 (IRQ_BOARD_END + 6)
151#define IRQ_LOCOMO_GPIO6 (IRQ_BOARD_END + 7)
152#define IRQ_LOCOMO_GPIO7 (IRQ_BOARD_END + 8)
153#define IRQ_LOCOMO_GPIO8 (IRQ_BOARD_END + 9)
154#define IRQ_LOCOMO_GPIO9 (IRQ_BOARD_END + 10)
155#define IRQ_LOCOMO_GPIO10 (IRQ_BOARD_END + 11)
156#define IRQ_LOCOMO_GPIO11 (IRQ_BOARD_END + 12)
157#define IRQ_LOCOMO_GPIO12 (IRQ_BOARD_END + 13)
158#define IRQ_LOCOMO_GPIO13 (IRQ_BOARD_END + 14)
159#define IRQ_LOCOMO_GPIO14 (IRQ_BOARD_END + 15)
160#define IRQ_LOCOMO_GPIO15 (IRQ_BOARD_END + 16)
161#define IRQ_LOCOMO_LT (IRQ_BOARD_END + 17)
162#define IRQ_LOCOMO_SPI_RFR (IRQ_BOARD_END + 18)
163#define IRQ_LOCOMO_SPI_RFW (IRQ_BOARD_END + 19)
164#define IRQ_LOCOMO_SPI_OVRN (IRQ_BOARD_END + 20)
165#define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21)
166
167/*
168 * Figure out the MAX IRQ number.
169 *
170 * If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1.
171 * If we have an LoCoMo, the max IRQ is IRQ_LOCOMO_SPI_TEND+1
172 * Otherwise, we have the standard IRQs only.
173 */
174#ifdef CONFIG_SA1111
175#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
176#elif defined(CONFIG_SHARP_LOCOMO)
177#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1)
178#elif defined(CONFIG_ARCH_LUBBOCK) || \
179 defined(CONFIG_MACH_MAINSTONE)
180#define NR_IRQS (IRQ_BOARD_END)
181#else
182#define NR_IRQS (IRQ_BOARD_START)
183#endif
184
185/*
186 * Board specific IRQs. Define them here.
187 * Do not surround them with ifdefs.
188 */
189#define LUBBOCK_IRQ(x) (IRQ_BOARD_START + (x))
190#define LUBBOCK_SD_IRQ LUBBOCK_IRQ(0)
191#define LUBBOCK_SA1111_IRQ LUBBOCK_IRQ(1)
192#define LUBBOCK_USB_IRQ LUBBOCK_IRQ(2) /* usb connect */
193#define LUBBOCK_ETH_IRQ LUBBOCK_IRQ(3)
194#define LUBBOCK_UCB1400_IRQ LUBBOCK_IRQ(4)
195#define LUBBOCK_BB_IRQ LUBBOCK_IRQ(5)
196#define LUBBOCK_USB_DISC_IRQ LUBBOCK_IRQ(6) /* usb disconnect */
197#define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6)
198
199#define MAINSTONE_IRQ(x) (IRQ_BOARD_START + (x))
200#define MAINSTONE_MMC_IRQ MAINSTONE_IRQ(0)
201#define MAINSTONE_USIM_IRQ MAINSTONE_IRQ(1)
202#define MAINSTONE_USBC_IRQ MAINSTONE_IRQ(2)
203#define MAINSTONE_ETHERNET_IRQ MAINSTONE_IRQ(3)
204#define MAINSTONE_AC97_IRQ MAINSTONE_IRQ(4)
205#define MAINSTONE_PEN_IRQ MAINSTONE_IRQ(5)
206#define MAINSTONE_MSINS_IRQ MAINSTONE_IRQ(6)
207#define MAINSTONE_EXBRD_IRQ MAINSTONE_IRQ(7)
208#define MAINSTONE_S0_CD_IRQ MAINSTONE_IRQ(9)
209#define MAINSTONE_S0_STSCHG_IRQ MAINSTONE_IRQ(10)
210#define MAINSTONE_S0_IRQ MAINSTONE_IRQ(11)
211#define MAINSTONE_S1_CD_IRQ MAINSTONE_IRQ(13)
212#define MAINSTONE_S1_STSCHG_IRQ MAINSTONE_IRQ(14)
213#define MAINSTONE_S1_IRQ MAINSTONE_IRQ(15)
214
215/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
216#define IRQ_LOCOMO_KEY_BASE (IRQ_BOARD_START + 0)
217#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
218#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
219#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
diff --git a/include/asm-arm/arch-pxa/lubbock.h b/include/asm-arm/arch-pxa/lubbock.h
new file mode 100644
index 000000000000..11ee73593fc3
--- /dev/null
+++ b/include/asm-arm/arch-pxa/lubbock.h
@@ -0,0 +1,40 @@
1/*
2 * linux/include/asm-arm/arch-pxa/lubbock.h
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#define LUBBOCK_ETH_PHYS PXA_CS3_PHYS
14
15#define LUBBOCK_FPGA_PHYS PXA_CS2_PHYS
16#define LUBBOCK_FPGA_VIRT (0xf0000000)
17#define LUB_P2V(x) ((x) - LUBBOCK_FPGA_PHYS + LUBBOCK_FPGA_VIRT)
18#define LUB_V2P(x) ((x) - LUBBOCK_FPGA_VIRT + LUBBOCK_FPGA_PHYS)
19
20#ifndef __ASSEMBLY__
21# define __LUB_REG(x) (*((volatile unsigned long *)LUB_P2V(x)))
22#else
23# define __LUB_REG(x) LUB_P2V(x)
24#endif
25
26/* FPGA register virtual addresses */
27#define LUB_WHOAMI __LUB_REG(LUBBOCK_FPGA_PHYS + 0x000)
28#define LUB_HEXLED __LUB_REG(LUBBOCK_FPGA_PHYS + 0x010)
29#define LUB_DISC_BLNK_LED __LUB_REG(LUBBOCK_FPGA_PHYS + 0x040)
30#define LUB_CONF_SWITCHES __LUB_REG(LUBBOCK_FPGA_PHYS + 0x050)
31#define LUB_USER_SWITCHES __LUB_REG(LUBBOCK_FPGA_PHYS + 0x060)
32#define LUB_MISC_WR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x080)
33#define LUB_MISC_RD __LUB_REG(LUBBOCK_FPGA_PHYS + 0x090)
34#define LUB_IRQ_MASK_EN __LUB_REG(LUBBOCK_FPGA_PHYS + 0x0c0)
35#define LUB_IRQ_SET_CLR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x0d0)
36#define LUB_GP __LUB_REG(LUBBOCK_FPGA_PHYS + 0x100)
37
38#ifndef __ASSEMBLY__
39extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set);
40#endif
diff --git a/include/asm-arm/arch-pxa/mainstone.h b/include/asm-arm/arch-pxa/mainstone.h
new file mode 100644
index 000000000000..14c862adcaa1
--- /dev/null
+++ b/include/asm-arm/arch-pxa/mainstone.h
@@ -0,0 +1,120 @@
1/*
2 * linux/include/asm-arm/arch-pxa/mainstone.h
3 *
4 * Author: Nicolas Pitre
5 * Created: Nov 14, 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#ifndef ASM_ARCH_MAINSTONE_H
14#define ASM_ARCH_MAINSTONE_H
15
16#define MST_ETH_PHYS PXA_CS4_PHYS
17
18#define MST_FPGA_PHYS PXA_CS2_PHYS
19#define MST_FPGA_VIRT (0xf0000000)
20#define MST_P2V(x) ((x) - MST_FPGA_PHYS + MST_FPGA_VIRT)
21#define MST_V2P(x) ((x) - MST_FPGA_VIRT + MST_FPGA_PHYS)
22
23#ifndef __ASSEMBLY__
24# define __MST_REG(x) (*((volatile unsigned long *)MST_P2V(x)))
25#else
26# define __MST_REG(x) MST_P2V(x)
27#endif
28
29/* board level registers in the FPGA */
30
31#define MST_LEDDAT1 __MST_REG(0x08000010)
32#define MST_LEDDAT2 __MST_REG(0x08000014)
33#define MST_LEDCTRL __MST_REG(0x08000040)
34#define MST_GPSWR __MST_REG(0x08000060)
35#define MST_MSCWR1 __MST_REG(0x08000080)
36#define MST_MSCWR2 __MST_REG(0x08000084)
37#define MST_MSCWR3 __MST_REG(0x08000088)
38#define MST_MSCRD __MST_REG(0x08000090)
39#define MST_INTMSKENA __MST_REG(0x080000c0)
40#define MST_INTSETCLR __MST_REG(0x080000d0)
41#define MST_PCMCIA0 __MST_REG(0x080000e0)
42#define MST_PCMCIA1 __MST_REG(0x080000e4)
43
44#define MST_MSCWR1_CAMERA_ON (1 << 15) /* Camera interface power control */
45#define MST_MSCWR1_CAMERA_SEL (1 << 14) /* Camera interface mux control */
46#define MST_MSCWR1_LCD_CTL (1 << 13) /* General-purpose LCD control */
47#define MST_MSCWR1_MS_ON (1 << 12) /* Memory Stick power control */
48#define MST_MSCWR1_MMC_ON (1 << 11) /* MultiMediaCard* power control */
49#define MST_MSCWR1_MS_SEL (1 << 10) /* SD/MS multiplexer control */
50#define MST_MSCWR1_BB_SEL (1 << 9) /* PCMCIA/Baseband multiplexer */
51#define MST_MSCWR1_BT_ON (1 << 8) /* Bluetooth UART transceiver */
52#define MST_MSCWR1_BTDTR (1 << 7) /* Bluetooth UART DTR */
53
54#define MST_MSCWR1_IRDA_MASK (3 << 5) /* IrDA transceiver mode */
55#define MST_MSCWR1_IRDA_FULL (0 << 5) /* full distance power */
56#define MST_MSCWR1_IRDA_OFF (1 << 5) /* shutdown */
57#define MST_MSCWR1_IRDA_MED (2 << 5) /* 2/3 distance power */
58#define MST_MSCWR1_IRDA_LOW (3 << 5) /* 1/3 distance power */
59
60#define MST_MSCWR1_IRDA_FIR (1 << 4) /* IrDA transceiver SIR/FIR */
61#define MST_MSCWR1_GREENLED (1 << 3) /* LED D1 control */
62#define MST_MSCWR1_PDC_CTL (1 << 2) /* reserved */
63#define MST_MSCWR1_MTR_ON (1 << 1) /* Silent alert motor */
64#define MST_MSCWR1_SYSRESET (1 << 0) /* System reset */
65
66#define MST_MSCWR2_USB_OTG_RST (1 << 6) /* USB On The Go reset */
67#define MST_MSCWR2_USB_OTG_SEL (1 << 5) /* USB On The Go control */
68#define MST_MSCWR2_nUSBC_SC (1 << 4) /* USB client soft connect control */
69#define MST_MSCWR2_I2S_SPKROFF (1 << 3) /* I2S CODEC amplifier control */
70#define MST_MSCWR2_AC97_SPKROFF (1 << 2) /* AC97 CODEC amplifier control */
71#define MST_MSCWR2_RADIO_PWR (1 << 1) /* Radio module power control */
72#define MST_MSCWR2_RADIO_WAKE (1 << 0) /* Radio module wake-up signal */
73
74#define MST_MSCWR3_GPIO_RESET_EN (1 << 2) /* Enable GPIO Reset */
75#define MST_MSCWR3_GPIO_RESET (1 << 1) /* Initiate a GPIO Reset */
76#define MST_MSCWR3_COMMS_SW_RESET (1 << 0) /* Communications Processor Reset Control */
77
78#define MST_MSCRD_nPENIRQ (1 << 9) /* ADI7873* nPENIRQ signal */
79#define MST_MSCRD_nMEMSTK_CD (1 << 8) /* Memory Stick detection signal */
80#define MST_MSCRD_nMMC_CD (1 << 7) /* SD/MMC card detection signal */
81#define MST_MSCRD_nUSIM_CD (1 << 6) /* USIM card detection signal */
82#define MST_MSCRD_USB_CBL (1 << 5) /* USB client cable status */
83#define MST_MSCRD_TS_BUSY (1 << 4) /* ADI7873 busy */
84#define MST_MSCRD_BTDSR (1 << 3) /* Bluetooth UART DSR */
85#define MST_MSCRD_BTRI (1 << 2) /* Bluetooth UART Ring Indicator */
86#define MST_MSCRD_BTDCD (1 << 1) /* Bluetooth UART DCD */
87#define MST_MSCRD_nMMC_WP (1 << 0) /* SD/MMC write-protect status */
88
89#define MST_INT_S1_IRQ (1 << 15) /* PCMCIA socket 1 IRQ */
90#define MST_INT_S1_STSCHG (1 << 14) /* PCMCIA socket 1 status changed */
91#define MST_INT_S1_CD (1 << 13) /* PCMCIA socket 1 card detection */
92#define MST_INT_S0_IRQ (1 << 11) /* PCMCIA socket 0 IRQ */
93#define MST_INT_S0_STSCHG (1 << 10) /* PCMCIA socket 0 status changed */
94#define MST_INT_S0_CD (1 << 9) /* PCMCIA socket 0 card detection */
95#define MST_INT_nEXBRD_INT (1 << 7) /* Expansion board IRQ */
96#define MST_INT_MSINS (1 << 6) /* Memory Stick* detection */
97#define MST_INT_PENIRQ (1 << 5) /* ADI7873* touch-screen IRQ */
98#define MST_INT_AC97 (1 << 4) /* AC'97 CODEC IRQ */
99#define MST_INT_ETHERNET (1 << 3) /* Ethernet controller IRQ */
100#define MST_INT_USBC (1 << 2) /* USB client cable detection IRQ */
101#define MST_INT_USIM (1 << 1) /* USIM card detection IRQ */
102#define MST_INT_MMC (1 << 0) /* MMC/SD card detection IRQ */
103
104#define MST_PCMCIA_nIRQ (1 << 10) /* IRQ / ready signal */
105#define MST_PCMCIA_nSPKR_BVD2 (1 << 9) /* VDD sense / digital speaker */
106#define MST_PCMCIA_nSTSCHG_BVD1 (1 << 8) /* VDD sense / card status changed */
107#define MST_PCMCIA_nVS2 (1 << 7) /* VSS voltage sense */
108#define MST_PCMCIA_nVS1 (1 << 6) /* VSS voltage sense */
109#define MST_PCMCIA_nCD (1 << 5) /* Card detection signal */
110#define MST_PCMCIA_RESET (1 << 4) /* Card reset signal */
111#define MST_PCMCIA_PWR_MASK (0x000f) /* MAX1602 power-supply controls */
112
113#define MST_PCMCIA_PWR_VPP_0 0x0 /* voltage VPP = 0V */
114#define MST_PCMCIA_PWR_VPP_120 0x2 /* voltage VPP = 12V*/
115#define MST_PCMCIA_PWR_VPP_VCC 0x1 /* voltage VPP = VCC */
116#define MST_PCMCIA_PWR_VCC_0 0x0 /* voltage VCC = 0V */
117#define MST_PCMCIA_PWR_VCC_33 0x8 /* voltage VCC = 3.3V */
118#define MST_PCMCIA_PWR_VCC_50 0x4 /* voltage VCC = 5.0V */
119
120#endif
diff --git a/include/asm-arm/arch-pxa/memory.h b/include/asm-arm/arch-pxa/memory.h
new file mode 100644
index 000000000000..217a80b820ff
--- /dev/null
+++ b/include/asm-arm/arch-pxa/memory.h
@@ -0,0 +1,76 @@
1/*
2 * linux/include/asm-arm/arch-pxa/memory.h
3 *
4 * Author: Nicolas Pitre
5 * Copyright: (C) 2001 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
12#ifndef __ASM_ARCH_MEMORY_H
13#define __ASM_ARCH_MEMORY_H
14
15/*
16 * Physical DRAM offset.
17 */
18#define PHYS_OFFSET (0xa0000000UL)
19
20/*
21 * Virtual view <-> DMA view memory address translations
22 * virt_to_bus: Used to translate the virtual address to an
23 * address suitable to be passed to set_dma_addr
24 * bus_to_virt: Used to convert an address for DMA operations
25 * to an address that the kernel can use.
26 */
27#define __virt_to_bus(x) __virt_to_phys(x)
28#define __bus_to_virt(x) __phys_to_virt(x)
29
30#ifdef CONFIG_DISCONTIGMEM
31/*
32 * The nodes are matched with the physical SDRAM banks as follows:
33 *
34 * node 0: 0xa0000000-0xa3ffffff --> 0xc0000000-0xc3ffffff
35 * node 1: 0xa4000000-0xa7ffffff --> 0xc4000000-0xc7ffffff
36 * node 2: 0xa8000000-0xabffffff --> 0xc8000000-0xcbffffff
37 * node 3: 0xac000000-0xafffffff --> 0xcc000000-0xcfffffff
38 */
39
40/*
41 * Given a kernel address, find the home node of the underlying memory.
42 */
43#define KVADDR_TO_NID(addr) (((unsigned long)(addr) - PAGE_OFFSET) >> 26)
44
45/*
46 * Given a page frame number, convert it to a node id.
47 */
48#define PFN_TO_NID(pfn) (((pfn) - PHYS_PFN_OFFSET) >> (26 - PAGE_SHIFT))
49
50/*
51 * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
52 * and returns the mem_map of that node.
53 */
54#define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr))
55
56/*
57 * Given a page frame number, find the owning node of the memory
58 * and returns the mem_map of that node.
59 */
60#define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn))
61
62/*
63 * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
64 * and returns the index corresponding to the appropriate page in the
65 * node's mem_map.
66 */
67#define LOCAL_MAP_NR(addr) \
68 (((unsigned long)(addr) & 0x03ffffff) >> PAGE_SHIFT)
69
70#else
71
72#define PFN_TO_NID(addr) (0)
73
74#endif
75
76#endif
diff --git a/include/asm-arm/arch-pxa/mmc.h b/include/asm-arm/arch-pxa/mmc.h
new file mode 100644
index 000000000000..7492ea7ea614
--- /dev/null
+++ b/include/asm-arm/arch-pxa/mmc.h
@@ -0,0 +1,19 @@
1#ifndef ASMARM_ARCH_MMC_H
2#define ASMARM_ARCH_MMC_H
3
4#include <linux/mmc/protocol.h>
5#include <linux/interrupt.h>
6
7struct device;
8struct mmc_host;
9
10struct pxamci_platform_data {
11 unsigned int ocr_mask; /* available voltages */
12 int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *);
13 void (*setpower)(struct device *, unsigned int);
14 void (*exit)(struct device *, void *);
15};
16
17extern void pxa_set_mci_info(struct pxamci_platform_data *info);
18
19#endif
diff --git a/include/asm-arm/arch-pxa/param.h b/include/asm-arm/arch-pxa/param.h
new file mode 100644
index 000000000000..3197d82d7573
--- /dev/null
+++ b/include/asm-arm/arch-pxa/param.h
@@ -0,0 +1,3 @@
1/*
2 * linux/include/asm-arm/arch-pxa/param.h
3 */
diff --git a/include/asm-arm/arch-pxa/poodle.h b/include/asm-arm/arch-pxa/poodle.h
new file mode 100644
index 000000000000..58bda9d571a5
--- /dev/null
+++ b/include/asm-arm/arch-pxa/poodle.h
@@ -0,0 +1,70 @@
1/*
2 * linux/include/asm-arm/arch-pxa/poodle.h
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 * Based on:
8 * linux/include/asm-arm/arch-sa1100/collie.h
9 *
10 * ChangeLog:
11 * 04-06-2001 Lineo Japan, Inc.
12 * 04-16-2001 SHARP Corporation
13 * Update to 2.6 John Lenz
14 */
15#ifndef __ASM_ARCH_POODLE_H
16#define __ASM_ARCH_POODLE_H 1
17
18/*
19 * GPIOs
20 */
21/* PXA GPIOs */
22#define POODLE_GPIO_ON_KEY (0)
23#define POODLE_GPIO_AC_IN (1)
24#define POODLE_GPIO_CO 16
25#define POODLE_GPIO_TP_INT (5)
26#define POODLE_GPIO_WAKEUP (11) /* change battery */
27#define POODLE_GPIO_GA_INT (10)
28#define POODLE_GPIO_IR_ON (22)
29#define POODLE_GPIO_HP_IN (4)
30#define POODLE_GPIO_CF_IRQ (17)
31#define POODLE_GPIO_CF_CD (14)
32#define POODLE_GPIO_CF_STSCHG (14)
33#define POODLE_GPIO_SD_PWR (33)
34#define POODLE_GPIO_nSD_CLK (6)
35#define POODLE_GPIO_nSD_WP (7)
36#define POODLE_GPIO_nSD_INT (8)
37#define POODLE_GPIO_nSD_DETECT (9)
38#define POODLE_GPIO_MAIN_BAT_LOW (13)
39#define POODLE_GPIO_BAT_COVER (13)
40#define POODLE_GPIO_ADC_TEMP_ON (21)
41#define POODLE_GPIO_BYPASS_ON (36)
42#define POODLE_GPIO_CHRG_ON (38)
43#define POODLE_GPIO_CHRG_FULL (16)
44
45/* PXA GPIOs */
46#define POODLE_IRQ_GPIO_ON_KEY IRQ_GPIO0
47#define POODLE_IRQ_GPIO_AC_IN IRQ_GPIO1
48#define POODLE_IRQ_GPIO_HP_IN IRQ_GPIO4
49#define POODLE_IRQ_GPIO_CO IRQ_GPIO16
50#define POODLE_IRQ_GPIO_TP_INT IRQ_GPIO5
51#define POODLE_IRQ_GPIO_WAKEUP IRQ_GPIO11
52#define POODLE_IRQ_GPIO_GA_INT IRQ_GPIO10
53#define POODLE_IRQ_GPIO_CF_IRQ IRQ_GPIO17
54#define POODLE_IRQ_GPIO_CF_CD IRQ_GPIO14
55#define POODLE_IRQ_GPIO_nSD_INT IRQ_GPIO8
56#define POODLE_IRQ_GPIO_nSD_DETECT IRQ_GPIO9
57#define POODLE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO13
58
59/* SCOOP GPIOs */
60#define POODLE_SCOOP_CHARGE_ON SCOOP_GPCR_PA11
61#define POODLE_SCOOP_CP401 SCOOP_GPCR_PA13
62#define POODLE_SCOOP_VPEN SCOOP_GPCR_PA18
63#define POODLE_SCOOP_L_PCLK SCOOP_GPCR_PA20
64#define POODLE_SCOOP_L_LCLK SCOOP_GPCR_PA21
65#define POODLE_SCOOP_HS_OUT SCOOP_GPCR_PA22
66
67#define POODLE_SCOOP_IO_DIR ( POODLE_SCOOP_VPEN | POODLE_SCOOP_HS_OUT )
68#define POODLE_SCOOP_IO_OUT ( 0 )
69
70#endif /* __ASM_ARCH_POODLE_H */
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
new file mode 100644
index 000000000000..39741d3c9a34
--- /dev/null
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -0,0 +1,2251 @@
1/*
2 * linux/include/asm-arm/arch-pxa/pxa-regs.h
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#ifndef __PXA_REGS_H
14#define __PXA_REGS_H
15
16#include <linux/config.h>
17
18/*
19 * PXA Chip selects
20 */
21
22#define PXA_CS0_PHYS 0x00000000
23#define PXA_CS1_PHYS 0x04000000
24#define PXA_CS2_PHYS 0x08000000
25#define PXA_CS3_PHYS 0x0C000000
26#define PXA_CS4_PHYS 0x10000000
27#define PXA_CS5_PHYS 0x14000000
28
29
30/*
31 * Personal Computer Memory Card International Association (PCMCIA) sockets
32 */
33
34#define PCMCIAPrtSp 0x04000000 /* PCMCIA Partition Space [byte] */
35#define PCMCIASp (4*PCMCIAPrtSp) /* PCMCIA Space [byte] */
36#define PCMCIAIOSp PCMCIAPrtSp /* PCMCIA I/O Space [byte] */
37#define PCMCIAAttrSp PCMCIAPrtSp /* PCMCIA Attribute Space [byte] */
38#define PCMCIAMemSp PCMCIAPrtSp /* PCMCIA Memory Space [byte] */
39
40#define PCMCIA0Sp PCMCIASp /* PCMCIA 0 Space [byte] */
41#define PCMCIA0IOSp PCMCIAIOSp /* PCMCIA 0 I/O Space [byte] */
42#define PCMCIA0AttrSp PCMCIAAttrSp /* PCMCIA 0 Attribute Space [byte] */
43#define PCMCIA0MemSp PCMCIAMemSp /* PCMCIA 0 Memory Space [byte] */
44
45#define PCMCIA1Sp PCMCIASp /* PCMCIA 1 Space [byte] */
46#define PCMCIA1IOSp PCMCIAIOSp /* PCMCIA 1 I/O Space [byte] */
47#define PCMCIA1AttrSp PCMCIAAttrSp /* PCMCIA 1 Attribute Space [byte] */
48#define PCMCIA1MemSp PCMCIAMemSp /* PCMCIA 1 Memory Space [byte] */
49
50#define _PCMCIA(Nb) /* PCMCIA [0..1] */ \
51 (0x20000000 + (Nb)*PCMCIASp)
52#define _PCMCIAIO(Nb) _PCMCIA (Nb) /* PCMCIA I/O [0..1] */
53#define _PCMCIAAttr(Nb) /* PCMCIA Attribute [0..1] */ \
54 (_PCMCIA (Nb) + 2*PCMCIAPrtSp)
55#define _PCMCIAMem(Nb) /* PCMCIA Memory [0..1] */ \
56 (_PCMCIA (Nb) + 3*PCMCIAPrtSp)
57
58#define _PCMCIA0 _PCMCIA (0) /* PCMCIA 0 */
59#define _PCMCIA0IO _PCMCIAIO (0) /* PCMCIA 0 I/O */
60#define _PCMCIA0Attr _PCMCIAAttr (0) /* PCMCIA 0 Attribute */
61#define _PCMCIA0Mem _PCMCIAMem (0) /* PCMCIA 0 Memory */
62
63#define _PCMCIA1 _PCMCIA (1) /* PCMCIA 1 */
64#define _PCMCIA1IO _PCMCIAIO (1) /* PCMCIA 1 I/O */
65#define _PCMCIA1Attr _PCMCIAAttr (1) /* PCMCIA 1 Attribute */
66#define _PCMCIA1Mem _PCMCIAMem (1) /* PCMCIA 1 Memory */
67
68
69
70/*
71 * DMA Controller
72 */
73
74#define DCSR0 __REG(0x40000000) /* DMA Control / Status Register for Channel 0 */
75#define DCSR1 __REG(0x40000004) /* DMA Control / Status Register for Channel 1 */
76#define DCSR2 __REG(0x40000008) /* DMA Control / Status Register for Channel 2 */
77#define DCSR3 __REG(0x4000000c) /* DMA Control / Status Register for Channel 3 */
78#define DCSR4 __REG(0x40000010) /* DMA Control / Status Register for Channel 4 */
79#define DCSR5 __REG(0x40000014) /* DMA Control / Status Register for Channel 5 */
80#define DCSR6 __REG(0x40000018) /* DMA Control / Status Register for Channel 6 */
81#define DCSR7 __REG(0x4000001c) /* DMA Control / Status Register for Channel 7 */
82#define DCSR8 __REG(0x40000020) /* DMA Control / Status Register for Channel 8 */
83#define DCSR9 __REG(0x40000024) /* DMA Control / Status Register for Channel 9 */
84#define DCSR10 __REG(0x40000028) /* DMA Control / Status Register for Channel 10 */
85#define DCSR11 __REG(0x4000002c) /* DMA Control / Status Register for Channel 11 */
86#define DCSR12 __REG(0x40000030) /* DMA Control / Status Register for Channel 12 */
87#define DCSR13 __REG(0x40000034) /* DMA Control / Status Register for Channel 13 */
88#define DCSR14 __REG(0x40000038) /* DMA Control / Status Register for Channel 14 */
89#define DCSR15 __REG(0x4000003c) /* DMA Control / Status Register for Channel 15 */
90
91#define DCSR(x) __REG2(0x40000000, (x) << 2)
92
93#define DCSR_RUN (1 << 31) /* Run Bit (read / write) */
94#define DCSR_NODESC (1 << 30) /* No-Descriptor Fetch (read / write) */
95#define DCSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable (read / write) */
96#ifdef CONFIG_PXA27x
97#define DCSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable (R/W) */
98#define DCSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */
99#define DCSR_EORSTOPEN (1 << 26) /* STOP on an EOR */
100#define DCSR_SETCMPST (1 << 25) /* Set Descriptor Compare Status */
101#define DCSR_CLRCMPST (1 << 24) /* Clear Descriptor Compare Status */
102#define DCSR_CMPST (1 << 10) /* The Descriptor Compare Status */
103#define DCSR_ENRINTR (1 << 9) /* The end of Receive */
104#endif
105#define DCSR_REQPEND (1 << 8) /* Request Pending (read-only) */
106#define DCSR_STOPSTATE (1 << 3) /* Stop State (read-only) */
107#define DCSR_ENDINTR (1 << 2) /* End Interrupt (read / write) */
108#define DCSR_STARTINTR (1 << 1) /* Start Interrupt (read / write) */
109#define DCSR_BUSERR (1 << 0) /* Bus Error Interrupt (read / write) */
110
111#define DINT __REG(0x400000f0) /* DMA Interrupt Register */
112
113#define DRCMR(n) __REG2(0x40000100, (n)<<2)
114#define DRCMR0 __REG(0x40000100) /* Request to Channel Map Register for DREQ 0 */
115#define DRCMR1 __REG(0x40000104) /* Request to Channel Map Register for DREQ 1 */
116#define DRCMR2 __REG(0x40000108) /* Request to Channel Map Register for I2S receive Request */
117#define DRCMR3 __REG(0x4000010c) /* Request to Channel Map Register for I2S transmit Request */
118#define DRCMR4 __REG(0x40000110) /* Request to Channel Map Register for BTUART receive Request */
119#define DRCMR5 __REG(0x40000114) /* Request to Channel Map Register for BTUART transmit Request. */
120#define DRCMR6 __REG(0x40000118) /* Request to Channel Map Register for FFUART receive Request */
121#define DRCMR7 __REG(0x4000011c) /* Request to Channel Map Register for FFUART transmit Request */
122#define DRCMR8 __REG(0x40000120) /* Request to Channel Map Register for AC97 microphone Request */
123#define DRCMR9 __REG(0x40000124) /* Request to Channel Map Register for AC97 modem receive Request */
124#define DRCMR10 __REG(0x40000128) /* Request to Channel Map Register for AC97 modem transmit Request */
125#define DRCMR11 __REG(0x4000012c) /* Request to Channel Map Register for AC97 audio receive Request */
126#define DRCMR12 __REG(0x40000130) /* Request to Channel Map Register for AC97 audio transmit Request */
127#define DRCMR13 __REG(0x40000134) /* Request to Channel Map Register for SSP receive Request */
128#define DRCMR14 __REG(0x40000138) /* Request to Channel Map Register for SSP transmit Request */
129#define DRCMR15 __REG(0x4000013c) /* Reserved */
130#define DRCMR16 __REG(0x40000140) /* Reserved */
131#define DRCMR17 __REG(0x40000144) /* Request to Channel Map Register for ICP receive Request */
132#define DRCMR18 __REG(0x40000148) /* Request to Channel Map Register for ICP transmit Request */
133#define DRCMR19 __REG(0x4000014c) /* Request to Channel Map Register for STUART receive Request */
134#define DRCMR20 __REG(0x40000150) /* Request to Channel Map Register for STUART transmit Request */
135#define DRCMR21 __REG(0x40000154) /* Request to Channel Map Register for MMC receive Request */
136#define DRCMR22 __REG(0x40000158) /* Request to Channel Map Register for MMC transmit Request */
137#define DRCMR23 __REG(0x4000015c) /* Reserved */
138#define DRCMR24 __REG(0x40000160) /* Reserved */
139#define DRCMR25 __REG(0x40000164) /* Request to Channel Map Register for USB endpoint 1 Request */
140#define DRCMR26 __REG(0x40000168) /* Request to Channel Map Register for USB endpoint 2 Request */
141#define DRCMR27 __REG(0x4000016C) /* Request to Channel Map Register for USB endpoint 3 Request */
142#define DRCMR28 __REG(0x40000170) /* Request to Channel Map Register for USB endpoint 4 Request */
143#define DRCMR29 __REG(0x40000174) /* Reserved */
144#define DRCMR30 __REG(0x40000178) /* Request to Channel Map Register for USB endpoint 6 Request */
145#define DRCMR31 __REG(0x4000017C) /* Request to Channel Map Register for USB endpoint 7 Request */
146#define DRCMR32 __REG(0x40000180) /* Request to Channel Map Register for USB endpoint 8 Request */
147#define DRCMR33 __REG(0x40000184) /* Request to Channel Map Register for USB endpoint 9 Request */
148#define DRCMR34 __REG(0x40000188) /* Reserved */
149#define DRCMR35 __REG(0x4000018C) /* Request to Channel Map Register for USB endpoint 11 Request */
150#define DRCMR36 __REG(0x40000190) /* Request to Channel Map Register for USB endpoint 12 Request */
151#define DRCMR37 __REG(0x40000194) /* Request to Channel Map Register for USB endpoint 13 Request */
152#define DRCMR38 __REG(0x40000198) /* Request to Channel Map Register for USB endpoint 14 Request */
153#define DRCMR39 __REG(0x4000019C) /* Reserved */
154
155#define DRCMR68 __REG(0x40001110) /* Request to Channel Map Register for Camera FIFO 0 Request */
156#define DRCMR69 __REG(0x40001114) /* Request to Channel Map Register for Camera FIFO 1 Request */
157#define DRCMR70 __REG(0x40001118) /* Request to Channel Map Register for Camera FIFO 2 Request */
158
159#define DRCMRRXSADR DRCMR2
160#define DRCMRTXSADR DRCMR3
161#define DRCMRRXBTRBR DRCMR4
162#define DRCMRTXBTTHR DRCMR5
163#define DRCMRRXFFRBR DRCMR6
164#define DRCMRTXFFTHR DRCMR7
165#define DRCMRRXMCDR DRCMR8
166#define DRCMRRXMODR DRCMR9
167#define DRCMRTXMODR DRCMR10
168#define DRCMRRXPCDR DRCMR11
169#define DRCMRTXPCDR DRCMR12
170#define DRCMRRXSSDR DRCMR13
171#define DRCMRTXSSDR DRCMR14
172#define DRCMRRXSS2DR DRCMR15
173#define DRCMRTXSS2DR DRCMR16
174#define DRCMRRXICDR DRCMR17
175#define DRCMRTXICDR DRCMR18
176#define DRCMRRXSTRBR DRCMR19
177#define DRCMRTXSTTHR DRCMR20
178#define DRCMRRXMMC DRCMR21
179#define DRCMRTXMMC DRCMR22
180#define DRCMRRXSS3DR DRCMR66
181#define DRCMRTXSS3DR DRCMR67
182#define DRCMRUDC(x) DRCMR((x) + 24)
183
184#define DRCMR_MAPVLD (1 << 7) /* Map Valid (read / write) */
185#define DRCMR_CHLNUM 0x1f /* mask for Channel Number (read / write) */
186
187#define DDADR0 __REG(0x40000200) /* DMA Descriptor Address Register Channel 0 */
188#define DSADR0 __REG(0x40000204) /* DMA Source Address Register Channel 0 */
189#define DTADR0 __REG(0x40000208) /* DMA Target Address Register Channel 0 */
190#define DCMD0 __REG(0x4000020c) /* DMA Command Address Register Channel 0 */
191#define DDADR1 __REG(0x40000210) /* DMA Descriptor Address Register Channel 1 */
192#define DSADR1 __REG(0x40000214) /* DMA Source Address Register Channel 1 */
193#define DTADR1 __REG(0x40000218) /* DMA Target Address Register Channel 1 */
194#define DCMD1 __REG(0x4000021c) /* DMA Command Address Register Channel 1 */
195#define DDADR2 __REG(0x40000220) /* DMA Descriptor Address Register Channel 2 */
196#define DSADR2 __REG(0x40000224) /* DMA Source Address Register Channel 2 */
197#define DTADR2 __REG(0x40000228) /* DMA Target Address Register Channel 2 */
198#define DCMD2 __REG(0x4000022c) /* DMA Command Address Register Channel 2 */
199#define DDADR3 __REG(0x40000230) /* DMA Descriptor Address Register Channel 3 */
200#define DSADR3 __REG(0x40000234) /* DMA Source Address Register Channel 3 */
201#define DTADR3 __REG(0x40000238) /* DMA Target Address Register Channel 3 */
202#define DCMD3 __REG(0x4000023c) /* DMA Command Address Register Channel 3 */
203#define DDADR4 __REG(0x40000240) /* DMA Descriptor Address Register Channel 4 */
204#define DSADR4 __REG(0x40000244) /* DMA Source Address Register Channel 4 */
205#define DTADR4 __REG(0x40000248) /* DMA Target Address Register Channel 4 */
206#define DCMD4 __REG(0x4000024c) /* DMA Command Address Register Channel 4 */
207#define DDADR5 __REG(0x40000250) /* DMA Descriptor Address Register Channel 5 */
208#define DSADR5 __REG(0x40000254) /* DMA Source Address Register Channel 5 */
209#define DTADR5 __REG(0x40000258) /* DMA Target Address Register Channel 5 */
210#define DCMD5 __REG(0x4000025c) /* DMA Command Address Register Channel 5 */
211#define DDADR6 __REG(0x40000260) /* DMA Descriptor Address Register Channel 6 */
212#define DSADR6 __REG(0x40000264) /* DMA Source Address Register Channel 6 */
213#define DTADR6 __REG(0x40000268) /* DMA Target Address Register Channel 6 */
214#define DCMD6 __REG(0x4000026c) /* DMA Command Address Register Channel 6 */
215#define DDADR7 __REG(0x40000270) /* DMA Descriptor Address Register Channel 7 */
216#define DSADR7 __REG(0x40000274) /* DMA Source Address Register Channel 7 */
217#define DTADR7 __REG(0x40000278) /* DMA Target Address Register Channel 7 */
218#define DCMD7 __REG(0x4000027c) /* DMA Command Address Register Channel 7 */
219#define DDADR8 __REG(0x40000280) /* DMA Descriptor Address Register Channel 8 */
220#define DSADR8 __REG(0x40000284) /* DMA Source Address Register Channel 8 */
221#define DTADR8 __REG(0x40000288) /* DMA Target Address Register Channel 8 */
222#define DCMD8 __REG(0x4000028c) /* DMA Command Address Register Channel 8 */
223#define DDADR9 __REG(0x40000290) /* DMA Descriptor Address Register Channel 9 */
224#define DSADR9 __REG(0x40000294) /* DMA Source Address Register Channel 9 */
225#define DTADR9 __REG(0x40000298) /* DMA Target Address Register Channel 9 */
226#define DCMD9 __REG(0x4000029c) /* DMA Command Address Register Channel 9 */
227#define DDADR10 __REG(0x400002a0) /* DMA Descriptor Address Register Channel 10 */
228#define DSADR10 __REG(0x400002a4) /* DMA Source Address Register Channel 10 */
229#define DTADR10 __REG(0x400002a8) /* DMA Target Address Register Channel 10 */
230#define DCMD10 __REG(0x400002ac) /* DMA Command Address Register Channel 10 */
231#define DDADR11 __REG(0x400002b0) /* DMA Descriptor Address Register Channel 11 */
232#define DSADR11 __REG(0x400002b4) /* DMA Source Address Register Channel 11 */
233#define DTADR11 __REG(0x400002b8) /* DMA Target Address Register Channel 11 */
234#define DCMD11 __REG(0x400002bc) /* DMA Command Address Register Channel 11 */
235#define DDADR12 __REG(0x400002c0) /* DMA Descriptor Address Register Channel 12 */
236#define DSADR12 __REG(0x400002c4) /* DMA Source Address Register Channel 12 */
237#define DTADR12 __REG(0x400002c8) /* DMA Target Address Register Channel 12 */
238#define DCMD12 __REG(0x400002cc) /* DMA Command Address Register Channel 12 */
239#define DDADR13 __REG(0x400002d0) /* DMA Descriptor Address Register Channel 13 */
240#define DSADR13 __REG(0x400002d4) /* DMA Source Address Register Channel 13 */
241#define DTADR13 __REG(0x400002d8) /* DMA Target Address Register Channel 13 */
242#define DCMD13 __REG(0x400002dc) /* DMA Command Address Register Channel 13 */
243#define DDADR14 __REG(0x400002e0) /* DMA Descriptor Address Register Channel 14 */
244#define DSADR14 __REG(0x400002e4) /* DMA Source Address Register Channel 14 */
245#define DTADR14 __REG(0x400002e8) /* DMA Target Address Register Channel 14 */
246#define DCMD14 __REG(0x400002ec) /* DMA Command Address Register Channel 14 */
247#define DDADR15 __REG(0x400002f0) /* DMA Descriptor Address Register Channel 15 */
248#define DSADR15 __REG(0x400002f4) /* DMA Source Address Register Channel 15 */
249#define DTADR15 __REG(0x400002f8) /* DMA Target Address Register Channel 15 */
250#define DCMD15 __REG(0x400002fc) /* DMA Command Address Register Channel 15 */
251
252#define DDADR(x) __REG2(0x40000200, (x) << 4)
253#define DSADR(x) __REG2(0x40000204, (x) << 4)
254#define DTADR(x) __REG2(0x40000208, (x) << 4)
255#define DCMD(x) __REG2(0x4000020c, (x) << 4)
256
257#define DDADR_DESCADDR 0xfffffff0 /* Address of next descriptor (mask) */
258#define DDADR_STOP (1 << 0) /* Stop (read / write) */
259
260#define DCMD_INCSRCADDR (1 << 31) /* Source Address Increment Setting. */
261#define DCMD_INCTRGADDR (1 << 30) /* Target Address Increment Setting. */
262#define DCMD_FLOWSRC (1 << 29) /* Flow Control by the source. */
263#define DCMD_FLOWTRG (1 << 28) /* Flow Control by the target. */
264#define DCMD_STARTIRQEN (1 << 22) /* Start Interrupt Enable */
265#define DCMD_ENDIRQEN (1 << 21) /* End Interrupt Enable */
266#define DCMD_ENDIAN (1 << 18) /* Device Endian-ness. */
267#define DCMD_BURST8 (1 << 16) /* 8 byte burst */
268#define DCMD_BURST16 (2 << 16) /* 16 byte burst */
269#define DCMD_BURST32 (3 << 16) /* 32 byte burst */
270#define DCMD_WIDTH1 (1 << 14) /* 1 byte width */
271#define DCMD_WIDTH2 (2 << 14) /* 2 byte width (HalfWord) */
272#define DCMD_WIDTH4 (3 << 14) /* 4 byte width (Word) */
273#define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */
274
275
276/*
277 * UARTs
278 */
279
280/* Full Function UART (FFUART) */
281#define FFUART FFRBR
282#define FFRBR __REG(0x40100000) /* Receive Buffer Register (read only) */
283#define FFTHR __REG(0x40100000) /* Transmit Holding Register (write only) */
284#define FFIER __REG(0x40100004) /* Interrupt Enable Register (read/write) */
285#define FFIIR __REG(0x40100008) /* Interrupt ID Register (read only) */
286#define FFFCR __REG(0x40100008) /* FIFO Control Register (write only) */
287#define FFLCR __REG(0x4010000C) /* Line Control Register (read/write) */
288#define FFMCR __REG(0x40100010) /* Modem Control Register (read/write) */
289#define FFLSR __REG(0x40100014) /* Line Status Register (read only) */
290#define FFMSR __REG(0x40100018) /* Modem Status Register (read only) */
291#define FFSPR __REG(0x4010001C) /* Scratch Pad Register (read/write) */
292#define FFISR __REG(0x40100020) /* Infrared Selection Register (read/write) */
293#define FFDLL __REG(0x40100000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */
294#define FFDLH __REG(0x40100004) /* Divisor Latch High Register (DLAB = 1) (read/write) */
295
296/* Bluetooth UART (BTUART) */
297#define BTUART BTRBR
298#define BTRBR __REG(0x40200000) /* Receive Buffer Register (read only) */
299#define BTTHR __REG(0x40200000) /* Transmit Holding Register (write only) */
300#define BTIER __REG(0x40200004) /* Interrupt Enable Register (read/write) */
301#define BTIIR __REG(0x40200008) /* Interrupt ID Register (read only) */
302#define BTFCR __REG(0x40200008) /* FIFO Control Register (write only) */
303#define BTLCR __REG(0x4020000C) /* Line Control Register (read/write) */
304#define BTMCR __REG(0x40200010) /* Modem Control Register (read/write) */
305#define BTLSR __REG(0x40200014) /* Line Status Register (read only) */
306#define BTMSR __REG(0x40200018) /* Modem Status Register (read only) */
307#define BTSPR __REG(0x4020001C) /* Scratch Pad Register (read/write) */
308#define BTISR __REG(0x40200020) /* Infrared Selection Register (read/write) */
309#define BTDLL __REG(0x40200000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */
310#define BTDLH __REG(0x40200004) /* Divisor Latch High Register (DLAB = 1) (read/write) */
311
312/* Standard UART (STUART) */
313#define STUART STRBR
314#define STRBR __REG(0x40700000) /* Receive Buffer Register (read only) */
315#define STTHR __REG(0x40700000) /* Transmit Holding Register (write only) */
316#define STIER __REG(0x40700004) /* Interrupt Enable Register (read/write) */
317#define STIIR __REG(0x40700008) /* Interrupt ID Register (read only) */
318#define STFCR __REG(0x40700008) /* FIFO Control Register (write only) */
319#define STLCR __REG(0x4070000C) /* Line Control Register (read/write) */
320#define STMCR __REG(0x40700010) /* Modem Control Register (read/write) */
321#define STLSR __REG(0x40700014) /* Line Status Register (read only) */
322#define STMSR __REG(0x40700018) /* Reserved */
323#define STSPR __REG(0x4070001C) /* Scratch Pad Register (read/write) */
324#define STISR __REG(0x40700020) /* Infrared Selection Register (read/write) */
325#define STDLL __REG(0x40700000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */
326#define STDLH __REG(0x40700004) /* Divisor Latch High Register (DLAB = 1) (read/write) */
327
328#define IER_DMAE (1 << 7) /* DMA Requests Enable */
329#define IER_UUE (1 << 6) /* UART Unit Enable */
330#define IER_NRZE (1 << 5) /* NRZ coding Enable */
331#define IER_RTIOE (1 << 4) /* Receiver Time Out Interrupt Enable */
332#define IER_MIE (1 << 3) /* Modem Interrupt Enable */
333#define IER_RLSE (1 << 2) /* Receiver Line Status Interrupt Enable */
334#define IER_TIE (1 << 1) /* Transmit Data request Interrupt Enable */
335#define IER_RAVIE (1 << 0) /* Receiver Data Available Interrupt Enable */
336
337#define IIR_FIFOES1 (1 << 7) /* FIFO Mode Enable Status */
338#define IIR_FIFOES0 (1 << 6) /* FIFO Mode Enable Status */
339#define IIR_TOD (1 << 3) /* Time Out Detected */
340#define IIR_IID2 (1 << 2) /* Interrupt Source Encoded */
341#define IIR_IID1 (1 << 1) /* Interrupt Source Encoded */
342#define IIR_IP (1 << 0) /* Interrupt Pending (active low) */
343
344#define FCR_ITL2 (1 << 7) /* Interrupt Trigger Level */
345#define FCR_ITL1 (1 << 6) /* Interrupt Trigger Level */
346#define FCR_RESETTF (1 << 2) /* Reset Transmitter FIFO */
347#define FCR_RESETRF (1 << 1) /* Reset Receiver FIFO */
348#define FCR_TRFIFOE (1 << 0) /* Transmit and Receive FIFO Enable */
349#define FCR_ITL_1 (0)
350#define FCR_ITL_8 (FCR_ITL1)
351#define FCR_ITL_16 (FCR_ITL2)
352#define FCR_ITL_32 (FCR_ITL2|FCR_ITL1)
353
354#define LCR_DLAB (1 << 7) /* Divisor Latch Access Bit */
355#define LCR_SB (1 << 6) /* Set Break */
356#define LCR_STKYP (1 << 5) /* Sticky Parity */
357#define LCR_EPS (1 << 4) /* Even Parity Select */
358#define LCR_PEN (1 << 3) /* Parity Enable */
359#define LCR_STB (1 << 2) /* Stop Bit */
360#define LCR_WLS1 (1 << 1) /* Word Length Select */
361#define LCR_WLS0 (1 << 0) /* Word Length Select */
362
363#define LSR_FIFOE (1 << 7) /* FIFO Error Status */
364#define LSR_TEMT (1 << 6) /* Transmitter Empty */
365#define LSR_TDRQ (1 << 5) /* Transmit Data Request */
366#define LSR_BI (1 << 4) /* Break Interrupt */
367#define LSR_FE (1 << 3) /* Framing Error */
368#define LSR_PE (1 << 2) /* Parity Error */
369#define LSR_OE (1 << 1) /* Overrun Error */
370#define LSR_DR (1 << 0) /* Data Ready */
371
372#define MCR_LOOP (1 << 4)
373#define MCR_OUT2 (1 << 3) /* force MSR_DCD in loopback mode */
374#define MCR_OUT1 (1 << 2) /* force MSR_RI in loopback mode */
375#define MCR_RTS (1 << 1) /* Request to Send */
376#define MCR_DTR (1 << 0) /* Data Terminal Ready */
377
378#define MSR_DCD (1 << 7) /* Data Carrier Detect */
379#define MSR_RI (1 << 6) /* Ring Indicator */
380#define MSR_DSR (1 << 5) /* Data Set Ready */
381#define MSR_CTS (1 << 4) /* Clear To Send */
382#define MSR_DDCD (1 << 3) /* Delta Data Carrier Detect */
383#define MSR_TERI (1 << 2) /* Trailing Edge Ring Indicator */
384#define MSR_DDSR (1 << 1) /* Delta Data Set Ready */
385#define MSR_DCTS (1 << 0) /* Delta Clear To Send */
386
387/*
388 * IrSR (Infrared Selection Register)
389 */
390#define STISR_RXPL (1 << 4) /* Receive Data Polarity */
391#define STISR_TXPL (1 << 3) /* Transmit Data Polarity */
392#define STISR_XMODE (1 << 2) /* Transmit Pulse Width Select */
393#define STISR_RCVEIR (1 << 1) /* Receiver SIR Enable */
394#define STISR_XMITIR (1 << 0) /* Transmitter SIR Enable */
395
396
397/*
398 * I2C registers
399 */
400
401#define IBMR __REG(0x40301680) /* I2C Bus Monitor Register - IBMR */
402#define IDBR __REG(0x40301688) /* I2C Data Buffer Register - IDBR */
403#define ICR __REG(0x40301690) /* I2C Control Register - ICR */
404#define ISR __REG(0x40301698) /* I2C Status Register - ISR */
405#define ISAR __REG(0x403016A0) /* I2C Slave Address Register - ISAR */
406
407#define PWRIBMR __REG(0x40f00180) /* Power I2C Bus Monitor Register-IBMR */
408#define PWRIDBR __REG(0x40f00188) /* Power I2C Data Buffer Register-IDBR */
409#define PWRICR __REG(0x40f00190) /* Power I2C Control Register - ICR */
410#define PWRISR __REG(0x40f00198) /* Power I2C Status Register - ISR */
411#define PWRISAR __REG(0x40f001A0) /*Power I2C Slave Address Register-ISAR */
412
413#define ICR_START (1 << 0) /* start bit */
414#define ICR_STOP (1 << 1) /* stop bit */
415#define ICR_ACKNAK (1 << 2) /* send ACK(0) or NAK(1) */
416#define ICR_TB (1 << 3) /* transfer byte bit */
417#define ICR_MA (1 << 4) /* master abort */
418#define ICR_SCLE (1 << 5) /* master clock enable */
419#define ICR_IUE (1 << 6) /* unit enable */
420#define ICR_GCD (1 << 7) /* general call disable */
421#define ICR_ITEIE (1 << 8) /* enable tx interrupts */
422#define ICR_IRFIE (1 << 9) /* enable rx interrupts */
423#define ICR_BEIE (1 << 10) /* enable bus error ints */
424#define ICR_SSDIE (1 << 11) /* slave STOP detected int enable */
425#define ICR_ALDIE (1 << 12) /* enable arbitration interrupt */
426#define ICR_SADIE (1 << 13) /* slave address detected int enable */
427#define ICR_UR (1 << 14) /* unit reset */
428
429#define ISR_RWM (1 << 0) /* read/write mode */
430#define ISR_ACKNAK (1 << 1) /* ack/nak status */
431#define ISR_UB (1 << 2) /* unit busy */
432#define ISR_IBB (1 << 3) /* bus busy */
433#define ISR_SSD (1 << 4) /* slave stop detected */
434#define ISR_ALD (1 << 5) /* arbitration loss detected */
435#define ISR_ITE (1 << 6) /* tx buffer empty */
436#define ISR_IRF (1 << 7) /* rx buffer full */
437#define ISR_GCAD (1 << 8) /* general call address detected */
438#define ISR_SAD (1 << 9) /* slave address detected */
439#define ISR_BED (1 << 10) /* bus error no ACK/NAK */
440
441
442/*
443 * Serial Audio Controller
444 */
445
446/* FIXME: This clash with SA1111 defines */
447#ifndef _ASM_ARCH_SA1111
448
449#define SACR0 __REG(0x40400000) /* Global Control Register */
450#define SACR1 __REG(0x40400004) /* Serial Audio I 2 S/MSB-Justified Control Register */
451#define SASR0 __REG(0x4040000C) /* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */
452#define SAIMR __REG(0x40400014) /* Serial Audio Interrupt Mask Register */
453#define SAICR __REG(0x40400018) /* Serial Audio Interrupt Clear Register */
454#define SADIV __REG(0x40400060) /* Audio Clock Divider Register. */
455#define SADR __REG(0x40400080) /* Serial Audio Data Register (TX and RX FIFO access Register). */
456
457#define SACR0_RFTH(x) (x << 12) /* Rx FIFO Interrupt or DMA Trigger Threshold */
458#define SACR0_TFTH(x) (x << 8) /* Tx FIFO Interrupt or DMA Trigger Threshold */
459#define SACR0_STRF (1 << 5) /* FIFO Select for EFWR Special Function */
460#define SACR0_EFWR (1 << 4) /* Enable EFWR Function */
461#define SACR0_RST (1 << 3) /* FIFO, i2s Register Reset */
462#define SACR0_BCKD (1 << 2) /* Bit Clock Direction */
463#define SACR0_ENB (1 << 0) /* Enable I2S Link */
464#define SACR1_ENLBF (1 << 5) /* Enable Loopback */
465#define SACR1_DRPL (1 << 4) /* Disable Replaying Function */
466#define SACR1_DREC (1 << 3) /* Disable Recording Function */
467#define SACR1_AMSL (1 << 1) /* Specify Alternate Mode */
468
469#define SASR0_I2SOFF (1 << 7) /* Controller Status */
470#define SASR0_ROR (1 << 6) /* Rx FIFO Overrun */
471#define SASR0_TUR (1 << 5) /* Tx FIFO Underrun */
472#define SASR0_RFS (1 << 4) /* Rx FIFO Service Request */
473#define SASR0_TFS (1 << 3) /* Tx FIFO Service Request */
474#define SASR0_BSY (1 << 2) /* I2S Busy */
475#define SASR0_RNE (1 << 1) /* Rx FIFO Not Empty */
476#define SASR0_TNF (1 << 0) /* Tx FIFO Not Empty */
477
478#define SAICR_ROR (1 << 6) /* Clear Rx FIFO Overrun Interrupt */
479#define SAICR_TUR (1 << 5) /* Clear Tx FIFO Underrun Interrupt */
480
481#define SAIMR_ROR (1 << 6) /* Enable Rx FIFO Overrun Condition Interrupt */
482#define SAIMR_TUR (1 << 5) /* Enable Tx FIFO Underrun Condition Interrupt */
483#define SAIMR_RFS (1 << 4) /* Enable Rx FIFO Service Interrupt */
484#define SAIMR_TFS (1 << 3) /* Enable Tx FIFO Service Interrupt */
485
486#endif
487
488/*
489 * AC97 Controller registers
490 */
491
492#define POCR __REG(0x40500000) /* PCM Out Control Register */
493#define POCR_FEIE (1 << 3) /* FIFO Error Interrupt Enable */
494#define POCR_FSRIE (1 << 1) /* FIFO Service Request Interrupt Enable */
495
496#define PICR __REG(0x40500004) /* PCM In Control Register */
497#define PICR_FEIE (1 << 3) /* FIFO Error Interrupt Enable */
498#define PICR_FSRIE (1 << 1) /* FIFO Service Request Interrupt Enable */
499
500#define MCCR __REG(0x40500008) /* Mic In Control Register */
501#define MCCR_FEIE (1 << 3) /* FIFO Error Interrupt Enable */
502#define MCCR_FSRIE (1 << 1) /* FIFO Service Request Interrupt Enable */
503
504#define GCR __REG(0x4050000C) /* Global Control Register */
505#define GCR_nDMAEN (1 << 24) /* non DMA Enable */
506#define GCR_CDONE_IE (1 << 19) /* Command Done Interrupt Enable */
507#define GCR_SDONE_IE (1 << 18) /* Status Done Interrupt Enable */
508#define GCR_SECRDY_IEN (1 << 9) /* Secondary Ready Interrupt Enable */
509#define GCR_PRIRDY_IEN (1 << 8) /* Primary Ready Interrupt Enable */
510#define GCR_SECRES_IEN (1 << 5) /* Secondary Resume Interrupt Enable */
511#define GCR_PRIRES_IEN (1 << 4) /* Primary Resume Interrupt Enable */
512#define GCR_ACLINK_OFF (1 << 3) /* AC-link Shut Off */
513#define GCR_WARM_RST (1 << 2) /* AC97 Warm Reset */
514#define GCR_COLD_RST (1 << 1) /* AC'97 Cold Reset (0 = active) */
515#define GCR_GIE (1 << 0) /* Codec GPI Interrupt Enable */
516
517#define POSR __REG(0x40500010) /* PCM Out Status Register */
518#define POSR_FIFOE (1 << 4) /* FIFO error */
519#define POSR_FSR (1 << 2) /* FIFO Service Request */
520
521#define PISR __REG(0x40500014) /* PCM In Status Register */
522#define PISR_FIFOE (1 << 4) /* FIFO error */
523#define PISR_EOC (1 << 3) /* DMA End-of-Chain (exclusive clear) */
524#define PISR_FSR (1 << 2) /* FIFO Service Request */
525
526#define MCSR __REG(0x40500018) /* Mic In Status Register */
527#define MCSR_FIFOE (1 << 4) /* FIFO error */
528#define MCSR_EOC (1 << 3) /* DMA End-of-Chain (exclusive clear) */
529#define MCSR_FSR (1 << 2) /* FIFO Service Request */
530
531#define GSR __REG(0x4050001C) /* Global Status Register */
532#define GSR_CDONE (1 << 19) /* Command Done */
533#define GSR_SDONE (1 << 18) /* Status Done */
534#define GSR_RDCS (1 << 15) /* Read Completion Status */
535#define GSR_BIT3SLT12 (1 << 14) /* Bit 3 of slot 12 */
536#define GSR_BIT2SLT12 (1 << 13) /* Bit 2 of slot 12 */
537#define GSR_BIT1SLT12 (1 << 12) /* Bit 1 of slot 12 */
538#define GSR_SECRES (1 << 11) /* Secondary Resume Interrupt */
539#define GSR_PRIRES (1 << 10) /* Primary Resume Interrupt */
540#define GSR_SCR (1 << 9) /* Secondary Codec Ready */
541#define GSR_PCR (1 << 8) /* Primary Codec Ready */
542#define GSR_MCINT (1 << 7) /* Mic In Interrupt */
543#define GSR_POINT (1 << 6) /* PCM Out Interrupt */
544#define GSR_PIINT (1 << 5) /* PCM In Interrupt */
545#define GSR_ACOFFD (1 << 3) /* AC-link Shut Off Done */
546#define GSR_MOINT (1 << 2) /* Modem Out Interrupt */
547#define GSR_MIINT (1 << 1) /* Modem In Interrupt */
548#define GSR_GSCI (1 << 0) /* Codec GPI Status Change Interrupt */
549
550#define CAR __REG(0x40500020) /* CODEC Access Register */
551#define CAR_CAIP (1 << 0) /* Codec Access In Progress */
552
553#define PCDR __REG(0x40500040) /* PCM FIFO Data Register */
554#define MCDR __REG(0x40500060) /* Mic-in FIFO Data Register */
555
556#define MOCR __REG(0x40500100) /* Modem Out Control Register */
557#define MOCR_FEIE (1 << 3) /* FIFO Error */
558#define MOCR_FSRIE (1 << 1) /* FIFO Service Request Interrupt Enable */
559
560#define MICR __REG(0x40500108) /* Modem In Control Register */
561#define MICR_FEIE (1 << 3) /* FIFO Error */
562#define MICR_FSRIE (1 << 1) /* FIFO Service Request Interrupt Enable */
563
564#define MOSR __REG(0x40500110) /* Modem Out Status Register */
565#define MOSR_FIFOE (1 << 4) /* FIFO error */
566#define MOSR_FSR (1 << 2) /* FIFO Service Request */
567
568#define MISR __REG(0x40500118) /* Modem In Status Register */
569#define MISR_FIFOE (1 << 4) /* FIFO error */
570#define MISR_EOC (1 << 3) /* DMA End-of-Chain (exclusive clear) */
571#define MISR_FSR (1 << 2) /* FIFO Service Request */
572
573#define MODR __REG(0x40500140) /* Modem FIFO Data Register */
574
575#define PAC_REG_BASE __REG(0x40500200) /* Primary Audio Codec */
576#define SAC_REG_BASE __REG(0x40500300) /* Secondary Audio Codec */
577#define PMC_REG_BASE __REG(0x40500400) /* Primary Modem Codec */
578#define SMC_REG_BASE __REG(0x40500500) /* Secondary Modem Codec */
579
580
581/*
582 * USB Device Controller
583 * PXA25x and PXA27x USB device controller registers are different.
584 */
585#if defined(CONFIG_PXA25x)
586
587#define UDC_RES1 __REG(0x40600004) /* UDC Undocumented - Reserved1 */
588#define UDC_RES2 __REG(0x40600008) /* UDC Undocumented - Reserved2 */
589#define UDC_RES3 __REG(0x4060000C) /* UDC Undocumented - Reserved3 */
590
591#define UDCCR __REG(0x40600000) /* UDC Control Register */
592#define UDCCR_UDE (1 << 0) /* UDC enable */
593#define UDCCR_UDA (1 << 1) /* UDC active */
594#define UDCCR_RSM (1 << 2) /* Device resume */
595#define UDCCR_RESIR (1 << 3) /* Resume interrupt request */
596#define UDCCR_SUSIR (1 << 4) /* Suspend interrupt request */
597#define UDCCR_SRM (1 << 5) /* Suspend/resume interrupt mask */
598#define UDCCR_RSTIR (1 << 6) /* Reset interrupt request */
599#define UDCCR_REM (1 << 7) /* Reset interrupt mask */
600
601#define UDCCS0 __REG(0x40600010) /* UDC Endpoint 0 Control/Status Register */
602#define UDCCS0_OPR (1 << 0) /* OUT packet ready */
603#define UDCCS0_IPR (1 << 1) /* IN packet ready */
604#define UDCCS0_FTF (1 << 2) /* Flush Tx FIFO */
605#define UDCCS0_DRWF (1 << 3) /* Device remote wakeup feature */
606#define UDCCS0_SST (1 << 4) /* Sent stall */
607#define UDCCS0_FST (1 << 5) /* Force stall */
608#define UDCCS0_RNE (1 << 6) /* Receive FIFO no empty */
609#define UDCCS0_SA (1 << 7) /* Setup active */
610
611/* Bulk IN - Endpoint 1,6,11 */
612#define UDCCS1 __REG(0x40600014) /* UDC Endpoint 1 (IN) Control/Status Register */
613#define UDCCS6 __REG(0x40600028) /* UDC Endpoint 6 (IN) Control/Status Register */
614#define UDCCS11 __REG(0x4060003C) /* UDC Endpoint 11 (IN) Control/Status Register */
615
616#define UDCCS_BI_TFS (1 << 0) /* Transmit FIFO service */
617#define UDCCS_BI_TPC (1 << 1) /* Transmit packet complete */
618#define UDCCS_BI_FTF (1 << 2) /* Flush Tx FIFO */
619#define UDCCS_BI_TUR (1 << 3) /* Transmit FIFO underrun */
620#define UDCCS_BI_SST (1 << 4) /* Sent stall */
621#define UDCCS_BI_FST (1 << 5) /* Force stall */
622#define UDCCS_BI_TSP (1 << 7) /* Transmit short packet */
623
624/* Bulk OUT - Endpoint 2,7,12 */
625#define UDCCS2 __REG(0x40600018) /* UDC Endpoint 2 (OUT) Control/Status Register */
626#define UDCCS7 __REG(0x4060002C) /* UDC Endpoint 7 (OUT) Control/Status Register */
627#define UDCCS12 __REG(0x40600040) /* UDC Endpoint 12 (OUT) Control/Status Register */
628
629#define UDCCS_BO_RFS (1 << 0) /* Receive FIFO service */
630#define UDCCS_BO_RPC (1 << 1) /* Receive packet complete */
631#define UDCCS_BO_DME (1 << 3) /* DMA enable */
632#define UDCCS_BO_SST (1 << 4) /* Sent stall */
633#define UDCCS_BO_FST (1 << 5) /* Force stall */
634#define UDCCS_BO_RNE (1 << 6) /* Receive FIFO not empty */
635#define UDCCS_BO_RSP (1 << 7) /* Receive short packet */
636
637/* Isochronous IN - Endpoint 3,8,13 */
638#define UDCCS3 __REG(0x4060001C) /* UDC Endpoint 3 (IN) Control/Status Register */
639#define UDCCS8 __REG(0x40600030) /* UDC Endpoint 8 (IN) Control/Status Register */
640#define UDCCS13 __REG(0x40600044) /* UDC Endpoint 13 (IN) Control/Status Register */
641
642#define UDCCS_II_TFS (1 << 0) /* Transmit FIFO service */
643#define UDCCS_II_TPC (1 << 1) /* Transmit packet complete */
644#define UDCCS_II_FTF (1 << 2) /* Flush Tx FIFO */
645#define UDCCS_II_TUR (1 << 3) /* Transmit FIFO underrun */
646#define UDCCS_II_TSP (1 << 7) /* Transmit short packet */
647
648/* Isochronous OUT - Endpoint 4,9,14 */
649#define UDCCS4 __REG(0x40600020) /* UDC Endpoint 4 (OUT) Control/Status Register */
650#define UDCCS9 __REG(0x40600034) /* UDC Endpoint 9 (OUT) Control/Status Register */
651#define UDCCS14 __REG(0x40600048) /* UDC Endpoint 14 (OUT) Control/Status Register */
652
653#define UDCCS_IO_RFS (1 << 0) /* Receive FIFO service */
654#define UDCCS_IO_RPC (1 << 1) /* Receive packet complete */
655#define UDCCS_IO_ROF (1 << 3) /* Receive overflow */
656#define UDCCS_IO_DME (1 << 3) /* DMA enable */
657#define UDCCS_IO_RNE (1 << 6) /* Receive FIFO not empty */
658#define UDCCS_IO_RSP (1 << 7) /* Receive short packet */
659
660/* Interrupt IN - Endpoint 5,10,15 */
661#define UDCCS5 __REG(0x40600024) /* UDC Endpoint 5 (Interrupt) Control/Status Register */
662#define UDCCS10 __REG(0x40600038) /* UDC Endpoint 10 (Interrupt) Control/Status Register */
663#define UDCCS15 __REG(0x4060004C) /* UDC Endpoint 15 (Interrupt) Control/Status Register */
664
665#define UDCCS_INT_TFS (1 << 0) /* Transmit FIFO service */
666#define UDCCS_INT_TPC (1 << 1) /* Transmit packet complete */
667#define UDCCS_INT_FTF (1 << 2) /* Flush Tx FIFO */
668#define UDCCS_INT_TUR (1 << 3) /* Transmit FIFO underrun */
669#define UDCCS_INT_SST (1 << 4) /* Sent stall */
670#define UDCCS_INT_FST (1 << 5) /* Force stall */
671#define UDCCS_INT_TSP (1 << 7) /* Transmit short packet */
672
673#define UFNRH __REG(0x40600060) /* UDC Frame Number Register High */
674#define UFNRL __REG(0x40600064) /* UDC Frame Number Register Low */
675#define UBCR2 __REG(0x40600068) /* UDC Byte Count Reg 2 */
676#define UBCR4 __REG(0x4060006c) /* UDC Byte Count Reg 4 */
677#define UBCR7 __REG(0x40600070) /* UDC Byte Count Reg 7 */
678#define UBCR9 __REG(0x40600074) /* UDC Byte Count Reg 9 */
679#define UBCR12 __REG(0x40600078) /* UDC Byte Count Reg 12 */
680#define UBCR14 __REG(0x4060007c) /* UDC Byte Count Reg 14 */
681#define UDDR0 __REG(0x40600080) /* UDC Endpoint 0 Data Register */
682#define UDDR1 __REG(0x40600100) /* UDC Endpoint 1 Data Register */
683#define UDDR2 __REG(0x40600180) /* UDC Endpoint 2 Data Register */
684#define UDDR3 __REG(0x40600200) /* UDC Endpoint 3 Data Register */
685#define UDDR4 __REG(0x40600400) /* UDC Endpoint 4 Data Register */
686#define UDDR5 __REG(0x406000A0) /* UDC Endpoint 5 Data Register */
687#define UDDR6 __REG(0x40600600) /* UDC Endpoint 6 Data Register */
688#define UDDR7 __REG(0x40600680) /* UDC Endpoint 7 Data Register */
689#define UDDR8 __REG(0x40600700) /* UDC Endpoint 8 Data Register */
690#define UDDR9 __REG(0x40600900) /* UDC Endpoint 9 Data Register */
691#define UDDR10 __REG(0x406000C0) /* UDC Endpoint 10 Data Register */
692#define UDDR11 __REG(0x40600B00) /* UDC Endpoint 11 Data Register */
693#define UDDR12 __REG(0x40600B80) /* UDC Endpoint 12 Data Register */
694#define UDDR13 __REG(0x40600C00) /* UDC Endpoint 13 Data Register */
695#define UDDR14 __REG(0x40600E00) /* UDC Endpoint 14 Data Register */
696#define UDDR15 __REG(0x406000E0) /* UDC Endpoint 15 Data Register */
697
698#define UICR0 __REG(0x40600050) /* UDC Interrupt Control Register 0 */
699
700#define UICR0_IM0 (1 << 0) /* Interrupt mask ep 0 */
701#define UICR0_IM1 (1 << 1) /* Interrupt mask ep 1 */
702#define UICR0_IM2 (1 << 2) /* Interrupt mask ep 2 */
703#define UICR0_IM3 (1 << 3) /* Interrupt mask ep 3 */
704#define UICR0_IM4 (1 << 4) /* Interrupt mask ep 4 */
705#define UICR0_IM5 (1 << 5) /* Interrupt mask ep 5 */
706#define UICR0_IM6 (1 << 6) /* Interrupt mask ep 6 */
707#define UICR0_IM7 (1 << 7) /* Interrupt mask ep 7 */
708
709#define UICR1 __REG(0x40600054) /* UDC Interrupt Control Register 1 */
710
711#define UICR1_IM8 (1 << 0) /* Interrupt mask ep 8 */
712#define UICR1_IM9 (1 << 1) /* Interrupt mask ep 9 */
713#define UICR1_IM10 (1 << 2) /* Interrupt mask ep 10 */
714#define UICR1_IM11 (1 << 3) /* Interrupt mask ep 11 */
715#define UICR1_IM12 (1 << 4) /* Interrupt mask ep 12 */
716#define UICR1_IM13 (1 << 5) /* Interrupt mask ep 13 */
717#define UICR1_IM14 (1 << 6) /* Interrupt mask ep 14 */
718#define UICR1_IM15 (1 << 7) /* Interrupt mask ep 15 */
719
720#define USIR0 __REG(0x40600058) /* UDC Status Interrupt Register 0 */
721
722#define USIR0_IR0 (1 << 0) /* Interrup request ep 0 */
723#define USIR0_IR1 (1 << 1) /* Interrup request ep 1 */
724#define USIR0_IR2 (1 << 2) /* Interrup request ep 2 */
725#define USIR0_IR3 (1 << 3) /* Interrup request ep 3 */
726#define USIR0_IR4 (1 << 4) /* Interrup request ep 4 */
727#define USIR0_IR5 (1 << 5) /* Interrup request ep 5 */
728#define USIR0_IR6 (1 << 6) /* Interrup request ep 6 */
729#define USIR0_IR7 (1 << 7) /* Interrup request ep 7 */
730
731#define USIR1 __REG(0x4060005C) /* UDC Status Interrupt Register 1 */
732
733#define USIR1_IR8 (1 << 0) /* Interrup request ep 8 */
734#define USIR1_IR9 (1 << 1) /* Interrup request ep 9 */
735#define USIR1_IR10 (1 << 2) /* Interrup request ep 10 */
736#define USIR1_IR11 (1 << 3) /* Interrup request ep 11 */
737#define USIR1_IR12 (1 << 4) /* Interrup request ep 12 */
738#define USIR1_IR13 (1 << 5) /* Interrup request ep 13 */
739#define USIR1_IR14 (1 << 6) /* Interrup request ep 14 */
740#define USIR1_IR15 (1 << 7) /* Interrup request ep 15 */
741
742#elif defined(CONFIG_PXA27x)
743
744#define UDCCR __REG(0x40600000) /* UDC Control Register */
745#define UDCCR_OEN (1 << 31) /* On-the-Go Enable */
746#define UDCCR_AALTHNP (1 << 30) /* A-device Alternate Host Negotiation
747 Protocol Port Support */
748#define UDCCR_AHNP (1 << 29) /* A-device Host Negotiation Protocol
749 Support */
750#define UDCCR_BHNP (1 << 28) /* B-device Host Negotiation Protocol
751 Enable */
752#define UDCCR_DWRE (1 << 16) /* Device Remote Wake-up Enable */
753#define UDCCR_ACN (0x03 << 11) /* Active UDC configuration Number */
754#define UDCCR_ACN_S 11
755#define UDCCR_AIN (0x07 << 8) /* Active UDC interface Number */
756#define UDCCR_AIN_S 8
757#define UDCCR_AAISN (0x07 << 5) /* Active UDC Alternate Interface
758 Setting Number */
759#define UDCCR_AAISN_S 5
760#define UDCCR_SMAC (1 << 4) /* Switch Endpoint Memory to Active
761 Configuration */
762#define UDCCR_EMCE (1 << 3) /* Endpoint Memory Configuration
763 Error */
764#define UDCCR_UDR (1 << 2) /* UDC Resume */
765#define UDCCR_UDA (1 << 1) /* UDC Active */
766#define UDCCR_UDE (1 << 0) /* UDC Enable */
767
768#define UDCICR0 __REG(0x40600004) /* UDC Interrupt Control Register0 */
769#define UDCICR1 __REG(0x40600008) /* UDC Interrupt Control Register1 */
770#define UDCICR_FIFOERR (1 << 1) /* FIFO Error interrupt for EP */
771#define UDCICR_PKTCOMPL (1 << 0) /* Packet Complete interrupt for EP */
772
773#define UDC_INT_FIFOERROR (0x2)
774#define UDC_INT_PACKETCMP (0x1)
775
776#define UDCICR_INT(n,intr) (((intr) & 0x03) << (((n) & 0x0F) * 2))
777#define UDCICR1_IECC (1 << 31) /* IntEn - Configuration Change */
778#define UDCICR1_IESOF (1 << 30) /* IntEn - Start of Frame */
779#define UDCICR1_IERU (1 << 29) /* IntEn - Resume */
780#define UDCICR1_IESU (1 << 28) /* IntEn - Suspend */
781#define UDCICR1_IERS (1 << 27) /* IntEn - Reset */
782
783#define UDCISR0 __REG(0x4060000C) /* UDC Interrupt Status Register 0 */
784#define UDCISR1 __REG(0x40600010) /* UDC Interrupt Status Register 1 */
785#define UDCISR_INT(n,intr) (((intr) & 0x03) << (((n) & 0x0F) * 2))
786#define UDCISR1_IECC (1 << 31) /* IntEn - Configuration Change */
787#define UDCISR1_IESOF (1 << 30) /* IntEn - Start of Frame */
788#define UDCISR1_IERU (1 << 29) /* IntEn - Resume */
789#define UDCISR1_IESU (1 << 28) /* IntEn - Suspend */
790#define UDCISR1_IERS (1 << 27) /* IntEn - Reset */
791
792
793#define UDCFNR __REG(0x40600014) /* UDC Frame Number Register */
794#define UDCOTGICR __REG(0x40600018) /* UDC On-The-Go interrupt control */
795#define UDCOTGICR_IESF (1 << 24) /* OTG SET_FEATURE command recvd */
796#define UDCOTGICR_IEXR (1 << 17) /* Extra Transciever Interrupt
797 Rising Edge Interrupt Enable */
798#define UDCOTGICR_IEXF (1 << 16) /* Extra Transciever Interrupt
799 Falling Edge Interrupt Enable */
800#define UDCOTGICR_IEVV40R (1 << 9) /* OTG Vbus Valid 4.0V Rising Edge
801 Interrupt Enable */
802#define UDCOTGICR_IEVV40F (1 << 8) /* OTG Vbus Valid 4.0V Falling Edge
803 Interrupt Enable */
804#define UDCOTGICR_IEVV44R (1 << 7) /* OTG Vbus Valid 4.4V Rising Edge
805 Interrupt Enable */
806#define UDCOTGICR_IEVV44F (1 << 6) /* OTG Vbus Valid 4.4V Falling Edge
807 Interrupt Enable */
808#define UDCOTGICR_IESVR (1 << 5) /* OTG Session Valid Rising Edge
809 Interrupt Enable */
810#define UDCOTGICR_IESVF (1 << 4) /* OTG Session Valid Falling Edge
811 Interrupt Enable */
812#define UDCOTGICR_IESDR (1 << 3) /* OTG A-Device SRP Detect Rising
813 Edge Interrupt Enable */
814#define UDCOTGICR_IESDF (1 << 2) /* OTG A-Device SRP Detect Falling
815 Edge Interrupt Enable */
816#define UDCOTGICR_IEIDR (1 << 1) /* OTG ID Change Rising Edge
817 Interrupt Enable */
818#define UDCOTGICR_IEIDF (1 << 0) /* OTG ID Change Falling Edge
819 Interrupt Enable */
820
821#define UDCCSN(x) __REG2(0x40600100, (x) << 2)
822#define UDCCSR0 __REG(0x40600100) /* UDC Control/Status register - Endpoint 0 */
823#define UDCCSR0_SA (1 << 7) /* Setup Active */
824#define UDCCSR0_RNE (1 << 6) /* Receive FIFO Not Empty */
825#define UDCCSR0_FST (1 << 5) /* Force Stall */
826#define UDCCSR0_SST (1 << 4) /* Sent Stall */
827#define UDCCSR0_DME (1 << 3) /* DMA Enable */
828#define UDCCSR0_FTF (1 << 2) /* Flush Transmit FIFO */
829#define UDCCSR0_IPR (1 << 1) /* IN Packet Ready */
830#define UDCCSR0_OPC (1 << 0) /* OUT Packet Complete */
831
832#define UDCCSRA __REG(0x40600104) /* UDC Control/Status register - Endpoint A */
833#define UDCCSRB __REG(0x40600108) /* UDC Control/Status register - Endpoint B */
834#define UDCCSRC __REG(0x4060010C) /* UDC Control/Status register - Endpoint C */
835#define UDCCSRD __REG(0x40600110) /* UDC Control/Status register - Endpoint D */
836#define UDCCSRE __REG(0x40600114) /* UDC Control/Status register - Endpoint E */
837#define UDCCSRF __REG(0x40600118) /* UDC Control/Status register - Endpoint F */
838#define UDCCSRG __REG(0x4060011C) /* UDC Control/Status register - Endpoint G */
839#define UDCCSRH __REG(0x40600120) /* UDC Control/Status register - Endpoint H */
840#define UDCCSRI __REG(0x40600124) /* UDC Control/Status register - Endpoint I */
841#define UDCCSRJ __REG(0x40600128) /* UDC Control/Status register - Endpoint J */
842#define UDCCSRK __REG(0x4060012C) /* UDC Control/Status register - Endpoint K */
843#define UDCCSRL __REG(0x40600130) /* UDC Control/Status register - Endpoint L */
844#define UDCCSRM __REG(0x40600134) /* UDC Control/Status register - Endpoint M */
845#define UDCCSRN __REG(0x40600138) /* UDC Control/Status register - Endpoint N */
846#define UDCCSRP __REG(0x4060013C) /* UDC Control/Status register - Endpoint P */
847#define UDCCSRQ __REG(0x40600140) /* UDC Control/Status register - Endpoint Q */
848#define UDCCSRR __REG(0x40600144) /* UDC Control/Status register - Endpoint R */
849#define UDCCSRS __REG(0x40600148) /* UDC Control/Status register - Endpoint S */
850#define UDCCSRT __REG(0x4060014C) /* UDC Control/Status register - Endpoint T */
851#define UDCCSRU __REG(0x40600150) /* UDC Control/Status register - Endpoint U */
852#define UDCCSRV __REG(0x40600154) /* UDC Control/Status register - Endpoint V */
853#define UDCCSRW __REG(0x40600158) /* UDC Control/Status register - Endpoint W */
854#define UDCCSRX __REG(0x4060015C) /* UDC Control/Status register - Endpoint X */
855
856#define UDCCSR_DPE (1 << 9) /* Data Packet Error */
857#define UDCCSR_FEF (1 << 8) /* Flush Endpoint FIFO */
858#define UDCCSR_SP (1 << 7) /* Short Packet Control/Status */
859#define UDCCSR_BNE (1 << 6) /* Buffer Not Empty (IN endpoints) */
860#define UDCCSR_BNF (1 << 6) /* Buffer Not Full (OUT endpoints) */
861#define UDCCSR_FST (1 << 5) /* Force STALL */
862#define UDCCSR_SST (1 << 4) /* Sent STALL */
863#define UDCCSR_DME (1 << 3) /* DMA Enable */
864#define UDCCSR_TRN (1 << 2) /* Tx/Rx NAK */
865#define UDCCSR_PC (1 << 1) /* Packet Complete */
866#define UDCCSR_FS (1 << 0) /* FIFO needs service */
867
868#define UDCBCN(x) __REG2(0x40600200, (x)<<2)
869#define UDCBCR0 __REG(0x40600200) /* Byte Count Register - EP0 */
870#define UDCBCRA __REG(0x40600204) /* Byte Count Register - EPA */
871#define UDCBCRB __REG(0x40600208) /* Byte Count Register - EPB */
872#define UDCBCRC __REG(0x4060020C) /* Byte Count Register - EPC */
873#define UDCBCRD __REG(0x40600210) /* Byte Count Register - EPD */
874#define UDCBCRE __REG(0x40600214) /* Byte Count Register - EPE */
875#define UDCBCRF __REG(0x40600218) /* Byte Count Register - EPF */
876#define UDCBCRG __REG(0x4060021C) /* Byte Count Register - EPG */
877#define UDCBCRH __REG(0x40600220) /* Byte Count Register - EPH */
878#define UDCBCRI __REG(0x40600224) /* Byte Count Register - EPI */
879#define UDCBCRJ __REG(0x40600228) /* Byte Count Register - EPJ */
880#define UDCBCRK __REG(0x4060022C) /* Byte Count Register - EPK */
881#define UDCBCRL __REG(0x40600230) /* Byte Count Register - EPL */
882#define UDCBCRM __REG(0x40600234) /* Byte Count Register - EPM */
883#define UDCBCRN __REG(0x40600238) /* Byte Count Register - EPN */
884#define UDCBCRP __REG(0x4060023C) /* Byte Count Register - EPP */
885#define UDCBCRQ __REG(0x40600240) /* Byte Count Register - EPQ */
886#define UDCBCRR __REG(0x40600244) /* Byte Count Register - EPR */
887#define UDCBCRS __REG(0x40600248) /* Byte Count Register - EPS */
888#define UDCBCRT __REG(0x4060024C) /* Byte Count Register - EPT */
889#define UDCBCRU __REG(0x40600250) /* Byte Count Register - EPU */
890#define UDCBCRV __REG(0x40600254) /* Byte Count Register - EPV */
891#define UDCBCRW __REG(0x40600258) /* Byte Count Register - EPW */
892#define UDCBCRX __REG(0x4060025C) /* Byte Count Register - EPX */
893
894#define UDCDN(x) __REG2(0x40600300, (x)<<2)
895#define PHYS_UDCDN(x) (0x40600300 + ((x)<<2))
896#define PUDCDN(x) (volatile u32 *)(io_p2v(PHYS_UDCDN((x))))
897#define UDCDR0 __REG(0x40600300) /* Data Register - EP0 */
898#define UDCDRA __REG(0x40600304) /* Data Register - EPA */
899#define UDCDRB __REG(0x40600308) /* Data Register - EPB */
900#define UDCDRC __REG(0x4060030C) /* Data Register - EPC */
901#define UDCDRD __REG(0x40600310) /* Data Register - EPD */
902#define UDCDRE __REG(0x40600314) /* Data Register - EPE */
903#define UDCDRF __REG(0x40600318) /* Data Register - EPF */
904#define UDCDRG __REG(0x4060031C) /* Data Register - EPG */
905#define UDCDRH __REG(0x40600320) /* Data Register - EPH */
906#define UDCDRI __REG(0x40600324) /* Data Register - EPI */
907#define UDCDRJ __REG(0x40600328) /* Data Register - EPJ */
908#define UDCDRK __REG(0x4060032C) /* Data Register - EPK */
909#define UDCDRL __REG(0x40600330) /* Data Register - EPL */
910#define UDCDRM __REG(0x40600334) /* Data Register - EPM */
911#define UDCDRN __REG(0x40600338) /* Data Register - EPN */
912#define UDCDRP __REG(0x4060033C) /* Data Register - EPP */
913#define UDCDRQ __REG(0x40600340) /* Data Register - EPQ */
914#define UDCDRR __REG(0x40600344) /* Data Register - EPR */
915#define UDCDRS __REG(0x40600348) /* Data Register - EPS */
916#define UDCDRT __REG(0x4060034C) /* Data Register - EPT */
917#define UDCDRU __REG(0x40600350) /* Data Register - EPU */
918#define UDCDRV __REG(0x40600354) /* Data Register - EPV */
919#define UDCDRW __REG(0x40600358) /* Data Register - EPW */
920#define UDCDRX __REG(0x4060035C) /* Data Register - EPX */
921
922#define UDCCN(x) __REG2(0x40600400, (x)<<2)
923#define UDCCRA __REG(0x40600404) /* Configuration register EPA */
924#define UDCCRB __REG(0x40600408) /* Configuration register EPB */
925#define UDCCRC __REG(0x4060040C) /* Configuration register EPC */
926#define UDCCRD __REG(0x40600410) /* Configuration register EPD */
927#define UDCCRE __REG(0x40600414) /* Configuration register EPE */
928#define UDCCRF __REG(0x40600418) /* Configuration register EPF */
929#define UDCCRG __REG(0x4060041C) /* Configuration register EPG */
930#define UDCCRH __REG(0x40600420) /* Configuration register EPH */
931#define UDCCRI __REG(0x40600424) /* Configuration register EPI */
932#define UDCCRJ __REG(0x40600428) /* Configuration register EPJ */
933#define UDCCRK __REG(0x4060042C) /* Configuration register EPK */
934#define UDCCRL __REG(0x40600430) /* Configuration register EPL */
935#define UDCCRM __REG(0x40600434) /* Configuration register EPM */
936#define UDCCRN __REG(0x40600438) /* Configuration register EPN */
937#define UDCCRP __REG(0x4060043C) /* Configuration register EPP */
938#define UDCCRQ __REG(0x40600440) /* Configuration register EPQ */
939#define UDCCRR __REG(0x40600444) /* Configuration register EPR */
940#define UDCCRS __REG(0x40600448) /* Configuration register EPS */
941#define UDCCRT __REG(0x4060044C) /* Configuration register EPT */
942#define UDCCRU __REG(0x40600450) /* Configuration register EPU */
943#define UDCCRV __REG(0x40600454) /* Configuration register EPV */
944#define UDCCRW __REG(0x40600458) /* Configuration register EPW */
945#define UDCCRX __REG(0x4060045C) /* Configuration register EPX */
946
947#define UDCCONR_CN (0x03 << 25) /* Configuration Number */
948#define UDCCONR_CN_S (25)
949#define UDCCONR_IN (0x07 << 22) /* Interface Number */
950#define UDCCONR_IN_S (22)
951#define UDCCONR_AISN (0x07 << 19) /* Alternate Interface Number */
952#define UDCCONR_AISN_S (19)
953#define UDCCONR_EN (0x0f << 15) /* Endpoint Number */
954#define UDCCONR_EN_S (15)
955#define UDCCONR_ET (0x03 << 13) /* Endpoint Type: */
956#define UDCCONR_ET_S (13)
957#define UDCCONR_ET_INT (0x03 << 13) /* Interrupt */
958#define UDCCONR_ET_BULK (0x02 << 13) /* Bulk */
959#define UDCCONR_ET_ISO (0x01 << 13) /* Isochronous */
960#define UDCCONR_ET_NU (0x00 << 13) /* Not used */
961#define UDCCONR_ED (1 << 12) /* Endpoint Direction */
962#define UDCCONR_MPS (0x3ff << 2) /* Maximum Packet Size */
963#define UDCCONR_MPS_S (2)
964#define UDCCONR_DE (1 << 1) /* Double Buffering Enable */
965#define UDCCONR_EE (1 << 0) /* Endpoint Enable */
966
967
968#define UDC_INT_FIFOERROR (0x2)
969#define UDC_INT_PACKETCMP (0x1)
970
971#define UDC_FNR_MASK (0x7ff)
972
973#define UDCCSR_WR_MASK (UDCCSR_DME|UDCCSR_FST)
974#define UDC_BCR_MASK (0x3ff)
975#endif
976
977/*
978 * Fast Infrared Communication Port
979 */
980
981#define FICP __REG(0x40800000) /* Start of FICP area */
982#define ICCR0 __REG(0x40800000) /* ICP Control Register 0 */
983#define ICCR1 __REG(0x40800004) /* ICP Control Register 1 */
984#define ICCR2 __REG(0x40800008) /* ICP Control Register 2 */
985#define ICDR __REG(0x4080000c) /* ICP Data Register */
986#define ICSR0 __REG(0x40800014) /* ICP Status Register 0 */
987#define ICSR1 __REG(0x40800018) /* ICP Status Register 1 */
988
989#define ICCR0_AME (1 << 7) /* Adress match enable */
990#define ICCR0_TIE (1 << 6) /* Transmit FIFO interrupt enable */
991#define ICCR0_RIE (1 << 5) /* Recieve FIFO interrupt enable */
992#define ICCR0_RXE (1 << 4) /* Receive enable */
993#define ICCR0_TXE (1 << 3) /* Transmit enable */
994#define ICCR0_TUS (1 << 2) /* Transmit FIFO underrun select */
995#define ICCR0_LBM (1 << 1) /* Loopback mode */
996#define ICCR0_ITR (1 << 0) /* IrDA transmission */
997
998#ifdef CONFIG_PXA27x
999#define ICCR2_RXP (1 << 3) /* Receive Pin Polarity select */
1000#define ICCR2_TXP (1 << 2) /* Transmit Pin Polarity select */
1001#define ICCR2_TRIG (3 << 0) /* Receive FIFO Trigger threshold */
1002#define ICCR2_TRIG_8 (0 << 0) /* >= 8 bytes */
1003#define ICCR2_TRIG_16 (1 << 0) /* >= 16 bytes */
1004#define ICCR2_TRIG_32 (2 << 0) /* >= 32 bytes */
1005#endif
1006
1007#ifdef CONFIG_PXA27x
1008#define ICSR0_EOC (1 << 6) /* DMA End of Descriptor Chain */
1009#endif
1010#define ICSR0_FRE (1 << 5) /* Framing error */
1011#define ICSR0_RFS (1 << 4) /* Receive FIFO service request */
1012#define ICSR0_TFS (1 << 3) /* Transnit FIFO service request */
1013#define ICSR0_RAB (1 << 2) /* Receiver abort */
1014#define ICSR0_TUR (1 << 1) /* Trunsmit FIFO underun */
1015#define ICSR0_EIF (1 << 0) /* End/Error in FIFO */
1016
1017#define ICSR1_ROR (1 << 6) /* Receiver FIFO underrun */
1018#define ICSR1_CRE (1 << 5) /* CRC error */
1019#define ICSR1_EOF (1 << 4) /* End of frame */
1020#define ICSR1_TNF (1 << 3) /* Transmit FIFO not full */
1021#define ICSR1_RNE (1 << 2) /* Receive FIFO not empty */
1022#define ICSR1_TBY (1 << 1) /* Tramsmiter busy flag */
1023#define ICSR1_RSY (1 << 0) /* Recevier synchronized flag */
1024
1025
1026/*
1027 * Real Time Clock
1028 */
1029
1030#define RCNR __REG(0x40900000) /* RTC Count Register */
1031#define RTAR __REG(0x40900004) /* RTC Alarm Register */
1032#define RTSR __REG(0x40900008) /* RTC Status Register */
1033#define RTTR __REG(0x4090000C) /* RTC Timer Trim Register */
1034#define PIAR __REG(0x40900038) /* Periodic Interrupt Alarm Register */
1035
1036#define RTSR_PICE (1 << 15) /* Periodic interrupt count enable */
1037#define RTSR_PIALE (1 << 14) /* Periodic interrupt Alarm enable */
1038#define RTSR_HZE (1 << 3) /* HZ interrupt enable */
1039#define RTSR_ALE (1 << 2) /* RTC alarm interrupt enable */
1040#define RTSR_HZ (1 << 1) /* HZ rising-edge detected */
1041#define RTSR_AL (1 << 0) /* RTC alarm detected */
1042
1043
1044/*
1045 * OS Timer & Match Registers
1046 */
1047
1048#define OSMR0 __REG(0x40A00000) /* */
1049#define OSMR1 __REG(0x40A00004) /* */
1050#define OSMR2 __REG(0x40A00008) /* */
1051#define OSMR3 __REG(0x40A0000C) /* */
1052#define OSMR4 __REG(0x40A00080) /* */
1053#define OSCR __REG(0x40A00010) /* OS Timer Counter Register */
1054#define OSCR4 __REG(0x40A00040) /* OS Timer Counter Register */
1055#define OMCR4 __REG(0x40A000C0) /* */
1056#define OSSR __REG(0x40A00014) /* OS Timer Status Register */
1057#define OWER __REG(0x40A00018) /* OS Timer Watchdog Enable Register */
1058#define OIER __REG(0x40A0001C) /* OS Timer Interrupt Enable Register */
1059
1060#define OSSR_M3 (1 << 3) /* Match status channel 3 */
1061#define OSSR_M2 (1 << 2) /* Match status channel 2 */
1062#define OSSR_M1 (1 << 1) /* Match status channel 1 */
1063#define OSSR_M0 (1 << 0) /* Match status channel 0 */
1064
1065#define OWER_WME (1 << 0) /* Watchdog Match Enable */
1066
1067#define OIER_E3 (1 << 3) /* Interrupt enable channel 3 */
1068#define OIER_E2 (1 << 2) /* Interrupt enable channel 2 */
1069#define OIER_E1 (1 << 1) /* Interrupt enable channel 1 */
1070#define OIER_E0 (1 << 0) /* Interrupt enable channel 0 */
1071
1072
1073/*
1074 * Pulse Width Modulator
1075 */
1076
1077#define PWM_CTRL0 __REG(0x40B00000) /* PWM 0 Control Register */
1078#define PWM_PWDUTY0 __REG(0x40B00004) /* PWM 0 Duty Cycle Register */
1079#define PWM_PERVAL0 __REG(0x40B00008) /* PWM 0 Period Control Register */
1080
1081#define PWM_CTRL1 __REG(0x40C00000) /* PWM 1Control Register */
1082#define PWM_PWDUTY1 __REG(0x40C00004) /* PWM 1 Duty Cycle Register */
1083#define PWM_PERVAL1 __REG(0x40C00008) /* PWM 1 Period Control Register */
1084
1085
1086/*
1087 * Interrupt Controller
1088 */
1089
1090#define ICIP __REG(0x40D00000) /* Interrupt Controller IRQ Pending Register */
1091#define ICMR __REG(0x40D00004) /* Interrupt Controller Mask Register */
1092#define ICLR __REG(0x40D00008) /* Interrupt Controller Level Register */
1093#define ICFP __REG(0x40D0000C) /* Interrupt Controller FIQ Pending Register */
1094#define ICPR __REG(0x40D00010) /* Interrupt Controller Pending Register */
1095#define ICCR __REG(0x40D00014) /* Interrupt Controller Control Register */
1096
1097
1098/*
1099 * General Purpose I/O
1100 */
1101
1102#define GPLR0 __REG(0x40E00000) /* GPIO Pin-Level Register GPIO<31:0> */
1103#define GPLR1 __REG(0x40E00004) /* GPIO Pin-Level Register GPIO<63:32> */
1104#define GPLR2 __REG(0x40E00008) /* GPIO Pin-Level Register GPIO<80:64> */
1105
1106#define GPDR0 __REG(0x40E0000C) /* GPIO Pin Direction Register GPIO<31:0> */
1107#define GPDR1 __REG(0x40E00010) /* GPIO Pin Direction Register GPIO<63:32> */
1108#define GPDR2 __REG(0x40E00014) /* GPIO Pin Direction Register GPIO<80:64> */
1109
1110#define GPSR0 __REG(0x40E00018) /* GPIO Pin Output Set Register GPIO<31:0> */
1111#define GPSR1 __REG(0x40E0001C) /* GPIO Pin Output Set Register GPIO<63:32> */
1112#define GPSR2 __REG(0x40E00020) /* GPIO Pin Output Set Register GPIO<80:64> */
1113
1114#define GPCR0 __REG(0x40E00024) /* GPIO Pin Output Clear Register GPIO<31:0> */
1115#define GPCR1 __REG(0x40E00028) /* GPIO Pin Output Clear Register GPIO <63:32> */
1116#define GPCR2 __REG(0x40E0002C) /* GPIO Pin Output Clear Register GPIO <80:64> */
1117
1118#define GRER0 __REG(0x40E00030) /* GPIO Rising-Edge Detect Register GPIO<31:0> */
1119#define GRER1 __REG(0x40E00034) /* GPIO Rising-Edge Detect Register GPIO<63:32> */
1120#define GRER2 __REG(0x40E00038) /* GPIO Rising-Edge Detect Register GPIO<80:64> */
1121
1122#define GFER0 __REG(0x40E0003C) /* GPIO Falling-Edge Detect Register GPIO<31:0> */
1123#define GFER1 __REG(0x40E00040) /* GPIO Falling-Edge Detect Register GPIO<63:32> */
1124#define GFER2 __REG(0x40E00044) /* GPIO Falling-Edge Detect Register GPIO<80:64> */
1125
1126#define GEDR0 __REG(0x40E00048) /* GPIO Edge Detect Status Register GPIO<31:0> */
1127#define GEDR1 __REG(0x40E0004C) /* GPIO Edge Detect Status Register GPIO<63:32> */
1128#define GEDR2 __REG(0x40E00050) /* GPIO Edge Detect Status Register GPIO<80:64> */
1129
1130#define GAFR0_L __REG(0x40E00054) /* GPIO Alternate Function Select Register GPIO<15:0> */
1131#define GAFR0_U __REG(0x40E00058) /* GPIO Alternate Function Select Register GPIO<31:16> */
1132#define GAFR1_L __REG(0x40E0005C) /* GPIO Alternate Function Select Register GPIO<47:32> */
1133#define GAFR1_U __REG(0x40E00060) /* GPIO Alternate Function Select Register GPIO<63:48> */
1134#define GAFR2_L __REG(0x40E00064) /* GPIO Alternate Function Select Register GPIO<79:64> */
1135#define GAFR2_U __REG(0x40E00068) /* GPIO Alternate Function Select Register GPIO<95-80> */
1136#define GAFR3_L __REG(0x40E0006C) /* GPIO Alternate Function Select Register GPIO<111:96> */
1137#define GAFR3_U __REG(0x40E00070) /* GPIO Alternate Function Select Register GPIO<127:112> */
1138
1139#define GPLR3 __REG(0x40E00100) /* GPIO Pin-Level Register GPIO<127:96> */
1140#define GPDR3 __REG(0x40E0010C) /* GPIO Pin Direction Register GPIO<127:96> */
1141#define GPSR3 __REG(0x40E00118) /* GPIO Pin Output Set Register GPIO<127:96> */
1142#define GPCR3 __REG(0x40E00124) /* GPIO Pin Output Clear Register GPIO<127:96> */
1143#define GRER3 __REG(0x40E00130) /* GPIO Rising-Edge Detect Register GPIO<127:96> */
1144#define GFER3 __REG(0x40E0013C) /* GPIO Falling-Edge Detect Register GPIO<127:96> */
1145#define GEDR3 __REG(0x40E00148) /* GPIO Edge Detect Status Register GPIO<127:96> */
1146
1147/* More handy macros. The argument is a literal GPIO number. */
1148
1149#define GPIO_bit(x) (1 << ((x) & 0x1f))
1150
1151#ifdef CONFIG_PXA27x
1152
1153/* Interrupt Controller */
1154
1155#define ICIP2 __REG(0x40D0009C) /* Interrupt Controller IRQ Pending Register 2 */
1156#define ICMR2 __REG(0x40D000A0) /* Interrupt Controller Mask Register 2 */
1157#define ICLR2 __REG(0x40D000A4) /* Interrupt Controller Level Register 2 */
1158#define ICFP2 __REG(0x40D000A8) /* Interrupt Controller FIQ Pending Register 2 */
1159#define ICPR2 __REG(0x40D000AC) /* Interrupt Controller Pending Register 2 */
1160
1161#define _GPLR(x) __REG2(0x40E00000, ((x) & 0x60) >> 3)
1162#define _GPDR(x) __REG2(0x40E0000C, ((x) & 0x60) >> 3)
1163#define _GPSR(x) __REG2(0x40E00018, ((x) & 0x60) >> 3)
1164#define _GPCR(x) __REG2(0x40E00024, ((x) & 0x60) >> 3)
1165#define _GRER(x) __REG2(0x40E00030, ((x) & 0x60) >> 3)
1166#define _GFER(x) __REG2(0x40E0003C, ((x) & 0x60) >> 3)
1167#define _GEDR(x) __REG2(0x40E00048, ((x) & 0x60) >> 3)
1168#define _GAFR(x) __REG2(0x40E00054, ((x) & 0x70) >> 2)
1169
1170#define GPLR(x) (*((((x) & 0x7f) < 96) ? &_GPLR(x) : &GPLR3))
1171#define GPDR(x) (*((((x) & 0x7f) < 96) ? &_GPDR(x) : &GPDR3))
1172#define GPSR(x) (*((((x) & 0x7f) < 96) ? &_GPSR(x) : &GPSR3))
1173#define GPCR(x) (*((((x) & 0x7f) < 96) ? &_GPCR(x) : &GPCR3))
1174#define GRER(x) (*((((x) & 0x7f) < 96) ? &_GRER(x) : &GRER3))
1175#define GFER(x) (*((((x) & 0x7f) < 96) ? &_GFER(x) : &GFER3))
1176#define GEDR(x) (*((((x) & 0x7f) < 96) ? &_GEDR(x) : &GEDR3))
1177#define GAFR(x) (*((((x) & 0x7f) < 96) ? &_GAFR(x) : \
1178 ((((x) & 0x7f) < 112) ? &GAFR3_L : &GAFR3_U)))
1179#else
1180
1181#define GPLR(x) __REG2(0x40E00000, ((x) & 0x60) >> 3)
1182#define GPDR(x) __REG2(0x40E0000C, ((x) & 0x60) >> 3)
1183#define GPSR(x) __REG2(0x40E00018, ((x) & 0x60) >> 3)
1184#define GPCR(x) __REG2(0x40E00024, ((x) & 0x60) >> 3)
1185#define GRER(x) __REG2(0x40E00030, ((x) & 0x60) >> 3)
1186#define GFER(x) __REG2(0x40E0003C, ((x) & 0x60) >> 3)
1187#define GEDR(x) __REG2(0x40E00048, ((x) & 0x60) >> 3)
1188#define GAFR(x) __REG2(0x40E00054, ((x) & 0x70) >> 2)
1189
1190#endif
1191
1192
1193/* GPIO alternate function assignments */
1194
1195#define GPIO1_RST 1 /* reset */
1196#define GPIO6_MMCCLK 6 /* MMC Clock */
1197#define GPIO7_48MHz 7 /* 48 MHz clock output */
1198#define GPIO8_MMCCS0 8 /* MMC Chip Select 0 */
1199#define GPIO9_MMCCS1 9 /* MMC Chip Select 1 */
1200#define GPIO10_RTCCLK 10 /* real time clock (1 Hz) */
1201#define GPIO11_3_6MHz 11 /* 3.6 MHz oscillator out */
1202#define GPIO12_32KHz 12 /* 32 kHz out */
1203#define GPIO13_MBGNT 13 /* memory controller grant */
1204#define GPIO14_MBREQ 14 /* alternate bus master request */
1205#define GPIO15_nCS_1 15 /* chip select 1 */
1206#define GPIO16_PWM0 16 /* PWM0 output */
1207#define GPIO17_PWM1 17 /* PWM1 output */
1208#define GPIO18_RDY 18 /* Ext. Bus Ready */
1209#define GPIO19_DREQ1 19 /* External DMA Request */
1210#define GPIO20_DREQ0 20 /* External DMA Request */
1211#define GPIO23_SCLK 23 /* SSP clock */
1212#define GPIO24_SFRM 24 /* SSP Frame */
1213#define GPIO25_STXD 25 /* SSP transmit */
1214#define GPIO26_SRXD 26 /* SSP receive */
1215#define GPIO27_SEXTCLK 27 /* SSP ext_clk */
1216#define GPIO28_BITCLK 28 /* AC97/I2S bit_clk */
1217#define GPIO29_SDATA_IN 29 /* AC97 Sdata_in0 / I2S Sdata_in */
1218#define GPIO30_SDATA_OUT 30 /* AC97/I2S Sdata_out */
1219#define GPIO31_SYNC 31 /* AC97/I2S sync */
1220#define GPIO32_SDATA_IN1 32 /* AC97 Sdata_in1 */
1221#define GPIO32_SYSCLK 32 /* I2S System Clock */
1222#define GPIO32_MMCCLK 32 /* MMC Clock (PXA270) */
1223#define GPIO33_nCS_5 33 /* chip select 5 */
1224#define GPIO34_FFRXD 34 /* FFUART receive */
1225#define GPIO34_MMCCS0 34 /* MMC Chip Select 0 */
1226#define GPIO35_FFCTS 35 /* FFUART Clear to send */
1227#define GPIO36_FFDCD 36 /* FFUART Data carrier detect */
1228#define GPIO37_FFDSR 37 /* FFUART data set ready */
1229#define GPIO38_FFRI 38 /* FFUART Ring Indicator */
1230#define GPIO39_MMCCS1 39 /* MMC Chip Select 1 */
1231#define GPIO39_FFTXD 39 /* FFUART transmit data */
1232#define GPIO40_FFDTR 40 /* FFUART data terminal Ready */
1233#define GPIO41_FFRTS 41 /* FFUART request to send */
1234#define GPIO42_BTRXD 42 /* BTUART receive data */
1235#define GPIO43_BTTXD 43 /* BTUART transmit data */
1236#define GPIO44_BTCTS 44 /* BTUART clear to send */
1237#define GPIO45_BTRTS 45 /* BTUART request to send */
1238#define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */
1239#define GPIO46_ICPRXD 46 /* ICP receive data */
1240#define GPIO46_STRXD 46 /* STD_UART receive data */
1241#define GPIO47_ICPTXD 47 /* ICP transmit data */
1242#define GPIO47_STTXD 47 /* STD_UART transmit data */
1243#define GPIO48_nPOE 48 /* Output Enable for Card Space */
1244#define GPIO49_nPWE 49 /* Write Enable for Card Space */
1245#define GPIO50_nPIOR 50 /* I/O Read for Card Space */
1246#define GPIO51_nPIOW 51 /* I/O Write for Card Space */
1247#define GPIO52_nPCE_1 52 /* Card Enable for Card Space */
1248#define GPIO53_nPCE_2 53 /* Card Enable for Card Space */
1249#define GPIO53_MMCCLK 53 /* MMC Clock */
1250#define GPIO54_MMCCLK 54 /* MMC Clock */
1251#define GPIO54_pSKTSEL 54 /* Socket Select for Card Space */
1252#define GPIO54_nPCE_2 54 /* Card Enable for Card Space (PXA27x) */
1253#define GPIO55_nPREG 55 /* Card Address bit 26 */
1254#define GPIO56_nPWAIT 56 /* Wait signal for Card Space */
1255#define GPIO57_nIOIS16 57 /* Bus Width select for I/O Card Space */
1256#define GPIO58_LDD_0 58 /* LCD data pin 0 */
1257#define GPIO59_LDD_1 59 /* LCD data pin 1 */
1258#define GPIO60_LDD_2 60 /* LCD data pin 2 */
1259#define GPIO61_LDD_3 61 /* LCD data pin 3 */
1260#define GPIO62_LDD_4 62 /* LCD data pin 4 */
1261#define GPIO63_LDD_5 63 /* LCD data pin 5 */
1262#define GPIO64_LDD_6 64 /* LCD data pin 6 */
1263#define GPIO65_LDD_7 65 /* LCD data pin 7 */
1264#define GPIO66_LDD_8 66 /* LCD data pin 8 */
1265#define GPIO66_MBREQ 66 /* alternate bus master req */
1266#define GPIO67_LDD_9 67 /* LCD data pin 9 */
1267#define GPIO67_MMCCS0 67 /* MMC Chip Select 0 */
1268#define GPIO68_LDD_10 68 /* LCD data pin 10 */
1269#define GPIO68_MMCCS1 68 /* MMC Chip Select 1 */
1270#define GPIO69_LDD_11 69 /* LCD data pin 11 */
1271#define GPIO69_MMCCLK 69 /* MMC_CLK */
1272#define GPIO70_LDD_12 70 /* LCD data pin 12 */
1273#define GPIO70_RTCCLK 70 /* Real Time clock (1 Hz) */
1274#define GPIO71_LDD_13 71 /* LCD data pin 13 */
1275#define GPIO71_3_6MHz 71 /* 3.6 MHz Oscillator clock */
1276#define GPIO72_LDD_14 72 /* LCD data pin 14 */
1277#define GPIO72_32kHz 72 /* 32 kHz clock */
1278#define GPIO73_LDD_15 73 /* LCD data pin 15 */
1279#define GPIO73_MBGNT 73 /* Memory controller grant */
1280#define GPIO74_LCD_FCLK 74 /* LCD Frame clock */
1281#define GPIO75_LCD_LCLK 75 /* LCD line clock */
1282#define GPIO76_LCD_PCLK 76 /* LCD Pixel clock */
1283#define GPIO77_LCD_ACBIAS 77 /* LCD AC Bias */
1284#define GPIO78_nCS_2 78 /* chip select 2 */
1285#define GPIO79_nCS_3 79 /* chip select 3 */
1286#define GPIO80_nCS_4 80 /* chip select 4 */
1287#define GPIO81_NSCLK 81 /* NSSP clock */
1288#define GPIO82_NSFRM 82 /* NSSP Frame */
1289#define GPIO83_NSTXD 83 /* NSSP transmit */
1290#define GPIO84_NSRXD 84 /* NSSP receive */
1291#define GPIO85_nPCE_1 85 /* Card Enable for Card Space (PXA27x) */
1292#define GPIO92_MMCDAT0 92 /* MMC DAT0 (PXA27x) */
1293#define GPIO109_MMCDAT1 109 /* MMC DAT1 (PXA27x) */
1294#define GPIO110_MMCDAT2 110 /* MMC DAT2 (PXA27x) */
1295#define GPIO110_MMCCS0 110 /* MMC Chip Select 0 (PXA27x) */
1296#define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */
1297#define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */
1298#define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */
1299#define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */
1300
1301/* GPIO alternate function mode & direction */
1302
1303#define GPIO_IN 0x000
1304#define GPIO_OUT 0x080
1305#define GPIO_ALT_FN_1_IN 0x100
1306#define GPIO_ALT_FN_1_OUT 0x180
1307#define GPIO_ALT_FN_2_IN 0x200
1308#define GPIO_ALT_FN_2_OUT 0x280
1309#define GPIO_ALT_FN_3_IN 0x300
1310#define GPIO_ALT_FN_3_OUT 0x380
1311#define GPIO_MD_MASK_NR 0x07f
1312#define GPIO_MD_MASK_DIR 0x080
1313#define GPIO_MD_MASK_FN 0x300
1314#define GPIO_DFLT_LOW 0x400
1315#define GPIO_DFLT_HIGH 0x800
1316
1317#define GPIO1_RTS_MD ( 1 | GPIO_ALT_FN_1_IN)
1318#define GPIO6_MMCCLK_MD ( 6 | GPIO_ALT_FN_1_OUT)
1319#define GPIO7_48MHz_MD ( 7 | GPIO_ALT_FN_1_OUT)
1320#define GPIO8_MMCCS0_MD ( 8 | GPIO_ALT_FN_1_OUT)
1321#define GPIO9_MMCCS1_MD ( 9 | GPIO_ALT_FN_1_OUT)
1322#define GPIO10_RTCCLK_MD (10 | GPIO_ALT_FN_1_OUT)
1323#define GPIO11_3_6MHz_MD (11 | GPIO_ALT_FN_1_OUT)
1324#define GPIO12_32KHz_MD (12 | GPIO_ALT_FN_1_OUT)
1325#define GPIO13_MBGNT_MD (13 | GPIO_ALT_FN_2_OUT)
1326#define GPIO14_MBREQ_MD (14 | GPIO_ALT_FN_1_IN)
1327#define GPIO15_nCS_1_MD (15 | GPIO_ALT_FN_2_OUT)
1328#define GPIO16_PWM0_MD (16 | GPIO_ALT_FN_2_OUT)
1329#define GPIO17_PWM1_MD (17 | GPIO_ALT_FN_2_OUT)
1330#define GPIO18_RDY_MD (18 | GPIO_ALT_FN_1_IN)
1331#define GPIO19_DREQ1_MD (19 | GPIO_ALT_FN_1_IN)
1332#define GPIO20_DREQ0_MD (20 | GPIO_ALT_FN_1_IN)
1333#define GPIO23_SCLK_MD (23 | GPIO_ALT_FN_2_OUT)
1334#define GPIO24_SFRM_MD (24 | GPIO_ALT_FN_2_OUT)
1335#define GPIO25_STXD_MD (25 | GPIO_ALT_FN_2_OUT)
1336#define GPIO26_SRXD_MD (26 | GPIO_ALT_FN_1_IN)
1337#define GPIO27_SEXTCLK_MD (27 | GPIO_ALT_FN_1_IN)
1338#define GPIO28_BITCLK_AC97_MD (28 | GPIO_ALT_FN_1_IN)
1339#define GPIO28_BITCLK_IN_I2S_MD (28 | GPIO_ALT_FN_2_IN)
1340#define GPIO28_BITCLK_OUT_I2S_MD (28 | GPIO_ALT_FN_1_OUT)
1341#define GPIO29_SDATA_IN_AC97_MD (29 | GPIO_ALT_FN_1_IN)
1342#define GPIO29_SDATA_IN_I2S_MD (29 | GPIO_ALT_FN_2_IN)
1343#define GPIO30_SDATA_OUT_AC97_MD (30 | GPIO_ALT_FN_2_OUT)
1344#define GPIO30_SDATA_OUT_I2S_MD (30 | GPIO_ALT_FN_1_OUT)
1345#define GPIO31_SYNC_I2S_MD (31 | GPIO_ALT_FN_1_OUT)
1346#define GPIO31_SYNC_AC97_MD (31 | GPIO_ALT_FN_2_OUT)
1347#define GPIO32_SDATA_IN1_AC97_MD (32 | GPIO_ALT_FN_1_IN)
1348#define GPIO32_SYSCLK_I2S_MD (32 | GPIO_ALT_FN_1_OUT)
1349#define GPIO32_MMCCLK_MD ( 32 | GPIO_ALT_FN_2_OUT)
1350#define GPIO33_nCS_5_MD (33 | GPIO_ALT_FN_2_OUT)
1351#define GPIO34_FFRXD_MD (34 | GPIO_ALT_FN_1_IN)
1352#define GPIO34_MMCCS0_MD (34 | GPIO_ALT_FN_2_OUT)
1353#define GPIO35_FFCTS_MD (35 | GPIO_ALT_FN_1_IN)
1354#define GPIO36_FFDCD_MD (36 | GPIO_ALT_FN_1_IN)
1355#define GPIO37_FFDSR_MD (37 | GPIO_ALT_FN_1_IN)
1356#define GPIO38_FFRI_MD (38 | GPIO_ALT_FN_1_IN)
1357#define GPIO39_MMCCS1_MD (39 | GPIO_ALT_FN_1_OUT)
1358#define GPIO39_FFTXD_MD (39 | GPIO_ALT_FN_2_OUT)
1359#define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT)
1360#define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT)
1361#define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN)
1362#define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT)
1363#define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN)
1364#define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT)
1365#define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT)
1366#define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN)
1367#define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN)
1368#define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT)
1369#define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT)
1370#define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT)
1371#define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT)
1372#define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT)
1373#define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT)
1374#define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT)
1375#define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT)
1376#define GPIO53_MMCCLK_MD (53 | GPIO_ALT_FN_1_OUT)
1377#define GPIO54_MMCCLK_MD (54 | GPIO_ALT_FN_1_OUT)
1378#define GPIO54_nPCE_2_MD (54 | GPIO_ALT_FN_2_OUT)
1379#define GPIO54_pSKTSEL_MD (54 | GPIO_ALT_FN_2_OUT)
1380#define GPIO55_nPREG_MD (55 | GPIO_ALT_FN_2_OUT)
1381#define GPIO56_nPWAIT_MD (56 | GPIO_ALT_FN_1_IN)
1382#define GPIO57_nIOIS16_MD (57 | GPIO_ALT_FN_1_IN)
1383#define GPIO58_LDD_0_MD (58 | GPIO_ALT_FN_2_OUT)
1384#define GPIO59_LDD_1_MD (59 | GPIO_ALT_FN_2_OUT)
1385#define GPIO60_LDD_2_MD (60 | GPIO_ALT_FN_2_OUT)
1386#define GPIO61_LDD_3_MD (61 | GPIO_ALT_FN_2_OUT)
1387#define GPIO62_LDD_4_MD (62 | GPIO_ALT_FN_2_OUT)
1388#define GPIO63_LDD_5_MD (63 | GPIO_ALT_FN_2_OUT)
1389#define GPIO64_LDD_6_MD (64 | GPIO_ALT_FN_2_OUT)
1390#define GPIO65_LDD_7_MD (65 | GPIO_ALT_FN_2_OUT)
1391#define GPIO66_LDD_8_MD (66 | GPIO_ALT_FN_2_OUT)
1392#define GPIO66_MBREQ_MD (66 | GPIO_ALT_FN_1_IN)
1393#define GPIO67_LDD_9_MD (67 | GPIO_ALT_FN_2_OUT)
1394#define GPIO67_MMCCS0_MD (67 | GPIO_ALT_FN_1_OUT)
1395#define GPIO68_LDD_10_MD (68 | GPIO_ALT_FN_2_OUT)
1396#define GPIO68_MMCCS1_MD (68 | GPIO_ALT_FN_1_OUT)
1397#define GPIO69_LDD_11_MD (69 | GPIO_ALT_FN_2_OUT)
1398#define GPIO69_MMCCLK_MD (69 | GPIO_ALT_FN_1_OUT)
1399#define GPIO70_LDD_12_MD (70 | GPIO_ALT_FN_2_OUT)
1400#define GPIO70_RTCCLK_MD (70 | GPIO_ALT_FN_1_OUT)
1401#define GPIO71_LDD_13_MD (71 | GPIO_ALT_FN_2_OUT)
1402#define GPIO71_3_6MHz_MD (71 | GPIO_ALT_FN_1_OUT)
1403#define GPIO72_LDD_14_MD (72 | GPIO_ALT_FN_2_OUT)
1404#define GPIO72_32kHz_MD (72 | GPIO_ALT_FN_1_OUT)
1405#define GPIO73_LDD_15_MD (73 | GPIO_ALT_FN_2_OUT)
1406#define GPIO73_MBGNT_MD (73 | GPIO_ALT_FN_1_OUT)
1407#define GPIO74_LCD_FCLK_MD (74 | GPIO_ALT_FN_2_OUT)
1408#define GPIO75_LCD_LCLK_MD (75 | GPIO_ALT_FN_2_OUT)
1409#define GPIO76_LCD_PCLK_MD (76 | GPIO_ALT_FN_2_OUT)
1410#define GPIO77_LCD_ACBIAS_MD (77 | GPIO_ALT_FN_2_OUT)
1411#define GPIO78_nCS_2_MD (78 | GPIO_ALT_FN_2_OUT)
1412#define GPIO79_nCS_3_MD (79 | GPIO_ALT_FN_2_OUT)
1413#define GPIO79_pSKTSEL_MD (79 | GPIO_ALT_FN_1_OUT)
1414#define GPIO80_nCS_4_MD (80 | GPIO_ALT_FN_2_OUT)
1415#define GPIO81_NSSP_CLK_OUT (81 | GPIO_ALT_FN_1_OUT)
1416#define GPIO81_NSSP_CLK_IN (81 | GPIO_ALT_FN_1_IN)
1417#define GPIO82_NSSP_FRM_OUT (82 | GPIO_ALT_FN_1_OUT)
1418#define GPIO82_NSSP_FRM_IN (82 | GPIO_ALT_FN_1_IN)
1419#define GPIO83_NSSP_TX (83 | GPIO_ALT_FN_1_OUT)
1420#define GPIO83_NSSP_RX (83 | GPIO_ALT_FN_2_IN)
1421#define GPIO84_NSSP_TX (84 | GPIO_ALT_FN_1_OUT)
1422#define GPIO84_NSSP_RX (84 | GPIO_ALT_FN_2_IN)
1423#define GPIO85_nPCE_1_MD (85 | GPIO_ALT_FN_1_OUT)
1424#define GPIO92_MMCDAT0_MD (92 | GPIO_ALT_FN_1_OUT)
1425#define GPIO109_MMCDAT1_MD (109 | GPIO_ALT_FN_1_OUT)
1426#define GPIO110_MMCDAT2_MD (110 | GPIO_ALT_FN_1_OUT)
1427#define GPIO110_MMCCS0_MD (110 | GPIO_ALT_FN_1_OUT)
1428#define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT)
1429#define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT)
1430#define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT)
1431#define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT)
1432#define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_OUT)
1433#define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN)
1434
1435/*
1436 * Power Manager
1437 */
1438
1439#define PMCR __REG(0x40F00000) /* Power Manager Control Register */
1440#define PSSR __REG(0x40F00004) /* Power Manager Sleep Status Register */
1441#define PSPR __REG(0x40F00008) /* Power Manager Scratch Pad Register */
1442#define PWER __REG(0x40F0000C) /* Power Manager Wake-up Enable Register */
1443#define PRER __REG(0x40F00010) /* Power Manager GPIO Rising-Edge Detect Enable Register */
1444#define PFER __REG(0x40F00014) /* Power Manager GPIO Falling-Edge Detect Enable Register */
1445#define PEDR __REG(0x40F00018) /* Power Manager GPIO Edge Detect Status Register */
1446#define PCFR __REG(0x40F0001C) /* Power Manager General Configuration Register */
1447#define PGSR0 __REG(0x40F00020) /* Power Manager GPIO Sleep State Register for GP[31-0] */
1448#define PGSR1 __REG(0x40F00024) /* Power Manager GPIO Sleep State Register for GP[63-32] */
1449#define PGSR2 __REG(0x40F00028) /* Power Manager GPIO Sleep State Register for GP[84-64] */
1450#define PGSR3 __REG(0x40F0002C) /* Power Manager GPIO Sleep State Register for GP[118-96] */
1451#define RCSR __REG(0x40F00030) /* Reset Controller Status Register */
1452
1453#define PSLR __REG(0x40F00034) /* Power Manager Sleep Config Register */
1454#define PSTR __REG(0x40F00038) /*Power Manager Standby Config Register */
1455#define PSNR __REG(0x40F0003C) /*Power Manager Sense Config Register */
1456#define PVCR __REG(0x40F00040) /*Power Manager VoltageControl Register */
1457#define PKWR __REG(0x40F00050) /* Power Manager KB Wake-up Enable Reg */
1458#define PKSR __REG(0x40F00054) /* Power Manager KB Level-Detect Register */
1459#define PCMD(x) __REG2(0x40F00080, (x)<<2)
1460#define PCMD0 __REG(0x40F00080 + 0 * 4)
1461#define PCMD1 __REG(0x40F00080 + 1 * 4)
1462#define PCMD2 __REG(0x40F00080 + 2 * 4)
1463#define PCMD3 __REG(0x40F00080 + 3 * 4)
1464#define PCMD4 __REG(0x40F00080 + 4 * 4)
1465#define PCMD5 __REG(0x40F00080 + 5 * 4)
1466#define PCMD6 __REG(0x40F00080 + 6 * 4)
1467#define PCMD7 __REG(0x40F00080 + 7 * 4)
1468#define PCMD8 __REG(0x40F00080 + 8 * 4)
1469#define PCMD9 __REG(0x40F00080 + 9 * 4)
1470#define PCMD10 __REG(0x40F00080 + 10 * 4)
1471#define PCMD11 __REG(0x40F00080 + 11 * 4)
1472#define PCMD12 __REG(0x40F00080 + 12 * 4)
1473#define PCMD13 __REG(0x40F00080 + 13 * 4)
1474#define PCMD14 __REG(0x40F00080 + 14 * 4)
1475#define PCMD15 __REG(0x40F00080 + 15 * 4)
1476#define PCMD16 __REG(0x40F00080 + 16 * 4)
1477#define PCMD17 __REG(0x40F00080 + 17 * 4)
1478#define PCMD18 __REG(0x40F00080 + 18 * 4)
1479#define PCMD19 __REG(0x40F00080 + 19 * 4)
1480#define PCMD20 __REG(0x40F00080 + 20 * 4)
1481#define PCMD21 __REG(0x40F00080 + 21 * 4)
1482#define PCMD22 __REG(0x40F00080 + 22 * 4)
1483#define PCMD23 __REG(0x40F00080 + 23 * 4)
1484#define PCMD24 __REG(0x40F00080 + 24 * 4)
1485#define PCMD25 __REG(0x40F00080 + 25 * 4)
1486#define PCMD26 __REG(0x40F00080 + 26 * 4)
1487#define PCMD27 __REG(0x40F00080 + 27 * 4)
1488#define PCMD28 __REG(0x40F00080 + 28 * 4)
1489#define PCMD29 __REG(0x40F00080 + 29 * 4)
1490#define PCMD30 __REG(0x40F00080 + 30 * 4)
1491#define PCMD31 __REG(0x40F00080 + 31 * 4)
1492
1493#define PCMD_MBC (1<<12)
1494#define PCMD_DCE (1<<11)
1495#define PCMD_LC (1<<10)
1496/* FIXME: PCMD_SQC need be checked. */
1497#define PCMD_SQC (3<<8) /* currently only bit 8 is changeable,
1498 bit 9 should be 0 all day. */
1499#define PVCR_VCSA (0x1<<14)
1500#define PVCR_CommandDelay (0xf80)
1501#define PCFR_PI2C_EN (0x1 << 6)
1502
1503#define PSSR_OTGPH (1 << 6) /* OTG Peripheral control Hold */
1504#define PSSR_RDH (1 << 5) /* Read Disable Hold */
1505#define PSSR_PH (1 << 4) /* Peripheral Control Hold */
1506#define PSSR_VFS (1 << 2) /* VDD Fault Status */
1507#define PSSR_BFS (1 << 1) /* Battery Fault Status */
1508#define PSSR_SSS (1 << 0) /* Software Sleep Status */
1509
1510#define PCFR_RO (1 << 15) /* RDH Override */
1511#define PCFR_PO (1 << 14) /* PH Override */
1512#define PCFR_GPROD (1 << 12) /* GPIO nRESET_OUT Disable */
1513#define PCFR_L1_EN (1 << 11) /* Sleep Mode L1 converter Enable */
1514#define PCFR_FVC (1 << 10) /* Frequency/Voltage Change */
1515#define PCFR_DC_EN (1 << 7) /* Sleep/deep-sleep DC-DC Converter Enable */
1516#define PCFR_PI2CEN (1 << 6) /* Enable PI2C controller */
1517#define PCFR_DS (1 << 3) /* Deep Sleep Mode */
1518#define PCFR_FS (1 << 2) /* Float Static Chip Selects */
1519#define PCFR_FP (1 << 1) /* Float PCMCIA controls */
1520#define PCFR_OPDE (1 << 0) /* 3.6864 MHz oscillator power-down enable */
1521
1522#define RCSR_GPR (1 << 3) /* GPIO Reset */
1523#define RCSR_SMR (1 << 2) /* Sleep Mode */
1524#define RCSR_WDR (1 << 1) /* Watchdog Reset */
1525#define RCSR_HWR (1 << 0) /* Hardware Reset */
1526
1527#define PWER_GPIO(Nb) (1 << Nb) /* GPIO [0..15] wake-up enable */
1528#define PWER_GPIO0 PWER_GPIO (0) /* GPIO [0] wake-up enable */
1529#define PWER_GPIO1 PWER_GPIO (1) /* GPIO [1] wake-up enable */
1530#define PWER_GPIO2 PWER_GPIO (2) /* GPIO [2] wake-up enable */
1531#define PWER_GPIO3 PWER_GPIO (3) /* GPIO [3] wake-up enable */
1532#define PWER_GPIO4 PWER_GPIO (4) /* GPIO [4] wake-up enable */
1533#define PWER_GPIO5 PWER_GPIO (5) /* GPIO [5] wake-up enable */
1534#define PWER_GPIO6 PWER_GPIO (6) /* GPIO [6] wake-up enable */
1535#define PWER_GPIO7 PWER_GPIO (7) /* GPIO [7] wake-up enable */
1536#define PWER_GPIO8 PWER_GPIO (8) /* GPIO [8] wake-up enable */
1537#define PWER_GPIO9 PWER_GPIO (9) /* GPIO [9] wake-up enable */
1538#define PWER_GPIO10 PWER_GPIO (10) /* GPIO [10] wake-up enable */
1539#define PWER_GPIO11 PWER_GPIO (11) /* GPIO [11] wake-up enable */
1540#define PWER_GPIO12 PWER_GPIO (12) /* GPIO [12] wake-up enable */
1541#define PWER_GPIO13 PWER_GPIO (13) /* GPIO [13] wake-up enable */
1542#define PWER_GPIO14 PWER_GPIO (14) /* GPIO [14] wake-up enable */
1543#define PWER_GPIO15 PWER_GPIO (15) /* GPIO [15] wake-up enable */
1544#define PWER_RTC 0x80000000 /* RTC alarm wake-up enable */
1545
1546
1547/*
1548 * SSP Serial Port Registers
1549 * PXA250, PXA255, PXA26x and PXA27x SSP controllers are all slightly different.
1550 * PXA255, PXA26x and PXA27x have extra ports, registers and bits.
1551 */
1552
1553 /* Common PXA2xx bits first */
1554#define SSCR0_DSS (0x0000000f) /* Data Size Select (mask) */
1555#define SSCR0_DataSize(x) ((x) - 1) /* Data Size Select [4..16] */
1556#define SSCR0_FRF (0x00000030) /* FRame Format (mask) */
1557#define SSCR0_Motorola (0x0 << 4) /* Motorola's Serial Peripheral Interface (SPI) */
1558#define SSCR0_TI (0x1 << 4) /* Texas Instruments' Synchronous Serial Protocol (SSP) */
1559#define SSCR0_National (0x2 << 4) /* National Microwire */
1560#define SSCR0_ECS (1 << 6) /* External clock select */
1561#define SSCR0_SSE (1 << 7) /* Synchronous Serial Port Enable */
1562#define SSCR0_SCR (0x0000ff00) /* Serial Clock Rate (mask) */
1563#define SSCR0_SerClkDiv(x) ((((x) - 2)/2) << 8) /* Divisor [2..512] */
1564
1565#define SSCR1_RIE (1 << 0) /* Receive FIFO Interrupt Enable */
1566#define SSCR1_TIE (1 << 1) /* Transmit FIFO Interrupt Enable */
1567#define SSCR1_LBM (1 << 2) /* Loop-Back Mode */
1568#define SSCR1_SPO (1 << 3) /* Motorola SPI SSPSCLK polarity setting */
1569#define SSCR1_SPH (1 << 4) /* Motorola SPI SSPSCLK phase setting */
1570#define SSCR1_MWDS (1 << 5) /* Microwire Transmit Data Size */
1571#define SSCR1_TFT (0x000003c0) /* Transmit FIFO Threshold (mask) */
1572#define SSCR1_TxTresh(x) (((x) - 1) << 6) /* level [1..16] */
1573#define SSCR1_RFT (0x00003c00) /* Receive FIFO Threshold (mask) */
1574#define SSCR1_RxTresh(x) (((x) - 1) << 10) /* level [1..16] */
1575
1576#define SSSR_TNF (1 << 2) /* Transmit FIFO Not Full */
1577#define SSSR_RNE (1 << 3) /* Receive FIFO Not Empty */
1578#define SSSR_BSY (1 << 4) /* SSP Busy */
1579#define SSSR_TFS (1 << 5) /* Transmit FIFO Service Request */
1580#define SSSR_RFS (1 << 6) /* Receive FIFO Service Request */
1581#define SSSR_ROR (1 << 7) /* Receive FIFO Overrun */
1582
1583#define SSCR0_TIM (1 << 23) /* Transmit FIFO Under Run Interrupt Mask */
1584#define SSCR0_RIM (1 << 22) /* Receive FIFO Over Run interrupt Mask */
1585#define SSCR0_NCS (1 << 21) /* Network Clock Select */
1586#define SSCR0_EDSS (1 << 20) /* Extended Data Size Select */
1587
1588/* extra bits in PXA255, PXA26x and PXA27x SSP ports */
1589#define SSCR0_PSP (3 << 4) /* PSP - Programmable Serial Protocol */
1590#define SSCR1_TTELP (1 << 31) /* TXD Tristate Enable Last Phase */
1591#define SSCR1_TTE (1 << 30) /* TXD Tristate Enable */
1592#define SSCR1_EBCEI (1 << 29) /* Enable Bit Count Error interrupt */
1593#define SSCR1_SCFR (1 << 28) /* Slave Clock free Running */
1594#define SSCR1_ECRA (1 << 27) /* Enable Clock Request A */
1595#define SSCR1_ECRB (1 << 26) /* Enable Clock request B */
1596#define SSCR1_SCLKDIR (1 << 25) /* Serial Bit Rate Clock Direction */
1597#define SSCR1_SFRMDIR (1 << 24) /* Frame Direction */
1598#define SSCR1_RWOT (1 << 23) /* Receive Without Transmit */
1599#define SSCR1_TRAIL (1 << 22) /* Trailing Byte */
1600#define SSCR1_TSRE (1 << 21) /* Transmit Service Request Enable */
1601#define SSCR1_RSRE (1 << 20) /* Receive Service Request Enable */
1602#define SSCR1_TINTE (1 << 19) /* Receiver Time-out Interrupt enable */
1603#define SSCR1_PINTE (1 << 18) /* Peripheral Trailing Byte Interupt Enable */
1604#define SSCR1_STRF (1 << 15) /* Select FIFO or EFWR */
1605#define SSCR1_EFWR (1 << 14) /* Enable FIFO Write/Read */
1606
1607#define SSSR_BCE (1 << 23) /* Bit Count Error */
1608#define SSSR_CSS (1 << 22) /* Clock Synchronisation Status */
1609#define SSSR_TUR (1 << 21) /* Transmit FIFO Under Run */
1610#define SSSR_EOC (1 << 20) /* End Of Chain */
1611#define SSSR_TINT (1 << 19) /* Receiver Time-out Interrupt */
1612#define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */
1613
1614#define SSPSP_DMYSTOP(x) (x << 23) /* Dummy Stop */
1615#define SSPSP_SFRMWDTH(x) (x << 16) /* Serial Frame Width */
1616#define SSPSP_SFRMDLY(x) (x << 9) /* Serial Frame Delay */
1617#define SSPSP_DMYSTRT(x) (x << 7) /* Dummy Start */
1618#define SSPSP_STRTDLY(x) (x << 4) /* Start Delay */
1619#define SSPSP_ETDS (1 << 3) /* End of Transfer data State */
1620#define SSPSP_SFRMP (1 << 2) /* Serial Frame Polarity */
1621#define SSPSP_SCMODE(x) (x << 0) /* Serial Bit Rate Clock Mode */
1622
1623
1624#define SSCR0_P1 __REG(0x41000000) /* SSP Port 1 Control Register 0 */
1625#define SSCR1_P1 __REG(0x41000004) /* SSP Port 1 Control Register 1 */
1626#define SSSR_P1 __REG(0x41000008) /* SSP Port 1 Status Register */
1627#define SSITR_P1 __REG(0x4100000C) /* SSP Port 1 Interrupt Test Register */
1628#define SSDR_P1 __REG(0x41000010) /* (Write / Read) SSP Port 1 Data Write Register/SSP Data Read Register */
1629
1630/* Support existing PXA25x drivers */
1631#define SSCR0 SSCR0_P1 /* SSP Control Register 0 */
1632#define SSCR1 SSCR1_P1 /* SSP Control Register 1 */
1633#define SSSR SSSR_P1 /* SSP Status Register */
1634#define SSITR SSITR_P1 /* SSP Interrupt Test Register */
1635#define SSDR SSDR_P1 /* (Write / Read) SSP Data Write Register/SSP Data Read Register */
1636
1637/* PXA27x ports */
1638#if defined (CONFIG_PXA27x)
1639#define SSTO_P1 __REG(0x41000028) /* SSP Port 1 Time Out Register */
1640#define SSPSP_P1 __REG(0x4100002C) /* SSP Port 1 Programmable Serial Protocol */
1641#define SSCR0_P2 __REG(0x41700000) /* SSP Port 2 Control Register 0 */
1642#define SSCR1_P2 __REG(0x41700004) /* SSP Port 2 Control Register 1 */
1643#define SSSR_P2 __REG(0x41700008) /* SSP Port 2 Status Register */
1644#define SSITR_P2 __REG(0x4170000C) /* SSP Port 2 Interrupt Test Register */
1645#define SSDR_P2 __REG(0x41700010) /* (Write / Read) SSP Port 2 Data Write Register/SSP Data Read Register */
1646#define SSTO_P2 __REG(0x41700028) /* SSP Port 2 Time Out Register */
1647#define SSPSP_P2 __REG(0x4170002C) /* SSP Port 2 Programmable Serial Protocol */
1648#define SSCR0_P3 __REG(0x41900000) /* SSP Port 3 Control Register 0 */
1649#define SSCR1_P3 __REG(0x41900004) /* SSP Port 3 Control Register 1 */
1650#define SSSR_P3 __REG(0x41900008) /* SSP Port 3 Status Register */
1651#define SSITR_P3 __REG(0x4190000C) /* SSP Port 3 Interrupt Test Register */
1652#define SSDR_P3 __REG(0x41900010) /* (Write / Read) SSP Port 3 Data Write Register/SSP Data Read Register */
1653#define SSTO_P3 __REG(0x41900028) /* SSP Port 3 Time Out Register */
1654#define SSPSP_P3 __REG(0x4190002C) /* SSP Port 3 Programmable Serial Protocol */
1655#else /* PXA255 (only port 2) and PXA26x ports*/
1656#define SSTO_P1 __REG(0x41000028) /* SSP Port 1 Time Out Register */
1657#define SSPSP_P1 __REG(0x4100002C) /* SSP Port 1 Programmable Serial Protocol */
1658#define SSCR0_P2 __REG(0x41400000) /* SSP Port 2 Control Register 0 */
1659#define SSCR1_P2 __REG(0x41400004) /* SSP Port 2 Control Register 1 */
1660#define SSSR_P2 __REG(0x41400008) /* SSP Port 2 Status Register */
1661#define SSITR_P2 __REG(0x4140000C) /* SSP Port 2 Interrupt Test Register */
1662#define SSDR_P2 __REG(0x41400010) /* (Write / Read) SSP Port 2 Data Write Register/SSP Data Read Register */
1663#define SSTO_P2 __REG(0x41400028) /* SSP Port 2 Time Out Register */
1664#define SSPSP_P2 __REG(0x4140002C) /* SSP Port 2 Programmable Serial Protocol */
1665#define SSCR0_P3 __REG(0x41500000) /* SSP Port 3 Control Register 0 */
1666#define SSCR1_P3 __REG(0x41500004) /* SSP Port 3 Control Register 1 */
1667#define SSSR_P3 __REG(0x41500008) /* SSP Port 3 Status Register */
1668#define SSITR_P3 __REG(0x4150000C) /* SSP Port 3 Interrupt Test Register */
1669#define SSDR_P3 __REG(0x41500010) /* (Write / Read) SSP Port 3 Data Write Register/SSP Data Read Register */
1670#define SSTO_P3 __REG(0x41500028) /* SSP Port 3 Time Out Register */
1671#define SSPSP_P3 __REG(0x4150002C) /* SSP Port 3 Programmable Serial Protocol */
1672#endif
1673
1674#define SSCR0_P(x) (*(((x) == 1) ? &SSCR0_P1 : ((x) == 2) ? &SSCR0_P2 : ((x) == 3) ? &SSCR0_P3 : NULL))
1675#define SSCR1_P(x) (*(((x) == 1) ? &SSCR1_P1 : ((x) == 2) ? &SSCR1_P2 : ((x) == 3) ? &SSCR1_P3 : NULL))
1676#define SSSR_P(x) (*(((x) == 1) ? &SSSR_P1 : ((x) == 2) ? &SSSR_P2 : ((x) == 3) ? &SSSR_P3 : NULL))
1677#define SSITR_P(x) (*(((x) == 1) ? &SSITR_P1 : ((x) == 2) ? &SSITR_P2 : ((x) == 3) ? &SSITR_P3 : NULL))
1678#define SSDR_P(x) (*(((x) == 1) ? &SSDR_P1 : ((x) == 2) ? &SSDR_P2 : ((x) == 3) ? &SSDR_P3 : NULL))
1679#define SSTO_P(x) (*(((x) == 1) ? &SSTO_P1 : ((x) == 2) ? &SSTO_P2 : ((x) == 3) ? &SSTO_P3 : NULL))
1680#define SSPSP_P(x) (*(((x) == 1) ? &SSPSP_P1 : ((x) == 2) ? &SSPSP_P2 : ((x) == 3) ? &SSPSP_P3 : NULL))
1681
1682/*
1683 * MultiMediaCard (MMC) controller
1684 */
1685
1686#define MMC_STRPCL __REG(0x41100000) /* Control to start and stop MMC clock */
1687#define MMC_STAT __REG(0x41100004) /* MMC Status Register (read only) */
1688#define MMC_CLKRT __REG(0x41100008) /* MMC clock rate */
1689#define MMC_SPI __REG(0x4110000c) /* SPI mode control bits */
1690#define MMC_CMDAT __REG(0x41100010) /* Command/response/data sequence control */
1691#define MMC_RESTO __REG(0x41100014) /* Expected response time out */
1692#define MMC_RDTO __REG(0x41100018) /* Expected data read time out */
1693#define MMC_BLKLEN __REG(0x4110001c) /* Block length of data transaction */
1694#define MMC_NOB __REG(0x41100020) /* Number of blocks, for block mode */
1695#define MMC_PRTBUF __REG(0x41100024) /* Partial MMC_TXFIFO FIFO written */
1696#define MMC_I_MASK __REG(0x41100028) /* Interrupt Mask */
1697#define MMC_I_REG __REG(0x4110002c) /* Interrupt Register (read only) */
1698#define MMC_CMD __REG(0x41100030) /* Index of current command */
1699#define MMC_ARGH __REG(0x41100034) /* MSW part of the current command argument */
1700#define MMC_ARGL __REG(0x41100038) /* LSW part of the current command argument */
1701#define MMC_RES __REG(0x4110003c) /* Response FIFO (read only) */
1702#define MMC_RXFIFO __REG(0x41100040) /* Receive FIFO (read only) */
1703#define MMC_TXFIFO __REG(0x41100044) /* Transmit FIFO (write only) */
1704
1705
1706/*
1707 * Core Clock
1708 */
1709
1710#define CCCR __REG(0x41300000) /* Core Clock Configuration Register */
1711#define CKEN __REG(0x41300004) /* Clock Enable Register */
1712#define OSCC __REG(0x41300008) /* Oscillator Configuration Register */
1713#define CCSR __REG(0x4130000C) /* Core Clock Status Register */
1714
1715#define CCCR_N_MASK 0x0380 /* Run Mode Frequency to Turbo Mode Frequency Multiplier */
1716#define CCCR_M_MASK 0x0060 /* Memory Frequency to Run Mode Frequency Multiplier */
1717#define CCCR_L_MASK 0x001f /* Crystal Frequency to Memory Frequency Multiplier */
1718
1719#define CKEN24_CAMERA (1 << 24) /* Camera Interface Clock Enable */
1720#define CKEN23_SSP1 (1 << 23) /* SSP1 Unit Clock Enable */
1721#define CKEN22_MEMC (1 << 22) /* Memory Controller Clock Enable */
1722#define CKEN21_MEMSTK (1 << 21) /* Memory Stick Host Controller */
1723#define CKEN20_IM (1 << 20) /* Internal Memory Clock Enable */
1724#define CKEN19_KEYPAD (1 << 19) /* Keypad Interface Clock Enable */
1725#define CKEN18_USIM (1 << 18) /* USIM Unit Clock Enable */
1726#define CKEN17_MSL (1 << 17) /* MSL Unit Clock Enable */
1727#define CKEN16_LCD (1 << 16) /* LCD Unit Clock Enable */
1728#define CKEN15_PWRI2C (1 << 15) /* PWR I2C Unit Clock Enable */
1729#define CKEN14_I2C (1 << 14) /* I2C Unit Clock Enable */
1730#define CKEN13_FICP (1 << 13) /* FICP Unit Clock Enable */
1731#define CKEN12_MMC (1 << 12) /* MMC Unit Clock Enable */
1732#define CKEN11_USB (1 << 11) /* USB Unit Clock Enable */
1733#define CKEN10_ASSP (1 << 10) /* ASSP (SSP3) Clock Enable */
1734#define CKEN10_USBHOST (1 << 10) /* USB Host Unit Clock Enable */
1735#define CKEN9_OSTIMER (1 << 9) /* OS Timer Unit Clock Enable */
1736#define CKEN9_NSSP (1 << 9) /* NSSP (SSP2) Clock Enable */
1737#define CKEN8_I2S (1 << 8) /* I2S Unit Clock Enable */
1738#define CKEN7_BTUART (1 << 7) /* BTUART Unit Clock Enable */
1739#define CKEN6_FFUART (1 << 6) /* FFUART Unit Clock Enable */
1740#define CKEN5_STUART (1 << 5) /* STUART Unit Clock Enable */
1741#define CKEN4_SSP3 (1 << 4) /* SSP3 Unit Clock Enable */
1742#define CKEN3_SSP (1 << 3) /* SSP Unit Clock Enable */
1743#define CKEN3_SSP2 (1 << 3) /* SSP2 Unit Clock Enable */
1744#define CKEN2_AC97 (1 << 2) /* AC97 Unit Clock Enable */
1745#define CKEN1_PWM1 (1 << 1) /* PWM1 Clock Enable */
1746#define CKEN0_PWM0 (1 << 0) /* PWM0 Clock Enable */
1747
1748#define OSCC_OON (1 << 1) /* 32.768kHz OON (write-once only bit) */
1749#define OSCC_OOK (1 << 0) /* 32.768kHz OOK (read-only bit) */
1750
1751
1752/*
1753 * LCD
1754 */
1755
1756#define LCCR0 __REG(0x44000000) /* LCD Controller Control Register 0 */
1757#define LCCR1 __REG(0x44000004) /* LCD Controller Control Register 1 */
1758#define LCCR2 __REG(0x44000008) /* LCD Controller Control Register 2 */
1759#define LCCR3 __REG(0x4400000C) /* LCD Controller Control Register 3 */
1760#define DFBR0 __REG(0x44000020) /* DMA Channel 0 Frame Branch Register */
1761#define DFBR1 __REG(0x44000024) /* DMA Channel 1 Frame Branch Register */
1762#define LCSR __REG(0x44000038) /* LCD Controller Status Register */
1763#define LIIDR __REG(0x4400003C) /* LCD Controller Interrupt ID Register */
1764#define TMEDRGBR __REG(0x44000040) /* TMED RGB Seed Register */
1765#define TMEDCR __REG(0x44000044) /* TMED Control Register */
1766
1767#define LCCR3_1BPP (0 << 24)
1768#define LCCR3_2BPP (1 << 24)
1769#define LCCR3_4BPP (2 << 24)
1770#define LCCR3_8BPP (3 << 24)
1771#define LCCR3_16BPP (4 << 24)
1772
1773#define FDADR0 __REG(0x44000200) /* DMA Channel 0 Frame Descriptor Address Register */
1774#define FSADR0 __REG(0x44000204) /* DMA Channel 0 Frame Source Address Register */
1775#define FIDR0 __REG(0x44000208) /* DMA Channel 0 Frame ID Register */
1776#define LDCMD0 __REG(0x4400020C) /* DMA Channel 0 Command Register */
1777#define FDADR1 __REG(0x44000210) /* DMA Channel 1 Frame Descriptor Address Register */
1778#define FSADR1 __REG(0x44000214) /* DMA Channel 1 Frame Source Address Register */
1779#define FIDR1 __REG(0x44000218) /* DMA Channel 1 Frame ID Register */
1780#define LDCMD1 __REG(0x4400021C) /* DMA Channel 1 Command Register */
1781
1782#define LCCR0_ENB (1 << 0) /* LCD Controller enable */
1783#define LCCR0_CMS (1 << 1) /* Color/Monochrome Display Select */
1784#define LCCR0_Color (LCCR0_CMS*0) /* Color display */
1785#define LCCR0_Mono (LCCR0_CMS*1) /* Monochrome display */
1786#define LCCR0_SDS (1 << 2) /* Single/Dual Panel Display */
1787 /* Select */
1788#define LCCR0_Sngl (LCCR0_SDS*0) /* Single panel display */
1789#define LCCR0_Dual (LCCR0_SDS*1) /* Dual panel display */
1790
1791#define LCCR0_LDM (1 << 3) /* LCD Disable Done Mask */
1792#define LCCR0_SFM (1 << 4) /* Start of frame mask */
1793#define LCCR0_IUM (1 << 5) /* Input FIFO underrun mask */
1794#define LCCR0_EFM (1 << 6) /* End of Frame mask */
1795#define LCCR0_PAS (1 << 7) /* Passive/Active display Select */
1796#define LCCR0_Pas (LCCR0_PAS*0) /* Passive display (STN) */
1797#define LCCR0_Act (LCCR0_PAS*1) /* Active display (TFT) */
1798#define LCCR0_DPD (1 << 9) /* Double Pixel Data (monochrome */
1799 /* display mode) */
1800#define LCCR0_4PixMono (LCCR0_DPD*0) /* 4-Pixel/clock Monochrome */
1801 /* display */
1802#define LCCR0_8PixMono (LCCR0_DPD*1) /* 8-Pixel/clock Monochrome */
1803 /* display */
1804#define LCCR0_DIS (1 << 10) /* LCD Disable */
1805#define LCCR0_QDM (1 << 11) /* LCD Quick Disable mask */
1806#define LCCR0_PDD (0xff << 12) /* Palette DMA request delay */
1807#define LCCR0_PDD_S 12
1808#define LCCR0_BM (1 << 20) /* Branch mask */
1809#define LCCR0_OUM (1 << 21) /* Output FIFO underrun mask */
1810
1811#define LCCR1_PPL Fld (10, 0) /* Pixels Per Line - 1 */
1812#define LCCR1_DisWdth(Pixel) /* Display Width [1..800 pix.] */ \
1813 (((Pixel) - 1) << FShft (LCCR1_PPL))
1814
1815#define LCCR1_HSW Fld (6, 10) /* Horizontal Synchronization */
1816#define LCCR1_HorSnchWdth(Tpix) /* Horizontal Synchronization */ \
1817 /* pulse Width [1..64 Tpix] */ \
1818 (((Tpix) - 1) << FShft (LCCR1_HSW))
1819
1820#define LCCR1_ELW Fld (8, 16) /* End-of-Line pixel clock Wait */
1821 /* count - 1 [Tpix] */
1822#define LCCR1_EndLnDel(Tpix) /* End-of-Line Delay */ \
1823 /* [1..256 Tpix] */ \
1824 (((Tpix) - 1) << FShft (LCCR1_ELW))
1825
1826#define LCCR1_BLW Fld (8, 24) /* Beginning-of-Line pixel clock */
1827 /* Wait count - 1 [Tpix] */
1828#define LCCR1_BegLnDel(Tpix) /* Beginning-of-Line Delay */ \
1829 /* [1..256 Tpix] */ \
1830 (((Tpix) - 1) << FShft (LCCR1_BLW))
1831
1832
1833#define LCCR2_LPP Fld (10, 0) /* Line Per Panel - 1 */
1834#define LCCR2_DisHght(Line) /* Display Height [1..1024 lines] */ \
1835 (((Line) - 1) << FShft (LCCR2_LPP))
1836
1837#define LCCR2_VSW Fld (6, 10) /* Vertical Synchronization pulse */
1838 /* Width - 1 [Tln] (L_FCLK) */
1839#define LCCR2_VrtSnchWdth(Tln) /* Vertical Synchronization pulse */ \
1840 /* Width [1..64 Tln] */ \
1841 (((Tln) - 1) << FShft (LCCR2_VSW))
1842
1843#define LCCR2_EFW Fld (8, 16) /* End-of-Frame line clock Wait */
1844 /* count [Tln] */
1845#define LCCR2_EndFrmDel(Tln) /* End-of-Frame Delay */ \
1846 /* [0..255 Tln] */ \
1847 ((Tln) << FShft (LCCR2_EFW))
1848
1849#define LCCR2_BFW Fld (8, 24) /* Beginning-of-Frame line clock */
1850 /* Wait count [Tln] */
1851#define LCCR2_BegFrmDel(Tln) /* Beginning-of-Frame Delay */ \
1852 /* [0..255 Tln] */ \
1853 ((Tln) << FShft (LCCR2_BFW))
1854
1855#if 0
1856#define LCCR3_PCD (0xff) /* Pixel clock divisor */
1857#define LCCR3_ACB (0xff << 8) /* AC Bias pin frequency */
1858#define LCCR3_ACB_S 8
1859#endif
1860
1861#define LCCR3_API (0xf << 16) /* AC Bias pin trasitions per interrupt */
1862#define LCCR3_API_S 16
1863#define LCCR3_VSP (1 << 20) /* vertical sync polarity */
1864#define LCCR3_HSP (1 << 21) /* horizontal sync polarity */
1865#define LCCR3_PCP (1 << 22) /* Pixel Clock Polarity (L_PCLK) */
1866#define LCCR3_PixRsEdg (LCCR3_PCP*0) /* Pixel clock Rising-Edge */
1867#define LCCR3_PixFlEdg (LCCR3_PCP*1) /* Pixel clock Falling-Edge */
1868
1869#define LCCR3_OEP (1 << 23) /* Output Enable Polarity (L_BIAS, */
1870 /* active display mode) */
1871#define LCCR3_OutEnH (LCCR3_OEP*0) /* Output Enable active High */
1872#define LCCR3_OutEnL (LCCR3_OEP*1) /* Output Enable active Low */
1873
1874#if 0
1875#define LCCR3_BPP (7 << 24) /* bits per pixel */
1876#define LCCR3_BPP_S 24
1877#endif
1878#define LCCR3_DPC (1 << 27) /* double pixel clock mode */
1879
1880
1881#define LCCR3_PCD Fld (8, 0) /* Pixel Clock Divisor */
1882#define LCCR3_PixClkDiv(Div) /* Pixel Clock Divisor */ \
1883 (((Div) << FShft (LCCR3_PCD)))
1884
1885
1886#define LCCR3_BPP Fld (3, 24) /* Bit Per Pixel */
1887#define LCCR3_Bpp(Bpp) /* Bit Per Pixel */ \
1888 (((Bpp) << FShft (LCCR3_BPP)))
1889
1890#define LCCR3_ACB Fld (8, 8) /* AC Bias */
1891#define LCCR3_Acb(Acb) /* BAC Bias */ \
1892 (((Acb) << FShft (LCCR3_ACB)))
1893
1894#define LCCR3_HorSnchH (LCCR3_HSP*0) /* Horizontal Synchronization */
1895 /* pulse active High */
1896#define LCCR3_HorSnchL (LCCR3_HSP*1) /* Horizontal Synchronization */
1897
1898#define LCCR3_VrtSnchH (LCCR3_VSP*0) /* Vertical Synchronization pulse */
1899 /* active High */
1900#define LCCR3_VrtSnchL (LCCR3_VSP*1) /* Vertical Synchronization pulse */
1901 /* active Low */
1902
1903#define LCSR_LDD (1 << 0) /* LCD Disable Done */
1904#define LCSR_SOF (1 << 1) /* Start of frame */
1905#define LCSR_BER (1 << 2) /* Bus error */
1906#define LCSR_ABC (1 << 3) /* AC Bias count */
1907#define LCSR_IUL (1 << 4) /* input FIFO underrun Lower panel */
1908#define LCSR_IUU (1 << 5) /* input FIFO underrun Upper panel */
1909#define LCSR_OU (1 << 6) /* output FIFO underrun */
1910#define LCSR_QD (1 << 7) /* quick disable */
1911#define LCSR_EOF (1 << 8) /* end of frame */
1912#define LCSR_BS (1 << 9) /* branch status */
1913#define LCSR_SINT (1 << 10) /* subsequent interrupt */
1914
1915#define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */
1916
1917#define LCSR_LDD (1 << 0) /* LCD Disable Done */
1918#define LCSR_SOF (1 << 1) /* Start of frame */
1919#define LCSR_BER (1 << 2) /* Bus error */
1920#define LCSR_ABC (1 << 3) /* AC Bias count */
1921#define LCSR_IUL (1 << 4) /* input FIFO underrun Lower panel */
1922#define LCSR_IUU (1 << 5) /* input FIFO underrun Upper panel */
1923#define LCSR_OU (1 << 6) /* output FIFO underrun */
1924#define LCSR_QD (1 << 7) /* quick disable */
1925#define LCSR_EOF (1 << 8) /* end of frame */
1926#define LCSR_BS (1 << 9) /* branch status */
1927#define LCSR_SINT (1 << 10) /* subsequent interrupt */
1928
1929#define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */
1930
1931/*
1932 * Memory controller
1933 */
1934
1935#define MDCNFG __REG(0x48000000) /* SDRAM Configuration Register 0 */
1936#define MDREFR __REG(0x48000004) /* SDRAM Refresh Control Register */
1937#define MSC0 __REG(0x48000008) /* Static Memory Control Register 0 */
1938#define MSC1 __REG(0x4800000C) /* Static Memory Control Register 1 */
1939#define MSC2 __REG(0x48000010) /* Static Memory Control Register 2 */
1940#define MECR __REG(0x48000014) /* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */
1941#define SXLCR __REG(0x48000018) /* LCR value to be written to SDRAM-Timing Synchronous Flash */
1942#define SXCNFG __REG(0x4800001C) /* Synchronous Static Memory Control Register */
1943#define SXMRS __REG(0x48000024) /* MRS value to be written to Synchronous Flash or SMROM */
1944#define MCMEM0 __REG(0x48000028) /* Card interface Common Memory Space Socket 0 Timing */
1945#define MCMEM1 __REG(0x4800002C) /* Card interface Common Memory Space Socket 1 Timing */
1946#define MCATT0 __REG(0x48000030) /* Card interface Attribute Space Socket 0 Timing Configuration */
1947#define MCATT1 __REG(0x48000034) /* Card interface Attribute Space Socket 1 Timing Configuration */
1948#define MCIO0 __REG(0x48000038) /* Card interface I/O Space Socket 0 Timing Configuration */
1949#define MCIO1 __REG(0x4800003C) /* Card interface I/O Space Socket 1 Timing Configuration */
1950#define MDMRS __REG(0x48000040) /* MRS value to be written to SDRAM */
1951#define BOOT_DEF __REG(0x48000044) /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */
1952
1953/*
1954 * More handy macros for PCMCIA
1955 *
1956 * Arg is socket number
1957 */
1958#define MCMEM(s) __REG2(0x48000028, (s)<<2 ) /* Card interface Common Memory Space Socket s Timing */
1959#define MCATT(s) __REG2(0x48000030, (s)<<2 ) /* Card interface Attribute Space Socket s Timing Configuration */
1960#define MCIO(s) __REG2(0x48000038, (s)<<2 ) /* Card interface I/O Space Socket s Timing Configuration */
1961
1962/* MECR register defines */
1963#define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */
1964#define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */
1965
1966#define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */
1967#define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */
1968#define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */
1969#define MDREFR_SLFRSH (1 << 22) /* SDRAM Self-Refresh Control/Status */
1970#define MDREFR_APD (1 << 20) /* SDRAM/SSRAM Auto-Power-Down Enable */
1971#define MDREFR_K2DB2 (1 << 19) /* SDCLK2 Divide by 2 Control/Status */
1972#define MDREFR_K2RUN (1 << 18) /* SDCLK2 Run Control/Status */
1973#define MDREFR_K1DB2 (1 << 17) /* SDCLK1 Divide by 2 Control/Status */
1974#define MDREFR_K1RUN (1 << 16) /* SDCLK1 Run Control/Status */
1975#define MDREFR_E1PIN (1 << 15) /* SDCKE1 Level Control/Status */
1976#define MDREFR_K0DB2 (1 << 14) /* SDCLK0 Divide by 2 Control/Status */
1977#define MDREFR_K0RUN (1 << 13) /* SDCLK0 Run Control/Status */
1978#define MDREFR_E0PIN (1 << 12) /* SDCKE0 Level Control/Status */
1979
1980
1981#ifdef CONFIG_PXA27x
1982
1983/*
1984 * Keypad
1985 */
1986#define KPC __REG(0x41500000) /* Keypad Interface Control register */
1987#define KPDK __REG(0x41500008) /* Keypad Interface Direct Key register */
1988#define KPREC __REG(0x41500010) /* Keypad Interface Rotary Encoder register */
1989#define KPMK __REG(0x41500018) /* Keypad Interface Matrix Key register */
1990#define KPAS __REG(0x41500020) /* Keypad Interface Automatic Scan register */
1991#define KPASMKP0 __REG(0x41500028) /* Keypad Interface Automatic Scan Multiple Key Presser register 0 */
1992#define KPASMKP1 __REG(0x41500030) /* Keypad Interface Automatic Scan Multiple Key Presser register 1 */
1993#define KPASMKP2 __REG(0x41500038) /* Keypad Interface Automatic Scan Multiple Key Presser register 2 */
1994#define KPASMKP3 __REG(0x41500040) /* Keypad Interface Automatic Scan Multiple Key Presser register 3 */
1995#define KPKDI __REG(0x41500048) /* Keypad Interface Key Debounce Interval register */
1996
1997#define KPC_AS (0x1 << 30) /* Automatic Scan bit */
1998#define KPC_ASACT (0x1 << 29) /* Automatic Scan on Activity */
1999#define KPC_MI (0x1 << 22) /* Matrix interrupt bit */
2000#define KPC_IMKP (0x1 << 21) /* Ignore Multiple Key Press */
2001#define KPC_MS7 (0x1 << 20) /* Matrix scan line 7 */
2002#define KPC_MS6 (0x1 << 19) /* Matrix scan line 6 */
2003#define KPC_MS5 (0x1 << 18) /* Matrix scan line 5 */
2004#define KPC_MS4 (0x1 << 17) /* Matrix scan line 4 */
2005#define KPC_MS3 (0x1 << 16) /* Matrix scan line 3 */
2006#define KPC_MS2 (0x1 << 15) /* Matrix scan line 2 */
2007#define KPC_MS1 (0x1 << 14) /* Matrix scan line 1 */
2008#define KPC_MS0 (0x1 << 13) /* Matrix scan line 0 */
2009#define KPC_MS_ALL (KPC_MS0 | KPC_MS1 | KPC_MS2 | KPC_MS3 | KPC_MS4 | KPC_MS5 | KPC_MS6 | KPC_MS7)
2010#define KPC_ME (0x1 << 12) /* Matrix Keypad Enable */
2011#define KPC_MIE (0x1 << 11) /* Matrix Interrupt Enable */
2012#define KPC_DK_DEB_SEL (0x1 << 9) /* Direct Keypad Debounce Select */
2013#define KPC_DI (0x1 << 5) /* Direct key interrupt bit */
2014#define KPC_RE_ZERO_DEB (0x1 << 4) /* Rotary Encoder Zero Debounce */
2015#define KPC_REE1 (0x1 << 3) /* Rotary Encoder1 Enable */
2016#define KPC_REE0 (0x1 << 2) /* Rotary Encoder0 Enable */
2017#define KPC_DE (0x1 << 1) /* Direct Keypad Enable */
2018#define KPC_DIE (0x1 << 0) /* Direct Keypad interrupt Enable */
2019
2020#define KPDK_DKP (0x1 << 31)
2021#define KPDK_DK7 (0x1 << 7)
2022#define KPDK_DK6 (0x1 << 6)
2023#define KPDK_DK5 (0x1 << 5)
2024#define KPDK_DK4 (0x1 << 4)
2025#define KPDK_DK3 (0x1 << 3)
2026#define KPDK_DK2 (0x1 << 2)
2027#define KPDK_DK1 (0x1 << 1)
2028#define KPDK_DK0 (0x1 << 0)
2029
2030#define KPREC_OF1 (0x1 << 31)
2031#define kPREC_UF1 (0x1 << 30)
2032#define KPREC_OF0 (0x1 << 15)
2033#define KPREC_UF0 (0x1 << 14)
2034
2035#define KPMK_MKP (0x1 << 31)
2036#define KPAS_SO (0x1 << 31)
2037#define KPASMKPx_SO (0x1 << 31)
2038
2039/*
2040 * UHC: USB Host Controller (OHCI-like) register definitions
2041 */
2042#define UHC_BASE_PHYS (0x4C000000)
2043#define UHCREV __REG(0x4C000000) /* UHC HCI Spec Revision */
2044#define UHCHCON __REG(0x4C000004) /* UHC Host Control Register */
2045#define UHCCOMS __REG(0x4C000008) /* UHC Command Status Register */
2046#define UHCINTS __REG(0x4C00000C) /* UHC Interrupt Status Register */
2047#define UHCINTE __REG(0x4C000010) /* UHC Interrupt Enable */
2048#define UHCINTD __REG(0x4C000014) /* UHC Interrupt Disable */
2049#define UHCHCCA __REG(0x4C000018) /* UHC Host Controller Comm. Area */
2050#define UHCPCED __REG(0x4C00001C) /* UHC Period Current Endpt Descr */
2051#define UHCCHED __REG(0x4C000020) /* UHC Control Head Endpt Descr */
2052#define UHCCCED __REG(0x4C000024) /* UHC Control Current Endpt Descr */
2053#define UHCBHED __REG(0x4C000028) /* UHC Bulk Head Endpt Descr */
2054#define UHCBCED __REG(0x4C00002C) /* UHC Bulk Current Endpt Descr */
2055#define UHCDHEAD __REG(0x4C000030) /* UHC Done Head */
2056#define UHCFMI __REG(0x4C000034) /* UHC Frame Interval */
2057#define UHCFMR __REG(0x4C000038) /* UHC Frame Remaining */
2058#define UHCFMN __REG(0x4C00003C) /* UHC Frame Number */
2059#define UHCPERS __REG(0x4C000040) /* UHC Periodic Start */
2060#define UHCLS __REG(0x4C000044) /* UHC Low Speed Threshold */
2061#define UHCRHDA __REG(0x4C000048) /* UHC Root Hub Descriptor A */
2062#define UHCRHDB __REG(0x4C00004C) /* UHC Root Hub Descriptor B */
2063#define UHCRHS __REG(0x4C000050) /* UHC Root Hub Status */
2064#define UHCRHPS1 __REG(0x4C000054) /* UHC Root Hub Port 1 Status */
2065#define UHCRHPS2 __REG(0x4C000058) /* UHC Root Hub Port 2 Status */
2066#define UHCRHPS3 __REG(0x4C00005C) /* UHC Root Hub Port 3 Status */
2067
2068#define UHCSTAT __REG(0x4C000060) /* UHC Status Register */
2069#define UHCSTAT_UPS3 (1 << 16) /* USB Power Sense Port3 */
2070#define UHCSTAT_SBMAI (1 << 15) /* System Bus Master Abort Interrupt*/
2071#define UHCSTAT_SBTAI (1 << 14) /* System Bus Target Abort Interrupt*/
2072#define UHCSTAT_UPRI (1 << 13) /* USB Port Resume Interrupt */
2073#define UHCSTAT_UPS2 (1 << 12) /* USB Power Sense Port 2 */
2074#define UHCSTAT_UPS1 (1 << 11) /* USB Power Sense Port 1 */
2075#define UHCSTAT_HTA (1 << 10) /* HCI Target Abort */
2076#define UHCSTAT_HBA (1 << 8) /* HCI Buffer Active */
2077#define UHCSTAT_RWUE (1 << 7) /* HCI Remote Wake Up Event */
2078
2079#define UHCHR __REG(0x4C000064) /* UHC Reset Register */
2080#define UHCHR_SSEP3 (1 << 11) /* Sleep Standby Enable for Port3 */
2081#define UHCHR_SSEP2 (1 << 10) /* Sleep Standby Enable for Port2 */
2082#define UHCHR_SSEP1 (1 << 9) /* Sleep Standby Enable for Port1 */
2083#define UHCHR_PCPL (1 << 7) /* Power control polarity low */
2084#define UHCHR_PSPL (1 << 6) /* Power sense polarity low */
2085#define UHCHR_SSE (1 << 5) /* Sleep Standby Enable */
2086#define UHCHR_UIT (1 << 4) /* USB Interrupt Test */
2087#define UHCHR_SSDC (1 << 3) /* Simulation Scale Down Clock */
2088#define UHCHR_CGR (1 << 2) /* Clock Generation Reset */
2089#define UHCHR_FHR (1 << 1) /* Force Host Controller Reset */
2090#define UHCHR_FSBIR (1 << 0) /* Force System Bus Iface Reset */
2091
2092#define UHCHIE __REG(0x4C000068) /* UHC Interrupt Enable Register*/
2093#define UHCHIE_UPS3IE (1 << 14) /* Power Sense Port3 IntEn */
2094#define UHCHIE_UPRIE (1 << 13) /* Port Resume IntEn */
2095#define UHCHIE_UPS2IE (1 << 12) /* Power Sense Port2 IntEn */
2096#define UHCHIE_UPS1IE (1 << 11) /* Power Sense Port1 IntEn */
2097#define UHCHIE_TAIE (1 << 10) /* HCI Interface Transfer Abort
2098 Interrupt Enable*/
2099#define UHCHIE_HBAIE (1 << 8) /* HCI Buffer Active IntEn */
2100#define UHCHIE_RWIE (1 << 7) /* Remote Wake-up IntEn */
2101
2102#define UHCHIT __REG(0x4C00006C) /* UHC Interrupt Test register */
2103
2104/* Camera Interface */
2105#define CICR0 __REG(0x50000000)
2106#define CICR1 __REG(0x50000004)
2107#define CICR2 __REG(0x50000008)
2108#define CICR3 __REG(0x5000000C)
2109#define CICR4 __REG(0x50000010)
2110#define CISR __REG(0x50000014)
2111#define CIFR __REG(0x50000018)
2112#define CITOR __REG(0x5000001C)
2113#define CIBR0 __REG(0x50000028)
2114#define CIBR1 __REG(0x50000030)
2115#define CIBR2 __REG(0x50000038)
2116
2117#define CICR0_DMAEN (1 << 31) /* DMA request enable */
2118#define CICR0_PAR_EN (1 << 30) /* Parity enable */
2119#define CICR0_SL_CAP_EN (1 << 29) /* Capture enable for slave mode */
2120#define CICR0_ENB (1 << 28) /* Camera interface enable */
2121#define CICR0_DIS (1 << 27) /* Camera interface disable */
2122#define CICR0_SIM (0x7 << 24) /* Sensor interface mode mask */
2123#define CICR0_TOM (1 << 9) /* Time-out mask */
2124#define CICR0_RDAVM (1 << 8) /* Receive-data-available mask */
2125#define CICR0_FEM (1 << 7) /* FIFO-empty mask */
2126#define CICR0_EOLM (1 << 6) /* End-of-line mask */
2127#define CICR0_PERRM (1 << 5) /* Parity-error mask */
2128#define CICR0_QDM (1 << 4) /* Quick-disable mask */
2129#define CICR0_CDM (1 << 3) /* Disable-done mask */
2130#define CICR0_SOFM (1 << 2) /* Start-of-frame mask */
2131#define CICR0_EOFM (1 << 1) /* End-of-frame mask */
2132#define CICR0_FOM (1 << 0) /* FIFO-overrun mask */
2133
2134#define CICR1_TBIT (1 << 31) /* Transparency bit */
2135#define CICR1_RGBT_CONV (0x3 << 30) /* RGBT conversion mask */
2136#define CICR1_PPL (0x3f << 15) /* Pixels per line mask */
2137#define CICR1_RGB_CONV (0x7 << 12) /* RGB conversion mask */
2138#define CICR1_RGB_F (1 << 11) /* RGB format */
2139#define CICR1_YCBCR_F (1 << 10) /* YCbCr format */
2140#define CICR1_RGB_BPP (0x7 << 7) /* RGB bis per pixel mask */
2141#define CICR1_RAW_BPP (0x3 << 5) /* Raw bis per pixel mask */
2142#define CICR1_COLOR_SP (0x3 << 3) /* Color space mask */
2143#define CICR1_DW (0x7 << 0) /* Data width mask */
2144
2145#define CICR2_BLW (0xff << 24) /* Beginning-of-line pixel clock
2146 wait count mask */
2147#define CICR2_ELW (0xff << 16) /* End-of-line pixel clock
2148 wait count mask */
2149#define CICR2_HSW (0x3f << 10) /* Horizontal sync pulse width mask */
2150#define CICR2_BFPW (0x3f << 3) /* Beginning-of-frame pixel clock
2151 wait count mask */
2152#define CICR2_FSW (0x7 << 0) /* Frame stabilization
2153 wait count mask */
2154
2155#define CICR3_BFW (0xff << 24) /* Beginning-of-frame line clock
2156 wait count mask */
2157#define CICR3_EFW (0xff << 16) /* End-of-frame line clock
2158 wait count mask */
2159#define CICR3_VSW (0x3f << 10) /* Vertical sync pulse width mask */
2160#define CICR3_BFPW (0x3f << 3) /* Beginning-of-frame pixel clock
2161 wait count mask */
2162#define CICR3_LPF (0x3ff << 0) /* Lines per frame mask */
2163
2164#define CICR4_MCLK_DLY (0x3 << 24) /* MCLK Data Capture Delay mask */
2165#define CICR4_PCLK_EN (1 << 23) /* Pixel clock enable */
2166#define CICR4_PCP (1 << 22) /* Pixel clock polarity */
2167#define CICR4_HSP (1 << 21) /* Horizontal sync polarity */
2168#define CICR4_VSP (1 << 20) /* Vertical sync polarity */
2169#define CICR4_MCLK_EN (1 << 19) /* MCLK enable */
2170#define CICR4_FR_RATE (0x7 << 8) /* Frame rate mask */
2171#define CICR4_DIV (0xff << 0) /* Clock divisor mask */
2172
2173#define CISR_FTO (1 << 15) /* FIFO time-out */
2174#define CISR_RDAV_2 (1 << 14) /* Channel 2 receive data available */
2175#define CISR_RDAV_1 (1 << 13) /* Channel 1 receive data available */
2176#define CISR_RDAV_0 (1 << 12) /* Channel 0 receive data available */
2177#define CISR_FEMPTY_2 (1 << 11) /* Channel 2 FIFO empty */
2178#define CISR_FEMPTY_1 (1 << 10) /* Channel 1 FIFO empty */
2179#define CISR_FEMPTY_0 (1 << 9) /* Channel 0 FIFO empty */
2180#define CISR_EOL (1 << 8) /* End of line */
2181#define CISR_PAR_ERR (1 << 7) /* Parity error */
2182#define CISR_CQD (1 << 6) /* Camera interface quick disable */
2183#define CISR_SOF (1 << 5) /* Start of frame */
2184#define CISR_CDD (1 << 4) /* Camera interface disable done */
2185#define CISR_EOF (1 << 3) /* End of frame */
2186#define CISR_IFO_2 (1 << 2) /* FIFO overrun for Channel 2 */
2187#define CISR_IFO_1 (1 << 1) /* FIFO overrun for Channel 1 */
2188#define CISR_IFO_0 (1 << 0) /* FIFO overrun for Channel 0 */
2189
2190#define CIFR_FLVL2 (0x7f << 23) /* FIFO 2 level mask */
2191#define CIFR_FLVL1 (0x7f << 16) /* FIFO 1 level mask */
2192#define CIFR_FLVL0 (0xff << 8) /* FIFO 0 level mask */
2193#define CIFR_THL_0 (0x3 << 4) /* Threshold Level for Channel 0 FIFO */
2194#define CIFR_RESET_F (1 << 3) /* Reset input FIFOs */
2195#define CIFR_FEN2 (1 << 2) /* FIFO enable for channel 2 */
2196#define CIFR_FEN1 (1 << 1) /* FIFO enable for channel 1 */
2197#define CIFR_FEN0 (1 << 0) /* FIFO enable for channel 0 */
2198
2199#define SRAM_SIZE 0x40000 /* 4x64K */
2200
2201#define SRAM_MEM_PHYS 0x5C000000
2202
2203#define IMPMCR __REG(0x58000000) /* IM Power Management Control Reg */
2204#define IMPMSR __REG(0x58000008) /* IM Power Management Status Reg */
2205
2206#define IMPMCR_PC3 (0x3 << 22) /* Bank 3 Power Control */
2207#define IMPMCR_PC3_RUN_MODE (0x0 << 22) /* Run mode */
2208#define IMPMCR_PC3_STANDBY_MODE (0x1 << 22) /* Standby mode */
2209#define IMPMCR_PC3_AUTO_MODE (0x3 << 22) /* Automatically controlled */
2210
2211#define IMPMCR_PC2 (0x3 << 20) /* Bank 2 Power Control */
2212#define IMPMCR_PC2_RUN_MODE (0x0 << 20) /* Run mode */
2213#define IMPMCR_PC2_STANDBY_MODE (0x1 << 20) /* Standby mode */
2214#define IMPMCR_PC2_AUTO_MODE (0x3 << 20) /* Automatically controlled */
2215
2216#define IMPMCR_PC1 (0x3 << 18) /* Bank 1 Power Control */
2217#define IMPMCR_PC1_RUN_MODE (0x0 << 18) /* Run mode */
2218#define IMPMCR_PC1_STANDBY_MODE (0x1 << 18) /* Standby mode */
2219#define IMPMCR_PC1_AUTO_MODE (0x3 << 18) /* Automatically controlled */
2220
2221#define IMPMCR_PC0 (0x3 << 16) /* Bank 0 Power Control */
2222#define IMPMCR_PC0_RUN_MODE (0x0 << 16) /* Run mode */
2223#define IMPMCR_PC0_STANDBY_MODE (0x1 << 16) /* Standby mode */
2224#define IMPMCR_PC0_AUTO_MODE (0x3 << 16) /* Automatically controlled */
2225
2226#define IMPMCR_AW3 (1 << 11) /* Bank 3 Automatic Wake-up enable */
2227#define IMPMCR_AW2 (1 << 10) /* Bank 2 Automatic Wake-up enable */
2228#define IMPMCR_AW1 (1 << 9) /* Bank 1 Automatic Wake-up enable */
2229#define IMPMCR_AW0 (1 << 8) /* Bank 0 Automatic Wake-up enable */
2230
2231#define IMPMCR_DST (0xFF << 0) /* Delay Standby Time, ms */
2232
2233#define IMPMSR_PS3 (0x3 << 6) /* Bank 3 Power Status: */
2234#define IMPMSR_PS3_RUN_MODE (0x0 << 6) /* Run mode */
2235#define IMPMSR_PS3_STANDBY_MODE (0x1 << 6) /* Standby mode */
2236
2237#define IMPMSR_PS2 (0x3 << 4) /* Bank 2 Power Status: */
2238#define IMPMSR_PS2_RUN_MODE (0x0 << 4) /* Run mode */
2239#define IMPMSR_PS2_STANDBY_MODE (0x1 << 4) /* Standby mode */
2240
2241#define IMPMSR_PS1 (0x3 << 2) /* Bank 1 Power Status: */
2242#define IMPMSR_PS1_RUN_MODE (0x0 << 2) /* Run mode */
2243#define IMPMSR_PS1_STANDBY_MODE (0x1 << 2) /* Standby mode */
2244
2245#define IMPMSR_PS0 (0x3 << 0) /* Bank 0 Power Status: */
2246#define IMPMSR_PS0_RUN_MODE (0x0 << 0) /* Run mode */
2247#define IMPMSR_PS0_STANDBY_MODE (0x1 << 0) /* Standby mode */
2248
2249#endif
2250
2251#endif
diff --git a/include/asm-arm/arch-pxa/pxafb.h b/include/asm-arm/arch-pxa/pxafb.h
new file mode 100644
index 000000000000..27d71e9d413b
--- /dev/null
+++ b/include/asm-arm/arch-pxa/pxafb.h
@@ -0,0 +1,68 @@
1/*
2 * linux/include/asm-arm/arch-pxa/pxafb.h
3 *
4 * Support for the xscale frame buffer.
5 *
6 * Author: Jean-Frederic Clere
7 * Created: Sep 22, 2003
8 * Copyright: jfclere@sinix.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 * This structure describes the machine which we are running on.
17 * It is set in linux/arch/arm/mach-pxa/machine_name.c and used in the probe routine
18 * of linux/drivers/video/pxafb.c
19 */
20struct pxafb_mach_info {
21 u_long pixclock;
22
23 u_short xres;
24 u_short yres;
25
26 u_char bpp;
27 u_char hsync_len;
28 u_char left_margin;
29 u_char right_margin;
30
31 u_char vsync_len;
32 u_char upper_margin;
33 u_char lower_margin;
34 u_char sync;
35
36 u_int cmap_greyscale:1,
37 cmap_inverse:1,
38 cmap_static:1,
39 unused:29;
40
41 /* The following should be defined in LCCR0
42 * LCCR0_Act or LCCR0_Pas Active or Passive
43 * LCCR0_Sngl or LCCR0_Dual Single/Dual panel
44 * LCCR0_Mono or LCCR0_Color Mono/Color
45 * LCCR0_4PixMono or LCCR0_8PixMono (in mono single mode)
46 * LCCR0_DMADel(Tcpu) (optional) DMA request delay
47 *
48 * The following should not be defined in LCCR0:
49 * LCCR0_OUM, LCCR0_BM, LCCR0_QDM, LCCR0_DIS, LCCR0_EFM
50 * LCCR0_IUM, LCCR0_SFM, LCCR0_LDM, LCCR0_ENB
51 */
52 u_int lccr0;
53 /* The following should be defined in LCCR3
54 * LCCR3_OutEnH or LCCR3_OutEnL Output enable polarity
55 * LCCR3_PixRsEdg or LCCR3_PixFlEdg Pixel clock edge type
56 * LCCR3_Acb(X) AB Bias pin frequency
57 * LCCR3_DPC (optional) Double Pixel Clock mode (untested)
58 *
59 * The following should not be defined in LCCR3
60 * LCCR3_HSP, LCCR3_VSP, LCCR0_Pcd(x), LCCR3_Bpp
61 */
62 u_int lccr3;
63
64 void (*pxafb_backlight_power)(int);
65 void (*pxafb_lcd_power)(int);
66
67};
68void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info);
diff --git a/include/asm-arm/arch-pxa/ssp.h b/include/asm-arm/arch-pxa/ssp.h
new file mode 100644
index 000000000000..6ec67b018c09
--- /dev/null
+++ b/include/asm-arm/arch-pxa/ssp.h
@@ -0,0 +1,47 @@
1/*
2 * ssp.h
3 *
4 * Copyright (C) 2003 Russell King, 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 driver supports the following PXA CPU/SSP ports:-
11 *
12 * PXA250 SSP
13 * PXA255 SSP, NSSP
14 * PXA26x SSP, NSSP, ASSP
15 * PXA27x SSP1, SSP2, SSP3
16 */
17
18#ifndef SSP_H
19#define SSP_H
20
21struct ssp_state {
22 u32 cr0;
23 u32 cr1;
24 u32 to;
25 u32 psp;
26};
27
28struct ssp_dev {
29 u32 port;
30 u32 mode;
31 u32 flags;
32 u32 psp_flags;
33 u32 speed;
34};
35
36int ssp_write_word(struct ssp_dev *dev, u32 data);
37int ssp_read_word(struct ssp_dev *dev);
38void ssp_flush(struct ssp_dev *dev);
39void ssp_enable(struct ssp_dev *dev);
40void ssp_disable(struct ssp_dev *dev);
41void ssp_save_state(struct ssp_dev *dev, struct ssp_state *ssp);
42void ssp_restore_state(struct ssp_dev *dev, struct ssp_state *ssp);
43int ssp_init(struct ssp_dev *dev, u32 port);
44int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed);
45void ssp_exit(struct ssp_dev *dev);
46
47#endif
diff --git a/include/asm-arm/arch-pxa/system.h b/include/asm-arm/arch-pxa/system.h
new file mode 100644
index 000000000000..840a46bfbc54
--- /dev/null
+++ b/include/asm-arm/arch-pxa/system.h
@@ -0,0 +1,34 @@
1/*
2 * linux/include/asm-arm/arch-pxa/system.h
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 "hardware.h"
14#include "pxa-regs.h"
15
16static inline void arch_idle(void)
17{
18 cpu_do_idle();
19}
20
21
22static inline void arch_reset(char mode)
23{
24 if (mode == 's') {
25 /* Jump into ROM at address 0 */
26 cpu_reset(0);
27 } else {
28 /* Initialize the watchdog and let it fire */
29 OWER = OWER_WME;
30 OSSR = OSSR_M3;
31 OSMR3 = OSCR + 368640; /* ... in 100 ms */
32 }
33}
34
diff --git a/include/asm-arm/arch-pxa/timex.h b/include/asm-arm/arch-pxa/timex.h
new file mode 100644
index 000000000000..aa125ec56a32
--- /dev/null
+++ b/include/asm-arm/arch-pxa/timex.h
@@ -0,0 +1,25 @@
1/*
2 * linux/include/asm-arm/arch-pxa/timex.h
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
15#if defined(CONFIG_PXA25x)
16/* PXA250/210 timer base */
17#define CLOCK_TICK_RATE 3686400
18#elif defined(CONFIG_PXA27x)
19/* PXA27x timer base */
20#ifdef CONFIG_MACH_MAINSTONE
21#define CLOCK_TICK_RATE 3249600
22#else
23#define CLOCK_TICK_RATE 3250000
24#endif
25#endif
diff --git a/include/asm-arm/arch-pxa/udc.h b/include/asm-arm/arch-pxa/udc.h
new file mode 100644
index 000000000000..30548a30c773
--- /dev/null
+++ b/include/asm-arm/arch-pxa/udc.h
@@ -0,0 +1,18 @@
1/*
2 * linux/include/asm-arm/arch-pxa/udc.h
3 *
4 * This supports machine-specific differences in how the PXA2xx
5 * USB Device Controller (UDC) is wired.
6 *
7 * It is set in linux/arch/arm/mach-pxa/<machine>.c and used in
8 * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c
9 */
10struct pxa2xx_udc_mach_info {
11 int (*udc_is_connected)(void); /* do we see host? */
12 void (*udc_command)(int cmd);
13#define PXA2XX_UDC_CMD_CONNECT 0 /* let host see us */
14#define PXA2XX_UDC_CMD_DISCONNECT 1 /* so host won't see us */
15};
16
17extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info);
18
diff --git a/include/asm-arm/arch-pxa/uncompress.h b/include/asm-arm/arch-pxa/uncompress.h
new file mode 100644
index 000000000000..4428d3eb7432
--- /dev/null
+++ b/include/asm-arm/arch-pxa/uncompress.h
@@ -0,0 +1,42 @@
1/*
2 * linux/include/asm-arm/arch-pxa/uncompress.h
3 *
4 * Author: Nicolas Pitre
5 * Copyright: (C) 2001 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
12#define FFUART ((volatile unsigned long *)0x40100000)
13#define BTUART ((volatile unsigned long *)0x40200000)
14#define STUART ((volatile unsigned long *)0x40700000)
15
16#define UART FFUART
17
18
19static __inline__ void putc(char c)
20{
21 while (!(UART[5] & 0x20));
22 UART[0] = c;
23}
24
25/*
26 * This does not append a newline
27 */
28static void putstr(const char *s)
29{
30 while (*s) {
31 putc(*s);
32 if (*s == '\n')
33 putc('\r');
34 s++;
35 }
36}
37
38/*
39 * nothing to do
40 */
41#define arch_decomp_setup()
42#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-pxa/vmalloc.h b/include/asm-arm/arch-pxa/vmalloc.h
new file mode 100644
index 000000000000..3381af6ddb0d
--- /dev/null
+++ b/include/asm-arm/arch-pxa/vmalloc.h
@@ -0,0 +1,22 @@
1/*
2 * linux/include/asm-arm/arch-pxa/vmalloc.h
3 *
4 * Author: Nicolas Pitre
5 * Copyright: (C) 2001 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
12/*
13 * Just any arbitrary offset to the start of the vmalloc VM area: the
14 * current 8MB value just means that there will be a 8MB "hole" after the
15 * physical memory until the kernel virtual memory starts. That means that
16 * any out-of-bounds memory accesses will hopefully be caught.
17 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
18 * area for the same reason. ;)
19 */
20#define VMALLOC_OFFSET (8*1024*1024)
21#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
22#define VMALLOC_END (0xe8000000)
diff --git a/include/asm-arm/arch-rpc/acornfb.h b/include/asm-arm/arch-rpc/acornfb.h
new file mode 100644
index 000000000000..ecb7733a0949
--- /dev/null
+++ b/include/asm-arm/arch-rpc/acornfb.h
@@ -0,0 +1,140 @@
1/*
2 * linux/include/asm-arm/arch-rpc/acornfb.h
3 *
4 * Copyright (C) 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 * AcornFB architecture specific code
11 */
12
13#define acornfb_bandwidth(var) ((var)->pixclock * 8 / (var)->bits_per_pixel)
14
15static inline int
16acornfb_valid_pixrate(struct fb_var_screeninfo *var)
17{
18 u_long limit;
19
20 if (!var->pixclock)
21 return 0;
22
23 /*
24 * Limits below are taken from RISC OS bandwidthlimit file
25 */
26 if (current_par.using_vram) {
27 if (current_par.vram_half_sam == 2048)
28 limit = 6578;
29 else
30 limit = 13157;
31 } else {
32 limit = 26315;
33 }
34
35 return acornfb_bandwidth(var) >= limit;
36}
37
38/*
39 * Try to find the best PLL parameters for the pixel clock.
40 * This algorithm seems to give best predictable results,
41 * and produces the same values as detailed in the VIDC20
42 * data sheet.
43 */
44static inline u_int
45acornfb_vidc20_find_pll(u_int pixclk)
46{
47 u_int r, best_r = 2, best_v = 2;
48 int best_d = 0x7fffffff;
49
50 for (r = 2; r <= 32; r++) {
51 u_int rr, v, p;
52 int d;
53
54 rr = 41667 * r;
55
56 v = (rr + pixclk / 2) / pixclk;
57
58 if (v > 32 || v < 2)
59 continue;
60
61 p = (rr + v / 2) / v;
62
63 d = pixclk - p;
64
65 if (d < 0)
66 d = -d;
67
68 if (d < best_d) {
69 best_d = d;
70 best_v = v - 1;
71 best_r = r - 1;
72 }
73
74 if (d == 0)
75 break;
76 }
77
78 return best_v << 8 | best_r;
79}
80
81static inline void
82acornfb_vidc20_find_rates(struct vidc_timing *vidc,
83 struct fb_var_screeninfo *var)
84{
85 u_int div;
86
87 /* Select pixel-clock divisor to keep PLL in range */
88 div = var->pixclock / 9090; /*9921*/
89
90 /* Limit divisor */
91 if (div == 0)
92 div = 1;
93 if (div > 8)
94 div = 8;
95
96 /* Encode divisor to VIDC20 setting */
97 switch (div) {
98 case 1: vidc->control |= VIDC20_CTRL_PIX_CK; break;
99 case 2: vidc->control |= VIDC20_CTRL_PIX_CK2; break;
100 case 3: vidc->control |= VIDC20_CTRL_PIX_CK3; break;
101 case 4: vidc->control |= VIDC20_CTRL_PIX_CK4; break;
102 case 5: vidc->control |= VIDC20_CTRL_PIX_CK5; break;
103 case 6: vidc->control |= VIDC20_CTRL_PIX_CK6; break;
104 case 7: vidc->control |= VIDC20_CTRL_PIX_CK7; break;
105 case 8: vidc->control |= VIDC20_CTRL_PIX_CK8; break;
106 }
107
108 /*
109 * With VRAM, the FIFO can be set to the highest possible setting
110 * because there are no latency considerations for other memory
111 * accesses. However, in 64 bit bus mode the FIFO preload value
112 * must not be set to VIDC20_CTRL_FIFO_28 because this will let
113 * the FIFO overflow. See VIDC20 manual page 33 (6.0 Setting the
114 * FIFO preload value).
115 */
116 if (current_par.using_vram) {
117 if (current_par.vram_half_sam == 2048)
118 vidc->control |= VIDC20_CTRL_FIFO_24;
119 else
120 vidc->control |= VIDC20_CTRL_FIFO_28;
121 } else {
122 unsigned long bandwidth = acornfb_bandwidth(var);
123
124 /* Encode bandwidth as VIDC20 setting */
125 if (bandwidth > 33334) /* < 30.0MB/s */
126 vidc->control |= VIDC20_CTRL_FIFO_16;
127 else if (bandwidth > 26666) /* < 37.5MB/s */
128 vidc->control |= VIDC20_CTRL_FIFO_20;
129 else if (bandwidth > 22222) /* < 45.0MB/s */
130 vidc->control |= VIDC20_CTRL_FIFO_24;
131 else /* > 45.0MB/s */
132 vidc->control |= VIDC20_CTRL_FIFO_28;
133 }
134
135 /* Find the PLL values */
136 vidc->pll_ctl = acornfb_vidc20_find_pll(var->pixclock / div);
137}
138
139#define acornfb_default_control() (VIDC20_CTRL_PIX_VCLK)
140#define acornfb_default_econtrol() (VIDC20_ECTL_DAC | VIDC20_ECTL_REG(3))
diff --git a/include/asm-arm/arch-rpc/debug-macro.S b/include/asm-arm/arch-rpc/debug-macro.S
new file mode 100644
index 000000000000..0711828164cd
--- /dev/null
+++ b/include/asm-arm/arch-rpc/debug-macro.S
@@ -0,0 +1,35 @@
1/* linux/include/asm-arm/arch-rpc/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .macro addruart,rx
15 mov \rx, #0xe0000000
16 orr \rx, \rx, #0x00010000
17 orr \rx, \rx, #0x00000fe0
18 .endm
19
20 .macro senduart,rd,rx
21 strb \rd, [\rx]
22 .endm
23
24 .macro busyuart,rd,rx
251001: ldrb \rd, [\rx, #0x14]
26 and \rd, \rd, #0x60
27 teq \rd, #0x60
28 bne 1001b
29 .endm
30
31 .macro waituart,rd,rx
321001: ldrb \rd, [\rx, #0x18]
33 tst \rd, #0x10
34 beq 1001b
35 .endm
diff --git a/include/asm-arm/arch-rpc/dma.h b/include/asm-arm/arch-rpc/dma.h
new file mode 100644
index 000000000000..d24a27e30b93
--- /dev/null
+++ b/include/asm-arm/arch-rpc/dma.h
@@ -0,0 +1,33 @@
1/*
2 * linux/include/asm-arm/arch-rpc/dma.h
3 *
4 * Copyright (C) 1997 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#ifndef __ASM_ARCH_DMA_H
11#define __ASM_ARCH_DMA_H
12
13/*
14 * This is the maximum DMA address that can be DMAd to.
15 * There should not be more than (0xd0000000 - 0xc0000000)
16 * bytes of RAM.
17 */
18#define MAX_DMA_ADDRESS 0xd0000000
19#define MAX_DMA_CHANNELS 8
20
21#define DMA_0 0
22#define DMA_1 1
23#define DMA_2 2
24#define DMA_3 3
25#define DMA_S0 4
26#define DMA_S1 5
27#define DMA_VIRTUAL_FLOPPY 6
28#define DMA_VIRTUAL_SOUND 7
29
30#define DMA_FLOPPY DMA_VIRTUAL_FLOPPY
31
32#endif /* _ASM_ARCH_DMA_H */
33
diff --git a/include/asm-arm/arch-rpc/entry-macro.S b/include/asm-arm/arch-rpc/entry-macro.S
new file mode 100644
index 000000000000..686f413f82d6
--- /dev/null
+++ b/include/asm-arm/arch-rpc/entry-macro.S
@@ -0,0 +1,3 @@
1
2#include <asm/hardware/entry-macro-iomd.S>
3
diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h
new file mode 100644
index 000000000000..be9754a05c19
--- /dev/null
+++ b/include/asm-arm/arch-rpc/hardware.h
@@ -0,0 +1,86 @@
1/*
2 * linux/include/asm-arm/arch-rpc/hardware.h
3 *
4 * Copyright (C) 1996-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 * This file contains the hardware definitions of the RiscPC series machines.
11 */
12#ifndef __ASM_ARCH_HARDWARE_H
13#define __ASM_ARCH_HARDWARE_H
14
15#include <asm/arch/memory.h>
16
17#ifndef __ASSEMBLY__
18#define IOMEM(x) ((void __iomem *)(x))
19#else
20#define IOMEM(x) x
21#endif /* __ASSEMBLY__ */
22
23/*
24 * What hardware must be present
25 */
26#define HAS_IOMD
27#define HAS_VIDC20
28
29/* Hardware addresses of major areas.
30 * *_START is the physical address
31 * *_SIZE is the size of the region
32 * *_BASE is the virtual address
33 */
34#define RAM_SIZE 0x10000000
35#define RAM_START 0x10000000
36
37#define EASI_SIZE 0x08000000 /* EASI I/O */
38#define EASI_START 0x08000000
39#define EASI_BASE 0xe5000000
40
41#define IO_START 0x03000000 /* I/O */
42#define IO_SIZE 0x01000000
43#define IO_BASE IOMEM(0xe0000000)
44
45#define SCREEN_START 0x02000000 /* VRAM */
46#define SCREEN_END 0xdfc00000
47#define SCREEN_BASE 0xdf800000
48
49#define FLUSH_BASE 0xdf000000
50#define UNCACHEABLE_ADDR 0xdf010000
51
52/*
53 * IO Addresses
54 */
55#define VIDC_BASE (void __iomem *)0xe0400000
56#define EXPMASK_BASE 0xe0360000
57#define IOMD_BASE IOMEM(0xe0200000)
58#define IOC_BASE IOMEM(0xe0200000)
59#define PCIO_BASE IOMEM(0xe0010000)
60#define FLOPPYDMA_BASE IOMEM(0xe002a000)
61
62#define FLUSH_BASE_PHYS 0x00000000 /* ROM */
63
64#define vidc_writel(val) __raw_writel(val, VIDC_BASE)
65
66#define IO_EC_EASI_BASE 0x81400000
67#define IO_EC_IOC4_BASE 0x8009c000
68#define IO_EC_IOC_BASE 0x80090000
69#define IO_EC_MEMC8_BASE 0x8000ac00
70#define IO_EC_MEMC_BASE 0x80000000
71
72#define NETSLOT_BASE 0x0302b000
73#define NETSLOT_SIZE 0x00001000
74
75#define PODSLOT_IOC0_BASE 0x03240000
76#define PODSLOT_IOC4_BASE 0x03270000
77#define PODSLOT_IOC_SIZE (1 << 14)
78#define PODSLOT_MEMC_BASE 0x03000000
79#define PODSLOT_MEMC_SIZE (1 << 14)
80#define PODSLOT_EASI_BASE 0x08000000
81#define PODSLOT_EASI_SIZE (1 << 24)
82
83#define EXPMASK_STATUS (EXPMASK_BASE + 0x00)
84#define EXPMASK_ENABLE (EXPMASK_BASE + 0x04)
85
86#endif
diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h
new file mode 100644
index 000000000000..24453c405a87
--- /dev/null
+++ b/include/asm-arm/arch-rpc/io.h
@@ -0,0 +1,257 @@
1/*
2 * linux/include/asm-arm/arch-rpc/io.h
3 *
4 * Copyright (C) 1997 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 * Modifications:
11 * 06-Dec-1997 RMK Created.
12 */
13#ifndef __ASM_ARM_ARCH_IO_H
14#define __ASM_ARM_ARCH_IO_H
15
16#define IO_SPACE_LIMIT 0xffffffff
17
18/*
19 * GCC is totally crap at loading/storing data. We try to persuade it
20 * to do the right thing by using these whereever possible instead of
21 * the above.
22 */
23#define __arch_base_getb(b,o) \
24 ({ \
25 unsigned int __v, __r = (b); \
26 __asm__ __volatile__( \
27 "ldrb %0, [%1, %2]" \
28 : "=r" (__v) \
29 : "r" (__r), "Ir" (o)); \
30 __v; \
31 })
32
33#define __arch_base_getl(b,o) \
34 ({ \
35 unsigned int __v, __r = (b); \
36 __asm__ __volatile__( \
37 "ldr %0, [%1, %2]" \
38 : "=r" (__v) \
39 : "r" (__r), "Ir" (o)); \
40 __v; \
41 })
42
43#define __arch_base_putb(v,b,o) \
44 ({ \
45 unsigned int __r = (b); \
46 __asm__ __volatile__( \
47 "strb %0, [%1, %2]" \
48 : \
49 : "r" (v), "r" (__r), "Ir" (o));\
50 })
51
52#define __arch_base_putl(v,b,o) \
53 ({ \
54 unsigned int __r = (b); \
55 __asm__ __volatile__( \
56 "str %0, [%1, %2]" \
57 : \
58 : "r" (v), "r" (__r), "Ir" (o));\
59 })
60
61/*
62 * We use two different types of addressing - PC style addresses, and ARM
63 * addresses. PC style accesses the PC hardware with the normal PC IO
64 * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
65 * and are translated to the start of IO. Note that all addresses are
66 * shifted left!
67 */
68#define __PORT_PCIO(x) (!((x) & 0x80000000))
69
70/*
71 * Dynamic IO functions.
72 */
73static inline void __outb (unsigned int value, unsigned int port)
74{
75 unsigned long temp;
76 __asm__ __volatile__(
77 "tst %2, #0x80000000\n\t"
78 "mov %0, %4\n\t"
79 "addeq %0, %0, %3\n\t"
80 "strb %1, [%0, %2, lsl #2] @ outb"
81 : "=&r" (temp)
82 : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
83 : "cc");
84}
85
86static inline void __outw (unsigned int value, unsigned int port)
87{
88 unsigned long temp;
89 __asm__ __volatile__(
90 "tst %2, #0x80000000\n\t"
91 "mov %0, %4\n\t"
92 "addeq %0, %0, %3\n\t"
93 "str %1, [%0, %2, lsl #2] @ outw"
94 : "=&r" (temp)
95 : "r" (value|value<<16), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
96 : "cc");
97}
98
99static inline void __outl (unsigned int value, unsigned int port)
100{
101 unsigned long temp;
102 __asm__ __volatile__(
103 "tst %2, #0x80000000\n\t"
104 "mov %0, %4\n\t"
105 "addeq %0, %0, %3\n\t"
106 "str %1, [%0, %2, lsl #2] @ outl"
107 : "=&r" (temp)
108 : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
109 : "cc");
110}
111
112#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
113static inline unsigned sz __in##fnsuffix (unsigned int port) \
114{ \
115 unsigned long temp, value; \
116 __asm__ __volatile__( \
117 "tst %2, #0x80000000\n\t" \
118 "mov %0, %4\n\t" \
119 "addeq %0, %0, %3\n\t" \
120 "ldr" instr " %1, [%0, %2, lsl #2] @ in" #fnsuffix \
121 : "=&r" (temp), "=r" (value) \
122 : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
123 : "cc"); \
124 return (unsigned sz)value; \
125}
126
127static inline void __iomem *__ioaddr(unsigned int port)
128{
129 void __iomem *ret;
130 if (__PORT_PCIO(port))
131 ret = PCIO_BASE;
132 else
133 ret = IO_BASE;
134 return ret + (port << 2);
135}
136
137#define DECLARE_IO(sz,fnsuffix,instr) \
138 DECLARE_DYN_IN(sz,fnsuffix,instr)
139
140DECLARE_IO(char,b,"b")
141DECLARE_IO(short,w,"")
142DECLARE_IO(int,l,"")
143
144#undef DECLARE_IO
145#undef DECLARE_DYN_IN
146
147/*
148 * Constant address IO functions
149 *
150 * These have to be macros for the 'J' constraint to work -
151 * +/-4096 immediate operand.
152 */
153#define __outbc(value,port) \
154({ \
155 if (__PORT_PCIO((port))) \
156 __asm__ __volatile__( \
157 "strb %0, [%1, %2] @ outbc" \
158 : : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
159 else \
160 __asm__ __volatile__( \
161 "strb %0, [%1, %2] @ outbc" \
162 : : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
163})
164
165#define __inbc(port) \
166({ \
167 unsigned char result; \
168 if (__PORT_PCIO((port))) \
169 __asm__ __volatile__( \
170 "ldrb %0, [%1, %2] @ inbc" \
171 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
172 else \
173 __asm__ __volatile__( \
174 "ldrb %0, [%1, %2] @ inbc" \
175 : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
176 result; \
177})
178
179#define __outwc(value,port) \
180({ \
181 unsigned long __v = value; \
182 if (__PORT_PCIO((port))) \
183 __asm__ __volatile__( \
184 "str %0, [%1, %2] @ outwc" \
185 : : "r" (__v|__v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
186 else \
187 __asm__ __volatile__( \
188 "str %0, [%1, %2] @ outwc" \
189 : : "r" (__v|__v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
190})
191
192#define __inwc(port) \
193({ \
194 unsigned short result; \
195 if (__PORT_PCIO((port))) \
196 __asm__ __volatile__( \
197 "ldr %0, [%1, %2] @ inwc" \
198 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
199 else \
200 __asm__ __volatile__( \
201 "ldr %0, [%1, %2] @ inwc" \
202 : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
203 result & 0xffff; \
204})
205
206#define __outlc(value,port) \
207({ \
208 unsigned long __v = value; \
209 if (__PORT_PCIO((port))) \
210 __asm__ __volatile__( \
211 "str %0, [%1, %2] @ outlc" \
212 : : "r" (__v), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
213 else \
214 __asm__ __volatile__( \
215 "str %0, [%1, %2] @ outlc" \
216 : : "r" (__v), "r" (IO_BASE), "r" ((port) << 2)); \
217})
218
219#define __inlc(port) \
220({ \
221 unsigned long result; \
222 if (__PORT_PCIO((port))) \
223 __asm__ __volatile__( \
224 "ldr %0, [%1, %2] @ inlc" \
225 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
226 else \
227 __asm__ __volatile__( \
228 "ldr %0, [%1, %2] @ inlc" \
229 : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
230 result; \
231})
232
233#define __ioaddrc(port) \
234 ((__PORT_PCIO(port) ? PCIO_BASE : IO_BASE) + ((port) << 2))
235
236#define inb(p) (__builtin_constant_p((p)) ? __inbc(p) : __inb(p))
237#define inw(p) (__builtin_constant_p((p)) ? __inwc(p) : __inw(p))
238#define inl(p) (__builtin_constant_p((p)) ? __inlc(p) : __inl(p))
239#define outb(v,p) (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p))
240#define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))
241#define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))
242#define __ioaddr(p) (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p))
243/* the following macro is deprecated */
244#define ioaddr(port) ((unsigned long)__ioaddr((port)))
245
246#define insb(p,d,l) __raw_readsb(__ioaddr(p),d,l)
247#define insw(p,d,l) __raw_readsw(__ioaddr(p),d,l)
248
249#define outsb(p,d,l) __raw_writesb(__ioaddr(p),d,l)
250#define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l)
251
252/*
253 * 1:1 mapping for ioremapped regions.
254 */
255#define __mem_pci(x) (x)
256
257#endif
diff --git a/include/asm-arm/arch-rpc/irqs.h b/include/asm-arm/arch-rpc/irqs.h
new file mode 100644
index 000000000000..27c35b05b27d
--- /dev/null
+++ b/include/asm-arm/arch-rpc/irqs.h
@@ -0,0 +1,46 @@
1/*
2 * linux/include/asm-arm/arch-rpc/irqs.h
3 *
4 * Copyright (C) 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
11#define IRQ_PRINTER 0
12#define IRQ_BATLOW 1
13#define IRQ_FLOPPYINDEX 2
14#define IRQ_VSYNCPULSE 3
15#define IRQ_POWERON 4
16#define IRQ_TIMER0 5
17#define IRQ_TIMER1 6
18#define IRQ_IMMEDIATE 7
19#define IRQ_EXPCARDFIQ 8
20#define IRQ_HARDDISK 9
21#define IRQ_SERIALPORT 10
22#define IRQ_FLOPPYDISK 12
23#define IRQ_EXPANSIONCARD 13
24#define IRQ_KEYBOARDTX 14
25#define IRQ_KEYBOARDRX 15
26
27#define IRQ_DMA0 16
28#define IRQ_DMA1 17
29#define IRQ_DMA2 18
30#define IRQ_DMA3 19
31#define IRQ_DMAS0 20
32#define IRQ_DMAS1 21
33
34#define FIQ_FLOPPYDATA 0
35#define FIQ_ECONET 2
36#define FIQ_SERIALPORT 4
37#define FIQ_EXPANSIONCARD 6
38#define FIQ_FORCE 7
39
40/*
41 * This is the offset of the FIQ "IRQ" numbers
42 */
43#define FIQ_START 64
44
45#define IRQ_TIMER IRQ_TIMER0
46
diff --git a/include/asm-arm/arch-rpc/memory.h b/include/asm-arm/arch-rpc/memory.h
new file mode 100644
index 000000000000..33fc75cdead0
--- /dev/null
+++ b/include/asm-arm/arch-rpc/memory.h
@@ -0,0 +1,33 @@
1/*
2 * linux/include/asm-arm/arch-rpc/memory.h
3 *
4 * Copyright (C) 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 * Changelog:
11 * 20-Oct-1996 RMK Created
12 * 31-Dec-1997 RMK Fixed definitions to reduce warnings
13 * 11-Jan-1998 RMK Uninlined to reduce hits on cache
14 * 08-Feb-1998 RMK Added __virt_to_bus and __bus_to_virt
15 * 21-Mar-1999 RMK Renamed to memory.h
16 * RMK Added TASK_SIZE and PAGE_OFFSET
17 */
18#ifndef __ASM_ARCH_MEMORY_H
19#define __ASM_ARCH_MEMORY_H
20
21/*
22 * Physical DRAM offset.
23 */
24#define PHYS_OFFSET (0x10000000UL)
25
26/*
27 * These are exactly the same on the RiscPC as the
28 * physical memory view.
29 */
30#define __virt_to_bus(x) __virt_to_phys(x)
31#define __bus_to_virt(x) __phys_to_virt(x)
32
33#endif
diff --git a/include/asm-arm/arch-rpc/param.h b/include/asm-arm/arch-rpc/param.h
new file mode 100644
index 000000000000..721dcd658858
--- /dev/null
+++ b/include/asm-arm/arch-rpc/param.h
@@ -0,0 +1,3 @@
1/*
2 * linux/include/asm-arm/arch-rpc/param.h
3 */
diff --git a/include/asm-arm/arch-rpc/system.h b/include/asm-arm/arch-rpc/system.h
new file mode 100644
index 000000000000..ca3277d1d5ea
--- /dev/null
+++ b/include/asm-arm/arch-rpc/system.h
@@ -0,0 +1,27 @@
1/*
2 * linux/include/asm-arm/arch-rpc/system.h
3 *
4 * Copyright (C) 1996-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#include <asm/arch/hardware.h>
11#include <asm/hardware/iomd.h>
12#include <asm/io.h>
13
14static inline void arch_idle(void)
15{
16 cpu_do_idle();
17}
18
19static inline void arch_reset(char mode)
20{
21 iomd_writeb(0, IOMD_ROMCR0);
22
23 /*
24 * Jump into the ROM
25 */
26 cpu_reset(0);
27}
diff --git a/include/asm-arm/arch-rpc/timex.h b/include/asm-arm/arch-rpc/timex.h
new file mode 100644
index 000000000000..ed7df64d960b
--- /dev/null
+++ b/include/asm-arm/arch-rpc/timex.h
@@ -0,0 +1,17 @@
1/*
2 * linux/include/asm-arm/arch-rpc/timex.h
3 *
4 * Copyright (C) 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 * RiscPC architecture timex specifications
11 */
12
13/*
14 * On the RiscPC, the clock ticks at 2MHz.
15 */
16#define CLOCK_TICK_RATE 2000000
17
diff --git a/include/asm-arm/arch-rpc/uncompress.h b/include/asm-arm/arch-rpc/uncompress.h
new file mode 100644
index 000000000000..43035fec64d2
--- /dev/null
+++ b/include/asm-arm/arch-rpc/uncompress.h
@@ -0,0 +1,155 @@
1/*
2 * linux/include/asm-arm/arch-rpc/uncompress.h
3 *
4 * Copyright (C) 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#define VIDMEM ((char *)SCREEN_START)
11
12#include <asm/hardware.h>
13#include <asm/io.h>
14
15int video_num_columns, video_num_lines, video_size_row;
16int white, bytes_per_char_h;
17extern unsigned long con_charconvtable[256];
18
19struct param_struct {
20 unsigned long page_size;
21 unsigned long nr_pages;
22 unsigned long ramdisk_size;
23 unsigned long mountrootrdonly;
24 unsigned long rootdev;
25 unsigned long video_num_cols;
26 unsigned long video_num_rows;
27 unsigned long video_x;
28 unsigned long video_y;
29 unsigned long memc_control_reg;
30 unsigned char sounddefault;
31 unsigned char adfsdrives;
32 unsigned char bytes_per_char_h;
33 unsigned char bytes_per_char_v;
34 unsigned long unused[256/4-11];
35};
36
37static const unsigned long palette_4[16] = {
38 0x00000000,
39 0x000000cc,
40 0x0000cc00, /* Green */
41 0x0000cccc, /* Yellow */
42 0x00cc0000, /* Blue */
43 0x00cc00cc, /* Magenta */
44 0x00cccc00, /* Cyan */
45 0x00cccccc, /* White */
46 0x00000000,
47 0x000000ff,
48 0x0000ff00,
49 0x0000ffff,
50 0x00ff0000,
51 0x00ff00ff,
52 0x00ffff00,
53 0x00ffffff
54};
55
56#define palette_setpixel(p) *(unsigned long *)(IO_START+0x00400000) = 0x10000000|((p) & 255)
57#define palette_write(v) *(unsigned long *)(IO_START+0x00400000) = 0x00000000|((v) & 0x00ffffff)
58
59/*
60 * params_phys is a linker defined symbol - see
61 * arch/arm/boot/compressed/Makefile
62 */
63extern __attribute__((pure)) struct param_struct *params(void);
64#define params (params())
65
66#ifndef STANDALONE_DEBUG
67/*
68 * This does not append a newline
69 */
70static void putstr(const char *s)
71{
72 extern void ll_write_char(char *, char c, char white);
73 int x,y;
74 unsigned char c;
75 char *ptr;
76
77 x = params->video_x;
78 y = params->video_y;
79
80 while ( ( c = *(unsigned char *)s++ ) != '\0' ) {
81 if ( c == '\n' ) {
82 x = 0;
83 if ( ++y >= video_num_lines ) {
84 y--;
85 }
86 } else {
87 ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
88 ll_write_char(ptr, c, white);
89 if ( ++x >= video_num_columns ) {
90 x = 0;
91 if ( ++y >= video_num_lines ) {
92 y--;
93 }
94 }
95 }
96 }
97
98 params->video_x = x;
99 params->video_y = y;
100}
101
102static void error(char *x);
103
104/*
105 * Setup for decompression
106 */
107static void arch_decomp_setup(void)
108{
109 int i;
110
111 video_num_lines = params->video_num_rows;
112 video_num_columns = params->video_num_cols;
113 bytes_per_char_h = params->bytes_per_char_h;
114 video_size_row = video_num_columns * bytes_per_char_h;
115 if (bytes_per_char_h == 4)
116 for (i = 0; i < 256; i++)
117 con_charconvtable[i] =
118 (i & 128 ? 1 << 0 : 0) |
119 (i & 64 ? 1 << 4 : 0) |
120 (i & 32 ? 1 << 8 : 0) |
121 (i & 16 ? 1 << 12 : 0) |
122 (i & 8 ? 1 << 16 : 0) |
123 (i & 4 ? 1 << 20 : 0) |
124 (i & 2 ? 1 << 24 : 0) |
125 (i & 1 ? 1 << 28 : 0);
126 else
127 for (i = 0; i < 16; i++)
128 con_charconvtable[i] =
129 (i & 8 ? 1 << 0 : 0) |
130 (i & 4 ? 1 << 8 : 0) |
131 (i & 2 ? 1 << 16 : 0) |
132 (i & 1 ? 1 << 24 : 0);
133
134
135 palette_setpixel(0);
136 if (bytes_per_char_h == 1) {
137 palette_write (0);
138 palette_write (0x00ffffff);
139 for (i = 2; i < 256; i++)
140 palette_write (0);
141 white = 1;
142 } else {
143 for (i = 0; i < 256; i++)
144 palette_write (i < 16 ? palette_4[i] : 0);
145 white = 7;
146 }
147
148 if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n");
149}
150#endif
151
152/*
153 * nothing to do
154 */
155#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-rpc/vmalloc.h b/include/asm-arm/arch-rpc/vmalloc.h
new file mode 100644
index 000000000000..a13c27f37d71
--- /dev/null
+++ b/include/asm-arm/arch-rpc/vmalloc.h
@@ -0,0 +1,21 @@
1/*
2 * linux/include/asm-arm/arch-rpc/vmalloc.h
3 *
4 * Copyright (C) 1997 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 * Just any arbitrary offset to the start of the vmalloc VM area: the
13 * current 8MB value just means that there will be a 8MB "hole" after the
14 * physical memory until the kernel virtual memory starts. That means that
15 * any out-of-bounds memory accesses will hopefully be caught.
16 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
17 * area for the same reason. ;)
18 */
19#define VMALLOC_OFFSET (8*1024*1024)
20#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
21#define VMALLOC_END (PAGE_OFFSET + 0x1c000000)
diff --git a/include/asm-arm/arch-s3c2410/bast-cpld.h b/include/asm-arm/arch-s3c2410/bast-cpld.h
new file mode 100644
index 000000000000..e28ca51a4975
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/bast-cpld.h
@@ -0,0 +1,58 @@
1/* linux/include/asm-arm/arch-s3c2410/bast-cpld.h
2 *
3 * (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * BAST - CPLD control constants
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 * Changelog:
13 * 25-May-2003 BJD Created file, added CTRL1 registers
14 * 30-Aug-2004 BJD Updated definitions from 2.4.26 port
15 * 30-Aug-2004 BJD Added CTRL3 and CTRL4 definitions
16*/
17
18#ifndef __ASM_ARCH_BASTCPLD_H
19#define __ASM_ARCH_BASTCPLD_H
20
21/* CTRL1 - Audio LR routing */
22
23#define BAST_CPLD_CTRL1_LRCOFF (0x00)
24#define BAST_CPLD_CTRL1_LRCADC (0x01)
25#define BAST_CPLD_CTRL1_LRCDAC (0x02)
26#define BAST_CPLD_CTRL1_LRCARM (0x03)
27#define BAST_CPLD_CTRL1_LRMASK (0x03)
28
29/* CTRL2 - NAND WP control, IDE Reset assert/check */
30
31#define BAST_CPLD_CTRL2_WNAND (0x04)
32#define BAST_CPLD_CTLR2_IDERST (0x08)
33
34/* CTRL3 - rom write control, CPLD identity */
35
36#define BAST_CPLD_CTRL3_IDMASK (0x0e)
37#define BAST_CPLD_CTRL3_ROMWEN (0x01)
38
39/* CTRL4 - 8bit LCD interface control/status */
40
41#define BAST_CPLD_CTRL4_LLAT (0x01)
42#define BAST_CPLD_CTRL4_LCDRW (0x02)
43#define BAST_CPLD_CTRL4_LCDCMD (0x04)
44#define BAST_CPLD_CTRL4_LCDE2 (0x01)
45
46/* CTRL5 - DMA routing */
47
48#define BAST_CPLD_DMA0_PRIIDE (0<<0)
49#define BAST_CPLD_DMA0_SECIDE (1<<0)
50#define BAST_CPLD_DMA0_ISA15 (2<<0)
51#define BAST_CPLD_DMA0_ISA36 (3<<0)
52
53#define BAST_CPLD_DMA1_PRIIDE (0<<2)
54#define BAST_CPLD_DMA1_SECIDE (1<<2)
55#define BAST_CPLD_DMA1_ISA15 (2<<2)
56#define BAST_CPLD_DMA1_ISA36 (3<<2)
57
58#endif /* __ASM_ARCH_BASTCPLD_H */
diff --git a/include/asm-arm/arch-s3c2410/bast-irq.h b/include/asm-arm/arch-s3c2410/bast-irq.h
new file mode 100644
index 000000000000..b79b47f0d126
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/bast-irq.h
@@ -0,0 +1,33 @@
1/* linux/include/asm-arm/arch-s3c2410/bast-irq.h
2 *
3 * (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Machine BAST - IRQ Number 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 * Changelog:
13 * 14-Sep-2004 BJD Fixed IRQ_USBOC definition
14 * 06-Jan-2003 BJD Linux 2.6.0 version
15 */
16
17#ifndef __ASM_ARCH_BASTIRQ_H
18#define __ASM_ARCH_BASTIRQ_H
19
20/* irq numbers to onboard peripherals */
21
22#define IRQ_USBOC IRQ_EINT18
23#define IRQ_IDE0 IRQ_EINT16
24#define IRQ_IDE1 IRQ_EINT17
25#define IRQ_PCSERIAL1 IRQ_EINT15
26#define IRQ_PCSERIAL2 IRQ_EINT14
27#define IRQ_PCPARALLEL IRQ_EINT13
28#define IRQ_ASIX IRQ_EINT11
29#define IRQ_DM9000 IRQ_EINT10
30#define IRQ_ISA IRQ_EINT9
31#define IRQ_SMALERT IRQ_EINT8
32
33#endif /* __ASM_ARCH_BASTIRQ_H */
diff --git a/include/asm-arm/arch-s3c2410/bast-map.h b/include/asm-arm/arch-s3c2410/bast-map.h
new file mode 100644
index 000000000000..29c07e302b04
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/bast-map.h
@@ -0,0 +1,150 @@
1/* linux/include/asm-arm/arch-s3c2410/bast-map.h
2 *
3 * (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Machine BAST - Memory map 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 * Changelog:
13 * 06-Jan-2003 BJD Linux 2.6.0 version, moved bast specifics from arch/map.h
14 * 12-Mar-2004 BJD Fixed header include protection
15*/
16
17/* needs arch/map.h including with this */
18
19/* ok, we've used up to 0x13000000, now we need to find space for the
20 * peripherals that live in the nGCS[x] areas, which are quite numerous
21 * in their space. We also have the board's CPLD to find register space
22 * for.
23 */
24
25#ifndef __ASM_ARCH_BASTMAP_H
26#define __ASM_ARCH_BASTMAP_H
27
28#define BAST_IOADDR(x) (S3C2410_ADDR((x) + 0x01300000))
29
30/* we put the CPLD registers next, to get them out of the way */
31
32#define BAST_VA_CTRL1 BAST_IOADDR(0x00000000) /* 0x01300000 */
33#define BAST_PA_CTRL1 (S3C2410_CS5 | 0x7800000)
34
35#define BAST_VA_CTRL2 BAST_IOADDR(0x00100000) /* 0x01400000 */
36#define BAST_PA_CTRL2 (S3C2410_CS1 | 0x6000000)
37
38#define BAST_VA_CTRL3 BAST_IOADDR(0x00200000) /* 0x01500000 */
39#define BAST_PA_CTRL3 (S3C2410_CS1 | 0x6800000)
40
41#define BAST_VA_CTRL4 BAST_IOADDR(0x00300000) /* 0x01600000 */
42#define BAST_PA_CTRL4 (S3C2410_CS1 | 0x7000000)
43
44/* next, we have the PC104 ISA interrupt registers */
45
46#define BAST_PA_PC104_IRQREQ (S3C2410_CS5 | 0x6000000) /* 0x01700000 */
47#define BAST_VA_PC104_IRQREQ BAST_IOADDR(0x00400000)
48
49#define BAST_PA_PC104_IRQRAW (S3C2410_CS5 | 0x6800000) /* 0x01800000 */
50#define BAST_VA_PC104_IRQRAW BAST_IOADDR(0x00500000)
51
52#define BAST_PA_PC104_IRQMASK (S3C2410_CS5 | 0x7000000) /* 0x01900000 */
53#define BAST_VA_PC104_IRQMASK BAST_IOADDR(0x00600000)
54
55#define BAST_PA_LCD_RCMD1 (0x8800000)
56#define BAST_VA_LCD_RCMD1 BAST_IOADDR(0x00700000)
57
58#define BAST_PA_LCD_WCMD1 (0x8000000)
59#define BAST_VA_LCD_WCMD1 BAST_IOADDR(0x00800000)
60
61#define BAST_PA_LCD_RDATA1 (0x9800000)
62#define BAST_VA_LCD_RDATA1 BAST_IOADDR(0x00900000)
63
64#define BAST_PA_LCD_WDATA1 (0x9000000)
65#define BAST_VA_LCD_WDATA1 BAST_IOADDR(0x00A00000)
66
67#define BAST_PA_LCD_RCMD2 (0xA800000)
68#define BAST_VA_LCD_RCMD2 BAST_IOADDR(0x00B00000)
69
70#define BAST_PA_LCD_WCMD2 (0xA000000)
71#define BAST_VA_LCD_WCMD2 BAST_IOADDR(0x00C00000)
72
73#define BAST_PA_LCD_RDATA2 (0xB800000)
74#define BAST_VA_LCD_RDATA2 BAST_IOADDR(0x00D00000)
75
76#define BAST_PA_LCD_WDATA2 (0xB000000)
77#define BAST_VA_LCD_WDATA2 BAST_IOADDR(0x00E00000)
78
79
80/* 0xE0000000 contains the IO space that is split by speed and
81 * wether the access is for 8 or 16bit IO... this ensures that
82 * the correct access is made
83 *
84 * 0x10000000 of space, partitioned as so:
85 *
86 * 0x00000000 to 0x04000000 8bit, slow
87 * 0x04000000 to 0x08000000 16bit, slow
88 * 0x08000000 to 0x0C000000 16bit, net
89 * 0x0C000000 to 0x10000000 16bit, fast
90 *
91 * each of these spaces has the following in:
92 *
93 * 0x00000000 to 0x01000000 16MB ISA IO space
94 * 0x01000000 to 0x02000000 16MB ISA memory space
95 * 0x02000000 to 0x02100000 1MB IDE primary channel
96 * 0x02100000 to 0x02200000 1MB IDE primary channel aux
97 * 0x02200000 to 0x02400000 1MB IDE secondary channel
98 * 0x02300000 to 0x02400000 1MB IDE secondary channel aux
99 * 0x02400000 to 0x02500000 1MB ASIX ethernet controller
100 * 0x02500000 to 0x02600000 1MB Davicom DM9000 ethernet controller
101 * 0x02600000 to 0x02700000 1MB PC SuperIO controller
102 *
103 * the phyiscal layout of the zones are:
104 * nGCS2 - 8bit, slow
105 * nGCS3 - 16bit, slow
106 * nGCS4 - 16bit, net
107 * nGCS5 - 16bit, fast
108 */
109
110#define BAST_VA_MULTISPACE (0xE0000000)
111
112#define BAST_VA_ISAIO (BAST_VA_MULTISPACE + 0x00000000)
113#define BAST_VA_ISAMEM (BAST_VA_MULTISPACE + 0x01000000)
114#define BAST_VA_IDEPRI (BAST_VA_MULTISPACE + 0x02000000)
115#define BAST_VA_IDEPRIAUX (BAST_VA_MULTISPACE + 0x02100000)
116#define BAST_VA_IDESEC (BAST_VA_MULTISPACE + 0x02200000)
117#define BAST_VA_IDESECAUX (BAST_VA_MULTISPACE + 0x02300000)
118#define BAST_VA_ASIXNET (BAST_VA_MULTISPACE + 0x02400000)
119#define BAST_VA_DM9000 (BAST_VA_MULTISPACE + 0x02500000)
120#define BAST_VA_SUPERIO (BAST_VA_MULTISPACE + 0x02600000)
121
122#define BAST_VA_MULTISPACE (0xE0000000)
123
124#define BAST_VAM_CS2 (0x00000000)
125#define BAST_VAM_CS3 (0x04000000)
126#define BAST_VAM_CS4 (0x08000000)
127#define BAST_VAM_CS5 (0x0C000000)
128
129/* physical offset addresses for the peripherals */
130
131#define BAST_PA_ISAIO (0x00000000)
132#define BAST_PA_ASIXNET (0x01000000)
133#define BAST_PA_SUPERIO (0x01800000)
134#define BAST_PA_IDEPRI (0x02000000)
135#define BAST_PA_IDEPRIAUX (0x02800000)
136#define BAST_PA_IDESEC (0x03000000)
137#define BAST_PA_IDESECAUX (0x03800000)
138#define BAST_PA_ISAMEM (0x04000000)
139#define BAST_PA_DM9000 (0x05000000)
140
141/* some configurations for the peripherals */
142
143#define BAST_PCSIO (BAST_VA_SUPERIO + BAST_VAM_CS2)
144/* */
145
146#define BAST_ASIXNET_CS BAST_VAM_CS5
147#define BAST_IDE_CS BAST_VAM_CS5
148#define BAST_DM9000_CS BAST_VAM_CS4
149
150#endif /* __ASM_ARCH_BASTMAP_H */
diff --git a/include/asm-arm/arch-s3c2410/bast-pmu.h b/include/asm-arm/arch-s3c2410/bast-pmu.h
new file mode 100644
index 000000000000..758c5c59d4bf
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/bast-pmu.h
@@ -0,0 +1,43 @@
1/* linux/include/asm-arm/arch-s3c2410/bast-pmu.h
2 *
3 * (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * Vincent Sanders <vince@simtec.co.uk>
6 *
7 * Machine BAST - Power Management chip
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 * 08-Oct-2003 BJD Initial creation
15*/
16
17#ifndef __ASM_ARCH_BASTPMU_H
18#define __ASM_ARCH_BASTPMU_H "08_OCT_2004"
19
20#define BASTPMU_REG_IDENT (0x00)
21#define BASTPMU_REG_VERSION (0x01)
22#define BASTPMU_REG_DDCCTRL (0x02)
23#define BASTPMU_REG_POWER (0x03)
24#define BASTPMU_REG_RESET (0x04)
25#define BASTPMU_REG_GWO (0x05)
26#define BASTPMU_REG_WOL (0x06)
27#define BASTPMU_REG_WOR (0x07)
28#define BASTPMU_REG_UID (0x09)
29
30#define BASTPMU_EEPROM (0xC0)
31
32#define BASTPMU_EEP_UID (BASTPMU_EEPROM + 0)
33#define BASTPMU_EEP_WOL (BASTPMU_EEPROM + 8)
34#define BASTPMU_EEP_WOR (BASTPMU_EEPROM + 9)
35
36#define BASTPMU_IDENT_0 0x53
37#define BASTPMU_IDENT_1 0x42
38#define BASTPMU_IDENT_2 0x50
39#define BASTPMU_IDENT_3 0x4d
40
41#define BASTPMU_RESET_GUARD (0x55)
42
43#endif /* __ASM_ARCH_BASTPMU_H */
diff --git a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S
new file mode 100644
index 000000000000..abfbe45cd17c
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/debug-macro.S
@@ -0,0 +1,99 @@
1/* linux/include/asm-arm/arch-s3c2410/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Copyright (C) 2005 Simtec Electronics
7 *
8 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
16*/
17
18#include <asm/arch/map.h>
19#include <asm/arch/regs-serial.h>
20#include <asm/arch/regs-gpio.h>
21
22#define S3C2410_UART1_OFF (0x4000)
23#define SHIFT_2440TXF (14-9)
24
25 .macro addruart, rx
26 mrc p15, 0, \rx, c1, c0
27 tst \rx, #1
28 ldreq \rx, = S3C2410_PA_UART
29 ldrne \rx, = S3C24XX_VA_UART
30#if CONFIG_DEBUG_S3C2410_UART != 0
31 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART)
32#endif
33 .endm
34
35 .macro senduart,rd,rx
36 str \rd, [\rx, # S3C2410_UTXH ]
37 .endm
38
39 .macro busyuart, rd, rx
40 ldr \rd, [ \rx, # S3C2410_UFCON ]
41 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
42 beq 1001f @
43 @ FIFO enabled...
441003:
45 mrc p15, 0, \rd, c1, c0
46 tst \rd, #1
47 addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART)
48 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
49 bic \rd, \rd, #0xff000
50 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
51 and \rd, \rd, #0x00ff0000
52 teq \rd, #0x00440000 @ is it 2440?
53
54 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
55 moveq \rd, \rd, lsr #SHIFT_2440TXF
56 tst \rd, #S3C2410_UFSTAT_TXFULL
57 bne 1003b
58 b 1002f
59
601001:
61 @ busy waiting for non fifo
62 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
63 tst \rd, #S3C2410_UTRSTAT_TXFE
64 beq 1001b
65
661002: @ exit busyuart
67 .endm
68
69 .macro waituart,rd,rx
70
71 ldr \rd, [ \rx, # S3C2410_UFCON ]
72 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
73 beq 1001f @
74 @ FIFO enabled...
751003:
76 mrc p15, 0, \rd, c1, c0
77 tst \rd, #1
78 addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART)
79 addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
80 bic \rd, \rd, #0xff000
81 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
82 and \rd, \rd, #0x00ff0000
83 teq \rd, #0x00440000 @ is it 2440?
84
85 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
86 andne \rd, \rd, #S3C2410_UFSTAT_TXMASK
87 andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK
88 teq \rd, #0
89 bne 1003b
90 b 1002f
91
921001:
93 @ idle waiting for non fifo
94 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
95 tst \rd, #S3C2410_UTRSTAT_TXFE
96 beq 1001b
97
981002: @ exit busyuart
99 .endm
diff --git a/include/asm-arm/arch-s3c2410/dma.h b/include/asm-arm/arch-s3c2410/dma.h
new file mode 100644
index 000000000000..e830a40e573a
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/dma.h
@@ -0,0 +1,376 @@
1/* linux/include/asm-arm/arch-bast/dma.h
2 *
3 * Copyright (C) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Samsung S3C2410X DMA 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 * Changelog:
13 * ??-May-2003 BJD Created file
14 * ??-Jun-2003 BJD Added more dma functionality to go with arch
15 * 10-Nov-2004 BJD Added sys_device support
16*/
17
18#ifndef __ASM_ARCH_DMA_H
19#define __ASM_ARCH_DMA_H __FILE__
20
21#include <linux/config.h>
22#include <linux/sysdev.h>
23#include "hardware.h"
24
25
26/*
27 * This is the maximum DMA address(physical address) that can be DMAd to.
28 *
29 */
30#define MAX_DMA_ADDRESS 0x20000000
31#define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */
32
33
34/* according to the samsung port, we cannot use the regular
35 * dma channels... we must therefore provide our own interface
36 * for DMA, and allow our drivers to use that.
37 */
38
39#define MAX_DMA_CHANNELS 0
40
41
42/* we have 4 dma channels */
43#define S3C2410_DMA_CHANNELS (4)
44
45/* types */
46
47typedef enum {
48 S3C2410_DMA_IDLE,
49 S3C2410_DMA_RUNNING,
50 S3C2410_DMA_PAUSED
51} s3c2410_dma_state_t;
52
53
54/* s3c2410_dma_loadst_t
55 *
56 * This represents the state of the DMA engine, wrt to the loaded / running
57 * transfers. Since we don't have any way of knowing exactly the state of
58 * the DMA transfers, we need to know the state to make decisions on wether
59 * we can
60 *
61 * S3C2410_DMA_NONE
62 *
63 * There are no buffers loaded (the channel should be inactive)
64 *
65 * S3C2410_DMA_1LOADED
66 *
67 * There is one buffer loaded, however it has not been confirmed to be
68 * loaded by the DMA engine. This may be because the channel is not
69 * yet running, or the DMA driver decided that it was too costly to
70 * sit and wait for it to happen.
71 *
72 * S3C2410_DMA_1RUNNING
73 *
74 * The buffer has been confirmed running, and not finisged
75 *
76 * S3C2410_DMA_1LOADED_1RUNNING
77 *
78 * There is a buffer waiting to be loaded by the DMA engine, and one
79 * currently running.
80*/
81
82typedef enum {
83 S3C2410_DMALOAD_NONE,
84 S3C2410_DMALOAD_1LOADED,
85 S3C2410_DMALOAD_1RUNNING,
86 S3C2410_DMALOAD_1LOADED_1RUNNING,
87} s3c2410_dma_loadst_t;
88
89typedef enum {
90 S3C2410_RES_OK,
91 S3C2410_RES_ERR,
92 S3C2410_RES_ABORT
93} s3c2410_dma_buffresult_t;
94
95
96typedef enum s3c2410_dmasrc_e s3c2410_dmasrc_t;
97
98enum s3c2410_dmasrc_e {
99 S3C2410_DMASRC_HW, /* source is memory */
100 S3C2410_DMASRC_MEM /* source is hardware */
101};
102
103/* enum s3c2410_chan_op_e
104 *
105 * operation codes passed to the DMA code by the user, and also used
106 * to inform the current channel owner of any changes to the system state
107*/
108
109enum s3c2410_chan_op_e {
110 S3C2410_DMAOP_START,
111 S3C2410_DMAOP_STOP,
112 S3C2410_DMAOP_PAUSE,
113 S3C2410_DMAOP_RESUME,
114 S3C2410_DMAOP_FLUSH,
115 S3C2410_DMAOP_TIMEOUT, /* internal signal to handler */
116};
117
118typedef enum s3c2410_chan_op_e s3c2410_chan_op_t;
119
120/* flags */
121
122#define S3C2410_DMAF_SLOW (1<<0) /* slow, so don't worry about
123 * waiting for reloads */
124#define S3C2410_DMAF_AUTOSTART (1<<1) /* auto-start if buffer queued */
125
126/* dma buffer */
127
128typedef struct s3c2410_dma_buf_s s3c2410_dma_buf_t;
129
130struct s3c2410_dma_client {
131 char *name;
132};
133
134typedef struct s3c2410_dma_client s3c2410_dma_client_t;
135
136/* s3c2410_dma_buf_s
137 *
138 * internally used buffer structure to describe a queued or running
139 * buffer.
140*/
141
142struct s3c2410_dma_buf_s {
143 s3c2410_dma_buf_t *next;
144 int magic; /* magic */
145 int size; /* buffer size in bytes */
146 dma_addr_t data; /* start of DMA data */
147 dma_addr_t ptr; /* where the DMA got to [1] */
148 void *id; /* client's id */
149};
150
151/* [1] is this updated for both recv/send modes? */
152
153typedef struct s3c2410_dma_chan_s s3c2410_dma_chan_t;
154
155/* s3c2410_dma_cbfn_t
156 *
157 * buffer callback routine type
158*/
159
160typedef void (*s3c2410_dma_cbfn_t)(s3c2410_dma_chan_t *, void *buf, int size,
161 s3c2410_dma_buffresult_t result);
162
163typedef int (*s3c2410_dma_opfn_t)(s3c2410_dma_chan_t *,
164 s3c2410_chan_op_t );
165
166struct s3c2410_dma_stats_s {
167 unsigned long loads;
168 unsigned long timeout_longest;
169 unsigned long timeout_shortest;
170 unsigned long timeout_avg;
171 unsigned long timeout_failed;
172};
173
174typedef struct s3c2410_dma_stats_s s3c2410_dma_stats_t;
175
176/* struct s3c2410_dma_chan_s
177 *
178 * full state information for each DMA channel
179*/
180
181struct s3c2410_dma_chan_s {
182 /* channel state flags and information */
183 unsigned char number; /* number of this dma channel */
184 unsigned char in_use; /* channel allocated */
185 unsigned char irq_claimed; /* irq claimed for channel */
186 unsigned char irq_enabled; /* irq enabled for channel */
187 unsigned char xfer_unit; /* size of an transfer */
188
189 /* channel state */
190
191 s3c2410_dma_state_t state;
192 s3c2410_dma_loadst_t load_state;
193 s3c2410_dma_client_t *client;
194
195 /* channel configuration */
196 s3c2410_dmasrc_t source;
197 unsigned long dev_addr;
198 unsigned long load_timeout;
199 unsigned int flags; /* channel flags */
200
201 /* channel's hardware position and configuration */
202 void __iomem *regs; /* channels registers */
203 void __iomem *addr_reg; /* data address register */
204 unsigned int irq; /* channel irq */
205 unsigned long dcon; /* default value of DCON */
206
207 /* driver handles */
208 s3c2410_dma_cbfn_t callback_fn; /* buffer done callback */
209 s3c2410_dma_opfn_t op_fn; /* channel operation callback */
210
211 /* stats gathering */
212 s3c2410_dma_stats_t *stats;
213 s3c2410_dma_stats_t stats_store;
214
215 /* buffer list and information */
216 s3c2410_dma_buf_t *curr; /* current dma buffer */
217 s3c2410_dma_buf_t *next; /* next buffer to load */
218 s3c2410_dma_buf_t *end; /* end of queue */
219
220 /* system device */
221 struct sys_device dev;
222};
223
224/* the currently allocated channel information */
225extern s3c2410_dma_chan_t s3c2410_chans[];
226
227/* note, we don't really use dma_device_t at the moment */
228typedef unsigned long dma_device_t;
229
230/* functions --------------------------------------------------------------- */
231
232/* s3c2410_dma_request
233 *
234 * request a dma channel exclusivley
235*/
236
237extern int s3c2410_dma_request(dmach_t channel,
238 s3c2410_dma_client_t *, void *dev);
239
240
241/* s3c2410_dma_ctrl
242 *
243 * change the state of the dma channel
244*/
245
246extern int s3c2410_dma_ctrl(dmach_t channel, s3c2410_chan_op_t op);
247
248/* s3c2410_dma_setflags
249 *
250 * set the channel's flags to a given state
251*/
252
253extern int s3c2410_dma_setflags(dmach_t channel,
254 unsigned int flags);
255
256/* s3c2410_dma_free
257 *
258 * free the dma channel (will also abort any outstanding operations)
259*/
260
261extern int s3c2410_dma_free(dmach_t channel, s3c2410_dma_client_t *);
262
263/* s3c2410_dma_enqueue
264 *
265 * place the given buffer onto the queue of operations for the channel.
266 * The buffer must be allocated from dma coherent memory, or the Dcache/WB
267 * drained before the buffer is given to the DMA system.
268*/
269
270extern int s3c2410_dma_enqueue(dmach_t channel, void *id,
271 dma_addr_t data, int size);
272
273/* s3c2410_dma_config
274 *
275 * configure the dma channel
276*/
277
278extern int s3c2410_dma_config(dmach_t channel, int xferunit, int dcon);
279
280/* s3c2410_dma_devconfig
281 *
282 * configure the device we're talking to
283*/
284
285extern int s3c2410_dma_devconfig(int channel, s3c2410_dmasrc_t source,
286 int hwcfg, unsigned long devaddr);
287
288/* s3c2410_dma_getposition
289 *
290 * get the position that the dma transfer is currently at
291*/
292
293extern int s3c2410_dma_getposition(dmach_t channel,
294 dma_addr_t *src, dma_addr_t *dest);
295
296extern int s3c2410_dma_set_opfn(dmach_t, s3c2410_dma_opfn_t rtn);
297extern int s3c2410_dma_set_buffdone_fn(dmach_t, s3c2410_dma_cbfn_t rtn);
298
299/* DMA Register definitions */
300
301#define S3C2410_DMA_DISRC (0x00)
302#define S3C2410_DMA_DISRCC (0x04)
303#define S3C2410_DMA_DIDST (0x08)
304#define S3C2410_DMA_DIDSTC (0x0C)
305#define S3C2410_DMA_DCON (0x10)
306#define S3C2410_DMA_DSTAT (0x14)
307#define S3C2410_DMA_DCSRC (0x18)
308#define S3C2410_DMA_DCDST (0x1C)
309#define S3C2410_DMA_DMASKTRIG (0x20)
310
311#define S3C2410_DISRCC_INC (1<<0)
312#define S3C2410_DISRCC_APB (1<<1)
313
314#define S3C2410_DMASKTRIG_STOP (1<<2)
315#define S3C2410_DMASKTRIG_ON (1<<1)
316#define S3C2410_DMASKTRIG_SWTRIG (1<<0)
317
318#define S3C2410_DCON_DEMAND (0<<31)
319#define S3C2410_DCON_HANDSHAKE (1<<31)
320#define S3C2410_DCON_SYNC_PCLK (0<<30)
321#define S3C2410_DCON_SYNC_HCLK (1<<30)
322
323#define S3C2410_DCON_INTREQ (1<<29)
324
325#define S3C2410_DCON_CH0_XDREQ0 (0<<24)
326#define S3C2410_DCON_CH0_UART0 (1<<24)
327#define S3C2410_DCON_CH0_SDI (2<<24)
328#define S3C2410_DCON_CH0_TIMER (3<<24)
329#define S3C2410_DCON_CH0_USBEP1 (4<<24)
330
331#define S3C2410_DCON_CH1_XDREQ1 (0<<24)
332#define S3C2410_DCON_CH1_UART1 (1<<24)
333#define S3C2410_DCON_CH1_I2SSDI (2<<24)
334#define S3C2410_DCON_CH1_SPI (3<<24)
335#define S3C2410_DCON_CH1_USBEP2 (4<<24)
336
337#define S3C2410_DCON_CH2_I2SSDO (0<<24)
338#define S3C2410_DCON_CH2_I2SSDI (1<<24)
339#define S3C2410_DCON_CH2_SDI (2<<24)
340#define S3C2410_DCON_CH2_TIMER (3<<24)
341#define S3C2410_DCON_CH2_USBEP3 (4<<24)
342
343#define S3C2410_DCON_CH3_UART2 (0<<24)
344#define S3C2410_DCON_CH3_SDI (1<<24)
345#define S3C2410_DCON_CH3_SPI (2<<24)
346#define S3C2410_DCON_CH3_TIMER (3<<24)
347#define S3C2410_DCON_CH3_USBEP4 (4<<24)
348
349#define S3C2410_DCON_SRCSHIFT (24)
350#define S3C2410_DCON_SRCMASK (7<<24)
351
352#define S3C2410_DCON_BYTE (0<<20)
353#define S3C2410_DCON_HALFWORD (1<<20)
354#define S3C2410_DCON_WORD (2<<20)
355
356#define S3C2410_DCON_AUTORELOAD (0<<22)
357#define S3C2410_DCON_NORELOAD (1<<22)
358#define S3C2410_DCON_HWTRIG (1<<23)
359
360#ifdef CONFIG_CPU_S3C2440
361#define S3C2440_DIDSTC_CHKINT (1<<2)
362
363#define S3C2440_DCON_CH0_I2SSDO (5<<24)
364#define S3C2440_DCON_CH0_PCMIN (6<<24)
365
366#define S3C2440_DCON_CH1_PCMOUT (5<<24)
367#define S3C2440_DCON_CH1_SDI (6<<24)
368
369#define S3C2440_DCON_CH2_PCMIN (5<<24)
370#define S3C2440_DCON_CH2_MICIN (6<<24)
371
372#define S3C2440_DCON_CH3_MICIN (5<<24)
373#define S3C2440_DCON_CH3_PCMOUT (6<<24)
374#endif
375
376#endif /* __ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-s3c2410/entry-macro.S b/include/asm-arm/arch-s3c2410/entry-macro.S
new file mode 100644
index 000000000000..b7d4d7f4422d
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/entry-macro.S
@@ -0,0 +1,119 @@
1/*
2 * include/asm-arm/arch-s3c2410/entry-macro.S
3 *
4 * Low-level IRQ helper macros for S3C2410-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9
10 * Modifications:
11 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
12 */
13
14
15 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
16
17 mov \tmp, #S3C24XX_VA_IRQ
18 ldr \irqnr, [ \tmp, #0x14 ] @ get irq no
1930000:
20 teq \irqnr, #4
21 teqne \irqnr, #5
22 beq 1002f @ external irq reg
23
24 @ debug check to see if interrupt reported is the same
25 @ as the offset....
26
27 teq \irqnr, #0
28 beq 20002f
29 ldr \irqstat, [ \tmp, #0x10 ] @ INTPND
30 mov \irqstat, \irqstat, lsr \irqnr
31 tst \irqstat, #1
32 bne 20002f
33
34 /* debug/warning if we get an invalud response from the
35 * INTOFFSET register */
36#if 1
37 stmfd r13!, { r0 - r4 , r8-r12, r14 }
38 ldr r1, [ \tmp, #0x14 ] @ INTOFFSET
39 ldr r2, [ \tmp, #0x10 ] @ INTPND
40 ldr r3, [ \tmp, #0x00 ] @ SRCPND
41 adr r0, 20003f
42 bl printk
43 b 20004f
44
4520003:
46 .ascii "<7>irq: err - bad offset %d, intpnd=%08x, srcpnd=%08x\n"
47 .byte 0
48 .align 4
4920004:
50 mov r1, #1
51 mov \tmp, #S3C24XX_VA_IRQ
52 ldmfd r13!, { r0 - r4 , r8-r12, r14 }
53#endif
54
55 @ try working out interrupt number for ourselves
56 mov \irqnr, #0
57 ldr \irqstat, [ \tmp, #0x10 ] @ INTPND
5810021:
59 movs \irqstat, \irqstat, lsr#1
60 bcs 30000b @ try and re-start the proccess
61 add \irqnr, \irqnr, #1
62 cmp \irqnr, #32
63 ble 10021b
64
65 @ found no interrupt, set Z flag and leave
66 movs \irqnr, #0
67 b 1001f
68
6920005:
7020002: @ exit
71 @ we base the s3c2410x interrupts at 16 and above to allow
72 @ isa peripherals to have their standard interrupts, also
73 @ ensure that Z flag is un-set on exit
74
75 @ note, we cannot be sure if we get IRQ_EINT0 (0) that
76 @ there is simply no interrupt pending, so in all other
77 @ cases we jump to say we have found something, otherwise
78 @ we check to see if the interrupt really is assrted
79 adds \irqnr, \irqnr, #IRQ_EINT0
80 teq \irqnr, #IRQ_EINT0
81 bne 1001f @ exit
82 ldr \irqstat, [ \tmp, #0x10 ] @ INTPND
83 teq \irqstat, #0
84 moveq \irqnr, #0
85 b 1001f
86
87 @ we get here from no main or external interrupts pending
881002:
89 add \tmp, \tmp, #S3C24XX_VA_GPIO - S3C24XX_VA_IRQ
90 ldr \irqstat, [ \tmp, # 0xa8 ] @ EXTINTPEND
91 ldr \irqnr, [ \tmp, # 0xa4 ] @ EXTINTMASK
92
93 bic \irqstat, \irqstat, \irqnr @ clear masked irqs
94
95 mov \irqnr, #IRQ_EINT4 @ start extint nos
96 mov \irqstat, \irqstat, lsr#4 @ ignore bottom 4 bits
9710021:
98 movs \irqstat, \irqstat, lsr#1
99 bcs 1004f
100 add \irqnr, \irqnr, #1
101 cmp \irqnr, #IRQ_EINT23
102 ble 10021b
103
104 @ found no interrupt, set Z flag and leave
105 movs \irqnr, #0
106
1071004: @ ensure Z flag clear in case our MOVS shifted out the last bit
108 teq \irqnr, #0
1091001:
110 @ exit irq routine
111 .endm
112
113
114 /* currently don't need an disable_fiq macro */
115
116 .macro disable_fiq
117 .endm
118
119
diff --git a/include/asm-arm/arch-s3c2410/hardware.h b/include/asm-arm/arch-s3c2410/hardware.h
new file mode 100644
index 000000000000..48a39918a760
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/hardware.h
@@ -0,0 +1,105 @@
1/* linux/include/asm-arm/arch-s3c2410/hardware.h
2 *
3 * (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - hardware
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 * Changelog:
13 * 21-May-2003 BJD Created file
14 * 06-Jun-2003 BJD Added CPU frequency settings
15 * 03-Sep-2003 BJD Linux v2.6 support
16 * 12-Mar-2004 BJD Fixed include protection, fixed type of clock vars
17 * 14-Sep-2004 BJD Added misccr and getpin to gpio
18 * 01-Oct-2004 BJD Added the new gpio functions
19 * 16-Oct-2004 BJD Removed the clock variables
20*/
21
22#ifndef __ASM_ARCH_HARDWARE_H
23#define __ASM_ARCH_HARDWARE_H
24
25#ifndef __ASSEMBLY__
26
27/* external functions for GPIO support
28 *
29 * These allow various different clients to access the same GPIO
30 * registers without conflicting. If your driver only owns the entire
31 * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
32*/
33
34/* s3c2410_gpio_cfgpin
35 *
36 * set the configuration of the given pin to the value passed.
37 *
38 * eg:
39 * s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
40 * s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
41*/
42
43extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
44
45extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
46
47/* s3c2410_gpio_getirq
48 *
49 * turn the given pin number into the corresponding IRQ number
50 *
51 * returns:
52 * < 0 = no interrupt for this pin
53 * >=0 = interrupt number for the pin
54*/
55
56extern int s3c2410_gpio_getirq(unsigned int pin);
57
58/* s3c2410_gpio_irqfilter
59 *
60 * set the irq filtering on the given pin
61 *
62 * on = 0 => disable filtering
63 * 1 => enable filtering
64 *
65 * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
66 * width of filter (0 through 63)
67 *
68 *
69*/
70
71extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
72 unsigned int config);
73
74/* s3c2410_gpio_pullup
75 *
76 * configure the pull-up control on the given pin
77 *
78 * to = 1 => disable the pull-up
79 * 0 => enable the pull-up
80 *
81 * eg;
82 *
83 * s3c2410_gpio_pullup(S3C2410_GPB0, 0);
84 * s3c2410_gpio_pullup(S3C2410_GPE8, 0);
85*/
86
87extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
88
89extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
90
91extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
92
93extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
94
95#endif /* __ASSEMBLY__ */
96
97#include <asm/sizes.h>
98#include <asm/arch/map.h>
99
100/* machine specific hardware definitions should go after this */
101
102/* currently here until moved into config (todo) */
103#define CONFIG_NO_MULTIWORD_IO
104
105#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-s3c2410/idle.h b/include/asm-arm/arch-s3c2410/idle.h
new file mode 100644
index 000000000000..749227c09576
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/idle.h
@@ -0,0 +1,28 @@
1/* linux/include/asm-arm/arch-s3c2410/idle.h
2 *
3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 CPU Idle controls
11 *
12 * Changelog:
13 * 28-Oct-2004 BJD Initial version
14 *
15*/
16
17#ifndef __ASM_ARCH_IDLE_H
18#define __ASM_ARCH_IDLE_H __FILE__
19
20/* This allows the over-ride of the default idle code, in case there
21 * is any other things to be done over idle (like DVS)
22*/
23
24extern void (*s3c24xx_idle)(void);
25
26extern void s3c24xx_default_idle(void);
27
28#endif /* __ASM_ARCH_IDLE_H */
diff --git a/include/asm-arm/arch-s3c2410/iic.h b/include/asm-arm/arch-s3c2410/iic.h
new file mode 100644
index 000000000000..518547f6d7a7
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/iic.h
@@ -0,0 +1,36 @@
1/* linux/include/asm-arm/arch-s3c2410/iic.h
2 *
3 * (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - I2C Controller platfrom_device info
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 * Changelog:
13 * 05-Oct-2004 BJD Created file
14 * 19-Oct-2004 BJD Updated for s3c2440
15*/
16
17#ifndef __ASM_ARCH_IIC_H
18#define __ASM_ARCH_IIC_H __FILE__
19
20#define S3C_IICFLG_FILTER (1<<0) /* enable s3c2440 filter */
21
22/* Notes:
23 * 1) All frequencies are expressed in Hz
24 * 2) A value of zero is `do not care`
25*/
26
27struct s3c2410_platform_i2c {
28 unsigned int flags;
29 unsigned int slave_addr; /* slave address for controller */
30 unsigned long bus_freq; /* standard bus frequency */
31 unsigned long max_freq; /* max frequency for the bus */
32 unsigned long min_freq; /* min frequency for the bus */
33 unsigned int sda_delay; /* pclks (s3c2440 only) */
34};
35
36#endif /* __ASM_ARCH_IIC_H */
diff --git a/include/asm-arm/arch-s3c2410/io.h b/include/asm-arm/arch-s3c2410/io.h
new file mode 100644
index 000000000000..418233a7ee6f
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/io.h
@@ -0,0 +1,196 @@
1/*
2 * linux/include/asm-arm/arch-s3c2410/io.h
3 * from linux/include/asm-arm/arch-rpc/io.h
4 *
5 * Copyright (C) 1997 Russell King
6 * (C) 2003 Simtec Electronics
7 *
8 * Modifications:
9 * 06-Dec-1997 RMK Created.
10 * 02-Sep-2003 BJD Modified for S3C2410
11 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
12 *
13 */
14
15#ifndef __ASM_ARM_ARCH_IO_H
16#define __ASM_ARM_ARCH_IO_H
17
18#define IO_SPACE_LIMIT 0xffffffff
19
20/*
21 * We use two different types of addressing - PC style addresses, and ARM
22 * addresses. PC style accesses the PC hardware with the normal PC IO
23 * addresses, eg 0x3f8 for serial#1. ARM addresses are above A28
24 * and are translated to the start of IO. Note that all addresses are
25 * not shifted left!
26 */
27
28#define __PORT_PCIO(x) ((x) < (1<<28))
29
30#define PCIO_BASE (S3C24XX_VA_ISA_WORD)
31#define PCIO_BASE_b (S3C24XX_VA_ISA_BYTE)
32#define PCIO_BASE_w (S3C24XX_VA_ISA_WORD)
33#define PCIO_BASE_l (S3C24XX_VA_ISA_WORD)
34/*
35 * Dynamic IO functions - let the compiler
36 * optimize the expressions
37 */
38
39#define DECLARE_DYN_OUT(sz,fnsuffix,instr) \
40static inline void __out##fnsuffix (unsigned int val, unsigned int port) \
41{ \
42 unsigned long temp; \
43 __asm__ __volatile__( \
44 "cmp %2, #(1<<28)\n\t" \
45 "mov %0, %2\n\t" \
46 "addcc %0, %0, %3\n\t" \
47 "str" instr " %1, [%0, #0 ] @ out" #fnsuffix \
48 : "=&r" (temp) \
49 : "r" (val), "r" (port), "Ir" (PCIO_BASE_##fnsuffix) \
50 : "cc"); \
51}
52
53
54#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
55static inline unsigned sz __in##fnsuffix (unsigned int port) \
56{ \
57 unsigned long temp, value; \
58 __asm__ __volatile__( \
59 "cmp %2, #(1<<28)\n\t" \
60 "mov %0, %2\n\t" \
61 "addcc %0, %0, %3\n\t" \
62 "ldr" instr " %1, [%0, #0 ] @ in" #fnsuffix \
63 : "=&r" (temp), "=r" (value) \
64 : "r" (port), "Ir" (PCIO_BASE_##fnsuffix) \
65 : "cc"); \
66 return (unsigned sz)value; \
67}
68
69static inline void __iomem *__ioaddr (unsigned long port)
70{
71 return __PORT_PCIO(port) ? (PCIO_BASE + port) : (void __iomem *)port;
72}
73
74#define DECLARE_IO(sz,fnsuffix,instr) \
75 DECLARE_DYN_IN(sz,fnsuffix,instr) \
76 DECLARE_DYN_OUT(sz,fnsuffix,instr)
77
78DECLARE_IO(char,b,"b")
79DECLARE_IO(short,w,"h")
80DECLARE_IO(int,l,"")
81
82#undef DECLARE_IO
83#undef DECLARE_DYN_IN
84
85/*
86 * Constant address IO functions
87 *
88 * These have to be macros for the 'J' constraint to work -
89 * +/-4096 immediate operand.
90 */
91#define __outbc(value,port) \
92({ \
93 if (__PORT_PCIO((port))) \
94 __asm__ __volatile__( \
95 "strb %0, [%1, %2] @ outbc" \
96 : : "r" (value), "r" (PCIO_BASE), "Jr" ((port))); \
97 else \
98 __asm__ __volatile__( \
99 "strb %0, [%1, #0] @ outbc" \
100 : : "r" (value), "r" ((port))); \
101})
102
103#define __inbc(port) \
104({ \
105 unsigned char result; \
106 if (__PORT_PCIO((port))) \
107 __asm__ __volatile__( \
108 "ldrb %0, [%1, %2] @ inbc" \
109 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port))); \
110 else \
111 __asm__ __volatile__( \
112 "ldrb %0, [%1, #0] @ inbc" \
113 : "=r" (result) : "r" ((port))); \
114 result; \
115})
116
117#define __outwc(value,port) \
118({ \
119 unsigned long v = value; \
120 if (__PORT_PCIO((port))) \
121 __asm__ __volatile__( \
122 "strh %0, [%1, %2] @ outwc" \
123 : : "r" (v), "r" (PCIO_BASE), "Jr" ((port))); \
124 else \
125 __asm__ __volatile__( \
126 "strh %0, [%1, #0] @ outwc" \
127 : : "r" (v), "r" ((port))); \
128})
129
130#define __inwc(port) \
131({ \
132 unsigned short result; \
133 if (__PORT_PCIO((port))) \
134 __asm__ __volatile__( \
135 "ldrh %0, [%1, %2] @ inwc" \
136 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port))); \
137 else \
138 __asm__ __volatile__( \
139 "ldrh %0, [%1, #0] @ inwc" \
140 : "=r" (result) : "r" ((port))); \
141 result; \
142})
143
144#define __outlc(value,port) \
145({ \
146 unsigned long v = value; \
147 if (__PORT_PCIO((port))) \
148 __asm__ __volatile__( \
149 "str %0, [%1, %2] @ outlc" \
150 : : "r" (v), "r" (PCIO_BASE), "Jr" ((port))); \
151 else \
152 __asm__ __volatile__( \
153 "str %0, [%1, #0] @ outlc" \
154 : : "r" (v), "r" ((port))); \
155})
156
157#define __inlc(port) \
158({ \
159 unsigned long result; \
160 if (__PORT_PCIO((port))) \
161 __asm__ __volatile__( \
162 "ldr %0, [%1, %2] @ inlc" \
163 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port))); \
164 else \
165 __asm__ __volatile__( \
166 "ldr %0, [%1, #0] @ inlc" \
167 : "=r" (result) : "r" ((port))); \
168 result; \
169})
170
171#define __ioaddrc(port) ((__PORT_PCIO(port) ? PCIO_BASE + (port) : (void __iomem *)(port)))
172
173#define inb(p) (__builtin_constant_p((p)) ? __inbc(p) : __inb(p))
174#define inw(p) (__builtin_constant_p((p)) ? __inwc(p) : __inw(p))
175#define inl(p) (__builtin_constant_p((p)) ? __inlc(p) : __inl(p))
176#define outb(v,p) (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p))
177#define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))
178#define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))
179#define __ioaddr(p) (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p))
180/* the following macro is deprecated */
181#define ioaddr(port) __ioaddr((port))
182
183#define insb(p,d,l) __raw_readsb(__ioaddr(p),d,l)
184#define insw(p,d,l) __raw_readsw(__ioaddr(p),d,l)
185#define insl(p,d,l) __raw_readsl(__ioaddr(p),d,l)
186
187#define outsb(p,d,l) __raw_writesb(__ioaddr(p),d,l)
188#define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l)
189#define outsl(p,d,l) __raw_writesl(__ioaddr(p),d,l)
190
191/*
192 * 1:1 mapping for ioremapped regions.
193 */
194#define __mem_pci(x) (x)
195
196#endif
diff --git a/include/asm-arm/arch-s3c2410/irqs.h b/include/asm-arm/arch-s3c2410/irqs.h
new file mode 100644
index 000000000000..d9773d697268
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/irqs.h
@@ -0,0 +1,126 @@
1/* linux/include/asm-arm/arch-s3c2410/irqs.h
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Changelog:
11 * 12-May-2003 BJD Created file
12 * 08-Jan-2003 BJD Linux 2.6.0 version, moved BAST bits out
13 * 12-Mar-2004 BJD Fixed bug in header protection
14 * 10-Feb-2005 BJD Added camera IRQ from guillaume.gourat@nexvision.tv
15 * 28-Feb-2005 BJD Updated s3c2440 IRQs
16 */
17
18
19#ifndef __ASM_ARCH_IRQS_H
20#define __ASM_ARCH_IRQS_H __FILE__
21
22
23/* we keep the first set of CPU IRQs out of the range of
24 * the ISA space, so that the PC104 has them to itself
25 * and we don't end up having to do horrible things to the
26 * standard ISA drivers....
27 */
28
29#define S3C2410_CPUIRQ_OFFSET (16)
30
31#define S3C2410_IRQ(x) ((x) + S3C2410_CPUIRQ_OFFSET)
32
33/* main cpu interrupts */
34#define IRQ_EINT0 S3C2410_IRQ(0) /* 16 */
35#define IRQ_EINT1 S3C2410_IRQ(1)
36#define IRQ_EINT2 S3C2410_IRQ(2)
37#define IRQ_EINT3 S3C2410_IRQ(3)
38#define IRQ_EINT4t7 S3C2410_IRQ(4) /* 20 */
39#define IRQ_EINT8t23 S3C2410_IRQ(5)
40#define IRQ_RESERVED6 S3C2410_IRQ(6) /* for s3c2410 */
41#define IRQ_CAM S3C2410_IRQ(6) /* for s3c2440 */
42#define IRQ_BATT_FLT S3C2410_IRQ(7)
43#define IRQ_TICK S3C2410_IRQ(8) /* 24 */
44#define IRQ_WDT S3C2410_IRQ(9)
45#define IRQ_TIMER0 S3C2410_IRQ(10)
46#define IRQ_TIMER1 S3C2410_IRQ(11)
47#define IRQ_TIMER2 S3C2410_IRQ(12)
48#define IRQ_TIMER3 S3C2410_IRQ(13)
49#define IRQ_TIMER4 S3C2410_IRQ(14)
50#define IRQ_UART2 S3C2410_IRQ(15)
51#define IRQ_LCD S3C2410_IRQ(16) /* 32 */
52#define IRQ_DMA0 S3C2410_IRQ(17)
53#define IRQ_DMA1 S3C2410_IRQ(18)
54#define IRQ_DMA2 S3C2410_IRQ(19)
55#define IRQ_DMA3 S3C2410_IRQ(20)
56#define IRQ_SDI S3C2410_IRQ(21)
57#define IRQ_SPI0 S3C2410_IRQ(22)
58#define IRQ_UART1 S3C2410_IRQ(23)
59#define IRQ_RESERVED24 S3C2410_IRQ(24) /* 40 */
60#define IRQ_NFCON S3C2410_IRQ(24) /* for s3c2440 */
61#define IRQ_USBD S3C2410_IRQ(25)
62#define IRQ_USBH S3C2410_IRQ(26)
63#define IRQ_IIC S3C2410_IRQ(27)
64#define IRQ_UART0 S3C2410_IRQ(28) /* 44 */
65#define IRQ_SPI1 S3C2410_IRQ(29)
66#define IRQ_RTC S3C2410_IRQ(30)
67#define IRQ_ADCPARENT S3C2410_IRQ(31)
68
69/* interrupts generated from the external interrupts sources */
70#define IRQ_EINT4 S3C2410_IRQ(32) /* 48 */
71#define IRQ_EINT5 S3C2410_IRQ(33)
72#define IRQ_EINT6 S3C2410_IRQ(34)
73#define IRQ_EINT7 S3C2410_IRQ(35)
74#define IRQ_EINT8 S3C2410_IRQ(36)
75#define IRQ_EINT9 S3C2410_IRQ(37)
76#define IRQ_EINT10 S3C2410_IRQ(38)
77#define IRQ_EINT11 S3C2410_IRQ(39)
78#define IRQ_EINT12 S3C2410_IRQ(40)
79#define IRQ_EINT13 S3C2410_IRQ(41)
80#define IRQ_EINT14 S3C2410_IRQ(42)
81#define IRQ_EINT15 S3C2410_IRQ(43)
82#define IRQ_EINT16 S3C2410_IRQ(44)
83#define IRQ_EINT17 S3C2410_IRQ(45)
84#define IRQ_EINT18 S3C2410_IRQ(46)
85#define IRQ_EINT19 S3C2410_IRQ(47)
86#define IRQ_EINT20 S3C2410_IRQ(48) /* 64 */
87#define IRQ_EINT21 S3C2410_IRQ(49)
88#define IRQ_EINT22 S3C2410_IRQ(50)
89#define IRQ_EINT23 S3C2410_IRQ(51)
90
91
92#define IRQ_EINT(x) S3C2410_IRQ((x >= 4) ? (IRQ_EINT4 + (x) - 4) : (S3C2410_IRQ(0) + (x)))
93
94#define IRQ_LCD_FIFO S3C2410_IRQ(52)
95#define IRQ_LCD_FRAME S3C2410_IRQ(53)
96
97/* IRQs for the interal UARTs, and ADC
98 * these need to be ordered in number of appearance in the
99 * SUBSRC mask register
100*/
101#define IRQ_S3CUART_RX0 S3C2410_IRQ(54) /* 70 */
102#define IRQ_S3CUART_TX0 S3C2410_IRQ(55) /* 71 */
103#define IRQ_S3CUART_ERR0 S3C2410_IRQ(56)
104
105#define IRQ_S3CUART_RX1 S3C2410_IRQ(57)
106#define IRQ_S3CUART_TX1 S3C2410_IRQ(58)
107#define IRQ_S3CUART_ERR1 S3C2410_IRQ(59)
108
109#define IRQ_S3CUART_RX2 S3C2410_IRQ(60)
110#define IRQ_S3CUART_TX2 S3C2410_IRQ(61)
111#define IRQ_S3CUART_ERR2 S3C2410_IRQ(62)
112
113#define IRQ_TC S3C2410_IRQ(63)
114#define IRQ_ADC S3C2410_IRQ(64)
115
116/* extra irqs for s3c2440 */
117
118#define IRQ_S3C2440_CAM_C S3C2410_IRQ(65)
119#define IRQ_S3C2440_CAM_P S3C2410_IRQ(66)
120#define IRQ_S3C2440_WDT S3C2410_IRQ(67)
121#define IRQ_S3C2440_AC97 S3C2410_IRQ(68)
122
123#define NR_IRQS (IRQ_S3C2440_AC97+1)
124
125
126#endif /* __ASM_ARCH_IRQ_H */
diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h
new file mode 100644
index 000000000000..1833ea5c4220
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/map.h
@@ -0,0 +1,192 @@
1/* linux/include/asm-arm/arch-s3c2410/map.h
2 *
3 * (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - Memory map 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 * Changelog:
13 * 12-May-2003 BJD Created file
14 * 06-Jan-2003 BJD Linux 2.6.0 version, moved bast specifics out
15 * 10-Feb-2005 BJD Added CAMIF definition from guillaume.gourat@nexvision.tv
16 * 10-Mar-2005 LCVR Added support to S3C2400, changed {VA,SZ} names
17*/
18
19#ifndef __ASM_ARCH_MAP_H
20#define __ASM_ARCH_MAP_H
21
22/* we have a bit of a tight squeeze to fit all our registers from
23 * 0xF00000000 upwards, since we use all of the nGCS space in some
24 * capacity, and also need to fit the S3C2410 registers in as well...
25 *
26 * we try to ensure stuff like the IRQ registers are available for
27 * an single MOVS instruction (ie, only 8 bits of set data)
28 *
29 * Note, we are trying to remove some of these from the implementation
30 * as they are only useful to certain drivers...
31 */
32
33#ifndef __ASSEMBLY__
34#define S3C2410_ADDR(x) ((void __iomem *)0xF0000000 + (x))
35#else
36#define S3C2410_ADDR(x) (0xF0000000 + (x))
37#endif
38
39#define S3C2400_ADDR(x) S3C2410_ADDR(x)
40
41/* interrupt controller is the first thing we put in, to make
42 * the assembly code for the irq detection easier
43 */
44#define S3C24XX_VA_IRQ S3C2410_ADDR(0x00000000)
45#define S3C2400_PA_IRQ (0x14400000)
46#define S3C2410_PA_IRQ (0x4A000000)
47#define S3C24XX_SZ_IRQ SZ_1M
48
49/* memory controller registers */
50#define S3C24XX_VA_MEMCTRL S3C2410_ADDR(0x00100000)
51#define S3C2400_PA_MEMCTRL (0x14000000)
52#define S3C2410_PA_MEMCTRL (0x48000000)
53#define S3C24XX_SZ_MEMCTRL SZ_1M
54
55/* USB host controller */
56#define S3C24XX_VA_USBHOST S3C2410_ADDR(0x00200000)
57#define S3C2400_PA_USBHOST (0x14200000)
58#define S3C2410_PA_USBHOST (0x49000000)
59#define S3C24XX_SZ_USBHOST SZ_1M
60
61/* DMA controller */
62#define S3C24XX_VA_DMA S3C2410_ADDR(0x00300000)
63#define S3C2400_PA_DMA (0x14600000)
64#define S3C2410_PA_DMA (0x4B000000)
65#define S3C24XX_SZ_DMA SZ_1M
66
67/* Clock and Power management */
68#define S3C24XX_VA_CLKPWR S3C2410_ADDR(0x00400000)
69#define S3C2400_PA_CLKPWR (0x14800000)
70#define S3C2410_PA_CLKPWR (0x4C000000)
71#define S3C24XX_SZ_CLKPWR SZ_1M
72
73/* LCD controller */
74#define S3C24XX_VA_LCD S3C2410_ADDR(0x00600000)
75#define S3C2400_PA_LCD (0x14A00000)
76#define S3C2410_PA_LCD (0x4D000000)
77#define S3C24XX_SZ_LCD SZ_1M
78
79/* NAND flash controller */
80#define S3C24XX_VA_NAND S3C2410_ADDR(0x00700000)
81#define S3C2410_PA_NAND (0x4E000000)
82#define S3C24XX_SZ_NAND SZ_1M
83
84/* MMC controller - available on the S3C2400 */
85#define S3C2400_VA_MMC S3C2400_ADDR(0x00700000)
86#define S3C2400_PA_MMC (0x15A00000)
87#define S3C2400_SZ_MMC SZ_1M
88
89/* UARTs */
90#define S3C24XX_VA_UART S3C2410_ADDR(0x00800000)
91#define S3C2400_PA_UART (0x15000000)
92#define S3C2410_PA_UART (0x50000000)
93#define S3C24XX_SZ_UART SZ_1M
94
95/* Timers */
96#define S3C24XX_VA_TIMER S3C2410_ADDR(0x00900000)
97#define S3C2400_PA_TIMER (0x15100000)
98#define S3C2410_PA_TIMER (0x51000000)
99#define S3C24XX_SZ_TIMER SZ_1M
100
101/* USB Device port */
102#define S3C24XX_VA_USBDEV S3C2410_ADDR(0x00A00000)
103#define S3C2400_PA_USBDEV (0x15200140)
104#define S3C2410_PA_USBDEV (0x52000000)
105#define S3C24XX_SZ_USBDEV SZ_1M
106
107/* Watchdog */
108#define S3C24XX_VA_WATCHDOG S3C2410_ADDR(0x00B00000)
109#define S3C2400_PA_WATCHDOG (0x15300000)
110#define S3C2410_PA_WATCHDOG (0x53000000)
111#define S3C24XX_SZ_WATCHDOG SZ_1M
112
113/* IIC hardware controller */
114#define S3C24XX_VA_IIC S3C2410_ADDR(0x00C00000)
115#define S3C2400_PA_IIC (0x15400000)
116#define S3C2410_PA_IIC (0x54000000)
117#define S3C24XX_SZ_IIC SZ_1M
118
119#define VA_IIC_BASE (S3C24XX_VA_IIC)
120
121/* IIS controller */
122#define S3C24XX_VA_IIS S3C2410_ADDR(0x00D00000)
123#define S3C2400_PA_IIS (0x15508000)
124#define S3C2410_PA_IIS (0x55000000)
125#define S3C24XX_SZ_IIS SZ_1M
126
127/* GPIO ports */
128#define S3C24XX_VA_GPIO S3C2410_ADDR(0x00E00000)
129#define S3C2400_PA_GPIO (0x15600000)
130#define S3C2410_PA_GPIO (0x56000000)
131#define S3C24XX_SZ_GPIO SZ_1M
132
133/* RTC */
134#define S3C24XX_VA_RTC S3C2410_ADDR(0x00F00000)
135#define S3C2400_PA_RTC (0x15700040)
136#define S3C2410_PA_RTC (0x57000000)
137#define S3C24XX_SZ_RTC SZ_1M
138
139/* ADC */
140#define S3C24XX_VA_ADC S3C2410_ADDR(0x01000000)
141#define S3C2400_PA_ADC (0x15800000)
142#define S3C2410_PA_ADC (0x58000000)
143#define S3C24XX_SZ_ADC SZ_1M
144
145/* SPI */
146#define S3C24XX_VA_SPI S3C2410_ADDR(0x01100000)
147#define S3C2400_PA_SPI (0x15900000)
148#define S3C2410_PA_SPI (0x59000000)
149#define S3C24XX_SZ_SPI SZ_1M
150
151/* SDI */
152#define S3C24XX_VA_SDI S3C2410_ADDR(0x01200000)
153#define S3C2410_PA_SDI (0x5A000000)
154#define S3C24XX_SZ_SDI SZ_1M
155
156/* CAMIF */
157#define S3C2440_PA_CAMIF (0x4F000000)
158#define S3C2440_SZ_CAMIF SZ_1M
159
160/* ISA style IO, for each machine to sort out mappings for, if it
161 * implements it. We reserve two 16M regions for ISA.
162 */
163
164#define S3C24XX_VA_ISA_WORD S3C2410_ADDR(0x02000000)
165#define S3C24XX_VA_ISA_BYTE S3C2410_ADDR(0x03000000)
166
167/* physical addresses of all the chip-select areas */
168
169#define S3C2410_CS0 (0x00000000)
170#define S3C2410_CS1 (0x08000000)
171#define S3C2410_CS2 (0x10000000)
172#define S3C2410_CS3 (0x18000000)
173#define S3C2410_CS4 (0x20000000)
174#define S3C2410_CS5 (0x28000000)
175#define S3C2410_CS6 (0x30000000)
176#define S3C2410_CS7 (0x38000000)
177
178#define S3C2410_SDRAM_PA (S3C2410_CS6)
179
180#define S3C2400_CS0 (0x00000000)
181#define S3C2400_CS1 (0x02000000)
182#define S3C2400_CS2 (0x04000000)
183#define S3C2400_CS3 (0x06000000)
184#define S3C2400_CS4 (0x08000000)
185#define S3C2400_CS5 (0x0A000000)
186#define S3C2400_CS6 (0x0C000000)
187#define S3C2400_CS7 (0x0E000000)
188
189#define S3C2400_SDRAM_PA (S3C2400_CS6)
190
191
192#endif /* __ASM_ARCH_MAP_H */
diff --git a/include/asm-arm/arch-s3c2410/memory.h b/include/asm-arm/arch-s3c2410/memory.h
new file mode 100644
index 000000000000..3380ab1d0749
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/memory.h
@@ -0,0 +1,44 @@
1/*
2 * linux/include/asm-arm/arch-s3c2410/memory.h
3 *
4 * from linux/include/asm-arm/arch-rpc/memory.h
5 *
6 * Copyright (C) 1996,1997,1998 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 * Changelog:
13 * 20-Oct-1996 RMK Created
14 * 31-Dec-1997 RMK Fixed definitions to reduce warnings
15 * 11-Jan-1998 RMK Uninlined to reduce hits on cache
16 * 08-Feb-1998 RMK Added __virt_to_bus and __bus_to_virt
17 * 21-Mar-1999 RMK Renamed to memory.h
18 * RMK Added TASK_SIZE and PAGE_OFFSET
19 * 05-Apr-2004 BJD Copied and altered for arch-s3c2410
20 * 17-Mar-2005 LCVR Modified for S3C2400
21*/
22
23#ifndef __ASM_ARCH_MEMORY_H
24#define __ASM_ARCH_MEMORY_H
25
26/*
27 * DRAM starts at 0x30000000 for S3C2410/S3C2440
28 * and at 0x0C000000 for S3C2400
29 */
30#ifdef CONFIG_CPU_S3C2400
31#define PHYS_OFFSET (0x0C000000UL)
32#else
33#define PHYS_OFFSET (0x30000000UL)
34#endif
35
36/*
37 * These are exactly the same on the S3C2410 as the
38 * physical memory view.
39*/
40
41#define __virt_to_bus(x) __virt_to_phys(x)
42#define __bus_to_virt(x) __phys_to_virt(x)
43
44#endif
diff --git a/include/asm-arm/arch-s3c2410/nand.h b/include/asm-arm/arch-s3c2410/nand.h
new file mode 100644
index 000000000000..9148ac045b0d
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/nand.h
@@ -0,0 +1,48 @@
1/* linux/include/asm-arm/arch-s3c2410/nand.h
2 *
3 * (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - NAND device controller platfrom_device info
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 * Changelog:
13 * 23-Sep-2004 BJD Created file
14*/
15
16/* struct s3c2410_nand_set
17 *
18 * define an set of one or more nand chips registered with an unique mtd
19 *
20 * nr_chips = number of chips in this set
21 * nr_partitions = number of partitions pointed to be partitoons (or zero)
22 * name = name of set (optional)
23 * nr_map = map for low-layer logical to physical chip numbers (option)
24 * partitions = mtd partition list
25*/
26
27struct s3c2410_nand_set {
28 int nr_chips;
29 int nr_partitions;
30 char *name;
31 int *nr_map;
32 struct mtd_partition *partitions;
33};
34
35struct s3c2410_platform_nand {
36 /* timing information for controller, all times in nanoseconds */
37
38 int tacls; /* time for active CLE/ALE to nWE/nOE */
39 int twrph0; /* active time for nWE/nOE */
40 int twrph1; /* time for release CLE/ALE from nWE/nOE inactive */
41
42 int nr_sets;
43 struct s3c2410_nand_set *sets;
44
45 void (*select_chip)(struct s3c2410_nand_set *,
46 int chip);
47};
48
diff --git a/include/asm-arm/arch-s3c2410/otom-map.h b/include/asm-arm/arch-s3c2410/otom-map.h
new file mode 100644
index 000000000000..e40c93429854
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/otom-map.h
@@ -0,0 +1,30 @@
1/* linux/include/asm-arm/arch-s3c2410/otom-map.h
2 *
3 * (c) 2005 Guillaume GOURAT / NexVision
4 * guillaume.gourat@nexvision.fr
5 *
6 * NexVision OTOM board memory map 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
13/* needs arch/map.h including with this */
14
15/* ok, we've used up to 0x01300000, now we need to find space for the
16 * peripherals that live in the nGCS[x] areas, which are quite numerous
17 * in their space.
18 */
19
20#ifndef __ASM_ARCH_OTOMMAP_H
21#define __ASM_ARCH_OTOMMAP_H
22
23#define OTOM_PA_CS8900A_BASE (S3C2410_CS3 + 0x01000000) /* nGCS3 +0x01000000 */
24#define OTOM_VA_CS8900A_BASE S3C2410_ADDR(0x04000000) /* 0xF4000000 */
25
26/* physical offset addresses for the peripherals */
27
28#define OTOM_PA_FLASH0_BASE (S3C2410_CS0) /* Bank 0 */
29
30#endif /* __ASM_ARCH_OTOMMAP_H */
diff --git a/include/asm-arm/arch-s3c2410/param.h b/include/asm-arm/arch-s3c2410/param.h
new file mode 100644
index 000000000000..483d3f149883
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/param.h
@@ -0,0 +1,27 @@
1/* linux/include/asm-arm/arch-s3c2410/param.h
2 *
3 * (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - Machine parameters
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 * Changelog:
13 * 02-Sep-2003 BJD Created file
14 * 12-Mar-2004 BJD Added include protection
15*/
16
17#ifndef __ASM_ARCH_PARAM_H
18#define __ASM_ARCH_PARAM_H
19
20/* we cannot get our timer down to 100Hz with the setup as is, but we can
21 * manage 200 clock ticks per second... if this is a problem, we can always
22 * add a software pre-scaler to the evil timer systems.
23*/
24
25#define HZ 200
26
27#endif /* __ASM_ARCH_PARAM_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-adc.h b/include/asm-arm/arch-s3c2410/regs-adc.h
new file mode 100644
index 000000000000..15bfc2f5754e
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-adc.h
@@ -0,0 +1,63 @@
1/* linux/include/asm/arch-s3c2410/regs-adc.h
2 *
3 * Copyright (c) 2004 Shannon Holland <holland@loser.net>
4 *
5 * This program is free software; yosu can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * S3C2410 ADC registers
10 *
11 * Changelog:
12 * 27-09-2004 SAH Created file
13*/
14
15#ifndef __ASM_ARCH_REGS_ADC_H
16#define __ASM_ARCH_REGS_ADC_H "regs-adc.h"
17
18#define S3C2410_ADCREG(x) (x)
19
20#define S3C2410_ADCCON S3C2410_ADCREG(0x00)
21#define S3C2410_ADCTSC S3C2410_ADCREG(0x04)
22#define S3C2410_ADCDLY S3C2410_ADCREG(0x08)
23#define S3C2410_ADCDAT0 S3C2410_ADCREG(0x0C)
24#define S3C2410_ADCDAT1 S3C2410_ADCREG(0x10)
25
26
27/* ADCCON Register Bits */
28#define S3C2410_ADCCON_ECFLG (1<<15)
29#define S3C2410_ADCCON_PRSCEN (1<<14)
30#define S3C2410_ADCCON_PRSCVL(x) (((x)&0xFF)<<6)
31#define S3C2410_ADCCON_PRSCVLMASK (0xFF<<6)
32#define S3C2410_ADCCON_SELMUX(x) (((x)&0x7)<<3)
33#define S3C2410_ADCCON_MUXMASK (0x7<<3)
34#define S3C2410_ADCCON_STDBM (1<<2)
35#define S3C2410_ADCCON_READ_START (1<<1)
36#define S3C2410_ADCCON_ENABLE_START (1<<0)
37#define S3C2410_ADCCON_STARTMASK (0x3<<0)
38
39
40/* ADCTSC Register Bits */
41#define S3C2410_ADCTSC_YM_SEN (1<<7)
42#define S3C2410_ADCTSC_YP_SEN (1<<6)
43#define S3C2410_ADCTSC_XM_SEN (1<<5)
44#define S3C2410_ADCTSC_XP_SEN (1<<4)
45#define S3C2410_ADCTSC_PULL_UP_DISABLE (1<<3)
46#define S3C2410_ADCTSC_AUTO_PST (1<<2)
47#define S3C2410_ADCTSC_XY_PST (0x3<<0)
48
49/* ADCDAT0 Bits */
50#define S3C2410_ADCDAT0_UPDOWN (1<<15)
51#define S3C2410_ADCDAT0_AUTO_PST (1<<14)
52#define S3C2410_ADCDAT0_XY_PST (0x3<<12)
53#define S3C2410_ADCDAT0_XPDATA_MASK (0x03FF)
54
55/* ADCDAT1 Bits */
56#define S3C2410_ADCDAT1_UPDOWN (1<<15)
57#define S3C2410_ADCDAT1_AUTO_PST (1<<14)
58#define S3C2410_ADCDAT1_XY_PST (0x3<<12)
59#define S3C2410_ADCDAT1_YPDATA_MASK (0x03FF)
60
61#endif /* __ASM_ARCH_REGS_ADC_H */
62
63
diff --git a/include/asm-arm/arch-s3c2410/regs-clock.h b/include/asm-arm/arch-s3c2410/regs-clock.h
new file mode 100644
index 000000000000..e5e938b79acc
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-clock.h
@@ -0,0 +1,122 @@
1/* linux/include/asm/arch-s3c2410/regs-clock.h
2 *
3 * Copyright (c) 2003,2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 clock register definitions
11 *
12 * Changelog:
13 * 18-Aug-2004 Ben Dooks Added 2440 definitions
14 * 08-Aug-2004 Herbert Pötzl Added CLKCON definitions
15 * 19-06-2003 Ben Dooks Created file
16 * 12-03-2004 Ben Dooks Updated include protection
17 * 29-Sep-2004 Ben Dooks Fixed usage for assembly inclusion
18 * 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat)
19 * 10-Mar-2005 Lucas Villa Real Changed S3C2410_VA to S3C24XX_VA
20 */
21
22#ifndef __ASM_ARM_REGS_CLOCK
23#define __ASM_ARM_REGS_CLOCK "$Id: clock.h,v 1.4 2003/04/30 14:50:51 ben Exp $"
24
25#define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
26
27#define S3C2410_PLLVAL(_m,_p,_s) ((_m) << 12 | ((_p) << 4) | ((_s)))
28
29#define S3C2410_LOCKTIME S3C2410_CLKREG(0x00)
30#define S3C2410_MPLLCON S3C2410_CLKREG(0x04)
31#define S3C2410_UPLLCON S3C2410_CLKREG(0x08)
32#define S3C2410_CLKCON S3C2410_CLKREG(0x0C)
33#define S3C2410_CLKSLOW S3C2410_CLKREG(0x10)
34#define S3C2410_CLKDIVN S3C2410_CLKREG(0x14)
35
36#define S3C2410_CLKCON_IDLE (1<<2)
37#define S3C2410_CLKCON_POWER (1<<3)
38#define S3C2410_CLKCON_NAND (1<<4)
39#define S3C2410_CLKCON_LCDC (1<<5)
40#define S3C2410_CLKCON_USBH (1<<6)
41#define S3C2410_CLKCON_USBD (1<<7)
42#define S3C2410_CLKCON_PWMT (1<<8)
43#define S3C2410_CLKCON_SDI (1<<9)
44#define S3C2410_CLKCON_UART0 (1<<10)
45#define S3C2410_CLKCON_UART1 (1<<11)
46#define S3C2410_CLKCON_UART2 (1<<12)
47#define S3C2410_CLKCON_GPIO (1<<13)
48#define S3C2410_CLKCON_RTC (1<<14)
49#define S3C2410_CLKCON_ADC (1<<15)
50#define S3C2410_CLKCON_IIC (1<<16)
51#define S3C2410_CLKCON_IIS (1<<17)
52#define S3C2410_CLKCON_SPI (1<<18)
53
54#define S3C2410_PLLCON_MDIVSHIFT 12
55#define S3C2410_PLLCON_PDIVSHIFT 4
56#define S3C2410_PLLCON_SDIVSHIFT 0
57#define S3C2410_PLLCON_MDIVMASK ((1<<(1+(19-12)))-1)
58#define S3C2410_PLLCON_PDIVMASK ((1<<5)-1)
59#define S3C2410_PLLCON_SDIVMASK 3
60
61/* DCLKCON register addresses in gpio.h */
62
63#define S3C2410_DCLKCON_DCLK0EN (1<<0)
64#define S3C2410_DCLKCON_DCLK0_PCLK (0<<1)
65#define S3C2410_DCLKCON_DCLK0_UCLK (1<<1)
66#define S3C2410_DCLKCON_DCLK0_DIV(x) (((x) - 1 )<<4)
67#define S3C2410_DCLKCON_DCLK0_CMP(x) (((x) - 1 )<<8)
68
69#define S3C2410_DCLKCON_DCLK1EN (1<<16)
70#define S3C2410_DCLKCON_DCLK1_PCLK (0<<17)
71#define S3C2410_DCLKCON_DCLK1_UCLK (1<<17)
72#define S3C2410_DCLKCON_DCLK1_DIV(x) (((x) - 1) <<20)
73
74#define S3C2410_CLKDIVN_PDIVN (1<<0)
75#define S3C2410_CLKDIVN_HDIVN (1<<1)
76
77#ifndef __ASSEMBLY__
78
79static inline unsigned int
80s3c2410_get_pll(int pllval, int baseclk)
81{
82 int mdiv, pdiv, sdiv;
83
84 mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT;
85 pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT;
86 sdiv = pllval >> S3C2410_PLLCON_SDIVSHIFT;
87
88 mdiv &= S3C2410_PLLCON_MDIVMASK;
89 pdiv &= S3C2410_PLLCON_PDIVMASK;
90 sdiv &= S3C2410_PLLCON_SDIVMASK;
91
92 return (baseclk * (mdiv + 8)) / ((pdiv + 2) << sdiv);
93}
94
95#endif /* __ASSEMBLY__ */
96
97#ifdef CONFIG_CPU_S3C2440
98
99/* extra registers */
100#define S3C2440_CAMDIVN S3C2410_CLKREG(0x18)
101
102#define S3C2440_CLKCON_CAMERA (1<<19)
103#define S3C2440_CLKCON_AC97 (1<<20)
104
105#define S3C2440_CLKDIVN_PDIVN (1<<0)
106#define S3C2440_CLKDIVN_HDIVN_MASK (3<<1)
107#define S3C2440_CLKDIVN_HDIVN_1 (0<<1)
108#define S3C2440_CLKDIVN_HDIVN_2 (1<<1)
109#define S3C2440_CLKDIVN_HDIVN_4_8 (2<<1)
110#define S3C2440_CLKDIVN_HDIVN_3_6 (3<<1)
111#define S3C2440_CLKDIVN_UCLK (1<<3)
112
113#define S3C2440_CAMDIVN_CAMCLK_MASK (0xf<<0)
114#define S3C2440_CAMDIVN_CAMCLK_SEL (1<<4)
115#define S3C2440_CAMDIVN_HCLK3_HALF (1<<8)
116#define S3C2440_CAMDIVN_HCLK4_HALF (1<<9)
117#define S3C2440_CAMDIVN_DVSEN (1<<12)
118
119#endif /* CONFIG_CPU_S3C2440 */
120
121
122#endif /* __ASM_ARM_REGS_CLOCK */
diff --git a/include/asm-arm/arch-s3c2410/regs-dsc.h b/include/asm-arm/arch-s3c2410/regs-dsc.h
new file mode 100644
index 000000000000..a023b0434efe
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-dsc.h
@@ -0,0 +1,183 @@
1/* linux/include/asm/hardware/s3c2410/regs-dsc.h
2 *
3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2440 Signal Drive Strength Control
11 *
12 * Changelog:
13 * 11-Aug-2004 BJD Created file
14 * 25-Aug-2004 BJD Added the _SELECT_* defs for using with functions
15*/
16
17
18#ifndef __ASM_ARCH_REGS_DSC_H
19#define __ASM_ARCH_REGS_DSC_H "2440-dsc"
20
21#ifdef CONFIG_CPU_S3C2440
22
23#define S3C2440_DSC0 S3C2410_GPIOREG(0xc4)
24#define S3C2440_DSC1 S3C2410_GPIOREG(0xc8)
25
26#define S3C2440_SELECT_DSC0 (0)
27#define S3C2440_SELECT_DSC1 (1<<31)
28
29#define S3C2440_DSC_GETSHIFT(x) ((x) & 31)
30
31#define S3C2440_DSC0_DISABLE (1<<31)
32
33#define S3C2440_DSC0_ADDR (S3C2440_SELECT_DSC0 | 8)
34#define S3C2440_DSC0_ADDR_12mA (0<<8)
35#define S3C2440_DSC0_ADDR_10mA (1<<8)
36#define S3C2440_DSC0_ADDR_8mA (2<<8)
37#define S3C2440_DSC0_ADDR_6mA (3<<8)
38#define S3C2440_DSC0_ADDR_MASK (3<<8)
39
40/* D24..D31 */
41#define S3C2440_DSC0_DATA3 (S3C2440_SELECT_DSC0 | 6)
42#define S3C2440_DSC0_DATA3_12mA (0<<6)
43#define S3C2440_DSC0_DATA3_10mA (1<<6)
44#define S3C2440_DSC0_DATA3_8mA (2<<6)
45#define S3C2440_DSC0_DATA3_6mA (3<<6)
46#define S3C2440_DSC0_DATA3_MASK (3<<6)
47
48/* D16..D23 */
49#define S3C2440_DSC0_DATA2 (S3C2440_SELECT_DSC0 | 4)
50#define S3C2440_DSC0_DATA2_12mA (0<<4)
51#define S3C2440_DSC0_DATA2_10mA (1<<4)
52#define S3C2440_DSC0_DATA2_8mA (2<<4)
53#define S3C2440_DSC0_DATA2_6mA (3<<4)
54#define S3C2440_DSC0_DATA2_MASK (3<<4)
55
56/* D8..D15 */
57#define S3C2440_DSC0_DATA1 (S3C2440_SELECT_DSC0 | 2)
58#define S3C2440_DSC0_DATA1_12mA (0<<2)
59#define S3C2440_DSC0_DATA1_10mA (1<<2)
60#define S3C2440_DSC0_DATA1_8mA (2<<2)
61#define S3C2440_DSC0_DATA1_6mA (3<<2)
62#define S3C2440_DSC0_DATA1_MASK (3<<2)
63
64/* D0..D7 */
65#define S3C2440_DSC0_DATA0 (S3C2440_SELECT_DSC0 | 0)
66#define S3C2440_DSC0_DATA0_12mA (0<<0)
67#define S3C2440_DSC0_DATA0_10mA (1<<0)
68#define S3C2440_DSC0_DATA0_8mA (2<<0)
69#define S3C2440_DSC0_DATA0_6mA (3<<0)
70#define S3C2440_DSC0_DATA0_MASK (3<<0)
71
72#define S3C2440_DSC1_SCK1 (S3C2440_SELECT_DSC1 | 28)
73#define S3C2440_DSC1_SCK1_12mA (0<<28)
74#define S3C2440_DSC1_SCK1_10mA (1<<28)
75#define S3C2440_DSC1_SCK1_8mA (2<<28)
76#define S3C2440_DSC1_SCK1_6mA (3<<28)
77#define S3C2440_DSC1_SCK1_MASK (3<<28)
78
79#define S3C2440_DSC1_SCK0 (S3C2440_SELECT_DSC1 | 26)
80#define S3C2440_DSC1_SCK0_12mA (0<<26)
81#define S3C2440_DSC1_SCK0_10mA (1<<26)
82#define S3C2440_DSC1_SCK0_8mA (2<<26)
83#define S3C2440_DSC1_SCK0_6mA (3<<26)
84#define S3C2440_DSC1_SCK0_MASK (3<<26)
85
86#define S3C2440_DSC1_SCKE (S3C2440_SELECT_DSC1 | 24)
87#define S3C2440_DSC1_SCKE_10mA (0<<24)
88#define S3C2440_DSC1_SCKE_8mA (1<<24)
89#define S3C2440_DSC1_SCKE_6mA (2<<24)
90#define S3C2440_DSC1_SCKE_4mA (3<<24)
91#define S3C2440_DSC1_SCKE_MASK (3<<24)
92
93/* SDRAM nRAS/nCAS */
94#define S3C2440_DSC1_SDR (S3C2440_SELECT_DSC1 | 22)
95#define S3C2440_DSC1_SDR_10mA (0<<22)
96#define S3C2440_DSC1_SDR_8mA (1<<22)
97#define S3C2440_DSC1_SDR_6mA (2<<22)
98#define S3C2440_DSC1_SDR_4mA (3<<22)
99#define S3C2440_DSC1_SDR_MASK (3<<22)
100
101/* NAND Flash Controller */
102#define S3C2440_DSC1_NFC (S3C2440_SELECT_DSC1 | 20)
103#define S3C2440_DSC1_NFC_10mA (0<<20)
104#define S3C2440_DSC1_NFC_8mA (1<<20)
105#define S3C2440_DSC1_NFC_6mA (2<<20)
106#define S3C2440_DSC1_NFC_4mA (3<<20)
107#define S3C2440_DSC1_NFC_MASK (3<<20)
108
109/* nBE[0..3] */
110#define S3C2440_DSC1_nBE (S3C2440_SELECT_DSC1 | 18)
111#define S3C2440_DSC1_nBE_10mA (0<<18)
112#define S3C2440_DSC1_nBE_8mA (1<<18)
113#define S3C2440_DSC1_nBE_6mA (2<<18)
114#define S3C2440_DSC1_nBE_4mA (3<<18)
115#define S3C2440_DSC1_nBE_MASK (3<<18)
116
117#define S3C2440_DSC1_WOE (S3C2440_SELECT_DSC1 | 16)
118#define S3C2440_DSC1_WOE_10mA (0<<16)
119#define S3C2440_DSC1_WOE_8mA (1<<16)
120#define S3C2440_DSC1_WOE_6mA (2<<16)
121#define S3C2440_DSC1_WOE_4mA (3<<16)
122#define S3C2440_DSC1_WOE_MASK (3<<16)
123
124#define S3C2440_DSC1_CS7 (S3C2440_SELECT_DSC1 | 14)
125#define S3C2440_DSC1_CS7_10mA (0<<14)
126#define S3C2440_DSC1_CS7_8mA (1<<14)
127#define S3C2440_DSC1_CS7_6mA (2<<14)
128#define S3C2440_DSC1_CS7_4mA (3<<14)
129#define S3C2440_DSC1_CS7_MASK (3<<14)
130
131#define S3C2440_DSC1_CS6 (S3C2440_SELECT_DSC1 | 12)
132#define S3C2440_DSC1_CS6_10mA (0<<12)
133#define S3C2440_DSC1_CS6_8mA (1<<12)
134#define S3C2440_DSC1_CS6_6mA (2<<12)
135#define S3C2440_DSC1_CS6_4mA (3<<12)
136#define S3C2440_DSC1_CS6_MASK (3<<12)
137
138#define S3C2440_DSC1_CS5 (S3C2440_SELECT_DSC1 | 10)
139#define S3C2440_DSC1_CS5_10mA (0<<10)
140#define S3C2440_DSC1_CS5_8mA (1<<10)
141#define S3C2440_DSC1_CS5_6mA (2<<10)
142#define S3C2440_DSC1_CS5_4mA (3<<10)
143#define S3C2440_DSC1_CS5_MASK (3<<10)
144
145#define S3C2440_DSC1_CS4 (S3C2440_SELECT_DSC1 | 8)
146#define S3C2440_DSC1_CS4_10mA (0<<8)
147#define S3C2440_DSC1_CS4_8mA (1<<8)
148#define S3C2440_DSC1_CS4_6mA (2<<8)
149#define S3C2440_DSC1_CS4_4mA (3<<8)
150#define S3C2440_DSC1_CS4_MASK (3<<8)
151
152#define S3C2440_DSC1_CS3 (S3C2440_SELECT_DSC1 | 6)
153#define S3C2440_DSC1_CS3_10mA (0<<6)
154#define S3C2440_DSC1_CS3_8mA (1<<6)
155#define S3C2440_DSC1_CS3_6mA (2<<6)
156#define S3C2440_DSC1_CS3_4mA (3<<6)
157#define S3C2440_DSC1_CS3_MASK (3<<6)
158
159#define S3C2440_DSC1_CS2 (S3C2440_SELECT_DSC1 | 4)
160#define S3C2440_DSC1_CS2_10mA (0<<4)
161#define S3C2440_DSC1_CS2_8mA (1<<4)
162#define S3C2440_DSC1_CS2_6mA (2<<4)
163#define S3C2440_DSC1_CS2_4mA (3<<4)
164#define S3C2440_DSC1_CS2_MASK (3<<4)
165
166#define S3C2440_DSC1_CS1 (S3C2440_SELECT_DSC1 | 2)
167#define S3C2440_DSC1_CS1_10mA (0<<2)
168#define S3C2440_DSC1_CS1_8mA (1<<2)
169#define S3C2440_DSC1_CS1_6mA (2<<2)
170#define S3C2440_DSC1_CS1_4mA (3<<2)
171#define S3C2440_DSC1_CS1_MASK (3<<2)
172
173#define S3C2440_DSC1_CS0 (S3C2440_SELECT_DSC1 | 0
174#define S3C2440_DSC1_CS0_10mA (0<<0)
175#define S3C2440_DSC1_CS0_8mA (1<<0)
176#define S3C2440_DSC1_CS0_6mA (2<<0)
177#define S3C2440_DSC1_CS0_4mA (3<<0)
178#define S3C2440_DSC1_CS0_MASK (3<<0)
179
180#endif /* CONFIG_CPU_S3C2440 */
181
182#endif /* __ASM_ARCH_REGS_DSC_H */
183
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h
new file mode 100644
index 000000000000..2053cbacffc3
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-gpio.h
@@ -0,0 +1,831 @@
1/* linux/include/asm/hardware/s3c2410/regs-gpio.h
2 *
3 * Copyright (c) 2003,2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 GPIO register definitions
11 *
12 * Changelog:
13 * 19-06-2003 BJD Created file
14 * 23-06-2003 BJD Updated GSTATUS registers
15 * 12-03-2004 BJD Updated include protection
16 * 20-07-2004 BJD Added GPIO pin numbers, added Port A definitions
17 * 04-10-2004 BJD Fixed number of bugs, added EXT IRQ filter defs
18 * 17-10-2004 BJD Added GSTATUS1 register definitions
19 * 18-11-2004 BJD Fixed definitions of GPE3, GPE4, GPE5 and GPE6
20 * 18-11-2004 BJD Added S3C2440 AC97 controls
21 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
22 * 28-Mar-2005 LCVR Fixed definition of GPB10
23*/
24
25
26#ifndef __ASM_ARCH_REGS_GPIO_H
27#define __ASM_ARCH_REGS_GPIO_H "$Id: gpio.h,v 1.5 2003/05/19 12:51:08 ben Exp $"
28
29#define S3C2410_GPIONO(bank,offset) ((bank) + (offset))
30
31#define S3C2410_GPIO_BANKA (32*0)
32#define S3C2410_GPIO_BANKB (32*1)
33#define S3C2410_GPIO_BANKC (32*2)
34#define S3C2410_GPIO_BANKD (32*3)
35#define S3C2410_GPIO_BANKE (32*4)
36#define S3C2410_GPIO_BANKF (32*5)
37#define S3C2410_GPIO_BANKG (32*6)
38#define S3C2410_GPIO_BANKH (32*7)
39
40#define S3C2410_GPIO_BASE(pin) ((((pin) & ~31) >> 1) + S3C24XX_VA_GPIO)
41#define S3C2410_GPIO_OFFSET(pin) ((pin) & 31)
42
43/* general configuration options */
44
45#define S3C2410_GPIO_LEAVE (0xFFFFFFFF)
46
47/* configure GPIO ports A..G */
48
49#define S3C2410_GPIOREG(x) ((x) + S3C24XX_VA_GPIO)
50
51/* port A - 22bits, zero in bit X makes pin X output
52 * 1 makes port special function, this is default
53*/
54#define S3C2410_GPACON S3C2410_GPIOREG(0x00)
55#define S3C2410_GPADAT S3C2410_GPIOREG(0x04)
56
57#define S3C2410_GPA0 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 0)
58#define S3C2410_GPA0_OUT (0<<0)
59#define S3C2410_GPA0_ADDR0 (1<<0)
60
61#define S3C2410_GPA1 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 1)
62#define S3C2410_GPA1_OUT (0<<1)
63#define S3C2410_GPA1_ADDR16 (1<<1)
64
65#define S3C2410_GPA2 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 2)
66#define S3C2410_GPA2_OUT (0<<2)
67#define S3C2410_GPA2_ADDR17 (1<<2)
68
69#define S3C2410_GPA3 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 3)
70#define S3C2410_GPA3_OUT (0<<3)
71#define S3C2410_GPA3_ADDR18 (1<<3)
72
73#define S3C2410_GPA4 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 4)
74#define S3C2410_GPA4_OUT (0<<4)
75#define S3C2410_GPA4_ADDR19 (1<<4)
76
77#define S3C2410_GPA5 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 5)
78#define S3C2410_GPA5_OUT (0<<5)
79#define S3C2410_GPA5_ADDR20 (1<<5)
80
81#define S3C2410_GPA6 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 6)
82#define S3C2410_GPA6_OUT (0<<6)
83#define S3C2410_GPA6_ADDR21 (1<<6)
84
85#define S3C2410_GPA7 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 7)
86#define S3C2410_GPA7_OUT (0<<7)
87#define S3C2410_GPA7_ADDR22 (1<<7)
88
89#define S3C2410_GPA8 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 8)
90#define S3C2410_GPA8_OUT (0<<8)
91#define S3C2410_GPA8_ADDR23 (1<<8)
92
93#define S3C2410_GPA9 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 9)
94#define S3C2410_GPA9_OUT (0<<9)
95#define S3C2410_GPA9_ADDR24 (1<<9)
96
97#define S3C2410_GPA10 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 10)
98#define S3C2410_GPA10_OUT (0<<10)
99#define S3C2410_GPA10_ADDR25 (1<<10)
100
101#define S3C2410_GPA11 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 11)
102#define S3C2410_GPA11_OUT (0<<11)
103#define S3C2410_GPA11_ADDR26 (1<<11)
104
105#define S3C2410_GPA12 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 12)
106#define S3C2410_GPA12_OUT (0<<12)
107#define S3C2410_GPA12_nGCS1 (1<<12)
108
109#define S3C2410_GPA13 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 13)
110#define S3C2410_GPA13_OUT (0<<13)
111#define S3C2410_GPA13_nGCS2 (1<<13)
112
113#define S3C2410_GPA14 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 14)
114#define S3C2410_GPA14_OUT (0<<14)
115#define S3C2410_GPA14_nGCS3 (1<<14)
116
117#define S3C2410_GPA15 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 15)
118#define S3C2410_GPA15_OUT (0<<15)
119#define S3C2410_GPA15_nGCS4 (1<<15)
120
121#define S3C2410_GPA16 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 16)
122#define S3C2410_GPA16_OUT (0<<16)
123#define S3C2410_GPA16_nGCS5 (1<<16)
124
125#define S3C2410_GPA17 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 17)
126#define S3C2410_GPA17_OUT (0<<17)
127#define S3C2410_GPA17_CLE (1<<17)
128
129#define S3C2410_GPA18 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 18)
130#define S3C2410_GPA18_OUT (0<<18)
131#define S3C2410_GPA18_ALE (1<<18)
132
133#define S3C2410_GPA19 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 19)
134#define S3C2410_GPA19_OUT (0<<19)
135#define S3C2410_GPA19_nFWE (1<<19)
136
137#define S3C2410_GPA20 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 20)
138#define S3C2410_GPA20_OUT (0<<20)
139#define S3C2410_GPA20_nFRE (1<<20)
140
141#define S3C2410_GPA21 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 21)
142#define S3C2410_GPA21_OUT (0<<21)
143#define S3C2410_GPA21_nRSTOUT (1<<21)
144
145#define S3C2410_GPA22 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 22)
146#define S3C2410_GPA22_OUT (0<<22)
147#define S3C2410_GPA22_nFCE (1<<22)
148
149/* 0x08 and 0x0c are reserved */
150
151/* GPB is 10 IO pins, each configured by 2 bits each in GPBCON.
152 * 00 = input, 01 = output, 10=special function, 11=reserved
153 * bit 0,1 = pin 0, 2,3= pin 1...
154 *
155 * CPBUP = pull up resistor control, 1=disabled, 0=enabled
156*/
157
158#define S3C2410_GPBCON S3C2410_GPIOREG(0x10)
159#define S3C2410_GPBDAT S3C2410_GPIOREG(0x14)
160#define S3C2410_GPBUP S3C2410_GPIOREG(0x18)
161
162/* no i/o pin in port b can have value 3! */
163
164#define S3C2410_GPB0 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 0)
165#define S3C2410_GPB0_INP (0x00 << 0)
166#define S3C2410_GPB0_OUTP (0x01 << 0)
167#define S3C2410_GPB0_TOUT0 (0x02 << 0)
168
169#define S3C2410_GPB1 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 1)
170#define S3C2410_GPB1_INP (0x00 << 2)
171#define S3C2410_GPB1_OUTP (0x01 << 2)
172#define S3C2410_GPB1_TOUT1 (0x02 << 2)
173
174#define S3C2410_GPB2 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 2)
175#define S3C2410_GPB2_INP (0x00 << 4)
176#define S3C2410_GPB2_OUTP (0x01 << 4)
177#define S3C2410_GPB2_TOUT2 (0x02 << 4)
178
179#define S3C2410_GPB3 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 3)
180#define S3C2410_GPB3_INP (0x00 << 6)
181#define S3C2410_GPB3_OUTP (0x01 << 6)
182#define S3C2410_GPB3_TOUT3 (0x02 << 6)
183
184#define S3C2410_GPB4 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 4)
185#define S3C2410_GPB4_INP (0x00 << 8)
186#define S3C2410_GPB4_OUTP (0x01 << 8)
187#define S3C2410_GPB4_TCLK0 (0x02 << 8)
188#define S3C2410_GPB4_MASK (0x03 << 8)
189
190#define S3C2410_GPB5 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 5)
191#define S3C2410_GPB5_INP (0x00 << 10)
192#define S3C2410_GPB5_OUTP (0x01 << 10)
193#define S3C2410_GPB5_nXBACK (0x02 << 10)
194
195#define S3C2410_GPB6 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 6)
196#define S3C2410_GPB6_INP (0x00 << 12)
197#define S3C2410_GPB6_OUTP (0x01 << 12)
198#define S3C2410_GPB6_nXBREQ (0x02 << 12)
199
200#define S3C2410_GPB7 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 7)
201#define S3C2410_GPB7_INP (0x00 << 14)
202#define S3C2410_GPB7_OUTP (0x01 << 14)
203#define S3C2410_GPB7_nXDACK1 (0x02 << 14)
204
205#define S3C2410_GPB8 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 8)
206#define S3C2410_GPB8_INP (0x00 << 16)
207#define S3C2410_GPB8_OUTP (0x01 << 16)
208#define S3C2410_GPB8_nXDREQ1 (0x02 << 16)
209
210#define S3C2410_GPB9 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 9)
211#define S3C2410_GPB9_INP (0x00 << 18)
212#define S3C2410_GPB9_OUTP (0x01 << 18)
213#define S3C2410_GPB9_nXDACK0 (0x02 << 18)
214
215#define S3C2410_GPB10 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 10)
216#define S3C2410_GPB10_INP (0x00 << 20)
217#define S3C2410_GPB10_OUTP (0x01 << 20)
218#define S3C2410_GPB10_nXDRE0 (0x02 << 20)
219
220/* Port C consits of 16 GPIO/Special function
221 *
222 * almost identical setup to port b, but the special functions are mostly
223 * to do with the video system's sync/etc.
224*/
225
226#define S3C2410_GPCCON S3C2410_GPIOREG(0x20)
227#define S3C2410_GPCDAT S3C2410_GPIOREG(0x24)
228#define S3C2410_GPCUP S3C2410_GPIOREG(0x28)
229
230#define S3C2410_GPC0 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 0)
231#define S3C2410_GPC0_INP (0x00 << 0)
232#define S3C2410_GPC0_OUTP (0x01 << 0)
233#define S3C2410_GPC0_LEND (0x02 << 0)
234
235#define S3C2410_GPC1 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 1)
236#define S3C2410_GPC1_INP (0x00 << 2)
237#define S3C2410_GPC1_OUTP (0x01 << 2)
238#define S3C2410_GPC1_VCLK (0x02 << 2)
239
240#define S3C2410_GPC2 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 2)
241#define S3C2410_GPC2_INP (0x00 << 4)
242#define S3C2410_GPC2_OUTP (0x01 << 4)
243#define S3C2410_GPC2_VLINE (0x02 << 4)
244
245#define S3C2410_GPC3 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 3)
246#define S3C2410_GPC3_INP (0x00 << 6)
247#define S3C2410_GPC3_OUTP (0x01 << 6)
248#define S3C2410_GPC3_VFRAME (0x02 << 6)
249
250#define S3C2410_GPC4 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 4)
251#define S3C2410_GPC4_INP (0x00 << 8)
252#define S3C2410_GPC4_OUTP (0x01 << 8)
253#define S3C2410_GPC4_VM (0x02 << 8)
254
255#define S3C2410_GPC5 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 5)
256#define S3C2410_GPC5_INP (0x00 << 10)
257#define S3C2410_GPC5_OUTP (0x01 << 10)
258#define S3C2410_GPC5_LCDVF0 (0x02 << 10)
259
260#define S3C2410_GPC6 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 6)
261#define S3C2410_GPC6_INP (0x00 << 12)
262#define S3C2410_GPC6_OUTP (0x01 << 12)
263#define S3C2410_GPC6_LCDVF1 (0x02 << 12)
264
265#define S3C2410_GPC7 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 7)
266#define S3C2410_GPC7_INP (0x00 << 14)
267#define S3C2410_GPC7_OUTP (0x01 << 14)
268#define S3C2410_GPC7_LCDVF2 (0x02 << 14)
269
270#define S3C2410_GPC8 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 8)
271#define S3C2410_GPC8_INP (0x00 << 16)
272#define S3C2410_GPC8_OUTP (0x01 << 16)
273#define S3C2410_GPC8_VD0 (0x02 << 16)
274
275#define S3C2410_GPC9 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 9)
276#define S3C2410_GPC9_INP (0x00 << 18)
277#define S3C2410_GPC9_OUTP (0x01 << 18)
278#define S3C2410_GPC9_VD1 (0x02 << 18)
279
280#define S3C2410_GPC10 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 10)
281#define S3C2410_GPC10_INP (0x00 << 20)
282#define S3C2410_GPC10_OUTP (0x01 << 20)
283#define S3C2410_GPC10_VD2 (0x02 << 20)
284
285#define S3C2410_GPC11 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 11)
286#define S3C2410_GPC11_INP (0x00 << 22)
287#define S3C2410_GPC11_OUTP (0x01 << 22)
288#define S3C2410_GPC11_VD3 (0x02 << 22)
289
290#define S3C2410_GPC12 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 12)
291#define S3C2410_GPC12_INP (0x00 << 24)
292#define S3C2410_GPC12_OUTP (0x01 << 24)
293#define S3C2410_GPC12_VD4 (0x02 << 24)
294
295#define S3C2410_GPC13 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 13)
296#define S3C2410_GPC13_INP (0x00 << 26)
297#define S3C2410_GPC13_OUTP (0x01 << 26)
298#define S3C2410_GPC13_VD5 (0x02 << 26)
299
300#define S3C2410_GPC14 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 14)
301#define S3C2410_GPC14_INP (0x00 << 28)
302#define S3C2410_GPC14_OUTP (0x01 << 28)
303#define S3C2410_GPC14_VD6 (0x02 << 28)
304
305#define S3C2410_GPC15 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 15)
306#define S3C2410_GPC15_INP (0x00 << 30)
307#define S3C2410_GPC15_OUTP (0x01 << 30)
308#define S3C2410_GPC15_VD7 (0x02 << 30)
309
310/* Port D consists of 16 GPIO/Special function
311 *
312 * almost identical setup to port b, but the special functions are mostly
313 * to do with the video system's data.
314*/
315
316#define S3C2410_GPDCON S3C2410_GPIOREG(0x30)
317#define S3C2410_GPDDAT S3C2410_GPIOREG(0x34)
318#define S3C2410_GPDUP S3C2410_GPIOREG(0x38)
319
320#define S3C2410_GPD0 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 0)
321#define S3C2410_GPD0_INP (0x00 << 0)
322#define S3C2410_GPD0_OUTP (0x01 << 0)
323#define S3C2410_GPD0_VD8 (0x02 << 0)
324
325#define S3C2410_GPD1 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 1)
326#define S3C2410_GPD1_INP (0x00 << 2)
327#define S3C2410_GPD1_OUTP (0x01 << 2)
328#define S3C2410_GPD1_VD9 (0x02 << 2)
329
330#define S3C2410_GPD2 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 2)
331#define S3C2410_GPD2_INP (0x00 << 4)
332#define S3C2410_GPD2_OUTP (0x01 << 4)
333#define S3C2410_GPD2_VD10 (0x02 << 4)
334
335#define S3C2410_GPD3 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 3)
336#define S3C2410_GPD3_INP (0x00 << 6)
337#define S3C2410_GPD3_OUTP (0x01 << 6)
338#define S3C2410_GPD3_VD11 (0x02 << 6)
339
340#define S3C2410_GPD4 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 4)
341#define S3C2410_GPD4_INP (0x00 << 8)
342#define S3C2410_GPD4_OUTP (0x01 << 8)
343#define S3C2410_GPD4_VD12 (0x02 << 8)
344
345#define S3C2410_GPD5 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 5)
346#define S3C2410_GPD5_INP (0x00 << 10)
347#define S3C2410_GPD5_OUTP (0x01 << 10)
348#define S3C2410_GPD5_VD13 (0x02 << 10)
349
350#define S3C2410_GPD6 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 6)
351#define S3C2410_GPD6_INP (0x00 << 12)
352#define S3C2410_GPD6_OUTP (0x01 << 12)
353#define S3C2410_GPD6_VD14 (0x02 << 12)
354
355#define S3C2410_GPD7 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 7)
356#define S3C2410_GPD7_INP (0x00 << 14)
357#define S3C2410_GPD7_OUTP (0x01 << 14)
358#define S3C2410_GPD7_VD15 (0x02 << 14)
359
360#define S3C2410_GPD8 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 8)
361#define S3C2410_GPD8_INP (0x00 << 16)
362#define S3C2410_GPD8_OUTP (0x01 << 16)
363#define S3C2410_GPD8_VD16 (0x02 << 16)
364
365#define S3C2410_GPD9 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 9)
366#define S3C2410_GPD9_INP (0x00 << 18)
367#define S3C2410_GPD9_OUTP (0x01 << 18)
368#define S3C2410_GPD9_VD17 (0x02 << 18)
369
370#define S3C2410_GPD10 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 10)
371#define S3C2410_GPD10_INP (0x00 << 20)
372#define S3C2410_GPD10_OUTP (0x01 << 20)
373#define S3C2410_GPD10_VD18 (0x02 << 20)
374
375#define S3C2410_GPD11 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 11)
376#define S3C2410_GPD11_INP (0x00 << 22)
377#define S3C2410_GPD11_OUTP (0x01 << 22)
378#define S3C2410_GPD11_VD19 (0x02 << 22)
379
380#define S3C2410_GPD12 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 12)
381#define S3C2410_GPD12_INP (0x00 << 24)
382#define S3C2410_GPD12_OUTP (0x01 << 24)
383#define S3C2410_GPD12_VD20 (0x02 << 24)
384
385#define S3C2410_GPD13 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 13)
386#define S3C2410_GPD13_INP (0x00 << 26)
387#define S3C2410_GPD13_OUTP (0x01 << 26)
388#define S3C2410_GPD13_VD21 (0x02 << 26)
389
390#define S3C2410_GPD14 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 14)
391#define S3C2410_GPD14_INP (0x00 << 28)
392#define S3C2410_GPD14_OUTP (0x01 << 28)
393#define S3C2410_GPD14_VD22 (0x02 << 28)
394
395#define S3C2410_GPD15 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 15)
396#define S3C2410_GPD15_INP (0x00 << 30)
397#define S3C2410_GPD15_OUTP (0x01 << 30)
398#define S3C2410_GPD15_VD23 (0x02 << 30)
399
400/* Port E consists of 16 GPIO/Special function
401 *
402 * again, the same as port B, but dealing with I2S, SDI, and
403 * more miscellaneous functions
404*/
405
406#define S3C2410_GPECON S3C2410_GPIOREG(0x40)
407#define S3C2410_GPEDAT S3C2410_GPIOREG(0x44)
408#define S3C2410_GPEUP S3C2410_GPIOREG(0x48)
409
410#define S3C2410_GPE0 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 0)
411#define S3C2410_GPE0_INP (0x00 << 0)
412#define S3C2410_GPE0_OUTP (0x01 << 0)
413#define S3C2410_GPE0_I2SLRCK (0x02 << 0)
414#define S3C2410_GPE0_MASK (0x03 << 0)
415
416#define S3C2410_GPE1 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 1)
417#define S3C2410_GPE1_INP (0x00 << 2)
418#define S3C2410_GPE1_OUTP (0x01 << 2)
419#define S3C2410_GPE1_I2SSCLK (0x02 << 2)
420#define S3C2410_GPE1_MASK (0x03 << 2)
421
422#define S3C2410_GPE2 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 2)
423#define S3C2410_GPE2_INP (0x00 << 4)
424#define S3C2410_GPE2_OUTP (0x01 << 4)
425#define S3C2410_GPE2_CDCLK (0x02 << 4)
426
427#define S3C2410_GPE3 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 3)
428#define S3C2410_GPE3_INP (0x00 << 6)
429#define S3C2410_GPE3_OUTP (0x01 << 6)
430#define S3C2410_GPE3_I2SSDI (0x02 << 6)
431#define S3C2410_GPE3_nSS0 (0x03 << 6)
432#define S3C2410_GPE3_MASK (0x03 << 6)
433
434#define S3C2410_GPE4 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 4)
435#define S3C2410_GPE4_INP (0x00 << 8)
436#define S3C2410_GPE4_OUTP (0x01 << 8)
437#define S3C2410_GPE4_I2SSDO (0x02 << 8)
438#define S3C2410_GPE4_I2SSDI (0x03 << 8)
439#define S3C2410_GPE4_MASK (0x03 << 8)
440
441#define S3C2410_GPE5 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 5)
442#define S3C2410_GPE5_INP (0x00 << 10)
443#define S3C2410_GPE5_OUTP (0x01 << 10)
444#define S3C2410_GPE5_SDCLK (0x02 << 10)
445
446#define S3C2410_GPE6 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 6)
447#define S3C2410_GPE6_INP (0x00 << 12)
448#define S3C2410_GPE6_OUTP (0x01 << 12)
449#define S3C2410_GPE6_SDCMD (0x02 << 12)
450
451#define S3C2410_GPE7 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 7)
452#define S3C2410_GPE7_INP (0x00 << 14)
453#define S3C2410_GPE7_OUTP (0x01 << 14)
454#define S3C2410_GPE7_SDDAT0 (0x02 << 14)
455
456#define S3C2410_GPE8 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 8)
457#define S3C2410_GPE8_INP (0x00 << 16)
458#define S3C2410_GPE8_OUTP (0x01 << 16)
459#define S3C2410_GPE8_SDDAT1 (0x02 << 16)
460
461#define S3C2410_GPE9 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 9)
462#define S3C2410_GPE9_INP (0x00 << 18)
463#define S3C2410_GPE9_OUTP (0x01 << 18)
464#define S3C2410_GPE9_SDDAT2 (0x02 << 18)
465
466#define S3C2410_GPE10 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 10)
467#define S3C2410_GPE10_INP (0x00 << 20)
468#define S3C2410_GPE10_OUTP (0x01 << 20)
469#define S3C2410_GPE10_SDDAT3 (0x02 << 20)
470
471#define S3C2410_GPE11 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 11)
472#define S3C2410_GPE11_INP (0x00 << 22)
473#define S3C2410_GPE11_OUTP (0x01 << 22)
474#define S3C2410_GPE11_SPIMISO0 (0x02 << 22)
475
476#define S3C2410_GPE12 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 12)
477#define S3C2410_GPE12_INP (0x00 << 24)
478#define S3C2410_GPE12_OUTP (0x01 << 24)
479#define S3C2410_GPE12_SPIMOSI0 (0x02 << 24)
480
481#define S3C2410_GPE13 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 13)
482#define S3C2410_GPE13_INP (0x00 << 26)
483#define S3C2410_GPE13_OUTP (0x01 << 26)
484#define S3C2410_GPE13_SPICLK0 (0x02 << 26)
485
486#define S3C2410_GPE14 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 14)
487#define S3C2410_GPE14_INP (0x00 << 28)
488#define S3C2410_GPE14_OUTP (0x01 << 28)
489#define S3C2410_GPE14_IICSCL (0x02 << 28)
490#define S3C2410_GPE14_MASK (0x03 << 28)
491
492#define S3C2410_GPE15 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 15)
493#define S3C2410_GPE15_INP (0x00 << 30)
494#define S3C2410_GPE15_OUTP (0x01 << 30)
495#define S3C2410_GPE15_IICSDA (0x02 << 30)
496#define S3C2410_GPE15_MASK (0x03 << 30)
497
498#define S3C2440_GPE0_ACSYNC (0x03 << 0)
499#define S3C2440_GPE1_ACBITCLK (0x03 << 2)
500#define S3C2440_GPE2_ACRESET (0x03 << 4)
501#define S3C2440_GPE3_ACIN (0x03 << 6)
502#define S3C2440_GPE4_ACOUT (0x03 << 8)
503
504#define S3C2410_GPE_PUPDIS(x) (1<<(x))
505
506/* Port F consists of 8 GPIO/Special function
507 *
508 * GPIO / interrupt inputs
509 *
510 * GPFCON has 2 bits for each of the input pins on port F
511 * 00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 undefined
512 *
513 * pull up works like all other ports.
514*/
515
516#define S3C2410_GPFCON S3C2410_GPIOREG(0x50)
517#define S3C2410_GPFDAT S3C2410_GPIOREG(0x54)
518#define S3C2410_GPFUP S3C2410_GPIOREG(0x58)
519
520#define S3C2410_GPF0 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 0)
521#define S3C2410_GPF0_INP (0x00 << 0)
522#define S3C2410_GPF0_OUTP (0x01 << 0)
523#define S3C2410_GPF0_EINT0 (0x02 << 0)
524
525#define S3C2410_GPF1 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 1)
526#define S3C2410_GPF1_INP (0x00 << 2)
527#define S3C2410_GPF1_OUTP (0x01 << 2)
528#define S3C2410_GPF1_EINT1 (0x02 << 2)
529
530#define S3C2410_GPF2 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 2)
531#define S3C2410_GPF2_INP (0x00 << 4)
532#define S3C2410_GPF2_OUTP (0x01 << 4)
533#define S3C2410_GPF2_EINT2 (0x02 << 4)
534
535#define S3C2410_GPF3 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 3)
536#define S3C2410_GPF3_INP (0x00 << 6)
537#define S3C2410_GPF3_OUTP (0x01 << 6)
538#define S3C2410_GPF3_EINT3 (0x02 << 6)
539
540#define S3C2410_GPF4 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 4)
541#define S3C2410_GPF4_INP (0x00 << 8)
542#define S3C2410_GPF4_OUTP (0x01 << 8)
543#define S3C2410_GPF4_EINT4 (0x02 << 8)
544
545#define S3C2410_GPF5 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 5)
546#define S3C2410_GPF5_INP (0x00 << 10)
547#define S3C2410_GPF5_OUTP (0x01 << 10)
548#define S3C2410_GPF5_EINT5 (0x02 << 10)
549
550#define S3C2410_GPF6 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 6)
551#define S3C2410_GPF6_INP (0x00 << 12)
552#define S3C2410_GPF6_OUTP (0x01 << 12)
553#define S3C2410_GPF6_EINT6 (0x02 << 12)
554
555#define S3C2410_GPF7 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 7)
556#define S3C2410_GPF7_INP (0x00 << 14)
557#define S3C2410_GPF7_OUTP (0x01 << 14)
558#define S3C2410_GPF7_EINT7 (0x02 << 14)
559
560/* Port G consists of 8 GPIO/IRQ/Special function
561 *
562 * GPGCON has 2 bits for each of the input pins on port F
563 * 00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 special func
564 *
565 * pull up works like all other ports.
566*/
567
568#define S3C2410_GPGCON S3C2410_GPIOREG(0x60)
569#define S3C2410_GPGDAT S3C2410_GPIOREG(0x64)
570#define S3C2410_GPGUP S3C2410_GPIOREG(0x68)
571
572#define S3C2410_GPG0 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 0)
573#define S3C2410_GPG0_INP (0x00 << 0)
574#define S3C2410_GPG0_OUTP (0x01 << 0)
575#define S3C2410_GPG0_EINT8 (0x02 << 0)
576
577#define S3C2410_GPG1 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 1)
578#define S3C2410_GPG1_INP (0x00 << 2)
579#define S3C2410_GPG1_OUTP (0x01 << 2)
580#define S3C2410_GPG1_EINT9 (0x02 << 2)
581
582#define S3C2410_GPG2 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 2)
583#define S3C2410_GPG2_INP (0x00 << 4)
584#define S3C2410_GPG2_OUTP (0x01 << 4)
585#define S3C2410_GPG2_EINT10 (0x02 << 4)
586
587#define S3C2410_GPG3 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3)
588#define S3C2410_GPG3_INP (0x00 << 6)
589#define S3C2410_GPG3_OUTP (0x01 << 6)
590#define S3C2410_GPG3_EINT11 (0x02 << 6)
591
592#define S3C2410_GPG4 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 4)
593#define S3C2410_GPG4_INP (0x00 << 8)
594#define S3C2410_GPG4_OUTP (0x01 << 8)
595#define S3C2410_GPG4_EINT12 (0x02 << 8)
596#define S3C2410_GPG4_LCDPWREN (0x03 << 8)
597
598#define S3C2410_GPG5 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 5)
599#define S3C2410_GPG5_INP (0x00 << 10)
600#define S3C2410_GPG5_OUTP (0x01 << 10)
601#define S3C2410_GPG5_EINT13 (0x02 << 10)
602#define S3C2410_GPG5_SPIMISO1 (0x03 << 10)
603
604#define S3C2410_GPG6 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 6)
605#define S3C2410_GPG6_INP (0x00 << 12)
606#define S3C2410_GPG6_OUTP (0x01 << 12)
607#define S3C2410_GPG6_EINT14 (0x02 << 12)
608#define S3C2410_GPG6_SPIMOSI1 (0x03 << 12)
609
610#define S3C2410_GPG7 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 7)
611#define S3C2410_GPG7_INP (0x00 << 14)
612#define S3C2410_GPG7_OUTP (0x01 << 14)
613#define S3C2410_GPG7_EINT15 (0x02 << 14)
614#define S3C2410_GPG7_SPICLK1 (0x03 << 14)
615
616#define S3C2410_GPG8 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 8)
617#define S3C2410_GPG8_INP (0x00 << 16)
618#define S3C2410_GPG8_OUTP (0x01 << 16)
619#define S3C2410_GPG8_EINT16 (0x02 << 16)
620
621#define S3C2410_GPG9 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 9)
622#define S3C2410_GPG9_INP (0x00 << 18)
623#define S3C2410_GPG9_OUTP (0x01 << 18)
624#define S3C2410_GPG9_EINT17 (0x02 << 18)
625
626#define S3C2410_GPG10 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10)
627#define S3C2410_GPG10_INP (0x00 << 20)
628#define S3C2410_GPG10_OUTP (0x01 << 20)
629#define S3C2410_GPG10_EINT18 (0x02 << 20)
630
631#define S3C2410_GPG11 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 11)
632#define S3C2410_GPG11_INP (0x00 << 22)
633#define S3C2410_GPG11_OUTP (0x01 << 22)
634#define S3C2410_GPG11_EINT19 (0x02 << 22)
635#define S3C2410_GPG11_TCLK1 (0x03 << 22)
636
637#define S3C2410_GPG12 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 12)
638#define S3C2410_GPG12_INP (0x00 << 24)
639#define S3C2410_GPG12_OUTP (0x01 << 24)
640#define S3C2410_GPG12_EINT20 (0x02 << 24)
641#define S3C2410_GPG12_XMON (0x03 << 24)
642
643#define S3C2410_GPG13 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 13)
644#define S3C2410_GPG13_INP (0x00 << 26)
645#define S3C2410_GPG13_OUTP (0x01 << 26)
646#define S3C2410_GPG13_EINT21 (0x02 << 26)
647#define S3C2410_GPG13_nXPON (0x03 << 26)
648
649#define S3C2410_GPG14 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 14)
650#define S3C2410_GPG14_INP (0x00 << 28)
651#define S3C2410_GPG14_OUTP (0x01 << 28)
652#define S3C2410_GPG14_EINT22 (0x02 << 28)
653#define S3C2410_GPG14_YMON (0x03 << 28)
654
655#define S3C2410_GPG15 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 15)
656#define S3C2410_GPG15_INP (0x00 << 30)
657#define S3C2410_GPG15_OUTP (0x01 << 30)
658#define S3C2410_GPG15_EINT23 (0x02 << 30)
659#define S3C2410_GPG15_nYPON (0x03 << 30)
660
661
662#define S3C2410_GPG_PUPDIS(x) (1<<(x))
663
664/* Port H consists of11 GPIO/serial/Misc pins
665 *
666 * GPGCON has 2 bits for each of the input pins on port F
667 * 00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 special func
668 *
669 * pull up works like all other ports.
670*/
671
672#define S3C2410_GPHCON S3C2410_GPIOREG(0x70)
673#define S3C2410_GPHDAT S3C2410_GPIOREG(0x74)
674#define S3C2410_GPHUP S3C2410_GPIOREG(0x78)
675
676#define S3C2410_GPH0 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 0)
677#define S3C2410_GPH0_INP (0x00 << 0)
678#define S3C2410_GPH0_OUTP (0x01 << 0)
679#define S3C2410_GPH0_nCTS0 (0x02 << 0)
680
681#define S3C2410_GPH1 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 1)
682#define S3C2410_GPH1_INP (0x00 << 2)
683#define S3C2410_GPH1_OUTP (0x01 << 2)
684#define S3C2410_GPH1_nRTS0 (0x02 << 2)
685
686#define S3C2410_GPH2 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 2)
687#define S3C2410_GPH2_INP (0x00 << 4)
688#define S3C2410_GPH2_OUTP (0x01 << 4)
689#define S3C2410_GPH2_TXD0 (0x02 << 4)
690
691#define S3C2410_GPH3 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 3)
692#define S3C2410_GPH3_INP (0x00 << 6)
693#define S3C2410_GPH3_OUTP (0x01 << 6)
694#define S3C2410_GPH3_RXD0 (0x02 << 6)
695
696#define S3C2410_GPH4 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 4)
697#define S3C2410_GPH4_INP (0x00 << 8)
698#define S3C2410_GPH4_OUTP (0x01 << 8)
699#define S3C2410_GPH4_TXD1 (0x02 << 8)
700
701#define S3C2410_GPH5 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 5)
702#define S3C2410_GPH5_INP (0x00 << 10)
703#define S3C2410_GPH5_OUTP (0x01 << 10)
704#define S3C2410_GPH5_RXD1 (0x02 << 10)
705
706#define S3C2410_GPH6 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 6)
707#define S3C2410_GPH6_INP (0x00 << 12)
708#define S3C2410_GPH6_OUTP (0x01 << 12)
709#define S3C2410_GPH6_TXD2 (0x02 << 12)
710#define S3C2410_GPH6_nRTS1 (0x03 << 12)
711
712#define S3C2410_GPH7 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 7)
713#define S3C2410_GPH7_INP (0x00 << 14)
714#define S3C2410_GPH7_OUTP (0x01 << 14)
715#define S3C2410_GPH7_RXD2 (0x02 << 14)
716#define S3C2410_GPH7_nCTS1 (0x03 << 14)
717
718#define S3C2410_GPH8 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 8)
719#define S3C2410_GPH8_INP (0x00 << 16)
720#define S3C2410_GPH8_OUTP (0x01 << 16)
721#define S3C2410_GPH8_UCLK (0x02 << 16)
722
723#define S3C2410_GPH9 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 9)
724#define S3C2410_GPH9_INP (0x00 << 18)
725#define S3C2410_GPH9_OUTP (0x01 << 18)
726#define S3C2410_GPH9_CLKOUT0 (0x02 << 18)
727
728#define S3C2410_GPH10 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 10)
729#define S3C2410_GPH10_INP (0x00 << 20)
730#define S3C2410_GPH10_OUTP (0x01 << 20)
731#define S3C2410_GPH10_CLKOUT1 (0x02 << 20)
732
733/* miscellaneous control */
734
735#define S3C2410_MISCCR S3C2410_GPIOREG(0x80)
736#define S3C2410_DCLKCON S3C2410_GPIOREG(0x84)
737
738/* see clock.h for dclk definitions */
739
740/* pullup control on databus */
741#define S3C2410_MISCCR_SPUCR_HEN (0)
742#define S3C2410_MISCCR_SPUCR_HDIS (1<<0)
743#define S3C2410_MISCCR_SPUCR_LEN (0)
744#define S3C2410_MISCCR_SPUCR_LDIS (1<<1)
745
746#define S3C2410_MISCCR_USBDEV (0)
747#define S3C2410_MISCCR_USBHOST (1<<3)
748
749#define S3C2410_MISCCR_CLK0_MPLL (0<<4)
750#define S3C2410_MISCCR_CLK0_UPLL (1<<4)
751#define S3C2410_MISCCR_CLK0_FCLK (2<<4)
752#define S3C2410_MISCCR_CLK0_HCLK (3<<4)
753#define S3C2410_MISCCR_CLK0_PCLK (4<<4)
754#define S3C2410_MISCCR_CLK0_DCLK0 (5<<4)
755
756#define S3C2410_MISCCR_CLK1_MPLL (0<<8)
757#define S3C2410_MISCCR_CLK1_UPLL (1<<8)
758#define S3C2410_MISCCR_CLK1_FCLK (2<<8)
759#define S3C2410_MISCCR_CLK1_HCLK (3<<8)
760#define S3C2410_MISCCR_CLK1_PCLK (4<<8)
761#define S3C2410_MISCCR_CLK1_DCLK1 (5<<8)
762
763#define S3C2410_MISCCR_USBSUSPND0 (1<<12)
764#define S3C2410_MISCCR_USBSUSPND1 (1<<13)
765
766#define S3C2410_MISCCR_nRSTCON (1<<16)
767
768#define S3C2410_MISCCR_nEN_SCLK0 (1<<17)
769#define S3C2410_MISCCR_nEN_SCLK1 (1<<18)
770#define S3C2410_MISCCR_nEN_SCLKE (1<<19)
771#define S3C2410_MISCCR_SDSLEEP (7<<17)
772
773/* external interrupt control... */
774/* S3C2410_EXTINT0 -> irq sense control for EINT0..EINT7
775 * S3C2410_EXTINT1 -> irq sense control for EINT8..EINT15
776 * S3C2410_EXTINT2 -> irq sense control for EINT16..EINT23
777 *
778 * note S3C2410_EXTINT2 has filtering options for EINT16..EINT23
779 *
780 * Samsung datasheet p9-25
781*/
782
783#define S3C2410_EXTINT0 S3C2410_GPIOREG(0x88)
784#define S3C2410_EXTINT1 S3C2410_GPIOREG(0x8C)
785#define S3C2410_EXTINT2 S3C2410_GPIOREG(0x90)
786
787/* values for S3C2410_EXTINT0/1/2 */
788#define S3C2410_EXTINT_LOWLEV (0x00)
789#define S3C2410_EXTINT_HILEV (0x01)
790#define S3C2410_EXTINT_FALLEDGE (0x02)
791#define S3C2410_EXTINT_RISEEDGE (0x04)
792#define S3C2410_EXTINT_BOTHEDGE (0x06)
793
794/* interrupt filtering conrrol for EINT16..EINT23 */
795#define S3C2410_EINFLT0 S3C2410_GPIOREG(0x94)
796#define S3C2410_EINFLT1 S3C2410_GPIOREG(0x98)
797#define S3C2410_EINFLT2 S3C2410_GPIOREG(0x9C)
798#define S3C2410_EINFLT3 S3C2410_GPIOREG(0xA0)
799
800/* values for interrupt filtering */
801#define S3C2410_EINTFLT_PCLK (0x00)
802#define S3C2410_EINTFLT_EXTCLK (1<<7)
803#define S3C2410_EINTFLT_WIDTHMSK(x) ((x) & 0x3f)
804
805/* removed EINTxxxx defs from here, not meant for this */
806
807/* GSTATUS have miscellaneous information in them
808 *
809 */
810
811#define S3C2410_GSTATUS0 S3C2410_GPIOREG(0x0AC)
812#define S3C2410_GSTATUS1 S3C2410_GPIOREG(0x0B0)
813#define S3C2410_GSTATUS2 S3C2410_GPIOREG(0x0B4)
814#define S3C2410_GSTATUS3 S3C2410_GPIOREG(0x0B8)
815#define S3C2410_GSTATUS4 S3C2410_GPIOREG(0x0BC)
816
817#define S3C2410_GSTATUS0_nWAIT (1<<3)
818#define S3C2410_GSTATUS0_NCON (1<<2)
819#define S3C2410_GSTATUS0_RnB (1<<1)
820#define S3C2410_GSTATUS0_nBATTFLT (1<<0)
821
822#define S3C2410_GSTATUS1_IDMASK (0xffff0000)
823#define S3C2410_GSTATUS1_2410 (0x32410000)
824#define S3C2410_GSTATUS1_2440 (0x32440000)
825
826#define S3C2410_GSTATUS2_WTRESET (1<<2)
827#define S3C2410_GSTATUS2_OFFRESET (1<<1)
828#define S3C2410_GSTATUS2_PONRESET (1<<0)
829
830#endif /* __ASM_ARCH_REGS_GPIO_H */
831
diff --git a/include/asm-arm/arch-s3c2410/regs-gpioj.h b/include/asm-arm/arch-s3c2410/regs-gpioj.h
new file mode 100644
index 000000000000..3ad2324acc39
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-gpioj.h
@@ -0,0 +1,101 @@
1/* linux/include/asm/hardware/s3c2410/regs-gpioj.h
2 *
3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2440 GPIO J register definitions
11 *
12 * Changelog:
13 * 11-Aug-2004 BJD Created file
14 * 10-Feb-2005 BJD Fix GPJ12 definition (Guillaume Gourat)
15*/
16
17
18#ifndef __ASM_ARCH_REGS_GPIOJ_H
19#define __ASM_ARCH_REGS_GPIOJ_H "gpioj"
20
21/* Port J consists of 13 GPIO/Camera pins
22 *
23 * GPJCON has 2 bits for each of the input pins on port F
24 * 00 = 0 input, 1 output, 2 Camera
25 *
26 * pull up works like all other ports.
27*/
28
29#define S3C2440_GPIO_BANKJ (416)
30
31#define S3C2440_GPJCON S3C2410_GPIOREG(0xd0)
32#define S3C2440_GPJDAT S3C2410_GPIOREG(0xd4)
33#define S3C2440_GPJUP S3C2410_GPIOREG(0xd8)
34
35#define S3C2440_GPJ0 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 0)
36#define S3C2440_GPJ0_INP (0x00 << 0)
37#define S3C2440_GPJ0_OUTP (0x01 << 0)
38#define S3C2440_GPJ0_CAMDATA0 (0x02 << 0)
39
40#define S3C2440_GPJ1 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 1)
41#define S3C2440_GPJ1_INP (0x00 << 2)
42#define S3C2440_GPJ1_OUTP (0x01 << 2)
43#define S3C2440_GPJ1_CAMDATA1 (0x02 << 2)
44
45#define S3C2440_GPJ2 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 2)
46#define S3C2440_GPJ2_INP (0x00 << 4)
47#define S3C2440_GPJ2_OUTP (0x01 << 4)
48#define S3C2440_GPJ2_CAMDATA2 (0x02 << 4)
49
50#define S3C2440_GPJ3 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 3)
51#define S3C2440_GPJ3_INP (0x00 << 6)
52#define S3C2440_GPJ3_OUTP (0x01 << 6)
53#define S3C2440_GPJ3_CAMDATA3 (0x02 << 6)
54
55#define S3C2440_GPJ4 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 4)
56#define S3C2440_GPJ4_INP (0x00 << 8)
57#define S3C2440_GPJ4_OUTP (0x01 << 8)
58#define S3C2440_GPJ4_CAMDATA4 (0x02 << 8)
59
60#define S3C2440_GPJ5 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 5)
61#define S3C2440_GPJ5_INP (0x00 << 10)
62#define S3C2440_GPJ5_OUTP (0x01 << 10)
63#define S3C2440_GPJ5_CAMDATA5 (0x02 << 10)
64
65#define S3C2440_GPJ6 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 6)
66#define S3C2440_GPJ6_INP (0x00 << 12)
67#define S3C2440_GPJ6_OUTP (0x01 << 12)
68#define S3C2440_GPJ6_CAMDATA6 (0x02 << 12)
69
70#define S3C2440_GPJ7 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 7)
71#define S3C2440_GPJ7_INP (0x00 << 14)
72#define S3C2440_GPJ7_OUTP (0x01 << 14)
73#define S3C2440_GPJ7_CAMDATA7 (0x02 << 14)
74
75#define S3C2440_GPJ8 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 8)
76#define S3C2440_GPJ8_INP (0x00 << 16)
77#define S3C2440_GPJ8_OUTP (0x01 << 16)
78#define S3C2440_GPJ8_CAMPCLK (0x02 << 16)
79
80#define S3C2440_GPJ9 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 9)
81#define S3C2440_GPJ9_INP (0x00 << 18)
82#define S3C2440_GPJ9_OUTP (0x01 << 18)
83#define S3C2440_GPJ9_CAMVSYNC (0x02 << 18)
84
85#define S3C2440_GPJ10 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 10)
86#define S3C2440_GPJ10_INP (0x00 << 20)
87#define S3C2440_GPJ10_OUTP (0x01 << 20)
88#define S3C2440_GPJ10_CAMHREF (0x02 << 20)
89
90#define S3C2440_GPJ11 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 11)
91#define S3C2440_GPJ11_INP (0x00 << 22)
92#define S3C2440_GPJ11_OUTP (0x01 << 22)
93#define S3C2440_GPJ11_CAMCLKOUT (0x02 << 22)
94
95#define S3C2440_GPJ12 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 12)
96#define S3C2440_GPJ12_INP (0x00 << 24)
97#define S3C2440_GPJ12_OUTP (0x01 << 24)
98#define S3C2440_GPJ12_CAMRESET (0x02 << 24)
99
100#endif /* __ASM_ARCH_REGS_GPIOJ_H */
101
diff --git a/include/asm-arm/arch-s3c2410/regs-iic.h b/include/asm-arm/arch-s3c2410/regs-iic.h
new file mode 100644
index 000000000000..fed3288e2046
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-iic.h
@@ -0,0 +1,60 @@
1/* linux/include/asm-arm/arch-s3c2410/regs-iic.h
2 *
3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 I2C Controller
11 *
12 * Changelog:
13 * 03-Oct-2004 BJD Initial include for Linux
14 * 08-Nov-2004 BJD Added S3C2440 filter register
15*/
16
17#ifndef __ASM_ARCH_REGS_IIC_H
18#define __ASM_ARCH_REGS_IIC_H __FILE__
19
20/* see s3c2410x user guide, v1.1, section 9 (p447) for more info */
21
22#define S3C2410_IICREG(x) (x)
23
24#define S3C2410_IICCON S3C2410_IICREG(0x00)
25#define S3C2410_IICSTAT S3C2410_IICREG(0x04)
26#define S3C2410_IICADD S3C2410_IICREG(0x08)
27#define S3C2410_IICDS S3C2410_IICREG(0x0C)
28#define S3C2440_IICLC S3C2410_IICREG(0x10)
29
30#define S3C2410_IICCON_ACKEN (1<<7)
31#define S3C2410_IICCON_TXDIV_16 (0<<6)
32#define S3C2410_IICCON_TXDIV_512 (1<<6)
33#define S3C2410_IICCON_IRQEN (1<<5)
34#define S3C2410_IICCON_IRQPEND (1<<4)
35#define S3C2410_IICCON_SCALE(x) ((x)&15)
36#define S3C2410_IICCON_SCALEMASK (0xf)
37
38#define S3C2410_IICSTAT_MASTER_RX (2<<6)
39#define S3C2410_IICSTAT_MASTER_TX (3<<6)
40#define S3C2410_IICSTAT_SLAVE_RX (0<<6)
41#define S3C2410_IICSTAT_SLAVE_TX (1<<6)
42#define S3C2410_IICSTAT_MODEMASK (3<<6)
43
44#define S3C2410_IICSTAT_START (1<<5)
45#define S3C2410_IICSTAT_BUSBUSY (1<<5)
46#define S3C2410_IICSTAT_TXRXEN (1<<4)
47#define S3C2410_IICSTAT_ARBITR (1<<3)
48#define S3C2410_IICSTAT_ASSLAVE (1<<2)
49#define S3C2410_IICSTAT_ADDR0 (1<<1)
50#define S3C2410_IICSTAT_LASTBIT (1<<0)
51
52#define S3C2410_IICLC_SDA_DELAY0 (0 << 0)
53#define S3C2410_IICLC_SDA_DELAY5 (1 << 0)
54#define S3C2410_IICLC_SDA_DELAY10 (2 << 0)
55#define S3C2410_IICLC_SDA_DELAY15 (3 << 0)
56#define S3C2410_IICLC_SDA_DELAY_MASK (3 << 0)
57
58#define S3C2410_IICLC_FILTER_ON (1<<2)
59
60#endif /* __ASM_ARCH_REGS_IIC_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-iis.h b/include/asm-arm/arch-s3c2410/regs-iis.h
new file mode 100644
index 000000000000..7ae8e1f45bc1
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-iis.h
@@ -0,0 +1,72 @@
1/* linux/include/asm/arch-s3c2410/regs-iis.h
2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 IIS register definition
11 *
12 * Changelog:
13 * 19-06-2003 BJD Created file
14 * 26-06-2003 BJD Finished off definitions for register addresses
15 * 12-03-2004 BJD Updated include protection
16 * 07-03-2005 BJD Added FIFO size flags and S3C2440 MPLL
17 */
18
19#ifndef __ASM_ARCH_REGS_IIS_H
20#define __ASM_ARCH_REGS_IIS_H
21
22#define S3C2410_IISCON (0x00)
23
24#define S3C2440_IISCON_MPLL (1<<9)
25#define S3C2410_IISCON_LRINDEX (1<<8)
26#define S3C2410_IISCON_TXFIFORDY (1<<7)
27#define S3C2410_IISCON_RXFIFORDY (1<<6)
28#define S3C2410_IISCON_TXDMAEN (1<<5)
29#define S3C2410_IISCON_RXDMAEN (1<<4)
30#define S3C2410_IISCON_TXIDLE (1<<3)
31#define S3C2410_IISCON_RXIDLE (1<<2)
32#define S3C2410_IISCON_IISEN (1<<0)
33
34#define S3C2410_IISMOD (0x04)
35
36#define S3C2410_IISMOD_SLAVE (1<<8)
37#define S3C2410_IISMOD_NOXFER (0<<6)
38#define S3C2410_IISMOD_RXMODE (1<<6)
39#define S3C2410_IISMOD_TXMODE (2<<6)
40#define S3C2410_IISMOD_TXRXMODE (3<<6)
41#define S3C2410_IISMOD_LR_LLOW (0<<5)
42#define S3C2410_IISMOD_LR_RLOW (1<<5)
43#define S3C2410_IISMOD_IIS (0<<4)
44#define S3C2410_IISMOD_MSB (1<<4)
45#define S3C2410_IISMOD_8BIT (0<<3)
46#define S3C2410_IISMOD_16BIT (1<<3)
47#define S3C2410_IISMOD_BITMASK (1<<3)
48#define S3C2410_IISMOD_256FS (0<<1)
49#define S3C2410_IISMOD_384FS (1<<1)
50#define S3C2410_IISMOD_16FS (0<<0)
51#define S3C2410_IISMOD_32FS (1<<0)
52#define S3C2410_IISMOD_48FS (2<<0)
53
54#define S3C2410_IISPSR (0x08)
55#define S3C2410_IISPSR_INTMASK (31<<5)
56#define S3C2410_IISPSR_INTSHIFT (5)
57#define S3C2410_IISPSR_EXTMASK (31<<0)
58#define S3C2410_IISPSR_EXTSHFIT (0)
59
60#define S3C2410_IISFCON (0x0c)
61
62#define S3C2410_IISFCON_TXDMA (1<<15)
63#define S3C2410_IISFCON_RXDMA (1<<14)
64#define S3C2410_IISFCON_TXENABLE (1<<13)
65#define S3C2410_IISFCON_RXENABLE (1<<12)
66#define S3C2410_IISFCON_TXMASK (0x3f << 6)
67#define S3C2410_IISFCON_TXSHIFT (6)
68#define S3C2410_IISFCON_RXMASK (0x3f)
69#define S3C2410_IISFCON_RXSHIFT (0)
70
71#define S3C2410_IISFIFO (0x10)
72#endif /* __ASM_ARCH_REGS_IIS_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-irq.h b/include/asm-arm/arch-s3c2410/regs-irq.h
new file mode 100644
index 000000000000..24b7292df79e
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-irq.h
@@ -0,0 +1,44 @@
1/* linux/include/asm/arch-s3c2410/regs-irq.h
2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * Changelog:
13 * 19-06-2003 BJD Created file
14 * 12-03-2004 BJD Updated include protection
15 * 10-03-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
16 */
17
18
19#ifndef ___ASM_ARCH_REGS_IRQ_H
20#define ___ASM_ARCH_REGS_IRQ_H "$Id: irq.h,v 1.3 2003/03/25 21:29:06 ben Exp $"
21
22/* interrupt controller */
23
24#define S3C2410_IRQREG(x) ((x) + S3C24XX_VA_IRQ)
25#define S3C2410_EINTREG(x) ((x) + S3C24XX_VA_GPIO)
26
27#define S3C2410_SRCPND S3C2410_IRQREG(0x000)
28#define S3C2410_INTMOD S3C2410_IRQREG(0x004)
29#define S3C2410_INTMSK S3C2410_IRQREG(0x008)
30#define S3C2410_PRIORITY S3C2410_IRQREG(0x00C)
31#define S3C2410_INTPND S3C2410_IRQREG(0x010)
32#define S3C2410_INTOFFSET S3C2410_IRQREG(0x014)
33#define S3C2410_SUBSRCPND S3C2410_IRQREG(0x018)
34#define S3C2410_INTSUBMSK S3C2410_IRQREG(0x01C)
35
36/* mask: 0=enable, 1=disable
37 * 1 bit EINT, 4=EINT4, 23=EINT23
38 * EINT0,1,2,3 are not handled here.
39*/
40
41#define S3C2410_EINTMASK S3C2410_EINTREG(0x0A4)
42#define S3C2410_EINTPEND S3C2410_EINTREG(0X0A8)
43
44#endif /* ___ASM_ARCH_REGS_IRQ_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-lcd.h b/include/asm-arm/arch-s3c2410/regs-lcd.h
new file mode 100644
index 000000000000..7f882ea92b2a
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-lcd.h
@@ -0,0 +1,114 @@
1/* linux/include/asm/arch-s3c2410/regs-lcd.h
2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * Changelog:
13 * 12-06-2003 BJD Created file
14 * 26-06-2003 BJD Updated LCDCON register definitions
15 * 12-03-2004 BJD Updated include protection
16 * 10-03-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
17*/
18
19
20#ifndef ___ASM_ARCH_REGS_LCD_H
21#define ___ASM_ARCH_REGS_LCD_H "$Id: lcd.h,v 1.3 2003/06/26 13:25:06 ben Exp $"
22
23#define S3C2410_LCDREG(x) ((x) + S3C24XX_VA_LCD)
24
25/* LCD control registers */
26#define S3C2410_LCDCON1 S3C2410_LCDREG(0x00)
27#define S3C2410_LCDCON2 S3C2410_LCDREG(0x04)
28#define S3C2410_LCDCON3 S3C2410_LCDREG(0x08)
29#define S3C2410_LCDCON4 S3C2410_LCDREG(0x0C)
30#define S3C2410_LCDCON5 S3C2410_LCDREG(0x10)
31
32#define S3C2410_LCDCON1_CLKVAL(x) ((x) << 8)
33#define S3C2410_LCDCON1_MMODE (1<<7)
34#define S3C2410_LCDCON1_DSCAN4 (0<<5)
35#define S3C2410_LCDCON1_STN4 (1<<5)
36#define S3C2410_LCDCON1_STN8 (2<<5)
37#define S3C2410_LCDCON1_TFT (3<<5)
38
39#define S3C2410_LCDCON1_STN1BPP (0<<1)
40#define S3C2410_LCDCON1_STN2GREY (1<<1)
41#define S3C2410_LCDCON1_STN4GREY (2<<1)
42#define S3C2410_LCDCON1_STN8BPP (3<<1)
43#define S3C2410_LCDCON1_STN12BPP (4<<1)
44
45#define S3C2410_LCDCON1_TFT1BPP (8<<1)
46#define S3C2410_LCDCON1_TFT2BPP (9<<1)
47#define S3C2410_LCDCON1_TFT4BPP (10<<1)
48#define S3C2410_LCDCON1_TFT8BPP (11<<1)
49#define S3C2410_LCDCON1_TFT16BPP (12<<1)
50#define S3C2410_LCDCON1_TFT24BPP (13<<1)
51
52#define S3C2410_LCDCON1_ENVID (1)
53
54#define S3C2410_LCDCON2_VBPD(x) ((x) << 24)
55#define S3C2410_LCDCON2_LINEVAL(x) ((x) << 14)
56#define S3C2410_LCDCON2_VFPD(x) ((x) << 6)
57#define S3C2410_LCDCON2_VSPW(x) ((x) << 0)
58
59#define S3C2410_LCDCON3_HBPD(x) ((x) << 19)
60#define S3C2410_LCDCON3_WDLY(x) ((x) << 19)
61#define S3C2410_LCDCON3_HOZVAL(x) ((x) << 8)
62#define S3C2410_LCDCON3_HFPD(x) ((x) << 0)
63#define S3C2410_LCDCON3_LINEBLANK(x)((x) << 0)
64
65#define S3C2410_LCDCON4_MVAL(x) ((x) << 8)
66#define S3C2410_LCDCON4_HSPW(x) ((x) << 0)
67#define S3C2410_LCDCON4_WLH(x) ((x) << 0)
68
69#define S3C2410_LCDCON5_BPP24BL (1<<12)
70#define S3C2410_LCDCON5_FRM565 (1<<11)
71#define S3C2410_LCDCON5_INVVCLK (1<<10)
72#define S3C2410_LCDCON5_INVVLINE (1<<9)
73#define S3C2410_LCDCON5_INVVFRAME (1<<8)
74#define S3C2410_LCDCON5_INVVD (1<<7)
75#define S3C2410_LCDCON5_INVVDEN (1<<6)
76#define S3C2410_LCDCON5_INVPWREN (1<<5)
77#define S3C2410_LCDCON5_INVLEND (1<<4)
78#define S3C2410_LCDCON5_PWREN (1<<3)
79#define S3C2410_LCDCON5_ENLEND (1<<2)
80#define S3C2410_LCDCON5_BSWP (1<<1)
81#define S3C2410_LCDCON5_HWSWP (1<<0)
82
83/* framebuffer start addressed */
84#define S3C2410_LCDSADDR1 S3C2410_LCDREG(0x14)
85#define S3C2410_LCDSADDR2 S3C2410_LCDREG(0x18)
86#define S3C2410_LCDSADDR3 S3C2410_LCDREG(0x1C)
87
88#define S3C2410_LCDBANK(x) ((x) << 21)
89#define S3C2410_LCDBASEU(x) (x)
90
91#define S3C2410_OFFSIZE(x) ((x) << 11)
92#define S3C2410_PAGEWIDTH(x) (x)
93
94/* colour lookup and miscellaneous controls */
95
96#define S3C2410_REDLUT S3C2410_LCDREG(0x20)
97#define S3C2410_GREENLUT S3C2410_LCDREG(0x24)
98#define S3C2410_BLUELUT S3C2410_LCDREG(0x28)
99
100#define S3C2410_DITHMODE S3C2410_LCDREG(0x4C)
101#define S3C2410_TPAL S3C2410_LCDREG(0x50)
102
103/* interrupt info */
104#define S3C2410_LCDINTPND S3C2410_LCDREG(0x54)
105#define S3C2410_LCDSRCPND S3C2410_LCDREG(0x58)
106#define S3C2410_LCDINTMSK S3C2410_LCDREG(0x5C)
107#define S3C2410_LPCSEL S3C2410_LCDREG(0x60)
108
109#define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4))
110
111#endif /* ___ASM_ARCH_REGS_LCD_H */
112
113
114
diff --git a/include/asm-arm/arch-s3c2410/regs-mem.h b/include/asm-arm/arch-s3c2410/regs-mem.h
new file mode 100644
index 000000000000..1a1328ac0d79
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-mem.h
@@ -0,0 +1,212 @@
1/* linux/include/asm-arm/arch-s3c2410/regs-mem.h
2 *
3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 Memory Control register definitions
11 *
12 * Changelog:
13 * 29-Sep-2004 BJD Initial include for Linux
14 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
15 *
16*/
17
18#ifndef __ASM_ARM_MEMREGS_H
19#define __ASM_ARM_MEMREGS_H "$Id: regs.h,v 1.8 2003/05/01 15:55:41 ben Exp $"
20
21#ifndef S3C2410_MEMREG
22#define S3C2410_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
23#endif
24
25/* bus width, and wait state control */
26#define S3C2410_BWSCON S3C2410_MEMREG(0x0000)
27
28/* bank zero config - note, pinstrapped from OM pins! */
29#define S3C2410_BWSCON_DW0_16 (1<<1)
30#define S3C2410_BWSCON_DW0_32 (2<<1)
31
32/* bank one configs */
33#define S3C2410_BWSCON_DW1_8 (0<<4)
34#define S3C2410_BWSCON_DW1_16 (1<<4)
35#define S3C2410_BWSCON_DW1_32 (2<<4)
36#define S3C2410_BWSCON_WS1 (1<<6)
37#define S3C2410_BWSCON_ST1 (1<<7)
38
39/* bank 2 configurations */
40#define S3C2410_BWSCON_DW2_8 (0<<8)
41#define S3C2410_BWSCON_DW2_16 (1<<8)
42#define S3C2410_BWSCON_DW2_32 (2<<8)
43#define S3C2410_BWSCON_WS2 (1<<10)
44#define S3C2410_BWSCON_ST2 (1<<11)
45
46/* bank 3 configurations */
47#define S3C2410_BWSCON_DW3_8 (0<<12)
48#define S3C2410_BWSCON_DW3_16 (1<<12)
49#define S3C2410_BWSCON_DW3_32 (2<<12)
50#define S3C2410_BWSCON_WS3 (1<<14)
51#define S3C2410_BWSCON_ST3 (1<<15)
52
53/* bank 4 configurations */
54#define S3C2410_BWSCON_DW4_8 (0<<16)
55#define S3C2410_BWSCON_DW4_16 (1<<16)
56#define S3C2410_BWSCON_DW4_32 (2<<16)
57#define S3C2410_BWSCON_WS4 (1<<18)
58#define S3C2410_BWSCON_ST4 (1<<19)
59
60/* bank 5 configurations */
61#define S3C2410_BWSCON_DW5_8 (0<<20)
62#define S3C2410_BWSCON_DW5_16 (1<<20)
63#define S3C2410_BWSCON_DW5_32 (2<<20)
64#define S3C2410_BWSCON_WS5 (1<<22)
65#define S3C2410_BWSCON_ST5 (1<<23)
66
67/* bank 6 configurations */
68#define S3C2410_BWSCON_DW6_8 (0<<24)
69#define S3C2410_BWSCON_DW6_16 (1<<24)
70#define S3C2410_BWSCON_DW6_32 (2<<24)
71#define S3C2410_BWSCON_WS6 (1<<26)
72#define S3C2410_BWSCON_ST6 (1<<27)
73
74/* bank 7 configurations */
75#define S3C2410_BWSCON_DW7_8 (0<<28)
76#define S3C2410_BWSCON_DW7_16 (1<<28)
77#define S3C2410_BWSCON_DW7_32 (2<<28)
78#define S3C2410_BWSCON_WS7 (1<<30)
79#define S3C2410_BWSCON_ST7 (1<<31)
80
81/* memory set (rom, ram) */
82#define S3C2410_BANKCON0 S3C2410_MEMREG(0x0004)
83#define S3C2410_BANKCON1 S3C2410_MEMREG(0x0008)
84#define S3C2410_BANKCON2 S3C2410_MEMREG(0x000C)
85#define S3C2410_BANKCON3 S3C2410_MEMREG(0x0010)
86#define S3C2410_BANKCON4 S3C2410_MEMREG(0x0014)
87#define S3C2410_BANKCON5 S3C2410_MEMREG(0x0018)
88#define S3C2410_BANKCON6 S3C2410_MEMREG(0x001C)
89#define S3C2410_BANKCON7 S3C2410_MEMREG(0x0020)
90
91/* bank configuration registers */
92
93#define S3C2410_BANKCON_PMCnorm (0x00)
94#define S3C2410_BANKCON_PMC4 (0x01)
95#define S3C2410_BANKCON_PMC8 (0x02)
96#define S3C2410_BANKCON_PMC16 (0x03)
97
98/* bank configurations for banks 0..7, note banks
99 * 6 and 7 have differnt configurations depending on
100 * the memory type bits */
101
102#define S3C2410_BANKCON_Tacp2 (0x0 << 2)
103#define S3C2410_BANKCON_Tacp3 (0x1 << 2)
104#define S3C2410_BANKCON_Tacp4 (0x2 << 2)
105#define S3C2410_BANKCON_Tacp6 (0x3 << 2)
106
107#define S3C2410_BANKCON_Tcah0 (0x0 << 4)
108#define S3C2410_BANKCON_Tcah1 (0x1 << 4)
109#define S3C2410_BANKCON_Tcah2 (0x2 << 4)
110#define S3C2410_BANKCON_Tcah4 (0x3 << 4)
111
112#define S3C2410_BANKCON_Tcoh0 (0x0 << 6)
113#define S3C2410_BANKCON_Tcoh1 (0x1 << 6)
114#define S3C2410_BANKCON_Tcoh2 (0x2 << 6)
115#define S3C2410_BANKCON_Tcoh4 (0x3 << 6)
116
117#define S3C2410_BANKCON_Tacc1 (0x0 << 8)
118#define S3C2410_BANKCON_Tacc2 (0x1 << 8)
119#define S3C2410_BANKCON_Tacc3 (0x2 << 8)
120#define S3C2410_BANKCON_Tacc4 (0x3 << 8)
121#define S3C2410_BANKCON_Tacc6 (0x4 << 8)
122#define S3C2410_BANKCON_Tacc8 (0x5 << 8)
123#define S3C2410_BANKCON_Tacc10 (0x6 << 8)
124#define S3C2410_BANKCON_Tacc14 (0x7 << 8)
125
126#define S3C2410_BANKCON_Tcos0 (0x0 << 11)
127#define S3C2410_BANKCON_Tcos1 (0x1 << 11)
128#define S3C2410_BANKCON_Tcos2 (0x2 << 11)
129#define S3C2410_BANKCON_Tcos4 (0x3 << 11)
130
131#define S3C2410_BANKCON_Tacs0 (0x0 << 13)
132#define S3C2410_BANKCON_Tacs1 (0x1 << 13)
133#define S3C2410_BANKCON_Tacs2 (0x2 << 13)
134#define S3C2410_BANKCON_Tacs4 (0x3 << 13)
135
136#define S3C2410_BANKCON_SRAM (0x0 << 15)
137#define S3C2400_BANKCON_EDODRAM (0x2 << 15)
138#define S3C2410_BANKCON_SDRAM (0x3 << 15)
139
140/* next bits only for EDO DRAM in 6,7 */
141#define S3C2400_BANKCON_EDO_Trdc1 (0x00 << 4)
142#define S3C2400_BANKCON_EDO_Trdc2 (0x01 << 4)
143#define S3C2400_BANKCON_EDO_Trdc3 (0x02 << 4)
144#define S3C2400_BANKCON_EDO_Trdc4 (0x03 << 4)
145
146/* CAS pulse width */
147#define S3C2400_BANKCON_EDO_PULSE1 (0x00 << 3)
148#define S3C2400_BANKCON_EDO_PULSE2 (0x01 << 3)
149
150/* CAS pre-charge */
151#define S3C2400_BANKCON_EDO_TCP1 (0x00 << 2)
152#define S3C2400_BANKCON_EDO_TCP2 (0x01 << 2)
153
154/* control column address select */
155#define S3C2400_BANKCON_EDO_SCANb8 (0x00 << 0)
156#define S3C2400_BANKCON_EDO_SCANb9 (0x01 << 0)
157#define S3C2400_BANKCON_EDO_SCANb10 (0x02 << 0)
158#define S3C2400_BANKCON_EDO_SCANb11 (0x03 << 0)
159
160/* next bits only for SDRAM in 6,7 */
161#define S3C2410_BANKCON_Trdc2 (0x00 << 2)
162#define S3C2410_BANKCON_Trdc3 (0x01 << 2)
163#define S3C2410_BANKCON_Trdc4 (0x02 << 2)
164
165/* control column address select */
166#define S3C2410_BANKCON_SCANb8 (0x00 << 0)
167#define S3C2410_BANKCON_SCANb9 (0x01 << 0)
168#define S3C2410_BANKCON_SCANb10 (0x02 << 0)
169
170#define S3C2410_REFRESH S3C2410_MEMREG(0x0024)
171#define S3C2410_BANKSIZE S3C2410_MEMREG(0x0028)
172#define S3C2410_MRSRB6 S3C2410_MEMREG(0x002C)
173#define S3C2410_MRSRB7 S3C2410_MEMREG(0x0030)
174
175/* refresh control */
176
177#define S3C2410_REFRESH_REFEN (1<<23)
178#define S3C2410_REFRESH_SELF (1<<22)
179#define S3C2410_REFRESH_REFCOUNTER ((1<<11)-1)
180
181#define S3C2410_REFRESH_TRP_MASK (3<<20)
182#define S3C2410_REFRESH_TRP_2clk (0<<20)
183#define S3C2410_REFRESH_TRP_3clk (1<<20)
184#define S3C2410_REFRESH_TRP_4clk (2<<20)
185
186#define S3C2410_REFRESH_TSRC_MASK (3<<18)
187#define S3C2410_REFRESH_TSRC_4clk (0<<18)
188#define S3C2410_REFRESH_TSRC_5clk (1<<18)
189#define S3C2410_REFRESH_TSRC_6clk (2<<18)
190#define S3C2410_REFRESH_TSRC_7clk (3<<18)
191
192
193/* mode select register(s) */
194
195#define S3C2410_MRSRB_CL1 (0x00 << 4)
196#define S3C2410_MRSRB_CL2 (0x02 << 4)
197#define S3C2410_MRSRB_CL3 (0x03 << 4)
198
199/* bank size register */
200#define S3C2410_BANKSIZE_128M (0x2 << 0)
201#define S3C2410_BANKSIZE_64M (0x1 << 0)
202#define S3C2410_BANKSIZE_32M (0x0 << 0)
203#define S3C2410_BANKSIZE_16M (0x7 << 0)
204#define S3C2410_BANKSIZE_8M (0x6 << 0)
205#define S3C2410_BANKSIZE_4M (0x5 << 0)
206#define S3C2410_BANKSIZE_2M (0x4 << 0)
207#define S3C2410_BANKSIZE_MASK (0x7 << 0)
208#define S3C2410_BANKSIZE_SCLK_EN (1<<4)
209#define S3C2410_BANKSIZE_SCKE_EN (1<<5)
210#define S3C2410_BANKSIZE_BURST (1<<7)
211
212#endif /* __ASM_ARM_MEMREGS_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-nand.h b/include/asm-arm/arch-s3c2410/regs-nand.h
new file mode 100644
index 000000000000..c443ac834698
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-nand.h
@@ -0,0 +1,43 @@
1/* linux/include/asm-arm/arch-s3c2410/regs-nand.h
2 *
3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 clock register definitions
11 *
12 * Changelog:
13 * 18-Aug-2004 BJD Copied file from 2.4 and updated
14*/
15
16#ifndef __ASM_ARM_REGS_NAND
17#define __ASM_ARM_REGS_NAND "$Id: nand.h,v 1.3 2003/12/09 11:36:29 ben Exp $"
18
19
20#define S3C2410_NFREG(x) (x)
21
22#define S3C2410_NFCONF S3C2410_NFREG(0x00)
23#define S3C2410_NFCMD S3C2410_NFREG(0x04)
24#define S3C2410_NFADDR S3C2410_NFREG(0x08)
25#define S3C2410_NFDATA S3C2410_NFREG(0x0C)
26#define S3C2410_NFSTAT S3C2410_NFREG(0x10)
27#define S3C2410_NFECC S3C2410_NFREG(0x14)
28
29#define S3C2410_NFCONF_EN (1<<15)
30#define S3C2410_NFCONF_512BYTE (1<<14)
31#define S3C2410_NFCONF_4STEP (1<<13)
32#define S3C2410_NFCONF_INITECC (1<<12)
33#define S3C2410_NFCONF_nFCE (1<<11)
34#define S3C2410_NFCONF_TACLS(x) ((x)<<8)
35#define S3C2410_NFCONF_TWRPH0(x) ((x)<<4)
36#define S3C2410_NFCONF_TWRPH1(x) ((x)<<0)
37
38#define S3C2410_NFSTAT_BUSY (1<<0)
39
40/* think ECC can only be 8bit read? */
41
42#endif /* __ASM_ARM_REGS_NAND */
43
diff --git a/include/asm-arm/arch-s3c2410/regs-rtc.h b/include/asm-arm/arch-s3c2410/regs-rtc.h
new file mode 100644
index 000000000000..228983f89bc8
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-rtc.h
@@ -0,0 +1,66 @@
1/* linux/include/asm/arch-s3c2410/regs-rtc.h
2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 Internal RTC register definition
11 *
12 * Changelog:
13 * 19-06-2003 BJD Created file
14 * 12-03-2004 BJD Updated include protection
15 * 15-01-2005 LCVR Changed S3C2410_VA to S3C24XX_VA (s3c2400 support)
16*/
17
18#ifndef __ASM_ARCH_REGS_RTC_H
19#define __ASM_ARCH_REGS_RTC_H __FILE__
20
21#define S3C2410_RTCREG(x) ((x) + S3C24XX_VA_RTC)
22
23#define S3C2410_RTCCON S3C2410_RTCREG(0x40)
24#define S3C2410_RTCCON_RTCEN (1<<0)
25#define S3C2410_RTCCON_CLKSEL (1<<1)
26#define S3C2410_RTCCON_CNTSEL (1<<2)
27#define S3C2410_RTCCON_CLKRST (1<<3)
28
29#define S3C2410_TICNT S3C2410_RTCREG(0x44)
30#define S3C2410_TICNT_ENABLE (1<<7)
31
32#define S3C2410_RTCALM S3C2410_RTCREG(0x50)
33#define S3C2410_RTCALM_ALMEN (1<<6)
34#define S3C2410_RTCALM_YEAREN (1<<5)
35#define S3C2410_RTCALM_MONEN (1<<4)
36#define S3C2410_RTCALM_DAYEN (1<<3)
37#define S3C2410_RTCALM_HOUREN (1<<2)
38#define S3C2410_RTCALM_MINEN (1<<1)
39#define S3C2410_RTCALM_SECEN (1<<0)
40
41#define S3C2410_RTCALM_ALL \
42 S3C2410_RTCALM_ALMEN | S3C2410_RTCALM_YEAREN | S3C2410_RTCALM_MONEN |\
43 S3C2410_RTCALM_DAYEN | S3C2410_RTCALM_HOUREN | S3C2410_RTCALM_MINEN |\
44 S3C2410_RTCALM_SECEN
45
46
47#define S3C2410_ALMSEC S3C2410_RTCREG(0x54)
48#define S3C2410_ALMMIN S3C2410_RTCREG(0x58)
49#define S3C2410_ALMHOUR S3C2410_RTCREG(0x5c)
50
51#define S3C2410_ALMDATE S3C2410_RTCREG(0x60)
52#define S3C2410_ALMMON S3C2410_RTCREG(0x64)
53#define S3C2410_ALMYEAR S3C2410_RTCREG(0x68)
54
55#define S3C2410_RTCRST S3C2410_RTCREG(0x6c)
56
57#define S3C2410_RTCSEC S3C2410_RTCREG(0x70)
58#define S3C2410_RTCMIN S3C2410_RTCREG(0x74)
59#define S3C2410_RTCHOUR S3C2410_RTCREG(0x78)
60#define S3C2410_RTCDATE S3C2410_RTCREG(0x7c)
61#define S3C2410_RTCDAY S3C2410_RTCREG(0x80)
62#define S3C2410_RTCMON S3C2410_RTCREG(0x84)
63#define S3C2410_RTCYEAR S3C2410_RTCREG(0x88)
64
65
66#endif /* __ASM_ARCH_REGS_RTC_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-sdi.h b/include/asm-arm/arch-s3c2410/regs-sdi.h
new file mode 100644
index 000000000000..ca9a26fbecec
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-sdi.h
@@ -0,0 +1,118 @@
1/* linux/include/asm/arch-s3c2410/regs-sdi.h
2 *
3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 MMC/SDIO register definitions
11 *
12 * Changelog:
13 * 18-Aug-2004 Ben Dooks Created initial file
14 * 29-Nov-2004 Koen Martens Added some missing defines, fixed duplicates
15 * 29-Nov-2004 Ben Dooks Updated Koen's patch
16*/
17
18#ifndef __ASM_ARM_REGS_SDI
19#define __ASM_ARM_REGS_SDI "regs-sdi.h"
20
21#define S3C2410_SDICON (0x00)
22#define S3C2410_SDIPRE (0x04)
23#define S3C2410_SDICMDARG (0x08)
24#define S3C2410_SDICMDCON (0x0C)
25#define S3C2410_SDICMDSTAT (0x10)
26#define S3C2410_SDIRSP0 (0x14)
27#define S3C2410_SDIRSP1 (0x18)
28#define S3C2410_SDIRSP2 (0x1C)
29#define S3C2410_SDIRSP3 (0x20)
30#define S3C2410_SDITIMER (0x24)
31#define S3C2410_SDIBSIZE (0x28)
32#define S3C2410_SDIDCON (0x2C)
33#define S3C2410_SDIDCNT (0x30)
34#define S3C2410_SDIDSTA (0x34)
35#define S3C2410_SDIFSTA (0x38)
36#define S3C2410_SDIDATA (0x3C)
37#define S3C2410_SDIIMSK (0x40)
38
39#define S3C2410_SDICON_BYTEORDER (1<<4)
40#define S3C2410_SDICON_SDIOIRQ (1<<3)
41#define S3C2410_SDICON_RWAITEN (1<<2)
42#define S3C2410_SDICON_FIFORESET (1<<1)
43#define S3C2410_SDICON_CLOCKTYPE (1<<0)
44
45#define S3C2410_SDICMDCON_ABORT (1<<12)
46#define S3C2410_SDICMDCON_WITHDATA (1<<11)
47#define S3C2410_SDICMDCON_LONGRSP (1<<10)
48#define S3C2410_SDICMDCON_WAITRSP (1<<9)
49#define S3C2410_SDICMDCON_CMDSTART (1<<8)
50#define S3C2410_SDICMDCON_INDEX (0xff)
51
52#define S3C2410_SDICMDSTAT_CRCFAIL (1<<12)
53#define S3C2410_SDICMDSTAT_CMDSENT (1<<11)
54#define S3C2410_SDICMDSTAT_CMDTIMEOUT (1<<10)
55#define S3C2410_SDICMDSTAT_RSPFIN (1<<9)
56#define S3C2410_SDICMDSTAT_XFERING (1<<8)
57#define S3C2410_SDICMDSTAT_INDEX (0xff)
58
59#define S3C2410_SDIDCON_IRQPERIOD (1<<21)
60#define S3C2410_SDIDCON_TXAFTERRESP (1<<20)
61#define S3C2410_SDIDCON_RXAFTERCMD (1<<19)
62#define S3C2410_SDIDCON_BUSYAFTERCMD (1<<18)
63#define S3C2410_SDIDCON_BLOCKMODE (1<<17)
64#define S3C2410_SDIDCON_WIDEBUS (1<<16)
65#define S3C2410_SDIDCON_DMAEN (1<<15)
66#define S3C2410_SDIDCON_STOP (1<<14)
67#define S3C2410_SDIDCON_DATMODE (3<<12)
68#define S3C2410_SDIDCON_BLKNUM (0x7ff)
69
70/* constants for S3C2410_SDIDCON_DATMODE */
71#define S3C2410_SDIDCON_XFER_READY (0<<12)
72#define S3C2410_SDIDCON_XFER_CHKSTART (1<<12)
73#define S3C2410_SDIDCON_XFER_RXSTART (2<<12)
74#define S3C2410_SDIDCON_XFER_TXSTART (3<<12)
75
76#define S3C2410_SDIDCNT_BLKNUM_SHIFT (12)
77
78#define S3C2410_SDIDSTA_RDYWAITREQ (1<<10)
79#define S3C2410_SDIDSTA_SDIOIRQDETECT (1<<9)
80#define S3C2410_SDIDSTA_FIFOFAIL (1<<8) /* reserved on 2440 */
81#define S3C2410_SDIDSTA_CRCFAIL (1<<7)
82#define S3C2410_SDIDSTA_RXCRCFAIL (1<<6)
83#define S3C2410_SDIDSTA_DATATIMEOUT (1<<5)
84#define S3C2410_SDIDSTA_XFERFINISH (1<<4)
85#define S3C2410_SDIDSTA_BUSYFINISH (1<<3)
86#define S3C2410_SDIDSTA_SBITERR (1<<2) /* reserved on 2410a/2440 */
87#define S3C2410_SDIDSTA_TXDATAON (1<<1)
88#define S3C2410_SDIDSTA_RXDATAON (1<<0)
89
90#define S3C2410_SDIFSTA_TFDET (1<<13)
91#define S3C2410_SDIFSTA_RFDET (1<<12)
92#define S3C2410_SDIFSTA_TXHALF (1<<11)
93#define S3C2410_SDIFSTA_TXEMPTY (1<<10)
94#define S3C2410_SDIFSTA_RFLAST (1<<9)
95#define S3C2410_SDIFSTA_RFFULL (1<<8)
96#define S3C2410_SDIFSTA_RFHALF (1<<7)
97#define S3C2410_SDIFSTA_COUNTMASK (0x7f)
98
99#define S3C2410_SDIIMSK_RESPONSECRC (1<<17)
100#define S3C2410_SDIIMSK_CMDSENT (1<<16)
101#define S3C2410_SDIIMSK_CMDTIMEOUT (1<<15)
102#define S3C2410_SDIIMSK_RESPONSEND (1<<14)
103#define S3C2410_SDIIMSK_READWAIT (1<<13)
104#define S3C2410_SDIIMSK_SDIOIRQ (1<<12)
105#define S3C2410_SDIIMSK_FIFOFAIL (1<<11)
106#define S3C2410_SDIIMSK_CRCSTATUS (1<<10)
107#define S3C2410_SDIIMSK_DATACRC (1<<9)
108#define S3C2410_SDIIMSK_DATATIMEOUT (1<<8)
109#define S3C2410_SDIIMSK_DATAFINISH (1<<7)
110#define S3C2410_SDIIMSK_BUSYFINISH (1<<6)
111#define S3C2410_SDIIMSK_SBITERR (1<<5) /* reserved 2440/2410a */
112#define S3C2410_SDIIMSK_TXFIFOHALF (1<<4)
113#define S3C2410_SDIIMSK_TXFIFOEMPTY (1<<3)
114#define S3C2410_SDIIMSK_RXFIFOLAST (1<<2)
115#define S3C2410_SDIIMSK_RXFIFOFULL (1<<1)
116#define S3C2410_SDIIMSK_RXFIFOHALF (1<<0)
117
118#endif /* __ASM_ARM_REGS_SDI */
diff --git a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/arch-s3c2410/regs-serial.h
new file mode 100644
index 000000000000..ce1bbbaad6d3
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-serial.h
@@ -0,0 +1,209 @@
1/* linux/include/asm-arm/arch-s3c2410/regs-serial.h
2 *
3 * From linux/include/asm-arm/hardware/serial_s3c2410.h
4 *
5 * Internal header file for Samsung S3C2410 serial ports (UART0-2)
6 *
7 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
8 *
9 * Additional defines, (c) 2003 Simtec Electronics (linux@simtec.co.uk)
10 *
11 * Adapted from:
12 *
13 * Internal header file for MX1ADS serial ports (UART1 & 2)
14 *
15 * Copyright (C) 2002 Shane Nay (shane@minirl.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 as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 *
31 * Modifications:
32 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA (s3c2400 support)
33 */
34
35#ifndef __ASM_ARM_REGS_SERIAL_H
36#define __ASM_ARM_REGS_SERIAL_H
37
38#define S3C24XX_VA_UART0 (S3C24XX_VA_UART)
39#define S3C24XX_VA_UART1 (S3C24XX_VA_UART + 0x4000 )
40#define S3C24XX_VA_UART2 (S3C24XX_VA_UART + 0x8000 )
41
42#define S3C2410_PA_UART0 (S3C2410_PA_UART)
43#define S3C2410_PA_UART1 (S3C2410_PA_UART + 0x4000 )
44#define S3C2410_PA_UART2 (S3C2410_PA_UART + 0x8000 )
45
46#define S3C2410_URXH (0x24)
47#define S3C2410_UTXH (0x20)
48#define S3C2410_ULCON (0x00)
49#define S3C2410_UCON (0x04)
50#define S3C2410_UFCON (0x08)
51#define S3C2410_UMCON (0x0C)
52#define S3C2410_UBRDIV (0x28)
53#define S3C2410_UTRSTAT (0x10)
54#define S3C2410_UERSTAT (0x14)
55#define S3C2410_UFSTAT (0x18)
56#define S3C2410_UMSTAT (0x1C)
57
58#define S3C2410_LCON_CFGMASK ((0xF<<3)|(0x3))
59
60#define S3C2410_LCON_CS5 (0x0)
61#define S3C2410_LCON_CS6 (0x1)
62#define S3C2410_LCON_CS7 (0x2)
63#define S3C2410_LCON_CS8 (0x3)
64#define S3C2410_LCON_CSMASK (0x3)
65
66#define S3C2410_LCON_PNONE (0x0)
67#define S3C2410_LCON_PEVEN (0x5 << 3)
68#define S3C2410_LCON_PODD (0x4 << 3)
69#define S3C2410_LCON_PMASK (0x7 << 3)
70
71#define S3C2410_LCON_STOPB (1<<2)
72#define S3C2410_LCON_IRM (1<<6)
73
74#define S3C2440_UCON_CLKMASK (3<<10)
75#define S3C2440_UCON_PCLK (0<<10)
76#define S3C2440_UCON_UCLK (1<<10)
77#define S3C2440_UCON_PCLK2 (2<<10)
78#define S3C2440_UCON_FCLK (3<<10)
79#define S3C2440_UCON2_FCLK_EN (1<<15)
80#define S3C2440_UCON0_DIVMASK (15 << 12)
81#define S3C2440_UCON1_DIVMASK (15 << 12)
82#define S3C2440_UCON2_DIVMASK (7 << 12)
83#define S3C2440_UCON_DIVSHIFT (12)
84
85#define S3C2410_UCON_UCLK (1<<10)
86#define S3C2410_UCON_SBREAK (1<<4)
87
88#define S3C2410_UCON_TXILEVEL (1<<9)
89#define S3C2410_UCON_RXILEVEL (1<<8)
90#define S3C2410_UCON_TXIRQMODE (1<<2)
91#define S3C2410_UCON_RXIRQMODE (1<<0)
92#define S3C2410_UCON_RXFIFO_TOI (1<<7)
93
94#define S3C2410_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
95 S3C2410_UCON_RXILEVEL | \
96 S3C2410_UCON_TXIRQMODE | \
97 S3C2410_UCON_RXIRQMODE | \
98 S3C2410_UCON_RXFIFO_TOI)
99
100#define S3C2410_UFCON_FIFOMODE (1<<0)
101#define S3C2410_UFCON_TXTRIG0 (0<<6)
102#define S3C2410_UFCON_RXTRIG8 (1<<4)
103#define S3C2410_UFCON_RXTRIG12 (2<<4)
104
105/* S3C2440 FIFO trigger levels */
106#define S3C2440_UFCON_RXTRIG1 (0<<4)
107#define S3C2440_UFCON_RXTRIG8 (1<<4)
108#define S3C2440_UFCON_RXTRIG16 (2<<4)
109#define S3C2440_UFCON_RXTRIG32 (3<<4)
110
111#define S3C2440_UFCON_TXTRIG0 (0<<6)
112#define S3C2440_UFCON_TXTRIG16 (1<<6)
113#define S3C2440_UFCON_TXTRIG32 (2<<6)
114#define S3C2440_UFCON_TXTRIG48 (3<<6)
115
116#define S3C2410_UFCON_RESETBOTH (3<<1)
117#define S3C2410_UFCON_RESETTX (1<<2)
118#define S3C2410_UFCON_RESETRX (1<<1)
119
120#define S3C2410_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
121 S3C2410_UFCON_TXTRIG0 | \
122 S3C2410_UFCON_RXTRIG8 )
123
124#define S3C2410_UMCOM_AFC (1<<4)
125#define S3C2410_UMCOM_RTS_LOW (1<<0)
126
127#define S3C2410_UFSTAT_TXFULL (1<<9)
128#define S3C2410_UFSTAT_RXFULL (1<<8)
129#define S3C2410_UFSTAT_TXMASK (15<<4)
130#define S3C2410_UFSTAT_TXSHIFT (4)
131#define S3C2410_UFSTAT_RXMASK (15<<0)
132#define S3C2410_UFSTAT_RXSHIFT (0)
133
134#define S3C2440_UFSTAT_TXFULL (1<<14)
135#define S3C2440_UFSTAT_RXFULL (1<<6)
136#define S3C2440_UFSTAT_TXSHIFT (8)
137#define S3C2440_UFSTAT_RXSHIFT (0)
138#define S3C2440_UFSTAT_TXMASK (63<<8)
139#define S3C2440_UFSTAT_RXMASK (63)
140
141#define S3C2410_UTRSTAT_TXE (1<<2)
142#define S3C2410_UTRSTAT_TXFE (1<<1)
143#define S3C2410_UTRSTAT_RXDR (1<<0)
144
145#define S3C2410_UERSTAT_OVERRUN (1<<0)
146#define S3C2410_UERSTAT_FRAME (1<<2)
147#define S3C2410_UERSTAT_BREAK (1<<3)
148#define S3C2410_UERSTAT_ANY (S3C2410_UERSTAT_OVERRUN | \
149 S3C2410_UERSTAT_FRAME | \
150 S3C2410_UERSTAT_BREAK)
151
152#define S3C2410_UMSTAT_CTS (1<<0)
153#define S3C2410_UMSTAT_DeltaCTS (1<<2)
154
155#ifndef __ASSEMBLY__
156
157/* struct s3c24xx_uart_clksrc
158 *
159 * this structure defines a named clock source that can be used for the
160 * uart, so that the best clock can be selected for the requested baud
161 * rate.
162 *
163 * min_baud and max_baud define the range of baud-rates this clock is
164 * acceptable for, if they are both zero, it is assumed any baud rate that
165 * can be generated from this clock will be used.
166 *
167 * divisor gives the divisor from the clock to the one seen by the uart
168*/
169
170struct s3c24xx_uart_clksrc {
171 const char *name;
172 unsigned int divisor;
173 unsigned int min_baud;
174 unsigned int max_baud;
175};
176
177/* configuration structure for per-machine configurations for the
178 * serial port
179 *
180 * the pointer is setup by the machine specific initialisation from the
181 * arch/arm/mach-s3c2410/ directory.
182*/
183
184struct s3c2410_uartcfg {
185 unsigned char hwport; /* hardware port number */
186 unsigned char unused;
187 unsigned short flags;
188 unsigned long uart_flags; /* default uart flags */
189
190 unsigned long ucon; /* value of ucon for port */
191 unsigned long ulcon; /* value of ulcon for port */
192 unsigned long ufcon; /* value of ufcon for port */
193
194 struct s3c24xx_uart_clksrc *clocks;
195 unsigned int clocks_size;
196};
197
198/* s3c24xx_uart_devs
199 *
200 * this is exported from the core as we cannot use driver_register(),
201 * or platform_add_device() before the console_initcall()
202*/
203
204extern struct platform_device *s3c24xx_uart_devs[3];
205
206#endif /* __ASSEMBLY__ */
207
208#endif /* __ASM_ARM_REGS_SERIAL_H */
209
diff --git a/include/asm-arm/arch-s3c2410/regs-spi.h b/include/asm-arm/arch-s3c2410/regs-spi.h
new file mode 100644
index 000000000000..cb502a88158b
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-spi.h
@@ -0,0 +1,56 @@
1/* linux/include/asm-arm/arch-s3c2410/regs-spi.h
2 *
3 * Copyright (c) 2004 Fetron GmbH
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * S3C2410 SPI register definition
10 *
11 * Changelog:
12 * 20-04-2004 KF Created file
13 * 04-10-2004 BJD Removed VA address (no longer mapped)
14 * tidied file for submission
15 */
16
17#ifndef __ASM_ARCH_REGS_SPI_H
18#define __ASM_ARCH_REGS_SPI_H
19
20
21#define S3C2410_SPCON (0x00)
22
23#define S3C2410_SPCON_SMOD_DMA (2<<5) /* DMA mode */
24#define S3C2410_SPCON_SMOD_INT (1<<5) /* interrupt mode */
25#define S3C2410_SPCON_SMOD_POLL (0<<5) /* polling mode */
26#define S3C2410_SPCON_ENSCK (1<<4) /* Enable SCK */
27#define S3C2410_SPCON_MSTR (1<<3) /* Master/Slave select
28 0: slave, 1: master */
29#define S3C2410_SPCON_CPOL_HIGH (1<<2) /* Clock polarity select */
30#define S3C2410_SPCON_CPOL_LOW (0<<2) /* Clock polarity select */
31
32#define S3C2410_SPCON_CPHA_FMTB (1<<1) /* Clock Phase Select */
33#define S3C2410_SPCON_CPHA_FMTA (0<<1) /* Clock Phase Select */
34
35#define S3C2410_SPCON_TAGD (1<<0) /* Tx auto garbage data mode */
36
37
38#define S3C2410_SPSTA (0x04)
39
40#define S3C2410_SPSTA_DCOL (1<<2) /* Data Collision Error */
41#define S3C2410_SPSTA_MULD (1<<1) /* Multi Master Error */
42#define S3C2410_SPSTA_READY (1<<0) /* Data Tx/Rx ready */
43
44
45#define S3C2410_SPPIN (0x08)
46
47#define S3C2410_SPPIN_ENMUL (1<<2) /* Multi Master Error detect */
48#define S3C2410_SPPIN_RESERVED (1<<1)
49#define S3C2410_SPPIN_KEEP (1<<0) /* Master Out keep */
50
51
52#define S3C2410_SPPRE (0x0C)
53#define S3C2410_SPTDAT (0x10)
54#define S3C2410_SPRDAT (0x14)
55
56#endif /* __ASM_ARCH_REGS_SPI_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-timer.h b/include/asm-arm/arch-s3c2410/regs-timer.h
new file mode 100644
index 000000000000..169064e27520
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-timer.h
@@ -0,0 +1,113 @@
1/* linux/include/asm/arch-s3c2410/regs-timer.h
2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 Timer configuration
11 *
12 * Changelog:
13 * 05-06-2003 BJD Created file
14 * 26-06-2003 BJD Added more timer definitions to mux / control
15 * 12-03-2004 BJD Updated include protection
16 * 10-02-2005 BJD Added S3C2410_TCFG1_MUX4_SHIFT (Guillaume Gourat)
17 * 10-03-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
18*/
19
20
21#ifndef __ASM_ARCH_REGS_TIMER_H
22#define __ASM_ARCH_REGS_TIMER_H "$Id: timer.h,v 1.4 2003/05/06 19:30:50 ben Exp $"
23
24#define S3C2410_TIMERREG(x) (S3C24XX_VA_TIMER + (x))
25#define S3C2410_TIMERREG2(tmr,reg) S3C2410_TIMERREG((reg)+0x0c+((tmr)*0x0c))
26
27#define S3C2410_TCFG0 S3C2410_TIMERREG(0x00)
28#define S3C2410_TCFG1 S3C2410_TIMERREG(0x04)
29#define S3C2410_TCON S3C2410_TIMERREG(0x08)
30
31#define S3C2410_TCFG_PRESCALER0_MASK (255<<0)
32#define S3C2410_TCFG_PRESCALER1_MASK (255<<8)
33#define S3C2410_TCFG_PRESCALER1_SHIFT (8)
34#define S3C2410_TCFG_DEADZONE_MASK (255<<16)
35#define S3C2410_TCFG_DEADZONE_SHIFT (16)
36
37#define S3C2410_TCFG1_MUX4_DIV2 (0<<16)
38#define S3C2410_TCFG1_MUX4_DIV4 (1<<16)
39#define S3C2410_TCFG1_MUX4_DIV8 (2<<16)
40#define S3C2410_TCFG1_MUX4_DIV16 (3<<16)
41#define S3C2410_TCFG1_MUX4_TCLK1 (4<<16)
42#define S3C2410_TCFG1_MUX4_MASK (15<<16)
43#define S3C2410_TCFG1_MUX4_SHIFT (16)
44
45#define S3C2410_TCFG1_MUX3_DIV2 (0<<12)
46#define S3C2410_TCFG1_MUX3_DIV4 (1<<12)
47#define S3C2410_TCFG1_MUX3_DIV8 (2<<12)
48#define S3C2410_TCFG1_MUX3_DIV16 (3<<12)
49#define S3C2410_TCFG1_MUX3_TCLK1 (4<<12)
50#define S3C2410_TCFG1_MUX3_MASK (15<<12)
51
52
53#define S3C2410_TCFG1_MUX2_DIV2 (0<<8)
54#define S3C2410_TCFG1_MUX2_DIV4 (1<<8)
55#define S3C2410_TCFG1_MUX2_DIV8 (2<<8)
56#define S3C2410_TCFG1_MUX2_DIV16 (3<<8)
57#define S3C2410_TCFG1_MUX2_TCLK1 (4<<8)
58#define S3C2410_TCFG1_MUX2_MASK (15<<8)
59
60
61#define S3C2410_TCFG1_MUX1_DIV2 (0<<4)
62#define S3C2410_TCFG1_MUX1_DIV4 (1<<4)
63#define S3C2410_TCFG1_MUX1_DIV8 (2<<4)
64#define S3C2410_TCFG1_MUX1_DIV16 (3<<4)
65#define S3C2410_TCFG1_MUX1_TCLK0 (4<<4)
66#define S3C2410_TCFG1_MUX1_MASK (15<<4)
67
68#define S3C2410_TCFG1_MUX0_DIV2 (0<<0)
69#define S3C2410_TCFG1_MUX0_DIV4 (1<<0)
70#define S3C2410_TCFG1_MUX0_DIV8 (2<<0)
71#define S3C2410_TCFG1_MUX0_DIV16 (3<<0)
72#define S3C2410_TCFG1_MUX0_TCLK0 (4<<0)
73#define S3C2410_TCFG1_MUX0_MASK (15<<0)
74
75/* for each timer, we have an count buffer, an compare buffer and
76 * an observation buffer
77*/
78
79/* WARNING - timer 4 has no buffer reg, and it's observation is at +4 */
80
81#define S3C2410_TCNTB(tmr) S3C2410_TIMERREG2(tmr, 0x00)
82#define S3C2410_TCMPB(tmr) S3C2410_TIMERREG2(tmr, 0x04)
83#define S3C2410_TCNTO(tmr) S3C2410_TIMERREG2(tmr, (((tmr) == 4) ? 0x04 : 0x08))
84
85#define S3C2410_TCON_T4RELOAD (1<<22)
86#define S3C2410_TCON_T4MANUALUPD (1<<21)
87#define S3C2410_TCON_T4START (1<<20)
88
89#define S3C2410_TCON_T3RELOAD (1<<19)
90#define S3C2410_TCON_T3INVERT (1<<18)
91#define S3C2410_TCON_T3MANUALUPD (1<<17)
92#define S3C2410_TCON_T3START (1<<16)
93
94#define S3C2410_TCON_T2RELOAD (1<<15)
95#define S3C2410_TCON_T2INVERT (1<<14)
96#define S3C2410_TCON_T2MANUALUPD (1<<13)
97#define S3C2410_TCON_T2START (1<<12)
98
99#define S3C2410_TCON_T1RELOAD (1<<11)
100#define S3C2410_TCON_T1INVERT (1<<10)
101#define S3C2410_TCON_T1MANUALUPD (1<<9)
102#define S3C2410_TCON_T1START (1<<8)
103
104#define S3C2410_TCON_T0DEADZONE (1<<4)
105#define S3C2410_TCON_T0RELOAD (1<<3)
106#define S3C2410_TCON_T0INVERT (1<<2)
107#define S3C2410_TCON_T0MANUALUPD (1<<1)
108#define S3C2410_TCON_T0START (1<<0)
109
110#endif /* __ASM_ARCH_REGS_TIMER_H */
111
112
113
diff --git a/include/asm-arm/arch-s3c2410/regs-udc.h b/include/asm-arm/arch-s3c2410/regs-udc.h
new file mode 100644
index 000000000000..bf315b763252
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-udc.h
@@ -0,0 +1,164 @@
1/* linux/include/asm/arch-s3c2410/regs-udc.h
2 *
3 * Copyright (C) 2004 Herbert Poetzl <herbert@13thfloor.at>
4 *
5 * This include file is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
9 *
10 * Changelog:
11 * 01-08-2004 Initial creation
12 * 12-09-2004 Cleanup for submission
13 * 24-10-2004 Fixed S3C2410_UDC_MAXP_REG definition
14 * 10-03-2005 Changed S3C2410_VA to S3C24XX_VA
15 */
16
17#ifndef __ASM_ARCH_REGS_UDC_H
18#define __ASM_ARCH_REGS_UDC_H
19
20
21#define S3C2410_USBDREG(x) ((x) + S3C24XX_VA_USBDEV)
22
23#define S3C2410_UDC_FUNC_ADDR_REG S3C2410_USBDREG(0x0140)
24#define S3C2410_UDC_PWR_REG S3C2410_USBDREG(0x0144)
25#define S3C2410_UDC_EP_INT_REG S3C2410_USBDREG(0x0148)
26
27#define S3C2410_UDC_USB_INT_REG S3C2410_USBDREG(0x0158)
28#define S3C2410_UDC_EP_INT_EN_REG S3C2410_USBDREG(0x015c)
29
30#define S3C2410_UDC_USB_INT_EN_REG S3C2410_USBDREG(0x016c)
31
32#define S3C2410_UDC_FRAME_NUM1_REG S3C2410_USBDREG(0x0170)
33#define S3C2410_UDC_FRAME_NUM2_REG S3C2410_USBDREG(0x0174)
34
35#define S3C2410_UDC_EP0_FIFO_REG S3C2410_USBDREG(0x01c0)
36#define S3C2410_UDC_EP1_FIFO_REG S3C2410_USBDREG(0x01c4)
37#define S3C2410_UDC_EP2_FIFO_REG S3C2410_USBDREG(0x01c8)
38#define S3C2410_UDC_EP3_FIFO_REG S3C2410_USBDREG(0x01cc)
39#define S3C2410_UDC_EP4_FIFO_REG S3C2410_USBDREG(0x01d0)
40
41#define S3C2410_UDC_EP1_DMA_CON S3C2410_USBDREG(0x0200)
42#define S3C2410_UDC_EP1_DMA_UNIT S3C2410_USBDREG(0x0204)
43#define S3C2410_UDC_EP1_DMA_FIFO S3C2410_USBDREG(0x0208)
44#define S3C2410_UDC_EP1_DMA_TTC_L S3C2410_USBDREG(0x020c)
45#define S3C2410_UDC_EP1_DMA_TTC_M S3C2410_USBDREG(0x0210)
46#define S3C2410_UDC_EP1_DMA_TTC_H S3C2410_USBDREG(0x0214)
47
48#define S3C2410_UDC_EP2_DMA_CON S3C2410_USBDREG(0x0218)
49#define S3C2410_UDC_EP2_DMA_UNIT S3C2410_USBDREG(0x021c)
50#define S3C2410_UDC_EP2_DMA_FIFO S3C2410_USBDREG(0x0220)
51#define S3C2410_UDC_EP2_DMA_TTC_L S3C2410_USBDREG(0x0224)
52#define S3C2410_UDC_EP2_DMA_TTC_M S3C2410_USBDREG(0x0228)
53#define S3C2410_UDC_EP2_DMA_TTC_H S3C2410_USBDREG(0x022c)
54
55#define S3C2410_UDC_EP3_DMA_CON S3C2410_USBDREG(0x0240)
56#define S3C2410_UDC_EP3_DMA_UNIT S3C2410_USBDREG(0x0244)
57#define S3C2410_UDC_EP3_DMA_FIFO S3C2410_USBDREG(0x0248)
58#define S3C2410_UDC_EP3_DMA_TTC_L S3C2410_USBDREG(0x024c)
59#define S3C2410_UDC_EP3_DMA_TTC_M S3C2410_USBDREG(0x0250)
60#define S3C2410_UDC_EP3_DMA_TTC_H S3C2410_USBDREG(0x0254)
61
62#define S3C2410_UDC_EP4_DMA_CON S3C2410_USBDREG(0x0258)
63#define S3C2410_UDC_EP4_DMA_UNIT S3C2410_USBDREG(0x025c)
64#define S3C2410_UDC_EP4_DMA_FIFO S3C2410_USBDREG(0x0260)
65#define S3C2410_UDC_EP4_DMA_TTC_L S3C2410_USBDREG(0x0264)
66#define S3C2410_UDC_EP4_DMA_TTC_M S3C2410_USBDREG(0x0268)
67#define S3C2410_UDC_EP4_DMA_TTC_H S3C2410_USBDREG(0x026c)
68
69#define S3C2410_UDC_INDEX_REG S3C2410_USBDREG(0x0178)
70
71/* indexed registers */
72
73#define S3C2410_UDC_MAXP_REG S3C2410_USBDREG(0x0180)
74
75#define S3C2410_UDC_EP0_CSR_REG S3C2410_USBDREG(0x0184)
76
77#define S3C2410_UDC_IN_CSR1_REG S3C2410_USBDREG(0x0184)
78#define S3C2410_UDC_IN_CSR2_REG S3C2410_USBDREG(0x0188)
79
80#define S3C2410_UDC_OUT_CSR1_REG S3C2410_USBDREG(0x0190)
81#define S3C2410_UDC_OUT_CSR2_REG S3C2410_USBDREG(0x0194)
82#define S3C2410_UDC_OUT_FIFO_CNT1_REG S3C2410_USBDREG(0x0198)
83#define S3C2410_UDC_OUT_FIFO_CNT2_REG S3C2410_USBDREG(0x019c)
84
85
86
87#define S3C2410_UDC_PWR_ISOUP (1<<7) // R/W
88#define S3C2410_UDC_PWR_RESET (1<<3) // R
89#define S3C2410_UDC_PWR_RESUME (1<<2) // R/W
90#define S3C2410_UDC_PWR_SUSPEND (1<<1) // R
91#define S3C2410_UDC_PWR_ENSUSPEND (1<<0) // R/W
92
93#define S3C2410_UDC_PWR_DEFAULT 0x00
94
95#define S3C2410_UDC_INT_EP4 (1<<4) // R/W (clear only)
96#define S3C2410_UDC_INT_EP3 (1<<3) // R/W (clear only)
97#define S3C2410_UDC_INT_EP2 (1<<2) // R/W (clear only)
98#define S3C2410_UDC_INT_EP1 (1<<1) // R/W (clear only)
99#define S3C2410_UDC_INT_EP0 (1<<0) // R/W (clear only)
100
101#define S3C2410_UDC_USBINT_RESET (1<<2) // R/W (clear only)
102#define S3C2410_UDC_USBINT_RESUME (1<<1) // R/W (clear only)
103#define S3C2410_UDC_USBINT_SUSPEND (1<<0) // R/W (clear only)
104
105#define S3C2410_UDC_INTE_EP4 (1<<4) // R/W
106#define S3C2410_UDC_INTE_EP3 (1<<3) // R/W
107#define S3C2410_UDC_INTE_EP2 (1<<2) // R/W
108#define S3C2410_UDC_INTE_EP1 (1<<1) // R/W
109#define S3C2410_UDC_INTE_EP0 (1<<0) // R/W
110
111#define S3C2410_UDC_USBINTE_RESET (1<<2) // R/W
112#define S3C2410_UDC_USBINTE_SUSPEND (1<<0) // R/W
113
114
115#define S3C2410_UDC_INDEX_EP0 (0x00)
116#define S3C2410_UDC_INDEX_EP1 (0x01) // ??
117#define S3C2410_UDC_INDEX_EP2 (0x02) // ??
118#define S3C2410_UDC_INDEX_EP3 (0x03) // ??
119#define S3C2410_UDC_INDEX_EP4 (0x04) // ??
120
121#define S3C2410_UDC_ICSR1_CLRDT (1<<6) // R/W
122#define S3C2410_UDC_ICSR1_SENTSTL (1<<5) // R/W (clear only)
123#define S3C2410_UDC_ICSR1_SENDSTL (1<<4) // R/W
124#define S3C2410_UDC_ICSR1_FFLUSH (1<<3) // W (set only)
125#define S3C2410_UDC_ICSR1_UNDRUN (1<<2) // R/W (clear only)
126#define S3C2410_UDC_ICSR1_PKTRDY (1<<0) // R/W (set only)
127
128#define S3C2410_UDC_ICSR2_AUTOSET (1<<7) // R/W
129#define S3C2410_UDC_ICSR2_ISO (1<<6) // R/W
130#define S3C2410_UDC_ICSR2_MODEIN (1<<5) // R/W
131#define S3C2410_UDC_ICSR2_DMAIEN (1<<4) // R/W
132
133#define S3C2410_UDC_OCSR1_CLRDT (1<<7) // R/W
134#define S3C2410_UDC_OCSR1_SENTSTL (1<<6) // R/W (clear only)
135#define S3C2410_UDC_OCSR1_SENDSTL (1<<5) // R/W
136#define S3C2410_UDC_OCSR1_FFLUSH (1<<4) // R/W
137#define S3C2410_UDC_OCSR1_DERROR (1<<3) // R
138#define S3C2410_UDC_OCSR1_OVRRUN (1<<2) // R/W (clear only)
139#define S3C2410_UDC_OCSR1_PKTRDY (1<<0) // R/W (clear only)
140
141#define S3C2410_UDC_OCSR2_AUTOCLR (1<<7) // R/W
142#define S3C2410_UDC_OCSR2_ISO (1<<6) // R/W
143#define S3C2410_UDC_OCSR2_DMAIEN (1<<5) // R/W
144
145#define S3C2410_UDC_SETIX(x) \
146 __raw_writel(S3C2410_UDC_INDEX_ ## x, S3C2410_UDC_INDEX_REG);
147
148
149#define S3C2410_UDC_EP0_CSR_OPKRDY (1<<0)
150#define S3C2410_UDC_EP0_CSR_IPKRDY (1<<1)
151#define S3C2410_UDC_EP0_CSR_SENTSTL (1<<2)
152#define S3C2410_UDC_EP0_CSR_DE (1<<3)
153#define S3C2410_UDC_EP0_CSR_SE (1<<4)
154#define S3C2410_UDC_EP0_CSR_SENDSTL (1<<5)
155#define S3C2410_UDC_EP0_CSR_SOPKTRDY (1<<6)
156#define S3C2410_UDC_EP0_CSR_SSE (1<<7)
157
158#define S3C2410_UDC_MAXP_8 (1<<0)
159#define S3C2410_UDC_MAXP_16 (1<<1)
160#define S3C2410_UDC_MAXP_32 (1<<2)
161#define S3C2410_UDC_MAXP_64 (1<<3)
162
163
164#endif
diff --git a/include/asm-arm/arch-s3c2410/regs-watchdog.h b/include/asm-arm/arch-s3c2410/regs-watchdog.h
new file mode 100644
index 000000000000..d199ca6aff22
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-watchdog.h
@@ -0,0 +1,46 @@
1/* linux/include/asm/arch-s3c2410/regs0watchdog.h
2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 Watchdog timer control
11 *
12 * Changelog:
13 * 21-06-2003 BJD Created file
14 * 12-03-2004 BJD Updated include protection
15 * 10-03-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
16*/
17
18
19#ifndef __ASM_ARCH_REGS_WATCHDOG_H
20#define __ASM_ARCH_REGS_WATCHDOG_H "$Id: watchdog.h,v 1.2 2003/04/29 13:31:09 ben Exp $"
21
22#define S3C2410_WDOGREG(x) ((x) + S3C24XX_VA_WATCHDOG)
23
24#define S3C2410_WTCON S3C2410_WDOGREG(0x00)
25#define S3C2410_WTDAT S3C2410_WDOGREG(0x04)
26#define S3C2410_WTCNT S3C2410_WDOGREG(0x08)
27
28/* the watchdog can either generate a reset pulse, or an
29 * interrupt.
30 */
31
32#define S3C2410_WTCON_RSTEN (0x01)
33#define S3C2410_WTCON_INTEN (1<<2)
34#define S3C2410_WTCON_ENABLE (1<<5)
35
36#define S3C2410_WTCON_DIV16 (0<<3)
37#define S3C2410_WTCON_DIV32 (1<<3)
38#define S3C2410_WTCON_DIV64 (2<<3)
39#define S3C2410_WTCON_DIV128 (3<<3)
40
41#define S3C2410_WTCON_PRESCALE(x) ((x) << 8)
42#define S3C2410_WTCON_PRESCALE_MASK (0xff00)
43
44#endif /* __ASM_ARCH_REGS_WATCHDOG_H */
45
46
diff --git a/include/asm-arm/arch-s3c2410/system.h b/include/asm-arm/arch-s3c2410/system.h
new file mode 100644
index 000000000000..9b0d85024cb4
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/system.h
@@ -0,0 +1,90 @@
1/* linux/include/asm-arm/arch-s3c2410/system.h
2 *
3 * (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - System function defines and includes
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 * Changelog:
13 * 12-May-2003 BJD Created file
14 * 14-May-2003 BJD Removed idle to aid debugging
15 * 12-Jun-2003 BJD Added reset via watchdog
16 * 04-Sep-2003 BJD Moved to v2.6
17 * 28-Oct-2004 BJD Added over-ride for idle, and fixed reset panic()
18 */
19
20#include <asm/hardware.h>
21#include <asm/io.h>
22
23#include <asm/arch/map.h>
24#include <asm/arch/idle.h>
25
26#include <asm/arch/regs-watchdog.h>
27#include <asm/arch/regs-clock.h>
28
29void (*s3c24xx_idle)(void);
30
31void s3c24xx_default_idle(void)
32{
33 void __iomem *reg = S3C2410_CLKCON;
34 unsigned long tmp;
35 int i;
36
37 /* idle the system by using the idle mode which will wait for an
38 * interrupt to happen before restarting the system.
39 */
40
41 /* Warning: going into idle state upsets jtag scanning */
42
43 __raw_writel(__raw_readl(reg) | (1<<2), reg);
44
45 /* the samsung port seems to do a loop and then unset idle.. */
46 for (i = 0; i < 50; i++) {
47 tmp += __raw_readl(reg); /* ensure loop not optimised out */
48 }
49
50 /* this bit is not cleared on re-start... */
51
52 __raw_writel(__raw_readl(reg) & ~(1<<2), reg);
53}
54
55static void arch_idle(void)
56{
57 if (s3c24xx_idle != NULL)
58 (s3c24xx_idle)();
59 else
60 s3c24xx_default_idle();
61}
62
63
64static void
65arch_reset(char mode)
66{
67 if (mode == 's') {
68 cpu_reset(0);
69 }
70
71 printk("arch_reset: attempting watchdog reset\n");
72
73 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
74
75 /* put initial values into count and data */
76 __raw_writel(0x100, S3C2410_WTCNT);
77 __raw_writel(0x100, S3C2410_WTDAT);
78
79 /* set the watchdog to go and reset... */
80 __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
81 S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
82
83 /* wait for reset to assert... */
84 mdelay(5000);
85
86 printk(KERN_ERR "Watchdog reset failed to assert reset\n");
87
88 /* we'll take a jump through zero as a poor second */
89 cpu_reset(0);
90}
diff --git a/include/asm-arm/arch-s3c2410/timex.h b/include/asm-arm/arch-s3c2410/timex.h
new file mode 100644
index 000000000000..3558a3a750bf
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/timex.h
@@ -0,0 +1,32 @@
1/* linux/include/asm-arm/arch-s3c2410/timex.h
2 *
3 * (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - time parameters
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 * Changelog:
13 * 02-Sep-2003 BJD Created file
14 * 05-Jan-2004 BJD Updated for Linux 2.6.0
15 * 22-Nov-2004 BJD Fixed CLOCK_TICK_RATE
16 * 10-Jan-2004 BJD Removed s3c2410_clock_tick_rate
17*/
18
19#ifndef __ASM_ARCH_TIMEX_H
20#define __ASM_ARCH_TIMEX_H
21
22/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
23 * a variable is useless. It seems as long as we make our timers an
24 * exact multiple of HZ, any value that makes a 1->1 correspondence
25 * for the time conversion functions to/from jiffies is acceptable.
26*/
27
28
29#define CLOCK_TICK_RATE 12000000
30
31
32#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h
new file mode 100644
index 000000000000..ad4252e27799
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/uncompress.h
@@ -0,0 +1,158 @@
1/* linux/include/asm-arm/arch-s3c2410/uncompress.h
2 *
3 * (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - uncompress code
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 * Changelog:
13 * 22-May-2003 BJD Created
14 * 08-Sep-2003 BJD Moved to linux v2.6
15 * 12-Mar-2004 BJD Updated header protection
16 * 12-Oct-2004 BJD Take account of debug uart configuration
17 * 15-Nov-2004 BJD Fixed uart configuration
18 * 22-Feb-2005 BJD Added watchdog to uncompress
19*/
20
21#ifndef __ASM_ARCH_UNCOMPRESS_H
22#define __ASM_ARCH_UNCOMPRESS_H
23
24#include <linux/config.h>
25
26/* defines for UART registers */
27#include "asm/arch/regs-serial.h"
28#include "asm/arch/regs-gpio.h"
29#include "asm/arch/regs-watchdog.h"
30
31#include <asm/arch/map.h>
32
33/* working in physical space... */
34#undef S3C2410_GPIOREG
35#undef S3C2410_WDOGREG
36
37#define S3C2410_GPIOREG(x) ((S3C2410_PA_GPIO + (x)))
38#define S3C2410_WDOGREG(x) ((S3C2410_PA_WATCHDOG + (x)))
39
40/* how many bytes we allow into the FIFO at a time in FIFO mode */
41#define FIFO_MAX (14)
42
43#define uart_base S3C2410_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT)
44
45static __inline__ void
46uart_wr(unsigned int reg, unsigned int val)
47{
48 volatile unsigned int *ptr;
49
50 ptr = (volatile unsigned int *)(reg + uart_base);
51 *ptr = val;
52}
53
54static __inline__ unsigned int
55uart_rd(unsigned int reg)
56{
57 volatile unsigned int *ptr;
58
59 ptr = (volatile unsigned int *)(reg + uart_base);
60 return *ptr;
61}
62
63
64/* we can deal with the case the UARTs are being run
65 * in FIFO mode, so that we don't hold up our execution
66 * waiting for tx to happen...
67*/
68
69static void
70putc(char ch)
71{
72 int cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1);
73
74 cpuid &= S3C2410_GSTATUS1_IDMASK;
75
76 if (ch == '\n')
77 putc('\r'); /* expand newline to \r\n */
78
79 if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
80 int level;
81
82 while (1) {
83 level = uart_rd(S3C2410_UFSTAT);
84
85 if (cpuid == S3C2410_GSTATUS1_2440) {
86 level &= S3C2440_UFSTAT_TXMASK;
87 level >>= S3C2440_UFSTAT_TXSHIFT;
88 } else {
89 level &= S3C2410_UFSTAT_TXMASK;
90 level >>= S3C2410_UFSTAT_TXSHIFT;
91 }
92
93 if (level < FIFO_MAX)
94 break;
95 }
96
97 } else {
98 /* not using fifos */
99
100 while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE);
101 }
102
103 /* write byte to transmission register */
104 uart_wr(S3C2410_UTXH, ch);
105}
106
107static void
108putstr(const char *ptr)
109{
110 for (; *ptr != '\0'; ptr++) {
111 putc(*ptr);
112 }
113}
114
115/* CONFIG_S3C2410_BOOT_WATCHDOG
116 *
117 * Simple boot-time watchdog setup, to reboot the system if there is
118 * any problem with the boot process
119*/
120
121#ifdef CONFIG_S3C2410_BOOT_WATCHDOG
122
123#define WDOG_COUNT (0xff00)
124
125#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0)
126
127static inline void arch_decomp_wdog(void)
128{
129 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
130}
131
132static void arch_decomp_wdog_start(void)
133{
134 __raw_writel(WDOG_COUNT, S3C2410_WTDAT);
135 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
136 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON);
137}
138
139#else
140#define arch_decomp_wdog_start()
141#define arch_decomp_wdog()
142#endif
143
144static void error(char *err);
145
146static void
147arch_decomp_setup(void)
148{
149 /* we may need to setup the uart(s) here if we are not running
150 * on an BAST... the BAST will have left the uarts configured
151 * after calling linux.
152 */
153
154 arch_decomp_wdog_start();
155}
156
157
158#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/include/asm-arm/arch-s3c2410/usb-control.h b/include/asm-arm/arch-s3c2410/usb-control.h
new file mode 100644
index 000000000000..1cc85a096b23
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/usb-control.h
@@ -0,0 +1,45 @@
1/* linux/include/asm-arm/arch-s3c2410/usb-control.h
2 *
3 * (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - usb port information
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 * Changelog:
13 * 11-Sep-2004 BJD Created file
14 * 21-Sep-2004 BJD Updated port info
15*/
16
17#ifndef __ASM_ARCH_USBCONTROL_H
18#define __ASM_ARCH_USBCONTROL_H "include/asm-arm/arch-s3c2410/usb-control.h"
19
20#define S3C_HCDFLG_USED (1)
21
22struct s3c2410_hcd_port {
23 unsigned char flags;
24 unsigned char power;
25 unsigned char oc_status;
26 unsigned char oc_changed;
27};
28
29struct s3c2410_hcd_info {
30 struct usb_hcd *hcd;
31 struct s3c2410_hcd_port port[2];
32
33 void (*power_control)(int port, int to);
34 void (*enable_oc)(struct s3c2410_hcd_info *, int on);
35 void (*report_oc)(struct s3c2410_hcd_info *, int ports);
36};
37
38static void inline s3c2410_report_oc(struct s3c2410_hcd_info *info, int ports)
39{
40 if (info->report_oc != NULL) {
41 (info->report_oc)(info, ports);
42 }
43}
44
45#endif /*__ASM_ARCH_USBCONTROL_H */
diff --git a/include/asm-arm/arch-s3c2410/vmalloc.h b/include/asm-arm/arch-s3c2410/vmalloc.h
new file mode 100644
index 000000000000..5fe72ad70904
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/vmalloc.h
@@ -0,0 +1,36 @@
1/* linux/include/asm-arm/arch-s3c2410/vmalloc.h
2 *
3 * from linux/include/asm-arm/arch-iop3xx/vmalloc.h
4 *
5 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
6 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 vmalloc definition
13 *
14 * Changelog:
15 * 12-Mar-2004 BJD Fixed header, added include protection
16 * 12=Mar-2004 BJD Fixed VMALLOC_END definitions
17 */
18
19#ifndef __ASM_ARCH_VMALLOC_H
20#define __ASM_ARCH_VMALLOC_H
21
22/*
23 * Just any arbitrary offset to the start of the vmalloc VM area: the
24 * current 8MB value just means that there will be a 8MB "hole" after the
25 * physical memory until the kernel virtual memory starts. That means that
26 * any out-of-bounds memory accesses will hopefully be caught.
27 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
28 * area for the same reason. ;)
29 */
30
31#define VMALLOC_OFFSET (8*1024*1024)
32#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
33#define VMALLOC_VMADDR(x) ((unsigned long)(x))
34#define VMALLOC_END (0xE0000000)
35
36#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/include/asm-arm/arch-s3c2410/vr1000-cpld.h b/include/asm-arm/arch-s3c2410/vr1000-cpld.h
new file mode 100644
index 000000000000..0ee373ac60d4
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/vr1000-cpld.h
@@ -0,0 +1,22 @@
1/* linux/include/asm-arm/arch-s3c2410/vr1000-cpld.h
2 *
3 * (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * VR1000 - CPLD control constants
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 * Changelog:
13 * 25-May-2003 BJD Created file, added CTRL1 registers
14 * 19-Mar-2004 BJD Added VR1000 CPLD definitions
15*/
16
17#ifndef __ASM_ARCH_VR1000CPLD_H
18#define __ASM_ARCH_VR1000CPLD_H
19
20#define VR1000_CPLD_CTRL2_RAMWEN (0x04) /* SRAM Write Enable */
21
22#endif /* __ASM_ARCH_VR1000CPLD_H */
diff --git a/include/asm-arm/arch-s3c2410/vr1000-irq.h b/include/asm-arm/arch-s3c2410/vr1000-irq.h
new file mode 100644
index 000000000000..694f7715d2da
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/vr1000-irq.h
@@ -0,0 +1,30 @@
1/* linux/include/asm-arm/arch-s3c2410/vr1000-irq.h
2 *
3 * (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Machine VR1000 - IRQ Number 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 * Changelog:
13 * 06-Jan-2003 BJD Linux 2.6.0 version
14 * 19-Mar-2004 BJD Updates for VR1000
15 */
16
17#ifndef __ASM_ARCH_VR1000IRQ_H
18#define __ASM_ARCH_VR1000IRQ_H
19
20/* irq numbers to onboard peripherals */
21
22#define IRQ_USBOC IRQ_EINT19
23#define IRQ_IDE0 IRQ_EINT16
24#define IRQ_IDE1 IRQ_EINT17
25#define IRQ_VR1000_SERIAL IRQ_EINT12
26#define IRQ_VR1000_DM9000A IRQ_EINT10
27#define IRQ_VR1000_DM9000N IRQ_EINT9
28#define IRQ_SMALERT IRQ_EINT8
29
30#endif /* __ASM_ARCH_VR1000IRQ_H */
diff --git a/include/asm-arm/arch-s3c2410/vr1000-map.h b/include/asm-arm/arch-s3c2410/vr1000-map.h
new file mode 100644
index 000000000000..867c9355fd39
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/vr1000-map.h
@@ -0,0 +1,116 @@
1/* linux/include/asm-arm/arch-s3c2410/vr1000-map.h
2 *
3 * (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Machine VR1000 - Memory map 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 * Changelog:
13 * 06-Jan-2003 BJD Linux 2.6.0 version, split specifics from arch/map.h
14 * 12-Mar-2004 BJD Fixed header include protection
15 * 19-Mar-2004 BJD Copied to VR1000 machine headers.
16 * 19-Jan-2005 BJD Updated map definitions
17*/
18
19/* needs arch/map.h including with this */
20
21/* ok, we've used up to 0x13000000, now we need to find space for the
22 * peripherals that live in the nGCS[x] areas, which are quite numerous
23 * in their space. We also have the board's CPLD to find register space
24 * for.
25 */
26
27#ifndef __ASM_ARCH_VR1000MAP_H
28#define __ASM_ARCH_VR1000MAP_H
29
30#include <asm/arch/bast-map.h>
31
32#define VR1000_IOADDR(x) BAST_IOADDR(x)
33
34/* we put the CPLD registers next, to get them out of the way */
35
36#define VR1000_VA_CTRL1 VR1000_IOADDR(0x00000000) /* 0x01300000 */
37#define VR1000_PA_CTRL1 (S3C2410_CS5 | 0x7800000)
38
39#define VR1000_VA_CTRL2 VR1000_IOADDR(0x00100000) /* 0x01400000 */
40#define VR1000_PA_CTRL2 (S3C2410_CS1 | 0x6000000)
41
42#define VR1000_VA_CTRL3 VR1000_IOADDR(0x00200000) /* 0x01500000 */
43#define VR1000_PA_CTRL3 (S3C2410_CS1 | 0x6800000)
44
45#define VR1000_VA_CTRL4 VR1000_IOADDR(0x00300000) /* 0x01600000 */
46#define VR1000_PA_CTRL4 (S3C2410_CS1 | 0x7000000)
47
48/* next, we have the PC104 ISA interrupt registers */
49
50#define VR1000_PA_PC104_IRQREQ (S3C2410_CS5 | 0x6000000) /* 0x01700000 */
51#define VR1000_VA_PC104_IRQREQ VR1000_IOADDR(0x00400000)
52
53#define VR1000_PA_PC104_IRQRAW (S3C2410_CS5 | 0x6800000) /* 0x01800000 */
54#define VR1000_VA_PC104_IRQRAW VR1000_IOADDR(0x00500000)
55
56#define VR1000_PA_PC104_IRQMASK (S3C2410_CS5 | 0x7000000) /* 0x01900000 */
57#define VR1000_VA_PC104_IRQMASK VR1000_IOADDR(0x00600000)
58
59/* 0xE0000000 contains the IO space that is split by speed and
60 * wether the access is for 8 or 16bit IO... this ensures that
61 * the correct access is made
62 *
63 * 0x10000000 of space, partitioned as so:
64 *
65 * 0x00000000 to 0x04000000 8bit, slow
66 * 0x04000000 to 0x08000000 16bit, slow
67 * 0x08000000 to 0x0C000000 16bit, net
68 * 0x0C000000 to 0x10000000 16bit, fast
69 *
70 * each of these spaces has the following in:
71 *
72 * 0x02000000 to 0x02100000 1MB IDE primary channel
73 * 0x02100000 to 0x02200000 1MB IDE primary channel aux
74 * 0x02200000 to 0x02400000 1MB IDE secondary channel
75 * 0x02300000 to 0x02400000 1MB IDE secondary channel aux
76 * 0x02500000 to 0x02600000 1MB Davicom DM9000 ethernet controllers
77 * 0x02600000 to 0x02700000 1MB
78 *
79 * the phyiscal layout of the zones are:
80 * nGCS2 - 8bit, slow
81 * nGCS3 - 16bit, slow
82 * nGCS4 - 16bit, net
83 * nGCS5 - 16bit, fast
84 */
85
86#define VR1000_VA_MULTISPACE (0xE0000000)
87
88#define VR1000_VA_ISAIO (VR1000_VA_MULTISPACE + 0x00000000)
89#define VR1000_VA_ISAMEM (VR1000_VA_MULTISPACE + 0x01000000)
90#define VR1000_VA_IDEPRI (VR1000_VA_MULTISPACE + 0x02000000)
91#define VR1000_VA_IDEPRIAUX (VR1000_VA_MULTISPACE + 0x02100000)
92#define VR1000_VA_IDESEC (VR1000_VA_MULTISPACE + 0x02200000)
93#define VR1000_VA_IDESECAUX (VR1000_VA_MULTISPACE + 0x02300000)
94#define VR1000_VA_ASIXNET (VR1000_VA_MULTISPACE + 0x02400000)
95#define VR1000_VA_DM9000 (VR1000_VA_MULTISPACE + 0x02500000)
96#define VR1000_VA_SUPERIO (VR1000_VA_MULTISPACE + 0x02600000)
97
98/* physical offset addresses for the peripherals */
99
100#define VR1000_PA_IDEPRI (0x02000000)
101#define VR1000_PA_IDEPRIAUX (0x02800000)
102#define VR1000_PA_IDESEC (0x03000000)
103#define VR1000_PA_IDESECAUX (0x03800000)
104#define VR1000_PA_DM9000 (0x05000000)
105
106#define VR1000_PA_SERIAL (0x11800000)
107#define VR1000_VA_SERIAL (VR1000_IOADDR(0x00700000))
108
109/* VR1000 ram is in CS1, with A26..A24 = 2_101 */
110#define VR1000_PA_SRAM (S3C2410_CS1 | 0x05000000)
111
112/* some configurations for the peripherals */
113
114#define VR1000_DM9000_CS VR1000_VAM_CS4
115
116#endif /* __ASM_ARCH_VR1000MAP_H */
diff --git a/include/asm-arm/arch-sa1100/SA-1100.h b/include/asm-arm/arch-sa1100/SA-1100.h
new file mode 100644
index 000000000000..62aaf04a3906
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/SA-1100.h
@@ -0,0 +1,2072 @@
1/*
2 * FILE SA-1100.h
3 *
4 * Version 1.2
5 * Author Copyright (c) Marc A. Viredaz, 1998
6 * DEC Western Research Laboratory, Palo Alto, CA
7 * Date January 1998 (April 1997)
8 * System StrongARM SA-1100
9 * Language C or ARM Assembly
10 * Purpose Definition of constants related to the StrongARM
11 * SA-1100 microprocessor (Advanced RISC Machine (ARM)
12 * architecture version 4). This file is based on the
13 * StrongARM SA-1100 data sheet version 2.2.
14 *
15 */
16
17
18/* Be sure that virtual mapping is defined right */
19#ifndef __ASM_ARCH_HARDWARE_H
20#error You must include hardware.h not SA-1100.h
21#endif
22
23#include "bitfield.h"
24
25/*
26 * SA1100 CS line to physical address
27 */
28
29#define SA1100_CS0_PHYS 0x00000000
30#define SA1100_CS1_PHYS 0x08000000
31#define SA1100_CS2_PHYS 0x10000000
32#define SA1100_CS3_PHYS 0x18000000
33#define SA1100_CS4_PHYS 0x40000000
34#define SA1100_CS5_PHYS 0x48000000
35
36/*
37 * Personal Computer Memory Card International Association (PCMCIA) sockets
38 */
39
40#define PCMCIAPrtSp 0x04000000 /* PCMCIA Partition Space [byte] */
41#define PCMCIASp (4*PCMCIAPrtSp) /* PCMCIA Space [byte] */
42#define PCMCIAIOSp PCMCIAPrtSp /* PCMCIA I/O Space [byte] */
43#define PCMCIAAttrSp PCMCIAPrtSp /* PCMCIA Attribute Space [byte] */
44#define PCMCIAMemSp PCMCIAPrtSp /* PCMCIA Memory Space [byte] */
45
46#define PCMCIA0Sp PCMCIASp /* PCMCIA 0 Space [byte] */
47#define PCMCIA0IOSp PCMCIAIOSp /* PCMCIA 0 I/O Space [byte] */
48#define PCMCIA0AttrSp PCMCIAAttrSp /* PCMCIA 0 Attribute Space [byte] */
49#define PCMCIA0MemSp PCMCIAMemSp /* PCMCIA 0 Memory Space [byte] */
50
51#define PCMCIA1Sp PCMCIASp /* PCMCIA 1 Space [byte] */
52#define PCMCIA1IOSp PCMCIAIOSp /* PCMCIA 1 I/O Space [byte] */
53#define PCMCIA1AttrSp PCMCIAAttrSp /* PCMCIA 1 Attribute Space [byte] */
54#define PCMCIA1MemSp PCMCIAMemSp /* PCMCIA 1 Memory Space [byte] */
55
56#define _PCMCIA(Nb) /* PCMCIA [0..1] */ \
57 (0x20000000 + (Nb)*PCMCIASp)
58#define _PCMCIAIO(Nb) _PCMCIA (Nb) /* PCMCIA I/O [0..1] */
59#define _PCMCIAAttr(Nb) /* PCMCIA Attribute [0..1] */ \
60 (_PCMCIA (Nb) + 2*PCMCIAPrtSp)
61#define _PCMCIAMem(Nb) /* PCMCIA Memory [0..1] */ \
62 (_PCMCIA (Nb) + 3*PCMCIAPrtSp)
63
64#define _PCMCIA0 _PCMCIA (0) /* PCMCIA 0 */
65#define _PCMCIA0IO _PCMCIAIO (0) /* PCMCIA 0 I/O */
66#define _PCMCIA0Attr _PCMCIAAttr (0) /* PCMCIA 0 Attribute */
67#define _PCMCIA0Mem _PCMCIAMem (0) /* PCMCIA 0 Memory */
68
69#define _PCMCIA1 _PCMCIA (1) /* PCMCIA 1 */
70#define _PCMCIA1IO _PCMCIAIO (1) /* PCMCIA 1 I/O */
71#define _PCMCIA1Attr _PCMCIAAttr (1) /* PCMCIA 1 Attribute */
72#define _PCMCIA1Mem _PCMCIAMem (1) /* PCMCIA 1 Memory */
73
74
75/*
76 * Universal Serial Bus (USB) Device Controller (UDC) control registers
77 *
78 * Registers
79 * Ser0UDCCR Serial port 0 Universal Serial Bus (USB) Device
80 * Controller (UDC) Control Register (read/write).
81 * Ser0UDCAR Serial port 0 Universal Serial Bus (USB) Device
82 * Controller (UDC) Address Register (read/write).
83 * Ser0UDCOMP Serial port 0 Universal Serial Bus (USB) Device
84 * Controller (UDC) Output Maximum Packet size register
85 * (read/write).
86 * Ser0UDCIMP Serial port 0 Universal Serial Bus (USB) Device
87 * Controller (UDC) Input Maximum Packet size register
88 * (read/write).
89 * Ser0UDCCS0 Serial port 0 Universal Serial Bus (USB) Device
90 * Controller (UDC) Control/Status register end-point 0
91 * (read/write).
92 * Ser0UDCCS1 Serial port 0 Universal Serial Bus (USB) Device
93 * Controller (UDC) Control/Status register end-point 1
94 * (output, read/write).
95 * Ser0UDCCS2 Serial port 0 Universal Serial Bus (USB) Device
96 * Controller (UDC) Control/Status register end-point 2
97 * (input, read/write).
98 * Ser0UDCD0 Serial port 0 Universal Serial Bus (USB) Device
99 * Controller (UDC) Data register end-point 0
100 * (read/write).
101 * Ser0UDCWC Serial port 0 Universal Serial Bus (USB) Device
102 * Controller (UDC) Write Count register end-point 0
103 * (read).
104 * Ser0UDCDR Serial port 0 Universal Serial Bus (USB) Device
105 * Controller (UDC) Data Register (read/write).
106 * Ser0UDCSR Serial port 0 Universal Serial Bus (USB) Device
107 * Controller (UDC) Status Register (read/write).
108 */
109
110#define Ser0UDCCR __REG(0x80000000) /* Ser. port 0 UDC Control Reg. */
111#define Ser0UDCAR __REG(0x80000004) /* Ser. port 0 UDC Address Reg. */
112#define Ser0UDCOMP __REG(0x80000008) /* Ser. port 0 UDC Output Maximum Packet size reg. */
113#define Ser0UDCIMP __REG(0x8000000C) /* Ser. port 0 UDC Input Maximum Packet size reg. */
114#define Ser0UDCCS0 __REG(0x80000010) /* Ser. port 0 UDC Control/Status reg. end-point 0 */
115#define Ser0UDCCS1 __REG(0x80000014) /* Ser. port 0 UDC Control/Status reg. end-point 1 (output) */
116#define Ser0UDCCS2 __REG(0x80000018) /* Ser. port 0 UDC Control/Status reg. end-point 2 (input) */
117#define Ser0UDCD0 __REG(0x8000001C) /* Ser. port 0 UDC Data reg. end-point 0 */
118#define Ser0UDCWC __REG(0x80000020) /* Ser. port 0 UDC Write Count reg. end-point 0 */
119#define Ser0UDCDR __REG(0x80000028) /* Ser. port 0 UDC Data Reg. */
120#define Ser0UDCSR __REG(0x80000030) /* Ser. port 0 UDC Status Reg. */
121
122#define UDCCR_UDD 0x00000001 /* UDC Disable */
123#define UDCCR_UDA 0x00000002 /* UDC Active (read) */
124#define UDCCR_RESIM 0x00000004 /* Resume Interrupt Mask, per errata */
125#define UDCCR_EIM 0x00000008 /* End-point 0 Interrupt Mask */
126 /* (disable) */
127#define UDCCR_RIM 0x00000010 /* Receive Interrupt Mask */
128 /* (disable) */
129#define UDCCR_TIM 0x00000020 /* Transmit Interrupt Mask */
130 /* (disable) */
131#define UDCCR_SRM 0x00000040 /* Suspend/Resume interrupt Mask */
132 /* (disable) */
133#define UDCCR_SUSIM UDCCR_SRM /* Per errata, SRM just masks suspend */
134#define UDCCR_REM 0x00000080 /* REset interrupt Mask (disable) */
135
136#define UDCAR_ADD Fld (7, 0) /* function ADDress */
137
138#define UDCOMP_OUTMAXP Fld (8, 0) /* OUTput MAXimum Packet size - 1 */
139 /* [byte] */
140#define UDCOMP_OutMaxPkt(Size) /* Output Maximum Packet size */ \
141 /* [1..256 byte] */ \
142 (((Size) - 1) << FShft (UDCOMP_OUTMAXP))
143
144#define UDCIMP_INMAXP Fld (8, 0) /* INput MAXimum Packet size - 1 */
145 /* [byte] */
146#define UDCIMP_InMaxPkt(Size) /* Input Maximum Packet size */ \
147 /* [1..256 byte] */ \
148 (((Size) - 1) << FShft (UDCIMP_INMAXP))
149
150#define UDCCS0_OPR 0x00000001 /* Output Packet Ready (read) */
151#define UDCCS0_IPR 0x00000002 /* Input Packet Ready */
152#define UDCCS0_SST 0x00000004 /* Sent STall */
153#define UDCCS0_FST 0x00000008 /* Force STall */
154#define UDCCS0_DE 0x00000010 /* Data End */
155#define UDCCS0_SE 0x00000020 /* Setup End (read) */
156#define UDCCS0_SO 0x00000040 /* Serviced Output packet ready */
157 /* (write) */
158#define UDCCS0_SSE 0x00000080 /* Serviced Setup End (write) */
159
160#define UDCCS1_RFS 0x00000001 /* Receive FIFO 12-bytes or more */
161 /* Service request (read) */
162#define UDCCS1_RPC 0x00000002 /* Receive Packet Complete */
163#define UDCCS1_RPE 0x00000004 /* Receive Packet Error (read) */
164#define UDCCS1_SST 0x00000008 /* Sent STall */
165#define UDCCS1_FST 0x00000010 /* Force STall */
166#define UDCCS1_RNE 0x00000020 /* Receive FIFO Not Empty (read) */
167
168#define UDCCS2_TFS 0x00000001 /* Transmit FIFO 8-bytes or less */
169 /* Service request (read) */
170#define UDCCS2_TPC 0x00000002 /* Transmit Packet Complete */
171#define UDCCS2_TPE 0x00000004 /* Transmit Packet Error (read) */
172#define UDCCS2_TUR 0x00000008 /* Transmit FIFO Under-Run */
173#define UDCCS2_SST 0x00000010 /* Sent STall */
174#define UDCCS2_FST 0x00000020 /* Force STall */
175
176#define UDCD0_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
177
178#define UDCWC_WC Fld (4, 0) /* Write Count */
179
180#define UDCDR_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
181
182#define UDCSR_EIR 0x00000001 /* End-point 0 Interrupt Request */
183#define UDCSR_RIR 0x00000002 /* Receive Interrupt Request */
184#define UDCSR_TIR 0x00000004 /* Transmit Interrupt Request */
185#define UDCSR_SUSIR 0x00000008 /* SUSpend Interrupt Request */
186#define UDCSR_RESIR 0x00000010 /* RESume Interrupt Request */
187#define UDCSR_RSTIR 0x00000020 /* ReSeT Interrupt Request */
188
189
190/*
191 * Universal Asynchronous Receiver/Transmitter (UART) control registers
192 *
193 * Registers
194 * Ser1UTCR0 Serial port 1 Universal Asynchronous
195 * Receiver/Transmitter (UART) Control Register 0
196 * (read/write).
197 * Ser1UTCR1 Serial port 1 Universal Asynchronous
198 * Receiver/Transmitter (UART) Control Register 1
199 * (read/write).
200 * Ser1UTCR2 Serial port 1 Universal Asynchronous
201 * Receiver/Transmitter (UART) Control Register 2
202 * (read/write).
203 * Ser1UTCR3 Serial port 1 Universal Asynchronous
204 * Receiver/Transmitter (UART) Control Register 3
205 * (read/write).
206 * Ser1UTDR Serial port 1 Universal Asynchronous
207 * Receiver/Transmitter (UART) Data Register
208 * (read/write).
209 * Ser1UTSR0 Serial port 1 Universal Asynchronous
210 * Receiver/Transmitter (UART) Status Register 0
211 * (read/write).
212 * Ser1UTSR1 Serial port 1 Universal Asynchronous
213 * Receiver/Transmitter (UART) Status Register 1 (read).
214 *
215 * Ser2UTCR0 Serial port 2 Universal Asynchronous
216 * Receiver/Transmitter (UART) Control Register 0
217 * (read/write).
218 * Ser2UTCR1 Serial port 2 Universal Asynchronous
219 * Receiver/Transmitter (UART) Control Register 1
220 * (read/write).
221 * Ser2UTCR2 Serial port 2 Universal Asynchronous
222 * Receiver/Transmitter (UART) Control Register 2
223 * (read/write).
224 * Ser2UTCR3 Serial port 2 Universal Asynchronous
225 * Receiver/Transmitter (UART) Control Register 3
226 * (read/write).
227 * Ser2UTCR4 Serial port 2 Universal Asynchronous
228 * Receiver/Transmitter (UART) Control Register 4
229 * (read/write).
230 * Ser2UTDR Serial port 2 Universal Asynchronous
231 * Receiver/Transmitter (UART) Data Register
232 * (read/write).
233 * Ser2UTSR0 Serial port 2 Universal Asynchronous
234 * Receiver/Transmitter (UART) Status Register 0
235 * (read/write).
236 * Ser2UTSR1 Serial port 2 Universal Asynchronous
237 * Receiver/Transmitter (UART) Status Register 1 (read).
238 *
239 * Ser3UTCR0 Serial port 3 Universal Asynchronous
240 * Receiver/Transmitter (UART) Control Register 0
241 * (read/write).
242 * Ser3UTCR1 Serial port 3 Universal Asynchronous
243 * Receiver/Transmitter (UART) Control Register 1
244 * (read/write).
245 * Ser3UTCR2 Serial port 3 Universal Asynchronous
246 * Receiver/Transmitter (UART) Control Register 2
247 * (read/write).
248 * Ser3UTCR3 Serial port 3 Universal Asynchronous
249 * Receiver/Transmitter (UART) Control Register 3
250 * (read/write).
251 * Ser3UTDR Serial port 3 Universal Asynchronous
252 * Receiver/Transmitter (UART) Data Register
253 * (read/write).
254 * Ser3UTSR0 Serial port 3 Universal Asynchronous
255 * Receiver/Transmitter (UART) Status Register 0
256 * (read/write).
257 * Ser3UTSR1 Serial port 3 Universal Asynchronous
258 * Receiver/Transmitter (UART) Status Register 1 (read).
259 *
260 * Clocks
261 * fxtl, Txtl Frequency, period of the system crystal (3.6864 MHz
262 * or 3.5795 MHz).
263 * fua, Tua Frequency, period of the UART communication.
264 */
265
266#define _UTCR0(Nb) __REG(0x80010000 + ((Nb) - 1)*0x00020000) /* UART Control Reg. 0 [1..3] */
267#define _UTCR1(Nb) __REG(0x80010004 + ((Nb) - 1)*0x00020000) /* UART Control Reg. 1 [1..3] */
268#define _UTCR2(Nb) __REG(0x80010008 + ((Nb) - 1)*0x00020000) /* UART Control Reg. 2 [1..3] */
269#define _UTCR3(Nb) __REG(0x8001000C + ((Nb) - 1)*0x00020000) /* UART Control Reg. 3 [1..3] */
270#define _UTCR4(Nb) __REG(0x80010010 + ((Nb) - 1)*0x00020000) /* UART Control Reg. 4 [2] */
271#define _UTDR(Nb) __REG(0x80010014 + ((Nb) - 1)*0x00020000) /* UART Data Reg. [1..3] */
272#define _UTSR0(Nb) __REG(0x8001001C + ((Nb) - 1)*0x00020000) /* UART Status Reg. 0 [1..3] */
273#define _UTSR1(Nb) __REG(0x80010020 + ((Nb) - 1)*0x00020000) /* UART Status Reg. 1 [1..3] */
274
275#define Ser1UTCR0 _UTCR0 (1) /* Ser. port 1 UART Control Reg. 0 */
276#define Ser1UTCR1 _UTCR1 (1) /* Ser. port 1 UART Control Reg. 1 */
277#define Ser1UTCR2 _UTCR2 (1) /* Ser. port 1 UART Control Reg. 2 */
278#define Ser1UTCR3 _UTCR3 (1) /* Ser. port 1 UART Control Reg. 3 */
279#define Ser1UTDR _UTDR (1) /* Ser. port 1 UART Data Reg. */
280#define Ser1UTSR0 _UTSR0 (1) /* Ser. port 1 UART Status Reg. 0 */
281#define Ser1UTSR1 _UTSR1 (1) /* Ser. port 1 UART Status Reg. 1 */
282
283#define Ser2UTCR0 _UTCR0 (2) /* Ser. port 2 UART Control Reg. 0 */
284#define Ser2UTCR1 _UTCR1 (2) /* Ser. port 2 UART Control Reg. 1 */
285#define Ser2UTCR2 _UTCR2 (2) /* Ser. port 2 UART Control Reg. 2 */
286#define Ser2UTCR3 _UTCR3 (2) /* Ser. port 2 UART Control Reg. 3 */
287#define Ser2UTCR4 _UTCR4 (2) /* Ser. port 2 UART Control Reg. 4 */
288#define Ser2UTDR _UTDR (2) /* Ser. port 2 UART Data Reg. */
289#define Ser2UTSR0 _UTSR0 (2) /* Ser. port 2 UART Status Reg. 0 */
290#define Ser2UTSR1 _UTSR1 (2) /* Ser. port 2 UART Status Reg. 1 */
291
292#define Ser3UTCR0 _UTCR0 (3) /* Ser. port 3 UART Control Reg. 0 */
293#define Ser3UTCR1 _UTCR1 (3) /* Ser. port 3 UART Control Reg. 1 */
294#define Ser3UTCR2 _UTCR2 (3) /* Ser. port 3 UART Control Reg. 2 */
295#define Ser3UTCR3 _UTCR3 (3) /* Ser. port 3 UART Control Reg. 3 */
296#define Ser3UTDR _UTDR (3) /* Ser. port 3 UART Data Reg. */
297#define Ser3UTSR0 _UTSR0 (3) /* Ser. port 3 UART Status Reg. 0 */
298#define Ser3UTSR1 _UTSR1 (3) /* Ser. port 3 UART Status Reg. 1 */
299
300/* Those are still used in some places */
301#define _Ser1UTCR0 __PREG(Ser1UTCR0)
302#define _Ser2UTCR0 __PREG(Ser2UTCR0)
303#define _Ser3UTCR0 __PREG(Ser3UTCR0)
304
305/* Register offsets */
306#define UTCR0 0x00
307#define UTCR1 0x04
308#define UTCR2 0x08
309#define UTCR3 0x0c
310#define UTDR 0x14
311#define UTSR0 0x1c
312#define UTSR1 0x20
313
314#define UTCR0_PE 0x00000001 /* Parity Enable */
315#define UTCR0_OES 0x00000002 /* Odd/Even parity Select */
316#define UTCR0_OddPar (UTCR0_OES*0) /* Odd Parity */
317#define UTCR0_EvenPar (UTCR0_OES*1) /* Even Parity */
318#define UTCR0_SBS 0x00000004 /* Stop Bit Select */
319#define UTCR0_1StpBit (UTCR0_SBS*0) /* 1 Stop Bit per frame */
320#define UTCR0_2StpBit (UTCR0_SBS*1) /* 2 Stop Bits per frame */
321#define UTCR0_DSS 0x00000008 /* Data Size Select */
322#define UTCR0_7BitData (UTCR0_DSS*0) /* 7-Bit Data */
323#define UTCR0_8BitData (UTCR0_DSS*1) /* 8-Bit Data */
324#define UTCR0_SCE 0x00000010 /* Sample Clock Enable */
325 /* (ser. port 1: GPIO [18], */
326 /* ser. port 3: GPIO [20]) */
327#define UTCR0_RCE 0x00000020 /* Receive Clock Edge select */
328#define UTCR0_RcRsEdg (UTCR0_RCE*0) /* Receive clock Rising-Edge */
329#define UTCR0_RcFlEdg (UTCR0_RCE*1) /* Receive clock Falling-Edge */
330#define UTCR0_TCE 0x00000040 /* Transmit Clock Edge select */
331#define UTCR0_TrRsEdg (UTCR0_TCE*0) /* Transmit clock Rising-Edge */
332#define UTCR0_TrFlEdg (UTCR0_TCE*1) /* Transmit clock Falling-Edge */
333#define UTCR0_Ser2IrDA /* Ser. port 2 IrDA settings */ \
334 (UTCR0_1StpBit + UTCR0_8BitData)
335
336#define UTCR1_BRD Fld (4, 0) /* Baud Rate Divisor/16 - 1 [11:8] */
337#define UTCR2_BRD Fld (8, 0) /* Baud Rate Divisor/16 - 1 [7:0] */
338 /* fua = fxtl/(16*(BRD[11:0] + 1)) */
339 /* Tua = 16*(BRD [11:0] + 1)*Txtl */
340#define UTCR1_BdRtDiv(Div) /* Baud Rate Divisor [16..65536] */ \
341 (((Div) - 16)/16 >> FSize (UTCR2_BRD) << \
342 FShft (UTCR1_BRD))
343#define UTCR2_BdRtDiv(Div) /* Baud Rate Divisor [16..65536] */ \
344 (((Div) - 16)/16 & FAlnMsk (UTCR2_BRD) << \
345 FShft (UTCR2_BRD))
346 /* fua = fxtl/(16*Floor (Div/16)) */
347 /* Tua = 16*Floor (Div/16)*Txtl */
348#define UTCR1_CeilBdRtDiv(Div) /* Ceil. of BdRtDiv [16..65536] */ \
349 (((Div) - 1)/16 >> FSize (UTCR2_BRD) << \
350 FShft (UTCR1_BRD))
351#define UTCR2_CeilBdRtDiv(Div) /* Ceil. of BdRtDiv [16..65536] */ \
352 (((Div) - 1)/16 & FAlnMsk (UTCR2_BRD) << \
353 FShft (UTCR2_BRD))
354 /* fua = fxtl/(16*Ceil (Div/16)) */
355 /* Tua = 16*Ceil (Div/16)*Txtl */
356
357#define UTCR3_RXE 0x00000001 /* Receive Enable */
358#define UTCR3_TXE 0x00000002 /* Transmit Enable */
359#define UTCR3_BRK 0x00000004 /* BReaK mode */
360#define UTCR3_RIE 0x00000008 /* Receive FIFO 1/3-to-2/3-full or */
361 /* more Interrupt Enable */
362#define UTCR3_TIE 0x00000010 /* Transmit FIFO 1/2-full or less */
363 /* Interrupt Enable */
364#define UTCR3_LBM 0x00000020 /* Look-Back Mode */
365#define UTCR3_Ser2IrDA /* Ser. port 2 IrDA settings (RIE, */ \
366 /* TIE, LBM can be set or cleared) */ \
367 (UTCR3_RXE + UTCR3_TXE)
368
369#define UTCR4_HSE 0x00000001 /* Hewlett-Packard Serial InfraRed */
370 /* (HP-SIR) modulation Enable */
371#define UTCR4_NRZ (UTCR4_HSE*0) /* Non-Return to Zero modulation */
372#define UTCR4_HPSIR (UTCR4_HSE*1) /* HP-SIR modulation */
373#define UTCR4_LPM 0x00000002 /* Low-Power Mode */
374#define UTCR4_Z3_16Bit (UTCR4_LPM*0) /* Zero pulse = 3/16 Bit time */
375#define UTCR4_Z1_6us (UTCR4_LPM*1) /* Zero pulse = 1.6 us */
376
377#define UTDR_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
378#if 0 /* Hidden receive FIFO bits */
379#define UTDR_PRE 0x00000100 /* receive PaRity Error (read) */
380#define UTDR_FRE 0x00000200 /* receive FRaming Error (read) */
381#define UTDR_ROR 0x00000400 /* Receive FIFO Over-Run (read) */
382#endif /* 0 */
383
384#define UTSR0_TFS 0x00000001 /* Transmit FIFO 1/2-full or less */
385 /* Service request (read) */
386#define UTSR0_RFS 0x00000002 /* Receive FIFO 1/3-to-2/3-full or */
387 /* more Service request (read) */
388#define UTSR0_RID 0x00000004 /* Receiver IDle */
389#define UTSR0_RBB 0x00000008 /* Receive Beginning of Break */
390#define UTSR0_REB 0x00000010 /* Receive End of Break */
391#define UTSR0_EIF 0x00000020 /* Error In FIFO (read) */
392
393#define UTSR1_TBY 0x00000001 /* Transmitter BusY (read) */
394#define UTSR1_RNE 0x00000002 /* Receive FIFO Not Empty (read) */
395#define UTSR1_TNF 0x00000004 /* Transmit FIFO Not Full (read) */
396#define UTSR1_PRE 0x00000008 /* receive PaRity Error (read) */
397#define UTSR1_FRE 0x00000010 /* receive FRaming Error (read) */
398#define UTSR1_ROR 0x00000020 /* Receive FIFO Over-Run (read) */
399
400
401/*
402 * Synchronous Data Link Controller (SDLC) control registers
403 *
404 * Registers
405 * Ser1SDCR0 Serial port 1 Synchronous Data Link Controller (SDLC)
406 * Control Register 0 (read/write).
407 * Ser1SDCR1 Serial port 1 Synchronous Data Link Controller (SDLC)
408 * Control Register 1 (read/write).
409 * Ser1SDCR2 Serial port 1 Synchronous Data Link Controller (SDLC)
410 * Control Register 2 (read/write).
411 * Ser1SDCR3 Serial port 1 Synchronous Data Link Controller (SDLC)
412 * Control Register 3 (read/write).
413 * Ser1SDCR4 Serial port 1 Synchronous Data Link Controller (SDLC)
414 * Control Register 4 (read/write).
415 * Ser1SDDR Serial port 1 Synchronous Data Link Controller (SDLC)
416 * Data Register (read/write).
417 * Ser1SDSR0 Serial port 1 Synchronous Data Link Controller (SDLC)
418 * Status Register 0 (read/write).
419 * Ser1SDSR1 Serial port 1 Synchronous Data Link Controller (SDLC)
420 * Status Register 1 (read/write).
421 *
422 * Clocks
423 * fxtl, Txtl Frequency, period of the system crystal (3.6864 MHz
424 * or 3.5795 MHz).
425 * fsd, Tsd Frequency, period of the SDLC communication.
426 */
427
428#define Ser1SDCR0 __REG(0x80020060) /* Ser. port 1 SDLC Control Reg. 0 */
429#define Ser1SDCR1 __REG(0x80020064) /* Ser. port 1 SDLC Control Reg. 1 */
430#define Ser1SDCR2 __REG(0x80020068) /* Ser. port 1 SDLC Control Reg. 2 */
431#define Ser1SDCR3 __REG(0x8002006C) /* Ser. port 1 SDLC Control Reg. 3 */
432#define Ser1SDCR4 __REG(0x80020070) /* Ser. port 1 SDLC Control Reg. 4 */
433#define Ser1SDDR __REG(0x80020078) /* Ser. port 1 SDLC Data Reg. */
434#define Ser1SDSR0 __REG(0x80020080) /* Ser. port 1 SDLC Status Reg. 0 */
435#define Ser1SDSR1 __REG(0x80020084) /* Ser. port 1 SDLC Status Reg. 1 */
436
437#define SDCR0_SUS 0x00000001 /* SDLC/UART Select */
438#define SDCR0_SDLC (SDCR0_SUS*0) /* SDLC mode (TXD1 & RXD1) */
439#define SDCR0_UART (SDCR0_SUS*1) /* UART mode (TXD1 & RXD1) */
440#define SDCR0_SDF 0x00000002 /* Single/Double start Flag select */
441#define SDCR0_SglFlg (SDCR0_SDF*0) /* Single start Flag */
442#define SDCR0_DblFlg (SDCR0_SDF*1) /* Double start Flag */
443#define SDCR0_LBM 0x00000004 /* Look-Back Mode */
444#define SDCR0_BMS 0x00000008 /* Bit Modulation Select */
445#define SDCR0_FM0 (SDCR0_BMS*0) /* Freq. Modulation zero (0) */
446#define SDCR0_NRZ (SDCR0_BMS*1) /* Non-Return to Zero modulation */
447#define SDCR0_SCE 0x00000010 /* Sample Clock Enable (GPIO [16]) */
448#define SDCR0_SCD 0x00000020 /* Sample Clock Direction select */
449 /* (GPIO [16]) */
450#define SDCR0_SClkIn (SDCR0_SCD*0) /* Sample Clock Input */
451#define SDCR0_SClkOut (SDCR0_SCD*1) /* Sample Clock Output */
452#define SDCR0_RCE 0x00000040 /* Receive Clock Edge select */
453#define SDCR0_RcRsEdg (SDCR0_RCE*0) /* Receive clock Rising-Edge */
454#define SDCR0_RcFlEdg (SDCR0_RCE*1) /* Receive clock Falling-Edge */
455#define SDCR0_TCE 0x00000080 /* Transmit Clock Edge select */
456#define SDCR0_TrRsEdg (SDCR0_TCE*0) /* Transmit clock Rising-Edge */
457#define SDCR0_TrFlEdg (SDCR0_TCE*1) /* Transmit clock Falling-Edge */
458
459#define SDCR1_AAF 0x00000001 /* Abort After Frame enable */
460 /* (GPIO [17]) */
461#define SDCR1_TXE 0x00000002 /* Transmit Enable */
462#define SDCR1_RXE 0x00000004 /* Receive Enable */
463#define SDCR1_RIE 0x00000008 /* Receive FIFO 1/3-to-2/3-full or */
464 /* more Interrupt Enable */
465#define SDCR1_TIE 0x00000010 /* Transmit FIFO 1/2-full or less */
466 /* Interrupt Enable */
467#define SDCR1_AME 0x00000020 /* Address Match Enable */
468#define SDCR1_TUS 0x00000040 /* Transmit FIFO Under-run Select */
469#define SDCR1_EFrmURn (SDCR1_TUS*0) /* End Frame on Under-Run */
470#define SDCR1_AbortURn (SDCR1_TUS*1) /* Abort on Under-Run */
471#define SDCR1_RAE 0x00000080 /* Receive Abort interrupt Enable */
472
473#define SDCR2_AMV Fld (8, 0) /* Address Match Value */
474
475#define SDCR3_BRD Fld (4, 0) /* Baud Rate Divisor/16 - 1 [11:8] */
476#define SDCR4_BRD Fld (8, 0) /* Baud Rate Divisor/16 - 1 [7:0] */
477 /* fsd = fxtl/(16*(BRD[11:0] + 1)) */
478 /* Tsd = 16*(BRD[11:0] + 1)*Txtl */
479#define SDCR3_BdRtDiv(Div) /* Baud Rate Divisor [16..65536] */ \
480 (((Div) - 16)/16 >> FSize (SDCR4_BRD) << \
481 FShft (SDCR3_BRD))
482#define SDCR4_BdRtDiv(Div) /* Baud Rate Divisor [16..65536] */ \
483 (((Div) - 16)/16 & FAlnMsk (SDCR4_BRD) << \
484 FShft (SDCR4_BRD))
485 /* fsd = fxtl/(16*Floor (Div/16)) */
486 /* Tsd = 16*Floor (Div/16)*Txtl */
487#define SDCR3_CeilBdRtDiv(Div) /* Ceil. of BdRtDiv [16..65536] */ \
488 (((Div) - 1)/16 >> FSize (SDCR4_BRD) << \
489 FShft (SDCR3_BRD))
490#define SDCR4_CeilBdRtDiv(Div) /* Ceil. of BdRtDiv [16..65536] */ \
491 (((Div) - 1)/16 & FAlnMsk (SDCR4_BRD) << \
492 FShft (SDCR4_BRD))
493 /* fsd = fxtl/(16*Ceil (Div/16)) */
494 /* Tsd = 16*Ceil (Div/16)*Txtl */
495
496#define SDDR_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
497#if 0 /* Hidden receive FIFO bits */
498#define SDDR_EOF 0x00000100 /* receive End-Of-Frame (read) */
499#define SDDR_CRE 0x00000200 /* receive CRC Error (read) */
500#define SDDR_ROR 0x00000400 /* Receive FIFO Over-Run (read) */
501#endif /* 0 */
502
503#define SDSR0_EIF 0x00000001 /* Error In FIFO (read) */
504#define SDSR0_TUR 0x00000002 /* Transmit FIFO Under-Run */
505#define SDSR0_RAB 0x00000004 /* Receive ABort */
506#define SDSR0_TFS 0x00000008 /* Transmit FIFO 1/2-full or less */
507 /* Service request (read) */
508#define SDSR0_RFS 0x00000010 /* Receive FIFO 1/3-to-2/3-full or */
509 /* more Service request (read) */
510
511#define SDSR1_RSY 0x00000001 /* Receiver SYnchronized (read) */
512#define SDSR1_TBY 0x00000002 /* Transmitter BusY (read) */
513#define SDSR1_RNE 0x00000004 /* Receive FIFO Not Empty (read) */
514#define SDSR1_TNF 0x00000008 /* Transmit FIFO Not Full (read) */
515#define SDSR1_RTD 0x00000010 /* Receive Transition Detected */
516#define SDSR1_EOF 0x00000020 /* receive End-Of-Frame (read) */
517#define SDSR1_CRE 0x00000040 /* receive CRC Error (read) */
518#define SDSR1_ROR 0x00000080 /* Receive FIFO Over-Run (read) */
519
520
521/*
522 * High-Speed Serial to Parallel controller (HSSP) control registers
523 *
524 * Registers
525 * Ser2HSCR0 Serial port 2 High-Speed Serial to Parallel
526 * controller (HSSP) Control Register 0 (read/write).
527 * Ser2HSCR1 Serial port 2 High-Speed Serial to Parallel
528 * controller (HSSP) Control Register 1 (read/write).
529 * Ser2HSDR Serial port 2 High-Speed Serial to Parallel
530 * controller (HSSP) Data Register (read/write).
531 * Ser2HSSR0 Serial port 2 High-Speed Serial to Parallel
532 * controller (HSSP) Status Register 0 (read/write).
533 * Ser2HSSR1 Serial port 2 High-Speed Serial to Parallel
534 * controller (HSSP) Status Register 1 (read).
535 * Ser2HSCR2 Serial port 2 High-Speed Serial to Parallel
536 * controller (HSSP) Control Register 2 (read/write).
537 * [The HSCR2 register is only implemented in
538 * versions 2.0 (rev. = 8) and higher of the StrongARM
539 * SA-1100.]
540 */
541
542#define Ser2HSCR0 __REG(0x80040060) /* Ser. port 2 HSSP Control Reg. 0 */
543#define Ser2HSCR1 __REG(0x80040064) /* Ser. port 2 HSSP Control Reg. 1 */
544#define Ser2HSDR __REG(0x8004006C) /* Ser. port 2 HSSP Data Reg. */
545#define Ser2HSSR0 __REG(0x80040074) /* Ser. port 2 HSSP Status Reg. 0 */
546#define Ser2HSSR1 __REG(0x80040078) /* Ser. port 2 HSSP Status Reg. 1 */
547#define Ser2HSCR2 __REG(0x90060028) /* Ser. port 2 HSSP Control Reg. 2 */
548
549#define HSCR0_ITR 0x00000001 /* IrDA Transmission Rate */
550#define HSCR0_UART (HSCR0_ITR*0) /* UART mode (115.2 kb/s if IrDA) */
551#define HSCR0_HSSP (HSCR0_ITR*1) /* HSSP mode (4 Mb/s) */
552#define HSCR0_LBM 0x00000002 /* Look-Back Mode */
553#define HSCR0_TUS 0x00000004 /* Transmit FIFO Under-run Select */
554#define HSCR0_EFrmURn (HSCR0_TUS*0) /* End Frame on Under-Run */
555#define HSCR0_AbortURn (HSCR0_TUS*1) /* Abort on Under-Run */
556#define HSCR0_TXE 0x00000008 /* Transmit Enable */
557#define HSCR0_RXE 0x00000010 /* Receive Enable */
558#define HSCR0_RIE 0x00000020 /* Receive FIFO 2/5-to-3/5-full or */
559 /* more Interrupt Enable */
560#define HSCR0_TIE 0x00000040 /* Transmit FIFO 1/2-full or less */
561 /* Interrupt Enable */
562#define HSCR0_AME 0x00000080 /* Address Match Enable */
563
564#define HSCR1_AMV Fld (8, 0) /* Address Match Value */
565
566#define HSDR_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
567#if 0 /* Hidden receive FIFO bits */
568#define HSDR_EOF 0x00000100 /* receive End-Of-Frame (read) */
569#define HSDR_CRE 0x00000200 /* receive CRC Error (read) */
570#define HSDR_ROR 0x00000400 /* Receive FIFO Over-Run (read) */
571#endif /* 0 */
572
573#define HSSR0_EIF 0x00000001 /* Error In FIFO (read) */
574#define HSSR0_TUR 0x00000002 /* Transmit FIFO Under-Run */
575#define HSSR0_RAB 0x00000004 /* Receive ABort */
576#define HSSR0_TFS 0x00000008 /* Transmit FIFO 1/2-full or less */
577 /* Service request (read) */
578#define HSSR0_RFS 0x00000010 /* Receive FIFO 2/5-to-3/5-full or */
579 /* more Service request (read) */
580#define HSSR0_FRE 0x00000020 /* receive FRaming Error */
581
582#define HSSR1_RSY 0x00000001 /* Receiver SYnchronized (read) */
583#define HSSR1_TBY 0x00000002 /* Transmitter BusY (read) */
584#define HSSR1_RNE 0x00000004 /* Receive FIFO Not Empty (read) */
585#define HSSR1_TNF 0x00000008 /* Transmit FIFO Not Full (read) */
586#define HSSR1_EOF 0x00000010 /* receive End-Of-Frame (read) */
587#define HSSR1_CRE 0x00000020 /* receive CRC Error (read) */
588#define HSSR1_ROR 0x00000040 /* Receive FIFO Over-Run (read) */
589
590#define HSCR2_TXP 0x00040000 /* Transmit data Polarity (TXD_2) */
591#define HSCR2_TrDataL (HSCR2_TXP*0) /* Transmit Data active Low */
592 /* (inverted) */
593#define HSCR2_TrDataH (HSCR2_TXP*1) /* Transmit Data active High */
594 /* (non-inverted) */
595#define HSCR2_RXP 0x00080000 /* Receive data Polarity (RXD_2) */
596#define HSCR2_RcDataL (HSCR2_RXP*0) /* Receive Data active Low */
597 /* (inverted) */
598#define HSCR2_RcDataH (HSCR2_RXP*1) /* Receive Data active High */
599 /* (non-inverted) */
600
601
602/*
603 * Multi-media Communications Port (MCP) control registers
604 *
605 * Registers
606 * Ser4MCCR0 Serial port 4 Multi-media Communications Port (MCP)
607 * Control Register 0 (read/write).
608 * Ser4MCDR0 Serial port 4 Multi-media Communications Port (MCP)
609 * Data Register 0 (audio, read/write).
610 * Ser4MCDR1 Serial port 4 Multi-media Communications Port (MCP)
611 * Data Register 1 (telecom, read/write).
612 * Ser4MCDR2 Serial port 4 Multi-media Communications Port (MCP)
613 * Data Register 2 (CODEC registers, read/write).
614 * Ser4MCSR Serial port 4 Multi-media Communications Port (MCP)
615 * Status Register (read/write).
616 * Ser4MCCR1 Serial port 4 Multi-media Communications Port (MCP)
617 * Control Register 1 (read/write).
618 * [The MCCR1 register is only implemented in
619 * versions 2.0 (rev. = 8) and higher of the StrongARM
620 * SA-1100.]
621 *
622 * Clocks
623 * fmc, Tmc Frequency, period of the MCP communication (10 MHz,
624 * 12 MHz, or GPIO [21]).
625 * faud, Taud Frequency, period of the audio sampling.
626 * ftcm, Ttcm Frequency, period of the telecom sampling.
627 */
628
629#define Ser4MCCR0 __REG(0x80060000) /* Ser. port 4 MCP Control Reg. 0 */
630#define Ser4MCDR0 __REG(0x80060008) /* Ser. port 4 MCP Data Reg. 0 (audio) */
631#define Ser4MCDR1 __REG(0x8006000C) /* Ser. port 4 MCP Data Reg. 1 (telecom) */
632#define Ser4MCDR2 __REG(0x80060010) /* Ser. port 4 MCP Data Reg. 2 (CODEC reg.) */
633#define Ser4MCSR __REG(0x80060018) /* Ser. port 4 MCP Status Reg. */
634#define Ser4MCCR1 __REG(0x90060030) /* Ser. port 4 MCP Control Reg. 1 */
635
636#define MCCR0_ASD Fld (7, 0) /* Audio Sampling rate Divisor/32 */
637 /* [6..127] */
638 /* faud = fmc/(32*ASD) */
639 /* Taud = 32*ASD*Tmc */
640#define MCCR0_AudSmpDiv(Div) /* Audio Sampling rate Divisor */ \
641 /* [192..4064] */ \
642 ((Div)/32 << FShft (MCCR0_ASD))
643 /* faud = fmc/(32*Floor (Div/32)) */
644 /* Taud = 32*Floor (Div/32)*Tmc */
645#define MCCR0_CeilAudSmpDiv(Div) /* Ceil. of AudSmpDiv [192..4064] */ \
646 (((Div) + 31)/32 << FShft (MCCR0_ASD))
647 /* faud = fmc/(32*Ceil (Div/32)) */
648 /* Taud = 32*Ceil (Div/32)*Tmc */
649#define MCCR0_TSD Fld (7, 8) /* Telecom Sampling rate */
650 /* Divisor/32 [16..127] */
651 /* ftcm = fmc/(32*TSD) */
652 /* Ttcm = 32*TSD*Tmc */
653#define MCCR0_TcmSmpDiv(Div) /* Telecom Sampling rate Divisor */ \
654 /* [512..4064] */ \
655 ((Div)/32 << FShft (MCCR0_TSD))
656 /* ftcm = fmc/(32*Floor (Div/32)) */
657 /* Ttcm = 32*Floor (Div/32)*Tmc */
658#define MCCR0_CeilTcmSmpDiv(Div) /* Ceil. of TcmSmpDiv [512..4064] */ \
659 (((Div) + 31)/32 << FShft (MCCR0_TSD))
660 /* ftcm = fmc/(32*Ceil (Div/32)) */
661 /* Ttcm = 32*Ceil (Div/32)*Tmc */
662#define MCCR0_MCE 0x00010000 /* MCP Enable */
663#define MCCR0_ECS 0x00020000 /* External Clock Select */
664#define MCCR0_IntClk (MCCR0_ECS*0) /* Internal Clock (10 or 12 MHz) */
665#define MCCR0_ExtClk (MCCR0_ECS*1) /* External Clock (GPIO [21]) */
666#define MCCR0_ADM 0x00040000 /* A/D (audio/telecom) data */
667 /* sampling/storing Mode */
668#define MCCR0_VldBit (MCCR0_ADM*0) /* Valid Bit storing mode */
669#define MCCR0_SmpCnt (MCCR0_ADM*1) /* Sampling Counter storing mode */
670#define MCCR0_TTE 0x00080000 /* Telecom Transmit FIFO 1/2-full */
671 /* or less interrupt Enable */
672#define MCCR0_TRE 0x00100000 /* Telecom Receive FIFO 1/2-full */
673 /* or more interrupt Enable */
674#define MCCR0_ATE 0x00200000 /* Audio Transmit FIFO 1/2-full */
675 /* or less interrupt Enable */
676#define MCCR0_ARE 0x00400000 /* Audio Receive FIFO 1/2-full or */
677 /* more interrupt Enable */
678#define MCCR0_LBM 0x00800000 /* Look-Back Mode */
679#define MCCR0_ECP Fld (2, 24) /* External Clock Prescaler - 1 */
680#define MCCR0_ExtClkDiv(Div) /* External Clock Divisor [1..4] */ \
681 (((Div) - 1) << FShft (MCCR0_ECP))
682
683#define MCDR0_DATA Fld (12, 4) /* receive/transmit audio DATA */
684 /* FIFOs */
685
686#define MCDR1_DATA Fld (14, 2) /* receive/transmit telecom DATA */
687 /* FIFOs */
688
689 /* receive/transmit CODEC reg. */
690 /* FIFOs: */
691#define MCDR2_DATA Fld (16, 0) /* reg. DATA */
692#define MCDR2_RW 0x00010000 /* reg. Read/Write (transmit) */
693#define MCDR2_Rd (MCDR2_RW*0) /* reg. Read */
694#define MCDR2_Wr (MCDR2_RW*1) /* reg. Write */
695#define MCDR2_ADD Fld (4, 17) /* reg. ADDress */
696
697#define MCSR_ATS 0x00000001 /* Audio Transmit FIFO 1/2-full */
698 /* or less Service request (read) */
699#define MCSR_ARS 0x00000002 /* Audio Receive FIFO 1/2-full or */
700 /* more Service request (read) */
701#define MCSR_TTS 0x00000004 /* Telecom Transmit FIFO 1/2-full */
702 /* or less Service request (read) */
703#define MCSR_TRS 0x00000008 /* Telecom Receive FIFO 1/2-full */
704 /* or more Service request (read) */
705#define MCSR_ATU 0x00000010 /* Audio Transmit FIFO Under-run */
706#define MCSR_ARO 0x00000020 /* Audio Receive FIFO Over-run */
707#define MCSR_TTU 0x00000040 /* Telecom Transmit FIFO Under-run */
708#define MCSR_TRO 0x00000080 /* Telecom Receive FIFO Over-run */
709#define MCSR_ANF 0x00000100 /* Audio transmit FIFO Not Full */
710 /* (read) */
711#define MCSR_ANE 0x00000200 /* Audio receive FIFO Not Empty */
712 /* (read) */
713#define MCSR_TNF 0x00000400 /* Telecom transmit FIFO Not Full */
714 /* (read) */
715#define MCSR_TNE 0x00000800 /* Telecom receive FIFO Not Empty */
716 /* (read) */
717#define MCSR_CWC 0x00001000 /* CODEC register Write Completed */
718 /* (read) */
719#define MCSR_CRC 0x00002000 /* CODEC register Read Completed */
720 /* (read) */
721#define MCSR_ACE 0x00004000 /* Audio CODEC Enabled (read) */
722#define MCSR_TCE 0x00008000 /* Telecom CODEC Enabled (read) */
723
724#define MCCR1_CFS 0x00100000 /* Clock Freq. Select */
725#define MCCR1_F12MHz (MCCR1_CFS*0) /* Freq. (fmc) = ~ 12 MHz */
726 /* (11.981 MHz) */
727#define MCCR1_F10MHz (MCCR1_CFS*1) /* Freq. (fmc) = ~ 10 MHz */
728 /* (9.585 MHz) */
729
730
731/*
732 * Synchronous Serial Port (SSP) control registers
733 *
734 * Registers
735 * Ser4SSCR0 Serial port 4 Synchronous Serial Port (SSP) Control
736 * Register 0 (read/write).
737 * Ser4SSCR1 Serial port 4 Synchronous Serial Port (SSP) Control
738 * Register 1 (read/write).
739 * [Bits SPO and SP are only implemented in versions 2.0
740 * (rev. = 8) and higher of the StrongARM SA-1100.]
741 * Ser4SSDR Serial port 4 Synchronous Serial Port (SSP) Data
742 * Register (read/write).
743 * Ser4SSSR Serial port 4 Synchronous Serial Port (SSP) Status
744 * Register (read/write).
745 *
746 * Clocks
747 * fxtl, Txtl Frequency, period of the system crystal (3.6864 MHz
748 * or 3.5795 MHz).
749 * fss, Tss Frequency, period of the SSP communication.
750 */
751
752#define Ser4SSCR0 __REG(0x80070060) /* Ser. port 4 SSP Control Reg. 0 */
753#define Ser4SSCR1 __REG(0x80070064) /* Ser. port 4 SSP Control Reg. 1 */
754#define Ser4SSDR __REG(0x8007006C) /* Ser. port 4 SSP Data Reg. */
755#define Ser4SSSR __REG(0x80070074) /* Ser. port 4 SSP Status Reg. */
756
757#define SSCR0_DSS Fld (4, 0) /* Data Size - 1 Select [3..15] */
758#define SSCR0_DataSize(Size) /* Data Size Select [4..16] */ \
759 (((Size) - 1) << FShft (SSCR0_DSS))
760#define SSCR0_FRF Fld (2, 4) /* FRame Format */
761#define SSCR0_Motorola /* Motorola Serial Peripheral */ \
762 /* Interface (SPI) format */ \
763 (0 << FShft (SSCR0_FRF))
764#define SSCR0_TI /* Texas Instruments Synchronous */ \
765 /* Serial format */ \
766 (1 << FShft (SSCR0_FRF))
767#define SSCR0_National /* National Microwire format */ \
768 (2 << FShft (SSCR0_FRF))
769#define SSCR0_SSE 0x00000080 /* SSP Enable */
770#define SSCR0_SCR Fld (8, 8) /* Serial Clock Rate divisor/2 - 1 */
771 /* fss = fxtl/(2*(SCR + 1)) */
772 /* Tss = 2*(SCR + 1)*Txtl */
773#define SSCR0_SerClkDiv(Div) /* Serial Clock Divisor [2..512] */ \
774 (((Div) - 2)/2 << FShft (SSCR0_SCR))
775 /* fss = fxtl/(2*Floor (Div/2)) */
776 /* Tss = 2*Floor (Div/2)*Txtl */
777#define SSCR0_CeilSerClkDiv(Div) /* Ceil. of SerClkDiv [2..512] */ \
778 (((Div) - 1)/2 << FShft (SSCR0_SCR))
779 /* fss = fxtl/(2*Ceil (Div/2)) */
780 /* Tss = 2*Ceil (Div/2)*Txtl */
781
782#define SSCR1_RIE 0x00000001 /* Receive FIFO 1/2-full or more */
783 /* Interrupt Enable */
784#define SSCR1_TIE 0x00000002 /* Transmit FIFO 1/2-full or less */
785 /* Interrupt Enable */
786#define SSCR1_LBM 0x00000004 /* Look-Back Mode */
787#define SSCR1_SPO 0x00000008 /* Sample clock (SCLK) POlarity */
788#define SSCR1_SClkIactL (SSCR1_SPO*0) /* Sample Clock Inactive Low */
789#define SSCR1_SClkIactH (SSCR1_SPO*1) /* Sample Clock Inactive High */
790#define SSCR1_SP 0x00000010 /* Sample clock (SCLK) Phase */
791#define SSCR1_SClk1P (SSCR1_SP*0) /* Sample Clock active 1 Period */
792 /* after frame (SFRM, 1st edge) */
793#define SSCR1_SClk1_2P (SSCR1_SP*1) /* Sample Clock active 1/2 Period */
794 /* after frame (SFRM, 1st edge) */
795#define SSCR1_ECS 0x00000020 /* External Clock Select */
796#define SSCR1_IntClk (SSCR1_ECS*0) /* Internal Clock */
797#define SSCR1_ExtClk (SSCR1_ECS*1) /* External Clock (GPIO [19]) */
798
799#define SSDR_DATA Fld (16, 0) /* receive/transmit DATA FIFOs */
800
801#define SSSR_TNF 0x00000002 /* Transmit FIFO Not Full (read) */
802#define SSSR_RNE 0x00000004 /* Receive FIFO Not Empty (read) */
803#define SSSR_BSY 0x00000008 /* SSP BuSY (read) */
804#define SSSR_TFS 0x00000010 /* Transmit FIFO 1/2-full or less */
805 /* Service request (read) */
806#define SSSR_RFS 0x00000020 /* Receive FIFO 1/2-full or more */
807 /* Service request (read) */
808#define SSSR_ROR 0x00000040 /* Receive FIFO Over-Run */
809
810
811/*
812 * Operating System (OS) timer control registers
813 *
814 * Registers
815 * OSMR0 Operating System (OS) timer Match Register 0
816 * (read/write).
817 * OSMR1 Operating System (OS) timer Match Register 1
818 * (read/write).
819 * OSMR2 Operating System (OS) timer Match Register 2
820 * (read/write).
821 * OSMR3 Operating System (OS) timer Match Register 3
822 * (read/write).
823 * OSCR Operating System (OS) timer Counter Register
824 * (read/write).
825 * OSSR Operating System (OS) timer Status Register
826 * (read/write).
827 * OWER Operating System (OS) timer Watch-dog Enable Register
828 * (read/write).
829 * OIER Operating System (OS) timer Interrupt Enable Register
830 * (read/write).
831 */
832
833#define OSMR0 __REG(0x90000000) /* OS timer Match Reg. 0 */
834#define OSMR1 __REG(0x90000004) /* OS timer Match Reg. 1 */
835#define OSMR2 __REG(0x90000008) /* OS timer Match Reg. 2 */
836#define OSMR3 __REG(0x9000000c) /* OS timer Match Reg. 3 */
837#define OSCR __REG(0x90000010) /* OS timer Counter Reg. */
838#define OSSR __REG(0x90000014 ) /* OS timer Status Reg. */
839#define OWER __REG(0x90000018 ) /* OS timer Watch-dog Enable Reg. */
840#define OIER __REG(0x9000001C ) /* OS timer Interrupt Enable Reg. */
841
842#define OSSR_M(Nb) /* Match detected [0..3] */ \
843 (0x00000001 << (Nb))
844#define OSSR_M0 OSSR_M (0) /* Match detected 0 */
845#define OSSR_M1 OSSR_M (1) /* Match detected 1 */
846#define OSSR_M2 OSSR_M (2) /* Match detected 2 */
847#define OSSR_M3 OSSR_M (3) /* Match detected 3 */
848
849#define OWER_WME 0x00000001 /* Watch-dog Match Enable */
850 /* (set only) */
851
852#define OIER_E(Nb) /* match interrupt Enable [0..3] */ \
853 (0x00000001 << (Nb))
854#define OIER_E0 OIER_E (0) /* match interrupt Enable 0 */
855#define OIER_E1 OIER_E (1) /* match interrupt Enable 1 */
856#define OIER_E2 OIER_E (2) /* match interrupt Enable 2 */
857#define OIER_E3 OIER_E (3) /* match interrupt Enable 3 */
858
859
860/*
861 * Real-Time Clock (RTC) control registers
862 *
863 * Registers
864 * RTAR Real-Time Clock (RTC) Alarm Register (read/write).
865 * RCNR Real-Time Clock (RTC) CouNt Register (read/write).
866 * RTTR Real-Time Clock (RTC) Trim Register (read/write).
867 * RTSR Real-Time Clock (RTC) Status Register (read/write).
868 *
869 * Clocks
870 * frtx, Trtx Frequency, period of the real-time clock crystal
871 * (32.768 kHz nominal).
872 * frtc, Trtc Frequency, period of the real-time clock counter
873 * (1 Hz nominal).
874 */
875
876#define RTAR __REG(0x90010000) /* RTC Alarm Reg. */
877#define RCNR __REG(0x90010004) /* RTC CouNt Reg. */
878#define RTTR __REG(0x90010008) /* RTC Trim Reg. */
879#define RTSR __REG(0x90010010) /* RTC Status Reg. */
880
881#define RTTR_C Fld (16, 0) /* clock divider Count - 1 */
882#define RTTR_D Fld (10, 16) /* trim Delete count */
883 /* frtc = (1023*(C + 1) - D)*frtx/ */
884 /* (1023*(C + 1)^2) */
885 /* Trtc = (1023*(C + 1)^2)*Trtx/ */
886 /* (1023*(C + 1) - D) */
887
888#define RTSR_AL 0x00000001 /* ALarm detected */
889#define RTSR_HZ 0x00000002 /* 1 Hz clock detected */
890#define RTSR_ALE 0x00000004 /* ALarm interrupt Enable */
891#define RTSR_HZE 0x00000008 /* 1 Hz clock interrupt Enable */
892
893
894/*
895 * Power Manager (PM) control registers
896 *
897 * Registers
898 * PMCR Power Manager (PM) Control Register (read/write).
899 * PSSR Power Manager (PM) Sleep Status Register (read/write).
900 * PSPR Power Manager (PM) Scratch-Pad Register (read/write).
901 * PWER Power Manager (PM) Wake-up Enable Register
902 * (read/write).
903 * PCFR Power Manager (PM) general ConFiguration Register
904 * (read/write).
905 * PPCR Power Manager (PM) Phase-Locked Loop (PLL)
906 * Configuration Register (read/write).
907 * PGSR Power Manager (PM) General-Purpose Input/Output (GPIO)
908 * Sleep state Register (read/write, see GPIO pins).
909 * POSR Power Manager (PM) Oscillator Status Register (read).
910 *
911 * Clocks
912 * fxtl, Txtl Frequency, period of the system crystal (3.6864 MHz
913 * or 3.5795 MHz).
914 * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
915 */
916
917#define PMCR __REG(0x90020000) /* PM Control Reg. */
918#define PSSR __REG(0x90020004) /* PM Sleep Status Reg. */
919#define PSPR __REG(0x90020008) /* PM Scratch-Pad Reg. */
920#define PWER __REG(0x9002000C) /* PM Wake-up Enable Reg. */
921#define PCFR __REG(0x90020010) /* PM general ConFiguration Reg. */
922#define PPCR __REG(0x90020014) /* PM PLL Configuration Reg. */
923#define PGSR __REG(0x90020018) /* PM GPIO Sleep state Reg. */
924#define POSR __REG(0x9002001C) /* PM Oscillator Status Reg. */
925
926#define PMCR_SF 0x00000001 /* Sleep Force (set only) */
927
928#define PSSR_SS 0x00000001 /* Software Sleep */
929#define PSSR_BFS 0x00000002 /* Battery Fault Status */
930 /* (BATT_FAULT) */
931#define PSSR_VFS 0x00000004 /* Vdd Fault Status (VDD_FAULT) */
932#define PSSR_DH 0x00000008 /* DRAM control Hold */
933#define PSSR_PH 0x00000010 /* Peripheral control Hold */
934
935#define PWER_GPIO(Nb) GPIO_GPIO (Nb) /* GPIO [0..27] wake-up enable */
936#define PWER_GPIO0 PWER_GPIO (0) /* GPIO [0] wake-up enable */
937#define PWER_GPIO1 PWER_GPIO (1) /* GPIO [1] wake-up enable */
938#define PWER_GPIO2 PWER_GPIO (2) /* GPIO [2] wake-up enable */
939#define PWER_GPIO3 PWER_GPIO (3) /* GPIO [3] wake-up enable */
940#define PWER_GPIO4 PWER_GPIO (4) /* GPIO [4] wake-up enable */
941#define PWER_GPIO5 PWER_GPIO (5) /* GPIO [5] wake-up enable */
942#define PWER_GPIO6 PWER_GPIO (6) /* GPIO [6] wake-up enable */
943#define PWER_GPIO7 PWER_GPIO (7) /* GPIO [7] wake-up enable */
944#define PWER_GPIO8 PWER_GPIO (8) /* GPIO [8] wake-up enable */
945#define PWER_GPIO9 PWER_GPIO (9) /* GPIO [9] wake-up enable */
946#define PWER_GPIO10 PWER_GPIO (10) /* GPIO [10] wake-up enable */
947#define PWER_GPIO11 PWER_GPIO (11) /* GPIO [11] wake-up enable */
948#define PWER_GPIO12 PWER_GPIO (12) /* GPIO [12] wake-up enable */
949#define PWER_GPIO13 PWER_GPIO (13) /* GPIO [13] wake-up enable */
950#define PWER_GPIO14 PWER_GPIO (14) /* GPIO [14] wake-up enable */
951#define PWER_GPIO15 PWER_GPIO (15) /* GPIO [15] wake-up enable */
952#define PWER_GPIO16 PWER_GPIO (16) /* GPIO [16] wake-up enable */
953#define PWER_GPIO17 PWER_GPIO (17) /* GPIO [17] wake-up enable */
954#define PWER_GPIO18 PWER_GPIO (18) /* GPIO [18] wake-up enable */
955#define PWER_GPIO19 PWER_GPIO (19) /* GPIO [19] wake-up enable */
956#define PWER_GPIO20 PWER_GPIO (20) /* GPIO [20] wake-up enable */
957#define PWER_GPIO21 PWER_GPIO (21) /* GPIO [21] wake-up enable */
958#define PWER_GPIO22 PWER_GPIO (22) /* GPIO [22] wake-up enable */
959#define PWER_GPIO23 PWER_GPIO (23) /* GPIO [23] wake-up enable */
960#define PWER_GPIO24 PWER_GPIO (24) /* GPIO [24] wake-up enable */
961#define PWER_GPIO25 PWER_GPIO (25) /* GPIO [25] wake-up enable */
962#define PWER_GPIO26 PWER_GPIO (26) /* GPIO [26] wake-up enable */
963#define PWER_GPIO27 PWER_GPIO (27) /* GPIO [27] wake-up enable */
964#define PWER_RTC 0x80000000 /* RTC alarm wake-up enable */
965
966#define PCFR_OPDE 0x00000001 /* Oscillator Power-Down Enable */
967#define PCFR_ClkRun (PCFR_OPDE*0) /* Clock Running in sleep mode */
968#define PCFR_ClkStp (PCFR_OPDE*1) /* Clock Stopped in sleep mode */
969#define PCFR_FP 0x00000002 /* Float PCMCIA pins */
970#define PCFR_PCMCIANeg (PCFR_FP*0) /* PCMCIA pins Negated (1) */
971#define PCFR_PCMCIAFlt (PCFR_FP*1) /* PCMCIA pins Floating */
972#define PCFR_FS 0x00000004 /* Float Static memory pins */
973#define PCFR_StMemNeg (PCFR_FS*0) /* Static Memory pins Negated (1) */
974#define PCFR_StMemFlt (PCFR_FS*1) /* Static Memory pins Floating */
975#define PCFR_FO 0x00000008 /* Force RTC oscillator */
976 /* (32.768 kHz) enable On */
977
978#define PPCR_CCF Fld (5, 0) /* CPU core Clock (CCLK) Freq. */
979#define PPCR_Fx16 /* Freq. x 16 (fcpu = 16*fxtl) */ \
980 (0x00 << FShft (PPCR_CCF))
981#define PPCR_Fx20 /* Freq. x 20 (fcpu = 20*fxtl) */ \
982 (0x01 << FShft (PPCR_CCF))
983#define PPCR_Fx24 /* Freq. x 24 (fcpu = 24*fxtl) */ \
984 (0x02 << FShft (PPCR_CCF))
985#define PPCR_Fx28 /* Freq. x 28 (fcpu = 28*fxtl) */ \
986 (0x03 << FShft (PPCR_CCF))
987#define PPCR_Fx32 /* Freq. x 32 (fcpu = 32*fxtl) */ \
988 (0x04 << FShft (PPCR_CCF))
989#define PPCR_Fx36 /* Freq. x 36 (fcpu = 36*fxtl) */ \
990 (0x05 << FShft (PPCR_CCF))
991#define PPCR_Fx40 /* Freq. x 40 (fcpu = 40*fxtl) */ \
992 (0x06 << FShft (PPCR_CCF))
993#define PPCR_Fx44 /* Freq. x 44 (fcpu = 44*fxtl) */ \
994 (0x07 << FShft (PPCR_CCF))
995#define PPCR_Fx48 /* Freq. x 48 (fcpu = 48*fxtl) */ \
996 (0x08 << FShft (PPCR_CCF))
997#define PPCR_Fx52 /* Freq. x 52 (fcpu = 52*fxtl) */ \
998 (0x09 << FShft (PPCR_CCF))
999#define PPCR_Fx56 /* Freq. x 56 (fcpu = 56*fxtl) */ \
1000 (0x0A << FShft (PPCR_CCF))
1001#define PPCR_Fx60 /* Freq. x 60 (fcpu = 60*fxtl) */ \
1002 (0x0B << FShft (PPCR_CCF))
1003#define PPCR_Fx64 /* Freq. x 64 (fcpu = 64*fxtl) */ \
1004 (0x0C << FShft (PPCR_CCF))
1005#define PPCR_Fx68 /* Freq. x 68 (fcpu = 68*fxtl) */ \
1006 (0x0D << FShft (PPCR_CCF))
1007#define PPCR_Fx72 /* Freq. x 72 (fcpu = 72*fxtl) */ \
1008 (0x0E << FShft (PPCR_CCF))
1009#define PPCR_Fx76 /* Freq. x 76 (fcpu = 76*fxtl) */ \
1010 (0x0F << FShft (PPCR_CCF))
1011 /* 3.6864 MHz crystal (fxtl): */
1012#define PPCR_F59_0MHz PPCR_Fx16 /* Freq. (fcpu) = 59.0 MHz */
1013#define PPCR_F73_7MHz PPCR_Fx20 /* Freq. (fcpu) = 73.7 MHz */
1014#define PPCR_F88_5MHz PPCR_Fx24 /* Freq. (fcpu) = 88.5 MHz */
1015#define PPCR_F103_2MHz PPCR_Fx28 /* Freq. (fcpu) = 103.2 MHz */
1016#define PPCR_F118_0MHz PPCR_Fx32 /* Freq. (fcpu) = 118.0 MHz */
1017#define PPCR_F132_7MHz PPCR_Fx36 /* Freq. (fcpu) = 132.7 MHz */
1018#define PPCR_F147_5MHz PPCR_Fx40 /* Freq. (fcpu) = 147.5 MHz */
1019#define PPCR_F162_2MHz PPCR_Fx44 /* Freq. (fcpu) = 162.2 MHz */
1020#define PPCR_F176_9MHz PPCR_Fx48 /* Freq. (fcpu) = 176.9 MHz */
1021#define PPCR_F191_7MHz PPCR_Fx52 /* Freq. (fcpu) = 191.7 MHz */
1022#define PPCR_F206_4MHz PPCR_Fx56 /* Freq. (fcpu) = 206.4 MHz */
1023#define PPCR_F221_2MHz PPCR_Fx60 /* Freq. (fcpu) = 221.2 MHz */
1024#define PPCR_F239_6MHz PPCR_Fx64 /* Freq. (fcpu) = 239.6 MHz */
1025#define PPCR_F250_7MHz PPCR_Fx68 /* Freq. (fcpu) = 250.7 MHz */
1026#define PPCR_F265_4MHz PPCR_Fx72 /* Freq. (fcpu) = 265.4 MHz */
1027#define PPCR_F280_2MHz PPCR_Fx76 /* Freq. (fcpu) = 280.2 MHz */
1028 /* 3.5795 MHz crystal (fxtl): */
1029#define PPCR_F57_3MHz PPCR_Fx16 /* Freq. (fcpu) = 57.3 MHz */
1030#define PPCR_F71_6MHz PPCR_Fx20 /* Freq. (fcpu) = 71.6 MHz */
1031#define PPCR_F85_9MHz PPCR_Fx24 /* Freq. (fcpu) = 85.9 MHz */
1032#define PPCR_F100_2MHz PPCR_Fx28 /* Freq. (fcpu) = 100.2 MHz */
1033#define PPCR_F114_5MHz PPCR_Fx32 /* Freq. (fcpu) = 114.5 MHz */
1034#define PPCR_F128_9MHz PPCR_Fx36 /* Freq. (fcpu) = 128.9 MHz */
1035#define PPCR_F143_2MHz PPCR_Fx40 /* Freq. (fcpu) = 143.2 MHz */
1036#define PPCR_F157_5MHz PPCR_Fx44 /* Freq. (fcpu) = 157.5 MHz */
1037#define PPCR_F171_8MHz PPCR_Fx48 /* Freq. (fcpu) = 171.8 MHz */
1038#define PPCR_F186_1MHz PPCR_Fx52 /* Freq. (fcpu) = 186.1 MHz */
1039#define PPCR_F200_5MHz PPCR_Fx56 /* Freq. (fcpu) = 200.5 MHz */
1040#define PPCR_F214_8MHz PPCR_Fx60 /* Freq. (fcpu) = 214.8 MHz */
1041#define PPCR_F229_1MHz PPCR_Fx64 /* Freq. (fcpu) = 229.1 MHz */
1042#define PPCR_F243_4MHz PPCR_Fx68 /* Freq. (fcpu) = 243.4 MHz */
1043#define PPCR_F257_7MHz PPCR_Fx72 /* Freq. (fcpu) = 257.7 MHz */
1044#define PPCR_F272_0MHz PPCR_Fx76 /* Freq. (fcpu) = 272.0 MHz */
1045
1046#define POSR_OOK 0x00000001 /* RTC Oscillator (32.768 kHz) OK */
1047
1048
1049/*
1050 * Reset Controller (RC) control registers
1051 *
1052 * Registers
1053 * RSRR Reset Controller (RC) Software Reset Register
1054 * (read/write).
1055 * RCSR Reset Controller (RC) Status Register (read/write).
1056 */
1057
1058#define RSRR __REG(0x90030000) /* RC Software Reset Reg. */
1059#define RCSR __REG(0x90030004) /* RC Status Reg. */
1060
1061#define RSRR_SWR 0x00000001 /* SoftWare Reset (set only) */
1062
1063#define RCSR_HWR 0x00000001 /* HardWare Reset */
1064#define RCSR_SWR 0x00000002 /* SoftWare Reset */
1065#define RCSR_WDR 0x00000004 /* Watch-Dog Reset */
1066#define RCSR_SMR 0x00000008 /* Sleep-Mode Reset */
1067
1068
1069/*
1070 * Test unit control registers
1071 *
1072 * Registers
1073 * TUCR Test Unit Control Register (read/write).
1074 */
1075
1076#define TUCR __REG(0x90030008) /* Test Unit Control Reg. */
1077
1078#define TUCR_TIC 0x00000040 /* TIC mode */
1079#define TUCR_TTST 0x00000080 /* Trim TeST mode */
1080#define TUCR_RCRC 0x00000100 /* Richard's Cyclic Redundancy */
1081 /* Check */
1082#define TUCR_PMD 0x00000200 /* Power Management Disable */
1083#define TUCR_MR 0x00000400 /* Memory Request mode */
1084#define TUCR_NoMB (TUCR_MR*0) /* No Memory Bus request & grant */
1085#define TUCR_MBGPIO (TUCR_MR*1) /* Memory Bus request (MBREQ) & */
1086 /* grant (MBGNT) on GPIO [22:21] */
1087#define TUCR_CTB Fld (3, 20) /* Clock Test Bits */
1088#define TUCR_FDC 0x00800000 /* RTC Force Delete Count */
1089#define TUCR_FMC 0x01000000 /* Force Michelle's Control mode */
1090#define TUCR_TMC 0x02000000 /* RTC Trimmer Multiplexer Control */
1091#define TUCR_DPS 0x04000000 /* Disallow Pad Sleep */
1092#define TUCR_TSEL Fld (3, 29) /* clock Test SELect on GPIO [27] */
1093#define TUCR_32_768kHz /* 32.768 kHz osc. on GPIO [27] */ \
1094 (0 << FShft (TUCR_TSEL))
1095#define TUCR_3_6864MHz /* 3.6864 MHz osc. on GPIO [27] */ \
1096 (1 << FShft (TUCR_TSEL))
1097#define TUCR_VDD /* VDD ring osc./16 on GPIO [27] */ \
1098 (2 << FShft (TUCR_TSEL))
1099#define TUCR_96MHzPLL /* 96 MHz PLL/4 on GPIO [27] */ \
1100 (3 << FShft (TUCR_TSEL))
1101#define TUCR_Clock /* internal (fcpu/2) & 32.768 kHz */ \
1102 /* Clocks on GPIO [26:27] */ \
1103 (4 << FShft (TUCR_TSEL))
1104#define TUCR_3_6864MHzA /* 3.6864 MHz osc. on GPIO [27] */ \
1105 /* (Alternative) */ \
1106 (5 << FShft (TUCR_TSEL))
1107#define TUCR_MainPLL /* Main PLL/16 on GPIO [27] */ \
1108 (6 << FShft (TUCR_TSEL))
1109#define TUCR_VDDL /* VDDL ring osc./4 on GPIO [27] */ \
1110 (7 << FShft (TUCR_TSEL))
1111
1112
1113/*
1114 * General-Purpose Input/Output (GPIO) control registers
1115 *
1116 * Registers
1117 * GPLR General-Purpose Input/Output (GPIO) Pin Level
1118 * Register (read).
1119 * GPDR General-Purpose Input/Output (GPIO) Pin Direction
1120 * Register (read/write).
1121 * GPSR General-Purpose Input/Output (GPIO) Pin output Set
1122 * Register (write).
1123 * GPCR General-Purpose Input/Output (GPIO) Pin output Clear
1124 * Register (write).
1125 * GRER General-Purpose Input/Output (GPIO) Rising-Edge
1126 * detect Register (read/write).
1127 * GFER General-Purpose Input/Output (GPIO) Falling-Edge
1128 * detect Register (read/write).
1129 * GEDR General-Purpose Input/Output (GPIO) Edge Detect
1130 * status Register (read/write).
1131 * GAFR General-Purpose Input/Output (GPIO) Alternate
1132 * Function Register (read/write).
1133 *
1134 * Clock
1135 * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
1136 */
1137
1138#define GPLR __REG(0x90040000) /* GPIO Pin Level Reg. */
1139#define GPDR __REG(0x90040004) /* GPIO Pin Direction Reg. */
1140#define GPSR __REG(0x90040008) /* GPIO Pin output Set Reg. */
1141#define GPCR __REG(0x9004000C) /* GPIO Pin output Clear Reg. */
1142#define GRER __REG(0x90040010) /* GPIO Rising-Edge detect Reg. */
1143#define GFER __REG(0x90040014) /* GPIO Falling-Edge detect Reg. */
1144#define GEDR __REG(0x90040018) /* GPIO Edge Detect status Reg. */
1145#define GAFR __REG(0x9004001C) /* GPIO Alternate Function Reg. */
1146
1147#define GPIO_MIN (0)
1148#define GPIO_MAX (27)
1149
1150#define GPIO_GPIO(Nb) /* GPIO [0..27] */ \
1151 (0x00000001 << (Nb))
1152#define GPIO_GPIO0 GPIO_GPIO (0) /* GPIO [0] */
1153#define GPIO_GPIO1 GPIO_GPIO (1) /* GPIO [1] */
1154#define GPIO_GPIO2 GPIO_GPIO (2) /* GPIO [2] */
1155#define GPIO_GPIO3 GPIO_GPIO (3) /* GPIO [3] */
1156#define GPIO_GPIO4 GPIO_GPIO (4) /* GPIO [4] */
1157#define GPIO_GPIO5 GPIO_GPIO (5) /* GPIO [5] */
1158#define GPIO_GPIO6 GPIO_GPIO (6) /* GPIO [6] */
1159#define GPIO_GPIO7 GPIO_GPIO (7) /* GPIO [7] */
1160#define GPIO_GPIO8 GPIO_GPIO (8) /* GPIO [8] */
1161#define GPIO_GPIO9 GPIO_GPIO (9) /* GPIO [9] */
1162#define GPIO_GPIO10 GPIO_GPIO (10) /* GPIO [10] */
1163#define GPIO_GPIO11 GPIO_GPIO (11) /* GPIO [11] */
1164#define GPIO_GPIO12 GPIO_GPIO (12) /* GPIO [12] */
1165#define GPIO_GPIO13 GPIO_GPIO (13) /* GPIO [13] */
1166#define GPIO_GPIO14 GPIO_GPIO (14) /* GPIO [14] */
1167#define GPIO_GPIO15 GPIO_GPIO (15) /* GPIO [15] */
1168#define GPIO_GPIO16 GPIO_GPIO (16) /* GPIO [16] */
1169#define GPIO_GPIO17 GPIO_GPIO (17) /* GPIO [17] */
1170#define GPIO_GPIO18 GPIO_GPIO (18) /* GPIO [18] */
1171#define GPIO_GPIO19 GPIO_GPIO (19) /* GPIO [19] */
1172#define GPIO_GPIO20 GPIO_GPIO (20) /* GPIO [20] */
1173#define GPIO_GPIO21 GPIO_GPIO (21) /* GPIO [21] */
1174#define GPIO_GPIO22 GPIO_GPIO (22) /* GPIO [22] */
1175#define GPIO_GPIO23 GPIO_GPIO (23) /* GPIO [23] */
1176#define GPIO_GPIO24 GPIO_GPIO (24) /* GPIO [24] */
1177#define GPIO_GPIO25 GPIO_GPIO (25) /* GPIO [25] */
1178#define GPIO_GPIO26 GPIO_GPIO (26) /* GPIO [26] */
1179#define GPIO_GPIO27 GPIO_GPIO (27) /* GPIO [27] */
1180
1181#define GPIO_LDD(Nb) /* LCD Data [8..15] (O) */ \
1182 GPIO_GPIO ((Nb) - 6)
1183#define GPIO_LDD8 GPIO_LDD (8) /* LCD Data [8] (O) */
1184#define GPIO_LDD9 GPIO_LDD (9) /* LCD Data [9] (O) */
1185#define GPIO_LDD10 GPIO_LDD (10) /* LCD Data [10] (O) */
1186#define GPIO_LDD11 GPIO_LDD (11) /* LCD Data [11] (O) */
1187#define GPIO_LDD12 GPIO_LDD (12) /* LCD Data [12] (O) */
1188#define GPIO_LDD13 GPIO_LDD (13) /* LCD Data [13] (O) */
1189#define GPIO_LDD14 GPIO_LDD (14) /* LCD Data [14] (O) */
1190#define GPIO_LDD15 GPIO_LDD (15) /* LCD Data [15] (O) */
1191 /* ser. port 4: */
1192#define GPIO_SSP_TXD GPIO_GPIO (10) /* SSP Transmit Data (O) */
1193#define GPIO_SSP_RXD GPIO_GPIO (11) /* SSP Receive Data (I) */
1194#define GPIO_SSP_SCLK GPIO_GPIO (12) /* SSP Sample CLocK (O) */
1195#define GPIO_SSP_SFRM GPIO_GPIO (13) /* SSP Sample FRaMe (O) */
1196 /* ser. port 1: */
1197#define GPIO_UART_TXD GPIO_GPIO (14) /* UART Transmit Data (O) */
1198#define GPIO_UART_RXD GPIO_GPIO (15) /* UART Receive Data (I) */
1199#define GPIO_SDLC_SCLK GPIO_GPIO (16) /* SDLC Sample CLocK (I/O) */
1200#define GPIO_SDLC_AAF GPIO_GPIO (17) /* SDLC Abort After Frame (O) */
1201#define GPIO_UART_SCLK1 GPIO_GPIO (18) /* UART Sample CLocK 1 (I) */
1202 /* ser. port 4: */
1203#define GPIO_SSP_CLK GPIO_GPIO (19) /* SSP external CLocK (I) */
1204 /* ser. port 3: */
1205#define GPIO_UART_SCLK3 GPIO_GPIO (20) /* UART Sample CLocK 3 (I) */
1206 /* ser. port 4: */
1207#define GPIO_MCP_CLK GPIO_GPIO (21) /* MCP CLocK (I) */
1208 /* test controller: */
1209#define GPIO_TIC_ACK GPIO_GPIO (21) /* TIC ACKnowledge (O) */
1210#define GPIO_MBGNT GPIO_GPIO (21) /* Memory Bus GraNT (O) */
1211#define GPIO_TREQA GPIO_GPIO (22) /* TIC REQuest A (I) */
1212#define GPIO_MBREQ GPIO_GPIO (22) /* Memory Bus REQuest (I) */
1213#define GPIO_TREQB GPIO_GPIO (23) /* TIC REQuest B (I) */
1214#define GPIO_1Hz GPIO_GPIO (25) /* 1 Hz clock (O) */
1215#define GPIO_RCLK GPIO_GPIO (26) /* internal (R) CLocK (O, fcpu/2) */
1216#define GPIO_32_768kHz GPIO_GPIO (27) /* 32.768 kHz clock (O, RTC) */
1217
1218#define GPDR_In 0 /* Input */
1219#define GPDR_Out 1 /* Output */
1220
1221
1222/*
1223 * Interrupt Controller (IC) control registers
1224 *
1225 * Registers
1226 * ICIP Interrupt Controller (IC) Interrupt ReQuest (IRQ)
1227 * Pending register (read).
1228 * ICMR Interrupt Controller (IC) Mask Register (read/write).
1229 * ICLR Interrupt Controller (IC) Level Register (read/write).
1230 * ICCR Interrupt Controller (IC) Control Register
1231 * (read/write).
1232 * [The ICCR register is only implemented in versions 2.0
1233 * (rev. = 8) and higher of the StrongARM SA-1100.]
1234 * ICFP Interrupt Controller (IC) Fast Interrupt reQuest
1235 * (FIQ) Pending register (read).
1236 * ICPR Interrupt Controller (IC) Pending Register (read).
1237 * [The ICPR register is active low (inverted) in
1238 * versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
1239 * StrongARM SA-1100, it is active high (non-inverted) in
1240 * versions 2.0 (rev. = 8) and higher.]
1241 */
1242
1243#define ICIP __REG(0x90050000) /* IC IRQ Pending reg. */
1244#define ICMR __REG(0x90050004) /* IC Mask Reg. */
1245#define ICLR __REG(0x90050008) /* IC Level Reg. */
1246#define ICCR __REG(0x9005000C) /* IC Control Reg. */
1247#define ICFP __REG(0x90050010) /* IC FIQ Pending reg. */
1248#define ICPR __REG(0x90050020) /* IC Pending Reg. */
1249
1250#define IC_GPIO(Nb) /* GPIO [0..10] */ \
1251 (0x00000001 << (Nb))
1252#define IC_GPIO0 IC_GPIO (0) /* GPIO [0] */
1253#define IC_GPIO1 IC_GPIO (1) /* GPIO [1] */
1254#define IC_GPIO2 IC_GPIO (2) /* GPIO [2] */
1255#define IC_GPIO3 IC_GPIO (3) /* GPIO [3] */
1256#define IC_GPIO4 IC_GPIO (4) /* GPIO [4] */
1257#define IC_GPIO5 IC_GPIO (5) /* GPIO [5] */
1258#define IC_GPIO6 IC_GPIO (6) /* GPIO [6] */
1259#define IC_GPIO7 IC_GPIO (7) /* GPIO [7] */
1260#define IC_GPIO8 IC_GPIO (8) /* GPIO [8] */
1261#define IC_GPIO9 IC_GPIO (9) /* GPIO [9] */
1262#define IC_GPIO10 IC_GPIO (10) /* GPIO [10] */
1263#define IC_GPIO11_27 0x00000800 /* GPIO [11:27] (ORed) */
1264#define IC_LCD 0x00001000 /* LCD controller */
1265#define IC_Ser0UDC 0x00002000 /* Ser. port 0 UDC */
1266#define IC_Ser1SDLC 0x00004000 /* Ser. port 1 SDLC */
1267#define IC_Ser1UART 0x00008000 /* Ser. port 1 UART */
1268#define IC_Ser2ICP 0x00010000 /* Ser. port 2 ICP */
1269#define IC_Ser3UART 0x00020000 /* Ser. port 3 UART */
1270#define IC_Ser4MCP 0x00040000 /* Ser. port 4 MCP */
1271#define IC_Ser4SSP 0x00080000 /* Ser. port 4 SSP */
1272#define IC_DMA(Nb) /* DMA controller channel [0..5] */ \
1273 (0x00100000 << (Nb))
1274#define IC_DMA0 IC_DMA (0) /* DMA controller channel 0 */
1275#define IC_DMA1 IC_DMA (1) /* DMA controller channel 1 */
1276#define IC_DMA2 IC_DMA (2) /* DMA controller channel 2 */
1277#define IC_DMA3 IC_DMA (3) /* DMA controller channel 3 */
1278#define IC_DMA4 IC_DMA (4) /* DMA controller channel 4 */
1279#define IC_DMA5 IC_DMA (5) /* DMA controller channel 5 */
1280#define IC_OST(Nb) /* OS Timer match [0..3] */ \
1281 (0x04000000 << (Nb))
1282#define IC_OST0 IC_OST (0) /* OS Timer match 0 */
1283#define IC_OST1 IC_OST (1) /* OS Timer match 1 */
1284#define IC_OST2 IC_OST (2) /* OS Timer match 2 */
1285#define IC_OST3 IC_OST (3) /* OS Timer match 3 */
1286#define IC_RTC1Hz 0x40000000 /* RTC 1 Hz clock */
1287#define IC_RTCAlrm 0x80000000 /* RTC Alarm */
1288
1289#define ICLR_IRQ 0 /* Interrupt ReQuest */
1290#define ICLR_FIQ 1 /* Fast Interrupt reQuest */
1291
1292#define ICCR_DIM 0x00000001 /* Disable Idle-mode interrupt */
1293 /* Mask */
1294#define ICCR_IdleAllInt (ICCR_DIM*0) /* Idle-mode All Interrupt enable */
1295 /* (ICMR ignored) */
1296#define ICCR_IdleMskInt (ICCR_DIM*1) /* Idle-mode non-Masked Interrupt */
1297 /* enable (ICMR used) */
1298
1299
1300/*
1301 * Peripheral Pin Controller (PPC) control registers
1302 *
1303 * Registers
1304 * PPDR Peripheral Pin Controller (PPC) Pin Direction
1305 * Register (read/write).
1306 * PPSR Peripheral Pin Controller (PPC) Pin State Register
1307 * (read/write).
1308 * PPAR Peripheral Pin Controller (PPC) Pin Assignment
1309 * Register (read/write).
1310 * PSDR Peripheral Pin Controller (PPC) Sleep-mode pin
1311 * Direction Register (read/write).
1312 * PPFR Peripheral Pin Controller (PPC) Pin Flag Register
1313 * (read).
1314 */
1315
1316#define PPDR __REG(0x90060000) /* PPC Pin Direction Reg. */
1317#define PPSR __REG(0x90060004) /* PPC Pin State Reg. */
1318#define PPAR __REG(0x90060008) /* PPC Pin Assignment Reg. */
1319#define PSDR __REG(0x9006000C) /* PPC Sleep-mode pin Direction Reg. */
1320#define PPFR __REG(0x90060010) /* PPC Pin Flag Reg. */
1321
1322#define PPC_LDD(Nb) /* LCD Data [0..7] */ \
1323 (0x00000001 << (Nb))
1324#define PPC_LDD0 PPC_LDD (0) /* LCD Data [0] */
1325#define PPC_LDD1 PPC_LDD (1) /* LCD Data [1] */
1326#define PPC_LDD2 PPC_LDD (2) /* LCD Data [2] */
1327#define PPC_LDD3 PPC_LDD (3) /* LCD Data [3] */
1328#define PPC_LDD4 PPC_LDD (4) /* LCD Data [4] */
1329#define PPC_LDD5 PPC_LDD (5) /* LCD Data [5] */
1330#define PPC_LDD6 PPC_LDD (6) /* LCD Data [6] */
1331#define PPC_LDD7 PPC_LDD (7) /* LCD Data [7] */
1332#define PPC_L_PCLK 0x00000100 /* LCD Pixel CLocK */
1333#define PPC_L_LCLK 0x00000200 /* LCD Line CLocK */
1334#define PPC_L_FCLK 0x00000400 /* LCD Frame CLocK */
1335#define PPC_L_BIAS 0x00000800 /* LCD AC BIAS */
1336 /* ser. port 1: */
1337#define PPC_TXD1 0x00001000 /* SDLC/UART Transmit Data 1 */
1338#define PPC_RXD1 0x00002000 /* SDLC/UART Receive Data 1 */
1339 /* ser. port 2: */
1340#define PPC_TXD2 0x00004000 /* IPC Transmit Data 2 */
1341#define PPC_RXD2 0x00008000 /* IPC Receive Data 2 */
1342 /* ser. port 3: */
1343#define PPC_TXD3 0x00010000 /* UART Transmit Data 3 */
1344#define PPC_RXD3 0x00020000 /* UART Receive Data 3 */
1345 /* ser. port 4: */
1346#define PPC_TXD4 0x00040000 /* MCP/SSP Transmit Data 4 */
1347#define PPC_RXD4 0x00080000 /* MCP/SSP Receive Data 4 */
1348#define PPC_SCLK 0x00100000 /* MCP/SSP Sample CLocK */
1349#define PPC_SFRM 0x00200000 /* MCP/SSP Sample FRaMe */
1350
1351#define PPDR_In 0 /* Input */
1352#define PPDR_Out 1 /* Output */
1353
1354 /* ser. port 1: */
1355#define PPAR_UPR 0x00001000 /* UART Pin Reassignment */
1356#define PPAR_UARTTR (PPAR_UPR*0) /* UART on TXD_1 & RXD_1 */
1357#define PPAR_UARTGPIO (PPAR_UPR*1) /* UART on GPIO [14:15] */
1358 /* ser. port 4: */
1359#define PPAR_SPR 0x00040000 /* SSP Pin Reassignment */
1360#define PPAR_SSPTRSS (PPAR_SPR*0) /* SSP on TXD_C, RXD_C, SCLK_C, */
1361 /* & SFRM_C */
1362#define PPAR_SSPGPIO (PPAR_SPR*1) /* SSP on GPIO [10:13] */
1363
1364#define PSDR_OutL 0 /* Output Low in sleep mode */
1365#define PSDR_Flt 1 /* Floating (input) in sleep mode */
1366
1367#define PPFR_LCD 0x00000001 /* LCD controller */
1368#define PPFR_SP1TX 0x00001000 /* Ser. Port 1 SDLC/UART Transmit */
1369#define PPFR_SP1RX 0x00002000 /* Ser. Port 1 SDLC/UART Receive */
1370#define PPFR_SP2TX 0x00004000 /* Ser. Port 2 ICP Transmit */
1371#define PPFR_SP2RX 0x00008000 /* Ser. Port 2 ICP Receive */
1372#define PPFR_SP3TX 0x00010000 /* Ser. Port 3 UART Transmit */
1373#define PPFR_SP3RX 0x00020000 /* Ser. Port 3 UART Receive */
1374#define PPFR_SP4 0x00040000 /* Ser. Port 4 MCP/SSP */
1375#define PPFR_PerEn 0 /* Peripheral Enabled */
1376#define PPFR_PPCEn 1 /* PPC Enabled */
1377
1378
1379/*
1380 * Dynamic Random-Access Memory (DRAM) control registers
1381 *
1382 * Registers
1383 * MDCNFG Memory system: Dynamic Random-Access Memory (DRAM)
1384 * CoNFiGuration register (read/write).
1385 * MDCAS0 Memory system: Dynamic Random-Access Memory (DRAM)
1386 * Column Address Strobe (CAS) shift register 0
1387 * (read/write).
1388 * MDCAS1 Memory system: Dynamic Random-Access Memory (DRAM)
1389 * Column Address Strobe (CAS) shift register 1
1390 * (read/write).
1391 * MDCAS2 Memory system: Dynamic Random-Access Memory (DRAM)
1392 * Column Address Strobe (CAS) shift register 2
1393 * (read/write).
1394 *
1395 * Clocks
1396 * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
1397 * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
1398 * fcas, Tcas Frequency, period of the DRAM CAS shift registers.
1399 */
1400
1401#define MDCNFG __REG(0xA0000000) /* DRAM CoNFiGuration reg. */
1402#define MDCAS0 __REG(0xA0000004) /* DRAM CAS shift reg. 0 */
1403#define MDCAS1 __REG(0xA0000008) /* DRAM CAS shift reg. 1 */
1404#define MDCAS2 __REG(0xA000000c) /* DRAM CAS shift reg. 2 */
1405
1406/* SA1100 MDCNFG values */
1407#define MDCNFG_DE(Nb) /* DRAM Enable bank [0..3] */ \
1408 (0x00000001 << (Nb))
1409#define MDCNFG_DE0 MDCNFG_DE (0) /* DRAM Enable bank 0 */
1410#define MDCNFG_DE1 MDCNFG_DE (1) /* DRAM Enable bank 1 */
1411#define MDCNFG_DE2 MDCNFG_DE (2) /* DRAM Enable bank 2 */
1412#define MDCNFG_DE3 MDCNFG_DE (3) /* DRAM Enable bank 3 */
1413#define MDCNFG_DRAC Fld (2, 4) /* DRAM Row Address Count - 9 */
1414#define MDCNFG_RowAdd(Add) /* Row Address count [9..12] */ \
1415 (((Add) - 9) << FShft (MDCNFG_DRAC))
1416#define MDCNFG_CDB2 0x00000040 /* shift reg. Clock Divide By 2 */
1417 /* (fcas = fcpu/2) */
1418#define MDCNFG_TRP Fld (4, 7) /* Time RAS Pre-charge - 1 [Tmem] */
1419#define MDCNFG_PrChrg(Tcpu) /* Pre-Charge time [2..32 Tcpu] */ \
1420 (((Tcpu) - 2)/2 << FShft (MDCNFG_TRP))
1421#define MDCNFG_CeilPrChrg(Tcpu) /* Ceil. of PrChrg [2..32 Tcpu] */ \
1422 (((Tcpu) - 1)/2 << FShft (MDCNFG_TRP))
1423#define MDCNFG_TRASR Fld (4, 11) /* Time RAS Refresh - 1 [Tmem] */
1424#define MDCNFG_Ref(Tcpu) /* Refresh time [2..32 Tcpu] */ \
1425 (((Tcpu) - 2)/2 << FShft (MDCNFG_TRASR))
1426#define MDCNFG_CeilRef(Tcpu) /* Ceil. of Ref [2..32 Tcpu] */ \
1427 (((Tcpu) - 1)/2 << FShft (MDCNFG_TRASR))
1428#define MDCNFG_TDL Fld (2, 15) /* Time Data Latch [Tcpu] */
1429#define MDCNFG_DataLtch(Tcpu) /* Data Latch delay [0..3 Tcpu] */ \
1430 ((Tcpu) << FShft (MDCNFG_TDL))
1431#define MDCNFG_DRI Fld (15, 17) /* min. DRAM Refresh Interval/4 */
1432 /* [Tmem] */
1433#define MDCNFG_RefInt(Tcpu) /* min. Refresh Interval */ \
1434 /* [0..262136 Tcpu] */ \
1435 ((Tcpu)/8 << FShft (MDCNFG_DRI))
1436
1437/* SA1110 MDCNFG values */
1438#define MDCNFG_SA1110_DE0 0x00000001 /* DRAM Enable bank 0 */
1439#define MDCNFG_SA1110_DE1 0x00000002 /* DRAM Enable bank 1 */
1440#define MDCNFG_SA1110_DTIM0 0x00000004 /* DRAM timing type 0/1 */
1441#define MDCNFG_SA1110_DWID0 0x00000008 /* DRAM bus width 0/1 */
1442#define MDCNFG_SA1110_DRAC0 Fld(3, 4) /* DRAM row addr bit count */
1443 /* bank 0/1 */
1444#define MDCNFG_SA1110_CDB20 0x00000080 /* Mem Clock divide by 2 0/1 */
1445#define MDCNFG_SA1110_TRP0 Fld(3, 8) /* RAS precharge 0/1 */
1446#define MDCNFG_SA1110_TDL0 Fld(2, 12) /* Data input latch after CAS*/
1447 /* deassertion 0/1 */
1448#define MDCNFG_SA1110_TWR0 Fld(2, 14) /* SDRAM write recovery 0/1 */
1449#define MDCNFG_SA1110_DE2 0x00010000 /* DRAM Enable bank 0 */
1450#define MDCNFG_SA1110_DE3 0x00020000 /* DRAM Enable bank 1 */
1451#define MDCNFG_SA1110_DTIM2 0x00040000 /* DRAM timing type 0/1 */
1452#define MDCNFG_SA1110_DWID2 0x00080000 /* DRAM bus width 0/1 */
1453#define MDCNFG_SA1110_DRAC2 Fld(3, 20) /* DRAM row addr bit count */
1454 /* bank 0/1 */
1455#define MDCNFG_SA1110_CDB22 0x00800000 /* Mem Clock divide by 2 0/1 */
1456#define MDCNFG_SA1110_TRP2 Fld(3, 24) /* RAS precharge 0/1 */
1457#define MDCNFG_SA1110_TDL2 Fld(2, 28) /* Data input latch after CAS*/
1458 /* deassertion 0/1 */
1459#define MDCNFG_SA1110_TWR2 Fld(2, 30) /* SDRAM write recovery 0/1 */
1460
1461
1462/*
1463 * Static memory control registers
1464 *
1465 * Registers
1466 * MSC0 Memory system: Static memory Control register 0
1467 * (read/write).
1468 * MSC1 Memory system: Static memory Control register 1
1469 * (read/write).
1470 *
1471 * Clocks
1472 * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
1473 * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
1474 */
1475
1476#define MSC0 __REG(0xa0000010) /* Static memory Control reg. 0 */
1477#define MSC1 __REG(0xa0000014) /* Static memory Control reg. 1 */
1478#define MSC2 __REG(0xa000002c) /* Static memory Control reg. 2, not contiguous */
1479
1480#define MSC_Bnk(Nb) /* static memory Bank [0..3] */ \
1481 Fld (16, ((Nb) Modulo 2)*16)
1482#define MSC0_Bnk0 MSC_Bnk (0) /* static memory Bank 0 */
1483#define MSC0_Bnk1 MSC_Bnk (1) /* static memory Bank 1 */
1484#define MSC1_Bnk2 MSC_Bnk (2) /* static memory Bank 2 */
1485#define MSC1_Bnk3 MSC_Bnk (3) /* static memory Bank 3 */
1486
1487#define MSC_RT Fld (2, 0) /* ROM/static memory Type */
1488#define MSC_NonBrst /* Non-Burst static memory */ \
1489 (0 << FShft (MSC_RT))
1490#define MSC_SRAM /* 32-bit byte-writable SRAM */ \
1491 (1 << FShft (MSC_RT))
1492#define MSC_Brst4 /* Burst-of-4 static memory */ \
1493 (2 << FShft (MSC_RT))
1494#define MSC_Brst8 /* Burst-of-8 static memory */ \
1495 (3 << FShft (MSC_RT))
1496#define MSC_RBW 0x0004 /* ROM/static memory Bus Width */
1497#define MSC_32BitStMem (MSC_RBW*0) /* 32-Bit Static Memory */
1498#define MSC_16BitStMem (MSC_RBW*1) /* 16-Bit Static Memory */
1499#define MSC_RDF Fld (5, 3) /* ROM/static memory read Delay */
1500 /* First access - 1(.5) [Tmem] */
1501#define MSC_1stRdAcc(Tcpu) /* 1st Read Access time (burst */ \
1502 /* static memory) [3..65 Tcpu] */ \
1503 ((((Tcpu) - 3)/2) << FShft (MSC_RDF))
1504#define MSC_Ceil1stRdAcc(Tcpu) /* Ceil. of 1stRdAcc [3..65 Tcpu] */ \
1505 ((((Tcpu) - 2)/2) << FShft (MSC_RDF))
1506#define MSC_RdAcc(Tcpu) /* Read Access time (non-burst */ \
1507 /* static memory) [2..64 Tcpu] */ \
1508 ((((Tcpu) - 2)/2) << FShft (MSC_RDF))
1509#define MSC_CeilRdAcc(Tcpu) /* Ceil. of RdAcc [2..64 Tcpu] */ \
1510 ((((Tcpu) - 1)/2) << FShft (MSC_RDF))
1511#define MSC_RDN Fld (5, 8) /* ROM/static memory read Delay */
1512 /* Next access - 1 [Tmem] */
1513#define MSC_NxtRdAcc(Tcpu) /* Next Read Access time (burst */ \
1514 /* static memory) [2..64 Tcpu] */ \
1515 ((((Tcpu) - 2)/2) << FShft (MSC_RDN))
1516#define MSC_CeilNxtRdAcc(Tcpu) /* Ceil. of NxtRdAcc [2..64 Tcpu] */ \
1517 ((((Tcpu) - 1)/2) << FShft (MSC_RDN))
1518#define MSC_WrAcc(Tcpu) /* Write Access time (non-burst */ \
1519 /* static memory) [2..64 Tcpu] */ \
1520 ((((Tcpu) - 2)/2) << FShft (MSC_RDN))
1521#define MSC_CeilWrAcc(Tcpu) /* Ceil. of WrAcc [2..64 Tcpu] */ \
1522 ((((Tcpu) - 1)/2) << FShft (MSC_RDN))
1523#define MSC_RRR Fld (3, 13) /* ROM/static memory RecoveRy */
1524 /* time/2 [Tmem] */
1525#define MSC_Rec(Tcpu) /* Recovery time [0..28 Tcpu] */ \
1526 (((Tcpu)/4) << FShft (MSC_RRR))
1527#define MSC_CeilRec(Tcpu) /* Ceil. of Rec [0..28 Tcpu] */ \
1528 ((((Tcpu) + 3)/4) << FShft (MSC_RRR))
1529
1530
1531/*
1532 * Personal Computer Memory Card International Association (PCMCIA) control
1533 * register
1534 *
1535 * Register
1536 * MECR Memory system: Expansion memory bus (PCMCIA)
1537 * Configuration Register (read/write).
1538 *
1539 * Clocks
1540 * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
1541 * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
1542 * fbclk, Tbclk Frequency, period of the PCMCIA clock (BCLK).
1543 */
1544
1545 /* Memory system: */
1546#define MECR __REG(0xA0000018) /* Expansion memory bus (PCMCIA) Configuration Reg. */
1547
1548#define MECR_PCMCIA(Nb) /* PCMCIA [0..1] */ \
1549 Fld (15, (Nb)*16)
1550#define MECR_PCMCIA0 MECR_PCMCIA (0) /* PCMCIA 0 */
1551#define MECR_PCMCIA1 MECR_PCMCIA (1) /* PCMCIA 1 */
1552
1553#define MECR_BSIO Fld (5, 0) /* BCLK Select I/O - 1 [Tmem] */
1554#define MECR_IOClk(Tcpu) /* I/O Clock [2..64 Tcpu] */ \
1555 ((((Tcpu) - 2)/2) << FShft (MECR_BSIO))
1556#define MECR_CeilIOClk(Tcpu) /* Ceil. of IOClk [2..64 Tcpu] */ \
1557 ((((Tcpu) - 1)/2) << FShft (MECR_BSIO))
1558#define MECR_BSA Fld (5, 5) /* BCLK Select Attribute - 1 */
1559 /* [Tmem] */
1560#define MECR_AttrClk(Tcpu) /* Attribute Clock [2..64 Tcpu] */ \
1561 ((((Tcpu) - 2)/2) << FShft (MECR_BSA))
1562#define MECR_CeilAttrClk(Tcpu) /* Ceil. of AttrClk [2..64 Tcpu] */ \
1563 ((((Tcpu) - 1)/2) << FShft (MECR_BSA))
1564#define MECR_BSM Fld (5, 10) /* BCLK Select Memory - 1 [Tmem] */
1565#define MECR_MemClk(Tcpu) /* Memory Clock [2..64 Tcpu] */ \
1566 ((((Tcpu) - 2)/2) << FShft (MECR_BSM))
1567#define MECR_CeilMemClk(Tcpu) /* Ceil. of MemClk [2..64 Tcpu] */ \
1568 ((((Tcpu) - 1)/2) << FShft (MECR_BSM))
1569
1570/*
1571 * On SA1110 only
1572 */
1573
1574#define MDREFR __REG(0xA000001C)
1575
1576#define MDREFR_TRASR Fld (4, 0)
1577#define MDREFR_DRI Fld (12, 4)
1578#define MDREFR_E0PIN (1 << 16)
1579#define MDREFR_K0RUN (1 << 17)
1580#define MDREFR_K0DB2 (1 << 18)
1581#define MDREFR_E1PIN (1 << 20)
1582#define MDREFR_K1RUN (1 << 21)
1583#define MDREFR_K1DB2 (1 << 22)
1584#define MDREFR_K2RUN (1 << 25)
1585#define MDREFR_K2DB2 (1 << 26)
1586#define MDREFR_EAPD (1 << 28)
1587#define MDREFR_KAPD (1 << 29)
1588#define MDREFR_SLFRSH (1 << 31)
1589
1590
1591/*
1592 * Direct Memory Access (DMA) control registers
1593 *
1594 * Registers
1595 * DDAR0 Direct Memory Access (DMA) Device Address Register
1596 * channel 0 (read/write).
1597 * DCSR0 Direct Memory Access (DMA) Control and Status
1598 * Register channel 0 (read/write).
1599 * DBSA0 Direct Memory Access (DMA) Buffer Start address
1600 * register A channel 0 (read/write).
1601 * DBTA0 Direct Memory Access (DMA) Buffer Transfer count
1602 * register A channel 0 (read/write).
1603 * DBSB0 Direct Memory Access (DMA) Buffer Start address
1604 * register B channel 0 (read/write).
1605 * DBTB0 Direct Memory Access (DMA) Buffer Transfer count
1606 * register B channel 0 (read/write).
1607 *
1608 * DDAR1 Direct Memory Access (DMA) Device Address Register
1609 * channel 1 (read/write).
1610 * DCSR1 Direct Memory Access (DMA) Control and Status
1611 * Register channel 1 (read/write).
1612 * DBSA1 Direct Memory Access (DMA) Buffer Start address
1613 * register A channel 1 (read/write).
1614 * DBTA1 Direct Memory Access (DMA) Buffer Transfer count
1615 * register A channel 1 (read/write).
1616 * DBSB1 Direct Memory Access (DMA) Buffer Start address
1617 * register B channel 1 (read/write).
1618 * DBTB1 Direct Memory Access (DMA) Buffer Transfer count
1619 * register B channel 1 (read/write).
1620 *
1621 * DDAR2 Direct Memory Access (DMA) Device Address Register
1622 * channel 2 (read/write).
1623 * DCSR2 Direct Memory Access (DMA) Control and Status
1624 * Register channel 2 (read/write).
1625 * DBSA2 Direct Memory Access (DMA) Buffer Start address
1626 * register A channel 2 (read/write).
1627 * DBTA2 Direct Memory Access (DMA) Buffer Transfer count
1628 * register A channel 2 (read/write).
1629 * DBSB2 Direct Memory Access (DMA) Buffer Start address
1630 * register B channel 2 (read/write).
1631 * DBTB2 Direct Memory Access (DMA) Buffer Transfer count
1632 * register B channel 2 (read/write).
1633 *
1634 * DDAR3 Direct Memory Access (DMA) Device Address Register
1635 * channel 3 (read/write).
1636 * DCSR3 Direct Memory Access (DMA) Control and Status
1637 * Register channel 3 (read/write).
1638 * DBSA3 Direct Memory Access (DMA) Buffer Start address
1639 * register A channel 3 (read/write).
1640 * DBTA3 Direct Memory Access (DMA) Buffer Transfer count
1641 * register A channel 3 (read/write).
1642 * DBSB3 Direct Memory Access (DMA) Buffer Start address
1643 * register B channel 3 (read/write).
1644 * DBTB3 Direct Memory Access (DMA) Buffer Transfer count
1645 * register B channel 3 (read/write).
1646 *
1647 * DDAR4 Direct Memory Access (DMA) Device Address Register
1648 * channel 4 (read/write).
1649 * DCSR4 Direct Memory Access (DMA) Control and Status
1650 * Register channel 4 (read/write).
1651 * DBSA4 Direct Memory Access (DMA) Buffer Start address
1652 * register A channel 4 (read/write).
1653 * DBTA4 Direct Memory Access (DMA) Buffer Transfer count
1654 * register A channel 4 (read/write).
1655 * DBSB4 Direct Memory Access (DMA) Buffer Start address
1656 * register B channel 4 (read/write).
1657 * DBTB4 Direct Memory Access (DMA) Buffer Transfer count
1658 * register B channel 4 (read/write).
1659 *
1660 * DDAR5 Direct Memory Access (DMA) Device Address Register
1661 * channel 5 (read/write).
1662 * DCSR5 Direct Memory Access (DMA) Control and Status
1663 * Register channel 5 (read/write).
1664 * DBSA5 Direct Memory Access (DMA) Buffer Start address
1665 * register A channel 5 (read/write).
1666 * DBTA5 Direct Memory Access (DMA) Buffer Transfer count
1667 * register A channel 5 (read/write).
1668 * DBSB5 Direct Memory Access (DMA) Buffer Start address
1669 * register B channel 5 (read/write).
1670 * DBTB5 Direct Memory Access (DMA) Buffer Transfer count
1671 * register B channel 5 (read/write).
1672 */
1673
1674#define DMASp 0x00000020 /* DMA control reg. Space [byte] */
1675
1676#define DDAR(Nb) __REG(0xB0000000 + (Nb)*DMASp) /* DMA Device Address Reg. channel [0..5] */
1677#define SetDCSR(Nb) __REG(0xB0000004 + (Nb)*DMASp) /* Set DMA Control & Status Reg. channel [0..5] (write) */
1678#define ClrDCSR(Nb) __REG(0xB0000008 + (Nb)*DMASp) /* Clear DMA Control & Status Reg. channel [0..5] (write) */
1679#define RdDCSR(Nb) __REG(0xB000000C + (Nb)*DMASp) /* Read DMA Control & Status Reg. channel [0..5] (read) */
1680#define DBSA(Nb) __REG(0xB0000010 + (Nb)*DMASp) /* DMA Buffer Start address reg. A channel [0..5] */
1681#define DBTA(Nb) __REG(0xB0000014 + (Nb)*DMASp) /* DMA Buffer Transfer count reg. A channel [0..5] */
1682#define DBSB(Nb) __REG(0xB0000018 + (Nb)*DMASp) /* DMA Buffer Start address reg. B channel [0..5] */
1683#define DBTB(Nb) __REG(0xB000001C + (Nb)*DMASp) /* DMA Buffer Transfer count reg. B channel [0..5] */
1684
1685#define DDAR_RW 0x00000001 /* device data Read/Write */
1686#define DDAR_DevWr (DDAR_RW*0) /* Device data Write */
1687 /* (memory -> device) */
1688#define DDAR_DevRd (DDAR_RW*1) /* Device data Read */
1689 /* (device -> memory) */
1690#define DDAR_E 0x00000002 /* big/little Endian device */
1691#define DDAR_LtlEnd (DDAR_E*0) /* Little Endian device */
1692#define DDAR_BigEnd (DDAR_E*1) /* Big Endian device */
1693#define DDAR_BS 0x00000004 /* device Burst Size */
1694#define DDAR_Brst4 (DDAR_BS*0) /* Burst-of-4 device */
1695#define DDAR_Brst8 (DDAR_BS*1) /* Burst-of-8 device */
1696#define DDAR_DW 0x00000008 /* device Data Width */
1697#define DDAR_8BitDev (DDAR_DW*0) /* 8-Bit Device */
1698#define DDAR_16BitDev (DDAR_DW*1) /* 16-Bit Device */
1699#define DDAR_DS Fld (4, 4) /* Device Select */
1700#define DDAR_Ser0UDCTr /* Ser. port 0 UDC Transmit */ \
1701 (0x0 << FShft (DDAR_DS))
1702#define DDAR_Ser0UDCRc /* Ser. port 0 UDC Receive */ \
1703 (0x1 << FShft (DDAR_DS))
1704#define DDAR_Ser1SDLCTr /* Ser. port 1 SDLC Transmit */ \
1705 (0x2 << FShft (DDAR_DS))
1706#define DDAR_Ser1SDLCRc /* Ser. port 1 SDLC Receive */ \
1707 (0x3 << FShft (DDAR_DS))
1708#define DDAR_Ser1UARTTr /* Ser. port 1 UART Transmit */ \
1709 (0x4 << FShft (DDAR_DS))
1710#define DDAR_Ser1UARTRc /* Ser. port 1 UART Receive */ \
1711 (0x5 << FShft (DDAR_DS))
1712#define DDAR_Ser2ICPTr /* Ser. port 2 ICP Transmit */ \
1713 (0x6 << FShft (DDAR_DS))
1714#define DDAR_Ser2ICPRc /* Ser. port 2 ICP Receive */ \
1715 (0x7 << FShft (DDAR_DS))
1716#define DDAR_Ser3UARTTr /* Ser. port 3 UART Transmit */ \
1717 (0x8 << FShft (DDAR_DS))
1718#define DDAR_Ser3UARTRc /* Ser. port 3 UART Receive */ \
1719 (0x9 << FShft (DDAR_DS))
1720#define DDAR_Ser4MCP0Tr /* Ser. port 4 MCP 0 Transmit */ \
1721 /* (audio) */ \
1722 (0xA << FShft (DDAR_DS))
1723#define DDAR_Ser4MCP0Rc /* Ser. port 4 MCP 0 Receive */ \
1724 /* (audio) */ \
1725 (0xB << FShft (DDAR_DS))
1726#define DDAR_Ser4MCP1Tr /* Ser. port 4 MCP 1 Transmit */ \
1727 /* (telecom) */ \
1728 (0xC << FShft (DDAR_DS))
1729#define DDAR_Ser4MCP1Rc /* Ser. port 4 MCP 1 Receive */ \
1730 /* (telecom) */ \
1731 (0xD << FShft (DDAR_DS))
1732#define DDAR_Ser4SSPTr /* Ser. port 4 SSP Transmit */ \
1733 (0xE << FShft (DDAR_DS))
1734#define DDAR_Ser4SSPRc /* Ser. port 4 SSP Receive */ \
1735 (0xF << FShft (DDAR_DS))
1736#define DDAR_DA Fld (24, 8) /* Device Address */
1737#define DDAR_DevAdd(Add) /* Device Address */ \
1738 (((Add) & 0xF0000000) | \
1739 (((Add) & 0X003FFFFC) << (FShft (DDAR_DA) - 2)))
1740#define DDAR_Ser0UDCWr /* Ser. port 0 UDC Write */ \
1741 (DDAR_DevWr + DDAR_Brst8 + DDAR_8BitDev + \
1742 DDAR_Ser0UDCTr + DDAR_DevAdd (__PREG(Ser0UDCDR)))
1743#define DDAR_Ser0UDCRd /* Ser. port 0 UDC Read */ \
1744 (DDAR_DevRd + DDAR_Brst8 + DDAR_8BitDev + \
1745 DDAR_Ser0UDCRc + DDAR_DevAdd (__PREG(Ser0UDCDR)))
1746#define DDAR_Ser1UARTWr /* Ser. port 1 UART Write */ \
1747 (DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev + \
1748 DDAR_Ser1UARTTr + DDAR_DevAdd (__PREG(Ser1UTDR)))
1749#define DDAR_Ser1UARTRd /* Ser. port 1 UART Read */ \
1750 (DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev + \
1751 DDAR_Ser1UARTRc + DDAR_DevAdd (__PREG(Ser1UTDR)))
1752#define DDAR_Ser1SDLCWr /* Ser. port 1 SDLC Write */ \
1753 (DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev + \
1754 DDAR_Ser1SDLCTr + DDAR_DevAdd (__PREG(Ser1SDDR)))
1755#define DDAR_Ser1SDLCRd /* Ser. port 1 SDLC Read */ \
1756 (DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev + \
1757 DDAR_Ser1SDLCRc + DDAR_DevAdd (__PREG(Ser1SDDR)))
1758#define DDAR_Ser2UARTWr /* Ser. port 2 UART Write */ \
1759 (DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev + \
1760 DDAR_Ser2ICPTr + DDAR_DevAdd (__PREG(Ser2UTDR)))
1761#define DDAR_Ser2UARTRd /* Ser. port 2 UART Read */ \
1762 (DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev + \
1763 DDAR_Ser2ICPRc + DDAR_DevAdd (__PREG(Ser2UTDR)))
1764#define DDAR_Ser2HSSPWr /* Ser. port 2 HSSP Write */ \
1765 (DDAR_DevWr + DDAR_Brst8 + DDAR_8BitDev + \
1766 DDAR_Ser2ICPTr + DDAR_DevAdd (__PREG(Ser2HSDR)))
1767#define DDAR_Ser2HSSPRd /* Ser. port 2 HSSP Read */ \
1768 (DDAR_DevRd + DDAR_Brst8 + DDAR_8BitDev + \
1769 DDAR_Ser2ICPRc + DDAR_DevAdd (__PREG(Ser2HSDR)))
1770#define DDAR_Ser3UARTWr /* Ser. port 3 UART Write */ \
1771 (DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev + \
1772 DDAR_Ser3UARTTr + DDAR_DevAdd (__PREG(Ser3UTDR)))
1773#define DDAR_Ser3UARTRd /* Ser. port 3 UART Read */ \
1774 (DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev + \
1775 DDAR_Ser3UARTRc + DDAR_DevAdd (__PREG(Ser3UTDR)))
1776#define DDAR_Ser4MCP0Wr /* Ser. port 4 MCP 0 Write (audio) */ \
1777 (DDAR_DevWr + DDAR_Brst4 + DDAR_16BitDev + \
1778 DDAR_Ser4MCP0Tr + DDAR_DevAdd (__PREG(Ser4MCDR0)))
1779#define DDAR_Ser4MCP0Rd /* Ser. port 4 MCP 0 Read (audio) */ \
1780 (DDAR_DevRd + DDAR_Brst4 + DDAR_16BitDev + \
1781 DDAR_Ser4MCP0Rc + DDAR_DevAdd (__PREG(Ser4MCDR0)))
1782#define DDAR_Ser4MCP1Wr /* Ser. port 4 MCP 1 Write */ \
1783 /* (telecom) */ \
1784 (DDAR_DevWr + DDAR_Brst4 + DDAR_16BitDev + \
1785 DDAR_Ser4MCP1Tr + DDAR_DevAdd (__PREG(Ser4MCDR1)))
1786#define DDAR_Ser4MCP1Rd /* Ser. port 4 MCP 1 Read */ \
1787 /* (telecom) */ \
1788 (DDAR_DevRd + DDAR_Brst4 + DDAR_16BitDev + \
1789 DDAR_Ser4MCP1Rc + DDAR_DevAdd (__PREG(Ser4MCDR1)))
1790#define DDAR_Ser4SSPWr /* Ser. port 4 SSP Write (16 bits) */ \
1791 (DDAR_DevWr + DDAR_Brst4 + DDAR_16BitDev + \
1792 DDAR_Ser4SSPTr + DDAR_DevAdd (__PREG(Ser4SSDR)))
1793#define DDAR_Ser4SSPRd /* Ser. port 4 SSP Read (16 bits) */ \
1794 (DDAR_DevRd + DDAR_Brst4 + DDAR_16BitDev + \
1795 DDAR_Ser4SSPRc + DDAR_DevAdd (__PREG(Ser4SSDR)))
1796
1797#define DCSR_RUN 0x00000001 /* DMA RUNing */
1798#define DCSR_IE 0x00000002 /* DMA Interrupt Enable */
1799#define DCSR_ERROR 0x00000004 /* DMA ERROR */
1800#define DCSR_DONEA 0x00000008 /* DONE DMA transfer buffer A */
1801#define DCSR_STRTA 0x00000010 /* STaRTed DMA transfer buffer A */
1802#define DCSR_DONEB 0x00000020 /* DONE DMA transfer buffer B */
1803#define DCSR_STRTB 0x00000040 /* STaRTed DMA transfer buffer B */
1804#define DCSR_BIU 0x00000080 /* DMA Buffer In Use */
1805#define DCSR_BufA (DCSR_BIU*0) /* DMA Buffer A in use */
1806#define DCSR_BufB (DCSR_BIU*1) /* DMA Buffer B in use */
1807
1808#define DBT_TC Fld (13, 0) /* Transfer Count */
1809#define DBTA_TCA DBT_TC /* Transfer Count buffer A */
1810#define DBTB_TCB DBT_TC /* Transfer Count buffer B */
1811
1812
1813/*
1814 * Liquid Crystal Display (LCD) control registers
1815 *
1816 * Registers
1817 * LCCR0 Liquid Crystal Display (LCD) Control Register 0
1818 * (read/write).
1819 * [Bits LDM, BAM, and ERM are only implemented in
1820 * versions 2.0 (rev. = 8) and higher of the StrongARM
1821 * SA-1100.]
1822 * LCSR Liquid Crystal Display (LCD) Status Register
1823 * (read/write).
1824 * [Bit LDD can be only read in versions 1.0 (rev. = 1)
1825 * and 1.1 (rev. = 2) of the StrongARM SA-1100, it can be
1826 * read and written (cleared) in versions 2.0 (rev. = 8)
1827 * and higher.]
1828 * DBAR1 Liquid Crystal Display (LCD) Direct Memory Access
1829 * (DMA) Base Address Register channel 1 (read/write).
1830 * DCAR1 Liquid Crystal Display (LCD) Direct Memory Access
1831 * (DMA) Current Address Register channel 1 (read).
1832 * DBAR2 Liquid Crystal Display (LCD) Direct Memory Access
1833 * (DMA) Base Address Register channel 2 (read/write).
1834 * DCAR2 Liquid Crystal Display (LCD) Direct Memory Access
1835 * (DMA) Current Address Register channel 2 (read).
1836 * LCCR1 Liquid Crystal Display (LCD) Control Register 1
1837 * (read/write).
1838 * [The LCCR1 register can be only written in
1839 * versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
1840 * StrongARM SA-1100, it can be written and read in
1841 * versions 2.0 (rev. = 8) and higher.]
1842 * LCCR2 Liquid Crystal Display (LCD) Control Register 2
1843 * (read/write).
1844 * [The LCCR1 register can be only written in
1845 * versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
1846 * StrongARM SA-1100, it can be written and read in
1847 * versions 2.0 (rev. = 8) and higher.]
1848 * LCCR3 Liquid Crystal Display (LCD) Control Register 3
1849 * (read/write).
1850 * [The LCCR1 register can be only written in
1851 * versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
1852 * StrongARM SA-1100, it can be written and read in
1853 * versions 2.0 (rev. = 8) and higher. Bit PCP is only
1854 * implemented in versions 2.0 (rev. = 8) and higher of
1855 * the StrongARM SA-1100.]
1856 *
1857 * Clocks
1858 * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
1859 * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
1860 * fpix, Tpix Frequency, period of the pixel clock.
1861 * fln, Tln Frequency, period of the line clock.
1862 * fac, Tac Frequency, period of the AC bias clock.
1863 */
1864
1865#define LCD_PEntrySp 2 /* LCD Palette Entry Space [byte] */
1866#define LCD_4BitPSp /* LCD 4-Bit pixel Palette Space */ \
1867 /* [byte] */ \
1868 (16*LCD_PEntrySp)
1869#define LCD_8BitPSp /* LCD 8-Bit pixel Palette Space */ \
1870 /* [byte] */ \
1871 (256*LCD_PEntrySp)
1872#define LCD_12_16BitPSp /* LCD 12/16-Bit pixel */ \
1873 /* dummy-Palette Space [byte] */ \
1874 (16*LCD_PEntrySp)
1875
1876#define LCD_PGrey Fld (4, 0) /* LCD Palette entry Grey value */
1877#define LCD_PBlue Fld (4, 0) /* LCD Palette entry Blue value */
1878#define LCD_PGreen Fld (4, 4) /* LCD Palette entry Green value */
1879#define LCD_PRed Fld (4, 8) /* LCD Palette entry Red value */
1880#define LCD_PBS Fld (2, 12) /* LCD Pixel Bit Size */
1881#define LCD_4Bit /* LCD 4-Bit pixel mode */ \
1882 (0 << FShft (LCD_PBS))
1883#define LCD_8Bit /* LCD 8-Bit pixel mode */ \
1884 (1 << FShft (LCD_PBS))
1885#define LCD_12_16Bit /* LCD 12/16-Bit pixel mode */ \
1886 (2 << FShft (LCD_PBS))
1887
1888#define LCD_Int0_0 0x0 /* LCD Intensity = 0.0% = 0 */
1889#define LCD_Int11_1 0x1 /* LCD Intensity = 11.1% = 1/9 */
1890#define LCD_Int20_0 0x2 /* LCD Intensity = 20.0% = 1/5 */
1891#define LCD_Int26_7 0x3 /* LCD Intensity = 26.7% = 4/15 */
1892#define LCD_Int33_3 0x4 /* LCD Intensity = 33.3% = 3/9 */
1893#define LCD_Int40_0 0x5 /* LCD Intensity = 40.0% = 2/5 */
1894#define LCD_Int44_4 0x6 /* LCD Intensity = 44.4% = 4/9 */
1895#define LCD_Int50_0 0x7 /* LCD Intensity = 50.0% = 1/2 */
1896#define LCD_Int55_6 0x8 /* LCD Intensity = 55.6% = 5/9 */
1897#define LCD_Int60_0 0x9 /* LCD Intensity = 60.0% = 3/5 */
1898#define LCD_Int66_7 0xA /* LCD Intensity = 66.7% = 6/9 */
1899#define LCD_Int73_3 0xB /* LCD Intensity = 73.3% = 11/15 */
1900#define LCD_Int80_0 0xC /* LCD Intensity = 80.0% = 4/5 */
1901#define LCD_Int88_9 0xD /* LCD Intensity = 88.9% = 8/9 */
1902#define LCD_Int100_0 0xE /* LCD Intensity = 100.0% = 1 */
1903#define LCD_Int100_0A 0xF /* LCD Intensity = 100.0% = 1 */
1904 /* (Alternative) */
1905
1906#define LCCR0 __REG(0xB0100000) /* LCD Control Reg. 0 */
1907#define LCSR __REG(0xB0100004) /* LCD Status Reg. */
1908#define DBAR1 __REG(0xB0100010) /* LCD DMA Base Address Reg. channel 1 */
1909#define DCAR1 __REG(0xB0100014) /* LCD DMA Current Address Reg. channel 1 */
1910#define DBAR2 __REG(0xB0100018) /* LCD DMA Base Address Reg. channel 2 */
1911#define DCAR2 __REG(0xB010001C) /* LCD DMA Current Address Reg. channel 2 */
1912#define LCCR1 __REG(0xB0100020) /* LCD Control Reg. 1 */
1913#define LCCR2 __REG(0xB0100024) /* LCD Control Reg. 2 */
1914#define LCCR3 __REG(0xB0100028) /* LCD Control Reg. 3 */
1915
1916#define LCCR0_LEN 0x00000001 /* LCD ENable */
1917#define LCCR0_CMS 0x00000002 /* Color/Monochrome display Select */
1918#define LCCR0_Color (LCCR0_CMS*0) /* Color display */
1919#define LCCR0_Mono (LCCR0_CMS*1) /* Monochrome display */
1920#define LCCR0_SDS 0x00000004 /* Single/Dual panel display */
1921 /* Select */
1922#define LCCR0_Sngl (LCCR0_SDS*0) /* Single panel display */
1923#define LCCR0_Dual (LCCR0_SDS*1) /* Dual panel display */
1924#define LCCR0_LDM 0x00000008 /* LCD Disable done (LDD) */
1925 /* interrupt Mask (disable) */
1926#define LCCR0_BAM 0x00000010 /* Base Address update (BAU) */
1927 /* interrupt Mask (disable) */
1928#define LCCR0_ERM 0x00000020 /* LCD ERror (BER, IOL, IUL, IOU, */
1929 /* IUU, OOL, OUL, OOU, and OUU) */
1930 /* interrupt Mask (disable) */
1931#define LCCR0_PAS 0x00000080 /* Passive/Active display Select */
1932#define LCCR0_Pas (LCCR0_PAS*0) /* Passive display (STN) */
1933#define LCCR0_Act (LCCR0_PAS*1) /* Active display (TFT) */
1934#define LCCR0_BLE 0x00000100 /* Big/Little Endian select */
1935#define LCCR0_LtlEnd (LCCR0_BLE*0) /* Little Endian frame buffer */
1936#define LCCR0_BigEnd (LCCR0_BLE*1) /* Big Endian frame buffer */
1937#define LCCR0_DPD 0x00000200 /* Double Pixel Data (monochrome */
1938 /* display mode) */
1939#define LCCR0_4PixMono (LCCR0_DPD*0) /* 4-Pixel/clock Monochrome */
1940 /* display */
1941#define LCCR0_8PixMono (LCCR0_DPD*1) /* 8-Pixel/clock Monochrome */
1942 /* display */
1943#define LCCR0_PDD Fld (8, 12) /* Palette DMA request Delay */
1944 /* [Tmem] */
1945#define LCCR0_DMADel(Tcpu) /* palette DMA request Delay */ \
1946 /* [0..510 Tcpu] */ \
1947 ((Tcpu)/2 << FShft (LCCR0_PDD))
1948
1949#define LCSR_LDD 0x00000001 /* LCD Disable Done */
1950#define LCSR_BAU 0x00000002 /* Base Address Update (read) */
1951#define LCSR_BER 0x00000004 /* Bus ERror */
1952#define LCSR_ABC 0x00000008 /* AC Bias clock Count */
1953#define LCSR_IOL 0x00000010 /* Input FIFO Over-run Lower */
1954 /* panel */
1955#define LCSR_IUL 0x00000020 /* Input FIFO Under-run Lower */
1956 /* panel */
1957#define LCSR_IOU 0x00000040 /* Input FIFO Over-run Upper */
1958 /* panel */
1959#define LCSR_IUU 0x00000080 /* Input FIFO Under-run Upper */
1960 /* panel */
1961#define LCSR_OOL 0x00000100 /* Output FIFO Over-run Lower */
1962 /* panel */
1963#define LCSR_OUL 0x00000200 /* Output FIFO Under-run Lower */
1964 /* panel */
1965#define LCSR_OOU 0x00000400 /* Output FIFO Over-run Upper */
1966 /* panel */
1967#define LCSR_OUU 0x00000800 /* Output FIFO Under-run Upper */
1968 /* panel */
1969
1970#define LCCR1_PPL Fld (6, 4) /* Pixels Per Line/16 - 1 */
1971#define LCCR1_DisWdth(Pixel) /* Display Width [16..1024 pix.] */ \
1972 (((Pixel) - 16)/16 << FShft (LCCR1_PPL))
1973#define LCCR1_HSW Fld (6, 10) /* Horizontal Synchronization */
1974 /* pulse Width - 1 [Tpix] (L_LCLK) */
1975#define LCCR1_HorSnchWdth(Tpix) /* Horizontal Synchronization */ \
1976 /* pulse Width [1..64 Tpix] */ \
1977 (((Tpix) - 1) << FShft (LCCR1_HSW))
1978#define LCCR1_ELW Fld (8, 16) /* End-of-Line pixel clock Wait */
1979 /* count - 1 [Tpix] */
1980#define LCCR1_EndLnDel(Tpix) /* End-of-Line Delay */ \
1981 /* [1..256 Tpix] */ \
1982 (((Tpix) - 1) << FShft (LCCR1_ELW))
1983#define LCCR1_BLW Fld (8, 24) /* Beginning-of-Line pixel clock */
1984 /* Wait count - 1 [Tpix] */
1985#define LCCR1_BegLnDel(Tpix) /* Beginning-of-Line Delay */ \
1986 /* [1..256 Tpix] */ \
1987 (((Tpix) - 1) << FShft (LCCR1_BLW))
1988
1989#define LCCR2_LPP Fld (10, 0) /* Line Per Panel - 1 */
1990#define LCCR2_DisHght(Line) /* Display Height [1..1024 lines] */ \
1991 (((Line) - 1) << FShft (LCCR2_LPP))
1992#define LCCR2_VSW Fld (6, 10) /* Vertical Synchronization pulse */
1993 /* Width - 1 [Tln] (L_FCLK) */
1994#define LCCR2_VrtSnchWdth(Tln) /* Vertical Synchronization pulse */ \
1995 /* Width [1..64 Tln] */ \
1996 (((Tln) - 1) << FShft (LCCR2_VSW))
1997#define LCCR2_EFW Fld (8, 16) /* End-of-Frame line clock Wait */
1998 /* count [Tln] */
1999#define LCCR2_EndFrmDel(Tln) /* End-of-Frame Delay */ \
2000 /* [0..255 Tln] */ \
2001 ((Tln) << FShft (LCCR2_EFW))
2002#define LCCR2_BFW Fld (8, 24) /* Beginning-of-Frame line clock */
2003 /* Wait count [Tln] */
2004#define LCCR2_BegFrmDel(Tln) /* Beginning-of-Frame Delay */ \
2005 /* [0..255 Tln] */ \
2006 ((Tln) << FShft (LCCR2_BFW))
2007
2008#define LCCR3_PCD Fld (8, 0) /* Pixel Clock Divisor/2 - 2 */
2009 /* [1..255] (L_PCLK) */
2010 /* fpix = fcpu/(2*(PCD + 2)) */
2011 /* Tpix = 2*(PCD + 2)*Tcpu */
2012#define LCCR3_PixClkDiv(Div) /* Pixel Clock Divisor [6..514] */ \
2013 (((Div) - 4)/2 << FShft (LCCR3_PCD))
2014 /* fpix = fcpu/(2*Floor (Div/2)) */
2015 /* Tpix = 2*Floor (Div/2)*Tcpu */
2016#define LCCR3_CeilPixClkDiv(Div) /* Ceil. of PixClkDiv [6..514] */ \
2017 (((Div) - 3)/2 << FShft (LCCR3_PCD))
2018 /* fpix = fcpu/(2*Ceil (Div/2)) */
2019 /* Tpix = 2*Ceil (Div/2)*Tcpu */
2020#define LCCR3_ACB Fld (8, 8) /* AC Bias clock half period - 1 */
2021 /* [Tln] (L_BIAS) */
2022#define LCCR3_ACBsDiv(Div) /* AC Bias clock Divisor [2..512] */ \
2023 (((Div) - 2)/2 << FShft (LCCR3_ACB))
2024 /* fac = fln/(2*Floor (Div/2)) */
2025 /* Tac = 2*Floor (Div/2)*Tln */
2026#define LCCR3_CeilACBsDiv(Div) /* Ceil. of ACBsDiv [2..512] */ \
2027 (((Div) - 1)/2 << FShft (LCCR3_ACB))
2028 /* fac = fln/(2*Ceil (Div/2)) */
2029 /* Tac = 2*Ceil (Div/2)*Tln */
2030#define LCCR3_API Fld (4, 16) /* AC bias Pin transitions per */
2031 /* Interrupt */
2032#define LCCR3_ACBsCntOff /* AC Bias clock transition Count */ \
2033 /* Off */ \
2034 (0 << FShft (LCCR3_API))
2035#define LCCR3_ACBsCnt(Trans) /* AC Bias clock transition Count */ \
2036 /* [1..15] */ \
2037 ((Trans) << FShft (LCCR3_API))
2038#define LCCR3_VSP 0x00100000 /* Vertical Synchronization pulse */
2039 /* Polarity (L_FCLK) */
2040#define LCCR3_VrtSnchH (LCCR3_VSP*0) /* Vertical Synchronization pulse */
2041 /* active High */
2042#define LCCR3_VrtSnchL (LCCR3_VSP*1) /* Vertical Synchronization pulse */
2043 /* active Low */
2044#define LCCR3_HSP 0x00200000 /* Horizontal Synchronization */
2045 /* pulse Polarity (L_LCLK) */
2046#define LCCR3_HorSnchH (LCCR3_HSP*0) /* Horizontal Synchronization */
2047 /* pulse active High */
2048#define LCCR3_HorSnchL (LCCR3_HSP*1) /* Horizontal Synchronization */
2049 /* pulse active Low */
2050#define LCCR3_PCP 0x00400000 /* Pixel Clock Polarity (L_PCLK) */
2051#define LCCR3_PixRsEdg (LCCR3_PCP*0) /* Pixel clock Rising-Edge */
2052#define LCCR3_PixFlEdg (LCCR3_PCP*1) /* Pixel clock Falling-Edge */
2053#define LCCR3_OEP 0x00800000 /* Output Enable Polarity (L_BIAS, */
2054 /* active display mode) */
2055#define LCCR3_OutEnH (LCCR3_OEP*0) /* Output Enable active High */
2056#define LCCR3_OutEnL (LCCR3_OEP*1) /* Output Enable active Low */
2057
2058#ifndef __ASSEMBLY__
2059extern unsigned int processor_id;
2060#endif
2061
2062#define CPU_REVISION (processor_id & 15)
2063#define CPU_SA1110_A0 (0)
2064#define CPU_SA1110_B0 (4)
2065#define CPU_SA1110_B1 (5)
2066#define CPU_SA1110_B2 (6)
2067#define CPU_SA1110_B4 (8)
2068
2069#define CPU_SA1100_ID (0x4401a110)
2070#define CPU_SA1100_MASK (0xfffffff0)
2071#define CPU_SA1110_ID (0x6901b110)
2072#define CPU_SA1110_MASK (0xfffffff0)
diff --git a/include/asm-arm/arch-sa1100/SA-1101.h b/include/asm-arm/arch-sa1100/SA-1101.h
new file mode 100644
index 000000000000..527d887f1ee3
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/SA-1101.h
@@ -0,0 +1,925 @@
1/*
2 * SA-1101.h
3 *
4 * Copyright (c) Peter Danielsson 1999
5 *
6 * Definition of constants related to the sa1101
7 * support chip for the sa1100
8 *
9 */
10
11
12/* Be sure that virtual mapping is defined right */
13#ifndef __ASM_ARCH_HARDWARE_H
14#error You must include hardware.h not SA-1101.h
15#endif
16
17#ifndef SA1101_BASE
18#error You must define SA-1101 physical base address
19#endif
20
21#ifndef LANGUAGE
22# ifdef __ASSEMBLY__
23# define LANGUAGE Assembly
24# else
25# define LANGUAGE C
26# endif
27#endif
28
29/*
30 * We have mapped the sa1101 depending on the value of SA1101_BASE.
31 * It then appears from 0xf4000000.
32 */
33
34#define SA1101_p2v( x ) ((x) - SA1101_BASE + 0xf4000000)
35#define SA1101_v2p( x ) ((x) - 0xf4000000 + SA1101_BASE)
36
37#ifndef SA1101_p2v
38#define SA1101_p2v(PhAdd) (PhAdd)
39#endif
40
41#include <asm/arch/bitfield.h>
42
43#define C 0
44#define Assembly 1
45
46
47/*
48 * Memory map
49 */
50
51#define __SHMEM_CONTROL0 0x00000000
52#define __SYSTEM_CONTROL1 0x00000400
53#define __ARBITER 0x00020000
54#define __SYSTEM_CONTROL2 0x00040000
55#define __SYSTEM_CONTROL3 0x00060000
56#define __PARALLEL_PORT 0x00080000
57#define __VIDMEM_CONTROL 0x00100000
58#define __UPDATE_FIFO 0x00120000
59#define __SHMEM_CONTROL1 0x00140000
60#define __INTERRUPT_CONTROL 0x00160000
61#define __USB_CONTROL 0x00180000
62#define __TRACK_INTERFACE 0x001a0000
63#define __MOUSE_INTERFACE 0x001b0000
64#define __KEYPAD_INTERFACE 0x001c0000
65#define __PCMCIA_INTERFACE 0x001e0000
66#define __VGA_CONTROL 0x00200000
67#define __GPIO_INTERFACE 0x00300000
68
69/*
70 * Macro that calculates real address for registers in the SA-1101
71 */
72
73#define _SA1101( x ) ((x) + SA1101_BASE)
74
75/*
76 * Interface and shared memory controller registers
77 *
78 * Registers
79 * SKCR SA-1101 control register (read/write)
80 * SMCR Shared Memory Controller Register
81 * SNPR Snoop Register
82 */
83
84#define _SKCR _SA1101( 0x00000000 ) /* SA-1101 Control Reg. */
85#define _SMCR _SA1101( 0x00140000 ) /* Shared Mem. Control Reg. */
86#define _SNPR _SA1101( 0x00140400 ) /* Snoop Reg. */
87
88#if LANGUAGE == C
89#define SKCR (*((volatile Word *) SA1101_p2v (_SKCR)))
90#define SMCR (*((volatile Word *) SA1101_p2v (_SMCR)))
91#define SNPR (*((volatile Word *) SA1101_p2v (_SNPR)))
92
93#define SKCR_PLLEn 0x0001 /* Enable On-Chip PLL */
94#define SKCR_BCLKEn 0x0002 /* Enables BCLK */
95#define SKCR_Sleep 0x0004 /* Sleep Mode */
96#define SKCR_IRefEn 0x0008 /* DAC Iref input enable */
97#define SKCR_VCOON 0x0010 /* VCO bias */
98#define SKCR_ScanTestEn 0x0020 /* Enables scan test */
99#define SKCR_ClockTestEn 0x0040 /* Enables clock test */
100
101#define SMCR_DCAC Fld(2,0) /* Number of column address bits */
102#define SMCR_DRAC Fld(2,2) /* Number of row address bits */
103#define SMCR_ArbiterBias 0x0008 /* favor video or USB */
104#define SMCR_TopVidMem Fld(4,5) /* Top 4 bits of vidmem addr. */
105
106#define SMCR_ColAdrBits( x ) /* col. addr bits 8..11 */ \
107 (( (x) - 8 ) << FShft (SMCR_DCAC))
108#define SMCR_RowAdrBits( x ) /* row addr bits 9..12 */\
109 (( (x) - 9 ) << FShft (SMCR_DRAC)
110
111#define SNPR_VFBstart Fld(12,0) /* Video frame buffer addr */
112#define SNPR_VFBsize Fld(11,12) /* Video frame buffer size */
113#define SNPR_WholeBank (1 << 23) /* Whole bank bit */
114#define SNPR_BankSelect Fld(2,27) /* Bank select */
115#define SNPR_SnoopEn (1 << 31) /* Enable snoop operation */
116
117#define SNPR_Set_VFBsize( x ) /* set frame buffer size (in kb) */ \
118 ( (x) << FShft (SNPR_VFBsize))
119#define SNPR_Select_Bank(x) /* select bank 0 or 1 */ \
120 (( (x) + 1 ) << FShft (SNPR_BankSelect ))
121
122#endif /* LANGUAGE == C */
123
124/*
125 * Video Memory Controller
126 *
127 * Registers
128 * VMCCR Configuration register
129 * VMCAR VMC address register
130 * VMCDR VMC data register
131 *
132 */
133
134#define _VMCCR _SA1101( 0x00100000 ) /* Configuration register */
135#define _VMCAR _SA1101( 0x00101000 ) /* VMC address register */
136#define _VMCDR _SA1101( 0x00101400 ) /* VMC data register */
137
138#if LANGUAGE == C
139#define VMCCR (*((volatile Word *) SA1101_p2v (_VMCCR)))
140#define VMCAR (*((volatile Word *) SA1101_p2v (_VMCAR)))
141#define VMCDR (*((volatile Word *) SA1101_p2v (_VMCDR)))
142
143#define VMCCR_RefreshEn 0x0000 /* Enable memory refresh */
144#define VMCCR_Config 0x0001 /* DRAM size */
145#define VMCCR_RefPeriod Fld(2,3) /* Refresh period */
146#define VMCCR_StaleDataWait Fld(4,5) /* Stale FIFO data timeout counter */
147#define VMCCR_SleepState (1<<9) /* State of interface pins in sleep*/
148#define VMCCR_RefTest (1<<10) /* refresh test */
149#define VMCCR_RefLow Fld(6,11) /* refresh low counter */
150#define VMCCR_RefHigh Fld(7,17) /* refresh high counter */
151#define VMCCR_SDTCTest Fld(7,24) /* stale data timeout counter */
152#define VMCCR_ForceSelfRef (1<<31) /* Force self refresh */
153
154#endif LANGUAGE == C
155
156
157/* Update FIFO
158 *
159 * Registers
160 * UFCR Update FIFO Control Register
161 * UFSR Update FIFO Status Register
162 * UFLVLR update FIFO level register
163 * UFDR update FIFO data register
164 */
165
166#define _UFCR _SA1101(0x00120000) /* Update FIFO Control Reg. */
167#define _UFSR _SA1101(0x00120400) /* Update FIFO Status Reg. */
168#define _UFLVLR _SA1101(0x00120800) /* Update FIFO level reg. */
169#define _UFDR _SA1101(0x00120c00) /* Update FIFO data reg. */
170
171#if LANGUAGE == C
172
173#define UFCR (*((volatile Word *) SA1101_p2v (_UFCR)))
174#define UFSR (*((volatile Word *) SA1101_p2v (_UFSR)))
175#define UFLVLR (*((volatile Word *) SA1101_p2v (_UFLVLR)))
176#define UFDR (*((volatile Word *) SA1101_p2v (_UFDR)))
177
178
179#define UFCR_FifoThreshhold Fld(7,0) /* Level for FifoGTn flag */
180
181#define UFSR_FifoGTnFlag 0x01 /* FifoGTn flag */#define UFSR_FifoEmpty 0x80 /* FIFO is empty */
182
183#endif /* LANGUAGE == C */
184
185/* System Controller
186 *
187 * Registers
188 * SKPCR Power Control Register
189 * SKCDR Clock Divider Register
190 * DACDR1 DAC1 Data register
191 * DACDR2 DAC2 Data register
192 */
193
194#define _SKPCR _SA1101(0x00000400)
195#define _SKCDR _SA1101(0x00040000)
196#define _DACDR1 _SA1101(0x00060000)
197#define _DACDR2 _SA1101(0x00060400)
198
199#if LANGUAGE == C
200#define SKPCR (*((volatile Word *) SA1101_p2v (_SKPCR)))
201#define SKCDR (*((volatile Word *) SA1101_p2v (_SKCDR)))
202#define DACDR1 (*((volatile Word *) SA1101_p2v (_DACDR1)))
203#define DACDR2 (*((volatile Word *) SA1101_p2v (_DACDR2)))
204
205#define SKPCR_UCLKEn 0x01 /* USB Enable */
206#define SKPCR_PCLKEn 0x02 /* PS/2 Enable */
207#define SKPCR_ICLKEn 0x04 /* Interrupt Controller Enable */
208#define SKPCR_VCLKEn 0x08 /* Video Controller Enable */
209#define SKPCR_PICLKEn 0x10 /* parallel port Enable */
210#define SKPCR_DCLKEn 0x20 /* DACs Enable */
211#define SKPCR_nKPADEn 0x40 /* Multiplexer */
212
213#define SKCDR_PLLMul Fld(7,0) /* PLL Multiplier */
214#define SKCDR_VCLKEn Fld(2,7) /* Video controller clock divider */
215#define SKDCR_BCLKEn (1<<9) /* BCLK Divider */
216#define SKDCR_UTESTCLKEn (1<<10) /* Route USB clock during test mode */
217#define SKDCR_DivRValue Fld(6,11) /* Input clock divider for PLL */
218#define SKDCR_DivNValue Fld(5,17) /* Output clock divider for PLL */
219#define SKDCR_PLLRSH Fld(3,22) /* PLL bandwidth control */
220#define SKDCR_ChargePump (1<<25) /* Charge pump control */
221#define SKDCR_ClkTestMode (1<<26) /* Clock output test mode */
222#define SKDCR_ClkTestEn (1<<27) /* Test clock generator */
223#define SKDCR_ClkJitterCntl Fld(3,28) /* video clock jitter compensation */
224
225#define DACDR_DACCount Fld(8,0) /* Count value */
226#define DACDR1_DACCount DACDR_DACCount
227#define DACDR2_DACCount DACDR_DACCount
228
229#endif /* LANGUAGE == C */
230
231/*
232 * Parallel Port Interface
233 *
234 * Registers
235 * IEEE_Config IEEE mode selection and programmable attributes
236 * IEEE_Control Controls the states of IEEE port control outputs
237 * IEEE_Data Forward transfer data register
238 * IEEE_Addr Forward transfer address register
239 * IEEE_Status Port IO signal status register
240 * IEEE_IntStatus Port interrupts status register
241 * IEEE_FifoLevels Rx and Tx FIFO interrupt generation levels
242 * IEEE_InitTime Forward timeout counter initial value
243 * IEEE_TimerStatus Forward timeout counter current value
244 * IEEE_FifoReset Reset forward transfer FIFO
245 * IEEE_ReloadValue Counter reload value
246 * IEEE_TestControl Control testmode
247 * IEEE_TestDataIn Test data register
248 * IEEE_TestDataInEn Enable test data
249 * IEEE_TestCtrlIn Test control signals
250 * IEEE_TestCtrlInEn Enable test control signals
251 * IEEE_TestDataStat Current data bus value
252 *
253 */
254
255/*
256 * The control registers are defined as offsets from a base address
257 */
258
259#define _IEEE( x ) _SA1101( (x) + __PARALLEL_PORT )
260
261#define _IEEE_Config _IEEE( 0x0000 )
262#define _IEEE_Control _IEEE( 0x0400 )
263#define _IEEE_Data _IEEE( 0x4000 )
264#define _IEEE_Addr _IEEE( 0x0800 )
265#define _IEEE_Status _IEEE( 0x0c00 )
266#define _IEEE_IntStatus _IEEE( 0x1000 )
267#define _IEEE_FifoLevels _IEEE( 0x1400 )
268#define _IEEE_InitTime _IEEE( 0x1800 )
269#define _IEEE_TimerStatus _IEEE( 0x1c00 )
270#define _IEEE_FifoReset _IEEE( 0x2000 )
271#define _IEEE_ReloadValue _IEEE( 0x3c00 )
272#define _IEEE_TestControl _IEEE( 0x2400 )
273#define _IEEE_TestDataIn _IEEE( 0x2800 )
274#define _IEEE_TestDataInEn _IEEE( 0x2c00 )
275#define _IEEE_TestCtrlIn _IEEE( 0x3000 )
276#define _IEEE_TestCtrlInEn _IEEE( 0x3400 )
277#define _IEEE_TestDataStat _IEEE( 0x3800 )
278
279
280#if LANGUAGE == C
281#define IEEE_Config (*((volatile Word *) SA1101_p2v (_IEEE_Config)))
282#define IEEE_Control (*((volatile Word *) SA1101_p2v (_IEEE_Control)))
283#define IEEE_Data (*((volatile Word *) SA1101_p2v (_IEEE_Data)))
284#define IEEE_Addr (*((volatile Word *) SA1101_p2v (_IEEE_Addr)))
285#define IEEE_Status (*((volatile Word *) SA1101_p2v (_IEEE_Status)))
286#define IEEE_IntStatus (*((volatile Word *) SA1101_p2v (_IEEE_IntStatus)))
287#define IEEE_FifoLevels (*((volatile Word *) SA1101_p2v (_IEEE_FifoLevels)))
288#define IEEE_InitTime (*((volatile Word *) SA1101_p2v (_IEEE_InitTime)))
289#define IEEE_TimerStatus (*((volatile Word *) SA1101_p2v (_IEEE_TimerStatus)))
290#define IEEE_FifoReset (*((volatile Word *) SA1101_p2v (_IEEE_FifoReset)))
291#define IEEE_ReloadValue (*((volatile Word *) SA1101_p2v (_IEEE_ReloadValue)))
292#define IEEE_TestControl (*((volatile Word *) SA1101_p2v (_IEEE_TestControl)))
293#define IEEE_TestDataIn (*((volatile Word *) SA1101_p2v (_IEEE_TestDataIn)))
294#define IEEE_TestDataInEn (*((volatile Word *) SA1101_p2v (_IEEE_TestDataInEn)))
295#define IEEE_TestCtrlIn (*((volatile Word *) SA1101_p2v (_IEEE_TestCtrlIn)))
296#define IEEE_TestCtrlInEn (*((volatile Word *) SA1101_p2v (_IEEE_TestCtrlInEn)))
297#define IEEE_TestDataStat (*((volatile Word *) SA1101_p2v (_IEEE_TestDataStat)))
298
299
300#define IEEE_Config_M Fld(3,0) /* Mode select */
301#define IEEE_Config_D 0x04 /* FIFO access enable */
302#define IEEE_Config_B 0x08 /* 9-bit word enable */
303#define IEEE_Config_T 0x10 /* Data transfer enable */
304#define IEEE_Config_A 0x20 /* Data transfer direction */
305#define IEEE_Config_E 0x40 /* Timer enable */
306#define IEEE_Control_A 0x08 /* AutoFd output */
307#define IEEE_Control_E 0x04 /* Selectin output */
308#define IEEE_Control_T 0x02 /* Strobe output */
309#define IEEE_Control_I 0x01 /* Port init output */
310#define IEEE_Data_C (1<<31) /* Byte count */
311#define IEEE_Data_Db Fld(9,16) /* Data byte 2 */
312#define IEEE_Data_Da Fld(9,0) /* Data byte 1 */
313#define IEEE_Addr_A Fld(8,0) /* forward address transfer byte */
314#define IEEE_Status_A 0x0100 /* nAutoFd port output status */
315#define IEEE_Status_E 0x0080 /* nSelectIn port output status */
316#define IEEE_Status_T 0x0040 /* nStrobe port output status */
317#define IEEE_Status_I 0x0020 /* nInit port output status */
318#define IEEE_Status_B 0x0010 /* Busy port inout status */
319#define IEEE_Status_S 0x0008 /* Select port input status */
320#define IEEE_Status_K 0x0004 /* nAck port input status */
321#define IEEE_Status_F 0x0002 /* nFault port input status */
322#define IEEE_Status_R 0x0001 /* pError port input status */
323
324#define IEEE_IntStatus_IntReqDat 0x0100
325#define IEEE_IntStatus_IntReqEmp 0x0080
326#define IEEE_IntStatus_IntReqInt 0x0040
327#define IEEE_IntStatus_IntReqRav 0x0020
328#define IEEE_IntStatus_IntReqTim 0x0010
329#define IEEE_IntStatus_RevAddrComp 0x0008
330#define IEEE_IntStatus_RevDataComp 0x0004
331#define IEEE_IntStatus_FwdAddrComp 0x0002
332#define IEEE_IntStatus_FwdDataComp 0x0001
333#define IEEE_FifoLevels_RevFifoLevel 2
334#define IEEE_FifoLevels_FwdFifoLevel 1
335#define IEEE_InitTime_TimValInit Fld(22,0)
336#define IEEE_TimerStatus_TimValStat Fld(22,0)
337#define IEEE_ReloadValue_Reload Fld(4,0)
338
339#define IEEE_TestControl_RegClk 0x04
340#define IEEE_TestControl_ClockSelect Fld(2,1)
341#define IEEE_TestControl_TimerTestModeEn 0x01
342#define IEEE_TestCtrlIn_PError 0x10
343#define IEEE_TestCtrlIn_nFault 0x08
344#define IEEE_TestCtrlIn_nAck 0x04
345#define IEEE_TestCtrlIn_PSel 0x02
346#define IEEE_TestCtrlIn_Busy 0x01
347
348#endif /* LANGUAGE == C */
349
350/*
351 * VGA Controller
352 *
353 * Registers
354 * VideoControl Video Control Register
355 * VgaTiming0 VGA Timing Register 0
356 * VgaTiming1 VGA Timing Register 1
357 * VgaTiming2 VGA Timing Register 2
358 * VgaTiming3 VGA Timing Register 3
359 * VgaBorder VGA Border Color Register
360 * VgaDBAR VGADMA Base Address Register
361 * VgaDCAR VGADMA Channel Current Address Register
362 * VgaStatus VGA Status Register
363 * VgaInterruptMask VGA Interrupt Mask Register
364 * VgaPalette VGA Palette Registers
365 * DacControl DAC Control Register
366 * VgaTest VGA Controller Test Register
367 */
368
369#define _VGA( x ) _SA1101( ( x ) + __VGA_CONTROL )
370
371#define _VideoControl _VGA( 0x0000 )
372#define _VgaTiming0 _VGA( 0x0400 )
373#define _VgaTiming1 _VGA( 0x0800 )
374#define _VgaTiming2 _VGA( 0x0c00 )
375#define _VgaTiming3 _VGA( 0x1000 )
376#define _VgaBorder _VGA( 0x1400 )
377#define _VgaDBAR _VGA( 0x1800 )
378#define _VgaDCAR _VGA( 0x1c00 )
379#define _VgaStatus _VGA( 0x2000 )
380#define _VgaInterruptMask _VGA( 0x2400 )
381#define _VgaPalette _VGA( 0x40000 )
382#define _DacControl _VGA( 0x3000 )
383#define _VgaTest _VGA( 0x2c00 )
384
385#if (LANGUAGE == C)
386#define VideoControl (*((volatile Word *) SA1101_p2v (_VideoControl)))
387#define VgaTiming0 (*((volatile Word *) SA1101_p2v (_VgaTiming0)))
388#define VgaTiming1 (*((volatile Word *) SA1101_p2v (_VgaTiming1)))
389#define VgaTiming2 (*((volatile Word *) SA1101_p2v (_VgaTiming2)))
390#define VgaTiming3 (*((volatile Word *) SA1101_p2v (_VgaTiming3)))
391#define VgaBorder (*((volatile Word *) SA1101_p2v (_VgaBorder)))
392#define VgaDBAR (*((volatile Word *) SA1101_p2v (_VgaDBAR)))
393#define VgaDCAR (*((volatile Word *) SA1101_p2v (_VgaDCAR)))
394#define VgaStatus (*((volatile Word *) SA1101_p2v (_VgaStatus)))
395#define VgaInterruptMask (*((volatile Word *) SA1101_p2v (_VgaInterruptMask)))
396#define VgaPalette (*((volatile Word *) SA1101_p2v (_VgaPalette)))
397#define DacControl (*((volatile Word *) SA1101_p2v (_DacControl))
398#define VgaTest (*((volatile Word *) SA1101_p2v (_VgaTest)))
399
400#define VideoControl_VgaEn 0x00000000
401#define VideoControl_BGR 0x00000001
402#define VideoControl_VCompVal Fld(2,2)
403#define VideoControl_VgaReq Fld(4,4)
404#define VideoControl_VBurstL Fld(4,8)
405#define VideoControl_VMode (1<<12)
406#define VideoControl_PalRead (1<<13)
407
408#define VgaTiming0_PPL Fld(6,2)
409#define VgaTiming0_HSW Fld(8,8)
410#define VgaTiming0_HFP Fld(8,16)
411#define VgaTiming0_HBP Fld(8,24)
412
413#define VgaTiming1_LPS Fld(10,0)
414#define VgaTiming1_VSW Fld(6,10)
415#define VgaTiming1_VFP Fld(8,16)
416#define VgaTiming1_VBP Fld(8,24)
417
418#define VgaTiming2_IVS 0x01
419#define VgaTiming2_IHS 0x02
420#define VgaTiming2_CVS 0x04
421#define VgaTiming2_CHS 0x08
422
423#define VgaTiming3_HBS Fld(8,0)
424#define VgaTiming3_HBE Fld(8,8)
425#define VgaTiming3_VBS Fld(8,16)
426#define VgaTiming3_VBE Fld(8,24)
427
428#define VgaBorder_BCOL Fld(24,0)
429
430#define VgaStatus_VFUF 0x01
431#define VgaStatus_VNext 0x02
432#define VgaStatus_VComp 0x04
433
434#define VgaInterruptMask_VFUFMask 0x00
435#define VgaInterruptMask_VNextMask 0x01
436#define VgaInterruptMask_VCompMask 0x02
437
438#define VgaPalette_R Fld(8,0)
439#define VgaPalette_G Fld(8,8)
440#define VgaPalette_B Fld(8,16)
441
442#define DacControl_DACON 0x0001
443#define DacControl_COMPON 0x0002
444#define DacControl_PEDON 0x0004
445#define DacControl_RTrim Fld(5,4)
446#define DacControl_GTrim Fld(5,9)
447#define DacControl_BTrim Fld(5,14)
448
449#define VgaTest_TDAC 0x00
450#define VgaTest_Datatest Fld(4,1)
451#define VgaTest_DACTESTDAC 0x10
452#define VgaTest_DACTESTOUT Fld(3,5)
453
454#endif /* LANGUAGE == C */
455
456/*
457 * USB Host Interface Controller
458 *
459 * Registers
460 * Revision
461 * Control
462 * CommandStatus
463 * InterruptStatus
464 * InterruptEnable
465 * HCCA
466 * PeriodCurrentED
467 * ControlHeadED
468 * BulkHeadED
469 * BulkCurrentED
470 * DoneHead
471 * FmInterval
472 * FmRemaining
473 * FmNumber
474 * PeriodicStart
475 * LSThreshold
476 * RhDescriptorA
477 * RhDescriptorB
478 * RhStatus
479 * RhPortStatus
480 * USBStatus
481 * USBReset
482 * USTAR
483 * USWER
484 * USRFR
485 * USNFR
486 * USTCSR
487 * USSR
488 *
489 */
490
491#define _USB( x ) _SA1101( ( x ) + __USB_CONTROL )
492
493
494#define _Revision _USB( 0x0000 )
495#define _Control _USB( 0x0888 )
496#define _CommandStatus _USB( 0x0c00 )
497#define _InterruptStatus _USB( 0x1000 )
498#define _InterruptEnable _USB( 0x1400 )
499#define _HCCA _USB( 0x1800 )
500#define _PeriodCurrentED _USB( 0x1c00 )
501#define _ControlHeadED _USB( 0x2000 )
502#define _BulkHeadED _USB( 0x2800 )
503#define _BulkCurrentED _USB( 0x2c00 )
504#define _DoneHead _USB( 0x3000 )
505#define _FmInterval _USB( 0x3400 )
506#define _FmRemaining _USB( 0x3800 )
507#define _FmNumber _USB( 0x3c00 )
508#define _PeriodicStart _USB( 0x4000 )
509#define _LSThreshold _USB( 0x4400 )
510#define _RhDescriptorA _USB( 0x4800 )
511#define _RhDescriptorB _USB( 0x4c00 )
512#define _RhStatus _USB( 0x5000 )
513#define _RhPortStatus _USB( 0x5400 )
514#define _USBStatus _USB( 0x11800 )
515#define _USBReset _USB( 0x11c00 )
516
517#define _USTAR _USB( 0x10400 )
518#define _USWER _USB( 0x10800 )
519#define _USRFR _USB( 0x10c00 )
520#define _USNFR _USB( 0x11000 )
521#define _USTCSR _USB( 0x11400 )
522#define _USSR _USB( 0x11800 )
523
524
525#if (LANGUAGE == C)
526
527#define Revision (*((volatile Word *) SA1101_p2v (_Revision)))
528#define Control (*((volatile Word *) SA1101_p2v (_Control)))
529#define CommandStatus (*((volatile Word *) SA1101_p2v (_CommandStatus)))
530#define InterruptStatus (*((volatile Word *) SA1101_p2v (_InterruptStatus)))
531#define InterruptEnable (*((volatile Word *) SA1101_p2v (_InterruptEnable)))
532#define HCCA (*((volatile Word *) SA1101_p2v (_HCCA)))
533#define PeriodCurrentED (*((volatile Word *) SA1101_p2v (_PeriodCurrentED)))
534#define ControlHeadED (*((volatile Word *) SA1101_p2v (_ControlHeadED)))
535#define BulkHeadED (*((volatile Word *) SA1101_p2v (_BulkHeadED)))
536#define BulkCurrentED (*((volatile Word *) SA1101_p2v (_BulkCurrentED)))
537#define DoneHead (*((volatile Word *) SA1101_p2v (_DoneHead)))
538#define FmInterval (*((volatile Word *) SA1101_p2v (_FmInterval)))
539#define FmRemaining (*((volatile Word *) SA1101_p2v (_FmRemaining)))
540#define FmNumber (*((volatile Word *) SA1101_p2v (_FmNumber)))
541#define PeriodicStart (*((volatile Word *) SA1101_p2v (_PeriodicStart)))
542#define LSThreshold (*((volatile Word *) SA1101_p2v (_LSThreshold)))
543#define RhDescriptorA (*((volatile Word *) SA1101_p2v (_RhDescriptorA)))
544#define RhDescriptorB (*((volatile Word *) SA1101_p2v (_RhDescriptorB)))
545#define RhStatus (*((volatile Word *) SA1101_p2v (_RhStatus)))
546#define RhPortStatus (*((volatile Word *) SA1101_p2v (_RhPortStatus)))
547#define USBStatus (*((volatile Word *) SA1101_p2v (_USBStatus)))
548#define USBReset (*((volatile Word *) SA1101_p2v (_USBReset)))
549#define USTAR (*((volatile Word *) SA1101_p2v (_USTAR)))
550#define USWER (*((volatile Word *) SA1101_p2v (_USWER)))
551#define USRFR (*((volatile Word *) SA1101_p2v (_USRFR)))
552#define USNFR (*((volatile Word *) SA1101_p2v (_USNFR)))
553#define USTCSR (*((volatile Word *) SA1101_p2v (_USTCSR)))
554#define USSR (*((volatile Word *) SA1101_p2v (_USSR)))
555
556
557#define USBStatus_IrqHciRmtWkp (1<<7)
558#define USBStatus_IrqHciBuffAcc (1<<8)
559#define USBStatus_nIrqHciM (1<<9)
560#define USBStatus_nHciMFClr (1<<10)
561
562#define USBReset_ForceIfReset 0x01
563#define USBReset_ForceHcReset 0x02
564#define USBReset_ClkGenReset 0x04
565
566#define USTCR_RdBstCntrl Fld(3,0)
567#define USTCR_ByteEnable Fld(4,3)
568#define USTCR_WriteEn (1<<7)
569#define USTCR_FifoCir (1<<8)
570#define USTCR_TestXferSel (1<<9)
571#define USTCR_FifoCirAtEnd (1<<10)
572#define USTCR_nSimScaleDownClk (1<<11)
573
574#define USSR_nAppMDEmpty 0x01
575#define USSR_nAppMDFirst 0x02
576#define USSR_nAppMDLast 0x04
577#define USSR_nAppMDFull 0x08
578#define USSR_nAppMAFull 0x10
579#define USSR_XferReq 0x20
580#define USSR_XferEnd 0x40
581
582#endif /* LANGUAGE == C */
583
584
585/*
586 * Interrupt Controller
587 *
588 * Registers
589 * INTTEST0 Test register 0
590 * INTTEST1 Test register 1
591 * INTENABLE0 Interrupt Enable register 0
592 * INTENABLE1 Interrupt Enable register 1
593 * INTPOL0 Interrupt Polarity selection 0
594 * INTPOL1 Interrupt Polarity selection 1
595 * INTTSTSEL Interrupt source selection
596 * INTSTATCLR0 Interrupt Status 0
597 * INTSTATCLR1 Interrupt Status 1
598 * INTSET0 Interrupt Set 0
599 * INTSET1 Interrupt Set 1
600 */
601
602#define _INT( x ) _SA1101( ( x ) + __INTERRUPT_CONTROL)
603
604#define _INTTEST0 _INT( 0x1000 )
605#define _INTTEST1 _INT( 0x1400 )
606#define _INTENABLE0 _INT( 0x2000 )
607#define _INTENABLE1 _INT( 0x2400 )
608#define _INTPOL0 _INT( 0x3000 )
609#define _INTPOL1 _INT( 0x3400 )
610#define _INTTSTSEL _INT( 0x5000 )
611#define _INTSTATCLR0 _INT( 0x6000 )
612#define _INTSTATCLR1 _INT( 0x6400 )
613#define _INTSET0 _INT( 0x7000 )
614#define _INTSET1 _INT( 0x7400 )
615
616#if ( LANGUAGE == C )
617#define INTTEST0 (*((volatile Word *) SA1101_p2v (_INTTEST0)))
618#define INTTEST1 (*((volatile Word *) SA1101_p2v (_INTTEST1)))
619#define INTENABLE0 (*((volatile Word *) SA1101_p2v (_INTENABLE0)))
620#define INTENABLE1 (*((volatile Word *) SA1101_p2v (_INTENABLE1)))
621#define INTPOL0 (*((volatile Word *) SA1101_p2v (_INTPOL0)))
622#define INTPOL1 (*((volatile Word *) SA1101_p2v (_INTPOL1)))
623#define INTTSTSEL (*((volatile Word *) SA1101_p2v (_INTTSTSEL)))
624#define INTSTATCLR0 (*((volatile Word *) SA1101_p2v (_INTSTATCLR0)))
625#define INTSTATCLR1 (*((volatile Word *) SA1101_p2v (_INTSTATCLR1)))
626#define INTSET0 (*((volatile Word *) SA1101_p2v (_INTSET0)))
627#define INTSET1 (*((volatile Word *) SA1101_p2v (_INTSET1)))
628
629#endif /* LANGUAGE == C */
630
631/*
632 * PS/2 Trackpad and Mouse Interfaces
633 *
634 * Registers (prefix kbd applies to trackpad interface, mse to mouse)
635 * KBDCR Control Register
636 * KBDSTAT Status Register
637 * KBDDATA Transmit/Receive Data register
638 * KBDCLKDIV Clock Division Register
639 * KBDPRECNT Clock Precount Register
640 * KBDTEST1 Test register 1
641 * KBDTEST2 Test register 2
642 * KBDTEST3 Test register 3
643 * KBDTEST4 Test register 4
644 * MSECR
645 * MSESTAT
646 * MSEDATA
647 * MSECLKDIV
648 * MSEPRECNT
649 * MSETEST1
650 * MSETEST2
651 * MSETEST3
652 * MSETEST4
653 *
654 */
655
656#define _KBD( x ) _SA1101( ( x ) + __TRACK_INTERFACE )
657#define _MSE( x ) _SA1101( ( x ) + __MOUSE_INTERFACE )
658
659#define _KBDCR _KBD( 0x0000 )
660#define _KBDSTAT _KBD( 0x0400 )
661#define _KBDDATA _KBD( 0x0800 )
662#define _KBDCLKDIV _KBD( 0x0c00 )
663#define _KBDPRECNT _KBD( 0x1000 )
664#define _KBDTEST1 _KBD( 0x2000 )
665#define _KBDTEST2 _KBD( 0x2400 )
666#define _KBDTEST3 _KBD( 0x2800 )
667#define _KBDTEST4 _KBD( 0x2c00 )
668#define _MSECR _MSE( 0x0000 )
669#define _MSESTAT _MSE( 0x0400 )
670#define _MSEDATA _MSE( 0x0800 )
671#define _MSECLKDIV _MSE( 0x0c00 )
672#define _MSEPRECNT _MSE( 0x1000 )
673#define _MSETEST1 _MSE( 0x2000 )
674#define _MSETEST2 _MSE( 0x2400 )
675#define _MSETEST3 _MSE( 0x2800 )
676#define _MSETEST4 _MSE( 0x2c00 )
677
678#if ( LANGUAGE == C )
679
680#define KBDCR (*((volatile Word *) SA1101_p2v (_KBDCR)))
681#define KBDSTAT (*((volatile Word *) SA1101_p2v (_KBDSTAT)))
682#define KBDDATA (*((volatile Word *) SA1101_p2v (_KBDDATA)))
683#define KBDCLKDIV (*((volatile Word *) SA1101_p2v (_KBDCLKDIV)))
684#define KBDPRECNT (*((volatile Word *) SA1101_p2v (_KBDPRECNT)))
685#define KBDTEST1 (*((volatile Word *) SA1101_p2v (_KBDTEST1)))
686#define KBDTEST2 (*((volatile Word *) SA1101_p2v (_KBDTEST2)))
687#define KBDTEST3 (*((volatile Word *) SA1101_p2v (_KBDTEST3)))
688#define KBDTEST4 (*((volatile Word *) SA1101_p2v (_KBDTEST4)))
689#define MSECR (*((volatile Word *) SA1101_p2v (_MSECR)))
690#define MSESTAT (*((volatile Word *) SA1101_p2v (_MSESTAT)))
691#define MSEDATA (*((volatile Word *) SA1101_p2v (_MSEDATA)))
692#define MSECLKDIV (*((volatile Word *) SA1101_p2v (_MSECLKDIV)))
693#define MSEPRECNT (*((volatile Word *) SA1101_p2v (_MSEPRECNT)))
694#define MSETEST1 (*((volatile Word *) SA1101_p2v (_MSETEST1)))
695#define MSETEST2 (*((volatile Word *) SA1101_p2v (_MSETEST2)))
696#define MSETEST3 (*((volatile Word *) SA1101_p2v (_MSETEST3)))
697#define MSETEST4 (*((volatile Word *) SA1101_p2v (_MSETEST4)))
698
699
700#define KBDCR_ENA 0x08
701#define KBDCR_FKD 0x02
702#define KBDCR_FKC 0x01
703
704#define KBDSTAT_TXE 0x80
705#define KBDSTAT_TXB 0x40
706#define KBDSTAT_RXF 0x20
707#define KBDSTAT_RXB 0x10
708#define KBDSTAT_ENA 0x08
709#define KBDSTAT_RXP 0x04
710#define KBDSTAT_KBD 0x02
711#define KBDSTAT_KBC 0x01
712
713#define KBDCLKDIV_DivVal Fld(4,0)
714
715#define MSECR_ENA 0x08
716#define MSECR_FKD 0x02
717#define MSECR_FKC 0x01
718
719#define MSESTAT_TXE 0x80
720#define MSESTAT_TXB 0x40
721#define MSESTAT_RXF 0x20
722#define MSESTAT_RXB 0x10
723#define MSESTAT_ENA 0x08
724#define MSESTAT_RXP 0x04
725#define MSESTAT_MSD 0x02
726#define MSESTAT_MSC 0x01
727
728#define MSECLKDIV_DivVal Fld(4,0)
729
730#define KBDTEST1_CD 0x80
731#define KBDTEST1_RC1 0x40
732#define KBDTEST1_MC 0x20
733#define KBDTEST1_C Fld(2,3)
734#define KBDTEST1_T2 0x40
735#define KBDTEST1_T1 0x20
736#define KBDTEST1_T0 0x10
737#define KBDTEST2_TICBnRES 0x08
738#define KBDTEST2_RKC 0x04
739#define KBDTEST2_RKD 0x02
740#define KBDTEST2_SEL 0x01
741#define KBDTEST3_ms_16 0x80
742#define KBDTEST3_us_64 0x40
743#define KBDTEST3_us_16 0x20
744#define KBDTEST3_DIV8 0x10
745#define KBDTEST3_DIn 0x08
746#define KBDTEST3_CIn 0x04
747#define KBDTEST3_KD 0x02
748#define KBDTEST3_KC 0x01
749#define KBDTEST4_BC12 0x80
750#define KBDTEST4_BC11 0x40
751#define KBDTEST4_TRES 0x20
752#define KBDTEST4_CLKOE 0x10
753#define KBDTEST4_CRES 0x08
754#define KBDTEST4_RXB 0x04
755#define KBDTEST4_TXB 0x02
756#define KBDTEST4_SRX 0x01
757
758#define MSETEST1_CD 0x80
759#define MSETEST1_RC1 0x40
760#define MSETEST1_MC 0x20
761#define MSETEST1_C Fld(2,3)
762#define MSETEST1_T2 0x40
763#define MSETEST1_T1 0x20
764#define MSETEST1_T0 0x10
765#define MSETEST2_TICBnRES 0x08
766#define MSETEST2_RKC 0x04
767#define MSETEST2_RKD 0x02
768#define MSETEST2_SEL 0x01
769#define MSETEST3_ms_16 0x80
770#define MSETEST3_us_64 0x40
771#define MSETEST3_us_16 0x20
772#define MSETEST3_DIV8 0x10
773#define MSETEST3_DIn 0x08
774#define MSETEST3_CIn 0x04
775#define MSETEST3_KD 0x02
776#define MSETEST3_KC 0x01
777#define MSETEST4_BC12 0x80
778#define MSETEST4_BC11 0x40
779#define MSETEST4_TRES 0x20
780#define MSETEST4_CLKOE 0x10
781#define MSETEST4_CRES 0x08
782#define MSETEST4_RXB 0x04
783#define MSETEST4_TXB 0x02
784#define MSETEST4_SRX 0x01
785
786#endif /* LANGUAGE == C */
787
788
789/*
790 * General-Purpose I/O Interface
791 *
792 * Registers
793 * PADWR Port A Data Write Register
794 * PBDWR Port B Data Write Register
795 * PADRR Port A Data Read Register
796 * PBDRR Port B Data Read Register
797 * PADDR Port A Data Direction Register
798 * PBDDR Port B Data Direction Register
799 * PASSR Port A Sleep State Register
800 * PBSSR Port B Sleep State Register
801 *
802 */
803
804#define _PIO( x ) _SA1101( ( x ) + __GPIO_INTERFACE )
805
806#define _PADWR _PIO( 0x0000 )
807#define _PBDWR _PIO( 0x0400 )
808#define _PADRR _PIO( 0x0000 )
809#define _PBDRR _PIO( 0x0400 )
810#define _PADDR _PIO( 0x0800 )
811#define _PBDDR _PIO( 0x0c00 )
812#define _PASSR _PIO( 0x1000 )
813#define _PBSSR _PIO( 0x1400 )
814
815
816#if ( LANGUAGE == C )
817
818
819#define PADWR (*((volatile Word *) SA1101_p2v (_PADWR)))
820#define PBDWR (*((volatile Word *) SA1101_p2v (_PBDWR)))
821#define PADRR (*((volatile Word *) SA1101_p2v (_PADRR)))
822#define PBDRR (*((volatile Word *) SA1101_p2v (_PBDRR)))
823#define PADDR (*((volatile Word *) SA1101_p2v (_PADDR)))
824#define PBDDR (*((volatile Word *) SA1101_p2v (_PBDDR)))
825#define PASSR (*((volatile Word *) SA1101_p2v (_PASSR)))
826#define PBSSR (*((volatile Word *) SA1101_p2v (_PBSSR)))
827
828#endif
829
830
831
832/*
833 * Keypad Interface
834 *
835 * Registers
836 * PXDWR
837 * PXDRR
838 * PYDWR
839 * PYDRR
840 *
841 */
842
843#define _KEYPAD( x ) _SA1101( ( x ) + __KEYPAD_INTERFACE )
844
845#define _PXDWR _KEYPAD( 0x0000 )
846#define _PXDRR _KEYPAD( 0x0000 )
847#define _PYDWR _KEYPAD( 0x0400 )
848#define _PYDRR _KEYPAD( 0x0400 )
849
850#if ( LANGUAGE == C )
851
852
853#define PXDWR (*((volatile Word *) SA1101_p2v (_PXDWR)))
854#define PXDRR (*((volatile Word *) SA1101_p2v (_PXDRR)))
855#define PYDWR (*((volatile Word *) SA1101_p2v (_PYDWR)))
856#define PYDRR (*((volatile Word *) SA1101_p2v (_PYDRR)))
857
858#endif
859
860
861
862/*
863 * PCMCIA Interface
864 *
865 * Registers
866 * PCSR Status Register
867 * PCCR Control Register
868 * PCSSR Sleep State Register
869 *
870 */
871
872#define _CARD( x ) _SA1101( ( x ) + __PCMCIA_INTERFACE )
873
874#define _PCSR _CARD( 0x0000 )
875#define _PCCR _CARD( 0x0400 )
876#define _PCSSR _CARD( 0x0800 )
877
878#if ( LANGUAGE == C )
879#define PCSR (*((volatile Word *) SA1101_p2v (_PCSR)))
880#define PCCR (*((volatile Word *) SA1101_p2v (_PCCR)))
881#define PCSSR (*((volatile Word *) SA1101_p2v (_PCSSR)))
882
883#define PCSR_S0_ready 0x0001
884#define PCSR_S1_ready 0x0002
885#define PCSR_S0_detected 0x0004
886#define PCSR_S1_detected 0x0008
887#define PCSR_S0_VS1 0x0010
888#define PCSR_S0_VS2 0x0020
889#define PCSR_S1_VS1 0x0040
890#define PCSR_S1_VS2 0x0080
891#define PCSR_S0_WP 0x0100
892#define PCSR_S1_WP 0x0200
893#define PCSR_S0_BVD1_nSTSCHG 0x0400
894#define PCSR_S0_BVD2_nSPKR 0x0800
895#define PCSR_S1_BVD1_nSTSCHG 0x1000
896#define PCSR_S1_BVD2_nSPKR 0x2000
897
898#define PCCR_S0_VPP0 0x0001
899#define PCCR_S0_VPP1 0x0002
900#define PCCR_S0_VCC0 0x0004
901#define PCCR_S0_VCC1 0x0008
902#define PCCR_S1_VPP0 0x0010
903#define PCCR_S1_VPP1 0x0020
904#define PCCR_S1_VCC0 0x0040
905#define PCCR_S1_VCC1 0x0080
906#define PCCR_S0_reset 0x0100
907#define PCCR_S1_reset 0x0200
908#define PCCR_S0_float 0x0400
909#define PCCR_S1_float 0x0800
910
911#define PCSSR_S0_VCC0 0x0001
912#define PCSSR_S0_VCC1 0x0002
913#define PCSSR_S0_VPP0 0x0004
914#define PCSSR_S0_VPP1 0x0008
915#define PCSSR_S0_control 0x0010
916#define PCSSR_S1_VCC0 0x0020
917#define PCSSR_S1_VCC1 0x0040
918#define PCSSR_S1_VPP0 0x0080
919#define PCSSR_S1_VPP1 0x0100
920#define PCSSR_S1_control 0x0200
921
922#endif
923
924#undef C
925#undef Assembly
diff --git a/include/asm-arm/arch-sa1100/SA-1111.h b/include/asm-arm/arch-sa1100/SA-1111.h
new file mode 100644
index 000000000000..c38f60915cb6
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/SA-1111.h
@@ -0,0 +1,5 @@
1/*
2 * Moved to new location
3 */
4#warning using old SA-1111.h - update to <asm/hardware/sa1111.h>
5#include <asm/hardware/sa1111.h>
diff --git a/include/asm-arm/arch-sa1100/assabet.h b/include/asm-arm/arch-sa1100/assabet.h
new file mode 100644
index 000000000000..1f59b368c3f6
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/assabet.h
@@ -0,0 +1,106 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/assabet.h
3 *
4 * Created 2000/06/05 by Nicolas Pitre <nico@cam.org>
5 *
6 * This file contains the hardware specific definitions for Assabet
7 * Only include this file from SA1100-specific files.
8 *
9 * 2000/05/23 John Dorsey <john+@cs.cmu.edu>
10 * Definitions for Neponset added.
11 */
12#ifndef __ASM_ARCH_ASSABET_H
13#define __ASM_ARCH_ASSABET_H
14
15#include <linux/config.h>
16
17/* System Configuration Register flags */
18
19#define ASSABET_SCR_SDRAM_LOW (1<<2) /* SDRAM size (low bit) */
20#define ASSABET_SCR_SDRAM_HIGH (1<<3) /* SDRAM size (high bit) */
21#define ASSABET_SCR_FLASH_LOW (1<<4) /* Flash size (low bit) */
22#define ASSABET_SCR_FLASH_HIGH (1<<5) /* Flash size (high bit) */
23#define ASSABET_SCR_GFX (1<<8) /* Graphics Accelerator (0 = present) */
24#define ASSABET_SCR_SA1111 (1<<9) /* Neponset (0 = present) */
25
26#define ASSABET_SCR_INIT -1
27
28extern unsigned long SCR_value;
29
30#ifdef CONFIG_ASSABET_NEPONSET
31#define machine_has_neponset() ((SCR_value & ASSABET_SCR_SA1111) == 0)
32#else
33#define machine_has_neponset() (0)
34#endif
35
36/* Board Control Register */
37
38#define ASSABET_BCR_BASE 0xf1000000
39#define ASSABET_BCR (*(volatile unsigned int *)(ASSABET_BCR_BASE))
40
41#define ASSABET_BCR_CF_PWR (1<<0) /* Compact Flash Power (1 = 3.3v, 0 = off) */
42#define ASSABET_BCR_CF_RST (1<<1) /* Compact Flash Reset (1 = power up reset) */
43#define ASSABET_BCR_GFX_RST (1<<1) /* Graphics Accelerator Reset (0 = hold reset) */
44#define ASSABET_BCR_CODEC_RST (1<<2) /* 0 = Holds UCB1300, ADI7171, and UDA1341 in reset */
45#define ASSABET_BCR_IRDA_FSEL (1<<3) /* IRDA Frequency select (0 = SIR, 1 = MIR/ FIR) */
46#define ASSABET_BCR_IRDA_MD0 (1<<4) /* Range/Power select */
47#define ASSABET_BCR_IRDA_MD1 (1<<5) /* Range/Power select */
48#define ASSABET_BCR_STEREO_LB (1<<6) /* Stereo Loopback */
49#define ASSABET_BCR_CF_BUS_OFF (1<<7) /* Compact Flash bus (0 = on, 1 = off (float)) */
50#define ASSABET_BCR_AUDIO_ON (1<<8) /* Audio power on */
51#define ASSABET_BCR_LIGHT_ON (1<<9) /* Backlight */
52#define ASSABET_BCR_LCD_12RGB (1<<10) /* 0 = 16RGB, 1 = 12RGB */
53#define ASSABET_BCR_LCD_ON (1<<11) /* LCD power on */
54#define ASSABET_BCR_RS232EN (1<<12) /* RS232 transceiver enable */
55#define ASSABET_BCR_LED_RED (1<<13) /* D9 (0 = on, 1 = off) */
56#define ASSABET_BCR_LED_GREEN (1<<14) /* D8 (0 = on, 1 = off) */
57#define ASSABET_BCR_VIB_ON (1<<15) /* Vibration motor (quiet alert) */
58#define ASSABET_BCR_COM_DTR (1<<16) /* COMport Data Terminal Ready */
59#define ASSABET_BCR_COM_RTS (1<<17) /* COMport Request To Send */
60#define ASSABET_BCR_RAD_WU (1<<18) /* Radio wake up interrupt */
61#define ASSABET_BCR_SMB_EN (1<<19) /* System management bus enable */
62#define ASSABET_BCR_TV_IR_DEC (1<<20) /* TV IR Decode Enable (not implemented) */
63#define ASSABET_BCR_QMUTE (1<<21) /* Quick Mute */
64#define ASSABET_BCR_RAD_ON (1<<22) /* Radio Power On */
65#define ASSABET_BCR_SPK_OFF (1<<23) /* 1 = Speaker amplifier power off */
66
67#ifdef CONFIG_SA1100_ASSABET
68extern void ASSABET_BCR_frob(unsigned int mask, unsigned int set);
69#else
70#define ASSABET_BCR_frob(x,y) do { } while (0)
71#endif
72
73#define ASSABET_BCR_set(x) ASSABET_BCR_frob((x), (x))
74#define ASSABET_BCR_clear(x) ASSABET_BCR_frob((x), 0)
75
76#define ASSABET_BSR_BASE 0xf1000000
77#define ASSABET_BSR (*(volatile unsigned int*)(ASSABET_BSR_BASE))
78
79#define ASSABET_BSR_RS232_VALID (1 << 24)
80#define ASSABET_BSR_COM_DCD (1 << 25)
81#define ASSABET_BSR_COM_CTS (1 << 26)
82#define ASSABET_BSR_COM_DSR (1 << 27)
83#define ASSABET_BSR_RAD_CTS (1 << 28)
84#define ASSABET_BSR_RAD_DSR (1 << 29)
85#define ASSABET_BSR_RAD_DCD (1 << 30)
86#define ASSABET_BSR_RAD_RI (1 << 31)
87
88
89/* GPIOs for which the generic definition doesn't say much */
90#define ASSABET_GPIO_RADIO_IRQ GPIO_GPIO (14) /* Radio interrupt request */
91#define ASSABET_GPIO_PS_MODE_SYNC GPIO_GPIO (16) /* Power supply mode/sync */
92#define ASSABET_GPIO_STEREO_64FS_CLK GPIO_GPIO (19) /* SSP UDA1341 clock input */
93#define ASSABET_GPIO_CF_IRQ GPIO_GPIO (21) /* CF IRQ */
94#define ASSABET_GPIO_CF_CD GPIO_GPIO (22) /* CF CD */
95#define ASSABET_GPIO_CF_BVD2 GPIO_GPIO (24) /* CF BVD */
96#define ASSABET_GPIO_GFX_IRQ GPIO_GPIO (24) /* Graphics IRQ */
97#define ASSABET_GPIO_CF_BVD1 GPIO_GPIO (25) /* CF BVD */
98#define ASSABET_GPIO_BATT_LOW GPIO_GPIO (26) /* Low battery */
99#define ASSABET_GPIO_RCLK GPIO_GPIO (26) /* CCLK/2 */
100
101#define ASSABET_IRQ_GPIO_CF_IRQ IRQ_GPIO21
102#define ASSABET_IRQ_GPIO_CF_CD IRQ_GPIO22
103#define ASSABET_IRQ_GPIO_CF_BVD2 IRQ_GPIO24
104#define ASSABET_IRQ_GPIO_CF_BVD1 IRQ_GPIO25
105
106#endif
diff --git a/include/asm-arm/arch-sa1100/badge4.h b/include/asm-arm/arch-sa1100/badge4.h
new file mode 100644
index 000000000000..8d7a671492db
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/badge4.h
@@ -0,0 +1,75 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/badge4.h
3 *
4 * Tim Connors <connors@hpl.hp.com>
5 * Christopher Hoover <ch@hpl.hp.com>
6 *
7 * Copyright (C) 2002 Hewlett-Packard Company
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#ifndef __ASM_ARCH_HARDWARE_H
16#error "include <asm/hardware.h> instead"
17#endif
18
19#define BADGE4_SA1111_BASE (0x48000000)
20
21/* GPIOs on the BadgePAD 4 */
22#define BADGE4_GPIO_INT_1111 GPIO_GPIO0 /* SA-1111 IRQ */
23
24#define BADGE4_GPIO_INT_VID GPIO_GPIO1 /* Video expansion */
25#define BADGE4_GPIO_LGP2 GPIO_GPIO2 /* GPIO_LDD8 */
26#define BADGE4_GPIO_LGP3 GPIO_GPIO3 /* GPIO_LDD9 */
27#define BADGE4_GPIO_LGP4 GPIO_GPIO4 /* GPIO_LDD10 */
28#define BADGE4_GPIO_LGP5 GPIO_GPIO5 /* GPIO_LDD11 */
29#define BADGE4_GPIO_LGP6 GPIO_GPIO6 /* GPIO_LDD12 */
30#define BADGE4_GPIO_LGP7 GPIO_GPIO7 /* GPIO_LDD13 */
31#define BADGE4_GPIO_LGP8 GPIO_GPIO8 /* GPIO_LDD14 */
32#define BADGE4_GPIO_LGP9 GPIO_GPIO9 /* GPIO_LDD15 */
33#define BADGE4_GPIO_GPA_VID GPIO_GPIO10 /* Video expansion */
34#define BADGE4_GPIO_GPB_VID GPIO_GPIO11 /* Video expansion */
35#define BADGE4_GPIO_GPC_VID GPIO_GPIO12 /* Video expansion */
36
37#define BADGE4_GPIO_UART_HS1 GPIO_GPIO13
38#define BADGE4_GPIO_UART_HS2 GPIO_GPIO14
39
40#define BADGE4_GPIO_MUXSEL0 GPIO_GPIO15
41#define BADGE4_GPIO_TESTPT_J7 GPIO_GPIO16
42
43#define BADGE4_GPIO_SDSDA GPIO_GPIO17 /* SDRAM SPD Data */
44#define BADGE4_GPIO_SDSCL GPIO_GPIO18 /* SDRAM SPD Clock */
45#define BADGE4_GPIO_SDTYP0 GPIO_GPIO19 /* SDRAM Type Control */
46#define BADGE4_GPIO_SDTYP1 GPIO_GPIO20 /* SDRAM Type Control */
47
48#define BADGE4_GPIO_BGNT_1111 GPIO_GPIO21 /* GPIO_MBGNT */
49#define BADGE4_GPIO_BREQ_1111 GPIO_GPIO22 /* GPIO_TREQA */
50
51#define BADGE4_GPIO_TESTPT_J6 GPIO_GPIO23
52
53#define BADGE4_GPIO_PCMEN5V GPIO_GPIO24 /* 5V power */
54
55#define BADGE4_GPIO_SA1111_NRST GPIO_GPIO25 /* SA-1111 nRESET */
56
57#define BADGE4_GPIO_TESTPT_J5 GPIO_GPIO26
58
59#define BADGE4_GPIO_CLK_1111 GPIO_GPIO27 /* GPIO_32_768kHz */
60
61/* Interrupts on the BadgePAD 4 */
62#define BADGE4_IRQ_GPIO_SA1111 IRQ_GPIO0 /* SA-1111 interrupt */
63
64
65/* PCM5ENV Usage tracking */
66
67#define BADGE4_5V_PCMCIA_SOCK0 (1<<0)
68#define BADGE4_5V_PCMCIA_SOCK1 (1<<1)
69#define BADGE4_5V_PCMCIA_SOCK(n) (1<<(n))
70#define BADGE4_5V_USB (1<<2)
71#define BADGE4_5V_INITIALLY (1<<3)
72
73#ifndef __ASSEMBLY__
74extern void badge4_set_5V(unsigned subsystem, int on);
75#endif
diff --git a/include/asm-arm/arch-sa1100/bitfield.h b/include/asm-arm/arch-sa1100/bitfield.h
new file mode 100644
index 000000000000..f1f0e3387d9c
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/bitfield.h
@@ -0,0 +1,113 @@
1/*
2 * FILE bitfield.h
3 *
4 * Version 1.1
5 * Author Copyright (c) Marc A. Viredaz, 1998
6 * DEC Western Research Laboratory, Palo Alto, CA
7 * Date April 1998 (April 1997)
8 * System Advanced RISC Machine (ARM)
9 * Language C or ARM Assembly
10 * Purpose Definition of macros to operate on bit fields.
11 */
12
13
14
15#ifndef __BITFIELD_H
16#define __BITFIELD_H
17
18#ifndef __ASSEMBLY__
19#define UData(Data) ((unsigned long) (Data))
20#else
21#define UData(Data) (Data)
22#endif
23
24
25/*
26 * MACRO: Fld
27 *
28 * Purpose
29 * The macro "Fld" encodes a bit field, given its size and its shift value
30 * with respect to bit 0.
31 *
32 * Note
33 * A more intuitive way to encode bit fields would have been to use their
34 * mask. However, extracting size and shift value information from a bit
35 * field's mask is cumbersome and might break the assembler (255-character
36 * line-size limit).
37 *
38 * Input
39 * Size Size of the bit field, in number of bits.
40 * Shft Shift value of the bit field with respect to bit 0.
41 *
42 * Output
43 * Fld Encoded bit field.
44 */
45
46#define Fld(Size, Shft) (((Size) << 16) + (Shft))
47
48
49/*
50 * MACROS: FSize, FShft, FMsk, FAlnMsk, F1stBit
51 *
52 * Purpose
53 * The macros "FSize", "FShft", "FMsk", "FAlnMsk", and "F1stBit" return
54 * the size, shift value, mask, aligned mask, and first bit of a
55 * bit field.
56 *
57 * Input
58 * Field Encoded bit field (using the macro "Fld").
59 *
60 * Output
61 * FSize Size of the bit field, in number of bits.
62 * FShft Shift value of the bit field with respect to bit 0.
63 * FMsk Mask for the bit field.
64 * FAlnMsk Mask for the bit field, aligned on bit 0.
65 * F1stBit First bit of the bit field.
66 */
67
68#define FSize(Field) ((Field) >> 16)
69#define FShft(Field) ((Field) & 0x0000FFFF)
70#define FMsk(Field) (((UData (1) << FSize (Field)) - 1) << FShft (Field))
71#define FAlnMsk(Field) ((UData (1) << FSize (Field)) - 1)
72#define F1stBit(Field) (UData (1) << FShft (Field))
73
74
75/*
76 * MACRO: FInsrt
77 *
78 * Purpose
79 * The macro "FInsrt" inserts a value into a bit field by shifting the
80 * former appropriately.
81 *
82 * Input
83 * Value Bit-field value.
84 * Field Encoded bit field (using the macro "Fld").
85 *
86 * Output
87 * FInsrt Bit-field value positioned appropriately.
88 */
89
90#define FInsrt(Value, Field) \
91 (UData (Value) << FShft (Field))
92
93
94/*
95 * MACRO: FExtr
96 *
97 * Purpose
98 * The macro "FExtr" extracts the value of a bit field by masking and
99 * shifting it appropriately.
100 *
101 * Input
102 * Data Data containing the bit-field to be extracted.
103 * Field Encoded bit field (using the macro "Fld").
104 *
105 * Output
106 * FExtr Bit-field value.
107 */
108
109#define FExtr(Data, Field) \
110 ((UData (Data) >> FShft (Field)) & FAlnMsk (Field))
111
112
113#endif /* __BITFIELD_H */
diff --git a/include/asm-arm/arch-sa1100/cerf.h b/include/asm-arm/arch-sa1100/cerf.h
new file mode 100644
index 000000000000..356d5ba88991
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/cerf.h
@@ -0,0 +1,29 @@
1/*
2 * include/asm-arm/arch-sa1100/cerf.h
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 */
10#ifndef _INCLUDE_CERF_H_
11#define _INCLUDE_CERF_H_
12
13#include <linux/config.h>
14
15#define CERF_ETH_IO 0xf0000000
16#define CERF_ETH_IRQ IRQ_GPIO26
17
18#define CERF_GPIO_CF_BVD2 GPIO_GPIO (19)
19#define CERF_GPIO_CF_BVD1 GPIO_GPIO (20)
20#define CERF_GPIO_CF_RESET GPIO_GPIO (21)
21#define CERF_GPIO_CF_IRQ GPIO_GPIO (22)
22#define CERF_GPIO_CF_CD GPIO_GPIO (23)
23
24#define CERF_IRQ_GPIO_CF_BVD2 IRQ_GPIO19
25#define CERF_IRQ_GPIO_CF_BVD1 IRQ_GPIO20
26#define CERF_IRQ_GPIO_CF_IRQ IRQ_GPIO22
27#define CERF_IRQ_GPIO_CF_CD IRQ_GPIO23
28
29#endif // _INCLUDE_CERF_H_
diff --git a/include/asm-arm/arch-sa1100/collie.h b/include/asm-arm/arch-sa1100/collie.h
new file mode 100644
index 000000000000..d49e5ff63ca4
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/collie.h
@@ -0,0 +1,85 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/collie.h
3 *
4 * This file contains the hardware specific definitions for Assabet
5 * Only include this file from SA1100-specific files.
6 *
7 * ChangeLog:
8 * 04-06-2001 Lineo Japan, Inc.
9 * 04-16-2001 SHARP Corporation
10 * 07-07-2002 Chris Larson <clarson@digi.com>
11 *
12 */
13#ifndef __ASM_ARCH_COLLIE_H
14#define __ASM_ARCH_COLLIE_H
15
16#include <linux/config.h>
17
18#define COLLIE_SCP_CHARGE_ON SCOOP_GPCR_PA11
19#define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12
20#define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13
21#define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14
22#define COLLIE_SCP_MUTE_R SCOOP_GPCR_PA15
23#define COLLIE_SCP_5VON SCOOP_GPCR_PA16
24#define COLLIE_SCP_AMP_ON SCOOP_GPCR_PA17
25#define COLLIE_SCP_VPEN SCOOP_GPCR_PA18
26#define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19
27
28#define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_CHARGE_ON | COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \
29 COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | COLLIE_SCP_VPEN | \
30 COLLIE_SCP_LB_VOL_CHG )
31#define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | COLLIE_SCP_VPEN | \
32 COLLIE_SCP_CHARGE_ON )
33
34/* GPIOs for which the generic definition doesn't say much */
35
36#define COLLIE_GPIO_ON_KEY GPIO_GPIO (0)
37#define COLLIE_GPIO_AC_IN GPIO_GPIO (1)
38#define COLLIE_GPIO_CF_IRQ GPIO_GPIO (14)
39#define COLLIE_GPIO_nREMOCON_INT GPIO_GPIO (15)
40#define COLLIE_GPIO_UCB1x00_RESET GPIO_GPIO (16)
41#define COLLIE_GPIO_CO GPIO_GPIO (20)
42#define COLLIE_GPIO_MCP_CLK GPIO_GPIO (21)
43#define COLLIE_GPIO_CF_CD GPIO_GPIO (22)
44#define COLLIE_GPIO_UCB1x00_IRQ GPIO_GPIO (23)
45#define COLLIE_GPIO_WAKEUP GPIO_GPIO (24)
46#define COLLIE_GPIO_GA_INT GPIO_GPIO (25)
47#define COLLIE_GPIO_MAIN_BAT_LOW GPIO_GPIO (26)
48
49/* Interrupts */
50
51#define COLLIE_IRQ_GPIO_ON_KEY IRQ_GPIO0
52#define COLLIE_IRQ_GPIO_AC_IN IRQ_GPIO1
53#define COLLIE_IRQ_GPIO_CF_IRQ IRQ_GPIO14
54#define COLLIE_IRQ_GPIO_nREMOCON_INT IRQ_GPIO15
55#define COLLIE_IRQ_GPIO_CO IRQ_GPIO20
56#define COLLIE_IRQ_GPIO_CF_CD IRQ_GPIO22
57#define COLLIE_IRQ_GPIO_UCB1x00_IRQ IRQ_GPIO23
58#define COLLIE_IRQ_GPIO_WAKEUP IRQ_GPIO24
59#define COLLIE_IRQ_GPIO_GA_INT IRQ_GPIO25
60#define COLLIE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO26
61
62#define COLLIE_LCM_IRQ_GPIO_RTS IRQ_LOCOMO_GPIO0
63#define COLLIE_LCM_IRQ_GPIO_CTS IRQ_LOCOMO_GPIO1
64#define COLLIE_LCM_IRQ_GPIO_DSR IRQ_LOCOMO_GPIO2
65#define COLLIE_LCM_IRQ_GPIO_DTR IRQ_LOCOMO_GPIO3
66#define COLLIE_LCM_IRQ_GPIO_nSD_DETECT IRQ_LOCOMO_GPIO13
67#define COLLIE_LCM_IRQ_GPIO_nSD_WP IRQ_LOCOMO_GPIO14
68
69/* GPIO's on the TC35143AF (Toshiba Analog Frontend) */
70#define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0 /* GPIO0=Version */
71#define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1 /* GPIO1=TBL_CHK */
72#define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2 /* GPIO2=VPNE_ON */
73#define COLLIE_TC35143_GPIO_IR_ON UCB_IO_3 /* GPIO3=IR_ON */
74#define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4 /* GPIO4=AMP_ON */
75#define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5 /* GPIO5=Version */
76#define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5 /* GPIO5=fs 8k LPF */
77#define COLLIE_TC35143_GPIO_BUZZER_BIAS UCB_IO_6 /* GPIO6=BUZZER BIAS */
78#define COLLIE_TC35143_GPIO_MBAT_ON UCB_IO_7 /* GPIO7=MBAT_ON */
79#define COLLIE_TC35143_GPIO_BBAT_ON UCB_IO_8 /* GPIO8=BBAT_ON */
80#define COLLIE_TC35143_GPIO_TMP_ON UCB_IO_9 /* GPIO9=TMP_ON */
81#define COLLIE_TC35143_GPIO_IN ( UCB_IO_0 | UCB_IO_2 | UCB_IO_5 )
82#define COLLIE_TC35143_GPIO_OUT ( UCB_IO_1 | UCB_IO_3 | UCB_IO_4 | UCB_IO_6 | \
83 UCB_IO_7 | UCB_IO_8 | UCB_IO_9 )
84
85#endif
diff --git a/include/asm-arm/arch-sa1100/debug-macro.S b/include/asm-arm/arch-sa1100/debug-macro.S
new file mode 100644
index 000000000000..755fa3453862
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/debug-macro.S
@@ -0,0 +1,57 @@
1/* linux/include/asm-arm/arch-sa1100/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled?
17 moveq \rx, #0x80000000 @ physical base address
18 movne \rx, #0xf8000000 @ virtual address
19
20 @ We probe for the active serial port here, coherently with
21 @ the comment in include/asm-arm/arch-sa1100/uncompress.h.
22 @ We assume r1 can be clobbered.
23
24 @ see if Ser3 is active
25 add \rx, \rx, #0x00050000
26 ldr r1, [\rx, #UTCR3]
27 tst r1, #UTCR3_TXE
28
29 @ if Ser3 is inactive, then try Ser1
30 addeq \rx, \rx, #(0x00010000 - 0x00050000)
31 ldreq r1, [\rx, #UTCR3]
32 tsteq r1, #UTCR3_TXE
33
34 @ if Ser1 is inactive, then try Ser2
35 addeq \rx, \rx, #(0x00030000 - 0x00010000)
36 ldreq r1, [\rx, #UTCR3]
37 tsteq r1, #UTCR3_TXE
38
39 @ if all ports are inactive, then there is nothing we can do
40 moveq pc, lr
41 .endm
42
43 .macro senduart,rd,rx
44 str \rd, [\rx, #UTDR]
45 .endm
46
47 .macro waituart,rd,rx
481001: ldr \rd, [\rx, #UTSR1]
49 tst \rd, #UTSR1_TNF
50 beq 1001b
51 .endm
52
53 .macro busyuart,rd,rx
541001: ldr \rd, [\rx, #UTSR1]
55 tst \rd, #UTSR1_TBY
56 bne 1001b
57 .endm
diff --git a/include/asm-arm/arch-sa1100/dma.h b/include/asm-arm/arch-sa1100/dma.h
new file mode 100644
index 000000000000..3d60ed9f8c34
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/dma.h
@@ -0,0 +1,132 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/dma.h
3 *
4 * Generic SA1100 DMA support
5 *
6 * Copyright (C) 2000 Nicolas Pitre
7 *
8 */
9
10#ifndef __ASM_ARCH_DMA_H
11#define __ASM_ARCH_DMA_H
12
13#include <linux/config.h>
14#include "hardware.h"
15
16
17/*
18 * This is the maximum DMA address that can be DMAd to.
19 */
20#define MAX_DMA_ADDRESS 0xffffffff
21
22
23/*
24 * The regular generic DMA interface is inappropriate for the
25 * SA1100 DMA model. None of the SA1100 specific drivers using
26 * DMA are portable anyway so it's pointless to try to twist the
27 * regular DMA API to accommodate them.
28 */
29#define MAX_DMA_CHANNELS 0
30
31/*
32 * The SA1100 has six internal DMA channels.
33 */
34#define SA1100_DMA_CHANNELS 6
35
36/*
37 * Maximum physical DMA buffer size
38 */
39#define MAX_DMA_SIZE 0x1fff
40#define CUT_DMA_SIZE 0x1000
41
42/*
43 * All possible SA1100 devices a DMA channel can be attached to.
44 */
45typedef enum {
46 DMA_Ser0UDCWr = DDAR_Ser0UDCWr, /* Ser. port 0 UDC Write */
47 DMA_Ser0UDCRd = DDAR_Ser0UDCRd, /* Ser. port 0 UDC Read */
48 DMA_Ser1UARTWr = DDAR_Ser1UARTWr, /* Ser. port 1 UART Write */
49 DMA_Ser1UARTRd = DDAR_Ser1UARTRd, /* Ser. port 1 UART Read */
50 DMA_Ser1SDLCWr = DDAR_Ser1SDLCWr, /* Ser. port 1 SDLC Write */
51 DMA_Ser1SDLCRd = DDAR_Ser1SDLCRd, /* Ser. port 1 SDLC Read */
52 DMA_Ser2UARTWr = DDAR_Ser2UARTWr, /* Ser. port 2 UART Write */
53 DMA_Ser2UARTRd = DDAR_Ser2UARTRd, /* Ser. port 2 UART Read */
54 DMA_Ser2HSSPWr = DDAR_Ser2HSSPWr, /* Ser. port 2 HSSP Write */
55 DMA_Ser2HSSPRd = DDAR_Ser2HSSPRd, /* Ser. port 2 HSSP Read */
56 DMA_Ser3UARTWr = DDAR_Ser3UARTWr, /* Ser. port 3 UART Write */
57 DMA_Ser3UARTRd = DDAR_Ser3UARTRd, /* Ser. port 3 UART Read */
58 DMA_Ser4MCP0Wr = DDAR_Ser4MCP0Wr, /* Ser. port 4 MCP 0 Write (audio) */
59 DMA_Ser4MCP0Rd = DDAR_Ser4MCP0Rd, /* Ser. port 4 MCP 0 Read (audio) */
60 DMA_Ser4MCP1Wr = DDAR_Ser4MCP1Wr, /* Ser. port 4 MCP 1 Write */
61 DMA_Ser4MCP1Rd = DDAR_Ser4MCP1Rd, /* Ser. port 4 MCP 1 Read */
62 DMA_Ser4SSPWr = DDAR_Ser4SSPWr, /* Ser. port 4 SSP Write (16 bits) */
63 DMA_Ser4SSPRd = DDAR_Ser4SSPRd /* Ser. port 4 SSP Read (16 bits) */
64} dma_device_t;
65
66typedef struct {
67 volatile u_long DDAR;
68 volatile u_long SetDCSR;
69 volatile u_long ClrDCSR;
70 volatile u_long RdDCSR;
71 volatile dma_addr_t DBSA;
72 volatile u_long DBTA;
73 volatile dma_addr_t DBSB;
74 volatile u_long DBTB;
75} dma_regs_t;
76
77typedef void (*dma_callback_t)(void *data);
78
79/*
80 * DMA function prototypes
81 */
82
83extern int sa1100_request_dma( dma_device_t device, const char *device_id,
84 dma_callback_t callback, void *data,
85 dma_regs_t **regs );
86extern void sa1100_free_dma( dma_regs_t *regs );
87extern int sa1100_start_dma( dma_regs_t *regs, dma_addr_t dma_ptr, u_int size );
88extern dma_addr_t sa1100_get_dma_pos(dma_regs_t *regs);
89extern void sa1100_reset_dma(dma_regs_t *regs);
90
91/**
92 * sa1100_stop_dma - stop DMA in progress
93 * @regs: identifier for the channel to use
94 *
95 * This stops DMA without clearing buffer pointers. Unlike
96 * sa1100_clear_dma() this allows subsequent use of sa1100_resume_dma()
97 * or sa1100_get_dma_pos().
98 *
99 * The @regs identifier is provided by a successful call to
100 * sa1100_request_dma().
101 **/
102
103#define sa1100_stop_dma(regs) ((regs)->ClrDCSR = DCSR_IE|DCSR_RUN)
104
105/**
106 * sa1100_resume_dma - resume DMA on a stopped channel
107 * @regs: identifier for the channel to use
108 *
109 * This resumes DMA on a channel previously stopped with
110 * sa1100_stop_dma().
111 *
112 * The @regs identifier is provided by a successful call to
113 * sa1100_request_dma().
114 **/
115
116#define sa1100_resume_dma(regs) ((regs)->SetDCSR = DCSR_IE|DCSR_RUN)
117
118/**
119 * sa1100_clear_dma - clear DMA pointers
120 * @regs: identifier for the channel to use
121 *
122 * This clear any DMA state so the DMA engine is ready to restart
123 * with new buffers through sa1100_start_dma(). Any buffers in flight
124 * are discarded.
125 *
126 * The @regs identifier is provided by a successful call to
127 * sa1100_request_dma().
128 **/
129
130#define sa1100_clear_dma(regs) ((regs)->ClrDCSR = DCSR_IE|DCSR_RUN|DCSR_STRTA|DCSR_STRTB)
131
132#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-sa1100/entry-macro.S b/include/asm-arm/arch-sa1100/entry-macro.S
new file mode 100644
index 000000000000..51fb50ce1169
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/entry-macro.S
@@ -0,0 +1,41 @@
1/*
2 * include/asm-arm/arch-sa1100/entry-macro.S
3 *
4 * Low-level IRQ helper macros for SA1100-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11 .macro disable_fiq
12 .endm
13
14 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
15 mov r4, #0xfa000000 @ ICIP = 0xfa050000
16 add r4, r4, #0x00050000
17 ldr \irqstat, [r4] @ get irqs
18 ldr \irqnr, [r4, #4] @ ICMR = 0xfa050004
19 ands \irqstat, \irqstat, \irqnr
20 mov \irqnr, #0
21 beq 1001f
22 tst \irqstat, #0xff
23 moveq \irqstat, \irqstat, lsr #8
24 addeq \irqnr, \irqnr, #8
25 tsteq \irqstat, #0xff
26 moveq \irqstat, \irqstat, lsr #8
27 addeq \irqnr, \irqnr, #8
28 tsteq \irqstat, #0xff
29 moveq \irqstat, \irqstat, lsr #8
30 addeq \irqnr, \irqnr, #8
31 tst \irqstat, #0x0f
32 moveq \irqstat, \irqstat, lsr #4
33 addeq \irqnr, \irqnr, #4
34 tst \irqstat, #0x03
35 moveq \irqstat, \irqstat, lsr #2
36 addeq \irqnr, \irqnr, #2
37 tst \irqstat, #0x01
38 addeqs \irqnr, \irqnr, #1
391001:
40 .endm
41
diff --git a/include/asm-arm/arch-sa1100/h3600.h b/include/asm-arm/arch-sa1100/h3600.h
new file mode 100644
index 000000000000..1b6355971574
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/h3600.h
@@ -0,0 +1,164 @@
1/*
2 *
3 * Definitions for H3600 Handheld Computer
4 *
5 * Copyright 2000 Compaq Computer Corporation.
6 *
7 * Use consistent with the GNU GPL is permitted,
8 * provided that this copyright notice is
9 * preserved in its entirety in all copies and derived works.
10 *
11 * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
12 * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
13 * FITNESS FOR ANY PARTICULAR PURPOSE.
14 *
15 * Author: Jamey Hicks.
16 *
17 * History:
18 *
19 * 2001-10-?? Andrew Christian Added support for iPAQ H3800
20 *
21 */
22
23#ifndef _INCLUDE_H3600_H_
24#define _INCLUDE_H3600_H_
25
26/* generalized support for H3xxx series Compaq Pocket PC's */
27#define machine_is_h3xxx() (machine_is_h3100() || machine_is_h3600() || machine_is_h3800())
28
29/* Physical memory regions corresponding to chip selects */
30#define H3600_EGPIO_PHYS (SA1100_CS5_PHYS + 0x01000000)
31#define H3600_BANK_2_PHYS SA1100_CS2_PHYS
32#define H3600_BANK_4_PHYS SA1100_CS4_PHYS
33
34/* Virtual memory regions corresponding to chip selects 2 & 4 (used on sleeves) */
35#define H3600_EGPIO_VIRT 0xf0000000
36#define H3600_BANK_2_VIRT 0xf1000000
37#define H3600_BANK_4_VIRT 0xf3800000
38
39/*
40 Machine-independent GPIO definitions
41 --- these are common across all current iPAQ platforms
42*/
43
44#define GPIO_H3600_NPOWER_BUTTON GPIO_GPIO (0) /* Also known as the "off button" */
45
46#define GPIO_H3600_PCMCIA_CD1 GPIO_GPIO (10)
47#define GPIO_H3600_PCMCIA_IRQ1 GPIO_GPIO (11)
48
49/* UDA1341 L3 Interface */
50#define GPIO_H3600_L3_DATA GPIO_GPIO (14)
51#define GPIO_H3600_L3_MODE GPIO_GPIO (15)
52#define GPIO_H3600_L3_CLOCK GPIO_GPIO (16)
53
54#define GPIO_H3600_PCMCIA_CD0 GPIO_GPIO (17)
55#define GPIO_H3600_SYS_CLK GPIO_GPIO (19)
56#define GPIO_H3600_PCMCIA_IRQ0 GPIO_GPIO (21)
57
58#define GPIO_H3600_COM_DCD GPIO_GPIO (23)
59#define GPIO_H3600_OPT_IRQ GPIO_GPIO (24)
60#define GPIO_H3600_COM_CTS GPIO_GPIO (25)
61#define GPIO_H3600_COM_RTS GPIO_GPIO (26)
62
63#define IRQ_GPIO_H3600_NPOWER_BUTTON IRQ_GPIO0
64#define IRQ_GPIO_H3600_PCMCIA_CD1 IRQ_GPIO10
65#define IRQ_GPIO_H3600_PCMCIA_IRQ1 IRQ_GPIO11
66#define IRQ_GPIO_H3600_PCMCIA_CD0 IRQ_GPIO17
67#define IRQ_GPIO_H3600_PCMCIA_IRQ0 IRQ_GPIO21
68#define IRQ_GPIO_H3600_COM_DCD IRQ_GPIO23
69#define IRQ_GPIO_H3600_OPT_IRQ IRQ_GPIO24
70#define IRQ_GPIO_H3600_COM_CTS IRQ_GPIO25
71
72
73#ifndef __ASSEMBLY__
74
75enum ipaq_egpio_type {
76 IPAQ_EGPIO_LCD_POWER, /* Power to the LCD panel */
77 IPAQ_EGPIO_CODEC_NRESET, /* Clear to reset the audio codec (remember to return high) */
78 IPAQ_EGPIO_AUDIO_ON, /* Audio power */
79 IPAQ_EGPIO_QMUTE, /* Audio muting */
80 IPAQ_EGPIO_OPT_NVRAM_ON, /* Non-volatile RAM on extension sleeves (SPI interface) */
81 IPAQ_EGPIO_OPT_ON, /* Power to extension sleeves */
82 IPAQ_EGPIO_CARD_RESET, /* Reset PCMCIA cards on extension sleeve (???) */
83 IPAQ_EGPIO_OPT_RESET, /* Reset option pack (???) */
84 IPAQ_EGPIO_IR_ON, /* IR sensor/emitter power */
85 IPAQ_EGPIO_IR_FSEL, /* IR speed selection 1->fast, 0->slow */
86 IPAQ_EGPIO_RS232_ON, /* Maxim RS232 chip power */
87 IPAQ_EGPIO_VPP_ON, /* Turn on power to flash programming */
88 IPAQ_EGPIO_LCD_ENABLE, /* Enable/disable LCD controller */
89};
90
91struct ipaq_model_ops {
92 const char *generic_name;
93 void (*control)(enum ipaq_egpio_type, int);
94 unsigned long (*read)(void);
95 void (*blank_callback)(int blank);
96 int (*pm_callback)(int req); /* Primary model callback */
97 int (*pm_callback_aux)(int req); /* Secondary callback (used by HAL modules) */
98};
99
100extern struct ipaq_model_ops ipaq_model_ops;
101
102static __inline__ const char * h3600_generic_name(void)
103{
104 return ipaq_model_ops.generic_name;
105}
106
107static __inline__ void assign_h3600_egpio(enum ipaq_egpio_type x, int level)
108{
109 if (ipaq_model_ops.control)
110 ipaq_model_ops.control(x,level);
111}
112
113static __inline__ void clr_h3600_egpio(enum ipaq_egpio_type x)
114{
115 if (ipaq_model_ops.control)
116 ipaq_model_ops.control(x,0);
117}
118
119static __inline__ void set_h3600_egpio(enum ipaq_egpio_type x)
120{
121 if (ipaq_model_ops.control)
122 ipaq_model_ops.control(x,1);
123}
124
125static __inline__ unsigned long read_h3600_egpio(void)
126{
127 if (ipaq_model_ops.read)
128 return ipaq_model_ops.read();
129 return 0;
130}
131
132static __inline__ int h3600_register_blank_callback(void (*f)(int))
133{
134 ipaq_model_ops.blank_callback = f;
135 return 0;
136}
137
138static __inline__ void h3600_unregister_blank_callback(void (*f)(int))
139{
140 ipaq_model_ops.blank_callback = NULL;
141}
142
143
144static __inline__ int h3600_register_pm_callback(int (*f)(int))
145{
146 ipaq_model_ops.pm_callback_aux = f;
147 return 0;
148}
149
150static __inline__ void h3600_unregister_pm_callback(int (*f)(int))
151{
152 ipaq_model_ops.pm_callback_aux = NULL;
153}
154
155static __inline__ int h3600_power_management(int req)
156{
157 if (ipaq_model_ops.pm_callback)
158 return ipaq_model_ops.pm_callback(req);
159 return 0;
160}
161
162#endif /* ASSEMBLY */
163
164#endif /* _INCLUDE_H3600_H_ */
diff --git a/include/asm-arm/arch-sa1100/h3600_gpio.h b/include/asm-arm/arch-sa1100/h3600_gpio.h
new file mode 100644
index 000000000000..62b0b7879685
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/h3600_gpio.h
@@ -0,0 +1,540 @@
1/*
2 *
3 * Definitions for H3600 Handheld Computer
4 *
5 * Copyright 2000 Compaq Computer Corporation.
6 *
7 * Use consistent with the GNU GPL is permitted,
8 * provided that this copyright notice is
9 * preserved in its entirety in all copies and derived works.
10 *
11 * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
12 * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
13 * FITNESS FOR ANY PARTICULAR PURPOSE.
14 *
15 * Author: Jamey Hicks.
16 *
17 * History:
18 *
19 * 2001-10-?? Andrew Christian Added support for iPAQ H3800
20 *
21 */
22
23#ifndef _INCLUDE_H3600_GPIO_H_
24#define _INCLUDE_H3600_GPIO_H_
25
26/*
27 * GPIO lines that are common across ALL iPAQ models are in "h3600.h"
28 * This file contains machine-specific definitions
29 */
30
31#define GPIO_H3600_SUSPEND GPIO_GPIO (0)
32/* GPIO[2:9] used by LCD on H3600/3800, used as GPIO on H3100 */
33#define GPIO_H3100_BT_ON GPIO_GPIO (2)
34#define GPIO_H3100_GPIO3 GPIO_GPIO (3)
35#define GPIO_H3100_QMUTE GPIO_GPIO (4)
36#define GPIO_H3100_LCD_3V_ON GPIO_GPIO (5)
37#define GPIO_H3100_AUD_ON GPIO_GPIO (6)
38#define GPIO_H3100_AUD_PWR_ON GPIO_GPIO (7)
39#define GPIO_H3100_IR_ON GPIO_GPIO (8)
40#define GPIO_H3100_IR_FSEL GPIO_GPIO (9)
41
42/* for H3600, audio sample rate clock generator */
43#define GPIO_H3600_CLK_SET0 GPIO_GPIO (12)
44#define GPIO_H3600_CLK_SET1 GPIO_GPIO (13)
45
46#define GPIO_H3600_ACTION_BUTTON GPIO_GPIO (18)
47#define GPIO_H3600_SOFT_RESET GPIO_GPIO (20) /* Also known as BATT_FAULT */
48#define GPIO_H3600_OPT_LOCK GPIO_GPIO (22)
49#define GPIO_H3600_OPT_DET GPIO_GPIO (27)
50
51/* H3800 specific pins */
52#define GPIO_H3800_AC_IN GPIO_GPIO (12)
53#define GPIO_H3800_COM_DSR GPIO_GPIO (13)
54#define GPIO_H3800_MMC_INT GPIO_GPIO (18)
55#define GPIO_H3800_NOPT_IND GPIO_GPIO (20) /* Almost exactly the same as GPIO_H3600_OPT_DET */
56#define GPIO_H3800_OPT_BAT_FAULT GPIO_GPIO (22)
57#define GPIO_H3800_CLK_OUT GPIO_GPIO (27)
58
59/****************************************************/
60
61#define IRQ_GPIO_H3600_ACTION_BUTTON IRQ_GPIO18
62#define IRQ_GPIO_H3600_OPT_DET IRQ_GPIO27
63
64#define IRQ_GPIO_H3800_MMC_INT IRQ_GPIO18
65#define IRQ_GPIO_H3800_NOPT_IND IRQ_GPIO20 /* almost same as OPT_DET */
66
67/* H3100 / 3600 EGPIO pins */
68#define EGPIO_H3600_VPP_ON (1 << 0)
69#define EGPIO_H3600_CARD_RESET (1 << 1) /* reset the attached pcmcia/compactflash card. active high. */
70#define EGPIO_H3600_OPT_RESET (1 << 2) /* reset the attached option pack. active high. */
71#define EGPIO_H3600_CODEC_NRESET (1 << 3) /* reset the onboard UDA1341. active low. */
72#define EGPIO_H3600_OPT_NVRAM_ON (1 << 4) /* apply power to optionpack nvram, active high. */
73#define EGPIO_H3600_OPT_ON (1 << 5) /* full power to option pack. active high. */
74#define EGPIO_H3600_LCD_ON (1 << 6) /* enable 3.3V to LCD. active high. */
75#define EGPIO_H3600_RS232_ON (1 << 7) /* UART3 transceiver force on. Active high. */
76
77/* H3600 only EGPIO pins */
78#define EGPIO_H3600_LCD_PCI (1 << 8) /* LCD control IC enable. active high. */
79#define EGPIO_H3600_IR_ON (1 << 9) /* apply power to IR module. active high. */
80#define EGPIO_H3600_AUD_AMP_ON (1 << 10) /* apply power to audio power amp. active high. */
81#define EGPIO_H3600_AUD_PWR_ON (1 << 11) /* apply power to reset of audio circuit. active high. */
82#define EGPIO_H3600_QMUTE (1 << 12) /* mute control for onboard UDA1341. active high. */
83#define EGPIO_H3600_IR_FSEL (1 << 13) /* IR speed select: 1->fast, 0->slow */
84#define EGPIO_H3600_LCD_5V_ON (1 << 14) /* enable 5V to LCD. active high. */
85#define EGPIO_H3600_LVDD_ON (1 << 15) /* enable 9V and -6.5V to LCD. */
86
87/********************* H3800, ASIC #2 ********************/
88
89#define _H3800_ASIC2_Base (H3600_EGPIO_VIRT)
90#define H3800_ASIC2_OFFSET(s,x,y) \
91 (*((volatile s *) (_H3800_ASIC2_Base + _H3800_ASIC2_ ## x ## _Base + _H3800_ASIC2_ ## x ## _ ## y)))
92#define H3800_ASIC2_NOFFSET(s,x,n,y) \
93 (*((volatile s *) (_H3800_ASIC2_Base + _H3800_ASIC2_ ## x ## _ ## n ## _Base + _H3800_ASIC2_ ## x ## _ ## y)))
94
95#define _H3800_ASIC2_GPIO_Base 0x0000
96#define _H3800_ASIC2_GPIO_Direction 0x0000 /* R/W, 16 bits 1:input, 0:output */
97#define _H3800_ASIC2_GPIO_InterruptType 0x0004 /* R/W, 12 bits 1:edge, 0:level */
98#define _H3800_ASIC2_GPIO_InterruptEdgeType 0x0008 /* R/W, 12 bits 1:rising, 0:falling */
99#define _H3800_ASIC2_GPIO_InterruptLevelType 0x000C /* R/W, 12 bits 1:high, 0:low */
100#define _H3800_ASIC2_GPIO_InterruptClear 0x0010 /* W, 12 bits */
101#define _H3800_ASIC2_GPIO_InterruptFlag 0x0010 /* R, 12 bits - reads int status */
102#define _H3800_ASIC2_GPIO_Data 0x0014 /* R/W, 16 bits */
103#define _H3800_ASIC2_GPIO_BattFaultOut 0x0018 /* R/W, 16 bit - sets level on batt fault */
104#define _H3800_ASIC2_GPIO_InterruptEnable 0x001c /* R/W, 12 bits 1:enable interrupt */
105#define _H3800_ASIC2_GPIO_Alternate 0x003c /* R/W, 12+1 bits - set alternate functions */
106
107#define H3800_ASIC2_GPIO_Direction H3800_ASIC2_OFFSET( u16, GPIO, Direction )
108#define H3800_ASIC2_GPIO_InterruptType H3800_ASIC2_OFFSET( u16, GPIO, InterruptType )
109#define H3800_ASIC2_GPIO_InterruptEdgeType H3800_ASIC2_OFFSET( u16, GPIO, InterruptEdgeType )
110#define H3800_ASIC2_GPIO_InterruptLevelType H3800_ASIC2_OFFSET( u16, GPIO, InterruptLevelType )
111#define H3800_ASIC2_GPIO_InterruptClear H3800_ASIC2_OFFSET( u16, GPIO, InterruptClear )
112#define H3800_ASIC2_GPIO_InterruptFlag H3800_ASIC2_OFFSET( u16, GPIO, InterruptFlag )
113#define H3800_ASIC2_GPIO_Data H3800_ASIC2_OFFSET( u16, GPIO, Data )
114#define H3800_ASIC2_GPIO_BattFaultOut H3800_ASIC2_OFFSET( u16, GPIO, BattFaultOut )
115#define H3800_ASIC2_GPIO_InterruptEnable H3800_ASIC2_OFFSET( u16, GPIO, InterruptEnable )
116#define H3800_ASIC2_GPIO_Alternate H3800_ASIC2_OFFSET( u16, GPIO, Alternate )
117
118#define GPIO_H3800_ASIC2_IN_Y1_N (1 << 0) /* Output: Touchscreen Y1 */
119#define GPIO_H3800_ASIC2_IN_X0 (1 << 1) /* Output: Touchscreen X0 */
120#define GPIO_H3800_ASIC2_IN_Y0 (1 << 2) /* Output: Touchscreen Y0 */
121#define GPIO_H3800_ASIC2_IN_X1_N (1 << 3) /* Output: Touchscreen X1 */
122#define GPIO_H3800_ASIC2_BT_RST (1 << 4) /* Output: Bluetooth reset */
123#define GPIO_H3800_ASIC2_PEN_IRQ (1 << 5) /* Input : Pen down */
124#define GPIO_H3800_ASIC2_SD_DETECT (1 << 6) /* Input : SD detect */
125#define GPIO_H3800_ASIC2_EAR_IN_N (1 << 7) /* Input : Audio jack plug inserted */
126#define GPIO_H3800_ASIC2_OPT_PCM_RESET (1 << 8) /* Output: */
127#define GPIO_H3800_ASIC2_OPT_RESET (1 << 9) /* Output: */
128#define GPIO_H3800_ASIC2_USB_DETECT_N (1 << 10) /* Input : */
129#define GPIO_H3800_ASIC2_SD_CON_SLT (1 << 11) /* Input : */
130
131#define _H3800_ASIC2_KPIO_Base 0x0200
132#define _H3800_ASIC2_KPIO_Direction 0x0000 /* R/W, 12 bits 1:input, 0:output */
133#define _H3800_ASIC2_KPIO_InterruptType 0x0004 /* R/W, 12 bits 1:edge, 0:level */
134#define _H3800_ASIC2_KPIO_InterruptEdgeType 0x0008 /* R/W, 12 bits 1:rising, 0:falling */
135#define _H3800_ASIC2_KPIO_InterruptLevelType 0x000C /* R/W, 12 bits 1:high, 0:low */
136#define _H3800_ASIC2_KPIO_InterruptClear 0x0010 /* W, 20 bits - 8 special */
137#define _H3800_ASIC2_KPIO_InterruptFlag 0x0010 /* R, 20 bits - 8 special - reads int status */
138#define _H3800_ASIC2_KPIO_Data 0x0014 /* R/W, 16 bits */
139#define _H3800_ASIC2_KPIO_BattFaultOut 0x0018 /* R/W, 16 bit - sets level on batt fault */
140#define _H3800_ASIC2_KPIO_InterruptEnable 0x001c /* R/W, 20 bits - 8 special */
141#define _H3800_ASIC2_KPIO_Alternate 0x003c /* R/W, 6 bits */
142
143#define H3800_ASIC2_KPIO_Direction H3800_ASIC2_OFFSET( u16, KPIO, Direction )
144#define H3800_ASIC2_KPIO_InterruptType H3800_ASIC2_OFFSET( u16, KPIO, InterruptType )
145#define H3800_ASIC2_KPIO_InterruptEdgeType H3800_ASIC2_OFFSET( u16, KPIO, InterruptEdgeType )
146#define H3800_ASIC2_KPIO_InterruptLevelType H3800_ASIC2_OFFSET( u16, KPIO, InterruptLevelType )
147#define H3800_ASIC2_KPIO_InterruptClear H3800_ASIC2_OFFSET( u32, KPIO, InterruptClear )
148#define H3800_ASIC2_KPIO_InterruptFlag H3800_ASIC2_OFFSET( u32, KPIO, InterruptFlag )
149#define H3800_ASIC2_KPIO_Data H3800_ASIC2_OFFSET( u16, KPIO, Data )
150#define H3800_ASIC2_KPIO_BattFaultOut H3800_ASIC2_OFFSET( u16, KPIO, BattFaultOut )
151#define H3800_ASIC2_KPIO_InterruptEnable H3800_ASIC2_OFFSET( u32, KPIO, InterruptEnable )
152#define H3800_ASIC2_KPIO_Alternate H3800_ASIC2_OFFSET( u16, KPIO, Alternate )
153
154#define H3800_ASIC2_KPIO_SPI_INT ( 1 << 16 )
155#define H3800_ASIC2_KPIO_OWM_INT ( 1 << 17 )
156#define H3800_ASIC2_KPIO_ADC_INT ( 1 << 18 )
157#define H3800_ASIC2_KPIO_UART_0_INT ( 1 << 19 )
158#define H3800_ASIC2_KPIO_UART_1_INT ( 1 << 20 )
159#define H3800_ASIC2_KPIO_TIMER_0_INT ( 1 << 21 )
160#define H3800_ASIC2_KPIO_TIMER_1_INT ( 1 << 22 )
161#define H3800_ASIC2_KPIO_TIMER_2_INT ( 1 << 23 )
162
163#define KPIO_H3800_ASIC2_RECORD_BTN_N (1 << 0) /* Record button */
164#define KPIO_H3800_ASIC2_KEY_5W1_N (1 << 1) /* Keypad */
165#define KPIO_H3800_ASIC2_KEY_5W2_N (1 << 2) /* */
166#define KPIO_H3800_ASIC2_KEY_5W3_N (1 << 3) /* */
167#define KPIO_H3800_ASIC2_KEY_5W4_N (1 << 4) /* */
168#define KPIO_H3800_ASIC2_KEY_5W5_N (1 << 5) /* */
169#define KPIO_H3800_ASIC2_KEY_LEFT_N (1 << 6) /* */
170#define KPIO_H3800_ASIC2_KEY_RIGHT_N (1 << 7) /* */
171#define KPIO_H3800_ASIC2_KEY_AP1_N (1 << 8) /* Old "Calendar" */
172#define KPIO_H3800_ASIC2_KEY_AP2_N (1 << 9) /* Old "Schedule" */
173#define KPIO_H3800_ASIC2_KEY_AP3_N (1 << 10) /* Old "Q" */
174#define KPIO_H3800_ASIC2_KEY_AP4_N (1 << 11) /* Old "Undo" */
175
176/* Alternate KPIO functions (set by default) */
177#define KPIO_ALT_H3800_ASIC2_KEY_5W1_N (1 << 1) /* Action key */
178#define KPIO_ALT_H3800_ASIC2_KEY_5W2_N (1 << 2) /* J1 of keypad input */
179#define KPIO_ALT_H3800_ASIC2_KEY_5W3_N (1 << 3) /* J2 of keypad input */
180#define KPIO_ALT_H3800_ASIC2_KEY_5W4_N (1 << 4) /* J3 of keypad input */
181#define KPIO_ALT_H3800_ASIC2_KEY_5W5_N (1 << 5) /* J4 of keypad input */
182
183#define _H3800_ASIC2_SPI_Base 0x0400
184#define _H3800_ASIC2_SPI_Control 0x0000 /* R/W 8 bits */
185#define _H3800_ASIC2_SPI_Data 0x0004 /* R/W 8 bits */
186#define _H3800_ASIC2_SPI_ChipSelectDisabled 0x0008 /* W 8 bits */
187
188#define H3800_ASIC2_SPI_Control H3800_ASIC2_OFFSET( u8, SPI, Control )
189#define H3800_ASIC2_SPI_Data H3800_ASIC2_OFFSET( u8, SPI, Data )
190#define H3800_ASIC2_SPI_ChipSelectDisabled H3800_ASIC2_OFFSET( u8, SPI, ChipSelectDisabled )
191
192#define _H3800_ASIC2_PWM_0_Base 0x0600
193#define _H3800_ASIC2_PWM_1_Base 0x0700
194#define _H3800_ASIC2_PWM_TimeBase 0x0000 /* R/W 6 bits */
195#define _H3800_ASIC2_PWM_PeriodTime 0x0004 /* R/W 12 bits */
196#define _H3800_ASIC2_PWM_DutyTime 0x0008 /* R/W 12 bits */
197
198#define H3800_ASIC2_PWM_0_TimeBase H3800_ASIC2_NOFFSET( u8, PWM, 0, TimeBase )
199#define H3800_ASIC2_PWM_0_PeriodTime H3800_ASIC2_NOFFSET( u16, PWM, 0, PeriodTime )
200#define H3800_ASIC2_PWM_0_DutyTime H3800_ASIC2_NOFFSET( u16, PWM, 0, DutyTime )
201
202#define H3800_ASIC2_PWM_1_TimeBase H3800_ASIC2_NOFFSET( u8, PWM, 1, TimeBase )
203#define H3800_ASIC2_PWM_1_PeriodTime H3800_ASIC2_NOFFSET( u16, PWM, 1, PeriodTime )
204#define H3800_ASIC2_PWM_1_DutyTime H3800_ASIC2_NOFFSET( u16, PWM, 1, DutyTime )
205
206#define H3800_ASIC2_PWM_TIMEBASE_MASK 0xf /* Low 4 bits sets time base, max = 8 */
207#define H3800_ASIC2_PWM_TIMEBASE_ENABLE ( 1 << 4 ) /* Enable clock */
208#define H3800_ASIC2_PWM_TIMEBASE_CLEAR ( 1 << 5 ) /* Clear the PWM */
209
210#define _H3800_ASIC2_LED_0_Base 0x0800
211#define _H3800_ASIC2_LED_1_Base 0x0880
212#define _H3800_ASIC2_LED_2_Base 0x0900
213#define _H3800_ASIC2_LED_TimeBase 0x0000 /* R/W 7 bits */
214#define _H3800_ASIC2_LED_PeriodTime 0x0004 /* R/W 12 bits */
215#define _H3800_ASIC2_LED_DutyTime 0x0008 /* R/W 12 bits */
216#define _H3800_ASIC2_LED_AutoStopCount 0x000c /* R/W 16 bits */
217
218#define H3800_ASIC2_LED_0_TimeBase H3800_ASIC2_NOFFSET( u8, LED, 0, TimeBase )
219#define H3800_ASIC2_LED_0_PeriodTime H3800_ASIC2_NOFFSET( u16, LED, 0, PeriodTime )
220#define H3800_ASIC2_LED_0_DutyTime H3800_ASIC2_NOFFSET( u16, LED, 0, DutyTime )
221#define H3800_ASIC2_LED_0_AutoStopClock H3800_ASIC2_NOFFSET( u16, LED, 0, AutoStopClock )
222
223#define H3800_ASIC2_LED_1_TimeBase H3800_ASIC2_NOFFSET( u8, LED, 1, TimeBase )
224#define H3800_ASIC2_LED_1_PeriodTime H3800_ASIC2_NOFFSET( u16, LED, 1, PeriodTime )
225#define H3800_ASIC2_LED_1_DutyTime H3800_ASIC2_NOFFSET( u16, LED, 1, DutyTime )
226#define H3800_ASIC2_LED_1_AutoStopClock H3800_ASIC2_NOFFSET( u16, LED, 1, AutoStopClock )
227
228#define H3800_ASIC2_LED_2_TimeBase H3800_ASIC2_NOFFSET( u8, LED, 2, TimeBase )
229#define H3800_ASIC2_LED_2_PeriodTime H3800_ASIC2_NOFFSET( u16, LED, 2, PeriodTime )
230#define H3800_ASIC2_LED_2_DutyTime H3800_ASIC2_NOFFSET( u16, LED, 2, DutyTime )
231#define H3800_ASIC2_LED_2_AutoStopClock H3800_ASIC2_NOFFSET( u16, LED, 2, AutoStopClock )
232
233#define H3800_ASIC2_LED_TIMEBASE_MASK 0x0f /* Low 4 bits sets time base, max = 13 */
234#define H3800_ASIC2_LED_TIMEBASE_BLINK ( 1 << 4 ) /* Enable blinking */
235#define H3800_ASIC2_LED_TIMEBASE_AUTOSTOP ( 1 << 5 )
236#define H3800_ASIC2_LED_TIMEBASE_ALWAYS ( 1 << 6 ) /* Enable blink always */
237
238#define _H3800_ASIC2_UART_0_Base 0x0A00
239#define _H3800_ASIC2_UART_1_Base 0x0C00
240#define _H3800_ASIC2_UART_Receive 0x0000 /* R 8 bits */
241#define _H3800_ASIC2_UART_Transmit 0x0000 /* W 8 bits */
242#define _H3800_ASIC2_UART_IntEnable 0x0004 /* R/W 8 bits */
243#define _H3800_ASIC2_UART_IntVerify 0x0008 /* R/W 8 bits */
244#define _H3800_ASIC2_UART_FIFOControl 0x000c /* R/W 8 bits */
245#define _H3800_ASIC2_UART_LineControl 0x0010 /* R/W 8 bits */
246#define _H3800_ASIC2_UART_ModemStatus 0x0014 /* R/W 8 bits */
247#define _H3800_ASIC2_UART_LineStatus 0x0018 /* R/W 8 bits */
248#define _H3800_ASIC2_UART_ScratchPad 0x001c /* R/W 8 bits */
249#define _H3800_ASIC2_UART_DivisorLatchL 0x0020 /* R/W 8 bits */
250#define _H3800_ASIC2_UART_DivisorLatchH 0x0024 /* R/W 8 bits */
251
252#define H3800_ASIC2_UART_0_Receive H3800_ASIC2_NOFFSET( u8, UART, 0, Receive )
253#define H3800_ASIC2_UART_0_Transmit H3800_ASIC2_NOFFSET( u8, UART, 0, Transmit )
254#define H3800_ASIC2_UART_0_IntEnable H3800_ASIC2_NOFFSET( u8, UART, 0, IntEnable )
255#define H3800_ASIC2_UART_0_IntVerify H3800_ASIC2_NOFFSET( u8, UART, 0, IntVerify )
256#define H3800_ASIC2_UART_0_FIFOControl H3800_ASIC2_NOFFSET( u8, UART, 0, FIFOControl )
257#define H3800_ASIC2_UART_0_LineControl H3800_ASIC2_NOFFSET( u8, UART, 0, LineControl )
258#define H3800_ASIC2_UART_0_ModemStatus H3800_ASIC2_NOFFSET( u8, UART, 0, ModemStatus )
259#define H3800_ASIC2_UART_0_LineStatus H3800_ASIC2_NOFFSET( u8, UART, 0, LineStatus )
260#define H3800_ASIC2_UART_0_ScratchPad H3800_ASIC2_NOFFSET( u8, UART, 0, ScratchPad )
261#define H3800_ASIC2_UART_0_DivisorLatchL H3800_ASIC2_NOFFSET( u8, UART, 0, DivisorLatchL )
262#define H3800_ASIC2_UART_0_DivisorLatchH H3800_ASIC2_NOFFSET( u8, UART, 0, DivisorLatchH )
263
264#define H3800_ASIC2_UART_1_Receive H3800_ASIC2_NOFFSET( u8, UART, 1, Receive )
265#define H3800_ASIC2_UART_1_Transmit H3800_ASIC2_NOFFSET( u8, UART, 1, Transmit )
266#define H3800_ASIC2_UART_1_IntEnable H3800_ASIC2_NOFFSET( u8, UART, 1, IntEnable )
267#define H3800_ASIC2_UART_1_IntVerify H3800_ASIC2_NOFFSET( u8, UART, 1, IntVerify )
268#define H3800_ASIC2_UART_1_FIFOControl H3800_ASIC2_NOFFSET( u8, UART, 1, FIFOControl )
269#define H3800_ASIC2_UART_1_LineControl H3800_ASIC2_NOFFSET( u8, UART, 1, LineControl )
270#define H3800_ASIC2_UART_1_ModemStatus H3800_ASIC2_NOFFSET( u8, UART, 1, ModemStatus )
271#define H3800_ASIC2_UART_1_LineStatus H3800_ASIC2_NOFFSET( u8, UART, 1, LineStatus )
272#define H3800_ASIC2_UART_1_ScratchPad H3800_ASIC2_NOFFSET( u8, UART, 1, ScratchPad )
273#define H3800_ASIC2_UART_1_DivisorLatchL H3800_ASIC2_NOFFSET( u8, UART, 1, DivisorLatchL )
274#define H3800_ASIC2_UART_1_DivisorLatchH H3800_ASIC2_NOFFSET( u8, UART, 1, DivisorLatchH )
275
276#define _H3800_ASIC2_TIMER_Base 0x0E00
277#define _H3800_ASIC2_TIMER_Command 0x0000 /* R/W 8 bits */
278
279#define H3800_ASIC2_TIMER_Command H3800_ASIC2_OFFSET( u8, Timer, Command )
280
281#define H3800_ASIC2_TIMER_GAT_0 ( 1 << 0 ) /* Gate enable, counter 0 */
282#define H3800_ASIC2_TIMER_GAT_1 ( 1 << 1 ) /* Gate enable, counter 1 */
283#define H3800_ASIC2_TIMER_GAT_2 ( 1 << 2 ) /* Gate enable, counter 2 */
284#define H3800_ASIC2_TIMER_CLK_0 ( 1 << 3 ) /* Clock enable, counter 0 */
285#define H3800_ASIC2_TIMER_CLK_1 ( 1 << 4 ) /* Clock enable, counter 1 */
286#define H3800_ASIC2_TIMER_CLK_2 ( 1 << 5 ) /* Clock enable, counter 2 */
287#define H3800_ASIC2_TIMER_MODE_0 ( 1 << 6 ) /* Mode 0 enable, counter 0 */
288#define H3800_ASIC2_TIMER_MODE_1 ( 1 << 7 ) /* Mode 0 enable, counter 1 */
289
290#define _H3800_ASIC2_CLOCK_Base 0x1000
291#define _H3800_ASIC2_CLOCK_Enable 0x0000 /* R/W 18 bits */
292
293#define H3800_ASIC2_CLOCK_Enable H3800_ASIC2_OFFSET( u32, CLOCK, Enable )
294
295#define H3800_ASIC2_CLOCK_AUDIO_1 0x0001 /* Enable 4.1 MHz clock for 8Khz and 4khz sample rate */
296#define H3800_ASIC2_CLOCK_AUDIO_2 0x0002 /* Enable 12.3 MHz clock for 48Khz and 32khz sample rate */
297#define H3800_ASIC2_CLOCK_AUDIO_3 0x0004 /* Enable 5.6 MHz clock for 11 kHZ sample rate */
298#define H3800_ASIC2_CLOCK_AUDIO_4 0x0008 /* Enable 11.289 MHz clock for 44 and 22 kHz sample rate */
299#define H3800_ASIC2_CLOCK_ADC ( 1 << 4 ) /* 1.024 MHz clock to ADC */
300#define H3800_ASIC2_CLOCK_SPI ( 1 << 5 ) /* 4.096 MHz clock to SPI */
301#define H3800_ASIC2_CLOCK_OWM ( 1 << 6 ) /* 4.096 MHz clock to OWM */
302#define H3800_ASIC2_CLOCK_PWM ( 1 << 7 ) /* 2.048 MHz clock to PWM */
303#define H3800_ASIC2_CLOCK_UART_1 ( 1 << 8 ) /* 24.576 MHz clock to UART1 (turn off bit 16) */
304#define H3800_ASIC2_CLOCK_UART_0 ( 1 << 9 ) /* 24.576 MHz clock to UART0 (turn off bit 17) */
305#define H3800_ASIC2_CLOCK_SD_1 ( 1 << 10 ) /* 16.934 MHz to SD */
306#define H3800_ASIC2_CLOCK_SD_2 ( 2 << 10 ) /* 24.576 MHz to SD */
307#define H3800_ASIC2_CLOCK_SD_3 ( 3 << 10 ) /* 33.869 MHz to SD */
308#define H3800_ASIC2_CLOCK_SD_4 ( 4 << 10 ) /* 49.152 MHz to SD */
309#define H3800_ASIC2_CLOCK_EX0 ( 1 << 13 ) /* Enable 32.768 kHz crystal */
310#define H3800_ASIC2_CLOCK_EX1 ( 1 << 14 ) /* Enable 24.576 MHz crystal */
311#define H3800_ASIC2_CLOCK_EX2 ( 1 << 15 ) /* Enable 33.869 MHz crystal */
312#define H3800_ASIC2_CLOCK_SLOW_UART_1 ( 1 << 16 ) /* Enable 3.686 MHz to UART1 (turn off bit 8) */
313#define H3800_ASIC2_CLOCK_SLOW_UART_0 ( 1 << 17 ) /* Enable 3.686 MHz to UART0 (turn off bit 9) */
314
315#define _H3800_ASIC2_ADC_Base 0x1200
316#define _H3800_ASIC2_ADC_Multiplexer 0x0000 /* R/W 4 bits - low 3 bits set channel */
317#define _H3800_ASIC2_ADC_ControlStatus 0x0004 /* R/W 8 bits */
318#define _H3800_ASIC2_ADC_Data 0x0008 /* R 10 bits */
319
320#define H3800_ASIC2_ADC_Multiplexer H3800_ASIC2_OFFSET( u8, ADC, Multiplexer )
321#define H3800_ASIC2_ADC_ControlStatus H3800_ASIC2_OFFSET( u8, ADC, ControlStatus )
322#define H3800_ASIC2_ADC_Data H3800_ASIC2_OFFSET( u16, ADC, Data )
323
324#define H3600_ASIC2_ADC_MUX_CHANNEL_MASK 0x07 /* Low 3 bits sets channel. max = 4 */
325#define H3600_ASIC2_ADC_MUX_CLKEN ( 1 << 3 ) /* Enable clock */
326
327#define H3600_ASIC2_ADC_CSR_ADPS_MASK 0x0f /* Low 4 bits sets prescale, max = 8 */
328#define H3600_ASIC2_ADC_CSR_FREE_RUN ( 1 << 4 )
329#define H3600_ASIC2_ADC_CSR_INT_ENABLE ( 1 << 5 )
330#define H3600_ASIC2_ADC_CSR_START ( 1 << 6 ) /* Set to start conversion. Goes to 0 when done */
331#define H3600_ASIC2_ADC_CSR_ENABLE ( 1 << 7 ) /* 1:power up ADC, 0:power down */
332
333
334#define _H3800_ASIC2_INTR_Base 0x1600
335#define _H3800_ASIC2_INTR_MaskAndFlag 0x0000 /* R/(W) 8bits */
336#define _H3800_ASIC2_INTR_ClockPrescale 0x0004 /* R/(W) 5bits */
337#define _H3800_ASIC2_INTR_TimerSet 0x0008 /* R/(W) 8bits */
338
339#define H3800_ASIC2_INTR_MaskAndFlag H3800_ASIC2_OFFSET( u8, INTR, MaskAndFlag )
340#define H3800_ASIC2_INTR_ClockPrescale H3800_ASIC2_OFFSET( u8, INTR, ClockPrescale )
341#define H3800_ASIC2_INTR_TimerSet H3800_ASIC2_OFFSET( u8, INTR, TimerSet )
342
343#define H3800_ASIC2_INTR_GLOBAL_MASK ( 1 << 0 ) /* Global interrupt mask */
344#define H3800_ASIC2_INTR_POWER_ON_RESET ( 1 << 1 ) /* 01: Power on reset (bits 1 & 2 ) */
345#define H3800_ASIC2_INTR_EXTERNAL_RESET ( 2 << 1 ) /* 10: External reset (bits 1 & 2 ) */
346#define H3800_ASIC2_INTR_MASK_UART_0 ( 1 << 4 )
347#define H3800_ASIC2_INTR_MASK_UART_1 ( 1 << 5 )
348#define H3800_ASIC2_INTR_MASK_TIMER ( 1 << 6 )
349#define H3800_ASIC2_INTR_MASK_OWM ( 1 << 7 )
350
351#define H3800_ASIC2_INTR_CLOCK_PRESCALE 0x0f /* 4 bits, max 14 */
352#define H3800_ASIC2_INTR_SET ( 1 << 4 ) /* Time base enable */
353
354
355#define _H3800_ASIC2_OWM_Base 0x1800
356#define _H3800_ASIC2_OWM_Command 0x0000 /* R/W 4 bits command register */
357#define _H3800_ASIC2_OWM_Data 0x0004 /* R/W 8 bits, transmit / receive buffer */
358#define _H3800_ASIC2_OWM_Interrupt 0x0008 /* R/W Command register */
359#define _H3800_ASIC2_OWM_InterruptEnable 0x000c /* R/W Command register */
360#define _H3800_ASIC2_OWM_ClockDivisor 0x0010 /* R/W 5 bits of divisor and pre-scale */
361
362#define H3800_ASIC2_OWM_Command H3800_ASIC2_OFFSET( u8, OWM, Command )
363#define H3800_ASIC2_OWM_Data H3800_ASIC2_OFFSET( u8, OWM, Data )
364#define H3800_ASIC2_OWM_Interrupt H3800_ASIC2_OFFSET( u8, OWM, Interrupt )
365#define H3800_ASIC2_OWM_InterruptEnable H3800_ASIC2_OFFSET( u8, OWM, InterruptEnable )
366#define H3800_ASIC2_OWM_ClockDivisor H3800_ASIC2_OFFSET( u8, OWM, ClockDivisor )
367
368#define H3800_ASIC2_OWM_CMD_ONE_WIRE_RESET ( 1 << 0 ) /* Set to force reset on 1-wire bus */
369#define H3800_ASIC2_OWM_CMD_SRA ( 1 << 1 ) /* Set to switch to Search ROM accelerator mode */
370#define H3800_ASIC2_OWM_CMD_DQ_OUTPUT ( 1 << 2 ) /* Write only - forces bus low */
371#define H3800_ASIC2_OWM_CMD_DQ_INPUT ( 1 << 3 ) /* Read only - reflects state of bus */
372
373#define H3800_ASIC2_OWM_INT_PD ( 1 << 0 ) /* Presence detect */
374#define H3800_ASIC2_OWM_INT_PDR ( 1 << 1 ) /* Presence detect result */
375#define H3800_ASIC2_OWM_INT_TBE ( 1 << 2 ) /* Transmit buffer empty */
376#define H3800_ASIC2_OWM_INT_TEMT ( 1 << 3 ) /* Transmit shift register empty */
377#define H3800_ASIC2_OWM_INT_RBF ( 1 << 4 ) /* Receive buffer full */
378
379#define H3800_ASIC2_OWM_INTEN_EPD ( 1 << 0 ) /* Enable receive buffer full interrupt */
380#define H3800_ASIC2_OWM_INTEN_IAS ( 1 << 1 ) /* Enable transmit shift register empty interrupt */
381#define H3800_ASIC2_OWM_INTEN_ETBE ( 1 << 2 ) /* Enable transmit buffer empty interrupt */
382#define H3800_ASIC2_OWM_INTEN_ETMT ( 1 << 3 ) /* INTR active state */
383#define H3800_ASIC2_OWM_INTEN_ERBF ( 1 << 4 ) /* Enable presence detect interrupt */
384
385#define _H3800_ASIC2_FlashCtl_Base 0x1A00
386
387/****************************************************/
388/* H3800, ASIC #1
389 * This ASIC is accesed through ASIC #2, and
390 * mapped into the 1c00 - 1f00 region
391 */
392
393#define H3800_ASIC1_OFFSET(s,x,y) \
394 (*((volatile s *) (_H3800_ASIC2_Base + _H3800_ASIC1_ ## x ## _Base + (_H3800_ASIC1_ ## x ## _ ## y << 1))))
395
396#define _H3800_ASIC1_MMC_Base 0x1c00
397
398#define _H3800_ASIC1_MMC_StartStopClock 0x00 /* R/W 8bit */
399#define _H3800_ASIC1_MMC_Status 0x02 /* R See below, default 0x0040 */
400#define _H3800_ASIC1_MMC_ClockRate 0x04 /* R/W 8bit, low 3 bits are clock divisor */
401#define _H3800_ASIC1_MMC_SPIRegister 0x08 /* R/W 8bit, see below */
402#define _H3800_ASIC1_MMC_CmdDataCont 0x0a /* R/W 8bit, write to start MMC adapter */
403#define _H3800_ASIC1_MMC_ResponseTimeout 0x0c /* R/W 8bit, clocks before response timeout */
404#define _H3800_ASIC1_MMC_ReadTimeout 0x0e /* R/W 16bit, clocks before received data timeout */
405#define _H3800_ASIC1_MMC_BlockLength 0x10 /* R/W 10bit */
406#define _H3800_ASIC1_MMC_NumOfBlocks 0x12 /* R/W 16bit, in block mode, number of blocks */
407#define _H3800_ASIC1_MMC_InterruptMask 0x1a /* R/W 8bit */
408#define _H3800_ASIC1_MMC_CommandNumber 0x1c /* R/W 6 bits */
409#define _H3800_ASIC1_MMC_ArgumentH 0x1e /* R/W 16 bits */
410#define _H3800_ASIC1_MMC_ArgumentL 0x20 /* R/W 16 bits */
411#define _H3800_ASIC1_MMC_ResFifo 0x22 /* R 8 x 16 bits - contains response FIFO */
412#define _H3800_ASIC1_MMC_BufferPartFull 0x28 /* R/W 8 bits */
413
414#define H3800_ASIC1_MMC_StartStopClock H3800_ASIC1_OFFSET( u8, MMC, StartStopClock )
415#define H3800_ASIC1_MMC_Status H3800_ASIC1_OFFSET( u16, MMC, Status )
416#define H3800_ASIC1_MMC_ClockRate H3800_ASIC1_OFFSET( u8, MMC, ClockRate )
417#define H3800_ASIC1_MMC_SPIRegister H3800_ASIC1_OFFSET( u8, MMC, SPIRegister )
418#define H3800_ASIC1_MMC_CmdDataCont H3800_ASIC1_OFFSET( u8, MMC, CmdDataCont )
419#define H3800_ASIC1_MMC_ResponseTimeout H3800_ASIC1_OFFSET( u8, MMC, ResponseTimeout )
420#define H3800_ASIC1_MMC_ReadTimeout H3800_ASIC1_OFFSET( u16, MMC, ReadTimeout )
421#define H3800_ASIC1_MMC_BlockLength H3800_ASIC1_OFFSET( u16, MMC, BlockLength )
422#define H3800_ASIC1_MMC_NumOfBlocks H3800_ASIC1_OFFSET( u16, MMC, NumOfBlocks )
423#define H3800_ASIC1_MMC_InterruptMask H3800_ASIC1_OFFSET( u8, MMC, InterruptMask )
424#define H3800_ASIC1_MMC_CommandNumber H3800_ASIC1_OFFSET( u8, MMC, CommandNumber )
425#define H3800_ASIC1_MMC_ArgumentH H3800_ASIC1_OFFSET( u16, MMC, ArgumentH )
426#define H3800_ASIC1_MMC_ArgumentL H3800_ASIC1_OFFSET( u16, MMC, ArgumentL )
427#define H3800_ASIC1_MMC_ResFifo H3800_ASIC1_OFFSET( u16, MMC, ResFifo )
428#define H3800_ASIC1_MMC_BufferPartFull H3800_ASIC1_OFFSET( u8, MMC, BufferPartFull )
429
430#define H3800_ASIC1_MMC_STOP_CLOCK (1 << 0) /* Write to "StartStopClock" register */
431#define H3800_ASIC1_MMC_START_CLOCK (1 << 1)
432
433#define H3800_ASIC1_MMC_STATUS_READ_TIMEOUT (1 << 0)
434#define H3800_ASIC1_MMC_STATUS_RESPONSE_TIMEOUT (1 << 1)
435#define H3800_ASIC1_MMC_STATUS_CRC_WRITE_ERROR (1 << 2)
436#define H3800_ASIC1_MMC_STATUS_CRC_READ_ERROR (1 << 3)
437#define H3800_ASIC1_MMC_STATUS_SPI_READ_ERROR (1 << 4) /* SPI data token error received */
438#define H3800_ASIC1_MMC_STATUS_CRC_RESPONSE_ERROR (1 << 5)
439#define H3800_ASIC1_MMC_STATUS_FIFO_EMPTY (1 << 6)
440#define H3800_ASIC1_MMC_STATUS_FIFO_FULL (1 << 7)
441#define H3800_ASIC1_MMC_STATUS_CLOCK_ENABLE (1 << 8) /* MultiMediaCard clock stopped */
442#define H3800_ASIC1_MMC_STATUS_DATA_TRANSFER_DONE (1 << 11) /* Write operation, indicates transfer finished */
443#define H3800_ASIC1_MMC_STATUS_END_PROGRAM (1 << 12) /* End write and read operations */
444#define H3800_ASIC1_MMC_STATUS_END_COMMAND_RESPONSE (1 << 13) /* End command response */
445
446#define H3800_ASIC1_MMC_SPI_REG_SPI_ENABLE (1 << 0) /* Enables SPI mode */
447#define H3800_ASIC1_MMC_SPI_REG_CRC_ON (1 << 1) /* 1:turn on CRC */
448#define H3800_ASIC1_MMC_SPI_REG_SPI_CS_ENABLE (1 << 2) /* 1:turn on SPI CS */
449#define H3800_ASIC1_MMC_SPI_REG_CS_ADDRESS_MASK 0x38 /* Bits 3,4,5 are the SPI CS relative address */
450
451#define H3800_ASIC1_MMC_CMD_DATA_CONT_FORMAT_NO_RESPONSE 0x00
452#define H3800_ASIC1_MMC_CMD_DATA_CONT_FORMAT_R1 0x01
453#define H3800_ASIC1_MMC_CMD_DATA_CONT_FORMAT_R2 0x02
454#define H3800_ASIC1_MMC_CMD_DATA_CONT_FORMAT_R3 0x03
455#define H3800_ASIC1_MMC_CMD_DATA_CONT_DATA_ENABLE (1 << 2) /* This command contains a data transfer */
456#define H3800_ASIC1_MMC_CMD_DATA_CONT_WRITE (1 << 3) /* This data transfer is a write */
457#define H3800_ASIC1_MMC_CMD_DATA_CONT_STREAM_MODE (1 << 4) /* This data transfer is in stream mode */
458#define H3800_ASIC1_MMC_CMD_DATA_CONT_BUSY_BIT (1 << 5) /* Busy signal expected after current cmd */
459#define H3800_ASIC1_MMC_CMD_DATA_CONT_INITIALIZE (1 << 6) /* Enables the 80 bits for initializing card */
460
461#define H3800_ASIC1_MMC_INT_MASK_DATA_TRANSFER_DONE (1 << 0)
462#define H3800_ASIC1_MMC_INT_MASK_PROGRAM_DONE (1 << 1)
463#define H3800_ASIC1_MMC_INT_MASK_END_COMMAND_RESPONSE (1 << 2)
464#define H3800_ASIC1_MMC_INT_MASK_BUFFER_READY (1 << 3)
465
466#define H3800_ASIC1_MMC_BUFFER_PART_FULL (1 << 0)
467
468/********* GPIO **********/
469
470#define _H3800_ASIC1_GPIO_Base 0x1e00
471
472#define _H3800_ASIC1_GPIO_Mask 0x30 /* R/W 0:don't mask, 1:mask interrupt */
473#define _H3800_ASIC1_GPIO_Direction 0x32 /* R/W 0:input, 1:output */
474#define _H3800_ASIC1_GPIO_Out 0x34 /* R/W 0:output low, 1:output high */
475#define _H3800_ASIC1_GPIO_TriggerType 0x36 /* R/W 0:level, 1:edge */
476#define _H3800_ASIC1_GPIO_EdgeTrigger 0x38 /* R/W 0:falling, 1:rising */
477#define _H3800_ASIC1_GPIO_LevelTrigger 0x3A /* R/W 0:low, 1:high level detect */
478#define _H3800_ASIC1_GPIO_LevelStatus 0x3C /* R/W 0:none, 1:detect */
479#define _H3800_ASIC1_GPIO_EdgeStatus 0x3E /* R/W 0:none, 1:detect */
480#define _H3800_ASIC1_GPIO_State 0x40 /* R See masks below (default 0) */
481#define _H3800_ASIC1_GPIO_Reset 0x42 /* R/W See masks below (default 0x04) */
482#define _H3800_ASIC1_GPIO_SleepMask 0x44 /* R/W 0:don't mask, 1:mask trigger in sleep mode */
483#define _H3800_ASIC1_GPIO_SleepDir 0x46 /* R/W direction 0:input, 1:output in sleep mode */
484#define _H3800_ASIC1_GPIO_SleepOut 0x48 /* R/W level 0:low, 1:high in sleep mode */
485#define _H3800_ASIC1_GPIO_Status 0x4A /* R Pin status */
486#define _H3800_ASIC1_GPIO_BattFaultDir 0x4C /* R/W direction 0:input, 1:output in batt_fault */
487#define _H3800_ASIC1_GPIO_BattFaultOut 0x4E /* R/W level 0:low, 1:high in batt_fault */
488
489#define H3800_ASIC1_GPIO_Mask H3800_ASIC1_OFFSET( u16, GPIO, Mask )
490#define H3800_ASIC1_GPIO_Direction H3800_ASIC1_OFFSET( u16, GPIO, Direction )
491#define H3800_ASIC1_GPIO_Out H3800_ASIC1_OFFSET( u16, GPIO, Out )
492#define H3800_ASIC1_GPIO_TriggerType H3800_ASIC1_OFFSET( u16, GPIO, TriggerType )
493#define H3800_ASIC1_GPIO_EdgeTrigger H3800_ASIC1_OFFSET( u16, GPIO, EdgeTrigger )
494#define H3800_ASIC1_GPIO_LevelTrigger H3800_ASIC1_OFFSET( u16, GPIO, LevelTrigger )
495#define H3800_ASIC1_GPIO_LevelStatus H3800_ASIC1_OFFSET( u16, GPIO, LevelStatus )
496#define H3800_ASIC1_GPIO_EdgeStatus H3800_ASIC1_OFFSET( u16, GPIO, EdgeStatus )
497#define H3800_ASIC1_GPIO_State H3800_ASIC1_OFFSET( u8, GPIO, State )
498#define H3800_ASIC1_GPIO_Reset H3800_ASIC1_OFFSET( u8, GPIO, Reset )
499#define H3800_ASIC1_GPIO_SleepMask H3800_ASIC1_OFFSET( u16, GPIO, SleepMask )
500#define H3800_ASIC1_GPIO_SleepDir H3800_ASIC1_OFFSET( u16, GPIO, SleepDir )
501#define H3800_ASIC1_GPIO_SleepOut H3800_ASIC1_OFFSET( u16, GPIO, SleepOut )
502#define H3800_ASIC1_GPIO_Status H3800_ASIC1_OFFSET( u16, GPIO, Status )
503#define H3800_ASIC1_GPIO_BattFaultDir H3800_ASIC1_OFFSET( u16, GPIO, BattFaultDir )
504#define H3800_ASIC1_GPIO_BattFaultOut H3800_ASIC1_OFFSET( u16, GPIO, BattFaultOut )
505
506#define H3800_ASIC1_GPIO_STATE_MASK (1 << 0)
507#define H3800_ASIC1_GPIO_STATE_DIRECTION (1 << 1)
508#define H3800_ASIC1_GPIO_STATE_OUT (1 << 2)
509#define H3800_ASIC1_GPIO_STATE_TRIGGER_TYPE (1 << 3)
510#define H3800_ASIC1_GPIO_STATE_EDGE_TRIGGER (1 << 4)
511#define H3800_ASIC1_GPIO_STATE_LEVEL_TRIGGER (1 << 5)
512
513#define H3800_ASIC1_GPIO_RESET_SOFTWARE (1 << 0)
514#define H3800_ASIC1_GPIO_RESET_AUTO_SLEEP (1 << 1)
515#define H3800_ASIC1_GPIO_RESET_FIRST_PWR_ON (1 << 2)
516
517/* These are all outputs */
518#define GPIO_H3800_ASIC1_IR_ON_N (1 << 0) /* Apply power to the IR Module */
519#define GPIO_H3800_ASIC1_SD_PWR_ON (1 << 1) /* Secure Digital power on */
520#define GPIO_H3800_ASIC1_RS232_ON (1 << 2) /* Turn on power to the RS232 chip ? */
521#define GPIO_H3800_ASIC1_PULSE_GEN (1 << 3) /* Goes to speaker / earphone */
522#define GPIO_H3800_ASIC1_CH_TIMER (1 << 4) /* */
523#define GPIO_H3800_ASIC1_LCD_5V_ON (1 << 5) /* Enables LCD_5V */
524#define GPIO_H3800_ASIC1_LCD_ON (1 << 6) /* Enables LCD_3V */
525#define GPIO_H3800_ASIC1_LCD_PCI (1 << 7) /* Connects to PDWN on LCD controller */
526#define GPIO_H3800_ASIC1_VGH_ON (1 << 8) /* Drives VGH on the LCD (+9??) */
527#define GPIO_H3800_ASIC1_VGL_ON (1 << 9) /* Drivers VGL on the LCD (-6??) */
528#define GPIO_H3800_ASIC1_FL_PWR_ON (1 << 10) /* Frontlight power on */
529#define GPIO_H3800_ASIC1_BT_PWR_ON (1 << 11) /* Bluetooth power on */
530#define GPIO_H3800_ASIC1_SPK_ON (1 << 12) /* */
531#define GPIO_H3800_ASIC1_EAR_ON_N (1 << 13) /* */
532#define GPIO_H3800_ASIC1_AUD_PWR_ON (1 << 14) /* */
533
534/* Write enable for the flash */
535
536#define _H3800_ASIC1_FlashWP_Base 0x1F00
537#define _H3800_ASIC1_FlashWP_VPP_ON 0x00 /* R 1: write, 0: protect */
538#define H3800_ASIC1_FlashWP_VPP_ON H3800_ASIC1_OFFSET( u8, FlashWP, VPP_ON )
539
540#endif /* _INCLUDE_H3600_GPIO_H_ */
diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h
new file mode 100644
index 000000000000..10c62db34362
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/hardware.h
@@ -0,0 +1,83 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/hardware.h
3 *
4 * Copyright (C) 1998 Nicolas Pitre <nico@cam.org>
5 *
6 * This file contains the hardware definitions for SA1100 architecture
7 *
8 * 2000/05/23 John Dorsey <john+@cs.cmu.edu>
9 * Definitions for SA1111 added.
10 */
11
12#ifndef __ASM_ARCH_HARDWARE_H
13#define __ASM_ARCH_HARDWARE_H
14
15#include <linux/config.h>
16
17/* Flushing areas */
18#define FLUSH_BASE_PHYS 0xe0000000 /* SA1100 zero bank */
19#define FLUSH_BASE 0xf5000000
20#define FLUSH_BASE_MINICACHE 0xf5800000
21#define UNCACHEABLE_ADDR 0xfa050000
22
23
24/*
25 * We requires absolute addresses i.e. (PCMCIA_IO_0_BASE + 0x3f8) for
26 * in*()/out*() macros to be usable for all cases.
27 */
28#define PCIO_BASE 0
29
30
31/*
32 * SA1100 internal I/O mappings
33 *
34 * We have the following mapping:
35 * phys virt
36 * 80000000 f8000000
37 * 90000000 fa000000
38 * a0000000 fc000000
39 * b0000000 fe000000
40 */
41
42#define VIO_BASE 0xf8000000 /* virtual start of IO space */
43#define VIO_SHIFT 3 /* x = IO space shrink power */
44#define PIO_START 0x80000000 /* physical start of IO space */
45
46#define io_p2v( x ) \
47 ( (((x)&0x00ffffff) | (((x)&0x30000000)>>VIO_SHIFT)) + VIO_BASE )
48#define io_v2p( x ) \
49 ( (((x)&0x00ffffff) | (((x)&(0x30000000>>VIO_SHIFT))<<VIO_SHIFT)) + PIO_START )
50
51#ifndef __ASSEMBLY__
52#include <asm/types.h>
53
54#if 0
55# define __REG(x) (*((volatile u32 *)io_p2v(x)))
56#else
57/*
58 * This __REG() version gives the same results as the one above, except
59 * that we are fooling gcc somehow so it generates far better and smaller
60 * assembly code for access to contigous registers. It's a shame that gcc
61 * doesn't guess this by itself.
62 */
63typedef struct { volatile u32 offset[4096]; } __regbase;
64# define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2]
65# define __REG(x) __REGP(io_p2v(x))
66#endif
67
68# define __PREG(x) (io_v2p((u32)&(x)))
69
70#else
71
72# define __REG(x) io_p2v(x)
73# define __PREG(x) io_v2p(x)
74
75#endif
76
77#include "SA-1100.h"
78
79#ifdef CONFIG_SA1101
80#include "SA-1101.h"
81#endif
82
83#endif /* _ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-sa1100/ide.h b/include/asm-arm/arch-sa1100/ide.h
new file mode 100644
index 000000000000..2153538069c7
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/ide.h
@@ -0,0 +1,76 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/ide.h
3 *
4 * Copyright (c) 1998 Hugo Fiennes & Nicolas Pitre
5 *
6 * 18-aug-2000: Cleanup by Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
7 * Get rid of the special ide_init_hwif_ports() functions
8 * and make a generalised function that can be used by all
9 * architectures.
10 */
11
12#include <linux/config.h>
13#include <asm/irq.h>
14#include <asm/hardware.h>
15#include <asm/mach-types.h>
16
17#error "This code is broken and needs update to match with current ide support"
18
19
20/*
21 * Set up a hw structure for a specified data port, control port and IRQ.
22 * This should follow whatever the default interface uses.
23 */
24static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
25 unsigned long ctrl_port, int *irq)
26{
27 unsigned long reg = data_port;
28 int i;
29 int regincr = 1;
30
31 /* The Empeg board has the first two address lines unused */
32 if (machine_is_empeg())
33 regincr = 1 << 2;
34
35 /* The LART doesn't use A0 for IDE */
36 if (machine_is_lart())
37 regincr = 1 << 1;
38
39 memset(hw, 0, sizeof(*hw));
40
41 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
42 hw->io_ports[i] = reg;
43 reg += regincr;
44 }
45
46 hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
47
48 if (irq)
49 *irq = 0;
50}
51
52/*
53 * This registers the standard ports for this architecture with the IDE
54 * driver.
55 */
56static __inline__ void
57ide_init_default_hwifs(void)
58{
59 if (machine_is_lart()) {
60#ifdef CONFIG_SA1100_LART
61 hw_regs_t hw;
62
63 /* Enable GPIO as interrupt line */
64 GPDR &= ~LART_GPIO_IDE;
65 set_irq_type(LART_IRQ_IDE, IRQT_RISING);
66
67 /* set PCMCIA interface timing */
68 MECR = 0x00060006;
69
70 /* init the interface */
71 ide_init_hwif_ports(&hw, PCMCIA_IO_0_BASE + 0x0000, PCMCIA_IO_0_BASE + 0x1000, NULL);
72 hw.irq = LART_IRQ_IDE;
73 ide_register_hw(&hw);
74#endif
75 }
76}
diff --git a/include/asm-arm/arch-sa1100/io.h b/include/asm-arm/arch-sa1100/io.h
new file mode 100644
index 000000000000..7d969ffbd3bb
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/io.h
@@ -0,0 +1,23 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/io.h
3 *
4 * Copyright (C) 1997-1999 Russell King
5 *
6 * Modifications:
7 * 06-12-1997 RMK Created.
8 * 07-04-1999 RMK Major cleanup
9 */
10#ifndef __ASM_ARM_ARCH_IO_H
11#define __ASM_ARM_ARCH_IO_H
12
13#define IO_SPACE_LIMIT 0xffffffff
14
15/*
16 * We don't actually have real ISA nor PCI buses, but there is so many
17 * drivers out there that might just work if we fake them...
18 */
19#define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
20#define __mem_pci(a) (a)
21#define __mem_isa(a) (a)
22
23#endif
diff --git a/include/asm-arm/arch-sa1100/irqs.h b/include/asm-arm/arch-sa1100/irqs.h
new file mode 100644
index 000000000000..eabd3be3d705
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/irqs.h
@@ -0,0 +1,198 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/irqs.h
3 *
4 * Copyright (C) 1996 Russell King
5 * Copyright (C) 1998 Deborah Wallach (updates for SA1100/Brutus).
6 * Copyright (C) 1999 Nicolas Pitre (full GPIO irq isolation)
7 *
8 * 2001/11/14 RMK Cleaned up and standardised a lot of the IRQs.
9 */
10#include <linux/config.h>
11
12#define IRQ_GPIO0 0
13#define IRQ_GPIO1 1
14#define IRQ_GPIO2 2
15#define IRQ_GPIO3 3
16#define IRQ_GPIO4 4
17#define IRQ_GPIO5 5
18#define IRQ_GPIO6 6
19#define IRQ_GPIO7 7
20#define IRQ_GPIO8 8
21#define IRQ_GPIO9 9
22#define IRQ_GPIO10 10
23#define IRQ_GPIO11_27 11
24#define IRQ_LCD 12 /* LCD controller */
25#define IRQ_Ser0UDC 13 /* Ser. port 0 UDC */
26#define IRQ_Ser1SDLC 14 /* Ser. port 1 SDLC */
27#define IRQ_Ser1UART 15 /* Ser. port 1 UART */
28#define IRQ_Ser2ICP 16 /* Ser. port 2 ICP */
29#define IRQ_Ser3UART 17 /* Ser. port 3 UART */
30#define IRQ_Ser4MCP 18 /* Ser. port 4 MCP */
31#define IRQ_Ser4SSP 19 /* Ser. port 4 SSP */
32#define IRQ_DMA0 20 /* DMA controller channel 0 */
33#define IRQ_DMA1 21 /* DMA controller channel 1 */
34#define IRQ_DMA2 22 /* DMA controller channel 2 */
35#define IRQ_DMA3 23 /* DMA controller channel 3 */
36#define IRQ_DMA4 24 /* DMA controller channel 4 */
37#define IRQ_DMA5 25 /* DMA controller channel 5 */
38#define IRQ_OST0 26 /* OS Timer match 0 */
39#define IRQ_OST1 27 /* OS Timer match 1 */
40#define IRQ_OST2 28 /* OS Timer match 2 */
41#define IRQ_OST3 29 /* OS Timer match 3 */
42#define IRQ_RTC1Hz 30 /* RTC 1 Hz clock */
43#define IRQ_RTCAlrm 31 /* RTC Alarm */
44
45#define IRQ_GPIO11 32
46#define IRQ_GPIO12 33
47#define IRQ_GPIO13 34
48#define IRQ_GPIO14 35
49#define IRQ_GPIO15 36
50#define IRQ_GPIO16 37
51#define IRQ_GPIO17 38
52#define IRQ_GPIO18 39
53#define IRQ_GPIO19 40
54#define IRQ_GPIO20 41
55#define IRQ_GPIO21 42
56#define IRQ_GPIO22 43
57#define IRQ_GPIO23 44
58#define IRQ_GPIO24 45
59#define IRQ_GPIO25 46
60#define IRQ_GPIO26 47
61#define IRQ_GPIO27 48
62
63/*
64 * The next 16 interrupts are for board specific purposes. Since
65 * the kernel can only run on one machine at a time, we can re-use
66 * these. If you need more, increase IRQ_BOARD_END, but keep it
67 * within sensible limits. IRQs 49 to 64 are available.
68 */
69#define IRQ_BOARD_START 49
70#define IRQ_BOARD_END 65
71
72#define IRQ_SA1111_START (IRQ_BOARD_END)
73#define IRQ_GPAIN0 (IRQ_BOARD_END + 0)
74#define IRQ_GPAIN1 (IRQ_BOARD_END + 1)
75#define IRQ_GPAIN2 (IRQ_BOARD_END + 2)
76#define IRQ_GPAIN3 (IRQ_BOARD_END + 3)
77#define IRQ_GPBIN0 (IRQ_BOARD_END + 4)
78#define IRQ_GPBIN1 (IRQ_BOARD_END + 5)
79#define IRQ_GPBIN2 (IRQ_BOARD_END + 6)
80#define IRQ_GPBIN3 (IRQ_BOARD_END + 7)
81#define IRQ_GPBIN4 (IRQ_BOARD_END + 8)
82#define IRQ_GPBIN5 (IRQ_BOARD_END + 9)
83#define IRQ_GPCIN0 (IRQ_BOARD_END + 10)
84#define IRQ_GPCIN1 (IRQ_BOARD_END + 11)
85#define IRQ_GPCIN2 (IRQ_BOARD_END + 12)
86#define IRQ_GPCIN3 (IRQ_BOARD_END + 13)
87#define IRQ_GPCIN4 (IRQ_BOARD_END + 14)
88#define IRQ_GPCIN5 (IRQ_BOARD_END + 15)
89#define IRQ_GPCIN6 (IRQ_BOARD_END + 16)
90#define IRQ_GPCIN7 (IRQ_BOARD_END + 17)
91#define IRQ_MSTXINT (IRQ_BOARD_END + 18)
92#define IRQ_MSRXINT (IRQ_BOARD_END + 19)
93#define IRQ_MSSTOPERRINT (IRQ_BOARD_END + 20)
94#define IRQ_TPTXINT (IRQ_BOARD_END + 21)
95#define IRQ_TPRXINT (IRQ_BOARD_END + 22)
96#define IRQ_TPSTOPERRINT (IRQ_BOARD_END + 23)
97#define SSPXMTINT (IRQ_BOARD_END + 24)
98#define SSPRCVINT (IRQ_BOARD_END + 25)
99#define SSPROR (IRQ_BOARD_END + 26)
100#define AUDXMTDMADONEA (IRQ_BOARD_END + 32)
101#define AUDRCVDMADONEA (IRQ_BOARD_END + 33)
102#define AUDXMTDMADONEB (IRQ_BOARD_END + 34)
103#define AUDRCVDMADONEB (IRQ_BOARD_END + 35)
104#define AUDTFSR (IRQ_BOARD_END + 36)
105#define AUDRFSR (IRQ_BOARD_END + 37)
106#define AUDTUR (IRQ_BOARD_END + 38)
107#define AUDROR (IRQ_BOARD_END + 39)
108#define AUDDTS (IRQ_BOARD_END + 40)
109#define AUDRDD (IRQ_BOARD_END + 41)
110#define AUDSTO (IRQ_BOARD_END + 42)
111#define IRQ_USBPWR (IRQ_BOARD_END + 43)
112#define IRQ_HCIM (IRQ_BOARD_END + 44)
113#define IRQ_HCIBUFFACC (IRQ_BOARD_END + 45)
114#define IRQ_HCIRMTWKP (IRQ_BOARD_END + 46)
115#define IRQ_NHCIMFCIR (IRQ_BOARD_END + 47)
116#define IRQ_USB_PORT_RESUME (IRQ_BOARD_END + 48)
117#define IRQ_S0_READY_NINT (IRQ_BOARD_END + 49)
118#define IRQ_S1_READY_NINT (IRQ_BOARD_END + 50)
119#define IRQ_S0_CD_VALID (IRQ_BOARD_END + 51)
120#define IRQ_S1_CD_VALID (IRQ_BOARD_END + 52)
121#define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
122#define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
123
124#define IRQ_LOCOMO_START (IRQ_BOARD_END)
125#define IRQ_LOCOMO_KEY (IRQ_BOARD_END + 0)
126#define IRQ_LOCOMO_GPIO0 (IRQ_BOARD_END + 1)
127#define IRQ_LOCOMO_GPIO1 (IRQ_BOARD_END + 2)
128#define IRQ_LOCOMO_GPIO2 (IRQ_BOARD_END + 3)
129#define IRQ_LOCOMO_GPIO3 (IRQ_BOARD_END + 4)
130#define IRQ_LOCOMO_GPIO4 (IRQ_BOARD_END + 5)
131#define IRQ_LOCOMO_GPIO5 (IRQ_BOARD_END + 6)
132#define IRQ_LOCOMO_GPIO6 (IRQ_BOARD_END + 7)
133#define IRQ_LOCOMO_GPIO7 (IRQ_BOARD_END + 8)
134#define IRQ_LOCOMO_GPIO8 (IRQ_BOARD_END + 9)
135#define IRQ_LOCOMO_GPIO9 (IRQ_BOARD_END + 10)
136#define IRQ_LOCOMO_GPIO10 (IRQ_BOARD_END + 11)
137#define IRQ_LOCOMO_GPIO11 (IRQ_BOARD_END + 12)
138#define IRQ_LOCOMO_GPIO12 (IRQ_BOARD_END + 13)
139#define IRQ_LOCOMO_GPIO13 (IRQ_BOARD_END + 14)
140#define IRQ_LOCOMO_GPIO14 (IRQ_BOARD_END + 15)
141#define IRQ_LOCOMO_GPIO15 (IRQ_BOARD_END + 16)
142#define IRQ_LOCOMO_LT (IRQ_BOARD_END + 17)
143#define IRQ_LOCOMO_SPI_RFR (IRQ_BOARD_END + 18)
144#define IRQ_LOCOMO_SPI_RFW (IRQ_BOARD_END + 19)
145#define IRQ_LOCOMO_SPI_OVRN (IRQ_BOARD_END + 20)
146#define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21)
147
148/*
149 * Figure out the MAX IRQ number.
150 *
151 * If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1.
152 * If we have an LoCoMo, the max IRQ is IRQ_LOCOMO_SPI_TEND+1
153 * Otherwise, we have the standard IRQs only.
154 */
155#ifdef CONFIG_SA1111
156#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
157#elif defined(CONFIG_SA1100_H3800)
158#define NR_IRQS (IRQ_BOARD_END)
159#elif defined(CONFIG_SHARP_LOCOMO)
160#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1)
161#else
162#define NR_IRQS (IRQ_BOARD_START)
163#endif
164
165/*
166 * Board specific IRQs. Define them here.
167 * Do not surround them with ifdefs.
168 */
169#define IRQ_NEPONSET_SMC9196 (IRQ_BOARD_START + 0)
170#define IRQ_NEPONSET_USAR (IRQ_BOARD_START + 1)
171#define IRQ_NEPONSET_SA1111 (IRQ_BOARD_START + 2)
172
173/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
174#define IRQ_LOCOMO_KEY_BASE (IRQ_BOARD_START + 0)
175#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
176#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
177#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
178
179/* H3800-specific IRQs (CONFIG_SA1100_H3800) */
180#define H3800_KPIO_IRQ_START (IRQ_BOARD_START)
181#define IRQ_H3800_KEY (IRQ_BOARD_START + 0)
182#define IRQ_H3800_SPI (IRQ_BOARD_START + 1)
183#define IRQ_H3800_OWM (IRQ_BOARD_START + 2)
184#define IRQ_H3800_ADC (IRQ_BOARD_START + 3)
185#define IRQ_H3800_UART_0 (IRQ_BOARD_START + 4)
186#define IRQ_H3800_UART_1 (IRQ_BOARD_START + 5)
187#define IRQ_H3800_TIMER_0 (IRQ_BOARD_START + 6)
188#define IRQ_H3800_TIMER_1 (IRQ_BOARD_START + 7)
189#define IRQ_H3800_TIMER_2 (IRQ_BOARD_START + 8)
190#define H3800_KPIO_IRQ_COUNT 9
191
192#define H3800_GPIO_IRQ_START (IRQ_BOARD_START + 9)
193#define IRQ_H3800_PEN (IRQ_BOARD_START + 9)
194#define IRQ_H3800_SD_DETECT (IRQ_BOARD_START + 10)
195#define IRQ_H3800_EAR_IN (IRQ_BOARD_START + 11)
196#define IRQ_H3800_USB_DETECT (IRQ_BOARD_START + 12)
197#define IRQ_H3800_SD_CON_SLT (IRQ_BOARD_START + 13)
198#define H3800_GPIO_IRQ_COUNT 5
diff --git a/include/asm-arm/arch-sa1100/jornada720.h b/include/asm-arm/arch-sa1100/jornada720.h
new file mode 100644
index 000000000000..1b8e8a304800
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/jornada720.h
@@ -0,0 +1,28 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/jornada720.h
3 *
4 * Created 2000/11/29 by John Ankcorn <jca@lcs.mit.edu>
5 *
6 * This file contains the hardware specific definitions for HP Jornada 720
7 *
8 */
9
10#ifndef __ASM_ARCH_HARDWARE_H
11#error "include <asm/hardware.h> instead"
12#endif
13
14#define SA1111_BASE (0x40000000)
15
16#define GPIO_JORNADA720_KEYBOARD GPIO_GPIO(0)
17#define GPIO_JORNADA720_MOUSE GPIO_GPIO(9)
18
19#define GPIO_JORNADA720_KEYBOARD_IRQ IRQ_GPIO0
20#define GPIO_JORNADA720_MOUSE_IRQ IRQ_GPIO9
21
22#ifndef __ASSEMBLY__
23
24void jornada720_mcu_init(void);
25void jornada_contrast(int arg_contrast);
26void jornada720_battery(void);
27int jornada720_getkey(unsigned char *data, int size);
28#endif
diff --git a/include/asm-arm/arch-sa1100/lart.h b/include/asm-arm/arch-sa1100/lart.h
new file mode 100644
index 000000000000..8a5482d908db
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/lart.h
@@ -0,0 +1,13 @@
1#ifndef _INCLUDE_LART_H
2#define _INCLUDE_LART_H
3
4#define LART_GPIO_ETH0 GPIO_GPIO0
5#define LART_IRQ_ETH0 IRQ_GPIO0
6
7#define LART_GPIO_IDE GPIO_GPIO1
8#define LART_IRQ_IDE IRQ_GPIO1
9
10#define LART_GPIO_UCB1200 GPIO_GPIO18
11#define LART_IRQ_UCB1200 IRQ_GPIO18
12
13#endif
diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h
new file mode 100644
index 000000000000..32d3d5bde34d
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/memory.h
@@ -0,0 +1,108 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/memory.h
3 *
4 * Copyright (C) 1999-2000 Nicolas Pitre <nico@cam.org>
5 */
6
7#ifndef __ASM_ARCH_MEMORY_H
8#define __ASM_ARCH_MEMORY_H
9
10#include <linux/config.h>
11#include <asm/sizes.h>
12
13/*
14 * Physical DRAM offset is 0xc0000000 on the SA1100
15 */
16#define PHYS_OFFSET (0xc0000000UL)
17
18#ifndef __ASSEMBLY__
19
20#ifdef CONFIG_SA1111
21static inline void
22__arch_adjust_zones(int node, unsigned long *size, unsigned long *holes)
23{
24 unsigned int sz = SZ_1M >> PAGE_SHIFT;
25
26 if (node != 0)
27 sz = 0;
28
29 size[1] = size[0] - sz;
30 size[0] = sz;
31}
32
33#define arch_adjust_zones(node, size, holes) \
34 __arch_adjust_zones(node, size, holes)
35
36#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_1M - 1)
37
38#endif
39#endif
40
41/*
42 * Virtual view <-> DMA view memory address translations
43 * virt_to_bus: Used to translate the virtual address to an
44 * address suitable to be passed to set_dma_addr
45 * bus_to_virt: Used to convert an address for DMA operations
46 * to an address that the kernel can use.
47 *
48 * On the SA1100, bus addresses are equivalent to physical addresses.
49 */
50#define __virt_to_bus(x) __virt_to_phys(x)
51#define __bus_to_virt(x) __phys_to_virt(x)
52
53#ifdef CONFIG_DISCONTIGMEM
54/*
55 * Because of the wide memory address space between physical RAM banks on the
56 * SA1100, it's much convenient to use Linux's NUMA support to implement our
57 * memory map representation. Assuming all memory nodes have equal access
58 * characteristics, we then have generic discontiguous memory support.
59 *
60 * Of course, all this isn't mandatory for SA1100 implementations with only
61 * one used memory bank. For those, simply undefine CONFIG_DISCONTIGMEM.
62 *
63 * The nodes are matched with the physical memory bank addresses which are
64 * incidentally the same as virtual addresses.
65 *
66 * node 0: 0xc0000000 - 0xc7ffffff
67 * node 1: 0xc8000000 - 0xcfffffff
68 * node 2: 0xd0000000 - 0xd7ffffff
69 * node 3: 0xd8000000 - 0xdfffffff
70 */
71
72/*
73 * Given a kernel address, find the home node of the underlying memory.
74 */
75#define KVADDR_TO_NID(addr) (((unsigned long)(addr) - PAGE_OFFSET) >> 27)
76
77/*
78 * Given a page frame number, convert it to a node id.
79 */
80#define PFN_TO_NID(pfn) (((pfn) - PHYS_PFN_OFFSET) >> (27 - PAGE_SHIFT))
81
82/*
83 * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
84 * and return the mem_map of that node.
85 */
86#define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr))
87
88/*
89 * Given a page frame number, find the owning node of the memory
90 * and return the mem_map of that node.
91 */
92#define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn))
93
94/*
95 * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
96 * and returns the index corresponding to the appropriate page in the
97 * node's mem_map.
98 */
99#define LOCAL_MAP_NR(addr) \
100 (((unsigned long)(addr) & 0x07ffffff) >> PAGE_SHIFT)
101
102#else
103
104#define PFN_TO_NID(addr) (0)
105
106#endif
107
108#endif
diff --git a/include/asm-arm/arch-sa1100/neponset.h b/include/asm-arm/arch-sa1100/neponset.h
new file mode 100644
index 000000000000..8051fd73a80b
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/neponset.h
@@ -0,0 +1,74 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/assabet.h
3 *
4 * Created 2000/06/05 by Nicolas Pitre <nico@cam.org>
5 *
6 * This file contains the hardware specific definitions for Assabet
7 * Only include this file from SA1100-specific files.
8 *
9 * 2000/05/23 John Dorsey <john+@cs.cmu.edu>
10 * Definitions for Neponset added.
11 */
12#ifndef __ASM_ARCH_NEPONSET_H
13#define __ASM_ARCH_NEPONSET_H
14
15/*
16 * Neponset definitions:
17 */
18
19#define NEPONSET_CPLD_BASE (0x10000000)
20#define Nep_p2v( x ) ((x) - NEPONSET_CPLD_BASE + 0xf3000000)
21#define Nep_v2p( x ) ((x) - 0xf3000000 + NEPONSET_CPLD_BASE)
22
23#define _IRR 0x10000024 /* Interrupt Reason Register */
24#define _AUD_CTL 0x100000c0 /* Audio controls (RW) */
25#define _MDM_CTL_0 0x100000b0 /* Modem control 0 (RW) */
26#define _MDM_CTL_1 0x100000b4 /* Modem control 1 (RW) */
27#define _NCR_0 0x100000a0 /* Control Register (RW) */
28#define _KP_X_OUT 0x10000090 /* Keypad row write (RW) */
29#define _KP_Y_IN 0x10000080 /* Keypad column read (RO) */
30#define _SWPK 0x10000020 /* Switch pack (RO) */
31#define _WHOAMI 0x10000000 /* System ID Register (RO) */
32
33#define _LEDS 0x10000010 /* LEDs [31:0] (WO) */
34
35#define IRR (*((volatile u_char *) Nep_p2v(_IRR)))
36#define AUD_CTL (*((volatile u_char *) Nep_p2v(_AUD_CTL)))
37#define MDM_CTL_0 (*((volatile u_char *) Nep_p2v(_MDM_CTL_0)))
38#define MDM_CTL_1 (*((volatile u_char *) Nep_p2v(_MDM_CTL_1)))
39#define NCR_0 (*((volatile u_char *) Nep_p2v(_NCR_0)))
40#define KP_X_OUT (*((volatile u_char *) Nep_p2v(_KP_X_OUT)))
41#define KP_Y_IN (*((volatile u_char *) Nep_p2v(_KP_Y_IN)))
42#define SWPK (*((volatile u_char *) Nep_p2v(_SWPK)))
43#define WHOAMI (*((volatile u_char *) Nep_p2v(_WHOAMI)))
44
45#define LEDS (*((volatile Word *) Nep_p2v(_LEDS)))
46
47#define IRR_ETHERNET (1<<0)
48#define IRR_USAR (1<<1)
49#define IRR_SA1111 (1<<2)
50
51#define AUD_SEL_1341 (1<<0)
52#define AUD_MUTE_1341 (1<<1)
53
54#define MDM_CTL0_RTS1 (1 << 0)
55#define MDM_CTL0_DTR1 (1 << 1)
56#define MDM_CTL0_RTS2 (1 << 2)
57#define MDM_CTL0_DTR2 (1 << 3)
58
59#define MDM_CTL1_CTS1 (1 << 0)
60#define MDM_CTL1_DSR1 (1 << 1)
61#define MDM_CTL1_DCD1 (1 << 2)
62#define MDM_CTL1_CTS2 (1 << 3)
63#define MDM_CTL1_DSR2 (1 << 4)
64#define MDM_CTL1_DCD2 (1 << 5)
65
66#define NCR_GP01_OFF (1<<0)
67#define NCR_TP_PWR_EN (1<<1)
68#define NCR_MS_PWR_EN (1<<2)
69#define NCR_ENET_OSC_EN (1<<3)
70#define NCR_SPI_KB_WK_UP (1<<4)
71#define NCR_A0VPP (1<<5)
72#define NCR_A1VPP (1<<6)
73
74#endif
diff --git a/include/asm-arm/arch-sa1100/param.h b/include/asm-arm/arch-sa1100/param.h
new file mode 100644
index 000000000000..867488909ecd
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/param.h
@@ -0,0 +1,3 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/param.h
3 */
diff --git a/include/asm-arm/arch-sa1100/shannon.h b/include/asm-arm/arch-sa1100/shannon.h
new file mode 100644
index 000000000000..ec27d6e12140
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/shannon.h
@@ -0,0 +1,43 @@
1#ifndef _INCLUDE_SHANNON_H
2#define _INCLUDE_SHANNON_H
3
4/* taken from comp.os.inferno Tue, 12 Sep 2000 09:21:50 GMT,
5 * written by <forsyth@vitanuova.com> */
6
7#define SHANNON_GPIO_SPI_FLASH GPIO_GPIO (0) /* Output - Driven low, enables SPI to flash */
8#define SHANNON_GPIO_SPI_DSP GPIO_GPIO (1) /* Output - Driven low, enables SPI to DSP */
9/* lcd lower = GPIO 2-9 */
10#define SHANNON_GPIO_SPI_OUTPUT GPIO_GPIO (10) /* Output - SPI output to DSP */
11#define SHANNON_GPIO_SPI_INPUT GPIO_GPIO (11) /* Input - SPI input from DSP */
12#define SHANNON_GPIO_SPI_CLOCK GPIO_GPIO (12) /* Output - Clock for SPI */
13#define SHANNON_GPIO_SPI_FRAME GPIO_GPIO (13) /* Output - Frame marker - not used */
14#define SHANNON_GPIO_SPI_RTS GPIO_GPIO (14) /* Input - SPI Ready to Send */
15#define SHANNON_IRQ_GPIO_SPI_RTS IRQ_GPIO14
16#define SHANNON_GPIO_SPI_CTS GPIO_GPIO (15) /* Output - SPI Clear to Send */
17#define SHANNON_GPIO_IRQ_CODEC GPIO_GPIO (16) /* in, irq from ucb1200 */
18#define SHANNON_IRQ_GPIO_IRQ_CODEC IRQ_GPIO16
19#define SHANNON_GPIO_DSP_RESET GPIO_GPIO (17) /* Output - Drive low to reset the DSP */
20#define SHANNON_GPIO_CODEC_RESET GPIO_GPIO (18) /* Output - Drive low to reset the UCB1x00 */
21#define SHANNON_GPIO_U3_RTS GPIO_GPIO (19) /* ?? */
22#define SHANNON_GPIO_U3_CTS GPIO_GPIO (20) /* ?? */
23#define SHANNON_GPIO_SENSE_12V GPIO_GPIO (21) /* Input, 12v flash unprotect detected */
24#define SHANNON_GPIO_DISP_EN GPIO_GPIO (22) /* out */
25/* XXX GPIO 23 unaccounted for */
26#define SHANNON_GPIO_EJECT_0 GPIO_GPIO (24) /* in */
27#define SHANNON_IRQ_GPIO_EJECT_0 IRQ_GPIO24
28#define SHANNON_GPIO_EJECT_1 GPIO_GPIO (25) /* in */
29#define SHANNON_IRQ_GPIO_EJECT_1 IRQ_GPIO25
30#define SHANNON_GPIO_RDY_0 GPIO_GPIO (26) /* in */
31#define SHANNON_IRQ_GPIO_RDY_0 IRQ_GPIO26
32#define SHANNON_GPIO_RDY_1 GPIO_GPIO (27) /* in */
33#define SHANNON_IRQ_GPIO_RDY_1 IRQ_GPIO27
34
35/* MCP UCB codec GPIO pins... */
36
37#define SHANNON_UCB_GPIO_BACKLIGHT 9
38#define SHANNON_UCB_GPIO_BRIGHT_MASK 7
39#define SHANNON_UCB_GPIO_BRIGHT 6
40#define SHANNON_UCB_GPIO_CONTRAST_MASK 0x3f
41#define SHANNON_UCB_GPIO_CONTRAST 0
42
43#endif
diff --git a/include/asm-arm/arch-sa1100/simpad.h b/include/asm-arm/arch-sa1100/simpad.h
new file mode 100644
index 000000000000..034301d23f60
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/simpad.h
@@ -0,0 +1,112 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/simpad.h
3 *
4 * based of assabet.h same as HUW_Webpanel
5 *
6 * This file contains the hardware specific definitions for SIMpad
7 *
8 * 2001/05/14 Juergen Messerer <juergen.messerer@freesurf.ch>
9 */
10
11#ifndef __ASM_ARCH_SIMPAD_H
12#define __ASM_ARCH_SIMPAD_H
13
14
15#define GPIO_UART1_RTS GPIO_GPIO14
16#define GPIO_UART1_DTR GPIO_GPIO7
17#define GPIO_UART1_CTS GPIO_GPIO8
18#define GPIO_UART1_DCD GPIO_GPIO23
19#define GPIO_UART1_DSR GPIO_GPIO6
20
21#define GPIO_UART3_RTS GPIO_GPIO12
22#define GPIO_UART3_DTR GPIO_GPIO16
23#define GPIO_UART3_CTS GPIO_GPIO13
24#define GPIO_UART3_DCD GPIO_GPIO18
25#define GPIO_UART3_DSR GPIO_GPIO17
26
27#define GPIO_POWER_BUTTON GPIO_GPIO0
28#define GPIO_UCB1300_IRQ GPIO_GPIO22 /* UCB GPIO and touchscreen */
29
30#define IRQ_UART1_CTS IRQ_GPIO15
31#define IRQ_UART1_DCD GPIO_GPIO23
32#define IRQ_UART1_DSR GPIO_GPIO6
33#define IRQ_UART3_CTS GPIO_GPIO13
34#define IRQ_UART3_DCD GPIO_GPIO18
35#define IRQ_UART3_DSR GPIO_GPIO17
36
37#define IRQ_GPIO_UCB1300_IRQ IRQ_GPIO22
38#define IRQ_GPIO_POWER_BUTTON IRQ_GPIO0
39
40
41/*--- PCMCIA ---*/
42#define GPIO_CF_CD GPIO_GPIO24
43#define GPIO_CF_IRQ GPIO_GPIO1
44#define IRQ_GPIO_CF_IRQ IRQ_GPIO1
45#define IRQ_GPIO_CF_CD IRQ_GPIO24
46
47/*--- SmartCard ---*/
48#define GPIO_SMART_CARD GPIO_GPIO10
49#define IRQ_GPIO_SMARD_CARD IRQ_GPIO10
50
51// CS3 Latch is write only, a shadow is necessary
52
53#define CS3BUSTYPE unsigned volatile long
54#define CS3_BASE 0xf1000000
55
56#define VCC_5V_EN 0x0001 // For 5V PCMCIA
57#define VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA
58#define EN1 0x0004 // This is only for EPROM's
59#define EN0 0x0008 // Both should be enable for 3.3V or 5V
60#define DISPLAY_ON 0x0010
61#define PCMCIA_BUFF_DIS 0x0020
62#define MQ_RESET 0x0040
63#define PCMCIA_RESET 0x0080
64#define DECT_POWER_ON 0x0100
65#define IRDA_SD 0x0200 // Shutdown for powersave
66#define RS232_ON 0x0400
67#define SD_MEDIAQ 0x0800 // Shutdown for powersave
68#define LED2_ON 0x1000
69#define IRDA_MODE 0x2000 // Fast/Slow IrDA mode
70#define ENABLE_5V 0x4000 // Enable 5V circuit
71#define RESET_SIMCARD 0x8000
72
73#define RS232_ENABLE 0x0440
74#define PCMCIAMASK 0x402f
75
76
77struct simpad_battery {
78 unsigned char ac_status; /* line connected yes/no */
79 unsigned char status; /* battery loading yes/no */
80 unsigned char percentage; /* percentage loaded */
81 unsigned short life; /* life till empty */
82};
83
84/* These should match the apm_bios.h definitions */
85#define SIMPAD_AC_STATUS_AC_OFFLINE 0x00
86#define SIMPAD_AC_STATUS_AC_ONLINE 0x01
87#define SIMPAD_AC_STATUS_AC_BACKUP 0x02 /* What does this mean? */
88#define SIMPAD_AC_STATUS_AC_UNKNOWN 0xff
89
90/* These bitfields are rarely "or'd" together */
91#define SIMPAD_BATT_STATUS_HIGH 0x01
92#define SIMPAD_BATT_STATUS_LOW 0x02
93#define SIMPAD_BATT_STATUS_CRITICAL 0x04
94#define SIMPAD_BATT_STATUS_CHARGING 0x08
95#define SIMPAD_BATT_STATUS_CHARGE_MAIN 0x10
96#define SIMPAD_BATT_STATUS_DEAD 0x20 /* Battery will not charge */
97#define SIMPAD_BATT_NOT_INSTALLED 0x20 /* For expansion pack batteries */
98#define SIMPAD_BATT_STATUS_FULL 0x40 /* Battery fully charged (and connected to AC) */
99#define SIMPAD_BATT_STATUS_NOBATT 0x80
100#define SIMPAD_BATT_STATUS_UNKNOWN 0xff
101
102extern int simpad_get_battery(struct simpad_battery* );
103
104#endif // __ASM_ARCH_SIMPAD_H
105
106
107
108
109
110
111
112
diff --git a/include/asm-arm/arch-sa1100/system.h b/include/asm-arm/arch-sa1100/system.h
new file mode 100644
index 000000000000..6f52118ba1a4
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/system.h
@@ -0,0 +1,22 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/system.h
3 *
4 * Copyright (c) 1999 Nicolas Pitre <nico@cam.org>
5 */
6#include <linux/config.h>
7
8static inline void arch_idle(void)
9{
10 cpu_do_idle();
11}
12
13static inline void arch_reset(char mode)
14{
15 if (mode == 's') {
16 /* Jump into ROM at address 0 */
17 cpu_reset(0);
18 } else {
19 /* Use on-chip reset capability */
20 RSRR = RSRR_SWR;
21 }
22}
diff --git a/include/asm-arm/arch-sa1100/timex.h b/include/asm-arm/arch-sa1100/timex.h
new file mode 100644
index 000000000000..837be9b797dd
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/timex.h
@@ -0,0 +1,12 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/timex.h
3 *
4 * SA1100 architecture timex specifications
5 *
6 * Copyright (C) 1998
7 */
8
9/*
10 * SA1100 timer
11 */
12#define CLOCK_TICK_RATE 3686400
diff --git a/include/asm-arm/arch-sa1100/uncompress.h b/include/asm-arm/arch-sa1100/uncompress.h
new file mode 100644
index 000000000000..43453501ee66
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/uncompress.h
@@ -0,0 +1,53 @@
1/*
2 * linux/include/asm-arm/arch-brutus/uncompress.h
3 *
4 * (C) 1999 Nicolas Pitre <nico@cam.org>
5 *
6 * Reorganised to be machine independent.
7 */
8
9#include "hardware.h"
10
11/*
12 * The following code assumes the serial port has already been
13 * initialized by the bootloader. We search for the first enabled
14 * port in the most probable order. If you didn't setup a port in
15 * your bootloader then nothing will appear (which might be desired).
16 */
17
18#define UART(x) (*(volatile unsigned long *)(serial_port + (x)))
19
20static void putstr( const char *s )
21{
22 unsigned long serial_port;
23
24 do {
25 serial_port = _Ser3UTCR0;
26 if (UART(UTCR3) & UTCR3_TXE) break;
27 serial_port = _Ser1UTCR0;
28 if (UART(UTCR3) & UTCR3_TXE) break;
29 serial_port = _Ser2UTCR0;
30 if (UART(UTCR3) & UTCR3_TXE) break;
31 return;
32 } while (0);
33
34 for (; *s; s++) {
35 /* wait for space in the UART's transmitter */
36 while (!(UART(UTSR1) & UTSR1_TNF));
37
38 /* send the character out. */
39 UART(UTDR) = *s;
40
41 /* if a LF, also do CR... */
42 if (*s == 10) {
43 while (!(UART(UTSR1) & UTSR1_TNF));
44 UART(UTDR) = 13;
45 }
46 }
47}
48
49/*
50 * Nothing to do for these
51 */
52#define arch_decomp_setup()
53#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-sa1100/vmalloc.h b/include/asm-arm/arch-sa1100/vmalloc.h
new file mode 100644
index 000000000000..135bc9493c06
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/vmalloc.h
@@ -0,0 +1,15 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/vmalloc.h
3 */
4
5/*
6 * Just any arbitrary offset to the start of the vmalloc VM area: the
7 * current 8MB value just means that there will be a 8MB "hole" after the
8 * physical memory until the kernel virtual memory starts. That means that
9 * any out-of-bounds memory accesses will hopefully be caught.
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;)
12 */
13#define VMALLOC_OFFSET (8*1024*1024)
14#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
15#define VMALLOC_END (0xe8000000)
diff --git a/include/asm-arm/arch-shark/debug-macro.S b/include/asm-arm/arch-shark/debug-macro.S
new file mode 100644
index 000000000000..7cb37f78825e
--- /dev/null
+++ b/include/asm-arm/arch-shark/debug-macro.S
@@ -0,0 +1,31 @@
1/* linux/include/asm-arm/arch-shark/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 .macro addruart,rx
15 mov \rx, #0xe0000000
16 orr \rx, \rx, #0x000003f8
17 .endm
18
19 .macro senduart,rd,rx
20 strb \rd, [\rx]
21 .endm
22
23 .macro busyuart,rd,rx
24 mov \rd, #0
251001: add \rd, \rd, #1
26 teq \rd, #0x10000
27 bne 1001b
28 .endm
29
30 .macro waituart,rd,rx
31 .endm
diff --git a/include/asm-arm/arch-shark/dma.h b/include/asm-arm/arch-shark/dma.h
new file mode 100644
index 000000000000..fc985d5e62af
--- /dev/null
+++ b/include/asm-arm/arch-shark/dma.h
@@ -0,0 +1,18 @@
1/*
2 * linux/include/asm-arm/arch-shark/dma.h
3 *
4 * by Alexander Schulz
5 */
6#ifndef __ASM_ARCH_DMA_H
7#define __ASM_ARCH_DMA_H
8
9/* Use only the lowest 4MB, nothing else works.
10 * The rest is not DMAable. See dev / .properties
11 * in OpenFirmware.
12 */
13#define MAX_DMA_ADDRESS 0xC0400000
14#define MAX_DMA_CHANNELS 8
15#define DMA_ISA_CASCADE 4
16
17#endif /* _ASM_ARCH_DMA_H */
18
diff --git a/include/asm-arm/arch-shark/entry-macro.S b/include/asm-arm/arch-shark/entry-macro.S
new file mode 100644
index 000000000000..a924f27fb8d9
--- /dev/null
+++ b/include/asm-arm/arch-shark/entry-macro.S
@@ -0,0 +1,35 @@
1/*
2 * include/asm-arm/arch-shark/entry-macro.S
3 *
4 * Low-level IRQ helper macros for Shark platform
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10 .macro disable_fiq
11 .endm
12
13 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
14 mov r4, #0xe0000000
15
16 mov \irqstat, #0x0C
17 strb \irqstat, [r4, #0x20] @outb(0x0C, 0x20) /* Poll command */
18 ldrb \irqnr, [r4, #0x20] @irq = inb(0x20) & 7
19 and \irqstat, \irqnr, #0x80
20 teq \irqstat, #0
21 beq 43f
22 and \irqnr, \irqnr, #7
23 teq \irqnr, #2
24 bne 44f
2543: mov \irqstat, #0x0C
26 strb \irqstat, [r4, #0xa0] @outb(0x0C, 0xA0) /* Poll command */
27 ldrb \irqnr, [r4, #0xa0] @irq = (inb(0xA0) & 7) + 8
28 and \irqstat, \irqnr, #0x80
29 teq \irqstat, #0
30 beq 44f
31 and \irqnr, \irqnr, #7
32 add \irqnr, \irqnr, #8
3344: teq \irqstat, #0
34 .endm
35
diff --git a/include/asm-arm/arch-shark/hardware.h b/include/asm-arm/arch-shark/hardware.h
new file mode 100644
index 000000000000..4d35f8c154c3
--- /dev/null
+++ b/include/asm-arm/arch-shark/hardware.h
@@ -0,0 +1,57 @@
1/*
2 * linux/include/asm-arm/arch-shark/hardware.h
3 *
4 * by Alexander Schulz
5 *
6 * derived from:
7 * linux/include/asm-arm/arch-ebsa110/hardware.h
8 * Copyright (C) 1996-1999 Russell King.
9 */
10#ifndef __ASM_ARCH_HARDWARE_H
11#define __ASM_ARCH_HARDWARE_H
12
13#ifndef __ASSEMBLY__
14
15/*
16 * Mapping areas
17 */
18#define IO_BASE 0xe0000000
19
20/*
21 * RAM definitions
22 */
23#define FLUSH_BASE_PHYS 0x80000000
24
25#else
26
27#define IO_BASE 0
28
29#endif
30
31#define IO_SIZE 0x08000000
32#define IO_START 0x40000000
33#define ROMCARD_SIZE 0x08000000
34#define ROMCARD_START 0x10000000
35
36#define FLUSH_BASE 0xdf000000
37#define PCIO_BASE 0xe0000000
38
39
40/* defines for the Framebuffer */
41#define FB_START 0x06000000
42#define FB_SIZE 0x01000000
43
44#define UNCACHEABLE_ADDR 0xdf010000
45
46#define SEQUOIA_LED_GREEN (1<<6)
47#define SEQUOIA_LED_AMBER (1<<5)
48#define SEQUOIA_LED_BACK (1<<7)
49
50#define pcibios_assign_all_busses() 1
51
52#define PCIBIOS_MIN_IO 0x6000
53#define PCIBIOS_MIN_MEM 0x50000000
54#define PCIMEM_BASE 0xe8000000
55
56#endif
57
diff --git a/include/asm-arm/arch-shark/io.h b/include/asm-arm/arch-shark/io.h
new file mode 100644
index 000000000000..1e7f26bc2e1d
--- /dev/null
+++ b/include/asm-arm/arch-shark/io.h
@@ -0,0 +1,199 @@
1/*
2 * linux/include/asm-arm/arch-shark/io.h
3 *
4 * by Alexander Schulz
5 *
6 * derived from:
7 * linux/include/asm-arm/arch-ebsa110/io.h
8 * Copyright (C) 1997,1998 Russell King
9 */
10
11#ifndef __ASM_ARM_ARCH_IO_H
12#define __ASM_ARM_ARCH_IO_H
13
14#define IO_SPACE_LIMIT 0xffffffff
15
16/*
17 * We use two different types of addressing - PC style addresses, and ARM
18 * addresses. PC style accesses the PC hardware with the normal PC IO
19 * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
20 * and are translated to the start of IO.
21 */
22#define __PORT_PCIO(x) (!((x) & 0x80000000))
23
24/*
25 * Dynamic IO functions - let the compiler
26 * optimize the expressions
27 */
28#define DECLARE_DYN_OUT(fnsuffix,instr) \
29static inline void __out##fnsuffix (unsigned int value, unsigned int port) \
30{ \
31 unsigned long temp; \
32 __asm__ __volatile__( \
33 "tst %2, #0x80000000\n\t" \
34 "mov %0, %4\n\t" \
35 "addeq %0, %0, %3\n\t" \
36 "str" instr " %1, [%0, %2] @ out" #fnsuffix \
37 : "=&r" (temp) \
38 : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
39 : "cc"); \
40}
41
42#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
43static inline unsigned sz __in##fnsuffix (unsigned int port) \
44{ \
45 unsigned long temp, value; \
46 __asm__ __volatile__( \
47 "tst %2, #0x80000000\n\t" \
48 "mov %0, %4\n\t" \
49 "addeq %0, %0, %3\n\t" \
50 "ldr" instr " %1, [%0, %2] @ in" #fnsuffix \
51 : "=&r" (temp), "=r" (value) \
52 : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
53 : "cc"); \
54 return (unsigned sz)value; \
55}
56
57static inline unsigned int __ioaddr (unsigned int port) \
58{ \
59 if (__PORT_PCIO(port)) \
60 return (unsigned int)(PCIO_BASE + (port)); \
61 else \
62 return (unsigned int)(IO_BASE + (port)); \
63}
64
65#define DECLARE_IO(sz,fnsuffix,instr) \
66 DECLARE_DYN_OUT(fnsuffix,instr) \
67 DECLARE_DYN_IN(sz,fnsuffix,instr)
68
69DECLARE_IO(char,b,"b")
70DECLARE_IO(short,w,"h")
71DECLARE_IO(long,l,"")
72
73#undef DECLARE_IO
74#undef DECLARE_DYN_OUT
75#undef DECLARE_DYN_IN
76
77/*
78 * Constant address IO functions
79 *
80 * These have to be macros for the 'J' constraint to work -
81 * +/-4096 immediate operand.
82 */
83#define __outbc(value,port) \
84({ \
85 if (__PORT_PCIO((port))) \
86 __asm__ __volatile__( \
87 "strb %0, [%1, %2] @ outbc" \
88 : : "r" (value), "r" (PCIO_BASE), "Jr" (port)); \
89 else \
90 __asm__ __volatile__( \
91 "strb %0, [%1, %2] @ outbc" \
92 : : "r" (value), "r" (IO_BASE), "r" (port)); \
93})
94
95#define __inbc(port) \
96({ \
97 unsigned char result; \
98 if (__PORT_PCIO((port))) \
99 __asm__ __volatile__( \
100 "ldrb %0, [%1, %2] @ inbc" \
101 : "=r" (result) : "r" (PCIO_BASE), "Jr" (port)); \
102 else \
103 __asm__ __volatile__( \
104 "ldrb %0, [%1, %2] @ inbc" \
105 : "=r" (result) : "r" (IO_BASE), "r" (port)); \
106 result; \
107})
108
109#define __outwc(value,port) \
110({ \
111 unsigned long v = value; \
112 if (__PORT_PCIO((port))) \
113 __asm__ __volatile__( \
114 "strh %0, [%1, %2] @ outwc" \
115 : : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" (port)); \
116 else \
117 __asm__ __volatile__( \
118 "strh %0, [%1, %2] @ outwc" \
119 : : "r" (v|v<<16), "r" (IO_BASE), "r" (port)); \
120})
121
122#define __inwc(port) \
123({ \
124 unsigned short result; \
125 if (__PORT_PCIO((port))) \
126 __asm__ __volatile__( \
127 "ldrh %0, [%1, %2] @ inwc" \
128 : "=r" (result) : "r" (PCIO_BASE), "Jr" (port)); \
129 else \
130 __asm__ __volatile__( \
131 "ldrh %0, [%1, %2] @ inwc" \
132 : "=r" (result) : "r" (IO_BASE), "r" (port)); \
133 result & 0xffff; \
134})
135
136#define __outlc(value,port) \
137({ \
138 unsigned long v = value; \
139 if (__PORT_PCIO((port))) \
140 __asm__ __volatile__( \
141 "str %0, [%1, %2] @ outlc" \
142 : : "r" (v), "r" (PCIO_BASE), "Jr" (port)); \
143 else \
144 __asm__ __volatile__( \
145 "str %0, [%1, %2] @ outlc" \
146 : : "r" (v), "r" (IO_BASE), "r" (port)); \
147})
148
149#define __inlc(port) \
150({ \
151 unsigned long result; \
152 if (__PORT_PCIO((port))) \
153 __asm__ __volatile__( \
154 "ldr %0, [%1, %2] @ inlc" \
155 : "=r" (result) : "r" (PCIO_BASE), "Jr" (port)); \
156 else \
157 __asm__ __volatile__( \
158 "ldr %0, [%1, %2] @ inlc" \
159 : "=r" (result) : "r" (IO_BASE), "r" (port)); \
160 result; \
161})
162
163#define __ioaddrc(port) \
164({ \
165 unsigned long addr; \
166 if (__PORT_PCIO((port))) \
167 addr = PCIO_BASE + (port); \
168 else \
169 addr = IO_BASE + (port); \
170 addr; \
171})
172
173#define __mem_pci(addr) (addr)
174
175#define inb(p) (__builtin_constant_p((p)) ? __inbc(p) : __inb(p))
176#define inw(p) (__builtin_constant_p((p)) ? __inwc(p) : __inw(p))
177#define inl(p) (__builtin_constant_p((p)) ? __inlc(p) : __inl(p))
178#define outb(v,p) (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p))
179#define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))
180#define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))
181
182/*
183 * Translated address IO functions
184 *
185 * IO address has already been translated to a virtual address
186 */
187#define outb_t(v,p) \
188 (*(volatile unsigned char *)(p) = (v))
189
190#define inb_t(p) \
191 (*(volatile unsigned char *)(p))
192
193#define outl_t(v,p) \
194 (*(volatile unsigned long *)(p) = (v))
195
196#define inl_t(p) \
197 (*(volatile unsigned long *)(p))
198
199#endif
diff --git a/include/asm-arm/arch-shark/irqs.h b/include/asm-arm/arch-shark/irqs.h
new file mode 100644
index 000000000000..b36cc975b290
--- /dev/null
+++ b/include/asm-arm/arch-shark/irqs.h
@@ -0,0 +1,13 @@
1/*
2 * linux/include/asm-arm/arch-shark/irqs.h
3 *
4 * by Alexander Schulz
5 */
6
7#define NR_IRQS 16
8
9#define IRQ_ISA_KEYBOARD 1
10#define RTC_IRQ 8
11#define I8042_KBD_IRQ 1
12#define I8042_AUX_IRQ 12
13#define IRQ_HARDDISK 14
diff --git a/include/asm-arm/arch-shark/memory.h b/include/asm-arm/arch-shark/memory.h
new file mode 100644
index 000000000000..8ff956d25463
--- /dev/null
+++ b/include/asm-arm/arch-shark/memory.h
@@ -0,0 +1,42 @@
1/*
2 * linux/include/asm-arm/arch-shark/memory.h
3 *
4 * by Alexander Schulz
5 *
6 * derived from:
7 * linux/include/asm-arm/arch-ebsa110/memory.h
8 * Copyright (c) 1996-1999 Russell King.
9 */
10#ifndef __ASM_ARCH_MEMORY_H
11#define __ASM_ARCH_MEMORY_H
12
13#include <asm/sizes.h>
14
15/*
16 * Physical DRAM offset.
17 */
18#define PHYS_OFFSET (0x08000000UL)
19
20#ifndef __ASSEMBLY__
21
22static inline void __arch_adjust_zones(int node, unsigned long *zone_size, unsigned long *zhole_size)
23{
24 if (node != 0) return;
25 /* Only the first 4 MB (=1024 Pages) are usable for DMA */
26 zone_size[1] = zone_size[0] - 1024;
27 zone_size[0] = 1024;
28 zhole_size[1] = zhole_size[0];
29 zhole_size[0] = 0;
30}
31
32#define arch_adjust_zones(node, size, holes) \
33 __arch_adjust_zones(node, size, holes)
34
35#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_4M - 1)
36
37#endif
38
39#define __virt_to_bus(x) __virt_to_phys(x)
40#define __bus_to_virt(x) __phys_to_virt(x)
41
42#endif
diff --git a/include/asm-arm/arch-shark/param.h b/include/asm-arm/arch-shark/param.h
new file mode 100644
index 000000000000..997eeb71de00
--- /dev/null
+++ b/include/asm-arm/arch-shark/param.h
@@ -0,0 +1,5 @@
1/*
2 * linux/include/asm-arm/arch-shark/param.h
3 *
4 * by Alexander Schulz
5 */
diff --git a/include/asm-arm/arch-shark/system.h b/include/asm-arm/arch-shark/system.h
new file mode 100644
index 000000000000..f12d771ab4ce
--- /dev/null
+++ b/include/asm-arm/arch-shark/system.h
@@ -0,0 +1,28 @@
1/*
2 * linux/include/asm-arm/arch-shark/system.h
3 *
4 * by Alexander Schulz
5 */
6#ifndef __ASM_ARCH_SYSTEM_H
7#define __ASM_ARCH_SYSTEM_H
8
9#include <asm/io.h>
10
11static void arch_reset(char mode)
12{
13 short temp;
14 local_irq_disable();
15 /* Reset the Machine via pc[3] of the sequoia chipset */
16 outw(0x09,0x24);
17 temp=inw(0x26);
18 temp = temp | (1<<3) | (1<<10);
19 outw(0x09,0x24);
20 outw(temp,0x26);
21
22}
23
24static inline void arch_idle(void)
25{
26}
27
28#endif
diff --git a/include/asm-arm/arch-shark/timex.h b/include/asm-arm/arch-shark/timex.h
new file mode 100644
index 000000000000..0d02d255513b
--- /dev/null
+++ b/include/asm-arm/arch-shark/timex.h
@@ -0,0 +1,7 @@
1/*
2 * linux/include/asm-arm/arch-shark/timex.h
3 *
4 * by Alexander Schulz
5 */
6
7#define CLOCK_TICK_RATE 1193180
diff --git a/include/asm-arm/arch-shark/uncompress.h b/include/asm-arm/arch-shark/uncompress.h
new file mode 100644
index 000000000000..910a8e0a0ca5
--- /dev/null
+++ b/include/asm-arm/arch-shark/uncompress.h
@@ -0,0 +1,60 @@
1/*
2 * linux/include/asm-arm/arch-shark/uncompress.h
3 * by Alexander Schulz
4 *
5 * derived from:
6 * linux/include/asm-arm/arch-ebsa285/uncompress.h
7 * Copyright (C) 1996,1997,1998 Russell King
8 */
9
10#define SERIAL_BASE ((volatile unsigned char *)0x400003f8)
11
12static __inline__ void putc(char c)
13{
14 int t;
15
16 SERIAL_BASE[0] = c;
17 t=0x10000;
18 while (t--);
19}
20
21/*
22 * This does not append a newline
23 */
24static void putstr(const char *s)
25{
26 while (*s) {
27 putc(*s);
28 if (*s == '\n')
29 putc('\r');
30 s++;
31 }
32}
33
34#ifdef DEBUG
35static void putn(unsigned long z)
36{
37 int i;
38 char x;
39
40 putc('0');
41 putc('x');
42 for (i=0;i<8;i++) {
43 x='0'+((z>>((7-i)*4))&0xf);
44 if (x>'9') x=x-'0'+'A'-10;
45 putc(x);
46 }
47}
48
49static void putr()
50{
51 putc('\n');
52 putc('\r');
53}
54#endif
55
56/*
57 * nothing to do
58 */
59#define arch_decomp_setup()
60#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-shark/vmalloc.h b/include/asm-arm/arch-shark/vmalloc.h
new file mode 100644
index 000000000000..1cc20098f690
--- /dev/null
+++ b/include/asm-arm/arch-shark/vmalloc.h
@@ -0,0 +1,15 @@
1/*
2 * linux/include/asm-arm/arch-rpc/vmalloc.h
3 */
4
5/*
6 * Just any arbitrary offset to the start of the vmalloc VM area: the
7 * current 8MB value just means that there will be a 8MB "hole" after the
8 * physical memory until the kernel virtual memory starts. That means that
9 * any out-of-bounds memory accesses will hopefully be caught.
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;)
12 */
13#define VMALLOC_OFFSET (8*1024*1024)
14#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
15#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-versatile/debug-macro.S b/include/asm-arm/arch-versatile/debug-macro.S
new file mode 100644
index 000000000000..89e38ac1444e
--- /dev/null
+++ b/include/asm-arm/arch-versatile/debug-macro.S
@@ -0,0 +1,39 @@
1/* linux/include/asm-arm/arch-versatile/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 <asm/hardware/amba_serial.h>
15
16 .macro addruart,rx
17 mrc p15, 0, \rx, c1, c0
18 tst \rx, #1 @ MMU enabled?
19 moveq \rx, #0x10000000
20 movne \rx, #0xf1000000 @ virtual base
21 orr \rx, \rx, #0x001F0000
22 orr \rx, \rx, #0x00001000
23 .endm
24
25 .macro senduart,rd,rx
26 strb \rd, [\rx, #UART01x_DR]
27 .endm
28
29 .macro waituart,rd,rx
301001: ldr \rd, [\rx, #0x18] @ UARTFLG
31 tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full
32 bne 1001b
33 .endm
34
35 .macro busyuart,rd,rx
361001: ldr \rd, [\rx, #0x18] @ UARTFLG
37 tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy
38 bne 1001b
39 .endm
diff --git a/include/asm-arm/arch-versatile/dma.h b/include/asm-arm/arch-versatile/dma.h
new file mode 100644
index 000000000000..dcc8ac26eac0
--- /dev/null
+++ b/include/asm-arm/arch-versatile/dma.h
@@ -0,0 +1,27 @@
1/*
2 * linux/include/asm-arm/arch-versatile/dma.h
3 *
4 * Copyright (C) 2003 ARM Limited.
5 * Copyright (C) 1997,1998 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 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#ifndef __ASM_ARCH_DMA_H
22#define __ASM_ARCH_DMA_H
23
24#define MAX_DMA_ADDRESS 0xffffffff
25#define MAX_DMA_CHANNELS 0
26
27#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-versatile/entry-macro.S b/include/asm-arm/arch-versatile/entry-macro.S
new file mode 100644
index 000000000000..90e4e970d253
--- /dev/null
+++ b/include/asm-arm/arch-versatile/entry-macro.S
@@ -0,0 +1,35 @@
1/*
2 * include/asm-arm/arch-versatile/entry-macro.S
3 *
4 * Low-level IRQ helper macros for Versatile platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10 .macro disable_fiq
11 .endm
12
13 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
14 ldr \base, =IO_ADDRESS(VERSATILE_VIC_BASE)
15 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status
16 mov \irqnr, #0
17 teq \irqstat, #0
18 beq 1003f
19
201001: tst \irqstat, #15
21 bne 1002f
22 add \irqnr, \irqnr, #4
23 movs \irqstat, \irqstat, lsr #4
24 bne 1001b
251002: tst \irqstat, #1
26 bne 1003f
27 add \irqnr, \irqnr, #1
28 movs \irqstat, \irqstat, lsr #1
29 bne 1002b
301003: /* EQ will be set if no irqs pending */
31
32@ clz \irqnr, \irqstat
33@1003: /* EQ will be set if we reach MAXIRQNUM */
34 .endm
35
diff --git a/include/asm-arm/arch-versatile/hardware.h b/include/asm-arm/arch-versatile/hardware.h
new file mode 100644
index 000000000000..d5fb4a251e7f
--- /dev/null
+++ b/include/asm-arm/arch-versatile/hardware.h
@@ -0,0 +1,45 @@
1/*
2 * linux/include/asm-arm/arch-versatile/hardware.h
3 *
4 * This file contains the hardware definitions of the Versatile boards.
5 *
6 * Copyright (C) 2003 ARM Limited.
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#ifndef __ASM_ARCH_HARDWARE_H
23#define __ASM_ARCH_HARDWARE_H
24
25#include <asm/sizes.h>
26#include <asm/arch/platform.h>
27
28// FIXME = PCI settings need to be fixed!!!!!
29
30/*
31 * Similar to above, but for PCI addresses (memory, IO, Config and the
32 * V3 chip itself). WARNING: this has to mirror definitions in platform.h
33 */
34#define PCI_MEMORY_VADDR 0xe8000000
35#define PCI_CONFIG_VADDR 0xec000000
36#define PCI_V3_VADDR 0xed000000
37#define PCI_IO_VADDR 0xee000000
38
39#define PCIO_BASE PCI_IO_VADDR
40#define PCIMEM_BASE PCI_MEMORY_VADDR
41
42/* macro to get at IO space when running virtually */
43#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
44
45#endif
diff --git a/include/asm-arm/arch-versatile/io.h b/include/asm-arm/arch-versatile/io.h
new file mode 100644
index 000000000000..dbb7158788fc
--- /dev/null
+++ b/include/asm-arm/arch-versatile/io.h
@@ -0,0 +1,29 @@
1/*
2 * linux/include/asm-arm/arch-versatile/io.h
3 *
4 * Copyright (C) 2003 ARM Limited
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#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22
23#define IO_SPACE_LIMIT 0xffff
24
25#define __io(a) ((void __iomem *)(a))
26#define __mem_pci(a) (a)
27#define __mem_isa(a) (a)
28
29#endif
diff --git a/include/asm-arm/arch-versatile/irqs.h b/include/asm-arm/arch-versatile/irqs.h
new file mode 100644
index 000000000000..745aa841b31a
--- /dev/null
+++ b/include/asm-arm/arch-versatile/irqs.h
@@ -0,0 +1,211 @@
1/*
2 * linux/include/asm-arm/arch-versatile/irqs.h
3 *
4 * Copyright (C) 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
22#include <asm/arch/platform.h>
23
24/*
25 * IRQ interrupts definitions are the same the INT definitions
26 * held within platform.h
27 */
28#define IRQ_VIC_START 0
29#define IRQ_WDOGINT (IRQ_VIC_START + INT_WDOGINT)
30#define IRQ_SOFTINT (IRQ_VIC_START + INT_SOFTINT)
31#define IRQ_COMMRx (IRQ_VIC_START + INT_COMMRx)
32#define IRQ_COMMTx (IRQ_VIC_START + INT_COMMTx)
33#define IRQ_TIMERINT0_1 (IRQ_VIC_START + INT_TIMERINT0_1)
34#define IRQ_TIMERINT2_3 (IRQ_VIC_START + INT_TIMERINT2_3)
35#define IRQ_GPIOINT0 (IRQ_VIC_START + INT_GPIOINT0)
36#define IRQ_GPIOINT1 (IRQ_VIC_START + INT_GPIOINT1)
37#define IRQ_GPIOINT2 (IRQ_VIC_START + INT_GPIOINT2)
38#define IRQ_GPIOINT3 (IRQ_VIC_START + INT_GPIOINT3)
39#define IRQ_RTCINT (IRQ_VIC_START + INT_RTCINT)
40#define IRQ_SSPINT (IRQ_VIC_START + INT_SSPINT)
41#define IRQ_UARTINT0 (IRQ_VIC_START + INT_UARTINT0)
42#define IRQ_UARTINT1 (IRQ_VIC_START + INT_UARTINT1)
43#define IRQ_UARTINT2 (IRQ_VIC_START + INT_UARTINT2)
44#define IRQ_SCIINT (IRQ_VIC_START + INT_SCIINT)
45#define IRQ_CLCDINT (IRQ_VIC_START + INT_CLCDINT)
46#define IRQ_DMAINT (IRQ_VIC_START + INT_DMAINT)
47#define IRQ_PWRFAILINT (IRQ_VIC_START + INT_PWRFAILINT)
48#define IRQ_MBXINT (IRQ_VIC_START + INT_MBXINT)
49#define IRQ_GNDINT (IRQ_VIC_START + INT_GNDINT)
50#define IRQ_VICSOURCE21 (IRQ_VIC_START + INT_VICSOURCE21)
51#define IRQ_VICSOURCE22 (IRQ_VIC_START + INT_VICSOURCE22)
52#define IRQ_VICSOURCE23 (IRQ_VIC_START + INT_VICSOURCE23)
53#define IRQ_VICSOURCE24 (IRQ_VIC_START + INT_VICSOURCE24)
54#define IRQ_VICSOURCE25 (IRQ_VIC_START + INT_VICSOURCE25)
55#define IRQ_VICSOURCE26 (IRQ_VIC_START + INT_VICSOURCE26)
56#define IRQ_VICSOURCE27 (IRQ_VIC_START + INT_VICSOURCE27)
57#define IRQ_VICSOURCE28 (IRQ_VIC_START + INT_VICSOURCE28)
58#define IRQ_VICSOURCE29 (IRQ_VIC_START + INT_VICSOURCE29)
59#define IRQ_VICSOURCE30 (IRQ_VIC_START + INT_VICSOURCE30)
60#define IRQ_VICSOURCE31 (IRQ_VIC_START + INT_VICSOURCE31)
61#define IRQ_VIC_END (IRQ_VIC_START + 31)
62
63#define IRQMASK_WDOGINT INTMASK_WDOGINT
64#define IRQMASK_SOFTINT INTMASK_SOFTINT
65#define IRQMASK_COMMRx INTMASK_COMMRx
66#define IRQMASK_COMMTx INTMASK_COMMTx
67#define IRQMASK_TIMERINT0_1 INTMASK_TIMERINT0_1
68#define IRQMASK_TIMERINT2_3 INTMASK_TIMERINT2_3
69#define IRQMASK_GPIOINT0 INTMASK_GPIOINT0
70#define IRQMASK_GPIOINT1 INTMASK_GPIOINT1
71#define IRQMASK_GPIOINT2 INTMASK_GPIOINT2
72#define IRQMASK_GPIOINT3 INTMASK_GPIOINT3
73#define IRQMASK_RTCINT INTMASK_RTCINT
74#define IRQMASK_SSPINT INTMASK_SSPINT
75#define IRQMASK_UARTINT0 INTMASK_UARTINT0
76#define IRQMASK_UARTINT1 INTMASK_UARTINT1
77#define IRQMASK_UARTINT2 INTMASK_UARTINT2
78#define IRQMASK_SCIINT INTMASK_SCIINT
79#define IRQMASK_CLCDINT INTMASK_CLCDINT
80#define IRQMASK_DMAINT INTMASK_DMAINT
81#define IRQMASK_PWRFAILINT INTMASK_PWRFAILINT
82#define IRQMASK_MBXINT INTMASK_MBXINT
83#define IRQMASK_GNDINT INTMASK_GNDINT
84#define IRQMASK_VICSOURCE21 INTMASK_VICSOURCE21
85#define IRQMASK_VICSOURCE22 INTMASK_VICSOURCE22
86#define IRQMASK_VICSOURCE23 INTMASK_VICSOURCE23
87#define IRQMASK_VICSOURCE24 INTMASK_VICSOURCE24
88#define IRQMASK_VICSOURCE25 INTMASK_VICSOURCE25
89#define IRQMASK_VICSOURCE26 INTMASK_VICSOURCE26
90#define IRQMASK_VICSOURCE27 INTMASK_VICSOURCE27
91#define IRQMASK_VICSOURCE28 INTMASK_VICSOURCE28
92#define IRQMASK_VICSOURCE29 INTMASK_VICSOURCE29
93#define IRQMASK_VICSOURCE30 INTMASK_VICSOURCE30
94#define IRQMASK_VICSOURCE31 INTMASK_VICSOURCE31
95
96/*
97 * FIQ interrupts definitions are the same the INT definitions.
98 */
99#define FIQ_WDOGINT INT_WDOGINT
100#define FIQ_SOFTINT INT_SOFTINT
101#define FIQ_COMMRx INT_COMMRx
102#define FIQ_COMMTx INT_COMMTx
103#define FIQ_TIMERINT0_1 INT_TIMERINT0_1
104#define FIQ_TIMERINT2_3 INT_TIMERINT2_3
105#define FIQ_GPIOINT0 INT_GPIOINT0
106#define FIQ_GPIOINT1 INT_GPIOINT1
107#define FIQ_GPIOINT2 INT_GPIOINT2
108#define FIQ_GPIOINT3 INT_GPIOINT3
109#define FIQ_RTCINT INT_RTCINT
110#define FIQ_SSPINT INT_SSPINT
111#define FIQ_UARTINT0 INT_UARTINT0
112#define FIQ_UARTINT1 INT_UARTINT1
113#define FIQ_UARTINT2 INT_UARTINT2
114#define FIQ_SCIINT INT_SCIINT
115#define FIQ_CLCDINT INT_CLCDINT
116#define FIQ_DMAINT INT_DMAINT
117#define FIQ_PWRFAILINT INT_PWRFAILINT
118#define FIQ_MBXINT INT_MBXINT
119#define FIQ_GNDINT INT_GNDINT
120#define FIQ_VICSOURCE21 INT_VICSOURCE21
121#define FIQ_VICSOURCE22 INT_VICSOURCE22
122#define FIQ_VICSOURCE23 INT_VICSOURCE23
123#define FIQ_VICSOURCE24 INT_VICSOURCE24
124#define FIQ_VICSOURCE25 INT_VICSOURCE25
125#define FIQ_VICSOURCE26 INT_VICSOURCE26
126#define FIQ_VICSOURCE27 INT_VICSOURCE27
127#define FIQ_VICSOURCE28 INT_VICSOURCE28
128#define FIQ_VICSOURCE29 INT_VICSOURCE29
129#define FIQ_VICSOURCE30 INT_VICSOURCE30
130#define FIQ_VICSOURCE31 INT_VICSOURCE31
131
132
133#define FIQMASK_WDOGINT INTMASK_WDOGINT
134#define FIQMASK_SOFTINT INTMASK_SOFTINT
135#define FIQMASK_COMMRx INTMASK_COMMRx
136#define FIQMASK_COMMTx INTMASK_COMMTx
137#define FIQMASK_TIMERINT0_1 INTMASK_TIMERINT0_1
138#define FIQMASK_TIMERINT2_3 INTMASK_TIMERINT2_3
139#define FIQMASK_GPIOINT0 INTMASK_GPIOINT0
140#define FIQMASK_GPIOINT1 INTMASK_GPIOINT1
141#define FIQMASK_GPIOINT2 INTMASK_GPIOINT2
142#define FIQMASK_GPIOINT3 INTMASK_GPIOINT3
143#define FIQMASK_RTCINT INTMASK_RTCINT
144#define FIQMASK_SSPINT INTMASK_SSPINT
145#define FIQMASK_UARTINT0 INTMASK_UARTINT0
146#define FIQMASK_UARTINT1 INTMASK_UARTINT1
147#define FIQMASK_UARTINT2 INTMASK_UARTINT2
148#define FIQMASK_SCIINT INTMASK_SCIINT
149#define FIQMASK_CLCDINT INTMASK_CLCDINT
150#define FIQMASK_DMAINT INTMASK_DMAINT
151#define FIQMASK_PWRFAILINT INTMASK_PWRFAILINT
152#define FIQMASK_MBXINT INTMASK_MBXINT
153#define FIQMASK_GNDINT INTMASK_GNDINT
154#define FIQMASK_VICSOURCE21 INTMASK_VICSOURCE21
155#define FIQMASK_VICSOURCE22 INTMASK_VICSOURCE22
156#define FIQMASK_VICSOURCE23 INTMASK_VICSOURCE23
157#define FIQMASK_VICSOURCE24 INTMASK_VICSOURCE24
158#define FIQMASK_VICSOURCE25 INTMASK_VICSOURCE25
159#define FIQMASK_VICSOURCE26 INTMASK_VICSOURCE26
160#define FIQMASK_VICSOURCE27 INTMASK_VICSOURCE27
161#define FIQMASK_VICSOURCE28 INTMASK_VICSOURCE28
162#define FIQMASK_VICSOURCE29 INTMASK_VICSOURCE29
163#define FIQMASK_VICSOURCE30 INTMASK_VICSOURCE30
164#define FIQMASK_VICSOURCE31 INTMASK_VICSOURCE31
165
166/*
167 * Secondary interrupt controller
168 */
169#define IRQ_SIC_START 32
170#define IRQ_SIC_MMCI0B (IRQ_SIC_START + SIC_INT_MMCI0B)
171#define IRQ_SIC_MMCI1B (IRQ_SIC_START + SIC_INT_MMCI1B)
172#define IRQ_SIC_KMI0 (IRQ_SIC_START + SIC_INT_KMI0)
173#define IRQ_SIC_KMI1 (IRQ_SIC_START + SIC_INT_KMI1)
174#define IRQ_SIC_SCI3 (IRQ_SIC_START + SIC_INT_SCI3)
175#define IRQ_SIC_UART3 (IRQ_SIC_START + SIC_INT_UART3)
176#define IRQ_SIC_CLCD (IRQ_SIC_START + SIC_INT_CLCD)
177#define IRQ_SIC_TOUCH (IRQ_SIC_START + SIC_INT_TOUCH)
178#define IRQ_SIC_KEYPAD (IRQ_SIC_START + SIC_INT_KEYPAD)
179#define IRQ_SIC_DoC (IRQ_SIC_START + SIC_INT_DoC)
180#define IRQ_SIC_MMCI0A (IRQ_SIC_START + SIC_INT_MMCI0A)
181#define IRQ_SIC_MMCI1A (IRQ_SIC_START + SIC_INT_MMCI1A)
182#define IRQ_SIC_AACI (IRQ_SIC_START + SIC_INT_AACI)
183#define IRQ_SIC_ETH (IRQ_SIC_START + SIC_INT_ETH)
184#define IRQ_SIC_USB (IRQ_SIC_START + SIC_INT_USB)
185#define IRQ_SIC_PCI0 (IRQ_SIC_START + SIC_INT_PCI0)
186#define IRQ_SIC_PCI1 (IRQ_SIC_START + SIC_INT_PCI1)
187#define IRQ_SIC_PCI2 (IRQ_SIC_START + SIC_INT_PCI2)
188#define IRQ_SIC_PCI3 (IRQ_SIC_START + SIC_INT_PCI3)
189#define IRQ_SIC_END 63
190
191#define SIC_IRQMASK_MMCI0B SIC_INTMASK_MMCI0B
192#define SIC_IRQMASK_MMCI1B SIC_INTMASK_MMCI1B
193#define SIC_IRQMASK_KMI0 SIC_INTMASK_KMI0
194#define SIC_IRQMASK_KMI1 SIC_INTMASK_KMI1
195#define SIC_IRQMASK_SCI3 SIC_INTMASK_SCI3
196#define SIC_IRQMASK_UART3 SIC_INTMASK_UART3
197#define SIC_IRQMASK_CLCD SIC_INTMASK_CLCD
198#define SIC_IRQMASK_TOUCH SIC_INTMASK_TOUCH
199#define SIC_IRQMASK_KEYPAD SIC_INTMASK_KEYPAD
200#define SIC_IRQMASK_DoC SIC_INTMASK_DoC
201#define SIC_IRQMASK_MMCI0A SIC_INTMASK_MMCI0A
202#define SIC_IRQMASK_MMCI1A SIC_INTMASK_MMCI1A
203#define SIC_IRQMASK_AACI SIC_INTMASK_AACI
204#define SIC_IRQMASK_ETH SIC_INTMASK_ETH
205#define SIC_IRQMASK_USB SIC_INTMASK_USB
206#define SIC_IRQMASK_PCI0 SIC_INTMASK_PCI0
207#define SIC_IRQMASK_PCI1 SIC_INTMASK_PCI1
208#define SIC_IRQMASK_PCI2 SIC_INTMASK_PCI2
209#define SIC_IRQMASK_PCI3 SIC_INTMASK_PCI3
210
211#define NR_IRQS 64
diff --git a/include/asm-arm/arch-versatile/memory.h b/include/asm-arm/arch-versatile/memory.h
new file mode 100644
index 000000000000..7b8b7cc422fa
--- /dev/null
+++ b/include/asm-arm/arch-versatile/memory.h
@@ -0,0 +1,38 @@
1/*
2 * linux/include/asm-arm/arch-versatile/memory.h
3 *
4 * Copyright (C) 2003 ARM Limited
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#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H
22
23/*
24 * Physical DRAM offset.
25 */
26#define PHYS_OFFSET (0x00000000UL)
27
28/*
29 * Virtual view <-> DMA view memory address translations
30 * virt_to_bus: Used to translate the virtual address to an
31 * address suitable to be passed to set_dma_addr
32 * bus_to_virt: Used to convert an address for DMA operations
33 * to an address that the kernel can use.
34 */
35#define __virt_to_bus(x) ((x) - PAGE_OFFSET)
36#define __bus_to_virt(x) ((x) + PAGE_OFFSET)
37
38#endif
diff --git a/include/asm-arm/arch-versatile/param.h b/include/asm-arm/arch-versatile/param.h
new file mode 100644
index 000000000000..34b897335f87
--- /dev/null
+++ b/include/asm-arm/arch-versatile/param.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-versatile/param.h
3 *
4 * Copyright (C) 2002 ARM Limited
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 */
diff --git a/include/asm-arm/arch-versatile/platform.h b/include/asm-arm/arch-versatile/platform.h
new file mode 100644
index 000000000000..2598d1f08548
--- /dev/null
+++ b/include/asm-arm/arch-versatile/platform.h
@@ -0,0 +1,510 @@
1/*
2 * linux/include/asm-arm/arch-versatile/platform.h
3 *
4 * Copyright (c) ARM Limited 2003. 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
21#ifndef __address_h
22#define __address_h 1
23
24/*
25 * Memory definitions
26 */
27#define VERSATILE_BOOT_ROM_LO 0x30000000 /* DoC Base (64Mb)...*/
28#define VERSATILE_BOOT_ROM_HI 0x30000000
29#define VERSATILE_BOOT_ROM_BASE VERSATILE_BOOT_ROM_HI /* Normal position */
30#define VERSATILE_BOOT_ROM_SIZE SZ_64M
31
32#define VERSATILE_SSRAM_BASE /* VERSATILE_SSMC_BASE ? */
33#define VERSATILE_SSRAM_SIZE SZ_2M
34
35#define VERSATILE_FLASH_BASE 0x34000000
36#define VERSATILE_FLASH_SIZE SZ_64M
37
38/*
39 * SDRAM
40 */
41#define VERSATILE_SDRAM_BASE 0x00000000
42
43/*
44 * Logic expansion modules
45 *
46 */
47
48
49/* ------------------------------------------------------------------------
50 * Versatile Registers
51 * ------------------------------------------------------------------------
52 *
53 */
54#define VERSATILE_SYS_ID_OFFSET 0x00
55#define VERSATILE_SYS_SW_OFFSET 0x04
56#define VERSATILE_SYS_LED_OFFSET 0x08
57#define VERSATILE_SYS_OSC0_OFFSET 0x0C
58
59#if defined(CONFIG_ARCH_VERSATILE_PB)
60#define VERSATILE_SYS_OSC1_OFFSET 0x10
61#define VERSATILE_SYS_OSC2_OFFSET 0x14
62#define VERSATILE_SYS_OSC3_OFFSET 0x18
63#define VERSATILE_SYS_OSC4_OFFSET 0x1C
64#elif defined(CONFIG_MACH_VERSATILE_AB)
65#define VERSATILE_SYS_OSC1_OFFSET 0x1C
66#endif
67
68#define VERSATILE_SYS_LOCK_OFFSET 0x20
69#define VERSATILE_SYS_100HZ_OFFSET 0x24
70#define VERSATILE_SYS_CFGDATA1_OFFSET 0x28
71#define VERSATILE_SYS_CFGDATA2_OFFSET 0x2C
72#define VERSATILE_SYS_FLAGS_OFFSET 0x30
73#define VERSATILE_SYS_FLAGSSET_OFFSET 0x30
74#define VERSATILE_SYS_FLAGSCLR_OFFSET 0x34
75#define VERSATILE_SYS_NVFLAGS_OFFSET 0x38
76#define VERSATILE_SYS_NVFLAGSSET_OFFSET 0x38
77#define VERSATILE_SYS_NVFLAGSCLR_OFFSET 0x3C
78#define VERSATILE_SYS_RESETCTL_OFFSET 0x40
79#define VERSATILE_SYS_PICCTL_OFFSET 0x44
80#define VERSATILE_SYS_MCI_OFFSET 0x48
81#define VERSATILE_SYS_FLASH_OFFSET 0x4C
82#define VERSATILE_SYS_CLCD_OFFSET 0x50
83#define VERSATILE_SYS_CLCDSER_OFFSET 0x54
84#define VERSATILE_SYS_BOOTCS_OFFSET 0x58
85#define VERSATILE_SYS_24MHz_OFFSET 0x5C
86#define VERSATILE_SYS_MISC_OFFSET 0x60
87#define VERSATILE_SYS_TEST_OSC0_OFFSET 0x80
88#define VERSATILE_SYS_TEST_OSC1_OFFSET 0x84
89#define VERSATILE_SYS_TEST_OSC2_OFFSET 0x88
90#define VERSATILE_SYS_TEST_OSC3_OFFSET 0x8C
91#define VERSATILE_SYS_TEST_OSC4_OFFSET 0x90
92
93#define VERSATILE_SYS_BASE 0x10000000
94#define VERSATILE_SYS_ID (VERSATILE_SYS_BASE + VERSATILE_SYS_ID_OFFSET)
95#define VERSATILE_SYS_SW (VERSATILE_SYS_BASE + VERSATILE_SYS_SW_OFFSET)
96#define VERSATILE_SYS_LED (VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET)
97#define VERSATILE_SYS_OSC0 (VERSATILE_SYS_BASE + VERSATILE_SYS_OSC0_OFFSET)
98#define VERSATILE_SYS_OSC1 (VERSATILE_SYS_BASE + VERSATILE_SYS_OSC1_OFFSET)
99
100#if defined(CONFIG_ARCH_VERSATILE_PB)
101#define VERSATILE_SYS_OSC2 (VERSATILE_SYS_BASE + VERSATILE_SYS_OSC2_OFFSET)
102#define VERSATILE_SYS_OSC3 (VERSATILE_SYS_BASE + VERSATILE_SYS_OSC3_OFFSET)
103#define VERSATILE_SYS_OSC4 (VERSATILE_SYS_BASE + VERSATILE_SYS_OSC4_OFFSET)
104#endif
105
106#define VERSATILE_SYS_LOCK (VERSATILE_SYS_BASE + VERSATILE_SYS_LOCK_OFFSET)
107#define VERSATILE_SYS_100HZ (VERSATILE_SYS_BASE + VERSATILE_SYS_100HZ_OFFSET)
108#define VERSATILE_SYS_CFGDATA1 (VERSATILE_SYS_BASE + VERSATILE_SYS_CFGDATA1_OFFSET)
109#define VERSATILE_SYS_CFGDATA2 (VERSATILE_SYS_BASE + VERSATILE_SYS_CFGDATA2_OFFSET)
110#define VERSATILE_SYS_FLAGS (VERSATILE_SYS_BASE + VERSATILE_SYS_FLAGS_OFFSET)
111#define VERSATILE_SYS_FLAGSSET (VERSATILE_SYS_BASE + VERSATILE_SYS_FLAGSSET_OFFSET)
112#define VERSATILE_SYS_FLAGSCLR (VERSATILE_SYS_BASE + VERSATILE_SYS_FLAGSCLR_OFFSET)
113#define VERSATILE_SYS_NVFLAGS (VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGS_OFFSET)
114#define VERSATILE_SYS_NVFLAGSSET (VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGSSET_OFFSET)
115#define VERSATILE_SYS_NVFLAGSCLR (VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGSCLR_OFFSET)
116#define VERSATILE_SYS_RESETCTL (VERSATILE_SYS_BASE + VERSATILE_SYS_RESETCTL_OFFSET)
117#define VERSATILE_SYS_PICCTL (VERSATILE_SYS_BASE + VERSATILE_SYS_PICCTL_OFFSET)
118#define VERSATILE_SYS_MCI (VERSATILE_SYS_BASE + VERSATILE_SYS_MCI_OFFSET)
119#define VERSATILE_SYS_FLASH (VERSATILE_SYS_BASE + VERSATILE_SYS_FLASH_OFFSET)
120#define VERSATILE_SYS_CLCD (VERSATILE_SYS_BASE + VERSATILE_SYS_CLCD_OFFSET)
121#define VERSATILE_SYS_CLCDSER (VERSATILE_SYS_BASE + VERSATILE_SYS_CLCDSER_OFFSET)
122#define VERSATILE_SYS_BOOTCS (VERSATILE_SYS_BASE + VERSATILE_SYS_BOOTCS_OFFSET)
123#define VERSATILE_SYS_24MHz (VERSATILE_SYS_BASE + VERSATILE_SYS_24MHz_OFFSET)
124#define VERSATILE_SYS_MISC (VERSATILE_SYS_BASE + VERSATILE_SYS_MISC_OFFSET)
125#define VERSATILE_SYS_TEST_OSC0 (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC0_OFFSET)
126#define VERSATILE_SYS_TEST_OSC1 (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC1_OFFSET)
127#define VERSATILE_SYS_TEST_OSC2 (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC2_OFFSET)
128#define VERSATILE_SYS_TEST_OSC3 (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC3_OFFSET)
129#define VERSATILE_SYS_TEST_OSC4 (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC4_OFFSET)
130
131/*
132 * Values for VERSATILE_SYS_RESET_CTRL
133 */
134#define VERSATILE_SYS_CTRL_RESET_CONFIGCLR 0x01
135#define VERSATILE_SYS_CTRL_RESET_CONFIGINIT 0x02
136#define VERSATILE_SYS_CTRL_RESET_DLLRESET 0x03
137#define VERSATILE_SYS_CTRL_RESET_PLLRESET 0x04
138#define VERSATILE_SYS_CTRL_RESET_POR 0x05
139#define VERSATILE_SYS_CTRL_RESET_DoC 0x06
140
141#define VERSATILE_SYS_CTRL_LED (1 << 0)
142
143
144/* ------------------------------------------------------------------------
145 * Versatile control registers
146 * ------------------------------------------------------------------------
147 */
148
149/*
150 * VERSATILE_IDFIELD
151 *
152 * 31:24 = manufacturer (0x41 = ARM)
153 * 23:16 = architecture (0x08 = AHB system bus, ASB processor bus)
154 * 15:12 = FPGA (0x3 = XVC600 or XVC600E)
155 * 11:4 = build value
156 * 3:0 = revision number (0x1 = rev B (AHB))
157 */
158
159/*
160 * VERSATILE_SYS_LOCK
161 * control access to SYS_OSCx, SYS_CFGDATAx, SYS_RESETCTL,
162 * SYS_CLD, SYS_BOOTCS
163 */
164#define VERSATILE_SYS_LOCK_LOCKED (1 << 16)
165#define VERSATILE_SYS_LOCKVAL_MASK 0xFFFF /* write 0xA05F to enable write access */
166
167/*
168 * VERSATILE_SYS_FLASH
169 */
170#define VERSATILE_FLASHPROG_FLVPPEN (1 << 0) /* Enable writing to flash */
171
172/*
173 * VERSATILE_INTREG
174 * - used to acknowledge and control MMCI and UART interrupts
175 */
176#define VERSATILE_INTREG_WPROT 0x00 /* MMC protection status (no interrupt generated) */
177#define VERSATILE_INTREG_RI0 0x01 /* Ring indicator UART0 is asserted, */
178#define VERSATILE_INTREG_CARDIN 0x08 /* MMCI card in detect */
179 /* write 1 to acknowledge and clear */
180#define VERSATILE_INTREG_RI1 0x02 /* Ring indicator UART1 is asserted, */
181#define VERSATILE_INTREG_CARDINSERT 0x03 /* Signal insertion of MMC card */
182
183/*
184 * VERSATILE peripheral addresses
185 */
186#define VERSATILE_PCI_CORE_BASE 0x10001000 /* PCI core control */
187#define VERSATILE_I2C_BASE 0x10002000 /* I2C control */
188#define VERSATILE_SIC_BASE 0x10003000 /* Secondary interrupt controller */
189#define VERSATILE_AACI_BASE 0x10004000 /* Audio */
190#define VERSATILE_MMCI0_BASE 0x10005000 /* MMC interface */
191#define VERSATILE_KMI0_BASE 0x10006000 /* KMI interface */
192#define VERSATILE_KMI1_BASE 0x10007000 /* KMI 2nd interface */
193#define VERSATILE_CHAR_LCD_BASE 0x10008000 /* Character LCD */
194#define VERSATILE_UART3_BASE 0x10009000 /* UART 3 */
195#define VERSATILE_SCI1_BASE 0x1000A000
196#define VERSATILE_MMCI1_BASE 0x1000B000 /* MMC Interface */
197 /* 0x1000C000 - 0x1000CFFF = reserved */
198#define VERSATILE_ETH_BASE 0x10010000 /* Ethernet */
199#define VERSATILE_USB_BASE 0x10020000 /* USB */
200 /* 0x10030000 - 0x100FFFFF = reserved */
201#define VERSATILE_SMC_BASE 0x10100000 /* SMC */
202#define VERSATILE_MPMC_BASE 0x10110000 /* MPMC */
203#define VERSATILE_CLCD_BASE 0x10120000 /* CLCD */
204#define VERSATILE_DMAC_BASE 0x10130000 /* DMA controller */
205#define VERSATILE_VIC_BASE 0x10140000 /* Vectored interrupt controller */
206#define VERSATILE_PERIPH_BASE 0x10150000 /* off-chip peripherals alias from */
207 /* 0x10000000 - 0x100FFFFF */
208#define VERSATILE_AHBM_BASE 0x101D0000 /* AHB monitor */
209#define VERSATILE_SCTL_BASE 0x101E0000 /* System controller */
210#define VERSATILE_WATCHDOG_BASE 0x101E1000 /* Watchdog */
211#define VERSATILE_TIMER0_1_BASE 0x101E2000 /* Timer 0 and 1 */
212#define VERSATILE_TIMER2_3_BASE 0x101E3000 /* Timer 2 and 3 */
213#define VERSATILE_GPIO0_BASE 0x101E4000 /* GPIO port 0 */
214#define VERSATILE_GPIO1_BASE 0x101E5000 /* GPIO port 1 */
215#define VERSATILE_GPIO2_BASE 0x101E6000 /* GPIO port 2 */
216#define VERSATILE_GPIO3_BASE 0x101E7000 /* GPIO port 3 */
217#define VERSATILE_RTC_BASE 0x101E8000 /* Real Time Clock */
218 /* 0x101E9000 - reserved */
219#define VERSATILE_SCI_BASE 0x101F0000 /* Smart card controller */
220#define VERSATILE_UART0_BASE 0x101F1000 /* Uart 0 */
221#define VERSATILE_UART1_BASE 0x101F2000 /* Uart 1 */
222#define VERSATILE_UART2_BASE 0x101F3000 /* Uart 2 */
223#define VERSATILE_SSP_BASE 0x101F4000 /* Synchronous Serial Port */
224
225#define VERSATILE_SSMC_BASE 0x20000000 /* SSMC */
226#define VERSATILE_IB2_BASE 0x24000000 /* IB2 module */
227#define VERSATILE_MBX_BASE 0x40000000 /* MBX */
228#define VERSATILE_PCI_BASE 0x41000000 /* PCI Interface */
229#define VERSATILE_SDRAM67_BASE 0x70000000 /* SDRAM banks 6 and 7 */
230#define VERSATILE_LT_BASE 0x80000000 /* Logic Tile expansion */
231
232/*
233 * Disk on Chip
234 */
235#define VERSATILE_DOC_BASE 0x2C000000
236#define VERSATILE_DOC_SIZE (16 << 20)
237#define VERSATILE_DOC_PAGE_SIZE 512
238#define VERSATILE_DOC_TOTAL_PAGES (DOC_SIZE / PAGE_SIZE)
239
240#define ERASE_UNIT_PAGES 32
241#define START_PAGE 0x80
242
243/*
244 * LED settings, bits [7:0]
245 */
246#define VERSATILE_SYS_LED0 (1 << 0)
247#define VERSATILE_SYS_LED1 (1 << 1)
248#define VERSATILE_SYS_LED2 (1 << 2)
249#define VERSATILE_SYS_LED3 (1 << 3)
250#define VERSATILE_SYS_LED4 (1 << 4)
251#define VERSATILE_SYS_LED5 (1 << 5)
252#define VERSATILE_SYS_LED6 (1 << 6)
253#define VERSATILE_SYS_LED7 (1 << 7)
254
255#define ALL_LEDS 0xFF
256
257#define LED_BANK VERSATILE_SYS_LED
258
259/*
260 * Control registers
261 */
262#define VERSATILE_IDFIELD_OFFSET 0x0 /* Versatile build information */
263#define VERSATILE_FLASHPROG_OFFSET 0x4 /* Flash devices */
264#define VERSATILE_INTREG_OFFSET 0x8 /* Interrupt control */
265#define VERSATILE_DECODE_OFFSET 0xC /* Fitted logic modules */
266
267
268/* ------------------------------------------------------------------------
269 * Versatile Interrupt Controller - control registers
270 * ------------------------------------------------------------------------
271 *
272 * Offsets from interrupt controller base
273 *
274 * System Controller interrupt controller base is
275 *
276 * VERSATILE_IC_BASE
277 *
278 * Core Module interrupt controller base is
279 *
280 * VERSATILE_SYS_IC
281 *
282 */
283#define VIC_IRQ_STATUS 0
284#define VIC_FIQ_STATUS 0x04
285#define VIC_IRQ_RAW_STATUS 0x08
286#define VIC_INT_SELECT 0x0C /* 1 = FIQ, 0 = IRQ */
287#define VIC_IRQ_ENABLE 0x10 /* 1 = enable, 0 = disable */
288#define VIC_IRQ_ENABLE_CLEAR 0x14
289#define VIC_IRQ_SOFT 0x18
290#define VIC_IRQ_SOFT_CLEAR 0x1C
291#define VIC_PROTECT 0x20
292#define VIC_VECT_ADDR 0x30
293#define VIC_DEF_VECT_ADDR 0x34
294#define VIC_VECT_ADDR0 0x100 /* 0 to 15 */
295#define VIC_VECT_CNTL0 0x200 /* 0 to 15 */
296#define VIC_ITCR 0x300 /* VIC test control register */
297
298#define VIC_FIQ_RAW_STATUS 0x08
299#define VIC_FIQ_ENABLE 0x10 /* 1 = enable, 0 = disable */
300#define VIC_FIQ_ENABLE_CLEAR 0x14
301#define VIC_FIQ_SOFT 0x18
302#define VIC_FIQ_SOFT_CLEAR 0x1C
303
304#define SIC_IRQ_STATUS 0
305#define SIC_IRQ_RAW_STATUS 0x04
306#define SIC_IRQ_ENABLE 0x08
307#define SIC_IRQ_ENABLE_SET 0x08
308#define SIC_IRQ_ENABLE_CLEAR 0x0C
309#define SIC_INT_SOFT_SET 0x10
310#define SIC_INT_SOFT_CLEAR 0x14
311#define SIC_INT_PIC_ENABLE 0x20 /* read status of pass through mask */
312#define SIC_INT_PIC_ENABLES 0x20 /* set interrupt pass through bits */
313#define SIC_INT_PIC_ENABLEC 0x24 /* Clear interrupt pass through bits */
314
315#define VICVectCntl_Enable (1 << 5)
316
317/* ------------------------------------------------------------------------
318 * Interrupts - bit assignment (primary)
319 * ------------------------------------------------------------------------
320 */
321
322#define INT_WDOGINT 0 /* Watchdog timer */
323#define INT_SOFTINT 1 /* Software interrupt */
324#define INT_COMMRx 2 /* Debug Comm Rx interrupt */
325#define INT_COMMTx 3 /* Debug Comm Tx interrupt */
326#define INT_TIMERINT0_1 4 /* Timer 0 and 1 */
327#define INT_TIMERINT2_3 5 /* Timer 2 and 3 */
328#define INT_GPIOINT0 6 /* GPIO 0 */
329#define INT_GPIOINT1 7 /* GPIO 1 */
330#define INT_GPIOINT2 8 /* GPIO 2 */
331#define INT_GPIOINT3 9 /* GPIO 3 */
332#define INT_RTCINT 10 /* Real Time Clock */
333#define INT_SSPINT 11 /* Synchronous Serial Port */
334#define INT_UARTINT0 12 /* UART 0 on development chip */
335#define INT_UARTINT1 13 /* UART 1 on development chip */
336#define INT_UARTINT2 14 /* UART 2 on development chip */
337#define INT_SCIINT 15 /* Smart Card Interface */
338#define INT_CLCDINT 16 /* CLCD controller */
339#define INT_DMAINT 17 /* DMA controller */
340#define INT_PWRFAILINT 18 /* Power failure */
341#define INT_MBXINT 19 /* Graphics processor */
342#define INT_GNDINT 20 /* Reserved */
343 /* External interrupt signals from logic tiles or secondary controller */
344#define INT_VICSOURCE21 21 /* Disk on Chip */
345#define INT_VICSOURCE22 22 /* MCI0A */
346#define INT_VICSOURCE23 23 /* MCI1A */
347#define INT_VICSOURCE24 24 /* AACI */
348#define INT_VICSOURCE25 25 /* Ethernet */
349#define INT_VICSOURCE26 26 /* USB */
350#define INT_VICSOURCE27 27 /* PCI 0 */
351#define INT_VICSOURCE28 28 /* PCI 1 */
352#define INT_VICSOURCE29 29 /* PCI 2 */
353#define INT_VICSOURCE30 30 /* PCI 3 */
354#define INT_VICSOURCE31 31 /* SIC source */
355
356/*
357 * Interrupt bit positions
358 *
359 */
360#define INTMASK_WDOGINT (1 << INT_WDOGINT)
361#define INTMASK_SOFTINT (1 << INT_SOFTINT)
362#define INTMASK_COMMRx (1 << INT_COMMRx)
363#define INTMASK_COMMTx (1 << INT_COMMTx)
364#define INTMASK_TIMERINT0_1 (1 << INT_TIMERINT0_1)
365#define INTMASK_TIMERINT2_3 (1 << INT_TIMERINT2_3)
366#define INTMASK_GPIOINT0 (1 << INT_GPIOINT0)
367#define INTMASK_GPIOINT1 (1 << INT_GPIOINT1)
368#define INTMASK_GPIOINT2 (1 << INT_GPIOINT2)
369#define INTMASK_GPIOINT3 (1 << INT_GPIOINT3)
370#define INTMASK_RTCINT (1 << INT_RTCINT)
371#define INTMASK_SSPINT (1 << INT_SSPINT)
372#define INTMASK_UARTINT0 (1 << INT_UARTINT0)
373#define INTMASK_UARTINT1 (1 << INT_UARTINT1)
374#define INTMASK_UARTINT2 (1 << INT_UARTINT2)
375#define INTMASK_SCIINT (1 << INT_SCIINT)
376#define INTMASK_CLCDINT (1 << INT_CLCDINT)
377#define INTMASK_DMAINT (1 << INT_DMAINT)
378#define INTMASK_PWRFAILINT (1 << INT_PWRFAILINT)
379#define INTMASK_MBXINT (1 << INT_MBXINT)
380#define INTMASK_GNDINT (1 << INT_GNDINT)
381#define INTMASK_VICSOURCE21 (1 << INT_VICSOURCE21)
382#define INTMASK_VICSOURCE22 (1 << INT_VICSOURCE22)
383#define INTMASK_VICSOURCE23 (1 << INT_VICSOURCE23)
384#define INTMASK_VICSOURCE24 (1 << INT_VICSOURCE24)
385#define INTMASK_VICSOURCE25 (1 << INT_VICSOURCE25)
386#define INTMASK_VICSOURCE26 (1 << INT_VICSOURCE26)
387#define INTMASK_VICSOURCE27 (1 << INT_VICSOURCE27)
388#define INTMASK_VICSOURCE28 (1 << INT_VICSOURCE28)
389#define INTMASK_VICSOURCE29 (1 << INT_VICSOURCE29)
390#define INTMASK_VICSOURCE30 (1 << INT_VICSOURCE30)
391#define INTMASK_VICSOURCE31 (1 << INT_VICSOURCE31)
392
393
394#define VERSATILE_SC_VALID_INT 0x003FFFFF
395
396#define MAXIRQNUM 31
397#define MAXFIQNUM 31
398#define MAXSWINUM 31
399
400/* ------------------------------------------------------------------------
401 * Interrupts - bit assignment (secondary)
402 * ------------------------------------------------------------------------
403 */
404#define SIC_INT_MMCI0B 1 /* Multimedia Card 0B */
405#define SIC_INT_MMCI1B 2 /* Multimedia Card 1B */
406#define SIC_INT_KMI0 3 /* Keyboard/Mouse port 0 */
407#define SIC_INT_KMI1 4 /* Keyboard/Mouse port 1 */
408#define SIC_INT_SCI3 5 /* Smart Card interface */
409#define SIC_INT_UART3 6 /* UART 3 empty or data available */
410#define SIC_INT_CLCD 7 /* Character LCD */
411#define SIC_INT_TOUCH 8 /* Touchscreen */
412#define SIC_INT_KEYPAD 9 /* Key pressed on display keypad */
413 /* 10:20 - reserved */
414#define SIC_INT_DoC 21 /* Disk on Chip memory controller */
415#define SIC_INT_MMCI0A 22 /* MMC 0A */
416#define SIC_INT_MMCI1A 23 /* MMC 1A */
417#define SIC_INT_AACI 24 /* Audio Codec */
418#define SIC_INT_ETH 25 /* Ethernet controller */
419#define SIC_INT_USB 26 /* USB controller */
420#define SIC_INT_PCI0 27
421#define SIC_INT_PCI1 28
422#define SIC_INT_PCI2 29
423#define SIC_INT_PCI3 30
424
425
426#define SIC_INTMASK_MMCI0B (1 << SIC_INT_MMCI0B)
427#define SIC_INTMASK_MMCI1B (1 << SIC_INT_MMCI1B)
428#define SIC_INTMASK_KMI0 (1 << SIC_INT_KMI0)
429#define SIC_INTMASK_KMI1 (1 << SIC_INT_KMI1)
430#define SIC_INTMASK_SCI3 (1 << SIC_INT_SCI3)
431#define SIC_INTMASK_UART3 (1 << SIC_INT_UART3)
432#define SIC_INTMASK_CLCD (1 << SIC_INT_CLCD)
433#define SIC_INTMASK_TOUCH (1 << SIC_INT_TOUCH)
434#define SIC_INTMASK_KEYPAD (1 << SIC_INT_KEYPAD)
435#define SIC_INTMASK_DoC (1 << SIC_INT_DoC)
436#define SIC_INTMASK_MMCI0A (1 << SIC_INT_MMCI0A)
437#define SIC_INTMASK_MMCI1A (1 << SIC_INT_MMCI1A)
438#define SIC_INTMASK_AACI (1 << SIC_INT_AACI)
439#define SIC_INTMASK_ETH (1 << SIC_INT_ETH)
440#define SIC_INTMASK_USB (1 << SIC_INT_USB)
441#define SIC_INTMASK_PCI0 (1 << SIC_INT_PCI0)
442#define SIC_INTMASK_PCI1 (1 << SIC_INT_PCI1)
443#define SIC_INTMASK_PCI2 (1 << SIC_INT_PCI2)
444#define SIC_INTMASK_PCI3 (1 << SIC_INT_PCI3)
445/*
446 * Application Flash
447 *
448 */
449#define FLASH_BASE VERSATILE_FLASH_BASE
450#define FLASH_SIZE VERSATILE_FLASH_SIZE
451#define FLASH_END (FLASH_BASE + FLASH_SIZE - 1)
452#define FLASH_BLOCK_SIZE SZ_128K
453
454/*
455 * Boot Flash
456 *
457 */
458#define EPROM_BASE VERSATILE_BOOT_ROM_HI
459#define EPROM_SIZE VERSATILE_BOOT_ROM_SIZE
460#define EPROM_END (EPROM_BASE + EPROM_SIZE - 1)
461
462/*
463 * Clean base - dummy
464 *
465 */
466#define CLEAN_BASE EPROM_BASE
467
468/*
469 * System controller bit assignment
470 */
471#define VERSATILE_REFCLK 0
472#define VERSATILE_TIMCLK 1
473
474#define VERSATILE_TIMER1_EnSel 15
475#define VERSATILE_TIMER2_EnSel 17
476#define VERSATILE_TIMER3_EnSel 19
477#define VERSATILE_TIMER4_EnSel 21
478
479
480#define MAX_TIMER 2
481#define MAX_PERIOD 699050
482#define TICKS_PER_uSEC 1
483
484/*
485 * These are useconds NOT ticks.
486 *
487 */
488#define mSEC_1 1000
489#define mSEC_5 (mSEC_1 * 5)
490#define mSEC_10 (mSEC_1 * 10)
491#define mSEC_25 (mSEC_1 * 25)
492#define SEC_1 (mSEC_1 * 1000)
493
494#define VERSATILE_CSR_BASE 0x10000000
495#define VERSATILE_CSR_SIZE 0x10000000
496
497#ifdef CONFIG_MACH_VERSATILE_AB
498/*
499 * IB2 Versatile/AB expansion board definitions
500 */
501#define VERSATILE_IB2_CAMERA_BANK 0x24000000
502#define VERSATILE_IB2_KBD_DATAREG 0x25000000
503#define VERSATILE_IB2_IER 0x26000000 /* for VICINTSOURCE27 */
504#define VERSATILE_IB2_CTRL 0x27000000
505#define VERSATILE_IB2_STAT 0x27000004
506#endif
507
508#endif
509
510/* END */
diff --git a/include/asm-arm/arch-versatile/system.h b/include/asm-arm/arch-versatile/system.h
new file mode 100644
index 000000000000..8889a189739f
--- /dev/null
+++ b/include/asm-arm/arch-versatile/system.h
@@ -0,0 +1,51 @@
1/*
2 * linux/include/asm-arm/arch-versatile/system.h
3 *
4 * Copyright (C) 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#ifndef __ASM_ARCH_SYSTEM_H
22#define __ASM_ARCH_SYSTEM_H
23
24#include <asm/hardware.h>
25#include <asm/io.h>
26#include <asm/arch/platform.h>
27
28static inline void arch_idle(void)
29{
30 /*
31 * This should do all the clock switching
32 * and wait for interrupt tricks
33 */
34 cpu_do_idle();
35}
36
37static inline void arch_reset(char mode)
38{
39 unsigned int hdr_ctrl = (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_RESETCTL_OFFSET);
40 unsigned int val;
41
42 /*
43 * To reset, we hit the on-board reset register
44 * in the system FPGA
45 */
46 val = __raw_readl(hdr_ctrl);
47 val |= VERSATILE_SYS_CTRL_RESET_CONFIGCLR;
48 __raw_writel(val, hdr_ctrl);
49}
50
51#endif
diff --git a/include/asm-arm/arch-versatile/timex.h b/include/asm-arm/arch-versatile/timex.h
new file mode 100644
index 000000000000..38fd04fc9141
--- /dev/null
+++ b/include/asm-arm/arch-versatile/timex.h
@@ -0,0 +1,23 @@
1/*
2 * linux/include/asm-arm/arch-versatile/timex.h
3 *
4 * Versatile architecture timex specifications
5 *
6 * Copyright (C) 2003 ARM Limited
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#define CLOCK_TICK_RATE (50000000 / 16)
diff --git a/include/asm-arm/arch-versatile/uncompress.h b/include/asm-arm/arch-versatile/uncompress.h
new file mode 100644
index 000000000000..2f57499c7b92
--- /dev/null
+++ b/include/asm-arm/arch-versatile/uncompress.h
@@ -0,0 +1,52 @@
1/*
2 * linux/include/asm-arm/arch-versatile/uncompress.h
3 *
4 * Copyright (C) 2003 ARM Limited
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#define AMBA_UART_DR (*(volatile unsigned char *)0x101F1000)
21#define AMBA_UART_LCRH (*(volatile unsigned char *)0x101F102C)
22#define AMBA_UART_CR (*(volatile unsigned char *)0x101F1030)
23#define AMBA_UART_FR (*(volatile unsigned char *)0x101F1018)
24
25/*
26 * This does not append a newline
27 */
28static void putstr(const char *s)
29{
30 while (*s) {
31 while (AMBA_UART_FR & (1 << 5))
32 barrier();
33
34 AMBA_UART_DR = *s;
35
36 if (*s == '\n') {
37 while (AMBA_UART_FR & (1 << 5))
38 barrier();
39
40 AMBA_UART_DR = '\r';
41 }
42 s++;
43 }
44 while (AMBA_UART_FR & (1 << 3))
45 barrier();
46}
47
48/*
49 * nothing to do
50 */
51#define arch_decomp_setup()
52#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-versatile/vmalloc.h b/include/asm-arm/arch-versatile/vmalloc.h
new file mode 100644
index 000000000000..adfb34829bfc
--- /dev/null
+++ b/include/asm-arm/arch-versatile/vmalloc.h
@@ -0,0 +1,33 @@
1/*
2 * linux/include/asm-arm/arch-versatile/vmalloc.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 * Copyright (C) 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 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/*
23 * Just any arbitrary offset to the start of the vmalloc VM area: the
24 * current 8MB value just means that there will be a 8MB "hole" after the
25 * physical memory until the kernel virtual memory starts. That means that
26 * any out-of-bounds memory accesses will hopefully be caught.
27 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
28 * area for the same reason. ;)
29 */
30#define VMALLOC_OFFSET (8*1024*1024)
31#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
32#define VMALLOC_VMADDR(x) ((unsigned long)(x))
33#define VMALLOC_END (PAGE_OFFSET + 0x18000000)
diff --git a/include/asm-arm/assembler.h b/include/asm-arm/assembler.h
new file mode 100644
index 000000000000..69a28f96bee2
--- /dev/null
+++ b/include/asm-arm/assembler.h
@@ -0,0 +1,117 @@
1/*
2 * linux/include/asm-arm/assembler.h
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 * This file contains arm architecture specific defines
11 * for the different processors.
12 *
13 * Do not include any C declarations in this file - it is included by
14 * assembler source.
15 */
16#ifndef __ASSEMBLY__
17#error "Only include this from assembly code"
18#endif
19
20#include <asm/ptrace.h>
21
22/*
23 * Endian independent macros for shifting bytes within registers.
24 */
25#ifndef __ARMEB__
26#define pull lsr
27#define push lsl
28#define get_byte_0 lsl #0
29#define get_byte_1 lsr #8
30#define get_byte_2 lsr #16
31#define get_byte_3 lsr #24
32#define put_byte_0 lsl #0
33#define put_byte_1 lsl #8
34#define put_byte_2 lsl #16
35#define put_byte_3 lsl #24
36#else
37#define pull lsl
38#define push lsr
39#define get_byte_0 lsr #24
40#define get_byte_1 lsr #16
41#define get_byte_2 lsr #8
42#define get_byte_3 lsl #0
43#define put_byte_0 lsl #24
44#define put_byte_1 lsl #16
45#define put_byte_2 lsl #8
46#define put_byte_3 lsl #0
47#endif
48
49/*
50 * Data preload for architectures that support it
51 */
52#if __LINUX_ARM_ARCH__ >= 5
53#define PLD(code...) code
54#else
55#define PLD(code...)
56#endif
57
58#define MODE_USR USR_MODE
59#define MODE_FIQ FIQ_MODE
60#define MODE_IRQ IRQ_MODE
61#define MODE_SVC SVC_MODE
62
63#define DEFAULT_FIQ MODE_FIQ
64
65/*
66 * LOADREGS - ldm with PC in register list (eg, ldmfd sp!, {pc})
67 */
68#ifdef __STDC__
69#define LOADREGS(cond, base, reglist...)\
70 ldm##cond base,reglist
71#else
72#define LOADREGS(cond, base, reglist...)\
73 ldm/**/cond base,reglist
74#endif
75
76/*
77 * Build a return instruction for this processor type.
78 */
79#define RETINSTR(instr, regs...)\
80 instr regs
81
82/*
83 * Save the current IRQ state and disable IRQs. Note that this macro
84 * assumes FIQs are enabled, and that the processor is in SVC mode.
85 */
86 .macro save_and_disable_irqs, oldcpsr, temp
87 mrs \oldcpsr, cpsr
88 mov \temp, #PSR_I_BIT | MODE_SVC
89 msr cpsr_c, \temp
90 .endm
91
92/*
93 * Restore interrupt state previously stored in a register. We don't
94 * guarantee that this will preserve the flags.
95 */
96 .macro restore_irqs, oldcpsr
97 msr cpsr_c, \oldcpsr
98 .endm
99
100/*
101 * These two are used to save LR/restore PC over a user-based access.
102 * The old 26-bit architecture requires that we do. On 32-bit
103 * architecture, we can safely ignore this requirement.
104 */
105 .macro save_lr
106 .endm
107
108 .macro restore_pc
109 mov pc, lr
110 .endm
111
112#define USER(x...) \
1139999: x; \
114 .section __ex_table,"a"; \
115 .align 3; \
116 .long 9999b,9001f; \
117 .previous
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
new file mode 100644
index 000000000000..2885972b0855
--- /dev/null
+++ b/include/asm-arm/atomic.h
@@ -0,0 +1,165 @@
1/*
2 * linux/include/asm-arm/atomic.h
3 *
4 * Copyright (C) 1996 Russell King.
5 * Copyright (C) 2002 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 version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef __ASM_ARM_ATOMIC_H
12#define __ASM_ARM_ATOMIC_H
13
14#include <linux/config.h>
15
16typedef struct { volatile int counter; } atomic_t;
17
18#define ATOMIC_INIT(i) { (i) }
19
20#ifdef __KERNEL__
21
22#define atomic_read(v) ((v)->counter)
23
24#if __LINUX_ARM_ARCH__ >= 6
25
26/*
27 * ARMv6 UP and SMP safe atomic ops. We use load exclusive and
28 * store exclusive to ensure that these are atomic. We may loop
29 * to ensure that the update happens. Writing to 'v->counter'
30 * without using the following operations WILL break the atomic
31 * nature of these ops.
32 */
33static inline void atomic_set(atomic_t *v, int i)
34{
35 unsigned long tmp;
36
37 __asm__ __volatile__("@ atomic_set\n"
38"1: ldrex %0, [%1]\n"
39" strex %0, %2, [%1]\n"
40" teq %0, #0\n"
41" bne 1b"
42 : "=&r" (tmp)
43 : "r" (&v->counter), "r" (i)
44 : "cc");
45}
46
47static inline int atomic_add_return(int i, atomic_t *v)
48{
49 unsigned long tmp;
50 int result;
51
52 __asm__ __volatile__("@ atomic_add_return\n"
53"1: ldrex %0, [%2]\n"
54" add %0, %0, %3\n"
55" strex %1, %0, [%2]\n"
56" teq %1, #0\n"
57" bne 1b"
58 : "=&r" (result), "=&r" (tmp)
59 : "r" (&v->counter), "Ir" (i)
60 : "cc");
61
62 return result;
63}
64
65static inline int atomic_sub_return(int i, atomic_t *v)
66{
67 unsigned long tmp;
68 int result;
69
70 __asm__ __volatile__("@ atomic_sub_return\n"
71"1: ldrex %0, [%2]\n"
72" sub %0, %0, %3\n"
73" strex %1, %0, [%2]\n"
74" teq %1, #0\n"
75" bne 1b"
76 : "=&r" (result), "=&r" (tmp)
77 : "r" (&v->counter), "Ir" (i)
78 : "cc");
79
80 return result;
81}
82
83static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
84{
85 unsigned long tmp, tmp2;
86
87 __asm__ __volatile__("@ atomic_clear_mask\n"
88"1: ldrex %0, %2\n"
89" bic %0, %0, %3\n"
90" strex %1, %0, %2\n"
91" teq %1, #0\n"
92" bne 1b"
93 : "=&r" (tmp), "=&r" (tmp2)
94 : "r" (addr), "Ir" (mask)
95 : "cc");
96}
97
98#else /* ARM_ARCH_6 */
99
100#include <asm/system.h>
101
102#ifdef CONFIG_SMP
103#error SMP not supported on pre-ARMv6 CPUs
104#endif
105
106#define atomic_set(v,i) (((v)->counter) = (i))
107
108static inline int atomic_add_return(int i, atomic_t *v)
109{
110 unsigned long flags;
111 int val;
112
113 local_irq_save(flags);
114 val = v->counter;
115 v->counter = val += i;
116 local_irq_restore(flags);
117
118 return val;
119}
120
121static inline int atomic_sub_return(int i, atomic_t *v)
122{
123 unsigned long flags;
124 int val;
125
126 local_irq_save(flags);
127 val = v->counter;
128 v->counter = val -= i;
129 local_irq_restore(flags);
130
131 return val;
132}
133
134static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
135{
136 unsigned long flags;
137
138 local_irq_save(flags);
139 *addr &= ~mask;
140 local_irq_restore(flags);
141}
142
143#endif /* __LINUX_ARM_ARCH__ */
144
145#define atomic_add(i, v) (void) atomic_add_return(i, v)
146#define atomic_inc(v) (void) atomic_add_return(1, v)
147#define atomic_sub(i, v) (void) atomic_sub_return(i, v)
148#define atomic_dec(v) (void) atomic_sub_return(1, v)
149
150#define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0)
151#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
152#define atomic_inc_return(v) (atomic_add_return(1, v))
153#define atomic_dec_return(v) (atomic_sub_return(1, v))
154#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0)
155
156#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0)
157
158/* Atomic operations are already serializing on ARM */
159#define smp_mb__before_atomic_dec() barrier()
160#define smp_mb__after_atomic_dec() barrier()
161#define smp_mb__before_atomic_inc() barrier()
162#define smp_mb__after_atomic_inc() barrier()
163
164#endif
165#endif
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
new file mode 100644
index 000000000000..4edd4dc40c5b
--- /dev/null
+++ b/include/asm-arm/bitops.h
@@ -0,0 +1,416 @@
1/*
2 * Copyright 1995, Russell King.
3 * Various bits and pieces copyrights include:
4 * Linus Torvalds (test_bit).
5 * Big endian support: Copyright 2001, Nicolas Pitre
6 * reworked by rmk.
7 *
8 * bit 0 is the LSB of an "unsigned long" quantity.
9 *
10 * Please note that the code in this file should never be included
11 * from user space. Many of these are not implemented in assembler
12 * since they would be too costly. Also, they require privileged
13 * instructions (which are not available from user mode) to ensure
14 * that they are atomic.
15 */
16
17#ifndef __ASM_ARM_BITOPS_H
18#define __ASM_ARM_BITOPS_H
19
20#ifdef __KERNEL__
21
22#include <asm/system.h>
23
24#define smp_mb__before_clear_bit() do { } while (0)
25#define smp_mb__after_clear_bit() do { } while (0)
26
27/*
28 * These functions are the basis of our bit ops.
29 *
30 * First, the atomic bitops. These use native endian.
31 */
32static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long *p)
33{
34 unsigned long flags;
35 unsigned long mask = 1UL << (bit & 31);
36
37 p += bit >> 5;
38
39 local_irq_save(flags);
40 *p |= mask;
41 local_irq_restore(flags);
42}
43
44static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p)
45{
46 unsigned long flags;
47 unsigned long mask = 1UL << (bit & 31);
48
49 p += bit >> 5;
50
51 local_irq_save(flags);
52 *p &= ~mask;
53 local_irq_restore(flags);
54}
55
56static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p)
57{
58 unsigned long flags;
59 unsigned long mask = 1UL << (bit & 31);
60
61 p += bit >> 5;
62
63 local_irq_save(flags);
64 *p ^= mask;
65 local_irq_restore(flags);
66}
67
68static inline int
69____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
70{
71 unsigned long flags;
72 unsigned int res;
73 unsigned long mask = 1UL << (bit & 31);
74
75 p += bit >> 5;
76
77 local_irq_save(flags);
78 res = *p;
79 *p = res | mask;
80 local_irq_restore(flags);
81
82 return res & mask;
83}
84
85static inline int
86____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
87{
88 unsigned long flags;
89 unsigned int res;
90 unsigned long mask = 1UL << (bit & 31);
91
92 p += bit >> 5;
93
94 local_irq_save(flags);
95 res = *p;
96 *p = res & ~mask;
97 local_irq_restore(flags);
98
99 return res & mask;
100}
101
102static inline int
103____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
104{
105 unsigned long flags;
106 unsigned int res;
107 unsigned long mask = 1UL << (bit & 31);
108
109 p += bit >> 5;
110
111 local_irq_save(flags);
112 res = *p;
113 *p = res ^ mask;
114 local_irq_restore(flags);
115
116 return res & mask;
117}
118
119/*
120 * Now the non-atomic variants. We let the compiler handle all
121 * optimisations for these. These are all _native_ endian.
122 */
123static inline void __set_bit(int nr, volatile unsigned long *p)
124{
125 p[nr >> 5] |= (1UL << (nr & 31));
126}
127
128static inline void __clear_bit(int nr, volatile unsigned long *p)
129{
130 p[nr >> 5] &= ~(1UL << (nr & 31));
131}
132
133static inline void __change_bit(int nr, volatile unsigned long *p)
134{
135 p[nr >> 5] ^= (1UL << (nr & 31));
136}
137
138static inline int __test_and_set_bit(int nr, volatile unsigned long *p)
139{
140 unsigned long oldval, mask = 1UL << (nr & 31);
141
142 p += nr >> 5;
143
144 oldval = *p;
145 *p = oldval | mask;
146 return oldval & mask;
147}
148
149static inline int __test_and_clear_bit(int nr, volatile unsigned long *p)
150{
151 unsigned long oldval, mask = 1UL << (nr & 31);
152
153 p += nr >> 5;
154
155 oldval = *p;
156 *p = oldval & ~mask;
157 return oldval & mask;
158}
159
160static inline int __test_and_change_bit(int nr, volatile unsigned long *p)
161{
162 unsigned long oldval, mask = 1UL << (nr & 31);
163
164 p += nr >> 5;
165
166 oldval = *p;
167 *p = oldval ^ mask;
168 return oldval & mask;
169}
170
171/*
172 * This routine doesn't need to be atomic.
173 */
174static inline int __test_bit(int nr, const volatile unsigned long * p)
175{
176 return (p[nr >> 5] >> (nr & 31)) & 1UL;
177}
178
179/*
180 * A note about Endian-ness.
181 * -------------------------
182 *
183 * When the ARM is put into big endian mode via CR15, the processor
184 * merely swaps the order of bytes within words, thus:
185 *
186 * ------------ physical data bus bits -----------
187 * D31 ... D24 D23 ... D16 D15 ... D8 D7 ... D0
188 * little byte 3 byte 2 byte 1 byte 0
189 * big byte 0 byte 1 byte 2 byte 3
190 *
191 * This means that reading a 32-bit word at address 0 returns the same
192 * value irrespective of the endian mode bit.
193 *
194 * Peripheral devices should be connected with the data bus reversed in
195 * "Big Endian" mode. ARM Application Note 61 is applicable, and is
196 * available from http://www.arm.com/.
197 *
198 * The following assumes that the data bus connectivity for big endian
199 * mode has been followed.
200 *
201 * Note that bit 0 is defined to be 32-bit word bit 0, not byte 0 bit 0.
202 */
203
204/*
205 * Little endian assembly bitops. nr = 0 -> byte 0 bit 0.
206 */
207extern void _set_bit_le(int nr, volatile unsigned long * p);
208extern void _clear_bit_le(int nr, volatile unsigned long * p);
209extern void _change_bit_le(int nr, volatile unsigned long * p);
210extern int _test_and_set_bit_le(int nr, volatile unsigned long * p);
211extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p);
212extern int _test_and_change_bit_le(int nr, volatile unsigned long * p);
213extern int _find_first_zero_bit_le(const void * p, unsigned size);
214extern int _find_next_zero_bit_le(const void * p, int size, int offset);
215extern int _find_first_bit_le(const unsigned long *p, unsigned size);
216extern int _find_next_bit_le(const unsigned long *p, int size, int offset);
217
218/*
219 * Big endian assembly bitops. nr = 0 -> byte 3 bit 0.
220 */
221extern void _set_bit_be(int nr, volatile unsigned long * p);
222extern void _clear_bit_be(int nr, volatile unsigned long * p);
223extern void _change_bit_be(int nr, volatile unsigned long * p);
224extern int _test_and_set_bit_be(int nr, volatile unsigned long * p);
225extern int _test_and_clear_bit_be(int nr, volatile unsigned long * p);
226extern int _test_and_change_bit_be(int nr, volatile unsigned long * p);
227extern int _find_first_zero_bit_be(const void * p, unsigned size);
228extern int _find_next_zero_bit_be(const void * p, int size, int offset);
229extern int _find_first_bit_be(const unsigned long *p, unsigned size);
230extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
231
232/*
233 * The __* form of bitops are non-atomic and may be reordered.
234 */
235#define ATOMIC_BITOP_LE(name,nr,p) \
236 (__builtin_constant_p(nr) ? \
237 ____atomic_##name(nr, p) : \
238 _##name##_le(nr,p))
239
240#define ATOMIC_BITOP_BE(name,nr,p) \
241 (__builtin_constant_p(nr) ? \
242 ____atomic_##name(nr, p) : \
243 _##name##_be(nr,p))
244
245#define NONATOMIC_BITOP(name,nr,p) \
246 (____nonatomic_##name(nr, p))
247
248#ifndef __ARMEB__
249/*
250 * These are the little endian, atomic definitions.
251 */
252#define set_bit(nr,p) ATOMIC_BITOP_LE(set_bit,nr,p)
253#define clear_bit(nr,p) ATOMIC_BITOP_LE(clear_bit,nr,p)
254#define change_bit(nr,p) ATOMIC_BITOP_LE(change_bit,nr,p)
255#define test_and_set_bit(nr,p) ATOMIC_BITOP_LE(test_and_set_bit,nr,p)
256#define test_and_clear_bit(nr,p) ATOMIC_BITOP_LE(test_and_clear_bit,nr,p)
257#define test_and_change_bit(nr,p) ATOMIC_BITOP_LE(test_and_change_bit,nr,p)
258#define test_bit(nr,p) __test_bit(nr,p)
259#define find_first_zero_bit(p,sz) _find_first_zero_bit_le(p,sz)
260#define find_next_zero_bit(p,sz,off) _find_next_zero_bit_le(p,sz,off)
261#define find_first_bit(p,sz) _find_first_bit_le(p,sz)
262#define find_next_bit(p,sz,off) _find_next_bit_le(p,sz,off)
263
264#define WORD_BITOFF_TO_LE(x) ((x))
265
266#else
267
268/*
269 * These are the big endian, atomic definitions.
270 */
271#define set_bit(nr,p) ATOMIC_BITOP_BE(set_bit,nr,p)
272#define clear_bit(nr,p) ATOMIC_BITOP_BE(clear_bit,nr,p)
273#define change_bit(nr,p) ATOMIC_BITOP_BE(change_bit,nr,p)
274#define test_and_set_bit(nr,p) ATOMIC_BITOP_BE(test_and_set_bit,nr,p)
275#define test_and_clear_bit(nr,p) ATOMIC_BITOP_BE(test_and_clear_bit,nr,p)
276#define test_and_change_bit(nr,p) ATOMIC_BITOP_BE(test_and_change_bit,nr,p)
277#define test_bit(nr,p) __test_bit(nr,p)
278#define find_first_zero_bit(p,sz) _find_first_zero_bit_be(p,sz)
279#define find_next_zero_bit(p,sz,off) _find_next_zero_bit_be(p,sz,off)
280#define find_first_bit(p,sz) _find_first_bit_be(p,sz)
281#define find_next_bit(p,sz,off) _find_next_bit_be(p,sz,off)
282
283#define WORD_BITOFF_TO_LE(x) ((x) ^ 0x18)
284
285#endif
286
287#if __LINUX_ARM_ARCH__ < 5
288
289/*
290 * ffz = Find First Zero in word. Undefined if no zero exists,
291 * so code should check against ~0UL first..
292 */
293static inline unsigned long ffz(unsigned long word)
294{
295 int k;
296
297 word = ~word;
298 k = 31;
299 if (word & 0x0000ffff) { k -= 16; word <<= 16; }
300 if (word & 0x00ff0000) { k -= 8; word <<= 8; }
301 if (word & 0x0f000000) { k -= 4; word <<= 4; }
302 if (word & 0x30000000) { k -= 2; word <<= 2; }
303 if (word & 0x40000000) { k -= 1; }
304 return k;
305}
306
307/*
308 * ffz = Find First Zero in word. Undefined if no zero exists,
309 * so code should check against ~0UL first..
310 */
311static inline unsigned long __ffs(unsigned long word)
312{
313 int k;
314
315 k = 31;
316 if (word & 0x0000ffff) { k -= 16; word <<= 16; }
317 if (word & 0x00ff0000) { k -= 8; word <<= 8; }
318 if (word & 0x0f000000) { k -= 4; word <<= 4; }
319 if (word & 0x30000000) { k -= 2; word <<= 2; }
320 if (word & 0x40000000) { k -= 1; }
321 return k;
322}
323
324/*
325 * fls: find last bit set.
326 */
327
328#define fls(x) generic_fls(x)
329
330/*
331 * ffs: find first bit set. This is defined the same way as
332 * the libc and compiler builtin ffs routines, therefore
333 * differs in spirit from the above ffz (man ffs).
334 */
335
336#define ffs(x) generic_ffs(x)
337
338#else
339
340/*
341 * On ARMv5 and above those functions can be implemented around
342 * the clz instruction for much better code efficiency.
343 */
344
345static __inline__ int generic_fls(int x);
346#define fls(x) \
347 ( __builtin_constant_p(x) ? generic_fls(x) : \
348 ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) )
349#define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); })
350#define __ffs(x) (ffs(x) - 1)
351#define ffz(x) __ffs( ~(x) )
352
353#endif
354
355/*
356 * Find first bit set in a 168-bit bitmap, where the first
357 * 128 bits are unlikely to be set.
358 */
359static inline int sched_find_first_bit(const unsigned long *b)
360{
361 unsigned long v;
362 unsigned int off;
363
364 for (off = 0; v = b[off], off < 4; off++) {
365 if (unlikely(v))
366 break;
367 }
368 return __ffs(v) + off * 32;
369}
370
371/*
372 * hweightN: returns the hamming weight (i.e. the number
373 * of bits set) of a N-bit word
374 */
375
376#define hweight32(x) generic_hweight32(x)
377#define hweight16(x) generic_hweight16(x)
378#define hweight8(x) generic_hweight8(x)
379
380/*
381 * Ext2 is defined to use little-endian byte ordering.
382 * These do not need to be atomic.
383 */
384#define ext2_set_bit(nr,p) \
385 __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
386#define ext2_set_bit_atomic(lock,nr,p) \
387 test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
388#define ext2_clear_bit(nr,p) \
389 __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
390#define ext2_clear_bit_atomic(lock,nr,p) \
391 test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
392#define ext2_test_bit(nr,p) \
393 __test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
394#define ext2_find_first_zero_bit(p,sz) \
395 _find_first_zero_bit_le(p,sz)
396#define ext2_find_next_zero_bit(p,sz,off) \
397 _find_next_zero_bit_le(p,sz,off)
398
399/*
400 * Minix is defined to use little-endian byte ordering.
401 * These do not need to be atomic.
402 */
403#define minix_set_bit(nr,p) \
404 __set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
405#define minix_test_bit(nr,p) \
406 __test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
407#define minix_test_and_set_bit(nr,p) \
408 __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
409#define minix_test_and_clear_bit(nr,p) \
410 __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
411#define minix_find_first_zero_bit(p,sz) \
412 _find_first_zero_bit_le(p,sz)
413
414#endif /* __KERNEL__ */
415
416#endif /* _ARM_BITOPS_H */
diff --git a/include/asm-arm/bug.h b/include/asm-arm/bug.h
new file mode 100644
index 000000000000..5e91b90a8181
--- /dev/null
+++ b/include/asm-arm/bug.h
@@ -0,0 +1,22 @@
1#ifndef _ASMARM_BUG_H
2#define _ASMARM_BUG_H
3
4#include <linux/config.h>
5
6#ifdef CONFIG_DEBUG_BUGVERBOSE
7extern volatile void __bug(const char *file, int line, void *data);
8
9/* give file/line information */
10#define BUG() __bug(__FILE__, __LINE__, NULL)
11
12#else
13
14/* this just causes an oops */
15#define BUG() (*(int *)0 = 0)
16
17#endif
18
19#define HAVE_ARCH_BUG
20#include <asm-generic/bug.h>
21
22#endif
diff --git a/include/asm-arm/bugs.h b/include/asm-arm/bugs.h
new file mode 100644
index 000000000000..4c80ec519d45
--- /dev/null
+++ b/include/asm-arm/bugs.h
@@ -0,0 +1,17 @@
1/*
2 * linux/include/asm-arm/bugs.h
3 *
4 * Copyright (C) 1995-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#ifndef __ASM_BUGS_H
11#define __ASM_BUGS_H
12
13extern void check_writebuffer_bugs(void);
14
15#define check_bugs() check_writebuffer_bugs()
16
17#endif
diff --git a/include/asm-arm/byteorder.h b/include/asm-arm/byteorder.h
new file mode 100644
index 000000000000..d648a1915c33
--- /dev/null
+++ b/include/asm-arm/byteorder.h
@@ -0,0 +1,33 @@
1/*
2 * linux/include/asm-arm/byteorder.h
3 *
4 * ARM Endian-ness. In little endian mode, the data bus is connected such
5 * that byte accesses appear as:
6 * 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
7 * and word accesses (data or instruction) appear as:
8 * d0...d31
9 *
10 * When in big endian mode, byte accesses appear as:
11 * 0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
12 * and word accesses (data or instruction) appear as:
13 * d0...d31
14 */
15#ifndef __ASM_ARM_BYTEORDER_H
16#define __ASM_ARM_BYTEORDER_H
17
18
19#include <asm/types.h>
20
21#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
22# define __BYTEORDER_HAS_U64__
23# define __SWAB_64_THRU_32__
24#endif
25
26#ifdef __ARMEB__
27#include <linux/byteorder/big_endian.h>
28#else
29#include <linux/byteorder/little_endian.h>
30#endif
31
32#endif
33
diff --git a/include/asm-arm/cache.h b/include/asm-arm/cache.h
new file mode 100644
index 000000000000..8d161f7c87ff
--- /dev/null
+++ b/include/asm-arm/cache.h
@@ -0,0 +1,15 @@
1/*
2 * linux/include/asm-arm/cache.h
3 */
4#ifndef __ASMARM_CACHE_H
5#define __ASMARM_CACHE_H
6
7#define L1_CACHE_SHIFT 5
8#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
9
10/*
11 * largest L1 which this arch supports
12 */
13#define L1_CACHE_SHIFT_MAX 5
14
15#endif
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
new file mode 100644
index 000000000000..09ffeed507c2
--- /dev/null
+++ b/include/asm-arm/cacheflush.h
@@ -0,0 +1,387 @@
1/*
2 * linux/include/asm-arm/cacheflush.h
3 *
4 * Copyright (C) 1999-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#ifndef _ASMARM_CACHEFLUSH_H
11#define _ASMARM_CACHEFLUSH_H
12
13#include <linux/config.h>
14#include <linux/sched.h>
15#include <linux/mm.h>
16
17#include <asm/mman.h>
18#include <asm/glue.h>
19
20/*
21 * Cache Model
22 * ===========
23 */
24#undef _CACHE
25#undef MULTI_CACHE
26
27#if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710)
28# ifdef _CACHE
29# define MULTI_CACHE 1
30# else
31# define _CACHE v3
32# endif
33#endif
34
35#if defined(CONFIG_CPU_ARM720T)
36# ifdef _CACHE
37# define MULTI_CACHE 1
38# else
39# define _CACHE v4
40# endif
41#endif
42
43#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \
44 defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020)
45# define MULTI_CACHE 1
46#endif
47
48#if defined(CONFIG_CPU_ARM926T)
49# ifdef _CACHE
50# define MULTI_CACHE 1
51# else
52# define _CACHE arm926
53# endif
54#endif
55
56#if defined(CONFIG_CPU_SA110) || defined(CONFIG_CPU_SA1100)
57# ifdef _CACHE
58# define MULTI_CACHE 1
59# else
60# define _CACHE v4wb
61# endif
62#endif
63
64#if defined(CONFIG_CPU_XSCALE)
65# ifdef _CACHE
66# define MULTI_CACHE 1
67# else
68# define _CACHE xscale
69# endif
70#endif
71
72#if defined(CONFIG_CPU_V6)
73//# ifdef _CACHE
74# define MULTI_CACHE 1
75//# else
76//# define _CACHE v6
77//# endif
78#endif
79
80#if !defined(_CACHE) && !defined(MULTI_CACHE)
81#error Unknown cache maintainence model
82#endif
83
84/*
85 * This flag is used to indicate that the page pointed to by a pte
86 * is dirty and requires cleaning before returning it to the user.
87 */
88#define PG_dcache_dirty PG_arch_1
89
90/*
91 * MM Cache Management
92 * ===================
93 *
94 * The arch/arm/mm/cache-*.S and arch/arm/mm/proc-*.S files
95 * implement these methods.
96 *
97 * Start addresses are inclusive and end addresses are exclusive;
98 * start addresses should be rounded down, end addresses up.
99 *
100 * See Documentation/cachetlb.txt for more information.
101 * Please note that the implementation of these, and the required
102 * effects are cache-type (VIVT/VIPT/PIPT) specific.
103 *
104 * flush_cache_kern_all()
105 *
106 * Unconditionally clean and invalidate the entire cache.
107 *
108 * flush_cache_user_mm(mm)
109 *
110 * Clean and invalidate all user space cache entries
111 * before a change of page tables.
112 *
113 * flush_cache_user_range(start, end, flags)
114 *
115 * Clean and invalidate a range of cache entries in the
116 * specified address space before a change of page tables.
117 * - start - user start address (inclusive, page aligned)
118 * - end - user end address (exclusive, page aligned)
119 * - flags - vma->vm_flags field
120 *
121 * coherent_kern_range(start, end)
122 *
123 * Ensure coherency between the Icache and the Dcache in the
124 * region described by start, end. If you have non-snooping
125 * Harvard caches, you need to implement this function.
126 * - start - virtual start address
127 * - end - virtual end address
128 *
129 * DMA Cache Coherency
130 * ===================
131 *
132 * dma_inv_range(start, end)
133 *
134 * Invalidate (discard) the specified virtual address range.
135 * May not write back any entries. If 'start' or 'end'
136 * are not cache line aligned, those lines must be written
137 * back.
138 * - start - virtual start address
139 * - end - virtual end address
140 *
141 * dma_clean_range(start, end)
142 *
143 * Clean (write back) the specified virtual address range.
144 * - start - virtual start address
145 * - end - virtual end address
146 *
147 * dma_flush_range(start, end)
148 *
149 * Clean and invalidate the specified virtual address range.
150 * - start - virtual start address
151 * - end - virtual end address
152 */
153
154struct cpu_cache_fns {
155 void (*flush_kern_all)(void);
156 void (*flush_user_all)(void);
157 void (*flush_user_range)(unsigned long, unsigned long, unsigned int);
158
159 void (*coherent_kern_range)(unsigned long, unsigned long);
160 void (*coherent_user_range)(unsigned long, unsigned long);
161 void (*flush_kern_dcache_page)(void *);
162
163 void (*dma_inv_range)(unsigned long, unsigned long);
164 void (*dma_clean_range)(unsigned long, unsigned long);
165 void (*dma_flush_range)(unsigned long, unsigned long);
166};
167
168/*
169 * Select the calling method
170 */
171#ifdef MULTI_CACHE
172
173extern struct cpu_cache_fns cpu_cache;
174
175#define __cpuc_flush_kern_all cpu_cache.flush_kern_all
176#define __cpuc_flush_user_all cpu_cache.flush_user_all
177#define __cpuc_flush_user_range cpu_cache.flush_user_range
178#define __cpuc_coherent_kern_range cpu_cache.coherent_kern_range
179#define __cpuc_coherent_user_range cpu_cache.coherent_user_range
180#define __cpuc_flush_dcache_page cpu_cache.flush_kern_dcache_page
181
182/*
183 * These are private to the dma-mapping API. Do not use directly.
184 * Their sole purpose is to ensure that data held in the cache
185 * is visible to DMA, or data written by DMA to system memory is
186 * visible to the CPU.
187 */
188#define dmac_inv_range cpu_cache.dma_inv_range
189#define dmac_clean_range cpu_cache.dma_clean_range
190#define dmac_flush_range cpu_cache.dma_flush_range
191
192#else
193
194#define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all)
195#define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all)
196#define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
197#define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
198#define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
199#define __cpuc_flush_dcache_page __glue(_CACHE,_flush_kern_dcache_page)
200
201extern void __cpuc_flush_kern_all(void);
202extern void __cpuc_flush_user_all(void);
203extern void __cpuc_flush_user_range(unsigned long, unsigned long, unsigned int);
204extern void __cpuc_coherent_kern_range(unsigned long, unsigned long);
205extern void __cpuc_coherent_user_range(unsigned long, unsigned long);
206extern void __cpuc_flush_dcache_page(void *);
207
208/*
209 * These are private to the dma-mapping API. Do not use directly.
210 * Their sole purpose is to ensure that data held in the cache
211 * is visible to DMA, or data written by DMA to system memory is
212 * visible to the CPU.
213 */
214#define dmac_inv_range __glue(_CACHE,_dma_inv_range)
215#define dmac_clean_range __glue(_CACHE,_dma_clean_range)
216#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
217
218extern void dmac_inv_range(unsigned long, unsigned long);
219extern void dmac_clean_range(unsigned long, unsigned long);
220extern void dmac_flush_range(unsigned long, unsigned long);
221
222#endif
223
224/*
225 * flush_cache_vmap() is used when creating mappings (eg, via vmap,
226 * vmalloc, ioremap etc) in kernel space for pages. Since the
227 * direct-mappings of these pages may contain cached data, we need
228 * to do a full cache flush to ensure that writebacks don't corrupt
229 * data placed into these pages via the new mappings.
230 */
231#define flush_cache_vmap(start, end) flush_cache_all()
232#define flush_cache_vunmap(start, end) flush_cache_all()
233
234/*
235 * Copy user data from/to a page which is mapped into a different
236 * processes address space. Really, we want to allow our "user
237 * space" model to handle this.
238 */
239#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
240 do { \
241 flush_cache_page(vma, vaddr, page_to_pfn(page));\
242 memcpy(dst, src, len); \
243 flush_dcache_page(page); \
244 } while (0)
245
246#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
247 do { \
248 flush_cache_page(vma, vaddr, page_to_pfn(page));\
249 memcpy(dst, src, len); \
250 } while (0)
251
252/*
253 * Convert calls to our calling convention.
254 */
255#define flush_cache_all() __cpuc_flush_kern_all()
256
257static inline void flush_cache_mm(struct mm_struct *mm)
258{
259 if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask))
260 __cpuc_flush_user_all();
261}
262
263static inline void
264flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
265{
266 if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask))
267 __cpuc_flush_user_range(start & PAGE_MASK, PAGE_ALIGN(end),
268 vma->vm_flags);
269}
270
271static inline void
272flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn)
273{
274 if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
275 unsigned long addr = user_addr & PAGE_MASK;
276 __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags);
277 }
278}
279
280/*
281 * flush_cache_user_range is used when we want to ensure that the
282 * Harvard caches are synchronised for the user space address range.
283 * This is used for the ARM private sys_cacheflush system call.
284 */
285#define flush_cache_user_range(vma,start,end) \
286 __cpuc_coherent_user_range((start) & PAGE_MASK, PAGE_ALIGN(end))
287
288/*
289 * Perform necessary cache operations to ensure that data previously
290 * stored within this range of addresses can be executed by the CPU.
291 */
292#define flush_icache_range(s,e) __cpuc_coherent_kern_range(s,e)
293
294/*
295 * Perform necessary cache operations to ensure that the TLB will
296 * see data written in the specified area.
297 */
298#define clean_dcache_area(start,size) cpu_dcache_clean_area(start, size)
299
300/*
301 * flush_dcache_page is used when the kernel has written to the page
302 * cache page at virtual address page->virtual.
303 *
304 * If this page isn't mapped (ie, page_mapping == NULL), or it might
305 * have userspace mappings, then we _must_ always clean + invalidate
306 * the dcache entries associated with the kernel mapping.
307 *
308 * Otherwise we can defer the operation, and clean the cache when we are
309 * about to change to user space. This is the same method as used on SPARC64.
310 * See update_mmu_cache for the user space part.
311 */
312extern void flush_dcache_page(struct page *);
313
314#define flush_dcache_mmap_lock(mapping) \
315 write_lock_irq(&(mapping)->tree_lock)
316#define flush_dcache_mmap_unlock(mapping) \
317 write_unlock_irq(&(mapping)->tree_lock)
318
319#define flush_icache_user_range(vma,page,addr,len) \
320 flush_dcache_page(page)
321
322/*
323 * We don't appear to need to do anything here. In fact, if we did, we'd
324 * duplicate cache flushing elsewhere performed by flush_dcache_page().
325 */
326#define flush_icache_page(vma,page) do { } while (0)
327
328#define __cacheid_present(val) (val != read_cpuid(CPUID_ID))
329#define __cacheid_vivt(val) ((val & (15 << 25)) != (14 << 25))
330#define __cacheid_vipt(val) ((val & (15 << 25)) == (14 << 25))
331#define __cacheid_vipt_nonaliasing(val) ((val & (15 << 25 | 1 << 23)) == (14 << 25))
332#define __cacheid_vipt_aliasing(val) ((val & (15 << 25 | 1 << 23)) == (14 << 25 | 1 << 23))
333
334#if defined(CONFIG_CPU_CACHE_VIVT) && !defined(CONFIG_CPU_CACHE_VIPT)
335
336#define cache_is_vivt() 1
337#define cache_is_vipt() 0
338#define cache_is_vipt_nonaliasing() 0
339#define cache_is_vipt_aliasing() 0
340
341#elif defined(CONFIG_CPU_CACHE_VIPT)
342
343#define cache_is_vivt() 0
344#define cache_is_vipt() 1
345#define cache_is_vipt_nonaliasing() \
346 ({ \
347 unsigned int __val = read_cpuid(CPUID_CACHETYPE); \
348 __cacheid_vipt_nonaliasing(__val); \
349 })
350
351#define cache_is_vipt_aliasing() \
352 ({ \
353 unsigned int __val = read_cpuid(CPUID_CACHETYPE); \
354 __cacheid_vipt_aliasing(__val); \
355 })
356
357#else
358
359#define cache_is_vivt() \
360 ({ \
361 unsigned int __val = read_cpuid(CPUID_CACHETYPE); \
362 (!__cacheid_present(__val)) || __cacheid_vivt(__val); \
363 })
364
365#define cache_is_vipt() \
366 ({ \
367 unsigned int __val = read_cpuid(CPUID_CACHETYPE); \
368 __cacheid_present(__val) && __cacheid_vipt(__val); \
369 })
370
371#define cache_is_vipt_nonaliasing() \
372 ({ \
373 unsigned int __val = read_cpuid(CPUID_CACHETYPE); \
374 __cacheid_present(__val) && \
375 __cacheid_vipt_nonaliasing(__val); \
376 })
377
378#define cache_is_vipt_aliasing() \
379 ({ \
380 unsigned int __val = read_cpuid(CPUID_CACHETYPE); \
381 __cacheid_present(__val) && \
382 __cacheid_vipt_aliasing(__val); \
383 })
384
385#endif
386
387#endif
diff --git a/include/asm-arm/checksum.h b/include/asm-arm/checksum.h
new file mode 100644
index 000000000000..d4256d5f3a7c
--- /dev/null
+++ b/include/asm-arm/checksum.h
@@ -0,0 +1,160 @@
1/*
2 * linux/include/asm-arm/checksum.h
3 *
4 * IP checksum routines
5 *
6 * Copyright (C) Original authors of ../asm-i386/checksum.h
7 * Copyright (C) 1996-1999 Russell King
8 */
9#ifndef __ASM_ARM_CHECKSUM_H
10#define __ASM_ARM_CHECKSUM_H
11
12#include <linux/in6.h>
13
14/*
15 * computes the checksum of a memory block at buff, length len,
16 * and adds in "sum" (32-bit)
17 *
18 * returns a 32-bit number suitable for feeding into itself
19 * or csum_tcpudp_magic
20 *
21 * this function must be called with even lengths, except
22 * for the last fragment, which may be odd
23 *
24 * it's best to have buff aligned on a 32-bit boundary
25 */
26unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
27
28/*
29 * the same as csum_partial, but copies from src while it
30 * checksums, and handles user-space pointer exceptions correctly, when needed.
31 *
32 * here even more important to align src and dst on a 32-bit (or even
33 * better 64-bit) boundary
34 */
35
36unsigned int
37csum_partial_copy_nocheck(const char *src, char *dst, int len, int sum);
38
39unsigned int
40csum_partial_copy_from_user(const char __user *src, char *dst, int len, int sum, int *err_ptr);
41
42/*
43 * This is the old (and unsafe) way of doing checksums, a warning message will
44 * be printed if it is used and an exception occurs.
45 *
46 * this functions should go away after some time.
47 */
48#define csum_partial_copy(src,dst,len,sum) csum_partial_copy_nocheck(src,dst,len,sum)
49
50/*
51 * This is a version of ip_compute_csum() optimized for IP headers,
52 * which always checksum on 4 octet boundaries.
53 */
54static inline unsigned short
55ip_fast_csum(unsigned char * iph, unsigned int ihl)
56{
57 unsigned int sum, tmp1;
58
59 __asm__ __volatile__(
60 "ldr %0, [%1], #4 @ ip_fast_csum \n\
61 ldr %3, [%1], #4 \n\
62 sub %2, %2, #5 \n\
63 adds %0, %0, %3 \n\
64 ldr %3, [%1], #4 \n\
65 adcs %0, %0, %3 \n\
66 ldr %3, [%1], #4 \n\
671: adcs %0, %0, %3 \n\
68 ldr %3, [%1], #4 \n\
69 tst %2, #15 @ do this carefully \n\
70 subne %2, %2, #1 @ without destroying \n\
71 bne 1b @ the carry flag \n\
72 adcs %0, %0, %3 \n\
73 adc %0, %0, #0 \n\
74 adds %0, %0, %0, lsl #16 \n\
75 addcs %0, %0, #0x10000 \n\
76 mvn %0, %0 \n\
77 mov %0, %0, lsr #16"
78 : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1)
79 : "1" (iph), "2" (ihl)
80 : "cc");
81 return sum;
82}
83
84/*
85 * Fold a partial checksum without adding pseudo headers
86 */
87static inline unsigned int
88csum_fold(unsigned int sum)
89{
90 __asm__(
91 "adds %0, %1, %1, lsl #16 @ csum_fold \n\
92 addcs %0, %0, #0x10000"
93 : "=r" (sum)
94 : "r" (sum)
95 : "cc");
96 return (~sum) >> 16;
97}
98
99static inline unsigned int
100csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
101 unsigned int proto, unsigned int sum)
102{
103 __asm__(
104 "adds %0, %1, %2 @ csum_tcpudp_nofold \n\
105 adcs %0, %0, %3 \n\
106 adcs %0, %0, %4 \n\
107 adcs %0, %0, %5 \n\
108 adc %0, %0, #0"
109 : "=&r"(sum)
110 : "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto))
111 : "cc");
112 return sum;
113}
114/*
115 * computes the checksum of the TCP/UDP pseudo-header
116 * returns a 16-bit checksum, already complemented
117 */
118static inline unsigned short int
119csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
120 unsigned int proto, unsigned int sum)
121{
122 __asm__(
123 "adds %0, %1, %2 @ csum_tcpudp_magic \n\
124 adcs %0, %0, %3 \n\
125 adcs %0, %0, %4 \n\
126 adcs %0, %0, %5 \n\
127 adc %0, %0, #0 \n\
128 adds %0, %0, %0, lsl #16 \n\
129 addcs %0, %0, #0x10000 \n\
130 mvn %0, %0"
131 : "=&r"(sum)
132 : "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto))
133 : "cc");
134 return sum >> 16;
135}
136
137
138/*
139 * this routine is used for miscellaneous IP-like checksums, mainly
140 * in icmp.c
141 */
142static inline unsigned short
143ip_compute_csum(unsigned char * buff, int len)
144{
145 return csum_fold(csum_partial(buff, len, 0));
146}
147
148#define _HAVE_ARCH_IPV6_CSUM
149extern unsigned long
150__csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len,
151 __u32 proto, unsigned int sum);
152
153static inline unsigned short int
154csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len,
155 unsigned short proto, unsigned int sum)
156{
157 return csum_fold(__csum_ipv6_magic(saddr, daddr, htonl(len),
158 htonl(proto), sum));
159}
160#endif
diff --git a/include/asm-arm/cpu-multi32.h b/include/asm-arm/cpu-multi32.h
new file mode 100644
index 000000000000..ff48022e4720
--- /dev/null
+++ b/include/asm-arm/cpu-multi32.h
@@ -0,0 +1,64 @@
1/*
2 * linux/include/asm-arm/cpu-multi32.h
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 <asm/page.h>
11
12struct mm_struct;
13
14/*
15 * Don't change this structure - ASM code
16 * relies on it.
17 */
18extern struct processor {
19 /* MISC
20 * get data abort address/flags
21 */
22 void (*_data_abort)(unsigned long pc);
23 /*
24 * Set up any processor specifics
25 */
26 void (*_proc_init)(void);
27 /*
28 * Disable any processor specifics
29 */
30 void (*_proc_fin)(void);
31 /*
32 * Special stuff for a reset
33 */
34 volatile void (*reset)(unsigned long addr);
35 /*
36 * Idle the processor
37 */
38 int (*_do_idle)(void);
39 /*
40 * Processor architecture specific
41 */
42 /*
43 * clean a virtual address range from the
44 * D-cache without flushing the cache.
45 */
46 void (*dcache_clean_area)(void *addr, int size);
47
48 /*
49 * Set the page table
50 */
51 void (*switch_mm)(unsigned long pgd_phys, struct mm_struct *mm);
52 /*
53 * Set a PTE
54 */
55 void (*set_pte)(pte_t *ptep, pte_t pte);
56} processor;
57
58#define cpu_proc_init() processor._proc_init()
59#define cpu_proc_fin() processor._proc_fin()
60#define cpu_reset(addr) processor.reset(addr)
61#define cpu_do_idle() processor._do_idle()
62#define cpu_dcache_clean_area(addr,sz) processor.dcache_clean_area(addr,sz)
63#define cpu_set_pte(ptep, pte) processor.set_pte(ptep, pte)
64#define cpu_do_switch_mm(pgd,mm) processor.switch_mm(pgd,mm)
diff --git a/include/asm-arm/cpu-single.h b/include/asm-arm/cpu-single.h
new file mode 100644
index 000000000000..b5ec5d54665d
--- /dev/null
+++ b/include/asm-arm/cpu-single.h
@@ -0,0 +1,44 @@
1/*
2 * linux/include/asm-arm/cpu-single.h
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/*
11 * Single CPU
12 */
13#ifdef __STDC__
14#define __catify_fn(name,x) name##x
15#else
16#define __catify_fn(name,x) name/**/x
17#endif
18#define __cpu_fn(name,x) __catify_fn(name,x)
19
20/*
21 * If we are supporting multiple CPUs, then we must use a table of
22 * function pointers for this lot. Otherwise, we can optimise the
23 * table away.
24 */
25#define cpu_proc_init __cpu_fn(CPU_NAME,_proc_init)
26#define cpu_proc_fin __cpu_fn(CPU_NAME,_proc_fin)
27#define cpu_reset __cpu_fn(CPU_NAME,_reset)
28#define cpu_do_idle __cpu_fn(CPU_NAME,_do_idle)
29#define cpu_dcache_clean_area __cpu_fn(CPU_NAME,_dcache_clean_area)
30#define cpu_do_switch_mm __cpu_fn(CPU_NAME,_switch_mm)
31#define cpu_set_pte __cpu_fn(CPU_NAME,_set_pte)
32
33#include <asm/page.h>
34
35struct mm_struct;
36
37/* declare all the functions as extern */
38extern void cpu_proc_init(void);
39extern void cpu_proc_fin(void);
40extern int cpu_do_idle(void);
41extern void cpu_dcache_clean_area(void *, int);
42extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
43extern void cpu_set_pte(pte_t *ptep, pte_t pte);
44extern volatile void cpu_reset(unsigned long addr);
diff --git a/include/asm-arm/cpu.h b/include/asm-arm/cpu.h
new file mode 100644
index 000000000000..fcbdd40cb667
--- /dev/null
+++ b/include/asm-arm/cpu.h
@@ -0,0 +1,25 @@
1/*
2 * linux/include/asm-arm/cpu.h
3 *
4 * Copyright (C) 2004-2005 ARM 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#ifndef __ASM_ARM_CPU_H
11#define __ASM_ARM_CPU_H
12
13#include <linux/config.h>
14#include <linux/percpu.h>
15
16struct cpuinfo_arm {
17 struct cpu cpu;
18#ifdef CONFIG_SMP
19 unsigned int loops_per_jiffy;
20#endif
21};
22
23DECLARE_PER_CPU(struct cpuinfo_arm, cpu_data);
24
25#endif
diff --git a/include/asm-arm/cputime.h b/include/asm-arm/cputime.h
new file mode 100644
index 000000000000..3a8002a5fec7
--- /dev/null
+++ b/include/asm-arm/cputime.h
@@ -0,0 +1,6 @@
1#ifndef __ARM_CPUTIME_H
2#define __ARM_CPUTIME_H
3
4#include <asm-generic/cputime.h>
5
6#endif /* __ARM_CPUTIME_H */
diff --git a/include/asm-arm/current.h b/include/asm-arm/current.h
new file mode 100644
index 000000000000..75d21e2a3ff7
--- /dev/null
+++ b/include/asm-arm/current.h
@@ -0,0 +1,15 @@
1#ifndef _ASMARM_CURRENT_H
2#define _ASMARM_CURRENT_H
3
4#include <linux/thread_info.h>
5
6static inline struct task_struct *get_current(void) __attribute_const__;
7
8static inline struct task_struct *get_current(void)
9{
10 return current_thread_info()->task;
11}
12
13#define current (get_current())
14
15#endif /* _ASMARM_CURRENT_H */
diff --git a/include/asm-arm/delay.h b/include/asm-arm/delay.h
new file mode 100644
index 000000000000..1704360e9699
--- /dev/null
+++ b/include/asm-arm/delay.h
@@ -0,0 +1,42 @@
1/*
2 * Copyright (C) 1995-2004 Russell King
3 *
4 * Delay routines, using a pre-computed "loops_per_second" value.
5 */
6#ifndef __ASM_ARM_DELAY_H
7#define __ASM_ARM_DELAY_H
8
9extern void __delay(int loops);
10
11/*
12 * This function intentionally does not exist; if you see references to
13 * it, it means that you're calling udelay() with an out of range value.
14 *
15 * With currently imposed limits, this means that we support a max delay
16 * of 2000us and 671 bogomips
17 */
18extern void __bad_udelay(void);
19
20/*
21 * division by multiplication: you don't have to worry about
22 * loss of precision.
23 *
24 * Use only for very small delays ( < 1 msec). Should probably use a
25 * lookup table, really, as the multiplications take much too long with
26 * short delays. This is a "reasonable" implementation, though (and the
27 * first constant multiplications gets optimized away if the delay is
28 * a constant)
29 */
30extern void __udelay(unsigned long usecs);
31extern void __const_udelay(unsigned long);
32
33#define MAX_UDELAY_MS 2
34
35#define udelay(n) \
36 (__builtin_constant_p(n) ? \
37 ((n) > (MAX_UDELAY_MS * 1000) ? __bad_udelay() : \
38 __const_udelay((n) * 0x68dbul)) : \
39 __udelay(n))
40
41#endif /* defined(_ARM_DELAY_H) */
42
diff --git a/include/asm-arm/div64.h b/include/asm-arm/div64.h
new file mode 100644
index 000000000000..3682616804ca
--- /dev/null
+++ b/include/asm-arm/div64.h
@@ -0,0 +1,48 @@
1#ifndef __ASM_ARM_DIV64
2#define __ASM_ARM_DIV64
3
4#include <asm/system.h>
5
6/*
7 * The semantics of do_div() are:
8 *
9 * uint32_t do_div(uint64_t *n, uint32_t base)
10 * {
11 * uint32_t remainder = *n % base;
12 * *n = *n / base;
13 * return remainder;
14 * }
15 *
16 * In other words, a 64-bit dividend with a 32-bit divisor producing
17 * a 64-bit result and a 32-bit remainder. To accomplish this optimally
18 * we call a special __do_div64 helper with completely non standard
19 * calling convention for arguments and results (beware).
20 */
21
22#ifdef __ARMEB__
23#define __xh "r0"
24#define __xl "r1"
25#else
26#define __xl "r0"
27#define __xh "r1"
28#endif
29
30#define do_div(n,base) \
31({ \
32 register unsigned int __base asm("r4") = base; \
33 register unsigned long long __n asm("r0") = n; \
34 register unsigned long long __res asm("r2"); \
35 register unsigned int __rem asm(__xh); \
36 asm( __asmeq("%0", __xh) \
37 __asmeq("%1", "r2") \
38 __asmeq("%2", "r0") \
39 __asmeq("%3", "r4") \
40 "bl __do_div64" \
41 : "=r" (__rem), "=r" (__res) \
42 : "r" (__n), "r" (__base) \
43 : "ip", "lr", "cc"); \
44 n = __res; \
45 __rem; \
46})
47
48#endif
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h
new file mode 100644
index 000000000000..925d016dd4b5
--- /dev/null
+++ b/include/asm-arm/dma-mapping.h
@@ -0,0 +1,426 @@
1#ifndef ASMARM_DMA_MAPPING_H
2#define ASMARM_DMA_MAPPING_H
3
4#ifdef __KERNEL__
5
6#include <linux/config.h>
7#include <linux/mm.h> /* need struct page */
8
9#include <asm/scatterlist.h>
10
11/*
12 * DMA-consistent mapping functions. These allocate/free a region of
13 * uncached, unwrite-buffered mapped memory space for use with DMA
14 * devices. This is the "generic" version. The PCI specific version
15 * is in pci.h
16 */
17extern void consistent_sync(void *kaddr, size_t size, int rw);
18
19/*
20 * Return whether the given device DMA address mask can be supported
21 * properly. For example, if your device can only drive the low 24-bits
22 * during bus mastering, then you would pass 0x00ffffff as the mask
23 * to this function.
24 */
25static inline int dma_supported(struct device *dev, u64 mask)
26{
27 return dev->dma_mask && *dev->dma_mask != 0;
28}
29
30static inline int dma_set_mask(struct device *dev, u64 dma_mask)
31{
32 if (!dev->dma_mask || !dma_supported(dev, dma_mask))
33 return -EIO;
34
35 *dev->dma_mask = dma_mask;
36
37 return 0;
38}
39
40static inline int dma_get_cache_alignment(void)
41{
42 return 32;
43}
44
45static inline int dma_is_consistent(dma_addr_t handle)
46{
47 return 0;
48}
49
50/*
51 * DMA errors are defined by all-bits-set in the DMA address.
52 */
53static inline int dma_mapping_error(dma_addr_t dma_addr)
54{
55 return dma_addr == ~0;
56}
57
58/**
59 * dma_alloc_coherent - allocate consistent memory for DMA
60 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
61 * @size: required memory size
62 * @handle: bus-specific DMA address
63 *
64 * Allocate some uncached, unbuffered memory for a device for
65 * performing DMA. This function allocates pages, and will
66 * return the CPU-viewed address, and sets @handle to be the
67 * device-viewed address.
68 */
69extern void *
70dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, int gfp);
71
72/**
73 * dma_free_coherent - free memory allocated by dma_alloc_coherent
74 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
75 * @size: size of memory originally requested in dma_alloc_coherent
76 * @cpu_addr: CPU-view address returned from dma_alloc_coherent
77 * @handle: device-view address returned from dma_alloc_coherent
78 *
79 * Free (and unmap) a DMA buffer previously allocated by
80 * dma_alloc_coherent().
81 *
82 * References to memory and mappings associated with cpu_addr/handle
83 * during and after this call executing are illegal.
84 */
85extern void
86dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
87 dma_addr_t handle);
88
89/**
90 * dma_mmap_coherent - map a coherent DMA allocation into user space
91 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
92 * @vma: vm_area_struct describing requested user mapping
93 * @cpu_addr: kernel CPU-view address returned from dma_alloc_coherent
94 * @handle: device-view address returned from dma_alloc_coherent
95 * @size: size of memory originally requested in dma_alloc_coherent
96 *
97 * Map a coherent DMA buffer previously allocated by dma_alloc_coherent
98 * into user space. The coherent DMA buffer must not be freed by the
99 * driver until the user space mapping has been released.
100 */
101int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma,
102 void *cpu_addr, dma_addr_t handle, size_t size);
103
104
105/**
106 * dma_alloc_writecombine - allocate writecombining memory for DMA
107 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
108 * @size: required memory size
109 * @handle: bus-specific DMA address
110 *
111 * Allocate some uncached, buffered memory for a device for
112 * performing DMA. This function allocates pages, and will
113 * return the CPU-viewed address, and sets @handle to be the
114 * device-viewed address.
115 */
116extern void *
117dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, int gfp);
118
119#define dma_free_writecombine(dev,size,cpu_addr,handle) \
120 dma_free_coherent(dev,size,cpu_addr,handle)
121
122int dma_mmap_writecombine(struct device *dev, struct vm_area_struct *vma,
123 void *cpu_addr, dma_addr_t handle, size_t size);
124
125
126/**
127 * dma_map_single - map a single buffer for streaming DMA
128 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
129 * @cpu_addr: CPU direct mapped address of buffer
130 * @size: size of buffer to map
131 * @dir: DMA transfer direction
132 *
133 * Ensure that any data held in the cache is appropriately discarded
134 * or written back.
135 *
136 * The device owns this memory once this call has completed. The CPU
137 * can regain ownership by calling dma_unmap_single() or
138 * dma_sync_single_for_cpu().
139 */
140#ifndef CONFIG_DMABOUNCE
141static inline dma_addr_t
142dma_map_single(struct device *dev, void *cpu_addr, size_t size,
143 enum dma_data_direction dir)
144{
145 consistent_sync(cpu_addr, size, dir);
146 return virt_to_dma(dev, (unsigned long)cpu_addr);
147}
148#else
149extern dma_addr_t dma_map_single(struct device *,void *, size_t, enum dma_data_direction);
150#endif
151
152/**
153 * dma_map_page - map a portion of a page for streaming DMA
154 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
155 * @page: page that buffer resides in
156 * @offset: offset into page for start of buffer
157 * @size: size of buffer to map
158 * @dir: DMA transfer direction
159 *
160 * Ensure that any data held in the cache is appropriately discarded
161 * or written back.
162 *
163 * The device owns this memory once this call has completed. The CPU
164 * can regain ownership by calling dma_unmap_page() or
165 * dma_sync_single_for_cpu().
166 */
167static inline dma_addr_t
168dma_map_page(struct device *dev, struct page *page,
169 unsigned long offset, size_t size,
170 enum dma_data_direction dir)
171{
172 return dma_map_single(dev, page_address(page) + offset, size, (int)dir);
173}
174
175/**
176 * dma_unmap_single - unmap a single buffer previously mapped
177 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
178 * @handle: DMA address of buffer
179 * @size: size of buffer to map
180 * @dir: DMA transfer direction
181 *
182 * Unmap a single streaming mode DMA translation. The handle and size
183 * must match what was provided in the previous dma_map_single() call.
184 * All other usages are undefined.
185 *
186 * After this call, reads by the CPU to the buffer are guaranteed to see
187 * whatever the device wrote there.
188 */
189#ifndef CONFIG_DMABOUNCE
190static inline void
191dma_unmap_single(struct device *dev, dma_addr_t handle, size_t size,
192 enum dma_data_direction dir)
193{
194 /* nothing to do */
195}
196#else
197extern void dma_unmap_single(struct device *, dma_addr_t, size_t, enum dma_data_direction);
198#endif
199
200/**
201 * dma_unmap_page - unmap a buffer previously mapped through dma_map_page()
202 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
203 * @handle: DMA address of buffer
204 * @size: size of buffer to map
205 * @dir: DMA transfer direction
206 *
207 * Unmap a single streaming mode DMA translation. The handle and size
208 * must match what was provided in the previous dma_map_single() call.
209 * All other usages are undefined.
210 *
211 * After this call, reads by the CPU to the buffer are guaranteed to see
212 * whatever the device wrote there.
213 */
214static inline void
215dma_unmap_page(struct device *dev, dma_addr_t handle, size_t size,
216 enum dma_data_direction dir)
217{
218 dma_unmap_single(dev, handle, size, (int)dir);
219}
220
221/**
222 * dma_map_sg - map a set of SG buffers for streaming mode DMA
223 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
224 * @sg: list of buffers
225 * @nents: number of buffers to map
226 * @dir: DMA transfer direction
227 *
228 * Map a set of buffers described by scatterlist in streaming
229 * mode for DMA. This is the scatter-gather version of the
230 * above dma_map_single interface. Here the scatter gather list
231 * elements are each tagged with the appropriate dma address
232 * and length. They are obtained via sg_dma_{address,length}(SG).
233 *
234 * NOTE: An implementation may be able to use a smaller number of
235 * DMA address/length pairs than there are SG table elements.
236 * (for example via virtual mapping capabilities)
237 * The routine returns the number of addr/length pairs actually
238 * used, at most nents.
239 *
240 * Device ownership issues as mentioned above for dma_map_single are
241 * the same here.
242 */
243#ifndef CONFIG_DMABOUNCE
244static inline int
245dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
246 enum dma_data_direction dir)
247{
248 int i;
249
250 for (i = 0; i < nents; i++, sg++) {
251 char *virt;
252
253 sg->dma_address = page_to_dma(dev, sg->page) + sg->offset;
254 virt = page_address(sg->page) + sg->offset;
255 consistent_sync(virt, sg->length, dir);
256 }
257
258 return nents;
259}
260#else
261extern int dma_map_sg(struct device *, struct scatterlist *, int, enum dma_data_direction);
262#endif
263
264/**
265 * dma_unmap_sg - unmap a set of SG buffers mapped by dma_map_sg
266 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
267 * @sg: list of buffers
268 * @nents: number of buffers to map
269 * @dir: DMA transfer direction
270 *
271 * Unmap a set of streaming mode DMA translations.
272 * Again, CPU read rules concerning calls here are the same as for
273 * dma_unmap_single() above.
274 */
275#ifndef CONFIG_DMABOUNCE
276static inline void
277dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
278 enum dma_data_direction dir)
279{
280
281 /* nothing to do */
282}
283#else
284extern void dma_unmap_sg(struct device *, struct scatterlist *, int, enum dma_data_direction);
285#endif
286
287
288/**
289 * dma_sync_single_for_cpu
290 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
291 * @handle: DMA address of buffer
292 * @size: size of buffer to map
293 * @dir: DMA transfer direction
294 *
295 * Make physical memory consistent for a single streaming mode DMA
296 * translation after a transfer.
297 *
298 * If you perform a dma_map_single() but wish to interrogate the
299 * buffer using the cpu, yet do not wish to teardown the PCI dma
300 * mapping, you must call this function before doing so. At the
301 * next point you give the PCI dma address back to the card, you
302 * must first the perform a dma_sync_for_device, and then the
303 * device again owns the buffer.
304 */
305#ifndef CONFIG_DMABOUNCE
306static inline void
307dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size,
308 enum dma_data_direction dir)
309{
310 consistent_sync((void *)dma_to_virt(dev, handle), size, dir);
311}
312
313static inline void
314dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size,
315 enum dma_data_direction dir)
316{
317 consistent_sync((void *)dma_to_virt(dev, handle), size, dir);
318}
319#else
320extern void dma_sync_single_for_cpu(struct device*, dma_addr_t, size_t, enum dma_data_direction);
321extern void dma_sync_single_for_device(struct device*, dma_addr_t, size_t, enum dma_data_direction);
322#endif
323
324
325/**
326 * dma_sync_sg_for_cpu
327 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
328 * @sg: list of buffers
329 * @nents: number of buffers to map
330 * @dir: DMA transfer direction
331 *
332 * Make physical memory consistent for a set of streaming
333 * mode DMA translations after a transfer.
334 *
335 * The same as dma_sync_single_for_* but for a scatter-gather list,
336 * same rules and usage.
337 */
338#ifndef CONFIG_DMABOUNCE
339static inline void
340dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents,
341 enum dma_data_direction dir)
342{
343 int i;
344
345 for (i = 0; i < nents; i++, sg++) {
346 char *virt = page_address(sg->page) + sg->offset;
347 consistent_sync(virt, sg->length, dir);
348 }
349}
350
351static inline void
352dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
353 enum dma_data_direction dir)
354{
355 int i;
356
357 for (i = 0; i < nents; i++, sg++) {
358 char *virt = page_address(sg->page) + sg->offset;
359 consistent_sync(virt, sg->length, dir);
360 }
361}
362#else
363extern void dma_sync_sg_for_cpu(struct device*, struct scatterlist*, int, enum dma_data_direction);
364extern void dma_sync_sg_for_device(struct device*, struct scatterlist*, int, enum dma_data_direction);
365#endif
366
367#ifdef CONFIG_DMABOUNCE
368/*
369 * For SA-1111, IXP425, and ADI systems the dma-mapping functions are "magic"
370 * and utilize bounce buffers as needed to work around limited DMA windows.
371 *
372 * On the SA-1111, a bug limits DMA to only certain regions of RAM.
373 * On the IXP425, the PCI inbound window is 64MB (256MB total RAM)
374 * On some ADI engineering sytems, PCI inbound window is 32MB (12MB total RAM)
375 *
376 * The following are helper functions used by the dmabounce subystem
377 *
378 */
379
380/**
381 * dmabounce_register_dev
382 *
383 * @dev: valid struct device pointer
384 * @small_buf_size: size of buffers to use with small buffer pool
385 * @large_buf_size: size of buffers to use with large buffer pool (can be 0)
386 *
387 * This function should be called by low-level platform code to register
388 * a device as requireing DMA buffer bouncing. The function will allocate
389 * appropriate DMA pools for the device.
390 *
391 */
392extern int dmabounce_register_dev(struct device *, unsigned long, unsigned long);
393
394/**
395 * dmabounce_unregister_dev
396 *
397 * @dev: valid struct device pointer
398 *
399 * This function should be called by low-level platform code when device
400 * that was previously registered with dmabounce_register_dev is removed
401 * from the system.
402 *
403 */
404extern void dmabounce_unregister_dev(struct device *);
405
406/**
407 * dma_needs_bounce
408 *
409 * @dev: valid struct device pointer
410 * @dma_handle: dma_handle of unbounced buffer
411 * @size: size of region being mapped
412 *
413 * Platforms that utilize the dmabounce mechanism must implement
414 * this function.
415 *
416 * The dmabounce routines call this function whenever a dma-mapping
417 * is requested to determine whether a given buffer needs to be bounced
418 * or not. The function must return 0 if the the buffer is OK for
419 * DMA access and 1 if the buffer needs to be bounced.
420 *
421 */
422extern int dma_needs_bounce(struct device*, dma_addr_t, size_t);
423#endif /* CONFIG_DMABOUNCE */
424
425#endif /* __KERNEL__ */
426#endif
diff --git a/include/asm-arm/dma.h b/include/asm-arm/dma.h
new file mode 100644
index 000000000000..ef41df43a584
--- /dev/null
+++ b/include/asm-arm/dma.h
@@ -0,0 +1,135 @@
1#ifndef __ASM_ARM_DMA_H
2#define __ASM_ARM_DMA_H
3
4typedef unsigned int dmach_t;
5
6#include <linux/config.h>
7#include <linux/spinlock.h>
8#include <asm/system.h>
9#include <asm/scatterlist.h>
10#include <asm/arch/dma.h>
11
12/*
13 * DMA modes
14 */
15typedef unsigned int dmamode_t;
16
17#define DMA_MODE_MASK 3
18
19#define DMA_MODE_READ 0
20#define DMA_MODE_WRITE 1
21#define DMA_MODE_CASCADE 2
22#define DMA_AUTOINIT 4
23
24extern spinlock_t dma_spin_lock;
25
26static inline unsigned long claim_dma_lock(void)
27{
28 unsigned long flags;
29 spin_lock_irqsave(&dma_spin_lock, flags);
30 return flags;
31}
32
33static inline void release_dma_lock(unsigned long flags)
34{
35 spin_unlock_irqrestore(&dma_spin_lock, flags);
36}
37
38/* Clear the 'DMA Pointer Flip Flop'.
39 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
40 */
41#define clear_dma_ff(channel)
42
43/* Set only the page register bits of the transfer address.
44 *
45 * NOTE: This is an architecture specific function, and should
46 * be hidden from the drivers
47 */
48extern void set_dma_page(dmach_t channel, char pagenr);
49
50/* Request a DMA channel
51 *
52 * Some architectures may need to do allocate an interrupt
53 */
54extern int request_dma(dmach_t channel, const char * device_id);
55
56/* Free a DMA channel
57 *
58 * Some architectures may need to do free an interrupt
59 */
60extern void free_dma(dmach_t channel);
61
62/* Enable DMA for this channel
63 *
64 * On some architectures, this may have other side effects like
65 * enabling an interrupt and setting the DMA registers.
66 */
67extern void enable_dma(dmach_t channel);
68
69/* Disable DMA for this channel
70 *
71 * On some architectures, this may have other side effects like
72 * disabling an interrupt or whatever.
73 */
74extern void disable_dma(dmach_t channel);
75
76/* Test whether the specified channel has an active DMA transfer
77 */
78extern int dma_channel_active(dmach_t channel);
79
80/* Set the DMA scatter gather list for this channel
81 *
82 * This should not be called if a DMA channel is enabled,
83 * especially since some DMA architectures don't update the
84 * DMA address immediately, but defer it to the enable_dma().
85 */
86extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg);
87
88/* Set the DMA address for this channel
89 *
90 * This should not be called if a DMA channel is enabled,
91 * especially since some DMA architectures don't update the
92 * DMA address immediately, but defer it to the enable_dma().
93 */
94extern void set_dma_addr(dmach_t channel, unsigned long physaddr);
95
96/* Set the DMA byte count for this channel
97 *
98 * This should not be called if a DMA channel is enabled,
99 * especially since some DMA architectures don't update the
100 * DMA count immediately, but defer it to the enable_dma().
101 */
102extern void set_dma_count(dmach_t channel, unsigned long count);
103
104/* Set the transfer direction for this channel
105 *
106 * This should not be called if a DMA channel is enabled,
107 * especially since some DMA architectures don't update the
108 * DMA transfer direction immediately, but defer it to the
109 * enable_dma().
110 */
111extern void set_dma_mode(dmach_t channel, dmamode_t mode);
112
113/* Set the transfer speed for this channel
114 */
115extern void set_dma_speed(dmach_t channel, int cycle_ns);
116
117/* Get DMA residue count. After a DMA transfer, this
118 * should return zero. Reading this while a DMA transfer is
119 * still in progress will return unpredictable results.
120 * If called before the channel has been used, it may return 1.
121 * Otherwise, it returns the number of _bytes_ left to transfer.
122 */
123extern int get_dma_residue(dmach_t channel);
124
125#ifndef NO_DMA
126#define NO_DMA 255
127#endif
128
129#ifdef CONFIG_PCI
130extern int isa_dma_bridge_buggy;
131#else
132#define isa_dma_bridge_buggy (0)
133#endif
134
135#endif /* _ARM_DMA_H */
diff --git a/include/asm-arm/domain.h b/include/asm-arm/domain.h
new file mode 100644
index 000000000000..da1d960387d9
--- /dev/null
+++ b/include/asm-arm/domain.h
@@ -0,0 +1,52 @@
1/*
2 * linux/include/asm-arm/domain.h
3 *
4 * Copyright (C) 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#ifndef __ASM_PROC_DOMAIN_H
11#define __ASM_PROC_DOMAIN_H
12
13/*
14 * Domain numbers
15 *
16 * DOMAIN_IO - domain 2 includes all IO only
17 * DOMAIN_USER - domain 1 includes all user memory only
18 * DOMAIN_KERNEL - domain 0 includes all kernel memory only
19 */
20#define DOMAIN_KERNEL 0
21#define DOMAIN_TABLE 0
22#define DOMAIN_USER 1
23#define DOMAIN_IO 2
24
25/*
26 * Domain types
27 */
28#define DOMAIN_NOACCESS 0
29#define DOMAIN_CLIENT 1
30#define DOMAIN_MANAGER 3
31
32#define domain_val(dom,type) ((type) << (2*(dom)))
33
34#ifndef __ASSEMBLY__
35#define set_domain(x) \
36 do { \
37 __asm__ __volatile__( \
38 "mcr p15, 0, %0, c3, c0 @ set domain" \
39 : : "r" (x)); \
40 } while (0)
41
42#define modify_domain(dom,type) \
43 do { \
44 struct thread_info *thread = current_thread_info(); \
45 unsigned int domain = thread->cpu_domain; \
46 domain &= ~domain_val(dom, DOMAIN_MANAGER); \
47 thread->cpu_domain = domain | domain_val(dom, type); \
48 set_domain(thread->cpu_domain); \
49 } while (0)
50
51#endif
52#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-arm/ecard.h b/include/asm-arm/ecard.h
new file mode 100644
index 000000000000..a0ae2b954d29
--- /dev/null
+++ b/include/asm-arm/ecard.h
@@ -0,0 +1,298 @@
1/*
2 * linux/include/asm-arm/ecard.h
3 *
4 * definitions for expansion cards
5 *
6 * This is a new system as from Linux 1.2.3
7 *
8 * Changelog:
9 * 11-12-1996 RMK Further minor improvements
10 * 12-09-1997 RMK Added interrupt enable/disable for card level
11 *
12 * Reference: Acorns Risc OS 3 Programmers Reference Manuals.
13 */
14
15#ifndef __ASM_ECARD_H
16#define __ASM_ECARD_H
17
18/*
19 * Currently understood cards (but not necessarily
20 * supported):
21 * Manufacturer Product ID
22 */
23#define MANU_ACORN 0x0000
24#define PROD_ACORN_SCSI 0x0002
25#define PROD_ACORN_ETHER1 0x0003
26#define PROD_ACORN_MFM 0x000b
27
28#define MANU_ANT2 0x0011
29#define PROD_ANT_ETHER3 0x00a4
30
31#define MANU_ATOMWIDE 0x0017
32#define PROD_ATOMWIDE_3PSERIAL 0x0090
33
34#define MANU_IRLAM_INSTRUMENTS 0x001f
35#define MANU_IRLAM_INSTRUMENTS_ETHERN 0x5678
36
37#define MANU_OAK 0x0021
38#define PROD_OAK_SCSI 0x0058
39
40#define MANU_MORLEY 0x002b
41#define PROD_MORLEY_SCSI_UNCACHED 0x0067
42
43#define MANU_CUMANA 0x003a
44#define PROD_CUMANA_SCSI_2 0x003a
45#define PROD_CUMANA_SCSI_1 0x00a0
46
47#define MANU_ICS 0x003c
48#define PROD_ICS_IDE 0x00ae
49
50#define MANU_ICS2 0x003d
51#define PROD_ICS2_IDE 0x00ae
52
53#define MANU_SERPORT 0x003f
54#define PROD_SERPORT_DSPORT 0x00b9
55
56#define MANU_ARXE 0x0041
57#define PROD_ARXE_SCSI 0x00be
58
59#define MANU_I3 0x0046
60#define PROD_I3_ETHERLAN500 0x00d4
61#define PROD_I3_ETHERLAN600 0x00ec
62#define PROD_I3_ETHERLAN600A 0x011e
63
64#define MANU_ANT 0x0053
65#define PROD_ANT_ETHERM 0x00d8
66#define PROD_ANT_ETHERB 0x00e4
67
68#define MANU_ALSYSTEMS 0x005b
69#define PROD_ALSYS_SCSIATAPI 0x0107
70
71#define MANU_MCS 0x0063
72#define PROD_MCS_CONNECT32 0x0125
73
74#define MANU_EESOX 0x0064
75#define PROD_EESOX_SCSI2 0x008c
76
77#define MANU_YELLOWSTONE 0x0096
78#define PROD_YELLOWSTONE_RAPIDE32 0x0120
79
80#ifdef ECARD_C
81#define CONST
82#else
83#define CONST const
84#endif
85
86#define MAX_ECARDS 9
87
88typedef enum { /* Cards address space */
89 ECARD_IOC,
90 ECARD_MEMC,
91 ECARD_EASI
92} card_type_t;
93
94typedef enum { /* Speed for ECARD_IOC space */
95 ECARD_SLOW = 0,
96 ECARD_MEDIUM = 1,
97 ECARD_FAST = 2,
98 ECARD_SYNC = 3
99} card_speed_t;
100
101struct ecard_id { /* Card ID structure */
102 unsigned short manufacturer;
103 unsigned short product;
104 void *data;
105};
106
107struct in_ecid { /* Packed card ID information */
108 unsigned short product; /* Product code */
109 unsigned short manufacturer; /* Manufacturer code */
110 unsigned char id:4; /* Simple ID */
111 unsigned char cd:1; /* Chunk dir present */
112 unsigned char is:1; /* Interrupt status pointers */
113 unsigned char w:2; /* Width */
114 unsigned char country; /* Country */
115 unsigned char irqmask; /* IRQ mask */
116 unsigned char fiqmask; /* FIQ mask */
117 unsigned long irqoff; /* IRQ offset */
118 unsigned long fiqoff; /* FIQ offset */
119};
120
121typedef struct expansion_card ecard_t;
122typedef unsigned long *loader_t;
123
124typedef struct { /* Card handler routines */
125 void (*irqenable)(ecard_t *ec, int irqnr);
126 void (*irqdisable)(ecard_t *ec, int irqnr);
127 int (*irqpending)(ecard_t *ec);
128 void (*fiqenable)(ecard_t *ec, int fiqnr);
129 void (*fiqdisable)(ecard_t *ec, int fiqnr);
130 int (*fiqpending)(ecard_t *ec);
131} expansioncard_ops_t;
132
133#define ECARD_NUM_RESOURCES (6)
134
135#define ECARD_RES_IOCSLOW (0)
136#define ECARD_RES_IOCMEDIUM (1)
137#define ECARD_RES_IOCFAST (2)
138#define ECARD_RES_IOCSYNC (3)
139#define ECARD_RES_MEMC (4)
140#define ECARD_RES_EASI (5)
141
142#define ecard_resource_start(ec,nr) ((ec)->resource[nr].start)
143#define ecard_resource_end(ec,nr) ((ec)->resource[nr].end)
144#define ecard_resource_len(ec,nr) ((ec)->resource[nr].end - \
145 (ec)->resource[nr].start + 1)
146#define ecard_resource_flags(ec,nr) ((ec)->resource[nr].flags)
147
148/*
149 * This contains all the info needed on an expansion card
150 */
151struct expansion_card {
152 struct expansion_card *next;
153
154 struct device dev;
155 struct resource resource[ECARD_NUM_RESOURCES];
156
157 /* Public data */
158 void __iomem *irqaddr; /* address of IRQ register */
159 void __iomem *fiqaddr; /* address of FIQ register */
160 unsigned char irqmask; /* IRQ mask */
161 unsigned char fiqmask; /* FIQ mask */
162 unsigned char claimed; /* Card claimed? */
163
164 void *irq_data; /* Data for use for IRQ by card */
165 void *fiq_data; /* Data for use for FIQ by card */
166 const expansioncard_ops_t *ops; /* Enable/Disable Ops for card */
167
168 CONST unsigned int slot_no; /* Slot number */
169 CONST unsigned int dma; /* DMA number (for request_dma) */
170 CONST unsigned int irq; /* IRQ number (for request_irq) */
171 CONST unsigned int fiq; /* FIQ number (for request_irq) */
172 CONST card_type_t type; /* Type of card */
173 CONST struct in_ecid cid; /* Card Identification */
174
175 /* Private internal data */
176 const char *card_desc; /* Card description */
177 CONST unsigned int podaddr; /* Base Linux address for card */
178 CONST loader_t loader; /* loader program */
179 u64 dma_mask;
180};
181
182struct in_chunk_dir {
183 unsigned int start_offset;
184 union {
185 unsigned char string[256];
186 unsigned char data[1];
187 } d;
188};
189
190/*
191 * ecard_claim: claim an expansion card entry
192 */
193#define ecard_claim(ec) ((ec)->claimed = 1)
194
195/*
196 * ecard_release: release an expansion card entry
197 */
198#define ecard_release(ec) ((ec)->claimed = 0)
199
200/*
201 * Read a chunk from an expansion card
202 * cd : where to put read data
203 * ec : expansion card info struct
204 * id : id number to find
205 * num: (n+1)'th id to find.
206 */
207extern int ecard_readchunk (struct in_chunk_dir *cd, struct expansion_card *ec, int id, int num);
208
209/*
210 * Obtain the address of a card. This returns the "old style" address
211 * and should no longer be used.
212 */
213static inline unsigned int __deprecated
214ecard_address(struct expansion_card *ec, card_type_t type, card_speed_t speed)
215{
216 extern unsigned int __ecard_address(struct expansion_card *,
217 card_type_t, card_speed_t);
218 return __ecard_address(ec, type, speed);
219}
220
221/*
222 * Request and release ecard resources
223 */
224extern int ecard_request_resources(struct expansion_card *ec);
225extern void ecard_release_resources(struct expansion_card *ec);
226
227#ifdef ECARD_C
228/* Definitions internal to ecard.c - for it's use only!!
229 *
230 * External expansion card header as read from the card
231 */
232struct ex_ecid {
233 unsigned char r_irq:1;
234 unsigned char r_zero:1;
235 unsigned char r_fiq:1;
236 unsigned char r_id:4;
237 unsigned char r_a:1;
238
239 unsigned char r_cd:1;
240 unsigned char r_is:1;
241 unsigned char r_w:2;
242 unsigned char r_r1:4;
243
244 unsigned char r_r2:8;
245
246 unsigned char r_prod[2];
247
248 unsigned char r_manu[2];
249
250 unsigned char r_country;
251
252 unsigned char r_fiqmask;
253 unsigned char r_fiqoff[3];
254
255 unsigned char r_irqmask;
256 unsigned char r_irqoff[3];
257};
258
259/*
260 * Chunk directory entry as read from the card
261 */
262struct ex_chunk_dir {
263 unsigned char r_id;
264 unsigned char r_len[3];
265 unsigned long r_start;
266 union {
267 char string[256];
268 char data[1];
269 } d;
270#define c_id(x) ((x)->r_id)
271#define c_len(x) ((x)->r_len[0]|((x)->r_len[1]<<8)|((x)->r_len[2]<<16))
272#define c_start(x) ((x)->r_start)
273};
274
275#endif
276
277extern struct bus_type ecard_bus_type;
278
279#define ECARD_DEV(_d) container_of((_d), struct expansion_card, dev)
280
281struct ecard_driver {
282 int (*probe)(struct expansion_card *, const struct ecard_id *id);
283 void (*remove)(struct expansion_card *);
284 void (*shutdown)(struct expansion_card *);
285 const struct ecard_id *id_table;
286 unsigned int id;
287 struct device_driver drv;
288};
289
290#define ECARD_DRV(_d) container_of((_d), struct ecard_driver, drv)
291
292#define ecard_set_drvdata(ec,data) dev_set_drvdata(&(ec)->dev, (data))
293#define ecard_get_drvdata(ec) dev_get_drvdata(&(ec)->dev)
294
295int ecard_register_driver(struct ecard_driver *);
296void ecard_remove_driver(struct ecard_driver *);
297
298#endif
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h
new file mode 100644
index 000000000000..cbceacbe5afa
--- /dev/null
+++ b/include/asm-arm/elf.h
@@ -0,0 +1,133 @@
1#ifndef __ASMARM_ELF_H
2#define __ASMARM_ELF_H
3
4#include <linux/config.h>
5
6/*
7 * ELF register definitions..
8 */
9
10#include <asm/ptrace.h>
11#include <asm/user.h>
12#include <asm/procinfo.h>
13
14typedef unsigned long elf_greg_t;
15typedef unsigned long elf_freg_t[3];
16
17#define EM_ARM 40
18#define EF_ARM_APCS26 0x08
19#define EF_ARM_SOFT_FLOAT 0x200
20#define EF_ARM_EABI_MASK 0xFF000000
21
22#define R_ARM_NONE 0
23#define R_ARM_PC24 1
24#define R_ARM_ABS32 2
25
26#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
27typedef elf_greg_t elf_gregset_t[ELF_NGREG];
28
29typedef struct user_fp elf_fpregset_t;
30
31/*
32 * This is used to ensure we don't load something for the wrong architecture.
33 */
34#define elf_check_arch(x) ( ((x)->e_machine == EM_ARM) && (ELF_PROC_OK((x))) )
35
36/*
37 * These are used to set parameters in the core dumps.
38 */
39#define ELF_CLASS ELFCLASS32
40#ifdef __ARMEB__
41#define ELF_DATA ELFDATA2MSB;
42#else
43#define ELF_DATA ELFDATA2LSB;
44#endif
45#define ELF_ARCH EM_ARM
46
47#define USE_ELF_CORE_DUMP
48#define ELF_EXEC_PAGESIZE 4096
49
50/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
51 use of this is to invoke "./ld.so someprog" to test out a new version of
52 the loader. We need to make sure that it is out of the way of the program
53 that it will "exec", and that there is sufficient room for the brk. */
54
55#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
56
57/* When the program starts, a1 contains a pointer to a function to be
58 registered with atexit, as per the SVR4 ABI. A value of 0 means we
59 have no such handler. */
60#define ELF_PLAT_INIT(_r, load_addr) (_r)->ARM_r0 = 0
61
62/* This yields a mask that user programs can use to figure out what
63 instruction set this cpu supports. */
64
65#define ELF_HWCAP (elf_hwcap)
66
67/* This yields a string that ld.so will use to load implementation
68 specific libraries for optimization. This is more specific in
69 intent than poking at uname or /proc/cpuinfo. */
70
71/* For now we just provide a fairly general string that describes the
72 processor family. This could be made more specific later if someone
73 implemented optimisations that require it. 26-bit CPUs give you
74 "v1l" for ARM2 (no SWP) and "v2l" for anything else (ARM1 isn't
75 supported). 32-bit CPUs give you "v3[lb]" for anything based on an
76 ARM6 or ARM7 core and "armv4[lb]" for anything based on a StrongARM-1
77 core. */
78
79#define ELF_PLATFORM_SIZE 8
80extern char elf_platform[];
81#define ELF_PLATFORM (elf_platform)
82
83#ifdef __KERNEL__
84
85/*
86 * 32-bit code is always OK. Some cpus can do 26-bit, some can't.
87 */
88#define ELF_PROC_OK(x) (ELF_THUMB_OK(x) && ELF_26BIT_OK(x))
89
90#define ELF_THUMB_OK(x) \
91 (( (elf_hwcap & HWCAP_THUMB) && ((x)->e_entry & 1) == 1) || \
92 ((x)->e_entry & 3) == 0)
93
94#define ELF_26BIT_OK(x) \
95 (( (elf_hwcap & HWCAP_26BIT) && (x)->e_flags & EF_ARM_APCS26) || \
96 ((x)->e_flags & EF_ARM_APCS26) == 0)
97
98#ifndef CONFIG_IWMMXT
99
100/* Old NetWinder binaries were compiled in such a way that the iBCS
101 heuristic always trips on them. Until these binaries become uncommon
102 enough not to care, don't trust the `ibcs' flag here. In any case
103 there is no other ELF system currently supported by iBCS.
104 @@ Could print a warning message to encourage users to upgrade. */
105#define SET_PERSONALITY(ex,ibcs2) \
106 set_personality(((ex).e_flags&EF_ARM_APCS26 ?PER_LINUX :PER_LINUX_32BIT))
107
108#else
109
110/*
111 * All iWMMXt capable CPUs don't support 26-bit mode. Yet they can run
112 * legacy binaries which used to contain FPA11 floating point instructions
113 * that have always been emulated by the kernel. PFA11 and iWMMXt overlap
114 * on coprocessor 1 space though. We therefore must decide if given task
115 * is allowed to use CP 0 and 1 for iWMMXt, or if they should be blocked
116 * at all times for the prefetch exception handler to catch FPA11 opcodes
117 * and emulate them. The best indication to discriminate those two cases
118 * is the SOFT_FLOAT flag in the ELF header.
119 */
120
121#define SET_PERSONALITY(ex,ibcs2) \
122do { \
123 set_personality(PER_LINUX_32BIT); \
124 if (((ex).e_flags & EF_ARM_EABI_MASK) || \
125 ((ex).e_flags & EF_ARM_SOFT_FLOAT)) \
126 set_thread_flag(TIF_USING_IWMMXT); \
127} while (0)
128
129#endif
130
131#endif
132
133#endif
diff --git a/include/asm-arm/errno.h b/include/asm-arm/errno.h
new file mode 100644
index 000000000000..6e60f0612bb6
--- /dev/null
+++ b/include/asm-arm/errno.h
@@ -0,0 +1,6 @@
1#ifndef _ARM_ERRNO_H
2#define _ARM_ERRNO_H
3
4#include <asm-generic/errno.h>
5
6#endif
diff --git a/include/asm-arm/fcntl.h b/include/asm-arm/fcntl.h
new file mode 100644
index 000000000000..485b6bdf4d7a
--- /dev/null
+++ b/include/asm-arm/fcntl.h
@@ -0,0 +1,87 @@
1#ifndef _ARM_FCNTL_H
2#define _ARM_FCNTL_H
3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECTORY 040000 /* must be a directory */
20#define O_NOFOLLOW 0100000 /* don't follow links */
21#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
22#define O_LARGEFILE 0400000
23#define O_NOATIME 01000000
24
25#define F_DUPFD 0 /* dup */
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39#define F_GETLK64 12 /* using 'struct flock64' */
40#define F_SETLK64 13
41#define F_SETLKW64 14
42
43/* for F_[GET|SET]FL */
44#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
45
46/* for posix fcntl() and lockf() */
47#define F_RDLCK 0
48#define F_WRLCK 1
49#define F_UNLCK 2
50
51/* for old implementation of bsd flock () */
52#define F_EXLCK 4 /* or 3 */
53#define F_SHLCK 8 /* or 4 */
54
55/* for leases */
56#define F_INPROGRESS 16
57
58/* operations for bsd flock(), also used by the kernel implementation */
59#define LOCK_SH 1 /* shared lock */
60#define LOCK_EX 2 /* exclusive lock */
61#define LOCK_NB 4 /* or'd with one of the above to prevent
62 blocking */
63#define LOCK_UN 8 /* remove lock */
64
65#define LOCK_MAND 32 /* This is a mandatory flock */
66#define LOCK_READ 64 /* ... Which allows concurrent read operations */
67#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
68#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
69
70struct flock {
71 short l_type;
72 short l_whence;
73 off_t l_start;
74 off_t l_len;
75 pid_t l_pid;
76};
77
78struct flock64 {
79 short l_type;
80 short l_whence;
81 loff_t l_start;
82 loff_t l_len;
83 pid_t l_pid;
84};
85
86#define F_LINUX_SPECIFIC_BASE 1024
87#endif
diff --git a/include/asm-arm/fiq.h b/include/asm-arm/fiq.h
new file mode 100644
index 000000000000..a3bad09e825c
--- /dev/null
+++ b/include/asm-arm/fiq.h
@@ -0,0 +1,37 @@
1/*
2 * linux/include/asm-arm/fiq.h
3 *
4 * Support for FIQ on ARM architectures.
5 * Written by Philip Blundell <philb@gnu.org>, 1998
6 * Re-written by Russell King
7 */
8
9#ifndef __ASM_FIQ_H
10#define __ASM_FIQ_H
11
12#include <asm/ptrace.h>
13
14struct fiq_handler {
15 struct fiq_handler *next;
16 /* Name
17 */
18 const char *name;
19 /* Called to ask driver to relinquish/
20 * reacquire FIQ
21 * return zero to accept, or -<errno>
22 */
23 int (*fiq_op)(void *, int relinquish);
24 /* data for the relinquish/reacquire functions
25 */
26 void *dev_id;
27};
28
29extern int claim_fiq(struct fiq_handler *f);
30extern void release_fiq(struct fiq_handler *f);
31extern void set_fiq_handler(void *start, unsigned int length);
32extern void set_fiq_regs(struct pt_regs *regs);
33extern void get_fiq_regs(struct pt_regs *regs);
34extern void enable_fiq(int fiq);
35extern void disable_fiq(int fiq);
36
37#endif
diff --git a/include/asm-arm/floppy.h b/include/asm-arm/floppy.h
new file mode 100644
index 000000000000..6ea657c886b9
--- /dev/null
+++ b/include/asm-arm/floppy.h
@@ -0,0 +1,144 @@
1/*
2 * linux/include/asm-arm/floppy.h
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 * Note that we don't touch FLOPPY_DMA nor FLOPPY_IRQ here
11 */
12#ifndef __ASM_ARM_FLOPPY_H
13#define __ASM_ARM_FLOPPY_H
14#if 0
15#include <asm/arch/floppy.h>
16#endif
17
18#define fd_outb(val,port) \
19 do { \
20 if ((port) == FD_DOR) \
21 fd_setdor((val)); \
22 else \
23 outb((val),(port)); \
24 } while(0)
25
26#define fd_inb(port) inb((port))
27#define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
28 SA_INTERRUPT|SA_SAMPLE_RANDOM,"floppy",NULL)
29#define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL)
30#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK)
31#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK)
32
33#define fd_request_dma() request_dma(DMA_FLOPPY,"floppy")
34#define fd_free_dma() free_dma(DMA_FLOPPY)
35#define fd_disable_dma() disable_dma(DMA_FLOPPY)
36#define fd_enable_dma() enable_dma(DMA_FLOPPY)
37#define fd_clear_dma_ff() clear_dma_ff(DMA_FLOPPY)
38#define fd_set_dma_mode(mode) set_dma_mode(DMA_FLOPPY, (mode))
39#define fd_set_dma_addr(addr) set_dma_addr(DMA_FLOPPY, virt_to_bus((addr)))
40#define fd_set_dma_count(len) set_dma_count(DMA_FLOPPY, (len))
41#define fd_cacheflush(addr,sz)
42
43/* need to clean up dma.h */
44#define DMA_FLOPPYDISK DMA_FLOPPY
45
46/* Floppy_selects is the list of DOR's to select drive fd
47 *
48 * On initialisation, the floppy list is scanned, and the drives allocated
49 * in the order that they are found. This is done by seeking the drive
50 * to a non-zero track, and then restoring it to track 0. If an error occurs,
51 * then there is no floppy drive present. [to be put back in again]
52 */
53static unsigned char floppy_selects[2][4] =
54{
55 { 0x10, 0x21, 0x23, 0x33 },
56 { 0x10, 0x21, 0x23, 0x33 }
57};
58
59#define fd_setdor(dor) \
60do { \
61 int new_dor = (dor); \
62 if (new_dor & 0xf0) \
63 new_dor = (new_dor & 0x0c) | floppy_selects[fdc][new_dor & 3]; \
64 else \
65 new_dor &= 0x0c; \
66 outb(new_dor, FD_DOR); \
67} while (0)
68
69/*
70 * Someday, we'll automatically detect which drives are present...
71 */
72static inline void fd_scandrives (void)
73{
74#if 0
75 int floppy, drive_count;
76
77 fd_disable_irq();
78 raw_cmd = &default_raw_cmd;
79 raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_SEEK;
80 raw_cmd->track = 0;
81 raw_cmd->rate = ?;
82 drive_count = 0;
83 for (floppy = 0; floppy < 4; floppy ++) {
84 current_drive = drive_count;
85 /*
86 * Turn on floppy motor
87 */
88 if (start_motor(redo_fd_request))
89 continue;
90 /*
91 * Set up FDC
92 */
93 fdc_specify();
94 /*
95 * Tell FDC to recalibrate
96 */
97 output_byte(FD_RECALIBRATE);
98 LAST_OUT(UNIT(floppy));
99 /* wait for command to complete */
100 if (!successful) {
101 int i;
102 for (i = drive_count; i < 3; i--)
103 floppy_selects[fdc][i] = floppy_selects[fdc][i + 1];
104 floppy_selects[fdc][3] = 0;
105 floppy -= 1;
106 } else
107 drive_count++;
108 }
109#else
110 floppy_selects[0][0] = 0x10;
111 floppy_selects[0][1] = 0x21;
112 floppy_selects[0][2] = 0x23;
113 floppy_selects[0][3] = 0x33;
114#endif
115}
116
117#define FDC1 (0x3f0)
118
119#define FLOPPY0_TYPE 4
120#define FLOPPY1_TYPE 4
121
122#define N_FDC 1
123#define N_DRIVE 4
124
125#define FLOPPY_MOTOR_MASK 0xf0
126
127#define CROSS_64KB(a,s) (0)
128
129/*
130 * This allows people to reverse the order of
131 * fd0 and fd1, in case their hardware is
132 * strangely connected (as some RiscPCs
133 * and A5000s seem to be).
134 */
135static void driveswap(int *ints, int dummy, int dummy2)
136{
137 floppy_selects[0][0] ^= floppy_selects[0][1];
138 floppy_selects[0][1] ^= floppy_selects[0][0];
139 floppy_selects[0][0] ^= floppy_selects[0][1];
140}
141
142#define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 }
143
144#endif
diff --git a/include/asm-arm/fpstate.h b/include/asm-arm/fpstate.h
new file mode 100644
index 000000000000..f7430e3aa55d
--- /dev/null
+++ b/include/asm-arm/fpstate.h
@@ -0,0 +1,74 @@
1/*
2 * linux/include/asm-arm/fpstate.h
3 *
4 * Copyright (C) 1995 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#ifndef __ASM_ARM_FPSTATE_H
12#define __ASM_ARM_FPSTATE_H
13
14#include <linux/config.h>
15
16#ifndef __ASSEMBLY__
17
18/*
19 * VFP storage area has:
20 * - FPEXC, FPSCR, FPINST and FPINST2.
21 * - 16 double precision data registers
22 * - an implementation-dependant word of state for FLDMX/FSTMX
23 *
24 * FPEXC will always be non-zero once the VFP has been used in this process.
25 */
26
27struct vfp_hard_struct {
28 __u64 fpregs[16];
29 __u32 fpmx_state;
30 __u32 fpexc;
31 __u32 fpscr;
32 /*
33 * VFP implementation specific state
34 */
35 __u32 fpinst;
36 __u32 fpinst2;
37};
38
39union vfp_state {
40 struct vfp_hard_struct hard;
41};
42
43extern void vfp_flush_thread(union vfp_state *);
44extern void vfp_release_thread(union vfp_state *);
45
46#define FP_HARD_SIZE 35
47
48struct fp_hard_struct {
49 unsigned int save[FP_HARD_SIZE]; /* as yet undefined */
50};
51
52#define FP_SOFT_SIZE 35
53
54struct fp_soft_struct {
55 unsigned int save[FP_SOFT_SIZE]; /* undefined information */
56};
57
58struct iwmmxt_struct {
59 unsigned int save[0x98/sizeof(int) + 1];
60};
61
62union fp_state {
63 struct fp_hard_struct hard;
64 struct fp_soft_struct soft;
65#ifdef CONFIG_IWMMXT
66 struct iwmmxt_struct iwmmxt;
67#endif
68};
69
70#define FP_SIZE (sizeof(union fp_state) / sizeof(int))
71
72#endif
73
74#endif
diff --git a/include/asm-arm/glue.h b/include/asm-arm/glue.h
new file mode 100644
index 000000000000..223e0d6c41be
--- /dev/null
+++ b/include/asm-arm/glue.h
@@ -0,0 +1,114 @@
1/*
2 * linux/include/asm-arm/glue.h
3 *
4 * Copyright (C) 1997-1999 Russell King
5 * Copyright (C) 2000-2002 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 version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This file provides the glue to stick the processor-specific bits
12 * into the kernel in an efficient manner. The idea is to use branches
13 * when we're only targetting one class of TLB, or indirect calls
14 * when we're targetting multiple classes of TLBs.
15 */
16#ifdef __KERNEL__
17
18#include <linux/config.h>
19
20#ifdef __STDC__
21#define ____glue(name,fn) name##fn
22#else
23#define ____glue(name,fn) name/**/fn
24#endif
25#define __glue(name,fn) ____glue(name,fn)
26
27
28
29/*
30 * Data Abort Model
31 * ================
32 *
33 * We have the following to choose from:
34 * arm6 - ARM6 style
35 * arm7 - ARM7 style
36 * v4_early - ARMv4 without Thumb early abort handler
37 * v4t_late - ARMv4 with Thumb late abort handler
38 * v4t_early - ARMv4 with Thumb early abort handler
39 * v5tej_early - ARMv5 with Thumb and Java early abort handler
40 * xscale - ARMv5 with Thumb with Xscale extensions
41 * v6_early - ARMv6 generic early abort handler
42 */
43#undef CPU_ABORT_HANDLER
44#undef MULTI_ABORT
45
46#if defined(CONFIG_CPU_ARM610)
47# ifdef CPU_ABORT_HANDLER
48# define MULTI_ABORT 1
49# else
50# define CPU_ABORT_HANDLER cpu_arm6_data_abort
51# endif
52#endif
53
54#if defined(CONFIG_CPU_ARM710)
55# ifdef CPU_ABORT_HANDLER
56# define MULTI_ABORT 1
57# else
58# define CPU_ABORT_HANDLER cpu_arm7_data_abort
59# endif
60#endif
61
62#ifdef CONFIG_CPU_ABRT_LV4T
63# ifdef CPU_ABORT_HANDLER
64# define MULTI_ABORT 1
65# else
66# define CPU_ABORT_HANDLER v4t_late_abort
67# endif
68#endif
69
70#ifdef CONFIG_CPU_ABRT_EV4
71# ifdef CPU_ABORT_HANDLER
72# define MULTI_ABORT 1
73# else
74# define CPU_ABORT_HANDLER v4_early_abort
75# endif
76#endif
77
78#ifdef CONFIG_CPU_ABRT_EV4T
79# ifdef CPU_ABORT_HANDLER
80# define MULTI_ABORT 1
81# else
82# define CPU_ABORT_HANDLER v4t_early_abort
83# endif
84#endif
85
86#ifdef CONFIG_CPU_ABRT_EV5TJ
87# ifdef CPU_ABORT_HANDLER
88# define MULTI_ABORT 1
89# else
90# define CPU_ABORT_HANDLER v5tj_early_abort
91# endif
92#endif
93
94#ifdef CONFIG_CPU_ABRT_EV5T
95# ifdef CPU_ABORT_HANDLER
96# define MULTI_ABORT 1
97# else
98# define CPU_ABORT_HANDLER v5t_early_abort
99# endif
100#endif
101
102#ifdef CONFIG_CPU_ABRT_EV6
103# ifdef CPU_ABORT_HANDLER
104# define MULTI_ABORT 1
105# else
106# define CPU_ABORT_HANDLER v6_early_abort
107# endif
108#endif
109
110#ifndef CPU_ABORT_HANDLER
111#error Unknown data abort handler type
112#endif
113
114#endif
diff --git a/include/asm-arm/hardirq.h b/include/asm-arm/hardirq.h
new file mode 100644
index 000000000000..e5ccb6b8ff83
--- /dev/null
+++ b/include/asm-arm/hardirq.h
@@ -0,0 +1,32 @@
1#ifndef __ASM_HARDIRQ_H
2#define __ASM_HARDIRQ_H
3
4#include <linux/config.h>
5#include <linux/cache.h>
6#include <linux/threads.h>
7#include <asm/irq.h>
8
9typedef struct {
10 unsigned int __softirq_pending;
11} ____cacheline_aligned irq_cpustat_t;
12
13#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
14
15#if NR_IRQS > 256
16#define HARDIRQ_BITS 9
17#else
18#define HARDIRQ_BITS 8
19#endif
20
21/*
22 * The hardirq mask has to be large enough to have space
23 * for potentially all IRQ sources in the system nesting
24 * on a single CPU:
25 */
26#if (1 << HARDIRQ_BITS) < NR_IRQS
27# error HARDIRQ_BITS is too low!
28#endif
29
30#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1
31
32#endif /* __ASM_HARDIRQ_H */
diff --git a/include/asm-arm/hardware.h b/include/asm-arm/hardware.h
new file mode 100644
index 000000000000..1fd1a5b6504b
--- /dev/null
+++ b/include/asm-arm/hardware.h
@@ -0,0 +1,18 @@
1/*
2 * linux/include/asm-arm/hardware.h
3 *
4 * Copyright (C) 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 * Common hardware definitions
11 */
12
13#ifndef __ASM_HARDWARE_H
14#define __ASM_HARDWARE_H
15
16#include <asm/arch/hardware.h>
17
18#endif
diff --git a/include/asm-arm/hardware/amba.h b/include/asm-arm/hardware/amba.h
new file mode 100644
index 000000000000..51e6e54b2aa1
--- /dev/null
+++ b/include/asm-arm/hardware/amba.h
@@ -0,0 +1,55 @@
1/*
2 * linux/include/asm-arm/hardware/amba.h
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#ifndef ASMARM_AMBA_H
11#define ASMARM_AMBA_H
12
13#define AMBA_NR_IRQS 2
14
15struct amba_device {
16 struct device dev;
17 struct resource res;
18 u64 dma_mask;
19 unsigned int periphid;
20 unsigned int irq[AMBA_NR_IRQS];
21};
22
23struct amba_id {
24 unsigned int id;
25 unsigned int mask;
26 void *data;
27};
28
29struct amba_driver {
30 struct device_driver drv;
31 int (*probe)(struct amba_device *, void *);
32 int (*remove)(struct amba_device *);
33 void (*shutdown)(struct amba_device *);
34 int (*suspend)(struct amba_device *, pm_message_t);
35 int (*resume)(struct amba_device *);
36 struct amba_id *id_table;
37};
38
39#define amba_get_drvdata(d) dev_get_drvdata(&d->dev)
40#define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)
41
42int amba_driver_register(struct amba_driver *);
43void amba_driver_unregister(struct amba_driver *);
44int amba_device_register(struct amba_device *, struct resource *);
45void amba_device_unregister(struct amba_device *);
46struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int);
47int amba_request_regions(struct amba_device *, const char *);
48void amba_release_regions(struct amba_device *);
49
50#define amba_config(d) (((d)->periphid >> 24) & 0xff)
51#define amba_rev(d) (((d)->periphid >> 20) & 0x0f)
52#define amba_manf(d) (((d)->periphid >> 12) & 0xff)
53#define amba_part(d) ((d)->periphid & 0xfff)
54
55#endif
diff --git a/include/asm-arm/hardware/amba_clcd.h b/include/asm-arm/hardware/amba_clcd.h
new file mode 100644
index 000000000000..2149be7c7023
--- /dev/null
+++ b/include/asm-arm/hardware/amba_clcd.h
@@ -0,0 +1,264 @@
1/*
2 * linux/include/asm-arm/hardware/amba_clcd.h -- Integrator LCD panel.
3 *
4 * David A Rusling
5 *
6 * Copyright (C) 2001 ARM Limited
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file COPYING in the main directory of this archive
10 * for more details.
11 */
12#include <linux/config.h>
13#include <linux/fb.h>
14
15/*
16 * CLCD Controller Internal Register addresses
17 */
18#define CLCD_TIM0 0x00000000
19#define CLCD_TIM1 0x00000004
20#define CLCD_TIM2 0x00000008
21#define CLCD_TIM3 0x0000000c
22#define CLCD_UBAS 0x00000010
23#define CLCD_LBAS 0x00000014
24
25#ifndef CONFIG_ARCH_VERSATILE
26#define CLCD_IENB 0x00000018
27#define CLCD_CNTL 0x0000001c
28#else
29/*
30 * Someone rearranged these two registers on the Versatile
31 * platform...
32 */
33#define CLCD_IENB 0x0000001c
34#define CLCD_CNTL 0x00000018
35#endif
36
37#define CLCD_STAT 0x00000020
38#define CLCD_INTR 0x00000024
39#define CLCD_UCUR 0x00000028
40#define CLCD_LCUR 0x0000002C
41#define CLCD_PALL 0x00000200
42#define CLCD_PALETTE 0x00000200
43
44#define TIM2_CLKSEL (1 << 5)
45#define TIM2_IVS (1 << 11)
46#define TIM2_IHS (1 << 12)
47#define TIM2_IPC (1 << 13)
48#define TIM2_IOE (1 << 14)
49#define TIM2_BCD (1 << 26)
50
51#define CNTL_LCDEN (1 << 0)
52#define CNTL_LCDBPP1 (0 << 1)
53#define CNTL_LCDBPP2 (1 << 1)
54#define CNTL_LCDBPP4 (2 << 1)
55#define CNTL_LCDBPP8 (3 << 1)
56#define CNTL_LCDBPP16 (4 << 1)
57#define CNTL_LCDBPP24 (5 << 1)
58#define CNTL_LCDBW (1 << 4)
59#define CNTL_LCDTFT (1 << 5)
60#define CNTL_LCDMONO8 (1 << 6)
61#define CNTL_LCDDUAL (1 << 7)
62#define CNTL_BGR (1 << 8)
63#define CNTL_BEBO (1 << 9)
64#define CNTL_BEPO (1 << 10)
65#define CNTL_LCDPWR (1 << 11)
66#define CNTL_LCDVCOMP(x) ((x) << 12)
67#define CNTL_LDMAFIFOTIME (1 << 15)
68#define CNTL_WATERMARK (1 << 16)
69
70struct clcd_panel {
71 struct fb_videomode mode;
72 signed short width; /* width in mm */
73 signed short height; /* height in mm */
74 u32 tim2;
75 u32 tim3;
76 u32 cntl;
77 unsigned int bpp:8,
78 fixedtimings:1,
79 grayscale:1;
80 unsigned int connector;
81};
82
83struct clcd_regs {
84 u32 tim0;
85 u32 tim1;
86 u32 tim2;
87 u32 tim3;
88 u32 cntl;
89 unsigned long pixclock;
90};
91
92struct clcd_fb;
93
94/*
95 * the board-type specific routines
96 */
97struct clcd_board {
98 const char *name;
99
100 /*
101 * Optional. Check whether the var structure is acceptable
102 * for this display.
103 */
104 int (*check)(struct clcd_fb *fb, struct fb_var_screeninfo *var);
105
106 /*
107 * Compulsary. Decode fb->fb.var into regs->*. In the case of
108 * fixed timing, set regs->* to the register values required.
109 */
110 void (*decode)(struct clcd_fb *fb, struct clcd_regs *regs);
111
112 /*
113 * Optional. Disable any extra display hardware.
114 */
115 void (*disable)(struct clcd_fb *);
116
117 /*
118 * Optional. Enable any extra display hardware.
119 */
120 void (*enable)(struct clcd_fb *);
121
122 /*
123 * Setup platform specific parts of CLCD driver
124 */
125 int (*setup)(struct clcd_fb *);
126
127 /*
128 * mmap the framebuffer memory
129 */
130 int (*mmap)(struct clcd_fb *, struct vm_area_struct *);
131
132 /*
133 * Remove platform specific parts of CLCD driver
134 */
135 void (*remove)(struct clcd_fb *);
136};
137
138struct amba_device;
139struct clk;
140
141/* this data structure describes each frame buffer device we find */
142struct clcd_fb {
143 struct fb_info fb;
144 struct amba_device *dev;
145 struct clk *clk;
146 struct clcd_panel *panel;
147 struct clcd_board *board;
148 void *board_data;
149 void __iomem *regs;
150 u32 clcd_cntl;
151 u32 cmap[16];
152};
153
154static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
155{
156 u32 val;
157
158 /*
159 * Program the CLCD controller registers and start the CLCD
160 */
161 val = ((fb->fb.var.xres / 16) - 1) << 2;
162 val |= (fb->fb.var.hsync_len - 1) << 8;
163 val |= (fb->fb.var.right_margin - 1) << 16;
164 val |= (fb->fb.var.left_margin - 1) << 24;
165 regs->tim0 = val;
166
167 val = fb->fb.var.yres - 1;
168 val |= (fb->fb.var.vsync_len - 1) << 10;
169 val |= fb->fb.var.lower_margin << 16;
170 val |= fb->fb.var.upper_margin << 24;
171 regs->tim1 = val;
172
173 val = fb->panel->tim2;
174 val |= fb->fb.var.sync & FB_SYNC_HOR_HIGH_ACT ? 0 : TIM2_IHS;
175 val |= fb->fb.var.sync & FB_SYNC_VERT_HIGH_ACT ? 0 : TIM2_IVS;
176
177 if (fb->panel->cntl & CNTL_LCDTFT)
178 val |= (fb->fb.var.xres_virtual - 1) << 16;
179 else if (fb->panel->cntl & CNTL_LCDBW)
180 printk("what value for CPL for stnmono panels?");
181 else
182 val |= ((fb->fb.var.xres_virtual * 8 / 3) - 1) << 16;
183 regs->tim2 = val;
184
185 regs->tim3 = fb->panel->tim3;
186
187 val = fb->panel->cntl;
188 if (fb->fb.var.grayscale)
189 val |= CNTL_LCDBW;
190
191 switch (fb->fb.var.bits_per_pixel) {
192 case 1:
193 val |= CNTL_LCDBPP1;
194 break;
195 case 2:
196 val |= CNTL_LCDBPP2;
197 break;
198 case 4:
199 val |= CNTL_LCDBPP4;
200 break;
201 case 8:
202 val |= CNTL_LCDBPP8;
203 break;
204 case 16:
205 val |= CNTL_LCDBPP16;
206 break;
207 case 24:
208 val |= CNTL_LCDBPP24;
209 break;
210 }
211
212 regs->cntl = val;
213 regs->pixclock = fb->fb.var.pixclock;
214}
215
216static inline int clcdfb_check(struct clcd_fb *fb, struct fb_var_screeninfo *var)
217{
218 var->xres_virtual = var->xres = (var->xres + 7) & ~7;
219 var->yres_virtual = var->yres;
220
221#define CHECK(e,l,h) (var->e < l || var->e > h)
222 if (CHECK(right_margin, (5+1), 256) || /* back porch */
223 CHECK(left_margin, (5+1), 256) || /* front porch */
224 CHECK(hsync_len, (5+1), 256) ||
225 var->xres > 4096 ||
226 var->lower_margin > 255 || /* back porch */
227 var->upper_margin > 255 || /* front porch */
228 var->vsync_len > 32 ||
229 var->yres > 1024)
230 return -EINVAL;
231#undef CHECK
232
233 /* single panel mode: PCD = max(PCD, 1) */
234 /* dual panel mode: PCD = max(PCD, 5) */
235
236 /*
237 * You can't change the grayscale setting, and
238 * we can only do non-interlaced video.
239 */
240 if (var->grayscale != fb->fb.var.grayscale ||
241 (var->vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED)
242 return -EINVAL;
243
244#define CHECK(e) (var->e != fb->fb.var.e)
245 if (fb->panel->fixedtimings &&
246 (CHECK(xres) ||
247 CHECK(yres) ||
248 CHECK(bits_per_pixel) ||
249 CHECK(pixclock) ||
250 CHECK(left_margin) ||
251 CHECK(right_margin) ||
252 CHECK(upper_margin) ||
253 CHECK(lower_margin) ||
254 CHECK(hsync_len) ||
255 CHECK(vsync_len) ||
256 CHECK(sync)))
257 return -EINVAL;
258#undef CHECK
259
260 var->nonstd = 0;
261 var->accel_flags = 0;
262
263 return 0;
264}
diff --git a/include/asm-arm/hardware/amba_kmi.h b/include/asm-arm/hardware/amba_kmi.h
new file mode 100644
index 000000000000..a39e5be751b3
--- /dev/null
+++ b/include/asm-arm/hardware/amba_kmi.h
@@ -0,0 +1,92 @@
1/*
2 * linux/include/asm-arm/hardware/amba_kmi.h
3 *
4 * Internal header file for AMBA KMI ports
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 *
23 * ---------------------------------------------------------------------------
24 * From ARM PrimeCell(tm) PS2 Keyboard/Mouse Interface (PL050) Technical
25 * Reference Manual - ARM DDI 0143B - see http://www.arm.com/
26 * ---------------------------------------------------------------------------
27 */
28#ifndef ASM_ARM_HARDWARE_AMBA_KMI_H
29#define ASM_ARM_HARDWARE_AMBA_KMI_H
30
31/*
32 * KMI control register:
33 * KMICR_TYPE 0 = PS2/AT mode, 1 = No line control bit mode
34 * KMICR_RXINTREN 1 = enable RX interrupts
35 * KMICR_TXINTREN 1 = enable TX interrupts
36 * KMICR_EN 1 = enable KMI
37 * KMICR_FD 1 = force KMI data low
38 * KMICR_FC 1 = force KMI clock low
39 */
40#define KMICR (KMI_BASE + 0x00)
41#define KMICR_TYPE (1 << 5)
42#define KMICR_RXINTREN (1 << 4)
43#define KMICR_TXINTREN (1 << 3)
44#define KMICR_EN (1 << 2)
45#define KMICR_FD (1 << 1)
46#define KMICR_FC (1 << 0)
47
48/*
49 * KMI status register:
50 * KMISTAT_TXEMPTY 1 = transmitter register empty
51 * KMISTAT_TXBUSY 1 = currently sending data
52 * KMISTAT_RXFULL 1 = receiver register ready to be read
53 * KMISTAT_RXBUSY 1 = currently receiving data
54 * KMISTAT_RXPARITY parity of last databyte received
55 * KMISTAT_IC current level of KMI clock input
56 * KMISTAT_ID current level of KMI data input
57 */
58#define KMISTAT (KMI_BASE + 0x04)
59#define KMISTAT_TXEMPTY (1 << 6)
60#define KMISTAT_TXBUSY (1 << 5)
61#define KMISTAT_RXFULL (1 << 4)
62#define KMISTAT_RXBUSY (1 << 3)
63#define KMISTAT_RXPARITY (1 << 2)
64#define KMISTAT_IC (1 << 1)
65#define KMISTAT_ID (1 << 0)
66
67/*
68 * KMI data register
69 */
70#define KMIDATA (KMI_BASE + 0x08)
71
72/*
73 * KMI clock divisor: to generate 8MHz internal clock
74 * div = (ref / 8MHz) - 1; 0 <= div <= 15
75 */
76#define KMICLKDIV (KMI_BASE + 0x0c)
77
78/*
79 * KMI interrupt register:
80 * KMIIR_TXINTR 1 = transmit interrupt asserted
81 * KMIIR_RXINTR 1 = receive interrupt asserted
82 */
83#define KMIIR (KMI_BASE + 0x10)
84#define KMIIR_TXINTR (1 << 1)
85#define KMIIR_RXINTR (1 << 0)
86
87/*
88 * The size of the KMI primecell
89 */
90#define KMI_SIZE (0x100)
91
92#endif
diff --git a/include/asm-arm/hardware/amba_serial.h b/include/asm-arm/hardware/amba_serial.h
new file mode 100644
index 000000000000..71770aa6389f
--- /dev/null
+++ b/include/asm-arm/hardware/amba_serial.h
@@ -0,0 +1,156 @@
1/*
2 * linux/include/asm-arm/hardware/serial_amba.h
3 *
4 * Internal header file for AMBA serial ports
5 *
6 * Copyright (C) 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#ifndef ASM_ARM_HARDWARE_SERIAL_AMBA_H
24#define ASM_ARM_HARDWARE_SERIAL_AMBA_H
25
26/* -------------------------------------------------------------------------------
27 * From AMBA UART (PL010) Block Specification
28 * -------------------------------------------------------------------------------
29 * UART Register Offsets.
30 */
31#define UART01x_DR 0x00 /* Data read or written from the interface. */
32#define UART01x_RSR 0x04 /* Receive status register (Read). */
33#define UART01x_ECR 0x04 /* Error clear register (Write). */
34#define UART010_LCRH 0x08 /* Line control register, high byte. */
35#define UART010_LCRM 0x0C /* Line control register, middle byte. */
36#define UART010_LCRL 0x10 /* Line control register, low byte. */
37#define UART010_CR 0x14 /* Control register. */
38#define UART01x_FR 0x18 /* Flag register (Read only). */
39#define UART010_IIR 0x1C /* Interrupt indentification register (Read). */
40#define UART010_ICR 0x1C /* Interrupt clear register (Write). */
41#define UART01x_ILPR 0x20 /* IrDA low power counter register. */
42#define UART011_IBRD 0x24 /* Integer baud rate divisor register. */
43#define UART011_FBRD 0x28 /* Fractional baud rate divisor register. */
44#define UART011_LCRH 0x2c /* Line control register. */
45#define UART011_CR 0x30 /* Control register. */
46#define UART011_IFLS 0x34 /* Interrupt fifo level select. */
47#define UART011_IMSC 0x38 /* Interrupt mask. */
48#define UART011_RIS 0x3c /* Raw interrupt status. */
49#define UART011_MIS 0x40 /* Masked interrupt status. */
50#define UART011_ICR 0x44 /* Interrupt clear register. */
51#define UART011_DMACR 0x48 /* DMA control register. */
52
53#define UART01x_RSR_OE 0x08
54#define UART01x_RSR_BE 0x04
55#define UART01x_RSR_PE 0x02
56#define UART01x_RSR_FE 0x01
57
58#define UART011_FR_RI 0x100
59#define UART011_FR_TXFE 0x080
60#define UART011_FR_RXFF 0x040
61#define UART01x_FR_TXFF 0x020
62#define UART01x_FR_RXFE 0x010
63#define UART01x_FR_BUSY 0x008
64#define UART01x_FR_DCD 0x004
65#define UART01x_FR_DSR 0x002
66#define UART01x_FR_CTS 0x001
67#define UART01x_FR_TMSK (UART01x_FR_TXFF + UART01x_FR_BUSY)
68
69#define UART011_CR_CTSEN 0x8000 /* CTS hardware flow control */
70#define UART011_CR_RTSEN 0x4000 /* RTS hardware flow control */
71#define UART011_CR_OUT2 0x2000 /* OUT2 */
72#define UART011_CR_OUT1 0x1000 /* OUT1 */
73#define UART011_CR_RTS 0x0800 /* RTS */
74#define UART011_CR_DTR 0x0400 /* DTR */
75#define UART011_CR_RXE 0x0200 /* receive enable */
76#define UART011_CR_TXE 0x0100 /* transmit enable */
77#define UART011_CR_LBE 0x0080 /* loopback enable */
78#define UART010_CR_RTIE 0x0040
79#define UART010_CR_TIE 0x0020
80#define UART010_CR_RIE 0x0010
81#define UART010_CR_MSIE 0x0008
82#define UART01x_CR_IIRLP 0x0004 /* SIR low power mode */
83#define UART01x_CR_SIREN 0x0002 /* SIR enable */
84#define UART01x_CR_UARTEN 0x0001 /* UART enable */
85
86#define UART011_LCRH_SPS 0x80
87#define UART01x_LCRH_WLEN_8 0x60
88#define UART01x_LCRH_WLEN_7 0x40
89#define UART01x_LCRH_WLEN_6 0x20
90#define UART01x_LCRH_WLEN_5 0x00
91#define UART01x_LCRH_FEN 0x10
92#define UART01x_LCRH_STP2 0x08
93#define UART01x_LCRH_EPS 0x04
94#define UART01x_LCRH_PEN 0x02
95#define UART01x_LCRH_BRK 0x01
96
97#define UART010_IIR_RTIS 0x08
98#define UART010_IIR_TIS 0x04
99#define UART010_IIR_RIS 0x02
100#define UART010_IIR_MIS 0x01
101
102#define UART011_IFLS_RX1_8 (0 << 3)
103#define UART011_IFLS_RX2_8 (1 << 3)
104#define UART011_IFLS_RX4_8 (2 << 3)
105#define UART011_IFLS_RX6_8 (3 << 3)
106#define UART011_IFLS_RX7_8 (4 << 3)
107#define UART011_IFLS_TX1_8 (0 << 0)
108#define UART011_IFLS_TX2_8 (1 << 0)
109#define UART011_IFLS_TX4_8 (2 << 0)
110#define UART011_IFLS_TX6_8 (3 << 0)
111#define UART011_IFLS_TX7_8 (4 << 0)
112
113#define UART011_OEIM (1 << 10) /* overrun error interrupt mask */
114#define UART011_BEIM (1 << 9) /* break error interrupt mask */
115#define UART011_PEIM (1 << 8) /* parity error interrupt mask */
116#define UART011_FEIM (1 << 7) /* framing error interrupt mask */
117#define UART011_RTIM (1 << 6) /* receive timeout interrupt mask */
118#define UART011_TXIM (1 << 5) /* transmit interrupt mask */
119#define UART011_RXIM (1 << 4) /* receive interrupt mask */
120#define UART011_DSRMIM (1 << 3) /* DSR interrupt mask */
121#define UART011_DCDMIM (1 << 2) /* DCD interrupt mask */
122#define UART011_CTSMIM (1 << 1) /* CTS interrupt mask */
123#define UART011_RIMIM (1 << 0) /* RI interrupt mask */
124
125#define UART011_OEIS (1 << 10) /* overrun error interrupt status */
126#define UART011_BEIS (1 << 9) /* break error interrupt status */
127#define UART011_PEIS (1 << 8) /* parity error interrupt status */
128#define UART011_FEIS (1 << 7) /* framing error interrupt status */
129#define UART011_RTIS (1 << 6) /* receive timeout interrupt status */
130#define UART011_TXIS (1 << 5) /* transmit interrupt status */
131#define UART011_RXIS (1 << 4) /* receive interrupt status */
132#define UART011_DSRMIS (1 << 3) /* DSR interrupt status */
133#define UART011_DCDMIS (1 << 2) /* DCD interrupt status */
134#define UART011_CTSMIS (1 << 1) /* CTS interrupt status */
135#define UART011_RIMIS (1 << 0) /* RI interrupt status */
136
137#define UART011_OEIC (1 << 10) /* overrun error interrupt clear */
138#define UART011_BEIC (1 << 9) /* break error interrupt clear */
139#define UART011_PEIC (1 << 8) /* parity error interrupt clear */
140#define UART011_FEIC (1 << 7) /* framing error interrupt clear */
141#define UART011_RTIC (1 << 6) /* receive timeout interrupt clear */
142#define UART011_TXIC (1 << 5) /* transmit interrupt clear */
143#define UART011_RXIC (1 << 4) /* receive interrupt clear */
144#define UART011_DSRMIC (1 << 3) /* DSR interrupt clear */
145#define UART011_DCDMIC (1 << 2) /* DCD interrupt clear */
146#define UART011_CTSMIC (1 << 1) /* CTS interrupt clear */
147#define UART011_RIMIC (1 << 0) /* RI interrupt clear */
148
149#define UART011_DMAONERR (1 << 2) /* disable dma on error */
150#define UART011_TXDMAE (1 << 1) /* enable transmit dma */
151#define UART011_RXDMAE (1 << 0) /* enable receive dma */
152
153#define UART01x_RSR_ANY (UART01x_RSR_OE|UART01x_RSR_BE|UART01x_RSR_PE|UART01x_RSR_FE)
154#define UART01x_FR_MODEM_ANY (UART01x_FR_DCD|UART01x_FR_DSR|UART01x_FR_CTS)
155
156#endif
diff --git a/include/asm-arm/hardware/clock.h b/include/asm-arm/hardware/clock.h
new file mode 100644
index 000000000000..4983449ff2c7
--- /dev/null
+++ b/include/asm-arm/hardware/clock.h
@@ -0,0 +1,121 @@
1/*
2 * linux/include/asm-arm/hardware/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 */
11#ifndef ASMARM_CLOCK_H
12#define ASMARM_CLOCK_H
13
14struct device;
15
16/*
17 * The base API.
18 */
19
20
21/*
22 * struct clk - an machine class defined object / cookie.
23 */
24struct clk;
25
26/**
27 * clk_get - lookup and obtain a reference to a clock producer.
28 * @dev: device for clock "consumer"
29 * @id: device ID
30 *
31 * Returns a struct clk corresponding to the clock producer, or
32 * valid IS_ERR() condition containing errno.
33 */
34struct clk *clk_get(struct device *dev, const char *id);
35
36/**
37 * clk_enable - inform the system when the clock source should be running.
38 * @clk: clock source
39 *
40 * If the clock can not be enabled/disabled, this should return success.
41 *
42 * Returns success (0) or negative errno.
43 */
44int clk_enable(struct clk *clk);
45
46/**
47 * clk_disable - inform the system when the clock source is no longer required.
48 * @clk: clock source
49 */
50void clk_disable(struct clk *clk);
51
52/**
53 * clk_use - increment the use count
54 * @clk: clock source
55 *
56 * Returns success (0) or negative errno.
57 */
58int clk_use(struct clk *clk);
59
60/**
61 * clk_unuse - decrement the use count
62 * @clk: clock source
63 */
64void clk_unuse(struct clk *clk);
65
66/**
67 * clk_get_rate - obtain the current clock rate (in Hz) for a clock source.
68 * This is only valid once the clock source has been enabled.
69 * @clk: clock source
70 */
71unsigned long clk_get_rate(struct clk *clk);
72
73/**
74 * clk_put - "free" the clock source
75 * @clk: clock source
76 */
77void clk_put(struct clk *clk);
78
79
80/*
81 * The remaining APIs are optional for machine class support.
82 */
83
84
85/**
86 * clk_round_rate - adjust a rate to the exact rate a clock can provide
87 * @clk: clock source
88 * @rate: desired clock rate in Hz
89 *
90 * Returns rounded clock rate in Hz, or negative errno.
91 */
92long clk_round_rate(struct clk *clk, unsigned long rate);
93
94/**
95 * clk_set_rate - set the clock rate for a clock source
96 * @clk: clock source
97 * @rate: desired clock rate in Hz
98 *
99 * Returns success (0) or negative errno.
100 */
101int clk_set_rate(struct clk *clk, unsigned long rate);
102
103/**
104 * clk_set_parent - set the parent clock source for this clock
105 * @clk: clock source
106 * @parent: parent clock source
107 *
108 * Returns success (0) or negative errno.
109 */
110int clk_set_parent(struct clk *clk, struct clk *parent);
111
112/**
113 * clk_get_parent - get the parent clock source for this clock
114 * @clk: clock source
115 *
116 * Returns struct clk corresponding to parent clock source, or
117 * valid IS_ERR() condition containing errno.
118 */
119struct clk *clk_get_parent(struct clk *clk);
120
121#endif
diff --git a/include/asm-arm/hardware/clps7111.h b/include/asm-arm/hardware/clps7111.h
new file mode 100644
index 000000000000..8d3228dc1778
--- /dev/null
+++ b/include/asm-arm/hardware/clps7111.h
@@ -0,0 +1,184 @@
1/*
2 * linux/include/asm-arm/hardware/clps7111.h
3 *
4 * This file contains the hardware definitions of the CLPS7111 internal
5 * registers.
6 *
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#ifndef __ASM_HARDWARE_CLPS7111_H
24#define __ASM_HARDWARE_CLPS7111_H
25
26#define CLPS7111_PHYS_BASE (0x80000000)
27
28#ifndef __ASSEMBLY__
29#define clps_readb(off) __raw_readb(CLPS7111_BASE + (off))
30#define clps_readw(off) __raw_readw(CLPS7111_BASE + (off))
31#define clps_readl(off) __raw_readl(CLPS7111_BASE + (off))
32#define clps_writeb(val,off) __raw_writeb(val, CLPS7111_BASE + (off))
33#define clps_writew(val,off) __raw_writew(val, CLPS7111_BASE + (off))
34#define clps_writel(val,off) __raw_writel(val, CLPS7111_BASE + (off))
35#endif
36
37#define PADR (0x0000)
38#define PBDR (0x0001)
39#define PDDR (0x0003)
40#define PADDR (0x0040)
41#define PBDDR (0x0041)
42#define PDDDR (0x0043)
43#define PEDR (0x0080)
44#define PEDDR (0x00c0)
45#define SYSCON1 (0x0100)
46#define SYSFLG1 (0x0140)
47#define MEMCFG1 (0x0180)
48#define MEMCFG2 (0x01c0)
49#define DRFPR (0x0200)
50#define INTSR1 (0x0240)
51#define INTMR1 (0x0280)
52#define LCDCON (0x02c0)
53#define TC1D (0x0300)
54#define TC2D (0x0340)
55#define RTCDR (0x0380)
56#define RTCMR (0x03c0)
57#define PMPCON (0x0400)
58#define CODR (0x0440)
59#define UARTDR1 (0x0480)
60#define UBRLCR1 (0x04c0)
61#define SYNCIO (0x0500)
62#define PALLSW (0x0540)
63#define PALMSW (0x0580)
64#define STFCLR (0x05c0)
65#define BLEOI (0x0600)
66#define MCEOI (0x0640)
67#define TEOI (0x0680)
68#define TC1EOI (0x06c0)
69#define TC2EOI (0x0700)
70#define RTCEOI (0x0740)
71#define UMSEOI (0x0780)
72#define COEOI (0x07c0)
73#define HALT (0x0800)
74#define STDBY (0x0840)
75
76#define FBADDR (0x1000)
77#define SYSCON2 (0x1100)
78#define SYSFLG2 (0x1140)
79#define INTSR2 (0x1240)
80#define INTMR2 (0x1280)
81#define UARTDR2 (0x1480)
82#define UBRLCR2 (0x14c0)
83#define SS2DR (0x1500)
84#define SRXEOF (0x1600)
85#define SS2POP (0x16c0)
86#define KBDEOI (0x1700)
87
88/* common bits: SYSCON1 / SYSCON2 */
89#define SYSCON_UARTEN (1 << 8)
90
91#define SYSCON1_KBDSCAN(x) ((x) & 15)
92#define SYSCON1_KBDSCANMASK (15)
93#define SYSCON1_TC1M (1 << 4)
94#define SYSCON1_TC1S (1 << 5)
95#define SYSCON1_TC2M (1 << 6)
96#define SYSCON1_TC2S (1 << 7)
97#define SYSCON1_UART1EN SYSCON_UARTEN
98#define SYSCON1_BZTOG (1 << 9)
99#define SYSCON1_BZMOD (1 << 10)
100#define SYSCON1_DBGEN (1 << 11)
101#define SYSCON1_LCDEN (1 << 12)
102#define SYSCON1_CDENTX (1 << 13)
103#define SYSCON1_CDENRX (1 << 14)
104#define SYSCON1_SIREN (1 << 15)
105#define SYSCON1_ADCKSEL(x) (((x) & 3) << 16)
106#define SYSCON1_ADCKSEL_MASK (3 << 16)
107#define SYSCON1_EXCKEN (1 << 18)
108#define SYSCON1_WAKEDIS (1 << 19)
109#define SYSCON1_IRTXM (1 << 20)
110
111/* common bits: SYSFLG1 / SYSFLG2 */
112#define SYSFLG_UBUSY (1 << 11)
113#define SYSFLG_URXFE (1 << 22)
114#define SYSFLG_UTXFF (1 << 23)
115
116#define SYSFLG1_MCDR (1 << 0)
117#define SYSFLG1_DCDET (1 << 1)
118#define SYSFLG1_WUDR (1 << 2)
119#define SYSFLG1_WUON (1 << 3)
120#define SYSFLG1_CTS (1 << 8)
121#define SYSFLG1_DSR (1 << 9)
122#define SYSFLG1_DCD (1 << 10)
123#define SYSFLG1_UBUSY SYSFLG_UBUSY
124#define SYSFLG1_NBFLG (1 << 12)
125#define SYSFLG1_RSTFLG (1 << 13)
126#define SYSFLG1_PFFLG (1 << 14)
127#define SYSFLG1_CLDFLG (1 << 15)
128#define SYSFLG1_URXFE SYSFLG_URXFE
129#define SYSFLG1_UTXFF SYSFLG_UTXFF
130#define SYSFLG1_CRXFE (1 << 24)
131#define SYSFLG1_CTXFF (1 << 25)
132#define SYSFLG1_SSIBUSY (1 << 26)
133#define SYSFLG1_ID (1 << 29)
134
135#define SYSFLG2_SSRXOF (1 << 0)
136#define SYSFLG2_RESVAL (1 << 1)
137#define SYSFLG2_RESFRM (1 << 2)
138#define SYSFLG2_SS2RXFE (1 << 3)
139#define SYSFLG2_SS2TXFF (1 << 4)
140#define SYSFLG2_SS2TXUF (1 << 5)
141#define SYSFLG2_CKMODE (1 << 6)
142#define SYSFLG2_UBUSY SYSFLG_UBUSY
143#define SYSFLG2_URXFE SYSFLG_URXFE
144#define SYSFLG2_UTXFF SYSFLG_UTXFF
145
146#define LCDCON_GSEN (1 << 30)
147#define LCDCON_GSMD (1 << 31)
148
149#define SYSCON2_SERSEL (1 << 0)
150#define SYSCON2_KBD6 (1 << 1)
151#define SYSCON2_DRAMZ (1 << 2)
152#define SYSCON2_KBWEN (1 << 3)
153#define SYSCON2_SS2TXEN (1 << 4)
154#define SYSCON2_PCCARD1 (1 << 5)
155#define SYSCON2_PCCARD2 (1 << 6)
156#define SYSCON2_SS2RXEN (1 << 7)
157#define SYSCON2_UART2EN SYSCON_UARTEN
158#define SYSCON2_SS2MAEN (1 << 9)
159#define SYSCON2_OSTB (1 << 12)
160#define SYSCON2_CLKENSL (1 << 13)
161#define SYSCON2_BUZFREQ (1 << 14)
162
163/* common bits: UARTDR1 / UARTDR2 */
164#define UARTDR_FRMERR (1 << 8)
165#define UARTDR_PARERR (1 << 9)
166#define UARTDR_OVERR (1 << 10)
167
168/* common bits: UBRLCR1 / UBRLCR2 */
169#define UBRLCR_BAUD_MASK ((1 << 12) - 1)
170#define UBRLCR_BREAK (1 << 12)
171#define UBRLCR_PRTEN (1 << 13)
172#define UBRLCR_EVENPRT (1 << 14)
173#define UBRLCR_XSTOP (1 << 15)
174#define UBRLCR_FIFOEN (1 << 16)
175#define UBRLCR_WRDLEN5 (0 << 17)
176#define UBRLCR_WRDLEN6 (1 << 17)
177#define UBRLCR_WRDLEN7 (2 << 17)
178#define UBRLCR_WRDLEN8 (3 << 17)
179#define UBRLCR_WRDLEN_MASK (3 << 17)
180
181#define SYNCIO_SMCKEN (1 << 13)
182#define SYNCIO_TXFRMEN (1 << 14)
183
184#endif /* __ASM_HARDWARE_CLPS7111_H */
diff --git a/include/asm-arm/hardware/cs89712.h b/include/asm-arm/hardware/cs89712.h
new file mode 100644
index 000000000000..ad99a3e1b802
--- /dev/null
+++ b/include/asm-arm/hardware/cs89712.h
@@ -0,0 +1,49 @@
1/*
2 * linux/include/asm-arm/hardware/cs89712.h
3 *
4 * This file contains the hardware definitions of the CS89712
5 * additional internal registers.
6 *
7 * Copyright (C) 2001 Thomas Gleixner autronix automation <gleixner@autronix.de>
8 *
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#ifndef __ASM_HARDWARE_CS89712_H
25#define __ASM_HARDWARE_CS89712_H
26
27/*
28* CS89712 additional registers
29*/
30
31#define PCDR 0x0002 /* Port C Data register ---------------------------- */
32#define PCDDR 0x0042 /* Port C Data Direction register ------------------ */
33#define SDCONF 0x2300 /* SDRAM Configuration register ---------------------*/
34#define SDRFPR 0x2340 /* SDRAM Refresh period register --------------------*/
35
36#define SDCONF_ACTIVE (1 << 10)
37#define SDCONF_CLKCTL (1 << 9)
38#define SDCONF_WIDTH_4 (0 << 7)
39#define SDCONF_WIDTH_8 (1 << 7)
40#define SDCONF_WIDTH_16 (2 << 7)
41#define SDCONF_WIDTH_32 (3 << 7)
42#define SDCONF_SIZE_16 (0 << 5)
43#define SDCONF_SIZE_64 (1 << 5)
44#define SDCONF_SIZE_128 (2 << 5)
45#define SDCONF_SIZE_256 (3 << 5)
46#define SDCONF_CASLAT_2 (2)
47#define SDCONF_CASLAT_3 (3)
48
49#endif /* __ASM_HARDWARE_CS89712_H */
diff --git a/include/asm-arm/hardware/dec21285.h b/include/asm-arm/hardware/dec21285.h
new file mode 100644
index 000000000000..9049f0ddaecf
--- /dev/null
+++ b/include/asm-arm/hardware/dec21285.h
@@ -0,0 +1,148 @@
1/*
2 * linux/include/asm-arm/hardware/dec21285.h
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 * DC21285 registers
11 */
12#define DC21285_PCI_IACK 0x79000000
13#define DC21285_ARMCSR_BASE 0x42000000
14#define DC21285_PCI_TYPE_0_CONFIG 0x7b000000
15#define DC21285_PCI_TYPE_1_CONFIG 0x7a000000
16#define DC21285_OUTBOUND_WRITE_FLUSH 0x78000000
17#define DC21285_FLASH 0x41000000
18#define DC21285_PCI_IO 0x7c000000
19#define DC21285_PCI_MEM 0x80000000
20
21#include <linux/config.h>
22#ifndef __ASSEMBLY__
23#include <asm/arch/hardware.h>
24#define DC21285_IO(x) ((volatile unsigned long *)(ARMCSR_BASE+(x)))
25#else
26#define DC21285_IO(x) (x)
27#endif
28
29#define CSR_PCICMD DC21285_IO(0x0004)
30#define CSR_CLASSREV DC21285_IO(0x0008)
31#define CSR_PCICACHELINESIZE DC21285_IO(0x000c)
32#define CSR_PCICSRBASE DC21285_IO(0x0010)
33#define CSR_PCICSRIOBASE DC21285_IO(0x0014)
34#define CSR_PCISDRAMBASE DC21285_IO(0x0018)
35#define CSR_PCIROMBASE DC21285_IO(0x0030)
36#define CSR_MBOX0 DC21285_IO(0x0050)
37#define CSR_MBOX1 DC21285_IO(0x0054)
38#define CSR_MBOX2 DC21285_IO(0x0058)
39#define CSR_MBOX3 DC21285_IO(0x005c)
40#define CSR_DOORBELL DC21285_IO(0x0060)
41#define CSR_DOORBELL_SETUP DC21285_IO(0x0064)
42#define CSR_ROMWRITEREG DC21285_IO(0x0068)
43#define CSR_CSRBASEMASK DC21285_IO(0x00f8)
44#define CSR_CSRBASEOFFSET DC21285_IO(0x00fc)
45#define CSR_SDRAMBASEMASK DC21285_IO(0x0100)
46#define CSR_SDRAMBASEOFFSET DC21285_IO(0x0104)
47#define CSR_ROMBASEMASK DC21285_IO(0x0108)
48#define CSR_SDRAMTIMING DC21285_IO(0x010c)
49#define CSR_SDRAMADDRSIZE0 DC21285_IO(0x0110)
50#define CSR_SDRAMADDRSIZE1 DC21285_IO(0x0114)
51#define CSR_SDRAMADDRSIZE2 DC21285_IO(0x0118)
52#define CSR_SDRAMADDRSIZE3 DC21285_IO(0x011c)
53#define CSR_I2O_INFREEHEAD DC21285_IO(0x0120)
54#define CSR_I2O_INPOSTTAIL DC21285_IO(0x0124)
55#define CSR_I2O_OUTPOSTHEAD DC21285_IO(0x0128)
56#define CSR_I2O_OUTFREETAIL DC21285_IO(0x012c)
57#define CSR_I2O_INFREECOUNT DC21285_IO(0x0130)
58#define CSR_I2O_OUTPOSTCOUNT DC21285_IO(0x0134)
59#define CSR_I2O_INPOSTCOUNT DC21285_IO(0x0138)
60#define CSR_SA110_CNTL DC21285_IO(0x013c)
61#define SA110_CNTL_INITCMPLETE (1 << 0)
62#define SA110_CNTL_ASSERTSERR (1 << 1)
63#define SA110_CNTL_RXSERR (1 << 3)
64#define SA110_CNTL_SA110DRAMPARITY (1 << 4)
65#define SA110_CNTL_PCISDRAMPARITY (1 << 5)
66#define SA110_CNTL_DMASDRAMPARITY (1 << 6)
67#define SA110_CNTL_DISCARDTIMER (1 << 8)
68#define SA110_CNTL_PCINRESET (1 << 9)
69#define SA110_CNTL_I2O_256 (0 << 10)
70#define SA110_CNTL_I20_512 (1 << 10)
71#define SA110_CNTL_I2O_1024 (2 << 10)
72#define SA110_CNTL_I2O_2048 (3 << 10)
73#define SA110_CNTL_I2O_4096 (4 << 10)
74#define SA110_CNTL_I2O_8192 (5 << 10)
75#define SA110_CNTL_I2O_16384 (6 << 10)
76#define SA110_CNTL_I2O_32768 (7 << 10)
77#define SA110_CNTL_WATCHDOG (1 << 13)
78#define SA110_CNTL_ROMWIDTH_UNDEF (0 << 14)
79#define SA110_CNTL_ROMWIDTH_16 (1 << 14)
80#define SA110_CNTL_ROMWIDTH_32 (2 << 14)
81#define SA110_CNTL_ROMWIDTH_8 (3 << 14)
82#define SA110_CNTL_ROMACCESSTIME(x) ((x)<<16)
83#define SA110_CNTL_ROMBURSTTIME(x) ((x)<<20)
84#define SA110_CNTL_ROMTRISTATETIME(x) ((x)<<24)
85#define SA110_CNTL_XCSDIR(x) ((x)<<28)
86#define SA110_CNTL_PCICFN (1 << 31)
87
88/*
89 * footbridge_cfn_mode() is used when we want
90 * to check whether we are the central function
91 */
92#define __footbridge_cfn_mode() (*CSR_SA110_CNTL & SA110_CNTL_PCICFN)
93#if defined(CONFIG_FOOTBRIDGE_HOST) && defined(CONFIG_FOOTBRIDGE_ADDIN)
94#define footbridge_cfn_mode() __footbridge_cfn_mode()
95#elif defined(CONFIG_FOOTBRIDGE_HOST)
96#define footbridge_cfn_mode() (1)
97#else
98#define footbridge_cfn_mode() (0)
99#endif
100
101#define CSR_PCIADDR_EXTN DC21285_IO(0x0140)
102#define CSR_PREFETCHMEMRANGE DC21285_IO(0x0144)
103#define CSR_XBUS_CYCLE DC21285_IO(0x0148)
104#define CSR_XBUS_IOSTROBE DC21285_IO(0x014c)
105#define CSR_DOORBELL_PCI DC21285_IO(0x0150)
106#define CSR_DOORBELL_SA110 DC21285_IO(0x0154)
107#define CSR_UARTDR DC21285_IO(0x0160)
108#define CSR_RXSTAT DC21285_IO(0x0164)
109#define CSR_H_UBRLCR DC21285_IO(0x0168)
110#define CSR_M_UBRLCR DC21285_IO(0x016c)
111#define CSR_L_UBRLCR DC21285_IO(0x0170)
112#define CSR_UARTCON DC21285_IO(0x0174)
113#define CSR_UARTFLG DC21285_IO(0x0178)
114#define CSR_IRQ_STATUS DC21285_IO(0x0180)
115#define CSR_IRQ_RAWSTATUS DC21285_IO(0x0184)
116#define CSR_IRQ_ENABLE DC21285_IO(0x0188)
117#define CSR_IRQ_DISABLE DC21285_IO(0x018c)
118#define CSR_IRQ_SOFT DC21285_IO(0x0190)
119#define CSR_FIQ_STATUS DC21285_IO(0x0280)
120#define CSR_FIQ_RAWSTATUS DC21285_IO(0x0284)
121#define CSR_FIQ_ENABLE DC21285_IO(0x0288)
122#define CSR_FIQ_DISABLE DC21285_IO(0x028c)
123#define CSR_FIQ_SOFT DC21285_IO(0x0290)
124#define CSR_TIMER1_LOAD DC21285_IO(0x0300)
125#define CSR_TIMER1_VALUE DC21285_IO(0x0304)
126#define CSR_TIMER1_CNTL DC21285_IO(0x0308)
127#define CSR_TIMER1_CLR DC21285_IO(0x030c)
128#define CSR_TIMER2_LOAD DC21285_IO(0x0320)
129#define CSR_TIMER2_VALUE DC21285_IO(0x0324)
130#define CSR_TIMER2_CNTL DC21285_IO(0x0328)
131#define CSR_TIMER2_CLR DC21285_IO(0x032c)
132#define CSR_TIMER3_LOAD DC21285_IO(0x0340)
133#define CSR_TIMER3_VALUE DC21285_IO(0x0344)
134#define CSR_TIMER3_CNTL DC21285_IO(0x0348)
135#define CSR_TIMER3_CLR DC21285_IO(0x034c)
136#define CSR_TIMER4_LOAD DC21285_IO(0x0360)
137#define CSR_TIMER4_VALUE DC21285_IO(0x0364)
138#define CSR_TIMER4_CNTL DC21285_IO(0x0368)
139#define CSR_TIMER4_CLR DC21285_IO(0x036c)
140
141#define TIMER_CNTL_ENABLE (1 << 7)
142#define TIMER_CNTL_AUTORELOAD (1 << 6)
143#define TIMER_CNTL_DIV1 (0)
144#define TIMER_CNTL_DIV16 (1 << 2)
145#define TIMER_CNTL_DIV256 (2 << 2)
146#define TIMER_CNTL_CNTEXT (3 << 2)
147
148
diff --git a/include/asm-arm/hardware/entry-macro-iomd.S b/include/asm-arm/hardware/entry-macro-iomd.S
new file mode 100644
index 000000000000..30c7b92c2416
--- /dev/null
+++ b/include/asm-arm/hardware/entry-macro-iomd.S
@@ -0,0 +1,145 @@
1/*
2 * arch/arm/commond/entry-macro-iomd.S
3 *
4 * Low-level IRQ helper macros for IOC/IOMD based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11/* IOC / IOMD based hardware */
12#include <asm/hardware/iomd.h>
13
14 .equ ioc_base_high, IOC_BASE & 0xff000000
15 .equ ioc_base_low, IOC_BASE & 0x00ff0000
16 .macro disable_fiq
17 mov r12, #ioc_base_high
18 .if ioc_base_low
19 orr r12, r12, #ioc_base_low
20 .endif
21 strb r12, [r12, #0x38] @ Disable FIQ register
22 .endm
23
24 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
25 mov r4, #ioc_base_high @ point at IOC
26 .if ioc_base_low
27 orr r4, r4, #ioc_base_low
28 .endif
29 ldrb \irqstat, [r4, #IOMD_IRQREQB] @ get high priority first
30 ldr \base, =irq_prio_h
31 teq \irqstat, #0
32#ifdef IOMD_BASE
33 ldreqb \irqstat, [r4, #IOMD_DMAREQ] @ get dma
34 addeq \base, \base, #256 @ irq_prio_h table size
35 teqeq \irqstat, #0
36 bne 2406f
37#endif
38 ldreqb \irqstat, [r4, #IOMD_IRQREQA] @ get low priority
39 addeq \base, \base, #256 @ irq_prio_d table size
40 teqeq \irqstat, #0
41#ifdef IOMD_IRQREQC
42 ldreqb \irqstat, [r4, #IOMD_IRQREQC]
43 addeq \base, \base, #256 @ irq_prio_l table size
44 teqeq \irqstat, #0
45#endif
46#ifdef IOMD_IRQREQD
47 ldreqb \irqstat, [r4, #IOMD_IRQREQD]
48 addeq \base, \base, #256 @ irq_prio_lc table size
49 teqeq \irqstat, #0
50#endif
512406: ldrneb \irqnr, [\base, \irqstat] @ get IRQ number
52 .endm
53
54/*
55 * Interrupt table (incorporates priority). Please note that we
56 * rely on the order of these tables (see above code).
57 */
58 .align 5
59irq_prio_h: .byte 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
60 .byte 12, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
61 .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
62 .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
63 .byte 14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10
64 .byte 14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10
65 .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
66 .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
67 .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
68 .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
69 .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
70 .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
71 .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
72 .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
73 .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
74 .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
75#ifdef IOMD_BASE
76irq_prio_d: .byte 0,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
77 .byte 20,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
78 .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
79 .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
80 .byte 22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
81 .byte 22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
82 .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
83 .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
84 .byte 23,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
85 .byte 23,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
86 .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
87 .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
88 .byte 22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
89 .byte 22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
90 .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
91 .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
92#endif
93irq_prio_l: .byte 0, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
94 .byte 4, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
95 .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
96 .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
97 .byte 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3
98 .byte 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3
99 .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
100 .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
101 .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
102 .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
103 .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
104 .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
105 .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
106 .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
107 .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
108 .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
109#ifdef IOMD_IRQREQC
110irq_prio_lc: .byte 24,24,25,24,26,26,26,26,27,27,27,27,27,27,27,27
111 .byte 28,24,25,24,26,26,26,26,27,27,27,27,27,27,27,27
112 .byte 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
113 .byte 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
114 .byte 30,30,30,30,30,30,30,30,27,27,27,27,27,27,27,27
115 .byte 30,30,30,30,30,30,30,30,27,27,27,27,27,27,27,27
116 .byte 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
117 .byte 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
118 .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
119 .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
120 .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
121 .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
122 .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
123 .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
124 .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
125 .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
126#endif
127#ifdef IOMD_IRQREQD
128irq_prio_ld: .byte 40,40,41,40,42,42,42,42,43,43,43,43,43,43,43,43
129 .byte 44,40,41,40,42,42,42,42,43,43,43,43,43,43,43,43
130 .byte 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
131 .byte 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
132 .byte 46,46,46,46,46,46,46,46,43,43,43,43,43,43,43,43
133 .byte 46,46,46,46,46,46,46,46,43,43,43,43,43,43,43,43
134 .byte 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
135 .byte 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
136 .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
137 .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
138 .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
139 .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
140 .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
141 .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
142 .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
143 .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
144#endif
145
diff --git a/include/asm-arm/hardware/ep7211.h b/include/asm-arm/hardware/ep7211.h
new file mode 100644
index 000000000000..017aa68f612d
--- /dev/null
+++ b/include/asm-arm/hardware/ep7211.h
@@ -0,0 +1,40 @@
1/*
2 * linux/include/asm-arm/hardware/ep7211.h
3 *
4 * This file contains the hardware definitions of the EP7211 internal
5 * registers.
6 *
7 * Copyright (C) 2001 Blue Mug, Inc. All Rights Reserved.
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#ifndef __ASM_HARDWARE_EP7211_H
24#define __ASM_HARDWARE_EP7211_H
25
26#include <asm/hardware/clps7111.h>
27
28/*
29 * define EP7211_BASE to be the base address of the region
30 * you want to access.
31 */
32
33#define EP7211_PHYS_BASE (0x80000000)
34
35/*
36 * XXX miket@bluemug.com: need to introduce EP7211 registers (those not
37 * present in 7212) here.
38 */
39
40#endif /* __ASM_HARDWARE_EP7211_H */
diff --git a/include/asm-arm/hardware/ep7212.h b/include/asm-arm/hardware/ep7212.h
new file mode 100644
index 000000000000..0e952e747073
--- /dev/null
+++ b/include/asm-arm/hardware/ep7212.h
@@ -0,0 +1,83 @@
1/*
2 * linux/include/asm-arm/hardware/ep7212.h
3 *
4 * This file contains the hardware definitions of the EP7212 internal
5 * registers.
6 *
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#ifndef __ASM_HARDWARE_EP7212_H
24#define __ASM_HARDWARE_EP7212_H
25
26/*
27 * define EP7212_BASE to be the base address of the region
28 * you want to access.
29 */
30
31#define EP7212_PHYS_BASE (0x80000000)
32
33#ifndef __ASSEMBLY__
34#define ep_readl(off) __raw_readl(EP7212_BASE + (off))
35#define ep_writel(val,off) __raw_writel(val, EP7212_BASE + (off))
36#endif
37
38/*
39 * These registers are specific to the EP7212 only
40 */
41#define DAIR 0x2000
42#define DAIR0 0x2040
43#define DAIDR1 0x2080
44#define DAIDR2 0x20c0
45#define DAISR 0x2100
46#define SYSCON3 0x2200
47#define INTSR3 0x2240
48#define INTMR3 0x2280
49#define LEDFLSH 0x22c0
50
51#define DAIR_DAIEN (1 << 16)
52#define DAIR_ECS (1 << 17)
53#define DAIR_LCTM (1 << 19)
54#define DAIR_LCRM (1 << 20)
55#define DAIR_RCTM (1 << 21)
56#define DAIR_RCRM (1 << 22)
57#define DAIR_LBM (1 << 23)
58
59#define DAIDR2_FIFOEN (1 << 15)
60#define DAIDR2_FIFOLEFT (0x0d << 16)
61#define DAIDR2_FIFORIGHT (0x11 << 16)
62
63#define DAISR_RCTS (1 << 0)
64#define DAISR_RCRS (1 << 1)
65#define DAISR_LCTS (1 << 2)
66#define DAISR_LCRS (1 << 3)
67#define DAISR_RCTU (1 << 4)
68#define DAISR_RCRO (1 << 5)
69#define DAISR_LCTU (1 << 6)
70#define DAISR_LCRO (1 << 7)
71#define DAISR_RCNF (1 << 8)
72#define DAISR_RCNE (1 << 9)
73#define DAISR_LCNF (1 << 10)
74#define DAISR_LCNE (1 << 11)
75#define DAISR_FIFO (1 << 12)
76
77#define SYSCON3_ADCCON (1 << 0)
78#define SYSCON3_DAISEL (1 << 3)
79#define SYSCON3_ADCCKNSEN (1 << 4)
80#define SYSCON3_FASTWAKE (1 << 8)
81#define SYSCON3_DAIEN (1 << 9)
82
83#endif /* __ASM_HARDWARE_EP7212_H */
diff --git a/include/asm-arm/hardware/icst307.h b/include/asm-arm/hardware/icst307.h
new file mode 100644
index 000000000000..ff8618a441c0
--- /dev/null
+++ b/include/asm-arm/hardware/icst307.h
@@ -0,0 +1,38 @@
1/*
2 * linux/include/asm-arm/hardware/icst307.h
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 ICS307
11 * clock generators. See http://www.icst.com/ for more information
12 * on these devices.
13 *
14 * This file is similar to the icst525.h file
15 */
16#ifndef ASMARM_HARDWARE_ICST307_H
17#define ASMARM_HARDWARE_ICST307_H
18
19struct icst307_params {
20 unsigned long ref;
21 unsigned long vco_max; /* inclusive */
22 unsigned short vd_min; /* inclusive */
23 unsigned short vd_max; /* inclusive */
24 unsigned char rd_min; /* inclusive */
25 unsigned char rd_max; /* inclusive */
26};
27
28struct icst307_vco {
29 unsigned short v;
30 unsigned char r;
31 unsigned char s;
32};
33
34unsigned long icst307_khz(const struct icst307_params *p, struct icst307_vco vco);
35struct icst307_vco icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq);
36struct icst307_vco icst307_ps_to_vco(const struct icst307_params *p, unsigned long period);
37
38#endif
diff --git a/include/asm-arm/hardware/icst525.h b/include/asm-arm/hardware/icst525.h
new file mode 100644
index 000000000000..edd5a5704406
--- /dev/null
+++ b/include/asm-arm/hardware/icst525.h
@@ -0,0 +1,36 @@
1/*
2 * linux/include/asm-arm/hardware/icst525.h
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#ifndef ASMARM_HARDWARE_ICST525_H
15#define ASMARM_HARDWARE_ICST525_H
16
17struct icst525_params {
18 unsigned long ref;
19 unsigned long vco_max; /* inclusive */
20 unsigned short vd_min; /* inclusive */
21 unsigned short vd_max; /* inclusive */
22 unsigned char rd_min; /* inclusive */
23 unsigned char rd_max; /* inclusive */
24};
25
26struct icst525_vco {
27 unsigned short v;
28 unsigned char r;
29 unsigned char s;
30};
31
32unsigned long icst525_khz(const struct icst525_params *p, struct icst525_vco vco);
33struct icst525_vco icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq);
34struct icst525_vco icst525_ps_to_vco(const struct icst525_params *p, unsigned long period);
35
36#endif
diff --git a/include/asm-arm/hardware/ioc.h b/include/asm-arm/hardware/ioc.h
new file mode 100644
index 000000000000..b3b46ef65943
--- /dev/null
+++ b/include/asm-arm/hardware/ioc.h
@@ -0,0 +1,72 @@
1/*
2 * linux/include/asm-arm/hardware/ioc.h
3 *
4 * Copyright (C) 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 * Use these macros to read/write the IOC. All it does is perform the actual
11 * read/write.
12 */
13#ifndef __ASMARM_HARDWARE_IOC_H
14#define __ASMARM_HARDWARE_IOC_H
15
16#ifndef __ASSEMBLY__
17
18/*
19 * We use __raw_base variants here so that we give the compiler the
20 * chance to keep IOC_BASE in a register.
21 */
22#define ioc_readb(off) __raw_readb(IOC_BASE + (off))
23#define ioc_writeb(val,off) __raw_writeb(val, IOC_BASE + (off))
24
25#endif
26
27#define IOC_CONTROL (0x00)
28#define IOC_KARTTX (0x04)
29#define IOC_KARTRX (0x04)
30
31#define IOC_IRQSTATA (0x10)
32#define IOC_IRQREQA (0x14)
33#define IOC_IRQCLRA (0x14)
34#define IOC_IRQMASKA (0x18)
35
36#define IOC_IRQSTATB (0x20)
37#define IOC_IRQREQB (0x24)
38#define IOC_IRQMASKB (0x28)
39
40#define IOC_FIQSTAT (0x30)
41#define IOC_FIQREQ (0x34)
42#define IOC_FIQMASK (0x38)
43
44#define IOC_T0CNTL (0x40)
45#define IOC_T0LTCHL (0x40)
46#define IOC_T0CNTH (0x44)
47#define IOC_T0LTCHH (0x44)
48#define IOC_T0GO (0x48)
49#define IOC_T0LATCH (0x4c)
50
51#define IOC_T1CNTL (0x50)
52#define IOC_T1LTCHL (0x50)
53#define IOC_T1CNTH (0x54)
54#define IOC_T1LTCHH (0x54)
55#define IOC_T1GO (0x58)
56#define IOC_T1LATCH (0x5c)
57
58#define IOC_T2CNTL (0x60)
59#define IOC_T2LTCHL (0x60)
60#define IOC_T2CNTH (0x64)
61#define IOC_T2LTCHH (0x64)
62#define IOC_T2GO (0x68)
63#define IOC_T2LATCH (0x6c)
64
65#define IOC_T3CNTL (0x70)
66#define IOC_T3LTCHL (0x70)
67#define IOC_T3CNTH (0x74)
68#define IOC_T3LTCHH (0x74)
69#define IOC_T3GO (0x78)
70#define IOC_T3LATCH (0x7c)
71
72#endif
diff --git a/include/asm-arm/hardware/iomd.h b/include/asm-arm/hardware/iomd.h
new file mode 100644
index 000000000000..82fa2c279a18
--- /dev/null
+++ b/include/asm-arm/hardware/iomd.h
@@ -0,0 +1,227 @@
1/*
2 * linux/include/asm-arm/hardware/iomd.h
3 *
4 * Copyright (C) 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 * This file contains information out the IOMD ASIC used in the
11 * Acorn RiscPC and subsequently integrated into the CLPS7500 chips.
12 */
13#ifndef __ASMARM_HARDWARE_IOMD_H
14#define __ASMARM_HARDWARE_IOMD_H
15
16#include <linux/config.h>
17
18#ifndef __ASSEMBLY__
19
20/*
21 * We use __raw_base variants here so that we give the compiler the
22 * chance to keep IOC_BASE in a register.
23 */
24#define iomd_readb(off) __raw_readb(IOMD_BASE + (off))
25#define iomd_readl(off) __raw_readl(IOMD_BASE + (off))
26#define iomd_writeb(val,off) __raw_writeb(val, IOMD_BASE + (off))
27#define iomd_writel(val,off) __raw_writel(val, IOMD_BASE + (off))
28
29#endif
30
31#define IOMD_CONTROL (0x000)
32#define IOMD_KARTTX (0x004)
33#define IOMD_KARTRX (0x004)
34#define IOMD_KCTRL (0x008)
35
36#ifdef CONFIG_ARCH_CLPS7500
37#define IOMD_IOLINES (0x00C)
38#endif
39
40#define IOMD_IRQSTATA (0x010)
41#define IOMD_IRQREQA (0x014)
42#define IOMD_IRQCLRA (0x014)
43#define IOMD_IRQMASKA (0x018)
44
45#ifdef CONFIG_ARCH_CLPS7500
46#define IOMD_SUSMODE (0x01C)
47#endif
48
49#define IOMD_IRQSTATB (0x020)
50#define IOMD_IRQREQB (0x024)
51#define IOMD_IRQMASKB (0x028)
52
53#define IOMD_FIQSTAT (0x030)
54#define IOMD_FIQREQ (0x034)
55#define IOMD_FIQMASK (0x038)
56
57#ifdef CONFIG_ARCH_CLPS7500
58#define IOMD_CLKCTL (0x03C)
59#endif
60
61#define IOMD_T0CNTL (0x040)
62#define IOMD_T0LTCHL (0x040)
63#define IOMD_T0CNTH (0x044)
64#define IOMD_T0LTCHH (0x044)
65#define IOMD_T0GO (0x048)
66#define IOMD_T0LATCH (0x04c)
67
68#define IOMD_T1CNTL (0x050)
69#define IOMD_T1LTCHL (0x050)
70#define IOMD_T1CNTH (0x054)
71#define IOMD_T1LTCHH (0x054)
72#define IOMD_T1GO (0x058)
73#define IOMD_T1LATCH (0x05c)
74
75#ifdef CONFIG_ARCH_CLPS7500
76#define IOMD_IRQSTATC (0x060)
77#define IOMD_IRQREQC (0x064)
78#define IOMD_IRQMASKC (0x068)
79
80#define IOMD_VIDMUX (0x06c)
81
82#define IOMD_IRQSTATD (0x070)
83#define IOMD_IRQREQD (0x074)
84#define IOMD_IRQMASKD (0x078)
85#endif
86
87#define IOMD_ROMCR0 (0x080)
88#define IOMD_ROMCR1 (0x084)
89#ifdef CONFIG_ARCH_RPC
90#define IOMD_DRAMCR (0x088)
91#endif
92#define IOMD_REFCR (0x08C)
93
94#define IOMD_FSIZE (0x090)
95#define IOMD_ID0 (0x094)
96#define IOMD_ID1 (0x098)
97#define IOMD_VERSION (0x09C)
98
99#ifdef CONFIG_ARCH_RPC
100#define IOMD_MOUSEX (0x0A0)
101#define IOMD_MOUSEY (0x0A4)
102#endif
103
104#ifdef CONFIG_ARCH_CLPS7500
105#define IOMD_MSEDAT (0x0A8)
106#define IOMD_MSECTL (0x0Ac)
107#endif
108
109#ifdef CONFIG_ARCH_RPC
110#define IOMD_DMATCR (0x0C0)
111#endif
112#define IOMD_IOTCR (0x0C4)
113#define IOMD_ECTCR (0x0C8)
114#ifdef CONFIG_ARCH_RPC
115#define IOMD_DMAEXT (0x0CC)
116#endif
117#ifdef CONFIG_ARCH_CLPS7500
118#define IOMD_ASTCR (0x0CC)
119#define IOMD_DRAMCR (0x0D0)
120#define IOMD_SELFREF (0x0D4)
121#define IOMD_ATODICR (0x0E0)
122#define IOMD_ATODSR (0x0E4)
123#define IOMD_ATODCC (0x0E8)
124#define IOMD_ATODCNT1 (0x0EC)
125#define IOMD_ATODCNT2 (0x0F0)
126#define IOMD_ATODCNT3 (0x0F4)
127#define IOMD_ATODCNT4 (0x0F8)
128#endif
129
130#ifdef CONFIG_ARCH_RPC
131#define DMA_EXT_IO0 1
132#define DMA_EXT_IO1 2
133#define DMA_EXT_IO2 4
134#define DMA_EXT_IO3 8
135
136#define IOMD_IO0CURA (0x100)
137#define IOMD_IO0ENDA (0x104)
138#define IOMD_IO0CURB (0x108)
139#define IOMD_IO0ENDB (0x10C)
140#define IOMD_IO0CR (0x110)
141#define IOMD_IO0ST (0x114)
142
143#define IOMD_IO1CURA (0x120)
144#define IOMD_IO1ENDA (0x124)
145#define IOMD_IO1CURB (0x128)
146#define IOMD_IO1ENDB (0x12C)
147#define IOMD_IO1CR (0x130)
148#define IOMD_IO1ST (0x134)
149
150#define IOMD_IO2CURA (0x140)
151#define IOMD_IO2ENDA (0x144)
152#define IOMD_IO2CURB (0x148)
153#define IOMD_IO2ENDB (0x14C)
154#define IOMD_IO2CR (0x150)
155#define IOMD_IO2ST (0x154)
156
157#define IOMD_IO3CURA (0x160)
158#define IOMD_IO3ENDA (0x164)
159#define IOMD_IO3CURB (0x168)
160#define IOMD_IO3ENDB (0x16C)
161#define IOMD_IO3CR (0x170)
162#define IOMD_IO3ST (0x174)
163#endif
164
165#define IOMD_SD0CURA (0x180)
166#define IOMD_SD0ENDA (0x184)
167#define IOMD_SD0CURB (0x188)
168#define IOMD_SD0ENDB (0x18C)
169#define IOMD_SD0CR (0x190)
170#define IOMD_SD0ST (0x194)
171
172#ifdef CONFIG_ARCH_RPC
173#define IOMD_SD1CURA (0x1A0)
174#define IOMD_SD1ENDA (0x1A4)
175#define IOMD_SD1CURB (0x1A8)
176#define IOMD_SD1ENDB (0x1AC)
177#define IOMD_SD1CR (0x1B0)
178#define IOMD_SD1ST (0x1B4)
179#endif
180
181#define IOMD_CURSCUR (0x1C0)
182#define IOMD_CURSINIT (0x1C4)
183
184#define IOMD_VIDCUR (0x1D0)
185#define IOMD_VIDEND (0x1D4)
186#define IOMD_VIDSTART (0x1D8)
187#define IOMD_VIDINIT (0x1DC)
188#define IOMD_VIDCR (0x1E0)
189
190#define IOMD_DMASTAT (0x1F0)
191#define IOMD_DMAREQ (0x1F4)
192#define IOMD_DMAMASK (0x1F8)
193
194#define DMA_END_S (1 << 31)
195#define DMA_END_L (1 << 30)
196
197#define DMA_CR_C 0x80
198#define DMA_CR_D 0x40
199#define DMA_CR_E 0x20
200
201#define DMA_ST_OFL 4
202#define DMA_ST_INT 2
203#define DMA_ST_AB 1
204
205/*
206 * DMA (MEMC) compatibility
207 */
208#define HALF_SAM vram_half_sam
209#define VDMA_ALIGNMENT (HALF_SAM * 2)
210#define VDMA_XFERSIZE (HALF_SAM)
211#define VDMA_INIT IOMD_VIDINIT
212#define VDMA_START IOMD_VIDSTART
213#define VDMA_END IOMD_VIDEND
214
215#ifndef __ASSEMBLY__
216extern unsigned int vram_half_sam;
217#define video_set_dma(start,end,offset) \
218do { \
219 outl (SCREEN_START + start, VDMA_START); \
220 outl (SCREEN_START + end - VDMA_XFERSIZE, VDMA_END); \
221 if (offset >= end - VDMA_XFERSIZE) \
222 offset |= 0x40000000; \
223 outl (SCREEN_START + offset, VDMA_INIT); \
224} while (0)
225#endif
226
227#endif
diff --git a/include/asm-arm/hardware/linkup-l1110.h b/include/asm-arm/hardware/linkup-l1110.h
new file mode 100644
index 000000000000..7ec91168a576
--- /dev/null
+++ b/include/asm-arm/hardware/linkup-l1110.h
@@ -0,0 +1,48 @@
1/*
2*
3* Definitions for H3600 Handheld Computer
4*
5* Copyright 2001 Compaq Computer Corporation.
6*
7* Use consistent with the GNU GPL is permitted,
8* provided that this copyright notice is
9* preserved in its entirety in all copies and derived works.
10*
11* COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
12* AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
13* FITNESS FOR ANY PARTICULAR PURPOSE.
14*
15* Author: Jamey Hicks.
16*
17*/
18
19/* LinkUp Systems PCCard/CompactFlash Interface for SA-1100 */
20
21/* PC Card Status Register */
22#define LINKUP_PRS_S1 (1 << 0) /* voltage control bits S1-S4 */
23#define LINKUP_PRS_S2 (1 << 1)
24#define LINKUP_PRS_S3 (1 << 2)
25#define LINKUP_PRS_S4 (1 << 3)
26#define LINKUP_PRS_BVD1 (1 << 4)
27#define LINKUP_PRS_BVD2 (1 << 5)
28#define LINKUP_PRS_VS1 (1 << 6)
29#define LINKUP_PRS_VS2 (1 << 7)
30#define LINKUP_PRS_RDY (1 << 8)
31#define LINKUP_PRS_CD1 (1 << 9)
32#define LINKUP_PRS_CD2 (1 << 10)
33
34/* PC Card Command Register */
35#define LINKUP_PRC_S1 (1 << 0)
36#define LINKUP_PRC_S2 (1 << 1)
37#define LINKUP_PRC_S3 (1 << 2)
38#define LINKUP_PRC_S4 (1 << 3)
39#define LINKUP_PRC_RESET (1 << 4)
40#define LINKUP_PRC_APOE (1 << 5) /* Auto Power Off Enable: clears S1-S4 when either nCD goes high */
41#define LINKUP_PRC_CFE (1 << 6) /* CompactFlash mode Enable: addresses A[10:0] only, A[25:11] high */
42#define LINKUP_PRC_SOE (1 << 7) /* signal output driver enable */
43#define LINKUP_PRC_SSP (1 << 8) /* sock select polarity: 0 for socket 0, 1 for socket 1 */
44#define LINKUP_PRC_MBZ (1 << 15) /* must be zero */
45
46struct linkup_l1110 {
47 volatile short prc;
48};
diff --git a/include/asm-arm/hardware/locomo.h b/include/asm-arm/hardware/locomo.h
new file mode 100644
index 000000000000..5f10048ec54e
--- /dev/null
+++ b/include/asm-arm/hardware/locomo.h
@@ -0,0 +1,206 @@
1/*
2 * linux/include/asm-arm/hardware/locomo.h
3 *
4 * This file contains the definitions for the LoCoMo G/A Chip
5 *
6 * (C) Copyright 2004 John Lenz
7 *
8 * May be copied or modified under the terms of the GNU General Public
9 * License. See linux/COPYING for more information.
10 *
11 * Based on sa1111.h
12 */
13#ifndef _ASM_ARCH_LOCOMO
14#define _ASM_ARCH_LOCOMO
15
16#define locomo_writel(val,addr) ({ *(volatile u16 *)(addr) = (val); })
17#define locomo_readl(addr) (*(volatile u16 *)(addr))
18
19/* LOCOMO version */
20#define LOCOMO_VER 0x00
21
22/* Pin status */
23#define LOCOMO_ST 0x04
24
25/* Pin status */
26#define LOCOMO_C32K 0x08
27
28/* Interrupt controller */
29#define LOCOMO_ICR 0x0C
30
31/* MCS decoder for boot selecting */
32#define LOCOMO_MCSX0 0x10
33#define LOCOMO_MCSX1 0x14
34#define LOCOMO_MCSX2 0x18
35#define LOCOMO_MCSX3 0x1c
36
37/* Touch panel controller */
38#define LOCOMO_ASD 0x20 /* AD start delay */
39#define LOCOMO_HSD 0x28 /* HSYS delay */
40#define LOCOMO_HSC 0x2c /* HSYS period */
41#define LOCOMO_TADC 0x30 /* tablet ADC clock */
42
43
44/* Long time timer */
45#define LOCOMO_LTC 0xd8 /* LTC interrupt setting */
46#define LOCOMO_LTINT 0xdc /* LTC interrupt */
47
48/* DAC control signal for LCD (COMADJ ) */
49#define LOCOMO_DAC 0xe0
50/* DAC control */
51#define LOCOMO_DAC_SCLOEB 0x08 /* SCL pin output data */
52#define LOCOMO_DAC_TEST 0x04 /* Test bit */
53#define LOCOMO_DAC_SDA 0x02 /* SDA pin level (read-only) */
54#define LOCOMO_DAC_SDAOEB 0x01 /* SDA pin output data */
55
56/* SPI interface */
57#define LOCOMO_SPIMD 0x60 /* SPI mode setting */
58#define LOCOMO_SPICT 0x64 /* SPI mode control */
59#define LOCOMO_SPIST 0x68 /* SPI status */
60#define LOCOMO_SPIIS 0x70 /* SPI interrupt status */
61#define LOCOMO_SPIWE 0x74 /* SPI interrupt status write enable */
62#define LOCOMO_SPIIE 0x78 /* SPI interrupt enable */
63#define LOCOMO_SPIIR 0x7c /* SPI interrupt request */
64#define LOCOMO_SPITD 0x80 /* SPI transfer data write */
65#define LOCOMO_SPIRD 0x84 /* SPI receive data read */
66#define LOCOMO_SPITS 0x88 /* SPI transfer data shift */
67#define LOCOMO_SPIRS 0x8C /* SPI receive data shift */
68#define LOCOMO_SPI_TEND (1 << 3) /* Transfer end bit */
69#define LOCOMO_SPI_OVRN (1 << 2) /* Over Run bit */
70#define LOCOMO_SPI_RFW (1 << 1) /* write buffer bit */
71#define LOCOMO_SPI_RFR (1) /* read buffer bit */
72
73/* GPIO */
74#define LOCOMO_GPD 0x90 /* GPIO direction */
75#define LOCOMO_GPE 0x94 /* GPIO input enable */
76#define LOCOMO_GPL 0x98 /* GPIO level */
77#define LOCOMO_GPO 0x9c /* GPIO out data setteing */
78#define LOCOMO_GRIE 0xa0 /* GPIO rise detection */
79#define LOCOMO_GFIE 0xa4 /* GPIO fall detection */
80#define LOCOMO_GIS 0xa8 /* GPIO edge detection status */
81#define LOCOMO_GWE 0xac /* GPIO status write enable */
82#define LOCOMO_GIE 0xb0 /* GPIO interrupt enable */
83#define LOCOMO_GIR 0xb4 /* GPIO interrupt request */
84#define LOCOMO_GPIO(Nb) (0x01 << (Nb))
85#define LOCOMO_GPIO_RTS LOCOMO_GPIO(0)
86#define LOCOMO_GPIO_CTS LOCOMO_GPIO(1)
87#define LOCOMO_GPIO_DSR LOCOMO_GPIO(2)
88#define LOCOMO_GPIO_DTR LOCOMO_GPIO(3)
89#define LOCOMO_GPIO_LCD_VSHA_ON LOCOMO_GPIO(4)
90#define LOCOMO_GPIO_LCD_VSHD_ON LOCOMO_GPIO(5)
91#define LOCOMO_GPIO_LCD_VEE_ON LOCOMO_GPIO(6)
92#define LOCOMO_GPIO_LCD_MOD LOCOMO_GPIO(7)
93#define LOCOMO_GPIO_DAC_ON LOCOMO_GPIO(8)
94#define LOCOMO_GPIO_FL_VR LOCOMO_GPIO(9)
95#define LOCOMO_GPIO_DAC_SDATA LOCOMO_GPIO(10)
96#define LOCOMO_GPIO_DAC_SCK LOCOMO_GPIO(11)
97#define LOCOMO_GPIO_DAC_SLOAD LOCOMO_GPIO(12)
98
99/* Start the definitions of the devices. Each device has an initial
100 * base address and a series of offsets from that base address. */
101
102/* Keyboard controller */
103#define LOCOMO_KEYBOARD 0x40
104#define LOCOMO_KIB 0x00 /* KIB level */
105#define LOCOMO_KSC 0x04 /* KSTRB control */
106#define LOCOMO_KCMD 0x08 /* KSTRB command */
107#define LOCOMO_KIC 0x0c /* Key interrupt */
108
109/* Front light adjustment controller */
110#define LOCOMO_FRONTLIGHT 0xc8
111#define LOCOMO_ALS 0x00 /* Adjust light cycle */
112#define LOCOMO_ALD 0x04 /* Adjust light duty */
113
114/* Backlight controller: TFT signal */
115#define LOCOMO_BACKLIGHT 0x38
116#define LOCOMO_TC 0x00 /* TFT control signal */
117#define LOCOMO_CPSD 0x04 /* CPS delay */
118
119/* Audio controller */
120#define LOCOMO_AUDIO 0x54
121#define LOCOMO_ACC 0x00 /* Audio clock */
122#define LOCOMO_PAIF 0x7C /* PCM audio interface */
123/* Audio clock */
124#define LOCOMO_ACC_XON 0x80
125#define LOCOMO_ACC_XEN 0x40
126#define LOCOMO_ACC_XSEL0 0x00
127#define LOCOMO_ACC_XSEL1 0x20
128#define LOCOMO_ACC_MCLKEN 0x10
129#define LOCOMO_ACC_64FSEN 0x08
130#define LOCOMO_ACC_CLKSEL000 0x00 /* mclk 2 */
131#define LOCOMO_ACC_CLKSEL001 0x01 /* mclk 3 */
132#define LOCOMO_ACC_CLKSEL010 0x02 /* mclk 4 */
133#define LOCOMO_ACC_CLKSEL011 0x03 /* mclk 6 */
134#define LOCOMO_ACC_CLKSEL100 0x04 /* mclk 8 */
135#define LOCOMO_ACC_CLKSEL101 0x05 /* mclk 12 */
136/* PCM audio interface */
137#define LOCOMO_PAIF_SCINV 0x20
138#define LOCOMO_PAIF_SCEN 0x10
139#define LOCOMO_PAIF_LRCRST 0x08
140#define LOCOMO_PAIF_LRCEVE 0x04
141#define LOCOMO_PAIF_LRCINV 0x02
142#define LOCOMO_PAIF_LRCEN 0x01
143
144/* LED controller */
145#define LOCOMO_LED 0xe8
146#define LOCOMO_LPT0 0x00
147#define LOCOMO_LPT1 0x04
148/* LED control */
149#define LOCOMO_LPT_TOFH 0x80
150#define LOCOMO_LPT_TOFL 0x08
151#define LOCOMO_LPT_TOH(TOH) ((TOH & 0x7) << 4)
152#define LOCOMO_LPT_TOL(TOL) ((TOL & 0x7))
153
154extern struct bus_type locomo_bus_type;
155
156#define LOCOMO_DEVID_KEYBOARD 0
157#define LOCOMO_DEVID_FRONTLIGHT 1
158#define LOCOMO_DEVID_BACKLIGHT 2
159#define LOCOMO_DEVID_AUDIO 3
160#define LOCOMO_DEVID_LED 4
161#define LOCOMO_DEVID_UART 5
162
163struct locomo_dev {
164 struct device dev;
165 unsigned int devid;
166 unsigned int irq[1];
167
168 void *mapbase;
169 unsigned long length;
170
171 u64 dma_mask;
172};
173
174#define LOCOMO_DEV(_d) container_of((_d), struct locomo_dev, dev)
175
176#define locomo_get_drvdata(d) dev_get_drvdata(&(d)->dev)
177#define locomo_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, p)
178
179struct locomo_driver {
180 struct device_driver drv;
181 unsigned int devid;
182 int (*probe)(struct locomo_dev *);
183 int (*remove)(struct locomo_dev *);
184 int (*suspend)(struct locomo_dev *, pm_message_t);
185 int (*resume)(struct locomo_dev *);
186};
187
188#define LOCOMO_DRV(_d) container_of((_d), struct locomo_driver, drv)
189
190#define LOCOMO_DRIVER_NAME(_ldev) ((_ldev)->dev.driver->name)
191
192void locomo_lcd_power(struct locomo_dev *, int, unsigned int);
193
194int locomo_driver_register(struct locomo_driver *);
195void locomo_driver_unregister(struct locomo_driver *);
196
197/* GPIO control functions */
198void locomo_gpio_set_dir(struct locomo_dev *ldev, unsigned int bits, unsigned int dir);
199unsigned int locomo_gpio_read_level(struct locomo_dev *ldev, unsigned int bits);
200unsigned int locomo_gpio_read_output(struct locomo_dev *ldev, unsigned int bits);
201void locomo_gpio_write(struct locomo_dev *ldev, unsigned int bits, unsigned int set);
202
203/* M62332 control function */
204void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int channel);
205
206#endif
diff --git a/include/asm-arm/hardware/memc.h b/include/asm-arm/hardware/memc.h
new file mode 100644
index 000000000000..8aef5aa0e01b
--- /dev/null
+++ b/include/asm-arm/hardware/memc.h
@@ -0,0 +1,26 @@
1/*
2 * linux/include/asm-arm/hardware/memc.h
3 *
4 * Copyright (C) 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#define VDMA_ALIGNMENT PAGE_SIZE
11#define VDMA_XFERSIZE 16
12#define VDMA_INIT 0
13#define VDMA_START 1
14#define VDMA_END 2
15
16#ifndef __ASSEMBLY__
17extern void memc_write(unsigned int reg, unsigned long val);
18
19#define video_set_dma(start,end,offset) \
20do { \
21 memc_write (VDMA_START, (start >> 2)); \
22 memc_write (VDMA_END, (end - VDMA_XFERSIZE) >> 2); \
23 memc_write (VDMA_INIT, (offset >> 2)); \
24} while (0)
25
26#endif
diff --git a/include/asm-arm/hardware/pci_v3.h b/include/asm-arm/hardware/pci_v3.h
new file mode 100644
index 000000000000..4d497bdb9a97
--- /dev/null
+++ b/include/asm-arm/hardware/pci_v3.h
@@ -0,0 +1,186 @@
1/*
2 * linux/include/asm-arm/hardware/pci_v3.h
3 *
4 * Internal header file PCI V3 chip
5 *
6 * Copyright (C) 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#ifndef ASM_ARM_HARDWARE_PCI_V3_H
24#define ASM_ARM_HARDWARE_PCI_V3_H
25
26/* -------------------------------------------------------------------------------
27 * V3 Local Bus to PCI Bridge definitions
28 * -------------------------------------------------------------------------------
29 * Registers (these are taken from page 129 of the EPC User's Manual Rev 1.04
30 * All V3 register names are prefaced by V3_ to avoid clashing with any other
31 * PCI definitions. Their names match the user's manual.
32 *
33 * I'm assuming that I20 is disabled.
34 *
35 */
36#define V3_PCI_VENDOR 0x00000000
37#define V3_PCI_DEVICE 0x00000002
38#define V3_PCI_CMD 0x00000004
39#define V3_PCI_STAT 0x00000006
40#define V3_PCI_CC_REV 0x00000008
41#define V3_PCI_HDR_CFG 0x0000000C
42#define V3_PCI_IO_BASE 0x00000010
43#define V3_PCI_BASE0 0x00000014
44#define V3_PCI_BASE1 0x00000018
45#define V3_PCI_SUB_VENDOR 0x0000002C
46#define V3_PCI_SUB_ID 0x0000002E
47#define V3_PCI_ROM 0x00000030
48#define V3_PCI_BPARAM 0x0000003C
49#define V3_PCI_MAP0 0x00000040
50#define V3_PCI_MAP1 0x00000044
51#define V3_PCI_INT_STAT 0x00000048
52#define V3_PCI_INT_CFG 0x0000004C
53#define V3_LB_BASE0 0x00000054
54#define V3_LB_BASE1 0x00000058
55#define V3_LB_MAP0 0x0000005E
56#define V3_LB_MAP1 0x00000062
57#define V3_LB_BASE2 0x00000064
58#define V3_LB_MAP2 0x00000066
59#define V3_LB_SIZE 0x00000068
60#define V3_LB_IO_BASE 0x0000006E
61#define V3_FIFO_CFG 0x00000070
62#define V3_FIFO_PRIORITY 0x00000072
63#define V3_FIFO_STAT 0x00000074
64#define V3_LB_ISTAT 0x00000076
65#define V3_LB_IMASK 0x00000077
66#define V3_SYSTEM 0x00000078
67#define V3_LB_CFG 0x0000007A
68#define V3_PCI_CFG 0x0000007C
69#define V3_DMA_PCI_ADR0 0x00000080
70#define V3_DMA_PCI_ADR1 0x00000090
71#define V3_DMA_LOCAL_ADR0 0x00000084
72#define V3_DMA_LOCAL_ADR1 0x00000094
73#define V3_DMA_LENGTH0 0x00000088
74#define V3_DMA_LENGTH1 0x00000098
75#define V3_DMA_CSR0 0x0000008B
76#define V3_DMA_CSR1 0x0000009B
77#define V3_DMA_CTLB_ADR0 0x0000008C
78#define V3_DMA_CTLB_ADR1 0x0000009C
79#define V3_DMA_DELAY 0x000000E0
80#define V3_MAIL_DATA 0x000000C0
81#define V3_PCI_MAIL_IEWR 0x000000D0
82#define V3_PCI_MAIL_IERD 0x000000D2
83#define V3_LB_MAIL_IEWR 0x000000D4
84#define V3_LB_MAIL_IERD 0x000000D6
85#define V3_MAIL_WR_STAT 0x000000D8
86#define V3_MAIL_RD_STAT 0x000000DA
87#define V3_QBA_MAP 0x000000DC
88
89/* PCI COMMAND REGISTER bits
90 */
91#define V3_COMMAND_M_FBB_EN (1 << 9)
92#define V3_COMMAND_M_SERR_EN (1 << 8)
93#define V3_COMMAND_M_PAR_EN (1 << 6)
94#define V3_COMMAND_M_MASTER_EN (1 << 2)
95#define V3_COMMAND_M_MEM_EN (1 << 1)
96#define V3_COMMAND_M_IO_EN (1 << 0)
97
98/* SYSTEM REGISTER bits
99 */
100#define V3_SYSTEM_M_RST_OUT (1 << 15)
101#define V3_SYSTEM_M_LOCK (1 << 14)
102
103/* PCI_CFG bits
104 */
105#define V3_PCI_CFG_M_I2O_EN (1 << 15)
106#define V3_PCI_CFG_M_IO_REG_DIS (1 << 14)
107#define V3_PCI_CFG_M_IO_DIS (1 << 13)
108#define V3_PCI_CFG_M_EN3V (1 << 12)
109#define V3_PCI_CFG_M_RETRY_EN (1 << 10)
110#define V3_PCI_CFG_M_AD_LOW1 (1 << 9)
111#define V3_PCI_CFG_M_AD_LOW0 (1 << 8)
112
113/* PCI_BASE register bits (PCI -> Local Bus)
114 */
115#define V3_PCI_BASE_M_ADR_BASE 0xFFF00000
116#define V3_PCI_BASE_M_ADR_BASEL 0x000FFF00
117#define V3_PCI_BASE_M_PREFETCH (1 << 3)
118#define V3_PCI_BASE_M_TYPE (3 << 1)
119#define V3_PCI_BASE_M_IO (1 << 0)
120
121/* PCI MAP register bits (PCI -> Local bus)
122 */
123#define V3_PCI_MAP_M_MAP_ADR 0xFFF00000
124#define V3_PCI_MAP_M_RD_POST_INH (1 << 15)
125#define V3_PCI_MAP_M_ROM_SIZE (3 << 10)
126#define V3_PCI_MAP_M_SWAP (3 << 8)
127#define V3_PCI_MAP_M_ADR_SIZE 0x000000F0
128#define V3_PCI_MAP_M_REG_EN (1 << 1)
129#define V3_PCI_MAP_M_ENABLE (1 << 0)
130
131/*
132 * LB_BASE0,1 register bits (Local bus -> PCI)
133 */
134#define V3_LB_BASE_ADR_BASE 0xfff00000
135#define V3_LB_BASE_SWAP (3 << 8)
136#define V3_LB_BASE_ADR_SIZE (15 << 4)
137#define V3_LB_BASE_PREFETCH (1 << 3)
138#define V3_LB_BASE_ENABLE (1 << 0)
139
140#define V3_LB_BASE_ADR_SIZE_1MB (0 << 4)
141#define V3_LB_BASE_ADR_SIZE_2MB (1 << 4)
142#define V3_LB_BASE_ADR_SIZE_4MB (2 << 4)
143#define V3_LB_BASE_ADR_SIZE_8MB (3 << 4)
144#define V3_LB_BASE_ADR_SIZE_16MB (4 << 4)
145#define V3_LB_BASE_ADR_SIZE_32MB (5 << 4)
146#define V3_LB_BASE_ADR_SIZE_64MB (6 << 4)
147#define V3_LB_BASE_ADR_SIZE_128MB (7 << 4)
148#define V3_LB_BASE_ADR_SIZE_256MB (8 << 4)
149#define V3_LB_BASE_ADR_SIZE_512MB (9 << 4)
150#define V3_LB_BASE_ADR_SIZE_1GB (10 << 4)
151#define V3_LB_BASE_ADR_SIZE_2GB (11 << 4)
152
153#define v3_addr_to_lb_base(a) ((a) & V3_LB_BASE_ADR_BASE)
154
155/*
156 * LB_MAP0,1 register bits (Local bus -> PCI)
157 */
158#define V3_LB_MAP_MAP_ADR 0xfff0
159#define V3_LB_MAP_TYPE (7 << 1)
160#define V3_LB_MAP_AD_LOW_EN (1 << 0)
161
162#define V3_LB_MAP_TYPE_IACK (0 << 1)
163#define V3_LB_MAP_TYPE_IO (1 << 1)
164#define V3_LB_MAP_TYPE_MEM (3 << 1)
165#define V3_LB_MAP_TYPE_CONFIG (5 << 1)
166#define V3_LB_MAP_TYPE_MEM_MULTIPLE (6 << 1)
167
168#define v3_addr_to_lb_map(a) (((a) >> 16) & V3_LB_MAP_MAP_ADR)
169
170/*
171 * LB_BASE2 register bits (Local bus -> PCI IO)
172 */
173#define V3_LB_BASE2_ADR_BASE 0xff00
174#define V3_LB_BASE2_SWAP (3 << 6)
175#define V3_LB_BASE2_ENABLE (1 << 0)
176
177#define v3_addr_to_lb_base2(a) (((a) >> 16) & V3_LB_BASE2_ADR_BASE)
178
179/*
180 * LB_MAP2 register bits (Local bus -> PCI IO)
181 */
182#define V3_LB_MAP2_MAP_ADR 0xff00
183
184#define v3_addr_to_lb_map2(a) (((a) >> 16) & V3_LB_MAP2_MAP_ADR)
185
186#endif
diff --git a/include/asm-arm/hardware/sa1111.h b/include/asm-arm/hardware/sa1111.h
new file mode 100644
index 000000000000..319aea064c36
--- /dev/null
+++ b/include/asm-arm/hardware/sa1111.h
@@ -0,0 +1,602 @@
1/*
2 * linux/include/asm-arm/hardware/SA-1111.h
3 *
4 * Copyright (C) 2000 John G Dorsey <john+@cs.cmu.edu>
5 *
6 * This file contains definitions for the SA-1111 Companion Chip.
7 * (Structure and naming borrowed from SA-1101.h, by Peter Danielsson.)
8 *
9 * Macro that calculates real address for registers in the SA-1111
10 */
11
12#ifndef _ASM_ARCH_SA1111
13#define _ASM_ARCH_SA1111
14
15#include <asm/arch/bitfield.h>
16
17/*
18 * The SA1111 is always located at virtual 0xf4000000, and is always
19 * "native" endian.
20 */
21
22#define SA1111_VBASE 0xf4000000
23
24/* Don't use these! */
25#define SA1111_p2v( x ) ((x) - SA1111_BASE + SA1111_VBASE)
26#define SA1111_v2p( x ) ((x) - SA1111_VBASE + SA1111_BASE)
27
28#ifndef __ASSEMBLY__
29#define _SA1111(x) ((x) + sa1111->resource.start)
30#endif
31
32/*
33 * 26 bits of the SA-1110 address bus are available to the SA-1111.
34 * Use these when feeding target addresses to the DMA engines.
35 */
36
37#define SA1111_ADDR_WIDTH (26)
38#define SA1111_ADDR_MASK ((1<<SA1111_ADDR_WIDTH)-1)
39#define SA1111_DMA_ADDR(x) ((x)&SA1111_ADDR_MASK)
40
41/*
42 * Don't ask the (SAC) DMA engines to move less than this amount.
43 */
44
45#define SA1111_SAC_DMA_MIN_XFER (0x800)
46
47/*
48 * SA1111 register definitions.
49 */
50#define __CCREG(x) __REGP(SA1111_VBASE + (x))
51
52#define sa1111_writel(val,addr) __raw_writel(val, addr)
53#define sa1111_readl(addr) __raw_readl(addr)
54
55/*
56 * System Bus Interface (SBI)
57 *
58 * Registers
59 * SKCR Control Register
60 * SMCR Shared Memory Controller Register
61 * SKID ID Register
62 */
63#define SA1111_SKCR 0x0000
64#define SA1111_SMCR 0x0004
65#define SA1111_SKID 0x0008
66
67#define SKCR_PLL_BYPASS (1<<0)
68#define SKCR_RCLKEN (1<<1)
69#define SKCR_SLEEP (1<<2)
70#define SKCR_DOZE (1<<3)
71#define SKCR_VCO_OFF (1<<4)
72#define SKCR_SCANTSTEN (1<<5)
73#define SKCR_CLKTSTEN (1<<6)
74#define SKCR_RDYEN (1<<7)
75#define SKCR_SELAC (1<<8)
76#define SKCR_OPPC (1<<9)
77#define SKCR_PLLTSTEN (1<<10)
78#define SKCR_USBIOTSTEN (1<<11)
79/*
80 * Don't believe the specs! Take them, throw them outside. Leave them
81 * there for a week. Spit on them. Walk on them. Stamp on them.
82 * Pour gasoline over them and finally burn them. Now think about coding.
83 * - The October 1999 errata (278260-007) says its bit 13, 1 to enable.
84 * - The Feb 2001 errata (278260-010) says that the previous errata
85 * (278260-009) is wrong, and its bit actually 12, fixed in spec
86 * 278242-003.
87 * - The SA1111 manual (278242) says bit 12, but 0 to enable.
88 * - Reality is bit 13, 1 to enable.
89 * -- rmk
90 */
91#define SKCR_OE_EN (1<<13)
92
93#define SMCR_DTIM (1<<0)
94#define SMCR_MBGE (1<<1)
95#define SMCR_DRAC_0 (1<<2)
96#define SMCR_DRAC_1 (1<<3)
97#define SMCR_DRAC_2 (1<<4)
98#define SMCR_DRAC Fld(3, 2)
99#define SMCR_CLAT (1<<5)
100
101#define SKID_SIREV_MASK (0x000000f0)
102#define SKID_MTREV_MASK (0x0000000f)
103#define SKID_ID_MASK (0xffffff00)
104#define SKID_SA1111_ID (0x690cc200)
105
106/*
107 * System Controller
108 *
109 * Registers
110 * SKPCR Power Control Register
111 * SKCDR Clock Divider Register
112 * SKAUD Audio Clock Divider Register
113 * SKPMC PS/2 Mouse Clock Divider Register
114 * SKPTC PS/2 Track Pad Clock Divider Register
115 * SKPEN0 PWM0 Enable Register
116 * SKPWM0 PWM0 Clock Register
117 * SKPEN1 PWM1 Enable Register
118 * SKPWM1 PWM1 Clock Register
119 */
120#define SA1111_SKPCR 0x0200
121#define SA1111_SKCDR 0x0204
122#define SA1111_SKAUD 0x0208
123#define SA1111_SKPMC 0x020c
124#define SA1111_SKPTC 0x0210
125#define SA1111_SKPEN0 0x0214
126#define SA1111_SKPWM0 0x0218
127#define SA1111_SKPEN1 0x021c
128#define SA1111_SKPWM1 0x0220
129
130#define SKPCR_UCLKEN (1<<0)
131#define SKPCR_ACCLKEN (1<<1)
132#define SKPCR_I2SCLKEN (1<<2)
133#define SKPCR_L3CLKEN (1<<3)
134#define SKPCR_SCLKEN (1<<4)
135#define SKPCR_PMCLKEN (1<<5)
136#define SKPCR_PTCLKEN (1<<6)
137#define SKPCR_DCLKEN (1<<7)
138#define SKPCR_PWMCLKEN (1<<8)
139
140/*
141 * USB Host controller
142 */
143#define SA1111_USB 0x0400
144
145/*
146 * Offsets from SA1111_USB_BASE
147 */
148#define SA1111_USB_STATUS 0x0118
149#define SA1111_USB_RESET 0x011c
150#define SA1111_USB_IRQTEST 0x0120
151
152#define USB_RESET_FORCEIFRESET (1 << 0)
153#define USB_RESET_FORCEHCRESET (1 << 1)
154#define USB_RESET_CLKGENRESET (1 << 2)
155#define USB_RESET_SIMSCALEDOWN (1 << 3)
156#define USB_RESET_USBINTTEST (1 << 4)
157#define USB_RESET_SLEEPSTBYEN (1 << 5)
158#define USB_RESET_PWRSENSELOW (1 << 6)
159#define USB_RESET_PWRCTRLLOW (1 << 7)
160
161#define USB_STATUS_IRQHCIRMTWKUP (1 << 7)
162#define USB_STATUS_IRQHCIBUFFACC (1 << 8)
163#define USB_STATUS_NIRQHCIM (1 << 9)
164#define USB_STATUS_NHCIMFCLR (1 << 10)
165#define USB_STATUS_USBPWRSENSE (1 << 11)
166
167/*
168 * Serial Audio Controller
169 *
170 * Registers
171 * SACR0 Serial Audio Common Control Register
172 * SACR1 Serial Audio Alternate Mode (I2C/MSB) Control Register
173 * SACR2 Serial Audio AC-link Control Register
174 * SASR0 Serial Audio I2S/MSB Interface & FIFO Status Register
175 * SASR1 Serial Audio AC-link Interface & FIFO Status Register
176 * SASCR Serial Audio Status Clear Register
177 * L3_CAR L3 Control Bus Address Register
178 * L3_CDR L3 Control Bus Data Register
179 * ACCAR AC-link Command Address Register
180 * ACCDR AC-link Command Data Register
181 * ACSAR AC-link Status Address Register
182 * ACSDR AC-link Status Data Register
183 * SADTCS Serial Audio DMA Transmit Control/Status Register
184 * SADTSA Serial Audio DMA Transmit Buffer Start Address A
185 * SADTCA Serial Audio DMA Transmit Buffer Count Register A
186 * SADTSB Serial Audio DMA Transmit Buffer Start Address B
187 * SADTCB Serial Audio DMA Transmit Buffer Count Register B
188 * SADRCS Serial Audio DMA Receive Control/Status Register
189 * SADRSA Serial Audio DMA Receive Buffer Start Address A
190 * SADRCA Serial Audio DMA Receive Buffer Count Register A
191 * SADRSB Serial Audio DMA Receive Buffer Start Address B
192 * SADRCB Serial Audio DMA Receive Buffer Count Register B
193 * SAITR Serial Audio Interrupt Test Register
194 * SADR Serial Audio Data Register (16 x 32-bit)
195 */
196
197#define _SACR0 _SA1111( 0x0600 )
198#define _SACR1 _SA1111( 0x0604 )
199#define _SACR2 _SA1111( 0x0608 )
200#define _SASR0 _SA1111( 0x060c )
201#define _SASR1 _SA1111( 0x0610 )
202#define _SASCR _SA1111( 0x0618 )
203#define _L3_CAR _SA1111( 0x061c )
204#define _L3_CDR _SA1111( 0x0620 )
205#define _ACCAR _SA1111( 0x0624 )
206#define _ACCDR _SA1111( 0x0628 )
207#define _ACSAR _SA1111( 0x062c )
208#define _ACSDR _SA1111( 0x0630 )
209#define _SADTCS _SA1111( 0x0634 )
210#define _SADTSA _SA1111( 0x0638 )
211#define _SADTCA _SA1111( 0x063c )
212#define _SADTSB _SA1111( 0x0640 )
213#define _SADTCB _SA1111( 0x0644 )
214#define _SADRCS _SA1111( 0x0648 )
215#define _SADRSA _SA1111( 0x064c )
216#define _SADRCA _SA1111( 0x0650 )
217#define _SADRSB _SA1111( 0x0654 )
218#define _SADRCB _SA1111( 0x0658 )
219#define _SAITR _SA1111( 0x065c )
220#define _SADR _SA1111( 0x0680 )
221
222#define SACR0 __CCREG(0x0600)
223#define SACR1 __CCREG(0x0604)
224#define SACR2 __CCREG(0x0608)
225#define SASR0 __CCREG(0x060c)
226#define SASR1 __CCREG(0x0610)
227#define SASCR __CCREG(0x0618)
228#define L3_CAR __CCREG(0x061c)
229#define L3_CDR __CCREG(0x0620)
230#define ACCAR __CCREG(0x0624)
231#define ACCDR __CCREG(0x0628)
232#define ACSAR __CCREG(0x062c)
233#define ACSDR __CCREG(0x0630)
234#define SADTCS __CCREG(0x0634)
235#define SADTSA __CCREG(0x0638)
236#define SADTCA __CCREG(0x063c)
237#define SADTSB __CCREG(0x0640)
238#define SADTCB __CCREG(0x0644)
239#define SADRCS __CCREG(0x0648)
240#define SADRSA __CCREG(0x064c)
241#define SADRCA __CCREG(0x0650)
242#define SADRSB __CCREG(0x0654)
243#define SADRCB __CCREG(0x0658)
244#define SAITR __CCREG(0x065c)
245#define SADR __CCREG(0x0680)
246
247#define SACR0_ENB (1<<0)
248#define SACR0_BCKD (1<<2)
249#define SACR0_RST (1<<3)
250
251#define SACR1_AMSL (1<<0)
252#define SACR1_L3EN (1<<1)
253#define SACR1_L3MB (1<<2)
254#define SACR1_DREC (1<<3)
255#define SACR1_DRPL (1<<4)
256#define SACR1_ENLBF (1<<5)
257
258#define SACR2_TS3V (1<<0)
259#define SACR2_TS4V (1<<1)
260#define SACR2_WKUP (1<<2)
261#define SACR2_DREC (1<<3)
262#define SACR2_DRPL (1<<4)
263#define SACR2_ENLBF (1<<5)
264#define SACR2_RESET (1<<6)
265
266#define SASR0_TNF (1<<0)
267#define SASR0_RNE (1<<1)
268#define SASR0_BSY (1<<2)
269#define SASR0_TFS (1<<3)
270#define SASR0_RFS (1<<4)
271#define SASR0_TUR (1<<5)
272#define SASR0_ROR (1<<6)
273#define SASR0_L3WD (1<<16)
274#define SASR0_L3RD (1<<17)
275
276#define SASR1_TNF (1<<0)
277#define SASR1_RNE (1<<1)
278#define SASR1_BSY (1<<2)
279#define SASR1_TFS (1<<3)
280#define SASR1_RFS (1<<4)
281#define SASR1_TUR (1<<5)
282#define SASR1_ROR (1<<6)
283#define SASR1_CADT (1<<16)
284#define SASR1_SADR (1<<17)
285#define SASR1_RSTO (1<<18)
286#define SASR1_CLPM (1<<19)
287#define SASR1_CRDY (1<<20)
288#define SASR1_RS3V (1<<21)
289#define SASR1_RS4V (1<<22)
290
291#define SASCR_TUR (1<<5)
292#define SASCR_ROR (1<<6)
293#define SASCR_DTS (1<<16)
294#define SASCR_RDD (1<<17)
295#define SASCR_STO (1<<18)
296
297#define SADTCS_TDEN (1<<0)
298#define SADTCS_TDIE (1<<1)
299#define SADTCS_TDBDA (1<<3)
300#define SADTCS_TDSTA (1<<4)
301#define SADTCS_TDBDB (1<<5)
302#define SADTCS_TDSTB (1<<6)
303#define SADTCS_TBIU (1<<7)
304
305#define SADRCS_RDEN (1<<0)
306#define SADRCS_RDIE (1<<1)
307#define SADRCS_RDBDA (1<<3)
308#define SADRCS_RDSTA (1<<4)
309#define SADRCS_RDBDB (1<<5)
310#define SADRCS_RDSTB (1<<6)
311#define SADRCS_RBIU (1<<7)
312
313#define SAD_CS_DEN (1<<0)
314#define SAD_CS_DIE (1<<1) /* Not functional on metal 1 */
315#define SAD_CS_DBDA (1<<3) /* Not functional on metal 1 */
316#define SAD_CS_DSTA (1<<4)
317#define SAD_CS_DBDB (1<<5) /* Not functional on metal 1 */
318#define SAD_CS_DSTB (1<<6)
319#define SAD_CS_BIU (1<<7) /* Not functional on metal 1 */
320
321#define SAITR_TFS (1<<0)
322#define SAITR_RFS (1<<1)
323#define SAITR_TUR (1<<2)
324#define SAITR_ROR (1<<3)
325#define SAITR_CADT (1<<4)
326#define SAITR_SADR (1<<5)
327#define SAITR_RSTO (1<<6)
328#define SAITR_TDBDA (1<<8)
329#define SAITR_TDBDB (1<<9)
330#define SAITR_RDBDA (1<<10)
331#define SAITR_RDBDB (1<<11)
332
333/*
334 * General-Purpose I/O Interface
335 *
336 * Registers
337 * PA_DDR GPIO Block A Data Direction
338 * PA_DRR/PA_DWR GPIO Block A Data Value Register (read/write)
339 * PA_SDR GPIO Block A Sleep Direction
340 * PA_SSR GPIO Block A Sleep State
341 * PB_DDR GPIO Block B Data Direction
342 * PB_DRR/PB_DWR GPIO Block B Data Value Register (read/write)
343 * PB_SDR GPIO Block B Sleep Direction
344 * PB_SSR GPIO Block B Sleep State
345 * PC_DDR GPIO Block C Data Direction
346 * PC_DRR/PC_DWR GPIO Block C Data Value Register (read/write)
347 * PC_SDR GPIO Block C Sleep Direction
348 * PC_SSR GPIO Block C Sleep State
349 */
350
351#define _PA_DDR _SA1111( 0x1000 )
352#define _PA_DRR _SA1111( 0x1004 )
353#define _PA_DWR _SA1111( 0x1004 )
354#define _PA_SDR _SA1111( 0x1008 )
355#define _PA_SSR _SA1111( 0x100c )
356#define _PB_DDR _SA1111( 0x1010 )
357#define _PB_DRR _SA1111( 0x1014 )
358#define _PB_DWR _SA1111( 0x1014 )
359#define _PB_SDR _SA1111( 0x1018 )
360#define _PB_SSR _SA1111( 0x101c )
361#define _PC_DDR _SA1111( 0x1020 )
362#define _PC_DRR _SA1111( 0x1024 )
363#define _PC_DWR _SA1111( 0x1024 )
364#define _PC_SDR _SA1111( 0x1028 )
365#define _PC_SSR _SA1111( 0x102c )
366
367#define SA1111_GPIO 0x1000
368
369#define SA1111_GPIO_PADDR (0x000)
370#define SA1111_GPIO_PADRR (0x004)
371#define SA1111_GPIO_PADWR (0x004)
372#define SA1111_GPIO_PASDR (0x008)
373#define SA1111_GPIO_PASSR (0x00c)
374#define SA1111_GPIO_PBDDR (0x010)
375#define SA1111_GPIO_PBDRR (0x014)
376#define SA1111_GPIO_PBDWR (0x014)
377#define SA1111_GPIO_PBSDR (0x018)
378#define SA1111_GPIO_PBSSR (0x01c)
379#define SA1111_GPIO_PCDDR (0x020)
380#define SA1111_GPIO_PCDRR (0x024)
381#define SA1111_GPIO_PCDWR (0x024)
382#define SA1111_GPIO_PCSDR (0x028)
383#define SA1111_GPIO_PCSSR (0x02c)
384
385#define GPIO_A0 (1 << 0)
386#define GPIO_A1 (1 << 1)
387#define GPIO_A2 (1 << 2)
388#define GPIO_A3 (1 << 3)
389
390#define GPIO_B0 (1 << 8)
391#define GPIO_B1 (1 << 9)
392#define GPIO_B2 (1 << 10)
393#define GPIO_B3 (1 << 11)
394#define GPIO_B4 (1 << 12)
395#define GPIO_B5 (1 << 13)
396#define GPIO_B6 (1 << 14)
397#define GPIO_B7 (1 << 15)
398
399#define GPIO_C0 (1 << 16)
400#define GPIO_C1 (1 << 17)
401#define GPIO_C2 (1 << 18)
402#define GPIO_C3 (1 << 19)
403#define GPIO_C4 (1 << 20)
404#define GPIO_C5 (1 << 21)
405#define GPIO_C6 (1 << 22)
406#define GPIO_C7 (1 << 23)
407
408/*
409 * Interrupt Controller
410 *
411 * Registers
412 * INTTEST0 Test register 0
413 * INTTEST1 Test register 1
414 * INTEN0 Interrupt Enable register 0
415 * INTEN1 Interrupt Enable register 1
416 * INTPOL0 Interrupt Polarity selection 0
417 * INTPOL1 Interrupt Polarity selection 1
418 * INTTSTSEL Interrupt source selection
419 * INTSTATCLR0 Interrupt Status/Clear 0
420 * INTSTATCLR1 Interrupt Status/Clear 1
421 * INTSET0 Interrupt source set 0
422 * INTSET1 Interrupt source set 1
423 * WAKE_EN0 Wake-up source enable 0
424 * WAKE_EN1 Wake-up source enable 1
425 * WAKE_POL0 Wake-up polarity selection 0
426 * WAKE_POL1 Wake-up polarity selection 1
427 */
428#define SA1111_INTC 0x1600
429
430/*
431 * These are offsets from the above base.
432 */
433#define SA1111_INTTEST0 0x0000
434#define SA1111_INTTEST1 0x0004
435#define SA1111_INTEN0 0x0008
436#define SA1111_INTEN1 0x000c
437#define SA1111_INTPOL0 0x0010
438#define SA1111_INTPOL1 0x0014
439#define SA1111_INTTSTSEL 0x0018
440#define SA1111_INTSTATCLR0 0x001c
441#define SA1111_INTSTATCLR1 0x0020
442#define SA1111_INTSET0 0x0024
443#define SA1111_INTSET1 0x0028
444#define SA1111_WAKEEN0 0x002c
445#define SA1111_WAKEEN1 0x0030
446#define SA1111_WAKEPOL0 0x0034
447#define SA1111_WAKEPOL1 0x0038
448
449/*
450 * PS/2 Trackpad and Mouse Interfaces
451 *
452 * Registers
453 * PS2CR Control Register
454 * PS2STAT Status Register
455 * PS2DATA Transmit/Receive Data register
456 * PS2CLKDIV Clock Division Register
457 * PS2PRECNT Clock Precount Register
458 * PS2TEST1 Test register 1
459 * PS2TEST2 Test register 2
460 * PS2TEST3 Test register 3
461 * PS2TEST4 Test register 4
462 */
463
464#define SA1111_KBD 0x0a00
465#define SA1111_MSE 0x0c00
466
467/*
468 * These are offsets from the above bases.
469 */
470#define SA1111_PS2CR 0x0000
471#define SA1111_PS2STAT 0x0004
472#define SA1111_PS2DATA 0x0008
473#define SA1111_PS2CLKDIV 0x000c
474#define SA1111_PS2PRECNT 0x0010
475
476#define PS2CR_ENA 0x08
477#define PS2CR_FKD 0x02
478#define PS2CR_FKC 0x01
479
480#define PS2STAT_STP 0x0100
481#define PS2STAT_TXE 0x0080
482#define PS2STAT_TXB 0x0040
483#define PS2STAT_RXF 0x0020
484#define PS2STAT_RXB 0x0010
485#define PS2STAT_ENA 0x0008
486#define PS2STAT_RXP 0x0004
487#define PS2STAT_KBD 0x0002
488#define PS2STAT_KBC 0x0001
489
490/*
491 * PCMCIA Interface
492 *
493 * Registers
494 * PCSR Status Register
495 * PCCR Control Register
496 * PCSSR Sleep State Register
497 */
498
499#define SA1111_PCMCIA 0x1600
500
501/*
502 * These are offsets from the above base.
503 */
504#define SA1111_PCCR 0x0000
505#define SA1111_PCSSR 0x0004
506#define SA1111_PCSR 0x0008
507
508#define PCSR_S0_READY (1<<0)
509#define PCSR_S1_READY (1<<1)
510#define PCSR_S0_DETECT (1<<2)
511#define PCSR_S1_DETECT (1<<3)
512#define PCSR_S0_VS1 (1<<4)
513#define PCSR_S0_VS2 (1<<5)
514#define PCSR_S1_VS1 (1<<6)
515#define PCSR_S1_VS2 (1<<7)
516#define PCSR_S0_WP (1<<8)
517#define PCSR_S1_WP (1<<9)
518#define PCSR_S0_BVD1 (1<<10)
519#define PCSR_S0_BVD2 (1<<11)
520#define PCSR_S1_BVD1 (1<<12)
521#define PCSR_S1_BVD2 (1<<13)
522
523#define PCCR_S0_RST (1<<0)
524#define PCCR_S1_RST (1<<1)
525#define PCCR_S0_FLT (1<<2)
526#define PCCR_S1_FLT (1<<3)
527#define PCCR_S0_PWAITEN (1<<4)
528#define PCCR_S1_PWAITEN (1<<5)
529#define PCCR_S0_PSE (1<<6)
530#define PCCR_S1_PSE (1<<7)
531
532#define PCSSR_S0_SLEEP (1<<0)
533#define PCSSR_S1_SLEEP (1<<1)
534
535
536
537
538extern struct bus_type sa1111_bus_type;
539
540#define SA1111_DEVID_SBI 0
541#define SA1111_DEVID_SK 1
542#define SA1111_DEVID_USB 2
543#define SA1111_DEVID_SAC 3
544#define SA1111_DEVID_SSP 4
545#define SA1111_DEVID_PS2 5
546#define SA1111_DEVID_GPIO 6
547#define SA1111_DEVID_INT 7
548#define SA1111_DEVID_PCMCIA 8
549
550struct sa1111_dev {
551 struct device dev;
552 unsigned int devid;
553 struct resource res;
554 void __iomem *mapbase;
555 unsigned int skpcr_mask;
556 unsigned int irq[6];
557 u64 dma_mask;
558};
559
560#define SA1111_DEV(_d) container_of((_d), struct sa1111_dev, dev)
561
562#define sa1111_get_drvdata(d) dev_get_drvdata(&(d)->dev)
563#define sa1111_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, p)
564
565struct sa1111_driver {
566 struct device_driver drv;
567 unsigned int devid;
568 int (*probe)(struct sa1111_dev *);
569 int (*remove)(struct sa1111_dev *);
570 int (*suspend)(struct sa1111_dev *, pm_message_t);
571 int (*resume)(struct sa1111_dev *);
572};
573
574#define SA1111_DRV(_d) container_of((_d), struct sa1111_driver, drv)
575
576#define SA1111_DRIVER_NAME(_sadev) ((_sadev)->dev.driver->name)
577
578/*
579 * These frob the SKPCR register.
580 */
581void sa1111_enable_device(struct sa1111_dev *);
582void sa1111_disable_device(struct sa1111_dev *);
583
584unsigned int sa1111_pll_clock(struct sa1111_dev *);
585
586#define SA1111_AUDIO_ACLINK 0
587#define SA1111_AUDIO_I2S 1
588
589void sa1111_select_audio_mode(struct sa1111_dev *sadev, int mode);
590int sa1111_set_audio_rate(struct sa1111_dev *sadev, int rate);
591int sa1111_get_audio_rate(struct sa1111_dev *sadev);
592
593int sa1111_check_dma_bug(dma_addr_t addr);
594
595int sa1111_driver_register(struct sa1111_driver *);
596void sa1111_driver_unregister(struct sa1111_driver *);
597
598void sa1111_set_io_dir(struct sa1111_dev *sadev, unsigned int bits, unsigned int dir, unsigned int sleep_dir);
599void sa1111_set_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
600void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
601
602#endif /* _ASM_ARCH_SA1111 */
diff --git a/include/asm-arm/hardware/scoop.h b/include/asm-arm/hardware/scoop.h
new file mode 100644
index 000000000000..7ea771ff6144
--- /dev/null
+++ b/include/asm-arm/hardware/scoop.h
@@ -0,0 +1,47 @@
1/*
2 * Definitions for the SCOOP interface found on various Sharp PDAs
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#define SCOOP_MCR 0x00
13#define SCOOP_CDR 0x04
14#define SCOOP_CSR 0x08
15#define SCOOP_CPR 0x0C
16#define SCOOP_CCR 0x10
17#define SCOOP_IRR 0x14
18#define SCOOP_IRM 0x14
19#define SCOOP_IMR 0x18
20#define SCOOP_ISR 0x1C
21#define SCOOP_GPCR 0x20
22#define SCOOP_GPWR 0x24
23#define SCOOP_GPRR 0x28
24
25#define SCOOP_GPCR_PA22 ( 1 << 12 )
26#define SCOOP_GPCR_PA21 ( 1 << 11 )
27#define SCOOP_GPCR_PA20 ( 1 << 10 )
28#define SCOOP_GPCR_PA19 ( 1 << 9 )
29#define SCOOP_GPCR_PA18 ( 1 << 8 )
30#define SCOOP_GPCR_PA17 ( 1 << 7 )
31#define SCOOP_GPCR_PA16 ( 1 << 6 )
32#define SCOOP_GPCR_PA15 ( 1 << 5 )
33#define SCOOP_GPCR_PA14 ( 1 << 4 )
34#define SCOOP_GPCR_PA13 ( 1 << 3 )
35#define SCOOP_GPCR_PA12 ( 1 << 2 )
36#define SCOOP_GPCR_PA11 ( 1 << 1 )
37
38struct scoop_config {
39 unsigned short io_out;
40 unsigned short io_dir;
41};
42
43void reset_scoop(struct device *dev);
44unsigned short set_scoop_gpio(struct device *dev, unsigned short bit);
45unsigned short reset_scoop_gpio(struct device *dev, unsigned short bit);
46unsigned short read_scoop_reg(struct device *dev, unsigned short reg);
47void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data);
diff --git a/include/asm-arm/hardware/ssp.h b/include/asm-arm/hardware/ssp.h
new file mode 100644
index 000000000000..28aa11b769cd
--- /dev/null
+++ b/include/asm-arm/hardware/ssp.h
@@ -0,0 +1,28 @@
1/*
2 * ssp.h
3 *
4 * Copyright (C) 2003 Russell King, 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#ifndef SSP_H
11#define SSP_H
12
13struct ssp_state {
14 unsigned int cr0;
15 unsigned int cr1;
16};
17
18int ssp_write_word(u16 data);
19int ssp_read_word(void);
20void ssp_flush(void);
21void ssp_enable(void);
22void ssp_disable(void);
23void ssp_save_state(struct ssp_state *ssp);
24void ssp_restore_state(struct ssp_state *ssp);
25int ssp_init(void);
26void ssp_exit(void);
27
28#endif
diff --git a/include/asm-arm/hdreg.h b/include/asm-arm/hdreg.h
new file mode 100644
index 000000000000..7f7fd1af0af3
--- /dev/null
+++ b/include/asm-arm/hdreg.h
@@ -0,0 +1 @@
#include <asm-generic/hdreg.h>
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h
new file mode 100644
index 000000000000..2114acb3d237
--- /dev/null
+++ b/include/asm-arm/ide.h
@@ -0,0 +1,36 @@
1/*
2 * linux/include/asm-arm/ide.h
3 *
4 * Copyright (C) 1994-1996 Linus Torvalds & authors
5 */
6
7/*
8 * This file contains the i386 architecture specific IDE code.
9 */
10
11#ifndef __ASMARM_IDE_H
12#define __ASMARM_IDE_H
13
14#ifdef __KERNEL__
15
16#ifndef MAX_HWIFS
17#define MAX_HWIFS 4
18#endif
19
20#if !defined(CONFIG_ARCH_L7200)
21# define IDE_ARCH_OBSOLETE_INIT
22# ifdef CONFIG_ARCH_CLPS7500
23# define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
24# else
25# define ide_default_io_ctl(base) (0)
26# endif
27#endif /* !ARCH_L7200 */
28
29#define __ide_mm_insw(port,addr,len) readsw(port,addr,len)
30#define __ide_mm_insl(port,addr,len) readsl(port,addr,len)
31#define __ide_mm_outsw(port,addr,len) writesw(port,addr,len)
32#define __ide_mm_outsl(port,addr,len) writesl(port,addr,len)
33
34#endif /* __KERNEL__ */
35
36#endif /* __ASMARM_IDE_H */
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
new file mode 100644
index 000000000000..69bc7a3e8160
--- /dev/null
+++ b/include/asm-arm/io.h
@@ -0,0 +1,286 @@
1/*
2 * linux/include/asm-arm/io.h
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 * Modifications:
11 * 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both
12 * constant addresses and variable addresses.
13 * 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture
14 * specific IO header files.
15 * 27-Mar-1999 PJB Second parameter of memcpy_toio is const..
16 * 04-Apr-1999 PJB Added check_signature.
17 * 12-Dec-1999 RMK More cleanups
18 * 18-Jun-2000 RMK Removed virt_to_* and friends definitions
19 * 05-Oct-2004 BJD Moved memory string functions to use void __iomem
20 */
21#ifndef __ASM_ARM_IO_H
22#define __ASM_ARM_IO_H
23
24#ifdef __KERNEL__
25
26#include <linux/types.h>
27#include <asm/byteorder.h>
28#include <asm/memory.h>
29#include <asm/arch/hardware.h>
30
31/*
32 * ISA I/O bus memory addresses are 1:1 with the physical address.
33 */
34#define isa_virt_to_bus virt_to_phys
35#define isa_page_to_bus page_to_phys
36#define isa_bus_to_virt phys_to_virt
37
38/*
39 * Generic IO read/write. These perform native-endian accesses. Note
40 * that some architectures will want to re-define __raw_{read,write}w.
41 */
42extern void __raw_writesb(void __iomem *addr, const void *data, int bytelen);
43extern void __raw_writesw(void __iomem *addr, const void *data, int wordlen);
44extern void __raw_writesl(void __iomem *addr, const void *data, int longlen);
45
46extern void __raw_readsb(void __iomem *addr, void *data, int bytelen);
47extern void __raw_readsw(void __iomem *addr, void *data, int wordlen);
48extern void __raw_readsl(void __iomem *addr, void *data, int longlen);
49
50#define __raw_writeb(v,a) (__chk_io_ptr(a), *(volatile unsigned char __force *)(a) = (v))
51#define __raw_writew(v,a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v))
52#define __raw_writel(v,a) (__chk_io_ptr(a), *(volatile unsigned int __force *)(a) = (v))
53
54#define __raw_readb(a) (__chk_io_ptr(a), *(volatile unsigned char __force *)(a))
55#define __raw_readw(a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a))
56#define __raw_readl(a) (__chk_io_ptr(a), *(volatile unsigned int __force *)(a))
57
58/*
59 * Bad read/write accesses...
60 */
61extern void __readwrite_bug(const char *fn);
62
63/*
64 * Now, pick up the machine-defined IO definitions
65 */
66#include <asm/arch/io.h>
67
68#ifdef __io_pci
69#warning machine class uses buggy __io_pci
70#endif
71#if defined(__arch_putb) || defined(__arch_putw) || defined(__arch_putl) || \
72 defined(__arch_getb) || defined(__arch_getw) || defined(__arch_getl)
73#warning machine class uses old __arch_putw or __arch_getw
74#endif
75
76/*
77 * IO port access primitives
78 * -------------------------
79 *
80 * The ARM doesn't have special IO access instructions; all IO is memory
81 * mapped. Note that these are defined to perform little endian accesses
82 * only. Their primary purpose is to access PCI and ISA peripherals.
83 *
84 * Note that for a big endian machine, this implies that the following
85 * big endian mode connectivity is in place, as described by numerious
86 * ARM documents:
87 *
88 * PCI: D0-D7 D8-D15 D16-D23 D24-D31
89 * ARM: D24-D31 D16-D23 D8-D15 D0-D7
90 *
91 * The machine specific io.h include defines __io to translate an "IO"
92 * address to a memory address.
93 *
94 * Note that we prevent GCC re-ordering or caching values in expressions
95 * by introducing sequence points into the in*() definitions. Note that
96 * __raw_* do not guarantee this behaviour.
97 *
98 * The {in,out}[bwl] macros are for emulating x86-style PCI/ISA IO space.
99 */
100#ifdef __io
101#define outb(v,p) __raw_writeb(v,__io(p))
102#define outw(v,p) __raw_writew(cpu_to_le16(v),__io(p))
103#define outl(v,p) __raw_writel(cpu_to_le32(v),__io(p))
104
105#define inb(p) ({ unsigned int __v = __raw_readb(__io(p)); __v; })
106#define inw(p) ({ unsigned int __v = le16_to_cpu(__raw_readw(__io(p))); __v; })
107#define inl(p) ({ unsigned int __v = le32_to_cpu(__raw_readl(__io(p))); __v; })
108
109#define outsb(p,d,l) __raw_writesb(__io(p),d,l)
110#define outsw(p,d,l) __raw_writesw(__io(p),d,l)
111#define outsl(p,d,l) __raw_writesl(__io(p),d,l)
112
113#define insb(p,d,l) __raw_readsb(__io(p),d,l)
114#define insw(p,d,l) __raw_readsw(__io(p),d,l)
115#define insl(p,d,l) __raw_readsl(__io(p),d,l)
116#endif
117
118#define outb_p(val,port) outb((val),(port))
119#define outw_p(val,port) outw((val),(port))
120#define outl_p(val,port) outl((val),(port))
121#define inb_p(port) inb((port))
122#define inw_p(port) inw((port))
123#define inl_p(port) inl((port))
124
125#define outsb_p(port,from,len) outsb(port,from,len)
126#define outsw_p(port,from,len) outsw(port,from,len)
127#define outsl_p(port,from,len) outsl(port,from,len)
128#define insb_p(port,to,len) insb(port,to,len)
129#define insw_p(port,to,len) insw(port,to,len)
130#define insl_p(port,to,len) insl(port,to,len)
131
132/*
133 * String version of IO memory access ops:
134 */
135extern void _memcpy_fromio(void *, void __iomem *, size_t);
136extern void _memcpy_toio(void __iomem *, const void *, size_t);
137extern void _memset_io(void __iomem *, int, size_t);
138
139#define mmiowb()
140
141/*
142 * Memory access primitives
143 * ------------------------
144 *
145 * These perform PCI memory accesses via an ioremap region. They don't
146 * take an address as such, but a cookie.
147 *
148 * Again, this are defined to perform little endian accesses. See the
149 * IO port primitives for more information.
150 */
151#ifdef __mem_pci
152#define readb(c) ({ unsigned int __v = __raw_readb(__mem_pci(c)); __v; })
153#define readw(c) ({ unsigned int __v = le16_to_cpu(__raw_readw(__mem_pci(c))); __v; })
154#define readl(c) ({ unsigned int __v = le32_to_cpu(__raw_readl(__mem_pci(c))); __v; })
155#define readb_relaxed(addr) readb(addr)
156#define readw_relaxed(addr) readw(addr)
157#define readl_relaxed(addr) readl(addr)
158
159#define readsb(p,d,l) __raw_readsb(__mem_pci(p),d,l)
160#define readsw(p,d,l) __raw_readsw(__mem_pci(p),d,l)
161#define readsl(p,d,l) __raw_readsl(__mem_pci(p),d,l)
162
163#define writeb(v,c) __raw_writeb(v,__mem_pci(c))
164#define writew(v,c) __raw_writew(cpu_to_le16(v),__mem_pci(c))
165#define writel(v,c) __raw_writel(cpu_to_le32(v),__mem_pci(c))
166
167#define writesb(p,d,l) __raw_writesb(__mem_pci(p),d,l)
168#define writesw(p,d,l) __raw_writesw(__mem_pci(p),d,l)
169#define writesl(p,d,l) __raw_writesl(__mem_pci(p),d,l)
170
171#define memset_io(c,v,l) _memset_io(__mem_pci(c),(v),(l))
172#define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l))
173#define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l))
174
175#define eth_io_copy_and_sum(s,c,l,b) \
176 eth_copy_and_sum((s),__mem_pci(c),(l),(b))
177
178static inline int
179check_signature(void __iomem *io_addr, const unsigned char *signature,
180 int length)
181{
182 int retval = 0;
183 do {
184 if (readb(io_addr) != *signature)
185 goto out;
186 io_addr++;
187 signature++;
188 length--;
189 } while (length);
190 retval = 1;
191out:
192 return retval;
193}
194
195#elif !defined(readb)
196
197#define readb(c) (__readwrite_bug("readb"),0)
198#define readw(c) (__readwrite_bug("readw"),0)
199#define readl(c) (__readwrite_bug("readl"),0)
200#define writeb(v,c) __readwrite_bug("writeb")
201#define writew(v,c) __readwrite_bug("writew")
202#define writel(v,c) __readwrite_bug("writel")
203
204#define eth_io_copy_and_sum(s,c,l,b) __readwrite_bug("eth_io_copy_and_sum")
205
206#define check_signature(io,sig,len) (0)
207
208#endif /* __mem_pci */
209
210/*
211 * If this architecture has ISA IO, then define the isa_read/isa_write
212 * macros.
213 */
214#ifdef __mem_isa
215
216#define isa_readb(addr) __raw_readb(__mem_isa(addr))
217#define isa_readw(addr) __raw_readw(__mem_isa(addr))
218#define isa_readl(addr) __raw_readl(__mem_isa(addr))
219#define isa_writeb(val,addr) __raw_writeb(val,__mem_isa(addr))
220#define isa_writew(val,addr) __raw_writew(val,__mem_isa(addr))
221#define isa_writel(val,addr) __raw_writel(val,__mem_isa(addr))
222#define isa_memset_io(a,b,c) _memset_io(__mem_isa(a),(b),(c))
223#define isa_memcpy_fromio(a,b,c) _memcpy_fromio((a),__mem_isa(b),(c))
224#define isa_memcpy_toio(a,b,c) _memcpy_toio(__mem_isa((a)),(b),(c))
225
226#define isa_eth_io_copy_and_sum(a,b,c,d) \
227 eth_copy_and_sum((a),__mem_isa(b),(c),(d))
228
229#else /* __mem_isa */
230
231#define isa_readb(addr) (__readwrite_bug("isa_readb"),0)
232#define isa_readw(addr) (__readwrite_bug("isa_readw"),0)
233#define isa_readl(addr) (__readwrite_bug("isa_readl"),0)
234#define isa_writeb(val,addr) __readwrite_bug("isa_writeb")
235#define isa_writew(val,addr) __readwrite_bug("isa_writew")
236#define isa_writel(val,addr) __readwrite_bug("isa_writel")
237#define isa_memset_io(a,b,c) __readwrite_bug("isa_memset_io")
238#define isa_memcpy_fromio(a,b,c) __readwrite_bug("isa_memcpy_fromio")
239#define isa_memcpy_toio(a,b,c) __readwrite_bug("isa_memcpy_toio")
240
241#define isa_eth_io_copy_and_sum(a,b,c,d) \
242 __readwrite_bug("isa_eth_io_copy_and_sum")
243
244#endif /* __mem_isa */
245
246/*
247 * ioremap and friends.
248 *
249 * ioremap takes a PCI memory address, as specified in
250 * Documentation/IO-mapping.txt.
251 */
252extern void __iomem * __ioremap(unsigned long, size_t, unsigned long, unsigned long);
253extern void __iounmap(void __iomem *addr);
254
255#ifndef __arch_ioremap
256#define ioremap(cookie,size) __ioremap(cookie,size,0,1)
257#define ioremap_nocache(cookie,size) __ioremap(cookie,size,0,1)
258#define ioremap_cached(cookie,size) __ioremap(cookie,size,L_PTE_CACHEABLE,1)
259#define iounmap(cookie) __iounmap(cookie)
260#else
261#define ioremap(cookie,size) __arch_ioremap((cookie),(size),0,1)
262#define ioremap_nocache(cookie,size) __arch_ioremap((cookie),(size),0,1)
263#define ioremap_cached(cookie,size) __arch_ioremap((cookie),(size),L_PTE_CACHEABLE,1)
264#define iounmap(cookie) __arch_iounmap(cookie)
265#endif
266
267/*
268 * can the hardware map this into one segment or not, given no other
269 * constraints.
270 */
271#define BIOVEC_MERGEABLE(vec1, vec2) \
272 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
273
274/*
275 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
276 * access
277 */
278#define xlate_dev_mem_ptr(p) __va(p)
279
280/*
281 * Convert a virtual cached pointer to an uncached pointer
282 */
283#define xlate_dev_kmem_ptr(p) p
284
285#endif /* __KERNEL__ */
286#endif /* __ASM_ARM_IO_H */
diff --git a/include/asm-arm/ioctl.h b/include/asm-arm/ioctl.h
new file mode 100644
index 000000000000..2cbb7d0e9dc6
--- /dev/null
+++ b/include/asm-arm/ioctl.h
@@ -0,0 +1,74 @@
1/*
2 * linux/ioctl.h for Linux by H.H. Bergman.
3 */
4
5#ifndef _ASMARM_IOCTL_H
6#define _ASMARM_IOCTL_H
7
8/* ioctl command encoding: 32 bits total, command in lower 16 bits,
9 * size of the parameter structure in the lower 14 bits of the
10 * upper 16 bits.
11 * Encoding the size of the parameter structure in the ioctl request
12 * is useful for catching programs compiled with old versions
13 * and to avoid overwriting user space outside the user buffer area.
14 * The highest 2 bits are reserved for indicating the ``access mode''.
15 * NOTE: This limits the max parameter size to 16kB -1 !
16 */
17
18/*
19 * The following is for compatibility across the various Linux
20 * platforms. The i386 ioctl numbering scheme doesn't really enforce
21 * a type field. De facto, however, the top 8 bits of the lower 16
22 * bits are indeed used as a type field, so we might just as well make
23 * this explicit here. Please be sure to use the decoding macros
24 * below from now on.
25 */
26#define _IOC_NRBITS 8
27#define _IOC_TYPEBITS 8
28#define _IOC_SIZEBITS 14
29#define _IOC_DIRBITS 2
30
31#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
32#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
33#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
34#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
35
36#define _IOC_NRSHIFT 0
37#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
38#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
39#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
40
41/*
42 * Direction bits.
43 */
44#define _IOC_NONE 0U
45#define _IOC_WRITE 1U
46#define _IOC_READ 2U
47
48#define _IOC(dir,type,nr,size) \
49 (((dir) << _IOC_DIRSHIFT) | \
50 ((type) << _IOC_TYPESHIFT) | \
51 ((nr) << _IOC_NRSHIFT) | \
52 ((size) << _IOC_SIZESHIFT))
53
54/* used to create numbers */
55#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
56#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
57#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
58#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
59
60/* used to decode ioctl numbers.. */
61#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
62#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
63#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
64#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
65
66/* ...and for the drivers/sound files... */
67
68#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
69#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
70#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
71#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
72#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
73
74#endif /* _ASMARM_IOCTL_H */
diff --git a/include/asm-arm/ioctls.h b/include/asm-arm/ioctls.h
new file mode 100644
index 000000000000..bb9a7aa10c12
--- /dev/null
+++ b/include/asm-arm/ioctls.h
@@ -0,0 +1,80 @@
1#ifndef __ASM_ARM_IOCTLS_H
2#define __ASM_ARM_IOCTLS_H
3
4#include <asm/ioctl.h>
5
6/* 0x54 is just a magic number to make these relatively unique ('T') */
7
8#define TCGETS 0x5401
9#define TCSETS 0x5402
10#define TCSETSW 0x5403
11#define TCSETSF 0x5404
12#define TCGETA 0x5405
13#define TCSETA 0x5406
14#define TCSETAW 0x5407
15#define TCSETAF 0x5408
16#define TCSBRK 0x5409
17#define TCXONC 0x540A
18#define TCFLSH 0x540B
19#define TIOCEXCL 0x540C
20#define TIOCNXCL 0x540D
21#define TIOCSCTTY 0x540E
22#define TIOCGPGRP 0x540F
23#define TIOCSPGRP 0x5410
24#define TIOCOUTQ 0x5411
25#define TIOCSTI 0x5412
26#define TIOCGWINSZ 0x5413
27#define TIOCSWINSZ 0x5414
28#define TIOCMGET 0x5415
29#define TIOCMBIS 0x5416
30#define TIOCMBIC 0x5417
31#define TIOCMSET 0x5418
32#define TIOCGSOFTCAR 0x5419
33#define TIOCSSOFTCAR 0x541A
34#define FIONREAD 0x541B
35#define TIOCINQ FIONREAD
36#define TIOCLINUX 0x541C
37#define TIOCCONS 0x541D
38#define TIOCGSERIAL 0x541E
39#define TIOCSSERIAL 0x541F
40#define TIOCPKT 0x5420
41#define FIONBIO 0x5421
42#define TIOCNOTTY 0x5422
43#define TIOCSETD 0x5423
44#define TIOCGETD 0x5424
45#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
46#define TIOCSBRK 0x5427 /* BSD compatibility */
47#define TIOCCBRK 0x5428 /* BSD compatibility */
48#define TIOCGSID 0x5429 /* Return the session ID of FD */
49#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
50#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
51
52#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
53#define FIOCLEX 0x5451
54#define FIOASYNC 0x5452
55#define TIOCSERCONFIG 0x5453
56#define TIOCSERGWILD 0x5454
57#define TIOCSERSWILD 0x5455
58#define TIOCGLCKTRMIOS 0x5456
59#define TIOCSLCKTRMIOS 0x5457
60#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
61#define TIOCSERGETLSR 0x5459 /* Get line status register */
62#define TIOCSERGETMULTI 0x545A /* Get multiport config */
63#define TIOCSERSETMULTI 0x545B /* Set multiport config */
64
65#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
66#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
67#define FIOQSIZE 0x545E
68
69/* Used for packet mode */
70#define TIOCPKT_DATA 0
71#define TIOCPKT_FLUSHREAD 1
72#define TIOCPKT_FLUSHWRITE 2
73#define TIOCPKT_STOP 4
74#define TIOCPKT_START 8
75#define TIOCPKT_NOSTOP 16
76#define TIOCPKT_DOSTOP 32
77
78#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
79
80#endif
diff --git a/include/asm-arm/ipc.h b/include/asm-arm/ipc.h
new file mode 100644
index 000000000000..a46e3d9c2a3f
--- /dev/null
+++ b/include/asm-arm/ipc.h
@@ -0,0 +1 @@
#include <asm-generic/ipc.h>
diff --git a/include/asm-arm/ipcbuf.h b/include/asm-arm/ipcbuf.h
new file mode 100644
index 000000000000..97683975f7df
--- /dev/null
+++ b/include/asm-arm/ipcbuf.h
@@ -0,0 +1,29 @@
1#ifndef __ASMARM_IPCBUF_H
2#define __ASMARM_IPCBUF_H
3
4/*
5 * The ipc64_perm structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit mode_t and seq
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid32_t uid;
18 __kernel_gid32_t gid;
19 __kernel_uid32_t cuid;
20 __kernel_gid32_t cgid;
21 __kernel_mode_t mode;
22 unsigned short __pad1;
23 unsigned short seq;
24 unsigned short __pad2;
25 unsigned long __unused1;
26 unsigned long __unused2;
27};
28
29#endif /* __ASMARM_IPCBUF_H */
diff --git a/include/asm-arm/irq.h b/include/asm-arm/irq.h
new file mode 100644
index 000000000000..f97912fbb10f
--- /dev/null
+++ b/include/asm-arm/irq.h
@@ -0,0 +1,51 @@
1#ifndef __ASM_ARM_IRQ_H
2#define __ASM_ARM_IRQ_H
3
4#include <asm/arch/irqs.h>
5
6#ifndef irq_canonicalize
7#define irq_canonicalize(i) (i)
8#endif
9
10#ifndef NR_IRQS
11#define NR_IRQS 128
12#endif
13
14/*
15 * Use this value to indicate lack of interrupt
16 * capability
17 */
18#ifndef NO_IRQ
19#define NO_IRQ ((unsigned int)(-1))
20#endif
21
22struct irqaction;
23
24extern void disable_irq_nosync(unsigned int);
25extern void disable_irq(unsigned int);
26extern void enable_irq(unsigned int);
27
28#define __IRQT_FALEDGE (1 << 0)
29#define __IRQT_RISEDGE (1 << 1)
30#define __IRQT_LOWLVL (1 << 2)
31#define __IRQT_HIGHLVL (1 << 3)
32
33#define IRQT_NOEDGE (0)
34#define IRQT_RISING (__IRQT_RISEDGE)
35#define IRQT_FALLING (__IRQT_FALEDGE)
36#define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE)
37#define IRQT_LOW (__IRQT_LOWLVL)
38#define IRQT_HIGH (__IRQT_HIGHLVL)
39#define IRQT_PROBE (1 << 4)
40
41int set_irq_type(unsigned int irq, unsigned int type);
42void disable_irq_wake(unsigned int irq);
43void enable_irq_wake(unsigned int irq);
44int setup_irq(unsigned int, struct irqaction *);
45
46struct irqaction;
47struct pt_regs;
48int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
49
50#endif
51
diff --git a/include/asm-arm/kmap_types.h b/include/asm-arm/kmap_types.h
new file mode 100644
index 000000000000..45def13ee17a
--- /dev/null
+++ b/include/asm-arm/kmap_types.h
@@ -0,0 +1,24 @@
1#ifndef __ARM_KMAP_TYPES_H
2#define __ARM_KMAP_TYPES_H
3
4/*
5 * This is the "bare minimum". AIO seems to require this.
6 */
7enum km_type {
8 KM_BOUNCE_READ,
9 KM_SKB_SUNRPC_DATA,
10 KM_SKB_DATA_SOFTIRQ,
11 KM_USER0,
12 KM_USER1,
13 KM_BIO_SRC_IRQ,
14 KM_BIO_DST_IRQ,
15 KM_PTE0,
16 KM_PTE1,
17 KM_IRQ0,
18 KM_IRQ1,
19 KM_SOFTIRQ0,
20 KM_SOFTIRQ1,
21 KM_TYPE_NR
22};
23
24#endif
diff --git a/include/asm-arm/leds.h b/include/asm-arm/leds.h
new file mode 100644
index 000000000000..88ce4124f854
--- /dev/null
+++ b/include/asm-arm/leds.h
@@ -0,0 +1,51 @@
1/*
2 * linux/include/asm-arm/leds.h
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 * Event-driven interface for LEDs on machines
11 * Added led_start and led_stop- Alex Holden, 28th Dec 1998.
12 */
13#ifndef ASM_ARM_LEDS_H
14#define ASM_ARM_LEDS_H
15
16#include <linux/config.h>
17
18typedef enum {
19 led_idle_start,
20 led_idle_end,
21 led_timer,
22 led_start,
23 led_stop,
24 led_claim, /* override idle & timer leds */
25 led_release, /* restore idle & timer leds */
26 led_start_timer_mode,
27 led_stop_timer_mode,
28 led_green_on,
29 led_green_off,
30 led_amber_on,
31 led_amber_off,
32 led_red_on,
33 led_red_off,
34 led_blue_on,
35 led_blue_off,
36 /*
37 * I want this between led_timer and led_start, but
38 * someone has decided to export this to user space
39 */
40 led_halted
41} led_event_t;
42
43/* Use this routine to handle LEDs */
44
45#ifdef CONFIG_LEDS
46extern void (*leds_event)(led_event_t);
47#else
48#define leds_event(e)
49#endif
50
51#endif
diff --git a/include/asm-arm/limits.h b/include/asm-arm/limits.h
new file mode 100644
index 000000000000..08d8c6600804
--- /dev/null
+++ b/include/asm-arm/limits.h
@@ -0,0 +1,11 @@
1#ifndef __ASM_PIPE_H
2#define __ASM_PIPE_H
3
4#ifndef PAGE_SIZE
5#include <asm/page.h>
6#endif
7
8#define PIPE_BUF PAGE_SIZE
9
10#endif
11
diff --git a/include/asm-arm/linkage.h b/include/asm-arm/linkage.h
new file mode 100644
index 000000000000..dbe4b4e31a5b
--- /dev/null
+++ b/include/asm-arm/linkage.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_LINKAGE_H
2#define __ASM_LINKAGE_H
3
4#define __ALIGN .align 0
5#define __ALIGN_STR ".align 0"
6
7#endif
diff --git a/include/asm-arm/local.h b/include/asm-arm/local.h
new file mode 100644
index 000000000000..c11c530f74d0
--- /dev/null
+++ b/include/asm-arm/local.h
@@ -0,0 +1 @@
#include <asm-generic/local.h>
diff --git a/include/asm-arm/locks.h b/include/asm-arm/locks.h
new file mode 100644
index 000000000000..c26298f3891f
--- /dev/null
+++ b/include/asm-arm/locks.h
@@ -0,0 +1,262 @@
1/*
2 * linux/include/asm-arm/locks.h
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 * Interrupt safe locking assembler.
11 */
12#ifndef __ASM_PROC_LOCKS_H
13#define __ASM_PROC_LOCKS_H
14
15#if __LINUX_ARM_ARCH__ >= 6
16
17#define __down_op(ptr,fail) \
18 ({ \
19 __asm__ __volatile__( \
20 "@ down_op\n" \
21"1: ldrex lr, [%0]\n" \
22" sub lr, lr, %1\n" \
23" strex ip, lr, [%0]\n" \
24" teq ip, #0\n" \
25" bne 1b\n" \
26" teq lr, #0\n" \
27" movmi ip, %0\n" \
28" blmi " #fail \
29 : \
30 : "r" (ptr), "I" (1) \
31 : "ip", "lr", "cc", "memory"); \
32 })
33
34#define __down_op_ret(ptr,fail) \
35 ({ \
36 unsigned int ret; \
37 __asm__ __volatile__( \
38 "@ down_op_ret\n" \
39"1: ldrex lr, [%1]\n" \
40" sub lr, lr, %2\n" \
41" strex ip, lr, [%1]\n" \
42" teq ip, #0\n" \
43" bne 1b\n" \
44" teq lr, #0\n" \
45" movmi ip, %1\n" \
46" movpl ip, #0\n" \
47" blmi " #fail "\n" \
48" mov %0, ip" \
49 : "=&r" (ret) \
50 : "r" (ptr), "I" (1) \
51 : "ip", "lr", "cc", "memory"); \
52 ret; \
53 })
54
55#define __up_op(ptr,wake) \
56 ({ \
57 __asm__ __volatile__( \
58 "@ up_op\n" \
59"1: ldrex lr, [%0]\n" \
60" add lr, lr, %1\n" \
61" strex ip, lr, [%0]\n" \
62" teq ip, #0\n" \
63" bne 1b\n" \
64" teq lr, #0\n" \
65" movle ip, %0\n" \
66" blle " #wake \
67 : \
68 : "r" (ptr), "I" (1) \
69 : "ip", "lr", "cc", "memory"); \
70 })
71
72/*
73 * The value 0x01000000 supports up to 128 processors and
74 * lots of processes. BIAS must be chosen such that sub'ing
75 * BIAS once per CPU will result in the long remaining
76 * negative.
77 */
78#define RW_LOCK_BIAS 0x01000000
79#define RW_LOCK_BIAS_STR "0x01000000"
80
81#define __down_op_write(ptr,fail) \
82 ({ \
83 __asm__ __volatile__( \
84 "@ down_op_write\n" \
85"1: ldrex lr, [%0]\n" \
86" sub lr, lr, %1\n" \
87" strex ip, lr, [%0]\n" \
88" teq ip, #0\n" \
89" bne 1b\n" \
90" teq lr, #0\n" \
91" movne ip, %0\n" \
92" blne " #fail \
93 : \
94 : "r" (ptr), "I" (RW_LOCK_BIAS) \
95 : "ip", "lr", "cc", "memory"); \
96 })
97
98#define __up_op_write(ptr,wake) \
99 ({ \
100 __asm__ __volatile__( \
101 "@ up_op_read\n" \
102"1: ldrex lr, [%0]\n" \
103" add lr, lr, %1\n" \
104" strex ip, lr, [%0]\n" \
105" teq ip, #0\n" \
106" bne 1b\n" \
107" movcs ip, %0\n" \
108" blcs " #wake \
109 : \
110 : "r" (ptr), "I" (RW_LOCK_BIAS) \
111 : "ip", "lr", "cc", "memory"); \
112 })
113
114#define __down_op_read(ptr,fail) \
115 __down_op(ptr, fail)
116
117#define __up_op_read(ptr,wake) \
118 ({ \
119 __asm__ __volatile__( \
120 "@ up_op_read\n" \
121"1: ldrex lr, [%0]\n" \
122" add lr, lr, %1\n" \
123" strex ip, lr, [%0]\n" \
124" teq ip, #0\n" \
125" bne 1b\n" \
126" teq lr, #0\n" \
127" moveq ip, %0\n" \
128" bleq " #wake \
129 : \
130 : "r" (ptr), "I" (1) \
131 : "ip", "lr", "cc", "memory"); \
132 })
133
134#else
135
136#define __down_op(ptr,fail) \
137 ({ \
138 __asm__ __volatile__( \
139 "@ down_op\n" \
140" mrs ip, cpsr\n" \
141" orr lr, ip, #128\n" \
142" msr cpsr_c, lr\n" \
143" ldr lr, [%0]\n" \
144" subs lr, lr, %1\n" \
145" str lr, [%0]\n" \
146" msr cpsr_c, ip\n" \
147" movmi ip, %0\n" \
148" blmi " #fail \
149 : \
150 : "r" (ptr), "I" (1) \
151 : "ip", "lr", "cc", "memory"); \
152 })
153
154#define __down_op_ret(ptr,fail) \
155 ({ \
156 unsigned int ret; \
157 __asm__ __volatile__( \
158 "@ down_op_ret\n" \
159" mrs ip, cpsr\n" \
160" orr lr, ip, #128\n" \
161" msr cpsr_c, lr\n" \
162" ldr lr, [%1]\n" \
163" subs lr, lr, %2\n" \
164" str lr, [%1]\n" \
165" msr cpsr_c, ip\n" \
166" movmi ip, %1\n" \
167" movpl ip, #0\n" \
168" blmi " #fail "\n" \
169" mov %0, ip" \
170 : "=&r" (ret) \
171 : "r" (ptr), "I" (1) \
172 : "ip", "lr", "cc", "memory"); \
173 ret; \
174 })
175
176#define __up_op(ptr,wake) \
177 ({ \
178 __asm__ __volatile__( \
179 "@ up_op\n" \
180" mrs ip, cpsr\n" \
181" orr lr, ip, #128\n" \
182" msr cpsr_c, lr\n" \
183" ldr lr, [%0]\n" \
184" adds lr, lr, %1\n" \
185" str lr, [%0]\n" \
186" msr cpsr_c, ip\n" \
187" movle ip, %0\n" \
188" blle " #wake \
189 : \
190 : "r" (ptr), "I" (1) \
191 : "ip", "lr", "cc", "memory"); \
192 })
193
194/*
195 * The value 0x01000000 supports up to 128 processors and
196 * lots of processes. BIAS must be chosen such that sub'ing
197 * BIAS once per CPU will result in the long remaining
198 * negative.
199 */
200#define RW_LOCK_BIAS 0x01000000
201#define RW_LOCK_BIAS_STR "0x01000000"
202
203#define __down_op_write(ptr,fail) \
204 ({ \
205 __asm__ __volatile__( \
206 "@ down_op_write\n" \
207" mrs ip, cpsr\n" \
208" orr lr, ip, #128\n" \
209" msr cpsr_c, lr\n" \
210" ldr lr, [%0]\n" \
211" subs lr, lr, %1\n" \
212" str lr, [%0]\n" \
213" msr cpsr_c, ip\n" \
214" movne ip, %0\n" \
215" blne " #fail \
216 : \
217 : "r" (ptr), "I" (RW_LOCK_BIAS) \
218 : "ip", "lr", "cc", "memory"); \
219 })
220
221#define __up_op_write(ptr,wake) \
222 ({ \
223 __asm__ __volatile__( \
224 "@ up_op_read\n" \
225" mrs ip, cpsr\n" \
226" orr lr, ip, #128\n" \
227" msr cpsr_c, lr\n" \
228" ldr lr, [%0]\n" \
229" adds lr, lr, %1\n" \
230" str lr, [%0]\n" \
231" msr cpsr_c, ip\n" \
232" movcs ip, %0\n" \
233" blcs " #wake \
234 : \
235 : "r" (ptr), "I" (RW_LOCK_BIAS) \
236 : "ip", "lr", "cc", "memory"); \
237 })
238
239#define __down_op_read(ptr,fail) \
240 __down_op(ptr, fail)
241
242#define __up_op_read(ptr,wake) \
243 ({ \
244 __asm__ __volatile__( \
245 "@ up_op_read\n" \
246" mrs ip, cpsr\n" \
247" orr lr, ip, #128\n" \
248" msr cpsr_c, lr\n" \
249" ldr lr, [%0]\n" \
250" adds lr, lr, %1\n" \
251" str lr, [%0]\n" \
252" msr cpsr_c, ip\n" \
253" moveq ip, %0\n" \
254" bleq " #wake \
255 : \
256 : "r" (ptr), "I" (1) \
257 : "ip", "lr", "cc", "memory"); \
258 })
259
260#endif
261
262#endif
diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h
new file mode 100644
index 000000000000..3a32e929ec8c
--- /dev/null
+++ b/include/asm-arm/mach/arch.h
@@ -0,0 +1,92 @@
1/*
2 * linux/include/asm-arm/mach/arch.h
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
11#ifndef __ASSEMBLY__
12
13struct tag;
14struct meminfo;
15struct sys_timer;
16
17struct machine_desc {
18 /*
19 * Note! The first five elements are used
20 * by assembler code in head-armv.S
21 */
22 unsigned int nr; /* architecture number */
23 unsigned int phys_ram; /* start of physical ram */
24 unsigned int phys_io; /* start of physical io */
25 unsigned int io_pg_offst; /* byte offset for io
26 * page tabe entry */
27
28 const char *name; /* architecture name */
29 unsigned int param_offset; /* parameter page */
30
31 unsigned int video_start; /* start of video RAM */
32 unsigned int video_end; /* end of video RAM */
33
34 unsigned int reserve_lp0 :1; /* never has lp0 */
35 unsigned int reserve_lp1 :1; /* never has lp1 */
36 unsigned int reserve_lp2 :1; /* never has lp2 */
37 unsigned int soft_reboot :1; /* soft reboot */
38 void (*fixup)(struct machine_desc *,
39 struct tag *, char **,
40 struct meminfo *);
41 void (*map_io)(void);/* IO mapping function */
42 void (*init_irq)(void);
43 struct sys_timer *timer; /* system tick timer */
44 void (*init_machine)(void);
45};
46
47/*
48 * Set of macros to define architecture features. This is built into
49 * a table by the linker.
50 */
51#define MACHINE_START(_type,_name) \
52const struct machine_desc __mach_desc_##_type \
53 __attribute__((__section__(".arch.info"))) = { \
54 .nr = MACH_TYPE_##_type, \
55 .name = _name,
56
57#define MAINTAINER(n)
58
59#define BOOT_MEM(_pram,_pio,_vio) \
60 .phys_ram = _pram, \
61 .phys_io = _pio, \
62 .io_pg_offst = ((_vio)>>18)&0xfffc,
63
64#define BOOT_PARAMS(_params) \
65 .param_offset = _params,
66
67#define VIDEO(_start,_end) \
68 .video_start = _start, \
69 .video_end = _end,
70
71#define DISABLE_PARPORT(_n) \
72 .reserve_lp##_n = 1,
73
74#define SOFT_REBOOT \
75 .soft_reboot = 1,
76
77#define FIXUP(_func) \
78 .fixup = _func,
79
80#define MAPIO(_func) \
81 .map_io = _func,
82
83#define INITIRQ(_func) \
84 .init_irq = _func,
85
86#define INIT_MACHINE(_func) \
87 .init_machine = _func,
88
89#define MACHINE_END \
90};
91
92#endif
diff --git a/include/asm-arm/mach/dma.h b/include/asm-arm/mach/dma.h
new file mode 100644
index 000000000000..31bf716106ee
--- /dev/null
+++ b/include/asm-arm/mach/dma.h
@@ -0,0 +1,55 @@
1/*
2 * linux/include/asm-arm/mach/dma.h
3 *
4 * Copyright (C) 1998-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 * This header file describes the interface between the generic DMA handler
11 * (dma.c) and the architecture-specific DMA backends (dma-*.c)
12 */
13
14struct dma_struct;
15typedef struct dma_struct dma_t;
16
17struct dma_ops {
18 int (*request)(dmach_t, dma_t *); /* optional */
19 void (*free)(dmach_t, dma_t *); /* optional */
20 void (*enable)(dmach_t, dma_t *); /* mandatory */
21 void (*disable)(dmach_t, dma_t *); /* mandatory */
22 int (*residue)(dmach_t, dma_t *); /* optional */
23 int (*setspeed)(dmach_t, dma_t *, int); /* optional */
24 char *type;
25};
26
27struct dma_struct {
28 struct scatterlist buf; /* single DMA */
29 int sgcount; /* number of DMA SG */
30 struct scatterlist *sg; /* DMA Scatter-Gather List */
31
32 unsigned int active:1; /* Transfer active */
33 unsigned int invalid:1; /* Address/Count changed */
34 unsigned int using_sg:1; /* using scatter list? */
35 dmamode_t dma_mode; /* DMA mode */
36 int speed; /* DMA speed */
37
38 unsigned int lock; /* Device is allocated */
39 const char *device_id; /* Device name */
40
41 unsigned int dma_base; /* Controller base address */
42 int dma_irq; /* Controller IRQ */
43 struct scatterlist cur_sg; /* Current controller buffer */
44 unsigned int state;
45
46 struct dma_ops *d_ops;
47};
48
49/* Prototype: void arch_dma_init(dma)
50 * Purpose : Initialise architecture specific DMA
51 * Params : dma - pointer to array of DMA structures
52 */
53extern void arch_dma_init(dma_t *dma);
54
55extern void isa_init_dma(dma_t *dma);
diff --git a/include/asm-arm/mach/flash.h b/include/asm-arm/mach/flash.h
new file mode 100644
index 000000000000..a92887d4b2cb
--- /dev/null
+++ b/include/asm-arm/mach/flash.h
@@ -0,0 +1,34 @@
1/*
2 * linux/include/asm-arm/mach/flash.h
3 *
4 * Copyright (C) 2003 Russell King, 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#ifndef ASMARM_MACH_FLASH_H
11#define ASMARM_MACH_FLASH_H
12
13struct mtd_partition;
14
15/*
16 * map_name: the map probe function name
17 * width: width of mapped device
18 * init: method called at driver/device initialisation
19 * exit: method called at driver/device removal
20 * set_vpp: method called to enable or disable VPP
21 * parts: optional array of mtd_partitions for static partitioning
22 * nr_parts: number of mtd_partitions for static partitoning
23 */
24struct flash_platform_data {
25 const char *map_name;
26 unsigned int width;
27 int (*init)(void);
28 void (*exit)(void);
29 void (*set_vpp)(int on);
30 struct mtd_partition *parts;
31 unsigned int nr_parts;
32};
33
34#endif
diff --git a/include/asm-arm/mach/irda.h b/include/asm-arm/mach/irda.h
new file mode 100644
index 000000000000..58984d9c0b0b
--- /dev/null
+++ b/include/asm-arm/mach/irda.h
@@ -0,0 +1,20 @@
1/*
2 * linux/include/asm-arm/mach/irda.h
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#ifndef __ASM_ARM_MACH_IRDA_H
11#define __ASM_ARM_MACH_IRDA_H
12
13struct irda_platform_data {
14 int (*startup)(struct device *);
15 void (*shutdown)(struct device *);
16 int (*set_power)(struct device *, unsigned int state);
17 void (*set_speed)(struct device *, unsigned int speed);
18};
19
20#endif
diff --git a/include/asm-arm/mach/irq.h b/include/asm-arm/mach/irq.h
new file mode 100644
index 000000000000..a43a353f6c7b
--- /dev/null
+++ b/include/asm-arm/mach/irq.h
@@ -0,0 +1,127 @@
1/*
2 * linux/include/asm-arm/mach/irq.h
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#ifndef __ASM_ARM_MACH_IRQ_H
11#define __ASM_ARM_MACH_IRQ_H
12
13struct irqdesc;
14struct pt_regs;
15struct seq_file;
16
17typedef void (*irq_handler_t)(unsigned int, struct irqdesc *, struct pt_regs *);
18typedef void (*irq_control_t)(unsigned int);
19
20struct irqchip {
21 /*
22 * Acknowledge the IRQ.
23 * If this is a level-based IRQ, then it is expected to mask the IRQ
24 * as well.
25 */
26 void (*ack)(unsigned int);
27 /*
28 * Mask the IRQ in hardware.
29 */
30 void (*mask)(unsigned int);
31 /*
32 * Unmask the IRQ in hardware.
33 */
34 void (*unmask)(unsigned int);
35 /*
36 * Ask the hardware to re-trigger the IRQ.
37 * Note: This method _must_ _not_ call the interrupt handler.
38 * If you are unable to retrigger the interrupt, do not
39 * provide a function, or if you do, return non-zero.
40 */
41 int (*retrigger)(unsigned int);
42 /*
43 * Set the type of the IRQ.
44 */
45 int (*type)(unsigned int, unsigned int);
46 /*
47 * Set wakeup-enable on the selected IRQ
48 */
49 int (*wake)(unsigned int, unsigned int);
50
51#ifdef CONFIG_SMP
52 /*
53 * Route an interrupt to a CPU
54 */
55 void (*set_cpu)(struct irqdesc *desc, unsigned int irq, unsigned int cpu);
56#endif
57};
58
59struct irqdesc {
60 irq_handler_t handle;
61 struct irqchip *chip;
62 struct irqaction *action;
63 struct list_head pend;
64 void *chipdata;
65 void *data;
66 unsigned int disable_depth;
67
68 unsigned int triggered: 1; /* IRQ has occurred */
69 unsigned int running : 1; /* IRQ is running */
70 unsigned int pending : 1; /* IRQ is pending */
71 unsigned int probing : 1; /* IRQ in use for a probe */
72 unsigned int probe_ok : 1; /* IRQ can be used for probe */
73 unsigned int valid : 1; /* IRQ claimable */
74 unsigned int noautoenable : 1; /* don't automatically enable IRQ */
75 unsigned int unused :25;
76
77 struct proc_dir_entry *procdir;
78
79#ifdef CONFIG_SMP
80 cpumask_t affinity;
81 unsigned int cpu;
82#endif
83
84 /*
85 * IRQ lock detection
86 */
87 unsigned int lck_cnt;
88 unsigned int lck_pc;
89 unsigned int lck_jif;
90};
91
92extern struct irqdesc irq_desc[];
93
94/*
95 * This is internal. Do not use it.
96 */
97extern void (*init_arch_irq)(void);
98extern void init_FIQ(void);
99extern int show_fiq_list(struct seq_file *, void *);
100void __set_irq_handler(unsigned int irq, irq_handler_t, int);
101
102/*
103 * External stuff.
104 */
105#define set_irq_handler(irq,handler) __set_irq_handler(irq,handler,0)
106#define set_irq_chained_handler(irq,handler) __set_irq_handler(irq,handler,1)
107#define set_irq_data(irq,d) do { irq_desc[irq].data = d; } while (0)
108#define set_irq_chipdata(irq,d) do { irq_desc[irq].chipdata = d; } while (0)
109#define get_irq_chipdata(irq) (irq_desc[irq].chipdata)
110
111void set_irq_chip(unsigned int irq, struct irqchip *);
112void set_irq_flags(unsigned int irq, unsigned int flags);
113
114#define IRQF_VALID (1 << 0)
115#define IRQF_PROBE (1 << 1)
116#define IRQF_NOAUTOEN (1 << 2)
117
118/*
119 * Built-in IRQ handlers.
120 */
121void do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
122void do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
123void do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
124void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
125void dummy_mask_unmask_irq(unsigned int irq);
126
127#endif
diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h
new file mode 100644
index 000000000000..9ac47cf8d2e4
--- /dev/null
+++ b/include/asm-arm/mach/map.h
@@ -0,0 +1,33 @@
1/*
2 * linux/include/asm-arm/map.h
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 * Page table mapping constructs and function prototypes
11 */
12struct map_desc {
13 unsigned long virtual;
14 unsigned long physical;
15 unsigned long length;
16 unsigned int type;
17};
18
19struct meminfo;
20
21#define MT_DEVICE 0
22#define MT_CACHECLEAN 1
23#define MT_MINICLEAN 2
24#define MT_LOW_VECTORS 3
25#define MT_HIGH_VECTORS 4
26#define MT_MEMORY 5
27#define MT_ROM 6
28#define MT_IXP2000_DEVICE 7
29
30extern void create_memmap_holes(struct meminfo *);
31extern void memtable_init(struct meminfo *);
32extern void iotable_init(struct map_desc *, int);
33extern void setup_io_desc(void);
diff --git a/include/asm-arm/mach/mmc.h b/include/asm-arm/mach/mmc.h
new file mode 100644
index 000000000000..1b3555d4b41e
--- /dev/null
+++ b/include/asm-arm/mach/mmc.h
@@ -0,0 +1,15 @@
1/*
2 * linux/include/asm-arm/mach/mmc.h
3 */
4#ifndef ASMARM_MACH_MMC_H
5#define ASMARM_MACH_MMC_H
6
7#include <linux/mmc/protocol.h>
8
9struct mmc_platform_data {
10 unsigned int ocr_mask; /* available voltages */
11 u32 (*translate_vdd)(struct device *, unsigned int);
12 unsigned int (*status)(struct device *);
13};
14
15#endif
diff --git a/include/asm-arm/mach/pci.h b/include/asm-arm/mach/pci.h
new file mode 100644
index 000000000000..25d540ed0079
--- /dev/null
+++ b/include/asm-arm/mach/pci.h
@@ -0,0 +1,75 @@
1/*
2 * linux/include/asm-arm/mach/pci.h
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
11struct pci_sys_data;
12struct pci_bus;
13
14struct hw_pci {
15 struct list_head buses;
16 int nr_controllers;
17 int (*setup)(int nr, struct pci_sys_data *);
18 struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
19 void (*preinit)(void);
20 void (*postinit)(void);
21 u8 (*swizzle)(struct pci_dev *dev, u8 *pin);
22 int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
23};
24
25/*
26 * Per-controller structure
27 */
28struct pci_sys_data {
29 struct list_head node;
30 int busnr; /* primary bus number */
31 unsigned long mem_offset; /* bus->cpu memory mapping offset */
32 unsigned long io_offset; /* bus->cpu IO mapping offset */
33 struct pci_bus *bus; /* PCI bus */
34 struct resource *resource[3]; /* Primary PCI bus resources */
35 /* Bridge swizzling */
36 u8 (*swizzle)(struct pci_dev *, u8 *);
37 /* IRQ mapping */
38 int (*map_irq)(struct pci_dev *, u8, u8);
39 struct hw_pci *hw;
40};
41
42/*
43 * This is the standard PCI-PCI bridge swizzling algorithm.
44 */
45u8 pci_std_swizzle(struct pci_dev *dev, u8 *pinp);
46
47/*
48 * Call this with your hw_pci struct to initialise the PCI system.
49 */
50void pci_common_init(struct hw_pci *);
51
52/*
53 * PCI controllers
54 */
55extern int iop321_setup(int nr, struct pci_sys_data *);
56extern struct pci_bus *iop321_scan_bus(int nr, struct pci_sys_data *);
57extern void iop321_init(void);
58
59extern int iop331_setup(int nr, struct pci_sys_data *);
60extern struct pci_bus *iop331_scan_bus(int nr, struct pci_sys_data *);
61extern void iop331_init(void);
62
63extern int dc21285_setup(int nr, struct pci_sys_data *);
64extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *);
65extern void dc21285_preinit(void);
66extern void dc21285_postinit(void);
67
68extern int via82c505_setup(int nr, struct pci_sys_data *);
69extern struct pci_bus *via82c505_scan_bus(int nr, struct pci_sys_data *);
70extern void via82c505_init(void *sysdata);
71
72extern int pci_v3_setup(int nr, struct pci_sys_data *);
73extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *);
74extern void pci_v3_preinit(void);
75extern void pci_v3_postinit(void);
diff --git a/include/asm-arm/mach/serial_sa1100.h b/include/asm-arm/mach/serial_sa1100.h
new file mode 100644
index 000000000000..9162018585df
--- /dev/null
+++ b/include/asm-arm/mach/serial_sa1100.h
@@ -0,0 +1,32 @@
1/*
2 * linux/include/asm-arm/mach/serial_sa1100.h
3 *
4 * Author: Nicolas Pitre
5 *
6 * Moved to include/asm-arm/mach and changed lots, Russell King
7 *
8 * Low level machine dependent UART functions.
9 */
10#include <linux/config.h>
11
12struct uart_port;
13struct uart_info;
14
15/*
16 * This is a temporary structure for registering these
17 * functions; it is intended to be discarded after boot.
18 */
19struct sa1100_port_fns {
20 void (*set_mctrl)(struct uart_port *, u_int);
21 u_int (*get_mctrl)(struct uart_port *);
22 void (*pm)(struct uart_port *, u_int, u_int);
23 int (*set_wake)(struct uart_port *, u_int);
24};
25
26#ifdef CONFIG_SERIAL_SA1100
27void sa1100_register_uart_fns(struct sa1100_port_fns *fns);
28void sa1100_register_uart(int idx, int port);
29#else
30#define sa1100_register_uart_fns(fns) do { } while (0)
31#define sa1100_register_uart(idx,port) do { } while (0)
32#endif
diff --git a/include/asm-arm/mach/sharpsl_param.h b/include/asm-arm/mach/sharpsl_param.h
new file mode 100644
index 000000000000..7a24ecf04220
--- /dev/null
+++ b/include/asm-arm/mach/sharpsl_param.h
@@ -0,0 +1,37 @@
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
14struct sharpsl_param_info {
15 unsigned int comadj_keyword;
16 unsigned int comadj;
17
18 unsigned int uuid_keyword;
19 unsigned char uuid[16];
20
21 unsigned int touch_keyword;
22 unsigned int touch_xp;
23 unsigned int touch_yp;
24 unsigned int touch_xd;
25 unsigned int touch_yd;
26
27 unsigned int adadj_keyword;
28 unsigned int adadj;
29
30 unsigned int phad_keyword;
31 unsigned int phadadj;
32} __attribute__((packed));
33
34
35extern struct sharpsl_param_info sharpsl_param;
36extern void sharpsl_save_param(void);
37
diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h
new file mode 100644
index 000000000000..5cf4fd659fd5
--- /dev/null
+++ b/include/asm-arm/mach/time.h
@@ -0,0 +1,54 @@
1/*
2 * linux/include/asm-arm/mach/time.h
3 *
4 * Copyright (C) 2004 MontaVista Software, 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 version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_ARM_MACH_TIME_H
11#define __ASM_ARM_MACH_TIME_H
12
13#include <linux/sysdev.h>
14
15/*
16 * This is our kernel timer structure.
17 *
18 * - init
19 * Initialise the kernels jiffy timer source, claim interrupt
20 * using setup_irq. This is called early on during initialisation
21 * while interrupts are still disabled on the local CPU.
22 * - suspend
23 * Suspend the kernel jiffy timer source, if necessary. This
24 * is called with interrupts disabled, after all normal devices
25 * have been suspended. If no action is required, set this to
26 * NULL.
27 * - resume
28 * Resume the kernel jiffy timer source, if necessary. This
29 * is called with interrupts disabled before any normal devices
30 * are resumed. If no action is required, set this to NULL.
31 * - offset
32 * Return the timer offset in microseconds since the last timer
33 * interrupt. Note: this must take account of any unprocessed
34 * timer interrupt which may be pending.
35 */
36struct sys_timer {
37 struct sys_device dev;
38 void (*init)(void);
39 void (*suspend)(void);
40 void (*resume)(void);
41 unsigned long (*offset)(void);
42};
43
44extern struct sys_timer *system_timer;
45extern void timer_tick(struct pt_regs *);
46
47/*
48 * Kernel time keeping support.
49 */
50extern int (*set_rtc)(void);
51extern void save_time_delta(struct timespec *delta, struct timespec *rtc);
52extern void restore_time_delta(struct timespec *delta, struct timespec *rtc);
53
54#endif
diff --git a/include/asm-arm/mc146818rtc.h b/include/asm-arm/mc146818rtc.h
new file mode 100644
index 000000000000..7b81e0c42543
--- /dev/null
+++ b/include/asm-arm/mc146818rtc.h
@@ -0,0 +1,28 @@
1/*
2 * Machine dependent access functions for RTC registers.
3 */
4#ifndef _ASM_MC146818RTC_H
5#define _ASM_MC146818RTC_H
6
7#include <asm/arch/irqs.h>
8#include <asm/io.h>
9
10#ifndef RTC_PORT
11#define RTC_PORT(x) (0x70 + (x))
12#define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */
13#endif
14
15/*
16 * The yet supported machines all access the RTC index register via
17 * an ISA port access but the way to access the date register differs ...
18 */
19#define CMOS_READ(addr) ({ \
20outb_p((addr),RTC_PORT(0)); \
21inb_p(RTC_PORT(1)); \
22})
23#define CMOS_WRITE(val, addr) ({ \
24outb_p((addr),RTC_PORT(0)); \
25outb_p((val),RTC_PORT(1)); \
26})
27
28#endif /* _ASM_MC146818RTC_H */
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
new file mode 100644
index 000000000000..e47bea7d1723
--- /dev/null
+++ b/include/asm-arm/memory.h
@@ -0,0 +1,200 @@
1/*
2 * linux/include/asm-arm/memory.h
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 * Note: this file should not be included by non-asm/.h files
11 */
12#ifndef __ASM_ARM_MEMORY_H
13#define __ASM_ARM_MEMORY_H
14
15#include <linux/config.h>
16#include <linux/compiler.h>
17#include <asm/arch/memory.h>
18
19#ifndef TASK_SIZE
20/*
21 * TASK_SIZE - the maximum size of a user space task.
22 * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area
23 */
24#define TASK_SIZE (0xbf000000UL)
25#define TASK_UNMAPPED_BASE (0x40000000UL)
26#endif
27
28/*
29 * The maximum size of a 26-bit user space task.
30 */
31#define TASK_SIZE_26 (0x04000000UL)
32
33/*
34 * Page offset: 3GB
35 */
36#ifndef PAGE_OFFSET
37#define PAGE_OFFSET (0xc0000000UL)
38#endif
39
40/*
41 * Physical vs virtual RAM address space conversion. These are
42 * private definitions which should NOT be used outside memory.h
43 * files. Use virt_to_phys/phys_to_virt/__pa/__va instead.
44 */
45#ifndef __virt_to_phys
46#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET)
47#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET)
48#endif
49
50/*
51 * The module space lives between the addresses given by TASK_SIZE
52 * and PAGE_OFFSET - it must be within 32MB of the kernel text.
53 */
54#define MODULE_END (PAGE_OFFSET)
55#define MODULE_START (MODULE_END - 16*1048576)
56
57#if TASK_SIZE > MODULE_START
58#error Top of user space clashes with start of module space
59#endif
60
61#ifndef __ASSEMBLY__
62
63/*
64 * The DMA mask corresponding to the maximum bus address allocatable
65 * using GFP_DMA. The default here places no restriction on DMA
66 * allocations. This must be the smallest DMA mask in the system,
67 * so a successful GFP_DMA allocation will always satisfy this.
68 */
69#ifndef ISA_DMA_THRESHOLD
70#define ISA_DMA_THRESHOLD (0xffffffffULL)
71#endif
72
73#ifndef arch_adjust_zones
74#define arch_adjust_zones(node,size,holes) do { } while (0)
75#endif
76
77/*
78 * PFNs are used to describe any physical page; this means
79 * PFN 0 == physical address 0.
80 *
81 * This is the PFN of the first RAM page in the kernel
82 * direct-mapped view. We assume this is the first page
83 * of RAM in the mem_map as well.
84 */
85#define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT)
86
87/*
88 * These are *only* valid on the kernel direct mapped RAM memory.
89 * Note: Drivers should NOT use these. They are the wrong
90 * translation for translating DMA addresses. Use the driver
91 * DMA support - see dma-mapping.h.
92 */
93static inline unsigned long virt_to_phys(void *x)
94{
95 return __virt_to_phys((unsigned long)(x));
96}
97
98static inline void *phys_to_virt(unsigned long x)
99{
100 return (void *)(__phys_to_virt((unsigned long)(x)));
101}
102
103/*
104 * Drivers should NOT use these either.
105 */
106#define __pa(x) __virt_to_phys((unsigned long)(x))
107#define __va(x) ((void *)__phys_to_virt((unsigned long)(x)))
108
109/*
110 * Virtual <-> DMA view memory address translations
111 * Again, these are *only* valid on the kernel direct mapped RAM
112 * memory. Use of these is *deprecated* (and that doesn't mean
113 * use the __ prefixed forms instead.) See dma-mapping.h.
114 */
115static inline __deprecated unsigned long virt_to_bus(void *x)
116{
117 return __virt_to_bus((unsigned long)x);
118}
119
120static inline __deprecated void *bus_to_virt(unsigned long x)
121{
122 return (void *)__bus_to_virt(x);
123}
124
125/*
126 * Conversion between a struct page and a physical address.
127 *
128 * Note: when converting an unknown physical address to a
129 * struct page, the resulting pointer must be validated
130 * using VALID_PAGE(). It must return an invalid struct page
131 * for any physical address not corresponding to a system
132 * RAM address.
133 *
134 * page_to_pfn(page) convert a struct page * to a PFN number
135 * pfn_to_page(pfn) convert a _valid_ PFN number to struct page *
136 * pfn_valid(pfn) indicates whether a PFN number is valid
137 *
138 * virt_to_page(k) convert a _valid_ virtual address to struct page *
139 * virt_addr_valid(k) indicates whether a virtual address is valid
140 */
141#ifndef CONFIG_DISCONTIGMEM
142
143#define page_to_pfn(page) (((page) - mem_map) + PHYS_PFN_OFFSET)
144#define pfn_to_page(pfn) ((mem_map + (pfn)) - PHYS_PFN_OFFSET)
145#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
146
147#define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT))
148#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
149
150#define PHYS_TO_NID(addr) (0)
151
152#else /* CONFIG_DISCONTIGMEM */
153
154/*
155 * This is more complex. We have a set of mem_map arrays spread
156 * around in memory.
157 */
158#include <linux/numa.h>
159
160#define page_to_pfn(page) \
161 (( (page) - page_zone(page)->zone_mem_map) \
162 + page_zone(page)->zone_start_pfn)
163#define pfn_to_page(pfn) \
164 (PFN_TO_MAPBASE(pfn) + LOCAL_MAP_NR((pfn) << PAGE_SHIFT))
165#define pfn_valid(pfn) (PFN_TO_NID(pfn) < MAX_NUMNODES)
166
167#define virt_to_page(kaddr) \
168 (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
169#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < MAX_NUMNODES)
170
171/*
172 * Common discontigmem stuff.
173 * PHYS_TO_NID is used by the ARM kernel/setup.c
174 */
175#define PHYS_TO_NID(addr) PFN_TO_NID((addr) >> PAGE_SHIFT)
176
177#endif /* !CONFIG_DISCONTIGMEM */
178
179/*
180 * For BIO. "will die". Kill me when bio_to_phys() and bvec_to_phys() die.
181 */
182#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
183
184/*
185 * Optional device DMA address remapping. Do _not_ use directly!
186 * We should really eliminate virt_to_bus() here - it's deprecated.
187 */
188#ifndef __arch_page_to_dma
189#define page_to_dma(dev, page) ((dma_addr_t)__virt_to_bus((unsigned long)page_address(page)))
190#define dma_to_virt(dev, addr) ((void *)__bus_to_virt(addr))
191#define virt_to_dma(dev, addr) ((dma_addr_t)__virt_to_bus((unsigned long)(addr)))
192#else
193#define page_to_dma(dev, page) (__arch_page_to_dma(dev, page))
194#define dma_to_virt(dev, addr) (__arch_dma_to_virt(dev, addr))
195#define virt_to_dma(dev, addr) (__arch_virt_to_dma(dev, addr))
196#endif
197
198#endif
199
200#endif
diff --git a/include/asm-arm/mman.h b/include/asm-arm/mman.h
new file mode 100644
index 000000000000..8e4f69c4fa5f
--- /dev/null
+++ b/include/asm-arm/mman.h
@@ -0,0 +1,43 @@
1#ifndef __ARM_MMAN_H__
2#define __ARM_MMAN_H__
3
4#define PROT_READ 0x1 /* page can be read */
5#define PROT_WRITE 0x2 /* page can be written */
6#define PROT_EXEC 0x4 /* page can be executed */
7#define PROT_SEM 0x8 /* page may be used for atomic ops */
8#define PROT_NONE 0x0 /* page can not be accessed */
9#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
10#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
11
12#define MAP_SHARED 0x01 /* Share changes */
13#define MAP_PRIVATE 0x02 /* Changes are private */
14#define MAP_TYPE 0x0f /* Mask for type of mapping */
15#define MAP_FIXED 0x10 /* Interpret addr exactly */
16#define MAP_ANONYMOUS 0x20 /* don't use a file */
17
18#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
19#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
20#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
21#define MAP_LOCKED 0x2000 /* pages are locked */
22#define MAP_NORESERVE 0x4000 /* don't check for reservations */
23#define MAP_POPULATE 0x8000 /* populate (prefault) page tables */
24#define MAP_NONBLOCK 0x10000 /* do not block on IO */
25
26#define MS_ASYNC 1 /* sync memory asynchronously */
27#define MS_INVALIDATE 2 /* invalidate the caches */
28#define MS_SYNC 4 /* synchronous memory sync */
29
30#define MCL_CURRENT 1 /* lock all current mappings */
31#define MCL_FUTURE 2 /* lock all future mappings */
32
33#define MADV_NORMAL 0x0 /* default page-in behavior */
34#define MADV_RANDOM 0x1 /* page-in minimum required */
35#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
36#define MADV_WILLNEED 0x3 /* pre-fault pages */
37#define MADV_DONTNEED 0x4 /* discard these pages */
38
39/* compatibility flags */
40#define MAP_ANON MAP_ANONYMOUS
41#define MAP_FILE 0
42
43#endif /* __ARM_MMAN_H__ */
diff --git a/include/asm-arm/mmu.h b/include/asm-arm/mmu.h
new file mode 100644
index 000000000000..a457cb71984f
--- /dev/null
+++ b/include/asm-arm/mmu.h
@@ -0,0 +1,16 @@
1#ifndef __ARM_MMU_H
2#define __ARM_MMU_H
3
4typedef struct {
5#if __LINUX_ARM_ARCH__ >= 6
6 unsigned int id;
7#endif
8} mm_context_t;
9
10#if __LINUX_ARM_ARCH__ >= 6
11#define ASID(mm) ((mm)->context.id & 255)
12#else
13#define ASID(mm) (0)
14#endif
15
16#endif
diff --git a/include/asm-arm/mmu_context.h b/include/asm-arm/mmu_context.h
new file mode 100644
index 000000000000..4af9c411c617
--- /dev/null
+++ b/include/asm-arm/mmu_context.h
@@ -0,0 +1,96 @@
1/*
2 * linux/include/asm-arm/mmu_context.h
3 *
4 * Copyright (C) 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 * Changelog:
11 * 27-06-1996 RMK Created
12 */
13#ifndef __ASM_ARM_MMU_CONTEXT_H
14#define __ASM_ARM_MMU_CONTEXT_H
15
16#include <asm/proc-fns.h>
17
18#if __LINUX_ARM_ARCH__ >= 6
19
20/*
21 * On ARMv6, we have the following structure in the Context ID:
22 *
23 * 31 7 0
24 * +-------------------------+-----------+
25 * | process ID | ASID |
26 * +-------------------------+-----------+
27 * | context ID |
28 * +-------------------------------------+
29 *
30 * The ASID is used to tag entries in the CPU caches and TLBs.
31 * The context ID is used by debuggers and trace logic, and
32 * should be unique within all running processes.
33 */
34#define ASID_BITS 8
35#define ASID_MASK ((~0) << ASID_BITS)
36
37extern unsigned int cpu_last_asid;
38
39void __init_new_context(struct task_struct *tsk, struct mm_struct *mm);
40void __new_context(struct mm_struct *mm);
41
42static inline void check_context(struct mm_struct *mm)
43{
44 if (unlikely((mm->context.id ^ cpu_last_asid) >> ASID_BITS))
45 __new_context(mm);
46}
47
48#define init_new_context(tsk,mm) (__init_new_context(tsk,mm),0)
49
50#else
51
52#define check_context(mm) do { } while (0)
53#define init_new_context(tsk,mm) 0
54
55#endif
56
57#define destroy_context(mm) do { } while(0)
58
59/*
60 * This is called when "tsk" is about to enter lazy TLB mode.
61 *
62 * mm: describes the currently active mm context
63 * tsk: task which is entering lazy tlb
64 * cpu: cpu number which is entering lazy tlb
65 *
66 * tsk->mm will be NULL
67 */
68static inline void
69enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
70{
71}
72
73/*
74 * This is the actual mm switch as far as the scheduler
75 * is concerned. No registers are touched. We avoid
76 * calling the CPU specific function when the mm hasn't
77 * actually changed.
78 */
79static inline void
80switch_mm(struct mm_struct *prev, struct mm_struct *next,
81 struct task_struct *tsk)
82{
83 unsigned int cpu = smp_processor_id();
84
85 if (prev != next) {
86 cpu_set(cpu, next->cpu_vm_mask);
87 check_context(next);
88 cpu_switch_mm(next->pgd, next);
89 cpu_clear(cpu, prev->cpu_vm_mask);
90 }
91}
92
93#define deactivate_mm(tsk,mm) do { } while (0)
94#define activate_mm(prev,next) switch_mm(prev, next, NULL)
95
96#endif
diff --git a/include/asm-arm/mmzone.h b/include/asm-arm/mmzone.h
new file mode 100644
index 000000000000..b87de151f0a4
--- /dev/null
+++ b/include/asm-arm/mmzone.h
@@ -0,0 +1,30 @@
1/*
2 * linux/include/asm-arm/mmzone.h
3 *
4 * 1999-12-29 Nicolas Pitre Created
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#ifndef __ASM_MMZONE_H
11#define __ASM_MMZONE_H
12
13/*
14 * Currently defined in arch/arm/mm/discontig.c
15 */
16extern pg_data_t discontig_node_data[];
17
18/*
19 * Return a pointer to the node data for node n.
20 */
21#define NODE_DATA(nid) (&discontig_node_data[nid])
22
23/*
24 * NODE_MEM_MAP gives the kaddr for the mem_map of the node.
25 */
26#define NODE_MEM_MAP(nid) (NODE_DATA(nid)->node_mem_map)
27
28#include <asm/arch/memory.h>
29
30#endif
diff --git a/include/asm-arm/module.h b/include/asm-arm/module.h
new file mode 100644
index 000000000000..24b168dc31a3
--- /dev/null
+++ b/include/asm-arm/module.h
@@ -0,0 +1,18 @@
1#ifndef _ASM_ARM_MODULE_H
2#define _ASM_ARM_MODULE_H
3
4struct mod_arch_specific
5{
6 int foo;
7};
8
9#define Elf_Shdr Elf32_Shdr
10#define Elf_Sym Elf32_Sym
11#define Elf_Ehdr Elf32_Ehdr
12
13/*
14 * Include the ARM architecture version.
15 */
16#define MODULE_ARCH_VERMAGIC "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
17
18#endif /* _ASM_ARM_MODULE_H */
diff --git a/include/asm-arm/msgbuf.h b/include/asm-arm/msgbuf.h
new file mode 100644
index 000000000000..33b35b946eaa
--- /dev/null
+++ b/include/asm-arm/msgbuf.h
@@ -0,0 +1,31 @@
1#ifndef _ASMARM_MSGBUF_H
2#define _ASMARM_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct msqid64_ds {
15 struct ipc64_perm msg_perm;
16 __kernel_time_t msg_stime; /* last msgsnd time */
17 unsigned long __unused1;
18 __kernel_time_t msg_rtime; /* last msgrcv time */
19 unsigned long __unused2;
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long __unused3;
22 unsigned long msg_cbytes; /* current number of bytes on queue */
23 unsigned long msg_qnum; /* number of messages in queue */
24 unsigned long msg_qbytes; /* max number of bytes on queue */
25 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
26 __kernel_pid_t msg_lrpid; /* last receive pid */
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31#endif /* _ASMARM_MSGBUF_H */
diff --git a/include/asm-arm/namei.h b/include/asm-arm/namei.h
new file mode 100644
index 000000000000..a402d3b9d0f7
--- /dev/null
+++ b/include/asm-arm/namei.h
@@ -0,0 +1,25 @@
1/*
2 * linux/include/asm-arm/namei.h
3 *
4 * Routines to handle famous /usr/gnemul
5 * Derived from the Sparc version of this file
6 *
7 * Included from linux/fs/namei.c
8 */
9
10#ifndef __ASMARM_NAMEI_H
11#define __ASMARM_NAMEI_H
12
13#define ARM_BSD_EMUL "usr/gnemul/bsd/"
14
15static inline char *__emul_prefix(void)
16{
17 switch (current->personality) {
18 case PER_BSD:
19 return ARM_BSD_EMUL;
20 default:
21 return NULL;
22 }
23}
24
25#endif /* __ASMARM_NAMEI_H */
diff --git a/include/asm-arm/numnodes.h b/include/asm-arm/numnodes.h
new file mode 100644
index 000000000000..5d2a1034a02e
--- /dev/null
+++ b/include/asm-arm/numnodes.h
@@ -0,0 +1,24 @@
1/*
2 * linux/include/asm-arm/numnodes.h
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
11/* This declaration for the size of the NUMA (CONFIG_DISCONTIGMEM)
12 * memory node table is the default.
13 *
14 * A good place to override this value is include/asm/arch/memory.h.
15 */
16
17#ifndef __ASM_ARM_NUMNODES_H
18#define __ASM_ARM_NUMNODES_H
19
20#ifndef NODES_SHIFT
21# define NODES_SHIFT 2 /* Normally, Max 4 Nodes */
22#endif
23
24#endif
diff --git a/include/asm-arm/nwflash.h b/include/asm-arm/nwflash.h
new file mode 100644
index 000000000000..04e5a557a884
--- /dev/null
+++ b/include/asm-arm/nwflash.h
@@ -0,0 +1,9 @@
1#ifndef _FLASH_H
2#define _FLASH_H
3
4#define FLASH_MINOR 160 /* MAJOR is 10 - miscdevice */
5#define CMD_WRITE_DISABLE 0
6#define CMD_WRITE_ENABLE 0x28
7#define CMD_WRITE_BASE64K_ENABLE 0x47
8
9#endif /* _FLASH_H */
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h
new file mode 100644
index 000000000000..4ca3a8e9348f
--- /dev/null
+++ b/include/asm-arm/page.h
@@ -0,0 +1,197 @@
1/*
2 * linux/include/asm-arm/page.h
3 *
4 * Copyright (C) 1995-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#ifndef _ASMARM_PAGE_H
11#define _ASMARM_PAGE_H
12
13#include <linux/config.h>
14
15/* PAGE_SHIFT determines the page size */
16#define PAGE_SHIFT 12
17#define PAGE_SIZE (1UL << PAGE_SHIFT)
18#define PAGE_MASK (~(PAGE_SIZE-1))
19
20#ifdef __KERNEL__
21
22/* to align the pointer to the (next) page boundary */
23#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
24
25#ifndef __ASSEMBLY__
26
27#include <asm/glue.h>
28
29/*
30 * User Space Model
31 * ================
32 *
33 * This section selects the correct set of functions for dealing with
34 * page-based copying and clearing for user space for the particular
35 * processor(s) we're building for.
36 *
37 * We have the following to choose from:
38 * v3 - ARMv3
39 * v4wt - ARMv4 with writethrough cache, without minicache
40 * v4wb - ARMv4 with writeback cache, without minicache
41 * v4_mc - ARMv4 with minicache
42 * xscale - Xscale
43 */
44#undef _USER
45#undef MULTI_USER
46
47#ifdef CONFIG_CPU_COPY_V3
48# ifdef _USER
49# define MULTI_USER 1
50# else
51# define _USER v3
52# endif
53#endif
54
55#ifdef CONFIG_CPU_COPY_V4WT
56# ifdef _USER
57# define MULTI_USER 1
58# else
59# define _USER v4wt
60# endif
61#endif
62
63#ifdef CONFIG_CPU_COPY_V4WB
64# ifdef _USER
65# define MULTI_USER 1
66# else
67# define _USER v4wb
68# endif
69#endif
70
71#ifdef CONFIG_CPU_SA1100
72# ifdef _USER
73# define MULTI_USER 1
74# else
75# define _USER v4_mc
76# endif
77#endif
78
79#ifdef CONFIG_CPU_XSCALE
80# ifdef _USER
81# define MULTI_USER 1
82# else
83# define _USER xscale_mc
84# endif
85#endif
86
87#ifdef CONFIG_CPU_COPY_V6
88# define MULTI_USER 1
89#endif
90
91#if !defined(_USER) && !defined(MULTI_USER)
92#error Unknown user operations model
93#endif
94
95struct cpu_user_fns {
96 void (*cpu_clear_user_page)(void *p, unsigned long user);
97 void (*cpu_copy_user_page)(void *to, const void *from,
98 unsigned long user);
99};
100
101#ifdef MULTI_USER
102extern struct cpu_user_fns cpu_user;
103
104#define __cpu_clear_user_page cpu_user.cpu_clear_user_page
105#define __cpu_copy_user_page cpu_user.cpu_copy_user_page
106
107#else
108
109#define __cpu_clear_user_page __glue(_USER,_clear_user_page)
110#define __cpu_copy_user_page __glue(_USER,_copy_user_page)
111
112extern void __cpu_clear_user_page(void *p, unsigned long user);
113extern void __cpu_copy_user_page(void *to, const void *from,
114 unsigned long user);
115#endif
116
117#define clear_user_page(addr,vaddr,pg) \
118 do { \
119 preempt_disable(); \
120 __cpu_clear_user_page(addr, vaddr); \
121 preempt_enable(); \
122 } while (0)
123
124#define copy_user_page(to,from,vaddr,pg) \
125 do { \
126 preempt_disable(); \
127 __cpu_copy_user_page(to, from, vaddr); \
128 preempt_enable(); \
129 } while (0)
130
131#define clear_page(page) memzero((void *)(page), PAGE_SIZE)
132extern void copy_page(void *to, const void *from);
133
134#undef STRICT_MM_TYPECHECKS
135
136#ifdef STRICT_MM_TYPECHECKS
137/*
138 * These are used to make use of C type-checking..
139 */
140typedef struct { unsigned long pte; } pte_t;
141typedef struct { unsigned long pmd; } pmd_t;
142typedef struct { unsigned long pgd[2]; } pgd_t;
143typedef struct { unsigned long pgprot; } pgprot_t;
144
145#define pte_val(x) ((x).pte)
146#define pmd_val(x) ((x).pmd)
147#define pgd_val(x) ((x).pgd[0])
148#define pgprot_val(x) ((x).pgprot)
149
150#define __pte(x) ((pte_t) { (x) } )
151#define __pmd(x) ((pmd_t) { (x) } )
152#define __pgprot(x) ((pgprot_t) { (x) } )
153
154#else
155/*
156 * .. while these make it easier on the compiler
157 */
158typedef unsigned long pte_t;
159typedef unsigned long pmd_t;
160typedef unsigned long pgd_t[2];
161typedef unsigned long pgprot_t;
162
163#define pte_val(x) (x)
164#define pmd_val(x) (x)
165#define pgd_val(x) ((x)[0])
166#define pgprot_val(x) (x)
167
168#define __pte(x) (x)
169#define __pmd(x) (x)
170#define __pgprot(x) (x)
171
172#endif /* STRICT_MM_TYPECHECKS */
173
174/* Pure 2^n version of get_order */
175static inline int get_order(unsigned long size)
176{
177 int order;
178
179 size = (size-1) >> (PAGE_SHIFT-1);
180 order = -1;
181 do {
182 size >>= 1;
183 order++;
184 } while (size);
185 return order;
186}
187
188#include <asm/memory.h>
189
190#endif /* !__ASSEMBLY__ */
191
192#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
193 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
194
195#endif /* __KERNEL__ */
196
197#endif
diff --git a/include/asm-arm/param.h b/include/asm-arm/param.h
new file mode 100644
index 000000000000..94223d4d7e88
--- /dev/null
+++ b/include/asm-arm/param.h
@@ -0,0 +1,36 @@
1/*
2 * linux/include/asm-arm/param.h
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#ifndef __ASM_PARAM_H
11#define __ASM_PARAM_H
12
13#ifdef __KERNEL__
14# include <asm/arch/param.h> /* for kernel version of HZ */
15
16# ifndef HZ
17# define HZ 100 /* Internal kernel timer frequency */
18# endif
19
20# define USER_HZ 100 /* User interfaces are in "ticks" */
21# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
22#else
23# define HZ 100
24#endif
25
26#define EXEC_PAGESIZE 4096
27
28#ifndef NOGROUP
29#define NOGROUP (-1)
30#endif
31
32/* max length of hostname */
33#define MAXHOSTNAMELEN 64
34
35#endif
36
diff --git a/include/asm-arm/parport.h b/include/asm-arm/parport.h
new file mode 100644
index 000000000000..f2f90c76ddd1
--- /dev/null
+++ b/include/asm-arm/parport.h
@@ -0,0 +1,18 @@
1/*
2 * linux/include/asm-arm/parport.h: ARM-specific parport initialisation
3 *
4 * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
5 *
6 * This file should only be included by drivers/parport/parport_pc.c.
7 */
8
9#ifndef __ASMARM_PARPORT_H
10#define __ASMARM_PARPORT_H
11
12static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
13static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
14{
15 return parport_pc_find_isa_ports (autoirq, autodma);
16}
17
18#endif /* !(_ASMARM_PARPORT_H) */
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
new file mode 100644
index 000000000000..40ffaefbeb1a
--- /dev/null
+++ b/include/asm-arm/pci.h
@@ -0,0 +1,59 @@
1#ifndef ASMARM_PCI_H
2#define ASMARM_PCI_H
3
4#ifdef __KERNEL__
5#include <linux/config.h>
6#include <asm-generic/pci-dma-compat.h>
7
8#include <asm/hardware.h> /* for PCIBIOS_MIN_* */
9
10#define pcibios_scan_all_fns(a, b) 0
11
12static inline void pcibios_set_master(struct pci_dev *dev)
13{
14 /* No special bus mastering setup handling */
15}
16
17static inline void pcibios_penalize_isa_irq(int irq)
18{
19 /* We don't do dynamic PCI IRQ allocation */
20}
21
22/*
23 * The PCI address space does equal the physical memory address space.
24 * The networking and block device layers use this boolean for bounce
25 * buffer decisions.
26 */
27#define PCI_DMA_BUS_IS_PHYS (0)
28
29/*
30 * We don't support DAC DMA cycles.
31 */
32#define pci_dac_dma_supported(pci_dev, mask) (0)
33
34/*
35 * Whether pci_unmap_{single,page} is a nop depends upon the
36 * configuration.
37 */
38#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
39#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
40#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
41#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
42#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
43#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
44
45#define HAVE_PCI_MMAP
46extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
47 enum pci_mmap_state mmap_state, int write_combine);
48
49extern void
50pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
51 struct resource *res);
52
53static inline void pcibios_add_platform_entries(struct pci_dev *dev)
54{
55}
56
57#endif /* __KERNEL__ */
58
59#endif
diff --git a/include/asm-arm/percpu.h b/include/asm-arm/percpu.h
new file mode 100644
index 000000000000..b4e32d8ec072
--- /dev/null
+++ b/include/asm-arm/percpu.h
@@ -0,0 +1,6 @@
1#ifndef __ARM_PERCPU
2#define __ARM_PERCPU
3
4#include <asm-generic/percpu.h>
5
6#endif
diff --git a/include/asm-arm/pgalloc.h b/include/asm-arm/pgalloc.h
new file mode 100644
index 000000000000..e814f8144f8b
--- /dev/null
+++ b/include/asm-arm/pgalloc.h
@@ -0,0 +1,130 @@
1/*
2 * linux/include/asm-arm/pgalloc.h
3 *
4 * Copyright (C) 2000-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#ifndef _ASMARM_PGALLOC_H
11#define _ASMARM_PGALLOC_H
12
13#include <asm/processor.h>
14#include <asm/cacheflush.h>
15#include <asm/tlbflush.h>
16
17/*
18 * Since we have only two-level page tables, these are trivial
19 */
20#define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); })
21#define pmd_free(pmd) do { } while (0)
22#define pgd_populate(mm,pmd,pte) BUG()
23
24extern pgd_t *get_pgd_slow(struct mm_struct *mm);
25extern void free_pgd_slow(pgd_t *pgd);
26
27#define pgd_alloc(mm) get_pgd_slow(mm)
28#define pgd_free(pgd) free_pgd_slow(pgd)
29
30#define check_pgt_cache() do { } while (0)
31
32/*
33 * Allocate one PTE table.
34 *
35 * This actually allocates two hardware PTE tables, but we wrap this up
36 * into one table thus:
37 *
38 * +------------+
39 * | h/w pt 0 |
40 * +------------+
41 * | h/w pt 1 |
42 * +------------+
43 * | Linux pt 0 |
44 * +------------+
45 * | Linux pt 1 |
46 * +------------+
47 */
48static inline pte_t *
49pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
50{
51 pte_t *pte;
52
53 pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
54 if (pte) {
55 clean_dcache_area(pte, sizeof(pte_t) * PTRS_PER_PTE);
56 pte += PTRS_PER_PTE;
57 }
58
59 return pte;
60}
61
62static inline struct page *
63pte_alloc_one(struct mm_struct *mm, unsigned long addr)
64{
65 struct page *pte;
66
67 pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
68 if (pte) {
69 void *page = page_address(pte);
70 clean_dcache_area(page, sizeof(pte_t) * PTRS_PER_PTE);
71 }
72
73 return pte;
74}
75
76/*
77 * Free one PTE table.
78 */
79static inline void pte_free_kernel(pte_t *pte)
80{
81 if (pte) {
82 pte -= PTRS_PER_PTE;
83 free_page((unsigned long)pte);
84 }
85}
86
87static inline void pte_free(struct page *pte)
88{
89 __free_page(pte);
90}
91
92/*
93 * Populate the pmdp entry with a pointer to the pte. This pmd is part
94 * of the mm address space.
95 *
96 * Ensure that we always set both PMD entries.
97 */
98static inline void
99pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
100{
101 unsigned long pte_ptr = (unsigned long)ptep;
102 unsigned long pmdval;
103
104 BUG_ON(mm != &init_mm);
105
106 /*
107 * The pmd must be loaded with the physical
108 * address of the PTE table
109 */
110 pte_ptr -= PTRS_PER_PTE * sizeof(void *);
111 pmdval = __pa(pte_ptr) | _PAGE_KERNEL_TABLE;
112 pmdp[0] = __pmd(pmdval);
113 pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
114 flush_pmd_entry(pmdp);
115}
116
117static inline void
118pmd_populate(struct mm_struct *mm, pmd_t *pmdp, struct page *ptep)
119{
120 unsigned long pmdval;
121
122 BUG_ON(mm == &init_mm);
123
124 pmdval = page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE;
125 pmdp[0] = __pmd(pmdval);
126 pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
127 flush_pmd_entry(pmdp);
128}
129
130#endif
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
new file mode 100644
index 000000000000..91ffb1f4cd10
--- /dev/null
+++ b/include/asm-arm/pgtable.h
@@ -0,0 +1,433 @@
1/*
2 * linux/include/asm-arm/pgtable.h
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#ifndef _ASMARM_PGTABLE_H
11#define _ASMARM_PGTABLE_H
12
13#include <asm-generic/4level-fixup.h>
14
15#include <asm/memory.h>
16#include <asm/proc-fns.h>
17#include <asm/arch/vmalloc.h>
18
19/*
20 * Hardware-wise, we have a two level page table structure, where the first
21 * level has 4096 entries, and the second level has 256 entries. Each entry
22 * is one 32-bit word. Most of the bits in the second level entry are used
23 * by hardware, and there aren't any "accessed" and "dirty" bits.
24 *
25 * Linux on the other hand has a three level page table structure, which can
26 * be wrapped to fit a two level page table structure easily - using the PGD
27 * and PTE only. However, Linux also expects one "PTE" table per page, and
28 * at least a "dirty" bit.
29 *
30 * Therefore, we tweak the implementation slightly - we tell Linux that we
31 * have 2048 entries in the first level, each of which is 8 bytes (iow, two
32 * hardware pointers to the second level.) The second level contains two
33 * hardware PTE tables arranged contiguously, followed by Linux versions
34 * which contain the state information Linux needs. We, therefore, end up
35 * with 512 entries in the "PTE" level.
36 *
37 * This leads to the page tables having the following layout:
38 *
39 * pgd pte
40 * | |
41 * +--------+ +0
42 * | |-----> +------------+ +0
43 * +- - - - + +4 | h/w pt 0 |
44 * | |-----> +------------+ +1024
45 * +--------+ +8 | h/w pt 1 |
46 * | | +------------+ +2048
47 * +- - - - + | Linux pt 0 |
48 * | | +------------+ +3072
49 * +--------+ | Linux pt 1 |
50 * | | +------------+ +4096
51 *
52 * See L_PTE_xxx below for definitions of bits in the "Linux pt", and
53 * PTE_xxx for definitions of bits appearing in the "h/w pt".
54 *
55 * PMD_xxx definitions refer to bits in the first level page table.
56 *
57 * The "dirty" bit is emulated by only granting hardware write permission
58 * iff the page is marked "writable" and "dirty" in the Linux PTE. This
59 * means that a write to a clean page will cause a permission fault, and
60 * the Linux MM layer will mark the page dirty via handle_pte_fault().
61 * For the hardware to notice the permission change, the TLB entry must
62 * be flushed, and ptep_establish() does that for us.
63 *
64 * The "accessed" or "young" bit is emulated by a similar method; we only
65 * allow accesses to the page if the "young" bit is set. Accesses to the
66 * page will cause a fault, and handle_pte_fault() will set the young bit
67 * for us as long as the page is marked present in the corresponding Linux
68 * PTE entry. Again, ptep_establish() will ensure that the TLB is up to
69 * date.
70 *
71 * However, when the "young" bit is cleared, we deny access to the page
72 * by clearing the hardware PTE. Currently Linux does not flush the TLB
73 * for us in this case, which means the TLB will retain the transation
74 * until either the TLB entry is evicted under pressure, or a context
75 * switch which changes the user space mapping occurs.
76 */
77#define PTRS_PER_PTE 512
78#define PTRS_PER_PMD 1
79#define PTRS_PER_PGD 2048
80
81/*
82 * PMD_SHIFT determines the size of the area a second-level page table can map
83 * PGDIR_SHIFT determines what a third-level page table entry can map
84 */
85#define PMD_SHIFT 21
86#define PGDIR_SHIFT 21
87
88#define LIBRARY_TEXT_START 0x0c000000
89
90#ifndef __ASSEMBLY__
91extern void __pte_error(const char *file, int line, unsigned long val);
92extern void __pmd_error(const char *file, int line, unsigned long val);
93extern void __pgd_error(const char *file, int line, unsigned long val);
94
95#define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte_val(pte))
96#define pmd_ERROR(pmd) __pmd_error(__FILE__, __LINE__, pmd_val(pmd))
97#define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd_val(pgd))
98#endif /* !__ASSEMBLY__ */
99
100#define PMD_SIZE (1UL << PMD_SHIFT)
101#define PMD_MASK (~(PMD_SIZE-1))
102#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
103#define PGDIR_MASK (~(PGDIR_SIZE-1))
104
105#define FIRST_USER_PGD_NR 1
106#define USER_PTRS_PER_PGD ((TASK_SIZE/PGDIR_SIZE) - FIRST_USER_PGD_NR)
107
108/*
109 * ARMv6 supersection address mask and size definitions.
110 */
111#define SUPERSECTION_SHIFT 24
112#define SUPERSECTION_SIZE (1UL << SUPERSECTION_SHIFT)
113#define SUPERSECTION_MASK (~(SUPERSECTION_SIZE-1))
114
115/*
116 * Hardware page table definitions.
117 *
118 * + Level 1 descriptor (PMD)
119 * - common
120 */
121#define PMD_TYPE_MASK (3 << 0)
122#define PMD_TYPE_FAULT (0 << 0)
123#define PMD_TYPE_TABLE (1 << 0)
124#define PMD_TYPE_SECT (2 << 0)
125#define PMD_BIT4 (1 << 4)
126#define PMD_DOMAIN(x) ((x) << 5)
127#define PMD_PROTECTION (1 << 9) /* v5 */
128/*
129 * - section
130 */
131#define PMD_SECT_BUFFERABLE (1 << 2)
132#define PMD_SECT_CACHEABLE (1 << 3)
133#define PMD_SECT_AP_WRITE (1 << 10)
134#define PMD_SECT_AP_READ (1 << 11)
135#define PMD_SECT_TEX(x) ((x) << 12) /* v5 */
136#define PMD_SECT_APX (1 << 15) /* v6 */
137#define PMD_SECT_S (1 << 16) /* v6 */
138#define PMD_SECT_nG (1 << 17) /* v6 */
139#define PMD_SECT_SUPER (1 << 18) /* v6 */
140
141#define PMD_SECT_UNCACHED (0)
142#define PMD_SECT_BUFFERED (PMD_SECT_BUFFERABLE)
143#define PMD_SECT_WT (PMD_SECT_CACHEABLE)
144#define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
145#define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE)
146#define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
147
148/*
149 * - coarse table (not used)
150 */
151
152/*
153 * + Level 2 descriptor (PTE)
154 * - common
155 */
156#define PTE_TYPE_MASK (3 << 0)
157#define PTE_TYPE_FAULT (0 << 0)
158#define PTE_TYPE_LARGE (1 << 0)
159#define PTE_TYPE_SMALL (2 << 0)
160#define PTE_TYPE_EXT (3 << 0) /* v5 */
161#define PTE_BUFFERABLE (1 << 2)
162#define PTE_CACHEABLE (1 << 3)
163
164/*
165 * - extended small page/tiny page
166 */
167#define PTE_EXT_AP_MASK (3 << 4)
168#define PTE_EXT_AP_UNO_SRO (0 << 4)
169#define PTE_EXT_AP_UNO_SRW (1 << 4)
170#define PTE_EXT_AP_URO_SRW (2 << 4)
171#define PTE_EXT_AP_URW_SRW (3 << 4)
172#define PTE_EXT_TEX(x) ((x) << 6) /* v5 */
173
174/*
175 * - small page
176 */
177#define PTE_SMALL_AP_MASK (0xff << 4)
178#define PTE_SMALL_AP_UNO_SRO (0x00 << 4)
179#define PTE_SMALL_AP_UNO_SRW (0x55 << 4)
180#define PTE_SMALL_AP_URO_SRW (0xaa << 4)
181#define PTE_SMALL_AP_URW_SRW (0xff << 4)
182
183/*
184 * "Linux" PTE definitions.
185 *
186 * We keep two sets of PTEs - the hardware and the linux version.
187 * This allows greater flexibility in the way we map the Linux bits
188 * onto the hardware tables, and allows us to have YOUNG and DIRTY
189 * bits.
190 *
191 * The PTE table pointer refers to the hardware entries; the "Linux"
192 * entries are stored 1024 bytes below.
193 */
194#define L_PTE_PRESENT (1 << 0)
195#define L_PTE_FILE (1 << 1) /* only when !PRESENT */
196#define L_PTE_YOUNG (1 << 1)
197#define L_PTE_BUFFERABLE (1 << 2) /* matches PTE */
198#define L_PTE_CACHEABLE (1 << 3) /* matches PTE */
199#define L_PTE_USER (1 << 4)
200#define L_PTE_WRITE (1 << 5)
201#define L_PTE_EXEC (1 << 6)
202#define L_PTE_DIRTY (1 << 7)
203
204#ifndef __ASSEMBLY__
205
206#include <asm/domain.h>
207
208#define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER))
209#define _PAGE_KERNEL_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL))
210
211/*
212 * The following macros handle the cache and bufferable bits...
213 */
214#define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_CACHEABLE | L_PTE_BUFFERABLE
215#define _L_PTE_READ L_PTE_USER | L_PTE_EXEC
216
217extern pgprot_t pgprot_kernel;
218
219#define PAGE_NONE __pgprot(_L_PTE_DEFAULT)
220#define PAGE_COPY __pgprot(_L_PTE_DEFAULT | _L_PTE_READ)
221#define PAGE_SHARED __pgprot(_L_PTE_DEFAULT | _L_PTE_READ | L_PTE_WRITE)
222#define PAGE_READONLY __pgprot(_L_PTE_DEFAULT | _L_PTE_READ)
223#define PAGE_KERNEL pgprot_kernel
224
225#endif /* __ASSEMBLY__ */
226
227/*
228 * The table below defines the page protection levels that we insert into our
229 * Linux page table version. These get translated into the best that the
230 * architecture can perform. Note that on most ARM hardware:
231 * 1) We cannot do execute protection
232 * 2) If we could do execute protection, then read is implied
233 * 3) write implies read permissions
234 */
235#define __P000 PAGE_NONE
236#define __P001 PAGE_READONLY
237#define __P010 PAGE_COPY
238#define __P011 PAGE_COPY
239#define __P100 PAGE_READONLY
240#define __P101 PAGE_READONLY
241#define __P110 PAGE_COPY
242#define __P111 PAGE_COPY
243
244#define __S000 PAGE_NONE
245#define __S001 PAGE_READONLY
246#define __S010 PAGE_SHARED
247#define __S011 PAGE_SHARED
248#define __S100 PAGE_READONLY
249#define __S101 PAGE_READONLY
250#define __S110 PAGE_SHARED
251#define __S111 PAGE_SHARED
252
253#ifndef __ASSEMBLY__
254/*
255 * ZERO_PAGE is a global shared page that is always zero: used
256 * for zero-mapped memory areas etc..
257 */
258extern struct page *empty_zero_page;
259#define ZERO_PAGE(vaddr) (empty_zero_page)
260
261#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
262#define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))
263
264#define pte_none(pte) (!pte_val(pte))
265#define pte_clear(mm,addr,ptep) set_pte_at((mm),(addr),(ptep), __pte(0))
266#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
267#define pte_offset_kernel(dir,addr) (pmd_page_kernel(*(dir)) + __pte_index(addr))
268#define pte_offset_map(dir,addr) (pmd_page_kernel(*(dir)) + __pte_index(addr))
269#define pte_offset_map_nested(dir,addr) (pmd_page_kernel(*(dir)) + __pte_index(addr))
270#define pte_unmap(pte) do { } while (0)
271#define pte_unmap_nested(pte) do { } while (0)
272
273#define set_pte(ptep, pte) cpu_set_pte(ptep,pte)
274#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
275
276/*
277 * The following only work if pte_present() is true.
278 * Undefined behaviour if not..
279 */
280#define pte_present(pte) (pte_val(pte) & L_PTE_PRESENT)
281#define pte_read(pte) (pte_val(pte) & L_PTE_USER)
282#define pte_write(pte) (pte_val(pte) & L_PTE_WRITE)
283#define pte_exec(pte) (pte_val(pte) & L_PTE_EXEC)
284#define pte_dirty(pte) (pte_val(pte) & L_PTE_DIRTY)
285#define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG)
286
287/*
288 * The following only works if pte_present() is not true.
289 */
290#define pte_file(pte) (pte_val(pte) & L_PTE_FILE)
291#define pte_to_pgoff(x) (pte_val(x) >> 2)
292#define pgoff_to_pte(x) __pte(((x) << 2) | L_PTE_FILE)
293
294#define PTE_FILE_MAX_BITS 30
295
296#define PTE_BIT_FUNC(fn,op) \
297static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
298
299/*PTE_BIT_FUNC(rdprotect, &= ~L_PTE_USER);*/
300/*PTE_BIT_FUNC(mkread, |= L_PTE_USER);*/
301PTE_BIT_FUNC(wrprotect, &= ~L_PTE_WRITE);
302PTE_BIT_FUNC(mkwrite, |= L_PTE_WRITE);
303PTE_BIT_FUNC(exprotect, &= ~L_PTE_EXEC);
304PTE_BIT_FUNC(mkexec, |= L_PTE_EXEC);
305PTE_BIT_FUNC(mkclean, &= ~L_PTE_DIRTY);
306PTE_BIT_FUNC(mkdirty, |= L_PTE_DIRTY);
307PTE_BIT_FUNC(mkold, &= ~L_PTE_YOUNG);
308PTE_BIT_FUNC(mkyoung, |= L_PTE_YOUNG);
309
310/*
311 * Mark the prot value as uncacheable and unbufferable.
312 */
313#define pgprot_noncached(prot) __pgprot(pgprot_val(prot) & ~(L_PTE_CACHEABLE | L_PTE_BUFFERABLE))
314#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~L_PTE_CACHEABLE)
315
316#define pmd_none(pmd) (!pmd_val(pmd))
317#define pmd_present(pmd) (pmd_val(pmd))
318#define pmd_bad(pmd) (pmd_val(pmd) & 2)
319
320#define copy_pmd(pmdpd,pmdps) \
321 do { \
322 pmdpd[0] = pmdps[0]; \
323 pmdpd[1] = pmdps[1]; \
324 flush_pmd_entry(pmdpd); \
325 } while (0)
326
327#define pmd_clear(pmdp) \
328 do { \
329 pmdp[0] = __pmd(0); \
330 pmdp[1] = __pmd(0); \
331 clean_pmd_entry(pmdp); \
332 } while (0)
333
334static inline pte_t *pmd_page_kernel(pmd_t pmd)
335{
336 unsigned long ptr;
337
338 ptr = pmd_val(pmd) & ~(PTRS_PER_PTE * sizeof(void *) - 1);
339 ptr += PTRS_PER_PTE * sizeof(void *);
340
341 return __va(ptr);
342}
343
344#define pmd_page(pmd) virt_to_page(__va(pmd_val(pmd)))
345
346/*
347 * Permanent address of a page. We never have highmem, so this is trivial.
348 */
349#define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT))
350
351/*
352 * Conversion functions: convert a page and protection to a page entry,
353 * and a page entry and page directory to the page they refer to.
354 */
355#define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot)
356
357/*
358 * The "pgd_xxx()" functions here are trivial for a folded two-level
359 * setup: the pgd is never bad, and a pmd always exists (as it's folded
360 * into the pgd entry)
361 */
362#define pgd_none(pgd) (0)
363#define pgd_bad(pgd) (0)
364#define pgd_present(pgd) (1)
365#define pgd_clear(pgdp) do { } while (0)
366#define set_pgd(pgd,pgdp) do { } while (0)
367
368#define page_pte_prot(page,prot) mk_pte(page, prot)
369#define page_pte(page) mk_pte(page, __pgprot(0))
370
371/* to find an entry in a page-table-directory */
372#define pgd_index(addr) ((addr) >> PGDIR_SHIFT)
373
374#define pgd_offset(mm, addr) ((mm)->pgd+pgd_index(addr))
375
376/* to find an entry in a kernel page-table-directory */
377#define pgd_offset_k(addr) pgd_offset(&init_mm, addr)
378
379/* Find an entry in the second-level page table.. */
380#define pmd_offset(dir, addr) ((pmd_t *)(dir))
381
382/* Find an entry in the third-level page table.. */
383#define __pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
384
385static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
386{
387 const unsigned long mask = L_PTE_EXEC | L_PTE_WRITE | L_PTE_USER;
388 pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);
389 return pte;
390}
391
392extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
393
394/* Encode and decode a swap entry.
395 *
396 * We support up to 32GB of swap on 4k machines
397 */
398#define __swp_type(x) (((x).val >> 2) & 0x7f)
399#define __swp_offset(x) ((x).val >> 9)
400#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 2) | ((offset) << 9) })
401#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
402#define __swp_entry_to_pte(swp) ((pte_t) { (swp).val })
403
404/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
405/* FIXME: this is not correct */
406#define kern_addr_valid(addr) (1)
407
408#include <asm-generic/pgtable.h>
409
410/*
411 * We provide our own arch_get_unmapped_area to cope with VIPT caches.
412 */
413#define HAVE_ARCH_UNMAPPED_AREA
414
415/*
416 * remap a physical address `phys' of size `size' with page protection `prot'
417 * into virtual address `from'
418 */
419#define io_remap_page_range(vma,from,phys,size,prot) \
420 remap_pfn_range(vma, from, (phys) >> PAGE_SHIFT, size, prot)
421
422#define io_remap_pfn_range(vma,from,pfn,size,prot) \
423 remap_pfn_range(vma, from, pfn, size, prot)
424
425#define MK_IOSPACE_PFN(space, pfn) (pfn)
426#define GET_IOSPACE(pfn) 0
427#define GET_PFN(pfn) (pfn)
428
429#define pgtable_cache_init() do { } while (0)
430
431#endif /* !__ASSEMBLY__ */
432
433#endif /* _ASMARM_PGTABLE_H */
diff --git a/include/asm-arm/poll.h b/include/asm-arm/poll.h
new file mode 100644
index 000000000000..2744ca831f5d
--- /dev/null
+++ b/include/asm-arm/poll.h
@@ -0,0 +1,26 @@
1#ifndef __ASMARM_POLL_H
2#define __ASMARM_POLL_H
3
4/* These are specified by iBCS2 */
5#define POLLIN 0x0001
6#define POLLPRI 0x0002
7#define POLLOUT 0x0004
8#define POLLERR 0x0008
9#define POLLHUP 0x0010
10#define POLLNVAL 0x0020
11
12/* The rest seem to be more-or-less nonstandard. Check them! */
13#define POLLRDNORM 0x0040
14#define POLLRDBAND 0x0080
15#define POLLWRNORM 0x0100
16#define POLLWRBAND 0x0200
17#define POLLMSG 0x0400
18#define POLLREMOVE 0x1000
19
20struct pollfd {
21 int fd;
22 short events;
23 short revents;
24};
25
26#endif
diff --git a/include/asm-arm/posix_types.h b/include/asm-arm/posix_types.h
new file mode 100644
index 000000000000..e142a2a016ca
--- /dev/null
+++ b/include/asm-arm/posix_types.h
@@ -0,0 +1,81 @@
1/*
2 * linux/include/asm-arm/posix_types.h
3 *
4 * Copyright (C) 1996-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 * Changelog:
11 * 27-06-1996 RMK Created
12 */
13#ifndef __ARCH_ARM_POSIX_TYPES_H
14#define __ARCH_ARM_POSIX_TYPES_H
15
16/*
17 * This file is generally used by user-level software, so you need to
18 * be a little careful about namespace pollution etc. Also, we cannot
19 * assume GCC is being used.
20 */
21
22typedef unsigned long __kernel_ino_t;
23typedef unsigned short __kernel_mode_t;
24typedef unsigned short __kernel_nlink_t;
25typedef long __kernel_off_t;
26typedef int __kernel_pid_t;
27typedef unsigned short __kernel_ipc_pid_t;
28typedef unsigned short __kernel_uid_t;
29typedef unsigned short __kernel_gid_t;
30typedef unsigned int __kernel_size_t;
31typedef int __kernel_ssize_t;
32typedef int __kernel_ptrdiff_t;
33typedef long __kernel_time_t;
34typedef long __kernel_suseconds_t;
35typedef long __kernel_clock_t;
36typedef int __kernel_timer_t;
37typedef int __kernel_clockid_t;
38typedef int __kernel_daddr_t;
39typedef char * __kernel_caddr_t;
40typedef unsigned short __kernel_uid16_t;
41typedef unsigned short __kernel_gid16_t;
42typedef unsigned int __kernel_uid32_t;
43typedef unsigned int __kernel_gid32_t;
44
45typedef unsigned short __kernel_old_uid_t;
46typedef unsigned short __kernel_old_gid_t;
47typedef unsigned short __kernel_old_dev_t;
48
49#ifdef __GNUC__
50typedef long long __kernel_loff_t;
51#endif
52
53typedef struct {
54#if defined(__KERNEL__) || defined(__USE_ALL)
55 int val[2];
56#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
57 int __val[2];
58#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
59} __kernel_fsid_t;
60
61#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
62
63#undef __FD_SET
64#define __FD_SET(fd, fdsetp) \
65 (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] |= (1<<((fd) & 31)))
66
67#undef __FD_CLR
68#define __FD_CLR(fd, fdsetp) \
69 (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] &= ~(1<<((fd) & 31)))
70
71#undef __FD_ISSET
72#define __FD_ISSET(fd, fdsetp) \
73 ((((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] & (1<<((fd) & 31))) != 0)
74
75#undef __FD_ZERO
76#define __FD_ZERO(fdsetp) \
77 (memset (fdsetp, 0, sizeof (*(fd_set *)(fdsetp))))
78
79#endif
80
81#endif
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h
new file mode 100644
index 000000000000..7bef2bf6be51
--- /dev/null
+++ b/include/asm-arm/proc-fns.h
@@ -0,0 +1,174 @@
1/*
2 * linux/include/asm-arm/proc-fns.h
3 *
4 * Copyright (C) 1997-1999 Russell King
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 version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef __ASM_PROCFNS_H
12#define __ASM_PROCFNS_H
13
14#ifdef __KERNEL__
15
16#include <linux/config.h>
17
18/*
19 * Work out if we need multiple CPU support
20 */
21#undef MULTI_CPU
22#undef CPU_NAME
23
24/*
25 * CPU_NAME - the prefix for CPU related functions
26 */
27
28#ifdef CONFIG_CPU_32
29# ifdef CONFIG_CPU_ARM610
30# ifdef CPU_NAME
31# undef MULTI_CPU
32# define MULTI_CPU
33# else
34# define CPU_NAME cpu_arm6
35# endif
36# endif
37# ifdef CONFIG_CPU_ARM710
38# ifdef CPU_NAME
39# undef MULTI_CPU
40# define MULTI_CPU
41# else
42# define CPU_NAME cpu_arm7
43# endif
44# endif
45# ifdef CONFIG_CPU_ARM720T
46# ifdef CPU_NAME
47# undef MULTI_CPU
48# define MULTI_CPU
49# else
50# define CPU_NAME cpu_arm720
51# endif
52# endif
53# ifdef CONFIG_CPU_ARM920T
54# ifdef CPU_NAME
55# undef MULTI_CPU
56# define MULTI_CPU
57# else
58# define CPU_NAME cpu_arm920
59# endif
60# endif
61# ifdef CONFIG_CPU_ARM922T
62# ifdef CPU_NAME
63# undef MULTI_CPU
64# define MULTI_CPU
65# else
66# define CPU_NAME cpu_arm922
67# endif
68# endif
69# ifdef CONFIG_CPU_ARM925T
70# ifdef CPU_NAME
71# undef MULTI_CPU
72# define MULTI_CPU
73# else
74# define CPU_NAME cpu_arm925
75# endif
76# endif
77# ifdef CONFIG_CPU_ARM926T
78# ifdef CPU_NAME
79# undef MULTI_CPU
80# define MULTI_CPU
81# else
82# define CPU_NAME cpu_arm926
83# endif
84# endif
85# ifdef CONFIG_CPU_SA110
86# ifdef CPU_NAME
87# undef MULTI_CPU
88# define MULTI_CPU
89# else
90# define CPU_NAME cpu_sa110
91# endif
92# endif
93# ifdef CONFIG_CPU_SA1100
94# ifdef CPU_NAME
95# undef MULTI_CPU
96# define MULTI_CPU
97# else
98# define CPU_NAME cpu_sa1100
99# endif
100# endif
101# ifdef CONFIG_CPU_ARM1020
102# ifdef CPU_NAME
103# undef MULTI_CPU
104# define MULTI_CPU
105# else
106# define CPU_NAME cpu_arm1020
107# endif
108# endif
109# ifdef CONFIG_CPU_ARM1020E
110# ifdef CPU_NAME
111# undef MULTI_CPU
112# define MULTI_CPU
113# else
114# define CPU_NAME cpu_arm1020e
115# endif
116# endif
117# ifdef CONFIG_CPU_ARM1022
118# ifdef CPU_NAME
119# undef MULTI_CPU
120# define MULTI_CPU
121# else
122# define CPU_NAME cpu_arm1022
123# endif
124# endif
125# ifdef CONFIG_CPU_ARM1026
126# ifdef CPU_NAME
127# undef MULTI_CPU
128# define MULTI_CPU
129# else
130# define CPU_NAME cpu_arm1026
131# endif
132# endif
133# ifdef CONFIG_CPU_XSCALE
134# ifdef CPU_NAME
135# undef MULTI_CPU
136# define MULTI_CPU
137# else
138# define CPU_NAME cpu_xscale
139# endif
140# endif
141# ifdef CONFIG_CPU_V6
142# ifdef CPU_NAME
143# undef MULTI_CPU
144# define MULTI_CPU
145# else
146# define CPU_NAME cpu_v6
147# endif
148# endif
149#endif
150
151#ifndef __ASSEMBLY__
152
153#ifndef MULTI_CPU
154#include "asm/cpu-single.h"
155#else
156#include "asm/cpu-multi32.h"
157#endif
158
159#include <asm/memory.h>
160
161#define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm)
162
163#define cpu_get_pgd() \
164 ({ \
165 unsigned long pg; \
166 __asm__("mrc p15, 0, %0, c2, c0, 0" \
167 : "=r" (pg) : : "cc"); \
168 pg &= ~0x3fff; \
169 (pgd_t *)phys_to_virt(pg); \
170 })
171
172#endif /* __ASSEMBLY__ */
173#endif /* __KERNEL__ */
174#endif /* __ASM_PROCFNS_H */
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h
new file mode 100644
index 000000000000..4a9845997a75
--- /dev/null
+++ b/include/asm-arm/processor.h
@@ -0,0 +1,118 @@
1/*
2 * linux/include/asm-arm/processor.h
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
11#ifndef __ASM_ARM_PROCESSOR_H
12#define __ASM_ARM_PROCESSOR_H
13
14/*
15 * Default implementation of macro that returns current
16 * instruction pointer ("program counter").
17 */
18#define current_text_addr() ({ __label__ _l; _l: &&_l;})
19
20#ifdef __KERNEL__
21
22#include <asm/ptrace.h>
23#include <asm/procinfo.h>
24#include <asm/types.h>
25
26#define KERNEL_STACK_SIZE PAGE_SIZE
27
28union debug_insn {
29 u32 arm;
30 u16 thumb;
31};
32
33struct debug_entry {
34 u32 address;
35 union debug_insn insn;
36};
37
38struct debug_info {
39 int nsaved;
40 struct debug_entry bp[2];
41};
42
43struct thread_struct {
44 /* fault info */
45 unsigned long address;
46 unsigned long trap_no;
47 unsigned long error_code;
48 /* debugging */
49 struct debug_info debug;
50};
51
52#define INIT_THREAD { }
53
54#define start_thread(regs,pc,sp) \
55({ \
56 unsigned long *stack = (unsigned long *)sp; \
57 set_fs(USER_DS); \
58 memzero(regs->uregs, sizeof(regs->uregs)); \
59 if (current->personality & ADDR_LIMIT_32BIT) \
60 regs->ARM_cpsr = USR_MODE; \
61 else \
62 regs->ARM_cpsr = USR26_MODE; \
63 if (elf_hwcap & HWCAP_THUMB && pc & 1) \
64 regs->ARM_cpsr |= PSR_T_BIT; \
65 regs->ARM_pc = pc & ~1; /* pc */ \
66 regs->ARM_sp = sp; /* sp */ \
67 regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
68 regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
69 regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
70})
71
72/* Forward declaration, a strange C thing */
73struct task_struct;
74
75/* Free all resources held by a thread. */
76extern void release_thread(struct task_struct *);
77
78/* Prepare to copy thread state - unlazy all lazy status */
79#define prepare_to_copy(tsk) do { } while (0)
80
81unsigned long get_wchan(struct task_struct *p);
82
83#define cpu_relax() barrier()
84
85/*
86 * Create a new kernel thread
87 */
88extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
89
90#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1019])
91#define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1017])
92
93/*
94 * Prefetching support - only ARMv5.
95 */
96#if __LINUX_ARM_ARCH__ >= 5
97
98#define ARCH_HAS_PREFETCH
99#define prefetch(ptr) \
100 ({ \
101 __asm__ __volatile__( \
102 "pld\t%0" \
103 : \
104 : "o" (*(char *)(ptr)) \
105 : "cc"); \
106 })
107
108#define ARCH_HAS_PREFETCHW
109#define prefetchw(ptr) prefetch(ptr)
110
111#define ARCH_HAS_SPINLOCK_PREFETCH
112#define spin_lock_prefetch(x) do { } while (0)
113
114#endif
115
116#endif
117
118#endif /* __ASM_ARM_PROCESSOR_H */
diff --git a/include/asm-arm/procinfo.h b/include/asm-arm/procinfo.h
new file mode 100644
index 000000000000..a9c75b2c314f
--- /dev/null
+++ b/include/asm-arm/procinfo.h
@@ -0,0 +1,60 @@
1/*
2 * linux/include/asm-arm/procinfo.h
3 *
4 * Copyright (C) 1996-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#ifndef __ASM_PROCINFO_H
11#define __ASM_PROCINFO_H
12
13#ifndef __ASSEMBLY__
14
15struct cpu_tlb_fns;
16struct cpu_user_fns;
17struct cpu_cache_fns;
18struct processor;
19
20/*
21 * Note! struct processor is always defined if we're
22 * using MULTI_CPU, otherwise this entry is unused,
23 * but still exists.
24 *
25 * NOTE! The following structure is defined by assembly
26 * language, NOT C code. For more information, check:
27 * arch/arm/mm/proc-*.S and arch/arm/kernel/head.S
28 */
29struct proc_info_list {
30 unsigned int cpu_val;
31 unsigned int cpu_mask;
32 unsigned long __cpu_mmu_flags; /* used by head.S */
33 unsigned long __cpu_flush; /* used by head.S */
34 const char *arch_name;
35 const char *elf_name;
36 unsigned int elf_hwcap;
37 const char *cpu_name;
38 struct processor *proc;
39 struct cpu_tlb_fns *tlb;
40 struct cpu_user_fns *user;
41 struct cpu_cache_fns *cache;
42};
43
44extern unsigned int elf_hwcap;
45
46#endif /* __ASSEMBLY__ */
47
48#define PROC_INFO_SZ 48
49
50#define HWCAP_SWP 1
51#define HWCAP_HALF 2
52#define HWCAP_THUMB 4
53#define HWCAP_26BIT 8 /* Play it safe */
54#define HWCAP_FAST_MULT 16
55#define HWCAP_FPA 32
56#define HWCAP_VFP 64
57#define HWCAP_EDSP 128
58#define HWCAP_JAVA 256
59
60#endif
diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
new file mode 100644
index 000000000000..604e3a186cf9
--- /dev/null
+++ b/include/asm-arm/ptrace.h
@@ -0,0 +1,155 @@
1/*
2 * linux/include/asm-arm/ptrace.h
3 *
4 * Copyright (C) 1996-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#ifndef __ASM_ARM_PTRACE_H
11#define __ASM_ARM_PTRACE_H
12
13#include <linux/config.h>
14
15#define PTRACE_GETREGS 12
16#define PTRACE_SETREGS 13
17#define PTRACE_GETFPREGS 14
18#define PTRACE_SETFPREGS 15
19
20#define PTRACE_GETWMMXREGS 18
21#define PTRACE_SETWMMXREGS 19
22
23#define PTRACE_OLDSETOPTIONS 21
24
25#define PTRACE_GET_THREAD_AREA 22
26/*
27 * PSR bits
28 */
29#define USR26_MODE 0x00000000
30#define FIQ26_MODE 0x00000001
31#define IRQ26_MODE 0x00000002
32#define SVC26_MODE 0x00000003
33#define USR_MODE 0x00000010
34#define FIQ_MODE 0x00000011
35#define IRQ_MODE 0x00000012
36#define SVC_MODE 0x00000013
37#define ABT_MODE 0x00000017
38#define UND_MODE 0x0000001b
39#define SYSTEM_MODE 0x0000001f
40#define MODE32_BIT 0x00000010
41#define MODE_MASK 0x0000001f
42#define PSR_T_BIT 0x00000020
43#define PSR_F_BIT 0x00000040
44#define PSR_I_BIT 0x00000080
45#define PSR_J_BIT 0x01000000
46#define PSR_Q_BIT 0x08000000
47#define PSR_V_BIT 0x10000000
48#define PSR_C_BIT 0x20000000
49#define PSR_Z_BIT 0x40000000
50#define PSR_N_BIT 0x80000000
51#define PCMASK 0
52
53/*
54 * Groups of PSR bits
55 */
56#define PSR_f 0xff000000 /* Flags */
57#define PSR_s 0x00ff0000 /* Status */
58#define PSR_x 0x0000ff00 /* Extension */
59#define PSR_c 0x000000ff /* Control */
60
61#ifndef __ASSEMBLY__
62
63/* this struct defines the way the registers are stored on the
64 stack during a system call. */
65
66struct pt_regs {
67 long uregs[18];
68};
69
70#define ARM_cpsr uregs[16]
71#define ARM_pc uregs[15]
72#define ARM_lr uregs[14]
73#define ARM_sp uregs[13]
74#define ARM_ip uregs[12]
75#define ARM_fp uregs[11]
76#define ARM_r10 uregs[10]
77#define ARM_r9 uregs[9]
78#define ARM_r8 uregs[8]
79#define ARM_r7 uregs[7]
80#define ARM_r6 uregs[6]
81#define ARM_r5 uregs[5]
82#define ARM_r4 uregs[4]
83#define ARM_r3 uregs[3]
84#define ARM_r2 uregs[2]
85#define ARM_r1 uregs[1]
86#define ARM_r0 uregs[0]
87#define ARM_ORIG_r0 uregs[17]
88
89#ifdef __KERNEL__
90
91#define user_mode(regs) \
92 (((regs)->ARM_cpsr & 0xf) == 0)
93
94#ifdef CONFIG_ARM_THUMB
95#define thumb_mode(regs) \
96 (((regs)->ARM_cpsr & PSR_T_BIT))
97#else
98#define thumb_mode(regs) (0)
99#endif
100
101#define processor_mode(regs) \
102 ((regs)->ARM_cpsr & MODE_MASK)
103
104#define interrupts_enabled(regs) \
105 (!((regs)->ARM_cpsr & PSR_I_BIT))
106
107#define fast_interrupts_enabled(regs) \
108 (!((regs)->ARM_cpsr & PSR_F_BIT))
109
110#define condition_codes(regs) \
111 ((regs)->ARM_cpsr & (PSR_V_BIT|PSR_C_BIT|PSR_Z_BIT|PSR_N_BIT))
112
113/* Are the current registers suitable for user mode?
114 * (used to maintain security in signal handlers)
115 */
116static inline int valid_user_regs(struct pt_regs *regs)
117{
118 if (user_mode(regs) &&
119 (regs->ARM_cpsr & (PSR_F_BIT|PSR_I_BIT)) == 0)
120 return 1;
121
122 /*
123 * Force CPSR to something logical...
124 */
125 regs->ARM_cpsr &= PSR_f | PSR_s | PSR_x | PSR_T_BIT | MODE32_BIT;
126
127 return 0;
128}
129
130#endif /* __KERNEL__ */
131
132#define pc_pointer(v) \
133 ((v) & ~PCMASK)
134
135#define instruction_pointer(regs) \
136 (pc_pointer((regs)->ARM_pc))
137
138#ifdef CONFIG_SMP
139extern unsigned long profile_pc(struct pt_regs *regs);
140#else
141#define profile_pc(regs) instruction_pointer(regs)
142#endif
143
144#ifdef __KERNEL__
145extern void show_regs(struct pt_regs *);
146
147#define predicate(x) (x & 0xf0000000)
148#define PREDICATE_ALWAYS 0xe0000000
149
150#endif
151
152#endif /* __ASSEMBLY__ */
153
154#endif
155
diff --git a/include/asm-arm/resource.h b/include/asm-arm/resource.h
new file mode 100644
index 000000000000..734b581b5b6a
--- /dev/null
+++ b/include/asm-arm/resource.h
@@ -0,0 +1,6 @@
1#ifndef _ARM_RESOURCE_H
2#define _ARM_RESOURCE_H
3
4#include <asm-generic/resource.h>
5
6#endif
diff --git a/include/asm-arm/rtc.h b/include/asm-arm/rtc.h
new file mode 100644
index 000000000000..aa7e16b2e225
--- /dev/null
+++ b/include/asm-arm/rtc.h
@@ -0,0 +1,46 @@
1/*
2 * linux/include/asm-arm/rtc.h
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef ASMARM_RTC_H
11#define ASMARM_RTC_H
12
13struct module;
14
15struct rtc_ops {
16 struct module *owner;
17 int (*open)(void);
18 void (*release)(void);
19 int (*ioctl)(unsigned int, unsigned long);
20
21 void (*read_time)(struct rtc_time *);
22 int (*set_time)(struct rtc_time *);
23 void (*read_alarm)(struct rtc_wkalrm *);
24 int (*set_alarm)(struct rtc_wkalrm *);
25 int (*proc)(char *buf);
26};
27
28void rtc_time_to_tm(unsigned long, struct rtc_time *);
29int rtc_tm_to_time(struct rtc_time *, unsigned long *);
30int rtc_valid_tm(struct rtc_time *);
31void rtc_next_alarm_time(struct rtc_time *, struct rtc_time *, struct rtc_time *);
32void rtc_update(unsigned long, unsigned long);
33int register_rtc(struct rtc_ops *);
34void unregister_rtc(struct rtc_ops *);
35
36static inline int rtc_periodic_alarm(struct rtc_time *tm)
37{
38 return (tm->tm_year == -1) ||
39 ((unsigned)tm->tm_mon >= 12) ||
40 ((unsigned)(tm->tm_mday - 1) >= 31) ||
41 ((unsigned)tm->tm_hour > 23) ||
42 ((unsigned)tm->tm_min > 59) ||
43 ((unsigned)tm->tm_sec > 59);
44}
45
46#endif
diff --git a/include/asm-arm/scatterlist.h b/include/asm-arm/scatterlist.h
new file mode 100644
index 000000000000..83b876fb04cc
--- /dev/null
+++ b/include/asm-arm/scatterlist.h
@@ -0,0 +1,25 @@
1#ifndef _ASMARM_SCATTERLIST_H
2#define _ASMARM_SCATTERLIST_H
3
4#include <asm/memory.h>
5#include <asm/types.h>
6
7struct scatterlist {
8 struct page *page; /* buffer page */
9 unsigned int offset; /* buffer offset */
10 dma_addr_t dma_address; /* dma address */
11 unsigned int length; /* length */
12 char *__address; /* for set_dma_addr */
13};
14
15/*
16 * These macros should be used after a pci_map_sg call has been done
17 * to get bus addresses of each of the SG entries and their lengths.
18 * You should only work with the number of sg entries pci_map_sg
19 * returns, or alternatively stop on the first sg_dma_len(sg) which
20 * is 0.
21 */
22#define sg_dma_address(sg) ((sg)->dma_address)
23#define sg_dma_len(sg) ((sg)->length)
24
25#endif /* _ASMARM_SCATTERLIST_H */
diff --git a/include/asm-arm/sections.h b/include/asm-arm/sections.h
new file mode 100644
index 000000000000..2b8c5160388f
--- /dev/null
+++ b/include/asm-arm/sections.h
@@ -0,0 +1 @@
#include <asm-generic/sections.h>
diff --git a/include/asm-arm/segment.h b/include/asm-arm/segment.h
new file mode 100644
index 000000000000..9e24c21f6304
--- /dev/null
+++ b/include/asm-arm/segment.h
@@ -0,0 +1,11 @@
1#ifndef __ASM_ARM_SEGMENT_H
2#define __ASM_ARM_SEGMENT_H
3
4#define __KERNEL_CS 0x0
5#define __KERNEL_DS 0x0
6
7#define __USER_CS 0x1
8#define __USER_DS 0x1
9
10#endif /* __ASM_ARM_SEGMENT_H */
11
diff --git a/include/asm-arm/semaphore-helper.h b/include/asm-arm/semaphore-helper.h
new file mode 100644
index 000000000000..1d7f1987edb9
--- /dev/null
+++ b/include/asm-arm/semaphore-helper.h
@@ -0,0 +1,84 @@
1#ifndef ASMARM_SEMAPHORE_HELPER_H
2#define ASMARM_SEMAPHORE_HELPER_H
3
4/*
5 * These two _must_ execute atomically wrt each other.
6 */
7static inline void wake_one_more(struct semaphore * sem)
8{
9 unsigned long flags;
10
11 spin_lock_irqsave(&semaphore_wake_lock, flags);
12 if (atomic_read(&sem->count) <= 0)
13 sem->waking++;
14 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
15}
16
17static inline int waking_non_zero(struct semaphore *sem)
18{
19 unsigned long flags;
20 int ret = 0;
21
22 spin_lock_irqsave(&semaphore_wake_lock, flags);
23 if (sem->waking > 0) {
24 sem->waking--;
25 ret = 1;
26 }
27 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
28 return ret;
29}
30
31/*
32 * waking non zero interruptible
33 * 1 got the lock
34 * 0 go to sleep
35 * -EINTR interrupted
36 *
37 * We must undo the sem->count down_interruptible() increment while we are
38 * protected by the spinlock in order to make this atomic_inc() with the
39 * atomic_read() in wake_one_more(), otherwise we can race. -arca
40 */
41static inline int waking_non_zero_interruptible(struct semaphore *sem,
42 struct task_struct *tsk)
43{
44 unsigned long flags;
45 int ret = 0;
46
47 spin_lock_irqsave(&semaphore_wake_lock, flags);
48 if (sem->waking > 0) {
49 sem->waking--;
50 ret = 1;
51 } else if (signal_pending(tsk)) {
52 atomic_inc(&sem->count);
53 ret = -EINTR;
54 }
55 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
56 return ret;
57}
58
59/*
60 * waking_non_zero_try_lock:
61 * 1 failed to lock
62 * 0 got the lock
63 *
64 * We must undo the sem->count down_interruptible() increment while we are
65 * protected by the spinlock in order to make this atomic_inc() with the
66 * atomic_read() in wake_one_more(), otherwise we can race. -arca
67 */
68static inline int waking_non_zero_trylock(struct semaphore *sem)
69{
70 unsigned long flags;
71 int ret = 1;
72
73 spin_lock_irqsave(&semaphore_wake_lock, flags);
74 if (sem->waking <= 0)
75 atomic_inc(&sem->count);
76 else {
77 sem->waking--;
78 ret = 0;
79 }
80 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
81 return ret;
82}
83
84#endif
diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h
new file mode 100644
index 000000000000..60f33e6eb800
--- /dev/null
+++ b/include/asm-arm/semaphore.h
@@ -0,0 +1,106 @@
1/*
2 * linux/include/asm-arm/semaphore.h
3 */
4#ifndef __ASM_ARM_SEMAPHORE_H
5#define __ASM_ARM_SEMAPHORE_H
6
7#include <linux/linkage.h>
8#include <linux/spinlock.h>
9#include <linux/wait.h>
10#include <linux/rwsem.h>
11
12#include <asm/atomic.h>
13#include <asm/locks.h>
14
15struct semaphore {
16 atomic_t count;
17 int sleepers;
18 wait_queue_head_t wait;
19};
20
21#define __SEMAPHORE_INIT(name, cnt) \
22{ \
23 .count = ATOMIC_INIT(cnt), \
24 .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \
25}
26
27#define __MUTEX_INITIALIZER(name) __SEMAPHORE_INIT(name,1)
28
29#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
30 struct semaphore name = __SEMAPHORE_INIT(name,count)
31
32#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
33#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
34
35static inline void sema_init(struct semaphore *sem, int val)
36{
37 atomic_set(&sem->count, val);
38 sem->sleepers = 0;
39 init_waitqueue_head(&sem->wait);
40}
41
42static inline void init_MUTEX(struct semaphore *sem)
43{
44 sema_init(sem, 1);
45}
46
47static inline void init_MUTEX_LOCKED(struct semaphore *sem)
48{
49 sema_init(sem, 0);
50}
51
52static inline int sema_count(struct semaphore *sem)
53{
54 return atomic_read(&sem->count);
55}
56
57/*
58 * special register calling convention
59 */
60asmlinkage void __down_failed(void);
61asmlinkage int __down_interruptible_failed(void);
62asmlinkage int __down_trylock_failed(void);
63asmlinkage void __up_wakeup(void);
64
65extern void __down(struct semaphore * sem);
66extern int __down_interruptible(struct semaphore * sem);
67extern int __down_trylock(struct semaphore * sem);
68extern void __up(struct semaphore * sem);
69
70/*
71 * This is ugly, but we want the default case to fall through.
72 * "__down" is the actual routine that waits...
73 */
74static inline void down(struct semaphore * sem)
75{
76 might_sleep();
77 __down_op(sem, __down_failed);
78}
79
80/*
81 * This is ugly, but we want the default case to fall through.
82 * "__down_interruptible" is the actual routine that waits...
83 */
84static inline int down_interruptible (struct semaphore * sem)
85{
86 might_sleep();
87 return __down_op_ret(sem, __down_interruptible_failed);
88}
89
90static inline int down_trylock(struct semaphore *sem)
91{
92 return __down_op_ret(sem, __down_trylock_failed);
93}
94
95/*
96 * Note! This is subtle. We jump to wake people up only if
97 * the semaphore was negative (== somebody was waiting on it).
98 * The default case (no contention) will result in NO
99 * jumps for both down() and up().
100 */
101static inline void up(struct semaphore * sem)
102{
103 __up_op(sem, __up_wakeup);
104}
105
106#endif
diff --git a/include/asm-arm/sembuf.h b/include/asm-arm/sembuf.h
new file mode 100644
index 000000000000..1c0283954289
--- /dev/null
+++ b/include/asm-arm/sembuf.h
@@ -0,0 +1,25 @@
1#ifndef _ASMARM_SEMBUF_H
2#define _ASMARM_SEMBUF_H
3
4/*
5 * The semid64_ds structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct semid64_ds {
15 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
16 __kernel_time_t sem_otime; /* last semop time */
17 unsigned long __unused1;
18 __kernel_time_t sem_ctime; /* last change time */
19 unsigned long __unused2;
20 unsigned long sem_nsems; /* no. of semaphores in array */
21 unsigned long __unused3;
22 unsigned long __unused4;
23};
24
25#endif /* _ASMARM_SEMBUF_H */
diff --git a/include/asm-arm/serial.h b/include/asm-arm/serial.h
new file mode 100644
index 000000000000..015b262dc145
--- /dev/null
+++ b/include/asm-arm/serial.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/serial.h
3 *
4 * Copyright (C) 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 * Changelog:
11 * 15-10-1996 RMK Created
12 */
13
14#ifndef __ASM_SERIAL_H
15#define __ASM_SERIAL_H
16
17#define BASE_BAUD (1843200 / 16)
18
19#endif
diff --git a/include/asm-arm/setup.h b/include/asm-arm/setup.h
new file mode 100644
index 000000000000..adcbd79762bf
--- /dev/null
+++ b/include/asm-arm/setup.h
@@ -0,0 +1,218 @@
1/*
2 * linux/include/asm/setup.h
3 *
4 * Copyright (C) 1997-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 * Structure passed to kernel to tell it about the
11 * hardware it's running on. See Documentation/arm/Setup
12 * for more info.
13 */
14#ifndef __ASMARM_SETUP_H
15#define __ASMARM_SETUP_H
16
17#define COMMAND_LINE_SIZE 1024
18
19/* The list ends with an ATAG_NONE node. */
20#define ATAG_NONE 0x00000000
21
22struct tag_header {
23 u32 size;
24 u32 tag;
25};
26
27/* The list must start with an ATAG_CORE node */
28#define ATAG_CORE 0x54410001
29
30struct tag_core {
31 u32 flags; /* bit 0 = read-only */
32 u32 pagesize;
33 u32 rootdev;
34};
35
36/* it is allowed to have multiple ATAG_MEM nodes */
37#define ATAG_MEM 0x54410002
38
39struct tag_mem32 {
40 u32 size;
41 u32 start; /* physical start address */
42};
43
44/* VGA text type displays */
45#define ATAG_VIDEOTEXT 0x54410003
46
47struct tag_videotext {
48 u8 x;
49 u8 y;
50 u16 video_page;
51 u8 video_mode;
52 u8 video_cols;
53 u16 video_ega_bx;
54 u8 video_lines;
55 u8 video_isvga;
56 u16 video_points;
57};
58
59/* describes how the ramdisk will be used in kernel */
60#define ATAG_RAMDISK 0x54410004
61
62struct tag_ramdisk {
63 u32 flags; /* bit 0 = load, bit 1 = prompt */
64 u32 size; /* decompressed ramdisk size in _kilo_ bytes */
65 u32 start; /* starting block of floppy-based RAM disk image */
66};
67
68/* describes where the compressed ramdisk image lives (virtual address) */
69/*
70 * this one accidentally used virtual addresses - as such,
71 * it's deprecated.
72 */
73#define ATAG_INITRD 0x54410005
74
75/* describes where the compressed ramdisk image lives (physical address) */
76#define ATAG_INITRD2 0x54420005
77
78struct tag_initrd {
79 u32 start; /* physical start address */
80 u32 size; /* size of compressed ramdisk image in bytes */
81};
82
83/* board serial number. "64 bits should be enough for everybody" */
84#define ATAG_SERIAL 0x54410006
85
86struct tag_serialnr {
87 u32 low;
88 u32 high;
89};
90
91/* board revision */
92#define ATAG_REVISION 0x54410007
93
94struct tag_revision {
95 u32 rev;
96};
97
98/* initial values for vesafb-type framebuffers. see struct screen_info
99 * in include/linux/tty.h
100 */
101#define ATAG_VIDEOLFB 0x54410008
102
103struct tag_videolfb {
104 u16 lfb_width;
105 u16 lfb_height;
106 u16 lfb_depth;
107 u16 lfb_linelength;
108 u32 lfb_base;
109 u32 lfb_size;
110 u8 red_size;
111 u8 red_pos;
112 u8 green_size;
113 u8 green_pos;
114 u8 blue_size;
115 u8 blue_pos;
116 u8 rsvd_size;
117 u8 rsvd_pos;
118};
119
120/* command line: \0 terminated string */
121#define ATAG_CMDLINE 0x54410009
122
123struct tag_cmdline {
124 char cmdline[1]; /* this is the minimum size */
125};
126
127/* acorn RiscPC specific information */
128#define ATAG_ACORN 0x41000101
129
130struct tag_acorn {
131 u32 memc_control_reg;
132 u32 vram_pages;
133 u8 sounddefault;
134 u8 adfsdrives;
135};
136
137/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
138#define ATAG_MEMCLK 0x41000402
139
140struct tag_memclk {
141 u32 fmemclk;
142};
143
144struct tag {
145 struct tag_header hdr;
146 union {
147 struct tag_core core;
148 struct tag_mem32 mem;
149 struct tag_videotext videotext;
150 struct tag_ramdisk ramdisk;
151 struct tag_initrd initrd;
152 struct tag_serialnr serialnr;
153 struct tag_revision revision;
154 struct tag_videolfb videolfb;
155 struct tag_cmdline cmdline;
156
157 /*
158 * Acorn specific
159 */
160 struct tag_acorn acorn;
161
162 /*
163 * DC21285 specific
164 */
165 struct tag_memclk memclk;
166 } u;
167};
168
169struct tagtable {
170 u32 tag;
171 int (*parse)(const struct tag *);
172};
173
174#define __tag __attribute_used__ __attribute__((__section__(".taglist")))
175#define __tagtable(tag, fn) \
176static struct tagtable __tagtable_##fn __tag = { tag, fn }
177
178#define tag_member_present(tag,member) \
179 ((unsigned long)(&((struct tag *)0L)->member + 1) \
180 <= (tag)->hdr.size * 4)
181
182#define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size))
183#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
184
185#define for_each_tag(t,base) \
186 for (t = base; t->hdr.size; t = tag_next(t))
187
188/*
189 * Memory map description
190 */
191#ifdef CONFIG_ARCH_LH7A40X
192# define NR_BANKS 16
193#else
194# define NR_BANKS 8
195#endif
196
197struct meminfo {
198 int nr_banks;
199 struct {
200 unsigned long start;
201 unsigned long size;
202 int node;
203 } bank[NR_BANKS];
204};
205
206/*
207 * Early command line parameters.
208 */
209struct early_params {
210 const char *arg;
211 void (*fn)(char **p);
212};
213
214#define __early_param(name,fn) \
215static struct early_params __early_##fn __attribute_used__ \
216__attribute__((__section__("__early_param"))) = { name, fn }
217
218#endif
diff --git a/include/asm-arm/shmbuf.h b/include/asm-arm/shmbuf.h
new file mode 100644
index 000000000000..2e5c67ba1c97
--- /dev/null
+++ b/include/asm-arm/shmbuf.h
@@ -0,0 +1,42 @@
1#ifndef _ASMARM_SHMBUF_H
2#define _ASMARM_SHMBUF_H
3
4/*
5 * The shmid64_ds structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct shmid64_ds {
15 struct ipc64_perm shm_perm; /* operation perms */
16 size_t shm_segsz; /* size of segment (bytes) */
17 __kernel_time_t shm_atime; /* last attach time */
18 unsigned long __unused1;
19 __kernel_time_t shm_dtime; /* last detach time */
20 unsigned long __unused2;
21 __kernel_time_t shm_ctime; /* last change time */
22 unsigned long __unused3;
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29
30struct shminfo64 {
31 unsigned long shmmax;
32 unsigned long shmmin;
33 unsigned long shmmni;
34 unsigned long shmseg;
35 unsigned long shmall;
36 unsigned long __unused1;
37 unsigned long __unused2;
38 unsigned long __unused3;
39 unsigned long __unused4;
40};
41
42#endif /* _ASMARM_SHMBUF_H */
diff --git a/include/asm-arm/shmparam.h b/include/asm-arm/shmparam.h
new file mode 100644
index 000000000000..a5223b3a9bf9
--- /dev/null
+++ b/include/asm-arm/shmparam.h
@@ -0,0 +1,16 @@
1#ifndef _ASMARM_SHMPARAM_H
2#define _ASMARM_SHMPARAM_H
3
4/*
5 * This should be the size of the virtually indexed cache/ways,
6 * or page size, whichever is greater since the cache aliases
7 * every size/ways bytes.
8 */
9#define SHMLBA (4 * PAGE_SIZE) /* attach addr a multiple of this */
10
11/*
12 * Enforce SHMLBA in shmat
13 */
14#define __ARCH_FORCE_SHMLBA
15
16#endif /* _ASMARM_SHMPARAM_H */
diff --git a/include/asm-arm/sigcontext.h b/include/asm-arm/sigcontext.h
new file mode 100644
index 000000000000..fc0b80b6a6fc
--- /dev/null
+++ b/include/asm-arm/sigcontext.h
@@ -0,0 +1,34 @@
1#ifndef _ASMARM_SIGCONTEXT_H
2#define _ASMARM_SIGCONTEXT_H
3
4/*
5 * Signal context structure - contains all info to do with the state
6 * before the signal handler was invoked. Note: only add new entries
7 * to the end of the structure.
8 */
9struct sigcontext {
10 unsigned long trap_no;
11 unsigned long error_code;
12 unsigned long oldmask;
13 unsigned long arm_r0;
14 unsigned long arm_r1;
15 unsigned long arm_r2;
16 unsigned long arm_r3;
17 unsigned long arm_r4;
18 unsigned long arm_r5;
19 unsigned long arm_r6;
20 unsigned long arm_r7;
21 unsigned long arm_r8;
22 unsigned long arm_r9;
23 unsigned long arm_r10;
24 unsigned long arm_fp;
25 unsigned long arm_ip;
26 unsigned long arm_sp;
27 unsigned long arm_lr;
28 unsigned long arm_pc;
29 unsigned long arm_cpsr;
30 unsigned long fault_address;
31};
32
33
34#endif
diff --git a/include/asm-arm/siginfo.h b/include/asm-arm/siginfo.h
new file mode 100644
index 000000000000..5e21852e6039
--- /dev/null
+++ b/include/asm-arm/siginfo.h
@@ -0,0 +1,6 @@
1#ifndef _ASMARM_SIGINFO_H
2#define _ASMARM_SIGINFO_H
3
4#include <asm-generic/siginfo.h>
5
6#endif
diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h
new file mode 100644
index 000000000000..b033e5fd60fa
--- /dev/null
+++ b/include/asm-arm/signal.h
@@ -0,0 +1,194 @@
1#ifndef _ASMARM_SIGNAL_H
2#define _ASMARM_SIGNAL_H
3
4#include <linux/types.h>
5
6/* Avoid too many header ordering problems. */
7struct siginfo;
8
9#ifdef __KERNEL__
10/* Most things should be clean enough to redefine this at will, if care
11 is taken to make libc match. */
12
13#define _NSIG 64
14#define _NSIG_BPW 32
15#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
16
17typedef unsigned long old_sigset_t; /* at least 32 bits */
18
19typedef struct {
20 unsigned long sig[_NSIG_WORDS];
21} sigset_t;
22
23#else
24/* Here we must cater to libcs that poke about in kernel headers. */
25
26#define NSIG 32
27typedef unsigned long sigset_t;
28
29#endif /* __KERNEL__ */
30
31#define SIGHUP 1
32#define SIGINT 2
33#define SIGQUIT 3
34#define SIGILL 4
35#define SIGTRAP 5
36#define SIGABRT 6
37#define SIGIOT 6
38#define SIGBUS 7
39#define SIGFPE 8
40#define SIGKILL 9
41#define SIGUSR1 10
42#define SIGSEGV 11
43#define SIGUSR2 12
44#define SIGPIPE 13
45#define SIGALRM 14
46#define SIGTERM 15
47#define SIGSTKFLT 16
48#define SIGCHLD 17
49#define SIGCONT 18
50#define SIGSTOP 19
51#define SIGTSTP 20
52#define SIGTTIN 21
53#define SIGTTOU 22
54#define SIGURG 23
55#define SIGXCPU 24
56#define SIGXFSZ 25
57#define SIGVTALRM 26
58#define SIGPROF 27
59#define SIGWINCH 28
60#define SIGIO 29
61#define SIGPOLL SIGIO
62/*
63#define SIGLOST 29
64*/
65#define SIGPWR 30
66#define SIGSYS 31
67#define SIGUNUSED 31
68
69/* These should not be considered constants from userland. */
70#define SIGRTMIN 32
71#define SIGRTMAX _NSIG
72
73#define SIGSWI 32
74
75/*
76 * SA_FLAGS values:
77 *
78 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
79 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
80 * SA_SIGINFO deliver the signal with SIGINFO structs
81 * SA_THIRTYTWO delivers the signal in 32-bit mode, even if the task
82 * is running in 26-bit.
83 * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)).
84 * SA_RESTART flag to get restarting signals (which were the default long ago)
85 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
86 * SA_NODEFER prevents the current signal from being masked in the handler.
87 * SA_RESETHAND clears the handler when the signal is delivered.
88 *
89 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
90 * Unix names RESETHAND and NODEFER respectively.
91 */
92#define SA_NOCLDSTOP 0x00000001
93#define SA_NOCLDWAIT 0x00000002
94#define SA_SIGINFO 0x00000004
95#define SA_THIRTYTWO 0x02000000
96#define SA_RESTORER 0x04000000
97#define SA_ONSTACK 0x08000000
98#define SA_RESTART 0x10000000
99#define SA_NODEFER 0x40000000
100#define SA_RESETHAND 0x80000000
101
102#define SA_NOMASK SA_NODEFER
103#define SA_ONESHOT SA_RESETHAND
104#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
105
106
107/*
108 * sigaltstack controls
109 */
110#define SS_ONSTACK 1
111#define SS_DISABLE 2
112
113#define MINSIGSTKSZ 2048
114#define SIGSTKSZ 8192
115
116#ifdef __KERNEL__
117
118/*
119 * These values of sa_flags are used only by the kernel as part of the
120 * irq handling routines.
121 *
122 * SA_INTERRUPT is also used by the irq handling routines.
123 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
124 */
125#define SA_PROBE 0x80000000
126#define SA_SAMPLE_RANDOM 0x10000000
127#define SA_IRQNOMASK 0x08000000
128#define SA_SHIRQ 0x04000000
129#endif
130
131#define SIG_BLOCK 0 /* for blocking signals */
132#define SIG_UNBLOCK 1 /* for unblocking signals */
133#define SIG_SETMASK 2 /* for setting the signal mask */
134
135/* Type of a signal handler. */
136typedef void __signalfn_t(int);
137typedef __signalfn_t __user *__sighandler_t;
138
139typedef void __restorefn_t(void);
140typedef __restorefn_t __user *__sigrestore_t;
141
142#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
143#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
144#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
145
146#ifdef __KERNEL__
147struct old_sigaction {
148 __sighandler_t sa_handler;
149 old_sigset_t sa_mask;
150 unsigned long sa_flags;
151 __sigrestore_t sa_restorer;
152};
153
154struct sigaction {
155 __sighandler_t sa_handler;
156 unsigned long sa_flags;
157 __sigrestore_t sa_restorer;
158 sigset_t sa_mask; /* mask last for extensibility */
159};
160
161struct k_sigaction {
162 struct sigaction sa;
163};
164
165#else
166/* Here we must cater to libcs that poke about in kernel headers. */
167
168struct sigaction {
169 union {
170 __sighandler_t _sa_handler;
171 void (*_sa_sigaction)(int, struct siginfo *, void *);
172 } _u;
173 sigset_t sa_mask;
174 unsigned long sa_flags;
175 void (*sa_restorer)(void);
176};
177
178#define sa_handler _u._sa_handler
179#define sa_sigaction _u._sa_sigaction
180
181#endif /* __KERNEL__ */
182
183typedef struct sigaltstack {
184 void __user *ss_sp;
185 int ss_flags;
186 size_t ss_size;
187} stack_t;
188
189#ifdef __KERNEL__
190#include <asm/sigcontext.h>
191#define ptrace_signal_deliver(regs, cookie) do { } while (0)
192#endif
193
194#endif
diff --git a/include/asm-arm/sizes.h b/include/asm-arm/sizes.h
new file mode 100644
index 000000000000..7f50ae0edf1b
--- /dev/null
+++ b/include/asm-arm/sizes.h
@@ -0,0 +1,52 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 */
16/* DO NOT EDIT!! - this file automatically generated
17 * from .s file by awk -f s2h.awk
18 */
19/* Size definitions
20 * Copyright (C) ARM Limited 1998. All rights reserved.
21 */
22
23#ifndef __sizes_h
24#define __sizes_h 1
25
26/* handy sizes */
27#define SZ_1K 0x00000400
28#define SZ_4K 0x00001000
29#define SZ_8K 0x00002000
30#define SZ_16K 0x00004000
31#define SZ_64K 0x00010000
32#define SZ_128K 0x00020000
33#define SZ_256K 0x00040000
34#define SZ_512K 0x00080000
35
36#define SZ_1M 0x00100000
37#define SZ_2M 0x00200000
38#define SZ_4M 0x00400000
39#define SZ_8M 0x00800000
40#define SZ_16M 0x01000000
41#define SZ_32M 0x02000000
42#define SZ_64M 0x04000000
43#define SZ_128M 0x08000000
44#define SZ_256M 0x10000000
45#define SZ_512M 0x20000000
46
47#define SZ_1G 0x40000000
48#define SZ_2G 0x80000000
49
50#endif
51
52/* END */
diff --git a/include/asm-arm/smp.h b/include/asm-arm/smp.h
new file mode 100644
index 000000000000..f21fd8f6bcdd
--- /dev/null
+++ b/include/asm-arm/smp.h
@@ -0,0 +1,58 @@
1/*
2 * linux/include/asm-arm/smp.h
3 *
4 * Copyright (C) 2004-2005 ARM 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#ifndef __ASM_ARM_SMP_H
11#define __ASM_ARM_SMP_H
12
13#include <linux/config.h>
14#include <linux/threads.h>
15#include <linux/cpumask.h>
16#include <linux/thread_info.h>
17
18#include <asm/arch/smp.h>
19
20#ifndef CONFIG_SMP
21# error "<asm-arm/smp.h> included in non-SMP build"
22#endif
23
24#define smp_processor_id() (current_thread_info()->cpu)
25
26extern cpumask_t cpu_present_mask;
27#define cpu_possible_map cpu_present_mask
28
29/*
30 * at the moment, there's not a big penalty for changing CPUs
31 * (the >big< penalty is running SMP in the first place)
32 */
33#define PROC_CHANGE_PENALTY 15
34
35struct seq_file;
36
37/*
38 * generate IPI list text
39 */
40extern void show_ipi_list(struct seq_file *p);
41
42/*
43 * Move global data into per-processor storage.
44 */
45extern void smp_store_cpu_info(unsigned int cpuid);
46
47/*
48 * Raise an IPI cross call on CPUs in callmap.
49 */
50extern void smp_cross_call(cpumask_t callmap);
51
52/*
53 * Boot a secondary CPU, and assign it the specified idle task.
54 * This also gives us the initial stack to use for this CPU.
55 */
56extern int boot_secondary(unsigned int cpu, struct task_struct *);
57
58#endif /* ifndef __ASM_ARM_SMP_H */
diff --git a/include/asm-arm/socket.h b/include/asm-arm/socket.h
new file mode 100644
index 000000000000..46d20585d951
--- /dev/null
+++ b/include/asm-arm/socket.h
@@ -0,0 +1,50 @@
1#ifndef _ASMARM_SOCKET_H
2#define _ASMARM_SOCKET_H
3
4#include <asm/sockios.h>
5
6/* For setsockopt(2) */
7#define SOL_SOCKET 1
8
9#define SO_DEBUG 1
10#define SO_REUSEADDR 2
11#define SO_TYPE 3
12#define SO_ERROR 4
13#define SO_DONTROUTE 5
14#define SO_BROADCAST 6
15#define SO_SNDBUF 7
16#define SO_RCVBUF 8
17#define SO_KEEPALIVE 9
18#define SO_OOBINLINE 10
19#define SO_NO_CHECK 11
20#define SO_PRIORITY 12
21#define SO_LINGER 13
22#define SO_BSDCOMPAT 14
23/* To add :#define SO_REUSEPORT 15 */
24#define SO_PASSCRED 16
25#define SO_PEERCRED 17
26#define SO_RCVLOWAT 18
27#define SO_SNDLOWAT 19
28#define SO_RCVTIMEO 20
29#define SO_SNDTIMEO 21
30
31/* Security levels - as per NRL IPv6 - don't actually do anything */
32#define SO_SECURITY_AUTHENTICATION 22
33#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
34#define SO_SECURITY_ENCRYPTION_NETWORK 24
35
36#define SO_BINDTODEVICE 25
37
38/* Socket filtering */
39#define SO_ATTACH_FILTER 26
40#define SO_DETACH_FILTER 27
41
42#define SO_PEERNAME 28
43#define SO_TIMESTAMP 29
44#define SCM_TIMESTAMP SO_TIMESTAMP
45
46#define SO_ACCEPTCONN 30
47
48#define SO_PEERSEC 31
49
50#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-arm/sockios.h b/include/asm-arm/sockios.h
new file mode 100644
index 000000000000..77c34087d513
--- /dev/null
+++ b/include/asm-arm/sockios.h
@@ -0,0 +1,12 @@
1#ifndef __ARCH_ARM_SOCKIOS_H
2#define __ARCH_ARM_SOCKIOS_H
3
4/* Socket-level I/O control calls. */
5#define FIOSETOWN 0x8901
6#define SIOCSPGRP 0x8902
7#define FIOGETOWN 0x8903
8#define SIOCGPGRP 0x8904
9#define SIOCATMARK 0x8905
10#define SIOCGSTAMP 0x8906 /* Get stamp */
11
12#endif
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h
new file mode 100644
index 000000000000..182323619caa
--- /dev/null
+++ b/include/asm-arm/spinlock.h
@@ -0,0 +1,169 @@
1#ifndef __ASM_SPINLOCK_H
2#define __ASM_SPINLOCK_H
3
4#if __LINUX_ARM_ARCH__ < 6
5#error SMP not supported on pre-ARMv6 CPUs
6#endif
7
8/*
9 * ARMv6 Spin-locking.
10 *
11 * We (exclusively) read the old value, and decrement it. If it
12 * hits zero, we may have won the lock, so we try (exclusively)
13 * storing it.
14 *
15 * Unlocked value: 0
16 * Locked value: 1
17 */
18typedef struct {
19 volatile unsigned int lock;
20#ifdef CONFIG_PREEMPT
21 unsigned int break_lock;
22#endif
23} spinlock_t;
24
25#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
26
27#define spin_lock_init(x) do { *(x) = SPIN_LOCK_UNLOCKED; } while (0)
28#define spin_is_locked(x) ((x)->lock != 0)
29#define spin_unlock_wait(x) do { barrier(); } while (spin_is_locked(x))
30#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
31
32static inline void _raw_spin_lock(spinlock_t *lock)
33{
34 unsigned long tmp;
35
36 __asm__ __volatile__(
37"1: ldrex %0, [%1]\n"
38" teq %0, #0\n"
39" strexeq %0, %2, [%1]\n"
40" teqeq %0, #0\n"
41" bne 1b"
42 : "=&r" (tmp)
43 : "r" (&lock->lock), "r" (1)
44 : "cc", "memory");
45}
46
47static inline int _raw_spin_trylock(spinlock_t *lock)
48{
49 unsigned long tmp;
50
51 __asm__ __volatile__(
52" ldrex %0, [%1]\n"
53" teq %0, #0\n"
54" strexeq %0, %2, [%1]"
55 : "=&r" (tmp)
56 : "r" (&lock->lock), "r" (1)
57 : "cc", "memory");
58
59 return tmp == 0;
60}
61
62static inline void _raw_spin_unlock(spinlock_t *lock)
63{
64 __asm__ __volatile__(
65" str %1, [%0]"
66 :
67 : "r" (&lock->lock), "r" (0)
68 : "cc", "memory");
69}
70
71/*
72 * RWLOCKS
73 */
74typedef struct {
75 volatile unsigned int lock;
76#ifdef CONFIG_PREEMPT
77 unsigned int break_lock;
78#endif
79} rwlock_t;
80
81#define RW_LOCK_UNLOCKED (rwlock_t) { 0 }
82#define rwlock_init(x) do { *(x) + RW_LOCK_UNLOCKED; } while (0)
83
84/*
85 * Write locks are easy - we just set bit 31. When unlocking, we can
86 * just write zero since the lock is exclusively held.
87 */
88static inline void _raw_write_lock(rwlock_t *rw)
89{
90 unsigned long tmp;
91
92 __asm__ __volatile__(
93"1: ldrex %0, [%1]\n"
94" teq %0, #0\n"
95" strexeq %0, %2, [%1]\n"
96" teq %0, #0\n"
97" bne 1b"
98 : "=&r" (tmp)
99 : "r" (&rw->lock), "r" (0x80000000)
100 : "cc", "memory");
101}
102
103static inline void _raw_write_unlock(rwlock_t *rw)
104{
105 __asm__ __volatile__(
106 "str %1, [%0]"
107 :
108 : "r" (&rw->lock), "r" (0)
109 : "cc", "memory");
110}
111
112/*
113 * Read locks are a bit more hairy:
114 * - Exclusively load the lock value.
115 * - Increment it.
116 * - Store new lock value if positive, and we still own this location.
117 * If the value is negative, we've already failed.
118 * - If we failed to store the value, we want a negative result.
119 * - If we failed, try again.
120 * Unlocking is similarly hairy. We may have multiple read locks
121 * currently active. However, we know we won't have any write
122 * locks.
123 */
124static inline void _raw_read_lock(rwlock_t *rw)
125{
126 unsigned long tmp, tmp2;
127
128 __asm__ __volatile__(
129"1: ldrex %0, [%2]\n"
130" adds %0, %0, #1\n"
131" strexpl %1, %0, [%2]\n"
132" rsbpls %0, %1, #0\n"
133" bmi 1b"
134 : "=&r" (tmp), "=&r" (tmp2)
135 : "r" (&rw->lock)
136 : "cc", "memory");
137}
138
139static inline void _raw_read_unlock(rwlock_t *rw)
140{
141 __asm__ __volatile__(
142"1: ldrex %0, [%2]\n"
143" sub %0, %0, #1\n"
144" strex %1, %0, [%2]\n"
145" teq %1, #0\n"
146" bne 1b"
147 : "=&r" (tmp), "=&r" (tmp2)
148 : "r" (&rw->lock)
149 : "cc", "memory");
150}
151
152#define _raw_read_trylock(lock) generic_raw_read_trylock(lock)
153
154static inline int _raw_write_trylock(rwlock_t *rw)
155{
156 unsigned long tmp;
157
158 __asm__ __volatile__(
159"1: ldrex %0, [%1]\n"
160" teq %0, #0\n"
161" strexeq %0, %2, [%1]"
162 : "=&r" (tmp)
163 : "r" (&rw->lock), "r" (0x80000000)
164 : "cc", "memory");
165
166 return tmp == 0;
167}
168
169#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-arm/stat.h b/include/asm-arm/stat.h
new file mode 100644
index 000000000000..ca8e7a8436da
--- /dev/null
+++ b/include/asm-arm/stat.h
@@ -0,0 +1,94 @@
1#ifndef _ASMARM_STAT_H
2#define _ASMARM_STAT_H
3
4struct __old_kernel_stat {
5 unsigned short st_dev;
6 unsigned short st_ino;
7 unsigned short st_mode;
8 unsigned short st_nlink;
9 unsigned short st_uid;
10 unsigned short st_gid;
11 unsigned short st_rdev;
12 unsigned long st_size;
13 unsigned long st_atime;
14 unsigned long st_mtime;
15 unsigned long st_ctime;
16};
17
18#define STAT_HAVE_NSEC
19
20struct stat {
21#if defined(__ARMEB__)
22 unsigned short st_dev;
23 unsigned short __pad1;
24#else
25 unsigned long st_dev;
26#endif
27 unsigned long st_ino;
28 unsigned short st_mode;
29 unsigned short st_nlink;
30 unsigned short st_uid;
31 unsigned short st_gid;
32#if defined(__ARMEB__)
33 unsigned short st_rdev;
34 unsigned short __pad2;
35#else
36 unsigned long st_rdev;
37#endif
38 unsigned long st_size;
39 unsigned long st_blksize;
40 unsigned long st_blocks;
41 unsigned long st_atime;
42 unsigned long st_atime_nsec;
43 unsigned long st_mtime;
44 unsigned long st_mtime_nsec;
45 unsigned long st_ctime;
46 unsigned long st_ctime_nsec;
47 unsigned long __unused4;
48 unsigned long __unused5;
49};
50
51/* This matches struct stat64 in glibc2.1, hence the absolutely
52 * insane amounts of padding around dev_t's.
53 * Note: The kernel zero's the padded region because glibc might read them
54 * in the hope that the kernel has stretched to using larger sizes.
55 */
56struct stat64 {
57 unsigned long long st_dev;
58 unsigned char __pad0[4];
59
60#define STAT64_HAS_BROKEN_ST_INO 1
61 unsigned long __st_ino;
62 unsigned int st_mode;
63 unsigned int st_nlink;
64
65 unsigned long st_uid;
66 unsigned long st_gid;
67
68 unsigned long long st_rdev;
69 unsigned char __pad3[4];
70
71 long long st_size;
72 unsigned long st_blksize;
73
74#if defined(__ARMEB__)
75 unsigned long __pad4; /* Future possible st_blocks hi bits */
76 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
77#else /* Must be little */
78 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
79 unsigned long __pad4; /* Future possible st_blocks hi bits */
80#endif
81
82 unsigned long st_atime;
83 unsigned long st_atime_nsec;
84
85 unsigned long st_mtime;
86 unsigned long st_mtime_nsec;
87
88 unsigned long st_ctime;
89 unsigned long st_ctime_nsec;
90
91 unsigned long long st_ino;
92};
93
94#endif
diff --git a/include/asm-arm/statfs.h b/include/asm-arm/statfs.h
new file mode 100644
index 000000000000..e81f82783b87
--- /dev/null
+++ b/include/asm-arm/statfs.h
@@ -0,0 +1,6 @@
1#ifndef _ASMARM_STATFS_H
2#define _ASMARM_STATFS_H
3
4#include <asm-generic/statfs.h>
5
6#endif
diff --git a/include/asm-arm/string.h b/include/asm-arm/string.h
new file mode 100644
index 000000000000..2a8ab162412f
--- /dev/null
+++ b/include/asm-arm/string.h
@@ -0,0 +1,43 @@
1#ifndef __ASM_ARM_STRING_H
2#define __ASM_ARM_STRING_H
3
4/*
5 * We don't do inline string functions, since the
6 * optimised inline asm versions are not small.
7 */
8
9#define __HAVE_ARCH_STRRCHR
10extern char * strrchr(const char * s, int c);
11
12#define __HAVE_ARCH_STRCHR
13extern char * strchr(const char * s, int c);
14
15#define __HAVE_ARCH_MEMCPY
16extern void * memcpy(void *, const void *, __kernel_size_t);
17
18#define __HAVE_ARCH_MEMMOVE
19extern void * memmove(void *, const void *, __kernel_size_t);
20
21#define __HAVE_ARCH_MEMCHR
22extern void * memchr(const void *, int, __kernel_size_t);
23
24#define __HAVE_ARCH_MEMZERO
25#define __HAVE_ARCH_MEMSET
26extern void * memset(void *, int, __kernel_size_t);
27
28extern void __memzero(void *ptr, __kernel_size_t n);
29
30#define memset(p,v,n) \
31 ({ \
32 if ((n) != 0) { \
33 if (__builtin_constant_p((v)) && (v) == 0) \
34 __memzero((p),(n)); \
35 else \
36 memset((p),(v),(n)); \
37 } \
38 (p); \
39 })
40
41#define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); })
42
43#endif
diff --git a/include/asm-arm/suspend.h b/include/asm-arm/suspend.h
new file mode 100644
index 000000000000..cf0d0bdee74d
--- /dev/null
+++ b/include/asm-arm/suspend.h
@@ -0,0 +1,4 @@
1#ifndef _ASMARM_SUSPEND_H
2#define _ASMARM_SUSPEND_H
3
4#endif
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
new file mode 100644
index 000000000000..b5731290b4e5
--- /dev/null
+++ b/include/asm-arm/system.h
@@ -0,0 +1,390 @@
1#ifndef __ASM_ARM_SYSTEM_H
2#define __ASM_ARM_SYSTEM_H
3
4#ifdef __KERNEL__
5
6#include <linux/config.h>
7
8#define CPU_ARCH_UNKNOWN 0
9#define CPU_ARCH_ARMv3 1
10#define CPU_ARCH_ARMv4 2
11#define CPU_ARCH_ARMv4T 3
12#define CPU_ARCH_ARMv5 4
13#define CPU_ARCH_ARMv5T 5
14#define CPU_ARCH_ARMv5TE 6
15#define CPU_ARCH_ARMv5TEJ 7
16#define CPU_ARCH_ARMv6 8
17
18/*
19 * CR1 bits (CP#15 CR1)
20 */
21#define CR_M (1 << 0) /* MMU enable */
22#define CR_A (1 << 1) /* Alignment abort enable */
23#define CR_C (1 << 2) /* Dcache enable */
24#define CR_W (1 << 3) /* Write buffer enable */
25#define CR_P (1 << 4) /* 32-bit exception handler */
26#define CR_D (1 << 5) /* 32-bit data address range */
27#define CR_L (1 << 6) /* Implementation defined */
28#define CR_B (1 << 7) /* Big endian */
29#define CR_S (1 << 8) /* System MMU protection */
30#define CR_R (1 << 9) /* ROM MMU protection */
31#define CR_F (1 << 10) /* Implementation defined */
32#define CR_Z (1 << 11) /* Implementation defined */
33#define CR_I (1 << 12) /* Icache enable */
34#define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */
35#define CR_RR (1 << 14) /* Round Robin cache replacement */
36#define CR_L4 (1 << 15) /* LDR pc can set T bit */
37#define CR_DT (1 << 16)
38#define CR_IT (1 << 18)
39#define CR_ST (1 << 19)
40#define CR_FI (1 << 21) /* Fast interrupt (lower latency mode) */
41#define CR_U (1 << 22) /* Unaligned access operation */
42#define CR_XP (1 << 23) /* Extended page tables */
43#define CR_VE (1 << 24) /* Vectored interrupts */
44
45#define CPUID_ID 0
46#define CPUID_CACHETYPE 1
47#define CPUID_TCM 2
48#define CPUID_TLBTYPE 3
49
50#define read_cpuid(reg) \
51 ({ \
52 unsigned int __val; \
53 asm("mrc p15, 0, %0, c0, c0, " __stringify(reg) \
54 : "=r" (__val) \
55 : \
56 : "cc"); \
57 __val; \
58 })
59
60/*
61 * This is used to ensure the compiler did actually allocate the register we
62 * asked it for some inline assembly sequences. Apparently we can't trust
63 * the compiler from one version to another so a bit of paranoia won't hurt.
64 * This string is meant to be concatenated with the inline asm string and
65 * will cause compilation to stop on mismatch.
66 * (for details, see gcc PR 15089)
67 */
68#define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t"
69
70#ifndef __ASSEMBLY__
71
72#include <linux/linkage.h>
73
74struct thread_info;
75struct task_struct;
76
77/* information about the system we're running on */
78extern unsigned int system_rev;
79extern unsigned int system_serial_low;
80extern unsigned int system_serial_high;
81extern unsigned int mem_fclk_21285;
82
83struct pt_regs;
84
85void die(const char *msg, struct pt_regs *regs, int err)
86 __attribute__((noreturn));
87
88void die_if_kernel(const char *str, struct pt_regs *regs, int err);
89
90void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
91 struct pt_regs *),
92 int sig, const char *name);
93
94#include <asm/proc-fns.h>
95
96#define xchg(ptr,x) \
97 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
98
99#define tas(ptr) (xchg((ptr),1))
100
101extern asmlinkage void __backtrace(void);
102
103extern int cpu_architecture(void);
104
105#define set_cr(x) \
106 __asm__ __volatile__( \
107 "mcr p15, 0, %0, c1, c0, 0 @ set CR" \
108 : : "r" (x) : "cc")
109
110#define get_cr() \
111 ({ \
112 unsigned int __val; \
113 __asm__ __volatile__( \
114 "mrc p15, 0, %0, c1, c0, 0 @ get CR" \
115 : "=r" (__val) : : "cc"); \
116 __val; \
117 })
118
119extern unsigned long cr_no_alignment; /* defined in entry-armv.S */
120extern unsigned long cr_alignment; /* defined in entry-armv.S */
121
122#define UDBG_UNDEFINED (1 << 0)
123#define UDBG_SYSCALL (1 << 1)
124#define UDBG_BADABORT (1 << 2)
125#define UDBG_SEGV (1 << 3)
126#define UDBG_BUS (1 << 4)
127
128extern unsigned int user_debug;
129
130#if __LINUX_ARM_ARCH__ >= 4
131#define vectors_high() (cr_alignment & CR_V)
132#else
133#define vectors_high() (0)
134#endif
135
136#define mb() __asm__ __volatile__ ("" : : : "memory")
137#define rmb() mb()
138#define wmb() mb()
139#define read_barrier_depends() do { } while(0)
140#define set_mb(var, value) do { var = value; mb(); } while (0)
141#define set_wmb(var, value) do { var = value; wmb(); } while (0)
142#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
143
144#ifdef CONFIG_SMP
145/*
146 * Define our own context switch locking. This allows us to enable
147 * interrupts over the context switch, otherwise we end up with high
148 * interrupt latency. The real problem area is switch_mm() which may
149 * do a full cache flush.
150 */
151#define prepare_arch_switch(rq,next) \
152do { \
153 spin_lock(&(next)->switch_lock); \
154 spin_unlock_irq(&(rq)->lock); \
155} while (0)
156
157#define finish_arch_switch(rq,prev) \
158 spin_unlock(&(prev)->switch_lock)
159
160#define task_running(rq,p) \
161 ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock))
162#else
163/*
164 * Our UP-case is more simple, but we assume knowledge of how
165 * spin_unlock_irq() and friends are implemented. This avoids
166 * us needlessly decrementing and incrementing the preempt count.
167 */
168#define prepare_arch_switch(rq,next) local_irq_enable()
169#define finish_arch_switch(rq,prev) spin_unlock(&(rq)->lock)
170#define task_running(rq,p) ((rq)->curr == (p))
171#endif
172
173/*
174 * switch_to(prev, next) should switch from task `prev' to `next'
175 * `prev' will never be the same as `next'. schedule() itself
176 * contains the memory barrier to tell GCC not to cache `current'.
177 */
178extern struct task_struct *__switch_to(struct task_struct *, struct thread_info *, struct thread_info *);
179
180#define switch_to(prev,next,last) \
181do { \
182 last = __switch_to(prev,prev->thread_info,next->thread_info); \
183} while (0)
184
185/*
186 * CPU interrupt mask handling.
187 */
188#if __LINUX_ARM_ARCH__ >= 6
189
190#define local_irq_save(x) \
191 ({ \
192 __asm__ __volatile__( \
193 "mrs %0, cpsr @ local_irq_save\n" \
194 "cpsid i" \
195 : "=r" (x) : : "memory", "cc"); \
196 })
197
198#define local_irq_enable() __asm__("cpsie i @ __sti" : : : "memory", "cc")
199#define local_irq_disable() __asm__("cpsid i @ __cli" : : : "memory", "cc")
200#define local_fiq_enable() __asm__("cpsie f @ __stf" : : : "memory", "cc")
201#define local_fiq_disable() __asm__("cpsid f @ __clf" : : : "memory", "cc")
202
203#else
204
205/*
206 * Save the current interrupt enable state & disable IRQs
207 */
208#define local_irq_save(x) \
209 ({ \
210 unsigned long temp; \
211 (void) (&temp == &x); \
212 __asm__ __volatile__( \
213 "mrs %0, cpsr @ local_irq_save\n" \
214" orr %1, %0, #128\n" \
215" msr cpsr_c, %1" \
216 : "=r" (x), "=r" (temp) \
217 : \
218 : "memory", "cc"); \
219 })
220
221/*
222 * Enable IRQs
223 */
224#define local_irq_enable() \
225 ({ \
226 unsigned long temp; \
227 __asm__ __volatile__( \
228 "mrs %0, cpsr @ local_irq_enable\n" \
229" bic %0, %0, #128\n" \
230" msr cpsr_c, %0" \
231 : "=r" (temp) \
232 : \
233 : "memory", "cc"); \
234 })
235
236/*
237 * Disable IRQs
238 */
239#define local_irq_disable() \
240 ({ \
241 unsigned long temp; \
242 __asm__ __volatile__( \
243 "mrs %0, cpsr @ local_irq_disable\n" \
244" orr %0, %0, #128\n" \
245" msr cpsr_c, %0" \
246 : "=r" (temp) \
247 : \
248 : "memory", "cc"); \
249 })
250
251/*
252 * Enable FIQs
253 */
254#define local_fiq_enable() \
255 ({ \
256 unsigned long temp; \
257 __asm__ __volatile__( \
258 "mrs %0, cpsr @ stf\n" \
259" bic %0, %0, #64\n" \
260" msr cpsr_c, %0" \
261 : "=r" (temp) \
262 : \
263 : "memory", "cc"); \
264 })
265
266/*
267 * Disable FIQs
268 */
269#define local_fiq_disable() \
270 ({ \
271 unsigned long temp; \
272 __asm__ __volatile__( \
273 "mrs %0, cpsr @ clf\n" \
274" orr %0, %0, #64\n" \
275" msr cpsr_c, %0" \
276 : "=r" (temp) \
277 : \
278 : "memory", "cc"); \
279 })
280
281#endif
282
283/*
284 * Save the current interrupt enable state.
285 */
286#define local_save_flags(x) \
287 ({ \
288 __asm__ __volatile__( \
289 "mrs %0, cpsr @ local_save_flags" \
290 : "=r" (x) : : "memory", "cc"); \
291 })
292
293/*
294 * restore saved IRQ & FIQ state
295 */
296#define local_irq_restore(x) \
297 __asm__ __volatile__( \
298 "msr cpsr_c, %0 @ local_irq_restore\n" \
299 : \
300 : "r" (x) \
301 : "memory", "cc")
302
303#define irqs_disabled() \
304({ \
305 unsigned long flags; \
306 local_save_flags(flags); \
307 flags & PSR_I_BIT; \
308})
309
310#ifdef CONFIG_SMP
311#error SMP not supported
312
313#define smp_mb() mb()
314#define smp_rmb() rmb()
315#define smp_wmb() wmb()
316#define smp_read_barrier_depends() read_barrier_depends()
317
318#else
319
320#define smp_mb() barrier()
321#define smp_rmb() barrier()
322#define smp_wmb() barrier()
323#define smp_read_barrier_depends() do { } while(0)
324
325#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
326/*
327 * On the StrongARM, "swp" is terminally broken since it bypasses the
328 * cache totally. This means that the cache becomes inconsistent, and,
329 * since we use normal loads/stores as well, this is really bad.
330 * Typically, this causes oopsen in filp_close, but could have other,
331 * more disasterous effects. There are two work-arounds:
332 * 1. Disable interrupts and emulate the atomic swap
333 * 2. Clean the cache, perform atomic swap, flush the cache
334 *
335 * We choose (1) since its the "easiest" to achieve here and is not
336 * dependent on the processor type.
337 */
338#define swp_is_buggy
339#endif
340
341static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
342{
343 extern void __bad_xchg(volatile void *, int);
344 unsigned long ret;
345#ifdef swp_is_buggy
346 unsigned long flags;
347#endif
348
349 switch (size) {
350#ifdef swp_is_buggy
351 case 1:
352 local_irq_save(flags);
353 ret = *(volatile unsigned char *)ptr;
354 *(volatile unsigned char *)ptr = x;
355 local_irq_restore(flags);
356 break;
357
358 case 4:
359 local_irq_save(flags);
360 ret = *(volatile unsigned long *)ptr;
361 *(volatile unsigned long *)ptr = x;
362 local_irq_restore(flags);
363 break;
364#else
365 case 1: __asm__ __volatile__ ("swpb %0, %1, [%2]"
366 : "=&r" (ret)
367 : "r" (x), "r" (ptr)
368 : "memory", "cc");
369 break;
370 case 4: __asm__ __volatile__ ("swp %0, %1, [%2]"
371 : "=&r" (ret)
372 : "r" (x), "r" (ptr)
373 : "memory", "cc");
374 break;
375#endif
376 default: __bad_xchg(ptr, size), ret = 0;
377 }
378
379 return ret;
380}
381
382#endif /* CONFIG_SMP */
383
384#endif /* __ASSEMBLY__ */
385
386#define arch_align_stack(x) (x)
387
388#endif /* __KERNEL__ */
389
390#endif
diff --git a/include/asm-arm/termbits.h b/include/asm-arm/termbits.h
new file mode 100644
index 000000000000..bbc6e1d24d3f
--- /dev/null
+++ b/include/asm-arm/termbits.h
@@ -0,0 +1,171 @@
1#ifndef __ASM_ARM_TERMBITS_H
2#define __ASM_ARM_TERMBITS_H
3
4typedef unsigned char cc_t;
5typedef unsigned int speed_t;
6typedef unsigned int tcflag_t;
7
8#define NCCS 19
9struct termios {
10 tcflag_t c_iflag; /* input mode flags */
11 tcflag_t c_oflag; /* output mode flags */
12 tcflag_t c_cflag; /* control mode flags */
13 tcflag_t c_lflag; /* local mode flags */
14 cc_t c_line; /* line discipline */
15 cc_t c_cc[NCCS]; /* control characters */
16};
17
18/* c_cc characters */
19#define VINTR 0
20#define VQUIT 1
21#define VERASE 2
22#define VKILL 3
23#define VEOF 4
24#define VTIME 5
25#define VMIN 6
26#define VSWTC 7
27#define VSTART 8
28#define VSTOP 9
29#define VSUSP 10
30#define VEOL 11
31#define VREPRINT 12
32#define VDISCARD 13
33#define VWERASE 14
34#define VLNEXT 15
35#define VEOL2 16
36
37/* c_iflag bits */
38#define IGNBRK 0000001
39#define BRKINT 0000002
40#define IGNPAR 0000004
41#define PARMRK 0000010
42#define INPCK 0000020
43#define ISTRIP 0000040
44#define INLCR 0000100
45#define IGNCR 0000200
46#define ICRNL 0000400
47#define IUCLC 0001000
48#define IXON 0002000
49#define IXANY 0004000
50#define IXOFF 0010000
51#define IMAXBEL 0020000
52#define IUTF8 0040000
53
54/* c_oflag bits */
55#define OPOST 0000001
56#define OLCUC 0000002
57#define ONLCR 0000004
58#define OCRNL 0000010
59#define ONOCR 0000020
60#define ONLRET 0000040
61#define OFILL 0000100
62#define OFDEL 0000200
63#define NLDLY 0000400
64#define NL0 0000000
65#define NL1 0000400
66#define CRDLY 0003000
67#define CR0 0000000
68#define CR1 0001000
69#define CR2 0002000
70#define CR3 0003000
71#define TABDLY 0014000
72#define TAB0 0000000
73#define TAB1 0004000
74#define TAB2 0010000
75#define TAB3 0014000
76#define XTABS 0014000
77#define BSDLY 0020000
78#define BS0 0000000
79#define BS1 0020000
80#define VTDLY 0040000
81#define VT0 0000000
82#define VT1 0040000
83#define FFDLY 0100000
84#define FF0 0000000
85#define FF1 0100000
86
87/* c_cflag bit meaning */
88#define CBAUD 0010017
89#define B0 0000000 /* hang up */
90#define B50 0000001
91#define B75 0000002
92#define B110 0000003
93#define B134 0000004
94#define B150 0000005
95#define B200 0000006
96#define B300 0000007
97#define B600 0000010
98#define B1200 0000011
99#define B1800 0000012
100#define B2400 0000013
101#define B4800 0000014
102#define B9600 0000015
103#define B19200 0000016
104#define B38400 0000017
105#define EXTA B19200
106#define EXTB B38400
107#define CSIZE 0000060
108#define CS5 0000000
109#define CS6 0000020
110#define CS7 0000040
111#define CS8 0000060
112#define CSTOPB 0000100
113#define CREAD 0000200
114#define PARENB 0000400
115#define PARODD 0001000
116#define HUPCL 0002000
117#define CLOCAL 0004000
118#define CBAUDEX 0010000
119#define B57600 0010001
120#define B115200 0010002
121#define B230400 0010003
122#define B460800 0010004
123#define B500000 0010005
124#define B576000 0010006
125#define B921600 0010007
126#define B1000000 0010010
127#define B1152000 0010011
128#define B1500000 0010012
129#define B2000000 0010013
130#define B2500000 0010014
131#define B3000000 0010015
132#define B3500000 0010016
133#define B4000000 0010017
134#define CIBAUD 002003600000 /* input baud rate (not used) */
135#define CMSPAR 010000000000 /* mark or space (stick) parity */
136#define CRTSCTS 020000000000 /* flow control */
137
138/* c_lflag bits */
139#define ISIG 0000001
140#define ICANON 0000002
141#define XCASE 0000004
142#define ECHO 0000010
143#define ECHOE 0000020
144#define ECHOK 0000040
145#define ECHONL 0000100
146#define NOFLSH 0000200
147#define TOSTOP 0000400
148#define ECHOCTL 0001000
149#define ECHOPRT 0002000
150#define ECHOKE 0004000
151#define FLUSHO 0010000
152#define PENDIN 0040000
153#define IEXTEN 0100000
154
155/* tcflow() and TCXONC use these */
156#define TCOOFF 0
157#define TCOON 1
158#define TCIOFF 2
159#define TCION 3
160
161/* tcflush() and TCFLSH use these */
162#define TCIFLUSH 0
163#define TCOFLUSH 1
164#define TCIOFLUSH 2
165
166/* tcsetattr uses these */
167#define TCSANOW 0
168#define TCSADRAIN 1
169#define TCSAFLUSH 2
170
171#endif /* __ASM_ARM_TERMBITS_H */
diff --git a/include/asm-arm/termios.h b/include/asm-arm/termios.h
new file mode 100644
index 000000000000..7b8f5e8ae063
--- /dev/null
+++ b/include/asm-arm/termios.h
@@ -0,0 +1,108 @@
1#ifndef __ASM_ARM_TERMIOS_H
2#define __ASM_ARM_TERMIOS_H
3
4#include <asm/termbits.h>
5#include <asm/ioctls.h>
6
7struct winsize {
8 unsigned short ws_row;
9 unsigned short ws_col;
10 unsigned short ws_xpixel;
11 unsigned short ws_ypixel;
12};
13
14#define NCC 8
15struct termio {
16 unsigned short c_iflag; /* input mode flags */
17 unsigned short c_oflag; /* output mode flags */
18 unsigned short c_cflag; /* control mode flags */
19 unsigned short c_lflag; /* local mode flags */
20 unsigned char c_line; /* line discipline */
21 unsigned char c_cc[NCC]; /* control characters */
22};
23
24#ifdef __KERNEL__
25/* intr=^C quit=^| erase=del kill=^U
26 eof=^D vtime=\0 vmin=\1 sxtc=\0
27 start=^Q stop=^S susp=^Z eol=\0
28 reprint=^R discard=^U werase=^W lnext=^V
29 eol2=\0
30*/
31#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
32#endif
33
34/* modem lines */
35#define TIOCM_LE 0x001
36#define TIOCM_DTR 0x002
37#define TIOCM_RTS 0x004
38#define TIOCM_ST 0x008
39#define TIOCM_SR 0x010
40#define TIOCM_CTS 0x020
41#define TIOCM_CAR 0x040
42#define TIOCM_RNG 0x080
43#define TIOCM_DSR 0x100
44#define TIOCM_CD TIOCM_CAR
45#define TIOCM_RI TIOCM_RNG
46#define TIOCM_OUT1 0x2000
47#define TIOCM_OUT2 0x4000
48#define TIOCM_LOOP 0x8000
49
50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
51
52/* line disciplines */
53#define N_TTY 0
54#define N_SLIP 1
55#define N_MOUSE 2
56#define N_PPP 3
57#define N_STRIP 4
58#define N_AX25 5
59#define N_X25 6 /* X.25 async */
60#define N_6PACK 7
61#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
62#define N_R3964 9 /* Reserved for Simatic R3964 module */
63#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
64#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
65#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
66#define N_HDLC 13 /* synchronous HDLC */
67#define N_SYNC_PPP 14
68#define N_HCI 15 /* Bluetooth HCI UART */
69
70#ifdef __KERNEL__
71
72/*
73 * Translate a "termio" structure into a "termios". Ugh.
74 */
75#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
76 unsigned short __tmp; \
77 get_user(__tmp,&(termio)->x); \
78 *(unsigned short *) &(termios)->x = __tmp; \
79}
80
81#define user_termio_to_kernel_termios(termios, termio) \
82({ \
83 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
84 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
85 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
86 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
87 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
88})
89
90/*
91 * Translate a "termios" structure into a "termio". Ugh.
92 */
93#define kernel_termios_to_user_termio(termio, termios) \
94({ \
95 put_user((termios)->c_iflag, &(termio)->c_iflag); \
96 put_user((termios)->c_oflag, &(termio)->c_oflag); \
97 put_user((termios)->c_cflag, &(termio)->c_cflag); \
98 put_user((termios)->c_lflag, &(termio)->c_lflag); \
99 put_user((termios)->c_line, &(termio)->c_line); \
100 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
101})
102
103#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios))
104#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios))
105
106#endif /* __KERNEL__ */
107
108#endif /* __ASM_ARM_TERMIOS_H */
diff --git a/include/asm-arm/therm.h b/include/asm-arm/therm.h
new file mode 100644
index 000000000000..e51c923ecdf3
--- /dev/null
+++ b/include/asm-arm/therm.h
@@ -0,0 +1,28 @@
1/*
2 * linux/include/asm-arm/therm.h: Definitions for Dallas Semiconductor
3 * DS1620 thermometer driver (as used in the Rebel.com NetWinder)
4 */
5#ifndef __ASM_THERM_H
6#define __ASM_THERM_H
7
8/* ioctl numbers for /dev/therm */
9#define CMD_SET_THERMOSTATE 0x53
10#define CMD_GET_THERMOSTATE 0x54
11#define CMD_GET_STATUS 0x56
12#define CMD_GET_TEMPERATURE 0x57
13#define CMD_SET_THERMOSTATE2 0x58
14#define CMD_GET_THERMOSTATE2 0x59
15#define CMD_GET_TEMPERATURE2 0x5a
16#define CMD_GET_FAN 0x5b
17#define CMD_SET_FAN 0x5c
18
19#define FAN_OFF 0
20#define FAN_ON 1
21#define FAN_ALWAYS_ON 2
22
23struct therm {
24 int hi;
25 int lo;
26};
27
28#endif
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
new file mode 100644
index 000000000000..a61618fb433c
--- /dev/null
+++ b/include/asm-arm/thread_info.h
@@ -0,0 +1,147 @@
1/*
2 * linux/include/asm-arm/thread_info.h
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#ifndef __ASM_ARM_THREAD_INFO_H
11#define __ASM_ARM_THREAD_INFO_H
12
13#ifdef __KERNEL__
14
15#include <asm/fpstate.h>
16
17#ifndef __ASSEMBLY__
18
19struct task_struct;
20struct exec_domain;
21
22#include <asm/ptrace.h>
23#include <asm/types.h>
24#include <asm/domain.h>
25
26typedef unsigned long mm_segment_t;
27
28struct cpu_context_save {
29 __u32 r4;
30 __u32 r5;
31 __u32 r6;
32 __u32 r7;
33 __u32 r8;
34 __u32 r9;
35 __u32 sl;
36 __u32 fp;
37 __u32 sp;
38 __u32 pc;
39 __u32 extra[2]; /* Xscale 'acc' register, etc */
40};
41
42/*
43 * low level task data that entry.S needs immediate access to.
44 * __switch_to() assumes cpu_context follows immediately after cpu_domain.
45 */
46struct thread_info {
47 unsigned long flags; /* low level flags */
48 __s32 preempt_count; /* 0 => preemptable, <0 => bug */
49 mm_segment_t addr_limit; /* address limit */
50 struct task_struct *task; /* main task structure */
51 struct exec_domain *exec_domain; /* execution domain */
52 __u32 cpu; /* cpu */
53 __u32 cpu_domain; /* cpu domain */
54 struct cpu_context_save cpu_context; /* cpu context */
55 __u8 used_cp[16]; /* thread used copro */
56 unsigned long tp_value;
57 union fp_state fpstate;
58 union vfp_state vfpstate;
59 struct restart_block restart_block;
60};
61
62#define INIT_THREAD_INFO(tsk) \
63{ \
64 .task = &tsk, \
65 .exec_domain = &default_exec_domain, \
66 .flags = 0, \
67 .preempt_count = 1, \
68 .addr_limit = KERNEL_DS, \
69 .cpu_domain = domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \
70 domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
71 domain_val(DOMAIN_IO, DOMAIN_CLIENT), \
72 .restart_block = { \
73 .fn = do_no_restart_syscall, \
74 }, \
75}
76
77#define init_thread_info (init_thread_union.thread_info)
78#define init_stack (init_thread_union.stack)
79
80#define THREAD_SIZE 8192
81
82/*
83 * how to get the thread information struct from C
84 */
85static inline struct thread_info *current_thread_info(void) __attribute_const__;
86
87static inline struct thread_info *current_thread_info(void)
88{
89 register unsigned long sp asm ("sp");
90 return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
91}
92
93extern struct thread_info *alloc_thread_info(struct task_struct *task);
94extern void free_thread_info(struct thread_info *);
95
96#define get_thread_info(ti) get_task_struct((ti)->task)
97#define put_thread_info(ti) put_task_struct((ti)->task)
98
99#define thread_saved_pc(tsk) \
100 ((unsigned long)(pc_pointer((tsk)->thread_info->cpu_context.pc)))
101#define thread_saved_fp(tsk) \
102 ((unsigned long)((tsk)->thread_info->cpu_context.fp))
103
104extern void iwmmxt_task_disable(struct thread_info *);
105extern void iwmmxt_task_copy(struct thread_info *, void *);
106extern void iwmmxt_task_restore(struct thread_info *, void *);
107extern void iwmmxt_task_release(struct thread_info *);
108
109#endif
110
111/*
112 * We use bit 30 of the preempt_count to indicate that kernel
113 * preemption is occuring. See include/asm-arm/hardirq.h.
114 */
115#define PREEMPT_ACTIVE 0x40000000
116
117/*
118 * thread information flags:
119 * TIF_SYSCALL_TRACE - syscall trace active
120 * TIF_NOTIFY_RESUME - resumption notification requested
121 * TIF_SIGPENDING - signal pending
122 * TIF_NEED_RESCHED - rescheduling necessary
123 * TIF_USEDFPU - FPU was used by this task this quantum (SMP)
124 * TIF_POLLING_NRFLAG - true if poll_idle() is polling TIF_NEED_RESCHED
125 */
126#define TIF_NOTIFY_RESUME 0
127#define TIF_SIGPENDING 1
128#define TIF_NEED_RESCHED 2
129#define TIF_SYSCALL_TRACE 8
130#define TIF_POLLING_NRFLAG 16
131#define TIF_USING_IWMMXT 17
132#define TIF_MEMDIE 18
133
134#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
135#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
136#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
137#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
138#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
139#define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT)
140
141/*
142 * Change these and you break ASM code in entry-common.S
143 */
144#define _TIF_WORK_MASK 0x000000ff
145
146#endif /* __KERNEL__ */
147#endif /* __ASM_ARM_THREAD_INFO_H */
diff --git a/include/asm-arm/timex.h b/include/asm-arm/timex.h
new file mode 100644
index 000000000000..7b8d4cb24be0
--- /dev/null
+++ b/include/asm-arm/timex.h
@@ -0,0 +1,24 @@
1/*
2 * linux/include/asm-arm/timex.h
3 *
4 * Copyright (C) 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 * Architecture Specific TIME specifications
11 */
12#ifndef _ASMARM_TIMEX_H
13#define _ASMARM_TIMEX_H
14
15#include <asm/arch/timex.h>
16
17typedef unsigned long cycles_t;
18
19static inline cycles_t get_cycles (void)
20{
21 return 0;
22}
23
24#endif
diff --git a/include/asm-arm/tlb.h b/include/asm-arm/tlb.h
new file mode 100644
index 000000000000..9bb325c54645
--- /dev/null
+++ b/include/asm-arm/tlb.h
@@ -0,0 +1,102 @@
1/*
2 * linux/include/asm-arm/tlb.h
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 * Experimentation shows that on a StrongARM, it appears to be faster
11 * to use the "invalidate whole tlb" rather than "invalidate single
12 * tlb" for this.
13 *
14 * This appears true for both the process fork+exit case, as well as
15 * the munmap-large-area case.
16 */
17#ifndef __ASMARM_TLB_H
18#define __ASMARM_TLB_H
19
20#include <asm/cacheflush.h>
21#include <asm/tlbflush.h>
22#include <asm/pgalloc.h>
23
24/*
25 * TLB handling. This allows us to remove pages from the page
26 * tables, and efficiently handle the TLB issues.
27 */
28struct mmu_gather {
29 struct mm_struct *mm;
30 unsigned int freed;
31 unsigned int fullmm;
32
33 unsigned int flushes;
34 unsigned int avoided_flushes;
35};
36
37DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
38
39static inline struct mmu_gather *
40tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
41{
42 int cpu = smp_processor_id();
43 struct mmu_gather *tlb = &per_cpu(mmu_gathers, cpu);
44
45 tlb->mm = mm;
46 tlb->freed = 0;
47 tlb->fullmm = full_mm_flush;
48
49 return tlb;
50}
51
52static inline void
53tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
54{
55 struct mm_struct *mm = tlb->mm;
56 unsigned long freed = tlb->freed;
57 int rss = get_mm_counter(mm, rss);
58
59 if (rss < freed)
60 freed = rss;
61 add_mm_counter(mm, rss, -freed);
62
63 if (tlb->fullmm)
64 flush_tlb_mm(mm);
65
66 /* keep the page table cache within bounds */
67 check_pgt_cache();
68}
69
70static inline unsigned int tlb_is_full_mm(struct mmu_gather *tlb)
71{
72 return tlb->fullmm;
73}
74
75#define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0)
76
77/*
78 * In the case of tlb vma handling, we can optimise these away in the
79 * case where we're doing a full MM flush. When we're doing a munmap,
80 * the vmas are adjusted to only cover the region to be torn down.
81 */
82static inline void
83tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
84{
85 if (!tlb->fullmm)
86 flush_cache_range(vma, vma->vm_start, vma->vm_end);
87}
88
89static inline void
90tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
91{
92 if (!tlb->fullmm)
93 flush_tlb_range(vma, vma->vm_start, vma->vm_end);
94}
95
96#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page)
97#define pte_free_tlb(tlb,ptep) pte_free(ptep)
98#define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp)
99
100#define tlb_migrate_finish(mm) do { } while (0)
101
102#endif
diff --git a/include/asm-arm/tlbflush.h b/include/asm-arm/tlbflush.h
new file mode 100644
index 000000000000..8a864b118569
--- /dev/null
+++ b/include/asm-arm/tlbflush.h
@@ -0,0 +1,404 @@
1/*
2 * linux/include/asm-arm/tlbflush.h
3 *
4 * Copyright (C) 1999-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#ifndef _ASMARM_TLBFLUSH_H
11#define _ASMARM_TLBFLUSH_H
12
13#include <linux/config.h>
14#include <asm/glue.h>
15
16#define TLB_V3_PAGE (1 << 0)
17#define TLB_V4_U_PAGE (1 << 1)
18#define TLB_V4_D_PAGE (1 << 2)
19#define TLB_V4_I_PAGE (1 << 3)
20#define TLB_V6_U_PAGE (1 << 4)
21#define TLB_V6_D_PAGE (1 << 5)
22#define TLB_V6_I_PAGE (1 << 6)
23
24#define TLB_V3_FULL (1 << 8)
25#define TLB_V4_U_FULL (1 << 9)
26#define TLB_V4_D_FULL (1 << 10)
27#define TLB_V4_I_FULL (1 << 11)
28#define TLB_V6_U_FULL (1 << 12)
29#define TLB_V6_D_FULL (1 << 13)
30#define TLB_V6_I_FULL (1 << 14)
31
32#define TLB_V6_U_ASID (1 << 16)
33#define TLB_V6_D_ASID (1 << 17)
34#define TLB_V6_I_ASID (1 << 18)
35
36#define TLB_DCLEAN (1 << 30)
37#define TLB_WB (1 << 31)
38
39/*
40 * MMU TLB Model
41 * =============
42 *
43 * We have the following to choose from:
44 * v3 - ARMv3
45 * v4 - ARMv4 without write buffer
46 * v4wb - ARMv4 with write buffer without I TLB flush entry instruction
47 * v4wbi - ARMv4 with write buffer with I TLB flush entry instruction
48 * v6wbi - ARMv6 with write buffer with I TLB flush entry instruction
49 */
50#undef _TLB
51#undef MULTI_TLB
52
53#define v3_tlb_flags (TLB_V3_FULL | TLB_V3_PAGE)
54
55#ifdef CONFIG_CPU_TLB_V3
56# define v3_possible_flags v3_tlb_flags
57# define v3_always_flags v3_tlb_flags
58# ifdef _TLB
59# define MULTI_TLB 1
60# else
61# define _TLB v3
62# endif
63#else
64# define v3_possible_flags 0
65# define v3_always_flags (-1UL)
66#endif
67
68#define v4_tlb_flags (TLB_V4_U_FULL | TLB_V4_U_PAGE)
69
70#ifdef CONFIG_CPU_TLB_V4WT
71# define v4_possible_flags v4_tlb_flags
72# define v4_always_flags v4_tlb_flags
73# ifdef _TLB
74# define MULTI_TLB 1
75# else
76# define _TLB v4
77# endif
78#else
79# define v4_possible_flags 0
80# define v4_always_flags (-1UL)
81#endif
82
83#define v4wbi_tlb_flags (TLB_WB | TLB_DCLEAN | \
84 TLB_V4_I_FULL | TLB_V4_D_FULL | \
85 TLB_V4_I_PAGE | TLB_V4_D_PAGE)
86
87#ifdef CONFIG_CPU_TLB_V4WBI
88# define v4wbi_possible_flags v4wbi_tlb_flags
89# define v4wbi_always_flags v4wbi_tlb_flags
90# ifdef _TLB
91# define MULTI_TLB 1
92# else
93# define _TLB v4wbi
94# endif
95#else
96# define v4wbi_possible_flags 0
97# define v4wbi_always_flags (-1UL)
98#endif
99
100#define v4wb_tlb_flags (TLB_WB | TLB_DCLEAN | \
101 TLB_V4_I_FULL | TLB_V4_D_FULL | \
102 TLB_V4_D_PAGE)
103
104#ifdef CONFIG_CPU_TLB_V4WB
105# define v4wb_possible_flags v4wb_tlb_flags
106# define v4wb_always_flags v4wb_tlb_flags
107# ifdef _TLB
108# define MULTI_TLB 1
109# else
110# define _TLB v4wb
111# endif
112#else
113# define v4wb_possible_flags 0
114# define v4wb_always_flags (-1UL)
115#endif
116
117#define v6wbi_tlb_flags (TLB_WB | TLB_DCLEAN | \
118 TLB_V6_I_FULL | TLB_V6_D_FULL | \
119 TLB_V6_I_PAGE | TLB_V6_D_PAGE | \
120 TLB_V6_I_ASID | TLB_V6_D_ASID)
121
122#ifdef CONFIG_CPU_TLB_V6
123# define v6wbi_possible_flags v6wbi_tlb_flags
124# define v6wbi_always_flags v6wbi_tlb_flags
125# ifdef _TLB
126# define MULTI_TLB 1
127# else
128# define _TLB v6wbi
129# endif
130#else
131# define v6wbi_possible_flags 0
132# define v6wbi_always_flags (-1UL)
133#endif
134
135#ifndef _TLB
136#error Unknown TLB model
137#endif
138
139#ifndef __ASSEMBLY__
140
141struct cpu_tlb_fns {
142 void (*flush_user_range)(unsigned long, unsigned long, struct vm_area_struct *);
143 void (*flush_kern_range)(unsigned long, unsigned long);
144 unsigned long tlb_flags;
145};
146
147/*
148 * Select the calling method
149 */
150#ifdef MULTI_TLB
151
152#define __cpu_flush_user_tlb_range cpu_tlb.flush_user_range
153#define __cpu_flush_kern_tlb_range cpu_tlb.flush_kern_range
154
155#else
156
157#define __cpu_flush_user_tlb_range __glue(_TLB,_flush_user_tlb_range)
158#define __cpu_flush_kern_tlb_range __glue(_TLB,_flush_kern_tlb_range)
159
160extern void __cpu_flush_user_tlb_range(unsigned long, unsigned long, struct vm_area_struct *);
161extern void __cpu_flush_kern_tlb_range(unsigned long, unsigned long);
162
163#endif
164
165extern struct cpu_tlb_fns cpu_tlb;
166
167#define __cpu_tlb_flags cpu_tlb.tlb_flags
168
169/*
170 * TLB Management
171 * ==============
172 *
173 * The arch/arm/mm/tlb-*.S files implement these methods.
174 *
175 * The TLB specific code is expected to perform whatever tests it
176 * needs to determine if it should invalidate the TLB for each
177 * call. Start addresses are inclusive and end addresses are
178 * exclusive; it is safe to round these addresses down.
179 *
180 * flush_tlb_all()
181 *
182 * Invalidate the entire TLB.
183 *
184 * flush_tlb_mm(mm)
185 *
186 * Invalidate all TLB entries in a particular address
187 * space.
188 * - mm - mm_struct describing address space
189 *
190 * flush_tlb_range(mm,start,end)
191 *
192 * Invalidate a range of TLB entries in the specified
193 * address space.
194 * - mm - mm_struct describing address space
195 * - start - start address (may not be aligned)
196 * - end - end address (exclusive, may not be aligned)
197 *
198 * flush_tlb_page(vaddr,vma)
199 *
200 * Invalidate the specified page in the specified address range.
201 * - vaddr - virtual address (may not be aligned)
202 * - vma - vma_struct describing address range
203 *
204 * flush_kern_tlb_page(kaddr)
205 *
206 * Invalidate the TLB entry for the specified page. The address
207 * will be in the kernels virtual memory space. Current uses
208 * only require the D-TLB to be invalidated.
209 * - kaddr - Kernel virtual memory address
210 */
211
212/*
213 * We optimise the code below by:
214 * - building a set of TLB flags that might be set in __cpu_tlb_flags
215 * - building a set of TLB flags that will always be set in __cpu_tlb_flags
216 * - if we're going to need __cpu_tlb_flags, access it once and only once
217 *
218 * This allows us to build optimal assembly for the single-CPU type case,
219 * and as close to optimal given the compiler constrants for multi-CPU
220 * case. We could do better for the multi-CPU case if the compiler
221 * implemented the "%?" method, but this has been discontinued due to too
222 * many people getting it wrong.
223 */
224#define possible_tlb_flags (v3_possible_flags | \
225 v4_possible_flags | \
226 v4wbi_possible_flags | \
227 v4wb_possible_flags | \
228 v6wbi_possible_flags)
229
230#define always_tlb_flags (v3_always_flags & \
231 v4_always_flags & \
232 v4wbi_always_flags & \
233 v4wb_always_flags & \
234 v6wbi_always_flags)
235
236#define tlb_flag(f) ((always_tlb_flags & (f)) || (__tlb_flag & possible_tlb_flags & (f)))
237
238static inline void flush_tlb_all(void)
239{
240 const int zero = 0;
241 const unsigned int __tlb_flag = __cpu_tlb_flags;
242
243 if (tlb_flag(TLB_WB))
244 asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero));
245
246 if (tlb_flag(TLB_V3_FULL))
247 asm("mcr%? p15, 0, %0, c6, c0, 0" : : "r" (zero));
248 if (tlb_flag(TLB_V4_U_FULL | TLB_V6_U_FULL))
249 asm("mcr%? p15, 0, %0, c8, c7, 0" : : "r" (zero));
250 if (tlb_flag(TLB_V4_D_FULL | TLB_V6_D_FULL))
251 asm("mcr%? p15, 0, %0, c8, c6, 0" : : "r" (zero));
252 if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL))
253 asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero));
254}
255
256static inline void flush_tlb_mm(struct mm_struct *mm)
257{
258 const int zero = 0;
259 const int asid = ASID(mm);
260 const unsigned int __tlb_flag = __cpu_tlb_flags;
261
262 if (tlb_flag(TLB_WB))
263 asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero));
264
265 if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) {
266 if (tlb_flag(TLB_V3_FULL))
267 asm("mcr%? p15, 0, %0, c6, c0, 0" : : "r" (zero));
268 if (tlb_flag(TLB_V4_U_FULL))
269 asm("mcr%? p15, 0, %0, c8, c7, 0" : : "r" (zero));
270 if (tlb_flag(TLB_V4_D_FULL))
271 asm("mcr%? p15, 0, %0, c8, c6, 0" : : "r" (zero));
272 if (tlb_flag(TLB_V4_I_FULL))
273 asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero));
274 }
275
276 if (tlb_flag(TLB_V6_U_ASID))
277 asm("mcr%? p15, 0, %0, c8, c7, 2" : : "r" (asid));
278 if (tlb_flag(TLB_V6_D_ASID))
279 asm("mcr%? p15, 0, %0, c8, c6, 2" : : "r" (asid));
280 if (tlb_flag(TLB_V6_I_ASID))
281 asm("mcr%? p15, 0, %0, c8, c5, 2" : : "r" (asid));
282}
283
284static inline void
285flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
286{
287 const int zero = 0;
288 const unsigned int __tlb_flag = __cpu_tlb_flags;
289
290 uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm);
291
292 if (tlb_flag(TLB_WB))
293 asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero));
294
295 if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
296 if (tlb_flag(TLB_V3_PAGE))
297 asm("mcr%? p15, 0, %0, c6, c0, 0" : : "r" (uaddr));
298 if (tlb_flag(TLB_V4_U_PAGE))
299 asm("mcr%? p15, 0, %0, c8, c7, 1" : : "r" (uaddr));
300 if (tlb_flag(TLB_V4_D_PAGE))
301 asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (uaddr));
302 if (tlb_flag(TLB_V4_I_PAGE))
303 asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (uaddr));
304 if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL))
305 asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero));
306 }
307
308 if (tlb_flag(TLB_V6_U_PAGE))
309 asm("mcr%? p15, 0, %0, c8, c7, 1" : : "r" (uaddr));
310 if (tlb_flag(TLB_V6_D_PAGE))
311 asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (uaddr));
312 if (tlb_flag(TLB_V6_I_PAGE))
313 asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (uaddr));
314}
315
316static inline void flush_tlb_kernel_page(unsigned long kaddr)
317{
318 const int zero = 0;
319 const unsigned int __tlb_flag = __cpu_tlb_flags;
320
321 kaddr &= PAGE_MASK;
322
323 if (tlb_flag(TLB_WB))
324 asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero));
325
326 if (tlb_flag(TLB_V3_PAGE))
327 asm("mcr%? p15, 0, %0, c6, c0, 0" : : "r" (kaddr));
328 if (tlb_flag(TLB_V4_U_PAGE))
329 asm("mcr%? p15, 0, %0, c8, c7, 1" : : "r" (kaddr));
330 if (tlb_flag(TLB_V4_D_PAGE))
331 asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (kaddr));
332 if (tlb_flag(TLB_V4_I_PAGE))
333 asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (kaddr));
334 if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL))
335 asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero));
336
337 if (tlb_flag(TLB_V6_U_PAGE))
338 asm("mcr%? p15, 0, %0, c8, c7, 1" : : "r" (kaddr));
339 if (tlb_flag(TLB_V6_D_PAGE))
340 asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (kaddr));
341 if (tlb_flag(TLB_V6_I_PAGE))
342 asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (kaddr));
343}
344
345/*
346 * flush_pmd_entry
347 *
348 * Flush a PMD entry (word aligned, or double-word aligned) to
349 * RAM if the TLB for the CPU we are running on requires this.
350 * This is typically used when we are creating PMD entries.
351 *
352 * clean_pmd_entry
353 *
354 * Clean (but don't drain the write buffer) if the CPU requires
355 * these operations. This is typically used when we are removing
356 * PMD entries.
357 */
358static inline void flush_pmd_entry(pmd_t *pmd)
359{
360 const unsigned int zero = 0;
361 const unsigned int __tlb_flag = __cpu_tlb_flags;
362
363 if (tlb_flag(TLB_DCLEAN))
364 asm("mcr%? p15, 0, %0, c7, c10, 1 @ flush_pmd"
365 : : "r" (pmd));
366 if (tlb_flag(TLB_WB))
367 asm("mcr%? p15, 0, %0, c7, c10, 4 @ flush_pmd"
368 : : "r" (zero));
369}
370
371static inline void clean_pmd_entry(pmd_t *pmd)
372{
373 const unsigned int __tlb_flag = __cpu_tlb_flags;
374
375 if (tlb_flag(TLB_DCLEAN))
376 asm("mcr%? p15, 0, %0, c7, c10, 1 @ flush_pmd"
377 : : "r" (pmd));
378}
379
380#undef tlb_flag
381#undef always_tlb_flags
382#undef possible_tlb_flags
383
384/*
385 * Convert calls to our calling convention.
386 */
387#define flush_tlb_range(vma,start,end) __cpu_flush_user_tlb_range(start,end,vma)
388#define flush_tlb_kernel_range(s,e) __cpu_flush_kern_tlb_range(s,e)
389
390/*
391 * if PG_dcache_dirty is set for the page, we need to ensure that any
392 * cache entries for the kernels virtual memory range are written
393 * back to the page.
394 */
395extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte);
396
397/*
398 * ARM processors do not cache TLB tables in RAM.
399 */
400#define flush_tlb_pgtables(mm,start,end) do { } while (0)
401
402#endif
403
404#endif
diff --git a/include/asm-arm/topology.h b/include/asm-arm/topology.h
new file mode 100644
index 000000000000..accbd7cad9b5
--- /dev/null
+++ b/include/asm-arm/topology.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_ARM_TOPOLOGY_H
2#define _ASM_ARM_TOPOLOGY_H
3
4#include <asm-generic/topology.h>
5
6#endif /* _ASM_ARM_TOPOLOGY_H */
diff --git a/include/asm-arm/traps.h b/include/asm-arm/traps.h
new file mode 100644
index 000000000000..d4f34dc83eb0
--- /dev/null
+++ b/include/asm-arm/traps.h
@@ -0,0 +1,18 @@
1#ifndef _ASMARM_TRAP_H
2#define _ASMARM_TRAP_H
3
4#include <linux/list.h>
5
6struct undef_hook {
7 struct list_head node;
8 u32 instr_mask;
9 u32 instr_val;
10 u32 cpsr_mask;
11 u32 cpsr_val;
12 int (*fn)(struct pt_regs *regs, unsigned int instr);
13};
14
15void register_undef_hook(struct undef_hook *hook);
16void unregister_undef_hook(struct undef_hook *hook);
17
18#endif
diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h
new file mode 100644
index 000000000000..f4c92e4c8c02
--- /dev/null
+++ b/include/asm-arm/types.h
@@ -0,0 +1,62 @@
1#ifndef __ASM_ARM_TYPES_H
2#define __ASM_ARM_TYPES_H
3
4#ifndef __ASSEMBLY__
5
6typedef unsigned short umode_t;
7
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
23typedef __signed__ long long __s64;
24typedef unsigned long long __u64;
25#endif
26
27#endif /* __ASSEMBLY__ */
28
29/*
30 * These aren't exported outside the kernel to avoid name space clashes
31 */
32#ifdef __KERNEL__
33
34#define BITS_PER_LONG 32
35
36#ifndef __ASSEMBLY__
37
38typedef signed char s8;
39typedef unsigned char u8;
40
41typedef signed short s16;
42typedef unsigned short u16;
43
44typedef signed int s32;
45typedef unsigned int u32;
46
47typedef signed long long s64;
48typedef unsigned long long u64;
49
50/* Dma addresses are 32-bits wide. */
51
52typedef u32 dma_addr_t;
53typedef u32 dma64_addr_t;
54
55typedef unsigned int kmem_bufctl_t;
56
57#endif /* __ASSEMBLY__ */
58
59#endif /* __KERNEL__ */
60
61#endif
62
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h
new file mode 100644
index 000000000000..a7c018b8a0d4
--- /dev/null
+++ b/include/asm-arm/uaccess.h
@@ -0,0 +1,438 @@
1/*
2 * linux/include/asm-arm/uaccess.h
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#ifndef _ASMARM_UACCESS_H
9#define _ASMARM_UACCESS_H
10
11/*
12 * User space memory access functions
13 */
14#include <linux/sched.h>
15#include <asm/errno.h>
16#include <asm/memory.h>
17#include <asm/domain.h>
18#include <asm/system.h>
19
20#define VERIFY_READ 0
21#define VERIFY_WRITE 1
22
23/*
24 * The exception table consists of pairs of addresses: the first is the
25 * address of an instruction that is allowed to fault, and the second is
26 * the address at which the program should continue. No registers are
27 * modified, so it is entirely up to the continuation code to figure out
28 * what to do.
29 *
30 * All the routines below use bits of fixup code that are out of line
31 * with the main instruction path. This means when everything is well,
32 * we don't even have to jump over them. Further, they do not intrude
33 * on our cache or tlb entries.
34 */
35
36struct exception_table_entry
37{
38 unsigned long insn, fixup;
39};
40
41extern int fixup_exception(struct pt_regs *regs);
42
43/*
44 * Note that this is actually 0x1,0000,0000
45 */
46#define KERNEL_DS 0x00000000
47#define USER_DS TASK_SIZE
48
49#define get_ds() (KERNEL_DS)
50#define get_fs() (current_thread_info()->addr_limit)
51
52static inline void set_fs (mm_segment_t fs)
53{
54 current_thread_info()->addr_limit = fs;
55 modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER);
56}
57
58#define segment_eq(a,b) ((a) == (b))
59
60#define __addr_ok(addr) ({ \
61 unsigned long flag; \
62 __asm__("cmp %2, %0; movlo %0, #0" \
63 : "=&r" (flag) \
64 : "0" (current_thread_info()->addr_limit), "r" (addr) \
65 : "cc"); \
66 (flag == 0); })
67
68/* We use 33-bit arithmetic here... */
69#define __range_ok(addr,size) ({ \
70 unsigned long flag, sum; \
71 __chk_user_ptr(addr); \
72 __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \
73 : "=&r" (flag), "=&r" (sum) \
74 : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \
75 : "cc"); \
76 flag; })
77
78#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
79
80/* this function will go away soon - use access_ok() instead */
81static inline int __deprecated verify_area(int type, const void __user *addr, unsigned long size)
82{
83 return access_ok(type, addr, size) ? 0 : -EFAULT;
84}
85
86/*
87 * Single-value transfer routines. They automatically use the right
88 * size if we just have the right pointer type. Note that the functions
89 * which read from user space (*get_*) need to take care not to leak
90 * kernel data even if the calling code is buggy and fails to check
91 * the return value. This means zeroing out the destination variable
92 * or buffer on error. Normally this is done out of line by the
93 * fixup code, but there are a few places where it intrudes on the
94 * main code path. When we only write to user space, there is no
95 * problem.
96 *
97 * The "__xxx" versions of the user access functions do not verify the
98 * address space - it must have been done previously with a separate
99 * "access_ok()" call.
100 *
101 * The "xxx_error" versions set the third argument to EFAULT if an
102 * error occurs, and leave it unchanged on success. Note that these
103 * versions are void (ie, don't return a value as such).
104 */
105
106extern int __get_user_1(void *);
107extern int __get_user_2(void *);
108extern int __get_user_4(void *);
109extern int __get_user_8(void *);
110extern int __get_user_bad(void);
111
112#define __get_user_x(__r2,__p,__e,__s,__i...) \
113 __asm__ __volatile__ ( \
114 __asmeq("%0", "r0") __asmeq("%1", "r2") \
115 "bl __get_user_" #__s \
116 : "=&r" (__e), "=r" (__r2) \
117 : "0" (__p) \
118 : __i, "cc")
119
120#define get_user(x,p) \
121 ({ \
122 const register typeof(*(p)) __user *__p asm("r0") = (p);\
123 register typeof(*(p)) __r2 asm("r2"); \
124 register int __e asm("r0"); \
125 switch (sizeof(*(__p))) { \
126 case 1: \
127 __get_user_x(__r2, __p, __e, 1, "lr"); \
128 break; \
129 case 2: \
130 __get_user_x(__r2, __p, __e, 2, "r3", "lr"); \
131 break; \
132 case 4: \
133 __get_user_x(__r2, __p, __e, 4, "lr"); \
134 break; \
135 case 8: \
136 __get_user_x(__r2, __p, __e, 8, "lr"); \
137 break; \
138 default: __e = __get_user_bad(); break; \
139 } \
140 x = __r2; \
141 __e; \
142 })
143
144#define __get_user(x,ptr) \
145({ \
146 long __gu_err = 0; \
147 __get_user_err((x),(ptr),__gu_err); \
148 __gu_err; \
149})
150
151#define __get_user_error(x,ptr,err) \
152({ \
153 __get_user_err((x),(ptr),err); \
154 (void) 0; \
155})
156
157#define __get_user_err(x,ptr,err) \
158do { \
159 unsigned long __gu_addr = (unsigned long)(ptr); \
160 unsigned long __gu_val; \
161 __chk_user_ptr(ptr); \
162 switch (sizeof(*(ptr))) { \
163 case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \
164 case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \
165 case 4: __get_user_asm_word(__gu_val,__gu_addr,err); break; \
166 default: (__gu_val) = __get_user_bad(); \
167 } \
168 (x) = (__typeof__(*(ptr)))__gu_val; \
169} while (0)
170
171#define __get_user_asm_byte(x,addr,err) \
172 __asm__ __volatile__( \
173 "1: ldrbt %1,[%2],#0\n" \
174 "2:\n" \
175 " .section .fixup,\"ax\"\n" \
176 " .align 2\n" \
177 "3: mov %0, %3\n" \
178 " mov %1, #0\n" \
179 " b 2b\n" \
180 " .previous\n" \
181 " .section __ex_table,\"a\"\n" \
182 " .align 3\n" \
183 " .long 1b, 3b\n" \
184 " .previous" \
185 : "+r" (err), "=&r" (x) \
186 : "r" (addr), "i" (-EFAULT) \
187 : "cc")
188
189#ifndef __ARMEB__
190#define __get_user_asm_half(x,__gu_addr,err) \
191({ \
192 unsigned long __b1, __b2; \
193 __get_user_asm_byte(__b1, __gu_addr, err); \
194 __get_user_asm_byte(__b2, __gu_addr + 1, err); \
195 (x) = __b1 | (__b2 << 8); \
196})
197#else
198#define __get_user_asm_half(x,__gu_addr,err) \
199({ \
200 unsigned long __b1, __b2; \
201 __get_user_asm_byte(__b1, __gu_addr, err); \
202 __get_user_asm_byte(__b2, __gu_addr + 1, err); \
203 (x) = (__b1 << 8) | __b2; \
204})
205#endif
206
207#define __get_user_asm_word(x,addr,err) \
208 __asm__ __volatile__( \
209 "1: ldrt %1,[%2],#0\n" \
210 "2:\n" \
211 " .section .fixup,\"ax\"\n" \
212 " .align 2\n" \
213 "3: mov %0, %3\n" \
214 " mov %1, #0\n" \
215 " b 2b\n" \
216 " .previous\n" \
217 " .section __ex_table,\"a\"\n" \
218 " .align 3\n" \
219 " .long 1b, 3b\n" \
220 " .previous" \
221 : "+r" (err), "=&r" (x) \
222 : "r" (addr), "i" (-EFAULT) \
223 : "cc")
224
225extern int __put_user_1(void *, unsigned int);
226extern int __put_user_2(void *, unsigned int);
227extern int __put_user_4(void *, unsigned int);
228extern int __put_user_8(void *, unsigned long long);
229extern int __put_user_bad(void);
230
231#define __put_user_x(__r2,__p,__e,__s) \
232 __asm__ __volatile__ ( \
233 __asmeq("%0", "r0") __asmeq("%2", "r2") \
234 "bl __put_user_" #__s \
235 : "=&r" (__e) \
236 : "0" (__p), "r" (__r2) \
237 : "ip", "lr", "cc")
238
239#define put_user(x,p) \
240 ({ \
241 const register typeof(*(p)) __r2 asm("r2") = (x); \
242 const register typeof(*(p)) __user *__p asm("r0") = (p);\
243 register int __e asm("r0"); \
244 switch (sizeof(*(__p))) { \
245 case 1: \
246 __put_user_x(__r2, __p, __e, 1); \
247 break; \
248 case 2: \
249 __put_user_x(__r2, __p, __e, 2); \
250 break; \
251 case 4: \
252 __put_user_x(__r2, __p, __e, 4); \
253 break; \
254 case 8: \
255 __put_user_x(__r2, __p, __e, 8); \
256 break; \
257 default: __e = __put_user_bad(); break; \
258 } \
259 __e; \
260 })
261
262#define __put_user(x,ptr) \
263({ \
264 long __pu_err = 0; \
265 __put_user_err((x),(ptr),__pu_err); \
266 __pu_err; \
267})
268
269#define __put_user_error(x,ptr,err) \
270({ \
271 __put_user_err((x),(ptr),err); \
272 (void) 0; \
273})
274
275#define __put_user_err(x,ptr,err) \
276do { \
277 unsigned long __pu_addr = (unsigned long)(ptr); \
278 __typeof__(*(ptr)) __pu_val = (x); \
279 __chk_user_ptr(ptr); \
280 switch (sizeof(*(ptr))) { \
281 case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \
282 case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \
283 case 4: __put_user_asm_word(__pu_val,__pu_addr,err); break; \
284 case 8: __put_user_asm_dword(__pu_val,__pu_addr,err); break; \
285 default: __put_user_bad(); \
286 } \
287} while (0)
288
289#define __put_user_asm_byte(x,__pu_addr,err) \
290 __asm__ __volatile__( \
291 "1: strbt %1,[%2],#0\n" \
292 "2:\n" \
293 " .section .fixup,\"ax\"\n" \
294 " .align 2\n" \
295 "3: mov %0, %3\n" \
296 " b 2b\n" \
297 " .previous\n" \
298 " .section __ex_table,\"a\"\n" \
299 " .align 3\n" \
300 " .long 1b, 3b\n" \
301 " .previous" \
302 : "+r" (err) \
303 : "r" (x), "r" (__pu_addr), "i" (-EFAULT) \
304 : "cc")
305
306#ifndef __ARMEB__
307#define __put_user_asm_half(x,__pu_addr,err) \
308({ \
309 unsigned long __temp = (unsigned long)(x); \
310 __put_user_asm_byte(__temp, __pu_addr, err); \
311 __put_user_asm_byte(__temp >> 8, __pu_addr + 1, err); \
312})
313#else
314#define __put_user_asm_half(x,__pu_addr,err) \
315({ \
316 unsigned long __temp = (unsigned long)(x); \
317 __put_user_asm_byte(__temp >> 8, __pu_addr, err); \
318 __put_user_asm_byte(__temp, __pu_addr + 1, err); \
319})
320#endif
321
322#define __put_user_asm_word(x,__pu_addr,err) \
323 __asm__ __volatile__( \
324 "1: strt %1,[%2],#0\n" \
325 "2:\n" \
326 " .section .fixup,\"ax\"\n" \
327 " .align 2\n" \
328 "3: mov %0, %3\n" \
329 " b 2b\n" \
330 " .previous\n" \
331 " .section __ex_table,\"a\"\n" \
332 " .align 3\n" \
333 " .long 1b, 3b\n" \
334 " .previous" \
335 : "+r" (err) \
336 : "r" (x), "r" (__pu_addr), "i" (-EFAULT) \
337 : "cc")
338
339#ifndef __ARMEB__
340#define __reg_oper0 "%R2"
341#define __reg_oper1 "%Q2"
342#else
343#define __reg_oper0 "%Q2"
344#define __reg_oper1 "%R2"
345#endif
346
347#define __put_user_asm_dword(x,__pu_addr,err) \
348 __asm__ __volatile__( \
349 "1: strt " __reg_oper1 ", [%1], #4\n" \
350 "2: strt " __reg_oper0 ", [%1], #0\n" \
351 "3:\n" \
352 " .section .fixup,\"ax\"\n" \
353 " .align 2\n" \
354 "4: mov %0, %3\n" \
355 " b 3b\n" \
356 " .previous\n" \
357 " .section __ex_table,\"a\"\n" \
358 " .align 3\n" \
359 " .long 1b, 4b\n" \
360 " .long 2b, 4b\n" \
361 " .previous" \
362 : "+r" (err), "+r" (__pu_addr) \
363 : "r" (x), "i" (-EFAULT) \
364 : "cc")
365
366extern unsigned long __arch_copy_from_user(void *to, const void __user *from, unsigned long n);
367extern unsigned long __arch_copy_to_user(void __user *to, const void *from, unsigned long n);
368extern unsigned long __arch_clear_user(void __user *addr, unsigned long n);
369extern unsigned long __arch_strncpy_from_user(char *to, const char __user *from, unsigned long count);
370extern unsigned long __arch_strnlen_user(const char __user *s, long n);
371
372static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n)
373{
374 if (access_ok(VERIFY_READ, from, n))
375 n = __arch_copy_from_user(to, from, n);
376 else /* security hole - plug it */
377 memzero(to, n);
378 return n;
379}
380
381static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)
382{
383 return __arch_copy_from_user(to, from, n);
384}
385
386static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)
387{
388 if (access_ok(VERIFY_WRITE, to, n))
389 n = __arch_copy_to_user(to, from, n);
390 return n;
391}
392
393static inline unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n)
394{
395 return __arch_copy_to_user(to, from, n);
396}
397
398#define __copy_to_user_inatomic __copy_to_user
399#define __copy_from_user_inatomic __copy_from_user
400
401static inline unsigned long clear_user (void __user *to, unsigned long n)
402{
403 if (access_ok(VERIFY_WRITE, to, n))
404 n = __arch_clear_user(to, n);
405 return n;
406}
407
408static inline unsigned long __clear_user (void __user *to, unsigned long n)
409{
410 return __arch_clear_user(to, n);
411}
412
413static inline long strncpy_from_user (char *dst, const char __user *src, long count)
414{
415 long res = -EFAULT;
416 if (access_ok(VERIFY_READ, src, 1))
417 res = __arch_strncpy_from_user(dst, src, count);
418 return res;
419}
420
421static inline long __strncpy_from_user (char *dst, const char __user *src, long count)
422{
423 return __arch_strncpy_from_user(dst, src, count);
424}
425
426#define strlen_user(s) strnlen_user(s, ~0UL >> 1)
427
428static inline long strnlen_user(const char __user *s, long n)
429{
430 unsigned long res = 0;
431
432 if (__addr_ok(s))
433 res = __arch_strnlen_user(s, n);
434
435 return res;
436}
437
438#endif /* _ASMARM_UACCESS_H */
diff --git a/include/asm-arm/ucontext.h b/include/asm-arm/ucontext.h
new file mode 100644
index 000000000000..f853130137cc
--- /dev/null
+++ b/include/asm-arm/ucontext.h
@@ -0,0 +1,12 @@
1#ifndef _ASMARM_UCONTEXT_H
2#define _ASMARM_UCONTEXT_H
3
4struct ucontext {
5 unsigned long uc_flags;
6 struct ucontext *uc_link;
7 stack_t uc_stack;
8 struct sigcontext uc_mcontext;
9 sigset_t uc_sigmask; /* mask last for extensibility */
10};
11
12#endif /* !_ASMARM_UCONTEXT_H */
diff --git a/include/asm-arm/unaligned.h b/include/asm-arm/unaligned.h
new file mode 100644
index 000000000000..1b39c2f322c9
--- /dev/null
+++ b/include/asm-arm/unaligned.h
@@ -0,0 +1,191 @@
1#ifndef __ASM_ARM_UNALIGNED_H
2#define __ASM_ARM_UNALIGNED_H
3
4#include <asm/types.h>
5
6extern int __bug_unaligned_x(void *ptr);
7
8/*
9 * What is the most efficient way of loading/storing an unaligned value?
10 *
11 * That is the subject of this file. Efficiency here is defined as
12 * minimum code size with minimum register usage for the common cases.
13 * It is currently not believed that long longs are common, so we
14 * trade efficiency for the chars, shorts and longs against the long
15 * longs.
16 *
17 * Current stats with gcc 2.7.2.2 for these functions:
18 *
19 * ptrsize get: code regs put: code regs
20 * 1 1 1 1 2
21 * 2 3 2 3 2
22 * 4 7 3 7 3
23 * 8 20 6 16 6
24 *
25 * gcc 2.95.1 seems to code differently:
26 *
27 * ptrsize get: code regs put: code regs
28 * 1 1 1 1 2
29 * 2 3 2 3 2
30 * 4 7 4 7 4
31 * 8 19 8 15 6
32 *
33 * which may or may not be more efficient (depending upon whether
34 * you can afford the extra registers). Hopefully the gcc 2.95
35 * is inteligent enough to decide if it is better to use the
36 * extra register, but evidence so far seems to suggest otherwise.
37 *
38 * Unfortunately, gcc is not able to optimise the high word
39 * out of long long >> 32, or the low word from long long << 32
40 */
41
42#define __get_unaligned_2_le(__p) \
43 (__p[0] | __p[1] << 8)
44
45#define __get_unaligned_2_be(__p) \
46 (__p[0] << 8 | __p[1])
47
48#define __get_unaligned_4_le(__p) \
49 (__p[0] | __p[1] << 8 | __p[2] << 16 | __p[3] << 24)
50
51#define __get_unaligned_4_be(__p) \
52 (__p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3])
53
54#define __get_unaligned_le(ptr) \
55 ({ \
56 __typeof__(*(ptr)) __v; \
57 __u8 *__p = (__u8 *)(ptr); \
58 switch (sizeof(*(ptr))) { \
59 case 1: __v = *(ptr); break; \
60 case 2: __v = __get_unaligned_2_le(__p); break; \
61 case 4: __v = __get_unaligned_4_le(__p); break; \
62 case 8: { \
63 unsigned int __v1, __v2; \
64 __v2 = __get_unaligned_4_le((__p+4)); \
65 __v1 = __get_unaligned_4_le(__p); \
66 __v = ((unsigned long long)__v2 << 32 | __v1); \
67 } \
68 break; \
69 default: __v = __bug_unaligned_x(__p); break; \
70 } \
71 __v; \
72 })
73
74#define __get_unaligned_be(ptr) \
75 ({ \
76 __typeof__(*(ptr)) __v; \
77 __u8 *__p = (__u8 *)(ptr); \
78 switch (sizeof(*(ptr))) { \
79 case 1: __v = *(ptr); break; \
80 case 2: __v = __get_unaligned_2_be(__p); break; \
81 case 4: __v = __get_unaligned_4_be(__p); break; \
82 case 8: { \
83 unsigned int __v1, __v2; \
84 __v2 = __get_unaligned_4_be(__p); \
85 __v1 = __get_unaligned_4_be((__p+4)); \
86 __v = ((unsigned long long)__v2 << 32 | __v1); \
87 } \
88 break; \
89 default: __v = __bug_unaligned_x(__p); break; \
90 } \
91 __v; \
92 })
93
94
95static inline void __put_unaligned_2_le(__u32 __v, register __u8 *__p)
96{
97 *__p++ = __v;
98 *__p++ = __v >> 8;
99}
100
101static inline void __put_unaligned_2_be(__u32 __v, register __u8 *__p)
102{
103 *__p++ = __v >> 8;
104 *__p++ = __v;
105}
106
107static inline void __put_unaligned_4_le(__u32 __v, register __u8 *__p)
108{
109 __put_unaligned_2_le(__v >> 16, __p + 2);
110 __put_unaligned_2_le(__v, __p);
111}
112
113static inline void __put_unaligned_4_be(__u32 __v, register __u8 *__p)
114{
115 __put_unaligned_2_be(__v >> 16, __p);
116 __put_unaligned_2_be(__v, __p + 2);
117}
118
119static inline void __put_unaligned_8_le(const unsigned long long __v, register __u8 *__p)
120{
121 /*
122 * tradeoff: 8 bytes of stack for all unaligned puts (2
123 * instructions), or an extra register in the long long
124 * case - go for the extra register.
125 */
126 __put_unaligned_4_le(__v >> 32, __p+4);
127 __put_unaligned_4_le(__v, __p);
128}
129
130static inline void __put_unaligned_8_be(const unsigned long long __v, register __u8 *__p)
131{
132 /*
133 * tradeoff: 8 bytes of stack for all unaligned puts (2
134 * instructions), or an extra register in the long long
135 * case - go for the extra register.
136 */
137 __put_unaligned_4_be(__v >> 32, __p);
138 __put_unaligned_4_be(__v, __p+4);
139}
140
141/*
142 * Try to store an unaligned value as efficiently as possible.
143 */
144#define __put_unaligned_le(val,ptr) \
145 ({ \
146 switch (sizeof(*(ptr))) { \
147 case 1: \
148 *(ptr) = (val); \
149 break; \
150 case 2: __put_unaligned_2_le((val),(__u8 *)(ptr)); \
151 break; \
152 case 4: __put_unaligned_4_le((val),(__u8 *)(ptr)); \
153 break; \
154 case 8: __put_unaligned_8_le((val),(__u8 *)(ptr)); \
155 break; \
156 default: __bug_unaligned_x(ptr); \
157 break; \
158 } \
159 (void) 0; \
160 })
161
162#define __put_unaligned_be(val,ptr) \
163 ({ \
164 switch (sizeof(*(ptr))) { \
165 case 1: \
166 *(ptr) = (val); \
167 break; \
168 case 2: __put_unaligned_2_be((val),(__u8 *)(ptr)); \
169 break; \
170 case 4: __put_unaligned_4_be((val),(__u8 *)(ptr)); \
171 break; \
172 case 8: __put_unaligned_8_be((val),(__u8 *)(ptr)); \
173 break; \
174 default: __bug_unaligned_x(ptr); \
175 break; \
176 } \
177 (void) 0; \
178 })
179
180/*
181 * Select endianness
182 */
183#ifndef __ARMEB__
184#define get_unaligned __get_unaligned_le
185#define put_unaligned __put_unaligned_le
186#else
187#define get_unaligned __get_unaligned_be
188#define put_unaligned __put_unaligned_be
189#endif
190
191#endif
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
new file mode 100644
index 000000000000..a19ec09eaa01
--- /dev/null
+++ b/include/asm-arm/unistd.h
@@ -0,0 +1,558 @@
1/*
2 * linux/include/asm-arm/unistd.h
3 *
4 * Copyright (C) 2001-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 * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
11 * no matter what the change is. Thanks!
12 */
13#ifndef __ASM_ARM_UNISTD_H
14#define __ASM_ARM_UNISTD_H
15
16#include <linux/linkage.h>
17
18#if defined(__thumb__)
19#define __NR_SYSCALL_BASE 0
20#else
21#define __NR_SYSCALL_BASE 0x900000
22#endif
23
24/*
25 * This file contains the system call numbers.
26 */
27
28#define __NR_restart_syscall (__NR_SYSCALL_BASE+ 0)
29#define __NR_exit (__NR_SYSCALL_BASE+ 1)
30#define __NR_fork (__NR_SYSCALL_BASE+ 2)
31#define __NR_read (__NR_SYSCALL_BASE+ 3)
32#define __NR_write (__NR_SYSCALL_BASE+ 4)
33#define __NR_open (__NR_SYSCALL_BASE+ 5)
34#define __NR_close (__NR_SYSCALL_BASE+ 6)
35 /* 7 was sys_waitpid */
36#define __NR_creat (__NR_SYSCALL_BASE+ 8)
37#define __NR_link (__NR_SYSCALL_BASE+ 9)
38#define __NR_unlink (__NR_SYSCALL_BASE+ 10)
39#define __NR_execve (__NR_SYSCALL_BASE+ 11)
40#define __NR_chdir (__NR_SYSCALL_BASE+ 12)
41#define __NR_time (__NR_SYSCALL_BASE+ 13)
42#define __NR_mknod (__NR_SYSCALL_BASE+ 14)
43#define __NR_chmod (__NR_SYSCALL_BASE+ 15)
44#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
45 /* 17 was sys_break */
46 /* 18 was sys_stat */
47#define __NR_lseek (__NR_SYSCALL_BASE+ 19)
48#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
49#define __NR_mount (__NR_SYSCALL_BASE+ 21)
50#define __NR_umount (__NR_SYSCALL_BASE+ 22)
51#define __NR_setuid (__NR_SYSCALL_BASE+ 23)
52#define __NR_getuid (__NR_SYSCALL_BASE+ 24)
53#define __NR_stime (__NR_SYSCALL_BASE+ 25)
54#define __NR_ptrace (__NR_SYSCALL_BASE+ 26)
55#define __NR_alarm (__NR_SYSCALL_BASE+ 27)
56 /* 28 was sys_fstat */
57#define __NR_pause (__NR_SYSCALL_BASE+ 29)
58#define __NR_utime (__NR_SYSCALL_BASE+ 30)
59 /* 31 was sys_stty */
60 /* 32 was sys_gtty */
61#define __NR_access (__NR_SYSCALL_BASE+ 33)
62#define __NR_nice (__NR_SYSCALL_BASE+ 34)
63 /* 35 was sys_ftime */
64#define __NR_sync (__NR_SYSCALL_BASE+ 36)
65#define __NR_kill (__NR_SYSCALL_BASE+ 37)
66#define __NR_rename (__NR_SYSCALL_BASE+ 38)
67#define __NR_mkdir (__NR_SYSCALL_BASE+ 39)
68#define __NR_rmdir (__NR_SYSCALL_BASE+ 40)
69#define __NR_dup (__NR_SYSCALL_BASE+ 41)
70#define __NR_pipe (__NR_SYSCALL_BASE+ 42)
71#define __NR_times (__NR_SYSCALL_BASE+ 43)
72 /* 44 was sys_prof */
73#define __NR_brk (__NR_SYSCALL_BASE+ 45)
74#define __NR_setgid (__NR_SYSCALL_BASE+ 46)
75#define __NR_getgid (__NR_SYSCALL_BASE+ 47)
76 /* 48 was sys_signal */
77#define __NR_geteuid (__NR_SYSCALL_BASE+ 49)
78#define __NR_getegid (__NR_SYSCALL_BASE+ 50)
79#define __NR_acct (__NR_SYSCALL_BASE+ 51)
80#define __NR_umount2 (__NR_SYSCALL_BASE+ 52)
81 /* 53 was sys_lock */
82#define __NR_ioctl (__NR_SYSCALL_BASE+ 54)
83#define __NR_fcntl (__NR_SYSCALL_BASE+ 55)
84 /* 56 was sys_mpx */
85#define __NR_setpgid (__NR_SYSCALL_BASE+ 57)
86 /* 58 was sys_ulimit */
87 /* 59 was sys_olduname */
88#define __NR_umask (__NR_SYSCALL_BASE+ 60)
89#define __NR_chroot (__NR_SYSCALL_BASE+ 61)
90#define __NR_ustat (__NR_SYSCALL_BASE+ 62)
91#define __NR_dup2 (__NR_SYSCALL_BASE+ 63)
92#define __NR_getppid (__NR_SYSCALL_BASE+ 64)
93#define __NR_getpgrp (__NR_SYSCALL_BASE+ 65)
94#define __NR_setsid (__NR_SYSCALL_BASE+ 66)
95#define __NR_sigaction (__NR_SYSCALL_BASE+ 67)
96 /* 68 was sys_sgetmask */
97 /* 69 was sys_ssetmask */
98#define __NR_setreuid (__NR_SYSCALL_BASE+ 70)
99#define __NR_setregid (__NR_SYSCALL_BASE+ 71)
100#define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72)
101#define __NR_sigpending (__NR_SYSCALL_BASE+ 73)
102#define __NR_sethostname (__NR_SYSCALL_BASE+ 74)
103#define __NR_setrlimit (__NR_SYSCALL_BASE+ 75)
104#define __NR_getrlimit (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
105#define __NR_getrusage (__NR_SYSCALL_BASE+ 77)
106#define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78)
107#define __NR_settimeofday (__NR_SYSCALL_BASE+ 79)
108#define __NR_getgroups (__NR_SYSCALL_BASE+ 80)
109#define __NR_setgroups (__NR_SYSCALL_BASE+ 81)
110#define __NR_select (__NR_SYSCALL_BASE+ 82)
111#define __NR_symlink (__NR_SYSCALL_BASE+ 83)
112 /* 84 was sys_lstat */
113#define __NR_readlink (__NR_SYSCALL_BASE+ 85)
114#define __NR_uselib (__NR_SYSCALL_BASE+ 86)
115#define __NR_swapon (__NR_SYSCALL_BASE+ 87)
116#define __NR_reboot (__NR_SYSCALL_BASE+ 88)
117#define __NR_readdir (__NR_SYSCALL_BASE+ 89)
118#define __NR_mmap (__NR_SYSCALL_BASE+ 90)
119#define __NR_munmap (__NR_SYSCALL_BASE+ 91)
120#define __NR_truncate (__NR_SYSCALL_BASE+ 92)
121#define __NR_ftruncate (__NR_SYSCALL_BASE+ 93)
122#define __NR_fchmod (__NR_SYSCALL_BASE+ 94)
123#define __NR_fchown (__NR_SYSCALL_BASE+ 95)
124#define __NR_getpriority (__NR_SYSCALL_BASE+ 96)
125#define __NR_setpriority (__NR_SYSCALL_BASE+ 97)
126 /* 98 was sys_profil */
127#define __NR_statfs (__NR_SYSCALL_BASE+ 99)
128#define __NR_fstatfs (__NR_SYSCALL_BASE+100)
129 /* 101 was sys_ioperm */
130#define __NR_socketcall (__NR_SYSCALL_BASE+102)
131#define __NR_syslog (__NR_SYSCALL_BASE+103)
132#define __NR_setitimer (__NR_SYSCALL_BASE+104)
133#define __NR_getitimer (__NR_SYSCALL_BASE+105)
134#define __NR_stat (__NR_SYSCALL_BASE+106)
135#define __NR_lstat (__NR_SYSCALL_BASE+107)
136#define __NR_fstat (__NR_SYSCALL_BASE+108)
137 /* 109 was sys_uname */
138 /* 110 was sys_iopl */
139#define __NR_vhangup (__NR_SYSCALL_BASE+111)
140 /* 112 was sys_idle */
141#define __NR_syscall (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
142#define __NR_wait4 (__NR_SYSCALL_BASE+114)
143#define __NR_swapoff (__NR_SYSCALL_BASE+115)
144#define __NR_sysinfo (__NR_SYSCALL_BASE+116)
145#define __NR_ipc (__NR_SYSCALL_BASE+117)
146#define __NR_fsync (__NR_SYSCALL_BASE+118)
147#define __NR_sigreturn (__NR_SYSCALL_BASE+119)
148#define __NR_clone (__NR_SYSCALL_BASE+120)
149#define __NR_setdomainname (__NR_SYSCALL_BASE+121)
150#define __NR_uname (__NR_SYSCALL_BASE+122)
151 /* 123 was sys_modify_ldt */
152#define __NR_adjtimex (__NR_SYSCALL_BASE+124)
153#define __NR_mprotect (__NR_SYSCALL_BASE+125)
154#define __NR_sigprocmask (__NR_SYSCALL_BASE+126)
155 /* 127 was sys_create_module */
156#define __NR_init_module (__NR_SYSCALL_BASE+128)
157#define __NR_delete_module (__NR_SYSCALL_BASE+129)
158 /* 130 was sys_get_kernel_syms */
159#define __NR_quotactl (__NR_SYSCALL_BASE+131)
160#define __NR_getpgid (__NR_SYSCALL_BASE+132)
161#define __NR_fchdir (__NR_SYSCALL_BASE+133)
162#define __NR_bdflush (__NR_SYSCALL_BASE+134)
163#define __NR_sysfs (__NR_SYSCALL_BASE+135)
164#define __NR_personality (__NR_SYSCALL_BASE+136)
165 /* 137 was sys_afs_syscall */
166#define __NR_setfsuid (__NR_SYSCALL_BASE+138)
167#define __NR_setfsgid (__NR_SYSCALL_BASE+139)
168#define __NR__llseek (__NR_SYSCALL_BASE+140)
169#define __NR_getdents (__NR_SYSCALL_BASE+141)
170#define __NR__newselect (__NR_SYSCALL_BASE+142)
171#define __NR_flock (__NR_SYSCALL_BASE+143)
172#define __NR_msync (__NR_SYSCALL_BASE+144)
173#define __NR_readv (__NR_SYSCALL_BASE+145)
174#define __NR_writev (__NR_SYSCALL_BASE+146)
175#define __NR_getsid (__NR_SYSCALL_BASE+147)
176#define __NR_fdatasync (__NR_SYSCALL_BASE+148)
177#define __NR__sysctl (__NR_SYSCALL_BASE+149)
178#define __NR_mlock (__NR_SYSCALL_BASE+150)
179#define __NR_munlock (__NR_SYSCALL_BASE+151)
180#define __NR_mlockall (__NR_SYSCALL_BASE+152)
181#define __NR_munlockall (__NR_SYSCALL_BASE+153)
182#define __NR_sched_setparam (__NR_SYSCALL_BASE+154)
183#define __NR_sched_getparam (__NR_SYSCALL_BASE+155)
184#define __NR_sched_setscheduler (__NR_SYSCALL_BASE+156)
185#define __NR_sched_getscheduler (__NR_SYSCALL_BASE+157)
186#define __NR_sched_yield (__NR_SYSCALL_BASE+158)
187#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE+159)
188#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE+160)
189#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE+161)
190#define __NR_nanosleep (__NR_SYSCALL_BASE+162)
191#define __NR_mremap (__NR_SYSCALL_BASE+163)
192#define __NR_setresuid (__NR_SYSCALL_BASE+164)
193#define __NR_getresuid (__NR_SYSCALL_BASE+165)
194 /* 166 was sys_vm86 */
195 /* 167 was sys_query_module */
196#define __NR_poll (__NR_SYSCALL_BASE+168)
197#define __NR_nfsservctl (__NR_SYSCALL_BASE+169)
198#define __NR_setresgid (__NR_SYSCALL_BASE+170)
199#define __NR_getresgid (__NR_SYSCALL_BASE+171)
200#define __NR_prctl (__NR_SYSCALL_BASE+172)
201#define __NR_rt_sigreturn (__NR_SYSCALL_BASE+173)
202#define __NR_rt_sigaction (__NR_SYSCALL_BASE+174)
203#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE+175)
204#define __NR_rt_sigpending (__NR_SYSCALL_BASE+176)
205#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)
206#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)
207#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
208#define __NR_pread64 (__NR_SYSCALL_BASE+180)
209#define __NR_pwrite64 (__NR_SYSCALL_BASE+181)
210#define __NR_chown (__NR_SYSCALL_BASE+182)
211#define __NR_getcwd (__NR_SYSCALL_BASE+183)
212#define __NR_capget (__NR_SYSCALL_BASE+184)
213#define __NR_capset (__NR_SYSCALL_BASE+185)
214#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)
215#define __NR_sendfile (__NR_SYSCALL_BASE+187)
216 /* 188 reserved */
217 /* 189 reserved */
218#define __NR_vfork (__NR_SYSCALL_BASE+190)
219#define __NR_ugetrlimit (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
220#define __NR_mmap2 (__NR_SYSCALL_BASE+192)
221#define __NR_truncate64 (__NR_SYSCALL_BASE+193)
222#define __NR_ftruncate64 (__NR_SYSCALL_BASE+194)
223#define __NR_stat64 (__NR_SYSCALL_BASE+195)
224#define __NR_lstat64 (__NR_SYSCALL_BASE+196)
225#define __NR_fstat64 (__NR_SYSCALL_BASE+197)
226#define __NR_lchown32 (__NR_SYSCALL_BASE+198)
227#define __NR_getuid32 (__NR_SYSCALL_BASE+199)
228#define __NR_getgid32 (__NR_SYSCALL_BASE+200)
229#define __NR_geteuid32 (__NR_SYSCALL_BASE+201)
230#define __NR_getegid32 (__NR_SYSCALL_BASE+202)
231#define __NR_setreuid32 (__NR_SYSCALL_BASE+203)
232#define __NR_setregid32 (__NR_SYSCALL_BASE+204)
233#define __NR_getgroups32 (__NR_SYSCALL_BASE+205)
234#define __NR_setgroups32 (__NR_SYSCALL_BASE+206)
235#define __NR_fchown32 (__NR_SYSCALL_BASE+207)
236#define __NR_setresuid32 (__NR_SYSCALL_BASE+208)
237#define __NR_getresuid32 (__NR_SYSCALL_BASE+209)
238#define __NR_setresgid32 (__NR_SYSCALL_BASE+210)
239#define __NR_getresgid32 (__NR_SYSCALL_BASE+211)
240#define __NR_chown32 (__NR_SYSCALL_BASE+212)
241#define __NR_setuid32 (__NR_SYSCALL_BASE+213)
242#define __NR_setgid32 (__NR_SYSCALL_BASE+214)
243#define __NR_setfsuid32 (__NR_SYSCALL_BASE+215)
244#define __NR_setfsgid32 (__NR_SYSCALL_BASE+216)
245#define __NR_getdents64 (__NR_SYSCALL_BASE+217)
246#define __NR_pivot_root (__NR_SYSCALL_BASE+218)
247#define __NR_mincore (__NR_SYSCALL_BASE+219)
248#define __NR_madvise (__NR_SYSCALL_BASE+220)
249#define __NR_fcntl64 (__NR_SYSCALL_BASE+221)
250 /* 222 for tux */
251 /* 223 is unused */
252#define __NR_gettid (__NR_SYSCALL_BASE+224)
253#define __NR_readahead (__NR_SYSCALL_BASE+225)
254#define __NR_setxattr (__NR_SYSCALL_BASE+226)
255#define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
256#define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
257#define __NR_getxattr (__NR_SYSCALL_BASE+229)
258#define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
259#define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
260#define __NR_listxattr (__NR_SYSCALL_BASE+232)
261#define __NR_llistxattr (__NR_SYSCALL_BASE+233)
262#define __NR_flistxattr (__NR_SYSCALL_BASE+234)
263#define __NR_removexattr (__NR_SYSCALL_BASE+235)
264#define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
265#define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
266#define __NR_tkill (__NR_SYSCALL_BASE+238)
267#define __NR_sendfile64 (__NR_SYSCALL_BASE+239)
268#define __NR_futex (__NR_SYSCALL_BASE+240)
269#define __NR_sched_setaffinity (__NR_SYSCALL_BASE+241)
270#define __NR_sched_getaffinity (__NR_SYSCALL_BASE+242)
271#define __NR_io_setup (__NR_SYSCALL_BASE+243)
272#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
273#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
274#define __NR_io_submit (__NR_SYSCALL_BASE+246)
275#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
276#define __NR_exit_group (__NR_SYSCALL_BASE+248)
277#define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249)
278#define __NR_epoll_create (__NR_SYSCALL_BASE+250)
279#define __NR_epoll_ctl (__NR_SYSCALL_BASE+251)
280#define __NR_epoll_wait (__NR_SYSCALL_BASE+252)
281#define __NR_remap_file_pages (__NR_SYSCALL_BASE+253)
282 /* 254 for set_thread_area */
283 /* 255 for get_thread_area */
284#define __NR_set_tid_address (__NR_SYSCALL_BASE+256)
285#define __NR_timer_create (__NR_SYSCALL_BASE+257)
286#define __NR_timer_settime (__NR_SYSCALL_BASE+258)
287#define __NR_timer_gettime (__NR_SYSCALL_BASE+259)
288#define __NR_timer_getoverrun (__NR_SYSCALL_BASE+260)
289#define __NR_timer_delete (__NR_SYSCALL_BASE+261)
290#define __NR_clock_settime (__NR_SYSCALL_BASE+262)
291#define __NR_clock_gettime (__NR_SYSCALL_BASE+263)
292#define __NR_clock_getres (__NR_SYSCALL_BASE+264)
293#define __NR_clock_nanosleep (__NR_SYSCALL_BASE+265)
294#define __NR_statfs64 (__NR_SYSCALL_BASE+266)
295#define __NR_fstatfs64 (__NR_SYSCALL_BASE+267)
296#define __NR_tgkill (__NR_SYSCALL_BASE+268)
297#define __NR_utimes (__NR_SYSCALL_BASE+269)
298#define __NR_fadvise64_64 (__NR_SYSCALL_BASE+270)
299#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271)
300#define __NR_pciconfig_read (__NR_SYSCALL_BASE+272)
301#define __NR_pciconfig_write (__NR_SYSCALL_BASE+273)
302#define __NR_mq_open (__NR_SYSCALL_BASE+274)
303#define __NR_mq_unlink (__NR_SYSCALL_BASE+275)
304#define __NR_mq_timedsend (__NR_SYSCALL_BASE+276)
305#define __NR_mq_timedreceive (__NR_SYSCALL_BASE+277)
306#define __NR_mq_notify (__NR_SYSCALL_BASE+278)
307#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
308#define __NR_waitid (__NR_SYSCALL_BASE+280)
309
310#if 0 /* reserve these for un-muxing socketcall */
311#define __NR_socket (__NR_SYSCALL_BASE+281)
312#define __NR_bind (__NR_SYSCALL_BASE+282)
313#define __NR_connect (__NR_SYSCALL_BASE+283)
314#define __NR_listen (__NR_SYSCALL_BASE+284)
315#define __NR_accept (__NR_SYSCALL_BASE+285)
316#define __NR_getsockname (__NR_SYSCALL_BASE+286)
317#define __NR_getpeername (__NR_SYSCALL_BASE+287)
318#define __NR_socketpair (__NR_SYSCALL_BASE+288)
319#define __NR_send (__NR_SYSCALL_BASE+289)
320#define __NR_sendto (__NR_SYSCALL_BASE+290)
321#define __NR_recv (__NR_SYSCALL_BASE+291)
322#define __NR_recvfrom (__NR_SYSCALL_BASE+292)
323#define __NR_shutdown (__NR_SYSCALL_BASE+293)
324#define __NR_setsockopt (__NR_SYSCALL_BASE+294)
325#define __NR_getsockopt (__NR_SYSCALL_BASE+295)
326#define __NR_sendmsg (__NR_SYSCALL_BASE+296)
327#define __NR_recvmsg (__NR_SYSCALL_BASE+297)
328#endif
329
330#if 0 /* reserve these for un-muxing ipc */
331#define __NR_semop (__NR_SYSCALL_BASE+298)
332#define __NR_semget (__NR_SYSCALL_BASE+299)
333#define __NR_semctl (__NR_SYSCALL_BASE+300)
334#define __NR_msgsnd (__NR_SYSCALL_BASE+301)
335#define __NR_msgrcv (__NR_SYSCALL_BASE+302)
336#define __NR_msgget (__NR_SYSCALL_BASE+303)
337#define __NR_msgctl (__NR_SYSCALL_BASE+304)
338#define __NR_shmat (__NR_SYSCALL_BASE+305)
339#define __NR_shmdt (__NR_SYSCALL_BASE+306)
340#define __NR_shmget (__NR_SYSCALL_BASE+307)
341#define __NR_shmctl (__NR_SYSCALL_BASE+308)
342#endif
343
344#define __NR_add_key (__NR_SYSCALL_BASE+309)
345#define __NR_request_key (__NR_SYSCALL_BASE+310)
346#define __NR_keyctl (__NR_SYSCALL_BASE+311)
347
348#if 0 /* reserved for un-muxing ipc */
349#define __NR_semtimedop (__NR_SYSCALL_BASE+312)
350#endif
351
352#define __NR_vserver (__NR_SYSCALL_BASE+313)
353
354/*
355 * The following SWIs are ARM private.
356 */
357#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
358#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
359#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
360#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
361#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
362
363#define __ARM_NR_set_tls (__ARM_NR_BASE+0x800)
364
365#define __sys2(x) #x
366#define __sys1(x) __sys2(x)
367
368#ifndef __syscall
369#if defined(__thumb__)
370#define __syscall(name) \
371 "push {r7}\n\t" \
372 "mov r7, #" __sys1(__NR_##name) "\n\t" \
373 "swi 0\n\t" \
374 "pop {r7}"
375#else
376#define __syscall(name) "swi\t" __sys1(__NR_##name) ""
377#endif
378#endif
379
380#define __syscall_return(type, res) \
381do { \
382 if ((unsigned long)(res) >= (unsigned long)(-129)) { \
383 errno = -(res); \
384 res = -1; \
385 } \
386 return (type) (res); \
387} while (0)
388
389#define _syscall0(type,name) \
390type name(void) { \
391 register long __res_r0 __asm__("r0"); \
392 long __res; \
393 __asm__ __volatile__ ( \
394 __syscall(name) \
395 : "=r" (__res_r0) \
396 : \
397 : "lr"); \
398 __res = __res_r0; \
399 __syscall_return(type,__res); \
400}
401
402#define _syscall1(type,name,type1,arg1) \
403type name(type1 arg1) { \
404 register long __r0 __asm__("r0") = (long)arg1; \
405 register long __res_r0 __asm__("r0"); \
406 long __res; \
407 __asm__ __volatile__ ( \
408 __syscall(name) \
409 : "=r" (__res_r0) \
410 : "r" (__r0) \
411 : "lr"); \
412 __res = __res_r0; \
413 __syscall_return(type,__res); \
414}
415
416#define _syscall2(type,name,type1,arg1,type2,arg2) \
417type name(type1 arg1,type2 arg2) { \
418 register long __r0 __asm__("r0") = (long)arg1; \
419 register long __r1 __asm__("r1") = (long)arg2; \
420 register long __res_r0 __asm__("r0"); \
421 long __res; \
422 __asm__ __volatile__ ( \
423 __syscall(name) \
424 : "=r" (__res_r0) \
425 : "r" (__r0),"r" (__r1) \
426 : "lr"); \
427 __res = __res_r0; \
428 __syscall_return(type,__res); \
429}
430
431
432#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
433type name(type1 arg1,type2 arg2,type3 arg3) { \
434 register long __r0 __asm__("r0") = (long)arg1; \
435 register long __r1 __asm__("r1") = (long)arg2; \
436 register long __r2 __asm__("r2") = (long)arg3; \
437 register long __res_r0 __asm__("r0"); \
438 long __res; \
439 __asm__ __volatile__ ( \
440 __syscall(name) \
441 : "=r" (__res_r0) \
442 : "r" (__r0),"r" (__r1),"r" (__r2) \
443 : "lr"); \
444 __res = __res_r0; \
445 __syscall_return(type,__res); \
446}
447
448
449#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\
450type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
451 register long __r0 __asm__("r0") = (long)arg1; \
452 register long __r1 __asm__("r1") = (long)arg2; \
453 register long __r2 __asm__("r2") = (long)arg3; \
454 register long __r3 __asm__("r3") = (long)arg4; \
455 register long __res_r0 __asm__("r0"); \
456 long __res; \
457 __asm__ __volatile__ ( \
458 __syscall(name) \
459 : "=r" (__res_r0) \
460 : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3) \
461 : "lr"); \
462 __res = __res_r0; \
463 __syscall_return(type,__res); \
464}
465
466
467#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
468type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \
469 register long __r0 __asm__("r0") = (long)arg1; \
470 register long __r1 __asm__("r1") = (long)arg2; \
471 register long __r2 __asm__("r2") = (long)arg3; \
472 register long __r3 __asm__("r3") = (long)arg4; \
473 register long __r4 __asm__("r4") = (long)arg5; \
474 register long __res_r0 __asm__("r0"); \
475 long __res; \
476 __asm__ __volatile__ ( \
477 __syscall(name) \
478 : "=r" (__res_r0) \
479 : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3),"r" (__r4) \
480 : "lr"); \
481 __res = __res_r0; \
482 __syscall_return(type,__res); \
483}
484
485#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
486type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) { \
487 register long __r0 __asm__("r0") = (long)arg1; \
488 register long __r1 __asm__("r1") = (long)arg2; \
489 register long __r2 __asm__("r2") = (long)arg3; \
490 register long __r3 __asm__("r3") = (long)arg4; \
491 register long __r4 __asm__("r4") = (long)arg5; \
492 register long __r5 __asm__("r5") = (long)arg6; \
493 register long __res_r0 __asm__("r0"); \
494 long __res; \
495 __asm__ __volatile__ ( \
496 __syscall(name) \
497 : "=r" (__res_r0) \
498 : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3), "r" (__r4),"r" (__r5) \
499 : "lr"); \
500 __res = __res_r0; \
501 __syscall_return(type,__res); \
502}
503
504#ifdef __KERNEL__
505#define __ARCH_WANT_IPC_PARSE_VERSION
506#define __ARCH_WANT_OLD_READDIR
507#define __ARCH_WANT_STAT64
508#define __ARCH_WANT_SYS_ALARM
509#define __ARCH_WANT_SYS_GETHOSTNAME
510#define __ARCH_WANT_SYS_PAUSE
511#define __ARCH_WANT_SYS_TIME
512#define __ARCH_WANT_SYS_UTIME
513#define __ARCH_WANT_SYS_SOCKETCALL
514#define __ARCH_WANT_SYS_FADVISE64
515#define __ARCH_WANT_SYS_GETPGRP
516#define __ARCH_WANT_SYS_LLSEEK
517#define __ARCH_WANT_SYS_NICE
518#define __ARCH_WANT_SYS_OLD_GETRLIMIT
519#define __ARCH_WANT_SYS_OLDUMOUNT
520#define __ARCH_WANT_SYS_SIGPENDING
521#define __ARCH_WANT_SYS_SIGPROCMASK
522#define __ARCH_WANT_SYS_RT_SIGACTION
523#endif
524
525#ifdef __KERNEL_SYSCALLS__
526
527#include <linux/compiler.h>
528#include <linux/types.h>
529#include <linux/syscalls.h>
530
531extern long execve(const char *file, char **argv, char **envp);
532
533struct pt_regs;
534asmlinkage int sys_execve(char *filenamei, char **argv, char **envp,
535 struct pt_regs *regs);
536asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
537 struct pt_regs *regs);
538asmlinkage int sys_fork(struct pt_regs *regs);
539asmlinkage int sys_vfork(struct pt_regs *regs);
540asmlinkage int sys_pipe(unsigned long *fildes);
541asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
542struct sigaction;
543asmlinkage long sys_rt_sigaction(int sig,
544 const struct sigaction __user *act,
545 struct sigaction __user *oact,
546 size_t sigsetsize);
547
548#endif
549
550/*
551 * "Conditional" syscalls
552 *
553 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
554 * but it doesn't work on all toolchains, so we just do it by hand
555 */
556#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
557
558#endif /* __ASM_ARM_UNISTD_H */
diff --git a/include/asm-arm/user.h b/include/asm-arm/user.h
new file mode 100644
index 000000000000..3e8b0f879159
--- /dev/null
+++ b/include/asm-arm/user.h
@@ -0,0 +1,84 @@
1#ifndef _ARM_USER_H
2#define _ARM_USER_H
3
4#include <asm/page.h>
5#include <asm/ptrace.h>
6/* Core file format: The core file is written in such a way that gdb
7 can understand it and provide useful information to the user (under
8 linux we use the 'trad-core' bfd). There are quite a number of
9 obstacles to being able to view the contents of the floating point
10 registers, and until these are solved you will not be able to view the
11 contents of them. Actually, you can read in the core file and look at
12 the contents of the user struct to find out what the floating point
13 registers contain.
14 The actual file contents are as follows:
15 UPAGE: 1 page consisting of a user struct that tells gdb what is present
16 in the file. Directly after this is a copy of the task_struct, which
17 is currently not used by gdb, but it may come in useful at some point.
18 All of the registers are stored as part of the upage. The upage should
19 always be only one page.
20 DATA: The data area is stored. We use current->end_text to
21 current->brk to pick up all of the user variables, plus any memory
22 that may have been malloced. No attempt is made to determine if a page
23 is demand-zero or if a page is totally unused, we just cover the entire
24 range. All of the addresses are rounded in such a way that an integral
25 number of pages is written.
26 STACK: We need the stack information in order to get a meaningful
27 backtrace. We need to write the data from (esp) to
28 current->start_stack, so we round each of these off in order to be able
29 to write an integer number of pages.
30 The minimum core file size is 3 pages, or 12288 bytes.
31*/
32
33struct user_fp {
34 struct fp_reg {
35 unsigned int sign1:1;
36 unsigned int unused:15;
37 unsigned int sign2:1;
38 unsigned int exponent:14;
39 unsigned int j:1;
40 unsigned int mantissa1:31;
41 unsigned int mantissa0:32;
42 } fpregs[8];
43 unsigned int fpsr:32;
44 unsigned int fpcr:32;
45 unsigned char ftype[8];
46 unsigned int init_flag;
47};
48
49/* When the kernel dumps core, it starts by dumping the user struct -
50 this will be used by gdb to figure out where the data and stack segments
51 are within the file, and what virtual addresses to use. */
52struct user{
53/* We start with the registers, to mimic the way that "memory" is returned
54 from the ptrace(3,...) function. */
55 struct pt_regs regs; /* Where the registers are actually stored */
56/* ptrace does not yet supply these. Someday.... */
57 int u_fpvalid; /* True if math co-processor being used. */
58 /* for this mess. Not yet used. */
59/* The rest of this junk is to help gdb figure out what goes where */
60 unsigned long int u_tsize; /* Text segment size (pages). */
61 unsigned long int u_dsize; /* Data segment size (pages). */
62 unsigned long int u_ssize; /* Stack segment size (pages). */
63 unsigned long start_code; /* Starting virtual address of text. */
64 unsigned long start_stack; /* Starting virtual address of stack area.
65 This is actually the bottom of the stack,
66 the top of the stack is always found in the
67 esp register. */
68 long int signal; /* Signal that caused the core dump. */
69 int reserved; /* No longer used */
70 struct pt_regs * u_ar0; /* Used by gdb to help find the values for */
71 /* the registers. */
72 unsigned long magic; /* To uniquely identify a core file */
73 char u_comm[32]; /* User command that was responsible */
74 int u_debugreg[8];
75 struct user_fp u_fp; /* FP state */
76 struct user_fp_struct * u_fp0;/* Used by gdb to help find the values for */
77 /* the FP registers. */
78};
79#define NBPG PAGE_SIZE
80#define UPAGES 1
81#define HOST_TEXT_START_ADDR (u.start_code)
82#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
83
84#endif /* _ARM_USER_H */
diff --git a/include/asm-arm/vfp.h b/include/asm-arm/vfp.h
new file mode 100644
index 000000000000..14c5e0946c47
--- /dev/null
+++ b/include/asm-arm/vfp.h
@@ -0,0 +1,78 @@
1/*
2 * linux/include/asm-arm/vfp.h
3 *
4 * VFP register definitions.
5 * First, the standard VFP set.
6 */
7
8#define FPSID cr0
9#define FPSCR cr1
10#define FPEXC cr8
11
12/* FPSID bits */
13#define FPSID_IMPLEMENTER_BIT (24)
14#define FPSID_IMPLEMENTER_MASK (0xff << FPSID_IMPLEMENTER_BIT)
15#define FPSID_SOFTWARE (1<<23)
16#define FPSID_FORMAT_BIT (21)
17#define FPSID_FORMAT_MASK (0x3 << FPSID_FORMAT_BIT)
18#define FPSID_NODOUBLE (1<<20)
19#define FPSID_ARCH_BIT (16)
20#define FPSID_ARCH_MASK (0xF << FPSID_ARCH_BIT)
21#define FPSID_PART_BIT (8)
22#define FPSID_PART_MASK (0xFF << FPSID_PART_BIT)
23#define FPSID_VARIANT_BIT (4)
24#define FPSID_VARIANT_MASK (0xF << FPSID_VARIANT_BIT)
25#define FPSID_REV_BIT (0)
26#define FPSID_REV_MASK (0xF << FPSID_REV_BIT)
27
28/* FPEXC bits */
29#define FPEXC_EXCEPTION (1<<31)
30#define FPEXC_ENABLE (1<<30)
31
32/* FPSCR bits */
33#define FPSCR_DEFAULT_NAN (1<<25)
34#define FPSCR_FLUSHTOZERO (1<<24)
35#define FPSCR_ROUND_NEAREST (0<<22)
36#define FPSCR_ROUND_PLUSINF (1<<22)
37#define FPSCR_ROUND_MINUSINF (2<<22)
38#define FPSCR_ROUND_TOZERO (3<<22)
39#define FPSCR_RMODE_BIT (22)
40#define FPSCR_RMODE_MASK (3 << FPSCR_RMODE_BIT)
41#define FPSCR_STRIDE_BIT (20)
42#define FPSCR_STRIDE_MASK (3 << FPSCR_STRIDE_BIT)
43#define FPSCR_LENGTH_BIT (16)
44#define FPSCR_LENGTH_MASK (7 << FPSCR_LENGTH_BIT)
45#define FPSCR_IOE (1<<8)
46#define FPSCR_DZE (1<<9)
47#define FPSCR_OFE (1<<10)
48#define FPSCR_UFE (1<<11)
49#define FPSCR_IXE (1<<12)
50#define FPSCR_IDE (1<<15)
51#define FPSCR_IOC (1<<0)
52#define FPSCR_DZC (1<<1)
53#define FPSCR_OFC (1<<2)
54#define FPSCR_UFC (1<<3)
55#define FPSCR_IXC (1<<4)
56#define FPSCR_IDC (1<<7)
57
58/*
59 * VFP9-S specific.
60 */
61#define FPINST cr9
62#define FPINST2 cr10
63
64/* FPEXC bits */
65#define FPEXC_FPV2 (1<<28)
66#define FPEXC_LENGTH_BIT (8)
67#define FPEXC_LENGTH_MASK (7 << FPEXC_LENGTH_BIT)
68#define FPEXC_INV (1 << 7)
69#define FPEXC_UFC (1 << 3)
70#define FPEXC_OFC (1 << 2)
71#define FPEXC_IOC (1 << 0)
72
73/* Bit patterns for decoding the packaged operation descriptors */
74#define VFPOPDESC_LENGTH_BIT (9)
75#define VFPOPDESC_LENGTH_MASK (0x07 << VFPOPDESC_LENGTH_BIT)
76#define VFPOPDESC_UNUSED_BIT (24)
77#define VFPOPDESC_UNUSED_MASK (0xFF << VFPOPDESC_UNUSED_BIT)
78#define VFPOPDESC_OPDESC_MASK (~(VFPOPDESC_LENGTH_MASK | VFPOPDESC_UNUSED_MASK))
diff --git a/include/asm-arm/vfpmacros.h b/include/asm-arm/vfpmacros.h
new file mode 100644
index 000000000000..15bd6e74c9cf
--- /dev/null
+++ b/include/asm-arm/vfpmacros.h
@@ -0,0 +1,25 @@
1/*
2 * linux/include/asm-arm/vfpmacros.h
3 *
4 * Assembler-only file containing VFP macros and register definitions.
5 */
6#include "vfp.h"
7
8@ Macros to allow building with old toolkits (with no VFP support)
9 .macro VFPFMRX, rd, sysreg, cond
10 MRC\cond p10, 7, \rd, \sysreg, cr0, 0 @ FMRX \rd, \sysreg
11 .endm
12
13 .macro VFPFMXR, sysreg, rd, cond
14 MCR\cond p10, 7, \rd, \sysreg, cr0, 0 @ FMXR \sysreg, \rd
15 .endm
16
17 @ read all the working registers back into the VFP
18 .macro VFPFLDMIA, base
19 LDC p11, cr0, [\base],#33*4 @ FLDMIAX \base!, {d0-d15}
20 .endm
21
22 @ write all the working registers out of the VFP
23 .macro VFPFSTMIA, base
24 STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15}
25 .endm
diff --git a/include/asm-arm/vga.h b/include/asm-arm/vga.h
new file mode 100644
index 000000000000..926e5ee128e9
--- /dev/null
+++ b/include/asm-arm/vga.h
@@ -0,0 +1,12 @@
1#ifndef ASMARM_VGA_H
2#define ASMARM_VGA_H
3
4#include <asm/hardware.h>
5#include <asm/io.h>
6
7#define VGA_MAP_MEM(x) (PCIMEM_BASE + (x))
8
9#define vga_readb(x) (*((volatile unsigned char *)x))
10#define vga_writeb(x,y) (*((volatile unsigned char *)y) = (x))
11
12#endif
diff --git a/include/asm-arm/xor.h b/include/asm-arm/xor.h
new file mode 100644
index 000000000000..e7c4cf58bed1
--- /dev/null
+++ b/include/asm-arm/xor.h
@@ -0,0 +1,141 @@
1/*
2 * linux/include/asm-arm/xor.h
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 <asm-generic/xor.h>
11
12#define __XOR(a1, a2) a1 ^= a2
13
14#define GET_BLOCK_2(dst) \
15 __asm__("ldmia %0, {%1, %2}" \
16 : "=r" (dst), "=r" (a1), "=r" (a2) \
17 : "0" (dst))
18
19#define GET_BLOCK_4(dst) \
20 __asm__("ldmia %0, {%1, %2, %3, %4}" \
21 : "=r" (dst), "=r" (a1), "=r" (a2), "=r" (a3), "=r" (a4) \
22 : "0" (dst))
23
24#define XOR_BLOCK_2(src) \
25 __asm__("ldmia %0!, {%1, %2}" \
26 : "=r" (src), "=r" (b1), "=r" (b2) \
27 : "0" (src)); \
28 __XOR(a1, b1); __XOR(a2, b2);
29
30#define XOR_BLOCK_4(src) \
31 __asm__("ldmia %0!, {%1, %2, %3, %4}" \
32 : "=r" (src), "=r" (b1), "=r" (b2), "=r" (b3), "=r" (b4) \
33 : "0" (src)); \
34 __XOR(a1, b1); __XOR(a2, b2); __XOR(a3, b3); __XOR(a4, b4)
35
36#define PUT_BLOCK_2(dst) \
37 __asm__ __volatile__("stmia %0!, {%2, %3}" \
38 : "=r" (dst) \
39 : "0" (dst), "r" (a1), "r" (a2))
40
41#define PUT_BLOCK_4(dst) \
42 __asm__ __volatile__("stmia %0!, {%2, %3, %4, %5}" \
43 : "=r" (dst) \
44 : "0" (dst), "r" (a1), "r" (a2), "r" (a3), "r" (a4))
45
46static void
47xor_arm4regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
48{
49 unsigned int lines = bytes / sizeof(unsigned long) / 4;
50 register unsigned int a1 __asm__("r4");
51 register unsigned int a2 __asm__("r5");
52 register unsigned int a3 __asm__("r6");
53 register unsigned int a4 __asm__("r7");
54 register unsigned int b1 __asm__("r8");
55 register unsigned int b2 __asm__("r9");
56 register unsigned int b3 __asm__("ip");
57 register unsigned int b4 __asm__("lr");
58
59 do {
60 GET_BLOCK_4(p1);
61 XOR_BLOCK_4(p2);
62 PUT_BLOCK_4(p1);
63 } while (--lines);
64}
65
66static void
67xor_arm4regs_3(unsigned long bytes, unsigned long *p1, unsigned long *p2,
68 unsigned long *p3)
69{
70 unsigned int lines = bytes / sizeof(unsigned long) / 4;
71 register unsigned int a1 __asm__("r4");
72 register unsigned int a2 __asm__("r5");
73 register unsigned int a3 __asm__("r6");
74 register unsigned int a4 __asm__("r7");
75 register unsigned int b1 __asm__("r8");
76 register unsigned int b2 __asm__("r9");
77 register unsigned int b3 __asm__("ip");
78 register unsigned int b4 __asm__("lr");
79
80 do {
81 GET_BLOCK_4(p1);
82 XOR_BLOCK_4(p2);
83 XOR_BLOCK_4(p3);
84 PUT_BLOCK_4(p1);
85 } while (--lines);
86}
87
88static void
89xor_arm4regs_4(unsigned long bytes, unsigned long *p1, unsigned long *p2,
90 unsigned long *p3, unsigned long *p4)
91{
92 unsigned int lines = bytes / sizeof(unsigned long) / 2;
93 register unsigned int a1 __asm__("r8");
94 register unsigned int a2 __asm__("r9");
95 register unsigned int b1 __asm__("ip");
96 register unsigned int b2 __asm__("lr");
97
98 do {
99 GET_BLOCK_2(p1);
100 XOR_BLOCK_2(p2);
101 XOR_BLOCK_2(p3);
102 XOR_BLOCK_2(p4);
103 PUT_BLOCK_2(p1);
104 } while (--lines);
105}
106
107static void
108xor_arm4regs_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
109 unsigned long *p3, unsigned long *p4, unsigned long *p5)
110{
111 unsigned int lines = bytes / sizeof(unsigned long) / 2;
112 register unsigned int a1 __asm__("r8");
113 register unsigned int a2 __asm__("r9");
114 register unsigned int b1 __asm__("ip");
115 register unsigned int b2 __asm__("lr");
116
117 do {
118 GET_BLOCK_2(p1);
119 XOR_BLOCK_2(p2);
120 XOR_BLOCK_2(p3);
121 XOR_BLOCK_2(p4);
122 XOR_BLOCK_2(p5);
123 PUT_BLOCK_2(p1);
124 } while (--lines);
125}
126
127static struct xor_block_template xor_block_arm4regs = {
128 .name = "arm4regs",
129 .do_2 = xor_arm4regs_2,
130 .do_3 = xor_arm4regs_3,
131 .do_4 = xor_arm4regs_4,
132 .do_5 = xor_arm4regs_5,
133};
134
135#undef XOR_TRY_TEMPLATES
136#define XOR_TRY_TEMPLATES \
137 do { \
138 xor_speed(&xor_block_arm4regs); \
139 xor_speed(&xor_block_8regs); \
140 xor_speed(&xor_block_32regs); \
141 } while (0)