aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS2
-rw-r--r--arch/cris/Kconfig538
-rw-r--r--arch/cris/Makefile139
-rw-r--r--arch/cris/arch-v10/Kconfig67
-rw-r--r--arch/cris/arch-v10/boot/Makefile24
-rw-r--r--arch/cris/arch-v10/boot/compressed/Makefile48
-rw-r--r--arch/cris/arch-v10/boot/compressed/misc.c6
-rw-r--r--arch/cris/arch-v10/boot/rescue/Makefile56
-rw-r--r--arch/cris/arch-v10/boot/rescue/head.S129
-rw-r--r--arch/cris/arch-v10/boot/rescue/kimagerescue.S58
-rw-r--r--arch/cris/arch-v10/boot/rescue/testrescue.S12
-rw-r--r--arch/cris/arch-v10/drivers/Kconfig181
-rw-r--r--arch/cris/arch-v10/drivers/Makefile12
-rw-r--r--arch/cris/arch-v10/drivers/axisflashmap.c181
-rw-r--r--arch/cris/arch-v10/drivers/ds1302.c4
-rw-r--r--arch/cris/arch-v10/drivers/eeprom.c75
-rw-r--r--arch/cris/arch-v10/drivers/gpio.c634
-rw-r--r--arch/cris/arch-v10/drivers/i2c.c81
-rw-r--r--arch/cris/arch-v10/drivers/pcf8563.c393
-rw-r--r--arch/cris/arch-v10/drivers/sync_serial.c1441
-rw-r--r--arch/cris/arch-v10/kernel/debugport.c134
-rw-r--r--arch/cris/arch-v10/kernel/dma.c3
-rw-r--r--arch/cris/arch-v10/kernel/entry.S249
-rw-r--r--arch/cris/arch-v10/kernel/fasttimer.c35
-rw-r--r--arch/cris/arch-v10/kernel/head.S221
-rw-r--r--arch/cris/arch-v10/kernel/io_interface_mux.c515
-rw-r--r--arch/cris/arch-v10/kernel/irq.c7
-rw-r--r--arch/cris/arch-v10/kernel/kgdb.c58
-rw-r--r--arch/cris/arch-v10/kernel/process.c3
-rw-r--r--arch/cris/arch-v10/kernel/ptrace.c1
-rw-r--r--arch/cris/arch-v10/kernel/shadows.c3
-rw-r--r--arch/cris/arch-v10/kernel/traps.c198
-rw-r--r--arch/cris/arch-v10/lib/checksum.S8
-rw-r--r--arch/cris/arch-v10/lib/checksumcopy.S8
-rw-r--r--arch/cris/arch-v10/lib/dram_init.S58
-rw-r--r--arch/cris/arch-v10/lib/old_checksum.c3
-rw-r--r--arch/cris/arch-v10/mm/fault.c13
-rw-r--r--arch/cris/arch-v10/mm/tlb.c58
-rw-r--r--arch/cris/arch-v32/Kconfig127
-rw-r--r--arch/cris/arch-v32/boot/Makefile23
-rw-r--r--arch/cris/arch-v32/boot/compressed/Makefile45
-rw-r--r--arch/cris/arch-v32/boot/compressed/README1
-rw-r--r--arch/cris/arch-v32/boot/compressed/head.S137
-rw-r--r--arch/cris/arch-v32/boot/compressed/misc.c72
-rw-r--r--arch/cris/arch-v32/boot/rescue/Makefile41
-rw-r--r--arch/cris/arch-v32/boot/rescue/head.S42
-rw-r--r--arch/cris/arch-v32/boot/rescue/rescue.ld37
-rw-r--r--arch/cris/arch-v32/drivers/Kconfig711
-rw-r--r--arch/cris/arch-v32/drivers/Makefile5
-rw-r--r--arch/cris/arch-v32/drivers/axisflashmap.c488
-rw-r--r--arch/cris/arch-v32/drivers/cryptocop.c104
-rw-r--r--arch/cris/arch-v32/drivers/i2c.c206
-rw-r--r--arch/cris/arch-v32/drivers/i2c.h2
-rw-r--r--arch/cris/arch-v32/drivers/iop_fw_load.c16
-rw-r--r--arch/cris/arch-v32/drivers/mach-a3/Makefile6
-rw-r--r--arch/cris/arch-v32/drivers/mach-a3/gpio.c984
-rw-r--r--arch/cris/arch-v32/drivers/mach-a3/nandflash.c180
-rw-r--r--arch/cris/arch-v32/drivers/mach-fs/Makefile6
-rw-r--r--arch/cris/arch-v32/drivers/mach-fs/gpio.c (renamed from arch/cris/arch-v32/drivers/gpio.c)612
-rw-r--r--arch/cris/arch-v32/drivers/mach-fs/nandflash.c (renamed from arch/cris/arch-v32/drivers/nandflash.c)122
-rw-r--r--arch/cris/arch-v32/drivers/pcf8563.c296
-rw-r--r--arch/cris/arch-v32/drivers/sync_serial.c938
-rw-r--r--arch/cris/arch-v32/kernel/Makefile5
-rw-r--r--arch/cris/arch-v32/kernel/arbiter.c296
-rw-r--r--arch/cris/arch-v32/kernel/crisksyms.c7
-rw-r--r--arch/cris/arch-v32/kernel/debugport.c342
-rw-r--r--arch/cris/arch-v32/kernel/entry.S83
-rw-r--r--arch/cris/arch-v32/kernel/fasttimer.c535
-rw-r--r--arch/cris/arch-v32/kernel/head.S204
-rw-r--r--arch/cris/arch-v32/kernel/io.c153
-rw-r--r--arch/cris/arch-v32/kernel/irq.c274
-rw-r--r--arch/cris/arch-v32/kernel/kgdb.c12
-rw-r--r--arch/cris/arch-v32/kernel/process.c14
-rw-r--r--arch/cris/arch-v32/kernel/ptrace.c10
-rw-r--r--arch/cris/arch-v32/kernel/signal.c144
-rw-r--r--arch/cris/arch-v32/kernel/smp.c31
-rw-r--r--arch/cris/arch-v32/kernel/time.c237
-rw-r--r--arch/cris/arch-v32/kernel/traps.c192
-rw-r--r--arch/cris/arch-v32/kernel/vcs_hook.c96
-rw-r--r--arch/cris/arch-v32/lib/Makefile3
-rw-r--r--arch/cris/arch-v32/lib/checksum.S72
-rw-r--r--arch/cris/arch-v32/lib/checksumcopy.S69
-rw-r--r--arch/cris/arch-v32/lib/delay.c28
-rw-r--r--arch/cris/arch-v32/lib/spinlock.S10
-rw-r--r--arch/cris/arch-v32/mach-a3/Kconfig110
-rw-r--r--arch/cris/arch-v32/mach-a3/Makefile11
-rw-r--r--arch/cris/arch-v32/mach-a3/arbiter.c634
-rw-r--r--arch/cris/arch-v32/mach-a3/cpufreq.c153
-rw-r--r--arch/cris/arch-v32/mach-a3/dma.c185
-rw-r--r--arch/cris/arch-v32/mach-a3/dram_init.S104
-rw-r--r--arch/cris/arch-v32/mach-a3/hw_settings.S51
-rw-r--r--arch/cris/arch-v32/mach-a3/io.c149
-rw-r--r--arch/cris/arch-v32/mach-a3/pinmux.c386
-rw-r--r--arch/cris/arch-v32/mach-a3/vcs_hook.c103
-rw-r--r--arch/cris/arch-v32/mach-a3/vcs_hook.h58
-rw-r--r--arch/cris/arch-v32/mach-fs/Kconfig216
-rw-r--r--arch/cris/arch-v32/mach-fs/Makefile11
-rw-r--r--arch/cris/arch-v32/mach-fs/arbiter.c404
-rw-r--r--arch/cris/arch-v32/mach-fs/cpufreq.c146
-rw-r--r--arch/cris/arch-v32/mach-fs/dma.c (renamed from arch/cris/arch-v32/kernel/dma.c)46
-rw-r--r--arch/cris/arch-v32/mach-fs/dram_init.S (renamed from arch/cris/arch-v32/lib/dram_init.S)23
-rw-r--r--arch/cris/arch-v32/mach-fs/hw_settings.S (renamed from arch/cris/arch-v32/lib/hw_settings.S)12
-rw-r--r--arch/cris/arch-v32/mach-fs/io.c191
-rw-r--r--arch/cris/arch-v32/mach-fs/pinmux.c309
-rw-r--r--arch/cris/arch-v32/mach-fs/vcs_hook.c100
-rw-r--r--arch/cris/arch-v32/mach-fs/vcs_hook.h (renamed from arch/cris/arch-v32/kernel/vcs_hook.h)8
-rw-r--r--arch/cris/arch-v32/mm/Makefile3
-rw-r--r--arch/cris/arch-v32/mm/init.c8
-rw-r--r--arch/cris/arch-v32/mm/intmem.c48
-rw-r--r--arch/cris/arch-v32/mm/l2cache.c29
-rw-r--r--arch/cris/arch-v32/mm/mmu.S93
-rw-r--r--arch/cris/arch-v32/mm/tlb.c56
-rw-r--r--arch/cris/arch-v32/vmlinux.lds.S74
-rw-r--r--arch/cris/artpec_3_defconfig582
-rw-r--r--arch/cris/defconfig795
-rw-r--r--arch/cris/etraxfs_defconfig585
-rw-r--r--arch/cris/kernel/module.c14
-rw-r--r--arch/cris/kernel/process.c103
-rw-r--r--arch/cris/kernel/ptrace.c58
-rw-r--r--arch/cris/kernel/semaphore.c1
-rw-r--r--arch/cris/kernel/setup.c27
-rw-r--r--arch/cris/kernel/time.c13
-rw-r--r--arch/cris/kernel/traps.c226
-rw-r--r--arch/cris/mm/fault.c169
-rw-r--r--arch/cris/mm/init.c111
-rw-r--r--drivers/net/cris/eth_v10.c225
-rw-r--r--include/asm-cris/Kbuild8
-rw-r--r--include/asm-cris/arch-v10/Kbuild3
-rw-r--r--include/asm-cris/arch-v10/bug.h66
-rw-r--r--include/asm-cris/arch-v10/io.h100
-rw-r--r--include/asm-cris/arch-v10/page.h4
-rw-r--r--include/asm-cris/arch-v32/Kbuild1
-rw-r--r--include/asm-cris/arch-v32/atomic.h10
-rw-r--r--include/asm-cris/arch-v32/bug.h33
-rw-r--r--include/asm-cris/arch-v32/cache.h11
-rw-r--r--include/asm-cris/arch-v32/delay.h10
-rw-r--r--include/asm-cris/arch-v32/hwregs/Makefile1
-rw-r--r--include/asm-cris/arch-v32/hwregs/dma.h13
-rw-r--r--include/asm-cris/arch-v32/hwregs/eth_defs.h202
-rw-r--r--include/asm-cris/arch-v32/hwregs/reg_rdwr.h10
-rw-r--r--include/asm-cris/arch-v32/io.h95
-rw-r--r--include/asm-cris/arch-v32/irq.h15
-rw-r--r--include/asm-cris/arch-v32/juliette.h326
-rw-r--r--include/asm-cris/arch-v32/mach-a3/arbiter.h34
-rw-r--r--include/asm-cris/arch-v32/mach-a3/dma.h31
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/asm/clkgen_defs_asm.h164
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/asm/ddr2_defs_asm.h266
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/asm/gio_defs_asm.h849
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/asm/pinmux_defs_asm.h572
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/asm/pio_defs_asm.h337
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/asm/reg_map_asm.h99
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/asm/timer_defs_asm.h228
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/clkgen_defs.h159
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/ddr2_defs.h281
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/gio_defs.h837
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/intr_vect.h46
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/intr_vect_defs.h341
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_reg_space_asm.h31
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sap_in_defs_asm.h109
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sap_out_defs_asm.h276
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_cfg_defs_asm.h739
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_cpu_defs_asm.h950
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_mpu_defs_asm.h1086
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_spu_defs_asm.h523
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_version_defs_asm.h61
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_reg_space.h31
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sap_in_defs.h141
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sap_out_defs.h231
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_cfg_defs.h725
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_cpu_defs.h522
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_mpu_defs.h648
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_spu_defs.h441
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_version_defs.h96
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/l2cache_defs.h142
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/marb_bar_defs.h482
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/marb_foo_defs.h626
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/pinmux_defs.h312
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/pio_defs.h371
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/reg_map.h103
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/strmux_defs.h120
-rw-r--r--include/asm-cris/arch-v32/mach-a3/hwregs/timer_defs.h265
-rw-r--r--include/asm-cris/arch-v32/mach-a3/memmap.h10
-rw-r--r--include/asm-cris/arch-v32/mach-a3/pinmux.h45
-rw-r--r--include/asm-cris/arch-v32/mach-a3/startup.inc60
-rw-r--r--include/asm-cris/arch-v32/mach-fs/arbiter.h28
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/asm/bif_core_defs_asm.h319
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/asm/config_defs_asm.h131
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/asm/gio_defs_asm.h276
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/asm/pinmux_defs_asm.h632
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/asm/reg_map_asm.h96
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/asm/timer_defs_asm.h229
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/bif_core_defs.h284
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/bif_dma_defs.h473
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/bif_slave_defs.h249
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/config_defs.h142
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/gio_defs.h295
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/intr_vect.h41
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/intr_vect_defs.h (renamed from include/asm-cris/arch-v32/hwregs/intr_vect_defs.h)13
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/marb_bp_defs.h205
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/marb_defs.h475
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/pinmux_defs.h357
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/reg_map.h (renamed from include/asm-cris/arch-v32/hwregs/reg_map.h)11
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/strmux_defs.h127
-rw-r--r--include/asm-cris/arch-v32/mach-fs/hwregs/timer_defs.h (renamed from include/asm-cris/arch-v32/hwregs/timer_defs.h)6
-rw-r--r--include/asm-cris/arch-v32/mach-fs/pinmux.h38
-rw-r--r--include/asm-cris/arch-v32/mach-fs/startup.inc77
-rw-r--r--include/asm-cris/arch-v32/offset.h2
-rw-r--r--include/asm-cris/arch-v32/page.h4
-rw-r--r--include/asm-cris/arch-v32/pinmux.h1
-rw-r--r--include/asm-cris/arch-v32/processor.h2
-rw-r--r--include/asm-cris/arch-v32/spinlock.h172
-rw-r--r--include/asm-cris/arch-v32/system.h9
-rw-r--r--include/asm-cris/arch-v32/timex.h8
-rw-r--r--include/asm-cris/arch-v32/unistd.h21
-rw-r--r--include/asm-cris/atomic.h4
-rw-r--r--include/asm-cris/axisflashmap.h39
-rw-r--r--include/asm-cris/bug.h2
-rw-r--r--include/asm-cris/delay.h3
-rw-r--r--include/asm-cris/dma-mapping.h11
-rw-r--r--include/asm-cris/etraxgpio.h112
-rw-r--r--include/asm-cris/io.h4
-rw-r--r--include/asm-cris/pgtable.h2
-rw-r--r--include/asm-cris/rtc.h41
-rw-r--r--include/asm-cris/smp.h4
-rw-r--r--include/asm-cris/sync_serial.h1
-rw-r--r--include/asm-cris/unistd.h4
226 files changed, 31838 insertions, 7714 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index a24631f4eab1..0d6f5119a6da 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1173,6 +1173,8 @@ S: Orphan
1173CRIS PORT 1173CRIS PORT
1174P: Mikael Starvik 1174P: Mikael Starvik
1175M: starvik@axis.com 1175M: starvik@axis.com
1176P: Jesper Nilsson
1177M: jesper.nilsson@axis.com
1176L: dev-etrax@axis.com 1178L: dev-etrax@axis.com
1177W: http://developer.axis.com 1179W: http://developer.axis.com
1178S: Maintained 1180S: Maintained
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index ff078e60e76d..8456bc8efb7c 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -13,10 +13,6 @@ config ZONE_DMA
13 bool 13 bool
14 default y 14 default y
15 15
16config NO_DMA
17 bool
18 default y
19
20config RWSEM_GENERIC_SPINLOCK 16config RWSEM_GENERIC_SPINLOCK
21 bool 17 bool
22 default y 18 default y
@@ -24,6 +20,10 @@ config RWSEM_GENERIC_SPINLOCK
24config RWSEM_XCHGADD_ALGORITHM 20config RWSEM_XCHGADD_ALGORITHM
25 bool 21 bool
26 22
23config GENERIC_IOMAP
24 bool
25 default y
26
27config ARCH_HAS_ILOG2_U32 27config ARCH_HAS_ILOG2_U32
28 bool 28 bool
29 default n 29 default n
@@ -44,13 +44,13 @@ config GENERIC_CALIBRATE_DELAY
44 bool 44 bool
45 default y 45 default y
46 46
47config IRQ_PER_CPU
48 bool
49 default y
50
51config NO_IOPORT 47config NO_IOPORT
52 def_bool y 48 def_bool y
53 49
50config FORCE_MAX_ZONEORDER
51 int
52 default 6
53
54config CRIS 54config CRIS
55 bool 55 bool
56 default y 56 default y
@@ -97,17 +97,15 @@ config ETRAX_FAST_TIMER
97 timers). 97 timers).
98 This is needed if CONFIG_ETRAX_SERIAL_FAST_TIMER is enabled. 98 This is needed if CONFIG_ETRAX_SERIAL_FAST_TIMER is enabled.
99 99
100config PREEMPT 100config ETRAX_KMALLOCED_MODULES
101 bool "Preemptible Kernel" 101 bool "Enable module allocation with kmalloc"
102 help 102 help
103 This option reduces the latency of the kernel when reacting to 103 Enable module allocation with kmalloc instead of vmalloc.
104 real-time or interactive events by allowing a low priority process to 104
105 be preempted even if it is in kernel mode executing a system call. 105config OOM_REBOOT
106 This allows applications to run more reliably even when the system is 106 bool "Enable reboot at out of memory"
107 under load.
108 107
109 Say Y here if you are building a kernel for a desktop, embedded 108source "kernel/Kconfig.preempt"
110 or real-time system. Say N if you are unsure.
111 109
112source mm/Kconfig 110source mm/Kconfig
113 111
@@ -134,24 +132,124 @@ config SVINTO_SIM
134 help 132 help
135 Support the xsim ETRAX Simulator. 133 Support the xsim ETRAX Simulator.
136 134
135config ETRAXFS
136 bool "ETRAX-FS-V32"
137 help
138 Support CRIS V32.
139
140config CRIS_MACH_ARTPEC3
141 bool "ARTPEC-3"
142 help
143 Support Axis ARTPEC-3.
144
137endchoice 145endchoice
138 146
147config ETRAX_VCS_SIM
148 bool "VCS Simulator"
149 help
150 Setup hardware to be run in the VCS simulator.
151
139config ETRAX_ARCH_V10 152config ETRAX_ARCH_V10
140 bool 153 bool
141 default y if ETRAX100LX || ETRAX100LX_V2 154 default y if ETRAX100LX || ETRAX100LX_V2
142 default n if !(ETRAX100LX || ETRAX100LX_V2) 155 default n if !(ETRAX100LX || ETRAX100LX_V2)
143 156
157config ETRAX_ARCH_V32
158 bool
159 default y if (ETRAXFS || CRIS_MACH_ARTPEC3)
160 default n if !(ETRAXFS || CRIS_MACH_ARTPEC3)
161
144config ETRAX_DRAM_SIZE 162config ETRAX_DRAM_SIZE
145 int "DRAM size (dec, in MB)" 163 int "DRAM size (dec, in MB)"
146 default "8" 164 default "8"
147 help 165 help
148 Size of DRAM (decimal in MB) typically 2, 8 or 16. 166 Size of DRAM (decimal in MB) typically 2, 8 or 16.
149 167
168config ETRAX_VMEM_SIZE
169 int "Video memory size (dec, in MB)"
170 depends on ETRAX_ARCH_V32 && !ETRAXFS
171 default 8 if !ETRAXFS
172 help
173 Size of Video accessible memory (decimal, in MB).
174
150config ETRAX_FLASH_BUSWIDTH 175config ETRAX_FLASH_BUSWIDTH
151 int "Buswidth of flash in bytes" 176 int "Buswidth of NOR flash in bytes"
152 default "2" 177 default "2"
153 help 178 help
154 Width in bytes of the Flash bus (1, 2 or 4). Is usually 2. 179 Width in bytes of the NOR Flash bus (1, 2 or 4). Is usually 2.
180
181config ETRAX_NANDFLASH_BUSWIDTH
182 int "Buswidth of NAND flash in bytes"
183 default "1"
184 help
185 Width in bytes of the NAND flash (1 or 2).
186
187config ETRAX_FLASH1_SIZE
188 int "FLASH1 size (dec, in MB. 0 = Unknown)"
189 default "0"
190
191choice
192 prompt "Product debug-port"
193 default ETRAX_DEBUG_PORT0
194
195config ETRAX_DEBUG_PORT0
196 bool "Serial-0"
197 help
198 Choose a serial port for the ETRAX debug console. Default to
199 port 0.
200
201config ETRAX_DEBUG_PORT1
202 bool "Serial-1"
203 help
204 Use serial port 1 for the console.
205
206config ETRAX_DEBUG_PORT2
207 bool "Serial-2"
208 help
209 Use serial port 2 for the console.
210
211config ETRAX_DEBUG_PORT3
212 bool "Serial-3"
213 help
214 Use serial port 3 for the console.
215
216config ETRAX_DEBUG_PORT_NULL
217 bool "disabled"
218 help
219 Disable serial-port debugging.
220
221endchoice
222
223choice
224 prompt "Kernel GDB port"
225 depends on ETRAX_KGDB
226 default ETRAX_KGDB_PORT0
227 help
228 Choose a serial port for kernel debugging. NOTE: This port should
229 not be enabled under Drivers for built-in interfaces (as it has its
230 own initialization code) and should not be the same as the debug port.
231
232config ETRAX_KGDB_PORT0
233 bool "Serial-0"
234 help
235 Use serial port 0 for kernel debugging.
236
237config ETRAX_KGDB_PORT1
238 bool "Serial-1"
239 help
240 Use serial port 1 for kernel debugging.
241
242config ETRAX_KGDB_PORT2
243 bool "Serial-2"
244 help
245 Use serial port 2 for kernel debugging.
246
247config ETRAX_KGDB_PORT3
248 bool "Serial-3"
249 help
250 Use serial port 3 for kernel debugging.
251
252endchoice
155 253
156source arch/cris/arch-v10/Kconfig 254source arch/cris/arch-v10/Kconfig
157source arch/cris/arch-v32/Kconfig 255source arch/cris/arch-v32/Kconfig
@@ -165,6 +263,387 @@ menu "Drivers for built-in interfaces"
165source arch/cris/arch-v10/drivers/Kconfig 263source arch/cris/arch-v10/drivers/Kconfig
166source arch/cris/arch-v32/drivers/Kconfig 264source arch/cris/arch-v32/drivers/Kconfig
167 265
266config ETRAX_AXISFLASHMAP
267 bool "Axis flash-map support"
268 select MTD
269 select MTD_CFI
270 select MTD_CFI_AMDSTD
271 select MTD_JEDECPROBE if ETRAX_ARCH_V32
272 select MTD_CHAR
273 select MTD_BLOCK
274 select MTD_PARTITIONS
275 select MTD_CONCAT
276 select MTD_COMPLEX_MAPPINGS
277 help
278 This option enables MTD mapping of flash devices. Needed to use
279 flash memories. If unsure, say Y.
280
281config ETRAX_RTC
282 bool "Real Time Clock support"
283 depends on ETRAX_I2C
284 help
285 Enables drivers for the Real-Time Clock battery-backed chips on
286 some products. The kernel reads the time when booting, and
287 the date can be set using ioctl(fd, RTC_SET_TIME, &rt) with rt a
288 rtc_time struct (see <file:include/asm-cris/rtc.h>) on the /dev/rtc
289 device. You can check the time with cat /proc/rtc, but
290 normal time reading should be done using libc function time and
291 friends.
292
293choice
294 prompt "RTC chip"
295 depends on ETRAX_RTC
296 default ETRAX_PCF8563 if ETRAX_ARCH_V32
297 default ETRAX_DS1302 if ETRAX_ARCH_V10
298
299config ETRAX_DS1302
300 depends on ETRAX_ARCH_V10
301 bool "DS1302"
302 help
303 Enables the driver for the DS1302 Real-Time Clock battery-backed
304 chip on some products.
305
306config ETRAX_PCF8563
307 bool "PCF8563"
308 help
309 Enables the driver for the PCF8563 Real-Time Clock battery-backed
310 chip on some products.
311
312endchoice
313
314config ETRAX_SYNCHRONOUS_SERIAL
315 bool "Synchronous serial-port support"
316 help
317 Select this to enable the synchronous serial port driver.
318
319config ETRAX_SYNCHRONOUS_SERIAL_PORT0
320 bool "Synchronous serial port 0 enabled"
321 depends on ETRAX_SYNCHRONOUS_SERIAL
322 help
323 Enabled synchronous serial port 0.
324
325config ETRAX_SYNCHRONOUS_SERIAL0_DMA
326 bool "Enable DMA on synchronous serial port 0."
327 depends on ETRAX_SYNCHRONOUS_SERIAL_PORT0
328 help
329 A synchronous serial port can run in manual or DMA mode.
330 Selecting this option will make it run in DMA mode.
331
332config ETRAX_SYNCHRONOUS_SERIAL_PORT1
333 bool "Synchronous serial port 1 enabled"
334 depends on ETRAX_SYNCHRONOUS_SERIAL && (ETRAXFS || ETRAX_ARCH_V10)
335 help
336 Enabled synchronous serial port 1.
337
338config ETRAX_SYNCHRONOUS_SERIAL1_DMA
339 bool "Enable DMA on synchronous serial port 1."
340 depends on ETRAX_SYNCHRONOUS_SERIAL_PORT1
341 help
342 A synchronous serial port can run in manual or DMA mode.
343 Selecting this option will make it run in DMA mode.
344
345choice
346 prompt "Network LED behavior"
347 depends on ETRAX_ETHERNET
348 default ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY
349
350config ETRAX_NETWORK_LED_ON_WHEN_LINK
351 bool "LED_on_when_link"
352 help
353 Selecting LED_on_when_link will light the LED when there is a
354 connection and will flash off when there is activity.
355
356 Selecting LED_on_when_activity will light the LED only when
357 there is activity.
358
359 This setting will also affect the behaviour of other activity LEDs
360 e.g. Bluetooth.
361
362config ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY
363 bool "LED_on_when_activity"
364 help
365 Selecting LED_on_when_link will light the LED when there is a
366 connection and will flash off when there is activity.
367
368 Selecting LED_on_when_activity will light the LED only when
369 there is activity.
370
371 This setting will also affect the behaviour of other activity LEDs
372 e.g. Bluetooth.
373
374endchoice
375
376choice
377 prompt "Ser0 DMA out channel"
378 depends on ETRAX_SERIAL_PORT0
379 default ETRAX_SERIAL_PORT0_DMA6_OUT if ETRAX_ARCH_V32
380 default ETRAX_SERIAL_PORT0_NO_DMA_OUT if ETRAX_ARCH_V10
381
382config ETRAX_SERIAL_PORT0_NO_DMA_OUT
383 bool "Ser0 uses no DMA for output"
384 help
385 Do not use DMA for ser0 output.
386
387config ETRAX_SERIAL_PORT0_DMA6_OUT
388 bool "Ser0 uses DMA6 for output"
389 depends on ETRAXFS
390 help
391 Enables the DMA6 output channel for ser0 (ttyS0).
392 If you do not enable DMA, an interrupt for each character will be
393 used when transmitting data.
394 Normally you want to use DMA, unless you use the DMA channel for
395 something else.
396
397config ETRAX_SERIAL_PORT0_DMA0_OUT
398 bool "Ser0 uses DMA0 for output"
399 depends on CRIS_MACH_ARTPEC3
400 help
401 Enables the DMA0 output channel for ser0 (ttyS0).
402 If you do not enable DMA, an interrupt for each character will be
403 used when transmitting data.
404 Normally you want to use DMA, unless you use the DMA channel for
405 something else.
406
407endchoice
408
409choice
410 prompt "Ser0 DMA in channel "
411 depends on ETRAX_SERIAL_PORT0
412 default ETRAX_SERIAL_PORT0_NO_DMA_IN if ETRAX_ARCH_V32
413 default ETRAX_SERIAL_PORT0_DMA7_IN if ETRAX_ARCH_V10
414 help
415 What DMA channel to use for ser0.
416
417config ETRAX_SERIAL_PORT0_NO_DMA_IN
418 bool "Ser0 uses no DMA for input"
419 help
420 Do not use DMA for ser0 input.
421
422config ETRAX_SERIAL_PORT0_DMA7_IN
423 bool "Ser0 uses DMA7 for input"
424 depends on ETRAXFS
425 help
426 Enables the DMA7 input channel for ser0 (ttyS0).
427 If you do not enable DMA, an interrupt for each character will be
428 used when receiving data.
429 Normally you want to use DMA, unless you use the DMA channel for
430 something else.
431
432config ETRAX_SERIAL_PORT0_DMA1_IN
433 bool "Ser0 uses DMA1 for input"
434 depends on CRIS_MACH_ARTPEC3
435 help
436 Enables the DMA1 input channel for ser0 (ttyS0).
437 If you do not enable DMA, an interrupt for each character will be
438 used when receiveing data.
439 Normally you want to use DMA, unless you use the DMA channel for
440 something else.
441
442endchoice
443
444choice
445 prompt "Ser1 DMA in channel "
446 depends on ETRAX_SERIAL_PORT1
447 default ETRAX_SERIAL_PORT1_NO_DMA_IN if ETRAX_ARCH_V32
448 default ETRAX_SERIAL_PORT1_DMA9_IN if ETRAX_ARCH_V10
449 help
450 What DMA channel to use for ser1.
451
452config ETRAX_SERIAL_PORT1_NO_DMA_IN
453 bool "Ser1 uses no DMA for input"
454 help
455 Do not use DMA for ser1 input.
456
457config ETRAX_SERIAL_PORT1_DMA5_IN
458 bool "Ser1 uses DMA5 for input"
459 depends on ETRAX_ARCH_V32
460 help
461 Enables the DMA5 input channel for ser1 (ttyS1).
462 If you do not enable DMA, an interrupt for each character will be
463 used when receiving data.
464 Normally you want this on, unless you use the DMA channel for
465 something else.
466
467config ETRAX_SERIAL_PORT1_DMA9_IN
468 depends on ETRAX_ARCH_V10
469 bool "Ser1 uses DMA9 for input"
470
471endchoice
472
473
474choice
475 prompt "Ser1 DMA out channel"
476 depends on ETRAX_SERIAL_PORT1
477 default ETRAX_SERIAL_PORT1_NO_DMA_OUT if ETRAX_ARCH_V32
478 default ETRAX_SERIAL_PORT1_DMA8_OUT if ETRAX_ARCH_V10
479 help
480 What DMA channel to use for ser1.
481
482config ETRAX_SERIAL_PORT1_NO_DMA_OUT
483 bool "Ser1 uses no DMA for output"
484 help
485 Do not use DMA for ser1 output.
486
487config ETRAX_SERIAL_PORT1_DMA8_OUT
488 depends on ETRAX_ARCH_V10
489 bool "Ser1 uses DMA8 for output"
490
491config ETRAX_SERIAL_PORT1_DMA4_OUT
492 depends on ETRAX_ARCH_V32
493 bool "Ser1 uses DMA4 for output"
494 help
495 Enables the DMA4 output channel for ser1 (ttyS1).
496 If you do not enable DMA, an interrupt for each character will be
497 used when transmitting data.
498 Normally you want this on, unless you use the DMA channel for
499 something else.
500
501endchoice
502
503choice
504 prompt "Ser2 DMA out channel"
505 depends on ETRAX_SERIAL_PORT2
506 default ETRAX_SERIAL_PORT2_NO_DMA_OUT if ETRAX_ARCH_V32
507 default ETRAX_SERIAL_PORT2_DMA2_OUT if ETRAX_ARCH_V10
508
509config ETRAX_SERIAL_PORT2_NO_DMA_OUT
510 bool "Ser2 uses no DMA for output"
511 help
512 Do not use DMA for ser2 output.
513
514config ETRAX_SERIAL_PORT2_DMA2_OUT
515 bool "Ser2 uses DMA2 for output"
516 depends on ETRAXFS || ETRAX_ARCH_V10
517 help
518 Enables the DMA2 output channel for ser2 (ttyS2).
519 If you do not enable DMA, an interrupt for each character will be
520 used when transmitting data.
521 Normally you want to use DMA, unless you use the DMA channel for
522 something else.
523
524config ETRAX_SERIAL_PORT2_DMA6_OUT
525 bool "Ser2 uses DMA6 for output"
526 depends on CRIS_MACH_ARTPEC3
527 help
528 Enables the DMA6 output channel for ser2 (ttyS2).
529 If you do not enable DMA, an interrupt for each character will be
530 used when transmitting data.
531 Normally you want to use DMA, unless you use the DMA channel for
532 something else.
533
534endchoice
535
536choice
537 prompt "Ser2 DMA in channel"
538 depends on ETRAX_SERIAL_PORT2
539 default ETRAX_SERIAL_PORT2_NO_DMA_IN if ETRAX_ARCH_V32
540 default ETRAX_SERIAL_PORT2_DMA3_IN if ETRAX_ARCH_V10
541 help
542 What DMA channel to use for ser2.
543
544config ETRAX_SERIAL_PORT2_NO_DMA_IN
545 bool "Ser2 uses no DMA for input"
546 help
547 Do not use DMA for ser2 input.
548
549config ETRAX_SERIAL_PORT2_DMA3_IN
550 bool "Ser2 uses DMA3 for input"
551 depends on ETRAXFS || ETRAX_ARCH_V10
552 help
553 Enables the DMA3 input channel for ser2 (ttyS2).
554 If you do not enable DMA, an interrupt for each character will be
555 used when receiving data.
556 Normally you want to use DMA, unless you use the DMA channel for
557 something else.
558
559config ETRAX_SERIAL_PORT2_DMA7_IN
560 bool "Ser2 uses DMA7 for input"
561 depends on CRIS_MACH_ARTPEC3
562 help
563 Enables the DMA7 input channel for ser2 (ttyS2).
564 If you do not enable DMA, an interrupt for each character will be
565 used when receiveing data.
566 Normally you want to use DMA, unless you use the DMA channel for
567 something else.
568
569endchoice
570
571choice
572 prompt "Ser3 DMA in channel"
573 depends on ETRAX_SERIAL_PORT3
574 default ETRAX_SERIAL_PORT3_NO_DMA_IN if ETRAX_ARCH_V32
575 default ETRAX_SERIAL_PORT3_DMA5_IN if ETRAX_ARCH_V10
576 help
577 What DMA channel to use for ser3.
578
579config ETRAX_SERIAL_PORT3_NO_DMA_IN
580 bool "Ser3 uses no DMA for input"
581 help
582 Do not use DMA for ser3 input.
583
584config ETRAX_SERIAL_PORT3_DMA5_IN
585 depends on ETRAX_ARCH_V10
586 bool "DMA 5"
587
588config ETRAX_SERIAL_PORT3_DMA9_IN
589 bool "Ser3 uses DMA9 for input"
590 depends on ETRAXFS
591 help
592 Enables the DMA9 input channel for ser3 (ttyS3).
593 If you do not enable DMA, an interrupt for each character will be
594 used when receiving data.
595 Normally you want to use DMA, unless you use the DMA channel for
596 something else.
597
598config ETRAX_SERIAL_PORT3_DMA3_IN
599 bool "Ser3 uses DMA3 for input"
600 depends on CRIS_MACH_ARTPEC3
601 help
602 Enables the DMA3 input channel for ser3 (ttyS3).
603 If you do not enable DMA, an interrupt for each character will be
604 used when receiveing data.
605 Normally you want to use DMA, unless you use the DMA channel for
606 something else.
607
608endchoice
609
610choice
611 prompt "Ser3 DMA out channel"
612 depends on ETRAX_SERIAL_PORT3
613 default ETRAX_SERIAL_PORT3_NO_DMA_OUT if ETRAX_ARCH_V32
614 default ETRAX_SERIAL_PORT3_DMA4_OUT if ETRAX_ARCH_V10
615
616config ETRAX_SERIAL_PORT3_NO_DMA_OUT
617 bool "Ser3 uses no DMA for output"
618 help
619 Do not use DMA for ser3 output.
620
621config ETRAX_SERIAL_PORT3_DMA4_OUT
622 depends on ETRAX_ARCH_V10
623 bool "DMA 4"
624
625config ETRAX_SERIAL_PORT3_DMA8_OUT
626 bool "Ser3 uses DMA8 for output"
627 depends on ETRAXFS
628 help
629 Enables the DMA8 output channel for ser3 (ttyS3).
630 If you do not enable DMA, an interrupt for each character will be
631 used when transmitting data.
632 Normally you want to use DMA, unless you use the DMA channel for
633 something else.
634
635config ETRAX_SERIAL_PORT3_DMA2_OUT
636 bool "Ser3 uses DMA2 for output"
637 depends on CRIS_MACH_ARTPEC3
638 help
639 Enables the DMA2 output channel for ser3 (ttyS3).
640 If you do not enable DMA, an interrupt for each character will be
641 used when transmitting data.
642 Normally you want to use DMA, unless you use the DMA channel for
643 something else.
644
645endchoice
646
168endmenu 647endmenu
169 648
170source "drivers/base/Kconfig" 649source "drivers/base/Kconfig"
@@ -178,22 +657,10 @@ source "drivers/pnp/Kconfig"
178 657
179source "drivers/block/Kconfig" 658source "drivers/block/Kconfig"
180 659
181source "drivers/md/Kconfig"
182
183source "drivers/ide/Kconfig" 660source "drivers/ide/Kconfig"
184 661
185source "drivers/scsi/Kconfig"
186
187source "drivers/ieee1394/Kconfig"
188
189source "drivers/message/i2o/Kconfig"
190
191source "drivers/net/Kconfig" 662source "drivers/net/Kconfig"
192 663
193source "drivers/isdn/Kconfig"
194
195source "drivers/telephony/Kconfig"
196
197source "drivers/i2c/Kconfig" 664source "drivers/i2c/Kconfig"
198 665
199source "drivers/rtc/Kconfig" 666source "drivers/rtc/Kconfig"
@@ -205,17 +672,8 @@ source "drivers/input/Kconfig"
205 672
206source "drivers/char/Kconfig" 673source "drivers/char/Kconfig"
207 674
208#source drivers/misc/Config.in
209source "drivers/media/Kconfig"
210
211source "fs/Kconfig" 675source "fs/Kconfig"
212 676
213source "sound/Kconfig"
214
215source "drivers/pcmcia/Kconfig"
216
217source "drivers/pci/Kconfig"
218
219source "drivers/usb/Kconfig" 677source "drivers/usb/Kconfig"
220 678
221source "arch/cris/Kconfig.debug" 679source "arch/cris/Kconfig.debug"
diff --git a/arch/cris/Makefile b/arch/cris/Makefile
index e6bf00c262e0..838cd2ae03ae 100644
--- a/arch/cris/Makefile
+++ b/arch/cris/Makefile
@@ -1,4 +1,4 @@
1# $Id: Makefile,v 1.28 2005/03/17 10:44:37 larsv Exp $ 1#
2# cris/Makefile 2# cris/Makefile
3# 3#
4# This file is included by the global makefile so that you can add your own 4# This file is included by the global makefile so that you can add your own
@@ -10,28 +10,36 @@
10# License. See the file "COPYING" in the main directory of this archive 10# License. See the file "COPYING" in the main directory of this archive
11# for more details. 11# for more details.
12 12
13# A bug in ld prevents us from having a (constant-value) symbol in a
14# "ORIGIN =" or "LENGTH =" expression.
15
16arch-y := v10 13arch-y := v10
17arch-$(CONFIG_ETRAX_ARCH_V10) := v10 14arch-$(CONFIG_ETRAX_ARCH_V10) := v10
18arch-$(CONFIG_ETRAX_ARCH_V32) := v32 15arch-$(CONFIG_ETRAX_ARCH_V32) := v32
19 16
20# No config avaiable for make clean etc 17# No config available for make clean etc
18mach-y := fs
19mach-$(CONFIG_CRIS_MACH_ARTPEC3) := a3
20mach-$(CONFIG_ETRAXFS) := fs
21
21ifneq ($(arch-y),) 22ifneq ($(arch-y),)
22SARCH := arch-$(arch-y) 23SARCH := arch-$(arch-y)
23else 24else
24SARCH := 25SARCH :=
25endif 26endif
26 27
28ifneq ($(mach-y),)
29MACH := mach-$(mach-y)
30else
31MACH :=
32endif
33
27LD = $(CROSS_COMPILE)ld -mcrislinux 34LD = $(CROSS_COMPILE)ld -mcrislinux
28 35
29OBJCOPYFLAGS := -O binary -R .note -R .comment -S 36OBJCOPYFLAGS := -O binary -R .note -R .comment -S
30 37
31CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE) 38CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
32KBUILD_AFLAGS += -mlinux
33 39
34KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe 40KBUILD_AFLAGS += -mlinux -march=$(arch-y) -Iinclude/asm/arch/mach -Iinclude/asm/arch
41
42KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe -Iinclude/asm/arch/mach -Iinclude/asm/arch
35 43
36ifdef CONFIG_FRAME_POINTER 44ifdef CONFIG_FRAME_POINTER
37KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g 45KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
@@ -44,6 +52,9 @@ LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
44 52
45core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ 53core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
46core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/ 54core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
55ifdef CONFIG_ETRAX_ARCH_V32
56core-y += arch/$(ARCH)/$(SARCH)/$(MACH)/
57endif
47drivers-y += arch/$(ARCH)/$(SARCH)/drivers/ 58drivers-y += arch/$(ARCH)/$(SARCH)/drivers/
48libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC) 59libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC)
49 60
@@ -52,79 +63,69 @@ SRC_ARCH = $(srctree)/arch/$(ARCH)
52# cris object files path 63# cris object files path
53OBJ_ARCH = $(objtree)/arch/$(ARCH) 64OBJ_ARCH = $(objtree)/arch/$(ARCH)
54 65
55target_boot_arch_dir = $(OBJ_ARCH)/$(SARCH)/boot 66boot := arch/$(ARCH)/boot
56target_boot_dir = $(OBJ_ARCH)/boot 67MACHINE := arch/$(ARCH)/$(SARCH)
57src_boot_dir = $(SRC_ARCH)/boot
58target_compressed_dir = $(OBJ_ARCH)/boot/compressed
59src_compressed_dir = $(SRC_ARCH)/boot/compressed
60target_rescue_dir = $(OBJ_ARCH)/boot/rescue
61src_rescue_dir = $(SRC_ARCH)/boot/rescue
62
63export target_boot_arch_dir target_boot_dir src_boot_dir target_compressed_dir src_compressed_dir target_rescue_dir src_rescue_dir
64
65vmlinux.bin: vmlinux
66 $(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin
67
68timage: vmlinux.bin
69 cat vmlinux.bin cramfs.img >timage
70
71simimage: timage
72 cp vmlinux.bin simvmlinux.bin
73
74# the following will remake timage without compiling the kernel
75# it does of course require that all object files exist...
76
77cramfs:
78## cramfs - Creates a cramfs image
79 mkcramfs -b 8192 -m romfs_meta.txt root cramfs.img
80 cat vmlinux.bin cramfs.img >timage
81 68
82clinux: vmlinux.bin decompress.bin rescue.bin 69all: zImage
83 70
84decompress.bin: $(target_boot_dir) 71zImage Image: vmlinux
85 @$(MAKE) -f $(src_compressed_dir)/Makefile $(target_compressed_dir)/decompress.bin 72 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
86 73
87$(target_rescue_dir)/rescue.bin: $(target_boot_dir) 74archprepare: $(SRC_ARCH)/.links $(srctree)/include/asm-$(ARCH)/.arch FORCE
88 @$(MAKE) -f $(src_rescue_dir)/Makefile $(target_rescue_dir)/rescue.bin
89
90zImage: $(target_boot_dir) vmlinux.bin $(target_rescue_dir)/rescue.bin
91## zImage - Compressed kernel (gzip)
92 @$(MAKE) -f $(src_boot_dir)/Makefile zImage
93
94$(target_boot_dir): $(target_boot_arch_dir)
95 ln -sfn $< $@
96
97$(target_boot_arch_dir):
98 mkdir -p $@
99
100compressed: zImage
101
102archmrproper:
103archclean:
104 @if [ -d arch/$(ARCH)/boot ]; then \
105 $(MAKE) $(clean)=arch/$(ARCH)/boot ; \
106 fi
107 rm -f timage vmlinux.bin decompress.bin rescue.bin cramfs.img
108 rm -rf $(LD_SCRIPT).tmp
109
110archprepare: $(SRC_ARCH)/.links $(srctree)/include/asm-$(ARCH)/.arch
111 75
112# Create some links to make all tools happy 76# Create some links to make all tools happy
113$(SRC_ARCH)/.links: 77$(SRC_ARCH)/.links:
114 @rm -rf $(SRC_ARCH)/drivers 78 @rm -rf $(SRC_ARCH)/drivers
115 @ln -sfn $(SRC_ARCH)/$(SARCH)/drivers $(SRC_ARCH)/drivers 79 @ln -sfn $(SARCH)/drivers $(SRC_ARCH)/drivers
116 @rm -rf $(SRC_ARCH)/boot 80 @rm -rf $(SRC_ARCH)/boot
117 @ln -sfn $(SRC_ARCH)/$(SARCH)/boot $(SRC_ARCH)/boot 81 @ln -sfn $(SARCH)/boot $(SRC_ARCH)/boot
118 @rm -rf $(SRC_ARCH)/lib 82 @rm -rf $(SRC_ARCH)/lib
119 @ln -sfn $(SRC_ARCH)/$(SARCH)/lib $(SRC_ARCH)/lib 83 @ln -sfn $(SARCH)/lib $(SRC_ARCH)/lib
120 @ln -sfn $(SRC_ARCH)/$(SARCH) $(SRC_ARCH)/arch 84 @rm -f $(SRC_ARCH)/arch/mach
121 @ln -sfn $(SRC_ARCH)/$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S 85 @rm -rf $(SRC_ARCH)/arch
122 @ln -sfn $(SRC_ARCH)/$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c 86 @ln -sfn $(SARCH) $(SRC_ARCH)/arch
87ifdef CONFIG_ETRAX_ARCH_V32
88 @ln -sfn ../$(SARCH)/$(MACH) $(SRC_ARCH)/arch/mach
89endif
90 @rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S
91 @ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S
92 @rm -rf $(SRC_ARCH)/kernel/asm-offsets.c
93 @ln -sfn ../$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c
123 @touch $@ 94 @touch $@
124 95
125# Create link to sub arch includes 96# Create link to sub arch includes
126$(srctree)/include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h) 97$(srctree)/include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h)
127 @echo ' Making $(srctree)/include/asm-$(ARCH)/arch -> $(srctree)/include/asm-$(ARCH)/$(SARCH) symlink' 98 @echo ' SYMLINK include/asm-$(ARCH)/arch -> include/asm-$(ARCH)/$(SARCH)'
128 @rm -f include/asm-$(ARCH)/arch 99 @rm -f $(srctree)/include/asm-$(ARCH)/arch/mach
129 @ln -sf $(srctree)/include/asm-$(ARCH)/$(SARCH) $(srctree)/include/asm-$(ARCH)/arch 100 @rm -f $(srctree)/include/asm-$(ARCH)/arch
101 @ln -sf $(SARCH) $(srctree)/include/asm-$(ARCH)/arch
102ifdef CONFIG_ETRAX_ARCH_V32
103 @ln -sf $(MACH) $(srctree)/include/asm-$(ARCH)/arch/mach
104endif
130 @touch $@ 105 @touch $@
106
107archclean:
108 $(Q)if [ -e arch/$(ARCH)/boot ]; then \
109 $(MAKE) $(clean)=arch/$(ARCH)/boot; \
110 fi
111
112CLEAN_FILES += \
113 $(MACHINE)/boot/zImage \
114 $(MACHINE)/boot/compressed/decompress.bin \
115 $(MACHINE)/boot/compressed/piggy.gz \
116 $(MACHINE)/boot/rescue/rescue.bin \
117 $(SRC_ARCH)/.links \
118 $(srctree)/include/asm-$(ARCH)/.arch
119
120MRPROPER_FILES += \
121 $(SRC_ARCH)/drivers \
122 $(SRC_ARCH)/boot \
123 $(SRC_ARCH)/lib \
124 $(SRC_ARCH)/arch \
125 $(SRC_ARCH)/kernel/vmlinux.lds.S \
126 $(SRC_ARCH)/kernel/asm-offsets.c
127
128define archhelp
129 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
130 echo '* Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
131endef
diff --git a/arch/cris/arch-v10/Kconfig b/arch/cris/arch-v10/Kconfig
index 1d61faec77cd..adc164e99339 100644
--- a/arch/cris/arch-v10/Kconfig
+++ b/arch/cris/arch-v10/Kconfig
@@ -1,5 +1,7 @@
1if ETRAX_ARCH_V10 1if ETRAX_ARCH_V10
2 2
3menu "CRIS v10 options"
4
3# ETRAX 100LX v1 has a MMU "feature" requiring a low mapping 5# ETRAX 100LX v1 has a MMU "feature" requiring a low mapping
4config CRIS_LOW_MAP 6config CRIS_LOW_MAP
5 bool 7 bool
@@ -228,69 +230,6 @@ config ETRAX_LED12R
228 For products with only one or two controllable LEDs, 230 For products with only one or two controllable LEDs,
229 set this to same as CONFIG_ETRAX_LED1G (normally 2). 231 set this to same as CONFIG_ETRAX_LED1G (normally 2).
230 232
231choice
232 prompt "Product debug-port"
233 depends on ETRAX_ARCH_V10
234 default ETRAX_DEBUG_PORT0
235
236config ETRAX_DEBUG_PORT0
237 bool "Serial-0"
238 help
239 Choose a serial port for the ETRAX debug console. Default to
240 port 0.
241
242config ETRAX_DEBUG_PORT1
243 bool "Serial-1"
244 help
245 Use serial port 1 for the console.
246
247config ETRAX_DEBUG_PORT2
248 bool "Serial-2"
249 help
250 Use serial port 2 for the console.
251
252config ETRAX_DEBUG_PORT3
253 bool "Serial-3"
254 help
255 Use serial port 3 for the console.
256
257config ETRAX_DEBUG_PORT_NULL
258 bool "disabled"
259 help
260 Disable serial-port debugging.
261
262endchoice
263
264choice
265 prompt "Kernel GDB port"
266 depends on ETRAX_KGDB
267 default ETRAX_KGDB_PORT0
268 help
269 Choose a serial port for kernel debugging. NOTE: This port should
270 not be enabled under Drivers for built-in interfaces (as it has its
271 own initialization code) and should not be the same as the debug port.
272
273config ETRAX_KGDB_PORT0
274 bool "Serial-0"
275 help
276 Use serial port 0 for kernel debugging.
277
278config ETRAX_KGDB_PORT1
279 bool "Serial-1"
280 help
281 Use serial port 1 for kernel debugging.
282
283config ETRAX_KGDB_PORT2
284 bool "Serial-2"
285 help
286 Use serial port 2 for kernel debugging.
287
288config ETRAX_KGDB_PORT3
289 bool "Serial-3"
290 help
291 Use serial port 3 for kernel debugging.
292
293endchoice
294 233
295choice 234choice
296 prompt "Product rescue-port" 235 prompt "Product rescue-port"
@@ -454,4 +393,6 @@ config ETRAX_POWERBUTTON_BIT
454 help 393 help
455 Configure where power button is connected. 394 Configure where power button is connected.
456 395
396endmenu
397
457endif 398endif
diff --git a/arch/cris/arch-v10/boot/Makefile b/arch/cris/arch-v10/boot/Makefile
index e5b105851108..20c83a53caf3 100644
--- a/arch/cris/arch-v10/boot/Makefile
+++ b/arch/cris/arch-v10/boot/Makefile
@@ -1,13 +1,21 @@
1# 1#
2# arch/cris/boot/Makefile 2# arch/cris/arch-v10/boot/Makefile
3# 3#
4target = $(target_boot_dir)
5src = $(src_boot_dir)
6 4
7zImage: compressed/vmlinuz 5OBJCOPY = objcopy-cris
6OBJCOPYFLAGS = -O binary --remove-section=.bss
8 7
9compressed/vmlinuz: 8subdir- := compressed rescue
10 @$(MAKE) -f $(src)/compressed/Makefile $(target_compressed_dir)/vmlinuz 9targets := Image
11 10
12clean: 11$(obj)/Image: vmlinux FORCE
13 @$(MAKE) -f $(src)/compressed/Makefile clean 12 $(call if_changed,objcopy)
13 @echo ' Kernel: $@ is ready'
14
15$(obj)/compressed/vmlinux: $(obj)/Image FORCE
16 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
17 $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
18
19$(obj)/zImage: $(obj)/compressed/vmlinux
20 @cp $< $@
21 @echo ' Kernel: $@ is ready'
diff --git a/arch/cris/arch-v10/boot/compressed/Makefile b/arch/cris/arch-v10/boot/compressed/Makefile
index 6584a44820f4..4a031cb27eb9 100644
--- a/arch/cris/arch-v10/boot/compressed/Makefile
+++ b/arch/cris/arch-v10/boot/compressed/Makefile
@@ -1,45 +1,35 @@
1# 1#
2# create a compressed vmlinuz image from the binary vmlinux.bin file 2# arch/cris/arch-v10/boot/compressed/Makefile
3# 3#
4target = $(target_compressed_dir)
5src = $(src_compressed_dir)
6 4
7CC = gcc-cris -melf $(LINUXINCLUDE) 5CC = gcc-cris -melf $(LINUXINCLUDE)
8CFLAGS = -O2 6ccflags-y += -O2
9LD = ld-cris 7LD = ld-cris
8ldflags-y += -T $(obj)/decompress.ld
9OBJECTS = $(obj)/head.o $(obj)/misc.o
10OBJCOPY = objcopy-cris 10OBJCOPY = objcopy-cris
11OBJCOPYFLAGS = -O binary --remove-section=.bss 11OBJCOPYFLAGS = -O binary --remove-section=.bss
12OBJECTS = $(target)/head.o $(target)/misc.o
13 12
14# files to compress 13quiet_cmd_image = BUILD $@
15SYSTEM = $(objtree)/vmlinux.bin 14cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@
16 15
17all: $(target_compressed_dir)/vmlinuz 16targets := vmlinux piggy.gz decompress.o decompress.bin
18 17
19$(target)/decompress.bin: $(OBJECTS) 18$(obj)/decompress.o: $(OBJECTS) FORCE
20 $(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS) 19 $(call if_changed,ld)
21 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin
22 20
23# Create vmlinuz image in top-level build directory 21$(obj)/decompress.bin: $(obj)/decompress.o FORCE
24$(target_compressed_dir)/vmlinuz: $(target) piggy.img $(target)/decompress.bin 22 $(call if_changed,objcopy)
25 @echo " COMPR vmlinux.bin --> vmlinuz"
26 @cat $(target)/decompress.bin piggy.img > $(target_compressed_dir)/vmlinuz
27 @rm -f piggy.img
28 23
29$(target)/head.o: $(src)/head.S 24$(obj)/head.o: $(obj)/head.S .config
30 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $@ 25 @$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
31 26
32$(target)/misc.o: $(src)/misc.c 27$(obj)/misc.o: $(obj)/misc.c .config
33 $(CC) -D__KERNEL__ -c $< -o $@ 28 @$(CC) -D__KERNEL__ -c $< -o $@
34 29
35# gzip the kernel image 30$(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE
31 $(call if_changed,image)
36 32
37piggy.img: $(SYSTEM) 33$(obj)/piggy.gz: $(obj)/../Image FORCE
38 @cat $(SYSTEM) | gzip -f -9 > piggy.img 34 $(call if_changed,gzip)
39
40$(target):
41 mkdir -p $(target)
42
43clean:
44 rm -f piggy.img $(objtree)/vmlinuz
45 35
diff --git a/arch/cris/arch-v10/boot/compressed/misc.c b/arch/cris/arch-v10/boot/compressed/misc.c
index e205d2e7e089..9a43ab19391e 100644
--- a/arch/cris/arch-v10/boot/compressed/misc.c
+++ b/arch/cris/arch-v10/boot/compressed/misc.c
@@ -1,15 +1,13 @@
1/* 1/*
2 * misc.c 2 * misc.c
3 * 3 *
4 * $Id: misc.c,v 1.6 2003/10/27 08:04:31 starvik Exp $ 4 * This is a collection of several routines from gzip-1.0.3
5 *
6 * This is a collection of several routines from gzip-1.0.3
7 * adapted for Linux. 5 * adapted for Linux.
8 * 6 *
9 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994 7 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
10 * puts by Nick Holloway 1993, better puts by Martin Mares 1995 8 * puts by Nick Holloway 1993, better puts by Martin Mares 1995
11 * adaptation for Linux/CRIS Axis Communications AB, 1999 9 * adaptation for Linux/CRIS Axis Communications AB, 1999
12 * 10 *
13 */ 11 */
14 12
15/* where the piggybacked kernel image expects itself to live. 13/* where the piggybacked kernel image expects itself to live.
diff --git a/arch/cris/arch-v10/boot/rescue/Makefile b/arch/cris/arch-v10/boot/rescue/Makefile
index 8be9b3130312..2e5045b9e19c 100644
--- a/arch/cris/arch-v10/boot/rescue/Makefile
+++ b/arch/cris/arch-v10/boot/rescue/Makefile
@@ -1,56 +1,38 @@
1# 1#
2# Makefile for rescue code 2# Makefile for rescue (bootstrap) code
3# 3#
4target = $(target_rescue_dir)
5src = $(src_rescue_dir)
6 4
7CC = gcc-cris -mlinux $(LINUXINCLUDE) 5CC = gcc-cris -mlinux $(LINUXINCLUDE)
8CFLAGS = -O2 6ccflags-y += -O2
7asflags-y += -traditional
9LD = gcc-cris -mlinux -nostdlib 8LD = gcc-cris -mlinux -nostdlib
9ldflags-y += -T $(obj)/rescue.ld
10OBJCOPY = objcopy-cris 10OBJCOPY = objcopy-cris
11OBJCOPYFLAGS = -O binary --remove-section=.bss 11OBJCOPYFLAGS = -O binary --remove-section=.bss
12obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o
13OBJECT := $(obj)/head.o
12 14
13all: $(target)/rescue.bin $(target)/testrescue.bin $(target)/kimagerescue.bin 15targets := rescue.o rescue.bin
14 16
15$(target)/rescue.bin: $(target) $(target)/head.o 17$(obj)/rescue.o: $(OBJECT) FORCE
16 $(LD) -T $(src)/rescue.ld -o $(target)/rescue.o $(target)/head.o 18 $(call if_changed,ld)
17 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/rescue.o $(target)/rescue.bin
18# Place a copy in top-level build directory
19 cp -p $(target)/rescue.bin $(objtree)
20 19
21$(target)/testrescue.bin: $(target) $(target)/testrescue.o 20$(obj)/rescue.bin: $(obj)/rescue.o FORCE
22 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/testrescue.o tr.bin 21 $(call if_changed,objcopy)
22 cp -p $(obj)/rescue.bin $(objtree)
23
24$(obj)/testrescue.bin: $(obj)/testrescue.o
25 $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/testrescue.o tr.bin
23# Pad it to 784 bytes 26# Pad it to 784 bytes
24 dd if=/dev/zero of=tmp2423 bs=1 count=784 27 dd if=/dev/zero of=tmp2423 bs=1 count=784
25 cat tr.bin tmp2423 >testrescue_tmp.bin 28 cat tr.bin tmp2423 >testrescue_tmp.bin
26 dd if=testrescue_tmp.bin of=$(target)/testrescue.bin bs=1 count=784 29 dd if=testrescue_tmp.bin of=$(obj)/testrescue.bin bs=1 count=784
27 rm tr.bin tmp2423 testrescue_tmp.bin 30 rm tr.bin tmp2423 testrescue_tmp.bin
28 31
29$(target)/kimagerescue.bin: $(target) $(target)/kimagerescue.o 32$(obj)/kimagerescue.bin: $(obj)/kimagerescue.o
30 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/kimagerescue.o ktr.bin 33 $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/kimagerescue.o ktr.bin
31# Pad it to 784 bytes, that's what the rescue loader expects 34# Pad it to 784 bytes, that's what the rescue loader expects
32 dd if=/dev/zero of=tmp2423 bs=1 count=784 35 dd if=/dev/zero of=tmp2423 bs=1 count=784
33 cat ktr.bin tmp2423 >kimagerescue_tmp.bin 36 cat ktr.bin tmp2423 >kimagerescue_tmp.bin
34 dd if=kimagerescue_tmp.bin of=$(target)/kimagerescue.bin bs=1 count=784 37 dd if=kimagerescue_tmp.bin of=$(obj)/kimagerescue.bin bs=1 count=784
35 rm ktr.bin tmp2423 kimagerescue_tmp.bin 38 rm ktr.bin tmp2423 kimagerescue_tmp.bin
36
37$(target):
38 mkdir -p $(target)
39
40$(target)/head.o: $(src)/head.S
41 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
42
43$(target)/testrescue.o: $(src)/testrescue.S
44 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
45
46$(target)/kimagerescue.o: $(src)/kimagerescue.S
47 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
48
49clean:
50 rm -f $(target)/*.o $(target)/*.bin
51
52fastdep:
53
54modules:
55
56modules-install:
diff --git a/arch/cris/arch-v10/boot/rescue/head.S b/arch/cris/arch-v10/boot/rescue/head.S
index f223cc0c00bb..6ba7be8ac4a0 100644
--- a/arch/cris/arch-v10/boot/rescue/head.S
+++ b/arch/cris/arch-v10/boot/rescue/head.S
@@ -1,5 +1,4 @@
1/* $Id: head.S,v 1.7 2005/03/07 12:11:06 starvik Exp $ 1/*
2 *
3 * Rescue code, made to reside at the beginning of the 2 * Rescue code, made to reside at the beginning of the
4 * flash-memory. when it starts, it checks a partition 3 * flash-memory. when it starts, it checks a partition
5 * table at the first sector after the rescue sector. 4 * table at the first sector after the rescue sector.
@@ -23,20 +22,20 @@
23 * Partition table format: 22 * Partition table format:
24 * 23 *
25 * Code transparency: 24 * Code transparency:
26 * 25 *
27 * 2 bytes [opcode 'nop'] 26 * 2 bytes [opcode 'nop']
28 * 2 bytes [opcode 'di'] 27 * 2 bytes [opcode 'di']
29 * 4 bytes [opcode 'ba <offset>', 8-bit or 16-bit version] 28 * 4 bytes [opcode 'ba <offset>', 8-bit or 16-bit version]
30 * 2 bytes [opcode 'nop', delay slot] 29 * 2 bytes [opcode 'nop', delay slot]
31 * 30 *
32 * Table validation (at +10): 31 * Table validation (at +10):
33 * 32 *
34 * 2 bytes [magic/version word for partitiontable - 0xef, 0xbe] 33 * 2 bytes [magic/version word for partitiontable - 0xef, 0xbe]
35 * 2 bytes [length of all entries plus the end marker] 34 * 2 bytes [length of all entries plus the end marker]
36 * 4 bytes [checksum for the partitiontable itself] 35 * 4 bytes [checksum for the partitiontable itself]
37 * 36 *
38 * Entries, each with the following format, last has offset -1: 37 * Entries, each with the following format, last has offset -1:
39 * 38 *
40 * 4 bytes [offset in bytes, from start of flash] 39 * 4 bytes [offset in bytes, from start of flash]
41 * 4 bytes [length in bytes of partition] 40 * 4 bytes [length in bytes of partition]
42 * 4 bytes [checksum, simple longword sum] 41 * 4 bytes [checksum, simple longword sum]
@@ -47,9 +46,9 @@
47 * End marker 46 * End marker
48 * 47 *
49 * 4 bytes [-1] 48 * 4 bytes [-1]
50 * 49 *
51 * 10 bytes [0, padding] 50 * 10 bytes [0, padding]
52 * 51 *
53 * Bit 0 in flags signifies RW or RO. The rescue code only bothers 52 * Bit 0 in flags signifies RW or RO. The rescue code only bothers
54 * to check the checksum for RO partitions, since the others will 53 * to check the checksum for RO partitions, since the others will
55 * change their data without updating the checksums. A 1 in bit 0 54 * change their data without updating the checksums. A 1 in bit 0
@@ -59,26 +58,29 @@
59 * 58 *
60 * During the wait for serial input, the status LED will flash so the 59 * During the wait for serial input, the status LED will flash so the
61 * user knows something went wrong. 60 * user knows something went wrong.
62 * 61 *
63 * Copyright (C) 1999, 2000, 2001, 2002, 2003 Axis Communications AB 62 * Copyright (C) 1999-2007 Axis Communications AB
64 */ 63 */
65 64
65#ifdef CONFIG_ETRAX_AXISFLASHMAP
66
66#define ASSEMBLER_MACROS_ONLY 67#define ASSEMBLER_MACROS_ONLY
67#include <asm/arch/sv_addr_ag.h> 68#include <asm/arch/sv_addr_ag.h>
68 69
69 ;; The partitiontable is looked for at the first sector after the boot 70 ;; The partitiontable is looked for at the first sector after the boot
70 ;; sector. Sector size is 65536 bytes in all flashes we use. 71 ;; sector. Sector size is 65536 bytes in all flashes we use.
71 72
72#define PTABLE_START CONFIG_ETRAX_PTABLE_SECTOR 73#define PTABLE_START CONFIG_ETRAX_PTABLE_SECTOR
73#define PTABLE_MAGIC 0xbeef 74#define PTABLE_MAGIC 0xbeef
74 75
75 ;; The normal Etrax100 on-chip boot ROM does serial boot at 0x380000f0. 76 ;; The normal Etrax100 on-chip boot ROM does serial boot at 0x380000f0.
76 ;; That is not where we put our downloaded serial boot-code. The length is 77 ;; That is not where we put our downloaded serial boot-code.
77 ;; enough for downloading code that loads the rest of itself (after 78 ;; The length is enough for downloading code that loads the rest
78 ;; having setup the DRAM etc). It is the same length as the on-chip 79 ;; of itself (after having setup the DRAM etc).
79 ;; ROM loads, so the same host loader can be used to load a rescued 80 ;; It is the same length as the on-chip ROM loads, so the same
80 ;; product as well as one booted through the Etrax serial boot code. 81 ;; host loader can be used to load a rescued product as well as
81 82 ;; one booted through the Etrax serial boot code.
83
82#define CODE_START 0x40000000 84#define CODE_START 0x40000000
83#define CODE_LENGTH 784 85#define CODE_LENGTH 784
84 86
@@ -102,7 +104,7 @@
102#define SERRECC R_SERIAL2_REC_CTRL 104#define SERRECC R_SERIAL2_REC_CTRL
103#define SERRDAT R_SERIAL2_REC_DATA 105#define SERRDAT R_SERIAL2_REC_DATA
104#define SERSTAT R_SERIAL2_STATUS 106#define SERSTAT R_SERIAL2_STATUS
105#endif 107#endif
106#ifdef CONFIG_ETRAX_RESCUE_SER3 108#ifdef CONFIG_ETRAX_RESCUE_SER3
107#define SERXOFF R_SERIAL3_XOFF 109#define SERXOFF R_SERIAL3_XOFF
108#define SERBAUD R_SERIAL3_BAUD 110#define SERBAUD R_SERIAL3_BAUD
@@ -115,60 +117,61 @@
115#define RAM_INIT_MAGIC 0x56902387 117#define RAM_INIT_MAGIC 0x56902387
116 118
117 .text 119 .text
118 120
119 ;; This is the entry point of the rescue code 121 ;; This is the entry point of the rescue code
120 ;; 0x80000000 if loaded in flash (as it should be) 122 ;; 0x80000000 if loaded in flash (as it should be)
121 ;; since etrax actually starts at address 2 when booting from flash, we 123 ;; Since etrax actually starts at address 2 when booting from flash, we
122 ;; put a nop (2 bytes) here first so we dont accidentally skip the di 124 ;; put a nop (2 bytes) here first so we dont accidentally skip the di
123 125
124 nop 126 nop
125 di 127 di
126 128
127 jump in_cache ; enter cached area instead 129 jump in_cache ; enter cached area instead
128in_cache: 130in_cache:
129 131
130 132
131 ;; first put a jump test to give a possibility of upgrading the rescue code 133 ;; First put a jump test to give a possibility of upgrading the
132 ;; without erasing/reflashing the sector. we put a longword of -1 here and if 134 ;; rescue code without erasing/reflashing the sector.
133 ;; it is not -1, we jump using the value as jump target. since we can always 135 ;; We put a longword of -1 here and if it is not -1, we jump using
134 ;; change 1's to 0's without erasing the sector, it is possible to add new 136 ;; the value as jump target. Since we can always change 1's to 0's
137 ;; without erasing the sector, it is possible to add new
135 ;; code after this and altering the jumptarget in an upgrade. 138 ;; code after this and altering the jumptarget in an upgrade.
136 139
137jtcd: move.d [jumptarget], $r0 140jtcd: move.d [jumptarget], $r0
138 cmp.d 0xffffffff, $r0 141 cmp.d 0xffffffff, $r0
139 beq no_newjump 142 beq no_newjump
140 nop 143 nop
141 144
142 jump [$r0] 145 jump [$r0]
143 146
144jumptarget: 147jumptarget:
145 .dword 0xffffffff ; can be overwritten later to insert new code 148 .dword 0xffffffff ; can be overwritten later to insert new code
146 149
147no_newjump: 150no_newjump:
148#ifdef CONFIG_ETRAX_ETHERNET 151#ifdef CONFIG_ETRAX_ETHERNET
149 ;; Start MII clock to make sure it is running when tranceiver is reset 152 ;; Start MII clock to make sure it is running when tranceiver is reset
150 move.d 0x3, $r0 ; enable = on, phy = mii_clk 153 move.d 0x3, $r0 ; enable = on, phy = mii_clk
151 move.d $r0, [R_NETWORK_GEN_CONFIG] 154 move.d $r0, [R_NETWORK_GEN_CONFIG]
152#endif 155#endif
153 156
154 ;; We need to setup the bus registers before we start using the DRAM 157 ;; We need to setup the bus registers before we start using the DRAM
155#include "../../lib/dram_init.S" 158#include "../../lib/dram_init.S"
156 159
157 ;; we now should go through the checksum-table and check the listed 160 ;; we now should go through the checksum-table and check the listed
158 ;; partitions for errors. 161 ;; partitions for errors.
159 162
160 move.d PTABLE_START, $r3 163 move.d PTABLE_START, $r3
161 move.d [$r3], $r0 164 move.d [$r3], $r0
162 cmp.d NOP_DI, $r0 ; make sure the nop/di is there... 165 cmp.d NOP_DI, $r0 ; make sure the nop/di is there...
163 bne do_rescue 166 bne do_rescue
164 nop 167 nop
165 168
166 ;; skip the code transparency block (10 bytes). 169 ;; skip the code transparency block (10 bytes).
167 170
168 addq 10, $r3 171 addq 10, $r3
169 172
170 ;; check for correct magic 173 ;; check for correct magic
171 174
172 move.w [$r3+], $r0 175 move.w [$r3+], $r0
173 cmp.w PTABLE_MAGIC, $r0 176 cmp.w PTABLE_MAGIC, $r0
174 bne do_rescue ; didn't recognize - trig rescue 177 bne do_rescue ; didn't recognize - trig rescue
@@ -186,11 +189,11 @@ no_newjump:
186 cmp.d $r0, $r4 189 cmp.d $r0, $r4
187 bne do_rescue ; didn't match - trig rescue 190 bne do_rescue ; didn't match - trig rescue
188 nop 191 nop
189 192
190 ;; ptable is ok. validate each entry. 193 ;; ptable is ok. validate each entry.
191 194
192 moveq -1, $r7 195 moveq -1, $r7
193 196
194ploop: move.d [$r3+], $r1 ; partition offset (from ptable start) 197ploop: move.d [$r3+], $r1 ; partition offset (from ptable start)
195 bne notfirst ; check if it is the partition containing ptable 198 bne notfirst ; check if it is the partition containing ptable
196 nop ; yes.. 199 nop ; yes..
@@ -199,7 +202,7 @@ ploop: move.d [$r3+], $r1 ; partition offset (from ptable start)
199 sub.d $r8, $r2 ; minus the ptable length 202 sub.d $r8, $r2 ; minus the ptable length
200 ba bosse 203 ba bosse
201 nop 204 nop
202notfirst: 205notfirst:
203 cmp.d -1, $r1 ; the end of the ptable ? 206 cmp.d -1, $r1 ; the end of the ptable ?
204 beq flash_ok ; if so, the flash is validated 207 beq flash_ok ; if so, the flash is validated
205 move.d [$r3+], $r2 ; partition length 208 move.d [$r3+], $r2 ; partition length
@@ -213,47 +216,46 @@ bosse: move.d [$r3+], $r5 ; checksum
213 bpl 1f 216 bpl 1f
214 nop 217 nop
215 move.d $r1, $r7 ; remember boot partition offset 218 move.d $r1, $r7 ; remember boot partition offset
2161: 2191:
217
218 add.d PTABLE_START, $r1 220 add.d PTABLE_START, $r1
219 221
220 jsr checksum ; checksum the partition 222 jsr checksum ; checksum the partition
221 223
222 cmp.d $r0, $r5 224 cmp.d $r0, $r5
223 beq ploop ; checksums matched, go to next entry 225 beq ploop ; checksums matched, go to next entry
224 nop 226 nop
225 227
226 ;; otherwise fall through to the rescue code. 228 ;; otherwise fall through to the rescue code.
227 229
228do_rescue: 230do_rescue:
229 ;; setup port PA and PB default initial directions and data 231 ;; setup port PA and PB default initial directions and data
230 ;; (so we can flash LEDs, and so that DTR and others are set) 232 ;; (so we can flash LEDs, and so that DTR and others are set)
231 233
232 move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0 234 move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0
233 move.b $r0, [R_PORT_PA_DIR] 235 move.b $r0, [R_PORT_PA_DIR]
234 move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0 236 move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0
235 move.b $r0, [R_PORT_PA_DATA] 237 move.b $r0, [R_PORT_PA_DATA]
236 238
237 move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, $r0 239 move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, $r0
238 move.b $r0, [R_PORT_PB_DIR] 240 move.b $r0, [R_PORT_PB_DIR]
239 move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0 241 move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0
240 move.b $r0, [R_PORT_PB_DATA] 242 move.b $r0, [R_PORT_PB_DATA]
241 243
242 ;; setup the serial port at 115200 baud 244 ;; setup the serial port at 115200 baud
243 245
244 moveq 0, $r0 246 moveq 0, $r0
245 move.d $r0, [SERXOFF] 247 move.d $r0, [SERXOFF]
246 248
247 move.b 0x99, $r0 249 move.b 0x99, $r0
248 move.b $r0, [SERBAUD] ; 115.2kbaud for both transmit and receive 250 move.b $r0, [SERBAUD] ; 115.2kbaud for both transmit and receive
249 251
250 move.b 0x40, $r0 ; rec enable 252 move.b 0x40, $r0 ; rec enable
251 move.b $r0, [SERRECC] 253 move.b $r0, [SERRECC]
252 254
253 moveq 0, $r1 ; "timer" to clock out a LED red flash 255 moveq 0, $r1 ; "timer" to clock out a LED red flash
254 move.d CODE_START, $r3 ; destination counter 256 move.d CODE_START, $r3 ; destination counter
255 movu.w CODE_LENGTH, $r4; length 257 movu.w CODE_LENGTH, $r4; length
256 258
257wait_ser: 259wait_ser:
258 addq 1, $r1 260 addq 1, $r1
259#ifndef CONFIG_ETRAX_NO_LEDS 261#ifndef CONFIG_ETRAX_NO_LEDS
@@ -272,20 +274,20 @@ wait_ser:
272 nop 274 nop
2731: not $r0 ; clear bit 2751: not $r0 ; clear bit
274 and.d $r0, $r2 276 and.d $r0, $r2
2752: 2772:
276#ifdef CONFIG_ETRAX_PA_LEDS 278#ifdef CONFIG_ETRAX_PA_LEDS
277 move.b $r2, [R_PORT_PA_DATA] 279 move.b $r2, [R_PORT_PA_DATA]
278#endif 280#endif
279#ifdef CONFIG_ETRAX_PB_LEDS 281#ifdef CONFIG_ETRAX_PB_LEDS
280 move.b $r2, [R_PORT_PB_DATA] 282 move.b $r2, [R_PORT_PB_DATA]
281#endif 283#endif
282#ifdef CONFIG_ETRAX_90000000_LEDS 284#ifdef CONFIG_ETRAX_90000000_LEDS
283 move.b $r2, [0x90000000] 285 move.b $r2, [0x90000000]
284#endif 286#endif
285#endif 287#endif
286 288
287 ;; check if we got something on the serial port 289 ;; check if we got something on the serial port
288 290
289 move.b [SERSTAT], $r0 291 move.b [SERSTAT], $r0
290 btstq 0, $r0 ; data_avail 292 btstq 0, $r0 ; data_avail
291 bpl wait_ser 293 bpl wait_ser
@@ -295,14 +297,15 @@ wait_ser:
295 297
296 move.b [SERRDAT], $r0 298 move.b [SERRDAT], $r0
297 move.b $r0, [$r3+] 299 move.b $r0, [$r3+]
298 300
299 subq 1, $r4 ; decrease length 301 subq 1, $r4 ; decrease length
300 bne wait_ser 302 bne wait_ser
301 nop 303 nop
302 304
303 ;; jump into downloaded code 305 ;; jump into downloaded code
304 306
305 move.d RAM_INIT_MAGIC, $r8 ; Tell next product that DRAM is initialized 307 move.d RAM_INIT_MAGIC, $r8 ; Tell next product that DRAM is
308 ; initialized
306 jump CODE_START 309 jump CODE_START
307 310
308flash_ok: 311flash_ok:
@@ -313,7 +316,8 @@ flash_ok:
313 nop 316 nop
314 move.d PTABLE_START, $r7; otherwise use the ptable start 317 move.d PTABLE_START, $r7; otherwise use the ptable start
3151: 3181:
316 move.d RAM_INIT_MAGIC, $r8 ; Tell next product that DRAM is initialized 319 move.d RAM_INIT_MAGIC, $r8 ; Tell next product that DRAM is
320 ; initialized
317 jump $r7 ; boot! 321 jump $r7 ; boot!
318 322
319 323
@@ -327,7 +331,8 @@ checksum:
327 moveq 0, $r0 331 moveq 0, $r0
328 moveq CONFIG_ETRAX_FLASH1_SIZE, $r6 332 moveq CONFIG_ETRAX_FLASH1_SIZE, $r6
329 333
330 ;; If the first physical flash memory is exceeded wrap to the second one. 334 ;; If the first physical flash memory is exceeded wrap to the
335 ;; second one
331 btstq 26, $r1 ; Are we addressing first flash? 336 btstq 26, $r1 ; Are we addressing first flash?
332 bpl 1f 337 bpl 1f
333 nop 338 nop
@@ -351,3 +356,5 @@ checksum:
3513: move.d MEM_CSE1_START, $r1 ; wrap to second flash 3563: move.d MEM_CSE1_START, $r1 ; wrap to second flash
352 ba 2b 357 ba 2b
353 nop 358 nop
359
360#endif
diff --git a/arch/cris/arch-v10/boot/rescue/kimagerescue.S b/arch/cris/arch-v10/boot/rescue/kimagerescue.S
index cbccd6316d39..55eeff8bb08e 100644
--- a/arch/cris/arch-v10/boot/rescue/kimagerescue.S
+++ b/arch/cris/arch-v10/boot/rescue/kimagerescue.S
@@ -1,5 +1,4 @@
1/* $Id: kimagerescue.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $ 1/*
2 *
3 * Rescue code to be prepended on a kimage and copied to the 2 * Rescue code to be prepended on a kimage and copied to the
4 * rescue serial port. 3 * rescue serial port.
5 * This is called from the rescue code, it will copy received data to 4 * This is called from the rescue code, it will copy received data to
@@ -7,13 +6,13 @@
7 */ 6 */
8 7
9#define ASSEMBLER_MACROS_ONLY 8#define ASSEMBLER_MACROS_ONLY
10#include <asm/sv_addr_ag.h> 9#include <asm/arch/sv_addr_ag.h>
11 10
12#define CODE_START 0x40004000 11#define CODE_START 0x40004000
13#define CODE_LENGTH 784 12#define CODE_LENGTH 784
14#define TIMEOUT_VALUE 1000 13#define TIMEOUT_VALUE 1000
15 14
16 15
17#ifdef CONFIG_ETRAX_RESCUE_SER0 16#ifdef CONFIG_ETRAX_RESCUE_SER0
18#define SERXOFF R_SERIAL0_XOFF 17#define SERXOFF R_SERIAL0_XOFF
19#define SERBAUD R_SERIAL0_BAUD 18#define SERBAUD R_SERIAL0_BAUD
@@ -34,7 +33,7 @@
34#define SERRECC R_SERIAL2_REC_CTRL 33#define SERRECC R_SERIAL2_REC_CTRL
35#define SERRDAT R_SERIAL2_REC_DATA 34#define SERRDAT R_SERIAL2_REC_DATA
36#define SERSTAT R_SERIAL2_STATUS 35#define SERSTAT R_SERIAL2_STATUS
37#endif 36#endif
38#ifdef CONFIG_ETRAX_RESCUE_SER3 37#ifdef CONFIG_ETRAX_RESCUE_SER3
39#define SERXOFF R_SERIAL3_XOFF 38#define SERXOFF R_SERIAL3_XOFF
40#define SERBAUD R_SERIAL3_BAUD 39#define SERBAUD R_SERIAL3_BAUD
@@ -48,54 +47,55 @@
48 ;; 0x80000000 if loaded in flash (as it should be) 47 ;; 0x80000000 if loaded in flash (as it should be)
49 ;; since etrax actually starts at address 2 when booting from flash, we 48 ;; since etrax actually starts at address 2 when booting from flash, we
50 ;; put a nop (2 bytes) here first so we dont accidentally skip the di 49 ;; put a nop (2 bytes) here first so we dont accidentally skip the di
51 50
52 nop 51 nop
53 di 52 di
54#ifndef CONFIG_SVINTO_SIM 53#ifndef CONFIG_SVINTO_SIM
55 ;; setup port PA and PB default initial directions and data 54 ;; setup port PA and PB default initial directions and data
56 ;; (so we can flash LEDs, and so that DTR and others are set) 55 ;; (so we can flash LEDs, and so that DTR and others are set)
57 56
58 move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0 57 move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0
59 move.b $r0, [R_PORT_PA_DIR] 58 move.b $r0, [R_PORT_PA_DIR]
60 move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0 59 move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0
61 move.b $r0, [R_PORT_PA_DATA] 60 move.b $r0, [R_PORT_PA_DATA]
62 61
63 move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, $r0 62 move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, $r0
64 move.b $r0, [R_PORT_PB_DIR] 63 move.b $r0, [R_PORT_PB_DIR]
65 move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0 64 move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0
66 move.b $r0, [R_PORT_PB_DATA] 65 move.b $r0, [R_PORT_PB_DATA]
67 66
68 ;; We need to setup the bus registers before we start using the DRAM 67 ;; We need to setup the bus registers before we start using the DRAM
69#include "../../lib/dram_init.S" 68#include "../../lib/dram_init.S"
70 69
71#endif 70#endif
72 ;; Setup the stack to a suitably high address. 71 ;; Setup the stack to a suitably high address.
73 ;; We assume 8 MB is the minimum DRAM in an eLinux 72 ;; We assume 8 MB is the minimum DRAM in an eLinux
74 ;; product and put the sp at the top for now. 73 ;; product and put the sp at the top for now.
75 74
76 move.d 0x40800000, $sp 75 move.d 0x40800000, $sp
77 76
78 ;; setup the serial port at 115200 baud 77 ;; setup the serial port at 115200 baud
79 78
80 moveq 0, $r0 79 moveq 0, $r0
81 move.d $r0, [SERXOFF] 80 move.d $r0, [SERXOFF]
82 81
83 move.b 0x99, $r0 82 move.b 0x99, $r0
84 move.b $r0, [SERBAUD] ; 115.2kbaud for both transmit and receive 83 move.b $r0, [SERBAUD] ; 115.2kbaud for both transmit
84 ; and receive
85 85
86 move.b 0x40, $r0 ; rec enable 86 move.b 0x40, $r0 ; rec enable
87 move.b $r0, [SERRECC] 87 move.b $r0, [SERRECC]
88 88
89 89
90 moveq 0, $r1 ; "timer" to clock out a LED red flash 90 moveq 0, $r1 ; "timer" to clock out a LED red flash
91 move.d CODE_START, $r3 ; destination counter 91 move.d CODE_START, $r3 ; destination counter
92 move.d CODE_LENGTH, $r4 ; length 92 move.d CODE_LENGTH, $r4 ; length
93 move.d TIMEOUT_VALUE, $r5 ; "timeout" until jump 93 move.d TIMEOUT_VALUE, $r5 ; "timeout" until jump
94 94
95wait_ser: 95wait_ser:
96 addq 1, $r1 96 addq 1, $r1
97 subq 1, $r5 ; decrease timeout 97 subq 1, $r5 ; decrease timeout
98 beq jump_start ; timed out 98 beq jump_start ; timed out
99 nop 99 nop
100#ifndef CONFIG_ETRAX_NO_LEDS 100#ifndef CONFIG_ETRAX_NO_LEDS
101#ifdef CONFIG_ETRAX_PA_LEDS 101#ifdef CONFIG_ETRAX_PA_LEDS
@@ -111,21 +111,21 @@ wait_ser:
111 or.d $r0, $r2 ; set bit 111 or.d $r0, $r2 ; set bit
112 ba 2f 112 ba 2f
113 nop 113 nop
1141: not $r0 ; clear bit 1141: not $r0 ; clear bit
115 and.d $r0, $r2 115 and.d $r0, $r2
1162: 1162:
117#ifdef CONFIG_ETRAX_PA_LEDS 117#ifdef CONFIG_ETRAX_PA_LEDS
118 move.b $r2, [R_PORT_PA_DATA] 118 move.b $r2, [R_PORT_PA_DATA]
119#endif 119#endif
120#ifdef CONFIG_ETRAX_PB_LEDS 120#ifdef CONFIG_ETRAX_PB_LEDS
121 move.b $r2, [R_PORT_PB_DATA] 121 move.b $r2, [R_PORT_PB_DATA]
122#endif 122#endif
123#endif 123#endif
124 124
125 ;; check if we got something on the serial port 125 ;; check if we got something on the serial port
126 126
127 move.b [SERSTAT], $r0 127 move.b [SERSTAT], $r0
128 btstq 0, $r0 ; data_avail 128 btstq 0, $r0 ; data_avail
129 bpl wait_ser 129 bpl wait_ser
130 nop 130 nop
131 131
@@ -134,7 +134,7 @@ wait_ser:
134 move.b [SERRDAT], $r0 134 move.b [SERRDAT], $r0
135 move.b $r0, [$r3+] 135 move.b $r0, [$r3+]
136 move.d TIMEOUT_VALUE, $r5 ; reset "timeout" 136 move.d TIMEOUT_VALUE, $r5 ; reset "timeout"
137 subq 1, $r4 ; decrease length 137 subq 1, $r4 ; decrease length
138 bne wait_ser 138 bne wait_ser
139 nop 139 nop
140jump_start: 140jump_start:
diff --git a/arch/cris/arch-v10/boot/rescue/testrescue.S b/arch/cris/arch-v10/boot/rescue/testrescue.S
index 566a9f341254..2d937f9afe23 100644
--- a/arch/cris/arch-v10/boot/rescue/testrescue.S
+++ b/arch/cris/arch-v10/boot/rescue/testrescue.S
@@ -1,13 +1,12 @@
1/* $Id: testrescue.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $ 1/*
2 *
3 * Simple testcode to download by the rescue block. 2 * Simple testcode to download by the rescue block.
4 * Just lits some LEDs to show it was downloaded correctly. 3 * Just lights some LEDs to show it was downloaded correctly.
5 * 4 *
6 * Copyright (C) 1999 Axis Communications AB 5 * Copyright (C) 1999 Axis Communications AB
7 */ 6 */
8 7
9#define ASSEMBLER_MACROS_ONLY 8#define ASSEMBLER_MACROS_ONLY
10#include <asm/sv_addr_ag.h> 9#include <asm/arch/sv_addr_ag.h>
11 10
12 .text 11 .text
13 12
@@ -16,11 +15,10 @@
16 moveq -1, $r2 15 moveq -1, $r2
17 move.b $r2, [R_PORT_PA_DIR] 16 move.b $r2, [R_PORT_PA_DIR]
18 moveq 0, $r2 17 moveq 0, $r2
19 move.b $r2, [R_PORT_PA_DATA] 18 move.b $r2, [R_PORT_PA_DATA]
20 19
21endless: 20endless:
22 nop 21 nop
23 ba endless 22 ba endless
24 nop 23 nop
25 24
26
diff --git a/arch/cris/arch-v10/drivers/Kconfig b/arch/cris/arch-v10/drivers/Kconfig
index 96740ef497d4..58f5864a6680 100644
--- a/arch/cris/arch-v10/drivers/Kconfig
+++ b/arch/cris/arch-v10/drivers/Kconfig
@@ -9,37 +9,6 @@ config ETRAX_ETHERNET
9 This option enables the ETRAX 100LX built-in 10/100Mbit Ethernet 9 This option enables the ETRAX 100LX built-in 10/100Mbit Ethernet
10 controller. 10 controller.
11 11
12choice
13 prompt "Network LED behavior"
14 depends on ETRAX_ETHERNET
15 default ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY
16
17config ETRAX_NETWORK_LED_ON_WHEN_LINK
18 bool "LED_on_when_link"
19 help
20 Selecting LED_on_when_link will light the LED when there is a
21 connection and will flash off when there is activity.
22
23 Selecting LED_on_when_activity will light the LED only when
24 there is activity.
25
26 This setting will also affect the behaviour of other activity LEDs
27 e.g. Bluetooth.
28
29config ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY
30 bool "LED_on_when_activity"
31 help
32 Selecting LED_on_when_link will light the LED when there is a
33 connection and will flash off when there is activity.
34
35 Selecting LED_on_when_activity will light the LED only when
36 there is activity.
37
38 This setting will also affect the behaviour of other activity LEDs
39 e.g. Bluetooth.
40
41endchoice
42
43config ETRAX_SERIAL 12config ETRAX_SERIAL
44 bool "Serial-port support" 13 bool "Serial-port support"
45 depends on ETRAX_ARCH_V10 14 depends on ETRAX_ARCH_V10
@@ -84,32 +53,6 @@ config ETRAX_SERIAL_PORT0
84 the same DMA channels. 53 the same DMA channels.
85 54
86choice 55choice
87 prompt "Ser0 DMA out assignment"
88 depends on ETRAX_SERIAL_PORT0
89 default ETRAX_SERIAL_PORT0_DMA6_OUT
90
91config ETRAX_SERIAL_PORT0_NO_DMA_OUT
92 bool "No DMA out"
93
94config ETRAX_SERIAL_PORT0_DMA6_OUT
95 bool "DMA 6"
96
97endchoice
98
99choice
100 prompt "Ser0 DMA in assignment"
101 depends on ETRAX_SERIAL_PORT0
102 default ETRAX_SERIAL_PORT0_DMA7_IN
103
104config ETRAX_SERIAL_PORT0_NO_DMA_IN
105 bool "No DMA in"
106
107config ETRAX_SERIAL_PORT0_DMA7_IN
108 bool "DMA 7"
109
110endchoice
111
112choice
113 prompt "Ser0 DTR, RI, DSR and CD assignment" 56 prompt "Ser0 DTR, RI, DSR and CD assignment"
114 depends on ETRAX_SERIAL_PORT0 57 depends on ETRAX_SERIAL_PORT0
115 default ETRAX_SER0_DTR_RI_DSR_CD_ON_NONE 58 default ETRAX_SER0_DTR_RI_DSR_CD_ON_NONE
@@ -198,32 +141,6 @@ config ETRAX_SERIAL_PORT1
198 Enables the ETRAX 100 serial driver for ser1 (ttyS1). 141 Enables the ETRAX 100 serial driver for ser1 (ttyS1).
199 142
200choice 143choice
201 prompt "Ser1 DMA out assignment"
202 depends on ETRAX_SERIAL_PORT1
203 default ETRAX_SERIAL_PORT1_DMA8_OUT
204
205config ETRAX_SERIAL_PORT1_NO_DMA_OUT
206 bool "No DMA out"
207
208config ETRAX_SERIAL_PORT1_DMA8_OUT
209 bool "DMA 8"
210
211endchoice
212
213choice
214 prompt "Ser1 DMA in assignment"
215 depends on ETRAX_SERIAL_PORT1
216 default ETRAX_SERIAL_PORT1_DMA9_IN
217
218config ETRAX_SERIAL_PORT1_NO_DMA_IN
219 bool "No DMA in"
220
221config ETRAX_SERIAL_PORT1_DMA9_IN
222 bool "DMA 9"
223
224endchoice
225
226choice
227 prompt "Ser1 DTR, RI, DSR and CD assignment" 144 prompt "Ser1 DTR, RI, DSR and CD assignment"
228 depends on ETRAX_SERIAL_PORT1 145 depends on ETRAX_SERIAL_PORT1
229 default ETRAX_SER1_DTR_RI_DSR_CD_ON_NONE 146 default ETRAX_SER1_DTR_RI_DSR_CD_ON_NONE
@@ -315,32 +232,6 @@ config ETRAX_SERIAL_PORT2
315 Enables the ETRAX 100 serial driver for ser2 (ttyS2). 232 Enables the ETRAX 100 serial driver for ser2 (ttyS2).
316 233
317choice 234choice
318 prompt "Ser2 DMA out assignment"
319 depends on ETRAX_SERIAL_PORT2
320 default ETRAX_SERIAL_PORT2_DMA2_OUT
321
322config ETRAX_SERIAL_PORT2_NO_DMA_OUT
323 bool "No DMA out"
324
325config ETRAX_SERIAL_PORT2_DMA2_OUT
326 bool "DMA 2"
327
328endchoice
329
330choice
331 prompt "Ser2 DMA in assignment"
332 depends on ETRAX_SERIAL_PORT2
333 default ETRAX_SERIAL_PORT2_DMA3_IN
334
335config ETRAX_SERIAL_PORT2_NO_DMA_IN
336 bool "No DMA in"
337
338config ETRAX_SERIAL_PORT2_DMA3_IN
339 bool "DMA 3"
340
341endchoice
342
343choice
344 prompt "Ser2 DTR, RI, DSR and CD assignment" 235 prompt "Ser2 DTR, RI, DSR and CD assignment"
345 depends on ETRAX_SERIAL_PORT2 236 depends on ETRAX_SERIAL_PORT2
346 default ETRAX_SER2_DTR_RI_DSR_CD_ON_NONE 237 default ETRAX_SER2_DTR_RI_DSR_CD_ON_NONE
@@ -429,32 +320,6 @@ config ETRAX_SERIAL_PORT3
429 Enables the ETRAX 100 serial driver for ser3 (ttyS3). 320 Enables the ETRAX 100 serial driver for ser3 (ttyS3).
430 321
431choice 322choice
432 prompt "Ser3 DMA out assignment"
433 depends on ETRAX_SERIAL_PORT3
434 default ETRAX_SERIAL_PORT3_DMA4_OUT
435
436config ETRAX_SERIAL_PORT3_NO_DMA_OUT
437 bool "No DMA out"
438
439config ETRAX_SERIAL_PORT3_DMA4_OUT
440 bool "DMA 4"
441
442endchoice
443
444choice
445 prompt "Ser3 DMA in assignment"
446 depends on ETRAX_SERIAL_PORT3
447 default ETRAX_SERIAL_PORT3_DMA5_IN
448
449config ETRAX_SERIAL_PORT3_NO_DMA_IN
450 bool "No DMA in"
451
452config ETRAX_SERIAL_PORT3_DMA5_IN
453 bool "DMA 5"
454
455endchoice
456
457choice
458 prompt "Ser3 DTR, RI, DSR and CD assignment" 323 prompt "Ser3 DTR, RI, DSR and CD assignment"
459 depends on ETRAX_SERIAL_PORT3 324 depends on ETRAX_SERIAL_PORT3
460 default ETRAX_SER3_DTR_RI_DSR_CD_ON_NONE 325 default ETRAX_SER3_DTR_RI_DSR_CD_ON_NONE
@@ -563,21 +428,6 @@ config ETRAX_USB_HOST_PORT2
563 depends on ETRAX_USB_HOST 428 depends on ETRAX_USB_HOST
564 default n 429 default n
565 430
566config ETRAX_AXISFLASHMAP
567 bool "Axis flash-map support"
568 depends on ETRAX_ARCH_V10
569 select MTD
570 select MTD_CFI
571 select MTD_CFI_AMDSTD
572 select MTD_CHAR
573 select MTD_BLOCK
574 select MTD_PARTITIONS
575 select MTD_CONCAT
576 select MTD_COMPLEX_MAPPINGS
577 help
578 This option enables MTD mapping of flash devices. Needed to use
579 flash memories. If unsure, say Y.
580
581config ETRAX_PTABLE_SECTOR 431config ETRAX_PTABLE_SECTOR
582 int "Byte-offset of partition table sector" 432 int "Byte-offset of partition table sector"
583 depends on ETRAX_AXISFLASHMAP 433 depends on ETRAX_AXISFLASHMAP
@@ -731,37 +581,6 @@ config ETRAX_PB_CHANGEABLE_BITS
731 Bit set = changeable. 581 Bit set = changeable.
732 You probably want 00 here. 582 You probably want 00 here.
733 583
734config ETRAX_RTC
735 bool "Real Time Clock support"
736 depends on ETRAX_ARCH_V10
737 help
738 Enables drivers for the Real-Time Clock battery-backed chips on
739 some products. The kernel reads the time when booting, and
740 the date can be set using ioctl(fd, RTC_SET_TIME, &rt) with rt a
741 rtc_time struct (see <file:include/asm-cris/rtc.h>) on the /dev/rtc
742 device, major 121. You can check the time with cat /proc/rtc, but
743 normal time reading should be done using libc function time and
744 friends.
745
746choice
747 prompt "RTC chip"
748 depends on ETRAX_RTC
749 default ETRAX_DS1302
750
751config ETRAX_DS1302
752 bool "DS1302"
753 help
754 Enables the driver for the DS1302 Real-Time Clock battery-backed
755 chip on some products.
756
757config ETRAX_PCF8563
758 bool "PCF8563"
759 help
760 Enables the driver for the PCF8563 Real-Time Clock battery-backed
761 chip on some products.
762
763endchoice
764
765config ETRAX_DS1302_RST_ON_GENERIC_PORT 584config ETRAX_DS1302_RST_ON_GENERIC_PORT
766 bool "DS1302 RST on Generic Port" 585 bool "DS1302 RST on Generic Port"
767 depends on ETRAX_DS1302 586 depends on ETRAX_DS1302
diff --git a/arch/cris/arch-v10/drivers/Makefile b/arch/cris/arch-v10/drivers/Makefile
index 20258e36f384..44bf2e88c26e 100644
--- a/arch/cris/arch-v10/drivers/Makefile
+++ b/arch/cris/arch-v10/drivers/Makefile
@@ -2,11 +2,11 @@
2# Makefile for Etrax-specific drivers 2# Makefile for Etrax-specific drivers
3# 3#
4 4
5obj-$(CONFIG_ETRAX_AXISFLASHMAP) += axisflashmap.o 5obj-$(CONFIG_ETRAX_AXISFLASHMAP) += axisflashmap.o
6obj-$(CONFIG_ETRAX_I2C) += i2c.o 6obj-$(CONFIG_ETRAX_I2C) += i2c.o
7obj-$(CONFIG_ETRAX_I2C_EEPROM) += eeprom.o 7obj-$(CONFIG_ETRAX_I2C_EEPROM) += eeprom.o
8obj-$(CONFIG_ETRAX_GPIO) += gpio.o 8obj-$(CONFIG_ETRAX_GPIO) += gpio.o
9obj-$(CONFIG_ETRAX_DS1302) += ds1302.o 9obj-$(CONFIG_ETRAX_DS1302) += ds1302.o
10obj-$(CONFIG_ETRAX_PCF8563) += pcf8563.o 10obj-$(CONFIG_ETRAX_PCF8563) += pcf8563.o
11 11obj-$(CONFIG_ETRAX_SYNCHRONOUS_SERIAL) += sync_serial.o
12 12
diff --git a/arch/cris/arch-v10/drivers/axisflashmap.c b/arch/cris/arch-v10/drivers/axisflashmap.c
index ea3cf2e39a14..b3bdda93ffef 100644
--- a/arch/cris/arch-v10/drivers/axisflashmap.c
+++ b/arch/cris/arch-v10/drivers/axisflashmap.c
@@ -10,129 +10,6 @@
10 * tells us what other partitions to define. If there isn't, we use a default 10 * tells us what other partitions to define. If there isn't, we use a default
11 * partition split defined below. 11 * partition split defined below.
12 * 12 *
13 * $Log: axisflashmap.c,v $
14 * Revision 1.11 2004/11/15 10:27:14 starvik
15 * Corrected typo (Thanks to Milton Miller <miltonm@bga.com>).
16 *
17 * Revision 1.10 2004/08/16 12:37:22 starvik
18 * Merge of Linux 2.6.8
19 *
20 * Revision 1.8 2004/05/14 07:58:03 starvik
21 * Merge of changes from 2.4
22 *
23 * Revision 1.6 2003/07/04 08:27:37 starvik
24 * Merge of Linux 2.5.74
25 *
26 * Revision 1.5 2002/12/11 13:13:57 starvik
27 * Added arch/ to v10 specific includes
28 * Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
29 *
30 * Revision 1.4 2002/11/20 11:56:10 starvik
31 * Merge of Linux 2.5.48
32 *
33 * Revision 1.3 2002/11/13 14:54:13 starvik
34 * Copied from linux 2.4
35 *
36 * Revision 1.28 2002/10/01 08:08:43 jonashg
37 * The first partition ends at the start of the partition table.
38 *
39 * Revision 1.27 2002/08/21 09:23:13 jonashg
40 * Speling.
41 *
42 * Revision 1.26 2002/08/21 08:35:20 jonashg
43 * Cosmetic change to printouts.
44 *
45 * Revision 1.25 2002/08/21 08:15:42 jonashg
46 * Made it compile even without CONFIG_MTD_CONCAT defined.
47 *
48 * Revision 1.24 2002/08/20 13:12:35 jonashg
49 * * New approach to probing. Probe cse0 and cse1 separately and (mtd)concat
50 * the results.
51 * * Removed compile time tests concerning how the mtdram driver has been
52 * configured. The user will know about the misconfiguration at runtime
53 * instead. (The old approach made it impossible to use mtdram for anything
54 * else than RAM boot).
55 *
56 * Revision 1.23 2002/05/13 12:12:28 johana
57 * Allow compile without CONFIG_MTD_MTDRAM but warn at compiletime and
58 * be informative at runtime.
59 *
60 * Revision 1.22 2002/05/13 10:24:44 johana
61 * Added #if checks on MTDRAM CONFIG
62 *
63 * Revision 1.21 2002/05/06 16:05:20 johana
64 * Removed debug printout.
65 *
66 * Revision 1.20 2002/05/06 16:03:00 johana
67 * No more cramfs as root hack in generic code.
68 * It's handled by axisflashmap using mtdram.
69 *
70 * Revision 1.19 2002/03/15 17:10:28 bjornw
71 * Changed comment about cached access since we changed this before
72 *
73 * Revision 1.18 2002/03/05 17:06:15 jonashg
74 * Try amd_flash probe before cfi_probe since amd_flash driver can handle two
75 * (or more) flash chips of different model and the cfi driver cannot.
76 *
77 * Revision 1.17 2001/11/12 19:42:38 pkj
78 * Fixed compiler warnings.
79 *
80 * Revision 1.16 2001/11/08 11:18:58 jonashg
81 * Always read from uncached address to avoid problems with flushing
82 * cachelines after write and MTD-erase. No performance loss have been
83 * seen yet.
84 *
85 * Revision 1.15 2001/10/19 12:41:04 jonashg
86 * Name of probe has changed in MTD.
87 *
88 * Revision 1.14 2001/09/21 07:14:10 jonashg
89 * Made root filesystem (cramfs) use mtdblock driver when booting from flash.
90 *
91 * Revision 1.13 2001/08/15 13:57:35 jonashg
92 * Entire MTD updated to the linux 2.4.7 version.
93 *
94 * Revision 1.12 2001/06/11 09:50:30 jonashg
95 * Oops, 2MB is 0x200000 bytes.
96 *
97 * Revision 1.11 2001/06/08 11:39:44 jonashg
98 * Changed sizes and offsets in axis_default_partitions to use
99 * CONFIG_ETRAX_PTABLE_SECTOR.
100 *
101 * Revision 1.10 2001/05/29 09:42:03 jonashg
102 * Use macro for end marker length instead of sizeof.
103 *
104 * Revision 1.9 2001/05/29 08:52:52 jonashg
105 * Gave names to the magic fours (size of the ptable end marker).
106 *
107 * Revision 1.8 2001/05/28 15:36:20 jonashg
108 * * Removed old comment about ptable location in flash (it's a CONFIG_ option).
109 * * Variable ptable was initialized twice to the same value.
110 *
111 * Revision 1.7 2001/04/05 13:41:46 markusl
112 * Updated according to review remarks
113 *
114 * Revision 1.6 2001/03/07 09:21:21 bjornw
115 * No need to waste .data
116 *
117 * Revision 1.5 2001/03/06 16:27:01 jonashg
118 * Probe the entire flash area for flash devices.
119 *
120 * Revision 1.4 2001/02/23 12:47:15 bjornw
121 * Uncached flash in LOW_MAP moved from 0xe to 0x8
122 *
123 * Revision 1.3 2001/02/16 12:11:45 jonashg
124 * MTD driver amd_flash is now included in MTD CVS repository.
125 * (It's now in drivers/mtd).
126 *
127 * Revision 1.2 2001/02/09 11:12:22 jonashg
128 * Support for AMD compatible non-CFI flash chips.
129 * Only tested with Toshiba TC58FVT160 so far.
130 *
131 * Revision 1.1 2001/01/12 17:01:18 bjornw
132 * * Added axisflashmap.c, a physical mapping for MTD that reads and understands
133 * Axis partition-table format.
134 *
135 *
136 */ 13 */
137 14
138#include <linux/module.h> 15#include <linux/module.h>
@@ -235,7 +112,7 @@ static struct map_info map_cse1 = {
235}; 112};
236 113
237/* If no partition-table was found, we use this default-set. */ 114/* If no partition-table was found, we use this default-set. */
238#define MAX_PARTITIONS 7 115#define MAX_PARTITIONS 7
239#define NUM_DEFAULT_PARTITIONS 3 116#define NUM_DEFAULT_PARTITIONS 3
240 117
241/* 118/*
@@ -300,6 +177,15 @@ static struct mtd_partition axis_partitions[MAX_PARTITIONS] = {
300 }, 177 },
301}; 178};
302 179
180#ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE
181/* Main flash device */
182static struct mtd_partition main_partition = {
183 .name = "main",
184 .size = 0,
185 .offset = 0
186};
187#endif
188
303/* 189/*
304 * Probe a chip select for AMD-compatible (JEDEC) or CFI-compatible flash 190 * Probe a chip select for AMD-compatible (JEDEC) or CFI-compatible flash
305 * chips in that order (because the amd_flash-driver is faster). 191 * chips in that order (because the amd_flash-driver is faster).
@@ -316,15 +202,14 @@ static struct mtd_info *probe_cs(struct map_info *map_cs)
316 mtd_cs = do_map_probe("cfi_probe", map_cs); 202 mtd_cs = do_map_probe("cfi_probe", map_cs);
317#endif 203#endif
318#ifdef CONFIG_MTD_JEDECPROBE 204#ifdef CONFIG_MTD_JEDECPROBE
319 if (!mtd_cs) { 205 if (!mtd_cs)
320 mtd_cs = do_map_probe("jedec_probe", map_cs); 206 mtd_cs = do_map_probe("jedec_probe", map_cs);
321 }
322#endif 207#endif
323 208
324 return mtd_cs; 209 return mtd_cs;
325} 210}
326 211
327/* 212/*
328 * Probe each chip select individually for flash chips. If there are chips on 213 * Probe each chip select individually for flash chips. If there are chips on
329 * both cse0 and cse1, the mtd_info structs will be concatenated to one struct 214 * both cse0 and cse1, the mtd_info structs will be concatenated to one struct
330 * so that MTD partitions can cross chip boundries. 215 * so that MTD partitions can cross chip boundries.
@@ -351,7 +236,7 @@ static struct mtd_info *flash_probe(void)
351 if (mtd_cse0 && mtd_cse1) { 236 if (mtd_cse0 && mtd_cse1) {
352#ifdef CONFIG_MTD_CONCAT 237#ifdef CONFIG_MTD_CONCAT
353 struct mtd_info *mtds[] = { mtd_cse0, mtd_cse1 }; 238 struct mtd_info *mtds[] = { mtd_cse0, mtd_cse1 };
354 239
355 /* Since the concatenation layer adds a small overhead we 240 /* Since the concatenation layer adds a small overhead we
356 * could try to figure out if the chips in cse0 and cse1 are 241 * could try to figure out if the chips in cse0 and cse1 are
357 * identical and reprobe the whole cse0+cse1 window. But since 242 * identical and reprobe the whole cse0+cse1 window. But since
@@ -372,7 +257,7 @@ static struct mtd_info *flash_probe(void)
372 257
373 /* The best we can do now is to only use what we found 258 /* The best we can do now is to only use what we found
374 * at cse0. 259 * at cse0.
375 */ 260 */
376 mtd_cse = mtd_cse0; 261 mtd_cse = mtd_cse0;
377 map_destroy(mtd_cse1); 262 map_destroy(mtd_cse1);
378 } 263 }
@@ -395,7 +280,7 @@ static int __init init_axis_flash(void)
395 struct partitiontable_head *ptable_head = NULL; 280 struct partitiontable_head *ptable_head = NULL;
396 struct partitiontable_entry *ptable; 281 struct partitiontable_entry *ptable;
397 int use_default_ptable = 1; /* Until proven otherwise. */ 282 int use_default_ptable = 1; /* Until proven otherwise. */
398 const char *pmsg = " /dev/flash%d at 0x%08x, size 0x%08x\n"; 283 const char pmsg[] = " /dev/flash%d at 0x%08x, size 0x%08x\n";
399 284
400 if (!(mymtd = flash_probe())) { 285 if (!(mymtd = flash_probe())) {
401 /* There's no reason to use this module if no flash chip can 286 /* There's no reason to use this module if no flash chip can
@@ -435,7 +320,7 @@ static int __init init_axis_flash(void)
435 unsigned long offset = CONFIG_ETRAX_PTABLE_SECTOR; 320 unsigned long offset = CONFIG_ETRAX_PTABLE_SECTOR;
436 unsigned char *p; 321 unsigned char *p;
437 unsigned long csum = 0; 322 unsigned long csum = 0;
438 323
439 ptable = (struct partitiontable_entry *) 324 ptable = (struct partitiontable_entry *)
440 ((unsigned long)ptable_head + sizeof(*ptable_head)); 325 ((unsigned long)ptable_head + sizeof(*ptable_head));
441 326
@@ -490,6 +375,16 @@ static int __init init_axis_flash(void)
490 pidx++; 375 pidx++;
491 } 376 }
492 377
378#ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE
379 if (mymtd) {
380 main_partition.size = mymtd->size;
381 err = add_mtd_partitions(mymtd, &main_partition, 1);
382 if (err)
383 panic("axisflashmap: Could not initialize "
384 "partition for whole main mtd device!\n");
385 }
386#endif
387
493 if (mymtd) { 388 if (mymtd) {
494 if (use_default_ptable) { 389 if (use_default_ptable) {
495 printk(KERN_INFO " Using default partition table.\n"); 390 printk(KERN_INFO " Using default partition table.\n");
@@ -499,9 +394,8 @@ static int __init init_axis_flash(void)
499 err = add_mtd_partitions(mymtd, axis_partitions, pidx); 394 err = add_mtd_partitions(mymtd, axis_partitions, pidx);
500 } 395 }
501 396
502 if (err) { 397 if (err)
503 panic("axisflashmap could not add MTD partitions!\n"); 398 panic("axisflashmap could not add MTD partitions!\n");
504 }
505 } 399 }
506 400
507 if (!romfs_in_flash) { 401 if (!romfs_in_flash) {
@@ -515,25 +409,24 @@ static int __init init_axis_flash(void)
515#else 409#else
516 struct mtd_info *mtd_ram; 410 struct mtd_info *mtd_ram;
517 411
518 mtd_ram = kmalloc(sizeof(struct mtd_info), 412 mtd_ram = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
519 GFP_KERNEL); 413 if (!mtd_ram)
520 if (!mtd_ram) {
521 panic("axisflashmap couldn't allocate memory for " 414 panic("axisflashmap couldn't allocate memory for "
522 "mtd_info!\n"); 415 "mtd_info!\n");
523 }
524 416
525 printk(KERN_INFO " Adding RAM partition for romfs image:\n"); 417 printk(KERN_INFO " Adding RAM partition for romfs image:\n");
526 printk(pmsg, pidx, romfs_start, romfs_length); 418 printk(pmsg, pidx, (unsigned)romfs_start,
527 419 (unsigned)romfs_length);
528 err = mtdram_init_device(mtd_ram, (void*)romfs_start, 420
529 romfs_length, "romfs"); 421 err = mtdram_init_device(mtd_ram,
530 if (err) { 422 (void *)romfs_start,
423 romfs_length,
424 "romfs");
425 if (err)
531 panic("axisflashmap could not initialize MTD RAM " 426 panic("axisflashmap could not initialize MTD RAM "
532 "device!\n"); 427 "device!\n");
533 }
534#endif 428#endif
535 } 429 }
536
537 return err; 430 return err;
538} 431}
539 432
diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c
index 1d1936a18133..c9aa3904be05 100644
--- a/arch/cris/arch-v10/drivers/ds1302.c
+++ b/arch/cris/arch-v10/drivers/ds1302.c
@@ -333,7 +333,7 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
333 ds1302_writereg(RTC_TRICKLECHARGER, tcs_val); 333 ds1302_writereg(RTC_TRICKLECHARGER, tcs_val);
334 return 0; 334 return 0;
335 } 335 }
336 case RTC_VLOW_RD: 336 case RTC_VL_READ:
337 { 337 {
338 /* TODO: 338 /* TODO:
339 * Implement voltage low detection support 339 * Implement voltage low detection support
@@ -342,7 +342,7 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
342 " is not supported\n"); 342 " is not supported\n");
343 return 0; 343 return 0;
344 } 344 }
345 case RTC_VLOW_SET: 345 case RTC_VL_CLR:
346 { 346 {
347 /* TODO: 347 /* TODO:
348 * Nothing to do since Voltage Low detection is not supported 348 * Nothing to do since Voltage Low detection is not supported
diff --git a/arch/cris/arch-v10/drivers/eeprom.c b/arch/cris/arch-v10/drivers/eeprom.c
index be35a70798aa..f1cac9dc75b8 100644
--- a/arch/cris/arch-v10/drivers/eeprom.c
+++ b/arch/cris/arch-v10/drivers/eeprom.c
@@ -19,77 +19,6 @@
19*! Sep 03 1999 Edgar Iglesias Added bail-out stuff if we get interrupted 19*! Sep 03 1999 Edgar Iglesias Added bail-out stuff if we get interrupted
20*! in the spin-lock. 20*! in the spin-lock.
21*! 21*!
22*! $Log: eeprom.c,v $
23*! Revision 1.12 2005/06/19 17:06:46 starvik
24*! Merge of Linux 2.6.12.
25*!
26*! Revision 1.11 2005/01/26 07:14:46 starvik
27*! Applied diff from kernel janitors (Nish Aravamudan).
28*!
29*! Revision 1.10 2003/09/11 07:29:48 starvik
30*! Merge of Linux 2.6.0-test5
31*!
32*! Revision 1.9 2003/07/04 08:27:37 starvik
33*! Merge of Linux 2.5.74
34*!
35*! Revision 1.8 2003/04/09 05:20:47 starvik
36*! Merge of Linux 2.5.67
37*!
38*! Revision 1.6 2003/02/10 07:19:28 starvik
39*! Removed misplaced ;
40*!
41*! Revision 1.5 2002/12/11 13:13:57 starvik
42*! Added arch/ to v10 specific includes
43*! Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
44*!
45*! Revision 1.4 2002/11/20 11:56:10 starvik
46*! Merge of Linux 2.5.48
47*!
48*! Revision 1.3 2002/11/18 13:16:06 starvik
49*! Linux 2.5 port of latest 2.4 drivers
50*!
51*! Revision 1.8 2001/06/15 13:24:29 jonashg
52*! * Added verification of pointers from userspace in read and write.
53*! * Made busy counter volatile.
54*! * Added define for initial write delay.
55*! * Removed warnings by using loff_t instead of unsigned long.
56*!
57*! Revision 1.7 2001/06/14 15:26:54 jonashg
58*! Removed test because condition is always true.
59*!
60*! Revision 1.6 2001/06/14 15:18:20 jonashg
61*! Kb -> kB (makes quite a difference if you don't know if you have 2k or 16k).
62*!
63*! Revision 1.5 2001/06/14 14:39:51 jonashg
64*! Forgot to use name when registering the driver.
65*!
66*! Revision 1.4 2001/06/14 14:35:47 jonashg
67*! * Gave driver a name and used it in printk's.
68*! * Cleanup.
69*!
70*! Revision 1.3 2001/03/19 16:04:46 markusl
71*! Fixed init of fops struct
72*!
73*! Revision 1.2 2001/03/19 10:35:07 markusl
74*! 2.4 port of eeprom driver
75*!
76*! Revision 1.8 2000/05/18 10:42:25 edgar
77*! Make sure to end write cycle on _every_ write
78*!
79*! Revision 1.7 2000/01/17 17:41:01 johana
80*! Adjusted probing and return -ENOSPC when writing outside EEPROM
81*!
82*! Revision 1.6 2000/01/17 15:50:36 johana
83*! Added adaptive timing adjustments and fixed autoprobing for 2k and 16k(?)
84*! EEPROMs
85*!
86*! Revision 1.5 1999/09/03 15:07:37 edgar
87*! Added bail-out check to the spinlock
88*!
89*! Revision 1.4 1999/09/03 12:11:17 bjornw
90*! Proper atomicity (need to use spinlocks, not if's). users -> busy.
91*!
92*!
93*! (c) 1999 Axis Communications AB, Lund, Sweden 22*! (c) 1999 Axis Communications AB, Lund, Sweden
94*!*****************************************************************************/ 23*!*****************************************************************************/
95 24
@@ -103,10 +32,10 @@
103#include <asm/uaccess.h> 32#include <asm/uaccess.h>
104#include "i2c.h" 33#include "i2c.h"
105 34
106#define D(x) 35#define D(x)
107 36
108/* If we should use adaptive timing or not: */ 37/* If we should use adaptive timing or not: */
109//#define EEPROM_ADAPTIVE_TIMING 38/* #define EEPROM_ADAPTIVE_TIMING */
110 39
111#define EEPROM_MAJOR_NR 122 /* use a LOCAL/EXPERIMENTAL major for now */ 40#define EEPROM_MAJOR_NR 122 /* use a LOCAL/EXPERIMENTAL major for now */
112#define EEPROM_MINOR_NR 0 41#define EEPROM_MINOR_NR 0
diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c
index 0d347a705835..68a998bd1069 100644
--- a/arch/cris/arch-v10/drivers/gpio.c
+++ b/arch/cris/arch-v10/drivers/gpio.c
@@ -1,138 +1,11 @@
1/* $Id: gpio.c,v 1.17 2005/06/19 17:06:46 starvik Exp $ 1/*
2 *
3 * Etrax general port I/O device 2 * Etrax general port I/O device
4 * 3 *
5 * Copyright (c) 1999, 2000, 2001, 2002 Axis Communications AB 4 * Copyright (c) 1999-2007 Axis Communications AB
6 * 5 *
7 * Authors: Bjorn Wesen (initial version) 6 * Authors: Bjorn Wesen (initial version)
8 * Ola Knutsson (LED handling) 7 * Ola Knutsson (LED handling)
9 * Johan Adolfsson (read/set directions, write, port G) 8 * Johan Adolfsson (read/set directions, write, port G)
10 *
11 * $Log: gpio.c,v $
12 * Revision 1.17 2005/06/19 17:06:46 starvik
13 * Merge of Linux 2.6.12.
14 *
15 * Revision 1.16 2005/03/07 13:02:29 starvik
16 * Protect driver global states with spinlock
17 *
18 * Revision 1.15 2005/01/05 06:08:55 starvik
19 * No need to do local_irq_disable after local_irq_save.
20 *
21 * Revision 1.14 2004/12/13 12:21:52 starvik
22 * Added I/O and DMA allocators from Linux 2.4
23 *
24 * Revision 1.12 2004/08/24 07:19:59 starvik
25 * Whitespace cleanup
26 *
27 * Revision 1.11 2004/05/14 07:58:03 starvik
28 * Merge of changes from 2.4
29 *
30 * Revision 1.9 2003/09/11 07:29:48 starvik
31 * Merge of Linux 2.6.0-test5
32 *
33 * Revision 1.8 2003/07/04 08:27:37 starvik
34 * Merge of Linux 2.5.74
35 *
36 * Revision 1.7 2003/01/10 07:44:07 starvik
37 * init_ioremap is now called by kernel before drivers are initialized
38 *
39 * Revision 1.6 2002/12/11 13:13:57 starvik
40 * Added arch/ to v10 specific includes
41 * Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
42 *
43 * Revision 1.5 2002/11/20 11:56:11 starvik
44 * Merge of Linux 2.5.48
45 *
46 * Revision 1.4 2002/11/18 10:10:05 starvik
47 * Linux 2.5 port of latest gpio.c from Linux 2.4
48 *
49 * Revision 1.20 2002/10/16 21:16:24 johana
50 * Added support for PA high level interrupt.
51 * That gives 2ms response time with iodtest for high levels and 2-12 ms
52 * response time on low levels if the check is not made in
53 * process.c:cpu_idle() as well.
54 *
55 * Revision 1.19 2002/10/14 18:27:33 johana
56 * Implemented alarm handling so select() now works.
57 * Latency is around 6-9 ms with a etrax_gpio_wake_up_check() in
58 * cpu_idle().
59 * Otherwise I get 15-18 ms (same as doing the poll in userspace -
60 * but less overhead).
61 * TODO? Perhaps we should add the check in IMMEDIATE_BH (or whatever it
62 * is in 2.4) as well?
63 * TODO? Perhaps call request_irq()/free_irq() only when needed?
64 * Increased version to 2.5
65 *
66 * Revision 1.18 2002/10/11 15:02:00 johana
67 * Mask inverted 8 bit value in setget_input().
68 *
69 * Revision 1.17 2002/06/17 15:53:01 johana
70 * Added IO_READ_INBITS, IO_READ_OUTBITS, IO_SETGET_INPUT and IO_SETGET_OUTPUT
71 * that take a pointer as argument and thus can handle 32 bit ports (G)
72 * correctly.
73 * These should be used instead of IO_READBITS, IO_SETINPUT and IO_SETOUTPUT.
74 * (especially if Port G bit 31 is used)
75 *
76 * Revision 1.16 2002/06/17 09:59:51 johana
77 * Returning 32 bit values in the ioctl return value doesn't work if bit
78 * 31 is set (could happen for port G), so mask it of with 0x7FFFFFFF.
79 * A new set of ioctl's will be added.
80 *
81 * Revision 1.15 2002/05/06 13:19:13 johana
82 * IO_SETINPUT returns mask with bit set = inputs for PA and PB as well.
83 *
84 * Revision 1.14 2002/04/12 12:01:53 johana
85 * Use global r_port_g_data_shadow.
86 * Moved gpio_init_port_g() closer to gpio_init() and marked it __init.
87 *
88 * Revision 1.13 2002/04/10 12:03:55 johana
89 * Added support for port G /dev/gpiog (minor 3).
90 * Changed indentation on switch cases.
91 * Fixed other spaces to tabs.
92 *
93 * Revision 1.12 2001/11/12 19:42:15 pkj
94 * * Corrected return values from gpio_leds_ioctl().
95 * * Fixed compiler warnings.
96 *
97 * Revision 1.11 2001/10/30 14:39:12 johana
98 * Added D() around gpio_write printk.
99 *
100 * Revision 1.10 2001/10/25 10:24:42 johana
101 * Added IO_CFG_WRITE_MODE ioctl and write method that can do fast
102 * bittoggling in the kernel. (This speeds up programming an FPGA with 450kB
103 * from ~60 seconds to 4 seconds).
104 * Added save_flags/cli/restore_flags in ioctl.
105 *
106 * Revision 1.9 2001/05/04 14:16:07 matsfg
107 * Corrected spelling error
108 *
109 * Revision 1.8 2001/04/27 13:55:26 matsfg
110 * Moved initioremap.
111 * Turns off all LEDS on init.
112 * Added support for shutdown and powerbutton.
113 *
114 * Revision 1.7 2001/04/04 13:30:08 matsfg
115 * Added bitset and bitclear for leds. Calls init_ioremap to set up memmapping
116 *
117 * Revision 1.6 2001/03/26 16:03:06 bjornw
118 * Needs linux/config.h
119 *
120 * Revision 1.5 2001/03/26 14:22:03 bjornw
121 * Namechange of some config options
122 *
123 * Revision 1.4 2001/02/27 13:52:48 bjornw
124 * malloc.h -> slab.h
125 *
126 * Revision 1.3 2001/01/24 15:06:48 bjornw
127 * gpio_wq correct type
128 *
129 * Revision 1.2 2001/01/18 16:07:30 bjornw
130 * 2.4 port
131 *
132 * Revision 1.1 2001/01/18 15:55:16 bjornw
133 * Verbatim copy of etraxgpio.c from elinux 2.0 added
134 *
135 *
136 */ 9 */
137 10
138 11
@@ -165,7 +38,7 @@ static int dp_cnt;
165#else 38#else
166#define DP(x) 39#define DP(x)
167#endif 40#endif
168 41
169static char gpio_name[] = "etrax gpio"; 42static char gpio_name[] = "etrax gpio";
170 43
171#if 0 44#if 0
@@ -173,9 +46,9 @@ static wait_queue_head_t *gpio_wq;
173#endif 46#endif
174 47
175static int gpio_ioctl(struct inode *inode, struct file *file, 48static int gpio_ioctl(struct inode *inode, struct file *file,
176 unsigned int cmd, unsigned long arg); 49 unsigned int cmd, unsigned long arg);
177static ssize_t gpio_write(struct file * file, const char * buf, size_t count, 50static ssize_t gpio_write(struct file *file, const char __user *buf,
178 loff_t *off); 51 size_t count, loff_t *off);
179static int gpio_open(struct inode *inode, struct file *filp); 52static int gpio_open(struct inode *inode, struct file *filp);
180static int gpio_release(struct inode *inode, struct file *filp); 53static int gpio_release(struct inode *inode, struct file *filp);
181static unsigned int gpio_poll(struct file *filp, struct poll_table_struct *wait); 54static unsigned int gpio_poll(struct file *filp, struct poll_table_struct *wait);
@@ -201,22 +74,22 @@ struct gpio_private {
201 74
202/* linked list of alarms to check for */ 75/* linked list of alarms to check for */
203 76
204static struct gpio_private *alarmlist = 0; 77static struct gpio_private *alarmlist;
205 78
206static int gpio_some_alarms = 0; /* Set if someone uses alarm */ 79static int gpio_some_alarms; /* Set if someone uses alarm */
207static unsigned long gpio_pa_irq_enabled_mask = 0; 80static unsigned long gpio_pa_irq_enabled_mask;
208 81
209static DEFINE_SPINLOCK(gpio_lock); /* Protect directions etc */ 82static DEFINE_SPINLOCK(gpio_lock); /* Protect directions etc */
210 83
211/* Port A and B use 8 bit access, but Port G is 32 bit */ 84/* Port A and B use 8 bit access, but Port G is 32 bit */
212#define NUM_PORTS (GPIO_MINOR_B+1) 85#define NUM_PORTS (GPIO_MINOR_B+1)
213 86
214static volatile unsigned char *ports[NUM_PORTS] = { 87static volatile unsigned char *ports[NUM_PORTS] = {
215 R_PORT_PA_DATA, 88 R_PORT_PA_DATA,
216 R_PORT_PB_DATA, 89 R_PORT_PB_DATA,
217}; 90};
218static volatile unsigned char *shads[NUM_PORTS] = { 91static volatile unsigned char *shads[NUM_PORTS] = {
219 &port_pa_data_shadow, 92 &port_pa_data_shadow,
220 &port_pb_data_shadow 93 &port_pb_data_shadow
221}; 94};
222 95
@@ -236,29 +109,29 @@ static volatile unsigned char *shads[NUM_PORTS] = {
236#endif 109#endif
237 110
238 111
239static unsigned char changeable_dir[NUM_PORTS] = { 112static unsigned char changeable_dir[NUM_PORTS] = {
240 CONFIG_ETRAX_PA_CHANGEABLE_DIR, 113 CONFIG_ETRAX_PA_CHANGEABLE_DIR,
241 CONFIG_ETRAX_PB_CHANGEABLE_DIR 114 CONFIG_ETRAX_PB_CHANGEABLE_DIR
242}; 115};
243static unsigned char changeable_bits[NUM_PORTS] = { 116static unsigned char changeable_bits[NUM_PORTS] = {
244 CONFIG_ETRAX_PA_CHANGEABLE_BITS, 117 CONFIG_ETRAX_PA_CHANGEABLE_BITS,
245 CONFIG_ETRAX_PB_CHANGEABLE_BITS 118 CONFIG_ETRAX_PB_CHANGEABLE_BITS
246}; 119};
247 120
248static volatile unsigned char *dir[NUM_PORTS] = { 121static volatile unsigned char *dir[NUM_PORTS] = {
249 R_PORT_PA_DIR, 122 R_PORT_PA_DIR,
250 R_PORT_PB_DIR 123 R_PORT_PB_DIR
251}; 124};
252 125
253static volatile unsigned char *dir_shadow[NUM_PORTS] = { 126static volatile unsigned char *dir_shadow[NUM_PORTS] = {
254 &port_pa_dir_shadow, 127 &port_pa_dir_shadow,
255 &port_pb_dir_shadow 128 &port_pb_dir_shadow
256}; 129};
257 130
258/* All bits in port g that can change dir. */ 131/* All bits in port g that can change dir. */
259static const unsigned long int changeable_dir_g_mask = 0x01FFFF01; 132static const unsigned long int changeable_dir_g_mask = 0x01FFFF01;
260 133
261/* Port G is 32 bit, handle it special, some bits are both inputs 134/* Port G is 32 bit, handle it special, some bits are both inputs
262 and outputs at the same time, only some of the bits can change direction 135 and outputs at the same time, only some of the bits can change direction
263 and some of them in groups of 8 bit. */ 136 and some of them in groups of 8 bit. */
264static unsigned long changeable_dir_g; 137static unsigned long changeable_dir_g;
@@ -269,18 +142,17 @@ static unsigned long dir_g_shadow; /* 1=output */
269#define USE_PORTS(priv) ((priv)->minor <= GPIO_MINOR_B) 142#define USE_PORTS(priv) ((priv)->minor <= GPIO_MINOR_B)
270 143
271 144
272 145static unsigned int gpio_poll(struct file *file, poll_table *wait)
273static unsigned int
274gpio_poll(struct file *file,
275 poll_table *wait)
276{ 146{
277 unsigned int mask = 0; 147 unsigned int mask = 0;
278 struct gpio_private *priv = (struct gpio_private *)file->private_data; 148 struct gpio_private *priv = file->private_data;
279 unsigned long data; 149 unsigned long data;
280 spin_lock(&gpio_lock); 150 unsigned long flags;
151
152 spin_lock_irqsave(&gpio_lock, flags);
153
281 poll_wait(file, &priv->alarm_wq, wait); 154 poll_wait(file, &priv->alarm_wq, wait);
282 if (priv->minor == GPIO_MINOR_A) { 155 if (priv->minor == GPIO_MINOR_A) {
283 unsigned long flags;
284 unsigned long tmp; 156 unsigned long tmp;
285 data = *R_PORT_PA_DATA; 157 data = *R_PORT_PA_DATA;
286 /* PA has support for high level interrupt - 158 /* PA has support for high level interrupt -
@@ -288,27 +160,25 @@ gpio_poll(struct file *file,
288 */ 160 */
289 tmp = ~data & priv->highalarm & 0xFF; 161 tmp = ~data & priv->highalarm & 0xFF;
290 tmp = (tmp << R_IRQ_MASK1_SET__pa0__BITNR); 162 tmp = (tmp << R_IRQ_MASK1_SET__pa0__BITNR);
291 local_irq_save(flags); 163
292 gpio_pa_irq_enabled_mask |= tmp; 164 gpio_pa_irq_enabled_mask |= tmp;
293 *R_IRQ_MASK1_SET = tmp; 165 *R_IRQ_MASK1_SET = tmp;
294 local_irq_restore(flags);
295
296 } else if (priv->minor == GPIO_MINOR_B) 166 } else if (priv->minor == GPIO_MINOR_B)
297 data = *R_PORT_PB_DATA; 167 data = *R_PORT_PB_DATA;
298 else if (priv->minor == GPIO_MINOR_G) 168 else if (priv->minor == GPIO_MINOR_G)
299 data = *R_PORT_G_DATA; 169 data = *R_PORT_G_DATA;
300 else { 170 else {
301 spin_unlock(&gpio_lock); 171 mask = 0;
302 return 0; 172 goto out;
303 } 173 }
304 174
305 if ((data & priv->highalarm) || 175 if ((data & priv->highalarm) ||
306 (~data & priv->lowalarm)) { 176 (~data & priv->lowalarm)) {
307 mask = POLLIN|POLLRDNORM; 177 mask = POLLIN|POLLRDNORM;
308 } 178 }
309 179
310 spin_unlock(&gpio_lock); 180out:
311 181 spin_unlock_irqrestore(&gpio_lock, flags);
312 DP(printk("gpio_poll ready: mask 0x%08X\n", mask)); 182 DP(printk("gpio_poll ready: mask 0x%08X\n", mask));
313 183
314 return mask; 184 return mask;
@@ -316,16 +186,19 @@ gpio_poll(struct file *file,
316 186
317int etrax_gpio_wake_up_check(void) 187int etrax_gpio_wake_up_check(void)
318{ 188{
319 struct gpio_private *priv = alarmlist; 189 struct gpio_private *priv;
320 unsigned long data = 0; 190 unsigned long data = 0;
321 int ret = 0; 191 int ret = 0;
322 spin_lock(&gpio_lock); 192 unsigned long flags;
193
194 spin_lock_irqsave(&gpio_lock, flags);
195 priv = alarmlist;
323 while (priv) { 196 while (priv) {
324 if (USE_PORTS(priv)) { 197 if (USE_PORTS(priv))
325 data = *priv->port; 198 data = *priv->port;
326 } else if (priv->minor == GPIO_MINOR_G) { 199 else if (priv->minor == GPIO_MINOR_G)
327 data = *R_PORT_G_DATA; 200 data = *R_PORT_G_DATA;
328 } 201
329 if ((data & priv->highalarm) || 202 if ((data & priv->highalarm) ||
330 (~data & priv->lowalarm)) { 203 (~data & priv->lowalarm)) {
331 DP(printk("etrax_gpio_wake_up_check %i\n",priv->minor)); 204 DP(printk("etrax_gpio_wake_up_check %i\n",priv->minor));
@@ -334,12 +207,12 @@ int etrax_gpio_wake_up_check(void)
334 } 207 }
335 priv = priv->next; 208 priv = priv->next;
336 } 209 }
337 spin_unlock(&gpio_lock); 210 spin_unlock_irqrestore(&gpio_lock, flags);
338 return ret; 211 return ret;
339} 212}
340 213
341static irqreturn_t 214static irqreturn_t
342gpio_poll_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 215gpio_poll_timer_interrupt(int irq, void *dev_id)
343{ 216{
344 if (gpio_some_alarms) { 217 if (gpio_some_alarms) {
345 etrax_gpio_wake_up_check(); 218 etrax_gpio_wake_up_check();
@@ -349,10 +222,13 @@ gpio_poll_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
349} 222}
350 223
351static irqreturn_t 224static irqreturn_t
352gpio_pa_interrupt(int irq, void *dev_id, struct pt_regs *regs) 225gpio_interrupt(int irq, void *dev_id)
353{ 226{
354 unsigned long tmp; 227 unsigned long tmp;
355 spin_lock(&gpio_lock); 228 unsigned long flags;
229
230 spin_lock_irqsave(&gpio_lock, flags);
231
356 /* Find what PA interrupts are active */ 232 /* Find what PA interrupts are active */
357 tmp = (*R_IRQ_READ1); 233 tmp = (*R_IRQ_READ1);
358 234
@@ -363,75 +239,70 @@ gpio_pa_interrupt(int irq, void *dev_id, struct pt_regs *regs)
363 *R_IRQ_MASK1_CLR = tmp; 239 *R_IRQ_MASK1_CLR = tmp;
364 gpio_pa_irq_enabled_mask &= ~tmp; 240 gpio_pa_irq_enabled_mask &= ~tmp;
365 241
366 spin_unlock(&gpio_lock); 242 spin_unlock_irqrestore(&gpio_lock, flags);
367 243
368 if (gpio_some_alarms) { 244 if (gpio_some_alarms)
369 return IRQ_RETVAL(etrax_gpio_wake_up_check()); 245 return IRQ_RETVAL(etrax_gpio_wake_up_check());
370 } 246
371 return IRQ_NONE; 247 return IRQ_NONE;
372} 248}
373 249
250static void gpio_write_bit(struct gpio_private *priv,
251 unsigned char data, int bit)
252{
253 *priv->port = *priv->shadow &= ~(priv->clk_mask);
254 if (data & 1 << bit)
255 *priv->port = *priv->shadow |= priv->data_mask;
256 else
257 *priv->port = *priv->shadow &= ~(priv->data_mask);
258
259 /* For FPGA: min 5.0ns (DCC) before CCLK high */
260 *priv->port = *priv->shadow |= priv->clk_mask;
261}
374 262
375static ssize_t gpio_write(struct file * file, const char * buf, size_t count, 263static void gpio_write_byte(struct gpio_private *priv, unsigned char data)
376 loff_t *off)
377{ 264{
378 struct gpio_private *priv = (struct gpio_private *)file->private_data; 265 int i;
379 unsigned char data, clk_mask, data_mask, write_msb;
380 unsigned long flags;
381 266
382 spin_lock(&gpio_lock); 267 if (priv->write_msb)
268 for (i = 7; i >= 0; i--)
269 gpio_write_bit(priv, data, i);
270 else
271 for (i = 0; i <= 7; i++)
272 gpio_write_bit(priv, data, i);
273}
383 274
275static ssize_t gpio_write(struct file *file, const char __user *buf,
276 size_t count, loff_t *off)
277{
278 struct gpio_private *priv = file->private_data;
279 unsigned long flags;
384 ssize_t retval = count; 280 ssize_t retval = count;
385 if (priv->minor !=GPIO_MINOR_A && priv->minor != GPIO_MINOR_B) { 281
386 retval = -EFAULT; 282 if (priv->minor != GPIO_MINOR_A && priv->minor != GPIO_MINOR_B)
387 goto out; 283 return -EFAULT;
388 } 284
389 285 if (!access_ok(VERIFY_READ, buf, count))
390 if (!access_ok(VERIFY_READ, buf, count)) { 286 return -EFAULT;
391 retval = -EFAULT; 287
392 goto out; 288 spin_lock_irqsave(&gpio_lock, flags);
393 } 289
394 clk_mask = priv->clk_mask;
395 data_mask = priv->data_mask;
396 /* It must have been configured using the IO_CFG_WRITE_MODE */ 290 /* It must have been configured using the IO_CFG_WRITE_MODE */
397 /* Perhaps a better error code? */ 291 /* Perhaps a better error code? */
398 if (clk_mask == 0 || data_mask == 0) { 292 if (priv->clk_mask == 0 || priv->data_mask == 0) {
399 retval = -EPERM; 293 retval = -EPERM;
400 goto out; 294 goto out;
401 } 295 }
402 write_msb = priv->write_msb; 296
403 D(printk("gpio_write: %lu to data 0x%02X clk 0x%02X msb: %i\n",count, data_mask, clk_mask, write_msb)); 297 D(printk(KERN_DEBUG "gpio_write: %02X to data 0x%02X "
404 while (count--) { 298 "clk 0x%02X msb: %i\n",
405 int i; 299 count, priv->data_mask, priv->clk_mask, priv->write_msb));
406 data = *buf++; 300
407 if (priv->write_msb) { 301 while (count--)
408 for (i = 7; i >= 0;i--) { 302 gpio_write_byte(priv, *buf++);
409 local_irq_save(flags); 303
410 *priv->port = *priv->shadow &= ~clk_mask;
411 if (data & 1<<i)
412 *priv->port = *priv->shadow |= data_mask;
413 else
414 *priv->port = *priv->shadow &= ~data_mask;
415 /* For FPGA: min 5.0ns (DCC) before CCLK high */
416 *priv->port = *priv->shadow |= clk_mask;
417 local_irq_restore(flags);
418 }
419 } else {
420 for (i = 0; i <= 7;i++) {
421 local_irq_save(flags);
422 *priv->port = *priv->shadow &= ~clk_mask;
423 if (data & 1<<i)
424 *priv->port = *priv->shadow |= data_mask;
425 else
426 *priv->port = *priv->shadow &= ~data_mask;
427 /* For FPGA: min 5.0ns (DCC) before CCLK high */
428 *priv->port = *priv->shadow |= clk_mask;
429 local_irq_restore(flags);
430 }
431 }
432 }
433out: 304out:
434 spin_unlock(&gpio_lock); 305 spin_unlock_irqrestore(&gpio_lock, flags);
435 return retval; 306 return retval;
436} 307}
437 308
@@ -442,22 +313,20 @@ gpio_open(struct inode *inode, struct file *filp)
442{ 313{
443 struct gpio_private *priv; 314 struct gpio_private *priv;
444 int p = iminor(inode); 315 int p = iminor(inode);
316 unsigned long flags;
445 317
446 if (p > GPIO_MINOR_LAST) 318 if (p > GPIO_MINOR_LAST)
447 return -EINVAL; 319 return -EINVAL;
448 320
449 priv = kmalloc(sizeof(struct gpio_private), 321 priv = kzalloc(sizeof(struct gpio_private), GFP_KERNEL);
450 GFP_KERNEL);
451 322
452 if (!priv) 323 if (!priv)
453 return -ENOMEM; 324 return -ENOMEM;
454 325
455 priv->minor = p; 326 priv->minor = p;
456 327
457 /* initialize the io/alarm struct and link it into our alarmlist */ 328 /* initialize the io/alarm struct */
458 329
459 priv->next = alarmlist;
460 alarmlist = priv;
461 if (USE_PORTS(priv)) { /* A and B */ 330 if (USE_PORTS(priv)) { /* A and B */
462 priv->port = ports[p]; 331 priv->port = ports[p];
463 priv->shadow = shads[p]; 332 priv->shadow = shads[p];
@@ -480,7 +349,13 @@ gpio_open(struct inode *inode, struct file *filp)
480 priv->data_mask = 0; 349 priv->data_mask = 0;
481 init_waitqueue_head(&priv->alarm_wq); 350 init_waitqueue_head(&priv->alarm_wq);
482 351
483 filp->private_data = (void *)priv; 352 filp->private_data = priv;
353
354 /* link it into our alarmlist */
355 spin_lock_irqsave(&gpio_lock, flags);
356 priv->next = alarmlist;
357 alarmlist = priv;
358 spin_unlock_irqrestore(&gpio_lock, flags);
484 359
485 return 0; 360 return 0;
486} 361}
@@ -490,11 +365,12 @@ gpio_release(struct inode *inode, struct file *filp)
490{ 365{
491 struct gpio_private *p; 366 struct gpio_private *p;
492 struct gpio_private *todel; 367 struct gpio_private *todel;
368 unsigned long flags;
493 369
494 spin_lock(&gpio_lock); 370 spin_lock_irqsave(&gpio_lock, flags);
495 371
496 p = alarmlist; 372 p = alarmlist;
497 todel = (struct gpio_private *)filp->private_data; 373 todel = filp->private_data;
498 374
499 /* unlink from alarmlist and free the private structure */ 375 /* unlink from alarmlist and free the private structure */
500 376
@@ -512,123 +388,114 @@ gpio_release(struct inode *inode, struct file *filp)
512 while (p) { 388 while (p) {
513 if (p->highalarm | p->lowalarm) { 389 if (p->highalarm | p->lowalarm) {
514 gpio_some_alarms = 1; 390 gpio_some_alarms = 1;
515 spin_unlock(&gpio_lock); 391 goto out;
516 return 0;
517 } 392 }
518 p = p->next; 393 p = p->next;
519 } 394 }
520 gpio_some_alarms = 0; 395 gpio_some_alarms = 0;
521 spin_unlock(&gpio_lock); 396out:
397 spin_unlock_irqrestore(&gpio_lock, flags);
522 return 0; 398 return 0;
523} 399}
524 400
525/* Main device API. ioctl's to read/set/clear bits, as well as to 401/* Main device API. ioctl's to read/set/clear bits, as well as to
526 * set alarms to wait for using a subsequent select(). 402 * set alarms to wait for using a subsequent select().
527 */ 403 */
528
529unsigned long inline setget_input(struct gpio_private *priv, unsigned long arg) 404unsigned long inline setget_input(struct gpio_private *priv, unsigned long arg)
530{ 405{
531 /* Set direction 0=unchanged 1=input, 406 /* Set direction 0=unchanged 1=input,
532 * return mask with 1=input 407 * return mask with 1=input */
533 */
534 unsigned long flags;
535 if (USE_PORTS(priv)) { 408 if (USE_PORTS(priv)) {
536 local_irq_save(flags); 409 *priv->dir = *priv->dir_shadow &=
537 *priv->dir = *priv->dir_shadow &=
538 ~((unsigned char)arg & priv->changeable_dir); 410 ~((unsigned char)arg & priv->changeable_dir);
539 local_irq_restore(flags);
540 return ~(*priv->dir_shadow) & 0xFF; /* Only 8 bits */ 411 return ~(*priv->dir_shadow) & 0xFF; /* Only 8 bits */
541 } else if (priv->minor == GPIO_MINOR_G) { 412 }
542 /* We must fiddle with R_GEN_CONFIG to change dir */ 413
543 local_irq_save(flags); 414 if (priv->minor != GPIO_MINOR_G)
544 if (((arg & dir_g_in_bits) != arg) && 415 return 0;
545 (arg & changeable_dir_g)) { 416
546 arg &= changeable_dir_g; 417 /* We must fiddle with R_GEN_CONFIG to change dir */
547 /* Clear bits in genconfig to set to input */ 418 if (((arg & dir_g_in_bits) != arg) &&
548 if (arg & (1<<0)) { 419 (arg & changeable_dir_g)) {
549 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG,g0dir); 420 arg &= changeable_dir_g;
550 dir_g_in_bits |= (1<<0); 421 /* Clear bits in genconfig to set to input */
551 dir_g_out_bits &= ~(1<<0); 422 if (arg & (1<<0)) {
552 } 423 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, g0dir);
553 if ((arg & 0x0000FF00) == 0x0000FF00) { 424 dir_g_in_bits |= (1<<0);
554 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG,g8_15dir); 425 dir_g_out_bits &= ~(1<<0);
555 dir_g_in_bits |= 0x0000FF00;
556 dir_g_out_bits &= ~0x0000FF00;
557 }
558 if ((arg & 0x00FF0000) == 0x00FF0000) {
559 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG,g16_23dir);
560 dir_g_in_bits |= 0x00FF0000;
561 dir_g_out_bits &= ~0x00FF0000;
562 }
563 if (arg & (1<<24)) {
564 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG,g24dir);
565 dir_g_in_bits |= (1<<24);
566 dir_g_out_bits &= ~(1<<24);
567 }
568 D(printk(KERN_INFO "gpio: SETINPUT on port G set "
569 "genconfig to 0x%08lX "
570 "in_bits: 0x%08lX "
571 "out_bits: 0x%08lX\n",
572 (unsigned long)genconfig_shadow,
573 dir_g_in_bits, dir_g_out_bits));
574 *R_GEN_CONFIG = genconfig_shadow;
575 /* Must be a >120 ns delay before writing this again */
576
577 } 426 }
578 local_irq_restore(flags); 427 if ((arg & 0x0000FF00) == 0x0000FF00) {
579 return dir_g_in_bits; 428 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, g8_15dir);
429 dir_g_in_bits |= 0x0000FF00;
430 dir_g_out_bits &= ~0x0000FF00;
431 }
432 if ((arg & 0x00FF0000) == 0x00FF0000) {
433 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, g16_23dir);
434 dir_g_in_bits |= 0x00FF0000;
435 dir_g_out_bits &= ~0x00FF0000;
436 }
437 if (arg & (1<<24)) {
438 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, g24dir);
439 dir_g_in_bits |= (1<<24);
440 dir_g_out_bits &= ~(1<<24);
441 }
442 D(printk(KERN_DEBUG "gpio: SETINPUT on port G set "
443 "genconfig to 0x%08lX "
444 "in_bits: 0x%08lX "
445 "out_bits: 0x%08lX\n",
446 (unsigned long)genconfig_shadow,
447 dir_g_in_bits, dir_g_out_bits));
448 *R_GEN_CONFIG = genconfig_shadow;
449 /* Must be a >120 ns delay before writing this again */
450
580 } 451 }
581 return 0; 452 return dir_g_in_bits;
582} /* setget_input */ 453} /* setget_input */
583 454
584unsigned long inline setget_output(struct gpio_private *priv, unsigned long arg) 455unsigned long inline setget_output(struct gpio_private *priv, unsigned long arg)
585{ 456{
586 unsigned long flags;
587 if (USE_PORTS(priv)) { 457 if (USE_PORTS(priv)) {
588 local_irq_save(flags); 458 *priv->dir = *priv->dir_shadow |=
589 *priv->dir = *priv->dir_shadow |= 459 ((unsigned char)arg & priv->changeable_dir);
590 ((unsigned char)arg & priv->changeable_dir);
591 local_irq_restore(flags);
592 return *priv->dir_shadow; 460 return *priv->dir_shadow;
593 } else if (priv->minor == GPIO_MINOR_G) { 461 }
594 /* We must fiddle with R_GEN_CONFIG to change dir */ 462 if (priv->minor != GPIO_MINOR_G)
595 local_irq_save(flags); 463 return 0;
596 if (((arg & dir_g_out_bits) != arg) && 464
597 (arg & changeable_dir_g)) { 465 /* We must fiddle with R_GEN_CONFIG to change dir */
598 /* Set bits in genconfig to set to output */ 466 if (((arg & dir_g_out_bits) != arg) &&
599 if (arg & (1<<0)) { 467 (arg & changeable_dir_g)) {
600 genconfig_shadow |= IO_MASK(R_GEN_CONFIG,g0dir); 468 /* Set bits in genconfig to set to output */
601 dir_g_out_bits |= (1<<0); 469 if (arg & (1<<0)) {
602 dir_g_in_bits &= ~(1<<0); 470 genconfig_shadow |= IO_MASK(R_GEN_CONFIG, g0dir);
603 } 471 dir_g_out_bits |= (1<<0);
604 if ((arg & 0x0000FF00) == 0x0000FF00) { 472 dir_g_in_bits &= ~(1<<0);
605 genconfig_shadow |= IO_MASK(R_GEN_CONFIG,g8_15dir);
606 dir_g_out_bits |= 0x0000FF00;
607 dir_g_in_bits &= ~0x0000FF00;
608 }
609 if ((arg & 0x00FF0000) == 0x00FF0000) {
610 genconfig_shadow |= IO_MASK(R_GEN_CONFIG,g16_23dir);
611 dir_g_out_bits |= 0x00FF0000;
612 dir_g_in_bits &= ~0x00FF0000;
613 }
614 if (arg & (1<<24)) {
615 genconfig_shadow |= IO_MASK(R_GEN_CONFIG,g24dir);
616 dir_g_out_bits |= (1<<24);
617 dir_g_in_bits &= ~(1<<24);
618 }
619 D(printk(KERN_INFO "gpio: SETOUTPUT on port G set "
620 "genconfig to 0x%08lX "
621 "in_bits: 0x%08lX "
622 "out_bits: 0x%08lX\n",
623 (unsigned long)genconfig_shadow,
624 dir_g_in_bits, dir_g_out_bits));
625 *R_GEN_CONFIG = genconfig_shadow;
626 /* Must be a >120 ns delay before writing this again */
627 } 473 }
628 local_irq_restore(flags); 474 if ((arg & 0x0000FF00) == 0x0000FF00) {
629 return dir_g_out_bits & 0x7FFFFFFF; 475 genconfig_shadow |= IO_MASK(R_GEN_CONFIG, g8_15dir);
476 dir_g_out_bits |= 0x0000FF00;
477 dir_g_in_bits &= ~0x0000FF00;
478 }
479 if ((arg & 0x00FF0000) == 0x00FF0000) {
480 genconfig_shadow |= IO_MASK(R_GEN_CONFIG, g16_23dir);
481 dir_g_out_bits |= 0x00FF0000;
482 dir_g_in_bits &= ~0x00FF0000;
483 }
484 if (arg & (1<<24)) {
485 genconfig_shadow |= IO_MASK(R_GEN_CONFIG, g24dir);
486 dir_g_out_bits |= (1<<24);
487 dir_g_in_bits &= ~(1<<24);
488 }
489 D(printk(KERN_INFO "gpio: SETOUTPUT on port G set "
490 "genconfig to 0x%08lX "
491 "in_bits: 0x%08lX "
492 "out_bits: 0x%08lX\n",
493 (unsigned long)genconfig_shadow,
494 dir_g_in_bits, dir_g_out_bits));
495 *R_GEN_CONFIG = genconfig_shadow;
496 /* Must be a >120 ns delay before writing this again */
630 } 497 }
631 return 0; 498 return dir_g_out_bits & 0x7FFFFFFF;
632} /* setget_output */ 499} /* setget_output */
633 500
634static int 501static int
@@ -642,12 +509,11 @@ gpio_ioctl(struct inode *inode, struct file *file,
642 unsigned long val; 509 unsigned long val;
643 int ret = 0; 510 int ret = 0;
644 511
645 struct gpio_private *priv = (struct gpio_private *)file->private_data; 512 struct gpio_private *priv = file->private_data;
646 if (_IOC_TYPE(cmd) != ETRAXGPIO_IOCTYPE) { 513 if (_IOC_TYPE(cmd) != ETRAXGPIO_IOCTYPE)
647 return -EINVAL; 514 return -EINVAL;
648 }
649 515
650 spin_lock(&gpio_lock); 516 spin_lock_irqsave(&gpio_lock, flags);
651 517
652 switch (_IOC_NR(cmd)) { 518 switch (_IOC_NR(cmd)) {
653 case IO_READBITS: /* Use IO_READ_INBITS and IO_READ_OUTBITS instead */ 519 case IO_READBITS: /* Use IO_READ_INBITS and IO_READ_OUTBITS instead */
@@ -659,7 +525,6 @@ gpio_ioctl(struct inode *inode, struct file *file,
659 } 525 }
660 break; 526 break;
661 case IO_SETBITS: 527 case IO_SETBITS:
662 local_irq_save(flags);
663 // set changeable bits with a 1 in arg 528 // set changeable bits with a 1 in arg
664 if (USE_PORTS(priv)) { 529 if (USE_PORTS(priv)) {
665 *priv->port = *priv->shadow |= 530 *priv->port = *priv->shadow |=
@@ -667,10 +532,8 @@ gpio_ioctl(struct inode *inode, struct file *file,
667 } else if (priv->minor == GPIO_MINOR_G) { 532 } else if (priv->minor == GPIO_MINOR_G) {
668 *R_PORT_G_DATA = port_g_data_shadow |= (arg & dir_g_out_bits); 533 *R_PORT_G_DATA = port_g_data_shadow |= (arg & dir_g_out_bits);
669 } 534 }
670 local_irq_restore(flags);
671 break; 535 break;
672 case IO_CLRBITS: 536 case IO_CLRBITS:
673 local_irq_save(flags);
674 // clear changeable bits with a 1 in arg 537 // clear changeable bits with a 1 in arg
675 if (USE_PORTS(priv)) { 538 if (USE_PORTS(priv)) {
676 *priv->port = *priv->shadow &= 539 *priv->port = *priv->shadow &=
@@ -678,7 +541,6 @@ gpio_ioctl(struct inode *inode, struct file *file,
678 } else if (priv->minor == GPIO_MINOR_G) { 541 } else if (priv->minor == GPIO_MINOR_G) {
679 *R_PORT_G_DATA = port_g_data_shadow &= ~((unsigned long)arg & dir_g_out_bits); 542 *R_PORT_G_DATA = port_g_data_shadow &= ~((unsigned long)arg & dir_g_out_bits);
680 } 543 }
681 local_irq_restore(flags);
682 break; 544 break;
683 case IO_HIGHALARM: 545 case IO_HIGHALARM:
684 // set alarm when bits with 1 in arg go high 546 // set alarm when bits with 1 in arg go high
@@ -698,6 +560,8 @@ gpio_ioctl(struct inode *inode, struct file *file,
698 /* Must update gpio_some_alarms */ 560 /* Must update gpio_some_alarms */
699 struct gpio_private *p = alarmlist; 561 struct gpio_private *p = alarmlist;
700 int some_alarms; 562 int some_alarms;
563 spin_lock_irq(&gpio_lock);
564 p = alarmlist;
701 some_alarms = 0; 565 some_alarms = 0;
702 while (p) { 566 while (p) {
703 if (p->highalarm | p->lowalarm) { 567 if (p->highalarm | p->lowalarm) {
@@ -707,6 +571,7 @@ gpio_ioctl(struct inode *inode, struct file *file,
707 p = p->next; 571 p = p->next;
708 } 572 }
709 gpio_some_alarms = some_alarms; 573 gpio_some_alarms = some_alarms;
574 spin_unlock_irq(&gpio_lock);
710 } 575 }
711 break; 576 break;
712 case IO_READDIR: /* Use IO_SETGET_INPUT/OUTPUT instead! */ 577 case IO_READDIR: /* Use IO_SETGET_INPUT/OUTPUT instead! */
@@ -766,7 +631,7 @@ gpio_ioctl(struct inode *inode, struct file *file,
766 } else if (priv->minor == GPIO_MINOR_G) { 631 } else if (priv->minor == GPIO_MINOR_G) {
767 val = *R_PORT_G_DATA; 632 val = *R_PORT_G_DATA;
768 } 633 }
769 if (copy_to_user((unsigned long*)arg, &val, sizeof(val))) 634 if (copy_to_user((void __user *)arg, &val, sizeof(val)))
770 ret = -EFAULT; 635 ret = -EFAULT;
771 break; 636 break;
772 case IO_READ_OUTBITS: 637 case IO_READ_OUTBITS:
@@ -776,33 +641,32 @@ gpio_ioctl(struct inode *inode, struct file *file,
776 } else if (priv->minor == GPIO_MINOR_G) { 641 } else if (priv->minor == GPIO_MINOR_G) {
777 val = port_g_data_shadow; 642 val = port_g_data_shadow;
778 } 643 }
779 if (copy_to_user((unsigned long*)arg, &val, sizeof(val))) 644 if (copy_to_user((void __user *)arg, &val, sizeof(val)))
780 ret = -EFAULT; 645 ret = -EFAULT;
781 break; 646 break;
782 case IO_SETGET_INPUT: 647 case IO_SETGET_INPUT:
783 /* bits set in *arg is set to input, 648 /* bits set in *arg is set to input,
784 * *arg updated with current input pins. 649 * *arg updated with current input pins.
785 */ 650 */
786 if (copy_from_user(&val, (unsigned long*)arg, sizeof(val))) 651 if (copy_from_user(&val, (void __user *)arg, sizeof(val)))
787 { 652 {
788 ret = -EFAULT; 653 ret = -EFAULT;
789 break; 654 break;
790 } 655 }
791 val = setget_input(priv, val); 656 val = setget_input(priv, val);
792 if (copy_to_user((unsigned long*)arg, &val, sizeof(val))) 657 if (copy_to_user((void __user *)arg, &val, sizeof(val)))
793 ret = -EFAULT; 658 ret = -EFAULT;
794 break; 659 break;
795 case IO_SETGET_OUTPUT: 660 case IO_SETGET_OUTPUT:
796 /* bits set in *arg is set to output, 661 /* bits set in *arg is set to output,
797 * *arg updated with current output pins. 662 * *arg updated with current output pins.
798 */ 663 */
799 if (copy_from_user(&val, (unsigned long*)arg, sizeof(val))) 664 if (copy_from_user(&val, (void __user *)arg, sizeof(val))) {
800 {
801 ret = -EFAULT; 665 ret = -EFAULT;
802 break; 666 break;
803 } 667 }
804 val = setget_output(priv, val); 668 val = setget_output(priv, val);
805 if (copy_to_user((unsigned long*)arg, &val, sizeof(val))) 669 if (copy_to_user((void __user *)arg, &val, sizeof(val)))
806 ret = -EFAULT; 670 ret = -EFAULT;
807 break; 671 break;
808 default: 672 default:
@@ -812,7 +676,7 @@ gpio_ioctl(struct inode *inode, struct file *file,
812 ret = -EINVAL; 676 ret = -EINVAL;
813 } /* switch */ 677 } /* switch */
814 678
815 spin_unlock(&gpio_lock); 679 spin_unlock_irqrestore(&gpio_lock, flags);
816 return ret; 680 return ret;
817} 681}
818 682
@@ -824,18 +688,18 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
824 688
825 switch (_IOC_NR(cmd)) { 689 switch (_IOC_NR(cmd)) {
826 case IO_LEDACTIVE_SET: 690 case IO_LEDACTIVE_SET:
827 green = ((unsigned char) arg) & 1; 691 green = ((unsigned char)arg) & 1;
828 red = (((unsigned char) arg) >> 1) & 1; 692 red = (((unsigned char)arg) >> 1) & 1;
829 LED_ACTIVE_SET_G(green); 693 CRIS_LED_ACTIVE_SET_G(green);
830 LED_ACTIVE_SET_R(red); 694 CRIS_LED_ACTIVE_SET_R(red);
831 break; 695 break;
832 696
833 case IO_LED_SETBIT: 697 case IO_LED_SETBIT:
834 LED_BIT_SET(arg); 698 CRIS_LED_BIT_SET(arg);
835 break; 699 break;
836 700
837 case IO_LED_CLRBIT: 701 case IO_LED_CLRBIT:
838 LED_BIT_CLR(arg); 702 CRIS_LED_BIT_CLR(arg);
839 break; 703 break;
840 704
841 default: 705 default:
@@ -845,7 +709,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
845 return 0; 709 return 0;
846} 710}
847 711
848const struct file_operations gpio_fops = { 712static const struct file_operations gpio_fops = {
849 .owner = THIS_MODULE, 713 .owner = THIS_MODULE,
850 .poll = gpio_poll, 714 .poll = gpio_poll,
851 .ioctl = gpio_ioctl, 715 .ioctl = gpio_ioctl,
@@ -854,16 +718,18 @@ const struct file_operations gpio_fops = {
854 .release = gpio_release, 718 .release = gpio_release,
855}; 719};
856 720
857 721static void ioif_watcher(const unsigned int gpio_in_available,
858void ioif_watcher(const unsigned int gpio_in_available, 722 const unsigned int gpio_out_available,
859 const unsigned int gpio_out_available, 723 const unsigned char pa_available,
860 const unsigned char pa_available, 724 const unsigned char pb_available)
861 const unsigned char pb_available)
862{ 725{
863 unsigned long int flags; 726 unsigned long int flags;
864 D(printk("gpio.c: ioif_watcher called\n")); 727
865 D(printk("gpio.c: G in: 0x%08x G out: 0x%08x PA: 0x%02x PB: 0x%02x\n", 728 D(printk(KERN_DEBUG "gpio.c: ioif_watcher called\n"));
866 gpio_in_available, gpio_out_available, pa_available, pb_available)); 729 D(printk(KERN_DEBUG "gpio.c: G in: 0x%08x G out: 0x%08x "
730 "PA: 0x%02x PB: 0x%02x\n",
731 gpio_in_available, gpio_out_available,
732 pa_available, pb_available));
867 733
868 spin_lock_irqsave(&gpio_lock, flags); 734 spin_lock_irqsave(&gpio_lock, flags);
869 735
@@ -872,7 +738,7 @@ void ioif_watcher(const unsigned int gpio_in_available,
872 738
873 /* Initialise the dir_g_shadow etc. depending on genconfig */ 739 /* Initialise the dir_g_shadow etc. depending on genconfig */
874 /* 0=input 1=output */ 740 /* 0=input 1=output */
875 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, g0dir, out)) 741 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, g0dir, out))
876 dir_g_shadow |= (1 << 0); 742 dir_g_shadow |= (1 << 0);
877 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, g8_15dir, out)) 743 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, g8_15dir, out))
878 dir_g_shadow |= 0x0000FF00; 744 dir_g_shadow |= 0x0000FF00;
@@ -884,7 +750,8 @@ void ioif_watcher(const unsigned int gpio_in_available,
884 changeable_dir_g = changeable_dir_g_mask; 750 changeable_dir_g = changeable_dir_g_mask;
885 changeable_dir_g &= dir_g_out_bits; 751 changeable_dir_g &= dir_g_out_bits;
886 changeable_dir_g &= dir_g_in_bits; 752 changeable_dir_g &= dir_g_in_bits;
887 /* Correct the bits that can change direction */ 753
754 /* Correct the bits that can change direction */
888 dir_g_out_bits &= ~changeable_dir_g; 755 dir_g_out_bits &= ~changeable_dir_g;
889 dir_g_out_bits |= dir_g_shadow; 756 dir_g_out_bits |= dir_g_shadow;
890 dir_g_in_bits &= ~changeable_dir_g; 757 dir_g_in_bits &= ~changeable_dir_g;
@@ -892,7 +759,8 @@ void ioif_watcher(const unsigned int gpio_in_available,
892 759
893 spin_unlock_irqrestore(&gpio_lock, flags); 760 spin_unlock_irqrestore(&gpio_lock, flags);
894 761
895 printk(KERN_INFO "GPIO port G: in_bits: 0x%08lX out_bits: 0x%08lX val: %08lX\n", 762 printk(KERN_INFO "GPIO port G: in_bits: 0x%08lX out_bits: 0x%08lX "
763 "val: %08lX\n",
896 dir_g_in_bits, dir_g_out_bits, (unsigned long)*R_PORT_G_DATA); 764 dir_g_in_bits, dir_g_out_bits, (unsigned long)*R_PORT_G_DATA);
897 printk(KERN_INFO "GPIO port G: dir: %08lX changeable: %08lX\n", 765 printk(KERN_INFO "GPIO port G: dir: %08lX changeable: %08lX\n",
898 dir_g_shadow, changeable_dir_g); 766 dir_g_shadow, changeable_dir_g);
@@ -900,16 +768,12 @@ void ioif_watcher(const unsigned int gpio_in_available,
900 768
901/* main driver initialization routine, called from mem.c */ 769/* main driver initialization routine, called from mem.c */
902 770
903static __init int 771static int __init gpio_init(void)
904gpio_init(void)
905{ 772{
906 int res; 773 int res;
907#if defined (CONFIG_ETRAX_CSP0_LEDS) 774#if defined (CONFIG_ETRAX_CSP0_LEDS)
908 int i; 775 int i;
909#endif 776#endif
910 printk("gpio init\n");
911
912 /* do the formalities */
913 777
914 res = register_chrdev(GPIO_MAJOR, gpio_name, &gpio_fops); 778 res = register_chrdev(GPIO_MAJOR, gpio_name, &gpio_fops);
915 if (res < 0) { 779 if (res < 0) {
@@ -919,43 +783,45 @@ gpio_init(void)
919 783
920 /* Clear all leds */ 784 /* Clear all leds */
921#if defined (CONFIG_ETRAX_CSP0_LEDS) || defined (CONFIG_ETRAX_PA_LEDS) || defined (CONFIG_ETRAX_PB_LEDS) 785#if defined (CONFIG_ETRAX_CSP0_LEDS) || defined (CONFIG_ETRAX_PA_LEDS) || defined (CONFIG_ETRAX_PB_LEDS)
922 LED_NETWORK_SET(0); 786 CRIS_LED_NETWORK_SET(0);
923 LED_ACTIVE_SET(0); 787 CRIS_LED_ACTIVE_SET(0);
924 LED_DISK_READ(0); 788 CRIS_LED_DISK_READ(0);
925 LED_DISK_WRITE(0); 789 CRIS_LED_DISK_WRITE(0);
926 790
927#if defined (CONFIG_ETRAX_CSP0_LEDS) 791#if defined (CONFIG_ETRAX_CSP0_LEDS)
928 for (i = 0; i < 32; i++) { 792 for (i = 0; i < 32; i++)
929 LED_BIT_SET(i); 793 CRIS_LED_BIT_SET(i);
930 }
931#endif 794#endif
932 795
933#endif 796#endif
934 /* The I/O interface allocation watcher will be called when 797 /* The I/O interface allocation watcher will be called when
935 * registering it. */ 798 * registering it. */
936 if (cris_io_interface_register_watcher(ioif_watcher)){ 799 if (cris_io_interface_register_watcher(ioif_watcher)){
937 printk(KERN_WARNING "gpio_init: Failed to install IO if allocator watcher\n"); 800 printk(KERN_WARNING "gpio_init: Failed to install IO "
801 "if allocator watcher\n");
938 } 802 }
939 803
940 printk(KERN_INFO "ETRAX 100LX GPIO driver v2.5, (c) 2001, 2002, 2003, 2004 Axis Communications AB\n"); 804 printk(KERN_INFO "ETRAX 100LX GPIO driver v2.5, (c) 2001-2008 "
805 "Axis Communications AB\n");
941 /* We call etrax_gpio_wake_up_check() from timer interrupt and 806 /* We call etrax_gpio_wake_up_check() from timer interrupt and
942 * from cpu_idle() in kernel/process.c 807 * from cpu_idle() in kernel/process.c
943 * The check in cpu_idle() reduces latency from ~15 ms to ~6 ms 808 * The check in cpu_idle() reduces latency from ~15 ms to ~6 ms
944 * in some tests. 809 * in some tests.
945 */ 810 */
946 if (request_irq(TIMER0_IRQ_NBR, gpio_poll_timer_interrupt, 811 res = request_irq(TIMER0_IRQ_NBR, gpio_poll_timer_interrupt,
947 IRQF_SHARED | IRQF_DISABLED,"gpio poll", NULL)) { 812 IRQF_SHARED | IRQF_DISABLED, "gpio poll", gpio_name);
813 if (res) {
948 printk(KERN_CRIT "err: timer0 irq for gpio\n"); 814 printk(KERN_CRIT "err: timer0 irq for gpio\n");
815 return res;
949 } 816 }
950 if (request_irq(PA_IRQ_NBR, gpio_pa_interrupt, 817 res = request_irq(PA_IRQ_NBR, gpio_interrupt,
951 IRQF_SHARED | IRQF_DISABLED,"gpio PA", NULL)) { 818 IRQF_SHARED | IRQF_DISABLED, "gpio PA", gpio_name);
819 if (res)
952 printk(KERN_CRIT "err: PA irq for gpio\n"); 820 printk(KERN_CRIT "err: PA irq for gpio\n");
953 }
954
955 821
956 return res; 822 return res;
957} 823}
958 824
959/* this makes sure that gpio_init is called during kernel boot */ 825/* this makes sure that gpio_init is called during kernel boot */
960
961module_init(gpio_init); 826module_init(gpio_init);
827
diff --git a/arch/cris/arch-v10/drivers/i2c.c b/arch/cris/arch-v10/drivers/i2c.c
index aca81ddaf60f..d6d22067d0c8 100644
--- a/arch/cris/arch-v10/drivers/i2c.c
+++ b/arch/cris/arch-v10/drivers/i2c.c
@@ -6,85 +6,9 @@
6*! kernel modules (i2c_writereg/readreg) and from userspace using 6*! kernel modules (i2c_writereg/readreg) and from userspace using
7*! ioctl()'s 7*! ioctl()'s
8*! 8*!
9*! Nov 30 1998 Torbjorn Eliasson Initial version. 9*! (C) Copyright 1999-2007 Axis Communications AB, LUND, SWEDEN
10*! Bjorn Wesen Elinux kernel version.
11*! Jan 14 2000 Johan Adolfsson Fixed PB shadow register stuff -
12*! don't use PB_I2C if DS1302 uses same bits,
13*! use PB.
14*! $Log: i2c.c,v $
15*! Revision 1.13 2005/03/07 13:13:07 starvik
16*! Added spinlocks to protect states etc
17*!
18*! Revision 1.12 2005/01/05 06:11:22 starvik
19*! No need to do local_irq_disable after local_irq_save.
20*!
21*! Revision 1.11 2004/12/13 12:21:52 starvik
22*! Added I/O and DMA allocators from Linux 2.4
23*!
24*! Revision 1.9 2004/08/24 06:49:14 starvik
25*! Whitespace cleanup
26*!
27*! Revision 1.8 2004/06/08 08:48:26 starvik
28*! Removed unused code
29*!
30*! Revision 1.7 2004/05/28 09:26:59 starvik
31*! Modified I2C initialization to work in 2.6.
32*!
33*! Revision 1.6 2004/05/14 07:58:03 starvik
34*! Merge of changes from 2.4
35*!
36*! Revision 1.4 2002/12/11 13:13:57 starvik
37*! Added arch/ to v10 specific includes
38*! Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
39*!
40*! Revision 1.3 2002/11/20 11:56:11 starvik
41*! Merge of Linux 2.5.48
42*!
43*! Revision 1.2 2002/11/18 13:16:06 starvik
44*! Linux 2.5 port of latest 2.4 drivers
45*!
46*! Revision 1.9 2002/10/31 15:32:26 starvik
47*! Update Port B register and shadow even when running with hardware support
48*! to avoid glitches when reading bits
49*! Never set direction to out in i2c_inbyte
50*! Removed incorrect clock toggling at end of i2c_inbyte
51*!
52*! Revision 1.8 2002/08/13 06:31:53 starvik
53*! Made SDA and SCL line configurable
54*! Modified i2c_inbyte to work with PCF8563
55*!
56*! Revision 1.7 2001/04/04 13:11:36 markusl
57*! Updated according to review remarks
58*!
59*! Revision 1.6 2001/03/19 12:43:00 markusl
60*! Made some symbols unstatic (used by the eeprom driver)
61*!
62*! Revision 1.5 2001/02/27 13:52:48 bjornw
63*! malloc.h -> slab.h
64*!
65*! Revision 1.4 2001/02/15 07:17:40 starvik
66*! Corrected usage if port_pb_i2c_shadow
67*!
68*! Revision 1.3 2001/01/26 17:55:13 bjornw
69*! * Made I2C_USES_PB_NOT_PB_I2C a CONFIG option instead of assigning it
70*! magically. Config.in needs to set it for the options that need it, like
71*! Dallas 1302 support. Actually, it should be default since it screws up
72*! the PB bits even if you don't use I2C..
73*! * Include linux/config.h to get the above
74*!
75*! Revision 1.2 2001/01/18 15:49:30 bjornw
76*! 2.4 port of I2C including some cleanups (untested of course)
77*!
78*! Revision 1.1 2001/01/18 15:35:25 bjornw
79*! Verbatim copy of the Etrax i2c driver, 2.0 elinux version
80*!
81*!
82*! ---------------------------------------------------------------------------
83*!
84*! (C) Copyright 1999-2002 Axis Communications AB, LUND, SWEDEN
85*! 10*!
86*!***************************************************************************/ 11*!***************************************************************************/
87/* $Id: i2c.c,v 1.13 2005/03/07 13:13:07 starvik Exp $ */
88 12
89/****************** INCLUDE FILES SECTION ***********************************/ 13/****************** INCLUDE FILES SECTION ***********************************/
90 14
@@ -622,7 +546,7 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
622 * last received byte needs to be nacked 546 * last received byte needs to be nacked
623 * instead of acked 547 * instead of acked
624 */ 548 */
625 i2c_sendack(); 549 i2c_sendnack();
626 /* 550 /*
627 * end sequence 551 * end sequence
628 */ 552 */
@@ -708,6 +632,7 @@ i2c_init(void)
708 if (!first) { 632 if (!first) {
709 return res; 633 return res;
710 } 634 }
635 first = 0;
711 636
712 /* Setup and enable the Port B I2C interface */ 637 /* Setup and enable the Port B I2C interface */
713 638
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c
index c263b8232dbc..52103d16dc6c 100644
--- a/arch/cris/arch-v10/drivers/pcf8563.c
+++ b/arch/cris/arch-v10/drivers/pcf8563.c
@@ -8,14 +8,13 @@
8 * low detector are also provided. All address and data are transferred 8 * low detector are also provided. All address and data are transferred
9 * serially via two-line bidirectional I2C-bus. Maximum bus speed is 9 * serially via two-line bidirectional I2C-bus. Maximum bus speed is
10 * 400 kbits/s. The built-in word address register is incremented 10 * 400 kbits/s. The built-in word address register is incremented
11 * automatically after each written or read bute. 11 * automatically after each written or read byte.
12 * 12 *
13 * Copyright (c) 2002, Axis Communications AB 13 * Copyright (c) 2002-2007, Axis Communications AB
14 * All rights reserved. 14 * All rights reserved.
15 * 15 *
16 * Author: Tobias Anderberg <tobiasa@axis.com>. 16 * Author: Tobias Anderberg <tobiasa@axis.com>.
17 * 17 *
18 * $Id: pcf8563.c,v 1.11 2005/03/07 13:13:07 starvik Exp $
19 */ 18 */
20 19
21#include <linux/module.h> 20#include <linux/module.h>
@@ -27,19 +26,19 @@
27#include <linux/ioctl.h> 26#include <linux/ioctl.h>
28#include <linux/delay.h> 27#include <linux/delay.h>
29#include <linux/bcd.h> 28#include <linux/bcd.h>
30#include <linux/capability.h> 29#include <linux/mutex.h>
31 30
32#include <asm/uaccess.h> 31#include <asm/uaccess.h>
33#include <asm/system.h> 32#include <asm/system.h>
34#include <asm/io.h> 33#include <asm/io.h>
35#include <asm/arch/svinto.h>
36#include <asm/rtc.h> 34#include <asm/rtc.h>
35
37#include "i2c.h" 36#include "i2c.h"
38 37
39#define PCF8563_MAJOR 121 /* Local major number. */ 38#define PCF8563_MAJOR 121 /* Local major number. */
40#define DEVICE_NAME "rtc" /* Name which is registered in /proc/devices. */ 39#define DEVICE_NAME "rtc" /* Name which is registered in /proc/devices. */
41#define PCF8563_NAME "PCF8563" 40#define PCF8563_NAME "PCF8563"
42#define DRIVER_VERSION "$Revision: 1.11 $" 41#define DRIVER_VERSION "$Revision: 1.24 $"
43 42
44/* I2C bus slave registers. */ 43/* I2C bus slave registers. */
45#define RTC_I2C_READ 0xa3 44#define RTC_I2C_READ 0xa3
@@ -49,71 +48,88 @@
49#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) 48#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x)
50#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) 49#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y)
51 50
52static DEFINE_SPINLOCK(rtc_lock); /* Protect state etc */ 51static DEFINE_MUTEX(rtc_lock); /* Protect state etc */
53 52
54static const unsigned char days_in_month[] = 53static const unsigned char days_in_month[] =
55 { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 54 { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
56 55
57int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); 56int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
58 57
58/* Cache VL bit value read at driver init since writing the RTC_SECOND
59 * register clears the VL status.
60 */
61static int voltage_low;
62
59static const struct file_operations pcf8563_fops = { 63static const struct file_operations pcf8563_fops = {
60 .owner = THIS_MODULE, 64 .owner = THIS_MODULE,
61 .ioctl = pcf8563_ioctl, 65 .ioctl = pcf8563_ioctl,
62}; 66};
63 67
64unsigned char 68unsigned char
65pcf8563_readreg(int reg) 69pcf8563_readreg(int reg)
66{ 70{
67 unsigned char res = i2c_readreg(RTC_I2C_READ, reg); 71 unsigned char res = rtc_read(reg);
68 72
69 /* The PCF8563 does not return 0 for unimplemented bits */ 73 /* The PCF8563 does not return 0 for unimplemented bits. */
70 switch(reg) 74 switch (reg) {
71 { 75 case RTC_SECONDS:
72 case RTC_SECONDS: 76 case RTC_MINUTES:
73 case RTC_MINUTES: 77 res &= 0x7F;
74 res &= 0x7f; 78 break;
75 break; 79 case RTC_HOURS:
76 case RTC_HOURS: 80 case RTC_DAY_OF_MONTH:
77 case RTC_DAY_OF_MONTH: 81 res &= 0x3F;
78 res &= 0x3f; 82 break;
79 break; 83 case RTC_WEEKDAY:
80 case RTC_MONTH: 84 res &= 0x07;
81 res = (res & 0x1f) - 1; /* PCF8563 returns month in range 1-12 */ 85 break;
82 break; 86 case RTC_MONTH:
87 res &= 0x1F;
88 break;
89 case RTC_CONTROL1:
90 res &= 0xA8;
91 break;
92 case RTC_CONTROL2:
93 res &= 0x1F;
94 break;
95 case RTC_CLOCKOUT_FREQ:
96 case RTC_TIMER_CONTROL:
97 res &= 0x83;
98 break;
83 } 99 }
84 return res; 100 return res;
85} 101}
86 102
87void 103void
88pcf8563_writereg(int reg, unsigned char val) 104pcf8563_writereg(int reg, unsigned char val)
89{ 105{
90#ifdef CONFIG_ETRAX_RTC_READONLY
91 if (reg == RTC_CONTROL1 || (reg >= RTC_SECONDS && reg <= RTC_YEAR))
92 return;
93#endif
94
95 rtc_write(reg, val); 106 rtc_write(reg, val);
96} 107}
97 108
98void 109void
99get_rtc_time(struct rtc_time *tm) 110get_rtc_time(struct rtc_time *tm)
100{ 111{
101 tm->tm_sec = rtc_read(RTC_SECONDS); 112 tm->tm_sec = rtc_read(RTC_SECONDS);
102 tm->tm_min = rtc_read(RTC_MINUTES); 113 tm->tm_min = rtc_read(RTC_MINUTES);
103 tm->tm_hour = rtc_read(RTC_HOURS); 114 tm->tm_hour = rtc_read(RTC_HOURS);
104 tm->tm_mday = rtc_read(RTC_DAY_OF_MONTH); 115 tm->tm_mday = rtc_read(RTC_DAY_OF_MONTH);
105 tm->tm_mon = rtc_read(RTC_MONTH); 116 tm->tm_wday = rtc_read(RTC_WEEKDAY);
117 tm->tm_mon = rtc_read(RTC_MONTH);
106 tm->tm_year = rtc_read(RTC_YEAR); 118 tm->tm_year = rtc_read(RTC_YEAR);
107 119
108 if (tm->tm_sec & 0x80) 120 if (tm->tm_sec & 0x80) {
109 printk(KERN_WARNING "%s: RTC Low Voltage - date/time is not reliable!\n", PCF8563_NAME); 121 printk(KERN_ERR "%s: RTC Voltage Low - reliable date/time "
122 "information is no longer guaranteed!\n", PCF8563_NAME);
123 }
110 124
111 tm->tm_year = BCD_TO_BIN(tm->tm_year) + ((tm->tm_mon & 0x80) ? 100 : 0); 125 tm->tm_year = BCD_TO_BIN(tm->tm_year) +
112 tm->tm_sec &= 0x7f; 126 ((tm->tm_mon & 0x80) ? 100 : 0);
113 tm->tm_min &= 0x7f; 127 tm->tm_sec &= 0x7F;
114 tm->tm_hour &= 0x3f; 128 tm->tm_min &= 0x7F;
115 tm->tm_mday &= 0x3f; 129 tm->tm_hour &= 0x3F;
116 tm->tm_mon &= 0x1f; 130 tm->tm_mday &= 0x3F;
131 tm->tm_wday &= 0x07; /* Not coded in BCD. */
132 tm->tm_mon &= 0x1F;
117 133
118 BCD_TO_BIN(tm->tm_sec); 134 BCD_TO_BIN(tm->tm_sec);
119 BCD_TO_BIN(tm->tm_min); 135 BCD_TO_BIN(tm->tm_min);
@@ -126,17 +142,24 @@ get_rtc_time(struct rtc_time *tm)
126int __init 142int __init
127pcf8563_init(void) 143pcf8563_init(void)
128{ 144{
129 int ret; 145 static int res;
130 146 static int first = 1;
131 if ((ret = i2c_init())) { 147
132 printk(KERN_CRIT "pcf8563_init: failed to init i2c\n"); 148 if (!first)
133 return ret; 149 return res;
150 first = 0;
151
152 /* Initiate the i2c protocol. */
153 res = i2c_init();
154 if (res < 0) {
155 printk(KERN_CRIT "pcf8563_init: Failed to init i2c.\n");
156 return res;
134 } 157 }
135 158
136 /* 159 /*
137 * First of all we need to reset the chip. This is done by 160 * First of all we need to reset the chip. This is done by
138 * clearing control1, control2 and clk freq, clear the 161 * clearing control1, control2 and clk freq and resetting
139 * Voltage Low bit, and resetting all alarms. 162 * all alarms.
140 */ 163 */
141 if (rtc_write(RTC_CONTROL1, 0x00) < 0) 164 if (rtc_write(RTC_CONTROL1, 0x00) < 0)
142 goto err; 165 goto err;
@@ -147,34 +170,36 @@ pcf8563_init(void)
147 if (rtc_write(RTC_CLOCKOUT_FREQ, 0x00) < 0) 170 if (rtc_write(RTC_CLOCKOUT_FREQ, 0x00) < 0)
148 goto err; 171 goto err;
149 172
150 /* Clear the VL bit in the seconds register. */ 173 if (rtc_write(RTC_TIMER_CONTROL, 0x03) < 0)
151 ret = rtc_read(RTC_SECONDS);
152
153 if (rtc_write(RTC_SECONDS, (ret & 0x7f)) < 0)
154 goto err; 174 goto err;
155 175
156 /* Reset the alarms. */ 176 /* Reset the alarms. */
157 if (rtc_write(RTC_MINUTE_ALARM, 0x00) < 0) 177 if (rtc_write(RTC_MINUTE_ALARM, 0x80) < 0)
158 goto err; 178 goto err;
159 179
160 if (rtc_write(RTC_HOUR_ALARM, 0x00) < 0) 180 if (rtc_write(RTC_HOUR_ALARM, 0x80) < 0)
161 goto err; 181 goto err;
162 182
163 if (rtc_write(RTC_DAY_ALARM, 0x00) < 0) 183 if (rtc_write(RTC_DAY_ALARM, 0x80) < 0)
164 goto err; 184 goto err;
165 185
166 if (rtc_write(RTC_WEEKDAY_ALARM, 0x00) < 0) 186 if (rtc_write(RTC_WEEKDAY_ALARM, 0x80) < 0)
167 goto err; 187 goto err;
168 188
169 /* Check for low voltage, and warn about it.. */ 189 /* Check for low voltage, and warn about it. */
170 if (rtc_read(RTC_SECONDS) & 0x80) 190 if (rtc_read(RTC_SECONDS) & 0x80) {
171 printk(KERN_WARNING "%s: RTC Low Voltage - date/time is not reliable!\n", PCF8563_NAME); 191 voltage_low = 1;
172 192 printk(KERN_WARNING "%s: RTC Voltage Low - reliable "
173 return 0; 193 "date/time information is no longer guaranteed!\n",
194 PCF8563_NAME);
195 }
196
197 return res;
174 198
175err: 199err:
176 printk(KERN_INFO "%s: Error initializing chip.\n", PCF8563_NAME); 200 printk(KERN_INFO "%s: Error initializing chip.\n", PCF8563_NAME);
177 return -1; 201 res = -1;
202 return res;
178} 203}
179 204
180void __exit 205void __exit
@@ -187,8 +212,8 @@ pcf8563_exit(void)
187 * ioctl calls for this driver. Why return -ENOTTY upon error? Because 212 * ioctl calls for this driver. Why return -ENOTTY upon error? Because
188 * POSIX says so! 213 * POSIX says so!
189 */ 214 */
190int 215int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
191pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) 216 unsigned long arg)
192{ 217{
193 /* Some sanity checks. */ 218 /* Some sanity checks. */
194 if (_IOC_TYPE(cmd) != RTC_MAGIC) 219 if (_IOC_TYPE(cmd) != RTC_MAGIC)
@@ -198,124 +223,146 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned
198 return -ENOTTY; 223 return -ENOTTY;
199 224
200 switch (cmd) { 225 switch (cmd) {
201 case RTC_RD_TIME: 226 case RTC_RD_TIME:
202 { 227 {
203 struct rtc_time tm; 228 struct rtc_time tm;
204
205 spin_lock(&rtc_lock);
206 get_rtc_time(&tm);
207
208 if (copy_to_user((struct rtc_time *) arg, &tm, sizeof(struct rtc_time))) {
209 spin_unlock(&rtc_lock);
210 return -EFAULT;
211 }
212
213 spin_unlock(&rtc_lock);
214 return 0;
215 }
216 break;
217 case RTC_SET_TIME:
218 {
219#ifdef CONFIG_ETRAX_RTC_READONLY
220 return -EPERM;
221#else
222 int leap;
223 int century;
224 struct rtc_time tm;
225
226 memset(&tm, 0, sizeof (struct rtc_time));
227 if (!capable(CAP_SYS_TIME))
228 return -EPERM;
229
230 if (copy_from_user(&tm, (struct rtc_time *) arg, sizeof(struct rtc_time)))
231 return -EFAULT;
232
233 /* Convert from struct tm to struct rtc_time. */
234 tm.tm_year += 1900;
235 tm.tm_mon += 1;
236
237 leap = ((tm.tm_mon == 2) && ((tm.tm_year % 4) == 0)) ? 1 : 0;
238
239 /* Perform some sanity checks. */
240 if ((tm.tm_year < 1970) ||
241 (tm.tm_mon > 12) ||
242 (tm.tm_mday == 0) ||
243 (tm.tm_mday > days_in_month[tm.tm_mon] + leap) ||
244 (tm.tm_hour >= 24) ||
245 (tm.tm_min >= 60) ||
246 (tm.tm_sec >= 60))
247 return -EINVAL;
248
249 century = (tm.tm_year >= 2000) ? 0x80 : 0;
250 tm.tm_year = tm.tm_year % 100;
251
252 BIN_TO_BCD(tm.tm_year);
253 BIN_TO_BCD(tm.tm_mday);
254 BIN_TO_BCD(tm.tm_hour);
255 BIN_TO_BCD(tm.tm_min);
256 BIN_TO_BCD(tm.tm_sec);
257 tm.tm_mon |= century;
258
259 spin_lock(&rtc_lock);
260
261 rtc_write(RTC_YEAR, tm.tm_year);
262 rtc_write(RTC_MONTH, tm.tm_mon);
263 rtc_write(RTC_DAY_OF_MONTH, tm.tm_mday);
264 rtc_write(RTC_HOURS, tm.tm_hour);
265 rtc_write(RTC_MINUTES, tm.tm_min);
266 rtc_write(RTC_SECONDS, tm.tm_sec);
267
268 spin_unlock(&rtc_lock);
269
270 return 0;
271#endif /* !CONFIG_ETRAX_RTC_READONLY */
272 }
273
274 case RTC_VLOW_RD:
275 {
276 int vl_bit = 0;
277
278 if (rtc_read(RTC_SECONDS) & 0x80) {
279 vl_bit = 1;
280 printk(KERN_WARNING "%s: RTC Voltage Low - reliable "
281 "date/time information is no longer guaranteed!\n",
282 PCF8563_NAME);
283 }
284 if (copy_to_user((int *) arg, &vl_bit, sizeof(int)))
285 return -EFAULT;
286
287 return 0;
288 }
289 229
290 case RTC_VLOW_SET: 230 mutex_lock(&rtc_lock);
291 { 231 memset(&tm, 0, sizeof tm);
292 /* Clear the VL bit in the seconds register */ 232 get_rtc_time(&tm);
293 int ret = rtc_read(RTC_SECONDS);
294 233
295 rtc_write(RTC_SECONDS, (ret & 0x7F)); 234 if (copy_to_user((struct rtc_time *) arg, &tm,
235 sizeof tm)) {
236 spin_unlock(&rtc_lock);
237 return -EFAULT;
238 }
239
240 mutex_unlock(&rtc_lock);
296 241
297 return 0; 242 return 0;
243 }
244 case RTC_SET_TIME:
245 {
246 int leap;
247 int year;
248 int century;
249 struct rtc_time tm;
250
251 memset(&tm, 0, sizeof tm);
252 if (!capable(CAP_SYS_TIME))
253 return -EPERM;
254
255 if (copy_from_user(&tm, (struct rtc_time *) arg, sizeof tm))
256 return -EFAULT;
257
258 /* Convert from struct tm to struct rtc_time. */
259 tm.tm_year += 1900;
260 tm.tm_mon += 1;
261
262 /*
263 * Check if tm.tm_year is a leap year. A year is a leap
264 * year if it is divisible by 4 but not 100, except
265 * that years divisible by 400 _are_ leap years.
266 */
267 year = tm.tm_year;
268 leap = (tm.tm_mon == 2) &&
269 ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
270
271 /* Perform some sanity checks. */
272 if ((tm.tm_year < 1970) ||
273 (tm.tm_mon > 12) ||
274 (tm.tm_mday == 0) ||
275 (tm.tm_mday > days_in_month[tm.tm_mon] + leap) ||
276 (tm.tm_wday >= 7) ||
277 (tm.tm_hour >= 24) ||
278 (tm.tm_min >= 60) ||
279 (tm.tm_sec >= 60))
280 return -EINVAL;
281
282 century = (tm.tm_year >= 2000) ? 0x80 : 0;
283 tm.tm_year = tm.tm_year % 100;
284
285 BIN_TO_BCD(tm.tm_year);
286 BIN_TO_BCD(tm.tm_mon);
287 BIN_TO_BCD(tm.tm_mday);
288 BIN_TO_BCD(tm.tm_hour);
289 BIN_TO_BCD(tm.tm_min);
290 BIN_TO_BCD(tm.tm_sec);
291 tm.tm_mon |= century;
292
293 mutex_lock(&rtc_lock);
294
295 rtc_write(RTC_YEAR, tm.tm_year);
296 rtc_write(RTC_MONTH, tm.tm_mon);
297 rtc_write(RTC_WEEKDAY, tm.tm_wday); /* Not coded in BCD. */
298 rtc_write(RTC_DAY_OF_MONTH, tm.tm_mday);
299 rtc_write(RTC_HOURS, tm.tm_hour);
300 rtc_write(RTC_MINUTES, tm.tm_min);
301 rtc_write(RTC_SECONDS, tm.tm_sec);
302
303 mutex_unlock(&rtc_lock);
304
305 return 0;
306 }
307 case RTC_VL_READ:
308 if (voltage_low) {
309 printk(KERN_ERR "%s: RTC Voltage Low - "
310 "reliable date/time information is no "
311 "longer guaranteed!\n", PCF8563_NAME);
298 } 312 }
299 313
300 default: 314 if (copy_to_user((int *) arg, &voltage_low, sizeof(int)))
301 return -ENOTTY; 315 return -EFAULT;
316 return 0;
317
318 case RTC_VL_CLR:
319 {
320 /* Clear the VL bit in the seconds register in case
321 * the time has not been set already (which would
322 * have cleared it). This does not really matter
323 * because of the cached voltage_low value but do it
324 * anyway for consistency. */
325
326 int ret = rtc_read(RTC_SECONDS);
327
328 rtc_write(RTC_SECONDS, (ret & 0x7F));
329
330 /* Clear the cached value. */
331 voltage_low = 0;
332
333 return 0;
334 }
335 default:
336 return -ENOTTY;
302 } 337 }
303 338
304 return 0; 339 return 0;
305} 340}
306 341
307static int __init 342static int __init pcf8563_register(void)
308pcf8563_register(void)
309{ 343{
310 pcf8563_init(); 344 if (pcf8563_init() < 0) {
345 printk(KERN_INFO "%s: Unable to initialize Real-Time Clock "
346 "Driver, %s\n", PCF8563_NAME, DRIVER_VERSION);
347 return -1;
348 }
349
311 if (register_chrdev(PCF8563_MAJOR, DEVICE_NAME, &pcf8563_fops) < 0) { 350 if (register_chrdev(PCF8563_MAJOR, DEVICE_NAME, &pcf8563_fops) < 0) {
312 printk(KERN_INFO "%s: Unable to get major number %d for RTC device.\n", 351 printk(KERN_INFO "%s: Unable to get major number %d for RTC device.\n",
313 PCF8563_NAME, PCF8563_MAJOR); 352 PCF8563_NAME, PCF8563_MAJOR);
314 return -1; 353 return -1;
315 } 354 }
316 355
317 printk(KERN_INFO "%s Real-Time Clock Driver, %s\n", PCF8563_NAME, DRIVER_VERSION); 356 printk(KERN_INFO "%s Real-Time Clock Driver, %s\n", PCF8563_NAME,
318 return 0; 357 DRIVER_VERSION);
358
359 /* Check for low voltage, and warn about it. */
360 if (voltage_low) {
361 printk(KERN_WARNING "%s: RTC Voltage Low - reliable date/time "
362 "information is no longer guaranteed!\n", PCF8563_NAME);
363 }
364
365 return 0;
319} 366}
320 367
321module_init(pcf8563_register); 368module_init(pcf8563_register);
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c
new file mode 100644
index 000000000000..069546e342c5
--- /dev/null
+++ b/arch/cris/arch-v10/drivers/sync_serial.c
@@ -0,0 +1,1441 @@
1/*
2 * Simple synchronous serial port driver for ETRAX 100LX.
3 *
4 * Synchronous serial ports are used for continuous streamed data like audio.
5 * The default setting for this driver is compatible with the STA 013 MP3
6 * decoder. The driver can easily be tuned to fit other audio encoder/decoders
7 * and SPI
8 *
9 * Copyright (c) 2001-2008 Axis Communications AB
10 *
11 * Author: Mikael Starvik, Johan Adolfsson
12 *
13 */
14#include <linux/module.h>
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/errno.h>
18#include <linux/major.h>
19#include <linux/sched.h>
20#include <linux/slab.h>
21#include <linux/interrupt.h>
22#include <linux/poll.h>
23#include <linux/init.h>
24#include <linux/timer.h>
25#include <asm/irq.h>
26#include <asm/dma.h>
27#include <asm/io.h>
28#include <asm/arch/svinto.h>
29#include <asm/uaccess.h>
30#include <asm/system.h>
31#include <asm/sync_serial.h>
32#include <asm/arch/io_interface_mux.h>
33
34/* The receiver is a bit tricky beacuse of the continuous stream of data.*/
35/* */
36/* Three DMA descriptors are linked together. Each DMA descriptor is */
37/* responsible for port->bufchunk of a common buffer. */
38/* */
39/* +---------------------------------------------+ */
40/* | +----------+ +----------+ +----------+ | */
41/* +-> | Descr[0] |-->| Descr[1] |-->| Descr[2] |-+ */
42/* +----------+ +----------+ +----------+ */
43/* | | | */
44/* v v v */
45/* +-------------------------------------+ */
46/* | BUFFER | */
47/* +-------------------------------------+ */
48/* |<- data_avail ->| */
49/* readp writep */
50/* */
51/* If the application keeps up the pace readp will be right after writep.*/
52/* If the application can't keep the pace we have to throw away data. */
53/* The idea is that readp should be ready with the data pointed out by */
54/* Descr[i] when the DMA has filled in Descr[i+1]. */
55/* Otherwise we will discard */
56/* the rest of the data pointed out by Descr1 and set readp to the start */
57/* of Descr2 */
58
59#define SYNC_SERIAL_MAJOR 125
60
61/* IN_BUFFER_SIZE should be a multiple of 6 to make sure that 24 bit */
62/* words can be handled */
63#define IN_BUFFER_SIZE 12288
64#define IN_DESCR_SIZE 256
65#define NUM_IN_DESCR (IN_BUFFER_SIZE/IN_DESCR_SIZE)
66#define OUT_BUFFER_SIZE 4096
67
68#define DEFAULT_FRAME_RATE 0
69#define DEFAULT_WORD_RATE 7
70
71/* NOTE: Enabling some debug will likely cause overrun or underrun,
72 * especially if manual mode is use.
73 */
74#define DEBUG(x)
75#define DEBUGREAD(x)
76#define DEBUGWRITE(x)
77#define DEBUGPOLL(x)
78#define DEBUGRXINT(x)
79#define DEBUGTXINT(x)
80
81/* Define some macros to access ETRAX 100 registers */
82#define SETF(var, reg, field, val) \
83 do { \
84 var = (var & ~IO_MASK_(reg##_, field##_)) | \
85 IO_FIELD_(reg##_, field##_, val); \
86 } while (0)
87
88#define SETS(var, reg, field, val) \
89 do { \
90 var = (var & ~IO_MASK_(reg##_, field##_)) | \
91 IO_STATE_(reg##_, field##_, _##val); \
92 } while (0)
93
94struct sync_port {
95 /* Etrax registers and bits*/
96 const volatile unsigned *const status;
97 volatile unsigned *const ctrl_data;
98 volatile unsigned *const output_dma_first;
99 volatile unsigned char *const output_dma_cmd;
100 volatile unsigned char *const output_dma_clr_irq;
101 volatile unsigned *const input_dma_first;
102 volatile unsigned char *const input_dma_cmd;
103 volatile unsigned *const input_dma_descr;
104 /* 8*4 */
105 volatile unsigned char *const input_dma_clr_irq;
106 volatile unsigned *const data_out;
107 const volatile unsigned *const data_in;
108 char data_avail_bit; /* In R_IRQ_MASK1_RD/SET/CLR */
109 char transmitter_ready_bit; /* In R_IRQ_MASK1_RD/SET/CLR */
110 char input_dma_descr_bit; /* In R_IRQ_MASK2_RD */
111
112 char output_dma_bit; /* In R_IRQ_MASK2_RD */
113 /* End of fields initialised in array */
114 char started; /* 1 if port has been started */
115 char port_nbr; /* Port 0 or 1 */
116 char busy; /* 1 if port is busy */
117
118 char enabled; /* 1 if port is enabled */
119 char use_dma; /* 1 if port uses dma */
120 char tr_running;
121
122 char init_irqs;
123
124 /* Register shadow */
125 unsigned int ctrl_data_shadow;
126 /* Remaining bytes for current transfer */
127 volatile unsigned int out_count;
128 /* Current position in out_buffer */
129 unsigned char *outp;
130 /* 16*4 */
131 /* Next byte to be read by application */
132 volatile unsigned char *volatile readp;
133 /* Next byte to be written by etrax */
134 volatile unsigned char *volatile writep;
135
136 unsigned int in_buffer_size;
137 unsigned int inbufchunk;
138 struct etrax_dma_descr out_descr __attribute__ ((aligned(32)));
139 struct etrax_dma_descr in_descr[NUM_IN_DESCR] __attribute__ ((aligned(32)));
140 unsigned char out_buffer[OUT_BUFFER_SIZE] __attribute__ ((aligned(32)));
141 unsigned char in_buffer[IN_BUFFER_SIZE]__attribute__ ((aligned(32)));
142 unsigned char flip[IN_BUFFER_SIZE] __attribute__ ((aligned(32)));
143 struct etrax_dma_descr *next_rx_desc;
144 struct etrax_dma_descr *prev_rx_desc;
145 int full;
146
147 wait_queue_head_t out_wait_q;
148 wait_queue_head_t in_wait_q;
149};
150
151
152static int etrax_sync_serial_init(void);
153static void initialize_port(int portnbr);
154static inline int sync_data_avail(struct sync_port *port);
155
156static int sync_serial_open(struct inode *inode, struct file *file);
157static int sync_serial_release(struct inode *inode, struct file *file);
158static unsigned int sync_serial_poll(struct file *filp, poll_table *wait);
159
160static int sync_serial_ioctl(struct inode *inode, struct file *file,
161 unsigned int cmd, unsigned long arg);
162static ssize_t sync_serial_write(struct file *file, const char *buf,
163 size_t count, loff_t *ppos);
164static ssize_t sync_serial_read(struct file *file, char *buf,
165 size_t count, loff_t *ppos);
166
167#if ((defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0) && \
168 defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL0_DMA)) || \
169 (defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT1) && \
170 defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL1_DMA)))
171#define SYNC_SER_DMA
172#endif
173
174static void send_word(struct sync_port *port);
175static void start_dma(struct sync_port *port, const char *data, int count);
176static void start_dma_in(struct sync_port *port);
177#ifdef SYNC_SER_DMA
178static irqreturn_t tr_interrupt(int irq, void *dev_id);
179static irqreturn_t rx_interrupt(int irq, void *dev_id);
180#endif
181#if ((defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0) && \
182 !defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL0_DMA)) || \
183 (defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT1) && \
184 !defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL1_DMA)))
185#define SYNC_SER_MANUAL
186#endif
187#ifdef SYNC_SER_MANUAL
188static irqreturn_t manual_interrupt(int irq, void *dev_id);
189#endif
190
191/* The ports */
192static struct sync_port ports[] = {
193 {
194 .status = R_SYNC_SERIAL1_STATUS,
195 .ctrl_data = R_SYNC_SERIAL1_CTRL,
196 .output_dma_first = R_DMA_CH8_FIRST,
197 .output_dma_cmd = R_DMA_CH8_CMD,
198 .output_dma_clr_irq = R_DMA_CH8_CLR_INTR,
199 .input_dma_first = R_DMA_CH9_FIRST,
200 .input_dma_cmd = R_DMA_CH9_CMD,
201 .input_dma_descr = R_DMA_CH9_DESCR,
202 .input_dma_clr_irq = R_DMA_CH9_CLR_INTR,
203 .data_out = R_SYNC_SERIAL1_TR_DATA,
204 .data_in = R_SYNC_SERIAL1_REC_DATA,
205 .data_avail_bit = IO_BITNR(R_IRQ_MASK1_RD, ser1_data),
206 .transmitter_ready_bit = IO_BITNR(R_IRQ_MASK1_RD, ser1_ready),
207 .input_dma_descr_bit = IO_BITNR(R_IRQ_MASK2_RD, dma9_descr),
208 .output_dma_bit = IO_BITNR(R_IRQ_MASK2_RD, dma8_eop),
209 .init_irqs = 1,
210#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL0_DMA)
211 .use_dma = 1,
212#else
213 .use_dma = 0,
214#endif
215 },
216 {
217 .status = R_SYNC_SERIAL3_STATUS,
218 .ctrl_data = R_SYNC_SERIAL3_CTRL,
219 .output_dma_first = R_DMA_CH4_FIRST,
220 .output_dma_cmd = R_DMA_CH4_CMD,
221 .output_dma_clr_irq = R_DMA_CH4_CLR_INTR,
222 .input_dma_first = R_DMA_CH5_FIRST,
223 .input_dma_cmd = R_DMA_CH5_CMD,
224 .input_dma_descr = R_DMA_CH5_DESCR,
225 .input_dma_clr_irq = R_DMA_CH5_CLR_INTR,
226 .data_out = R_SYNC_SERIAL3_TR_DATA,
227 .data_in = R_SYNC_SERIAL3_REC_DATA,
228 .data_avail_bit = IO_BITNR(R_IRQ_MASK1_RD, ser3_data),
229 .transmitter_ready_bit = IO_BITNR(R_IRQ_MASK1_RD, ser3_ready),
230 .input_dma_descr_bit = IO_BITNR(R_IRQ_MASK2_RD, dma5_descr),
231 .output_dma_bit = IO_BITNR(R_IRQ_MASK2_RD, dma4_eop),
232 .init_irqs = 1,
233#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL1_DMA)
234 .use_dma = 1,
235#else
236 .use_dma = 0,
237#endif
238 }
239};
240
241/* Register shadows */
242static unsigned sync_serial_prescale_shadow;
243
244#define NUMBER_OF_PORTS 2
245
246static struct file_operations sync_serial_fops = {
247 .owner = THIS_MODULE,
248 .write = sync_serial_write,
249 .read = sync_serial_read,
250 .poll = sync_serial_poll,
251 .ioctl = sync_serial_ioctl,
252 .open = sync_serial_open,
253 .release = sync_serial_release
254};
255
256static int __init etrax_sync_serial_init(void)
257{
258 ports[0].enabled = 0;
259 ports[1].enabled = 0;
260
261#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0)
262 if (cris_request_io_interface(if_sync_serial_1, "sync_ser1")) {
263 printk(KERN_CRIT "ETRAX100LX sync_serial: "
264 "Could not allocate IO group for port %d\n", 0);
265 return -EBUSY;
266 }
267#endif
268#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT1)
269 if (cris_request_io_interface(if_sync_serial_3, "sync_ser3")) {
270#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0)
271 cris_free_io_interface(if_sync_serial_1);
272#endif
273 printk(KERN_CRIT "ETRAX100LX sync_serial: "
274 "Could not allocate IO group for port %d\n", 1);
275 return -EBUSY;
276 }
277#endif
278
279 if (register_chrdev(SYNC_SERIAL_MAJOR, "sync serial",
280 &sync_serial_fops) < 0) {
281#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT1)
282 cris_free_io_interface(if_sync_serial_3);
283#endif
284#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0)
285 cris_free_io_interface(if_sync_serial_1);
286#endif
287 printk("unable to get major for synchronous serial port\n");
288 return -EBUSY;
289 }
290
291 /* Deselect synchronous serial ports while configuring. */
292 SETS(gen_config_ii_shadow, R_GEN_CONFIG_II, sermode1, async);
293 SETS(gen_config_ii_shadow, R_GEN_CONFIG_II, sermode3, async);
294 *R_GEN_CONFIG_II = gen_config_ii_shadow;
295
296 /* Initialize Ports */
297#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0)
298 ports[0].enabled = 1;
299 SETS(port_pb_i2c_shadow, R_PORT_PB_I2C, syncser1, ss1extra);
300 SETS(gen_config_ii_shadow, R_GEN_CONFIG_II, sermode1, sync);
301#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL0_DMA)
302 ports[0].use_dma = 1;
303#else
304 ports[0].use_dma = 0;
305#endif
306 initialize_port(0);
307#endif
308
309#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT1)
310 ports[1].enabled = 1;
311 SETS(port_pb_i2c_shadow, R_PORT_PB_I2C, syncser3, ss3extra);
312 SETS(gen_config_ii_shadow, R_GEN_CONFIG_II, sermode3, sync);
313#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL1_DMA)
314 ports[1].use_dma = 1;
315#else
316 ports[1].use_dma = 0;
317#endif
318 initialize_port(1);
319#endif
320
321 *R_PORT_PB_I2C = port_pb_i2c_shadow; /* Use PB4/PB7 */
322
323 /* Set up timing */
324 *R_SYNC_SERIAL_PRESCALE = sync_serial_prescale_shadow = (
325 IO_STATE(R_SYNC_SERIAL_PRESCALE, clk_sel_u1, codec) |
326 IO_STATE(R_SYNC_SERIAL_PRESCALE, word_stb_sel_u1, external) |
327 IO_STATE(R_SYNC_SERIAL_PRESCALE, clk_sel_u3, codec) |
328 IO_STATE(R_SYNC_SERIAL_PRESCALE, word_stb_sel_u3, external) |
329 IO_STATE(R_SYNC_SERIAL_PRESCALE, prescaler, div4) |
330 IO_FIELD(R_SYNC_SERIAL_PRESCALE, frame_rate,
331 DEFAULT_FRAME_RATE) |
332 IO_FIELD(R_SYNC_SERIAL_PRESCALE, word_rate, DEFAULT_WORD_RATE) |
333 IO_STATE(R_SYNC_SERIAL_PRESCALE, warp_mode, normal));
334
335 /* Select synchronous ports */
336 *R_GEN_CONFIG_II = gen_config_ii_shadow;
337
338 printk(KERN_INFO "ETRAX 100LX synchronous serial port driver\n");
339 return 0;
340}
341
342static void __init initialize_port(int portnbr)
343{
344 struct sync_port *port = &ports[portnbr];
345
346 DEBUG(printk(KERN_DEBUG "Init sync serial port %d\n", portnbr));
347
348 port->started = 0;
349 port->port_nbr = portnbr;
350 port->busy = 0;
351 port->tr_running = 0;
352
353 port->out_count = 0;
354 port->outp = port->out_buffer;
355
356 port->readp = port->flip;
357 port->writep = port->flip;
358 port->in_buffer_size = IN_BUFFER_SIZE;
359 port->inbufchunk = IN_DESCR_SIZE;
360 port->next_rx_desc = &port->in_descr[0];
361 port->prev_rx_desc = &port->in_descr[NUM_IN_DESCR-1];
362 port->prev_rx_desc->ctrl = d_eol;
363
364 init_waitqueue_head(&port->out_wait_q);
365 init_waitqueue_head(&port->in_wait_q);
366
367 port->ctrl_data_shadow =
368 IO_STATE(R_SYNC_SERIAL1_CTRL, tr_baud, c115k2Hz) |
369 IO_STATE(R_SYNC_SERIAL1_CTRL, mode, master_output) |
370 IO_STATE(R_SYNC_SERIAL1_CTRL, error, ignore) |
371 IO_STATE(R_SYNC_SERIAL1_CTRL, rec_enable, disable) |
372 IO_STATE(R_SYNC_SERIAL1_CTRL, f_synctype, normal) |
373 IO_STATE(R_SYNC_SERIAL1_CTRL, f_syncsize, word) |
374 IO_STATE(R_SYNC_SERIAL1_CTRL, f_sync, on) |
375 IO_STATE(R_SYNC_SERIAL1_CTRL, clk_mode, normal) |
376 IO_STATE(R_SYNC_SERIAL1_CTRL, clk_halt, stopped) |
377 IO_STATE(R_SYNC_SERIAL1_CTRL, bitorder, msb) |
378 IO_STATE(R_SYNC_SERIAL1_CTRL, tr_enable, disable) |
379 IO_STATE(R_SYNC_SERIAL1_CTRL, wordsize, size8bit) |
380 IO_STATE(R_SYNC_SERIAL1_CTRL, buf_empty, lmt_8) |
381 IO_STATE(R_SYNC_SERIAL1_CTRL, buf_full, lmt_8) |
382 IO_STATE(R_SYNC_SERIAL1_CTRL, flow_ctrl, enabled) |
383 IO_STATE(R_SYNC_SERIAL1_CTRL, clk_polarity, neg) |
384 IO_STATE(R_SYNC_SERIAL1_CTRL, frame_polarity, normal)|
385 IO_STATE(R_SYNC_SERIAL1_CTRL, status_polarity, inverted)|
386 IO_STATE(R_SYNC_SERIAL1_CTRL, clk_driver, normal) |
387 IO_STATE(R_SYNC_SERIAL1_CTRL, frame_driver, normal) |
388 IO_STATE(R_SYNC_SERIAL1_CTRL, status_driver, normal)|
389 IO_STATE(R_SYNC_SERIAL1_CTRL, def_out0, high);
390
391 if (port->use_dma)
392 port->ctrl_data_shadow |= IO_STATE(R_SYNC_SERIAL1_CTRL,
393 dma_enable, on);
394 else
395 port->ctrl_data_shadow |= IO_STATE(R_SYNC_SERIAL1_CTRL,
396 dma_enable, off);
397
398 *port->ctrl_data = port->ctrl_data_shadow;
399}
400
401static inline int sync_data_avail(struct sync_port *port)
402{
403 int avail;
404 unsigned char *start;
405 unsigned char *end;
406
407 start = (unsigned char *)port->readp; /* cast away volatile */
408 end = (unsigned char *)port->writep; /* cast away volatile */
409 /* 0123456789 0123456789
410 * ----- - -----
411 * ^rp ^wp ^wp ^rp
412 */
413 if (end >= start)
414 avail = end - start;
415 else
416 avail = port->in_buffer_size - (start - end);
417 return avail;
418}
419
420static inline int sync_data_avail_to_end(struct sync_port *port)
421{
422 int avail;
423 unsigned char *start;
424 unsigned char *end;
425
426 start = (unsigned char *)port->readp; /* cast away volatile */
427 end = (unsigned char *)port->writep; /* cast away volatile */
428 /* 0123456789 0123456789
429 * ----- -----
430 * ^rp ^wp ^wp ^rp
431 */
432
433 if (end >= start)
434 avail = end - start;
435 else
436 avail = port->flip + port->in_buffer_size - start;
437 return avail;
438}
439
440
441static int sync_serial_open(struct inode *inode, struct file *file)
442{
443 int dev = MINOR(inode->i_rdev);
444 struct sync_port *port;
445 int mode;
446
447 DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev));
448
449 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) {
450 DEBUG(printk(KERN_DEBUG "Invalid minor %d\n", dev));
451 return -ENODEV;
452 }
453 port = &ports[dev];
454 /* Allow open this device twice (assuming one reader and one writer) */
455 if (port->busy == 2) {
456 DEBUG(printk(KERN_DEBUG "Device is busy.. \n"));
457 return -EBUSY;
458 }
459 if (port->init_irqs) {
460 if (port->use_dma) {
461 if (port == &ports[0]) {
462#ifdef SYNC_SER_DMA
463 if (request_irq(24, tr_interrupt, 0,
464 "synchronous serial 1 dma tr",
465 &ports[0])) {
466 printk(KERN_CRIT "Can't alloc "
467 "sync serial port 1 IRQ");
468 return -EBUSY;
469 } else if (request_irq(25, rx_interrupt, 0,
470 "synchronous serial 1 dma rx",
471 &ports[0])) {
472 free_irq(24, &port[0]);
473 printk(KERN_CRIT "Can't alloc "
474 "sync serial port 1 IRQ");
475 return -EBUSY;
476 } else if (cris_request_dma(8,
477 "synchronous serial 1 dma tr",
478 DMA_VERBOSE_ON_ERROR,
479 dma_ser1)) {
480 free_irq(24, &port[0]);
481 free_irq(25, &port[0]);
482 printk(KERN_CRIT "Can't alloc "
483 "sync serial port 1 "
484 "TX DMA channel");
485 return -EBUSY;
486 } else if (cris_request_dma(9,
487 "synchronous serial 1 dma rec",
488 DMA_VERBOSE_ON_ERROR,
489 dma_ser1)) {
490 cris_free_dma(8, NULL);
491 free_irq(24, &port[0]);
492 free_irq(25, &port[0]);
493 printk(KERN_CRIT "Can't alloc "
494 "sync serial port 1 "
495 "RX DMA channel");
496 return -EBUSY;
497 }
498#endif
499 RESET_DMA(8); WAIT_DMA(8);
500 RESET_DMA(9); WAIT_DMA(9);
501 *R_DMA_CH8_CLR_INTR =
502 IO_STATE(R_DMA_CH8_CLR_INTR, clr_eop,
503 do) |
504 IO_STATE(R_DMA_CH8_CLR_INTR, clr_descr,
505 do);
506 *R_DMA_CH9_CLR_INTR =
507 IO_STATE(R_DMA_CH9_CLR_INTR, clr_eop,
508 do) |
509 IO_STATE(R_DMA_CH9_CLR_INTR, clr_descr,
510 do);
511 *R_IRQ_MASK2_SET =
512 IO_STATE(R_IRQ_MASK2_SET, dma8_eop,
513 set) |
514 IO_STATE(R_IRQ_MASK2_SET, dma9_descr,
515 set);
516 } else if (port == &ports[1]) {
517#ifdef SYNC_SER_DMA
518 if (request_irq(20, tr_interrupt, 0,
519 "synchronous serial 3 dma tr",
520 &ports[1])) {
521 printk(KERN_CRIT "Can't alloc "
522 "sync serial port 3 IRQ");
523 return -EBUSY;
524 } else if (request_irq(21, rx_interrupt, 0,
525 "synchronous serial 3 dma rx",
526 &ports[1])) {
527 free_irq(20, &ports[1]);
528 printk(KERN_CRIT "Can't alloc "
529 "sync serial port 3 IRQ");
530 return -EBUSY;
531 } else if (cris_request_dma(4,
532 "synchronous serial 3 dma tr",
533 DMA_VERBOSE_ON_ERROR,
534 dma_ser3)) {
535 free_irq(21, &ports[1]);
536 free_irq(20, &ports[1]);
537 printk(KERN_CRIT "Can't alloc "
538 "sync serial port 3 "
539 "TX DMA channel");
540 return -EBUSY;
541 } else if (cris_request_dma(5,
542 "synchronous serial 3 dma rec",
543 DMA_VERBOSE_ON_ERROR,
544 dma_ser3)) {
545 cris_free_dma(4, NULL);
546 free_irq(21, &ports[1]);
547 free_irq(20, &ports[1]);
548 printk(KERN_CRIT "Can't alloc "
549 "sync serial port 3 "
550 "RX DMA channel");
551 return -EBUSY;
552 }
553#endif
554 RESET_DMA(4); WAIT_DMA(4);
555 RESET_DMA(5); WAIT_DMA(5);
556 *R_DMA_CH4_CLR_INTR =
557 IO_STATE(R_DMA_CH4_CLR_INTR, clr_eop,
558 do) |
559 IO_STATE(R_DMA_CH4_CLR_INTR, clr_descr,
560 do);
561 *R_DMA_CH5_CLR_INTR =
562 IO_STATE(R_DMA_CH5_CLR_INTR, clr_eop,
563 do) |
564 IO_STATE(R_DMA_CH5_CLR_INTR, clr_descr,
565 do);
566 *R_IRQ_MASK2_SET =
567 IO_STATE(R_IRQ_MASK2_SET, dma4_eop,
568 set) |
569 IO_STATE(R_IRQ_MASK2_SET, dma5_descr,
570 set);
571 }
572 start_dma_in(port);
573 port->init_irqs = 0;
574 } else { /* !port->use_dma */
575#ifdef SYNC_SER_MANUAL
576 if (port == &ports[0]) {
577 if (request_irq(8,
578 manual_interrupt,
579 IRQF_SHARED | IRQF_DISABLED,
580 "synchronous serial manual irq",
581 &ports[0])) {
582 printk(KERN_CRIT "Can't alloc "
583 "sync serial manual irq");
584 return -EBUSY;
585 }
586 } else if (port == &ports[1]) {
587 if (request_irq(8,
588 manual_interrupt,
589 IRQF_SHARED | IRQF_DISABLED,
590 "synchronous serial manual irq",
591 &ports[1])) {
592 printk(KERN_CRIT "Can't alloc "
593 "sync serial manual irq");
594 return -EBUSY;
595 }
596 }
597 port->init_irqs = 0;
598#else
599 panic("sync_serial: Manual mode not supported.\n");
600#endif /* SYNC_SER_MANUAL */
601 }
602 } /* port->init_irqs */
603
604 port->busy++;
605 /* Start port if we use it as input */
606 mode = IO_EXTRACT(R_SYNC_SERIAL1_CTRL, mode, port->ctrl_data_shadow);
607 if (mode == IO_STATE_VALUE(R_SYNC_SERIAL1_CTRL, mode, master_input) ||
608 mode == IO_STATE_VALUE(R_SYNC_SERIAL1_CTRL, mode, slave_input) ||
609 mode == IO_STATE_VALUE(R_SYNC_SERIAL1_CTRL, mode, master_bidir) ||
610 mode == IO_STATE_VALUE(R_SYNC_SERIAL1_CTRL, mode, slave_bidir)) {
611 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, clk_halt,
612 running);
613 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, tr_enable,
614 enable);
615 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, rec_enable,
616 enable);
617 port->started = 1;
618 *port->ctrl_data = port->ctrl_data_shadow;
619 if (!port->use_dma)
620 *R_IRQ_MASK1_SET = 1 << port->data_avail_bit;
621 DEBUG(printk(KERN_DEBUG "sser%d rec started\n", dev));
622 }
623 return 0;
624}
625
626static int sync_serial_release(struct inode *inode, struct file *file)
627{
628 int dev = MINOR(inode->i_rdev);
629 struct sync_port *port;
630
631 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) {
632 DEBUG(printk(KERN_DEBUG "Invalid minor %d\n", dev));
633 return -ENODEV;
634 }
635 port = &ports[dev];
636 if (port->busy)
637 port->busy--;
638 if (!port->busy)
639 *R_IRQ_MASK1_CLR = ((1 << port->data_avail_bit) |
640 (1 << port->transmitter_ready_bit));
641
642 return 0;
643}
644
645
646
647static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
648{
649 int dev = MINOR(file->f_dentry->d_inode->i_rdev);
650 unsigned int mask = 0;
651 struct sync_port *port;
652 DEBUGPOLL(static unsigned int prev_mask = 0);
653
654 port = &ports[dev];
655 poll_wait(file, &port->out_wait_q, wait);
656 poll_wait(file, &port->in_wait_q, wait);
657 /* Some room to write */
658 if (port->out_count < OUT_BUFFER_SIZE)
659 mask |= POLLOUT | POLLWRNORM;
660 /* At least an inbufchunk of data */
661 if (sync_data_avail(port) >= port->inbufchunk)
662 mask |= POLLIN | POLLRDNORM;
663
664 DEBUGPOLL(if (mask != prev_mask)
665 printk(KERN_DEBUG "sync_serial_poll: mask 0x%08X %s %s\n",
666 mask,
667 mask & POLLOUT ? "POLLOUT" : "",
668 mask & POLLIN ? "POLLIN" : "");
669 prev_mask = mask;
670 );
671 return mask;
672}
673
674static int sync_serial_ioctl(struct inode *inode, struct file *file,
675 unsigned int cmd, unsigned long arg)
676{
677 int return_val = 0;
678 unsigned long flags;
679
680 int dev = MINOR(file->f_dentry->d_inode->i_rdev);
681 struct sync_port *port;
682
683 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) {
684 DEBUG(printk(KERN_DEBUG "Invalid minor %d\n", dev));
685 return -1;
686 }
687 port = &ports[dev];
688
689 local_irq_save(flags);
690 /* Disable port while changing config */
691 if (dev) {
692 if (port->use_dma) {
693 RESET_DMA(4); WAIT_DMA(4);
694 port->tr_running = 0;
695 port->out_count = 0;
696 port->outp = port->out_buffer;
697 *R_DMA_CH4_CLR_INTR =
698 IO_STATE(R_DMA_CH4_CLR_INTR, clr_eop, do) |
699 IO_STATE(R_DMA_CH4_CLR_INTR, clr_descr, do);
700 }
701 SETS(gen_config_ii_shadow, R_GEN_CONFIG_II, sermode3, async);
702 } else {
703 if (port->use_dma) {
704 RESET_DMA(8); WAIT_DMA(8);
705 port->tr_running = 0;
706 port->out_count = 0;
707 port->outp = port->out_buffer;
708 *R_DMA_CH8_CLR_INTR =
709 IO_STATE(R_DMA_CH8_CLR_INTR, clr_eop, do) |
710 IO_STATE(R_DMA_CH8_CLR_INTR, clr_descr, do);
711 }
712 SETS(gen_config_ii_shadow, R_GEN_CONFIG_II, sermode1, async);
713 }
714 *R_GEN_CONFIG_II = gen_config_ii_shadow;
715 local_irq_restore(flags);
716
717 switch (cmd) {
718 case SSP_SPEED:
719 if (GET_SPEED(arg) == CODEC) {
720 if (dev)
721 SETS(sync_serial_prescale_shadow,
722 R_SYNC_SERIAL_PRESCALE, clk_sel_u3,
723 codec);
724 else
725 SETS(sync_serial_prescale_shadow,
726 R_SYNC_SERIAL_PRESCALE, clk_sel_u1,
727 codec);
728
729 SETF(sync_serial_prescale_shadow,
730 R_SYNC_SERIAL_PRESCALE, prescaler,
731 GET_FREQ(arg));
732 SETF(sync_serial_prescale_shadow,
733 R_SYNC_SERIAL_PRESCALE, frame_rate,
734 GET_FRAME_RATE(arg));
735 SETF(sync_serial_prescale_shadow,
736 R_SYNC_SERIAL_PRESCALE, word_rate,
737 GET_WORD_RATE(arg));
738 } else {
739 SETF(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
740 tr_baud, GET_SPEED(arg));
741 if (dev)
742 SETS(sync_serial_prescale_shadow,
743 R_SYNC_SERIAL_PRESCALE, clk_sel_u3,
744 baudrate);
745 else
746 SETS(sync_serial_prescale_shadow,
747 R_SYNC_SERIAL_PRESCALE, clk_sel_u1,
748 baudrate);
749 }
750 break;
751 case SSP_MODE:
752 if (arg > 5)
753 return -EINVAL;
754 if (arg == MASTER_OUTPUT || arg == SLAVE_OUTPUT)
755 *R_IRQ_MASK1_CLR = 1 << port->data_avail_bit;
756 else if (!port->use_dma)
757 *R_IRQ_MASK1_SET = 1 << port->data_avail_bit;
758 SETF(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, mode, arg);
759 break;
760 case SSP_FRAME_SYNC:
761 if (arg & NORMAL_SYNC)
762 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
763 f_synctype, normal);
764 else if (arg & EARLY_SYNC)
765 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
766 f_synctype, early);
767
768 if (arg & BIT_SYNC)
769 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
770 f_syncsize, bit);
771 else if (arg & WORD_SYNC)
772 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
773 f_syncsize, word);
774 else if (arg & EXTENDED_SYNC)
775 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
776 f_syncsize, extended);
777
778 if (arg & SYNC_ON)
779 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
780 f_sync, on);
781 else if (arg & SYNC_OFF)
782 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
783 f_sync, off);
784
785 if (arg & WORD_SIZE_8)
786 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
787 wordsize, size8bit);
788 else if (arg & WORD_SIZE_12)
789 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
790 wordsize, size12bit);
791 else if (arg & WORD_SIZE_16)
792 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
793 wordsize, size16bit);
794 else if (arg & WORD_SIZE_24)
795 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
796 wordsize, size24bit);
797 else if (arg & WORD_SIZE_32)
798 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
799 wordsize, size32bit);
800
801 if (arg & BIT_ORDER_MSB)
802 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
803 bitorder, msb);
804 else if (arg & BIT_ORDER_LSB)
805 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
806 bitorder, lsb);
807
808 if (arg & FLOW_CONTROL_ENABLE)
809 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
810 flow_ctrl, enabled);
811 else if (arg & FLOW_CONTROL_DISABLE)
812 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
813 flow_ctrl, disabled);
814
815 if (arg & CLOCK_NOT_GATED)
816 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
817 clk_mode, normal);
818 else if (arg & CLOCK_GATED)
819 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
820 clk_mode, gated);
821
822 break;
823 case SSP_IPOLARITY:
824 /* NOTE!! negedge is considered NORMAL */
825 if (arg & CLOCK_NORMAL)
826 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
827 clk_polarity, neg);
828 else if (arg & CLOCK_INVERT)
829 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
830 clk_polarity, pos);
831
832 if (arg & FRAME_NORMAL)
833 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
834 frame_polarity, normal);
835 else if (arg & FRAME_INVERT)
836 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
837 frame_polarity, inverted);
838
839 if (arg & STATUS_NORMAL)
840 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
841 status_polarity, normal);
842 else if (arg & STATUS_INVERT)
843 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
844 status_polarity, inverted);
845 break;
846 case SSP_OPOLARITY:
847 if (arg & CLOCK_NORMAL)
848 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
849 clk_driver, normal);
850 else if (arg & CLOCK_INVERT)
851 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
852 clk_driver, inverted);
853
854 if (arg & FRAME_NORMAL)
855 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
856 frame_driver, normal);
857 else if (arg & FRAME_INVERT)
858 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
859 frame_driver, inverted);
860
861 if (arg & STATUS_NORMAL)
862 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
863 status_driver, normal);
864 else if (arg & STATUS_INVERT)
865 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
866 status_driver, inverted);
867 break;
868 case SSP_SPI:
869 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, flow_ctrl,
870 disabled);
871 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, bitorder,
872 msb);
873 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, wordsize,
874 size8bit);
875 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, f_sync, on);
876 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, f_syncsize,
877 word);
878 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, f_synctype,
879 normal);
880 if (arg & SPI_SLAVE) {
881 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
882 frame_polarity, inverted);
883 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
884 clk_polarity, neg);
885 SETF(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
886 mode, SLAVE_INPUT);
887 } else {
888 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
889 frame_driver, inverted);
890 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
891 clk_driver, inverted);
892 SETF(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL,
893 mode, MASTER_OUTPUT);
894 }
895 break;
896 case SSP_INBUFCHUNK:
897#if 0
898 if (arg > port->in_buffer_size/NUM_IN_DESCR)
899 return -EINVAL;
900 port->inbufchunk = arg;
901 /* Make sure in_buffer_size is a multiple of inbufchunk */
902 port->in_buffer_size =
903 (port->in_buffer_size/port->inbufchunk) *
904 port->inbufchunk;
905 DEBUG(printk(KERN_DEBUG "inbufchunk %i in_buffer_size: %i\n",
906 port->inbufchunk, port->in_buffer_size));
907 if (port->use_dma) {
908 if (port->port_nbr == 0) {
909 RESET_DMA(9);
910 WAIT_DMA(9);
911 } else {
912 RESET_DMA(5);
913 WAIT_DMA(5);
914 }
915 start_dma_in(port);
916 }
917#endif
918 break;
919 default:
920 return_val = -1;
921 }
922 /* Make sure we write the config without interruption */
923 local_irq_save(flags);
924 /* Set config and enable port */
925 *port->ctrl_data = port->ctrl_data_shadow;
926 nop(); nop(); nop(); nop();
927 *R_SYNC_SERIAL_PRESCALE = sync_serial_prescale_shadow;
928 nop(); nop(); nop(); nop();
929 if (dev)
930 SETS(gen_config_ii_shadow, R_GEN_CONFIG_II, sermode3, sync);
931 else
932 SETS(gen_config_ii_shadow, R_GEN_CONFIG_II, sermode1, sync);
933
934 *R_GEN_CONFIG_II = gen_config_ii_shadow;
935 /* Reset DMA. At readout from serial port the data could be shifted
936 * one byte if not resetting DMA.
937 */
938 if (port->use_dma) {
939 if (port->port_nbr == 0) {
940 RESET_DMA(9);
941 WAIT_DMA(9);
942 } else {
943 RESET_DMA(5);
944 WAIT_DMA(5);
945 }
946 start_dma_in(port);
947 }
948 local_irq_restore(flags);
949 return return_val;
950}
951
952
953static ssize_t sync_serial_write(struct file *file, const char *buf,
954 size_t count, loff_t *ppos)
955{
956 int dev = MINOR(file->f_dentry->d_inode->i_rdev);
957 DECLARE_WAITQUEUE(wait, current);
958 struct sync_port *port;
959 unsigned long flags;
960 unsigned long c, c1;
961 unsigned long free_outp;
962 unsigned long outp;
963 unsigned long out_buffer;
964
965 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) {
966 DEBUG(printk(KERN_DEBUG "Invalid minor %d\n", dev));
967 return -ENODEV;
968 }
969 port = &ports[dev];
970
971 DEBUGWRITE(printk(KERN_DEBUG "W d%d c %lu (%d/%d)\n",
972 port->port_nbr, count, port->out_count, OUT_BUFFER_SIZE));
973 /* Space to end of buffer */
974 /*
975 * out_buffer <c1>012345<- c ->OUT_BUFFER_SIZE
976 * outp^ +out_count
977 * ^free_outp
978 * out_buffer 45<- c ->0123OUT_BUFFER_SIZE
979 * +out_count outp^
980 * free_outp
981 *
982 */
983
984 /* Read variables that may be updated by interrupts */
985 local_irq_save(flags);
986 if (count > OUT_BUFFER_SIZE - port->out_count)
987 count = OUT_BUFFER_SIZE - port->out_count;
988
989 outp = (unsigned long)port->outp;
990 free_outp = outp + port->out_count;
991 local_irq_restore(flags);
992 out_buffer = (unsigned long)port->out_buffer;
993
994 /* Find out where and how much to write */
995 if (free_outp >= out_buffer + OUT_BUFFER_SIZE)
996 free_outp -= OUT_BUFFER_SIZE;
997 if (free_outp >= outp)
998 c = out_buffer + OUT_BUFFER_SIZE - free_outp;
999 else
1000 c = outp - free_outp;
1001 if (c > count)
1002 c = count;
1003
1004 DEBUGWRITE(printk(KERN_DEBUG "w op %08lX fop %08lX c %lu\n",
1005 outp, free_outp, c));
1006 if (copy_from_user((void *)free_outp, buf, c))
1007 return -EFAULT;
1008
1009 if (c != count) {
1010 buf += c;
1011 c1 = count - c;
1012 DEBUGWRITE(printk(KERN_DEBUG "w2 fi %lu c %lu c1 %lu\n",
1013 free_outp-out_buffer, c, c1));
1014 if (copy_from_user((void *)out_buffer, buf, c1))
1015 return -EFAULT;
1016 }
1017 local_irq_save(flags);
1018 port->out_count += count;
1019 local_irq_restore(flags);
1020
1021 /* Make sure transmitter/receiver is running */
1022 if (!port->started) {
1023 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, clk_halt,
1024 running);
1025 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, tr_enable,
1026 enable);
1027 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, rec_enable,
1028 enable);
1029 port->started = 1;
1030 }
1031
1032 *port->ctrl_data = port->ctrl_data_shadow;
1033
1034 if (file->f_flags & O_NONBLOCK) {
1035 local_irq_save(flags);
1036 if (!port->tr_running) {
1037 if (!port->use_dma) {
1038 /* Start sender by writing data */
1039 send_word(port);
1040 /* and enable transmitter ready IRQ */
1041 *R_IRQ_MASK1_SET = 1 <<
1042 port->transmitter_ready_bit;
1043 } else
1044 start_dma(port,
1045 (unsigned char *volatile)port->outp, c);
1046 }
1047 local_irq_restore(flags);
1048 DEBUGWRITE(printk(KERN_DEBUG "w d%d c %lu NB\n",
1049 port->port_nbr, count));
1050 return count;
1051 }
1052
1053 /* Sleep until all sent */
1054 add_wait_queue(&port->out_wait_q, &wait);
1055 set_current_state(TASK_INTERRUPTIBLE);
1056 local_irq_save(flags);
1057 if (!port->tr_running) {
1058 if (!port->use_dma) {
1059 /* Start sender by writing data */
1060 send_word(port);
1061 /* and enable transmitter ready IRQ */
1062 *R_IRQ_MASK1_SET = 1 << port->transmitter_ready_bit;
1063 } else
1064 start_dma(port, port->outp, c);
1065 }
1066 local_irq_restore(flags);
1067 schedule();
1068 set_current_state(TASK_RUNNING);
1069 remove_wait_queue(&port->out_wait_q, &wait);
1070 if (signal_pending(current))
1071 return -EINTR;
1072
1073 DEBUGWRITE(printk(KERN_DEBUG "w d%d c %lu\n", port->port_nbr, count));
1074 return count;
1075}
1076
1077static ssize_t sync_serial_read(struct file *file, char *buf,
1078 size_t count, loff_t *ppos)
1079{
1080 int dev = MINOR(file->f_dentry->d_inode->i_rdev);
1081 int avail;
1082 struct sync_port *port;
1083 unsigned char *start;
1084 unsigned char *end;
1085 unsigned long flags;
1086
1087 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) {
1088 DEBUG(printk(KERN_DEBUG "Invalid minor %d\n", dev));
1089 return -ENODEV;
1090 }
1091 port = &ports[dev];
1092
1093 DEBUGREAD(printk(KERN_DEBUG "R%d c %d ri %lu wi %lu /%lu\n",
1094 dev, count, port->readp - port->flip,
1095 port->writep - port->flip, port->in_buffer_size));
1096
1097 if (!port->started) {
1098 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, clk_halt,
1099 running);
1100 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, tr_enable,
1101 enable);
1102 SETS(port->ctrl_data_shadow, R_SYNC_SERIAL1_CTRL, rec_enable,
1103 enable);
1104 port->started = 1;
1105 }
1106 *port->ctrl_data = port->ctrl_data_shadow;
1107
1108 /* Calculate number of available bytes */
1109 /* Save pointers to avoid that they are modified by interrupt */
1110 local_irq_save(flags);
1111 start = (unsigned char *)port->readp; /* cast away volatile */
1112 end = (unsigned char *)port->writep; /* cast away volatile */
1113 local_irq_restore(flags);
1114 while (start == end && !port->full) {
1115 /* No data */
1116 if (file->f_flags & O_NONBLOCK)
1117 return -EAGAIN;
1118
1119 interruptible_sleep_on(&port->in_wait_q);
1120 if (signal_pending(current))
1121 return -EINTR;
1122
1123 local_irq_save(flags);
1124 start = (unsigned char *)port->readp; /* cast away volatile */
1125 end = (unsigned char *)port->writep; /* cast away volatile */
1126 local_irq_restore(flags);
1127 }
1128
1129 /* Lazy read, never return wrapped data. */
1130 if (port->full)
1131 avail = port->in_buffer_size;
1132 else if (end > start)
1133 avail = end - start;
1134 else
1135 avail = port->flip + port->in_buffer_size - start;
1136
1137 count = count > avail ? avail : count;
1138 if (copy_to_user(buf, start, count))
1139 return -EFAULT;
1140 /* Disable interrupts while updating readp */
1141 local_irq_save(flags);
1142 port->readp += count;
1143 if (port->readp >= port->flip + port->in_buffer_size) /* Wrap? */
1144 port->readp = port->flip;
1145 port->full = 0;
1146 local_irq_restore(flags);
1147 DEBUGREAD(printk(KERN_DEBUG "r %d\n", count));
1148 return count;
1149}
1150
1151static void send_word(struct sync_port *port)
1152{
1153 switch (IO_EXTRACT(R_SYNC_SERIAL1_CTRL, wordsize,
1154 port->ctrl_data_shadow)) {
1155 case IO_STATE_VALUE(R_SYNC_SERIAL1_CTRL, wordsize, size8bit):
1156 port->out_count--;
1157 *port->data_out = *port->outp++;
1158 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE)
1159 port->outp = port->out_buffer;
1160 break;
1161 case IO_STATE_VALUE(R_SYNC_SERIAL1_CTRL, wordsize, size12bit):
1162 {
1163 int data = (*port->outp++) << 8;
1164 data |= *port->outp++;
1165 port->out_count -= 2;
1166 *port->data_out = data;
1167 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE)
1168 port->outp = port->out_buffer;
1169 break;
1170 }
1171 case IO_STATE_VALUE(R_SYNC_SERIAL1_CTRL, wordsize, size16bit):
1172 port->out_count -= 2;
1173 *port->data_out = *(unsigned short *)port->outp;
1174 port->outp += 2;
1175 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE)
1176 port->outp = port->out_buffer;
1177 break;
1178 case IO_STATE_VALUE(R_SYNC_SERIAL1_CTRL, wordsize, size24bit):
1179 port->out_count -= 3;
1180 *port->data_out = *(unsigned int *)port->outp;
1181 port->outp += 3;
1182 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE)
1183 port->outp = port->out_buffer;
1184 break;
1185 case IO_STATE_VALUE(R_SYNC_SERIAL1_CTRL, wordsize, size32bit):
1186 port->out_count -= 4;
1187 *port->data_out = *(unsigned int *)port->outp;
1188 port->outp += 4;
1189 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE)
1190 port->outp = port->out_buffer;
1191 break;
1192 }
1193}
1194
1195
1196static void start_dma(struct sync_port *port, const char *data, int count)
1197{
1198 port->tr_running = 1;
1199 port->out_descr.hw_len = 0;
1200 port->out_descr.next = 0;
1201 port->out_descr.ctrl = d_eol | d_eop; /* No d_wait to avoid glitches */
1202 port->out_descr.sw_len = count;
1203 port->out_descr.buf = virt_to_phys(data);
1204 port->out_descr.status = 0;
1205
1206 *port->output_dma_first = virt_to_phys(&port->out_descr);
1207 *port->output_dma_cmd = IO_STATE(R_DMA_CH0_CMD, cmd, start);
1208 DEBUGTXINT(printk(KERN_DEBUG "dma %08lX c %d\n",
1209 (unsigned long)data, count));
1210}
1211
1212static void start_dma_in(struct sync_port *port)
1213{
1214 int i;
1215 unsigned long buf;
1216 port->writep = port->flip;
1217
1218 if (port->writep > port->flip + port->in_buffer_size) {
1219 panic("Offset too large in sync serial driver\n");
1220 return;
1221 }
1222 buf = virt_to_phys(port->in_buffer);
1223 for (i = 0; i < NUM_IN_DESCR; i++) {
1224 port->in_descr[i].sw_len = port->inbufchunk;
1225 port->in_descr[i].ctrl = d_int;
1226 port->in_descr[i].next = virt_to_phys(&port->in_descr[i+1]);
1227 port->in_descr[i].buf = buf;
1228 port->in_descr[i].hw_len = 0;
1229 port->in_descr[i].status = 0;
1230 port->in_descr[i].fifo_len = 0;
1231 buf += port->inbufchunk;
1232 prepare_rx_descriptor(&port->in_descr[i]);
1233 }
1234 /* Link the last descriptor to the first */
1235 port->in_descr[i-1].next = virt_to_phys(&port->in_descr[0]);
1236 port->in_descr[i-1].ctrl |= d_eol;
1237 port->next_rx_desc = &port->in_descr[0];
1238 port->prev_rx_desc = &port->in_descr[NUM_IN_DESCR - 1];
1239 *port->input_dma_first = virt_to_phys(port->next_rx_desc);
1240 *port->input_dma_cmd = IO_STATE(R_DMA_CH0_CMD, cmd, start);
1241}
1242
1243#ifdef SYNC_SER_DMA
1244static irqreturn_t tr_interrupt(int irq, void *dev_id)
1245{
1246 unsigned long ireg = *R_IRQ_MASK2_RD;
1247 struct etrax_dma_descr *descr;
1248 unsigned int sentl;
1249 int handled = 0;
1250 int i;
1251
1252 for (i = 0; i < NUMBER_OF_PORTS; i++) {
1253 struct sync_port *port = &ports[i];
1254 if (!port->enabled || !port->use_dma)
1255 continue;
1256
1257 /* IRQ active for the port? */
1258 if (!(ireg & (1 << port->output_dma_bit)))
1259 continue;
1260
1261 handled = 1;
1262
1263 /* Clear IRQ */
1264 *port->output_dma_clr_irq =
1265 IO_STATE(R_DMA_CH0_CLR_INTR, clr_eop, do) |
1266 IO_STATE(R_DMA_CH0_CLR_INTR, clr_descr, do);
1267
1268 descr = &port->out_descr;
1269 if (!(descr->status & d_stop))
1270 sentl = descr->sw_len;
1271 else
1272 /* Otherwise find amount of data sent here */
1273 sentl = descr->hw_len;
1274
1275 port->out_count -= sentl;
1276 port->outp += sentl;
1277 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE)
1278 port->outp = port->out_buffer;
1279 if (port->out_count) {
1280 int c = port->out_buffer + OUT_BUFFER_SIZE - port->outp;
1281 if (c > port->out_count)
1282 c = port->out_count;
1283 DEBUGTXINT(printk(KERN_DEBUG
1284 "tx_int DMAWRITE %i %i\n", sentl, c));
1285 start_dma(port, port->outp, c);
1286 } else {
1287 DEBUGTXINT(printk(KERN_DEBUG
1288 "tx_int DMA stop %i\n", sentl));
1289 port->tr_running = 0;
1290 }
1291 /* wake up the waiting process */
1292 wake_up_interruptible(&port->out_wait_q);
1293 }
1294 return IRQ_RETVAL(handled);
1295} /* tr_interrupt */
1296
1297static irqreturn_t rx_interrupt(int irq, void *dev_id)
1298{
1299 unsigned long ireg = *R_IRQ_MASK2_RD;
1300 int i;
1301 int handled = 0;
1302
1303 for (i = 0; i < NUMBER_OF_PORTS; i++) {
1304 struct sync_port *port = &ports[i];
1305
1306 if (!port->enabled || !port->use_dma)
1307 continue;
1308
1309 if (!(ireg & (1 << port->input_dma_descr_bit)))
1310 continue;
1311
1312 /* Descriptor interrupt */
1313 handled = 1;
1314 while (*port->input_dma_descr !=
1315 virt_to_phys(port->next_rx_desc)) {
1316 if (port->writep + port->inbufchunk > port->flip +
1317 port->in_buffer_size) {
1318 int first_size = port->flip +
1319 port->in_buffer_size - port->writep;
1320 memcpy(port->writep,
1321 phys_to_virt(port->next_rx_desc->buf),
1322 first_size);
1323 memcpy(port->flip,
1324 phys_to_virt(port->next_rx_desc->buf +
1325 first_size),
1326 port->inbufchunk - first_size);
1327 port->writep = port->flip +
1328 port->inbufchunk - first_size;
1329 } else {
1330 memcpy(port->writep,
1331 phys_to_virt(port->next_rx_desc->buf),
1332 port->inbufchunk);
1333 port->writep += port->inbufchunk;
1334 if (port->writep >= port->flip
1335 + port->in_buffer_size)
1336 port->writep = port->flip;
1337 }
1338 if (port->writep == port->readp)
1339 port->full = 1;
1340 prepare_rx_descriptor(port->next_rx_desc);
1341 port->next_rx_desc->ctrl |= d_eol;
1342 port->prev_rx_desc->ctrl &= ~d_eol;
1343 port->prev_rx_desc = phys_to_virt((unsigned)
1344 port->next_rx_desc);
1345 port->next_rx_desc = phys_to_virt((unsigned)
1346 port->next_rx_desc->next);
1347 /* Wake up the waiting process */
1348 wake_up_interruptible(&port->in_wait_q);
1349 *port->input_dma_cmd = IO_STATE(R_DMA_CH1_CMD,
1350 cmd, restart);
1351 /* DMA has reached end of descriptor */
1352 *port->input_dma_clr_irq = IO_STATE(R_DMA_CH0_CLR_INTR,
1353 clr_descr, do);
1354 }
1355 }
1356 return IRQ_RETVAL(handled);
1357} /* rx_interrupt */
1358#endif /* SYNC_SER_DMA */
1359
1360#ifdef SYNC_SER_MANUAL
1361static irqreturn_t manual_interrupt(int irq, void *dev_id)
1362{
1363 int i;
1364 int handled = 0;
1365
1366 for (i = 0; i < NUMBER_OF_PORTS; i++) {
1367 struct sync_port *port = &ports[i];
1368
1369 if (!port->enabled || port->use_dma)
1370 continue;
1371
1372 /* Data received? */
1373 if (*R_IRQ_MASK1_RD & (1 << port->data_avail_bit)) {
1374 handled = 1;
1375 /* Read data */
1376 switch (port->ctrl_data_shadow &
1377 IO_MASK(R_SYNC_SERIAL1_CTRL, wordsize)) {
1378 case IO_STATE(R_SYNC_SERIAL1_CTRL, wordsize, size8bit):
1379 *port->writep++ =
1380 *(volatile char *)port->data_in;
1381 break;
1382 case IO_STATE(R_SYNC_SERIAL1_CTRL, wordsize, size12bit):
1383 {
1384 int data = *(unsigned short *)port->data_in;
1385 *port->writep = (data & 0x0ff0) >> 4;
1386 *(port->writep + 1) = data & 0x0f;
1387 port->writep += 2;
1388 break;
1389 }
1390 case IO_STATE(R_SYNC_SERIAL1_CTRL, wordsize, size16bit):
1391 *(unsigned short *)port->writep =
1392 *(volatile unsigned short *)port->data_in;
1393 port->writep += 2;
1394 break;
1395 case IO_STATE(R_SYNC_SERIAL1_CTRL, wordsize, size24bit):
1396 *(unsigned int *)port->writep = *port->data_in;
1397 port->writep += 3;
1398 break;
1399 case IO_STATE(R_SYNC_SERIAL1_CTRL, wordsize, size32bit):
1400 *(unsigned int *)port->writep = *port->data_in;
1401 port->writep += 4;
1402 break;
1403 }
1404
1405 /* Wrap? */
1406 if (port->writep >= port->flip + port->in_buffer_size)
1407 port->writep = port->flip;
1408 if (port->writep == port->readp) {
1409 /* Receive buffer overrun, discard oldest */
1410 port->readp++;
1411 /* Wrap? */
1412 if (port->readp >= port->flip +
1413 port->in_buffer_size)
1414 port->readp = port->flip;
1415 }
1416 if (sync_data_avail(port) >= port->inbufchunk) {
1417 /* Wake up application */
1418 wake_up_interruptible(&port->in_wait_q);
1419 }
1420 }
1421
1422 /* Transmitter ready? */
1423 if (*R_IRQ_MASK1_RD & (1 << port->transmitter_ready_bit)) {
1424 if (port->out_count > 0) {
1425 /* More data to send */
1426 send_word(port);
1427 } else {
1428 /* Transmission finished */
1429 /* Turn off IRQ */
1430 *R_IRQ_MASK1_CLR = 1 <<
1431 port->transmitter_ready_bit;
1432 /* Wake up application */
1433 wake_up_interruptible(&port->out_wait_q);
1434 }
1435 }
1436 }
1437 return IRQ_RETVAL(handled);
1438}
1439#endif
1440
1441module_init(etrax_sync_serial_init);
diff --git a/arch/cris/arch-v10/kernel/debugport.c b/arch/cris/arch-v10/kernel/debugport.c
index 93679a48c791..04d5eee2c90c 100644
--- a/arch/cris/arch-v10/kernel/debugport.c
+++ b/arch/cris/arch-v10/kernel/debugport.c
@@ -1,6 +1,6 @@
1/* Serialport functions for debugging 1/* Serialport functions for debugging
2 * 2 *
3 * Copyright (c) 2000 Axis Communications AB 3 * Copyright (c) 2000-2007 Axis Communications AB
4 * 4 *
5 * Authors: Bjorn Wesen 5 * Authors: Bjorn Wesen
6 * 6 *
@@ -11,96 +11,6 @@
11 * enableDebugIRQ() 11 * enableDebugIRQ()
12 * init_etrax_debug() 12 * init_etrax_debug()
13 * 13 *
14 * $Log: debugport.c,v $
15 * Revision 1.27 2005/06/10 10:34:14 starvik
16 * Real console support
17 *
18 * Revision 1.26 2005/06/07 07:06:07 starvik
19 * Added LF->CR translation to make ETRAX customers happy.
20 *
21 * Revision 1.25 2005/03/08 08:56:47 mikaelam
22 * Do only set index as port->index if port is defined, otherwise use the index from the command line
23 *
24 * Revision 1.24 2005/01/19 10:26:33 mikaelam
25 * Return the cris serial driver in console device driver callback function
26 *
27 * Revision 1.23 2005/01/14 10:12:17 starvik
28 * KGDB on separate port.
29 * Console fixes from 2.4.
30 *
31 * Revision 1.22 2005/01/11 16:06:13 starvik
32 * typo
33 *
34 * Revision 1.21 2005/01/11 13:49:14 starvik
35 * Added raw_printk to be used where we don't trust the console.
36 *
37 * Revision 1.20 2004/12/27 11:18:32 starvik
38 * Merge of Linux 2.6.10 (not functional yet).
39 *
40 * Revision 1.19 2004/10/21 07:26:16 starvik
41 * Made it possible to specify console settings on kernel command line.
42 *
43 * Revision 1.18 2004/10/19 13:07:37 starvik
44 * Merge of Linux 2.6.9
45 *
46 * Revision 1.17 2004/09/29 10:33:46 starvik
47 * Resolved a dealock when printing debug from kernel.
48 *
49 * Revision 1.16 2004/08/24 06:12:19 starvik
50 * Whitespace cleanup
51 *
52 * Revision 1.15 2004/08/16 12:37:19 starvik
53 * Merge of Linux 2.6.8
54 *
55 * Revision 1.14 2004/05/17 13:11:29 starvik
56 * Disable DMA until real serial driver is up
57 *
58 * Revision 1.13 2004/05/14 07:58:01 starvik
59 * Merge of changes from 2.4
60 *
61 * Revision 1.12 2003/09/11 07:29:49 starvik
62 * Merge of Linux 2.6.0-test5
63 *
64 * Revision 1.11 2003/07/07 09:53:36 starvik
65 * Revert all the 2.5.74 merge changes to make the console work again
66 *
67 * Revision 1.9 2003/02/17 17:07:23 starvik
68 * Solved the problem with corrupted debug output (from Linux 2.4)
69 * * Wait until DMA, FIFO and pipe is empty before and after transmissions
70 * * Buffer data until a FIFO flush can be triggered.
71 *
72 * Revision 1.8 2003/01/22 06:48:36 starvik
73 * Fixed warnings issued by GCC 3.2.1
74 *
75 * Revision 1.7 2002/12/12 08:26:32 starvik
76 * Don't use C-comments inside CVS comments
77 *
78 * Revision 1.6 2002/12/11 15:42:02 starvik
79 * Extracted v10 (ETRAX 100LX) specific stuff from arch/cris/kernel/
80 *
81 * Revision 1.5 2002/11/20 06:58:03 starvik
82 * Compiles with kgdb
83 *
84 * Revision 1.4 2002/11/19 14:35:24 starvik
85 * Changes from linux 2.4
86 * Changed struct initializer syntax to the currently preferred notation
87 *
88 * Revision 1.3 2002/11/06 09:47:03 starvik
89 * Modified for new interrupt macros
90 *
91 * Revision 1.2 2002/01/21 15:21:50 bjornw
92 * Update for kdev_t changes
93 *
94 * Revision 1.6 2001/04/17 13:58:39 orjanf
95 * * Renamed CONFIG_KGDB to CONFIG_ETRAX_KGDB.
96 *
97 * Revision 1.5 2001/03/26 14:22:05 bjornw
98 * Namechange of some config options
99 *
100 * Revision 1.4 2000/10/06 12:37:26 bjornw
101 * Use physical addresses when talking to DMA
102 *
103 *
104 */ 14 */
105 15
106#include <linux/console.h> 16#include <linux/console.h>
@@ -112,6 +22,8 @@
112#include <asm/arch/svinto.h> 22#include <asm/arch/svinto.h>
113#include <asm/io.h> /* Get SIMCOUT. */ 23#include <asm/io.h> /* Get SIMCOUT. */
114 24
25extern void reset_watchdog(void);
26
115struct dbg_port 27struct dbg_port
116{ 28{
117 unsigned int index; 29 unsigned int index;
@@ -188,7 +100,9 @@ struct dbg_port ports[]=
188 } 100 }
189}; 101};
190 102
103#ifdef CONFIG_ETRAX_SERIAL
191extern struct tty_driver *serial_driver; 104extern struct tty_driver *serial_driver;
105#endif
192 106
193struct dbg_port* port = 107struct dbg_port* port =
194#if defined(CONFIG_ETRAX_DEBUG_PORT0) 108#if defined(CONFIG_ETRAX_DEBUG_PORT0)
@@ -368,11 +282,12 @@ console_write_direct(struct console *co, const char *buf, unsigned int len)
368{ 282{
369 int i; 283 int i;
370 unsigned long flags; 284 unsigned long flags;
371 local_irq_save(flags);
372 285
373 if (!port) 286 if (!port)
374 return; 287 return;
375 288
289 local_irq_save(flags);
290
376 /* Send data */ 291 /* Send data */
377 for (i = 0; i < len; i++) { 292 for (i = 0; i < len; i++) {
378 /* LF -> CRLF */ 293 /* LF -> CRLF */
@@ -386,26 +301,16 @@ console_write_direct(struct console *co, const char *buf, unsigned int len)
386 ; 301 ;
387 *port->write = buf[i]; 302 *port->write = buf[i];
388 } 303 }
389 local_irq_restore(flags);
390}
391 304
392int raw_printk(const char *fmt, ...) 305 /*
393{ 306 * Feed the watchdog, otherwise it will reset the chip during boot.
394 static char buf[1024]; 307 * The time to send an ordinary boot message line (10-90 chars)
395 int printed_len; 308 * varies between 1-8ms at 115200. What makes up for the additional
396 static int first = 1; 309 * 90ms that allows the watchdog to bite?
397 if (first) { 310 */
398 /* Force reinitialization of the port to get manual mode. */ 311 reset_watchdog();
399 port->started = 0; 312
400 start_port(port); 313 local_irq_restore(flags);
401 first = 0;
402 }
403 va_list args;
404 va_start(args, fmt);
405 printed_len = vsnprintf(buf, sizeof(buf), fmt, args);
406 va_end(args);
407 console_write_direct(NULL, buf, strlen(buf));
408 return printed_len;
409} 314}
410 315
411static void 316static void
@@ -500,6 +405,7 @@ console_setup(struct console *co, char *options)
500 return 0; 405 return 0;
501} 406}
502 407
408
503/* This is a dummy serial device that throws away anything written to it. 409/* This is a dummy serial device that throws away anything written to it.
504 * This is used when no debug output is wanted. 410 * This is used when no debug output is wanted.
505 */ 411 */
@@ -555,7 +461,13 @@ etrax_console_device(struct console* co, int *index)
555{ 461{
556 if (port) 462 if (port)
557 *index = port->index; 463 *index = port->index;
464 else
465 *index = 0;
466#ifdef CONFIG_ETRAX_SERIAL
558 return port ? serial_driver : &dummy_driver; 467 return port ? serial_driver : &dummy_driver;
468#else
469 return &dummy_driver;
470#endif
559} 471}
560 472
561static struct console sercons = { 473static struct console sercons = {
diff --git a/arch/cris/arch-v10/kernel/dma.c b/arch/cris/arch-v10/kernel/dma.c
index e9a0311b141d..eb1fa0d2b49f 100644
--- a/arch/cris/arch-v10/kernel/dma.c
+++ b/arch/cris/arch-v10/kernel/dma.c
@@ -1,6 +1,5 @@
1/* Wrapper for DMA channel allocator that updates DMA client muxing. 1/* Wrapper for DMA channel allocator that updates DMA client muxing.
2 * Copyright 2004, Axis Communications AB 2 * Copyright 2004-2007, Axis Communications AB
3 * $Id: dma.c,v 1.1 2004/12/13 12:21:51 starvik Exp $
4 */ 3 */
5 4
6#include <linux/kernel.h> 5#include <linux/kernel.h>
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S
index d1361dc119e2..3a65f322ae07 100644
--- a/arch/cris/arch-v10/kernel/entry.S
+++ b/arch/cris/arch-v10/kernel/entry.S
@@ -1,252 +1,9 @@
1/* $Id: entry.S,v 1.28 2005/06/20 05:06:30 starvik Exp $ 1/*
2 *
3 * linux/arch/cris/entry.S 2 * linux/arch/cris/entry.S
4 * 3 *
5 * Copyright (C) 2000, 2001, 2002 Axis Communications AB 4 * Copyright (C) 2000, 2001, 2002 Axis Communications AB
6 * 5 *
7 * Authors: Bjorn Wesen (bjornw@axis.com) 6 * Authors: Bjorn Wesen (bjornw@axis.com)
8 *
9 * $Log: entry.S,v $
10 * Revision 1.28 2005/06/20 05:06:30 starvik
11 * Remove unnecessary diff to kernel.org tree
12 *
13 * Revision 1.27 2005/03/04 08:16:16 starvik
14 * Merge of Linux 2.6.11.
15 *
16 * Revision 1.26 2005/01/11 13:49:47 starvik
17 * Added NMI handler.
18 *
19 * Revision 1.25 2004/12/27 11:18:32 starvik
20 * Merge of Linux 2.6.10 (not functional yet).
21 *
22 * Revision 1.24 2004/12/22 10:41:23 starvik
23 * Updates to make v10 compile with the latest SMP aware generic code (even
24 * though v10 will never have SMP).
25 *
26 * Revision 1.23 2004/10/19 13:07:37 starvik
27 * Merge of Linux 2.6.9
28 *
29 * Revision 1.22 2004/06/21 10:29:55 starvik
30 * Merge of Linux 2.6.7
31 *
32 * Revision 1.21 2004/06/09 05:30:27 starvik
33 * Clean up multiple interrupt handling.
34 * Prevent interrupts from interrupting each other.
35 * Handle all active interrupts.
36 *
37 * Revision 1.20 2004/06/08 08:55:32 starvik
38 * Removed unused code
39 *
40 * Revision 1.19 2004/06/04 11:56:15 starvik
41 * Implemented page table lookup for refills in assembler for improved performance.
42 *
43 * Revision 1.18 2004/05/11 12:28:25 starvik
44 * Merge of Linux 2.6.6
45 *
46 * Revision 1.17 2003/09/11 07:29:49 starvik
47 * Merge of Linux 2.6.0-test5
48 *
49 * Revision 1.16 2003/07/04 08:27:41 starvik
50 * Merge of Linux 2.5.74
51 *
52 * Revision 1.15 2003/04/09 07:32:55 starvik
53 * resume should return task_struct, not thread_info
54 *
55 * Revision 1.14 2003/04/09 05:20:44 starvik
56 * Merge of Linux 2.5.67
57 *
58 * Revision 1.13 2002/12/11 15:42:02 starvik
59 * Extracted v10 (ETRAX 100LX) specific stuff from arch/cris/kernel/*.c
60 *
61 * Revision 1.12 2002/12/10 09:00:10 starvik
62 * Merge of Linux 2.5.51
63 *
64 * Revision 1.11 2002/12/05 07:53:10 starvik
65 * Corrected constants used with btstq
66 *
67 * Revision 1.10 2002/11/27 08:45:10 starvik
68 * pid is in task_struct, not thread_info
69 *
70 * Revision 1.9 2002/11/26 09:52:05 starvik
71 * Added preemptive kernel scheduling (if CONFIG_PREEMPT)
72 *
73 * Revision 1.8 2002/11/20 11:56:11 starvik
74 * Merge of Linux 2.5.48
75 *
76 * Revision 1.7 2002/11/18 13:02:42 starvik
77 * Added fourth parameter to do_notify_resume
78 * Minor cleanup
79 *
80 * Revision 1.6 2002/11/11 10:37:50 starvik
81 * Use new asm-offset defines
82 * Modified for new location of current->work etc
83 * Removed SYMBOL_NAME from syscalls
84 * Added some new syscalls
85 *
86 * Revision 1.5 2002/11/05 06:45:11 starvik
87 * Merge of Linux 2.5.45
88 *
89 * Revision 1.4 2002/02/05 15:41:31 bjornw
90 * Rewritten to conform better to current 2.5 code (similar to arch/i386)
91 *
92 * Revision 1.3 2002/01/21 15:22:20 bjornw
93 * NICE_DOGGY fix from 2.4 arch/cris
94 *
95 * Revision 1.37 2001/12/07 17:03:55 bjornw
96 * Call a c-hook called watchdog_bite_hook instead of show_registers directly
97 *
98 * Revision 1.36 2001/11/22 13:36:36 bjornw
99 * * In ret_from_intr, check regs->dccr for usermode reentrance instead of
100 * DCCR explicitly (because the latter might not reflect current reality)
101 * * In mmu_bus_fault, set $r9 _after_ calling the C-code instead of before
102 * since $r9 is call-clobbered and is potentially needed afterwards
103 *
104 * Revision 1.35 2001/10/30 17:10:15 bjornw
105 * Add some syscalls
106 *
107 * Revision 1.34 2001/10/01 14:45:03 bjornw
108 * Removed underscores and added register prefixes
109 *
110 * Revision 1.33 2001/08/21 13:48:01 jonashg
111 * Added fix by HP to avoid oops when doing a hard_reset_now.
112 *
113 * Revision 1.32 2001/08/14 04:32:02 hp
114 * In _resume, add comment why R9 is saved; don't sound like it's call-saved.
115 *
116 * Revision 1.31 2001/07/25 16:07:42 bjornw
117 * softirq_active/mask -> softirq_pending only
118 *
119 * Revision 1.30 2001/07/05 01:03:32 hp
120 * - include asm/errno.h to get ENOSYS.
121 * - Use ENOSYS, not local constant LENOSYS; tweak comments.
122 * - Explain why .include, not #include is used.
123 * - Make oops-register-dump if watchdog bits and it's not expected.
124 * - Don't jsr, use jump _hard_reset_now, and skip spurious nop.
125 * - Use correct section attribute for section .rodata.
126 * - Adjust sys_ni_syscall fill number.
127 *
128 * Revision 1.29 2001/06/25 14:07:00 hp
129 * Fix review comment.
130 * * head.S: Use IO_STATE, IO_FIELD and IO_MASK constructs instead of
131 * magic numbers. Add comment that -traditional must not be used.
132 * * entry.S (SYMBOL_NAME): Change redefinition to use ## concatenation.
133 * Correct and update comment.
134 * * Makefile (.S.o): Don't use -traditional. Add comment why the
135 * toplevel rule can't be used (now that there's a reason).
136 *
137 * Revision 1.28 2001/06/21 02:00:40 hp
138 * * entry.S: Include asm/unistd.h.
139 * (_sys_call_table): Use section .rodata, not .data.
140 * (_kernel_thread): Move from...
141 * * process.c: ... here.
142 * * entryoffsets.c (VAL): Break out from...
143 * (OF): Use VAL.
144 * (LCLONE_VM): New asmified value from CLONE_VM.
145 *
146 * Revision 1.27 2001/05/29 11:25:27 markusl
147 * In case of "spurious_interrupt", do hard_reset instead of hanging system in a loop...
148 *
149 * Revision 1.26 2001/05/15 15:46:03 bjornw
150 * Include config.h now that we use some CONFIG_ options
151 *
152 * Revision 1.25 2001/05/15 05:38:47 hp
153 * Tweaked code in _ret_from_sys_call
154 *
155 * Revision 1.24 2001/05/15 05:27:49 hp
156 * Save r9 in r1 over function call rather than on stack.
157 *
158 * Revision 1.23 2001/05/15 05:10:00 hp
159 * Generate entry.S structure offsets from C
160 *
161 * Revision 1.22 2001/04/17 13:58:39 orjanf
162 * * Renamed CONFIG_KGDB to CONFIG_ETRAX_KGDB.
163 *
164 * Revision 1.21 2001/04/17 11:33:29 orjanf
165 * Updated according to review:
166 * * Included asm/sv_addr_ag.h to get macro for internal register.
167 * * Corrected comment regarding system call argument passing.
168 * * Removed comment about instruction being in a delay slot.
169 * * Added comment about SYMBOL_NAME macro.
170 *
171 * Revision 1.20 2001/04/12 08:51:07 hp
172 * - Add entry for sys_fcntl64. In fact copy last piece from i386 including ...
173 * - .rept to fill table to safe state with sys_ni_syscall.
174 *
175 * Revision 1.19 2001/04/04 09:43:32 orjanf
176 * * Moved do_sigtrap from traps.c to entry.S.
177 * * LTASK_PID need not be global anymore.
178 *
179 * Revision 1.18 2001/03/26 09:25:02 markusl
180 * Updated after review, should now handle USB interrupts correctly.
181 *
182 * Revision 1.17 2001/03/21 16:12:55 bjornw
183 * * Always make room for the cpu status record in the frame, in order to
184 * use the same framelength and layout for both mmu busfaults and normal
185 * irqs. No need to check for the explicit CRIS_FRAME_FIXUP type anymore.
186 * * Fixed bug with using addq for popping the stack in the epilogue - it
187 * destroyed the flag register. Use instructions that don't affect the
188 * flag register instead.
189 * * Removed write to R_PORT_PA_DATA during spurious_interrupt
190 *
191 * Revision 1.16 2001/03/20 19:43:02 bjornw
192 * * Get rid of esp0 setting
193 * * Give a 7th argument to a systemcall - the stackframe
194 *
195 * Revision 1.15 2001/03/05 13:14:30 bjornw
196 * Spelling fix
197 *
198 * Revision 1.14 2001/02/23 08:36:36 perf
199 * New ABI; syscallnr=r9, arg5=mof, arg6=srp.
200 * Corrected tracesys call check.
201 *
202 * Revision 1.13 2001/02/15 08:40:55 perf
203 * H-P by way of perf;
204 * - (_system_call): Don't read system call function address into r1.
205 * - (RBFExit): There is no such thing as a null pop. Adjust sp by addq.
206 * - (_system_call): Don't use r10 and don't save and restore it.
207 * - (THREAD_ESP0): New constant.
208 * - (_system_call): Inline set_esp0.
209 *
210 * Revision 1.12 2001/01/31 17:56:25 orjanf
211 * Added definition of LTASK_PID and made it global.
212 *
213 * Revision 1.11 2001/01/10 21:13:29 bjornw
214 * SYMBOL_NAME is defined incorrectly for the compiler options we currently use
215 *
216 * Revision 1.10 2000/12/18 23:47:56 bjornw
217 * * Added syscall trace support (ptrace), completely untested of course
218 * * Removed redundant check for NULL entries in syscall_table
219 *
220 * Revision 1.9 2000/11/21 16:40:51 bjornw
221 * * New frame type used when an SBFS frame needs to be popped without
222 * actually restarting the instruction
223 * * Enable interrupts in signal_return (they did so in x86, I hope it's a good
224 * idea)
225 *
226 * Revision 1.8 2000/11/17 16:53:35 bjornw
227 * Added detection of frame-type in Rexit, so that mmu_bus_fault can
228 * use ret_from_intr in the return-path to check for signals (like SEGV)
229 * and other foul things that might have occurred during the fault.
230 *
231 * Revision 1.7 2000/10/06 15:04:28 bjornw
232 * Include mof in register savings
233 *
234 * Revision 1.6 2000/09/12 16:02:44 bjornw
235 * Linux-2.4.0-test7 derived updates
236 *
237 * Revision 1.5 2000/08/17 15:35:15 bjornw
238 * 2.4.0-test6 changed local_irq_count and friends API
239 *
240 * Revision 1.4 2000/08/02 13:59:30 bjornw
241 * Removed olduname and uname from the syscall list
242 *
243 * Revision 1.3 2000/07/31 13:32:58 bjornw
244 * * Export ret_from_intr
245 * * _resume updated (prev/last tjohejsan)
246 * * timer_interrupt obsolete
247 * * SIGSEGV detection in mmu_bus_fault temporarily disabled
248 *
249 *
250 */ 7 */
251 8
252/* 9/*
@@ -1167,9 +924,11 @@ sys_call_table:
1167 .long sys_epoll_pwait 924 .long sys_epoll_pwait
1168 .long sys_utimensat /* 320 */ 925 .long sys_utimensat /* 320 */
1169 .long sys_signalfd 926 .long sys_signalfd
1170 .long sys_ni_syscall 927 .long sys_timerfd_create
1171 .long sys_eventfd 928 .long sys_eventfd
1172 .long sys_fallocate 929 .long sys_fallocate
930 .long sys_timerfd_settime /* 325 */
931 .long sys_timerfd_gettime
1173 932
1174 /* 933 /*
1175 * NOTE!! This doesn't have to be exact - we just have 934 * NOTE!! This doesn't have to be exact - we just have
diff --git a/arch/cris/arch-v10/kernel/fasttimer.c b/arch/cris/arch-v10/kernel/fasttimer.c
index c1a3a2100ee7..31ff35cff02c 100644
--- a/arch/cris/arch-v10/kernel/fasttimer.c
+++ b/arch/cris/arch-v10/kernel/fasttimer.c
@@ -31,15 +31,12 @@
31 31
32#define DEBUG_LOG_INCLUDED 32#define DEBUG_LOG_INCLUDED
33#define FAST_TIMER_LOG 33#define FAST_TIMER_LOG
34//#define FAST_TIMER_TEST 34/* #define FAST_TIMER_TEST */
35 35
36#define FAST_TIMER_SANITY_CHECKS 36#define FAST_TIMER_SANITY_CHECKS
37 37
38#ifdef FAST_TIMER_SANITY_CHECKS 38#ifdef FAST_TIMER_SANITY_CHECKS
39#define SANITYCHECK(x) x
40static int sanity_failed; 39static int sanity_failed;
41#else
42#define SANITYCHECK(x)
43#endif 40#endif
44 41
45#define D1(x) 42#define D1(x)
@@ -226,23 +223,19 @@ void start_one_shot_timer(struct fast_timer *t,
226 do_gettimeofday_fast(&t->tv_set); 223 do_gettimeofday_fast(&t->tv_set);
227 tmp = fast_timer_list; 224 tmp = fast_timer_list;
228 225
229 SANITYCHECK({ /* Check so this is not in the list already... */ 226#ifdef FAST_TIMER_SANITY_CHECKS
230 while (tmp != NULL) 227 /* Check so this is not in the list already... */
231 { 228 while (tmp != NULL) {
232 if (tmp == t) 229 if (tmp == t) {
233 { 230 printk(KERN_WARNING "timer name: %s data: "
234 printk(KERN_WARNING 231 "0x%08lX already in list!\n", name, data);
235 "timer name: %s data: 0x%08lX already in list!\n", name, data); 232 sanity_failed++;
236 sanity_failed++; 233 goto done;
237 goto done; 234 } else
238 } 235 tmp = tmp->next;
239 else 236 }
240 { 237 tmp = fast_timer_list;
241 tmp = tmp->next; 238#endif
242 }
243 }
244 tmp = fast_timer_list;
245 });
246 239
247 t->delay_us = delay_us; 240 t->delay_us = delay_us;
248 t->function = function; 241 t->function = function;
diff --git a/arch/cris/arch-v10/kernel/head.S b/arch/cris/arch-v10/kernel/head.S
index d946d8b8d277..96344afc4ebc 100644
--- a/arch/cris/arch-v10/kernel/head.S
+++ b/arch/cris/arch-v10/kernel/head.S
@@ -1,186 +1,10 @@
1/* $Id: head.S,v 1.10 2005/06/20 05:12:54 starvik Exp $ 1/*
2 *
3 * Head of the kernel - alter with care 2 * Head of the kernel - alter with care
4 * 3 *
5 * Copyright (C) 2000, 2001 Axis Communications AB 4 * Copyright (C) 2000, 2001 Axis Communications AB
6 * 5 *
7 * Authors: Bjorn Wesen (bjornw@axis.com) 6 * Authors: Bjorn Wesen (bjornw@axis.com)
8 * 7 *
9 * $Log: head.S,v $
10 * Revision 1.10 2005/06/20 05:12:54 starvik
11 * Remove unnecessary diff to kernel.org tree
12 *
13 * Revision 1.9 2004/12/13 12:21:51 starvik
14 * Added I/O and DMA allocators from Linux 2.4
15 *
16 * Revision 1.8 2004/11/22 11:41:14 starvik
17 * Kernel command line may be supplied to kernel. Not used by Axis but may
18 * be used by customers.
19 *
20 * Revision 1.7 2004/05/14 07:58:01 starvik
21 * Merge of changes from 2.4
22 *
23 * Revision 1.6 2003/04/28 05:31:46 starvik
24 * Added section attributes
25 *
26 * Revision 1.5 2002/12/11 15:42:02 starvik
27 * Extracted v10 (ETRAX 100LX) specific stuff from arch/cris/kernel/*.c
28 *
29 * Revision 1.4 2002/11/07 09:00:44 starvik
30 * Names changed for init sections
31 * init_task_union -> init_thread_union
32 *
33 * Revision 1.3 2002/02/05 15:38:23 bjornw
34 * Oops.. non-CRAMFS_MAGIC should jump over the copying, not into it...
35 *
36 * Revision 1.2 2001/12/18 13:35:19 bjornw
37 * Applied the 2.4.13->2.4.16 CRIS patch to 2.5.1 (is a copy of 2.4.15).
38 *
39 * Revision 1.43 2001/11/08 15:09:43 starvik
40 * Only start MII clock if Ethernet is configured
41 *
42 * Revision 1.42 2001/11/08 14:37:34 starvik
43 * Start MII clock early to make sure that it is running at tranceiver reset
44 *
45 * Revision 1.41 2001/10/29 14:55:58 pkj
46 * Corrected pa$r0 to par0.
47 *
48 * Revision 1.40 2001/10/03 14:59:57 pkj
49 * Added support for resetting the Bluetooth hardware.
50 *
51 * Revision 1.39 2001/10/01 14:45:03 bjornw
52 * Removed underscores and added register prefixes
53 *
54 * Revision 1.38 2001/09/21 07:14:11 jonashg
55 * Made root filesystem (cramfs) use mtdblock driver when booting from flash.
56 *
57 * Revision 1.37 2001/09/11 13:44:29 orjanf
58 * Decouple usage of serial ports for debug and kgdb.
59 *
60 * Revision 1.36 2001/06/29 12:39:31 pkj
61 * Added support for mirroring the first flash to just below the
62 * second one, to make them look consecutive to cramfs.
63 *
64 * Revision 1.35 2001/06/25 14:07:00 hp
65 * Fix review comment.
66 * * head.S: Use IO_STATE, IO_FIELD and IO_MASK constructs instead of
67 * magic numbers. Add comment that -traditional must not be used.
68 * * entry.S (SYMBOL_NAME): Change redefinition to use ## concatenation.
69 * Correct and update comment.
70 * * Makefile (.S.o): Don't use -traditional. Add comment why the
71 * toplevel rule can't be used (now that there's a reason).
72 *
73 * Revision 1.34 2001/05/15 07:08:14 hp
74 * Tweak "notice" to reflect that both r8 r9 are used
75 *
76 * Revision 1.33 2001/05/15 06:40:05 hp
77 * Put bulk of code in .text.init, data in .data.init
78 *
79 * Revision 1.32 2001/05/15 06:18:56 hp
80 * Execute review comment: s/bcc/bhs/g; s/bcs/blo/g
81 *
82 * Revision 1.31 2001/05/15 06:08:40 hp
83 * Add sentence about autodetecting the bit31-MMU-bug
84 *
85 * Revision 1.30 2001/05/15 06:00:05 hp
86 * Update comment: LOW_MAP is not forced on xsim anymore.
87 *
88 * Revision 1.29 2001/04/18 12:51:59 orjanf
89 * * Reverted review change regarding the use of bcs/bcc.
90 * * Removed non-working LED-clearing code.
91 *
92 * Revision 1.28 2001/04/17 13:58:39 orjanf
93 * * Renamed CONFIG_KGDB to CONFIG_ETRAX_KGDB.
94 *
95 * Revision 1.27 2001/04/17 11:42:35 orjanf
96 * Changed according to review:
97 * * Added comment explaining memory map bug.
98 * * Changed bcs and bcc to blo and bhs, respectively.
99 * * Removed mentioning of Stallone and Olga boards.
100 *
101 * Revision 1.26 2001/04/06 12:31:07 jonashg
102 * Check for cramfs in flash before RAM instead of RAM before flash.
103 *
104 * Revision 1.25 2001/04/04 06:23:53 starvik
105 * Initialize DRAM if not already initialized
106 *
107 * Revision 1.24 2001/04/03 11:12:00 starvik
108 * Removed dram init (done by rescue or etrax100boot
109 * Corrected include
110 *
111 * Revision 1.23 2001/04/03 09:53:03 starvik
112 * Include hw_settings.S
113 *
114 * Revision 1.22 2001/03/26 14:23:26 bjornw
115 * Namechange of some config options
116 *
117 * Revision 1.21 2001/03/08 12:14:41 bjornw
118 * * Config name for ETRAX IDE was renamed
119 * * Removed G27 auto-setting when JULIETTE is chosen (need to make this
120 * a new config option later)
121 *
122 * Revision 1.20 2001/02/23 12:47:56 bjornw
123 * MMU regs during LOW_MAP updated to reflect a newer reality
124 *
125 * Revision 1.19 2001/02/19 11:12:07 bjornw
126 * Changed comment header format
127 *
128 * Revision 1.18 2001/02/15 07:25:38 starvik
129 * Added support for synchronous serial ports
130 *
131 * Revision 1.17 2001/02/08 15:53:13 starvik
132 * Last commit removed some important ifdefs
133 *
134 * Revision 1.16 2001/02/08 15:20:38 starvik
135 * Include dram_init.S as inline
136 *
137 * Revision 1.15 2001/01/29 18:12:01 bjornw
138 * Corrected some comments
139 *
140 * Revision 1.14 2001/01/29 13:11:29 starvik
141 * Include dram_init.S (with DRAM/SDRAM initialization)
142 *
143 * Revision 1.13 2001/01/23 14:54:57 markusl
144 * Updated for USB
145 * i.e. added r_gen_config settings
146 *
147 * Revision 1.12 2001/01/19 16:16:29 perf
148 * Added temporary mapping of 0x0c->0x0c to avoid flash loading confusion.
149 * Renamed serial options from ETRAX100 to ETRAX.
150 *
151 * Revision 1.11 2001/01/16 16:31:38 bjornw
152 * * Changed name and semantics of running_from_flash to romfs_in_flash,
153 * set by head.S to indicate to setup.c whether there is a cramfs image
154 * after the kernels BSS or not. Should work for all three boot-cases
155 * (DRAM with cramfs in DRAM, DRAM with cramfs in flash (compressed boot),
156 * and flash with cramfs in flash)
157 *
158 * Revision 1.10 2001/01/16 14:12:21 bjornw
159 * * Check for cramfs start passed in r9 from the decompressor, if all other
160 * cramfs options fail (if we boot from DRAM but don't find a cramfs image
161 * after the kernel in DRAM, it is probably still in the flash)
162 * * Check magic in cramfs detection when booting from flash directly
163 *
164 * Revision 1.9 2001/01/15 17:17:02 bjornw
165 * * Corrected the code that detects the cramfs lengths
166 * * Added a comment saying that the above does not work due to other
167 * reasons..
168 *
169 * Revision 1.8 2001/01/15 16:27:51 jonashg
170 * Made boot after flashing work.
171 * * end destination is __vmlinux_end in RAM.
172 * * _romfs_start moved because of virtual memory.
173 *
174 * Revision 1.7 2000/11/21 13:55:29 bjornw
175 * Use CONFIG_CRIS_LOW_MAP for the low VM map instead of explicit CPU type
176 *
177 * Revision 1.6 2000/10/06 12:36:55 bjornw
178 * Forgot swapper_pg_dir when changing memory map..
179 *
180 * Revision 1.5 2000/10/04 16:49:30 bjornw
181 * * Fixed memory mapping in LX
182 * * Check for cramfs instead of romfs
183 *
184 */ 8 */
185 9
186#define ASSEMBLER_MACROS_ONLY 10#define ASSEMBLER_MACROS_ONLY
@@ -595,11 +419,17 @@ no_command_line:
595 419
596 moveq 0,$r0 420 moveq 0,$r0
597 421
422 ;; Select or disable serial port 2
423#ifdef CONFIG_ETRAX_SERIAL_PORT2
424 or.d IO_STATE (R_GEN_CONFIG, ser2, select),$r0
425#else
426 or.d IO_STATE (R_GEN_CONFIG, ser2, disable),$r0
427#endif
428
598 ;; Init interfaces (disable them). 429 ;; Init interfaces (disable them).
599 or.d IO_STATE (R_GEN_CONFIG, scsi0, disable) \ 430 or.d IO_STATE (R_GEN_CONFIG, scsi0, disable) \
600 | IO_STATE (R_GEN_CONFIG, ata, disable) \ 431 | IO_STATE (R_GEN_CONFIG, ata, disable) \
601 | IO_STATE (R_GEN_CONFIG, par0, disable) \ 432 | IO_STATE (R_GEN_CONFIG, par0, disable) \
602 | IO_STATE (R_GEN_CONFIG, ser2, disable) \
603 | IO_STATE (R_GEN_CONFIG, mio, disable) \ 433 | IO_STATE (R_GEN_CONFIG, mio, disable) \
604 | IO_STATE (R_GEN_CONFIG, scsi1, disable) \ 434 | IO_STATE (R_GEN_CONFIG, scsi1, disable) \
605 | IO_STATE (R_GEN_CONFIG, scsi0w, disable) \ 435 | IO_STATE (R_GEN_CONFIG, scsi0w, disable) \
@@ -801,6 +631,41 @@ no_command_line:
801 | IO_STATE (R_SERIAL1_TR_CTRL, tr_bitnr, tr_8bit),$r0 631 | IO_STATE (R_SERIAL1_TR_CTRL, tr_bitnr, tr_8bit),$r0
802 move.b $r0,[R_SERIAL1_TR_CTRL] 632 move.b $r0,[R_SERIAL1_TR_CTRL]
803 633
634#ifdef CONFIG_ETRAX_SERIAL_PORT2
635 ;; setup the serial port 2 at 115200 baud for debug purposes
636
637 moveq IO_STATE (R_SERIAL2_XOFF, tx_stop, enable) \
638 | IO_STATE (R_SERIAL2_XOFF, auto_xoff, disable) \
639 | IO_FIELD (R_SERIAL2_XOFF, xoff_char, 0),$r0
640 move.d $r0,[R_SERIAL2_XOFF]
641
642 ; 115.2kbaud for both transmit and receive
643 move.b IO_STATE (R_SERIAL2_BAUD, tr_baud, c115k2Hz) \
644 | IO_STATE (R_SERIAL2_BAUD, rec_baud, c115k2Hz),$r0
645 move.b $r0,[R_SERIAL2_BAUD]
646
647 ; Set up and enable the serial2 receiver.
648 move.b IO_STATE (R_SERIAL2_REC_CTRL, dma_err, stop) \
649 | IO_STATE (R_SERIAL2_REC_CTRL, rec_enable, enable) \
650 | IO_STATE (R_SERIAL2_REC_CTRL, rts_, active) \
651 | IO_STATE (R_SERIAL2_REC_CTRL, sampling, middle) \
652 | IO_STATE (R_SERIAL2_REC_CTRL, rec_stick_par, normal) \
653 | IO_STATE (R_SERIAL2_REC_CTRL, rec_par, even) \
654 | IO_STATE (R_SERIAL2_REC_CTRL, rec_par_en, disable) \
655 | IO_STATE (R_SERIAL2_REC_CTRL, rec_bitnr, rec_8bit),$r0
656 move.b $r0,[R_SERIAL2_REC_CTRL]
657
658 ; Set up and enable the serial2 transmitter.
659 move.b IO_FIELD (R_SERIAL2_TR_CTRL, txd, 0) \
660 | IO_STATE (R_SERIAL2_TR_CTRL, tr_enable, enable) \
661 | IO_STATE (R_SERIAL2_TR_CTRL, auto_cts, disabled) \
662 | IO_STATE (R_SERIAL2_TR_CTRL, stop_bits, one_bit) \
663 | IO_STATE (R_SERIAL2_TR_CTRL, tr_stick_par, normal) \
664 | IO_STATE (R_SERIAL2_TR_CTRL, tr_par, even) \
665 | IO_STATE (R_SERIAL2_TR_CTRL, tr_par_en, disable) \
666 | IO_STATE (R_SERIAL2_TR_CTRL, tr_bitnr, tr_8bit),$r0
667 move.b $r0,[R_SERIAL2_TR_CTRL]
668#endif
804 669
805#ifdef CONFIG_ETRAX_SERIAL_PORT3 670#ifdef CONFIG_ETRAX_SERIAL_PORT3
806 ;; setup the serial port 3 at 115200 baud for debug purposes 671 ;; setup the serial port 3 at 115200 baud for debug purposes
diff --git a/arch/cris/arch-v10/kernel/io_interface_mux.c b/arch/cris/arch-v10/kernel/io_interface_mux.c
index f3b327d4ed9c..add98e0941b5 100644
--- a/arch/cris/arch-v10/kernel/io_interface_mux.c
+++ b/arch/cris/arch-v10/kernel/io_interface_mux.c
@@ -1,10 +1,9 @@
1/* IO interface mux allocator for ETRAX100LX. 1/* IO interface mux allocator for ETRAX100LX.
2 * Copyright 2004, Axis Communications AB 2 * Copyright 2004-2007, Axis Communications AB
3 * $Id: io_interface_mux.c,v 1.2 2004/12/21 12:08:38 starvik Exp $
4 */ 3 */
5 4
6 5
7/* C.f. ETRAX100LX Designer's Reference 20.9 */ 6/* C.f. ETRAX100LX Designer's Reference chapter 19.9 */
8 7
9#include <linux/kernel.h> 8#include <linux/kernel.h>
10#include <linux/slab.h> 9#include <linux/slab.h>
@@ -45,17 +44,39 @@ struct watcher
45struct if_group 44struct if_group
46{ 45{
47 enum io_if_group group; 46 enum io_if_group group;
48 unsigned char used; 47 /* name - the name of the group 'A' to 'F' */
49 enum cris_io_interface owner; 48 char *name;
49 /* used - a bit mask of all pins in the group in the order listed
50 * in the tables in 19.9.1 to 19.9.6. Note that no
51 * distinction is made between in, out and in/out pins. */
52 unsigned int used;
50}; 53};
51 54
52 55
53struct interface 56struct interface
54{ 57{
55 enum cris_io_interface ioif; 58 enum cris_io_interface ioif;
59 /* name - the name of the interface */
60 char *name;
61 /* groups - OR'ed together io_if_group flags describing what pin groups
62 * the interface uses pins in. */
56 unsigned char groups; 63 unsigned char groups;
64 /* used - set when the interface is allocated. */
57 unsigned char used; 65 unsigned char used;
58 char *owner; 66 char *owner;
67 /* group_a through group_f - bit masks describing what pins in the
68 * pin groups the interface uses. */
69 unsigned int group_a;
70 unsigned int group_b;
71 unsigned int group_c;
72 unsigned int group_d;
73 unsigned int group_e;
74 unsigned int group_f;
75
76 /* gpio_g_in, gpio_g_out, gpio_b - bit masks telling what pins in the
77 * GPIO ports the interface uses. This could be reconstucted using
78 * the group_X masks and a table of what pins the GPIO ports use,
79 * but that would be messy. */
59 unsigned int gpio_g_in; 80 unsigned int gpio_g_in;
60 unsigned int gpio_g_out; 81 unsigned int gpio_g_out;
61 unsigned char gpio_b; 82 unsigned char gpio_b;
@@ -64,26 +85,32 @@ struct interface
64static struct if_group if_groups[6] = { 85static struct if_group if_groups[6] = {
65 { 86 {
66 .group = group_a, 87 .group = group_a,
88 .name = "A",
67 .used = 0, 89 .used = 0,
68 }, 90 },
69 { 91 {
70 .group = group_b, 92 .group = group_b,
93 .name = "B",
71 .used = 0, 94 .used = 0,
72 }, 95 },
73 { 96 {
74 .group = group_c, 97 .group = group_c,
98 .name = "C",
75 .used = 0, 99 .used = 0,
76 }, 100 },
77 { 101 {
78 .group = group_d, 102 .group = group_d,
103 .name = "D",
79 .used = 0, 104 .used = 0,
80 }, 105 },
81 { 106 {
82 .group = group_e, 107 .group = group_e,
108 .name = "E",
83 .used = 0, 109 .used = 0,
84 }, 110 },
85 { 111 {
86 .group = group_f, 112 .group = group_f,
113 .name = "F",
87 .used = 0, 114 .used = 0,
88 } 115 }
89}; 116};
@@ -94,14 +121,32 @@ static struct interface interfaces[] = {
94 /* Begin Non-multiplexed interfaces */ 121 /* Begin Non-multiplexed interfaces */
95 { 122 {
96 .ioif = if_eth, 123 .ioif = if_eth,
124 .name = "ethernet",
97 .groups = 0, 125 .groups = 0,
126
127 .group_a = 0,
128 .group_b = 0,
129 .group_c = 0,
130 .group_d = 0,
131 .group_e = 0,
132 .group_f = 0,
133
98 .gpio_g_in = 0, 134 .gpio_g_in = 0,
99 .gpio_g_out = 0, 135 .gpio_g_out = 0,
100 .gpio_b = 0 136 .gpio_b = 0
101 }, 137 },
102 { 138 {
103 .ioif = if_serial_0, 139 .ioif = if_serial_0,
140 .name = "serial_0",
104 .groups = 0, 141 .groups = 0,
142
143 .group_a = 0,
144 .group_b = 0,
145 .group_c = 0,
146 .group_d = 0,
147 .group_e = 0,
148 .group_f = 0,
149
105 .gpio_g_in = 0, 150 .gpio_g_in = 0,
106 .gpio_g_out = 0, 151 .gpio_g_out = 0,
107 .gpio_b = 0 152 .gpio_b = 0
@@ -109,172 +154,385 @@ static struct interface interfaces[] = {
109 /* End Non-multiplexed interfaces */ 154 /* End Non-multiplexed interfaces */
110 { 155 {
111 .ioif = if_serial_1, 156 .ioif = if_serial_1,
157 .name = "serial_1",
112 .groups = group_e, 158 .groups = group_e,
159
160 .group_a = 0,
161 .group_b = 0,
162 .group_c = 0,
163 .group_d = 0,
164 .group_e = 0x0f,
165 .group_f = 0,
166
113 .gpio_g_in = 0x00000000, 167 .gpio_g_in = 0x00000000,
114 .gpio_g_out = 0x00000000, 168 .gpio_g_out = 0x00000000,
115 .gpio_b = 0x00 169 .gpio_b = 0x00
116 }, 170 },
117 { 171 {
118 .ioif = if_serial_2, 172 .ioif = if_serial_2,
173 .name = "serial_2",
119 .groups = group_b, 174 .groups = group_b,
175
176 .group_a = 0,
177 .group_b = 0x0f,
178 .group_c = 0,
179 .group_d = 0,
180 .group_e = 0,
181 .group_f = 0,
182
120 .gpio_g_in = 0x000000c0, 183 .gpio_g_in = 0x000000c0,
121 .gpio_g_out = 0x000000c0, 184 .gpio_g_out = 0x000000c0,
122 .gpio_b = 0x00 185 .gpio_b = 0x00
123 }, 186 },
124 { 187 {
125 .ioif = if_serial_3, 188 .ioif = if_serial_3,
189 .name = "serial_3",
126 .groups = group_c, 190 .groups = group_c,
191
192 .group_a = 0,
193 .group_b = 0,
194 .group_c = 0x0f,
195 .group_d = 0,
196 .group_e = 0,
197 .group_f = 0,
198
127 .gpio_g_in = 0xc0000000, 199 .gpio_g_in = 0xc0000000,
128 .gpio_g_out = 0xc0000000, 200 .gpio_g_out = 0xc0000000,
129 .gpio_b = 0x00 201 .gpio_b = 0x00
130 }, 202 },
131 { 203 {
132 .ioif = if_sync_serial_1, 204 .ioif = if_sync_serial_1,
133 .groups = group_e | group_f, /* if_sync_serial_1 and if_sync_serial_3 205 .name = "sync_serial_1",
134 can be used simultaneously */ 206 .groups = group_e | group_f,
207
208 .group_a = 0,
209 .group_b = 0,
210 .group_c = 0,
211 .group_d = 0,
212 .group_e = 0x0f,
213 .group_f = 0x10,
214
135 .gpio_g_in = 0x00000000, 215 .gpio_g_in = 0x00000000,
136 .gpio_g_out = 0x00000000, 216 .gpio_g_out = 0x00000000,
137 .gpio_b = 0x10 217 .gpio_b = 0x10
138 }, 218 },
139 { 219 {
140 .ioif = if_sync_serial_3, 220 .ioif = if_sync_serial_3,
221 .name = "sync_serial_3",
141 .groups = group_c | group_f, 222 .groups = group_c | group_f,
223
224 .group_a = 0,
225 .group_b = 0,
226 .group_c = 0x0f,
227 .group_d = 0,
228 .group_e = 0,
229 .group_f = 0x80,
230
142 .gpio_g_in = 0xc0000000, 231 .gpio_g_in = 0xc0000000,
143 .gpio_g_out = 0xc0000000, 232 .gpio_g_out = 0xc0000000,
144 .gpio_b = 0x80 233 .gpio_b = 0x80
145 }, 234 },
146 { 235 {
147 .ioif = if_shared_ram, 236 .ioif = if_shared_ram,
237 .name = "shared_ram",
148 .groups = group_a, 238 .groups = group_a,
239
240 .group_a = 0x7f8ff,
241 .group_b = 0,
242 .group_c = 0,
243 .group_d = 0,
244 .group_e = 0,
245 .group_f = 0,
246
149 .gpio_g_in = 0x0000ff3e, 247 .gpio_g_in = 0x0000ff3e,
150 .gpio_g_out = 0x0000ff38, 248 .gpio_g_out = 0x0000ff38,
151 .gpio_b = 0x00 249 .gpio_b = 0x00
152 }, 250 },
153 { 251 {
154 .ioif = if_shared_ram_w, 252 .ioif = if_shared_ram_w,
253 .name = "shared_ram_w",
155 .groups = group_a | group_d, 254 .groups = group_a | group_d,
255
256 .group_a = 0x7f8ff,
257 .group_b = 0,
258 .group_c = 0,
259 .group_d = 0xff,
260 .group_e = 0,
261 .group_f = 0,
262
156 .gpio_g_in = 0x00ffff3e, 263 .gpio_g_in = 0x00ffff3e,
157 .gpio_g_out = 0x00ffff38, 264 .gpio_g_out = 0x00ffff38,
158 .gpio_b = 0x00 265 .gpio_b = 0x00
159 }, 266 },
160 { 267 {
161 .ioif = if_par_0, 268 .ioif = if_par_0,
269 .name = "par_0",
162 .groups = group_a, 270 .groups = group_a,
271
272 .group_a = 0x7fbff,
273 .group_b = 0,
274 .group_c = 0,
275 .group_d = 0,
276 .group_e = 0,
277 .group_f = 0,
278
163 .gpio_g_in = 0x0000ff3e, 279 .gpio_g_in = 0x0000ff3e,
164 .gpio_g_out = 0x0000ff3e, 280 .gpio_g_out = 0x0000ff3e,
165 .gpio_b = 0x00 281 .gpio_b = 0x00
166 }, 282 },
167 { 283 {
168 .ioif = if_par_1, 284 .ioif = if_par_1,
285 .name = "par_1",
169 .groups = group_d, 286 .groups = group_d,
287
288 .group_a = 0,
289 .group_b = 0,
290 .group_c = 0,
291 .group_d = 0x7feff,
292 .group_e = 0,
293 .group_f = 0,
294
170 .gpio_g_in = 0x3eff0000, 295 .gpio_g_in = 0x3eff0000,
171 .gpio_g_out = 0x3eff0000, 296 .gpio_g_out = 0x3eff0000,
172 .gpio_b = 0x00 297 .gpio_b = 0x00
173 }, 298 },
174 { 299 {
175 .ioif = if_par_w, 300 .ioif = if_par_w,
301 .name = "par_w",
176 .groups = group_a | group_d, 302 .groups = group_a | group_d,
303
304 .group_a = 0x7fbff,
305 .group_b = 0,
306 .group_c = 0,
307 .group_d = 0xff,
308 .group_e = 0,
309 .group_f = 0,
310
177 .gpio_g_in = 0x00ffff3e, 311 .gpio_g_in = 0x00ffff3e,
178 .gpio_g_out = 0x00ffff3e, 312 .gpio_g_out = 0x00ffff3e,
179 .gpio_b = 0x00 313 .gpio_b = 0x00
180 }, 314 },
181 { 315 {
182 .ioif = if_scsi8_0, 316 .ioif = if_scsi8_0,
183 .groups = group_a | group_b | group_f, /* if_scsi8_0 and if_scsi8_1 317 .name = "scsi8_0",
184 can be used simultaneously */ 318 .groups = group_a | group_b | group_f,
319
320 .group_a = 0x7ffff,
321 .group_b = 0x0f,
322 .group_c = 0,
323 .group_d = 0,
324 .group_e = 0,
325 .group_f = 0x10,
326
185 .gpio_g_in = 0x0000ffff, 327 .gpio_g_in = 0x0000ffff,
186 .gpio_g_out = 0x0000ffff, 328 .gpio_g_out = 0x0000ffff,
187 .gpio_b = 0x10 329 .gpio_b = 0x10
188 }, 330 },
189 { 331 {
190 .ioif = if_scsi8_1, 332 .ioif = if_scsi8_1,
191 .groups = group_c | group_d | group_f, /* if_scsi8_0 and if_scsi8_1 333 .name = "scsi8_1",
192 can be used simultaneously */ 334 .groups = group_c | group_d | group_f,
335
336 .group_a = 0,
337 .group_b = 0,
338 .group_c = 0x0f,
339 .group_d = 0x7ffff,
340 .group_e = 0,
341 .group_f = 0x80,
342
193 .gpio_g_in = 0xffff0000, 343 .gpio_g_in = 0xffff0000,
194 .gpio_g_out = 0xffff0000, 344 .gpio_g_out = 0xffff0000,
195 .gpio_b = 0x80 345 .gpio_b = 0x80
196 }, 346 },
197 { 347 {
198 .ioif = if_scsi_w, 348 .ioif = if_scsi_w,
349 .name = "scsi_w",
199 .groups = group_a | group_b | group_d | group_f, 350 .groups = group_a | group_b | group_d | group_f,
351
352 .group_a = 0x7ffff,
353 .group_b = 0x0f,
354 .group_c = 0,
355 .group_d = 0x601ff,
356 .group_e = 0,
357 .group_f = 0x90,
358
200 .gpio_g_in = 0x01ffffff, 359 .gpio_g_in = 0x01ffffff,
201 .gpio_g_out = 0x07ffffff, 360 .gpio_g_out = 0x07ffffff,
202 .gpio_b = 0x80 361 .gpio_b = 0x80
203 }, 362 },
204 { 363 {
205 .ioif = if_ata, 364 .ioif = if_ata,
365 .name = "ata",
206 .groups = group_a | group_b | group_c | group_d, 366 .groups = group_a | group_b | group_c | group_d,
367
368 .group_a = 0x7ffff,
369 .group_b = 0x0f,
370 .group_c = 0x0f,
371 .group_d = 0x7cfff,
372 .group_e = 0,
373 .group_f = 0,
374
207 .gpio_g_in = 0xf9ffffff, 375 .gpio_g_in = 0xf9ffffff,
208 .gpio_g_out = 0xffffffff, 376 .gpio_g_out = 0xffffffff,
209 .gpio_b = 0x80 377 .gpio_b = 0x80
210 }, 378 },
211 { 379 {
212 .ioif = if_csp, 380 .ioif = if_csp,
213 .groups = group_f, /* if_csp and if_i2c can be used simultaneously */ 381 .name = "csp",
382 .groups = group_f,
383
384 .group_a = 0,
385 .group_b = 0,
386 .group_c = 0,
387 .group_d = 0,
388 .group_e = 0,
389 .group_f = 0xfc,
390
214 .gpio_g_in = 0x00000000, 391 .gpio_g_in = 0x00000000,
215 .gpio_g_out = 0x00000000, 392 .gpio_g_out = 0x00000000,
216 .gpio_b = 0xfc 393 .gpio_b = 0xfc
217 }, 394 },
218 { 395 {
219 .ioif = if_i2c, 396 .ioif = if_i2c,
220 .groups = group_f, /* if_csp and if_i2c can be used simultaneously */ 397 .name = "i2c",
398 .groups = group_f,
399
400 .group_a = 0,
401 .group_b = 0,
402 .group_c = 0,
403 .group_d = 0,
404 .group_e = 0,
405 .group_f = 0x03,
406
221 .gpio_g_in = 0x00000000, 407 .gpio_g_in = 0x00000000,
222 .gpio_g_out = 0x00000000, 408 .gpio_g_out = 0x00000000,
223 .gpio_b = 0x03 409 .gpio_b = 0x03
224 }, 410 },
225 { 411 {
226 .ioif = if_usb_1, 412 .ioif = if_usb_1,
413 .name = "usb_1",
227 .groups = group_e | group_f, 414 .groups = group_e | group_f,
415
416 .group_a = 0,
417 .group_b = 0,
418 .group_c = 0,
419 .group_d = 0,
420 .group_e = 0x0f,
421 .group_f = 0x2c,
422
228 .gpio_g_in = 0x00000000, 423 .gpio_g_in = 0x00000000,
229 .gpio_g_out = 0x00000000, 424 .gpio_g_out = 0x00000000,
230 .gpio_b = 0x2c 425 .gpio_b = 0x2c
231 }, 426 },
232 { 427 {
233 .ioif = if_usb_2, 428 .ioif = if_usb_2,
429 .name = "usb_2",
234 .groups = group_d, 430 .groups = group_d,
235 .gpio_g_in = 0x0e000000, 431
236 .gpio_g_out = 0x3c000000, 432 .group_a = 0,
433 .group_b = 0,
434 .group_c = 0,
435 .group_d = 0,
436 .group_e = 0x33e00,
437 .group_f = 0,
438
439 .gpio_g_in = 0x3e000000,
440 .gpio_g_out = 0x0c000000,
237 .gpio_b = 0x00 441 .gpio_b = 0x00
238 }, 442 },
239 /* GPIO pins */ 443 /* GPIO pins */
240 { 444 {
241 .ioif = if_gpio_grp_a, 445 .ioif = if_gpio_grp_a,
446 .name = "gpio_a",
242 .groups = group_a, 447 .groups = group_a,
448
449 .group_a = 0,
450 .group_b = 0,
451 .group_c = 0,
452 .group_d = 0,
453 .group_e = 0,
454 .group_f = 0,
455
243 .gpio_g_in = 0x0000ff3f, 456 .gpio_g_in = 0x0000ff3f,
244 .gpio_g_out = 0x0000ff3f, 457 .gpio_g_out = 0x0000ff3f,
245 .gpio_b = 0x00 458 .gpio_b = 0x00
246 }, 459 },
247 { 460 {
248 .ioif = if_gpio_grp_b, 461 .ioif = if_gpio_grp_b,
462 .name = "gpio_b",
249 .groups = group_b, 463 .groups = group_b,
464
465 .group_a = 0,
466 .group_b = 0,
467 .group_c = 0,
468 .group_d = 0,
469 .group_e = 0,
470 .group_f = 0,
471
250 .gpio_g_in = 0x000000c0, 472 .gpio_g_in = 0x000000c0,
251 .gpio_g_out = 0x000000c0, 473 .gpio_g_out = 0x000000c0,
252 .gpio_b = 0x00 474 .gpio_b = 0x00
253 }, 475 },
254 { 476 {
255 .ioif = if_gpio_grp_c, 477 .ioif = if_gpio_grp_c,
478 .name = "gpio_c",
256 .groups = group_c, 479 .groups = group_c,
480
481 .group_a = 0,
482 .group_b = 0,
483 .group_c = 0,
484 .group_d = 0,
485 .group_e = 0,
486 .group_f = 0,
487
257 .gpio_g_in = 0xc0000000, 488 .gpio_g_in = 0xc0000000,
258 .gpio_g_out = 0xc0000000, 489 .gpio_g_out = 0xc0000000,
259 .gpio_b = 0x00 490 .gpio_b = 0x00
260 }, 491 },
261 { 492 {
262 .ioif = if_gpio_grp_d, 493 .ioif = if_gpio_grp_d,
494 .name = "gpio_d",
263 .groups = group_d, 495 .groups = group_d,
496
497 .group_a = 0,
498 .group_b = 0,
499 .group_c = 0,
500 .group_d = 0,
501 .group_e = 0,
502 .group_f = 0,
503
264 .gpio_g_in = 0x3fff0000, 504 .gpio_g_in = 0x3fff0000,
265 .gpio_g_out = 0x3fff0000, 505 .gpio_g_out = 0x3fff0000,
266 .gpio_b = 0x00 506 .gpio_b = 0x00
267 }, 507 },
268 { 508 {
269 .ioif = if_gpio_grp_e, 509 .ioif = if_gpio_grp_e,
510 .name = "gpio_e",
270 .groups = group_e, 511 .groups = group_e,
512
513 .group_a = 0,
514 .group_b = 0,
515 .group_c = 0,
516 .group_d = 0,
517 .group_e = 0,
518 .group_f = 0,
519
271 .gpio_g_in = 0x00000000, 520 .gpio_g_in = 0x00000000,
272 .gpio_g_out = 0x00000000, 521 .gpio_g_out = 0x00000000,
273 .gpio_b = 0x00 522 .gpio_b = 0x00
274 }, 523 },
275 { 524 {
276 .ioif = if_gpio_grp_f, 525 .ioif = if_gpio_grp_f,
526 .name = "gpio_f",
277 .groups = group_f, 527 .groups = group_f,
528
529 .group_a = 0,
530 .group_b = 0,
531 .group_c = 0,
532 .group_d = 0,
533 .group_e = 0,
534 .group_f = 0,
535
278 .gpio_g_in = 0x00000000, 536 .gpio_g_in = 0x00000000,
279 .gpio_g_out = 0x00000000, 537 .gpio_g_out = 0x00000000,
280 .gpio_b = 0xff 538 .gpio_b = 0xff
@@ -284,11 +542,13 @@ static struct interface interfaces[] = {
284 542
285static struct watcher *watchers = NULL; 543static struct watcher *watchers = NULL;
286 544
545/* The pins that are free to use in the GPIO ports. */
287static unsigned int gpio_in_pins = 0xffffffff; 546static unsigned int gpio_in_pins = 0xffffffff;
288static unsigned int gpio_out_pins = 0xffffffff; 547static unsigned int gpio_out_pins = 0xffffffff;
289static unsigned char gpio_pb_pins = 0xff; 548static unsigned char gpio_pb_pins = 0xff;
290static unsigned char gpio_pa_pins = 0xff; 549static unsigned char gpio_pa_pins = 0xff;
291 550
551/* Identifiers for the owners of the GPIO pins. */
292static enum cris_io_interface gpio_pa_owners[8]; 552static enum cris_io_interface gpio_pa_owners[8];
293static enum cris_io_interface gpio_pb_owners[8]; 553static enum cris_io_interface gpio_pb_owners[8];
294static enum cris_io_interface gpio_pg_owners[32]; 554static enum cris_io_interface gpio_pg_owners[32];
@@ -338,13 +598,15 @@ int cris_request_io_interface(enum cris_io_interface ioif, const char *device_id
338 struct if_group *grp; 598 struct if_group *grp;
339 unsigned char group_set; 599 unsigned char group_set;
340 unsigned long flags; 600 unsigned long flags;
601 int res = 0;
341 602
342 (void)cris_io_interface_init(); 603 (void)cris_io_interface_init();
343 604
344 DBG(printk("cris_request_io_interface(%d, \"%s\")\n", ioif, device_id)); 605 DBG(printk("cris_request_io_interface(%d, \"%s\")\n", ioif, device_id));
345 606
346 if ((ioif >= if_max_interfaces) || (ioif < 0)) { 607 if ((ioif >= if_max_interfaces) || (ioif < 0)) {
347 printk(KERN_CRIT "cris_request_io_interface: Bad interface %u submitted for %s\n", 608 printk(KERN_CRIT "cris_request_io_interface: Bad interface "
609 "%u submitted for %s\n",
348 ioif, 610 ioif,
349 device_id); 611 device_id);
350 return -EINVAL; 612 return -EINVAL;
@@ -353,59 +615,69 @@ int cris_request_io_interface(enum cris_io_interface ioif, const char *device_id
353 local_irq_save(flags); 615 local_irq_save(flags);
354 616
355 if (interfaces[ioif].used) { 617 if (interfaces[ioif].used) {
356 local_irq_restore(flags); 618 printk(KERN_CRIT "cris_io_interface: Cannot allocate interface "
357 printk(KERN_CRIT "cris_io_interface: Cannot allocate interface for %s, in use by %s\n", 619 "%s for %s, in use by %s\n",
620 interfaces[ioif].name,
358 device_id, 621 device_id,
359 interfaces[ioif].owner); 622 interfaces[ioif].owner);
360 return -EBUSY; 623 res = -EBUSY;
624 goto exit;
361 } 625 }
362 626
363 /* Check that all required groups are free before allocating, */ 627 /* Check that all required pins in the used groups are free
628 * before allocating. */
364 group_set = interfaces[ioif].groups; 629 group_set = interfaces[ioif].groups;
365 while (NULL != (grp = get_group(group_set))) { 630 while (NULL != (grp = get_group(group_set))) {
366 if (grp->used) { 631 unsigned int if_group_use = 0;
367 if (grp->group == group_f) { 632
368 if ((if_sync_serial_1 == ioif) || 633 switch (grp->group) {
369 (if_sync_serial_3 == ioif)) { 634 case group_a:
370 if ((grp->owner != if_sync_serial_1) && 635 if_group_use = interfaces[ioif].group_a;
371 (grp->owner != if_sync_serial_3)) { 636 break;
372 local_irq_restore(flags); 637 case group_b:
373 return -EBUSY; 638 if_group_use = interfaces[ioif].group_b;
374 } 639 break;
375 } else if ((if_scsi8_0 == ioif) || 640 case group_c:
376 (if_scsi8_1 == ioif)) { 641 if_group_use = interfaces[ioif].group_c;
377 if ((grp->owner != if_scsi8_0) && 642 break;
378 (grp->owner != if_scsi8_1)) { 643 case group_d:
379 local_irq_restore(flags); 644 if_group_use = interfaces[ioif].group_d;
380 return -EBUSY; 645 break;
381 } 646 case group_e:
382 } 647 if_group_use = interfaces[ioif].group_e;
383 } else { 648 break;
384 local_irq_restore(flags); 649 case group_f:
385 return -EBUSY; 650 if_group_use = interfaces[ioif].group_f;
386 } 651 break;
652 default:
653 BUG_ON(1);
387 } 654 }
655
656 if (if_group_use & grp->used) {
657 printk(KERN_INFO "cris_request_io_interface: group "
658 "%s needed by %s not available\n",
659 grp->name, interfaces[ioif].name);
660 res = -EBUSY;
661 goto exit;
662 }
663
388 group_set = clear_group_from_set(group_set, grp); 664 group_set = clear_group_from_set(group_set, grp);
389 } 665 }
390 666
391 /* Are the required GPIO pins available too? */ 667 /* Are the required GPIO pins available too? */
392 if (((interfaces[ioif].gpio_g_in & gpio_in_pins) != interfaces[ioif].gpio_g_in) || 668 if (((interfaces[ioif].gpio_g_in & gpio_in_pins) !=
393 ((interfaces[ioif].gpio_g_out & gpio_out_pins) != interfaces[ioif].gpio_g_out) || 669 interfaces[ioif].gpio_g_in) ||
394 ((interfaces[ioif].gpio_b & gpio_pb_pins) != interfaces[ioif].gpio_b)) { 670 ((interfaces[ioif].gpio_g_out & gpio_out_pins) !=
395 local_irq_restore(flags); 671 interfaces[ioif].gpio_g_out) ||
396 printk(KERN_CRIT "cris_request_io_interface: Could not get required pins for interface %u\n", 672 ((interfaces[ioif].gpio_b & gpio_pb_pins) !=
397 ioif); 673 interfaces[ioif].gpio_b)) {
398 return -EBUSY; 674 printk(KERN_CRIT "cris_request_io_interface: Could not get "
399 } 675 "required pins for interface %u\n", ioif);
400 676 res = -EBUSY;
401 /* All needed I/O pins and pin groups are free, allocate. */ 677 goto exit;
402 group_set = interfaces[ioif].groups;
403 while (NULL != (grp = get_group(group_set))) {
404 grp->used = 1;
405 grp->owner = ioif;
406 group_set = clear_group_from_set(group_set, grp);
407 } 678 }
408 679
680 /* Check which registers need to be reconfigured. */
409 gens = genconfig_shadow; 681 gens = genconfig_shadow;
410 gens_ii = gen_config_ii_shadow; 682 gens_ii = gen_config_ii_shadow;
411 683
@@ -495,9 +767,43 @@ int cris_request_io_interface(enum cris_io_interface ioif, const char *device_id
495 set_gen_config = 0; 767 set_gen_config = 0;
496 break; 768 break;
497 default: 769 default:
498 panic("cris_request_io_interface: Bad interface %u submitted for %s\n", 770 printk(KERN_INFO "cris_request_io_interface: Bad interface "
499 ioif, 771 "%u submitted for %s\n",
500 device_id); 772 ioif, device_id);
773 res = -EBUSY;
774 goto exit;
775 }
776
777 /* All needed I/O pins and pin groups are free, allocate. */
778 group_set = interfaces[ioif].groups;
779 while (NULL != (grp = get_group(group_set))) {
780 unsigned int if_group_use = 0;
781
782 switch (grp->group) {
783 case group_a:
784 if_group_use = interfaces[ioif].group_a;
785 break;
786 case group_b:
787 if_group_use = interfaces[ioif].group_b;
788 break;
789 case group_c:
790 if_group_use = interfaces[ioif].group_c;
791 break;
792 case group_d:
793 if_group_use = interfaces[ioif].group_d;
794 break;
795 case group_e:
796 if_group_use = interfaces[ioif].group_e;
797 break;
798 case group_f:
799 if_group_use = interfaces[ioif].group_f;
800 break;
801 default:
802 BUG_ON(1);
803 }
804 grp->used |= if_group_use;
805
806 group_set = clear_group_from_set(group_set, grp);
501 } 807 }
502 808
503 interfaces[ioif].used = 1; 809 interfaces[ioif].used = 1;
@@ -516,25 +822,28 @@ int cris_request_io_interface(enum cris_io_interface ioif, const char *device_id
516 *R_GEN_CONFIG_II = gen_config_ii_shadow; 822 *R_GEN_CONFIG_II = gen_config_ii_shadow;
517 } 823 }
518 824
519 DBG(printk("GPIO pins: available before: g_in=0x%08x g_out=0x%08x pb=0x%02x\n", 825 DBG(printk(KERN_DEBUG "GPIO pins: available before: "
520 gpio_in_pins, gpio_out_pins, gpio_pb_pins)); 826 "g_in=0x%08x g_out=0x%08x pb=0x%02x\n",
521 DBG(printk("grabbing pins: g_in=0x%08x g_out=0x%08x pb=0x%02x\n", 827 gpio_in_pins, gpio_out_pins, gpio_pb_pins));
522 interfaces[ioif].gpio_g_in, 828 DBG(printk(KERN_DEBUG
523 interfaces[ioif].gpio_g_out, 829 "grabbing pins: g_in=0x%08x g_out=0x%08x pb=0x%02x\n",
524 interfaces[ioif].gpio_b)); 830 interfaces[ioif].gpio_g_in,
831 interfaces[ioif].gpio_g_out,
832 interfaces[ioif].gpio_b));
525 833
526 gpio_in_pins &= ~interfaces[ioif].gpio_g_in; 834 gpio_in_pins &= ~interfaces[ioif].gpio_g_in;
527 gpio_out_pins &= ~interfaces[ioif].gpio_g_out; 835 gpio_out_pins &= ~interfaces[ioif].gpio_g_out;
528 gpio_pb_pins &= ~interfaces[ioif].gpio_b; 836 gpio_pb_pins &= ~interfaces[ioif].gpio_b;
529 837
530 DBG(printk("GPIO pins: available after: g_in=0x%08x g_out=0x%08x pb=0x%02x\n", 838 DBG(printk(KERN_DEBUG "GPIO pins: available after: "
531 gpio_in_pins, gpio_out_pins, gpio_pb_pins)); 839 "g_in=0x%08x g_out=0x%08x pb=0x%02x\n",
840 gpio_in_pins, gpio_out_pins, gpio_pb_pins));
532 841
842exit:
533 local_irq_restore(flags); 843 local_irq_restore(flags);
534 844 if (res == 0)
535 notify_watchers(); 845 notify_watchers();
536 846 return res;
537 return 0;
538} 847}
539 848
540 849
@@ -560,43 +869,35 @@ void cris_free_io_interface(enum cris_io_interface ioif)
560 } 869 }
561 group_set = interfaces[ioif].groups; 870 group_set = interfaces[ioif].groups;
562 while (NULL != (grp = get_group(group_set))) { 871 while (NULL != (grp = get_group(group_set))) {
563 if (grp->group == group_f) { 872 unsigned int if_group_use = 0;
564 switch (ioif) 873
565 { 874 switch (grp->group) {
566 case if_sync_serial_1: 875 case group_a:
567 if ((grp->owner == if_sync_serial_1) && 876 if_group_use = interfaces[ioif].group_a;
568 interfaces[if_sync_serial_3].used) { 877 break;
569 grp->owner = if_sync_serial_3; 878 case group_b:
570 } else 879 if_group_use = interfaces[ioif].group_b;
571 grp->used = 0; 880 break;
572 break; 881 case group_c:
573 case if_sync_serial_3: 882 if_group_use = interfaces[ioif].group_c;
574 if ((grp->owner == if_sync_serial_3) && 883 break;
575 interfaces[if_sync_serial_1].used) { 884 case group_d:
576 grp->owner = if_sync_serial_1; 885 if_group_use = interfaces[ioif].group_d;
577 } else 886 break;
578 grp->used = 0; 887 case group_e:
579 break; 888 if_group_use = interfaces[ioif].group_e;
580 case if_scsi8_0: 889 break;
581 if ((grp->owner == if_scsi8_0) && 890 case group_f:
582 interfaces[if_scsi8_1].used) { 891 if_group_use = interfaces[ioif].group_f;
583 grp->owner = if_scsi8_1; 892 break;
584 } else 893 default:
585 grp->used = 0; 894 BUG_ON(1);
586 break;
587 case if_scsi8_1:
588 if ((grp->owner == if_scsi8_1) &&
589 interfaces[if_scsi8_0].used) {
590 grp->owner = if_scsi8_0;
591 } else
592 grp->used = 0;
593 break;
594 default:
595 grp->used = 0;
596 }
597 } else {
598 grp->used = 0;
599 } 895 }
896
897 if ((grp->used & if_group_use) != if_group_use)
898 BUG_ON(1);
899 grp->used = grp->used & ~if_group_use;
900
600 group_set = clear_group_from_set(group_set, grp); 901 group_set = clear_group_from_set(group_set, grp);
601 } 902 }
602 interfaces[ioif].used = 0; 903 interfaces[ioif].used = 0;
diff --git a/arch/cris/arch-v10/kernel/irq.c b/arch/cris/arch-v10/kernel/irq.c
index e06ab0050d37..65ed803dae6f 100644
--- a/arch/cris/arch-v10/kernel/irq.c
+++ b/arch/cris/arch-v10/kernel/irq.c
@@ -1,5 +1,4 @@
1/* $Id: irq.c,v 1.4 2005/01/04 12:22:28 starvik Exp $ 1/*
2 *
3 * linux/arch/cris/kernel/irq.c 2 * linux/arch/cris/kernel/irq.c
4 * 3 *
5 * Copyright (c) 2000-2002 Axis Communications AB 4 * Copyright (c) 2000-2002 Axis Communications AB
@@ -18,10 +17,6 @@
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/init.h> 18#include <linux/init.h>
20 19
21/* From kgdb.c. */
22extern void kgdb_init(void);
23extern void breakpoint(void);
24
25#define mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr)); 20#define mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr));
26#define unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr)); 21#define unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr));
27 22
diff --git a/arch/cris/arch-v10/kernel/kgdb.c b/arch/cris/arch-v10/kernel/kgdb.c
index 77f4b1423725..a3ca55150745 100644
--- a/arch/cris/arch-v10/kernel/kgdb.c
+++ b/arch/cris/arch-v10/kernel/kgdb.c
@@ -17,66 +17,8 @@
17*! Jun 17 1999 Hendrik Ruijter Added gdb 4.18 support. 'X', 'qC' and 'qL'. 17*! Jun 17 1999 Hendrik Ruijter Added gdb 4.18 support. 'X', 'qC' and 'qL'.
18*! Jul 21 1999 Bjorn Wesen eLinux port 18*! Jul 21 1999 Bjorn Wesen eLinux port
19*! 19*!
20*! $Log: kgdb.c,v $
21*! Revision 1.6 2005/01/14 10:12:17 starvik
22*! KGDB on separate port.
23*! Console fixes from 2.4.
24*!
25*! Revision 1.5 2004/10/07 13:59:08 starvik
26*! Corrected call to set_int_vector
27*!
28*! Revision 1.4 2003/04/09 05:20:44 starvik
29*! Merge of Linux 2.5.67
30*!
31*! Revision 1.3 2003/01/21 19:11:08 starvik
32*! Modified include path for new dir layout
33*!
34*! Revision 1.2 2002/11/19 14:35:24 starvik
35*! Changes from linux 2.4
36*! Changed struct initializer syntax to the currently preferred notation
37*!
38*! Revision 1.1 2001/12/17 13:59:27 bjornw
39*! Initial revision
40*!
41*! Revision 1.6 2001/10/09 13:10:03 matsfg
42*! Added $ on registers and removed some underscores
43*!
44*! Revision 1.5 2001/04/17 13:58:39 orjanf
45*! * Renamed CONFIG_KGDB to CONFIG_ETRAX_KGDB.
46*!
47*! Revision 1.4 2001/02/23 13:45:19 bjornw
48*! config.h check
49*!
50*! Revision 1.3 2001/01/31 18:08:23 orjanf
51*! Removed kgdb_handle_breakpoint from being the break 8 handler.
52*!
53*! Revision 1.2 2001/01/12 14:22:25 orjanf
54*! Updated kernel debugging support to work with ETRAX 100LX.
55*!
56*! Revision 1.1 2000/07/10 16:25:21 bjornw
57*! Initial revision
58*!
59*! Revision 1.1.1.1 1999/12/03 14:57:31 bjornw
60*! * Initial version of arch/cris, the latest CRIS architecture with an MMU.
61*! Mostly copied from arch/etrax100 with appropriate renames of files.
62*! The mm/ subdir is copied from arch/i386.
63*! This does not compile yet at all.
64*!
65*!
66*! Revision 1.4 1999/07/22 17:25:25 bjornw
67*! Dont wait for + in putpacket if we havent hit the initial breakpoint yet. Added a kgdb_init function which sets up the break and irq vectors.
68*!
69*! Revision 1.3 1999/07/21 19:51:18 bjornw
70*! Check if the interrupting char is a ctrl-C, ignore otherwise.
71*!
72*! Revision 1.2 1999/07/21 18:09:39 bjornw
73*! Ported to eLinux architecture, and added some kgdb documentation.
74*!
75*!
76*!--------------------------------------------------------------------------- 20*!---------------------------------------------------------------------------
77*! 21*!
78*! $Id: kgdb.c,v 1.6 2005/01/14 10:12:17 starvik Exp $
79*!
80*! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN 22*! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN
81*! 23*!
82*!**************************************************************************/ 24*!**************************************************************************/
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c
index 1a3760c94f85..53117f07cc1a 100644
--- a/arch/cris/arch-v10/kernel/process.c
+++ b/arch/cris/arch-v10/kernel/process.c
@@ -1,5 +1,4 @@
1/* $Id: process.c,v 1.12 2004/12/27 11:18:32 starvik Exp $ 1/*
2 *
3 * linux/arch/cris/kernel/process.c 2 * linux/arch/cris/kernel/process.c
4 * 3 *
5 * Copyright (C) 1995 Linus Torvalds 4 * Copyright (C) 1995 Linus Torvalds
diff --git a/arch/cris/arch-v10/kernel/ptrace.c b/arch/cris/arch-v10/kernel/ptrace.c
index b570ae9b6cad..ee505b2eb4db 100644
--- a/arch/cris/arch-v10/kernel/ptrace.c
+++ b/arch/cris/arch-v10/kernel/ptrace.c
@@ -65,6 +65,7 @@ void
65ptrace_disable(struct task_struct *child) 65ptrace_disable(struct task_struct *child)
66{ 66{
67 /* Todo - pending singlesteps? */ 67 /* Todo - pending singlesteps? */
68 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
68} 69}
69 70
70/* 71/*
diff --git a/arch/cris/arch-v10/kernel/shadows.c b/arch/cris/arch-v10/kernel/shadows.c
index 326178aef6ee..2454a0b02f54 100644
--- a/arch/cris/arch-v10/kernel/shadows.c
+++ b/arch/cris/arch-v10/kernel/shadows.c
@@ -1,5 +1,4 @@
1/* $Id: shadows.c,v 1.2 2004/12/13 12:21:51 starvik Exp $ 1/*
2 *
3 * Various shadow registers. Defines for these are in include/asm-etrax100/io.h 2 * Various shadow registers. Defines for these are in include/asm-etrax100/io.h
4 */ 3 */
5 4
diff --git a/arch/cris/arch-v10/kernel/traps.c b/arch/cris/arch-v10/kernel/traps.c
index 4becc1bcced9..9eada5d8893b 100644
--- a/arch/cris/arch-v10/kernel/traps.c
+++ b/arch/cris/arch-v10/kernel/traps.c
@@ -1,13 +1,10 @@
1/* $Id: traps.c,v 1.4 2005/04/24 18:47:55 starvik Exp $ 1/*
2 * Helper functions for trap handlers
2 * 3 *
3 * linux/arch/cris/arch-v10/traps.c 4 * Copyright (C) 2000-2007, Axis Communications AB.
4 * 5 *
5 * Heler functions for trap handlers 6 * Authors: Bjorn Wesen
6 * 7 * Hans-Peter Nilsson
7 * Copyright (C) 2000-2002 Axis Communications AB
8 *
9 * Authors: Bjorn Wesen
10 * Hans-Peter Nilsson
11 * 8 *
12 */ 9 */
13 10
@@ -15,124 +12,119 @@
15#include <asm/uaccess.h> 12#include <asm/uaccess.h>
16#include <asm/arch/sv_addr_ag.h> 13#include <asm/arch/sv_addr_ag.h>
17 14
18extern int raw_printk(const char *fmt, ...); 15void
19 16show_registers(struct pt_regs *regs)
20void
21show_registers(struct pt_regs * regs)
22{ 17{
23 /* We either use rdusp() - the USP register, which might not 18 /*
24 correspond to the current process for all cases we're called, 19 * It's possible to use either the USP register or current->thread.usp.
25 or we use the current->thread.usp, which is not up to date for 20 * USP might not correspond to the current process for all cases this
26 the current process. Experience shows we want the USP 21 * function is called, and current->thread.usp isn't up to date for the
27 register. */ 22 * current process. Experience shows that using USP is the way to go.
23 */
28 unsigned long usp = rdusp(); 24 unsigned long usp = rdusp();
29 25
30 raw_printk("IRP: %08lx SRP: %08lx DCCR: %08lx USP: %08lx MOF: %08lx\n", 26 printk("IRP: %08lx SRP: %08lx DCCR: %08lx USP: %08lx MOF: %08lx\n",
31 regs->irp, regs->srp, regs->dccr, usp, regs->mof ); 27 regs->irp, regs->srp, regs->dccr, usp, regs->mof);
32 raw_printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n", 28
29 printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n",
33 regs->r0, regs->r1, regs->r2, regs->r3); 30 regs->r0, regs->r1, regs->r2, regs->r3);
34 raw_printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n", 31
32 printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n",
35 regs->r4, regs->r5, regs->r6, regs->r7); 33 regs->r4, regs->r5, regs->r6, regs->r7);
36 raw_printk(" r8: %08lx r9: %08lx r10: %08lx r11: %08lx\n", 34
35 printk(" r8: %08lx r9: %08lx r10: %08lx r11: %08lx\n",
37 regs->r8, regs->r9, regs->r10, regs->r11); 36 regs->r8, regs->r9, regs->r10, regs->r11);
38 raw_printk("r12: %08lx r13: %08lx oR10: %08lx sp: %08lx\n", 37
39 regs->r12, regs->r13, regs->orig_r10, regs); 38 printk("r12: %08lx r13: %08lx oR10: %08lx sp: %08lx\n",
40 raw_printk("R_MMU_CAUSE: %08lx\n", (unsigned long)*R_MMU_CAUSE); 39 regs->r12, regs->r13, regs->orig_r10, (long unsigned)regs);
41 raw_printk("Process %s (pid: %d, stackpage=%08lx)\n", 40
41 printk("R_MMU_CAUSE: %08lx\n", (unsigned long)*R_MMU_CAUSE);
42
43 printk("Process %s (pid: %d, stackpage=%08lx)\n",
42 current->comm, current->pid, (unsigned long)current); 44 current->comm, current->pid, (unsigned long)current);
43 45
44 /* 46 /*
45 * When in-kernel, we also print out the stack and code at the 47 * When in-kernel, we also print out the stack and code at the
46 * time of the fault.. 48 * time of the fault..
47 */ 49 */
48 if (! user_mode(regs)) { 50 if (!user_mode(regs)) {
49 int i; 51 int i;
50 52
51 show_stack(NULL, (unsigned long*)usp); 53 show_stack(NULL, (unsigned long *)usp);
52 54
53 /* Dump kernel stack if the previous dump wasn't one. */ 55 /*
56 * If the previous stack-dump wasn't a kernel one, dump the
57 * kernel stack now.
58 */
54 if (usp != 0) 59 if (usp != 0)
55 show_stack (NULL, NULL); 60 show_stack(NULL, NULL);
56 61
57 raw_printk("\nCode: "); 62 printk("\nCode: ");
58 if(regs->irp < PAGE_OFFSET) 63
59 goto bad; 64 if (regs->irp < PAGE_OFFSET)
60 65 goto bad_value;
61 /* Often enough the value at regs->irp does not point to 66
62 the interesting instruction, which is most often the 67 /*
63 _previous_ instruction. So we dump at an offset large 68 * Quite often the value at regs->irp doesn't point to the
64 enough that instruction decoding should be in sync at 69 * interesting instruction, which often is the previous
65 the interesting point, but small enough to fit on a row 70 * instruction. So dump at an offset large enough that the
66 (sort of). We point out the regs->irp location in a 71 * instruction decoding should be in sync at the interesting
67 ksymoops-friendly way by wrapping the byte for that 72 * point, but small enough to fit on a row. The regs->irp
68 address in parentheses. */ 73 * location is pointed out in a ksymoops-friendly way by
69 for(i = -12; i < 12; i++) 74 * wrapping the byte for that address in parenthesises.
70 { 75 */
71 unsigned char c; 76 for (i = -12; i < 12; i++) {
72 if(__get_user(c, &((unsigned char*)regs->irp)[i])) { 77 unsigned char c;
73bad: 78
74 raw_printk(" Bad IP value."); 79 if (__get_user(c, &((unsigned char *)regs->irp)[i])) {
75 break; 80bad_value:
76 } 81 printk(" Bad IP value.");
82 break;
83 }
77 84
78 if (i == 0) 85 if (i == 0)
79 raw_printk("(%02x) ", c); 86 printk("(%02x) ", c);
80 else 87 else
81 raw_printk("%02x ", c); 88 printk("%02x ", c);
82 } 89 }
83 raw_printk("\n"); 90 printk("\n");
84 } 91 }
85} 92}
86 93
87/* Called from entry.S when the watchdog has bitten
88 * We print out something resembling an oops dump, and if
89 * we have the nice doggy development flag set, we halt here
90 * instead of rebooting.
91 */
92
93extern void reset_watchdog(void);
94extern void stop_watchdog(void);
95
96
97void 94void
98watchdog_bite_hook(struct pt_regs *regs) 95arch_enable_nmi(void)
99{ 96{
100#ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY 97 asm volatile ("setf m");
101 local_irq_disable();
102 stop_watchdog();
103 show_registers(regs);
104 while(1) /* nothing */;
105#else
106 show_registers(regs);
107#endif
108} 98}
109 99
110/* This is normally the 'Oops' routine */ 100extern void (*nmi_handler)(struct pt_regs *);
111void 101void handle_nmi(struct pt_regs *regs)
112die_if_kernel(const char * str, struct pt_regs * regs, long err)
113{ 102{
114 if(user_mode(regs)) 103 if (nmi_handler)
115 return; 104 nmi_handler(regs);
116 105
117#ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY 106 /* Wait until nmi is no longer active. (We enable NMI immediately after
118 /* This printout might take too long and trigger the 107 returning from this function, and we don't want it happening while
119 * watchdog normally. If we're in the nice doggy 108 exiting from the NMI interrupt handler.) */
120 * development mode, stop the watchdog during printout. 109 while (*R_IRQ_MASK0_RD & IO_STATE(R_IRQ_MASK0_RD, nmi_pin, active))
121 */ 110 ;
122 stop_watchdog();
123#endif
124
125 raw_printk("%s: %04lx\n", str, err & 0xffff);
126
127 show_registers(regs);
128
129#ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY
130 reset_watchdog();
131#endif
132 do_exit(SIGSEGV);
133} 111}
134 112
135void arch_enable_nmi(void) 113#ifdef CONFIG_DEBUG_BUGVERBOSE
114void
115handle_BUG(struct pt_regs *regs)
136{ 116{
137 asm volatile("setf m"); 117 struct bug_frame f;
118 unsigned char c;
119 unsigned long irp = regs->irp;
120
121 if (__copy_from_user(&f, (const void __user *)(irp - 8), sizeof f))
122 return;
123 if (f.prefix != BUG_PREFIX || f.magic != BUG_MAGIC)
124 return;
125 if (__get_user(c, f.filename))
126 f.filename = "<bad filename>";
127
128 printk("kernel BUG at %s:%d!\n", f.filename, f.line);
138} 129}
130#endif
diff --git a/arch/cris/arch-v10/lib/checksum.S b/arch/cris/arch-v10/lib/checksum.S
index 85c48f0a9ec2..7d552f4bd5ae 100644
--- a/arch/cris/arch-v10/lib/checksum.S
+++ b/arch/cris/arch-v10/lib/checksum.S
@@ -1,4 +1,4 @@
1/* $Id: checksum.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $ 1/*
2 * A fast checksum routine using movem 2 * A fast checksum routine using movem
3 * Copyright (c) 1998-2001 Axis Communications AB 3 * Copyright (c) 1998-2001 Axis Communications AB
4 * 4 *
@@ -61,8 +61,6 @@ _mloop: movem [$r10+],$r9 ; read 10 longwords
61 61
62 ax 62 ax
63 addq 0,$r12 63 addq 0,$r12
64 ax ; do it again, since we might have generated a carry
65 addq 0,$r12
66 64
67 subq 10*4,$r11 65 subq 10*4,$r11
68 bge _mloop 66 bge _mloop
@@ -88,10 +86,6 @@ _word_loop:
88 lsrq 16,$r13 ; r13 = checksum >> 16 86 lsrq 16,$r13 ; r13 = checksum >> 16
89 and.d $r9,$r12 ; checksum = checksum & 0xffff 87 and.d $r9,$r12 ; checksum = checksum & 0xffff
90 add.d $r13,$r12 ; checksum += r13 88 add.d $r13,$r12 ; checksum += r13
91 move.d $r12,$r13 ; do the same again, maybe we got a carry last add
92 lsrq 16,$r13
93 and.d $r9,$r12
94 add.d $r13,$r12
95 89
96_no_fold: 90_no_fold:
97 cmpq 2,$r11 91 cmpq 2,$r11
diff --git a/arch/cris/arch-v10/lib/checksumcopy.S b/arch/cris/arch-v10/lib/checksumcopy.S
index 35cbffb306fd..540db8a5f849 100644
--- a/arch/cris/arch-v10/lib/checksumcopy.S
+++ b/arch/cris/arch-v10/lib/checksumcopy.S
@@ -1,4 +1,4 @@
1/* $Id: checksumcopy.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $ 1/*
2 * A fast checksum+copy routine using movem 2 * A fast checksum+copy routine using movem
3 * Copyright (c) 1998, 2001 Axis Communications AB 3 * Copyright (c) 1998, 2001 Axis Communications AB
4 * 4 *
@@ -67,8 +67,6 @@ _mloop: movem [$r10+],$r9 ; read 10 longwords
67 67
68 ax 68 ax
69 addq 0,$r13 69 addq 0,$r13
70 ax ; do it again, since we might have generated a carry
71 addq 0,$r13
72 70
73 subq 10*4,$r12 71 subq 10*4,$r12
74 bge _mloop 72 bge _mloop
@@ -91,10 +89,6 @@ _word_loop:
91 lsrq 16,$r9 ; r0 = checksum >> 16 89 lsrq 16,$r9 ; r0 = checksum >> 16
92 and.d 0xffff,$r13 ; checksum = checksum & 0xffff 90 and.d 0xffff,$r13 ; checksum = checksum & 0xffff
93 add.d $r9,$r13 ; checksum += r0 91 add.d $r9,$r13 ; checksum += r0
94 move.d $r13,$r9 ; do the same again, maybe we got a carry last add
95 lsrq 16,$r9
96 and.d 0xffff,$r13
97 add.d $r9,$r13
98 92
99_no_fold: 93_no_fold:
100 cmpq 2,$r12 94 cmpq 2,$r12
diff --git a/arch/cris/arch-v10/lib/dram_init.S b/arch/cris/arch-v10/lib/dram_init.S
index 6a6bdfd6984d..b9190ff7d0a4 100644
--- a/arch/cris/arch-v10/lib/dram_init.S
+++ b/arch/cris/arch-v10/lib/dram_init.S
@@ -1,5 +1,4 @@
1/* $Id: dram_init.S,v 1.4 2003/09/22 09:21:59 starvik Exp $ 1/*
2 *
3 * DRAM/SDRAM initialization - alter with care 2 * DRAM/SDRAM initialization - alter with care
4 * This file is intended to be included from other assembler files 3 * This file is intended to be included from other assembler files
5 * 4 *
@@ -8,60 +7,7 @@
8 * 7 *
9 * Copyright (C) 2000, 2001 Axis Communications AB 8 * Copyright (C) 2000, 2001 Axis Communications AB
10 * 9 *
11 * Authors: Mikael Starvik (starvik@axis.com) 10 * Authors: Mikael Starvik (starvik@axis.com)
12 *
13 * $Log: dram_init.S,v $
14 * Revision 1.4 2003/09/22 09:21:59 starvik
15 * Decompresser is linked to 0x407xxxxx and sdram commands are at 0x000xxxxx
16 * so we need to mask off 12 bits.
17 *
18 * Revision 1.3 2003/03/31 09:38:37 starvik
19 * Corrected calculation of end of sdram init commands
20 *
21 * Revision 1.2 2002/11/19 13:33:29 starvik
22 * Changes from Linux 2.4
23 *
24 * Revision 1.13 2002/10/30 07:42:28 starvik
25 * Always read SDRAM command sequence from flash
26 *
27 * Revision 1.12 2002/08/09 11:37:37 orjanf
28 * Added double initialization work-around for Samsung SDRAMs.
29 *
30 * Revision 1.11 2002/06/04 11:43:21 starvik
31 * Check if mrs_data is specified in kernelconfig (necessary for MCM)
32 *
33 * Revision 1.10 2001/10/04 12:00:21 martinnn
34 * Added missing underscores.
35 *
36 * Revision 1.9 2001/10/01 14:47:35 bjornw
37 * Added register prefixes and removed underscores
38 *
39 * Revision 1.8 2001/05/15 07:12:45 hp
40 * Copy warning from head.S about r8 and r9
41 *
42 * Revision 1.7 2001/04/18 12:05:39 bjornw
43 * Fixed comments, and explicitly include config.h to be sure its there
44 *
45 * Revision 1.6 2001/04/10 06:20:16 starvik
46 * Delay should be 200us, not 200ns
47 *
48 * Revision 1.5 2001/04/09 06:01:13 starvik
49 * Added support for 100 MHz SDRAMs
50 *
51 * Revision 1.4 2001/03/26 14:24:01 bjornw
52 * Namechange of some config options
53 *
54 * Revision 1.3 2001/03/23 08:29:41 starvik
55 * Corrected calculation of mrs_data
56 *
57 * Revision 1.2 2001/02/08 15:20:00 starvik
58 * Corrected SDRAM initialization
59 * Should now be included as inline
60 *
61 * Revision 1.1 2001/01/29 13:08:02 starvik
62 * Initial version
63 * This file should be included from all assembler files that needs to
64 * initialize DRAM/SDRAM.
65 * 11 *
66 */ 12 */
67 13
diff --git a/arch/cris/arch-v10/lib/old_checksum.c b/arch/cris/arch-v10/lib/old_checksum.c
index 497634a64829..1734b467efa6 100644
--- a/arch/cris/arch-v10/lib/old_checksum.c
+++ b/arch/cris/arch-v10/lib/old_checksum.c
@@ -1,5 +1,4 @@
1/* $Id: old_checksum.c,v 1.3 2003/10/27 08:04:32 starvik Exp $ 1/*
2 *
3 * INET An implementation of the TCP/IP protocol suite for the LINUX 2 * INET An implementation of the TCP/IP protocol suite for the LINUX
4 * operating system. INET is implemented using the BSD Socket 3 * operating system. INET is implemented using the BSD Socket
5 * interface as the means of communication with the user level. 4 * interface as the means of communication with the user level.
diff --git a/arch/cris/arch-v10/mm/fault.c b/arch/cris/arch-v10/mm/fault.c
index fe2615022b97..65504fd80928 100644
--- a/arch/cris/arch-v10/mm/fault.c
+++ b/arch/cris/arch-v10/mm/fault.c
@@ -4,10 +4,10 @@
4 * Low level bus fault handler 4 * Low level bus fault handler
5 * 5 *
6 * 6 *
7 * Copyright (C) 2000, 2001 Axis Communications AB 7 * Copyright (C) 2000-2007 Axis Communications AB
8 *
9 * Authors: Bjorn Wesen
8 * 10 *
9 * Authors: Bjorn Wesen
10 *
11 */ 11 */
12 12
13#include <linux/mm.h> 13#include <linux/mm.h>
@@ -60,7 +60,7 @@ handle_mmu_bus_fault(struct pt_regs *regs)
60#ifdef DEBUG 60#ifdef DEBUG
61 page_id = IO_EXTRACT(R_MMU_CAUSE, page_id, cause); 61 page_id = IO_EXTRACT(R_MMU_CAUSE, page_id, cause);
62 acc = IO_EXTRACT(R_MMU_CAUSE, acc_excp, cause); 62 acc = IO_EXTRACT(R_MMU_CAUSE, acc_excp, cause);
63 inv = IO_EXTRACT(R_MMU_CAUSE, inv_excp, cause); 63 inv = IO_EXTRACT(R_MMU_CAUSE, inv_excp, cause);
64 index = IO_EXTRACT(R_TLB_SELECT, index, select); 64 index = IO_EXTRACT(R_TLB_SELECT, index, select);
65#endif 65#endif
66 miss = IO_EXTRACT(R_MMU_CAUSE, miss_excp, cause); 66 miss = IO_EXTRACT(R_MMU_CAUSE, miss_excp, cause);
@@ -84,12 +84,13 @@ handle_mmu_bus_fault(struct pt_regs *regs)
84 local_irq_disable(); 84 local_irq_disable();
85 pmd = (pmd_t *)(pgd + pgd_index(address)); 85 pmd = (pmd_t *)(pgd + pgd_index(address));
86 if (pmd_none(*pmd)) 86 if (pmd_none(*pmd))
87 return; 87 goto exit;
88 pte = *pte_offset_kernel(pmd, address); 88 pte = *pte_offset_kernel(pmd, address);
89 if (!pte_present(pte)) 89 if (!pte_present(pte))
90 return; 90 goto exit;
91 *R_TLB_SELECT = select; 91 *R_TLB_SELECT = select;
92 *R_TLB_HI = cause; 92 *R_TLB_HI = cause;
93 *R_TLB_LO = pte_val(pte); 93 *R_TLB_LO = pte_val(pte);
94exit:
94 local_irq_restore(flags); 95 local_irq_restore(flags);
95} 96}
diff --git a/arch/cris/arch-v10/mm/tlb.c b/arch/cris/arch-v10/mm/tlb.c
index 7d9fec88dee5..6baf5bd209e7 100644
--- a/arch/cris/arch-v10/mm/tlb.c
+++ b/arch/cris/arch-v10/mm/tlb.c
@@ -4,8 +4,8 @@
4 * Low level TLB handling 4 * Low level TLB handling
5 * 5 *
6 * 6 *
7 * Copyright (C) 2000-2002 Axis Communications AB 7 * Copyright (C) 2000-2007 Axis Communications AB
8 * 8 *
9 * Authors: Bjorn Wesen (bjornw@axis.com) 9 * Authors: Bjorn Wesen (bjornw@axis.com)
10 * 10 *
11 */ 11 */
@@ -39,7 +39,7 @@ flush_tlb_all(void)
39 unsigned long flags; 39 unsigned long flags;
40 40
41 /* the vpn of i & 0xf is so we dont write similar TLB entries 41 /* the vpn of i & 0xf is so we dont write similar TLB entries
42 * in the same 4-way entry group. details.. 42 * in the same 4-way entry group. details...
43 */ 43 */
44 44
45 local_irq_save(flags); 45 local_irq_save(flags);
@@ -47,7 +47,7 @@ flush_tlb_all(void)
47 *R_TLB_SELECT = ( IO_FIELD(R_TLB_SELECT, index, i) ); 47 *R_TLB_SELECT = ( IO_FIELD(R_TLB_SELECT, index, i) );
48 *R_TLB_HI = ( IO_FIELD(R_TLB_HI, page_id, INVALID_PAGEID ) | 48 *R_TLB_HI = ( IO_FIELD(R_TLB_HI, page_id, INVALID_PAGEID ) |
49 IO_FIELD(R_TLB_HI, vpn, i & 0xf ) ); 49 IO_FIELD(R_TLB_HI, vpn, i & 0xf ) );
50 50
51 *R_TLB_LO = ( IO_STATE(R_TLB_LO, global,no ) | 51 *R_TLB_LO = ( IO_STATE(R_TLB_LO, global,no ) |
52 IO_STATE(R_TLB_LO, valid, no ) | 52 IO_STATE(R_TLB_LO, valid, no ) |
53 IO_STATE(R_TLB_LO, kernel,no ) | 53 IO_STATE(R_TLB_LO, kernel,no ) |
@@ -71,10 +71,10 @@ flush_tlb_mm(struct mm_struct *mm)
71 71
72 if(page_id == NO_CONTEXT) 72 if(page_id == NO_CONTEXT)
73 return; 73 return;
74 74
75 /* mark the TLB entries that match the page_id as invalid. 75 /* mark the TLB entries that match the page_id as invalid.
76 * here we could also check the _PAGE_GLOBAL bit and NOT flush 76 * here we could also check the _PAGE_GLOBAL bit and NOT flush
77 * global pages. is it worth the extra I/O ? 77 * global pages. is it worth the extra I/O ?
78 */ 78 */
79 79
80 local_irq_save(flags); 80 local_irq_save(flags);
@@ -83,7 +83,7 @@ flush_tlb_mm(struct mm_struct *mm)
83 if (IO_EXTRACT(R_TLB_HI, page_id, *R_TLB_HI) == page_id) { 83 if (IO_EXTRACT(R_TLB_HI, page_id, *R_TLB_HI) == page_id) {
84 *R_TLB_HI = ( IO_FIELD(R_TLB_HI, page_id, INVALID_PAGEID ) | 84 *R_TLB_HI = ( IO_FIELD(R_TLB_HI, page_id, INVALID_PAGEID ) |
85 IO_FIELD(R_TLB_HI, vpn, i & 0xf ) ); 85 IO_FIELD(R_TLB_HI, vpn, i & 0xf ) );
86 86
87 *R_TLB_LO = ( IO_STATE(R_TLB_LO, global,no ) | 87 *R_TLB_LO = ( IO_STATE(R_TLB_LO, global,no ) |
88 IO_STATE(R_TLB_LO, valid, no ) | 88 IO_STATE(R_TLB_LO, valid, no ) |
89 IO_STATE(R_TLB_LO, kernel,no ) | 89 IO_STATE(R_TLB_LO, kernel,no ) |
@@ -96,9 +96,7 @@ flush_tlb_mm(struct mm_struct *mm)
96 96
97/* invalidate a single page */ 97/* invalidate a single page */
98 98
99void 99void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
100flush_tlb_page(struct vm_area_struct *vma,
101 unsigned long addr)
102{ 100{
103 struct mm_struct *mm = vma->vm_mm; 101 struct mm_struct *mm = vma->vm_mm;
104 int page_id = mm->context.page_id; 102 int page_id = mm->context.page_id;
@@ -113,7 +111,7 @@ flush_tlb_page(struct vm_area_struct *vma,
113 addr &= PAGE_MASK; /* perhaps not necessary */ 111 addr &= PAGE_MASK; /* perhaps not necessary */
114 112
115 /* invalidate those TLB entries that match both the mm context 113 /* invalidate those TLB entries that match both the mm context
116 * and the virtual address requested 114 * and the virtual address requested
117 */ 115 */
118 116
119 local_irq_save(flags); 117 local_irq_save(flags);
@@ -125,7 +123,7 @@ flush_tlb_page(struct vm_area_struct *vma,
125 (tlb_hi & PAGE_MASK) == addr) { 123 (tlb_hi & PAGE_MASK) == addr) {
126 *R_TLB_HI = IO_FIELD(R_TLB_HI, page_id, INVALID_PAGEID ) | 124 *R_TLB_HI = IO_FIELD(R_TLB_HI, page_id, INVALID_PAGEID ) |
127 addr; /* same addr as before works. */ 125 addr; /* same addr as before works. */
128 126
129 *R_TLB_LO = ( IO_STATE(R_TLB_LO, global,no ) | 127 *R_TLB_LO = ( IO_STATE(R_TLB_LO, global,no ) |
130 IO_STATE(R_TLB_LO, valid, no ) | 128 IO_STATE(R_TLB_LO, valid, no ) |
131 IO_STATE(R_TLB_LO, kernel,no ) | 129 IO_STATE(R_TLB_LO, kernel,no ) |
@@ -144,7 +142,7 @@ dump_tlb_all(void)
144{ 142{
145 int i; 143 int i;
146 unsigned long flags; 144 unsigned long flags;
147 145
148 printk("TLB dump. LO is: pfn | reserved | global | valid | kernel | we |\n"); 146 printk("TLB dump. LO is: pfn | reserved | global | valid | kernel | we |\n");
149 147
150 local_save_flags(flags); 148 local_save_flags(flags);
@@ -172,27 +170,29 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
172 170
173/* called in schedule() just before actually doing the switch_to */ 171/* called in schedule() just before actually doing the switch_to */
174 172
175void 173void switch_mm(struct mm_struct *prev, struct mm_struct *next,
176switch_mm(struct mm_struct *prev, struct mm_struct *next, 174 struct task_struct *tsk)
177 struct task_struct *tsk)
178{ 175{
179 /* make sure we have a context */ 176 if (prev != next) {
177 /* make sure we have a context */
178 get_mmu_context(next);
180 179
181 get_mmu_context(next); 180 /* remember the pgd for the fault handlers
181 * this is similar to the pgd register in some other CPU's.
182 * we need our own copy of it because current and active_mm
183 * might be invalid at points where we still need to derefer
184 * the pgd.
185 */
182 186
183 /* remember the pgd for the fault handlers 187 per_cpu(current_pgd, smp_processor_id()) = next->pgd;
184 * this is similar to the pgd register in some other CPU's.
185 * we need our own copy of it because current and active_mm
186 * might be invalid at points where we still need to derefer
187 * the pgd.
188 */
189 188
190 per_cpu(current_pgd, smp_processor_id()) = next->pgd; 189 /* switch context in the MMU */
191 190
192 /* switch context in the MMU */ 191 D(printk(KERN_DEBUG "switching mmu_context to %d (%p)\n",
193 192 next->context, next));
194 D(printk("switching mmu_context to %d (%p)\n", next->context, next));
195 193
196 *R_MMU_CONTEXT = IO_FIELD(R_MMU_CONTEXT, page_id, next->context.page_id); 194 *R_MMU_CONTEXT = IO_FIELD(R_MMU_CONTEXT,
195 page_id, next->context.page_id);
196 }
197} 197}
198 198
diff --git a/arch/cris/arch-v32/Kconfig b/arch/cris/arch-v32/Kconfig
index d8acaa920e1c..005ed2b3f7f4 100644
--- a/arch/cris/arch-v32/Kconfig
+++ b/arch/cris/arch-v32/Kconfig
@@ -1,27 +1,73 @@
1if ETRAX_ARCH_V32 1if ETRAX_ARCH_V32
2 2
3source arch/cris/arch-v32/mach-fs/Kconfig
4source arch/cris/arch-v32/mach-a3/Kconfig
5
6source drivers/cpufreq/Kconfig
7
3config ETRAX_DRAM_VIRTUAL_BASE 8config ETRAX_DRAM_VIRTUAL_BASE
4 hex 9 hex
5 depends on ETRAX_ARCH_V32 10 depends on ETRAX_ARCH_V32
6 default "c0000000" 11 default "c0000000"
7 12
8config ETRAX_LED1G 13choice
9 string "First green LED bit" 14 prompt "Nbr of Ethernet LED groups"
10 depends on ETRAX_ARCH_V32 15 depends on ETRAX_ARCH_V32
16 default ETRAX_NBR_LED_GRP_ONE
17 help
18 Select how many Ethernet LED groups that can be used. Usually one per Ethernet
19 interface is a good choice.
20
21config ETRAX_NBR_LED_GRP_ZERO
22 bool "Use zero LED groups"
23 help
24 Select this if you do not want any Ethernet LEDs.
25
26config ETRAX_NBR_LED_GRP_ONE
27 bool "Use one LED group"
28 help
29 Select this if you want one Ethernet LED group. This LED group
30 can be used for one or more Ethernet interfaces. However, it is
31 recomended that each Ethernet interface use a dedicated LED group.
32
33config ETRAX_NBR_LED_GRP_TWO
34 bool "Use two LED groups"
35 help
36 Select this if you want two Ethernet LED groups. This is the
37 best choice if you have more than one Ethernet interface and
38 would like to have separate LEDs for the interfaces.
39
40endchoice
41
42config ETRAX_LED_G_NET0
43 string "Ethernet LED group 0 green LED bit"
44 depends on ETRAX_ARCH_V32 && (ETRAX_NBR_LED_GRP_ONE || ETRAX_NBR_LED_GRP_TWO)
11 default "PA3" 45 default "PA3"
12 help 46 help
13 Bit to use for the first green LED (network LED). 47 Bit to use for the green LED in Ethernet LED group 0.
14 Most Axis products use bit A3 here.
15 48
16config ETRAX_LED1R 49config ETRAX_LED_R_NET0
17 string "First red LED bit" 50 string "Ethernet LED group 0 red LED bit"
18 depends on ETRAX_ARCH_V32 51 depends on ETRAX_ARCH_V32 && (ETRAX_NBR_LED_GRP_ONE || ETRAX_NBR_LED_GRP_TWO)
19 default "PA4" 52 default "PA4"
20 help 53 help
21 Bit to use for the first red LED (network LED). 54 Bit to use for the red LED in Ethernet LED group 0.
22 Most Axis products use bit A4 here.
23 55
24config ETRAX_LED2G 56config ETRAX_LED_G_NET1
57 string "Ethernet group 1 green LED bit"
58 depends on ETRAX_ARCH_V32 && ETRAX_NBR_LED_GRP_TWO
59 default ""
60 help
61 Bit to use for the green LED in Ethernet LED group 1.
62
63config ETRAX_LED_R_NET1
64 string "Ethernet group 1 red LED bit"
65 depends on ETRAX_ARCH_V32 && ETRAX_NBR_LED_GRP_TWO
66 default ""
67 help
68 Bit to use for the red LED in Ethernet LED group 1.
69
70config ETRAX_V32_LED2G
25 string "Second green LED bit" 71 string "Second green LED bit"
26 depends on ETRAX_ARCH_V32 72 depends on ETRAX_ARCH_V32
27 default "PA5" 73 default "PA5"
@@ -29,7 +75,7 @@ config ETRAX_LED2G
29 Bit to use for the first green LED (status LED). 75 Bit to use for the first green LED (status LED).
30 Most Axis products use bit A5 here. 76 Most Axis products use bit A5 here.
31 77
32config ETRAX_LED2R 78config ETRAX_V32_LED2R
33 string "Second red LED bit" 79 string "Second red LED bit"
34 depends on ETRAX_ARCH_V32 80 depends on ETRAX_ARCH_V32
35 default "PA6" 81 default "PA6"
@@ -37,7 +83,7 @@ config ETRAX_LED2R
37 Bit to use for the first red LED (network LED). 83 Bit to use for the first red LED (network LED).
38 Most Axis products use bit A6 here. 84 Most Axis products use bit A6 here.
39 85
40config ETRAX_LED3G 86config ETRAX_V32_LED3G
41 string "Third green LED bit" 87 string "Third green LED bit"
42 depends on ETRAX_ARCH_V32 88 depends on ETRAX_ARCH_V32
43 default "PA7" 89 default "PA7"
@@ -45,7 +91,7 @@ config ETRAX_LED3G
45 Bit to use for the first green LED (drive/power LED). 91 Bit to use for the first green LED (drive/power LED).
46 Most Axis products use bit A7 here. 92 Most Axis products use bit A7 here.
47 93
48config ETRAX_LED3R 94config ETRAX_V32_LED3R
49 string "Third red LED bit" 95 string "Third red LED bit"
50 depends on ETRAX_ARCH_V32 96 depends on ETRAX_ARCH_V32
51 default "PA7" 97 default "PA7"
@@ -54,39 +100,6 @@ config ETRAX_LED3R
54 Most Axis products use bit A7 here. 100 Most Axis products use bit A7 here.
55 101
56choice 102choice
57 prompt "Product debug-port"
58 depends on ETRAX_ARCH_V32
59 default ETRAX_DEBUG_PORT0
60
61config ETRAX_DEBUG_PORT0
62 bool "Serial-0"
63 help
64 Choose a serial port for the ETRAX debug console. Default to
65 port 0.
66
67config ETRAX_DEBUG_PORT1
68 bool "Serial-1"
69 help
70 Use serial port 1 for the console.
71
72config ETRAX_DEBUG_PORT2
73 bool "Serial-2"
74 help
75 Use serial port 2 for the console.
76
77config ETRAX_DEBUG_PORT3
78 bool "Serial-3"
79 help
80 Use serial port 3 for the console.
81
82config ETRAX_DEBUG_PORT_NULL
83 bool "disabled"
84 help
85 Disable serial-port debugging.
86
87endchoice
88
89choice
90 prompt "Kernel GDB port" 103 prompt "Kernel GDB port"
91 depends on ETRAX_KGDB 104 depends on ETRAX_KGDB
92 default ETRAX_KGDB_PORT0 105 default ETRAX_KGDB_PORT0
@@ -95,25 +108,11 @@ choice
95 not be enabled under Drivers for built-in interfaces (as it has its 108 not be enabled under Drivers for built-in interfaces (as it has its
96 own initialization code) and should not be the same as the debug port. 109 own initialization code) and should not be the same as the debug port.
97 110
98config ETRAX_KGDB_PORT0 111config ETRAX_KGDB_PORT4
99 bool "Serial-0" 112 bool "Serial-4"
100 help 113 depends on ETRAX_SERIAL_PORTS = 5
101 Use serial port 0 for kernel debugging.
102
103config ETRAX_KGDB_PORT1
104 bool "Serial-1"
105 help
106 Use serial port 1 for kernel debugging.
107
108config ETRAX_KGDB_PORT2
109 bool "Serial-2"
110 help
111 Use serial port 2 for kernel debugging.
112
113config ETRAX_KGDB_PORT3
114 bool "Serial-3"
115 help 114 help
116 Use serial port 3 for kernel debugging. 115 Use serial port 4 for kernel debugging.
117 116
118endchoice 117endchoice
119 118
diff --git a/arch/cris/arch-v32/boot/Makefile b/arch/cris/arch-v32/boot/Makefile
index 26f293ab9617..3f91349c5f12 100644
--- a/arch/cris/arch-v32/boot/Makefile
+++ b/arch/cris/arch-v32/boot/Makefile
@@ -1,14 +1,21 @@
1# 1#
2# arch/cris/arch-v32/boot/Makefile 2# arch/cris/arch-v32/boot/Makefile
3# 3#
4target = $(target_boot_dir)
5src = $(src_boot_dir)
6 4
7zImage: compressed/vmlinuz 5OBJCOPY = objcopy-cris
6OBJCOPYFLAGS = -O binary -R .note -R .comment
8 7
9compressed/vmlinuz: $(objtree)/vmlinux 8subdir- := compressed rescue
10 @$(MAKE) -f $(src)/compressed/Makefile $(objtree)/vmlinuz 9targets := Image
11 10
12clean: 11$(obj)/Image: vmlinux FORCE
13 rm -f zImage tools/build compressed/vmlinux.out 12 $(call if_changed,objcopy)
14 @$(MAKE) -f $(src)/compressed/Makefile clean 13 @echo ' Kernel: $@ is ready'
14
15$(obj)/compressed/vmlinux: $(obj)/Image FORCE
16 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
17 $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
18
19$(obj)/zImage: $(obj)/compressed/vmlinux
20 @cp $< $@
21 @echo ' Kernel: $@ is ready'
diff --git a/arch/cris/arch-v32/boot/compressed/Makefile b/arch/cris/arch-v32/boot/compressed/Makefile
index 609692f9d5eb..2c8c2c3039c5 100644
--- a/arch/cris/arch-v32/boot/compressed/Makefile
+++ b/arch/cris/arch-v32/boot/compressed/Makefile
@@ -1,41 +1,30 @@
1# 1#
2# lx25/arch/cris/arch-v32/boot/compressed/Makefile 2# arch/cris/arch-v32/boot/compressed/Makefile
3# 3#
4# create a compressed vmlinux image from the original vmlinux files and romfs
5#
6
7target = $(target_compressed_dir)
8src = $(src_compressed_dir)
9 4
10CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE) 5CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE)
11CFLAGS = -O2 6asflags-y += -I $(srctree)/include/asm/mach/ -I $(srctree)/include/asm/arch
7ccflags-y += -O2 -I $(srctree)/include/asm/mach/ -I $(srctree)/include/asm/arch
12LD = gcc-cris -mlinux -march=v32 -nostdlib 8LD = gcc-cris -mlinux -march=v32 -nostdlib
9ldflags-y += -T $(obj)/decompress.ld
10obj-y = head.o misc.o
11OBJECTS = $(obj)/head.o $(obj)/misc.o
13OBJCOPY = objcopy-cris 12OBJCOPY = objcopy-cris
14OBJCOPYFLAGS = -O binary --remove-section=.bss 13OBJCOPYFLAGS = -O binary --remove-section=.bss
15OBJECTS = $(target)/head.o $(target)/misc.o
16
17# files to compress
18SYSTEM = $(objtree)/vmlinux.bin
19
20all: vmlinuz
21
22$(target)/decompress.bin: $(OBJECTS)
23 $(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS)
24 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin
25 14
26$(objtree)/vmlinuz: $(target) piggy.img $(target)/decompress.bin 15quiet_cmd_image = BUILD $@
27 cat $(target)/decompress.bin piggy.img > $(objtree)/vmlinuz 16cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@
28 rm -f piggy.img
29 cp $(objtree)/vmlinuz $(src)
30 17
31$(target)/head.o: $(src)/head.S 18targets := vmlinux piggy.gz decompress.o decompress.bin
32 $(CC) -D__ASSEMBLY__ -c $< -o $@
33 19
34# gzip the kernel image 20$(obj)/decompress.o: $(OBJECTS) FORCE
21 $(call if_changed,ld)
35 22
36piggy.img: $(SYSTEM) 23$(obj)/decompress.bin: $(obj)/decompress.o FORCE
37 cat $(SYSTEM) | gzip -f -9 > piggy.img 24 $(call if_changed,objcopy)
38 25
39clean: 26$(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE
40 rm -f piggy.img $(objtree)/vmlinuz vmlinuz.o decompress.o decompress.bin $(OBJECTS) 27 $(call if_changed,image)
41 28
29$(obj)/piggy.gz: $(obj)/../Image FORCE
30 $(call if_changed,gzip)
diff --git a/arch/cris/arch-v32/boot/compressed/README b/arch/cris/arch-v32/boot/compressed/README
index e33691d15c57..182c5d75784b 100644
--- a/arch/cris/arch-v32/boot/compressed/README
+++ b/arch/cris/arch-v32/boot/compressed/README
@@ -1,6 +1,5 @@
1Creation of the self-extracting compressed kernel image (vmlinuz) 1Creation of the self-extracting compressed kernel image (vmlinuz)
2----------------------------------------------------------------- 2-----------------------------------------------------------------
3$Id: README,v 1.1 2003/08/21 09:37:03 johana Exp $
4 3
5This can be slightly confusing because it's a process with many steps. 4This can be slightly confusing because it's a process with many steps.
6 5
diff --git a/arch/cris/arch-v32/boot/compressed/head.S b/arch/cris/arch-v32/boot/compressed/head.S
index 34cea10a8998..f86208caf32d 100644
--- a/arch/cris/arch-v32/boot/compressed/head.S
+++ b/arch/cris/arch-v32/boot/compressed/head.S
@@ -2,13 +2,12 @@
2 * Code that sets up the DRAM registers, calls the 2 * Code that sets up the DRAM registers, calls the
3 * decompressor to unpack the piggybacked kernel, and jumps. 3 * decompressor to unpack the piggybacked kernel, and jumps.
4 * 4 *
5 * Copyright (C) 1999 - 2003, Axis Communications AB 5 * Copyright (C) 1999 - 2006, Axis Communications AB
6 */ 6 */
7 7
8#define ASSEMBLER_MACROS_ONLY 8#define ASSEMBLER_MACROS_ONLY
9#include <asm/arch/hwregs/asm/reg_map_asm.h> 9#include <hwregs/asm/reg_map_asm.h>
10#include <asm/arch/hwregs/asm/gio_defs_asm.h> 10#include <asm/arch/mach/startup.inc>
11#include <asm/arch/hwregs/asm/config_defs_asm.h>
12 11
13#define RAM_INIT_MAGIC 0x56902387 12#define RAM_INIT_MAGIC 0x56902387
14#define COMMAND_LINE_MAGIC 0x87109563 13#define COMMAND_LINE_MAGIC 0x87109563
@@ -22,114 +21,49 @@ start:
22 di 21 di
23 22
24 ;; Start clocks for used blocks. 23 ;; Start clocks for used blocks.
25 move.d REG_ADDR(config, regi_config, rw_clk_ctrl), $r1 24 START_CLOCKS
26 move.d [$r1], $r0 25
27 or.d REG_STATE(config, rw_clk_ctrl, cpu, yes) | \ 26 ;; Initialize the DRAM registers.
28 REG_STATE(config, rw_clk_ctrl, bif, yes) | \
29 REG_STATE(config, rw_clk_ctrl, fix_io, yes), $r0
30 move.d $r0, [$r1]
31
32 ;; If booting from NAND flash we first have to copy some
33 ;; data from NAND flash to internal RAM to get the code
34 ;; that initializes the SDRAM. Lets copy 20 KB. This
35 ;; code executes at 0x38010000 if booting from NAND and
36 ;; we are guaranted that at least 0x200 bytes are good so
37 ;; lets start from there. The first 8192 bytes in the nand
38 ;; flash is spliced with zeroes and is thus 16384 bytes.
39 move.d 0x38010200, $r10
40 move.d 0x14200, $r11 ; Start offset in NAND flash 0x10200 + 16384
41 move.d 0x5000, $r12 ; Length of copy
42
43 ;; Before this code the tools add a partitiontable so the PC
44 ;; has an offset from the linked address.
45offset1:
46 lapcq ., $r13 ; get PC
47 add.d first_copy_complete-offset1, $r13
48
49#include "../../lib/nand_init.S"
50
51first_copy_complete:
52 ;; Initialze the DRAM registers.
53 cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized? 27 cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized?
54 beq dram_init_finished 28 beq dram_init_finished
55 nop 29 nop
56 30
57#include "../../lib/dram_init.S" 31#include "../../mach/dram_init.S"
58 32
59dram_init_finished: 33dram_init_finished:
60 lapcq ., $r13 ; get PC
61 add.d second_copy_complete-dram_init_finished, $r13
62
63 move.d REG_ADDR(config, regi_config, r_bootsel), $r0
64 move.d [$r0], $r0
65 and.d REG_MASK(config, r_bootsel, boot_mode), $r0
66 cmp.d REG_STATE(config, r_bootsel, boot_mode, nand), $r0
67 bne second_copy_complete ; No NAND boot
68 nop
69
70 ;; Copy 2MB from NAND flash to SDRAM (at 2-4MB into the SDRAM)
71 move.d 0x40204000, $r10
72 move.d 0x8000, $r11
73 move.d 0x200000, $r12
74 ba copy_nand_to_ram
75 nop
76second_copy_complete:
77
78 ;; Initiate the PA port.
79 move.d CONFIG_ETRAX_DEF_GIO_PA_OUT, $r0
80 move.d REG_ADDR(gio, regi_gio, rw_pa_dout), $r1
81 move.d $r0, [$r1]
82
83 move.d CONFIG_ETRAX_DEF_GIO_PA_OE, $r0
84 move.d REG_ADDR(gio, regi_gio, rw_pa_oe), $r1
85 move.d $r0, [$r1]
86 34
35 GIO_INIT
87 ;; Setup the stack to a suitably high address. 36 ;; Setup the stack to a suitably high address.
88 ;; We assume 8 MB is the minimum DRAM and put 37 ;; We assume 8 MB is the minimum DRAM and put
89 ;; the SP at the top for now. 38 ;; the SP at the top for now.
90 39
91 move.d 0x40800000, $sp 40 move.d 0x40800000, $sp
92 41
93 ;; Figure out where the compressed piggyback image is 42 ;; Figure out where the compressed piggyback image is.
94 ;; in the flash (since we wont try to copy it to DRAM 43 ;; It is either in [NOR] flash (we don't want to copy it
95 ;; before unpacking). It is at _edata, but in flash. 44 ;; to DRAM before unpacking), or copied to DRAM
45 ;; by the [NAND] flash boot loader.
46 ;; The piggyback image is at _edata, but relative to where the
47 ;; image is actually located in memory, not where it is linked
48 ;; (the decompressor is linked at 0x40700000+ and runs there).
96 ;; Use (_edata - herami) as offset to the current PC. 49 ;; Use (_edata - herami) as offset to the current PC.
97 50
98 move.d REG_ADDR(config, regi_config, r_bootsel), $r0
99 move.d [$r0], $r0
100 and.d REG_MASK(config, r_bootsel, boot_mode), $r0
101 cmp.d REG_STATE(config, r_bootsel, boot_mode, nand), $r0
102 beq hereami2
103 nop
104hereami: 51hereami:
105 lapcq ., $r5 ; get PC 52 lapcq ., $r5 ; get PC
106 and.d 0x7fffffff, $r5 ; strip any non-cache bit 53 and.d 0x7fffffff, $r5 ; strip any non-cache bit
107 move.d $r5, $r0 ; save for later - flash address of 'herami' 54 move.d $r5, $r0 ; source address of 'herami'
108 add.d _edata, $r5 55 add.d _edata, $r5
109 sub.d hereami, $r5 ; r5 = flash address of '_edata' 56 sub.d hereami, $r5 ; r5 = flash address of '_edata'
110 move.d hereami, $r1 ; destination 57 move.d hereami, $r1 ; destination
111 ba 2f 58
112 nop
113hereami2:
114 lapcq ., $r5 ; get PC
115 and.d 0x00ffffff, $r5 ; strip any non-cache bit
116 move.d $r5, $r6
117 or.d 0x40200000, $r6
118 move.d $r6, $r0 ; save for later - flash address of 'herami'
119 add.d _edata, $r5
120 sub.d hereami2, $r5 ; r5 = flash address of '_edata'
121 add.d 0x40200000, $r5
122 move.d hereami2, $r1 ; destination
1232:
124 ;; Copy text+data to DRAM 59 ;; Copy text+data to DRAM
125 60
126 move.d _edata, $r2 ; end destination 61 move.d _edata, $r2 ; end destination
1271: move.w [$r0+], $r3 621: move.w [$r0+], $r3 ; from herami+ source
128 move.w $r3, [$r1+] 63 move.w $r3, [$r1+] ; to hereami+ destination (linked address)
129 cmp.d $r2, $r1 64 cmp.d $r2, $r1 ; finish when destination == _edata
130 bcs 1b 65 bcs 1b
131 nop 66 nop
132
133 move.d input_data, $r0 ; for the decompressor 67 move.d input_data, $r0 ; for the decompressor
134 move.d $r5, [$r0] ; for the decompressor 68 move.d $r5, [$r0] ; for the decompressor
135 69
@@ -144,16 +78,24 @@ hereami2:
144 nop 78 nop
145 79
146 ;; Save command line magic and address. 80 ;; Save command line magic and address.
147 move.d _cmd_line_magic, $r12 81 move.d _cmd_line_magic, $r0
148 move.d $r10, [$r12] 82 move.d $r10, [$r0]
149 move.d _cmd_line_addr, $r12 83 move.d _cmd_line_addr, $r0
150 move.d $r11, [$r12] 84 move.d $r11, [$r0]
85
86 ;; Save boot source indicator
87 move.d _boot_source, $r0
88 move.d $r12, [$r0]
151 89
152 ;; Do the decompression and save compressed size in _inptr 90 ;; Do the decompression and save compressed size in _inptr
153 91
154 jsr decompress_kernel 92 jsr decompress_kernel
155 nop 93 nop
156 94
95 ;; Restore boot source indicator
96 move.d _boot_source, $r12
97 move.d [$r12], $r12
98
157 ;; Restore command line magic and address. 99 ;; Restore command line magic and address.
158 move.d _cmd_line_magic, $r10 100 move.d _cmd_line_magic, $r10
159 move.d [$r10], $r10 101 move.d [$r10], $r10
@@ -166,11 +108,10 @@ hereami2:
166 move.d [$r0], $r9 ; flash address of compressed kernel 108 move.d [$r0], $r9 ; flash address of compressed kernel
167 move.d inptr, $r0 109 move.d inptr, $r0
168 add.d [$r0], $r9 ; size of compressed kernel 110 add.d [$r0], $r9 ; size of compressed kernel
169 cmp.d 0x40200000, $r9 111 cmp.d 0x40000000, $r9 ; image in DRAM ?
170 blo enter_kernel 112 blo enter_kernel ; no, must be [NOR] flash, jump
171 nop 113 nop ; delay slot
172 sub.d 0x40200000, $r9 114 and.d 0x001fffff, $r9 ; assume compressed kernel was < 2M
173 add.d 0x4000, $r9
174 115
175enter_kernel: 116enter_kernel:
176 ;; Enter the decompressed kernel 117 ;; Enter the decompressed kernel
@@ -186,7 +127,7 @@ _cmd_line_magic:
186 .dword 0 127 .dword 0
187_cmd_line_addr: 128_cmd_line_addr:
188 .dword 0 129 .dword 0
189is_nand_boot: 130_boot_source:
190 .dword 0 131 .dword 0
191 132
192#include "../../lib/hw_settings.S" 133#include "../../mach/hw_settings.S"
diff --git a/arch/cris/arch-v32/boot/compressed/misc.c b/arch/cris/arch-v32/boot/compressed/misc.c
index 0169ba1ca9c9..55b2695c5d70 100644
--- a/arch/cris/arch-v32/boot/compressed/misc.c
+++ b/arch/cris/arch-v32/boot/compressed/misc.c
@@ -1,8 +1,6 @@
1/* 1/*
2 * misc.c 2 * misc.c
3 * 3 *
4 * $Id: misc.c,v 1.8 2005/04/24 18:34:29 starvik Exp $
5 *
6 * This is a collection of several routines from gzip-1.0.3 4 * This is a collection of several routines from gzip-1.0.3
7 * adapted for Linux. 5 * adapted for Linux.
8 * 6 *
@@ -22,9 +20,13 @@
22 20
23 21
24#include <linux/types.h> 22#include <linux/types.h>
25#include <asm/arch/hwregs/reg_rdwr.h> 23#include <hwregs/reg_rdwr.h>
26#include <asm/arch/hwregs/reg_map.h> 24#include <hwregs/reg_map.h>
27#include <asm/arch/hwregs/ser_defs.h> 25#include <hwregs/ser_defs.h>
26#include <hwregs/pinmux_defs.h>
27#ifdef CONFIG_CRIS_MACH_ARTPEC3
28#include <hwregs/clkgen_defs.h>
29#endif
28 30
29/* 31/*
30 * gzip declarations 32 * gzip declarations
@@ -85,7 +87,6 @@ static unsigned outcnt = 0; /* bytes in output buffer */
85# define Tracecv(c,x) 87# define Tracecv(c,x)
86#endif 88#endif
87 89
88static int fill_inbuf(void);
89static void flush_window(void); 90static void flush_window(void);
90static void error(char *m); 91static void error(char *m);
91static void gzip_mark(void **); 92static void gzip_mark(void **);
@@ -186,6 +187,8 @@ memset(void* s, int c, size_t n)
186 char *ss = (char*)s; 187 char *ss = (char*)s;
187 188
188 for (i=0;i<n;i++) ss[i] = c; 189 for (i=0;i<n;i++) ss[i] = c;
190
191 return s;
189} 192}
190 193
191void* 194void*
@@ -196,6 +199,8 @@ memcpy(void* __dest, __const void* __src,
196 char *d = (char *)__dest, *s = (char *)__src; 199 char *d = (char *)__dest, *s = (char *)__src;
197 200
198 for (i=0;i<__n;i++) d[i] = s[i]; 201 for (i=0;i<__n;i++) d[i] = s[i];
202
203 return __dest;
199} 204}
200 205
201/* =========================================================================== 206/* ===========================================================================
@@ -225,15 +230,15 @@ flush_window()
225static void 230static void
226error(char *x) 231error(char *x)
227{ 232{
228 puts("\n\n"); 233 puts("\r\n\n");
229 puts(x); 234 puts(x);
230 puts("\n\n -- System halted\n"); 235 puts("\r\n\n -- System halted\n");
231 236
232 while(1); /* Halt */ 237 while(1); /* Halt */
233} 238}
234 239
235void 240void
236setup_normal_output_buffer() 241setup_normal_output_buffer(void)
237{ 242{
238 output_data = (char *)KERNEL_LOAD_ADR; 243 output_data = (char *)KERNEL_LOAD_ADR;
239} 244}
@@ -262,15 +267,17 @@ serial_setup(reg_scope_instances regi_ser)
262 rec_baud = REG_RD(ser, regi_ser, rw_rec_baud_div); 267 rec_baud = REG_RD(ser, regi_ser, rw_rec_baud_div);
263 268
264 tr_ctrl.stop_bits = 1; /* 2 stop bits. */ 269 tr_ctrl.stop_bits = 1; /* 2 stop bits. */
270 tr_ctrl.en = 1; /* enable transmitter */
271 rec_ctrl.en = 1; /* enabler receiver */
265 272
266 /* 273 /*
267 * The baudrate setup is a bit fishy, but in the end the transceiver is 274 * The baudrate setup used to be a bit fishy, but now transmitter and
268 * set to 4800 and the receiver to 115200. The magic value is 275 * receiver are both set to the intended baud rate, 115200.
269 * 29.493 MHz. 276 * The magic value is 29.493 MHz.
270 */ 277 */
271 tr_ctrl.base_freq = regk_ser_f29_493; 278 tr_ctrl.base_freq = regk_ser_f29_493;
272 rec_ctrl.base_freq = regk_ser_f29_493; 279 rec_ctrl.base_freq = regk_ser_f29_493;
273 tr_baud.div = (29493000 / 8) / 4800; 280 tr_baud.div = (29493000 / 8) / 115200;
274 rec_baud.div = (29493000 / 8) / 115200; 281 rec_baud.div = (29493000 / 8) / 115200;
275 282
276 REG_WR(ser, regi_ser, rw_tr_ctrl, tr_ctrl); 283 REG_WR(ser, regi_ser, rw_tr_ctrl, tr_ctrl);
@@ -280,25 +287,52 @@ serial_setup(reg_scope_instances regi_ser)
280} 287}
281 288
282void 289void
283decompress_kernel() 290decompress_kernel(void)
284{ 291{
285 char revision; 292 char revision;
286 293
287 /* input_data is set in head.S */ 294#if defined(CONFIG_ETRAX_DEBUG_PORT1) || \
288 inbuf = input_data; 295 defined(CONFIG_ETRAX_DEBUG_PORT2) || \
296 defined(CONFIG_ETRAX_DEBUG_PORT3)
297 reg_pinmux_rw_hwprot hwprot;
298
299#ifdef CONFIG_CRIS_MACH_ARTPEC3
300 reg_clkgen_rw_clk_ctrl clk_ctrl;
301
302 /* Enable corresponding clock region when serial 1..3 selected */
303
304 clk_ctrl = REG_RD(clkgen, regi_clkgen, rw_clk_ctrl);
305 clk_ctrl.sser_ser_dma6_7 = regk_clkgen_yes;
306 REG_WR(clkgen, regi_clkgen, rw_clk_ctrl, clk_ctrl);
307#endif
308
309 /* pinmux setup for ports 1..3 */
310 hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot);
311#endif
289 312
290#ifdef CONFIG_ETRAX_DEBUG_PORT0 313#ifdef CONFIG_ETRAX_DEBUG_PORT0
291 serial_setup(regi_ser0); 314 serial_setup(regi_ser0);
292#endif 315#endif
293#ifdef CONFIG_ETRAX_DEBUG_PORT1 316#ifdef CONFIG_ETRAX_DEBUG_PORT1
317 hwprot.ser1 = regk_pinmux_yes;
294 serial_setup(regi_ser1); 318 serial_setup(regi_ser1);
295#endif 319#endif
296#ifdef CONFIG_ETRAX_DEBUG_PORT2 320#ifdef CONFIG_ETRAX_DEBUG_PORT2
321 hwprot.ser2 = regk_pinmux_yes;
297 serial_setup(regi_ser2); 322 serial_setup(regi_ser2);
298#endif 323#endif
299#ifdef CONFIG_ETRAX_DEBUG_PORT3 324#ifdef CONFIG_ETRAX_DEBUG_PORT3
325 hwprot.ser3 = regk_pinmux_yes;
300 serial_setup(regi_ser3); 326 serial_setup(regi_ser3);
301#endif 327#endif
328#if defined(CONFIG_ETRAX_DEBUG_PORT1) || \
329 defined(CONFIG_ETRAX_DEBUG_PORT2) || \
330 defined(CONFIG_ETRAX_DEBUG_PORT3)
331 REG_WR(pinmux, regi_pinmux, rw_hwprot, hwprot);
332#endif
333
334 /* input_data is set in head.S */
335 inbuf = input_data;
302 336
303 setup_normal_output_buffer(); 337 setup_normal_output_buffer();
304 338
@@ -307,11 +341,11 @@ decompress_kernel()
307 __asm__ volatile ("move $vr,%0" : "=rm" (revision)); 341 __asm__ volatile ("move $vr,%0" : "=rm" (revision));
308 if (revision < 32) 342 if (revision < 32)
309 { 343 {
310 puts("You need an ETRAX FS to run Linux 2.6/crisv32.\n"); 344 puts("You need an ETRAX FS to run Linux 2.6/crisv32.\r\n");
311 while(1); 345 while(1);
312 } 346 }
313 347
314 puts("Uncompressing Linux...\n"); 348 puts("Uncompressing Linux...\r\n");
315 gunzip(); 349 gunzip();
316 puts("Done. Now booting the kernel.\n"); 350 puts("Done. Now booting the kernel.\r\n");
317} 351}
diff --git a/arch/cris/arch-v32/boot/rescue/Makefile b/arch/cris/arch-v32/boot/rescue/Makefile
index f668a8198724..c0987795dcb7 100644
--- a/arch/cris/arch-v32/boot/rescue/Makefile
+++ b/arch/cris/arch-v32/boot/rescue/Makefile
@@ -1,36 +1,27 @@
1# 1#
2# Makefile for rescue code 2# Makefile for rescue (bootstrap) code
3# 3#
4target = $(target_rescue_dir)
5src = $(src_rescue_dir)
6 4
7CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE) 5CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE)
8CFLAGS = -O2 6ccflags-y += -O2 -I $(srctree)/include/asm/arch/mach/ \
7 -I $(srctree)/include/asm/arch
8asflags-y += -I $(srctree)/include/asm/arch/mach/ -I $(srctree)/include/asm/arch
9LD = gcc-cris -mlinux -march=v32 -nostdlib 9LD = gcc-cris -mlinux -march=v32 -nostdlib
10ldflags-y += -T $(obj)/rescue.ld
11LDPOSTFLAGS = -lgcc
10OBJCOPY = objcopy-cris 12OBJCOPY = objcopy-cris
11OBJCOPYFLAGS = -O binary --remove-section=.bss 13OBJCOPYFLAGS = -O binary --remove-section=.bss
14obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o
15OBJECT := $(obj)/head.o
12 16
13all: $(target)/rescue.bin 17targets := rescue.o rescue.bin
14 18
15rescue: rescue.bin 19quiet_cmd_ldlibgcc = LD $@
16 # do nothing 20cmd_ldlibgcc = $(LD) $(LDFLAGS) $(filter-out FORCE,$^) $(LDPOSTFLAGS) -o $@
17 21
18$(target)/rescue.bin: $(target) $(target)/head.o 22$(obj)/rescue.o: $(OBJECTS) FORCE
19 $(LD) -T $(src)/rescue.ld -o $(target)/rescue.o $(target)/head.o 23 $(call if_changed,ldlibgcc)
20 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/rescue.o $(target)/rescue.bin
21 cp -p $(target)/rescue.bin $(objtree)
22 24
23$(target): 25$(obj)/rescue.bin: $(obj)/rescue.o FORCE
24 mkdir -p $(target) 26 $(call if_changed,objcopy)
25 27 cp -p $(obj)/rescue.bin $(objtree)
26$(target)/head.o: $(src)/head.S
27 $(CC) -D__ASSEMBLY__ -c $< -o $*.o
28
29clean:
30 rm -f $(target)/*.o $(target)/*.bin
31
32fastdep:
33
34modules:
35
36modules-install:
diff --git a/arch/cris/arch-v32/boot/rescue/head.S b/arch/cris/arch-v32/boot/rescue/head.S
index 8cdb4011bc16..5f846b7700a3 100644
--- a/arch/cris/arch-v32/boot/rescue/head.S
+++ b/arch/cris/arch-v32/boot/rescue/head.S
@@ -1,38 +1,26 @@
1/* $Id: head.S,v 1.4 2004/11/01 16:10:28 starvik Exp $ 1/*
2 * Just get started by jumping to CONFIG_ETRAX_PTABLE_SECTOR to start
3 * kernel decompressor.
4 *
5 * In practice, this only works for NOR flash (or some convoluted RAM boot)
6 * and hence is not really useful for Artpec-3, so it's Etrax FS / NOR only.
2 * 7 *
3 * This used to be the rescue code but now that is handled by the
4 * RedBoot based RFL instead. Nothing to see here, move along.
5 */ 8 */
6 9
7#include <asm/arch/hwregs/reg_map_asm.h> 10#include <mach/startup.inc>
8#include <asm/arch/hwregs/config_defs_asm.h>
9 11
10 .text 12#ifdef CONFIG_ETRAX_AXISFLASHMAP
11 13
12 ;; Start clocks for used blocks. 14;; Code
13 move.d REG_ADDR(config, regi_config, rw_clk_ctrl), $r1
14 move.d [$r1], $r0
15 or.d REG_STATE(config, rw_clk_ctrl, cpu, yes) | \
16 REG_STATE(config, rw_clk_ctrl, bif, yes) | \
17 REG_STATE(config, rw_clk_ctrl, fix_io, yes), $r0
18 move.d $r0, [$r1]
19 15
20 ;; Copy 68KB NAND flash to Internal RAM (if NAND boot) 16 .text
21 move.d 0x38004000, $r10 17start:
22 move.d 0x8000, $r11
23 move.d 0x11000, $r12
24 move.d copy_complete, $r13
25 and.d 0x000fffff, $r13
26 or.d 0x38000000, $r13
27 18
28#include "../../lib/nand_init.S" 19 ;; Start clocks for used blocks.
20 START_CLOCKS
29 21
30 ;; No NAND found
31 move.d CONFIG_ETRAX_PTABLE_SECTOR, $r10 22 move.d CONFIG_ETRAX_PTABLE_SECTOR, $r10
32 jump $r10 ; Jump to decompresser 23 jump $r10 ; Jump to decompressor
33 nop 24 nop
34 25
35copy_complete: 26#endif
36 move.d 0x38000000 + CONFIG_ETRAX_PTABLE_SECTOR, $r10
37 jump $r10 ; Jump to decompresser
38 nop
diff --git a/arch/cris/arch-v32/boot/rescue/rescue.ld b/arch/cris/arch-v32/boot/rescue/rescue.ld
index 42b11aa122b2..8ac646bc1a2b 100644
--- a/arch/cris/arch-v32/boot/rescue/rescue.ld
+++ b/arch/cris/arch-v32/boot/rescue/rescue.ld
@@ -1,20 +1,43 @@
1/*#OUTPUT_FORMAT(elf32-us-cris) */
2OUTPUT_ARCH (crisv32)
3/* Now that NAND support has been stripped, this file could be simplified,
4 * but it doesn't do any harm on the other hand so why bother. */
5
1MEMORY 6MEMORY
2 { 7 {
3 flash : ORIGIN = 0x00000000, 8 bootblk : ORIGIN = 0x38000000,
4 LENGTH = 0x00100000 9 LENGTH = 0x00004000
10 intmem : ORIGIN = 0x38004000,
11 LENGTH = 0x00005000
5 } 12 }
6 13
7SECTIONS 14SECTIONS
8{ 15{
9 .text : 16 .text :
10 { 17 {
11 stext = . ; 18 _stext = . ;
12 *(.text) 19 *(.text)
13 etext = . ; 20 *(.init.text)
14 } > flash 21 *(.rodata)
22 *(.rodata.*)
23 _etext = . ;
24 } > bootblk
15 .data : 25 .data :
16 { 26 {
17 *(.data) 27 *(.data)
18 edata = . ; 28 _edata = . ;
19 } > flash 29 } > bootblk
30 .bss :
31 {
32 _bss = . ;
33 *(.bss)
34 _end = ALIGN( 0x10 ) ;
35 } > intmem
36
37 /* Get rid of stuff from EXPORT_SYMBOL(foo). */
38 /DISCARD/ :
39 {
40 *(__ksymtab_strings)
41 *(__ksymtab)
42 }
20} 43}
diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig
index c329cce2a0c3..2a92cb1886ca 100644
--- a/arch/cris/arch-v32/drivers/Kconfig
+++ b/arch/cris/arch-v32/drivers/Kconfig
@@ -4,64 +4,102 @@ config ETRAX_ETHERNET
4 bool "Ethernet support" 4 bool "Ethernet support"
5 depends on ETRAX_ARCH_V32 5 depends on ETRAX_ARCH_V32
6 select NET_ETHERNET 6 select NET_ETHERNET
7 select MII
7 help 8 help
8 This option enables the ETRAX FS built-in 10/100Mbit Ethernet 9 This option enables the ETRAX FS built-in 10/100Mbit Ethernet
9 controller. 10 controller.
10 11
11config ETRAX_ETHERNET_HW_CSUM 12config ETRAX_NO_PHY
12 bool "Hardware accelerated ethernet checksum and scatter/gather" 13 bool "PHY not present"
13 depends on ETRAX_ETHERNET 14 depends on ETRAX_ETHERNET
14 depends on ETRAX_STREAMCOPROC 15 default N
15 default y
16 help 16 help
17 Hardware acceleration of checksumming and scatter/gather 17 This option disables all MDIO communication with an ethernet
18 transceiver connected to the MII interface. This option shall
19 typically be enabled if the MII interface is connected to a
20 switch. This option should normally be disabled. If enabled,
21 speed and duplex will be locked to 100 Mbit and full duplex.
18 22
19config ETRAX_ETHERNET_IFACE0 23config ETRAX_ETHERNET_IFACE0
20 depends on ETRAX_ETHERNET 24 depends on ETRAX_ETHERNET
21 bool "Enable network interface 0" 25 bool "Enable network interface 0"
22 26
23config ETRAX_ETHERNET_IFACE1 27config ETRAX_ETHERNET_IFACE1
24 depends on ETRAX_ETHERNET 28 depends on (ETRAX_ETHERNET && ETRAXFS)
25 bool "Enable network interface 1 (uses DMA6 and DMA7)" 29 bool "Enable network interface 1 (uses DMA6 and DMA7)"
26 30
31config ETRAX_ETHERNET_GBIT
32 depends on (ETRAX_ETHERNET && CRIS_MACH_ARTPEC3)
33 bool "Enable gigabit Ethernet support"
34
27choice 35choice
28 prompt "Network LED behavior" 36 prompt "Eth0 led group"
29 depends on ETRAX_ETHERNET 37 depends on ETRAX_ETHERNET_IFACE0
30 default ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY 38 default ETRAX_ETH0_USE_LEDGRP0
31 39
32config ETRAX_NETWORK_LED_ON_WHEN_LINK 40config ETRAX_ETH0_USE_LEDGRP0
33 bool "LED_on_when_link" 41 bool "Use LED grp 0"
42 depends on ETRAX_NBR_LED_GRP_ONE || ETRAX_NBR_LED_GRP_TWO
34 help 43 help
35 Selecting LED_on_when_link will light the LED when there is a 44 Use LED grp 0 for eth0
36 connection and will flash off when there is activity.
37 45
38 Selecting LED_on_when_activity will light the LED only when 46config ETRAX_ETH0_USE_LEDGRP1
39 there is activity. 47 bool "Use LED grp 1"
40 48 depends on ETRAX_NBR_LED_GRP_TWO
41 This setting will also affect the behaviour of other activity LEDs 49 help
42 e.g. Bluetooth. 50 Use LED grp 1 for eth0
43 51
44config ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY 52config ETRAX_ETH0_USE_LEDGRPNULL
45 bool "LED_on_when_activity" 53 bool "Use no LEDs for eth0"
46 help 54 help
47 Selecting LED_on_when_link will light the LED when there is a 55 Use no LEDs for eth0
48 connection and will flash off when there is activity. 56endchoice
49 57
50 Selecting LED_on_when_activity will light the LED only when 58choice
51 there is activity. 59 prompt "Eth1 led group"
60 depends on ETRAX_ETHERNET_IFACE1
61 default ETRAX_ETH1_USE_LEDGRP1
62
63config ETRAX_ETH1_USE_LEDGRP0
64 bool "Use LED grp 0"
65 depends on ETRAX_NBR_LED_GRP_ONE || ETRAX_NBR_LED_GRP_TWO
66 help
67 Use LED grp 0 for eth1
52 68
53 This setting will also affect the behaviour of other activity LEDs 69config ETRAX_ETH1_USE_LEDGRP1
54 e.g. Bluetooth. 70 bool "Use LED grp 1"
71 depends on ETRAX_NBR_LED_GRP_TWO
72 help
73 Use LED grp 1 for eth1
55 74
75config ETRAX_ETH1_USE_LEDGRPNULL
76 bool "Use no LEDs for eth1"
77 help
78 Use no LEDs for eth1
56endchoice 79endchoice
57 80
58config ETRAXFS_SERIAL 81config ETRAXFS_SERIAL
59 bool "Serial-port support" 82 bool "Serial-port support"
60 depends on ETRAX_ARCH_V32 83 depends on ETRAX_ARCH_V32
84 select SERIAL_CORE
85 select SERIAL_CORE_CONSOLE
61 help 86 help
62 Enables the ETRAX FS serial driver for ser0 (ttyS0) 87 Enables the ETRAX FS serial driver for ser0 (ttyS0)
63 You probably want this enabled. 88 You probably want this enabled.
64 89
90config ETRAX_RS485
91 bool "RS-485 support"
92 depends on ETRAXFS_SERIAL
93 help
94 Enables support for RS-485 serial communication.
95
96config ETRAX_RS485_DISABLE_RECEIVER
97 bool "Disable serial receiver"
98 depends on ETRAX_RS485
99 help
100 It is necessary to disable the serial receiver to avoid serial
101 loopback. Not all products are able to do this in software only.
102
65config ETRAX_SERIAL_PORT0 103config ETRAX_SERIAL_PORT0
66 bool "Serial port 0 enabled" 104 bool "Serial port 0 enabled"
67 depends on ETRAXFS_SERIAL 105 depends on ETRAXFS_SERIAL
@@ -72,50 +110,28 @@ config ETRAX_SERIAL_PORT0
72 ser0 can use dma4 or dma6 for output and dma5 or dma7 for input. 110 ser0 can use dma4 or dma6 for output and dma5 or dma7 for input.
73 111
74choice 112choice
75 prompt "Ser0 DMA in channel " 113 prompt "Ser0 default port type "
76 depends on ETRAX_SERIAL_PORT0 114 depends on ETRAX_SERIAL_PORT0
77 default ETRAX_SERIAL_PORT0_NO_DMA_IN 115 default ETRAX_SERIAL_PORT0_TYPE_232
78 help 116 help
79 What DMA channel to use for ser0. 117 Type of serial port.
80
81 118
82config ETRAX_SERIAL_PORT0_NO_DMA_IN 119config ETRAX_SERIAL_PORT0_TYPE_232
83 bool "Ser0 uses no DMA for input" 120 bool "Ser0 is a RS-232 port"
84 help 121 help
85 Do not use DMA for ser0 input. 122 Configure serial port 0 to be a RS-232 port.
86 123
87config ETRAX_SERIAL_PORT0_DMA7_IN 124config ETRAX_SERIAL_PORT0_TYPE_485HD
88 bool "Ser0 uses DMA7 for input" 125 bool "Ser0 is a half duplex RS-485 port"
89 depends on ETRAX_SERIAL_PORT0 126 depends on ETRAX_RS485
90 help
91 Enables the DMA7 input channel for ser0 (ttyS0).
92 If you do not enable DMA, an interrupt for each character will be
93 used when receiving data.
94 Normally you want to use DMA, unless you use the DMA channel for
95 something else.
96
97endchoice
98
99choice
100 prompt "Ser0 DMA out channel"
101 depends on ETRAX_SERIAL_PORT0
102 default ETRAX_SERIAL_PORT0_NO_DMA_OUT
103
104config ETRAX_SERIAL_PORT0_NO_DMA_OUT
105 bool "Ser0 uses no DMA for output"
106 help 127 help
107 Do not use DMA for ser0 output. 128 Configure serial port 0 to be a half duplex (two wires) RS-485 port.
108 129
109config ETRAX_SERIAL_PORT0_DMA6_OUT 130config ETRAX_SERIAL_PORT0_TYPE_485FD
110 bool "Ser0 uses DMA6 for output" 131 bool "Ser0 is a full duplex RS-485 port"
111 depends on ETRAX_SERIAL_PORT0 132 depends on ETRAX_RS485
112 help 133 help
113 Enables the DMA6 output channel for ser0 (ttyS0). 134 Configure serial port 0 to be a full duplex (four wires) RS-485 port.
114 If you do not enable DMA, an interrupt for each character will be
115 used when transmitting data.
116 Normally you want to use DMA, unless you use the DMA channel for
117 something else.
118
119endchoice 135endchoice
120 136
121config ETRAX_SER0_DTR_BIT 137config ETRAX_SER0_DTR_BIT
@@ -141,52 +157,28 @@ config ETRAX_SERIAL_PORT1
141 Enables the ETRAX FS serial driver for ser1 (ttyS1). 157 Enables the ETRAX FS serial driver for ser1 (ttyS1).
142 158
143choice 159choice
144 prompt "Ser1 DMA in channel " 160 prompt "Ser1 default port type"
145 depends on ETRAX_SERIAL_PORT1 161 depends on ETRAX_SERIAL_PORT1
146 default ETRAX_SERIAL_PORT1_NO_DMA_IN 162 default ETRAX_SERIAL_PORT1_TYPE_232
147 help
148 What DMA channel to use for ser1.
149
150
151config ETRAX_SERIAL_PORT1_NO_DMA_IN
152 bool "Ser1 uses no DMA for input"
153 help 163 help
154 Do not use DMA for ser1 input. 164 Type of serial port.
155 165
156config ETRAX_SERIAL_PORT1_DMA5_IN 166config ETRAX_SERIAL_PORT1_TYPE_232
157 bool "Ser1 uses DMA5 for input" 167 bool "Ser1 is a RS-232 port"
158 depends on ETRAX_SERIAL_PORT1
159 help 168 help
160 Enables the DMA5 input channel for ser1 (ttyS1). 169 Configure serial port 1 to be a RS-232 port.
161 If you do not enable DMA, an interrupt for each character will be
162 used when receiving data.
163 Normally you want this on, unless you use the DMA channel for
164 something else.
165
166endchoice
167 170
168choice 171config ETRAX_SERIAL_PORT1_TYPE_485HD
169 prompt "Ser1 DMA out channel " 172 bool "Ser1 is a half duplex RS-485 port"
170 depends on ETRAX_SERIAL_PORT1 173 depends on ETRAX_RS485
171 default ETRAX_SERIAL_PORT1_NO_DMA_OUT
172 help
173 What DMA channel to use for ser1.
174
175config ETRAX_SERIAL_PORT1_NO_DMA_OUT
176 bool "Ser1 uses no DMA for output"
177 help 174 help
178 Do not use DMA for ser1 output. 175 Configure serial port 1 to be a half duplex (two wires) RS-485 port.
179 176
180config ETRAX_SERIAL_PORT1_DMA4_OUT 177config ETRAX_SERIAL_PORT1_TYPE_485FD
181 bool "Ser1 uses DMA4 for output" 178 bool "Ser1 is a full duplex RS-485 port"
182 depends on ETRAX_SERIAL_PORT1 179 depends on ETRAX_RS485
183 help 180 help
184 Enables the DMA4 output channel for ser1 (ttyS1). 181 Configure serial port 1 to be a full duplex (four wires) RS-485 port.
185 If you do not enable DMA, an interrupt for each character will be
186 used when transmitting data.
187 Normally you want this on, unless you use the DMA channel for
188 something else.
189
190endchoice 182endchoice
191 183
192config ETRAX_SER1_DTR_BIT 184config ETRAX_SER1_DTR_BIT
@@ -212,52 +204,31 @@ config ETRAX_SERIAL_PORT2
212 Enables the ETRAX FS serial driver for ser2 (ttyS2). 204 Enables the ETRAX FS serial driver for ser2 (ttyS2).
213 205
214choice 206choice
215 prompt "Ser2 DMA in channel " 207 prompt "Ser2 default port type"
216 depends on ETRAX_SERIAL_PORT2 208 depends on ETRAX_SERIAL_PORT2
217 default ETRAX_SERIAL_PORT2_NO_DMA_IN 209 default ETRAX_SERIAL_PORT2_TYPE_232
218 help 210 help
219 What DMA channel to use for ser2. 211 What DMA channel to use for ser2
220 212
221 213config ETRAX_SERIAL_PORT2_TYPE_232
222config ETRAX_SERIAL_PORT2_NO_DMA_IN 214 bool "Ser2 is a RS-232 port"
223 bool "Ser2 uses no DMA for input"
224 help 215 help
225 Do not use DMA for ser2 input. 216 Configure serial port 2 to be a RS-232 port.
226 217
227config ETRAX_SERIAL_PORT2_DMA3_IN 218config ETRAX_SERIAL_PORT2_TYPE_485HD
228 bool "Ser2 uses DMA3 for input" 219 bool "Ser2 is a half duplex RS-485 port"
229 depends on ETRAX_SERIAL_PORT2 220 depends on ETRAX_RS485
230 help
231 Enables the DMA3 input channel for ser2 (ttyS2).
232 If you do not enable DMA, an interrupt for each character will be
233 used when receiving data.
234 Normally you want to use DMA, unless you use the DMA channel for
235 something else.
236
237endchoice
238
239choice
240 prompt "Ser2 DMA out channel"
241 depends on ETRAX_SERIAL_PORT2
242 default ETRAX_SERIAL_PORT2_NO_DMA_OUT
243
244config ETRAX_SERIAL_PORT2_NO_DMA_OUT
245 bool "Ser2 uses no DMA for output"
246 help 221 help
247 Do not use DMA for ser2 output. 222 Configure serial port 2 to be a half duplex (two wires) RS-485 port.
248 223
249config ETRAX_SERIAL_PORT2_DMA2_OUT 224config ETRAX_SERIAL_PORT2_TYPE_485FD
250 bool "Ser2 uses DMA2 for output" 225 bool "Ser2 is a full duplex RS-485 port"
251 depends on ETRAX_SERIAL_PORT2 226 depends on ETRAX_RS485
252 help 227 help
253 Enables the DMA2 output channel for ser2 (ttyS2). 228 Configure serial port 2 to be a full duplex (four wires) RS-485 port.
254 If you do not enable DMA, an interrupt for each character will be
255 used when transmitting data.
256 Normally you want to use DMA, unless you use the DMA channel for
257 something else.
258
259endchoice 229endchoice
260 230
231
261config ETRAX_SER2_DTR_BIT 232config ETRAX_SER2_DTR_BIT
262 string "Ser 2 DTR bit (empty = not used)" 233 string "Ser 2 DTR bit (empty = not used)"
263 depends on ETRAX_SERIAL_PORT2 234 depends on ETRAX_SERIAL_PORT2
@@ -281,71 +252,121 @@ config ETRAX_SERIAL_PORT3
281 Enables the ETRAX FS serial driver for ser3 (ttyS3). 252 Enables the ETRAX FS serial driver for ser3 (ttyS3).
282 253
283choice 254choice
284 prompt "Ser3 DMA in channel " 255 prompt "Ser3 default port type"
285 depends on ETRAX_SERIAL_PORT3 256 depends on ETRAX_SERIAL_PORT3
286 default ETRAX_SERIAL_PORT3_NO_DMA_IN 257 default ETRAX_SERIAL_PORT3_TYPE_232
287 help 258 help
288 What DMA channel to use for ser3. 259 What DMA channel to use for ser3.
289 260
261config ETRAX_SERIAL_PORT3_TYPE_232
262 bool "Ser3 is a RS-232 port"
263 help
264 Configure serial port 3 to be a RS-232 port.
290 265
291config ETRAX_SERIAL_PORT3_NO_DMA_IN 266config ETRAX_SERIAL_PORT3_TYPE_485HD
292 bool "Ser3 uses no DMA for input" 267 bool "Ser3 is a half duplex RS-485 port"
268 depends on ETRAX_RS485
293 help 269 help
294 Do not use DMA for ser3 input. 270 Configure serial port 3 to be a half duplex (two wires) RS-485 port.
295 271
296config ETRAX_SERIAL_PORT3_DMA9_IN 272config ETRAX_SERIAL_PORT3_TYPE_485FD
297 bool "Ser3 uses DMA9 for input" 273 bool "Ser3 is a full duplex RS-485 port"
274 depends on ETRAX_RS485
275 help
276 Configure serial port 3 to be a full duplex (four wires) RS-485 port.
277endchoice
278
279config ETRAX_SER3_DTR_BIT
280 string "Ser 3 DTR bit (empty = not used)"
281 depends on ETRAX_SERIAL_PORT3
282
283config ETRAX_SER3_RI_BIT
284 string "Ser 3 RI bit (empty = not used)"
285 depends on ETRAX_SERIAL_PORT3
286
287config ETRAX_SER3_DSR_BIT
288 string "Ser 3 DSR bit (empty = not used)"
289 depends on ETRAX_SERIAL_PORT3
290
291config ETRAX_SER3_CD_BIT
292 string "Ser 3 CD bit (empty = not used)"
298 depends on ETRAX_SERIAL_PORT3 293 depends on ETRAX_SERIAL_PORT3
294
295config ETRAX_SERIAL_PORT4
296 bool "Serial port 4 enabled"
297 depends on ETRAXFS_SERIAL && CRIS_MACH_ARTPEC3
299 help 298 help
300 Enables the DMA9 input channel for ser3 (ttyS3). 299 Enables the ETRAX FS serial driver for ser4 (ttyS4).
301 If you do not enable DMA, an interrupt for each character will be 300
302 used when receiving data. 301choice
303 Normally you want to use DMA, unless you use the DMA channel for 302 prompt "Ser4 default port type"
304 something else. 303 depends on ETRAX_SERIAL_PORT4
304 default ETRAX_SERIAL_PORT4_TYPE_232
305 help
306 What DMA channel to use for ser4.
305 307
308config ETRAX_SERIAL_PORT4_TYPE_232
309 bool "Ser4 is a RS-232 port"
310 help
311 Configure serial port 4 to be a RS-232 port.
312
313config ETRAX_SERIAL_PORT4_TYPE_485HD
314 bool "Ser4 is a half duplex RS-485 port"
315 depends on ETRAX_RS485
316 help
317 Configure serial port 4 to be a half duplex (two wires) RS-485 port.
318
319config ETRAX_SERIAL_PORT4_TYPE_485FD
320 bool "Ser4 is a full duplex RS-485 port"
321 depends on ETRAX_RS485
322 help
323 Configure serial port 4 to be a full duplex (four wires) RS-485 port.
306endchoice 324endchoice
307 325
308choice 326choice
309 prompt "Ser3 DMA out channel" 327 prompt "Ser4 DMA in channel "
310 depends on ETRAX_SERIAL_PORT3 328 depends on ETRAX_SERIAL_PORT4
311 default ETRAX_SERIAL_PORT3_NO_DMA_OUT 329 default ETRAX_SERIAL_PORT4_NO_DMA_IN
330 help
331 What DMA channel to use for ser4.
332
312 333
313config ETRAX_SERIAL_PORT3_NO_DMA_OUT 334config ETRAX_SERIAL_PORT4_NO_DMA_IN
314 bool "Ser3 uses no DMA for output" 335 bool "Ser4 uses no DMA for input"
315 help 336 help
316 Do not use DMA for ser3 output. 337 Do not use DMA for ser4 input.
317 338
318config ETRAX_SERIAL_PORT3_DMA8_OUT 339config ETRAX_SERIAL_PORT4_DMA9_IN
319 bool "Ser3 uses DMA8 for output" 340 bool "Ser4 uses DMA9 for input"
320 depends on ETRAX_SERIAL_PORT3 341 depends on ETRAX_SERIAL_PORT4
321 help 342 help
322 Enables the DMA8 output channel for ser3 (ttyS3). 343 Enables the DMA9 input channel for ser4 (ttyS4).
323 If you do not enable DMA, an interrupt for each character will be 344 If you do not enable DMA, an interrupt for each character will be
324 used when transmitting data. 345 used when receiveing data.
325 Normally you want to use DMA, unless you use the DMA channel for 346 Normally you want to use DMA, unless you use the DMA channel for
326 something else. 347 something else.
327 348
328endchoice 349endchoice
329 350
330config ETRAX_SER3_DTR_BIT 351config ETRAX_SER4_DTR_BIT
331 string "Ser 3 DTR bit (empty = not used)" 352 string "Ser 4 DTR bit (empty = not used)"
332 depends on ETRAX_SERIAL_PORT3 353 depends on ETRAX_SERIAL_PORT4
333 354
334config ETRAX_SER3_RI_BIT 355config ETRAX_SER4_RI_BIT
335 string "Ser 3 RI bit (empty = not used)" 356 string "Ser 4 RI bit (empty = not used)"
336 depends on ETRAX_SERIAL_PORT3 357 depends on ETRAX_SERIAL_PORT4
337 358
338config ETRAX_SER3_DSR_BIT 359config ETRAX_SER4_DSR_BIT
339 string "Ser 3 DSR bit (empty = not used)" 360 string "Ser 4 DSR bit (empty = not used)"
340 depends on ETRAX_SERIAL_PORT3 361 depends on ETRAX_SERIAL_PORT4
341 362
342config ETRAX_SER3_CD_BIT 363config ETRAX_SER3_CD_BIT
343 string "Ser 3 CD bit (empty = not used)" 364 string "Ser 4 CD bit (empty = not used)"
344 depends on ETRAX_SERIAL_PORT3 365 depends on ETRAX_SERIAL_PORT4
345 366
346config ETRAX_RS485 367config ETRAX_RS485
347 bool "RS-485 support" 368 bool "RS-485 support"
348 depends on ETRAX_SERIAL 369 depends on ETRAXFS_SERIAL
349 help 370 help
350 Enables support for RS-485 serial communication. For a primer on 371 Enables support for RS-485 serial communication. For a primer on
351 RS-485, see <http://www.hw.cz/english/docs/rs485/rs485.html>. 372 RS-485, see <http://www.hw.cz/english/docs/rs485/rs485.html>.
@@ -356,22 +377,6 @@ config ETRAX_RS485_DISABLE_RECEIVER
356 help 377 help
357 It is necessary to disable the serial receiver to avoid serial 378 It is necessary to disable the serial receiver to avoid serial
358 loopback. Not all products are able to do this in software only. 379 loopback. Not all products are able to do this in software only.
359 Axis 2400/2401 must disable receiver.
360
361config ETRAX_AXISFLASHMAP
362 bool "Axis flash-map support"
363 depends on ETRAX_ARCH_V32
364 select MTD
365 select MTD_CFI
366 select MTD_CFI_AMDSTD
367 select MTD_CHAR
368 select MTD_BLOCK
369 select MTD_PARTITIONS
370 select MTD_CONCAT
371 select MTD_COMPLEX_MAPPINGS
372 help
373 This option enables MTD mapping of flash devices. Needed to use
374 flash memories. If unsure, say Y.
375 380
376config ETRAX_SYNCHRONOUS_SERIAL 381config ETRAX_SYNCHRONOUS_SERIAL
377 bool "Synchronous serial-port support" 382 bool "Synchronous serial-port support"
@@ -394,7 +399,7 @@ config ETRAX_SYNCHRONOUS_SERIAL0_DMA
394 399
395config ETRAX_SYNCHRONOUS_SERIAL_PORT1 400config ETRAX_SYNCHRONOUS_SERIAL_PORT1
396 bool "Synchronous serial port 1 enabled" 401 bool "Synchronous serial port 1 enabled"
397 depends on ETRAX_SYNCHRONOUS_SERIAL 402 depends on ETRAX_SYNCHRONOUS_SERIAL && ETRAXFS
398 help 403 help
399 Enabled synchronous serial port 1. 404 Enabled synchronous serial port 1.
400 405
@@ -405,6 +410,31 @@ config ETRAX_SYNCHRONOUS_SERIAL1_DMA
405 A synchronous serial port can run in manual or DMA mode. 410 A synchronous serial port can run in manual or DMA mode.
406 Selecting this option will make it run in DMA mode. 411 Selecting this option will make it run in DMA mode.
407 412
413config ETRAX_AXISFLASHMAP
414 bool "Axis flash-map support"
415 depends on ETRAX_ARCH_V32
416 select MTD
417 select MTD_CFI
418 select MTD_CFI_AMDSTD
419 select MTD_JEDECPROBE
420 select MTD_CHAR
421 select MTD_BLOCK
422 select MTD_PARTITIONS
423 select MTD_CONCAT
424 select MTD_COMPLEX_MAPPINGS
425 help
426 This option enables MTD mapping of flash devices. Needed to use
427 flash memories. If unsure, say Y.
428
429config ETRAX_AXISFLASHMAP_MTD0WHOLE
430 bool "MTD0 is whole boot flash device"
431 depends on ETRAX_AXISFLASHMAP
432 default N
433 help
434 When this option is not set, mtd0 refers to the first partition
435 on the boot flash device. When set, mtd0 refers to the whole
436 device, with mtd1 referring to the first partition etc.
437
408config ETRAX_PTABLE_SECTOR 438config ETRAX_PTABLE_SECTOR
409 int "Byte-offset of partition table sector" 439 int "Byte-offset of partition table sector"
410 depends on ETRAX_AXISFLASHMAP 440 depends on ETRAX_AXISFLASHMAP
@@ -425,42 +455,32 @@ config ETRAX_NANDFLASH
425 This option enables MTD mapping of NAND flash devices. Needed to use 455 This option enables MTD mapping of NAND flash devices. Needed to use
426 NAND flash memories. If unsure, say Y. 456 NAND flash memories. If unsure, say Y.
427 457
458config ETRAX_NANDBOOT
459 bool "Boot from NAND flash"
460 depends on ETRAX_NANDFLASH
461 help
462 This options enables booting from NAND flash devices.
463 Say Y if your boot code, kernel and root file system is in
464 NAND flash. Say N if they are in NOR flash.
465
428config ETRAX_I2C 466config ETRAX_I2C
429 bool "I2C driver" 467 bool "I2C driver"
430 depends on ETRAX_ARCH_V32 468 depends on ETRAX_ARCH_V32
431 help 469 help
432 This option enabled the I2C driver used by e.g. the RTC driver. 470 This option enables the I2C driver used by e.g. the RTC driver.
433 471
434config ETRAX_I2C_DATA_PORT 472config ETRAX_V32_I2C_DATA_PORT
435 string "I2C data pin" 473 string "I2C data pin"
436 depends on ETRAX_I2C 474 depends on ETRAX_I2C
437 help 475 help
438 The pin to use for I2C data. 476 The pin to use for I2C data.
439 477
440config ETRAX_I2C_CLK_PORT 478config ETRAX_V32_I2C_CLK_PORT
441 string "I2C clock pin" 479 string "I2C clock pin"
442 depends on ETRAX_I2C 480 depends on ETRAX_I2C
443 help 481 help
444 The pin to use for I2C clock. 482 The pin to use for I2C clock.
445 483
446config ETRAX_RTC
447 bool "Real Time Clock support"
448 depends on ETRAX_ARCH_V32
449 help
450 Enabled RTC support.
451
452choice
453 prompt "RTC chip"
454 depends on ETRAX_RTC
455 default ETRAX_PCF8563
456
457config ETRAX_PCF8563
458 bool "PCF8563"
459 help
460 Philips PCF8563 RTC
461
462endchoice
463
464config ETRAX_GPIO 484config ETRAX_GPIO
465 bool "GPIO support" 485 bool "GPIO support"
466 depends on ETRAX_ARCH_V32 486 depends on ETRAX_ARCH_V32
@@ -476,33 +496,36 @@ config ETRAX_GPIO
476 Remember that you need to setup the port directions appropriately in 496 Remember that you need to setup the port directions appropriately in
477 the General configuration. 497 the General configuration.
478 498
479config ETRAX_PA_BUTTON_BITMASK 499config ETRAX_VIRTUAL_GPIO
480 hex "PA-buttons bitmask" 500 bool "Virtual GPIO support"
481 depends on ETRAX_GPIO 501 depends on ETRAX_GPIO
482 default "0x02"
483 help 502 help
484 This is a bitmask (8 bits) with information about what bits on PA 503 Enables the virtual Etrax general port device (major 120, minor 6).
485 that are used for buttons. 504 It uses an I/O expander for the I2C-bus.
486 Most products has a so called TEST button on PA1, if that is true 505
487 use 0x02 here. 506config ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN
488 Use 00 if there are no buttons on PA. 507 int "Virtual GPIO interrupt pin on PA pin"
489 If the bitmask is <> 00 a button driver will be included in the gpio 508 range 0 7
490 driver. ETRAX general I/O support must be enabled. 509 depends on ETRAX_VIRTUAL_GPIO
510 help
511 The pin to use on PA for virtual gpio interrupt.
491 512
492config ETRAX_PA_CHANGEABLE_DIR 513config ETRAX_PA_CHANGEABLE_DIR
493 hex "PA user changeable dir mask" 514 hex "PA user changeable dir mask"
494 depends on ETRAX_GPIO 515 depends on ETRAX_GPIO
495 default "0x00" 516 default "0x00" if ETRAXFS
517 default "0x00000000" if !ETRAXFS
496 help 518 help
497 This is a bitmask (8 bits) with information of what bits in PA that a 519 This is a bitmask (8 bits) with information of what bits in PA that a
498 user can change direction on using ioctl's. 520 user can change direction on using ioctl's.
499 Bit set = changeable. 521 Bit set = changeable.
500 You probably want 0x00 here, but it depends on your hardware. 522 You probably want 0 here, but it depends on your hardware.
501 523
502config ETRAX_PA_CHANGEABLE_BITS 524config ETRAX_PA_CHANGEABLE_BITS
503 hex "PA user changeable bits mask" 525 hex "PA user changeable bits mask"
504 depends on ETRAX_GPIO 526 depends on ETRAX_GPIO
505 default "0x00" 527 default "0x00" if ETRAXFS
528 default "0x00000000" if !ETRAXFS
506 help 529 help
507 This is a bitmask (8 bits) with information of what bits in PA 530 This is a bitmask (8 bits) with information of what bits in PA
508 that a user can change the value on using ioctl's. 531 that a user can change the value on using ioctl's.
@@ -511,17 +534,19 @@ config ETRAX_PA_CHANGEABLE_BITS
511config ETRAX_PB_CHANGEABLE_DIR 534config ETRAX_PB_CHANGEABLE_DIR
512 hex "PB user changeable dir mask" 535 hex "PB user changeable dir mask"
513 depends on ETRAX_GPIO 536 depends on ETRAX_GPIO
514 default "0x00000" 537 default "0x00000" if ETRAXFS
538 default "0x00000000" if !ETRAXFS
515 help 539 help
516 This is a bitmask (18 bits) with information of what bits in PB 540 This is a bitmask (18 bits) with information of what bits in PB
517 that a user can change direction on using ioctl's. 541 that a user can change direction on using ioctl's.
518 Bit set = changeable. 542 Bit set = changeable.
519 You probably want 0x00000 here, but it depends on your hardware. 543 You probably want 0 here, but it depends on your hardware.
520 544
521config ETRAX_PB_CHANGEABLE_BITS 545config ETRAX_PB_CHANGEABLE_BITS
522 hex "PB user changeable bits mask" 546 hex "PB user changeable bits mask"
523 depends on ETRAX_GPIO 547 depends on ETRAX_GPIO
524 default "0x00000" 548 default "0x00000" if ETRAXFS
549 default "0x00000000" if !ETRAXFS
525 help 550 help
526 This is a bitmask (18 bits) with information of what bits in PB 551 This is a bitmask (18 bits) with information of what bits in PB
527 that a user can change the value on using ioctl's. 552 that a user can change the value on using ioctl's.
@@ -530,17 +555,19 @@ config ETRAX_PB_CHANGEABLE_BITS
530config ETRAX_PC_CHANGEABLE_DIR 555config ETRAX_PC_CHANGEABLE_DIR
531 hex "PC user changeable dir mask" 556 hex "PC user changeable dir mask"
532 depends on ETRAX_GPIO 557 depends on ETRAX_GPIO
533 default "0x00000" 558 default "0x00000" if ETRAXFS
559 default "0x00000000" if !ETRAXFS
534 help 560 help
535 This is a bitmask (18 bits) with information of what bits in PC 561 This is a bitmask (18 bits) with information of what bits in PC
536 that a user can change direction on using ioctl's. 562 that a user can change direction on using ioctl's.
537 Bit set = changeable. 563 Bit set = changeable.
538 You probably want 0x00000 here, but it depends on your hardware. 564 You probably want 0 here, but it depends on your hardware.
539 565
540config ETRAX_PC_CHANGEABLE_BITS 566config ETRAX_PC_CHANGEABLE_BITS
541 hex "PC user changeable bits mask" 567 hex "PC user changeable bits mask"
542 depends on ETRAX_GPIO 568 depends on ETRAX_GPIO
543 default "0x00000" 569 default "0x00000" if ETRAXFS
570 default "0x00000000" if ETRAXFS
544 help 571 help
545 This is a bitmask (18 bits) with information of what bits in PC 572 This is a bitmask (18 bits) with information of what bits in PC
546 that a user can change the value on using ioctl's. 573 that a user can change the value on using ioctl's.
@@ -548,7 +575,7 @@ config ETRAX_PC_CHANGEABLE_BITS
548 575
549config ETRAX_PD_CHANGEABLE_DIR 576config ETRAX_PD_CHANGEABLE_DIR
550 hex "PD user changeable dir mask" 577 hex "PD user changeable dir mask"
551 depends on ETRAX_GPIO 578 depends on ETRAX_GPIO && ETRAXFS
552 default "0x00000" 579 default "0x00000"
553 help 580 help
554 This is a bitmask (18 bits) with information of what bits in PD 581 This is a bitmask (18 bits) with information of what bits in PD
@@ -558,7 +585,7 @@ config ETRAX_PD_CHANGEABLE_DIR
558 585
559config ETRAX_PD_CHANGEABLE_BITS 586config ETRAX_PD_CHANGEABLE_BITS
560 hex "PD user changeable bits mask" 587 hex "PD user changeable bits mask"
561 depends on ETRAX_GPIO 588 depends on ETRAX_GPIO && ETRAXFS
562 default "0x00000" 589 default "0x00000"
563 help 590 help
564 This is a bitmask (18 bits) with information of what bits in PD 591 This is a bitmask (18 bits) with information of what bits in PD
@@ -567,7 +594,7 @@ config ETRAX_PD_CHANGEABLE_BITS
567 594
568config ETRAX_PE_CHANGEABLE_DIR 595config ETRAX_PE_CHANGEABLE_DIR
569 hex "PE user changeable dir mask" 596 hex "PE user changeable dir mask"
570 depends on ETRAX_GPIO 597 depends on ETRAX_GPIO && ETRAXFS
571 default "0x00000" 598 default "0x00000"
572 help 599 help
573 This is a bitmask (18 bits) with information of what bits in PE 600 This is a bitmask (18 bits) with information of what bits in PE
@@ -577,20 +604,36 @@ config ETRAX_PE_CHANGEABLE_DIR
577 604
578config ETRAX_PE_CHANGEABLE_BITS 605config ETRAX_PE_CHANGEABLE_BITS
579 hex "PE user changeable bits mask" 606 hex "PE user changeable bits mask"
580 depends on ETRAX_GPIO 607 depends on ETRAX_GPIO && ETRAXFS
581 default "0x00000" 608 default "0x00000"
582 help 609 help
583 This is a bitmask (18 bits) with information of what bits in PE 610 This is a bitmask (18 bits) with information of what bits in PE
584 that a user can change the value on using ioctl's. 611 that a user can change the value on using ioctl's.
585 Bit set = changeable. 612 Bit set = changeable.
586 613
614config ETRAX_PV_CHANGEABLE_DIR
615 hex "PV user changeable dir mask"
616 depends on ETRAX_VIRTUAL_GPIO
617 default "0x0000"
618 help
619 This is a bitmask (16 bits) with information of what bits in PV
620 that a user can change direction on using ioctl's.
621 Bit set = changeable.
622 You probably want 0x0000 here, but it depends on your hardware.
623
624config ETRAX_PV_CHANGEABLE_BITS
625 hex "PV user changeable bits mask"
626 depends on ETRAX_VIRTUAL_GPIO
627 default "0x0000"
628 help
629 This is a bitmask (16 bits) with information of what bits in PV
630 that a user can change the value on using ioctl's.
631 Bit set = changeable.
632
587config ETRAX_CARDBUS 633config ETRAX_CARDBUS
588 bool "Cardbus support" 634 bool "Cardbus support"
589 depends on ETRAX_ARCH_V32 635 depends on ETRAX_ARCH_V32
590 select PCCARD
591 select CARDBUS
592 select HOTPLUG 636 select HOTPLUG
593 select PCCARD_NONSTATIC
594 help 637 help
595 Enabled the ETRAX Cardbus driver. 638 Enabled the ETRAX Cardbus driver.
596 639
@@ -613,4 +656,202 @@ config ETRAX_STREAMCOPROC
613 This option enables a driver for the stream co-processor 656 This option enables a driver for the stream co-processor
614 for cryptographic operations. 657 for cryptographic operations.
615 658
659source drivers/mmc/Kconfig
660
661config ETRAX_MMC_IOP
662 tristate "MMC/SD host driver using IO-processor"
663 depends on ETRAX_ARCH_V32 && MMC
664 help
665 This option enables the SD/MMC host controller interface.
666 The host controller is implemented using the built in
667 IO-Processor. Only the SPU is used in this implementation.
668
669config ETRAX_SPI_MMC
670# Make this one of several "choices" (possible simultaneously but
671# suggested uniquely) when an IOP driver emerges for "real" MMC/SD
672# protocol support.
673 tristate
674 depends on !ETRAX_MMC_IOP
675 default MMC
676 select SPI
677 select MMC_SPI
678 select ETRAX_SPI_MMC_BOARD
679
680# For the parts that can't be a module (due to restrictions in
681# framework elsewhere).
682config ETRAX_SPI_MMC_BOARD
683 boolean
684 default n
685
686# While the board info is MMC_SPI only, the drivers are written to be
687# independent of MMC_SPI, so we'll keep SPI non-dependent on the
688# MMC_SPI config choices (well, except for a single depends-on-line
689# for the board-info file until a separate non-MMC SPI board file
690# emerges).
691# FIXME: When that happens, we'll need to be able to ask for and
692# configure non-MMC SPI ports together with MMC_SPI ports (if multiple
693# SPI ports are enabled).
694
695config SPI_ETRAX_SSER
696 tristate
697 depends on SPI_MASTER && ETRAX_ARCH_V32 && EXPERIMENTAL
698 select SPI_BITBANG
699 help
700 This enables using an synchronous serial (sser) port as a
701 SPI master controller on Axis ETRAX FS and later. The
702 driver can be configured to use any sser port.
703
704config SPI_ETRAX_GPIO
705 tristate
706 depends on SPI_MASTER && ETRAX_ARCH_V32 && EXPERIMENTAL
707 select SPI_BITBANG
708 help
709 This enables using GPIO pins port as a SPI master controller
710 on Axis ETRAX FS and later. The driver can be configured to
711 use any GPIO pins.
712
713config ETRAX_SPI_SSER0
714 tristate "SPI using synchronous serial port 0 (sser0)"
715 depends on ETRAX_SPI_MMC
716 default m if MMC_SPI=m
717 default y if MMC_SPI=y
718 default y if MMC_SPI=n
719 select SPI_ETRAX_SSER
720 help
721 Say Y for an MMC/SD socket connected to synchronous serial port 0,
722 or for devices using the SPI protocol on that port. Say m if you
723 want to build it as a module, which will be named spi_crisv32_sser.
724 (You need to select MMC separately.)
725
726config ETRAX_SPI_SSER0_DMA
727 bool "DMA for SPI on sser0 enabled"
728 depends on ETRAX_SPI_SSER0
729 depends on !ETRAX_SERIAL_PORT1_DMA4_OUT && !ETRAX_SERIAL_PORT1_DMA5_IN
730 default y
731 help
732 Say Y if using DMA (dma4/dma5) for SPI on synchronous serial port 0.
733
734config ETRAX_SPI_MMC_CD_SSER0_PIN
735 string "MMC/SD card detect pin for SPI on sser0"
736 depends on ETRAX_SPI_SSER0 && MMC_SPI
737 default "pd11"
738 help
739 The pin to use for SD/MMC card detect. This pin should be pulled up
740 and grounded when a card is present. If defined as " " (space), no
741 pin is selected. A card must then always be inserted for proper
742 action.
743
744config ETRAX_SPI_MMC_WP_SSER0_PIN
745 string "MMC/SD card write-protect pin for SPI on sser0"
746 depends on ETRAX_SPI_SSER0 && MMC_SPI
747 default "pd10"
748 help
749 The pin to use for the SD/MMC write-protect signal for a memory
750 card. If defined as " " (space), the card is considered writable.
751
752config ETRAX_SPI_SSER1
753 tristate "SPI using synchronous serial port 1 (sser1)"
754 depends on ETRAX_SPI_MMC
755 default m if MMC_SPI=m && ETRAX_SPI_SSER0=n
756 default y if MMC_SPI=y && ETRAX_SPI_SSER0=n
757 default y if MMC_SPI=n && ETRAX_SPI_SSER0=n
758 select SPI_ETRAX_SSER
759 help
760 Say Y for an MMC/SD socket connected to synchronous serial port 1,
761 or for devices using the SPI protocol on that port. Say m if you
762 want to build it as a module, which will be named spi_crisv32_sser.
763 (You need to select MMC separately.)
764
765config ETRAX_SPI_SSER1_DMA
766 bool "DMA for SPI on sser1 enabled"
767 depends on ETRAX_SPI_SSER1 && !ETRAX_ETHERNET_IFACE1
768 depends on !ETRAX_SERIAL_PORT0_DMA6_OUT && !ETRAX_SERIAL_PORT0_DMA7_IN
769 default y
770 help
771 Say Y if using DMA (dma6/dma7) for SPI on synchronous serial port 1.
772
773config ETRAX_SPI_MMC_CD_SSER1_PIN
774 string "MMC/SD card detect pin for SPI on sser1"
775 depends on ETRAX_SPI_SSER1 && MMC_SPI
776 default "pd12"
777 help
778 The pin to use for SD/MMC card detect. This pin should be pulled up
779 and grounded when a card is present. If defined as " " (space), no
780 pin is selected. A card must then always be inserted for proper
781 action.
782
783config ETRAX_SPI_MMC_WP_SSER1_PIN
784 string "MMC/SD card write-protect pin for SPI on sser1"
785 depends on ETRAX_SPI_SSER1 && MMC_SPI
786 default "pd9"
787 help
788 The pin to use for the SD/MMC write-protect signal for a memory
789 card. If defined as " " (space), the card is considered writable.
790
791config ETRAX_SPI_GPIO
792 tristate "Bitbanged SPI using gpio pins"
793 depends on ETRAX_SPI_MMC
794 select SPI_ETRAX_GPIO
795 default m if MMC_SPI=m && ETRAX_SPI_SSER0=n && ETRAX_SPI_SSER1=n
796 default y if MMC_SPI=y && ETRAX_SPI_SSER0=n && ETRAX_SPI_SSER1=n
797 default y if MMC_SPI=n && ETRAX_SPI_SSER0=n && ETRAX_SPI_SSER1=n
798 help
799 Say Y for an MMC/SD socket connected to general I/O pins (but not
800 a complete synchronous serial ports), or for devices using the SPI
801 protocol on general I/O pins. Slow and slows down the system.
802 Say m to build it as a module, which will be called spi_crisv32_gpio.
803 (You need to select MMC separately.)
804
805# The default match that of sser0, only because that's how it was tested.
806config ETRAX_SPI_CS_PIN
807 string "SPI chip select pin"
808 depends on ETRAX_SPI_GPIO
809 default "pc3"
810 help
811 The pin to use for SPI chip select.
812
813config ETRAX_SPI_CLK_PIN
814 string "SPI clock pin"
815 depends on ETRAX_SPI_GPIO
816 default "pc1"
817 help
818 The pin to use for the SPI clock.
819
820config ETRAX_SPI_DATAIN_PIN
821 string "SPI MISO (data in) pin"
822 depends on ETRAX_SPI_GPIO
823 default "pc16"
824 help
825 The pin to use for SPI data in from the device.
826
827config ETRAX_SPI_DATAOUT_PIN
828 string "SPI MOSI (data out) pin"
829 depends on ETRAX_SPI_GPIO
830 default "pc0"
831 help
832 The pin to use for SPI data out to the device.
833
834config ETRAX_SPI_MMC_CD_GPIO_PIN
835 string "MMC/SD card detect pin for SPI using gpio (space for none)"
836 depends on ETRAX_SPI_GPIO && MMC_SPI
837 default "pd11"
838 help
839 The pin to use for SD/MMC card detect. This pin should be pulled up
840 and grounded when a card is present. If defined as " " (space), no
841 pin is selected. A card must then always be inserted for proper
842 action.
843
844config ETRAX_SPI_MMC_WP_GPIO_PIN
845 string "MMC/SD card write-protect pin for SPI using gpio (space for none)"
846 depends on ETRAX_SPI_GPIO && MMC_SPI
847 default "pd10"
848 help
849 The pin to use for the SD/MMC write-protect signal for a memory
850 card. If defined as " " (space), the card is considered writable.
851
852# Avoid choices causing non-working configs by conditionalizing the inclusion.
853if ETRAX_SPI_MMC
854source drivers/spi/Kconfig
855endif
856
616endif 857endif
diff --git a/arch/cris/arch-v32/drivers/Makefile b/arch/cris/arch-v32/drivers/Makefile
index a359cd20ae75..e8c02437edaf 100644
--- a/arch/cris/arch-v32/drivers/Makefile
+++ b/arch/cris/arch-v32/drivers/Makefile
@@ -4,10 +4,11 @@
4 4
5obj-$(CONFIG_ETRAX_STREAMCOPROC) += cryptocop.o 5obj-$(CONFIG_ETRAX_STREAMCOPROC) += cryptocop.o
6obj-$(CONFIG_ETRAX_AXISFLASHMAP) += axisflashmap.o 6obj-$(CONFIG_ETRAX_AXISFLASHMAP) += axisflashmap.o
7obj-$(CONFIG_ETRAX_NANDFLASH) += nandflash.o 7obj-$(CONFIG_ETRAXFS) += mach-fs/
8obj-$(CONFIG_ETRAX_GPIO) += gpio.o 8obj-$(CONFIG_CRIS_MACH_ARTPEC3) += mach-a3/
9obj-$(CONFIG_ETRAX_IOP_FW_LOAD) += iop_fw_load.o 9obj-$(CONFIG_ETRAX_IOP_FW_LOAD) += iop_fw_load.o
10obj-$(CONFIG_ETRAX_PCF8563) += pcf8563.o 10obj-$(CONFIG_ETRAX_PCF8563) += pcf8563.o
11obj-$(CONFIG_ETRAX_I2C) += i2c.o 11obj-$(CONFIG_ETRAX_I2C) += i2c.o
12obj-$(CONFIG_ETRAX_SYNCHRONOUS_SERIAL) += sync_serial.o 12obj-$(CONFIG_ETRAX_SYNCHRONOUS_SERIAL) += sync_serial.o
13obj-$(CONFIG_PCI) += pci/ 13obj-$(CONFIG_PCI) += pci/
14obj-$(CONFIG_ETRAX_SPI_MMC_BOARD) += board_mmcspi.o
diff --git a/arch/cris/arch-v32/drivers/axisflashmap.c b/arch/cris/arch-v32/drivers/axisflashmap.c
index c5ff95e18269..51e1e85df96d 100644
--- a/arch/cris/arch-v32/drivers/axisflashmap.c
+++ b/arch/cris/arch-v32/drivers/axisflashmap.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Physical mapping layer for MTD using the Axis partitiontable format 2 * Physical mapping layer for MTD using the Axis partitiontable format
3 * 3 *
4 * Copyright (c) 2001, 2002, 2003 Axis Communications AB 4 * Copyright (c) 2001-2007 Axis Communications AB
5 * 5 *
6 * This file is under the GPL. 6 * This file is under the GPL.
7 * 7 *
@@ -10,9 +10,6 @@
10 * tells us what other partitions to define. If there isn't, we use a default 10 * tells us what other partitions to define. If there isn't, we use a default
11 * partition split defined below. 11 * partition split defined below.
12 * 12 *
13 * Copy of os/lx25/arch/cris/arch-v10/drivers/axisflashmap.c 1.5
14 * with minor changes.
15 *
16 */ 13 */
17 14
18#include <linux/module.h> 15#include <linux/module.h>
@@ -27,7 +24,8 @@
27#include <linux/mtd/mtdram.h> 24#include <linux/mtd/mtdram.h>
28#include <linux/mtd/partitions.h> 25#include <linux/mtd/partitions.h>
29 26
30#include <asm/arch/hwregs/config_defs.h> 27#include <linux/cramfs_fs.h>
28
31#include <asm/axisflashmap.h> 29#include <asm/axisflashmap.h>
32#include <asm/mmu.h> 30#include <asm/mmu.h>
33 31
@@ -37,16 +35,24 @@
37#define FLASH_UNCACHED_ADDR KSEG_E 35#define FLASH_UNCACHED_ADDR KSEG_E
38#define FLASH_CACHED_ADDR KSEG_F 36#define FLASH_CACHED_ADDR KSEG_F
39 37
38#define PAGESIZE (512)
39
40#if CONFIG_ETRAX_FLASH_BUSWIDTH==1 40#if CONFIG_ETRAX_FLASH_BUSWIDTH==1
41#define flash_data __u8 41#define flash_data __u8
42#elif CONFIG_ETRAX_FLASH_BUSWIDTH==2 42#elif CONFIG_ETRAX_FLASH_BUSWIDTH==2
43#define flash_data __u16 43#define flash_data __u16
44#elif CONFIG_ETRAX_FLASH_BUSWIDTH==4 44#elif CONFIG_ETRAX_FLASH_BUSWIDTH==4
45#define flash_data __u16 45#define flash_data __u32
46#endif 46#endif
47 47
48/* From head.S */ 48/* From head.S */
49extern unsigned long romfs_start, romfs_length, romfs_in_flash; 49extern unsigned long romfs_in_flash; /* 1 when romfs_start, _length in flash */
50extern unsigned long romfs_start, romfs_length;
51extern unsigned long nand_boot; /* 1 when booted from nand flash */
52
53struct partition_name {
54 char name[6];
55};
50 56
51/* The master mtd for the entire flash. */ 57/* The master mtd for the entire flash. */
52struct mtd_info* axisflash_mtd = NULL; 58struct mtd_info* axisflash_mtd = NULL;
@@ -112,32 +118,20 @@ static struct map_info map_cse1 = {
112 .map_priv_1 = FLASH_UNCACHED_ADDR + MEM_CSE0_SIZE 118 .map_priv_1 = FLASH_UNCACHED_ADDR + MEM_CSE0_SIZE
113}; 119};
114 120
115/* If no partition-table was found, we use this default-set. */ 121#define MAX_PARTITIONS 7
116#define MAX_PARTITIONS 7 122#ifdef CONFIG_ETRAX_NANDBOOT
117#define NUM_DEFAULT_PARTITIONS 3 123#define NUM_DEFAULT_PARTITIONS 4
124#define DEFAULT_ROOTFS_PARTITION_NO 2
125#define DEFAULT_MEDIA_SIZE 0x2000000 /* 32 megs */
126#else
127#define NUM_DEFAULT_PARTITIONS 3
128#define DEFAULT_ROOTFS_PARTITION_NO (-1)
129#define DEFAULT_MEDIA_SIZE 0x800000 /* 8 megs */
130#endif
118 131
119/* 132#if (MAX_PARTITIONS < NUM_DEFAULT_PARTITIONS)
120 * Default flash size is 2MB. CONFIG_ETRAX_PTABLE_SECTOR is most likely the 133#error MAX_PARTITIONS must be >= than NUM_DEFAULT_PARTITIONS
121 * size of one flash block and "filesystem"-partition needs 5 blocks to be able 134#endif
122 * to use JFFS.
123 */
124static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = {
125 {
126 .name = "boot firmware",
127 .size = CONFIG_ETRAX_PTABLE_SECTOR,
128 .offset = 0
129 },
130 {
131 .name = "kernel",
132 .size = 0x200000 - (6 * CONFIG_ETRAX_PTABLE_SECTOR),
133 .offset = CONFIG_ETRAX_PTABLE_SECTOR
134 },
135 {
136 .name = "filesystem",
137 .size = 5 * CONFIG_ETRAX_PTABLE_SECTOR,
138 .offset = 0x200000 - (5 * CONFIG_ETRAX_PTABLE_SECTOR)
139 }
140};
141 135
142/* Initialize the ones normally used. */ 136/* Initialize the ones normally used. */
143static struct mtd_partition axis_partitions[MAX_PARTITIONS] = { 137static struct mtd_partition axis_partitions[MAX_PARTITIONS] = {
@@ -178,6 +172,56 @@ static struct mtd_partition axis_partitions[MAX_PARTITIONS] = {
178 }, 172 },
179}; 173};
180 174
175
176/* If no partition-table was found, we use this default-set.
177 * Default flash size is 8MB (NOR). CONFIG_ETRAX_PTABLE_SECTOR is most
178 * likely the size of one flash block and "filesystem"-partition needs
179 * to be >=5 blocks to be able to use JFFS.
180 */
181static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = {
182 {
183 .name = "boot firmware",
184 .size = CONFIG_ETRAX_PTABLE_SECTOR,
185 .offset = 0
186 },
187 {
188 .name = "kernel",
189 .size = 10 * CONFIG_ETRAX_PTABLE_SECTOR,
190 .offset = CONFIG_ETRAX_PTABLE_SECTOR
191 },
192#define FILESYSTEM_SECTOR (11 * CONFIG_ETRAX_PTABLE_SECTOR)
193#ifdef CONFIG_ETRAX_NANDBOOT
194 {
195 .name = "rootfs",
196 .size = 10 * CONFIG_ETRAX_PTABLE_SECTOR,
197 .offset = FILESYSTEM_SECTOR
198 },
199#undef FILESYSTEM_SECTOR
200#define FILESYSTEM_SECTOR (21 * CONFIG_ETRAX_PTABLE_SECTOR)
201#endif
202 {
203 .name = "rwfs",
204 .size = DEFAULT_MEDIA_SIZE - FILESYSTEM_SECTOR,
205 .offset = FILESYSTEM_SECTOR
206 }
207};
208
209#ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE
210/* Main flash device */
211static struct mtd_partition main_partition = {
212 .name = "main",
213 .size = 0,
214 .offset = 0
215};
216#endif
217
218/* Auxilliary partition if we find another flash */
219static struct mtd_partition aux_partition = {
220 .name = "aux",
221 .size = 0,
222 .offset = 0
223};
224
181/* 225/*
182 * Probe a chip select for AMD-compatible (JEDEC) or CFI-compatible flash 226 * Probe a chip select for AMD-compatible (JEDEC) or CFI-compatible flash
183 * chips in that order (because the amd_flash-driver is faster). 227 * chips in that order (because the amd_flash-driver is faster).
@@ -191,7 +235,7 @@ static struct mtd_info *probe_cs(struct map_info *map_cs)
191 map_cs->name, map_cs->size, map_cs->map_priv_1); 235 map_cs->name, map_cs->size, map_cs->map_priv_1);
192 236
193#ifdef CONFIG_MTD_CFI 237#ifdef CONFIG_MTD_CFI
194 mtd_cs = do_map_probe("cfi_probe", map_cs); 238 mtd_cs = do_map_probe("cfi_probe", map_cs);
195#endif 239#endif
196#ifdef CONFIG_MTD_JEDECPROBE 240#ifdef CONFIG_MTD_JEDECPROBE
197 if (!mtd_cs) 241 if (!mtd_cs)
@@ -204,7 +248,7 @@ static struct mtd_info *probe_cs(struct map_info *map_cs)
204/* 248/*
205 * Probe each chip select individually for flash chips. If there are chips on 249 * Probe each chip select individually for flash chips. If there are chips on
206 * both cse0 and cse1, the mtd_info structs will be concatenated to one struct 250 * both cse0 and cse1, the mtd_info structs will be concatenated to one struct
207 * so that MTD partitions can cross chip boundaries. 251 * so that MTD partitions can cross chip boundries.
208 * 252 *
209 * The only known restriction to how you can mount your chips is that each 253 * The only known restriction to how you can mount your chips is that each
210 * chip select must hold similar flash chips. But you need external hardware 254 * chip select must hold similar flash chips. But you need external hardware
@@ -216,9 +260,8 @@ static struct mtd_info *flash_probe(void)
216{ 260{
217 struct mtd_info *mtd_cse0; 261 struct mtd_info *mtd_cse0;
218 struct mtd_info *mtd_cse1; 262 struct mtd_info *mtd_cse1;
219 struct mtd_info *mtd_nand = NULL;
220 struct mtd_info *mtd_total; 263 struct mtd_info *mtd_total;
221 struct mtd_info *mtds[3]; 264 struct mtd_info *mtds[2];
222 int count = 0; 265 int count = 0;
223 266
224 if ((mtd_cse0 = probe_cs(&map_cse0)) != NULL) 267 if ((mtd_cse0 = probe_cs(&map_cse0)) != NULL)
@@ -226,12 +269,7 @@ static struct mtd_info *flash_probe(void)
226 if ((mtd_cse1 = probe_cs(&map_cse1)) != NULL) 269 if ((mtd_cse1 = probe_cs(&map_cse1)) != NULL)
227 mtds[count++] = mtd_cse1; 270 mtds[count++] = mtd_cse1;
228 271
229#ifdef CONFIG_ETRAX_NANDFLASH 272 if (!mtd_cse0 && !mtd_cse1) {
230 if ((mtd_nand = crisv32_nand_flash_probe()) != NULL)
231 mtds[count++] = mtd_nand;
232#endif
233
234 if (!mtd_cse0 && !mtd_cse1 && !mtd_nand) {
235 /* No chip found. */ 273 /* No chip found. */
236 return NULL; 274 return NULL;
237 } 275 }
@@ -245,9 +283,7 @@ static struct mtd_info *flash_probe(void)
245 * So we use the MTD concatenation layer instead of further 283 * So we use the MTD concatenation layer instead of further
246 * complicating the probing procedure. 284 * complicating the probing procedure.
247 */ 285 */
248 mtd_total = mtd_concat_create(mtds, 286 mtd_total = mtd_concat_create(mtds, count, "cse0+cse1");
249 count,
250 "cse0+cse1+nand");
251#else 287#else
252 printk(KERN_ERR "%s and %s: Cannot concatenate due to kernel " 288 printk(KERN_ERR "%s and %s: Cannot concatenate due to kernel "
253 "(mis)configuration!\n", map_cse0.name, map_cse1.name); 289 "(mis)configuration!\n", map_cse0.name, map_cse1.name);
@@ -255,61 +291,162 @@ static struct mtd_info *flash_probe(void)
255#endif 291#endif
256 if (!mtd_total) { 292 if (!mtd_total) {
257 printk(KERN_ERR "%s and %s: Concatenation failed!\n", 293 printk(KERN_ERR "%s and %s: Concatenation failed!\n",
258 map_cse0.name, map_cse1.name); 294 map_cse0.name, map_cse1.name);
259 295
260 /* The best we can do now is to only use what we found 296 /* The best we can do now is to only use what we found
261 * at cse0. 297 * at cse0. */
262 */
263 mtd_total = mtd_cse0; 298 mtd_total = mtd_cse0;
264 map_destroy(mtd_cse1); 299 map_destroy(mtd_cse1);
265 } 300 }
266 } else { 301 } else
267 mtd_total = mtd_cse0? mtd_cse0 : mtd_cse1 ? mtd_cse1 : mtd_nand; 302 mtd_total = mtd_cse0 ? mtd_cse0 : mtd_cse1;
268
269 }
270 303
271 return mtd_total; 304 return mtd_total;
272} 305}
273 306
274extern unsigned long crisv32_nand_boot;
275extern unsigned long crisv32_nand_cramfs_offset;
276
277/* 307/*
278 * Probe the flash chip(s) and, if it succeeds, read the partition-table 308 * Probe the flash chip(s) and, if it succeeds, read the partition-table
279 * and register the partitions with MTD. 309 * and register the partitions with MTD.
280 */ 310 */
281static int __init init_axis_flash(void) 311static int __init init_axis_flash(void)
282{ 312{
283 struct mtd_info *mymtd; 313 struct mtd_info *main_mtd;
314 struct mtd_info *aux_mtd = NULL;
284 int err = 0; 315 int err = 0;
285 int pidx = 0; 316 int pidx = 0;
286 struct partitiontable_head *ptable_head = NULL; 317 struct partitiontable_head *ptable_head = NULL;
287 struct partitiontable_entry *ptable; 318 struct partitiontable_entry *ptable;
288 int use_default_ptable = 1; /* Until proven otherwise. */ 319 int ptable_ok = 0;
289 const char *pmsg = KERN_INFO " /dev/flash%d at 0x%08x, size 0x%08x\n"; 320 static char page[PAGESIZE];
290 static char page[512];
291 size_t len; 321 size_t len;
322 int ram_rootfs_partition = -1; /* -1 => no RAM rootfs partition */
323 int part;
324
325 /* We need a root fs. If it resides in RAM, we need to use an
326 * MTDRAM device, so it must be enabled in the kernel config,
327 * but its size must be configured as 0 so as not to conflict
328 * with our usage.
329 */
330#if !defined(CONFIG_MTD_MTDRAM) || (CONFIG_MTDRAM_TOTAL_SIZE != 0) || (CONFIG_MTDRAM_ABS_POS != 0)
331 if (!romfs_in_flash && !nand_boot) {
332 printk(KERN_EMERG "axisflashmap: Cannot create an MTD RAM "
333 "device; configure CONFIG_MTD_MTDRAM with size = 0!\n");
334 panic("This kernel cannot boot from RAM!\n");
335 }
336#endif
337
338#ifndef CONFIG_ETRAX_VCS_SIM
339 main_mtd = flash_probe();
340 if (main_mtd)
341 printk(KERN_INFO "%s: 0x%08x bytes of NOR flash memory.\n",
342 main_mtd->name, main_mtd->size);
343
344#ifdef CONFIG_ETRAX_NANDFLASH
345 aux_mtd = crisv32_nand_flash_probe();
346 if (aux_mtd)
347 printk(KERN_INFO "%s: 0x%08x bytes of NAND flash memory.\n",
348 aux_mtd->name, aux_mtd->size);
349
350#ifdef CONFIG_ETRAX_NANDBOOT
351 {
352 struct mtd_info *tmp_mtd;
292 353
293#ifndef CONFIG_ETRAXFS_SIM 354 printk(KERN_INFO "axisflashmap: Set to boot from NAND flash, "
294 mymtd = flash_probe(); 355 "making NAND flash primary device.\n");
295 mymtd->read(mymtd, CONFIG_ETRAX_PTABLE_SECTOR, 512, &len, page); 356 tmp_mtd = main_mtd;
296 ptable_head = (struct partitiontable_head *)(page + PARTITION_TABLE_OFFSET); 357 main_mtd = aux_mtd;
358 aux_mtd = tmp_mtd;
359 }
360#endif /* CONFIG_ETRAX_NANDBOOT */
361#endif /* CONFIG_ETRAX_NANDFLASH */
297 362
298 if (!mymtd) { 363 if (!main_mtd && !aux_mtd) {
299 /* There's no reason to use this module if no flash chip can 364 /* There's no reason to use this module if no flash chip can
300 * be identified. Make sure that's understood. 365 * be identified. Make sure that's understood.
301 */ 366 */
302 printk(KERN_INFO "axisflashmap: Found no flash chip.\n"); 367 printk(KERN_INFO "axisflashmap: Found no flash chip.\n");
303 } else {
304 printk(KERN_INFO "%s: 0x%08x bytes of flash memory.\n",
305 mymtd->name, mymtd->size);
306 axisflash_mtd = mymtd;
307 } 368 }
308 369
309 if (mymtd) { 370#if 0 /* Dump flash memory so we can see what is going on */
310 mymtd->owner = THIS_MODULE; 371 if (main_mtd) {
372 int sectoraddr, i;
373 for (sectoraddr = 0; sectoraddr < 2*65536+4096;
374 sectoraddr += PAGESIZE) {
375 main_mtd->read(main_mtd, sectoraddr, PAGESIZE, &len,
376 page);
377 printk(KERN_INFO
378 "Sector at %d (length %d):\n",
379 sectoraddr, len);
380 for (i = 0; i < PAGESIZE; i += 16) {
381 printk(KERN_INFO
382 "%02x %02x %02x %02x "
383 "%02x %02x %02x %02x "
384 "%02x %02x %02x %02x "
385 "%02x %02x %02x %02x\n",
386 page[i] & 255, page[i+1] & 255,
387 page[i+2] & 255, page[i+3] & 255,
388 page[i+4] & 255, page[i+5] & 255,
389 page[i+6] & 255, page[i+7] & 255,
390 page[i+8] & 255, page[i+9] & 255,
391 page[i+10] & 255, page[i+11] & 255,
392 page[i+12] & 255, page[i+13] & 255,
393 page[i+14] & 255, page[i+15] & 255);
394 }
395 }
396 }
397#endif
398
399 if (main_mtd) {
400 main_mtd->owner = THIS_MODULE;
401 axisflash_mtd = main_mtd;
402
403 loff_t ptable_sector = CONFIG_ETRAX_PTABLE_SECTOR;
404
405 /* First partition (rescue) is always set to the default. */
406 pidx++;
407#ifdef CONFIG_ETRAX_NANDBOOT
408 /* We know where the partition table should be located,
409 * it will be in first good block after that.
410 */
411 int blockstat;
412 do {
413 blockstat = main_mtd->block_isbad(main_mtd,
414 ptable_sector);
415 if (blockstat < 0)
416 ptable_sector = 0; /* read error */
417 else if (blockstat)
418 ptable_sector += main_mtd->erasesize;
419 } while (blockstat && ptable_sector);
420#endif
421 if (ptable_sector) {
422 main_mtd->read(main_mtd, ptable_sector, PAGESIZE,
423 &len, page);
424 ptable_head = &((struct partitiontable *) page)->head;
425 }
426
427#if 0 /* Dump partition table so we can see what is going on */
428 printk(KERN_INFO
429 "axisflashmap: flash read %d bytes at 0x%08x, data: "
430 "%02x %02x %02x %02x %02x %02x %02x %02x\n",
431 len, CONFIG_ETRAX_PTABLE_SECTOR,
432 page[0] & 255, page[1] & 255,
433 page[2] & 255, page[3] & 255,
434 page[4] & 255, page[5] & 255,
435 page[6] & 255, page[7] & 255);
436 printk(KERN_INFO
437 "axisflashmap: partition table offset %d, data: "
438 "%02x %02x %02x %02x %02x %02x %02x %02x\n",
439 PARTITION_TABLE_OFFSET,
440 page[PARTITION_TABLE_OFFSET+0] & 255,
441 page[PARTITION_TABLE_OFFSET+1] & 255,
442 page[PARTITION_TABLE_OFFSET+2] & 255,
443 page[PARTITION_TABLE_OFFSET+3] & 255,
444 page[PARTITION_TABLE_OFFSET+4] & 255,
445 page[PARTITION_TABLE_OFFSET+5] & 255,
446 page[PARTITION_TABLE_OFFSET+6] & 255,
447 page[PARTITION_TABLE_OFFSET+7] & 255);
448#endif
311 } 449 }
312 pidx++; /* First partition is always set to the default. */
313 450
314 if (ptable_head && (ptable_head->magic == PARTITION_TABLE_MAGIC) 451 if (ptable_head && (ptable_head->magic == PARTITION_TABLE_MAGIC)
315 && (ptable_head->size < 452 && (ptable_head->size <
@@ -322,7 +459,6 @@ static int __init init_axis_flash(void)
322 /* Looks like a start, sane length and end of a 459 /* Looks like a start, sane length and end of a
323 * partition table, lets check csum etc. 460 * partition table, lets check csum etc.
324 */ 461 */
325 int ptable_ok = 0;
326 struct partitiontable_entry *max_addr = 462 struct partitiontable_entry *max_addr =
327 (struct partitiontable_entry *) 463 (struct partitiontable_entry *)
328 ((unsigned long)ptable_head + sizeof(*ptable_head) + 464 ((unsigned long)ptable_head + sizeof(*ptable_head) +
@@ -346,104 +482,170 @@ static int __init init_axis_flash(void)
346 ptable_ok = (csum == ptable_head->checksum); 482 ptable_ok = (csum == ptable_head->checksum);
347 483
348 /* Read the entries and use/show the info. */ 484 /* Read the entries and use/show the info. */
349 printk(KERN_INFO " Found a%s partition table at 0x%p-0x%p.\n", 485 printk(KERN_INFO "axisflashmap: "
486 "Found a%s partition table at 0x%p-0x%p.\n",
350 (ptable_ok ? " valid" : "n invalid"), ptable_head, 487 (ptable_ok ? " valid" : "n invalid"), ptable_head,
351 max_addr); 488 max_addr);
352 489
353 /* We have found a working bootblock. Now read the 490 /* We have found a working bootblock. Now read the
354 * partition table. Scan the table. It ends when 491 * partition table. Scan the table. It ends with 0xffffffff.
355 * there is 0xffffffff, that is, empty flash.
356 */ 492 */
357 while (ptable_ok 493 while (ptable_ok
358 && ptable->offset != 0xffffffff 494 && ptable->offset != PARTITIONTABLE_END_MARKER
359 && ptable < max_addr 495 && ptable < max_addr
360 && pidx < MAX_PARTITIONS) { 496 && pidx < MAX_PARTITIONS - 1) {
361 497
362 axis_partitions[pidx].offset = offset + ptable->offset + (crisv32_nand_boot ? 16384 : 0); 498 axis_partitions[pidx].offset = offset + ptable->offset;
363 axis_partitions[pidx].size = ptable->size; 499#ifdef CONFIG_ETRAX_NANDFLASH
364 500 if (main_mtd->type == MTD_NANDFLASH) {
365 printk(pmsg, pidx, axis_partitions[pidx].offset, 501 axis_partitions[pidx].size =
366 axis_partitions[pidx].size); 502 (((ptable+1)->offset ==
503 PARTITIONTABLE_END_MARKER) ?
504 main_mtd->size :
505 ((ptable+1)->offset + offset)) -
506 (ptable->offset + offset);
507
508 } else
509#endif /* CONFIG_ETRAX_NANDFLASH */
510 axis_partitions[pidx].size = ptable->size;
511#ifdef CONFIG_ETRAX_NANDBOOT
512 /* Save partition number of jffs2 ro partition.
513 * Needed if RAM booting or root file system in RAM.
514 */
515 if (!nand_boot &&
516 ram_rootfs_partition < 0 && /* not already set */
517 ptable->type == PARTITION_TYPE_JFFS2 &&
518 (ptable->flags & PARTITION_FLAGS_READONLY_MASK) ==
519 PARTITION_FLAGS_READONLY)
520 ram_rootfs_partition = pidx;
521#endif /* CONFIG_ETRAX_NANDBOOT */
367 pidx++; 522 pidx++;
368 ptable++; 523 ptable++;
369 } 524 }
370 use_default_ptable = !ptable_ok;
371 } 525 }
372 526
373 if (romfs_in_flash) { 527 /* Decide whether to use default partition table. */
374 /* Add an overlapping device for the root partition (romfs). */ 528 /* Only use default table if we actually have a device (main_mtd) */
375 529
376 axis_partitions[pidx].name = "romfs"; 530 struct mtd_partition *partition = &axis_partitions[0];
377 if (crisv32_nand_boot) { 531 if (main_mtd && !ptable_ok) {
378 char* data = kmalloc(1024, GFP_KERNEL); 532 memcpy(axis_partitions, axis_default_partitions,
379 int len; 533 sizeof(axis_default_partitions));
380 int offset = crisv32_nand_cramfs_offset & ~(1024-1); 534 pidx = NUM_DEFAULT_PARTITIONS;
381 char* tmp; 535 ram_rootfs_partition = DEFAULT_ROOTFS_PARTITION_NO;
382 536 }
383 mymtd->read(mymtd, offset, 1024, &len, data);
384 tmp = &data[crisv32_nand_cramfs_offset % 512];
385 axis_partitions[pidx].size = *(unsigned*)(tmp + 4);
386 axis_partitions[pidx].offset = crisv32_nand_cramfs_offset;
387 kfree(data);
388 } else {
389 axis_partitions[pidx].size = romfs_length;
390 axis_partitions[pidx].offset = romfs_start - FLASH_CACHED_ADDR;
391 }
392 537
538 /* Add artificial partitions for rootfs if necessary */
539 if (romfs_in_flash) {
540 /* rootfs is in directly accessible flash memory = NOR flash.
541 Add an overlapping device for the rootfs partition. */
542 printk(KERN_INFO "axisflashmap: Adding partition for "
543 "overlapping root file system image\n");
544 axis_partitions[pidx].size = romfs_length;
545 axis_partitions[pidx].offset = romfs_start - FLASH_CACHED_ADDR;
546 axis_partitions[pidx].name = "romfs";
393 axis_partitions[pidx].mask_flags |= MTD_WRITEABLE; 547 axis_partitions[pidx].mask_flags |= MTD_WRITEABLE;
394 548 ram_rootfs_partition = -1;
395 printk(KERN_INFO
396 " Adding readonly flash partition for romfs image:\n");
397 printk(pmsg, pidx, axis_partitions[pidx].offset,
398 axis_partitions[pidx].size);
399 pidx++; 549 pidx++;
400 } 550 } else if (romfs_length && !nand_boot) {
401 551 /* romfs exists in memory, but not in flash, so must be in RAM.
402 if (mymtd) { 552 * Configure an MTDRAM partition. */
403 if (use_default_ptable) { 553 if (ram_rootfs_partition < 0) {
404 printk(KERN_INFO " Using default partition table.\n"); 554 /* None set yet, put it at the end */
405 err = add_mtd_partitions(mymtd, axis_default_partitions, 555 ram_rootfs_partition = pidx;
406 NUM_DEFAULT_PARTITIONS); 556 pidx++;
407 } else {
408 err = add_mtd_partitions(mymtd, axis_partitions, pidx);
409 } 557 }
558 printk(KERN_INFO "axisflashmap: Adding partition for "
559 "root file system image in RAM\n");
560 axis_partitions[ram_rootfs_partition].size = romfs_length;
561 axis_partitions[ram_rootfs_partition].offset = romfs_start;
562 axis_partitions[ram_rootfs_partition].name = "romfs";
563 axis_partitions[ram_rootfs_partition].mask_flags |=
564 MTD_WRITEABLE;
565 }
410 566
411 if (err) { 567#ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE
412 panic("axisflashmap could not add MTD partitions!\n"); 568 if (main_mtd) {
413 } 569 main_partition.size = main_mtd->size;
570 err = add_mtd_partitions(main_mtd, &main_partition, 1);
571 if (err)
572 panic("axisflashmap: Could not initialize "
573 "partition for whole main mtd device!\n");
414 } 574 }
415/* CONFIG_EXTRAXFS_SIM */
416#endif 575#endif
417 576
418 if (!romfs_in_flash) { 577 /* Now, register all partitions with mtd.
419 /* Create an RAM device for the root partition (romfs). */ 578 * We do this one at a time so we can slip in an MTDRAM device
579 * in the proper place if required. */
580
581 for (part = 0; part < pidx; part++) {
582 if (part == ram_rootfs_partition) {
583 /* add MTDRAM partition here */
584 struct mtd_info *mtd_ram;
585
586 mtd_ram = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
587 if (!mtd_ram)
588 panic("axisflashmap: Couldn't allocate memory "
589 "for mtd_info!\n");
590 printk(KERN_INFO "axisflashmap: Adding RAM partition "
591 "for rootfs image.\n");
592 err = mtdram_init_device(mtd_ram,
593 (void *)partition[part].offset,
594 partition[part].size,
595 partition[part].name);
596 if (err)
597 panic("axisflashmap: Could not initialize "
598 "MTD RAM device!\n");
599 /* JFFS2 likes to have an erasesize. Keep potential
600 * JFFS2 rootfs happy by providing one. Since image
601 * was most likely created for main mtd, use that
602 * erasesize, if available. Otherwise, make a guess. */
603 mtd_ram->erasesize = (main_mtd ? main_mtd->erasesize :
604 CONFIG_ETRAX_PTABLE_SECTOR);
605 } else {
606 err = add_mtd_partitions(main_mtd, &partition[part], 1);
607 if (err)
608 panic("axisflashmap: Could not add mtd "
609 "partition %d\n", part);
610 }
611 }
612#endif /* CONFIG_EXTRAX_VCS_SIM */
613
614#ifdef CONFIG_ETRAX_VCS_SIM
615 /* For simulator, always use a RAM partition.
616 * The rootfs will be found after the kernel in RAM,
617 * with romfs_start and romfs_end indicating location and size.
618 */
619 struct mtd_info *mtd_ram;
620
621 mtd_ram = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
622 if (!mtd_ram) {
623 panic("axisflashmap: Couldn't allocate memory for "
624 "mtd_info!\n");
625 }
420 626
421#if !defined(CONFIG_MTD_MTDRAM) || (CONFIG_MTDRAM_TOTAL_SIZE != 0) || (CONFIG_MTDRAM_ABS_POS != 0) 627 printk(KERN_INFO "axisflashmap: Adding RAM partition for romfs, "
422 /* No use trying to boot this kernel from RAM. Panic! */ 628 "at %u, size %u\n",
423 printk(KERN_EMERG "axisflashmap: Cannot create an MTD RAM " 629 (unsigned) romfs_start, (unsigned) romfs_length);
424 "device due to kernel (mis)configuration!\n");
425 panic("This kernel cannot boot from RAM!\n");
426#else
427 struct mtd_info *mtd_ram;
428 630
429 mtd_ram = kmalloc(sizeof(struct mtd_info), 631 err = mtdram_init_device(mtd_ram, (void *)romfs_start,
430 GFP_KERNEL); 632 romfs_length, "romfs");
431 if (!mtd_ram) { 633 if (err) {
432 panic("axisflashmap couldn't allocate memory for " 634 panic("axisflashmap: Could not initialize MTD RAM "
433 "mtd_info!\n"); 635 "device!\n");
434 } 636 }
637#endif /* CONFIG_EXTRAX_VCS_SIM */
435 638
436 printk(KERN_INFO " Adding RAM partition for romfs image:\n"); 639#ifndef CONFIG_ETRAX_VCS_SIM
437 printk(pmsg, pidx, romfs_start, romfs_length); 640 if (aux_mtd) {
641 aux_partition.size = aux_mtd->size;
642 err = add_mtd_partitions(aux_mtd, &aux_partition, 1);
643 if (err)
644 panic("axisflashmap: Could not initialize "
645 "aux mtd device!\n");
438 646
439 err = mtdram_init_device(mtd_ram, (void*)romfs_start,
440 romfs_length, "romfs");
441 if (err) {
442 panic("axisflashmap could not initialize MTD RAM "
443 "device!\n");
444 }
445#endif
446 } 647 }
648#endif /* CONFIG_EXTRAX_VCS_SIM */
447 649
448 return err; 650 return err;
449} 651}
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index e8914d401696..9fb58202be99 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -1,8 +1,7 @@
1/* $Id: cryptocop.c,v 1.13 2005/04/21 17:27:55 henriken Exp $ 1/*
2 *
3 * Stream co-processor driver for the ETRAX FS 2 * Stream co-processor driver for the ETRAX FS
4 * 3 *
5 * Copyright (C) 2003-2005 Axis Communications AB 4 * Copyright (C) 2003-2007 Axis Communications AB
6 */ 5 */
7 6
8#include <linux/init.h> 7#include <linux/init.h>
@@ -25,17 +24,29 @@
25#include <asm/signal.h> 24#include <asm/signal.h>
26#include <asm/irq.h> 25#include <asm/irq.h>
27 26
28#include <asm/arch/dma.h> 27#include <dma.h>
29#include <asm/arch/hwregs/dma.h> 28#include <hwregs/dma.h>
30#include <asm/arch/hwregs/reg_map.h> 29#include <hwregs/reg_map.h>
31#include <asm/arch/hwregs/reg_rdwr.h> 30#include <hwregs/reg_rdwr.h>
32#include <asm/arch/hwregs/intr_vect_defs.h> 31#include <hwregs/intr_vect_defs.h>
33 32
34#include <asm/arch/hwregs/strcop.h> 33#include <hwregs/strcop.h>
35#include <asm/arch/hwregs/strcop_defs.h> 34#include <hwregs/strcop_defs.h>
36#include <asm/arch/cryptocop.h> 35#include <cryptocop.h>
37 36
38 37#ifdef CONFIG_ETRAXFS
38#define IN_DMA 9
39#define OUT_DMA 8
40#define IN_DMA_INST regi_dma9
41#define OUT_DMA_INST regi_dma8
42#define DMA_IRQ DMA9_INTR_VECT
43#else
44#define IN_DMA 3
45#define OUT_DMA 2
46#define IN_DMA_INST regi_dma3
47#define OUT_DMA_INST regi_dma2
48#define DMA_IRQ DMA3_INTR_VECT
49#endif
39 50
40#define DESCR_ALLOC_PAD (31) 51#define DESCR_ALLOC_PAD (31)
41 52
@@ -1886,14 +1897,14 @@ static void cryptocop_do_tasklet(unsigned long unused)
1886} 1897}
1887 1898
1888static irqreturn_t 1899static irqreturn_t
1889dma_done_interrupt(int irq, void *dev_id, struct pt_regs * regs) 1900dma_done_interrupt(int irq, void *dev_id)
1890{ 1901{
1891 struct cryptocop_prio_job *done_job; 1902 struct cryptocop_prio_job *done_job;
1892 reg_dma_rw_ack_intr ack_intr = { 1903 reg_dma_rw_ack_intr ack_intr = {
1893 .data = 1, 1904 .data = 1,
1894 }; 1905 };
1895 1906
1896 REG_WR (dma, regi_dma9, rw_ack_intr, ack_intr); 1907 REG_WR(dma, IN_DMA_INST, rw_ack_intr, ack_intr);
1897 1908
1898 DEBUG(printk("cryptocop DMA done\n")); 1909 DEBUG(printk("cryptocop DMA done\n"));
1899 1910
@@ -1937,7 +1948,6 @@ dma_done_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1937static int init_cryptocop(void) 1948static int init_cryptocop(void)
1938{ 1949{
1939 unsigned long flags; 1950 unsigned long flags;
1940 reg_intr_vect_rw_mask intr_mask;
1941 reg_dma_rw_cfg dma_cfg = {.en = 1}; 1951 reg_dma_rw_cfg dma_cfg = {.en = 1};
1942 reg_dma_rw_intr_mask intr_mask_in = {.data = regk_dma_yes}; /* Only want descriptor interrupts from the DMA in channel. */ 1952 reg_dma_rw_intr_mask intr_mask_in = {.data = regk_dma_yes}; /* Only want descriptor interrupts from the DMA in channel. */
1943 reg_dma_rw_ack_intr ack_intr = {.data = 1,.in_eop = 1 }; 1953 reg_dma_rw_ack_intr ack_intr = {.data = 1,.in_eop = 1 };
@@ -1950,10 +1960,14 @@ static int init_cryptocop(void)
1950 .en = 1 1960 .en = 1
1951 }; 1961 };
1952 1962
1953 if (request_irq(DMA9_INTR_VECT, dma_done_interrupt, 0, "stream co-processor DMA", NULL)) panic("request_irq stream co-processor irq dma9"); 1963 if (request_irq(DMA_IRQ, dma_done_interrupt, 0,
1964 "stream co-processor DMA", NULL))
1965 panic("request_irq stream co-processor irq dma9");
1954 1966
1955 (void)crisv32_request_dma(8, "strcop", DMA_PANIC_ON_ERROR, 0, dma_strp); 1967 (void)crisv32_request_dma(OUT_DMA, "strcop", DMA_PANIC_ON_ERROR,
1956 (void)crisv32_request_dma(9, "strcop", DMA_PANIC_ON_ERROR, 0, dma_strp); 1968 0, dma_strp);
1969 (void)crisv32_request_dma(IN_DMA, "strcop", DMA_PANIC_ON_ERROR,
1970 0, dma_strp);
1957 1971
1958 local_irq_save(flags); 1972 local_irq_save(flags);
1959 1973
@@ -1963,24 +1977,19 @@ static int init_cryptocop(void)
1963 strcop_cfg.en = 1; 1977 strcop_cfg.en = 1;
1964 REG_WR(strcop, regi_strcop, rw_cfg, strcop_cfg); 1978 REG_WR(strcop, regi_strcop, rw_cfg, strcop_cfg);
1965 1979
1966 /* Enable DMA9 interrupt */
1967 intr_mask = REG_RD(intr_vect, regi_irq, rw_mask);
1968 intr_mask.dma9 = 1;
1969 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
1970
1971 /* Enable DMAs. */ 1980 /* Enable DMAs. */
1972 REG_WR(dma, regi_dma9, rw_cfg, dma_cfg); /* input DMA */ 1981 REG_WR(dma, IN_DMA_INST, rw_cfg, dma_cfg); /* input DMA */
1973 REG_WR(dma, regi_dma8, rw_cfg, dma_cfg); /* output DMA */ 1982 REG_WR(dma, OUT_DMA_INST, rw_cfg, dma_cfg); /* output DMA */
1974 1983
1975 /* Set up wordsize = 4 for DMAs. */ 1984 /* Set up wordsize = 4 for DMAs. */
1976 DMA_WR_CMD (regi_dma8, regk_dma_set_w_size4); 1985 DMA_WR_CMD(OUT_DMA_INST, regk_dma_set_w_size4);
1977 DMA_WR_CMD (regi_dma9, regk_dma_set_w_size4); 1986 DMA_WR_CMD(IN_DMA_INST, regk_dma_set_w_size4);
1978 1987
1979 /* Enable interrupts. */ 1988 /* Enable interrupts. */
1980 REG_WR(dma, regi_dma9, rw_intr_mask, intr_mask_in); 1989 REG_WR(dma, IN_DMA_INST, rw_intr_mask, intr_mask_in);
1981 1990
1982 /* Clear intr ack. */ 1991 /* Clear intr ack. */
1983 REG_WR(dma, regi_dma9, rw_ack_intr, ack_intr); 1992 REG_WR(dma, IN_DMA_INST, rw_ack_intr, ack_intr);
1984 1993
1985 local_irq_restore(flags); 1994 local_irq_restore(flags);
1986 1995
@@ -1991,7 +2000,6 @@ static int init_cryptocop(void)
1991static void release_cryptocop(void) 2000static void release_cryptocop(void)
1992{ 2001{
1993 unsigned long flags; 2002 unsigned long flags;
1994 reg_intr_vect_rw_mask intr_mask;
1995 reg_dma_rw_cfg dma_cfg = {.en = 0}; 2003 reg_dma_rw_cfg dma_cfg = {.en = 0};
1996 reg_dma_rw_intr_mask intr_mask_in = {0}; 2004 reg_dma_rw_intr_mask intr_mask_in = {0};
1997 reg_dma_rw_ack_intr ack_intr = {.data = 1,.in_eop = 1 }; 2005 reg_dma_rw_ack_intr ack_intr = {.data = 1,.in_eop = 1 };
@@ -1999,26 +2007,21 @@ static void release_cryptocop(void)
1999 local_irq_save(flags); 2007 local_irq_save(flags);
2000 2008
2001 /* Clear intr ack. */ 2009 /* Clear intr ack. */
2002 REG_WR(dma, regi_dma9, rw_ack_intr, ack_intr); 2010 REG_WR(dma, IN_DMA_INST, rw_ack_intr, ack_intr);
2003
2004 /* Disable DMA9 interrupt */
2005 intr_mask = REG_RD(intr_vect, regi_irq, rw_mask);
2006 intr_mask.dma9 = 0;
2007 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
2008 2011
2009 /* Disable DMAs. */ 2012 /* Disable DMAs. */
2010 REG_WR(dma, regi_dma9, rw_cfg, dma_cfg); /* input DMA */ 2013 REG_WR(dma, IN_DMA_INST, rw_cfg, dma_cfg); /* input DMA */
2011 REG_WR(dma, regi_dma8, rw_cfg, dma_cfg); /* output DMA */ 2014 REG_WR(dma, OUT_DMA_INST, rw_cfg, dma_cfg); /* output DMA */
2012 2015
2013 /* Disable interrupts. */ 2016 /* Disable interrupts. */
2014 REG_WR(dma, regi_dma9, rw_intr_mask, intr_mask_in); 2017 REG_WR(dma, IN_DMA_INST, rw_intr_mask, intr_mask_in);
2015 2018
2016 local_irq_restore(flags); 2019 local_irq_restore(flags);
2017 2020
2018 free_irq(DMA9_INTR_VECT, NULL); 2021 free_irq(DMA_IRQ, NULL);
2019 2022
2020 (void)crisv32_free_dma(8); 2023 (void)crisv32_free_dma(OUT_DMA);
2021 (void)crisv32_free_dma(9); 2024 (void)crisv32_free_dma(IN_DMA);
2022} 2025}
2023 2026
2024 2027
@@ -2076,13 +2079,13 @@ static void cryptocop_job_queue_close(void)
2076 reg_dma_rw_cfg dma_out_cfg, dma_in_cfg; 2079 reg_dma_rw_cfg dma_out_cfg, dma_in_cfg;
2077 2080
2078 /* Stop DMA. */ 2081 /* Stop DMA. */
2079 dma_out_cfg = REG_RD(dma, regi_dma8, rw_cfg); 2082 dma_out_cfg = REG_RD(dma, OUT_DMA_INST, rw_cfg);
2080 dma_out_cfg.en = regk_dma_no; 2083 dma_out_cfg.en = regk_dma_no;
2081 REG_WR(dma, regi_dma8, rw_cfg, dma_out_cfg); 2084 REG_WR(dma, OUT_DMA_INST, rw_cfg, dma_out_cfg);
2082 2085
2083 dma_in_cfg = REG_RD(dma, regi_dma9, rw_cfg); 2086 dma_in_cfg = REG_RD(dma, IN_DMA_INST, rw_cfg);
2084 dma_in_cfg.en = regk_dma_no; 2087 dma_in_cfg.en = regk_dma_no;
2085 REG_WR(dma, regi_dma9, rw_cfg, dma_in_cfg); 2088 REG_WR(dma, IN_DMA_INST, rw_cfg, dma_in_cfg);
2086 2089
2087 /* Disble the cryptocop. */ 2090 /* Disble the cryptocop. */
2088 rw_cfg = REG_RD(strcop, regi_strcop, rw_cfg); 2091 rw_cfg = REG_RD(strcop, regi_strcop, rw_cfg);
@@ -2226,10 +2229,11 @@ static void cryptocop_start_job(void)
2226 &pj->iop->ctx_out, (char*)virt_to_phys(&pj->iop->ctx_out))); 2229 &pj->iop->ctx_out, (char*)virt_to_phys(&pj->iop->ctx_out)));
2227 2230
2228 /* Start input DMA. */ 2231 /* Start input DMA. */
2229 DMA_START_CONTEXT(regi_dma9, virt_to_phys(&pj->iop->ctx_in)); 2232 flush_dma_context(&pj->iop->ctx_in);
2233 DMA_START_CONTEXT(IN_DMA_INST, virt_to_phys(&pj->iop->ctx_in));
2230 2234
2231 /* Start output DMA. */ 2235 /* Start output DMA. */
2232 DMA_START_CONTEXT(regi_dma8, virt_to_phys(&pj->iop->ctx_out)); 2236 DMA_START_CONTEXT(OUT_DMA_INST, virt_to_phys(&pj->iop->ctx_out));
2233 2237
2234 spin_unlock_irqrestore(&running_job_lock, running_job_flags); 2238 spin_unlock_irqrestore(&running_job_lock, running_job_flags);
2235 DEBUG(printk("cryptocop_start_job: exiting\n")); 2239 DEBUG(printk("cryptocop_start_job: exiting\n"));
diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c
index f1edd2e359b2..c2fb7a5c1396 100644
--- a/arch/cris/arch-v32/drivers/i2c.c
+++ b/arch/cris/arch-v32/drivers/i2c.c
@@ -19,10 +19,10 @@
19*! 19*!
20*! --------------------------------------------------------------------------- 20*! ---------------------------------------------------------------------------
21*! 21*!
22*! (C) Copyright 1999-2002 Axis Communications AB, LUND, SWEDEN 22*! (C) Copyright 1999-2007 Axis Communications AB, LUND, SWEDEN
23*! 23*!
24*!***************************************************************************/ 24*!***************************************************************************/
25/* $Id: i2c.c,v 1.2 2005/05/09 15:29:49 starvik Exp $ */ 25
26/****************** INCLUDE FILES SECTION ***********************************/ 26/****************** INCLUDE FILES SECTION ***********************************/
27 27
28#include <linux/module.h> 28#include <linux/module.h>
@@ -79,6 +79,8 @@ static const char i2c_name[] = "i2c";
79 79
80#define i2c_delay(usecs) udelay(usecs) 80#define i2c_delay(usecs) udelay(usecs)
81 81
82static DEFINE_SPINLOCK(i2c_lock); /* Protect directions etc */
83
82/****************** VARIABLE SECTION ************************************/ 84/****************** VARIABLE SECTION ************************************/
83 85
84static struct crisv32_iopin cris_i2c_clk; 86static struct crisv32_iopin cris_i2c_clk;
@@ -252,6 +254,7 @@ i2c_getack(void)
252 * generate ACK clock pulse 254 * generate ACK clock pulse
253 */ 255 */
254 i2c_clk(I2C_CLOCK_HIGH); 256 i2c_clk(I2C_CLOCK_HIGH);
257#if 0
255 /* 258 /*
256 * Use PORT PB instead of I2C 259 * Use PORT PB instead of I2C
257 * for input. (I2C not working) 260 * for input. (I2C not working)
@@ -264,6 +267,8 @@ i2c_getack(void)
264 i2c_data(1); 267 i2c_data(1);
265 i2c_disable(); 268 i2c_disable();
266 i2c_dir_in(); 269 i2c_dir_in();
270#endif
271
267 /* 272 /*
268 * now wait for ack 273 * now wait for ack
269 */ 274 */
@@ -271,11 +276,11 @@ i2c_getack(void)
271 /* 276 /*
272 * check for ack 277 * check for ack
273 */ 278 */
274 if(i2c_getbit()) 279 if (i2c_getbit())
275 ack = 0; 280 ack = 0;
276 i2c_delay(CLOCK_HIGH_TIME/2); 281 i2c_delay(CLOCK_HIGH_TIME/2);
277 if(!ack){ 282 if (!ack) {
278 if(!i2c_getbit()) /* receiver pulled SDA low */ 283 if (!i2c_getbit()) /* receiver pulld SDA low */
279 ack = 1; 284 ack = 1;
280 i2c_delay(CLOCK_HIGH_TIME/2); 285 i2c_delay(CLOCK_HIGH_TIME/2);
281 } 286 }
@@ -285,6 +290,7 @@ i2c_getack(void)
285 * before we enable our output. If we keep data high 290 * before we enable our output. If we keep data high
286 * and enable output, we would generate a stop condition. 291 * and enable output, we would generate a stop condition.
287 */ 292 */
293#if 0
288 i2c_data(I2C_DATA_LOW); 294 i2c_data(I2C_DATA_LOW);
289 295
290 /* 296 /*
@@ -292,6 +298,7 @@ i2c_getack(void)
292 */ 298 */
293 i2c_enable(); 299 i2c_enable();
294 i2c_dir_out(); 300 i2c_dir_out();
301#endif
295 i2c_clk(I2C_CLOCK_LOW); 302 i2c_clk(I2C_CLOCK_LOW);
296 i2c_delay(CLOCK_HIGH_TIME/4); 303 i2c_delay(CLOCK_HIGH_TIME/4);
297 /* 304 /*
@@ -375,6 +382,121 @@ i2c_sendnack(void)
375 382
376/*#--------------------------------------------------------------------------- 383/*#---------------------------------------------------------------------------
377*# 384*#
385*# FUNCTION NAME: i2c_write
386*#
387*# DESCRIPTION : Writes a value to an I2C device
388*#
389*#--------------------------------------------------------------------------*/
390int
391i2c_write(unsigned char theSlave, void *data, size_t nbytes)
392{
393 int error, cntr = 3;
394 unsigned char bytes_wrote = 0;
395 unsigned char value;
396 unsigned long flags;
397
398 spin_lock_irqsave(&i2c_lock, flags);
399
400 do {
401 error = 0;
402
403 i2c_start();
404 /*
405 * send slave address
406 */
407 i2c_outbyte((theSlave & 0xfe));
408 /*
409 * wait for ack
410 */
411 if (!i2c_getack())
412 error = 1;
413 /*
414 * send data
415 */
416 for (bytes_wrote = 0; bytes_wrote < nbytes; bytes_wrote++) {
417 memcpy(&value, data + bytes_wrote, sizeof value);
418 i2c_outbyte(value);
419 /*
420 * now it's time to wait for ack
421 */
422 if (!i2c_getack())
423 error |= 4;
424 }
425 /*
426 * end byte stream
427 */
428 i2c_stop();
429
430 } while (error && cntr--);
431
432 i2c_delay(CLOCK_LOW_TIME);
433
434 spin_unlock_irqrestore(&i2c_lock, flags);
435
436 return -error;
437}
438
439/*#---------------------------------------------------------------------------
440*#
441*# FUNCTION NAME: i2c_read
442*#
443*# DESCRIPTION : Reads a value from an I2C device
444*#
445*#--------------------------------------------------------------------------*/
446int
447i2c_read(unsigned char theSlave, void *data, size_t nbytes)
448{
449 unsigned char b = 0;
450 unsigned char bytes_read = 0;
451 int error, cntr = 3;
452 unsigned long flags;
453
454 spin_lock_irqsave(&i2c_lock, flags);
455
456 do {
457 error = 0;
458 memset(data, 0, nbytes);
459 /*
460 * generate start condition
461 */
462 i2c_start();
463 /*
464 * send slave address
465 */
466 i2c_outbyte((theSlave | 0x01));
467 /*
468 * wait for ack
469 */
470 if (!i2c_getack())
471 error = 1;
472 /*
473 * fetch data
474 */
475 for (bytes_read = 0; bytes_read < nbytes; bytes_read++) {
476 b = i2c_inbyte();
477 memcpy(data + bytes_read, &b, sizeof b);
478
479 if (bytes_read < (nbytes - 1))
480 i2c_sendack();
481 }
482 /*
483 * last received byte needs to be nacked
484 * instead of acked
485 */
486 i2c_sendnack();
487 /*
488 * end sequence
489 */
490 i2c_stop();
491 } while (error && cntr--);
492
493 spin_unlock_irqrestore(&i2c_lock, flags);
494
495 return -error;
496}
497
498/*#---------------------------------------------------------------------------
499*#
378*# FUNCTION NAME: i2c_writereg 500*# FUNCTION NAME: i2c_writereg
379*# 501*#
380*# DESCRIPTION : Writes a value to an I2C device 502*# DESCRIPTION : Writes a value to an I2C device
@@ -387,12 +509,10 @@ i2c_writereg(unsigned char theSlave, unsigned char theReg,
387 int error, cntr = 3; 509 int error, cntr = 3;
388 unsigned long flags; 510 unsigned long flags;
389 511
512 spin_lock_irqsave(&i2c_lock, flags);
513
390 do { 514 do {
391 error = 0; 515 error = 0;
392 /*
393 * we don't like to be interrupted
394 */
395 local_irq_save(flags);
396 516
397 i2c_start(); 517 i2c_start();
398 /* 518 /*
@@ -427,15 +547,12 @@ i2c_writereg(unsigned char theSlave, unsigned char theReg,
427 * end byte stream 547 * end byte stream
428 */ 548 */
429 i2c_stop(); 549 i2c_stop();
430 /*
431 * enable interrupt again
432 */
433 local_irq_restore(flags);
434
435 } while(error && cntr--); 550 } while(error && cntr--);
436 551
437 i2c_delay(CLOCK_LOW_TIME); 552 i2c_delay(CLOCK_LOW_TIME);
438 553
554 spin_unlock_irqrestore(&i2c_lock, flags);
555
439 return -error; 556 return -error;
440} 557}
441 558
@@ -453,13 +570,11 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
453 int error, cntr = 3; 570 int error, cntr = 3;
454 unsigned long flags; 571 unsigned long flags;
455 572
573 spin_lock_irqsave(&i2c_lock, flags);
574
456 do { 575 do {
457 error = 0; 576 error = 0;
458 /* 577 /*
459 * we don't like to be interrupted
460 */
461 local_irq_save(flags);
462 /*
463 * generate start condition 578 * generate start condition
464 */ 579 */
465 i2c_start(); 580 i2c_start();
@@ -482,7 +597,7 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
482 * now it's time to wait for ack 597 * now it's time to wait for ack
483 */ 598 */
484 if(!i2c_getack()) 599 if(!i2c_getack())
485 error = 1; 600 error |= 2;
486 /* 601 /*
487 * repeat start condition 602 * repeat start condition
488 */ 603 */
@@ -496,7 +611,7 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
496 * wait for ack 611 * wait for ack
497 */ 612 */
498 if(!i2c_getack()) 613 if(!i2c_getack())
499 error = 1; 614 error |= 4;
500 /* 615 /*
501 * fetch register 616 * fetch register
502 */ 617 */
@@ -510,13 +625,11 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
510 * end sequence 625 * end sequence
511 */ 626 */
512 i2c_stop(); 627 i2c_stop();
513 /*
514 * enable interrupt again
515 */
516 local_irq_restore(flags);
517 628
518 } while(error && cntr--); 629 } while(error && cntr--);
519 630
631 spin_unlock_irqrestore(&i2c_lock, flags);
632
520 return b; 633 return b;
521} 634}
522 635
@@ -540,7 +653,7 @@ i2c_ioctl(struct inode *inode, struct file *file,
540 unsigned int cmd, unsigned long arg) 653 unsigned int cmd, unsigned long arg)
541{ 654{
542 if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) { 655 if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) {
543 return -EINVAL; 656 return -ENOTTY;
544 } 657 }
545 658
546 switch (_IOC_NR(cmd)) { 659 switch (_IOC_NR(cmd)) {
@@ -580,31 +693,52 @@ static const struct file_operations i2c_fops = {
580 .release = i2c_release, 693 .release = i2c_release,
581}; 694};
582 695
583int __init 696static int __init i2c_init(void)
584i2c_init(void)
585{ 697{
586 int res; 698 static int res;
699 static int first = 1;
587 700
588 /* Setup and enable the Port B I2C interface */ 701 if (!first)
702 return res;
589 703
590 crisv32_io_get_name(&cris_i2c_data, CONFIG_ETRAX_I2C_DATA_PORT); 704 first = 0;
591 crisv32_io_get_name(&cris_i2c_clk, CONFIG_ETRAX_I2C_CLK_PORT); 705
706 /* Setup and enable the DATA and CLK pins */
707
708 res = crisv32_io_get_name(&cris_i2c_data,
709 CONFIG_ETRAX_V32_I2C_DATA_PORT);
710 if (res < 0)
711 return res;
712
713 res = crisv32_io_get_name(&cris_i2c_clk, CONFIG_ETRAX_V32_I2C_CLK_PORT);
714 crisv32_io_set_dir(&cris_i2c_clk, crisv32_io_dir_out);
715
716 return res;
717}
718
719
720static int __init i2c_register(void)
721{
722 int res;
723
724 res = i2c_init();
725 if (res < 0)
726 return res;
592 727
593 /* register char device */ 728 /* register char device */
594 729
595 res = register_chrdev(I2C_MAJOR, i2c_name, &i2c_fops); 730 res = register_chrdev(I2C_MAJOR, i2c_name, &i2c_fops);
596 if(res < 0) { 731 if (res < 0) {
597 printk(KERN_ERR "i2c: couldn't get a major number.\n"); 732 printk(KERN_ERR "i2c: couldn't get a major number.\n");
598 return res; 733 return res;
599 } 734 }
600 735
601 printk(KERN_INFO "I2C driver v2.2, (c) 1999-2001 Axis Communications AB\n"); 736 printk(KERN_INFO
737 "I2C driver v2.2, (c) 1999-2007 Axis Communications AB\n");
602 738
603 return 0; 739 return 0;
604} 740}
605
606/* this makes sure that i2c_init is called during boot */ 741/* this makes sure that i2c_init is called during boot */
607 742module_init(i2c_register);
608module_init(i2c_init);
609 743
610/****************** END OF FILE i2c.c ********************************/ 744/****************** END OF FILE i2c.c ********************************/
diff --git a/arch/cris/arch-v32/drivers/i2c.h b/arch/cris/arch-v32/drivers/i2c.h
index bfe1a13f9f35..c073cf4ba016 100644
--- a/arch/cris/arch-v32/drivers/i2c.h
+++ b/arch/cris/arch-v32/drivers/i2c.h
@@ -3,6 +3,8 @@
3 3
4/* High level I2C actions */ 4/* High level I2C actions */
5int __init i2c_init(void); 5int __init i2c_init(void);
6int i2c_write(unsigned char theSlave, void *data, size_t nbytes);
7int i2c_read(unsigned char theSlave, void *data, size_t nbytes);
6int i2c_writereg(unsigned char theSlave, unsigned char theReg, unsigned char theValue); 8int i2c_writereg(unsigned char theSlave, unsigned char theReg, unsigned char theValue);
7unsigned char i2c_readreg(unsigned char theSlave, unsigned char theReg); 9unsigned char i2c_readreg(unsigned char theSlave, unsigned char theReg);
8 10
diff --git a/arch/cris/arch-v32/drivers/iop_fw_load.c b/arch/cris/arch-v32/drivers/iop_fw_load.c
index f4bdc1dfa320..3b3857ec1f15 100644
--- a/arch/cris/arch-v32/drivers/iop_fw_load.c
+++ b/arch/cris/arch-v32/drivers/iop_fw_load.c
@@ -1,5 +1,4 @@
1/* $Id: iop_fw_load.c,v 1.4 2005/04/07 09:27:46 larsv Exp $ 1/*
2 *
3 * Firmware loader for ETRAX FS IO-Processor 2 * Firmware loader for ETRAX FS IO-Processor
4 * 3 *
5 * Copyright (C) 2004 Axis Communications AB 4 * Copyright (C) 2004 Axis Communications AB
@@ -11,12 +10,13 @@
11#include <linux/device.h> 10#include <linux/device.h>
12#include <linux/firmware.h> 11#include <linux/firmware.h>
13 12
14#include <asm/arch/hwregs/reg_map.h> 13#include <hwregs/reg_rdwr.h>
15#include <asm/arch/hwregs/iop/iop_reg_space.h> 14#include <hwregs/reg_map.h>
16#include <asm/arch/hwregs/iop/iop_mpu_macros.h> 15#include <hwregs/iop/iop_reg_space.h>
17#include <asm/arch/hwregs/iop/iop_mpu_defs.h> 16#include <hwregs/iop/iop_mpu_macros.h>
18#include <asm/arch/hwregs/iop/iop_spu_defs.h> 17#include <hwregs/iop/iop_mpu_defs.h>
19#include <asm/arch/hwregs/iop/iop_sw_cpu_defs.h> 18#include <hwregs/iop/iop_spu_defs.h>
19#include <hwregs/iop/iop_sw_cpu_defs.h>
20 20
21#define IOP_TIMEOUT 100 21#define IOP_TIMEOUT 100
22 22
diff --git a/arch/cris/arch-v32/drivers/mach-a3/Makefile b/arch/cris/arch-v32/drivers/mach-a3/Makefile
new file mode 100644
index 000000000000..5c6d2a2a080e
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/mach-a3/Makefile
@@ -0,0 +1,6 @@
1#
2# Makefile for Etrax-specific drivers
3#
4
5obj-$(CONFIG_ETRAX_NANDFLASH) += nandflash.o
6obj-$(CONFIG_ETRAX_GPIO) += gpio.o
diff --git a/arch/cris/arch-v32/drivers/mach-a3/gpio.c b/arch/cris/arch-v32/drivers/mach-a3/gpio.c
new file mode 100644
index 000000000000..de107dad9f4f
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/mach-a3/gpio.c
@@ -0,0 +1,984 @@
1/*
2 * Artec-3 general port I/O device
3 *
4 * Copyright (c) 2007 Axis Communications AB
5 *
6 * Authors: Bjorn Wesen (initial version)
7 * Ola Knutsson (LED handling)
8 * Johan Adolfsson (read/set directions, write, port G,
9 * port to ETRAX FS.
10 * Ricard Wanderlof (PWM for Artpec-3)
11 *
12 */
13
14#include <linux/module.h>
15#include <linux/sched.h>
16#include <linux/slab.h>
17#include <linux/ioport.h>
18#include <linux/errno.h>
19#include <linux/kernel.h>
20#include <linux/fs.h>
21#include <linux/string.h>
22#include <linux/poll.h>
23#include <linux/init.h>
24#include <linux/interrupt.h>
25#include <linux/spinlock.h>
26
27#include <asm/etraxgpio.h>
28#include <hwregs/reg_map.h>
29#include <hwregs/reg_rdwr.h>
30#include <hwregs/gio_defs.h>
31#include <hwregs/intr_vect_defs.h>
32#include <asm/io.h>
33#include <asm/system.h>
34#include <asm/irq.h>
35#include <asm/arch/mach/pinmux.h>
36
37#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
38#include "../i2c.h"
39
40#define VIRT_I2C_ADDR 0x40
41#endif
42
43/* The following gio ports on ARTPEC-3 is available:
44 * pa 32 bits
45 * pb 32 bits
46 * pc 16 bits
47 * each port has a rw_px_dout, r_px_din and rw_px_oe register.
48 */
49
50#define GPIO_MAJOR 120 /* experimental MAJOR number */
51
52#define I2C_INTERRUPT_BITS 0x300 /* i2c0_done and i2c1_done bits */
53
54#define D(x)
55
56#if 0
57static int dp_cnt;
58#define DP(x) \
59 do { \
60 dp_cnt++; \
61 if (dp_cnt % 1000 == 0) \
62 x; \
63 } while (0)
64#else
65#define DP(x)
66#endif
67
68static char gpio_name[] = "etrax gpio";
69
70#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
71static int virtual_gpio_ioctl(struct file *file, unsigned int cmd,
72 unsigned long arg);
73#endif
74static int gpio_ioctl(struct inode *inode, struct file *file,
75 unsigned int cmd, unsigned long arg);
76static ssize_t gpio_write(struct file *file, const char __user *buf,
77 size_t count, loff_t *off);
78static int gpio_open(struct inode *inode, struct file *filp);
79static int gpio_release(struct inode *inode, struct file *filp);
80static unsigned int gpio_poll(struct file *filp,
81 struct poll_table_struct *wait);
82
83/* private data per open() of this driver */
84
85struct gpio_private {
86 struct gpio_private *next;
87 /* The IO_CFG_WRITE_MODE_VALUE only support 8 bits: */
88 unsigned char clk_mask;
89 unsigned char data_mask;
90 unsigned char write_msb;
91 unsigned char pad1;
92 /* These fields are generic */
93 unsigned long highalarm, lowalarm;
94 wait_queue_head_t alarm_wq;
95 int minor;
96};
97
98static void gpio_set_alarm(struct gpio_private *priv);
99static int gpio_leds_ioctl(unsigned int cmd, unsigned long arg);
100static int gpio_pwm_ioctl(struct gpio_private *priv, unsigned int cmd,
101 unsigned long arg);
102
103
104/* linked list of alarms to check for */
105
106static struct gpio_private *alarmlist;
107
108static int wanted_interrupts;
109
110static DEFINE_SPINLOCK(gpio_lock);
111
112#define NUM_PORTS (GPIO_MINOR_LAST+1)
113#define GIO_REG_RD_ADDR(reg) \
114 (unsigned long *)(regi_gio + REG_RD_ADDR_gio_##reg)
115#define GIO_REG_WR_ADDR(reg) \
116 (unsigned long *)(regi_gio + REG_WR_ADDR_gio_##reg)
117static unsigned long led_dummy;
118static unsigned long port_d_dummy; /* Only input on Artpec-3 */
119#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
120static unsigned long port_e_dummy; /* Non existent on Artpec-3 */
121static unsigned long virtual_dummy;
122static unsigned long virtual_rw_pv_oe = CONFIG_ETRAX_DEF_GIO_PV_OE;
123static unsigned short cached_virtual_gpio_read;
124#endif
125
126static unsigned long *data_out[NUM_PORTS] = {
127 GIO_REG_WR_ADDR(rw_pa_dout),
128 GIO_REG_WR_ADDR(rw_pb_dout),
129 &led_dummy,
130 GIO_REG_WR_ADDR(rw_pc_dout),
131 &port_d_dummy,
132#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
133 &port_e_dummy,
134 &virtual_dummy,
135#endif
136};
137
138static unsigned long *data_in[NUM_PORTS] = {
139 GIO_REG_RD_ADDR(r_pa_din),
140 GIO_REG_RD_ADDR(r_pb_din),
141 &led_dummy,
142 GIO_REG_RD_ADDR(r_pc_din),
143 GIO_REG_RD_ADDR(r_pd_din),
144#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
145 &port_e_dummy,
146 &virtual_dummy,
147#endif
148};
149
150static unsigned long changeable_dir[NUM_PORTS] = {
151 CONFIG_ETRAX_PA_CHANGEABLE_DIR,
152 CONFIG_ETRAX_PB_CHANGEABLE_DIR,
153 0,
154 CONFIG_ETRAX_PC_CHANGEABLE_DIR,
155 0,
156#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
157 0,
158 CONFIG_ETRAX_PV_CHANGEABLE_DIR,
159#endif
160};
161
162static unsigned long changeable_bits[NUM_PORTS] = {
163 CONFIG_ETRAX_PA_CHANGEABLE_BITS,
164 CONFIG_ETRAX_PB_CHANGEABLE_BITS,
165 0,
166 CONFIG_ETRAX_PC_CHANGEABLE_BITS,
167 0,
168#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
169 0,
170 CONFIG_ETRAX_PV_CHANGEABLE_BITS,
171#endif
172};
173
174static unsigned long *dir_oe[NUM_PORTS] = {
175 GIO_REG_WR_ADDR(rw_pa_oe),
176 GIO_REG_WR_ADDR(rw_pb_oe),
177 &led_dummy,
178 GIO_REG_WR_ADDR(rw_pc_oe),
179 &port_d_dummy,
180#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
181 &port_e_dummy,
182 &virtual_rw_pv_oe,
183#endif
184};
185
186static void gpio_set_alarm(struct gpio_private *priv)
187{
188 int bit;
189 int intr_cfg;
190 int mask;
191 int pins;
192 unsigned long flags;
193
194 spin_lock_irqsave(&gpio_lock, flags);
195 intr_cfg = REG_RD_INT(gio, regi_gio, rw_intr_cfg);
196 pins = REG_RD_INT(gio, regi_gio, rw_intr_pins);
197 mask = REG_RD_INT(gio, regi_gio, rw_intr_mask) & I2C_INTERRUPT_BITS;
198
199 for (bit = 0; bit < 32; bit++) {
200 int intr = bit % 8;
201 int pin = bit / 8;
202 if (priv->minor < GPIO_MINOR_LEDS)
203 pin += priv->minor * 4;
204 else
205 pin += (priv->minor - 1) * 4;
206
207 if (priv->highalarm & (1<<bit)) {
208 intr_cfg |= (regk_gio_hi << (intr * 3));
209 mask |= 1 << intr;
210 wanted_interrupts = mask & 0xff;
211 pins |= pin << (intr * 4);
212 } else if (priv->lowalarm & (1<<bit)) {
213 intr_cfg |= (regk_gio_lo << (intr * 3));
214 mask |= 1 << intr;
215 wanted_interrupts = mask & 0xff;
216 pins |= pin << (intr * 4);
217 }
218 }
219
220 REG_WR_INT(gio, regi_gio, rw_intr_cfg, intr_cfg);
221 REG_WR_INT(gio, regi_gio, rw_intr_pins, pins);
222 REG_WR_INT(gio, regi_gio, rw_intr_mask, mask);
223
224 spin_unlock_irqrestore(&gpio_lock, flags);
225}
226
227static unsigned int gpio_poll(struct file *file, struct poll_table_struct *wait)
228{
229 unsigned int mask = 0;
230 struct gpio_private *priv = file->private_data;
231 unsigned long data;
232 unsigned long tmp;
233
234 if (priv->minor >= GPIO_MINOR_PWM0 &&
235 priv->minor <= GPIO_MINOR_LAST_PWM)
236 return 0;
237
238 poll_wait(file, &priv->alarm_wq, wait);
239 if (priv->minor <= GPIO_MINOR_D) {
240 data = readl(data_in[priv->minor]);
241 REG_WR_INT(gio, regi_gio, rw_ack_intr, wanted_interrupts);
242 tmp = REG_RD_INT(gio, regi_gio, rw_intr_mask);
243 tmp &= I2C_INTERRUPT_BITS;
244 tmp |= wanted_interrupts;
245 REG_WR_INT(gio, regi_gio, rw_intr_mask, tmp);
246 } else
247 return 0;
248
249 if ((data & priv->highalarm) || (~data & priv->lowalarm))
250 mask = POLLIN|POLLRDNORM;
251
252 DP(printk(KERN_DEBUG "gpio_poll ready: mask 0x%08X\n", mask));
253 return mask;
254}
255
256static irqreturn_t gpio_interrupt(int irq, void *dev_id)
257{
258 reg_gio_rw_intr_mask intr_mask;
259 reg_gio_r_masked_intr masked_intr;
260 reg_gio_rw_ack_intr ack_intr;
261 unsigned long flags;
262 unsigned long tmp;
263 unsigned long tmp2;
264#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
265 unsigned char enable_gpiov_ack = 0;
266#endif
267
268 /* Find what PA interrupts are active */
269 masked_intr = REG_RD(gio, regi_gio, r_masked_intr);
270 tmp = REG_TYPE_CONV(unsigned long, reg_gio_r_masked_intr, masked_intr);
271
272 /* Find those that we have enabled */
273 spin_lock_irqsave(&gpio_lock, flags);
274 tmp &= wanted_interrupts;
275 spin_unlock_irqrestore(&gpio_lock, flags);
276
277#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
278 /* Something changed on virtual GPIO. Interrupt is acked by
279 * reading the device.
280 */
281 if (tmp & (1 << CONFIG_ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN)) {
282 i2c_read(VIRT_I2C_ADDR, (void *)&cached_virtual_gpio_read,
283 sizeof(cached_virtual_gpio_read));
284 enable_gpiov_ack = 1;
285 }
286#endif
287
288 /* Ack them */
289 ack_intr = REG_TYPE_CONV(reg_gio_rw_ack_intr, unsigned long, tmp);
290 REG_WR(gio, regi_gio, rw_ack_intr, ack_intr);
291
292 /* Disable those interrupts.. */
293 intr_mask = REG_RD(gio, regi_gio, rw_intr_mask);
294 tmp2 = REG_TYPE_CONV(unsigned long, reg_gio_rw_intr_mask, intr_mask);
295 tmp2 &= ~tmp;
296#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
297 /* Do not disable interrupt on virtual GPIO. Changes on virtual
298 * pins are only noticed by an interrupt.
299 */
300 if (enable_gpiov_ack)
301 tmp2 |= (1 << CONFIG_ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN);
302#endif
303 intr_mask = REG_TYPE_CONV(reg_gio_rw_intr_mask, unsigned long, tmp2);
304 REG_WR(gio, regi_gio, rw_intr_mask, intr_mask);
305
306 return IRQ_RETVAL(tmp);
307}
308
309static void gpio_write_bit(unsigned long *port, unsigned char data, int bit,
310 unsigned char clk_mask, unsigned char data_mask)
311{
312 unsigned long shadow = readl(port) & ~clk_mask;
313 writel(shadow, port);
314 if (data & 1 << bit)
315 shadow |= data_mask;
316 else
317 shadow &= ~data_mask;
318 writel(shadow, port);
319 /* For FPGA: min 5.0ns (DCC) before CCLK high */
320 shadow |= clk_mask;
321 writel(shadow, port);
322}
323
324static void gpio_write_byte(struct gpio_private *priv, unsigned long *port,
325 unsigned char data)
326{
327 int i;
328
329 if (priv->write_msb)
330 for (i = 7; i >= 0; i--)
331 gpio_write_bit(port, data, i, priv->clk_mask,
332 priv->data_mask);
333 else
334 for (i = 0; i <= 7; i++)
335 gpio_write_bit(port, data, i, priv->clk_mask,
336 priv->data_mask);
337}
338
339
340static ssize_t gpio_write(struct file *file, const char __user *buf,
341 size_t count, loff_t *off)
342{
343 struct gpio_private *priv = file->private_data;
344 unsigned long flags;
345 ssize_t retval = count;
346 /* Only bits 0-7 may be used for write operations but allow all
347 devices except leds... */
348#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
349 if (priv->minor == GPIO_MINOR_V)
350 return -EFAULT;
351#endif
352 if (priv->minor == GPIO_MINOR_LEDS)
353 return -EFAULT;
354
355 if (priv->minor >= GPIO_MINOR_PWM0 &&
356 priv->minor <= GPIO_MINOR_LAST_PWM)
357 return -EFAULT;
358
359 if (!access_ok(VERIFY_READ, buf, count))
360 return -EFAULT;
361
362 /* It must have been configured using the IO_CFG_WRITE_MODE */
363 /* Perhaps a better error code? */
364 if (priv->clk_mask == 0 || priv->data_mask == 0)
365 return -EPERM;
366
367 D(printk(KERN_DEBUG "gpio_write: %lu to data 0x%02X clk 0x%02X "
368 "msb: %i\n",
369 count, priv->data_mask, priv->clk_mask, priv->write_msb));
370
371 spin_lock_irqsave(&gpio_lock, flags);
372
373 while (count--)
374 gpio_write_byte(priv, data_out[priv->minor], *buf++);
375
376 spin_unlock_irqrestore(&gpio_lock, flags);
377 return retval;
378}
379
380static int gpio_open(struct inode *inode, struct file *filp)
381{
382 struct gpio_private *priv;
383 int p = iminor(inode);
384
385 if (p > GPIO_MINOR_LAST_PWM ||
386 (p > GPIO_MINOR_LAST && p < GPIO_MINOR_PWM0))
387 return -EINVAL;
388
389 priv = kmalloc(sizeof(struct gpio_private), GFP_KERNEL);
390
391 if (!priv)
392 return -ENOMEM;
393 memset(priv, 0, sizeof(*priv));
394
395 priv->minor = p;
396 filp->private_data = priv;
397
398 /* initialize the io/alarm struct, not for PWM ports though */
399 if (p <= GPIO_MINOR_LAST) {
400
401 priv->clk_mask = 0;
402 priv->data_mask = 0;
403 priv->highalarm = 0;
404 priv->lowalarm = 0;
405
406 init_waitqueue_head(&priv->alarm_wq);
407
408 /* link it into our alarmlist */
409 spin_lock_irq(&gpio_lock);
410 priv->next = alarmlist;
411 alarmlist = priv;
412 spin_unlock_irq(&gpio_lock);
413 }
414
415 return 0;
416}
417
418static int gpio_release(struct inode *inode, struct file *filp)
419{
420 struct gpio_private *p;
421 struct gpio_private *todel;
422 /* local copies while updating them: */
423 unsigned long a_high, a_low;
424
425 /* prepare to free private structure */
426 todel = filp->private_data;
427
428 /* unlink from alarmlist - only for non-PWM ports though */
429 if (todel->minor <= GPIO_MINOR_LAST) {
430 spin_lock_irq(&gpio_lock);
431 p = alarmlist;
432
433 if (p == todel)
434 alarmlist = todel->next;
435 else {
436 while (p->next != todel)
437 p = p->next;
438 p->next = todel->next;
439 }
440
441 /* Check if there are still any alarms set */
442 p = alarmlist;
443 a_high = 0;
444 a_low = 0;
445 while (p) {
446 if (p->minor == GPIO_MINOR_A) {
447#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
448 p->lowalarm |= (1 << CONFIG_ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN);
449#endif
450 a_high |= p->highalarm;
451 a_low |= p->lowalarm;
452 }
453
454 p = p->next;
455 }
456
457#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
458 /* Variable 'a_low' needs to be set here again
459 * to ensure that interrupt for virtual GPIO is handled.
460 */
461 a_low |= (1 << CONFIG_ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN);
462#endif
463
464 spin_unlock_irq(&gpio_lock);
465 }
466 kfree(todel);
467
468 return 0;
469}
470
471/* Main device API. ioctl's to read/set/clear bits, as well as to
472 * set alarms to wait for using a subsequent select().
473 */
474
475inline unsigned long setget_input(struct gpio_private *priv, unsigned long arg)
476{
477 /* Set direction 0=unchanged 1=input,
478 * return mask with 1=input
479 */
480 unsigned long flags;
481 unsigned long dir_shadow;
482
483 spin_lock_irqsave(&gpio_lock, flags);
484
485 dir_shadow = readl(dir_oe[priv->minor]) &
486 ~(arg & changeable_dir[priv->minor]);
487 writel(dir_shadow, dir_oe[priv->minor]);
488
489 spin_unlock_irqrestore(&gpio_lock, flags);
490
491 if (priv->minor == GPIO_MINOR_C)
492 dir_shadow ^= 0xFFFF; /* Only 16 bits */
493#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
494 else if (priv->minor == GPIO_MINOR_V)
495 dir_shadow ^= 0xFFFF; /* Only 16 bits */
496#endif
497 else
498 dir_shadow ^= 0xFFFFFFFF; /* PA, PB and PD 32 bits */
499
500 return dir_shadow;
501
502} /* setget_input */
503
504static inline unsigned long setget_output(struct gpio_private *priv,
505 unsigned long arg)
506{
507 unsigned long flags;
508 unsigned long dir_shadow;
509
510 spin_lock_irqsave(&gpio_lock, flags);
511
512 dir_shadow = readl(dir_oe[priv->minor]) |
513 (arg & changeable_dir[priv->minor]);
514 writel(dir_shadow, dir_oe[priv->minor]);
515
516 spin_unlock_irqrestore(&gpio_lock, flags);
517 return dir_shadow;
518} /* setget_output */
519
520static int gpio_ioctl(struct inode *inode, struct file *file,
521 unsigned int cmd, unsigned long arg)
522{
523 unsigned long flags;
524 unsigned long val;
525 unsigned long shadow;
526 struct gpio_private *priv = file->private_data;
527
528 if (_IOC_TYPE(cmd) != ETRAXGPIO_IOCTYPE)
529 return -ENOTTY;
530
531 /* Check for special ioctl handlers first */
532
533#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
534 if (priv->minor == GPIO_MINOR_V)
535 return virtual_gpio_ioctl(file, cmd, arg);
536#endif
537
538 if (priv->minor == GPIO_MINOR_LEDS)
539 return gpio_leds_ioctl(cmd, arg);
540
541 if (priv->minor >= GPIO_MINOR_PWM0 &&
542 priv->minor <= GPIO_MINOR_LAST_PWM)
543 return gpio_pwm_ioctl(priv, cmd, arg);
544
545 switch (_IOC_NR(cmd)) {
546 case IO_READBITS: /* Use IO_READ_INBITS and IO_READ_OUTBITS instead */
547 /* Read the port. */
548 return readl(data_in[priv->minor]);
549 case IO_SETBITS:
550 spin_lock_irqsave(&gpio_lock, flags);
551 /* Set changeable bits with a 1 in arg. */
552 shadow = readl(data_out[priv->minor]) |
553 (arg & changeable_bits[priv->minor]);
554 writel(shadow, data_out[priv->minor]);
555 spin_unlock_irqrestore(&gpio_lock, flags);
556 break;
557 case IO_CLRBITS:
558 spin_lock_irqsave(&gpio_lock, flags);
559 /* Clear changeable bits with a 1 in arg. */
560 shadow = readl(data_out[priv->minor]) &
561 ~(arg & changeable_bits[priv->minor]);
562 writel(shadow, data_out[priv->minor]);
563 spin_unlock_irqrestore(&gpio_lock, flags);
564 break;
565 case IO_HIGHALARM:
566 /* Set alarm when bits with 1 in arg go high. */
567 priv->highalarm |= arg;
568 gpio_set_alarm(priv);
569 break;
570 case IO_LOWALARM:
571 /* Set alarm when bits with 1 in arg go low. */
572 priv->lowalarm |= arg;
573 gpio_set_alarm(priv);
574 break;
575 case IO_CLRALARM:
576 /* Clear alarm for bits with 1 in arg. */
577 priv->highalarm &= ~arg;
578 priv->lowalarm &= ~arg;
579 gpio_set_alarm(priv);
580 break;
581 case IO_READDIR: /* Use IO_SETGET_INPUT/OUTPUT instead! */
582 /* Read direction 0=input 1=output */
583 return readl(dir_oe[priv->minor]);
584
585 case IO_SETINPUT: /* Use IO_SETGET_INPUT instead! */
586 /* Set direction 0=unchanged 1=input,
587 * return mask with 1=input
588 */
589 return setget_input(priv, arg);
590
591 case IO_SETOUTPUT: /* Use IO_SETGET_OUTPUT instead! */
592 /* Set direction 0=unchanged 1=output,
593 * return mask with 1=output
594 */
595 return setget_output(priv, arg);
596
597 case IO_CFG_WRITE_MODE:
598 {
599 int res = -EPERM;
600 unsigned long dir_shadow, clk_mask, data_mask, write_msb;
601
602 clk_mask = arg & 0xFF;
603 data_mask = (arg >> 8) & 0xFF;
604 write_msb = (arg >> 16) & 0x01;
605
606 /* Check if we're allowed to change the bits and
607 * the direction is correct
608 */
609 spin_lock_irqsave(&gpio_lock, flags);
610 dir_shadow = readl(dir_oe[priv->minor]);
611 if ((clk_mask & changeable_bits[priv->minor]) &&
612 (data_mask & changeable_bits[priv->minor]) &&
613 (clk_mask & dir_shadow) &&
614 (data_mask & dir_shadow)) {
615 priv->clk_mask = clk_mask;
616 priv->data_mask = data_mask;
617 priv->write_msb = write_msb;
618 res = 0;
619 }
620 spin_unlock_irqrestore(&gpio_lock, flags);
621
622 return res;
623 }
624 case IO_READ_INBITS:
625 /* *arg is result of reading the input pins */
626 val = readl(data_in[priv->minor]);
627 if (copy_to_user((void __user *)arg, &val, sizeof(val)))
628 return -EFAULT;
629 return 0;
630 case IO_READ_OUTBITS:
631 /* *arg is result of reading the output shadow */
632 val = *data_out[priv->minor];
633 if (copy_to_user((void __user *)arg, &val, sizeof(val)))
634 return -EFAULT;
635 break;
636 case IO_SETGET_INPUT:
637 /* bits set in *arg is set to input,
638 * *arg updated with current input pins.
639 */
640 if (copy_from_user(&val, (void __user *)arg, sizeof(val)))
641 return -EFAULT;
642 val = setget_input(priv, val);
643 if (copy_to_user((void __user *)arg, &val, sizeof(val)))
644 return -EFAULT;
645 break;
646 case IO_SETGET_OUTPUT:
647 /* bits set in *arg is set to output,
648 * *arg updated with current output pins.
649 */
650 if (copy_from_user(&val, (void __user *)arg, sizeof(val)))
651 return -EFAULT;
652 val = setget_output(priv, val);
653 if (copy_to_user((void __user *)arg, &val, sizeof(val)))
654 return -EFAULT;
655 break;
656 default:
657 return -EINVAL;
658 } /* switch */
659
660 return 0;
661}
662
663#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
664static int virtual_gpio_ioctl(struct file *file, unsigned int cmd,
665 unsigned long arg)
666{
667 unsigned long flags;
668 unsigned short val;
669 unsigned short shadow;
670 struct gpio_private *priv = file->private_data;
671
672 switch (_IOC_NR(cmd)) {
673 case IO_SETBITS:
674 spin_lock_irqsave(&gpio_lock, flags);
675 /* Set changeable bits with a 1 in arg. */
676 i2c_read(VIRT_I2C_ADDR, (void *)&shadow, sizeof(shadow));
677 shadow |= ~readl(dir_oe[priv->minor]) |
678 (arg & changeable_bits[priv->minor]);
679 i2c_write(VIRT_I2C_ADDR, (void *)&shadow, sizeof(shadow));
680 spin_lock_irqrestore(&gpio_lock, flags);
681 break;
682 case IO_CLRBITS:
683 spin_lock_irqsave(&gpio_lock, flags);
684 /* Clear changeable bits with a 1 in arg. */
685 i2c_read(VIRT_I2C_ADDR, (void *)&shadow, sizeof(shadow));
686 shadow |= ~readl(dir_oe[priv->minor]) &
687 ~(arg & changeable_bits[priv->minor]);
688 i2c_write(VIRT_I2C_ADDR, (void *)&shadow, sizeof(shadow));
689 spin_lock_irqrestore(&gpio_lock, flags);
690 break;
691 case IO_HIGHALARM:
692 /* Set alarm when bits with 1 in arg go high. */
693 priv->highalarm |= arg;
694 break;
695 case IO_LOWALARM:
696 /* Set alarm when bits with 1 in arg go low. */
697 priv->lowalarm |= arg;
698 break;
699 case IO_CLRALARM:
700 /* Clear alarm for bits with 1 in arg. */
701 priv->highalarm &= ~arg;
702 priv->lowalarm &= ~arg;
703 break;
704 case IO_CFG_WRITE_MODE:
705 {
706 unsigned long dir_shadow;
707 dir_shadow = readl(dir_oe[priv->minor]);
708
709 priv->clk_mask = arg & 0xFF;
710 priv->data_mask = (arg >> 8) & 0xFF;
711 priv->write_msb = (arg >> 16) & 0x01;
712 /* Check if we're allowed to change the bits and
713 * the direction is correct
714 */
715 if (!((priv->clk_mask & changeable_bits[priv->minor]) &&
716 (priv->data_mask & changeable_bits[priv->minor]) &&
717 (priv->clk_mask & dir_shadow) &&
718 (priv->data_mask & dir_shadow))) {
719 priv->clk_mask = 0;
720 priv->data_mask = 0;
721 return -EPERM;
722 }
723 break;
724 }
725 case IO_READ_INBITS:
726 /* *arg is result of reading the input pins */
727 val = cached_virtual_gpio_read & ~readl(dir_oe[priv->minor]);
728 if (copy_to_user((void __user *)arg, &val, sizeof(val)))
729 return -EFAULT;
730 return 0;
731
732 case IO_READ_OUTBITS:
733 /* *arg is result of reading the output shadow */
734 i2c_read(VIRT_I2C_ADDR, (void *)&val, sizeof(val));
735 val &= readl(dir_oe[priv->minor]);
736 if (copy_to_user((void __user *)arg, &val, sizeof(val)))
737 return -EFAULT;
738 break;
739 case IO_SETGET_INPUT:
740 {
741 /* bits set in *arg is set to input,
742 * *arg updated with current input pins.
743 */
744 unsigned short input_mask = ~readl(dir_oe[priv->minor]);
745 if (copy_from_user(&val, (void __user *)arg, sizeof(val)))
746 return -EFAULT;
747 val = setget_input(priv, val);
748 if (copy_to_user((void __user *)arg, &val, sizeof(val)))
749 return -EFAULT;
750 if ((input_mask & val) != input_mask) {
751 /* Input pins changed. All ports desired as input
752 * should be set to logic 1.
753 */
754 unsigned short change = input_mask ^ val;
755 i2c_read(VIRT_I2C_ADDR, (void *)&shadow,
756 sizeof(shadow));
757 shadow &= ~change;
758 shadow |= val;
759 i2c_write(VIRT_I2C_ADDR, (void *)&shadow,
760 sizeof(shadow));
761 }
762 break;
763 }
764 case IO_SETGET_OUTPUT:
765 /* bits set in *arg is set to output,
766 * *arg updated with current output pins.
767 */
768 if (copy_from_user(&val, (void __user *)arg, sizeof(val)))
769 return -EFAULT;
770 val = setget_output(priv, val);
771 if (copy_to_user((void __user *)arg, &val, sizeof(val)))
772 return -EFAULT;
773 break;
774 default:
775 return -EINVAL;
776 } /* switch */
777 return 0;
778}
779#endif /* CONFIG_ETRAX_VIRTUAL_GPIO */
780
781static int gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
782{
783 unsigned char green;
784 unsigned char red;
785
786 switch (_IOC_NR(cmd)) {
787 case IO_LEDACTIVE_SET:
788 green = ((unsigned char) arg) & 1;
789 red = (((unsigned char) arg) >> 1) & 1;
790 CRIS_LED_ACTIVE_SET_G(green);
791 CRIS_LED_ACTIVE_SET_R(red);
792 break;
793
794 default:
795 return -EINVAL;
796 } /* switch */
797
798 return 0;
799}
800
801static int gpio_pwm_set_mode(unsigned long arg, int pwm_port)
802{
803 int pinmux_pwm = pinmux_pwm0 + pwm_port;
804 int mode;
805 reg_gio_rw_pwm0_ctrl rw_pwm_ctrl = {
806 .ccd_val = 0,
807 .ccd_override = regk_gio_no,
808 .mode = regk_gio_no
809 };
810 int allocstatus;
811
812 if (get_user(mode, &((struct io_pwm_set_mode *) arg)->mode))
813 return -EFAULT;
814 rw_pwm_ctrl.mode = mode;
815 if (mode != PWM_OFF)
816 allocstatus = crisv32_pinmux_alloc_fixed(pinmux_pwm);
817 else
818 allocstatus = crisv32_pinmux_dealloc_fixed(pinmux_pwm);
819 if (allocstatus)
820 return allocstatus;
821 REG_WRITE(reg_gio_rw_pwm0_ctrl, REG_ADDR(gio, regi_gio, rw_pwm0_ctrl) +
822 12 * pwm_port, rw_pwm_ctrl);
823 return 0;
824}
825
826static int gpio_pwm_set_period(unsigned long arg, int pwm_port)
827{
828 struct io_pwm_set_period periods;
829 reg_gio_rw_pwm0_var rw_pwm_widths;
830
831 if (copy_from_user(&periods, (void __user *)arg, sizeof(periods)))
832 return -EFAULT;
833 if (periods.lo > 8191 || periods.hi > 8191)
834 return -EINVAL;
835 rw_pwm_widths.lo = periods.lo;
836 rw_pwm_widths.hi = periods.hi;
837 REG_WRITE(reg_gio_rw_pwm0_var, REG_ADDR(gio, regi_gio, rw_pwm0_var) +
838 12 * pwm_port, rw_pwm_widths);
839 return 0;
840}
841
842static int gpio_pwm_set_duty(unsigned long arg, int pwm_port)
843{
844 unsigned int duty;
845 reg_gio_rw_pwm0_data rw_pwm_duty;
846
847 if (get_user(duty, &((struct io_pwm_set_duty *) arg)->duty))
848 return -EFAULT;
849 if (duty > 255)
850 return -EINVAL;
851 rw_pwm_duty.data = duty;
852 REG_WRITE(reg_gio_rw_pwm0_data, REG_ADDR(gio, regi_gio, rw_pwm0_data) +
853 12 * pwm_port, rw_pwm_duty);
854 return 0;
855}
856
857static int gpio_pwm_ioctl(struct gpio_private *priv, unsigned int cmd,
858 unsigned long arg)
859{
860 int pwm_port = priv->minor - GPIO_MINOR_PWM0;
861
862 switch (_IOC_NR(cmd)) {
863 case IO_PWM_SET_MODE:
864 return gpio_pwm_set_mode(arg, pwm_port);
865 case IO_PWM_SET_PERIOD:
866 return gpio_pwm_set_period(arg, pwm_port);
867 case IO_PWM_SET_DUTY:
868 return gpio_pwm_set_duty(arg, pwm_port);
869 default:
870 return -EINVAL;
871 }
872 return 0;
873}
874
875static const struct file_operations gpio_fops = {
876 .owner = THIS_MODULE,
877 .poll = gpio_poll,
878 .ioctl = gpio_ioctl,
879 .write = gpio_write,
880 .open = gpio_open,
881 .release = gpio_release,
882};
883
884#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
885static void __init virtual_gpio_init(void)
886{
887 reg_gio_rw_intr_cfg intr_cfg;
888 reg_gio_rw_intr_mask intr_mask;
889 unsigned short shadow;
890
891 shadow = ~virtual_rw_pv_oe; /* Input ports should be set to logic 1 */
892 shadow |= CONFIG_ETRAX_DEF_GIO_PV_OUT;
893 i2c_write(VIRT_I2C_ADDR, (void *)&shadow, sizeof(shadow));
894
895 /* Set interrupt mask and on what state the interrupt shall trigger.
896 * For virtual gpio the interrupt shall trigger on logic '0'.
897 */
898 intr_cfg = REG_RD(gio, regi_gio, rw_intr_cfg);
899 intr_mask = REG_RD(gio, regi_gio, rw_intr_mask);
900
901 switch (CONFIG_ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN) {
902 case 0:
903 intr_cfg.pa0 = regk_gio_lo;
904 intr_mask.pa0 = regk_gio_yes;
905 break;
906 case 1:
907 intr_cfg.pa1 = regk_gio_lo;
908 intr_mask.pa1 = regk_gio_yes;
909 break;
910 case 2:
911 intr_cfg.pa2 = regk_gio_lo;
912 intr_mask.pa2 = regk_gio_yes;
913 break;
914 case 3:
915 intr_cfg.pa3 = regk_gio_lo;
916 intr_mask.pa3 = regk_gio_yes;
917 break;
918 case 4:
919 intr_cfg.pa4 = regk_gio_lo;
920 intr_mask.pa4 = regk_gio_yes;
921 break;
922 case 5:
923 intr_cfg.pa5 = regk_gio_lo;
924 intr_mask.pa5 = regk_gio_yes;
925 break;
926 case 6:
927 intr_cfg.pa6 = regk_gio_lo;
928 intr_mask.pa6 = regk_gio_yes;
929 break;
930 case 7:
931 intr_cfg.pa7 = regk_gio_lo;
932 intr_mask.pa7 = regk_gio_yes;
933 break;
934 }
935
936 REG_WR(gio, regi_gio, rw_intr_cfg, intr_cfg);
937 REG_WR(gio, regi_gio, rw_intr_mask, intr_mask);
938}
939#endif
940
941/* main driver initialization routine, called from mem.c */
942
943static int __init gpio_init(void)
944{
945 int res;
946
947 printk(KERN_INFO "ETRAX FS GPIO driver v2.7, (c) 2003-2008 "
948 "Axis Communications AB\n");
949
950 /* do the formalities */
951
952 res = register_chrdev(GPIO_MAJOR, gpio_name, &gpio_fops);
953 if (res < 0) {
954 printk(KERN_ERR "gpio: couldn't get a major number.\n");
955 return res;
956 }
957
958 /* Clear all leds */
959 CRIS_LED_NETWORK_GRP0_SET(0);
960 CRIS_LED_NETWORK_GRP1_SET(0);
961 CRIS_LED_ACTIVE_SET(0);
962 CRIS_LED_DISK_READ(0);
963 CRIS_LED_DISK_WRITE(0);
964
965 int res2 = request_irq(GIO_INTR_VECT, gpio_interrupt,
966 IRQF_SHARED | IRQF_DISABLED, "gpio", &alarmlist);
967 if (res2) {
968 printk(KERN_ERR "err: irq for gpio\n");
969 return res2;
970 }
971
972 /* No IRQs by default. */
973 REG_WR_INT(gio, regi_gio, rw_intr_pins, 0);
974
975#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
976 virtual_gpio_init();
977#endif
978
979 return res;
980}
981
982/* this makes sure that gpio_init is called during kernel boot */
983
984module_init(gpio_init);
diff --git a/arch/cris/arch-v32/drivers/mach-a3/nandflash.c b/arch/cris/arch-v32/drivers/mach-a3/nandflash.c
new file mode 100644
index 000000000000..01ed0be2d0d1
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/mach-a3/nandflash.c
@@ -0,0 +1,180 @@
1/*
2 * arch/cris/arch-v32/drivers/nandflash.c
3 *
4 * Copyright (c) 2007
5 *
6 * Derived from drivers/mtd/nand/spia.c
7 * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com)
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14
15#include <linux/slab.h>
16#include <linux/init.h>
17#include <linux/module.h>
18#include <linux/mtd/mtd.h>
19#include <linux/mtd/nand.h>
20#include <linux/mtd/partitions.h>
21#include <asm/arch/memmap.h>
22#include <hwregs/reg_map.h>
23#include <hwregs/reg_rdwr.h>
24#include <hwregs/pio_defs.h>
25#include <pinmux.h>
26#include <asm/io.h>
27
28#define MANUAL_ALE_CLE_CONTROL 1
29
30#define regf_ALE a0
31#define regf_CLE a1
32#define regf_NCE ce0_n
33
34#define CLE_BIT 10
35#define ALE_BIT 11
36#define CE_BIT 12
37
38struct mtd_info_wrapper {
39 struct mtd_info info;
40 struct nand_chip chip;
41};
42
43/* Bitmask for control pins */
44#define PIN_BITMASK ((1 << CE_BIT) | (1 << CLE_BIT) | (1 << ALE_BIT))
45
46static struct mtd_info *crisv32_mtd;
47/*
48 * hardware specific access to control-lines
49 */
50static void crisv32_hwcontrol(struct mtd_info *mtd, int cmd,
51 unsigned int ctrl)
52{
53 unsigned long flags;
54 reg_pio_rw_dout dout;
55 struct nand_chip *this = mtd->priv;
56
57 local_irq_save(flags);
58
59 /* control bits change */
60 if (ctrl & NAND_CTRL_CHANGE) {
61 dout = REG_RD(pio, regi_pio, rw_dout);
62 dout.regf_NCE = (ctrl & NAND_NCE) ? 0 : 1;
63
64#if !MANUAL_ALE_CLE_CONTROL
65 if (ctrl & NAND_ALE) {
66 /* A0 = ALE high */
67 this->IO_ADDR_W = (void __iomem *)REG_ADDR(pio,
68 regi_pio, rw_io_access1);
69 } else if (ctrl & NAND_CLE) {
70 /* A1 = CLE high */
71 this->IO_ADDR_W = (void __iomem *)REG_ADDR(pio,
72 regi_pio, rw_io_access2);
73 } else {
74 /* A1 = CLE and A0 = ALE low */
75 this->IO_ADDR_W = (void __iomem *)REG_ADDR(pio,
76 regi_pio, rw_io_access0);
77 }
78#else
79
80 dout.regf_CLE = (ctrl & NAND_CLE) ? 1 : 0;
81 dout.regf_ALE = (ctrl & NAND_ALE) ? 1 : 0;
82#endif
83 REG_WR(pio, regi_pio, rw_dout, dout);
84 }
85
86 /* command to chip */
87 if (cmd != NAND_CMD_NONE)
88 writeb(cmd, this->IO_ADDR_W);
89
90 local_irq_restore(flags);
91}
92
93/*
94* read device ready pin
95*/
96static int crisv32_device_ready(struct mtd_info *mtd)
97{
98 reg_pio_r_din din = REG_RD(pio, regi_pio, r_din);
99 return din.rdy;
100}
101
102/*
103 * Main initialization routine
104 */
105struct mtd_info *__init crisv32_nand_flash_probe(void)
106{
107 void __iomem *read_cs;
108 void __iomem *write_cs;
109
110 struct mtd_info_wrapper *wrapper;
111 struct nand_chip *this;
112 int err = 0;
113
114 reg_pio_rw_man_ctrl man_ctrl = {
115 .regf_NCE = regk_pio_yes,
116#if MANUAL_ALE_CLE_CONTROL
117 .regf_ALE = regk_pio_yes,
118 .regf_CLE = regk_pio_yes
119#endif
120 };
121 reg_pio_rw_oe oe = {
122 .regf_NCE = regk_pio_yes,
123#if MANUAL_ALE_CLE_CONTROL
124 .regf_ALE = regk_pio_yes,
125 .regf_CLE = regk_pio_yes
126#endif
127 };
128 reg_pio_rw_dout dout = { .regf_NCE = 1 };
129
130 /* Allocate pio pins to pio */
131 crisv32_pinmux_alloc_fixed(pinmux_pio);
132 /* Set up CE, ALE, CLE (ce0_n, a0, a1) for manual control and output */
133 REG_WR(pio, regi_pio, rw_man_ctrl, man_ctrl);
134 REG_WR(pio, regi_pio, rw_dout, dout);
135 REG_WR(pio, regi_pio, rw_oe, oe);
136
137 /* Allocate memory for MTD device structure and private data */
138 wrapper = kzalloc(sizeof(struct mtd_info_wrapper), GFP_KERNEL);
139 if (!wrapper) {
140 printk(KERN_ERR "Unable to allocate CRISv32 NAND MTD "
141 "device structure.\n");
142 err = -ENOMEM;
143 return NULL;
144 }
145
146 read_cs = write_cs = (void __iomem *)REG_ADDR(pio, regi_pio,
147 rw_io_access0);
148
149 /* Get pointer to private data */
150 this = &wrapper->chip;
151 crisv32_mtd = &wrapper->info;
152
153 /* Link the private data with the MTD structure */
154 crisv32_mtd->priv = this;
155
156 /* Set address of NAND IO lines */
157 this->IO_ADDR_R = read_cs;
158 this->IO_ADDR_W = write_cs;
159 this->cmd_ctrl = crisv32_hwcontrol;
160 this->dev_ready = crisv32_device_ready;
161 /* 20 us command delay time */
162 this->chip_delay = 20;
163 this->ecc.mode = NAND_ECC_SOFT;
164
165 /* Enable the following for a flash based bad block table */
166 /* this->options = NAND_USE_FLASH_BBT; */
167
168 /* Scan to find existance of the device */
169 if (nand_scan(crisv32_mtd, 1)) {
170 err = -ENXIO;
171 goto out_mtd;
172 }
173
174 return crisv32_mtd;
175
176out_mtd:
177 kfree(wrapper);
178 return NULL;
179}
180
diff --git a/arch/cris/arch-v32/drivers/mach-fs/Makefile b/arch/cris/arch-v32/drivers/mach-fs/Makefile
new file mode 100644
index 000000000000..5c6d2a2a080e
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/mach-fs/Makefile
@@ -0,0 +1,6 @@
1#
2# Makefile for Etrax-specific drivers
3#
4
5obj-$(CONFIG_ETRAX_NANDFLASH) += nandflash.o
6obj-$(CONFIG_ETRAX_GPIO) += gpio.o
diff --git a/arch/cris/arch-v32/drivers/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c
index d82c5c561135..7863fd4efc2b 100644
--- a/arch/cris/arch-v32/drivers/gpio.c
+++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c
@@ -1,68 +1,15 @@
1/* $Id: gpio.c,v 1.16 2005/06/19 17:06:49 starvik Exp $ 1/*
2 *
3 * ETRAX CRISv32 general port I/O device 2 * ETRAX CRISv32 general port I/O device
4 * 3 *
5 * Copyright (c) 1999, 2000, 2001, 2002, 2003 Axis Communications AB 4 * Copyright (c) 1999-2006 Axis Communications AB
6 * 5 *
7 * Authors: Bjorn Wesen (initial version) 6 * Authors: Bjorn Wesen (initial version)
8 * Ola Knutsson (LED handling) 7 * Ola Knutsson (LED handling)
9 * Johan Adolfsson (read/set directions, write, port G, 8 * Johan Adolfsson (read/set directions, write, port G,
10 * port to ETRAX FS. 9 * port to ETRAX FS.
11 * 10 *
12 * $Log: gpio.c,v $
13 * Revision 1.16 2005/06/19 17:06:49 starvik
14 * Merge of Linux 2.6.12.
15 *
16 * Revision 1.15 2005/05/25 08:22:20 starvik
17 * Changed GPIO port order to fit packages/devices/axis-2.4.
18 *
19 * Revision 1.14 2005/04/24 18:35:08 starvik
20 * Updated with final register headers.
21 *
22 * Revision 1.13 2005/03/15 15:43:00 starvik
23 * dev_id needs to be supplied for shared IRQs.
24 *
25 * Revision 1.12 2005/03/10 17:12:00 starvik
26 * Protect alarm list with spinlock.
27 *
28 * Revision 1.11 2005/01/05 06:08:59 starvik
29 * No need to do local_irq_disable after local_irq_save.
30 *
31 * Revision 1.10 2004/11/19 08:38:31 starvik
32 * Removed old crap.
33 *
34 * Revision 1.9 2004/05/14 07:58:02 starvik
35 * Merge of changes from 2.4
36 *
37 * Revision 1.8 2003/09/11 07:29:50 starvik
38 * Merge of Linux 2.6.0-test5
39 *
40 * Revision 1.7 2003/07/10 13:25:46 starvik
41 * Compiles for 2.5.74
42 * Lindented ethernet.c
43 *
44 * Revision 1.6 2003/07/04 08:27:46 starvik
45 * Merge of Linux 2.5.74
46 *
47 * Revision 1.5 2003/06/10 08:26:37 johana
48 * Etrax -> ETRAX CRISv32
49 *
50 * Revision 1.4 2003/06/05 14:22:48 johana
51 * Initialise some_alarms.
52 *
53 * Revision 1.3 2003/06/05 10:15:46 johana
54 * New INTR_VECT macros.
55 * Enable interrupts in global config.
56 *
57 * Revision 1.2 2003/06/03 15:52:50 johana
58 * Initial CRIS v32 version.
59 *
60 * Revision 1.1 2003/06/03 08:53:15 johana
61 * Copy of os/lx25/arch/cris/arch-v10/drivers/gpio.c version 1.7.
62 *
63 */ 11 */
64 12
65
66#include <linux/module.h> 13#include <linux/module.h>
67#include <linux/sched.h> 14#include <linux/sched.h>
68#include <linux/slab.h> 15#include <linux/slab.h>
@@ -77,14 +24,20 @@
77#include <linux/spinlock.h> 24#include <linux/spinlock.h>
78 25
79#include <asm/etraxgpio.h> 26#include <asm/etraxgpio.h>
80#include <asm/arch/hwregs/reg_map.h> 27#include <hwregs/reg_map.h>
81#include <asm/arch/hwregs/reg_rdwr.h> 28#include <hwregs/reg_rdwr.h>
82#include <asm/arch/hwregs/gio_defs.h> 29#include <hwregs/gio_defs.h>
83#include <asm/arch/hwregs/intr_vect_defs.h> 30#include <hwregs/intr_vect_defs.h>
84#include <asm/io.h> 31#include <asm/io.h>
85#include <asm/system.h> 32#include <asm/system.h>
86#include <asm/irq.h> 33#include <asm/irq.h>
87 34
35#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
36#include "../i2c.h"
37
38#define VIRT_I2C_ADDR 0x40
39#endif
40
88/* The following gio ports on ETRAX FS is available: 41/* The following gio ports on ETRAX FS is available:
89 * pa 8 bits, supports interrupts off, hi, low, set, posedge, negedge anyedge 42 * pa 8 bits, supports interrupts off, hi, low, set, posedge, negedge anyedge
90 * pb 18 bits 43 * pb 18 bits
@@ -100,7 +53,12 @@
100 53
101#if 0 54#if 0
102static int dp_cnt; 55static int dp_cnt;
103#define DP(x) do { dp_cnt++; if (dp_cnt % 1000 == 0) x; }while(0) 56#define DP(x) \
57 do { \
58 dp_cnt++; \
59 if (dp_cnt % 1000 == 0) \
60 x; \
61 } while (0)
104#else 62#else
105#define DP(x) 63#define DP(x)
106#endif 64#endif
@@ -111,13 +69,18 @@ static char gpio_name[] = "etrax gpio";
111static wait_queue_head_t *gpio_wq; 69static wait_queue_head_t *gpio_wq;
112#endif 70#endif
113 71
72#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
73static int virtual_gpio_ioctl(struct file *file, unsigned int cmd,
74 unsigned long arg);
75#endif
114static int gpio_ioctl(struct inode *inode, struct file *file, 76static int gpio_ioctl(struct inode *inode, struct file *file,
115 unsigned int cmd, unsigned long arg); 77 unsigned int cmd, unsigned long arg);
116static ssize_t gpio_write(struct file * file, const char * buf, size_t count, 78static ssize_t gpio_write(struct file *file, const char *buf, size_t count,
117 loff_t *off); 79 loff_t *off);
118static int gpio_open(struct inode *inode, struct file *filp); 80static int gpio_open(struct inode *inode, struct file *filp);
119static int gpio_release(struct inode *inode, struct file *filp); 81static int gpio_release(struct inode *inode, struct file *filp);
120static unsigned int gpio_poll(struct file *filp, struct poll_table_struct *wait); 82static unsigned int gpio_poll(struct file *filp,
83 struct poll_table_struct *wait);
121 84
122/* private data per open() of this driver */ 85/* private data per open() of this driver */
123 86
@@ -136,18 +99,25 @@ struct gpio_private {
136 99
137/* linked list of alarms to check for */ 100/* linked list of alarms to check for */
138 101
139static struct gpio_private *alarmlist = 0; 102static struct gpio_private *alarmlist;
140 103
141static int gpio_some_alarms = 0; /* Set if someone uses alarm */ 104static int gpio_some_alarms; /* Set if someone uses alarm */
142static unsigned long gpio_pa_high_alarms = 0; 105static unsigned long gpio_pa_high_alarms;
143static unsigned long gpio_pa_low_alarms = 0; 106static unsigned long gpio_pa_low_alarms;
144 107
145static DEFINE_SPINLOCK(alarm_lock); 108static DEFINE_SPINLOCK(alarm_lock);
146 109
147#define NUM_PORTS (GPIO_MINOR_LAST+1) 110#define NUM_PORTS (GPIO_MINOR_LAST+1)
148#define GIO_REG_RD_ADDR(reg) (volatile unsigned long*) (regi_gio + REG_RD_ADDR_gio_##reg ) 111#define GIO_REG_RD_ADDR(reg) \
149#define GIO_REG_WR_ADDR(reg) (volatile unsigned long*) (regi_gio + REG_RD_ADDR_gio_##reg ) 112 (volatile unsigned long *)(regi_gio + REG_RD_ADDR_gio_##reg)
113#define GIO_REG_WR_ADDR(reg) \
114 (volatile unsigned long *)(regi_gio + REG_RD_ADDR_gio_##reg)
150unsigned long led_dummy; 115unsigned long led_dummy;
116#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
117static unsigned long virtual_dummy;
118static unsigned long virtual_rw_pv_oe = CONFIG_ETRAX_DEF_GIO_PV_OE;
119static unsigned short cached_virtual_gpio_read;
120#endif
151 121
152static volatile unsigned long *data_out[NUM_PORTS] = { 122static volatile unsigned long *data_out[NUM_PORTS] = {
153 GIO_REG_WR_ADDR(rw_pa_dout), 123 GIO_REG_WR_ADDR(rw_pa_dout),
@@ -156,6 +126,9 @@ static volatile unsigned long *data_out[NUM_PORTS] = {
156 GIO_REG_WR_ADDR(rw_pc_dout), 126 GIO_REG_WR_ADDR(rw_pc_dout),
157 GIO_REG_WR_ADDR(rw_pd_dout), 127 GIO_REG_WR_ADDR(rw_pd_dout),
158 GIO_REG_WR_ADDR(rw_pe_dout), 128 GIO_REG_WR_ADDR(rw_pe_dout),
129#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
130 &virtual_dummy,
131#endif
159}; 132};
160 133
161static volatile unsigned long *data_in[NUM_PORTS] = { 134static volatile unsigned long *data_in[NUM_PORTS] = {
@@ -165,6 +138,9 @@ static volatile unsigned long *data_in[NUM_PORTS] = {
165 GIO_REG_RD_ADDR(r_pc_din), 138 GIO_REG_RD_ADDR(r_pc_din),
166 GIO_REG_RD_ADDR(r_pd_din), 139 GIO_REG_RD_ADDR(r_pd_din),
167 GIO_REG_RD_ADDR(r_pe_din), 140 GIO_REG_RD_ADDR(r_pe_din),
141#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
142 &virtual_dummy,
143#endif
168}; 144};
169 145
170static unsigned long changeable_dir[NUM_PORTS] = { 146static unsigned long changeable_dir[NUM_PORTS] = {
@@ -174,6 +150,9 @@ static unsigned long changeable_dir[NUM_PORTS] = {
174 CONFIG_ETRAX_PC_CHANGEABLE_DIR, 150 CONFIG_ETRAX_PC_CHANGEABLE_DIR,
175 CONFIG_ETRAX_PD_CHANGEABLE_DIR, 151 CONFIG_ETRAX_PD_CHANGEABLE_DIR,
176 CONFIG_ETRAX_PE_CHANGEABLE_DIR, 152 CONFIG_ETRAX_PE_CHANGEABLE_DIR,
153#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
154 CONFIG_ETRAX_PV_CHANGEABLE_DIR,
155#endif
177}; 156};
178 157
179static unsigned long changeable_bits[NUM_PORTS] = { 158static unsigned long changeable_bits[NUM_PORTS] = {
@@ -183,6 +162,9 @@ static unsigned long changeable_bits[NUM_PORTS] = {
183 CONFIG_ETRAX_PC_CHANGEABLE_BITS, 162 CONFIG_ETRAX_PC_CHANGEABLE_BITS,
184 CONFIG_ETRAX_PD_CHANGEABLE_BITS, 163 CONFIG_ETRAX_PD_CHANGEABLE_BITS,
185 CONFIG_ETRAX_PE_CHANGEABLE_BITS, 164 CONFIG_ETRAX_PE_CHANGEABLE_BITS,
165#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
166 CONFIG_ETRAX_PV_CHANGEABLE_BITS,
167#endif
186}; 168};
187 169
188static volatile unsigned long *dir_oe[NUM_PORTS] = { 170static volatile unsigned long *dir_oe[NUM_PORTS] = {
@@ -192,13 +174,14 @@ static volatile unsigned long *dir_oe[NUM_PORTS] = {
192 GIO_REG_WR_ADDR(rw_pc_oe), 174 GIO_REG_WR_ADDR(rw_pc_oe),
193 GIO_REG_WR_ADDR(rw_pd_oe), 175 GIO_REG_WR_ADDR(rw_pd_oe),
194 GIO_REG_WR_ADDR(rw_pe_oe), 176 GIO_REG_WR_ADDR(rw_pe_oe),
177#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
178 &virtual_rw_pv_oe,
179#endif
195}; 180};
196 181
197 182
198 183
199static unsigned int 184static unsigned int gpio_poll(struct file *file, struct poll_table_struct *wait)
200gpio_poll(struct file *file,
201 poll_table *wait)
202{ 185{
203 unsigned int mask = 0; 186 unsigned int mask = 0;
204 struct gpio_private *priv = (struct gpio_private *)file->private_data; 187 struct gpio_private *priv = (struct gpio_private *)file->private_data;
@@ -210,65 +193,50 @@ gpio_poll(struct file *file,
210 unsigned long flags; 193 unsigned long flags;
211 194
212 local_irq_save(flags); 195 local_irq_save(flags);
213 data = REG_TYPE_CONV(unsigned long, reg_gio_r_pa_din, REG_RD(gio, regi_gio, r_pa_din)); 196 data = REG_TYPE_CONV(unsigned long, reg_gio_r_pa_din,
197 REG_RD(gio, regi_gio, r_pa_din));
214 /* PA has support for interrupt 198 /* PA has support for interrupt
215 * lets activate high for those low and with highalarm set 199 * lets activate high for those low and with highalarm set
216 */ 200 */
217 intr_cfg = REG_RD(gio, regi_gio, rw_intr_cfg); 201 intr_cfg = REG_RD(gio, regi_gio, rw_intr_cfg);
218 202
219 tmp = ~data & priv->highalarm & 0xFF; 203 tmp = ~data & priv->highalarm & 0xFF;
220 if (tmp & (1 << 0)) { 204 if (tmp & (1 << 0))
221 intr_cfg.pa0 = regk_gio_hi; 205 intr_cfg.pa0 = regk_gio_hi;
222 } 206 if (tmp & (1 << 1))
223 if (tmp & (1 << 1)) {
224 intr_cfg.pa1 = regk_gio_hi; 207 intr_cfg.pa1 = regk_gio_hi;
225 } 208 if (tmp & (1 << 2))
226 if (tmp & (1 << 2)) {
227 intr_cfg.pa2 = regk_gio_hi; 209 intr_cfg.pa2 = regk_gio_hi;
228 } 210 if (tmp & (1 << 3))
229 if (tmp & (1 << 3)) {
230 intr_cfg.pa3 = regk_gio_hi; 211 intr_cfg.pa3 = regk_gio_hi;
231 } 212 if (tmp & (1 << 4))
232 if (tmp & (1 << 4)) {
233 intr_cfg.pa4 = regk_gio_hi; 213 intr_cfg.pa4 = regk_gio_hi;
234 } 214 if (tmp & (1 << 5))
235 if (tmp & (1 << 5)) {
236 intr_cfg.pa5 = regk_gio_hi; 215 intr_cfg.pa5 = regk_gio_hi;
237 } 216 if (tmp & (1 << 6))
238 if (tmp & (1 << 6)) {
239 intr_cfg.pa6 = regk_gio_hi; 217 intr_cfg.pa6 = regk_gio_hi;
240 } 218 if (tmp & (1 << 7))
241 if (tmp & (1 << 7)) {
242 intr_cfg.pa7 = regk_gio_hi; 219 intr_cfg.pa7 = regk_gio_hi;
243 }
244 /* 220 /*
245 * lets activate low for those high and with lowalarm set 221 * lets activate low for those high and with lowalarm set
246 */ 222 */
247 tmp = data & priv->lowalarm & 0xFF; 223 tmp = data & priv->lowalarm & 0xFF;
248 if (tmp & (1 << 0)) { 224 if (tmp & (1 << 0))
249 intr_cfg.pa0 = regk_gio_lo; 225 intr_cfg.pa0 = regk_gio_lo;
250 } 226 if (tmp & (1 << 1))
251 if (tmp & (1 << 1)) {
252 intr_cfg.pa1 = regk_gio_lo; 227 intr_cfg.pa1 = regk_gio_lo;
253 } 228 if (tmp & (1 << 2))
254 if (tmp & (1 << 2)) {
255 intr_cfg.pa2 = regk_gio_lo; 229 intr_cfg.pa2 = regk_gio_lo;
256 } 230 if (tmp & (1 << 3))
257 if (tmp & (1 << 3)) {
258 intr_cfg.pa3 = regk_gio_lo; 231 intr_cfg.pa3 = regk_gio_lo;
259 } 232 if (tmp & (1 << 4))
260 if (tmp & (1 << 4)) {
261 intr_cfg.pa4 = regk_gio_lo; 233 intr_cfg.pa4 = regk_gio_lo;
262 } 234 if (tmp & (1 << 5))
263 if (tmp & (1 << 5)) {
264 intr_cfg.pa5 = regk_gio_lo; 235 intr_cfg.pa5 = regk_gio_lo;
265 } 236 if (tmp & (1 << 6))
266 if (tmp & (1 << 6)) {
267 intr_cfg.pa6 = regk_gio_lo; 237 intr_cfg.pa6 = regk_gio_lo;
268 } 238 if (tmp & (1 << 7))
269 if (tmp & (1 << 7)) {
270 intr_cfg.pa7 = regk_gio_lo; 239 intr_cfg.pa7 = regk_gio_lo;
271 }
272 240
273 REG_WR(gio, regi_gio, rw_intr_cfg, intr_cfg); 241 REG_WR(gio, regi_gio, rw_intr_cfg, intr_cfg);
274 local_irq_restore(flags); 242 local_irq_restore(flags);
@@ -277,50 +245,65 @@ gpio_poll(struct file *file,
277 else 245 else
278 return 0; 246 return 0;
279 247
280 if ((data & priv->highalarm) || 248 if ((data & priv->highalarm) || (~data & priv->lowalarm))
281 (~data & priv->lowalarm)) {
282 mask = POLLIN|POLLRDNORM; 249 mask = POLLIN|POLLRDNORM;
283 }
284 250
285 DP(printk("gpio_poll ready: mask 0x%08X\n", mask)); 251 DP(printk(KERN_DEBUG "gpio_poll ready: mask 0x%08X\n", mask));
286 return mask; 252 return mask;
287} 253}
288 254
289int etrax_gpio_wake_up_check(void) 255int etrax_gpio_wake_up_check(void)
290{ 256{
291 struct gpio_private *priv = alarmlist; 257 struct gpio_private *priv;
292 unsigned long data = 0; 258 unsigned long data = 0;
293 int ret = 0; 259 unsigned long flags;
260 int ret = 0;
261 spin_lock_irqsave(&alarm_lock, flags);
262 priv = alarmlist;
294 while (priv) { 263 while (priv) {
264#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
265 if (priv->minor == GPIO_MINOR_V)
266 data = (unsigned long)cached_virtual_gpio_read;
267 else {
268 data = *data_in[priv->minor];
269 if (priv->minor == GPIO_MINOR_A)
270 priv->lowalarm |= (1 << CONFIG_ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN);
271 }
272#else
295 data = *data_in[priv->minor]; 273 data = *data_in[priv->minor];
274#endif
296 if ((data & priv->highalarm) || 275 if ((data & priv->highalarm) ||
297 (~data & priv->lowalarm)) { 276 (~data & priv->lowalarm)) {
298 DP(printk("etrax_gpio_wake_up_check %i\n",priv->minor)); 277 DP(printk(KERN_DEBUG
278 "etrax_gpio_wake_up_check %i\n", priv->minor));
299 wake_up_interruptible(&priv->alarm_wq); 279 wake_up_interruptible(&priv->alarm_wq);
300 ret = 1; 280 ret = 1;
301 } 281 }
302 priv = priv->next; 282 priv = priv->next;
303 } 283 }
304 return ret; 284 spin_unlock_irqrestore(&alarm_lock, flags);
285 return ret;
305} 286}
306 287
307static irqreturn_t 288static irqreturn_t
308gpio_poll_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 289gpio_poll_timer_interrupt(int irq, void *dev_id)
309{ 290{
310 if (gpio_some_alarms) { 291 if (gpio_some_alarms)
311 return IRQ_RETVAL(etrax_gpio_wake_up_check()); 292 return IRQ_RETVAL(etrax_gpio_wake_up_check());
312 } 293 return IRQ_NONE;
313 return IRQ_NONE;
314} 294}
315 295
316static irqreturn_t 296static irqreturn_t
317gpio_pa_interrupt(int irq, void *dev_id, struct pt_regs *regs) 297gpio_pa_interrupt(int irq, void *dev_id)
318{ 298{
319 reg_gio_rw_intr_mask intr_mask; 299 reg_gio_rw_intr_mask intr_mask;
320 reg_gio_r_masked_intr masked_intr; 300 reg_gio_r_masked_intr masked_intr;
321 reg_gio_rw_ack_intr ack_intr; 301 reg_gio_rw_ack_intr ack_intr;
322 unsigned long tmp; 302 unsigned long tmp;
323 unsigned long tmp2; 303 unsigned long tmp2;
304#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
305 unsigned char enable_gpiov_ack = 0;
306#endif
324 307
325 /* Find what PA interrupts are active */ 308 /* Find what PA interrupts are active */
326 masked_intr = REG_RD(gio, regi_gio, r_masked_intr); 309 masked_intr = REG_RD(gio, regi_gio, r_masked_intr);
@@ -331,6 +314,17 @@ gpio_pa_interrupt(int irq, void *dev_id, struct pt_regs *regs)
331 tmp &= (gpio_pa_high_alarms | gpio_pa_low_alarms); 314 tmp &= (gpio_pa_high_alarms | gpio_pa_low_alarms);
332 spin_unlock(&alarm_lock); 315 spin_unlock(&alarm_lock);
333 316
317#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
318 /* Something changed on virtual GPIO. Interrupt is acked by
319 * reading the device.
320 */
321 if (tmp & (1 << CONFIG_ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN)) {
322 i2c_read(VIRT_I2C_ADDR, (void *)&cached_virtual_gpio_read,
323 sizeof(cached_virtual_gpio_read));
324 enable_gpiov_ack = 1;
325 }
326#endif
327
334 /* Ack them */ 328 /* Ack them */
335 ack_intr = REG_TYPE_CONV(reg_gio_rw_ack_intr, unsigned long, tmp); 329 ack_intr = REG_TYPE_CONV(reg_gio_rw_ack_intr, unsigned long, tmp);
336 REG_WR(gio, regi_gio, rw_ack_intr, ack_intr); 330 REG_WR(gio, regi_gio, rw_ack_intr, ack_intr);
@@ -339,18 +333,24 @@ gpio_pa_interrupt(int irq, void *dev_id, struct pt_regs *regs)
339 intr_mask = REG_RD(gio, regi_gio, rw_intr_mask); 333 intr_mask = REG_RD(gio, regi_gio, rw_intr_mask);
340 tmp2 = REG_TYPE_CONV(unsigned long, reg_gio_rw_intr_mask, intr_mask); 334 tmp2 = REG_TYPE_CONV(unsigned long, reg_gio_rw_intr_mask, intr_mask);
341 tmp2 &= ~tmp; 335 tmp2 &= ~tmp;
336#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
337 /* Do not disable interrupt on virtual GPIO. Changes on virtual
338 * pins are only noticed by an interrupt.
339 */
340 if (enable_gpiov_ack)
341 tmp2 |= (1 << CONFIG_ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN);
342#endif
342 intr_mask = REG_TYPE_CONV(reg_gio_rw_intr_mask, unsigned long, tmp2); 343 intr_mask = REG_TYPE_CONV(reg_gio_rw_intr_mask, unsigned long, tmp2);
343 REG_WR(gio, regi_gio, rw_intr_mask, intr_mask); 344 REG_WR(gio, regi_gio, rw_intr_mask, intr_mask);
344 345
345 if (gpio_some_alarms) { 346 if (gpio_some_alarms)
346 return IRQ_RETVAL(etrax_gpio_wake_up_check()); 347 return IRQ_RETVAL(etrax_gpio_wake_up_check());
347 } 348 return IRQ_NONE;
348 return IRQ_NONE;
349} 349}
350 350
351 351
352static ssize_t gpio_write(struct file * file, const char * buf, size_t count, 352static ssize_t gpio_write(struct file *file, const char *buf, size_t count,
353 loff_t *off) 353 loff_t *off)
354{ 354{
355 struct gpio_private *priv = (struct gpio_private *)file->private_data; 355 struct gpio_private *priv = (struct gpio_private *)file->private_data;
356 unsigned char data, clk_mask, data_mask, write_msb; 356 unsigned char data, clk_mask, data_mask, write_msb;
@@ -360,29 +360,31 @@ static ssize_t gpio_write(struct file * file, const char * buf, size_t count,
360 ssize_t retval = count; 360 ssize_t retval = count;
361 /* Only bits 0-7 may be used for write operations but allow all 361 /* Only bits 0-7 may be used for write operations but allow all
362 devices except leds... */ 362 devices except leds... */
363 if (priv->minor == GPIO_MINOR_LEDS) { 363#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
364 if (priv->minor == GPIO_MINOR_V)
365 return -EFAULT;
366#endif
367 if (priv->minor == GPIO_MINOR_LEDS)
364 return -EFAULT; 368 return -EFAULT;
365 }
366 369
367 if (!access_ok(VERIFY_READ, buf, count)) { 370 if (!access_ok(VERIFY_READ, buf, count))
368 return -EFAULT; 371 return -EFAULT;
369 }
370 clk_mask = priv->clk_mask; 372 clk_mask = priv->clk_mask;
371 data_mask = priv->data_mask; 373 data_mask = priv->data_mask;
372 /* It must have been configured using the IO_CFG_WRITE_MODE */ 374 /* It must have been configured using the IO_CFG_WRITE_MODE */
373 /* Perhaps a better error code? */ 375 /* Perhaps a better error code? */
374 if (clk_mask == 0 || data_mask == 0) { 376 if (clk_mask == 0 || data_mask == 0)
375 return -EPERM; 377 return -EPERM;
376 }
377 write_msb = priv->write_msb; 378 write_msb = priv->write_msb;
378 D(printk("gpio_write: %lu to data 0x%02X clk 0x%02X msb: %i\n",count, data_mask, clk_mask, write_msb)); 379 D(printk(KERN_DEBUG "gpio_write: %lu to data 0x%02X clk 0x%02X "
380 "msb: %i\n", count, data_mask, clk_mask, write_msb));
379 port = data_out[priv->minor]; 381 port = data_out[priv->minor];
380 382
381 while (count--) { 383 while (count--) {
382 int i; 384 int i;
383 data = *buf++; 385 data = *buf++;
384 if (priv->write_msb) { 386 if (priv->write_msb) {
385 for (i = 7; i >= 0;i--) { 387 for (i = 7; i >= 0; i--) {
386 local_irq_save(flags); 388 local_irq_save(flags);
387 shadow = *port; 389 shadow = *port;
388 *port = shadow &= ~clk_mask; 390 *port = shadow &= ~clk_mask;
@@ -395,7 +397,7 @@ static ssize_t gpio_write(struct file * file, const char * buf, size_t count,
395 local_irq_restore(flags); 397 local_irq_restore(flags);
396 } 398 }
397 } else { 399 } else {
398 for (i = 0; i <= 7;i++) { 400 for (i = 0; i <= 7; i++) {
399 local_irq_save(flags); 401 local_irq_save(flags);
400 shadow = *port; 402 shadow = *port;
401 *port = shadow &= ~clk_mask; 403 *port = shadow &= ~clk_mask;
@@ -423,18 +425,16 @@ gpio_open(struct inode *inode, struct file *filp)
423 if (p > GPIO_MINOR_LAST) 425 if (p > GPIO_MINOR_LAST)
424 return -EINVAL; 426 return -EINVAL;
425 427
426 priv = kmalloc(sizeof(struct gpio_private), 428 priv = kmalloc(sizeof(struct gpio_private), GFP_KERNEL);
427 GFP_KERNEL);
428 429
429 if (!priv) 430 if (!priv)
430 return -ENOMEM; 431 return -ENOMEM;
432 memset(priv, 0, sizeof(*priv));
431 433
432 priv->minor = p; 434 priv->minor = p;
433 435
434 /* initialize the io/alarm struct and link it into our alarmlist */ 436 /* initialize the io/alarm struct */
435 437
436 priv->next = alarmlist;
437 alarmlist = priv;
438 priv->clk_mask = 0; 438 priv->clk_mask = 0;
439 priv->data_mask = 0; 439 priv->data_mask = 0;
440 priv->highalarm = 0; 440 priv->highalarm = 0;
@@ -443,20 +443,30 @@ gpio_open(struct inode *inode, struct file *filp)
443 443
444 filp->private_data = (void *)priv; 444 filp->private_data = (void *)priv;
445 445
446 /* link it into our alarmlist */
447 spin_lock_irq(&alarm_lock);
448 priv->next = alarmlist;
449 alarmlist = priv;
450 spin_unlock_irq(&alarm_lock);
451
446 return 0; 452 return 0;
447} 453}
448 454
449static int 455static int
450gpio_release(struct inode *inode, struct file *filp) 456gpio_release(struct inode *inode, struct file *filp)
451{ 457{
452 struct gpio_private *p = alarmlist; 458 struct gpio_private *p;
453 struct gpio_private *todel = (struct gpio_private *)filp->private_data; 459 struct gpio_private *todel;
454 /* local copies while updating them: */ 460 /* local copies while updating them: */
455 unsigned long a_high, a_low; 461 unsigned long a_high, a_low;
456 unsigned long some_alarms; 462 unsigned long some_alarms;
457 463
458 /* unlink from alarmlist and free the private structure */ 464 /* unlink from alarmlist and free the private structure */
459 465
466 spin_lock_irq(&alarm_lock);
467 p = alarmlist;
468 todel = (struct gpio_private *)filp->private_data;
469
460 if (p == todel) { 470 if (p == todel) {
461 alarmlist = todel->next; 471 alarmlist = todel->next;
462 } else { 472 } else {
@@ -468,26 +478,35 @@ gpio_release(struct inode *inode, struct file *filp)
468 kfree(todel); 478 kfree(todel);
469 /* Check if there are still any alarms set */ 479 /* Check if there are still any alarms set */
470 p = alarmlist; 480 p = alarmlist;
471 some_alarms = 0; 481 some_alarms = 0;
472 a_high = 0; 482 a_high = 0;
473 a_low = 0; 483 a_low = 0;
474 while (p) { 484 while (p) {
475 if (p->minor == GPIO_MINOR_A) { 485 if (p->minor == GPIO_MINOR_A) {
486#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
487 p->lowalarm |= (1 << CONFIG_ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN);
488#endif
476 a_high |= p->highalarm; 489 a_high |= p->highalarm;
477 a_low |= p->lowalarm; 490 a_low |= p->lowalarm;
478 } 491 }
479 492
480 if (p->highalarm | p->lowalarm) { 493 if (p->highalarm | p->lowalarm)
481 some_alarms = 1; 494 some_alarms = 1;
482 }
483 p = p->next; 495 p = p->next;
484 } 496 }
485 497
486 spin_lock(&alarm_lock); 498#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
499 /* Variables 'some_alarms' and 'a_low' needs to be set here again
500 * to ensure that interrupt for virtual GPIO is handled.
501 */
502 some_alarms = 1;
503 a_low |= (1 << CONFIG_ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN);
504#endif
505
487 gpio_some_alarms = some_alarms; 506 gpio_some_alarms = some_alarms;
488 gpio_pa_high_alarms = a_high; 507 gpio_pa_high_alarms = a_high;
489 gpio_pa_low_alarms = a_low; 508 gpio_pa_low_alarms = a_low;
490 spin_unlock(&alarm_lock); 509 spin_unlock_irq(&alarm_lock);
491 510
492 return 0; 511 return 0;
493} 512}
@@ -496,7 +515,7 @@ gpio_release(struct inode *inode, struct file *filp)
496 * set alarms to wait for using a subsequent select(). 515 * set alarms to wait for using a subsequent select().
497 */ 516 */
498 517
499unsigned long inline setget_input(struct gpio_private *priv, unsigned long arg) 518inline unsigned long setget_input(struct gpio_private *priv, unsigned long arg)
500{ 519{
501 /* Set direction 0=unchanged 1=input, 520 /* Set direction 0=unchanged 1=input,
502 * return mask with 1=input 521 * return mask with 1=input
@@ -512,13 +531,17 @@ unsigned long inline setget_input(struct gpio_private *priv, unsigned long arg)
512 531
513 if (priv->minor == GPIO_MINOR_A) 532 if (priv->minor == GPIO_MINOR_A)
514 dir_shadow ^= 0xFF; /* Only 8 bits */ 533 dir_shadow ^= 0xFF; /* Only 8 bits */
534#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
535 else if (priv->minor == GPIO_MINOR_V)
536 dir_shadow ^= 0xFFFF; /* Only 16 bits */
537#endif
515 else 538 else
516 dir_shadow ^= 0x3FFFF; /* Only 18 bits */ 539 dir_shadow ^= 0x3FFFF; /* Only 18 bits */
517 return dir_shadow; 540 return dir_shadow;
518 541
519} /* setget_input */ 542} /* setget_input */
520 543
521unsigned long inline setget_output(struct gpio_private *priv, unsigned long arg) 544inline unsigned long setget_output(struct gpio_private *priv, unsigned long arg)
522{ 545{
523 unsigned long flags; 546 unsigned long flags;
524 unsigned long dir_shadow; 547 unsigned long dir_shadow;
@@ -542,20 +565,22 @@ gpio_ioctl(struct inode *inode, struct file *file,
542 unsigned long val; 565 unsigned long val;
543 unsigned long shadow; 566 unsigned long shadow;
544 struct gpio_private *priv = (struct gpio_private *)file->private_data; 567 struct gpio_private *priv = (struct gpio_private *)file->private_data;
545 if (_IOC_TYPE(cmd) != ETRAXGPIO_IOCTYPE) { 568 if (_IOC_TYPE(cmd) != ETRAXGPIO_IOCTYPE)
546 return -EINVAL; 569 return -EINVAL;
547 } 570
571#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
572 if (priv->minor == GPIO_MINOR_V)
573 return virtual_gpio_ioctl(file, cmd, arg);
574#endif
548 575
549 switch (_IOC_NR(cmd)) { 576 switch (_IOC_NR(cmd)) {
550 case IO_READBITS: /* Use IO_READ_INBITS and IO_READ_OUTBITS instead */ 577 case IO_READBITS: /* Use IO_READ_INBITS and IO_READ_OUTBITS instead */
551 // read the port 578 /* Read the port. */
552 return *data_in[priv->minor]; 579 return *data_in[priv->minor];
553 break; 580 break;
554 case IO_SETBITS: 581 case IO_SETBITS:
555 local_irq_save(flags); 582 local_irq_save(flags);
556 if (arg & 0x04) 583 /* Set changeable bits with a 1 in arg. */
557 printk("GPIO SET 2\n");
558 // set changeable bits with a 1 in arg
559 shadow = *data_out[priv->minor]; 584 shadow = *data_out[priv->minor];
560 shadow |= (arg & changeable_bits[priv->minor]); 585 shadow |= (arg & changeable_bits[priv->minor]);
561 *data_out[priv->minor] = shadow; 586 *data_out[priv->minor] = shadow;
@@ -563,46 +588,42 @@ gpio_ioctl(struct inode *inode, struct file *file,
563 break; 588 break;
564 case IO_CLRBITS: 589 case IO_CLRBITS:
565 local_irq_save(flags); 590 local_irq_save(flags);
566 if (arg & 0x04) 591 /* Clear changeable bits with a 1 in arg. */
567 printk("GPIO CLR 2\n");
568 // clear changeable bits with a 1 in arg
569 shadow = *data_out[priv->minor]; 592 shadow = *data_out[priv->minor];
570 shadow &= ~(arg & changeable_bits[priv->minor]); 593 shadow &= ~(arg & changeable_bits[priv->minor]);
571 *data_out[priv->minor] = shadow; 594 *data_out[priv->minor] = shadow;
572 local_irq_restore(flags); 595 local_irq_restore(flags);
573 break; 596 break;
574 case IO_HIGHALARM: 597 case IO_HIGHALARM:
575 // set alarm when bits with 1 in arg go high 598 /* Set alarm when bits with 1 in arg go high. */
576 priv->highalarm |= arg; 599 priv->highalarm |= arg;
577 spin_lock(&alarm_lock); 600 spin_lock_irqsave(&alarm_lock, flags);
578 gpio_some_alarms = 1; 601 gpio_some_alarms = 1;
579 if (priv->minor == GPIO_MINOR_A) { 602 if (priv->minor == GPIO_MINOR_A)
580 gpio_pa_high_alarms |= arg; 603 gpio_pa_high_alarms |= arg;
581 } 604 spin_unlock_irqrestore(&alarm_lock, flags);
582 spin_unlock(&alarm_lock);
583 break; 605 break;
584 case IO_LOWALARM: 606 case IO_LOWALARM:
585 // set alarm when bits with 1 in arg go low 607 /* Set alarm when bits with 1 in arg go low. */
586 priv->lowalarm |= arg; 608 priv->lowalarm |= arg;
587 spin_lock(&alarm_lock); 609 spin_lock_irqsave(&alarm_lock, flags);
588 gpio_some_alarms = 1; 610 gpio_some_alarms = 1;
589 if (priv->minor == GPIO_MINOR_A) { 611 if (priv->minor == GPIO_MINOR_A)
590 gpio_pa_low_alarms |= arg; 612 gpio_pa_low_alarms |= arg;
591 } 613 spin_unlock_irqrestore(&alarm_lock, flags);
592 spin_unlock(&alarm_lock);
593 break; 614 break;
594 case IO_CLRALARM: 615 case IO_CLRALARM:
595 // clear alarm for bits with 1 in arg 616 /* Clear alarm for bits with 1 in arg. */
596 priv->highalarm &= ~arg; 617 priv->highalarm &= ~arg;
597 priv->lowalarm &= ~arg; 618 priv->lowalarm &= ~arg;
598 spin_lock(&alarm_lock); 619 spin_lock_irqsave(&alarm_lock, flags);
599 if (priv->minor == GPIO_MINOR_A) { 620 if (priv->minor == GPIO_MINOR_A) {
600 if (gpio_pa_high_alarms & arg || 621 if (gpio_pa_high_alarms & arg ||
601 gpio_pa_low_alarms & arg) { 622 gpio_pa_low_alarms & arg)
602 /* Must update the gpio_pa_*alarms masks */ 623 /* Must update the gpio_pa_*alarms masks */
603 } 624 ;
604 } 625 }
605 spin_unlock(&alarm_lock); 626 spin_unlock_irqrestore(&alarm_lock, flags);
606 break; 627 break;
607 case IO_READDIR: /* Use IO_SETGET_INPUT/OUTPUT instead! */ 628 case IO_READDIR: /* Use IO_SETGET_INPUT/OUTPUT instead! */
608 /* Read direction 0=input 1=output */ 629 /* Read direction 0=input 1=output */
@@ -633,8 +654,7 @@ gpio_ioctl(struct inode *inode, struct file *file,
633 if (!((priv->clk_mask & changeable_bits[priv->minor]) && 654 if (!((priv->clk_mask & changeable_bits[priv->minor]) &&
634 (priv->data_mask & changeable_bits[priv->minor]) && 655 (priv->data_mask & changeable_bits[priv->minor]) &&
635 (priv->clk_mask & dir_shadow) && 656 (priv->clk_mask & dir_shadow) &&
636 (priv->data_mask & dir_shadow))) 657 (priv->data_mask & dir_shadow))) {
637 {
638 priv->clk_mask = 0; 658 priv->clk_mask = 0;
639 priv->data_mask = 0; 659 priv->data_mask = 0;
640 return -EPERM; 660 return -EPERM;
@@ -644,34 +664,34 @@ gpio_ioctl(struct inode *inode, struct file *file,
644 case IO_READ_INBITS: 664 case IO_READ_INBITS:
645 /* *arg is result of reading the input pins */ 665 /* *arg is result of reading the input pins */
646 val = *data_in[priv->minor]; 666 val = *data_in[priv->minor];
647 if (copy_to_user((unsigned long*)arg, &val, sizeof(val))) 667 if (copy_to_user((unsigned long *)arg, &val, sizeof(val)))
648 return -EFAULT; 668 return -EFAULT;
649 return 0; 669 return 0;
650 break; 670 break;
651 case IO_READ_OUTBITS: 671 case IO_READ_OUTBITS:
652 /* *arg is result of reading the output shadow */ 672 /* *arg is result of reading the output shadow */
653 val = *data_out[priv->minor]; 673 val = *data_out[priv->minor];
654 if (copy_to_user((unsigned long*)arg, &val, sizeof(val))) 674 if (copy_to_user((unsigned long *)arg, &val, sizeof(val)))
655 return -EFAULT; 675 return -EFAULT;
656 break; 676 break;
657 case IO_SETGET_INPUT: 677 case IO_SETGET_INPUT:
658 /* bits set in *arg is set to input, 678 /* bits set in *arg is set to input,
659 * *arg updated with current input pins. 679 * *arg updated with current input pins.
660 */ 680 */
661 if (copy_from_user(&val, (unsigned long*)arg, sizeof(val))) 681 if (copy_from_user(&val, (unsigned long *)arg, sizeof(val)))
662 return -EFAULT; 682 return -EFAULT;
663 val = setget_input(priv, val); 683 val = setget_input(priv, val);
664 if (copy_to_user((unsigned long*)arg, &val, sizeof(val))) 684 if (copy_to_user((unsigned long *)arg, &val, sizeof(val)))
665 return -EFAULT; 685 return -EFAULT;
666 break; 686 break;
667 case IO_SETGET_OUTPUT: 687 case IO_SETGET_OUTPUT:
668 /* bits set in *arg is set to output, 688 /* bits set in *arg is set to output,
669 * *arg updated with current output pins. 689 * *arg updated with current output pins.
670 */ 690 */
671 if (copy_from_user(&val, (unsigned long*)arg, sizeof(val))) 691 if (copy_from_user(&val, (unsigned long *)arg, sizeof(val)))
672 return -EFAULT; 692 return -EFAULT;
673 val = setget_output(priv, val); 693 val = setget_output(priv, val);
674 if (copy_to_user((unsigned long*)arg, &val, sizeof(val))) 694 if (copy_to_user((unsigned long *)arg, &val, sizeof(val)))
675 return -EFAULT; 695 return -EFAULT;
676 break; 696 break;
677 default: 697 default:
@@ -684,6 +704,133 @@ gpio_ioctl(struct inode *inode, struct file *file,
684 return 0; 704 return 0;
685} 705}
686 706
707#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
708static int
709virtual_gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
710{
711 unsigned long flags;
712 unsigned short val;
713 unsigned short shadow;
714 struct gpio_private *priv = (struct gpio_private *)file->private_data;
715
716 switch (_IOC_NR(cmd)) {
717 case IO_SETBITS:
718 local_irq_save(flags);
719 /* Set changeable bits with a 1 in arg. */
720 i2c_read(VIRT_I2C_ADDR, (void *)&shadow, sizeof(shadow));
721 shadow |= ~*dir_oe[priv->minor];
722 shadow |= (arg & changeable_bits[priv->minor]);
723 i2c_write(VIRT_I2C_ADDR, (void *)&shadow, sizeof(shadow));
724 local_irq_restore(flags);
725 break;
726 case IO_CLRBITS:
727 local_irq_save(flags);
728 /* Clear changeable bits with a 1 in arg. */
729 i2c_read(VIRT_I2C_ADDR, (void *)&shadow, sizeof(shadow));
730 shadow |= ~*dir_oe[priv->minor];
731 shadow &= ~(arg & changeable_bits[priv->minor]);
732 i2c_write(VIRT_I2C_ADDR, (void *)&shadow, sizeof(shadow));
733 local_irq_restore(flags);
734 break;
735 case IO_HIGHALARM:
736 /* Set alarm when bits with 1 in arg go high. */
737 priv->highalarm |= arg;
738 spin_lock(&alarm_lock);
739 gpio_some_alarms = 1;
740 spin_unlock(&alarm_lock);
741 break;
742 case IO_LOWALARM:
743 /* Set alarm when bits with 1 in arg go low. */
744 priv->lowalarm |= arg;
745 spin_lock(&alarm_lock);
746 gpio_some_alarms = 1;
747 spin_unlock(&alarm_lock);
748 break;
749 case IO_CLRALARM:
750 /* Clear alarm for bits with 1 in arg. */
751 priv->highalarm &= ~arg;
752 priv->lowalarm &= ~arg;
753 spin_lock(&alarm_lock);
754 spin_unlock(&alarm_lock);
755 break;
756 case IO_CFG_WRITE_MODE:
757 {
758 unsigned long dir_shadow;
759 dir_shadow = *dir_oe[priv->minor];
760
761 priv->clk_mask = arg & 0xFF;
762 priv->data_mask = (arg >> 8) & 0xFF;
763 priv->write_msb = (arg >> 16) & 0x01;
764 /* Check if we're allowed to change the bits and
765 * the direction is correct
766 */
767 if (!((priv->clk_mask & changeable_bits[priv->minor]) &&
768 (priv->data_mask & changeable_bits[priv->minor]) &&
769 (priv->clk_mask & dir_shadow) &&
770 (priv->data_mask & dir_shadow))) {
771 priv->clk_mask = 0;
772 priv->data_mask = 0;
773 return -EPERM;
774 }
775 break;
776 }
777 case IO_READ_INBITS:
778 /* *arg is result of reading the input pins */
779 val = cached_virtual_gpio_read;
780 val &= ~*dir_oe[priv->minor];
781 if (copy_to_user((unsigned long *)arg, &val, sizeof(val)))
782 return -EFAULT;
783 return 0;
784 break;
785 case IO_READ_OUTBITS:
786 /* *arg is result of reading the output shadow */
787 i2c_read(VIRT_I2C_ADDR, (void *)&val, sizeof(val));
788 val &= *dir_oe[priv->minor];
789 if (copy_to_user((unsigned long *)arg, &val, sizeof(val)))
790 return -EFAULT;
791 break;
792 case IO_SETGET_INPUT:
793 {
794 /* bits set in *arg is set to input,
795 * *arg updated with current input pins.
796 */
797 unsigned short input_mask = ~*dir_oe[priv->minor];
798 if (copy_from_user(&val, (unsigned long *)arg, sizeof(val)))
799 return -EFAULT;
800 val = setget_input(priv, val);
801 if (copy_to_user((unsigned long *)arg, &val, sizeof(val)))
802 return -EFAULT;
803 if ((input_mask & val) != input_mask) {
804 /* Input pins changed. All ports desired as input
805 * should be set to logic 1.
806 */
807 unsigned short change = input_mask ^ val;
808 i2c_read(VIRT_I2C_ADDR, (void *)&shadow,
809 sizeof(shadow));
810 shadow &= ~change;
811 shadow |= val;
812 i2c_write(VIRT_I2C_ADDR, (void *)&shadow,
813 sizeof(shadow));
814 }
815 break;
816 }
817 case IO_SETGET_OUTPUT:
818 /* bits set in *arg is set to output,
819 * *arg updated with current output pins.
820 */
821 if (copy_from_user(&val, (unsigned long *)arg, sizeof(val)))
822 return -EFAULT;
823 val = setget_output(priv, val);
824 if (copy_to_user((unsigned long *)arg, &val, sizeof(val)))
825 return -EFAULT;
826 break;
827 default:
828 return -EINVAL;
829 } /* switch */
830 return 0;
831}
832#endif /* CONFIG_ETRAX_VIRTUAL_GPIO */
833
687static int 834static int
688gpio_leds_ioctl(unsigned int cmd, unsigned long arg) 835gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
689{ 836{
@@ -694,8 +841,8 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
694 case IO_LEDACTIVE_SET: 841 case IO_LEDACTIVE_SET:
695 green = ((unsigned char) arg) & 1; 842 green = ((unsigned char) arg) & 1;
696 red = (((unsigned char) arg) >> 1) & 1; 843 red = (((unsigned char) arg) >> 1) & 1;
697 LED_ACTIVE_SET_G(green); 844 CRIS_LED_ACTIVE_SET_G(green);
698 LED_ACTIVE_SET_R(red); 845 CRIS_LED_ACTIVE_SET_R(red);
699 break; 846 break;
700 847
701 default: 848 default:
@@ -705,7 +852,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
705 return 0; 852 return 0;
706} 853}
707 854
708const struct file_operations gpio_fops = { 855struct file_operations gpio_fops = {
709 .owner = THIS_MODULE, 856 .owner = THIS_MODULE,
710 .poll = gpio_poll, 857 .poll = gpio_poll,
711 .ioctl = gpio_ioctl, 858 .ioctl = gpio_ioctl,
@@ -714,6 +861,66 @@ const struct file_operations gpio_fops = {
714 .release = gpio_release, 861 .release = gpio_release,
715}; 862};
716 863
864#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
865static void
866virtual_gpio_init(void)
867{
868 reg_gio_rw_intr_cfg intr_cfg;
869 reg_gio_rw_intr_mask intr_mask;
870 unsigned short shadow;
871
872 shadow = ~virtual_rw_pv_oe; /* Input ports should be set to logic 1 */
873 shadow |= CONFIG_ETRAX_DEF_GIO_PV_OUT;
874 i2c_write(VIRT_I2C_ADDR, (void *)&shadow, sizeof(shadow));
875
876 /* Set interrupt mask and on what state the interrupt shall trigger.
877 * For virtual gpio the interrupt shall trigger on logic '0'.
878 */
879 intr_cfg = REG_RD(gio, regi_gio, rw_intr_cfg);
880 intr_mask = REG_RD(gio, regi_gio, rw_intr_mask);
881
882 switch (CONFIG_ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN) {
883 case 0:
884 intr_cfg.pa0 = regk_gio_lo;
885 intr_mask.pa0 = regk_gio_yes;
886 break;
887 case 1:
888 intr_cfg.pa1 = regk_gio_lo;
889 intr_mask.pa1 = regk_gio_yes;
890 break;
891 case 2:
892 intr_cfg.pa2 = regk_gio_lo;
893 intr_mask.pa2 = regk_gio_yes;
894 break;
895 case 3:
896 intr_cfg.pa3 = regk_gio_lo;
897 intr_mask.pa3 = regk_gio_yes;
898 break;
899 case 4:
900 intr_cfg.pa4 = regk_gio_lo;
901 intr_mask.pa4 = regk_gio_yes;
902 break;
903 case 5:
904 intr_cfg.pa5 = regk_gio_lo;
905 intr_mask.pa5 = regk_gio_yes;
906 break;
907 case 6:
908 intr_cfg.pa6 = regk_gio_lo;
909 intr_mask.pa6 = regk_gio_yes;
910 break;
911 case 7:
912 intr_cfg.pa7 = regk_gio_lo;
913 intr_mask.pa7 = regk_gio_yes;
914 break;
915 }
916
917 REG_WR(gio, regi_gio, rw_intr_cfg, intr_cfg);
918 REG_WR(gio, regi_gio, rw_intr_mask, intr_mask);
919
920 gpio_pa_low_alarms |= (1 << CONFIG_ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_PIN);
921 gpio_some_alarms = 1;
922}
923#endif
717 924
718/* main driver initialization routine, called from mem.c */ 925/* main driver initialization routine, called from mem.c */
719 926
@@ -721,7 +928,6 @@ static __init int
721gpio_init(void) 928gpio_init(void)
722{ 929{
723 int res; 930 int res;
724 reg_intr_vect_rw_mask intr_mask;
725 931
726 /* do the formalities */ 932 /* do the formalities */
727 933
@@ -732,30 +938,30 @@ gpio_init(void)
732 } 938 }
733 939
734 /* Clear all leds */ 940 /* Clear all leds */
735 LED_NETWORK_SET(0); 941 CRIS_LED_NETWORK_GRP0_SET(0);
736 LED_ACTIVE_SET(0); 942 CRIS_LED_NETWORK_GRP1_SET(0);
737 LED_DISK_READ(0); 943 CRIS_LED_ACTIVE_SET(0);
738 LED_DISK_WRITE(0); 944 CRIS_LED_DISK_READ(0);
739 945 CRIS_LED_DISK_WRITE(0);
740 printk("ETRAX FS GPIO driver v2.5, (c) 2003-2005 Axis Communications AB\n"); 946
947 printk(KERN_INFO "ETRAX FS GPIO driver v2.5, (c) 2003-2007 "
948 "Axis Communications AB\n");
741 /* We call etrax_gpio_wake_up_check() from timer interrupt and 949 /* We call etrax_gpio_wake_up_check() from timer interrupt and
742 * from cpu_idle() in kernel/process.c 950 * from cpu_idle() in kernel/process.c
743 * The check in cpu_idle() reduces latency from ~15 ms to ~6 ms 951 * The check in cpu_idle() reduces latency from ~15 ms to ~6 ms
744 * in some tests. 952 * in some tests.
745 */ 953 */
746 if (request_irq(TIMER_INTR_VECT, gpio_poll_timer_interrupt, 954 if (request_irq(TIMER0_INTR_VECT, gpio_poll_timer_interrupt,
747 IRQF_SHARED | IRQF_DISABLED,"gpio poll", &alarmlist)) { 955 IRQF_SHARED | IRQF_DISABLED, "gpio poll", &alarmlist))
748 printk("err: timer0 irq for gpio\n"); 956 printk(KERN_ERR "timer0 irq for gpio\n");
749 } 957
750 if (request_irq(GEN_IO_INTR_VECT, gpio_pa_interrupt, 958 if (request_irq(GIO_INTR_VECT, gpio_pa_interrupt,
751 IRQF_SHARED | IRQF_DISABLED,"gpio PA", &alarmlist)) { 959 IRQF_SHARED | IRQF_DISABLED, "gpio PA", &alarmlist))
752 printk("err: PA irq for gpio\n"); 960 printk(KERN_ERR "PA irq for gpio\n");
753 } 961
754 /* enable the gio and timer irq in global config */ 962#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
755 intr_mask = REG_RD(intr_vect, regi_irq, rw_mask); 963 virtual_gpio_init();
756 intr_mask.timer = 1; 964#endif
757 intr_mask.gen_io = 1;
758 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
759 965
760 return res; 966 return res;
761} 967}
diff --git a/arch/cris/arch-v32/drivers/nandflash.c b/arch/cris/arch-v32/drivers/mach-fs/nandflash.c
index 5ce015c6bb0d..aa01b134458a 100644
--- a/arch/cris/arch-v32/drivers/nandflash.c
+++ b/arch/cris/arch-v32/drivers/mach-fs/nandflash.c
@@ -4,9 +4,7 @@
4 * Copyright (c) 2004 4 * Copyright (c) 2004
5 * 5 *
6 * Derived from drivers/mtd/nand/spia.c 6 * Derived from drivers/mtd/nand/spia.c
7 * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com) 7 * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com)
8 *
9 * $Id: nandflash.c,v 1.3 2005/06/01 10:57:12 starvik Exp $
10 * 8 *
11 * This program is free software; you can redistribute it and/or modify 9 * 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 10 * it under the terms of the GNU General Public License version 2 as
@@ -21,10 +19,10 @@
21#include <linux/mtd/nand.h> 19#include <linux/mtd/nand.h>
22#include <linux/mtd/partitions.h> 20#include <linux/mtd/partitions.h>
23#include <asm/arch/memmap.h> 21#include <asm/arch/memmap.h>
24#include <asm/arch/hwregs/reg_map.h> 22#include <hwregs/reg_map.h>
25#include <asm/arch/hwregs/reg_rdwr.h> 23#include <hwregs/reg_rdwr.h>
26#include <asm/arch/hwregs/gio_defs.h> 24#include <hwregs/gio_defs.h>
27#include <asm/arch/hwregs/bif_core_defs.h> 25#include <hwregs/bif_core_defs.h>
28#include <asm/io.h> 26#include <asm/io.h>
29 27
30#define CE_BIT 4 28#define CE_BIT 4
@@ -32,44 +30,65 @@
32#define ALE_BIT 6 30#define ALE_BIT 6
33#define BY_BIT 7 31#define BY_BIT 7
34 32
35static struct mtd_info *crisv32_mtd = NULL; 33struct mtd_info_wrapper {
34 struct mtd_info info;
35 struct nand_chip chip;
36};
37
38/* Bitmask for control pins */
39#define PIN_BITMASK ((1 << CE_BIT) | (1 << CLE_BIT) | (1 << ALE_BIT))
40
41/* Bitmask for mtd nand control bits */
42#define CTRL_BITMASK (NAND_NCE | NAND_CLE | NAND_ALE)
43
44
45static struct mtd_info *crisv32_mtd;
36/* 46/*
37 * hardware specific access to control-lines 47 * hardware specific access to control-lines
38*/ 48 */
39static void crisv32_hwcontrol(struct mtd_info *mtd, int cmd) 49static void crisv32_hwcontrol(struct mtd_info *mtd, int cmd,
50 unsigned int ctrl)
40{ 51{
41 unsigned long flags; 52 unsigned long flags;
42 reg_gio_rw_pa_dout dout = REG_RD(gio, regi_gio, rw_pa_dout); 53 reg_gio_rw_pa_dout dout;
54 struct nand_chip *this = mtd->priv;
43 55
44 local_irq_save(flags); 56 local_irq_save(flags);
45 switch(cmd){ 57
46 case NAND_CTL_SETCLE: 58 /* control bits change */
47 dout.data |= (1<<CLE_BIT); 59 if (ctrl & NAND_CTRL_CHANGE) {
48 break; 60 dout = REG_RD(gio, regi_gio, rw_pa_dout);
49 case NAND_CTL_CLRCLE: 61 dout.data &= ~PIN_BITMASK;
50 dout.data &= ~(1<<CLE_BIT); 62
51 break; 63#if (CE_BIT == 4 && NAND_NCE == 1 && \
52 case NAND_CTL_SETALE: 64 CLE_BIT == 5 && NAND_CLE == 2 && \
53 dout.data |= (1<<ALE_BIT); 65 ALE_BIT == 6 && NAND_ALE == 4)
54 break; 66 /* Pins in same order as control bits, but shifted.
55 case NAND_CTL_CLRALE: 67 * Optimize for this case; works for 2.6.18 */
56 dout.data &= ~(1<<ALE_BIT); 68 dout.data |= ((ctrl & CTRL_BITMASK) ^ NAND_NCE) << CE_BIT;
57 break; 69#else
58 case NAND_CTL_SETNCE: 70 /* the slow way */
59 dout.data |= (1<<CE_BIT); 71 if (!(ctrl & NAND_NCE))
60 break; 72 dout.data |= (1 << CE_BIT);
61 case NAND_CTL_CLRNCE: 73 if (ctrl & NAND_CLE)
62 dout.data &= ~(1<<CE_BIT); 74 dout.data |= (1 << CLE_BIT);
63 break; 75 if (ctrl & NAND_ALE)
76 dout.data |= (1 << ALE_BIT);
77#endif
78 REG_WR(gio, regi_gio, rw_pa_dout, dout);
64 } 79 }
65 REG_WR(gio, regi_gio, rw_pa_dout, dout); 80
81 /* command to chip */
82 if (cmd != NAND_CMD_NONE)
83 writeb(cmd, this->IO_ADDR_W);
84
66 local_irq_restore(flags); 85 local_irq_restore(flags);
67} 86}
68 87
69/* 88/*
70* read device ready pin 89* read device ready pin
71*/ 90*/
72int crisv32_device_ready(struct mtd_info *mtd) 91static int crisv32_device_ready(struct mtd_info *mtd)
73{ 92{
74 reg_gio_r_pa_din din = REG_RD(gio, regi_gio, r_pa_din); 93 reg_gio_r_pa_din din = REG_RD(gio, regi_gio, r_pa_din);
75 return ((din.data & (1 << BY_BIT)) >> BY_BIT); 94 return ((din.data & (1 << BY_BIT)) >> BY_BIT);
@@ -78,21 +97,23 @@ int crisv32_device_ready(struct mtd_info *mtd)
78/* 97/*
79 * Main initialization routine 98 * Main initialization routine
80 */ 99 */
81struct mtd_info* __init crisv32_nand_flash_probe (void) 100struct mtd_info *__init crisv32_nand_flash_probe(void)
82{ 101{
83 void __iomem *read_cs; 102 void __iomem *read_cs;
84 void __iomem *write_cs; 103 void __iomem *write_cs;
85 104
86 reg_bif_core_rw_grp3_cfg bif_cfg = REG_RD(bif_core, regi_bif_core, rw_grp3_cfg); 105 reg_bif_core_rw_grp3_cfg bif_cfg = REG_RD(bif_core, regi_bif_core,
106 rw_grp3_cfg);
87 reg_gio_rw_pa_oe pa_oe = REG_RD(gio, regi_gio, rw_pa_oe); 107 reg_gio_rw_pa_oe pa_oe = REG_RD(gio, regi_gio, rw_pa_oe);
108 struct mtd_info_wrapper *wrapper;
88 struct nand_chip *this; 109 struct nand_chip *this;
89 int err = 0; 110 int err = 0;
90 111
91 /* Allocate memory for MTD device structure and private data */ 112 /* Allocate memory for MTD device structure and private data */
92 crisv32_mtd = kmalloc (sizeof(struct mtd_info) + sizeof (struct nand_chip), 113 wrapper = kzalloc(sizeof(struct mtd_info_wrapper), GFP_KERNEL);
93 GFP_KERNEL); 114 if (!wrapper) {
94 if (!crisv32_mtd) { 115 printk(KERN_ERR "Unable to allocate CRISv32 NAND MTD "
95 printk ("Unable to allocate CRISv32 NAND MTD device structure.\n"); 116 "device structure.\n");
96 err = -ENOMEM; 117 err = -ENOMEM;
97 return NULL; 118 return NULL;
98 } 119 }
@@ -101,45 +122,42 @@ struct mtd_info* __init crisv32_nand_flash_probe (void)
101 write_cs = ioremap(MEM_CSP1_START | MEM_NON_CACHEABLE, 8192); 122 write_cs = ioremap(MEM_CSP1_START | MEM_NON_CACHEABLE, 8192);
102 123
103 if (!read_cs || !write_cs) { 124 if (!read_cs || !write_cs) {
104 printk("CRISv32 NAND ioremap failed\n"); 125 printk(KERN_ERR "CRISv32 NAND ioremap failed\n");
105 err = -EIO; 126 err = -EIO;
106 goto out_mtd; 127 goto out_mtd;
107 } 128 }
108 129
109 /* Get pointer to private data */ 130 /* Get pointer to private data */
110 this = (struct nand_chip *) (&crisv32_mtd[1]); 131 this = &wrapper->chip;
132 crisv32_mtd = &wrapper->info;
111 133
112 pa_oe.oe |= 1 << CE_BIT; 134 pa_oe.oe |= 1 << CE_BIT;
113 pa_oe.oe |= 1 << ALE_BIT; 135 pa_oe.oe |= 1 << ALE_BIT;
114 pa_oe.oe |= 1 << CLE_BIT; 136 pa_oe.oe |= 1 << CLE_BIT;
115 pa_oe.oe &= ~ (1 << BY_BIT); 137 pa_oe.oe &= ~(1 << BY_BIT);
116 REG_WR(gio, regi_gio, rw_pa_oe, pa_oe); 138 REG_WR(gio, regi_gio, rw_pa_oe, pa_oe);
117 139
118 bif_cfg.gated_csp0 = regk_bif_core_rd; 140 bif_cfg.gated_csp0 = regk_bif_core_rd;
119 bif_cfg.gated_csp1 = regk_bif_core_wr; 141 bif_cfg.gated_csp1 = regk_bif_core_wr;
120 REG_WR(bif_core, regi_bif_core, rw_grp3_cfg, bif_cfg); 142 REG_WR(bif_core, regi_bif_core, rw_grp3_cfg, bif_cfg);
121 143
122 /* Initialize structures */
123 memset((char *) crisv32_mtd, 0, sizeof(struct mtd_info));
124 memset((char *) this, 0, sizeof(struct nand_chip));
125
126 /* Link the private data with the MTD structure */ 144 /* Link the private data with the MTD structure */
127 crisv32_mtd->priv = this; 145 crisv32_mtd->priv = this;
128 146
129 /* Set address of NAND IO lines */ 147 /* Set address of NAND IO lines */
130 this->IO_ADDR_R = read_cs; 148 this->IO_ADDR_R = read_cs;
131 this->IO_ADDR_W = write_cs; 149 this->IO_ADDR_W = write_cs;
132 this->hwcontrol = crisv32_hwcontrol; 150 this->cmd_ctrl = crisv32_hwcontrol;
133 this->dev_ready = crisv32_device_ready; 151 this->dev_ready = crisv32_device_ready;
134 /* 20 us command delay time */ 152 /* 20 us command delay time */
135 this->chip_delay = 20; 153 this->chip_delay = 20;
136 this->eccmode = NAND_ECC_SOFT; 154 this->ecc.mode = NAND_ECC_SOFT;
137 155
138 /* Enable the following for a flash based bad block table */ 156 /* Enable the following for a flash based bad block table */
139 this->options = NAND_USE_FLASH_BBT; 157 /* this->options = NAND_USE_FLASH_BBT; */
140 158
141 /* Scan to find existence of the device */ 159 /* Scan to find existance of the device */
142 if (nand_scan (crisv32_mtd, 1)) { 160 if (nand_scan(crisv32_mtd, 1)) {
143 err = -ENXIO; 161 err = -ENXIO;
144 goto out_ior; 162 goto out_ior;
145 } 163 }
@@ -150,7 +168,7 @@ out_ior:
150 iounmap((void *)read_cs); 168 iounmap((void *)read_cs);
151 iounmap((void *)write_cs); 169 iounmap((void *)write_cs);
152out_mtd: 170out_mtd:
153 kfree (crisv32_mtd); 171 kfree(wrapper);
154 return NULL; 172 return NULL;
155} 173}
156 174
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c
index 6dbd700d3d66..53db3870ba04 100644
--- a/arch/cris/arch-v32/drivers/pcf8563.c
+++ b/arch/cris/arch-v32/drivers/pcf8563.c
@@ -10,7 +10,7 @@
10 * 400 kbits/s. The built-in word address register is incremented 10 * 400 kbits/s. The built-in word address register is incremented
11 * automatically after each written or read byte. 11 * automatically after each written or read byte.
12 * 12 *
13 * Copyright (c) 2002-2003, Axis Communications AB 13 * Copyright (c) 2002-2007, Axis Communications AB
14 * All rights reserved. 14 * All rights reserved.
15 * 15 *
16 * Author: Tobias Anderberg <tobiasa@axis.com>. 16 * Author: Tobias Anderberg <tobiasa@axis.com>.
@@ -26,6 +26,7 @@
26#include <linux/ioctl.h> 26#include <linux/ioctl.h>
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/bcd.h> 28#include <linux/bcd.h>
29#include <linux/mutex.h>
29 30
30#include <asm/uaccess.h> 31#include <asm/uaccess.h>
31#include <asm/system.h> 32#include <asm/system.h>
@@ -37,24 +38,27 @@
37#define PCF8563_MAJOR 121 /* Local major number. */ 38#define PCF8563_MAJOR 121 /* Local major number. */
38#define DEVICE_NAME "rtc" /* Name which is registered in /proc/devices. */ 39#define DEVICE_NAME "rtc" /* Name which is registered in /proc/devices. */
39#define PCF8563_NAME "PCF8563" 40#define PCF8563_NAME "PCF8563"
40#define DRIVER_VERSION "$Revision: 1.1 $" 41#define DRIVER_VERSION "$Revision: 1.17 $"
41 42
42/* Two simple wrapper macros, saves a few keystrokes. */ 43/* Two simple wrapper macros, saves a few keystrokes. */
43#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) 44#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x)
44#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) 45#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y)
45 46
47static DEFINE_MUTEX(rtc_lock); /* Protect state etc */
48
46static const unsigned char days_in_month[] = 49static const unsigned char days_in_month[] =
47 { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 50 { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
48 51
49int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); 52int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
50int pcf8563_open(struct inode *, struct file *); 53
51int pcf8563_release(struct inode *, struct file *); 54/* Cache VL bit value read at driver init since writing the RTC_SECOND
55 * register clears the VL status.
56 */
57static int voltage_low;
52 58
53static const struct file_operations pcf8563_fops = { 59static const struct file_operations pcf8563_fops = {
54 .owner = THIS_MODULE, 60 .owner = THIS_MODULE,
55 .ioctl = pcf8563_ioctl, 61 .ioctl = pcf8563_ioctl
56 .open = pcf8563_open,
57 .release = pcf8563_release,
58}; 62};
59 63
60unsigned char 64unsigned char
@@ -62,7 +66,7 @@ pcf8563_readreg(int reg)
62{ 66{
63 unsigned char res = rtc_read(reg); 67 unsigned char res = rtc_read(reg);
64 68
65 /* The PCF8563 does not return 0 for unimplemented bits */ 69 /* The PCF8563 does not return 0 for unimplemented bits. */
66 switch (reg) { 70 switch (reg) {
67 case RTC_SECONDS: 71 case RTC_SECONDS:
68 case RTC_MINUTES: 72 case RTC_MINUTES:
@@ -95,11 +99,6 @@ pcf8563_readreg(int reg)
95void 99void
96pcf8563_writereg(int reg, unsigned char val) 100pcf8563_writereg(int reg, unsigned char val)
97{ 101{
98#ifdef CONFIG_ETRAX_RTC_READONLY
99 if (reg == RTC_CONTROL1 || (reg >= RTC_SECONDS && reg <= RTC_YEAR))
100 return;
101#endif
102
103 rtc_write(reg, val); 102 rtc_write(reg, val);
104} 103}
105 104
@@ -114,11 +113,13 @@ get_rtc_time(struct rtc_time *tm)
114 tm->tm_mon = rtc_read(RTC_MONTH); 113 tm->tm_mon = rtc_read(RTC_MONTH);
115 tm->tm_year = rtc_read(RTC_YEAR); 114 tm->tm_year = rtc_read(RTC_YEAR);
116 115
117 if (tm->tm_sec & 0x80) 116 if (tm->tm_sec & 0x80) {
118 printk(KERN_WARNING "%s: RTC Voltage Low - reliable date/time " 117 printk(KERN_ERR "%s: RTC Voltage Low - reliable date/time "
119 "information is no longer guaranteed!\n", PCF8563_NAME); 118 "information is no longer guaranteed!\n", PCF8563_NAME);
119 }
120 120
121 tm->tm_year = BCD_TO_BIN(tm->tm_year) + ((tm->tm_mon & 0x80) ? 100 : 0); 121 tm->tm_year = BCD_TO_BIN(tm->tm_year) +
122 ((tm->tm_mon & 0x80) ? 100 : 0);
122 tm->tm_sec &= 0x7F; 123 tm->tm_sec &= 0x7F;
123 tm->tm_min &= 0x7F; 124 tm->tm_min &= 0x7F;
124 tm->tm_hour &= 0x3F; 125 tm->tm_hour &= 0x3F;
@@ -137,8 +138,19 @@ get_rtc_time(struct rtc_time *tm)
137int __init 138int __init
138pcf8563_init(void) 139pcf8563_init(void)
139{ 140{
141 static int res;
142 static int first = 1;
143
144 if (!first)
145 return res;
146 first = 0;
147
140 /* Initiate the i2c protocol. */ 148 /* Initiate the i2c protocol. */
141 i2c_init(); 149 res = i2c_init();
150 if (res < 0) {
151 printk(KERN_CRIT "pcf8563_init: Failed to init i2c.\n");
152 return res;
153 }
142 154
143 /* 155 /*
144 * First of all we need to reset the chip. This is done by 156 * First of all we need to reset the chip. This is done by
@@ -170,24 +182,20 @@ pcf8563_init(void)
170 if (rtc_write(RTC_WEEKDAY_ALARM, 0x80) < 0) 182 if (rtc_write(RTC_WEEKDAY_ALARM, 0x80) < 0)
171 goto err; 183 goto err;
172 184
173 if (register_chrdev(PCF8563_MAJOR, DEVICE_NAME, &pcf8563_fops) < 0) { 185 /* Check for low voltage, and warn about it. */
174 printk(KERN_INFO "%s: Unable to get major number %d for RTC device.\n", 186 if (rtc_read(RTC_SECONDS) & 0x80) {
175 PCF8563_NAME, PCF8563_MAJOR); 187 voltage_low = 1;
176 return -1; 188 printk(KERN_WARNING "%s: RTC Voltage Low - reliable "
189 "date/time information is no longer guaranteed!\n",
190 PCF8563_NAME);
177 } 191 }
178 192
179 printk(KERN_INFO "%s Real-Time Clock Driver, %s\n", PCF8563_NAME, DRIVER_VERSION); 193 return res;
180
181 /* Check for low voltage, and warn about it.. */
182 if (rtc_read(RTC_SECONDS) & 0x80)
183 printk(KERN_WARNING "%s: RTC Voltage Low - reliable date/time "
184 "information is no longer guaranteed!\n", PCF8563_NAME);
185
186 return 0;
187 194
188err: 195err:
189 printk(KERN_INFO "%s: Error initializing chip.\n", PCF8563_NAME); 196 printk(KERN_INFO "%s: Error initializing chip.\n", PCF8563_NAME);
190 return -1; 197 res = -1;
198 return res;
191} 199}
192 200
193void __exit 201void __exit
@@ -200,8 +208,8 @@ pcf8563_exit(void)
200 * ioctl calls for this driver. Why return -ENOTTY upon error? Because 208 * ioctl calls for this driver. Why return -ENOTTY upon error? Because
201 * POSIX says so! 209 * POSIX says so!
202 */ 210 */
203int 211int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
204pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) 212 unsigned long arg)
205{ 213{
206 /* Some sanity checks. */ 214 /* Some sanity checks. */
207 if (_IOC_TYPE(cmd) != RTC_MAGIC) 215 if (_IOC_TYPE(cmd) != RTC_MAGIC)
@@ -211,125 +219,147 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned
211 return -ENOTTY; 219 return -ENOTTY;
212 220
213 switch (cmd) { 221 switch (cmd) {
214 case RTC_RD_TIME: 222 case RTC_RD_TIME:
215 { 223 {
216 struct rtc_time tm; 224 struct rtc_time tm;
217 225
218 memset(&tm, 0, sizeof (struct rtc_time)); 226 mutex_lock(&rtc_lock);
219 get_rtc_time(&tm); 227 memset(&tm, 0, sizeof tm);
220 228 get_rtc_time(&tm);
221 if (copy_to_user((struct rtc_time *) arg, &tm, sizeof tm)) { 229
222 return -EFAULT; 230 if (copy_to_user((struct rtc_time *) arg, &tm,
223 } 231 sizeof tm)) {
224 232 spin_unlock(&rtc_lock);
225 return 0; 233 return -EFAULT;
226 } 234 }
227 235
228 case RTC_SET_TIME: 236 mutex_unlock(&rtc_lock);
229 { 237
230#ifdef CONFIG_ETRAX_RTC_READONLY 238 return 0;
239 }
240 case RTC_SET_TIME:
241 {
242 int leap;
243 int year;
244 int century;
245 struct rtc_time tm;
246
247 memset(&tm, 0, sizeof tm);
248 if (!capable(CAP_SYS_TIME))
231 return -EPERM; 249 return -EPERM;
232#else
233 int leap;
234 int year;
235 int century;
236 struct rtc_time tm;
237
238 if (!capable(CAP_SYS_TIME))
239 return -EPERM;
240
241 if (copy_from_user(&tm, (struct rtc_time *) arg, sizeof tm))
242 return -EFAULT;
243
244 /* Convert from struct tm to struct rtc_time. */
245 tm.tm_year += 1900;
246 tm.tm_mon += 1;
247
248 /*
249 * Check if tm.tm_year is a leap year. A year is a leap
250 * year if it is divisible by 4 but not 100, except
251 * that years divisible by 400 _are_ leap years.
252 */
253 year = tm.tm_year;
254 leap = (tm.tm_mon == 2) && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
255
256 /* Perform some sanity checks. */
257 if ((tm.tm_year < 1970) ||
258 (tm.tm_mon > 12) ||
259 (tm.tm_mday == 0) ||
260 (tm.tm_mday > days_in_month[tm.tm_mon] + leap) ||
261 (tm.tm_wday >= 7) ||
262 (tm.tm_hour >= 24) ||
263 (tm.tm_min >= 60) ||
264 (tm.tm_sec >= 60))
265 return -EINVAL;
266
267 century = (tm.tm_year >= 2000) ? 0x80 : 0;
268 tm.tm_year = tm.tm_year % 100;
269
270 BIN_TO_BCD(tm.tm_year);
271 BIN_TO_BCD(tm.tm_mday);
272 BIN_TO_BCD(tm.tm_hour);
273 BIN_TO_BCD(tm.tm_min);
274 BIN_TO_BCD(tm.tm_sec);
275 tm.tm_mon |= century;
276
277 rtc_write(RTC_YEAR, tm.tm_year);
278 rtc_write(RTC_MONTH, tm.tm_mon);
279 rtc_write(RTC_WEEKDAY, tm.tm_wday); /* Not coded in BCD. */
280 rtc_write(RTC_DAY_OF_MONTH, tm.tm_mday);
281 rtc_write(RTC_HOURS, tm.tm_hour);
282 rtc_write(RTC_MINUTES, tm.tm_min);
283 rtc_write(RTC_SECONDS, tm.tm_sec);
284
285 return 0;
286#endif /* !CONFIG_ETRAX_RTC_READONLY */
287 }
288 250
289 case RTC_VLOW_RD: 251 if (copy_from_user(&tm, (struct rtc_time *) arg,
290 { 252 sizeof tm))
291 int vl_bit = 0; 253 return -EFAULT;
254
255 /* Convert from struct tm to struct rtc_time. */
256 tm.tm_year += 1900;
257 tm.tm_mon += 1;
258
259 /*
260 * Check if tm.tm_year is a leap year. A year is a leap
261 * year if it is divisible by 4 but not 100, except
262 * that years divisible by 400 _are_ leap years.
263 */
264 year = tm.tm_year;
265 leap = (tm.tm_mon == 2) &&
266 ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
267
268 /* Perform some sanity checks. */
269 if ((tm.tm_year < 1970) ||
270 (tm.tm_mon > 12) ||
271 (tm.tm_mday == 0) ||
272 (tm.tm_mday > days_in_month[tm.tm_mon] + leap) ||
273 (tm.tm_wday >= 7) ||
274 (tm.tm_hour >= 24) ||
275 (tm.tm_min >= 60) ||
276 (tm.tm_sec >= 60))
277 return -EINVAL;
278
279 century = (tm.tm_year >= 2000) ? 0x80 : 0;
280 tm.tm_year = tm.tm_year % 100;
281
282 BIN_TO_BCD(tm.tm_year);
283 BIN_TO_BCD(tm.tm_mon);
284 BIN_TO_BCD(tm.tm_mday);
285 BIN_TO_BCD(tm.tm_hour);
286 BIN_TO_BCD(tm.tm_min);
287 BIN_TO_BCD(tm.tm_sec);
288 tm.tm_mon |= century;
289
290 mutex_lock(&rtc_lock);
291
292 rtc_write(RTC_YEAR, tm.tm_year);
293 rtc_write(RTC_MONTH, tm.tm_mon);
294 rtc_write(RTC_WEEKDAY, tm.tm_wday); /* Not coded in BCD. */
295 rtc_write(RTC_DAY_OF_MONTH, tm.tm_mday);
296 rtc_write(RTC_HOURS, tm.tm_hour);
297 rtc_write(RTC_MINUTES, tm.tm_min);
298 rtc_write(RTC_SECONDS, tm.tm_sec);
299
300 mutex_unlock(&rtc_lock);
301
302 return 0;
303 }
304 case RTC_VL_READ:
305 if (voltage_low)
306 printk(KERN_ERR "%s: RTC Voltage Low - "
307 "reliable date/time information is no "
308 "longer guaranteed!\n", PCF8563_NAME);
292 309
293 if (rtc_read(RTC_SECONDS) & 0x80) { 310 if (copy_to_user((int *) arg, &voltage_low, sizeof(int)))
294 vl_bit = 1; 311 return -EFAULT;
295 printk(KERN_WARNING "%s: RTC Voltage Low - reliable " 312 return 0;
296 "date/time information is no longer guaranteed!\n",
297 PCF8563_NAME);
298 }
299 if (copy_to_user((int *) arg, &vl_bit, sizeof(int)))
300 return -EFAULT;
301 313
302 return 0; 314 case RTC_VL_CLR:
303 } 315 {
316 /* Clear the VL bit in the seconds register in case
317 * the time has not been set already (which would
318 * have cleared it). This does not really matter
319 * because of the cached voltage_low value but do it
320 * anyway for consistency. */
304 321
305 case RTC_VLOW_SET: 322 int ret = rtc_read(RTC_SECONDS);
306 {
307 /* Clear the VL bit in the seconds register */
308 int ret = rtc_read(RTC_SECONDS);
309 323
310 rtc_write(RTC_SECONDS, (ret & 0x7F)); 324 rtc_write(RTC_SECONDS, (ret & 0x7F));
311 325
312 return 0; 326 /* Clear the cached value. */
313 } 327 voltage_low = 0;
314 328
315 default: 329 return 0;
316 return -ENOTTY; 330 }
331 default:
332 return -ENOTTY;
317 } 333 }
318 334
319 return 0; 335 return 0;
320} 336}
321 337
322int 338static int __init pcf8563_register(void)
323pcf8563_open(struct inode *inode, struct file *filp)
324{ 339{
325 return 0; 340 if (pcf8563_init() < 0) {
326} 341 printk(KERN_INFO "%s: Unable to initialize Real-Time Clock "
342 "Driver, %s\n", PCF8563_NAME, DRIVER_VERSION);
343 return -1;
344 }
345
346 if (register_chrdev(PCF8563_MAJOR, DEVICE_NAME, &pcf8563_fops) < 0) {
347 printk(KERN_INFO "%s: Unable to get major numer %d for RTC "
348 "device.\n", PCF8563_NAME, PCF8563_MAJOR);
349 return -1;
350 }
351
352 printk(KERN_INFO "%s Real-Time Clock Driver, %s\n", PCF8563_NAME,
353 DRIVER_VERSION);
354
355 /* Check for low voltage, and warn about it. */
356 if (voltage_low) {
357 printk(KERN_WARNING "%s: RTC Voltage Low - reliable date/time "
358 "information is no longer guaranteed!\n", PCF8563_NAME);
359 }
327 360
328int
329pcf8563_release(struct inode *inode, struct file *filp)
330{
331 return 0; 361 return 0;
332} 362}
333 363
334module_init(pcf8563_init); 364module_init(pcf8563_register);
335module_exit(pcf8563_exit); 365module_exit(pcf8563_exit);
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c
index d581b0a92a3f..47c377df6fb3 100644
--- a/arch/cris/arch-v32/drivers/sync_serial.c
+++ b/arch/cris/arch-v32/drivers/sync_serial.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Simple synchronous serial port driver for ETRAX FS. 2 * Simple synchronous serial port driver for ETRAX FS and Artpec-3.
3 * 3 *
4 * Copyright (c) 2005 Axis Communications AB 4 * Copyright (c) 2005 Axis Communications AB
5 * 5 *
@@ -21,17 +21,18 @@
21#include <linux/spinlock.h> 21#include <linux/spinlock.h>
22 22
23#include <asm/io.h> 23#include <asm/io.h>
24#include <asm/arch/dma.h> 24#include <dma.h>
25#include <asm/arch/pinmux.h> 25#include <pinmux.h>
26#include <asm/arch/hwregs/reg_rdwr.h> 26#include <hwregs/reg_rdwr.h>
27#include <asm/arch/hwregs/sser_defs.h> 27#include <hwregs/sser_defs.h>
28#include <asm/arch/hwregs/dma_defs.h> 28#include <hwregs/dma_defs.h>
29#include <asm/arch/hwregs/dma.h> 29#include <hwregs/dma.h>
30#include <asm/arch/hwregs/intr_vect_defs.h> 30#include <hwregs/intr_vect_defs.h>
31#include <asm/arch/hwregs/intr_vect.h> 31#include <hwregs/intr_vect.h>
32#include <asm/arch/hwregs/reg_map.h> 32#include <hwregs/reg_map.h>
33#include <asm/sync_serial.h> 33#include <asm/sync_serial.h>
34 34
35
35/* The receiver is a bit tricky beacuse of the continuous stream of data.*/ 36/* The receiver is a bit tricky beacuse of the continuous stream of data.*/
36/* */ 37/* */
37/* Three DMA descriptors are linked together. Each DMA descriptor is */ 38/* Three DMA descriptors are linked together. Each DMA descriptor is */
@@ -63,8 +64,10 @@
63/* words can be handled */ 64/* words can be handled */
64#define IN_BUFFER_SIZE 12288 65#define IN_BUFFER_SIZE 12288
65#define IN_DESCR_SIZE 256 66#define IN_DESCR_SIZE 256
66#define NUM_IN_DESCR (IN_BUFFER_SIZE/IN_DESCR_SIZE) 67#define NBR_IN_DESCR (IN_BUFFER_SIZE/IN_DESCR_SIZE)
67#define OUT_BUFFER_SIZE 4096 68
69#define OUT_BUFFER_SIZE 1024*8
70#define NBR_OUT_DESCR 8
68 71
69#define DEFAULT_FRAME_RATE 0 72#define DEFAULT_FRAME_RATE 0
70#define DEFAULT_WORD_RATE 7 73#define DEFAULT_WORD_RATE 7
@@ -78,6 +81,8 @@
78#define DEBUGPOLL(x) 81#define DEBUGPOLL(x)
79#define DEBUGRXINT(x) 82#define DEBUGRXINT(x)
80#define DEBUGTXINT(x) 83#define DEBUGTXINT(x)
84#define DEBUGTRDMA(x)
85#define DEBUGOUTBUF(x)
81 86
82typedef struct sync_port 87typedef struct sync_port
83{ 88{
@@ -97,10 +102,11 @@ typedef struct sync_port
97 int output; 102 int output;
98 int input; 103 int input;
99 104
100 volatile unsigned int out_count; /* Remaining bytes for current transfer */ 105 /* Next byte to be read by application */
101 unsigned char* outp; /* Current position in out_buffer */ 106 volatile unsigned char *volatile readp;
102 volatile unsigned char* volatile readp; /* Next byte to be read by application */ 107 /* Next byte to be written by etrax */
103 volatile unsigned char* volatile writep; /* Next byte to be written by etrax */ 108 volatile unsigned char *volatile writep;
109
104 unsigned int in_buffer_size; 110 unsigned int in_buffer_size;
105 unsigned int inbufchunk; 111 unsigned int inbufchunk;
106 unsigned char out_buffer[OUT_BUFFER_SIZE] __attribute__ ((aligned(32))); 112 unsigned char out_buffer[OUT_BUFFER_SIZE] __attribute__ ((aligned(32)));
@@ -108,11 +114,30 @@ typedef struct sync_port
108 unsigned char flip[IN_BUFFER_SIZE] __attribute__ ((aligned(32))); 114 unsigned char flip[IN_BUFFER_SIZE] __attribute__ ((aligned(32)));
109 struct dma_descr_data* next_rx_desc; 115 struct dma_descr_data* next_rx_desc;
110 struct dma_descr_data* prev_rx_desc; 116 struct dma_descr_data* prev_rx_desc;
117
118 /* Pointer to the first available descriptor in the ring,
119 * unless active_tr_descr == catch_tr_descr and a dma
120 * transfer is active */
121 struct dma_descr_data *active_tr_descr;
122
123 /* Pointer to the first allocated descriptor in the ring */
124 struct dma_descr_data *catch_tr_descr;
125
126 /* Pointer to the descriptor with the current end-of-list */
127 struct dma_descr_data *prev_tr_descr;
111 int full; 128 int full;
112 129
113 dma_descr_data in_descr[NUM_IN_DESCR] __attribute__ ((__aligned__(16))); 130 /* Pointer to the first byte being read by DMA
131 * or current position in out_buffer if not using DMA. */
132 unsigned char *out_rd_ptr;
133
134 /* Number of bytes currently locked for being read by DMA */
135 int out_buf_count;
136
137 dma_descr_data in_descr[NBR_IN_DESCR] __attribute__ ((__aligned__(16)));
114 dma_descr_context in_context __attribute__ ((__aligned__(32))); 138 dma_descr_context in_context __attribute__ ((__aligned__(32)));
115 dma_descr_data out_descr __attribute__ ((__aligned__(16))); 139 dma_descr_data out_descr[NBR_OUT_DESCR]
140 __attribute__ ((__aligned__(16)));
116 dma_descr_context out_context __attribute__ ((__aligned__(32))); 141 dma_descr_context out_context __attribute__ ((__aligned__(32)));
117 wait_queue_head_t out_wait_q; 142 wait_queue_head_t out_wait_q;
118 wait_queue_head_t in_wait_q; 143 wait_queue_head_t in_wait_q;
@@ -143,11 +168,11 @@ static ssize_t sync_serial_read(struct file *file, char *buf,
143#endif 168#endif
144 169
145static void send_word(sync_port* port); 170static void send_word(sync_port* port);
146static void start_dma(struct sync_port *port, const char* data, int count); 171static void start_dma_out(struct sync_port *port, const char *data, int count);
147static void start_dma_in(sync_port* port); 172static void start_dma_in(sync_port* port);
148#ifdef SYNC_SER_DMA 173#ifdef SYNC_SER_DMA
149static irqreturn_t tr_interrupt(int irq, void *dev_id, struct pt_regs * regs); 174static irqreturn_t tr_interrupt(int irq, void *dev_id);
150static irqreturn_t rx_interrupt(int irq, void *dev_id, struct pt_regs * regs); 175static irqreturn_t rx_interrupt(int irq, void *dev_id);
151#endif 176#endif
152 177
153#if (defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0) && \ 178#if (defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0) && \
@@ -157,22 +182,49 @@ static irqreturn_t rx_interrupt(int irq, void *dev_id, struct pt_regs * regs);
157#define SYNC_SER_MANUAL 182#define SYNC_SER_MANUAL
158#endif 183#endif
159#ifdef SYNC_SER_MANUAL 184#ifdef SYNC_SER_MANUAL
160static irqreturn_t manual_interrupt(int irq, void *dev_id, struct pt_regs * regs); 185static irqreturn_t manual_interrupt(int irq, void *dev_id);
186#endif
187
188#ifdef CONFIG_ETRAXFS /* ETRAX FS */
189#define OUT_DMA_NBR 4
190#define IN_DMA_NBR 5
191#define PINMUX_SSER pinmux_sser0
192#define SYNCSER_INST regi_sser0
193#define SYNCSER_INTR_VECT SSER0_INTR_VECT
194#define OUT_DMA_INST regi_dma4
195#define IN_DMA_INST regi_dma5
196#define DMA_OUT_INTR_VECT DMA4_INTR_VECT
197#define DMA_IN_INTR_VECT DMA5_INTR_VECT
198#define REQ_DMA_SYNCSER dma_sser0
199#else /* Artpec-3 */
200#define OUT_DMA_NBR 6
201#define IN_DMA_NBR 7
202#define PINMUX_SSER pinmux_sser
203#define SYNCSER_INST regi_sser
204#define SYNCSER_INTR_VECT SSER_INTR_VECT
205#define OUT_DMA_INST regi_dma6
206#define IN_DMA_INST regi_dma7
207#define DMA_OUT_INTR_VECT DMA6_INTR_VECT
208#define DMA_IN_INTR_VECT DMA7_INTR_VECT
209#define REQ_DMA_SYNCSER dma_sser
161#endif 210#endif
162 211
163/* The ports */ 212/* The ports */
164static struct sync_port ports[]= 213static struct sync_port ports[]=
165{ 214{
166 { 215 {
167 .regi_sser = regi_sser0, 216 .regi_sser = SYNCSER_INST,
168 .regi_dmaout = regi_dma4, 217 .regi_dmaout = OUT_DMA_INST,
169 .regi_dmain = regi_dma5, 218 .regi_dmain = IN_DMA_INST,
170#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL0_DMA) 219#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL0_DMA)
171 .use_dma = 1, 220 .use_dma = 1,
172#else 221#else
173 .use_dma = 0, 222 .use_dma = 0,
174#endif 223#endif
175 }, 224 }
225#ifdef CONFIG_ETRAXFS
226 ,
227
176 { 228 {
177 .regi_sser = regi_sser1, 229 .regi_sser = regi_sser1,
178 .regi_dmaout = regi_dma6, 230 .regi_dmaout = regi_dma6,
@@ -183,9 +235,10 @@ static struct sync_port ports[]=
183 .use_dma = 0, 235 .use_dma = 0,
184#endif 236#endif
185 } 237 }
238#endif
186}; 239};
187 240
188#define NUMBER_OF_PORTS ARRAY_SIZE(ports) 241#define NBR_PORTS ARRAY_SIZE(ports)
189 242
190static const struct file_operations sync_serial_fops = { 243static const struct file_operations sync_serial_fops = {
191 .owner = THIS_MODULE, 244 .owner = THIS_MODULE,
@@ -200,19 +253,21 @@ static const struct file_operations sync_serial_fops = {
200static int __init etrax_sync_serial_init(void) 253static int __init etrax_sync_serial_init(void)
201{ 254{
202 ports[0].enabled = 0; 255 ports[0].enabled = 0;
256#ifdef CONFIG_ETRAXFS
203 ports[1].enabled = 0; 257 ports[1].enabled = 0;
204 258#endif
205 if (register_chrdev(SYNC_SERIAL_MAJOR,"sync serial", &sync_serial_fops) <0 ) 259 if (register_chrdev(SYNC_SERIAL_MAJOR, "sync serial",
206 { 260 &sync_serial_fops) < 0) {
207 printk("unable to get major for synchronous serial port\n"); 261 printk(KERN_WARNING
262 "Unable to get major for synchronous serial port\n");
208 return -EBUSY; 263 return -EBUSY;
209 } 264 }
210 265
211 /* Initialize Ports */ 266 /* Initialize Ports */
212#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0) 267#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0)
213 if (crisv32_pinmux_alloc_fixed(pinmux_sser0)) 268 if (crisv32_pinmux_alloc_fixed(PINMUX_SSER)) {
214 { 269 printk(KERN_WARNING
215 printk("Unable to allocate pins for syncrhronous serial port 0\n"); 270 "Unable to alloc pins for synchronous serial port 0\n");
216 return -EIO; 271 return -EIO;
217 } 272 }
218 ports[0].enabled = 1; 273 ports[0].enabled = 1;
@@ -220,33 +275,40 @@ static int __init etrax_sync_serial_init(void)
220#endif 275#endif
221 276
222#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT1) 277#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT1)
223 if (crisv32_pinmux_alloc_fixed(pinmux_sser1)) 278 if (crisv32_pinmux_alloc_fixed(pinmux_sser1)) {
224 { 279 printk(KERN_WARNING
225 printk("Unable to allocate pins for syncrhronous serial port 0\n"); 280 "Unable to alloc pins for synchronous serial port 0\n");
226 return -EIO; 281 return -EIO;
227 } 282 }
228 ports[1].enabled = 1; 283 ports[1].enabled = 1;
229 initialize_port(1); 284 initialize_port(1);
230#endif 285#endif
231 286
232 printk("ETRAX FS synchronous serial port driver\n"); 287#ifdef CONFIG_ETRAXFS
288 printk(KERN_INFO "ETRAX FS synchronous serial port driver\n");
289#else
290 printk(KERN_INFO "Artpec-3 synchronous serial port driver\n");
291#endif
233 return 0; 292 return 0;
234} 293}
235 294
236static void __init initialize_port(int portnbr) 295static void __init initialize_port(int portnbr)
237{ 296{
238 struct sync_port* port = &ports[portnbr]; 297 int __attribute__((unused)) i;
298 struct sync_port *port = &ports[portnbr];
239 reg_sser_rw_cfg cfg = {0}; 299 reg_sser_rw_cfg cfg = {0};
240 reg_sser_rw_frm_cfg frm_cfg = {0}; 300 reg_sser_rw_frm_cfg frm_cfg = {0};
241 reg_sser_rw_tr_cfg tr_cfg = {0}; 301 reg_sser_rw_tr_cfg tr_cfg = {0};
242 reg_sser_rw_rec_cfg rec_cfg = {0}; 302 reg_sser_rw_rec_cfg rec_cfg = {0};
243 303
244 DEBUG(printk("Init sync serial port %d\n", portnbr)); 304 DEBUG(printk(KERN_DEBUG "Init sync serial port %d\n", portnbr));
245 305
246 port->port_nbr = portnbr; 306 port->port_nbr = portnbr;
247 port->init_irqs = 1; 307 port->init_irqs = 1;
248 308
249 port->outp = port->out_buffer; 309 port->out_rd_ptr = port->out_buffer;
310 port->out_buf_count = 0;
311
250 port->output = 1; 312 port->output = 1;
251 port->input = 0; 313 port->input = 0;
252 314
@@ -255,7 +317,7 @@ static void __init initialize_port(int portnbr)
255 port->in_buffer_size = IN_BUFFER_SIZE; 317 port->in_buffer_size = IN_BUFFER_SIZE;
256 port->inbufchunk = IN_DESCR_SIZE; 318 port->inbufchunk = IN_DESCR_SIZE;
257 port->next_rx_desc = &port->in_descr[0]; 319 port->next_rx_desc = &port->in_descr[0];
258 port->prev_rx_desc = &port->in_descr[NUM_IN_DESCR-1]; 320 port->prev_rx_desc = &port->in_descr[NBR_IN_DESCR-1];
259 port->prev_rx_desc->eol = 1; 321 port->prev_rx_desc->eol = 1;
260 322
261 init_waitqueue_head(&port->out_wait_q); 323 init_waitqueue_head(&port->out_wait_q);
@@ -286,8 +348,13 @@ static void __init initialize_port(int portnbr)
286 tr_cfg.sample_size = 7; 348 tr_cfg.sample_size = 7;
287 tr_cfg.sh_dir = regk_sser_msbfirst; 349 tr_cfg.sh_dir = regk_sser_msbfirst;
288 tr_cfg.use_dma = port->use_dma ? regk_sser_yes : regk_sser_no; 350 tr_cfg.use_dma = port->use_dma ? regk_sser_yes : regk_sser_no;
351#if 0
289 tr_cfg.rate_ctrl = regk_sser_bulk; 352 tr_cfg.rate_ctrl = regk_sser_bulk;
290 tr_cfg.data_pin_use = regk_sser_dout; 353 tr_cfg.data_pin_use = regk_sser_dout;
354#else
355 tr_cfg.rate_ctrl = regk_sser_iso;
356 tr_cfg.data_pin_use = regk_sser_dout;
357#endif
291 tr_cfg.bulk_wspace = 1; 358 tr_cfg.bulk_wspace = 1;
292 REG_WR(sser, port->regi_sser, rw_tr_cfg, tr_cfg); 359 REG_WR(sser, port->regi_sser, rw_tr_cfg, tr_cfg);
293 360
@@ -296,6 +363,27 @@ static void __init initialize_port(int portnbr)
296 rec_cfg.use_dma = port->use_dma ? regk_sser_yes : regk_sser_no; 363 rec_cfg.use_dma = port->use_dma ? regk_sser_yes : regk_sser_no;
297 rec_cfg.fifo_thr = regk_sser_inf; 364 rec_cfg.fifo_thr = regk_sser_inf;
298 REG_WR(sser, port->regi_sser, rw_rec_cfg, rec_cfg); 365 REG_WR(sser, port->regi_sser, rw_rec_cfg, rec_cfg);
366
367#ifdef SYNC_SER_DMA
368 /* Setup the descriptor ring for dma out/transmit. */
369 for (i = 0; i < NBR_OUT_DESCR; i++) {
370 port->out_descr[i].wait = 0;
371 port->out_descr[i].intr = 1;
372 port->out_descr[i].eol = 0;
373 port->out_descr[i].out_eop = 0;
374 port->out_descr[i].next =
375 (dma_descr_data *)virt_to_phys(&port->out_descr[i+1]);
376 }
377
378 /* Create a ring from the list. */
379 port->out_descr[NBR_OUT_DESCR-1].next =
380 (dma_descr_data *)virt_to_phys(&port->out_descr[0]);
381
382 /* Setup context for traversing the ring. */
383 port->active_tr_descr = &port->out_descr[0];
384 port->prev_tr_descr = &port->out_descr[NBR_OUT_DESCR-1];
385 port->catch_tr_descr = &port->out_descr[0];
386#endif
299} 387}
300 388
301static inline int sync_data_avail(struct sync_port *port) 389static inline int sync_data_avail(struct sync_port *port)
@@ -311,7 +399,7 @@ static inline int sync_data_avail(struct sync_port *port)
311 * ^rp ^wp ^wp ^rp 399 * ^rp ^wp ^wp ^rp
312 */ 400 */
313 401
314 if (end >= start) 402 if (end >= start)
315 avail = end - start; 403 avail = end - start;
316 else 404 else
317 avail = port->in_buffer_size - (start - end); 405 avail = port->in_buffer_size - (start - end);
@@ -331,7 +419,7 @@ static inline int sync_data_avail_to_end(struct sync_port *port)
331 * ^rp ^wp ^wp ^rp 419 * ^rp ^wp ^wp ^rp
332 */ 420 */
333 421
334 if (end >= start) 422 if (end >= start)
335 avail = end - start; 423 avail = end - start;
336 else 424 else
337 avail = port->flip + port->in_buffer_size - start; 425 avail = port->flip + port->in_buffer_size - start;
@@ -341,66 +429,69 @@ static inline int sync_data_avail_to_end(struct sync_port *port)
341static int sync_serial_open(struct inode *inode, struct file *file) 429static int sync_serial_open(struct inode *inode, struct file *file)
342{ 430{
343 int dev = iminor(inode); 431 int dev = iminor(inode);
344 sync_port* port; 432 sync_port *port;
345 reg_dma_rw_cfg cfg = {.en = regk_dma_yes}; 433 reg_dma_rw_cfg cfg = {.en = regk_dma_yes};
346 reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes}; 434 reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes};
347 435
348 DEBUG(printk("Open sync serial port %d\n", dev)); 436 DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev));
349 437
350 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) 438 if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled)
351 { 439 {
352 DEBUG(printk("Invalid minor %d\n", dev)); 440 DEBUG(printk(KERN_DEBUG "Invalid minor %d\n", dev));
353 return -ENODEV; 441 return -ENODEV;
354 } 442 }
355 port = &ports[dev]; 443 port = &ports[dev];
356 /* Allow open this device twice (assuming one reader and one writer) */ 444 /* Allow open this device twice (assuming one reader and one writer) */
357 if (port->busy == 2) 445 if (port->busy == 2)
358 { 446 {
359 DEBUG(printk("Device is busy.. \n")); 447 DEBUG(printk(KERN_DEBUG "Device is busy.. \n"));
360 return -EBUSY; 448 return -EBUSY;
361 } 449 }
450
451
362 if (port->init_irqs) { 452 if (port->init_irqs) {
363 if (port->use_dma) { 453 if (port->use_dma) {
364 if (port == &ports[0]){ 454 if (port == &ports[0]) {
365#ifdef SYNC_SER_DMA 455#ifdef SYNC_SER_DMA
366 if(request_irq(DMA4_INTR_VECT, 456 if (request_irq(DMA_OUT_INTR_VECT,
367 tr_interrupt, 457 tr_interrupt,
368 0, 458 0,
369 "synchronous serial 0 dma tr", 459 "synchronous serial 0 dma tr",
370 &ports[0])) { 460 &ports[0])) {
371 printk(KERN_CRIT "Can't allocate sync serial port 0 IRQ"); 461 printk(KERN_CRIT "Can't allocate sync serial port 0 IRQ");
372 return -EBUSY; 462 return -EBUSY;
373 } else if(request_irq(DMA5_INTR_VECT, 463 } else if (request_irq(DMA_IN_INTR_VECT,
374 rx_interrupt, 464 rx_interrupt,
375 0, 465 0,
376 "synchronous serial 1 dma rx", 466 "synchronous serial 1 dma rx",
377 &ports[0])) { 467 &ports[0])) {
378 free_irq(DMA4_INTR_VECT, &port[0]); 468 free_irq(DMA_OUT_INTR_VECT, &port[0]);
379 printk(KERN_CRIT "Can't allocate sync serial port 0 IRQ"); 469 printk(KERN_CRIT "Can't allocate sync serial port 0 IRQ");
380 return -EBUSY; 470 return -EBUSY;
381 } else if (crisv32_request_dma(SYNC_SER0_TX_DMA_NBR, 471 } else if (crisv32_request_dma(OUT_DMA_NBR,
382 "synchronous serial 0 dma tr", 472 "synchronous serial 0 dma tr",
383 DMA_VERBOSE_ON_ERROR, 473 DMA_VERBOSE_ON_ERROR,
384 0, 474 0,
385 dma_sser0)) { 475 REQ_DMA_SYNCSER)) {
386 free_irq(DMA4_INTR_VECT, &port[0]); 476 free_irq(DMA_OUT_INTR_VECT, &port[0]);
387 free_irq(DMA5_INTR_VECT, &port[0]); 477 free_irq(DMA_IN_INTR_VECT, &port[0]);
388 printk(KERN_CRIT "Can't allocate sync serial port 0 TX DMA channel"); 478 printk(KERN_CRIT "Can't allocate sync serial port 0 TX DMA channel");
389 return -EBUSY; 479 return -EBUSY;
390 } else if (crisv32_request_dma(SYNC_SER0_RX_DMA_NBR, 480 } else if (crisv32_request_dma(IN_DMA_NBR,
391 "synchronous serial 0 dma rec", 481 "synchronous serial 0 dma rec",
392 DMA_VERBOSE_ON_ERROR, 482 DMA_VERBOSE_ON_ERROR,
393 0, 483 0,
394 dma_sser0)) { 484 REQ_DMA_SYNCSER)) {
395 crisv32_free_dma(SYNC_SER0_TX_DMA_NBR); 485 crisv32_free_dma(OUT_DMA_NBR);
396 free_irq(DMA4_INTR_VECT, &port[0]); 486 free_irq(DMA_OUT_INTR_VECT, &port[0]);
397 free_irq(DMA5_INTR_VECT, &port[0]); 487 free_irq(DMA_IN_INTR_VECT, &port[0]);
398 printk(KERN_CRIT "Can't allocate sync serial port 1 RX DMA channel"); 488 printk(KERN_CRIT "Can't allocate sync serial port 1 RX DMA channel");
399 return -EBUSY; 489 return -EBUSY;
400 } 490 }
401#endif 491#endif
402 } 492 }
403 else if (port == &ports[1]){ 493#ifdef CONFIG_ETRAXFS
494 else if (port == &ports[1]) {
404#ifdef SYNC_SER_DMA 495#ifdef SYNC_SER_DMA
405 if (request_irq(DMA6_INTR_VECT, 496 if (request_irq(DMA6_INTR_VECT,
406 tr_interrupt, 497 tr_interrupt,
@@ -417,20 +508,22 @@ static int sync_serial_open(struct inode *inode, struct file *file)
417 free_irq(DMA6_INTR_VECT, &ports[1]); 508 free_irq(DMA6_INTR_VECT, &ports[1]);
418 printk(KERN_CRIT "Can't allocate sync serial port 3 IRQ"); 509 printk(KERN_CRIT "Can't allocate sync serial port 3 IRQ");
419 return -EBUSY; 510 return -EBUSY;
420 } else if (crisv32_request_dma(SYNC_SER1_TX_DMA_NBR, 511 } else if (crisv32_request_dma(
421 "synchronous serial 1 dma tr", 512 SYNC_SER1_TX_DMA_NBR,
422 DMA_VERBOSE_ON_ERROR, 513 "synchronous serial 1 dma tr",
423 0, 514 DMA_VERBOSE_ON_ERROR,
424 dma_sser1)) { 515 0,
425 free_irq(21, &ports[1]); 516 dma_sser1)) {
426 free_irq(20, &ports[1]); 517 free_irq(DMA6_INTR_VECT, &ports[1]);
518 free_irq(DMA7_INTR_VECT, &ports[1]);
427 printk(KERN_CRIT "Can't allocate sync serial port 3 TX DMA channel"); 519 printk(KERN_CRIT "Can't allocate sync serial port 3 TX DMA channel");
428 return -EBUSY; 520 return -EBUSY;
429 } else if (crisv32_request_dma(SYNC_SER1_RX_DMA_NBR, 521 } else if (crisv32_request_dma(
430 "synchronous serial 3 dma rec", 522 SYNC_SER1_RX_DMA_NBR,
431 DMA_VERBOSE_ON_ERROR, 523 "synchronous serial 3 dma rec",
432 0, 524 DMA_VERBOSE_ON_ERROR,
433 dma_sser1)) { 525 0,
526 dma_sser1)) {
434 crisv32_free_dma(SYNC_SER1_TX_DMA_NBR); 527 crisv32_free_dma(SYNC_SER1_TX_DMA_NBR);
435 free_irq(DMA6_INTR_VECT, &ports[1]); 528 free_irq(DMA6_INTR_VECT, &ports[1]);
436 free_irq(DMA7_INTR_VECT, &ports[1]); 529 free_irq(DMA7_INTR_VECT, &ports[1]);
@@ -439,14 +532,14 @@ static int sync_serial_open(struct inode *inode, struct file *file)
439 } 532 }
440#endif 533#endif
441 } 534 }
442 535#endif
443 /* Enable DMAs */ 536 /* Enable DMAs */
444 REG_WR(dma, port->regi_dmain, rw_cfg, cfg); 537 REG_WR(dma, port->regi_dmain, rw_cfg, cfg);
445 REG_WR(dma, port->regi_dmaout, rw_cfg, cfg); 538 REG_WR(dma, port->regi_dmaout, rw_cfg, cfg);
446 /* Enable DMA IRQs */ 539 /* Enable DMA IRQs */
447 REG_WR(dma, port->regi_dmain, rw_intr_mask, intr_mask); 540 REG_WR(dma, port->regi_dmain, rw_intr_mask, intr_mask);
448 REG_WR(dma, port->regi_dmaout, rw_intr_mask, intr_mask); 541 REG_WR(dma, port->regi_dmaout, rw_intr_mask, intr_mask);
449 /* Set up wordsize = 2 for DMAs. */ 542 /* Set up wordsize = 1 for DMAs. */
450 DMA_WR_CMD (port->regi_dmain, regk_dma_set_w_size1); 543 DMA_WR_CMD (port->regi_dmain, regk_dma_set_w_size1);
451 DMA_WR_CMD (port->regi_dmaout, regk_dma_set_w_size1); 544 DMA_WR_CMD (port->regi_dmaout, regk_dma_set_w_size1);
452 545
@@ -455,7 +548,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
455 } else { /* !port->use_dma */ 548 } else { /* !port->use_dma */
456#ifdef SYNC_SER_MANUAL 549#ifdef SYNC_SER_MANUAL
457 if (port == &ports[0]) { 550 if (port == &ports[0]) {
458 if (request_irq(SSER0_INTR_VECT, 551 if (request_irq(SYNCSER_INTR_VECT,
459 manual_interrupt, 552 manual_interrupt,
460 0, 553 0,
461 "synchronous serial manual irq", 554 "synchronous serial manual irq",
@@ -463,7 +556,9 @@ static int sync_serial_open(struct inode *inode, struct file *file)
463 printk("Can't allocate sync serial manual irq"); 556 printk("Can't allocate sync serial manual irq");
464 return -EBUSY; 557 return -EBUSY;
465 } 558 }
466 } else if (port == &ports[1]) { 559 }
560#ifdef CONFIG_ETRAXFS
561 else if (port == &ports[1]) {
467 if (request_irq(SSER1_INTR_VECT, 562 if (request_irq(SSER1_INTR_VECT,
468 manual_interrupt, 563 manual_interrupt,
469 0, 564 0,
@@ -473,11 +568,13 @@ static int sync_serial_open(struct inode *inode, struct file *file)
473 return -EBUSY; 568 return -EBUSY;
474 } 569 }
475 } 570 }
571#endif
476 port->init_irqs = 0; 572 port->init_irqs = 0;
477#else 573#else
478 panic("sync_serial: Manual mode not supported.\n"); 574 panic("sync_serial: Manual mode not supported.\n");
479#endif /* SYNC_SER_MANUAL */ 575#endif /* SYNC_SER_MANUAL */
480 } 576 }
577
481 } /* port->init_irqs */ 578 } /* port->init_irqs */
482 579
483 port->busy++; 580 port->busy++;
@@ -487,9 +584,9 @@ static int sync_serial_open(struct inode *inode, struct file *file)
487static int sync_serial_release(struct inode *inode, struct file *file) 584static int sync_serial_release(struct inode *inode, struct file *file)
488{ 585{
489 int dev = iminor(inode); 586 int dev = iminor(inode);
490 sync_port* port; 587 sync_port *port;
491 588
492 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) 589 if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled)
493 { 590 {
494 DEBUG(printk("Invalid minor %d\n", dev)); 591 DEBUG(printk("Invalid minor %d\n", dev));
495 return -ENODEV; 592 return -ENODEV;
@@ -506,17 +603,37 @@ static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
506{ 603{
507 int dev = iminor(file->f_path.dentry->d_inode); 604 int dev = iminor(file->f_path.dentry->d_inode);
508 unsigned int mask = 0; 605 unsigned int mask = 0;
509 sync_port* port; 606 sync_port *port;
510 DEBUGPOLL( static unsigned int prev_mask = 0; ); 607 DEBUGPOLL( static unsigned int prev_mask = 0; );
511 608
512 port = &ports[dev]; 609 port = &ports[dev];
610
611 if (!port->started) {
612 reg_sser_rw_cfg cfg = REG_RD(sser, port->regi_sser, rw_cfg);
613 reg_sser_rw_rec_cfg rec_cfg =
614 REG_RD(sser, port->regi_sser, rw_rec_cfg);
615 cfg.en = regk_sser_yes;
616 rec_cfg.rec_en = port->input;
617 REG_WR(sser, port->regi_sser, rw_cfg, cfg);
618 REG_WR(sser, port->regi_sser, rw_rec_cfg, rec_cfg);
619 port->started = 1;
620 }
621
513 poll_wait(file, &port->out_wait_q, wait); 622 poll_wait(file, &port->out_wait_q, wait);
514 poll_wait(file, &port->in_wait_q, wait); 623 poll_wait(file, &port->in_wait_q, wait);
515 /* Some room to write */ 624
516 if (port->out_count < OUT_BUFFER_SIZE) 625 /* No active transfer, descriptors are available */
626 if (port->output && !port->tr_running)
627 mask |= POLLOUT | POLLWRNORM;
628
629 /* Descriptor and buffer space available. */
630 if (port->output &&
631 port->active_tr_descr != port->catch_tr_descr &&
632 port->out_buf_count < OUT_BUFFER_SIZE)
517 mask |= POLLOUT | POLLWRNORM; 633 mask |= POLLOUT | POLLWRNORM;
634
518 /* At least an inbufchunk of data */ 635 /* At least an inbufchunk of data */
519 if (sync_data_avail(port) >= port->inbufchunk) 636 if (port->input && sync_data_avail(port) >= port->inbufchunk)
520 mask |= POLLIN | POLLRDNORM; 637 mask |= POLLIN | POLLRDNORM;
521 638
522 DEBUGPOLL(if (mask != prev_mask) 639 DEBUGPOLL(if (mask != prev_mask)
@@ -531,15 +648,16 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
531 unsigned int cmd, unsigned long arg) 648 unsigned int cmd, unsigned long arg)
532{ 649{
533 int return_val = 0; 650 int return_val = 0;
651 int dma_w_size = regk_dma_set_w_size1;
534 int dev = iminor(file->f_path.dentry->d_inode); 652 int dev = iminor(file->f_path.dentry->d_inode);
535 sync_port* port; 653 sync_port *port;
536 reg_sser_rw_tr_cfg tr_cfg; 654 reg_sser_rw_tr_cfg tr_cfg;
537 reg_sser_rw_rec_cfg rec_cfg; 655 reg_sser_rw_rec_cfg rec_cfg;
538 reg_sser_rw_frm_cfg frm_cfg; 656 reg_sser_rw_frm_cfg frm_cfg;
539 reg_sser_rw_cfg gen_cfg; 657 reg_sser_rw_cfg gen_cfg;
540 reg_sser_rw_intr_mask intr_mask; 658 reg_sser_rw_intr_mask intr_mask;
541 659
542 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) 660 if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled)
543 { 661 {
544 DEBUG(printk("Invalid minor %d\n", dev)); 662 DEBUG(printk("Invalid minor %d\n", dev));
545 return -1; 663 return -1;
@@ -558,61 +676,81 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
558 case SSP_SPEED: 676 case SSP_SPEED:
559 if (GET_SPEED(arg) == CODEC) 677 if (GET_SPEED(arg) == CODEC)
560 { 678 {
679 unsigned int freq;
680
561 gen_cfg.base_freq = regk_sser_f32; 681 gen_cfg.base_freq = regk_sser_f32;
562 /* FREQ = 0 => 4 MHz => clk_div = 7*/ 682
563 gen_cfg.clk_div = 6 + (1 << GET_FREQ(arg)); 683 /* Clock divider will internally be
564 } 684 * gen_cfg.clk_div + 1.
565 else 685 */
566 { 686
687 freq = GET_FREQ(arg);
688 switch (freq) {
689 case FREQ_32kHz:
690 case FREQ_64kHz:
691 case FREQ_128kHz:
692 case FREQ_256kHz:
693 gen_cfg.clk_div = 125 *
694 (1 << (freq - FREQ_256kHz)) - 1;
695 break;
696 case FREQ_512kHz:
697 gen_cfg.clk_div = 62;
698 break;
699 case FREQ_1MHz:
700 case FREQ_2MHz:
701 case FREQ_4MHz:
702 gen_cfg.clk_div = 8 * (1 << freq) - 1;
703 break;
704 }
705 } else {
567 gen_cfg.base_freq = regk_sser_f29_493; 706 gen_cfg.base_freq = regk_sser_f29_493;
568 switch (GET_SPEED(arg)) 707 switch (GET_SPEED(arg)) {
569 { 708 case SSP150:
570 case SSP150: 709 gen_cfg.clk_div = 29493000 / (150 * 8) - 1;
571 gen_cfg.clk_div = 29493000 / (150 * 8) - 1; 710 break;
572 break; 711 case SSP300:
573 case SSP300: 712 gen_cfg.clk_div = 29493000 / (300 * 8) - 1;
574 gen_cfg.clk_div = 29493000 / (300 * 8) - 1; 713 break;
575 break; 714 case SSP600:
576 case SSP600: 715 gen_cfg.clk_div = 29493000 / (600 * 8) - 1;
577 gen_cfg.clk_div = 29493000 / (600 * 8) - 1; 716 break;
578 break; 717 case SSP1200:
579 case SSP1200: 718 gen_cfg.clk_div = 29493000 / (1200 * 8) - 1;
580 gen_cfg.clk_div = 29493000 / (1200 * 8) - 1; 719 break;
581 break; 720 case SSP2400:
582 case SSP2400: 721 gen_cfg.clk_div = 29493000 / (2400 * 8) - 1;
583 gen_cfg.clk_div = 29493000 / (2400 * 8) - 1; 722 break;
584 break; 723 case SSP4800:
585 case SSP4800: 724 gen_cfg.clk_div = 29493000 / (4800 * 8) - 1;
586 gen_cfg.clk_div = 29493000 / (4800 * 8) - 1; 725 break;
587 break; 726 case SSP9600:
588 case SSP9600: 727 gen_cfg.clk_div = 29493000 / (9600 * 8) - 1;
589 gen_cfg.clk_div = 29493000 / (9600 * 8) - 1; 728 break;
590 break; 729 case SSP19200:
591 case SSP19200: 730 gen_cfg.clk_div = 29493000 / (19200 * 8) - 1;
592 gen_cfg.clk_div = 29493000 / (19200 * 8) - 1; 731 break;
593 break; 732 case SSP28800:
594 case SSP28800: 733 gen_cfg.clk_div = 29493000 / (28800 * 8) - 1;
595 gen_cfg.clk_div = 29493000 / (28800 * 8) - 1; 734 break;
596 break; 735 case SSP57600:
597 case SSP57600: 736 gen_cfg.clk_div = 29493000 / (57600 * 8) - 1;
598 gen_cfg.clk_div = 29493000 / (57600 * 8) - 1; 737 break;
599 break; 738 case SSP115200:
600 case SSP115200: 739 gen_cfg.clk_div = 29493000 / (115200 * 8) - 1;
601 gen_cfg.clk_div = 29493000 / (115200 * 8) - 1; 740 break;
602 break; 741 case SSP230400:
603 case SSP230400: 742 gen_cfg.clk_div = 29493000 / (230400 * 8) - 1;
604 gen_cfg.clk_div = 29493000 / (230400 * 8) - 1; 743 break;
605 break; 744 case SSP460800:
606 case SSP460800: 745 gen_cfg.clk_div = 29493000 / (460800 * 8) - 1;
607 gen_cfg.clk_div = 29493000 / (460800 * 8) - 1; 746 break;
608 break; 747 case SSP921600:
609 case SSP921600: 748 gen_cfg.clk_div = 29493000 / (921600 * 8) - 1;
610 gen_cfg.clk_div = 29493000 / (921600 * 8) - 1; 749 break;
611 break; 750 case SSP3125000:
612 case SSP3125000: 751 gen_cfg.base_freq = regk_sser_f100;
613 gen_cfg.base_freq = regk_sser_f100; 752 gen_cfg.clk_div = 100000000 / (3125000 * 8) - 1;
614 gen_cfg.clk_div = 100000000 / (3125000 * 8) - 1; 753 break;
615 break;
616 754
617 } 755 }
618 } 756 }
@@ -625,46 +763,60 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
625 case MASTER_OUTPUT: 763 case MASTER_OUTPUT:
626 port->output = 1; 764 port->output = 1;
627 port->input = 0; 765 port->input = 0;
766 frm_cfg.out_on = regk_sser_tr;
767 frm_cfg.frame_pin_dir = regk_sser_out;
628 gen_cfg.clk_dir = regk_sser_out; 768 gen_cfg.clk_dir = regk_sser_out;
629 break; 769 break;
630 case SLAVE_OUTPUT: 770 case SLAVE_OUTPUT:
631 port->output = 1; 771 port->output = 1;
632 port->input = 0; 772 port->input = 0;
773 frm_cfg.frame_pin_dir = regk_sser_in;
633 gen_cfg.clk_dir = regk_sser_in; 774 gen_cfg.clk_dir = regk_sser_in;
634 break; 775 break;
635 case MASTER_INPUT: 776 case MASTER_INPUT:
636 port->output = 0; 777 port->output = 0;
637 port->input = 1; 778 port->input = 1;
779 frm_cfg.frame_pin_dir = regk_sser_out;
780 frm_cfg.out_on = regk_sser_intern_tb;
638 gen_cfg.clk_dir = regk_sser_out; 781 gen_cfg.clk_dir = regk_sser_out;
639 break; 782 break;
640 case SLAVE_INPUT: 783 case SLAVE_INPUT:
641 port->output = 0; 784 port->output = 0;
642 port->input = 1; 785 port->input = 1;
786 frm_cfg.frame_pin_dir = regk_sser_in;
643 gen_cfg.clk_dir = regk_sser_in; 787 gen_cfg.clk_dir = regk_sser_in;
644 break; 788 break;
645 case MASTER_BIDIR: 789 case MASTER_BIDIR:
646 port->output = 1; 790 port->output = 1;
647 port->input = 1; 791 port->input = 1;
792 frm_cfg.frame_pin_dir = regk_sser_out;
793 frm_cfg.out_on = regk_sser_intern_tb;
648 gen_cfg.clk_dir = regk_sser_out; 794 gen_cfg.clk_dir = regk_sser_out;
649 break; 795 break;
650 case SLAVE_BIDIR: 796 case SLAVE_BIDIR:
651 port->output = 1; 797 port->output = 1;
652 port->input = 1; 798 port->input = 1;
799 frm_cfg.frame_pin_dir = regk_sser_in;
653 gen_cfg.clk_dir = regk_sser_in; 800 gen_cfg.clk_dir = regk_sser_in;
654 break; 801 break;
655 default: 802 default:
656 spin_unlock_irq(&port->lock); 803 spin_unlock_irq(&port->lock);
657 return -EINVAL; 804 return -EINVAL;
658
659 } 805 }
660 if (!port->use_dma || (arg == MASTER_OUTPUT || arg == SLAVE_OUTPUT)) 806 if (!port->use_dma || (arg == MASTER_OUTPUT || arg == SLAVE_OUTPUT))
661 intr_mask.rdav = regk_sser_yes; 807 intr_mask.rdav = regk_sser_yes;
662 break; 808 break;
663 case SSP_FRAME_SYNC: 809 case SSP_FRAME_SYNC:
664 if (arg & NORMAL_SYNC) 810 if (arg & NORMAL_SYNC) {
811 frm_cfg.rec_delay = 1;
665 frm_cfg.tr_delay = 1; 812 frm_cfg.tr_delay = 1;
813 }
666 else if (arg & EARLY_SYNC) 814 else if (arg & EARLY_SYNC)
667 frm_cfg.tr_delay = 0; 815 frm_cfg.rec_delay = frm_cfg.tr_delay = 0;
816 else if (arg & SECOND_WORD_SYNC) {
817 frm_cfg.rec_delay = 7;
818 frm_cfg.tr_delay = 1;
819 }
668 820
669 tr_cfg.bulk_wspace = frm_cfg.tr_delay; 821 tr_cfg.bulk_wspace = frm_cfg.tr_delay;
670 frm_cfg.early_wend = regk_sser_yes; 822 frm_cfg.early_wend = regk_sser_yes;
@@ -680,9 +832,11 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
680 else if (arg & SYNC_OFF) 832 else if (arg & SYNC_OFF)
681 frm_cfg.frame_pin_use = regk_sser_gio0; 833 frm_cfg.frame_pin_use = regk_sser_gio0;
682 834
683 if (arg & WORD_SIZE_8) 835 dma_w_size = regk_dma_set_w_size2;
836 if (arg & WORD_SIZE_8) {
684 rec_cfg.sample_size = tr_cfg.sample_size = 7; 837 rec_cfg.sample_size = tr_cfg.sample_size = 7;
685 else if (arg & WORD_SIZE_12) 838 dma_w_size = regk_dma_set_w_size1;
839 } else if (arg & WORD_SIZE_12)
686 rec_cfg.sample_size = tr_cfg.sample_size = 11; 840 rec_cfg.sample_size = tr_cfg.sample_size = 11;
687 else if (arg & WORD_SIZE_16) 841 else if (arg & WORD_SIZE_16)
688 rec_cfg.sample_size = tr_cfg.sample_size = 15; 842 rec_cfg.sample_size = tr_cfg.sample_size = 15;
@@ -696,10 +850,13 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
696 else if (arg & BIT_ORDER_LSB) 850 else if (arg & BIT_ORDER_LSB)
697 rec_cfg.sh_dir = tr_cfg.sh_dir = regk_sser_lsbfirst; 851 rec_cfg.sh_dir = tr_cfg.sh_dir = regk_sser_lsbfirst;
698 852
699 if (arg & FLOW_CONTROL_ENABLE) 853 if (arg & FLOW_CONTROL_ENABLE) {
854 frm_cfg.status_pin_use = regk_sser_frm;
700 rec_cfg.fifo_thr = regk_sser_thr16; 855 rec_cfg.fifo_thr = regk_sser_thr16;
701 else if (arg & FLOW_CONTROL_DISABLE) 856 } else if (arg & FLOW_CONTROL_DISABLE) {
857 frm_cfg.status_pin_use = regk_sser_gio0;
702 rec_cfg.fifo_thr = regk_sser_inf; 858 rec_cfg.fifo_thr = regk_sser_inf;
859 }
703 860
704 if (arg & CLOCK_NOT_GATED) 861 if (arg & CLOCK_NOT_GATED)
705 gen_cfg.gate_clk = regk_sser_no; 862 gen_cfg.gate_clk = regk_sser_no;
@@ -726,9 +883,9 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
726 break; 883 break;
727 case SSP_OPOLARITY: 884 case SSP_OPOLARITY:
728 if (arg & CLOCK_NORMAL) 885 if (arg & CLOCK_NORMAL)
729 gen_cfg.out_clk_pol = regk_sser_neg;
730 else if (arg & CLOCK_INVERT)
731 gen_cfg.out_clk_pol = regk_sser_pos; 886 gen_cfg.out_clk_pol = regk_sser_pos;
887 else if (arg & CLOCK_INVERT)
888 gen_cfg.out_clk_pol = regk_sser_neg;
732 889
733 if (arg & FRAME_NORMAL) 890 if (arg & FRAME_NORMAL)
734 frm_cfg.level = regk_sser_pos_hi; 891 frm_cfg.level = regk_sser_pos_hi;
@@ -770,10 +927,9 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
770 } 927 }
771 928
772 929
773 if (port->started) 930 if (port->started) {
774 {
775 tr_cfg.tr_en = port->output;
776 rec_cfg.rec_en = port->input; 931 rec_cfg.rec_en = port->input;
932 gen_cfg.en = (port->output | port->input);
777 } 933 }
778 934
779 REG_WR(sser, port->regi_sser, rw_tr_cfg, tr_cfg); 935 REG_WR(sser, port->regi_sser, rw_tr_cfg, tr_cfg);
@@ -782,138 +938,145 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
782 REG_WR(sser, port->regi_sser, rw_intr_mask, intr_mask); 938 REG_WR(sser, port->regi_sser, rw_intr_mask, intr_mask);
783 REG_WR(sser, port->regi_sser, rw_cfg, gen_cfg); 939 REG_WR(sser, port->regi_sser, rw_cfg, gen_cfg);
784 940
941
942 if (cmd == SSP_FRAME_SYNC && (arg & (WORD_SIZE_8 | WORD_SIZE_12 |
943 WORD_SIZE_16 | WORD_SIZE_24 | WORD_SIZE_32))) {
944 int en = gen_cfg.en;
945 gen_cfg.en = 0;
946 REG_WR(sser, port->regi_sser, rw_cfg, gen_cfg);
947 /* ##### Should DMA be stoped before we change dma size? */
948 DMA_WR_CMD(port->regi_dmain, dma_w_size);
949 DMA_WR_CMD(port->regi_dmaout, dma_w_size);
950 gen_cfg.en = en;
951 REG_WR(sser, port->regi_sser, rw_cfg, gen_cfg);
952 }
953
785 spin_unlock_irq(&port->lock); 954 spin_unlock_irq(&port->lock);
786 return return_val; 955 return return_val;
787} 956}
788 957
789static ssize_t sync_serial_write(struct file * file, const char * buf, 958/* NOTE: sync_serial_write does not support concurrency */
790 size_t count, loff_t *ppos) 959static ssize_t sync_serial_write(struct file *file, const char *buf,
960 size_t count, loff_t *ppos)
791{ 961{
792 int dev = iminor(file->f_path.dentry->d_inode); 962 int dev = iminor(file->f_path.dentry->d_inode);
793 DECLARE_WAITQUEUE(wait, current); 963 DECLARE_WAITQUEUE(wait, current);
794 sync_port *port; 964 struct sync_port *port;
795 unsigned long c, c1; 965 int trunc_count;
796 unsigned long free_outp;
797 unsigned long outp;
798 unsigned long out_buffer;
799 unsigned long flags; 966 unsigned long flags;
967 int bytes_free;
968 int out_buf_count;
800 969
801 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) 970 unsigned char *rd_ptr; /* First allocated byte in the buffer */
802 { 971 unsigned char *wr_ptr; /* First free byte in the buffer */
972 unsigned char *buf_stop_ptr; /* Last byte + 1 */
973
974 if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled) {
803 DEBUG(printk("Invalid minor %d\n", dev)); 975 DEBUG(printk("Invalid minor %d\n", dev));
804 return -ENODEV; 976 return -ENODEV;
805 } 977 }
806 port = &ports[dev]; 978 port = &ports[dev];
807 979
808 DEBUGWRITE(printk("W d%d c %lu (%d/%d)\n", port->port_nbr, count, port->out_count, OUT_BUFFER_SIZE)); 980 /* |<- OUT_BUFFER_SIZE ->|
809 /* Space to end of buffer */ 981 * |<- out_buf_count ->|
810 /* 982 * |<- trunc_count ->| ...->|
811 * out_buffer <c1>012345<- c ->OUT_BUFFER_SIZE 983 * ______________________________________________________
812 * outp^ +out_count 984 * | free | data | free |
813 ^free_outp 985 * |_________|___________________|________________________|
814 * out_buffer 45<- c ->0123OUT_BUFFER_SIZE 986 * ^ rd_ptr ^ wr_ptr
815 * +out_count outp^
816 * free_outp
817 *
818 */ 987 */
988 DEBUGWRITE(printk(KERN_DEBUG "W d%d c %lu a: %p c: %p\n",
989 port->port_nbr, count, port->active_tr_descr,
990 port->catch_tr_descr));
819 991
820 /* Read variables that may be updated by interrupts */ 992 /* Read variables that may be updated by interrupts */
821 spin_lock_irqsave(&port->lock, flags); 993 spin_lock_irqsave(&port->lock, flags);
822 count = count > OUT_BUFFER_SIZE - port->out_count ? OUT_BUFFER_SIZE - port->out_count : count; 994 rd_ptr = port->out_rd_ptr;
823 outp = (unsigned long)port->outp; 995 out_buf_count = port->out_buf_count;
824 free_outp = outp + port->out_count;
825 spin_unlock_irqrestore(&port->lock, flags); 996 spin_unlock_irqrestore(&port->lock, flags);
826 out_buffer = (unsigned long)port->out_buffer;
827 997
828 /* Find out where and how much to write */ 998 /* Check if resources are available */
829 if (free_outp >= out_buffer + OUT_BUFFER_SIZE) 999 if (port->tr_running &&
830 free_outp -= OUT_BUFFER_SIZE; 1000 ((port->use_dma && port->active_tr_descr == port->catch_tr_descr) ||
831 if (free_outp >= outp) 1001 out_buf_count >= OUT_BUFFER_SIZE)) {
832 c = out_buffer + OUT_BUFFER_SIZE - free_outp; 1002 DEBUGWRITE(printk(KERN_DEBUG "sser%d full\n", dev));
833 else 1003 return -EAGAIN;
834 c = outp - free_outp; 1004 }
835 if (c > count) 1005
836 c = count; 1006 buf_stop_ptr = port->out_buffer + OUT_BUFFER_SIZE;
1007
1008 /* Determine pointer to the first free byte, before copying. */
1009 wr_ptr = rd_ptr + out_buf_count;
1010 if (wr_ptr >= buf_stop_ptr)
1011 wr_ptr -= OUT_BUFFER_SIZE;
837 1012
838// DEBUGWRITE(printk("w op %08lX fop %08lX c %lu\n", outp, free_outp, c)); 1013 /* If we wrap the ring buffer, let the user space program handle it by
839 if (copy_from_user((void*)free_outp, buf, c)) 1014 * truncating the data. This could be more elegant, small buffer
1015 * fragments may occur.
1016 */
1017 bytes_free = OUT_BUFFER_SIZE - out_buf_count;
1018 if (wr_ptr + bytes_free > buf_stop_ptr)
1019 bytes_free = buf_stop_ptr - wr_ptr;
1020 trunc_count = (count < bytes_free) ? count : bytes_free;
1021
1022 if (copy_from_user(wr_ptr, buf, trunc_count))
840 return -EFAULT; 1023 return -EFAULT;
841 1024
842 if (c != count) { 1025 DEBUGOUTBUF(printk(KERN_DEBUG "%-4d + %-4d = %-4d %p %p %p\n",
843 buf += c; 1026 out_buf_count, trunc_count,
844 c1 = count - c; 1027 port->out_buf_count, port->out_buffer,
845 DEBUGWRITE(printk("w2 fi %lu c %lu c1 %lu\n", free_outp-out_buffer, c, c1)); 1028 wr_ptr, buf_stop_ptr));
846 if (copy_from_user((void*)out_buffer, buf, c1))
847 return -EFAULT;
848 }
849 spin_lock_irqsave(&port->lock, flags);
850 port->out_count += count;
851 spin_unlock_irqrestore(&port->lock, flags);
852 1029
853 /* Make sure transmitter/receiver is running */ 1030 /* Make sure transmitter/receiver is running */
854 if (!port->started) 1031 if (!port->started) {
855 {
856 reg_sser_rw_cfg cfg = REG_RD(sser, port->regi_sser, rw_cfg); 1032 reg_sser_rw_cfg cfg = REG_RD(sser, port->regi_sser, rw_cfg);
857 reg_sser_rw_tr_cfg tr_cfg = REG_RD(sser, port->regi_sser, rw_tr_cfg);
858 reg_sser_rw_rec_cfg rec_cfg = REG_RD(sser, port->regi_sser, rw_rec_cfg); 1033 reg_sser_rw_rec_cfg rec_cfg = REG_RD(sser, port->regi_sser, rw_rec_cfg);
859 cfg.en = regk_sser_yes; 1034 cfg.en = regk_sser_yes;
860 tr_cfg.tr_en = port->output;
861 rec_cfg.rec_en = port->input; 1035 rec_cfg.rec_en = port->input;
862 REG_WR(sser, port->regi_sser, rw_cfg, cfg); 1036 REG_WR(sser, port->regi_sser, rw_cfg, cfg);
863 REG_WR(sser, port->regi_sser, rw_tr_cfg, tr_cfg);
864 REG_WR(sser, port->regi_sser, rw_rec_cfg, rec_cfg); 1037 REG_WR(sser, port->regi_sser, rw_rec_cfg, rec_cfg);
865 port->started = 1; 1038 port->started = 1;
866 } 1039 }
867 1040
868 if (file->f_flags & O_NONBLOCK) { 1041 /* Setup wait if blocking */
869 spin_lock_irqsave(&port->lock, flags); 1042 if (!(file->f_flags & O_NONBLOCK)) {
870 if (!port->tr_running) { 1043 add_wait_queue(&port->out_wait_q, &wait);
871 if (!port->use_dma) { 1044 set_current_state(TASK_INTERRUPTIBLE);
872 reg_sser_rw_intr_mask intr_mask;
873 intr_mask = REG_RD(sser, port->regi_sser, rw_intr_mask);
874 /* Start sender by writing data */
875 send_word(port);
876 /* and enable transmitter ready IRQ */
877 intr_mask.trdy = 1;
878 REG_WR(sser, port->regi_sser, rw_intr_mask, intr_mask);
879 } else {
880 start_dma(port, (unsigned char* volatile )port->outp, c);
881 }
882 }
883 spin_unlock_irqrestore(&port->lock, flags);
884 DEBUGWRITE(printk("w d%d c %lu NB\n",
885 port->port_nbr, count));
886 return count;
887 } 1045 }
888 1046
889 /* Sleep until all sent */
890
891 add_wait_queue(&port->out_wait_q, &wait);
892 set_current_state(TASK_INTERRUPTIBLE);
893 spin_lock_irqsave(&port->lock, flags); 1047 spin_lock_irqsave(&port->lock, flags);
894 if (!port->tr_running) { 1048 port->out_buf_count += trunc_count;
895 if (!port->use_dma) { 1049 if (port->use_dma) {
896 reg_sser_rw_intr_mask intr_mask; 1050 start_dma_out(port, wr_ptr, trunc_count);
897 intr_mask = REG_RD(sser, port->regi_sser, rw_intr_mask); 1051 } else if (!port->tr_running) {
898 /* Start sender by writing data */ 1052 reg_sser_rw_intr_mask intr_mask;
899 send_word(port); 1053 intr_mask = REG_RD(sser, port->regi_sser, rw_intr_mask);
900 /* and enable transmitter ready IRQ */ 1054 /* Start sender by writing data */
901 intr_mask.trdy = 1; 1055 send_word(port);
902 REG_WR(sser, port->regi_sser, rw_intr_mask, intr_mask); 1056 /* and enable transmitter ready IRQ */
903 } else { 1057 intr_mask.trdy = 1;
904 start_dma(port, port->outp, c); 1058 REG_WR(sser, port->regi_sser, rw_intr_mask, intr_mask);
905 }
906 } 1059 }
907 spin_unlock_irqrestore(&port->lock, flags); 1060 spin_unlock_irqrestore(&port->lock, flags);
1061
1062 /* Exit if non blocking */
1063 if (file->f_flags & O_NONBLOCK) {
1064 DEBUGWRITE(printk(KERN_DEBUG "w d%d c %lu %08x\n",
1065 port->port_nbr, trunc_count,
1066 REG_RD_INT(dma, port->regi_dmaout, r_intr)));
1067 return trunc_count;
1068 }
1069
908 schedule(); 1070 schedule();
909 set_current_state(TASK_RUNNING); 1071 set_current_state(TASK_RUNNING);
910 remove_wait_queue(&port->out_wait_q, &wait); 1072 remove_wait_queue(&port->out_wait_q, &wait);
1073
911 if (signal_pending(current)) 1074 if (signal_pending(current))
912 {
913 return -EINTR; 1075 return -EINTR;
914 } 1076
915 DEBUGWRITE(printk("w d%d c %lu\n", port->port_nbr, count)); 1077 DEBUGWRITE(printk(KERN_DEBUG "w d%d c %lu\n",
916 return count; 1078 port->port_nbr, trunc_count));
1079 return trunc_count;
917} 1080}
918 1081
919static ssize_t sync_serial_read(struct file * file, char * buf, 1082static ssize_t sync_serial_read(struct file * file, char * buf,
@@ -926,7 +1089,7 @@ static ssize_t sync_serial_read(struct file * file, char * buf,
926 unsigned char* end; 1089 unsigned char* end;
927 unsigned long flags; 1090 unsigned long flags;
928 1091
929 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) 1092 if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled)
930 { 1093 {
931 DEBUG(printk("Invalid minor %d\n", dev)); 1094 DEBUG(printk("Invalid minor %d\n", dev));
932 return -ENODEV; 1095 return -ENODEV;
@@ -949,7 +1112,6 @@ static ssize_t sync_serial_read(struct file * file, char * buf,
949 port->started = 1; 1112 port->started = 1;
950 } 1113 }
951 1114
952
953 /* Calculate number of available bytes */ 1115 /* Calculate number of available bytes */
954 /* Save pointers to avoid that they are modified by interrupt */ 1116 /* Save pointers to avoid that they are modified by interrupt */
955 spin_lock_irqsave(&port->lock, flags); 1117 spin_lock_irqsave(&port->lock, flags);
@@ -958,16 +1120,14 @@ static ssize_t sync_serial_read(struct file * file, char * buf,
958 spin_unlock_irqrestore(&port->lock, flags); 1120 spin_unlock_irqrestore(&port->lock, flags);
959 while ((start == end) && !port->full) /* No data */ 1121 while ((start == end) && !port->full) /* No data */
960 { 1122 {
1123 DEBUGREAD(printk(KERN_DEBUG "&"));
961 if (file->f_flags & O_NONBLOCK) 1124 if (file->f_flags & O_NONBLOCK)
962 {
963 return -EAGAIN; 1125 return -EAGAIN;
964 }
965 1126
966 interruptible_sleep_on(&port->in_wait_q); 1127 interruptible_sleep_on(&port->in_wait_q);
967 if (signal_pending(current)) 1128 if (signal_pending(current))
968 {
969 return -EINTR; 1129 return -EINTR;
970 } 1130
971 spin_lock_irqsave(&port->lock, flags); 1131 spin_lock_irqsave(&port->lock, flags);
972 start = (unsigned char*)port->readp; /* cast away volatile */ 1132 start = (unsigned char*)port->readp; /* cast away volatile */
973 end = (unsigned char*)port->writep; /* cast away volatile */ 1133 end = (unsigned char*)port->writep; /* cast away volatile */
@@ -1004,83 +1164,105 @@ static void send_word(sync_port* port)
1004 switch(tr_cfg.sample_size) 1164 switch(tr_cfg.sample_size)
1005 { 1165 {
1006 case 8: 1166 case 8:
1007 port->out_count--; 1167 port->out_buf_count--;
1008 tr_data.data = *port->outp++; 1168 tr_data.data = *port->out_rd_ptr++;
1009 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data); 1169 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1010 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE) 1170 if (port->out_rd_ptr >= port->out_buffer + OUT_BUFFER_SIZE)
1011 port->outp = port->out_buffer; 1171 port->out_rd_ptr = port->out_buffer;
1012 break; 1172 break;
1013 case 12: 1173 case 12:
1014 { 1174 {
1015 int data = (*port->outp++) << 8; 1175 int data = (*port->out_rd_ptr++) << 8;
1016 data |= *port->outp++; 1176 data |= *port->out_rd_ptr++;
1017 port->out_count-=2; 1177 port->out_buf_count -= 2;
1018 tr_data.data = data; 1178 tr_data.data = data;
1019 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data); 1179 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1020 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE) 1180 if (port->out_rd_ptr >= port->out_buffer + OUT_BUFFER_SIZE)
1021 port->outp = port->out_buffer; 1181 port->out_rd_ptr = port->out_buffer;
1022 } 1182 }
1023 break; 1183 break;
1024 case 16: 1184 case 16:
1025 port->out_count-=2; 1185 port->out_buf_count -= 2;
1026 tr_data.data = *(unsigned short *)port->outp; 1186 tr_data.data = *(unsigned short *)port->out_rd_ptr;
1027 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data); 1187 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1028 port->outp+=2; 1188 port->out_rd_ptr += 2;
1029 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE) 1189 if (port->out_rd_ptr >= port->out_buffer + OUT_BUFFER_SIZE)
1030 port->outp = port->out_buffer; 1190 port->out_rd_ptr = port->out_buffer;
1031 break; 1191 break;
1032 case 24: 1192 case 24:
1033 port->out_count-=3; 1193 port->out_buf_count -= 3;
1034 tr_data.data = *(unsigned short *)port->outp; 1194 tr_data.data = *(unsigned short *)port->out_rd_ptr;
1035 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data); 1195 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1036 port->outp+=2; 1196 port->out_rd_ptr += 2;
1037 tr_data.data = *port->outp++; 1197 tr_data.data = *port->out_rd_ptr++;
1038 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data); 1198 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1039 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE) 1199 if (port->out_rd_ptr >= port->out_buffer + OUT_BUFFER_SIZE)
1040 port->outp = port->out_buffer; 1200 port->out_rd_ptr = port->out_buffer;
1041 break; 1201 break;
1042 case 32: 1202 case 32:
1043 port->out_count-=4; 1203 port->out_buf_count -= 4;
1044 tr_data.data = *(unsigned short *)port->outp; 1204 tr_data.data = *(unsigned short *)port->out_rd_ptr;
1045 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data); 1205 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1046 port->outp+=2; 1206 port->out_rd_ptr += 2;
1047 tr_data.data = *(unsigned short *)port->outp; 1207 tr_data.data = *(unsigned short *)port->out_rd_ptr;
1048 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data); 1208 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1049 port->outp+=2; 1209 port->out_rd_ptr += 2;
1050 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE) 1210 if (port->out_rd_ptr >= port->out_buffer + OUT_BUFFER_SIZE)
1051 port->outp = port->out_buffer; 1211 port->out_rd_ptr = port->out_buffer;
1052 break; 1212 break;
1053 } 1213 }
1054} 1214}
1055 1215
1056 1216static void start_dma_out(struct sync_port *port,
1057static void start_dma(struct sync_port* port, const char* data, int count) 1217 const char *data, int count)
1058{ 1218{
1059 port->tr_running = 1; 1219 port->active_tr_descr->buf = (char *) virt_to_phys((char *) data);
1060 port->out_descr.buf = (char*)virt_to_phys((char*)data); 1220 port->active_tr_descr->after = port->active_tr_descr->buf + count;
1061 port->out_descr.after = port->out_descr.buf + count; 1221 port->active_tr_descr->intr = 1;
1062 port->out_descr.eol = port->out_descr.intr = 1; 1222
1223 port->active_tr_descr->eol = 1;
1224 port->prev_tr_descr->eol = 0;
1225
1226 DEBUGTRDMA(printk(KERN_DEBUG "Inserting eolr:%p eol@:%p\n",
1227 port->prev_tr_descr, port->active_tr_descr));
1228 port->prev_tr_descr = port->active_tr_descr;
1229 port->active_tr_descr = phys_to_virt((int) port->active_tr_descr->next);
1230
1231 if (!port->tr_running) {
1232 reg_sser_rw_tr_cfg tr_cfg = REG_RD(sser, port->regi_sser,
1233 rw_tr_cfg);
1063 1234
1064 port->out_context.saved_data = (dma_descr_data*)virt_to_phys(&port->out_descr); 1235 port->out_context.next = 0;
1065 port->out_context.saved_data_buf = port->out_descr.buf; 1236 port->out_context.saved_data =
1237 (dma_descr_data *)virt_to_phys(port->prev_tr_descr);
1238 port->out_context.saved_data_buf = port->prev_tr_descr->buf;
1239
1240 DMA_START_CONTEXT(port->regi_dmaout,
1241 virt_to_phys((char *)&port->out_context));
1242
1243 tr_cfg.tr_en = regk_sser_yes;
1244 REG_WR(sser, port->regi_sser, rw_tr_cfg, tr_cfg);
1245 DEBUGTRDMA(printk(KERN_DEBUG "dma s\n"););
1246 } else {
1247 DMA_CONTINUE_DATA(port->regi_dmaout);
1248 DEBUGTRDMA(printk(KERN_DEBUG "dma c\n"););
1249 }
1066 1250
1067 DMA_START_CONTEXT(port->regi_dmaout, virt_to_phys((char*)&port->out_context)); 1251 port->tr_running = 1;
1068 DEBUGTXINT(printk("dma %08lX c %d\n", (unsigned long)data, count));
1069} 1252}
1070 1253
1071static void start_dma_in(sync_port* port) 1254static void start_dma_in(sync_port *port)
1072{ 1255{
1073 int i; 1256 int i;
1074 char* buf; 1257 char *buf;
1075 port->writep = port->flip; 1258 port->writep = port->flip;
1076 1259
1077 if (port->writep > port->flip + port->in_buffer_size) 1260 if (port->writep > port->flip + port->in_buffer_size) {
1078 {
1079 panic("Offset too large in sync serial driver\n"); 1261 panic("Offset too large in sync serial driver\n");
1080 return; 1262 return;
1081 } 1263 }
1082 buf = (char*)virt_to_phys(port->in_buffer); 1264 buf = (char*)virt_to_phys(port->in_buffer);
1083 for (i = 0; i < NUM_IN_DESCR; i++) { 1265 for (i = 0; i < NBR_IN_DESCR; i++) {
1084 port->in_descr[i].buf = buf; 1266 port->in_descr[i].buf = buf;
1085 port->in_descr[i].after = buf + port->inbufchunk; 1267 port->in_descr[i].after = buf + port->inbufchunk;
1086 port->in_descr[i].intr = 1; 1268 port->in_descr[i].intr = 1;
@@ -1092,59 +1274,126 @@ static void start_dma_in(sync_port* port)
1092 port->in_descr[i-1].next = (dma_descr_data*)virt_to_phys(&port->in_descr[0]); 1274 port->in_descr[i-1].next = (dma_descr_data*)virt_to_phys(&port->in_descr[0]);
1093 port->in_descr[i-1].eol = regk_sser_yes; 1275 port->in_descr[i-1].eol = regk_sser_yes;
1094 port->next_rx_desc = &port->in_descr[0]; 1276 port->next_rx_desc = &port->in_descr[0];
1095 port->prev_rx_desc = &port->in_descr[NUM_IN_DESCR - 1]; 1277 port->prev_rx_desc = &port->in_descr[NBR_IN_DESCR - 1];
1096 port->in_context.saved_data = (dma_descr_data*)virt_to_phys(&port->in_descr[0]); 1278 port->in_context.saved_data = (dma_descr_data*)virt_to_phys(&port->in_descr[0]);
1097 port->in_context.saved_data_buf = port->in_descr[0].buf; 1279 port->in_context.saved_data_buf = port->in_descr[0].buf;
1098 DMA_START_CONTEXT(port->regi_dmain, virt_to_phys(&port->in_context)); 1280 DMA_START_CONTEXT(port->regi_dmain, virt_to_phys(&port->in_context));
1099} 1281}
1100 1282
1101#ifdef SYNC_SER_DMA 1283#ifdef SYNC_SER_DMA
1102static irqreturn_t tr_interrupt(int irq, void *dev_id, struct pt_regs * regs) 1284static irqreturn_t tr_interrupt(int irq, void *dev_id)
1103{ 1285{
1104 reg_dma_r_masked_intr masked; 1286 reg_dma_r_masked_intr masked;
1105 reg_dma_rw_ack_intr ack_intr = {.data = regk_dma_yes}; 1287 reg_dma_rw_ack_intr ack_intr = {.data = regk_dma_yes};
1288 reg_dma_rw_stat stat;
1106 int i; 1289 int i;
1107 struct dma_descr_data *descr;
1108 unsigned int sentl;
1109 int found = 0; 1290 int found = 0;
1291 int stop_sser = 0;
1110 1292
1111 for (i = 0; i < NUMBER_OF_PORTS; i++) 1293 for (i = 0; i < NBR_PORTS; i++) {
1112 {
1113 sync_port *port = &ports[i]; 1294 sync_port *port = &ports[i];
1114 if (!port->enabled || !port->use_dma ) 1295 if (!port->enabled || !port->use_dma)
1115 continue; 1296 continue;
1116 1297
1298 /* IRQ active for the port? */
1117 masked = REG_RD(dma, port->regi_dmaout, r_masked_intr); 1299 masked = REG_RD(dma, port->regi_dmaout, r_masked_intr);
1300 if (!masked.data)
1301 continue;
1118 1302
1119 if (masked.data) /* IRQ active for the port? */ 1303 found = 1;
1120 { 1304
1121 found = 1; 1305 /* Check if we should stop the DMA transfer */
1122 /* Clear IRQ */ 1306 stat = REG_RD(dma, port->regi_dmaout, rw_stat);
1123 REG_WR(dma, port->regi_dmaout, rw_ack_intr, ack_intr); 1307 if (stat.list_state == regk_dma_data_at_eol)
1124 descr = &port->out_descr; 1308 stop_sser = 1;
1125 sentl = descr->after - descr->buf; 1309
1126 port->out_count -= sentl; 1310 /* Clear IRQ */
1127 port->outp += sentl; 1311 REG_WR(dma, port->regi_dmaout, rw_ack_intr, ack_intr);
1128 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE) 1312
1129 port->outp = port->out_buffer; 1313 if (!stop_sser) {
1130 if (port->out_count) { 1314 /* The DMA has completed a descriptor, EOL was not
1131 int c; 1315 * encountered, so step relevant descriptor and
1132 c = port->out_buffer + OUT_BUFFER_SIZE - port->outp; 1316 * datapointers forward. */
1133 if (c > port->out_count) 1317 int sent;
1134 c = port->out_count; 1318 sent = port->catch_tr_descr->after -
1135 DEBUGTXINT(printk("tx_int DMAWRITE %i %i\n", sentl, c)); 1319 port->catch_tr_descr->buf;
1136 start_dma(port, port->outp, c); 1320 DEBUGTXINT(printk(KERN_DEBUG "%-4d - %-4d = %-4d\t"
1137 } else { 1321 "in descr %p (ac: %p)\n",
1138 DEBUGTXINT(printk("tx_int DMA stop %i\n", sentl)); 1322 port->out_buf_count, sent,
1139 port->tr_running = 0; 1323 port->out_buf_count - sent,
1324 port->catch_tr_descr,
1325 port->active_tr_descr););
1326 port->out_buf_count -= sent;
1327 port->catch_tr_descr =
1328 phys_to_virt((int) port->catch_tr_descr->next);
1329 port->out_rd_ptr =
1330 phys_to_virt((int) port->catch_tr_descr->buf);
1331 } else {
1332 int i, sent;
1333 /* EOL handler.
1334 * Note that if an EOL was encountered during the irq
1335 * locked section of sync_ser_write the DMA will be
1336 * restarted and the eol flag will be cleared.
1337 * The remaining descriptors will be traversed by
1338 * the descriptor interrupts as usual.
1339 */
1340 i = 0;
1341 while (!port->catch_tr_descr->eol) {
1342 sent = port->catch_tr_descr->after -
1343 port->catch_tr_descr->buf;
1344 DEBUGOUTBUF(printk(KERN_DEBUG
1345 "traversing descr %p -%d (%d)\n",
1346 port->catch_tr_descr,
1347 sent,
1348 port->out_buf_count));
1349 port->out_buf_count -= sent;
1350 port->catch_tr_descr = phys_to_virt(
1351 (int)port->catch_tr_descr->next);
1352 i++;
1353 if (i >= NBR_OUT_DESCR) {
1354 /* TODO: Reset and recover */
1355 panic("sync_serial: missing eol");
1356 }
1140 } 1357 }
1141 wake_up_interruptible(&port->out_wait_q); /* wake up the waiting process */ 1358 sent = port->catch_tr_descr->after -
1359 port->catch_tr_descr->buf;
1360 DEBUGOUTBUF(printk(KERN_DEBUG
1361 "eol at descr %p -%d (%d)\n",
1362 port->catch_tr_descr,
1363 sent,
1364 port->out_buf_count));
1365
1366 port->out_buf_count -= sent;
1367
1368 /* Update read pointer to first free byte, we
1369 * may already be writing data there. */
1370 port->out_rd_ptr =
1371 phys_to_virt((int) port->catch_tr_descr->after);
1372 if (port->out_rd_ptr > port->out_buffer +
1373 OUT_BUFFER_SIZE)
1374 port->out_rd_ptr = port->out_buffer;
1375
1376 reg_sser_rw_tr_cfg tr_cfg =
1377 REG_RD(sser, port->regi_sser, rw_tr_cfg);
1378 DEBUGTXINT(printk(KERN_DEBUG
1379 "tr_int DMA stop %d, set catch @ %p\n",
1380 port->out_buf_count,
1381 port->active_tr_descr));
1382 if (port->out_buf_count != 0)
1383 printk(KERN_CRIT "sync_ser: buffer not "
1384 "empty after eol.\n");
1385 port->catch_tr_descr = port->active_tr_descr;
1386 port->tr_running = 0;
1387 tr_cfg.tr_en = regk_sser_no;
1388 REG_WR(sser, port->regi_sser, rw_tr_cfg, tr_cfg);
1142 } 1389 }
1390 /* wake up the waiting process */
1391 wake_up_interruptible(&port->out_wait_q);
1143 } 1392 }
1144 return IRQ_RETVAL(found); 1393 return IRQ_RETVAL(found);
1145} /* tr_interrupt */ 1394} /* tr_interrupt */
1146 1395
1147static irqreturn_t rx_interrupt(int irq, void *dev_id, struct pt_regs * regs) 1396static irqreturn_t rx_interrupt(int irq, void *dev_id)
1148{ 1397{
1149 reg_dma_r_masked_intr masked; 1398 reg_dma_r_masked_intr masked;
1150 reg_dma_rw_ack_intr ack_intr = {.data = regk_dma_yes}; 1399 reg_dma_rw_ack_intr ack_intr = {.data = regk_dma_yes};
@@ -1152,7 +1401,7 @@ static irqreturn_t rx_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1152 int i; 1401 int i;
1153 int found = 0; 1402 int found = 0;
1154 1403
1155 for (i = 0; i < NUMBER_OF_PORTS; i++) 1404 for (i = 0; i < NBR_PORTS; i++)
1156 { 1405 {
1157 sync_port *port = &ports[i]; 1406 sync_port *port = &ports[i];
1158 1407
@@ -1166,7 +1415,7 @@ static irqreturn_t rx_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1166 found = 1; 1415 found = 1;
1167 while (REG_RD(dma, port->regi_dmain, rw_data) != 1416 while (REG_RD(dma, port->regi_dmain, rw_data) !=
1168 virt_to_phys(port->next_rx_desc)) { 1417 virt_to_phys(port->next_rx_desc)) {
1169 1418 DEBUGRXINT(printk(KERN_DEBUG "!"));
1170 if (port->writep + port->inbufchunk > port->flip + port->in_buffer_size) { 1419 if (port->writep + port->inbufchunk > port->flip + port->in_buffer_size) {
1171 int first_size = port->flip + port->in_buffer_size - port->writep; 1420 int first_size = port->flip + port->in_buffer_size - port->writep;
1172 memcpy((char*)port->writep, phys_to_virt((unsigned)port->next_rx_desc->buf), first_size); 1421 memcpy((char*)port->writep, phys_to_virt((unsigned)port->next_rx_desc->buf), first_size);
@@ -1185,11 +1434,16 @@ static irqreturn_t rx_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1185 port->full = 1; 1434 port->full = 1;
1186 } 1435 }
1187 1436
1188 port->next_rx_desc->eol = 0; 1437 port->next_rx_desc->eol = 1;
1189 port->prev_rx_desc->eol = 1; 1438 port->prev_rx_desc->eol = 0;
1190 port->prev_rx_desc = phys_to_virt((unsigned)port->next_rx_desc); 1439 /* Cache bug workaround */
1440 flush_dma_descr(port->prev_rx_desc, 0);
1441 port->prev_rx_desc = port->next_rx_desc;
1191 port->next_rx_desc = phys_to_virt((unsigned)port->next_rx_desc->next); 1442 port->next_rx_desc = phys_to_virt((unsigned)port->next_rx_desc->next);
1192 wake_up_interruptible(&port->in_wait_q); /* wake up the waiting process */ 1443 /* Cache bug workaround */
1444 flush_dma_descr(port->prev_rx_desc, 1);
1445 /* wake up the waiting process */
1446 wake_up_interruptible(&port->in_wait_q);
1193 DMA_CONTINUE(port->regi_dmain); 1447 DMA_CONTINUE(port->regi_dmain);
1194 REG_WR(dma, port->regi_dmain, rw_ack_intr, ack_intr); 1448 REG_WR(dma, port->regi_dmain, rw_ack_intr, ack_intr);
1195 1449
@@ -1201,15 +1455,15 @@ static irqreturn_t rx_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1201#endif /* SYNC_SER_DMA */ 1455#endif /* SYNC_SER_DMA */
1202 1456
1203#ifdef SYNC_SER_MANUAL 1457#ifdef SYNC_SER_MANUAL
1204static irqreturn_t manual_interrupt(int irq, void *dev_id, struct pt_regs * regs) 1458static irqreturn_t manual_interrupt(int irq, void *dev_id)
1205{ 1459{
1206 int i; 1460 int i;
1207 int found = 0; 1461 int found = 0;
1208 reg_sser_r_masked_intr masked; 1462 reg_sser_r_masked_intr masked;
1209 1463
1210 for (i = 0; i < NUMBER_OF_PORTS; i++) 1464 for (i = 0; i < NBR_PORTS; i++)
1211 { 1465 {
1212 sync_port* port = &ports[i]; 1466 sync_port *port = &ports[i];
1213 1467
1214 if (!port->enabled || port->use_dma) 1468 if (!port->enabled || port->use_dma)
1215 { 1469 {
@@ -1263,7 +1517,7 @@ static irqreturn_t manual_interrupt(int irq, void *dev_id, struct pt_regs * regs
1263 if (masked.trdy) /* Transmitter ready? */ 1517 if (masked.trdy) /* Transmitter ready? */
1264 { 1518 {
1265 found = 1; 1519 found = 1;
1266 if (port->out_count > 0) /* More data to send */ 1520 if (port->out_buf_count > 0) /* More data to send */
1267 send_word(port); 1521 send_word(port);
1268 else /* transmission finished */ 1522 else /* transmission finished */
1269 { 1523 {
diff --git a/arch/cris/arch-v32/kernel/Makefile b/arch/cris/arch-v32/kernel/Makefile
index 5d5b613cde8c..993d987b0078 100644
--- a/arch/cris/arch-v32/kernel/Makefile
+++ b/arch/cris/arch-v32/kernel/Makefile
@@ -1,4 +1,3 @@
1# $Id: Makefile,v 1.11 2004/12/17 10:16:13 starvik Exp $
2# 1#
3# Makefile for the linux kernel. 2# Makefile for the linux kernel.
4# 3#
@@ -6,9 +5,9 @@
6extra-y := head.o 5extra-y := head.o
7 6
8 7
9obj-y := entry.o traps.o irq.o debugport.o dma.o pinmux.o \ 8obj-y := entry.o traps.o irq.o debugport.o \
10 process.o ptrace.o setup.o signal.o traps.o time.o \ 9 process.o ptrace.o setup.o signal.o traps.o time.o \
11 arbiter.o io.o 10 cache.o cacheflush.o
12 11
13obj-$(CONFIG_ETRAXFS_SIM) += vcs_hook.o 12obj-$(CONFIG_ETRAXFS_SIM) += vcs_hook.o
14 13
diff --git a/arch/cris/arch-v32/kernel/arbiter.c b/arch/cris/arch-v32/kernel/arbiter.c
deleted file mode 100644
index 420a5312ed03..000000000000
--- a/arch/cris/arch-v32/kernel/arbiter.c
+++ /dev/null
@@ -1,296 +0,0 @@
1/*
2 * Memory arbiter functions. Allocates bandwidth through the
3 * arbiter and sets up arbiter breakpoints.
4 *
5 * The algorithm first assigns slots to the clients that has specified
6 * bandwidth (e.g. ethernet) and then the remaining slots are divided
7 * on all the active clients.
8 *
9 * Copyright (c) 2004, 2005 Axis Communications AB.
10 */
11
12#include <asm/arch/hwregs/reg_map.h>
13#include <asm/arch/hwregs/reg_rdwr.h>
14#include <asm/arch/hwregs/marb_defs.h>
15#include <asm/arch/arbiter.h>
16#include <asm/arch/hwregs/intr_vect.h>
17#include <linux/interrupt.h>
18#include <linux/signal.h>
19#include <linux/errno.h>
20#include <linux/spinlock.h>
21#include <asm/io.h>
22
23struct crisv32_watch_entry
24{
25 unsigned long instance;
26 watch_callback* cb;
27 unsigned long start;
28 unsigned long end;
29 int used;
30};
31
32#define NUMBER_OF_BP 4
33#define NBR_OF_CLIENTS 14
34#define NBR_OF_SLOTS 64
35#define SDRAM_BANDWIDTH 100000000 /* Some kind of expected value */
36#define INTMEM_BANDWIDTH 400000000
37#define NBR_OF_REGIONS 2
38
39static struct crisv32_watch_entry watches[NUMBER_OF_BP] =
40{
41 {regi_marb_bp0},
42 {regi_marb_bp1},
43 {regi_marb_bp2},
44 {regi_marb_bp3}
45};
46
47static int requested_slots[NBR_OF_REGIONS][NBR_OF_CLIENTS];
48static int active_clients[NBR_OF_REGIONS][NBR_OF_CLIENTS];
49static int max_bandwidth[NBR_OF_REGIONS] = {SDRAM_BANDWIDTH, INTMEM_BANDWIDTH};
50
51DEFINE_SPINLOCK(arbiter_lock);
52
53static irqreturn_t
54crisv32_arbiter_irq(int irq, void* dev_id, struct pt_regs* regs);
55
56static void crisv32_arbiter_config(int region)
57{
58 int slot;
59 int client;
60 int interval = 0;
61 int val[NBR_OF_SLOTS];
62
63 for (slot = 0; slot < NBR_OF_SLOTS; slot++)
64 val[slot] = NBR_OF_CLIENTS + 1;
65
66 for (client = 0; client < NBR_OF_CLIENTS; client++)
67 {
68 int pos;
69 if (!requested_slots[region][client])
70 continue;
71 interval = NBR_OF_SLOTS / requested_slots[region][client];
72 pos = 0;
73 while (pos < NBR_OF_SLOTS)
74 {
75 if (val[pos] != NBR_OF_CLIENTS + 1)
76 pos++;
77 else
78 {
79 val[pos] = client;
80 pos += interval;
81 }
82 }
83 }
84
85 client = 0;
86 for (slot = 0; slot < NBR_OF_SLOTS; slot++)
87 {
88 if (val[slot] == NBR_OF_CLIENTS + 1)
89 {
90 int first = client;
91 while(!active_clients[region][client]) {
92 client = (client + 1) % NBR_OF_CLIENTS;
93 if (client == first)
94 break;
95 }
96 val[slot] = client;
97 client = (client + 1) % NBR_OF_CLIENTS;
98 }
99 if (region == EXT_REGION)
100 REG_WR_INT_VECT(marb, regi_marb, rw_ext_slots, slot, val[slot]);
101 else if (region == INT_REGION)
102 REG_WR_INT_VECT(marb, regi_marb, rw_int_slots, slot, val[slot]);
103 }
104}
105
106extern char _stext, _etext;
107
108static void crisv32_arbiter_init(void)
109{
110 static int initialized = 0;
111
112 if (initialized)
113 return;
114
115 initialized = 1;
116
117 /* CPU caches are active. */
118 active_clients[EXT_REGION][10] = active_clients[EXT_REGION][11] = 1;
119 crisv32_arbiter_config(EXT_REGION);
120 crisv32_arbiter_config(INT_REGION);
121
122 if (request_irq(MEMARB_INTR_VECT, crisv32_arbiter_irq, IRQF_DISABLED,
123 "arbiter", NULL))
124 printk(KERN_ERR "Couldn't allocate arbiter IRQ\n");
125
126#ifndef CONFIG_ETRAX_KGDB
127 /* Global watch for writes to kernel text segment. */
128 crisv32_arbiter_watch(virt_to_phys(&_stext), &_etext - &_stext,
129 arbiter_all_clients, arbiter_all_write, NULL);
130#endif
131}
132
133
134
135int crisv32_arbiter_allocate_bandwidth(int client, int region,
136 unsigned long bandwidth)
137{
138 int i;
139 int total_assigned = 0;
140 int total_clients = 0;
141 int req;
142
143 crisv32_arbiter_init();
144
145 for (i = 0; i < NBR_OF_CLIENTS; i++)
146 {
147 total_assigned += requested_slots[region][i];
148 total_clients += active_clients[region][i];
149 }
150 req = NBR_OF_SLOTS / (max_bandwidth[region] / bandwidth);
151
152 if (total_assigned + total_clients + req + 1 > NBR_OF_SLOTS)
153 return -ENOMEM;
154
155 active_clients[region][client] = 1;
156 requested_slots[region][client] = req;
157 crisv32_arbiter_config(region);
158
159 return 0;
160}
161
162int crisv32_arbiter_watch(unsigned long start, unsigned long size,
163 unsigned long clients, unsigned long accesses,
164 watch_callback* cb)
165{
166 int i;
167
168 crisv32_arbiter_init();
169
170 if (start > 0x80000000) {
171 printk("Arbiter: %lX doesn't look like a physical address", start);
172 return -EFAULT;
173 }
174
175 spin_lock(&arbiter_lock);
176
177 for (i = 0; i < NUMBER_OF_BP; i++) {
178 if (!watches[i].used) {
179 reg_marb_rw_intr_mask intr_mask = REG_RD(marb, regi_marb, rw_intr_mask);
180
181 watches[i].used = 1;
182 watches[i].start = start;
183 watches[i].end = start + size;
184 watches[i].cb = cb;
185
186 REG_WR_INT(marb_bp, watches[i].instance, rw_first_addr, watches[i].start);
187 REG_WR_INT(marb_bp, watches[i].instance, rw_last_addr, watches[i].end);
188 REG_WR_INT(marb_bp, watches[i].instance, rw_op, accesses);
189 REG_WR_INT(marb_bp, watches[i].instance, rw_clients, clients);
190
191 if (i == 0)
192 intr_mask.bp0 = regk_marb_yes;
193 else if (i == 1)
194 intr_mask.bp1 = regk_marb_yes;
195 else if (i == 2)
196 intr_mask.bp2 = regk_marb_yes;
197 else if (i == 3)
198 intr_mask.bp3 = regk_marb_yes;
199
200 REG_WR(marb, regi_marb, rw_intr_mask, intr_mask);
201 spin_unlock(&arbiter_lock);
202
203 return i;
204 }
205 }
206 spin_unlock(&arbiter_lock);
207 return -ENOMEM;
208}
209
210int crisv32_arbiter_unwatch(int id)
211{
212 reg_marb_rw_intr_mask intr_mask = REG_RD(marb, regi_marb, rw_intr_mask);
213
214 crisv32_arbiter_init();
215
216 spin_lock(&arbiter_lock);
217
218 if ((id < 0) || (id >= NUMBER_OF_BP) || (!watches[id].used)) {
219 spin_unlock(&arbiter_lock);
220 return -EINVAL;
221 }
222
223 memset(&watches[id], 0, sizeof(struct crisv32_watch_entry));
224
225 if (id == 0)
226 intr_mask.bp0 = regk_marb_no;
227 else if (id == 1)
228 intr_mask.bp2 = regk_marb_no;
229 else if (id == 2)
230 intr_mask.bp2 = regk_marb_no;
231 else if (id == 3)
232 intr_mask.bp3 = regk_marb_no;
233
234 REG_WR(marb, regi_marb, rw_intr_mask, intr_mask);
235
236 spin_unlock(&arbiter_lock);
237 return 0;
238}
239
240extern void show_registers(struct pt_regs *regs);
241
242static irqreturn_t
243crisv32_arbiter_irq(int irq, void* dev_id, struct pt_regs* regs)
244{
245 reg_marb_r_masked_intr masked_intr = REG_RD(marb, regi_marb, r_masked_intr);
246 reg_marb_bp_r_brk_clients r_clients;
247 reg_marb_bp_r_brk_addr r_addr;
248 reg_marb_bp_r_brk_op r_op;
249 reg_marb_bp_r_brk_first_client r_first;
250 reg_marb_bp_r_brk_size r_size;
251 reg_marb_bp_rw_ack ack = {0};
252 reg_marb_rw_ack_intr ack_intr = {.bp0=1,.bp1=1,.bp2=1,.bp3=1};
253 struct crisv32_watch_entry* watch;
254
255 if (masked_intr.bp0) {
256 watch = &watches[0];
257 ack_intr.bp0 = regk_marb_yes;
258 } else if (masked_intr.bp1) {
259 watch = &watches[1];
260 ack_intr.bp1 = regk_marb_yes;
261 } else if (masked_intr.bp2) {
262 watch = &watches[2];
263 ack_intr.bp2 = regk_marb_yes;
264 } else if (masked_intr.bp3) {
265 watch = &watches[3];
266 ack_intr.bp3 = regk_marb_yes;
267 } else {
268 return IRQ_NONE;
269 }
270
271 /* Retrieve all useful information and print it. */
272 r_clients = REG_RD(marb_bp, watch->instance, r_brk_clients);
273 r_addr = REG_RD(marb_bp, watch->instance, r_brk_addr);
274 r_op = REG_RD(marb_bp, watch->instance, r_brk_op);
275 r_first = REG_RD(marb_bp, watch->instance, r_brk_first_client);
276 r_size = REG_RD(marb_bp, watch->instance, r_brk_size);
277
278 printk("Arbiter IRQ\n");
279 printk("Clients %X addr %X op %X first %X size %X\n",
280 REG_TYPE_CONV(int, reg_marb_bp_r_brk_clients, r_clients),
281 REG_TYPE_CONV(int, reg_marb_bp_r_brk_addr, r_addr),
282 REG_TYPE_CONV(int, reg_marb_bp_r_brk_op, r_op),
283 REG_TYPE_CONV(int, reg_marb_bp_r_brk_first_client, r_first),
284 REG_TYPE_CONV(int, reg_marb_bp_r_brk_size, r_size));
285
286 REG_WR(marb_bp, watch->instance, rw_ack, ack);
287 REG_WR(marb, regi_marb, rw_ack_intr, ack_intr);
288
289 printk("IRQ occured at %lX\n", regs->erp);
290
291 if (watch->cb)
292 watch->cb();
293
294
295 return IRQ_HANDLED;
296}
diff --git a/arch/cris/arch-v32/kernel/crisksyms.c b/arch/cris/arch-v32/kernel/crisksyms.c
index e513da711245..77d02c15a7fc 100644
--- a/arch/cris/arch-v32/kernel/crisksyms.c
+++ b/arch/cris/arch-v32/kernel/crisksyms.c
@@ -2,7 +2,8 @@
2#include <linux/irq.h> 2#include <linux/irq.h>
3#include <asm/arch/dma.h> 3#include <asm/arch/dma.h>
4#include <asm/arch/intmem.h> 4#include <asm/arch/intmem.h>
5#include <asm/arch/pinmux.h> 5#include <asm/arch/mach/pinmux.h>
6#include <asm/arch/io.h>
6 7
7/* Functions for allocating DMA channels */ 8/* Functions for allocating DMA channels */
8EXPORT_SYMBOL(crisv32_request_dma); 9EXPORT_SYMBOL(crisv32_request_dma);
@@ -16,7 +17,11 @@ EXPORT_SYMBOL(crisv32_intmem_virt_to_phys);
16 17
17/* Functions for handling pinmux */ 18/* Functions for handling pinmux */
18EXPORT_SYMBOL(crisv32_pinmux_alloc); 19EXPORT_SYMBOL(crisv32_pinmux_alloc);
20EXPORT_SYMBOL(crisv32_pinmux_alloc_fixed);
19EXPORT_SYMBOL(crisv32_pinmux_dealloc); 21EXPORT_SYMBOL(crisv32_pinmux_dealloc);
22EXPORT_SYMBOL(crisv32_pinmux_dealloc_fixed);
23EXPORT_SYMBOL(crisv32_io_get_name);
24EXPORT_SYMBOL(crisv32_io_get);
20 25
21/* Functions masking/unmasking interrupts */ 26/* Functions masking/unmasking interrupts */
22EXPORT_SYMBOL(mask_irq); 27EXPORT_SYMBOL(mask_irq);
diff --git a/arch/cris/arch-v32/kernel/debugport.c b/arch/cris/arch-v32/kernel/debugport.c
index d1272ad92153..15af4c293157 100644
--- a/arch/cris/arch-v32/kernel/debugport.c
+++ b/arch/cris/arch-v32/kernel/debugport.c
@@ -4,17 +4,12 @@
4 4
5#include <linux/console.h> 5#include <linux/console.h>
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/major.h>
8#include <linux/delay.h>
9#include <linux/tty.h>
10#include <asm/system.h> 7#include <asm/system.h>
11#include <asm/io.h> 8#include <hwregs/reg_rdwr.h>
12#include <asm/arch/hwregs/ser_defs.h> 9#include <hwregs/reg_map.h>
13#include <asm/arch/hwregs/dma_defs.h> 10#include <hwregs/ser_defs.h>
14#include <asm/arch/pinmux.h> 11#include <hwregs/dma_defs.h>
15 12#include <asm/arch/mach/pinmux.h>
16#include <asm/irq.h>
17#include <asm/arch/hwregs/intr_vect_defs.h>
18 13
19struct dbg_port 14struct dbg_port
20{ 15{
@@ -59,45 +54,50 @@ struct dbg_port ports[] =
59 115200, 54 115200,
60 'N', 55 'N',
61 8 56 8
62 } 57 },
58#if CONFIG_ETRAX_SERIAL_PORTS == 5
59 {
60 4,
61 regi_ser4,
62 0,
63 115200,
64 'N',
65 8
66 },
67#endif
63}; 68};
64static struct dbg_port *port = 69static struct dbg_port *port =
65#if defined(CONFIG_ETRAX_DEBUG_PORT0) 70#if defined(CONFIG_ETRAX_DEBUG_PORT0)
66&ports[0]; 71 &ports[0];
67#elif defined(CONFIG_ETRAX_DEBUG_PORT1) 72#elif defined(CONFIG_ETRAX_DEBUG_PORT1)
68&ports[1]; 73 &ports[1];
69#elif defined(CONFIG_ETRAX_DEBUG_PORT2) 74#elif defined(CONFIG_ETRAX_DEBUG_PORT2)
70&ports[2]; 75 &ports[2];
71#elif defined(CONFIG_ETRAX_DEBUG_PORT3) 76#elif defined(CONFIG_ETRAX_DEBUG_PORT3)
72&ports[3]; 77 &ports[3];
78#elif defined(CONFIG_ETRAX_DEBUG_PORT4)
79 &ports[4];
73#else 80#else
74NULL; 81 NULL;
75#endif 82#endif
76 83
77#ifdef CONFIG_ETRAX_KGDB 84#ifdef CONFIG_ETRAX_KGDB
78static struct dbg_port *kgdb_port = 85static struct dbg_port *kgdb_port =
79#if defined(CONFIG_ETRAX_KGDB_PORT0) 86#if defined(CONFIG_ETRAX_KGDB_PORT0)
80&ports[0]; 87 &ports[0];
81#elif defined(CONFIG_ETRAX_KGDB_PORT1) 88#elif defined(CONFIG_ETRAX_KGDB_PORT1)
82&ports[1]; 89 &ports[1];
83#elif defined(CONFIG_ETRAX_KGDB_PORT2) 90#elif defined(CONFIG_ETRAX_KGDB_PORT2)
84&ports[2]; 91 &ports[2];
85#elif defined(CONFIG_ETRAX_KGDB_PORT3) 92#elif defined(CONFIG_ETRAX_KGDB_PORT3)
86&ports[3]; 93 &ports[3];
94#elif defined(CONFIG_ETRAX_KGDB_PORT4)
95 &ports[4];
87#else 96#else
88NULL; 97 NULL;
89#endif 98#endif
90#endif 99#endif
91 100
92#ifdef CONFIG_ETRAXFS_SIM
93extern void print_str( const char *str );
94static char buffer[1024];
95static char msg[] = "Debug: ";
96static int buffer_pos = sizeof(msg) - 1;
97#endif
98
99extern struct tty_driver *serial_driver;
100
101static void 101static void
102start_port(struct dbg_port* p) 102start_port(struct dbg_port* p)
103{ 103{
@@ -114,6 +114,10 @@ start_port(struct dbg_port* p)
114 crisv32_pinmux_alloc_fixed(pinmux_ser2); 114 crisv32_pinmux_alloc_fixed(pinmux_ser2);
115 else if (p->nbr == 3) 115 else if (p->nbr == 3)
116 crisv32_pinmux_alloc_fixed(pinmux_ser3); 116 crisv32_pinmux_alloc_fixed(pinmux_ser3);
117#if CONFIG_ETRAX_SERIAL_PORTS == 5
118 else if (p->nbr == 4)
119 crisv32_pinmux_alloc_fixed(pinmux_ser4);
120#endif
117 121
118 /* Set up serial port registers */ 122 /* Set up serial port registers */
119 reg_ser_rw_tr_ctrl tr_ctrl = {0}; 123 reg_ser_rw_tr_ctrl tr_ctrl = {0};
@@ -156,124 +160,21 @@ start_port(struct dbg_port* p)
156 REG_WR (ser, p->instance, rw_rec_ctrl, rec_ctrl); 160 REG_WR (ser, p->instance, rw_rec_ctrl, rec_ctrl);
157} 161}
158 162
159/* No debug */
160#ifdef CONFIG_ETRAX_DEBUG_PORT_NULL
161
162static void
163console_write(struct console *co, const char *buf, unsigned int len)
164{
165 return;
166}
167
168/* Target debug */
169#elif !defined(CONFIG_ETRAXFS_SIM)
170
171static void
172console_write_direct(struct console *co, const char *buf, unsigned int len)
173{
174 int i;
175 reg_ser_r_stat_din stat;
176 reg_ser_rw_tr_dma_en tr_dma_en, old;
177
178 /* Switch to manual mode */
179 tr_dma_en = old = REG_RD (ser, port->instance, rw_tr_dma_en);
180 if (tr_dma_en.en == regk_ser_yes) {
181 tr_dma_en.en = regk_ser_no;
182 REG_WR(ser, port->instance, rw_tr_dma_en, tr_dma_en);
183 }
184
185 /* Send data */
186 for (i = 0; i < len; i++) {
187 /* LF -> CRLF */
188 if (buf[i] == '\n') {
189 do {
190 stat = REG_RD (ser, port->instance, r_stat_din);
191 } while (!stat.tr_rdy);
192 REG_WR_INT (ser, port->instance, rw_dout, '\r');
193 }
194 /* Wait until transmitter is ready and send.*/
195 do {
196 stat = REG_RD (ser, port->instance, r_stat_din);
197 } while (!stat.tr_rdy);
198 REG_WR_INT (ser, port->instance, rw_dout, buf[i]);
199 }
200
201 /* Restore mode */
202 if (tr_dma_en.en != old.en)
203 REG_WR(ser, port->instance, rw_tr_dma_en, old);
204}
205
206static void
207console_write(struct console *co, const char *buf, unsigned int len)
208{
209 if (!port)
210 return;
211 console_write_direct(co, buf, len);
212}
213
214
215
216#else
217
218/* VCS debug */
219
220static void
221console_write(struct console *co, const char *buf, unsigned int len)
222{
223 char* pos;
224 pos = memchr(buf, '\n', len);
225 if (pos) {
226 int l = ++pos - buf;
227 memcpy(buffer + buffer_pos, buf, l);
228 memcpy(buffer, msg, sizeof(msg) - 1);
229 buffer[buffer_pos + l] = '\0';
230 print_str(buffer);
231 buffer_pos = sizeof(msg) - 1;
232 if (pos - buf != len) {
233 memcpy(buffer + buffer_pos, pos, len - l);
234 buffer_pos += len - l;
235 }
236 } else {
237 memcpy(buffer + buffer_pos, buf, len);
238 buffer_pos += len;
239 }
240}
241
242#endif
243
244int raw_printk(const char *fmt, ...)
245{
246 static char buf[1024];
247 int printed_len;
248 va_list args;
249 va_start(args, fmt);
250 printed_len = vsnprintf(buf, sizeof(buf), fmt, args);
251 va_end(args);
252 console_write(NULL, buf, strlen(buf));
253 return printed_len;
254}
255
256void
257stupid_debug(char* buf)
258{
259 console_write(NULL, buf, strlen(buf));
260}
261
262#ifdef CONFIG_ETRAX_KGDB 163#ifdef CONFIG_ETRAX_KGDB
263/* Use polling to get a single character from the kernel debug port */ 164/* Use polling to get a single character from the kernel debug port */
264int 165int
265getDebugChar(void) 166getDebugChar(void)
266{ 167{
267 reg_ser_rs_status_data stat; 168 reg_ser_rs_stat_din stat;
268 reg_ser_rw_ack_intr ack_intr = { 0 }; 169 reg_ser_rw_ack_intr ack_intr = { 0 };
269 170
270 do { 171 do {
271 stat = REG_RD(ser, kgdb_instance, rs_status_data); 172 stat = REG_RD(ser, kgdb_port->instance, rs_stat_din);
272 } while (!stat.data_avail); 173 } while (!stat.dav);
273 174
274 /* Ack the data_avail interrupt. */ 175 /* Ack the data_avail interrupt. */
275 ack_intr.data_avail = 1; 176 ack_intr.dav = 1;
276 REG_WR(ser, kgdb_instance, rw_ack_intr, ack_intr); 177 REG_WR(ser, kgdb_port->instance, rw_ack_intr, ack_intr);
277 178
278 return stat.data; 179 return stat.data;
279} 180}
@@ -282,173 +183,18 @@ getDebugChar(void)
282void 183void
283putDebugChar(int val) 184putDebugChar(int val)
284{ 185{
285 reg_ser_r_status_data stat; 186 reg_ser_r_stat_din stat;
286 do { 187 do {
287 stat = REG_RD (ser, kgdb_instance, r_status_data); 188 stat = REG_RD(ser, kgdb_port->instance, r_stat_din);
288 } while (!stat.tr_ready); 189 } while (!stat.tr_rdy);
289 REG_WR (ser, kgdb_instance, rw_data_out, REG_TYPE_CONV(reg_ser_rw_data_out, int, val)); 190 REG_WR_INT(ser, kgdb_port->instance, rw_dout, val);
290} 191}
291#endif /* CONFIG_ETRAX_KGDB */ 192#endif /* CONFIG_ETRAX_KGDB */
292 193
293static int __init
294console_setup(struct console *co, char *options)
295{
296 char* s;
297
298 if (options) {
299 port = &ports[co->index];
300 port->baudrate = 115200;
301 port->parity = 'N';
302 port->bits = 8;
303 port->baudrate = simple_strtoul(options, NULL, 10);
304 s = options;
305 while(*s >= '0' && *s <= '9')
306 s++;
307 if (*s) port->parity = *s++;
308 if (*s) port->bits = *s++ - '0';
309 port->started = 0;
310 start_port(port);
311 }
312 return 0;
313}
314
315/* This is a dummy serial device that throws away anything written to it.
316 * This is used when no debug output is wanted.
317 */
318static struct tty_driver dummy_driver;
319
320static int dummy_open(struct tty_struct *tty, struct file * filp)
321{
322 return 0;
323}
324
325static void dummy_close(struct tty_struct *tty, struct file * filp)
326{
327}
328
329static int dummy_write(struct tty_struct * tty,
330 const unsigned char *buf, int count)
331{
332 return count;
333}
334
335static int
336dummy_write_room(struct tty_struct *tty)
337{
338 return 8192;
339}
340
341void __init
342init_dummy_console(void)
343{
344 memset(&dummy_driver, 0, sizeof(struct tty_driver));
345 dummy_driver.driver_name = "serial";
346 dummy_driver.name = "ttyS";
347 dummy_driver.major = TTY_MAJOR;
348 dummy_driver.minor_start = 68;
349 dummy_driver.num = 1; /* etrax100 has 4 serial ports */
350 dummy_driver.type = TTY_DRIVER_TYPE_SERIAL;
351 dummy_driver.subtype = SERIAL_TYPE_NORMAL;
352 dummy_driver.init_termios = tty_std_termios;
353 dummy_driver.init_termios.c_cflag =
354 B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */
355 dummy_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
356
357 dummy_driver.open = dummy_open;
358 dummy_driver.close = dummy_close;
359 dummy_driver.write = dummy_write;
360 dummy_driver.write_room = dummy_write_room;
361 if (tty_register_driver(&dummy_driver))
362 panic("Couldn't register dummy serial driver\n");
363}
364
365static struct tty_driver*
366crisv32_console_device(struct console* co, int *index)
367{
368 if (port)
369 *index = port->nbr;
370 return port ? serial_driver : &dummy_driver;
371}
372
373static struct console sercons = {
374 name : "ttyS",
375 write: console_write,
376 read : NULL,
377 device : crisv32_console_device,
378 unblank : NULL,
379 setup : console_setup,
380 flags : CON_PRINTBUFFER,
381 index : -1,
382 cflag : 0,
383 next : NULL
384};
385static struct console sercons0 = {
386 name : "ttyS",
387 write: console_write,
388 read : NULL,
389 device : crisv32_console_device,
390 unblank : NULL,
391 setup : console_setup,
392 flags : CON_PRINTBUFFER,
393 index : 0,
394 cflag : 0,
395 next : NULL
396};
397
398static struct console sercons1 = {
399 name : "ttyS",
400 write: console_write,
401 read : NULL,
402 device : crisv32_console_device,
403 unblank : NULL,
404 setup : console_setup,
405 flags : CON_PRINTBUFFER,
406 index : 1,
407 cflag : 0,
408 next : NULL
409};
410static struct console sercons2 = {
411 name : "ttyS",
412 write: console_write,
413 read : NULL,
414 device : crisv32_console_device,
415 unblank : NULL,
416 setup : console_setup,
417 flags : CON_PRINTBUFFER,
418 index : 2,
419 cflag : 0,
420 next : NULL
421};
422static struct console sercons3 = {
423 name : "ttyS",
424 write: console_write,
425 read : NULL,
426 device : crisv32_console_device,
427 unblank : NULL,
428 setup : console_setup,
429 flags : CON_PRINTBUFFER,
430 index : 3,
431 cflag : 0,
432 next : NULL
433};
434
435/* Register console for printk's, etc. */ 194/* Register console for printk's, etc. */
436int __init 195int __init
437init_etrax_debug(void) 196init_etrax_debug(void)
438{ 197{
439 static int first = 1;
440
441 if (!first) {
442 unregister_console(&sercons);
443 register_console(&sercons0);
444 register_console(&sercons1);
445 register_console(&sercons2);
446 register_console(&sercons3);
447 init_dummy_console();
448 return 0;
449 }
450 first = 0;
451 register_console(&sercons);
452 start_port(port); 198 start_port(port);
453 199
454#ifdef CONFIG_ETRAX_KGDB 200#ifdef CONFIG_ETRAX_KGDB
@@ -456,5 +202,3 @@ init_etrax_debug(void)
456#endif /* CONFIG_ETRAX_KGDB */ 202#endif /* CONFIG_ETRAX_KGDB */
457 return 0; 203 return 0;
458} 204}
459
460__initcall(init_etrax_debug);
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S
index f9d27807b914..eebbaba45430 100644
--- a/arch/cris/arch-v32/kernel/entry.S
+++ b/arch/cris/arch-v32/kernel/entry.S
@@ -10,7 +10,7 @@
10 * after a timer-interrupt and after each system call. 10 * after a timer-interrupt and after each system call.
11 * 11 *
12 * Stack layout in 'ret_from_system_call': 12 * Stack layout in 'ret_from_system_call':
13 * ptrace needs to have all regs on the stack. 13 * ptrace needs to have all regs on the stack.
14 * if the order here is changed, it needs to be 14 * if the order here is changed, it needs to be
15 * updated in fork.c:copy_process, signal.c:do_signal, 15 * updated in fork.c:copy_process, signal.c:do_signal,
16 * ptrace.c and ptrace.h 16 * ptrace.c and ptrace.h
@@ -281,12 +281,10 @@ _work_notifysig:
281 ;; Deal with pending signals and notify-resume requests. 281 ;; Deal with pending signals and notify-resume requests.
282 282
283 addoq +TI_flags, $r0, $acr 283 addoq +TI_flags, $r0, $acr
284 move.d [$acr], $r13 ; The thread_info_flags parameter. 284 move.d [$acr], $r12 ; The thread_info_flags parameter.
285 move.d $r9, $r10 ; do_notify_resume syscall/irq param. 285 move.d $sp, $r11 ; The regs param.
286 moveq 0, $r11 ; oldset param - 0 in this case.
287 move.d $sp, $r12 ; The regs param.
288 jsr do_notify_resume 286 jsr do_notify_resume
289 nop 287 move.d $r9, $r10 ; do_notify_resume syscall/irq param.
290 288
291 ba _Rexit 289 ba _Rexit
292 nop 290 nop
@@ -396,7 +394,7 @@ nmi_interrupt:
396 btstq REG_BIT(intr_vect, r_nmi, watchdog), $r0 394 btstq REG_BIT(intr_vect, r_nmi, watchdog), $r0
397 bpl 1f 395 bpl 1f
398 nop 396 nop
399 jsr handle_watchdog_bite ; In time.c. 397 jsr handle_watchdog_bite ; In time.c.
400 move.d $sp, $r10 ; Pointer to registers 398 move.d $sp, $r10 ; Pointer to registers
4011: btstq REG_BIT(intr_vect, r_nmi, ext), $r0 3991: btstq REG_BIT(intr_vect, r_nmi, ext), $r0
402 bpl 1f 400 bpl 1f
@@ -515,6 +513,13 @@ _ugdb_handle_exception:
515 ba do_sigtrap ; SIGTRAP the offending process. 513 ba do_sigtrap ; SIGTRAP the offending process.
516 move.d [$sp+], $r0 ; Restore R0 in delay slot. 514 move.d [$sp+], $r0 ; Restore R0 in delay slot.
517 515
516 .global kernel_execve
517kernel_execve:
518 move.d __NR_execve, $r9
519 break 13
520 ret
521 nop
522
518 .data 523 .data
519 524
520 .section .rodata,"a" 525 .section .rodata,"a"
@@ -778,21 +783,21 @@ sys_call_table:
778 .long sys_epoll_ctl /* 255 */ 783 .long sys_epoll_ctl /* 255 */
779 .long sys_epoll_wait 784 .long sys_epoll_wait
780 .long sys_remap_file_pages 785 .long sys_remap_file_pages
781 .long sys_set_tid_address 786 .long sys_set_tid_address
782 .long sys_timer_create 787 .long sys_timer_create
783 .long sys_timer_settime /* 260 */ 788 .long sys_timer_settime /* 260 */
784 .long sys_timer_gettime 789 .long sys_timer_gettime
785 .long sys_timer_getoverrun 790 .long sys_timer_getoverrun
786 .long sys_timer_delete 791 .long sys_timer_delete
787 .long sys_clock_settime 792 .long sys_clock_settime
788 .long sys_clock_gettime /* 265 */ 793 .long sys_clock_gettime /* 265 */
789 .long sys_clock_getres 794 .long sys_clock_getres
790 .long sys_clock_nanosleep 795 .long sys_clock_nanosleep
791 .long sys_statfs64 796 .long sys_statfs64
792 .long sys_fstatfs64 797 .long sys_fstatfs64
793 .long sys_tgkill /* 270 */ 798 .long sys_tgkill /* 270 */
794 .long sys_utimes 799 .long sys_utimes
795 .long sys_fadvise64_64 800 .long sys_fadvise64_64
796 .long sys_ni_syscall /* sys_vserver */ 801 .long sys_ni_syscall /* sys_vserver */
797 .long sys_ni_syscall /* sys_mbind */ 802 .long sys_ni_syscall /* sys_mbind */
798 .long sys_ni_syscall /* 275 sys_get_mempolicy */ 803 .long sys_ni_syscall /* 275 sys_get_mempolicy */
@@ -805,6 +810,48 @@ sys_call_table:
805 .long sys_mq_getsetattr 810 .long sys_mq_getsetattr
806 .long sys_ni_syscall /* reserved for kexec */ 811 .long sys_ni_syscall /* reserved for kexec */
807 .long sys_waitid 812 .long sys_waitid
813 .long sys_ni_syscall /* 285 */ /* available */
814 .long sys_add_key
815 .long sys_request_key
816 .long sys_keyctl
817 .long sys_ioprio_set
818 .long sys_ioprio_get /* 290 */
819 .long sys_inotify_init
820 .long sys_inotify_add_watch
821 .long sys_inotify_rm_watch
822 .long sys_migrate_pages
823 .long sys_openat /* 295 */
824 .long sys_mkdirat
825 .long sys_mknodat
826 .long sys_fchownat
827 .long sys_futimesat
828 .long sys_fstatat64 /* 300 */
829 .long sys_unlinkat
830 .long sys_renameat
831 .long sys_linkat
832 .long sys_symlinkat
833 .long sys_readlinkat /* 305 */
834 .long sys_fchmodat
835 .long sys_faccessat
836 .long sys_pselect6
837 .long sys_ppoll
838 .long sys_unshare /* 310 */
839 .long sys_set_robust_list
840 .long sys_get_robust_list
841 .long sys_splice
842 .long sys_sync_file_range
843 .long sys_tee /* 315 */
844 .long sys_vmsplice
845 .long sys_move_pages
846 .long sys_getcpu
847 .long sys_epoll_pwait
848 .long sys_utimensat /* 320 */
849 .long sys_signalfd
850 .long sys_timerfd_create
851 .long sys_eventfd
852 .long sys_fallocate
853 .long sys_timerfd_settime /* 325 */
854 .long sys_timerfd_gettime
808 855
809 /* 856 /*
810 * NOTE!! This doesn't have to be exact - we just have 857 * NOTE!! This doesn't have to be exact - we just have
diff --git a/arch/cris/arch-v32/kernel/fasttimer.c b/arch/cris/arch-v32/kernel/fasttimer.c
index b40551f9f40d..2de9d5849ef0 100644
--- a/arch/cris/arch-v32/kernel/fasttimer.c
+++ b/arch/cris/arch-v32/kernel/fasttimer.c
@@ -1,110 +1,9 @@
1/* $Id: fasttimer.c,v 1.11 2005/01/04 11:15:46 starvik Exp $ 1/*
2 * linux/arch/cris/kernel/fasttimer.c 2 * linux/arch/cris/kernel/fasttimer.c
3 * 3 *
4 * Fast timers for ETRAX FS 4 * Fast timers for ETRAX FS
5 * This may be useful in other OS than Linux so use 2 space indentation...
6 *
7 * $Log: fasttimer.c,v $
8 * Revision 1.11 2005/01/04 11:15:46 starvik
9 * Don't share timer IRQ.
10 *
11 * Revision 1.10 2004/12/07 09:19:38 starvik
12 * Corrected includes.
13 * Use correct interrupt macros.
14 *
15 * Revision 1.9 2004/05/14 10:18:58 starvik
16 * Export fast_timer_list
17 *
18 * Revision 1.8 2004/05/14 07:58:03 starvik
19 * Merge of changes from 2.4
20 *
21 * Revision 1.7 2003/07/10 12:06:14 starvik
22 * Return IRQ_NONE if irq wasn't handled
23 *
24 * Revision 1.6 2003/07/04 08:27:49 starvik
25 * Merge of Linux 2.5.74
26 *
27 * Revision 1.5 2003/06/05 10:16:22 johana
28 * New INTR_VECT macros.
29 *
30 * Revision 1.4 2003/06/03 08:49:45 johana
31 * Fixed typo.
32 *
33 * Revision 1.3 2003/06/02 12:51:27 johana
34 * Now compiles.
35 * Commented some include files that probably can be removed.
36 *
37 * Revision 1.2 2003/06/02 12:09:41 johana
38 * Ported to ETRAX FS using the trig interrupt instead of timer1.
39 *
40 * Revision 1.3 2002/12/12 08:26:32 starvik
41 * Don't use C-comments inside CVS comments
42 *
43 * Revision 1.2 2002/12/11 15:42:02 starvik
44 * Extracted v10 (ETRAX 100LX) specific stuff from arch/cris/kernel/
45 *
46 * Revision 1.1 2002/11/18 07:58:06 starvik
47 * Fast timers (from Linux 2.4)
48 *
49 * Revision 1.5 2002/10/15 06:21:39 starvik
50 * Added call to init_waitqueue_head
51 * 5 *
52 * Revision 1.4 2002/05/28 17:47:59 johana 6 * Copyright (C) 2000-2006 Axis Communications AB, Lund, Sweden
53 * Added del_fast_timer()
54 *
55 * Revision 1.3 2002/05/28 16:16:07 johana
56 * Handle empty fast_timer_list
57 *
58 * Revision 1.2 2002/05/27 15:38:42 johana
59 * Made it compile without warnings on Linux 2.4.
60 * (includes, wait_queue, PROC_FS and snprintf)
61 *
62 * Revision 1.1 2002/05/27 15:32:25 johana
63 * arch/etrax100/kernel/fasttimer.c v1.8 from the elinux tree.
64 *
65 * Revision 1.8 2001/11/27 13:50:40 pkj
66 * Disable interrupts while stopping the timer and while modifying the
67 * list of active timers in timer1_handler() as it may be interrupted
68 * by other interrupts (e.g., the serial interrupt) which may add fast
69 * timers.
70 *
71 * Revision 1.7 2001/11/22 11:50:32 pkj
72 * * Only store information about the last 16 timers.
73 * * proc_fasttimer_read() now uses an allocated buffer, since it
74 * requires more space than just a page even for only writing the
75 * last 16 timers. The buffer is only allocated on request, so
76 * unless /proc/fasttimer is read, it is never allocated.
77 * * Renamed fast_timer_started to fast_timers_started to match
78 * fast_timers_added and fast_timers_expired.
79 * * Some clean-up.
80 *
81 * Revision 1.6 2000/12/13 14:02:08 johana
82 * Removed volatile for fast_timer_list
83 *
84 * Revision 1.5 2000/12/13 13:55:35 johana
85 * Added DEBUG_LOG, added som cli() and cleanup
86 *
87 * Revision 1.4 2000/12/05 13:48:50 johana
88 * Added range check when writing proc file, modified timer int handling
89 *
90 * Revision 1.3 2000/11/23 10:10:20 johana
91 * More debug/logging possibilities.
92 * Moved GET_JIFFIES_USEC() to timex.h and time.c
93 *
94 * Revision 1.2 2000/11/01 13:41:04 johana
95 * Clean up and bugfixes.
96 * Created new do_gettimeofday_fast() that gets a timeval struct
97 * with time based on jiffies and *R_TIMER0_DATA, uses a table
98 * for fast conversion of timer value to microseconds.
99 * (Much faster the standard do_gettimeofday() and we don't really
100 * want to use the true time - we want the "uptime" so timers don't screw up
101 * when we change the time.
102 * TODO: Add efficient support for continuous timers as well.
103 *
104 * Revision 1.1 2000/10/26 15:49:16 johana
105 * Added fasttimer, highresolution timers.
106 *
107 * Copyright (C) 2000,2001 2002, 2003 Axis Communications AB, Lund, Sweden
108 */ 7 */
109 8
110#include <linux/errno.h> 9#include <linux/errno.h>
@@ -122,9 +21,9 @@
122 21
123#include <linux/version.h> 22#include <linux/version.h>
124 23
125#include <asm/arch/hwregs/reg_map.h> 24#include <hwregs/reg_map.h>
126#include <asm/arch/hwregs/reg_rdwr.h> 25#include <hwregs/reg_rdwr.h>
127#include <asm/arch/hwregs/timer_defs.h> 26#include <hwregs/timer_defs.h>
128#include <asm/fasttimer.h> 27#include <asm/fasttimer.h>
129#include <linux/proc_fs.h> 28#include <linux/proc_fs.h>
130 29
@@ -140,30 +39,25 @@
140 39
141#define DEBUG_LOG_INCLUDED 40#define DEBUG_LOG_INCLUDED
142#define FAST_TIMER_LOG 41#define FAST_TIMER_LOG
143//#define FAST_TIMER_TEST 42/* #define FAST_TIMER_TEST */
144 43
145#define FAST_TIMER_SANITY_CHECKS 44#define FAST_TIMER_SANITY_CHECKS
146 45
147#ifdef FAST_TIMER_SANITY_CHECKS 46#ifdef FAST_TIMER_SANITY_CHECKS
148#define SANITYCHECK(x) x 47static int sanity_failed;
149static int sanity_failed = 0;
150#else
151#define SANITYCHECK(x)
152#endif 48#endif
153 49
154#define D1(x) 50#define D1(x)
155#define D2(x) 51#define D2(x)
156#define DP(x) 52#define DP(x)
157 53
158#define __INLINE__ inline 54static unsigned int fast_timer_running;
159 55static unsigned int fast_timers_added;
160static int fast_timer_running = 0; 56static unsigned int fast_timers_started;
161static int fast_timers_added = 0; 57static unsigned int fast_timers_expired;
162static int fast_timers_started = 0; 58static unsigned int fast_timers_deleted;
163static int fast_timers_expired = 0; 59static unsigned int fast_timer_is_init;
164static int fast_timers_deleted = 0; 60static unsigned int fast_timer_ints;
165static int fast_timer_is_init = 0;
166static int fast_timer_ints = 0;
167 61
168struct fast_timer *fast_timer_list = NULL; 62struct fast_timer *fast_timer_list = NULL;
169 63
@@ -171,8 +65,8 @@ struct fast_timer *fast_timer_list = NULL;
171#define DEBUG_LOG_MAX 128 65#define DEBUG_LOG_MAX 128
172static const char * debug_log_string[DEBUG_LOG_MAX]; 66static const char * debug_log_string[DEBUG_LOG_MAX];
173static unsigned long debug_log_value[DEBUG_LOG_MAX]; 67static unsigned long debug_log_value[DEBUG_LOG_MAX];
174static int debug_log_cnt = 0; 68static unsigned int debug_log_cnt;
175static int debug_log_cnt_wrapped = 0; 69static unsigned int debug_log_cnt_wrapped;
176 70
177#define DEBUG_LOG(string, value) \ 71#define DEBUG_LOG(string, value) \
178{ \ 72{ \
@@ -202,103 +96,92 @@ struct fast_timer timer_expired_log[NUM_TIMER_STATS];
202int timer_div_settings[NUM_TIMER_STATS]; 96int timer_div_settings[NUM_TIMER_STATS];
203int timer_delay_settings[NUM_TIMER_STATS]; 97int timer_delay_settings[NUM_TIMER_STATS];
204 98
99struct work_struct fast_work;
205 100
206static void 101static void
207timer_trig_handler(void); 102timer_trig_handler(struct work_struct *work);
208 103
209 104
210 105
211/* Not true gettimeofday, only checks the jiffies (uptime) + useconds */ 106/* Not true gettimeofday, only checks the jiffies (uptime) + useconds */
212void __INLINE__ do_gettimeofday_fast(struct timeval *tv) 107inline void do_gettimeofday_fast(struct fasttime_t *tv)
213{ 108{
214 unsigned long sec = jiffies; 109 tv->tv_jiff = jiffies;
215 unsigned long usec = GET_JIFFIES_USEC(); 110 tv->tv_usec = GET_JIFFIES_USEC();
216
217 usec += (sec % HZ) * (1000000 / HZ);
218 sec = sec / HZ;
219
220 if (usec > 1000000)
221 {
222 usec -= 1000000;
223 sec++;
224 }
225 tv->tv_sec = sec;
226 tv->tv_usec = usec;
227} 111}
228 112
229int __INLINE__ timeval_cmp(struct timeval *t0, struct timeval *t1) 113inline int fasttime_cmp(struct fasttime_t *t0, struct fasttime_t *t1)
230{ 114{
231 if (t0->tv_sec < t1->tv_sec) 115 /* Compare jiffies. Takes care of wrapping */
232 { 116 if (time_before(t0->tv_jiff, t1->tv_jiff))
233 return -1; 117 return -1;
234 } 118 else if (time_after(t0->tv_jiff, t1->tv_jiff))
235 else if (t0->tv_sec > t1->tv_sec) 119 return 1;
236 { 120
237 return 1; 121 /* Compare us */
238 } 122 if (t0->tv_usec < t1->tv_usec)
239 if (t0->tv_usec < t1->tv_usec) 123 return -1;
240 { 124 else if (t0->tv_usec > t1->tv_usec)
241 return -1; 125 return 1;
242 } 126 return 0;
243 else if (t0->tv_usec > t1->tv_usec)
244 {
245 return 1;
246 }
247 return 0;
248} 127}
249 128
250/* Called with ints off */ 129/* Called with ints off */
251void __INLINE__ start_timer_trig(unsigned long delay_us) 130inline void start_timer_trig(unsigned long delay_us)
252{ 131{
253 reg_timer_rw_ack_intr ack_intr = { 0 }; 132 reg_timer_rw_ack_intr ack_intr = { 0 };
254 reg_timer_rw_intr_mask intr_mask; 133 reg_timer_rw_intr_mask intr_mask;
255 reg_timer_rw_trig trig; 134 reg_timer_rw_trig trig;
256 reg_timer_rw_trig_cfg trig_cfg = { 0 }; 135 reg_timer_rw_trig_cfg trig_cfg = { 0 };
257 reg_timer_r_time r_time; 136 reg_timer_r_time r_time0;
137 reg_timer_r_time r_time1;
138 unsigned char trig_wrap;
139 unsigned char time_wrap;
258 140
259 r_time = REG_RD(timer, regi_timer, r_time); 141 r_time0 = REG_RD(timer, regi_timer0, r_time);
260 142
261 D1(printk("start_timer_trig : %d us freq: %i div: %i\n", 143 D1(printk("start_timer_trig : %d us freq: %i div: %i\n",
262 delay_us, freq_index, div)); 144 delay_us, freq_index, div));
263 /* Clear trig irq */ 145 /* Clear trig irq */
264 intr_mask = REG_RD(timer, regi_timer, rw_intr_mask); 146 intr_mask = REG_RD(timer, regi_timer0, rw_intr_mask);
265 intr_mask.trig = 0; 147 intr_mask.trig = 0;
266 REG_WR(timer, regi_timer, rw_intr_mask, intr_mask); 148 REG_WR(timer, regi_timer0, rw_intr_mask, intr_mask);
267 149
268 /* Set timer values */ 150 /* Set timer values and check if trigger wraps. */
269 /* r_time is 100MHz (10 ns resolution) */ 151 /* r_time is 100MHz (10 ns resolution) */
270 trig = r_time + delay_us*(1000/10); 152 trig_wrap = (trig = r_time0 + delay_us*(1000/10)) < r_time0;
271 153
272 timer_div_settings[fast_timers_started % NUM_TIMER_STATS] = trig; 154 timer_div_settings[fast_timers_started % NUM_TIMER_STATS] = trig;
273 timer_delay_settings[fast_timers_started % NUM_TIMER_STATS] = delay_us; 155 timer_delay_settings[fast_timers_started % NUM_TIMER_STATS] = delay_us;
274 156
275 /* Ack interrupt */ 157 /* Ack interrupt */
276 ack_intr.trig = 1; 158 ack_intr.trig = 1;
277 REG_WR(timer, regi_timer, rw_ack_intr, ack_intr); 159 REG_WR(timer, regi_timer0, rw_ack_intr, ack_intr);
278 160
279 /* Start timer */ 161 /* Start timer */
280 REG_WR(timer, regi_timer, rw_trig, trig); 162 REG_WR(timer, regi_timer0, rw_trig, trig);
281 trig_cfg.tmr = regk_timer_time; 163 trig_cfg.tmr = regk_timer_time;
282 REG_WR(timer, regi_timer, rw_trig_cfg, trig_cfg); 164 REG_WR(timer, regi_timer0, rw_trig_cfg, trig_cfg);
283 165
284 /* Check if we have already passed the trig time */ 166 /* Check if we have already passed the trig time */
285 r_time = REG_RD(timer, regi_timer, r_time); 167 r_time1 = REG_RD(timer, regi_timer0, r_time);
286 if (r_time < trig) { 168 time_wrap = r_time1 < r_time0;
169
170 if ((trig_wrap && !time_wrap) || (r_time1 < trig)) {
287 /* No, Enable trig irq */ 171 /* No, Enable trig irq */
288 intr_mask = REG_RD(timer, regi_timer, rw_intr_mask); 172 intr_mask = REG_RD(timer, regi_timer0, rw_intr_mask);
289 intr_mask.trig = 1; 173 intr_mask.trig = 1;
290 REG_WR(timer, regi_timer, rw_intr_mask, intr_mask); 174 REG_WR(timer, regi_timer0, rw_intr_mask, intr_mask);
291 fast_timers_started++; 175 fast_timers_started++;
292 fast_timer_running = 1; 176 fast_timer_running = 1;
293 } 177 } else {
294 else
295 {
296 /* We have passed the time, disable trig point, ack intr */ 178 /* We have passed the time, disable trig point, ack intr */
297 trig_cfg.tmr = regk_timer_off; 179 trig_cfg.tmr = regk_timer_off;
298 REG_WR(timer, regi_timer, rw_trig_cfg, trig_cfg); 180 REG_WR(timer, regi_timer0, rw_trig_cfg, trig_cfg);
299 REG_WR(timer, regi_timer, rw_ack_intr, ack_intr); 181 REG_WR(timer, regi_timer0, rw_ack_intr, ack_intr);
300 /* call the int routine directly */ 182 /* call the int routine */
301 timer_trig_handler(); 183 INIT_WORK(&fast_work, timer_trig_handler);
184 schedule_work(&fast_work);
302 } 185 }
303 186
304} 187}
@@ -320,22 +203,20 @@ void start_one_shot_timer(struct fast_timer *t,
320 do_gettimeofday_fast(&t->tv_set); 203 do_gettimeofday_fast(&t->tv_set);
321 tmp = fast_timer_list; 204 tmp = fast_timer_list;
322 205
323 SANITYCHECK({ /* Check so this is not in the list already... */ 206#ifdef FAST_TIMER_SANITY_CHECKS
324 while (tmp != NULL) 207 /* Check so this is not in the list already... */
325 { 208 while (tmp != NULL) {
326 if (tmp == t) 209 if (tmp == t) {
327 { 210 printk(KERN_DEBUG
328 printk("timer name: %s data: 0x%08lX already in list!\n", name, data); 211 "timer name: %s data: 0x%08lX already "
329 sanity_failed++; 212 "in list!\n", name, data);
330 return; 213 sanity_failed++;
331 } 214 goto done;
332 else 215 } else
333 { 216 tmp = tmp->next;
334 tmp = tmp->next; 217 }
335 } 218 tmp = fast_timer_list;
336 } 219#endif
337 tmp = fast_timer_list;
338 });
339 220
340 t->delay_us = delay_us; 221 t->delay_us = delay_us;
341 t->function = function; 222 t->function = function;
@@ -343,11 +224,10 @@ void start_one_shot_timer(struct fast_timer *t,
343 t->name = name; 224 t->name = name;
344 225
345 t->tv_expires.tv_usec = t->tv_set.tv_usec + delay_us % 1000000; 226 t->tv_expires.tv_usec = t->tv_set.tv_usec + delay_us % 1000000;
346 t->tv_expires.tv_sec = t->tv_set.tv_sec + delay_us / 1000000; 227 t->tv_expires.tv_jiff = t->tv_set.tv_jiff + delay_us / 1000000 / HZ;
347 if (t->tv_expires.tv_usec > 1000000) 228 if (t->tv_expires.tv_usec > 1000000) {
348 {
349 t->tv_expires.tv_usec -= 1000000; 229 t->tv_expires.tv_usec -= 1000000;
350 t->tv_expires.tv_sec++; 230 t->tv_expires.tv_jiff += HZ;
351 } 231 }
352#ifdef FAST_TIMER_LOG 232#ifdef FAST_TIMER_LOG
353 timer_added_log[fast_timers_added % NUM_TIMER_STATS] = *t; 233 timer_added_log[fast_timers_added % NUM_TIMER_STATS] = *t;
@@ -355,15 +235,12 @@ void start_one_shot_timer(struct fast_timer *t,
355 fast_timers_added++; 235 fast_timers_added++;
356 236
357 /* Check if this should timeout before anything else */ 237 /* Check if this should timeout before anything else */
358 if (tmp == NULL || timeval_cmp(&t->tv_expires, &tmp->tv_expires) < 0) 238 if (tmp == NULL || fasttime_cmp(&t->tv_expires, &tmp->tv_expires) < 0) {
359 {
360 /* Put first in list and modify the timer value */ 239 /* Put first in list and modify the timer value */
361 t->prev = NULL; 240 t->prev = NULL;
362 t->next = fast_timer_list; 241 t->next = fast_timer_list;
363 if (fast_timer_list) 242 if (fast_timer_list)
364 {
365 fast_timer_list->prev = t; 243 fast_timer_list->prev = t;
366 }
367 fast_timer_list = t; 244 fast_timer_list = t;
368#ifdef FAST_TIMER_LOG 245#ifdef FAST_TIMER_LOG
369 timer_started_log[fast_timers_started % NUM_TIMER_STATS] = *t; 246 timer_started_log[fast_timers_started % NUM_TIMER_STATS] = *t;
@@ -372,10 +249,8 @@ void start_one_shot_timer(struct fast_timer *t,
372 } else { 249 } else {
373 /* Put in correct place in list */ 250 /* Put in correct place in list */
374 while (tmp->next && 251 while (tmp->next &&
375 timeval_cmp(&t->tv_expires, &tmp->next->tv_expires) > 0) 252 fasttime_cmp(&t->tv_expires, &tmp->next->tv_expires) > 0)
376 {
377 tmp = tmp->next; 253 tmp = tmp->next;
378 }
379 /* Insert t after tmp */ 254 /* Insert t after tmp */
380 t->prev = tmp; 255 t->prev = tmp;
381 t->next = tmp->next; 256 t->next = tmp->next;
@@ -388,6 +263,7 @@ void start_one_shot_timer(struct fast_timer *t,
388 263
389 D2(printk("start_one_shot_timer: %d us done\n", delay_us)); 264 D2(printk("start_one_shot_timer: %d us done\n", delay_us));
390 265
266done:
391 local_irq_restore(flags); 267 local_irq_restore(flags);
392} /* start_one_shot_timer */ 268} /* start_one_shot_timer */
393 269
@@ -431,19 +307,18 @@ int del_fast_timer(struct fast_timer * t)
431/* Timer interrupt handler for trig interrupts */ 307/* Timer interrupt handler for trig interrupts */
432 308
433static irqreturn_t 309static irqreturn_t
434timer_trig_interrupt(int irq, void *dev_id, struct pt_regs *regs) 310timer_trig_interrupt(int irq, void *dev_id)
435{ 311{
436 reg_timer_r_masked_intr masked_intr; 312 reg_timer_r_masked_intr masked_intr;
437
438 /* Check if the timer interrupt is for us (a trig int) */ 313 /* Check if the timer interrupt is for us (a trig int) */
439 masked_intr = REG_RD(timer, regi_timer, r_masked_intr); 314 masked_intr = REG_RD(timer, regi_timer0, r_masked_intr);
440 if (!masked_intr.trig) 315 if (!masked_intr.trig)
441 return IRQ_NONE; 316 return IRQ_NONE;
442 timer_trig_handler(); 317 timer_trig_handler(NULL);
443 return IRQ_HANDLED; 318 return IRQ_HANDLED;
444} 319}
445 320
446static void timer_trig_handler(void) 321static void timer_trig_handler(struct work_struct *work)
447{ 322{
448 reg_timer_rw_ack_intr ack_intr = { 0 }; 323 reg_timer_rw_ack_intr ack_intr = { 0 };
449 reg_timer_rw_intr_mask intr_mask; 324 reg_timer_rw_intr_mask intr_mask;
@@ -451,38 +326,45 @@ static void timer_trig_handler(void)
451 struct fast_timer *t; 326 struct fast_timer *t;
452 unsigned long flags; 327 unsigned long flags;
453 328
329 /* We keep interrupts disabled not only when we modify the
330 * fast timer list, but any time we hold a reference to a
331 * timer in the list, since del_fast_timer may be called
332 * from (another) interrupt context. Thus, the only time
333 * when interrupts are enabled is when calling the timer
334 * callback function.
335 */
454 local_irq_save(flags); 336 local_irq_save(flags);
455 337
456 /* Clear timer trig interrupt */ 338 /* Clear timer trig interrupt */
457 intr_mask = REG_RD(timer, regi_timer, rw_intr_mask); 339 intr_mask = REG_RD(timer, regi_timer0, rw_intr_mask);
458 intr_mask.trig = 0; 340 intr_mask.trig = 0;
459 REG_WR(timer, regi_timer, rw_intr_mask, intr_mask); 341 REG_WR(timer, regi_timer0, rw_intr_mask, intr_mask);
460 342
461 /* First stop timer, then ack interrupt */ 343 /* First stop timer, then ack interrupt */
462 /* Stop timer */ 344 /* Stop timer */
463 trig_cfg.tmr = regk_timer_off; 345 trig_cfg.tmr = regk_timer_off;
464 REG_WR(timer, regi_timer, rw_trig_cfg, trig_cfg); 346 REG_WR(timer, regi_timer0, rw_trig_cfg, trig_cfg);
465 347
466 /* Ack interrupt */ 348 /* Ack interrupt */
467 ack_intr.trig = 1; 349 ack_intr.trig = 1;
468 REG_WR(timer, regi_timer, rw_ack_intr, ack_intr); 350 REG_WR(timer, regi_timer0, rw_ack_intr, ack_intr);
469 351
470 fast_timer_running = 0; 352 fast_timer_running = 0;
471 fast_timer_ints++; 353 fast_timer_ints++;
472 354
473 local_irq_restore(flags); 355 fast_timer_function_type *f;
356 unsigned long d;
474 357
475 t = fast_timer_list; 358 t = fast_timer_list;
476 while (t) 359 while (t) {
477 { 360 struct fasttime_t tv;
478 struct timeval tv;
479 361
480 /* Has it really expired? */ 362 /* Has it really expired? */
481 do_gettimeofday_fast(&tv); 363 do_gettimeofday_fast(&tv);
482 D1(printk("t: %is %06ius\n", tv.tv_sec, tv.tv_usec)); 364 D1(printk(KERN_DEBUG
365 "t: %is %06ius\n", tv.tv_jiff, tv.tv_usec));
483 366
484 if (timeval_cmp(&t->tv_expires, &tv) <= 0) 367 if (fasttime_cmp(&t->tv_expires, &tv) <= 0) {
485 {
486 /* Yes it has expired */ 368 /* Yes it has expired */
487#ifdef FAST_TIMER_LOG 369#ifdef FAST_TIMER_LOG
488 timer_expired_log[fast_timers_expired % NUM_TIMER_STATS] = *t; 370 timer_expired_log[fast_timers_expired % NUM_TIMER_STATS] = *t;
@@ -490,84 +372,77 @@ static void timer_trig_handler(void)
490 fast_timers_expired++; 372 fast_timers_expired++;
491 373
492 /* Remove this timer before call, since it may reuse the timer */ 374 /* Remove this timer before call, since it may reuse the timer */
493 local_irq_save(flags);
494 if (t->prev) 375 if (t->prev)
495 {
496 t->prev->next = t->next; 376 t->prev->next = t->next;
497 }
498 else 377 else
499 {
500 fast_timer_list = t->next; 378 fast_timer_list = t->next;
501 }
502 if (t->next) 379 if (t->next)
503 {
504 t->next->prev = t->prev; 380 t->next->prev = t->prev;
505 }
506 t->prev = NULL; 381 t->prev = NULL;
507 t->next = NULL; 382 t->next = NULL;
508 local_irq_restore(flags);
509 383
510 if (t->function != NULL) 384 /* Save function callback data before enabling
511 { 385 * interrupts, since the timer may be removed and we
512 t->function(t->data); 386 * don't know how it was allocated (e.g. ->function
513 } 387 * and ->data may become overwritten after deletion
514 else 388 * if the timer was stack-allocated).
515 { 389 */
390 f = t->function;
391 d = t->data;
392
393 if (f != NULL) {
394 /* Run the callback function with interrupts
395 * enabled. */
396 local_irq_restore(flags);
397 f(d);
398 local_irq_save(flags);
399 } else
516 DEBUG_LOG("!trimertrig %i function==NULL!\n", fast_timer_ints); 400 DEBUG_LOG("!trimertrig %i function==NULL!\n", fast_timer_ints);
517 } 401 } else {
518 }
519 else
520 {
521 /* Timer is to early, let's set it again using the normal routines */ 402 /* Timer is to early, let's set it again using the normal routines */
522 D1(printk(".\n")); 403 D1(printk(".\n"));
523 } 404 }
524 405
525 local_irq_save(flags); 406 t = fast_timer_list;
526 if ((t = fast_timer_list) != NULL) 407 if (t != NULL) {
527 {
528 /* Start next timer.. */ 408 /* Start next timer.. */
529 long us; 409 long us = 0;
530 struct timeval tv; 410 struct fasttime_t tv;
531 411
532 do_gettimeofday_fast(&tv); 412 do_gettimeofday_fast(&tv);
533 us = ((t->tv_expires.tv_sec - tv.tv_sec) * 1000000 + 413
534 t->tv_expires.tv_usec - tv.tv_usec); 414 /* time_after_eq takes care of wrapping */
535 if (us > 0) 415 if (time_after_eq(t->tv_expires.tv_jiff, tv.tv_jiff))
536 { 416 us = ((t->tv_expires.tv_jiff - tv.tv_jiff) *
537 if (!fast_timer_running) 417 1000000 / HZ + t->tv_expires.tv_usec -
538 { 418 tv.tv_usec);
419
420 if (us > 0) {
421 if (!fast_timer_running) {
539#ifdef FAST_TIMER_LOG 422#ifdef FAST_TIMER_LOG
540 timer_started_log[fast_timers_started % NUM_TIMER_STATS] = *t; 423 timer_started_log[fast_timers_started % NUM_TIMER_STATS] = *t;
541#endif 424#endif
542 start_timer_trig(us); 425 start_timer_trig(us);
543 } 426 }
544 local_irq_restore(flags);
545 break; 427 break;
546 } 428 } else {
547 else
548 {
549 /* Timer already expired, let's handle it better late than never. 429 /* Timer already expired, let's handle it better late than never.
550 * The normal loop handles it 430 * The normal loop handles it
551 */ 431 */
552 D1(printk("e! %d\n", us)); 432 D1(printk("e! %d\n", us));
553 } 433 }
554 } 434 }
555 local_irq_restore(flags);
556 } 435 }
557 436
558 if (!t) 437 local_irq_restore(flags);
559 { 438
439 if (!t)
560 D1(printk("ttrig stop!\n")); 440 D1(printk("ttrig stop!\n"));
561 }
562} 441}
563 442
564static void wake_up_func(unsigned long data) 443static void wake_up_func(unsigned long data)
565{ 444{
566#ifdef DECLARE_WAITQUEUE
567 wait_queue_head_t *sleep_wait_p = (wait_queue_head_t*)data; 445 wait_queue_head_t *sleep_wait_p = (wait_queue_head_t*)data;
568#else
569 struct wait_queue **sleep_wait_p = (struct wait_queue **)data;
570#endif
571 wake_up(sleep_wait_p); 446 wake_up(sleep_wait_p);
572} 447}
573 448
@@ -577,28 +452,17 @@ static void wake_up_func(unsigned long data)
577void schedule_usleep(unsigned long us) 452void schedule_usleep(unsigned long us)
578{ 453{
579 struct fast_timer t; 454 struct fast_timer t;
580#ifdef DECLARE_WAITQUEUE
581 wait_queue_head_t sleep_wait; 455 wait_queue_head_t sleep_wait;
582 init_waitqueue_head(&sleep_wait); 456 init_waitqueue_head(&sleep_wait);
583 {
584 DECLARE_WAITQUEUE(wait, current);
585#else
586 struct wait_queue *sleep_wait = NULL;
587 struct wait_queue wait = { current, NULL };
588#endif
589 457
590 D1(printk("schedule_usleep(%d)\n", us)); 458 D1(printk("schedule_usleep(%d)\n", us));
591 add_wait_queue(&sleep_wait, &wait);
592 set_current_state(TASK_INTERRUPTIBLE);
593 start_one_shot_timer(&t, wake_up_func, (unsigned long)&sleep_wait, us, 459 start_one_shot_timer(&t, wake_up_func, (unsigned long)&sleep_wait, us,
594 "usleep"); 460 "usleep");
595 schedule(); 461 /* Uninterruptible sleep on the fast timer. (The condition is
596 set_current_state(TASK_RUNNING); 462 * somewhat redundant since the timer is what wakes us up.) */
597 remove_wait_queue(&sleep_wait, &wait); 463 wait_event(sleep_wait, !fast_timer_pending(&t));
464
598 D1(printk("done schedule_usleep(%d)\n", us)); 465 D1(printk("done schedule_usleep(%d)\n", us));
599#ifdef DECLARE_WAITQUEUE
600 }
601#endif
602} 466}
603 467
604#ifdef CONFIG_PROC_FS 468#ifdef CONFIG_PROC_FS
@@ -618,20 +482,22 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
618 unsigned long flags; 482 unsigned long flags;
619 int i = 0; 483 int i = 0;
620 int num_to_show; 484 int num_to_show;
621 struct timeval tv; 485 struct fasttime_t tv;
622 struct fast_timer *t, *nextt; 486 struct fast_timer *t, *nextt;
623 static char *bigbuf = NULL; 487 static char *bigbuf = NULL;
624 static unsigned long used; 488 static unsigned long used;
625 489
626 if (!bigbuf && !(bigbuf = vmalloc(BIG_BUF_SIZE))) 490 if (!bigbuf) {
627 { 491 bigbuf = vmalloc(BIG_BUF_SIZE);
628 used = 0; 492 if (!bigbuf) {
629 bigbuf[0] = '\0'; 493 used = 0;
630 return 0; 494 if (buf)
631 } 495 buf[0] = '\0';
632 496 return 0;
633 if (!offset || !used) 497 }
634 { 498 }
499
500 if (!offset || !used) {
635 do_gettimeofday_fast(&tv); 501 do_gettimeofday_fast(&tv);
636 502
637 used = 0; 503 used = 0;
@@ -648,7 +514,7 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
648 used += sprintf(bigbuf + used, "Fast timer running: %s\n", 514 used += sprintf(bigbuf + used, "Fast timer running: %s\n",
649 fast_timer_running ? "yes" : "no"); 515 fast_timer_running ? "yes" : "no");
650 used += sprintf(bigbuf + used, "Current time: %lu.%06lu\n", 516 used += sprintf(bigbuf + used, "Current time: %lu.%06lu\n",
651 (unsigned long)tv.tv_sec, 517 (unsigned long)tv.tv_jiff,
652 (unsigned long)tv.tv_usec); 518 (unsigned long)tv.tv_usec);
653#ifdef FAST_TIMER_SANITY_CHECKS 519#ifdef FAST_TIMER_SANITY_CHECKS
654 used += sprintf(bigbuf + used, "Sanity failed: %i\n", 520 used += sprintf(bigbuf + used, "Sanity failed: %i\n",
@@ -661,10 +527,8 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
661 int end_i = debug_log_cnt; 527 int end_i = debug_log_cnt;
662 i = 0; 528 i = 0;
663 529
664 if (debug_log_cnt_wrapped) 530 if (debug_log_cnt_wrapped)
665 {
666 i = debug_log_cnt; 531 i = debug_log_cnt;
667 }
668 532
669 while ((i != end_i || (debug_log_cnt_wrapped && !used)) && 533 while ((i != end_i || (debug_log_cnt_wrapped && !used)) &&
670 used+100 < BIG_BUF_SIZE) 534 used+100 < BIG_BUF_SIZE)
@@ -697,9 +561,9 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
697 "d: %6li us data: 0x%08lX" 561 "d: %6li us data: 0x%08lX"
698 "\n", 562 "\n",
699 t->name, 563 t->name,
700 (unsigned long)t->tv_set.tv_sec, 564 (unsigned long)t->tv_set.tv_jiff,
701 (unsigned long)t->tv_set.tv_usec, 565 (unsigned long)t->tv_set.tv_usec,
702 (unsigned long)t->tv_expires.tv_sec, 566 (unsigned long)t->tv_expires.tv_jiff,
703 (unsigned long)t->tv_expires.tv_usec, 567 (unsigned long)t->tv_expires.tv_usec,
704 t->delay_us, 568 t->delay_us,
705 t->data 569 t->data
@@ -719,9 +583,9 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
719 "d: %6li us data: 0x%08lX" 583 "d: %6li us data: 0x%08lX"
720 "\n", 584 "\n",
721 t->name, 585 t->name,
722 (unsigned long)t->tv_set.tv_sec, 586 (unsigned long)t->tv_set.tv_jiff,
723 (unsigned long)t->tv_set.tv_usec, 587 (unsigned long)t->tv_set.tv_usec,
724 (unsigned long)t->tv_expires.tv_sec, 588 (unsigned long)t->tv_expires.tv_jiff,
725 (unsigned long)t->tv_expires.tv_usec, 589 (unsigned long)t->tv_expires.tv_usec,
726 t->delay_us, 590 t->delay_us,
727 t->data 591 t->data
@@ -739,9 +603,9 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
739 "d: %6li us data: 0x%08lX" 603 "d: %6li us data: 0x%08lX"
740 "\n", 604 "\n",
741 t->name, 605 t->name,
742 (unsigned long)t->tv_set.tv_sec, 606 (unsigned long)t->tv_set.tv_jiff,
743 (unsigned long)t->tv_set.tv_usec, 607 (unsigned long)t->tv_set.tv_usec,
744 (unsigned long)t->tv_expires.tv_sec, 608 (unsigned long)t->tv_expires.tv_jiff,
745 (unsigned long)t->tv_expires.tv_usec, 609 (unsigned long)t->tv_expires.tv_usec,
746 t->delay_us, 610 t->delay_us,
747 t->data 611 t->data
@@ -752,26 +616,25 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
752 616
753 used += sprintf(bigbuf + used, "Active timers:\n"); 617 used += sprintf(bigbuf + used, "Active timers:\n");
754 local_irq_save(flags); 618 local_irq_save(flags);
755 local_irq_save(flags);
756 t = fast_timer_list; 619 t = fast_timer_list;
757 while (t != NULL && (used+100 < BIG_BUF_SIZE)) 620 while (t != NULL && (used+100 < BIG_BUF_SIZE))
758 { 621 {
759 nextt = t->next; 622 nextt = t->next;
760 local_irq_restore(flags); 623 local_irq_restore(flags);
761 used += sprintf(bigbuf + used, "%-14s s: %6lu.%06lu e: %6lu.%06lu " 624 used += sprintf(bigbuf + used, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
762 "d: %6li us data: 0x%08lX" 625 "d: %6li us data: 0x%08lX"
763/* " func: 0x%08lX" */ 626/* " func: 0x%08lX" */
764 "\n", 627 "\n",
765 t->name, 628 t->name,
766 (unsigned long)t->tv_set.tv_sec, 629 (unsigned long)t->tv_set.tv_jiff,
767 (unsigned long)t->tv_set.tv_usec, 630 (unsigned long)t->tv_set.tv_usec,
768 (unsigned long)t->tv_expires.tv_sec, 631 (unsigned long)t->tv_expires.tv_jiff,
769 (unsigned long)t->tv_expires.tv_usec, 632 (unsigned long)t->tv_expires.tv_usec,
770 t->delay_us, 633 t->delay_us,
771 t->data 634 t->data
772/* , t->function */ 635/* , t->function */
773 ); 636 );
774 local_irq_disable(); 637 local_irq_save(flags);
775 if (t->next != nextt) 638 if (t->next != nextt)
776 { 639 {
777 printk("timer removed!\n"); 640 printk("timer removed!\n");
@@ -800,7 +663,7 @@ static volatile int num_test_timeout = 0;
800static struct fast_timer tr[10]; 663static struct fast_timer tr[10];
801static int exp_num[10]; 664static int exp_num[10];
802 665
803static struct timeval tv_exp[100]; 666static struct fasttime_t tv_exp[100];
804 667
805static void test_timeout(unsigned long data) 668static void test_timeout(unsigned long data)
806{ 669{
@@ -838,7 +701,7 @@ static void fast_timer_test(void)
838 int prev_num; 701 int prev_num;
839 int j; 702 int j;
840 703
841 struct timeval tv, tv0, tv1, tv2; 704 struct fasttime_t tv, tv0, tv1, tv2;
842 705
843 printk("fast_timer_test() start\n"); 706 printk("fast_timer_test() start\n");
844 do_gettimeofday_fast(&tv); 707 do_gettimeofday_fast(&tv);
@@ -851,21 +714,22 @@ static void fast_timer_test(void)
851 { 714 {
852 do_gettimeofday_fast(&tv_exp[j]); 715 do_gettimeofday_fast(&tv_exp[j]);
853 } 716 }
854 printk("fast_timer_test() %is %06i\n", tv.tv_sec, tv.tv_usec); 717 printk(KERN_DEBUG "fast_timer_test() %is %06i\n", tv.tv_jiff, tv.tv_usec);
855 718
856 for (j = 0; j < 1000; j++) 719 for (j = 0; j < 1000; j++)
857 { 720 {
858 printk("%i %i %i %i %i\n",j_u[j], j_u[j+1], j_u[j+2], j_u[j+3], j_u[j+4]); 721 printk(KERN_DEBUG "%i %i %i %i %i\n",
722 j_u[j], j_u[j+1], j_u[j+2], j_u[j+3], j_u[j+4]);
859 j += 4; 723 j += 4;
860 } 724 }
861 for (j = 0; j < 100; j++) 725 for (j = 0; j < 100; j++)
862 { 726 {
863 printk("%i.%i %i.%i %i.%i %i.%i %i.%i\n", 727 printk(KERN_DEBUG "%i.%i %i.%i %i.%i %i.%i %i.%i\n",
864 tv_exp[j].tv_sec,tv_exp[j].tv_usec, 728 tv_exp[j].tv_jiff, tv_exp[j].tv_usec,
865 tv_exp[j+1].tv_sec,tv_exp[j+1].tv_usec, 729 tv_exp[j+1].tv_jiff, tv_exp[j+1].tv_usec,
866 tv_exp[j+2].tv_sec,tv_exp[j+2].tv_usec, 730 tv_exp[j+2].tv_jiff, tv_exp[j+2].tv_usec,
867 tv_exp[j+3].tv_sec,tv_exp[j+3].tv_usec, 731 tv_exp[j+3].tv_jiff, tv_exp[j+3].tv_usec,
868 tv_exp[j+4].tv_sec,tv_exp[j+4].tv_usec); 732 tv_exp[j+4].tv_jiff, tv_exp[j+4].tv_usec);
869 j += 4; 733 j += 4;
870 } 734 }
871 do_gettimeofday_fast(&tv0); 735 do_gettimeofday_fast(&tv0);
@@ -892,14 +756,15 @@ static void fast_timer_test(void)
892 while (num_test_timeout < i) 756 while (num_test_timeout < i)
893 { 757 {
894 if (num_test_timeout != prev_num) 758 if (num_test_timeout != prev_num)
895 {
896 prev_num = num_test_timeout; 759 prev_num = num_test_timeout;
897 }
898 } 760 }
899 do_gettimeofday_fast(&tv2); 761 do_gettimeofday_fast(&tv2);
900 printk("Timers started %is %06i\n", tv0.tv_sec, tv0.tv_usec); 762 printk(KERN_INFO "Timers started %is %06i\n",
901 printk("Timers started at %is %06i\n", tv1.tv_sec, tv1.tv_usec); 763 tv0.tv_jiff, tv0.tv_usec);
902 printk("Timers done %is %06i\n", tv2.tv_sec, tv2.tv_usec); 764 printk(KERN_INFO "Timers started at %is %06i\n",
765 tv1.tv_jiff, tv1.tv_usec);
766 printk(KERN_INFO "Timers done %is %06i\n",
767 tv2.tv_jiff, tv2.tv_usec);
903 DP(printk("buf0:\n"); 768 DP(printk("buf0:\n");
904 printk(buf0); 769 printk(buf0);
905 printk("buf1:\n"); 770 printk("buf1:\n");
@@ -921,9 +786,9 @@ static void fast_timer_test(void)
921 printk("%-10s set: %6is %06ius exp: %6is %06ius " 786 printk("%-10s set: %6is %06ius exp: %6is %06ius "
922 "data: 0x%08X func: 0x%08X\n", 787 "data: 0x%08X func: 0x%08X\n",
923 t->name, 788 t->name,
924 t->tv_set.tv_sec, 789 t->tv_set.tv_jiff,
925 t->tv_set.tv_usec, 790 t->tv_set.tv_usec,
926 t->tv_expires.tv_sec, 791 t->tv_expires.tv_jiff,
927 t->tv_expires.tv_usec, 792 t->tv_expires.tv_usec,
928 t->data, 793 t->data,
929 t->function 794 t->function
@@ -931,10 +796,12 @@ static void fast_timer_test(void)
931 796
932 printk(" del: %6ius did exp: %6is %06ius as #%i error: %6li\n", 797 printk(" del: %6ius did exp: %6is %06ius as #%i error: %6li\n",
933 t->delay_us, 798 t->delay_us,
934 tv_exp[j].tv_sec, 799 tv_exp[j].tv_jiff,
935 tv_exp[j].tv_usec, 800 tv_exp[j].tv_usec,
936 exp_num[j], 801 exp_num[j],
937 (tv_exp[j].tv_sec - t->tv_expires.tv_sec)*1000000 + tv_exp[j].tv_usec - t->tv_expires.tv_usec); 802 (tv_exp[j].tv_jiff - t->tv_expires.tv_jiff) *
803 1000000 + tv_exp[j].tv_usec -
804 t->tv_expires.tv_usec);
938 } 805 }
939 proc_fasttimer_read(buf5, NULL, 0, 0, 0); 806 proc_fasttimer_read(buf5, NULL, 0, 0, 0);
940 printk("buf5 after all done:\n"); 807 printk("buf5 after all done:\n");
@@ -944,7 +811,7 @@ static void fast_timer_test(void)
944#endif 811#endif
945 812
946 813
947void fast_timer_init(void) 814int fast_timer_init(void)
948{ 815{
949 /* For some reason, request_irq() hangs when called froom time_init() */ 816 /* For some reason, request_irq() hangs when called froom time_init() */
950 if (!fast_timer_is_init) 817 if (!fast_timer_is_init)
@@ -952,18 +819,20 @@ void fast_timer_init(void)
952 printk("fast_timer_init()\n"); 819 printk("fast_timer_init()\n");
953 820
954#ifdef CONFIG_PROC_FS 821#ifdef CONFIG_PROC_FS
955 if ((fasttimer_proc_entry = create_proc_entry( "fasttimer", 0, 0 ))) 822 fasttimer_proc_entry = create_proc_entry("fasttimer", 0, 0);
956 fasttimer_proc_entry->read_proc = proc_fasttimer_read; 823 if (fasttimer_proc_entry)
824 fasttimer_proc_entry->read_proc = proc_fasttimer_read;
957#endif /* PROC_FS */ 825#endif /* PROC_FS */
958 if(request_irq(TIMER_INTR_VECT, timer_trig_interrupt, IRQF_DISABLED, 826 if (request_irq(TIMER0_INTR_VECT, timer_trig_interrupt,
959 "fast timer int", NULL)) 827 IRQF_SHARED | IRQF_DISABLED,
960 { 828 "fast timer int", &fast_timer_list))
961 printk("err: timer1 irq\n"); 829 printk(KERN_ERR "err: fasttimer irq\n");
962 }
963 fast_timer_is_init = 1; 830 fast_timer_is_init = 1;
964#ifdef FAST_TIMER_TEST 831#ifdef FAST_TIMER_TEST
965 printk("do test\n"); 832 printk("do test\n");
966 fast_timer_test(); 833 fast_timer_test();
967#endif 834#endif
968 } 835 }
836 return 0;
969} 837}
838__initcall(fast_timer_init);
diff --git a/arch/cris/arch-v32/kernel/head.S b/arch/cris/arch-v32/kernel/head.S
index 20bd80a84e48..2d66a7c320e1 100644
--- a/arch/cris/arch-v32/kernel/head.S
+++ b/arch/cris/arch-v32/kernel/head.S
@@ -4,22 +4,25 @@
4 * Copyright (C) 2003, Axis Communications AB 4 * Copyright (C) 2003, Axis Communications AB
5 */ 5 */
6 6
7
8#define ASSEMBLER_MACROS_ONLY 7#define ASSEMBLER_MACROS_ONLY
9 8
10/* 9/*
11 * The macros found in mmu_defs_asm.h uses the ## concatenation operator, so 10 * The macros found in mmu_defs_asm.h uses the ## concatenation operator, so
12 * -traditional must not be used when assembling this file. 11 * -traditional must not be used when assembling this file.
13 */ 12 */
14#include <asm/arch/hwregs/reg_rdwr.h> 13#include <hwregs/reg_rdwr.h>
15#include <asm/arch/hwregs/asm/mmu_defs_asm.h> 14#include <asm/arch/memmap.h>
16#include <asm/arch/hwregs/asm/reg_map_asm.h> 15#include <hwregs/intr_vect.h>
17#include <asm/arch/hwregs/asm/config_defs_asm.h> 16#include <hwregs/asm/mmu_defs_asm.h>
18#include <asm/arch/hwregs/asm/bif_core_defs_asm.h> 17#include <hwregs/asm/reg_map_asm.h>
18#include <asm/arch/mach/startup.inc>
19 19
20#define CRAMFS_MAGIC 0x28cd3d45 20#define CRAMFS_MAGIC 0x28cd3d45
21#define JHEAD_MAGIC 0x1FF528A6
22#define JHEAD_SIZE 8
21#define RAM_INIT_MAGIC 0x56902387 23#define RAM_INIT_MAGIC 0x56902387
22#define COMMAND_LINE_MAGIC 0x87109563 24#define COMMAND_LINE_MAGIC 0x87109563
25#define NAND_BOOT_MAGIC 0x9a9db001
23 26
24 ;; NOTE: R8 and R9 carry information from the decompressor (if the 27 ;; NOTE: R8 and R9 carry information from the decompressor (if the
25 ;; kernel was compressed). They must not be used in the code below 28 ;; kernel was compressed). They must not be used in the code below
@@ -30,12 +33,11 @@
30 .global romfs_start 33 .global romfs_start
31 .global romfs_length 34 .global romfs_length
32 .global romfs_in_flash 35 .global romfs_in_flash
36 .global nand_boot
33 .global swapper_pg_dir 37 .global swapper_pg_dir
34 .global crisv32_nand_boot
35 .global crisv32_nand_cramfs_offset
36 38
37 ;; Dummy section to make it bootable with current VCS simulator 39 ;; Dummy section to make it bootable with current VCS simulator
38#ifdef CONFIG_ETRAXFS_SIM 40#ifdef CONFIG_ETRAX_VCS_SIM
39 .section ".boot", "ax" 41 .section ".boot", "ax"
40 ba tstart 42 ba tstart
41 nop 43 nop
@@ -51,33 +53,15 @@ tstart:
51 ;; 53 ;;
52 di 54 di
53 55
54 ;; Start clocks for used blocks. 56 START_CLOCKS
55 move.d REG_ADDR(config, regi_config, rw_clk_ctrl), $r1 57
56 move.d [$r1], $r0 58 SETUP_WAIT_STATES
57 or.d REG_STATE(config, rw_clk_ctrl, cpu, yes) | \ 59
58 REG_STATE(config, rw_clk_ctrl, bif, yes) | \ 60 GIO_INIT
59 REG_STATE(config, rw_clk_ctrl, fix_io, yes), $r0 61
60 move.d $r0, [$r1] 62#ifdef CONFIG_SMP
61 63secondary_cpu_entry: /* Entry point for secondary CPUs */
62 ;; Set up waitstates etc 64 di
63 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp1_cfg), $r0
64 move.d CONFIG_ETRAX_MEM_GRP1_CONFIG, $r1
65 move.d $r1, [$r0]
66 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp2_cfg), $r0
67 move.d CONFIG_ETRAX_MEM_GRP2_CONFIG, $r1
68 move.d $r1, [$r0]
69 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp3_cfg), $r0
70 move.d CONFIG_ETRAX_MEM_GRP3_CONFIG, $r1
71 move.d $r1, [$r0]
72 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp4_cfg), $r0
73 move.d CONFIG_ETRAX_MEM_GRP4_CONFIG, $r1
74 move.d $r1, [$r0]
75
76#ifdef CONFIG_ETRAXFS_SIM
77 ;; Set up minimal flash waitstates
78 move.d 0, $r10
79 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp1_cfg), $r11
80 move.d $r10, [$r11]
81#endif 65#endif
82 66
83 ;; Setup and enable the MMU. Use same configuration for both the data 67 ;; Setup and enable the MMU. Use same configuration for both the data
@@ -85,7 +69,7 @@ tstart:
85 ;; 69 ;;
86 ;; Note; 3 cycles is needed for a bank-select to take effect. Further; 70 ;; Note; 3 cycles is needed for a bank-select to take effect. Further;
87 ;; bank 1 is the instruction MMU, bank 2 is the data MMU. 71 ;; bank 1 is the instruction MMU, bank 2 is the data MMU.
88#ifndef CONFIG_ETRAXFS_SIM 72#ifndef CONFIG_ETRAX_VCS_SIM
89 move.d REG_FIELD(mmu, rw_mm_kbase_hi, base_e, 8) \ 73 move.d REG_FIELD(mmu, rw_mm_kbase_hi, base_e, 8) \
90 | REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 4) \ 74 | REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 4) \
91 | REG_FIELD(mmu, rw_mm_kbase_hi, base_b, 0xb), $r0 75 | REG_FIELD(mmu, rw_mm_kbase_hi, base_b, 0xb), $r0
@@ -93,7 +77,7 @@ tstart:
93 ;; Map the virtual DRAM to the RW eprom area at address 0. 77 ;; Map the virtual DRAM to the RW eprom area at address 0.
94 ;; Also map 0xa for the hook calls, 78 ;; Also map 0xa for the hook calls,
95 move.d REG_FIELD(mmu, rw_mm_kbase_hi, base_e, 8) \ 79 move.d REG_FIELD(mmu, rw_mm_kbase_hi, base_e, 8) \
96 | REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 0) \ 80 | REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 4) \
97 | REG_FIELD(mmu, rw_mm_kbase_hi, base_b, 0xb) \ 81 | REG_FIELD(mmu, rw_mm_kbase_hi, base_b, 0xb) \
98 | REG_FIELD(mmu, rw_mm_kbase_hi, base_a, 0xa), $r0 82 | REG_FIELD(mmu, rw_mm_kbase_hi, base_a, 0xa), $r0
99#endif 83#endif
@@ -104,7 +88,7 @@ tstart:
104 88
105 ;; Enable certain page protections and setup linear mapping 89 ;; Enable certain page protections and setup linear mapping
106 ;; for f,e,c,b,4,0. 90 ;; for f,e,c,b,4,0.
107#ifndef CONFIG_ETRAXFS_SIM 91#ifndef CONFIG_ETRAX_VCS_SIM
108 move.d REG_STATE(mmu, rw_mm_cfg, we, on) \ 92 move.d REG_STATE(mmu, rw_mm_cfg, we, on) \
109 | REG_STATE(mmu, rw_mm_cfg, acc, on) \ 93 | REG_STATE(mmu, rw_mm_cfg, acc, on) \
110 | REG_STATE(mmu, rw_mm_cfg, ex, on) \ 94 | REG_STATE(mmu, rw_mm_cfg, ex, on) \
@@ -183,17 +167,11 @@ tstart:
183 nop 167 nop
184 nop 168 nop
185 nop 169 nop
186 move $s10, $r0 170 move $s12, $r0
187 cmpq 0, $r0 171 cmpq 0, $r0
188 beq master_cpu 172 beq master_cpu
189 nop 173 nop
190slave_cpu: 174slave_cpu:
191 ; A slave waits for cpu_now_booting to be equal to CPU ID.
192 move.d cpu_now_booting, $r1
193slave_wait:
194 cmp.d [$r1], $r0
195 bne slave_wait
196 nop
197 ; Time to boot-up. Get stack location provided by master CPU. 175 ; Time to boot-up. Get stack location provided by master CPU.
198 move.d smp_init_current_idle_thread, $r1 176 move.d smp_init_current_idle_thread, $r1
199 move.d [$r1], $sp 177 move.d [$r1], $sp
@@ -203,9 +181,16 @@ slave_wait:
203 jsr smp_callin 181 jsr smp_callin
204 nop 182 nop
205master_cpu: 183master_cpu:
184 /* Set up entry point for secondary CPUs. The boot ROM has set up
185 * EBP at start of internal memory. The CPU will get there
186 * later when we issue an IPI to them... */
187 move.d MEM_INTMEM_START + IPI_INTR_VECT * 4, $r0
188 move.d secondary_cpu_entry, $r1
189 move.d $r1, [$r0]
206#endif 190#endif
207#ifndef CONFIG_ETRAXFS_SIM 191#ifndef CONFIG_ETRAX_VCS_SIM
208 ;; Check if starting from DRAM or flash. 192 ; Check if starting from DRAM (network->RAM boot or unpacked
193 ; compressed kernel), or directly from flash.
209 lapcq ., $r0 194 lapcq ., $r0
210 and.d 0x7fffffff, $r0 ; Mask off the non-cache bit. 195 and.d 0x7fffffff, $r0 ; Mask off the non-cache bit.
211 cmp.d 0x10000, $r0 ; Arbitrary, something above this code. 196 cmp.d 0x10000, $r0 ; Arbitrary, something above this code.
@@ -232,12 +217,13 @@ _inflash:
232 beq _dram_initialized 217 beq _dram_initialized
233 nop 218 nop
234 219
235#include "../lib/dram_init.S" 220#include "../mach/dram_init.S"
236 221
237_dram_initialized: 222_dram_initialized:
238 ;; Copy the text and data section to DRAM. This depends on that the 223 ;; Copy the text and data section to DRAM. This depends on that the
239 ;; variables used below are correctly set up by the linker script. 224 ;; variables used below are correctly set up by the linker script.
240 ;; The calculated value stored in R4 is used below. 225 ;; The calculated value stored in R4 is used below.
226 ;; Leave the cramfs file system (piggybacked after the kernel) in flash.
241 moveq 0, $r0 ; Source. 227 moveq 0, $r0 ; Source.
242 move.d text_start, $r1 ; Destination. 228 move.d text_start, $r1 ; Destination.
243 move.d __vmlinux_end, $r2 229 move.d __vmlinux_end, $r2
@@ -249,7 +235,7 @@ _dram_initialized:
249 blo 1b 235 blo 1b
250 nop 236 nop
251 237
252 ;; Keep CRAMFS in flash. 238 ;; Check for cramfs.
253 moveq 0, $r0 239 moveq 0, $r0
254 move.d romfs_length, $r1 240 move.d romfs_length, $r1
255 move.d $r0, [$r1] 241 move.d $r0, [$r1]
@@ -258,6 +244,7 @@ _dram_initialized:
258 bne 1f 244 bne 1f
259 nop 245 nop
260 246
247 ;; Set length and start of cramfs, set romfs_in_flash flag
261 addoq +4, $r4, $acr 248 addoq +4, $r4, $acr
262 move.d [$acr], $r0 249 move.d [$acr], $r0
263 move.d romfs_length, $r1 250 move.d romfs_length, $r1
@@ -273,35 +260,32 @@ _dram_initialized:
273 nop 260 nop
274 261
275_inram: 262_inram:
276 ;; Check if booting from NAND flash (in that case we just remember the offset 263 ;; Check if booting from NAND flash; if so, set appropriate flags
277 ;; into the flash where cramfs should be). 264 ;; and move on.
278 move.d REG_ADDR(config, regi_config, r_bootsel), $r0 265 cmp.d NAND_BOOT_MAGIC, $r12
279 move.d [$r0], $r0 266 bne move_cramfs ; not nand, jump
280 and.d REG_MASK(config, r_bootsel, boot_mode), $r0
281 cmp.d REG_STATE(config, r_bootsel, boot_mode, nand), $r0
282 bne move_cramfs
283 moveq 1,$r0
284 move.d crisv32_nand_boot, $r1
285 move.d $r0, [$r1]
286 move.d crisv32_nand_cramfs_offset, $r1
287 move.d $r9, [$r1]
288 moveq 1, $r0 267 moveq 1, $r0
289 move.d romfs_in_flash, $r1 268 move.d nand_boot, $r1 ; tell axisflashmap we're booting from NAND
269 move.d $r0, [$r1]
270 moveq 0, $r0 ; tell axisflashmap romfs is not in
271 move.d romfs_in_flash, $r1 ; (directly accessed) flash
290 move.d $r0, [$r1] 272 move.d $r0, [$r1]
291 jump _start_it 273 jump _start_it ; continue with boot
292 nop 274 nop
293 275
294move_cramfs: 276move_cramfs:
295 ;; Move the cramfs after BSS. 277 ;; kernel is in DRAM.
278 ;; Must figure out if there is a piggybacked rootfs image or not.
279 ;; Set romfs_length to 0 => no rootfs image available by default.
296 moveq 0, $r0 280 moveq 0, $r0
297 move.d romfs_length, $r1 281 move.d romfs_length, $r1
298 move.d $r0, [$r1] 282 move.d $r0, [$r1]
299 283
300#ifndef CONFIG_ETRAXFS_SIM 284#ifndef CONFIG_ETRAX_VCS_SIM
301 ;; The kernel could have been unpacked to DRAM by the loader, but 285 ;; The kernel could have been unpacked to DRAM by the loader, but
302 ;; the cramfs image could still be inte the flash immediately 286 ;; the cramfs image could still be in the flash immediately
303 ;; following the compressed kernel image. The loaded passes the address 287 ;; following the compressed kernel image. The loader passes the address
304 ;; of the bute succeeding the last compressed byte in the flash in 288 ;; of the byte succeeding the last compressed byte in the flash in
305 ;; register R9 when starting the kernel. 289 ;; register R9 when starting the kernel.
306 cmp.d 0x0ffffff8, $r9 290 cmp.d 0x0ffffff8, $r9
307 bhs _no_romfs_in_flash ; R9 points outside the flash area. 291 bhs _no_romfs_in_flash ; R9 points outside the flash area.
@@ -310,11 +294,13 @@ move_cramfs:
310 ba _no_romfs_in_flash 294 ba _no_romfs_in_flash
311 nop 295 nop
312#endif 296#endif
297 ;; cramfs rootfs might to be in flash. Check for it.
313 move.d [$r9], $r0 ; cramfs_super.magic 298 move.d [$r9], $r0 ; cramfs_super.magic
314 cmp.d CRAMFS_MAGIC, $r0 299 cmp.d CRAMFS_MAGIC, $r0
315 bne _no_romfs_in_flash 300 bne _no_romfs_in_flash
316 nop 301 nop
317 302
303 ;; found cramfs in flash. set address and size, and romfs_in_flash flag.
318 addoq +4, $r9, $acr 304 addoq +4, $r9, $acr
319 move.d [$acr], $r0 305 move.d [$acr], $r0
320 move.d romfs_length, $r1 306 move.d romfs_length, $r1
@@ -330,27 +316,43 @@ move_cramfs:
330 nop 316 nop
331 317
332_no_romfs_in_flash: 318_no_romfs_in_flash:
333 ;; Look for cramfs. 319 ;; No romfs in flash, so look for cramfs, or jffs2 with jhead,
320 ;; after kernel in RAM, as is the case with network->RAM boot.
321 ;; For cramfs, partition starts with magic and length.
322 ;; For jffs2, a jhead is prepended which contains with magic and length.
323 ;; The jhead is not part of the jffs2 partition however.
334#ifndef CONFIG_ETRAXFS_SIM 324#ifndef CONFIG_ETRAXFS_SIM
335 move.d __vmlinux_end, $r0 325 move.d __vmlinux_end, $r0
336#else 326#else
337 move.d __end, $r0 327 move.d __end, $r0
338#endif 328#endif
339 move.d [$r0], $r1 329 move.d [$r0], $r1
340 cmp.d CRAMFS_MAGIC, $r1 330 cmp.d CRAMFS_MAGIC, $r1 ; cramfs magic?
341 bne 2f 331 beq 2f ; yes, jump
332 nop
333 cmp.d JHEAD_MAGIC, $r1 ; jffs2 (jhead) magic?
334 bne 4f ; no, skip copy
342 nop 335 nop
336 addq 4, $r0 ; location of jffs2 size
337 move.d [$r0+], $r2 ; fetch jffs2 size -> r2
338 ; r0 now points to start of jffs2
339 ba 3f
340 nop
3412:
342 addoq +4, $r0, $acr ; location of cramfs size
343 move.d [$acr], $r2 ; fetch cramfs size -> r2
344 ; r0 still points to start of cramfs
3453:
346 ;; Now, move the root fs to after kernel's BSS
343 347
344 addoq +4, $r0, $acr 348 move.d _end, $r1 ; start of cramfs -> r1
345 move.d [$acr], $r2
346 move.d _end, $r1
347 move.d romfs_start, $r3 349 move.d romfs_start, $r3
348 move.d $r1, [$r3] 350 move.d $r1, [$r3] ; store at romfs_start (for axisflashmap)
349 move.d romfs_length, $r3 351 move.d romfs_length, $r3
350 move.d $r2, [$r3] 352 move.d $r2, [$r3] ; store size at romfs_length
351 353
352#ifndef CONFIG_ETRAXFS_SIM 354#ifndef CONFIG_ETRAX_VCS_SIM
353 add.d $r2, $r0 355 add.d $r2, $r0 ; copy from end and downwards
354 add.d $r2, $r1 356 add.d $r2, $r1
355 357
356 lsrq 1, $r2 ; Size is in bytes, we copy words. 358 lsrq 1, $r2 ; Size is in bytes, we copy words.
@@ -365,10 +367,17 @@ _no_romfs_in_flash:
365 nop 367 nop
366#endif 368#endif
367 369
3682: 3704:
371 ;; BSS move done.
372 ;; Clear romfs_in_flash flag, as we now know romfs is in DRAM
373 ;; Also clear nand_boot flag; if we got here, we know we've not
374 ;; booted from NAND flash.
369 moveq 0, $r0 375 moveq 0, $r0
370 move.d romfs_in_flash, $r1 376 move.d romfs_in_flash, $r1
371 move.d $r0, [$r1] 377 move.d $r0, [$r1]
378 moveq 0, $r0
379 move.d nand_boot, $r1
380 move.d $r0, [$r1]
372 381
373 jump _start_it ; Jump to cached code. 382 jump _start_it ; Jump to cached code.
374 nop 383 nop
@@ -384,8 +393,8 @@ _start_it:
384 move.d cris_command_line, $r10 393 move.d cris_command_line, $r10
385 or.d 0x80000000, $r11 ; Make it virtual 394 or.d 0x80000000, $r11 ; Make it virtual
3861: 3951:
387 move.b [$r11+], $r12 396 move.b [$r11+], $r1
388 move.b $r12, [$r10+] 397 move.b $r1, [$r10+]
389 subq 1, $r13 398 subq 1, $r13
390 bne 1b 399 bne 1b
391 nop 400 nop
@@ -401,7 +410,7 @@ no_command_line:
401 move.d etrax_irv, $r1 ; Set the exception base register and pointer. 410 move.d etrax_irv, $r1 ; Set the exception base register and pointer.
402 move.d $r0, [$r1] 411 move.d $r0, [$r1]
403 412
404#ifndef CONFIG_ETRAXFS_SIM 413#ifndef CONFIG_ETRAX_VCS_SIM
405 ;; Clear the BSS region from _bss_start to _end. 414 ;; Clear the BSS region from _bss_start to _end.
406 move.d __bss_start, $r0 415 move.d __bss_start, $r0
407 move.d _end, $r1 416 move.d _end, $r1
@@ -411,7 +420,7 @@ no_command_line:
411 nop 420 nop
412#endif 421#endif
413 422
414#ifdef CONFIG_ETRAXFS_SIM 423#ifdef CONFIG_ETRAX_VCS_SIM
415 /* Set the watchdog timeout to something big. Will be removed when */ 424 /* Set the watchdog timeout to something big. Will be removed when */
416 /* watchdog can be disabled with command line option */ 425 /* watchdog can be disabled with command line option */
417 move.d 0x7fffffff, $r10 426 move.d 0x7fffffff, $r10
@@ -423,25 +432,44 @@ no_command_line:
423 move.d __bss_start, $r0 432 move.d __bss_start, $r0
424 movem [$r0], $r13 433 movem [$r0], $r13
425 434
435#ifdef CONFIG_ETRAX_L2CACHE
436 jsr l2cache_init
437 nop
438#endif
439
426 jump start_kernel ; Jump to start_kernel() in init/main.c. 440 jump start_kernel ; Jump to start_kernel() in init/main.c.
427 nop 441 nop
428 442
429 .data 443 .data
430etrax_irv: 444etrax_irv:
431 .dword 0 445 .dword 0
446
447; Variables for communication with the Axis flash map driver (axisflashmap),
448; and for setting up memory in arch/cris/kernel/setup.c .
449
450; romfs_start is set to the start of the root file system, if it exists
451; in directly accessible memory (i.e. NOR Flash when booting from Flash,
452; or RAM when booting directly from a network-downloaded RAM image)
432romfs_start: 453romfs_start:
433 .dword 0 454 .dword 0
455
456; romfs_length is set to the size of the root file system image, if it exists
457; in directly accessible memory (see romfs_start). Otherwise it is set to 0.
434romfs_length: 458romfs_length:
435 .dword 0 459 .dword 0
460
461; romfs_in_flash is set to 1 if the root file system resides in directly
462; accessible flash memory (i.e. NOR flash). It is set to 0 for RAM boot
463; or NAND flash boot.
436romfs_in_flash: 464romfs_in_flash:
437 .dword 0 465 .dword 0
438crisv32_nand_boot: 466
439 .dword 0 467; nand_boot is set to 1 when the kernel has been booted from NAND flash
440crisv32_nand_cramfs_offset: 468nand_boot:
441 .dword 0 469 .dword 0
442 470
443swapper_pg_dir = 0xc0002000 471swapper_pg_dir = 0xc0002000
444 472
445 .section ".init.data", "aw" 473 .section ".init.data", "aw"
446 474
447#include "../lib/hw_settings.S" 475#include "../mach/hw_settings.S"
diff --git a/arch/cris/arch-v32/kernel/io.c b/arch/cris/arch-v32/kernel/io.c
deleted file mode 100644
index a22a9e02e093..000000000000
--- a/arch/cris/arch-v32/kernel/io.c
+++ /dev/null
@@ -1,153 +0,0 @@
1/*
2 * Helper functions for I/O pins.
3 *
4 * Copyright (c) 2004 Axis Communications AB.
5 */
6
7#include <linux/types.h>
8#include <linux/errno.h>
9#include <linux/init.h>
10#include <linux/string.h>
11#include <linux/ctype.h>
12#include <linux/kernel.h>
13#include <linux/module.h>
14#include <asm/io.h>
15#include <asm/arch/pinmux.h>
16#include <asm/arch/hwregs/gio_defs.h>
17
18struct crisv32_ioport crisv32_ioports[] =
19{
20 {
21 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pa_oe),
22 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pa_dout),
23 (unsigned long*)REG_ADDR(gio, regi_gio, r_pa_din),
24 8
25 },
26 {
27 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pb_oe),
28 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pb_dout),
29 (unsigned long*)REG_ADDR(gio, regi_gio, r_pb_din),
30 18
31 },
32 {
33 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pc_oe),
34 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pc_dout),
35 (unsigned long*)REG_ADDR(gio, regi_gio, r_pc_din),
36 18
37 },
38 {
39 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pd_oe),
40 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pd_dout),
41 (unsigned long*)REG_ADDR(gio, regi_gio, r_pd_din),
42 18
43 },
44 {
45 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pe_oe),
46 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pe_dout),
47 (unsigned long*)REG_ADDR(gio, regi_gio, r_pe_din),
48 18
49 }
50};
51
52#define NBR_OF_PORTS ARRAY_SIZE(crisv32_ioports)
53
54struct crisv32_iopin crisv32_led1_green;
55struct crisv32_iopin crisv32_led1_red;
56struct crisv32_iopin crisv32_led2_green;
57struct crisv32_iopin crisv32_led2_red;
58struct crisv32_iopin crisv32_led3_green;
59struct crisv32_iopin crisv32_led3_red;
60
61/* Dummy port used when green LED and red LED is on the same bit */
62static unsigned long io_dummy;
63static struct crisv32_ioport dummy_port =
64{
65 &io_dummy,
66 &io_dummy,
67 &io_dummy,
68 18
69};
70static struct crisv32_iopin dummy_led =
71{
72 &dummy_port,
73 0
74};
75
76static int __init crisv32_io_init(void)
77{
78 int ret = 0;
79 /* Initialize LEDs */
80 ret += crisv32_io_get_name(&crisv32_led1_green, CONFIG_ETRAX_LED1G);
81 ret += crisv32_io_get_name(&crisv32_led1_red, CONFIG_ETRAX_LED1R);
82 ret += crisv32_io_get_name(&crisv32_led2_green, CONFIG_ETRAX_LED2G);
83 ret += crisv32_io_get_name(&crisv32_led2_red, CONFIG_ETRAX_LED2R);
84 ret += crisv32_io_get_name(&crisv32_led3_green, CONFIG_ETRAX_LED3G);
85 ret += crisv32_io_get_name(&crisv32_led3_red, CONFIG_ETRAX_LED3R);
86 crisv32_io_set_dir(&crisv32_led1_green, crisv32_io_dir_out);
87 crisv32_io_set_dir(&crisv32_led1_red, crisv32_io_dir_out);
88 crisv32_io_set_dir(&crisv32_led2_green, crisv32_io_dir_out);
89 crisv32_io_set_dir(&crisv32_led2_red, crisv32_io_dir_out);
90 crisv32_io_set_dir(&crisv32_led3_green, crisv32_io_dir_out);
91 crisv32_io_set_dir(&crisv32_led3_red, crisv32_io_dir_out);
92
93 if (!strcmp(CONFIG_ETRAX_LED1G, CONFIG_ETRAX_LED1R))
94 crisv32_led1_red = dummy_led;
95 if (!strcmp(CONFIG_ETRAX_LED2G, CONFIG_ETRAX_LED2R))
96 crisv32_led2_red = dummy_led;
97
98 return ret;
99}
100
101__initcall(crisv32_io_init);
102
103int crisv32_io_get(struct crisv32_iopin* iopin,
104 unsigned int port, unsigned int pin)
105{
106 if (port > NBR_OF_PORTS)
107 return -EINVAL;
108 if (port > crisv32_ioports[port].pin_count)
109 return -EINVAL;
110
111 iopin->bit = 1 << pin;
112 iopin->port = &crisv32_ioports[port];
113
114 if (crisv32_pinmux_alloc(port, pin, pin, pinmux_gpio))
115 return -EIO;
116
117 return 0;
118}
119
120int crisv32_io_get_name(struct crisv32_iopin* iopin,
121 char* name)
122{
123 int port;
124 int pin;
125
126 if (toupper(*name) == 'P')
127 name++;
128
129 if (toupper(*name) < 'A' || toupper(*name) > 'E')
130 return -EINVAL;
131
132 port = toupper(*name) - 'A';
133 name++;
134 pin = simple_strtoul(name, NULL, 10);
135
136 if (pin < 0 || pin > crisv32_ioports[port].pin_count)
137 return -EINVAL;
138
139 iopin->bit = 1 << pin;
140 iopin->port = &crisv32_ioports[port];
141
142 if (crisv32_pinmux_alloc(port, pin, pin, pinmux_gpio))
143 return -EIO;
144
145 return 0;
146}
147
148#ifdef CONFIG_PCI
149/* PCI I/O access stuff */
150struct cris_io_operations* cris_iops = NULL;
151EXPORT_SYMBOL(cris_iops);
152#endif
153
diff --git a/arch/cris/arch-v32/kernel/irq.c b/arch/cris/arch-v32/kernel/irq.c
index a9acaa270243..173c141ac9ba 100644
--- a/arch/cris/arch-v32/kernel/irq.c
+++ b/arch/cris/arch-v32/kernel/irq.c
@@ -15,15 +15,21 @@
15#include <linux/threads.h> 15#include <linux/threads.h>
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/kernel_stat.h> 17#include <linux/kernel_stat.h>
18#include <asm/arch/hwregs/reg_map.h> 18#include <hwregs/reg_map.h>
19#include <asm/arch/hwregs/reg_rdwr.h> 19#include <hwregs/reg_rdwr.h>
20#include <asm/arch/hwregs/intr_vect.h> 20#include <hwregs/intr_vect.h>
21#include <asm/arch/hwregs/intr_vect_defs.h> 21#include <hwregs/intr_vect_defs.h>
22 22
23#define CPU_FIXED -1 23#define CPU_FIXED -1
24 24
25/* IRQ masks (refer to comment for crisv32_do_multiple) */ 25/* IRQ masks (refer to comment for crisv32_do_multiple) */
26#define TIMER_MASK (1 << (TIMER_INTR_VECT - FIRST_IRQ)) 26#if TIMER0_INTR_VECT - FIRST_IRQ < 32
27#define TIMER_MASK (1 << (TIMER0_INTR_VECT - FIRST_IRQ))
28#undef TIMER_VECT1
29#else
30#define TIMER_MASK (1 << (TIMER0_INTR_VECT - FIRST_IRQ - 32))
31#define TIMER_VECT1
32#endif
27#ifdef CONFIG_ETRAX_KGDB 33#ifdef CONFIG_ETRAX_KGDB
28#if defined(CONFIG_ETRAX_KGDB_PORT0) 34#if defined(CONFIG_ETRAX_KGDB_PORT0)
29#define IGNOREMASK (1 << (SER0_INTR_VECT - FIRST_IRQ)) 35#define IGNOREMASK (1 << (SER0_INTR_VECT - FIRST_IRQ))
@@ -44,8 +50,8 @@ struct cris_irq_allocation
44 cpumask_t mask; /* The CPUs to which the IRQ may be allocated. */ 50 cpumask_t mask; /* The CPUs to which the IRQ may be allocated. */
45}; 51};
46 52
47struct cris_irq_allocation irq_allocations[NR_IRQS] = 53struct cris_irq_allocation irq_allocations[NR_REAL_IRQS] =
48 {[0 ... NR_IRQS - 1] = {0, CPU_MASK_ALL}}; 54 { [0 ... NR_REAL_IRQS - 1] = {0, CPU_MASK_ALL} };
49 55
50static unsigned long irq_regs[NR_CPUS] = 56static unsigned long irq_regs[NR_CPUS] =
51{ 57{
@@ -55,6 +61,12 @@ static unsigned long irq_regs[NR_CPUS] =
55#endif 61#endif
56}; 62};
57 63
64#if NR_REAL_IRQS > 32
65#define NBR_REGS 2
66#else
67#define NBR_REGS 1
68#endif
69
58unsigned long cpu_irq_counters[NR_CPUS]; 70unsigned long cpu_irq_counters[NR_CPUS];
59unsigned long irq_counters[NR_REAL_IRQS]; 71unsigned long irq_counters[NR_REAL_IRQS];
60 72
@@ -79,45 +91,81 @@ extern void d_mmu_write(void);
79extern void kgdb_init(void); 91extern void kgdb_init(void);
80extern void breakpoint(void); 92extern void breakpoint(void);
81 93
94/* From traps.c. */
95extern void breakh_BUG(void);
96
82/* 97/*
83 * Build the IRQ handler stubs using macros from irq.h. First argument is the 98 * Build the IRQ handler stubs using macros from irq.h.
84 * IRQ number, the second argument is the corresponding bit in
85 * intr_rw_vect_mask found in asm/arch/hwregs/intr_vect_defs.h.
86 */ 99 */
87BUILD_IRQ(0x31, (1 << 0)) /* memarb */ 100BUILD_IRQ(0x31)
88BUILD_IRQ(0x32, (1 << 1)) /* gen_io */ 101BUILD_IRQ(0x32)
89BUILD_IRQ(0x33, (1 << 2)) /* iop0 */ 102BUILD_IRQ(0x33)
90BUILD_IRQ(0x34, (1 << 3)) /* iop1 */ 103BUILD_IRQ(0x34)
91BUILD_IRQ(0x35, (1 << 4)) /* iop2 */ 104BUILD_IRQ(0x35)
92BUILD_IRQ(0x36, (1 << 5)) /* iop3 */ 105BUILD_IRQ(0x36)
93BUILD_IRQ(0x37, (1 << 6)) /* dma0 */ 106BUILD_IRQ(0x37)
94BUILD_IRQ(0x38, (1 << 7)) /* dma1 */ 107BUILD_IRQ(0x38)
95BUILD_IRQ(0x39, (1 << 8)) /* dma2 */ 108BUILD_IRQ(0x39)
96BUILD_IRQ(0x3a, (1 << 9)) /* dma3 */ 109BUILD_IRQ(0x3a)
97BUILD_IRQ(0x3b, (1 << 10)) /* dma4 */ 110BUILD_IRQ(0x3b)
98BUILD_IRQ(0x3c, (1 << 11)) /* dma5 */ 111BUILD_IRQ(0x3c)
99BUILD_IRQ(0x3d, (1 << 12)) /* dma6 */ 112BUILD_IRQ(0x3d)
100BUILD_IRQ(0x3e, (1 << 13)) /* dma7 */ 113BUILD_IRQ(0x3e)
101BUILD_IRQ(0x3f, (1 << 14)) /* dma8 */ 114BUILD_IRQ(0x3f)
102BUILD_IRQ(0x40, (1 << 15)) /* dma9 */ 115BUILD_IRQ(0x40)
103BUILD_IRQ(0x41, (1 << 16)) /* ata */ 116BUILD_IRQ(0x41)
104BUILD_IRQ(0x42, (1 << 17)) /* sser0 */ 117BUILD_IRQ(0x42)
105BUILD_IRQ(0x43, (1 << 18)) /* sser1 */ 118BUILD_IRQ(0x43)
106BUILD_IRQ(0x44, (1 << 19)) /* ser0 */ 119BUILD_IRQ(0x44)
107BUILD_IRQ(0x45, (1 << 20)) /* ser1 */ 120BUILD_IRQ(0x45)
108BUILD_IRQ(0x46, (1 << 21)) /* ser2 */ 121BUILD_IRQ(0x46)
109BUILD_IRQ(0x47, (1 << 22)) /* ser3 */ 122BUILD_IRQ(0x47)
110BUILD_IRQ(0x48, (1 << 23)) 123BUILD_IRQ(0x48)
111BUILD_IRQ(0x49, (1 << 24)) /* eth0 */ 124BUILD_IRQ(0x49)
112BUILD_IRQ(0x4a, (1 << 25)) /* eth1 */ 125BUILD_IRQ(0x4a)
113BUILD_TIMER_IRQ(0x4b, (1 << 26))/* timer */ 126BUILD_IRQ(0x4b)
114BUILD_IRQ(0x4c, (1 << 27)) /* bif_arb */ 127BUILD_IRQ(0x4c)
115BUILD_IRQ(0x4d, (1 << 28)) /* bif_dma */ 128BUILD_IRQ(0x4d)
116BUILD_IRQ(0x4e, (1 << 29)) /* ext */ 129BUILD_IRQ(0x4e)
117BUILD_IRQ(0x4f, (1 << 29)) /* ipi */ 130BUILD_IRQ(0x4f)
131BUILD_IRQ(0x50)
132#if MACH_IRQS > 32
133BUILD_IRQ(0x51)
134BUILD_IRQ(0x52)
135BUILD_IRQ(0x53)
136BUILD_IRQ(0x54)
137BUILD_IRQ(0x55)
138BUILD_IRQ(0x56)
139BUILD_IRQ(0x57)
140BUILD_IRQ(0x58)
141BUILD_IRQ(0x59)
142BUILD_IRQ(0x5a)
143BUILD_IRQ(0x5b)
144BUILD_IRQ(0x5c)
145BUILD_IRQ(0x5d)
146BUILD_IRQ(0x5e)
147BUILD_IRQ(0x5f)
148BUILD_IRQ(0x60)
149BUILD_IRQ(0x61)
150BUILD_IRQ(0x62)
151BUILD_IRQ(0x63)
152BUILD_IRQ(0x64)
153BUILD_IRQ(0x65)
154BUILD_IRQ(0x66)
155BUILD_IRQ(0x67)
156BUILD_IRQ(0x68)
157BUILD_IRQ(0x69)
158BUILD_IRQ(0x6a)
159BUILD_IRQ(0x6b)
160BUILD_IRQ(0x6c)
161BUILD_IRQ(0x6d)
162BUILD_IRQ(0x6e)
163BUILD_IRQ(0x6f)
164BUILD_IRQ(0x70)
165#endif
118 166
119/* Pointers to the low-level handlers. */ 167/* Pointers to the low-level handlers. */
120static void (*interrupt[NR_IRQS])(void) = { 168static void (*interrupt[MACH_IRQS])(void) = {
121 IRQ0x31_interrupt, IRQ0x32_interrupt, IRQ0x33_interrupt, 169 IRQ0x31_interrupt, IRQ0x32_interrupt, IRQ0x33_interrupt,
122 IRQ0x34_interrupt, IRQ0x35_interrupt, IRQ0x36_interrupt, 170 IRQ0x34_interrupt, IRQ0x35_interrupt, IRQ0x36_interrupt,
123 IRQ0x37_interrupt, IRQ0x38_interrupt, IRQ0x39_interrupt, 171 IRQ0x37_interrupt, IRQ0x38_interrupt, IRQ0x39_interrupt,
@@ -128,7 +176,20 @@ static void (*interrupt[NR_IRQS])(void) = {
128 IRQ0x46_interrupt, IRQ0x47_interrupt, IRQ0x48_interrupt, 176 IRQ0x46_interrupt, IRQ0x47_interrupt, IRQ0x48_interrupt,
129 IRQ0x49_interrupt, IRQ0x4a_interrupt, IRQ0x4b_interrupt, 177 IRQ0x49_interrupt, IRQ0x4a_interrupt, IRQ0x4b_interrupt,
130 IRQ0x4c_interrupt, IRQ0x4d_interrupt, IRQ0x4e_interrupt, 178 IRQ0x4c_interrupt, IRQ0x4d_interrupt, IRQ0x4e_interrupt,
131 IRQ0x4f_interrupt 179 IRQ0x4f_interrupt, IRQ0x50_interrupt,
180#if MACH_IRQS > 32
181 IRQ0x51_interrupt, IRQ0x52_interrupt, IRQ0x53_interrupt,
182 IRQ0x54_interrupt, IRQ0x55_interrupt, IRQ0x56_interrupt,
183 IRQ0x57_interrupt, IRQ0x58_interrupt, IRQ0x59_interrupt,
184 IRQ0x5a_interrupt, IRQ0x5b_interrupt, IRQ0x5c_interrupt,
185 IRQ0x5d_interrupt, IRQ0x5e_interrupt, IRQ0x5f_interrupt,
186 IRQ0x60_interrupt, IRQ0x61_interrupt, IRQ0x62_interrupt,
187 IRQ0x63_interrupt, IRQ0x64_interrupt, IRQ0x65_interrupt,
188 IRQ0x66_interrupt, IRQ0x67_interrupt, IRQ0x68_interrupt,
189 IRQ0x69_interrupt, IRQ0x6a_interrupt, IRQ0x6b_interrupt,
190 IRQ0x6c_interrupt, IRQ0x6d_interrupt, IRQ0x6e_interrupt,
191 IRQ0x6f_interrupt, IRQ0x70_interrupt,
192#endif
132}; 193};
133 194
134void 195void
@@ -137,13 +198,26 @@ block_irq(int irq, int cpu)
137 int intr_mask; 198 int intr_mask;
138 unsigned long flags; 199 unsigned long flags;
139 200
140 spin_lock_irqsave(&irq_lock, flags); 201 spin_lock_irqsave(&irq_lock, flags);
141 intr_mask = REG_RD_INT(intr_vect, irq_regs[cpu], rw_mask); 202 if (irq - FIRST_IRQ < 32)
142 203 intr_mask = REG_RD_INT_VECT(intr_vect, irq_regs[cpu],
143 /* Remember; 1 let through, 0 block. */ 204 rw_mask, 0);
144 intr_mask &= ~(1 << (irq - FIRST_IRQ)); 205 else
145 206 intr_mask = REG_RD_INT_VECT(intr_vect, irq_regs[cpu],
146 REG_WR_INT(intr_vect, irq_regs[cpu], rw_mask, intr_mask); 207 rw_mask, 1);
208
209 /* Remember; 1 let thru, 0 block. */
210 if (irq - FIRST_IRQ < 32)
211 intr_mask &= ~(1 << (irq - FIRST_IRQ));
212 else
213 intr_mask &= ~(1 << (irq - FIRST_IRQ - 32));
214
215 if (irq - FIRST_IRQ < 32)
216 REG_WR_INT_VECT(intr_vect, irq_regs[cpu], rw_mask,
217 0, intr_mask);
218 else
219 REG_WR_INT_VECT(intr_vect, irq_regs[cpu], rw_mask,
220 1, intr_mask);
147 spin_unlock_irqrestore(&irq_lock, flags); 221 spin_unlock_irqrestore(&irq_lock, flags);
148} 222}
149 223
@@ -154,12 +228,26 @@ unblock_irq(int irq, int cpu)
154 unsigned long flags; 228 unsigned long flags;
155 229
156 spin_lock_irqsave(&irq_lock, flags); 230 spin_lock_irqsave(&irq_lock, flags);
157 intr_mask = REG_RD_INT(intr_vect, irq_regs[cpu], rw_mask); 231 if (irq - FIRST_IRQ < 32)
158 232 intr_mask = REG_RD_INT_VECT(intr_vect, irq_regs[cpu],
159 /* Remember; 1 let through, 0 block. */ 233 rw_mask, 0);
160 intr_mask |= (1 << (irq - FIRST_IRQ)); 234 else
235 intr_mask = REG_RD_INT_VECT(intr_vect, irq_regs[cpu],
236 rw_mask, 1);
237
238 /* Remember; 1 let thru, 0 block. */
239 if (irq - FIRST_IRQ < 32)
240 intr_mask |= (1 << (irq - FIRST_IRQ));
241 else
242 intr_mask |= (1 << (irq - FIRST_IRQ - 32));
243
244 if (irq - FIRST_IRQ < 32)
245 REG_WR_INT_VECT(intr_vect, irq_regs[cpu], rw_mask,
246 0, intr_mask);
247 else
248 REG_WR_INT_VECT(intr_vect, irq_regs[cpu], rw_mask,
249 1, intr_mask);
161 250
162 REG_WR_INT(intr_vect, irq_regs[cpu], rw_mask, intr_mask);
163 spin_unlock_irqrestore(&irq_lock, flags); 251 spin_unlock_irqrestore(&irq_lock, flags);
164} 252}
165 253
@@ -298,8 +386,9 @@ crisv32_do_multiple(struct pt_regs* regs)
298{ 386{
299 int cpu; 387 int cpu;
300 int mask; 388 int mask;
301 int masked; 389 int masked[NBR_REGS];
302 int bit; 390 int bit;
391 int i;
303 392
304 cpu = smp_processor_id(); 393 cpu = smp_processor_id();
305 394
@@ -308,42 +397,59 @@ crisv32_do_multiple(struct pt_regs* regs)
308 */ 397 */
309 irq_enter(); 398 irq_enter();
310 399
311 /* Get which IRQs that happened. */ 400 for (i = 0; i < NBR_REGS; i++) {
312 masked = REG_RD_INT(intr_vect, irq_regs[cpu], r_masked_vect); 401 /* Get which IRQs that happend. */
402 masked[i] = REG_RD_INT_VECT(intr_vect, irq_regs[cpu],
403 r_masked_vect, i);
313 404
314 /* Calculate new IRQ mask with these IRQs disabled. */ 405 /* Calculate new IRQ mask with these IRQs disabled. */
315 mask = REG_RD_INT(intr_vect, irq_regs[cpu], rw_mask); 406 mask = REG_RD_INT_VECT(intr_vect, irq_regs[cpu], rw_mask, i);
316 mask &= ~masked; 407 mask &= ~masked[i];
317 408
318 /* Timer IRQ is never masked */ 409 /* Timer IRQ is never masked */
319 if (masked & TIMER_MASK) 410#ifdef TIMER_VECT1
320 mask |= TIMER_MASK; 411 if ((i == 1) && (masked[0] & TIMER_MASK))
321 412 mask |= TIMER_MASK;
322 /* Block all the IRQs */ 413#else
323 REG_WR_INT(intr_vect, irq_regs[cpu], rw_mask, mask); 414 if ((i == 0) && (masked[0] & TIMER_MASK))
415 mask |= TIMER_MASK;
416#endif
417 /* Block all the IRQs */
418 REG_WR_INT_VECT(intr_vect, irq_regs[cpu], rw_mask, i, mask);
324 419
325 /* Check for timer IRQ and handle it special. */ 420 /* Check for timer IRQ and handle it special. */
326 if (masked & TIMER_MASK) { 421#ifdef TIMER_VECT1
327 masked &= ~TIMER_MASK; 422 if ((i == 1) && (masked[i] & TIMER_MASK)) {
328 do_IRQ(TIMER_INTR_VECT, regs); 423 masked[i] &= ~TIMER_MASK;
424 do_IRQ(TIMER0_INTR_VECT, regs);
425 }
426#else
427 if ((i == 0) && (masked[i] & TIMER_MASK)) {
428 masked[i] &= ~TIMER_MASK;
429 do_IRQ(TIMER0_INTR_VECT, regs);
430 }
329 } 431 }
432#endif
330 433
331#ifdef IGNORE_MASK 434#ifdef IGNORE_MASK
332 /* Remove IRQs that can't be handled as multiple. */ 435 /* Remove IRQs that can't be handled as multiple. */
333 masked &= ~IGNORE_MASK; 436 masked[0] &= ~IGNORE_MASK;
334#endif 437#endif
335 438
336 /* Handle the rest of the IRQs. */ 439 /* Handle the rest of the IRQs. */
337 for (bit = 0; bit < 32; bit++) 440 for (i = 0; i < NBR_REGS; i++) {
338 { 441 for (bit = 0; bit < 32; bit++) {
339 if (masked & (1 << bit)) 442 if (masked[i] & (1 << bit))
340 do_IRQ(bit + FIRST_IRQ, regs); 443 do_IRQ(bit + FIRST_IRQ + i*32, regs);
444 }
341 } 445 }
342 446
343 /* Unblock all the IRQs. */ 447 /* Unblock all the IRQs. */
344 mask = REG_RD_INT(intr_vect, irq_regs[cpu], rw_mask); 448 for (i = 0; i < NBR_REGS; i++) {
345 mask |= masked; 449 mask = REG_RD_INT_VECT(intr_vect, irq_regs[cpu], rw_mask, i);
346 REG_WR_INT(intr_vect, irq_regs[cpu], rw_mask, mask); 450 mask |= masked[i];
451 REG_WR_INT_VECT(intr_vect, irq_regs[cpu], rw_mask, i, mask);
452 }
347 453
348 /* This irq_exit() will trigger the soft IRQs. */ 454 /* This irq_exit() will trigger the soft IRQs. */
349 irq_exit(); 455 irq_exit();
@@ -361,20 +467,21 @@ init_IRQ(void)
361 reg_intr_vect_rw_mask vect_mask = {0}; 467 reg_intr_vect_rw_mask vect_mask = {0};
362 468
363 /* Clear all interrupts masks. */ 469 /* Clear all interrupts masks. */
364 REG_WR(intr_vect, regi_irq, rw_mask, vect_mask); 470 for (i = 0; i < NBR_REGS; i++)
471 REG_WR_VECT(intr_vect, regi_irq, rw_mask, i, vect_mask);
365 472
366 for (i = 0; i < 256; i++) 473 for (i = 0; i < 256; i++)
367 etrax_irv->v[i] = weird_irq; 474 etrax_irv->v[i] = weird_irq;
368 475
369 /* Point all IRQs to bad handlers. */ 476 /* Point all IRQ's to bad handlers. */
370 for (i = FIRST_IRQ, j = 0; j < NR_IRQS; i++, j++) { 477 for (i = FIRST_IRQ, j = 0; j < NR_IRQS; i++, j++) {
371 irq_desc[j].chip = &crisv32_irq_type; 478 irq_desc[j].chip = &crisv32_irq_type;
372 set_exception_vector(i, interrupt[j]); 479 set_exception_vector(i, interrupt[j]);
373 } 480 }
374 481
375 /* Mark Timer and IPI IRQs as CPU local */ 482 /* Mark Timer and IPI IRQs as CPU local */
376 irq_allocations[TIMER_INTR_VECT - FIRST_IRQ].cpu = CPU_FIXED; 483 irq_allocations[TIMER0_INTR_VECT - FIRST_IRQ].cpu = CPU_FIXED;
377 irq_desc[TIMER_INTR_VECT].status |= IRQ_PER_CPU; 484 irq_desc[TIMER0_INTR_VECT].status |= IRQ_PER_CPU;
378 irq_allocations[IPI_INTR_VECT - FIRST_IRQ].cpu = CPU_FIXED; 485 irq_allocations[IPI_INTR_VECT - FIRST_IRQ].cpu = CPU_FIXED;
379 irq_desc[IPI_INTR_VECT].status |= IRQ_PER_CPU; 486 irq_desc[IPI_INTR_VECT].status |= IRQ_PER_CPU;
380 487
@@ -391,6 +498,11 @@ init_IRQ(void)
391 set_exception_vector(0x0a, d_mmu_access); 498 set_exception_vector(0x0a, d_mmu_access);
392 set_exception_vector(0x0b, d_mmu_write); 499 set_exception_vector(0x0b, d_mmu_write);
393 500
501#ifdef CONFIG_BUG
502 /* Break 14 handler, used to implement cheap BUG(). */
503 set_exception_vector(0x1e, breakh_BUG);
504#endif
505
394 /* The system-call trap is reached by "break 13". */ 506 /* The system-call trap is reached by "break 13". */
395 set_exception_vector(0x1d, system_call); 507 set_exception_vector(0x1d, system_call);
396 508
diff --git a/arch/cris/arch-v32/kernel/kgdb.c b/arch/cris/arch-v32/kernel/kgdb.c
index 480e56348be2..4e2e2e271efb 100644
--- a/arch/cris/arch-v32/kernel/kgdb.c
+++ b/arch/cris/arch-v32/kernel/kgdb.c
@@ -381,7 +381,7 @@ static int read_register(char regno, unsigned int *valptr);
381/* Serial port, reads one character. ETRAX 100 specific. from debugport.c */ 381/* Serial port, reads one character. ETRAX 100 specific. from debugport.c */
382int getDebugChar(void); 382int getDebugChar(void);
383 383
384#ifdef CONFIG_ETRAXFS_SIM 384#ifdef CONFIG_ETRAX_VCS_SIM
385int getDebugChar(void) 385int getDebugChar(void)
386{ 386{
387 return socketread(); 387 return socketread();
@@ -391,7 +391,7 @@ int getDebugChar(void)
391/* Serial port, writes one character. ETRAX 100 specific. from debugport.c */ 391/* Serial port, writes one character. ETRAX 100 specific. from debugport.c */
392void putDebugChar(int val); 392void putDebugChar(int val);
393 393
394#ifdef CONFIG_ETRAXFS_SIM 394#ifdef CONFIG_ETRAX_VCS_SIM
395void putDebugChar(int val) 395void putDebugChar(int val)
396{ 396{
397 socketwrite((char *)&val, 1); 397 socketwrite((char *)&val, 1);
@@ -1599,7 +1599,7 @@ kgdb_init(void)
1599 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask); 1599 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
1600 1600
1601 ser_intr_mask = REG_RD(ser, regi_ser0, rw_intr_mask); 1601 ser_intr_mask = REG_RD(ser, regi_ser0, rw_intr_mask);
1602 ser_intr_mask.data_avail = regk_ser_yes; 1602 ser_intr_mask.dav = regk_ser_yes;
1603 REG_WR(ser, regi_ser0, rw_intr_mask, ser_intr_mask); 1603 REG_WR(ser, regi_ser0, rw_intr_mask, ser_intr_mask);
1604#elif defined(CONFIG_ETRAX_KGDB_PORT1) 1604#elif defined(CONFIG_ETRAX_KGDB_PORT1)
1605 /* Note: no shortcut registered (not handled by multiple_interrupt). 1605 /* Note: no shortcut registered (not handled by multiple_interrupt).
@@ -1611,7 +1611,7 @@ kgdb_init(void)
1611 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask); 1611 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
1612 1612
1613 ser_intr_mask = REG_RD(ser, regi_ser1, rw_intr_mask); 1613 ser_intr_mask = REG_RD(ser, regi_ser1, rw_intr_mask);
1614 ser_intr_mask.data_avail = regk_ser_yes; 1614 ser_intr_mask.dav = regk_ser_yes;
1615 REG_WR(ser, regi_ser1, rw_intr_mask, ser_intr_mask); 1615 REG_WR(ser, regi_ser1, rw_intr_mask, ser_intr_mask);
1616#elif defined(CONFIG_ETRAX_KGDB_PORT2) 1616#elif defined(CONFIG_ETRAX_KGDB_PORT2)
1617 /* Note: no shortcut registered (not handled by multiple_interrupt). 1617 /* Note: no shortcut registered (not handled by multiple_interrupt).
@@ -1623,7 +1623,7 @@ kgdb_init(void)
1623 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask); 1623 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
1624 1624
1625 ser_intr_mask = REG_RD(ser, regi_ser2, rw_intr_mask); 1625 ser_intr_mask = REG_RD(ser, regi_ser2, rw_intr_mask);
1626 ser_intr_mask.data_avail = regk_ser_yes; 1626 ser_intr_mask.dav = regk_ser_yes;
1627 REG_WR(ser, regi_ser2, rw_intr_mask, ser_intr_mask); 1627 REG_WR(ser, regi_ser2, rw_intr_mask, ser_intr_mask);
1628#elif defined(CONFIG_ETRAX_KGDB_PORT3) 1628#elif defined(CONFIG_ETRAX_KGDB_PORT3)
1629 /* Note: no shortcut registered (not handled by multiple_interrupt). 1629 /* Note: no shortcut registered (not handled by multiple_interrupt).
@@ -1635,7 +1635,7 @@ kgdb_init(void)
1635 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask); 1635 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
1636 1636
1637 ser_intr_mask = REG_RD(ser, regi_ser3, rw_intr_mask); 1637 ser_intr_mask = REG_RD(ser, regi_ser3, rw_intr_mask);
1638 ser_intr_mask.data_avail = regk_ser_yes; 1638 ser_intr_mask.dav = regk_ser_yes;
1639 REG_WR(ser, regi_ser3, rw_intr_mask, ser_intr_mask); 1639 REG_WR(ser, regi_ser3, rw_intr_mask, ser_intr_mask);
1640#endif 1640#endif
1641 1641
diff --git a/arch/cris/arch-v32/kernel/process.c b/arch/cris/arch-v32/kernel/process.c
index b72a15580dc7..ced5b725d9bd 100644
--- a/arch/cris/arch-v32/kernel/process.c
+++ b/arch/cris/arch-v32/kernel/process.c
@@ -12,17 +12,13 @@
12#include <linux/err.h> 12#include <linux/err.h>
13#include <linux/fs.h> 13#include <linux/fs.h>
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <asm/arch/hwregs/reg_rdwr.h> 15#include <hwregs/reg_rdwr.h>
16#include <asm/arch/hwregs/reg_map.h> 16#include <hwregs/reg_map.h>
17#include <asm/arch/hwregs/timer_defs.h> 17#include <hwregs/timer_defs.h>
18#include <asm/arch/hwregs/intr_vect_defs.h> 18#include <hwregs/intr_vect_defs.h>
19 19
20extern void stop_watchdog(void); 20extern void stop_watchdog(void);
21 21
22#ifdef CONFIG_ETRAX_GPIO
23extern void etrax_gpio_wake_up_check(void); /* Defined in drivers/gpio.c. */
24#endif
25
26extern int cris_hlt_counter; 22extern int cris_hlt_counter;
27 23
28/* We use this if we don't have any better idle routine. */ 24/* We use this if we don't have any better idle routine. */
@@ -82,7 +78,7 @@ hard_reset_now(void)
82 wd_ctrl.cmd = regk_timer_start; 78 wd_ctrl.cmd = regk_timer_start;
83 79
84 arch_enable_nmi(); 80 arch_enable_nmi();
85 REG_WR(timer, regi_timer, rw_wd_ctrl, wd_ctrl); 81 REG_WR(timer, regi_timer0, rw_wd_ctrl, wd_ctrl);
86} 82}
87#endif 83#endif
88 84
diff --git a/arch/cris/arch-v32/kernel/ptrace.c b/arch/cris/arch-v32/kernel/ptrace.c
index 2df60529a8af..e27f4670e88e 100644
--- a/arch/cris/arch-v32/kernel/ptrace.c
+++ b/arch/cris/arch-v32/kernel/ptrace.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2000-2003, Axis Communications AB. 2 * Copyright (C) 2000-2007, Axis Communications AB.
3 */ 3 */
4 4
5#include <linux/kernel.h> 5#include <linux/kernel.h>
@@ -149,7 +149,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
149 ret = generic_ptrace_pokedata(child, addr, data); 149 ret = generic_ptrace_pokedata(child, addr, data);
150 break; 150 break;
151 151
152 /* Write the word at location address in the USER area. */ 152 /* Write the word at location address in the USER area. */
153 case PTRACE_POKEUSR: 153 case PTRACE_POKEUSR:
154 ret = -EIO; 154 ret = -EIO;
155 if ((addr & 3) || addr < 0 || addr > PT_MAX << 2) 155 if ((addr & 3) || addr < 0 || addr > PT_MAX << 2)
@@ -201,7 +201,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
201 201
202 break; 202 break;
203 203
204 /* Make the child exit by sending it a sigkill. */ 204 /* Make the child exit by sending it a sigkill. */
205 case PTRACE_KILL: 205 case PTRACE_KILL:
206 ret = 0; 206 ret = 0;
207 207
@@ -245,9 +245,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
245 break; 245 break;
246 246
247 } 247 }
248
248 /* Get all GP registers from the child. */ 249 /* Get all GP registers from the child. */
249 case PTRACE_GETREGS: { 250 case PTRACE_GETREGS: {
250 int i; 251 int i;
251 unsigned long tmp; 252 unsigned long tmp;
252 253
253 for (i = 0; i <= PT_MAX; i++) { 254 for (i = 0; i <= PT_MAX; i++) {
@@ -294,6 +295,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
294 break; 295 break;
295 } 296 }
296 297
298out_tsk:
297 return ret; 299 return ret;
298} 300}
299 301
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c
index 024cc6901974..58c1866804e3 100644
--- a/arch/cris/arch-v32/kernel/signal.c
+++ b/arch/cris/arch-v32/kernel/signal.c
@@ -50,7 +50,7 @@ struct rt_signal_frame {
50 unsigned char retcode[8]; /* Trampoline code. */ 50 unsigned char retcode[8]; /* Trampoline code. */
51}; 51};
52 52
53int do_signal(int restart, sigset_t *oldset, struct pt_regs *regs); 53void do_signal(int restart, struct pt_regs *regs);
54void keep_debug_flags(unsigned long oldccs, unsigned long oldspc, 54void keep_debug_flags(unsigned long oldccs, unsigned long oldspc,
55 struct pt_regs *regs); 55 struct pt_regs *regs);
56/* 56/*
@@ -61,74 +61,16 @@ int
61sys_sigsuspend(old_sigset_t mask, long r11, long r12, long r13, long mof, 61sys_sigsuspend(old_sigset_t mask, long r11, long r12, long r13, long mof,
62 long srp, struct pt_regs *regs) 62 long srp, struct pt_regs *regs)
63{ 63{
64 sigset_t saveset;
65
66 mask &= _BLOCKABLE; 64 mask &= _BLOCKABLE;
67
68 spin_lock_irq(&current->sighand->siglock); 65 spin_lock_irq(&current->sighand->siglock);
69 66 current->saved_sigmask = current->blocked;
70 saveset = current->blocked;
71
72 siginitset(&current->blocked, mask); 67 siginitset(&current->blocked, mask);
73
74 recalc_sigpending();
75 spin_unlock_irq(&current->sighand->siglock);
76
77 regs->r10 = -EINTR;
78
79 while (1) {
80 current->state = TASK_INTERRUPTIBLE;
81 schedule();
82
83 if (do_signal(0, &saveset, regs)) {
84 /*
85 * This point is reached twice: once to call
86 * the signal handler, then again to return
87 * from the sigsuspend system call. When
88 * calling the signal handler, R10 hold the
89 * signal number as set by do_signal(). The
90 * sigsuspend call will always return with
91 * the restored value above; -EINTR.
92 */
93 return regs->r10;
94 }
95 }
96}
97
98/* Define some dummy arguments to be able to reach the regs argument. */
99int
100sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, long r12, long r13,
101 long mof, long srp, struct pt_regs *regs)
102{
103 sigset_t saveset;
104 sigset_t newset;
105
106 if (sigsetsize != sizeof(sigset_t))
107 return -EINVAL;
108
109 if (copy_from_user(&newset, unewset, sizeof(newset)))
110 return -EFAULT;
111
112 sigdelsetmask(&newset, ~_BLOCKABLE);
113 spin_lock_irq(&current->sighand->siglock);
114
115 saveset = current->blocked;
116 current->blocked = newset;
117
118 recalc_sigpending(); 68 recalc_sigpending();
119 spin_unlock_irq(&current->sighand->siglock); 69 spin_unlock_irq(&current->sighand->siglock);
120 70 current->state = TASK_INTERRUPTIBLE;
121 regs->r10 = -EINTR; 71 schedule();
122 72 set_thread_flag(TIF_RESTORE_SIGMASK);
123 while (1) { 73 return -ERESTARTNOHAND;
124 current->state = TASK_INTERRUPTIBLE;
125 schedule();
126
127 if (do_signal(0, &saveset, regs)) {
128 /* See comment in function above. */
129 return regs->r10;
130 }
131 }
132} 74}
133 75
134int 76int
@@ -290,7 +232,7 @@ sys_rt_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp,
290 goto badframe; 232 goto badframe;
291 233
292 if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT) 234 if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT)
293 goto badframe; 235 goto badframe;
294 236
295 keep_debug_flags(oldccs, oldspc, regs); 237 keep_debug_flags(oldccs, oldspc, regs);
296 238
@@ -347,11 +289,11 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
347/* Grab and setup a signal frame. 289/* Grab and setup a signal frame.
348 * 290 *
349 * Basically a lot of state-info is stacked, and arranged for the 291 * Basically a lot of state-info is stacked, and arranged for the
350 * user-mode program to return to the kernel using either a trampoline 292 * user-mode program to return to the kernel using either a trampiline
351 * which performs the syscall sigreturn(), or a provided user-mode 293 * which performs the syscall sigreturn(), or a provided user-mode
352 * trampoline. 294 * trampoline.
353 */ 295 */
354static void 296static int
355setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, 297setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
356 struct pt_regs * regs) 298 struct pt_regs * regs)
357{ 299{
@@ -417,16 +359,17 @@ setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
417 /* Actually move the USP to reflect the stacked frame. */ 359 /* Actually move the USP to reflect the stacked frame. */
418 wrusp((unsigned long)frame); 360 wrusp((unsigned long)frame);
419 361
420 return; 362 return 0;
421 363
422give_sigsegv: 364give_sigsegv:
423 if (sig == SIGSEGV) 365 if (sig == SIGSEGV)
424 ka->sa.sa_handler = SIG_DFL; 366 ka->sa.sa_handler = SIG_DFL;
425 367
426 force_sig(SIGSEGV, current); 368 force_sig(SIGSEGV, current);
369 return -EFAULT;
427} 370}
428 371
429static void 372static int
430setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 373setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
431 sigset_t *set, struct pt_regs * regs) 374 sigset_t *set, struct pt_regs * regs)
432{ 375{
@@ -503,21 +446,24 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
503 /* Actually move the usp to reflect the stacked frame. */ 446 /* Actually move the usp to reflect the stacked frame. */
504 wrusp((unsigned long)frame); 447 wrusp((unsigned long)frame);
505 448
506 return; 449 return 0;
507 450
508give_sigsegv: 451give_sigsegv:
509 if (sig == SIGSEGV) 452 if (sig == SIGSEGV)
510 ka->sa.sa_handler = SIG_DFL; 453 ka->sa.sa_handler = SIG_DFL;
511 454
512 force_sig(SIGSEGV, current); 455 force_sig(SIGSEGV, current);
456 return -EFAULT;
513} 457}
514 458
515/* Invoke a singal handler to, well, handle the signal. */ 459/* Invoke a singal handler to, well, handle the signal. */
516static inline void 460static inline int
517handle_signal(int canrestart, unsigned long sig, 461handle_signal(int canrestart, unsigned long sig,
518 siginfo_t *info, struct k_sigaction *ka, 462 siginfo_t *info, struct k_sigaction *ka,
519 sigset_t *oldset, struct pt_regs * regs) 463 sigset_t *oldset, struct pt_regs * regs)
520{ 464{
465 int ret;
466
521 /* Check if this got called from a system call. */ 467 /* Check if this got called from a system call. */
522 if (canrestart) { 468 if (canrestart) {
523 /* If so, check system call restarting. */ 469 /* If so, check system call restarting. */
@@ -561,19 +507,24 @@ handle_signal(int canrestart, unsigned long sig,
561 507
562 /* Set up the stack frame. */ 508 /* Set up the stack frame. */
563 if (ka->sa.sa_flags & SA_SIGINFO) 509 if (ka->sa.sa_flags & SA_SIGINFO)
564 setup_rt_frame(sig, ka, info, oldset, regs); 510 ret = setup_rt_frame(sig, ka, info, oldset, regs);
565 else 511 else
566 setup_frame(sig, ka, oldset, regs); 512 ret = setup_frame(sig, ka, oldset, regs);
567 513
568 if (ka->sa.sa_flags & SA_ONESHOT) 514 if (ka->sa.sa_flags & SA_ONESHOT)
569 ka->sa.sa_handler = SIG_DFL; 515 ka->sa.sa_handler = SIG_DFL;
570 516
571 spin_lock_irq(&current->sighand->siglock); 517 if (ret == 0) {
572 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 518 spin_lock_irq(&current->sighand->siglock);
573 if (!(ka->sa.sa_flags & SA_NODEFER)) 519 sigorsets(&current->blocked, &current->blocked,
574 sigaddset(&current->blocked,sig); 520 &ka->sa.sa_mask);
575 recalc_sigpending(); 521 if (!(ka->sa.sa_flags & SA_NODEFER))
576 spin_unlock_irq(&current->sighand->siglock); 522 sigaddset(&current->blocked, sig);
523 recalc_sigpending();
524 spin_unlock_irq(&current->sighand->siglock);
525 }
526
527 return ret;
577} 528}
578 529
579/* 530/*
@@ -587,12 +538,13 @@ handle_signal(int canrestart, unsigned long sig,
587 * we can use user_mode(regs) to see if we came directly from kernel or user 538 * we can use user_mode(regs) to see if we came directly from kernel or user
588 * mode below. 539 * mode below.
589 */ 540 */
590int 541void
591do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs) 542do_signal(int canrestart, struct pt_regs *regs)
592{ 543{
593 int signr; 544 int signr;
594 siginfo_t info; 545 siginfo_t info;
595 struct k_sigaction ka; 546 struct k_sigaction ka;
547 sigset_t *oldset;
596 548
597 /* 549 /*
598 * The common case should go fast, which is why this point is 550 * The common case should go fast, which is why this point is
@@ -600,17 +552,28 @@ do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs)
600 * without doing anything. 552 * without doing anything.
601 */ 553 */
602 if (!user_mode(regs)) 554 if (!user_mode(regs))
603 return 1; 555 return;
604 556
605 if (!oldset) 557 if (test_thread_flag(TIF_RESTORE_SIGMASK))
558 oldset = &current->saved_sigmask;
559 else
606 oldset = &current->blocked; 560 oldset = &current->blocked;
607 561
608 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 562 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
609 563
610 if (signr > 0) { 564 if (signr > 0) {
611 /* Deliver the signal. */ 565 /* Whee! Actually deliver the signal. */
612 handle_signal(canrestart, signr, &info, &ka, oldset, regs); 566 if (handle_signal(canrestart, signr, &info, &ka,
613 return 1; 567 oldset, regs)) {
568 /* a signal was successfully delivered; the saved
569 * sigmask will have been stored in the signal frame,
570 * and will be restored by sigreturn, so we can simply
571 * clear the TIF_RESTORE_SIGMASK flag */
572 if (test_thread_flag(TIF_RESTORE_SIGMASK))
573 clear_thread_flag(TIF_RESTORE_SIGMASK);
574 }
575
576 return;
614 } 577 }
615 578
616 /* Got here from a system call? */ 579 /* Got here from a system call? */
@@ -628,7 +591,12 @@ do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs)
628 } 591 }
629 } 592 }
630 593
631 return 0; 594 /* if there's no signal to deliver, we just put the saved sigmask
595 * back */
596 if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
597 clear_thread_flag(TIF_RESTORE_SIGMASK);
598 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
599 }
632} 600}
633 601
634asmlinkage void 602asmlinkage void
@@ -641,7 +609,7 @@ ugdb_trap_user(struct thread_info *ti, int sig)
641 user_regs(ti)->spc = 0; 609 user_regs(ti)->spc = 0;
642 } 610 }
643 /* FIXME: Filter out false h/w breakpoint hits (i.e. EDA 611 /* FIXME: Filter out false h/w breakpoint hits (i.e. EDA
644 not within any configured h/w breakpoint range). Synchronize with 612 not withing any configured h/w breakpoint range). Synchronize with
645 what already exists for kernel debugging. */ 613 what already exists for kernel debugging. */
646 if (((user_regs(ti)->exs & 0xff00) >> 8) == BREAK_8_INTR_VECT) { 614 if (((user_regs(ti)->exs & 0xff00) >> 8) == BREAK_8_INTR_VECT) {
647 /* Break 8: subtract 2 from ERP unless in a delay slot. */ 615 /* Break 8: subtract 2 from ERP unless in a delay slot. */
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c
index 171c96e0a5d3..a9c3334e46c9 100644
--- a/arch/cris/arch-v32/kernel/smp.c
+++ b/arch/cris/arch-v32/kernel/smp.c
@@ -1,11 +1,12 @@
1#include <linux/types.h>
1#include <asm/delay.h> 2#include <asm/delay.h>
2#include <asm/arch/irq.h> 3#include <irq.h>
3#include <asm/arch/hwregs/intr_vect.h> 4#include <hwregs/intr_vect.h>
4#include <asm/arch/hwregs/intr_vect_defs.h> 5#include <hwregs/intr_vect_defs.h>
5#include <asm/tlbflush.h> 6#include <asm/tlbflush.h>
6#include <asm/mmu_context.h> 7#include <asm/mmu_context.h>
7#include <asm/arch/hwregs/mmu_defs_asm.h> 8#include <hwregs/asm/mmu_defs_asm.h>
8#include <asm/arch/hwregs/supp_reg.h> 9#include <hwregs/supp_reg.h>
9#include <asm/atomic.h> 10#include <asm/atomic.h>
10 11
11#include <linux/err.h> 12#include <linux/err.h>
@@ -20,6 +21,7 @@
20#define IPI_SCHEDULE 1 21#define IPI_SCHEDULE 1
21#define IPI_CALL 2 22#define IPI_CALL 2
22#define IPI_FLUSH_TLB 4 23#define IPI_FLUSH_TLB 4
24#define IPI_BOOT 8
23 25
24#define FLUSH_ALL (void*)0xffffffff 26#define FLUSH_ALL (void*)0xffffffff
25 27
@@ -30,6 +32,8 @@ spinlock_t cris_atomic_locks[] = { [0 ... LOCK_COUNT - 1] = SPIN_LOCK_UNLOCKED};
30cpumask_t cpu_online_map = CPU_MASK_NONE; 32cpumask_t cpu_online_map = CPU_MASK_NONE;
31EXPORT_SYMBOL(cpu_online_map); 33EXPORT_SYMBOL(cpu_online_map);
32cpumask_t phys_cpu_present_map = CPU_MASK_NONE; 34cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
35cpumask_t cpu_possible_map;
36EXPORT_SYMBOL(cpu_possible_map);
33EXPORT_SYMBOL(phys_cpu_present_map); 37EXPORT_SYMBOL(phys_cpu_present_map);
34 38
35/* Variables used during SMP boot */ 39/* Variables used during SMP boot */
@@ -55,13 +59,12 @@ static unsigned long flush_addr;
55extern int setup_irq(int, struct irqaction *); 59extern int setup_irq(int, struct irqaction *);
56 60
57/* Mode registers */ 61/* Mode registers */
58static unsigned long irq_regs[NR_CPUS] = 62static unsigned long irq_regs[NR_CPUS] = {
59{
60 regi_irq, 63 regi_irq,
61 regi_irq2 64 regi_irq2
62}; 65};
63 66
64static irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs); 67static irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id);
65static int send_ipi(int vector, int wait, cpumask_t cpu_mask); 68static int send_ipi(int vector, int wait, cpumask_t cpu_mask);
66static struct irqaction irq_ipi = { 69static struct irqaction irq_ipi = {
67 .handler = crisv32_ipi_interrupt, 70 .handler = crisv32_ipi_interrupt,
@@ -101,6 +104,7 @@ void __devinit smp_prepare_boot_cpu(void)
101 104
102 cpu_set(0, cpu_online_map); 105 cpu_set(0, cpu_online_map);
103 cpu_set(0, phys_cpu_present_map); 106 cpu_set(0, phys_cpu_present_map);
107 cpu_set(0, cpu_possible_map);
104} 108}
105 109
106void __init smp_cpus_done(unsigned int max_cpus) 110void __init smp_cpus_done(unsigned int max_cpus)
@@ -113,6 +117,7 @@ smp_boot_one_cpu(int cpuid)
113{ 117{
114 unsigned timeout; 118 unsigned timeout;
115 struct task_struct *idle; 119 struct task_struct *idle;
120 cpumask_t cpu_mask = CPU_MASK_NONE;
116 121
117 idle = fork_idle(cpuid); 122 idle = fork_idle(cpuid);
118 if (IS_ERR(idle)) 123 if (IS_ERR(idle))
@@ -124,6 +129,12 @@ smp_boot_one_cpu(int cpuid)
124 smp_init_current_idle_thread = task_thread_info(idle); 129 smp_init_current_idle_thread = task_thread_info(idle);
125 cpu_now_booting = cpuid; 130 cpu_now_booting = cpuid;
126 131
132 /* Kick it */
133 cpu_set(cpuid, cpu_online_map);
134 cpu_set(cpuid, cpu_mask);
135 send_ipi(IPI_BOOT, 0, cpu_mask);
136 cpu_clear(cpuid, cpu_online_map);
137
127 /* Wait for CPU to come online */ 138 /* Wait for CPU to come online */
128 for (timeout = 0; timeout < 10000; timeout++) { 139 for (timeout = 0; timeout < 10000; timeout++) {
129 if(cpu_online(cpuid)) { 140 if(cpu_online(cpuid)) {
@@ -165,7 +176,7 @@ void __init smp_callin(void)
165 /* Enable IRQ and idle */ 176 /* Enable IRQ and idle */
166 REG_WR(intr_vect, irq_regs[cpu], rw_mask, vect_mask); 177 REG_WR(intr_vect, irq_regs[cpu], rw_mask, vect_mask);
167 unmask_irq(IPI_INTR_VECT); 178 unmask_irq(IPI_INTR_VECT);
168 unmask_irq(TIMER_INTR_VECT); 179 unmask_irq(TIMER0_INTR_VECT);
169 preempt_disable(); 180 preempt_disable();
170 local_irq_enable(); 181 local_irq_enable();
171 182
@@ -328,7 +339,7 @@ int smp_call_function(void (*func)(void *info), void *info,
328 return ret; 339 return ret;
329} 340}
330 341
331irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs) 342irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id)
332{ 343{
333 void (*func) (void *info) = call_data->func; 344 void (*func) (void *info) = call_data->func;
334 void *info = call_data->info; 345 void *info = call_data->info;
diff --git a/arch/cris/arch-v32/kernel/time.c b/arch/cris/arch-v32/kernel/time.c
index 2f7e8e200f2c..3a13dd6e0a9a 100644
--- a/arch/cris/arch-v32/kernel/time.c
+++ b/arch/cris/arch-v32/kernel/time.c
@@ -1,8 +1,7 @@
1/* $Id: time.c,v 1.19 2005/04/29 05:40:09 starvik Exp $ 1/*
2 *
3 * linux/arch/cris/arch-v32/kernel/time.c 2 * linux/arch/cris/arch-v32/kernel/time.c
4 * 3 *
5 * Copyright (C) 2003 Axis Communications AB 4 * Copyright (C) 2003-2007 Axis Communications AB
6 * 5 *
7 */ 6 */
8 7
@@ -14,28 +13,34 @@
14#include <linux/sched.h> 13#include <linux/sched.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/threads.h> 15#include <linux/threads.h>
16#include <linux/cpufreq.h>
17#include <asm/types.h> 17#include <asm/types.h>
18#include <asm/signal.h> 18#include <asm/signal.h>
19#include <asm/io.h> 19#include <asm/io.h>
20#include <asm/delay.h> 20#include <asm/delay.h>
21#include <asm/rtc.h> 21#include <asm/rtc.h>
22#include <asm/irq.h> 22#include <asm/irq.h>
23 23#include <asm/irq_regs.h>
24#include <asm/arch/hwregs/reg_map.h> 24
25#include <asm/arch/hwregs/reg_rdwr.h> 25#include <hwregs/reg_map.h>
26#include <asm/arch/hwregs/timer_defs.h> 26#include <hwregs/reg_rdwr.h>
27#include <asm/arch/hwregs/intr_vect_defs.h> 27#include <hwregs/timer_defs.h>
28#include <hwregs/intr_vect_defs.h>
29#ifdef CONFIG_CRIS_MACH_ARTPEC3
30#include <hwregs/clkgen_defs.h>
31#endif
28 32
29/* Watchdog defines */ 33/* Watchdog defines */
30#define ETRAX_WD_KEY_MASK 0x7F /* key is 7 bit */ 34#define ETRAX_WD_KEY_MASK 0x7F /* key is 7 bit */
31#define ETRAX_WD_HZ 763 /* watchdog counts at 763 Hz */ 35#define ETRAX_WD_HZ 763 /* watchdog counts at 763 Hz */
32#define ETRAX_WD_CNT ((2*ETRAX_WD_HZ)/HZ + 1) /* Number of 763 counts before watchdog bites */ 36/* Number of 763 counts before watchdog bites */
37#define ETRAX_WD_CNT ((2*ETRAX_WD_HZ)/HZ + 1)
33 38
34unsigned long timer_regs[NR_CPUS] = 39unsigned long timer_regs[NR_CPUS] =
35{ 40{
36 regi_timer, 41 regi_timer0,
37#ifdef CONFIG_SMP 42#ifdef CONFIG_SMP
38 regi_timer2 43 regi_timer2
39#endif 44#endif
40}; 45};
41 46
@@ -44,12 +49,22 @@ extern int set_rtc_mmss(unsigned long nowtime);
44extern int setup_irq(int, struct irqaction *); 49extern int setup_irq(int, struct irqaction *);
45extern int have_rtc; 50extern int have_rtc;
46 51
52#ifdef CONFIG_CPU_FREQ
53static int
54cris_time_freq_notifier(struct notifier_block *nb, unsigned long val,
55 void *data);
56
57static struct notifier_block cris_time_freq_notifier_block = {
58 .notifier_call = cris_time_freq_notifier,
59};
60#endif
61
47unsigned long get_ns_in_jiffie(void) 62unsigned long get_ns_in_jiffie(void)
48{ 63{
49 reg_timer_r_tmr0_data data; 64 reg_timer_r_tmr0_data data;
50 unsigned long ns; 65 unsigned long ns;
51 66
52 data = REG_RD(timer, regi_timer, r_tmr0_data); 67 data = REG_RD(timer, regi_timer0, r_tmr0_data);
53 ns = (TIMER0_DIV - data) * 10; 68 ns = (TIMER0_DIV - data) * 10;
54 return ns; 69 return ns;
55} 70}
@@ -59,31 +74,27 @@ unsigned long do_slow_gettimeoffset(void)
59 unsigned long count; 74 unsigned long count;
60 unsigned long usec_count = 0; 75 unsigned long usec_count = 0;
61 76
62 static unsigned long count_p = TIMER0_DIV;/* for the first call after boot */ 77 /* For the first call after boot */
78 static unsigned long count_p = TIMER0_DIV;
63 static unsigned long jiffies_p = 0; 79 static unsigned long jiffies_p = 0;
64 80
65 /* 81 /* Cache volatile jiffies temporarily; we have IRQs turned off. */
66 * cache volatile jiffies temporarily; we have IRQs turned off.
67 */
68 unsigned long jiffies_t; 82 unsigned long jiffies_t;
69 83
70 /* The timer interrupt comes from Etrax timer 0. In order to get 84 /* The timer interrupt comes from Etrax timer 0. In order to get
71 * better precision, we check the current value. It might have 85 * better precision, we check the current value. It might have
72 * underflowed already though. 86 * underflowed already though. */
73 */ 87 count = REG_RD(timer, regi_timer0, r_tmr0_data);
88 jiffies_t = jiffies;
74 89
75 count = REG_RD(timer, regi_timer, r_tmr0_data); 90 /* Avoiding timer inconsistencies (they are rare, but they happen)
76 jiffies_t = jiffies; 91 * There is one problem that must be avoided here:
77 92 * 1. the timer counter underflows
78 /*
79 * avoiding timer inconsistencies (they are rare, but they happen)...
80 * there are one problem that must be avoided here:
81 * 1. the timer counter underflows
82 */ 93 */
83 if( jiffies_t == jiffies_p ) { 94 if( jiffies_t == jiffies_p ) {
84 if( count > count_p ) { 95 if( count > count_p ) {
85 /* Timer wrapped, use new count and prescale 96 /* Timer wrapped, use new count and prescale.
86 * increase the time corresponding to one jiffie 97 * Increase the time corresponding to one jiffy.
87 */ 98 */
88 usec_count = 1000000/HZ; 99 usec_count = 1000000/HZ;
89 } 100 }
@@ -106,17 +117,15 @@ unsigned long do_slow_gettimeoffset(void)
106 */ 117 */
107/* This gives us 1.3 ms to do something useful when the NMI comes */ 118/* This gives us 1.3 ms to do something useful when the NMI comes */
108 119
109/* right now, starting the watchdog is the same as resetting it */ 120/* Right now, starting the watchdog is the same as resetting it */
110#define start_watchdog reset_watchdog 121#define start_watchdog reset_watchdog
111 122
112#if defined(CONFIG_ETRAX_WATCHDOG) 123#if defined(CONFIG_ETRAX_WATCHDOG)
113static short int watchdog_key = 42; /* arbitrary 7 bit number */ 124static short int watchdog_key = 42; /* arbitrary 7 bit number */
114#endif 125#endif
115 126
116/* number of pages to consider "out of memory". it is normal that the memory 127/* Number of pages to consider "out of memory". It is normal that the memory
117 * is used though, so put this really low. 128 * is used though, so set this really low. */
118 */
119
120#define WATCHDOG_MIN_FREE_PAGES 8 129#define WATCHDOG_MIN_FREE_PAGES 8
121 130
122void 131void
@@ -125,14 +134,15 @@ reset_watchdog(void)
125#if defined(CONFIG_ETRAX_WATCHDOG) 134#if defined(CONFIG_ETRAX_WATCHDOG)
126 reg_timer_rw_wd_ctrl wd_ctrl = { 0 }; 135 reg_timer_rw_wd_ctrl wd_ctrl = { 0 };
127 136
128 /* only keep watchdog happy as long as we have memory left! */ 137 /* Only keep watchdog happy as long as we have memory left! */
129 if(nr_free_pages() > WATCHDOG_MIN_FREE_PAGES) { 138 if(nr_free_pages() > WATCHDOG_MIN_FREE_PAGES) {
130 /* reset the watchdog with the inverse of the old key */ 139 /* Reset the watchdog with the inverse of the old key */
131 watchdog_key ^= ETRAX_WD_KEY_MASK; /* invert key, which is 7 bits */ 140 /* Invert key, which is 7 bits */
141 watchdog_key ^= ETRAX_WD_KEY_MASK;
132 wd_ctrl.cnt = ETRAX_WD_CNT; 142 wd_ctrl.cnt = ETRAX_WD_CNT;
133 wd_ctrl.cmd = regk_timer_start; 143 wd_ctrl.cmd = regk_timer_start;
134 wd_ctrl.key = watchdog_key; 144 wd_ctrl.key = watchdog_key;
135 REG_WR(timer, regi_timer, rw_wd_ctrl, wd_ctrl); 145 REG_WR(timer, regi_timer0, rw_wd_ctrl, wd_ctrl);
136 } 146 }
137#endif 147#endif
138} 148}
@@ -148,7 +158,7 @@ stop_watchdog(void)
148 wd_ctrl.cnt = ETRAX_WD_CNT; 158 wd_ctrl.cnt = ETRAX_WD_CNT;
149 wd_ctrl.cmd = regk_timer_stop; 159 wd_ctrl.cmd = regk_timer_stop;
150 wd_ctrl.key = watchdog_key; 160 wd_ctrl.key = watchdog_key;
151 REG_WR(timer, regi_timer, rw_wd_ctrl, wd_ctrl); 161 REG_WR(timer, regi_timer0, rw_wd_ctrl, wd_ctrl);
152#endif 162#endif
153} 163}
154 164
@@ -160,17 +170,28 @@ handle_watchdog_bite(struct pt_regs* regs)
160#if defined(CONFIG_ETRAX_WATCHDOG) 170#if defined(CONFIG_ETRAX_WATCHDOG)
161 extern int cause_of_death; 171 extern int cause_of_death;
162 172
163 raw_printk("Watchdog bite\n"); 173 oops_in_progress = 1;
174 printk(KERN_WARNING "Watchdog bite\n");
164 175
165 /* Check if forced restart or unexpected watchdog */ 176 /* Check if forced restart or unexpected watchdog */
166 if (cause_of_death == 0xbedead) { 177 if (cause_of_death == 0xbedead) {
178#ifdef CONFIG_CRIS_MACH_ARTPEC3
179 /* There is a bug in Artpec-3 (voodoo TR 78) that requires
180 * us to go to lower frequency for the reset to be reliable
181 */
182 reg_clkgen_rw_clk_ctrl ctrl =
183 REG_RD(clkgen, regi_clkgen, rw_clk_ctrl);
184 ctrl.pll = 0;
185 REG_WR(clkgen, regi_clkgen, rw_clk_ctrl, ctrl);
186#endif
167 while(1); 187 while(1);
168 } 188 }
169 189
170 /* Unexpected watchdog, stop the watchdog and dump registers*/ 190 /* Unexpected watchdog, stop the watchdog and dump registers. */
171 stop_watchdog(); 191 stop_watchdog();
172 raw_printk("Oops: bitten by watchdog\n"); 192 printk(KERN_WARNING "Oops: bitten by watchdog\n");
173 show_registers(regs); 193 show_registers(regs);
194 oops_in_progress = 0;
174#ifndef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY 195#ifndef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY
175 reset_watchdog(); 196 reset_watchdog();
176#endif 197#endif
@@ -178,21 +199,19 @@ handle_watchdog_bite(struct pt_regs* regs)
178#endif 199#endif
179} 200}
180 201
181/* last time the cmos clock got updated */ 202/* Last time the cmos clock got updated. */
182static long last_rtc_update = 0; 203static long last_rtc_update = 0;
183 204
184/* 205/*
185 * timer_interrupt() needs to keep up the real-time clock, 206 * timer_interrupt() needs to keep up the real-time clock,
186 * as well as call the "do_timer()" routine every clocktick 207 * as well as call the "do_timer()" routine every clocktick.
187 */ 208 */
188
189//static unsigned short myjiff; /* used by our debug routine print_timestamp */
190
191extern void cris_do_profile(struct pt_regs *regs); 209extern void cris_do_profile(struct pt_regs *regs);
192 210
193static inline irqreturn_t 211static inline irqreturn_t
194timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 212timer_interrupt(int irq, void *dev_id)
195{ 213{
214 struct pt_regs *regs = get_irq_regs();
196 int cpu = smp_processor_id(); 215 int cpu = smp_processor_id();
197 reg_timer_r_masked_intr masked_intr; 216 reg_timer_r_masked_intr masked_intr;
198 reg_timer_rw_ack_intr ack_intr = { 0 }; 217 reg_timer_rw_ack_intr ack_intr = { 0 };
@@ -202,11 +221,11 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
202 if (!masked_intr.tmr0) 221 if (!masked_intr.tmr0)
203 return IRQ_NONE; 222 return IRQ_NONE;
204 223
205 /* acknowledge the timer irq */ 224 /* Acknowledge the timer irq. */
206 ack_intr.tmr0 = 1; 225 ack_intr.tmr0 = 1;
207 REG_WR(timer, timer_regs[cpu], rw_ack_intr, ack_intr); 226 REG_WR(timer, timer_regs[cpu], rw_ack_intr, ack_intr);
208 227
209 /* reset watchdog otherwise it resets us! */ 228 /* Reset watchdog otherwise it resets us! */
210 reset_watchdog(); 229 reset_watchdog();
211 230
212 /* Update statistics. */ 231 /* Update statistics. */
@@ -218,7 +237,7 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
218 if (cpu != 0) 237 if (cpu != 0)
219 return IRQ_HANDLED; 238 return IRQ_HANDLED;
220 239
221 /* call the real timer interrupt handler */ 240 /* Call the real timer interrupt handler */
222 do_timer(1); 241 do_timer(1);
223 242
224 /* 243 /*
@@ -236,17 +255,17 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
236 if (set_rtc_mmss(xtime.tv_sec) == 0) 255 if (set_rtc_mmss(xtime.tv_sec) == 0)
237 last_rtc_update = xtime.tv_sec; 256 last_rtc_update = xtime.tv_sec;
238 else 257 else
239 last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ 258 /* Do it again in 60 s */
259 last_rtc_update = xtime.tv_sec - 600;
240 } 260 }
241 return IRQ_HANDLED; 261 return IRQ_HANDLED;
242} 262}
243 263
244/* timer is IRQF_SHARED so drivers can add stuff to the timer irq chain 264/* Timer is IRQF_SHARED so drivers can add stuff to the timer irq chain.
245 * it needs to be IRQF_DISABLED to make the jiffies update work properly 265 * It needs to be IRQF_DISABLED to make the jiffies update work properly.
246 */ 266 */
247 267static struct irqaction irq_timer = {
248static struct irqaction irq_timer = { 268 .handler = timer_interrupt,
249 .mask = timer_interrupt,
250 .flags = IRQF_SHARED | IRQF_DISABLED, 269 .flags = IRQF_SHARED | IRQF_DISABLED,
251 .mask = CPU_MASK_NONE, 270 .mask = CPU_MASK_NONE,
252 .name = "timer" 271 .name = "timer"
@@ -256,27 +275,27 @@ void __init
256cris_timer_init(void) 275cris_timer_init(void)
257{ 276{
258 int cpu = smp_processor_id(); 277 int cpu = smp_processor_id();
259 reg_timer_rw_tmr0_ctrl tmr0_ctrl = { 0 }; 278 reg_timer_rw_tmr0_ctrl tmr0_ctrl = { 0 };
260 reg_timer_rw_tmr0_div tmr0_div = TIMER0_DIV; 279 reg_timer_rw_tmr0_div tmr0_div = TIMER0_DIV;
261 reg_timer_rw_intr_mask timer_intr_mask; 280 reg_timer_rw_intr_mask timer_intr_mask;
262 281
263 /* Setup the etrax timers 282 /* Setup the etrax timers.
264 * Base frequency is 100MHz, divider 1000000 -> 100 HZ 283 * Base frequency is 100MHz, divider 1000000 -> 100 HZ
265 * We use timer0, so timer1 is free. 284 * We use timer0, so timer1 is free.
266 * The trig timer is used by the fasttimer API if enabled. 285 * The trig timer is used by the fasttimer API if enabled.
267 */ 286 */
268 287
269 tmr0_ctrl.op = regk_timer_ld; 288 tmr0_ctrl.op = regk_timer_ld;
270 tmr0_ctrl.freq = regk_timer_f100; 289 tmr0_ctrl.freq = regk_timer_f100;
271 REG_WR(timer, timer_regs[cpu], rw_tmr0_div, tmr0_div); 290 REG_WR(timer, timer_regs[cpu], rw_tmr0_div, tmr0_div);
272 REG_WR(timer, timer_regs[cpu], rw_tmr0_ctrl, tmr0_ctrl); /* Load */ 291 REG_WR(timer, timer_regs[cpu], rw_tmr0_ctrl, tmr0_ctrl); /* Load */
273 tmr0_ctrl.op = regk_timer_run; 292 tmr0_ctrl.op = regk_timer_run;
274 REG_WR(timer, timer_regs[cpu], rw_tmr0_ctrl, tmr0_ctrl); /* Start */ 293 REG_WR(timer, timer_regs[cpu], rw_tmr0_ctrl, tmr0_ctrl); /* Start */
275 294
276 /* enable the timer irq */ 295 /* Enable the timer irq. */
277 timer_intr_mask = REG_RD(timer, timer_regs[cpu], rw_intr_mask); 296 timer_intr_mask = REG_RD(timer, timer_regs[cpu], rw_intr_mask);
278 timer_intr_mask.tmr0 = 1; 297 timer_intr_mask.tmr0 = 1;
279 REG_WR(timer, timer_regs[cpu], rw_intr_mask, timer_intr_mask); 298 REG_WR(timer, timer_regs[cpu], rw_intr_mask, timer_intr_mask);
280} 299}
281 300
282void __init 301void __init
@@ -284,7 +303,7 @@ time_init(void)
284{ 303{
285 reg_intr_vect_rw_mask intr_mask; 304 reg_intr_vect_rw_mask intr_mask;
286 305
287 /* probe for the RTC and read it if it exists 306 /* Probe for the RTC and read it if it exists.
288 * Before the RTC can be probed the loops_per_usec variable needs 307 * Before the RTC can be probed the loops_per_usec variable needs
289 * to be initialized to make usleep work. A better value for 308 * to be initialized to make usleep work. A better value for
290 * loops_per_usec is calculated by the kernel later once the 309 * loops_per_usec is calculated by the kernel later once the
@@ -293,52 +312,74 @@ time_init(void)
293 loops_per_usec = 50; 312 loops_per_usec = 50;
294 313
295 if(RTC_INIT() < 0) { 314 if(RTC_INIT() < 0) {
296 /* no RTC, start at 1980 */ 315 /* No RTC, start at 1980 */
297 xtime.tv_sec = 0; 316 xtime.tv_sec = 0;
298 xtime.tv_nsec = 0; 317 xtime.tv_nsec = 0;
299 have_rtc = 0; 318 have_rtc = 0;
300 } else { 319 } else {
301 /* get the current time */ 320 /* Get the current time */
302 have_rtc = 1; 321 have_rtc = 1;
303 update_xtime_from_cmos(); 322 update_xtime_from_cmos();
304 } 323 }
305 324
306 /* 325 /*
307 * Initialize wall_to_monotonic such that adding it to xtime will yield zero, the 326 * Initialize wall_to_monotonic such that adding it to
308 * tv_nsec field must be normalized (i.e., 0 <= nsec < NSEC_PER_SEC). 327 * xtime will yield zero, the tv_nsec field must be normalized
328 * (i.e., 0 <= nsec < NSEC_PER_SEC).
309 */ 329 */
310 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); 330 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec);
311 331
312 /* Start CPU local timer */ 332 /* Start CPU local timer. */
313 cris_timer_init(); 333 cris_timer_init();
314 334
315 /* enable the timer irq in global config */ 335 /* Enable the timer irq in global config. */
316 intr_mask = REG_RD(intr_vect, regi_irq, rw_mask); 336 intr_mask = REG_RD_VECT(intr_vect, regi_irq, rw_mask, 1);
317 intr_mask.timer = 1; 337 intr_mask.timer0 = 1;
318 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask); 338 REG_WR_VECT(intr_vect, regi_irq, rw_mask, 1, intr_mask);
319
320 /* now actually register the timer irq handler that calls timer_interrupt() */
321 339
322 setup_irq(TIMER_INTR_VECT, &irq_timer); 340 /* Now actually register the timer irq handler that calls
341 * timer_interrupt(). */
342 setup_irq(TIMER0_INTR_VECT, &irq_timer);
323 343
324 /* enable watchdog if we should use one */ 344 /* Enable watchdog if we should use one. */
325 345
326#if defined(CONFIG_ETRAX_WATCHDOG) 346#if defined(CONFIG_ETRAX_WATCHDOG)
327 printk("Enabling watchdog...\n"); 347 printk(KERN_INFO "Enabling watchdog...\n");
328 start_watchdog(); 348 start_watchdog();
329 349
330 /* If we use the hardware watchdog, we want to trap it as an NMI 350 /* If we use the hardware watchdog, we want to trap it as an NMI
331 and dump registers before it resets us. For this to happen, we 351 * and dump registers before it resets us. For this to happen, we
332 must set the "m" NMI enable flag (which once set, is unset only 352 * must set the "m" NMI enable flag (which once set, is unset only
333 when an NMI is taken). 353 * when an NMI is taken). */
334 354 {
335 The same goes for the external NMI, but that doesn't have any 355 unsigned long flags;
336 driver or infrastructure support yet. */ 356 local_save_flags(flags);
337 { 357 flags |= (1<<30); /* NMI M flag is at bit 30 */
338 unsigned long flags; 358 local_irq_restore(flags);
339 local_save_flags(flags); 359 }
340 flags |= (1<<30); /* NMI M flag is at bit 30 */ 360#endif
341 local_irq_restore(flags); 361
342 } 362#ifdef CONFIG_CPU_FREQ
363 cpufreq_register_notifier(&cris_time_freq_notifier_block,
364 CPUFREQ_TRANSITION_NOTIFIER);
343#endif 365#endif
344} 366}
367
368#ifdef CONFIG_CPU_FREQ
369static int
370cris_time_freq_notifier(struct notifier_block *nb, unsigned long val,
371 void *data)
372{
373 struct cpufreq_freqs *freqs = data;
374 if (val == CPUFREQ_POSTCHANGE) {
375 reg_timer_r_tmr0_data data;
376 reg_timer_rw_tmr0_div div = (freqs->new * 500) / HZ;
377 do {
378 data = REG_RD(timer, timer_regs[freqs->cpu],
379 r_tmr0_data);
380 } while (data > 20);
381 REG_WR(timer, timer_regs[freqs->cpu], rw_tmr0_div, div);
382 }
383 return 0;
384}
385#endif
diff --git a/arch/cris/arch-v32/kernel/traps.c b/arch/cris/arch-v32/kernel/traps.c
index 17fd3dbd1c80..9003e382cada 100644
--- a/arch/cris/arch-v32/kernel/traps.c
+++ b/arch/cris/arch-v32/kernel/traps.c
@@ -1,50 +1,45 @@
1/* 1/*
2 * Copyright (C) 2003, Axis Communications AB. 2 * Copyright (C) 2003-2006, Axis Communications AB.
3 */ 3 */
4 4
5#include <linux/ptrace.h> 5#include <linux/ptrace.h>
6#include <linux/module.h>
6#include <asm/uaccess.h> 7#include <asm/uaccess.h>
7 8#include <hwregs/supp_reg.h>
8#include <asm/arch/hwregs/supp_reg.h> 9#include <hwregs/intr_vect_defs.h>
9 10#include <asm/irq.h>
10extern void reset_watchdog(void);
11extern void stop_watchdog(void);
12
13extern int raw_printk(const char *fmt, ...);
14 11
15void 12void
16show_registers(struct pt_regs *regs) 13show_registers(struct pt_regs *regs)
17{ 14{
18 /* 15 /*
19 * It's possible to use either the USP register or current->thread.usp. 16 * It's possible to use either the USP register or current->thread.usp.
20 * USP might not correspond to the current proccess for all cases this 17 * USP might not correspond to the current process for all cases this
21 * function is called, and current->thread.usp isn't up to date for the 18 * function is called, and current->thread.usp isn't up to date for the
22 * current proccess. Experience shows that using USP is the way to go. 19 * current process. Experience shows that using USP is the way to go.
23 */ 20 */
24 unsigned long usp; 21 unsigned long usp = rdusp();
25 unsigned long d_mmu_cause; 22 unsigned long d_mmu_cause;
26 unsigned long i_mmu_cause; 23 unsigned long i_mmu_cause;
27 24
28 usp = rdusp(); 25 printk("CPU: %d\n", smp_processor_id());
29 26
30 raw_printk("CPU: %d\n", smp_processor_id()); 27 printk("ERP: %08lx SRP: %08lx CCS: %08lx USP: %08lx MOF: %08lx\n",
28 regs->erp, regs->srp, regs->ccs, usp, regs->mof);
31 29
32 raw_printk("ERP: %08lx SRP: %08lx CCS: %08lx USP: %08lx MOF: %08lx\n", 30 printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n",
33 regs->erp, regs->srp, regs->ccs, usp, regs->mof); 31 regs->r0, regs->r1, regs->r2, regs->r3);
34 32
35 raw_printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n", 33 printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n",
36 regs->r0, regs->r1, regs->r2, regs->r3); 34 regs->r4, regs->r5, regs->r6, regs->r7);
37 35
38 raw_printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n", 36 printk(" r8: %08lx r9: %08lx r10: %08lx r11: %08lx\n",
39 regs->r4, regs->r5, regs->r6, regs->r7); 37 regs->r8, regs->r9, regs->r10, regs->r11);
40 38
41 raw_printk(" r8: %08lx r9: %08lx r10: %08lx r11: %08lx\n", 39 printk("r12: %08lx r13: %08lx oR10: %08lx acr: %08lx\n",
42 regs->r8, regs->r9, regs->r10, regs->r11); 40 regs->r12, regs->r13, regs->orig_r10, regs->acr);
43 41
44 raw_printk("r12: %08lx r13: %08lx oR10: %08lx acr: %08lx\n", 42 printk(" sp: %08lx\n", (unsigned long)regs);
45 regs->r12, regs->r13, regs->orig_r10, regs->acr);
46
47 raw_printk("sp: %08lx\n", regs);
48 43
49 SUPP_BANK_SEL(BANK_IM); 44 SUPP_BANK_SEL(BANK_IM);
50 SUPP_REG_RD(RW_MM_CAUSE, i_mmu_cause); 45 SUPP_REG_RD(RW_MM_CAUSE, i_mmu_cause);
@@ -52,18 +47,20 @@ show_registers(struct pt_regs *regs)
52 SUPP_BANK_SEL(BANK_DM); 47 SUPP_BANK_SEL(BANK_DM);
53 SUPP_REG_RD(RW_MM_CAUSE, d_mmu_cause); 48 SUPP_REG_RD(RW_MM_CAUSE, d_mmu_cause);
54 49
55 raw_printk(" Data MMU Cause: %08lx\n", d_mmu_cause); 50 printk(" Data MMU Cause: %08lx\n", d_mmu_cause);
56 raw_printk("Instruction MMU Cause: %08lx\n", i_mmu_cause); 51 printk("Instruction MMU Cause: %08lx\n", i_mmu_cause);
57 52
58 raw_printk("Process %s (pid: %d, stackpage: %08lx)\n", 53 printk("Process %s (pid: %d, stackpage=%08lx)\n",
59 current->comm, current->pid, (unsigned long) current); 54 current->comm, current->pid, (unsigned long)current);
60 55
61 /* Show additional info if in kernel-mode. */ 56 /*
57 * When in-kernel, we also print out the stack and code at the
58 * time of the fault..
59 */
62 if (!user_mode(regs)) { 60 if (!user_mode(regs)) {
63 int i; 61 int i;
64 unsigned char c;
65 62
66 show_stack(NULL, (unsigned long *) usp); 63 show_stack(NULL, (unsigned long *)usp);
67 64
68 /* 65 /*
69 * If the previous stack-dump wasn't a kernel one, dump the 66 * If the previous stack-dump wasn't a kernel one, dump the
@@ -72,7 +69,7 @@ show_registers(struct pt_regs *regs)
72 if (usp != 0) 69 if (usp != 0)
73 show_stack(NULL, NULL); 70 show_stack(NULL, NULL);
74 71
75 raw_printk("\nCode: "); 72 printk("\nCode: ");
76 73
77 if (regs->erp < PAGE_OFFSET) 74 if (regs->erp < PAGE_OFFSET)
78 goto bad_value; 75 goto bad_value;
@@ -84,76 +81,115 @@ show_registers(struct pt_regs *regs)
84 * instruction decoding should be in sync at the interesting 81 * instruction decoding should be in sync at the interesting
85 * point, but small enough to fit on a row. The regs->erp 82 * point, but small enough to fit on a row. The regs->erp
86 * location is pointed out in a ksymoops-friendly way by 83 * location is pointed out in a ksymoops-friendly way by
87 * wrapping the byte for that address in parenthesis. 84 * wrapping the byte for that address in parenthesises.
88 */ 85 */
89 for (i = -12; i < 12; i++) { 86 for (i = -12; i < 12; i++) {
90 if (__get_user(c, &((unsigned char *) regs->erp)[i])) { 87 unsigned char c;
88
89 if (__get_user(c, &((unsigned char *)regs->erp)[i])) {
91bad_value: 90bad_value:
92 raw_printk(" Bad IP value."); 91 printk(" Bad IP value.");
93 break; 92 break;
94 } 93 }
95 94
96 if (i == 0) 95 if (i == 0)
97 raw_printk("(%02x) ", c); 96 printk("(%02x) ", c);
98 else 97 else
99 raw_printk("%02x ", c); 98 printk("%02x ", c);
100 } 99 }
101 100 printk("\n");
102 raw_printk("\n");
103 } 101 }
104} 102}
105 103
106/*
107 * This gets called from entry.S when the watchdog has bitten. Show something
108 * similar to an Oops dump, and if the kernel is configured to be a nice doggy;
109 * halt instead of reboot.
110 */
111void 104void
112watchdog_bite_hook(struct pt_regs *regs) 105arch_enable_nmi(void)
113{ 106{
114#ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY 107 unsigned long flags;
115 local_irq_disable();
116 stop_watchdog();
117 show_registers(regs);
118 108
119 while (1) 109 local_save_flags(flags);
120 ; /* Do nothing. */ 110 flags |= (1 << 30); /* NMI M flag is at bit 30 */
121#else 111 local_irq_restore(flags);
122 show_registers(regs);
123#endif
124} 112}
125 113
126/* This is normally the Oops function. */ 114extern void (*nmi_handler)(struct pt_regs *);
127void 115void handle_nmi(struct pt_regs *regs)
128die_if_kernel(const char *str, struct pt_regs *regs, long err)
129{ 116{
130 if (user_mode(regs)) 117#ifdef CONFIG_ETRAXFS
131 return; 118 reg_intr_vect_r_nmi r;
119#endif
132 120
133#ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY 121 if (nmi_handler)
134 /* 122 nmi_handler(regs);
135 * This printout might take too long and could trigger 123
136 * the watchdog normally. If NICE_DOGGY is set, simply 124#ifdef CONFIG_ETRAXFS
137 * stop the watchdog during the printout. 125 /* Wait until nmi is no longer active. */
138 */ 126 do {
139 stop_watchdog(); 127 r = REG_RD(intr_vect, regi_irq, r_nmi);
128 } while (r.ext == regk_intr_vect_on);
140#endif 129#endif
130}
141 131
142 raw_printk("%s: %04lx\n", str, err & 0xffff);
143 132
144 show_registers(regs); 133#ifdef CONFIG_BUG
134extern void die_if_kernel(const char *str, struct pt_regs *regs, long err);
145 135
146#ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY 136/* Copy of the regs at BUG() time. */
147 reset_watchdog(); 137struct pt_regs BUG_regs;
148#endif
149 138
150 do_exit(SIGSEGV); 139void do_BUG(char *file, unsigned int line)
140{
141 printk("kernel BUG at %s:%d!\n", file, line);
142 die_if_kernel("Oops", &BUG_regs, 0);
151} 143}
144EXPORT_SYMBOL(do_BUG);
152 145
153void arch_enable_nmi(void) 146void fixup_BUG(struct pt_regs *regs)
154{ 147{
155 unsigned long flags; 148 BUG_regs = *regs;
156 local_save_flags(flags); 149
157 flags |= (1<<30); /* NMI M flag is at bit 30 */ 150#ifdef CONFIG_DEBUG_BUGVERBOSE
158 local_irq_restore(flags); 151 /*
152 * Fixup the BUG arguments through exception handlers.
153 */
154 {
155 const struct exception_table_entry *fixup;
156
157 /*
158 * ERP points at the "break 14" + 2, compensate for the 2
159 * bytes.
160 */
161 fixup = search_exception_tables(instruction_pointer(regs) - 2);
162 if (fixup) {
163 /* Adjust the instruction pointer in the stackframe. */
164 instruction_pointer(regs) = fixup->fixup;
165 arch_fixup(regs);
166 }
167 }
168#else
169 /* Dont try to lookup the filename + line, just dump regs. */
170 do_BUG("unknown", 0);
171#endif
159} 172}
173
174/*
175 * Break 14 handler. Save regs and jump into the fixup_BUG.
176 */
177__asm__ ( ".text\n\t"
178 ".global breakh_BUG\n\t"
179 "breakh_BUG:\n\t"
180 SAVE_ALL
181 KGDB_FIXUP
182 "move.d $sp, $r10\n\t"
183 "jsr fixup_BUG\n\t"
184 "nop\n\t"
185 "jump ret_from_intr\n\t"
186 "nop\n\t");
187
188
189#ifdef CONFIG_DEBUG_BUGVERBOSE
190void
191handle_BUG(struct pt_regs *regs)
192{
193}
194#endif
195#endif
diff --git a/arch/cris/arch-v32/kernel/vcs_hook.c b/arch/cris/arch-v32/kernel/vcs_hook.c
deleted file mode 100644
index 64d71c54c22c..000000000000
--- a/arch/cris/arch-v32/kernel/vcs_hook.c
+++ /dev/null
@@ -1,96 +0,0 @@
1// $Id: vcs_hook.c,v 1.2 2003/08/12 12:01:06 starvik Exp $
2//
3// Call simulator hook. This is the part running in the
4// simulated program.
5//
6
7#include "vcs_hook.h"
8#include <stdarg.h>
9#include <asm/arch-v32/hwregs/reg_map.h>
10#include <asm/arch-v32/hwregs/intr_vect_defs.h>
11
12#define HOOK_TRIG_ADDR 0xb7000000 /* hook cvlog model reg address */
13#define HOOK_MEM_BASE_ADDR 0xa0000000 /* csp4 (shared mem) base addr */
14
15#define HOOK_DATA(offset) ((unsigned*) HOOK_MEM_BASE_ADDR)[offset]
16#define VHOOK_DATA(offset) ((volatile unsigned*) HOOK_MEM_BASE_ADDR)[offset]
17#define HOOK_TRIG(funcid) do { *((unsigned *) HOOK_TRIG_ADDR) = funcid; } while(0)
18#define HOOK_DATA_BYTE(offset) ((unsigned char*) HOOK_MEM_BASE_ADDR)[offset]
19
20
21// ------------------------------------------------------------------ hook_call
22int hook_call( unsigned id, unsigned pcnt, ...) {
23 va_list ap;
24 unsigned i;
25 unsigned ret;
26#ifdef USING_SOS
27 PREEMPT_OFF_SAVE();
28#endif
29
30 // pass parameters
31 HOOK_DATA(0) = id;
32
33 /* Have to make hook_print_str a special case since we call with a
34 parameter of byte type. Should perhaps be a separate
35 hook_call. */
36
37 if (id == hook_print_str) {
38 int i;
39 char *str;
40
41 HOOK_DATA(1) = pcnt;
42
43 va_start(ap, pcnt);
44 str = (char*)va_arg(ap,unsigned);
45
46 for (i=0; i!=pcnt; i++) {
47 HOOK_DATA_BYTE(8+i) = str[i];
48 }
49 HOOK_DATA_BYTE(8+i) = 0; /* null byte */
50 }
51 else {
52 va_start(ap, pcnt);
53 for( i = 1; i <= pcnt; i++ ) HOOK_DATA(i) = va_arg(ap,unsigned);
54 va_end(ap);
55 }
56
57 // read from mem to make sure data has propagated to memory before trigging
58 *((volatile unsigned*) HOOK_MEM_BASE_ADDR);
59
60 // trigger hook
61 HOOK_TRIG(id);
62
63 // wait for call to finish
64 while( VHOOK_DATA(0) > 0 ) {}
65
66 // extract return value
67
68 ret = VHOOK_DATA(1);
69
70#ifdef USING_SOS
71 PREEMPT_RESTORE();
72#endif
73 return ret;
74}
75
76unsigned
77hook_buf(unsigned i)
78{
79 return (HOOK_DATA(i));
80}
81
82void print_str( const char *str ) {
83 int i;
84 for (i=1; str[i]; i++); /* find null at end of string */
85 hook_call(hook_print_str, i, str);
86}
87
88// --------------------------------------------------------------- CPU_KICK_DOG
89void CPU_KICK_DOG(void) {
90 (void) hook_call( hook_kick_dog, 0 );
91}
92
93// ------------------------------------------------------- CPU_WATCHDOG_TIMEOUT
94void CPU_WATCHDOG_TIMEOUT( unsigned t ) {
95 (void) hook_call( hook_dog_timeout, 1, t );
96}
diff --git a/arch/cris/arch-v32/lib/Makefile b/arch/cris/arch-v32/lib/Makefile
index 05b3ec6978d6..eb4aad1f1158 100644
--- a/arch/cris/arch-v32/lib/Makefile
+++ b/arch/cris/arch-v32/lib/Makefile
@@ -2,5 +2,6 @@
2# Makefile for Etrax-specific library files.. 2# Makefile for Etrax-specific library files..
3# 3#
4 4
5lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o csumcpfruser.o spinlock.o 5lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o \
6 csumcpfruser.o spinlock.o delay.o
6 7
diff --git a/arch/cris/arch-v32/lib/checksum.S b/arch/cris/arch-v32/lib/checksum.S
index 32e66181b826..87f3fd71ab10 100644
--- a/arch/cris/arch-v32/lib/checksum.S
+++ b/arch/cris/arch-v32/lib/checksum.S
@@ -1,6 +1,6 @@
1/* 1/*
2 * A fast checksum routine using movem 2 * A fast checksum routine using movem
3 * Copyright (c) 1998-2001, 2003 Axis Communications AB 3 * Copyright (c) 1998-2007 Axis Communications AB
4 * 4 *
5 * csum_partial(const unsigned char * buff, int len, unsigned int sum) 5 * csum_partial(const unsigned char * buff, int len, unsigned int sum)
6 */ 6 */
@@ -12,30 +12,23 @@ csum_partial:
12 ;; r11 - length 12 ;; r11 - length
13 ;; r12 - checksum 13 ;; r12 - checksum
14 14
15 ;; check for breakeven length between movem and normal word looping versions 15 ;; Optimized for large packets
16 ;; we also do _NOT_ want to compute a checksum over more than the 16 subq 10*4, $r11
17 ;; actual length when length < 40 17 blt _word_loop
18 18 move.d $r11, $acr
19 cmpu.w 80,$r11
20 blo _word_loop
21 nop
22
23 ;; need to save the registers we use below in the movem loop
24 ;; this overhead is why we have a check above for breakeven length
25 ;; only r0 - r8 have to be saved, the other ones are clobber-able
26 ;; according to the ABI
27 19
28 subq 9*4,$sp 20 subq 9*4,$sp
29 subq 10*4,$r11 ; update length for the first loop 21 clearf c
30 movem $r8,[$sp] 22 movem $r8,[$sp]
31 23
32 ;; do a movem checksum 24 ;; do a movem checksum
33 25
34_mloop: movem [$r10+],$r9 ; read 10 longwords 26_mloop: movem [$r10+],$r9 ; read 10 longwords
35 27 ;; Loop count without touching the c flag.
28 addoq -10*4, $acr, $acr
36 ;; perform dword checksumming on the 10 longwords 29 ;; perform dword checksumming on the 10 longwords
37 30
38 add.d $r0,$r12 31 addc $r0,$r12
39 addc $r1,$r12 32 addc $r1,$r12
40 addc $r2,$r12 33 addc $r2,$r12
41 addc $r3,$r12 34 addc $r3,$r12
@@ -46,60 +39,41 @@ _mloop: movem [$r10+],$r9 ; read 10 longwords
46 addc $r8,$r12 39 addc $r8,$r12
47 addc $r9,$r12 40 addc $r9,$r12
48 41
49 ;; fold the carry into the checksum, to avoid having to loop the carry 42 ;; test $acr without trashing carry.
50 ;; back into the top 43 move.d $acr, $acr
51 44 bpl _mloop
52 addc 0,$r12 45 ;; r11 <= acr is not really needed in the mloop, just using the dslot
53 addc 0,$r12 ; do it again, since we might have generated a carry 46 ;; to prepare for what is needed after mloop.
54 47 move.d $acr, $r11
55 subq 10*4,$r11
56 bge _mloop
57 nop
58
59 addq 10*4,$r11 ; compensate for last loop underflowing length
60 48
49 ;; fold the last carry into r13
50 addc 0, $r12
61 movem [$sp+],$r8 ; restore regs 51 movem [$sp+],$r8 ; restore regs
62 52
63_word_loop: 53_word_loop:
64 ;; only fold if there is anything to fold. 54 addq 10*4,$r11 ; compensate for last loop underflowing length
65
66 cmpq 0,$r12
67 beq _no_fold
68
69 ;; fold 32-bit checksum into a 16-bit checksum, to avoid carries below.
70 ;; r9 and r13 can be used as temporaries.
71 55
72 moveq -1,$r9 ; put 0xffff in r9, faster than move.d 0xffff,r9 56 moveq -1,$r9 ; put 0xffff in r9, faster than move.d 0xffff,r9
73 lsrq 16,$r9 57 lsrq 16,$r9
74 58
75 move.d $r12,$r13 59 move.d $r12,$r13
76 lsrq 16,$r13 ; r13 = checksum >> 16 60 lsrq 16,$r13 ; r13 = checksum >> 16
77 and.d $r9,$r12 ; checksum = checksum & 0xffff 61 and.d $r9,$r12 ; checksum = checksum & 0xffff
78 add.d $r13,$r12 ; checksum += r13
79 move.d $r12,$r13 ; do the same again, maybe we got a carry last add
80 lsrq 16,$r13
81 and.d $r9,$r12
82 add.d $r13,$r12
83 62
84_no_fold: 63_no_fold:
85 cmpq 2,$r11 64 subq 2,$r11
86 blt _no_words 65 blt _no_words
87 nop 66 add.d $r13,$r12 ; checksum += r13
88 67
89 ;; checksum the rest of the words 68 ;; checksum the rest of the words
90
91 subq 2,$r11
92
93_wloop: subq 2,$r11 69_wloop: subq 2,$r11
94 bge _wloop 70 bge _wloop
95 addu.w [$r10+],$r12 71 addu.w [$r10+],$r12
96 72
97 addq 2,$r11
98
99_no_words: 73_no_words:
74 addq 2,$r11
100 ;; see if we have one odd byte more 75 ;; see if we have one odd byte more
101 cmpq 1,$r11 76 bne _do_byte
102 beq _do_byte
103 nop 77 nop
104 ret 78 ret
105 move.d $r12,$r10 79 move.d $r12,$r10
diff --git a/arch/cris/arch-v32/lib/checksumcopy.S b/arch/cris/arch-v32/lib/checksumcopy.S
index 9303ccbadc6d..21aabe91489b 100644
--- a/arch/cris/arch-v32/lib/checksumcopy.S
+++ b/arch/cris/arch-v32/lib/checksumcopy.S
@@ -1,6 +1,6 @@
1/* 1/*
2 * A fast checksum+copy routine using movem 2 * A fast checksum+copy routine using movem
3 * Copyright (c) 1998, 2001, 2003 Axis Communications AB 3 * Copyright (c) 1998-2007 Axis Communications AB
4 * 4 *
5 * Authors: Bjorn Wesen 5 * Authors: Bjorn Wesen
6 * 6 *
@@ -16,32 +16,23 @@ csum_partial_copy_nocheck:
16 ;; r12 - length 16 ;; r12 - length
17 ;; r13 - checksum 17 ;; r13 - checksum
18 18
19 ;; check for breakeven length between movem and normal word looping versions 19 ;; Optimized for large packets
20 ;; we also do _NOT_ want to compute a checksum over more than the 20 subq 10*4, $r12
21 ;; actual length when length < 40 21 blt _word_loop
22 22 move.d $r12, $acr
23 cmpu.w 80,$r12
24 blo _word_loop
25 nop
26
27 ;; need to save the registers we use below in the movem loop
28 ;; this overhead is why we have a check above for breakeven length
29 ;; only r0 - r8 have to be saved, the other ones are clobber-able
30 ;; according to the ABI
31 23
32 subq 9*4,$sp 24 subq 9*4,$sp
33 subq 10*4,$r12 ; update length for the first loop 25 clearf c
34 movem $r8,[$sp] 26 movem $r8,[$sp]
35 27
36 ;; do a movem copy and checksum 28 ;; do a movem copy and checksum
37
381: ;; A failing userspace access (the read) will have this as PC. 291: ;; A failing userspace access (the read) will have this as PC.
39_mloop: movem [$r10+],$r9 ; read 10 longwords 30_mloop: movem [$r10+],$r9 ; read 10 longwords
31 addoq -10*4, $acr, $acr ; loop counter in latency cycle
40 movem $r9,[$r11+] ; write 10 longwords 32 movem $r9,[$r11+] ; write 10 longwords
41 33
42 ;; perform dword checksumming on the 10 longwords 34 ;; perform dword checksumming on the 10 longwords
43 35 addc $r0,$r13
44 add.d $r0,$r13
45 addc $r1,$r13 36 addc $r1,$r13
46 addc $r2,$r13 37 addc $r2,$r13
47 addc $r3,$r13 38 addc $r3,$r13
@@ -52,47 +43,30 @@ _mloop: movem [$r10+],$r9 ; read 10 longwords
52 addc $r8,$r13 43 addc $r8,$r13
53 addc $r9,$r13 44 addc $r9,$r13
54 45
55 ;; fold the carry into the checksum, to avoid having to loop the carry 46 ;; test $acr, without trashing carry.
56 ;; back into the top 47 move.d $acr, $acr
57 48 bpl _mloop
58 addc 0,$r13 49 ;; r12 <= acr is needed after mloop and in the exception handlers.
59 addc 0,$r13 ; do it again, since we might have generated a carry 50 move.d $acr, $r12
60
61 subq 10*4,$r12
62 bge _mloop
63 nop
64
65 addq 10*4,$r12 ; compensate for last loop underflowing length
66 51
52 ;; fold the last carry into r13
53 addc 0, $r13
67 movem [$sp+],$r8 ; restore regs 54 movem [$sp+],$r8 ; restore regs
68 55
69_word_loop: 56_word_loop:
70 ;; only fold if there is anything to fold. 57 addq 10*4,$r12 ; compensate for last loop underflowing length
71
72 cmpq 0,$r13
73 beq _no_fold
74 58
75 ;; fold 32-bit checksum into a 16-bit checksum, to avoid carries below 59 ;; fold 32-bit checksum into a 16-bit checksum, to avoid carries below
76 ;; r9 can be used as temporary. 60 ;; r9 can be used as temporary.
77
78 move.d $r13,$r9 61 move.d $r13,$r9
79 lsrq 16,$r9 ; r0 = checksum >> 16 62 lsrq 16,$r9 ; r0 = checksum >> 16
80 and.d 0xffff,$r13 ; checksum = checksum & 0xffff 63 and.d 0xffff,$r13 ; checksum = checksum & 0xffff
81 add.d $r9,$r13 ; checksum += r0
82 move.d $r13,$r9 ; do the same again, maybe we got a carry last add
83 lsrq 16,$r9
84 and.d 0xffff,$r13
85 add.d $r9,$r13
86 64
87_no_fold: 65 subq 2, $r12
88 cmpq 2,$r12
89 blt _no_words 66 blt _no_words
90 nop 67 add.d $r9,$r13 ; checksum += r0
91 68
92 ;; copy and checksum the rest of the words 69 ;; copy and checksum the rest of the words
93
94 subq 2,$r12
95
962: ;; A failing userspace access for the read below will have this as PC. 702: ;; A failing userspace access for the read below will have this as PC.
97_wloop: move.w [$r10+],$r9 71_wloop: move.w [$r10+],$r9
98 addu.w $r9,$r13 72 addu.w $r9,$r13
@@ -100,12 +74,9 @@ _wloop: move.w [$r10+],$r9
100 bge _wloop 74 bge _wloop
101 move.w $r9,[$r11+] 75 move.w $r9,[$r11+]
102 76
103 addq 2,$r12
104
105_no_words: 77_no_words:
106 ;; see if we have one odd byte more 78 addq 2,$r12
107 cmpq 1,$r12 79 bne _do_byte
108 beq _do_byte
109 nop 80 nop
110 ret 81 ret
111 move.d $r13,$r10 82 move.d $r13,$r10
diff --git a/arch/cris/arch-v32/lib/delay.c b/arch/cris/arch-v32/lib/delay.c
new file mode 100644
index 000000000000..39f1ac9995b4
--- /dev/null
+++ b/arch/cris/arch-v32/lib/delay.c
@@ -0,0 +1,28 @@
1/*
2 * Precise Delay Loops for ETRAX FS
3 *
4 * Copyright (C) 2006 Axis Communications AB.
5 *
6 */
7
8#include <hwregs/reg_map.h>
9#include <hwregs/reg_rdwr.h>
10#include <hwregs/timer_defs.h>
11#include <linux/types.h>
12#include <linux/delay.h>
13#include <linux/module.h>
14
15/*
16 * On ETRAX FS, we can check the free-running read-only 100MHz timer
17 * getting 32-bit 10ns precision, theoretically good for 42.94967295
18 * seconds. Unsigned arithmetic and careful expression handles
19 * wrapping.
20 */
21
22void cris_delay10ns(u32 n10ns)
23{
24 u32 t0 = REG_RD(timer, regi_timer0, r_time);
25 while (REG_RD(timer, regi_timer0, r_time) - t0 < n10ns)
26 ;
27}
28EXPORT_SYMBOL(cris_delay10ns);
diff --git a/arch/cris/arch-v32/lib/spinlock.S b/arch/cris/arch-v32/lib/spinlock.S
index 2437ae7f6ed2..79087ef59a1c 100644
--- a/arch/cris/arch-v32/lib/spinlock.S
+++ b/arch/cris/arch-v32/lib/spinlock.S
@@ -12,11 +12,11 @@
12 12
13cris_spin_lock: 13cris_spin_lock:
14 clearf p 14 clearf p
151: test.d [$r10] 151: test.b [$r10]
16 beq 1b 16 beq 1b
17 clearf p 17 clearf p
18 ax 18 ax
19 clear.d [$r10] 19 clear.b [$r10]
20 bcs 1b 20 bcs 1b
21 clearf p 21 clearf p
22 ret 22 ret
@@ -24,10 +24,10 @@ cris_spin_lock:
24 24
25cris_spin_trylock: 25cris_spin_trylock:
26 clearf p 26 clearf p
271: move.d [$r10], $r11 271: move.b [$r10], $r11
28 ax 28 ax
29 clear.d [$r10] 29 clear.b [$r10]
30 bcs 1b 30 bcs 1b
31 clearf p 31 clearf p
32 ret 32 ret
33 move.d $r11,$r10 33 movu.b $r11,$r10
diff --git a/arch/cris/arch-v32/mach-a3/Kconfig b/arch/cris/arch-v32/mach-a3/Kconfig
new file mode 100644
index 000000000000..a4df06d5997a
--- /dev/null
+++ b/arch/cris/arch-v32/mach-a3/Kconfig
@@ -0,0 +1,110 @@
1if CRIS_MACH_ARTPEC3
2
3menu "Artpec-3 options"
4 depends on CRIS_MACH_ARTPEC3
5
6config ETRAX_DRAM_VIRTUAL_BASE
7 hex
8 default "c0000000"
9
10config ETRAX_L2CACHE
11 bool
12 default y
13
14config ETRAX_SERIAL_PORTS
15 int
16 default 5
17
18config ETRAX_DDR
19 bool
20 default y
21
22config ETRAX_DDR2_MRS
23 hex "DDR2 MRS"
24 default "0"
25
26config ETRAX_DDR2_TIMING
27 hex "DDR2 SDRAM timing"
28 default "0"
29 help
30 SDRAM timing parameters.
31
32config ETRAX_DDR2_CONFIG
33 hex "DDR2 config"
34 default "0"
35
36config ETRAX_PIO_CE0_CFG
37 hex "PIO CE0 configuration"
38 default "0"
39
40config ETRAX_PIO_CE1_CFG
41 hex "PIO CE1 configuration"
42 default "0"
43
44config ETRAX_PIO_CE2_CFG
45 hex "PIO CE2 configuration"
46 default "0"
47
48config ETRAX_DEF_GIO_PA_OE
49 hex "GIO_PA_OE"
50 default "00000000"
51 help
52 Configures the direction of general port A bits. 1 is out, 0 is in.
53 This is often totally different depending on the product used.
54 There are some guidelines though - if you know that only LED's are
55 connected to port PA, then they are usually connected to bits 2-4
56 and you can therefore use 1c. On other boards which don't have the
57 LED's at the general ports, these bits are used for all kinds of
58 stuff. If you don't know what to use, it is always safe to put all
59 as inputs, although floating inputs isn't good.
60
61config ETRAX_DEF_GIO_PA_OUT
62 hex "GIO_PA_OUT"
63 default "00000000"
64 help
65 Configures the initial data for the general port A bits. Most
66 products should use 00 here.
67
68config ETRAX_DEF_GIO_PB_OE
69 hex "GIO_PB_OE"
70 default "000000000"
71 help
72 Configures the direction of general port B bits. 1 is out, 0 is in.
73 This is often totally different depending on the product used.
74 There are some guidelines though - if you know that only LED's are
75 connected to port PA, then they are usually connected to bits 2-4
76 and you can therefore use 1c. On other boards which don't have the
77 LED's at the general ports, these bits are used for all kinds of
78 stuff. If you don't know what to use, it is always safe to put all
79 as inputs, although floating inputs isn't good.
80
81config ETRAX_DEF_GIO_PB_OUT
82 hex "GIO_PB_OUT"
83 default "000000000"
84 help
85 Configures the initial data for the general port B bits. Most
86 products should use 00000 here.
87
88config ETRAX_DEF_GIO_PC_OE
89 hex "GIO_PC_OE"
90 default "00000"
91 help
92 Configures the direction of general port C bits. 1 is out, 0 is in.
93 This is often totally different depending on the product used.
94 There are some guidelines though - if you know that only LED's are
95 connected to port PA, then they are usually connected to bits 2-4
96 and you can therefore use 1c. On other boards which don't have the
97 LED's at the general ports, these bits are used for all kinds of
98 stuff. If you don't know what to use, it is always safe to put all
99 as inputs, although floating inputs isn't good.
100
101config ETRAX_DEF_GIO_PC_OUT
102 hex "GIO_PC_OUT"
103 default "00000"
104 help
105 Configures the initial data for the general port C bits. Most
106 products should use 00000 here.
107
108endmenu
109
110endif
diff --git a/arch/cris/arch-v32/mach-a3/Makefile b/arch/cris/arch-v32/mach-a3/Makefile
new file mode 100644
index 000000000000..41fa6a6893a9
--- /dev/null
+++ b/arch/cris/arch-v32/mach-a3/Makefile
@@ -0,0 +1,11 @@
1# $Id: Makefile,v 1.3 2007/03/13 11:57:46 starvik Exp $
2#
3# Makefile for the linux kernel.
4#
5
6obj-y := dma.o pinmux.o io.o arbiter.o
7obj-$(CONFIG_ETRAX_VCS_SIM) += vcs_hook.o
8obj-$(CONFIG_CPU_FREQ) += cpufreq.o
9
10clean:
11
diff --git a/arch/cris/arch-v32/mach-a3/arbiter.c b/arch/cris/arch-v32/mach-a3/arbiter.c
new file mode 100644
index 000000000000..8b924db71c9a
--- /dev/null
+++ b/arch/cris/arch-v32/mach-a3/arbiter.c
@@ -0,0 +1,634 @@
1/*
2 * Memory arbiter functions. Allocates bandwidth through the
3 * arbiter and sets up arbiter breakpoints.
4 *
5 * The algorithm first assigns slots to the clients that has specified
6 * bandwidth (e.g. ethernet) and then the remaining slots are divided
7 * on all the active clients.
8 *
9 * Copyright (c) 2004-2007 Axis Communications AB.
10 *
11 * The artpec-3 has two arbiters. The memory hierarchy looks like this:
12 *
13 *
14 * CPU DMAs
15 * | |
16 * | |
17 * -------------- ------------------
18 * | foo arbiter|----| Internal memory|
19 * -------------- ------------------
20 * |
21 * --------------
22 * | L2 cache |
23 * --------------
24 * |
25 * h264 etc |
26 * | |
27 * | |
28 * --------------
29 * | bar arbiter|
30 * --------------
31 * |
32 * ---------
33 * | SDRAM |
34 * ---------
35 *
36 */
37
38#include <hwregs/reg_map.h>
39#include <hwregs/reg_rdwr.h>
40#include <hwregs/marb_foo_defs.h>
41#include <hwregs/marb_bar_defs.h>
42#include <arbiter.h>
43#include <hwregs/intr_vect.h>
44#include <linux/interrupt.h>
45#include <linux/irq.h>
46#include <linux/signal.h>
47#include <linux/errno.h>
48#include <linux/spinlock.h>
49#include <asm/io.h>
50#include <asm/irq_regs.h>
51
52#define D(x)
53
54struct crisv32_watch_entry {
55 unsigned long instance;
56 watch_callback *cb;
57 unsigned long start;
58 unsigned long end;
59 int used;
60};
61
62#define NUMBER_OF_BP 4
63#define SDRAM_BANDWIDTH 400000000
64#define INTMEM_BANDWIDTH 400000000
65#define NBR_OF_SLOTS 64
66#define NBR_OF_REGIONS 2
67#define NBR_OF_CLIENTS 15
68#define ARBITERS 2
69#define UNASSIGNED 100
70
71struct arbiter {
72 unsigned long instance;
73 int nbr_regions;
74 int nbr_clients;
75 int requested_slots[NBR_OF_REGIONS][NBR_OF_CLIENTS];
76 int active_clients[NBR_OF_REGIONS][NBR_OF_CLIENTS];
77};
78
79static struct crisv32_watch_entry watches[ARBITERS][NUMBER_OF_BP] =
80{
81 {
82 {regi_marb_foo_bp0},
83 {regi_marb_foo_bp1},
84 {regi_marb_foo_bp2},
85 {regi_marb_foo_bp3}
86 },
87 {
88 {regi_marb_bar_bp0},
89 {regi_marb_bar_bp1},
90 {regi_marb_bar_bp2},
91 {regi_marb_bar_bp3}
92 }
93};
94
95struct arbiter arbiters[ARBITERS] =
96{
97 { /* L2 cache arbiter */
98 .instance = regi_marb_foo,
99 .nbr_regions = 2,
100 .nbr_clients = 15
101 },
102 { /* DDR2 arbiter */
103 .instance = regi_marb_bar,
104 .nbr_regions = 1,
105 .nbr_clients = 9
106 }
107};
108
109static int max_bandwidth[NBR_OF_REGIONS] = {SDRAM_BANDWIDTH, INTMEM_BANDWIDTH};
110
111DEFINE_SPINLOCK(arbiter_lock);
112
113static irqreturn_t
114crisv32_foo_arbiter_irq(int irq, void *dev_id);
115static irqreturn_t
116crisv32_bar_arbiter_irq(int irq, void *dev_id);
117
118/*
119 * "I'm the arbiter, I know the score.
120 * From square one I'll be watching all 64."
121 * (memory arbiter slots, that is)
122 *
123 * Or in other words:
124 * Program the memory arbiter slots for "region" according to what's
125 * in requested_slots[] and active_clients[], while minimizing
126 * latency. A caller may pass a non-zero positive amount for
127 * "unused_slots", which must then be the unallocated, remaining
128 * number of slots, free to hand out to any client.
129 */
130
131static void crisv32_arbiter_config(int arbiter, int region, int unused_slots)
132{
133 int slot;
134 int client;
135 int interval = 0;
136
137 /*
138 * This vector corresponds to the hardware arbiter slots (see
139 * the hardware documentation for semantics). We initialize
140 * each slot with a suitable sentinel value outside the valid
141 * range {0 .. NBR_OF_CLIENTS - 1} and replace them with
142 * client indexes. Then it's fed to the hardware.
143 */
144 s8 val[NBR_OF_SLOTS];
145
146 for (slot = 0; slot < NBR_OF_SLOTS; slot++)
147 val[slot] = -1;
148
149 for (client = 0; client < arbiters[arbiter].nbr_clients; client++) {
150 int pos;
151 /* Allocate the requested non-zero number of slots, but
152 * also give clients with zero-requests one slot each
153 * while stocks last. We do the latter here, in client
154 * order. This makes sure zero-request clients are the
155 * first to get to any spare slots, else those slots
156 * could, when bandwidth is allocated close to the limit,
157 * all be allocated to low-index non-zero-request clients
158 * in the default-fill loop below. Another positive but
159 * secondary effect is a somewhat better spread of the
160 * zero-bandwidth clients in the vector, avoiding some of
161 * the latency that could otherwise be caused by the
162 * partitioning of non-zero-bandwidth clients at low
163 * indexes and zero-bandwidth clients at high
164 * indexes. (Note that this spreading can only affect the
165 * unallocated bandwidth.) All the above only matters for
166 * memory-intensive situations, of course.
167 */
168 if (!arbiters[arbiter].requested_slots[region][client]) {
169 /*
170 * Skip inactive clients. Also skip zero-slot
171 * allocations in this pass when there are no known
172 * free slots.
173 */
174 if (!arbiters[arbiter].active_clients[region][client] ||
175 unused_slots <= 0)
176 continue;
177
178 unused_slots--;
179
180 /* Only allocate one slot for this client. */
181 interval = NBR_OF_SLOTS;
182 } else
183 interval = NBR_OF_SLOTS /
184 arbiters[arbiter].requested_slots[region][client];
185
186 pos = 0;
187 while (pos < NBR_OF_SLOTS) {
188 if (val[pos] >= 0)
189 pos++;
190 else {
191 val[pos] = client;
192 pos += interval;
193 }
194 }
195 }
196
197 client = 0;
198 for (slot = 0; slot < NBR_OF_SLOTS; slot++) {
199 /*
200 * Allocate remaining slots in round-robin
201 * client-number order for active clients. For this
202 * pass, we ignore requested bandwidth and previous
203 * allocations.
204 */
205 if (val[slot] < 0) {
206 int first = client;
207 while (!arbiters[arbiter].active_clients[region][client]) {
208 client = (client + 1) %
209 arbiters[arbiter].nbr_clients;
210 if (client == first)
211 break;
212 }
213 val[slot] = client;
214 client = (client + 1) % arbiters[arbiter].nbr_clients;
215 }
216 if (arbiter == 0) {
217 if (region == EXT_REGION)
218 REG_WR_INT_VECT(marb_foo, regi_marb_foo,
219 rw_l2_slots, slot, val[slot]);
220 else if (region == INT_REGION)
221 REG_WR_INT_VECT(marb_foo, regi_marb_foo,
222 rw_intm_slots, slot, val[slot]);
223 } else {
224 REG_WR_INT_VECT(marb_bar, regi_marb_bar,
225 rw_ddr2_slots, slot, val[slot]);
226 }
227 }
228}
229
230extern char _stext, _etext;
231
232static void crisv32_arbiter_init(void)
233{
234 static int initialized;
235
236 if (initialized)
237 return;
238
239 initialized = 1;
240
241 /*
242 * CPU caches are always set to active, but with zero
243 * bandwidth allocated. It should be ok to allocate zero
244 * bandwidth for the caches, because DMA for other channels
245 * will supposedly finish, once their programmed amount is
246 * done, and then the caches will get access according to the
247 * "fixed scheme" for unclaimed slots. Though, if for some
248 * use-case somewhere, there's a maximum CPU latency for
249 * e.g. some interrupt, we have to start allocating specific
250 * bandwidth for the CPU caches too.
251 */
252 arbiters[0].active_clients[EXT_REGION][11] = 1;
253 arbiters[0].active_clients[EXT_REGION][12] = 1;
254 crisv32_arbiter_config(0, EXT_REGION, 0);
255 crisv32_arbiter_config(0, INT_REGION, 0);
256 crisv32_arbiter_config(1, EXT_REGION, 0);
257
258 if (request_irq(MEMARB_FOO_INTR_VECT, crisv32_foo_arbiter_irq,
259 IRQF_DISABLED, "arbiter", NULL))
260 printk(KERN_ERR "Couldn't allocate arbiter IRQ\n");
261
262 if (request_irq(MEMARB_BAR_INTR_VECT, crisv32_bar_arbiter_irq,
263 IRQF_DISABLED, "arbiter", NULL))
264 printk(KERN_ERR "Couldn't allocate arbiter IRQ\n");
265
266#ifndef CONFIG_ETRAX_KGDB
267 /* Global watch for writes to kernel text segment. */
268 crisv32_arbiter_watch(virt_to_phys(&_stext), &_etext - &_stext,
269 MARB_CLIENTS(arbiter_all_clients, arbiter_bar_all_clients),
270 arbiter_all_write, NULL);
271#endif
272
273 /* Set up max burst sizes by default */
274 REG_WR_INT(marb_bar, regi_marb_bar, rw_h264_rd_burst, 3);
275 REG_WR_INT(marb_bar, regi_marb_bar, rw_h264_wr_burst, 3);
276 REG_WR_INT(marb_bar, regi_marb_bar, rw_ccd_burst, 3);
277 REG_WR_INT(marb_bar, regi_marb_bar, rw_vin_wr_burst, 3);
278 REG_WR_INT(marb_bar, regi_marb_bar, rw_vin_rd_burst, 3);
279 REG_WR_INT(marb_bar, regi_marb_bar, rw_sclr_rd_burst, 3);
280 REG_WR_INT(marb_bar, regi_marb_bar, rw_vout_burst, 3);
281 REG_WR_INT(marb_bar, regi_marb_bar, rw_sclr_fifo_burst, 3);
282 REG_WR_INT(marb_bar, regi_marb_bar, rw_l2cache_burst, 3);
283}
284
285int crisv32_arbiter_allocate_bandwidth(int client, int region,
286 unsigned long bandwidth)
287{
288 int i;
289 int total_assigned = 0;
290 int total_clients = 0;
291 int req;
292 int arbiter = 0;
293
294 crisv32_arbiter_init();
295
296 if (client & 0xffff0000) {
297 arbiter = 1;
298 client >>= 16;
299 }
300
301 for (i = 0; i < arbiters[arbiter].nbr_clients; i++) {
302 total_assigned += arbiters[arbiter].requested_slots[region][i];
303 total_clients += arbiters[arbiter].active_clients[region][i];
304 }
305
306 /* Avoid division by 0 for 0-bandwidth requests. */
307 req = bandwidth == 0
308 ? 0 : NBR_OF_SLOTS / (max_bandwidth[region] / bandwidth);
309
310 /*
311 * We make sure that there are enough slots only for non-zero
312 * requests. Requesting 0 bandwidth *may* allocate slots,
313 * though if all bandwidth is allocated, such a client won't
314 * get any and will have to rely on getting memory access
315 * according to the fixed scheme that's the default when one
316 * of the slot-allocated clients doesn't claim their slot.
317 */
318 if (total_assigned + req > NBR_OF_SLOTS)
319 return -ENOMEM;
320
321 arbiters[arbiter].active_clients[region][client] = 1;
322 arbiters[arbiter].requested_slots[region][client] = req;
323 crisv32_arbiter_config(arbiter, region, NBR_OF_SLOTS - total_assigned);
324
325 /* Propagate allocation from foo to bar */
326 if (arbiter == 0)
327 crisv32_arbiter_allocate_bandwidth(8 << 16,
328 EXT_REGION, bandwidth);
329 return 0;
330}
331
332/*
333 * Main entry for bandwidth deallocation.
334 *
335 * Strictly speaking, for a somewhat constant set of clients where
336 * each client gets a constant bandwidth and is just enabled or
337 * disabled (somewhat dynamically), no action is necessary here to
338 * avoid starvation for non-zero-allocation clients, as the allocated
339 * slots will just be unused. However, handing out those unused slots
340 * to active clients avoids needless latency if the "fixed scheme"
341 * would give unclaimed slots to an eager low-index client.
342 */
343
344void crisv32_arbiter_deallocate_bandwidth(int client, int region)
345{
346 int i;
347 int total_assigned = 0;
348 int arbiter = 0;
349
350 if (client & 0xffff0000)
351 arbiter = 1;
352
353 arbiters[arbiter].requested_slots[region][client] = 0;
354 arbiters[arbiter].active_clients[region][client] = 0;
355
356 for (i = 0; i < arbiters[arbiter].nbr_clients; i++)
357 total_assigned += arbiters[arbiter].requested_slots[region][i];
358
359 crisv32_arbiter_config(arbiter, region, NBR_OF_SLOTS - total_assigned);
360}
361
362int crisv32_arbiter_watch(unsigned long start, unsigned long size,
363 unsigned long clients, unsigned long accesses,
364 watch_callback *cb)
365{
366 int i;
367 int arbiter;
368 int used[2];
369 int ret = 0;
370
371 crisv32_arbiter_init();
372
373 if (start > 0x80000000) {
374 printk(KERN_ERR "Arbiter: %lX doesn't look like a "
375 "physical address", start);
376 return -EFAULT;
377 }
378
379 spin_lock(&arbiter_lock);
380
381 if (clients & 0xffff)
382 used[0] = 1;
383 if (clients & 0xffff0000)
384 used[1] = 1;
385
386 for (arbiter = 0; arbiter < ARBITERS; arbiter++) {
387 if (!used[arbiter])
388 continue;
389
390 for (i = 0; i < NUMBER_OF_BP; i++) {
391 if (!watches[arbiter][i].used) {
392 unsigned intr_mask;
393 if (arbiter)
394 intr_mask = REG_RD_INT(marb_bar,
395 regi_marb_bar, rw_intr_mask);
396 else
397 intr_mask = REG_RD_INT(marb_foo,
398 regi_marb_foo, rw_intr_mask);
399
400 watches[arbiter][i].used = 1;
401 watches[arbiter][i].start = start;
402 watches[arbiter][i].end = start + size;
403 watches[arbiter][i].cb = cb;
404
405 ret |= (i + 1) << (arbiter + 8);
406 if (arbiter) {
407 REG_WR_INT(marb_bar_bp,
408 watches[arbiter][i].instance,
409 rw_first_addr,
410 watches[arbiter][i].start);
411 REG_WR_INT(marb_bar_bp,
412 watches[arbiter][i].instance,
413 rw_last_addr,
414 watches[arbiter][i].end);
415 REG_WR_INT(marb_bar_bp,
416 watches[arbiter][i].instance,
417 rw_op, accesses);
418 REG_WR_INT(marb_bar_bp,
419 watches[arbiter][i].instance,
420 rw_clients,
421 clients & 0xffff);
422 } else {
423 REG_WR_INT(marb_foo_bp,
424 watches[arbiter][i].instance,
425 rw_first_addr,
426 watches[arbiter][i].start);
427 REG_WR_INT(marb_foo_bp,
428 watches[arbiter][i].instance,
429 rw_last_addr,
430 watches[arbiter][i].end);
431 REG_WR_INT(marb_foo_bp,
432 watches[arbiter][i].instance,
433 rw_op, accesses);
434 REG_WR_INT(marb_foo_bp,
435 watches[arbiter][i].instance,
436 rw_clients, clients >> 16);
437 }
438
439 if (i == 0)
440 intr_mask |= 1;
441 else if (i == 1)
442 intr_mask |= 2;
443 else if (i == 2)
444 intr_mask |= 4;
445 else if (i == 3)
446 intr_mask |= 8;
447
448 if (arbiter)
449 REG_WR_INT(marb_bar, regi_marb_bar,
450 rw_intr_mask, intr_mask);
451 else
452 REG_WR_INT(marb_foo, regi_marb_foo,
453 rw_intr_mask, intr_mask);
454
455 spin_unlock(&arbiter_lock);
456
457 break;
458 }
459 }
460 }
461 spin_unlock(&arbiter_lock);
462 if (ret)
463 return ret;
464 else
465 return -ENOMEM;
466}
467
468int crisv32_arbiter_unwatch(int id)
469{
470 int arbiter;
471 int intr_mask;
472
473 crisv32_arbiter_init();
474
475 spin_lock(&arbiter_lock);
476
477 for (arbiter = 0; arbiter < ARBITERS; arbiter++) {
478 int id2;
479
480 if (arbiter)
481 intr_mask = REG_RD_INT(marb_bar, regi_marb_bar,
482 rw_intr_mask);
483 else
484 intr_mask = REG_RD_INT(marb_foo, regi_marb_foo,
485 rw_intr_mask);
486
487 id2 = (id & (0xff << (arbiter + 8))) >> (arbiter + 8);
488 if (id2 == 0)
489 continue;
490 id2--;
491 if ((id2 >= NUMBER_OF_BP) || (!watches[arbiter][id2].used)) {
492 spin_unlock(&arbiter_lock);
493 return -EINVAL;
494 }
495
496 memset(&watches[arbiter][id2], 0,
497 sizeof(struct crisv32_watch_entry));
498
499 if (id2 == 0)
500 intr_mask &= ~1;
501 else if (id2 == 1)
502 intr_mask &= ~2;
503 else if (id2 == 2)
504 intr_mask &= ~4;
505 else if (id2 == 3)
506 intr_mask &= ~8;
507
508 if (arbiter)
509 REG_WR_INT(marb_bar, regi_marb_bar, rw_intr_mask,
510 intr_mask);
511 else
512 REG_WR_INT(marb_foo, regi_marb_foo, rw_intr_mask,
513 intr_mask);
514 }
515
516 spin_unlock(&arbiter_lock);
517 return 0;
518}
519
520extern void show_registers(struct pt_regs *regs);
521
522
523static irqreturn_t
524crisv32_foo_arbiter_irq(int irq, void *dev_id)
525{
526 reg_marb_foo_r_masked_intr masked_intr =
527 REG_RD(marb_foo, regi_marb_foo, r_masked_intr);
528 reg_marb_foo_bp_r_brk_clients r_clients;
529 reg_marb_foo_bp_r_brk_addr r_addr;
530 reg_marb_foo_bp_r_brk_op r_op;
531 reg_marb_foo_bp_r_brk_first_client r_first;
532 reg_marb_foo_bp_r_brk_size r_size;
533 reg_marb_foo_bp_rw_ack ack = {0};
534 reg_marb_foo_rw_ack_intr ack_intr = {
535 .bp0 = 1, .bp1 = 1, .bp2 = 1, .bp3 = 1
536 };
537 struct crisv32_watch_entry *watch;
538 unsigned arbiter = (unsigned)dev_id;
539
540 masked_intr = REG_RD(marb_foo, regi_marb_foo, r_masked_intr);
541
542 if (masked_intr.bp0)
543 watch = &watches[arbiter][0];
544 else if (masked_intr.bp1)
545 watch = &watches[arbiter][1];
546 else if (masked_intr.bp2)
547 watch = &watches[arbiter][2];
548 else if (masked_intr.bp3)
549 watch = &watches[arbiter][3];
550 else
551 return IRQ_NONE;
552
553 /* Retrieve all useful information and print it. */
554 r_clients = REG_RD(marb_foo_bp, watch->instance, r_brk_clients);
555 r_addr = REG_RD(marb_foo_bp, watch->instance, r_brk_addr);
556 r_op = REG_RD(marb_foo_bp, watch->instance, r_brk_op);
557 r_first = REG_RD(marb_foo_bp, watch->instance, r_brk_first_client);
558 r_size = REG_RD(marb_foo_bp, watch->instance, r_brk_size);
559
560 printk(KERN_DEBUG "Arbiter IRQ\n");
561 printk(KERN_DEBUG "Clients %X addr %X op %X first %X size %X\n",
562 REG_TYPE_CONV(int, reg_marb_foo_bp_r_brk_clients, r_clients),
563 REG_TYPE_CONV(int, reg_marb_foo_bp_r_brk_addr, r_addr),
564 REG_TYPE_CONV(int, reg_marb_foo_bp_r_brk_op, r_op),
565 REG_TYPE_CONV(int, reg_marb_foo_bp_r_brk_first_client, r_first),
566 REG_TYPE_CONV(int, reg_marb_foo_bp_r_brk_size, r_size));
567
568 REG_WR(marb_foo_bp, watch->instance, rw_ack, ack);
569 REG_WR(marb_foo, regi_marb_foo, rw_ack_intr, ack_intr);
570
571 printk(KERN_DEBUG "IRQ occured at %X\n", (unsigned)get_irq_regs());
572
573 if (watch->cb)
574 watch->cb();
575
576 return IRQ_HANDLED;
577}
578
579static irqreturn_t
580crisv32_bar_arbiter_irq(int irq, void *dev_id)
581{
582 reg_marb_bar_r_masked_intr masked_intr =
583 REG_RD(marb_bar, regi_marb_bar, r_masked_intr);
584 reg_marb_bar_bp_r_brk_clients r_clients;
585 reg_marb_bar_bp_r_brk_addr r_addr;
586 reg_marb_bar_bp_r_brk_op r_op;
587 reg_marb_bar_bp_r_brk_first_client r_first;
588 reg_marb_bar_bp_r_brk_size r_size;
589 reg_marb_bar_bp_rw_ack ack = {0};
590 reg_marb_bar_rw_ack_intr ack_intr = {
591 .bp0 = 1, .bp1 = 1, .bp2 = 1, .bp3 = 1
592 };
593 struct crisv32_watch_entry *watch;
594 unsigned arbiter = (unsigned)dev_id;
595
596 masked_intr = REG_RD(marb_bar, regi_marb_bar, r_masked_intr);
597
598 if (masked_intr.bp0)
599 watch = &watches[arbiter][0];
600 else if (masked_intr.bp1)
601 watch = &watches[arbiter][1];
602 else if (masked_intr.bp2)
603 watch = &watches[arbiter][2];
604 else if (masked_intr.bp3)
605 watch = &watches[arbiter][3];
606 else
607 return IRQ_NONE;
608
609 /* Retrieve all useful information and print it. */
610 r_clients = REG_RD(marb_bar_bp, watch->instance, r_brk_clients);
611 r_addr = REG_RD(marb_bar_bp, watch->instance, r_brk_addr);
612 r_op = REG_RD(marb_bar_bp, watch->instance, r_brk_op);
613 r_first = REG_RD(marb_bar_bp, watch->instance, r_brk_first_client);
614 r_size = REG_RD(marb_bar_bp, watch->instance, r_brk_size);
615
616 printk(KERN_DEBUG "Arbiter IRQ\n");
617 printk(KERN_DEBUG "Clients %X addr %X op %X first %X size %X\n",
618 REG_TYPE_CONV(int, reg_marb_bar_bp_r_brk_clients, r_clients),
619 REG_TYPE_CONV(int, reg_marb_bar_bp_r_brk_addr, r_addr),
620 REG_TYPE_CONV(int, reg_marb_bar_bp_r_brk_op, r_op),
621 REG_TYPE_CONV(int, reg_marb_bar_bp_r_brk_first_client, r_first),
622 REG_TYPE_CONV(int, reg_marb_bar_bp_r_brk_size, r_size));
623
624 REG_WR(marb_bar_bp, watch->instance, rw_ack, ack);
625 REG_WR(marb_bar, regi_marb_bar, rw_ack_intr, ack_intr);
626
627 printk(KERN_DEBUG "IRQ occured at %X\n", (unsigned)get_irq_regs()->erp);
628
629 if (watch->cb)
630 watch->cb();
631
632 return IRQ_HANDLED;
633}
634
diff --git a/arch/cris/arch-v32/mach-a3/cpufreq.c b/arch/cris/arch-v32/mach-a3/cpufreq.c
new file mode 100644
index 000000000000..8e5a3cab8ad7
--- /dev/null
+++ b/arch/cris/arch-v32/mach-a3/cpufreq.c
@@ -0,0 +1,153 @@
1#include <linux/init.h>
2#include <linux/module.h>
3#include <linux/cpufreq.h>
4#include <hwregs/reg_map.h>
5#include <hwregs/reg_rdwr.h>
6#include <hwregs/clkgen_defs.h>
7#include <hwregs/ddr2_defs.h>
8
9static int
10cris_sdram_freq_notifier(struct notifier_block *nb, unsigned long val,
11 void *data);
12
13static struct notifier_block cris_sdram_freq_notifier_block = {
14 .notifier_call = cris_sdram_freq_notifier
15};
16
17static struct cpufreq_frequency_table cris_freq_table[] = {
18 {0x01, 6000},
19 {0x02, 200000},
20 {0, CPUFREQ_TABLE_END},
21};
22
23static unsigned int cris_freq_get_cpu_frequency(unsigned int cpu)
24{
25 reg_clkgen_rw_clk_ctrl clk_ctrl;
26 clk_ctrl = REG_RD(clkgen, regi_clkgen, rw_clk_ctrl);
27 return clk_ctrl.pll ? 200000 : 6000;
28}
29
30static void cris_freq_set_cpu_state(unsigned int state)
31{
32 int i = 0;
33 struct cpufreq_freqs freqs;
34 reg_clkgen_rw_clk_ctrl clk_ctrl;
35 clk_ctrl = REG_RD(clkgen, regi_clkgen, rw_clk_ctrl);
36
37#ifdef CONFIG_SMP
38 for_each_present_cpu(i)
39#endif
40 {
41 freqs.old = cris_freq_get_cpu_frequency(i);
42 freqs.new = cris_freq_table[state].frequency;
43 freqs.cpu = i;
44 }
45
46 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
47
48 local_irq_disable();
49
50 /* Even though we may be SMP they will share the same clock
51 * so all settings are made on CPU0. */
52 if (cris_freq_table[state].frequency == 200000)
53 clk_ctrl.pll = 1;
54 else
55 clk_ctrl.pll = 0;
56 REG_WR(clkgen, regi_clkgen, rw_clk_ctrl, clk_ctrl);
57
58 local_irq_enable();
59
60 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
61};
62
63static int cris_freq_verify(struct cpufreq_policy *policy)
64{
65 return cpufreq_frequency_table_verify(policy, &cris_freq_table[0]);
66}
67
68static int cris_freq_target(struct cpufreq_policy *policy,
69 unsigned int target_freq,
70 unsigned int relation)
71{
72 unsigned int newstate = 0;
73
74 if (cpufreq_frequency_table_target(policy, cris_freq_table,
75 target_freq, relation, &newstate))
76 return -EINVAL;
77
78 cris_freq_set_cpu_state(newstate);
79
80 return 0;
81}
82
83static int cris_freq_cpu_init(struct cpufreq_policy *policy)
84{
85 int result;
86
87 /* cpuinfo and default policy values */
88 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
89 policy->cpuinfo.transition_latency = 1000000; /* 1ms */
90 policy->cur = cris_freq_get_cpu_frequency(0);
91
92 result = cpufreq_frequency_table_cpuinfo(policy, cris_freq_table);
93 if (result)
94 return (result);
95
96 cpufreq_frequency_table_get_attr(cris_freq_table, policy->cpu);
97
98 return 0;
99}
100
101
102static int cris_freq_cpu_exit(struct cpufreq_policy *policy)
103{
104 cpufreq_frequency_table_put_attr(policy->cpu);
105 return 0;
106}
107
108
109static struct freq_attr *cris_freq_attr[] = {
110 &cpufreq_freq_attr_scaling_available_freqs,
111 NULL,
112};
113
114static struct cpufreq_driver cris_freq_driver = {
115 .get = cris_freq_get_cpu_frequency,
116 .verify = cris_freq_verify,
117 .target = cris_freq_target,
118 .init = cris_freq_cpu_init,
119 .exit = cris_freq_cpu_exit,
120 .name = "cris_freq",
121 .owner = THIS_MODULE,
122 .attr = cris_freq_attr,
123};
124
125static int __init cris_freq_init(void)
126{
127 int ret;
128 ret = cpufreq_register_driver(&cris_freq_driver);
129 cpufreq_register_notifier(&cris_sdram_freq_notifier_block,
130 CPUFREQ_TRANSITION_NOTIFIER);
131 return ret;
132}
133
134static int
135cris_sdram_freq_notifier(struct notifier_block *nb, unsigned long val,
136 void *data)
137{
138 int i;
139 struct cpufreq_freqs *freqs = data;
140 if (val == CPUFREQ_PRECHANGE) {
141 reg_ddr2_rw_cfg cfg =
142 REG_RD(ddr2, regi_ddr2_ctrl, rw_cfg);
143 cfg.ref_interval = (freqs->new == 200000 ? 1560 : 46);
144
145 if (freqs->new == 200000)
146 for (i = 0; i < 50000; i++);
147 REG_WR(bif_core, regi_bif_core, rw_sdram_timing, timing);
148 }
149 return 0;
150}
151
152
153module_init(cris_freq_init);
diff --git a/arch/cris/arch-v32/mach-a3/dma.c b/arch/cris/arch-v32/mach-a3/dma.c
new file mode 100644
index 000000000000..25f236ef0b81
--- /dev/null
+++ b/arch/cris/arch-v32/mach-a3/dma.c
@@ -0,0 +1,185 @@
1/* Wrapper for DMA channel allocator that starts clocks etc */
2
3#include <linux/kernel.h>
4#include <linux/spinlock.h>
5#include <asm/arch/mach/dma.h>
6#include <hwregs/reg_map.h>
7#include <hwregs/reg_rdwr.h>
8#include <hwregs/marb_defs.h>
9#include <hwregs/clkgen_defs.h>
10#include <hwregs/strmux_defs.h>
11#include <linux/errno.h>
12#include <asm/system.h>
13#include <arbiter.h>
14
15static char used_dma_channels[MAX_DMA_CHANNELS];
16static const char *used_dma_channels_users[MAX_DMA_CHANNELS];
17
18static DEFINE_SPINLOCK(dma_lock);
19
20int crisv32_request_dma(unsigned int dmanr, const char *device_id,
21 unsigned options, unsigned int bandwidth, enum dma_owner owner)
22{
23 unsigned long flags;
24 reg_clkgen_rw_clk_ctrl clk_ctrl;
25 reg_strmux_rw_cfg strmux_cfg;
26
27 if (crisv32_arbiter_allocate_bandwidth(dmanr,
28 options & DMA_INT_MEM ? INT_REGION : EXT_REGION,
29 bandwidth))
30 return -ENOMEM;
31
32 spin_lock_irqsave(&dma_lock, flags);
33
34 if (used_dma_channels[dmanr]) {
35 spin_unlock_irqrestore(&dma_lock, flags);
36 if (options & DMA_VERBOSE_ON_ERROR)
37 printk(KERN_ERR "Failed to request DMA %i for %s, "
38 "already allocated by %s\n",
39 dmanr,
40 device_id,
41 used_dma_channels_users[dmanr]);
42
43 if (options & DMA_PANIC_ON_ERROR)
44 panic("request_dma error!");
45 spin_unlock_irqrestore(&dma_lock, flags);
46 return -EBUSY;
47 }
48 clk_ctrl = REG_RD(clkgen, regi_clkgen, rw_clk_ctrl);
49 strmux_cfg = REG_RD(strmux, regi_strmux, rw_cfg);
50
51 switch (dmanr) {
52 case 0:
53 case 1:
54 clk_ctrl.dma0_1_eth = 1;
55 break;
56 case 2:
57 case 3:
58 clk_ctrl.dma2_3_strcop = 1;
59 break;
60 case 4:
61 case 5:
62 clk_ctrl.dma4_5_iop = 1;
63 break;
64 case 6:
65 case 7:
66 clk_ctrl.sser_ser_dma6_7 = 1;
67 break;
68 case 9:
69 case 11:
70 clk_ctrl.dma9_11 = 1;
71 break;
72#if MAX_DMA_CHANNELS-1 != 11
73#error Check dma.c
74#endif
75 default:
76 spin_unlock_irqrestore(&dma_lock, flags);
77 if (options & DMA_VERBOSE_ON_ERROR)
78 printk(KERN_ERR "Failed to request DMA %i for %s, "
79 "only 0-%i valid)\n",
80 dmanr, device_id, MAX_DMA_CHANNELS-1);
81
82 if (options & DMA_PANIC_ON_ERROR)
83 panic("request_dma error!");
84 return -EINVAL;
85 }
86
87 switch (owner) {
88 case dma_eth:
89 if (dmanr == 0)
90 strmux_cfg.dma0 = regk_strmux_eth;
91 else if (dmanr == 1)
92 strmux_cfg.dma1 = regk_strmux_eth;
93 else
94 panic("Invalid DMA channel for eth\n");
95 break;
96 case dma_ser0:
97 if (dmanr == 0)
98 strmux_cfg.dma0 = regk_strmux_ser0;
99 else if (dmanr == 1)
100 strmux_cfg.dma1 = regk_strmux_ser0;
101 else
102 panic("Invalid DMA channel for ser0\n");
103 break;
104 case dma_ser3:
105 if (dmanr == 2)
106 strmux_cfg.dma2 = regk_strmux_ser3;
107 else if (dmanr == 3)
108 strmux_cfg.dma3 = regk_strmux_ser3;
109 else
110 panic("Invalid DMA channel for ser3\n");
111 break;
112 case dma_strp:
113 if (dmanr == 2)
114 strmux_cfg.dma2 = regk_strmux_strcop;
115 else if (dmanr == 3)
116 strmux_cfg.dma3 = regk_strmux_strcop;
117 else
118 panic("Invalid DMA channel for strp\n");
119 break;
120 case dma_ser1:
121 if (dmanr == 4)
122 strmux_cfg.dma4 = regk_strmux_ser1;
123 else if (dmanr == 5)
124 strmux_cfg.dma5 = regk_strmux_ser1;
125 else
126 panic("Invalid DMA channel for ser1\n");
127 break;
128 case dma_iop:
129 if (dmanr == 4)
130 strmux_cfg.dma4 = regk_strmux_iop;
131 else if (dmanr == 5)
132 strmux_cfg.dma5 = regk_strmux_iop;
133 else
134 panic("Invalid DMA channel for iop\n");
135 break;
136 case dma_ser2:
137 if (dmanr == 6)
138 strmux_cfg.dma6 = regk_strmux_ser2;
139 else if (dmanr == 7)
140 strmux_cfg.dma7 = regk_strmux_ser2;
141 else
142 panic("Invalid DMA channel for ser2\n");
143 break;
144 case dma_sser:
145 if (dmanr == 6)
146 strmux_cfg.dma6 = regk_strmux_sser;
147 else if (dmanr == 7)
148 strmux_cfg.dma7 = regk_strmux_sser;
149 else
150 panic("Invalid DMA channel for sser\n");
151 break;
152 case dma_ser4:
153 if (dmanr == 9)
154 strmux_cfg.dma9 = regk_strmux_ser4;
155 else
156 panic("Invalid DMA channel for ser4\n");
157 break;
158 case dma_jpeg:
159 if (dmanr == 9)
160 strmux_cfg.dma9 = regk_strmux_jpeg;
161 else
162 panic("Invalid DMA channel for JPEG\n");
163 break;
164 case dma_h264:
165 if (dmanr == 11)
166 strmux_cfg.dma11 = regk_strmux_h264;
167 else
168 panic("Invalid DMA channel for H264\n");
169 break;
170 }
171
172 used_dma_channels[dmanr] = 1;
173 used_dma_channels_users[dmanr] = device_id;
174 REG_WR(clkgen, regi_clkgen, rw_clk_ctrl, clk_ctrl);
175 REG_WR(strmux, regi_strmux, rw_cfg, strmux_cfg);
176 spin_unlock_irqrestore(&dma_lock, flags);
177 return 0;
178}
179
180void crisv32_free_dma(unsigned int dmanr)
181{
182 spin_lock(&dma_lock);
183 used_dma_channels[dmanr] = 0;
184 spin_unlock(&dma_lock);
185}
diff --git a/arch/cris/arch-v32/mach-a3/dram_init.S b/arch/cris/arch-v32/mach-a3/dram_init.S
new file mode 100644
index 000000000000..94d6b41cb299
--- /dev/null
+++ b/arch/cris/arch-v32/mach-a3/dram_init.S
@@ -0,0 +1,104 @@
1/*
2 * DDR SDRAM initialization - alter with care
3 * This file is intended to be included from other assembler files
4 *
5 * Note: This file may not modify r8 or r9 because they are used to
6 * carry information from the decompresser to the kernel
7 *
8 * Copyright (C) 2005-2007 Axis Communications AB
9 *
10 * Authors: Mikael Starvik <starvik@axis.com>
11 */
12
13/* Just to be certain the config file is included, we include it here
14 * explicitely instead of depending on it being included in the file that
15 * uses this code.
16 */
17
18#include <hwregs/asm/reg_map_asm.h>
19#include <hwregs/asm/ddr2_defs_asm.h>
20
21 ;; WARNING! The registers r8 and r9 are used as parameters carrying
22 ;; information from the decompressor (if the kernel was compressed).
23 ;; They should not be used in the code below.
24
25 ;; Refer to ddr2 MDS for initialization sequence
26
27 ; Start clock
28 move.d REG_ADDR(ddr2, regi_ddr2_ctrl, rw_phy_cfg), $r0
29 move.d REG_STATE(ddr2, rw_phy_cfg, en, yes), $r1
30 move.d $r1, [$r0]
31
32 ; Reset phy and start calibration
33 move.d REG_ADDR(ddr2, regi_ddr2_ctrl, rw_phy_ctrl), $r0
34 move.d REG_STATE(ddr2, rw_phy_ctrl, rst, yes) | \
35 REG_STATE(ddr2, rw_phy_ctrl, cal_rst, yes), $r1
36 move.d $r1, [$r0]
37 move.d REG_STATE(ddr2, rw_phy_ctrl, cal_start, yes), $r1
38 move.d $r1, [$r0]
39
40 ; 2. Wait 200us
41 move.d 10000, $r2
421: bne 1b
43 subq 1, $r2
44
45 ; Issue commands
46 move.d REG_ADDR(ddr2, regi_ddr2_ctrl, rw_ctrl), $r0
47 move.d sdram_commands_start, $r2
48command_loop:
49 movu.b [$r2+], $r1
50 movu.w [$r2+], $r3
51do_cmd:
52 lslq 16, $r1
53 or.d $r3, $r1
54 move.d $r1, [$r0]
55 cmp.d sdram_commands_end, $r2
56 blo command_loop
57 nop
58
59 ; Set timing
60 move.d REG_ADDR(ddr2, regi_ddr2_ctrl, rw_timing), $r0
61 move.d CONFIG_ETRAX_DDR2_TIMING, $r1
62 move.d $r1, [$r0]
63
64 ; Set latency
65 move.d REG_ADDR(ddr2, regi_ddr2_ctrl, rw_latency), $r0
66 move.d 0x13, $r1
67 move.d $r1, [$r0]
68
69 ; Set configuration
70 move.d REG_ADDR(ddr2, regi_ddr2_ctrl, rw_cfg), $r0
71 move.d CONFIG_ETRAX_DDR2_CONFIG, $r1
72 move.d $r1, [$r0]
73
74 ba after_sdram_commands
75 nop
76
77sdram_commands_start:
78 .byte regk_ddr2_deselect
79 .word 0
80 .byte regk_ddr2_pre
81 .word regk_ddr2_pre_all
82 .byte regk_ddr2_emrs2
83 .word 0
84 .byte regk_ddr2_emrs3
85 .word 0
86 .byte regk_ddr2_emrs
87 .word regk_ddr2_dll_en
88 .byte regk_ddr2_mrs
89 .word regk_ddr2_dll_rst
90 .byte regk_ddr2_pre
91 .word regk_ddr2_pre_all
92 .byte regk_ddr2_ref
93 .word 0
94 .byte regk_ddr2_ref
95 .word 0
96 .byte regk_ddr2_mrs
97 .word CONFIG_ETRAX_DDR2_MRS & 0xffff
98 .byte regk_ddr2_emrs
99 .word regk_ddr2_ocd_default | regk_ddr2_dll_en
100 .byte regk_ddr2_emrs
101 .word regk_ddr2_ocd_exit | regk_ddr2_dll_en | (CONFIG_ETRAX_DDR2_MRS >> 16)
102sdram_commands_end:
103 .align 1
104after_sdram_commands:
diff --git a/arch/cris/arch-v32/mach-a3/hw_settings.S b/arch/cris/arch-v32/mach-a3/hw_settings.S
new file mode 100644
index 000000000000..258a6329cd4a
--- /dev/null
+++ b/arch/cris/arch-v32/mach-a3/hw_settings.S
@@ -0,0 +1,51 @@
1/*
2 * This table is used by some tools to extract hardware parameters.
3 * The table should be included in the kernel and the decompressor.
4 * Don't forget to update the tools if you change this table.
5 *
6 * Copyright (C) 2001-2007 Axis Communications AB
7 *
8 * Authors: Mikael Starvik <starvik@axis.com>
9 */
10
11#include <hwregs/asm/reg_map_asm.h>
12#include <hwregs/asm/ddr2_defs_asm.h>
13#include <hwregs/asm/gio_defs_asm.h>
14
15 .ascii "HW_PARAM_MAGIC" ; Magic number
16 .dword 0xc0004000 ; Kernel start address
17
18 ; Debug port
19#ifdef CONFIG_ETRAX_DEBUG_PORT0
20 .dword 0
21#elif defined(CONFIG_ETRAX_DEBUG_PORT1)
22 .dword 1
23#elif defined(CONFIG_ETRAX_DEBUG_PORT2)
24 .dword 2
25#elif defined(CONFIG_ETRAX_DEBUG_PORT3)
26 .dword 3
27#else
28 .dword 4 ; No debug
29#endif
30
31 ; Register values
32 .dword REG_ADDR(ddr2, regi_ddr2_ctrl, rw_cfg)
33 .dword CONFIG_ETRAX_DDR2_CONFIG
34 .dword REG_ADDR(ddr2, regi_ddr2_ctrl, rw_timing)
35 .dword CONFIG_ETRAX_DDR2_TIMING
36 .dword CONFIG_ETRAX_DDR2_MRS
37
38 .dword REG_ADDR(gio, regi_gio, rw_pa_dout)
39 .dword CONFIG_ETRAX_DEF_GIO_PA_OUT
40 .dword REG_ADDR(gio, regi_gio, rw_pa_oe)
41 .dword CONFIG_ETRAX_DEF_GIO_PA_OE
42 .dword REG_ADDR(gio, regi_gio, rw_pb_dout)
43 .dword CONFIG_ETRAX_DEF_GIO_PB_OUT
44 .dword REG_ADDR(gio, regi_gio, rw_pb_oe)
45 .dword CONFIG_ETRAX_DEF_GIO_PB_OE
46 .dword REG_ADDR(gio, regi_gio, rw_pc_dout)
47 .dword CONFIG_ETRAX_DEF_GIO_PC_OUT
48 .dword REG_ADDR(gio, regi_gio, rw_pc_oe)
49 .dword CONFIG_ETRAX_DEF_GIO_PC_OE
50
51 .dword 0 ; No more register values
diff --git a/arch/cris/arch-v32/mach-a3/io.c b/arch/cris/arch-v32/mach-a3/io.c
new file mode 100644
index 000000000000..9eeaf3eca474
--- /dev/null
+++ b/arch/cris/arch-v32/mach-a3/io.c
@@ -0,0 +1,149 @@
1/*
2 * Helper functions for I/O pins.
3 *
4 * Copyright (c) 2005-2007 Axis Communications AB.
5 */
6
7#include <linux/types.h>
8#include <linux/errno.h>
9#include <linux/init.h>
10#include <linux/string.h>
11#include <linux/ctype.h>
12#include <linux/kernel.h>
13#include <linux/module.h>
14#include <asm/io.h>
15#include <asm/arch/mach/pinmux.h>
16#include <hwregs/gio_defs.h>
17
18struct crisv32_ioport crisv32_ioports[] = {
19 {
20 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pa_oe),
21 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pa_dout),
22 (unsigned long *)REG_ADDR(gio, regi_gio, r_pa_din),
23 32
24 },
25 {
26 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pb_oe),
27 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pb_dout),
28 (unsigned long *)REG_ADDR(gio, regi_gio, r_pb_din),
29 32
30 },
31 {
32 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pc_oe),
33 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pc_dout),
34 (unsigned long *)REG_ADDR(gio, regi_gio, r_pc_din),
35 16
36 },
37};
38
39#define NBR_OF_PORTS sizeof(crisv32_ioports)/sizeof(struct crisv32_ioport)
40
41struct crisv32_iopin crisv32_led_net0_green;
42struct crisv32_iopin crisv32_led_net0_red;
43struct crisv32_iopin crisv32_led2_green;
44struct crisv32_iopin crisv32_led2_red;
45struct crisv32_iopin crisv32_led3_green;
46struct crisv32_iopin crisv32_led3_red;
47
48/* Dummy port used when green LED and red LED is on the same bit */
49static unsigned long io_dummy;
50static struct crisv32_ioport dummy_port = {
51 &io_dummy,
52 &io_dummy,
53 &io_dummy,
54 32
55};
56static struct crisv32_iopin dummy_led = {
57 &dummy_port,
58 0
59};
60
61static int __init crisv32_io_init(void)
62{
63 int ret = 0;
64
65 u32 i;
66
67 /* Locks *should* be dynamically initialized. */
68 for (i = 0; i < ARRAY_SIZE(crisv32_ioports); i++)
69 spin_lock_init(&crisv32_ioports[i].lock);
70 spin_lock_init(&dummy_port.lock);
71
72 /* Initialize LEDs */
73#if (defined(CONFIG_ETRAX_NBR_LED_GRP_ONE) || defined(CONFIG_ETRAX_NBR_LED_GRP_TWO))
74 ret += crisv32_io_get_name(&crisv32_led_net0_green,
75 CONFIG_ETRAX_LED_G_NET0);
76 crisv32_io_set_dir(&crisv32_led_net0_green, crisv32_io_dir_out);
77 if (strcmp(CONFIG_ETRAX_LED_G_NET0, CONFIG_ETRAX_LED_R_NET0)) {
78 ret += crisv32_io_get_name(&crisv32_led_net0_red,
79 CONFIG_ETRAX_LED_R_NET0);
80 crisv32_io_set_dir(&crisv32_led_net0_red, crisv32_io_dir_out);
81 } else
82 crisv32_led_net0_red = dummy_led;
83#endif
84
85 ret += crisv32_io_get_name(&crisv32_led2_green, CONFIG_ETRAX_V32_LED2G);
86 ret += crisv32_io_get_name(&crisv32_led2_red, CONFIG_ETRAX_V32_LED2R);
87 ret += crisv32_io_get_name(&crisv32_led3_green, CONFIG_ETRAX_V32_LED3G);
88 ret += crisv32_io_get_name(&crisv32_led3_red, CONFIG_ETRAX_V32_LED3R);
89
90 crisv32_io_set_dir(&crisv32_led2_green, crisv32_io_dir_out);
91 crisv32_io_set_dir(&crisv32_led2_red, crisv32_io_dir_out);
92 crisv32_io_set_dir(&crisv32_led3_green, crisv32_io_dir_out);
93 crisv32_io_set_dir(&crisv32_led3_red, crisv32_io_dir_out);
94
95 return ret;
96}
97
98__initcall(crisv32_io_init);
99
100int crisv32_io_get(struct crisv32_iopin *iopin,
101 unsigned int port, unsigned int pin)
102{
103 if (port > NBR_OF_PORTS)
104 return -EINVAL;
105 if (port > crisv32_ioports[port].pin_count)
106 return -EINVAL;
107
108 iopin->bit = 1 << pin;
109 iopin->port = &crisv32_ioports[port];
110
111 if (crisv32_pinmux_alloc(port, pin, pin, pinmux_gpio))
112 return -EIO;
113
114 return 0;
115}
116
117int crisv32_io_get_name(struct crisv32_iopin *iopin, const char *name)
118{
119 int port;
120 int pin;
121
122 if (toupper(*name) == 'P')
123 name++;
124
125 if (toupper(*name) < 'A' || toupper(*name) > 'E')
126 return -EINVAL;
127
128 port = toupper(*name) - 'A';
129 name++;
130 pin = simple_strtoul(name, NULL, 10);
131
132 if (pin < 0 || pin > crisv32_ioports[port].pin_count)
133 return -EINVAL;
134
135 iopin->bit = 1 << pin;
136 iopin->port = &crisv32_ioports[port];
137
138 if (crisv32_pinmux_alloc(port, pin, pin, pinmux_gpio))
139 return -EIO;
140
141 return 0;
142}
143
144#ifdef CONFIG_PCI
145/* PCI I/O access stuff */
146struct cris_io_operations *cris_iops = NULL;
147EXPORT_SYMBOL(cris_iops);
148#endif
149
diff --git a/arch/cris/arch-v32/mach-a3/pinmux.c b/arch/cris/arch-v32/mach-a3/pinmux.c
new file mode 100644
index 000000000000..0a28c9bedfb7
--- /dev/null
+++ b/arch/cris/arch-v32/mach-a3/pinmux.c
@@ -0,0 +1,386 @@
1/*
2 * Allocator for I/O pins. All pins are allocated to GPIO at bootup.
3 * Unassigned pins and GPIO pins can be allocated to a fixed interface
4 * or the I/O processor instead.
5 *
6 * Copyright (c) 2005-2007 Axis Communications AB.
7 */
8
9#include <linux/init.h>
10#include <linux/errno.h>
11#include <linux/kernel.h>
12#include <linux/string.h>
13#include <linux/spinlock.h>
14#include <hwregs/reg_map.h>
15#include <hwregs/reg_rdwr.h>
16#include <pinmux.h>
17#include <hwregs/pinmux_defs.h>
18#include <hwregs/clkgen_defs.h>
19
20#undef DEBUG
21
22#define PINS 80
23#define PORT_PINS 32
24#define PORTS 3
25
26static char pins[PINS];
27static DEFINE_SPINLOCK(pinmux_lock);
28
29static void crisv32_pinmux_set(int port);
30
31int
32crisv32_pinmux_init(void)
33{
34 static int initialized;
35
36 if (!initialized) {
37 initialized = 1;
38 REG_WR_INT(pinmux, regi_pinmux, rw_hwprot, 0);
39 crisv32_pinmux_alloc(PORT_A, 0, 31, pinmux_gpio);
40 crisv32_pinmux_alloc(PORT_B, 0, 31, pinmux_gpio);
41 crisv32_pinmux_alloc(PORT_C, 0, 15, pinmux_gpio);
42 }
43
44 return 0;
45}
46
47int
48crisv32_pinmux_alloc(int port, int first_pin, int last_pin, enum pin_mode mode)
49{
50 int i;
51 unsigned long flags;
52
53 crisv32_pinmux_init();
54
55 if (port >= PORTS)
56 return -EINVAL;
57
58 spin_lock_irqsave(&pinmux_lock, flags);
59
60 for (i = first_pin; i <= last_pin; i++) {
61 if ((pins[port * PORT_PINS + i] != pinmux_none) &&
62 (pins[port * PORT_PINS + i] != pinmux_gpio) &&
63 (pins[port * PORT_PINS + i] != mode)) {
64 spin_unlock_irqrestore(&pinmux_lock, flags);
65#ifdef DEBUG
66 panic("Pinmux alloc failed!\n");
67#endif
68 return -EPERM;
69 }
70 }
71
72 for (i = first_pin; i <= last_pin; i++)
73 pins[port * PORT_PINS + i] = mode;
74
75 crisv32_pinmux_set(port);
76
77 spin_unlock_irqrestore(&pinmux_lock, flags);
78
79 return 0;
80}
81
82int
83crisv32_pinmux_alloc_fixed(enum fixed_function function)
84{
85 int ret = -EINVAL;
86 char saved[sizeof pins];
87 unsigned long flags;
88
89 spin_lock_irqsave(&pinmux_lock, flags);
90
91 /* Save internal data for recovery */
92 memcpy(saved, pins, sizeof pins);
93
94 crisv32_pinmux_init(); /* must be done before we read rw_hwprot */
95
96 reg_pinmux_rw_hwprot hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot);
97 reg_clkgen_rw_clk_ctrl clk_ctrl = REG_RD(clkgen, regi_clkgen,
98 rw_clk_ctrl);
99
100 switch (function) {
101 case pinmux_eth:
102 clk_ctrl.eth = regk_clkgen_yes;
103 clk_ctrl.dma0_1_eth = regk_clkgen_yes;
104 ret = crisv32_pinmux_alloc(PORT_B, 8, 23, pinmux_fixed);
105 ret |= crisv32_pinmux_alloc(PORT_B, 24, 25, pinmux_fixed);
106 hwprot.eth = hwprot.eth_mdio = regk_pinmux_yes;
107 break;
108 case pinmux_geth:
109 ret = crisv32_pinmux_alloc(PORT_B, 0, 7, pinmux_fixed);
110 hwprot.geth = regk_pinmux_yes;
111 break;
112 case pinmux_tg_cmos:
113 clk_ctrl.ccd_tg_100 = clk_ctrl.ccd_tg_200 = regk_clkgen_yes;
114 ret = crisv32_pinmux_alloc(PORT_B, 27, 29, pinmux_fixed);
115 hwprot.tg_clk = regk_pinmux_yes;
116 break;
117 case pinmux_tg_ccd:
118 clk_ctrl.ccd_tg_100 = clk_ctrl.ccd_tg_200 = regk_clkgen_yes;
119 ret = crisv32_pinmux_alloc(PORT_B, 27, 31, pinmux_fixed);
120 ret |= crisv32_pinmux_alloc(PORT_C, 0, 15, pinmux_fixed);
121 hwprot.tg = hwprot.tg_clk = regk_pinmux_yes;
122 break;
123 case pinmux_vout:
124 clk_ctrl.strdma0_2_video = regk_clkgen_yes;
125 ret = crisv32_pinmux_alloc(PORT_A, 8, 18, pinmux_fixed);
126 hwprot.vout = hwprot.vout_sync = regk_pinmux_yes;
127 break;
128 case pinmux_ser1:
129 clk_ctrl.sser_ser_dma6_7 = regk_clkgen_yes;
130 ret = crisv32_pinmux_alloc(PORT_A, 24, 25, pinmux_fixed);
131 hwprot.ser1 = regk_pinmux_yes;
132 break;
133 case pinmux_ser2:
134 clk_ctrl.sser_ser_dma6_7 = regk_clkgen_yes;
135 ret = crisv32_pinmux_alloc(PORT_A, 26, 27, pinmux_fixed);
136 hwprot.ser2 = regk_pinmux_yes;
137 break;
138 case pinmux_ser3:
139 clk_ctrl.sser_ser_dma6_7 = regk_clkgen_yes;
140 ret = crisv32_pinmux_alloc(PORT_A, 28, 29, pinmux_fixed);
141 hwprot.ser3 = regk_pinmux_yes;
142 break;
143 case pinmux_ser4:
144 clk_ctrl.sser_ser_dma6_7 = regk_clkgen_yes;
145 ret = crisv32_pinmux_alloc(PORT_A, 30, 31, pinmux_fixed);
146 hwprot.ser4 = regk_pinmux_yes;
147 break;
148 case pinmux_sser:
149 clk_ctrl.sser_ser_dma6_7 = regk_clkgen_yes;
150 ret = crisv32_pinmux_alloc(PORT_A, 19, 23, pinmux_fixed);
151 hwprot.sser = regk_pinmux_yes;
152 break;
153 case pinmux_pio:
154 hwprot.pio = regk_pinmux_yes;
155 ret = 0;
156 break;
157 case pinmux_pwm0:
158 ret = crisv32_pinmux_alloc(PORT_A, 30, 30, pinmux_fixed);
159 hwprot.pwm0 = regk_pinmux_yes;
160 break;
161 case pinmux_pwm1:
162 ret = crisv32_pinmux_alloc(PORT_A, 31, 31, pinmux_fixed);
163 hwprot.pwm1 = regk_pinmux_yes;
164 break;
165 case pinmux_pwm2:
166 ret = crisv32_pinmux_alloc(PORT_B, 26, 26, pinmux_fixed);
167 hwprot.pwm2 = regk_pinmux_yes;
168 break;
169 case pinmux_i2c0:
170 ret = crisv32_pinmux_alloc(PORT_A, 0, 1, pinmux_fixed);
171 hwprot.i2c0 = regk_pinmux_yes;
172 break;
173 case pinmux_i2c1:
174 ret = crisv32_pinmux_alloc(PORT_A, 2, 3, pinmux_fixed);
175 hwprot.i2c1 = regk_pinmux_yes;
176 break;
177 case pinmux_i2c1_3wire:
178 ret = crisv32_pinmux_alloc(PORT_A, 2, 3, pinmux_fixed);
179 ret |= crisv32_pinmux_alloc(PORT_A, 7, 7, pinmux_fixed);
180 hwprot.i2c1 = hwprot.i2c1_sen = regk_pinmux_yes;
181 break;
182 case pinmux_i2c1_sda1:
183 ret = crisv32_pinmux_alloc(PORT_A, 2, 4, pinmux_fixed);
184 hwprot.i2c1 = hwprot.i2c1_sda1 = regk_pinmux_yes;
185 break;
186 case pinmux_i2c1_sda2:
187 ret = crisv32_pinmux_alloc(PORT_A, 2, 3, pinmux_fixed);
188 ret |= crisv32_pinmux_alloc(PORT_A, 5, 5, pinmux_fixed);
189 hwprot.i2c1 = hwprot.i2c1_sda2 = regk_pinmux_yes;
190 break;
191 case pinmux_i2c1_sda3:
192 ret = crisv32_pinmux_alloc(PORT_A, 2, 3, pinmux_fixed);
193 ret |= crisv32_pinmux_alloc(PORT_A, 6, 6, pinmux_fixed);
194 hwprot.i2c1 = hwprot.i2c1_sda3 = regk_pinmux_yes;
195 break;
196 default:
197 ret = -EINVAL;
198 break;
199 }
200
201 if (!ret) {
202 REG_WR(pinmux, regi_pinmux, rw_hwprot, hwprot);
203 REG_WR(clkgen, regi_clkgen, rw_clk_ctrl, clk_ctrl);
204 } else
205 memcpy(pins, saved, sizeof pins);
206
207 spin_unlock_irqrestore(&pinmux_lock, flags);
208
209 return ret;
210}
211
212void
213crisv32_pinmux_set(int port)
214{
215 int i;
216 int gpio_val = 0;
217 int iop_val = 0;
218 int pin = port * PORT_PINS;
219
220 for (i = 0; (i < PORT_PINS) && (pin < PINS); i++, pin++) {
221 if (pins[pin] == pinmux_gpio)
222 gpio_val |= (1 << i);
223 else if (pins[pin] == pinmux_iop)
224 iop_val |= (1 << i);
225 }
226
227 REG_WRITE(int, regi_pinmux + REG_RD_ADDR_pinmux_rw_gio_pa + 4 * port,
228 gpio_val);
229 REG_WRITE(int, regi_pinmux + REG_RD_ADDR_pinmux_rw_iop_pa + 4 * port,
230 iop_val);
231
232#ifdef DEBUG
233 crisv32_pinmux_dump();
234#endif
235}
236
237int
238crisv32_pinmux_dealloc(int port, int first_pin, int last_pin)
239{
240 int i;
241 unsigned long flags;
242
243 crisv32_pinmux_init();
244
245 if (port > PORTS)
246 return -EINVAL;
247
248 spin_lock_irqsave(&pinmux_lock, flags);
249
250 for (i = first_pin; i <= last_pin; i++)
251 pins[port * PORT_PINS + i] = pinmux_none;
252
253 crisv32_pinmux_set(port);
254 spin_unlock_irqrestore(&pinmux_lock, flags);
255
256 return 0;
257}
258
259int
260crisv32_pinmux_dealloc_fixed(enum fixed_function function)
261{
262 int ret = -EINVAL;
263 char saved[sizeof pins];
264 unsigned long flags;
265
266 spin_lock_irqsave(&pinmux_lock, flags);
267
268 /* Save internal data for recovery */
269 memcpy(saved, pins, sizeof pins);
270
271 crisv32_pinmux_init(); /* must be done before we read rw_hwprot */
272
273 reg_pinmux_rw_hwprot hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot);
274
275 switch (function) {
276 case pinmux_eth:
277 ret = crisv32_pinmux_dealloc(PORT_B, 8, 23);
278 ret |= crisv32_pinmux_dealloc(PORT_B, 24, 25);
279 ret |= crisv32_pinmux_dealloc(PORT_B, 0, 7);
280 hwprot.eth = hwprot.eth_mdio = hwprot.geth = regk_pinmux_no;
281 break;
282 case pinmux_tg_cmos:
283 ret = crisv32_pinmux_dealloc(PORT_B, 27, 29);
284 hwprot.tg_clk = regk_pinmux_no;
285 break;
286 case pinmux_tg_ccd:
287 ret = crisv32_pinmux_dealloc(PORT_B, 27, 31);
288 ret |= crisv32_pinmux_dealloc(PORT_C, 0, 15);
289 hwprot.tg = hwprot.tg_clk = regk_pinmux_no;
290 break;
291 case pinmux_vout:
292 ret = crisv32_pinmux_dealloc(PORT_A, 8, 18);
293 hwprot.vout = hwprot.vout_sync = regk_pinmux_no;
294 break;
295 case pinmux_ser1:
296 ret = crisv32_pinmux_dealloc(PORT_A, 24, 25);
297 hwprot.ser1 = regk_pinmux_no;
298 break;
299 case pinmux_ser2:
300 ret = crisv32_pinmux_dealloc(PORT_A, 26, 27);
301 hwprot.ser2 = regk_pinmux_no;
302 break;
303 case pinmux_ser3:
304 ret = crisv32_pinmux_dealloc(PORT_A, 28, 29);
305 hwprot.ser3 = regk_pinmux_no;
306 break;
307 case pinmux_ser4:
308 ret = crisv32_pinmux_dealloc(PORT_A, 30, 31);
309 hwprot.ser4 = regk_pinmux_no;
310 break;
311 case pinmux_sser:
312 ret = crisv32_pinmux_dealloc(PORT_A, 19, 23);
313 hwprot.sser = regk_pinmux_no;
314 break;
315 case pinmux_pwm0:
316 ret = crisv32_pinmux_dealloc(PORT_A, 30, 30);
317 hwprot.pwm0 = regk_pinmux_no;
318 break;
319 case pinmux_pwm1:
320 ret = crisv32_pinmux_dealloc(PORT_A, 31, 31);
321 hwprot.pwm1 = regk_pinmux_no;
322 break;
323 case pinmux_pwm2:
324 ret = crisv32_pinmux_dealloc(PORT_B, 26, 26);
325 hwprot.pwm2 = regk_pinmux_no;
326 break;
327 case pinmux_i2c0:
328 ret = crisv32_pinmux_dealloc(PORT_A, 0, 1);
329 hwprot.i2c0 = regk_pinmux_no;
330 break;
331 case pinmux_i2c1:
332 ret = crisv32_pinmux_dealloc(PORT_A, 2, 3);
333 hwprot.i2c1 = regk_pinmux_no;
334 break;
335 case pinmux_i2c1_3wire:
336 ret = crisv32_pinmux_dealloc(PORT_A, 2, 3);
337 ret |= crisv32_pinmux_dealloc(PORT_A, 7, 7);
338 hwprot.i2c1 = hwprot.i2c1_sen = regk_pinmux_no;
339 break;
340 case pinmux_i2c1_sda1:
341 ret = crisv32_pinmux_dealloc(PORT_A, 2, 4);
342 hwprot.i2c1_sda1 = regk_pinmux_no;
343 break;
344 case pinmux_i2c1_sda2:
345 ret = crisv32_pinmux_dealloc(PORT_A, 2, 3);
346 ret |= crisv32_pinmux_dealloc(PORT_A, 5, 5);
347 hwprot.i2c1_sda2 = regk_pinmux_no;
348 break;
349 case pinmux_i2c1_sda3:
350 ret = crisv32_pinmux_dealloc(PORT_A, 2, 3);
351 ret |= crisv32_pinmux_dealloc(PORT_A, 6, 6);
352 hwprot.i2c1_sda3 = regk_pinmux_no;
353 break;
354 default:
355 ret = -EINVAL;
356 break;
357 }
358
359 if (!ret)
360 REG_WR(pinmux, regi_pinmux, rw_hwprot, hwprot);
361 else
362 memcpy(pins, saved, sizeof pins);
363
364 spin_unlock_irqrestore(&pinmux_lock, flags);
365
366 return ret;
367}
368
369void
370crisv32_pinmux_dump(void)
371{
372 int i, j;
373 int pin = 0;
374
375 crisv32_pinmux_init();
376
377 for (i = 0; i < PORTS; i++) {
378 pin++;
379 printk(KERN_DEBUG "Port %c\n", 'A'+i);
380 for (j = 0; (j < PORT_PINS) && (pin < PINS); j++, pin++)
381 printk(KERN_DEBUG
382 " Pin %d = %d\n", j, pins[i * PORT_PINS + j]);
383 }
384}
385
386__initcall(crisv32_pinmux_init);
diff --git a/arch/cris/arch-v32/mach-a3/vcs_hook.c b/arch/cris/arch-v32/mach-a3/vcs_hook.c
new file mode 100644
index 000000000000..58b1a5469fd7
--- /dev/null
+++ b/arch/cris/arch-v32/mach-a3/vcs_hook.c
@@ -0,0 +1,103 @@
1/*
2 * Simulator hook mechanism
3 */
4
5#include "vcs_hook.h"
6#include <asm/io.h>
7#include <stdarg.h>
8
9#define HOOK_TRIG_ADDR 0xb7000000
10#define HOOK_MEM_BASE_ADDR 0xce000000
11
12static volatile unsigned *hook_base;
13
14#define HOOK_DATA(offset) hook_base[offset]
15#define VHOOK_DATA(offset) hook_base[offset]
16#define HOOK_TRIG(funcid) \
17 do { \
18 *((unsigned *) HOOK_TRIG_ADDR) = funcid; \
19 } while (0)
20#define HOOK_DATA_BYTE(offset) ((unsigned char *)hook_base)[offset]
21
22static void hook_init(void)
23{
24 static int first = 1;
25 if (first) {
26 first = 0;
27 hook_base = ioremap(HOOK_MEM_BASE_ADDR, 8192);
28 }
29}
30
31static unsigned hook_trig(unsigned id)
32{
33 unsigned ret;
34
35 /* preempt_disable(); */
36
37 /* Dummy read from mem to make sure data has propagated to memory
38 * before trigging */
39 ret = *hook_base;
40
41 /* trigger hook */
42 HOOK_TRIG(id);
43
44 /* wait for call to finish */
45 while (VHOOK_DATA(0) > 0) ;
46
47 /* extract return value */
48
49 ret = VHOOK_DATA(1);
50
51 return ret;
52}
53
54int hook_call(unsigned id, unsigned pcnt, ...)
55{
56 va_list ap;
57 int i;
58 unsigned ret;
59
60 hook_init();
61
62 HOOK_DATA(0) = id;
63
64 va_start(ap, pcnt);
65 for (i = 1; i <= pcnt; i++)
66 HOOK_DATA(i) = va_arg(ap, unsigned);
67 va_end(ap);
68
69 ret = hook_trig(id);
70
71 return ret;
72}
73
74int hook_call_str(unsigned id, unsigned size, const char *str)
75{
76 int i;
77 unsigned ret;
78
79 hook_init();
80
81 HOOK_DATA(0) = id;
82 HOOK_DATA(1) = size;
83
84 for (i = 0; i < size; i++)
85 HOOK_DATA_BYTE(8 + i) = str[i];
86 HOOK_DATA_BYTE(8 + i) = 0;
87
88 ret = hook_trig(id);
89
90 return ret;
91}
92
93void print_str(const char *str)
94{
95 int i;
96 /* find null at end of string */
97 for (i = 1; str[i]; i++) ;
98 hook_call(hook_print_str, i, str);
99}
100
101void CPU_WATCHDOG_TIMEOUT(unsigned t)
102{
103}
diff --git a/arch/cris/arch-v32/mach-a3/vcs_hook.h b/arch/cris/arch-v32/mach-a3/vcs_hook.h
new file mode 100644
index 000000000000..8b73d0e8392d
--- /dev/null
+++ b/arch/cris/arch-v32/mach-a3/vcs_hook.h
@@ -0,0 +1,58 @@
1/*
2 * Simulator hook call mechanism
3 */
4
5#ifndef __hook_h__
6#define __hook_h__
7
8int hook_call(unsigned id, unsigned pcnt, ...);
9int hook_call_str(unsigned id, unsigned size, const char *str);
10
11enum hook_ids {
12 hook_debug_on = 1,
13 hook_debug_off,
14 hook_stop_sim_ok,
15 hook_stop_sim_fail,
16 hook_alloc_shared,
17 hook_ptr_shared,
18 hook_free_shared,
19 hook_file2shared,
20 hook_cmp_shared,
21 hook_print_params,
22 hook_sim_time,
23 hook_stop_sim,
24 hook_kick_dog,
25 hook_dog_timeout,
26 hook_rand,
27 hook_srand,
28 hook_rand_range,
29 hook_print_str,
30 hook_print_hex,
31 hook_cmp_offset_shared,
32 hook_fill_random_shared,
33 hook_alloc_random_data,
34 hook_calloc_random_data,
35 hook_print_int,
36 hook_print_uint,
37 hook_fputc,
38 hook_init_fd,
39 hook_sbrk,
40 hook_print_context_descr,
41 hook_print_data_descr,
42 hook_print_group_descr,
43 hook_fill_shared,
44 hook_sl_srand,
45 hook_sl_rand_irange,
46 hook_sl_rand_urange,
47 hook_sl_sh_malloc_aligned,
48 hook_sl_sh_calloc_aligned,
49 hook_sl_sh_alloc_random_data,
50 hook_sl_sh_file2mem,
51 hook_sl_vera_mbox_handle,
52 hook_sl_vera_mbox_put,
53 hook_sl_vera_mbox_get,
54 hook_sl_system,
55 hook_sl_sh_hexdump
56};
57
58#endif
diff --git a/arch/cris/arch-v32/mach-fs/Kconfig b/arch/cris/arch-v32/mach-fs/Kconfig
new file mode 100644
index 000000000000..f6d74475f1c6
--- /dev/null
+++ b/arch/cris/arch-v32/mach-fs/Kconfig
@@ -0,0 +1,216 @@
1if ETRAXFS
2
3menu "ETRAX FS options"
4 depends on ETRAXFS
5
6config ETRAX_DRAM_VIRTUAL_BASE
7 hex
8 depends on ETRAX_ARCH_V32
9 default "c0000000"
10
11config ETRAX_SERIAL_PORTS
12 int
13 default 4
14
15config ETRAX_MEM_GRP1_CONFIG
16 hex "MEM_GRP1_CONFIG"
17 depends on ETRAX_ARCH_V32
18 default "4044a"
19 help
20 Waitstates for flash. The default value is suitable for the
21 standard flashes used in axis products (120 ns).
22
23config ETRAX_MEM_GRP2_CONFIG
24 hex "MEM_GRP2_CONFIG"
25 depends on ETRAX_ARCH_V32
26 default "0"
27 help
28 Waitstates for SRAM. 0 is a good choice for most Axis products.
29
30config ETRAX_MEM_GRP3_CONFIG
31 hex "MEM_GRP3_CONFIG"
32 depends on ETRAX_ARCH_V32
33 default "0"
34 help
35 Waitstates for CSP0-3. 0 is a good choice for most Axis products.
36 It may need to be changed if external devices such as extra
37 register-mapped LEDs are used.
38
39config ETRAX_MEM_GRP4_CONFIG
40 hex "MEM_GRP4_CONFIG"
41 depends on ETRAX_ARCH_V32
42 default "0"
43 help
44 Waitstates for CSP4-6. 0 is a good choice for most Axis products.
45
46config ETRAX_SDRAM_GRP0_CONFIG
47 hex "SDRAM_GRP0_CONFIG"
48 depends on ETRAX_ARCH_V32
49 default "336"
50 help
51 SDRAM configuration for group 0. The value depends on the
52 hardware configuration. The default value is suitable
53 for 32 MB organized as two 16 bits chips (e.g. Axis
54 part number 18550) connected as one 32 bit device (i.e. in
55 the same group).
56
57config ETRAX_SDRAM_GRP1_CONFIG
58 hex "SDRAM_GRP1_CONFIG"
59 depends on ETRAX_ARCH_V32
60 default "0"
61 help
62 SDRAM configuration for group 1. The defult value is 0
63 because group 1 is not used in the default configuration,
64 described in the help for SDRAM_GRP0_CONFIG.
65
66config ETRAX_SDRAM_TIMING
67 hex "SDRAM_TIMING"
68 depends on ETRAX_ARCH_V32
69 default "104a"
70 help
71 SDRAM timing parameters. The default value is ok for
72 most hardwares but large SDRAMs may require a faster
73 refresh (a.k.a 8K refresh). The default value implies
74 100MHz clock and SDR mode.
75
76config ETRAX_SDRAM_COMMAND
77 hex "SDRAM_COMMAND"
78 depends on ETRAX_ARCH_V32
79 default "0"
80 help
81 SDRAM command. Should be 0 unless you really know what
82 you are doing (may be != 0 for unusual address line
83 mappings such as in a MCM)..
84
85config ETRAX_DEF_GIO_PA_OE
86 hex "GIO_PA_OE"
87 depends on ETRAX_ARCH_V32
88 default "1c"
89 help
90 Configures the direction of general port A bits. 1 is out, 0 is in.
91 This is often totally different depending on the product used.
92 There are some guidelines though - if you know that only LED's are
93 connected to port PA, then they are usually connected to bits 2-4
94 and you can therefore use 1c. On other boards which don't have the
95 LED's at the general ports, these bits are used for all kinds of
96 stuff. If you don't know what to use, it is always safe to put all
97 as inputs, although floating inputs isn't good.
98
99config ETRAX_DEF_GIO_PA_OUT
100 hex "GIO_PA_OUT"
101 depends on ETRAX_ARCH_V32
102 default "00"
103 help
104 Configures the initial data for the general port A bits. Most
105 products should use 00 here.
106
107config ETRAX_DEF_GIO_PB_OE
108 hex "GIO_PB_OE"
109 depends on ETRAX_ARCH_V32
110 default "00000"
111 help
112 Configures the direction of general port B bits. 1 is out, 0 is in.
113 This is often totally different depending on the product used.
114 There are some guidelines though - if you know that only LED's are
115 connected to port PA, then they are usually connected to bits 2-4
116 and you can therefore use 1c. On other boards which don't have the
117 LED's at the general ports, these bits are used for all kinds of
118 stuff. If you don't know what to use, it is always safe to put all
119 as inputs, although floating inputs isn't good.
120
121config ETRAX_DEF_GIO_PB_OUT
122 hex "GIO_PB_OUT"
123 depends on ETRAX_ARCH_V32
124 default "00000"
125 help
126 Configures the initial data for the general port B bits. Most
127 products should use 00000 here.
128
129config ETRAX_DEF_GIO_PC_OE
130 hex "GIO_PC_OE"
131 depends on ETRAX_ARCH_V32
132 default "00000"
133 help
134 Configures the direction of general port C bits. 1 is out, 0 is in.
135 This is often totally different depending on the product used.
136 There are some guidelines though - if you know that only LED's are
137 connected to port PA, then they are usually connected to bits 2-4
138 and you can therefore use 1c. On other boards which don't have the
139 LED's at the general ports, these bits are used for all kinds of
140 stuff. If you don't know what to use, it is always safe to put all
141 as inputs, although floating inputs isn't good.
142
143config ETRAX_DEF_GIO_PC_OUT
144 hex "GIO_PC_OUT"
145 depends on ETRAX_ARCH_V32
146 default "00000"
147 help
148 Configures the initial data for the general port C bits. Most
149 products should use 00000 here.
150
151config ETRAX_DEF_GIO_PD_OE
152 hex "GIO_PD_OE"
153 depends on ETRAX_ARCH_V32
154 default "00000"
155 help
156 Configures the direction of general port D bits. 1 is out, 0 is in.
157 This is often totally different depending on the product used.
158 There are some guidelines though - if you know that only LED's are
159 connected to port PA, then they are usually connected to bits 2-4
160 and you can therefore use 1c. On other boards which don't have the
161 LED's at the general ports, these bits are used for all kinds of
162 stuff. If you don't know what to use, it is always safe to put all
163 as inputs, although floating inputs isn't good.
164
165config ETRAX_DEF_GIO_PD_OUT
166 hex "GIO_PD_OUT"
167 depends on ETRAX_ARCH_V32
168 default "00000"
169 help
170 Configures the initial data for the general port D bits. Most
171 products should use 00000 here.
172
173config ETRAX_DEF_GIO_PE_OE
174 hex "GIO_PE_OE"
175 depends on ETRAX_ARCH_V32
176 default "00000"
177 help
178 Configures the direction of general port E bits. 1 is out, 0 is in.
179 This is often totally different depending on the product used.
180 There are some guidelines though - if you know that only LED's are
181 connected to port PA, then they are usually connected to bits 2-4
182 and you can therefore use 1c. On other boards which don't have the
183 LED's at the general ports, these bits are used for all kinds of
184 stuff. If you don't know what to use, it is always safe to put all
185 as inputs, although floating inputs isn't good.
186
187config ETRAX_DEF_GIO_PE_OUT
188 hex "GIO_PE_OUT"
189 depends on ETRAX_ARCH_V32
190 default "00000"
191 help
192 Configures the initial data for the general port E bits. Most
193 products should use 00000 here.
194
195config ETRAX_DEF_GIO_PV_OE
196 hex "GIO_PV_OE"
197 depends on ETRAX_VIRTUAL_GPIO
198 default "0000"
199 help
200 Configures the direction of virtual general port V bits. 1 is out,
201 0 is in. This is often totally different depending on the product
202 used. These bits are used for all kinds of stuff. If you don't know
203 what to use, it is always safe to put all as inputs, although
204 floating inputs isn't good.
205
206config ETRAX_DEF_GIO_PV_OUT
207 hex "GIO_PV_OUT"
208 depends on ETRAX_VIRTUAL_GPIO
209 default "0000"
210 help
211 Configures the initial data for the virtual general port V bits.
212 Most products should use 0000 here.
213
214endmenu
215
216endif
diff --git a/arch/cris/arch-v32/mach-fs/Makefile b/arch/cris/arch-v32/mach-fs/Makefile
new file mode 100644
index 000000000000..4ff407a1b931
--- /dev/null
+++ b/arch/cris/arch-v32/mach-fs/Makefile
@@ -0,0 +1,11 @@
1# $Id: Makefile,v 1.3 2007/03/13 11:57:46 starvik Exp $
2#
3# Makefile for the linux kernel.
4#
5
6obj-y := dma.o pinmux.o io.o arbiter.o
7bj-$(CONFIG_ETRAX_VCS_SIM) += vcs_hook.o
8obj-$(CONFIG_CPU_FREQ) += cpufreq.o
9
10clean:
11
diff --git a/arch/cris/arch-v32/mach-fs/arbiter.c b/arch/cris/arch-v32/mach-fs/arbiter.c
new file mode 100644
index 000000000000..84d31bd7b692
--- /dev/null
+++ b/arch/cris/arch-v32/mach-fs/arbiter.c
@@ -0,0 +1,404 @@
1/*
2 * Memory arbiter functions. Allocates bandwidth through the
3 * arbiter and sets up arbiter breakpoints.
4 *
5 * The algorithm first assigns slots to the clients that has specified
6 * bandwidth (e.g. ethernet) and then the remaining slots are divided
7 * on all the active clients.
8 *
9 * Copyright (c) 2004-2007 Axis Communications AB.
10 */
11
12#include <hwregs/reg_map.h>
13#include <hwregs/reg_rdwr.h>
14#include <hwregs/marb_defs.h>
15#include <arbiter.h>
16#include <hwregs/intr_vect.h>
17#include <linux/interrupt.h>
18#include <linux/signal.h>
19#include <linux/errno.h>
20#include <linux/spinlock.h>
21#include <asm/io.h>
22#include <asm/irq_regs.h>
23
24struct crisv32_watch_entry {
25 unsigned long instance;
26 watch_callback *cb;
27 unsigned long start;
28 unsigned long end;
29 int used;
30};
31
32#define NUMBER_OF_BP 4
33#define NBR_OF_CLIENTS 14
34#define NBR_OF_SLOTS 64
35#define SDRAM_BANDWIDTH 100000000 /* Some kind of expected value */
36#define INTMEM_BANDWIDTH 400000000
37#define NBR_OF_REGIONS 2
38
39static struct crisv32_watch_entry watches[NUMBER_OF_BP] = {
40 {regi_marb_bp0},
41 {regi_marb_bp1},
42 {regi_marb_bp2},
43 {regi_marb_bp3}
44};
45
46static u8 requested_slots[NBR_OF_REGIONS][NBR_OF_CLIENTS];
47static u8 active_clients[NBR_OF_REGIONS][NBR_OF_CLIENTS];
48static int max_bandwidth[NBR_OF_REGIONS] =
49 { SDRAM_BANDWIDTH, INTMEM_BANDWIDTH };
50
51DEFINE_SPINLOCK(arbiter_lock);
52
53static irqreturn_t crisv32_arbiter_irq(int irq, void *dev_id);
54
55/*
56 * "I'm the arbiter, I know the score.
57 * From square one I'll be watching all 64."
58 * (memory arbiter slots, that is)
59 *
60 * Or in other words:
61 * Program the memory arbiter slots for "region" according to what's
62 * in requested_slots[] and active_clients[], while minimizing
63 * latency. A caller may pass a non-zero positive amount for
64 * "unused_slots", which must then be the unallocated, remaining
65 * number of slots, free to hand out to any client.
66 */
67
68static void crisv32_arbiter_config(int region, int unused_slots)
69{
70 int slot;
71 int client;
72 int interval = 0;
73
74 /*
75 * This vector corresponds to the hardware arbiter slots (see
76 * the hardware documentation for semantics). We initialize
77 * each slot with a suitable sentinel value outside the valid
78 * range {0 .. NBR_OF_CLIENTS - 1} and replace them with
79 * client indexes. Then it's fed to the hardware.
80 */
81 s8 val[NBR_OF_SLOTS];
82
83 for (slot = 0; slot < NBR_OF_SLOTS; slot++)
84 val[slot] = -1;
85
86 for (client = 0; client < NBR_OF_CLIENTS; client++) {
87 int pos;
88 /* Allocate the requested non-zero number of slots, but
89 * also give clients with zero-requests one slot each
90 * while stocks last. We do the latter here, in client
91 * order. This makes sure zero-request clients are the
92 * first to get to any spare slots, else those slots
93 * could, when bandwidth is allocated close to the limit,
94 * all be allocated to low-index non-zero-request clients
95 * in the default-fill loop below. Another positive but
96 * secondary effect is a somewhat better spread of the
97 * zero-bandwidth clients in the vector, avoiding some of
98 * the latency that could otherwise be caused by the
99 * partitioning of non-zero-bandwidth clients at low
100 * indexes and zero-bandwidth clients at high
101 * indexes. (Note that this spreading can only affect the
102 * unallocated bandwidth.) All the above only matters for
103 * memory-intensive situations, of course.
104 */
105 if (!requested_slots[region][client]) {
106 /*
107 * Skip inactive clients. Also skip zero-slot
108 * allocations in this pass when there are no known
109 * free slots.
110 */
111 if (!active_clients[region][client]
112 || unused_slots <= 0)
113 continue;
114
115 unused_slots--;
116
117 /* Only allocate one slot for this client. */
118 interval = NBR_OF_SLOTS;
119 } else
120 interval =
121 NBR_OF_SLOTS / requested_slots[region][client];
122
123 pos = 0;
124 while (pos < NBR_OF_SLOTS) {
125 if (val[pos] >= 0)
126 pos++;
127 else {
128 val[pos] = client;
129 pos += interval;
130 }
131 }
132 }
133
134 client = 0;
135 for (slot = 0; slot < NBR_OF_SLOTS; slot++) {
136 /*
137 * Allocate remaining slots in round-robin
138 * client-number order for active clients. For this
139 * pass, we ignore requested bandwidth and previous
140 * allocations.
141 */
142 if (val[slot] < 0) {
143 int first = client;
144 while (!active_clients[region][client]) {
145 client = (client + 1) % NBR_OF_CLIENTS;
146 if (client == first)
147 break;
148 }
149 val[slot] = client;
150 client = (client + 1) % NBR_OF_CLIENTS;
151 }
152 if (region == EXT_REGION)
153 REG_WR_INT_VECT(marb, regi_marb, rw_ext_slots, slot,
154 val[slot]);
155 else if (region == INT_REGION)
156 REG_WR_INT_VECT(marb, regi_marb, rw_int_slots, slot,
157 val[slot]);
158 }
159}
160
161extern char _stext, _etext;
162
163static void crisv32_arbiter_init(void)
164{
165 static int initialized;
166
167 if (initialized)
168 return;
169
170 initialized = 1;
171
172 /*
173 * CPU caches are always set to active, but with zero
174 * bandwidth allocated. It should be ok to allocate zero
175 * bandwidth for the caches, because DMA for other channels
176 * will supposedly finish, once their programmed amount is
177 * done, and then the caches will get access according to the
178 * "fixed scheme" for unclaimed slots. Though, if for some
179 * use-case somewhere, there's a maximum CPU latency for
180 * e.g. some interrupt, we have to start allocating specific
181 * bandwidth for the CPU caches too.
182 */
183 active_clients[EXT_REGION][10] = active_clients[EXT_REGION][11] = 1;
184 crisv32_arbiter_config(EXT_REGION, 0);
185 crisv32_arbiter_config(INT_REGION, 0);
186
187 if (request_irq(MEMARB_INTR_VECT, crisv32_arbiter_irq, IRQF_DISABLED,
188 "arbiter", NULL))
189 printk(KERN_ERR "Couldn't allocate arbiter IRQ\n");
190
191#ifndef CONFIG_ETRAX_KGDB
192 /* Global watch for writes to kernel text segment. */
193 crisv32_arbiter_watch(virt_to_phys(&_stext), &_etext - &_stext,
194 arbiter_all_clients, arbiter_all_write, NULL);
195#endif
196}
197
198/* Main entry for bandwidth allocation. */
199
200int crisv32_arbiter_allocate_bandwidth(int client, int region,
201 unsigned long bandwidth)
202{
203 int i;
204 int total_assigned = 0;
205 int total_clients = 0;
206 int req;
207
208 crisv32_arbiter_init();
209
210 for (i = 0; i < NBR_OF_CLIENTS; i++) {
211 total_assigned += requested_slots[region][i];
212 total_clients += active_clients[region][i];
213 }
214
215 /* Avoid division by 0 for 0-bandwidth requests. */
216 req = bandwidth == 0
217 ? 0 : NBR_OF_SLOTS / (max_bandwidth[region] / bandwidth);
218
219 /*
220 * We make sure that there are enough slots only for non-zero
221 * requests. Requesting 0 bandwidth *may* allocate slots,
222 * though if all bandwidth is allocated, such a client won't
223 * get any and will have to rely on getting memory access
224 * according to the fixed scheme that's the default when one
225 * of the slot-allocated clients doesn't claim their slot.
226 */
227 if (total_assigned + req > NBR_OF_SLOTS)
228 return -ENOMEM;
229
230 active_clients[region][client] = 1;
231 requested_slots[region][client] = req;
232 crisv32_arbiter_config(region, NBR_OF_SLOTS - total_assigned);
233
234 return 0;
235}
236
237/*
238 * Main entry for bandwidth deallocation.
239 *
240 * Strictly speaking, for a somewhat constant set of clients where
241 * each client gets a constant bandwidth and is just enabled or
242 * disabled (somewhat dynamically), no action is necessary here to
243 * avoid starvation for non-zero-allocation clients, as the allocated
244 * slots will just be unused. However, handing out those unused slots
245 * to active clients avoids needless latency if the "fixed scheme"
246 * would give unclaimed slots to an eager low-index client.
247 */
248
249void crisv32_arbiter_deallocate_bandwidth(int client, int region)
250{
251 int i;
252 int total_assigned = 0;
253
254 requested_slots[region][client] = 0;
255 active_clients[region][client] = 0;
256
257 for (i = 0; i < NBR_OF_CLIENTS; i++)
258 total_assigned += requested_slots[region][i];
259
260 crisv32_arbiter_config(region, NBR_OF_SLOTS - total_assigned);
261}
262
263int crisv32_arbiter_watch(unsigned long start, unsigned long size,
264 unsigned long clients, unsigned long accesses,
265 watch_callback *cb)
266{
267 int i;
268
269 crisv32_arbiter_init();
270
271 if (start > 0x80000000) {
272 printk(KERN_ERR "Arbiter: %lX doesn't look like a "
273 "physical address", start);
274 return -EFAULT;
275 }
276
277 spin_lock(&arbiter_lock);
278
279 for (i = 0; i < NUMBER_OF_BP; i++) {
280 if (!watches[i].used) {
281 reg_marb_rw_intr_mask intr_mask =
282 REG_RD(marb, regi_marb, rw_intr_mask);
283
284 watches[i].used = 1;
285 watches[i].start = start;
286 watches[i].end = start + size;
287 watches[i].cb = cb;
288
289 REG_WR_INT(marb_bp, watches[i].instance, rw_first_addr,
290 watches[i].start);
291 REG_WR_INT(marb_bp, watches[i].instance, rw_last_addr,
292 watches[i].end);
293 REG_WR_INT(marb_bp, watches[i].instance, rw_op,
294 accesses);
295 REG_WR_INT(marb_bp, watches[i].instance, rw_clients,
296 clients);
297
298 if (i == 0)
299 intr_mask.bp0 = regk_marb_yes;
300 else if (i == 1)
301 intr_mask.bp1 = regk_marb_yes;
302 else if (i == 2)
303 intr_mask.bp2 = regk_marb_yes;
304 else if (i == 3)
305 intr_mask.bp3 = regk_marb_yes;
306
307 REG_WR(marb, regi_marb, rw_intr_mask, intr_mask);
308 spin_unlock(&arbiter_lock);
309
310 return i;
311 }
312 }
313 spin_unlock(&arbiter_lock);
314 return -ENOMEM;
315}
316
317int crisv32_arbiter_unwatch(int id)
318{
319 reg_marb_rw_intr_mask intr_mask = REG_RD(marb, regi_marb, rw_intr_mask);
320
321 crisv32_arbiter_init();
322
323 spin_lock(&arbiter_lock);
324
325 if ((id < 0) || (id >= NUMBER_OF_BP) || (!watches[id].used)) {
326 spin_unlock(&arbiter_lock);
327 return -EINVAL;
328 }
329
330 memset(&watches[id], 0, sizeof(struct crisv32_watch_entry));
331
332 if (id == 0)
333 intr_mask.bp0 = regk_marb_no;
334 else if (id == 1)
335 intr_mask.bp2 = regk_marb_no;
336 else if (id == 2)
337 intr_mask.bp2 = regk_marb_no;
338 else if (id == 3)
339 intr_mask.bp3 = regk_marb_no;
340
341 REG_WR(marb, regi_marb, rw_intr_mask, intr_mask);
342
343 spin_unlock(&arbiter_lock);
344 return 0;
345}
346
347extern void show_registers(struct pt_regs *regs);
348
349static irqreturn_t crisv32_arbiter_irq(int irq, void *dev_id)
350{
351 reg_marb_r_masked_intr masked_intr =
352 REG_RD(marb, regi_marb, r_masked_intr);
353 reg_marb_bp_r_brk_clients r_clients;
354 reg_marb_bp_r_brk_addr r_addr;
355 reg_marb_bp_r_brk_op r_op;
356 reg_marb_bp_r_brk_first_client r_first;
357 reg_marb_bp_r_brk_size r_size;
358 reg_marb_bp_rw_ack ack = { 0 };
359 reg_marb_rw_ack_intr ack_intr = {
360 .bp0 = 1, .bp1 = 1, .bp2 = 1, .bp3 = 1
361 };
362 struct crisv32_watch_entry *watch;
363
364 if (masked_intr.bp0) {
365 watch = &watches[0];
366 ack_intr.bp0 = regk_marb_yes;
367 } else if (masked_intr.bp1) {
368 watch = &watches[1];
369 ack_intr.bp1 = regk_marb_yes;
370 } else if (masked_intr.bp2) {
371 watch = &watches[2];
372 ack_intr.bp2 = regk_marb_yes;
373 } else if (masked_intr.bp3) {
374 watch = &watches[3];
375 ack_intr.bp3 = regk_marb_yes;
376 } else {
377 return IRQ_NONE;
378 }
379
380 /* Retrieve all useful information and print it. */
381 r_clients = REG_RD(marb_bp, watch->instance, r_brk_clients);
382 r_addr = REG_RD(marb_bp, watch->instance, r_brk_addr);
383 r_op = REG_RD(marb_bp, watch->instance, r_brk_op);
384 r_first = REG_RD(marb_bp, watch->instance, r_brk_first_client);
385 r_size = REG_RD(marb_bp, watch->instance, r_brk_size);
386
387 printk(KERN_INFO "Arbiter IRQ\n");
388 printk(KERN_INFO "Clients %X addr %X op %X first %X size %X\n",
389 REG_TYPE_CONV(int, reg_marb_bp_r_brk_clients, r_clients),
390 REG_TYPE_CONV(int, reg_marb_bp_r_brk_addr, r_addr),
391 REG_TYPE_CONV(int, reg_marb_bp_r_brk_op, r_op),
392 REG_TYPE_CONV(int, reg_marb_bp_r_brk_first_client, r_first),
393 REG_TYPE_CONV(int, reg_marb_bp_r_brk_size, r_size));
394
395 REG_WR(marb_bp, watch->instance, rw_ack, ack);
396 REG_WR(marb, regi_marb, rw_ack_intr, ack_intr);
397
398 printk(KERN_INFO "IRQ occured at %lX\n", get_irq_regs()->erp);
399
400 if (watch->cb)
401 watch->cb();
402
403 return IRQ_HANDLED;
404}
diff --git a/arch/cris/arch-v32/mach-fs/cpufreq.c b/arch/cris/arch-v32/mach-fs/cpufreq.c
new file mode 100644
index 000000000000..d57631c0d8d1
--- /dev/null
+++ b/arch/cris/arch-v32/mach-fs/cpufreq.c
@@ -0,0 +1,146 @@
1#include <linux/init.h>
2#include <linux/module.h>
3#include <linux/cpufreq.h>
4#include <hwregs/reg_map.h>
5#include <asm/arch/hwregs/reg_rdwr.h>
6#include <asm/arch/hwregs/config_defs.h>
7#include <asm/arch/hwregs/bif_core_defs.h>
8
9static int
10cris_sdram_freq_notifier(struct notifier_block *nb, unsigned long val,
11 void *data);
12
13static struct notifier_block cris_sdram_freq_notifier_block = {
14 .notifier_call = cris_sdram_freq_notifier
15};
16
17static struct cpufreq_frequency_table cris_freq_table[] = {
18 {0x01, 6000},
19 {0x02, 200000},
20 {0, CPUFREQ_TABLE_END},
21};
22
23static unsigned int cris_freq_get_cpu_frequency(unsigned int cpu)
24{
25 reg_config_rw_clk_ctrl clk_ctrl;
26 clk_ctrl = REG_RD(config, regi_config, rw_clk_ctrl);
27 return clk_ctrl.pll ? 200000 : 6000;
28}
29
30static void cris_freq_set_cpu_state(unsigned int state)
31{
32 int i;
33 struct cpufreq_freqs freqs;
34 reg_config_rw_clk_ctrl clk_ctrl;
35 clk_ctrl = REG_RD(config, regi_config, rw_clk_ctrl);
36
37 for_each_possible_cpu(i) {
38 freqs.old = cris_freq_get_cpu_frequency(i);
39 freqs.new = cris_freq_table[state].frequency;
40 freqs.cpu = i;
41 }
42
43 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
44
45 local_irq_disable();
46
47 /* Even though we may be SMP they will share the same clock
48 * so all settings are made on CPU0. */
49 if (cris_freq_table[state].frequency == 200000)
50 clk_ctrl.pll = 1;
51 else
52 clk_ctrl.pll = 0;
53 REG_WR(config, regi_config, rw_clk_ctrl, clk_ctrl);
54
55 local_irq_enable();
56
57 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
58};
59
60static int cris_freq_verify(struct cpufreq_policy *policy)
61{
62 return cpufreq_frequency_table_verify(policy, &cris_freq_table[0]);
63}
64
65static int cris_freq_target(struct cpufreq_policy *policy,
66 unsigned int target_freq, unsigned int relation)
67{
68 unsigned int newstate = 0;
69
70 if (cpufreq_frequency_table_target
71 (policy, cris_freq_table, target_freq, relation, &newstate))
72 return -EINVAL;
73
74 cris_freq_set_cpu_state(newstate);
75
76 return 0;
77}
78
79static int cris_freq_cpu_init(struct cpufreq_policy *policy)
80{
81 int result;
82
83 /* cpuinfo and default policy values */
84 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
85 policy->cpuinfo.transition_latency = 1000000; /* 1ms */
86 policy->cur = cris_freq_get_cpu_frequency(0);
87
88 result = cpufreq_frequency_table_cpuinfo(policy, cris_freq_table);
89 if (result)
90 return (result);
91
92 cpufreq_frequency_table_get_attr(cris_freq_table, policy->cpu);
93
94 return 0;
95}
96
97static int cris_freq_cpu_exit(struct cpufreq_policy *policy)
98{
99 cpufreq_frequency_table_put_attr(policy->cpu);
100 return 0;
101}
102
103static struct freq_attr *cris_freq_attr[] = {
104 &cpufreq_freq_attr_scaling_available_freqs,
105 NULL,
106};
107
108static struct cpufreq_driver cris_freq_driver = {
109 .get = cris_freq_get_cpu_frequency,
110 .verify = cris_freq_verify,
111 .target = cris_freq_target,
112 .init = cris_freq_cpu_init,
113 .exit = cris_freq_cpu_exit,
114 .name = "cris_freq",
115 .owner = THIS_MODULE,
116 .attr = cris_freq_attr,
117};
118
119static int __init cris_freq_init(void)
120{
121 int ret;
122 ret = cpufreq_register_driver(&cris_freq_driver);
123 cpufreq_register_notifier(&cris_sdram_freq_notifier_block,
124 CPUFREQ_TRANSITION_NOTIFIER);
125 return ret;
126}
127
128static int
129cris_sdram_freq_notifier(struct notifier_block *nb, unsigned long val,
130 void *data)
131{
132 int i;
133 struct cpufreq_freqs *freqs = data;
134 if (val == CPUFREQ_PRECHANGE) {
135 reg_bif_core_rw_sdram_timing timing =
136 REG_RD(bif_core, regi_bif_core, rw_sdram_timing);
137 timing.cpd = (freqs->new == 200000 ? 0 : 1);
138
139 if (freqs->new == 200000)
140 for (i = 0; i < 50000; i++) ;
141 REG_WR(bif_core, regi_bif_core, rw_sdram_timing, timing);
142 }
143 return 0;
144}
145
146module_init(cris_freq_init);
diff --git a/arch/cris/arch-v32/kernel/dma.c b/arch/cris/arch-v32/mach-fs/dma.c
index 570e19128ffd..a6acf4e6345c 100644
--- a/arch/cris/arch-v32/kernel/dma.c
+++ b/arch/cris/arch-v32/mach-fs/dma.c
@@ -3,49 +3,54 @@
3#include <linux/kernel.h> 3#include <linux/kernel.h>
4#include <linux/spinlock.h> 4#include <linux/spinlock.h>
5#include <asm/dma.h> 5#include <asm/dma.h>
6#include <asm/arch/hwregs/reg_map.h> 6#include <hwregs/reg_map.h>
7#include <asm/arch/hwregs/reg_rdwr.h> 7#include <hwregs/reg_rdwr.h>
8#include <asm/arch/hwregs/marb_defs.h> 8#include <hwregs/marb_defs.h>
9#include <asm/arch/hwregs/config_defs.h> 9#include <hwregs/config_defs.h>
10#include <asm/arch/hwregs/strmux_defs.h> 10#include <hwregs/strmux_defs.h>
11#include <linux/errno.h> 11#include <linux/errno.h>
12#include <asm/system.h> 12#include <asm/system.h>
13#include <asm/arch/arbiter.h> 13#include <asm/arch/mach/arbiter.h>
14 14
15static char used_dma_channels[MAX_DMA_CHANNELS]; 15static char used_dma_channels[MAX_DMA_CHANNELS];
16static const char * used_dma_channels_users[MAX_DMA_CHANNELS]; 16static const char *used_dma_channels_users[MAX_DMA_CHANNELS];
17 17
18static DEFINE_SPINLOCK(dma_lock); 18static DEFINE_SPINLOCK(dma_lock);
19 19
20int crisv32_request_dma(unsigned int dmanr, const char * device_id, 20int crisv32_request_dma(unsigned int dmanr, const char *device_id,
21 unsigned options, unsigned int bandwidth, 21 unsigned options, unsigned int bandwidth,
22 enum dma_owner owner) 22 enum dma_owner owner)
23{ 23{
24 unsigned long flags; 24 unsigned long flags;
25 reg_config_rw_clk_ctrl clk_ctrl; 25 reg_config_rw_clk_ctrl clk_ctrl;
26 reg_strmux_rw_cfg strmux_cfg; 26 reg_strmux_rw_cfg strmux_cfg;
27 27
28 if (crisv32_arbiter_allocate_bandwidth(dmanr, 28 if (crisv32_arbiter_allocate_bandwidth(dmanr,
29 options & DMA_INT_MEM ? INT_REGION : EXT_REGION, 29 options & DMA_INT_MEM ?
30 bandwidth)) 30 INT_REGION : EXT_REGION,
31 return -ENOMEM; 31 bandwidth))
32 return -ENOMEM;
32 33
33 spin_lock_irqsave(&dma_lock, flags); 34 spin_lock_irqsave(&dma_lock, flags);
34 35
35 if (used_dma_channels[dmanr]) { 36 if (used_dma_channels[dmanr]) {
36 spin_unlock_irqrestore(&dma_lock, flags); 37 spin_unlock_irqrestore(&dma_lock, flags);
37 if (options & DMA_VERBOSE_ON_ERROR) { 38 if (options & DMA_VERBOSE_ON_ERROR) {
38 printk("Failed to request DMA %i for %s, already allocated by %s\n", dmanr, device_id, used_dma_channels_users[dmanr]); 39 printk(KERN_ERR "Failed to request DMA %i for %s, "
40 "already allocated by %s\n",
41 dmanr,
42 device_id,
43 used_dma_channels_users[dmanr]);
39 } 44 }
40 if (options & DMA_PANIC_ON_ERROR) 45 if (options & DMA_PANIC_ON_ERROR)
41 panic("request_dma error!"); 46 panic("request_dma error!");
47 spin_unlock_irqrestore(&dma_lock, flags);
42 return -EBUSY; 48 return -EBUSY;
43 } 49 }
44 clk_ctrl = REG_RD(config, regi_config, rw_clk_ctrl); 50 clk_ctrl = REG_RD(config, regi_config, rw_clk_ctrl);
45 strmux_cfg = REG_RD(strmux, regi_strmux, rw_cfg); 51 strmux_cfg = REG_RD(strmux, regi_strmux, rw_cfg);
46 52
47 switch(dmanr) 53 switch (dmanr) {
48 {
49 case 0: 54 case 0:
50 case 1: 55 case 1:
51 clk_ctrl.dma01_eth0 = 1; 56 clk_ctrl.dma01_eth0 = 1;
@@ -72,7 +77,9 @@ int crisv32_request_dma(unsigned int dmanr, const char * device_id,
72 default: 77 default:
73 spin_unlock_irqrestore(&dma_lock, flags); 78 spin_unlock_irqrestore(&dma_lock, flags);
74 if (options & DMA_VERBOSE_ON_ERROR) { 79 if (options & DMA_VERBOSE_ON_ERROR) {
75 printk("Failed to request DMA %i for %s, only 0-%i valid)\n", dmanr, device_id, MAX_DMA_CHANNELS-1); 80 printk(KERN_ERR "Failed to request DMA %i for %s, "
81 "only 0-%i valid)\n",
82 dmanr, device_id, MAX_DMA_CHANNELS - 1);
76 } 83 }
77 84
78 if (options & DMA_PANIC_ON_ERROR) 85 if (options & DMA_PANIC_ON_ERROR)
@@ -80,8 +87,7 @@ int crisv32_request_dma(unsigned int dmanr, const char * device_id,
80 return -EINVAL; 87 return -EINVAL;
81 } 88 }
82 89
83 switch(owner) 90 switch (owner) {
84 {
85 case dma_eth0: 91 case dma_eth0:
86 if (dmanr == 0) 92 if (dmanr == 0)
87 strmux_cfg.dma0 = regk_strmux_eth0; 93 strmux_cfg.dma0 = regk_strmux_eth0;
@@ -212,7 +218,7 @@ int crisv32_request_dma(unsigned int dmanr, const char * device_id,
212 used_dma_channels_users[dmanr] = device_id; 218 used_dma_channels_users[dmanr] = device_id;
213 REG_WR(config, regi_config, rw_clk_ctrl, clk_ctrl); 219 REG_WR(config, regi_config, rw_clk_ctrl, clk_ctrl);
214 REG_WR(strmux, regi_strmux, rw_cfg, strmux_cfg); 220 REG_WR(strmux, regi_strmux, rw_cfg, strmux_cfg);
215 spin_unlock_irqrestore(&dma_lock,flags); 221 spin_unlock_irqrestore(&dma_lock, flags);
216 return 0; 222 return 0;
217} 223}
218 224
diff --git a/arch/cris/arch-v32/lib/dram_init.S b/arch/cris/arch-v32/mach-fs/dram_init.S
index 218fbe259ee5..6fbad336527b 100644
--- a/arch/cris/arch-v32/lib/dram_init.S
+++ b/arch/cris/arch-v32/mach-fs/dram_init.S
@@ -1,23 +1,22 @@
1/* $Id: dram_init.S,v 1.4 2005/04/24 18:48:32 starvik Exp $ 1/*
2 *
3 * DRAM/SDRAM initialization - alter with care 2 * DRAM/SDRAM initialization - alter with care
4 * This file is intended to be included from other assembler files 3 * This file is intended to be included from other assembler files
5 * 4 *
6 * Note: This file may not modify r8 or r9 because they are used to 5 * Note: This file may not modify r8 or r9 because they are used to
7 * carry information from the decompresser to the kernel 6 * carry information from the decompresser to the kernel
8 * 7 *
9 * Copyright (C) 2000-2003 Axis Communications AB 8 * Copyright (C) 2000-2007 Axis Communications AB
10 * 9 *
11 * Authors: Mikael Starvik (starvik@axis.com) 10 * Authors: Mikael Starvik <starvik@axis.com>
12 */ 11 */
13 12
14/* Just to be certain the config file is included, we include it here 13/* Just to be certain the config file is included, we include it here
15 * explicitly instead of depending on it being included in the file that 14 * explicitely instead of depending on it being included in the file that
16 * uses this code. 15 * uses this code.
17 */ 16 */
18 17
19#include <asm/arch/hwregs/asm/reg_map_asm.h> 18#include <hwregs/asm/reg_map_asm.h>
20#include <asm/arch/hwregs/asm/bif_core_defs_asm.h> 19#include <hwregs/asm/bif_core_defs_asm.h>
21 20
22 ;; WARNING! The registers r8 and r9 are used as parameters carrying 21 ;; WARNING! The registers r8 and r9 are used as parameters carrying
23 ;; information from the decompressor (if the kernel was compressed). 22 ;; information from the decompressor (if the kernel was compressed).
@@ -46,7 +45,7 @@
46 45
47 move.d 0x40, $r4 ; Assume 32 bits and CAS latency = 2 46 move.d 0x40, $r4 ; Assume 32 bits and CAS latency = 2
48 move.d CONFIG_ETRAX_SDRAM_TIMING, $r1 47 move.d CONFIG_ETRAX_SDRAM_TIMING, $r1
49 and.d 0x07, $r1 ; Get CAS latency 48 and.d 0x07, $r1 ; Get CAS latency
50 cmpq 2, $r1 ; CL = 2 ? 49 cmpq 2, $r1 ; CL = 2 ?
51 beq _bw_check 50 beq _bw_check
52 nop 51 nop
@@ -80,12 +79,10 @@ _set_timing:
80 subq 1, $r2 79 subq 1, $r2
81 80
82 ; Issue initialization command sequence 81 ; Issue initialization command sequence
83 move.d _sdram_commands_start, $r2 82 lapc _sdram_commands_start, $r2
84 and.d 0x000fffff, $r2 ; Make sure commands are read from flash 83 lapc _sdram_commands_end, $r3
85 move.d _sdram_commands_end, $r3
86 and.d 0x000fffff, $r3
871: clear.d $r6 841: clear.d $r6
88 move.b [$r2+], $r6 ; Load command 85 move.b [$r2+], $r6 ; Load command
89 or.d $r4, $r6 ; Add calculated mrs 86 or.d $r4, $r6 ; Add calculated mrs
90 move.d $r6, [$r5] ; Write rw_sdram_cmd 87 move.d $r6, [$r5] ; Write rw_sdram_cmd
91 ; Wait 80 ns between each command 88 ; Wait 80 ns between each command
diff --git a/arch/cris/arch-v32/lib/hw_settings.S b/arch/cris/arch-v32/mach-fs/hw_settings.S
index fff9443513d1..8bde93c36214 100644
--- a/arch/cris/arch-v32/lib/hw_settings.S
+++ b/arch/cris/arch-v32/mach-fs/hw_settings.S
@@ -1,18 +1,16 @@
1/* 1/*
2 * $Id: hw_settings.S,v 1.3 2005/04/24 18:36:57 starvik Exp $
3 *
4 * This table is used by some tools to extract hardware parameters. 2 * This table is used by some tools to extract hardware parameters.
5 * The table should be included in the kernel and the decompressor. 3 * The table should be included in the kernel and the decompressor.
6 * Don't forget to update the tools if you change this table. 4 * Don't forget to update the tools if you change this table.
7 * 5 *
8 * Copyright (C) 2001 Axis Communications AB 6 * Copyright (C) 2001-2007 Axis Communications AB
9 * 7 *
10 * Authors: Mikael Starvik (starvik@axis.com) 8 * Authors: Mikael Starvik <starvik@axis.com>
11 */ 9 */
12 10
13#include <asm/arch/hwregs/asm/reg_map_asm.h> 11#include <hwregs/asm/reg_map_asm.h>
14#include <asm/arch/hwregs/asm/bif_core_defs_asm.h> 12#include <hwregs/asm/bif_core_defs_asm.h>
15#include <asm/arch/hwregs/asm/gio_defs_asm.h> 13#include <hwregs/asm/gio_defs_asm.h>
16 14
17 .ascii "HW_PARAM_MAGIC" ; Magic number 15 .ascii "HW_PARAM_MAGIC" ; Magic number
18 .dword 0xc0004000 ; Kernel start address 16 .dword 0xc0004000 ; Kernel start address
diff --git a/arch/cris/arch-v32/mach-fs/io.c b/arch/cris/arch-v32/mach-fs/io.c
new file mode 100644
index 000000000000..a03a3ad3a188
--- /dev/null
+++ b/arch/cris/arch-v32/mach-fs/io.c
@@ -0,0 +1,191 @@
1/*
2 * Helper functions for I/O pins.
3 *
4 * Copyright (c) 2004-2007 Axis Communications AB.
5 */
6
7#include <linux/types.h>
8#include <linux/errno.h>
9#include <linux/init.h>
10#include <linux/string.h>
11#include <linux/ctype.h>
12#include <linux/kernel.h>
13#include <linux/module.h>
14#include <asm/io.h>
15#include <asm/arch/pinmux.h>
16#include <asm/arch/hwregs/gio_defs.h>
17
18#ifndef DEBUG
19#define DEBUG(x)
20#endif
21
22struct crisv32_ioport crisv32_ioports[] = {
23 {
24 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pa_oe),
25 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pa_dout),
26 (unsigned long *)REG_ADDR(gio, regi_gio, r_pa_din),
27 8
28 },
29 {
30 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pb_oe),
31 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pb_dout),
32 (unsigned long *)REG_ADDR(gio, regi_gio, r_pb_din),
33 18
34 },
35 {
36 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pc_oe),
37 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pc_dout),
38 (unsigned long *)REG_ADDR(gio, regi_gio, r_pc_din),
39 18
40 },
41 {
42 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pd_oe),
43 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pd_dout),
44 (unsigned long *)REG_ADDR(gio, regi_gio, r_pd_din),
45 18
46 },
47 {
48 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pe_oe),
49 (unsigned long *)REG_ADDR(gio, regi_gio, rw_pe_dout),
50 (unsigned long *)REG_ADDR(gio, regi_gio, r_pe_din),
51 18
52 }
53};
54
55#define NBR_OF_PORTS sizeof(crisv32_ioports)/sizeof(struct crisv32_ioport)
56
57struct crisv32_iopin crisv32_led_net0_green;
58struct crisv32_iopin crisv32_led_net0_red;
59struct crisv32_iopin crisv32_led_net1_green;
60struct crisv32_iopin crisv32_led_net1_red;
61struct crisv32_iopin crisv32_led2_green;
62struct crisv32_iopin crisv32_led2_red;
63struct crisv32_iopin crisv32_led3_green;
64struct crisv32_iopin crisv32_led3_red;
65
66/* Dummy port used when green LED and red LED is on the same bit */
67static unsigned long io_dummy;
68static struct crisv32_ioport dummy_port = {
69 &io_dummy,
70 &io_dummy,
71 &io_dummy,
72 18
73};
74static struct crisv32_iopin dummy_led = {
75 &dummy_port,
76 0
77};
78
79static int __init crisv32_io_init(void)
80{
81 int ret = 0;
82
83 u32 i;
84
85 /* Locks *should* be dynamically initialized. */
86 for (i = 0; i < ARRAY_SIZE(crisv32_ioports); i++)
87 spin_lock_init(&crisv32_ioports[i].lock);
88 spin_lock_init(&dummy_port.lock);
89
90 /* Initialize LEDs */
91#if (defined(CONFIG_ETRAX_NBR_LED_GRP_ONE) || defined(CONFIG_ETRAX_NBR_LED_GRP_TWO))
92 ret +=
93 crisv32_io_get_name(&crisv32_led_net0_green,
94 CONFIG_ETRAX_LED_G_NET0);
95 crisv32_io_set_dir(&crisv32_led_net0_green, crisv32_io_dir_out);
96 if (strcmp(CONFIG_ETRAX_LED_G_NET0, CONFIG_ETRAX_LED_R_NET0)) {
97 ret +=
98 crisv32_io_get_name(&crisv32_led_net0_red,
99 CONFIG_ETRAX_LED_R_NET0);
100 crisv32_io_set_dir(&crisv32_led_net0_red, crisv32_io_dir_out);
101 } else
102 crisv32_led_net0_red = dummy_led;
103#endif
104
105#ifdef CONFIG_ETRAX_NBR_LED_GRP_TWO
106 ret +=
107 crisv32_io_get_name(&crisv32_led_net1_green,
108 CONFIG_ETRAX_LED_G_NET1);
109 crisv32_io_set_dir(&crisv32_led_net1_green, crisv32_io_dir_out);
110 if (strcmp(CONFIG_ETRAX_LED_G_NET1, CONFIG_ETRAX_LED_R_NET1)) {
111 crisv32_io_get_name(&crisv32_led_net1_red,
112 CONFIG_ETRAX_LED_R_NET1);
113 crisv32_io_set_dir(&crisv32_led_net1_red, crisv32_io_dir_out);
114 } else
115 crisv32_led_net1_red = dummy_led;
116#endif
117
118 ret += crisv32_io_get_name(&crisv32_led2_green, CONFIG_ETRAX_V32_LED2G);
119 ret += crisv32_io_get_name(&crisv32_led2_red, CONFIG_ETRAX_V32_LED2R);
120 ret += crisv32_io_get_name(&crisv32_led3_green, CONFIG_ETRAX_V32_LED3G);
121 ret += crisv32_io_get_name(&crisv32_led3_red, CONFIG_ETRAX_V32_LED3R);
122
123 crisv32_io_set_dir(&crisv32_led2_green, crisv32_io_dir_out);
124 crisv32_io_set_dir(&crisv32_led2_red, crisv32_io_dir_out);
125 crisv32_io_set_dir(&crisv32_led3_green, crisv32_io_dir_out);
126 crisv32_io_set_dir(&crisv32_led3_red, crisv32_io_dir_out);
127
128 return ret;
129}
130
131__initcall(crisv32_io_init);
132
133int crisv32_io_get(struct crisv32_iopin *iopin,
134 unsigned int port, unsigned int pin)
135{
136 if (port > NBR_OF_PORTS)
137 return -EINVAL;
138 if (port > crisv32_ioports[port].pin_count)
139 return -EINVAL;
140
141 iopin->bit = 1 << pin;
142 iopin->port = &crisv32_ioports[port];
143
144 /* Only allocate pinmux gpiopins if port != PORT_A (port 0) */
145 /* NOTE! crisv32_pinmux_alloc thinks PORT_B is port 0 */
146 if (port != 0 && crisv32_pinmux_alloc(port - 1, pin, pin, pinmux_gpio))
147 return -EIO;
148 DEBUG(printk(KERN_DEBUG "crisv32_io_get: Allocated pin %d on port %d\n",
149 pin, port));
150
151 return 0;
152}
153
154int crisv32_io_get_name(struct crisv32_iopin *iopin, const char *name)
155{
156 int port;
157 int pin;
158
159 if (toupper(*name) == 'P')
160 name++;
161
162 if (toupper(*name) < 'A' || toupper(*name) > 'E')
163 return -EINVAL;
164
165 port = toupper(*name) - 'A';
166 name++;
167 pin = simple_strtoul(name, NULL, 10);
168
169 if (pin < 0 || pin > crisv32_ioports[port].pin_count)
170 return -EINVAL;
171
172 iopin->bit = 1 << pin;
173 iopin->port = &crisv32_ioports[port];
174
175 /* Only allocate pinmux gpiopins if port != PORT_A (port 0) */
176 /* NOTE! crisv32_pinmux_alloc thinks PORT_B is port 0 */
177 if (port != 0 && crisv32_pinmux_alloc(port - 1, pin, pin, pinmux_gpio))
178 return -EIO;
179
180 DEBUG(printk(KERN_DEBUG
181 "crisv32_io_get_name: Allocated pin %d on port %d\n",
182 pin, port));
183
184 return 0;
185}
186
187#ifdef CONFIG_PCI
188/* PCI I/O access stuff */
189struct cris_io_operations *cris_iops = NULL;
190EXPORT_SYMBOL(cris_iops);
191#endif
diff --git a/arch/cris/arch-v32/mach-fs/pinmux.c b/arch/cris/arch-v32/mach-fs/pinmux.c
new file mode 100644
index 000000000000..d722ad9ae626
--- /dev/null
+++ b/arch/cris/arch-v32/mach-fs/pinmux.c
@@ -0,0 +1,309 @@
1/*
2 * Allocator for I/O pins. All pins are allocated to GPIO at bootup.
3 * Unassigned pins and GPIO pins can be allocated to a fixed interface
4 * or the I/O processor instead.
5 *
6 * Copyright (c) 2004-2007 Axis Communications AB.
7 */
8
9#include <linux/init.h>
10#include <linux/errno.h>
11#include <linux/kernel.h>
12#include <linux/string.h>
13#include <linux/spinlock.h>
14#include <hwregs/reg_map.h>
15#include <hwregs/reg_rdwr.h>
16#include <pinmux.h>
17#include <hwregs/pinmux_defs.h>
18
19#undef DEBUG
20
21#define PORT_PINS 18
22#define PORTS 4
23
24static char pins[PORTS][PORT_PINS];
25static DEFINE_SPINLOCK(pinmux_lock);
26
27static void crisv32_pinmux_set(int port);
28
29int crisv32_pinmux_init(void)
30{
31 static int initialized;
32
33 if (!initialized) {
34 reg_pinmux_rw_pa pa = REG_RD(pinmux, regi_pinmux, rw_pa);
35 initialized = 1;
36 REG_WR_INT(pinmux, regi_pinmux, rw_hwprot, 0);
37 pa.pa0 = pa.pa1 = pa.pa2 = pa.pa3 =
38 pa.pa4 = pa.pa5 = pa.pa6 = pa.pa7 = regk_pinmux_yes;
39 REG_WR(pinmux, regi_pinmux, rw_pa, pa);
40 crisv32_pinmux_alloc(PORT_B, 0, PORT_PINS - 1, pinmux_gpio);
41 crisv32_pinmux_alloc(PORT_C, 0, PORT_PINS - 1, pinmux_gpio);
42 crisv32_pinmux_alloc(PORT_D, 0, PORT_PINS - 1, pinmux_gpio);
43 crisv32_pinmux_alloc(PORT_E, 0, PORT_PINS - 1, pinmux_gpio);
44 }
45
46 return 0;
47}
48
49int
50crisv32_pinmux_alloc(int port, int first_pin, int last_pin, enum pin_mode mode)
51{
52 int i;
53 unsigned long flags;
54
55 crisv32_pinmux_init();
56
57 if (port > PORTS)
58 return -EINVAL;
59
60 spin_lock_irqsave(&pinmux_lock, flags);
61
62 for (i = first_pin; i <= last_pin; i++) {
63 if ((pins[port][i] != pinmux_none)
64 && (pins[port][i] != pinmux_gpio)
65 && (pins[port][i] != mode)) {
66 spin_unlock_irqrestore(&pinmux_lock, flags);
67#ifdef DEBUG
68 panic("Pinmux alloc failed!\n");
69#endif
70 return -EPERM;
71 }
72 }
73
74 for (i = first_pin; i <= last_pin; i++)
75 pins[port][i] = mode;
76
77 crisv32_pinmux_set(port);
78
79 spin_unlock_irqrestore(&pinmux_lock, flags);
80
81 return 0;
82}
83
84int crisv32_pinmux_alloc_fixed(enum fixed_function function)
85{
86 int ret = -EINVAL;
87 char saved[sizeof pins];
88 unsigned long flags;
89
90 spin_lock_irqsave(&pinmux_lock, flags);
91
92 /* Save internal data for recovery */
93 memcpy(saved, pins, sizeof pins);
94
95 crisv32_pinmux_init(); /* Must be done before we read rw_hwprot */
96
97 reg_pinmux_rw_hwprot hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot);
98
99 switch (function) {
100 case pinmux_ser1:
101 ret = crisv32_pinmux_alloc(PORT_C, 4, 7, pinmux_fixed);
102 hwprot.ser1 = regk_pinmux_yes;
103 break;
104 case pinmux_ser2:
105 ret = crisv32_pinmux_alloc(PORT_C, 8, 11, pinmux_fixed);
106 hwprot.ser2 = regk_pinmux_yes;
107 break;
108 case pinmux_ser3:
109 ret = crisv32_pinmux_alloc(PORT_C, 12, 15, pinmux_fixed);
110 hwprot.ser3 = regk_pinmux_yes;
111 break;
112 case pinmux_sser0:
113 ret = crisv32_pinmux_alloc(PORT_C, 0, 3, pinmux_fixed);
114 ret |= crisv32_pinmux_alloc(PORT_C, 16, 16, pinmux_fixed);
115 hwprot.sser0 = regk_pinmux_yes;
116 break;
117 case pinmux_sser1:
118 ret = crisv32_pinmux_alloc(PORT_D, 0, 4, pinmux_fixed);
119 hwprot.sser1 = regk_pinmux_yes;
120 break;
121 case pinmux_ata0:
122 ret = crisv32_pinmux_alloc(PORT_D, 5, 7, pinmux_fixed);
123 ret |= crisv32_pinmux_alloc(PORT_D, 15, 17, pinmux_fixed);
124 hwprot.ata0 = regk_pinmux_yes;
125 break;
126 case pinmux_ata1:
127 ret = crisv32_pinmux_alloc(PORT_D, 0, 4, pinmux_fixed);
128 ret |= crisv32_pinmux_alloc(PORT_E, 17, 17, pinmux_fixed);
129 hwprot.ata1 = regk_pinmux_yes;
130 break;
131 case pinmux_ata2:
132 ret = crisv32_pinmux_alloc(PORT_C, 11, 15, pinmux_fixed);
133 ret |= crisv32_pinmux_alloc(PORT_E, 3, 3, pinmux_fixed);
134 hwprot.ata2 = regk_pinmux_yes;
135 break;
136 case pinmux_ata3:
137 ret = crisv32_pinmux_alloc(PORT_C, 8, 10, pinmux_fixed);
138 ret |= crisv32_pinmux_alloc(PORT_C, 0, 2, pinmux_fixed);
139 hwprot.ata2 = regk_pinmux_yes;
140 break;
141 case pinmux_ata:
142 ret = crisv32_pinmux_alloc(PORT_B, 0, 15, pinmux_fixed);
143 ret |= crisv32_pinmux_alloc(PORT_D, 8, 15, pinmux_fixed);
144 hwprot.ata = regk_pinmux_yes;
145 break;
146 case pinmux_eth1:
147 ret = crisv32_pinmux_alloc(PORT_E, 0, 17, pinmux_fixed);
148 hwprot.eth1 = regk_pinmux_yes;
149 hwprot.eth1_mgm = regk_pinmux_yes;
150 break;
151 case pinmux_timer:
152 ret = crisv32_pinmux_alloc(PORT_C, 16, 16, pinmux_fixed);
153 hwprot.timer = regk_pinmux_yes;
154 spin_unlock_irqrestore(&pinmux_lock, flags);
155 return ret;
156 }
157
158 if (!ret)
159 REG_WR(pinmux, regi_pinmux, rw_hwprot, hwprot);
160 else
161 memcpy(pins, saved, sizeof pins);
162
163 spin_unlock_irqrestore(&pinmux_lock, flags);
164
165 return ret;
166}
167
168void crisv32_pinmux_set(int port)
169{
170 int i;
171 int gpio_val = 0;
172 int iop_val = 0;
173
174 for (i = 0; i < PORT_PINS; i++) {
175 if (pins[port][i] == pinmux_gpio)
176 gpio_val |= (1 << i);
177 else if (pins[port][i] == pinmux_iop)
178 iop_val |= (1 << i);
179 }
180
181 REG_WRITE(int, regi_pinmux + REG_RD_ADDR_pinmux_rw_pb_gio + 8 * port,
182 gpio_val);
183 REG_WRITE(int, regi_pinmux + REG_RD_ADDR_pinmux_rw_pb_iop + 8 * port,
184 iop_val);
185
186#ifdef DEBUG
187 crisv32_pinmux_dump();
188#endif
189}
190
191int crisv32_pinmux_dealloc(int port, int first_pin, int last_pin)
192{
193 int i;
194 unsigned long flags;
195
196 crisv32_pinmux_init();
197
198 if (port > PORTS)
199 return -EINVAL;
200
201 spin_lock_irqsave(&pinmux_lock, flags);
202
203 for (i = first_pin; i <= last_pin; i++)
204 pins[port][i] = pinmux_none;
205
206 crisv32_pinmux_set(port);
207 spin_unlock_irqrestore(&pinmux_lock, flags);
208
209 return 0;
210}
211
212int crisv32_pinmux_dealloc_fixed(enum fixed_function function)
213{
214 int ret = -EINVAL;
215 char saved[sizeof pins];
216 unsigned long flags;
217
218 spin_lock_irqsave(&pinmux_lock, flags);
219
220 /* Save internal data for recovery */
221 memcpy(saved, pins, sizeof pins);
222
223 crisv32_pinmux_init(); /* Must be done before we read rw_hwprot */
224
225 reg_pinmux_rw_hwprot hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot);
226
227 switch (function) {
228 case pinmux_ser1:
229 ret = crisv32_pinmux_dealloc(PORT_C, 4, 7);
230 hwprot.ser1 = regk_pinmux_no;
231 break;
232 case pinmux_ser2:
233 ret = crisv32_pinmux_dealloc(PORT_C, 8, 11);
234 hwprot.ser2 = regk_pinmux_no;
235 break;
236 case pinmux_ser3:
237 ret = crisv32_pinmux_dealloc(PORT_C, 12, 15);
238 hwprot.ser3 = regk_pinmux_no;
239 break;
240 case pinmux_sser0:
241 ret = crisv32_pinmux_dealloc(PORT_C, 0, 3);
242 ret |= crisv32_pinmux_dealloc(PORT_C, 16, 16);
243 hwprot.sser0 = regk_pinmux_no;
244 break;
245 case pinmux_sser1:
246 ret = crisv32_pinmux_dealloc(PORT_D, 0, 4);
247 hwprot.sser1 = regk_pinmux_no;
248 break;
249 case pinmux_ata0:
250 ret = crisv32_pinmux_dealloc(PORT_D, 5, 7);
251 ret |= crisv32_pinmux_dealloc(PORT_D, 15, 17);
252 hwprot.ata0 = regk_pinmux_no;
253 break;
254 case pinmux_ata1:
255 ret = crisv32_pinmux_dealloc(PORT_D, 0, 4);
256 ret |= crisv32_pinmux_dealloc(PORT_E, 17, 17);
257 hwprot.ata1 = regk_pinmux_no;
258 break;
259 case pinmux_ata2:
260 ret = crisv32_pinmux_dealloc(PORT_C, 11, 15);
261 ret |= crisv32_pinmux_dealloc(PORT_E, 3, 3);
262 hwprot.ata2 = regk_pinmux_no;
263 break;
264 case pinmux_ata3:
265 ret = crisv32_pinmux_dealloc(PORT_C, 8, 10);
266 ret |= crisv32_pinmux_dealloc(PORT_C, 0, 2);
267 hwprot.ata2 = regk_pinmux_no;
268 break;
269 case pinmux_ata:
270 ret = crisv32_pinmux_dealloc(PORT_B, 0, 15);
271 ret |= crisv32_pinmux_dealloc(PORT_D, 8, 15);
272 hwprot.ata = regk_pinmux_no;
273 break;
274 case pinmux_eth1:
275 ret = crisv32_pinmux_dealloc(PORT_E, 0, 17);
276 hwprot.eth1 = regk_pinmux_no;
277 hwprot.eth1_mgm = regk_pinmux_no;
278 break;
279 case pinmux_timer:
280 ret = crisv32_pinmux_dealloc(PORT_C, 16, 16);
281 hwprot.timer = regk_pinmux_no;
282 spin_unlock_irqrestore(&pinmux_lock, flags);
283 return ret;
284 }
285
286 if (!ret)
287 REG_WR(pinmux, regi_pinmux, rw_hwprot, hwprot);
288 else
289 memcpy(pins, saved, sizeof pins);
290
291 spin_unlock_irqrestore(&pinmux_lock, flags);
292
293 return ret;
294}
295
296void crisv32_pinmux_dump(void)
297{
298 int i, j;
299
300 crisv32_pinmux_init();
301
302 for (i = 0; i < PORTS; i++) {
303 printk(KERN_DEBUG "Port %c\n", 'B' + i);
304 for (j = 0; j < PORT_PINS; j++)
305 printk(KERN_DEBUG " Pin %d = %d\n", j, pins[i][j]);
306 }
307}
308
309__initcall(crisv32_pinmux_init);
diff --git a/arch/cris/arch-v32/mach-fs/vcs_hook.c b/arch/cris/arch-v32/mach-fs/vcs_hook.c
new file mode 100644
index 000000000000..593b10f07ef1
--- /dev/null
+++ b/arch/cris/arch-v32/mach-fs/vcs_hook.c
@@ -0,0 +1,100 @@
1/*
2 * Call simulator hook. This is the part running in the
3 * simulated program.
4 */
5
6#include "vcs_hook.h"
7#include <stdarg.h>
8#include <asm/arch-v32/hwregs/reg_map.h>
9#include <asm/arch-v32/hwregs/intr_vect_defs.h>
10
11#define HOOK_TRIG_ADDR 0xb7000000 /* hook cvlog model reg address */
12#define HOOK_MEM_BASE_ADDR 0xa0000000 /* csp4 (shared mem) base addr */
13
14#define HOOK_DATA(offset) ((unsigned *)HOOK_MEM_BASE_ADDR)[offset]
15#define VHOOK_DATA(offset) ((volatile unsigned *)HOOK_MEM_BASE_ADDR)[offset]
16#define HOOK_TRIG(funcid) \
17 do { \
18 *((unsigned *) HOOK_TRIG_ADDR) = funcid; \
19 } while (0)
20#define HOOK_DATA_BYTE(offset) ((unsigned char *)HOOK_MEM_BASE_ADDR)[offset]
21
22int hook_call(unsigned id, unsigned pcnt, ...)
23{
24 va_list ap;
25 unsigned i;
26 unsigned ret;
27#ifdef USING_SOS
28 PREEMPT_OFF_SAVE();
29#endif
30
31 /* pass parameters */
32 HOOK_DATA(0) = id;
33
34 /* Have to make hook_print_str a special case since we call with a
35 * parameter of byte type. Should perhaps be a separate
36 * hook_call. */
37
38 if (id == hook_print_str) {
39 int i;
40 char *str;
41
42 HOOK_DATA(1) = pcnt;
43
44 va_start(ap, pcnt);
45 str = (char *)va_arg(ap, unsigned);
46
47 for (i = 0; i != pcnt; i++)
48 HOOK_DATA_BYTE(8 + i) = str[i];
49
50 HOOK_DATA_BYTE(8 + i) = 0; /* null byte */
51 } else {
52 va_start(ap, pcnt);
53 for (i = 1; i <= pcnt; i++)
54 HOOK_DATA(i) = va_arg(ap, unsigned);
55 va_end(ap);
56 }
57
58 /* read from mem to make sure data has propagated to memory before
59 * trigging */
60 ret = *((volatile unsigned *)HOOK_MEM_BASE_ADDR);
61
62 /* trigger hook */
63 HOOK_TRIG(id);
64
65 /* wait for call to finish */
66 while (VHOOK_DATA(0) > 0) ;
67
68 /* extract return value */
69
70 ret = VHOOK_DATA(1);
71
72#ifdef USING_SOS
73 PREEMPT_RESTORE();
74#endif
75 return ret;
76}
77
78unsigned hook_buf(unsigned i)
79{
80 return (HOOK_DATA(i));
81}
82
83void print_str(const char *str)
84{
85 int i;
86 /* find null at end of string */
87 for (i = 1; str[i]; i++) ;
88 hook_call(hook_print_str, i, str);
89}
90
91void CPU_KICK_DOG(void)
92{
93 (void)hook_call(hook_kick_dog, 0);
94}
95
96void CPU_WATCHDOG_TIMEOUT(unsigned t)
97{
98 (void)hook_call(hook_dog_timeout, 1, t);
99}
100
diff --git a/arch/cris/arch-v32/kernel/vcs_hook.h b/arch/cris/arch-v32/mach-fs/vcs_hook.h
index 7d73709e3cc6..c000b9fece41 100644
--- a/arch/cris/arch-v32/kernel/vcs_hook.h
+++ b/arch/cris/arch-v32/mach-fs/vcs_hook.h
@@ -1,11 +1,11 @@
1// $Id: vcs_hook.h,v 1.1 2003/08/12 12:01:06 starvik Exp $ 1/*
2// 2 * Call simulator hook functions
3// Call simulator hook functions 3 */
4 4
5#ifndef HOOK_H 5#ifndef HOOK_H
6#define HOOK_H 6#define HOOK_H
7 7
8int hook_call( unsigned id, unsigned pcnt, ...); 8int hook_call(unsigned id, unsigned pcnt, ...);
9 9
10enum hook_ids { 10enum hook_ids {
11 hook_debug_on = 1, 11 hook_debug_on = 1,
diff --git a/arch/cris/arch-v32/mm/Makefile b/arch/cris/arch-v32/mm/Makefile
index 9146f88484b1..0b801f2964ac 100644
--- a/arch/cris/arch-v32/mm/Makefile
+++ b/arch/cris/arch-v32/mm/Makefile
@@ -1,3 +1,4 @@
1# Makefile for the Linux/cris parts of the memory manager. 1# Makefile for the Linux/cris parts of the memory manager.
2 2
3obj-y := mmu.o init.o tlb.o intmem.o 3obj-y += mmu.o init.o tlb.o intmem.o
4obj-$(CONFIG_ETRAX_L2CACHE) += l2cache.o
diff --git a/arch/cris/arch-v32/mm/init.c b/arch/cris/arch-v32/mm/init.c
index a84ba7ff22d2..5a9ac5834647 100644
--- a/arch/cris/arch-v32/mm/init.c
+++ b/arch/cris/arch-v32/mm/init.c
@@ -65,7 +65,7 @@ cris_mmu_init(void)
65 REG_STATE(mmu, rw_mm_cfg, seg_d, page) | 65 REG_STATE(mmu, rw_mm_cfg, seg_d, page) |
66 REG_STATE(mmu, rw_mm_cfg, seg_c, linear) | 66 REG_STATE(mmu, rw_mm_cfg, seg_c, linear) |
67 REG_STATE(mmu, rw_mm_cfg, seg_b, linear) | 67 REG_STATE(mmu, rw_mm_cfg, seg_b, linear) |
68#ifndef CONFIG_ETRAXFS_SIM 68#ifndef CONFIG_ETRAX_VCS_SIM
69 REG_STATE(mmu, rw_mm_cfg, seg_a, page) | 69 REG_STATE(mmu, rw_mm_cfg, seg_a, page) |
70#else 70#else
71 REG_STATE(mmu, rw_mm_cfg, seg_a, linear) | 71 REG_STATE(mmu, rw_mm_cfg, seg_a, linear) |
@@ -84,13 +84,9 @@ cris_mmu_init(void)
84 mmu_kbase_hi = ( REG_FIELD(mmu, rw_mm_kbase_hi, base_f, 0x0) | 84 mmu_kbase_hi = ( REG_FIELD(mmu, rw_mm_kbase_hi, base_f, 0x0) |
85 REG_FIELD(mmu, rw_mm_kbase_hi, base_e, 0x8) | 85 REG_FIELD(mmu, rw_mm_kbase_hi, base_e, 0x8) |
86 REG_FIELD(mmu, rw_mm_kbase_hi, base_d, 0x0) | 86 REG_FIELD(mmu, rw_mm_kbase_hi, base_d, 0x0) |
87#ifndef CONFIG_ETRAXFS_SIM
88 REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 0x4) | 87 REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 0x4) |
89#else
90 REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 0x0) |
91#endif
92 REG_FIELD(mmu, rw_mm_kbase_hi, base_b, 0xb) | 88 REG_FIELD(mmu, rw_mm_kbase_hi, base_b, 0xb) |
93#ifndef CONFIG_ETRAXFS_SIM 89#ifndef CONFIG_ETRAX_VCS_SIM
94 REG_FIELD(mmu, rw_mm_kbase_hi, base_a, 0x0) | 90 REG_FIELD(mmu, rw_mm_kbase_hi, base_a, 0x0) |
95#else 91#else
96 REG_FIELD(mmu, rw_mm_kbase_hi, base_a, 0xa) | 92 REG_FIELD(mmu, rw_mm_kbase_hi, base_a, 0xa) |
diff --git a/arch/cris/arch-v32/mm/intmem.c b/arch/cris/arch-v32/mm/intmem.c
index 41ee7f7997fd..9e8b69cdf19e 100644
--- a/arch/cris/arch-v32/mm/intmem.c
+++ b/arch/cris/arch-v32/mm/intmem.c
@@ -7,11 +7,17 @@
7#include <linux/list.h> 7#include <linux/list.h>
8#include <linux/slab.h> 8#include <linux/slab.h>
9#include <asm/io.h> 9#include <asm/io.h>
10#include <asm/arch/memmap.h> 10#include <memmap.h>
11 11
12#define STATUS_FREE 0 12#define STATUS_FREE 0
13#define STATUS_ALLOCATED 1 13#define STATUS_ALLOCATED 1
14 14
15#ifdef CONFIG_ETRAX_L2CACHE
16#define RESERVED_SIZE 66*1024
17#else
18#define RESERVED_SIZE 0
19#endif
20
15struct intmem_allocation { 21struct intmem_allocation {
16 struct list_head entry; 22 struct list_head entry;
17 unsigned int size; 23 unsigned int size;
@@ -30,9 +36,10 @@ static void crisv32_intmem_init(void)
30 struct intmem_allocation* alloc = 36 struct intmem_allocation* alloc =
31 (struct intmem_allocation*)kmalloc(sizeof *alloc, GFP_KERNEL); 37 (struct intmem_allocation*)kmalloc(sizeof *alloc, GFP_KERNEL);
32 INIT_LIST_HEAD(&intmem_allocations); 38 INIT_LIST_HEAD(&intmem_allocations);
33 intmem_virtual = ioremap(MEM_INTMEM_START, MEM_INTMEM_SIZE); 39 intmem_virtual = ioremap(MEM_INTMEM_START + RESERVED_SIZE,
40 MEM_INTMEM_SIZE - RESERVED_SIZE);
34 initiated = 1; 41 initiated = 1;
35 alloc->size = MEM_INTMEM_SIZE; 42 alloc->size = MEM_INTMEM_SIZE - RESERVED_SIZE;
36 alloc->offset = 0; 43 alloc->offset = 0;
37 alloc->status = STATUS_FREE; 44 alloc->status = STATUS_FREE;
38 list_add_tail(&alloc->entry, &intmem_allocations); 45 list_add_tail(&alloc->entry, &intmem_allocations);
@@ -59,19 +66,23 @@ void* crisv32_intmem_alloc(unsigned size, unsigned align)
59 (struct intmem_allocation*) 66 (struct intmem_allocation*)
60 kmalloc(sizeof *alloc, GFP_ATOMIC); 67 kmalloc(sizeof *alloc, GFP_ATOMIC);
61 alloc->status = STATUS_FREE; 68 alloc->status = STATUS_FREE;
62 alloc->size = allocation->size - size - alignment; 69 alloc->size = allocation->size - size -
63 alloc->offset = allocation->offset + size; 70 alignment;
71 alloc->offset = allocation->offset + size +
72 alignment;
64 list_add(&alloc->entry, &allocation->entry); 73 list_add(&alloc->entry, &allocation->entry);
65 74
66 if (alignment) { 75 if (alignment) {
67 struct intmem_allocation* tmp; 76 struct intmem_allocation *tmp;
68 tmp = (struct intmem_allocation*) 77 tmp = (struct intmem_allocation *)
69 kmalloc(sizeof *tmp, GFP_ATOMIC); 78 kmalloc(sizeof *tmp,
79 GFP_ATOMIC);
70 tmp->offset = allocation->offset; 80 tmp->offset = allocation->offset;
71 tmp->size = alignment; 81 tmp->size = alignment;
72 tmp->status = STATUS_FREE; 82 tmp->status = STATUS_FREE;
73 allocation->offset += alignment; 83 allocation->offset += alignment;
74 list_add_tail(&tmp->entry, &allocation->entry); 84 list_add_tail(&tmp->entry,
85 &allocation->entry);
75 } 86 }
76 } 87 }
77 allocation->status = STATUS_ALLOCATED; 88 allocation->status = STATUS_ALLOCATED;
@@ -96,22 +107,24 @@ void crisv32_intmem_free(void* addr)
96 107
97 list_for_each_entry_safe(allocation, tmp, &intmem_allocations, entry) { 108 list_for_each_entry_safe(allocation, tmp, &intmem_allocations, entry) {
98 if (allocation->offset == (int)(addr - intmem_virtual)) { 109 if (allocation->offset == (int)(addr - intmem_virtual)) {
99 struct intmem_allocation* prev = 110 struct intmem_allocation *prev =
100 list_entry(allocation->entry.prev, 111 list_entry(allocation->entry.prev,
101 struct intmem_allocation, entry); 112 struct intmem_allocation, entry);
102 struct intmem_allocation* next = 113 struct intmem_allocation *next =
103 list_entry(allocation->entry.next, 114 list_entry(allocation->entry.next,
104 struct intmem_allocation, entry); 115 struct intmem_allocation, entry);
105 116
106 allocation->status = STATUS_FREE; 117 allocation->status = STATUS_FREE;
107 /* Join with prev and/or next if also free */ 118 /* Join with prev and/or next if also free */
108 if (prev->status == STATUS_FREE) { 119 if ((prev != &intmem_allocations) &&
120 (prev->status == STATUS_FREE)) {
109 prev->size += allocation->size; 121 prev->size += allocation->size;
110 list_del(&allocation->entry); 122 list_del(&allocation->entry);
111 kfree(allocation); 123 kfree(allocation);
112 allocation = prev; 124 allocation = prev;
113 } 125 }
114 if (next->status == STATUS_FREE) { 126 if ((next != &intmem_allocations) &&
127 (next->status == STATUS_FREE)) {
115 allocation->size += next->size; 128 allocation->size += next->size;
116 list_del(&next->entry); 129 list_del(&next->entry);
117 kfree(next); 130 kfree(next);
@@ -125,15 +138,16 @@ void crisv32_intmem_free(void* addr)
125 138
126void* crisv32_intmem_phys_to_virt(unsigned long addr) 139void* crisv32_intmem_phys_to_virt(unsigned long addr)
127{ 140{
128 return (void*)(addr - MEM_INTMEM_START+ 141 return (void *)(addr - (MEM_INTMEM_START + RESERVED_SIZE) +
129 (unsigned long)intmem_virtual); 142 (unsigned long)intmem_virtual);
130} 143}
131 144
132unsigned long crisv32_intmem_virt_to_phys(void* addr) 145unsigned long crisv32_intmem_virt_to_phys(void* addr)
133{ 146{
134 return (unsigned long)((unsigned long )addr - 147 return (unsigned long)((unsigned long )addr -
135 (unsigned long)intmem_virtual + MEM_INTMEM_START); 148 (unsigned long)intmem_virtual + MEM_INTMEM_START +
149 RESERVED_SIZE);
136} 150}
137 151
138 152module_init(crisv32_intmem_init);
139 153
diff --git a/arch/cris/arch-v32/mm/l2cache.c b/arch/cris/arch-v32/mm/l2cache.c
new file mode 100644
index 000000000000..332ff10dcc6b
--- /dev/null
+++ b/arch/cris/arch-v32/mm/l2cache.c
@@ -0,0 +1,29 @@
1#include <linux/init.h>
2#include <linux/kernel.h>
3#include <linux/string.h>
4#include <memmap.h>
5#include <hwregs/reg_map.h>
6#include <hwregs/reg_rdwr.h>
7#include <hwregs/l2cache_defs.h>
8#include <asm/io.h>
9
10#define L2CACHE_SIZE 64
11
12int __init l2cache_init(void)
13{
14 reg_l2cache_rw_ctrl ctrl = {0};
15 reg_l2cache_rw_cfg cfg = {.en = regk_l2cache_yes};
16
17 ctrl.csize = L2CACHE_SIZE;
18 ctrl.cbase = L2CACHE_SIZE / 4 + (L2CACHE_SIZE % 4 ? 1 : 0);
19 REG_WR(l2cache, regi_l2cache, rw_ctrl, ctrl);
20
21 /* Flush the tag memory */
22 memset((void *)(MEM_INTMEM_START | MEM_NON_CACHEABLE), 0, 2*1024);
23
24 /* Enable the cache */
25 REG_WR(l2cache, regi_l2cache, rw_cfg, cfg);
26
27 return 0;
28}
29
diff --git a/arch/cris/arch-v32/mm/mmu.S b/arch/cris/arch-v32/mm/mmu.S
index 27b70e5006af..2238d154bde3 100644
--- a/arch/cris/arch-v32/mm/mmu.S
+++ b/arch/cris/arch-v32/mm/mmu.S
@@ -1,3 +1,5 @@
1; WARNING : The refill handler has been modified, see below !!!
2
1/* 3/*
2 * Copyright (C) 2003 Axis Communications AB 4 * Copyright (C) 2003 Axis Communications AB
3 * 5 *
@@ -61,6 +63,14 @@
61; Note that the code is optimized to minimize stalls (makes the code harder 63; Note that the code is optimized to minimize stalls (makes the code harder
62; to read). 64; to read).
63; 65;
66; WARNING !!!
67; Modified by Mikael Asker 060725: added a workaround for strange TLB
68; behavior. If the same PTE is present in more than one set, the TLB
69; doesn't recognize it and we get stuck in a loop of refill exceptions.
70; The workaround detects such loops and exits them by flushing
71; the TLB contents. The problem and workaround were verified
72; in VCS by Mikael Starvik.
73;
64; Each page is 8 KB. Each PMD holds 8192/4 PTEs (each PTE is 4 bytes) so each 74; Each page is 8 KB. Each PMD holds 8192/4 PTEs (each PTE is 4 bytes) so each
65; PMD holds 16 MB of virtual memory. 75; PMD holds 16 MB of virtual memory.
66; Bits 0-12 : Offset within a page 76; Bits 0-12 : Offset within a page
@@ -68,6 +78,11 @@
68; Bits 24-31 : PMD offset within the PGD 78; Bits 24-31 : PMD offset within the PGD
69 79
70.macro MMU_REFILL_HANDLER handler, mmu 80.macro MMU_REFILL_HANDLER handler, mmu
81 .data
821: .dword 0 ; refill_count
83 ; == 0 <=> last_refill_cause is invalid
842: .dword 0 ; last_refill_cause
85 .text
71 .globl \handler 86 .globl \handler
72\handler: 87\handler:
73 subq 4, $sp 88 subq 4, $sp
@@ -76,42 +91,96 @@
76 subq 4, $sp 91 subq 4, $sp
77 move \mmu, $srs ; Select MMU support register bank 92 move \mmu, $srs ; Select MMU support register bank
78 move.d $acr, [$sp] 93 move.d $acr, [$sp]
79 subq 4, $sp 94 subq 12, $sp
80 move.d $r0, [$sp] 95 move.d 1b, $acr ; Point to refill_count
96 movem $r2, [$sp]
97
98 test.d [$acr] ; refill_count == 0 ?
99 beq 5f ; yes, last_refill_cause is invalid
100 move.d $acr, $r1
101
102 ; last_refill_cause is valid, investigate cause
103 addq 4, $r1 ; Point to last_refill_cause
104 move $s3, $r0 ; Get rw_mm_cause
105 move.d [$r1], $r2 ; Get last_refill_cause
106 cmp.d $r0, $r2 ; rw_mm_cause == last_refill_cause ?
107 beq 6f ; yes, increment count
108 moveq 1, $r2
109
110 ; rw_mm_cause != last_refill_cause
111 move.d $r2, [$acr] ; refill_count = 1
112 move.d $r0, [$r1] ; last_refill_cause = rw_mm_cause
113
1143: ; Probably not in a loop, continue normal processing
81#ifdef CONFIG_SMP 115#ifdef CONFIG_SMP
82 move $s7, $acr ; PGD 116 move $s7, $acr ; PGD
83#else 117#else
84 move.d per_cpu__current_pgd, $acr ; PGD 118 move.d per_cpu__current_pgd, $acr ; PGD
85#endif 119#endif
86 ; Look up PMD in PGD 120 ; Look up PMD in PGD
87 move $s3, $r0 ; rw_mm_cause
88 lsrq 24, $r0 ; Get PMD index into PGD (bit 24-31) 121 lsrq 24, $r0 ; Get PMD index into PGD (bit 24-31)
89 move.d [$acr], $acr ; PGD for the current process 122 move.d [$acr], $acr ; PGD for the current process
90 addi $r0.d, $acr, $acr 123 addi $r0.d, $acr, $acr
91 move $s3, $r0 ; rw_mm_cause 124 move $s3, $r0 ; rw_mm_cause
92 move.d [$acr], $acr ; Get PMD 125 move.d [$acr], $acr ; Get PMD
93 beq 1f 126 beq 8f
94 ; Look up PTE in PMD 127 ; Look up PTE in PMD
95 lsrq PAGE_SHIFT, $r0 128 lsrq PAGE_SHIFT, $r0
96 and.w PAGE_MASK, $acr ; Remove PMD flags 129 and.w PAGE_MASK, $acr ; Remove PMD flags
97 and.d 0x7ff, $r0 ; Get PTE index into PMD (bit 13-23) 130 and.d 0x7ff, $r0 ; Get PTE index into PMD (bit 13-23)
98 addi $r0.d, $acr, $acr 131 addi $r0.d, $acr, $acr
99 move.d [$acr], $acr ; Get PTE 132 move.d [$acr], $acr ; Get PTE
100 beq 2f 133 beq 9f
101 move.d [$sp+], $r0 ; Pop r0 in delayslot 134 movem [$sp], $r2 ; Restore r0-r2 in delay slot
135 addq 12, $sp
102 ; Store in TLB 136 ; Store in TLB
103 move $acr, $s5 137 move $acr, $s5
104 ; Return 1384: ; Return
105 move.d [$sp+], $acr 139 move.d [$sp+], $acr
106 move [$sp], $srs 140 move [$sp], $srs
107 addq 4, $sp 141 addq 4, $sp
108 rete 142 rete
109 rfe 143 rfe
1101: ; PMD missing, let the mm subsystem fix it up. 144
111 move.d [$sp+], $r0 ; Pop r0 1455: ; last_refill_cause is invalid
1122: ; PTE missing, let the mm subsystem fix it up. 146 moveq 1, $r2
147 addq 4, $r1 ; Point to last_refill_cause
148 move.d $r2, [$acr] ; refill_count = 1
149 move $s3, $r0 ; Get rw_mm_cause
150 ba 3b ; Continue normal processing
151 move.d $r0,[$r1] ; last_refill_cause = rw_mm_cause
152
1536: ; rw_mm_cause == last_refill_cause
154 move.d [$acr], $r2 ; Get refill_count
155 cmpq 4, $r2 ; refill_count > 4 ?
156 bhi 7f ; yes
157 addq 1, $r2 ; refill_count++
158 ba 3b ; Continue normal processing
159 move.d $r2, [$acr]
160
1617: ; refill_count > 4, error
162 move.d $acr, $r0 ; Save pointer to refill_count
163 clear.d [$r0] ; refill_count = 0
164
165 ;; rewind the short stack
166 movem [$sp], $r2 ; Restore r0-r2
167 addq 12, $sp
168 move.d [$sp+], $acr
169 move [$sp], $srs
170 addq 4, $sp
171 ;; Keep it simple (slow), save all the regs.
172 SAVE_ALL
173 jsr __flush_tlb_all
174 nop
175 ba ret_from_intr ; Return
176 nop
177
1788: ; PMD missing, let the mm subsystem fix it up.
179 movem [$sp], $r2 ; Restore r0-r2
1809: ; PTE missing, let the mm subsystem fix it up.
181 addq 12, $sp
113 move.d [$sp+], $acr 182 move.d [$sp+], $acr
114 move [$sp], $srs 183 move [$sp], $srs
115 addq 4, $sp 184 addq 4, $sp
116 SAVE_ALL 185 SAVE_ALL
117 move \mmu, $srs 186 move \mmu, $srs
diff --git a/arch/cris/arch-v32/mm/tlb.c b/arch/cris/arch-v32/mm/tlb.c
index a076ef6e9389..eda5ebcaea54 100644
--- a/arch/cris/arch-v32/mm/tlb.c
+++ b/arch/cris/arch-v32/mm/tlb.c
@@ -13,8 +13,8 @@
13#include <asm/arch/hwregs/supp_reg.h> 13#include <asm/arch/hwregs/supp_reg.h>
14 14
15#define UPDATE_TLB_SEL_IDX(val) \ 15#define UPDATE_TLB_SEL_IDX(val) \
16do { \ 16do { \
17 unsigned long tlb_sel; \ 17 unsigned long tlb_sel; \
18 \ 18 \
19 tlb_sel = REG_FIELD(mmu, rw_mm_tlb_sel, idx, val); \ 19 tlb_sel = REG_FIELD(mmu, rw_mm_tlb_sel, idx, val); \
20 SUPP_REG_WR(RW_MM_TLB_SEL, tlb_sel); \ 20 SUPP_REG_WR(RW_MM_TLB_SEL, tlb_sel); \
@@ -30,8 +30,8 @@ do { \
30 * The TLB can host up to 256 different mm contexts at the same time. The running 30 * The TLB can host up to 256 different mm contexts at the same time. The running
31 * context is found in the PID register. Each TLB entry contains a page_id that 31 * context is found in the PID register. Each TLB entry contains a page_id that
32 * has to match the PID register to give a hit. page_id_map keeps track of which 32 * has to match the PID register to give a hit. page_id_map keeps track of which
33 * mm is assigned to which page_id, making sure it's known when to invalidate TLB 33 * mm's is assigned to which page_id's, making sure it's known when to
34 * entries. 34 * invalidate TLB entries.
35 * 35 *
36 * The last page_id is never running, it is used as an invalid page_id so that 36 * The last page_id is never running, it is used as an invalid page_id so that
37 * it's possible to make TLB entries that will nerver match. 37 * it's possible to make TLB entries that will nerver match.
@@ -179,29 +179,29 @@ void
179switch_mm(struct mm_struct *prev, struct mm_struct *next, 179switch_mm(struct mm_struct *prev, struct mm_struct *next,
180 struct task_struct *tsk) 180 struct task_struct *tsk)
181{ 181{
182 int cpu = smp_processor_id(); 182 if (prev != next) {
183 183 int cpu = smp_processor_id();
184 /* Make sure there is a MMU context. */ 184
185 spin_lock(&mmu_context_lock); 185 /* Make sure there is a MMU context. */
186 get_mmu_context(next); 186 spin_lock(&mmu_context_lock);
187 cpu_set(cpu, next->cpu_vm_mask); 187 get_mmu_context(next);
188 spin_unlock(&mmu_context_lock); 188 cpu_set(cpu, next->cpu_vm_mask);
189 189 spin_unlock(&mmu_context_lock);
190 /* 190
191 * Remember the pgd for the fault handlers. Keep a separate copy of it 191 /*
192 * because current and active_mm might be invalid at points where 192 * Remember the pgd for the fault handlers. Keep a seperate
193 * there's still a need to derefer the pgd. 193 * copy of it because current and active_mm might be invalid
194 */ 194 * at points where * there's still a need to derefer the pgd.
195 per_cpu(current_pgd, cpu) = next->pgd; 195 */
196 196 per_cpu(current_pgd, cpu) = next->pgd;
197 /* Switch context in the MMU. */ 197
198 if (tsk && task_thread_info(tsk)) 198 /* Switch context in the MMU. */
199 { 199 if (tsk && task_thread_info(tsk)) {
200 SPEC_REG_WR(SPEC_REG_PID, next->context.page_id | task_thread_info(tsk)->tls); 200 SPEC_REG_WR(SPEC_REG_PID, next->context.page_id |
201 } 201 task_thread_info(tsk)->tls);
202 else 202 } else {
203 { 203 SPEC_REG_WR(SPEC_REG_PID, next->context.page_id);
204 SPEC_REG_WR(SPEC_REG_PID, next->context.page_id); 204 }
205 } 205 }
206} 206}
207 207
diff --git a/arch/cris/arch-v32/vmlinux.lds.S b/arch/cris/arch-v32/vmlinux.lds.S
index fead8c59ea63..d5f28e40717c 100644
--- a/arch/cris/arch-v32/vmlinux.lds.S
+++ b/arch/cris/arch-v32/vmlinux.lds.S
@@ -9,6 +9,13 @@
9 */ 9 */
10 10
11#include <asm-generic/vmlinux.lds.h> 11#include <asm-generic/vmlinux.lds.h>
12#include <asm/page.h>
13
14#ifdef CONFIG_ETRAX_VMEM_SIZE
15#define __CONFIG_ETRAX_VMEM_SIZE CONFIG_ETRAX_VMEM_SIZE
16#else
17#define __CONFIG_ETRAX_VMEM_SIZE 0
18#endif
12 19
13jiffies = jiffies_64; 20jiffies = jiffies_64;
14SECTIONS 21SECTIONS
@@ -17,18 +24,19 @@ SECTIONS
17 dram_start = .; 24 dram_start = .;
18 ebp_start = .; 25 ebp_start = .;
19 26
20 /* The boot section is only necessary until the VCS top level testbench */ 27 /* The boot section is only necessary until the VCS top */
21 /* includes both flash and DRAM. */ 28 /* level testbench includes both flash and DRAM. */
22 .boot : { *(.boot) } 29 .boot : { *(.boot) }
23 30
24 . = DRAM_VIRTUAL_BASE + 0x4000; /* See head.S and pages reserved at the start. */ 31 /* See head.S and pages reserved at the start. */
32 . = DRAM_VIRTUAL_BASE + 0x4000;
25 33
26 _text = .; /* Text and read-only data. */ 34 _text = .; /* Text and read-only data. */
27 text_start = .; /* Lots of aliases. */ 35 text_start = .; /* Lots of aliases. */
28 _stext = .; 36 _stext = .;
29 __stext = .; 37 __stext = .;
30 .text : { 38 .text : {
31 *(.text) 39 TEXT_TEXT
32 SCHED_TEXT 40 SCHED_TEXT
33 LOCK_TEXT 41 LOCK_TEXT
34 *(.fixup) 42 *(.fixup)
@@ -39,9 +47,9 @@ SECTIONS
39 __etext = .; 47 __etext = .;
40 48
41 . = ALIGN(4); /* Exception table. */ 49 . = ALIGN(4); /* Exception table. */
42 __start___ex_table = .; 50 __start___ex_table = .;
43 __ex_table : { *(__ex_table) } 51 __ex_table : { *(__ex_table) }
44 __stop___ex_table = .; 52 __stop___ex_table = .;
45 53
46 RODATA 54 RODATA
47 55
@@ -54,33 +62,27 @@ SECTIONS
54 __edata = . ; /* End of data section. */ 62 __edata = . ; /* End of data section. */
55 _edata = . ; 63 _edata = . ;
56 64
57 . = ALIGN(8192); /* init_task and stack, must be aligned. */ 65 . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */
58 .data.init_task : { *(.data.init_task) } 66 .data.init_task : { *(.data.init_task) }
59 67
60 . = ALIGN(8192); /* Init code and data. */ 68 . = ALIGN(PAGE_SIZE); /* Init code and data. */
61 __init_begin = .; 69 __init_begin = .;
62 .init.text : { 70 .init.text : {
63 _sinittext = .; 71 _sinittext = .;
64 INIT_TEXT 72 INIT_TEXT
65 _einittext = .; 73 _einittext = .;
66 } 74 }
67 .init.data : { INIT_DATA } 75 .init.data : { INIT_DATA }
68 . = ALIGN(16); 76 . = ALIGN(16);
69 __setup_start = .; 77 __setup_start = .;
70 .init.setup : { *(.init.setup) } 78 .init.setup : { *(.init.setup) }
71 __setup_end = .; 79 __setup_end = .;
72 __start___param = .; 80 __start___param = .;
73 __param : { *(__param) } 81 __param : { *(__param) }
74 __stop___param = .; 82 __stop___param = .;
75 .initcall.init : { 83 .initcall.init : {
76 __initcall_start = .; 84 __initcall_start = .;
77 *(.initcall1.init); 85 INITCALLS
78 *(.initcall2.init);
79 *(.initcall3.init);
80 *(.initcall4.init);
81 *(.initcall5.init);
82 *(.initcall6.init);
83 *(.initcall7.init);
84 __initcall_end = .; 86 __initcall_end = .;
85 } 87 }
86 88
@@ -91,25 +93,23 @@ SECTIONS
91 } 93 }
92 SECURITY_INIT 94 SECURITY_INIT
93 95
94 PERCPU(8192) 96 __vmlinux_end = .; /* Last address of the physical file. */
97 PERCPU(PAGE_SIZE)
95 98
96#ifdef CONFIG_BLK_DEV_INITRD
97 .init.ramfs : { 99 .init.ramfs : {
98 __initramfs_start = .; 100 __initramfs_start = .;
99 *(.init.ramfs) 101 *(.init.ramfs)
100 __initramfs_end = .; 102 __initramfs_end = .;
101 /*
102 * We fill to the next page, so we can discard all init
103 * pages without needing to consider what payload might be
104 * appended to the kernel image.
105 */
106 FILL (0);
107 . = ALIGN (8192);
108 } 103 }
109#endif
110 104
111 __vmlinux_end = .; /* Last address of the physical file. */ 105 /*
112 __init_end = .; 106 * We fill to the next page, so we can discard all init
107 * pages without needing to consider what payload might be
108 * appended to the kernel image.
109 */
110 . = ALIGN (PAGE_SIZE);
111
112 __init_end = .;
113 113
114 __data_end = . ; /* Move to _edata? */ 114 __data_end = . ; /* Move to _edata? */
115 __bss_start = .; /* BSS. */ 115 __bss_start = .; /* BSS. */
@@ -123,11 +123,11 @@ SECTIONS
123 __end = .; 123 __end = .;
124 124
125 /* Sections to be discarded */ 125 /* Sections to be discarded */
126 /DISCARD/ : { 126 /DISCARD/ : {
127 EXIT_TEXT 127 EXIT_TEXT
128 EXIT_DATA 128 EXIT_DATA
129 *(.exitcall.exit) 129 *(.exitcall.exit)
130 } 130 }
131 131
132 dram_end = dram_start + CONFIG_ETRAX_DRAM_SIZE*1024*1024; 132 dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
133} 133}
diff --git a/arch/cris/artpec_3_defconfig b/arch/cris/artpec_3_defconfig
new file mode 100644
index 000000000000..41fe67409aab
--- /dev/null
+++ b/arch/cris/artpec_3_defconfig
@@ -0,0 +1,582 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24-rc3
4# Mon Dec 3 11:18:54 2007
5#
6CONFIG_MMU=y
7CONFIG_ZONE_DMA=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_IOMAP=y
10# CONFIG_ARCH_HAS_ILOG2_U32 is not set
11# CONFIG_ARCH_HAS_ILOG2_U64 is not set
12CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_CALIBRATE_DELAY=y
15CONFIG_NO_IOPORT=y
16CONFIG_FORCE_MAX_ZONEORDER=6
17CONFIG_CRIS=y
18CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
19
20#
21# General setup
22#
23CONFIG_EXPERIMENTAL=y
24CONFIG_BROKEN_ON_SMP=y
25CONFIG_INIT_ENV_ARG_LIMIT=32
26CONFIG_LOCALVERSION=""
27CONFIG_LOCALVERSION_AUTO=y
28# CONFIG_SWAP is not set
29# CONFIG_SYSVIPC is not set
30# CONFIG_POSIX_MQUEUE is not set
31# CONFIG_BSD_PROCESS_ACCT is not set
32# CONFIG_TASKSTATS is not set
33# CONFIG_USER_NS is not set
34# CONFIG_PID_NS is not set
35# CONFIG_AUDIT is not set
36# CONFIG_IKCONFIG is not set
37CONFIG_LOG_BUF_SHIFT=14
38# CONFIG_CGROUPS is not set
39CONFIG_FAIR_GROUP_SCHED=y
40CONFIG_FAIR_USER_SCHED=y
41# CONFIG_FAIR_CGROUP_SCHED is not set
42CONFIG_SYSFS_DEPRECATED=y
43# CONFIG_RELAY is not set
44# CONFIG_BLK_DEV_INITRD is not set
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y
47CONFIG_EMBEDDED=y
48CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y
50# CONFIG_KALLSYMS is not set
51# CONFIG_HOTPLUG is not set
52CONFIG_PRINTK=y
53CONFIG_BUG=y
54CONFIG_ELF_CORE=y
55CONFIG_BASE_FULL=y
56CONFIG_FUTEX=y
57CONFIG_ANON_INODES=y
58CONFIG_EPOLL=y
59CONFIG_SIGNALFD=y
60CONFIG_EVENTFD=y
61CONFIG_SHMEM=y
62CONFIG_VM_EVENT_COUNTERS=y
63CONFIG_SLUB_DEBUG=y
64# CONFIG_SLAB is not set
65CONFIG_SLUB=y
66# CONFIG_SLOB is not set
67CONFIG_RT_MUTEXES=y
68# CONFIG_TINY_SHMEM is not set
69CONFIG_BASE_SMALL=0
70# CONFIG_MODULES is not set
71CONFIG_BLOCK=y
72# CONFIG_LBD is not set
73# CONFIG_BLK_DEV_IO_TRACE is not set
74# CONFIG_LSF is not set
75# CONFIG_BLK_DEV_BSG is not set
76
77#
78# IO Schedulers
79#
80CONFIG_IOSCHED_NOOP=y
81# CONFIG_IOSCHED_AS is not set
82# CONFIG_IOSCHED_DEADLINE is not set
83CONFIG_IOSCHED_CFQ=y
84# CONFIG_DEFAULT_AS is not set
85# CONFIG_DEFAULT_DEADLINE is not set
86CONFIG_DEFAULT_CFQ=y
87# CONFIG_DEFAULT_NOOP is not set
88CONFIG_DEFAULT_IOSCHED="cfq"
89
90#
91# General setup
92#
93CONFIG_BINFMT_ELF=y
94# CONFIG_BINFMT_MISC is not set
95CONFIG_GENERIC_HARDIRQS=y
96CONFIG_ETRAX_CMDLINE="root=/dev/mtdblock3 init=/linuxrc"
97# CONFIG_ETRAX_WATCHDOG is not set
98CONFIG_ETRAX_FAST_TIMER=y
99# CONFIG_ETRAX_KMALLOCED_MODULES is not set
100# CONFIG_OOM_REBOOT is not set
101CONFIG_PREEMPT_NONE=y
102# CONFIG_PREEMPT_VOLUNTARY is not set
103# CONFIG_PREEMPT is not set
104CONFIG_SELECT_MEMORY_MODEL=y
105CONFIG_FLATMEM_MANUAL=y
106# CONFIG_DISCONTIGMEM_MANUAL is not set
107# CONFIG_SPARSEMEM_MANUAL is not set
108CONFIG_FLATMEM=y
109CONFIG_FLAT_NODE_MEM_MAP=y
110# CONFIG_SPARSEMEM_STATIC is not set
111# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
112CONFIG_SPLIT_PTLOCK_CPUS=4
113# CONFIG_RESOURCES_64BIT is not set
114CONFIG_ZONE_DMA_FLAG=1
115CONFIG_BOUNCE=y
116CONFIG_VIRT_TO_BUS=y
117
118#
119# Hardware setup
120#
121# CONFIG_ETRAX100LX is not set
122# CONFIG_ETRAX100LX_V2 is not set
123# CONFIG_SVINTO_SIM is not set
124# CONFIG_ETRAXFS is not set
125CONFIG_CRIS_MACH_ARTPEC3=y
126# CONFIG_ETRAX_VCS_SIM is not set
127# CONFIG_ETRAX_ARCH_V10 is not set
128CONFIG_ETRAX_ARCH_V32=y
129CONFIG_ETRAX_DRAM_SIZE=32
130CONFIG_ETRAX_VMEM_SIZE=8
131CONFIG_ETRAX_FLASH_BUSWIDTH=2
132CONFIG_ETRAX_NANDFLASH_BUSWIDTH=1
133CONFIG_ETRAX_FLASH1_SIZE=4
134CONFIG_ETRAX_DEBUG_PORT0=y
135# CONFIG_ETRAX_DEBUG_PORT1 is not set
136# CONFIG_ETRAX_DEBUG_PORT2 is not set
137# CONFIG_ETRAX_DEBUG_PORT3 is not set
138# CONFIG_ETRAX_DEBUG_PORT_NULL is not set
139CONFIG_ETRAX_DRAM_VIRTUAL_BASE=c0000000
140CONFIG_ETRAX_SERIAL_PORTS=5
141CONFIG_ETRAX_DEF_GIO_PA_OE=1c
142CONFIG_ETRAX_DEF_GIO_PA_OUT=00
143CONFIG_ETRAX_DEF_GIO_PB_OE=00000
144CONFIG_ETRAX_DEF_GIO_PB_OUT=00000
145CONFIG_ETRAX_DEF_GIO_PC_OE=00000
146CONFIG_ETRAX_DEF_GIO_PC_OUT=00000
147
148#
149# Artpec-3 options
150#
151CONFIG_ETRAX_L2CACHE=y
152CONFIG_ETRAX_DDR=y
153CONFIG_ETRAX_DDR2_MRS=0
154CONFIG_ETRAX_DDR2_TIMING=0
155CONFIG_ETRAX_DDR2_CONFIG=0
156CONFIG_ETRAX_PIO_CE0_CFG=0
157CONFIG_ETRAX_PIO_CE1_CFG=0
158CONFIG_ETRAX_PIO_CE2_CFG=0
159# CONFIG_CPU_FREQ is not set
160# CONFIG_ETRAX_NBR_LED_GRP_ZERO is not set
161CONFIG_ETRAX_NBR_LED_GRP_ONE=y
162# CONFIG_ETRAX_NBR_LED_GRP_TWO is not set
163CONFIG_ETRAX_LED_G_NET0="PA3"
164CONFIG_ETRAX_LED_R_NET0="PA4"
165CONFIG_ETRAX_V32_LED2G="PA5"
166CONFIG_ETRAX_V32_LED2R="PA6"
167CONFIG_ETRAX_V32_LED3G="PA7"
168CONFIG_ETRAX_V32_LED3R="PA7"
169
170#
171# Networking
172#
173CONFIG_NET=y
174
175#
176# Networking options
177#
178CONFIG_PACKET=y
179# CONFIG_PACKET_MMAP is not set
180CONFIG_UNIX=y
181CONFIG_XFRM=y
182# CONFIG_XFRM_USER is not set
183# CONFIG_XFRM_SUB_POLICY is not set
184# CONFIG_XFRM_MIGRATE is not set
185# CONFIG_NET_KEY is not set
186CONFIG_INET=y
187# CONFIG_IP_MULTICAST is not set
188# CONFIG_IP_ADVANCED_ROUTER is not set
189CONFIG_IP_FIB_HASH=y
190# CONFIG_IP_PNP is not set
191# CONFIG_NET_IPIP is not set
192# CONFIG_NET_IPGRE is not set
193# CONFIG_ARPD is not set
194# CONFIG_SYN_COOKIES is not set
195# CONFIG_INET_AH is not set
196# CONFIG_INET_ESP is not set
197# CONFIG_INET_IPCOMP is not set
198# CONFIG_INET_XFRM_TUNNEL is not set
199# CONFIG_INET_TUNNEL is not set
200CONFIG_INET_XFRM_MODE_TRANSPORT=y
201CONFIG_INET_XFRM_MODE_TUNNEL=y
202CONFIG_INET_XFRM_MODE_BEET=y
203# CONFIG_INET_LRO is not set
204CONFIG_INET_DIAG=y
205CONFIG_INET_TCP_DIAG=y
206# CONFIG_TCP_CONG_ADVANCED is not set
207CONFIG_TCP_CONG_CUBIC=y
208CONFIG_DEFAULT_TCP_CONG="cubic"
209# CONFIG_TCP_MD5SIG is not set
210# CONFIG_IP_VS is not set
211# CONFIG_IPV6 is not set
212# CONFIG_INET6_XFRM_TUNNEL is not set
213# CONFIG_INET6_TUNNEL is not set
214# CONFIG_NETWORK_SECMARK is not set
215CONFIG_NETFILTER=y
216# CONFIG_NETFILTER_DEBUG is not set
217
218#
219# Core Netfilter Configuration
220#
221# CONFIG_NETFILTER_NETLINK is not set
222# CONFIG_NF_CONNTRACK_ENABLED is not set
223# CONFIG_NF_CONNTRACK is not set
224# CONFIG_NETFILTER_XTABLES is not set
225
226#
227# IP: Netfilter Configuration
228#
229# CONFIG_IP_NF_QUEUE is not set
230# CONFIG_IP_NF_IPTABLES is not set
231# CONFIG_IP_NF_ARPTABLES is not set
232# CONFIG_IP_DCCP is not set
233# CONFIG_IP_SCTP is not set
234# CONFIG_TIPC is not set
235# CONFIG_ATM is not set
236# CONFIG_BRIDGE is not set
237# CONFIG_VLAN_8021Q is not set
238# CONFIG_DECNET is not set
239# CONFIG_LLC2 is not set
240# CONFIG_IPX is not set
241# CONFIG_ATALK is not set
242# CONFIG_X25 is not set
243# CONFIG_LAPB is not set
244# CONFIG_ECONET is not set
245# CONFIG_WAN_ROUTER is not set
246# CONFIG_NET_SCHED is not set
247
248#
249# Network testing
250#
251# CONFIG_NET_PKTGEN is not set
252# CONFIG_HAMRADIO is not set
253# CONFIG_IRDA is not set
254# CONFIG_BT is not set
255# CONFIG_AF_RXRPC is not set
256
257#
258# Wireless
259#
260# CONFIG_CFG80211 is not set
261# CONFIG_WIRELESS_EXT is not set
262# CONFIG_MAC80211 is not set
263# CONFIG_IEEE80211 is not set
264# CONFIG_RFKILL is not set
265# CONFIG_NET_9P is not set
266
267#
268# Drivers for built-in interfaces
269#
270CONFIG_ETRAX_ETHERNET=y
271# CONFIG_ETRAX_IDE is not set
272CONFIG_ETRAX_AXISFLASHMAP=y
273CONFIG_ETRAX_PTABLE_SECTOR=65536
274# CONFIG_ETRAX_I2C is not set
275# CONFIG_ETRAX_GPIO is not set
276# CONFIG_ETRAX_NO_PHY is not set
277# CONFIG_ETRAX_ETHERNET_IFACE0 is not set
278# CONFIG_ETRAX_ETHERNET_GBIT is not set
279# CONFIG_ETRAXFS_SERIAL is not set
280# CONFIG_ETRAX_SYNCHRONOUS_SERIAL is not set
281# CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE is not set
282# CONFIG_ETRAX_NANDFLASH is not set
283# CONFIG_ETRAX_CARDBUS is not set
284# CONFIG_ETRAX_IOP_FW_LOAD is not set
285# CONFIG_ETRAX_STREAMCOPROC is not set
286# CONFIG_ETRAX_SPI_MMC is not set
287# CONFIG_ETRAX_SPI_MMC_BOARD is not set
288# CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK is not set
289CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY=y
290
291#
292# Generic Driver Options
293#
294CONFIG_STANDALONE=y
295CONFIG_PREVENT_FIRMWARE_BUILD=y
296# CONFIG_SYS_HYPERVISOR is not set
297CONFIG_MTD=y
298# CONFIG_MTD_DEBUG is not set
299CONFIG_MTD_CONCAT=y
300CONFIG_MTD_PARTITIONS=y
301# CONFIG_MTD_REDBOOT_PARTS is not set
302# CONFIG_MTD_CMDLINE_PARTS is not set
303
304#
305# User Modules And Translation Layers
306#
307CONFIG_MTD_CHAR=y
308CONFIG_MTD_BLKDEVS=y
309CONFIG_MTD_BLOCK=y
310# CONFIG_FTL is not set
311# CONFIG_NFTL is not set
312# CONFIG_INFTL is not set
313# CONFIG_RFD_FTL is not set
314# CONFIG_SSFDC is not set
315# CONFIG_MTD_OOPS is not set
316
317#
318# RAM/ROM/Flash chip drivers
319#
320CONFIG_MTD_CFI=y
321CONFIG_MTD_JEDECPROBE=y
322CONFIG_MTD_GEN_PROBE=y
323# CONFIG_MTD_CFI_ADV_OPTIONS is not set
324CONFIG_MTD_MAP_BANK_WIDTH_1=y
325CONFIG_MTD_MAP_BANK_WIDTH_2=y
326CONFIG_MTD_MAP_BANK_WIDTH_4=y
327# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
328# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
329# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
330CONFIG_MTD_CFI_I1=y
331CONFIG_MTD_CFI_I2=y
332# CONFIG_MTD_CFI_I4 is not set
333# CONFIG_MTD_CFI_I8 is not set
334# CONFIG_MTD_CFI_INTELEXT is not set
335CONFIG_MTD_CFI_AMDSTD=y
336# CONFIG_MTD_CFI_STAA is not set
337CONFIG_MTD_CFI_UTIL=y
338CONFIG_MTD_RAM=y
339# CONFIG_MTD_ROM is not set
340# CONFIG_MTD_ABSENT is not set
341
342#
343# Mapping drivers for chip access
344#
345CONFIG_MTD_COMPLEX_MAPPINGS=y
346# CONFIG_MTD_PHYSMAP is not set
347# CONFIG_MTD_PLATRAM is not set
348
349#
350# Self-contained MTD device drivers
351#
352# CONFIG_MTD_SLRAM is not set
353# CONFIG_MTD_PHRAM is not set
354CONFIG_MTD_MTDRAM=y
355CONFIG_MTDRAM_TOTAL_SIZE=0
356CONFIG_MTDRAM_ERASE_SIZE=64
357CONFIG_MTDRAM_ABS_POS=0x0
358# CONFIG_MTD_BLOCK2MTD is not set
359
360#
361# Disk-On-Chip Device Drivers
362#
363# CONFIG_MTD_DOC2000 is not set
364# CONFIG_MTD_DOC2001 is not set
365# CONFIG_MTD_DOC2001PLUS is not set
366# CONFIG_MTD_NAND is not set
367# CONFIG_MTD_ONENAND is not set
368
369#
370# UBI - Unsorted block images
371#
372# CONFIG_MTD_UBI is not set
373CONFIG_BLK_DEV=y
374# CONFIG_BLK_DEV_COW_COMMON is not set
375# CONFIG_BLK_DEV_LOOP is not set
376# CONFIG_BLK_DEV_NBD is not set
377CONFIG_BLK_DEV_RAM=y
378CONFIG_BLK_DEV_RAM_COUNT=16
379CONFIG_BLK_DEV_RAM_SIZE=4096
380CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
381# CONFIG_CDROM_PKTCDVD is not set
382# CONFIG_ATA_OVER_ETH is not set
383CONFIG_NETDEVICES=y
384# CONFIG_NETDEVICES_MULTIQUEUE is not set
385# CONFIG_DUMMY is not set
386# CONFIG_BONDING is not set
387# CONFIG_MACVLAN is not set
388# CONFIG_EQUALIZER is not set
389# CONFIG_TUN is not set
390# CONFIG_VETH is not set
391# CONFIG_PHYLIB is not set
392CONFIG_NET_ETHERNET=y
393CONFIG_MII=y
394# CONFIG_IBM_NEW_EMAC_ZMII is not set
395# CONFIG_IBM_NEW_EMAC_RGMII is not set
396# CONFIG_IBM_NEW_EMAC_TAH is not set
397# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
398CONFIG_NETDEV_1000=y
399CONFIG_NETDEV_10000=y
400
401#
402# Wireless LAN
403#
404# CONFIG_WLAN_PRE80211 is not set
405# CONFIG_WLAN_80211 is not set
406# CONFIG_WAN is not set
407# CONFIG_PPP is not set
408# CONFIG_SLIP is not set
409# CONFIG_SHAPER is not set
410# CONFIG_NETCONSOLE is not set
411# CONFIG_NETPOLL is not set
412# CONFIG_NET_POLL_CONTROLLER is not set
413# CONFIG_RTC_CLASS is not set
414
415#
416# Input device support
417#
418# CONFIG_INPUT is not set
419
420#
421# Hardware I/O ports
422#
423CONFIG_SERIO=y
424# CONFIG_SERIO_I8042 is not set
425# CONFIG_SERIO_SERPORT is not set
426# CONFIG_SERIO_LIBPS2 is not set
427# CONFIG_SERIO_RAW is not set
428# CONFIG_GAMEPORT is not set
429
430#
431# Character devices
432#
433# CONFIG_VT is not set
434CONFIG_UNIX98_PTYS=y
435CONFIG_LEGACY_PTYS=y
436CONFIG_LEGACY_PTY_COUNT=256
437CONFIG_HW_RANDOM=y
438# CONFIG_RTC is not set
439# CONFIG_GEN_RTC is not set
440# CONFIG_R3964 is not set
441# CONFIG_RAW_DRIVER is not set
442
443#
444# File systems
445#
446# CONFIG_EXT2_FS is not set
447# CONFIG_EXT3_FS is not set
448# CONFIG_EXT4DEV_FS is not set
449# CONFIG_REISERFS_FS is not set
450# CONFIG_JFS_FS is not set
451# CONFIG_FS_POSIX_ACL is not set
452# CONFIG_XFS_FS is not set
453# CONFIG_GFS2_FS is not set
454# CONFIG_OCFS2_FS is not set
455# CONFIG_MINIX_FS is not set
456# CONFIG_ROMFS_FS is not set
457CONFIG_INOTIFY=y
458CONFIG_INOTIFY_USER=y
459# CONFIG_QUOTA is not set
460CONFIG_DNOTIFY=y
461# CONFIG_AUTOFS_FS is not set
462# CONFIG_AUTOFS4_FS is not set
463# CONFIG_FUSE_FS is not set
464
465#
466# CD-ROM/DVD Filesystems
467#
468# CONFIG_ISO9660_FS is not set
469# CONFIG_UDF_FS is not set
470
471#
472# DOS/FAT/NT Filesystems
473#
474# CONFIG_MSDOS_FS is not set
475# CONFIG_VFAT_FS is not set
476# CONFIG_NTFS_FS is not set
477
478#
479# Pseudo filesystems
480#
481CONFIG_PROC_FS=y
482CONFIG_PROC_KCORE=y
483CONFIG_PROC_SYSCTL=y
484CONFIG_SYSFS=y
485CONFIG_TMPFS=y
486# CONFIG_TMPFS_POSIX_ACL is not set
487# CONFIG_HUGETLB_PAGE is not set
488# CONFIG_CONFIGFS_FS is not set
489
490#
491# Miscellaneous filesystems
492#
493# CONFIG_ADFS_FS is not set
494# CONFIG_AFFS_FS is not set
495# CONFIG_HFS_FS is not set
496# CONFIG_HFSPLUS_FS is not set
497# CONFIG_BEFS_FS is not set
498# CONFIG_BFS_FS is not set
499# CONFIG_EFS_FS is not set
500CONFIG_JFFS2_FS=y
501CONFIG_JFFS2_FS_DEBUG=0
502CONFIG_JFFS2_FS_WRITEBUFFER=y
503# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
504# CONFIG_JFFS2_SUMMARY is not set
505# CONFIG_JFFS2_FS_XATTR is not set
506# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
507CONFIG_JFFS2_ZLIB=y
508# CONFIG_JFFS2_LZO is not set
509CONFIG_JFFS2_RTIME=y
510# CONFIG_JFFS2_RUBIN is not set
511CONFIG_CRAMFS=y
512# CONFIG_VXFS_FS is not set
513# CONFIG_HPFS_FS is not set
514# CONFIG_QNX4FS_FS is not set
515# CONFIG_SYSV_FS is not set
516# CONFIG_UFS_FS is not set
517CONFIG_NETWORK_FILESYSTEMS=y
518CONFIG_NFS_FS=y
519CONFIG_NFS_V3=y
520# CONFIG_NFS_V3_ACL is not set
521# CONFIG_NFS_V4 is not set
522# CONFIG_NFS_DIRECTIO is not set
523# CONFIG_NFSD is not set
524CONFIG_LOCKD=y
525CONFIG_LOCKD_V4=y
526CONFIG_NFS_COMMON=y
527CONFIG_SUNRPC=y
528# CONFIG_SUNRPC_BIND34 is not set
529# CONFIG_RPCSEC_GSS_KRB5 is not set
530# CONFIG_RPCSEC_GSS_SPKM3 is not set
531# CONFIG_SMB_FS is not set
532# CONFIG_CIFS is not set
533# CONFIG_NCP_FS is not set
534# CONFIG_CODA_FS is not set
535# CONFIG_AFS_FS is not set
536
537#
538# Partition Types
539#
540# CONFIG_PARTITION_ADVANCED is not set
541CONFIG_MSDOS_PARTITION=y
542# CONFIG_NLS is not set
543# CONFIG_DLM is not set
544
545#
546# Kernel hacking
547#
548# CONFIG_PROFILING is not set
549# CONFIG_SYSTEM_PROFILER is not set
550# CONFIG_PRINTK_TIME is not set
551CONFIG_ENABLE_WARN_DEPRECATED=y
552CONFIG_ENABLE_MUST_CHECK=y
553# CONFIG_MAGIC_SYSRQ is not set
554# CONFIG_UNUSED_SYMBOLS is not set
555# CONFIG_DEBUG_FS is not set
556# CONFIG_HEADERS_CHECK is not set
557# CONFIG_DEBUG_KERNEL is not set
558# CONFIG_SLUB_DEBUG_ON is not set
559# CONFIG_SAMPLES is not set
560
561#
562# Security options
563#
564# CONFIG_KEYS is not set
565# CONFIG_SECURITY is not set
566# CONFIG_SECURITY_FILE_CAPABILITIES is not set
567# CONFIG_CRYPTO is not set
568
569#
570# Library routines
571#
572CONFIG_BITREVERSE=y
573# CONFIG_CRC_CCITT is not set
574# CONFIG_CRC16 is not set
575# CONFIG_CRC_ITU_T is not set
576CONFIG_CRC32=y
577# CONFIG_CRC7 is not set
578# CONFIG_LIBCRC32C is not set
579CONFIG_ZLIB_INFLATE=y
580CONFIG_ZLIB_DEFLATE=y
581CONFIG_PLIST=y
582CONFIG_HAS_DMA=y
diff --git a/arch/cris/defconfig b/arch/cris/defconfig
index 9c33ae659934..59f36a58f842 100644
--- a/arch/cris/defconfig
+++ b/arch/cris/defconfig
@@ -1,52 +1,91 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11 3# Linux kernel version: 2.6.24-rc3
4# Mon Jun 20 13:42:02 2005 4# Mon Dec 3 11:34:27 2007
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_UID16=y 7CONFIG_ZONE_DMA=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_IOMAP=y 9CONFIG_GENERIC_IOMAP=y
10# CONFIG_ARCH_HAS_ILOG2_U32 is not set
11# CONFIG_ARCH_HAS_ILOG2_U64 is not set
12CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 14CONFIG_GENERIC_CALIBRATE_DELAY=y
15CONFIG_NO_IOPORT=y
16CONFIG_FORCE_MAX_ZONEORDER=6
11CONFIG_CRIS=y 17CONFIG_CRIS=y
18CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
12 19
13# 20#
14# Code maturity level options 21# General setup
15# 22#
16CONFIG_EXPERIMENTAL=y 23CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y 24CONFIG_BROKEN_ON_SMP=y
19 25CONFIG_INIT_ENV_ARG_LIMIT=32
20#
21# General setup
22#
23CONFIG_LOCALVERSION="" 26CONFIG_LOCALVERSION=""
27CONFIG_LOCALVERSION_AUTO=y
24# CONFIG_SWAP is not set 28# CONFIG_SWAP is not set
25# CONFIG_SYSVIPC is not set 29# CONFIG_SYSVIPC is not set
26# CONFIG_POSIX_MQUEUE is not set 30# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y 32# CONFIG_TASKSTATS is not set
33# CONFIG_USER_NS is not set
34# CONFIG_PID_NS is not set
29# CONFIG_AUDIT is not set 35# CONFIG_AUDIT is not set
30CONFIG_LOG_BUF_SHIFT=14
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set 36# CONFIG_IKCONFIG is not set
37CONFIG_LOG_BUF_SHIFT=14
38# CONFIG_CGROUPS is not set
39CONFIG_FAIR_GROUP_SCHED=y
40CONFIG_FAIR_USER_SCHED=y
41# CONFIG_FAIR_CGROUP_SCHED is not set
42CONFIG_SYSFS_DEPRECATED=y
43# CONFIG_RELAY is not set
44# CONFIG_BLK_DEV_INITRD is not set
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y
34CONFIG_EMBEDDED=y 47CONFIG_EMBEDDED=y
48CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y
35# CONFIG_KALLSYMS is not set 50# CONFIG_KALLSYMS is not set
51# CONFIG_HOTPLUG is not set
52CONFIG_PRINTK=y
53CONFIG_BUG=y
54CONFIG_ELF_CORE=y
55CONFIG_BASE_FULL=y
36CONFIG_FUTEX=y 56CONFIG_FUTEX=y
57CONFIG_ANON_INODES=y
37CONFIG_EPOLL=y 58CONFIG_EPOLL=y
38# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 59CONFIG_SIGNALFD=y
60CONFIG_EVENTFD=y
39CONFIG_SHMEM=y 61CONFIG_SHMEM=y
40CONFIG_CC_ALIGN_FUNCTIONS=0 62CONFIG_VM_EVENT_COUNTERS=y
41CONFIG_CC_ALIGN_LABELS=0 63CONFIG_SLUB_DEBUG=y
42CONFIG_CC_ALIGN_LOOPS=0 64# CONFIG_SLAB is not set
43CONFIG_CC_ALIGN_JUMPS=0 65CONFIG_SLUB=y
66# CONFIG_SLOB is not set
67CONFIG_RT_MUTEXES=y
44# CONFIG_TINY_SHMEM is not set 68# CONFIG_TINY_SHMEM is not set
69CONFIG_BASE_SMALL=0
70# CONFIG_MODULES is not set
71CONFIG_BLOCK=y
72# CONFIG_LBD is not set
73# CONFIG_BLK_DEV_IO_TRACE is not set
74# CONFIG_LSF is not set
75# CONFIG_BLK_DEV_BSG is not set
45 76
46# 77#
47# Loadable module support 78# IO Schedulers
48# 79#
49# CONFIG_MODULES is not set 80CONFIG_IOSCHED_NOOP=y
81# CONFIG_IOSCHED_AS is not set
82# CONFIG_IOSCHED_DEADLINE is not set
83CONFIG_IOSCHED_CFQ=y
84# CONFIG_DEFAULT_AS is not set
85# CONFIG_DEFAULT_DEADLINE is not set
86CONFIG_DEFAULT_CFQ=y
87# CONFIG_DEFAULT_NOOP is not set
88CONFIG_DEFAULT_IOSCHED="cfq"
50 89
51# 90#
52# General setup 91# General setup
@@ -54,12 +93,27 @@ CONFIG_CC_ALIGN_JUMPS=0
54CONFIG_BINFMT_ELF=y 93CONFIG_BINFMT_ELF=y
55# CONFIG_BINFMT_MISC is not set 94# CONFIG_BINFMT_MISC is not set
56CONFIG_GENERIC_HARDIRQS=y 95CONFIG_GENERIC_HARDIRQS=y
57# CONFIG_SMP is not set
58CONFIG_ETRAX_CMDLINE="root=/dev/mtdblock3 init=/linuxrc" 96CONFIG_ETRAX_CMDLINE="root=/dev/mtdblock3 init=/linuxrc"
59# CONFIG_ETRAX_WATCHDOG is not set 97# CONFIG_ETRAX_WATCHDOG is not set
60CONFIG_ETRAX_FAST_TIMER=y 98CONFIG_ETRAX_FAST_TIMER=y
61# CONFIG_PREEMPT is not set 99# CONFIG_ETRAX_KMALLOCED_MODULES is not set
62# CONFIG_OOM_REBOOT is not set 100# CONFIG_OOM_REBOOT is not set
101CONFIG_PREEMPT_NONE=y
102# CONFIG_PREEMPT_VOLUNTARY is not set
103# CONFIG_PREEMPT is not set
104CONFIG_SELECT_MEMORY_MODEL=y
105CONFIG_FLATMEM_MANUAL=y
106# CONFIG_DISCONTIGMEM_MANUAL is not set
107# CONFIG_SPARSEMEM_MANUAL is not set
108CONFIG_FLATMEM=y
109CONFIG_FLAT_NODE_MEM_MAP=y
110# CONFIG_SPARSEMEM_STATIC is not set
111# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
112CONFIG_SPLIT_PTLOCK_CPUS=4
113# CONFIG_RESOURCES_64BIT is not set
114CONFIG_ZONE_DMA_FLAG=1
115CONFIG_BOUNCE=y
116CONFIG_VIRT_TO_BUS=y
63 117
64# 118#
65# Hardware setup 119# Hardware setup
@@ -68,127 +122,180 @@ CONFIG_ETRAX_FAST_TIMER=y
68CONFIG_ETRAX100LX_V2=y 122CONFIG_ETRAX100LX_V2=y
69# CONFIG_SVINTO_SIM is not set 123# CONFIG_SVINTO_SIM is not set
70# CONFIG_ETRAXFS is not set 124# CONFIG_ETRAXFS is not set
71# CONFIG_ETRAXFS_SIM is not set 125# CONFIG_CRIS_MACH_ARTPEC3 is not set
126# CONFIG_ETRAX_VCS_SIM is not set
72CONFIG_ETRAX_ARCH_V10=y 127CONFIG_ETRAX_ARCH_V10=y
73# CONFIG_ETRAX_ARCH_V32 is not set 128# CONFIG_ETRAX_ARCH_V32 is not set
74CONFIG_ETRAX_DRAM_SIZE=32 129CONFIG_ETRAX_DRAM_SIZE=32
75CONFIG_ETRAX_FLASH_BUSWIDTH=2 130CONFIG_ETRAX_FLASH_BUSWIDTH=2
131CONFIG_ETRAX_NANDFLASH_BUSWIDTH=1
76CONFIG_ETRAX_FLASH1_SIZE=4 132CONFIG_ETRAX_FLASH1_SIZE=4
133# CONFIG_ETRAX_DEBUG_PORT0 is not set
134# CONFIG_ETRAX_DEBUG_PORT1 is not set
135# CONFIG_ETRAX_DEBUG_PORT2 is not set
136# CONFIG_ETRAX_DEBUG_PORT3 is not set
137CONFIG_ETRAX_DEBUG_PORT_NULL=y
138
139#
140# CRIS v10 options
141#
77CONFIG_ETRAX_DRAM_VIRTUAL_BASE=c0000000 142CONFIG_ETRAX_DRAM_VIRTUAL_BASE=c0000000
78CONFIG_ETRAX_PA_LEDS=y 143CONFIG_ETRAX_PA_LEDS=y
79# CONFIG_ETRAX_PB_LEDS is not set 144# CONFIG_ETRAX_PB_LEDS is not set
80# CONFIG_ETRAX_CSP0_LEDS is not set 145# CONFIG_ETRAX_CSP0_LEDS is not set
81# CONFIG_ETRAX_NO_LEDS is not set 146# CONFIG_ETRAX_NO_LEDS is not set
82CONFIG_ETRAX_LED1G=2 147CONFIG_ETRAX_LED1G=2
83CONFIG_ETRAX_LED1R=2 148CONFIG_ETRAX_LED1R=3
84CONFIG_ETRAX_LED2G=3 149CONFIG_ETRAX_LED2G=4
85CONFIG_ETRAX_LED2R=3 150CONFIG_ETRAX_LED2R=5
86CONFIG_ETRAX_LED3G=2 151CONFIG_ETRAX_LED3G=2
87CONFIG_ETRAX_LED3R=2 152CONFIG_ETRAX_LED3R=2
88CONFIG_ETRAX_DEBUG_PORT0=y
89# CONFIG_ETRAX_DEBUG_PORT1 is not set
90# CONFIG_ETRAX_DEBUG_PORT2 is not set
91# CONFIG_ETRAX_DEBUG_PORT3 is not set
92# CONFIG_ETRAX_DEBUG_PORT_NULL is not set
93CONFIG_ETRAX_RESCUE_SER0=y 153CONFIG_ETRAX_RESCUE_SER0=y
94# CONFIG_ETRAX_RESCUE_SER1 is not set 154# CONFIG_ETRAX_RESCUE_SER1 is not set
95# CONFIG_ETRAX_RESCUE_SER2 is not set 155# CONFIG_ETRAX_RESCUE_SER2 is not set
96# CONFIG_ETRAX_RESCUE_SER3 is not set 156# CONFIG_ETRAX_RESCUE_SER3 is not set
97CONFIG_ETRAX_DEF_R_WAITSTATES=0x95a6 157CONFIG_ETRAX_DEF_R_WAITSTATES=95a6
98CONFIG_ETRAX_DEF_R_BUS_CONFIG=0x4 158CONFIG_ETRAX_DEF_R_BUS_CONFIG=104
99CONFIG_ETRAX_SDRAM=y 159# CONFIG_ETRAX_SDRAM is not set
100CONFIG_ETRAX_DEF_R_SDRAM_CONFIG=0x09e05757 160CONFIG_ETRAX_DEF_R_DRAM_CONFIG=1a200040
101CONFIG_ETRAX_DEF_R_SDRAM_TIMING=0x80008002 161CONFIG_ETRAX_DEF_R_DRAM_TIMING=5611
102CONFIG_ETRAX_DEF_R_PORT_PA_DIR=0x1d 162CONFIG_ETRAX_DEF_R_PORT_PA_DIR=1c
103CONFIG_ETRAX_DEF_R_PORT_PA_DATA=0x00 163CONFIG_ETRAX_DEF_R_PORT_PA_DATA=00
104CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG=0x00 164CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG=00
105CONFIG_ETRAX_DEF_R_PORT_PB_DIR=0x1e 165CONFIG_ETRAX_DEF_R_PORT_PB_DIR=00
106CONFIG_ETRAX_DEF_R_PORT_PB_DATA=0xf3 166CONFIG_ETRAX_DEF_R_PORT_PB_DATA=ff
107# CONFIG_ETRAX_SOFT_SHUTDOWN is not set 167# CONFIG_ETRAX_SOFT_SHUTDOWN is not set
108 168
109# 169#
170# Networking
171#
172CONFIG_NET=y
173
174#
175# Networking options
176#
177CONFIG_PACKET=y
178# CONFIG_PACKET_MMAP is not set
179CONFIG_UNIX=y
180CONFIG_XFRM=y
181# CONFIG_XFRM_USER is not set
182# CONFIG_XFRM_SUB_POLICY is not set
183# CONFIG_XFRM_MIGRATE is not set
184# CONFIG_NET_KEY is not set
185CONFIG_INET=y
186# CONFIG_IP_MULTICAST is not set
187# CONFIG_IP_ADVANCED_ROUTER is not set
188CONFIG_IP_FIB_HASH=y
189# CONFIG_IP_PNP is not set
190# CONFIG_NET_IPIP is not set
191# CONFIG_NET_IPGRE is not set
192# CONFIG_ARPD is not set
193# CONFIG_SYN_COOKIES is not set
194# CONFIG_INET_AH is not set
195# CONFIG_INET_ESP is not set
196# CONFIG_INET_IPCOMP is not set
197# CONFIG_INET_XFRM_TUNNEL is not set
198# CONFIG_INET_TUNNEL is not set
199CONFIG_INET_XFRM_MODE_TRANSPORT=y
200CONFIG_INET_XFRM_MODE_TUNNEL=y
201CONFIG_INET_XFRM_MODE_BEET=y
202# CONFIG_INET_LRO is not set
203CONFIG_INET_DIAG=y
204CONFIG_INET_TCP_DIAG=y
205# CONFIG_TCP_CONG_ADVANCED is not set
206CONFIG_TCP_CONG_CUBIC=y
207CONFIG_DEFAULT_TCP_CONG="cubic"
208# CONFIG_TCP_MD5SIG is not set
209# CONFIG_IP_VS is not set
210# CONFIG_IPV6 is not set
211# CONFIG_INET6_XFRM_TUNNEL is not set
212# CONFIG_INET6_TUNNEL is not set
213# CONFIG_NETWORK_SECMARK is not set
214CONFIG_NETFILTER=y
215# CONFIG_NETFILTER_DEBUG is not set
216
217#
218# Core Netfilter Configuration
219#
220# CONFIG_NETFILTER_NETLINK is not set
221# CONFIG_NF_CONNTRACK_ENABLED is not set
222# CONFIG_NF_CONNTRACK is not set
223# CONFIG_NETFILTER_XTABLES is not set
224
225#
226# IP: Netfilter Configuration
227#
228# CONFIG_IP_NF_QUEUE is not set
229# CONFIG_IP_NF_IPTABLES is not set
230# CONFIG_IP_NF_ARPTABLES is not set
231# CONFIG_IP_DCCP is not set
232# CONFIG_IP_SCTP is not set
233# CONFIG_TIPC is not set
234# CONFIG_ATM is not set
235# CONFIG_BRIDGE is not set
236# CONFIG_VLAN_8021Q is not set
237# CONFIG_DECNET is not set
238# CONFIG_LLC2 is not set
239# CONFIG_IPX is not set
240# CONFIG_ATALK is not set
241# CONFIG_X25 is not set
242# CONFIG_LAPB is not set
243# CONFIG_ECONET is not set
244# CONFIG_WAN_ROUTER is not set
245# CONFIG_NET_SCHED is not set
246
247#
248# Network testing
249#
250# CONFIG_NET_PKTGEN is not set
251# CONFIG_HAMRADIO is not set
252# CONFIG_IRDA is not set
253# CONFIG_BT is not set
254# CONFIG_AF_RXRPC is not set
255
256#
257# Wireless
258#
259# CONFIG_CFG80211 is not set
260# CONFIG_WIRELESS_EXT is not set
261# CONFIG_MAC80211 is not set
262# CONFIG_IEEE80211 is not set
263# CONFIG_RFKILL is not set
264# CONFIG_NET_9P is not set
265
266#
110# Drivers for built-in interfaces 267# Drivers for built-in interfaces
111# 268#
112CONFIG_ETRAX_ETHERNET=y 269CONFIG_ETRAX_ETHERNET=y
113# CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK is not set
114CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY=y
115CONFIG_ETRAX_SERIAL=y 270CONFIG_ETRAX_SERIAL=y
116# CONFIG_ETRAX_SERIAL_FAST_TIMER is not set 271# CONFIG_ETRAX_SERIAL_FAST_TIMER is not set
117# CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST is not set 272# CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST is not set
118CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS=5 273CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS=5
119CONFIG_ETRAX_SERIAL_PORT0=y 274# CONFIG_ETRAX_SERIAL_PORT0 is not set
120# CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_OUT is not set
121CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT=y
122# CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_IN is not set
123CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN=y
124CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_NONE=y
125# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PA is not set
126# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PB is not set
127# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_MIXED is not set
128CONFIG_ETRAX_SER0_DTR_ON_PA_BIT=-1
129CONFIG_ETRAX_SER0_RI_ON_PA_BIT=-1
130CONFIG_ETRAX_SER0_DSR_ON_PA_BIT=-1
131CONFIG_ETRAX_SER0_CD_ON_PA_BIT=-1
132CONFIG_ETRAX_SER0_DTR_ON_PB_BIT=-1
133CONFIG_ETRAX_SER0_RI_ON_PB_BIT=-1
134CONFIG_ETRAX_SER0_DSR_ON_PB_BIT=-1
135CONFIG_ETRAX_SER0_CD_ON_PB_BIT=-1
136# CONFIG_ETRAX_SERIAL_PORT1 is not set 275# CONFIG_ETRAX_SERIAL_PORT1 is not set
137CONFIG_ETRAX_SERIAL_PORT2=y 276# CONFIG_ETRAX_SERIAL_PORT2 is not set
138# CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_OUT is not set
139CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT=y
140# CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_IN is not set
141CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN=y
142CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_NONE=y
143# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_PA is not set
144# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_PB is not set
145# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_MIXED is not set
146CONFIG_ETRAX_SER2_DTR_ON_PA_BIT=-1
147CONFIG_ETRAX_SER2_RI_ON_PA_BIT=-1
148CONFIG_ETRAX_SER2_DSR_ON_PA_BIT=-1
149CONFIG_ETRAX_SER2_CD_ON_PA_BIT=-1
150CONFIG_ETRAX_SER2_DTR_ON_PB_BIT=-1
151CONFIG_ETRAX_SER2_RI_ON_PB_BIT=-1
152CONFIG_ETRAX_SER2_DSR_ON_PB_BIT=-1
153CONFIG_ETRAX_SER2_CD_ON_PB_BIT=-1
154# CONFIG_ETRAX_SERIAL_PORT3 is not set 277# CONFIG_ETRAX_SERIAL_PORT3 is not set
155CONFIG_ETRAX_RS485=y 278# CONFIG_ETRAX_RS485 is not set
156# CONFIG_ETRAX_RS485_ON_PA is not set 279# CONFIG_ETRAX_IDE is not set
157# CONFIG_ETRAX_RS485_DISABLE_RECEIVER is not set 280# CONFIG_ETRAX_USB_HOST is not set
158CONFIG_ETRAX_IDE=y
159CONFIG_ETRAX_IDE_DELAY=15
160CONFIG_ETRAX_IDE_PB7_RESET=y
161# CONFIG_ETRAX_IDE_G27_RESET is not set
162CONFIG_ETRAX_USB_HOST=y
163CONFIG_ETRAX_USB_HOST_PORT1=y
164CONFIG_ETRAX_USB_HOST_PORT2=y
165CONFIG_ETRAX_AXISFLASHMAP=y 281CONFIG_ETRAX_AXISFLASHMAP=y
166CONFIG_ETRAX_PTABLE_SECTOR=65536 282CONFIG_ETRAX_PTABLE_SECTOR=65536
167# CONFIG_ETRAX_I2C is not set 283# CONFIG_ETRAX_I2C is not set
168# CONFIG_ETRAX_GPIO is not set 284# CONFIG_ETRAX_GPIO is not set
169CONFIG_ETRAX_RTC=y 285# CONFIG_ETRAX_RTC is not set
170CONFIG_ETRAX_DS1302=y 286# CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK is not set
171# CONFIG_ETRAX_PCF8563 is not set 287CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY=y
172CONFIG_ETRAX_DS1302_RST_ON_GENERIC_PORT=y
173CONFIG_ETRAX_DS1302_RSTBIT=0
174CONFIG_ETRAX_DS1302_SCLBIT=1
175CONFIG_ETRAX_DS1302_SDABIT=0
176CONFIG_ETRAX_DS1302_TRICKLE_CHARGE=0
177 288
178# 289#
179# Generic Driver Options 290# Generic Driver Options
180# 291#
181CONFIG_STANDALONE=y 292CONFIG_STANDALONE=y
182CONFIG_PREVENT_FIRMWARE_BUILD=y 293CONFIG_PREVENT_FIRMWARE_BUILD=y
183# CONFIG_FW_LOADER is not set 294# CONFIG_SYS_HYPERVISOR is not set
184
185#
186# Memory Technology Devices (MTD)
187#
188CONFIG_MTD=y 295CONFIG_MTD=y
189# CONFIG_MTD_DEBUG is not set 296# CONFIG_MTD_DEBUG is not set
190CONFIG_MTD_PARTITIONS=y
191CONFIG_MTD_CONCAT=y 297CONFIG_MTD_CONCAT=y
298CONFIG_MTD_PARTITIONS=y
192# CONFIG_MTD_REDBOOT_PARTS is not set 299# CONFIG_MTD_REDBOOT_PARTS is not set
193# CONFIG_MTD_CMDLINE_PARTS is not set 300# CONFIG_MTD_CMDLINE_PARTS is not set
194 301
@@ -196,16 +303,20 @@ CONFIG_MTD_CONCAT=y
196# User Modules And Translation Layers 303# User Modules And Translation Layers
197# 304#
198CONFIG_MTD_CHAR=y 305CONFIG_MTD_CHAR=y
306CONFIG_MTD_BLKDEVS=y
199CONFIG_MTD_BLOCK=y 307CONFIG_MTD_BLOCK=y
200# CONFIG_FTL is not set 308# CONFIG_FTL is not set
201# CONFIG_NFTL is not set 309# CONFIG_NFTL is not set
202# CONFIG_INFTL is not set 310# CONFIG_INFTL is not set
311# CONFIG_RFD_FTL is not set
312# CONFIG_SSFDC is not set
313# CONFIG_MTD_OOPS is not set
203 314
204# 315#
205# RAM/ROM/Flash chip drivers 316# RAM/ROM/Flash chip drivers
206# 317#
207CONFIG_MTD_CFI=y 318CONFIG_MTD_CFI=y
208# CONFIG_MTD_JEDECPROBE is not set 319CONFIG_MTD_JEDECPROBE=y
209CONFIG_MTD_GEN_PROBE=y 320CONFIG_MTD_GEN_PROBE=y
210# CONFIG_MTD_CFI_ADV_OPTIONS is not set 321# CONFIG_MTD_CFI_ADV_OPTIONS is not set
211CONFIG_MTD_MAP_BANK_WIDTH_1=y 322CONFIG_MTD_MAP_BANK_WIDTH_1=y
@@ -220,20 +331,18 @@ CONFIG_MTD_CFI_I2=y
220# CONFIG_MTD_CFI_I8 is not set 331# CONFIG_MTD_CFI_I8 is not set
221# CONFIG_MTD_CFI_INTELEXT is not set 332# CONFIG_MTD_CFI_INTELEXT is not set
222CONFIG_MTD_CFI_AMDSTD=y 333CONFIG_MTD_CFI_AMDSTD=y
223CONFIG_MTD_CFI_AMDSTD_RETRY=0
224# CONFIG_MTD_CFI_STAA is not set 334# CONFIG_MTD_CFI_STAA is not set
225CONFIG_MTD_CFI_UTIL=y 335CONFIG_MTD_CFI_UTIL=y
226CONFIG_MTD_RAM=y 336CONFIG_MTD_RAM=y
227# CONFIG_MTD_ROM is not set 337# CONFIG_MTD_ROM is not set
228# CONFIG_MTD_ABSENT is not set 338# CONFIG_MTD_ABSENT is not set
229# CONFIG_MTD_SHARP is not set
230# CONFIG_MTD_JEDEC is not set
231 339
232# 340#
233# Mapping drivers for chip access 341# Mapping drivers for chip access
234# 342#
235CONFIG_MTD_COMPLEX_MAPPINGS=y 343CONFIG_MTD_COMPLEX_MAPPINGS=y
236# CONFIG_MTD_PHYSMAP is not set 344# CONFIG_MTD_PHYSMAP is not set
345# CONFIG_MTD_PLATRAM is not set
237 346
238# 347#
239# Self-contained MTD device drivers 348# Self-contained MTD device drivers
@@ -244,7 +353,6 @@ CONFIG_MTD_MTDRAM=y
244CONFIG_MTDRAM_TOTAL_SIZE=0 353CONFIG_MTDRAM_TOTAL_SIZE=0
245CONFIG_MTDRAM_ERASE_SIZE=64 354CONFIG_MTDRAM_ERASE_SIZE=64
246CONFIG_MTDRAM_ABS_POS=0x0 355CONFIG_MTDRAM_ABS_POS=0x0
247# CONFIG_MTD_BLKMTD is not set
248# CONFIG_MTD_BLOCK2MTD is not set 356# CONFIG_MTD_BLOCK2MTD is not set
249 357
250# 358#
@@ -253,216 +361,54 @@ CONFIG_MTDRAM_ABS_POS=0x0
253# CONFIG_MTD_DOC2000 is not set 361# CONFIG_MTD_DOC2000 is not set
254# CONFIG_MTD_DOC2001 is not set 362# CONFIG_MTD_DOC2001 is not set
255# CONFIG_MTD_DOC2001PLUS is not set 363# CONFIG_MTD_DOC2001PLUS is not set
256
257#
258# NAND Flash Device Drivers
259#
260# CONFIG_MTD_NAND is not set 364# CONFIG_MTD_NAND is not set
365# CONFIG_MTD_ONENAND is not set
261 366
262# 367#
263# Parallel port support 368# UBI - Unsorted block images
264#
265# CONFIG_PARPORT is not set
266
267#
268# Plug and Play support
269# 369#
270 370# CONFIG_MTD_UBI is not set
271# 371CONFIG_BLK_DEV=y
272# Block devices
273#
274# CONFIG_BLK_DEV_FD is not set
275# CONFIG_BLK_DEV_COW_COMMON is not set 372# CONFIG_BLK_DEV_COW_COMMON is not set
276# CONFIG_BLK_DEV_LOOP is not set 373# CONFIG_BLK_DEV_LOOP is not set
277# CONFIG_BLK_DEV_CRYPTOLOOP is not set
278# CONFIG_BLK_DEV_NBD is not set 374# CONFIG_BLK_DEV_NBD is not set
279# CONFIG_BLK_DEV_UB is not set
280CONFIG_BLK_DEV_RAM=y 375CONFIG_BLK_DEV_RAM=y
281CONFIG_BLK_DEV_RAM_COUNT=16 376CONFIG_BLK_DEV_RAM_COUNT=16
282CONFIG_BLK_DEV_RAM_SIZE=4096 377CONFIG_BLK_DEV_RAM_SIZE=4096
283# CONFIG_BLK_DEV_INITRD is not set 378CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
284CONFIG_INITRAMFS_SOURCE=""
285# CONFIG_CDROM_PKTCDVD is not set 379# CONFIG_CDROM_PKTCDVD is not set
286
287#
288# IO Schedulers
289#
290CONFIG_IOSCHED_NOOP=y
291# CONFIG_IOSCHED_AS is not set
292# CONFIG_IOSCHED_DEADLINE is not set
293CONFIG_IOSCHED_CFQ=y
294# CONFIG_ATA_OVER_ETH is not set 380# CONFIG_ATA_OVER_ETH is not set
295
296#
297# Multi-device support (RAID and LVM)
298#
299# CONFIG_MD is not set
300
301#
302# ATA/ATAPI/MFM/RLL support
303#
304# CONFIG_IDE is not set
305# CONFIG_PARIDE is not set
306
307#
308# Please see Documentation/ide.txt for help/info on IDE drives
309#
310# CONFIG_BLK_DEV_IDE_SATA is not set
311# CONFIG_IDEDISK_MULTI_MODE is not set
312# CONFIG_BLK_DEV_IDETAPE is not set
313# CONFIG_BLK_DEV_IDEFLOPPY is not set
314# CONFIG_IDE_TASK_IOCTL is not set
315
316#
317# IDE chipset support/bugfixes
318#
319# CONFIG_IDE_GENERIC is not set
320# CONFIG_IDE_ARM is not set
321# CONFIG_IDEDMA_AUTO is not set
322# CONFIG_BLK_DEV_HD is not set
323
324#
325# SCSI device support
326#
327# CONFIG_SCSI is not set
328# CONFIG_ISCSI_TCP is not set
329
330#
331# IEEE 1394 (FireWire) support
332#
333
334#
335# I2O device support
336#
337
338#
339# Networking support
340#
341CONFIG_NET=y
342
343#
344# Networking options
345#
346CONFIG_PACKET=y
347# CONFIG_PACKET_MMAP is not set
348# CONFIG_NETLINK_DEV is not set
349CONFIG_UNIX=y
350# CONFIG_NET_KEY is not set
351CONFIG_INET=y
352# CONFIG_IP_MULTICAST is not set
353# CONFIG_IP_ADVANCED_ROUTER is not set
354# CONFIG_IP_PNP is not set
355# CONFIG_NET_IPIP is not set
356# CONFIG_NET_IPGRE is not set
357# CONFIG_ARPD is not set
358# CONFIG_SYN_COOKIES is not set
359# CONFIG_INET_AH is not set
360# CONFIG_INET_ESP is not set
361# CONFIG_INET_IPCOMP is not set
362# CONFIG_INET_TUNNEL is not set
363CONFIG_IP_TCPDIAG=y
364# CONFIG_IP_TCPDIAG_IPV6 is not set
365
366#
367# IP: Virtual Server Configuration
368#
369# CONFIG_IP_VS is not set
370# CONFIG_IPV6 is not set
371CONFIG_NETFILTER=y
372# CONFIG_NETFILTER_DEBUG is not set
373
374#
375# IP: Netfilter Configuration
376#
377# CONFIG_IP_NF_CONNTRACK is not set
378# CONFIG_IP_NF_CONNTRACK_MARK is not set
379# CONFIG_IP_NF_QUEUE is not set
380# CONFIG_IP_NF_IPTABLES is not set
381# CONFIG_IP_NF_ARPTABLES is not set
382
383#
384# SCTP Configuration (EXPERIMENTAL)
385#
386# CONFIG_IP_SCTP is not set
387# CONFIG_ATM is not set
388# CONFIG_BRIDGE is not set
389# CONFIG_VLAN_8021Q is not set
390# CONFIG_DECNET is not set
391# CONFIG_LLC2 is not set
392# CONFIG_IPX is not set
393# CONFIG_ATALK is not set
394# CONFIG_X25 is not set
395# CONFIG_LAPB is not set
396# CONFIG_NET_DIVERT is not set
397# CONFIG_ECONET is not set
398# CONFIG_WAN_ROUTER is not set
399
400#
401# QoS and/or fair queueing
402#
403# CONFIG_NET_SCHED is not set
404# CONFIG_NET_CLS_ROUTE is not set
405
406#
407# Network testing
408#
409# CONFIG_NET_PKTGEN is not set
410# CONFIG_NETPOLL is not set
411# CONFIG_NET_POLL_CONTROLLER is not set
412# CONFIG_HAMRADIO is not set
413# CONFIG_IRDA is not set
414# CONFIG_AF_RXRPC is not set
415# CONFIG_AF_RXRPC_DEBUG is not set
416# CONFIG_BT is not set
417# CONFIG_I2C is not set
418
419CONFIG_NETDEVICES=y 381CONFIG_NETDEVICES=y
382# CONFIG_NETDEVICES_MULTIQUEUE is not set
420# CONFIG_DUMMY is not set 383# CONFIG_DUMMY is not set
421# CONFIG_BONDING is not set 384# CONFIG_BONDING is not set
385# CONFIG_MACVLAN is not set
422# CONFIG_EQUALIZER is not set 386# CONFIG_EQUALIZER is not set
423# CONFIG_TUN is not set 387# CONFIG_TUN is not set
424 388# CONFIG_VETH is not set
425# 389# CONFIG_PHYLIB is not set
426# Ethernet (10 or 100Mbit)
427#
428CONFIG_NET_ETHERNET=y 390CONFIG_NET_ETHERNET=y
429# CONFIG_MII is not set 391CONFIG_MII=y
392# CONFIG_IBM_NEW_EMAC_ZMII is not set
393# CONFIG_IBM_NEW_EMAC_RGMII is not set
394# CONFIG_IBM_NEW_EMAC_TAH is not set
395# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
396CONFIG_NETDEV_1000=y
397CONFIG_NETDEV_10000=y
430 398
431# 399#
432# Ethernet (1000 Mbit) 400# Wireless LAN
433#
434
435#
436# Ethernet (10000 Mbit)
437#
438
439#
440# Token Ring devices
441#
442
443#
444# Wireless LAN (non-hamradio)
445#
446# CONFIG_NET_RADIO is not set
447
448#
449# Wan interfaces
450# 401#
402# CONFIG_WLAN_PRE80211 is not set
403# CONFIG_WLAN_80211 is not set
451# CONFIG_WAN is not set 404# CONFIG_WAN is not set
452# CONFIG_PPP is not set 405# CONFIG_PPP is not set
453# CONFIG_SLIP is not set 406# CONFIG_SLIP is not set
454# CONFIG_SHAPER is not set 407# CONFIG_SHAPER is not set
455# CONFIG_NETCONSOLE is not set 408# CONFIG_NETCONSOLE is not set
456 409# CONFIG_NETPOLL is not set
457# 410# CONFIG_NET_POLL_CONTROLLER is not set
458# ISDN subsystem 411# CONFIG_RTC_CLASS is not set
459#
460# CONFIG_ISDN is not set
461
462#
463# Telephony Support
464#
465# CONFIG_PHONE is not set
466 412
467# 413#
468# Input device support 414# Input device support
@@ -470,7 +416,7 @@ CONFIG_NET_ETHERNET=y
470# CONFIG_INPUT is not set 416# CONFIG_INPUT is not set
471 417
472# 418#
473# Input I/O drivers 419# Hardware I/O ports
474# 420#
475CONFIG_SERIO=y 421CONFIG_SERIO=y
476# CONFIG_SERIO_I8042 is not set 422# CONFIG_SERIO_I8042 is not set
@@ -480,94 +426,39 @@ CONFIG_SERIO=y
480# CONFIG_GAMEPORT is not set 426# CONFIG_GAMEPORT is not set
481 427
482# 428#
483# Input Device Drivers
484#
485CONFIG_INPUT_KEYBOARD=y
486CONFIG_KEYBOARD_ATKBD=y
487# CONFIG_KEYBOARD_SUNKBD is not set
488# CONFIG_KEYBOARD_LKKBD is not set
489# CONFIG_KEYBOARD_XTKBD is not set
490# CONFIG_KEYBOARD_NEWTON is not set
491CONFIG_INPUT_MOUSE=y
492CONFIG_MOUSE_PS2=y
493# CONFIG_MOUSE_SERIAL is not set
494# CONFIG_MOUSE_VSXXXAA is not set
495# CONFIG_INPUT_JOYSTICK is not set
496# CONFIG_INPUT_TABLET is not set
497# CONFIG_INPUT_TOUCHSCREEN is not set
498# CONFIG_INPUT_MISC is not set
499
500#
501# Character devices 429# Character devices
502# 430#
503# CONFIG_VT is not set 431# CONFIG_VT is not set
504# CONFIG_SERIAL_NONSTANDARD is not set
505
506#
507# Serial drivers
508#
509# CONFIG_SERIAL_8250 is not set
510
511#
512# Non-8250 serial port support
513#
514CONFIG_SERIAL_CORE=y
515CONFIG_SERIAL_CORE_CONSOLE=y
516CONFIG_UNIX98_PTYS=y 432CONFIG_UNIX98_PTYS=y
517CONFIG_LEGACY_PTYS=y 433CONFIG_LEGACY_PTYS=y
518CONFIG_LEGACY_PTY_COUNT=256 434CONFIG_LEGACY_PTY_COUNT=256
519 435CONFIG_HW_RANDOM=y
520#
521# IPMI
522#
523# CONFIG_IPMI_HANDLER is not set
524
525#
526# Watchdog Cards
527#
528# CONFIG_WATCHDOG is not set
529# CONFIG_RTC is not set 436# CONFIG_RTC is not set
530# CONFIG_GEN_RTC is not set 437# CONFIG_GEN_RTC is not set
531# CONFIG_DTLK is not set
532# CONFIG_R3964 is not set 438# CONFIG_R3964 is not set
533# CONFIG_RTC_LIB is not set
534# CONFIG_RTC_CLASS is not set
535
536#
537# Ftape, the floppy tape device driver
538#
539# CONFIG_DRM is not set
540# CONFIG_RAW_DRIVER is not set 439# CONFIG_RAW_DRIVER is not set
541 440
542# 441#
543# Multimedia devices
544#
545# CONFIG_VIDEO_DEV is not set
546
547#
548# Digital Video Broadcasting Devices
549#
550# CONFIG_DVB is not set
551
552#
553# File systems 442# File systems
554# 443#
555# CONFIG_EXT2_FS is not set 444# CONFIG_EXT2_FS is not set
556# CONFIG_EXT3_FS is not set 445# CONFIG_EXT3_FS is not set
557# CONFIG_JBD is not set 446# CONFIG_EXT4DEV_FS is not set
558# CONFIG_REISERFS_FS is not set 447# CONFIG_REISERFS_FS is not set
559# CONFIG_JFS_FS is not set 448# CONFIG_JFS_FS is not set
560 449# CONFIG_FS_POSIX_ACL is not set
561#
562# XFS support
563#
564# CONFIG_XFS_FS is not set 450# CONFIG_XFS_FS is not set
451# CONFIG_GFS2_FS is not set
452# CONFIG_OCFS2_FS is not set
565# CONFIG_MINIX_FS is not set 453# CONFIG_MINIX_FS is not set
566# CONFIG_ROMFS_FS is not set 454# CONFIG_ROMFS_FS is not set
455CONFIG_INOTIFY=y
456CONFIG_INOTIFY_USER=y
567# CONFIG_QUOTA is not set 457# CONFIG_QUOTA is not set
568CONFIG_DNOTIFY=y 458CONFIG_DNOTIFY=y
569# CONFIG_AUTOFS_FS is not set 459# CONFIG_AUTOFS_FS is not set
570# CONFIG_AUTOFS4_FS is not set 460# CONFIG_AUTOFS4_FS is not set
461# CONFIG_FUSE_FS is not set
571 462
572# 463#
573# CD-ROM/DVD Filesystems 464# CD-ROM/DVD Filesystems
@@ -587,13 +478,12 @@ CONFIG_DNOTIFY=y
587# 478#
588CONFIG_PROC_FS=y 479CONFIG_PROC_FS=y
589CONFIG_PROC_KCORE=y 480CONFIG_PROC_KCORE=y
481CONFIG_PROC_SYSCTL=y
590CONFIG_SYSFS=y 482CONFIG_SYSFS=y
591# CONFIG_DEVFS_FS is not set
592# CONFIG_DEVPTS_FS_XATTR is not set
593CONFIG_TMPFS=y 483CONFIG_TMPFS=y
594# CONFIG_TMPFS_XATTR is not set 484# CONFIG_TMPFS_POSIX_ACL is not set
595# CONFIG_HUGETLB_PAGE is not set 485# CONFIG_HUGETLB_PAGE is not set
596CONFIG_RAMFS=y 486# CONFIG_CONFIGFS_FS is not set
597 487
598# 488#
599# Miscellaneous filesystems 489# Miscellaneous filesystems
@@ -605,15 +495,15 @@ CONFIG_RAMFS=y
605# CONFIG_BEFS_FS is not set 495# CONFIG_BEFS_FS is not set
606# CONFIG_BFS_FS is not set 496# CONFIG_BFS_FS is not set
607# CONFIG_EFS_FS is not set 497# CONFIG_EFS_FS is not set
608CONFIG_JFFS_FS=y
609CONFIG_JFFS_FS_VERBOSE=0
610# CONFIG_JFFS_PROC_FS is not set
611CONFIG_JFFS2_FS=y 498CONFIG_JFFS2_FS=y
612CONFIG_JFFS2_FS_DEBUG=0 499CONFIG_JFFS2_FS_DEBUG=0
613# CONFIG_JFFS2_FS_NAND is not set 500CONFIG_JFFS2_FS_WRITEBUFFER=y
614# CONFIG_JFFS2_FS_NOR_ECC is not set 501# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
502# CONFIG_JFFS2_SUMMARY is not set
503# CONFIG_JFFS2_FS_XATTR is not set
615# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 504# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
616CONFIG_JFFS2_ZLIB=y 505CONFIG_JFFS2_ZLIB=y
506# CONFIG_JFFS2_LZO is not set
617CONFIG_JFFS2_RTIME=y 507CONFIG_JFFS2_RTIME=y
618# CONFIG_JFFS2_RUBIN is not set 508# CONFIG_JFFS2_RUBIN is not set
619CONFIG_CRAMFS=y 509CONFIG_CRAMFS=y
@@ -622,12 +512,10 @@ CONFIG_CRAMFS=y
622# CONFIG_QNX4FS_FS is not set 512# CONFIG_QNX4FS_FS is not set
623# CONFIG_SYSV_FS is not set 513# CONFIG_SYSV_FS is not set
624# CONFIG_UFS_FS is not set 514# CONFIG_UFS_FS is not set
625 515CONFIG_NETWORK_FILESYSTEMS=y
626#
627# Network File Systems
628#
629CONFIG_NFS_FS=y 516CONFIG_NFS_FS=y
630CONFIG_NFS_V3=y 517CONFIG_NFS_V3=y
518# CONFIG_NFS_V3_ACL is not set
631# CONFIG_NFS_V4 is not set 519# CONFIG_NFS_V4 is not set
632# CONFIG_NFS_DIRECTIO is not set 520# CONFIG_NFS_DIRECTIO is not set
633# CONFIG_NFSD is not set 521# CONFIG_NFSD is not set
@@ -649,181 +537,44 @@ CONFIG_SUNRPC=y
649# 537#
650# CONFIG_PARTITION_ADVANCED is not set 538# CONFIG_PARTITION_ADVANCED is not set
651CONFIG_MSDOS_PARTITION=y 539CONFIG_MSDOS_PARTITION=y
652
653#
654# Native Language Support
655#
656# CONFIG_NLS is not set 540# CONFIG_NLS is not set
657 541# CONFIG_DLM is not set
658#
659# Sound
660#
661# CONFIG_SOUND is not set
662
663#
664# Generic devices
665#
666# CONFIG_SND_MPU401_UART is not set
667# CONFIG_SND_DUMMY is not set
668# CONFIG_SND_VIRMIDI is not set
669# CONFIG_SND_MTPAV is not set
670# CONFIG_SND_SERIAL_U16550 is not set
671# CONFIG_SND_MPU401 is not set
672
673#
674# PCCARD (PCMCIA/CardBus) support
675#
676# CONFIG_PCCARD is not set
677# CONFIG_PARPORT_PC_PCMCIA is not set
678# CONFIG_NET_PCMCIA is not set
679
680#
681# PC-card bridges
682#
683
684#
685# USB support
686#
687CONFIG_USB=y
688# CONFIG_USB_DEBUG is not set
689
690#
691# Miscellaneous USB options
692#
693CONFIG_USB_DEVICEFS=y
694# CONFIG_USB_BANDWIDTH is not set
695# CONFIG_USB_DYNAMIC_MINORS is not set
696# CONFIG_USB_OTG is not set
697# CONFIG_USB_ARCH_HAS_HCD is not set
698# CONFIG_USB_ARCH_HAS_OHCI is not set
699
700#
701# USB Host Controller Drivers
702#
703# CONFIG_USB_SL811_HCD is not set
704
705#
706# USB Device Class drivers
707#
708
709#
710# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
711#
712# CONFIG_USB_ACM is not set
713# CONFIG_USB_PRINTER is not set
714
715#
716# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
717#
718# CONFIG_USB_STORAGE is not set
719
720#
721# USB Input Devices
722#
723# CONFIG_USB_HID is not set
724# HID_SUPPORT is not set
725
726#
727# USB HID Boot Protocol drivers
728#
729# CONFIG_USB_KBD is not set
730# CONFIG_USB_MOUSE is not set
731# CONFIG_USB_AIPTEK is not set
732# CONFIG_USB_WACOM is not set
733# CONFIG_USB_KBTAB is not set
734# CONFIG_USB_POWERMATE is not set
735# CONFIG_USB_MTOUCH is not set
736# CONFIG_USB_EGALAX is not set
737# CONFIG_USB_XPAD is not set
738# CONFIG_USB_ATI_REMOTE is not set
739
740#
741# USB Imaging devices
742#
743# CONFIG_USB_MDC800 is not set
744
745#
746# USB Multimedia devices
747#
748# CONFIG_USB_DABUSB is not set
749
750#
751# Video4Linux support is needed for USB Multimedia device support
752#
753
754#
755# USB Network Adapters
756#
757# CONFIG_USB_CATC is not set
758# CONFIG_USB_KAWETH is not set
759# CONFIG_USB_PEGASUS is not set
760CONFIG_USB_RTL8150=y
761# CONFIG_USB_USBNET is not set
762
763#
764# USB port drivers
765#
766
767#
768# USB Serial Converter support
769#
770# CONFIG_USB_SERIAL is not set
771
772#
773# USB Miscellaneous drivers
774#
775# CONFIG_USB_EMI62 is not set
776# CONFIG_USB_EMI26 is not set
777# CONFIG_USB_AUERSWALD is not set
778# CONFIG_USB_RIO500 is not set
779# CONFIG_USB_LEGOTOWER is not set
780# CONFIG_USB_LCD is not set
781# CONFIG_USB_LED is not set
782# CONFIG_USB_CYTHERM is not set
783# CONFIG_USB_PHIDGETKIT is not set
784# CONFIG_USB_PHIDGETSERVO is not set
785# CONFIG_USB_IDMOUSE is not set
786# CONFIG_USB_TEST is not set
787
788#
789# USB ATM/DSL drivers
790#
791
792#
793# USB Gadget Support
794#
795# CONFIG_USB_GADGET is not set
796 542
797# 543#
798# Kernel hacking 544# Kernel hacking
799# 545#
800# CONFIG_PROFILING is not set 546# CONFIG_PROFILING is not set
801# CONFIG_SYSTEM_PROFILER is not set 547# CONFIG_SYSTEM_PROFILER is not set
802# CONFIG_ETRAX_KGDB is not set 548# CONFIG_PRINTK_TIME is not set
803# CONFIG_DEBUG_INFO is not set 549CONFIG_ENABLE_WARN_DEPRECATED=y
804# CONFIG_FRAME_POINTER is not set 550CONFIG_ENABLE_MUST_CHECK=y
805# CONFIG_DEBUG_NMI_OOPS is not set 551# CONFIG_MAGIC_SYSRQ is not set
552# CONFIG_UNUSED_SYMBOLS is not set
553# CONFIG_DEBUG_FS is not set
554# CONFIG_HEADERS_CHECK is not set
555# CONFIG_DEBUG_KERNEL is not set
556# CONFIG_SLUB_DEBUG_ON is not set
557# CONFIG_SAMPLES is not set
806 558
807# 559#
808# Security options 560# Security options
809# 561#
810# CONFIG_KEYS is not set 562# CONFIG_KEYS is not set
811# CONFIG_SECURITY is not set 563# CONFIG_SECURITY is not set
812 564# CONFIG_SECURITY_FILE_CAPABILITIES is not set
813#
814# Cryptographic options
815#
816# CONFIG_CRYPTO is not set 565# CONFIG_CRYPTO is not set
817 566
818# 567#
819# Hardware crypto devices
820# CONFIG_CRYPTO_HW is not set
821
822#
823# Library routines 568# Library routines
824# 569#
570CONFIG_BITREVERSE=y
825# CONFIG_CRC_CCITT is not set 571# CONFIG_CRC_CCITT is not set
572# CONFIG_CRC16 is not set
573# CONFIG_CRC_ITU_T is not set
826CONFIG_CRC32=y 574CONFIG_CRC32=y
575# CONFIG_CRC7 is not set
827# CONFIG_LIBCRC32C is not set 576# CONFIG_LIBCRC32C is not set
828CONFIG_ZLIB_INFLATE=y 577CONFIG_ZLIB_INFLATE=y
829CONFIG_ZLIB_DEFLATE=y 578CONFIG_ZLIB_DEFLATE=y
579CONFIG_PLIST=y
580CONFIG_HAS_DMA=y
diff --git a/arch/cris/etraxfs_defconfig b/arch/cris/etraxfs_defconfig
new file mode 100644
index 000000000000..73c646a37255
--- /dev/null
+++ b/arch/cris/etraxfs_defconfig
@@ -0,0 +1,585 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24-rc3
4# Fri Nov 30 14:24:26 2007
5#
6CONFIG_MMU=y
7CONFIG_ZONE_DMA=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_IOMAP=y
10# CONFIG_ARCH_HAS_ILOG2_U32 is not set
11# CONFIG_ARCH_HAS_ILOG2_U64 is not set
12CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_CALIBRATE_DELAY=y
15CONFIG_NO_IOPORT=y
16CONFIG_FORCE_MAX_ZONEORDER=6
17CONFIG_CRIS=y
18CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
19
20#
21# General setup
22#
23CONFIG_EXPERIMENTAL=y
24CONFIG_BROKEN_ON_SMP=y
25CONFIG_INIT_ENV_ARG_LIMIT=32
26CONFIG_LOCALVERSION=""
27CONFIG_LOCALVERSION_AUTO=y
28# CONFIG_SWAP is not set
29# CONFIG_SYSVIPC is not set
30# CONFIG_POSIX_MQUEUE is not set
31# CONFIG_BSD_PROCESS_ACCT is not set
32# CONFIG_TASKSTATS is not set
33# CONFIG_USER_NS is not set
34# CONFIG_PID_NS is not set
35# CONFIG_AUDIT is not set
36# CONFIG_IKCONFIG is not set
37CONFIG_LOG_BUF_SHIFT=14
38# CONFIG_CGROUPS is not set
39CONFIG_FAIR_GROUP_SCHED=y
40CONFIG_FAIR_USER_SCHED=y
41# CONFIG_FAIR_CGROUP_SCHED is not set
42CONFIG_SYSFS_DEPRECATED=y
43# CONFIG_RELAY is not set
44# CONFIG_BLK_DEV_INITRD is not set
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y
47CONFIG_EMBEDDED=y
48CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y
50# CONFIG_KALLSYMS is not set
51# CONFIG_HOTPLUG is not set
52CONFIG_PRINTK=y
53CONFIG_BUG=y
54CONFIG_ELF_CORE=y
55CONFIG_BASE_FULL=y
56CONFIG_FUTEX=y
57CONFIG_ANON_INODES=y
58CONFIG_EPOLL=y
59CONFIG_SIGNALFD=y
60CONFIG_EVENTFD=y
61CONFIG_SHMEM=y
62CONFIG_VM_EVENT_COUNTERS=y
63CONFIG_SLUB_DEBUG=y
64# CONFIG_SLAB is not set
65CONFIG_SLUB=y
66# CONFIG_SLOB is not set
67CONFIG_RT_MUTEXES=y
68# CONFIG_TINY_SHMEM is not set
69CONFIG_BASE_SMALL=0
70# CONFIG_MODULES is not set
71CONFIG_BLOCK=y
72# CONFIG_LBD is not set
73# CONFIG_BLK_DEV_IO_TRACE is not set
74# CONFIG_LSF is not set
75# CONFIG_BLK_DEV_BSG is not set
76
77#
78# IO Schedulers
79#
80CONFIG_IOSCHED_NOOP=y
81# CONFIG_IOSCHED_AS is not set
82# CONFIG_IOSCHED_DEADLINE is not set
83CONFIG_IOSCHED_CFQ=y
84# CONFIG_DEFAULT_AS is not set
85# CONFIG_DEFAULT_DEADLINE is not set
86CONFIG_DEFAULT_CFQ=y
87# CONFIG_DEFAULT_NOOP is not set
88CONFIG_DEFAULT_IOSCHED="cfq"
89
90#
91# General setup
92#
93CONFIG_BINFMT_ELF=y
94# CONFIG_BINFMT_MISC is not set
95CONFIG_GENERIC_HARDIRQS=y
96CONFIG_ETRAX_CMDLINE="root=/dev/mtdblock3 init=/linuxrc"
97# CONFIG_ETRAX_WATCHDOG is not set
98CONFIG_ETRAX_FAST_TIMER=y
99# CONFIG_ETRAX_KMALLOCED_MODULES is not set
100# CONFIG_OOM_REBOOT is not set
101CONFIG_PREEMPT_NONE=y
102# CONFIG_PREEMPT_VOLUNTARY is not set
103# CONFIG_PREEMPT is not set
104CONFIG_SELECT_MEMORY_MODEL=y
105CONFIG_FLATMEM_MANUAL=y
106# CONFIG_DISCONTIGMEM_MANUAL is not set
107# CONFIG_SPARSEMEM_MANUAL is not set
108CONFIG_FLATMEM=y
109CONFIG_FLAT_NODE_MEM_MAP=y
110# CONFIG_SPARSEMEM_STATIC is not set
111# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
112CONFIG_SPLIT_PTLOCK_CPUS=4
113# CONFIG_RESOURCES_64BIT is not set
114CONFIG_ZONE_DMA_FLAG=1
115CONFIG_BOUNCE=y
116CONFIG_VIRT_TO_BUS=y
117
118#
119# Hardware setup
120#
121# CONFIG_ETRAX100LX is not set
122# CONFIG_ETRAX100LX_V2 is not set
123# CONFIG_SVINTO_SIM is not set
124CONFIG_ETRAXFS=y
125# CONFIG_CRIS_MACH_ARTPEC3 is not set
126# CONFIG_ETRAX_VCS_SIM is not set
127# CONFIG_ETRAX_ARCH_V10 is not set
128CONFIG_ETRAX_ARCH_V32=y
129CONFIG_ETRAX_DRAM_SIZE=32
130CONFIG_ETRAX_FLASH_BUSWIDTH=2
131CONFIG_ETRAX_NANDFLASH_BUSWIDTH=1
132CONFIG_ETRAX_FLASH1_SIZE=4
133CONFIG_ETRAX_DEBUG_PORT0=y
134# CONFIG_ETRAX_DEBUG_PORT1 is not set
135# CONFIG_ETRAX_DEBUG_PORT2 is not set
136# CONFIG_ETRAX_DEBUG_PORT3 is not set
137# CONFIG_ETRAX_DEBUG_PORT_NULL is not set
138CONFIG_ETRAX_DRAM_VIRTUAL_BASE=c0000000
139
140#
141# ETRAX FS options
142#
143CONFIG_ETRAX_SERIAL_PORTS=4
144CONFIG_ETRAX_MEM_GRP1_CONFIG=4044a
145CONFIG_ETRAX_MEM_GRP2_CONFIG=0
146CONFIG_ETRAX_MEM_GRP3_CONFIG=0
147CONFIG_ETRAX_MEM_GRP4_CONFIG=0
148CONFIG_ETRAX_SDRAM_GRP0_CONFIG=336
149CONFIG_ETRAX_SDRAM_GRP1_CONFIG=0
150CONFIG_ETRAX_SDRAM_TIMING=104a
151CONFIG_ETRAX_SDRAM_COMMAND=0
152CONFIG_ETRAX_DEF_GIO_PA_OE=1c
153CONFIG_ETRAX_DEF_GIO_PA_OUT=00
154CONFIG_ETRAX_DEF_GIO_PB_OE=00000
155CONFIG_ETRAX_DEF_GIO_PB_OUT=00000
156CONFIG_ETRAX_DEF_GIO_PC_OE=00000
157CONFIG_ETRAX_DEF_GIO_PC_OUT=00000
158CONFIG_ETRAX_DEF_GIO_PD_OE=00000
159CONFIG_ETRAX_DEF_GIO_PD_OUT=00000
160CONFIG_ETRAX_DEF_GIO_PE_OE=00000
161CONFIG_ETRAX_DEF_GIO_PE_OUT=00000
162# CONFIG_CPU_FREQ is not set
163# CONFIG_ETRAX_NBR_LED_GRP_ZERO is not set
164CONFIG_ETRAX_NBR_LED_GRP_ONE=y
165# CONFIG_ETRAX_NBR_LED_GRP_TWO is not set
166CONFIG_ETRAX_LED_G_NET0="PA3"
167CONFIG_ETRAX_LED_R_NET0="PA4"
168CONFIG_ETRAX_V32_LED2G="PA5"
169CONFIG_ETRAX_V32_LED2R="PA6"
170CONFIG_ETRAX_V32_LED3G="PA7"
171CONFIG_ETRAX_V32_LED3R="PA7"
172
173#
174# Networking
175#
176CONFIG_NET=y
177
178#
179# Networking options
180#
181CONFIG_PACKET=y
182# CONFIG_PACKET_MMAP is not set
183CONFIG_UNIX=y
184CONFIG_XFRM=y
185# CONFIG_XFRM_USER is not set
186# CONFIG_XFRM_SUB_POLICY is not set
187# CONFIG_XFRM_MIGRATE is not set
188# CONFIG_NET_KEY is not set
189CONFIG_INET=y
190# CONFIG_IP_MULTICAST is not set
191# CONFIG_IP_ADVANCED_ROUTER is not set
192CONFIG_IP_FIB_HASH=y
193# CONFIG_IP_PNP is not set
194# CONFIG_NET_IPIP is not set
195# CONFIG_NET_IPGRE is not set
196# CONFIG_ARPD is not set
197# CONFIG_SYN_COOKIES is not set
198# CONFIG_INET_AH is not set
199# CONFIG_INET_ESP is not set
200# CONFIG_INET_IPCOMP is not set
201# CONFIG_INET_XFRM_TUNNEL is not set
202# CONFIG_INET_TUNNEL is not set
203CONFIG_INET_XFRM_MODE_TRANSPORT=y
204CONFIG_INET_XFRM_MODE_TUNNEL=y
205CONFIG_INET_XFRM_MODE_BEET=y
206# CONFIG_INET_LRO is not set
207CONFIG_INET_DIAG=y
208CONFIG_INET_TCP_DIAG=y
209# CONFIG_TCP_CONG_ADVANCED is not set
210CONFIG_TCP_CONG_CUBIC=y
211CONFIG_DEFAULT_TCP_CONG="cubic"
212# CONFIG_TCP_MD5SIG is not set
213# CONFIG_IP_VS is not set
214# CONFIG_IPV6 is not set
215# CONFIG_INET6_XFRM_TUNNEL is not set
216# CONFIG_INET6_TUNNEL is not set
217# CONFIG_NETWORK_SECMARK is not set
218CONFIG_NETFILTER=y
219# CONFIG_NETFILTER_DEBUG is not set
220
221#
222# Core Netfilter Configuration
223#
224# CONFIG_NETFILTER_NETLINK is not set
225# CONFIG_NF_CONNTRACK_ENABLED is not set
226# CONFIG_NF_CONNTRACK is not set
227# CONFIG_NETFILTER_XTABLES is not set
228
229#
230# IP: Netfilter Configuration
231#
232# CONFIG_IP_NF_QUEUE is not set
233# CONFIG_IP_NF_IPTABLES is not set
234# CONFIG_IP_NF_ARPTABLES is not set
235# CONFIG_IP_DCCP is not set
236# CONFIG_IP_SCTP is not set
237# CONFIG_TIPC is not set
238# CONFIG_ATM is not set
239# CONFIG_BRIDGE is not set
240# CONFIG_VLAN_8021Q is not set
241# CONFIG_DECNET is not set
242# CONFIG_LLC2 is not set
243# CONFIG_IPX is not set
244# CONFIG_ATALK is not set
245# CONFIG_X25 is not set
246# CONFIG_LAPB is not set
247# CONFIG_ECONET is not set
248# CONFIG_WAN_ROUTER is not set
249# CONFIG_NET_SCHED is not set
250
251#
252# Network testing
253#
254# CONFIG_NET_PKTGEN is not set
255# CONFIG_HAMRADIO is not set
256# CONFIG_IRDA is not set
257# CONFIG_BT is not set
258# CONFIG_AF_RXRPC is not set
259
260#
261# Wireless
262#
263# CONFIG_CFG80211 is not set
264# CONFIG_WIRELESS_EXT is not set
265# CONFIG_MAC80211 is not set
266# CONFIG_IEEE80211 is not set
267# CONFIG_RFKILL is not set
268# CONFIG_NET_9P is not set
269
270#
271# Drivers for built-in interfaces
272#
273CONFIG_ETRAX_ETHERNET=y
274# CONFIG_ETRAX_IDE is not set
275CONFIG_ETRAX_AXISFLASHMAP=y
276CONFIG_ETRAX_PTABLE_SECTOR=65536
277# CONFIG_ETRAX_I2C is not set
278# CONFIG_ETRAX_GPIO is not set
279# CONFIG_ETRAX_NO_PHY is not set
280# CONFIG_ETRAX_ETHERNET_IFACE0 is not set
281# CONFIG_ETRAX_ETHERNET_IFACE1 is not set
282# CONFIG_ETRAXFS_SERIAL is not set
283# CONFIG_ETRAX_SYNCHRONOUS_SERIAL is not set
284# CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE is not set
285# CONFIG_ETRAX_NANDFLASH is not set
286# CONFIG_ETRAX_CARDBUS is not set
287# CONFIG_ETRAX_IOP_FW_LOAD is not set
288# CONFIG_ETRAX_STREAMCOPROC is not set
289# CONFIG_ETRAX_SPI_MMC is not set
290# CONFIG_ETRAX_SPI_MMC_BOARD is not set
291# CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK is not set
292CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY=y
293
294#
295# Generic Driver Options
296#
297CONFIG_STANDALONE=y
298CONFIG_PREVENT_FIRMWARE_BUILD=y
299# CONFIG_SYS_HYPERVISOR is not set
300CONFIG_MTD=y
301# CONFIG_MTD_DEBUG is not set
302CONFIG_MTD_CONCAT=y
303CONFIG_MTD_PARTITIONS=y
304# CONFIG_MTD_REDBOOT_PARTS is not set
305# CONFIG_MTD_CMDLINE_PARTS is not set
306
307#
308# User Modules And Translation Layers
309#
310CONFIG_MTD_CHAR=y
311CONFIG_MTD_BLKDEVS=y
312CONFIG_MTD_BLOCK=y
313# CONFIG_FTL is not set
314# CONFIG_NFTL is not set
315# CONFIG_INFTL is not set
316# CONFIG_RFD_FTL is not set
317# CONFIG_SSFDC is not set
318# CONFIG_MTD_OOPS is not set
319
320#
321# RAM/ROM/Flash chip drivers
322#
323CONFIG_MTD_CFI=y
324CONFIG_MTD_JEDECPROBE=y
325CONFIG_MTD_GEN_PROBE=y
326# CONFIG_MTD_CFI_ADV_OPTIONS is not set
327CONFIG_MTD_MAP_BANK_WIDTH_1=y
328CONFIG_MTD_MAP_BANK_WIDTH_2=y
329CONFIG_MTD_MAP_BANK_WIDTH_4=y
330# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
331# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
332# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
333CONFIG_MTD_CFI_I1=y
334CONFIG_MTD_CFI_I2=y
335# CONFIG_MTD_CFI_I4 is not set
336# CONFIG_MTD_CFI_I8 is not set
337# CONFIG_MTD_CFI_INTELEXT is not set
338CONFIG_MTD_CFI_AMDSTD=y
339# CONFIG_MTD_CFI_STAA is not set
340CONFIG_MTD_CFI_UTIL=y
341CONFIG_MTD_RAM=y
342# CONFIG_MTD_ROM is not set
343# CONFIG_MTD_ABSENT is not set
344
345#
346# Mapping drivers for chip access
347#
348CONFIG_MTD_COMPLEX_MAPPINGS=y
349# CONFIG_MTD_PHYSMAP is not set
350# CONFIG_MTD_PLATRAM is not set
351
352#
353# Self-contained MTD device drivers
354#
355# CONFIG_MTD_SLRAM is not set
356# CONFIG_MTD_PHRAM is not set
357CONFIG_MTD_MTDRAM=y
358CONFIG_MTDRAM_TOTAL_SIZE=0
359CONFIG_MTDRAM_ERASE_SIZE=64
360CONFIG_MTDRAM_ABS_POS=0x0
361# CONFIG_MTD_BLOCK2MTD is not set
362
363#
364# Disk-On-Chip Device Drivers
365#
366# CONFIG_MTD_DOC2000 is not set
367# CONFIG_MTD_DOC2001 is not set
368# CONFIG_MTD_DOC2001PLUS is not set
369# CONFIG_MTD_NAND is not set
370# CONFIG_MTD_ONENAND is not set
371
372#
373# UBI - Unsorted block images
374#
375# CONFIG_MTD_UBI is not set
376CONFIG_BLK_DEV=y
377# CONFIG_BLK_DEV_COW_COMMON is not set
378# CONFIG_BLK_DEV_LOOP is not set
379# CONFIG_BLK_DEV_NBD is not set
380CONFIG_BLK_DEV_RAM=y
381CONFIG_BLK_DEV_RAM_COUNT=16
382CONFIG_BLK_DEV_RAM_SIZE=4096
383CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
384# CONFIG_CDROM_PKTCDVD is not set
385# CONFIG_ATA_OVER_ETH is not set
386CONFIG_NETDEVICES=y
387# CONFIG_NETDEVICES_MULTIQUEUE is not set
388# CONFIG_DUMMY is not set
389# CONFIG_BONDING is not set
390# CONFIG_MACVLAN is not set
391# CONFIG_EQUALIZER is not set
392# CONFIG_TUN is not set
393# CONFIG_VETH is not set
394# CONFIG_PHYLIB is not set
395CONFIG_NET_ETHERNET=y
396CONFIG_MII=y
397# CONFIG_IBM_NEW_EMAC_ZMII is not set
398# CONFIG_IBM_NEW_EMAC_RGMII is not set
399# CONFIG_IBM_NEW_EMAC_TAH is not set
400# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
401CONFIG_NETDEV_1000=y
402CONFIG_NETDEV_10000=y
403
404#
405# Wireless LAN
406#
407# CONFIG_WLAN_PRE80211 is not set
408# CONFIG_WLAN_80211 is not set
409# CONFIG_WAN is not set
410# CONFIG_PPP is not set
411# CONFIG_SLIP is not set
412# CONFIG_SHAPER is not set
413# CONFIG_NETCONSOLE is not set
414# CONFIG_NETPOLL is not set
415# CONFIG_NET_POLL_CONTROLLER is not set
416# CONFIG_RTC_CLASS is not set
417
418#
419# Input device support
420#
421# CONFIG_INPUT is not set
422
423#
424# Hardware I/O ports
425#
426CONFIG_SERIO=y
427# CONFIG_SERIO_I8042 is not set
428# CONFIG_SERIO_SERPORT is not set
429# CONFIG_SERIO_LIBPS2 is not set
430# CONFIG_SERIO_RAW is not set
431# CONFIG_GAMEPORT is not set
432
433#
434# Character devices
435#
436# CONFIG_VT is not set
437CONFIG_UNIX98_PTYS=y
438CONFIG_LEGACY_PTYS=y
439CONFIG_LEGACY_PTY_COUNT=256
440CONFIG_HW_RANDOM=y
441# CONFIG_RTC is not set
442# CONFIG_GEN_RTC is not set
443# CONFIG_R3964 is not set
444# CONFIG_RAW_DRIVER is not set
445
446#
447# File systems
448#
449# CONFIG_EXT2_FS is not set
450# CONFIG_EXT3_FS is not set
451# CONFIG_EXT4DEV_FS is not set
452# CONFIG_REISERFS_FS is not set
453# CONFIG_JFS_FS is not set
454# CONFIG_FS_POSIX_ACL is not set
455# CONFIG_XFS_FS is not set
456# CONFIG_GFS2_FS is not set
457# CONFIG_OCFS2_FS is not set
458# CONFIG_MINIX_FS is not set
459# CONFIG_ROMFS_FS is not set
460CONFIG_INOTIFY=y
461CONFIG_INOTIFY_USER=y
462# CONFIG_QUOTA is not set
463CONFIG_DNOTIFY=y
464# CONFIG_AUTOFS_FS is not set
465# CONFIG_AUTOFS4_FS is not set
466# CONFIG_FUSE_FS is not set
467
468#
469# CD-ROM/DVD Filesystems
470#
471# CONFIG_ISO9660_FS is not set
472# CONFIG_UDF_FS is not set
473
474#
475# DOS/FAT/NT Filesystems
476#
477# CONFIG_MSDOS_FS is not set
478# CONFIG_VFAT_FS is not set
479# CONFIG_NTFS_FS is not set
480
481#
482# Pseudo filesystems
483#
484CONFIG_PROC_FS=y
485CONFIG_PROC_KCORE=y
486CONFIG_PROC_SYSCTL=y
487CONFIG_SYSFS=y
488CONFIG_TMPFS=y
489# CONFIG_TMPFS_POSIX_ACL is not set
490# CONFIG_HUGETLB_PAGE is not set
491# CONFIG_CONFIGFS_FS is not set
492
493#
494# Miscellaneous filesystems
495#
496# CONFIG_ADFS_FS is not set
497# CONFIG_AFFS_FS is not set
498# CONFIG_HFS_FS is not set
499# CONFIG_HFSPLUS_FS is not set
500# CONFIG_BEFS_FS is not set
501# CONFIG_BFS_FS is not set
502# CONFIG_EFS_FS is not set
503CONFIG_JFFS2_FS=y
504CONFIG_JFFS2_FS_DEBUG=0
505CONFIG_JFFS2_FS_WRITEBUFFER=y
506# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
507# CONFIG_JFFS2_SUMMARY is not set
508# CONFIG_JFFS2_FS_XATTR is not set
509# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
510CONFIG_JFFS2_ZLIB=y
511# CONFIG_JFFS2_LZO is not set
512CONFIG_JFFS2_RTIME=y
513# CONFIG_JFFS2_RUBIN is not set
514CONFIG_CRAMFS=y
515# CONFIG_VXFS_FS is not set
516# CONFIG_HPFS_FS is not set
517# CONFIG_QNX4FS_FS is not set
518# CONFIG_SYSV_FS is not set
519# CONFIG_UFS_FS is not set
520CONFIG_NETWORK_FILESYSTEMS=y
521CONFIG_NFS_FS=y
522CONFIG_NFS_V3=y
523# CONFIG_NFS_V3_ACL is not set
524# CONFIG_NFS_V4 is not set
525# CONFIG_NFS_DIRECTIO is not set
526# CONFIG_NFSD is not set
527CONFIG_LOCKD=y
528CONFIG_LOCKD_V4=y
529CONFIG_NFS_COMMON=y
530CONFIG_SUNRPC=y
531# CONFIG_SUNRPC_BIND34 is not set
532# CONFIG_RPCSEC_GSS_KRB5 is not set
533# CONFIG_RPCSEC_GSS_SPKM3 is not set
534# CONFIG_SMB_FS is not set
535# CONFIG_CIFS is not set
536# CONFIG_NCP_FS is not set
537# CONFIG_CODA_FS is not set
538# CONFIG_AFS_FS is not set
539
540#
541# Partition Types
542#
543# CONFIG_PARTITION_ADVANCED is not set
544CONFIG_MSDOS_PARTITION=y
545# CONFIG_NLS is not set
546# CONFIG_DLM is not set
547
548#
549# Kernel hacking
550#
551# CONFIG_PROFILING is not set
552# CONFIG_SYSTEM_PROFILER is not set
553# CONFIG_PRINTK_TIME is not set
554CONFIG_ENABLE_WARN_DEPRECATED=y
555CONFIG_ENABLE_MUST_CHECK=y
556# CONFIG_MAGIC_SYSRQ is not set
557# CONFIG_UNUSED_SYMBOLS is not set
558# CONFIG_DEBUG_FS is not set
559# CONFIG_HEADERS_CHECK is not set
560# CONFIG_DEBUG_KERNEL is not set
561# CONFIG_SLUB_DEBUG_ON is not set
562# CONFIG_SAMPLES is not set
563
564#
565# Security options
566#
567# CONFIG_KEYS is not set
568# CONFIG_SECURITY is not set
569# CONFIG_SECURITY_FILE_CAPABILITIES is not set
570# CONFIG_CRYPTO is not set
571
572#
573# Library routines
574#
575CONFIG_BITREVERSE=y
576# CONFIG_CRC_CCITT is not set
577# CONFIG_CRC16 is not set
578# CONFIG_CRC_ITU_T is not set
579CONFIG_CRC32=y
580# CONFIG_CRC7 is not set
581# CONFIG_LIBCRC32C is not set
582CONFIG_ZLIB_INFLATE=y
583CONFIG_ZLIB_DEFLATE=y
584CONFIG_PLIST=y
585CONFIG_HAS_DMA=y
diff --git a/arch/cris/kernel/module.c b/arch/cris/kernel/module.c
index 11b867df8617..a187833febc8 100644
--- a/arch/cris/kernel/module.c
+++ b/arch/cris/kernel/module.c
@@ -28,20 +28,28 @@
28#define DEBUGP(fmt , ...) 28#define DEBUGP(fmt , ...)
29#endif 29#endif
30 30
31#ifdef CONFIG_ETRAX_KMALLOCED_MODULES
32#define MALLOC_MODULE(size) kmalloc(size, GFP_KERNEL)
33#define FREE_MODULE(region) kfree(region)
34#else
35#define MALLOC_MODULE(size) vmalloc_exec(size)
36#define FREE_MODULE(region) vfree(region)
37#endif
38
31void *module_alloc(unsigned long size) 39void *module_alloc(unsigned long size)
32{ 40{
33 if (size == 0) 41 if (size == 0)
34 return NULL; 42 return NULL;
35 return vmalloc_exec(size); 43 return MALLOC_MODULE(size);
36} 44}
37 45
38 46
39/* Free memory returned from module_alloc */ 47/* Free memory returned from module_alloc */
40void module_free(struct module *mod, void *module_region) 48void module_free(struct module *mod, void *module_region)
41{ 49{
42 vfree(module_region); 50 FREE_MODULE(module_region);
43 /* FIXME: If module_region == mod->init_region, trim exception 51 /* FIXME: If module_region == mod->init_region, trim exception
44 table entries. */ 52 table entries. */
45} 53}
46 54
47/* We don't need anything special. */ 55/* We don't need anything special. */
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 9ca558fc5bc8..ef2db8fd102a 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -1,5 +1,4 @@
1/* $Id: process.c,v 1.21 2005/03/04 08:16:17 starvik Exp $ 1/*
2 *
3 * linux/arch/cris/kernel/process.c 2 * linux/arch/cris/kernel/process.c
4 * 3 *
5 * Copyright (C) 1995 Linus Torvalds 4 * Copyright (C) 1995 Linus Torvalds
@@ -7,105 +6,6 @@
7 * 6 *
8 * Authors: Bjorn Wesen (bjornw@axis.com) 7 * Authors: Bjorn Wesen (bjornw@axis.com)
9 * 8 *
10 * $Log: process.c,v $
11 * Revision 1.21 2005/03/04 08:16:17 starvik
12 * Merge of Linux 2.6.11.
13 *
14 * Revision 1.20 2005/01/18 05:57:22 starvik
15 * Renamed hlt_counter to cris_hlt_counter and made it global.
16 *
17 * Revision 1.19 2004/10/19 13:07:43 starvik
18 * Merge of Linux 2.6.9
19 *
20 * Revision 1.18 2004/08/16 12:37:23 starvik
21 * Merge of Linux 2.6.8
22 *
23 * Revision 1.17 2004/04/05 13:53:48 starvik
24 * Merge of Linux 2.6.5
25 *
26 * Revision 1.16 2003/10/27 08:04:33 starvik
27 * Merge of Linux 2.6.0-test9
28 *
29 * Revision 1.15 2003/09/11 07:29:52 starvik
30 * Merge of Linux 2.6.0-test5
31 *
32 * Revision 1.14 2003/06/10 10:21:12 johana
33 * Moved thread_saved_pc() from arch/cris/kernel/process.c to
34 * subarch specific process.c. arch-v32 has an erp, no irp.
35 *
36 * Revision 1.13 2003/04/09 05:20:47 starvik
37 * Merge of Linux 2.5.67
38 *
39 * Revision 1.12 2002/12/11 15:41:11 starvik
40 * Extracted v10 (ETRAX 100LX) specific stuff to arch/cris/arch-v10/kernel
41 *
42 * Revision 1.11 2002/12/10 09:00:10 starvik
43 * Merge of Linux 2.5.51
44 *
45 * Revision 1.10 2002/11/27 08:42:34 starvik
46 * Argument to user_regs() is thread_info*
47 *
48 * Revision 1.9 2002/11/26 09:44:21 starvik
49 * New threads exits through ret_from_fork (necessary for preemptive scheduling)
50 *
51 * Revision 1.8 2002/11/19 14:35:24 starvik
52 * Changes from linux 2.4
53 * Changed struct initializer syntax to the currently prefered notation
54 *
55 * Revision 1.7 2002/11/18 07:39:42 starvik
56 * thread_saved_pc moved here from processor.h
57 *
58 * Revision 1.6 2002/11/14 06:51:27 starvik
59 * Made cpu_idle more similar with other archs
60 * init_task_union -> init_thread_union
61 * Updated for new interrupt macros
62 * sys_clone and do_fork have a new argument, user_tid
63 *
64 * Revision 1.5 2002/11/05 06:45:11 starvik
65 * Merge of Linux 2.5.45
66 *
67 * Revision 1.4 2002/02/05 15:37:44 bjornw
68 * Need init_task.h
69 *
70 * Revision 1.3 2002/01/21 15:22:49 bjornw
71 * current->counter is gone
72 *
73 * Revision 1.22 2001/11/13 09:40:43 orjanf
74 * Added dump_fpu (needed for core dumps).
75 *
76 * Revision 1.21 2001/11/12 18:26:21 pkj
77 * Fixed compiler warnings.
78 *
79 * Revision 1.20 2001/10/03 08:21:39 jonashg
80 * cause_of_death does not exist if CONFIG_SVINTO_SIM is defined.
81 *
82 * Revision 1.19 2001/09/26 11:52:54 bjornw
83 * INIT_MMAP is gone in 2.4.10
84 *
85 * Revision 1.18 2001/08/21 21:43:51 hp
86 * Move last watchdog fix inside #ifdef CONFIG_ETRAX_WATCHDOG
87 *
88 * Revision 1.17 2001/08/21 13:48:01 jonashg
89 * Added fix by HP to avoid oops when doing a hard_reset_now.
90 *
91 * Revision 1.16 2001/06/21 02:00:40 hp
92 * * entry.S: Include asm/unistd.h.
93 * (_sys_call_table): Use section .rodata, not .data.
94 * (_kernel_thread): Move from...
95 * * process.c: ... here.
96 * * entryoffsets.c (VAL): Break out from...
97 * (OF): Use VAL.
98 * (LCLONE_VM): New asmified value from CLONE_VM.
99 *
100 * Revision 1.15 2001/06/20 16:31:57 hp
101 * Add comments to describe empty functions according to review.
102 *
103 * Revision 1.14 2001/05/29 11:27:59 markusl
104 * Fixed so that hard_reset_now will do reset even if watchdog wasn't enabled
105 *
106 * Revision 1.13 2001/03/20 19:44:06 bjornw
107 * Use the 7th syscall argument for regs instead of current_regs
108 *
109 */ 9 */
110 10
111/* 11/*
@@ -206,6 +106,7 @@ EXPORT_SYMBOL(pm_power_off);
206 * low exit latency (ie sit in a loop waiting for 106 * low exit latency (ie sit in a loop waiting for
207 * somebody to say that they'd like to reschedule) 107 * somebody to say that they'd like to reschedule)
208 */ 108 */
109
209void cpu_idle (void) 110void cpu_idle (void)
210{ 111{
211 /* endless idle loop with no priority at all */ 112 /* endless idle loop with no priority at all */
diff --git a/arch/cris/kernel/ptrace.c b/arch/cris/kernel/ptrace.c
index 3ccd20e85dce..b326023baab2 100644
--- a/arch/cris/kernel/ptrace.c
+++ b/arch/cris/kernel/ptrace.c
@@ -2,65 +2,11 @@
2 * linux/arch/cris/kernel/ptrace.c 2 * linux/arch/cris/kernel/ptrace.c
3 * 3 *
4 * Parts taken from the m68k port. 4 * Parts taken from the m68k port.
5 * 5 *
6 * Copyright (c) 2000, 2001, 2002 Axis Communications AB 6 * Copyright (c) 2000, 2001, 2002 Axis Communications AB
7 * 7 *
8 * Authors: Bjorn Wesen 8 * Authors: Bjorn Wesen
9 * 9 *
10 * $Log: ptrace.c,v $
11 * Revision 1.10 2004/09/22 11:50:01 orjanf
12 * * Moved get_reg/put_reg to arch-specific files.
13 * * Added functions to access debug registers (CRISv32).
14 * * Added support for PTRACE_SINGLESTEP (CRISv32).
15 * * Added S flag to CCS_MASK (CRISv32).
16 *
17 * Revision 1.9 2003/07/04 12:56:11 tobiasa
18 * Moved arch-specific code to arch-specific files.
19 *
20 * Revision 1.8 2003/04/09 05:20:47 starvik
21 * Merge of Linux 2.5.67
22 *
23 * Revision 1.7 2002/11/27 08:42:34 starvik
24 * Argument to user_regs() is thread_info*
25 *
26 * Revision 1.6 2002/11/20 11:56:11 starvik
27 * Merge of Linux 2.5.48
28 *
29 * Revision 1.5 2002/11/18 07:41:19 starvik
30 * Removed warning
31 *
32 * Revision 1.4 2002/11/11 12:47:28 starvik
33 * SYSCALL_TRACE has been moved to thread flags
34 *
35 * Revision 1.3 2002/02/05 15:37:18 bjornw
36 * * Add do_notify_resume (replaces do_signal in the callchain)
37 * * syscall_trace is now do_syscall_trace
38 * * current->ptrace flag PT_TRACESYS -> PT_SYSCALLTRACE
39 * * Keep track of the current->work.syscall_trace counter
40 *
41 * Revision 1.2 2001/12/18 13:35:20 bjornw
42 * Applied the 2.4.13->2.4.16 CRIS patch to 2.5.1 (is a copy of 2.4.15).
43 *
44 * Revision 1.8 2001/11/12 18:26:21 pkj
45 * Fixed compiler warnings.
46 *
47 * Revision 1.7 2001/09/26 11:53:49 bjornw
48 * PTRACE_DETACH works more simple in 2.4.10
49 *
50 * Revision 1.6 2001/07/25 16:08:47 bjornw
51 * PTRACE_ATTACH bulk moved into arch-independent code in 2.4.7
52 *
53 * Revision 1.5 2001/03/26 14:24:28 orjanf
54 * * Changed loop condition.
55 * * Added comment documenting non-standard ptrace behaviour.
56 *
57 * Revision 1.4 2001/03/20 19:44:41 bjornw
58 * Use the user_regs macro instead of thread.esp0
59 *
60 * Revision 1.3 2000/12/18 23:45:25 bjornw
61 * Linux/CRIS first version
62 *
63 *
64 */ 10 */
65 11
66#include <linux/kernel.h> 12#include <linux/kernel.h>
@@ -85,7 +31,7 @@ extern int do_signal(int canrestart, struct pt_regs *regs);
85 31
86 32
87void do_notify_resume(int canrestart, struct pt_regs *regs, 33void do_notify_resume(int canrestart, struct pt_regs *regs,
88 __u32 thread_info_flags ) 34 __u32 thread_info_flags)
89{ 35{
90 /* deal with pending signal delivery */ 36 /* deal with pending signal delivery */
91 if (thread_info_flags & _TIF_SIGPENDING) 37 if (thread_info_flags & _TIF_SIGPENDING)
diff --git a/arch/cris/kernel/semaphore.c b/arch/cris/kernel/semaphore.c
index b884263d3cd4..f137a439041f 100644
--- a/arch/cris/kernel/semaphore.c
+++ b/arch/cris/kernel/semaphore.c
@@ -4,7 +4,6 @@
4 */ 4 */
5 5
6#include <linux/sched.h> 6#include <linux/sched.h>
7#include <linux/init.h>
8#include <asm/semaphore-helper.h> 7#include <asm/semaphore-helper.h>
9 8
10/* 9/*
diff --git a/arch/cris/kernel/setup.c b/arch/cris/kernel/setup.c
index c34fb235b09f..04d48dd91ddf 100644
--- a/arch/cris/kernel/setup.c
+++ b/arch/cris/kernel/setup.c
@@ -18,7 +18,7 @@
18#include <linux/screen_info.h> 18#include <linux/screen_info.h>
19#include <linux/utsname.h> 19#include <linux/utsname.h>
20#include <linux/pfn.h> 20#include <linux/pfn.h>
21 21#include <linux/cpu.h>
22#include <asm/setup.h> 22#include <asm/setup.h>
23 23
24/* 24/*
@@ -36,6 +36,8 @@ extern unsigned long dram_start, dram_end;
36 36
37extern unsigned long romfs_start, romfs_length, romfs_in_flash; /* from head.S */ 37extern unsigned long romfs_start, romfs_length, romfs_in_flash; /* from head.S */
38 38
39static struct cpu cpu_devices[NR_CPUS];
40
39extern void show_etrax_copyright(void); /* arch-vX/kernel/setup.c */ 41extern void show_etrax_copyright(void); /* arch-vX/kernel/setup.c */
40 42
41/* This mainly sets up the memory area, and can be really confusing. 43/* This mainly sets up the memory area, and can be really confusing.
@@ -45,24 +47,23 @@ extern void show_etrax_copyright(void); /* arch-vX/kernel/setup.c */
45 * given by the macro __pa(). 47 * given by the macro __pa().
46 * 48 *
47 * In this DRAM, the kernel code and data is loaded, in the beginning. 49 * In this DRAM, the kernel code and data is loaded, in the beginning.
48 * It really starts at c0004000 to make room for some special pages - 50 * It really starts at c0004000 to make room for some special pages -
49 * the start address is text_start. The kernel data ends at _end. After 51 * the start address is text_start. The kernel data ends at _end. After
50 * this the ROM filesystem is appended (if there is any). 52 * this the ROM filesystem is appended (if there is any).
51 * 53 *
52 * Between this address and dram_end, we have RAM pages usable to the 54 * Between this address and dram_end, we have RAM pages usable to the
53 * boot code and the system. 55 * boot code and the system.
54 * 56 *
55 */ 57 */
56 58
57void __init 59void __init setup_arch(char **cmdline_p)
58setup_arch(char **cmdline_p)
59{ 60{
60 extern void init_etrax_debug(void); 61 extern void init_etrax_debug(void);
61 unsigned long bootmap_size; 62 unsigned long bootmap_size;
62 unsigned long start_pfn, max_pfn; 63 unsigned long start_pfn, max_pfn;
63 unsigned long memory_start; 64 unsigned long memory_start;
64 65
65 /* register an initial console printing routine for printk's */ 66 /* register an initial console printing routine for printk's */
66 67
67 init_etrax_debug(); 68 init_etrax_debug();
68 69
@@ -121,7 +122,7 @@ setup_arch(char **cmdline_p)
121 min_low_pfn = PAGE_OFFSET >> PAGE_SHIFT; 122 min_low_pfn = PAGE_OFFSET >> PAGE_SHIFT;
122 123
123 bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, 124 bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn,
124 min_low_pfn, 125 min_low_pfn,
125 max_low_pfn); 126 max_low_pfn);
126 127
127 /* And free all memory not belonging to the kernel (addr, size) */ 128 /* And free all memory not belonging to the kernel (addr, size) */
@@ -187,4 +188,16 @@ const struct seq_operations cpuinfo_op = {
187 .show = show_cpuinfo, 188 .show = show_cpuinfo,
188}; 189};
189 190
191static int __init topology_init(void)
192{
193 int i;
194
195 for_each_possible_cpu(i) {
196 return register_cpu(&cpu_devices[i], i);
197 }
198
199 return 0;
200}
201
202subsys_initcall(topology_init);
190 203
diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c
index 7a2cc7efbcf8..ff4c6aa75def 100644
--- a/arch/cris/kernel/time.c
+++ b/arch/cris/kernel/time.c
@@ -1,5 +1,4 @@
1/* $Id: time.c,v 1.18 2005/03/04 08:16:17 starvik Exp $ 1/*
2 *
3 * linux/arch/cris/kernel/time.c 2 * linux/arch/cris/kernel/time.c
4 * 3 *
5 * Copyright (C) 1991, 1992, 1995 Linus Torvalds 4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
@@ -18,7 +17,7 @@
18 * Linux/CRIS specific code: 17 * Linux/CRIS specific code:
19 * 18 *
20 * Authors: Bjorn Wesen 19 * Authors: Bjorn Wesen
21 * Johan Adolfsson 20 * Johan Adolfsson
22 * 21 *
23 */ 22 */
24 23
@@ -208,10 +207,16 @@ cris_do_profile(struct pt_regs* regs)
208#endif 207#endif
209 208
210#ifdef CONFIG_PROFILING 209#ifdef CONFIG_PROFILING
211 profile_tick(CPU_PROFILING); 210 profile_tick(CPU_PROFILING);
212#endif 211#endif
213} 212}
214 213
214unsigned long long sched_clock(void)
215{
216 return (unsigned long long)jiffies * (1000000000 / HZ) +
217 get_ns_in_jiffie();
218}
219
215static int 220static int
216__init init_udelay(void) 221__init init_udelay(void)
217{ 222{
diff --git a/arch/cris/kernel/traps.c b/arch/cris/kernel/traps.c
index 520d92205fed..541efbf09371 100644
--- a/arch/cris/kernel/traps.c
+++ b/arch/cris/kernel/traps.c
@@ -1,66 +1,78 @@
1/* $Id: traps.c,v 1.11 2005/01/24 16:03:19 orjanf Exp $ 1/*
2 *
3 * linux/arch/cris/traps.c 2 * linux/arch/cris/traps.c
4 * 3 *
5 * Here we handle the break vectors not used by the system call 4 * Here we handle the break vectors not used by the system call
6 * mechanism, as well as some general stack/register dumping 5 * mechanism, as well as some general stack/register dumping
7 * things. 6 * things.
8 * 7 *
9 * Copyright (C) 2000-2002 Axis Communications AB 8 * Copyright (C) 2000-2007 Axis Communications AB
10 * 9 *
11 * Authors: Bjorn Wesen 10 * Authors: Bjorn Wesen
12 * Hans-Peter Nilsson 11 * Hans-Peter Nilsson
13 * 12 *
14 */ 13 */
15 14
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/module.h> 16#include <linux/module.h>
17
18#include <asm/pgtable.h> 18#include <asm/pgtable.h>
19#include <asm/uaccess.h> 19#include <asm/uaccess.h>
20 20
21extern void arch_enable_nmi(void);
22extern void stop_watchdog(void);
23extern void reset_watchdog(void);
24extern void show_registers(struct pt_regs *regs);
25
26#ifdef CONFIG_DEBUG_BUGVERBOSE
27extern void handle_BUG(struct pt_regs *regs);
28#else
29#define handle_BUG(regs)
30#endif
31
21static int kstack_depth_to_print = 24; 32static int kstack_depth_to_print = 24;
22 33
23extern int raw_printk(const char *fmt, ...); 34void (*nmi_handler)(struct pt_regs *);
24 35
25void show_trace(unsigned long * stack) 36void
37show_trace(unsigned long *stack)
26{ 38{
27 unsigned long addr, module_start, module_end; 39 unsigned long addr, module_start, module_end;
28 extern char _stext, _etext; 40 extern char _stext, _etext;
29 int i; 41 int i;
30 42
31 raw_printk("\nCall Trace: "); 43 printk("\nCall Trace: ");
32 44
33 i = 1; 45 i = 1;
34 module_start = VMALLOC_START; 46 module_start = VMALLOC_START;
35 module_end = VMALLOC_END; 47 module_end = VMALLOC_END;
36 48
37 while (((long) stack & (THREAD_SIZE-1)) != 0) { 49 while (((long)stack & (THREAD_SIZE-1)) != 0) {
38 if (__get_user (addr, stack)) { 50 if (__get_user(addr, stack)) {
39 /* This message matches "failing address" marked 51 /* This message matches "failing address" marked
40 s390 in ksymoops, so lines containing it will 52 s390 in ksymoops, so lines containing it will
41 not be filtered out by ksymoops. */ 53 not be filtered out by ksymoops. */
42 raw_printk ("Failing address 0x%lx\n", (unsigned long)stack); 54 printk("Failing address 0x%lx\n", (unsigned long)stack);
43 break; 55 break;
44 } 56 }
45 stack++; 57 stack++;
46 58
47 /* 59 /*
48 * If the address is either in the text segment of the 60 * If the address is either in the text segment of the
49 * kernel, or in the region which contains vmalloc'ed 61 * kernel, or in the region which contains vmalloc'ed
50 * memory, it *may* be the address of a calling 62 * memory, it *may* be the address of a calling
51 * routine; if so, print it so that someone tracing 63 * routine; if so, print it so that someone tracing
52 * down the cause of the crash will be able to figure 64 * down the cause of the crash will be able to figure
53 * out the call path that was taken. 65 * out the call path that was taken.
54 */ 66 */
55 if (((addr >= (unsigned long) &_stext) && 67 if (((addr >= (unsigned long)&_stext) &&
56 (addr <= (unsigned long) &_etext)) || 68 (addr <= (unsigned long)&_etext)) ||
57 ((addr >= module_start) && (addr <= module_end))) { 69 ((addr >= module_start) && (addr <= module_end))) {
58 if (i && ((i % 8) == 0)) 70 if (i && ((i % 8) == 0))
59 raw_printk("\n "); 71 printk("\n ");
60 raw_printk("[<%08lx>] ", addr); 72 printk("[<%08lx>] ", addr);
61 i++; 73 i++;
62 } 74 }
63 } 75 }
64} 76}
65 77
66/* 78/*
@@ -78,109 +90,149 @@ void show_trace(unsigned long * stack)
78 * with the ksymoops maintainer. 90 * with the ksymoops maintainer.
79 */ 91 */
80 92
81void 93void
82show_stack(struct task_struct *task, unsigned long *sp) 94show_stack(struct task_struct *task, unsigned long *sp)
83{ 95{
84 unsigned long *stack, addr; 96 unsigned long *stack, addr;
85 int i; 97 int i;
86 98
87 /* 99 /*
88 * debugging aid: "show_stack(NULL);" prints a 100 * debugging aid: "show_stack(NULL);" prints a
89 * back trace. 101 * back trace.
90 */ 102 */
91 103
92 if(sp == NULL) { 104 if (sp == NULL) {
93 if (task) 105 if (task)
94 sp = (unsigned long*)task->thread.ksp; 106 sp = (unsigned long*)task->thread.ksp;
95 else 107 else
96 sp = (unsigned long*)rdsp(); 108 sp = (unsigned long*)rdsp();
97 } 109 }
98 110
99 stack = sp; 111 stack = sp;
100 112
101 raw_printk("\nStack from %08lx:\n ", (unsigned long)stack); 113 printk("\nStack from %08lx:\n ", (unsigned long)stack);
102 for(i = 0; i < kstack_depth_to_print; i++) { 114 for (i = 0; i < kstack_depth_to_print; i++) {
103 if (((long) stack & (THREAD_SIZE-1)) == 0) 115 if (((long)stack & (THREAD_SIZE-1)) == 0)
104 break; 116 break;
105 if (i && ((i % 8) == 0)) 117 if (i && ((i % 8) == 0))
106 raw_printk("\n "); 118 printk("\n ");
107 if (__get_user (addr, stack)) { 119 if (__get_user(addr, stack)) {
108 /* This message matches "failing address" marked 120 /* This message matches "failing address" marked
109 s390 in ksymoops, so lines containing it will 121 s390 in ksymoops, so lines containing it will
110 not be filtered out by ksymoops. */ 122 not be filtered out by ksymoops. */
111 raw_printk ("Failing address 0x%lx\n", (unsigned long)stack); 123 printk("Failing address 0x%lx\n", (unsigned long)stack);
112 break; 124 break;
113 } 125 }
114 stack++; 126 stack++;
115 raw_printk("%08lx ", addr); 127 printk("%08lx ", addr);
116 } 128 }
117 show_trace(sp); 129 show_trace(sp);
118} 130}
119 131
120static void (*nmi_handler)(struct pt_regs*); 132#if 0
121extern void arch_enable_nmi(void); 133/* displays a short stack trace */
122 134
123void set_nmi_handler(void (*handler)(struct pt_regs*)) 135int
136show_stack(void)
124{ 137{
125 nmi_handler = handler; 138 unsigned long *sp = (unsigned long *)rdusp();
126 arch_enable_nmi(); 139 int i;
140
141 printk("Stack dump [0x%08lx]:\n", (unsigned long)sp);
142 for (i = 0; i < 16; i++)
143 printk("sp + %d: 0x%08lx\n", i*4, sp[i]);
144 return 0;
127} 145}
146#endif
128 147
129void handle_nmi(struct pt_regs* regs) 148void
149dump_stack(void)
130{ 150{
131 if (nmi_handler) 151 show_stack(NULL, NULL);
132 nmi_handler(regs); 152}
153EXPORT_SYMBOL(dump_stack);
154
155void
156set_nmi_handler(void (*handler)(struct pt_regs *))
157{
158 nmi_handler = handler;
159 arch_enable_nmi();
133} 160}
134 161
135#ifdef CONFIG_DEBUG_NMI_OOPS 162#ifdef CONFIG_DEBUG_NMI_OOPS
136void oops_nmi_handler(struct pt_regs* regs) 163void
164oops_nmi_handler(struct pt_regs *regs)
137{ 165{
138 stop_watchdog(); 166 stop_watchdog();
139 raw_printk("NMI!\n"); 167 oops_in_progress = 1;
140 show_registers(regs); 168 printk("NMI!\n");
169 show_registers(regs);
170 oops_in_progress = 0;
141} 171}
142 172
143static int 173static int __init
144__init oops_nmi_register(void) 174oops_nmi_register(void)
145{ 175{
146 set_nmi_handler(oops_nmi_handler); 176 set_nmi_handler(oops_nmi_handler);
147 return 0; 177 return 0;
148} 178}
149 179
150__initcall(oops_nmi_register); 180__initcall(oops_nmi_register);
151 181
152#endif 182#endif
153 183
154#if 0 184/*
155/* displays a short stack trace */ 185 * This gets called from entry.S when the watchdog has bitten. Show something
156 186 * similiar to an Oops dump, and if the kernel is configured to be a nice
157int 187 * doggy, then halt instead of reboot.
158show_stack() 188 */
189void
190watchdog_bite_hook(struct pt_regs *regs)
159{ 191{
160 unsigned long *sp = (unsigned long *)rdusp(); 192#ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY
161 int i; 193 local_irq_disable();
162 raw_printk("Stack dump [0x%08lx]:\n", (unsigned long)sp); 194 stop_watchdog();
163 for(i = 0; i < 16; i++) 195 show_registers(regs);
164 raw_printk("sp + %d: 0x%08lx\n", i*4, sp[i]); 196
165 return 0; 197 while (1)
166} 198 ; /* Do nothing. */
199#else
200 show_registers(regs);
167#endif 201#endif
202}
168 203
169void dump_stack(void) 204/* This is normally the Oops function. */
205void
206die_if_kernel(const char *str, struct pt_regs *regs, long err)
170{ 207{
171 show_stack(NULL, NULL); 208 if (user_mode(regs))
172} 209 return;
173 210
174EXPORT_SYMBOL(dump_stack); 211#ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY
212 /*
213 * This printout might take too long and could trigger
214 * the watchdog normally. If NICE_DOGGY is set, simply
215 * stop the watchdog during the printout.
216 */
217 stop_watchdog();
218#endif
175 219
176void __init 220 handle_BUG(regs);
177trap_init(void) 221
178{ 222 printk("%s: %04lx\n", str, err & 0xffff);
179 /* Nothing needs to be done */ 223
224 show_registers(regs);
225
226 oops_in_progress = 0;
227
228#ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY
229 reset_watchdog();
230#endif
231 do_exit(SIGSEGV);
180} 232}
181 233
182void spinning_cpu(void* addr) 234void __init
235trap_init(void)
183{ 236{
184 raw_printk("CPU %d spinning on %X\n", smp_processor_id(), addr); 237 /* Nothing needs to be done */
185 dump_stack();
186} 238}
diff --git a/arch/cris/mm/fault.c b/arch/cris/mm/fault.c
index 3034f3ff950c..c4c76db90f9c 100644
--- a/arch/cris/mm/fault.c
+++ b/arch/cris/mm/fault.c
@@ -1,130 +1,9 @@
1/* 1/*
2 * linux/arch/cris/mm/fault.c 2 * linux/arch/cris/mm/fault.c
3 * 3 *
4 * Copyright (C) 2000, 2001 Axis Communications AB 4 * Copyright (C) 2000-2006 Axis Communications AB
5 *
6 * Authors: Bjorn Wesen
7 *
8 * $Log: fault.c,v $
9 * Revision 1.20 2005/03/04 08:16:18 starvik
10 * Merge of Linux 2.6.11.
11 *
12 * Revision 1.19 2005/01/14 10:07:59 starvik
13 * Fixed warning.
14 *
15 * Revision 1.18 2005/01/12 08:10:14 starvik
16 * Re-added the change of frametype when handling kernel page fault fixup
17 * for v10. This is necessary to avoid that the CPU remakes the faulting
18 * access.
19 *
20 * Revision 1.17 2005/01/11 13:53:05 starvik
21 * Use raw_printk.
22 *
23 * Revision 1.16 2004/12/17 11:39:41 starvik
24 * SMP support.
25 *
26 * Revision 1.15 2004/11/23 18:36:18 starvik
27 * Stack is now non-executable.
28 * Signal handler trampolines are placed in a reserved page mapped into all
29 * processes.
30 *
31 * Revision 1.14 2004/11/23 07:10:21 starvik
32 * Moved find_fixup_code to generic code.
33 *
34 * Revision 1.13 2004/11/23 07:00:54 starvik
35 * Actually use the execute permission bit in the MMU. This makes it possible
36 * to prevent e.g. attacks where executable code is put on the stack.
37 *
38 * Revision 1.12 2004/09/29 06:16:04 starvik
39 * Use instruction_pointer
40 *
41 * Revision 1.11 2004/05/14 07:58:05 starvik
42 * Merge of changes from 2.4
43 *
44 * Revision 1.10 2003/10/27 14:51:24 starvik
45 * Removed debugcode
46 *
47 * Revision 1.9 2003/10/27 14:50:42 starvik
48 * Changed do_page_fault signature
49 *
50 * Revision 1.8 2003/07/04 13:02:48 tobiasa
51 * Moved code snippet from arch/cris/mm/fault.c that searches for fixup code
52 * to separate function in arch-specific files.
53 *
54 * Revision 1.7 2003/01/22 06:48:38 starvik
55 * Fixed warnings issued by GCC 3.2.1
56 *
57 * Revision 1.6 2003/01/09 14:42:52 starvik
58 * Merge of Linux 2.5.55
59 *
60 * Revision 1.5 2002/12/11 14:44:48 starvik
61 * Extracted v10 (ETRAX 100LX) specific stuff to arch/cris/arch-v10/mm
62 *
63 * Revision 1.4 2002/11/13 15:10:28 starvik
64 * pte_offset has been renamed to pte_offset_kernel
65 *
66 * Revision 1.3 2002/11/05 06:45:13 starvik
67 * Merge of Linux 2.5.45
68 *
69 * Revision 1.2 2001/12/18 13:35:22 bjornw
70 * Applied the 2.4.13->2.4.16 CRIS patch to 2.5.1 (is a copy of 2.4.15).
71 *
72 * Revision 1.20 2001/11/22 13:34:06 bjornw
73 * * Bug workaround (LX TR89): force a rerun of the whole of an interrupted
74 * unaligned write, because the second half of the write will be corrupted
75 * otherwise. Affected unaligned writes spanning not-yet mapped pages.
76 * * Optimization: use the wr_rd bit in R_MMU_CAUSE to know whether a miss
77 * was due to a read or a write (before we didn't know this until the next
78 * restart of the interrupted instruction, thus wasting one fault-irq)
79 *
80 * Revision 1.19 2001/11/12 19:02:10 pkj
81 * Fixed compiler warnings.
82 *
83 * Revision 1.18 2001/07/18 22:14:32 bjornw
84 * Enable interrupts in the bulk of do_page_fault
85 *
86 * Revision 1.17 2001/07/18 13:07:23 bjornw
87 * * Detect non-existant PTE's in vmalloc pmd synchronization
88 * * Remove comment about fast-paths for VMALLOC_START etc, because all that
89 * was totally bogus anyway it turned out :)
90 * * Fix detection of vmalloc-area synchronization
91 * * Add some comments
92 *
93 * Revision 1.16 2001/06/13 00:06:08 bjornw
94 * current_pgd should be volatile
95 *
96 * Revision 1.15 2001/06/13 00:02:23 bjornw
97 * Use a separate variable to store the current pgd to avoid races in schedule
98 *
99 * Revision 1.14 2001/05/16 17:41:07 hp
100 * Last comment tweak further tweaked.
101 *
102 * Revision 1.13 2001/05/15 00:58:44 hp
103 * Expand a bit on the comment why we compare address >= TASK_SIZE rather
104 * than >= VMALLOC_START.
105 *
106 * Revision 1.12 2001/04/04 10:51:14 bjornw
107 * mmap_sem is grabbed for reading
108 *
109 * Revision 1.11 2001/03/23 07:36:07 starvik
110 * Corrected according to review remarks
111 *
112 * Revision 1.10 2001/03/21 16:10:11 bjornw
113 * CRIS_FRAME_FIXUP not needed anymore, use FRAME_NORMAL
114 *
115 * Revision 1.9 2001/03/05 13:22:20 bjornw
116 * Spell-fix and fix in vmalloc_fault handling
117 *
118 * Revision 1.8 2000/11/22 14:45:31 bjornw
119 * * 2.4.0-test10 removed the set_pgdir instantaneous kernel global mapping
120 * into all processes. Instead we fill in the missing PTE entries on demand.
121 *
122 * Revision 1.7 2000/11/21 16:39:09 bjornw
123 * fixup switches frametype
124 *
125 * Revision 1.6 2000/11/17 16:54:08 bjornw
126 * More detailed siginfo reporting
127 * 5 *
6 * Authors: Bjorn Wesen
128 * 7 *
129 */ 8 */
130 9
@@ -135,7 +14,6 @@
135 14
136extern int find_fixup_code(struct pt_regs *); 15extern int find_fixup_code(struct pt_regs *);
137extern void die_if_kernel(const char *, struct pt_regs *, long); 16extern void die_if_kernel(const char *, struct pt_regs *, long);
138extern int raw_printk(const char *fmt, ...);
139 17
140/* debug of low-level TLB reload */ 18/* debug of low-level TLB reload */
141#undef DEBUG 19#undef DEBUG
@@ -164,8 +42,8 @@ unsigned long cris_signal_return_page;
164 * address. 42 * address.
165 * 43 *
166 * error_code: 44 * error_code:
167 * bit 0 == 0 means no page found, 1 means protection fault 45 * bit 0 == 0 means no page found, 1 means protection fault
168 * bit 1 == 0 means read, 1 means write 46 * bit 1 == 0 means read, 1 means write
169 * 47 *
170 * If this routine detects a bad access, it returns 1, otherwise it 48 * If this routine detects a bad access, it returns 1, otherwise it
171 * returns 0. 49 * returns 0.
@@ -181,9 +59,10 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
181 siginfo_t info; 59 siginfo_t info;
182 int fault; 60 int fault;
183 61
184 D(printk("Page fault for %lX on %X at %lX, prot %d write %d\n", 62 D(printk(KERN_DEBUG
185 address, smp_processor_id(), instruction_pointer(regs), 63 "Page fault for %lX on %X at %lX, prot %d write %d\n",
186 protection, writeaccess)); 64 address, smp_processor_id(), instruction_pointer(regs),
65 protection, writeaccess));
187 66
188 tsk = current; 67 tsk = current;
189 68
@@ -233,7 +112,7 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
233 * context, we must not take the fault.. 112 * context, we must not take the fault..
234 */ 113 */
235 114
236 if (in_atomic() || !mm) 115 if (in_interrupt() || !mm)
237 goto no_context; 116 goto no_context;
238 117
239 down_read(&mm->mmap_sem); 118 down_read(&mm->mmap_sem);
@@ -319,6 +198,9 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
319 /* info.si_code has been set above */ 198 /* info.si_code has been set above */
320 info.si_addr = (void *)address; 199 info.si_addr = (void *)address;
321 force_sig_info(SIGSEGV, &info, tsk); 200 force_sig_info(SIGSEGV, &info, tsk);
201 printk(KERN_NOTICE "%s (pid %d) segfaults for page "
202 "address %08lx at pc %08lx\n",
203 tsk->comm, tsk->pid, address, instruction_pointer(regs));
322 return; 204 return;
323 } 205 }
324 206
@@ -326,7 +208,7 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
326 208
327 /* Are we prepared to handle this kernel fault? 209 /* Are we prepared to handle this kernel fault?
328 * 210 *
329 * (The kernel has valid exception-points in the source 211 * (The kernel has valid exception-points in the source
330 * when it acesses user-memory. When it fails in one 212 * when it acesses user-memory. When it fails in one
331 * of those points, we find it in a table and do a jump 213 * of those points, we find it in a table and do a jump
332 * to some fixup code that loads an appropriate error 214 * to some fixup code that loads an appropriate error
@@ -341,13 +223,18 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
341 * terminate things with extreme prejudice. 223 * terminate things with extreme prejudice.
342 */ 224 */
343 225
344 if ((unsigned long) (address) < PAGE_SIZE) 226 if (!oops_in_progress) {
345 raw_printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); 227 oops_in_progress = 1;
346 else 228 if ((unsigned long) (address) < PAGE_SIZE)
347 raw_printk(KERN_ALERT "Unable to handle kernel access"); 229 printk(KERN_ALERT "Unable to handle kernel NULL "
348 raw_printk(" at virtual address %08lx\n",address); 230 "pointer dereference");
349 231 else
350 die_if_kernel("Oops", regs, (writeaccess << 1) | protection); 232 printk(KERN_ALERT "Unable to handle kernel access"
233 " at virtual address %08lx\n", address);
234
235 die_if_kernel("Oops", regs, (writeaccess << 1) | protection);
236 oops_in_progress = 0;
237 }
351 238
352 do_exit(SIGKILL); 239 do_exit(SIGKILL);
353 240
@@ -360,7 +247,7 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
360 up_read(&mm->mmap_sem); 247 up_read(&mm->mmap_sem);
361 printk("VM: killing process %s\n", tsk->comm); 248 printk("VM: killing process %s\n", tsk->comm);
362 if (user_mode(regs)) 249 if (user_mode(regs))
363 do_group_exit(SIGKILL); 250 do_exit(SIGKILL);
364 goto no_context; 251 goto no_context;
365 252
366 do_sigbus: 253 do_sigbus:
@@ -406,8 +293,8 @@ vmalloc_fault:
406 /* Since we're two-level, we don't need to do both 293 /* Since we're two-level, we don't need to do both
407 * set_pgd and set_pmd (they do the same thing). If 294 * set_pgd and set_pmd (they do the same thing). If
408 * we go three-level at some point, do the right thing 295 * we go three-level at some point, do the right thing
409 * with pgd_present and set_pgd here. 296 * with pgd_present and set_pgd here.
410 * 297 *
411 * Also, since the vmalloc area is global, we don't 298 * Also, since the vmalloc area is global, we don't
412 * need to copy individual PTE's, it is enough to 299 * need to copy individual PTE's, it is enough to
413 * copy the pgd pointer into the pte page of the 300 * copy the pgd pointer into the pte page of the
diff --git a/arch/cris/mm/init.c b/arch/cris/mm/init.c
index 0c833d176226..4207a2b52750 100644
--- a/arch/cris/mm/init.c
+++ b/arch/cris/mm/init.c
@@ -6,117 +6,6 @@
6 * 6 *
7 * Authors: Bjorn Wesen (bjornw@axis.com) 7 * Authors: Bjorn Wesen (bjornw@axis.com)
8 * 8 *
9 * $Log: init.c,v $
10 * Revision 1.11 2004/05/28 09:28:56 starvik
11 * Calculation of loops_per_usec moved because initialization order has changed
12 * in Linux 2.6.
13 *
14 * Revision 1.10 2004/05/14 07:58:05 starvik
15 * Merge of changes from 2.4
16 *
17 * Revision 1.9 2003/07/04 08:27:54 starvik
18 * Merge of Linux 2.5.74
19 *
20 * Revision 1.8 2003/04/09 05:20:48 starvik
21 * Merge of Linux 2.5.67
22 *
23 * Revision 1.7 2003/01/22 06:48:38 starvik
24 * Fixed warnings issued by GCC 3.2.1
25 *
26 * Revision 1.6 2002/12/11 14:44:48 starvik
27 * Extracted v10 (ETRAX 100LX) specific stuff to arch/cris/arch-v10/mm
28 *
29 * Revision 1.5 2002/11/18 07:37:37 starvik
30 * Added cache bug workaround (from Linux 2.4)
31 *
32 * Revision 1.4 2002/11/13 15:40:24 starvik
33 * Removed the page table cache stuff (as done in other archs)
34 *
35 * Revision 1.3 2002/11/05 06:45:13 starvik
36 * Merge of Linux 2.5.45
37 *
38 * Revision 1.2 2001/12/18 13:35:22 bjornw
39 * Applied the 2.4.13->2.4.16 CRIS patch to 2.5.1 (is a copy of 2.4.15).
40 *
41 * Revision 1.31 2001/11/13 16:22:00 bjornw
42 * Skip calculating totalram and sharedram in si_meminfo
43 *
44 * Revision 1.30 2001/11/12 19:02:10 pkj
45 * Fixed compiler warnings.
46 *
47 * Revision 1.29 2001/07/25 16:09:50 bjornw
48 * val->sharedram will stay 0
49 *
50 * Revision 1.28 2001/06/28 16:30:17 bjornw
51 * Oops. This needs to wait until 2.4.6 is merged
52 *
53 * Revision 1.27 2001/06/28 14:04:07 bjornw
54 * Fill in sharedram
55 *
56 * Revision 1.26 2001/06/18 06:36:02 hp
57 * Enable free_initmem of __init-type pages
58 *
59 * Revision 1.25 2001/06/13 00:02:23 bjornw
60 * Use a separate variable to store the current pgd to avoid races in schedule
61 *
62 * Revision 1.24 2001/05/15 00:52:20 hp
63 * Only map segment 0xa as seg if CONFIG_JULIETTE
64 *
65 * Revision 1.23 2001/04/04 14:35:40 bjornw
66 * * Removed get_pte_slow and friends (2.4.3 change)
67 * * Removed bad_pmd handling (2.4.3 change)
68 *
69 * Revision 1.22 2001/04/04 13:38:04 matsfg
70 * Moved ioremap to a separate function instead
71 *
72 * Revision 1.21 2001/03/27 09:28:33 bjornw
73 * ioremap used too early - lets try it in mem_init instead
74 *
75 * Revision 1.20 2001/03/23 07:39:21 starvik
76 * Corrected according to review remarks
77 *
78 * Revision 1.19 2001/03/15 14:25:17 bjornw
79 * More general shadow registers and ioremaped addresses for external I/O
80 *
81 * Revision 1.18 2001/02/23 12:46:44 bjornw
82 * * 0xc was not CSE1; 0x8 is, same as uncached flash, so we move the uncached
83 * flash during CRIS_LOW_MAP from 0xe to 0x8 so both the flash and the I/O
84 * is mapped straight over (for !CRIS_LOW_MAP the uncached flash is still 0xe)
85 *
86 * Revision 1.17 2001/02/22 15:05:21 bjornw
87 * Map 0x9 straight over during LOW_MAP to allow for memory mapped LEDs
88 *
89 * Revision 1.16 2001/02/22 15:02:35 bjornw
90 * Map 0xc straight over during LOW_MAP to allow for memory mapped I/O
91 *
92 * Revision 1.15 2001/01/10 21:12:10 bjornw
93 * loops_per_sec -> loops_per_jiffy
94 *
95 * Revision 1.14 2000/11/22 16:23:20 bjornw
96 * Initialize totalhigh counters to 0 to make /proc/meminfo look nice.
97 *
98 * Revision 1.13 2000/11/21 16:37:51 bjornw
99 * Temporarily disable initmem freeing
100 *
101 * Revision 1.12 2000/11/21 13:55:07 bjornw
102 * Use CONFIG_CRIS_LOW_MAP for the low VM map instead of explicit CPU type
103 *
104 * Revision 1.11 2000/10/06 12:38:22 bjornw
105 * Cast empty_bad_page correctly (should really be of * type from the start..
106 *
107 * Revision 1.10 2000/10/04 16:53:57 bjornw
108 * Fix memory-map due to LX features
109 *
110 * Revision 1.9 2000/09/13 15:47:49 bjornw
111 * Wrong count in reserved-pages loop
112 *
113 * Revision 1.8 2000/09/13 14:35:10 bjornw
114 * 2.4.0-test8 added a new arg to free_area_init_node
115 *
116 * Revision 1.7 2000/08/17 15:35:55 bjornw
117 * 2.4.0-test6 removed MAP_NR and inserted virt_to_page
118 *
119 *
120 */ 9 */
121 10
122#include <linux/init.h> 11#include <linux/init.h>
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 917b7b46f1a7..65d0a9103297 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -1,221 +1,10 @@
1/* $Id: ethernet.c,v 1.31 2004/10/18 14:49:03 starvik Exp $ 1/*
2 *
3 * e100net.c: A network driver for the ETRAX 100LX network controller. 2 * e100net.c: A network driver for the ETRAX 100LX network controller.
4 * 3 *
5 * Copyright (c) 1998-2002 Axis Communications AB. 4 * Copyright (c) 1998-2002 Axis Communications AB.
6 * 5 *
7 * The outline of this driver comes from skeleton.c. 6 * The outline of this driver comes from skeleton.c.
8 * 7 *
9 * $Log: ethernet.c,v $
10 * Revision 1.31 2004/10/18 14:49:03 starvik
11 * Use RX interrupt as random source
12 *
13 * Revision 1.30 2004/09/29 10:44:04 starvik
14 * Enabed MAC-address output again
15 *
16 * Revision 1.29 2004/08/24 07:14:05 starvik
17 * Make use of generic MDIO interface and constants.
18 *
19 * Revision 1.28 2004/08/20 09:37:11 starvik
20 * Added support for Intel LXT972A. Creds to Randy Scarborough.
21 *
22 * Revision 1.27 2004/08/16 12:37:22 starvik
23 * Merge of Linux 2.6.8
24 *
25 * Revision 1.25 2004/06/21 10:29:57 starvik
26 * Merge of Linux 2.6.7
27 *
28 * Revision 1.23 2004/06/09 05:29:22 starvik
29 * Avoid any race where R_DMA_CH1_FIRST is NULL (may trigger cache bug).
30 *
31 * Revision 1.22 2004/05/14 07:58:03 starvik
32 * Merge of changes from 2.4
33 *
34 * Revision 1.20 2004/03/11 11:38:40 starvik
35 * Merge of Linux 2.6.4
36 *
37 * Revision 1.18 2003/12/03 13:45:46 starvik
38 * Use hardware pad for short packets to prevent information leakage.
39 *
40 * Revision 1.17 2003/07/04 08:27:37 starvik
41 * Merge of Linux 2.5.74
42 *
43 * Revision 1.16 2003/04/24 08:28:22 starvik
44 * New LED behaviour: LED off when no link
45 *
46 * Revision 1.15 2003/04/09 05:20:47 starvik
47 * Merge of Linux 2.5.67
48 *
49 * Revision 1.13 2003/03/06 16:11:01 henriken
50 * Off by one error in group address register setting.
51 *
52 * Revision 1.12 2003/02/27 17:24:19 starvik
53 * Corrected Rev to Revision
54 *
55 * Revision 1.11 2003/01/24 09:53:21 starvik
56 * Oops. Initialize GA to 0, not to 1
57 *
58 * Revision 1.10 2003/01/24 09:50:55 starvik
59 * Initialize GA_0 and GA_1 to 0 to avoid matching of unwanted packets
60 *
61 * Revision 1.9 2002/12/13 07:40:58 starvik
62 * Added basic ethtool interface
63 * Handled out of memory when allocating new buffers
64 *
65 * Revision 1.8 2002/12/11 13:13:57 starvik
66 * Added arch/ to v10 specific includes
67 * Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
68 *
69 * Revision 1.7 2002/11/26 09:41:42 starvik
70 * Added e100_set_config (standard interface to set media type)
71 * Added protection against preemptive scheduling
72 * Added standard MII ioctls
73 *
74 * Revision 1.6 2002/11/21 07:18:18 starvik
75 * Timers must be initialized in 2.5.48
76 *
77 * Revision 1.5 2002/11/20 11:56:11 starvik
78 * Merge of Linux 2.5.48
79 *
80 * Revision 1.4 2002/11/18 07:26:46 starvik
81 * Linux 2.5 port of latest Linux 2.4 ethernet driver
82 *
83 * Revision 1.33 2002/10/02 20:16:17 hp
84 * SETF, SETS: Use underscored IO_x_ macros rather than incorrect token concatenation
85 *
86 * Revision 1.32 2002/09/16 06:05:58 starvik
87 * Align memory returned by dev_alloc_skb
88 * Moved handling of sent packets to interrupt to avoid reference counting problem
89 *
90 * Revision 1.31 2002/09/10 13:28:23 larsv
91 * Return -EINVAL for unknown ioctls to avoid confusing tools that tests
92 * for supported functionality by issuing special ioctls, i.e. wireless
93 * extensions.
94 *
95 * Revision 1.30 2002/05/07 18:50:08 johana
96 * Correct spelling in comments.
97 *
98 * Revision 1.29 2002/05/06 05:38:49 starvik
99 * Performance improvements:
100 * Large packets are not copied (breakpoint set to 256 bytes)
101 * The cache bug workaround is delayed until half of the receive list
102 * has been used
103 * Added transmit list
104 * Transmit interrupts are only enabled when transmit queue is full
105 *
106 * Revision 1.28.2.1 2002/04/30 08:15:51 starvik
107 * Performance improvements:
108 * Large packets are not copied (breakpoint set to 256 bytes)
109 * The cache bug workaround is delayed until half of the receive list
110 * has been used.
111 * Added transmit list
112 * Transmit interrupts are only enabled when transmit queue is full
113 *
114 * Revision 1.28 2002/04/22 11:47:21 johana
115 * Fix according to 2.4.19-pre7. time_after/time_before and
116 * missing end of comment.
117 * The patch has a typo for ethernet.c in e100_clear_network_leds(),
118 * that is fixed here.
119 *
120 * Revision 1.27 2002/04/12 11:55:11 bjornw
121 * Added TODO
122 *
123 * Revision 1.26 2002/03/15 17:11:02 bjornw
124 * Use prepare_rx_descriptor after the CPU has touched the receiving descs
125 *
126 * Revision 1.25 2002/03/08 13:07:53 bjornw
127 * Unnecessary spinlock removed
128 *
129 * Revision 1.24 2002/02/20 12:57:43 fredriks
130 * Replaced MIN() with min().
131 *
132 * Revision 1.23 2002/02/20 10:58:14 fredriks
133 * Strip the Ethernet checksum (4 bytes) before forwarding a frame to upper layers.
134 *
135 * Revision 1.22 2002/01/30 07:48:22 matsfg
136 * Initiate R_NETWORK_TR_CTRL
137 *
138 * Revision 1.21 2001/11/23 11:54:49 starvik
139 * Added IFF_PROMISC and IFF_ALLMULTI handling in set_multicast_list
140 * Removed compiler warnings
141 *
142 * Revision 1.20 2001/11/12 19:26:00 pkj
143 * * Corrected e100_negotiate() to not assign half to current_duplex when
144 * it was supposed to compare them...
145 * * Cleaned up failure handling in e100_open().
146 * * Fixed compiler warnings.
147 *
148 * Revision 1.19 2001/11/09 07:43:09 starvik
149 * Added full duplex support
150 * Added ioctl to set speed and duplex
151 * Clear LED timer only runs when LED is lit
152 *
153 * Revision 1.18 2001/10/03 14:40:43 jonashg
154 * Update rx_bytes counter.
155 *
156 * Revision 1.17 2001/06/11 12:43:46 olof
157 * Modified defines for network LED behavior
158 *
159 * Revision 1.16 2001/05/30 06:12:46 markusl
160 * TxDesc.next should not be set to NULL
161 *
162 * Revision 1.15 2001/05/29 10:27:04 markusl
163 * Updated after review remarks:
164 * +Use IO_EXTRACT
165 * +Handle underrun
166 *
167 * Revision 1.14 2001/05/29 09:20:14 jonashg
168 * Use driver name on printk output so one can tell which driver that complains.
169 *
170 * Revision 1.13 2001/05/09 12:35:59 johana
171 * Use DMA_NBR and IRQ_NBR defines from dma.h and irq.h
172 *
173 * Revision 1.12 2001/04/05 11:43:11 tobiasa
174 * Check dev before panic.
175 *
176 * Revision 1.11 2001/04/04 11:21:05 markusl
177 * Updated according to review remarks
178 *
179 * Revision 1.10 2001/03/26 16:03:06 bjornw
180 * Needs linux/config.h
181 *
182 * Revision 1.9 2001/03/19 14:47:48 pkj
183 * * Make sure there is always a pause after the network LEDs are
184 * changed so they will not look constantly lit during heavy traffic.
185 * * Always use HZ when setting times relative to jiffies.
186 * * Use LED_NETWORK_SET() when setting the network LEDs.
187 *
188 * Revision 1.8 2001/02/27 13:52:48 bjornw
189 * malloc.h -> slab.h
190 *
191 * Revision 1.7 2001/02/23 13:46:38 bjornw
192 * Spellling check
193 *
194 * Revision 1.6 2001/01/26 15:21:04 starvik
195 * Don't disable interrupts while reading MDIO registers (MDIO is slow)
196 * Corrected promiscuous mode
197 * Improved deallocation of IRQs ("ifconfig eth0 down" now works)
198 *
199 * Revision 1.5 2000/11/29 17:22:22 bjornw
200 * Get rid of the udword types legacy stuff
201 *
202 * Revision 1.4 2000/11/22 16:36:09 bjornw
203 * Please marketing by using the correct case when spelling Etrax.
204 *
205 * Revision 1.3 2000/11/21 16:43:04 bjornw
206 * Minor short->int change
207 *
208 * Revision 1.2 2000/11/08 14:27:57 bjornw
209 * 2.4 port
210 *
211 * Revision 1.1 2000/11/06 13:56:00 bjornw
212 * Verbatim copy of the 1.24 version of e100net.c from elinux
213 *
214 * Revision 1.24 2000/10/04 15:55:23 bjornw
215 * * Use virt_to_phys etc. for DMA addresses
216 * * Removed bogus CHECKSUM_UNNECESSARY
217 *
218 *
219 */ 8 */
220 9
221 10
@@ -244,7 +33,7 @@
244#include <linux/ethtool.h> 33#include <linux/ethtool.h>
245 34
246#include <asm/arch/svinto.h>/* DMA and register descriptions */ 35#include <asm/arch/svinto.h>/* DMA and register descriptions */
247#include <asm/io.h> /* LED_* I/O functions */ 36#include <asm/io.h> /* CRIS_LED_* I/O functions */
248#include <asm/irq.h> 37#include <asm/irq.h>
249#include <asm/dma.h> 38#include <asm/dma.h>
250#include <asm/system.h> 39#include <asm/system.h>
@@ -1899,18 +1688,18 @@ e100_set_network_leds(int active)
1899 if (!current_speed) { 1688 if (!current_speed) {
1900 /* Make LED red, link is down */ 1689 /* Make LED red, link is down */
1901#if defined(CONFIG_ETRAX_NETWORK_RED_ON_NO_CONNECTION) 1690#if defined(CONFIG_ETRAX_NETWORK_RED_ON_NO_CONNECTION)
1902 LED_NETWORK_SET(LED_RED); 1691 CRIS_LED_NETWORK_SET(CRIS_LED_RED);
1903#else 1692#else
1904 LED_NETWORK_SET(LED_OFF); 1693 CRIS_LED_NETWORK_SET(CRIS_LED_OFF);
1905#endif 1694#endif
1906 } else if (light_leds) { 1695 } else if (light_leds) {
1907 if (current_speed == 10) { 1696 if (current_speed == 10) {
1908 LED_NETWORK_SET(LED_ORANGE); 1697 CRIS_LED_NETWORK_SET(CRIS_LED_ORANGE);
1909 } else { 1698 } else {
1910 LED_NETWORK_SET(LED_GREEN); 1699 CRIS_LED_NETWORK_SET(CRIS_LED_GREEN);
1911 } 1700 }
1912 } else { 1701 } else {
1913 LED_NETWORK_SET(LED_OFF); 1702 CRIS_LED_NETWORK_SET(CRIS_LED_OFF);
1914 } 1703 }
1915} 1704}
1916 1705
diff --git a/include/asm-cris/Kbuild b/include/asm-cris/Kbuild
index 14498d5a2f65..17455459c43f 100644
--- a/include/asm-cris/Kbuild
+++ b/include/asm-cris/Kbuild
@@ -1,5 +1,11 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-y += arch-v10/ arch-v32/ 3header-$(CONFIG_ETRAX_ARCH_V10) += arch-v10/
4header-$(CONFIG_ETRAX_ARCH_V32) += arch-v32/
4 5
6header-y += ethernet.h
7header-y += rtc.h
8header-y += sync_serial.h
9
10unifdef-y += etraxgpio.h
5unifdef-y += rs485.h 11unifdef-y += rs485.h
diff --git a/include/asm-cris/arch-v10/Kbuild b/include/asm-cris/arch-v10/Kbuild
index d7f27dc0941a..60e7e1b73cec 100644
--- a/include/asm-cris/arch-v10/Kbuild
+++ b/include/asm-cris/arch-v10/Kbuild
@@ -1,2 +1,5 @@
1header-y += ptrace.h 1header-y += ptrace.h
2header-y += user.h 2header-y += user.h
3header-y += svinto.h
4header-y += sv_addr_ag.h
5header-y += sv_addr.agh
diff --git a/include/asm-cris/arch-v10/bug.h b/include/asm-cris/arch-v10/bug.h
new file mode 100644
index 000000000000..3485d6b34bb0
--- /dev/null
+++ b/include/asm-cris/arch-v10/bug.h
@@ -0,0 +1,66 @@
1#ifndef __ASM_CRISv10_ARCH_BUG_H
2#define __ASM_CRISv10_ARCH_BUG_H
3
4#include <linux/stringify.h>
5
6#ifdef CONFIG_BUG
7#ifdef CONFIG_DEBUG_BUGVERBOSE
8/* The BUG() macro is used for marking obviously incorrect code paths.
9 * It will cause a message with the file name and line number to be printed,
10 * and then cause an oops. The message is actually printed by handle_BUG()
11 * in arch/cris/kernel/traps.c, and the reason we use this method of storing
12 * the file name and line number is that we do not want to affect the registers
13 * by calling printk() before causing the oops.
14 */
15
16#define BUG_PREFIX 0x0D7F
17#define BUG_MAGIC 0x00001234
18
19struct bug_frame {
20 unsigned short prefix;
21 unsigned int magic;
22 unsigned short clear;
23 unsigned short movu;
24 unsigned short line;
25 unsigned short jump;
26 unsigned char *filename;
27};
28
29#if 0
30/* Unfortunately this version of the macro does not work due to a problem
31 * with the compiler (aka a bug) when compiling with -O2, which sometimes
32 * erroneously causes the second input to be stored in a register...
33 */
34#define BUG() \
35 __asm__ __volatile__ ("clear.d [" __stringify(BUG_MAGIC) "]\n\t"\
36 "movu.w %0,$r0\n\t" \
37 "jump %1\n\t" \
38 : : "i" (__LINE__), "i" (__FILE__))
39#else
40/* This version will have to do for now, until the compiler is fixed.
41 * The drawbacks of this version are that the file name will appear multiple
42 * times in the .rodata section, and that __LINE__ and __FILE__ can probably
43 * not be used like this with newer versions of gcc.
44 */
45#define BUG() \
46 __asm__ __volatile__ ("clear.d [" __stringify(BUG_MAGIC) "]\n\t"\
47 "movu.w " __stringify(__LINE__) ",$r0\n\t"\
48 "jump 0f\n\t" \
49 ".section .rodata\n" \
50 "0:\t.string \"" __FILE__ "\"\n\t" \
51 ".previous")
52#endif
53
54#else
55
56/* This just causes an oops. */
57#define BUG() (*(int *)0 = 0)
58
59#endif
60
61#define HAVE_ARCH_BUG
62#endif
63
64#include <asm-generic/bug.h>
65
66#endif
diff --git a/include/asm-cris/arch-v10/io.h b/include/asm-cris/arch-v10/io.h
index 11ef5b53d84e..c08c24265299 100644
--- a/include/asm-cris/arch-v10/io.h
+++ b/include/asm-cris/arch-v10/io.h
@@ -23,7 +23,7 @@ extern volatile unsigned long *port_cse1_addr;
23extern volatile unsigned long *port_csp0_addr; 23extern volatile unsigned long *port_csp0_addr;
24extern volatile unsigned long *port_csp4_addr; 24extern volatile unsigned long *port_csp4_addr;
25 25
26/* macro for setting regs through a shadow - 26/* macro for setting regs through a shadow -
27 * r = register name (like R_PORT_PA_DATA) 27 * r = register name (like R_PORT_PA_DATA)
28 * s = shadow name (like port_pa_data_shadow) 28 * s = shadow name (like port_pa_data_shadow)
29 * b = bit number 29 * b = bit number
@@ -38,83 +38,89 @@ extern volatile unsigned long *port_csp4_addr;
38#undef CONFIG_ETRAX_PA_LEDS 38#undef CONFIG_ETRAX_PA_LEDS
39#undef CONFIG_ETRAX_PB_LEDS 39#undef CONFIG_ETRAX_PB_LEDS
40#undef CONFIG_ETRAX_CSP0_LEDS 40#undef CONFIG_ETRAX_CSP0_LEDS
41#define LED_NETWORK_SET_G(x) 41#define CRIS_LED_NETWORK_SET_G(x)
42#define LED_NETWORK_SET_R(x) 42#define CRIS_LED_NETWORK_SET_R(x)
43#define LED_ACTIVE_SET_G(x) 43#define CRIS_LED_ACTIVE_SET_G(x)
44#define LED_ACTIVE_SET_R(x) 44#define CRIS_LED_ACTIVE_SET_R(x)
45#define LED_DISK_WRITE(x) 45#define CRIS_LED_DISK_WRITE(x)
46#define LED_DISK_READ(x) 46#define CRIS_LED_DISK_READ(x)
47#endif 47#endif
48 48
49#if !defined(CONFIG_ETRAX_CSP0_LEDS) 49#if !defined(CONFIG_ETRAX_CSP0_LEDS)
50#define LED_BIT_SET(x) 50#define CRIS_LED_BIT_SET(x)
51#define LED_BIT_CLR(x) 51#define CRIS_LED_BIT_CLR(x)
52#endif 52#endif
53 53
54#define LED_OFF 0x00 54#define CRIS_LED_OFF 0x00
55#define LED_GREEN 0x01 55#define CRIS_LED_GREEN 0x01
56#define LED_RED 0x02 56#define CRIS_LED_RED 0x02
57#define LED_ORANGE (LED_GREEN | LED_RED) 57#define CRIS_LED_ORANGE (CRIS_LED_GREEN | CRIS_LED_RED)
58 58
59#if CONFIG_ETRAX_LED1G == CONFIG_ETRAX_LED1R 59#if defined(CONFIG_ETRAX_NO_LEDS)
60#define LED_NETWORK_SET(x) \ 60#define CRIS_LED_NETWORK_SET(x)
61#else
62#if CONFIG_ETRAX_LED1G == CONFIG_ETRAX_LED1R
63#define CRIS_LED_NETWORK_SET(x) \
61 do { \ 64 do { \
62 LED_NETWORK_SET_G((x) & LED_GREEN); \ 65 CRIS_LED_NETWORK_SET_G((x) & CRIS_LED_GREEN); \
63 } while (0) 66 } while (0)
64#else 67#else
65#define LED_NETWORK_SET(x) \ 68#define CRIS_LED_NETWORK_SET(x) \
66 do { \ 69 do { \
67 LED_NETWORK_SET_G((x) & LED_GREEN); \ 70 CRIS_LED_NETWORK_SET_G((x) & CRIS_LED_GREEN); \
68 LED_NETWORK_SET_R((x) & LED_RED); \ 71 CRIS_LED_NETWORK_SET_R((x) & CRIS_LED_RED); \
69 } while (0) 72 } while (0)
70#endif 73#endif
71#if CONFIG_ETRAX_LED2G == CONFIG_ETRAX_LED2R 74#if CONFIG_ETRAX_LED2G == CONFIG_ETRAX_LED2R
72#define LED_ACTIVE_SET(x) \ 75#define CRIS_LED_ACTIVE_SET(x) \
73 do { \ 76 do { \
74 LED_ACTIVE_SET_G((x) & LED_GREEN); \ 77 CRIS_LED_ACTIVE_SET_G((x) & CRIS_LED_GREEN); \
75 } while (0) 78 } while (0)
76#else 79#else
77#define LED_ACTIVE_SET(x) \ 80#define CRIS_LED_ACTIVE_SET(x) \
78 do { \ 81 do { \
79 LED_ACTIVE_SET_G((x) & LED_GREEN); \ 82 CRIS_LED_ACTIVE_SET_G((x) & CRIS_LED_GREEN); \
80 LED_ACTIVE_SET_R((x) & LED_RED); \ 83 CRIS_LED_ACTIVE_SET_R((x) & CRIS_LED_RED); \
81 } while (0) 84 } while (0)
82#endif 85#endif
86#endif
83 87
84#ifdef CONFIG_ETRAX_PA_LEDS 88#ifdef CONFIG_ETRAX_PA_LEDS
85#define LED_NETWORK_SET_G(x) \ 89#define CRIS_LED_NETWORK_SET_G(x) \
86 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED1G, !(x)) 90 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED1G, !(x))
87#define LED_NETWORK_SET_R(x) \ 91#define CRIS_LED_NETWORK_SET_R(x) \
88 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED1R, !(x)) 92 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED1R, !(x))
89#define LED_ACTIVE_SET_G(x) \ 93#define CRIS_LED_ACTIVE_SET_G(x) \
90 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED2G, !(x)) 94 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED2G, !(x))
91#define LED_ACTIVE_SET_R(x) \ 95#define CRIS_LED_ACTIVE_SET_R(x) \
92 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED2R, !(x)) 96 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED2R, !(x))
93#define LED_DISK_WRITE(x) \ 97#define CRIS_LED_DISK_WRITE(x) \
94 do{\ 98 do{\
95 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED3G, !(x));\ 99 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED3G, !(x));\
96 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED3R, !(x));\ 100 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED3R, !(x));\
97 }while(0) 101 }while(0)
98#define LED_DISK_READ(x) \ 102#define CRIS_LED_DISK_READ(x) \
99 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, CONFIG_ETRAX_LED3G, !(x)) 103 REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, \
104 CONFIG_ETRAX_LED3G, !(x))
100#endif 105#endif
101 106
102#ifdef CONFIG_ETRAX_PB_LEDS 107#ifdef CONFIG_ETRAX_PB_LEDS
103#define LED_NETWORK_SET_G(x) \ 108#define CRIS_LED_NETWORK_SET_G(x) \
104 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED1G, !(x)) 109 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED1G, !(x))
105#define LED_NETWORK_SET_R(x) \ 110#define CRIS_LED_NETWORK_SET_R(x) \
106 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED1R, !(x)) 111 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED1R, !(x))
107#define LED_ACTIVE_SET_G(x) \ 112#define CRIS_LED_ACTIVE_SET_G(x) \
108 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED2G, !(x)) 113 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED2G, !(x))
109#define LED_ACTIVE_SET_R(x) \ 114#define CRIS_LED_ACTIVE_SET_R(x) \
110 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED2R, !(x)) 115 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED2R, !(x))
111#define LED_DISK_WRITE(x) \ 116#define CRIS_LED_DISK_WRITE(x) \
112 do{\ 117 do{\
113 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED3G, !(x));\ 118 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED3G, !(x));\
114 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED3R, !(x));\ 119 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED3R, !(x));\
115 }while(0) 120 }while(0)
116#define LED_DISK_READ(x) \ 121#define CRIS_LED_DISK_READ(x) \
117 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, CONFIG_ETRAX_LED3G, !(x)) 122 REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, \
123 CONFIG_ETRAX_LED3G, !(x))
118#endif 124#endif
119 125
120#ifdef CONFIG_ETRAX_CSP0_LEDS 126#ifdef CONFIG_ETRAX_CSP0_LEDS
@@ -130,27 +136,27 @@ extern volatile unsigned long *port_csp4_addr;
130 (1 << CONFIG_ETRAX_LED10Y ) |(1 << CONFIG_ETRAX_LED11Y )|\ 136 (1 << CONFIG_ETRAX_LED10Y ) |(1 << CONFIG_ETRAX_LED11Y )|\
131 (1 << CONFIG_ETRAX_LED12R )) 137 (1 << CONFIG_ETRAX_LED12R ))
132 138
133#define LED_NETWORK_SET_G(x) \ 139#define CRIS_LED_NETWORK_SET_G(x) \
134 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED1G, !(x)) 140 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED1G, !(x))
135#define LED_NETWORK_SET_R(x) \ 141#define CRIS_LED_NETWORK_SET_R(x) \
136 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED1R, !(x)) 142 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED1R, !(x))
137#define LED_ACTIVE_SET_G(x) \ 143#define CRIS_LED_ACTIVE_SET_G(x) \
138 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED2G, !(x)) 144 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED2G, !(x))
139#define LED_ACTIVE_SET_R(x) \ 145#define CRIS_LED_ACTIVE_SET_R(x) \
140 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED2R, !(x)) 146 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED2R, !(x))
141#define LED_DISK_WRITE(x) \ 147#define CRIS_LED_DISK_WRITE(x) \
142 do{\ 148 do{\
143 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED3G, !(x));\ 149 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED3G, !(x));\
144 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED3R, !(x));\ 150 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED3R, !(x));\
145 }while(0) 151 }while(0)
146#define LED_DISK_READ(x) \ 152#define CRIS_LED_DISK_READ(x) \
147 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED3G, !(x)) 153 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, CONFIG_ETRAX_LED3G, !(x))
148#define LED_BIT_SET(x)\ 154#define CRIS_LED_BIT_SET(x)\
149 do{\ 155 do{\
150 if((( 1 << x) & CONFIGURABLE_LEDS) != 0)\ 156 if((( 1 << x) & CONFIGURABLE_LEDS) != 0)\
151 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, x, 1);\ 157 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, x, 1);\
152 }while(0) 158 }while(0)
153#define LED_BIT_CLR(x)\ 159#define CRIS_LED_BIT_CLR(x)\
154 do{\ 160 do{\
155 if((( 1 << x) & CONFIGURABLE_LEDS) != 0)\ 161 if((( 1 << x) & CONFIGURABLE_LEDS) != 0)\
156 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, x, 0);\ 162 REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, x, 0);\
diff --git a/include/asm-cris/arch-v10/page.h b/include/asm-cris/arch-v10/page.h
index 7d8307aed7f3..ffafc99c3472 100644
--- a/include/asm-cris/arch-v10/page.h
+++ b/include/asm-cris/arch-v10/page.h
@@ -12,8 +12,8 @@
12#endif 12#endif
13 13
14/* macros to convert between really physical and virtual addresses 14/* macros to convert between really physical and virtual addresses
15 * by stripping a selected bit, we can convert between KSEG_x and 0x40000000 where 15 * by stripping a selected bit, we can convert between KSEG_x and
16 * the DRAM really resides 16 * 0x40000000 where the DRAM really resides
17 */ 17 */
18 18
19#ifdef CONFIG_CRIS_LOW_MAP 19#ifdef CONFIG_CRIS_LOW_MAP
diff --git a/include/asm-cris/arch-v32/Kbuild b/include/asm-cris/arch-v32/Kbuild
index d7f27dc0941a..a0ec545e242e 100644
--- a/include/asm-cris/arch-v32/Kbuild
+++ b/include/asm-cris/arch-v32/Kbuild
@@ -1,2 +1,3 @@
1header-y += ptrace.h 1header-y += ptrace.h
2header-y += user.h 2header-y += user.h
3header-y += cryptocop.h
diff --git a/include/asm-cris/arch-v32/atomic.h b/include/asm-cris/arch-v32/atomic.h
index bbfb7a5ae315..852ceff8013f 100644
--- a/include/asm-cris/arch-v32/atomic.h
+++ b/include/asm-cris/arch-v32/atomic.h
@@ -1,7 +1,7 @@
1#ifndef __ASM_CRIS_ARCH_ATOMIC__ 1#ifndef __ASM_CRIS_ARCH_ATOMIC__
2#define __ASM_CRIS_ARCH_ATOMIC__ 2#define __ASM_CRIS_ARCH_ATOMIC__
3 3
4#include <asm/system.h> 4#include <linux/spinlock_types.h>
5 5
6extern void cris_spin_unlock(void *l, int val); 6extern void cris_spin_unlock(void *l, int val);
7extern void cris_spin_lock(void *l); 7extern void cris_spin_lock(void *l);
@@ -18,15 +18,15 @@ extern spinlock_t cris_atomic_locks[];
18 18
19#define cris_atomic_save(addr, flags) \ 19#define cris_atomic_save(addr, flags) \
20 local_irq_save(flags); \ 20 local_irq_save(flags); \
21 cris_spin_lock((void*)&cris_atomic_locks[HASH_ADDR(addr)].lock); 21 cris_spin_lock((void *)&cris_atomic_locks[HASH_ADDR(addr)].raw_lock.slock);
22 22
23#define cris_atomic_restore(addr, flags) \ 23#define cris_atomic_restore(addr, flags) \
24 { \ 24 { \
25 spinlock_t *lock = (void*)&cris_atomic_locks[HASH_ADDR(addr)]; \ 25 spinlock_t *lock = (void*)&cris_atomic_locks[HASH_ADDR(addr)]; \
26 __asm__ volatile ("move.d %1,%0" \ 26 __asm__ volatile ("move.d %1,%0" \
27 : "=m" (lock->lock) \ 27 : "=m" (lock->raw_lock.slock) \
28 : "r" (1) \ 28 : "r" (1) \
29 : "memory"); \ 29 : "memory"); \
30 local_irq_restore(flags); \ 30 local_irq_restore(flags); \
31 } 31 }
32 32
diff --git a/include/asm-cris/arch-v32/bug.h b/include/asm-cris/arch-v32/bug.h
new file mode 100644
index 000000000000..0f211e135248
--- /dev/null
+++ b/include/asm-cris/arch-v32/bug.h
@@ -0,0 +1,33 @@
1#ifndef __ASM_CRISv32_ARCH_BUG_H
2#define __ASM_CRISv32_ARCH_BUG_H
3
4#include <linux/stringify.h>
5
6#ifdef CONFIG_BUG
7#ifdef CONFIG_DEBUG_BUGVERBOSE
8/*
9 * The penalty for the in-band code path will be the size of break 14.
10 * All other stuff is done out-of-band with exception handlers.
11 */
12#define BUG() \
13 __asm__ __volatile__ ("0: break 14\n\t" \
14 ".section .fixup,\"ax\"\n" \
15 "1:\n\t" \
16 "move.d %0, $r10\n\t" \
17 "move.d %1, $r11\n\t" \
18 "jump do_BUG\n\t" \
19 "nop\n\t" \
20 ".previous\n\t" \
21 ".section __ex_table,\"a\"\n\t" \
22 ".dword 0b, 1b\n\t" \
23 ".previous\n\t" \
24 : : "ri" (__FILE__), "i" (__LINE__))
25#else
26#define BUG() __asm__ __volatile__ ("break 14\n\t")
27#endif
28
29#define HAVE_ARCH_BUG
30#endif
31
32#include <asm-generic/bug.h>
33#endif
diff --git a/include/asm-cris/arch-v32/cache.h b/include/asm-cris/arch-v32/cache.h
index 80b236b15319..b3d752dfe15b 100644
--- a/include/asm-cris/arch-v32/cache.h
+++ b/include/asm-cris/arch-v32/cache.h
@@ -1,8 +1,19 @@
1#ifndef _ASM_CRIS_ARCH_CACHE_H 1#ifndef _ASM_CRIS_ARCH_CACHE_H
2#define _ASM_CRIS_ARCH_CACHE_H 2#define _ASM_CRIS_ARCH_CACHE_H
3 3
4#include <asm/arch/hwregs/dma.h>
5
4/* A cache-line is 32 bytes. */ 6/* A cache-line is 32 bytes. */
5#define L1_CACHE_BYTES 32 7#define L1_CACHE_BYTES 32
6#define L1_CACHE_SHIFT 5 8#define L1_CACHE_SHIFT 5
7 9
10void flush_dma_list(dma_descr_data *descr);
11void flush_dma_descr(dma_descr_data *descr, int flush_buf);
12
13#define flush_dma_context(c) \
14 flush_dma_list(phys_to_virt((c)->saved_data));
15
16void cris_flush_cache_range(void *buf, unsigned long len);
17void cris_flush_cache(void);
18
8#endif /* _ASM_CRIS_ARCH_CACHE_H */ 19#endif /* _ASM_CRIS_ARCH_CACHE_H */
diff --git a/include/asm-cris/arch-v32/delay.h b/include/asm-cris/arch-v32/delay.h
index b6e941e637de..e9fda03810a9 100644
--- a/include/asm-cris/arch-v32/delay.h
+++ b/include/asm-cris/arch-v32/delay.h
@@ -1,6 +1,16 @@
1#ifndef _ASM_CRIS_ARCH_DELAY_H 1#ifndef _ASM_CRIS_ARCH_DELAY_H
2#define _ASM_CRIS_ARCH_DELAY_H 2#define _ASM_CRIS_ARCH_DELAY_H
3 3
4extern void cris_delay10ns(u32 n10ns);
5#define udelay(u) cris_delay10ns((u)*100)
6#define ndelay(n) cris_delay10ns(((n)+9)/10)
7
8/*
9 * Not used anymore for udelay or ndelay. Referenced by
10 * e.g. init/calibrate.c. All other references are likely bugs;
11 * should be replaced by mdelay, udelay or ndelay.
12 */
13
4static inline void 14static inline void
5__delay(int loops) 15__delay(int loops)
6{ 16{
diff --git a/include/asm-cris/arch-v32/hwregs/Makefile b/include/asm-cris/arch-v32/hwregs/Makefile
index c9160f9949a9..f9a05d2aa061 100644
--- a/include/asm-cris/arch-v32/hwregs/Makefile
+++ b/include/asm-cris/arch-v32/hwregs/Makefile
@@ -1,4 +1,3 @@
1# $Id: Makefile,v 1.8 2004/01/07 21:16:18 johana Exp $
2# Makefile to generate or copy the latest register definitions 1# Makefile to generate or copy the latest register definitions
3# and related datastructures and helpermacros. 2# and related datastructures and helpermacros.
4# The offical place for these files is at: 3# The offical place for these files is at:
diff --git a/include/asm-cris/arch-v32/hwregs/dma.h b/include/asm-cris/arch-v32/hwregs/dma.h
index c31832d3d6be..3ce322b5c731 100644
--- a/include/asm-cris/arch-v32/hwregs/dma.h
+++ b/include/asm-cris/arch-v32/hwregs/dma.h
@@ -1,5 +1,4 @@
1/* $Id: dma.h,v 1.7 2005/04/24 18:30:58 starvik Exp $ 1/*
2 *
3 * DMA C definitions and help macros 2 * DMA C definitions and help macros
4 * 3 *
5 */ 4 */
@@ -98,11 +97,11 @@ typedef struct dma_descr_data {
98 97
99// give stream command 98// give stream command
100#define DMA_WR_CMD( inst, cmd_par ) \ 99#define DMA_WR_CMD( inst, cmd_par ) \
101 do { reg_dma_rw_stream_cmd r = {0}; \ 100 do { reg_dma_rw_stream_cmd __x = {0}; \
102 do { r = REG_RD( dma, inst, rw_stream_cmd ); } while( r.busy ); \ 101 do { __x = REG_RD(dma, inst, rw_stream_cmd); } while (__x.busy); \
103 r.cmd = (cmd_par); \ 102 __x.cmd = (cmd_par); \
104 REG_WR( dma, inst, rw_stream_cmd, r ); \ 103 REG_WR(dma, inst, rw_stream_cmd, __x); \
105 } while( 0 ) 104 } while (0)
106 105
107// load: g,c,d:burst 106// load: g,c,d:burst
108#define DMA_START_GROUP( inst, group_descr ) \ 107#define DMA_START_GROUP( inst, group_descr ) \
diff --git a/include/asm-cris/arch-v32/hwregs/eth_defs.h b/include/asm-cris/arch-v32/hwregs/eth_defs.h
index 1196d7cc783f..90fe8a28894f 100644
--- a/include/asm-cris/arch-v32/hwregs/eth_defs.h
+++ b/include/asm-cris/arch-v32/hwregs/eth_defs.h
@@ -3,12 +3,12 @@
3 3
4/* 4/*
5 * This file is autogenerated from 5 * This file is autogenerated from
6 * file: ../../inst/eth/rtl/eth_regs.r 6 * file: eth.r
7 * id: eth_regs.r,v 1.11 2005/02/09 10:48:38 kriskn Exp 7 * id: eth_regs.r,v 1.16 2005/05/20 15:41:22 perz Exp
8 * last modfied: Mon Apr 11 16:07:03 2005 8 * last modfied: Mon Jan 9 06:06:41 2006
9 * 9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile eth_defs.h ../../inst/eth/rtl/eth_regs.r 10 * by /n/asic/design/tools/rdesc/rdes2c eth.r
11 * id: $Id: eth_defs.h,v 1.6 2005/04/24 18:30:58 starvik Exp $ 11 * id: $Id: eth_defs.h,v 1.7 2006/01/26 13:45:30 karljope Exp $
12 * Any changes here will be lost. 12 * Any changes here will be lost.
13 * 13 *
14 * -*- buffer-read-only: t -*- 14 * -*- buffer-read-only: t -*-
@@ -116,26 +116,28 @@ typedef struct {
116 116
117/* Register rw_ga_lo, scope eth, type rw */ 117/* Register rw_ga_lo, scope eth, type rw */
118typedef struct { 118typedef struct {
119 unsigned int table : 32; 119 unsigned int tbl : 32;
120} reg_eth_rw_ga_lo; 120} reg_eth_rw_ga_lo;
121#define REG_RD_ADDR_eth_rw_ga_lo 16 121#define REG_RD_ADDR_eth_rw_ga_lo 16
122#define REG_WR_ADDR_eth_rw_ga_lo 16 122#define REG_WR_ADDR_eth_rw_ga_lo 16
123 123
124/* Register rw_ga_hi, scope eth, type rw */ 124/* Register rw_ga_hi, scope eth, type rw */
125typedef struct { 125typedef struct {
126 unsigned int table : 32; 126 unsigned int tbl : 32;
127} reg_eth_rw_ga_hi; 127} reg_eth_rw_ga_hi;
128#define REG_RD_ADDR_eth_rw_ga_hi 20 128#define REG_RD_ADDR_eth_rw_ga_hi 20
129#define REG_WR_ADDR_eth_rw_ga_hi 20 129#define REG_WR_ADDR_eth_rw_ga_hi 20
130 130
131/* Register rw_gen_ctrl, scope eth, type rw */ 131/* Register rw_gen_ctrl, scope eth, type rw */
132typedef struct { 132typedef struct {
133 unsigned int en : 1; 133 unsigned int en : 1;
134 unsigned int phy : 2; 134 unsigned int phy : 2;
135 unsigned int protocol : 1; 135 unsigned int protocol : 1;
136 unsigned int loopback : 1; 136 unsigned int loopback : 1;
137 unsigned int flow_ctrl_dis : 1; 137 unsigned int flow_ctrl : 1;
138 unsigned int dummy1 : 26; 138 unsigned int gtxclk_out : 1;
139 unsigned int phyrst_n : 1;
140 unsigned int dummy1 : 24;
139} reg_eth_rw_gen_ctrl; 141} reg_eth_rw_gen_ctrl;
140#define REG_RD_ADDR_eth_rw_gen_ctrl 24 142#define REG_RD_ADDR_eth_rw_gen_ctrl 24
141#define REG_WR_ADDR_eth_rw_gen_ctrl 24 143#define REG_WR_ADDR_eth_rw_gen_ctrl 24
@@ -150,22 +152,23 @@ typedef struct {
150 unsigned int oversize : 1; 152 unsigned int oversize : 1;
151 unsigned int bad_crc : 1; 153 unsigned int bad_crc : 1;
152 unsigned int duplex : 1; 154 unsigned int duplex : 1;
153 unsigned int max_size : 1; 155 unsigned int max_size : 16;
154 unsigned int dummy1 : 23; 156 unsigned int dummy1 : 8;
155} reg_eth_rw_rec_ctrl; 157} reg_eth_rw_rec_ctrl;
156#define REG_RD_ADDR_eth_rw_rec_ctrl 28 158#define REG_RD_ADDR_eth_rw_rec_ctrl 28
157#define REG_WR_ADDR_eth_rw_rec_ctrl 28 159#define REG_WR_ADDR_eth_rw_rec_ctrl 28
158 160
159/* Register rw_tr_ctrl, scope eth, type rw */ 161/* Register rw_tr_ctrl, scope eth, type rw */
160typedef struct { 162typedef struct {
161 unsigned int crc : 1; 163 unsigned int crc : 1;
162 unsigned int pad : 1; 164 unsigned int pad : 1;
163 unsigned int retry : 1; 165 unsigned int retry : 1;
164 unsigned int ignore_col : 1; 166 unsigned int ignore_col : 1;
165 unsigned int cancel : 1; 167 unsigned int cancel : 1;
166 unsigned int hsh_delay : 1; 168 unsigned int hsh_delay : 1;
167 unsigned int ignore_crs : 1; 169 unsigned int ignore_crs : 1;
168 unsigned int dummy1 : 25; 170 unsigned int carrier_ext : 1;
171 unsigned int dummy1 : 24;
169} reg_eth_rw_tr_ctrl; 172} reg_eth_rw_tr_ctrl;
170#define REG_RD_ADDR_eth_rw_tr_ctrl 32 173#define REG_RD_ADDR_eth_rw_tr_ctrl 32
171#define REG_WR_ADDR_eth_rw_tr_ctrl 32 174#define REG_WR_ADDR_eth_rw_tr_ctrl 32
@@ -180,13 +183,10 @@ typedef struct {
180 183
181/* Register rw_mgm_ctrl, scope eth, type rw */ 184/* Register rw_mgm_ctrl, scope eth, type rw */
182typedef struct { 185typedef struct {
183 unsigned int mdio : 1; 186 unsigned int mdio : 1;
184 unsigned int mdoe : 1; 187 unsigned int mdoe : 1;
185 unsigned int mdc : 1; 188 unsigned int mdc : 1;
186 unsigned int phyclk : 1; 189 unsigned int dummy1 : 29;
187 unsigned int txdata : 4;
188 unsigned int txen : 1;
189 unsigned int dummy1 : 23;
190} reg_eth_rw_mgm_ctrl; 190} reg_eth_rw_mgm_ctrl;
191#define REG_RD_ADDR_eth_rw_mgm_ctrl 40 191#define REG_RD_ADDR_eth_rw_mgm_ctrl 40
192#define REG_WR_ADDR_eth_rw_mgm_ctrl 40 192#define REG_WR_ADDR_eth_rw_mgm_ctrl 40
@@ -196,17 +196,8 @@ typedef struct {
196 unsigned int mdio : 1; 196 unsigned int mdio : 1;
197 unsigned int exc_col : 1; 197 unsigned int exc_col : 1;
198 unsigned int urun : 1; 198 unsigned int urun : 1;
199 unsigned int phyclk : 1; 199 unsigned int clk_125 : 1;
200 unsigned int txdata : 4; 200 unsigned int dummy1 : 28;
201 unsigned int txen : 1;
202 unsigned int col : 1;
203 unsigned int crs : 1;
204 unsigned int txclk : 1;
205 unsigned int rxdata : 4;
206 unsigned int rxer : 1;
207 unsigned int rxdv : 1;
208 unsigned int rxclk : 1;
209 unsigned int dummy1 : 13;
210} reg_eth_r_stat; 201} reg_eth_r_stat;
211#define REG_RD_ADDR_eth_r_stat 44 202#define REG_RD_ADDR_eth_r_stat 44
212 203
@@ -274,83 +265,83 @@ typedef struct {
274 265
275/* Register rw_intr_mask, scope eth, type rw */ 266/* Register rw_intr_mask, scope eth, type rw */
276typedef struct { 267typedef struct {
277 unsigned int crc : 1; 268 unsigned int crc : 1;
278 unsigned int align : 1; 269 unsigned int align : 1;
279 unsigned int oversize : 1; 270 unsigned int oversize : 1;
280 unsigned int congestion : 1; 271 unsigned int congestion : 1;
281 unsigned int single_col : 1; 272 unsigned int single_col : 1;
282 unsigned int mult_col : 1; 273 unsigned int mult_col : 1;
283 unsigned int late_col : 1; 274 unsigned int late_col : 1;
284 unsigned int deferred : 1; 275 unsigned int deferred : 1;
285 unsigned int carrier_loss : 1; 276 unsigned int carrier_loss : 1;
286 unsigned int sqe_test_err : 1; 277 unsigned int sqe_test_err : 1;
287 unsigned int orun : 1; 278 unsigned int orun : 1;
288 unsigned int urun : 1; 279 unsigned int urun : 1;
289 unsigned int excessive_col : 1; 280 unsigned int exc_col : 1;
290 unsigned int mdio : 1; 281 unsigned int mdio : 1;
291 unsigned int dummy1 : 18; 282 unsigned int dummy1 : 18;
292} reg_eth_rw_intr_mask; 283} reg_eth_rw_intr_mask;
293#define REG_RD_ADDR_eth_rw_intr_mask 76 284#define REG_RD_ADDR_eth_rw_intr_mask 76
294#define REG_WR_ADDR_eth_rw_intr_mask 76 285#define REG_WR_ADDR_eth_rw_intr_mask 76
295 286
296/* Register rw_ack_intr, scope eth, type rw */ 287/* Register rw_ack_intr, scope eth, type rw */
297typedef struct { 288typedef struct {
298 unsigned int crc : 1; 289 unsigned int crc : 1;
299 unsigned int align : 1; 290 unsigned int align : 1;
300 unsigned int oversize : 1; 291 unsigned int oversize : 1;
301 unsigned int congestion : 1; 292 unsigned int congestion : 1;
302 unsigned int single_col : 1; 293 unsigned int single_col : 1;
303 unsigned int mult_col : 1; 294 unsigned int mult_col : 1;
304 unsigned int late_col : 1; 295 unsigned int late_col : 1;
305 unsigned int deferred : 1; 296 unsigned int deferred : 1;
306 unsigned int carrier_loss : 1; 297 unsigned int carrier_loss : 1;
307 unsigned int sqe_test_err : 1; 298 unsigned int sqe_test_err : 1;
308 unsigned int orun : 1; 299 unsigned int orun : 1;
309 unsigned int urun : 1; 300 unsigned int urun : 1;
310 unsigned int excessive_col : 1; 301 unsigned int exc_col : 1;
311 unsigned int mdio : 1; 302 unsigned int mdio : 1;
312 unsigned int dummy1 : 18; 303 unsigned int dummy1 : 18;
313} reg_eth_rw_ack_intr; 304} reg_eth_rw_ack_intr;
314#define REG_RD_ADDR_eth_rw_ack_intr 80 305#define REG_RD_ADDR_eth_rw_ack_intr 80
315#define REG_WR_ADDR_eth_rw_ack_intr 80 306#define REG_WR_ADDR_eth_rw_ack_intr 80
316 307
317/* Register r_intr, scope eth, type r */ 308/* Register r_intr, scope eth, type r */
318typedef struct { 309typedef struct {
319 unsigned int crc : 1; 310 unsigned int crc : 1;
320 unsigned int align : 1; 311 unsigned int align : 1;
321 unsigned int oversize : 1; 312 unsigned int oversize : 1;
322 unsigned int congestion : 1; 313 unsigned int congestion : 1;
323 unsigned int single_col : 1; 314 unsigned int single_col : 1;
324 unsigned int mult_col : 1; 315 unsigned int mult_col : 1;
325 unsigned int late_col : 1; 316 unsigned int late_col : 1;
326 unsigned int deferred : 1; 317 unsigned int deferred : 1;
327 unsigned int carrier_loss : 1; 318 unsigned int carrier_loss : 1;
328 unsigned int sqe_test_err : 1; 319 unsigned int sqe_test_err : 1;
329 unsigned int orun : 1; 320 unsigned int orun : 1;
330 unsigned int urun : 1; 321 unsigned int urun : 1;
331 unsigned int excessive_col : 1; 322 unsigned int exc_col : 1;
332 unsigned int mdio : 1; 323 unsigned int mdio : 1;
333 unsigned int dummy1 : 18; 324 unsigned int dummy1 : 18;
334} reg_eth_r_intr; 325} reg_eth_r_intr;
335#define REG_RD_ADDR_eth_r_intr 84 326#define REG_RD_ADDR_eth_r_intr 84
336 327
337/* Register r_masked_intr, scope eth, type r */ 328/* Register r_masked_intr, scope eth, type r */
338typedef struct { 329typedef struct {
339 unsigned int crc : 1; 330 unsigned int crc : 1;
340 unsigned int align : 1; 331 unsigned int align : 1;
341 unsigned int oversize : 1; 332 unsigned int oversize : 1;
342 unsigned int congestion : 1; 333 unsigned int congestion : 1;
343 unsigned int single_col : 1; 334 unsigned int single_col : 1;
344 unsigned int mult_col : 1; 335 unsigned int mult_col : 1;
345 unsigned int late_col : 1; 336 unsigned int late_col : 1;
346 unsigned int deferred : 1; 337 unsigned int deferred : 1;
347 unsigned int carrier_loss : 1; 338 unsigned int carrier_loss : 1;
348 unsigned int sqe_test_err : 1; 339 unsigned int sqe_test_err : 1;
349 unsigned int orun : 1; 340 unsigned int orun : 1;
350 unsigned int urun : 1; 341 unsigned int urun : 1;
351 unsigned int excessive_col : 1; 342 unsigned int exc_col : 1;
352 unsigned int mdio : 1; 343 unsigned int mdio : 1;
353 unsigned int dummy1 : 18; 344 unsigned int dummy1 : 18;
354} reg_eth_r_masked_intr; 345} reg_eth_r_masked_intr;
355#define REG_RD_ADDR_eth_r_masked_intr 88 346#define REG_RD_ADDR_eth_r_masked_intr 88
356 347
@@ -360,12 +351,15 @@ enum {
360 regk_eth_discard = 0x00000000, 351 regk_eth_discard = 0x00000000,
361 regk_eth_ether = 0x00000000, 352 regk_eth_ether = 0x00000000,
362 regk_eth_full = 0x00000001, 353 regk_eth_full = 0x00000001,
354 regk_eth_gmii = 0x00000003,
355 regk_eth_gtxclk = 0x00000001,
363 regk_eth_half = 0x00000000, 356 regk_eth_half = 0x00000000,
364 regk_eth_hsh = 0x00000001, 357 regk_eth_hsh = 0x00000001,
365 regk_eth_mii = 0x00000001, 358 regk_eth_mii = 0x00000001,
359 regk_eth_mii_arec = 0x00000002,
366 regk_eth_mii_clk = 0x00000000, 360 regk_eth_mii_clk = 0x00000000,
367 regk_eth_mii_rec = 0x00000002,
368 regk_eth_no = 0x00000000, 361 regk_eth_no = 0x00000000,
362 regk_eth_phyrst = 0x00000000,
369 regk_eth_rec = 0x00000001, 363 regk_eth_rec = 0x00000001,
370 regk_eth_rw_ga_hi_default = 0x00000000, 364 regk_eth_rw_ga_hi_default = 0x00000000,
371 regk_eth_rw_ga_lo_default = 0x00000000, 365 regk_eth_rw_ga_lo_default = 0x00000000,
@@ -377,8 +371,8 @@ enum {
377 regk_eth_rw_ma1_lo_default = 0x00000000, 371 regk_eth_rw_ma1_lo_default = 0x00000000,
378 regk_eth_rw_mgm_ctrl_default = 0x00000000, 372 regk_eth_rw_mgm_ctrl_default = 0x00000000,
379 regk_eth_rw_test_ctrl_default = 0x00000000, 373 regk_eth_rw_test_ctrl_default = 0x00000000,
380 regk_eth_size1518 = 0x00000000, 374 regk_eth_size1518 = 0x000005ee,
381 regk_eth_size1522 = 0x00000001, 375 regk_eth_size1522 = 0x000005f2,
382 regk_eth_yes = 0x00000001 376 regk_eth_yes = 0x00000001
383}; 377};
384#endif /* __eth_defs_h */ 378#endif /* __eth_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/reg_rdwr.h b/include/asm-cris/arch-v32/hwregs/reg_rdwr.h
index 44e60233c68f..236f91efe7e8 100644
--- a/include/asm-cris/arch-v32/hwregs/reg_rdwr.h
+++ b/include/asm-cris/arch-v32/hwregs/reg_rdwr.h
@@ -1,15 +1,17 @@
1/* $Id: reg_rdwr.h,v 1.6 2005/04/24 18:30:58 starvik Exp $ 1/*
2 *
3 * Read/write register macros used by *_defs.h 2 * Read/write register macros used by *_defs.h
4 */ 3 */
5 4
6#ifndef reg_rdwr_h 5#ifndef reg_rdwr_h
7#define reg_rdwr_h 6#define reg_rdwr_h
8 7
8#ifndef REG_READ
9#define REG_READ(type, addr) (*((volatile type *) (addr)))
10#endif
9 11
10#define REG_READ(type, addr) *((volatile type *) (addr)) 12#ifndef REG_WRITE
11
12#define REG_WRITE(type, addr, val) \ 13#define REG_WRITE(type, addr, val) \
13 do { *((volatile type *) (addr)) = (val); } while(0) 14 do { *((volatile type *) (addr)) = (val); } while(0)
15#endif
14 16
15#endif 17#endif
diff --git a/include/asm-cris/arch-v32/io.h b/include/asm-cris/arch-v32/io.h
index 5efe4d949001..6b38912f29ba 100644
--- a/include/asm-cris/arch-v32/io.h
+++ b/include/asm-cris/arch-v32/io.h
@@ -1,9 +1,10 @@
1#ifndef _ASM_ARCH_CRIS_IO_H 1#ifndef _ASM_ARCH_CRIS_IO_H
2#define _ASM_ARCH_CRIS_IO_H 2#define _ASM_ARCH_CRIS_IO_H
3 3
4#include <asm/arch/hwregs/reg_map.h> 4#include <linux/spinlock.h>
5#include <asm/arch/hwregs/reg_rdwr.h> 5#include <hwregs/reg_map.h>
6#include <asm/arch/hwregs/gio_defs.h> 6#include <hwregs/reg_rdwr.h>
7#include <hwregs/gio_defs.h>
7 8
8enum crisv32_io_dir 9enum crisv32_io_dir
9{ 10{
@@ -13,10 +14,11 @@ enum crisv32_io_dir
13 14
14struct crisv32_ioport 15struct crisv32_ioport
15{ 16{
16 unsigned long* oe; 17 volatile unsigned long *oe;
17 unsigned long* data; 18 volatile unsigned long *data;
18 unsigned long* data_in; 19 volatile unsigned long *data_in;
19 unsigned int pin_count; 20 unsigned int pin_count;
21 spinlock_t lock;
20}; 22};
21 23
22struct crisv32_iopin 24struct crisv32_iopin
@@ -34,22 +36,36 @@ extern struct crisv32_iopin crisv32_led2_red;
34extern struct crisv32_iopin crisv32_led3_green; 36extern struct crisv32_iopin crisv32_led3_green;
35extern struct crisv32_iopin crisv32_led3_red; 37extern struct crisv32_iopin crisv32_led3_red;
36 38
37static inline void crisv32_io_set(struct crisv32_iopin* iopin, 39extern struct crisv32_iopin crisv32_led_net0_green;
38 int val) 40extern struct crisv32_iopin crisv32_led_net0_red;
41extern struct crisv32_iopin crisv32_led_net1_green;
42extern struct crisv32_iopin crisv32_led_net1_red;
43
44static inline void crisv32_io_set(struct crisv32_iopin *iopin, int val)
39{ 45{
46 long flags;
47 spin_lock_irqsave(&iopin->port->lock, flags);
48
40 if (val) 49 if (val)
41 *iopin->port->data |= iopin->bit; 50 *iopin->port->data |= iopin->bit;
42 else 51 else
43 *iopin->port->data &= ~iopin->bit; 52 *iopin->port->data &= ~iopin->bit;
53
54 spin_unlock_irqrestore(&iopin->port->lock, flags);
44} 55}
45 56
46static inline void crisv32_io_set_dir(struct crisv32_iopin* iopin, 57static inline void crisv32_io_set_dir(struct crisv32_iopin* iopin,
47 enum crisv32_io_dir dir) 58 enum crisv32_io_dir dir)
48{ 59{
60 long flags;
61 spin_lock_irqsave(&iopin->port->lock, flags);
62
49 if (dir == crisv32_io_dir_in) 63 if (dir == crisv32_io_dir_in)
50 *iopin->port->oe &= ~iopin->bit; 64 *iopin->port->oe &= ~iopin->bit;
51 else 65 else
52 *iopin->port->oe |= iopin->bit; 66 *iopin->port->oe |= iopin->bit;
67
68 spin_unlock_irqrestore(&iopin->port->lock, flags);
53} 69}
54 70
55static inline int crisv32_io_rd(struct crisv32_iopin* iopin) 71static inline int crisv32_io_rd(struct crisv32_iopin* iopin)
@@ -60,38 +76,61 @@ static inline int crisv32_io_rd(struct crisv32_iopin* iopin)
60int crisv32_io_get(struct crisv32_iopin* iopin, 76int crisv32_io_get(struct crisv32_iopin* iopin,
61 unsigned int port, unsigned int pin); 77 unsigned int port, unsigned int pin);
62int crisv32_io_get_name(struct crisv32_iopin* iopin, 78int crisv32_io_get_name(struct crisv32_iopin* iopin,
63 char* name); 79 const char *name);
64 80
65#define LED_OFF 0x00 81#define CRIS_LED_OFF 0x00
66#define LED_GREEN 0x01 82#define CRIS_LED_GREEN 0x01
67#define LED_RED 0x02 83#define CRIS_LED_RED 0x02
68#define LED_ORANGE (LED_GREEN | LED_RED) 84#define CRIS_LED_ORANGE (CRIS_LED_GREEN | CRIS_LED_RED)
69 85
70#define LED_NETWORK_SET(x) \ 86#if (defined(CONFIG_ETRAX_NBR_LED_GRP_ONE) || defined(CONFIG_ETRAX_NBR_LED_GRP_TWO))
71 do { \ 87#define CRIS_LED_NETWORK_GRP0_SET(x) \
72 LED_NETWORK_SET_G((x) & LED_GREEN); \ 88 do { \
73 LED_NETWORK_SET_R((x) & LED_RED); \ 89 CRIS_LED_NETWORK_GRP0_SET_G((x) & CRIS_LED_GREEN); \
90 CRIS_LED_NETWORK_GRP0_SET_R((x) & CRIS_LED_RED); \
74 } while (0) 91 } while (0)
75#define LED_ACTIVE_SET(x) \ 92#else
93#define CRIS_LED_NETWORK_GRP0_SET(x) while (0) {}
94#endif
95
96#define CRIS_LED_NETWORK_GRP0_SET_G(x) \
97 crisv32_io_set(&crisv32_led_net0_green, !(x));
98
99#define CRIS_LED_NETWORK_GRP0_SET_R(x) \
100 crisv32_io_set(&crisv32_led_net0_red, !(x));
101
102#if defined(CONFIG_ETRAX_NBR_LED_GRP_TWO)
103#define CRIS_LED_NETWORK_GRP1_SET(x) \
104 do { \
105 CRIS_LED_NETWORK_GRP1_SET_G((x) & CRIS_LED_GREEN); \
106 CRIS_LED_NETWORK_GRP1_SET_R((x) & CRIS_LED_RED); \
107 } while (0)
108#else
109#define CRIS_LED_NETWORK_GRP1_SET(x) while (0) {}
110#endif
111
112#define CRIS_LED_NETWORK_GRP1_SET_G(x) \
113 crisv32_io_set(&crisv32_led_net1_green, !(x));
114
115#define CRIS_LED_NETWORK_GRP1_SET_R(x) \
116 crisv32_io_set(&crisv32_led_net1_red, !(x));
117
118#define CRIS_LED_ACTIVE_SET(x) \
76 do { \ 119 do { \
77 LED_ACTIVE_SET_G((x) & LED_GREEN); \ 120 CRIS_LED_ACTIVE_SET_G((x) & CRIS_LED_GREEN); \
78 LED_ACTIVE_SET_R((x) & LED_RED); \ 121 CRIS_LED_ACTIVE_SET_R((x) & CRIS_LED_RED); \
79 } while (0) 122 } while (0)
80 123
81#define LED_NETWORK_SET_G(x) \ 124#define CRIS_LED_ACTIVE_SET_G(x) \
82 crisv32_io_set(&crisv32_led1_green, !(x));
83#define LED_NETWORK_SET_R(x) \
84 crisv32_io_set(&crisv32_led1_red, !(x));
85#define LED_ACTIVE_SET_G(x) \
86 crisv32_io_set(&crisv32_led2_green, !(x)); 125 crisv32_io_set(&crisv32_led2_green, !(x));
87#define LED_ACTIVE_SET_R(x) \ 126#define CRIS_LED_ACTIVE_SET_R(x) \
88 crisv32_io_set(&crisv32_led2_red, !(x)); 127 crisv32_io_set(&crisv32_led2_red, !(x));
89#define LED_DISK_WRITE(x) \ 128#define CRIS_LED_DISK_WRITE(x) \
90 do{\ 129 do{\
91 crisv32_io_set(&crisv32_led3_green, !(x)); \ 130 crisv32_io_set(&crisv32_led3_green, !(x)); \
92 crisv32_io_set(&crisv32_led3_red, !(x)); \ 131 crisv32_io_set(&crisv32_led3_red, !(x)); \
93 }while(0) 132 }while(0)
94#define LED_DISK_READ(x) \ 133#define CRIS_LED_DISK_READ(x) \
95 crisv32_io_set(&crisv32_led3_green, !(x)); 134 crisv32_io_set(&crisv32_led3_green, !(x));
96 135
97#endif 136#endif
diff --git a/include/asm-cris/arch-v32/irq.h b/include/asm-cris/arch-v32/irq.h
index bac94ee6bc90..9e4c9fbdfddf 100644
--- a/include/asm-cris/arch-v32/irq.h
+++ b/include/asm-cris/arch-v32/irq.h
@@ -1,12 +1,17 @@
1#ifndef _ASM_ARCH_IRQ_H 1#ifndef _ASM_ARCH_IRQ_H
2#define _ASM_ARCH_IRQ_H 2#define _ASM_ARCH_IRQ_H
3 3
4#include "hwregs/intr_vect.h" 4#include <hwregs/intr_vect.h>
5 5
6/* Number of non-cpu interrupts. */ 6/* Number of non-cpu interrupts. */
7#define NR_IRQS 0x50 /* Exceptions + IRQs */ 7#define NR_IRQS NBR_INTR_VECT /* Exceptions + IRQs */
8#define NR_REAL_IRQS 0x20 /* IRQs */
9#define FIRST_IRQ 0x31 /* Exception number for first IRQ */ 8#define FIRST_IRQ 0x31 /* Exception number for first IRQ */
9#define NR_REAL_IRQS (NBR_INTR_VECT - FIRST_IRQ) /* IRQs */
10#if NR_REAL_IRQS > 32
11#define MACH_IRQS 64
12#else
13#define MACH_IRQS 32
14#endif
10 15
11#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
12/* Global IRQ vector. */ 17/* Global IRQ vector. */
@@ -73,7 +78,7 @@ void set_exception_vector(int n, irqvectptr addr);
73 * which will acknowledge the interrupt, is run. The actual blocking is made 78 * which will acknowledge the interrupt, is run. The actual blocking is made
74 * by crisv32_do_IRQ. 79 * by crisv32_do_IRQ.
75 */ 80 */
76#define BUILD_IRQ(nr, mask) \ 81#define BUILD_IRQ(nr) \
77void IRQ_NAME(nr); \ 82void IRQ_NAME(nr); \
78__asm__ ( \ 83__asm__ ( \
79 ".text\n\t" \ 84 ".text\n\t" \
@@ -81,7 +86,7 @@ __asm__ ( \
81 SAVE_ALL \ 86 SAVE_ALL \
82 KGDB_FIXUP \ 87 KGDB_FIXUP \
83 "move.d "#nr",$r10\n\t" \ 88 "move.d "#nr",$r10\n\t" \
84 "move.d $sp,$r12\n\t" \ 89 "move.d $sp, $r12\n\t" \
85 "jsr crisv32_do_IRQ\n\t" \ 90 "jsr crisv32_do_IRQ\n\t" \
86 "moveq 1, $r11\n\t" \ 91 "moveq 1, $r11\n\t" \
87 "jump ret_from_intr\n\t" \ 92 "jump ret_from_intr\n\t" \
diff --git a/include/asm-cris/arch-v32/juliette.h b/include/asm-cris/arch-v32/juliette.h
deleted file mode 100644
index f1f81725e57b..000000000000
--- a/include/asm-cris/arch-v32/juliette.h
+++ /dev/null
@@ -1,326 +0,0 @@
1#ifndef _ASM_JULIETTE_H
2#define _ASM_JULIETTE_H
3
4/* juliette _IOC_TYPE, bits 8 to 15 in ioctl cmd */
5
6#define JULIOCTYPE 42
7
8/* supported ioctl _IOC_NR's */
9
10#define JULSTARTDMA 0x1 /* start a picture asynchronously */
11
12/* set parameters */
13
14#define SETDEFAULT 0x2 /* CCD/VIDEO/SS1M */
15#define SETPARAMETERS 0x3 /* CCD/VIDEO */
16#define SETSIZE 0x4 /* CCD/VIDEO/SS1M */
17#define SETCOMPRESSION 0x5 /* CCD/VIDEO/SS1M */
18#define SETCOLORLEVEL 0x6 /* CCD/VIDEO */
19#define SETBRIGHTNESS 0x7 /* CCD */
20#define SETROTATION 0x8 /* CCD */
21#define SETTEXT 0x9 /* CCD/VIDEO/SS1M */
22#define SETCLOCK 0xa /* CCD/VIDEO/SS1M */
23#define SETDATE 0xb /* CCD/VIDEO/SS1M */
24#define SETTIMEFORMAT 0xc /* CCD/VIDEO/SS1M */
25#define SETDATEFORMAT 0xd /* VIDEO */
26#define SETTEXTALIGNMENT 0xe /* VIDEO */
27#define SETFPS 0xf /* CCD/VIDEO/SS1M */
28#define SETVGA 0xff /* VIDEO */
29#define SETCOMMENT 0xfe /* CCD/VIDEO */
30
31/* get parameters */
32
33#define GETDRIVERTYPE 0x10 /* CCD/VIDEO/SS1M */
34#define GETNBROFCAMERAS 0x11 /* CCD/VIDEO/SS1M */
35#define GETPARAMETERS 0x12 /* CCD/VIDEO/SS1M */
36#define GETBUFFERSIZE 0x13 /* CCD/VIDEO/SS1M */
37#define GETVIDEOTYPE 0x14 /* VIDEO/SS1M */
38#define GETVIDEOSIGNAL 0x15 /* VIDEO */
39#define GETMODULATION 0x16 /* VIDEO */
40#define GETDCYVALUES 0xa0 /* CCD /SS1M */
41#define GETDCYWIDTH 0xa1 /* CCD /SS1M */
42#define GETDCYHEIGHT 0xa2 /* CCD /SS1M */
43#define GETSIZE 0xa3 /* CCD/VIDEO */
44#define GETCOMPRESSION 0xa4 /* CCD/VIDEO */
45
46/* detect and get parameters */
47
48#define DETECTMODULATION 0x17 /* VIDEO */
49#define DETECTVIDEOTYPE 0x18 /* VIDEO */
50#define DETECTVIDEOSIGNAL 0x19 /* VIDEO */
51
52/* configure default parameters */
53
54#define CONFIGUREDEFAULT 0x20 /* CCD/VIDEO/SS1M */
55#define DEFSIZE 0x21 /* CCD/VIDEO/SS1M */
56#define DEFCOMPRESSION 0x22 /* CCD/VIDEO/SS1M */
57#define DEFCOLORLEVEL 0x23 /* CCD/VIDEO */
58#define DEFBRIGHTNESS 0x24 /* CCD */
59#define DEFROTATION 0x25 /* CCD */
60#define DEFWHITEBALANCE 0x26 /* CCD */
61#define DEFEXPOSURE 0x27 /* CCD */
62#define DEFAUTOEXPWINDOW 0x28 /* CCD */
63#define DEFTEXT 0x29 /* CCD/VIDEO/SS1M */
64#define DEFCLOCK 0x2a /* CCD/VIDEO/SS1M */
65#define DEFDATE 0x2b /* CCD/VIDEO/SS1M */
66#define DEFTIMEFORMAT 0x2c /* CCD/VIDEO/SS1M */
67#define DEFDATEFORMAT 0x2d /* VIDEO */
68#define DEFTEXTALIGNMENT 0x2e /* VIDEO */
69#define DEFFPS 0x2f /* CCD/VIDEO/SS1M */
70#define DEFTEXTSTRING 0x30 /* CCD/VIDEO/SS1M */
71#define DEFHEADERINFO 0x31 /* CCD/VIDEO/SS1M */
72#define DEFWEXAR 0x32 /* CCD */
73#define DEFLINEDELAY 0x33 /* CCD */
74#define DEFDISABLEDVIDEO 0x34 /* VIDEO */
75#define DEFVIDEOTYPE 0x35 /* VIDEO */
76#define DEFMODULATION 0x36 /* VIDEO */
77#define DEFXOFFSET 0x37 /* VIDEO */
78#define DEFYOFFSET 0x38 /* VIDEO */
79#define DEFYCMODE 0x39 /* VIDEO */
80#define DEFVCRMODE 0x3a /* VIDEO */
81#define DEFSTOREDCYVALUES 0x3b /* CCD/VIDEO/SS1M */
82#define DEFWCDS 0x3c /* CCD */
83#define DEFVGA 0x3d /* VIDEO */
84#define DEFCOMMENT 0x3e /* CCD/VIDEO */
85#define DEFCOMMENTSIZE 0x3f /* CCD/VIDEO */
86#define DEFCOMMENTTEXT 0x50 /* CCD/VIDEO */
87#define DEFSTOREDCYTEXT 0x51 /* VIDEO */
88
89
90#define JULABORTDMA 0x70 /* Abort current DMA transfer */
91
92/* juliette general i/o port */
93
94#define JIO_READBITS 0x40 /* read and return current port bits */
95#define JIO_SETBITS 0x41 /* set bits marked by 1 in the argument */
96#define JIO_CLRBITS 0x42 /* clr bits marked by 1 in the argument */
97#define JIO_READDIR 0x43 /* read direction, 0=input 1=output */
98#define JIO_SETINPUT 0x44 /* set direction, 0=unchanged 1=input
99 returns current dir */
100#define JIO_SETOUTPUT 0x45 /* set direction, 0=unchanged 1=output
101 returns current dir */
102
103/**** YumYum internal adresses ****/
104
105/* Juliette buffer addresses */
106
107#define BUFFER1_VIDEO 0x1100
108#define BUFFER2_VIDEO 0x2800
109#define ACDC_BUFF_VIDEO 0x0aaa
110#define BUFFER1 0x1700
111#define BUFFER2 0x2b01
112#define ACDC_BUFFER 0x1200
113#define BUFFER1_SS1M 0x1100
114#define BUFFER2_SS1M 0x2800
115#define ACDC_BUFF_SS1M 0x0900
116
117/* Juliette parameter memory addresses */
118
119#define PA_BUFFER_CNT 0x3f09 /* CCD/VIDEO */
120#define PA_CCD_BUFFER 0x3f10 /* CCD */
121#define PA_VIDEO_BUFFER 0x3f10 /* VIDEO */
122#define PA_DCT_BUFFER 0x3f11 /* CCD/VIDEO */
123#define PA_TEMP 0x3f12 /* CCD/VIDEO */
124#define PA_VIDEOLINE_RD 0x3f13 /* VIDEO */
125#define PA_VIDEOLINE_WR 0x3f14 /* VIDEO */
126#define PA_VI_HDELAY0 0x3f15 /* VIDEO */
127#define PA_VI_VDELAY0 0x3f16 /* VIDEO */
128#define PA_VI_HDELAY1 0x3f17 /* VIDEO */
129#define PA_VI_VDELAY1 0x3f18 /* VIDEO */
130#define PA_VI_HDELAY2 0x3f19 /* VIDEO */
131#define PA_VI_VDELAY2 0x3f1a /* VIDEO */
132#define PA_VI_HDELAY3 0x3f1b /* VIDEO */
133#define PA_VI_VDELAY3 0x3f1c /* VIDEO */
134#define PA_VI_CTRL 0x3f20 /* VIDEO */
135#define PA_JPEG_CTRL 0x3f22 /* CCD/VIDEO */
136#define PA_BUFFER_SIZE 0x3f24 /* CCD/VIDEO */
137#define PA_PAL_NTSC 0x3f25 /* VIDEO */
138#define PA_MACROBLOCKS 0x3f26 /* CCD/VIDEO */
139#define PA_COLOR 0x3f27 /* VIDEO */
140#define PA_MEMCH1CNT2 0x3f28 /* CCD/VIDEO */
141#define PA_MEMCH1CNT3 0x3f29 /* VIDEO */
142#define PA_MEMCH1STR2 0x3f2a /* CCD/VIDEO */
143#define PA_MEMCH1STR3 0x3f2b /* VIDEO */
144#define PA_BUFFERS 0x3f2c /* CCD/VIDEO */
145#define PA_PROGRAM 0x3f2d /* CCD/VIDEO */
146#define PA_ROTATION 0x3f2e /* CCD */
147#define PA_PC 0x3f30 /* CCD/VIDEO */
148#define PA_PC2 0x3f31 /* VIDEO */
149#define PA_ODD_LINE 0x3f32 /* VIDEO */
150#define PA_EXP_DELAY 0x3f34 /* CCD */
151#define PA_MACROBLOCK_CNT 0x3f35 /* CCD/VIDEO */
152#define PA_DRAM_PTR1_L 0x3f36 /* CCD/VIDEO */
153#define PA_CLPOB_CNT 0x3f37 /* CCD */
154#define PA_DRAM_PTR1_H 0x3f38 /* CCD/VIDEO */
155#define PA_DRAM_PTR2_L 0x3f3a /* VIDEO */
156#define PA_DRAM_PTR2_H 0x3f3c /* VIDEO */
157#define PA_CCD_LINE_CNT 0x3f3f /* CCD */
158#define PA_VIDEO_LINE_CNT 0x3f3f /* VIDEO */
159#define PA_TEXT 0x3f41 /* CCD/VIDEO */
160#define PA_CAMERA_CHANGED 0x3f42 /* VIDEO */
161#define PA_TEXTALIGNMENT 0x3f43 /* VIDEO */
162#define PA_DISABLED 0x3f44 /* VIDEO */
163#define PA_MACROBLOCKTEXT 0x3f45 /* VIDEO */
164#define PA_VGA 0x3f46 /* VIDEO */
165#define PA_ZERO 0x3ffe /* VIDEO */
166#define PA_NULL 0x3fff /* CCD/VIDEO */
167
168typedef enum {
169 jpeg = 0,
170 dummy = 1
171} request_type;
172
173typedef enum {
174 hugesize = 0,
175 fullsize = 1,
176 halfsize = 2,
177 fieldsize = 3
178} size_type;
179
180typedef enum {
181 min = 0,
182 low = 1,
183 medium = 2,
184 high = 3,
185 very_high = 4,
186 very_low = 5,
187 q1 = 6,
188 q2 = 7,
189 q3 = 8,
190 q4 = 9,
191 q5 = 10,
192 q6 = 11
193} compr_type;
194
195typedef enum {
196 deg_0 = 0,
197 deg_180 = 1,
198 deg_90 = 2,
199 deg_270 = 3
200} rotation_type;
201
202typedef enum {
203 auto_white = 0,
204 hold = 1,
205 fixed_outdoor = 2,
206 fixed_indoor = 3,
207 fixed_fluor = 4
208} white_balance_type;
209
210typedef enum {
211 auto_exp = 0,
212 fixed_exp = 1
213} exposure_type;
214
215typedef enum {
216 no_window = 0,
217 center = 1,
218 top = 2,
219 lower = 3,
220 left = 4,
221 right = 5,
222 spot = 6,
223 cw = 7
224} exp_window_type;
225
226typedef enum {
227 h_24 = 0,
228 h_12 = 1,
229 h_24P = 2
230} hour_type;
231
232typedef enum {
233 standard = 0,
234 YYYY_MM_DD = 1,
235 Www_Mmm_DD_YYYY = 2,
236 Www_DD_MM_YYYY = 3
237} date_type;
238
239typedef enum {
240 left_align = 0,
241 center_align = 1,
242 right_align = 2
243} alignment_type;
244
245typedef enum {
246 off = 0,
247 on = 1,
248 no = 0,
249 yes = 1
250} enable_type;
251
252typedef enum {
253 disabled = 0,
254 enabled = 1,
255 extended = 2
256} comment_type;
257
258typedef enum {
259 pal = 0,
260 ntsc = 1
261} video_type;
262
263typedef enum {
264 pal_bghi_ntsc_m = 0,
265 ntsc_4_43_50hz_pal_4_43_60hz = 1,
266 pal_n_ntsc_4_43_60hz = 2,
267 ntsc_n_pal_m = 3,
268 secam_pal_4_43_60hz = 4
269} modulation_type;
270
271typedef enum {
272 cam0 = 0,
273 cam1 = 1,
274 cam2 = 2,
275 cam3 = 3,
276 quad = 32
277} camera_type;
278
279typedef enum {
280 video_driver = 0,
281 ccd_driver = 1
282} driver_type;
283
284struct jul_param {
285 request_type req_type;
286 size_type size;
287 compr_type compression;
288 rotation_type rotation;
289 int color_level;
290 int brightness;
291 white_balance_type white_balance;
292 exposure_type exposure;
293 exp_window_type auto_exp_window;
294 hour_type time_format;
295 date_type date_format;
296 alignment_type text_alignment;
297 enable_type text;
298 enable_type clock;
299 enable_type date;
300 enable_type fps;
301 enable_type vga;
302 enable_type comment;
303};
304
305struct video_param {
306 enable_type disabled;
307 modulation_type modulation;
308 video_type video;
309 enable_type signal;
310 enable_type vcr;
311 int xoffset;
312 int yoffset;
313};
314
315/* The juliette_request structure is used during the JULSTARTDMA asynchronous
316 * picture-taking ioctl call as an argument to specify a buffer which will get
317 * the final picture.
318 */
319
320struct juliette_request {
321 char *buf; /* Pointer to the buffer to hold picture data */
322 unsigned int buflen; /* Length of the above buffer */
323 unsigned int size; /* Resulting length, 0 if the picture is not ready */
324};
325
326#endif
diff --git a/include/asm-cris/arch-v32/mach-a3/arbiter.h b/include/asm-cris/arch-v32/mach-a3/arbiter.h
new file mode 100644
index 000000000000..65e9d6ff0520
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/arbiter.h
@@ -0,0 +1,34 @@
1#ifndef _ASM_CRIS_ARCH_ARBITER_H
2#define _ASM_CRIS_ARCH_ARBITER_H
3
4#define EXT_REGION 0
5#define INT_REGION 1
6
7typedef void (watch_callback)(void);
8
9enum {
10 arbiter_all_dmas = 0x7fe,
11 arbiter_cpu = 0x1800,
12 arbiter_all_clients = 0x7fff
13};
14
15enum {
16 arbiter_bar_all_clients = 0x1ff
17};
18
19enum {
20 arbiter_all_read = 0x55,
21 arbiter_all_write = 0xaa,
22 arbiter_all_accesses = 0xff
23};
24
25#define MARB_CLIENTS(foo_cli, bar_cli) (((bar_cli) << 16) | (foo_cli))
26
27int crisv32_arbiter_allocate_bandwidth(int client, int region,
28 unsigned long bandwidth);
29int crisv32_arbiter_watch(unsigned long start, unsigned long size,
30 unsigned long clients, unsigned long accesses,
31 watch_callback * cb);
32int crisv32_arbiter_unwatch(int id);
33
34#endif
diff --git a/include/asm-cris/arch-v32/mach-a3/dma.h b/include/asm-cris/arch-v32/mach-a3/dma.h
new file mode 100644
index 000000000000..9e8eb13b601d
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/dma.h
@@ -0,0 +1,31 @@
1#ifndef _ASM_ARCH_CRIS_DMA_H
2#define _ASM_ARCH_CRIS_DMA_H
3
4/* Defines for using and allocating dma channels. */
5
6#define MAX_DMA_CHANNELS 12 /* 8 and 10 not used. */
7
8enum dma_owner {
9 dma_eth,
10 dma_ser0,
11 dma_ser1,
12 dma_ser2,
13 dma_ser3,
14 dma_ser4,
15 dma_iop,
16 dma_sser,
17 dma_strp,
18 dma_h264,
19 dma_jpeg
20};
21
22int crisv32_request_dma(unsigned int dmanr, const char *device_id,
23 unsigned options, unsigned bandwidth, enum dma_owner owner);
24void crisv32_free_dma(unsigned int dmanr);
25
26/* Masks used by crisv32_request_dma options: */
27#define DMA_VERBOSE_ON_ERROR 1
28#define DMA_PANIC_ON_ERROR (2|DMA_VERBOSE_ON_ERROR)
29#define DMA_INT_MEM 4
30
31#endif /* _ASM_ARCH_CRIS_DMA_H */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/asm/clkgen_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/clkgen_defs_asm.h
new file mode 100644
index 000000000000..02855adf63e8
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/clkgen_defs_asm.h
@@ -0,0 +1,164 @@
1#ifndef __clkgen_defs_asm_h
2#define __clkgen_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: clkgen.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile clkgen_defs_asm.h clkgen.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53/* Register r_bootsel, scope clkgen, type r */
54#define reg_clkgen_r_bootsel___boot_mode___lsb 0
55#define reg_clkgen_r_bootsel___boot_mode___width 5
56#define reg_clkgen_r_bootsel___intern_main_clk___lsb 5
57#define reg_clkgen_r_bootsel___intern_main_clk___width 1
58#define reg_clkgen_r_bootsel___intern_main_clk___bit 5
59#define reg_clkgen_r_bootsel___extern_usb2_clk___lsb 6
60#define reg_clkgen_r_bootsel___extern_usb2_clk___width 1
61#define reg_clkgen_r_bootsel___extern_usb2_clk___bit 6
62#define reg_clkgen_r_bootsel_offset 0
63
64/* Register rw_clk_ctrl, scope clkgen, type rw */
65#define reg_clkgen_rw_clk_ctrl___pll___lsb 0
66#define reg_clkgen_rw_clk_ctrl___pll___width 1
67#define reg_clkgen_rw_clk_ctrl___pll___bit 0
68#define reg_clkgen_rw_clk_ctrl___cpu___lsb 1
69#define reg_clkgen_rw_clk_ctrl___cpu___width 1
70#define reg_clkgen_rw_clk_ctrl___cpu___bit 1
71#define reg_clkgen_rw_clk_ctrl___iop_usb___lsb 2
72#define reg_clkgen_rw_clk_ctrl___iop_usb___width 1
73#define reg_clkgen_rw_clk_ctrl___iop_usb___bit 2
74#define reg_clkgen_rw_clk_ctrl___vin___lsb 3
75#define reg_clkgen_rw_clk_ctrl___vin___width 1
76#define reg_clkgen_rw_clk_ctrl___vin___bit 3
77#define reg_clkgen_rw_clk_ctrl___sclr___lsb 4
78#define reg_clkgen_rw_clk_ctrl___sclr___width 1
79#define reg_clkgen_rw_clk_ctrl___sclr___bit 4
80#define reg_clkgen_rw_clk_ctrl___h264___lsb 5
81#define reg_clkgen_rw_clk_ctrl___h264___width 1
82#define reg_clkgen_rw_clk_ctrl___h264___bit 5
83#define reg_clkgen_rw_clk_ctrl___ddr2___lsb 6
84#define reg_clkgen_rw_clk_ctrl___ddr2___width 1
85#define reg_clkgen_rw_clk_ctrl___ddr2___bit 6
86#define reg_clkgen_rw_clk_ctrl___vout_hist___lsb 7
87#define reg_clkgen_rw_clk_ctrl___vout_hist___width 1
88#define reg_clkgen_rw_clk_ctrl___vout_hist___bit 7
89#define reg_clkgen_rw_clk_ctrl___eth___lsb 8
90#define reg_clkgen_rw_clk_ctrl___eth___width 1
91#define reg_clkgen_rw_clk_ctrl___eth___bit 8
92#define reg_clkgen_rw_clk_ctrl___ccd_tg_200___lsb 9
93#define reg_clkgen_rw_clk_ctrl___ccd_tg_200___width 1
94#define reg_clkgen_rw_clk_ctrl___ccd_tg_200___bit 9
95#define reg_clkgen_rw_clk_ctrl___dma0_1_eth___lsb 10
96#define reg_clkgen_rw_clk_ctrl___dma0_1_eth___width 1
97#define reg_clkgen_rw_clk_ctrl___dma0_1_eth___bit 10
98#define reg_clkgen_rw_clk_ctrl___ccd_tg_100___lsb 11
99#define reg_clkgen_rw_clk_ctrl___ccd_tg_100___width 1
100#define reg_clkgen_rw_clk_ctrl___ccd_tg_100___bit 11
101#define reg_clkgen_rw_clk_ctrl___jpeg___lsb 12
102#define reg_clkgen_rw_clk_ctrl___jpeg___width 1
103#define reg_clkgen_rw_clk_ctrl___jpeg___bit 12
104#define reg_clkgen_rw_clk_ctrl___sser_ser_dma6_7___lsb 13
105#define reg_clkgen_rw_clk_ctrl___sser_ser_dma6_7___width 1
106#define reg_clkgen_rw_clk_ctrl___sser_ser_dma6_7___bit 13
107#define reg_clkgen_rw_clk_ctrl___strdma0_2_video___lsb 14
108#define reg_clkgen_rw_clk_ctrl___strdma0_2_video___width 1
109#define reg_clkgen_rw_clk_ctrl___strdma0_2_video___bit 14
110#define reg_clkgen_rw_clk_ctrl___dma2_3_strcop___lsb 15
111#define reg_clkgen_rw_clk_ctrl___dma2_3_strcop___width 1
112#define reg_clkgen_rw_clk_ctrl___dma2_3_strcop___bit 15
113#define reg_clkgen_rw_clk_ctrl___dma4_5_iop___lsb 16
114#define reg_clkgen_rw_clk_ctrl___dma4_5_iop___width 1
115#define reg_clkgen_rw_clk_ctrl___dma4_5_iop___bit 16
116#define reg_clkgen_rw_clk_ctrl___dma9_11___lsb 17
117#define reg_clkgen_rw_clk_ctrl___dma9_11___width 1
118#define reg_clkgen_rw_clk_ctrl___dma9_11___bit 17
119#define reg_clkgen_rw_clk_ctrl___memarb_bar_ddr___lsb 18
120#define reg_clkgen_rw_clk_ctrl___memarb_bar_ddr___width 1
121#define reg_clkgen_rw_clk_ctrl___memarb_bar_ddr___bit 18
122#define reg_clkgen_rw_clk_ctrl___sclr_h264___lsb 19
123#define reg_clkgen_rw_clk_ctrl___sclr_h264___width 1
124#define reg_clkgen_rw_clk_ctrl___sclr_h264___bit 19
125#define reg_clkgen_rw_clk_ctrl_offset 4
126
127
128/* Constants */
129#define regk_clkgen_eth1000_rx 0x0000000c
130#define regk_clkgen_eth1000_tx 0x0000000e
131#define regk_clkgen_eth100_rx 0x0000001d
132#define regk_clkgen_eth100_rx_half 0x0000001c
133#define regk_clkgen_eth100_tx 0x0000001f
134#define regk_clkgen_eth100_tx_half 0x0000001e
135#define regk_clkgen_nand_3_2 0x00000000
136#define regk_clkgen_nand_3_2_0x30 0x00000002
137#define regk_clkgen_nand_3_2_0x30_pll 0x00000012
138#define regk_clkgen_nand_3_2_pll 0x00000010
139#define regk_clkgen_nand_3_3 0x00000001
140#define regk_clkgen_nand_3_3_0x30 0x00000003
141#define regk_clkgen_nand_3_3_0x30_pll 0x00000013
142#define regk_clkgen_nand_3_3_pll 0x00000011
143#define regk_clkgen_nand_4_2 0x00000004
144#define regk_clkgen_nand_4_2_0x30 0x00000006
145#define regk_clkgen_nand_4_2_0x30_pll 0x00000016
146#define regk_clkgen_nand_4_2_pll 0x00000014
147#define regk_clkgen_nand_4_3 0x00000005
148#define regk_clkgen_nand_4_3_0x30 0x00000007
149#define regk_clkgen_nand_4_3_0x30_pll 0x00000017
150#define regk_clkgen_nand_4_3_pll 0x00000015
151#define regk_clkgen_nand_5_2 0x00000008
152#define regk_clkgen_nand_5_2_0x30 0x0000000a
153#define regk_clkgen_nand_5_2_0x30_pll 0x0000001a
154#define regk_clkgen_nand_5_2_pll 0x00000018
155#define regk_clkgen_nand_5_3 0x00000009
156#define regk_clkgen_nand_5_3_0x30 0x0000000b
157#define regk_clkgen_nand_5_3_0x30_pll 0x0000001b
158#define regk_clkgen_nand_5_3_pll 0x00000019
159#define regk_clkgen_no 0x00000000
160#define regk_clkgen_rw_clk_ctrl_default 0x00000002
161#define regk_clkgen_ser 0x0000000d
162#define regk_clkgen_ser_pll 0x0000000f
163#define regk_clkgen_yes 0x00000001
164#endif /* __clkgen_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/asm/ddr2_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/ddr2_defs_asm.h
new file mode 100644
index 000000000000..b12be03edacb
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/ddr2_defs_asm.h
@@ -0,0 +1,266 @@
1#ifndef __ddr2_defs_asm_h
2#define __ddr2_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ddr2.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile ddr2_defs_asm.h ddr2.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53/* Register rw_cfg, scope ddr2, type rw */
54#define reg_ddr2_rw_cfg___col_width___lsb 0
55#define reg_ddr2_rw_cfg___col_width___width 4
56#define reg_ddr2_rw_cfg___nr_banks___lsb 4
57#define reg_ddr2_rw_cfg___nr_banks___width 1
58#define reg_ddr2_rw_cfg___nr_banks___bit 4
59#define reg_ddr2_rw_cfg___bw___lsb 5
60#define reg_ddr2_rw_cfg___bw___width 1
61#define reg_ddr2_rw_cfg___bw___bit 5
62#define reg_ddr2_rw_cfg___nr_ref___lsb 6
63#define reg_ddr2_rw_cfg___nr_ref___width 4
64#define reg_ddr2_rw_cfg___ref_interval___lsb 10
65#define reg_ddr2_rw_cfg___ref_interval___width 11
66#define reg_ddr2_rw_cfg___odt_ctrl___lsb 21
67#define reg_ddr2_rw_cfg___odt_ctrl___width 2
68#define reg_ddr2_rw_cfg___odt_mem___lsb 23
69#define reg_ddr2_rw_cfg___odt_mem___width 1
70#define reg_ddr2_rw_cfg___odt_mem___bit 23
71#define reg_ddr2_rw_cfg___imp_strength___lsb 24
72#define reg_ddr2_rw_cfg___imp_strength___width 1
73#define reg_ddr2_rw_cfg___imp_strength___bit 24
74#define reg_ddr2_rw_cfg___auto_imp_cal___lsb 25
75#define reg_ddr2_rw_cfg___auto_imp_cal___width 1
76#define reg_ddr2_rw_cfg___auto_imp_cal___bit 25
77#define reg_ddr2_rw_cfg___imp_cal_override___lsb 26
78#define reg_ddr2_rw_cfg___imp_cal_override___width 1
79#define reg_ddr2_rw_cfg___imp_cal_override___bit 26
80#define reg_ddr2_rw_cfg___dll_override___lsb 27
81#define reg_ddr2_rw_cfg___dll_override___width 1
82#define reg_ddr2_rw_cfg___dll_override___bit 27
83#define reg_ddr2_rw_cfg_offset 0
84
85/* Register rw_timing, scope ddr2, type rw */
86#define reg_ddr2_rw_timing___wr___lsb 0
87#define reg_ddr2_rw_timing___wr___width 3
88#define reg_ddr2_rw_timing___rcd___lsb 3
89#define reg_ddr2_rw_timing___rcd___width 3
90#define reg_ddr2_rw_timing___rp___lsb 6
91#define reg_ddr2_rw_timing___rp___width 3
92#define reg_ddr2_rw_timing___ras___lsb 9
93#define reg_ddr2_rw_timing___ras___width 4
94#define reg_ddr2_rw_timing___rfc___lsb 13
95#define reg_ddr2_rw_timing___rfc___width 7
96#define reg_ddr2_rw_timing___rc___lsb 20
97#define reg_ddr2_rw_timing___rc___width 5
98#define reg_ddr2_rw_timing___rtp___lsb 25
99#define reg_ddr2_rw_timing___rtp___width 2
100#define reg_ddr2_rw_timing___rtw___lsb 27
101#define reg_ddr2_rw_timing___rtw___width 3
102#define reg_ddr2_rw_timing___wtr___lsb 30
103#define reg_ddr2_rw_timing___wtr___width 2
104#define reg_ddr2_rw_timing_offset 4
105
106/* Register rw_latency, scope ddr2, type rw */
107#define reg_ddr2_rw_latency___cas___lsb 0
108#define reg_ddr2_rw_latency___cas___width 3
109#define reg_ddr2_rw_latency___additive___lsb 3
110#define reg_ddr2_rw_latency___additive___width 3
111#define reg_ddr2_rw_latency_offset 8
112
113/* Register rw_phy_cfg, scope ddr2, type rw */
114#define reg_ddr2_rw_phy_cfg___en___lsb 0
115#define reg_ddr2_rw_phy_cfg___en___width 1
116#define reg_ddr2_rw_phy_cfg___en___bit 0
117#define reg_ddr2_rw_phy_cfg_offset 12
118
119/* Register rw_phy_ctrl, scope ddr2, type rw */
120#define reg_ddr2_rw_phy_ctrl___rst___lsb 0
121#define reg_ddr2_rw_phy_ctrl___rst___width 1
122#define reg_ddr2_rw_phy_ctrl___rst___bit 0
123#define reg_ddr2_rw_phy_ctrl___cal_rst___lsb 1
124#define reg_ddr2_rw_phy_ctrl___cal_rst___width 1
125#define reg_ddr2_rw_phy_ctrl___cal_rst___bit 1
126#define reg_ddr2_rw_phy_ctrl___cal_start___lsb 2
127#define reg_ddr2_rw_phy_ctrl___cal_start___width 1
128#define reg_ddr2_rw_phy_ctrl___cal_start___bit 2
129#define reg_ddr2_rw_phy_ctrl_offset 16
130
131/* Register rw_ctrl, scope ddr2, type rw */
132#define reg_ddr2_rw_ctrl___mrs_data___lsb 0
133#define reg_ddr2_rw_ctrl___mrs_data___width 16
134#define reg_ddr2_rw_ctrl___cmd___lsb 16
135#define reg_ddr2_rw_ctrl___cmd___width 8
136#define reg_ddr2_rw_ctrl_offset 20
137
138/* Register rw_pwr_down, scope ddr2, type rw */
139#define reg_ddr2_rw_pwr_down___self_ref___lsb 0
140#define reg_ddr2_rw_pwr_down___self_ref___width 2
141#define reg_ddr2_rw_pwr_down___phy_en___lsb 2
142#define reg_ddr2_rw_pwr_down___phy_en___width 1
143#define reg_ddr2_rw_pwr_down___phy_en___bit 2
144#define reg_ddr2_rw_pwr_down_offset 24
145
146/* Register r_stat, scope ddr2, type r */
147#define reg_ddr2_r_stat___dll_lock___lsb 0
148#define reg_ddr2_r_stat___dll_lock___width 1
149#define reg_ddr2_r_stat___dll_lock___bit 0
150#define reg_ddr2_r_stat___dll_delay_code___lsb 1
151#define reg_ddr2_r_stat___dll_delay_code___width 7
152#define reg_ddr2_r_stat___imp_cal_done___lsb 8
153#define reg_ddr2_r_stat___imp_cal_done___width 1
154#define reg_ddr2_r_stat___imp_cal_done___bit 8
155#define reg_ddr2_r_stat___imp_cal_fault___lsb 9
156#define reg_ddr2_r_stat___imp_cal_fault___width 1
157#define reg_ddr2_r_stat___imp_cal_fault___bit 9
158#define reg_ddr2_r_stat___cal_imp_pu___lsb 10
159#define reg_ddr2_r_stat___cal_imp_pu___width 4
160#define reg_ddr2_r_stat___cal_imp_pd___lsb 14
161#define reg_ddr2_r_stat___cal_imp_pd___width 4
162#define reg_ddr2_r_stat_offset 28
163
164/* Register rw_imp_ctrl, scope ddr2, type rw */
165#define reg_ddr2_rw_imp_ctrl___imp_pu___lsb 0
166#define reg_ddr2_rw_imp_ctrl___imp_pu___width 4
167#define reg_ddr2_rw_imp_ctrl___imp_pd___lsb 4
168#define reg_ddr2_rw_imp_ctrl___imp_pd___width 4
169#define reg_ddr2_rw_imp_ctrl_offset 32
170
171#define STRIDE_ddr2_rw_dll_ctrl 4
172/* Register rw_dll_ctrl, scope ddr2, type rw */
173#define reg_ddr2_rw_dll_ctrl___mode___lsb 0
174#define reg_ddr2_rw_dll_ctrl___mode___width 1
175#define reg_ddr2_rw_dll_ctrl___mode___bit 0
176#define reg_ddr2_rw_dll_ctrl___clk_delay___lsb 1
177#define reg_ddr2_rw_dll_ctrl___clk_delay___width 7
178#define reg_ddr2_rw_dll_ctrl_offset 36
179
180#define STRIDE_ddr2_rw_dqs_dll_ctrl 4
181/* Register rw_dqs_dll_ctrl, scope ddr2, type rw */
182#define reg_ddr2_rw_dqs_dll_ctrl___dqs90_delay___lsb 0
183#define reg_ddr2_rw_dqs_dll_ctrl___dqs90_delay___width 7
184#define reg_ddr2_rw_dqs_dll_ctrl___dqs180_delay___lsb 7
185#define reg_ddr2_rw_dqs_dll_ctrl___dqs180_delay___width 7
186#define reg_ddr2_rw_dqs_dll_ctrl___dqs270_delay___lsb 14
187#define reg_ddr2_rw_dqs_dll_ctrl___dqs270_delay___width 7
188#define reg_ddr2_rw_dqs_dll_ctrl___dqs360_delay___lsb 21
189#define reg_ddr2_rw_dqs_dll_ctrl___dqs360_delay___width 7
190#define reg_ddr2_rw_dqs_dll_ctrl_offset 52
191
192
193/* Constants */
194#define regk_ddr2_al0 0x00000000
195#define regk_ddr2_al1 0x00000008
196#define regk_ddr2_al2 0x00000010
197#define regk_ddr2_al3 0x00000018
198#define regk_ddr2_al4 0x00000020
199#define regk_ddr2_auto 0x00000003
200#define regk_ddr2_bank4 0x00000000
201#define regk_ddr2_bank8 0x00000001
202#define regk_ddr2_bl4 0x00000002
203#define regk_ddr2_bl8 0x00000003
204#define regk_ddr2_bt_il 0x00000008
205#define regk_ddr2_bt_seq 0x00000000
206#define regk_ddr2_bw16 0x00000001
207#define regk_ddr2_bw32 0x00000000
208#define regk_ddr2_cas2 0x00000020
209#define regk_ddr2_cas3 0x00000030
210#define regk_ddr2_cas4 0x00000040
211#define regk_ddr2_cas5 0x00000050
212#define regk_ddr2_deselect 0x000000c0
213#define regk_ddr2_dic_weak 0x00000002
214#define regk_ddr2_direct 0x00000001
215#define regk_ddr2_dis 0x00000000
216#define regk_ddr2_dll_dis 0x00000001
217#define regk_ddr2_dll_en 0x00000000
218#define regk_ddr2_dll_rst 0x00000100
219#define regk_ddr2_emrs 0x00000081
220#define regk_ddr2_emrs2 0x00000082
221#define regk_ddr2_emrs3 0x00000083
222#define regk_ddr2_full 0x00000001
223#define regk_ddr2_hi_ref_rate 0x00000080
224#define regk_ddr2_mrs 0x00000080
225#define regk_ddr2_no 0x00000000
226#define regk_ddr2_nop 0x000000b8
227#define regk_ddr2_ocd_adj 0x00000200
228#define regk_ddr2_ocd_default 0x00000380
229#define regk_ddr2_ocd_drive0 0x00000100
230#define regk_ddr2_ocd_drive1 0x00000080
231#define regk_ddr2_ocd_exit 0x00000000
232#define regk_ddr2_odt_dis 0x00000000
233#define regk_ddr2_offs 0x00000000
234#define regk_ddr2_pre 0x00000090
235#define regk_ddr2_pre_all 0x00000400
236#define regk_ddr2_pwr_down_fast 0x00000000
237#define regk_ddr2_pwr_down_slow 0x00001000
238#define regk_ddr2_ref 0x00000088
239#define regk_ddr2_rtt150 0x00000040
240#define regk_ddr2_rtt50 0x00000044
241#define regk_ddr2_rtt75 0x00000004
242#define regk_ddr2_rw_cfg_default 0x00186000
243#define regk_ddr2_rw_dll_ctrl_default 0x00000000
244#define regk_ddr2_rw_dll_ctrl_size 0x00000004
245#define regk_ddr2_rw_dqs_dll_ctrl_default 0x00000000
246#define regk_ddr2_rw_dqs_dll_ctrl_size 0x00000004
247#define regk_ddr2_rw_latency_default 0x00000000
248#define regk_ddr2_rw_phy_cfg_default 0x00000000
249#define regk_ddr2_rw_pwr_down_default 0x00000000
250#define regk_ddr2_rw_timing_default 0x00000000
251#define regk_ddr2_s1Gb 0x0000001a
252#define regk_ddr2_s256Mb 0x0000000f
253#define regk_ddr2_s2Gb 0x00000027
254#define regk_ddr2_s4Gb 0x00000042
255#define regk_ddr2_s512Mb 0x00000015
256#define regk_ddr2_temp0_85 0x00000618
257#define regk_ddr2_temp85_95 0x0000030c
258#define regk_ddr2_term150 0x00000002
259#define regk_ddr2_term50 0x00000003
260#define regk_ddr2_term75 0x00000001
261#define regk_ddr2_test 0x00000080
262#define regk_ddr2_weak 0x00000000
263#define regk_ddr2_wr2 0x00000200
264#define regk_ddr2_wr3 0x00000400
265#define regk_ddr2_yes 0x00000001
266#endif /* __ddr2_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/asm/gio_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/gio_defs_asm.h
new file mode 100644
index 000000000000..df6714fda179
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/gio_defs_asm.h
@@ -0,0 +1,849 @@
1#ifndef __gio_defs_asm_h
2#define __gio_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: gio.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile gio_defs_asm.h gio.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53/* Register r_pa_din, scope gio, type r */
54#define reg_gio_r_pa_din___data___lsb 0
55#define reg_gio_r_pa_din___data___width 32
56#define reg_gio_r_pa_din_offset 0
57
58/* Register rw_pa_dout, scope gio, type rw */
59#define reg_gio_rw_pa_dout___data___lsb 0
60#define reg_gio_rw_pa_dout___data___width 32
61#define reg_gio_rw_pa_dout_offset 4
62
63/* Register rw_pa_oe, scope gio, type rw */
64#define reg_gio_rw_pa_oe___oe___lsb 0
65#define reg_gio_rw_pa_oe___oe___width 32
66#define reg_gio_rw_pa_oe_offset 8
67
68/* Register rw_pa_byte0_dout, scope gio, type rw */
69#define reg_gio_rw_pa_byte0_dout___data___lsb 0
70#define reg_gio_rw_pa_byte0_dout___data___width 8
71#define reg_gio_rw_pa_byte0_dout_offset 12
72
73/* Register rw_pa_byte0_oe, scope gio, type rw */
74#define reg_gio_rw_pa_byte0_oe___oe___lsb 0
75#define reg_gio_rw_pa_byte0_oe___oe___width 8
76#define reg_gio_rw_pa_byte0_oe_offset 16
77
78/* Register rw_pa_byte1_dout, scope gio, type rw */
79#define reg_gio_rw_pa_byte1_dout___data___lsb 0
80#define reg_gio_rw_pa_byte1_dout___data___width 8
81#define reg_gio_rw_pa_byte1_dout_offset 20
82
83/* Register rw_pa_byte1_oe, scope gio, type rw */
84#define reg_gio_rw_pa_byte1_oe___oe___lsb 0
85#define reg_gio_rw_pa_byte1_oe___oe___width 8
86#define reg_gio_rw_pa_byte1_oe_offset 24
87
88/* Register rw_pa_byte2_dout, scope gio, type rw */
89#define reg_gio_rw_pa_byte2_dout___data___lsb 0
90#define reg_gio_rw_pa_byte2_dout___data___width 8
91#define reg_gio_rw_pa_byte2_dout_offset 28
92
93/* Register rw_pa_byte2_oe, scope gio, type rw */
94#define reg_gio_rw_pa_byte2_oe___oe___lsb 0
95#define reg_gio_rw_pa_byte2_oe___oe___width 8
96#define reg_gio_rw_pa_byte2_oe_offset 32
97
98/* Register rw_pa_byte3_dout, scope gio, type rw */
99#define reg_gio_rw_pa_byte3_dout___data___lsb 0
100#define reg_gio_rw_pa_byte3_dout___data___width 8
101#define reg_gio_rw_pa_byte3_dout_offset 36
102
103/* Register rw_pa_byte3_oe, scope gio, type rw */
104#define reg_gio_rw_pa_byte3_oe___oe___lsb 0
105#define reg_gio_rw_pa_byte3_oe___oe___width 8
106#define reg_gio_rw_pa_byte3_oe_offset 40
107
108/* Register r_pb_din, scope gio, type r */
109#define reg_gio_r_pb_din___data___lsb 0
110#define reg_gio_r_pb_din___data___width 32
111#define reg_gio_r_pb_din_offset 44
112
113/* Register rw_pb_dout, scope gio, type rw */
114#define reg_gio_rw_pb_dout___data___lsb 0
115#define reg_gio_rw_pb_dout___data___width 32
116#define reg_gio_rw_pb_dout_offset 48
117
118/* Register rw_pb_oe, scope gio, type rw */
119#define reg_gio_rw_pb_oe___oe___lsb 0
120#define reg_gio_rw_pb_oe___oe___width 32
121#define reg_gio_rw_pb_oe_offset 52
122
123/* Register rw_pb_byte0_dout, scope gio, type rw */
124#define reg_gio_rw_pb_byte0_dout___data___lsb 0
125#define reg_gio_rw_pb_byte0_dout___data___width 8
126#define reg_gio_rw_pb_byte0_dout_offset 56
127
128/* Register rw_pb_byte0_oe, scope gio, type rw */
129#define reg_gio_rw_pb_byte0_oe___oe___lsb 0
130#define reg_gio_rw_pb_byte0_oe___oe___width 8
131#define reg_gio_rw_pb_byte0_oe_offset 60
132
133/* Register rw_pb_byte1_dout, scope gio, type rw */
134#define reg_gio_rw_pb_byte1_dout___data___lsb 0
135#define reg_gio_rw_pb_byte1_dout___data___width 8
136#define reg_gio_rw_pb_byte1_dout_offset 64
137
138/* Register rw_pb_byte1_oe, scope gio, type rw */
139#define reg_gio_rw_pb_byte1_oe___oe___lsb 0
140#define reg_gio_rw_pb_byte1_oe___oe___width 8
141#define reg_gio_rw_pb_byte1_oe_offset 68
142
143/* Register rw_pb_byte2_dout, scope gio, type rw */
144#define reg_gio_rw_pb_byte2_dout___data___lsb 0
145#define reg_gio_rw_pb_byte2_dout___data___width 8
146#define reg_gio_rw_pb_byte2_dout_offset 72
147
148/* Register rw_pb_byte2_oe, scope gio, type rw */
149#define reg_gio_rw_pb_byte2_oe___oe___lsb 0
150#define reg_gio_rw_pb_byte2_oe___oe___width 8
151#define reg_gio_rw_pb_byte2_oe_offset 76
152
153/* Register rw_pb_byte3_dout, scope gio, type rw */
154#define reg_gio_rw_pb_byte3_dout___data___lsb 0
155#define reg_gio_rw_pb_byte3_dout___data___width 8
156#define reg_gio_rw_pb_byte3_dout_offset 80
157
158/* Register rw_pb_byte3_oe, scope gio, type rw */
159#define reg_gio_rw_pb_byte3_oe___oe___lsb 0
160#define reg_gio_rw_pb_byte3_oe___oe___width 8
161#define reg_gio_rw_pb_byte3_oe_offset 84
162
163/* Register r_pc_din, scope gio, type r */
164#define reg_gio_r_pc_din___data___lsb 0
165#define reg_gio_r_pc_din___data___width 16
166#define reg_gio_r_pc_din_offset 88
167
168/* Register rw_pc_dout, scope gio, type rw */
169#define reg_gio_rw_pc_dout___data___lsb 0
170#define reg_gio_rw_pc_dout___data___width 16
171#define reg_gio_rw_pc_dout_offset 92
172
173/* Register rw_pc_oe, scope gio, type rw */
174#define reg_gio_rw_pc_oe___oe___lsb 0
175#define reg_gio_rw_pc_oe___oe___width 16
176#define reg_gio_rw_pc_oe_offset 96
177
178/* Register rw_pc_byte0_dout, scope gio, type rw */
179#define reg_gio_rw_pc_byte0_dout___data___lsb 0
180#define reg_gio_rw_pc_byte0_dout___data___width 8
181#define reg_gio_rw_pc_byte0_dout_offset 100
182
183/* Register rw_pc_byte0_oe, scope gio, type rw */
184#define reg_gio_rw_pc_byte0_oe___oe___lsb 0
185#define reg_gio_rw_pc_byte0_oe___oe___width 8
186#define reg_gio_rw_pc_byte0_oe_offset 104
187
188/* Register rw_pc_byte1_dout, scope gio, type rw */
189#define reg_gio_rw_pc_byte1_dout___data___lsb 0
190#define reg_gio_rw_pc_byte1_dout___data___width 8
191#define reg_gio_rw_pc_byte1_dout_offset 108
192
193/* Register rw_pc_byte1_oe, scope gio, type rw */
194#define reg_gio_rw_pc_byte1_oe___oe___lsb 0
195#define reg_gio_rw_pc_byte1_oe___oe___width 8
196#define reg_gio_rw_pc_byte1_oe_offset 112
197
198/* Register r_pd_din, scope gio, type r */
199#define reg_gio_r_pd_din___data___lsb 0
200#define reg_gio_r_pd_din___data___width 32
201#define reg_gio_r_pd_din_offset 116
202
203/* Register rw_intr_cfg, scope gio, type rw */
204#define reg_gio_rw_intr_cfg___intr0___lsb 0
205#define reg_gio_rw_intr_cfg___intr0___width 3
206#define reg_gio_rw_intr_cfg___intr1___lsb 3
207#define reg_gio_rw_intr_cfg___intr1___width 3
208#define reg_gio_rw_intr_cfg___intr2___lsb 6
209#define reg_gio_rw_intr_cfg___intr2___width 3
210#define reg_gio_rw_intr_cfg___intr3___lsb 9
211#define reg_gio_rw_intr_cfg___intr3___width 3
212#define reg_gio_rw_intr_cfg___intr4___lsb 12
213#define reg_gio_rw_intr_cfg___intr4___width 3
214#define reg_gio_rw_intr_cfg___intr5___lsb 15
215#define reg_gio_rw_intr_cfg___intr5___width 3
216#define reg_gio_rw_intr_cfg___intr6___lsb 18
217#define reg_gio_rw_intr_cfg___intr6___width 3
218#define reg_gio_rw_intr_cfg___intr7___lsb 21
219#define reg_gio_rw_intr_cfg___intr7___width 3
220#define reg_gio_rw_intr_cfg_offset 120
221
222/* Register rw_intr_pins, scope gio, type rw */
223#define reg_gio_rw_intr_pins___intr0___lsb 0
224#define reg_gio_rw_intr_pins___intr0___width 4
225#define reg_gio_rw_intr_pins___intr1___lsb 4
226#define reg_gio_rw_intr_pins___intr1___width 4
227#define reg_gio_rw_intr_pins___intr2___lsb 8
228#define reg_gio_rw_intr_pins___intr2___width 4
229#define reg_gio_rw_intr_pins___intr3___lsb 12
230#define reg_gio_rw_intr_pins___intr3___width 4
231#define reg_gio_rw_intr_pins___intr4___lsb 16
232#define reg_gio_rw_intr_pins___intr4___width 4
233#define reg_gio_rw_intr_pins___intr5___lsb 20
234#define reg_gio_rw_intr_pins___intr5___width 4
235#define reg_gio_rw_intr_pins___intr6___lsb 24
236#define reg_gio_rw_intr_pins___intr6___width 4
237#define reg_gio_rw_intr_pins___intr7___lsb 28
238#define reg_gio_rw_intr_pins___intr7___width 4
239#define reg_gio_rw_intr_pins_offset 124
240
241/* Register rw_intr_mask, scope gio, type rw */
242#define reg_gio_rw_intr_mask___intr0___lsb 0
243#define reg_gio_rw_intr_mask___intr0___width 1
244#define reg_gio_rw_intr_mask___intr0___bit 0
245#define reg_gio_rw_intr_mask___intr1___lsb 1
246#define reg_gio_rw_intr_mask___intr1___width 1
247#define reg_gio_rw_intr_mask___intr1___bit 1
248#define reg_gio_rw_intr_mask___intr2___lsb 2
249#define reg_gio_rw_intr_mask___intr2___width 1
250#define reg_gio_rw_intr_mask___intr2___bit 2
251#define reg_gio_rw_intr_mask___intr3___lsb 3
252#define reg_gio_rw_intr_mask___intr3___width 1
253#define reg_gio_rw_intr_mask___intr3___bit 3
254#define reg_gio_rw_intr_mask___intr4___lsb 4
255#define reg_gio_rw_intr_mask___intr4___width 1
256#define reg_gio_rw_intr_mask___intr4___bit 4
257#define reg_gio_rw_intr_mask___intr5___lsb 5
258#define reg_gio_rw_intr_mask___intr5___width 1
259#define reg_gio_rw_intr_mask___intr5___bit 5
260#define reg_gio_rw_intr_mask___intr6___lsb 6
261#define reg_gio_rw_intr_mask___intr6___width 1
262#define reg_gio_rw_intr_mask___intr6___bit 6
263#define reg_gio_rw_intr_mask___intr7___lsb 7
264#define reg_gio_rw_intr_mask___intr7___width 1
265#define reg_gio_rw_intr_mask___intr7___bit 7
266#define reg_gio_rw_intr_mask___i2c0_done___lsb 8
267#define reg_gio_rw_intr_mask___i2c0_done___width 1
268#define reg_gio_rw_intr_mask___i2c0_done___bit 8
269#define reg_gio_rw_intr_mask___i2c1_done___lsb 9
270#define reg_gio_rw_intr_mask___i2c1_done___width 1
271#define reg_gio_rw_intr_mask___i2c1_done___bit 9
272#define reg_gio_rw_intr_mask_offset 128
273
274/* Register rw_ack_intr, scope gio, type rw */
275#define reg_gio_rw_ack_intr___intr0___lsb 0
276#define reg_gio_rw_ack_intr___intr0___width 1
277#define reg_gio_rw_ack_intr___intr0___bit 0
278#define reg_gio_rw_ack_intr___intr1___lsb 1
279#define reg_gio_rw_ack_intr___intr1___width 1
280#define reg_gio_rw_ack_intr___intr1___bit 1
281#define reg_gio_rw_ack_intr___intr2___lsb 2
282#define reg_gio_rw_ack_intr___intr2___width 1
283#define reg_gio_rw_ack_intr___intr2___bit 2
284#define reg_gio_rw_ack_intr___intr3___lsb 3
285#define reg_gio_rw_ack_intr___intr3___width 1
286#define reg_gio_rw_ack_intr___intr3___bit 3
287#define reg_gio_rw_ack_intr___intr4___lsb 4
288#define reg_gio_rw_ack_intr___intr4___width 1
289#define reg_gio_rw_ack_intr___intr4___bit 4
290#define reg_gio_rw_ack_intr___intr5___lsb 5
291#define reg_gio_rw_ack_intr___intr5___width 1
292#define reg_gio_rw_ack_intr___intr5___bit 5
293#define reg_gio_rw_ack_intr___intr6___lsb 6
294#define reg_gio_rw_ack_intr___intr6___width 1
295#define reg_gio_rw_ack_intr___intr6___bit 6
296#define reg_gio_rw_ack_intr___intr7___lsb 7
297#define reg_gio_rw_ack_intr___intr7___width 1
298#define reg_gio_rw_ack_intr___intr7___bit 7
299#define reg_gio_rw_ack_intr___i2c0_done___lsb 8
300#define reg_gio_rw_ack_intr___i2c0_done___width 1
301#define reg_gio_rw_ack_intr___i2c0_done___bit 8
302#define reg_gio_rw_ack_intr___i2c1_done___lsb 9
303#define reg_gio_rw_ack_intr___i2c1_done___width 1
304#define reg_gio_rw_ack_intr___i2c1_done___bit 9
305#define reg_gio_rw_ack_intr_offset 132
306
307/* Register r_intr, scope gio, type r */
308#define reg_gio_r_intr___intr0___lsb 0
309#define reg_gio_r_intr___intr0___width 1
310#define reg_gio_r_intr___intr0___bit 0
311#define reg_gio_r_intr___intr1___lsb 1
312#define reg_gio_r_intr___intr1___width 1
313#define reg_gio_r_intr___intr1___bit 1
314#define reg_gio_r_intr___intr2___lsb 2
315#define reg_gio_r_intr___intr2___width 1
316#define reg_gio_r_intr___intr2___bit 2
317#define reg_gio_r_intr___intr3___lsb 3
318#define reg_gio_r_intr___intr3___width 1
319#define reg_gio_r_intr___intr3___bit 3
320#define reg_gio_r_intr___intr4___lsb 4
321#define reg_gio_r_intr___intr4___width 1
322#define reg_gio_r_intr___intr4___bit 4
323#define reg_gio_r_intr___intr5___lsb 5
324#define reg_gio_r_intr___intr5___width 1
325#define reg_gio_r_intr___intr5___bit 5
326#define reg_gio_r_intr___intr6___lsb 6
327#define reg_gio_r_intr___intr6___width 1
328#define reg_gio_r_intr___intr6___bit 6
329#define reg_gio_r_intr___intr7___lsb 7
330#define reg_gio_r_intr___intr7___width 1
331#define reg_gio_r_intr___intr7___bit 7
332#define reg_gio_r_intr___i2c0_done___lsb 8
333#define reg_gio_r_intr___i2c0_done___width 1
334#define reg_gio_r_intr___i2c0_done___bit 8
335#define reg_gio_r_intr___i2c1_done___lsb 9
336#define reg_gio_r_intr___i2c1_done___width 1
337#define reg_gio_r_intr___i2c1_done___bit 9
338#define reg_gio_r_intr_offset 136
339
340/* Register r_masked_intr, scope gio, type r */
341#define reg_gio_r_masked_intr___intr0___lsb 0
342#define reg_gio_r_masked_intr___intr0___width 1
343#define reg_gio_r_masked_intr___intr0___bit 0
344#define reg_gio_r_masked_intr___intr1___lsb 1
345#define reg_gio_r_masked_intr___intr1___width 1
346#define reg_gio_r_masked_intr___intr1___bit 1
347#define reg_gio_r_masked_intr___intr2___lsb 2
348#define reg_gio_r_masked_intr___intr2___width 1
349#define reg_gio_r_masked_intr___intr2___bit 2
350#define reg_gio_r_masked_intr___intr3___lsb 3
351#define reg_gio_r_masked_intr___intr3___width 1
352#define reg_gio_r_masked_intr___intr3___bit 3
353#define reg_gio_r_masked_intr___intr4___lsb 4
354#define reg_gio_r_masked_intr___intr4___width 1
355#define reg_gio_r_masked_intr___intr4___bit 4
356#define reg_gio_r_masked_intr___intr5___lsb 5
357#define reg_gio_r_masked_intr___intr5___width 1
358#define reg_gio_r_masked_intr___intr5___bit 5
359#define reg_gio_r_masked_intr___intr6___lsb 6
360#define reg_gio_r_masked_intr___intr6___width 1
361#define reg_gio_r_masked_intr___intr6___bit 6
362#define reg_gio_r_masked_intr___intr7___lsb 7
363#define reg_gio_r_masked_intr___intr7___width 1
364#define reg_gio_r_masked_intr___intr7___bit 7
365#define reg_gio_r_masked_intr___i2c0_done___lsb 8
366#define reg_gio_r_masked_intr___i2c0_done___width 1
367#define reg_gio_r_masked_intr___i2c0_done___bit 8
368#define reg_gio_r_masked_intr___i2c1_done___lsb 9
369#define reg_gio_r_masked_intr___i2c1_done___width 1
370#define reg_gio_r_masked_intr___i2c1_done___bit 9
371#define reg_gio_r_masked_intr_offset 140
372
373/* Register rw_i2c0_start, scope gio, type rw */
374#define reg_gio_rw_i2c0_start___run___lsb 0
375#define reg_gio_rw_i2c0_start___run___width 1
376#define reg_gio_rw_i2c0_start___run___bit 0
377#define reg_gio_rw_i2c0_start_offset 144
378
379/* Register rw_i2c0_cfg, scope gio, type rw */
380#define reg_gio_rw_i2c0_cfg___en___lsb 0
381#define reg_gio_rw_i2c0_cfg___en___width 1
382#define reg_gio_rw_i2c0_cfg___en___bit 0
383#define reg_gio_rw_i2c0_cfg___bit_order___lsb 1
384#define reg_gio_rw_i2c0_cfg___bit_order___width 1
385#define reg_gio_rw_i2c0_cfg___bit_order___bit 1
386#define reg_gio_rw_i2c0_cfg___scl_io___lsb 2
387#define reg_gio_rw_i2c0_cfg___scl_io___width 1
388#define reg_gio_rw_i2c0_cfg___scl_io___bit 2
389#define reg_gio_rw_i2c0_cfg___scl_inv___lsb 3
390#define reg_gio_rw_i2c0_cfg___scl_inv___width 1
391#define reg_gio_rw_i2c0_cfg___scl_inv___bit 3
392#define reg_gio_rw_i2c0_cfg___sda_io___lsb 4
393#define reg_gio_rw_i2c0_cfg___sda_io___width 1
394#define reg_gio_rw_i2c0_cfg___sda_io___bit 4
395#define reg_gio_rw_i2c0_cfg___sda_idle___lsb 5
396#define reg_gio_rw_i2c0_cfg___sda_idle___width 1
397#define reg_gio_rw_i2c0_cfg___sda_idle___bit 5
398#define reg_gio_rw_i2c0_cfg_offset 148
399
400/* Register rw_i2c0_ctrl, scope gio, type rw */
401#define reg_gio_rw_i2c0_ctrl___trf_bits___lsb 0
402#define reg_gio_rw_i2c0_ctrl___trf_bits___width 6
403#define reg_gio_rw_i2c0_ctrl___switch_dir___lsb 6
404#define reg_gio_rw_i2c0_ctrl___switch_dir___width 6
405#define reg_gio_rw_i2c0_ctrl___extra_start___lsb 12
406#define reg_gio_rw_i2c0_ctrl___extra_start___width 3
407#define reg_gio_rw_i2c0_ctrl___early_end___lsb 15
408#define reg_gio_rw_i2c0_ctrl___early_end___width 1
409#define reg_gio_rw_i2c0_ctrl___early_end___bit 15
410#define reg_gio_rw_i2c0_ctrl___start_stop___lsb 16
411#define reg_gio_rw_i2c0_ctrl___start_stop___width 1
412#define reg_gio_rw_i2c0_ctrl___start_stop___bit 16
413#define reg_gio_rw_i2c0_ctrl___ack_dir0___lsb 17
414#define reg_gio_rw_i2c0_ctrl___ack_dir0___width 1
415#define reg_gio_rw_i2c0_ctrl___ack_dir0___bit 17
416#define reg_gio_rw_i2c0_ctrl___ack_dir1___lsb 18
417#define reg_gio_rw_i2c0_ctrl___ack_dir1___width 1
418#define reg_gio_rw_i2c0_ctrl___ack_dir1___bit 18
419#define reg_gio_rw_i2c0_ctrl___ack_dir2___lsb 19
420#define reg_gio_rw_i2c0_ctrl___ack_dir2___width 1
421#define reg_gio_rw_i2c0_ctrl___ack_dir2___bit 19
422#define reg_gio_rw_i2c0_ctrl___ack_dir3___lsb 20
423#define reg_gio_rw_i2c0_ctrl___ack_dir3___width 1
424#define reg_gio_rw_i2c0_ctrl___ack_dir3___bit 20
425#define reg_gio_rw_i2c0_ctrl___ack_dir4___lsb 21
426#define reg_gio_rw_i2c0_ctrl___ack_dir4___width 1
427#define reg_gio_rw_i2c0_ctrl___ack_dir4___bit 21
428#define reg_gio_rw_i2c0_ctrl___ack_dir5___lsb 22
429#define reg_gio_rw_i2c0_ctrl___ack_dir5___width 1
430#define reg_gio_rw_i2c0_ctrl___ack_dir5___bit 22
431#define reg_gio_rw_i2c0_ctrl___ack_bit___lsb 23
432#define reg_gio_rw_i2c0_ctrl___ack_bit___width 1
433#define reg_gio_rw_i2c0_ctrl___ack_bit___bit 23
434#define reg_gio_rw_i2c0_ctrl___start_bit___lsb 24
435#define reg_gio_rw_i2c0_ctrl___start_bit___width 1
436#define reg_gio_rw_i2c0_ctrl___start_bit___bit 24
437#define reg_gio_rw_i2c0_ctrl___freq___lsb 25
438#define reg_gio_rw_i2c0_ctrl___freq___width 2
439#define reg_gio_rw_i2c0_ctrl_offset 152
440
441/* Register rw_i2c0_data, scope gio, type rw */
442#define reg_gio_rw_i2c0_data___data0___lsb 0
443#define reg_gio_rw_i2c0_data___data0___width 8
444#define reg_gio_rw_i2c0_data___data1___lsb 8
445#define reg_gio_rw_i2c0_data___data1___width 8
446#define reg_gio_rw_i2c0_data___data2___lsb 16
447#define reg_gio_rw_i2c0_data___data2___width 8
448#define reg_gio_rw_i2c0_data___data3___lsb 24
449#define reg_gio_rw_i2c0_data___data3___width 8
450#define reg_gio_rw_i2c0_data_offset 156
451
452/* Register rw_i2c0_data2, scope gio, type rw */
453#define reg_gio_rw_i2c0_data2___data4___lsb 0
454#define reg_gio_rw_i2c0_data2___data4___width 8
455#define reg_gio_rw_i2c0_data2___data5___lsb 8
456#define reg_gio_rw_i2c0_data2___data5___width 8
457#define reg_gio_rw_i2c0_data2___start_val___lsb 16
458#define reg_gio_rw_i2c0_data2___start_val___width 6
459#define reg_gio_rw_i2c0_data2___ack_val___lsb 22
460#define reg_gio_rw_i2c0_data2___ack_val___width 6
461#define reg_gio_rw_i2c0_data2_offset 160
462
463/* Register rw_i2c1_start, scope gio, type rw */
464#define reg_gio_rw_i2c1_start___run___lsb 0
465#define reg_gio_rw_i2c1_start___run___width 1
466#define reg_gio_rw_i2c1_start___run___bit 0
467#define reg_gio_rw_i2c1_start_offset 164
468
469/* Register rw_i2c1_cfg, scope gio, type rw */
470#define reg_gio_rw_i2c1_cfg___en___lsb 0
471#define reg_gio_rw_i2c1_cfg___en___width 1
472#define reg_gio_rw_i2c1_cfg___en___bit 0
473#define reg_gio_rw_i2c1_cfg___bit_order___lsb 1
474#define reg_gio_rw_i2c1_cfg___bit_order___width 1
475#define reg_gio_rw_i2c1_cfg___bit_order___bit 1
476#define reg_gio_rw_i2c1_cfg___scl_io___lsb 2
477#define reg_gio_rw_i2c1_cfg___scl_io___width 1
478#define reg_gio_rw_i2c1_cfg___scl_io___bit 2
479#define reg_gio_rw_i2c1_cfg___scl_inv___lsb 3
480#define reg_gio_rw_i2c1_cfg___scl_inv___width 1
481#define reg_gio_rw_i2c1_cfg___scl_inv___bit 3
482#define reg_gio_rw_i2c1_cfg___sda0_io___lsb 4
483#define reg_gio_rw_i2c1_cfg___sda0_io___width 1
484#define reg_gio_rw_i2c1_cfg___sda0_io___bit 4
485#define reg_gio_rw_i2c1_cfg___sda0_idle___lsb 5
486#define reg_gio_rw_i2c1_cfg___sda0_idle___width 1
487#define reg_gio_rw_i2c1_cfg___sda0_idle___bit 5
488#define reg_gio_rw_i2c1_cfg___sda1_io___lsb 6
489#define reg_gio_rw_i2c1_cfg___sda1_io___width 1
490#define reg_gio_rw_i2c1_cfg___sda1_io___bit 6
491#define reg_gio_rw_i2c1_cfg___sda1_idle___lsb 7
492#define reg_gio_rw_i2c1_cfg___sda1_idle___width 1
493#define reg_gio_rw_i2c1_cfg___sda1_idle___bit 7
494#define reg_gio_rw_i2c1_cfg___sda2_io___lsb 8
495#define reg_gio_rw_i2c1_cfg___sda2_io___width 1
496#define reg_gio_rw_i2c1_cfg___sda2_io___bit 8
497#define reg_gio_rw_i2c1_cfg___sda2_idle___lsb 9
498#define reg_gio_rw_i2c1_cfg___sda2_idle___width 1
499#define reg_gio_rw_i2c1_cfg___sda2_idle___bit 9
500#define reg_gio_rw_i2c1_cfg___sda3_io___lsb 10
501#define reg_gio_rw_i2c1_cfg___sda3_io___width 1
502#define reg_gio_rw_i2c1_cfg___sda3_io___bit 10
503#define reg_gio_rw_i2c1_cfg___sda3_idle___lsb 11
504#define reg_gio_rw_i2c1_cfg___sda3_idle___width 1
505#define reg_gio_rw_i2c1_cfg___sda3_idle___bit 11
506#define reg_gio_rw_i2c1_cfg___sda_sel___lsb 12
507#define reg_gio_rw_i2c1_cfg___sda_sel___width 2
508#define reg_gio_rw_i2c1_cfg___sen_idle___lsb 14
509#define reg_gio_rw_i2c1_cfg___sen_idle___width 1
510#define reg_gio_rw_i2c1_cfg___sen_idle___bit 14
511#define reg_gio_rw_i2c1_cfg___sen_inv___lsb 15
512#define reg_gio_rw_i2c1_cfg___sen_inv___width 1
513#define reg_gio_rw_i2c1_cfg___sen_inv___bit 15
514#define reg_gio_rw_i2c1_cfg___sen_sel___lsb 16
515#define reg_gio_rw_i2c1_cfg___sen_sel___width 2
516#define reg_gio_rw_i2c1_cfg_offset 168
517
518/* Register rw_i2c1_ctrl, scope gio, type rw */
519#define reg_gio_rw_i2c1_ctrl___trf_bits___lsb 0
520#define reg_gio_rw_i2c1_ctrl___trf_bits___width 6
521#define reg_gio_rw_i2c1_ctrl___switch_dir___lsb 6
522#define reg_gio_rw_i2c1_ctrl___switch_dir___width 6
523#define reg_gio_rw_i2c1_ctrl___extra_start___lsb 12
524#define reg_gio_rw_i2c1_ctrl___extra_start___width 3
525#define reg_gio_rw_i2c1_ctrl___early_end___lsb 15
526#define reg_gio_rw_i2c1_ctrl___early_end___width 1
527#define reg_gio_rw_i2c1_ctrl___early_end___bit 15
528#define reg_gio_rw_i2c1_ctrl___start_stop___lsb 16
529#define reg_gio_rw_i2c1_ctrl___start_stop___width 1
530#define reg_gio_rw_i2c1_ctrl___start_stop___bit 16
531#define reg_gio_rw_i2c1_ctrl___ack_dir0___lsb 17
532#define reg_gio_rw_i2c1_ctrl___ack_dir0___width 1
533#define reg_gio_rw_i2c1_ctrl___ack_dir0___bit 17
534#define reg_gio_rw_i2c1_ctrl___ack_dir1___lsb 18
535#define reg_gio_rw_i2c1_ctrl___ack_dir1___width 1
536#define reg_gio_rw_i2c1_ctrl___ack_dir1___bit 18
537#define reg_gio_rw_i2c1_ctrl___ack_dir2___lsb 19
538#define reg_gio_rw_i2c1_ctrl___ack_dir2___width 1
539#define reg_gio_rw_i2c1_ctrl___ack_dir2___bit 19
540#define reg_gio_rw_i2c1_ctrl___ack_dir3___lsb 20
541#define reg_gio_rw_i2c1_ctrl___ack_dir3___width 1
542#define reg_gio_rw_i2c1_ctrl___ack_dir3___bit 20
543#define reg_gio_rw_i2c1_ctrl___ack_dir4___lsb 21
544#define reg_gio_rw_i2c1_ctrl___ack_dir4___width 1
545#define reg_gio_rw_i2c1_ctrl___ack_dir4___bit 21
546#define reg_gio_rw_i2c1_ctrl___ack_dir5___lsb 22
547#define reg_gio_rw_i2c1_ctrl___ack_dir5___width 1
548#define reg_gio_rw_i2c1_ctrl___ack_dir5___bit 22
549#define reg_gio_rw_i2c1_ctrl___ack_bit___lsb 23
550#define reg_gio_rw_i2c1_ctrl___ack_bit___width 1
551#define reg_gio_rw_i2c1_ctrl___ack_bit___bit 23
552#define reg_gio_rw_i2c1_ctrl___start_bit___lsb 24
553#define reg_gio_rw_i2c1_ctrl___start_bit___width 1
554#define reg_gio_rw_i2c1_ctrl___start_bit___bit 24
555#define reg_gio_rw_i2c1_ctrl___freq___lsb 25
556#define reg_gio_rw_i2c1_ctrl___freq___width 2
557#define reg_gio_rw_i2c1_ctrl_offset 172
558
559/* Register rw_i2c1_data, scope gio, type rw */
560#define reg_gio_rw_i2c1_data___data0___lsb 0
561#define reg_gio_rw_i2c1_data___data0___width 8
562#define reg_gio_rw_i2c1_data___data1___lsb 8
563#define reg_gio_rw_i2c1_data___data1___width 8
564#define reg_gio_rw_i2c1_data___data2___lsb 16
565#define reg_gio_rw_i2c1_data___data2___width 8
566#define reg_gio_rw_i2c1_data___data3___lsb 24
567#define reg_gio_rw_i2c1_data___data3___width 8
568#define reg_gio_rw_i2c1_data_offset 176
569
570/* Register rw_i2c1_data2, scope gio, type rw */
571#define reg_gio_rw_i2c1_data2___data4___lsb 0
572#define reg_gio_rw_i2c1_data2___data4___width 8
573#define reg_gio_rw_i2c1_data2___data5___lsb 8
574#define reg_gio_rw_i2c1_data2___data5___width 8
575#define reg_gio_rw_i2c1_data2___start_val___lsb 16
576#define reg_gio_rw_i2c1_data2___start_val___width 6
577#define reg_gio_rw_i2c1_data2___ack_val___lsb 22
578#define reg_gio_rw_i2c1_data2___ack_val___width 6
579#define reg_gio_rw_i2c1_data2_offset 180
580
581/* Register r_ppwm_stat, scope gio, type r */
582#define reg_gio_r_ppwm_stat___freq___lsb 0
583#define reg_gio_r_ppwm_stat___freq___width 2
584#define reg_gio_r_ppwm_stat_offset 184
585
586/* Register rw_ppwm_data, scope gio, type rw */
587#define reg_gio_rw_ppwm_data___data___lsb 0
588#define reg_gio_rw_ppwm_data___data___width 8
589#define reg_gio_rw_ppwm_data_offset 188
590
591/* Register rw_pwm0_ctrl, scope gio, type rw */
592#define reg_gio_rw_pwm0_ctrl___mode___lsb 0
593#define reg_gio_rw_pwm0_ctrl___mode___width 2
594#define reg_gio_rw_pwm0_ctrl___ccd_override___lsb 2
595#define reg_gio_rw_pwm0_ctrl___ccd_override___width 1
596#define reg_gio_rw_pwm0_ctrl___ccd_override___bit 2
597#define reg_gio_rw_pwm0_ctrl___ccd_val___lsb 3
598#define reg_gio_rw_pwm0_ctrl___ccd_val___width 1
599#define reg_gio_rw_pwm0_ctrl___ccd_val___bit 3
600#define reg_gio_rw_pwm0_ctrl_offset 192
601
602/* Register rw_pwm0_var, scope gio, type rw */
603#define reg_gio_rw_pwm0_var___lo___lsb 0
604#define reg_gio_rw_pwm0_var___lo___width 13
605#define reg_gio_rw_pwm0_var___hi___lsb 13
606#define reg_gio_rw_pwm0_var___hi___width 13
607#define reg_gio_rw_pwm0_var_offset 196
608
609/* Register rw_pwm0_data, scope gio, type rw */
610#define reg_gio_rw_pwm0_data___data___lsb 0
611#define reg_gio_rw_pwm0_data___data___width 8
612#define reg_gio_rw_pwm0_data_offset 200
613
614/* Register rw_pwm1_ctrl, scope gio, type rw */
615#define reg_gio_rw_pwm1_ctrl___mode___lsb 0
616#define reg_gio_rw_pwm1_ctrl___mode___width 2
617#define reg_gio_rw_pwm1_ctrl___ccd_override___lsb 2
618#define reg_gio_rw_pwm1_ctrl___ccd_override___width 1
619#define reg_gio_rw_pwm1_ctrl___ccd_override___bit 2
620#define reg_gio_rw_pwm1_ctrl___ccd_val___lsb 3
621#define reg_gio_rw_pwm1_ctrl___ccd_val___width 1
622#define reg_gio_rw_pwm1_ctrl___ccd_val___bit 3
623#define reg_gio_rw_pwm1_ctrl_offset 204
624
625/* Register rw_pwm1_var, scope gio, type rw */
626#define reg_gio_rw_pwm1_var___lo___lsb 0
627#define reg_gio_rw_pwm1_var___lo___width 13
628#define reg_gio_rw_pwm1_var___hi___lsb 13
629#define reg_gio_rw_pwm1_var___hi___width 13
630#define reg_gio_rw_pwm1_var_offset 208
631
632/* Register rw_pwm1_data, scope gio, type rw */
633#define reg_gio_rw_pwm1_data___data___lsb 0
634#define reg_gio_rw_pwm1_data___data___width 8
635#define reg_gio_rw_pwm1_data_offset 212
636
637/* Register rw_pwm2_ctrl, scope gio, type rw */
638#define reg_gio_rw_pwm2_ctrl___mode___lsb 0
639#define reg_gio_rw_pwm2_ctrl___mode___width 2
640#define reg_gio_rw_pwm2_ctrl___ccd_override___lsb 2
641#define reg_gio_rw_pwm2_ctrl___ccd_override___width 1
642#define reg_gio_rw_pwm2_ctrl___ccd_override___bit 2
643#define reg_gio_rw_pwm2_ctrl___ccd_val___lsb 3
644#define reg_gio_rw_pwm2_ctrl___ccd_val___width 1
645#define reg_gio_rw_pwm2_ctrl___ccd_val___bit 3
646#define reg_gio_rw_pwm2_ctrl_offset 216
647
648/* Register rw_pwm2_var, scope gio, type rw */
649#define reg_gio_rw_pwm2_var___lo___lsb 0
650#define reg_gio_rw_pwm2_var___lo___width 13
651#define reg_gio_rw_pwm2_var___hi___lsb 13
652#define reg_gio_rw_pwm2_var___hi___width 13
653#define reg_gio_rw_pwm2_var_offset 220
654
655/* Register rw_pwm2_data, scope gio, type rw */
656#define reg_gio_rw_pwm2_data___data___lsb 0
657#define reg_gio_rw_pwm2_data___data___width 8
658#define reg_gio_rw_pwm2_data_offset 224
659
660/* Register rw_pwm_in_cfg, scope gio, type rw */
661#define reg_gio_rw_pwm_in_cfg___pin___lsb 0
662#define reg_gio_rw_pwm_in_cfg___pin___width 3
663#define reg_gio_rw_pwm_in_cfg_offset 228
664
665/* Register r_pwm_in_lo, scope gio, type r */
666#define reg_gio_r_pwm_in_lo___data___lsb 0
667#define reg_gio_r_pwm_in_lo___data___width 32
668#define reg_gio_r_pwm_in_lo_offset 232
669
670/* Register r_pwm_in_hi, scope gio, type r */
671#define reg_gio_r_pwm_in_hi___data___lsb 0
672#define reg_gio_r_pwm_in_hi___data___width 32
673#define reg_gio_r_pwm_in_hi_offset 236
674
675/* Register r_pwm_in_cnt, scope gio, type r */
676#define reg_gio_r_pwm_in_cnt___data___lsb 0
677#define reg_gio_r_pwm_in_cnt___data___width 32
678#define reg_gio_r_pwm_in_cnt_offset 240
679
680
681/* Constants */
682#define regk_gio_anyedge 0x00000007
683#define regk_gio_f100k 0x00000000
684#define regk_gio_f1562 0x00000000
685#define regk_gio_f195 0x00000003
686#define regk_gio_f1m 0x00000002
687#define regk_gio_f390 0x00000002
688#define regk_gio_f400k 0x00000001
689#define regk_gio_f5m 0x00000003
690#define regk_gio_f781 0x00000001
691#define regk_gio_hi 0x00000001
692#define regk_gio_in 0x00000000
693#define regk_gio_intr_pa0 0x00000000
694#define regk_gio_intr_pa1 0x00000000
695#define regk_gio_intr_pa10 0x00000001
696#define regk_gio_intr_pa11 0x00000001
697#define regk_gio_intr_pa12 0x00000001
698#define regk_gio_intr_pa13 0x00000001
699#define regk_gio_intr_pa14 0x00000001
700#define regk_gio_intr_pa15 0x00000001
701#define regk_gio_intr_pa16 0x00000002
702#define regk_gio_intr_pa17 0x00000002
703#define regk_gio_intr_pa18 0x00000002
704#define regk_gio_intr_pa19 0x00000002
705#define regk_gio_intr_pa2 0x00000000
706#define regk_gio_intr_pa20 0x00000002
707#define regk_gio_intr_pa21 0x00000002
708#define regk_gio_intr_pa22 0x00000002
709#define regk_gio_intr_pa23 0x00000002
710#define regk_gio_intr_pa24 0x00000003
711#define regk_gio_intr_pa25 0x00000003
712#define regk_gio_intr_pa26 0x00000003
713#define regk_gio_intr_pa27 0x00000003
714#define regk_gio_intr_pa28 0x00000003
715#define regk_gio_intr_pa29 0x00000003
716#define regk_gio_intr_pa3 0x00000000
717#define regk_gio_intr_pa30 0x00000003
718#define regk_gio_intr_pa31 0x00000003
719#define regk_gio_intr_pa4 0x00000000
720#define regk_gio_intr_pa5 0x00000000
721#define regk_gio_intr_pa6 0x00000000
722#define regk_gio_intr_pa7 0x00000000
723#define regk_gio_intr_pa8 0x00000001
724#define regk_gio_intr_pa9 0x00000001
725#define regk_gio_intr_pb0 0x00000004
726#define regk_gio_intr_pb1 0x00000004
727#define regk_gio_intr_pb10 0x00000005
728#define regk_gio_intr_pb11 0x00000005
729#define regk_gio_intr_pb12 0x00000005
730#define regk_gio_intr_pb13 0x00000005
731#define regk_gio_intr_pb14 0x00000005
732#define regk_gio_intr_pb15 0x00000005
733#define regk_gio_intr_pb16 0x00000006
734#define regk_gio_intr_pb17 0x00000006
735#define regk_gio_intr_pb18 0x00000006
736#define regk_gio_intr_pb19 0x00000006
737#define regk_gio_intr_pb2 0x00000004
738#define regk_gio_intr_pb20 0x00000006
739#define regk_gio_intr_pb21 0x00000006
740#define regk_gio_intr_pb22 0x00000006
741#define regk_gio_intr_pb23 0x00000006
742#define regk_gio_intr_pb24 0x00000007
743#define regk_gio_intr_pb25 0x00000007
744#define regk_gio_intr_pb26 0x00000007
745#define regk_gio_intr_pb27 0x00000007
746#define regk_gio_intr_pb28 0x00000007
747#define regk_gio_intr_pb29 0x00000007
748#define regk_gio_intr_pb3 0x00000004
749#define regk_gio_intr_pb30 0x00000007
750#define regk_gio_intr_pb31 0x00000007
751#define regk_gio_intr_pb4 0x00000004
752#define regk_gio_intr_pb5 0x00000004
753#define regk_gio_intr_pb6 0x00000004
754#define regk_gio_intr_pb7 0x00000004
755#define regk_gio_intr_pb8 0x00000005
756#define regk_gio_intr_pb9 0x00000005
757#define regk_gio_intr_pc0 0x00000008
758#define regk_gio_intr_pc1 0x00000008
759#define regk_gio_intr_pc10 0x00000009
760#define regk_gio_intr_pc11 0x00000009
761#define regk_gio_intr_pc12 0x00000009
762#define regk_gio_intr_pc13 0x00000009
763#define regk_gio_intr_pc14 0x00000009
764#define regk_gio_intr_pc15 0x00000009
765#define regk_gio_intr_pc2 0x00000008
766#define regk_gio_intr_pc3 0x00000008
767#define regk_gio_intr_pc4 0x00000008
768#define regk_gio_intr_pc5 0x00000008
769#define regk_gio_intr_pc6 0x00000008
770#define regk_gio_intr_pc7 0x00000008
771#define regk_gio_intr_pc8 0x00000009
772#define regk_gio_intr_pc9 0x00000009
773#define regk_gio_intr_pd0 0x0000000c
774#define regk_gio_intr_pd1 0x0000000c
775#define regk_gio_intr_pd10 0x0000000d
776#define regk_gio_intr_pd11 0x0000000d
777#define regk_gio_intr_pd12 0x0000000d
778#define regk_gio_intr_pd13 0x0000000d
779#define regk_gio_intr_pd14 0x0000000d
780#define regk_gio_intr_pd15 0x0000000d
781#define regk_gio_intr_pd16 0x0000000e
782#define regk_gio_intr_pd17 0x0000000e
783#define regk_gio_intr_pd18 0x0000000e
784#define regk_gio_intr_pd19 0x0000000e
785#define regk_gio_intr_pd2 0x0000000c
786#define regk_gio_intr_pd20 0x0000000e
787#define regk_gio_intr_pd21 0x0000000e
788#define regk_gio_intr_pd22 0x0000000e
789#define regk_gio_intr_pd23 0x0000000e
790#define regk_gio_intr_pd24 0x0000000f
791#define regk_gio_intr_pd25 0x0000000f
792#define regk_gio_intr_pd26 0x0000000f
793#define regk_gio_intr_pd27 0x0000000f
794#define regk_gio_intr_pd28 0x0000000f
795#define regk_gio_intr_pd29 0x0000000f
796#define regk_gio_intr_pd3 0x0000000c
797#define regk_gio_intr_pd30 0x0000000f
798#define regk_gio_intr_pd31 0x0000000f
799#define regk_gio_intr_pd4 0x0000000c
800#define regk_gio_intr_pd5 0x0000000c
801#define regk_gio_intr_pd6 0x0000000c
802#define regk_gio_intr_pd7 0x0000000c
803#define regk_gio_intr_pd8 0x0000000d
804#define regk_gio_intr_pd9 0x0000000d
805#define regk_gio_lo 0x00000002
806#define regk_gio_lsb 0x00000000
807#define regk_gio_msb 0x00000001
808#define regk_gio_negedge 0x00000006
809#define regk_gio_no 0x00000000
810#define regk_gio_no_switch 0x0000003f
811#define regk_gio_none 0x00000007
812#define regk_gio_off 0x00000000
813#define regk_gio_opendrain 0x00000000
814#define regk_gio_out 0x00000001
815#define regk_gio_posedge 0x00000005
816#define regk_gio_pwm_hfp 0x00000002
817#define regk_gio_pwm_pa0 0x00000001
818#define regk_gio_pwm_pa19 0x00000004
819#define regk_gio_pwm_pa6 0x00000002
820#define regk_gio_pwm_pa7 0x00000003
821#define regk_gio_pwm_pb26 0x00000005
822#define regk_gio_pwm_pd23 0x00000006
823#define regk_gio_pwm_pd31 0x00000007
824#define regk_gio_pwm_std 0x00000001
825#define regk_gio_pwm_var 0x00000003
826#define regk_gio_rw_i2c0_cfg_default 0x00000020
827#define regk_gio_rw_i2c0_ctrl_default 0x00010000
828#define regk_gio_rw_i2c0_start_default 0x00000000
829#define regk_gio_rw_i2c1_cfg_default 0x00000aa0
830#define regk_gio_rw_i2c1_ctrl_default 0x00010000
831#define regk_gio_rw_i2c1_start_default 0x00000000
832#define regk_gio_rw_intr_cfg_default 0x00000000
833#define regk_gio_rw_intr_mask_default 0x00000000
834#define regk_gio_rw_pa_oe_default 0x00000000
835#define regk_gio_rw_pb_oe_default 0x00000000
836#define regk_gio_rw_pc_oe_default 0x00000000
837#define regk_gio_rw_ppwm_data_default 0x00000000
838#define regk_gio_rw_pwm0_ctrl_default 0x00000000
839#define regk_gio_rw_pwm1_ctrl_default 0x00000000
840#define regk_gio_rw_pwm2_ctrl_default 0x00000000
841#define regk_gio_rw_pwm_in_cfg_default 0x00000000
842#define regk_gio_sda0 0x00000000
843#define regk_gio_sda1 0x00000001
844#define regk_gio_sda2 0x00000002
845#define regk_gio_sda3 0x00000003
846#define regk_gio_sen 0x00000000
847#define regk_gio_set 0x00000003
848#define regk_gio_yes 0x00000001
849#endif /* __gio_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/asm/pinmux_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/pinmux_defs_asm.h
new file mode 100644
index 000000000000..c3dc9c666c46
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/pinmux_defs_asm.h
@@ -0,0 +1,572 @@
1#ifndef __pinmux_defs_asm_h
2#define __pinmux_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: pinmux.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile pinmux_defs_asm.h pinmux.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53/* Register rw_hwprot, scope pinmux, type rw */
54#define reg_pinmux_rw_hwprot___eth___lsb 0
55#define reg_pinmux_rw_hwprot___eth___width 1
56#define reg_pinmux_rw_hwprot___eth___bit 0
57#define reg_pinmux_rw_hwprot___eth_mdio___lsb 1
58#define reg_pinmux_rw_hwprot___eth_mdio___width 1
59#define reg_pinmux_rw_hwprot___eth_mdio___bit 1
60#define reg_pinmux_rw_hwprot___geth___lsb 2
61#define reg_pinmux_rw_hwprot___geth___width 1
62#define reg_pinmux_rw_hwprot___geth___bit 2
63#define reg_pinmux_rw_hwprot___tg___lsb 3
64#define reg_pinmux_rw_hwprot___tg___width 1
65#define reg_pinmux_rw_hwprot___tg___bit 3
66#define reg_pinmux_rw_hwprot___tg_clk___lsb 4
67#define reg_pinmux_rw_hwprot___tg_clk___width 1
68#define reg_pinmux_rw_hwprot___tg_clk___bit 4
69#define reg_pinmux_rw_hwprot___vout___lsb 5
70#define reg_pinmux_rw_hwprot___vout___width 1
71#define reg_pinmux_rw_hwprot___vout___bit 5
72#define reg_pinmux_rw_hwprot___vout_sync___lsb 6
73#define reg_pinmux_rw_hwprot___vout_sync___width 1
74#define reg_pinmux_rw_hwprot___vout_sync___bit 6
75#define reg_pinmux_rw_hwprot___ser1___lsb 7
76#define reg_pinmux_rw_hwprot___ser1___width 1
77#define reg_pinmux_rw_hwprot___ser1___bit 7
78#define reg_pinmux_rw_hwprot___ser2___lsb 8
79#define reg_pinmux_rw_hwprot___ser2___width 1
80#define reg_pinmux_rw_hwprot___ser2___bit 8
81#define reg_pinmux_rw_hwprot___ser3___lsb 9
82#define reg_pinmux_rw_hwprot___ser3___width 1
83#define reg_pinmux_rw_hwprot___ser3___bit 9
84#define reg_pinmux_rw_hwprot___ser4___lsb 10
85#define reg_pinmux_rw_hwprot___ser4___width 1
86#define reg_pinmux_rw_hwprot___ser4___bit 10
87#define reg_pinmux_rw_hwprot___sser___lsb 11
88#define reg_pinmux_rw_hwprot___sser___width 1
89#define reg_pinmux_rw_hwprot___sser___bit 11
90#define reg_pinmux_rw_hwprot___pwm0___lsb 12
91#define reg_pinmux_rw_hwprot___pwm0___width 1
92#define reg_pinmux_rw_hwprot___pwm0___bit 12
93#define reg_pinmux_rw_hwprot___pwm1___lsb 13
94#define reg_pinmux_rw_hwprot___pwm1___width 1
95#define reg_pinmux_rw_hwprot___pwm1___bit 13
96#define reg_pinmux_rw_hwprot___pwm2___lsb 14
97#define reg_pinmux_rw_hwprot___pwm2___width 1
98#define reg_pinmux_rw_hwprot___pwm2___bit 14
99#define reg_pinmux_rw_hwprot___timer0___lsb 15
100#define reg_pinmux_rw_hwprot___timer0___width 1
101#define reg_pinmux_rw_hwprot___timer0___bit 15
102#define reg_pinmux_rw_hwprot___timer1___lsb 16
103#define reg_pinmux_rw_hwprot___timer1___width 1
104#define reg_pinmux_rw_hwprot___timer1___bit 16
105#define reg_pinmux_rw_hwprot___pio___lsb 17
106#define reg_pinmux_rw_hwprot___pio___width 1
107#define reg_pinmux_rw_hwprot___pio___bit 17
108#define reg_pinmux_rw_hwprot___i2c0___lsb 18
109#define reg_pinmux_rw_hwprot___i2c0___width 1
110#define reg_pinmux_rw_hwprot___i2c0___bit 18
111#define reg_pinmux_rw_hwprot___i2c1___lsb 19
112#define reg_pinmux_rw_hwprot___i2c1___width 1
113#define reg_pinmux_rw_hwprot___i2c1___bit 19
114#define reg_pinmux_rw_hwprot___i2c1_sda1___lsb 20
115#define reg_pinmux_rw_hwprot___i2c1_sda1___width 1
116#define reg_pinmux_rw_hwprot___i2c1_sda1___bit 20
117#define reg_pinmux_rw_hwprot___i2c1_sda2___lsb 21
118#define reg_pinmux_rw_hwprot___i2c1_sda2___width 1
119#define reg_pinmux_rw_hwprot___i2c1_sda2___bit 21
120#define reg_pinmux_rw_hwprot___i2c1_sda3___lsb 22
121#define reg_pinmux_rw_hwprot___i2c1_sda3___width 1
122#define reg_pinmux_rw_hwprot___i2c1_sda3___bit 22
123#define reg_pinmux_rw_hwprot___i2c1_sen___lsb 23
124#define reg_pinmux_rw_hwprot___i2c1_sen___width 1
125#define reg_pinmux_rw_hwprot___i2c1_sen___bit 23
126#define reg_pinmux_rw_hwprot_offset 0
127
128/* Register rw_gio_pa, scope pinmux, type rw */
129#define reg_pinmux_rw_gio_pa___pa0___lsb 0
130#define reg_pinmux_rw_gio_pa___pa0___width 1
131#define reg_pinmux_rw_gio_pa___pa0___bit 0
132#define reg_pinmux_rw_gio_pa___pa1___lsb 1
133#define reg_pinmux_rw_gio_pa___pa1___width 1
134#define reg_pinmux_rw_gio_pa___pa1___bit 1
135#define reg_pinmux_rw_gio_pa___pa2___lsb 2
136#define reg_pinmux_rw_gio_pa___pa2___width 1
137#define reg_pinmux_rw_gio_pa___pa2___bit 2
138#define reg_pinmux_rw_gio_pa___pa3___lsb 3
139#define reg_pinmux_rw_gio_pa___pa3___width 1
140#define reg_pinmux_rw_gio_pa___pa3___bit 3
141#define reg_pinmux_rw_gio_pa___pa4___lsb 4
142#define reg_pinmux_rw_gio_pa___pa4___width 1
143#define reg_pinmux_rw_gio_pa___pa4___bit 4
144#define reg_pinmux_rw_gio_pa___pa5___lsb 5
145#define reg_pinmux_rw_gio_pa___pa5___width 1
146#define reg_pinmux_rw_gio_pa___pa5___bit 5
147#define reg_pinmux_rw_gio_pa___pa6___lsb 6
148#define reg_pinmux_rw_gio_pa___pa6___width 1
149#define reg_pinmux_rw_gio_pa___pa6___bit 6
150#define reg_pinmux_rw_gio_pa___pa7___lsb 7
151#define reg_pinmux_rw_gio_pa___pa7___width 1
152#define reg_pinmux_rw_gio_pa___pa7___bit 7
153#define reg_pinmux_rw_gio_pa___pa8___lsb 8
154#define reg_pinmux_rw_gio_pa___pa8___width 1
155#define reg_pinmux_rw_gio_pa___pa8___bit 8
156#define reg_pinmux_rw_gio_pa___pa9___lsb 9
157#define reg_pinmux_rw_gio_pa___pa9___width 1
158#define reg_pinmux_rw_gio_pa___pa9___bit 9
159#define reg_pinmux_rw_gio_pa___pa10___lsb 10
160#define reg_pinmux_rw_gio_pa___pa10___width 1
161#define reg_pinmux_rw_gio_pa___pa10___bit 10
162#define reg_pinmux_rw_gio_pa___pa11___lsb 11
163#define reg_pinmux_rw_gio_pa___pa11___width 1
164#define reg_pinmux_rw_gio_pa___pa11___bit 11
165#define reg_pinmux_rw_gio_pa___pa12___lsb 12
166#define reg_pinmux_rw_gio_pa___pa12___width 1
167#define reg_pinmux_rw_gio_pa___pa12___bit 12
168#define reg_pinmux_rw_gio_pa___pa13___lsb 13
169#define reg_pinmux_rw_gio_pa___pa13___width 1
170#define reg_pinmux_rw_gio_pa___pa13___bit 13
171#define reg_pinmux_rw_gio_pa___pa14___lsb 14
172#define reg_pinmux_rw_gio_pa___pa14___width 1
173#define reg_pinmux_rw_gio_pa___pa14___bit 14
174#define reg_pinmux_rw_gio_pa___pa15___lsb 15
175#define reg_pinmux_rw_gio_pa___pa15___width 1
176#define reg_pinmux_rw_gio_pa___pa15___bit 15
177#define reg_pinmux_rw_gio_pa___pa16___lsb 16
178#define reg_pinmux_rw_gio_pa___pa16___width 1
179#define reg_pinmux_rw_gio_pa___pa16___bit 16
180#define reg_pinmux_rw_gio_pa___pa17___lsb 17
181#define reg_pinmux_rw_gio_pa___pa17___width 1
182#define reg_pinmux_rw_gio_pa___pa17___bit 17
183#define reg_pinmux_rw_gio_pa___pa18___lsb 18
184#define reg_pinmux_rw_gio_pa___pa18___width 1
185#define reg_pinmux_rw_gio_pa___pa18___bit 18
186#define reg_pinmux_rw_gio_pa___pa19___lsb 19
187#define reg_pinmux_rw_gio_pa___pa19___width 1
188#define reg_pinmux_rw_gio_pa___pa19___bit 19
189#define reg_pinmux_rw_gio_pa___pa20___lsb 20
190#define reg_pinmux_rw_gio_pa___pa20___width 1
191#define reg_pinmux_rw_gio_pa___pa20___bit 20
192#define reg_pinmux_rw_gio_pa___pa21___lsb 21
193#define reg_pinmux_rw_gio_pa___pa21___width 1
194#define reg_pinmux_rw_gio_pa___pa21___bit 21
195#define reg_pinmux_rw_gio_pa___pa22___lsb 22
196#define reg_pinmux_rw_gio_pa___pa22___width 1
197#define reg_pinmux_rw_gio_pa___pa22___bit 22
198#define reg_pinmux_rw_gio_pa___pa23___lsb 23
199#define reg_pinmux_rw_gio_pa___pa23___width 1
200#define reg_pinmux_rw_gio_pa___pa23___bit 23
201#define reg_pinmux_rw_gio_pa___pa24___lsb 24
202#define reg_pinmux_rw_gio_pa___pa24___width 1
203#define reg_pinmux_rw_gio_pa___pa24___bit 24
204#define reg_pinmux_rw_gio_pa___pa25___lsb 25
205#define reg_pinmux_rw_gio_pa___pa25___width 1
206#define reg_pinmux_rw_gio_pa___pa25___bit 25
207#define reg_pinmux_rw_gio_pa___pa26___lsb 26
208#define reg_pinmux_rw_gio_pa___pa26___width 1
209#define reg_pinmux_rw_gio_pa___pa26___bit 26
210#define reg_pinmux_rw_gio_pa___pa27___lsb 27
211#define reg_pinmux_rw_gio_pa___pa27___width 1
212#define reg_pinmux_rw_gio_pa___pa27___bit 27
213#define reg_pinmux_rw_gio_pa___pa28___lsb 28
214#define reg_pinmux_rw_gio_pa___pa28___width 1
215#define reg_pinmux_rw_gio_pa___pa28___bit 28
216#define reg_pinmux_rw_gio_pa___pa29___lsb 29
217#define reg_pinmux_rw_gio_pa___pa29___width 1
218#define reg_pinmux_rw_gio_pa___pa29___bit 29
219#define reg_pinmux_rw_gio_pa___pa30___lsb 30
220#define reg_pinmux_rw_gio_pa___pa30___width 1
221#define reg_pinmux_rw_gio_pa___pa30___bit 30
222#define reg_pinmux_rw_gio_pa___pa31___lsb 31
223#define reg_pinmux_rw_gio_pa___pa31___width 1
224#define reg_pinmux_rw_gio_pa___pa31___bit 31
225#define reg_pinmux_rw_gio_pa_offset 4
226
227/* Register rw_gio_pb, scope pinmux, type rw */
228#define reg_pinmux_rw_gio_pb___pb0___lsb 0
229#define reg_pinmux_rw_gio_pb___pb0___width 1
230#define reg_pinmux_rw_gio_pb___pb0___bit 0
231#define reg_pinmux_rw_gio_pb___pb1___lsb 1
232#define reg_pinmux_rw_gio_pb___pb1___width 1
233#define reg_pinmux_rw_gio_pb___pb1___bit 1
234#define reg_pinmux_rw_gio_pb___pb2___lsb 2
235#define reg_pinmux_rw_gio_pb___pb2___width 1
236#define reg_pinmux_rw_gio_pb___pb2___bit 2
237#define reg_pinmux_rw_gio_pb___pb3___lsb 3
238#define reg_pinmux_rw_gio_pb___pb3___width 1
239#define reg_pinmux_rw_gio_pb___pb3___bit 3
240#define reg_pinmux_rw_gio_pb___pb4___lsb 4
241#define reg_pinmux_rw_gio_pb___pb4___width 1
242#define reg_pinmux_rw_gio_pb___pb4___bit 4
243#define reg_pinmux_rw_gio_pb___pb5___lsb 5
244#define reg_pinmux_rw_gio_pb___pb5___width 1
245#define reg_pinmux_rw_gio_pb___pb5___bit 5
246#define reg_pinmux_rw_gio_pb___pb6___lsb 6
247#define reg_pinmux_rw_gio_pb___pb6___width 1
248#define reg_pinmux_rw_gio_pb___pb6___bit 6
249#define reg_pinmux_rw_gio_pb___pb7___lsb 7
250#define reg_pinmux_rw_gio_pb___pb7___width 1
251#define reg_pinmux_rw_gio_pb___pb7___bit 7
252#define reg_pinmux_rw_gio_pb___pb8___lsb 8
253#define reg_pinmux_rw_gio_pb___pb8___width 1
254#define reg_pinmux_rw_gio_pb___pb8___bit 8
255#define reg_pinmux_rw_gio_pb___pb9___lsb 9
256#define reg_pinmux_rw_gio_pb___pb9___width 1
257#define reg_pinmux_rw_gio_pb___pb9___bit 9
258#define reg_pinmux_rw_gio_pb___pb10___lsb 10
259#define reg_pinmux_rw_gio_pb___pb10___width 1
260#define reg_pinmux_rw_gio_pb___pb10___bit 10
261#define reg_pinmux_rw_gio_pb___pb11___lsb 11
262#define reg_pinmux_rw_gio_pb___pb11___width 1
263#define reg_pinmux_rw_gio_pb___pb11___bit 11
264#define reg_pinmux_rw_gio_pb___pb12___lsb 12
265#define reg_pinmux_rw_gio_pb___pb12___width 1
266#define reg_pinmux_rw_gio_pb___pb12___bit 12
267#define reg_pinmux_rw_gio_pb___pb13___lsb 13
268#define reg_pinmux_rw_gio_pb___pb13___width 1
269#define reg_pinmux_rw_gio_pb___pb13___bit 13
270#define reg_pinmux_rw_gio_pb___pb14___lsb 14
271#define reg_pinmux_rw_gio_pb___pb14___width 1
272#define reg_pinmux_rw_gio_pb___pb14___bit 14
273#define reg_pinmux_rw_gio_pb___pb15___lsb 15
274#define reg_pinmux_rw_gio_pb___pb15___width 1
275#define reg_pinmux_rw_gio_pb___pb15___bit 15
276#define reg_pinmux_rw_gio_pb___pb16___lsb 16
277#define reg_pinmux_rw_gio_pb___pb16___width 1
278#define reg_pinmux_rw_gio_pb___pb16___bit 16
279#define reg_pinmux_rw_gio_pb___pb17___lsb 17
280#define reg_pinmux_rw_gio_pb___pb17___width 1
281#define reg_pinmux_rw_gio_pb___pb17___bit 17
282#define reg_pinmux_rw_gio_pb___pb18___lsb 18
283#define reg_pinmux_rw_gio_pb___pb18___width 1
284#define reg_pinmux_rw_gio_pb___pb18___bit 18
285#define reg_pinmux_rw_gio_pb___pb19___lsb 19
286#define reg_pinmux_rw_gio_pb___pb19___width 1
287#define reg_pinmux_rw_gio_pb___pb19___bit 19
288#define reg_pinmux_rw_gio_pb___pb20___lsb 20
289#define reg_pinmux_rw_gio_pb___pb20___width 1
290#define reg_pinmux_rw_gio_pb___pb20___bit 20
291#define reg_pinmux_rw_gio_pb___pb21___lsb 21
292#define reg_pinmux_rw_gio_pb___pb21___width 1
293#define reg_pinmux_rw_gio_pb___pb21___bit 21
294#define reg_pinmux_rw_gio_pb___pb22___lsb 22
295#define reg_pinmux_rw_gio_pb___pb22___width 1
296#define reg_pinmux_rw_gio_pb___pb22___bit 22
297#define reg_pinmux_rw_gio_pb___pb23___lsb 23
298#define reg_pinmux_rw_gio_pb___pb23___width 1
299#define reg_pinmux_rw_gio_pb___pb23___bit 23
300#define reg_pinmux_rw_gio_pb___pb24___lsb 24
301#define reg_pinmux_rw_gio_pb___pb24___width 1
302#define reg_pinmux_rw_gio_pb___pb24___bit 24
303#define reg_pinmux_rw_gio_pb___pb25___lsb 25
304#define reg_pinmux_rw_gio_pb___pb25___width 1
305#define reg_pinmux_rw_gio_pb___pb25___bit 25
306#define reg_pinmux_rw_gio_pb___pb26___lsb 26
307#define reg_pinmux_rw_gio_pb___pb26___width 1
308#define reg_pinmux_rw_gio_pb___pb26___bit 26
309#define reg_pinmux_rw_gio_pb___pb27___lsb 27
310#define reg_pinmux_rw_gio_pb___pb27___width 1
311#define reg_pinmux_rw_gio_pb___pb27___bit 27
312#define reg_pinmux_rw_gio_pb___pb28___lsb 28
313#define reg_pinmux_rw_gio_pb___pb28___width 1
314#define reg_pinmux_rw_gio_pb___pb28___bit 28
315#define reg_pinmux_rw_gio_pb___pb29___lsb 29
316#define reg_pinmux_rw_gio_pb___pb29___width 1
317#define reg_pinmux_rw_gio_pb___pb29___bit 29
318#define reg_pinmux_rw_gio_pb___pb30___lsb 30
319#define reg_pinmux_rw_gio_pb___pb30___width 1
320#define reg_pinmux_rw_gio_pb___pb30___bit 30
321#define reg_pinmux_rw_gio_pb___pb31___lsb 31
322#define reg_pinmux_rw_gio_pb___pb31___width 1
323#define reg_pinmux_rw_gio_pb___pb31___bit 31
324#define reg_pinmux_rw_gio_pb_offset 8
325
326/* Register rw_gio_pc, scope pinmux, type rw */
327#define reg_pinmux_rw_gio_pc___pc0___lsb 0
328#define reg_pinmux_rw_gio_pc___pc0___width 1
329#define reg_pinmux_rw_gio_pc___pc0___bit 0
330#define reg_pinmux_rw_gio_pc___pc1___lsb 1
331#define reg_pinmux_rw_gio_pc___pc1___width 1
332#define reg_pinmux_rw_gio_pc___pc1___bit 1
333#define reg_pinmux_rw_gio_pc___pc2___lsb 2
334#define reg_pinmux_rw_gio_pc___pc2___width 1
335#define reg_pinmux_rw_gio_pc___pc2___bit 2
336#define reg_pinmux_rw_gio_pc___pc3___lsb 3
337#define reg_pinmux_rw_gio_pc___pc3___width 1
338#define reg_pinmux_rw_gio_pc___pc3___bit 3
339#define reg_pinmux_rw_gio_pc___pc4___lsb 4
340#define reg_pinmux_rw_gio_pc___pc4___width 1
341#define reg_pinmux_rw_gio_pc___pc4___bit 4
342#define reg_pinmux_rw_gio_pc___pc5___lsb 5
343#define reg_pinmux_rw_gio_pc___pc5___width 1
344#define reg_pinmux_rw_gio_pc___pc5___bit 5
345#define reg_pinmux_rw_gio_pc___pc6___lsb 6
346#define reg_pinmux_rw_gio_pc___pc6___width 1
347#define reg_pinmux_rw_gio_pc___pc6___bit 6
348#define reg_pinmux_rw_gio_pc___pc7___lsb 7
349#define reg_pinmux_rw_gio_pc___pc7___width 1
350#define reg_pinmux_rw_gio_pc___pc7___bit 7
351#define reg_pinmux_rw_gio_pc___pc8___lsb 8
352#define reg_pinmux_rw_gio_pc___pc8___width 1
353#define reg_pinmux_rw_gio_pc___pc8___bit 8
354#define reg_pinmux_rw_gio_pc___pc9___lsb 9
355#define reg_pinmux_rw_gio_pc___pc9___width 1
356#define reg_pinmux_rw_gio_pc___pc9___bit 9
357#define reg_pinmux_rw_gio_pc___pc10___lsb 10
358#define reg_pinmux_rw_gio_pc___pc10___width 1
359#define reg_pinmux_rw_gio_pc___pc10___bit 10
360#define reg_pinmux_rw_gio_pc___pc11___lsb 11
361#define reg_pinmux_rw_gio_pc___pc11___width 1
362#define reg_pinmux_rw_gio_pc___pc11___bit 11
363#define reg_pinmux_rw_gio_pc___pc12___lsb 12
364#define reg_pinmux_rw_gio_pc___pc12___width 1
365#define reg_pinmux_rw_gio_pc___pc12___bit 12
366#define reg_pinmux_rw_gio_pc___pc13___lsb 13
367#define reg_pinmux_rw_gio_pc___pc13___width 1
368#define reg_pinmux_rw_gio_pc___pc13___bit 13
369#define reg_pinmux_rw_gio_pc___pc14___lsb 14
370#define reg_pinmux_rw_gio_pc___pc14___width 1
371#define reg_pinmux_rw_gio_pc___pc14___bit 14
372#define reg_pinmux_rw_gio_pc___pc15___lsb 15
373#define reg_pinmux_rw_gio_pc___pc15___width 1
374#define reg_pinmux_rw_gio_pc___pc15___bit 15
375#define reg_pinmux_rw_gio_pc_offset 12
376
377/* Register rw_iop_pa, scope pinmux, type rw */
378#define reg_pinmux_rw_iop_pa___pa0___lsb 0
379#define reg_pinmux_rw_iop_pa___pa0___width 1
380#define reg_pinmux_rw_iop_pa___pa0___bit 0
381#define reg_pinmux_rw_iop_pa___pa1___lsb 1
382#define reg_pinmux_rw_iop_pa___pa1___width 1
383#define reg_pinmux_rw_iop_pa___pa1___bit 1
384#define reg_pinmux_rw_iop_pa___pa2___lsb 2
385#define reg_pinmux_rw_iop_pa___pa2___width 1
386#define reg_pinmux_rw_iop_pa___pa2___bit 2
387#define reg_pinmux_rw_iop_pa___pa3___lsb 3
388#define reg_pinmux_rw_iop_pa___pa3___width 1
389#define reg_pinmux_rw_iop_pa___pa3___bit 3
390#define reg_pinmux_rw_iop_pa___pa4___lsb 4
391#define reg_pinmux_rw_iop_pa___pa4___width 1
392#define reg_pinmux_rw_iop_pa___pa4___bit 4
393#define reg_pinmux_rw_iop_pa___pa5___lsb 5
394#define reg_pinmux_rw_iop_pa___pa5___width 1
395#define reg_pinmux_rw_iop_pa___pa5___bit 5
396#define reg_pinmux_rw_iop_pa___pa6___lsb 6
397#define reg_pinmux_rw_iop_pa___pa6___width 1
398#define reg_pinmux_rw_iop_pa___pa6___bit 6
399#define reg_pinmux_rw_iop_pa___pa7___lsb 7
400#define reg_pinmux_rw_iop_pa___pa7___width 1
401#define reg_pinmux_rw_iop_pa___pa7___bit 7
402#define reg_pinmux_rw_iop_pa___pa8___lsb 8
403#define reg_pinmux_rw_iop_pa___pa8___width 1
404#define reg_pinmux_rw_iop_pa___pa8___bit 8
405#define reg_pinmux_rw_iop_pa___pa9___lsb 9
406#define reg_pinmux_rw_iop_pa___pa9___width 1
407#define reg_pinmux_rw_iop_pa___pa9___bit 9
408#define reg_pinmux_rw_iop_pa___pa10___lsb 10
409#define reg_pinmux_rw_iop_pa___pa10___width 1
410#define reg_pinmux_rw_iop_pa___pa10___bit 10
411#define reg_pinmux_rw_iop_pa___pa11___lsb 11
412#define reg_pinmux_rw_iop_pa___pa11___width 1
413#define reg_pinmux_rw_iop_pa___pa11___bit 11
414#define reg_pinmux_rw_iop_pa___pa12___lsb 12
415#define reg_pinmux_rw_iop_pa___pa12___width 1
416#define reg_pinmux_rw_iop_pa___pa12___bit 12
417#define reg_pinmux_rw_iop_pa___pa13___lsb 13
418#define reg_pinmux_rw_iop_pa___pa13___width 1
419#define reg_pinmux_rw_iop_pa___pa13___bit 13
420#define reg_pinmux_rw_iop_pa___pa14___lsb 14
421#define reg_pinmux_rw_iop_pa___pa14___width 1
422#define reg_pinmux_rw_iop_pa___pa14___bit 14
423#define reg_pinmux_rw_iop_pa___pa15___lsb 15
424#define reg_pinmux_rw_iop_pa___pa15___width 1
425#define reg_pinmux_rw_iop_pa___pa15___bit 15
426#define reg_pinmux_rw_iop_pa___pa16___lsb 16
427#define reg_pinmux_rw_iop_pa___pa16___width 1
428#define reg_pinmux_rw_iop_pa___pa16___bit 16
429#define reg_pinmux_rw_iop_pa___pa17___lsb 17
430#define reg_pinmux_rw_iop_pa___pa17___width 1
431#define reg_pinmux_rw_iop_pa___pa17___bit 17
432#define reg_pinmux_rw_iop_pa___pa18___lsb 18
433#define reg_pinmux_rw_iop_pa___pa18___width 1
434#define reg_pinmux_rw_iop_pa___pa18___bit 18
435#define reg_pinmux_rw_iop_pa___pa19___lsb 19
436#define reg_pinmux_rw_iop_pa___pa19___width 1
437#define reg_pinmux_rw_iop_pa___pa19___bit 19
438#define reg_pinmux_rw_iop_pa___pa20___lsb 20
439#define reg_pinmux_rw_iop_pa___pa20___width 1
440#define reg_pinmux_rw_iop_pa___pa20___bit 20
441#define reg_pinmux_rw_iop_pa___pa21___lsb 21
442#define reg_pinmux_rw_iop_pa___pa21___width 1
443#define reg_pinmux_rw_iop_pa___pa21___bit 21
444#define reg_pinmux_rw_iop_pa___pa22___lsb 22
445#define reg_pinmux_rw_iop_pa___pa22___width 1
446#define reg_pinmux_rw_iop_pa___pa22___bit 22
447#define reg_pinmux_rw_iop_pa___pa23___lsb 23
448#define reg_pinmux_rw_iop_pa___pa23___width 1
449#define reg_pinmux_rw_iop_pa___pa23___bit 23
450#define reg_pinmux_rw_iop_pa___pa24___lsb 24
451#define reg_pinmux_rw_iop_pa___pa24___width 1
452#define reg_pinmux_rw_iop_pa___pa24___bit 24
453#define reg_pinmux_rw_iop_pa___pa25___lsb 25
454#define reg_pinmux_rw_iop_pa___pa25___width 1
455#define reg_pinmux_rw_iop_pa___pa25___bit 25
456#define reg_pinmux_rw_iop_pa___pa26___lsb 26
457#define reg_pinmux_rw_iop_pa___pa26___width 1
458#define reg_pinmux_rw_iop_pa___pa26___bit 26
459#define reg_pinmux_rw_iop_pa___pa27___lsb 27
460#define reg_pinmux_rw_iop_pa___pa27___width 1
461#define reg_pinmux_rw_iop_pa___pa27___bit 27
462#define reg_pinmux_rw_iop_pa___pa28___lsb 28
463#define reg_pinmux_rw_iop_pa___pa28___width 1
464#define reg_pinmux_rw_iop_pa___pa28___bit 28
465#define reg_pinmux_rw_iop_pa___pa29___lsb 29
466#define reg_pinmux_rw_iop_pa___pa29___width 1
467#define reg_pinmux_rw_iop_pa___pa29___bit 29
468#define reg_pinmux_rw_iop_pa___pa30___lsb 30
469#define reg_pinmux_rw_iop_pa___pa30___width 1
470#define reg_pinmux_rw_iop_pa___pa30___bit 30
471#define reg_pinmux_rw_iop_pa___pa31___lsb 31
472#define reg_pinmux_rw_iop_pa___pa31___width 1
473#define reg_pinmux_rw_iop_pa___pa31___bit 31
474#define reg_pinmux_rw_iop_pa_offset 16
475
476/* Register rw_iop_pb, scope pinmux, type rw */
477#define reg_pinmux_rw_iop_pb___pb0___lsb 0
478#define reg_pinmux_rw_iop_pb___pb0___width 1
479#define reg_pinmux_rw_iop_pb___pb0___bit 0
480#define reg_pinmux_rw_iop_pb___pb1___lsb 1
481#define reg_pinmux_rw_iop_pb___pb1___width 1
482#define reg_pinmux_rw_iop_pb___pb1___bit 1
483#define reg_pinmux_rw_iop_pb___pb2___lsb 2
484#define reg_pinmux_rw_iop_pb___pb2___width 1
485#define reg_pinmux_rw_iop_pb___pb2___bit 2
486#define reg_pinmux_rw_iop_pb___pb3___lsb 3
487#define reg_pinmux_rw_iop_pb___pb3___width 1
488#define reg_pinmux_rw_iop_pb___pb3___bit 3
489#define reg_pinmux_rw_iop_pb___pb4___lsb 4
490#define reg_pinmux_rw_iop_pb___pb4___width 1
491#define reg_pinmux_rw_iop_pb___pb4___bit 4
492#define reg_pinmux_rw_iop_pb___pb5___lsb 5
493#define reg_pinmux_rw_iop_pb___pb5___width 1
494#define reg_pinmux_rw_iop_pb___pb5___bit 5
495#define reg_pinmux_rw_iop_pb___pb6___lsb 6
496#define reg_pinmux_rw_iop_pb___pb6___width 1
497#define reg_pinmux_rw_iop_pb___pb6___bit 6
498#define reg_pinmux_rw_iop_pb___pb7___lsb 7
499#define reg_pinmux_rw_iop_pb___pb7___width 1
500#define reg_pinmux_rw_iop_pb___pb7___bit 7
501#define reg_pinmux_rw_iop_pb_offset 20
502
503/* Register rw_iop_pio, scope pinmux, type rw */
504#define reg_pinmux_rw_iop_pio___d0___lsb 0
505#define reg_pinmux_rw_iop_pio___d0___width 1
506#define reg_pinmux_rw_iop_pio___d0___bit 0
507#define reg_pinmux_rw_iop_pio___d1___lsb 1
508#define reg_pinmux_rw_iop_pio___d1___width 1
509#define reg_pinmux_rw_iop_pio___d1___bit 1
510#define reg_pinmux_rw_iop_pio___d2___lsb 2
511#define reg_pinmux_rw_iop_pio___d2___width 1
512#define reg_pinmux_rw_iop_pio___d2___bit 2
513#define reg_pinmux_rw_iop_pio___d3___lsb 3
514#define reg_pinmux_rw_iop_pio___d3___width 1
515#define reg_pinmux_rw_iop_pio___d3___bit 3
516#define reg_pinmux_rw_iop_pio___d4___lsb 4
517#define reg_pinmux_rw_iop_pio___d4___width 1
518#define reg_pinmux_rw_iop_pio___d4___bit 4
519#define reg_pinmux_rw_iop_pio___d5___lsb 5
520#define reg_pinmux_rw_iop_pio___d5___width 1
521#define reg_pinmux_rw_iop_pio___d5___bit 5
522#define reg_pinmux_rw_iop_pio___d6___lsb 6
523#define reg_pinmux_rw_iop_pio___d6___width 1
524#define reg_pinmux_rw_iop_pio___d6___bit 6
525#define reg_pinmux_rw_iop_pio___d7___lsb 7
526#define reg_pinmux_rw_iop_pio___d7___width 1
527#define reg_pinmux_rw_iop_pio___d7___bit 7
528#define reg_pinmux_rw_iop_pio___rd_n___lsb 8
529#define reg_pinmux_rw_iop_pio___rd_n___width 1
530#define reg_pinmux_rw_iop_pio___rd_n___bit 8
531#define reg_pinmux_rw_iop_pio___wr_n___lsb 9
532#define reg_pinmux_rw_iop_pio___wr_n___width 1
533#define reg_pinmux_rw_iop_pio___wr_n___bit 9
534#define reg_pinmux_rw_iop_pio___a0___lsb 10
535#define reg_pinmux_rw_iop_pio___a0___width 1
536#define reg_pinmux_rw_iop_pio___a0___bit 10
537#define reg_pinmux_rw_iop_pio___a1___lsb 11
538#define reg_pinmux_rw_iop_pio___a1___width 1
539#define reg_pinmux_rw_iop_pio___a1___bit 11
540#define reg_pinmux_rw_iop_pio___ce0_n___lsb 12
541#define reg_pinmux_rw_iop_pio___ce0_n___width 1
542#define reg_pinmux_rw_iop_pio___ce0_n___bit 12
543#define reg_pinmux_rw_iop_pio___ce1_n___lsb 13
544#define reg_pinmux_rw_iop_pio___ce1_n___width 1
545#define reg_pinmux_rw_iop_pio___ce1_n___bit 13
546#define reg_pinmux_rw_iop_pio___ce2_n___lsb 14
547#define reg_pinmux_rw_iop_pio___ce2_n___width 1
548#define reg_pinmux_rw_iop_pio___ce2_n___bit 14
549#define reg_pinmux_rw_iop_pio___rdy___lsb 15
550#define reg_pinmux_rw_iop_pio___rdy___width 1
551#define reg_pinmux_rw_iop_pio___rdy___bit 15
552#define reg_pinmux_rw_iop_pio_offset 24
553
554/* Register rw_iop_usb, scope pinmux, type rw */
555#define reg_pinmux_rw_iop_usb___usb0___lsb 0
556#define reg_pinmux_rw_iop_usb___usb0___width 1
557#define reg_pinmux_rw_iop_usb___usb0___bit 0
558#define reg_pinmux_rw_iop_usb_offset 28
559
560
561/* Constants */
562#define regk_pinmux_no 0x00000000
563#define regk_pinmux_rw_gio_pa_default 0x00000000
564#define regk_pinmux_rw_gio_pb_default 0x00000000
565#define regk_pinmux_rw_gio_pc_default 0x00000000
566#define regk_pinmux_rw_hwprot_default 0x00000000
567#define regk_pinmux_rw_iop_pa_default 0x00000000
568#define regk_pinmux_rw_iop_pb_default 0x00000000
569#define regk_pinmux_rw_iop_pio_default 0x00000000
570#define regk_pinmux_rw_iop_usb_default 0x00000001
571#define regk_pinmux_yes 0x00000001
572#endif /* __pinmux_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/asm/pio_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/pio_defs_asm.h
new file mode 100644
index 000000000000..3907ef4921c8
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/pio_defs_asm.h
@@ -0,0 +1,337 @@
1#ifndef __pio_defs_asm_h
2#define __pio_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: pio.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile pio_defs_asm.h pio.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53/* Register rw_data, scope pio, type rw */
54#define reg_pio_rw_data_offset 64
55
56/* Register rw_io_access0, scope pio, type rw */
57#define reg_pio_rw_io_access0___data___lsb 0
58#define reg_pio_rw_io_access0___data___width 8
59#define reg_pio_rw_io_access0_offset 0
60
61/* Register rw_io_access1, scope pio, type rw */
62#define reg_pio_rw_io_access1___data___lsb 0
63#define reg_pio_rw_io_access1___data___width 8
64#define reg_pio_rw_io_access1_offset 4
65
66/* Register rw_io_access2, scope pio, type rw */
67#define reg_pio_rw_io_access2___data___lsb 0
68#define reg_pio_rw_io_access2___data___width 8
69#define reg_pio_rw_io_access2_offset 8
70
71/* Register rw_io_access3, scope pio, type rw */
72#define reg_pio_rw_io_access3___data___lsb 0
73#define reg_pio_rw_io_access3___data___width 8
74#define reg_pio_rw_io_access3_offset 12
75
76/* Register rw_io_access4, scope pio, type rw */
77#define reg_pio_rw_io_access4___data___lsb 0
78#define reg_pio_rw_io_access4___data___width 8
79#define reg_pio_rw_io_access4_offset 16
80
81/* Register rw_io_access5, scope pio, type rw */
82#define reg_pio_rw_io_access5___data___lsb 0
83#define reg_pio_rw_io_access5___data___width 8
84#define reg_pio_rw_io_access5_offset 20
85
86/* Register rw_io_access6, scope pio, type rw */
87#define reg_pio_rw_io_access6___data___lsb 0
88#define reg_pio_rw_io_access6___data___width 8
89#define reg_pio_rw_io_access6_offset 24
90
91/* Register rw_io_access7, scope pio, type rw */
92#define reg_pio_rw_io_access7___data___lsb 0
93#define reg_pio_rw_io_access7___data___width 8
94#define reg_pio_rw_io_access7_offset 28
95
96/* Register rw_io_access8, scope pio, type rw */
97#define reg_pio_rw_io_access8___data___lsb 0
98#define reg_pio_rw_io_access8___data___width 8
99#define reg_pio_rw_io_access8_offset 32
100
101/* Register rw_io_access9, scope pio, type rw */
102#define reg_pio_rw_io_access9___data___lsb 0
103#define reg_pio_rw_io_access9___data___width 8
104#define reg_pio_rw_io_access9_offset 36
105
106/* Register rw_io_access10, scope pio, type rw */
107#define reg_pio_rw_io_access10___data___lsb 0
108#define reg_pio_rw_io_access10___data___width 8
109#define reg_pio_rw_io_access10_offset 40
110
111/* Register rw_io_access11, scope pio, type rw */
112#define reg_pio_rw_io_access11___data___lsb 0
113#define reg_pio_rw_io_access11___data___width 8
114#define reg_pio_rw_io_access11_offset 44
115
116/* Register rw_io_access12, scope pio, type rw */
117#define reg_pio_rw_io_access12___data___lsb 0
118#define reg_pio_rw_io_access12___data___width 8
119#define reg_pio_rw_io_access12_offset 48
120
121/* Register rw_io_access13, scope pio, type rw */
122#define reg_pio_rw_io_access13___data___lsb 0
123#define reg_pio_rw_io_access13___data___width 8
124#define reg_pio_rw_io_access13_offset 52
125
126/* Register rw_io_access14, scope pio, type rw */
127#define reg_pio_rw_io_access14___data___lsb 0
128#define reg_pio_rw_io_access14___data___width 8
129#define reg_pio_rw_io_access14_offset 56
130
131/* Register rw_io_access15, scope pio, type rw */
132#define reg_pio_rw_io_access15___data___lsb 0
133#define reg_pio_rw_io_access15___data___width 8
134#define reg_pio_rw_io_access15_offset 60
135
136/* Register rw_ce0_cfg, scope pio, type rw */
137#define reg_pio_rw_ce0_cfg___lw___lsb 0
138#define reg_pio_rw_ce0_cfg___lw___width 6
139#define reg_pio_rw_ce0_cfg___ew___lsb 6
140#define reg_pio_rw_ce0_cfg___ew___width 3
141#define reg_pio_rw_ce0_cfg___zw___lsb 9
142#define reg_pio_rw_ce0_cfg___zw___width 3
143#define reg_pio_rw_ce0_cfg___aw___lsb 12
144#define reg_pio_rw_ce0_cfg___aw___width 2
145#define reg_pio_rw_ce0_cfg___mode___lsb 14
146#define reg_pio_rw_ce0_cfg___mode___width 2
147#define reg_pio_rw_ce0_cfg_offset 68
148
149/* Register rw_ce1_cfg, scope pio, type rw */
150#define reg_pio_rw_ce1_cfg___lw___lsb 0
151#define reg_pio_rw_ce1_cfg___lw___width 6
152#define reg_pio_rw_ce1_cfg___ew___lsb 6
153#define reg_pio_rw_ce1_cfg___ew___width 3
154#define reg_pio_rw_ce1_cfg___zw___lsb 9
155#define reg_pio_rw_ce1_cfg___zw___width 3
156#define reg_pio_rw_ce1_cfg___aw___lsb 12
157#define reg_pio_rw_ce1_cfg___aw___width 2
158#define reg_pio_rw_ce1_cfg___mode___lsb 14
159#define reg_pio_rw_ce1_cfg___mode___width 2
160#define reg_pio_rw_ce1_cfg_offset 72
161
162/* Register rw_ce2_cfg, scope pio, type rw */
163#define reg_pio_rw_ce2_cfg___lw___lsb 0
164#define reg_pio_rw_ce2_cfg___lw___width 6
165#define reg_pio_rw_ce2_cfg___ew___lsb 6
166#define reg_pio_rw_ce2_cfg___ew___width 3
167#define reg_pio_rw_ce2_cfg___zw___lsb 9
168#define reg_pio_rw_ce2_cfg___zw___width 3
169#define reg_pio_rw_ce2_cfg___aw___lsb 12
170#define reg_pio_rw_ce2_cfg___aw___width 2
171#define reg_pio_rw_ce2_cfg___mode___lsb 14
172#define reg_pio_rw_ce2_cfg___mode___width 2
173#define reg_pio_rw_ce2_cfg_offset 76
174
175/* Register rw_dout, scope pio, type rw */
176#define reg_pio_rw_dout___data___lsb 0
177#define reg_pio_rw_dout___data___width 8
178#define reg_pio_rw_dout___rd_n___lsb 8
179#define reg_pio_rw_dout___rd_n___width 1
180#define reg_pio_rw_dout___rd_n___bit 8
181#define reg_pio_rw_dout___wr_n___lsb 9
182#define reg_pio_rw_dout___wr_n___width 1
183#define reg_pio_rw_dout___wr_n___bit 9
184#define reg_pio_rw_dout___a0___lsb 10
185#define reg_pio_rw_dout___a0___width 1
186#define reg_pio_rw_dout___a0___bit 10
187#define reg_pio_rw_dout___a1___lsb 11
188#define reg_pio_rw_dout___a1___width 1
189#define reg_pio_rw_dout___a1___bit 11
190#define reg_pio_rw_dout___ce0_n___lsb 12
191#define reg_pio_rw_dout___ce0_n___width 1
192#define reg_pio_rw_dout___ce0_n___bit 12
193#define reg_pio_rw_dout___ce1_n___lsb 13
194#define reg_pio_rw_dout___ce1_n___width 1
195#define reg_pio_rw_dout___ce1_n___bit 13
196#define reg_pio_rw_dout___ce2_n___lsb 14
197#define reg_pio_rw_dout___ce2_n___width 1
198#define reg_pio_rw_dout___ce2_n___bit 14
199#define reg_pio_rw_dout___rdy___lsb 15
200#define reg_pio_rw_dout___rdy___width 1
201#define reg_pio_rw_dout___rdy___bit 15
202#define reg_pio_rw_dout_offset 80
203
204/* Register rw_oe, scope pio, type rw */
205#define reg_pio_rw_oe___data___lsb 0
206#define reg_pio_rw_oe___data___width 8
207#define reg_pio_rw_oe___rd_n___lsb 8
208#define reg_pio_rw_oe___rd_n___width 1
209#define reg_pio_rw_oe___rd_n___bit 8
210#define reg_pio_rw_oe___wr_n___lsb 9
211#define reg_pio_rw_oe___wr_n___width 1
212#define reg_pio_rw_oe___wr_n___bit 9
213#define reg_pio_rw_oe___a0___lsb 10
214#define reg_pio_rw_oe___a0___width 1
215#define reg_pio_rw_oe___a0___bit 10
216#define reg_pio_rw_oe___a1___lsb 11
217#define reg_pio_rw_oe___a1___width 1
218#define reg_pio_rw_oe___a1___bit 11
219#define reg_pio_rw_oe___ce0_n___lsb 12
220#define reg_pio_rw_oe___ce0_n___width 1
221#define reg_pio_rw_oe___ce0_n___bit 12
222#define reg_pio_rw_oe___ce1_n___lsb 13
223#define reg_pio_rw_oe___ce1_n___width 1
224#define reg_pio_rw_oe___ce1_n___bit 13
225#define reg_pio_rw_oe___ce2_n___lsb 14
226#define reg_pio_rw_oe___ce2_n___width 1
227#define reg_pio_rw_oe___ce2_n___bit 14
228#define reg_pio_rw_oe___rdy___lsb 15
229#define reg_pio_rw_oe___rdy___width 1
230#define reg_pio_rw_oe___rdy___bit 15
231#define reg_pio_rw_oe_offset 84
232
233/* Register rw_man_ctrl, scope pio, type rw */
234#define reg_pio_rw_man_ctrl___data___lsb 0
235#define reg_pio_rw_man_ctrl___data___width 8
236#define reg_pio_rw_man_ctrl___rd_n___lsb 8
237#define reg_pio_rw_man_ctrl___rd_n___width 1
238#define reg_pio_rw_man_ctrl___rd_n___bit 8
239#define reg_pio_rw_man_ctrl___wr_n___lsb 9
240#define reg_pio_rw_man_ctrl___wr_n___width 1
241#define reg_pio_rw_man_ctrl___wr_n___bit 9
242#define reg_pio_rw_man_ctrl___a0___lsb 10
243#define reg_pio_rw_man_ctrl___a0___width 1
244#define reg_pio_rw_man_ctrl___a0___bit 10
245#define reg_pio_rw_man_ctrl___a1___lsb 11
246#define reg_pio_rw_man_ctrl___a1___width 1
247#define reg_pio_rw_man_ctrl___a1___bit 11
248#define reg_pio_rw_man_ctrl___ce0_n___lsb 12
249#define reg_pio_rw_man_ctrl___ce0_n___width 1
250#define reg_pio_rw_man_ctrl___ce0_n___bit 12
251#define reg_pio_rw_man_ctrl___ce1_n___lsb 13
252#define reg_pio_rw_man_ctrl___ce1_n___width 1
253#define reg_pio_rw_man_ctrl___ce1_n___bit 13
254#define reg_pio_rw_man_ctrl___ce2_n___lsb 14
255#define reg_pio_rw_man_ctrl___ce2_n___width 1
256#define reg_pio_rw_man_ctrl___ce2_n___bit 14
257#define reg_pio_rw_man_ctrl___rdy___lsb 15
258#define reg_pio_rw_man_ctrl___rdy___width 1
259#define reg_pio_rw_man_ctrl___rdy___bit 15
260#define reg_pio_rw_man_ctrl_offset 88
261
262/* Register r_din, scope pio, type r */
263#define reg_pio_r_din___data___lsb 0
264#define reg_pio_r_din___data___width 8
265#define reg_pio_r_din___rd_n___lsb 8
266#define reg_pio_r_din___rd_n___width 1
267#define reg_pio_r_din___rd_n___bit 8
268#define reg_pio_r_din___wr_n___lsb 9
269#define reg_pio_r_din___wr_n___width 1
270#define reg_pio_r_din___wr_n___bit 9
271#define reg_pio_r_din___a0___lsb 10
272#define reg_pio_r_din___a0___width 1
273#define reg_pio_r_din___a0___bit 10
274#define reg_pio_r_din___a1___lsb 11
275#define reg_pio_r_din___a1___width 1
276#define reg_pio_r_din___a1___bit 11
277#define reg_pio_r_din___ce0_n___lsb 12
278#define reg_pio_r_din___ce0_n___width 1
279#define reg_pio_r_din___ce0_n___bit 12
280#define reg_pio_r_din___ce1_n___lsb 13
281#define reg_pio_r_din___ce1_n___width 1
282#define reg_pio_r_din___ce1_n___bit 13
283#define reg_pio_r_din___ce2_n___lsb 14
284#define reg_pio_r_din___ce2_n___width 1
285#define reg_pio_r_din___ce2_n___bit 14
286#define reg_pio_r_din___rdy___lsb 15
287#define reg_pio_r_din___rdy___width 1
288#define reg_pio_r_din___rdy___bit 15
289#define reg_pio_r_din_offset 92
290
291/* Register r_stat, scope pio, type r */
292#define reg_pio_r_stat___busy___lsb 0
293#define reg_pio_r_stat___busy___width 1
294#define reg_pio_r_stat___busy___bit 0
295#define reg_pio_r_stat_offset 96
296
297/* Register rw_intr_mask, scope pio, type rw */
298#define reg_pio_rw_intr_mask___rdy___lsb 0
299#define reg_pio_rw_intr_mask___rdy___width 1
300#define reg_pio_rw_intr_mask___rdy___bit 0
301#define reg_pio_rw_intr_mask_offset 100
302
303/* Register rw_ack_intr, scope pio, type rw */
304#define reg_pio_rw_ack_intr___rdy___lsb 0
305#define reg_pio_rw_ack_intr___rdy___width 1
306#define reg_pio_rw_ack_intr___rdy___bit 0
307#define reg_pio_rw_ack_intr_offset 104
308
309/* Register r_intr, scope pio, type r */
310#define reg_pio_r_intr___rdy___lsb 0
311#define reg_pio_r_intr___rdy___width 1
312#define reg_pio_r_intr___rdy___bit 0
313#define reg_pio_r_intr_offset 108
314
315/* Register r_masked_intr, scope pio, type r */
316#define reg_pio_r_masked_intr___rdy___lsb 0
317#define reg_pio_r_masked_intr___rdy___width 1
318#define reg_pio_r_masked_intr___rdy___bit 0
319#define reg_pio_r_masked_intr_offset 112
320
321
322/* Constants */
323#define regk_pio_a2 0x00000003
324#define regk_pio_no 0x00000000
325#define regk_pio_normal 0x00000000
326#define regk_pio_rd 0x00000001
327#define regk_pio_rw_ce0_cfg_default 0x00000000
328#define regk_pio_rw_ce1_cfg_default 0x00000000
329#define regk_pio_rw_ce2_cfg_default 0x00000000
330#define regk_pio_rw_intr_mask_default 0x00000000
331#define regk_pio_rw_man_ctrl_default 0x00000000
332#define regk_pio_rw_oe_default 0x00000000
333#define regk_pio_wr 0x00000002
334#define regk_pio_wr_ce2 0x00000003
335#define regk_pio_yes 0x00000001
336#define regk_pio_yes_all 0x000000ff
337#endif /* __pio_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/asm/reg_map_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/reg_map_asm.h
new file mode 100644
index 000000000000..89439e9610e2
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/reg_map_asm.h
@@ -0,0 +1,99 @@
1#ifndef __reg_map_asm_h
2#define __reg_map_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: reg.rmap
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -base 0xb0000000 -map marb_bar.r marb_foo.r ccd_top.r ccd_stat.r ccd_tg.r ccd_dp.r ccd.r iop_sap_in.r iop_sap_out.r iop_sw_cfg.r iop_sw_cpu.r iop_sw_mpu.r iop_sw_spu.r iop_version.r iop_crc_par.r iop_dmc_in.r iop_dmc_out.r iop_fifo_in_extra.r iop_fifo_in.r iop_fifo_out_extra.r iop_fifo_out.r iop_mc.r iop_mpu.r iop_scrc_in.r iop_scrc_out.r iop_spu.r iop_timer_grp.r iop_trigger_grp.r iop.r -outfile reg_map_asm.h reg.rmap
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13#define regi_ccd 0xb0000000
14#define regi_ccd_top 0xb0000000
15#define regi_ccd_dp 0xb0000400
16#define regi_ccd_stat 0xb0000800
17#define regi_ccd_tg 0xb0001000
18#define regi_cfg 0xb0002000
19#define regi_clkgen 0xb0004000
20#define regi_ddr2_ctrl 0xb0006000
21#define regi_dma0 0xb0008000
22#define regi_dma1 0xb000a000
23#define regi_dma11 0xb000c000
24#define regi_dma2 0xb000e000
25#define regi_dma3 0xb0010000
26#define regi_dma4 0xb0012000
27#define regi_dma5 0xb0014000
28#define regi_dma6 0xb0016000
29#define regi_dma7 0xb0018000
30#define regi_dma9 0xb001a000
31#define regi_eth 0xb001c000
32#define regi_gio 0xb0020000
33#define regi_h264 0xb0022000
34#define regi_hist 0xb0026000
35#define regi_iop 0xb0028000
36#define regi_iop_version 0xb0028000
37#define regi_iop_fifo_in_extra 0xb0028040
38#define regi_iop_fifo_out_extra 0xb0028080
39#define regi_iop_trigger_grp0 0xb00280c0
40#define regi_iop_trigger_grp1 0xb0028100
41#define regi_iop_trigger_grp2 0xb0028140
42#define regi_iop_trigger_grp3 0xb0028180
43#define regi_iop_trigger_grp4 0xb00281c0
44#define regi_iop_trigger_grp5 0xb0028200
45#define regi_iop_trigger_grp6 0xb0028240
46#define regi_iop_trigger_grp7 0xb0028280
47#define regi_iop_crc_par 0xb0028300
48#define regi_iop_dmc_in 0xb0028380
49#define regi_iop_dmc_out 0xb0028400
50#define regi_iop_fifo_in 0xb0028480
51#define regi_iop_fifo_out 0xb0028500
52#define regi_iop_scrc_in 0xb0028580
53#define regi_iop_scrc_out 0xb0028600
54#define regi_iop_timer_grp0 0xb0028680
55#define regi_iop_timer_grp1 0xb0028700
56#define regi_iop_sap_in 0xb0028800
57#define regi_iop_sap_out 0xb0028900
58#define regi_iop_spu 0xb0028a00
59#define regi_iop_sw_cfg 0xb0028b00
60#define regi_iop_sw_cpu 0xb0028c00
61#define regi_iop_sw_mpu 0xb0028d00
62#define regi_iop_sw_spu 0xb0028e00
63#define regi_iop_mpu 0xb0029000
64#define regi_irq 0xb002a000
65#define regi_jpeg 0xb002c000
66#define regi_l2cache 0xb0030000
67#define regi_marb_bar 0xb0032000
68#define regi_marb_bar_bp0 0xb0032140
69#define regi_marb_bar_bp1 0xb0032180
70#define regi_marb_bar_bp2 0xb00321c0
71#define regi_marb_bar_bp3 0xb0032200
72#define regi_marb_foo 0xb0034000
73#define regi_marb_foo_bp0 0xb0034280
74#define regi_marb_foo_bp1 0xb00342c0
75#define regi_marb_foo_bp2 0xb0034300
76#define regi_marb_foo_bp3 0xb0034340
77#define regi_pinmux 0xb0038000
78#define regi_pio 0xb0036000
79#define regi_sclr 0xb003a000
80#define regi_sclr_fifo 0xb003c000
81#define regi_ser0 0xb003e000
82#define regi_ser1 0xb0040000
83#define regi_ser2 0xb0042000
84#define regi_ser3 0xb0044000
85#define regi_ser4 0xb0046000
86#define regi_sser 0xb0048000
87#define regi_strcop 0xb004a000
88#define regi_strdma0 0xb004e000
89#define regi_strdma1 0xb0050000
90#define regi_strdma2 0xb0052000
91#define regi_strdma3 0xb0054000
92#define regi_strdma5 0xb0056000
93#define regi_strmux 0xb004c000
94#define regi_timer0 0xb0058000
95#define regi_timer1 0xb005a000
96#define regi_trace 0xb005c000
97#define regi_vin 0xb005e000
98#define regi_vout 0xb0060000
99#endif /* __reg_map_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/asm/timer_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/timer_defs_asm.h
new file mode 100644
index 000000000000..b129e826fc34
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/asm/timer_defs_asm.h
@@ -0,0 +1,228 @@
1#ifndef __timer_defs_asm_h
2#define __timer_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: timer.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile timer_defs_asm.h timer.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53/* Register rw_tmr0_div, scope timer, type rw */
54#define reg_timer_rw_tmr0_div_offset 0
55
56/* Register r_tmr0_data, scope timer, type r */
57#define reg_timer_r_tmr0_data_offset 4
58
59/* Register rw_tmr0_ctrl, scope timer, type rw */
60#define reg_timer_rw_tmr0_ctrl___op___lsb 0
61#define reg_timer_rw_tmr0_ctrl___op___width 2
62#define reg_timer_rw_tmr0_ctrl___freq___lsb 2
63#define reg_timer_rw_tmr0_ctrl___freq___width 3
64#define reg_timer_rw_tmr0_ctrl_offset 8
65
66/* Register rw_tmr1_div, scope timer, type rw */
67#define reg_timer_rw_tmr1_div_offset 16
68
69/* Register r_tmr1_data, scope timer, type r */
70#define reg_timer_r_tmr1_data_offset 20
71
72/* Register rw_tmr1_ctrl, scope timer, type rw */
73#define reg_timer_rw_tmr1_ctrl___op___lsb 0
74#define reg_timer_rw_tmr1_ctrl___op___width 2
75#define reg_timer_rw_tmr1_ctrl___freq___lsb 2
76#define reg_timer_rw_tmr1_ctrl___freq___width 3
77#define reg_timer_rw_tmr1_ctrl_offset 24
78
79/* Register rs_cnt_data, scope timer, type rs */
80#define reg_timer_rs_cnt_data___tmr___lsb 0
81#define reg_timer_rs_cnt_data___tmr___width 24
82#define reg_timer_rs_cnt_data___cnt___lsb 24
83#define reg_timer_rs_cnt_data___cnt___width 8
84#define reg_timer_rs_cnt_data_offset 32
85
86/* Register r_cnt_data, scope timer, type r */
87#define reg_timer_r_cnt_data___tmr___lsb 0
88#define reg_timer_r_cnt_data___tmr___width 24
89#define reg_timer_r_cnt_data___cnt___lsb 24
90#define reg_timer_r_cnt_data___cnt___width 8
91#define reg_timer_r_cnt_data_offset 36
92
93/* Register rw_cnt_cfg, scope timer, type rw */
94#define reg_timer_rw_cnt_cfg___clk___lsb 0
95#define reg_timer_rw_cnt_cfg___clk___width 2
96#define reg_timer_rw_cnt_cfg_offset 40
97
98/* Register rw_trig, scope timer, type rw */
99#define reg_timer_rw_trig_offset 48
100
101/* Register rw_trig_cfg, scope timer, type rw */
102#define reg_timer_rw_trig_cfg___tmr___lsb 0
103#define reg_timer_rw_trig_cfg___tmr___width 2
104#define reg_timer_rw_trig_cfg_offset 52
105
106/* Register r_time, scope timer, type r */
107#define reg_timer_r_time_offset 56
108
109/* Register rw_out, scope timer, type rw */
110#define reg_timer_rw_out___tmr___lsb 0
111#define reg_timer_rw_out___tmr___width 2
112#define reg_timer_rw_out_offset 60
113
114/* Register rw_wd_ctrl, scope timer, type rw */
115#define reg_timer_rw_wd_ctrl___cnt___lsb 0
116#define reg_timer_rw_wd_ctrl___cnt___width 8
117#define reg_timer_rw_wd_ctrl___cmd___lsb 8
118#define reg_timer_rw_wd_ctrl___cmd___width 1
119#define reg_timer_rw_wd_ctrl___cmd___bit 8
120#define reg_timer_rw_wd_ctrl___key___lsb 9
121#define reg_timer_rw_wd_ctrl___key___width 7
122#define reg_timer_rw_wd_ctrl_offset 64
123
124/* Register r_wd_stat, scope timer, type r */
125#define reg_timer_r_wd_stat___cnt___lsb 0
126#define reg_timer_r_wd_stat___cnt___width 8
127#define reg_timer_r_wd_stat___cmd___lsb 8
128#define reg_timer_r_wd_stat___cmd___width 1
129#define reg_timer_r_wd_stat___cmd___bit 8
130#define reg_timer_r_wd_stat_offset 68
131
132/* Register rw_intr_mask, scope timer, type rw */
133#define reg_timer_rw_intr_mask___tmr0___lsb 0
134#define reg_timer_rw_intr_mask___tmr0___width 1
135#define reg_timer_rw_intr_mask___tmr0___bit 0
136#define reg_timer_rw_intr_mask___tmr1___lsb 1
137#define reg_timer_rw_intr_mask___tmr1___width 1
138#define reg_timer_rw_intr_mask___tmr1___bit 1
139#define reg_timer_rw_intr_mask___cnt___lsb 2
140#define reg_timer_rw_intr_mask___cnt___width 1
141#define reg_timer_rw_intr_mask___cnt___bit 2
142#define reg_timer_rw_intr_mask___trig___lsb 3
143#define reg_timer_rw_intr_mask___trig___width 1
144#define reg_timer_rw_intr_mask___trig___bit 3
145#define reg_timer_rw_intr_mask_offset 72
146
147/* Register rw_ack_intr, scope timer, type rw */
148#define reg_timer_rw_ack_intr___tmr0___lsb 0
149#define reg_timer_rw_ack_intr___tmr0___width 1
150#define reg_timer_rw_ack_intr___tmr0___bit 0
151#define reg_timer_rw_ack_intr___tmr1___lsb 1
152#define reg_timer_rw_ack_intr___tmr1___width 1
153#define reg_timer_rw_ack_intr___tmr1___bit 1
154#define reg_timer_rw_ack_intr___cnt___lsb 2
155#define reg_timer_rw_ack_intr___cnt___width 1
156#define reg_timer_rw_ack_intr___cnt___bit 2
157#define reg_timer_rw_ack_intr___trig___lsb 3
158#define reg_timer_rw_ack_intr___trig___width 1
159#define reg_timer_rw_ack_intr___trig___bit 3
160#define reg_timer_rw_ack_intr_offset 76
161
162/* Register r_intr, scope timer, type r */
163#define reg_timer_r_intr___tmr0___lsb 0
164#define reg_timer_r_intr___tmr0___width 1
165#define reg_timer_r_intr___tmr0___bit 0
166#define reg_timer_r_intr___tmr1___lsb 1
167#define reg_timer_r_intr___tmr1___width 1
168#define reg_timer_r_intr___tmr1___bit 1
169#define reg_timer_r_intr___cnt___lsb 2
170#define reg_timer_r_intr___cnt___width 1
171#define reg_timer_r_intr___cnt___bit 2
172#define reg_timer_r_intr___trig___lsb 3
173#define reg_timer_r_intr___trig___width 1
174#define reg_timer_r_intr___trig___bit 3
175#define reg_timer_r_intr_offset 80
176
177/* Register r_masked_intr, scope timer, type r */
178#define reg_timer_r_masked_intr___tmr0___lsb 0
179#define reg_timer_r_masked_intr___tmr0___width 1
180#define reg_timer_r_masked_intr___tmr0___bit 0
181#define reg_timer_r_masked_intr___tmr1___lsb 1
182#define reg_timer_r_masked_intr___tmr1___width 1
183#define reg_timer_r_masked_intr___tmr1___bit 1
184#define reg_timer_r_masked_intr___cnt___lsb 2
185#define reg_timer_r_masked_intr___cnt___width 1
186#define reg_timer_r_masked_intr___cnt___bit 2
187#define reg_timer_r_masked_intr___trig___lsb 3
188#define reg_timer_r_masked_intr___trig___width 1
189#define reg_timer_r_masked_intr___trig___bit 3
190#define reg_timer_r_masked_intr_offset 84
191
192/* Register rw_test, scope timer, type rw */
193#define reg_timer_rw_test___dis___lsb 0
194#define reg_timer_rw_test___dis___width 1
195#define reg_timer_rw_test___dis___bit 0
196#define reg_timer_rw_test___en___lsb 1
197#define reg_timer_rw_test___en___width 1
198#define reg_timer_rw_test___en___bit 1
199#define reg_timer_rw_test_offset 88
200
201
202/* Constants */
203#define regk_timer_ext 0x00000001
204#define regk_timer_f100 0x00000007
205#define regk_timer_f29_493 0x00000004
206#define regk_timer_f32 0x00000005
207#define regk_timer_f32_768 0x00000006
208#define regk_timer_f90 0x00000003
209#define regk_timer_hold 0x00000001
210#define regk_timer_ld 0x00000000
211#define regk_timer_no 0x00000000
212#define regk_timer_off 0x00000000
213#define regk_timer_run 0x00000002
214#define regk_timer_rw_cnt_cfg_default 0x00000000
215#define regk_timer_rw_intr_mask_default 0x00000000
216#define regk_timer_rw_out_default 0x00000000
217#define regk_timer_rw_test_default 0x00000000
218#define regk_timer_rw_tmr0_ctrl_default 0x00000000
219#define regk_timer_rw_tmr1_ctrl_default 0x00000000
220#define regk_timer_rw_trig_cfg_default 0x00000000
221#define regk_timer_start 0x00000001
222#define regk_timer_stop 0x00000000
223#define regk_timer_time 0x00000001
224#define regk_timer_tmr0 0x00000002
225#define regk_timer_tmr1 0x00000003
226#define regk_timer_vclk 0x00000002
227#define regk_timer_yes 0x00000001
228#endif /* __timer_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/clkgen_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/clkgen_defs.h
new file mode 100644
index 000000000000..c1e9ba93b3a3
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/clkgen_defs.h
@@ -0,0 +1,159 @@
1#ifndef __clkgen_defs_h
2#define __clkgen_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: clkgen.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile clkgen_defs.h clkgen.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope clkgen */
83
84/* Register r_bootsel, scope clkgen, type r */
85typedef struct {
86 unsigned int boot_mode : 5;
87 unsigned int intern_main_clk : 1;
88 unsigned int extern_usb2_clk : 1;
89 unsigned int dummy1 : 25;
90} reg_clkgen_r_bootsel;
91#define REG_RD_ADDR_clkgen_r_bootsel 0
92
93/* Register rw_clk_ctrl, scope clkgen, type rw */
94typedef struct {
95 unsigned int pll : 1;
96 unsigned int cpu : 1;
97 unsigned int iop_usb : 1;
98 unsigned int vin : 1;
99 unsigned int sclr : 1;
100 unsigned int h264 : 1;
101 unsigned int ddr2 : 1;
102 unsigned int vout_hist : 1;
103 unsigned int eth : 1;
104 unsigned int ccd_tg_200 : 1;
105 unsigned int dma0_1_eth : 1;
106 unsigned int ccd_tg_100 : 1;
107 unsigned int jpeg : 1;
108 unsigned int sser_ser_dma6_7 : 1;
109 unsigned int strdma0_2_video : 1;
110 unsigned int dma2_3_strcop : 1;
111 unsigned int dma4_5_iop : 1;
112 unsigned int dma9_11 : 1;
113 unsigned int memarb_bar_ddr : 1;
114 unsigned int sclr_h264 : 1;
115 unsigned int dummy1 : 12;
116} reg_clkgen_rw_clk_ctrl;
117#define REG_RD_ADDR_clkgen_rw_clk_ctrl 4
118#define REG_WR_ADDR_clkgen_rw_clk_ctrl 4
119
120
121/* Constants */
122enum {
123 regk_clkgen_eth1000_rx = 0x0000000c,
124 regk_clkgen_eth1000_tx = 0x0000000e,
125 regk_clkgen_eth100_rx = 0x0000001d,
126 regk_clkgen_eth100_rx_half = 0x0000001c,
127 regk_clkgen_eth100_tx = 0x0000001f,
128 regk_clkgen_eth100_tx_half = 0x0000001e,
129 regk_clkgen_nand_3_2 = 0x00000000,
130 regk_clkgen_nand_3_2_0x30 = 0x00000002,
131 regk_clkgen_nand_3_2_0x30_pll = 0x00000012,
132 regk_clkgen_nand_3_2_pll = 0x00000010,
133 regk_clkgen_nand_3_3 = 0x00000001,
134 regk_clkgen_nand_3_3_0x30 = 0x00000003,
135 regk_clkgen_nand_3_3_0x30_pll = 0x00000013,
136 regk_clkgen_nand_3_3_pll = 0x00000011,
137 regk_clkgen_nand_4_2 = 0x00000004,
138 regk_clkgen_nand_4_2_0x30 = 0x00000006,
139 regk_clkgen_nand_4_2_0x30_pll = 0x00000016,
140 regk_clkgen_nand_4_2_pll = 0x00000014,
141 regk_clkgen_nand_4_3 = 0x00000005,
142 regk_clkgen_nand_4_3_0x30 = 0x00000007,
143 regk_clkgen_nand_4_3_0x30_pll = 0x00000017,
144 regk_clkgen_nand_4_3_pll = 0x00000015,
145 regk_clkgen_nand_5_2 = 0x00000008,
146 regk_clkgen_nand_5_2_0x30 = 0x0000000a,
147 regk_clkgen_nand_5_2_0x30_pll = 0x0000001a,
148 regk_clkgen_nand_5_2_pll = 0x00000018,
149 regk_clkgen_nand_5_3 = 0x00000009,
150 regk_clkgen_nand_5_3_0x30 = 0x0000000b,
151 regk_clkgen_nand_5_3_0x30_pll = 0x0000001b,
152 regk_clkgen_nand_5_3_pll = 0x00000019,
153 regk_clkgen_no = 0x00000000,
154 regk_clkgen_rw_clk_ctrl_default = 0x00000002,
155 regk_clkgen_ser = 0x0000000d,
156 regk_clkgen_ser_pll = 0x0000000f,
157 regk_clkgen_yes = 0x00000001
158};
159#endif /* __clkgen_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/ddr2_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/ddr2_defs.h
new file mode 100644
index 000000000000..0f30e8bf946d
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/ddr2_defs.h
@@ -0,0 +1,281 @@
1#ifndef __ddr2_defs_h
2#define __ddr2_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ddr2.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile ddr2_defs.h ddr2.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope ddr2 */
83
84/* Register rw_cfg, scope ddr2, type rw */
85typedef struct {
86 unsigned int col_width : 4;
87 unsigned int nr_banks : 1;
88 unsigned int bw : 1;
89 unsigned int nr_ref : 4;
90 unsigned int ref_interval : 11;
91 unsigned int odt_ctrl : 2;
92 unsigned int odt_mem : 1;
93 unsigned int imp_strength : 1;
94 unsigned int auto_imp_cal : 1;
95 unsigned int imp_cal_override : 1;
96 unsigned int dll_override : 1;
97 unsigned int dummy1 : 4;
98} reg_ddr2_rw_cfg;
99#define REG_RD_ADDR_ddr2_rw_cfg 0
100#define REG_WR_ADDR_ddr2_rw_cfg 0
101
102/* Register rw_timing, scope ddr2, type rw */
103typedef struct {
104 unsigned int wr : 3;
105 unsigned int rcd : 3;
106 unsigned int rp : 3;
107 unsigned int ras : 4;
108 unsigned int rfc : 7;
109 unsigned int rc : 5;
110 unsigned int rtp : 2;
111 unsigned int rtw : 3;
112 unsigned int wtr : 2;
113} reg_ddr2_rw_timing;
114#define REG_RD_ADDR_ddr2_rw_timing 4
115#define REG_WR_ADDR_ddr2_rw_timing 4
116
117/* Register rw_latency, scope ddr2, type rw */
118typedef struct {
119 unsigned int cas : 3;
120 unsigned int additive : 3;
121 unsigned int dummy1 : 26;
122} reg_ddr2_rw_latency;
123#define REG_RD_ADDR_ddr2_rw_latency 8
124#define REG_WR_ADDR_ddr2_rw_latency 8
125
126/* Register rw_phy_cfg, scope ddr2, type rw */
127typedef struct {
128 unsigned int en : 1;
129 unsigned int dummy1 : 31;
130} reg_ddr2_rw_phy_cfg;
131#define REG_RD_ADDR_ddr2_rw_phy_cfg 12
132#define REG_WR_ADDR_ddr2_rw_phy_cfg 12
133
134/* Register rw_phy_ctrl, scope ddr2, type rw */
135typedef struct {
136 unsigned int rst : 1;
137 unsigned int cal_rst : 1;
138 unsigned int cal_start : 1;
139 unsigned int dummy1 : 29;
140} reg_ddr2_rw_phy_ctrl;
141#define REG_RD_ADDR_ddr2_rw_phy_ctrl 16
142#define REG_WR_ADDR_ddr2_rw_phy_ctrl 16
143
144/* Register rw_ctrl, scope ddr2, type rw */
145typedef struct {
146 unsigned int mrs_data : 16;
147 unsigned int cmd : 8;
148 unsigned int dummy1 : 8;
149} reg_ddr2_rw_ctrl;
150#define REG_RD_ADDR_ddr2_rw_ctrl 20
151#define REG_WR_ADDR_ddr2_rw_ctrl 20
152
153/* Register rw_pwr_down, scope ddr2, type rw */
154typedef struct {
155 unsigned int self_ref : 2;
156 unsigned int phy_en : 1;
157 unsigned int dummy1 : 29;
158} reg_ddr2_rw_pwr_down;
159#define REG_RD_ADDR_ddr2_rw_pwr_down 24
160#define REG_WR_ADDR_ddr2_rw_pwr_down 24
161
162/* Register r_stat, scope ddr2, type r */
163typedef struct {
164 unsigned int dll_lock : 1;
165 unsigned int dll_delay_code : 7;
166 unsigned int imp_cal_done : 1;
167 unsigned int imp_cal_fault : 1;
168 unsigned int cal_imp_pu : 4;
169 unsigned int cal_imp_pd : 4;
170 unsigned int dummy1 : 14;
171} reg_ddr2_r_stat;
172#define REG_RD_ADDR_ddr2_r_stat 28
173
174/* Register rw_imp_ctrl, scope ddr2, type rw */
175typedef struct {
176 unsigned int imp_pu : 4;
177 unsigned int imp_pd : 4;
178 unsigned int dummy1 : 24;
179} reg_ddr2_rw_imp_ctrl;
180#define REG_RD_ADDR_ddr2_rw_imp_ctrl 32
181#define REG_WR_ADDR_ddr2_rw_imp_ctrl 32
182
183#define STRIDE_ddr2_rw_dll_ctrl 4
184/* Register rw_dll_ctrl, scope ddr2, type rw */
185typedef struct {
186 unsigned int mode : 1;
187 unsigned int clk_delay : 7;
188 unsigned int dummy1 : 24;
189} reg_ddr2_rw_dll_ctrl;
190#define REG_RD_ADDR_ddr2_rw_dll_ctrl 36
191#define REG_WR_ADDR_ddr2_rw_dll_ctrl 36
192
193#define STRIDE_ddr2_rw_dqs_dll_ctrl 4
194/* Register rw_dqs_dll_ctrl, scope ddr2, type rw */
195typedef struct {
196 unsigned int dqs90_delay : 7;
197 unsigned int dqs180_delay : 7;
198 unsigned int dqs270_delay : 7;
199 unsigned int dqs360_delay : 7;
200 unsigned int dummy1 : 4;
201} reg_ddr2_rw_dqs_dll_ctrl;
202#define REG_RD_ADDR_ddr2_rw_dqs_dll_ctrl 52
203#define REG_WR_ADDR_ddr2_rw_dqs_dll_ctrl 52
204
205
206/* Constants */
207enum {
208 regk_ddr2_al0 = 0x00000000,
209 regk_ddr2_al1 = 0x00000008,
210 regk_ddr2_al2 = 0x00000010,
211 regk_ddr2_al3 = 0x00000018,
212 regk_ddr2_al4 = 0x00000020,
213 regk_ddr2_auto = 0x00000003,
214 regk_ddr2_bank4 = 0x00000000,
215 regk_ddr2_bank8 = 0x00000001,
216 regk_ddr2_bl4 = 0x00000002,
217 regk_ddr2_bl8 = 0x00000003,
218 regk_ddr2_bt_il = 0x00000008,
219 regk_ddr2_bt_seq = 0x00000000,
220 regk_ddr2_bw16 = 0x00000001,
221 regk_ddr2_bw32 = 0x00000000,
222 regk_ddr2_cas2 = 0x00000020,
223 regk_ddr2_cas3 = 0x00000030,
224 regk_ddr2_cas4 = 0x00000040,
225 regk_ddr2_cas5 = 0x00000050,
226 regk_ddr2_deselect = 0x000000c0,
227 regk_ddr2_dic_weak = 0x00000002,
228 regk_ddr2_direct = 0x00000001,
229 regk_ddr2_dis = 0x00000000,
230 regk_ddr2_dll_dis = 0x00000001,
231 regk_ddr2_dll_en = 0x00000000,
232 regk_ddr2_dll_rst = 0x00000100,
233 regk_ddr2_emrs = 0x00000081,
234 regk_ddr2_emrs2 = 0x00000082,
235 regk_ddr2_emrs3 = 0x00000083,
236 regk_ddr2_full = 0x00000001,
237 regk_ddr2_hi_ref_rate = 0x00000080,
238 regk_ddr2_mrs = 0x00000080,
239 regk_ddr2_no = 0x00000000,
240 regk_ddr2_nop = 0x000000b8,
241 regk_ddr2_ocd_adj = 0x00000200,
242 regk_ddr2_ocd_default = 0x00000380,
243 regk_ddr2_ocd_drive0 = 0x00000100,
244 regk_ddr2_ocd_drive1 = 0x00000080,
245 regk_ddr2_ocd_exit = 0x00000000,
246 regk_ddr2_odt_dis = 0x00000000,
247 regk_ddr2_offs = 0x00000000,
248 regk_ddr2_pre = 0x00000090,
249 regk_ddr2_pre_all = 0x00000400,
250 regk_ddr2_pwr_down_fast = 0x00000000,
251 regk_ddr2_pwr_down_slow = 0x00001000,
252 regk_ddr2_ref = 0x00000088,
253 regk_ddr2_rtt150 = 0x00000040,
254 regk_ddr2_rtt50 = 0x00000044,
255 regk_ddr2_rtt75 = 0x00000004,
256 regk_ddr2_rw_cfg_default = 0x00186000,
257 regk_ddr2_rw_dll_ctrl_default = 0x00000000,
258 regk_ddr2_rw_dll_ctrl_size = 0x00000004,
259 regk_ddr2_rw_dqs_dll_ctrl_default = 0x00000000,
260 regk_ddr2_rw_dqs_dll_ctrl_size = 0x00000004,
261 regk_ddr2_rw_latency_default = 0x00000000,
262 regk_ddr2_rw_phy_cfg_default = 0x00000000,
263 regk_ddr2_rw_pwr_down_default = 0x00000000,
264 regk_ddr2_rw_timing_default = 0x00000000,
265 regk_ddr2_s1Gb = 0x0000001a,
266 regk_ddr2_s256Mb = 0x0000000f,
267 regk_ddr2_s2Gb = 0x00000027,
268 regk_ddr2_s4Gb = 0x00000042,
269 regk_ddr2_s512Mb = 0x00000015,
270 regk_ddr2_temp0_85 = 0x00000618,
271 regk_ddr2_temp85_95 = 0x0000030c,
272 regk_ddr2_term150 = 0x00000002,
273 regk_ddr2_term50 = 0x00000003,
274 regk_ddr2_term75 = 0x00000001,
275 regk_ddr2_test = 0x00000080,
276 regk_ddr2_weak = 0x00000000,
277 regk_ddr2_wr2 = 0x00000200,
278 regk_ddr2_wr3 = 0x00000400,
279 regk_ddr2_yes = 0x00000001
280};
281#endif /* __ddr2_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/gio_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/gio_defs.h
new file mode 100644
index 000000000000..5d88e0db23ae
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/gio_defs.h
@@ -0,0 +1,837 @@
1#ifndef __gio_defs_h
2#define __gio_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: gio.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile gio_defs.h gio.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope gio */
83
84/* Register r_pa_din, scope gio, type r */
85typedef struct {
86 unsigned int data : 32;
87} reg_gio_r_pa_din;
88#define REG_RD_ADDR_gio_r_pa_din 0
89
90/* Register rw_pa_dout, scope gio, type rw */
91typedef struct {
92 unsigned int data : 32;
93} reg_gio_rw_pa_dout;
94#define REG_RD_ADDR_gio_rw_pa_dout 4
95#define REG_WR_ADDR_gio_rw_pa_dout 4
96
97/* Register rw_pa_oe, scope gio, type rw */
98typedef struct {
99 unsigned int oe : 32;
100} reg_gio_rw_pa_oe;
101#define REG_RD_ADDR_gio_rw_pa_oe 8
102#define REG_WR_ADDR_gio_rw_pa_oe 8
103
104/* Register rw_pa_byte0_dout, scope gio, type rw */
105typedef struct {
106 unsigned int data : 8;
107 unsigned int dummy1 : 24;
108} reg_gio_rw_pa_byte0_dout;
109#define REG_RD_ADDR_gio_rw_pa_byte0_dout 12
110#define REG_WR_ADDR_gio_rw_pa_byte0_dout 12
111
112/* Register rw_pa_byte0_oe, scope gio, type rw */
113typedef struct {
114 unsigned int oe : 8;
115 unsigned int dummy1 : 24;
116} reg_gio_rw_pa_byte0_oe;
117#define REG_RD_ADDR_gio_rw_pa_byte0_oe 16
118#define REG_WR_ADDR_gio_rw_pa_byte0_oe 16
119
120/* Register rw_pa_byte1_dout, scope gio, type rw */
121typedef struct {
122 unsigned int data : 8;
123 unsigned int dummy1 : 24;
124} reg_gio_rw_pa_byte1_dout;
125#define REG_RD_ADDR_gio_rw_pa_byte1_dout 20
126#define REG_WR_ADDR_gio_rw_pa_byte1_dout 20
127
128/* Register rw_pa_byte1_oe, scope gio, type rw */
129typedef struct {
130 unsigned int oe : 8;
131 unsigned int dummy1 : 24;
132} reg_gio_rw_pa_byte1_oe;
133#define REG_RD_ADDR_gio_rw_pa_byte1_oe 24
134#define REG_WR_ADDR_gio_rw_pa_byte1_oe 24
135
136/* Register rw_pa_byte2_dout, scope gio, type rw */
137typedef struct {
138 unsigned int data : 8;
139 unsigned int dummy1 : 24;
140} reg_gio_rw_pa_byte2_dout;
141#define REG_RD_ADDR_gio_rw_pa_byte2_dout 28
142#define REG_WR_ADDR_gio_rw_pa_byte2_dout 28
143
144/* Register rw_pa_byte2_oe, scope gio, type rw */
145typedef struct {
146 unsigned int oe : 8;
147 unsigned int dummy1 : 24;
148} reg_gio_rw_pa_byte2_oe;
149#define REG_RD_ADDR_gio_rw_pa_byte2_oe 32
150#define REG_WR_ADDR_gio_rw_pa_byte2_oe 32
151
152/* Register rw_pa_byte3_dout, scope gio, type rw */
153typedef struct {
154 unsigned int data : 8;
155 unsigned int dummy1 : 24;
156} reg_gio_rw_pa_byte3_dout;
157#define REG_RD_ADDR_gio_rw_pa_byte3_dout 36
158#define REG_WR_ADDR_gio_rw_pa_byte3_dout 36
159
160/* Register rw_pa_byte3_oe, scope gio, type rw */
161typedef struct {
162 unsigned int oe : 8;
163 unsigned int dummy1 : 24;
164} reg_gio_rw_pa_byte3_oe;
165#define REG_RD_ADDR_gio_rw_pa_byte3_oe 40
166#define REG_WR_ADDR_gio_rw_pa_byte3_oe 40
167
168/* Register r_pb_din, scope gio, type r */
169typedef struct {
170 unsigned int data : 32;
171} reg_gio_r_pb_din;
172#define REG_RD_ADDR_gio_r_pb_din 44
173
174/* Register rw_pb_dout, scope gio, type rw */
175typedef struct {
176 unsigned int data : 32;
177} reg_gio_rw_pb_dout;
178#define REG_RD_ADDR_gio_rw_pb_dout 48
179#define REG_WR_ADDR_gio_rw_pb_dout 48
180
181/* Register rw_pb_oe, scope gio, type rw */
182typedef struct {
183 unsigned int oe : 32;
184} reg_gio_rw_pb_oe;
185#define REG_RD_ADDR_gio_rw_pb_oe 52
186#define REG_WR_ADDR_gio_rw_pb_oe 52
187
188/* Register rw_pb_byte0_dout, scope gio, type rw */
189typedef struct {
190 unsigned int data : 8;
191 unsigned int dummy1 : 24;
192} reg_gio_rw_pb_byte0_dout;
193#define REG_RD_ADDR_gio_rw_pb_byte0_dout 56
194#define REG_WR_ADDR_gio_rw_pb_byte0_dout 56
195
196/* Register rw_pb_byte0_oe, scope gio, type rw */
197typedef struct {
198 unsigned int oe : 8;
199 unsigned int dummy1 : 24;
200} reg_gio_rw_pb_byte0_oe;
201#define REG_RD_ADDR_gio_rw_pb_byte0_oe 60
202#define REG_WR_ADDR_gio_rw_pb_byte0_oe 60
203
204/* Register rw_pb_byte1_dout, scope gio, type rw */
205typedef struct {
206 unsigned int data : 8;
207 unsigned int dummy1 : 24;
208} reg_gio_rw_pb_byte1_dout;
209#define REG_RD_ADDR_gio_rw_pb_byte1_dout 64
210#define REG_WR_ADDR_gio_rw_pb_byte1_dout 64
211
212/* Register rw_pb_byte1_oe, scope gio, type rw */
213typedef struct {
214 unsigned int oe : 8;
215 unsigned int dummy1 : 24;
216} reg_gio_rw_pb_byte1_oe;
217#define REG_RD_ADDR_gio_rw_pb_byte1_oe 68
218#define REG_WR_ADDR_gio_rw_pb_byte1_oe 68
219
220/* Register rw_pb_byte2_dout, scope gio, type rw */
221typedef struct {
222 unsigned int data : 8;
223 unsigned int dummy1 : 24;
224} reg_gio_rw_pb_byte2_dout;
225#define REG_RD_ADDR_gio_rw_pb_byte2_dout 72
226#define REG_WR_ADDR_gio_rw_pb_byte2_dout 72
227
228/* Register rw_pb_byte2_oe, scope gio, type rw */
229typedef struct {
230 unsigned int oe : 8;
231 unsigned int dummy1 : 24;
232} reg_gio_rw_pb_byte2_oe;
233#define REG_RD_ADDR_gio_rw_pb_byte2_oe 76
234#define REG_WR_ADDR_gio_rw_pb_byte2_oe 76
235
236/* Register rw_pb_byte3_dout, scope gio, type rw */
237typedef struct {
238 unsigned int data : 8;
239 unsigned int dummy1 : 24;
240} reg_gio_rw_pb_byte3_dout;
241#define REG_RD_ADDR_gio_rw_pb_byte3_dout 80
242#define REG_WR_ADDR_gio_rw_pb_byte3_dout 80
243
244/* Register rw_pb_byte3_oe, scope gio, type rw */
245typedef struct {
246 unsigned int oe : 8;
247 unsigned int dummy1 : 24;
248} reg_gio_rw_pb_byte3_oe;
249#define REG_RD_ADDR_gio_rw_pb_byte3_oe 84
250#define REG_WR_ADDR_gio_rw_pb_byte3_oe 84
251
252/* Register r_pc_din, scope gio, type r */
253typedef struct {
254 unsigned int data : 16;
255 unsigned int dummy1 : 16;
256} reg_gio_r_pc_din;
257#define REG_RD_ADDR_gio_r_pc_din 88
258
259/* Register rw_pc_dout, scope gio, type rw */
260typedef struct {
261 unsigned int data : 16;
262 unsigned int dummy1 : 16;
263} reg_gio_rw_pc_dout;
264#define REG_RD_ADDR_gio_rw_pc_dout 92
265#define REG_WR_ADDR_gio_rw_pc_dout 92
266
267/* Register rw_pc_oe, scope gio, type rw */
268typedef struct {
269 unsigned int oe : 16;
270 unsigned int dummy1 : 16;
271} reg_gio_rw_pc_oe;
272#define REG_RD_ADDR_gio_rw_pc_oe 96
273#define REG_WR_ADDR_gio_rw_pc_oe 96
274
275/* Register rw_pc_byte0_dout, scope gio, type rw */
276typedef struct {
277 unsigned int data : 8;
278 unsigned int dummy1 : 24;
279} reg_gio_rw_pc_byte0_dout;
280#define REG_RD_ADDR_gio_rw_pc_byte0_dout 100
281#define REG_WR_ADDR_gio_rw_pc_byte0_dout 100
282
283/* Register rw_pc_byte0_oe, scope gio, type rw */
284typedef struct {
285 unsigned int oe : 8;
286 unsigned int dummy1 : 24;
287} reg_gio_rw_pc_byte0_oe;
288#define REG_RD_ADDR_gio_rw_pc_byte0_oe 104
289#define REG_WR_ADDR_gio_rw_pc_byte0_oe 104
290
291/* Register rw_pc_byte1_dout, scope gio, type rw */
292typedef struct {
293 unsigned int data : 8;
294 unsigned int dummy1 : 24;
295} reg_gio_rw_pc_byte1_dout;
296#define REG_RD_ADDR_gio_rw_pc_byte1_dout 108
297#define REG_WR_ADDR_gio_rw_pc_byte1_dout 108
298
299/* Register rw_pc_byte1_oe, scope gio, type rw */
300typedef struct {
301 unsigned int oe : 8;
302 unsigned int dummy1 : 24;
303} reg_gio_rw_pc_byte1_oe;
304#define REG_RD_ADDR_gio_rw_pc_byte1_oe 112
305#define REG_WR_ADDR_gio_rw_pc_byte1_oe 112
306
307/* Register r_pd_din, scope gio, type r */
308typedef struct {
309 unsigned int data : 32;
310} reg_gio_r_pd_din;
311#define REG_RD_ADDR_gio_r_pd_din 116
312
313/* Register rw_intr_cfg, scope gio, type rw */
314typedef struct {
315 unsigned int intr0 : 3;
316 unsigned int intr1 : 3;
317 unsigned int intr2 : 3;
318 unsigned int intr3 : 3;
319 unsigned int intr4 : 3;
320 unsigned int intr5 : 3;
321 unsigned int intr6 : 3;
322 unsigned int intr7 : 3;
323 unsigned int dummy1 : 8;
324} reg_gio_rw_intr_cfg;
325#define REG_RD_ADDR_gio_rw_intr_cfg 120
326#define REG_WR_ADDR_gio_rw_intr_cfg 120
327
328/* Register rw_intr_pins, scope gio, type rw */
329typedef struct {
330 unsigned int intr0 : 4;
331 unsigned int intr1 : 4;
332 unsigned int intr2 : 4;
333 unsigned int intr3 : 4;
334 unsigned int intr4 : 4;
335 unsigned int intr5 : 4;
336 unsigned int intr6 : 4;
337 unsigned int intr7 : 4;
338} reg_gio_rw_intr_pins;
339#define REG_RD_ADDR_gio_rw_intr_pins 124
340#define REG_WR_ADDR_gio_rw_intr_pins 124
341
342/* Register rw_intr_mask, scope gio, type rw */
343typedef struct {
344 unsigned int intr0 : 1;
345 unsigned int intr1 : 1;
346 unsigned int intr2 : 1;
347 unsigned int intr3 : 1;
348 unsigned int intr4 : 1;
349 unsigned int intr5 : 1;
350 unsigned int intr6 : 1;
351 unsigned int intr7 : 1;
352 unsigned int i2c0_done : 1;
353 unsigned int i2c1_done : 1;
354 unsigned int dummy1 : 22;
355} reg_gio_rw_intr_mask;
356#define REG_RD_ADDR_gio_rw_intr_mask 128
357#define REG_WR_ADDR_gio_rw_intr_mask 128
358
359/* Register rw_ack_intr, scope gio, type rw */
360typedef struct {
361 unsigned int intr0 : 1;
362 unsigned int intr1 : 1;
363 unsigned int intr2 : 1;
364 unsigned int intr3 : 1;
365 unsigned int intr4 : 1;
366 unsigned int intr5 : 1;
367 unsigned int intr6 : 1;
368 unsigned int intr7 : 1;
369 unsigned int i2c0_done : 1;
370 unsigned int i2c1_done : 1;
371 unsigned int dummy1 : 22;
372} reg_gio_rw_ack_intr;
373#define REG_RD_ADDR_gio_rw_ack_intr 132
374#define REG_WR_ADDR_gio_rw_ack_intr 132
375
376/* Register r_intr, scope gio, type r */
377typedef struct {
378 unsigned int intr0 : 1;
379 unsigned int intr1 : 1;
380 unsigned int intr2 : 1;
381 unsigned int intr3 : 1;
382 unsigned int intr4 : 1;
383 unsigned int intr5 : 1;
384 unsigned int intr6 : 1;
385 unsigned int intr7 : 1;
386 unsigned int i2c0_done : 1;
387 unsigned int i2c1_done : 1;
388 unsigned int dummy1 : 22;
389} reg_gio_r_intr;
390#define REG_RD_ADDR_gio_r_intr 136
391
392/* Register r_masked_intr, scope gio, type r */
393typedef struct {
394 unsigned int intr0 : 1;
395 unsigned int intr1 : 1;
396 unsigned int intr2 : 1;
397 unsigned int intr3 : 1;
398 unsigned int intr4 : 1;
399 unsigned int intr5 : 1;
400 unsigned int intr6 : 1;
401 unsigned int intr7 : 1;
402 unsigned int i2c0_done : 1;
403 unsigned int i2c1_done : 1;
404 unsigned int dummy1 : 22;
405} reg_gio_r_masked_intr;
406#define REG_RD_ADDR_gio_r_masked_intr 140
407
408/* Register rw_i2c0_start, scope gio, type rw */
409typedef struct {
410 unsigned int run : 1;
411 unsigned int dummy1 : 31;
412} reg_gio_rw_i2c0_start;
413#define REG_RD_ADDR_gio_rw_i2c0_start 144
414#define REG_WR_ADDR_gio_rw_i2c0_start 144
415
416/* Register rw_i2c0_cfg, scope gio, type rw */
417typedef struct {
418 unsigned int en : 1;
419 unsigned int bit_order : 1;
420 unsigned int scl_io : 1;
421 unsigned int scl_inv : 1;
422 unsigned int sda_io : 1;
423 unsigned int sda_idle : 1;
424 unsigned int dummy1 : 26;
425} reg_gio_rw_i2c0_cfg;
426#define REG_RD_ADDR_gio_rw_i2c0_cfg 148
427#define REG_WR_ADDR_gio_rw_i2c0_cfg 148
428
429/* Register rw_i2c0_ctrl, scope gio, type rw */
430typedef struct {
431 unsigned int trf_bits : 6;
432 unsigned int switch_dir : 6;
433 unsigned int extra_start : 3;
434 unsigned int early_end : 1;
435 unsigned int start_stop : 1;
436 unsigned int ack_dir0 : 1;
437 unsigned int ack_dir1 : 1;
438 unsigned int ack_dir2 : 1;
439 unsigned int ack_dir3 : 1;
440 unsigned int ack_dir4 : 1;
441 unsigned int ack_dir5 : 1;
442 unsigned int ack_bit : 1;
443 unsigned int start_bit : 1;
444 unsigned int freq : 2;
445 unsigned int dummy1 : 5;
446} reg_gio_rw_i2c0_ctrl;
447#define REG_RD_ADDR_gio_rw_i2c0_ctrl 152
448#define REG_WR_ADDR_gio_rw_i2c0_ctrl 152
449
450/* Register rw_i2c0_data, scope gio, type rw */
451typedef struct {
452 unsigned int data0 : 8;
453 unsigned int data1 : 8;
454 unsigned int data2 : 8;
455 unsigned int data3 : 8;
456} reg_gio_rw_i2c0_data;
457#define REG_RD_ADDR_gio_rw_i2c0_data 156
458#define REG_WR_ADDR_gio_rw_i2c0_data 156
459
460/* Register rw_i2c0_data2, scope gio, type rw */
461typedef struct {
462 unsigned int data4 : 8;
463 unsigned int data5 : 8;
464 unsigned int start_val : 6;
465 unsigned int ack_val : 6;
466 unsigned int dummy1 : 4;
467} reg_gio_rw_i2c0_data2;
468#define REG_RD_ADDR_gio_rw_i2c0_data2 160
469#define REG_WR_ADDR_gio_rw_i2c0_data2 160
470
471/* Register rw_i2c1_start, scope gio, type rw */
472typedef struct {
473 unsigned int run : 1;
474 unsigned int dummy1 : 31;
475} reg_gio_rw_i2c1_start;
476#define REG_RD_ADDR_gio_rw_i2c1_start 164
477#define REG_WR_ADDR_gio_rw_i2c1_start 164
478
479/* Register rw_i2c1_cfg, scope gio, type rw */
480typedef struct {
481 unsigned int en : 1;
482 unsigned int bit_order : 1;
483 unsigned int scl_io : 1;
484 unsigned int scl_inv : 1;
485 unsigned int sda0_io : 1;
486 unsigned int sda0_idle : 1;
487 unsigned int sda1_io : 1;
488 unsigned int sda1_idle : 1;
489 unsigned int sda2_io : 1;
490 unsigned int sda2_idle : 1;
491 unsigned int sda3_io : 1;
492 unsigned int sda3_idle : 1;
493 unsigned int sda_sel : 2;
494 unsigned int sen_idle : 1;
495 unsigned int sen_inv : 1;
496 unsigned int sen_sel : 2;
497 unsigned int dummy1 : 14;
498} reg_gio_rw_i2c1_cfg;
499#define REG_RD_ADDR_gio_rw_i2c1_cfg 168
500#define REG_WR_ADDR_gio_rw_i2c1_cfg 168
501
502/* Register rw_i2c1_ctrl, scope gio, type rw */
503typedef struct {
504 unsigned int trf_bits : 6;
505 unsigned int switch_dir : 6;
506 unsigned int extra_start : 3;
507 unsigned int early_end : 1;
508 unsigned int start_stop : 1;
509 unsigned int ack_dir0 : 1;
510 unsigned int ack_dir1 : 1;
511 unsigned int ack_dir2 : 1;
512 unsigned int ack_dir3 : 1;
513 unsigned int ack_dir4 : 1;
514 unsigned int ack_dir5 : 1;
515 unsigned int ack_bit : 1;
516 unsigned int start_bit : 1;
517 unsigned int freq : 2;
518 unsigned int dummy1 : 5;
519} reg_gio_rw_i2c1_ctrl;
520#define REG_RD_ADDR_gio_rw_i2c1_ctrl 172
521#define REG_WR_ADDR_gio_rw_i2c1_ctrl 172
522
523/* Register rw_i2c1_data, scope gio, type rw */
524typedef struct {
525 unsigned int data0 : 8;
526 unsigned int data1 : 8;
527 unsigned int data2 : 8;
528 unsigned int data3 : 8;
529} reg_gio_rw_i2c1_data;
530#define REG_RD_ADDR_gio_rw_i2c1_data 176
531#define REG_WR_ADDR_gio_rw_i2c1_data 176
532
533/* Register rw_i2c1_data2, scope gio, type rw */
534typedef struct {
535 unsigned int data4 : 8;
536 unsigned int data5 : 8;
537 unsigned int start_val : 6;
538 unsigned int ack_val : 6;
539 unsigned int dummy1 : 4;
540} reg_gio_rw_i2c1_data2;
541#define REG_RD_ADDR_gio_rw_i2c1_data2 180
542#define REG_WR_ADDR_gio_rw_i2c1_data2 180
543
544/* Register r_ppwm_stat, scope gio, type r */
545typedef struct {
546 unsigned int freq : 2;
547 unsigned int dummy1 : 30;
548} reg_gio_r_ppwm_stat;
549#define REG_RD_ADDR_gio_r_ppwm_stat 184
550
551/* Register rw_ppwm_data, scope gio, type rw */
552typedef struct {
553 unsigned int data : 8;
554 unsigned int dummy1 : 24;
555} reg_gio_rw_ppwm_data;
556#define REG_RD_ADDR_gio_rw_ppwm_data 188
557#define REG_WR_ADDR_gio_rw_ppwm_data 188
558
559/* Register rw_pwm0_ctrl, scope gio, type rw */
560typedef struct {
561 unsigned int mode : 2;
562 unsigned int ccd_override : 1;
563 unsigned int ccd_val : 1;
564 unsigned int dummy1 : 28;
565} reg_gio_rw_pwm0_ctrl;
566#define REG_RD_ADDR_gio_rw_pwm0_ctrl 192
567#define REG_WR_ADDR_gio_rw_pwm0_ctrl 192
568
569/* Register rw_pwm0_var, scope gio, type rw */
570typedef struct {
571 unsigned int lo : 13;
572 unsigned int hi : 13;
573 unsigned int dummy1 : 6;
574} reg_gio_rw_pwm0_var;
575#define REG_RD_ADDR_gio_rw_pwm0_var 196
576#define REG_WR_ADDR_gio_rw_pwm0_var 196
577
578/* Register rw_pwm0_data, scope gio, type rw */
579typedef struct {
580 unsigned int data : 8;
581 unsigned int dummy1 : 24;
582} reg_gio_rw_pwm0_data;
583#define REG_RD_ADDR_gio_rw_pwm0_data 200
584#define REG_WR_ADDR_gio_rw_pwm0_data 200
585
586/* Register rw_pwm1_ctrl, scope gio, type rw */
587typedef struct {
588 unsigned int mode : 2;
589 unsigned int ccd_override : 1;
590 unsigned int ccd_val : 1;
591 unsigned int dummy1 : 28;
592} reg_gio_rw_pwm1_ctrl;
593#define REG_RD_ADDR_gio_rw_pwm1_ctrl 204
594#define REG_WR_ADDR_gio_rw_pwm1_ctrl 204
595
596/* Register rw_pwm1_var, scope gio, type rw */
597typedef struct {
598 unsigned int lo : 13;
599 unsigned int hi : 13;
600 unsigned int dummy1 : 6;
601} reg_gio_rw_pwm1_var;
602#define REG_RD_ADDR_gio_rw_pwm1_var 208
603#define REG_WR_ADDR_gio_rw_pwm1_var 208
604
605/* Register rw_pwm1_data, scope gio, type rw */
606typedef struct {
607 unsigned int data : 8;
608 unsigned int dummy1 : 24;
609} reg_gio_rw_pwm1_data;
610#define REG_RD_ADDR_gio_rw_pwm1_data 212
611#define REG_WR_ADDR_gio_rw_pwm1_data 212
612
613/* Register rw_pwm2_ctrl, scope gio, type rw */
614typedef struct {
615 unsigned int mode : 2;
616 unsigned int ccd_override : 1;
617 unsigned int ccd_val : 1;
618 unsigned int dummy1 : 28;
619} reg_gio_rw_pwm2_ctrl;
620#define REG_RD_ADDR_gio_rw_pwm2_ctrl 216
621#define REG_WR_ADDR_gio_rw_pwm2_ctrl 216
622
623/* Register rw_pwm2_var, scope gio, type rw */
624typedef struct {
625 unsigned int lo : 13;
626 unsigned int hi : 13;
627 unsigned int dummy1 : 6;
628} reg_gio_rw_pwm2_var;
629#define REG_RD_ADDR_gio_rw_pwm2_var 220
630#define REG_WR_ADDR_gio_rw_pwm2_var 220
631
632/* Register rw_pwm2_data, scope gio, type rw */
633typedef struct {
634 unsigned int data : 8;
635 unsigned int dummy1 : 24;
636} reg_gio_rw_pwm2_data;
637#define REG_RD_ADDR_gio_rw_pwm2_data 224
638#define REG_WR_ADDR_gio_rw_pwm2_data 224
639
640/* Register rw_pwm_in_cfg, scope gio, type rw */
641typedef struct {
642 unsigned int pin : 3;
643 unsigned int dummy1 : 29;
644} reg_gio_rw_pwm_in_cfg;
645#define REG_RD_ADDR_gio_rw_pwm_in_cfg 228
646#define REG_WR_ADDR_gio_rw_pwm_in_cfg 228
647
648/* Register r_pwm_in_lo, scope gio, type r */
649typedef struct {
650 unsigned int data : 32;
651} reg_gio_r_pwm_in_lo;
652#define REG_RD_ADDR_gio_r_pwm_in_lo 232
653
654/* Register r_pwm_in_hi, scope gio, type r */
655typedef struct {
656 unsigned int data : 32;
657} reg_gio_r_pwm_in_hi;
658#define REG_RD_ADDR_gio_r_pwm_in_hi 236
659
660/* Register r_pwm_in_cnt, scope gio, type r */
661typedef struct {
662 unsigned int data : 32;
663} reg_gio_r_pwm_in_cnt;
664#define REG_RD_ADDR_gio_r_pwm_in_cnt 240
665
666
667/* Constants */
668enum {
669 regk_gio_anyedge = 0x00000007,
670 regk_gio_f100k = 0x00000000,
671 regk_gio_f1562 = 0x00000000,
672 regk_gio_f195 = 0x00000003,
673 regk_gio_f1m = 0x00000002,
674 regk_gio_f390 = 0x00000002,
675 regk_gio_f400k = 0x00000001,
676 regk_gio_f5m = 0x00000003,
677 regk_gio_f781 = 0x00000001,
678 regk_gio_hi = 0x00000001,
679 regk_gio_in = 0x00000000,
680 regk_gio_intr_pa0 = 0x00000000,
681 regk_gio_intr_pa1 = 0x00000000,
682 regk_gio_intr_pa10 = 0x00000001,
683 regk_gio_intr_pa11 = 0x00000001,
684 regk_gio_intr_pa12 = 0x00000001,
685 regk_gio_intr_pa13 = 0x00000001,
686 regk_gio_intr_pa14 = 0x00000001,
687 regk_gio_intr_pa15 = 0x00000001,
688 regk_gio_intr_pa16 = 0x00000002,
689 regk_gio_intr_pa17 = 0x00000002,
690 regk_gio_intr_pa18 = 0x00000002,
691 regk_gio_intr_pa19 = 0x00000002,
692 regk_gio_intr_pa2 = 0x00000000,
693 regk_gio_intr_pa20 = 0x00000002,
694 regk_gio_intr_pa21 = 0x00000002,
695 regk_gio_intr_pa22 = 0x00000002,
696 regk_gio_intr_pa23 = 0x00000002,
697 regk_gio_intr_pa24 = 0x00000003,
698 regk_gio_intr_pa25 = 0x00000003,
699 regk_gio_intr_pa26 = 0x00000003,
700 regk_gio_intr_pa27 = 0x00000003,
701 regk_gio_intr_pa28 = 0x00000003,
702 regk_gio_intr_pa29 = 0x00000003,
703 regk_gio_intr_pa3 = 0x00000000,
704 regk_gio_intr_pa30 = 0x00000003,
705 regk_gio_intr_pa31 = 0x00000003,
706 regk_gio_intr_pa4 = 0x00000000,
707 regk_gio_intr_pa5 = 0x00000000,
708 regk_gio_intr_pa6 = 0x00000000,
709 regk_gio_intr_pa7 = 0x00000000,
710 regk_gio_intr_pa8 = 0x00000001,
711 regk_gio_intr_pa9 = 0x00000001,
712 regk_gio_intr_pb0 = 0x00000004,
713 regk_gio_intr_pb1 = 0x00000004,
714 regk_gio_intr_pb10 = 0x00000005,
715 regk_gio_intr_pb11 = 0x00000005,
716 regk_gio_intr_pb12 = 0x00000005,
717 regk_gio_intr_pb13 = 0x00000005,
718 regk_gio_intr_pb14 = 0x00000005,
719 regk_gio_intr_pb15 = 0x00000005,
720 regk_gio_intr_pb16 = 0x00000006,
721 regk_gio_intr_pb17 = 0x00000006,
722 regk_gio_intr_pb18 = 0x00000006,
723 regk_gio_intr_pb19 = 0x00000006,
724 regk_gio_intr_pb2 = 0x00000004,
725 regk_gio_intr_pb20 = 0x00000006,
726 regk_gio_intr_pb21 = 0x00000006,
727 regk_gio_intr_pb22 = 0x00000006,
728 regk_gio_intr_pb23 = 0x00000006,
729 regk_gio_intr_pb24 = 0x00000007,
730 regk_gio_intr_pb25 = 0x00000007,
731 regk_gio_intr_pb26 = 0x00000007,
732 regk_gio_intr_pb27 = 0x00000007,
733 regk_gio_intr_pb28 = 0x00000007,
734 regk_gio_intr_pb29 = 0x00000007,
735 regk_gio_intr_pb3 = 0x00000004,
736 regk_gio_intr_pb30 = 0x00000007,
737 regk_gio_intr_pb31 = 0x00000007,
738 regk_gio_intr_pb4 = 0x00000004,
739 regk_gio_intr_pb5 = 0x00000004,
740 regk_gio_intr_pb6 = 0x00000004,
741 regk_gio_intr_pb7 = 0x00000004,
742 regk_gio_intr_pb8 = 0x00000005,
743 regk_gio_intr_pb9 = 0x00000005,
744 regk_gio_intr_pc0 = 0x00000008,
745 regk_gio_intr_pc1 = 0x00000008,
746 regk_gio_intr_pc10 = 0x00000009,
747 regk_gio_intr_pc11 = 0x00000009,
748 regk_gio_intr_pc12 = 0x00000009,
749 regk_gio_intr_pc13 = 0x00000009,
750 regk_gio_intr_pc14 = 0x00000009,
751 regk_gio_intr_pc15 = 0x00000009,
752 regk_gio_intr_pc2 = 0x00000008,
753 regk_gio_intr_pc3 = 0x00000008,
754 regk_gio_intr_pc4 = 0x00000008,
755 regk_gio_intr_pc5 = 0x00000008,
756 regk_gio_intr_pc6 = 0x00000008,
757 regk_gio_intr_pc7 = 0x00000008,
758 regk_gio_intr_pc8 = 0x00000009,
759 regk_gio_intr_pc9 = 0x00000009,
760 regk_gio_intr_pd0 = 0x0000000c,
761 regk_gio_intr_pd1 = 0x0000000c,
762 regk_gio_intr_pd10 = 0x0000000d,
763 regk_gio_intr_pd11 = 0x0000000d,
764 regk_gio_intr_pd12 = 0x0000000d,
765 regk_gio_intr_pd13 = 0x0000000d,
766 regk_gio_intr_pd14 = 0x0000000d,
767 regk_gio_intr_pd15 = 0x0000000d,
768 regk_gio_intr_pd16 = 0x0000000e,
769 regk_gio_intr_pd17 = 0x0000000e,
770 regk_gio_intr_pd18 = 0x0000000e,
771 regk_gio_intr_pd19 = 0x0000000e,
772 regk_gio_intr_pd2 = 0x0000000c,
773 regk_gio_intr_pd20 = 0x0000000e,
774 regk_gio_intr_pd21 = 0x0000000e,
775 regk_gio_intr_pd22 = 0x0000000e,
776 regk_gio_intr_pd23 = 0x0000000e,
777 regk_gio_intr_pd24 = 0x0000000f,
778 regk_gio_intr_pd25 = 0x0000000f,
779 regk_gio_intr_pd26 = 0x0000000f,
780 regk_gio_intr_pd27 = 0x0000000f,
781 regk_gio_intr_pd28 = 0x0000000f,
782 regk_gio_intr_pd29 = 0x0000000f,
783 regk_gio_intr_pd3 = 0x0000000c,
784 regk_gio_intr_pd30 = 0x0000000f,
785 regk_gio_intr_pd31 = 0x0000000f,
786 regk_gio_intr_pd4 = 0x0000000c,
787 regk_gio_intr_pd5 = 0x0000000c,
788 regk_gio_intr_pd6 = 0x0000000c,
789 regk_gio_intr_pd7 = 0x0000000c,
790 regk_gio_intr_pd8 = 0x0000000d,
791 regk_gio_intr_pd9 = 0x0000000d,
792 regk_gio_lo = 0x00000002,
793 regk_gio_lsb = 0x00000000,
794 regk_gio_msb = 0x00000001,
795 regk_gio_negedge = 0x00000006,
796 regk_gio_no = 0x00000000,
797 regk_gio_no_switch = 0x0000003f,
798 regk_gio_none = 0x00000007,
799 regk_gio_off = 0x00000000,
800 regk_gio_opendrain = 0x00000000,
801 regk_gio_out = 0x00000001,
802 regk_gio_posedge = 0x00000005,
803 regk_gio_pwm_hfp = 0x00000002,
804 regk_gio_pwm_pa0 = 0x00000001,
805 regk_gio_pwm_pa19 = 0x00000004,
806 regk_gio_pwm_pa6 = 0x00000002,
807 regk_gio_pwm_pa7 = 0x00000003,
808 regk_gio_pwm_pb26 = 0x00000005,
809 regk_gio_pwm_pd23 = 0x00000006,
810 regk_gio_pwm_pd31 = 0x00000007,
811 regk_gio_pwm_std = 0x00000001,
812 regk_gio_pwm_var = 0x00000003,
813 regk_gio_rw_i2c0_cfg_default = 0x00000020,
814 regk_gio_rw_i2c0_ctrl_default = 0x00010000,
815 regk_gio_rw_i2c0_start_default = 0x00000000,
816 regk_gio_rw_i2c1_cfg_default = 0x00000aa0,
817 regk_gio_rw_i2c1_ctrl_default = 0x00010000,
818 regk_gio_rw_i2c1_start_default = 0x00000000,
819 regk_gio_rw_intr_cfg_default = 0x00000000,
820 regk_gio_rw_intr_mask_default = 0x00000000,
821 regk_gio_rw_pa_oe_default = 0x00000000,
822 regk_gio_rw_pb_oe_default = 0x00000000,
823 regk_gio_rw_pc_oe_default = 0x00000000,
824 regk_gio_rw_ppwm_data_default = 0x00000000,
825 regk_gio_rw_pwm0_ctrl_default = 0x00000000,
826 regk_gio_rw_pwm1_ctrl_default = 0x00000000,
827 regk_gio_rw_pwm2_ctrl_default = 0x00000000,
828 regk_gio_rw_pwm_in_cfg_default = 0x00000000,
829 regk_gio_sda0 = 0x00000000,
830 regk_gio_sda1 = 0x00000001,
831 regk_gio_sda2 = 0x00000002,
832 regk_gio_sda3 = 0x00000003,
833 regk_gio_sen = 0x00000000,
834 regk_gio_set = 0x00000003,
835 regk_gio_yes = 0x00000001
836};
837#endif /* __gio_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/intr_vect.h b/include/asm-cris/arch-v32/mach-a3/hwregs/intr_vect.h
new file mode 100644
index 000000000000..bea699aa480e
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/intr_vect.h
@@ -0,0 +1,46 @@
1/* Interrupt vector numbers autogenerated by ../../../tools/rdesc/bin/rdes2intr
2 from intr_vect.r */
3
4#ifndef _INTR_VECT_R
5#define _INTR_VECT_R
6#define TIMER0_INTR_VECT 0x31
7#define TIMER1_INTR_VECT 0x32
8#define DMA0_INTR_VECT 0x33
9#define DMA1_INTR_VECT 0x34
10#define DMA2_INTR_VECT 0x35
11#define DMA3_INTR_VECT 0x36
12#define DMA4_INTR_VECT 0x37
13#define DMA5_INTR_VECT 0x38
14#define DMA6_INTR_VECT 0x39
15#define DMA7_INTR_VECT 0x3a
16#define DMA9_INTR_VECT 0x3b
17#define DMA11_INTR_VECT 0x3c
18#define GIO_INTR_VECT 0x3d
19#define IOP0_INTR_VECT 0x3e
20#define IOP1_INTR_VECT 0x3f
21#define SER0_INTR_VECT 0x40
22#define SER1_INTR_VECT 0x41
23#define SER2_INTR_VECT 0x42
24#define SER3_INTR_VECT 0x43
25#define SER4_INTR_VECT 0x44
26#define SSER_INTR_VECT 0x45
27#define STRDMA0_INTR_VECT 0x46
28#define STRDMA1_INTR_VECT 0x47
29#define STRDMA2_INTR_VECT 0x48
30#define STRDMA3_INTR_VECT 0x49
31#define STRDMA5_INTR_VECT 0x4a
32#define VIN_INTR_VECT 0x4b
33#define VOUT_INTR_VECT 0x4c
34#define JPEG_INTR_VECT 0x4d
35#define H264_INTR_VECT 0x4e
36#define HISTO_INTR_VECT 0x4f
37#define CCD_INTR_VECT 0x50
38#define ETH_INTR_VECT 0x51
39#define MEMARB_BAR_INTR_VECT 0x52
40#define MEMARB_FOO_INTR_VECT 0x53
41#define PIO_INTR_VECT 0x54
42#define SCLR_INTR_VECT 0x55
43#define SCLR_FIFO_INTR_VECT 0x56
44#define IPI_INTR_VECT 0x57
45#define NBR_INTR_VECT 0x58
46#endif
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/intr_vect_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/intr_vect_defs.h
new file mode 100644
index 000000000000..b820f6347c74
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/intr_vect_defs.h
@@ -0,0 +1,341 @@
1#ifndef __intr_vect_defs_h
2#define __intr_vect_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: intr_vect.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile intr_vect_defs.h intr_vect.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope intr_vect */
83
84
85#define STRIDE_intr_vect_rw_mask 4
86/* Register rw_mask0, scope intr_vect, type rw */
87typedef struct {
88 unsigned int timer0 : 1;
89 unsigned int timer1 : 1;
90 unsigned int dma0 : 1;
91 unsigned int dma1 : 1;
92 unsigned int dma2 : 1;
93 unsigned int dma3 : 1;
94 unsigned int dma4 : 1;
95 unsigned int dma5 : 1;
96 unsigned int dma6 : 1;
97 unsigned int dma7 : 1;
98 unsigned int dma9 : 1;
99 unsigned int dma11 : 1;
100 unsigned int gio : 1;
101 unsigned int iop0 : 1;
102 unsigned int iop1 : 1;
103 unsigned int ser0 : 1;
104 unsigned int ser1 : 1;
105 unsigned int ser2 : 1;
106 unsigned int ser3 : 1;
107 unsigned int ser4 : 1;
108 unsigned int sser : 1;
109 unsigned int strdma0 : 1;
110 unsigned int strdma1 : 1;
111 unsigned int strdma2 : 1;
112 unsigned int strdma3 : 1;
113 unsigned int strdma5 : 1;
114 unsigned int vin : 1;
115 unsigned int vout : 1;
116 unsigned int jpeg : 1;
117 unsigned int h264 : 1;
118 unsigned int histo : 1;
119 unsigned int ccd : 1;
120} reg_intr_vect_rw_mask0;
121#define reg_intr_vect_rw_mask reg_intr_vect_rw_mask0
122#define REG_RD_ADDR_intr_vect_rw_mask 0
123#define REG_WR_ADDR_intr_vect_rw_mask 0
124#define REG_RD_ADDR_intr_vect_rw_mask0 0
125#define REG_WR_ADDR_intr_vect_rw_mask0 0
126
127#define STRIDE_intr_vect_r_vect 4
128/* Register r_vect0, scope intr_vect, type r */
129typedef struct {
130 unsigned int timer0 : 1;
131 unsigned int timer1 : 1;
132 unsigned int dma0 : 1;
133 unsigned int dma1 : 1;
134 unsigned int dma2 : 1;
135 unsigned int dma3 : 1;
136 unsigned int dma4 : 1;
137 unsigned int dma5 : 1;
138 unsigned int dma6 : 1;
139 unsigned int dma7 : 1;
140 unsigned int dma9 : 1;
141 unsigned int dma11 : 1;
142 unsigned int gio : 1;
143 unsigned int iop0 : 1;
144 unsigned int iop1 : 1;
145 unsigned int ser0 : 1;
146 unsigned int ser1 : 1;
147 unsigned int ser2 : 1;
148 unsigned int ser3 : 1;
149 unsigned int ser4 : 1;
150 unsigned int sser : 1;
151 unsigned int strdma0 : 1;
152 unsigned int strdma1 : 1;
153 unsigned int strdma2 : 1;
154 unsigned int strdma3 : 1;
155 unsigned int strdma5 : 1;
156 unsigned int vin : 1;
157 unsigned int vout : 1;
158 unsigned int jpeg : 1;
159 unsigned int h264 : 1;
160 unsigned int histo : 1;
161 unsigned int ccd : 1;
162} reg_intr_vect_r_vect0;
163#define reg_intr_vect_r_vect reg_intr_vect_r_vect0
164#define REG_RD_ADDR_intr_vect_r_vect 8
165#define REG_RD_ADDR_intr_vect_r_vect0 8
166
167#define STRIDE_intr_vect_r_masked_vect 4
168/* Register r_masked_vect0, scope intr_vect, type r */
169typedef struct {
170 unsigned int timer0 : 1;
171 unsigned int timer1 : 1;
172 unsigned int dma0 : 1;
173 unsigned int dma1 : 1;
174 unsigned int dma2 : 1;
175 unsigned int dma3 : 1;
176 unsigned int dma4 : 1;
177 unsigned int dma5 : 1;
178 unsigned int dma6 : 1;
179 unsigned int dma7 : 1;
180 unsigned int dma9 : 1;
181 unsigned int dma11 : 1;
182 unsigned int gio : 1;
183 unsigned int iop0 : 1;
184 unsigned int iop1 : 1;
185 unsigned int ser0 : 1;
186 unsigned int ser1 : 1;
187 unsigned int ser2 : 1;
188 unsigned int ser3 : 1;
189 unsigned int ser4 : 1;
190 unsigned int sser : 1;
191 unsigned int strdma0 : 1;
192 unsigned int strdma1 : 1;
193 unsigned int strdma2 : 1;
194 unsigned int strdma3 : 1;
195 unsigned int strdma5 : 1;
196 unsigned int vin : 1;
197 unsigned int vout : 1;
198 unsigned int jpeg : 1;
199 unsigned int h264 : 1;
200 unsigned int histo : 1;
201 unsigned int ccd : 1;
202} reg_intr_vect_r_masked_vect0;
203#define reg_intr_vect_r_masked_vect reg_intr_masked_vect_r_vect0
204#define REG_RD_ADDR_intr_vect_r_masked_vect0 16
205#define REG_RD_ADDR_intr_vect_r_masked_vect 16
206
207#define STRIDE_intr_vect_rw_xmask 4
208/* Register rw_xmask0, scope intr_vect, type rw */
209typedef struct {
210 unsigned int timer0 : 1;
211 unsigned int timer1 : 1;
212 unsigned int dma0 : 1;
213 unsigned int dma1 : 1;
214 unsigned int dma2 : 1;
215 unsigned int dma3 : 1;
216 unsigned int dma4 : 1;
217 unsigned int dma5 : 1;
218 unsigned int dma6 : 1;
219 unsigned int dma7 : 1;
220 unsigned int dma9 : 1;
221 unsigned int dma11 : 1;
222 unsigned int gio : 1;
223 unsigned int iop0 : 1;
224 unsigned int iop1 : 1;
225 unsigned int ser0 : 1;
226 unsigned int ser1 : 1;
227 unsigned int ser2 : 1;
228 unsigned int ser3 : 1;
229 unsigned int ser4 : 1;
230 unsigned int sser : 1;
231 unsigned int strdma0 : 1;
232 unsigned int strdma1 : 1;
233 unsigned int strdma2 : 1;
234 unsigned int strdma3 : 1;
235 unsigned int strdma5 : 1;
236 unsigned int vin : 1;
237 unsigned int vout : 1;
238 unsigned int jpeg : 1;
239 unsigned int h264 : 1;
240 unsigned int histo : 1;
241 unsigned int ccd : 1;
242} reg_intr_vect_rw_xmask0;
243#define reg_intr_vect_rw_xmask reg_intr_vect_rw_xmask0
244#define REG_RD_ADDR_intr_vect_rw_xmask0 24
245#define REG_WR_ADDR_intr_vect_rw_xmask0 24
246#define REG_RD_ADDR_intr_vect_rw_xmask 24
247#define REG_WR_ADDR_intr_vect_rw_xmask 24
248
249/* Register rw_mask1, scope intr_vect, type rw */
250typedef struct {
251 unsigned int eth : 1;
252 unsigned int memarb_bar : 1;
253 unsigned int memarb_foo : 1;
254 unsigned int pio : 1;
255 unsigned int sclr : 1;
256 unsigned int sclr_fifo : 1;
257 unsigned int dummy1 : 26;
258} reg_intr_vect_rw_mask1;
259#define REG_RD_ADDR_intr_vect_rw_mask1 4
260#define REG_WR_ADDR_intr_vect_rw_mask1 4
261
262/* Register r_vect1, scope intr_vect, type r */
263typedef struct {
264 unsigned int eth : 1;
265 unsigned int memarb_bar : 1;
266 unsigned int memarb_foo : 1;
267 unsigned int pio : 1;
268 unsigned int sclr : 1;
269 unsigned int sclr_fifo : 1;
270 unsigned int dummy1 : 26;
271} reg_intr_vect_r_vect1;
272#define REG_RD_ADDR_intr_vect_r_vect1 12
273
274/* Register r_masked_vect1, scope intr_vect, type r */
275typedef struct {
276 unsigned int eth : 1;
277 unsigned int memarb_bar : 1;
278 unsigned int memarb_foo : 1;
279 unsigned int pio : 1;
280 unsigned int sclr : 1;
281 unsigned int sclr_fifo : 1;
282 unsigned int dummy1 : 26;
283} reg_intr_vect_r_masked_vect1;
284#define REG_RD_ADDR_intr_vect_r_masked_vect1 20
285
286/* Register rw_xmask1, scope intr_vect, type rw */
287typedef struct {
288 unsigned int eth : 1;
289 unsigned int memarb_bar : 1;
290 unsigned int memarb_foo : 1;
291 unsigned int pio : 1;
292 unsigned int sclr : 1;
293 unsigned int sclr_fifo : 1;
294 unsigned int dummy1 : 26;
295} reg_intr_vect_rw_xmask1;
296#define REG_RD_ADDR_intr_vect_rw_xmask1 28
297#define REG_WR_ADDR_intr_vect_rw_xmask1 28
298
299/* Register rw_xmask_ctrl, scope intr_vect, type rw */
300typedef struct {
301 unsigned int en : 1;
302 unsigned int dummy1 : 31;
303} reg_intr_vect_rw_xmask_ctrl;
304#define REG_RD_ADDR_intr_vect_rw_xmask_ctrl 32
305#define REG_WR_ADDR_intr_vect_rw_xmask_ctrl 32
306
307/* Register r_nmi, scope intr_vect, type r */
308typedef struct {
309 unsigned int watchdog0 : 1;
310 unsigned int watchdog1 : 1;
311 unsigned int dummy1 : 30;
312} reg_intr_vect_r_nmi;
313#define REG_RD_ADDR_intr_vect_r_nmi 64
314
315/* Register r_guru, scope intr_vect, type r */
316typedef struct {
317 unsigned int jtag : 1;
318 unsigned int dummy1 : 31;
319} reg_intr_vect_r_guru;
320#define REG_RD_ADDR_intr_vect_r_guru 68
321
322
323/* Register rw_ipi, scope intr_vect, type rw */
324typedef struct
325{
326 unsigned int vector;
327} reg_intr_vect_rw_ipi;
328#define REG_RD_ADDR_intr_vect_rw_ipi 72
329#define REG_WR_ADDR_intr_vect_rw_ipi 72
330
331/* Constants */
332enum {
333 regk_intr_vect_no = 0x00000000,
334 regk_intr_vect_rw_mask0_default = 0x00000000,
335 regk_intr_vect_rw_mask1_default = 0x00000000,
336 regk_intr_vect_rw_xmask0_default = 0x00000000,
337 regk_intr_vect_rw_xmask1_default = 0x00000000,
338 regk_intr_vect_rw_xmask_ctrl_default = 0x00000000,
339 regk_intr_vect_yes = 0x00000001
340};
341#endif /* __intr_vect_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_reg_space_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_reg_space_asm.h
new file mode 100644
index 000000000000..d75a74e90458
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_reg_space_asm.h
@@ -0,0 +1,31 @@
1/* Autogenerated Changes here will be lost!
2 * generated by ./gen_sw.pl Wed Feb 14 09:27:48 2007 iop_sw.cfg
3 */
4#define iop_version 0
5#define iop_fifo_in_extra 64
6#define iop_fifo_out_extra 128
7#define iop_trigger_grp0 192
8#define iop_trigger_grp1 256
9#define iop_trigger_grp2 320
10#define iop_trigger_grp3 384
11#define iop_trigger_grp4 448
12#define iop_trigger_grp5 512
13#define iop_trigger_grp6 576
14#define iop_trigger_grp7 640
15#define iop_crc_par 768
16#define iop_dmc_in 896
17#define iop_dmc_out 1024
18#define iop_fifo_in 1152
19#define iop_fifo_out 1280
20#define iop_scrc_in 1408
21#define iop_scrc_out 1536
22#define iop_timer_grp0 1664
23#define iop_timer_grp1 1792
24#define iop_sap_in 2048
25#define iop_sap_out 2304
26#define iop_spu 2560
27#define iop_sw_cfg 2816
28#define iop_sw_cpu 3072
29#define iop_sw_mpu 3328
30#define iop_sw_spu 3584
31#define iop_mpu 4096
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sap_in_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sap_in_defs_asm.h
new file mode 100644
index 000000000000..7f90b5a0460d
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sap_in_defs_asm.h
@@ -0,0 +1,109 @@
1#ifndef __iop_sap_in_defs_asm_h
2#define __iop_sap_in_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_sap_in.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile iop_sap_in_defs_asm.h iop_sap_in.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53#define STRIDE_iop_sap_in_rw_bus_byte 4
54/* Register rw_bus_byte, scope iop_sap_in, type rw */
55#define reg_iop_sap_in_rw_bus_byte___sync_sel___lsb 0
56#define reg_iop_sap_in_rw_bus_byte___sync_sel___width 2
57#define reg_iop_sap_in_rw_bus_byte___sync_ext_src___lsb 2
58#define reg_iop_sap_in_rw_bus_byte___sync_ext_src___width 3
59#define reg_iop_sap_in_rw_bus_byte___sync_edge___lsb 5
60#define reg_iop_sap_in_rw_bus_byte___sync_edge___width 2
61#define reg_iop_sap_in_rw_bus_byte___delay___lsb 7
62#define reg_iop_sap_in_rw_bus_byte___delay___width 2
63#define reg_iop_sap_in_rw_bus_byte_offset 0
64
65#define STRIDE_iop_sap_in_rw_gio 4
66/* Register rw_gio, scope iop_sap_in, type rw */
67#define reg_iop_sap_in_rw_gio___sync_sel___lsb 0
68#define reg_iop_sap_in_rw_gio___sync_sel___width 2
69#define reg_iop_sap_in_rw_gio___sync_ext_src___lsb 2
70#define reg_iop_sap_in_rw_gio___sync_ext_src___width 3
71#define reg_iop_sap_in_rw_gio___sync_edge___lsb 5
72#define reg_iop_sap_in_rw_gio___sync_edge___width 2
73#define reg_iop_sap_in_rw_gio___delay___lsb 7
74#define reg_iop_sap_in_rw_gio___delay___width 2
75#define reg_iop_sap_in_rw_gio___logic___lsb 9
76#define reg_iop_sap_in_rw_gio___logic___width 2
77#define reg_iop_sap_in_rw_gio_offset 16
78
79
80/* Constants */
81#define regk_iop_sap_in_and 0x00000002
82#define regk_iop_sap_in_ext_clk200 0x00000003
83#define regk_iop_sap_in_gio0 0x00000000
84#define regk_iop_sap_in_gio12 0x00000003
85#define regk_iop_sap_in_gio16 0x00000004
86#define regk_iop_sap_in_gio20 0x00000005
87#define regk_iop_sap_in_gio24 0x00000006
88#define regk_iop_sap_in_gio28 0x00000007
89#define regk_iop_sap_in_gio4 0x00000001
90#define regk_iop_sap_in_gio8 0x00000002
91#define regk_iop_sap_in_inv 0x00000001
92#define regk_iop_sap_in_neg 0x00000002
93#define regk_iop_sap_in_no 0x00000000
94#define regk_iop_sap_in_no_del_ext_clk200 0x00000002
95#define regk_iop_sap_in_none 0x00000000
96#define regk_iop_sap_in_one 0x00000001
97#define regk_iop_sap_in_or 0x00000003
98#define regk_iop_sap_in_pos 0x00000001
99#define regk_iop_sap_in_pos_neg 0x00000003
100#define regk_iop_sap_in_rw_bus_byte_default 0x00000000
101#define regk_iop_sap_in_rw_bus_byte_size 0x00000004
102#define regk_iop_sap_in_rw_gio_default 0x00000000
103#define regk_iop_sap_in_rw_gio_size 0x00000020
104#define regk_iop_sap_in_timer_grp0_tmr3 0x00000000
105#define regk_iop_sap_in_timer_grp1_tmr3 0x00000001
106#define regk_iop_sap_in_tmr_clk200 0x00000001
107#define regk_iop_sap_in_two 0x00000002
108#define regk_iop_sap_in_two_clk200 0x00000000
109#endif /* __iop_sap_in_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sap_out_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sap_out_defs_asm.h
new file mode 100644
index 000000000000..399bd656406b
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sap_out_defs_asm.h
@@ -0,0 +1,276 @@
1#ifndef __iop_sap_out_defs_asm_h
2#define __iop_sap_out_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_sap_out.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile iop_sap_out_defs_asm.h iop_sap_out.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53/* Register rw_gen_gated, scope iop_sap_out, type rw */
54#define reg_iop_sap_out_rw_gen_gated___clk0_src___lsb 0
55#define reg_iop_sap_out_rw_gen_gated___clk0_src___width 2
56#define reg_iop_sap_out_rw_gen_gated___clk0_gate_src___lsb 2
57#define reg_iop_sap_out_rw_gen_gated___clk0_gate_src___width 2
58#define reg_iop_sap_out_rw_gen_gated___clk0_force_src___lsb 4
59#define reg_iop_sap_out_rw_gen_gated___clk0_force_src___width 3
60#define reg_iop_sap_out_rw_gen_gated___clk1_src___lsb 7
61#define reg_iop_sap_out_rw_gen_gated___clk1_src___width 2
62#define reg_iop_sap_out_rw_gen_gated___clk1_gate_src___lsb 9
63#define reg_iop_sap_out_rw_gen_gated___clk1_gate_src___width 2
64#define reg_iop_sap_out_rw_gen_gated___clk1_force_src___lsb 11
65#define reg_iop_sap_out_rw_gen_gated___clk1_force_src___width 3
66#define reg_iop_sap_out_rw_gen_gated_offset 0
67
68/* Register rw_bus, scope iop_sap_out, type rw */
69#define reg_iop_sap_out_rw_bus___byte0_clk_sel___lsb 0
70#define reg_iop_sap_out_rw_bus___byte0_clk_sel___width 2
71#define reg_iop_sap_out_rw_bus___byte0_clk_ext___lsb 2
72#define reg_iop_sap_out_rw_bus___byte0_clk_ext___width 2
73#define reg_iop_sap_out_rw_bus___byte0_gated_clk___lsb 4
74#define reg_iop_sap_out_rw_bus___byte0_gated_clk___width 1
75#define reg_iop_sap_out_rw_bus___byte0_gated_clk___bit 4
76#define reg_iop_sap_out_rw_bus___byte0_clk_inv___lsb 5
77#define reg_iop_sap_out_rw_bus___byte0_clk_inv___width 1
78#define reg_iop_sap_out_rw_bus___byte0_clk_inv___bit 5
79#define reg_iop_sap_out_rw_bus___byte0_delay___lsb 6
80#define reg_iop_sap_out_rw_bus___byte0_delay___width 1
81#define reg_iop_sap_out_rw_bus___byte0_delay___bit 6
82#define reg_iop_sap_out_rw_bus___byte1_clk_sel___lsb 7
83#define reg_iop_sap_out_rw_bus___byte1_clk_sel___width 2
84#define reg_iop_sap_out_rw_bus___byte1_clk_ext___lsb 9
85#define reg_iop_sap_out_rw_bus___byte1_clk_ext___width 2
86#define reg_iop_sap_out_rw_bus___byte1_gated_clk___lsb 11
87#define reg_iop_sap_out_rw_bus___byte1_gated_clk___width 1
88#define reg_iop_sap_out_rw_bus___byte1_gated_clk___bit 11
89#define reg_iop_sap_out_rw_bus___byte1_clk_inv___lsb 12
90#define reg_iop_sap_out_rw_bus___byte1_clk_inv___width 1
91#define reg_iop_sap_out_rw_bus___byte1_clk_inv___bit 12
92#define reg_iop_sap_out_rw_bus___byte1_delay___lsb 13
93#define reg_iop_sap_out_rw_bus___byte1_delay___width 1
94#define reg_iop_sap_out_rw_bus___byte1_delay___bit 13
95#define reg_iop_sap_out_rw_bus___byte2_clk_sel___lsb 14
96#define reg_iop_sap_out_rw_bus___byte2_clk_sel___width 2
97#define reg_iop_sap_out_rw_bus___byte2_clk_ext___lsb 16
98#define reg_iop_sap_out_rw_bus___byte2_clk_ext___width 2
99#define reg_iop_sap_out_rw_bus___byte2_gated_clk___lsb 18
100#define reg_iop_sap_out_rw_bus___byte2_gated_clk___width 1
101#define reg_iop_sap_out_rw_bus___byte2_gated_clk___bit 18
102#define reg_iop_sap_out_rw_bus___byte2_clk_inv___lsb 19
103#define reg_iop_sap_out_rw_bus___byte2_clk_inv___width 1
104#define reg_iop_sap_out_rw_bus___byte2_clk_inv___bit 19
105#define reg_iop_sap_out_rw_bus___byte2_delay___lsb 20
106#define reg_iop_sap_out_rw_bus___byte2_delay___width 1
107#define reg_iop_sap_out_rw_bus___byte2_delay___bit 20
108#define reg_iop_sap_out_rw_bus___byte3_clk_sel___lsb 21
109#define reg_iop_sap_out_rw_bus___byte3_clk_sel___width 2
110#define reg_iop_sap_out_rw_bus___byte3_clk_ext___lsb 23
111#define reg_iop_sap_out_rw_bus___byte3_clk_ext___width 2
112#define reg_iop_sap_out_rw_bus___byte3_gated_clk___lsb 25
113#define reg_iop_sap_out_rw_bus___byte3_gated_clk___width 1
114#define reg_iop_sap_out_rw_bus___byte3_gated_clk___bit 25
115#define reg_iop_sap_out_rw_bus___byte3_clk_inv___lsb 26
116#define reg_iop_sap_out_rw_bus___byte3_clk_inv___width 1
117#define reg_iop_sap_out_rw_bus___byte3_clk_inv___bit 26
118#define reg_iop_sap_out_rw_bus___byte3_delay___lsb 27
119#define reg_iop_sap_out_rw_bus___byte3_delay___width 1
120#define reg_iop_sap_out_rw_bus___byte3_delay___bit 27
121#define reg_iop_sap_out_rw_bus_offset 4
122
123/* Register rw_bus_lo_oe, scope iop_sap_out, type rw */
124#define reg_iop_sap_out_rw_bus_lo_oe___byte0_clk_sel___lsb 0
125#define reg_iop_sap_out_rw_bus_lo_oe___byte0_clk_sel___width 2
126#define reg_iop_sap_out_rw_bus_lo_oe___byte0_clk_ext___lsb 2
127#define reg_iop_sap_out_rw_bus_lo_oe___byte0_clk_ext___width 2
128#define reg_iop_sap_out_rw_bus_lo_oe___byte0_gated_clk___lsb 4
129#define reg_iop_sap_out_rw_bus_lo_oe___byte0_gated_clk___width 1
130#define reg_iop_sap_out_rw_bus_lo_oe___byte0_gated_clk___bit 4
131#define reg_iop_sap_out_rw_bus_lo_oe___byte0_clk_inv___lsb 5
132#define reg_iop_sap_out_rw_bus_lo_oe___byte0_clk_inv___width 1
133#define reg_iop_sap_out_rw_bus_lo_oe___byte0_clk_inv___bit 5
134#define reg_iop_sap_out_rw_bus_lo_oe___byte0_delay___lsb 6
135#define reg_iop_sap_out_rw_bus_lo_oe___byte0_delay___width 1
136#define reg_iop_sap_out_rw_bus_lo_oe___byte0_delay___bit 6
137#define reg_iop_sap_out_rw_bus_lo_oe___byte0_logic___lsb 7
138#define reg_iop_sap_out_rw_bus_lo_oe___byte0_logic___width 2
139#define reg_iop_sap_out_rw_bus_lo_oe___byte0_logic_src___lsb 9
140#define reg_iop_sap_out_rw_bus_lo_oe___byte0_logic_src___width 2
141#define reg_iop_sap_out_rw_bus_lo_oe___byte1_clk_sel___lsb 11
142#define reg_iop_sap_out_rw_bus_lo_oe___byte1_clk_sel___width 2
143#define reg_iop_sap_out_rw_bus_lo_oe___byte1_clk_ext___lsb 13
144#define reg_iop_sap_out_rw_bus_lo_oe___byte1_clk_ext___width 2
145#define reg_iop_sap_out_rw_bus_lo_oe___byte1_gated_clk___lsb 15
146#define reg_iop_sap_out_rw_bus_lo_oe___byte1_gated_clk___width 1
147#define reg_iop_sap_out_rw_bus_lo_oe___byte1_gated_clk___bit 15
148#define reg_iop_sap_out_rw_bus_lo_oe___byte1_clk_inv___lsb 16
149#define reg_iop_sap_out_rw_bus_lo_oe___byte1_clk_inv___width 1
150#define reg_iop_sap_out_rw_bus_lo_oe___byte1_clk_inv___bit 16
151#define reg_iop_sap_out_rw_bus_lo_oe___byte1_delay___lsb 17
152#define reg_iop_sap_out_rw_bus_lo_oe___byte1_delay___width 1
153#define reg_iop_sap_out_rw_bus_lo_oe___byte1_delay___bit 17
154#define reg_iop_sap_out_rw_bus_lo_oe___byte1_logic___lsb 18
155#define reg_iop_sap_out_rw_bus_lo_oe___byte1_logic___width 2
156#define reg_iop_sap_out_rw_bus_lo_oe___byte1_logic_src___lsb 20
157#define reg_iop_sap_out_rw_bus_lo_oe___byte1_logic_src___width 2
158#define reg_iop_sap_out_rw_bus_lo_oe_offset 8
159
160/* Register rw_bus_hi_oe, scope iop_sap_out, type rw */
161#define reg_iop_sap_out_rw_bus_hi_oe___byte2_clk_sel___lsb 0
162#define reg_iop_sap_out_rw_bus_hi_oe___byte2_clk_sel___width 2
163#define reg_iop_sap_out_rw_bus_hi_oe___byte2_clk_ext___lsb 2
164#define reg_iop_sap_out_rw_bus_hi_oe___byte2_clk_ext___width 2
165#define reg_iop_sap_out_rw_bus_hi_oe___byte2_gated_clk___lsb 4
166#define reg_iop_sap_out_rw_bus_hi_oe___byte2_gated_clk___width 1
167#define reg_iop_sap_out_rw_bus_hi_oe___byte2_gated_clk___bit 4
168#define reg_iop_sap_out_rw_bus_hi_oe___byte2_clk_inv___lsb 5
169#define reg_iop_sap_out_rw_bus_hi_oe___byte2_clk_inv___width 1
170#define reg_iop_sap_out_rw_bus_hi_oe___byte2_clk_inv___bit 5
171#define reg_iop_sap_out_rw_bus_hi_oe___byte2_delay___lsb 6
172#define reg_iop_sap_out_rw_bus_hi_oe___byte2_delay___width 1
173#define reg_iop_sap_out_rw_bus_hi_oe___byte2_delay___bit 6
174#define reg_iop_sap_out_rw_bus_hi_oe___byte2_logic___lsb 7
175#define reg_iop_sap_out_rw_bus_hi_oe___byte2_logic___width 2
176#define reg_iop_sap_out_rw_bus_hi_oe___byte2_logic_src___lsb 9
177#define reg_iop_sap_out_rw_bus_hi_oe___byte2_logic_src___width 2
178#define reg_iop_sap_out_rw_bus_hi_oe___byte3_clk_sel___lsb 11
179#define reg_iop_sap_out_rw_bus_hi_oe___byte3_clk_sel___width 2
180#define reg_iop_sap_out_rw_bus_hi_oe___byte3_clk_ext___lsb 13
181#define reg_iop_sap_out_rw_bus_hi_oe___byte3_clk_ext___width 2
182#define reg_iop_sap_out_rw_bus_hi_oe___byte3_gated_clk___lsb 15
183#define reg_iop_sap_out_rw_bus_hi_oe___byte3_gated_clk___width 1
184#define reg_iop_sap_out_rw_bus_hi_oe___byte3_gated_clk___bit 15
185#define reg_iop_sap_out_rw_bus_hi_oe___byte3_clk_inv___lsb 16
186#define reg_iop_sap_out_rw_bus_hi_oe___byte3_clk_inv___width 1
187#define reg_iop_sap_out_rw_bus_hi_oe___byte3_clk_inv___bit 16
188#define reg_iop_sap_out_rw_bus_hi_oe___byte3_delay___lsb 17
189#define reg_iop_sap_out_rw_bus_hi_oe___byte3_delay___width 1
190#define reg_iop_sap_out_rw_bus_hi_oe___byte3_delay___bit 17
191#define reg_iop_sap_out_rw_bus_hi_oe___byte3_logic___lsb 18
192#define reg_iop_sap_out_rw_bus_hi_oe___byte3_logic___width 2
193#define reg_iop_sap_out_rw_bus_hi_oe___byte3_logic_src___lsb 20
194#define reg_iop_sap_out_rw_bus_hi_oe___byte3_logic_src___width 2
195#define reg_iop_sap_out_rw_bus_hi_oe_offset 12
196
197#define STRIDE_iop_sap_out_rw_gio 4
198/* Register rw_gio, scope iop_sap_out, type rw */
199#define reg_iop_sap_out_rw_gio___out_clk_sel___lsb 0
200#define reg_iop_sap_out_rw_gio___out_clk_sel___width 3
201#define reg_iop_sap_out_rw_gio___out_clk_ext___lsb 3
202#define reg_iop_sap_out_rw_gio___out_clk_ext___width 2
203#define reg_iop_sap_out_rw_gio___out_gated_clk___lsb 5
204#define reg_iop_sap_out_rw_gio___out_gated_clk___width 1
205#define reg_iop_sap_out_rw_gio___out_gated_clk___bit 5
206#define reg_iop_sap_out_rw_gio___out_clk_inv___lsb 6
207#define reg_iop_sap_out_rw_gio___out_clk_inv___width 1
208#define reg_iop_sap_out_rw_gio___out_clk_inv___bit 6
209#define reg_iop_sap_out_rw_gio___out_delay___lsb 7
210#define reg_iop_sap_out_rw_gio___out_delay___width 1
211#define reg_iop_sap_out_rw_gio___out_delay___bit 7
212#define reg_iop_sap_out_rw_gio___out_logic___lsb 8
213#define reg_iop_sap_out_rw_gio___out_logic___width 2
214#define reg_iop_sap_out_rw_gio___out_logic_src___lsb 10
215#define reg_iop_sap_out_rw_gio___out_logic_src___width 2
216#define reg_iop_sap_out_rw_gio___oe_clk_sel___lsb 12
217#define reg_iop_sap_out_rw_gio___oe_clk_sel___width 3
218#define reg_iop_sap_out_rw_gio___oe_clk_ext___lsb 15
219#define reg_iop_sap_out_rw_gio___oe_clk_ext___width 2
220#define reg_iop_sap_out_rw_gio___oe_gated_clk___lsb 17
221#define reg_iop_sap_out_rw_gio___oe_gated_clk___width 1
222#define reg_iop_sap_out_rw_gio___oe_gated_clk___bit 17
223#define reg_iop_sap_out_rw_gio___oe_clk_inv___lsb 18
224#define reg_iop_sap_out_rw_gio___oe_clk_inv___width 1
225#define reg_iop_sap_out_rw_gio___oe_clk_inv___bit 18
226#define reg_iop_sap_out_rw_gio___oe_delay___lsb 19
227#define reg_iop_sap_out_rw_gio___oe_delay___width 1
228#define reg_iop_sap_out_rw_gio___oe_delay___bit 19
229#define reg_iop_sap_out_rw_gio___oe_logic___lsb 20
230#define reg_iop_sap_out_rw_gio___oe_logic___width 2
231#define reg_iop_sap_out_rw_gio___oe_logic_src___lsb 22
232#define reg_iop_sap_out_rw_gio___oe_logic_src___width 2
233#define reg_iop_sap_out_rw_gio_offset 16
234
235
236/* Constants */
237#define regk_iop_sap_out_always 0x00000001
238#define regk_iop_sap_out_and 0x00000002
239#define regk_iop_sap_out_clk0 0x00000000
240#define regk_iop_sap_out_clk1 0x00000001
241#define regk_iop_sap_out_clk12 0x00000004
242#define regk_iop_sap_out_clk200 0x00000000
243#define regk_iop_sap_out_ext 0x00000002
244#define regk_iop_sap_out_gated 0x00000003
245#define regk_iop_sap_out_gio0 0x00000000
246#define regk_iop_sap_out_gio1 0x00000000
247#define regk_iop_sap_out_gio16 0x00000002
248#define regk_iop_sap_out_gio17 0x00000002
249#define regk_iop_sap_out_gio24 0x00000003
250#define regk_iop_sap_out_gio25 0x00000003
251#define regk_iop_sap_out_gio8 0x00000001
252#define regk_iop_sap_out_gio9 0x00000001
253#define regk_iop_sap_out_gio_out10 0x00000005
254#define regk_iop_sap_out_gio_out18 0x00000006
255#define regk_iop_sap_out_gio_out2 0x00000004
256#define regk_iop_sap_out_gio_out26 0x00000007
257#define regk_iop_sap_out_inv 0x00000001
258#define regk_iop_sap_out_nand 0x00000003
259#define regk_iop_sap_out_no 0x00000000
260#define regk_iop_sap_out_none 0x00000000
261#define regk_iop_sap_out_one 0x00000001
262#define regk_iop_sap_out_rw_bus_default 0x00000000
263#define regk_iop_sap_out_rw_bus_hi_oe_default 0x00000000
264#define regk_iop_sap_out_rw_bus_lo_oe_default 0x00000000
265#define regk_iop_sap_out_rw_gen_gated_default 0x00000000
266#define regk_iop_sap_out_rw_gio_default 0x00000000
267#define regk_iop_sap_out_rw_gio_size 0x00000020
268#define regk_iop_sap_out_spu_gio6 0x00000002
269#define regk_iop_sap_out_spu_gio7 0x00000003
270#define regk_iop_sap_out_timer_grp0_tmr2 0x00000000
271#define regk_iop_sap_out_timer_grp0_tmr3 0x00000001
272#define regk_iop_sap_out_timer_grp1_tmr2 0x00000002
273#define regk_iop_sap_out_timer_grp1_tmr3 0x00000003
274#define regk_iop_sap_out_tmr200 0x00000001
275#define regk_iop_sap_out_yes 0x00000001
276#endif /* __iop_sap_out_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_cfg_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_cfg_defs_asm.h
new file mode 100644
index 000000000000..3b3949b51a66
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_cfg_defs_asm.h
@@ -0,0 +1,739 @@
1#ifndef __iop_sw_cfg_defs_asm_h
2#define __iop_sw_cfg_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_sw_cfg.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile iop_sw_cfg_defs_asm.h iop_sw_cfg.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53/* Register rw_crc_par_owner, scope iop_sw_cfg, type rw */
54#define reg_iop_sw_cfg_rw_crc_par_owner___cfg___lsb 0
55#define reg_iop_sw_cfg_rw_crc_par_owner___cfg___width 2
56#define reg_iop_sw_cfg_rw_crc_par_owner_offset 0
57
58/* Register rw_dmc_in_owner, scope iop_sw_cfg, type rw */
59#define reg_iop_sw_cfg_rw_dmc_in_owner___cfg___lsb 0
60#define reg_iop_sw_cfg_rw_dmc_in_owner___cfg___width 2
61#define reg_iop_sw_cfg_rw_dmc_in_owner_offset 4
62
63/* Register rw_dmc_out_owner, scope iop_sw_cfg, type rw */
64#define reg_iop_sw_cfg_rw_dmc_out_owner___cfg___lsb 0
65#define reg_iop_sw_cfg_rw_dmc_out_owner___cfg___width 2
66#define reg_iop_sw_cfg_rw_dmc_out_owner_offset 8
67
68/* Register rw_fifo_in_owner, scope iop_sw_cfg, type rw */
69#define reg_iop_sw_cfg_rw_fifo_in_owner___cfg___lsb 0
70#define reg_iop_sw_cfg_rw_fifo_in_owner___cfg___width 2
71#define reg_iop_sw_cfg_rw_fifo_in_owner_offset 12
72
73/* Register rw_fifo_in_extra_owner, scope iop_sw_cfg, type rw */
74#define reg_iop_sw_cfg_rw_fifo_in_extra_owner___cfg___lsb 0
75#define reg_iop_sw_cfg_rw_fifo_in_extra_owner___cfg___width 2
76#define reg_iop_sw_cfg_rw_fifo_in_extra_owner_offset 16
77
78/* Register rw_fifo_out_owner, scope iop_sw_cfg, type rw */
79#define reg_iop_sw_cfg_rw_fifo_out_owner___cfg___lsb 0
80#define reg_iop_sw_cfg_rw_fifo_out_owner___cfg___width 2
81#define reg_iop_sw_cfg_rw_fifo_out_owner_offset 20
82
83/* Register rw_fifo_out_extra_owner, scope iop_sw_cfg, type rw */
84#define reg_iop_sw_cfg_rw_fifo_out_extra_owner___cfg___lsb 0
85#define reg_iop_sw_cfg_rw_fifo_out_extra_owner___cfg___width 2
86#define reg_iop_sw_cfg_rw_fifo_out_extra_owner_offset 24
87
88/* Register rw_sap_in_owner, scope iop_sw_cfg, type rw */
89#define reg_iop_sw_cfg_rw_sap_in_owner___cfg___lsb 0
90#define reg_iop_sw_cfg_rw_sap_in_owner___cfg___width 2
91#define reg_iop_sw_cfg_rw_sap_in_owner_offset 28
92
93/* Register rw_sap_out_owner, scope iop_sw_cfg, type rw */
94#define reg_iop_sw_cfg_rw_sap_out_owner___cfg___lsb 0
95#define reg_iop_sw_cfg_rw_sap_out_owner___cfg___width 2
96#define reg_iop_sw_cfg_rw_sap_out_owner_offset 32
97
98/* Register rw_scrc_in_owner, scope iop_sw_cfg, type rw */
99#define reg_iop_sw_cfg_rw_scrc_in_owner___cfg___lsb 0
100#define reg_iop_sw_cfg_rw_scrc_in_owner___cfg___width 2
101#define reg_iop_sw_cfg_rw_scrc_in_owner_offset 36
102
103/* Register rw_scrc_out_owner, scope iop_sw_cfg, type rw */
104#define reg_iop_sw_cfg_rw_scrc_out_owner___cfg___lsb 0
105#define reg_iop_sw_cfg_rw_scrc_out_owner___cfg___width 2
106#define reg_iop_sw_cfg_rw_scrc_out_owner_offset 40
107
108/* Register rw_spu_owner, scope iop_sw_cfg, type rw */
109#define reg_iop_sw_cfg_rw_spu_owner___cfg___lsb 0
110#define reg_iop_sw_cfg_rw_spu_owner___cfg___width 1
111#define reg_iop_sw_cfg_rw_spu_owner___cfg___bit 0
112#define reg_iop_sw_cfg_rw_spu_owner_offset 44
113
114/* Register rw_timer_grp0_owner, scope iop_sw_cfg, type rw */
115#define reg_iop_sw_cfg_rw_timer_grp0_owner___cfg___lsb 0
116#define reg_iop_sw_cfg_rw_timer_grp0_owner___cfg___width 2
117#define reg_iop_sw_cfg_rw_timer_grp0_owner_offset 48
118
119/* Register rw_timer_grp1_owner, scope iop_sw_cfg, type rw */
120#define reg_iop_sw_cfg_rw_timer_grp1_owner___cfg___lsb 0
121#define reg_iop_sw_cfg_rw_timer_grp1_owner___cfg___width 2
122#define reg_iop_sw_cfg_rw_timer_grp1_owner_offset 52
123
124/* Register rw_trigger_grp0_owner, scope iop_sw_cfg, type rw */
125#define reg_iop_sw_cfg_rw_trigger_grp0_owner___cfg___lsb 0
126#define reg_iop_sw_cfg_rw_trigger_grp0_owner___cfg___width 2
127#define reg_iop_sw_cfg_rw_trigger_grp0_owner_offset 56
128
129/* Register rw_trigger_grp1_owner, scope iop_sw_cfg, type rw */
130#define reg_iop_sw_cfg_rw_trigger_grp1_owner___cfg___lsb 0
131#define reg_iop_sw_cfg_rw_trigger_grp1_owner___cfg___width 2
132#define reg_iop_sw_cfg_rw_trigger_grp1_owner_offset 60
133
134/* Register rw_trigger_grp2_owner, scope iop_sw_cfg, type rw */
135#define reg_iop_sw_cfg_rw_trigger_grp2_owner___cfg___lsb 0
136#define reg_iop_sw_cfg_rw_trigger_grp2_owner___cfg___width 2
137#define reg_iop_sw_cfg_rw_trigger_grp2_owner_offset 64
138
139/* Register rw_trigger_grp3_owner, scope iop_sw_cfg, type rw */
140#define reg_iop_sw_cfg_rw_trigger_grp3_owner___cfg___lsb 0
141#define reg_iop_sw_cfg_rw_trigger_grp3_owner___cfg___width 2
142#define reg_iop_sw_cfg_rw_trigger_grp3_owner_offset 68
143
144/* Register rw_trigger_grp4_owner, scope iop_sw_cfg, type rw */
145#define reg_iop_sw_cfg_rw_trigger_grp4_owner___cfg___lsb 0
146#define reg_iop_sw_cfg_rw_trigger_grp4_owner___cfg___width 2
147#define reg_iop_sw_cfg_rw_trigger_grp4_owner_offset 72
148
149/* Register rw_trigger_grp5_owner, scope iop_sw_cfg, type rw */
150#define reg_iop_sw_cfg_rw_trigger_grp5_owner___cfg___lsb 0
151#define reg_iop_sw_cfg_rw_trigger_grp5_owner___cfg___width 2
152#define reg_iop_sw_cfg_rw_trigger_grp5_owner_offset 76
153
154/* Register rw_trigger_grp6_owner, scope iop_sw_cfg, type rw */
155#define reg_iop_sw_cfg_rw_trigger_grp6_owner___cfg___lsb 0
156#define reg_iop_sw_cfg_rw_trigger_grp6_owner___cfg___width 2
157#define reg_iop_sw_cfg_rw_trigger_grp6_owner_offset 80
158
159/* Register rw_trigger_grp7_owner, scope iop_sw_cfg, type rw */
160#define reg_iop_sw_cfg_rw_trigger_grp7_owner___cfg___lsb 0
161#define reg_iop_sw_cfg_rw_trigger_grp7_owner___cfg___width 2
162#define reg_iop_sw_cfg_rw_trigger_grp7_owner_offset 84
163
164/* Register rw_bus_mask, scope iop_sw_cfg, type rw */
165#define reg_iop_sw_cfg_rw_bus_mask___byte0___lsb 0
166#define reg_iop_sw_cfg_rw_bus_mask___byte0___width 8
167#define reg_iop_sw_cfg_rw_bus_mask___byte1___lsb 8
168#define reg_iop_sw_cfg_rw_bus_mask___byte1___width 8
169#define reg_iop_sw_cfg_rw_bus_mask___byte2___lsb 16
170#define reg_iop_sw_cfg_rw_bus_mask___byte2___width 8
171#define reg_iop_sw_cfg_rw_bus_mask___byte3___lsb 24
172#define reg_iop_sw_cfg_rw_bus_mask___byte3___width 8
173#define reg_iop_sw_cfg_rw_bus_mask_offset 88
174
175/* Register rw_bus_oe_mask, scope iop_sw_cfg, type rw */
176#define reg_iop_sw_cfg_rw_bus_oe_mask___byte0___lsb 0
177#define reg_iop_sw_cfg_rw_bus_oe_mask___byte0___width 1
178#define reg_iop_sw_cfg_rw_bus_oe_mask___byte0___bit 0
179#define reg_iop_sw_cfg_rw_bus_oe_mask___byte1___lsb 1
180#define reg_iop_sw_cfg_rw_bus_oe_mask___byte1___width 1
181#define reg_iop_sw_cfg_rw_bus_oe_mask___byte1___bit 1
182#define reg_iop_sw_cfg_rw_bus_oe_mask___byte2___lsb 2
183#define reg_iop_sw_cfg_rw_bus_oe_mask___byte2___width 1
184#define reg_iop_sw_cfg_rw_bus_oe_mask___byte2___bit 2
185#define reg_iop_sw_cfg_rw_bus_oe_mask___byte3___lsb 3
186#define reg_iop_sw_cfg_rw_bus_oe_mask___byte3___width 1
187#define reg_iop_sw_cfg_rw_bus_oe_mask___byte3___bit 3
188#define reg_iop_sw_cfg_rw_bus_oe_mask_offset 92
189
190/* Register rw_gio_mask, scope iop_sw_cfg, type rw */
191#define reg_iop_sw_cfg_rw_gio_mask___val___lsb 0
192#define reg_iop_sw_cfg_rw_gio_mask___val___width 32
193#define reg_iop_sw_cfg_rw_gio_mask_offset 96
194
195/* Register rw_gio_oe_mask, scope iop_sw_cfg, type rw */
196#define reg_iop_sw_cfg_rw_gio_oe_mask___val___lsb 0
197#define reg_iop_sw_cfg_rw_gio_oe_mask___val___width 32
198#define reg_iop_sw_cfg_rw_gio_oe_mask_offset 100
199
200/* Register rw_pinmapping, scope iop_sw_cfg, type rw */
201#define reg_iop_sw_cfg_rw_pinmapping___bus_byte0___lsb 0
202#define reg_iop_sw_cfg_rw_pinmapping___bus_byte0___width 2
203#define reg_iop_sw_cfg_rw_pinmapping___bus_byte1___lsb 2
204#define reg_iop_sw_cfg_rw_pinmapping___bus_byte1___width 2
205#define reg_iop_sw_cfg_rw_pinmapping___bus_byte2___lsb 4
206#define reg_iop_sw_cfg_rw_pinmapping___bus_byte2___width 2
207#define reg_iop_sw_cfg_rw_pinmapping___bus_byte3___lsb 6
208#define reg_iop_sw_cfg_rw_pinmapping___bus_byte3___width 2
209#define reg_iop_sw_cfg_rw_pinmapping___gio3_0___lsb 8
210#define reg_iop_sw_cfg_rw_pinmapping___gio3_0___width 2
211#define reg_iop_sw_cfg_rw_pinmapping___gio7_4___lsb 10
212#define reg_iop_sw_cfg_rw_pinmapping___gio7_4___width 2
213#define reg_iop_sw_cfg_rw_pinmapping___gio11_8___lsb 12
214#define reg_iop_sw_cfg_rw_pinmapping___gio11_8___width 2
215#define reg_iop_sw_cfg_rw_pinmapping___gio15_12___lsb 14
216#define reg_iop_sw_cfg_rw_pinmapping___gio15_12___width 2
217#define reg_iop_sw_cfg_rw_pinmapping___gio19_16___lsb 16
218#define reg_iop_sw_cfg_rw_pinmapping___gio19_16___width 2
219#define reg_iop_sw_cfg_rw_pinmapping___gio23_20___lsb 18
220#define reg_iop_sw_cfg_rw_pinmapping___gio23_20___width 2
221#define reg_iop_sw_cfg_rw_pinmapping___gio27_24___lsb 20
222#define reg_iop_sw_cfg_rw_pinmapping___gio27_24___width 2
223#define reg_iop_sw_cfg_rw_pinmapping___gio31_28___lsb 22
224#define reg_iop_sw_cfg_rw_pinmapping___gio31_28___width 2
225#define reg_iop_sw_cfg_rw_pinmapping_offset 104
226
227/* Register rw_bus_out_cfg, scope iop_sw_cfg, type rw */
228#define reg_iop_sw_cfg_rw_bus_out_cfg___bus_lo___lsb 0
229#define reg_iop_sw_cfg_rw_bus_out_cfg___bus_lo___width 2
230#define reg_iop_sw_cfg_rw_bus_out_cfg___bus_hi___lsb 2
231#define reg_iop_sw_cfg_rw_bus_out_cfg___bus_hi___width 2
232#define reg_iop_sw_cfg_rw_bus_out_cfg___bus_lo_oe___lsb 4
233#define reg_iop_sw_cfg_rw_bus_out_cfg___bus_lo_oe___width 2
234#define reg_iop_sw_cfg_rw_bus_out_cfg___bus_hi_oe___lsb 6
235#define reg_iop_sw_cfg_rw_bus_out_cfg___bus_hi_oe___width 2
236#define reg_iop_sw_cfg_rw_bus_out_cfg_offset 108
237
238/* Register rw_gio_out_grp0_cfg, scope iop_sw_cfg, type rw */
239#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio0___lsb 0
240#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio0___width 3
241#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio0_oe___lsb 3
242#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio0_oe___width 1
243#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio0_oe___bit 3
244#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio1___lsb 4
245#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio1___width 3
246#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio1_oe___lsb 7
247#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio1_oe___width 1
248#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio1_oe___bit 7
249#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio2___lsb 8
250#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio2___width 3
251#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio2_oe___lsb 11
252#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio2_oe___width 1
253#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio2_oe___bit 11
254#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio3___lsb 12
255#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio3___width 3
256#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio3_oe___lsb 15
257#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio3_oe___width 1
258#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio3_oe___bit 15
259#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg_offset 112
260
261/* Register rw_gio_out_grp1_cfg, scope iop_sw_cfg, type rw */
262#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio4___lsb 0
263#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio4___width 3
264#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio4_oe___lsb 3
265#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio4_oe___width 1
266#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio4_oe___bit 3
267#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio5___lsb 4
268#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio5___width 3
269#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio5_oe___lsb 7
270#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio5_oe___width 1
271#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio5_oe___bit 7
272#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio6___lsb 8
273#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio6___width 3
274#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio6_oe___lsb 11
275#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio6_oe___width 1
276#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio6_oe___bit 11
277#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio7___lsb 12
278#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio7___width 3
279#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio7_oe___lsb 15
280#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio7_oe___width 1
281#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio7_oe___bit 15
282#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg_offset 116
283
284/* Register rw_gio_out_grp2_cfg, scope iop_sw_cfg, type rw */
285#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio8___lsb 0
286#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio8___width 3
287#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio8_oe___lsb 3
288#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio8_oe___width 1
289#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio8_oe___bit 3
290#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio9___lsb 4
291#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio9___width 3
292#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio9_oe___lsb 7
293#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio9_oe___width 1
294#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio9_oe___bit 7
295#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio10___lsb 8
296#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio10___width 3
297#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio10_oe___lsb 11
298#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio10_oe___width 1
299#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio10_oe___bit 11
300#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio11___lsb 12
301#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio11___width 3
302#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio11_oe___lsb 15
303#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio11_oe___width 1
304#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio11_oe___bit 15
305#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg_offset 120
306
307/* Register rw_gio_out_grp3_cfg, scope iop_sw_cfg, type rw */
308#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio12___lsb 0
309#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio12___width 3
310#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio12_oe___lsb 3
311#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio12_oe___width 1
312#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio12_oe___bit 3
313#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio13___lsb 4
314#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio13___width 3
315#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio13_oe___lsb 7
316#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio13_oe___width 1
317#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio13_oe___bit 7
318#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio14___lsb 8
319#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio14___width 3
320#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio14_oe___lsb 11
321#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio14_oe___width 1
322#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio14_oe___bit 11
323#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio15___lsb 12
324#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio15___width 3
325#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio15_oe___lsb 15
326#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio15_oe___width 1
327#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio15_oe___bit 15
328#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg_offset 124
329
330/* Register rw_gio_out_grp4_cfg, scope iop_sw_cfg, type rw */
331#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio16___lsb 0
332#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio16___width 3
333#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio16_oe___lsb 3
334#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio16_oe___width 1
335#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio16_oe___bit 3
336#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio17___lsb 4
337#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio17___width 3
338#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio17_oe___lsb 7
339#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio17_oe___width 1
340#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio17_oe___bit 7
341#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio18___lsb 8
342#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio18___width 3
343#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio18_oe___lsb 11
344#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio18_oe___width 1
345#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio18_oe___bit 11
346#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio19___lsb 12
347#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio19___width 3
348#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio19_oe___lsb 15
349#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio19_oe___width 1
350#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio19_oe___bit 15
351#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg_offset 128
352
353/* Register rw_gio_out_grp5_cfg, scope iop_sw_cfg, type rw */
354#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio20___lsb 0
355#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio20___width 3
356#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio20_oe___lsb 3
357#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio20_oe___width 1
358#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio20_oe___bit 3
359#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio21___lsb 4
360#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio21___width 3
361#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio21_oe___lsb 7
362#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio21_oe___width 1
363#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio21_oe___bit 7
364#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio22___lsb 8
365#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio22___width 3
366#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio22_oe___lsb 11
367#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio22_oe___width 1
368#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio22_oe___bit 11
369#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio23___lsb 12
370#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio23___width 3
371#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio23_oe___lsb 15
372#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio23_oe___width 1
373#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio23_oe___bit 15
374#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg_offset 132
375
376/* Register rw_gio_out_grp6_cfg, scope iop_sw_cfg, type rw */
377#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio24___lsb 0
378#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio24___width 3
379#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio24_oe___lsb 3
380#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio24_oe___width 1
381#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio24_oe___bit 3
382#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio25___lsb 4
383#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio25___width 3
384#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio25_oe___lsb 7
385#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio25_oe___width 1
386#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio25_oe___bit 7
387#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio26___lsb 8
388#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio26___width 3
389#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio26_oe___lsb 11
390#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio26_oe___width 1
391#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio26_oe___bit 11
392#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio27___lsb 12
393#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio27___width 3
394#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio27_oe___lsb 15
395#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio27_oe___width 1
396#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio27_oe___bit 15
397#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg_offset 136
398
399/* Register rw_gio_out_grp7_cfg, scope iop_sw_cfg, type rw */
400#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio28___lsb 0
401#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio28___width 3
402#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio28_oe___lsb 3
403#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio28_oe___width 1
404#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio28_oe___bit 3
405#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio29___lsb 4
406#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio29___width 3
407#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio29_oe___lsb 7
408#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio29_oe___width 1
409#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio29_oe___bit 7
410#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio30___lsb 8
411#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio30___width 3
412#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio30_oe___lsb 11
413#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio30_oe___width 1
414#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio30_oe___bit 11
415#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio31___lsb 12
416#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio31___width 3
417#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio31_oe___lsb 15
418#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio31_oe___width 1
419#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio31_oe___bit 15
420#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg_offset 140
421
422/* Register rw_spu_cfg, scope iop_sw_cfg, type rw */
423#define reg_iop_sw_cfg_rw_spu_cfg___bus0_in___lsb 0
424#define reg_iop_sw_cfg_rw_spu_cfg___bus0_in___width 1
425#define reg_iop_sw_cfg_rw_spu_cfg___bus0_in___bit 0
426#define reg_iop_sw_cfg_rw_spu_cfg___bus1_in___lsb 1
427#define reg_iop_sw_cfg_rw_spu_cfg___bus1_in___width 1
428#define reg_iop_sw_cfg_rw_spu_cfg___bus1_in___bit 1
429#define reg_iop_sw_cfg_rw_spu_cfg_offset 144
430
431/* Register rw_timer_grp0_cfg, scope iop_sw_cfg, type rw */
432#define reg_iop_sw_cfg_rw_timer_grp0_cfg___ext_clk___lsb 0
433#define reg_iop_sw_cfg_rw_timer_grp0_cfg___ext_clk___width 3
434#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr0_en___lsb 3
435#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr0_en___width 2
436#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr1_en___lsb 5
437#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr1_en___width 2
438#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr2_en___lsb 7
439#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr2_en___width 2
440#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr3_en___lsb 9
441#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr3_en___width 2
442#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr0_dis___lsb 11
443#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr0_dis___width 2
444#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr1_dis___lsb 13
445#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr1_dis___width 2
446#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr2_dis___lsb 15
447#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr2_dis___width 2
448#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr3_dis___lsb 17
449#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr3_dis___width 2
450#define reg_iop_sw_cfg_rw_timer_grp0_cfg_offset 148
451
452/* Register rw_timer_grp1_cfg, scope iop_sw_cfg, type rw */
453#define reg_iop_sw_cfg_rw_timer_grp1_cfg___ext_clk___lsb 0
454#define reg_iop_sw_cfg_rw_timer_grp1_cfg___ext_clk___width 3
455#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr0_en___lsb 3
456#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr0_en___width 2
457#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr1_en___lsb 5
458#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr1_en___width 2
459#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr2_en___lsb 7
460#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr2_en___width 2
461#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr3_en___lsb 9
462#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr3_en___width 2
463#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr0_dis___lsb 11
464#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr0_dis___width 2
465#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr1_dis___lsb 13
466#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr1_dis___width 2
467#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr2_dis___lsb 15
468#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr2_dis___width 2
469#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr3_dis___lsb 17
470#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr3_dis___width 2
471#define reg_iop_sw_cfg_rw_timer_grp1_cfg_offset 152
472
473/* Register rw_trigger_grps_cfg, scope iop_sw_cfg, type rw */
474#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp0_dis___lsb 0
475#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp0_dis___width 1
476#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp0_dis___bit 0
477#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp0_en___lsb 1
478#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp0_en___width 1
479#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp0_en___bit 1
480#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp1_dis___lsb 2
481#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp1_dis___width 1
482#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp1_dis___bit 2
483#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp1_en___lsb 3
484#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp1_en___width 1
485#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp1_en___bit 3
486#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp2_dis___lsb 4
487#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp2_dis___width 1
488#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp2_dis___bit 4
489#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp2_en___lsb 5
490#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp2_en___width 1
491#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp2_en___bit 5
492#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp3_dis___lsb 6
493#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp3_dis___width 1
494#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp3_dis___bit 6
495#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp3_en___lsb 7
496#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp3_en___width 1
497#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp3_en___bit 7
498#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp4_dis___lsb 8
499#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp4_dis___width 1
500#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp4_dis___bit 8
501#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp4_en___lsb 9
502#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp4_en___width 1
503#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp4_en___bit 9
504#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp5_dis___lsb 10
505#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp5_dis___width 1
506#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp5_dis___bit 10
507#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp5_en___lsb 11
508#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp5_en___width 1
509#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp5_en___bit 11
510#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp6_dis___lsb 12
511#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp6_dis___width 1
512#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp6_dis___bit 12
513#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp6_en___lsb 13
514#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp6_en___width 1
515#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp6_en___bit 13
516#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp7_dis___lsb 14
517#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp7_dis___width 1
518#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp7_dis___bit 14
519#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp7_en___lsb 15
520#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp7_en___width 1
521#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp7_en___bit 15
522#define reg_iop_sw_cfg_rw_trigger_grps_cfg_offset 156
523
524/* Register rw_pdp_cfg, scope iop_sw_cfg, type rw */
525#define reg_iop_sw_cfg_rw_pdp_cfg___out_strb___lsb 0
526#define reg_iop_sw_cfg_rw_pdp_cfg___out_strb___width 4
527#define reg_iop_sw_cfg_rw_pdp_cfg___in_src___lsb 4
528#define reg_iop_sw_cfg_rw_pdp_cfg___in_src___width 2
529#define reg_iop_sw_cfg_rw_pdp_cfg___in_size___lsb 6
530#define reg_iop_sw_cfg_rw_pdp_cfg___in_size___width 3
531#define reg_iop_sw_cfg_rw_pdp_cfg___in_last___lsb 9
532#define reg_iop_sw_cfg_rw_pdp_cfg___in_last___width 2
533#define reg_iop_sw_cfg_rw_pdp_cfg___in_strb___lsb 11
534#define reg_iop_sw_cfg_rw_pdp_cfg___in_strb___width 4
535#define reg_iop_sw_cfg_rw_pdp_cfg_offset 160
536
537/* Register rw_sdp_cfg, scope iop_sw_cfg, type rw */
538#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_out_strb___lsb 0
539#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_out_strb___width 3
540#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in_data___lsb 3
541#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in_data___width 3
542#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in_last___lsb 6
543#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in_last___width 2
544#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in_strb___lsb 8
545#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in_strb___width 3
546#define reg_iop_sw_cfg_rw_sdp_cfg_offset 164
547
548
549/* Constants */
550#define regk_iop_sw_cfg_a 0x00000001
551#define regk_iop_sw_cfg_b 0x00000002
552#define regk_iop_sw_cfg_bus 0x00000000
553#define regk_iop_sw_cfg_bus_rot16 0x00000002
554#define regk_iop_sw_cfg_bus_rot24 0x00000003
555#define regk_iop_sw_cfg_bus_rot8 0x00000001
556#define regk_iop_sw_cfg_clk12 0x00000000
557#define regk_iop_sw_cfg_cpu 0x00000000
558#define regk_iop_sw_cfg_gated_clk0 0x0000000e
559#define regk_iop_sw_cfg_gated_clk1 0x0000000f
560#define regk_iop_sw_cfg_gio0 0x00000004
561#define regk_iop_sw_cfg_gio1 0x00000001
562#define regk_iop_sw_cfg_gio2 0x00000005
563#define regk_iop_sw_cfg_gio3 0x00000002
564#define regk_iop_sw_cfg_gio4 0x00000006
565#define regk_iop_sw_cfg_gio5 0x00000003
566#define regk_iop_sw_cfg_gio6 0x00000007
567#define regk_iop_sw_cfg_gio7 0x00000004
568#define regk_iop_sw_cfg_gio_in18 0x00000002
569#define regk_iop_sw_cfg_gio_in19 0x00000003
570#define regk_iop_sw_cfg_gio_in20 0x00000004
571#define regk_iop_sw_cfg_gio_in21 0x00000005
572#define regk_iop_sw_cfg_gio_in26 0x00000006
573#define regk_iop_sw_cfg_gio_in27 0x00000007
574#define regk_iop_sw_cfg_gio_in4 0x00000000
575#define regk_iop_sw_cfg_gio_in5 0x00000001
576#define regk_iop_sw_cfg_last_timer_grp0_tmr2 0x00000001
577#define regk_iop_sw_cfg_last_timer_grp1_tmr2 0x00000002
578#define regk_iop_sw_cfg_last_timer_grp1_tmr3 0x00000003
579#define regk_iop_sw_cfg_mpu 0x00000001
580#define regk_iop_sw_cfg_none 0x00000000
581#define regk_iop_sw_cfg_pdp_out 0x00000001
582#define regk_iop_sw_cfg_pdp_out_hi 0x00000001
583#define regk_iop_sw_cfg_pdp_out_lo 0x00000000
584#define regk_iop_sw_cfg_rw_bus_mask_default 0x00000000
585#define regk_iop_sw_cfg_rw_bus_oe_mask_default 0x00000000
586#define regk_iop_sw_cfg_rw_bus_out_cfg_default 0x00000000
587#define regk_iop_sw_cfg_rw_crc_par_owner_default 0x00000000
588#define regk_iop_sw_cfg_rw_dmc_in_owner_default 0x00000000
589#define regk_iop_sw_cfg_rw_dmc_out_owner_default 0x00000000
590#define regk_iop_sw_cfg_rw_fifo_in_extra_owner_default 0x00000000
591#define regk_iop_sw_cfg_rw_fifo_in_owner_default 0x00000000
592#define regk_iop_sw_cfg_rw_fifo_out_extra_owner_default 0x00000000
593#define regk_iop_sw_cfg_rw_fifo_out_owner_default 0x00000000
594#define regk_iop_sw_cfg_rw_gio_mask_default 0x00000000
595#define regk_iop_sw_cfg_rw_gio_oe_mask_default 0x00000000
596#define regk_iop_sw_cfg_rw_gio_out_grp0_cfg_default 0x00000000
597#define regk_iop_sw_cfg_rw_gio_out_grp1_cfg_default 0x00000000
598#define regk_iop_sw_cfg_rw_gio_out_grp2_cfg_default 0x00000000
599#define regk_iop_sw_cfg_rw_gio_out_grp3_cfg_default 0x00000000
600#define regk_iop_sw_cfg_rw_gio_out_grp4_cfg_default 0x00000000
601#define regk_iop_sw_cfg_rw_gio_out_grp5_cfg_default 0x00000000
602#define regk_iop_sw_cfg_rw_gio_out_grp6_cfg_default 0x00000000
603#define regk_iop_sw_cfg_rw_gio_out_grp7_cfg_default 0x00000000
604#define regk_iop_sw_cfg_rw_pdp_cfg_default 0x00000000
605#define regk_iop_sw_cfg_rw_pinmapping_default 0x00555555
606#define regk_iop_sw_cfg_rw_sap_in_owner_default 0x00000000
607#define regk_iop_sw_cfg_rw_sap_out_owner_default 0x00000000
608#define regk_iop_sw_cfg_rw_scrc_in_owner_default 0x00000000
609#define regk_iop_sw_cfg_rw_scrc_out_owner_default 0x00000000
610#define regk_iop_sw_cfg_rw_sdp_cfg_default 0x00000000
611#define regk_iop_sw_cfg_rw_spu_cfg_default 0x00000000
612#define regk_iop_sw_cfg_rw_spu_owner_default 0x00000000
613#define regk_iop_sw_cfg_rw_timer_grp0_cfg_default 0x00000000
614#define regk_iop_sw_cfg_rw_timer_grp0_owner_default 0x00000000
615#define regk_iop_sw_cfg_rw_timer_grp1_cfg_default 0x00000000
616#define regk_iop_sw_cfg_rw_timer_grp1_owner_default 0x00000000
617#define regk_iop_sw_cfg_rw_trigger_grp0_owner_default 0x00000000
618#define regk_iop_sw_cfg_rw_trigger_grp1_owner_default 0x00000000
619#define regk_iop_sw_cfg_rw_trigger_grp2_owner_default 0x00000000
620#define regk_iop_sw_cfg_rw_trigger_grp3_owner_default 0x00000000
621#define regk_iop_sw_cfg_rw_trigger_grp4_owner_default 0x00000000
622#define regk_iop_sw_cfg_rw_trigger_grp5_owner_default 0x00000000
623#define regk_iop_sw_cfg_rw_trigger_grp6_owner_default 0x00000000
624#define regk_iop_sw_cfg_rw_trigger_grp7_owner_default 0x00000000
625#define regk_iop_sw_cfg_rw_trigger_grps_cfg_default 0x00000000
626#define regk_iop_sw_cfg_sdp_out 0x00000004
627#define regk_iop_sw_cfg_size16 0x00000002
628#define regk_iop_sw_cfg_size24 0x00000003
629#define regk_iop_sw_cfg_size32 0x00000004
630#define regk_iop_sw_cfg_size8 0x00000001
631#define regk_iop_sw_cfg_spu 0x00000002
632#define regk_iop_sw_cfg_spu_bus_out0_hi 0x00000002
633#define regk_iop_sw_cfg_spu_bus_out0_lo 0x00000002
634#define regk_iop_sw_cfg_spu_bus_out1_hi 0x00000003
635#define regk_iop_sw_cfg_spu_bus_out1_lo 0x00000003
636#define regk_iop_sw_cfg_spu_g0 0x00000007
637#define regk_iop_sw_cfg_spu_g1 0x00000007
638#define regk_iop_sw_cfg_spu_g2 0x00000007
639#define regk_iop_sw_cfg_spu_g3 0x00000007
640#define regk_iop_sw_cfg_spu_g4 0x00000007
641#define regk_iop_sw_cfg_spu_g5 0x00000007
642#define regk_iop_sw_cfg_spu_g6 0x00000007
643#define regk_iop_sw_cfg_spu_g7 0x00000007
644#define regk_iop_sw_cfg_spu_gio0 0x00000000
645#define regk_iop_sw_cfg_spu_gio1 0x00000001
646#define regk_iop_sw_cfg_spu_gio5 0x00000005
647#define regk_iop_sw_cfg_spu_gio6 0x00000006
648#define regk_iop_sw_cfg_spu_gio7 0x00000007
649#define regk_iop_sw_cfg_spu_gio_out0 0x00000008
650#define regk_iop_sw_cfg_spu_gio_out1 0x00000009
651#define regk_iop_sw_cfg_spu_gio_out2 0x0000000a
652#define regk_iop_sw_cfg_spu_gio_out3 0x0000000b
653#define regk_iop_sw_cfg_spu_gio_out4 0x0000000c
654#define regk_iop_sw_cfg_spu_gio_out5 0x0000000d
655#define regk_iop_sw_cfg_spu_gio_out6 0x0000000e
656#define regk_iop_sw_cfg_spu_gio_out7 0x0000000f
657#define regk_iop_sw_cfg_spu_gioout0 0x00000000
658#define regk_iop_sw_cfg_spu_gioout1 0x00000000
659#define regk_iop_sw_cfg_spu_gioout10 0x00000007
660#define regk_iop_sw_cfg_spu_gioout11 0x00000007
661#define regk_iop_sw_cfg_spu_gioout12 0x00000007
662#define regk_iop_sw_cfg_spu_gioout13 0x00000007
663#define regk_iop_sw_cfg_spu_gioout14 0x00000007
664#define regk_iop_sw_cfg_spu_gioout15 0x00000007
665#define regk_iop_sw_cfg_spu_gioout16 0x00000007
666#define regk_iop_sw_cfg_spu_gioout17 0x00000007
667#define regk_iop_sw_cfg_spu_gioout18 0x00000007
668#define regk_iop_sw_cfg_spu_gioout19 0x00000007
669#define regk_iop_sw_cfg_spu_gioout2 0x00000001
670#define regk_iop_sw_cfg_spu_gioout20 0x00000007
671#define regk_iop_sw_cfg_spu_gioout21 0x00000007
672#define regk_iop_sw_cfg_spu_gioout22 0x00000007
673#define regk_iop_sw_cfg_spu_gioout23 0x00000007
674#define regk_iop_sw_cfg_spu_gioout24 0x00000007
675#define regk_iop_sw_cfg_spu_gioout25 0x00000007
676#define regk_iop_sw_cfg_spu_gioout26 0x00000007
677#define regk_iop_sw_cfg_spu_gioout27 0x00000007
678#define regk_iop_sw_cfg_spu_gioout28 0x00000007
679#define regk_iop_sw_cfg_spu_gioout29 0x00000007
680#define regk_iop_sw_cfg_spu_gioout3 0x00000001
681#define regk_iop_sw_cfg_spu_gioout30 0x00000007
682#define regk_iop_sw_cfg_spu_gioout31 0x00000007
683#define regk_iop_sw_cfg_spu_gioout4 0x00000002
684#define regk_iop_sw_cfg_spu_gioout5 0x00000002
685#define regk_iop_sw_cfg_spu_gioout6 0x00000003
686#define regk_iop_sw_cfg_spu_gioout7 0x00000003
687#define regk_iop_sw_cfg_spu_gioout8 0x00000007
688#define regk_iop_sw_cfg_spu_gioout9 0x00000007
689#define regk_iop_sw_cfg_strb_timer_grp0_tmr0 0x00000001
690#define regk_iop_sw_cfg_strb_timer_grp0_tmr1 0x00000002
691#define regk_iop_sw_cfg_strb_timer_grp1_tmr0 0x00000003
692#define regk_iop_sw_cfg_strb_timer_grp1_tmr1 0x00000002
693#define regk_iop_sw_cfg_timer_grp0 0x00000000
694#define regk_iop_sw_cfg_timer_grp0_rot 0x00000001
695#define regk_iop_sw_cfg_timer_grp0_strb0 0x00000005
696#define regk_iop_sw_cfg_timer_grp0_strb1 0x00000005
697#define regk_iop_sw_cfg_timer_grp0_strb2 0x00000005
698#define regk_iop_sw_cfg_timer_grp0_strb3 0x00000005
699#define regk_iop_sw_cfg_timer_grp0_tmr0 0x00000002
700#define regk_iop_sw_cfg_timer_grp1 0x00000000
701#define regk_iop_sw_cfg_timer_grp1_rot 0x00000001
702#define regk_iop_sw_cfg_timer_grp1_strb0 0x00000006
703#define regk_iop_sw_cfg_timer_grp1_strb1 0x00000006
704#define regk_iop_sw_cfg_timer_grp1_strb2 0x00000006
705#define regk_iop_sw_cfg_timer_grp1_strb3 0x00000006
706#define regk_iop_sw_cfg_timer_grp1_tmr0 0x00000003
707#define regk_iop_sw_cfg_trig0_0 0x00000000
708#define regk_iop_sw_cfg_trig0_1 0x00000000
709#define regk_iop_sw_cfg_trig0_2 0x00000000
710#define regk_iop_sw_cfg_trig0_3 0x00000000
711#define regk_iop_sw_cfg_trig1_0 0x00000000
712#define regk_iop_sw_cfg_trig1_1 0x00000000
713#define regk_iop_sw_cfg_trig1_2 0x00000000
714#define regk_iop_sw_cfg_trig1_3 0x00000000
715#define regk_iop_sw_cfg_trig2_0 0x00000001
716#define regk_iop_sw_cfg_trig2_1 0x00000001
717#define regk_iop_sw_cfg_trig2_2 0x00000001
718#define regk_iop_sw_cfg_trig2_3 0x00000001
719#define regk_iop_sw_cfg_trig3_0 0x00000001
720#define regk_iop_sw_cfg_trig3_1 0x00000001
721#define regk_iop_sw_cfg_trig3_2 0x00000001
722#define regk_iop_sw_cfg_trig3_3 0x00000001
723#define regk_iop_sw_cfg_trig4_0 0x00000002
724#define regk_iop_sw_cfg_trig4_1 0x00000002
725#define regk_iop_sw_cfg_trig4_2 0x00000002
726#define regk_iop_sw_cfg_trig4_3 0x00000002
727#define regk_iop_sw_cfg_trig5_0 0x00000002
728#define regk_iop_sw_cfg_trig5_1 0x00000002
729#define regk_iop_sw_cfg_trig5_2 0x00000002
730#define regk_iop_sw_cfg_trig5_3 0x00000002
731#define regk_iop_sw_cfg_trig6_0 0x00000003
732#define regk_iop_sw_cfg_trig6_1 0x00000003
733#define regk_iop_sw_cfg_trig6_2 0x00000003
734#define regk_iop_sw_cfg_trig6_3 0x00000003
735#define regk_iop_sw_cfg_trig7_0 0x00000003
736#define regk_iop_sw_cfg_trig7_1 0x00000003
737#define regk_iop_sw_cfg_trig7_2 0x00000003
738#define regk_iop_sw_cfg_trig7_3 0x00000003
739#endif /* __iop_sw_cfg_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_cpu_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_cpu_defs_asm.h
new file mode 100644
index 000000000000..3f4fe1b31815
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_cpu_defs_asm.h
@@ -0,0 +1,950 @@
1#ifndef __iop_sw_cpu_defs_asm_h
2#define __iop_sw_cpu_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_sw_cpu.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile iop_sw_cpu_defs_asm.h iop_sw_cpu.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53/* Register r_mpu_trace, scope iop_sw_cpu, type r */
54#define reg_iop_sw_cpu_r_mpu_trace_offset 0
55
56/* Register r_spu_trace, scope iop_sw_cpu, type r */
57#define reg_iop_sw_cpu_r_spu_trace_offset 4
58
59/* Register r_spu_fsm_trace, scope iop_sw_cpu, type r */
60#define reg_iop_sw_cpu_r_spu_fsm_trace_offset 8
61
62/* Register rw_mc_ctrl, scope iop_sw_cpu, type rw */
63#define reg_iop_sw_cpu_rw_mc_ctrl___keep_owner___lsb 0
64#define reg_iop_sw_cpu_rw_mc_ctrl___keep_owner___width 1
65#define reg_iop_sw_cpu_rw_mc_ctrl___keep_owner___bit 0
66#define reg_iop_sw_cpu_rw_mc_ctrl___cmd___lsb 1
67#define reg_iop_sw_cpu_rw_mc_ctrl___cmd___width 2
68#define reg_iop_sw_cpu_rw_mc_ctrl___size___lsb 3
69#define reg_iop_sw_cpu_rw_mc_ctrl___size___width 3
70#define reg_iop_sw_cpu_rw_mc_ctrl___wr_spu_mem___lsb 6
71#define reg_iop_sw_cpu_rw_mc_ctrl___wr_spu_mem___width 1
72#define reg_iop_sw_cpu_rw_mc_ctrl___wr_spu_mem___bit 6
73#define reg_iop_sw_cpu_rw_mc_ctrl_offset 12
74
75/* Register rw_mc_data, scope iop_sw_cpu, type rw */
76#define reg_iop_sw_cpu_rw_mc_data___val___lsb 0
77#define reg_iop_sw_cpu_rw_mc_data___val___width 32
78#define reg_iop_sw_cpu_rw_mc_data_offset 16
79
80/* Register rw_mc_addr, scope iop_sw_cpu, type rw */
81#define reg_iop_sw_cpu_rw_mc_addr_offset 20
82
83/* Register rs_mc_data, scope iop_sw_cpu, type rs */
84#define reg_iop_sw_cpu_rs_mc_data_offset 24
85
86/* Register r_mc_data, scope iop_sw_cpu, type r */
87#define reg_iop_sw_cpu_r_mc_data_offset 28
88
89/* Register r_mc_stat, scope iop_sw_cpu, type r */
90#define reg_iop_sw_cpu_r_mc_stat___busy_cpu___lsb 0
91#define reg_iop_sw_cpu_r_mc_stat___busy_cpu___width 1
92#define reg_iop_sw_cpu_r_mc_stat___busy_cpu___bit 0
93#define reg_iop_sw_cpu_r_mc_stat___busy_mpu___lsb 1
94#define reg_iop_sw_cpu_r_mc_stat___busy_mpu___width 1
95#define reg_iop_sw_cpu_r_mc_stat___busy_mpu___bit 1
96#define reg_iop_sw_cpu_r_mc_stat___busy_spu___lsb 2
97#define reg_iop_sw_cpu_r_mc_stat___busy_spu___width 1
98#define reg_iop_sw_cpu_r_mc_stat___busy_spu___bit 2
99#define reg_iop_sw_cpu_r_mc_stat___owned_by_cpu___lsb 3
100#define reg_iop_sw_cpu_r_mc_stat___owned_by_cpu___width 1
101#define reg_iop_sw_cpu_r_mc_stat___owned_by_cpu___bit 3
102#define reg_iop_sw_cpu_r_mc_stat___owned_by_mpu___lsb 4
103#define reg_iop_sw_cpu_r_mc_stat___owned_by_mpu___width 1
104#define reg_iop_sw_cpu_r_mc_stat___owned_by_mpu___bit 4
105#define reg_iop_sw_cpu_r_mc_stat___owned_by_spu___lsb 5
106#define reg_iop_sw_cpu_r_mc_stat___owned_by_spu___width 1
107#define reg_iop_sw_cpu_r_mc_stat___owned_by_spu___bit 5
108#define reg_iop_sw_cpu_r_mc_stat_offset 32
109
110/* Register rw_bus_clr_mask, scope iop_sw_cpu, type rw */
111#define reg_iop_sw_cpu_rw_bus_clr_mask___byte0___lsb 0
112#define reg_iop_sw_cpu_rw_bus_clr_mask___byte0___width 8
113#define reg_iop_sw_cpu_rw_bus_clr_mask___byte1___lsb 8
114#define reg_iop_sw_cpu_rw_bus_clr_mask___byte1___width 8
115#define reg_iop_sw_cpu_rw_bus_clr_mask___byte2___lsb 16
116#define reg_iop_sw_cpu_rw_bus_clr_mask___byte2___width 8
117#define reg_iop_sw_cpu_rw_bus_clr_mask___byte3___lsb 24
118#define reg_iop_sw_cpu_rw_bus_clr_mask___byte3___width 8
119#define reg_iop_sw_cpu_rw_bus_clr_mask_offset 36
120
121/* Register rw_bus_set_mask, scope iop_sw_cpu, type rw */
122#define reg_iop_sw_cpu_rw_bus_set_mask___byte0___lsb 0
123#define reg_iop_sw_cpu_rw_bus_set_mask___byte0___width 8
124#define reg_iop_sw_cpu_rw_bus_set_mask___byte1___lsb 8
125#define reg_iop_sw_cpu_rw_bus_set_mask___byte1___width 8
126#define reg_iop_sw_cpu_rw_bus_set_mask___byte2___lsb 16
127#define reg_iop_sw_cpu_rw_bus_set_mask___byte2___width 8
128#define reg_iop_sw_cpu_rw_bus_set_mask___byte3___lsb 24
129#define reg_iop_sw_cpu_rw_bus_set_mask___byte3___width 8
130#define reg_iop_sw_cpu_rw_bus_set_mask_offset 40
131
132/* Register rw_bus_oe_clr_mask, scope iop_sw_cpu, type rw */
133#define reg_iop_sw_cpu_rw_bus_oe_clr_mask___byte0___lsb 0
134#define reg_iop_sw_cpu_rw_bus_oe_clr_mask___byte0___width 1
135#define reg_iop_sw_cpu_rw_bus_oe_clr_mask___byte0___bit 0
136#define reg_iop_sw_cpu_rw_bus_oe_clr_mask___byte1___lsb 1
137#define reg_iop_sw_cpu_rw_bus_oe_clr_mask___byte1___width 1
138#define reg_iop_sw_cpu_rw_bus_oe_clr_mask___byte1___bit 1
139#define reg_iop_sw_cpu_rw_bus_oe_clr_mask___byte2___lsb 2
140#define reg_iop_sw_cpu_rw_bus_oe_clr_mask___byte2___width 1
141#define reg_iop_sw_cpu_rw_bus_oe_clr_mask___byte2___bit 2
142#define reg_iop_sw_cpu_rw_bus_oe_clr_mask___byte3___lsb 3
143#define reg_iop_sw_cpu_rw_bus_oe_clr_mask___byte3___width 1
144#define reg_iop_sw_cpu_rw_bus_oe_clr_mask___byte3___bit 3
145#define reg_iop_sw_cpu_rw_bus_oe_clr_mask_offset 44
146
147/* Register rw_bus_oe_set_mask, scope iop_sw_cpu, type rw */
148#define reg_iop_sw_cpu_rw_bus_oe_set_mask___byte0___lsb 0
149#define reg_iop_sw_cpu_rw_bus_oe_set_mask___byte0___width 1
150#define reg_iop_sw_cpu_rw_bus_oe_set_mask___byte0___bit 0
151#define reg_iop_sw_cpu_rw_bus_oe_set_mask___byte1___lsb 1
152#define reg_iop_sw_cpu_rw_bus_oe_set_mask___byte1___width 1
153#define reg_iop_sw_cpu_rw_bus_oe_set_mask___byte1___bit 1
154#define reg_iop_sw_cpu_rw_bus_oe_set_mask___byte2___lsb 2
155#define reg_iop_sw_cpu_rw_bus_oe_set_mask___byte2___width 1
156#define reg_iop_sw_cpu_rw_bus_oe_set_mask___byte2___bit 2
157#define reg_iop_sw_cpu_rw_bus_oe_set_mask___byte3___lsb 3
158#define reg_iop_sw_cpu_rw_bus_oe_set_mask___byte3___width 1
159#define reg_iop_sw_cpu_rw_bus_oe_set_mask___byte3___bit 3
160#define reg_iop_sw_cpu_rw_bus_oe_set_mask_offset 48
161
162/* Register r_bus_in, scope iop_sw_cpu, type r */
163#define reg_iop_sw_cpu_r_bus_in_offset 52
164
165/* Register rw_gio_clr_mask, scope iop_sw_cpu, type rw */
166#define reg_iop_sw_cpu_rw_gio_clr_mask___val___lsb 0
167#define reg_iop_sw_cpu_rw_gio_clr_mask___val___width 32
168#define reg_iop_sw_cpu_rw_gio_clr_mask_offset 56
169
170/* Register rw_gio_set_mask, scope iop_sw_cpu, type rw */
171#define reg_iop_sw_cpu_rw_gio_set_mask___val___lsb 0
172#define reg_iop_sw_cpu_rw_gio_set_mask___val___width 32
173#define reg_iop_sw_cpu_rw_gio_set_mask_offset 60
174
175/* Register rw_gio_oe_clr_mask, scope iop_sw_cpu, type rw */
176#define reg_iop_sw_cpu_rw_gio_oe_clr_mask___val___lsb 0
177#define reg_iop_sw_cpu_rw_gio_oe_clr_mask___val___width 32
178#define reg_iop_sw_cpu_rw_gio_oe_clr_mask_offset 64
179
180/* Register rw_gio_oe_set_mask, scope iop_sw_cpu, type rw */
181#define reg_iop_sw_cpu_rw_gio_oe_set_mask___val___lsb 0
182#define reg_iop_sw_cpu_rw_gio_oe_set_mask___val___width 32
183#define reg_iop_sw_cpu_rw_gio_oe_set_mask_offset 68
184
185/* Register r_gio_in, scope iop_sw_cpu, type r */
186#define reg_iop_sw_cpu_r_gio_in_offset 72
187
188/* Register rw_intr0_mask, scope iop_sw_cpu, type rw */
189#define reg_iop_sw_cpu_rw_intr0_mask___mpu_0___lsb 0
190#define reg_iop_sw_cpu_rw_intr0_mask___mpu_0___width 1
191#define reg_iop_sw_cpu_rw_intr0_mask___mpu_0___bit 0
192#define reg_iop_sw_cpu_rw_intr0_mask___mpu_1___lsb 1
193#define reg_iop_sw_cpu_rw_intr0_mask___mpu_1___width 1
194#define reg_iop_sw_cpu_rw_intr0_mask___mpu_1___bit 1
195#define reg_iop_sw_cpu_rw_intr0_mask___mpu_2___lsb 2
196#define reg_iop_sw_cpu_rw_intr0_mask___mpu_2___width 1
197#define reg_iop_sw_cpu_rw_intr0_mask___mpu_2___bit 2
198#define reg_iop_sw_cpu_rw_intr0_mask___mpu_3___lsb 3
199#define reg_iop_sw_cpu_rw_intr0_mask___mpu_3___width 1
200#define reg_iop_sw_cpu_rw_intr0_mask___mpu_3___bit 3
201#define reg_iop_sw_cpu_rw_intr0_mask___mpu_4___lsb 4
202#define reg_iop_sw_cpu_rw_intr0_mask___mpu_4___width 1
203#define reg_iop_sw_cpu_rw_intr0_mask___mpu_4___bit 4
204#define reg_iop_sw_cpu_rw_intr0_mask___mpu_5___lsb 5
205#define reg_iop_sw_cpu_rw_intr0_mask___mpu_5___width 1
206#define reg_iop_sw_cpu_rw_intr0_mask___mpu_5___bit 5
207#define reg_iop_sw_cpu_rw_intr0_mask___mpu_6___lsb 6
208#define reg_iop_sw_cpu_rw_intr0_mask___mpu_6___width 1
209#define reg_iop_sw_cpu_rw_intr0_mask___mpu_6___bit 6
210#define reg_iop_sw_cpu_rw_intr0_mask___mpu_7___lsb 7
211#define reg_iop_sw_cpu_rw_intr0_mask___mpu_7___width 1
212#define reg_iop_sw_cpu_rw_intr0_mask___mpu_7___bit 7
213#define reg_iop_sw_cpu_rw_intr0_mask___mpu_8___lsb 8
214#define reg_iop_sw_cpu_rw_intr0_mask___mpu_8___width 1
215#define reg_iop_sw_cpu_rw_intr0_mask___mpu_8___bit 8
216#define reg_iop_sw_cpu_rw_intr0_mask___mpu_9___lsb 9
217#define reg_iop_sw_cpu_rw_intr0_mask___mpu_9___width 1
218#define reg_iop_sw_cpu_rw_intr0_mask___mpu_9___bit 9
219#define reg_iop_sw_cpu_rw_intr0_mask___mpu_10___lsb 10
220#define reg_iop_sw_cpu_rw_intr0_mask___mpu_10___width 1
221#define reg_iop_sw_cpu_rw_intr0_mask___mpu_10___bit 10
222#define reg_iop_sw_cpu_rw_intr0_mask___mpu_11___lsb 11
223#define reg_iop_sw_cpu_rw_intr0_mask___mpu_11___width 1
224#define reg_iop_sw_cpu_rw_intr0_mask___mpu_11___bit 11
225#define reg_iop_sw_cpu_rw_intr0_mask___mpu_12___lsb 12
226#define reg_iop_sw_cpu_rw_intr0_mask___mpu_12___width 1
227#define reg_iop_sw_cpu_rw_intr0_mask___mpu_12___bit 12
228#define reg_iop_sw_cpu_rw_intr0_mask___mpu_13___lsb 13
229#define reg_iop_sw_cpu_rw_intr0_mask___mpu_13___width 1
230#define reg_iop_sw_cpu_rw_intr0_mask___mpu_13___bit 13
231#define reg_iop_sw_cpu_rw_intr0_mask___mpu_14___lsb 14
232#define reg_iop_sw_cpu_rw_intr0_mask___mpu_14___width 1
233#define reg_iop_sw_cpu_rw_intr0_mask___mpu_14___bit 14
234#define reg_iop_sw_cpu_rw_intr0_mask___mpu_15___lsb 15
235#define reg_iop_sw_cpu_rw_intr0_mask___mpu_15___width 1
236#define reg_iop_sw_cpu_rw_intr0_mask___mpu_15___bit 15
237#define reg_iop_sw_cpu_rw_intr0_mask___spu_0___lsb 16
238#define reg_iop_sw_cpu_rw_intr0_mask___spu_0___width 1
239#define reg_iop_sw_cpu_rw_intr0_mask___spu_0___bit 16
240#define reg_iop_sw_cpu_rw_intr0_mask___spu_1___lsb 17
241#define reg_iop_sw_cpu_rw_intr0_mask___spu_1___width 1
242#define reg_iop_sw_cpu_rw_intr0_mask___spu_1___bit 17
243#define reg_iop_sw_cpu_rw_intr0_mask___spu_2___lsb 18
244#define reg_iop_sw_cpu_rw_intr0_mask___spu_2___width 1
245#define reg_iop_sw_cpu_rw_intr0_mask___spu_2___bit 18
246#define reg_iop_sw_cpu_rw_intr0_mask___spu_3___lsb 19
247#define reg_iop_sw_cpu_rw_intr0_mask___spu_3___width 1
248#define reg_iop_sw_cpu_rw_intr0_mask___spu_3___bit 19
249#define reg_iop_sw_cpu_rw_intr0_mask___spu_4___lsb 20
250#define reg_iop_sw_cpu_rw_intr0_mask___spu_4___width 1
251#define reg_iop_sw_cpu_rw_intr0_mask___spu_4___bit 20
252#define reg_iop_sw_cpu_rw_intr0_mask___spu_5___lsb 21
253#define reg_iop_sw_cpu_rw_intr0_mask___spu_5___width 1
254#define reg_iop_sw_cpu_rw_intr0_mask___spu_5___bit 21
255#define reg_iop_sw_cpu_rw_intr0_mask___spu_6___lsb 22
256#define reg_iop_sw_cpu_rw_intr0_mask___spu_6___width 1
257#define reg_iop_sw_cpu_rw_intr0_mask___spu_6___bit 22
258#define reg_iop_sw_cpu_rw_intr0_mask___spu_7___lsb 23
259#define reg_iop_sw_cpu_rw_intr0_mask___spu_7___width 1
260#define reg_iop_sw_cpu_rw_intr0_mask___spu_7___bit 23
261#define reg_iop_sw_cpu_rw_intr0_mask___spu_8___lsb 24
262#define reg_iop_sw_cpu_rw_intr0_mask___spu_8___width 1
263#define reg_iop_sw_cpu_rw_intr0_mask___spu_8___bit 24
264#define reg_iop_sw_cpu_rw_intr0_mask___spu_9___lsb 25
265#define reg_iop_sw_cpu_rw_intr0_mask___spu_9___width 1
266#define reg_iop_sw_cpu_rw_intr0_mask___spu_9___bit 25
267#define reg_iop_sw_cpu_rw_intr0_mask___spu_10___lsb 26
268#define reg_iop_sw_cpu_rw_intr0_mask___spu_10___width 1
269#define reg_iop_sw_cpu_rw_intr0_mask___spu_10___bit 26
270#define reg_iop_sw_cpu_rw_intr0_mask___spu_11___lsb 27
271#define reg_iop_sw_cpu_rw_intr0_mask___spu_11___width 1
272#define reg_iop_sw_cpu_rw_intr0_mask___spu_11___bit 27
273#define reg_iop_sw_cpu_rw_intr0_mask___spu_12___lsb 28
274#define reg_iop_sw_cpu_rw_intr0_mask___spu_12___width 1
275#define reg_iop_sw_cpu_rw_intr0_mask___spu_12___bit 28
276#define reg_iop_sw_cpu_rw_intr0_mask___spu_13___lsb 29
277#define reg_iop_sw_cpu_rw_intr0_mask___spu_13___width 1
278#define reg_iop_sw_cpu_rw_intr0_mask___spu_13___bit 29
279#define reg_iop_sw_cpu_rw_intr0_mask___spu_14___lsb 30
280#define reg_iop_sw_cpu_rw_intr0_mask___spu_14___width 1
281#define reg_iop_sw_cpu_rw_intr0_mask___spu_14___bit 30
282#define reg_iop_sw_cpu_rw_intr0_mask___spu_15___lsb 31
283#define reg_iop_sw_cpu_rw_intr0_mask___spu_15___width 1
284#define reg_iop_sw_cpu_rw_intr0_mask___spu_15___bit 31
285#define reg_iop_sw_cpu_rw_intr0_mask_offset 76
286
287/* Register rw_ack_intr0, scope iop_sw_cpu, type rw */
288#define reg_iop_sw_cpu_rw_ack_intr0___mpu_0___lsb 0
289#define reg_iop_sw_cpu_rw_ack_intr0___mpu_0___width 1
290#define reg_iop_sw_cpu_rw_ack_intr0___mpu_0___bit 0
291#define reg_iop_sw_cpu_rw_ack_intr0___mpu_1___lsb 1
292#define reg_iop_sw_cpu_rw_ack_intr0___mpu_1___width 1
293#define reg_iop_sw_cpu_rw_ack_intr0___mpu_1___bit 1
294#define reg_iop_sw_cpu_rw_ack_intr0___mpu_2___lsb 2
295#define reg_iop_sw_cpu_rw_ack_intr0___mpu_2___width 1
296#define reg_iop_sw_cpu_rw_ack_intr0___mpu_2___bit 2
297#define reg_iop_sw_cpu_rw_ack_intr0___mpu_3___lsb 3
298#define reg_iop_sw_cpu_rw_ack_intr0___mpu_3___width 1
299#define reg_iop_sw_cpu_rw_ack_intr0___mpu_3___bit 3
300#define reg_iop_sw_cpu_rw_ack_intr0___mpu_4___lsb 4
301#define reg_iop_sw_cpu_rw_ack_intr0___mpu_4___width 1
302#define reg_iop_sw_cpu_rw_ack_intr0___mpu_4___bit 4
303#define reg_iop_sw_cpu_rw_ack_intr0___mpu_5___lsb 5
304#define reg_iop_sw_cpu_rw_ack_intr0___mpu_5___width 1
305#define reg_iop_sw_cpu_rw_ack_intr0___mpu_5___bit 5
306#define reg_iop_sw_cpu_rw_ack_intr0___mpu_6___lsb 6
307#define reg_iop_sw_cpu_rw_ack_intr0___mpu_6___width 1
308#define reg_iop_sw_cpu_rw_ack_intr0___mpu_6___bit 6
309#define reg_iop_sw_cpu_rw_ack_intr0___mpu_7___lsb 7
310#define reg_iop_sw_cpu_rw_ack_intr0___mpu_7___width 1
311#define reg_iop_sw_cpu_rw_ack_intr0___mpu_7___bit 7
312#define reg_iop_sw_cpu_rw_ack_intr0___mpu_8___lsb 8
313#define reg_iop_sw_cpu_rw_ack_intr0___mpu_8___width 1
314#define reg_iop_sw_cpu_rw_ack_intr0___mpu_8___bit 8
315#define reg_iop_sw_cpu_rw_ack_intr0___mpu_9___lsb 9
316#define reg_iop_sw_cpu_rw_ack_intr0___mpu_9___width 1
317#define reg_iop_sw_cpu_rw_ack_intr0___mpu_9___bit 9
318#define reg_iop_sw_cpu_rw_ack_intr0___mpu_10___lsb 10
319#define reg_iop_sw_cpu_rw_ack_intr0___mpu_10___width 1
320#define reg_iop_sw_cpu_rw_ack_intr0___mpu_10___bit 10
321#define reg_iop_sw_cpu_rw_ack_intr0___mpu_11___lsb 11
322#define reg_iop_sw_cpu_rw_ack_intr0___mpu_11___width 1
323#define reg_iop_sw_cpu_rw_ack_intr0___mpu_11___bit 11
324#define reg_iop_sw_cpu_rw_ack_intr0___mpu_12___lsb 12
325#define reg_iop_sw_cpu_rw_ack_intr0___mpu_12___width 1
326#define reg_iop_sw_cpu_rw_ack_intr0___mpu_12___bit 12
327#define reg_iop_sw_cpu_rw_ack_intr0___mpu_13___lsb 13
328#define reg_iop_sw_cpu_rw_ack_intr0___mpu_13___width 1
329#define reg_iop_sw_cpu_rw_ack_intr0___mpu_13___bit 13
330#define reg_iop_sw_cpu_rw_ack_intr0___mpu_14___lsb 14
331#define reg_iop_sw_cpu_rw_ack_intr0___mpu_14___width 1
332#define reg_iop_sw_cpu_rw_ack_intr0___mpu_14___bit 14
333#define reg_iop_sw_cpu_rw_ack_intr0___mpu_15___lsb 15
334#define reg_iop_sw_cpu_rw_ack_intr0___mpu_15___width 1
335#define reg_iop_sw_cpu_rw_ack_intr0___mpu_15___bit 15
336#define reg_iop_sw_cpu_rw_ack_intr0___spu_0___lsb 16
337#define reg_iop_sw_cpu_rw_ack_intr0___spu_0___width 1
338#define reg_iop_sw_cpu_rw_ack_intr0___spu_0___bit 16
339#define reg_iop_sw_cpu_rw_ack_intr0___spu_1___lsb 17
340#define reg_iop_sw_cpu_rw_ack_intr0___spu_1___width 1
341#define reg_iop_sw_cpu_rw_ack_intr0___spu_1___bit 17
342#define reg_iop_sw_cpu_rw_ack_intr0___spu_2___lsb 18
343#define reg_iop_sw_cpu_rw_ack_intr0___spu_2___width 1
344#define reg_iop_sw_cpu_rw_ack_intr0___spu_2___bit 18
345#define reg_iop_sw_cpu_rw_ack_intr0___spu_3___lsb 19
346#define reg_iop_sw_cpu_rw_ack_intr0___spu_3___width 1
347#define reg_iop_sw_cpu_rw_ack_intr0___spu_3___bit 19
348#define reg_iop_sw_cpu_rw_ack_intr0___spu_4___lsb 20
349#define reg_iop_sw_cpu_rw_ack_intr0___spu_4___width 1
350#define reg_iop_sw_cpu_rw_ack_intr0___spu_4___bit 20
351#define reg_iop_sw_cpu_rw_ack_intr0___spu_5___lsb 21
352#define reg_iop_sw_cpu_rw_ack_intr0___spu_5___width 1
353#define reg_iop_sw_cpu_rw_ack_intr0___spu_5___bit 21
354#define reg_iop_sw_cpu_rw_ack_intr0___spu_6___lsb 22
355#define reg_iop_sw_cpu_rw_ack_intr0___spu_6___width 1
356#define reg_iop_sw_cpu_rw_ack_intr0___spu_6___bit 22
357#define reg_iop_sw_cpu_rw_ack_intr0___spu_7___lsb 23
358#define reg_iop_sw_cpu_rw_ack_intr0___spu_7___width 1
359#define reg_iop_sw_cpu_rw_ack_intr0___spu_7___bit 23
360#define reg_iop_sw_cpu_rw_ack_intr0___spu_8___lsb 24
361#define reg_iop_sw_cpu_rw_ack_intr0___spu_8___width 1
362#define reg_iop_sw_cpu_rw_ack_intr0___spu_8___bit 24
363#define reg_iop_sw_cpu_rw_ack_intr0___spu_9___lsb 25
364#define reg_iop_sw_cpu_rw_ack_intr0___spu_9___width 1
365#define reg_iop_sw_cpu_rw_ack_intr0___spu_9___bit 25
366#define reg_iop_sw_cpu_rw_ack_intr0___spu_10___lsb 26
367#define reg_iop_sw_cpu_rw_ack_intr0___spu_10___width 1
368#define reg_iop_sw_cpu_rw_ack_intr0___spu_10___bit 26
369#define reg_iop_sw_cpu_rw_ack_intr0___spu_11___lsb 27
370#define reg_iop_sw_cpu_rw_ack_intr0___spu_11___width 1
371#define reg_iop_sw_cpu_rw_ack_intr0___spu_11___bit 27
372#define reg_iop_sw_cpu_rw_ack_intr0___spu_12___lsb 28
373#define reg_iop_sw_cpu_rw_ack_intr0___spu_12___width 1
374#define reg_iop_sw_cpu_rw_ack_intr0___spu_12___bit 28
375#define reg_iop_sw_cpu_rw_ack_intr0___spu_13___lsb 29
376#define reg_iop_sw_cpu_rw_ack_intr0___spu_13___width 1
377#define reg_iop_sw_cpu_rw_ack_intr0___spu_13___bit 29
378#define reg_iop_sw_cpu_rw_ack_intr0___spu_14___lsb 30
379#define reg_iop_sw_cpu_rw_ack_intr0___spu_14___width 1
380#define reg_iop_sw_cpu_rw_ack_intr0___spu_14___bit 30
381#define reg_iop_sw_cpu_rw_ack_intr0___spu_15___lsb 31
382#define reg_iop_sw_cpu_rw_ack_intr0___spu_15___width 1
383#define reg_iop_sw_cpu_rw_ack_intr0___spu_15___bit 31
384#define reg_iop_sw_cpu_rw_ack_intr0_offset 80
385
386/* Register r_intr0, scope iop_sw_cpu, type r */
387#define reg_iop_sw_cpu_r_intr0___mpu_0___lsb 0
388#define reg_iop_sw_cpu_r_intr0___mpu_0___width 1
389#define reg_iop_sw_cpu_r_intr0___mpu_0___bit 0
390#define reg_iop_sw_cpu_r_intr0___mpu_1___lsb 1
391#define reg_iop_sw_cpu_r_intr0___mpu_1___width 1
392#define reg_iop_sw_cpu_r_intr0___mpu_1___bit 1
393#define reg_iop_sw_cpu_r_intr0___mpu_2___lsb 2
394#define reg_iop_sw_cpu_r_intr0___mpu_2___width 1
395#define reg_iop_sw_cpu_r_intr0___mpu_2___bit 2
396#define reg_iop_sw_cpu_r_intr0___mpu_3___lsb 3
397#define reg_iop_sw_cpu_r_intr0___mpu_3___width 1
398#define reg_iop_sw_cpu_r_intr0___mpu_3___bit 3
399#define reg_iop_sw_cpu_r_intr0___mpu_4___lsb 4
400#define reg_iop_sw_cpu_r_intr0___mpu_4___width 1
401#define reg_iop_sw_cpu_r_intr0___mpu_4___bit 4
402#define reg_iop_sw_cpu_r_intr0___mpu_5___lsb 5
403#define reg_iop_sw_cpu_r_intr0___mpu_5___width 1
404#define reg_iop_sw_cpu_r_intr0___mpu_5___bit 5
405#define reg_iop_sw_cpu_r_intr0___mpu_6___lsb 6
406#define reg_iop_sw_cpu_r_intr0___mpu_6___width 1
407#define reg_iop_sw_cpu_r_intr0___mpu_6___bit 6
408#define reg_iop_sw_cpu_r_intr0___mpu_7___lsb 7
409#define reg_iop_sw_cpu_r_intr0___mpu_7___width 1
410#define reg_iop_sw_cpu_r_intr0___mpu_7___bit 7
411#define reg_iop_sw_cpu_r_intr0___mpu_8___lsb 8
412#define reg_iop_sw_cpu_r_intr0___mpu_8___width 1
413#define reg_iop_sw_cpu_r_intr0___mpu_8___bit 8
414#define reg_iop_sw_cpu_r_intr0___mpu_9___lsb 9
415#define reg_iop_sw_cpu_r_intr0___mpu_9___width 1
416#define reg_iop_sw_cpu_r_intr0___mpu_9___bit 9
417#define reg_iop_sw_cpu_r_intr0___mpu_10___lsb 10
418#define reg_iop_sw_cpu_r_intr0___mpu_10___width 1
419#define reg_iop_sw_cpu_r_intr0___mpu_10___bit 10
420#define reg_iop_sw_cpu_r_intr0___mpu_11___lsb 11
421#define reg_iop_sw_cpu_r_intr0___mpu_11___width 1
422#define reg_iop_sw_cpu_r_intr0___mpu_11___bit 11
423#define reg_iop_sw_cpu_r_intr0___mpu_12___lsb 12
424#define reg_iop_sw_cpu_r_intr0___mpu_12___width 1
425#define reg_iop_sw_cpu_r_intr0___mpu_12___bit 12
426#define reg_iop_sw_cpu_r_intr0___mpu_13___lsb 13
427#define reg_iop_sw_cpu_r_intr0___mpu_13___width 1
428#define reg_iop_sw_cpu_r_intr0___mpu_13___bit 13
429#define reg_iop_sw_cpu_r_intr0___mpu_14___lsb 14
430#define reg_iop_sw_cpu_r_intr0___mpu_14___width 1
431#define reg_iop_sw_cpu_r_intr0___mpu_14___bit 14
432#define reg_iop_sw_cpu_r_intr0___mpu_15___lsb 15
433#define reg_iop_sw_cpu_r_intr0___mpu_15___width 1
434#define reg_iop_sw_cpu_r_intr0___mpu_15___bit 15
435#define reg_iop_sw_cpu_r_intr0___spu_0___lsb 16
436#define reg_iop_sw_cpu_r_intr0___spu_0___width 1
437#define reg_iop_sw_cpu_r_intr0___spu_0___bit 16
438#define reg_iop_sw_cpu_r_intr0___spu_1___lsb 17
439#define reg_iop_sw_cpu_r_intr0___spu_1___width 1
440#define reg_iop_sw_cpu_r_intr0___spu_1___bit 17
441#define reg_iop_sw_cpu_r_intr0___spu_2___lsb 18
442#define reg_iop_sw_cpu_r_intr0___spu_2___width 1
443#define reg_iop_sw_cpu_r_intr0___spu_2___bit 18
444#define reg_iop_sw_cpu_r_intr0___spu_3___lsb 19
445#define reg_iop_sw_cpu_r_intr0___spu_3___width 1
446#define reg_iop_sw_cpu_r_intr0___spu_3___bit 19
447#define reg_iop_sw_cpu_r_intr0___spu_4___lsb 20
448#define reg_iop_sw_cpu_r_intr0___spu_4___width 1
449#define reg_iop_sw_cpu_r_intr0___spu_4___bit 20
450#define reg_iop_sw_cpu_r_intr0___spu_5___lsb 21
451#define reg_iop_sw_cpu_r_intr0___spu_5___width 1
452#define reg_iop_sw_cpu_r_intr0___spu_5___bit 21
453#define reg_iop_sw_cpu_r_intr0___spu_6___lsb 22
454#define reg_iop_sw_cpu_r_intr0___spu_6___width 1
455#define reg_iop_sw_cpu_r_intr0___spu_6___bit 22
456#define reg_iop_sw_cpu_r_intr0___spu_7___lsb 23
457#define reg_iop_sw_cpu_r_intr0___spu_7___width 1
458#define reg_iop_sw_cpu_r_intr0___spu_7___bit 23
459#define reg_iop_sw_cpu_r_intr0___spu_8___lsb 24
460#define reg_iop_sw_cpu_r_intr0___spu_8___width 1
461#define reg_iop_sw_cpu_r_intr0___spu_8___bit 24
462#define reg_iop_sw_cpu_r_intr0___spu_9___lsb 25
463#define reg_iop_sw_cpu_r_intr0___spu_9___width 1
464#define reg_iop_sw_cpu_r_intr0___spu_9___bit 25
465#define reg_iop_sw_cpu_r_intr0___spu_10___lsb 26
466#define reg_iop_sw_cpu_r_intr0___spu_10___width 1
467#define reg_iop_sw_cpu_r_intr0___spu_10___bit 26
468#define reg_iop_sw_cpu_r_intr0___spu_11___lsb 27
469#define reg_iop_sw_cpu_r_intr0___spu_11___width 1
470#define reg_iop_sw_cpu_r_intr0___spu_11___bit 27
471#define reg_iop_sw_cpu_r_intr0___spu_12___lsb 28
472#define reg_iop_sw_cpu_r_intr0___spu_12___width 1
473#define reg_iop_sw_cpu_r_intr0___spu_12___bit 28
474#define reg_iop_sw_cpu_r_intr0___spu_13___lsb 29
475#define reg_iop_sw_cpu_r_intr0___spu_13___width 1
476#define reg_iop_sw_cpu_r_intr0___spu_13___bit 29
477#define reg_iop_sw_cpu_r_intr0___spu_14___lsb 30
478#define reg_iop_sw_cpu_r_intr0___spu_14___width 1
479#define reg_iop_sw_cpu_r_intr0___spu_14___bit 30
480#define reg_iop_sw_cpu_r_intr0___spu_15___lsb 31
481#define reg_iop_sw_cpu_r_intr0___spu_15___width 1
482#define reg_iop_sw_cpu_r_intr0___spu_15___bit 31
483#define reg_iop_sw_cpu_r_intr0_offset 84
484
485/* Register r_masked_intr0, scope iop_sw_cpu, type r */
486#define reg_iop_sw_cpu_r_masked_intr0___mpu_0___lsb 0
487#define reg_iop_sw_cpu_r_masked_intr0___mpu_0___width 1
488#define reg_iop_sw_cpu_r_masked_intr0___mpu_0___bit 0
489#define reg_iop_sw_cpu_r_masked_intr0___mpu_1___lsb 1
490#define reg_iop_sw_cpu_r_masked_intr0___mpu_1___width 1
491#define reg_iop_sw_cpu_r_masked_intr0___mpu_1___bit 1
492#define reg_iop_sw_cpu_r_masked_intr0___mpu_2___lsb 2
493#define reg_iop_sw_cpu_r_masked_intr0___mpu_2___width 1
494#define reg_iop_sw_cpu_r_masked_intr0___mpu_2___bit 2
495#define reg_iop_sw_cpu_r_masked_intr0___mpu_3___lsb 3
496#define reg_iop_sw_cpu_r_masked_intr0___mpu_3___width 1
497#define reg_iop_sw_cpu_r_masked_intr0___mpu_3___bit 3
498#define reg_iop_sw_cpu_r_masked_intr0___mpu_4___lsb 4
499#define reg_iop_sw_cpu_r_masked_intr0___mpu_4___width 1
500#define reg_iop_sw_cpu_r_masked_intr0___mpu_4___bit 4
501#define reg_iop_sw_cpu_r_masked_intr0___mpu_5___lsb 5
502#define reg_iop_sw_cpu_r_masked_intr0___mpu_5___width 1
503#define reg_iop_sw_cpu_r_masked_intr0___mpu_5___bit 5
504#define reg_iop_sw_cpu_r_masked_intr0___mpu_6___lsb 6
505#define reg_iop_sw_cpu_r_masked_intr0___mpu_6___width 1
506#define reg_iop_sw_cpu_r_masked_intr0___mpu_6___bit 6
507#define reg_iop_sw_cpu_r_masked_intr0___mpu_7___lsb 7
508#define reg_iop_sw_cpu_r_masked_intr0___mpu_7___width 1
509#define reg_iop_sw_cpu_r_masked_intr0___mpu_7___bit 7
510#define reg_iop_sw_cpu_r_masked_intr0___mpu_8___lsb 8
511#define reg_iop_sw_cpu_r_masked_intr0___mpu_8___width 1
512#define reg_iop_sw_cpu_r_masked_intr0___mpu_8___bit 8
513#define reg_iop_sw_cpu_r_masked_intr0___mpu_9___lsb 9
514#define reg_iop_sw_cpu_r_masked_intr0___mpu_9___width 1
515#define reg_iop_sw_cpu_r_masked_intr0___mpu_9___bit 9
516#define reg_iop_sw_cpu_r_masked_intr0___mpu_10___lsb 10
517#define reg_iop_sw_cpu_r_masked_intr0___mpu_10___width 1
518#define reg_iop_sw_cpu_r_masked_intr0___mpu_10___bit 10
519#define reg_iop_sw_cpu_r_masked_intr0___mpu_11___lsb 11
520#define reg_iop_sw_cpu_r_masked_intr0___mpu_11___width 1
521#define reg_iop_sw_cpu_r_masked_intr0___mpu_11___bit 11
522#define reg_iop_sw_cpu_r_masked_intr0___mpu_12___lsb 12
523#define reg_iop_sw_cpu_r_masked_intr0___mpu_12___width 1
524#define reg_iop_sw_cpu_r_masked_intr0___mpu_12___bit 12
525#define reg_iop_sw_cpu_r_masked_intr0___mpu_13___lsb 13
526#define reg_iop_sw_cpu_r_masked_intr0___mpu_13___width 1
527#define reg_iop_sw_cpu_r_masked_intr0___mpu_13___bit 13
528#define reg_iop_sw_cpu_r_masked_intr0___mpu_14___lsb 14
529#define reg_iop_sw_cpu_r_masked_intr0___mpu_14___width 1
530#define reg_iop_sw_cpu_r_masked_intr0___mpu_14___bit 14
531#define reg_iop_sw_cpu_r_masked_intr0___mpu_15___lsb 15
532#define reg_iop_sw_cpu_r_masked_intr0___mpu_15___width 1
533#define reg_iop_sw_cpu_r_masked_intr0___mpu_15___bit 15
534#define reg_iop_sw_cpu_r_masked_intr0___spu_0___lsb 16
535#define reg_iop_sw_cpu_r_masked_intr0___spu_0___width 1
536#define reg_iop_sw_cpu_r_masked_intr0___spu_0___bit 16
537#define reg_iop_sw_cpu_r_masked_intr0___spu_1___lsb 17
538#define reg_iop_sw_cpu_r_masked_intr0___spu_1___width 1
539#define reg_iop_sw_cpu_r_masked_intr0___spu_1___bit 17
540#define reg_iop_sw_cpu_r_masked_intr0___spu_2___lsb 18
541#define reg_iop_sw_cpu_r_masked_intr0___spu_2___width 1
542#define reg_iop_sw_cpu_r_masked_intr0___spu_2___bit 18
543#define reg_iop_sw_cpu_r_masked_intr0___spu_3___lsb 19
544#define reg_iop_sw_cpu_r_masked_intr0___spu_3___width 1
545#define reg_iop_sw_cpu_r_masked_intr0___spu_3___bit 19
546#define reg_iop_sw_cpu_r_masked_intr0___spu_4___lsb 20
547#define reg_iop_sw_cpu_r_masked_intr0___spu_4___width 1
548#define reg_iop_sw_cpu_r_masked_intr0___spu_4___bit 20
549#define reg_iop_sw_cpu_r_masked_intr0___spu_5___lsb 21
550#define reg_iop_sw_cpu_r_masked_intr0___spu_5___width 1
551#define reg_iop_sw_cpu_r_masked_intr0___spu_5___bit 21
552#define reg_iop_sw_cpu_r_masked_intr0___spu_6___lsb 22
553#define reg_iop_sw_cpu_r_masked_intr0___spu_6___width 1
554#define reg_iop_sw_cpu_r_masked_intr0___spu_6___bit 22
555#define reg_iop_sw_cpu_r_masked_intr0___spu_7___lsb 23
556#define reg_iop_sw_cpu_r_masked_intr0___spu_7___width 1
557#define reg_iop_sw_cpu_r_masked_intr0___spu_7___bit 23
558#define reg_iop_sw_cpu_r_masked_intr0___spu_8___lsb 24
559#define reg_iop_sw_cpu_r_masked_intr0___spu_8___width 1
560#define reg_iop_sw_cpu_r_masked_intr0___spu_8___bit 24
561#define reg_iop_sw_cpu_r_masked_intr0___spu_9___lsb 25
562#define reg_iop_sw_cpu_r_masked_intr0___spu_9___width 1
563#define reg_iop_sw_cpu_r_masked_intr0___spu_9___bit 25
564#define reg_iop_sw_cpu_r_masked_intr0___spu_10___lsb 26
565#define reg_iop_sw_cpu_r_masked_intr0___spu_10___width 1
566#define reg_iop_sw_cpu_r_masked_intr0___spu_10___bit 26
567#define reg_iop_sw_cpu_r_masked_intr0___spu_11___lsb 27
568#define reg_iop_sw_cpu_r_masked_intr0___spu_11___width 1
569#define reg_iop_sw_cpu_r_masked_intr0___spu_11___bit 27
570#define reg_iop_sw_cpu_r_masked_intr0___spu_12___lsb 28
571#define reg_iop_sw_cpu_r_masked_intr0___spu_12___width 1
572#define reg_iop_sw_cpu_r_masked_intr0___spu_12___bit 28
573#define reg_iop_sw_cpu_r_masked_intr0___spu_13___lsb 29
574#define reg_iop_sw_cpu_r_masked_intr0___spu_13___width 1
575#define reg_iop_sw_cpu_r_masked_intr0___spu_13___bit 29
576#define reg_iop_sw_cpu_r_masked_intr0___spu_14___lsb 30
577#define reg_iop_sw_cpu_r_masked_intr0___spu_14___width 1
578#define reg_iop_sw_cpu_r_masked_intr0___spu_14___bit 30
579#define reg_iop_sw_cpu_r_masked_intr0___spu_15___lsb 31
580#define reg_iop_sw_cpu_r_masked_intr0___spu_15___width 1
581#define reg_iop_sw_cpu_r_masked_intr0___spu_15___bit 31
582#define reg_iop_sw_cpu_r_masked_intr0_offset 88
583
584/* Register rw_intr1_mask, scope iop_sw_cpu, type rw */
585#define reg_iop_sw_cpu_rw_intr1_mask___mpu_16___lsb 0
586#define reg_iop_sw_cpu_rw_intr1_mask___mpu_16___width 1
587#define reg_iop_sw_cpu_rw_intr1_mask___mpu_16___bit 0
588#define reg_iop_sw_cpu_rw_intr1_mask___mpu_17___lsb 1
589#define reg_iop_sw_cpu_rw_intr1_mask___mpu_17___width 1
590#define reg_iop_sw_cpu_rw_intr1_mask___mpu_17___bit 1
591#define reg_iop_sw_cpu_rw_intr1_mask___mpu_18___lsb 2
592#define reg_iop_sw_cpu_rw_intr1_mask___mpu_18___width 1
593#define reg_iop_sw_cpu_rw_intr1_mask___mpu_18___bit 2
594#define reg_iop_sw_cpu_rw_intr1_mask___mpu_19___lsb 3
595#define reg_iop_sw_cpu_rw_intr1_mask___mpu_19___width 1
596#define reg_iop_sw_cpu_rw_intr1_mask___mpu_19___bit 3
597#define reg_iop_sw_cpu_rw_intr1_mask___mpu_20___lsb 4
598#define reg_iop_sw_cpu_rw_intr1_mask___mpu_20___width 1
599#define reg_iop_sw_cpu_rw_intr1_mask___mpu_20___bit 4
600#define reg_iop_sw_cpu_rw_intr1_mask___mpu_21___lsb 5
601#define reg_iop_sw_cpu_rw_intr1_mask___mpu_21___width 1
602#define reg_iop_sw_cpu_rw_intr1_mask___mpu_21___bit 5
603#define reg_iop_sw_cpu_rw_intr1_mask___mpu_22___lsb 6
604#define reg_iop_sw_cpu_rw_intr1_mask___mpu_22___width 1
605#define reg_iop_sw_cpu_rw_intr1_mask___mpu_22___bit 6
606#define reg_iop_sw_cpu_rw_intr1_mask___mpu_23___lsb 7
607#define reg_iop_sw_cpu_rw_intr1_mask___mpu_23___width 1
608#define reg_iop_sw_cpu_rw_intr1_mask___mpu_23___bit 7
609#define reg_iop_sw_cpu_rw_intr1_mask___mpu_24___lsb 8
610#define reg_iop_sw_cpu_rw_intr1_mask___mpu_24___width 1
611#define reg_iop_sw_cpu_rw_intr1_mask___mpu_24___bit 8
612#define reg_iop_sw_cpu_rw_intr1_mask___mpu_25___lsb 9
613#define reg_iop_sw_cpu_rw_intr1_mask___mpu_25___width 1
614#define reg_iop_sw_cpu_rw_intr1_mask___mpu_25___bit 9
615#define reg_iop_sw_cpu_rw_intr1_mask___mpu_26___lsb 10
616#define reg_iop_sw_cpu_rw_intr1_mask___mpu_26___width 1
617#define reg_iop_sw_cpu_rw_intr1_mask___mpu_26___bit 10
618#define reg_iop_sw_cpu_rw_intr1_mask___mpu_27___lsb 11
619#define reg_iop_sw_cpu_rw_intr1_mask___mpu_27___width 1
620#define reg_iop_sw_cpu_rw_intr1_mask___mpu_27___bit 11
621#define reg_iop_sw_cpu_rw_intr1_mask___mpu_28___lsb 12
622#define reg_iop_sw_cpu_rw_intr1_mask___mpu_28___width 1
623#define reg_iop_sw_cpu_rw_intr1_mask___mpu_28___bit 12
624#define reg_iop_sw_cpu_rw_intr1_mask___mpu_29___lsb 13
625#define reg_iop_sw_cpu_rw_intr1_mask___mpu_29___width 1
626#define reg_iop_sw_cpu_rw_intr1_mask___mpu_29___bit 13
627#define reg_iop_sw_cpu_rw_intr1_mask___mpu_30___lsb 14
628#define reg_iop_sw_cpu_rw_intr1_mask___mpu_30___width 1
629#define reg_iop_sw_cpu_rw_intr1_mask___mpu_30___bit 14
630#define reg_iop_sw_cpu_rw_intr1_mask___mpu_31___lsb 15
631#define reg_iop_sw_cpu_rw_intr1_mask___mpu_31___width 1
632#define reg_iop_sw_cpu_rw_intr1_mask___mpu_31___bit 15
633#define reg_iop_sw_cpu_rw_intr1_mask___dmc_in___lsb 16
634#define reg_iop_sw_cpu_rw_intr1_mask___dmc_in___width 1
635#define reg_iop_sw_cpu_rw_intr1_mask___dmc_in___bit 16
636#define reg_iop_sw_cpu_rw_intr1_mask___dmc_out___lsb 17
637#define reg_iop_sw_cpu_rw_intr1_mask___dmc_out___width 1
638#define reg_iop_sw_cpu_rw_intr1_mask___dmc_out___bit 17
639#define reg_iop_sw_cpu_rw_intr1_mask___fifo_in___lsb 18
640#define reg_iop_sw_cpu_rw_intr1_mask___fifo_in___width 1
641#define reg_iop_sw_cpu_rw_intr1_mask___fifo_in___bit 18
642#define reg_iop_sw_cpu_rw_intr1_mask___fifo_out___lsb 19
643#define reg_iop_sw_cpu_rw_intr1_mask___fifo_out___width 1
644#define reg_iop_sw_cpu_rw_intr1_mask___fifo_out___bit 19
645#define reg_iop_sw_cpu_rw_intr1_mask___fifo_in_extra___lsb 20
646#define reg_iop_sw_cpu_rw_intr1_mask___fifo_in_extra___width 1
647#define reg_iop_sw_cpu_rw_intr1_mask___fifo_in_extra___bit 20
648#define reg_iop_sw_cpu_rw_intr1_mask___fifo_out_extra___lsb 21
649#define reg_iop_sw_cpu_rw_intr1_mask___fifo_out_extra___width 1
650#define reg_iop_sw_cpu_rw_intr1_mask___fifo_out_extra___bit 21
651#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp0___lsb 22
652#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp0___width 1
653#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp0___bit 22
654#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp1___lsb 23
655#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp1___width 1
656#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp1___bit 23
657#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp2___lsb 24
658#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp2___width 1
659#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp2___bit 24
660#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp3___lsb 25
661#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp3___width 1
662#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp3___bit 25
663#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp4___lsb 26
664#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp4___width 1
665#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp4___bit 26
666#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp5___lsb 27
667#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp5___width 1
668#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp5___bit 27
669#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp6___lsb 28
670#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp6___width 1
671#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp6___bit 28
672#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp7___lsb 29
673#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp7___width 1
674#define reg_iop_sw_cpu_rw_intr1_mask___trigger_grp7___bit 29
675#define reg_iop_sw_cpu_rw_intr1_mask___timer_grp0___lsb 30
676#define reg_iop_sw_cpu_rw_intr1_mask___timer_grp0___width 1
677#define reg_iop_sw_cpu_rw_intr1_mask___timer_grp0___bit 30
678#define reg_iop_sw_cpu_rw_intr1_mask___timer_grp1___lsb 31
679#define reg_iop_sw_cpu_rw_intr1_mask___timer_grp1___width 1
680#define reg_iop_sw_cpu_rw_intr1_mask___timer_grp1___bit 31
681#define reg_iop_sw_cpu_rw_intr1_mask_offset 92
682
683/* Register rw_ack_intr1, scope iop_sw_cpu, type rw */
684#define reg_iop_sw_cpu_rw_ack_intr1___mpu_16___lsb 0
685#define reg_iop_sw_cpu_rw_ack_intr1___mpu_16___width 1
686#define reg_iop_sw_cpu_rw_ack_intr1___mpu_16___bit 0
687#define reg_iop_sw_cpu_rw_ack_intr1___mpu_17___lsb 1
688#define reg_iop_sw_cpu_rw_ack_intr1___mpu_17___width 1
689#define reg_iop_sw_cpu_rw_ack_intr1___mpu_17___bit 1
690#define reg_iop_sw_cpu_rw_ack_intr1___mpu_18___lsb 2
691#define reg_iop_sw_cpu_rw_ack_intr1___mpu_18___width 1
692#define reg_iop_sw_cpu_rw_ack_intr1___mpu_18___bit 2
693#define reg_iop_sw_cpu_rw_ack_intr1___mpu_19___lsb 3
694#define reg_iop_sw_cpu_rw_ack_intr1___mpu_19___width 1
695#define reg_iop_sw_cpu_rw_ack_intr1___mpu_19___bit 3
696#define reg_iop_sw_cpu_rw_ack_intr1___mpu_20___lsb 4
697#define reg_iop_sw_cpu_rw_ack_intr1___mpu_20___width 1
698#define reg_iop_sw_cpu_rw_ack_intr1___mpu_20___bit 4
699#define reg_iop_sw_cpu_rw_ack_intr1___mpu_21___lsb 5
700#define reg_iop_sw_cpu_rw_ack_intr1___mpu_21___width 1
701#define reg_iop_sw_cpu_rw_ack_intr1___mpu_21___bit 5
702#define reg_iop_sw_cpu_rw_ack_intr1___mpu_22___lsb 6
703#define reg_iop_sw_cpu_rw_ack_intr1___mpu_22___width 1
704#define reg_iop_sw_cpu_rw_ack_intr1___mpu_22___bit 6
705#define reg_iop_sw_cpu_rw_ack_intr1___mpu_23___lsb 7
706#define reg_iop_sw_cpu_rw_ack_intr1___mpu_23___width 1
707#define reg_iop_sw_cpu_rw_ack_intr1___mpu_23___bit 7
708#define reg_iop_sw_cpu_rw_ack_intr1___mpu_24___lsb 8
709#define reg_iop_sw_cpu_rw_ack_intr1___mpu_24___width 1
710#define reg_iop_sw_cpu_rw_ack_intr1___mpu_24___bit 8
711#define reg_iop_sw_cpu_rw_ack_intr1___mpu_25___lsb 9
712#define reg_iop_sw_cpu_rw_ack_intr1___mpu_25___width 1
713#define reg_iop_sw_cpu_rw_ack_intr1___mpu_25___bit 9
714#define reg_iop_sw_cpu_rw_ack_intr1___mpu_26___lsb 10
715#define reg_iop_sw_cpu_rw_ack_intr1___mpu_26___width 1
716#define reg_iop_sw_cpu_rw_ack_intr1___mpu_26___bit 10
717#define reg_iop_sw_cpu_rw_ack_intr1___mpu_27___lsb 11
718#define reg_iop_sw_cpu_rw_ack_intr1___mpu_27___width 1
719#define reg_iop_sw_cpu_rw_ack_intr1___mpu_27___bit 11
720#define reg_iop_sw_cpu_rw_ack_intr1___mpu_28___lsb 12
721#define reg_iop_sw_cpu_rw_ack_intr1___mpu_28___width 1
722#define reg_iop_sw_cpu_rw_ack_intr1___mpu_28___bit 12
723#define reg_iop_sw_cpu_rw_ack_intr1___mpu_29___lsb 13
724#define reg_iop_sw_cpu_rw_ack_intr1___mpu_29___width 1
725#define reg_iop_sw_cpu_rw_ack_intr1___mpu_29___bit 13
726#define reg_iop_sw_cpu_rw_ack_intr1___mpu_30___lsb 14
727#define reg_iop_sw_cpu_rw_ack_intr1___mpu_30___width 1
728#define reg_iop_sw_cpu_rw_ack_intr1___mpu_30___bit 14
729#define reg_iop_sw_cpu_rw_ack_intr1___mpu_31___lsb 15
730#define reg_iop_sw_cpu_rw_ack_intr1___mpu_31___width 1
731#define reg_iop_sw_cpu_rw_ack_intr1___mpu_31___bit 15
732#define reg_iop_sw_cpu_rw_ack_intr1_offset 96
733
734/* Register r_intr1, scope iop_sw_cpu, type r */
735#define reg_iop_sw_cpu_r_intr1___mpu_16___lsb 0
736#define reg_iop_sw_cpu_r_intr1___mpu_16___width 1
737#define reg_iop_sw_cpu_r_intr1___mpu_16___bit 0
738#define reg_iop_sw_cpu_r_intr1___mpu_17___lsb 1
739#define reg_iop_sw_cpu_r_intr1___mpu_17___width 1
740#define reg_iop_sw_cpu_r_intr1___mpu_17___bit 1
741#define reg_iop_sw_cpu_r_intr1___mpu_18___lsb 2
742#define reg_iop_sw_cpu_r_intr1___mpu_18___width 1
743#define reg_iop_sw_cpu_r_intr1___mpu_18___bit 2
744#define reg_iop_sw_cpu_r_intr1___mpu_19___lsb 3
745#define reg_iop_sw_cpu_r_intr1___mpu_19___width 1
746#define reg_iop_sw_cpu_r_intr1___mpu_19___bit 3
747#define reg_iop_sw_cpu_r_intr1___mpu_20___lsb 4
748#define reg_iop_sw_cpu_r_intr1___mpu_20___width 1
749#define reg_iop_sw_cpu_r_intr1___mpu_20___bit 4
750#define reg_iop_sw_cpu_r_intr1___mpu_21___lsb 5
751#define reg_iop_sw_cpu_r_intr1___mpu_21___width 1
752#define reg_iop_sw_cpu_r_intr1___mpu_21___bit 5
753#define reg_iop_sw_cpu_r_intr1___mpu_22___lsb 6
754#define reg_iop_sw_cpu_r_intr1___mpu_22___width 1
755#define reg_iop_sw_cpu_r_intr1___mpu_22___bit 6
756#define reg_iop_sw_cpu_r_intr1___mpu_23___lsb 7
757#define reg_iop_sw_cpu_r_intr1___mpu_23___width 1
758#define reg_iop_sw_cpu_r_intr1___mpu_23___bit 7
759#define reg_iop_sw_cpu_r_intr1___mpu_24___lsb 8
760#define reg_iop_sw_cpu_r_intr1___mpu_24___width 1
761#define reg_iop_sw_cpu_r_intr1___mpu_24___bit 8
762#define reg_iop_sw_cpu_r_intr1___mpu_25___lsb 9
763#define reg_iop_sw_cpu_r_intr1___mpu_25___width 1
764#define reg_iop_sw_cpu_r_intr1___mpu_25___bit 9
765#define reg_iop_sw_cpu_r_intr1___mpu_26___lsb 10
766#define reg_iop_sw_cpu_r_intr1___mpu_26___width 1
767#define reg_iop_sw_cpu_r_intr1___mpu_26___bit 10
768#define reg_iop_sw_cpu_r_intr1___mpu_27___lsb 11
769#define reg_iop_sw_cpu_r_intr1___mpu_27___width 1
770#define reg_iop_sw_cpu_r_intr1___mpu_27___bit 11
771#define reg_iop_sw_cpu_r_intr1___mpu_28___lsb 12
772#define reg_iop_sw_cpu_r_intr1___mpu_28___width 1
773#define reg_iop_sw_cpu_r_intr1___mpu_28___bit 12
774#define reg_iop_sw_cpu_r_intr1___mpu_29___lsb 13
775#define reg_iop_sw_cpu_r_intr1___mpu_29___width 1
776#define reg_iop_sw_cpu_r_intr1___mpu_29___bit 13
777#define reg_iop_sw_cpu_r_intr1___mpu_30___lsb 14
778#define reg_iop_sw_cpu_r_intr1___mpu_30___width 1
779#define reg_iop_sw_cpu_r_intr1___mpu_30___bit 14
780#define reg_iop_sw_cpu_r_intr1___mpu_31___lsb 15
781#define reg_iop_sw_cpu_r_intr1___mpu_31___width 1
782#define reg_iop_sw_cpu_r_intr1___mpu_31___bit 15
783#define reg_iop_sw_cpu_r_intr1___dmc_in___lsb 16
784#define reg_iop_sw_cpu_r_intr1___dmc_in___width 1
785#define reg_iop_sw_cpu_r_intr1___dmc_in___bit 16
786#define reg_iop_sw_cpu_r_intr1___dmc_out___lsb 17
787#define reg_iop_sw_cpu_r_intr1___dmc_out___width 1
788#define reg_iop_sw_cpu_r_intr1___dmc_out___bit 17
789#define reg_iop_sw_cpu_r_intr1___fifo_in___lsb 18
790#define reg_iop_sw_cpu_r_intr1___fifo_in___width 1
791#define reg_iop_sw_cpu_r_intr1___fifo_in___bit 18
792#define reg_iop_sw_cpu_r_intr1___fifo_out___lsb 19
793#define reg_iop_sw_cpu_r_intr1___fifo_out___width 1
794#define reg_iop_sw_cpu_r_intr1___fifo_out___bit 19
795#define reg_iop_sw_cpu_r_intr1___fifo_in_extra___lsb 20
796#define reg_iop_sw_cpu_r_intr1___fifo_in_extra___width 1
797#define reg_iop_sw_cpu_r_intr1___fifo_in_extra___bit 20
798#define reg_iop_sw_cpu_r_intr1___fifo_out_extra___lsb 21
799#define reg_iop_sw_cpu_r_intr1___fifo_out_extra___width 1
800#define reg_iop_sw_cpu_r_intr1___fifo_out_extra___bit 21
801#define reg_iop_sw_cpu_r_intr1___trigger_grp0___lsb 22
802#define reg_iop_sw_cpu_r_intr1___trigger_grp0___width 1
803#define reg_iop_sw_cpu_r_intr1___trigger_grp0___bit 22
804#define reg_iop_sw_cpu_r_intr1___trigger_grp1___lsb 23
805#define reg_iop_sw_cpu_r_intr1___trigger_grp1___width 1
806#define reg_iop_sw_cpu_r_intr1___trigger_grp1___bit 23
807#define reg_iop_sw_cpu_r_intr1___trigger_grp2___lsb 24
808#define reg_iop_sw_cpu_r_intr1___trigger_grp2___width 1
809#define reg_iop_sw_cpu_r_intr1___trigger_grp2___bit 24
810#define reg_iop_sw_cpu_r_intr1___trigger_grp3___lsb 25
811#define reg_iop_sw_cpu_r_intr1___trigger_grp3___width 1
812#define reg_iop_sw_cpu_r_intr1___trigger_grp3___bit 25
813#define reg_iop_sw_cpu_r_intr1___trigger_grp4___lsb 26
814#define reg_iop_sw_cpu_r_intr1___trigger_grp4___width 1
815#define reg_iop_sw_cpu_r_intr1___trigger_grp4___bit 26
816#define reg_iop_sw_cpu_r_intr1___trigger_grp5___lsb 27
817#define reg_iop_sw_cpu_r_intr1___trigger_grp5___width 1
818#define reg_iop_sw_cpu_r_intr1___trigger_grp5___bit 27
819#define reg_iop_sw_cpu_r_intr1___trigger_grp6___lsb 28
820#define reg_iop_sw_cpu_r_intr1___trigger_grp6___width 1
821#define reg_iop_sw_cpu_r_intr1___trigger_grp6___bit 28
822#define reg_iop_sw_cpu_r_intr1___trigger_grp7___lsb 29
823#define reg_iop_sw_cpu_r_intr1___trigger_grp7___width 1
824#define reg_iop_sw_cpu_r_intr1___trigger_grp7___bit 29
825#define reg_iop_sw_cpu_r_intr1___timer_grp0___lsb 30
826#define reg_iop_sw_cpu_r_intr1___timer_grp0___width 1
827#define reg_iop_sw_cpu_r_intr1___timer_grp0___bit 30
828#define reg_iop_sw_cpu_r_intr1___timer_grp1___lsb 31
829#define reg_iop_sw_cpu_r_intr1___timer_grp1___width 1
830#define reg_iop_sw_cpu_r_intr1___timer_grp1___bit 31
831#define reg_iop_sw_cpu_r_intr1_offset 100
832
833/* Register r_masked_intr1, scope iop_sw_cpu, type r */
834#define reg_iop_sw_cpu_r_masked_intr1___mpu_16___lsb 0
835#define reg_iop_sw_cpu_r_masked_intr1___mpu_16___width 1
836#define reg_iop_sw_cpu_r_masked_intr1___mpu_16___bit 0
837#define reg_iop_sw_cpu_r_masked_intr1___mpu_17___lsb 1
838#define reg_iop_sw_cpu_r_masked_intr1___mpu_17___width 1
839#define reg_iop_sw_cpu_r_masked_intr1___mpu_17___bit 1
840#define reg_iop_sw_cpu_r_masked_intr1___mpu_18___lsb 2
841#define reg_iop_sw_cpu_r_masked_intr1___mpu_18___width 1
842#define reg_iop_sw_cpu_r_masked_intr1___mpu_18___bit 2
843#define reg_iop_sw_cpu_r_masked_intr1___mpu_19___lsb 3
844#define reg_iop_sw_cpu_r_masked_intr1___mpu_19___width 1
845#define reg_iop_sw_cpu_r_masked_intr1___mpu_19___bit 3
846#define reg_iop_sw_cpu_r_masked_intr1___mpu_20___lsb 4
847#define reg_iop_sw_cpu_r_masked_intr1___mpu_20___width 1
848#define reg_iop_sw_cpu_r_masked_intr1___mpu_20___bit 4
849#define reg_iop_sw_cpu_r_masked_intr1___mpu_21___lsb 5
850#define reg_iop_sw_cpu_r_masked_intr1___mpu_21___width 1
851#define reg_iop_sw_cpu_r_masked_intr1___mpu_21___bit 5
852#define reg_iop_sw_cpu_r_masked_intr1___mpu_22___lsb 6
853#define reg_iop_sw_cpu_r_masked_intr1___mpu_22___width 1
854#define reg_iop_sw_cpu_r_masked_intr1___mpu_22___bit 6
855#define reg_iop_sw_cpu_r_masked_intr1___mpu_23___lsb 7
856#define reg_iop_sw_cpu_r_masked_intr1___mpu_23___width 1
857#define reg_iop_sw_cpu_r_masked_intr1___mpu_23___bit 7
858#define reg_iop_sw_cpu_r_masked_intr1___mpu_24___lsb 8
859#define reg_iop_sw_cpu_r_masked_intr1___mpu_24___width 1
860#define reg_iop_sw_cpu_r_masked_intr1___mpu_24___bit 8
861#define reg_iop_sw_cpu_r_masked_intr1___mpu_25___lsb 9
862#define reg_iop_sw_cpu_r_masked_intr1___mpu_25___width 1
863#define reg_iop_sw_cpu_r_masked_intr1___mpu_25___bit 9
864#define reg_iop_sw_cpu_r_masked_intr1___mpu_26___lsb 10
865#define reg_iop_sw_cpu_r_masked_intr1___mpu_26___width 1
866#define reg_iop_sw_cpu_r_masked_intr1___mpu_26___bit 10
867#define reg_iop_sw_cpu_r_masked_intr1___mpu_27___lsb 11
868#define reg_iop_sw_cpu_r_masked_intr1___mpu_27___width 1
869#define reg_iop_sw_cpu_r_masked_intr1___mpu_27___bit 11
870#define reg_iop_sw_cpu_r_masked_intr1___mpu_28___lsb 12
871#define reg_iop_sw_cpu_r_masked_intr1___mpu_28___width 1
872#define reg_iop_sw_cpu_r_masked_intr1___mpu_28___bit 12
873#define reg_iop_sw_cpu_r_masked_intr1___mpu_29___lsb 13
874#define reg_iop_sw_cpu_r_masked_intr1___mpu_29___width 1
875#define reg_iop_sw_cpu_r_masked_intr1___mpu_29___bit 13
876#define reg_iop_sw_cpu_r_masked_intr1___mpu_30___lsb 14
877#define reg_iop_sw_cpu_r_masked_intr1___mpu_30___width 1
878#define reg_iop_sw_cpu_r_masked_intr1___mpu_30___bit 14
879#define reg_iop_sw_cpu_r_masked_intr1___mpu_31___lsb 15
880#define reg_iop_sw_cpu_r_masked_intr1___mpu_31___width 1
881#define reg_iop_sw_cpu_r_masked_intr1___mpu_31___bit 15
882#define reg_iop_sw_cpu_r_masked_intr1___dmc_in___lsb 16
883#define reg_iop_sw_cpu_r_masked_intr1___dmc_in___width 1
884#define reg_iop_sw_cpu_r_masked_intr1___dmc_in___bit 16
885#define reg_iop_sw_cpu_r_masked_intr1___dmc_out___lsb 17
886#define reg_iop_sw_cpu_r_masked_intr1___dmc_out___width 1
887#define reg_iop_sw_cpu_r_masked_intr1___dmc_out___bit 17
888#define reg_iop_sw_cpu_r_masked_intr1___fifo_in___lsb 18
889#define reg_iop_sw_cpu_r_masked_intr1___fifo_in___width 1
890#define reg_iop_sw_cpu_r_masked_intr1___fifo_in___bit 18
891#define reg_iop_sw_cpu_r_masked_intr1___fifo_out___lsb 19
892#define reg_iop_sw_cpu_r_masked_intr1___fifo_out___width 1
893#define reg_iop_sw_cpu_r_masked_intr1___fifo_out___bit 19
894#define reg_iop_sw_cpu_r_masked_intr1___fifo_in_extra___lsb 20
895#define reg_iop_sw_cpu_r_masked_intr1___fifo_in_extra___width 1
896#define reg_iop_sw_cpu_r_masked_intr1___fifo_in_extra___bit 20
897#define reg_iop_sw_cpu_r_masked_intr1___fifo_out_extra___lsb 21
898#define reg_iop_sw_cpu_r_masked_intr1___fifo_out_extra___width 1
899#define reg_iop_sw_cpu_r_masked_intr1___fifo_out_extra___bit 21
900#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp0___lsb 22
901#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp0___width 1
902#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp0___bit 22
903#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp1___lsb 23
904#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp1___width 1
905#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp1___bit 23
906#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp2___lsb 24
907#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp2___width 1
908#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp2___bit 24
909#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp3___lsb 25
910#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp3___width 1
911#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp3___bit 25
912#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp4___lsb 26
913#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp4___width 1
914#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp4___bit 26
915#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp5___lsb 27
916#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp5___width 1
917#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp5___bit 27
918#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp6___lsb 28
919#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp6___width 1
920#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp6___bit 28
921#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp7___lsb 29
922#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp7___width 1
923#define reg_iop_sw_cpu_r_masked_intr1___trigger_grp7___bit 29
924#define reg_iop_sw_cpu_r_masked_intr1___timer_grp0___lsb 30
925#define reg_iop_sw_cpu_r_masked_intr1___timer_grp0___width 1
926#define reg_iop_sw_cpu_r_masked_intr1___timer_grp0___bit 30
927#define reg_iop_sw_cpu_r_masked_intr1___timer_grp1___lsb 31
928#define reg_iop_sw_cpu_r_masked_intr1___timer_grp1___width 1
929#define reg_iop_sw_cpu_r_masked_intr1___timer_grp1___bit 31
930#define reg_iop_sw_cpu_r_masked_intr1_offset 104
931
932
933/* Constants */
934#define regk_iop_sw_cpu_copy 0x00000000
935#define regk_iop_sw_cpu_no 0x00000000
936#define regk_iop_sw_cpu_rd 0x00000002
937#define regk_iop_sw_cpu_reg_copy 0x00000001
938#define regk_iop_sw_cpu_rw_bus_clr_mask_default 0x00000000
939#define regk_iop_sw_cpu_rw_bus_oe_clr_mask_default 0x00000000
940#define regk_iop_sw_cpu_rw_bus_oe_set_mask_default 0x00000000
941#define regk_iop_sw_cpu_rw_bus_set_mask_default 0x00000000
942#define regk_iop_sw_cpu_rw_gio_clr_mask_default 0x00000000
943#define regk_iop_sw_cpu_rw_gio_oe_clr_mask_default 0x00000000
944#define regk_iop_sw_cpu_rw_gio_oe_set_mask_default 0x00000000
945#define regk_iop_sw_cpu_rw_gio_set_mask_default 0x00000000
946#define regk_iop_sw_cpu_rw_intr0_mask_default 0x00000000
947#define regk_iop_sw_cpu_rw_intr1_mask_default 0x00000000
948#define regk_iop_sw_cpu_wr 0x00000003
949#define regk_iop_sw_cpu_yes 0x00000001
950#endif /* __iop_sw_cpu_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_mpu_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_mpu_defs_asm.h
new file mode 100644
index 000000000000..ffcc83b22d21
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_mpu_defs_asm.h
@@ -0,0 +1,1086 @@
1#ifndef __iop_sw_mpu_defs_asm_h
2#define __iop_sw_mpu_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_sw_mpu.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile iop_sw_mpu_defs_asm.h iop_sw_mpu.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53/* Register rw_sw_cfg_owner, scope iop_sw_mpu, type rw */
54#define reg_iop_sw_mpu_rw_sw_cfg_owner___cfg___lsb 0
55#define reg_iop_sw_mpu_rw_sw_cfg_owner___cfg___width 2
56#define reg_iop_sw_mpu_rw_sw_cfg_owner_offset 0
57
58/* Register r_spu_trace, scope iop_sw_mpu, type r */
59#define reg_iop_sw_mpu_r_spu_trace_offset 4
60
61/* Register r_spu_fsm_trace, scope iop_sw_mpu, type r */
62#define reg_iop_sw_mpu_r_spu_fsm_trace_offset 8
63
64/* Register rw_mc_ctrl, scope iop_sw_mpu, type rw */
65#define reg_iop_sw_mpu_rw_mc_ctrl___keep_owner___lsb 0
66#define reg_iop_sw_mpu_rw_mc_ctrl___keep_owner___width 1
67#define reg_iop_sw_mpu_rw_mc_ctrl___keep_owner___bit 0
68#define reg_iop_sw_mpu_rw_mc_ctrl___cmd___lsb 1
69#define reg_iop_sw_mpu_rw_mc_ctrl___cmd___width 2
70#define reg_iop_sw_mpu_rw_mc_ctrl___size___lsb 3
71#define reg_iop_sw_mpu_rw_mc_ctrl___size___width 3
72#define reg_iop_sw_mpu_rw_mc_ctrl___wr_spu_mem___lsb 6
73#define reg_iop_sw_mpu_rw_mc_ctrl___wr_spu_mem___width 1
74#define reg_iop_sw_mpu_rw_mc_ctrl___wr_spu_mem___bit 6
75#define reg_iop_sw_mpu_rw_mc_ctrl_offset 12
76
77/* Register rw_mc_data, scope iop_sw_mpu, type rw */
78#define reg_iop_sw_mpu_rw_mc_data___val___lsb 0
79#define reg_iop_sw_mpu_rw_mc_data___val___width 32
80#define reg_iop_sw_mpu_rw_mc_data_offset 16
81
82/* Register rw_mc_addr, scope iop_sw_mpu, type rw */
83#define reg_iop_sw_mpu_rw_mc_addr_offset 20
84
85/* Register rs_mc_data, scope iop_sw_mpu, type rs */
86#define reg_iop_sw_mpu_rs_mc_data_offset 24
87
88/* Register r_mc_data, scope iop_sw_mpu, type r */
89#define reg_iop_sw_mpu_r_mc_data_offset 28
90
91/* Register r_mc_stat, scope iop_sw_mpu, type r */
92#define reg_iop_sw_mpu_r_mc_stat___busy_cpu___lsb 0
93#define reg_iop_sw_mpu_r_mc_stat___busy_cpu___width 1
94#define reg_iop_sw_mpu_r_mc_stat___busy_cpu___bit 0
95#define reg_iop_sw_mpu_r_mc_stat___busy_mpu___lsb 1
96#define reg_iop_sw_mpu_r_mc_stat___busy_mpu___width 1
97#define reg_iop_sw_mpu_r_mc_stat___busy_mpu___bit 1
98#define reg_iop_sw_mpu_r_mc_stat___busy_spu___lsb 2
99#define reg_iop_sw_mpu_r_mc_stat___busy_spu___width 1
100#define reg_iop_sw_mpu_r_mc_stat___busy_spu___bit 2
101#define reg_iop_sw_mpu_r_mc_stat___owned_by_cpu___lsb 3
102#define reg_iop_sw_mpu_r_mc_stat___owned_by_cpu___width 1
103#define reg_iop_sw_mpu_r_mc_stat___owned_by_cpu___bit 3
104#define reg_iop_sw_mpu_r_mc_stat___owned_by_mpu___lsb 4
105#define reg_iop_sw_mpu_r_mc_stat___owned_by_mpu___width 1
106#define reg_iop_sw_mpu_r_mc_stat___owned_by_mpu___bit 4
107#define reg_iop_sw_mpu_r_mc_stat___owned_by_spu___lsb 5
108#define reg_iop_sw_mpu_r_mc_stat___owned_by_spu___width 1
109#define reg_iop_sw_mpu_r_mc_stat___owned_by_spu___bit 5
110#define reg_iop_sw_mpu_r_mc_stat_offset 32
111
112/* Register rw_bus_clr_mask, scope iop_sw_mpu, type rw */
113#define reg_iop_sw_mpu_rw_bus_clr_mask___byte0___lsb 0
114#define reg_iop_sw_mpu_rw_bus_clr_mask___byte0___width 8
115#define reg_iop_sw_mpu_rw_bus_clr_mask___byte1___lsb 8
116#define reg_iop_sw_mpu_rw_bus_clr_mask___byte1___width 8
117#define reg_iop_sw_mpu_rw_bus_clr_mask___byte2___lsb 16
118#define reg_iop_sw_mpu_rw_bus_clr_mask___byte2___width 8
119#define reg_iop_sw_mpu_rw_bus_clr_mask___byte3___lsb 24
120#define reg_iop_sw_mpu_rw_bus_clr_mask___byte3___width 8
121#define reg_iop_sw_mpu_rw_bus_clr_mask_offset 36
122
123/* Register rw_bus_set_mask, scope iop_sw_mpu, type rw */
124#define reg_iop_sw_mpu_rw_bus_set_mask___byte0___lsb 0
125#define reg_iop_sw_mpu_rw_bus_set_mask___byte0___width 8
126#define reg_iop_sw_mpu_rw_bus_set_mask___byte1___lsb 8
127#define reg_iop_sw_mpu_rw_bus_set_mask___byte1___width 8
128#define reg_iop_sw_mpu_rw_bus_set_mask___byte2___lsb 16
129#define reg_iop_sw_mpu_rw_bus_set_mask___byte2___width 8
130#define reg_iop_sw_mpu_rw_bus_set_mask___byte3___lsb 24
131#define reg_iop_sw_mpu_rw_bus_set_mask___byte3___width 8
132#define reg_iop_sw_mpu_rw_bus_set_mask_offset 40
133
134/* Register rw_bus_oe_clr_mask, scope iop_sw_mpu, type rw */
135#define reg_iop_sw_mpu_rw_bus_oe_clr_mask___byte0___lsb 0
136#define reg_iop_sw_mpu_rw_bus_oe_clr_mask___byte0___width 1
137#define reg_iop_sw_mpu_rw_bus_oe_clr_mask___byte0___bit 0
138#define reg_iop_sw_mpu_rw_bus_oe_clr_mask___byte1___lsb 1
139#define reg_iop_sw_mpu_rw_bus_oe_clr_mask___byte1___width 1
140#define reg_iop_sw_mpu_rw_bus_oe_clr_mask___byte1___bit 1
141#define reg_iop_sw_mpu_rw_bus_oe_clr_mask___byte2___lsb 2
142#define reg_iop_sw_mpu_rw_bus_oe_clr_mask___byte2___width 1
143#define reg_iop_sw_mpu_rw_bus_oe_clr_mask___byte2___bit 2
144#define reg_iop_sw_mpu_rw_bus_oe_clr_mask___byte3___lsb 3
145#define reg_iop_sw_mpu_rw_bus_oe_clr_mask___byte3___width 1
146#define reg_iop_sw_mpu_rw_bus_oe_clr_mask___byte3___bit 3
147#define reg_iop_sw_mpu_rw_bus_oe_clr_mask_offset 44
148
149/* Register rw_bus_oe_set_mask, scope iop_sw_mpu, type rw */
150#define reg_iop_sw_mpu_rw_bus_oe_set_mask___byte0___lsb 0
151#define reg_iop_sw_mpu_rw_bus_oe_set_mask___byte0___width 1
152#define reg_iop_sw_mpu_rw_bus_oe_set_mask___byte0___bit 0
153#define reg_iop_sw_mpu_rw_bus_oe_set_mask___byte1___lsb 1
154#define reg_iop_sw_mpu_rw_bus_oe_set_mask___byte1___width 1
155#define reg_iop_sw_mpu_rw_bus_oe_set_mask___byte1___bit 1
156#define reg_iop_sw_mpu_rw_bus_oe_set_mask___byte2___lsb 2
157#define reg_iop_sw_mpu_rw_bus_oe_set_mask___byte2___width 1
158#define reg_iop_sw_mpu_rw_bus_oe_set_mask___byte2___bit 2
159#define reg_iop_sw_mpu_rw_bus_oe_set_mask___byte3___lsb 3
160#define reg_iop_sw_mpu_rw_bus_oe_set_mask___byte3___width 1
161#define reg_iop_sw_mpu_rw_bus_oe_set_mask___byte3___bit 3
162#define reg_iop_sw_mpu_rw_bus_oe_set_mask_offset 48
163
164/* Register r_bus_in, scope iop_sw_mpu, type r */
165#define reg_iop_sw_mpu_r_bus_in_offset 52
166
167/* Register rw_gio_clr_mask, scope iop_sw_mpu, type rw */
168#define reg_iop_sw_mpu_rw_gio_clr_mask___val___lsb 0
169#define reg_iop_sw_mpu_rw_gio_clr_mask___val___width 32
170#define reg_iop_sw_mpu_rw_gio_clr_mask_offset 56
171
172/* Register rw_gio_set_mask, scope iop_sw_mpu, type rw */
173#define reg_iop_sw_mpu_rw_gio_set_mask___val___lsb 0
174#define reg_iop_sw_mpu_rw_gio_set_mask___val___width 32
175#define reg_iop_sw_mpu_rw_gio_set_mask_offset 60
176
177/* Register rw_gio_oe_clr_mask, scope iop_sw_mpu, type rw */
178#define reg_iop_sw_mpu_rw_gio_oe_clr_mask___val___lsb 0
179#define reg_iop_sw_mpu_rw_gio_oe_clr_mask___val___width 32
180#define reg_iop_sw_mpu_rw_gio_oe_clr_mask_offset 64
181
182/* Register rw_gio_oe_set_mask, scope iop_sw_mpu, type rw */
183#define reg_iop_sw_mpu_rw_gio_oe_set_mask___val___lsb 0
184#define reg_iop_sw_mpu_rw_gio_oe_set_mask___val___width 32
185#define reg_iop_sw_mpu_rw_gio_oe_set_mask_offset 68
186
187/* Register r_gio_in, scope iop_sw_mpu, type r */
188#define reg_iop_sw_mpu_r_gio_in_offset 72
189
190/* Register rw_cpu_intr, scope iop_sw_mpu, type rw */
191#define reg_iop_sw_mpu_rw_cpu_intr___intr0___lsb 0
192#define reg_iop_sw_mpu_rw_cpu_intr___intr0___width 1
193#define reg_iop_sw_mpu_rw_cpu_intr___intr0___bit 0
194#define reg_iop_sw_mpu_rw_cpu_intr___intr1___lsb 1
195#define reg_iop_sw_mpu_rw_cpu_intr___intr1___width 1
196#define reg_iop_sw_mpu_rw_cpu_intr___intr1___bit 1
197#define reg_iop_sw_mpu_rw_cpu_intr___intr2___lsb 2
198#define reg_iop_sw_mpu_rw_cpu_intr___intr2___width 1
199#define reg_iop_sw_mpu_rw_cpu_intr___intr2___bit 2
200#define reg_iop_sw_mpu_rw_cpu_intr___intr3___lsb 3
201#define reg_iop_sw_mpu_rw_cpu_intr___intr3___width 1
202#define reg_iop_sw_mpu_rw_cpu_intr___intr3___bit 3
203#define reg_iop_sw_mpu_rw_cpu_intr___intr4___lsb 4
204#define reg_iop_sw_mpu_rw_cpu_intr___intr4___width 1
205#define reg_iop_sw_mpu_rw_cpu_intr___intr4___bit 4
206#define reg_iop_sw_mpu_rw_cpu_intr___intr5___lsb 5
207#define reg_iop_sw_mpu_rw_cpu_intr___intr5___width 1
208#define reg_iop_sw_mpu_rw_cpu_intr___intr5___bit 5
209#define reg_iop_sw_mpu_rw_cpu_intr___intr6___lsb 6
210#define reg_iop_sw_mpu_rw_cpu_intr___intr6___width 1
211#define reg_iop_sw_mpu_rw_cpu_intr___intr6___bit 6
212#define reg_iop_sw_mpu_rw_cpu_intr___intr7___lsb 7
213#define reg_iop_sw_mpu_rw_cpu_intr___intr7___width 1
214#define reg_iop_sw_mpu_rw_cpu_intr___intr7___bit 7
215#define reg_iop_sw_mpu_rw_cpu_intr___intr8___lsb 8
216#define reg_iop_sw_mpu_rw_cpu_intr___intr8___width 1
217#define reg_iop_sw_mpu_rw_cpu_intr___intr8___bit 8
218#define reg_iop_sw_mpu_rw_cpu_intr___intr9___lsb 9
219#define reg_iop_sw_mpu_rw_cpu_intr___intr9___width 1
220#define reg_iop_sw_mpu_rw_cpu_intr___intr9___bit 9
221#define reg_iop_sw_mpu_rw_cpu_intr___intr10___lsb 10
222#define reg_iop_sw_mpu_rw_cpu_intr___intr10___width 1
223#define reg_iop_sw_mpu_rw_cpu_intr___intr10___bit 10
224#define reg_iop_sw_mpu_rw_cpu_intr___intr11___lsb 11
225#define reg_iop_sw_mpu_rw_cpu_intr___intr11___width 1
226#define reg_iop_sw_mpu_rw_cpu_intr___intr11___bit 11
227#define reg_iop_sw_mpu_rw_cpu_intr___intr12___lsb 12
228#define reg_iop_sw_mpu_rw_cpu_intr___intr12___width 1
229#define reg_iop_sw_mpu_rw_cpu_intr___intr12___bit 12
230#define reg_iop_sw_mpu_rw_cpu_intr___intr13___lsb 13
231#define reg_iop_sw_mpu_rw_cpu_intr___intr13___width 1
232#define reg_iop_sw_mpu_rw_cpu_intr___intr13___bit 13
233#define reg_iop_sw_mpu_rw_cpu_intr___intr14___lsb 14
234#define reg_iop_sw_mpu_rw_cpu_intr___intr14___width 1
235#define reg_iop_sw_mpu_rw_cpu_intr___intr14___bit 14
236#define reg_iop_sw_mpu_rw_cpu_intr___intr15___lsb 15
237#define reg_iop_sw_mpu_rw_cpu_intr___intr15___width 1
238#define reg_iop_sw_mpu_rw_cpu_intr___intr15___bit 15
239#define reg_iop_sw_mpu_rw_cpu_intr___intr16___lsb 16
240#define reg_iop_sw_mpu_rw_cpu_intr___intr16___width 1
241#define reg_iop_sw_mpu_rw_cpu_intr___intr16___bit 16
242#define reg_iop_sw_mpu_rw_cpu_intr___intr17___lsb 17
243#define reg_iop_sw_mpu_rw_cpu_intr___intr17___width 1
244#define reg_iop_sw_mpu_rw_cpu_intr___intr17___bit 17
245#define reg_iop_sw_mpu_rw_cpu_intr___intr18___lsb 18
246#define reg_iop_sw_mpu_rw_cpu_intr___intr18___width 1
247#define reg_iop_sw_mpu_rw_cpu_intr___intr18___bit 18
248#define reg_iop_sw_mpu_rw_cpu_intr___intr19___lsb 19
249#define reg_iop_sw_mpu_rw_cpu_intr___intr19___width 1
250#define reg_iop_sw_mpu_rw_cpu_intr___intr19___bit 19
251#define reg_iop_sw_mpu_rw_cpu_intr___intr20___lsb 20
252#define reg_iop_sw_mpu_rw_cpu_intr___intr20___width 1
253#define reg_iop_sw_mpu_rw_cpu_intr___intr20___bit 20
254#define reg_iop_sw_mpu_rw_cpu_intr___intr21___lsb 21
255#define reg_iop_sw_mpu_rw_cpu_intr___intr21___width 1
256#define reg_iop_sw_mpu_rw_cpu_intr___intr21___bit 21
257#define reg_iop_sw_mpu_rw_cpu_intr___intr22___lsb 22
258#define reg_iop_sw_mpu_rw_cpu_intr___intr22___width 1
259#define reg_iop_sw_mpu_rw_cpu_intr___intr22___bit 22
260#define reg_iop_sw_mpu_rw_cpu_intr___intr23___lsb 23
261#define reg_iop_sw_mpu_rw_cpu_intr___intr23___width 1
262#define reg_iop_sw_mpu_rw_cpu_intr___intr23___bit 23
263#define reg_iop_sw_mpu_rw_cpu_intr___intr24___lsb 24
264#define reg_iop_sw_mpu_rw_cpu_intr___intr24___width 1
265#define reg_iop_sw_mpu_rw_cpu_intr___intr24___bit 24
266#define reg_iop_sw_mpu_rw_cpu_intr___intr25___lsb 25
267#define reg_iop_sw_mpu_rw_cpu_intr___intr25___width 1
268#define reg_iop_sw_mpu_rw_cpu_intr___intr25___bit 25
269#define reg_iop_sw_mpu_rw_cpu_intr___intr26___lsb 26
270#define reg_iop_sw_mpu_rw_cpu_intr___intr26___width 1
271#define reg_iop_sw_mpu_rw_cpu_intr___intr26___bit 26
272#define reg_iop_sw_mpu_rw_cpu_intr___intr27___lsb 27
273#define reg_iop_sw_mpu_rw_cpu_intr___intr27___width 1
274#define reg_iop_sw_mpu_rw_cpu_intr___intr27___bit 27
275#define reg_iop_sw_mpu_rw_cpu_intr___intr28___lsb 28
276#define reg_iop_sw_mpu_rw_cpu_intr___intr28___width 1
277#define reg_iop_sw_mpu_rw_cpu_intr___intr28___bit 28
278#define reg_iop_sw_mpu_rw_cpu_intr___intr29___lsb 29
279#define reg_iop_sw_mpu_rw_cpu_intr___intr29___width 1
280#define reg_iop_sw_mpu_rw_cpu_intr___intr29___bit 29
281#define reg_iop_sw_mpu_rw_cpu_intr___intr30___lsb 30
282#define reg_iop_sw_mpu_rw_cpu_intr___intr30___width 1
283#define reg_iop_sw_mpu_rw_cpu_intr___intr30___bit 30
284#define reg_iop_sw_mpu_rw_cpu_intr___intr31___lsb 31
285#define reg_iop_sw_mpu_rw_cpu_intr___intr31___width 1
286#define reg_iop_sw_mpu_rw_cpu_intr___intr31___bit 31
287#define reg_iop_sw_mpu_rw_cpu_intr_offset 76
288
289/* Register r_cpu_intr, scope iop_sw_mpu, type r */
290#define reg_iop_sw_mpu_r_cpu_intr___intr0___lsb 0
291#define reg_iop_sw_mpu_r_cpu_intr___intr0___width 1
292#define reg_iop_sw_mpu_r_cpu_intr___intr0___bit 0
293#define reg_iop_sw_mpu_r_cpu_intr___intr1___lsb 1
294#define reg_iop_sw_mpu_r_cpu_intr___intr1___width 1
295#define reg_iop_sw_mpu_r_cpu_intr___intr1___bit 1
296#define reg_iop_sw_mpu_r_cpu_intr___intr2___lsb 2
297#define reg_iop_sw_mpu_r_cpu_intr___intr2___width 1
298#define reg_iop_sw_mpu_r_cpu_intr___intr2___bit 2
299#define reg_iop_sw_mpu_r_cpu_intr___intr3___lsb 3
300#define reg_iop_sw_mpu_r_cpu_intr___intr3___width 1
301#define reg_iop_sw_mpu_r_cpu_intr___intr3___bit 3
302#define reg_iop_sw_mpu_r_cpu_intr___intr4___lsb 4
303#define reg_iop_sw_mpu_r_cpu_intr___intr4___width 1
304#define reg_iop_sw_mpu_r_cpu_intr___intr4___bit 4
305#define reg_iop_sw_mpu_r_cpu_intr___intr5___lsb 5
306#define reg_iop_sw_mpu_r_cpu_intr___intr5___width 1
307#define reg_iop_sw_mpu_r_cpu_intr___intr5___bit 5
308#define reg_iop_sw_mpu_r_cpu_intr___intr6___lsb 6
309#define reg_iop_sw_mpu_r_cpu_intr___intr6___width 1
310#define reg_iop_sw_mpu_r_cpu_intr___intr6___bit 6
311#define reg_iop_sw_mpu_r_cpu_intr___intr7___lsb 7
312#define reg_iop_sw_mpu_r_cpu_intr___intr7___width 1
313#define reg_iop_sw_mpu_r_cpu_intr___intr7___bit 7
314#define reg_iop_sw_mpu_r_cpu_intr___intr8___lsb 8
315#define reg_iop_sw_mpu_r_cpu_intr___intr8___width 1
316#define reg_iop_sw_mpu_r_cpu_intr___intr8___bit 8
317#define reg_iop_sw_mpu_r_cpu_intr___intr9___lsb 9
318#define reg_iop_sw_mpu_r_cpu_intr___intr9___width 1
319#define reg_iop_sw_mpu_r_cpu_intr___intr9___bit 9
320#define reg_iop_sw_mpu_r_cpu_intr___intr10___lsb 10
321#define reg_iop_sw_mpu_r_cpu_intr___intr10___width 1
322#define reg_iop_sw_mpu_r_cpu_intr___intr10___bit 10
323#define reg_iop_sw_mpu_r_cpu_intr___intr11___lsb 11
324#define reg_iop_sw_mpu_r_cpu_intr___intr11___width 1
325#define reg_iop_sw_mpu_r_cpu_intr___intr11___bit 11
326#define reg_iop_sw_mpu_r_cpu_intr___intr12___lsb 12
327#define reg_iop_sw_mpu_r_cpu_intr___intr12___width 1
328#define reg_iop_sw_mpu_r_cpu_intr___intr12___bit 12
329#define reg_iop_sw_mpu_r_cpu_intr___intr13___lsb 13
330#define reg_iop_sw_mpu_r_cpu_intr___intr13___width 1
331#define reg_iop_sw_mpu_r_cpu_intr___intr13___bit 13
332#define reg_iop_sw_mpu_r_cpu_intr___intr14___lsb 14
333#define reg_iop_sw_mpu_r_cpu_intr___intr14___width 1
334#define reg_iop_sw_mpu_r_cpu_intr___intr14___bit 14
335#define reg_iop_sw_mpu_r_cpu_intr___intr15___lsb 15
336#define reg_iop_sw_mpu_r_cpu_intr___intr15___width 1
337#define reg_iop_sw_mpu_r_cpu_intr___intr15___bit 15
338#define reg_iop_sw_mpu_r_cpu_intr___intr16___lsb 16
339#define reg_iop_sw_mpu_r_cpu_intr___intr16___width 1
340#define reg_iop_sw_mpu_r_cpu_intr___intr16___bit 16
341#define reg_iop_sw_mpu_r_cpu_intr___intr17___lsb 17
342#define reg_iop_sw_mpu_r_cpu_intr___intr17___width 1
343#define reg_iop_sw_mpu_r_cpu_intr___intr17___bit 17
344#define reg_iop_sw_mpu_r_cpu_intr___intr18___lsb 18
345#define reg_iop_sw_mpu_r_cpu_intr___intr18___width 1
346#define reg_iop_sw_mpu_r_cpu_intr___intr18___bit 18
347#define reg_iop_sw_mpu_r_cpu_intr___intr19___lsb 19
348#define reg_iop_sw_mpu_r_cpu_intr___intr19___width 1
349#define reg_iop_sw_mpu_r_cpu_intr___intr19___bit 19
350#define reg_iop_sw_mpu_r_cpu_intr___intr20___lsb 20
351#define reg_iop_sw_mpu_r_cpu_intr___intr20___width 1
352#define reg_iop_sw_mpu_r_cpu_intr___intr20___bit 20
353#define reg_iop_sw_mpu_r_cpu_intr___intr21___lsb 21
354#define reg_iop_sw_mpu_r_cpu_intr___intr21___width 1
355#define reg_iop_sw_mpu_r_cpu_intr___intr21___bit 21
356#define reg_iop_sw_mpu_r_cpu_intr___intr22___lsb 22
357#define reg_iop_sw_mpu_r_cpu_intr___intr22___width 1
358#define reg_iop_sw_mpu_r_cpu_intr___intr22___bit 22
359#define reg_iop_sw_mpu_r_cpu_intr___intr23___lsb 23
360#define reg_iop_sw_mpu_r_cpu_intr___intr23___width 1
361#define reg_iop_sw_mpu_r_cpu_intr___intr23___bit 23
362#define reg_iop_sw_mpu_r_cpu_intr___intr24___lsb 24
363#define reg_iop_sw_mpu_r_cpu_intr___intr24___width 1
364#define reg_iop_sw_mpu_r_cpu_intr___intr24___bit 24
365#define reg_iop_sw_mpu_r_cpu_intr___intr25___lsb 25
366#define reg_iop_sw_mpu_r_cpu_intr___intr25___width 1
367#define reg_iop_sw_mpu_r_cpu_intr___intr25___bit 25
368#define reg_iop_sw_mpu_r_cpu_intr___intr26___lsb 26
369#define reg_iop_sw_mpu_r_cpu_intr___intr26___width 1
370#define reg_iop_sw_mpu_r_cpu_intr___intr26___bit 26
371#define reg_iop_sw_mpu_r_cpu_intr___intr27___lsb 27
372#define reg_iop_sw_mpu_r_cpu_intr___intr27___width 1
373#define reg_iop_sw_mpu_r_cpu_intr___intr27___bit 27
374#define reg_iop_sw_mpu_r_cpu_intr___intr28___lsb 28
375#define reg_iop_sw_mpu_r_cpu_intr___intr28___width 1
376#define reg_iop_sw_mpu_r_cpu_intr___intr28___bit 28
377#define reg_iop_sw_mpu_r_cpu_intr___intr29___lsb 29
378#define reg_iop_sw_mpu_r_cpu_intr___intr29___width 1
379#define reg_iop_sw_mpu_r_cpu_intr___intr29___bit 29
380#define reg_iop_sw_mpu_r_cpu_intr___intr30___lsb 30
381#define reg_iop_sw_mpu_r_cpu_intr___intr30___width 1
382#define reg_iop_sw_mpu_r_cpu_intr___intr30___bit 30
383#define reg_iop_sw_mpu_r_cpu_intr___intr31___lsb 31
384#define reg_iop_sw_mpu_r_cpu_intr___intr31___width 1
385#define reg_iop_sw_mpu_r_cpu_intr___intr31___bit 31
386#define reg_iop_sw_mpu_r_cpu_intr_offset 80
387
388/* Register rw_intr_grp0_mask, scope iop_sw_mpu, type rw */
389#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu_intr0___lsb 0
390#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu_intr0___width 1
391#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu_intr0___bit 0
392#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp0___lsb 1
393#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp0___width 1
394#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp0___bit 1
395#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp0___lsb 2
396#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp0___width 1
397#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp0___bit 2
398#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out___lsb 3
399#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out___width 1
400#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out___bit 3
401#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu_intr1___lsb 4
402#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu_intr1___width 1
403#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu_intr1___bit 4
404#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp1___lsb 5
405#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp1___width 1
406#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp1___bit 5
407#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp1___lsb 6
408#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp1___width 1
409#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp1___bit 6
410#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in___lsb 7
411#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in___width 1
412#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in___bit 7
413#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu_intr2___lsb 8
414#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu_intr2___width 1
415#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu_intr2___bit 8
416#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp2___lsb 9
417#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp2___width 1
418#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp2___bit 9
419#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out_extra___lsb 10
420#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out_extra___width 1
421#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out_extra___bit 10
422#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_out___lsb 11
423#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_out___width 1
424#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_out___bit 11
425#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu_intr3___lsb 12
426#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu_intr3___width 1
427#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu_intr3___bit 12
428#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp3___lsb 13
429#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp3___width 1
430#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp3___bit 13
431#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in_extra___lsb 14
432#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in_extra___width 1
433#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in_extra___bit 14
434#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_in___lsb 15
435#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_in___width 1
436#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_in___bit 15
437#define reg_iop_sw_mpu_rw_intr_grp0_mask_offset 84
438
439/* Register rw_ack_intr_grp0, scope iop_sw_mpu, type rw */
440#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu_intr0___lsb 0
441#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu_intr0___width 1
442#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu_intr0___bit 0
443#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu_intr1___lsb 4
444#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu_intr1___width 1
445#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu_intr1___bit 4
446#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu_intr2___lsb 8
447#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu_intr2___width 1
448#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu_intr2___bit 8
449#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu_intr3___lsb 12
450#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu_intr3___width 1
451#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu_intr3___bit 12
452#define reg_iop_sw_mpu_rw_ack_intr_grp0_offset 88
453
454/* Register r_intr_grp0, scope iop_sw_mpu, type r */
455#define reg_iop_sw_mpu_r_intr_grp0___spu_intr0___lsb 0
456#define reg_iop_sw_mpu_r_intr_grp0___spu_intr0___width 1
457#define reg_iop_sw_mpu_r_intr_grp0___spu_intr0___bit 0
458#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp0___lsb 1
459#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp0___width 1
460#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp0___bit 1
461#define reg_iop_sw_mpu_r_intr_grp0___timer_grp0___lsb 2
462#define reg_iop_sw_mpu_r_intr_grp0___timer_grp0___width 1
463#define reg_iop_sw_mpu_r_intr_grp0___timer_grp0___bit 2
464#define reg_iop_sw_mpu_r_intr_grp0___fifo_out___lsb 3
465#define reg_iop_sw_mpu_r_intr_grp0___fifo_out___width 1
466#define reg_iop_sw_mpu_r_intr_grp0___fifo_out___bit 3
467#define reg_iop_sw_mpu_r_intr_grp0___spu_intr1___lsb 4
468#define reg_iop_sw_mpu_r_intr_grp0___spu_intr1___width 1
469#define reg_iop_sw_mpu_r_intr_grp0___spu_intr1___bit 4
470#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp1___lsb 5
471#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp1___width 1
472#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp1___bit 5
473#define reg_iop_sw_mpu_r_intr_grp0___timer_grp1___lsb 6
474#define reg_iop_sw_mpu_r_intr_grp0___timer_grp1___width 1
475#define reg_iop_sw_mpu_r_intr_grp0___timer_grp1___bit 6
476#define reg_iop_sw_mpu_r_intr_grp0___fifo_in___lsb 7
477#define reg_iop_sw_mpu_r_intr_grp0___fifo_in___width 1
478#define reg_iop_sw_mpu_r_intr_grp0___fifo_in___bit 7
479#define reg_iop_sw_mpu_r_intr_grp0___spu_intr2___lsb 8
480#define reg_iop_sw_mpu_r_intr_grp0___spu_intr2___width 1
481#define reg_iop_sw_mpu_r_intr_grp0___spu_intr2___bit 8
482#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp2___lsb 9
483#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp2___width 1
484#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp2___bit 9
485#define reg_iop_sw_mpu_r_intr_grp0___fifo_out_extra___lsb 10
486#define reg_iop_sw_mpu_r_intr_grp0___fifo_out_extra___width 1
487#define reg_iop_sw_mpu_r_intr_grp0___fifo_out_extra___bit 10
488#define reg_iop_sw_mpu_r_intr_grp0___dmc_out___lsb 11
489#define reg_iop_sw_mpu_r_intr_grp0___dmc_out___width 1
490#define reg_iop_sw_mpu_r_intr_grp0___dmc_out___bit 11
491#define reg_iop_sw_mpu_r_intr_grp0___spu_intr3___lsb 12
492#define reg_iop_sw_mpu_r_intr_grp0___spu_intr3___width 1
493#define reg_iop_sw_mpu_r_intr_grp0___spu_intr3___bit 12
494#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp3___lsb 13
495#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp3___width 1
496#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp3___bit 13
497#define reg_iop_sw_mpu_r_intr_grp0___fifo_in_extra___lsb 14
498#define reg_iop_sw_mpu_r_intr_grp0___fifo_in_extra___width 1
499#define reg_iop_sw_mpu_r_intr_grp0___fifo_in_extra___bit 14
500#define reg_iop_sw_mpu_r_intr_grp0___dmc_in___lsb 15
501#define reg_iop_sw_mpu_r_intr_grp0___dmc_in___width 1
502#define reg_iop_sw_mpu_r_intr_grp0___dmc_in___bit 15
503#define reg_iop_sw_mpu_r_intr_grp0_offset 92
504
505/* Register r_masked_intr_grp0, scope iop_sw_mpu, type r */
506#define reg_iop_sw_mpu_r_masked_intr_grp0___spu_intr0___lsb 0
507#define reg_iop_sw_mpu_r_masked_intr_grp0___spu_intr0___width 1
508#define reg_iop_sw_mpu_r_masked_intr_grp0___spu_intr0___bit 0
509#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp0___lsb 1
510#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp0___width 1
511#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp0___bit 1
512#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp0___lsb 2
513#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp0___width 1
514#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp0___bit 2
515#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out___lsb 3
516#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out___width 1
517#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out___bit 3
518#define reg_iop_sw_mpu_r_masked_intr_grp0___spu_intr1___lsb 4
519#define reg_iop_sw_mpu_r_masked_intr_grp0___spu_intr1___width 1
520#define reg_iop_sw_mpu_r_masked_intr_grp0___spu_intr1___bit 4
521#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp1___lsb 5
522#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp1___width 1
523#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp1___bit 5
524#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp1___lsb 6
525#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp1___width 1
526#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp1___bit 6
527#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in___lsb 7
528#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in___width 1
529#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in___bit 7
530#define reg_iop_sw_mpu_r_masked_intr_grp0___spu_intr2___lsb 8
531#define reg_iop_sw_mpu_r_masked_intr_grp0___spu_intr2___width 1
532#define reg_iop_sw_mpu_r_masked_intr_grp0___spu_intr2___bit 8
533#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp2___lsb 9
534#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp2___width 1
535#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp2___bit 9
536#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out_extra___lsb 10
537#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out_extra___width 1
538#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out_extra___bit 10
539#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_out___lsb 11
540#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_out___width 1
541#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_out___bit 11
542#define reg_iop_sw_mpu_r_masked_intr_grp0___spu_intr3___lsb 12
543#define reg_iop_sw_mpu_r_masked_intr_grp0___spu_intr3___width 1
544#define reg_iop_sw_mpu_r_masked_intr_grp0___spu_intr3___bit 12
545#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp3___lsb 13
546#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp3___width 1
547#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp3___bit 13
548#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in_extra___lsb 14
549#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in_extra___width 1
550#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in_extra___bit 14
551#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_in___lsb 15
552#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_in___width 1
553#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_in___bit 15
554#define reg_iop_sw_mpu_r_masked_intr_grp0_offset 96
555
556/* Register rw_intr_grp1_mask, scope iop_sw_mpu, type rw */
557#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu_intr4___lsb 0
558#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu_intr4___width 1
559#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu_intr4___bit 0
560#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp4___lsb 1
561#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp4___width 1
562#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp4___bit 1
563#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out_extra___lsb 2
564#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out_extra___width 1
565#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out_extra___bit 2
566#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_out___lsb 3
567#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_out___width 1
568#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_out___bit 3
569#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu_intr5___lsb 4
570#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu_intr5___width 1
571#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu_intr5___bit 4
572#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp5___lsb 5
573#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp5___width 1
574#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp5___bit 5
575#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in_extra___lsb 6
576#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in_extra___width 1
577#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in_extra___bit 6
578#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_in___lsb 7
579#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_in___width 1
580#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_in___bit 7
581#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu_intr6___lsb 8
582#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu_intr6___width 1
583#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu_intr6___bit 8
584#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp6___lsb 9
585#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp6___width 1
586#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp6___bit 9
587#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp0___lsb 10
588#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp0___width 1
589#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp0___bit 10
590#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out___lsb 11
591#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out___width 1
592#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out___bit 11
593#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu_intr7___lsb 12
594#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu_intr7___width 1
595#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu_intr7___bit 12
596#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp7___lsb 13
597#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp7___width 1
598#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp7___bit 13
599#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp1___lsb 14
600#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp1___width 1
601#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp1___bit 14
602#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in___lsb 15
603#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in___width 1
604#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in___bit 15
605#define reg_iop_sw_mpu_rw_intr_grp1_mask_offset 100
606
607/* Register rw_ack_intr_grp1, scope iop_sw_mpu, type rw */
608#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu_intr4___lsb 0
609#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu_intr4___width 1
610#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu_intr4___bit 0
611#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu_intr5___lsb 4
612#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu_intr5___width 1
613#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu_intr5___bit 4
614#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu_intr6___lsb 8
615#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu_intr6___width 1
616#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu_intr6___bit 8
617#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu_intr7___lsb 12
618#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu_intr7___width 1
619#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu_intr7___bit 12
620#define reg_iop_sw_mpu_rw_ack_intr_grp1_offset 104
621
622/* Register r_intr_grp1, scope iop_sw_mpu, type r */
623#define reg_iop_sw_mpu_r_intr_grp1___spu_intr4___lsb 0
624#define reg_iop_sw_mpu_r_intr_grp1___spu_intr4___width 1
625#define reg_iop_sw_mpu_r_intr_grp1___spu_intr4___bit 0
626#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp4___lsb 1
627#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp4___width 1
628#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp4___bit 1
629#define reg_iop_sw_mpu_r_intr_grp1___fifo_out_extra___lsb 2
630#define reg_iop_sw_mpu_r_intr_grp1___fifo_out_extra___width 1
631#define reg_iop_sw_mpu_r_intr_grp1___fifo_out_extra___bit 2
632#define reg_iop_sw_mpu_r_intr_grp1___dmc_out___lsb 3
633#define reg_iop_sw_mpu_r_intr_grp1___dmc_out___width 1
634#define reg_iop_sw_mpu_r_intr_grp1___dmc_out___bit 3
635#define reg_iop_sw_mpu_r_intr_grp1___spu_intr5___lsb 4
636#define reg_iop_sw_mpu_r_intr_grp1___spu_intr5___width 1
637#define reg_iop_sw_mpu_r_intr_grp1___spu_intr5___bit 4
638#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp5___lsb 5
639#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp5___width 1
640#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp5___bit 5
641#define reg_iop_sw_mpu_r_intr_grp1___fifo_in_extra___lsb 6
642#define reg_iop_sw_mpu_r_intr_grp1___fifo_in_extra___width 1
643#define reg_iop_sw_mpu_r_intr_grp1___fifo_in_extra___bit 6
644#define reg_iop_sw_mpu_r_intr_grp1___dmc_in___lsb 7
645#define reg_iop_sw_mpu_r_intr_grp1___dmc_in___width 1
646#define reg_iop_sw_mpu_r_intr_grp1___dmc_in___bit 7
647#define reg_iop_sw_mpu_r_intr_grp1___spu_intr6___lsb 8
648#define reg_iop_sw_mpu_r_intr_grp1___spu_intr6___width 1
649#define reg_iop_sw_mpu_r_intr_grp1___spu_intr6___bit 8
650#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp6___lsb 9
651#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp6___width 1
652#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp6___bit 9
653#define reg_iop_sw_mpu_r_intr_grp1___timer_grp0___lsb 10
654#define reg_iop_sw_mpu_r_intr_grp1___timer_grp0___width 1
655#define reg_iop_sw_mpu_r_intr_grp1___timer_grp0___bit 10
656#define reg_iop_sw_mpu_r_intr_grp1___fifo_out___lsb 11
657#define reg_iop_sw_mpu_r_intr_grp1___fifo_out___width 1
658#define reg_iop_sw_mpu_r_intr_grp1___fifo_out___bit 11
659#define reg_iop_sw_mpu_r_intr_grp1___spu_intr7___lsb 12
660#define reg_iop_sw_mpu_r_intr_grp1___spu_intr7___width 1
661#define reg_iop_sw_mpu_r_intr_grp1___spu_intr7___bit 12
662#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp7___lsb 13
663#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp7___width 1
664#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp7___bit 13
665#define reg_iop_sw_mpu_r_intr_grp1___timer_grp1___lsb 14
666#define reg_iop_sw_mpu_r_intr_grp1___timer_grp1___width 1
667#define reg_iop_sw_mpu_r_intr_grp1___timer_grp1___bit 14
668#define reg_iop_sw_mpu_r_intr_grp1___fifo_in___lsb 15
669#define reg_iop_sw_mpu_r_intr_grp1___fifo_in___width 1
670#define reg_iop_sw_mpu_r_intr_grp1___fifo_in___bit 15
671#define reg_iop_sw_mpu_r_intr_grp1_offset 108
672
673/* Register r_masked_intr_grp1, scope iop_sw_mpu, type r */
674#define reg_iop_sw_mpu_r_masked_intr_grp1___spu_intr4___lsb 0
675#define reg_iop_sw_mpu_r_masked_intr_grp1___spu_intr4___width 1
676#define reg_iop_sw_mpu_r_masked_intr_grp1___spu_intr4___bit 0
677#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp4___lsb 1
678#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp4___width 1
679#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp4___bit 1
680#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out_extra___lsb 2
681#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out_extra___width 1
682#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out_extra___bit 2
683#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_out___lsb 3
684#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_out___width 1
685#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_out___bit 3
686#define reg_iop_sw_mpu_r_masked_intr_grp1___spu_intr5___lsb 4
687#define reg_iop_sw_mpu_r_masked_intr_grp1___spu_intr5___width 1
688#define reg_iop_sw_mpu_r_masked_intr_grp1___spu_intr5___bit 4
689#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp5___lsb 5
690#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp5___width 1
691#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp5___bit 5
692#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in_extra___lsb 6
693#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in_extra___width 1
694#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in_extra___bit 6
695#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_in___lsb 7
696#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_in___width 1
697#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_in___bit 7
698#define reg_iop_sw_mpu_r_masked_intr_grp1___spu_intr6___lsb 8
699#define reg_iop_sw_mpu_r_masked_intr_grp1___spu_intr6___width 1
700#define reg_iop_sw_mpu_r_masked_intr_grp1___spu_intr6___bit 8
701#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp6___lsb 9
702#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp6___width 1
703#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp6___bit 9
704#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp0___lsb 10
705#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp0___width 1
706#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp0___bit 10
707#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out___lsb 11
708#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out___width 1
709#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out___bit 11
710#define reg_iop_sw_mpu_r_masked_intr_grp1___spu_intr7___lsb 12
711#define reg_iop_sw_mpu_r_masked_intr_grp1___spu_intr7___width 1
712#define reg_iop_sw_mpu_r_masked_intr_grp1___spu_intr7___bit 12
713#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp7___lsb 13
714#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp7___width 1
715#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp7___bit 13
716#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp1___lsb 14
717#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp1___width 1
718#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp1___bit 14
719#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in___lsb 15
720#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in___width 1
721#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in___bit 15
722#define reg_iop_sw_mpu_r_masked_intr_grp1_offset 112
723
724/* Register rw_intr_grp2_mask, scope iop_sw_mpu, type rw */
725#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu_intr8___lsb 0
726#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu_intr8___width 1
727#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu_intr8___bit 0
728#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp0___lsb 1
729#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp0___width 1
730#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp0___bit 1
731#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp0___lsb 2
732#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp0___width 1
733#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp0___bit 2
734#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out___lsb 3
735#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out___width 1
736#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out___bit 3
737#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu_intr9___lsb 4
738#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu_intr9___width 1
739#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu_intr9___bit 4
740#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp1___lsb 5
741#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp1___width 1
742#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp1___bit 5
743#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp1___lsb 6
744#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp1___width 1
745#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp1___bit 6
746#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in___lsb 7
747#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in___width 1
748#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in___bit 7
749#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu_intr10___lsb 8
750#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu_intr10___width 1
751#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu_intr10___bit 8
752#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp2___lsb 9
753#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp2___width 1
754#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp2___bit 9
755#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out_extra___lsb 10
756#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out_extra___width 1
757#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out_extra___bit 10
758#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_out___lsb 11
759#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_out___width 1
760#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_out___bit 11
761#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu_intr11___lsb 12
762#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu_intr11___width 1
763#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu_intr11___bit 12
764#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp3___lsb 13
765#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp3___width 1
766#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp3___bit 13
767#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in_extra___lsb 14
768#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in_extra___width 1
769#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in_extra___bit 14
770#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_in___lsb 15
771#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_in___width 1
772#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_in___bit 15
773#define reg_iop_sw_mpu_rw_intr_grp2_mask_offset 116
774
775/* Register rw_ack_intr_grp2, scope iop_sw_mpu, type rw */
776#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu_intr8___lsb 0
777#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu_intr8___width 1
778#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu_intr8___bit 0
779#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu_intr9___lsb 4
780#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu_intr9___width 1
781#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu_intr9___bit 4
782#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu_intr10___lsb 8
783#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu_intr10___width 1
784#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu_intr10___bit 8
785#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu_intr11___lsb 12
786#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu_intr11___width 1
787#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu_intr11___bit 12
788#define reg_iop_sw_mpu_rw_ack_intr_grp2_offset 120
789
790/* Register r_intr_grp2, scope iop_sw_mpu, type r */
791#define reg_iop_sw_mpu_r_intr_grp2___spu_intr8___lsb 0
792#define reg_iop_sw_mpu_r_intr_grp2___spu_intr8___width 1
793#define reg_iop_sw_mpu_r_intr_grp2___spu_intr8___bit 0
794#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp0___lsb 1
795#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp0___width 1
796#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp0___bit 1
797#define reg_iop_sw_mpu_r_intr_grp2___timer_grp0___lsb 2
798#define reg_iop_sw_mpu_r_intr_grp2___timer_grp0___width 1
799#define reg_iop_sw_mpu_r_intr_grp2___timer_grp0___bit 2
800#define reg_iop_sw_mpu_r_intr_grp2___fifo_out___lsb 3
801#define reg_iop_sw_mpu_r_intr_grp2___fifo_out___width 1
802#define reg_iop_sw_mpu_r_intr_grp2___fifo_out___bit 3
803#define reg_iop_sw_mpu_r_intr_grp2___spu_intr9___lsb 4
804#define reg_iop_sw_mpu_r_intr_grp2___spu_intr9___width 1
805#define reg_iop_sw_mpu_r_intr_grp2___spu_intr9___bit 4
806#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp1___lsb 5
807#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp1___width 1
808#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp1___bit 5
809#define reg_iop_sw_mpu_r_intr_grp2___timer_grp1___lsb 6
810#define reg_iop_sw_mpu_r_intr_grp2___timer_grp1___width 1
811#define reg_iop_sw_mpu_r_intr_grp2___timer_grp1___bit 6
812#define reg_iop_sw_mpu_r_intr_grp2___fifo_in___lsb 7
813#define reg_iop_sw_mpu_r_intr_grp2___fifo_in___width 1
814#define reg_iop_sw_mpu_r_intr_grp2___fifo_in___bit 7
815#define reg_iop_sw_mpu_r_intr_grp2___spu_intr10___lsb 8
816#define reg_iop_sw_mpu_r_intr_grp2___spu_intr10___width 1
817#define reg_iop_sw_mpu_r_intr_grp2___spu_intr10___bit 8
818#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp2___lsb 9
819#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp2___width 1
820#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp2___bit 9
821#define reg_iop_sw_mpu_r_intr_grp2___fifo_out_extra___lsb 10
822#define reg_iop_sw_mpu_r_intr_grp2___fifo_out_extra___width 1
823#define reg_iop_sw_mpu_r_intr_grp2___fifo_out_extra___bit 10
824#define reg_iop_sw_mpu_r_intr_grp2___dmc_out___lsb 11
825#define reg_iop_sw_mpu_r_intr_grp2___dmc_out___width 1
826#define reg_iop_sw_mpu_r_intr_grp2___dmc_out___bit 11
827#define reg_iop_sw_mpu_r_intr_grp2___spu_intr11___lsb 12
828#define reg_iop_sw_mpu_r_intr_grp2___spu_intr11___width 1
829#define reg_iop_sw_mpu_r_intr_grp2___spu_intr11___bit 12
830#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp3___lsb 13
831#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp3___width 1
832#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp3___bit 13
833#define reg_iop_sw_mpu_r_intr_grp2___fifo_in_extra___lsb 14
834#define reg_iop_sw_mpu_r_intr_grp2___fifo_in_extra___width 1
835#define reg_iop_sw_mpu_r_intr_grp2___fifo_in_extra___bit 14
836#define reg_iop_sw_mpu_r_intr_grp2___dmc_in___lsb 15
837#define reg_iop_sw_mpu_r_intr_grp2___dmc_in___width 1
838#define reg_iop_sw_mpu_r_intr_grp2___dmc_in___bit 15
839#define reg_iop_sw_mpu_r_intr_grp2_offset 124
840
841/* Register r_masked_intr_grp2, scope iop_sw_mpu, type r */
842#define reg_iop_sw_mpu_r_masked_intr_grp2___spu_intr8___lsb 0
843#define reg_iop_sw_mpu_r_masked_intr_grp2___spu_intr8___width 1
844#define reg_iop_sw_mpu_r_masked_intr_grp2___spu_intr8___bit 0
845#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp0___lsb 1
846#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp0___width 1
847#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp0___bit 1
848#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp0___lsb 2
849#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp0___width 1
850#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp0___bit 2
851#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out___lsb 3
852#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out___width 1
853#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out___bit 3
854#define reg_iop_sw_mpu_r_masked_intr_grp2___spu_intr9___lsb 4
855#define reg_iop_sw_mpu_r_masked_intr_grp2___spu_intr9___width 1
856#define reg_iop_sw_mpu_r_masked_intr_grp2___spu_intr9___bit 4
857#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp1___lsb 5
858#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp1___width 1
859#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp1___bit 5
860#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp1___lsb 6
861#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp1___width 1
862#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp1___bit 6
863#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in___lsb 7
864#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in___width 1
865#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in___bit 7
866#define reg_iop_sw_mpu_r_masked_intr_grp2___spu_intr10___lsb 8
867#define reg_iop_sw_mpu_r_masked_intr_grp2___spu_intr10___width 1
868#define reg_iop_sw_mpu_r_masked_intr_grp2___spu_intr10___bit 8
869#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp2___lsb 9
870#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp2___width 1
871#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp2___bit 9
872#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out_extra___lsb 10
873#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out_extra___width 1
874#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out_extra___bit 10
875#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_out___lsb 11
876#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_out___width 1
877#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_out___bit 11
878#define reg_iop_sw_mpu_r_masked_intr_grp2___spu_intr11___lsb 12
879#define reg_iop_sw_mpu_r_masked_intr_grp2___spu_intr11___width 1
880#define reg_iop_sw_mpu_r_masked_intr_grp2___spu_intr11___bit 12
881#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp3___lsb 13
882#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp3___width 1
883#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp3___bit 13
884#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in_extra___lsb 14
885#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in_extra___width 1
886#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in_extra___bit 14
887#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_in___lsb 15
888#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_in___width 1
889#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_in___bit 15
890#define reg_iop_sw_mpu_r_masked_intr_grp2_offset 128
891
892/* Register rw_intr_grp3_mask, scope iop_sw_mpu, type rw */
893#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu_intr12___lsb 0
894#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu_intr12___width 1
895#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu_intr12___bit 0
896#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp4___lsb 1
897#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp4___width 1
898#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp4___bit 1
899#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out_extra___lsb 2
900#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out_extra___width 1
901#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out_extra___bit 2
902#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_out___lsb 3
903#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_out___width 1
904#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_out___bit 3
905#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu_intr13___lsb 4
906#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu_intr13___width 1
907#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu_intr13___bit 4
908#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp5___lsb 5
909#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp5___width 1
910#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp5___bit 5
911#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in_extra___lsb 6
912#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in_extra___width 1
913#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in_extra___bit 6
914#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_in___lsb 7
915#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_in___width 1
916#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_in___bit 7
917#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu_intr14___lsb 8
918#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu_intr14___width 1
919#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu_intr14___bit 8
920#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp6___lsb 9
921#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp6___width 1
922#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp6___bit 9
923#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp0___lsb 10
924#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp0___width 1
925#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp0___bit 10
926#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out___lsb 11
927#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out___width 1
928#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out___bit 11
929#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu_intr15___lsb 12
930#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu_intr15___width 1
931#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu_intr15___bit 12
932#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp7___lsb 13
933#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp7___width 1
934#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp7___bit 13
935#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp1___lsb 14
936#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp1___width 1
937#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp1___bit 14
938#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in___lsb 15
939#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in___width 1
940#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in___bit 15
941#define reg_iop_sw_mpu_rw_intr_grp3_mask_offset 132
942
943/* Register rw_ack_intr_grp3, scope iop_sw_mpu, type rw */
944#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu_intr12___lsb 0
945#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu_intr12___width 1
946#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu_intr12___bit 0
947#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu_intr13___lsb 4
948#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu_intr13___width 1
949#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu_intr13___bit 4
950#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu_intr14___lsb 8
951#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu_intr14___width 1
952#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu_intr14___bit 8
953#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu_intr15___lsb 12
954#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu_intr15___width 1
955#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu_intr15___bit 12
956#define reg_iop_sw_mpu_rw_ack_intr_grp3_offset 136
957
958/* Register r_intr_grp3, scope iop_sw_mpu, type r */
959#define reg_iop_sw_mpu_r_intr_grp3___spu_intr12___lsb 0
960#define reg_iop_sw_mpu_r_intr_grp3___spu_intr12___width 1
961#define reg_iop_sw_mpu_r_intr_grp3___spu_intr12___bit 0
962#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp4___lsb 1
963#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp4___width 1
964#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp4___bit 1
965#define reg_iop_sw_mpu_r_intr_grp3___fifo_out_extra___lsb 2
966#define reg_iop_sw_mpu_r_intr_grp3___fifo_out_extra___width 1
967#define reg_iop_sw_mpu_r_intr_grp3___fifo_out_extra___bit 2
968#define reg_iop_sw_mpu_r_intr_grp3___dmc_out___lsb 3
969#define reg_iop_sw_mpu_r_intr_grp3___dmc_out___width 1
970#define reg_iop_sw_mpu_r_intr_grp3___dmc_out___bit 3
971#define reg_iop_sw_mpu_r_intr_grp3___spu_intr13___lsb 4
972#define reg_iop_sw_mpu_r_intr_grp3___spu_intr13___width 1
973#define reg_iop_sw_mpu_r_intr_grp3___spu_intr13___bit 4
974#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp5___lsb 5
975#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp5___width 1
976#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp5___bit 5
977#define reg_iop_sw_mpu_r_intr_grp3___fifo_in_extra___lsb 6
978#define reg_iop_sw_mpu_r_intr_grp3___fifo_in_extra___width 1
979#define reg_iop_sw_mpu_r_intr_grp3___fifo_in_extra___bit 6
980#define reg_iop_sw_mpu_r_intr_grp3___dmc_in___lsb 7
981#define reg_iop_sw_mpu_r_intr_grp3___dmc_in___width 1
982#define reg_iop_sw_mpu_r_intr_grp3___dmc_in___bit 7
983#define reg_iop_sw_mpu_r_intr_grp3___spu_intr14___lsb 8
984#define reg_iop_sw_mpu_r_intr_grp3___spu_intr14___width 1
985#define reg_iop_sw_mpu_r_intr_grp3___spu_intr14___bit 8
986#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp6___lsb 9
987#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp6___width 1
988#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp6___bit 9
989#define reg_iop_sw_mpu_r_intr_grp3___timer_grp0___lsb 10
990#define reg_iop_sw_mpu_r_intr_grp3___timer_grp0___width 1
991#define reg_iop_sw_mpu_r_intr_grp3___timer_grp0___bit 10
992#define reg_iop_sw_mpu_r_intr_grp3___fifo_out___lsb 11
993#define reg_iop_sw_mpu_r_intr_grp3___fifo_out___width 1
994#define reg_iop_sw_mpu_r_intr_grp3___fifo_out___bit 11
995#define reg_iop_sw_mpu_r_intr_grp3___spu_intr15___lsb 12
996#define reg_iop_sw_mpu_r_intr_grp3___spu_intr15___width 1
997#define reg_iop_sw_mpu_r_intr_grp3___spu_intr15___bit 12
998#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp7___lsb 13
999#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp7___width 1
1000#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp7___bit 13
1001#define reg_iop_sw_mpu_r_intr_grp3___timer_grp1___lsb 14
1002#define reg_iop_sw_mpu_r_intr_grp3___timer_grp1___width 1
1003#define reg_iop_sw_mpu_r_intr_grp3___timer_grp1___bit 14
1004#define reg_iop_sw_mpu_r_intr_grp3___fifo_in___lsb 15
1005#define reg_iop_sw_mpu_r_intr_grp3___fifo_in___width 1
1006#define reg_iop_sw_mpu_r_intr_grp3___fifo_in___bit 15
1007#define reg_iop_sw_mpu_r_intr_grp3_offset 140
1008
1009/* Register r_masked_intr_grp3, scope iop_sw_mpu, type r */
1010#define reg_iop_sw_mpu_r_masked_intr_grp3___spu_intr12___lsb 0
1011#define reg_iop_sw_mpu_r_masked_intr_grp3___spu_intr12___width 1
1012#define reg_iop_sw_mpu_r_masked_intr_grp3___spu_intr12___bit 0
1013#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp4___lsb 1
1014#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp4___width 1
1015#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp4___bit 1
1016#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out_extra___lsb 2
1017#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out_extra___width 1
1018#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out_extra___bit 2
1019#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_out___lsb 3
1020#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_out___width 1
1021#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_out___bit 3
1022#define reg_iop_sw_mpu_r_masked_intr_grp3___spu_intr13___lsb 4
1023#define reg_iop_sw_mpu_r_masked_intr_grp3___spu_intr13___width 1
1024#define reg_iop_sw_mpu_r_masked_intr_grp3___spu_intr13___bit 4
1025#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp5___lsb 5
1026#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp5___width 1
1027#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp5___bit 5
1028#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in_extra___lsb 6
1029#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in_extra___width 1
1030#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in_extra___bit 6
1031#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_in___lsb 7
1032#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_in___width 1
1033#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_in___bit 7
1034#define reg_iop_sw_mpu_r_masked_intr_grp3___spu_intr14___lsb 8
1035#define reg_iop_sw_mpu_r_masked_intr_grp3___spu_intr14___width 1
1036#define reg_iop_sw_mpu_r_masked_intr_grp3___spu_intr14___bit 8
1037#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp6___lsb 9
1038#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp6___width 1
1039#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp6___bit 9
1040#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp0___lsb 10
1041#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp0___width 1
1042#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp0___bit 10
1043#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out___lsb 11
1044#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out___width 1
1045#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out___bit 11
1046#define reg_iop_sw_mpu_r_masked_intr_grp3___spu_intr15___lsb 12
1047#define reg_iop_sw_mpu_r_masked_intr_grp3___spu_intr15___width 1
1048#define reg_iop_sw_mpu_r_masked_intr_grp3___spu_intr15___bit 12
1049#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp7___lsb 13
1050#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp7___width 1
1051#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp7___bit 13
1052#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp1___lsb 14
1053#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp1___width 1
1054#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp1___bit 14
1055#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in___lsb 15
1056#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in___width 1
1057#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in___bit 15
1058#define reg_iop_sw_mpu_r_masked_intr_grp3_offset 144
1059
1060
1061/* Constants */
1062#define regk_iop_sw_mpu_copy 0x00000000
1063#define regk_iop_sw_mpu_cpu 0x00000000
1064#define regk_iop_sw_mpu_mpu 0x00000001
1065#define regk_iop_sw_mpu_no 0x00000000
1066#define regk_iop_sw_mpu_nop 0x00000000
1067#define regk_iop_sw_mpu_rd 0x00000002
1068#define regk_iop_sw_mpu_reg_copy 0x00000001
1069#define regk_iop_sw_mpu_rw_bus_clr_mask_default 0x00000000
1070#define regk_iop_sw_mpu_rw_bus_oe_clr_mask_default 0x00000000
1071#define regk_iop_sw_mpu_rw_bus_oe_set_mask_default 0x00000000
1072#define regk_iop_sw_mpu_rw_bus_set_mask_default 0x00000000
1073#define regk_iop_sw_mpu_rw_gio_clr_mask_default 0x00000000
1074#define regk_iop_sw_mpu_rw_gio_oe_clr_mask_default 0x00000000
1075#define regk_iop_sw_mpu_rw_gio_oe_set_mask_default 0x00000000
1076#define regk_iop_sw_mpu_rw_gio_set_mask_default 0x00000000
1077#define regk_iop_sw_mpu_rw_intr_grp0_mask_default 0x00000000
1078#define regk_iop_sw_mpu_rw_intr_grp1_mask_default 0x00000000
1079#define regk_iop_sw_mpu_rw_intr_grp2_mask_default 0x00000000
1080#define regk_iop_sw_mpu_rw_intr_grp3_mask_default 0x00000000
1081#define regk_iop_sw_mpu_rw_sw_cfg_owner_default 0x00000000
1082#define regk_iop_sw_mpu_set 0x00000001
1083#define regk_iop_sw_mpu_spu 0x00000002
1084#define regk_iop_sw_mpu_wr 0x00000003
1085#define regk_iop_sw_mpu_yes 0x00000001
1086#endif /* __iop_sw_mpu_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_spu_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_spu_defs_asm.h
new file mode 100644
index 000000000000..67a745338087
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_sw_spu_defs_asm.h
@@ -0,0 +1,523 @@
1#ifndef __iop_sw_spu_defs_asm_h
2#define __iop_sw_spu_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_sw_spu.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile iop_sw_spu_defs_asm.h iop_sw_spu.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53/* Register r_mpu_trace, scope iop_sw_spu, type r */
54#define reg_iop_sw_spu_r_mpu_trace_offset 0
55
56/* Register rw_mc_ctrl, scope iop_sw_spu, type rw */
57#define reg_iop_sw_spu_rw_mc_ctrl___keep_owner___lsb 0
58#define reg_iop_sw_spu_rw_mc_ctrl___keep_owner___width 1
59#define reg_iop_sw_spu_rw_mc_ctrl___keep_owner___bit 0
60#define reg_iop_sw_spu_rw_mc_ctrl___cmd___lsb 1
61#define reg_iop_sw_spu_rw_mc_ctrl___cmd___width 2
62#define reg_iop_sw_spu_rw_mc_ctrl___size___lsb 3
63#define reg_iop_sw_spu_rw_mc_ctrl___size___width 3
64#define reg_iop_sw_spu_rw_mc_ctrl___wr_spu_mem___lsb 6
65#define reg_iop_sw_spu_rw_mc_ctrl___wr_spu_mem___width 1
66#define reg_iop_sw_spu_rw_mc_ctrl___wr_spu_mem___bit 6
67#define reg_iop_sw_spu_rw_mc_ctrl_offset 4
68
69/* Register rw_mc_data, scope iop_sw_spu, type rw */
70#define reg_iop_sw_spu_rw_mc_data___val___lsb 0
71#define reg_iop_sw_spu_rw_mc_data___val___width 32
72#define reg_iop_sw_spu_rw_mc_data_offset 8
73
74/* Register rw_mc_addr, scope iop_sw_spu, type rw */
75#define reg_iop_sw_spu_rw_mc_addr_offset 12
76
77/* Register rs_mc_data, scope iop_sw_spu, type rs */
78#define reg_iop_sw_spu_rs_mc_data_offset 16
79
80/* Register r_mc_data, scope iop_sw_spu, type r */
81#define reg_iop_sw_spu_r_mc_data_offset 20
82
83/* Register r_mc_stat, scope iop_sw_spu, type r */
84#define reg_iop_sw_spu_r_mc_stat___busy_cpu___lsb 0
85#define reg_iop_sw_spu_r_mc_stat___busy_cpu___width 1
86#define reg_iop_sw_spu_r_mc_stat___busy_cpu___bit 0
87#define reg_iop_sw_spu_r_mc_stat___busy_mpu___lsb 1
88#define reg_iop_sw_spu_r_mc_stat___busy_mpu___width 1
89#define reg_iop_sw_spu_r_mc_stat___busy_mpu___bit 1
90#define reg_iop_sw_spu_r_mc_stat___busy_spu___lsb 2
91#define reg_iop_sw_spu_r_mc_stat___busy_spu___width 1
92#define reg_iop_sw_spu_r_mc_stat___busy_spu___bit 2
93#define reg_iop_sw_spu_r_mc_stat___owned_by_cpu___lsb 3
94#define reg_iop_sw_spu_r_mc_stat___owned_by_cpu___width 1
95#define reg_iop_sw_spu_r_mc_stat___owned_by_cpu___bit 3
96#define reg_iop_sw_spu_r_mc_stat___owned_by_mpu___lsb 4
97#define reg_iop_sw_spu_r_mc_stat___owned_by_mpu___width 1
98#define reg_iop_sw_spu_r_mc_stat___owned_by_mpu___bit 4
99#define reg_iop_sw_spu_r_mc_stat___owned_by_spu___lsb 5
100#define reg_iop_sw_spu_r_mc_stat___owned_by_spu___width 1
101#define reg_iop_sw_spu_r_mc_stat___owned_by_spu___bit 5
102#define reg_iop_sw_spu_r_mc_stat_offset 24
103
104/* Register rw_bus_clr_mask, scope iop_sw_spu, type rw */
105#define reg_iop_sw_spu_rw_bus_clr_mask___byte0___lsb 0
106#define reg_iop_sw_spu_rw_bus_clr_mask___byte0___width 8
107#define reg_iop_sw_spu_rw_bus_clr_mask___byte1___lsb 8
108#define reg_iop_sw_spu_rw_bus_clr_mask___byte1___width 8
109#define reg_iop_sw_spu_rw_bus_clr_mask___byte2___lsb 16
110#define reg_iop_sw_spu_rw_bus_clr_mask___byte2___width 8
111#define reg_iop_sw_spu_rw_bus_clr_mask___byte3___lsb 24
112#define reg_iop_sw_spu_rw_bus_clr_mask___byte3___width 8
113#define reg_iop_sw_spu_rw_bus_clr_mask_offset 28
114
115/* Register rw_bus_set_mask, scope iop_sw_spu, type rw */
116#define reg_iop_sw_spu_rw_bus_set_mask___byte0___lsb 0
117#define reg_iop_sw_spu_rw_bus_set_mask___byte0___width 8
118#define reg_iop_sw_spu_rw_bus_set_mask___byte1___lsb 8
119#define reg_iop_sw_spu_rw_bus_set_mask___byte1___width 8
120#define reg_iop_sw_spu_rw_bus_set_mask___byte2___lsb 16
121#define reg_iop_sw_spu_rw_bus_set_mask___byte2___width 8
122#define reg_iop_sw_spu_rw_bus_set_mask___byte3___lsb 24
123#define reg_iop_sw_spu_rw_bus_set_mask___byte3___width 8
124#define reg_iop_sw_spu_rw_bus_set_mask_offset 32
125
126/* Register rw_bus_oe_clr_mask, scope iop_sw_spu, type rw */
127#define reg_iop_sw_spu_rw_bus_oe_clr_mask___byte0___lsb 0
128#define reg_iop_sw_spu_rw_bus_oe_clr_mask___byte0___width 1
129#define reg_iop_sw_spu_rw_bus_oe_clr_mask___byte0___bit 0
130#define reg_iop_sw_spu_rw_bus_oe_clr_mask___byte1___lsb 1
131#define reg_iop_sw_spu_rw_bus_oe_clr_mask___byte1___width 1
132#define reg_iop_sw_spu_rw_bus_oe_clr_mask___byte1___bit 1
133#define reg_iop_sw_spu_rw_bus_oe_clr_mask___byte2___lsb 2
134#define reg_iop_sw_spu_rw_bus_oe_clr_mask___byte2___width 1
135#define reg_iop_sw_spu_rw_bus_oe_clr_mask___byte2___bit 2
136#define reg_iop_sw_spu_rw_bus_oe_clr_mask___byte3___lsb 3
137#define reg_iop_sw_spu_rw_bus_oe_clr_mask___byte3___width 1
138#define reg_iop_sw_spu_rw_bus_oe_clr_mask___byte3___bit 3
139#define reg_iop_sw_spu_rw_bus_oe_clr_mask_offset 36
140
141/* Register rw_bus_oe_set_mask, scope iop_sw_spu, type rw */
142#define reg_iop_sw_spu_rw_bus_oe_set_mask___byte0___lsb 0
143#define reg_iop_sw_spu_rw_bus_oe_set_mask___byte0___width 1
144#define reg_iop_sw_spu_rw_bus_oe_set_mask___byte0___bit 0
145#define reg_iop_sw_spu_rw_bus_oe_set_mask___byte1___lsb 1
146#define reg_iop_sw_spu_rw_bus_oe_set_mask___byte1___width 1
147#define reg_iop_sw_spu_rw_bus_oe_set_mask___byte1___bit 1
148#define reg_iop_sw_spu_rw_bus_oe_set_mask___byte2___lsb 2
149#define reg_iop_sw_spu_rw_bus_oe_set_mask___byte2___width 1
150#define reg_iop_sw_spu_rw_bus_oe_set_mask___byte2___bit 2
151#define reg_iop_sw_spu_rw_bus_oe_set_mask___byte3___lsb 3
152#define reg_iop_sw_spu_rw_bus_oe_set_mask___byte3___width 1
153#define reg_iop_sw_spu_rw_bus_oe_set_mask___byte3___bit 3
154#define reg_iop_sw_spu_rw_bus_oe_set_mask_offset 40
155
156/* Register r_bus_in, scope iop_sw_spu, type r */
157#define reg_iop_sw_spu_r_bus_in_offset 44
158
159/* Register rw_gio_clr_mask, scope iop_sw_spu, type rw */
160#define reg_iop_sw_spu_rw_gio_clr_mask___val___lsb 0
161#define reg_iop_sw_spu_rw_gio_clr_mask___val___width 32
162#define reg_iop_sw_spu_rw_gio_clr_mask_offset 48
163
164/* Register rw_gio_set_mask, scope iop_sw_spu, type rw */
165#define reg_iop_sw_spu_rw_gio_set_mask___val___lsb 0
166#define reg_iop_sw_spu_rw_gio_set_mask___val___width 32
167#define reg_iop_sw_spu_rw_gio_set_mask_offset 52
168
169/* Register rw_gio_oe_clr_mask, scope iop_sw_spu, type rw */
170#define reg_iop_sw_spu_rw_gio_oe_clr_mask___val___lsb 0
171#define reg_iop_sw_spu_rw_gio_oe_clr_mask___val___width 32
172#define reg_iop_sw_spu_rw_gio_oe_clr_mask_offset 56
173
174/* Register rw_gio_oe_set_mask, scope iop_sw_spu, type rw */
175#define reg_iop_sw_spu_rw_gio_oe_set_mask___val___lsb 0
176#define reg_iop_sw_spu_rw_gio_oe_set_mask___val___width 32
177#define reg_iop_sw_spu_rw_gio_oe_set_mask_offset 60
178
179/* Register r_gio_in, scope iop_sw_spu, type r */
180#define reg_iop_sw_spu_r_gio_in_offset 64
181
182/* Register rw_bus_clr_mask_lo, scope iop_sw_spu, type rw */
183#define reg_iop_sw_spu_rw_bus_clr_mask_lo___byte0___lsb 0
184#define reg_iop_sw_spu_rw_bus_clr_mask_lo___byte0___width 8
185#define reg_iop_sw_spu_rw_bus_clr_mask_lo___byte1___lsb 8
186#define reg_iop_sw_spu_rw_bus_clr_mask_lo___byte1___width 8
187#define reg_iop_sw_spu_rw_bus_clr_mask_lo_offset 68
188
189/* Register rw_bus_clr_mask_hi, scope iop_sw_spu, type rw */
190#define reg_iop_sw_spu_rw_bus_clr_mask_hi___byte2___lsb 0
191#define reg_iop_sw_spu_rw_bus_clr_mask_hi___byte2___width 8
192#define reg_iop_sw_spu_rw_bus_clr_mask_hi___byte3___lsb 8
193#define reg_iop_sw_spu_rw_bus_clr_mask_hi___byte3___width 8
194#define reg_iop_sw_spu_rw_bus_clr_mask_hi_offset 72
195
196/* Register rw_bus_set_mask_lo, scope iop_sw_spu, type rw */
197#define reg_iop_sw_spu_rw_bus_set_mask_lo___byte0___lsb 0
198#define reg_iop_sw_spu_rw_bus_set_mask_lo___byte0___width 8
199#define reg_iop_sw_spu_rw_bus_set_mask_lo___byte1___lsb 8
200#define reg_iop_sw_spu_rw_bus_set_mask_lo___byte1___width 8
201#define reg_iop_sw_spu_rw_bus_set_mask_lo_offset 76
202
203/* Register rw_bus_set_mask_hi, scope iop_sw_spu, type rw */
204#define reg_iop_sw_spu_rw_bus_set_mask_hi___byte2___lsb 0
205#define reg_iop_sw_spu_rw_bus_set_mask_hi___byte2___width 8
206#define reg_iop_sw_spu_rw_bus_set_mask_hi___byte3___lsb 8
207#define reg_iop_sw_spu_rw_bus_set_mask_hi___byte3___width 8
208#define reg_iop_sw_spu_rw_bus_set_mask_hi_offset 80
209
210/* Register rw_gio_clr_mask_lo, scope iop_sw_spu, type rw */
211#define reg_iop_sw_spu_rw_gio_clr_mask_lo___val___lsb 0
212#define reg_iop_sw_spu_rw_gio_clr_mask_lo___val___width 16
213#define reg_iop_sw_spu_rw_gio_clr_mask_lo_offset 84
214
215/* Register rw_gio_clr_mask_hi, scope iop_sw_spu, type rw */
216#define reg_iop_sw_spu_rw_gio_clr_mask_hi___val___lsb 0
217#define reg_iop_sw_spu_rw_gio_clr_mask_hi___val___width 16
218#define reg_iop_sw_spu_rw_gio_clr_mask_hi_offset 88
219
220/* Register rw_gio_set_mask_lo, scope iop_sw_spu, type rw */
221#define reg_iop_sw_spu_rw_gio_set_mask_lo___val___lsb 0
222#define reg_iop_sw_spu_rw_gio_set_mask_lo___val___width 16
223#define reg_iop_sw_spu_rw_gio_set_mask_lo_offset 92
224
225/* Register rw_gio_set_mask_hi, scope iop_sw_spu, type rw */
226#define reg_iop_sw_spu_rw_gio_set_mask_hi___val___lsb 0
227#define reg_iop_sw_spu_rw_gio_set_mask_hi___val___width 16
228#define reg_iop_sw_spu_rw_gio_set_mask_hi_offset 96
229
230/* Register rw_gio_oe_clr_mask_lo, scope iop_sw_spu, type rw */
231#define reg_iop_sw_spu_rw_gio_oe_clr_mask_lo___val___lsb 0
232#define reg_iop_sw_spu_rw_gio_oe_clr_mask_lo___val___width 16
233#define reg_iop_sw_spu_rw_gio_oe_clr_mask_lo_offset 100
234
235/* Register rw_gio_oe_clr_mask_hi, scope iop_sw_spu, type rw */
236#define reg_iop_sw_spu_rw_gio_oe_clr_mask_hi___val___lsb 0
237#define reg_iop_sw_spu_rw_gio_oe_clr_mask_hi___val___width 16
238#define reg_iop_sw_spu_rw_gio_oe_clr_mask_hi_offset 104
239
240/* Register rw_gio_oe_set_mask_lo, scope iop_sw_spu, type rw */
241#define reg_iop_sw_spu_rw_gio_oe_set_mask_lo___val___lsb 0
242#define reg_iop_sw_spu_rw_gio_oe_set_mask_lo___val___width 16
243#define reg_iop_sw_spu_rw_gio_oe_set_mask_lo_offset 108
244
245/* Register rw_gio_oe_set_mask_hi, scope iop_sw_spu, type rw */
246#define reg_iop_sw_spu_rw_gio_oe_set_mask_hi___val___lsb 0
247#define reg_iop_sw_spu_rw_gio_oe_set_mask_hi___val___width 16
248#define reg_iop_sw_spu_rw_gio_oe_set_mask_hi_offset 112
249
250/* Register rw_cpu_intr, scope iop_sw_spu, type rw */
251#define reg_iop_sw_spu_rw_cpu_intr___intr0___lsb 0
252#define reg_iop_sw_spu_rw_cpu_intr___intr0___width 1
253#define reg_iop_sw_spu_rw_cpu_intr___intr0___bit 0
254#define reg_iop_sw_spu_rw_cpu_intr___intr1___lsb 1
255#define reg_iop_sw_spu_rw_cpu_intr___intr1___width 1
256#define reg_iop_sw_spu_rw_cpu_intr___intr1___bit 1
257#define reg_iop_sw_spu_rw_cpu_intr___intr2___lsb 2
258#define reg_iop_sw_spu_rw_cpu_intr___intr2___width 1
259#define reg_iop_sw_spu_rw_cpu_intr___intr2___bit 2
260#define reg_iop_sw_spu_rw_cpu_intr___intr3___lsb 3
261#define reg_iop_sw_spu_rw_cpu_intr___intr3___width 1
262#define reg_iop_sw_spu_rw_cpu_intr___intr3___bit 3
263#define reg_iop_sw_spu_rw_cpu_intr___intr4___lsb 4
264#define reg_iop_sw_spu_rw_cpu_intr___intr4___width 1
265#define reg_iop_sw_spu_rw_cpu_intr___intr4___bit 4
266#define reg_iop_sw_spu_rw_cpu_intr___intr5___lsb 5
267#define reg_iop_sw_spu_rw_cpu_intr___intr5___width 1
268#define reg_iop_sw_spu_rw_cpu_intr___intr5___bit 5
269#define reg_iop_sw_spu_rw_cpu_intr___intr6___lsb 6
270#define reg_iop_sw_spu_rw_cpu_intr___intr6___width 1
271#define reg_iop_sw_spu_rw_cpu_intr___intr6___bit 6
272#define reg_iop_sw_spu_rw_cpu_intr___intr7___lsb 7
273#define reg_iop_sw_spu_rw_cpu_intr___intr7___width 1
274#define reg_iop_sw_spu_rw_cpu_intr___intr7___bit 7
275#define reg_iop_sw_spu_rw_cpu_intr___intr8___lsb 8
276#define reg_iop_sw_spu_rw_cpu_intr___intr8___width 1
277#define reg_iop_sw_spu_rw_cpu_intr___intr8___bit 8
278#define reg_iop_sw_spu_rw_cpu_intr___intr9___lsb 9
279#define reg_iop_sw_spu_rw_cpu_intr___intr9___width 1
280#define reg_iop_sw_spu_rw_cpu_intr___intr9___bit 9
281#define reg_iop_sw_spu_rw_cpu_intr___intr10___lsb 10
282#define reg_iop_sw_spu_rw_cpu_intr___intr10___width 1
283#define reg_iop_sw_spu_rw_cpu_intr___intr10___bit 10
284#define reg_iop_sw_spu_rw_cpu_intr___intr11___lsb 11
285#define reg_iop_sw_spu_rw_cpu_intr___intr11___width 1
286#define reg_iop_sw_spu_rw_cpu_intr___intr11___bit 11
287#define reg_iop_sw_spu_rw_cpu_intr___intr12___lsb 12
288#define reg_iop_sw_spu_rw_cpu_intr___intr12___width 1
289#define reg_iop_sw_spu_rw_cpu_intr___intr12___bit 12
290#define reg_iop_sw_spu_rw_cpu_intr___intr13___lsb 13
291#define reg_iop_sw_spu_rw_cpu_intr___intr13___width 1
292#define reg_iop_sw_spu_rw_cpu_intr___intr13___bit 13
293#define reg_iop_sw_spu_rw_cpu_intr___intr14___lsb 14
294#define reg_iop_sw_spu_rw_cpu_intr___intr14___width 1
295#define reg_iop_sw_spu_rw_cpu_intr___intr14___bit 14
296#define reg_iop_sw_spu_rw_cpu_intr___intr15___lsb 15
297#define reg_iop_sw_spu_rw_cpu_intr___intr15___width 1
298#define reg_iop_sw_spu_rw_cpu_intr___intr15___bit 15
299#define reg_iop_sw_spu_rw_cpu_intr_offset 116
300
301/* Register r_cpu_intr, scope iop_sw_spu, type r */
302#define reg_iop_sw_spu_r_cpu_intr___intr0___lsb 0
303#define reg_iop_sw_spu_r_cpu_intr___intr0___width 1
304#define reg_iop_sw_spu_r_cpu_intr___intr0___bit 0
305#define reg_iop_sw_spu_r_cpu_intr___intr1___lsb 1
306#define reg_iop_sw_spu_r_cpu_intr___intr1___width 1
307#define reg_iop_sw_spu_r_cpu_intr___intr1___bit 1
308#define reg_iop_sw_spu_r_cpu_intr___intr2___lsb 2
309#define reg_iop_sw_spu_r_cpu_intr___intr2___width 1
310#define reg_iop_sw_spu_r_cpu_intr___intr2___bit 2
311#define reg_iop_sw_spu_r_cpu_intr___intr3___lsb 3
312#define reg_iop_sw_spu_r_cpu_intr___intr3___width 1
313#define reg_iop_sw_spu_r_cpu_intr___intr3___bit 3
314#define reg_iop_sw_spu_r_cpu_intr___intr4___lsb 4
315#define reg_iop_sw_spu_r_cpu_intr___intr4___width 1
316#define reg_iop_sw_spu_r_cpu_intr___intr4___bit 4
317#define reg_iop_sw_spu_r_cpu_intr___intr5___lsb 5
318#define reg_iop_sw_spu_r_cpu_intr___intr5___width 1
319#define reg_iop_sw_spu_r_cpu_intr___intr5___bit 5
320#define reg_iop_sw_spu_r_cpu_intr___intr6___lsb 6
321#define reg_iop_sw_spu_r_cpu_intr___intr6___width 1
322#define reg_iop_sw_spu_r_cpu_intr___intr6___bit 6
323#define reg_iop_sw_spu_r_cpu_intr___intr7___lsb 7
324#define reg_iop_sw_spu_r_cpu_intr___intr7___width 1
325#define reg_iop_sw_spu_r_cpu_intr___intr7___bit 7
326#define reg_iop_sw_spu_r_cpu_intr___intr8___lsb 8
327#define reg_iop_sw_spu_r_cpu_intr___intr8___width 1
328#define reg_iop_sw_spu_r_cpu_intr___intr8___bit 8
329#define reg_iop_sw_spu_r_cpu_intr___intr9___lsb 9
330#define reg_iop_sw_spu_r_cpu_intr___intr9___width 1
331#define reg_iop_sw_spu_r_cpu_intr___intr9___bit 9
332#define reg_iop_sw_spu_r_cpu_intr___intr10___lsb 10
333#define reg_iop_sw_spu_r_cpu_intr___intr10___width 1
334#define reg_iop_sw_spu_r_cpu_intr___intr10___bit 10
335#define reg_iop_sw_spu_r_cpu_intr___intr11___lsb 11
336#define reg_iop_sw_spu_r_cpu_intr___intr11___width 1
337#define reg_iop_sw_spu_r_cpu_intr___intr11___bit 11
338#define reg_iop_sw_spu_r_cpu_intr___intr12___lsb 12
339#define reg_iop_sw_spu_r_cpu_intr___intr12___width 1
340#define reg_iop_sw_spu_r_cpu_intr___intr12___bit 12
341#define reg_iop_sw_spu_r_cpu_intr___intr13___lsb 13
342#define reg_iop_sw_spu_r_cpu_intr___intr13___width 1
343#define reg_iop_sw_spu_r_cpu_intr___intr13___bit 13
344#define reg_iop_sw_spu_r_cpu_intr___intr14___lsb 14
345#define reg_iop_sw_spu_r_cpu_intr___intr14___width 1
346#define reg_iop_sw_spu_r_cpu_intr___intr14___bit 14
347#define reg_iop_sw_spu_r_cpu_intr___intr15___lsb 15
348#define reg_iop_sw_spu_r_cpu_intr___intr15___width 1
349#define reg_iop_sw_spu_r_cpu_intr___intr15___bit 15
350#define reg_iop_sw_spu_r_cpu_intr_offset 120
351
352/* Register r_hw_intr, scope iop_sw_spu, type r */
353#define reg_iop_sw_spu_r_hw_intr___trigger_grp0___lsb 0
354#define reg_iop_sw_spu_r_hw_intr___trigger_grp0___width 1
355#define reg_iop_sw_spu_r_hw_intr___trigger_grp0___bit 0
356#define reg_iop_sw_spu_r_hw_intr___trigger_grp1___lsb 1
357#define reg_iop_sw_spu_r_hw_intr___trigger_grp1___width 1
358#define reg_iop_sw_spu_r_hw_intr___trigger_grp1___bit 1
359#define reg_iop_sw_spu_r_hw_intr___trigger_grp2___lsb 2
360#define reg_iop_sw_spu_r_hw_intr___trigger_grp2___width 1
361#define reg_iop_sw_spu_r_hw_intr___trigger_grp2___bit 2
362#define reg_iop_sw_spu_r_hw_intr___trigger_grp3___lsb 3
363#define reg_iop_sw_spu_r_hw_intr___trigger_grp3___width 1
364#define reg_iop_sw_spu_r_hw_intr___trigger_grp3___bit 3
365#define reg_iop_sw_spu_r_hw_intr___trigger_grp4___lsb 4
366#define reg_iop_sw_spu_r_hw_intr___trigger_grp4___width 1
367#define reg_iop_sw_spu_r_hw_intr___trigger_grp4___bit 4
368#define reg_iop_sw_spu_r_hw_intr___trigger_grp5___lsb 5
369#define reg_iop_sw_spu_r_hw_intr___trigger_grp5___width 1
370#define reg_iop_sw_spu_r_hw_intr___trigger_grp5___bit 5
371#define reg_iop_sw_spu_r_hw_intr___trigger_grp6___lsb 6
372#define reg_iop_sw_spu_r_hw_intr___trigger_grp6___width 1
373#define reg_iop_sw_spu_r_hw_intr___trigger_grp6___bit 6
374#define reg_iop_sw_spu_r_hw_intr___trigger_grp7___lsb 7
375#define reg_iop_sw_spu_r_hw_intr___trigger_grp7___width 1
376#define reg_iop_sw_spu_r_hw_intr___trigger_grp7___bit 7
377#define reg_iop_sw_spu_r_hw_intr___timer_grp0___lsb 8
378#define reg_iop_sw_spu_r_hw_intr___timer_grp0___width 1
379#define reg_iop_sw_spu_r_hw_intr___timer_grp0___bit 8
380#define reg_iop_sw_spu_r_hw_intr___timer_grp1___lsb 9
381#define reg_iop_sw_spu_r_hw_intr___timer_grp1___width 1
382#define reg_iop_sw_spu_r_hw_intr___timer_grp1___bit 9
383#define reg_iop_sw_spu_r_hw_intr___fifo_out___lsb 10
384#define reg_iop_sw_spu_r_hw_intr___fifo_out___width 1
385#define reg_iop_sw_spu_r_hw_intr___fifo_out___bit 10
386#define reg_iop_sw_spu_r_hw_intr___fifo_out_extra___lsb 11
387#define reg_iop_sw_spu_r_hw_intr___fifo_out_extra___width 1
388#define reg_iop_sw_spu_r_hw_intr___fifo_out_extra___bit 11
389#define reg_iop_sw_spu_r_hw_intr___fifo_in___lsb 12
390#define reg_iop_sw_spu_r_hw_intr___fifo_in___width 1
391#define reg_iop_sw_spu_r_hw_intr___fifo_in___bit 12
392#define reg_iop_sw_spu_r_hw_intr___fifo_in_extra___lsb 13
393#define reg_iop_sw_spu_r_hw_intr___fifo_in_extra___width 1
394#define reg_iop_sw_spu_r_hw_intr___fifo_in_extra___bit 13
395#define reg_iop_sw_spu_r_hw_intr___dmc_out___lsb 14
396#define reg_iop_sw_spu_r_hw_intr___dmc_out___width 1
397#define reg_iop_sw_spu_r_hw_intr___dmc_out___bit 14
398#define reg_iop_sw_spu_r_hw_intr___dmc_in___lsb 15
399#define reg_iop_sw_spu_r_hw_intr___dmc_in___width 1
400#define reg_iop_sw_spu_r_hw_intr___dmc_in___bit 15
401#define reg_iop_sw_spu_r_hw_intr_offset 124
402
403/* Register rw_mpu_intr, scope iop_sw_spu, type rw */
404#define reg_iop_sw_spu_rw_mpu_intr___intr0___lsb 0
405#define reg_iop_sw_spu_rw_mpu_intr___intr0___width 1
406#define reg_iop_sw_spu_rw_mpu_intr___intr0___bit 0
407#define reg_iop_sw_spu_rw_mpu_intr___intr1___lsb 1
408#define reg_iop_sw_spu_rw_mpu_intr___intr1___width 1
409#define reg_iop_sw_spu_rw_mpu_intr___intr1___bit 1
410#define reg_iop_sw_spu_rw_mpu_intr___intr2___lsb 2
411#define reg_iop_sw_spu_rw_mpu_intr___intr2___width 1
412#define reg_iop_sw_spu_rw_mpu_intr___intr2___bit 2
413#define reg_iop_sw_spu_rw_mpu_intr___intr3___lsb 3
414#define reg_iop_sw_spu_rw_mpu_intr___intr3___width 1
415#define reg_iop_sw_spu_rw_mpu_intr___intr3___bit 3
416#define reg_iop_sw_spu_rw_mpu_intr___intr4___lsb 4
417#define reg_iop_sw_spu_rw_mpu_intr___intr4___width 1
418#define reg_iop_sw_spu_rw_mpu_intr___intr4___bit 4
419#define reg_iop_sw_spu_rw_mpu_intr___intr5___lsb 5
420#define reg_iop_sw_spu_rw_mpu_intr___intr5___width 1
421#define reg_iop_sw_spu_rw_mpu_intr___intr5___bit 5
422#define reg_iop_sw_spu_rw_mpu_intr___intr6___lsb 6
423#define reg_iop_sw_spu_rw_mpu_intr___intr6___width 1
424#define reg_iop_sw_spu_rw_mpu_intr___intr6___bit 6
425#define reg_iop_sw_spu_rw_mpu_intr___intr7___lsb 7
426#define reg_iop_sw_spu_rw_mpu_intr___intr7___width 1
427#define reg_iop_sw_spu_rw_mpu_intr___intr7___bit 7
428#define reg_iop_sw_spu_rw_mpu_intr___intr8___lsb 8
429#define reg_iop_sw_spu_rw_mpu_intr___intr8___width 1
430#define reg_iop_sw_spu_rw_mpu_intr___intr8___bit 8
431#define reg_iop_sw_spu_rw_mpu_intr___intr9___lsb 9
432#define reg_iop_sw_spu_rw_mpu_intr___intr9___width 1
433#define reg_iop_sw_spu_rw_mpu_intr___intr9___bit 9
434#define reg_iop_sw_spu_rw_mpu_intr___intr10___lsb 10
435#define reg_iop_sw_spu_rw_mpu_intr___intr10___width 1
436#define reg_iop_sw_spu_rw_mpu_intr___intr10___bit 10
437#define reg_iop_sw_spu_rw_mpu_intr___intr11___lsb 11
438#define reg_iop_sw_spu_rw_mpu_intr___intr11___width 1
439#define reg_iop_sw_spu_rw_mpu_intr___intr11___bit 11
440#define reg_iop_sw_spu_rw_mpu_intr___intr12___lsb 12
441#define reg_iop_sw_spu_rw_mpu_intr___intr12___width 1
442#define reg_iop_sw_spu_rw_mpu_intr___intr12___bit 12
443#define reg_iop_sw_spu_rw_mpu_intr___intr13___lsb 13
444#define reg_iop_sw_spu_rw_mpu_intr___intr13___width 1
445#define reg_iop_sw_spu_rw_mpu_intr___intr13___bit 13
446#define reg_iop_sw_spu_rw_mpu_intr___intr14___lsb 14
447#define reg_iop_sw_spu_rw_mpu_intr___intr14___width 1
448#define reg_iop_sw_spu_rw_mpu_intr___intr14___bit 14
449#define reg_iop_sw_spu_rw_mpu_intr___intr15___lsb 15
450#define reg_iop_sw_spu_rw_mpu_intr___intr15___width 1
451#define reg_iop_sw_spu_rw_mpu_intr___intr15___bit 15
452#define reg_iop_sw_spu_rw_mpu_intr_offset 128
453
454/* Register r_mpu_intr, scope iop_sw_spu, type r */
455#define reg_iop_sw_spu_r_mpu_intr___intr0___lsb 0
456#define reg_iop_sw_spu_r_mpu_intr___intr0___width 1
457#define reg_iop_sw_spu_r_mpu_intr___intr0___bit 0
458#define reg_iop_sw_spu_r_mpu_intr___intr1___lsb 1
459#define reg_iop_sw_spu_r_mpu_intr___intr1___width 1
460#define reg_iop_sw_spu_r_mpu_intr___intr1___bit 1
461#define reg_iop_sw_spu_r_mpu_intr___intr2___lsb 2
462#define reg_iop_sw_spu_r_mpu_intr___intr2___width 1
463#define reg_iop_sw_spu_r_mpu_intr___intr2___bit 2
464#define reg_iop_sw_spu_r_mpu_intr___intr3___lsb 3
465#define reg_iop_sw_spu_r_mpu_intr___intr3___width 1
466#define reg_iop_sw_spu_r_mpu_intr___intr3___bit 3
467#define reg_iop_sw_spu_r_mpu_intr___intr4___lsb 4
468#define reg_iop_sw_spu_r_mpu_intr___intr4___width 1
469#define reg_iop_sw_spu_r_mpu_intr___intr4___bit 4
470#define reg_iop_sw_spu_r_mpu_intr___intr5___lsb 5
471#define reg_iop_sw_spu_r_mpu_intr___intr5___width 1
472#define reg_iop_sw_spu_r_mpu_intr___intr5___bit 5
473#define reg_iop_sw_spu_r_mpu_intr___intr6___lsb 6
474#define reg_iop_sw_spu_r_mpu_intr___intr6___width 1
475#define reg_iop_sw_spu_r_mpu_intr___intr6___bit 6
476#define reg_iop_sw_spu_r_mpu_intr___intr7___lsb 7
477#define reg_iop_sw_spu_r_mpu_intr___intr7___width 1
478#define reg_iop_sw_spu_r_mpu_intr___intr7___bit 7
479#define reg_iop_sw_spu_r_mpu_intr___intr8___lsb 8
480#define reg_iop_sw_spu_r_mpu_intr___intr8___width 1
481#define reg_iop_sw_spu_r_mpu_intr___intr8___bit 8
482#define reg_iop_sw_spu_r_mpu_intr___intr9___lsb 9
483#define reg_iop_sw_spu_r_mpu_intr___intr9___width 1
484#define reg_iop_sw_spu_r_mpu_intr___intr9___bit 9
485#define reg_iop_sw_spu_r_mpu_intr___intr10___lsb 10
486#define reg_iop_sw_spu_r_mpu_intr___intr10___width 1
487#define reg_iop_sw_spu_r_mpu_intr___intr10___bit 10
488#define reg_iop_sw_spu_r_mpu_intr___intr11___lsb 11
489#define reg_iop_sw_spu_r_mpu_intr___intr11___width 1
490#define reg_iop_sw_spu_r_mpu_intr___intr11___bit 11
491#define reg_iop_sw_spu_r_mpu_intr___intr12___lsb 12
492#define reg_iop_sw_spu_r_mpu_intr___intr12___width 1
493#define reg_iop_sw_spu_r_mpu_intr___intr12___bit 12
494#define reg_iop_sw_spu_r_mpu_intr___intr13___lsb 13
495#define reg_iop_sw_spu_r_mpu_intr___intr13___width 1
496#define reg_iop_sw_spu_r_mpu_intr___intr13___bit 13
497#define reg_iop_sw_spu_r_mpu_intr___intr14___lsb 14
498#define reg_iop_sw_spu_r_mpu_intr___intr14___width 1
499#define reg_iop_sw_spu_r_mpu_intr___intr14___bit 14
500#define reg_iop_sw_spu_r_mpu_intr___intr15___lsb 15
501#define reg_iop_sw_spu_r_mpu_intr___intr15___width 1
502#define reg_iop_sw_spu_r_mpu_intr___intr15___bit 15
503#define reg_iop_sw_spu_r_mpu_intr_offset 132
504
505
506/* Constants */
507#define regk_iop_sw_spu_copy 0x00000000
508#define regk_iop_sw_spu_no 0x00000000
509#define regk_iop_sw_spu_nop 0x00000000
510#define regk_iop_sw_spu_rd 0x00000002
511#define regk_iop_sw_spu_reg_copy 0x00000001
512#define regk_iop_sw_spu_rw_bus_clr_mask_default 0x00000000
513#define regk_iop_sw_spu_rw_bus_oe_clr_mask_default 0x00000000
514#define regk_iop_sw_spu_rw_bus_oe_set_mask_default 0x00000000
515#define regk_iop_sw_spu_rw_bus_set_mask_default 0x00000000
516#define regk_iop_sw_spu_rw_gio_clr_mask_default 0x00000000
517#define regk_iop_sw_spu_rw_gio_oe_clr_mask_default 0x00000000
518#define regk_iop_sw_spu_rw_gio_oe_set_mask_default 0x00000000
519#define regk_iop_sw_spu_rw_gio_set_mask_default 0x00000000
520#define regk_iop_sw_spu_set 0x00000001
521#define regk_iop_sw_spu_wr 0x00000003
522#define regk_iop_sw_spu_yes 0x00000001
523#endif /* __iop_sw_spu_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_version_defs_asm.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_version_defs_asm.h
new file mode 100644
index 000000000000..4ad671202af0
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/asm/iop_version_defs_asm.h
@@ -0,0 +1,61 @@
1#ifndef __iop_version_defs_asm_h
2#define __iop_version_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_version.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -asm -outfile iop_version_defs_asm.h iop_version.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13
14#ifndef REG_FIELD
15#define REG_FIELD( scope, reg, field, value ) \
16 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
17#define REG_FIELD_X_( value, shift ) ((value) << shift)
18#endif
19
20#ifndef REG_STATE
21#define REG_STATE( scope, reg, field, symbolic_value ) \
22 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
23#define REG_STATE_X_( k, shift ) (k << shift)
24#endif
25
26#ifndef REG_MASK
27#define REG_MASK( scope, reg, field ) \
28 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
29#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
30#endif
31
32#ifndef REG_LSB
33#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
34#endif
35
36#ifndef REG_BIT
37#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
38#endif
39
40#ifndef REG_ADDR
41#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
42#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
43#endif
44
45#ifndef REG_ADDR_VECT
46#define REG_ADDR_VECT( scope, inst, reg, index ) \
47 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
48 STRIDE_##scope##_##reg )
49#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
50 ((inst) + offs + (index) * stride)
51#endif
52
53/* Register r_version, scope iop_version, type r */
54#define reg_iop_version_r_version___nr___lsb 0
55#define reg_iop_version_r_version___nr___width 8
56#define reg_iop_version_r_version_offset 0
57
58
59/* Constants */
60#define regk_iop_version_v2_0 0x00000002
61#endif /* __iop_version_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_reg_space.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_reg_space.h
new file mode 100644
index 000000000000..af3196c60a46
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_reg_space.h
@@ -0,0 +1,31 @@
1/* Autogenerated Changes here will be lost!
2 * generated by ./gen_sw.pl Wed Feb 14 09:27:48 2007 iop_sw.cfg
3 */
4#define regi_iop_version (regi_iop + 0)
5#define regi_iop_fifo_in_extra (regi_iop + 64)
6#define regi_iop_fifo_out_extra (regi_iop + 128)
7#define regi_iop_trigger_grp0 (regi_iop + 192)
8#define regi_iop_trigger_grp1 (regi_iop + 256)
9#define regi_iop_trigger_grp2 (regi_iop + 320)
10#define regi_iop_trigger_grp3 (regi_iop + 384)
11#define regi_iop_trigger_grp4 (regi_iop + 448)
12#define regi_iop_trigger_grp5 (regi_iop + 512)
13#define regi_iop_trigger_grp6 (regi_iop + 576)
14#define regi_iop_trigger_grp7 (regi_iop + 640)
15#define regi_iop_crc_par (regi_iop + 768)
16#define regi_iop_dmc_in (regi_iop + 896)
17#define regi_iop_dmc_out (regi_iop + 1024)
18#define regi_iop_fifo_in (regi_iop + 1152)
19#define regi_iop_fifo_out (regi_iop + 1280)
20#define regi_iop_scrc_in (regi_iop + 1408)
21#define regi_iop_scrc_out (regi_iop + 1536)
22#define regi_iop_timer_grp0 (regi_iop + 1664)
23#define regi_iop_timer_grp1 (regi_iop + 1792)
24#define regi_iop_sap_in (regi_iop + 2048)
25#define regi_iop_sap_out (regi_iop + 2304)
26#define regi_iop_spu (regi_iop + 2560)
27#define regi_iop_sw_cfg (regi_iop + 2816)
28#define regi_iop_sw_cpu (regi_iop + 3072)
29#define regi_iop_sw_mpu (regi_iop + 3328)
30#define regi_iop_sw_spu (regi_iop + 3584)
31#define regi_iop_mpu (regi_iop + 4096)
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sap_in_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sap_in_defs.h
new file mode 100644
index 000000000000..51dde016c03a
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sap_in_defs.h
@@ -0,0 +1,141 @@
1#ifndef __iop_sap_in_defs_h
2#define __iop_sap_in_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_sap_in.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile iop_sap_in_defs.h iop_sap_in.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope iop_sap_in */
83
84#define STRIDE_iop_sap_in_rw_bus_byte 4
85/* Register rw_bus_byte, scope iop_sap_in, type rw */
86typedef struct {
87 unsigned int sync_sel : 2;
88 unsigned int sync_ext_src : 3;
89 unsigned int sync_edge : 2;
90 unsigned int delay : 2;
91 unsigned int dummy1 : 23;
92} reg_iop_sap_in_rw_bus_byte;
93#define REG_RD_ADDR_iop_sap_in_rw_bus_byte 0
94#define REG_WR_ADDR_iop_sap_in_rw_bus_byte 0
95
96#define STRIDE_iop_sap_in_rw_gio 4
97/* Register rw_gio, scope iop_sap_in, type rw */
98typedef struct {
99 unsigned int sync_sel : 2;
100 unsigned int sync_ext_src : 3;
101 unsigned int sync_edge : 2;
102 unsigned int delay : 2;
103 unsigned int logic : 2;
104 unsigned int dummy1 : 21;
105} reg_iop_sap_in_rw_gio;
106#define REG_RD_ADDR_iop_sap_in_rw_gio 16
107#define REG_WR_ADDR_iop_sap_in_rw_gio 16
108
109
110/* Constants */
111enum {
112 regk_iop_sap_in_and = 0x00000002,
113 regk_iop_sap_in_ext_clk200 = 0x00000003,
114 regk_iop_sap_in_gio0 = 0x00000000,
115 regk_iop_sap_in_gio12 = 0x00000003,
116 regk_iop_sap_in_gio16 = 0x00000004,
117 regk_iop_sap_in_gio20 = 0x00000005,
118 regk_iop_sap_in_gio24 = 0x00000006,
119 regk_iop_sap_in_gio28 = 0x00000007,
120 regk_iop_sap_in_gio4 = 0x00000001,
121 regk_iop_sap_in_gio8 = 0x00000002,
122 regk_iop_sap_in_inv = 0x00000001,
123 regk_iop_sap_in_neg = 0x00000002,
124 regk_iop_sap_in_no = 0x00000000,
125 regk_iop_sap_in_no_del_ext_clk200 = 0x00000002,
126 regk_iop_sap_in_none = 0x00000000,
127 regk_iop_sap_in_one = 0x00000001,
128 regk_iop_sap_in_or = 0x00000003,
129 regk_iop_sap_in_pos = 0x00000001,
130 regk_iop_sap_in_pos_neg = 0x00000003,
131 regk_iop_sap_in_rw_bus_byte_default = 0x00000000,
132 regk_iop_sap_in_rw_bus_byte_size = 0x00000004,
133 regk_iop_sap_in_rw_gio_default = 0x00000000,
134 regk_iop_sap_in_rw_gio_size = 0x00000020,
135 regk_iop_sap_in_timer_grp0_tmr3 = 0x00000000,
136 regk_iop_sap_in_timer_grp1_tmr3 = 0x00000001,
137 regk_iop_sap_in_tmr_clk200 = 0x00000001,
138 regk_iop_sap_in_two = 0x00000002,
139 regk_iop_sap_in_two_clk200 = 0x00000000
140};
141#endif /* __iop_sap_in_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sap_out_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sap_out_defs.h
new file mode 100644
index 000000000000..5af88baa2ac1
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sap_out_defs.h
@@ -0,0 +1,231 @@
1#ifndef __iop_sap_out_defs_h
2#define __iop_sap_out_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_sap_out.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile iop_sap_out_defs.h iop_sap_out.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope iop_sap_out */
83
84/* Register rw_gen_gated, scope iop_sap_out, type rw */
85typedef struct {
86 unsigned int clk0_src : 2;
87 unsigned int clk0_gate_src : 2;
88 unsigned int clk0_force_src : 3;
89 unsigned int clk1_src : 2;
90 unsigned int clk1_gate_src : 2;
91 unsigned int clk1_force_src : 3;
92 unsigned int dummy1 : 18;
93} reg_iop_sap_out_rw_gen_gated;
94#define REG_RD_ADDR_iop_sap_out_rw_gen_gated 0
95#define REG_WR_ADDR_iop_sap_out_rw_gen_gated 0
96
97/* Register rw_bus, scope iop_sap_out, type rw */
98typedef struct {
99 unsigned int byte0_clk_sel : 2;
100 unsigned int byte0_clk_ext : 2;
101 unsigned int byte0_gated_clk : 1;
102 unsigned int byte0_clk_inv : 1;
103 unsigned int byte0_delay : 1;
104 unsigned int byte1_clk_sel : 2;
105 unsigned int byte1_clk_ext : 2;
106 unsigned int byte1_gated_clk : 1;
107 unsigned int byte1_clk_inv : 1;
108 unsigned int byte1_delay : 1;
109 unsigned int byte2_clk_sel : 2;
110 unsigned int byte2_clk_ext : 2;
111 unsigned int byte2_gated_clk : 1;
112 unsigned int byte2_clk_inv : 1;
113 unsigned int byte2_delay : 1;
114 unsigned int byte3_clk_sel : 2;
115 unsigned int byte3_clk_ext : 2;
116 unsigned int byte3_gated_clk : 1;
117 unsigned int byte3_clk_inv : 1;
118 unsigned int byte3_delay : 1;
119 unsigned int dummy1 : 4;
120} reg_iop_sap_out_rw_bus;
121#define REG_RD_ADDR_iop_sap_out_rw_bus 4
122#define REG_WR_ADDR_iop_sap_out_rw_bus 4
123
124/* Register rw_bus_lo_oe, scope iop_sap_out, type rw */
125typedef struct {
126 unsigned int byte0_clk_sel : 2;
127 unsigned int byte0_clk_ext : 2;
128 unsigned int byte0_gated_clk : 1;
129 unsigned int byte0_clk_inv : 1;
130 unsigned int byte0_delay : 1;
131 unsigned int byte0_logic : 2;
132 unsigned int byte0_logic_src : 2;
133 unsigned int byte1_clk_sel : 2;
134 unsigned int byte1_clk_ext : 2;
135 unsigned int byte1_gated_clk : 1;
136 unsigned int byte1_clk_inv : 1;
137 unsigned int byte1_delay : 1;
138 unsigned int byte1_logic : 2;
139 unsigned int byte1_logic_src : 2;
140 unsigned int dummy1 : 10;
141} reg_iop_sap_out_rw_bus_lo_oe;
142#define REG_RD_ADDR_iop_sap_out_rw_bus_lo_oe 8
143#define REG_WR_ADDR_iop_sap_out_rw_bus_lo_oe 8
144
145/* Register rw_bus_hi_oe, scope iop_sap_out, type rw */
146typedef struct {
147 unsigned int byte2_clk_sel : 2;
148 unsigned int byte2_clk_ext : 2;
149 unsigned int byte2_gated_clk : 1;
150 unsigned int byte2_clk_inv : 1;
151 unsigned int byte2_delay : 1;
152 unsigned int byte2_logic : 2;
153 unsigned int byte2_logic_src : 2;
154 unsigned int byte3_clk_sel : 2;
155 unsigned int byte3_clk_ext : 2;
156 unsigned int byte3_gated_clk : 1;
157 unsigned int byte3_clk_inv : 1;
158 unsigned int byte3_delay : 1;
159 unsigned int byte3_logic : 2;
160 unsigned int byte3_logic_src : 2;
161 unsigned int dummy1 : 10;
162} reg_iop_sap_out_rw_bus_hi_oe;
163#define REG_RD_ADDR_iop_sap_out_rw_bus_hi_oe 12
164#define REG_WR_ADDR_iop_sap_out_rw_bus_hi_oe 12
165
166#define STRIDE_iop_sap_out_rw_gio 4
167/* Register rw_gio, scope iop_sap_out, type rw */
168typedef struct {
169 unsigned int out_clk_sel : 3;
170 unsigned int out_clk_ext : 2;
171 unsigned int out_gated_clk : 1;
172 unsigned int out_clk_inv : 1;
173 unsigned int out_delay : 1;
174 unsigned int out_logic : 2;
175 unsigned int out_logic_src : 2;
176 unsigned int oe_clk_sel : 3;
177 unsigned int oe_clk_ext : 2;
178 unsigned int oe_gated_clk : 1;
179 unsigned int oe_clk_inv : 1;
180 unsigned int oe_delay : 1;
181 unsigned int oe_logic : 2;
182 unsigned int oe_logic_src : 2;
183 unsigned int dummy1 : 8;
184} reg_iop_sap_out_rw_gio;
185#define REG_RD_ADDR_iop_sap_out_rw_gio 16
186#define REG_WR_ADDR_iop_sap_out_rw_gio 16
187
188
189/* Constants */
190enum {
191 regk_iop_sap_out_always = 0x00000001,
192 regk_iop_sap_out_and = 0x00000002,
193 regk_iop_sap_out_clk0 = 0x00000000,
194 regk_iop_sap_out_clk1 = 0x00000001,
195 regk_iop_sap_out_clk12 = 0x00000004,
196 regk_iop_sap_out_clk200 = 0x00000000,
197 regk_iop_sap_out_ext = 0x00000002,
198 regk_iop_sap_out_gated = 0x00000003,
199 regk_iop_sap_out_gio0 = 0x00000000,
200 regk_iop_sap_out_gio1 = 0x00000000,
201 regk_iop_sap_out_gio16 = 0x00000002,
202 regk_iop_sap_out_gio17 = 0x00000002,
203 regk_iop_sap_out_gio24 = 0x00000003,
204 regk_iop_sap_out_gio25 = 0x00000003,
205 regk_iop_sap_out_gio8 = 0x00000001,
206 regk_iop_sap_out_gio9 = 0x00000001,
207 regk_iop_sap_out_gio_out10 = 0x00000005,
208 regk_iop_sap_out_gio_out18 = 0x00000006,
209 regk_iop_sap_out_gio_out2 = 0x00000004,
210 regk_iop_sap_out_gio_out26 = 0x00000007,
211 regk_iop_sap_out_inv = 0x00000001,
212 regk_iop_sap_out_nand = 0x00000003,
213 regk_iop_sap_out_no = 0x00000000,
214 regk_iop_sap_out_none = 0x00000000,
215 regk_iop_sap_out_one = 0x00000001,
216 regk_iop_sap_out_rw_bus_default = 0x00000000,
217 regk_iop_sap_out_rw_bus_hi_oe_default = 0x00000000,
218 regk_iop_sap_out_rw_bus_lo_oe_default = 0x00000000,
219 regk_iop_sap_out_rw_gen_gated_default = 0x00000000,
220 regk_iop_sap_out_rw_gio_default = 0x00000000,
221 regk_iop_sap_out_rw_gio_size = 0x00000020,
222 regk_iop_sap_out_spu_gio6 = 0x00000002,
223 regk_iop_sap_out_spu_gio7 = 0x00000003,
224 regk_iop_sap_out_timer_grp0_tmr2 = 0x00000000,
225 regk_iop_sap_out_timer_grp0_tmr3 = 0x00000001,
226 regk_iop_sap_out_timer_grp1_tmr2 = 0x00000002,
227 regk_iop_sap_out_timer_grp1_tmr3 = 0x00000003,
228 regk_iop_sap_out_tmr200 = 0x00000001,
229 regk_iop_sap_out_yes = 0x00000001
230};
231#endif /* __iop_sap_out_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_cfg_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_cfg_defs.h
new file mode 100644
index 000000000000..98ac95275a1c
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_cfg_defs.h
@@ -0,0 +1,725 @@
1#ifndef __iop_sw_cfg_defs_h
2#define __iop_sw_cfg_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_sw_cfg.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile iop_sw_cfg_defs.h iop_sw_cfg.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope iop_sw_cfg */
83
84/* Register rw_crc_par_owner, scope iop_sw_cfg, type rw */
85typedef struct {
86 unsigned int cfg : 2;
87 unsigned int dummy1 : 30;
88} reg_iop_sw_cfg_rw_crc_par_owner;
89#define REG_RD_ADDR_iop_sw_cfg_rw_crc_par_owner 0
90#define REG_WR_ADDR_iop_sw_cfg_rw_crc_par_owner 0
91
92/* Register rw_dmc_in_owner, scope iop_sw_cfg, type rw */
93typedef struct {
94 unsigned int cfg : 2;
95 unsigned int dummy1 : 30;
96} reg_iop_sw_cfg_rw_dmc_in_owner;
97#define REG_RD_ADDR_iop_sw_cfg_rw_dmc_in_owner 4
98#define REG_WR_ADDR_iop_sw_cfg_rw_dmc_in_owner 4
99
100/* Register rw_dmc_out_owner, scope iop_sw_cfg, type rw */
101typedef struct {
102 unsigned int cfg : 2;
103 unsigned int dummy1 : 30;
104} reg_iop_sw_cfg_rw_dmc_out_owner;
105#define REG_RD_ADDR_iop_sw_cfg_rw_dmc_out_owner 8
106#define REG_WR_ADDR_iop_sw_cfg_rw_dmc_out_owner 8
107
108/* Register rw_fifo_in_owner, scope iop_sw_cfg, type rw */
109typedef struct {
110 unsigned int cfg : 2;
111 unsigned int dummy1 : 30;
112} reg_iop_sw_cfg_rw_fifo_in_owner;
113#define REG_RD_ADDR_iop_sw_cfg_rw_fifo_in_owner 12
114#define REG_WR_ADDR_iop_sw_cfg_rw_fifo_in_owner 12
115
116/* Register rw_fifo_in_extra_owner, scope iop_sw_cfg, type rw */
117typedef struct {
118 unsigned int cfg : 2;
119 unsigned int dummy1 : 30;
120} reg_iop_sw_cfg_rw_fifo_in_extra_owner;
121#define REG_RD_ADDR_iop_sw_cfg_rw_fifo_in_extra_owner 16
122#define REG_WR_ADDR_iop_sw_cfg_rw_fifo_in_extra_owner 16
123
124/* Register rw_fifo_out_owner, scope iop_sw_cfg, type rw */
125typedef struct {
126 unsigned int cfg : 2;
127 unsigned int dummy1 : 30;
128} reg_iop_sw_cfg_rw_fifo_out_owner;
129#define REG_RD_ADDR_iop_sw_cfg_rw_fifo_out_owner 20
130#define REG_WR_ADDR_iop_sw_cfg_rw_fifo_out_owner 20
131
132/* Register rw_fifo_out_extra_owner, scope iop_sw_cfg, type rw */
133typedef struct {
134 unsigned int cfg : 2;
135 unsigned int dummy1 : 30;
136} reg_iop_sw_cfg_rw_fifo_out_extra_owner;
137#define REG_RD_ADDR_iop_sw_cfg_rw_fifo_out_extra_owner 24
138#define REG_WR_ADDR_iop_sw_cfg_rw_fifo_out_extra_owner 24
139
140/* Register rw_sap_in_owner, scope iop_sw_cfg, type rw */
141typedef struct {
142 unsigned int cfg : 2;
143 unsigned int dummy1 : 30;
144} reg_iop_sw_cfg_rw_sap_in_owner;
145#define REG_RD_ADDR_iop_sw_cfg_rw_sap_in_owner 28
146#define REG_WR_ADDR_iop_sw_cfg_rw_sap_in_owner 28
147
148/* Register rw_sap_out_owner, scope iop_sw_cfg, type rw */
149typedef struct {
150 unsigned int cfg : 2;
151 unsigned int dummy1 : 30;
152} reg_iop_sw_cfg_rw_sap_out_owner;
153#define REG_RD_ADDR_iop_sw_cfg_rw_sap_out_owner 32
154#define REG_WR_ADDR_iop_sw_cfg_rw_sap_out_owner 32
155
156/* Register rw_scrc_in_owner, scope iop_sw_cfg, type rw */
157typedef struct {
158 unsigned int cfg : 2;
159 unsigned int dummy1 : 30;
160} reg_iop_sw_cfg_rw_scrc_in_owner;
161#define REG_RD_ADDR_iop_sw_cfg_rw_scrc_in_owner 36
162#define REG_WR_ADDR_iop_sw_cfg_rw_scrc_in_owner 36
163
164/* Register rw_scrc_out_owner, scope iop_sw_cfg, type rw */
165typedef struct {
166 unsigned int cfg : 2;
167 unsigned int dummy1 : 30;
168} reg_iop_sw_cfg_rw_scrc_out_owner;
169#define REG_RD_ADDR_iop_sw_cfg_rw_scrc_out_owner 40
170#define REG_WR_ADDR_iop_sw_cfg_rw_scrc_out_owner 40
171
172/* Register rw_spu_owner, scope iop_sw_cfg, type rw */
173typedef struct {
174 unsigned int cfg : 1;
175 unsigned int dummy1 : 31;
176} reg_iop_sw_cfg_rw_spu_owner;
177#define REG_RD_ADDR_iop_sw_cfg_rw_spu_owner 44
178#define REG_WR_ADDR_iop_sw_cfg_rw_spu_owner 44
179
180/* Register rw_timer_grp0_owner, scope iop_sw_cfg, type rw */
181typedef struct {
182 unsigned int cfg : 2;
183 unsigned int dummy1 : 30;
184} reg_iop_sw_cfg_rw_timer_grp0_owner;
185#define REG_RD_ADDR_iop_sw_cfg_rw_timer_grp0_owner 48
186#define REG_WR_ADDR_iop_sw_cfg_rw_timer_grp0_owner 48
187
188/* Register rw_timer_grp1_owner, scope iop_sw_cfg, type rw */
189typedef struct {
190 unsigned int cfg : 2;
191 unsigned int dummy1 : 30;
192} reg_iop_sw_cfg_rw_timer_grp1_owner;
193#define REG_RD_ADDR_iop_sw_cfg_rw_timer_grp1_owner 52
194#define REG_WR_ADDR_iop_sw_cfg_rw_timer_grp1_owner 52
195
196/* Register rw_trigger_grp0_owner, scope iop_sw_cfg, type rw */
197typedef struct {
198 unsigned int cfg : 2;
199 unsigned int dummy1 : 30;
200} reg_iop_sw_cfg_rw_trigger_grp0_owner;
201#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp0_owner 56
202#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp0_owner 56
203
204/* Register rw_trigger_grp1_owner, scope iop_sw_cfg, type rw */
205typedef struct {
206 unsigned int cfg : 2;
207 unsigned int dummy1 : 30;
208} reg_iop_sw_cfg_rw_trigger_grp1_owner;
209#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp1_owner 60
210#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp1_owner 60
211
212/* Register rw_trigger_grp2_owner, scope iop_sw_cfg, type rw */
213typedef struct {
214 unsigned int cfg : 2;
215 unsigned int dummy1 : 30;
216} reg_iop_sw_cfg_rw_trigger_grp2_owner;
217#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp2_owner 64
218#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp2_owner 64
219
220/* Register rw_trigger_grp3_owner, scope iop_sw_cfg, type rw */
221typedef struct {
222 unsigned int cfg : 2;
223 unsigned int dummy1 : 30;
224} reg_iop_sw_cfg_rw_trigger_grp3_owner;
225#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp3_owner 68
226#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp3_owner 68
227
228/* Register rw_trigger_grp4_owner, scope iop_sw_cfg, type rw */
229typedef struct {
230 unsigned int cfg : 2;
231 unsigned int dummy1 : 30;
232} reg_iop_sw_cfg_rw_trigger_grp4_owner;
233#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp4_owner 72
234#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp4_owner 72
235
236/* Register rw_trigger_grp5_owner, scope iop_sw_cfg, type rw */
237typedef struct {
238 unsigned int cfg : 2;
239 unsigned int dummy1 : 30;
240} reg_iop_sw_cfg_rw_trigger_grp5_owner;
241#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp5_owner 76
242#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp5_owner 76
243
244/* Register rw_trigger_grp6_owner, scope iop_sw_cfg, type rw */
245typedef struct {
246 unsigned int cfg : 2;
247 unsigned int dummy1 : 30;
248} reg_iop_sw_cfg_rw_trigger_grp6_owner;
249#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp6_owner 80
250#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp6_owner 80
251
252/* Register rw_trigger_grp7_owner, scope iop_sw_cfg, type rw */
253typedef struct {
254 unsigned int cfg : 2;
255 unsigned int dummy1 : 30;
256} reg_iop_sw_cfg_rw_trigger_grp7_owner;
257#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp7_owner 84
258#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp7_owner 84
259
260/* Register rw_bus_mask, scope iop_sw_cfg, type rw */
261typedef struct {
262 unsigned int byte0 : 8;
263 unsigned int byte1 : 8;
264 unsigned int byte2 : 8;
265 unsigned int byte3 : 8;
266} reg_iop_sw_cfg_rw_bus_mask;
267#define REG_RD_ADDR_iop_sw_cfg_rw_bus_mask 88
268#define REG_WR_ADDR_iop_sw_cfg_rw_bus_mask 88
269
270/* Register rw_bus_oe_mask, scope iop_sw_cfg, type rw */
271typedef struct {
272 unsigned int byte0 : 1;
273 unsigned int byte1 : 1;
274 unsigned int byte2 : 1;
275 unsigned int byte3 : 1;
276 unsigned int dummy1 : 28;
277} reg_iop_sw_cfg_rw_bus_oe_mask;
278#define REG_RD_ADDR_iop_sw_cfg_rw_bus_oe_mask 92
279#define REG_WR_ADDR_iop_sw_cfg_rw_bus_oe_mask 92
280
281/* Register rw_gio_mask, scope iop_sw_cfg, type rw */
282typedef struct {
283 unsigned int val : 32;
284} reg_iop_sw_cfg_rw_gio_mask;
285#define REG_RD_ADDR_iop_sw_cfg_rw_gio_mask 96
286#define REG_WR_ADDR_iop_sw_cfg_rw_gio_mask 96
287
288/* Register rw_gio_oe_mask, scope iop_sw_cfg, type rw */
289typedef struct {
290 unsigned int val : 32;
291} reg_iop_sw_cfg_rw_gio_oe_mask;
292#define REG_RD_ADDR_iop_sw_cfg_rw_gio_oe_mask 100
293#define REG_WR_ADDR_iop_sw_cfg_rw_gio_oe_mask 100
294
295/* Register rw_pinmapping, scope iop_sw_cfg, type rw */
296typedef struct {
297 unsigned int bus_byte0 : 2;
298 unsigned int bus_byte1 : 2;
299 unsigned int bus_byte2 : 2;
300 unsigned int bus_byte3 : 2;
301 unsigned int gio3_0 : 2;
302 unsigned int gio7_4 : 2;
303 unsigned int gio11_8 : 2;
304 unsigned int gio15_12 : 2;
305 unsigned int gio19_16 : 2;
306 unsigned int gio23_20 : 2;
307 unsigned int gio27_24 : 2;
308 unsigned int gio31_28 : 2;
309 unsigned int dummy1 : 8;
310} reg_iop_sw_cfg_rw_pinmapping;
311#define REG_RD_ADDR_iop_sw_cfg_rw_pinmapping 104
312#define REG_WR_ADDR_iop_sw_cfg_rw_pinmapping 104
313
314/* Register rw_bus_out_cfg, scope iop_sw_cfg, type rw */
315typedef struct {
316 unsigned int bus_lo : 2;
317 unsigned int bus_hi : 2;
318 unsigned int bus_lo_oe : 2;
319 unsigned int bus_hi_oe : 2;
320 unsigned int dummy1 : 24;
321} reg_iop_sw_cfg_rw_bus_out_cfg;
322#define REG_RD_ADDR_iop_sw_cfg_rw_bus_out_cfg 108
323#define REG_WR_ADDR_iop_sw_cfg_rw_bus_out_cfg 108
324
325/* Register rw_gio_out_grp0_cfg, scope iop_sw_cfg, type rw */
326typedef struct {
327 unsigned int gio0 : 3;
328 unsigned int gio0_oe : 1;
329 unsigned int gio1 : 3;
330 unsigned int gio1_oe : 1;
331 unsigned int gio2 : 3;
332 unsigned int gio2_oe : 1;
333 unsigned int gio3 : 3;
334 unsigned int gio3_oe : 1;
335 unsigned int dummy1 : 16;
336} reg_iop_sw_cfg_rw_gio_out_grp0_cfg;
337#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp0_cfg 112
338#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp0_cfg 112
339
340/* Register rw_gio_out_grp1_cfg, scope iop_sw_cfg, type rw */
341typedef struct {
342 unsigned int gio4 : 3;
343 unsigned int gio4_oe : 1;
344 unsigned int gio5 : 3;
345 unsigned int gio5_oe : 1;
346 unsigned int gio6 : 3;
347 unsigned int gio6_oe : 1;
348 unsigned int gio7 : 3;
349 unsigned int gio7_oe : 1;
350 unsigned int dummy1 : 16;
351} reg_iop_sw_cfg_rw_gio_out_grp1_cfg;
352#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp1_cfg 116
353#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp1_cfg 116
354
355/* Register rw_gio_out_grp2_cfg, scope iop_sw_cfg, type rw */
356typedef struct {
357 unsigned int gio8 : 3;
358 unsigned int gio8_oe : 1;
359 unsigned int gio9 : 3;
360 unsigned int gio9_oe : 1;
361 unsigned int gio10 : 3;
362 unsigned int gio10_oe : 1;
363 unsigned int gio11 : 3;
364 unsigned int gio11_oe : 1;
365 unsigned int dummy1 : 16;
366} reg_iop_sw_cfg_rw_gio_out_grp2_cfg;
367#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp2_cfg 120
368#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp2_cfg 120
369
370/* Register rw_gio_out_grp3_cfg, scope iop_sw_cfg, type rw */
371typedef struct {
372 unsigned int gio12 : 3;
373 unsigned int gio12_oe : 1;
374 unsigned int gio13 : 3;
375 unsigned int gio13_oe : 1;
376 unsigned int gio14 : 3;
377 unsigned int gio14_oe : 1;
378 unsigned int gio15 : 3;
379 unsigned int gio15_oe : 1;
380 unsigned int dummy1 : 16;
381} reg_iop_sw_cfg_rw_gio_out_grp3_cfg;
382#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp3_cfg 124
383#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp3_cfg 124
384
385/* Register rw_gio_out_grp4_cfg, scope iop_sw_cfg, type rw */
386typedef struct {
387 unsigned int gio16 : 3;
388 unsigned int gio16_oe : 1;
389 unsigned int gio17 : 3;
390 unsigned int gio17_oe : 1;
391 unsigned int gio18 : 3;
392 unsigned int gio18_oe : 1;
393 unsigned int gio19 : 3;
394 unsigned int gio19_oe : 1;
395 unsigned int dummy1 : 16;
396} reg_iop_sw_cfg_rw_gio_out_grp4_cfg;
397#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp4_cfg 128
398#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp4_cfg 128
399
400/* Register rw_gio_out_grp5_cfg, scope iop_sw_cfg, type rw */
401typedef struct {
402 unsigned int gio20 : 3;
403 unsigned int gio20_oe : 1;
404 unsigned int gio21 : 3;
405 unsigned int gio21_oe : 1;
406 unsigned int gio22 : 3;
407 unsigned int gio22_oe : 1;
408 unsigned int gio23 : 3;
409 unsigned int gio23_oe : 1;
410 unsigned int dummy1 : 16;
411} reg_iop_sw_cfg_rw_gio_out_grp5_cfg;
412#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp5_cfg 132
413#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp5_cfg 132
414
415/* Register rw_gio_out_grp6_cfg, scope iop_sw_cfg, type rw */
416typedef struct {
417 unsigned int gio24 : 3;
418 unsigned int gio24_oe : 1;
419 unsigned int gio25 : 3;
420 unsigned int gio25_oe : 1;
421 unsigned int gio26 : 3;
422 unsigned int gio26_oe : 1;
423 unsigned int gio27 : 3;
424 unsigned int gio27_oe : 1;
425 unsigned int dummy1 : 16;
426} reg_iop_sw_cfg_rw_gio_out_grp6_cfg;
427#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp6_cfg 136
428#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp6_cfg 136
429
430/* Register rw_gio_out_grp7_cfg, scope iop_sw_cfg, type rw */
431typedef struct {
432 unsigned int gio28 : 3;
433 unsigned int gio28_oe : 1;
434 unsigned int gio29 : 3;
435 unsigned int gio29_oe : 1;
436 unsigned int gio30 : 3;
437 unsigned int gio30_oe : 1;
438 unsigned int gio31 : 3;
439 unsigned int gio31_oe : 1;
440 unsigned int dummy1 : 16;
441} reg_iop_sw_cfg_rw_gio_out_grp7_cfg;
442#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp7_cfg 140
443#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp7_cfg 140
444
445/* Register rw_spu_cfg, scope iop_sw_cfg, type rw */
446typedef struct {
447 unsigned int bus0_in : 1;
448 unsigned int bus1_in : 1;
449 unsigned int dummy1 : 30;
450} reg_iop_sw_cfg_rw_spu_cfg;
451#define REG_RD_ADDR_iop_sw_cfg_rw_spu_cfg 144
452#define REG_WR_ADDR_iop_sw_cfg_rw_spu_cfg 144
453
454/* Register rw_timer_grp0_cfg, scope iop_sw_cfg, type rw */
455typedef struct {
456 unsigned int ext_clk : 3;
457 unsigned int tmr0_en : 2;
458 unsigned int tmr1_en : 2;
459 unsigned int tmr2_en : 2;
460 unsigned int tmr3_en : 2;
461 unsigned int tmr0_dis : 2;
462 unsigned int tmr1_dis : 2;
463 unsigned int tmr2_dis : 2;
464 unsigned int tmr3_dis : 2;
465 unsigned int dummy1 : 13;
466} reg_iop_sw_cfg_rw_timer_grp0_cfg;
467#define REG_RD_ADDR_iop_sw_cfg_rw_timer_grp0_cfg 148
468#define REG_WR_ADDR_iop_sw_cfg_rw_timer_grp0_cfg 148
469
470/* Register rw_timer_grp1_cfg, scope iop_sw_cfg, type rw */
471typedef struct {
472 unsigned int ext_clk : 3;
473 unsigned int tmr0_en : 2;
474 unsigned int tmr1_en : 2;
475 unsigned int tmr2_en : 2;
476 unsigned int tmr3_en : 2;
477 unsigned int tmr0_dis : 2;
478 unsigned int tmr1_dis : 2;
479 unsigned int tmr2_dis : 2;
480 unsigned int tmr3_dis : 2;
481 unsigned int dummy1 : 13;
482} reg_iop_sw_cfg_rw_timer_grp1_cfg;
483#define REG_RD_ADDR_iop_sw_cfg_rw_timer_grp1_cfg 152
484#define REG_WR_ADDR_iop_sw_cfg_rw_timer_grp1_cfg 152
485
486/* Register rw_trigger_grps_cfg, scope iop_sw_cfg, type rw */
487typedef struct {
488 unsigned int grp0_dis : 1;
489 unsigned int grp0_en : 1;
490 unsigned int grp1_dis : 1;
491 unsigned int grp1_en : 1;
492 unsigned int grp2_dis : 1;
493 unsigned int grp2_en : 1;
494 unsigned int grp3_dis : 1;
495 unsigned int grp3_en : 1;
496 unsigned int grp4_dis : 1;
497 unsigned int grp4_en : 1;
498 unsigned int grp5_dis : 1;
499 unsigned int grp5_en : 1;
500 unsigned int grp6_dis : 1;
501 unsigned int grp6_en : 1;
502 unsigned int grp7_dis : 1;
503 unsigned int grp7_en : 1;
504 unsigned int dummy1 : 16;
505} reg_iop_sw_cfg_rw_trigger_grps_cfg;
506#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grps_cfg 156
507#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grps_cfg 156
508
509/* Register rw_pdp_cfg, scope iop_sw_cfg, type rw */
510typedef struct {
511 unsigned int out_strb : 4;
512 unsigned int in_src : 2;
513 unsigned int in_size : 3;
514 unsigned int in_last : 2;
515 unsigned int in_strb : 4;
516 unsigned int dummy1 : 17;
517} reg_iop_sw_cfg_rw_pdp_cfg;
518#define REG_RD_ADDR_iop_sw_cfg_rw_pdp_cfg 160
519#define REG_WR_ADDR_iop_sw_cfg_rw_pdp_cfg 160
520
521/* Register rw_sdp_cfg, scope iop_sw_cfg, type rw */
522typedef struct {
523 unsigned int sdp_out_strb : 3;
524 unsigned int sdp_in_data : 3;
525 unsigned int sdp_in_last : 2;
526 unsigned int sdp_in_strb : 3;
527 unsigned int dummy1 : 21;
528} reg_iop_sw_cfg_rw_sdp_cfg;
529#define REG_RD_ADDR_iop_sw_cfg_rw_sdp_cfg 164
530#define REG_WR_ADDR_iop_sw_cfg_rw_sdp_cfg 164
531
532
533/* Constants */
534enum {
535 regk_iop_sw_cfg_a = 0x00000001,
536 regk_iop_sw_cfg_b = 0x00000002,
537 regk_iop_sw_cfg_bus = 0x00000000,
538 regk_iop_sw_cfg_bus_rot16 = 0x00000002,
539 regk_iop_sw_cfg_bus_rot24 = 0x00000003,
540 regk_iop_sw_cfg_bus_rot8 = 0x00000001,
541 regk_iop_sw_cfg_clk12 = 0x00000000,
542 regk_iop_sw_cfg_cpu = 0x00000000,
543 regk_iop_sw_cfg_gated_clk0 = 0x0000000e,
544 regk_iop_sw_cfg_gated_clk1 = 0x0000000f,
545 regk_iop_sw_cfg_gio0 = 0x00000004,
546 regk_iop_sw_cfg_gio1 = 0x00000001,
547 regk_iop_sw_cfg_gio2 = 0x00000005,
548 regk_iop_sw_cfg_gio3 = 0x00000002,
549 regk_iop_sw_cfg_gio4 = 0x00000006,
550 regk_iop_sw_cfg_gio5 = 0x00000003,
551 regk_iop_sw_cfg_gio6 = 0x00000007,
552 regk_iop_sw_cfg_gio7 = 0x00000004,
553 regk_iop_sw_cfg_gio_in18 = 0x00000002,
554 regk_iop_sw_cfg_gio_in19 = 0x00000003,
555 regk_iop_sw_cfg_gio_in20 = 0x00000004,
556 regk_iop_sw_cfg_gio_in21 = 0x00000005,
557 regk_iop_sw_cfg_gio_in26 = 0x00000006,
558 regk_iop_sw_cfg_gio_in27 = 0x00000007,
559 regk_iop_sw_cfg_gio_in4 = 0x00000000,
560 regk_iop_sw_cfg_gio_in5 = 0x00000001,
561 regk_iop_sw_cfg_last_timer_grp0_tmr2 = 0x00000001,
562 regk_iop_sw_cfg_last_timer_grp1_tmr2 = 0x00000002,
563 regk_iop_sw_cfg_last_timer_grp1_tmr3 = 0x00000003,
564 regk_iop_sw_cfg_mpu = 0x00000001,
565 regk_iop_sw_cfg_none = 0x00000000,
566 regk_iop_sw_cfg_pdp_out = 0x00000001,
567 regk_iop_sw_cfg_pdp_out_hi = 0x00000001,
568 regk_iop_sw_cfg_pdp_out_lo = 0x00000000,
569 regk_iop_sw_cfg_rw_bus_mask_default = 0x00000000,
570 regk_iop_sw_cfg_rw_bus_oe_mask_default = 0x00000000,
571 regk_iop_sw_cfg_rw_bus_out_cfg_default = 0x00000000,
572 regk_iop_sw_cfg_rw_crc_par_owner_default = 0x00000000,
573 regk_iop_sw_cfg_rw_dmc_in_owner_default = 0x00000000,
574 regk_iop_sw_cfg_rw_dmc_out_owner_default = 0x00000000,
575 regk_iop_sw_cfg_rw_fifo_in_extra_owner_default = 0x00000000,
576 regk_iop_sw_cfg_rw_fifo_in_owner_default = 0x00000000,
577 regk_iop_sw_cfg_rw_fifo_out_extra_owner_default = 0x00000000,
578 regk_iop_sw_cfg_rw_fifo_out_owner_default = 0x00000000,
579 regk_iop_sw_cfg_rw_gio_mask_default = 0x00000000,
580 regk_iop_sw_cfg_rw_gio_oe_mask_default = 0x00000000,
581 regk_iop_sw_cfg_rw_gio_out_grp0_cfg_default = 0x00000000,
582 regk_iop_sw_cfg_rw_gio_out_grp1_cfg_default = 0x00000000,
583 regk_iop_sw_cfg_rw_gio_out_grp2_cfg_default = 0x00000000,
584 regk_iop_sw_cfg_rw_gio_out_grp3_cfg_default = 0x00000000,
585 regk_iop_sw_cfg_rw_gio_out_grp4_cfg_default = 0x00000000,
586 regk_iop_sw_cfg_rw_gio_out_grp5_cfg_default = 0x00000000,
587 regk_iop_sw_cfg_rw_gio_out_grp6_cfg_default = 0x00000000,
588 regk_iop_sw_cfg_rw_gio_out_grp7_cfg_default = 0x00000000,
589 regk_iop_sw_cfg_rw_pdp_cfg_default = 0x00000000,
590 regk_iop_sw_cfg_rw_pinmapping_default = 0x00555555,
591 regk_iop_sw_cfg_rw_sap_in_owner_default = 0x00000000,
592 regk_iop_sw_cfg_rw_sap_out_owner_default = 0x00000000,
593 regk_iop_sw_cfg_rw_scrc_in_owner_default = 0x00000000,
594 regk_iop_sw_cfg_rw_scrc_out_owner_default = 0x00000000,
595 regk_iop_sw_cfg_rw_sdp_cfg_default = 0x00000000,
596 regk_iop_sw_cfg_rw_spu_cfg_default = 0x00000000,
597 regk_iop_sw_cfg_rw_spu_owner_default = 0x00000000,
598 regk_iop_sw_cfg_rw_timer_grp0_cfg_default = 0x00000000,
599 regk_iop_sw_cfg_rw_timer_grp0_owner_default = 0x00000000,
600 regk_iop_sw_cfg_rw_timer_grp1_cfg_default = 0x00000000,
601 regk_iop_sw_cfg_rw_timer_grp1_owner_default = 0x00000000,
602 regk_iop_sw_cfg_rw_trigger_grp0_owner_default = 0x00000000,
603 regk_iop_sw_cfg_rw_trigger_grp1_owner_default = 0x00000000,
604 regk_iop_sw_cfg_rw_trigger_grp2_owner_default = 0x00000000,
605 regk_iop_sw_cfg_rw_trigger_grp3_owner_default = 0x00000000,
606 regk_iop_sw_cfg_rw_trigger_grp4_owner_default = 0x00000000,
607 regk_iop_sw_cfg_rw_trigger_grp5_owner_default = 0x00000000,
608 regk_iop_sw_cfg_rw_trigger_grp6_owner_default = 0x00000000,
609 regk_iop_sw_cfg_rw_trigger_grp7_owner_default = 0x00000000,
610 regk_iop_sw_cfg_rw_trigger_grps_cfg_default = 0x00000000,
611 regk_iop_sw_cfg_sdp_out = 0x00000004,
612 regk_iop_sw_cfg_size16 = 0x00000002,
613 regk_iop_sw_cfg_size24 = 0x00000003,
614 regk_iop_sw_cfg_size32 = 0x00000004,
615 regk_iop_sw_cfg_size8 = 0x00000001,
616 regk_iop_sw_cfg_spu = 0x00000002,
617 regk_iop_sw_cfg_spu_bus_out0_hi = 0x00000002,
618 regk_iop_sw_cfg_spu_bus_out0_lo = 0x00000002,
619 regk_iop_sw_cfg_spu_bus_out1_hi = 0x00000003,
620 regk_iop_sw_cfg_spu_bus_out1_lo = 0x00000003,
621 regk_iop_sw_cfg_spu_g0 = 0x00000007,
622 regk_iop_sw_cfg_spu_g1 = 0x00000007,
623 regk_iop_sw_cfg_spu_g2 = 0x00000007,
624 regk_iop_sw_cfg_spu_g3 = 0x00000007,
625 regk_iop_sw_cfg_spu_g4 = 0x00000007,
626 regk_iop_sw_cfg_spu_g5 = 0x00000007,
627 regk_iop_sw_cfg_spu_g6 = 0x00000007,
628 regk_iop_sw_cfg_spu_g7 = 0x00000007,
629 regk_iop_sw_cfg_spu_gio0 = 0x00000000,
630 regk_iop_sw_cfg_spu_gio1 = 0x00000001,
631 regk_iop_sw_cfg_spu_gio5 = 0x00000005,
632 regk_iop_sw_cfg_spu_gio6 = 0x00000006,
633 regk_iop_sw_cfg_spu_gio7 = 0x00000007,
634 regk_iop_sw_cfg_spu_gio_out0 = 0x00000008,
635 regk_iop_sw_cfg_spu_gio_out1 = 0x00000009,
636 regk_iop_sw_cfg_spu_gio_out2 = 0x0000000a,
637 regk_iop_sw_cfg_spu_gio_out3 = 0x0000000b,
638 regk_iop_sw_cfg_spu_gio_out4 = 0x0000000c,
639 regk_iop_sw_cfg_spu_gio_out5 = 0x0000000d,
640 regk_iop_sw_cfg_spu_gio_out6 = 0x0000000e,
641 regk_iop_sw_cfg_spu_gio_out7 = 0x0000000f,
642 regk_iop_sw_cfg_spu_gioout0 = 0x00000000,
643 regk_iop_sw_cfg_spu_gioout1 = 0x00000000,
644 regk_iop_sw_cfg_spu_gioout10 = 0x00000007,
645 regk_iop_sw_cfg_spu_gioout11 = 0x00000007,
646 regk_iop_sw_cfg_spu_gioout12 = 0x00000007,
647 regk_iop_sw_cfg_spu_gioout13 = 0x00000007,
648 regk_iop_sw_cfg_spu_gioout14 = 0x00000007,
649 regk_iop_sw_cfg_spu_gioout15 = 0x00000007,
650 regk_iop_sw_cfg_spu_gioout16 = 0x00000007,
651 regk_iop_sw_cfg_spu_gioout17 = 0x00000007,
652 regk_iop_sw_cfg_spu_gioout18 = 0x00000007,
653 regk_iop_sw_cfg_spu_gioout19 = 0x00000007,
654 regk_iop_sw_cfg_spu_gioout2 = 0x00000001,
655 regk_iop_sw_cfg_spu_gioout20 = 0x00000007,
656 regk_iop_sw_cfg_spu_gioout21 = 0x00000007,
657 regk_iop_sw_cfg_spu_gioout22 = 0x00000007,
658 regk_iop_sw_cfg_spu_gioout23 = 0x00000007,
659 regk_iop_sw_cfg_spu_gioout24 = 0x00000007,
660 regk_iop_sw_cfg_spu_gioout25 = 0x00000007,
661 regk_iop_sw_cfg_spu_gioout26 = 0x00000007,
662 regk_iop_sw_cfg_spu_gioout27 = 0x00000007,
663 regk_iop_sw_cfg_spu_gioout28 = 0x00000007,
664 regk_iop_sw_cfg_spu_gioout29 = 0x00000007,
665 regk_iop_sw_cfg_spu_gioout3 = 0x00000001,
666 regk_iop_sw_cfg_spu_gioout30 = 0x00000007,
667 regk_iop_sw_cfg_spu_gioout31 = 0x00000007,
668 regk_iop_sw_cfg_spu_gioout4 = 0x00000002,
669 regk_iop_sw_cfg_spu_gioout5 = 0x00000002,
670 regk_iop_sw_cfg_spu_gioout6 = 0x00000003,
671 regk_iop_sw_cfg_spu_gioout7 = 0x00000003,
672 regk_iop_sw_cfg_spu_gioout8 = 0x00000007,
673 regk_iop_sw_cfg_spu_gioout9 = 0x00000007,
674 regk_iop_sw_cfg_strb_timer_grp0_tmr0 = 0x00000001,
675 regk_iop_sw_cfg_strb_timer_grp0_tmr1 = 0x00000002,
676 regk_iop_sw_cfg_strb_timer_grp1_tmr0 = 0x00000003,
677 regk_iop_sw_cfg_strb_timer_grp1_tmr1 = 0x00000002,
678 regk_iop_sw_cfg_timer_grp0 = 0x00000000,
679 regk_iop_sw_cfg_timer_grp0_rot = 0x00000001,
680 regk_iop_sw_cfg_timer_grp0_strb0 = 0x00000005,
681 regk_iop_sw_cfg_timer_grp0_strb1 = 0x00000005,
682 regk_iop_sw_cfg_timer_grp0_strb2 = 0x00000005,
683 regk_iop_sw_cfg_timer_grp0_strb3 = 0x00000005,
684 regk_iop_sw_cfg_timer_grp0_tmr0 = 0x00000002,
685 regk_iop_sw_cfg_timer_grp1 = 0x00000000,
686 regk_iop_sw_cfg_timer_grp1_rot = 0x00000001,
687 regk_iop_sw_cfg_timer_grp1_strb0 = 0x00000006,
688 regk_iop_sw_cfg_timer_grp1_strb1 = 0x00000006,
689 regk_iop_sw_cfg_timer_grp1_strb2 = 0x00000006,
690 regk_iop_sw_cfg_timer_grp1_strb3 = 0x00000006,
691 regk_iop_sw_cfg_timer_grp1_tmr0 = 0x00000003,
692 regk_iop_sw_cfg_trig0_0 = 0x00000000,
693 regk_iop_sw_cfg_trig0_1 = 0x00000000,
694 regk_iop_sw_cfg_trig0_2 = 0x00000000,
695 regk_iop_sw_cfg_trig0_3 = 0x00000000,
696 regk_iop_sw_cfg_trig1_0 = 0x00000000,
697 regk_iop_sw_cfg_trig1_1 = 0x00000000,
698 regk_iop_sw_cfg_trig1_2 = 0x00000000,
699 regk_iop_sw_cfg_trig1_3 = 0x00000000,
700 regk_iop_sw_cfg_trig2_0 = 0x00000001,
701 regk_iop_sw_cfg_trig2_1 = 0x00000001,
702 regk_iop_sw_cfg_trig2_2 = 0x00000001,
703 regk_iop_sw_cfg_trig2_3 = 0x00000001,
704 regk_iop_sw_cfg_trig3_0 = 0x00000001,
705 regk_iop_sw_cfg_trig3_1 = 0x00000001,
706 regk_iop_sw_cfg_trig3_2 = 0x00000001,
707 regk_iop_sw_cfg_trig3_3 = 0x00000001,
708 regk_iop_sw_cfg_trig4_0 = 0x00000002,
709 regk_iop_sw_cfg_trig4_1 = 0x00000002,
710 regk_iop_sw_cfg_trig4_2 = 0x00000002,
711 regk_iop_sw_cfg_trig4_3 = 0x00000002,
712 regk_iop_sw_cfg_trig5_0 = 0x00000002,
713 regk_iop_sw_cfg_trig5_1 = 0x00000002,
714 regk_iop_sw_cfg_trig5_2 = 0x00000002,
715 regk_iop_sw_cfg_trig5_3 = 0x00000002,
716 regk_iop_sw_cfg_trig6_0 = 0x00000003,
717 regk_iop_sw_cfg_trig6_1 = 0x00000003,
718 regk_iop_sw_cfg_trig6_2 = 0x00000003,
719 regk_iop_sw_cfg_trig6_3 = 0x00000003,
720 regk_iop_sw_cfg_trig7_0 = 0x00000003,
721 regk_iop_sw_cfg_trig7_1 = 0x00000003,
722 regk_iop_sw_cfg_trig7_2 = 0x00000003,
723 regk_iop_sw_cfg_trig7_3 = 0x00000003
724};
725#endif /* __iop_sw_cfg_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_cpu_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_cpu_defs.h
new file mode 100644
index 000000000000..a16f556370eb
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_cpu_defs.h
@@ -0,0 +1,522 @@
1#ifndef __iop_sw_cpu_defs_h
2#define __iop_sw_cpu_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_sw_cpu.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile iop_sw_cpu_defs.h iop_sw_cpu.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope iop_sw_cpu */
83
84/* Register r_mpu_trace, scope iop_sw_cpu, type r */
85typedef unsigned int reg_iop_sw_cpu_r_mpu_trace;
86#define REG_RD_ADDR_iop_sw_cpu_r_mpu_trace 0
87
88/* Register r_spu_trace, scope iop_sw_cpu, type r */
89typedef unsigned int reg_iop_sw_cpu_r_spu_trace;
90#define REG_RD_ADDR_iop_sw_cpu_r_spu_trace 4
91
92/* Register r_spu_fsm_trace, scope iop_sw_cpu, type r */
93typedef unsigned int reg_iop_sw_cpu_r_spu_fsm_trace;
94#define REG_RD_ADDR_iop_sw_cpu_r_spu_fsm_trace 8
95
96/* Register rw_mc_ctrl, scope iop_sw_cpu, type rw */
97typedef struct {
98 unsigned int keep_owner : 1;
99 unsigned int cmd : 2;
100 unsigned int size : 3;
101 unsigned int wr_spu_mem : 1;
102 unsigned int dummy1 : 25;
103} reg_iop_sw_cpu_rw_mc_ctrl;
104#define REG_RD_ADDR_iop_sw_cpu_rw_mc_ctrl 12
105#define REG_WR_ADDR_iop_sw_cpu_rw_mc_ctrl 12
106
107/* Register rw_mc_data, scope iop_sw_cpu, type rw */
108typedef struct {
109 unsigned int val : 32;
110} reg_iop_sw_cpu_rw_mc_data;
111#define REG_RD_ADDR_iop_sw_cpu_rw_mc_data 16
112#define REG_WR_ADDR_iop_sw_cpu_rw_mc_data 16
113
114/* Register rw_mc_addr, scope iop_sw_cpu, type rw */
115typedef unsigned int reg_iop_sw_cpu_rw_mc_addr;
116#define REG_RD_ADDR_iop_sw_cpu_rw_mc_addr 20
117#define REG_WR_ADDR_iop_sw_cpu_rw_mc_addr 20
118
119/* Register rs_mc_data, scope iop_sw_cpu, type rs */
120typedef unsigned int reg_iop_sw_cpu_rs_mc_data;
121#define REG_RD_ADDR_iop_sw_cpu_rs_mc_data 24
122
123/* Register r_mc_data, scope iop_sw_cpu, type r */
124typedef unsigned int reg_iop_sw_cpu_r_mc_data;
125#define REG_RD_ADDR_iop_sw_cpu_r_mc_data 28
126
127/* Register r_mc_stat, scope iop_sw_cpu, type r */
128typedef struct {
129 unsigned int busy_cpu : 1;
130 unsigned int busy_mpu : 1;
131 unsigned int busy_spu : 1;
132 unsigned int owned_by_cpu : 1;
133 unsigned int owned_by_mpu : 1;
134 unsigned int owned_by_spu : 1;
135 unsigned int dummy1 : 26;
136} reg_iop_sw_cpu_r_mc_stat;
137#define REG_RD_ADDR_iop_sw_cpu_r_mc_stat 32
138
139/* Register rw_bus_clr_mask, scope iop_sw_cpu, type rw */
140typedef struct {
141 unsigned int byte0 : 8;
142 unsigned int byte1 : 8;
143 unsigned int byte2 : 8;
144 unsigned int byte3 : 8;
145} reg_iop_sw_cpu_rw_bus_clr_mask;
146#define REG_RD_ADDR_iop_sw_cpu_rw_bus_clr_mask 36
147#define REG_WR_ADDR_iop_sw_cpu_rw_bus_clr_mask 36
148
149/* Register rw_bus_set_mask, scope iop_sw_cpu, type rw */
150typedef struct {
151 unsigned int byte0 : 8;
152 unsigned int byte1 : 8;
153 unsigned int byte2 : 8;
154 unsigned int byte3 : 8;
155} reg_iop_sw_cpu_rw_bus_set_mask;
156#define REG_RD_ADDR_iop_sw_cpu_rw_bus_set_mask 40
157#define REG_WR_ADDR_iop_sw_cpu_rw_bus_set_mask 40
158
159/* Register rw_bus_oe_clr_mask, scope iop_sw_cpu, type rw */
160typedef struct {
161 unsigned int byte0 : 1;
162 unsigned int byte1 : 1;
163 unsigned int byte2 : 1;
164 unsigned int byte3 : 1;
165 unsigned int dummy1 : 28;
166} reg_iop_sw_cpu_rw_bus_oe_clr_mask;
167#define REG_RD_ADDR_iop_sw_cpu_rw_bus_oe_clr_mask 44
168#define REG_WR_ADDR_iop_sw_cpu_rw_bus_oe_clr_mask 44
169
170/* Register rw_bus_oe_set_mask, scope iop_sw_cpu, type rw */
171typedef struct {
172 unsigned int byte0 : 1;
173 unsigned int byte1 : 1;
174 unsigned int byte2 : 1;
175 unsigned int byte3 : 1;
176 unsigned int dummy1 : 28;
177} reg_iop_sw_cpu_rw_bus_oe_set_mask;
178#define REG_RD_ADDR_iop_sw_cpu_rw_bus_oe_set_mask 48
179#define REG_WR_ADDR_iop_sw_cpu_rw_bus_oe_set_mask 48
180
181/* Register r_bus_in, scope iop_sw_cpu, type r */
182typedef unsigned int reg_iop_sw_cpu_r_bus_in;
183#define REG_RD_ADDR_iop_sw_cpu_r_bus_in 52
184
185/* Register rw_gio_clr_mask, scope iop_sw_cpu, type rw */
186typedef struct {
187 unsigned int val : 32;
188} reg_iop_sw_cpu_rw_gio_clr_mask;
189#define REG_RD_ADDR_iop_sw_cpu_rw_gio_clr_mask 56
190#define REG_WR_ADDR_iop_sw_cpu_rw_gio_clr_mask 56
191
192/* Register rw_gio_set_mask, scope iop_sw_cpu, type rw */
193typedef struct {
194 unsigned int val : 32;
195} reg_iop_sw_cpu_rw_gio_set_mask;
196#define REG_RD_ADDR_iop_sw_cpu_rw_gio_set_mask 60
197#define REG_WR_ADDR_iop_sw_cpu_rw_gio_set_mask 60
198
199/* Register rw_gio_oe_clr_mask, scope iop_sw_cpu, type rw */
200typedef struct {
201 unsigned int val : 32;
202} reg_iop_sw_cpu_rw_gio_oe_clr_mask;
203#define REG_RD_ADDR_iop_sw_cpu_rw_gio_oe_clr_mask 64
204#define REG_WR_ADDR_iop_sw_cpu_rw_gio_oe_clr_mask 64
205
206/* Register rw_gio_oe_set_mask, scope iop_sw_cpu, type rw */
207typedef struct {
208 unsigned int val : 32;
209} reg_iop_sw_cpu_rw_gio_oe_set_mask;
210#define REG_RD_ADDR_iop_sw_cpu_rw_gio_oe_set_mask 68
211#define REG_WR_ADDR_iop_sw_cpu_rw_gio_oe_set_mask 68
212
213/* Register r_gio_in, scope iop_sw_cpu, type r */
214typedef unsigned int reg_iop_sw_cpu_r_gio_in;
215#define REG_RD_ADDR_iop_sw_cpu_r_gio_in 72
216
217/* Register rw_intr0_mask, scope iop_sw_cpu, type rw */
218typedef struct {
219 unsigned int mpu_0 : 1;
220 unsigned int mpu_1 : 1;
221 unsigned int mpu_2 : 1;
222 unsigned int mpu_3 : 1;
223 unsigned int mpu_4 : 1;
224 unsigned int mpu_5 : 1;
225 unsigned int mpu_6 : 1;
226 unsigned int mpu_7 : 1;
227 unsigned int mpu_8 : 1;
228 unsigned int mpu_9 : 1;
229 unsigned int mpu_10 : 1;
230 unsigned int mpu_11 : 1;
231 unsigned int mpu_12 : 1;
232 unsigned int mpu_13 : 1;
233 unsigned int mpu_14 : 1;
234 unsigned int mpu_15 : 1;
235 unsigned int spu_0 : 1;
236 unsigned int spu_1 : 1;
237 unsigned int spu_2 : 1;
238 unsigned int spu_3 : 1;
239 unsigned int spu_4 : 1;
240 unsigned int spu_5 : 1;
241 unsigned int spu_6 : 1;
242 unsigned int spu_7 : 1;
243 unsigned int spu_8 : 1;
244 unsigned int spu_9 : 1;
245 unsigned int spu_10 : 1;
246 unsigned int spu_11 : 1;
247 unsigned int spu_12 : 1;
248 unsigned int spu_13 : 1;
249 unsigned int spu_14 : 1;
250 unsigned int spu_15 : 1;
251} reg_iop_sw_cpu_rw_intr0_mask;
252#define REG_RD_ADDR_iop_sw_cpu_rw_intr0_mask 76
253#define REG_WR_ADDR_iop_sw_cpu_rw_intr0_mask 76
254
255/* Register rw_ack_intr0, scope iop_sw_cpu, type rw */
256typedef struct {
257 unsigned int mpu_0 : 1;
258 unsigned int mpu_1 : 1;
259 unsigned int mpu_2 : 1;
260 unsigned int mpu_3 : 1;
261 unsigned int mpu_4 : 1;
262 unsigned int mpu_5 : 1;
263 unsigned int mpu_6 : 1;
264 unsigned int mpu_7 : 1;
265 unsigned int mpu_8 : 1;
266 unsigned int mpu_9 : 1;
267 unsigned int mpu_10 : 1;
268 unsigned int mpu_11 : 1;
269 unsigned int mpu_12 : 1;
270 unsigned int mpu_13 : 1;
271 unsigned int mpu_14 : 1;
272 unsigned int mpu_15 : 1;
273 unsigned int spu_0 : 1;
274 unsigned int spu_1 : 1;
275 unsigned int spu_2 : 1;
276 unsigned int spu_3 : 1;
277 unsigned int spu_4 : 1;
278 unsigned int spu_5 : 1;
279 unsigned int spu_6 : 1;
280 unsigned int spu_7 : 1;
281 unsigned int spu_8 : 1;
282 unsigned int spu_9 : 1;
283 unsigned int spu_10 : 1;
284 unsigned int spu_11 : 1;
285 unsigned int spu_12 : 1;
286 unsigned int spu_13 : 1;
287 unsigned int spu_14 : 1;
288 unsigned int spu_15 : 1;
289} reg_iop_sw_cpu_rw_ack_intr0;
290#define REG_RD_ADDR_iop_sw_cpu_rw_ack_intr0 80
291#define REG_WR_ADDR_iop_sw_cpu_rw_ack_intr0 80
292
293/* Register r_intr0, scope iop_sw_cpu, type r */
294typedef struct {
295 unsigned int mpu_0 : 1;
296 unsigned int mpu_1 : 1;
297 unsigned int mpu_2 : 1;
298 unsigned int mpu_3 : 1;
299 unsigned int mpu_4 : 1;
300 unsigned int mpu_5 : 1;
301 unsigned int mpu_6 : 1;
302 unsigned int mpu_7 : 1;
303 unsigned int mpu_8 : 1;
304 unsigned int mpu_9 : 1;
305 unsigned int mpu_10 : 1;
306 unsigned int mpu_11 : 1;
307 unsigned int mpu_12 : 1;
308 unsigned int mpu_13 : 1;
309 unsigned int mpu_14 : 1;
310 unsigned int mpu_15 : 1;
311 unsigned int spu_0 : 1;
312 unsigned int spu_1 : 1;
313 unsigned int spu_2 : 1;
314 unsigned int spu_3 : 1;
315 unsigned int spu_4 : 1;
316 unsigned int spu_5 : 1;
317 unsigned int spu_6 : 1;
318 unsigned int spu_7 : 1;
319 unsigned int spu_8 : 1;
320 unsigned int spu_9 : 1;
321 unsigned int spu_10 : 1;
322 unsigned int spu_11 : 1;
323 unsigned int spu_12 : 1;
324 unsigned int spu_13 : 1;
325 unsigned int spu_14 : 1;
326 unsigned int spu_15 : 1;
327} reg_iop_sw_cpu_r_intr0;
328#define REG_RD_ADDR_iop_sw_cpu_r_intr0 84
329
330/* Register r_masked_intr0, scope iop_sw_cpu, type r */
331typedef struct {
332 unsigned int mpu_0 : 1;
333 unsigned int mpu_1 : 1;
334 unsigned int mpu_2 : 1;
335 unsigned int mpu_3 : 1;
336 unsigned int mpu_4 : 1;
337 unsigned int mpu_5 : 1;
338 unsigned int mpu_6 : 1;
339 unsigned int mpu_7 : 1;
340 unsigned int mpu_8 : 1;
341 unsigned int mpu_9 : 1;
342 unsigned int mpu_10 : 1;
343 unsigned int mpu_11 : 1;
344 unsigned int mpu_12 : 1;
345 unsigned int mpu_13 : 1;
346 unsigned int mpu_14 : 1;
347 unsigned int mpu_15 : 1;
348 unsigned int spu_0 : 1;
349 unsigned int spu_1 : 1;
350 unsigned int spu_2 : 1;
351 unsigned int spu_3 : 1;
352 unsigned int spu_4 : 1;
353 unsigned int spu_5 : 1;
354 unsigned int spu_6 : 1;
355 unsigned int spu_7 : 1;
356 unsigned int spu_8 : 1;
357 unsigned int spu_9 : 1;
358 unsigned int spu_10 : 1;
359 unsigned int spu_11 : 1;
360 unsigned int spu_12 : 1;
361 unsigned int spu_13 : 1;
362 unsigned int spu_14 : 1;
363 unsigned int spu_15 : 1;
364} reg_iop_sw_cpu_r_masked_intr0;
365#define REG_RD_ADDR_iop_sw_cpu_r_masked_intr0 88
366
367/* Register rw_intr1_mask, scope iop_sw_cpu, type rw */
368typedef struct {
369 unsigned int mpu_16 : 1;
370 unsigned int mpu_17 : 1;
371 unsigned int mpu_18 : 1;
372 unsigned int mpu_19 : 1;
373 unsigned int mpu_20 : 1;
374 unsigned int mpu_21 : 1;
375 unsigned int mpu_22 : 1;
376 unsigned int mpu_23 : 1;
377 unsigned int mpu_24 : 1;
378 unsigned int mpu_25 : 1;
379 unsigned int mpu_26 : 1;
380 unsigned int mpu_27 : 1;
381 unsigned int mpu_28 : 1;
382 unsigned int mpu_29 : 1;
383 unsigned int mpu_30 : 1;
384 unsigned int mpu_31 : 1;
385 unsigned int dmc_in : 1;
386 unsigned int dmc_out : 1;
387 unsigned int fifo_in : 1;
388 unsigned int fifo_out : 1;
389 unsigned int fifo_in_extra : 1;
390 unsigned int fifo_out_extra : 1;
391 unsigned int trigger_grp0 : 1;
392 unsigned int trigger_grp1 : 1;
393 unsigned int trigger_grp2 : 1;
394 unsigned int trigger_grp3 : 1;
395 unsigned int trigger_grp4 : 1;
396 unsigned int trigger_grp5 : 1;
397 unsigned int trigger_grp6 : 1;
398 unsigned int trigger_grp7 : 1;
399 unsigned int timer_grp0 : 1;
400 unsigned int timer_grp1 : 1;
401} reg_iop_sw_cpu_rw_intr1_mask;
402#define REG_RD_ADDR_iop_sw_cpu_rw_intr1_mask 92
403#define REG_WR_ADDR_iop_sw_cpu_rw_intr1_mask 92
404
405/* Register rw_ack_intr1, scope iop_sw_cpu, type rw */
406typedef struct {
407 unsigned int mpu_16 : 1;
408 unsigned int mpu_17 : 1;
409 unsigned int mpu_18 : 1;
410 unsigned int mpu_19 : 1;
411 unsigned int mpu_20 : 1;
412 unsigned int mpu_21 : 1;
413 unsigned int mpu_22 : 1;
414 unsigned int mpu_23 : 1;
415 unsigned int mpu_24 : 1;
416 unsigned int mpu_25 : 1;
417 unsigned int mpu_26 : 1;
418 unsigned int mpu_27 : 1;
419 unsigned int mpu_28 : 1;
420 unsigned int mpu_29 : 1;
421 unsigned int mpu_30 : 1;
422 unsigned int mpu_31 : 1;
423 unsigned int dummy1 : 16;
424} reg_iop_sw_cpu_rw_ack_intr1;
425#define REG_RD_ADDR_iop_sw_cpu_rw_ack_intr1 96
426#define REG_WR_ADDR_iop_sw_cpu_rw_ack_intr1 96
427
428/* Register r_intr1, scope iop_sw_cpu, type r */
429typedef struct {
430 unsigned int mpu_16 : 1;
431 unsigned int mpu_17 : 1;
432 unsigned int mpu_18 : 1;
433 unsigned int mpu_19 : 1;
434 unsigned int mpu_20 : 1;
435 unsigned int mpu_21 : 1;
436 unsigned int mpu_22 : 1;
437 unsigned int mpu_23 : 1;
438 unsigned int mpu_24 : 1;
439 unsigned int mpu_25 : 1;
440 unsigned int mpu_26 : 1;
441 unsigned int mpu_27 : 1;
442 unsigned int mpu_28 : 1;
443 unsigned int mpu_29 : 1;
444 unsigned int mpu_30 : 1;
445 unsigned int mpu_31 : 1;
446 unsigned int dmc_in : 1;
447 unsigned int dmc_out : 1;
448 unsigned int fifo_in : 1;
449 unsigned int fifo_out : 1;
450 unsigned int fifo_in_extra : 1;
451 unsigned int fifo_out_extra : 1;
452 unsigned int trigger_grp0 : 1;
453 unsigned int trigger_grp1 : 1;
454 unsigned int trigger_grp2 : 1;
455 unsigned int trigger_grp3 : 1;
456 unsigned int trigger_grp4 : 1;
457 unsigned int trigger_grp5 : 1;
458 unsigned int trigger_grp6 : 1;
459 unsigned int trigger_grp7 : 1;
460 unsigned int timer_grp0 : 1;
461 unsigned int timer_grp1 : 1;
462} reg_iop_sw_cpu_r_intr1;
463#define REG_RD_ADDR_iop_sw_cpu_r_intr1 100
464
465/* Register r_masked_intr1, scope iop_sw_cpu, type r */
466typedef struct {
467 unsigned int mpu_16 : 1;
468 unsigned int mpu_17 : 1;
469 unsigned int mpu_18 : 1;
470 unsigned int mpu_19 : 1;
471 unsigned int mpu_20 : 1;
472 unsigned int mpu_21 : 1;
473 unsigned int mpu_22 : 1;
474 unsigned int mpu_23 : 1;
475 unsigned int mpu_24 : 1;
476 unsigned int mpu_25 : 1;
477 unsigned int mpu_26 : 1;
478 unsigned int mpu_27 : 1;
479 unsigned int mpu_28 : 1;
480 unsigned int mpu_29 : 1;
481 unsigned int mpu_30 : 1;
482 unsigned int mpu_31 : 1;
483 unsigned int dmc_in : 1;
484 unsigned int dmc_out : 1;
485 unsigned int fifo_in : 1;
486 unsigned int fifo_out : 1;
487 unsigned int fifo_in_extra : 1;
488 unsigned int fifo_out_extra : 1;
489 unsigned int trigger_grp0 : 1;
490 unsigned int trigger_grp1 : 1;
491 unsigned int trigger_grp2 : 1;
492 unsigned int trigger_grp3 : 1;
493 unsigned int trigger_grp4 : 1;
494 unsigned int trigger_grp5 : 1;
495 unsigned int trigger_grp6 : 1;
496 unsigned int trigger_grp7 : 1;
497 unsigned int timer_grp0 : 1;
498 unsigned int timer_grp1 : 1;
499} reg_iop_sw_cpu_r_masked_intr1;
500#define REG_RD_ADDR_iop_sw_cpu_r_masked_intr1 104
501
502
503/* Constants */
504enum {
505 regk_iop_sw_cpu_copy = 0x00000000,
506 regk_iop_sw_cpu_no = 0x00000000,
507 regk_iop_sw_cpu_rd = 0x00000002,
508 regk_iop_sw_cpu_reg_copy = 0x00000001,
509 regk_iop_sw_cpu_rw_bus_clr_mask_default = 0x00000000,
510 regk_iop_sw_cpu_rw_bus_oe_clr_mask_default = 0x00000000,
511 regk_iop_sw_cpu_rw_bus_oe_set_mask_default = 0x00000000,
512 regk_iop_sw_cpu_rw_bus_set_mask_default = 0x00000000,
513 regk_iop_sw_cpu_rw_gio_clr_mask_default = 0x00000000,
514 regk_iop_sw_cpu_rw_gio_oe_clr_mask_default = 0x00000000,
515 regk_iop_sw_cpu_rw_gio_oe_set_mask_default = 0x00000000,
516 regk_iop_sw_cpu_rw_gio_set_mask_default = 0x00000000,
517 regk_iop_sw_cpu_rw_intr0_mask_default = 0x00000000,
518 regk_iop_sw_cpu_rw_intr1_mask_default = 0x00000000,
519 regk_iop_sw_cpu_wr = 0x00000003,
520 regk_iop_sw_cpu_yes = 0x00000001
521};
522#endif /* __iop_sw_cpu_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_mpu_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_mpu_defs.h
new file mode 100644
index 000000000000..a2e4e1a33e57
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_mpu_defs.h
@@ -0,0 +1,648 @@
1#ifndef __iop_sw_mpu_defs_h
2#define __iop_sw_mpu_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_sw_mpu.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile iop_sw_mpu_defs.h iop_sw_mpu.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope iop_sw_mpu */
83
84/* Register rw_sw_cfg_owner, scope iop_sw_mpu, type rw */
85typedef struct {
86 unsigned int cfg : 2;
87 unsigned int dummy1 : 30;
88} reg_iop_sw_mpu_rw_sw_cfg_owner;
89#define REG_RD_ADDR_iop_sw_mpu_rw_sw_cfg_owner 0
90#define REG_WR_ADDR_iop_sw_mpu_rw_sw_cfg_owner 0
91
92/* Register r_spu_trace, scope iop_sw_mpu, type r */
93typedef unsigned int reg_iop_sw_mpu_r_spu_trace;
94#define REG_RD_ADDR_iop_sw_mpu_r_spu_trace 4
95
96/* Register r_spu_fsm_trace, scope iop_sw_mpu, type r */
97typedef unsigned int reg_iop_sw_mpu_r_spu_fsm_trace;
98#define REG_RD_ADDR_iop_sw_mpu_r_spu_fsm_trace 8
99
100/* Register rw_mc_ctrl, scope iop_sw_mpu, type rw */
101typedef struct {
102 unsigned int keep_owner : 1;
103 unsigned int cmd : 2;
104 unsigned int size : 3;
105 unsigned int wr_spu_mem : 1;
106 unsigned int dummy1 : 25;
107} reg_iop_sw_mpu_rw_mc_ctrl;
108#define REG_RD_ADDR_iop_sw_mpu_rw_mc_ctrl 12
109#define REG_WR_ADDR_iop_sw_mpu_rw_mc_ctrl 12
110
111/* Register rw_mc_data, scope iop_sw_mpu, type rw */
112typedef struct {
113 unsigned int val : 32;
114} reg_iop_sw_mpu_rw_mc_data;
115#define REG_RD_ADDR_iop_sw_mpu_rw_mc_data 16
116#define REG_WR_ADDR_iop_sw_mpu_rw_mc_data 16
117
118/* Register rw_mc_addr, scope iop_sw_mpu, type rw */
119typedef unsigned int reg_iop_sw_mpu_rw_mc_addr;
120#define REG_RD_ADDR_iop_sw_mpu_rw_mc_addr 20
121#define REG_WR_ADDR_iop_sw_mpu_rw_mc_addr 20
122
123/* Register rs_mc_data, scope iop_sw_mpu, type rs */
124typedef unsigned int reg_iop_sw_mpu_rs_mc_data;
125#define REG_RD_ADDR_iop_sw_mpu_rs_mc_data 24
126
127/* Register r_mc_data, scope iop_sw_mpu, type r */
128typedef unsigned int reg_iop_sw_mpu_r_mc_data;
129#define REG_RD_ADDR_iop_sw_mpu_r_mc_data 28
130
131/* Register r_mc_stat, scope iop_sw_mpu, type r */
132typedef struct {
133 unsigned int busy_cpu : 1;
134 unsigned int busy_mpu : 1;
135 unsigned int busy_spu : 1;
136 unsigned int owned_by_cpu : 1;
137 unsigned int owned_by_mpu : 1;
138 unsigned int owned_by_spu : 1;
139 unsigned int dummy1 : 26;
140} reg_iop_sw_mpu_r_mc_stat;
141#define REG_RD_ADDR_iop_sw_mpu_r_mc_stat 32
142
143/* Register rw_bus_clr_mask, scope iop_sw_mpu, type rw */
144typedef struct {
145 unsigned int byte0 : 8;
146 unsigned int byte1 : 8;
147 unsigned int byte2 : 8;
148 unsigned int byte3 : 8;
149} reg_iop_sw_mpu_rw_bus_clr_mask;
150#define REG_RD_ADDR_iop_sw_mpu_rw_bus_clr_mask 36
151#define REG_WR_ADDR_iop_sw_mpu_rw_bus_clr_mask 36
152
153/* Register rw_bus_set_mask, scope iop_sw_mpu, type rw */
154typedef struct {
155 unsigned int byte0 : 8;
156 unsigned int byte1 : 8;
157 unsigned int byte2 : 8;
158 unsigned int byte3 : 8;
159} reg_iop_sw_mpu_rw_bus_set_mask;
160#define REG_RD_ADDR_iop_sw_mpu_rw_bus_set_mask 40
161#define REG_WR_ADDR_iop_sw_mpu_rw_bus_set_mask 40
162
163/* Register rw_bus_oe_clr_mask, scope iop_sw_mpu, type rw */
164typedef struct {
165 unsigned int byte0 : 1;
166 unsigned int byte1 : 1;
167 unsigned int byte2 : 1;
168 unsigned int byte3 : 1;
169 unsigned int dummy1 : 28;
170} reg_iop_sw_mpu_rw_bus_oe_clr_mask;
171#define REG_RD_ADDR_iop_sw_mpu_rw_bus_oe_clr_mask 44
172#define REG_WR_ADDR_iop_sw_mpu_rw_bus_oe_clr_mask 44
173
174/* Register rw_bus_oe_set_mask, scope iop_sw_mpu, type rw */
175typedef struct {
176 unsigned int byte0 : 1;
177 unsigned int byte1 : 1;
178 unsigned int byte2 : 1;
179 unsigned int byte3 : 1;
180 unsigned int dummy1 : 28;
181} reg_iop_sw_mpu_rw_bus_oe_set_mask;
182#define REG_RD_ADDR_iop_sw_mpu_rw_bus_oe_set_mask 48
183#define REG_WR_ADDR_iop_sw_mpu_rw_bus_oe_set_mask 48
184
185/* Register r_bus_in, scope iop_sw_mpu, type r */
186typedef unsigned int reg_iop_sw_mpu_r_bus_in;
187#define REG_RD_ADDR_iop_sw_mpu_r_bus_in 52
188
189/* Register rw_gio_clr_mask, scope iop_sw_mpu, type rw */
190typedef struct {
191 unsigned int val : 32;
192} reg_iop_sw_mpu_rw_gio_clr_mask;
193#define REG_RD_ADDR_iop_sw_mpu_rw_gio_clr_mask 56
194#define REG_WR_ADDR_iop_sw_mpu_rw_gio_clr_mask 56
195
196/* Register rw_gio_set_mask, scope iop_sw_mpu, type rw */
197typedef struct {
198 unsigned int val : 32;
199} reg_iop_sw_mpu_rw_gio_set_mask;
200#define REG_RD_ADDR_iop_sw_mpu_rw_gio_set_mask 60
201#define REG_WR_ADDR_iop_sw_mpu_rw_gio_set_mask 60
202
203/* Register rw_gio_oe_clr_mask, scope iop_sw_mpu, type rw */
204typedef struct {
205 unsigned int val : 32;
206} reg_iop_sw_mpu_rw_gio_oe_clr_mask;
207#define REG_RD_ADDR_iop_sw_mpu_rw_gio_oe_clr_mask 64
208#define REG_WR_ADDR_iop_sw_mpu_rw_gio_oe_clr_mask 64
209
210/* Register rw_gio_oe_set_mask, scope iop_sw_mpu, type rw */
211typedef struct {
212 unsigned int val : 32;
213} reg_iop_sw_mpu_rw_gio_oe_set_mask;
214#define REG_RD_ADDR_iop_sw_mpu_rw_gio_oe_set_mask 68
215#define REG_WR_ADDR_iop_sw_mpu_rw_gio_oe_set_mask 68
216
217/* Register r_gio_in, scope iop_sw_mpu, type r */
218typedef unsigned int reg_iop_sw_mpu_r_gio_in;
219#define REG_RD_ADDR_iop_sw_mpu_r_gio_in 72
220
221/* Register rw_cpu_intr, scope iop_sw_mpu, type rw */
222typedef struct {
223 unsigned int intr0 : 1;
224 unsigned int intr1 : 1;
225 unsigned int intr2 : 1;
226 unsigned int intr3 : 1;
227 unsigned int intr4 : 1;
228 unsigned int intr5 : 1;
229 unsigned int intr6 : 1;
230 unsigned int intr7 : 1;
231 unsigned int intr8 : 1;
232 unsigned int intr9 : 1;
233 unsigned int intr10 : 1;
234 unsigned int intr11 : 1;
235 unsigned int intr12 : 1;
236 unsigned int intr13 : 1;
237 unsigned int intr14 : 1;
238 unsigned int intr15 : 1;
239 unsigned int intr16 : 1;
240 unsigned int intr17 : 1;
241 unsigned int intr18 : 1;
242 unsigned int intr19 : 1;
243 unsigned int intr20 : 1;
244 unsigned int intr21 : 1;
245 unsigned int intr22 : 1;
246 unsigned int intr23 : 1;
247 unsigned int intr24 : 1;
248 unsigned int intr25 : 1;
249 unsigned int intr26 : 1;
250 unsigned int intr27 : 1;
251 unsigned int intr28 : 1;
252 unsigned int intr29 : 1;
253 unsigned int intr30 : 1;
254 unsigned int intr31 : 1;
255} reg_iop_sw_mpu_rw_cpu_intr;
256#define REG_RD_ADDR_iop_sw_mpu_rw_cpu_intr 76
257#define REG_WR_ADDR_iop_sw_mpu_rw_cpu_intr 76
258
259/* Register r_cpu_intr, scope iop_sw_mpu, type r */
260typedef struct {
261 unsigned int intr0 : 1;
262 unsigned int intr1 : 1;
263 unsigned int intr2 : 1;
264 unsigned int intr3 : 1;
265 unsigned int intr4 : 1;
266 unsigned int intr5 : 1;
267 unsigned int intr6 : 1;
268 unsigned int intr7 : 1;
269 unsigned int intr8 : 1;
270 unsigned int intr9 : 1;
271 unsigned int intr10 : 1;
272 unsigned int intr11 : 1;
273 unsigned int intr12 : 1;
274 unsigned int intr13 : 1;
275 unsigned int intr14 : 1;
276 unsigned int intr15 : 1;
277 unsigned int intr16 : 1;
278 unsigned int intr17 : 1;
279 unsigned int intr18 : 1;
280 unsigned int intr19 : 1;
281 unsigned int intr20 : 1;
282 unsigned int intr21 : 1;
283 unsigned int intr22 : 1;
284 unsigned int intr23 : 1;
285 unsigned int intr24 : 1;
286 unsigned int intr25 : 1;
287 unsigned int intr26 : 1;
288 unsigned int intr27 : 1;
289 unsigned int intr28 : 1;
290 unsigned int intr29 : 1;
291 unsigned int intr30 : 1;
292 unsigned int intr31 : 1;
293} reg_iop_sw_mpu_r_cpu_intr;
294#define REG_RD_ADDR_iop_sw_mpu_r_cpu_intr 80
295
296/* Register rw_intr_grp0_mask, scope iop_sw_mpu, type rw */
297typedef struct {
298 unsigned int spu_intr0 : 1;
299 unsigned int trigger_grp0 : 1;
300 unsigned int timer_grp0 : 1;
301 unsigned int fifo_out : 1;
302 unsigned int spu_intr1 : 1;
303 unsigned int trigger_grp1 : 1;
304 unsigned int timer_grp1 : 1;
305 unsigned int fifo_in : 1;
306 unsigned int spu_intr2 : 1;
307 unsigned int trigger_grp2 : 1;
308 unsigned int fifo_out_extra : 1;
309 unsigned int dmc_out : 1;
310 unsigned int spu_intr3 : 1;
311 unsigned int trigger_grp3 : 1;
312 unsigned int fifo_in_extra : 1;
313 unsigned int dmc_in : 1;
314 unsigned int dummy1 : 16;
315} reg_iop_sw_mpu_rw_intr_grp0_mask;
316#define REG_RD_ADDR_iop_sw_mpu_rw_intr_grp0_mask 84
317#define REG_WR_ADDR_iop_sw_mpu_rw_intr_grp0_mask 84
318
319/* Register rw_ack_intr_grp0, scope iop_sw_mpu, type rw */
320typedef struct {
321 unsigned int spu_intr0 : 1;
322 unsigned int dummy1 : 3;
323 unsigned int spu_intr1 : 1;
324 unsigned int dummy2 : 3;
325 unsigned int spu_intr2 : 1;
326 unsigned int dummy3 : 3;
327 unsigned int spu_intr3 : 1;
328 unsigned int dummy4 : 19;
329} reg_iop_sw_mpu_rw_ack_intr_grp0;
330#define REG_RD_ADDR_iop_sw_mpu_rw_ack_intr_grp0 88
331#define REG_WR_ADDR_iop_sw_mpu_rw_ack_intr_grp0 88
332
333/* Register r_intr_grp0, scope iop_sw_mpu, type r */
334typedef struct {
335 unsigned int spu_intr0 : 1;
336 unsigned int trigger_grp0 : 1;
337 unsigned int timer_grp0 : 1;
338 unsigned int fifo_out : 1;
339 unsigned int spu_intr1 : 1;
340 unsigned int trigger_grp1 : 1;
341 unsigned int timer_grp1 : 1;
342 unsigned int fifo_in : 1;
343 unsigned int spu_intr2 : 1;
344 unsigned int trigger_grp2 : 1;
345 unsigned int fifo_out_extra : 1;
346 unsigned int dmc_out : 1;
347 unsigned int spu_intr3 : 1;
348 unsigned int trigger_grp3 : 1;
349 unsigned int fifo_in_extra : 1;
350 unsigned int dmc_in : 1;
351 unsigned int dummy1 : 16;
352} reg_iop_sw_mpu_r_intr_grp0;
353#define REG_RD_ADDR_iop_sw_mpu_r_intr_grp0 92
354
355/* Register r_masked_intr_grp0, scope iop_sw_mpu, type r */
356typedef struct {
357 unsigned int spu_intr0 : 1;
358 unsigned int trigger_grp0 : 1;
359 unsigned int timer_grp0 : 1;
360 unsigned int fifo_out : 1;
361 unsigned int spu_intr1 : 1;
362 unsigned int trigger_grp1 : 1;
363 unsigned int timer_grp1 : 1;
364 unsigned int fifo_in : 1;
365 unsigned int spu_intr2 : 1;
366 unsigned int trigger_grp2 : 1;
367 unsigned int fifo_out_extra : 1;
368 unsigned int dmc_out : 1;
369 unsigned int spu_intr3 : 1;
370 unsigned int trigger_grp3 : 1;
371 unsigned int fifo_in_extra : 1;
372 unsigned int dmc_in : 1;
373 unsigned int dummy1 : 16;
374} reg_iop_sw_mpu_r_masked_intr_grp0;
375#define REG_RD_ADDR_iop_sw_mpu_r_masked_intr_grp0 96
376
377/* Register rw_intr_grp1_mask, scope iop_sw_mpu, type rw */
378typedef struct {
379 unsigned int spu_intr4 : 1;
380 unsigned int trigger_grp4 : 1;
381 unsigned int fifo_out_extra : 1;
382 unsigned int dmc_out : 1;
383 unsigned int spu_intr5 : 1;
384 unsigned int trigger_grp5 : 1;
385 unsigned int fifo_in_extra : 1;
386 unsigned int dmc_in : 1;
387 unsigned int spu_intr6 : 1;
388 unsigned int trigger_grp6 : 1;
389 unsigned int timer_grp0 : 1;
390 unsigned int fifo_out : 1;
391 unsigned int spu_intr7 : 1;
392 unsigned int trigger_grp7 : 1;
393 unsigned int timer_grp1 : 1;
394 unsigned int fifo_in : 1;
395 unsigned int dummy1 : 16;
396} reg_iop_sw_mpu_rw_intr_grp1_mask;
397#define REG_RD_ADDR_iop_sw_mpu_rw_intr_grp1_mask 100
398#define REG_WR_ADDR_iop_sw_mpu_rw_intr_grp1_mask 100
399
400/* Register rw_ack_intr_grp1, scope iop_sw_mpu, type rw */
401typedef struct {
402 unsigned int spu_intr4 : 1;
403 unsigned int dummy1 : 3;
404 unsigned int spu_intr5 : 1;
405 unsigned int dummy2 : 3;
406 unsigned int spu_intr6 : 1;
407 unsigned int dummy3 : 3;
408 unsigned int spu_intr7 : 1;
409 unsigned int dummy4 : 19;
410} reg_iop_sw_mpu_rw_ack_intr_grp1;
411#define REG_RD_ADDR_iop_sw_mpu_rw_ack_intr_grp1 104
412#define REG_WR_ADDR_iop_sw_mpu_rw_ack_intr_grp1 104
413
414/* Register r_intr_grp1, scope iop_sw_mpu, type r */
415typedef struct {
416 unsigned int spu_intr4 : 1;
417 unsigned int trigger_grp4 : 1;
418 unsigned int fifo_out_extra : 1;
419 unsigned int dmc_out : 1;
420 unsigned int spu_intr5 : 1;
421 unsigned int trigger_grp5 : 1;
422 unsigned int fifo_in_extra : 1;
423 unsigned int dmc_in : 1;
424 unsigned int spu_intr6 : 1;
425 unsigned int trigger_grp6 : 1;
426 unsigned int timer_grp0 : 1;
427 unsigned int fifo_out : 1;
428 unsigned int spu_intr7 : 1;
429 unsigned int trigger_grp7 : 1;
430 unsigned int timer_grp1 : 1;
431 unsigned int fifo_in : 1;
432 unsigned int dummy1 : 16;
433} reg_iop_sw_mpu_r_intr_grp1;
434#define REG_RD_ADDR_iop_sw_mpu_r_intr_grp1 108
435
436/* Register r_masked_intr_grp1, scope iop_sw_mpu, type r */
437typedef struct {
438 unsigned int spu_intr4 : 1;
439 unsigned int trigger_grp4 : 1;
440 unsigned int fifo_out_extra : 1;
441 unsigned int dmc_out : 1;
442 unsigned int spu_intr5 : 1;
443 unsigned int trigger_grp5 : 1;
444 unsigned int fifo_in_extra : 1;
445 unsigned int dmc_in : 1;
446 unsigned int spu_intr6 : 1;
447 unsigned int trigger_grp6 : 1;
448 unsigned int timer_grp0 : 1;
449 unsigned int fifo_out : 1;
450 unsigned int spu_intr7 : 1;
451 unsigned int trigger_grp7 : 1;
452 unsigned int timer_grp1 : 1;
453 unsigned int fifo_in : 1;
454 unsigned int dummy1 : 16;
455} reg_iop_sw_mpu_r_masked_intr_grp1;
456#define REG_RD_ADDR_iop_sw_mpu_r_masked_intr_grp1 112
457
458/* Register rw_intr_grp2_mask, scope iop_sw_mpu, type rw */
459typedef struct {
460 unsigned int spu_intr8 : 1;
461 unsigned int trigger_grp0 : 1;
462 unsigned int timer_grp0 : 1;
463 unsigned int fifo_out : 1;
464 unsigned int spu_intr9 : 1;
465 unsigned int trigger_grp1 : 1;
466 unsigned int timer_grp1 : 1;
467 unsigned int fifo_in : 1;
468 unsigned int spu_intr10 : 1;
469 unsigned int trigger_grp2 : 1;
470 unsigned int fifo_out_extra : 1;
471 unsigned int dmc_out : 1;
472 unsigned int spu_intr11 : 1;
473 unsigned int trigger_grp3 : 1;
474 unsigned int fifo_in_extra : 1;
475 unsigned int dmc_in : 1;
476 unsigned int dummy1 : 16;
477} reg_iop_sw_mpu_rw_intr_grp2_mask;
478#define REG_RD_ADDR_iop_sw_mpu_rw_intr_grp2_mask 116
479#define REG_WR_ADDR_iop_sw_mpu_rw_intr_grp2_mask 116
480
481/* Register rw_ack_intr_grp2, scope iop_sw_mpu, type rw */
482typedef struct {
483 unsigned int spu_intr8 : 1;
484 unsigned int dummy1 : 3;
485 unsigned int spu_intr9 : 1;
486 unsigned int dummy2 : 3;
487 unsigned int spu_intr10 : 1;
488 unsigned int dummy3 : 3;
489 unsigned int spu_intr11 : 1;
490 unsigned int dummy4 : 19;
491} reg_iop_sw_mpu_rw_ack_intr_grp2;
492#define REG_RD_ADDR_iop_sw_mpu_rw_ack_intr_grp2 120
493#define REG_WR_ADDR_iop_sw_mpu_rw_ack_intr_grp2 120
494
495/* Register r_intr_grp2, scope iop_sw_mpu, type r */
496typedef struct {
497 unsigned int spu_intr8 : 1;
498 unsigned int trigger_grp0 : 1;
499 unsigned int timer_grp0 : 1;
500 unsigned int fifo_out : 1;
501 unsigned int spu_intr9 : 1;
502 unsigned int trigger_grp1 : 1;
503 unsigned int timer_grp1 : 1;
504 unsigned int fifo_in : 1;
505 unsigned int spu_intr10 : 1;
506 unsigned int trigger_grp2 : 1;
507 unsigned int fifo_out_extra : 1;
508 unsigned int dmc_out : 1;
509 unsigned int spu_intr11 : 1;
510 unsigned int trigger_grp3 : 1;
511 unsigned int fifo_in_extra : 1;
512 unsigned int dmc_in : 1;
513 unsigned int dummy1 : 16;
514} reg_iop_sw_mpu_r_intr_grp2;
515#define REG_RD_ADDR_iop_sw_mpu_r_intr_grp2 124
516
517/* Register r_masked_intr_grp2, scope iop_sw_mpu, type r */
518typedef struct {
519 unsigned int spu_intr8 : 1;
520 unsigned int trigger_grp0 : 1;
521 unsigned int timer_grp0 : 1;
522 unsigned int fifo_out : 1;
523 unsigned int spu_intr9 : 1;
524 unsigned int trigger_grp1 : 1;
525 unsigned int timer_grp1 : 1;
526 unsigned int fifo_in : 1;
527 unsigned int spu_intr10 : 1;
528 unsigned int trigger_grp2 : 1;
529 unsigned int fifo_out_extra : 1;
530 unsigned int dmc_out : 1;
531 unsigned int spu_intr11 : 1;
532 unsigned int trigger_grp3 : 1;
533 unsigned int fifo_in_extra : 1;
534 unsigned int dmc_in : 1;
535 unsigned int dummy1 : 16;
536} reg_iop_sw_mpu_r_masked_intr_grp2;
537#define REG_RD_ADDR_iop_sw_mpu_r_masked_intr_grp2 128
538
539/* Register rw_intr_grp3_mask, scope iop_sw_mpu, type rw */
540typedef struct {
541 unsigned int spu_intr12 : 1;
542 unsigned int trigger_grp4 : 1;
543 unsigned int fifo_out_extra : 1;
544 unsigned int dmc_out : 1;
545 unsigned int spu_intr13 : 1;
546 unsigned int trigger_grp5 : 1;
547 unsigned int fifo_in_extra : 1;
548 unsigned int dmc_in : 1;
549 unsigned int spu_intr14 : 1;
550 unsigned int trigger_grp6 : 1;
551 unsigned int timer_grp0 : 1;
552 unsigned int fifo_out : 1;
553 unsigned int spu_intr15 : 1;
554 unsigned int trigger_grp7 : 1;
555 unsigned int timer_grp1 : 1;
556 unsigned int fifo_in : 1;
557 unsigned int dummy1 : 16;
558} reg_iop_sw_mpu_rw_intr_grp3_mask;
559#define REG_RD_ADDR_iop_sw_mpu_rw_intr_grp3_mask 132
560#define REG_WR_ADDR_iop_sw_mpu_rw_intr_grp3_mask 132
561
562/* Register rw_ack_intr_grp3, scope iop_sw_mpu, type rw */
563typedef struct {
564 unsigned int spu_intr12 : 1;
565 unsigned int dummy1 : 3;
566 unsigned int spu_intr13 : 1;
567 unsigned int dummy2 : 3;
568 unsigned int spu_intr14 : 1;
569 unsigned int dummy3 : 3;
570 unsigned int spu_intr15 : 1;
571 unsigned int dummy4 : 19;
572} reg_iop_sw_mpu_rw_ack_intr_grp3;
573#define REG_RD_ADDR_iop_sw_mpu_rw_ack_intr_grp3 136
574#define REG_WR_ADDR_iop_sw_mpu_rw_ack_intr_grp3 136
575
576/* Register r_intr_grp3, scope iop_sw_mpu, type r */
577typedef struct {
578 unsigned int spu_intr12 : 1;
579 unsigned int trigger_grp4 : 1;
580 unsigned int fifo_out_extra : 1;
581 unsigned int dmc_out : 1;
582 unsigned int spu_intr13 : 1;
583 unsigned int trigger_grp5 : 1;
584 unsigned int fifo_in_extra : 1;
585 unsigned int dmc_in : 1;
586 unsigned int spu_intr14 : 1;
587 unsigned int trigger_grp6 : 1;
588 unsigned int timer_grp0 : 1;
589 unsigned int fifo_out : 1;
590 unsigned int spu_intr15 : 1;
591 unsigned int trigger_grp7 : 1;
592 unsigned int timer_grp1 : 1;
593 unsigned int fifo_in : 1;
594 unsigned int dummy1 : 16;
595} reg_iop_sw_mpu_r_intr_grp3;
596#define REG_RD_ADDR_iop_sw_mpu_r_intr_grp3 140
597
598/* Register r_masked_intr_grp3, scope iop_sw_mpu, type r */
599typedef struct {
600 unsigned int spu_intr12 : 1;
601 unsigned int trigger_grp4 : 1;
602 unsigned int fifo_out_extra : 1;
603 unsigned int dmc_out : 1;
604 unsigned int spu_intr13 : 1;
605 unsigned int trigger_grp5 : 1;
606 unsigned int fifo_in_extra : 1;
607 unsigned int dmc_in : 1;
608 unsigned int spu_intr14 : 1;
609 unsigned int trigger_grp6 : 1;
610 unsigned int timer_grp0 : 1;
611 unsigned int fifo_out : 1;
612 unsigned int spu_intr15 : 1;
613 unsigned int trigger_grp7 : 1;
614 unsigned int timer_grp1 : 1;
615 unsigned int fifo_in : 1;
616 unsigned int dummy1 : 16;
617} reg_iop_sw_mpu_r_masked_intr_grp3;
618#define REG_RD_ADDR_iop_sw_mpu_r_masked_intr_grp3 144
619
620
621/* Constants */
622enum {
623 regk_iop_sw_mpu_copy = 0x00000000,
624 regk_iop_sw_mpu_cpu = 0x00000000,
625 regk_iop_sw_mpu_mpu = 0x00000001,
626 regk_iop_sw_mpu_no = 0x00000000,
627 regk_iop_sw_mpu_nop = 0x00000000,
628 regk_iop_sw_mpu_rd = 0x00000002,
629 regk_iop_sw_mpu_reg_copy = 0x00000001,
630 regk_iop_sw_mpu_rw_bus_clr_mask_default = 0x00000000,
631 regk_iop_sw_mpu_rw_bus_oe_clr_mask_default = 0x00000000,
632 regk_iop_sw_mpu_rw_bus_oe_set_mask_default = 0x00000000,
633 regk_iop_sw_mpu_rw_bus_set_mask_default = 0x00000000,
634 regk_iop_sw_mpu_rw_gio_clr_mask_default = 0x00000000,
635 regk_iop_sw_mpu_rw_gio_oe_clr_mask_default = 0x00000000,
636 regk_iop_sw_mpu_rw_gio_oe_set_mask_default = 0x00000000,
637 regk_iop_sw_mpu_rw_gio_set_mask_default = 0x00000000,
638 regk_iop_sw_mpu_rw_intr_grp0_mask_default = 0x00000000,
639 regk_iop_sw_mpu_rw_intr_grp1_mask_default = 0x00000000,
640 regk_iop_sw_mpu_rw_intr_grp2_mask_default = 0x00000000,
641 regk_iop_sw_mpu_rw_intr_grp3_mask_default = 0x00000000,
642 regk_iop_sw_mpu_rw_sw_cfg_owner_default = 0x00000000,
643 regk_iop_sw_mpu_set = 0x00000001,
644 regk_iop_sw_mpu_spu = 0x00000002,
645 regk_iop_sw_mpu_wr = 0x00000003,
646 regk_iop_sw_mpu_yes = 0x00000001
647};
648#endif /* __iop_sw_mpu_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_spu_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_spu_defs.h
new file mode 100644
index 000000000000..c8560b865a1a
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_sw_spu_defs.h
@@ -0,0 +1,441 @@
1#ifndef __iop_sw_spu_defs_h
2#define __iop_sw_spu_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_sw_spu.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile iop_sw_spu_defs.h iop_sw_spu.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope iop_sw_spu */
83
84/* Register r_mpu_trace, scope iop_sw_spu, type r */
85typedef unsigned int reg_iop_sw_spu_r_mpu_trace;
86#define REG_RD_ADDR_iop_sw_spu_r_mpu_trace 0
87
88/* Register rw_mc_ctrl, scope iop_sw_spu, type rw */
89typedef struct {
90 unsigned int keep_owner : 1;
91 unsigned int cmd : 2;
92 unsigned int size : 3;
93 unsigned int wr_spu_mem : 1;
94 unsigned int dummy1 : 25;
95} reg_iop_sw_spu_rw_mc_ctrl;
96#define REG_RD_ADDR_iop_sw_spu_rw_mc_ctrl 4
97#define REG_WR_ADDR_iop_sw_spu_rw_mc_ctrl 4
98
99/* Register rw_mc_data, scope iop_sw_spu, type rw */
100typedef struct {
101 unsigned int val : 32;
102} reg_iop_sw_spu_rw_mc_data;
103#define REG_RD_ADDR_iop_sw_spu_rw_mc_data 8
104#define REG_WR_ADDR_iop_sw_spu_rw_mc_data 8
105
106/* Register rw_mc_addr, scope iop_sw_spu, type rw */
107typedef unsigned int reg_iop_sw_spu_rw_mc_addr;
108#define REG_RD_ADDR_iop_sw_spu_rw_mc_addr 12
109#define REG_WR_ADDR_iop_sw_spu_rw_mc_addr 12
110
111/* Register rs_mc_data, scope iop_sw_spu, type rs */
112typedef unsigned int reg_iop_sw_spu_rs_mc_data;
113#define REG_RD_ADDR_iop_sw_spu_rs_mc_data 16
114
115/* Register r_mc_data, scope iop_sw_spu, type r */
116typedef unsigned int reg_iop_sw_spu_r_mc_data;
117#define REG_RD_ADDR_iop_sw_spu_r_mc_data 20
118
119/* Register r_mc_stat, scope iop_sw_spu, type r */
120typedef struct {
121 unsigned int busy_cpu : 1;
122 unsigned int busy_mpu : 1;
123 unsigned int busy_spu : 1;
124 unsigned int owned_by_cpu : 1;
125 unsigned int owned_by_mpu : 1;
126 unsigned int owned_by_spu : 1;
127 unsigned int dummy1 : 26;
128} reg_iop_sw_spu_r_mc_stat;
129#define REG_RD_ADDR_iop_sw_spu_r_mc_stat 24
130
131/* Register rw_bus_clr_mask, scope iop_sw_spu, type rw */
132typedef struct {
133 unsigned int byte0 : 8;
134 unsigned int byte1 : 8;
135 unsigned int byte2 : 8;
136 unsigned int byte3 : 8;
137} reg_iop_sw_spu_rw_bus_clr_mask;
138#define REG_RD_ADDR_iop_sw_spu_rw_bus_clr_mask 28
139#define REG_WR_ADDR_iop_sw_spu_rw_bus_clr_mask 28
140
141/* Register rw_bus_set_mask, scope iop_sw_spu, type rw */
142typedef struct {
143 unsigned int byte0 : 8;
144 unsigned int byte1 : 8;
145 unsigned int byte2 : 8;
146 unsigned int byte3 : 8;
147} reg_iop_sw_spu_rw_bus_set_mask;
148#define REG_RD_ADDR_iop_sw_spu_rw_bus_set_mask 32
149#define REG_WR_ADDR_iop_sw_spu_rw_bus_set_mask 32
150
151/* Register rw_bus_oe_clr_mask, scope iop_sw_spu, type rw */
152typedef struct {
153 unsigned int byte0 : 1;
154 unsigned int byte1 : 1;
155 unsigned int byte2 : 1;
156 unsigned int byte3 : 1;
157 unsigned int dummy1 : 28;
158} reg_iop_sw_spu_rw_bus_oe_clr_mask;
159#define REG_RD_ADDR_iop_sw_spu_rw_bus_oe_clr_mask 36
160#define REG_WR_ADDR_iop_sw_spu_rw_bus_oe_clr_mask 36
161
162/* Register rw_bus_oe_set_mask, scope iop_sw_spu, type rw */
163typedef struct {
164 unsigned int byte0 : 1;
165 unsigned int byte1 : 1;
166 unsigned int byte2 : 1;
167 unsigned int byte3 : 1;
168 unsigned int dummy1 : 28;
169} reg_iop_sw_spu_rw_bus_oe_set_mask;
170#define REG_RD_ADDR_iop_sw_spu_rw_bus_oe_set_mask 40
171#define REG_WR_ADDR_iop_sw_spu_rw_bus_oe_set_mask 40
172
173/* Register r_bus_in, scope iop_sw_spu, type r */
174typedef unsigned int reg_iop_sw_spu_r_bus_in;
175#define REG_RD_ADDR_iop_sw_spu_r_bus_in 44
176
177/* Register rw_gio_clr_mask, scope iop_sw_spu, type rw */
178typedef struct {
179 unsigned int val : 32;
180} reg_iop_sw_spu_rw_gio_clr_mask;
181#define REG_RD_ADDR_iop_sw_spu_rw_gio_clr_mask 48
182#define REG_WR_ADDR_iop_sw_spu_rw_gio_clr_mask 48
183
184/* Register rw_gio_set_mask, scope iop_sw_spu, type rw */
185typedef struct {
186 unsigned int val : 32;
187} reg_iop_sw_spu_rw_gio_set_mask;
188#define REG_RD_ADDR_iop_sw_spu_rw_gio_set_mask 52
189#define REG_WR_ADDR_iop_sw_spu_rw_gio_set_mask 52
190
191/* Register rw_gio_oe_clr_mask, scope iop_sw_spu, type rw */
192typedef struct {
193 unsigned int val : 32;
194} reg_iop_sw_spu_rw_gio_oe_clr_mask;
195#define REG_RD_ADDR_iop_sw_spu_rw_gio_oe_clr_mask 56
196#define REG_WR_ADDR_iop_sw_spu_rw_gio_oe_clr_mask 56
197
198/* Register rw_gio_oe_set_mask, scope iop_sw_spu, type rw */
199typedef struct {
200 unsigned int val : 32;
201} reg_iop_sw_spu_rw_gio_oe_set_mask;
202#define REG_RD_ADDR_iop_sw_spu_rw_gio_oe_set_mask 60
203#define REG_WR_ADDR_iop_sw_spu_rw_gio_oe_set_mask 60
204
205/* Register r_gio_in, scope iop_sw_spu, type r */
206typedef unsigned int reg_iop_sw_spu_r_gio_in;
207#define REG_RD_ADDR_iop_sw_spu_r_gio_in 64
208
209/* Register rw_bus_clr_mask_lo, scope iop_sw_spu, type rw */
210typedef struct {
211 unsigned int byte0 : 8;
212 unsigned int byte1 : 8;
213 unsigned int dummy1 : 16;
214} reg_iop_sw_spu_rw_bus_clr_mask_lo;
215#define REG_RD_ADDR_iop_sw_spu_rw_bus_clr_mask_lo 68
216#define REG_WR_ADDR_iop_sw_spu_rw_bus_clr_mask_lo 68
217
218/* Register rw_bus_clr_mask_hi, scope iop_sw_spu, type rw */
219typedef struct {
220 unsigned int byte2 : 8;
221 unsigned int byte3 : 8;
222 unsigned int dummy1 : 16;
223} reg_iop_sw_spu_rw_bus_clr_mask_hi;
224#define REG_RD_ADDR_iop_sw_spu_rw_bus_clr_mask_hi 72
225#define REG_WR_ADDR_iop_sw_spu_rw_bus_clr_mask_hi 72
226
227/* Register rw_bus_set_mask_lo, scope iop_sw_spu, type rw */
228typedef struct {
229 unsigned int byte0 : 8;
230 unsigned int byte1 : 8;
231 unsigned int dummy1 : 16;
232} reg_iop_sw_spu_rw_bus_set_mask_lo;
233#define REG_RD_ADDR_iop_sw_spu_rw_bus_set_mask_lo 76
234#define REG_WR_ADDR_iop_sw_spu_rw_bus_set_mask_lo 76
235
236/* Register rw_bus_set_mask_hi, scope iop_sw_spu, type rw */
237typedef struct {
238 unsigned int byte2 : 8;
239 unsigned int byte3 : 8;
240 unsigned int dummy1 : 16;
241} reg_iop_sw_spu_rw_bus_set_mask_hi;
242#define REG_RD_ADDR_iop_sw_spu_rw_bus_set_mask_hi 80
243#define REG_WR_ADDR_iop_sw_spu_rw_bus_set_mask_hi 80
244
245/* Register rw_gio_clr_mask_lo, scope iop_sw_spu, type rw */
246typedef struct {
247 unsigned int val : 16;
248 unsigned int dummy1 : 16;
249} reg_iop_sw_spu_rw_gio_clr_mask_lo;
250#define REG_RD_ADDR_iop_sw_spu_rw_gio_clr_mask_lo 84
251#define REG_WR_ADDR_iop_sw_spu_rw_gio_clr_mask_lo 84
252
253/* Register rw_gio_clr_mask_hi, scope iop_sw_spu, type rw */
254typedef struct {
255 unsigned int val : 16;
256 unsigned int dummy1 : 16;
257} reg_iop_sw_spu_rw_gio_clr_mask_hi;
258#define REG_RD_ADDR_iop_sw_spu_rw_gio_clr_mask_hi 88
259#define REG_WR_ADDR_iop_sw_spu_rw_gio_clr_mask_hi 88
260
261/* Register rw_gio_set_mask_lo, scope iop_sw_spu, type rw */
262typedef struct {
263 unsigned int val : 16;
264 unsigned int dummy1 : 16;
265} reg_iop_sw_spu_rw_gio_set_mask_lo;
266#define REG_RD_ADDR_iop_sw_spu_rw_gio_set_mask_lo 92
267#define REG_WR_ADDR_iop_sw_spu_rw_gio_set_mask_lo 92
268
269/* Register rw_gio_set_mask_hi, scope iop_sw_spu, type rw */
270typedef struct {
271 unsigned int val : 16;
272 unsigned int dummy1 : 16;
273} reg_iop_sw_spu_rw_gio_set_mask_hi;
274#define REG_RD_ADDR_iop_sw_spu_rw_gio_set_mask_hi 96
275#define REG_WR_ADDR_iop_sw_spu_rw_gio_set_mask_hi 96
276
277/* Register rw_gio_oe_clr_mask_lo, scope iop_sw_spu, type rw */
278typedef struct {
279 unsigned int val : 16;
280 unsigned int dummy1 : 16;
281} reg_iop_sw_spu_rw_gio_oe_clr_mask_lo;
282#define REG_RD_ADDR_iop_sw_spu_rw_gio_oe_clr_mask_lo 100
283#define REG_WR_ADDR_iop_sw_spu_rw_gio_oe_clr_mask_lo 100
284
285/* Register rw_gio_oe_clr_mask_hi, scope iop_sw_spu, type rw */
286typedef struct {
287 unsigned int val : 16;
288 unsigned int dummy1 : 16;
289} reg_iop_sw_spu_rw_gio_oe_clr_mask_hi;
290#define REG_RD_ADDR_iop_sw_spu_rw_gio_oe_clr_mask_hi 104
291#define REG_WR_ADDR_iop_sw_spu_rw_gio_oe_clr_mask_hi 104
292
293/* Register rw_gio_oe_set_mask_lo, scope iop_sw_spu, type rw */
294typedef struct {
295 unsigned int val : 16;
296 unsigned int dummy1 : 16;
297} reg_iop_sw_spu_rw_gio_oe_set_mask_lo;
298#define REG_RD_ADDR_iop_sw_spu_rw_gio_oe_set_mask_lo 108
299#define REG_WR_ADDR_iop_sw_spu_rw_gio_oe_set_mask_lo 108
300
301/* Register rw_gio_oe_set_mask_hi, scope iop_sw_spu, type rw */
302typedef struct {
303 unsigned int val : 16;
304 unsigned int dummy1 : 16;
305} reg_iop_sw_spu_rw_gio_oe_set_mask_hi;
306#define REG_RD_ADDR_iop_sw_spu_rw_gio_oe_set_mask_hi 112
307#define REG_WR_ADDR_iop_sw_spu_rw_gio_oe_set_mask_hi 112
308
309/* Register rw_cpu_intr, scope iop_sw_spu, type rw */
310typedef struct {
311 unsigned int intr0 : 1;
312 unsigned int intr1 : 1;
313 unsigned int intr2 : 1;
314 unsigned int intr3 : 1;
315 unsigned int intr4 : 1;
316 unsigned int intr5 : 1;
317 unsigned int intr6 : 1;
318 unsigned int intr7 : 1;
319 unsigned int intr8 : 1;
320 unsigned int intr9 : 1;
321 unsigned int intr10 : 1;
322 unsigned int intr11 : 1;
323 unsigned int intr12 : 1;
324 unsigned int intr13 : 1;
325 unsigned int intr14 : 1;
326 unsigned int intr15 : 1;
327 unsigned int dummy1 : 16;
328} reg_iop_sw_spu_rw_cpu_intr;
329#define REG_RD_ADDR_iop_sw_spu_rw_cpu_intr 116
330#define REG_WR_ADDR_iop_sw_spu_rw_cpu_intr 116
331
332/* Register r_cpu_intr, scope iop_sw_spu, type r */
333typedef struct {
334 unsigned int intr0 : 1;
335 unsigned int intr1 : 1;
336 unsigned int intr2 : 1;
337 unsigned int intr3 : 1;
338 unsigned int intr4 : 1;
339 unsigned int intr5 : 1;
340 unsigned int intr6 : 1;
341 unsigned int intr7 : 1;
342 unsigned int intr8 : 1;
343 unsigned int intr9 : 1;
344 unsigned int intr10 : 1;
345 unsigned int intr11 : 1;
346 unsigned int intr12 : 1;
347 unsigned int intr13 : 1;
348 unsigned int intr14 : 1;
349 unsigned int intr15 : 1;
350 unsigned int dummy1 : 16;
351} reg_iop_sw_spu_r_cpu_intr;
352#define REG_RD_ADDR_iop_sw_spu_r_cpu_intr 120
353
354/* Register r_hw_intr, scope iop_sw_spu, type r */
355typedef struct {
356 unsigned int trigger_grp0 : 1;
357 unsigned int trigger_grp1 : 1;
358 unsigned int trigger_grp2 : 1;
359 unsigned int trigger_grp3 : 1;
360 unsigned int trigger_grp4 : 1;
361 unsigned int trigger_grp5 : 1;
362 unsigned int trigger_grp6 : 1;
363 unsigned int trigger_grp7 : 1;
364 unsigned int timer_grp0 : 1;
365 unsigned int timer_grp1 : 1;
366 unsigned int fifo_out : 1;
367 unsigned int fifo_out_extra : 1;
368 unsigned int fifo_in : 1;
369 unsigned int fifo_in_extra : 1;
370 unsigned int dmc_out : 1;
371 unsigned int dmc_in : 1;
372 unsigned int dummy1 : 16;
373} reg_iop_sw_spu_r_hw_intr;
374#define REG_RD_ADDR_iop_sw_spu_r_hw_intr 124
375
376/* Register rw_mpu_intr, scope iop_sw_spu, type rw */
377typedef struct {
378 unsigned int intr0 : 1;
379 unsigned int intr1 : 1;
380 unsigned int intr2 : 1;
381 unsigned int intr3 : 1;
382 unsigned int intr4 : 1;
383 unsigned int intr5 : 1;
384 unsigned int intr6 : 1;
385 unsigned int intr7 : 1;
386 unsigned int intr8 : 1;
387 unsigned int intr9 : 1;
388 unsigned int intr10 : 1;
389 unsigned int intr11 : 1;
390 unsigned int intr12 : 1;
391 unsigned int intr13 : 1;
392 unsigned int intr14 : 1;
393 unsigned int intr15 : 1;
394 unsigned int dummy1 : 16;
395} reg_iop_sw_spu_rw_mpu_intr;
396#define REG_RD_ADDR_iop_sw_spu_rw_mpu_intr 128
397#define REG_WR_ADDR_iop_sw_spu_rw_mpu_intr 128
398
399/* Register r_mpu_intr, scope iop_sw_spu, type r */
400typedef struct {
401 unsigned int intr0 : 1;
402 unsigned int intr1 : 1;
403 unsigned int intr2 : 1;
404 unsigned int intr3 : 1;
405 unsigned int intr4 : 1;
406 unsigned int intr5 : 1;
407 unsigned int intr6 : 1;
408 unsigned int intr7 : 1;
409 unsigned int intr8 : 1;
410 unsigned int intr9 : 1;
411 unsigned int intr10 : 1;
412 unsigned int intr11 : 1;
413 unsigned int intr12 : 1;
414 unsigned int intr13 : 1;
415 unsigned int intr14 : 1;
416 unsigned int intr15 : 1;
417 unsigned int dummy1 : 16;
418} reg_iop_sw_spu_r_mpu_intr;
419#define REG_RD_ADDR_iop_sw_spu_r_mpu_intr 132
420
421
422/* Constants */
423enum {
424 regk_iop_sw_spu_copy = 0x00000000,
425 regk_iop_sw_spu_no = 0x00000000,
426 regk_iop_sw_spu_nop = 0x00000000,
427 regk_iop_sw_spu_rd = 0x00000002,
428 regk_iop_sw_spu_reg_copy = 0x00000001,
429 regk_iop_sw_spu_rw_bus_clr_mask_default = 0x00000000,
430 regk_iop_sw_spu_rw_bus_oe_clr_mask_default = 0x00000000,
431 regk_iop_sw_spu_rw_bus_oe_set_mask_default = 0x00000000,
432 regk_iop_sw_spu_rw_bus_set_mask_default = 0x00000000,
433 regk_iop_sw_spu_rw_gio_clr_mask_default = 0x00000000,
434 regk_iop_sw_spu_rw_gio_oe_clr_mask_default = 0x00000000,
435 regk_iop_sw_spu_rw_gio_oe_set_mask_default = 0x00000000,
436 regk_iop_sw_spu_rw_gio_set_mask_default = 0x00000000,
437 regk_iop_sw_spu_set = 0x00000001,
438 regk_iop_sw_spu_wr = 0x00000003,
439 regk_iop_sw_spu_yes = 0x00000001
440};
441#endif /* __iop_sw_spu_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_version_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_version_defs.h
new file mode 100644
index 000000000000..20de425e652b
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/iop/iop_version_defs.h
@@ -0,0 +1,96 @@
1#ifndef __iop_version_defs_h
2#define __iop_version_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: iop_version.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile iop_version_defs.h iop_version.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope iop_version */
83
84/* Register r_version, scope iop_version, type r */
85typedef struct {
86 unsigned int nr : 8;
87 unsigned int dummy1 : 24;
88} reg_iop_version_r_version;
89#define REG_RD_ADDR_iop_version_r_version 0
90
91
92/* Constants */
93enum {
94 regk_iop_version_v2_0 = 0x00000002
95};
96#endif /* __iop_version_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/l2cache_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/l2cache_defs.h
new file mode 100644
index 000000000000..243ac3c882cb
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/l2cache_defs.h
@@ -0,0 +1,142 @@
1#ifndef __l2cache_defs_h
2#define __l2cache_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: l2cache.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile l2cache_defs.h l2cache.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope l2cache */
83
84/* Register rw_cfg, scope l2cache, type rw */
85typedef struct {
86 unsigned int en : 1;
87 unsigned int dummy1 : 31;
88} reg_l2cache_rw_cfg;
89#define REG_RD_ADDR_l2cache_rw_cfg 0
90#define REG_WR_ADDR_l2cache_rw_cfg 0
91
92/* Register rw_ctrl, scope l2cache, type rw */
93typedef struct {
94 unsigned int dummy1 : 7;
95 unsigned int cbase : 9;
96 unsigned int dummy2 : 4;
97 unsigned int csize : 10;
98 unsigned int dummy3 : 2;
99} reg_l2cache_rw_ctrl;
100#define REG_RD_ADDR_l2cache_rw_ctrl 4
101#define REG_WR_ADDR_l2cache_rw_ctrl 4
102
103/* Register rw_idxop, scope l2cache, type rw */
104typedef struct {
105 unsigned int idx : 10;
106 unsigned int dummy1 : 14;
107 unsigned int way : 3;
108 unsigned int dummy2 : 2;
109 unsigned int cmd : 3;
110} reg_l2cache_rw_idxop;
111#define REG_RD_ADDR_l2cache_rw_idxop 8
112#define REG_WR_ADDR_l2cache_rw_idxop 8
113
114/* Register rw_addrop_addr, scope l2cache, type rw */
115typedef struct {
116 unsigned int addr : 32;
117} reg_l2cache_rw_addrop_addr;
118#define REG_RD_ADDR_l2cache_rw_addrop_addr 12
119#define REG_WR_ADDR_l2cache_rw_addrop_addr 12
120
121/* Register rw_addrop_ctrl, scope l2cache, type rw */
122typedef struct {
123 unsigned int size : 16;
124 unsigned int dummy1 : 13;
125 unsigned int cmd : 3;
126} reg_l2cache_rw_addrop_ctrl;
127#define REG_RD_ADDR_l2cache_rw_addrop_ctrl 16
128#define REG_WR_ADDR_l2cache_rw_addrop_ctrl 16
129
130
131/* Constants */
132enum {
133 regk_l2cache_flush = 0x00000001,
134 regk_l2cache_no = 0x00000000,
135 regk_l2cache_rw_addrop_addr_default = 0x00000000,
136 regk_l2cache_rw_addrop_ctrl_default = 0x00000000,
137 regk_l2cache_rw_cfg_default = 0x00000000,
138 regk_l2cache_rw_ctrl_default = 0x00000000,
139 regk_l2cache_rw_idxop_default = 0x00000000,
140 regk_l2cache_yes = 0x00000001
141};
142#endif /* __l2cache_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/marb_bar_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/marb_bar_defs.h
new file mode 100644
index 000000000000..c0e7628cbf7d
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/marb_bar_defs.h
@@ -0,0 +1,482 @@
1#ifndef __marb_bar_defs_h
2#define __marb_bar_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: marb_bar.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile marb_bar_defs.h marb_bar.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope marb_bar */
83
84#define STRIDE_marb_bar_rw_ddr2_slots 4
85/* Register rw_ddr2_slots, scope marb_bar, type rw */
86typedef struct {
87 unsigned int owner : 4;
88 unsigned int dummy1 : 28;
89} reg_marb_bar_rw_ddr2_slots;
90#define REG_RD_ADDR_marb_bar_rw_ddr2_slots 0
91#define REG_WR_ADDR_marb_bar_rw_ddr2_slots 0
92
93/* Register rw_h264_rd_burst, scope marb_bar, type rw */
94typedef struct {
95 unsigned int ddr2_bsize : 2;
96 unsigned int dummy1 : 30;
97} reg_marb_bar_rw_h264_rd_burst;
98#define REG_RD_ADDR_marb_bar_rw_h264_rd_burst 256
99#define REG_WR_ADDR_marb_bar_rw_h264_rd_burst 256
100
101/* Register rw_h264_wr_burst, scope marb_bar, type rw */
102typedef struct {
103 unsigned int ddr2_bsize : 2;
104 unsigned int dummy1 : 30;
105} reg_marb_bar_rw_h264_wr_burst;
106#define REG_RD_ADDR_marb_bar_rw_h264_wr_burst 260
107#define REG_WR_ADDR_marb_bar_rw_h264_wr_burst 260
108
109/* Register rw_ccd_burst, scope marb_bar, type rw */
110typedef struct {
111 unsigned int ddr2_bsize : 2;
112 unsigned int dummy1 : 30;
113} reg_marb_bar_rw_ccd_burst;
114#define REG_RD_ADDR_marb_bar_rw_ccd_burst 264
115#define REG_WR_ADDR_marb_bar_rw_ccd_burst 264
116
117/* Register rw_vin_wr_burst, scope marb_bar, type rw */
118typedef struct {
119 unsigned int ddr2_bsize : 2;
120 unsigned int dummy1 : 30;
121} reg_marb_bar_rw_vin_wr_burst;
122#define REG_RD_ADDR_marb_bar_rw_vin_wr_burst 268
123#define REG_WR_ADDR_marb_bar_rw_vin_wr_burst 268
124
125/* Register rw_vin_rd_burst, scope marb_bar, type rw */
126typedef struct {
127 unsigned int ddr2_bsize : 2;
128 unsigned int dummy1 : 30;
129} reg_marb_bar_rw_vin_rd_burst;
130#define REG_RD_ADDR_marb_bar_rw_vin_rd_burst 272
131#define REG_WR_ADDR_marb_bar_rw_vin_rd_burst 272
132
133/* Register rw_sclr_rd_burst, scope marb_bar, type rw */
134typedef struct {
135 unsigned int ddr2_bsize : 2;
136 unsigned int dummy1 : 30;
137} reg_marb_bar_rw_sclr_rd_burst;
138#define REG_RD_ADDR_marb_bar_rw_sclr_rd_burst 276
139#define REG_WR_ADDR_marb_bar_rw_sclr_rd_burst 276
140
141/* Register rw_vout_burst, scope marb_bar, type rw */
142typedef struct {
143 unsigned int ddr2_bsize : 2;
144 unsigned int dummy1 : 30;
145} reg_marb_bar_rw_vout_burst;
146#define REG_RD_ADDR_marb_bar_rw_vout_burst 280
147#define REG_WR_ADDR_marb_bar_rw_vout_burst 280
148
149/* Register rw_sclr_fifo_burst, scope marb_bar, type rw */
150typedef struct {
151 unsigned int ddr2_bsize : 2;
152 unsigned int dummy1 : 30;
153} reg_marb_bar_rw_sclr_fifo_burst;
154#define REG_RD_ADDR_marb_bar_rw_sclr_fifo_burst 284
155#define REG_WR_ADDR_marb_bar_rw_sclr_fifo_burst 284
156
157/* Register rw_l2cache_burst, scope marb_bar, type rw */
158typedef struct {
159 unsigned int ddr2_bsize : 2;
160 unsigned int dummy1 : 30;
161} reg_marb_bar_rw_l2cache_burst;
162#define REG_RD_ADDR_marb_bar_rw_l2cache_burst 288
163#define REG_WR_ADDR_marb_bar_rw_l2cache_burst 288
164
165/* Register rw_intr_mask, scope marb_bar, type rw */
166typedef struct {
167 unsigned int bp0 : 1;
168 unsigned int bp1 : 1;
169 unsigned int bp2 : 1;
170 unsigned int bp3 : 1;
171 unsigned int dummy1 : 28;
172} reg_marb_bar_rw_intr_mask;
173#define REG_RD_ADDR_marb_bar_rw_intr_mask 292
174#define REG_WR_ADDR_marb_bar_rw_intr_mask 292
175
176/* Register rw_ack_intr, scope marb_bar, type rw */
177typedef struct {
178 unsigned int bp0 : 1;
179 unsigned int bp1 : 1;
180 unsigned int bp2 : 1;
181 unsigned int bp3 : 1;
182 unsigned int dummy1 : 28;
183} reg_marb_bar_rw_ack_intr;
184#define REG_RD_ADDR_marb_bar_rw_ack_intr 296
185#define REG_WR_ADDR_marb_bar_rw_ack_intr 296
186
187/* Register r_intr, scope marb_bar, type r */
188typedef struct {
189 unsigned int bp0 : 1;
190 unsigned int bp1 : 1;
191 unsigned int bp2 : 1;
192 unsigned int bp3 : 1;
193 unsigned int dummy1 : 28;
194} reg_marb_bar_r_intr;
195#define REG_RD_ADDR_marb_bar_r_intr 300
196
197/* Register r_masked_intr, scope marb_bar, type r */
198typedef struct {
199 unsigned int bp0 : 1;
200 unsigned int bp1 : 1;
201 unsigned int bp2 : 1;
202 unsigned int bp3 : 1;
203 unsigned int dummy1 : 28;
204} reg_marb_bar_r_masked_intr;
205#define REG_RD_ADDR_marb_bar_r_masked_intr 304
206
207/* Register rw_stop_mask, scope marb_bar, type rw */
208typedef struct {
209 unsigned int h264_rd : 1;
210 unsigned int h264_wr : 1;
211 unsigned int ccd : 1;
212 unsigned int vin_wr : 1;
213 unsigned int vin_rd : 1;
214 unsigned int sclr_rd : 1;
215 unsigned int vout : 1;
216 unsigned int sclr_fifo : 1;
217 unsigned int l2cache : 1;
218 unsigned int dummy1 : 23;
219} reg_marb_bar_rw_stop_mask;
220#define REG_RD_ADDR_marb_bar_rw_stop_mask 308
221#define REG_WR_ADDR_marb_bar_rw_stop_mask 308
222
223/* Register r_stopped, scope marb_bar, type r */
224typedef struct {
225 unsigned int h264_rd : 1;
226 unsigned int h264_wr : 1;
227 unsigned int ccd : 1;
228 unsigned int vin_wr : 1;
229 unsigned int vin_rd : 1;
230 unsigned int sclr_rd : 1;
231 unsigned int vout : 1;
232 unsigned int sclr_fifo : 1;
233 unsigned int l2cache : 1;
234 unsigned int dummy1 : 23;
235} reg_marb_bar_r_stopped;
236#define REG_RD_ADDR_marb_bar_r_stopped 312
237
238/* Register rw_no_snoop, scope marb_bar, type rw */
239typedef struct {
240 unsigned int h264_rd : 1;
241 unsigned int h264_wr : 1;
242 unsigned int ccd : 1;
243 unsigned int vin_wr : 1;
244 unsigned int vin_rd : 1;
245 unsigned int sclr_rd : 1;
246 unsigned int vout : 1;
247 unsigned int sclr_fifo : 1;
248 unsigned int l2cache : 1;
249 unsigned int dummy1 : 23;
250} reg_marb_bar_rw_no_snoop;
251#define REG_RD_ADDR_marb_bar_rw_no_snoop 576
252#define REG_WR_ADDR_marb_bar_rw_no_snoop 576
253
254
255/* Constants */
256enum {
257 regk_marb_bar_ccd = 0x00000002,
258 regk_marb_bar_h264_rd = 0x00000000,
259 regk_marb_bar_h264_wr = 0x00000001,
260 regk_marb_bar_l2cache = 0x00000008,
261 regk_marb_bar_no = 0x00000000,
262 regk_marb_bar_r_stopped_default = 0x00000000,
263 regk_marb_bar_rw_ccd_burst_default = 0x00000000,
264 regk_marb_bar_rw_ddr2_slots_default = 0x00000000,
265 regk_marb_bar_rw_ddr2_slots_size = 0x00000040,
266 regk_marb_bar_rw_h264_rd_burst_default = 0x00000000,
267 regk_marb_bar_rw_h264_wr_burst_default = 0x00000000,
268 regk_marb_bar_rw_intr_mask_default = 0x00000000,
269 regk_marb_bar_rw_l2cache_burst_default = 0x00000000,
270 regk_marb_bar_rw_no_snoop_default = 0x00000000,
271 regk_marb_bar_rw_sclr_fifo_burst_default = 0x00000000,
272 regk_marb_bar_rw_sclr_rd_burst_default = 0x00000000,
273 regk_marb_bar_rw_stop_mask_default = 0x00000000,
274 regk_marb_bar_rw_vin_rd_burst_default = 0x00000000,
275 regk_marb_bar_rw_vin_wr_burst_default = 0x00000000,
276 regk_marb_bar_rw_vout_burst_default = 0x00000000,
277 regk_marb_bar_sclr_fifo = 0x00000007,
278 regk_marb_bar_sclr_rd = 0x00000005,
279 regk_marb_bar_vin_rd = 0x00000004,
280 regk_marb_bar_vin_wr = 0x00000003,
281 regk_marb_bar_vout = 0x00000006,
282 regk_marb_bar_yes = 0x00000001
283};
284#endif /* __marb_bar_defs_h */
285#ifndef __marb_bar_bp_defs_h
286#define __marb_bar_bp_defs_h
287
288/*
289 * This file is autogenerated from
290 * file: marb_bar.r
291 *
292 * by ../../../tools/rdesc/bin/rdes2c -outfile marb_bar_defs.h marb_bar.r
293 * Any changes here will be lost.
294 *
295 * -*- buffer-read-only: t -*-
296 */
297/* Main access macros */
298#ifndef REG_RD
299#define REG_RD( scope, inst, reg ) \
300 REG_READ( reg_##scope##_##reg, \
301 (inst) + REG_RD_ADDR_##scope##_##reg )
302#endif
303
304#ifndef REG_WR
305#define REG_WR( scope, inst, reg, val ) \
306 REG_WRITE( reg_##scope##_##reg, \
307 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
308#endif
309
310#ifndef REG_RD_VECT
311#define REG_RD_VECT( scope, inst, reg, index ) \
312 REG_READ( reg_##scope##_##reg, \
313 (inst) + REG_RD_ADDR_##scope##_##reg + \
314 (index) * STRIDE_##scope##_##reg )
315#endif
316
317#ifndef REG_WR_VECT
318#define REG_WR_VECT( scope, inst, reg, index, val ) \
319 REG_WRITE( reg_##scope##_##reg, \
320 (inst) + REG_WR_ADDR_##scope##_##reg + \
321 (index) * STRIDE_##scope##_##reg, (val) )
322#endif
323
324#ifndef REG_RD_INT
325#define REG_RD_INT( scope, inst, reg ) \
326 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
327#endif
328
329#ifndef REG_WR_INT
330#define REG_WR_INT( scope, inst, reg, val ) \
331 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
332#endif
333
334#ifndef REG_RD_INT_VECT
335#define REG_RD_INT_VECT( scope, inst, reg, index ) \
336 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
337 (index) * STRIDE_##scope##_##reg )
338#endif
339
340#ifndef REG_WR_INT_VECT
341#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
342 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
343 (index) * STRIDE_##scope##_##reg, (val) )
344#endif
345
346#ifndef REG_TYPE_CONV
347#define REG_TYPE_CONV( type, orgtype, val ) \
348 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
349#endif
350
351#ifndef reg_page_size
352#define reg_page_size 8192
353#endif
354
355#ifndef REG_ADDR
356#define REG_ADDR( scope, inst, reg ) \
357 ( (inst) + REG_RD_ADDR_##scope##_##reg )
358#endif
359
360#ifndef REG_ADDR_VECT
361#define REG_ADDR_VECT( scope, inst, reg, index ) \
362 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
363 (index) * STRIDE_##scope##_##reg )
364#endif
365
366/* C-code for register scope marb_bar_bp */
367
368/* Register rw_first_addr, scope marb_bar_bp, type rw */
369typedef unsigned int reg_marb_bar_bp_rw_first_addr;
370#define REG_RD_ADDR_marb_bar_bp_rw_first_addr 0
371#define REG_WR_ADDR_marb_bar_bp_rw_first_addr 0
372
373/* Register rw_last_addr, scope marb_bar_bp, type rw */
374typedef unsigned int reg_marb_bar_bp_rw_last_addr;
375#define REG_RD_ADDR_marb_bar_bp_rw_last_addr 4
376#define REG_WR_ADDR_marb_bar_bp_rw_last_addr 4
377
378/* Register rw_op, scope marb_bar_bp, type rw */
379typedef struct {
380 unsigned int rd : 1;
381 unsigned int wr : 1;
382 unsigned int rd_excl : 1;
383 unsigned int pri_wr : 1;
384 unsigned int us_rd : 1;
385 unsigned int us_wr : 1;
386 unsigned int us_rd_excl : 1;
387 unsigned int us_pri_wr : 1;
388 unsigned int dummy1 : 24;
389} reg_marb_bar_bp_rw_op;
390#define REG_RD_ADDR_marb_bar_bp_rw_op 8
391#define REG_WR_ADDR_marb_bar_bp_rw_op 8
392
393/* Register rw_clients, scope marb_bar_bp, type rw */
394typedef struct {
395 unsigned int h264_rd : 1;
396 unsigned int h264_wr : 1;
397 unsigned int ccd : 1;
398 unsigned int vin_wr : 1;
399 unsigned int vin_rd : 1;
400 unsigned int sclr_rd : 1;
401 unsigned int vout : 1;
402 unsigned int sclr_fifo : 1;
403 unsigned int l2cache : 1;
404 unsigned int dummy1 : 23;
405} reg_marb_bar_bp_rw_clients;
406#define REG_RD_ADDR_marb_bar_bp_rw_clients 12
407#define REG_WR_ADDR_marb_bar_bp_rw_clients 12
408
409/* Register rw_options, scope marb_bar_bp, type rw */
410typedef struct {
411 unsigned int wrap : 1;
412 unsigned int dummy1 : 31;
413} reg_marb_bar_bp_rw_options;
414#define REG_RD_ADDR_marb_bar_bp_rw_options 16
415#define REG_WR_ADDR_marb_bar_bp_rw_options 16
416
417/* Register r_brk_addr, scope marb_bar_bp, type r */
418typedef unsigned int reg_marb_bar_bp_r_brk_addr;
419#define REG_RD_ADDR_marb_bar_bp_r_brk_addr 20
420
421/* Register r_brk_op, scope marb_bar_bp, type r */
422typedef struct {
423 unsigned int rd : 1;
424 unsigned int wr : 1;
425 unsigned int rd_excl : 1;
426 unsigned int pri_wr : 1;
427 unsigned int us_rd : 1;
428 unsigned int us_wr : 1;
429 unsigned int us_rd_excl : 1;
430 unsigned int us_pri_wr : 1;
431 unsigned int dummy1 : 24;
432} reg_marb_bar_bp_r_brk_op;
433#define REG_RD_ADDR_marb_bar_bp_r_brk_op 24
434
435/* Register r_brk_clients, scope marb_bar_bp, type r */
436typedef struct {
437 unsigned int h264_rd : 1;
438 unsigned int h264_wr : 1;
439 unsigned int ccd : 1;
440 unsigned int vin_wr : 1;
441 unsigned int vin_rd : 1;
442 unsigned int sclr_rd : 1;
443 unsigned int vout : 1;
444 unsigned int sclr_fifo : 1;
445 unsigned int l2cache : 1;
446 unsigned int dummy1 : 23;
447} reg_marb_bar_bp_r_brk_clients;
448#define REG_RD_ADDR_marb_bar_bp_r_brk_clients 28
449
450/* Register r_brk_first_client, scope marb_bar_bp, type r */
451typedef struct {
452 unsigned int h264_rd : 1;
453 unsigned int h264_wr : 1;
454 unsigned int ccd : 1;
455 unsigned int vin_wr : 1;
456 unsigned int vin_rd : 1;
457 unsigned int sclr_rd : 1;
458 unsigned int vout : 1;
459 unsigned int sclr_fifo : 1;
460 unsigned int l2cache : 1;
461 unsigned int dummy1 : 23;
462} reg_marb_bar_bp_r_brk_first_client;
463#define REG_RD_ADDR_marb_bar_bp_r_brk_first_client 32
464
465/* Register r_brk_size, scope marb_bar_bp, type r */
466typedef unsigned int reg_marb_bar_bp_r_brk_size;
467#define REG_RD_ADDR_marb_bar_bp_r_brk_size 36
468
469/* Register rw_ack, scope marb_bar_bp, type rw */
470typedef unsigned int reg_marb_bar_bp_rw_ack;
471#define REG_RD_ADDR_marb_bar_bp_rw_ack 40
472#define REG_WR_ADDR_marb_bar_bp_rw_ack 40
473
474
475/* Constants */
476enum {
477 regk_marb_bar_bp_no = 0x00000000,
478 regk_marb_bar_bp_rw_op_default = 0x00000000,
479 regk_marb_bar_bp_rw_options_default = 0x00000000,
480 regk_marb_bar_bp_yes = 0x00000001
481};
482#endif /* __marb_bar_bp_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/marb_foo_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/marb_foo_defs.h
new file mode 100644
index 000000000000..2baa833f109a
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/marb_foo_defs.h
@@ -0,0 +1,626 @@
1#ifndef __marb_foo_defs_h
2#define __marb_foo_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: marb_foo.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile marb_foo_defs.h marb_foo.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope marb_foo */
83
84#define STRIDE_marb_foo_rw_intm_slots 4
85/* Register rw_intm_slots, scope marb_foo, type rw */
86typedef struct {
87 unsigned int owner : 4;
88 unsigned int dummy1 : 28;
89} reg_marb_foo_rw_intm_slots;
90#define REG_RD_ADDR_marb_foo_rw_intm_slots 0
91#define REG_WR_ADDR_marb_foo_rw_intm_slots 0
92
93#define STRIDE_marb_foo_rw_l2_slots 4
94/* Register rw_l2_slots, scope marb_foo, type rw */
95typedef struct {
96 unsigned int owner : 4;
97 unsigned int dummy1 : 28;
98} reg_marb_foo_rw_l2_slots;
99#define REG_RD_ADDR_marb_foo_rw_l2_slots 256
100#define REG_WR_ADDR_marb_foo_rw_l2_slots 256
101
102#define STRIDE_marb_foo_rw_regs_slots 4
103/* Register rw_regs_slots, scope marb_foo, type rw */
104typedef struct {
105 unsigned int owner : 4;
106 unsigned int dummy1 : 28;
107} reg_marb_foo_rw_regs_slots;
108#define REG_RD_ADDR_marb_foo_rw_regs_slots 512
109#define REG_WR_ADDR_marb_foo_rw_regs_slots 512
110
111/* Register rw_sclr_burst, scope marb_foo, type rw */
112typedef struct {
113 unsigned int intm_bsize : 2;
114 unsigned int l2_bsize : 2;
115 unsigned int dummy1 : 28;
116} reg_marb_foo_rw_sclr_burst;
117#define REG_RD_ADDR_marb_foo_rw_sclr_burst 528
118#define REG_WR_ADDR_marb_foo_rw_sclr_burst 528
119
120/* Register rw_dma0_burst, scope marb_foo, type rw */
121typedef struct {
122 unsigned int intm_bsize : 2;
123 unsigned int l2_bsize : 2;
124 unsigned int dummy1 : 28;
125} reg_marb_foo_rw_dma0_burst;
126#define REG_RD_ADDR_marb_foo_rw_dma0_burst 532
127#define REG_WR_ADDR_marb_foo_rw_dma0_burst 532
128
129/* Register rw_dma1_burst, scope marb_foo, type rw */
130typedef struct {
131 unsigned int intm_bsize : 2;
132 unsigned int l2_bsize : 2;
133 unsigned int dummy1 : 28;
134} reg_marb_foo_rw_dma1_burst;
135#define REG_RD_ADDR_marb_foo_rw_dma1_burst 536
136#define REG_WR_ADDR_marb_foo_rw_dma1_burst 536
137
138/* Register rw_dma2_burst, scope marb_foo, type rw */
139typedef struct {
140 unsigned int intm_bsize : 2;
141 unsigned int l2_bsize : 2;
142 unsigned int dummy1 : 28;
143} reg_marb_foo_rw_dma2_burst;
144#define REG_RD_ADDR_marb_foo_rw_dma2_burst 540
145#define REG_WR_ADDR_marb_foo_rw_dma2_burst 540
146
147/* Register rw_dma3_burst, scope marb_foo, type rw */
148typedef struct {
149 unsigned int intm_bsize : 2;
150 unsigned int l2_bsize : 2;
151 unsigned int dummy1 : 28;
152} reg_marb_foo_rw_dma3_burst;
153#define REG_RD_ADDR_marb_foo_rw_dma3_burst 544
154#define REG_WR_ADDR_marb_foo_rw_dma3_burst 544
155
156/* Register rw_dma4_burst, scope marb_foo, type rw */
157typedef struct {
158 unsigned int intm_bsize : 2;
159 unsigned int l2_bsize : 2;
160 unsigned int dummy1 : 28;
161} reg_marb_foo_rw_dma4_burst;
162#define REG_RD_ADDR_marb_foo_rw_dma4_burst 548
163#define REG_WR_ADDR_marb_foo_rw_dma4_burst 548
164
165/* Register rw_dma5_burst, scope marb_foo, type rw */
166typedef struct {
167 unsigned int intm_bsize : 2;
168 unsigned int l2_bsize : 2;
169 unsigned int dummy1 : 28;
170} reg_marb_foo_rw_dma5_burst;
171#define REG_RD_ADDR_marb_foo_rw_dma5_burst 552
172#define REG_WR_ADDR_marb_foo_rw_dma5_burst 552
173
174/* Register rw_dma6_burst, scope marb_foo, type rw */
175typedef struct {
176 unsigned int intm_bsize : 2;
177 unsigned int l2_bsize : 2;
178 unsigned int dummy1 : 28;
179} reg_marb_foo_rw_dma6_burst;
180#define REG_RD_ADDR_marb_foo_rw_dma6_burst 556
181#define REG_WR_ADDR_marb_foo_rw_dma6_burst 556
182
183/* Register rw_dma7_burst, scope marb_foo, type rw */
184typedef struct {
185 unsigned int intm_bsize : 2;
186 unsigned int l2_bsize : 2;
187 unsigned int dummy1 : 28;
188} reg_marb_foo_rw_dma7_burst;
189#define REG_RD_ADDR_marb_foo_rw_dma7_burst 560
190#define REG_WR_ADDR_marb_foo_rw_dma7_burst 560
191
192/* Register rw_dma9_burst, scope marb_foo, type rw */
193typedef struct {
194 unsigned int intm_bsize : 2;
195 unsigned int l2_bsize : 2;
196 unsigned int dummy1 : 28;
197} reg_marb_foo_rw_dma9_burst;
198#define REG_RD_ADDR_marb_foo_rw_dma9_burst 564
199#define REG_WR_ADDR_marb_foo_rw_dma9_burst 564
200
201/* Register rw_dma11_burst, scope marb_foo, type rw */
202typedef struct {
203 unsigned int intm_bsize : 2;
204 unsigned int l2_bsize : 2;
205 unsigned int dummy1 : 28;
206} reg_marb_foo_rw_dma11_burst;
207#define REG_RD_ADDR_marb_foo_rw_dma11_burst 568
208#define REG_WR_ADDR_marb_foo_rw_dma11_burst 568
209
210/* Register rw_cpui_burst, scope marb_foo, type rw */
211typedef struct {
212 unsigned int intm_bsize : 2;
213 unsigned int l2_bsize : 2;
214 unsigned int dummy1 : 28;
215} reg_marb_foo_rw_cpui_burst;
216#define REG_RD_ADDR_marb_foo_rw_cpui_burst 572
217#define REG_WR_ADDR_marb_foo_rw_cpui_burst 572
218
219/* Register rw_cpud_burst, scope marb_foo, type rw */
220typedef struct {
221 unsigned int intm_bsize : 2;
222 unsigned int l2_bsize : 2;
223 unsigned int dummy1 : 28;
224} reg_marb_foo_rw_cpud_burst;
225#define REG_RD_ADDR_marb_foo_rw_cpud_burst 576
226#define REG_WR_ADDR_marb_foo_rw_cpud_burst 576
227
228/* Register rw_iop_burst, scope marb_foo, type rw */
229typedef struct {
230 unsigned int intm_bsize : 2;
231 unsigned int l2_bsize : 2;
232 unsigned int dummy1 : 28;
233} reg_marb_foo_rw_iop_burst;
234#define REG_RD_ADDR_marb_foo_rw_iop_burst 580
235#define REG_WR_ADDR_marb_foo_rw_iop_burst 580
236
237/* Register rw_ccdstat_burst, scope marb_foo, type rw */
238typedef struct {
239 unsigned int intm_bsize : 2;
240 unsigned int l2_bsize : 2;
241 unsigned int dummy1 : 28;
242} reg_marb_foo_rw_ccdstat_burst;
243#define REG_RD_ADDR_marb_foo_rw_ccdstat_burst 584
244#define REG_WR_ADDR_marb_foo_rw_ccdstat_burst 584
245
246/* Register rw_intr_mask, scope marb_foo, type rw */
247typedef struct {
248 unsigned int bp0 : 1;
249 unsigned int bp1 : 1;
250 unsigned int bp2 : 1;
251 unsigned int bp3 : 1;
252 unsigned int dummy1 : 28;
253} reg_marb_foo_rw_intr_mask;
254#define REG_RD_ADDR_marb_foo_rw_intr_mask 588
255#define REG_WR_ADDR_marb_foo_rw_intr_mask 588
256
257/* Register rw_ack_intr, scope marb_foo, type rw */
258typedef struct {
259 unsigned int bp0 : 1;
260 unsigned int bp1 : 1;
261 unsigned int bp2 : 1;
262 unsigned int bp3 : 1;
263 unsigned int dummy1 : 28;
264} reg_marb_foo_rw_ack_intr;
265#define REG_RD_ADDR_marb_foo_rw_ack_intr 592
266#define REG_WR_ADDR_marb_foo_rw_ack_intr 592
267
268/* Register r_intr, scope marb_foo, type r */
269typedef struct {
270 unsigned int bp0 : 1;
271 unsigned int bp1 : 1;
272 unsigned int bp2 : 1;
273 unsigned int bp3 : 1;
274 unsigned int dummy1 : 28;
275} reg_marb_foo_r_intr;
276#define REG_RD_ADDR_marb_foo_r_intr 596
277
278/* Register r_masked_intr, scope marb_foo, type r */
279typedef struct {
280 unsigned int bp0 : 1;
281 unsigned int bp1 : 1;
282 unsigned int bp2 : 1;
283 unsigned int bp3 : 1;
284 unsigned int dummy1 : 28;
285} reg_marb_foo_r_masked_intr;
286#define REG_RD_ADDR_marb_foo_r_masked_intr 600
287
288/* Register rw_stop_mask, scope marb_foo, type rw */
289typedef struct {
290 unsigned int sclr : 1;
291 unsigned int dma0 : 1;
292 unsigned int dma1 : 1;
293 unsigned int dma2 : 1;
294 unsigned int dma3 : 1;
295 unsigned int dma4 : 1;
296 unsigned int dma5 : 1;
297 unsigned int dma6 : 1;
298 unsigned int dma7 : 1;
299 unsigned int dma9 : 1;
300 unsigned int dma11 : 1;
301 unsigned int cpui : 1;
302 unsigned int cpud : 1;
303 unsigned int iop : 1;
304 unsigned int ccdstat : 1;
305 unsigned int dummy1 : 17;
306} reg_marb_foo_rw_stop_mask;
307#define REG_RD_ADDR_marb_foo_rw_stop_mask 604
308#define REG_WR_ADDR_marb_foo_rw_stop_mask 604
309
310/* Register r_stopped, scope marb_foo, type r */
311typedef struct {
312 unsigned int sclr : 1;
313 unsigned int dma0 : 1;
314 unsigned int dma1 : 1;
315 unsigned int dma2 : 1;
316 unsigned int dma3 : 1;
317 unsigned int dma4 : 1;
318 unsigned int dma5 : 1;
319 unsigned int dma6 : 1;
320 unsigned int dma7 : 1;
321 unsigned int dma9 : 1;
322 unsigned int dma11 : 1;
323 unsigned int cpui : 1;
324 unsigned int cpud : 1;
325 unsigned int iop : 1;
326 unsigned int ccdstat : 1;
327 unsigned int dummy1 : 17;
328} reg_marb_foo_r_stopped;
329#define REG_RD_ADDR_marb_foo_r_stopped 608
330
331/* Register rw_no_snoop, scope marb_foo, type rw */
332typedef struct {
333 unsigned int sclr : 1;
334 unsigned int dma0 : 1;
335 unsigned int dma1 : 1;
336 unsigned int dma2 : 1;
337 unsigned int dma3 : 1;
338 unsigned int dma4 : 1;
339 unsigned int dma5 : 1;
340 unsigned int dma6 : 1;
341 unsigned int dma7 : 1;
342 unsigned int dma9 : 1;
343 unsigned int dma11 : 1;
344 unsigned int cpui : 1;
345 unsigned int cpud : 1;
346 unsigned int iop : 1;
347 unsigned int ccdstat : 1;
348 unsigned int dummy1 : 17;
349} reg_marb_foo_rw_no_snoop;
350#define REG_RD_ADDR_marb_foo_rw_no_snoop 896
351#define REG_WR_ADDR_marb_foo_rw_no_snoop 896
352
353/* Register rw_no_snoop_rq, scope marb_foo, type rw */
354typedef struct {
355 unsigned int dummy1 : 11;
356 unsigned int cpui : 1;
357 unsigned int cpud : 1;
358 unsigned int dummy2 : 19;
359} reg_marb_foo_rw_no_snoop_rq;
360#define REG_RD_ADDR_marb_foo_rw_no_snoop_rq 900
361#define REG_WR_ADDR_marb_foo_rw_no_snoop_rq 900
362
363
364/* Constants */
365enum {
366 regk_marb_foo_ccdstat = 0x0000000e,
367 regk_marb_foo_cpud = 0x0000000c,
368 regk_marb_foo_cpui = 0x0000000b,
369 regk_marb_foo_dma0 = 0x00000001,
370 regk_marb_foo_dma1 = 0x00000002,
371 regk_marb_foo_dma11 = 0x0000000a,
372 regk_marb_foo_dma2 = 0x00000003,
373 regk_marb_foo_dma3 = 0x00000004,
374 regk_marb_foo_dma4 = 0x00000005,
375 regk_marb_foo_dma5 = 0x00000006,
376 regk_marb_foo_dma6 = 0x00000007,
377 regk_marb_foo_dma7 = 0x00000008,
378 regk_marb_foo_dma9 = 0x00000009,
379 regk_marb_foo_iop = 0x0000000d,
380 regk_marb_foo_no = 0x00000000,
381 regk_marb_foo_r_stopped_default = 0x00000000,
382 regk_marb_foo_rw_ccdstat_burst_default = 0x00000000,
383 regk_marb_foo_rw_cpud_burst_default = 0x00000000,
384 regk_marb_foo_rw_cpui_burst_default = 0x00000000,
385 regk_marb_foo_rw_dma0_burst_default = 0x00000000,
386 regk_marb_foo_rw_dma11_burst_default = 0x00000000,
387 regk_marb_foo_rw_dma1_burst_default = 0x00000000,
388 regk_marb_foo_rw_dma2_burst_default = 0x00000000,
389 regk_marb_foo_rw_dma3_burst_default = 0x00000000,
390 regk_marb_foo_rw_dma4_burst_default = 0x00000000,
391 regk_marb_foo_rw_dma5_burst_default = 0x00000000,
392 regk_marb_foo_rw_dma6_burst_default = 0x00000000,
393 regk_marb_foo_rw_dma7_burst_default = 0x00000000,
394 regk_marb_foo_rw_dma9_burst_default = 0x00000000,
395 regk_marb_foo_rw_intm_slots_default = 0x00000000,
396 regk_marb_foo_rw_intm_slots_size = 0x00000040,
397 regk_marb_foo_rw_intr_mask_default = 0x00000000,
398 regk_marb_foo_rw_iop_burst_default = 0x00000000,
399 regk_marb_foo_rw_l2_slots_default = 0x00000000,
400 regk_marb_foo_rw_l2_slots_size = 0x00000040,
401 regk_marb_foo_rw_no_snoop_default = 0x00000000,
402 regk_marb_foo_rw_no_snoop_rq_default = 0x00000000,
403 regk_marb_foo_rw_regs_slots_default = 0x00000000,
404 regk_marb_foo_rw_regs_slots_size = 0x00000004,
405 regk_marb_foo_rw_sclr_burst_default = 0x00000000,
406 regk_marb_foo_rw_stop_mask_default = 0x00000000,
407 regk_marb_foo_sclr = 0x00000000,
408 regk_marb_foo_yes = 0x00000001
409};
410#endif /* __marb_foo_defs_h */
411#ifndef __marb_foo_bp_defs_h
412#define __marb_foo_bp_defs_h
413
414/*
415 * This file is autogenerated from
416 * file: marb_foo.r
417 *
418 * by ../../../tools/rdesc/bin/rdes2c -outfile marb_foo_defs.h marb_foo.r
419 * Any changes here will be lost.
420 *
421 * -*- buffer-read-only: t -*-
422 */
423/* Main access macros */
424#ifndef REG_RD
425#define REG_RD( scope, inst, reg ) \
426 REG_READ( reg_##scope##_##reg, \
427 (inst) + REG_RD_ADDR_##scope##_##reg )
428#endif
429
430#ifndef REG_WR
431#define REG_WR( scope, inst, reg, val ) \
432 REG_WRITE( reg_##scope##_##reg, \
433 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
434#endif
435
436#ifndef REG_RD_VECT
437#define REG_RD_VECT( scope, inst, reg, index ) \
438 REG_READ( reg_##scope##_##reg, \
439 (inst) + REG_RD_ADDR_##scope##_##reg + \
440 (index) * STRIDE_##scope##_##reg )
441#endif
442
443#ifndef REG_WR_VECT
444#define REG_WR_VECT( scope, inst, reg, index, val ) \
445 REG_WRITE( reg_##scope##_##reg, \
446 (inst) + REG_WR_ADDR_##scope##_##reg + \
447 (index) * STRIDE_##scope##_##reg, (val) )
448#endif
449
450#ifndef REG_RD_INT
451#define REG_RD_INT( scope, inst, reg ) \
452 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
453#endif
454
455#ifndef REG_WR_INT
456#define REG_WR_INT( scope, inst, reg, val ) \
457 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
458#endif
459
460#ifndef REG_RD_INT_VECT
461#define REG_RD_INT_VECT( scope, inst, reg, index ) \
462 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
463 (index) * STRIDE_##scope##_##reg )
464#endif
465
466#ifndef REG_WR_INT_VECT
467#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
468 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
469 (index) * STRIDE_##scope##_##reg, (val) )
470#endif
471
472#ifndef REG_TYPE_CONV
473#define REG_TYPE_CONV( type, orgtype, val ) \
474 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
475#endif
476
477#ifndef reg_page_size
478#define reg_page_size 8192
479#endif
480
481#ifndef REG_ADDR
482#define REG_ADDR( scope, inst, reg ) \
483 ( (inst) + REG_RD_ADDR_##scope##_##reg )
484#endif
485
486#ifndef REG_ADDR_VECT
487#define REG_ADDR_VECT( scope, inst, reg, index ) \
488 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
489 (index) * STRIDE_##scope##_##reg )
490#endif
491
492/* C-code for register scope marb_foo_bp */
493
494/* Register rw_first_addr, scope marb_foo_bp, type rw */
495typedef unsigned int reg_marb_foo_bp_rw_first_addr;
496#define REG_RD_ADDR_marb_foo_bp_rw_first_addr 0
497#define REG_WR_ADDR_marb_foo_bp_rw_first_addr 0
498
499/* Register rw_last_addr, scope marb_foo_bp, type rw */
500typedef unsigned int reg_marb_foo_bp_rw_last_addr;
501#define REG_RD_ADDR_marb_foo_bp_rw_last_addr 4
502#define REG_WR_ADDR_marb_foo_bp_rw_last_addr 4
503
504/* Register rw_op, scope marb_foo_bp, type rw */
505typedef struct {
506 unsigned int rd : 1;
507 unsigned int wr : 1;
508 unsigned int rd_excl : 1;
509 unsigned int pri_wr : 1;
510 unsigned int us_rd : 1;
511 unsigned int us_wr : 1;
512 unsigned int us_rd_excl : 1;
513 unsigned int us_pri_wr : 1;
514 unsigned int dummy1 : 24;
515} reg_marb_foo_bp_rw_op;
516#define REG_RD_ADDR_marb_foo_bp_rw_op 8
517#define REG_WR_ADDR_marb_foo_bp_rw_op 8
518
519/* Register rw_clients, scope marb_foo_bp, type rw */
520typedef struct {
521 unsigned int sclr : 1;
522 unsigned int dma0 : 1;
523 unsigned int dma1 : 1;
524 unsigned int dma2 : 1;
525 unsigned int dma3 : 1;
526 unsigned int dma4 : 1;
527 unsigned int dma5 : 1;
528 unsigned int dma6 : 1;
529 unsigned int dma7 : 1;
530 unsigned int dma9 : 1;
531 unsigned int dma11 : 1;
532 unsigned int cpui : 1;
533 unsigned int cpud : 1;
534 unsigned int iop : 1;
535 unsigned int ccdstat : 1;
536 unsigned int dummy1 : 17;
537} reg_marb_foo_bp_rw_clients;
538#define REG_RD_ADDR_marb_foo_bp_rw_clients 12
539#define REG_WR_ADDR_marb_foo_bp_rw_clients 12
540
541/* Register rw_options, scope marb_foo_bp, type rw */
542typedef struct {
543 unsigned int wrap : 1;
544 unsigned int dummy1 : 31;
545} reg_marb_foo_bp_rw_options;
546#define REG_RD_ADDR_marb_foo_bp_rw_options 16
547#define REG_WR_ADDR_marb_foo_bp_rw_options 16
548
549/* Register r_brk_addr, scope marb_foo_bp, type r */
550typedef unsigned int reg_marb_foo_bp_r_brk_addr;
551#define REG_RD_ADDR_marb_foo_bp_r_brk_addr 20
552
553/* Register r_brk_op, scope marb_foo_bp, type r */
554typedef struct {
555 unsigned int rd : 1;
556 unsigned int wr : 1;
557 unsigned int rd_excl : 1;
558 unsigned int pri_wr : 1;
559 unsigned int us_rd : 1;
560 unsigned int us_wr : 1;
561 unsigned int us_rd_excl : 1;
562 unsigned int us_pri_wr : 1;
563 unsigned int dummy1 : 24;
564} reg_marb_foo_bp_r_brk_op;
565#define REG_RD_ADDR_marb_foo_bp_r_brk_op 24
566
567/* Register r_brk_clients, scope marb_foo_bp, type r */
568typedef struct {
569 unsigned int sclr : 1;
570 unsigned int dma0 : 1;
571 unsigned int dma1 : 1;
572 unsigned int dma2 : 1;
573 unsigned int dma3 : 1;
574 unsigned int dma4 : 1;
575 unsigned int dma5 : 1;
576 unsigned int dma6 : 1;
577 unsigned int dma7 : 1;
578 unsigned int dma9 : 1;
579 unsigned int dma11 : 1;
580 unsigned int cpui : 1;
581 unsigned int cpud : 1;
582 unsigned int iop : 1;
583 unsigned int ccdstat : 1;
584 unsigned int dummy1 : 17;
585} reg_marb_foo_bp_r_brk_clients;
586#define REG_RD_ADDR_marb_foo_bp_r_brk_clients 28
587
588/* Register r_brk_first_client, scope marb_foo_bp, type r */
589typedef struct {
590 unsigned int sclr : 1;
591 unsigned int dma0 : 1;
592 unsigned int dma1 : 1;
593 unsigned int dma2 : 1;
594 unsigned int dma3 : 1;
595 unsigned int dma4 : 1;
596 unsigned int dma5 : 1;
597 unsigned int dma6 : 1;
598 unsigned int dma7 : 1;
599 unsigned int dma9 : 1;
600 unsigned int dma11 : 1;
601 unsigned int cpui : 1;
602 unsigned int cpud : 1;
603 unsigned int iop : 1;
604 unsigned int ccdstat : 1;
605 unsigned int dummy1 : 17;
606} reg_marb_foo_bp_r_brk_first_client;
607#define REG_RD_ADDR_marb_foo_bp_r_brk_first_client 32
608
609/* Register r_brk_size, scope marb_foo_bp, type r */
610typedef unsigned int reg_marb_foo_bp_r_brk_size;
611#define REG_RD_ADDR_marb_foo_bp_r_brk_size 36
612
613/* Register rw_ack, scope marb_foo_bp, type rw */
614typedef unsigned int reg_marb_foo_bp_rw_ack;
615#define REG_RD_ADDR_marb_foo_bp_rw_ack 40
616#define REG_WR_ADDR_marb_foo_bp_rw_ack 40
617
618
619/* Constants */
620enum {
621 regk_marb_foo_bp_no = 0x00000000,
622 regk_marb_foo_bp_rw_op_default = 0x00000000,
623 regk_marb_foo_bp_rw_options_default = 0x00000000,
624 regk_marb_foo_bp_yes = 0x00000001
625};
626#endif /* __marb_foo_bp_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/pinmux_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/pinmux_defs.h
new file mode 100644
index 000000000000..4b96cd2cba8a
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/pinmux_defs.h
@@ -0,0 +1,312 @@
1#ifndef __pinmux_defs_h
2#define __pinmux_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: pinmux.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile pinmux_defs.h pinmux.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope pinmux */
83
84/* Register rw_hwprot, scope pinmux, type rw */
85typedef struct {
86 unsigned int eth : 1;
87 unsigned int eth_mdio : 1;
88 unsigned int geth : 1;
89 unsigned int tg : 1;
90 unsigned int tg_clk : 1;
91 unsigned int vout : 1;
92 unsigned int vout_sync : 1;
93 unsigned int ser1 : 1;
94 unsigned int ser2 : 1;
95 unsigned int ser3 : 1;
96 unsigned int ser4 : 1;
97 unsigned int sser : 1;
98 unsigned int pwm0 : 1;
99 unsigned int pwm1 : 1;
100 unsigned int pwm2 : 1;
101 unsigned int timer0 : 1;
102 unsigned int timer1 : 1;
103 unsigned int pio : 1;
104 unsigned int i2c0 : 1;
105 unsigned int i2c1 : 1;
106 unsigned int i2c1_sda1 : 1;
107 unsigned int i2c1_sda2 : 1;
108 unsigned int i2c1_sda3 : 1;
109 unsigned int i2c1_sen : 1;
110 unsigned int dummy1 : 8;
111} reg_pinmux_rw_hwprot;
112#define REG_RD_ADDR_pinmux_rw_hwprot 0
113#define REG_WR_ADDR_pinmux_rw_hwprot 0
114
115/* Register rw_gio_pa, scope pinmux, type rw */
116typedef struct {
117 unsigned int pa0 : 1;
118 unsigned int pa1 : 1;
119 unsigned int pa2 : 1;
120 unsigned int pa3 : 1;
121 unsigned int pa4 : 1;
122 unsigned int pa5 : 1;
123 unsigned int pa6 : 1;
124 unsigned int pa7 : 1;
125 unsigned int pa8 : 1;
126 unsigned int pa9 : 1;
127 unsigned int pa10 : 1;
128 unsigned int pa11 : 1;
129 unsigned int pa12 : 1;
130 unsigned int pa13 : 1;
131 unsigned int pa14 : 1;
132 unsigned int pa15 : 1;
133 unsigned int pa16 : 1;
134 unsigned int pa17 : 1;
135 unsigned int pa18 : 1;
136 unsigned int pa19 : 1;
137 unsigned int pa20 : 1;
138 unsigned int pa21 : 1;
139 unsigned int pa22 : 1;
140 unsigned int pa23 : 1;
141 unsigned int pa24 : 1;
142 unsigned int pa25 : 1;
143 unsigned int pa26 : 1;
144 unsigned int pa27 : 1;
145 unsigned int pa28 : 1;
146 unsigned int pa29 : 1;
147 unsigned int pa30 : 1;
148 unsigned int pa31 : 1;
149} reg_pinmux_rw_gio_pa;
150#define REG_RD_ADDR_pinmux_rw_gio_pa 4
151#define REG_WR_ADDR_pinmux_rw_gio_pa 4
152
153/* Register rw_gio_pb, scope pinmux, type rw */
154typedef struct {
155 unsigned int pb0 : 1;
156 unsigned int pb1 : 1;
157 unsigned int pb2 : 1;
158 unsigned int pb3 : 1;
159 unsigned int pb4 : 1;
160 unsigned int pb5 : 1;
161 unsigned int pb6 : 1;
162 unsigned int pb7 : 1;
163 unsigned int pb8 : 1;
164 unsigned int pb9 : 1;
165 unsigned int pb10 : 1;
166 unsigned int pb11 : 1;
167 unsigned int pb12 : 1;
168 unsigned int pb13 : 1;
169 unsigned int pb14 : 1;
170 unsigned int pb15 : 1;
171 unsigned int pb16 : 1;
172 unsigned int pb17 : 1;
173 unsigned int pb18 : 1;
174 unsigned int pb19 : 1;
175 unsigned int pb20 : 1;
176 unsigned int pb21 : 1;
177 unsigned int pb22 : 1;
178 unsigned int pb23 : 1;
179 unsigned int pb24 : 1;
180 unsigned int pb25 : 1;
181 unsigned int pb26 : 1;
182 unsigned int pb27 : 1;
183 unsigned int pb28 : 1;
184 unsigned int pb29 : 1;
185 unsigned int pb30 : 1;
186 unsigned int pb31 : 1;
187} reg_pinmux_rw_gio_pb;
188#define REG_RD_ADDR_pinmux_rw_gio_pb 8
189#define REG_WR_ADDR_pinmux_rw_gio_pb 8
190
191/* Register rw_gio_pc, scope pinmux, type rw */
192typedef struct {
193 unsigned int pc0 : 1;
194 unsigned int pc1 : 1;
195 unsigned int pc2 : 1;
196 unsigned int pc3 : 1;
197 unsigned int pc4 : 1;
198 unsigned int pc5 : 1;
199 unsigned int pc6 : 1;
200 unsigned int pc7 : 1;
201 unsigned int pc8 : 1;
202 unsigned int pc9 : 1;
203 unsigned int pc10 : 1;
204 unsigned int pc11 : 1;
205 unsigned int pc12 : 1;
206 unsigned int pc13 : 1;
207 unsigned int pc14 : 1;
208 unsigned int pc15 : 1;
209 unsigned int dummy1 : 16;
210} reg_pinmux_rw_gio_pc;
211#define REG_RD_ADDR_pinmux_rw_gio_pc 12
212#define REG_WR_ADDR_pinmux_rw_gio_pc 12
213
214/* Register rw_iop_pa, scope pinmux, type rw */
215typedef struct {
216 unsigned int pa0 : 1;
217 unsigned int pa1 : 1;
218 unsigned int pa2 : 1;
219 unsigned int pa3 : 1;
220 unsigned int pa4 : 1;
221 unsigned int pa5 : 1;
222 unsigned int pa6 : 1;
223 unsigned int pa7 : 1;
224 unsigned int pa8 : 1;
225 unsigned int pa9 : 1;
226 unsigned int pa10 : 1;
227 unsigned int pa11 : 1;
228 unsigned int pa12 : 1;
229 unsigned int pa13 : 1;
230 unsigned int pa14 : 1;
231 unsigned int pa15 : 1;
232 unsigned int pa16 : 1;
233 unsigned int pa17 : 1;
234 unsigned int pa18 : 1;
235 unsigned int pa19 : 1;
236 unsigned int pa20 : 1;
237 unsigned int pa21 : 1;
238 unsigned int pa22 : 1;
239 unsigned int pa23 : 1;
240 unsigned int pa24 : 1;
241 unsigned int pa25 : 1;
242 unsigned int pa26 : 1;
243 unsigned int pa27 : 1;
244 unsigned int pa28 : 1;
245 unsigned int pa29 : 1;
246 unsigned int pa30 : 1;
247 unsigned int pa31 : 1;
248} reg_pinmux_rw_iop_pa;
249#define REG_RD_ADDR_pinmux_rw_iop_pa 16
250#define REG_WR_ADDR_pinmux_rw_iop_pa 16
251
252/* Register rw_iop_pb, scope pinmux, type rw */
253typedef struct {
254 unsigned int pb0 : 1;
255 unsigned int pb1 : 1;
256 unsigned int pb2 : 1;
257 unsigned int pb3 : 1;
258 unsigned int pb4 : 1;
259 unsigned int pb5 : 1;
260 unsigned int pb6 : 1;
261 unsigned int pb7 : 1;
262 unsigned int dummy1 : 24;
263} reg_pinmux_rw_iop_pb;
264#define REG_RD_ADDR_pinmux_rw_iop_pb 20
265#define REG_WR_ADDR_pinmux_rw_iop_pb 20
266
267/* Register rw_iop_pio, scope pinmux, type rw */
268typedef struct {
269 unsigned int d0 : 1;
270 unsigned int d1 : 1;
271 unsigned int d2 : 1;
272 unsigned int d3 : 1;
273 unsigned int d4 : 1;
274 unsigned int d5 : 1;
275 unsigned int d6 : 1;
276 unsigned int d7 : 1;
277 unsigned int rd_n : 1;
278 unsigned int wr_n : 1;
279 unsigned int a0 : 1;
280 unsigned int a1 : 1;
281 unsigned int ce0_n : 1;
282 unsigned int ce1_n : 1;
283 unsigned int ce2_n : 1;
284 unsigned int rdy : 1;
285 unsigned int dummy1 : 16;
286} reg_pinmux_rw_iop_pio;
287#define REG_RD_ADDR_pinmux_rw_iop_pio 24
288#define REG_WR_ADDR_pinmux_rw_iop_pio 24
289
290/* Register rw_iop_usb, scope pinmux, type rw */
291typedef struct {
292 unsigned int usb0 : 1;
293 unsigned int dummy1 : 31;
294} reg_pinmux_rw_iop_usb;
295#define REG_RD_ADDR_pinmux_rw_iop_usb 28
296#define REG_WR_ADDR_pinmux_rw_iop_usb 28
297
298
299/* Constants */
300enum {
301 regk_pinmux_no = 0x00000000,
302 regk_pinmux_rw_gio_pa_default = 0x00000000,
303 regk_pinmux_rw_gio_pb_default = 0x00000000,
304 regk_pinmux_rw_gio_pc_default = 0x00000000,
305 regk_pinmux_rw_hwprot_default = 0x00000000,
306 regk_pinmux_rw_iop_pa_default = 0x00000000,
307 regk_pinmux_rw_iop_pb_default = 0x00000000,
308 regk_pinmux_rw_iop_pio_default = 0x00000000,
309 regk_pinmux_rw_iop_usb_default = 0x00000001,
310 regk_pinmux_yes = 0x00000001
311};
312#endif /* __pinmux_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/pio_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/pio_defs.h
new file mode 100644
index 000000000000..2d8e4b4cc602
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/pio_defs.h
@@ -0,0 +1,371 @@
1#ifndef __pio_defs_h
2#define __pio_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: pio.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile pio_defs.h pio.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope pio */
83
84/* Register rw_data, scope pio, type rw */
85typedef unsigned int reg_pio_rw_data;
86#define REG_RD_ADDR_pio_rw_data 64
87#define REG_WR_ADDR_pio_rw_data 64
88
89/* Register rw_io_access0, scope pio, type rw */
90typedef struct {
91 unsigned int data : 8;
92 unsigned int dummy1 : 24;
93} reg_pio_rw_io_access0;
94#define REG_RD_ADDR_pio_rw_io_access0 0
95#define REG_WR_ADDR_pio_rw_io_access0 0
96
97/* Register rw_io_access1, scope pio, type rw */
98typedef struct {
99 unsigned int data : 8;
100 unsigned int dummy1 : 24;
101} reg_pio_rw_io_access1;
102#define REG_RD_ADDR_pio_rw_io_access1 4
103#define REG_WR_ADDR_pio_rw_io_access1 4
104
105/* Register rw_io_access2, scope pio, type rw */
106typedef struct {
107 unsigned int data : 8;
108 unsigned int dummy1 : 24;
109} reg_pio_rw_io_access2;
110#define REG_RD_ADDR_pio_rw_io_access2 8
111#define REG_WR_ADDR_pio_rw_io_access2 8
112
113/* Register rw_io_access3, scope pio, type rw */
114typedef struct {
115 unsigned int data : 8;
116 unsigned int dummy1 : 24;
117} reg_pio_rw_io_access3;
118#define REG_RD_ADDR_pio_rw_io_access3 12
119#define REG_WR_ADDR_pio_rw_io_access3 12
120
121/* Register rw_io_access4, scope pio, type rw */
122typedef struct {
123 unsigned int data : 8;
124 unsigned int dummy1 : 24;
125} reg_pio_rw_io_access4;
126#define REG_RD_ADDR_pio_rw_io_access4 16
127#define REG_WR_ADDR_pio_rw_io_access4 16
128
129/* Register rw_io_access5, scope pio, type rw */
130typedef struct {
131 unsigned int data : 8;
132 unsigned int dummy1 : 24;
133} reg_pio_rw_io_access5;
134#define REG_RD_ADDR_pio_rw_io_access5 20
135#define REG_WR_ADDR_pio_rw_io_access5 20
136
137/* Register rw_io_access6, scope pio, type rw */
138typedef struct {
139 unsigned int data : 8;
140 unsigned int dummy1 : 24;
141} reg_pio_rw_io_access6;
142#define REG_RD_ADDR_pio_rw_io_access6 24
143#define REG_WR_ADDR_pio_rw_io_access6 24
144
145/* Register rw_io_access7, scope pio, type rw */
146typedef struct {
147 unsigned int data : 8;
148 unsigned int dummy1 : 24;
149} reg_pio_rw_io_access7;
150#define REG_RD_ADDR_pio_rw_io_access7 28
151#define REG_WR_ADDR_pio_rw_io_access7 28
152
153/* Register rw_io_access8, scope pio, type rw */
154typedef struct {
155 unsigned int data : 8;
156 unsigned int dummy1 : 24;
157} reg_pio_rw_io_access8;
158#define REG_RD_ADDR_pio_rw_io_access8 32
159#define REG_WR_ADDR_pio_rw_io_access8 32
160
161/* Register rw_io_access9, scope pio, type rw */
162typedef struct {
163 unsigned int data : 8;
164 unsigned int dummy1 : 24;
165} reg_pio_rw_io_access9;
166#define REG_RD_ADDR_pio_rw_io_access9 36
167#define REG_WR_ADDR_pio_rw_io_access9 36
168
169/* Register rw_io_access10, scope pio, type rw */
170typedef struct {
171 unsigned int data : 8;
172 unsigned int dummy1 : 24;
173} reg_pio_rw_io_access10;
174#define REG_RD_ADDR_pio_rw_io_access10 40
175#define REG_WR_ADDR_pio_rw_io_access10 40
176
177/* Register rw_io_access11, scope pio, type rw */
178typedef struct {
179 unsigned int data : 8;
180 unsigned int dummy1 : 24;
181} reg_pio_rw_io_access11;
182#define REG_RD_ADDR_pio_rw_io_access11 44
183#define REG_WR_ADDR_pio_rw_io_access11 44
184
185/* Register rw_io_access12, scope pio, type rw */
186typedef struct {
187 unsigned int data : 8;
188 unsigned int dummy1 : 24;
189} reg_pio_rw_io_access12;
190#define REG_RD_ADDR_pio_rw_io_access12 48
191#define REG_WR_ADDR_pio_rw_io_access12 48
192
193/* Register rw_io_access13, scope pio, type rw */
194typedef struct {
195 unsigned int data : 8;
196 unsigned int dummy1 : 24;
197} reg_pio_rw_io_access13;
198#define REG_RD_ADDR_pio_rw_io_access13 52
199#define REG_WR_ADDR_pio_rw_io_access13 52
200
201/* Register rw_io_access14, scope pio, type rw */
202typedef struct {
203 unsigned int data : 8;
204 unsigned int dummy1 : 24;
205} reg_pio_rw_io_access14;
206#define REG_RD_ADDR_pio_rw_io_access14 56
207#define REG_WR_ADDR_pio_rw_io_access14 56
208
209/* Register rw_io_access15, scope pio, type rw */
210typedef struct {
211 unsigned int data : 8;
212 unsigned int dummy1 : 24;
213} reg_pio_rw_io_access15;
214#define REG_RD_ADDR_pio_rw_io_access15 60
215#define REG_WR_ADDR_pio_rw_io_access15 60
216
217/* Register rw_ce0_cfg, scope pio, type rw */
218typedef struct {
219 unsigned int lw : 6;
220 unsigned int ew : 3;
221 unsigned int zw : 3;
222 unsigned int aw : 2;
223 unsigned int mode : 2;
224 unsigned int dummy1 : 16;
225} reg_pio_rw_ce0_cfg;
226#define REG_RD_ADDR_pio_rw_ce0_cfg 68
227#define REG_WR_ADDR_pio_rw_ce0_cfg 68
228
229/* Register rw_ce1_cfg, scope pio, type rw */
230typedef struct {
231 unsigned int lw : 6;
232 unsigned int ew : 3;
233 unsigned int zw : 3;
234 unsigned int aw : 2;
235 unsigned int mode : 2;
236 unsigned int dummy1 : 16;
237} reg_pio_rw_ce1_cfg;
238#define REG_RD_ADDR_pio_rw_ce1_cfg 72
239#define REG_WR_ADDR_pio_rw_ce1_cfg 72
240
241/* Register rw_ce2_cfg, scope pio, type rw */
242typedef struct {
243 unsigned int lw : 6;
244 unsigned int ew : 3;
245 unsigned int zw : 3;
246 unsigned int aw : 2;
247 unsigned int mode : 2;
248 unsigned int dummy1 : 16;
249} reg_pio_rw_ce2_cfg;
250#define REG_RD_ADDR_pio_rw_ce2_cfg 76
251#define REG_WR_ADDR_pio_rw_ce2_cfg 76
252
253/* Register rw_dout, scope pio, type rw */
254typedef struct {
255 unsigned int data : 8;
256 unsigned int rd_n : 1;
257 unsigned int wr_n : 1;
258 unsigned int a0 : 1;
259 unsigned int a1 : 1;
260 unsigned int ce0_n : 1;
261 unsigned int ce1_n : 1;
262 unsigned int ce2_n : 1;
263 unsigned int rdy : 1;
264 unsigned int dummy1 : 16;
265} reg_pio_rw_dout;
266#define REG_RD_ADDR_pio_rw_dout 80
267#define REG_WR_ADDR_pio_rw_dout 80
268
269/* Register rw_oe, scope pio, type rw */
270typedef struct {
271 unsigned int data : 8;
272 unsigned int rd_n : 1;
273 unsigned int wr_n : 1;
274 unsigned int a0 : 1;
275 unsigned int a1 : 1;
276 unsigned int ce0_n : 1;
277 unsigned int ce1_n : 1;
278 unsigned int ce2_n : 1;
279 unsigned int rdy : 1;
280 unsigned int dummy1 : 16;
281} reg_pio_rw_oe;
282#define REG_RD_ADDR_pio_rw_oe 84
283#define REG_WR_ADDR_pio_rw_oe 84
284
285/* Register rw_man_ctrl, scope pio, type rw */
286typedef struct {
287 unsigned int data : 8;
288 unsigned int rd_n : 1;
289 unsigned int wr_n : 1;
290 unsigned int a0 : 1;
291 unsigned int a1 : 1;
292 unsigned int ce0_n : 1;
293 unsigned int ce1_n : 1;
294 unsigned int ce2_n : 1;
295 unsigned int rdy : 1;
296 unsigned int dummy1 : 16;
297} reg_pio_rw_man_ctrl;
298#define REG_RD_ADDR_pio_rw_man_ctrl 88
299#define REG_WR_ADDR_pio_rw_man_ctrl 88
300
301/* Register r_din, scope pio, type r */
302typedef struct {
303 unsigned int data : 8;
304 unsigned int rd_n : 1;
305 unsigned int wr_n : 1;
306 unsigned int a0 : 1;
307 unsigned int a1 : 1;
308 unsigned int ce0_n : 1;
309 unsigned int ce1_n : 1;
310 unsigned int ce2_n : 1;
311 unsigned int rdy : 1;
312 unsigned int dummy1 : 16;
313} reg_pio_r_din;
314#define REG_RD_ADDR_pio_r_din 92
315
316/* Register r_stat, scope pio, type r */
317typedef struct {
318 unsigned int busy : 1;
319 unsigned int dummy1 : 31;
320} reg_pio_r_stat;
321#define REG_RD_ADDR_pio_r_stat 96
322
323/* Register rw_intr_mask, scope pio, type rw */
324typedef struct {
325 unsigned int rdy : 1;
326 unsigned int dummy1 : 31;
327} reg_pio_rw_intr_mask;
328#define REG_RD_ADDR_pio_rw_intr_mask 100
329#define REG_WR_ADDR_pio_rw_intr_mask 100
330
331/* Register rw_ack_intr, scope pio, type rw */
332typedef struct {
333 unsigned int rdy : 1;
334 unsigned int dummy1 : 31;
335} reg_pio_rw_ack_intr;
336#define REG_RD_ADDR_pio_rw_ack_intr 104
337#define REG_WR_ADDR_pio_rw_ack_intr 104
338
339/* Register r_intr, scope pio, type r */
340typedef struct {
341 unsigned int rdy : 1;
342 unsigned int dummy1 : 31;
343} reg_pio_r_intr;
344#define REG_RD_ADDR_pio_r_intr 108
345
346/* Register r_masked_intr, scope pio, type r */
347typedef struct {
348 unsigned int rdy : 1;
349 unsigned int dummy1 : 31;
350} reg_pio_r_masked_intr;
351#define REG_RD_ADDR_pio_r_masked_intr 112
352
353
354/* Constants */
355enum {
356 regk_pio_a2 = 0x00000003,
357 regk_pio_no = 0x00000000,
358 regk_pio_normal = 0x00000000,
359 regk_pio_rd = 0x00000001,
360 regk_pio_rw_ce0_cfg_default = 0x00000000,
361 regk_pio_rw_ce1_cfg_default = 0x00000000,
362 regk_pio_rw_ce2_cfg_default = 0x00000000,
363 regk_pio_rw_intr_mask_default = 0x00000000,
364 regk_pio_rw_man_ctrl_default = 0x00000000,
365 regk_pio_rw_oe_default = 0x00000000,
366 regk_pio_wr = 0x00000002,
367 regk_pio_wr_ce2 = 0x00000003,
368 regk_pio_yes = 0x00000001,
369 regk_pio_yes_all = 0x000000ff
370};
371#endif /* __pio_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/reg_map.h b/include/asm-cris/arch-v32/mach-a3/hwregs/reg_map.h
new file mode 100644
index 000000000000..36e59d6e96b6
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/reg_map.h
@@ -0,0 +1,103 @@
1#ifndef __reg_map_h
2#define __reg_map_h
3
4/*
5 * This file is autogenerated from
6 * file: reg.rmap
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -base 0xb0000000 -map marb_bar.r marb_foo.r ccd_top.r ccd_stat.r ccd_tg.r ccd_dp.r ccd.r iop_sap_in.r iop_sap_out.r iop_sw_cfg.r iop_sw_cpu.r iop_sw_mpu.r iop_sw_spu.r iop_version.r iop_crc_par.r iop_dmc_in.r iop_dmc_out.r iop_fifo_in_extra.r iop_fifo_in.r iop_fifo_out_extra.r iop_fifo_out.r iop_mc.r iop_mpu.r iop_scrc_in.r iop_scrc_out.r iop_spu.r iop_timer_grp.r iop_trigger_grp.r iop.r -outfile reg_map.h reg.rmap
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13typedef enum {
14 regi_ccd = 0xb0000000,
15 regi_ccd_top = 0xb0000000,
16 regi_ccd_dp = 0xb0000400,
17 regi_ccd_stat = 0xb0000800,
18 regi_ccd_tg = 0xb0001000,
19 regi_cfg = 0xb0002000,
20 regi_clkgen = 0xb0004000,
21 regi_ddr2_ctrl = 0xb0006000,
22 regi_dma0 = 0xb0008000,
23 regi_dma1 = 0xb000a000,
24 regi_dma11 = 0xb000c000,
25 regi_dma2 = 0xb000e000,
26 regi_dma3 = 0xb0010000,
27 regi_dma4 = 0xb0012000,
28 regi_dma5 = 0xb0014000,
29 regi_dma6 = 0xb0016000,
30 regi_dma7 = 0xb0018000,
31 regi_dma9 = 0xb001a000,
32 regi_eth = 0xb001c000,
33 regi_gio = 0xb0020000,
34 regi_h264 = 0xb0022000,
35 regi_hist = 0xb0026000,
36 regi_iop = 0xb0028000,
37 regi_iop_version = 0xb0028000,
38 regi_iop_fifo_in_extra = 0xb0028040,
39 regi_iop_fifo_out_extra = 0xb0028080,
40 regi_iop_trigger_grp0 = 0xb00280c0,
41 regi_iop_trigger_grp1 = 0xb0028100,
42 regi_iop_trigger_grp2 = 0xb0028140,
43 regi_iop_trigger_grp3 = 0xb0028180,
44 regi_iop_trigger_grp4 = 0xb00281c0,
45 regi_iop_trigger_grp5 = 0xb0028200,
46 regi_iop_trigger_grp6 = 0xb0028240,
47 regi_iop_trigger_grp7 = 0xb0028280,
48 regi_iop_crc_par = 0xb0028300,
49 regi_iop_dmc_in = 0xb0028380,
50 regi_iop_dmc_out = 0xb0028400,
51 regi_iop_fifo_in = 0xb0028480,
52 regi_iop_fifo_out = 0xb0028500,
53 regi_iop_scrc_in = 0xb0028580,
54 regi_iop_scrc_out = 0xb0028600,
55 regi_iop_timer_grp0 = 0xb0028680,
56 regi_iop_timer_grp1 = 0xb0028700,
57 regi_iop_sap_in = 0xb0028800,
58 regi_iop_sap_out = 0xb0028900,
59 regi_iop_spu = 0xb0028a00,
60 regi_iop_sw_cfg = 0xb0028b00,
61 regi_iop_sw_cpu = 0xb0028c00,
62 regi_iop_sw_mpu = 0xb0028d00,
63 regi_iop_sw_spu = 0xb0028e00,
64 regi_iop_mpu = 0xb0029000,
65 regi_irq = 0xb002a000,
66 regi_irq2 = 0xb006a000,
67 regi_jpeg = 0xb002c000,
68 regi_l2cache = 0xb0030000,
69 regi_marb_bar = 0xb0032000,
70 regi_marb_bar_bp0 = 0xb0032140,
71 regi_marb_bar_bp1 = 0xb0032180,
72 regi_marb_bar_bp2 = 0xb00321c0,
73 regi_marb_bar_bp3 = 0xb0032200,
74 regi_marb_foo = 0xb0034000,
75 regi_marb_foo_bp0 = 0xb0034280,
76 regi_marb_foo_bp1 = 0xb00342c0,
77 regi_marb_foo_bp2 = 0xb0034300,
78 regi_marb_foo_bp3 = 0xb0034340,
79 regi_pinmux = 0xb0038000,
80 regi_pio = 0xb0036000,
81 regi_sclr = 0xb003a000,
82 regi_sclr_fifo = 0xb003c000,
83 regi_ser0 = 0xb003e000,
84 regi_ser1 = 0xb0040000,
85 regi_ser2 = 0xb0042000,
86 regi_ser3 = 0xb0044000,
87 regi_ser4 = 0xb0046000,
88 regi_sser = 0xb0048000,
89 regi_strcop = 0xb004a000,
90 regi_strdma0 = 0xb004e000,
91 regi_strdma1 = 0xb0050000,
92 regi_strdma2 = 0xb0052000,
93 regi_strdma3 = 0xb0054000,
94 regi_strdma5 = 0xb0056000,
95 regi_strmux = 0xb004c000,
96 regi_timer0 = 0xb0058000,
97 regi_timer1 = 0xb005a000,
98 regi_timer2 = 0xb006e000,
99 regi_trace = 0xb005c000,
100 regi_vin = 0xb005e000,
101 regi_vout = 0xb0060000
102} reg_scope_instances;
103#endif /* __reg_map_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/strmux_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/strmux_defs.h
new file mode 100644
index 000000000000..14f718a4ecc3
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/strmux_defs.h
@@ -0,0 +1,120 @@
1#ifndef __strmux_defs_h
2#define __strmux_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: strmux.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile strmux_defs.h strmux.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope strmux */
83
84/* Register rw_cfg, scope strmux, type rw */
85typedef struct {
86 unsigned int dma0 : 2;
87 unsigned int dma1 : 2;
88 unsigned int dma2 : 2;
89 unsigned int dma3 : 2;
90 unsigned int dma4 : 2;
91 unsigned int dma5 : 2;
92 unsigned int dma6 : 2;
93 unsigned int dma7 : 2;
94 unsigned int dummy1 : 2;
95 unsigned int dma9 : 2;
96 unsigned int dummy2 : 2;
97 unsigned int dma11 : 2;
98 unsigned int dummy3 : 8;
99} reg_strmux_rw_cfg;
100#define REG_RD_ADDR_strmux_rw_cfg 0
101#define REG_WR_ADDR_strmux_rw_cfg 0
102
103
104/* Constants */
105enum {
106 regk_strmux_eth = 0x00000001,
107 regk_strmux_h264 = 0x00000001,
108 regk_strmux_iop = 0x00000001,
109 regk_strmux_jpeg = 0x00000001,
110 regk_strmux_off = 0x00000000,
111 regk_strmux_rw_cfg_default = 0x00000000,
112 regk_strmux_ser0 = 0x00000002,
113 regk_strmux_ser1 = 0x00000002,
114 regk_strmux_ser2 = 0x00000002,
115 regk_strmux_ser3 = 0x00000002,
116 regk_strmux_ser4 = 0x00000002,
117 regk_strmux_sser = 0x00000001,
118 regk_strmux_strcop = 0x00000001
119};
120#endif /* __strmux_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/hwregs/timer_defs.h b/include/asm-cris/arch-v32/mach-a3/hwregs/timer_defs.h
new file mode 100644
index 000000000000..2c33e097d60a
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/hwregs/timer_defs.h
@@ -0,0 +1,265 @@
1#ifndef __timer_defs_h
2#define __timer_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: timer.r
7 *
8 * by ../../../tools/rdesc/bin/rdes2c -outfile timer_defs.h timer.r
9 * Any changes here will be lost.
10 *
11 * -*- buffer-read-only: t -*-
12 */
13/* Main access macros */
14#ifndef REG_RD
15#define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
18#endif
19
20#ifndef REG_WR
21#define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
24#endif
25
26#ifndef REG_RD_VECT
27#define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
31#endif
32
33#ifndef REG_WR_VECT
34#define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
38#endif
39
40#ifndef REG_RD_INT
41#define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
43#endif
44
45#ifndef REG_WR_INT
46#define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
48#endif
49
50#ifndef REG_RD_INT_VECT
51#define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
54#endif
55
56#ifndef REG_WR_INT_VECT
57#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
60#endif
61
62#ifndef REG_TYPE_CONV
63#define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
65#endif
66
67#ifndef reg_page_size
68#define reg_page_size 8192
69#endif
70
71#ifndef REG_ADDR
72#define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
74#endif
75
76#ifndef REG_ADDR_VECT
77#define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
80#endif
81
82/* C-code for register scope timer */
83
84/* Register rw_tmr0_div, scope timer, type rw */
85typedef unsigned int reg_timer_rw_tmr0_div;
86#define REG_RD_ADDR_timer_rw_tmr0_div 0
87#define REG_WR_ADDR_timer_rw_tmr0_div 0
88
89/* Register r_tmr0_data, scope timer, type r */
90typedef unsigned int reg_timer_r_tmr0_data;
91#define REG_RD_ADDR_timer_r_tmr0_data 4
92
93/* Register rw_tmr0_ctrl, scope timer, type rw */
94typedef struct {
95 unsigned int op : 2;
96 unsigned int freq : 3;
97 unsigned int dummy1 : 27;
98} reg_timer_rw_tmr0_ctrl;
99#define REG_RD_ADDR_timer_rw_tmr0_ctrl 8
100#define REG_WR_ADDR_timer_rw_tmr0_ctrl 8
101
102/* Register rw_tmr1_div, scope timer, type rw */
103typedef unsigned int reg_timer_rw_tmr1_div;
104#define REG_RD_ADDR_timer_rw_tmr1_div 16
105#define REG_WR_ADDR_timer_rw_tmr1_div 16
106
107/* Register r_tmr1_data, scope timer, type r */
108typedef unsigned int reg_timer_r_tmr1_data;
109#define REG_RD_ADDR_timer_r_tmr1_data 20
110
111/* Register rw_tmr1_ctrl, scope timer, type rw */
112typedef struct {
113 unsigned int op : 2;
114 unsigned int freq : 3;
115 unsigned int dummy1 : 27;
116} reg_timer_rw_tmr1_ctrl;
117#define REG_RD_ADDR_timer_rw_tmr1_ctrl 24
118#define REG_WR_ADDR_timer_rw_tmr1_ctrl 24
119
120/* Register rs_cnt_data, scope timer, type rs */
121typedef struct {
122 unsigned int tmr : 24;
123 unsigned int cnt : 8;
124} reg_timer_rs_cnt_data;
125#define REG_RD_ADDR_timer_rs_cnt_data 32
126
127/* Register r_cnt_data, scope timer, type r */
128typedef struct {
129 unsigned int tmr : 24;
130 unsigned int cnt : 8;
131} reg_timer_r_cnt_data;
132#define REG_RD_ADDR_timer_r_cnt_data 36
133
134/* Register rw_cnt_cfg, scope timer, type rw */
135typedef struct {
136 unsigned int clk : 2;
137 unsigned int dummy1 : 30;
138} reg_timer_rw_cnt_cfg;
139#define REG_RD_ADDR_timer_rw_cnt_cfg 40
140#define REG_WR_ADDR_timer_rw_cnt_cfg 40
141
142/* Register rw_trig, scope timer, type rw */
143typedef unsigned int reg_timer_rw_trig;
144#define REG_RD_ADDR_timer_rw_trig 48
145#define REG_WR_ADDR_timer_rw_trig 48
146
147/* Register rw_trig_cfg, scope timer, type rw */
148typedef struct {
149 unsigned int tmr : 2;
150 unsigned int dummy1 : 30;
151} reg_timer_rw_trig_cfg;
152#define REG_RD_ADDR_timer_rw_trig_cfg 52
153#define REG_WR_ADDR_timer_rw_trig_cfg 52
154
155/* Register r_time, scope timer, type r */
156typedef unsigned int reg_timer_r_time;
157#define REG_RD_ADDR_timer_r_time 56
158
159/* Register rw_out, scope timer, type rw */
160typedef struct {
161 unsigned int tmr : 2;
162 unsigned int dummy1 : 30;
163} reg_timer_rw_out;
164#define REG_RD_ADDR_timer_rw_out 60
165#define REG_WR_ADDR_timer_rw_out 60
166
167/* Register rw_wd_ctrl, scope timer, type rw */
168typedef struct {
169 unsigned int cnt : 8;
170 unsigned int cmd : 1;
171 unsigned int key : 7;
172 unsigned int dummy1 : 16;
173} reg_timer_rw_wd_ctrl;
174#define REG_RD_ADDR_timer_rw_wd_ctrl 64
175#define REG_WR_ADDR_timer_rw_wd_ctrl 64
176
177/* Register r_wd_stat, scope timer, type r */
178typedef struct {
179 unsigned int cnt : 8;
180 unsigned int cmd : 1;
181 unsigned int dummy1 : 23;
182} reg_timer_r_wd_stat;
183#define REG_RD_ADDR_timer_r_wd_stat 68
184
185/* Register rw_intr_mask, scope timer, type rw */
186typedef struct {
187 unsigned int tmr0 : 1;
188 unsigned int tmr1 : 1;
189 unsigned int cnt : 1;
190 unsigned int trig : 1;
191 unsigned int dummy1 : 28;
192} reg_timer_rw_intr_mask;
193#define REG_RD_ADDR_timer_rw_intr_mask 72
194#define REG_WR_ADDR_timer_rw_intr_mask 72
195
196/* Register rw_ack_intr, scope timer, type rw */
197typedef struct {
198 unsigned int tmr0 : 1;
199 unsigned int tmr1 : 1;
200 unsigned int cnt : 1;
201 unsigned int trig : 1;
202 unsigned int dummy1 : 28;
203} reg_timer_rw_ack_intr;
204#define REG_RD_ADDR_timer_rw_ack_intr 76
205#define REG_WR_ADDR_timer_rw_ack_intr 76
206
207/* Register r_intr, scope timer, type r */
208typedef struct {
209 unsigned int tmr0 : 1;
210 unsigned int tmr1 : 1;
211 unsigned int cnt : 1;
212 unsigned int trig : 1;
213 unsigned int dummy1 : 28;
214} reg_timer_r_intr;
215#define REG_RD_ADDR_timer_r_intr 80
216
217/* Register r_masked_intr, scope timer, type r */
218typedef struct {
219 unsigned int tmr0 : 1;
220 unsigned int tmr1 : 1;
221 unsigned int cnt : 1;
222 unsigned int trig : 1;
223 unsigned int dummy1 : 28;
224} reg_timer_r_masked_intr;
225#define REG_RD_ADDR_timer_r_masked_intr 84
226
227/* Register rw_test, scope timer, type rw */
228typedef struct {
229 unsigned int dis : 1;
230 unsigned int en : 1;
231 unsigned int dummy1 : 30;
232} reg_timer_rw_test;
233#define REG_RD_ADDR_timer_rw_test 88
234#define REG_WR_ADDR_timer_rw_test 88
235
236
237/* Constants */
238enum {
239 regk_timer_ext = 0x00000001,
240 regk_timer_f100 = 0x00000007,
241 regk_timer_f29_493 = 0x00000004,
242 regk_timer_f32 = 0x00000005,
243 regk_timer_f32_768 = 0x00000006,
244 regk_timer_f90 = 0x00000003,
245 regk_timer_hold = 0x00000001,
246 regk_timer_ld = 0x00000000,
247 regk_timer_no = 0x00000000,
248 regk_timer_off = 0x00000000,
249 regk_timer_run = 0x00000002,
250 regk_timer_rw_cnt_cfg_default = 0x00000000,
251 regk_timer_rw_intr_mask_default = 0x00000000,
252 regk_timer_rw_out_default = 0x00000000,
253 regk_timer_rw_test_default = 0x00000000,
254 regk_timer_rw_tmr0_ctrl_default = 0x00000000,
255 regk_timer_rw_tmr1_ctrl_default = 0x00000000,
256 regk_timer_rw_trig_cfg_default = 0x00000000,
257 regk_timer_start = 0x00000001,
258 regk_timer_stop = 0x00000000,
259 regk_timer_time = 0x00000001,
260 regk_timer_tmr0 = 0x00000002,
261 regk_timer_tmr1 = 0x00000003,
262 regk_timer_vclk = 0x00000002,
263 regk_timer_yes = 0x00000001
264};
265#endif /* __timer_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-a3/memmap.h b/include/asm-cris/arch-v32/mach-a3/memmap.h
new file mode 100644
index 000000000000..7e15c9eb4e49
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/memmap.h
@@ -0,0 +1,10 @@
1#ifndef _ASM_ARCH_MEMMAP_H
2#define _ASM_ARCH_MEMMAP_H
3
4#define MEM_INTMEM_START (0x38000000)
5#define MEM_INTMEM_SIZE (0x00018000)
6#define MEM_DRAM_START (0x40000000)
7
8#define MEM_NON_CACHEABLE (0x80000000)
9
10#endif
diff --git a/include/asm-cris/arch-v32/mach-a3/pinmux.h b/include/asm-cris/arch-v32/mach-a3/pinmux.h
new file mode 100644
index 000000000000..db42a7254584
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/pinmux.h
@@ -0,0 +1,45 @@
1#ifndef _ASM_CRIS_ARCH_PINMUX_H
2#define _ASM_CRIS_ARCH_PINMUX_H
3
4#define PORT_A 0
5#define PORT_B 1
6#define PORT_C 2
7
8enum pin_mode {
9 pinmux_none = 0,
10 pinmux_fixed,
11 pinmux_gpio,
12 pinmux_iop
13};
14
15enum fixed_function {
16 pinmux_eth,
17 pinmux_geth,
18 pinmux_tg_ccd,
19 pinmux_tg_cmos,
20 pinmux_vout,
21 pinmux_ser1,
22 pinmux_ser2,
23 pinmux_ser3,
24 pinmux_ser4,
25 pinmux_sser,
26 pinmux_pio,
27 pinmux_pwm0,
28 pinmux_pwm1,
29 pinmux_pwm2,
30 pinmux_i2c0,
31 pinmux_i2c1,
32 pinmux_i2c1_3wire,
33 pinmux_i2c1_sda1,
34 pinmux_i2c1_sda2,
35 pinmux_i2c1_sda3,
36};
37
38int crisv32_pinmux_init(void);
39int crisv32_pinmux_alloc(int port, int first_pin, int last_pin, enum pin_mode);
40int crisv32_pinmux_alloc_fixed(enum fixed_function function);
41int crisv32_pinmux_dealloc(int port, int first_pin, int last_pin);
42int crisv32_pinmux_dealloc_fixed(enum fixed_function function);
43void crisv32_pinmux_dump(void);
44
45#endif
diff --git a/include/asm-cris/arch-v32/mach-a3/startup.inc b/include/asm-cris/arch-v32/mach-a3/startup.inc
new file mode 100644
index 000000000000..2f23e5e16f4a
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-a3/startup.inc
@@ -0,0 +1,60 @@
1#include <hwregs/asm/reg_map_asm.h>
2#include <hwregs/asm/gio_defs_asm.h>
3#include <hwregs/asm/pio_defs_asm.h>
4#include <hwregs/asm/clkgen_defs_asm.h>
5#include <hwregs/asm/pinmux_defs_asm.h>
6
7 .macro GIO_INIT
8 move.d CONFIG_ETRAX_DEF_GIO_PA_OUT, $r0
9 move.d REG_ADDR(gio, regi_gio, rw_pa_dout), $r1
10 move.d $r0, [$r1]
11
12 move.d CONFIG_ETRAX_DEF_GIO_PA_OE, $r0
13 move.d REG_ADDR(gio, regi_gio, rw_pa_oe), $r1
14 move.d $r0, [$r1]
15
16 move.d CONFIG_ETRAX_DEF_GIO_PB_OUT, $r0
17 move.d REG_ADDR(gio, regi_gio, rw_pb_dout), $r1
18 move.d $r0, [$r1]
19
20 move.d CONFIG_ETRAX_DEF_GIO_PB_OE, $r0
21 move.d REG_ADDR(gio, regi_gio, rw_pb_oe), $r1
22 move.d $r0, [$r1]
23
24 move.d CONFIG_ETRAX_DEF_GIO_PC_OUT, $r0
25 move.d REG_ADDR(gio, regi_gio, rw_pc_dout), $r1
26 move.d $r0, [$r1]
27
28 move.d CONFIG_ETRAX_DEF_GIO_PC_OE, $r0
29 move.d REG_ADDR(gio, regi_gio, rw_pc_oe), $r1
30 move.d $r0, [$r1]
31
32 move.d 0xFFFFFFFF, $r0
33 move.d REG_ADDR(pinmux, regi_pinmux, rw_gio_pa), $r1
34 move.d $r0, [$r1]
35 move.d REG_ADDR(pinmux, regi_pinmux, rw_gio_pb), $r1
36 move.d $r0, [$r1]
37 move.d REG_ADDR(pinmux, regi_pinmux, rw_gio_pc), $r1
38 move.d $r0, [$r1]
39 .endm
40
41 .macro START_CLOCKS
42 move.d REG_ADDR(clkgen, regi_clkgen, rw_clk_ctrl), $r1
43 move.d [$r1], $r0
44 or.d REG_STATE(clkgen, rw_clk_ctrl, cpu, yes) | \
45 REG_STATE(clkgen, rw_clk_ctrl, ddr2, yes) | \
46 REG_STATE(clkgen, rw_clk_ctrl, memarb_bar_ddr, yes), $r0
47 move.d $r0, [$r1]
48 .endm
49
50 .macro SETUP_WAIT_STATES
51 move.d REG_ADDR(pio, regi_pio, rw_ce0_cfg), $r0
52 move.d CONFIG_ETRAX_PIO_CE0_CFG, $r1
53 move.d $r1, [$r0]
54 move.d REG_ADDR(pio, regi_pio, rw_ce1_cfg), $r0
55 move.d CONFIG_ETRAX_PIO_CE1_CFG, $r1
56 move.d $r1, [$r0]
57 move.d REG_ADDR(pio, regi_pio, rw_ce2_cfg), $r0
58 move.d CONFIG_ETRAX_PIO_CE2_CFG, $r1
59 move.d $r1, [$r0]
60 .endm
diff --git a/include/asm-cris/arch-v32/mach-fs/arbiter.h b/include/asm-cris/arch-v32/mach-fs/arbiter.h
new file mode 100644
index 000000000000..a2e0ec8faa7d
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/arbiter.h
@@ -0,0 +1,28 @@
1#ifndef _ASM_CRIS_ARCH_ARBITER_H
2#define _ASM_CRIS_ARCH_ARBITER_H
3
4#define EXT_REGION 0
5#define INT_REGION 1
6
7typedef void (watch_callback)(void);
8
9enum {
10 arbiter_all_dmas = 0x3ff,
11 arbiter_cpu = 0xc00,
12 arbiter_all_clients = 0x3fff
13};
14
15enum {
16 arbiter_all_read = 0x55,
17 arbiter_all_write = 0xaa,
18 arbiter_all_accesses = 0xff
19};
20
21int crisv32_arbiter_allocate_bandwidth(int client, int region,
22 unsigned long bandwidth);
23int crisv32_arbiter_watch(unsigned long start, unsigned long size,
24 unsigned long clients, unsigned long accesses,
25 watch_callback * cb);
26int crisv32_arbiter_unwatch(int id);
27
28#endif
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/asm/bif_core_defs_asm.h b/include/asm-cris/arch-v32/mach-fs/hwregs/asm/bif_core_defs_asm.h
new file mode 100644
index 000000000000..0a409c92837e
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/asm/bif_core_defs_asm.h
@@ -0,0 +1,319 @@
1#ifndef __bif_core_defs_asm_h
2#define __bif_core_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/bif/rtl/bif_core_regs.r
7 * id: bif_core_regs.r,v 1.17 2005/02/04 13:28:22 np Exp
8 * last modfied: Mon Apr 11 16:06:33 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/bif_core_defs_asm.h ../../inst/bif/rtl/bif_core_regs.r
11 * id: $Id: bif_core_defs_asm.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_grp1_cfg, scope bif_core, type rw */
57#define reg_bif_core_rw_grp1_cfg___lw___lsb 0
58#define reg_bif_core_rw_grp1_cfg___lw___width 6
59#define reg_bif_core_rw_grp1_cfg___ew___lsb 6
60#define reg_bif_core_rw_grp1_cfg___ew___width 3
61#define reg_bif_core_rw_grp1_cfg___zw___lsb 9
62#define reg_bif_core_rw_grp1_cfg___zw___width 3
63#define reg_bif_core_rw_grp1_cfg___aw___lsb 12
64#define reg_bif_core_rw_grp1_cfg___aw___width 2
65#define reg_bif_core_rw_grp1_cfg___dw___lsb 14
66#define reg_bif_core_rw_grp1_cfg___dw___width 2
67#define reg_bif_core_rw_grp1_cfg___ewb___lsb 16
68#define reg_bif_core_rw_grp1_cfg___ewb___width 2
69#define reg_bif_core_rw_grp1_cfg___bw___lsb 18
70#define reg_bif_core_rw_grp1_cfg___bw___width 1
71#define reg_bif_core_rw_grp1_cfg___bw___bit 18
72#define reg_bif_core_rw_grp1_cfg___wr_extend___lsb 19
73#define reg_bif_core_rw_grp1_cfg___wr_extend___width 1
74#define reg_bif_core_rw_grp1_cfg___wr_extend___bit 19
75#define reg_bif_core_rw_grp1_cfg___erc_en___lsb 20
76#define reg_bif_core_rw_grp1_cfg___erc_en___width 1
77#define reg_bif_core_rw_grp1_cfg___erc_en___bit 20
78#define reg_bif_core_rw_grp1_cfg___mode___lsb 21
79#define reg_bif_core_rw_grp1_cfg___mode___width 1
80#define reg_bif_core_rw_grp1_cfg___mode___bit 21
81#define reg_bif_core_rw_grp1_cfg_offset 0
82
83/* Register rw_grp2_cfg, scope bif_core, type rw */
84#define reg_bif_core_rw_grp2_cfg___lw___lsb 0
85#define reg_bif_core_rw_grp2_cfg___lw___width 6
86#define reg_bif_core_rw_grp2_cfg___ew___lsb 6
87#define reg_bif_core_rw_grp2_cfg___ew___width 3
88#define reg_bif_core_rw_grp2_cfg___zw___lsb 9
89#define reg_bif_core_rw_grp2_cfg___zw___width 3
90#define reg_bif_core_rw_grp2_cfg___aw___lsb 12
91#define reg_bif_core_rw_grp2_cfg___aw___width 2
92#define reg_bif_core_rw_grp2_cfg___dw___lsb 14
93#define reg_bif_core_rw_grp2_cfg___dw___width 2
94#define reg_bif_core_rw_grp2_cfg___ewb___lsb 16
95#define reg_bif_core_rw_grp2_cfg___ewb___width 2
96#define reg_bif_core_rw_grp2_cfg___bw___lsb 18
97#define reg_bif_core_rw_grp2_cfg___bw___width 1
98#define reg_bif_core_rw_grp2_cfg___bw___bit 18
99#define reg_bif_core_rw_grp2_cfg___wr_extend___lsb 19
100#define reg_bif_core_rw_grp2_cfg___wr_extend___width 1
101#define reg_bif_core_rw_grp2_cfg___wr_extend___bit 19
102#define reg_bif_core_rw_grp2_cfg___erc_en___lsb 20
103#define reg_bif_core_rw_grp2_cfg___erc_en___width 1
104#define reg_bif_core_rw_grp2_cfg___erc_en___bit 20
105#define reg_bif_core_rw_grp2_cfg___mode___lsb 21
106#define reg_bif_core_rw_grp2_cfg___mode___width 1
107#define reg_bif_core_rw_grp2_cfg___mode___bit 21
108#define reg_bif_core_rw_grp2_cfg_offset 4
109
110/* Register rw_grp3_cfg, scope bif_core, type rw */
111#define reg_bif_core_rw_grp3_cfg___lw___lsb 0
112#define reg_bif_core_rw_grp3_cfg___lw___width 6
113#define reg_bif_core_rw_grp3_cfg___ew___lsb 6
114#define reg_bif_core_rw_grp3_cfg___ew___width 3
115#define reg_bif_core_rw_grp3_cfg___zw___lsb 9
116#define reg_bif_core_rw_grp3_cfg___zw___width 3
117#define reg_bif_core_rw_grp3_cfg___aw___lsb 12
118#define reg_bif_core_rw_grp3_cfg___aw___width 2
119#define reg_bif_core_rw_grp3_cfg___dw___lsb 14
120#define reg_bif_core_rw_grp3_cfg___dw___width 2
121#define reg_bif_core_rw_grp3_cfg___ewb___lsb 16
122#define reg_bif_core_rw_grp3_cfg___ewb___width 2
123#define reg_bif_core_rw_grp3_cfg___bw___lsb 18
124#define reg_bif_core_rw_grp3_cfg___bw___width 1
125#define reg_bif_core_rw_grp3_cfg___bw___bit 18
126#define reg_bif_core_rw_grp3_cfg___wr_extend___lsb 19
127#define reg_bif_core_rw_grp3_cfg___wr_extend___width 1
128#define reg_bif_core_rw_grp3_cfg___wr_extend___bit 19
129#define reg_bif_core_rw_grp3_cfg___erc_en___lsb 20
130#define reg_bif_core_rw_grp3_cfg___erc_en___width 1
131#define reg_bif_core_rw_grp3_cfg___erc_en___bit 20
132#define reg_bif_core_rw_grp3_cfg___mode___lsb 21
133#define reg_bif_core_rw_grp3_cfg___mode___width 1
134#define reg_bif_core_rw_grp3_cfg___mode___bit 21
135#define reg_bif_core_rw_grp3_cfg___gated_csp0___lsb 24
136#define reg_bif_core_rw_grp3_cfg___gated_csp0___width 2
137#define reg_bif_core_rw_grp3_cfg___gated_csp1___lsb 26
138#define reg_bif_core_rw_grp3_cfg___gated_csp1___width 2
139#define reg_bif_core_rw_grp3_cfg___gated_csp2___lsb 28
140#define reg_bif_core_rw_grp3_cfg___gated_csp2___width 2
141#define reg_bif_core_rw_grp3_cfg___gated_csp3___lsb 30
142#define reg_bif_core_rw_grp3_cfg___gated_csp3___width 2
143#define reg_bif_core_rw_grp3_cfg_offset 8
144
145/* Register rw_grp4_cfg, scope bif_core, type rw */
146#define reg_bif_core_rw_grp4_cfg___lw___lsb 0
147#define reg_bif_core_rw_grp4_cfg___lw___width 6
148#define reg_bif_core_rw_grp4_cfg___ew___lsb 6
149#define reg_bif_core_rw_grp4_cfg___ew___width 3
150#define reg_bif_core_rw_grp4_cfg___zw___lsb 9
151#define reg_bif_core_rw_grp4_cfg___zw___width 3
152#define reg_bif_core_rw_grp4_cfg___aw___lsb 12
153#define reg_bif_core_rw_grp4_cfg___aw___width 2
154#define reg_bif_core_rw_grp4_cfg___dw___lsb 14
155#define reg_bif_core_rw_grp4_cfg___dw___width 2
156#define reg_bif_core_rw_grp4_cfg___ewb___lsb 16
157#define reg_bif_core_rw_grp4_cfg___ewb___width 2
158#define reg_bif_core_rw_grp4_cfg___bw___lsb 18
159#define reg_bif_core_rw_grp4_cfg___bw___width 1
160#define reg_bif_core_rw_grp4_cfg___bw___bit 18
161#define reg_bif_core_rw_grp4_cfg___wr_extend___lsb 19
162#define reg_bif_core_rw_grp4_cfg___wr_extend___width 1
163#define reg_bif_core_rw_grp4_cfg___wr_extend___bit 19
164#define reg_bif_core_rw_grp4_cfg___erc_en___lsb 20
165#define reg_bif_core_rw_grp4_cfg___erc_en___width 1
166#define reg_bif_core_rw_grp4_cfg___erc_en___bit 20
167#define reg_bif_core_rw_grp4_cfg___mode___lsb 21
168#define reg_bif_core_rw_grp4_cfg___mode___width 1
169#define reg_bif_core_rw_grp4_cfg___mode___bit 21
170#define reg_bif_core_rw_grp4_cfg___gated_csp4___lsb 26
171#define reg_bif_core_rw_grp4_cfg___gated_csp4___width 2
172#define reg_bif_core_rw_grp4_cfg___gated_csp5___lsb 28
173#define reg_bif_core_rw_grp4_cfg___gated_csp5___width 2
174#define reg_bif_core_rw_grp4_cfg___gated_csp6___lsb 30
175#define reg_bif_core_rw_grp4_cfg___gated_csp6___width 2
176#define reg_bif_core_rw_grp4_cfg_offset 12
177
178/* Register rw_sdram_cfg_grp0, scope bif_core, type rw */
179#define reg_bif_core_rw_sdram_cfg_grp0___bank_sel___lsb 0
180#define reg_bif_core_rw_sdram_cfg_grp0___bank_sel___width 5
181#define reg_bif_core_rw_sdram_cfg_grp0___ca___lsb 5
182#define reg_bif_core_rw_sdram_cfg_grp0___ca___width 3
183#define reg_bif_core_rw_sdram_cfg_grp0___type___lsb 8
184#define reg_bif_core_rw_sdram_cfg_grp0___type___width 1
185#define reg_bif_core_rw_sdram_cfg_grp0___type___bit 8
186#define reg_bif_core_rw_sdram_cfg_grp0___bw___lsb 9
187#define reg_bif_core_rw_sdram_cfg_grp0___bw___width 1
188#define reg_bif_core_rw_sdram_cfg_grp0___bw___bit 9
189#define reg_bif_core_rw_sdram_cfg_grp0___sh___lsb 10
190#define reg_bif_core_rw_sdram_cfg_grp0___sh___width 3
191#define reg_bif_core_rw_sdram_cfg_grp0___wmm___lsb 13
192#define reg_bif_core_rw_sdram_cfg_grp0___wmm___width 1
193#define reg_bif_core_rw_sdram_cfg_grp0___wmm___bit 13
194#define reg_bif_core_rw_sdram_cfg_grp0___sh16___lsb 14
195#define reg_bif_core_rw_sdram_cfg_grp0___sh16___width 1
196#define reg_bif_core_rw_sdram_cfg_grp0___sh16___bit 14
197#define reg_bif_core_rw_sdram_cfg_grp0___grp_sel___lsb 15
198#define reg_bif_core_rw_sdram_cfg_grp0___grp_sel___width 5
199#define reg_bif_core_rw_sdram_cfg_grp0_offset 16
200
201/* Register rw_sdram_cfg_grp1, scope bif_core, type rw */
202#define reg_bif_core_rw_sdram_cfg_grp1___bank_sel___lsb 0
203#define reg_bif_core_rw_sdram_cfg_grp1___bank_sel___width 5
204#define reg_bif_core_rw_sdram_cfg_grp1___ca___lsb 5
205#define reg_bif_core_rw_sdram_cfg_grp1___ca___width 3
206#define reg_bif_core_rw_sdram_cfg_grp1___type___lsb 8
207#define reg_bif_core_rw_sdram_cfg_grp1___type___width 1
208#define reg_bif_core_rw_sdram_cfg_grp1___type___bit 8
209#define reg_bif_core_rw_sdram_cfg_grp1___bw___lsb 9
210#define reg_bif_core_rw_sdram_cfg_grp1___bw___width 1
211#define reg_bif_core_rw_sdram_cfg_grp1___bw___bit 9
212#define reg_bif_core_rw_sdram_cfg_grp1___sh___lsb 10
213#define reg_bif_core_rw_sdram_cfg_grp1___sh___width 3
214#define reg_bif_core_rw_sdram_cfg_grp1___wmm___lsb 13
215#define reg_bif_core_rw_sdram_cfg_grp1___wmm___width 1
216#define reg_bif_core_rw_sdram_cfg_grp1___wmm___bit 13
217#define reg_bif_core_rw_sdram_cfg_grp1___sh16___lsb 14
218#define reg_bif_core_rw_sdram_cfg_grp1___sh16___width 1
219#define reg_bif_core_rw_sdram_cfg_grp1___sh16___bit 14
220#define reg_bif_core_rw_sdram_cfg_grp1_offset 20
221
222/* Register rw_sdram_timing, scope bif_core, type rw */
223#define reg_bif_core_rw_sdram_timing___cl___lsb 0
224#define reg_bif_core_rw_sdram_timing___cl___width 3
225#define reg_bif_core_rw_sdram_timing___rcd___lsb 3
226#define reg_bif_core_rw_sdram_timing___rcd___width 3
227#define reg_bif_core_rw_sdram_timing___rp___lsb 6
228#define reg_bif_core_rw_sdram_timing___rp___width 3
229#define reg_bif_core_rw_sdram_timing___rc___lsb 9
230#define reg_bif_core_rw_sdram_timing___rc___width 2
231#define reg_bif_core_rw_sdram_timing___dpl___lsb 11
232#define reg_bif_core_rw_sdram_timing___dpl___width 2
233#define reg_bif_core_rw_sdram_timing___pde___lsb 13
234#define reg_bif_core_rw_sdram_timing___pde___width 1
235#define reg_bif_core_rw_sdram_timing___pde___bit 13
236#define reg_bif_core_rw_sdram_timing___ref___lsb 14
237#define reg_bif_core_rw_sdram_timing___ref___width 2
238#define reg_bif_core_rw_sdram_timing___cpd___lsb 16
239#define reg_bif_core_rw_sdram_timing___cpd___width 1
240#define reg_bif_core_rw_sdram_timing___cpd___bit 16
241#define reg_bif_core_rw_sdram_timing___sdcke___lsb 17
242#define reg_bif_core_rw_sdram_timing___sdcke___width 1
243#define reg_bif_core_rw_sdram_timing___sdcke___bit 17
244#define reg_bif_core_rw_sdram_timing___sdclk___lsb 18
245#define reg_bif_core_rw_sdram_timing___sdclk___width 1
246#define reg_bif_core_rw_sdram_timing___sdclk___bit 18
247#define reg_bif_core_rw_sdram_timing_offset 24
248
249/* Register rw_sdram_cmd, scope bif_core, type rw */
250#define reg_bif_core_rw_sdram_cmd___cmd___lsb 0
251#define reg_bif_core_rw_sdram_cmd___cmd___width 3
252#define reg_bif_core_rw_sdram_cmd___mrs_data___lsb 3
253#define reg_bif_core_rw_sdram_cmd___mrs_data___width 15
254#define reg_bif_core_rw_sdram_cmd_offset 28
255
256/* Register rs_sdram_ref_stat, scope bif_core, type rs */
257#define reg_bif_core_rs_sdram_ref_stat___ok___lsb 0
258#define reg_bif_core_rs_sdram_ref_stat___ok___width 1
259#define reg_bif_core_rs_sdram_ref_stat___ok___bit 0
260#define reg_bif_core_rs_sdram_ref_stat_offset 32
261
262/* Register r_sdram_ref_stat, scope bif_core, type r */
263#define reg_bif_core_r_sdram_ref_stat___ok___lsb 0
264#define reg_bif_core_r_sdram_ref_stat___ok___width 1
265#define reg_bif_core_r_sdram_ref_stat___ok___bit 0
266#define reg_bif_core_r_sdram_ref_stat_offset 36
267
268
269/* Constants */
270#define regk_bif_core_bank2 0x00000000
271#define regk_bif_core_bank4 0x00000001
272#define regk_bif_core_bit10 0x0000000a
273#define regk_bif_core_bit11 0x0000000b
274#define regk_bif_core_bit12 0x0000000c
275#define regk_bif_core_bit13 0x0000000d
276#define regk_bif_core_bit14 0x0000000e
277#define regk_bif_core_bit15 0x0000000f
278#define regk_bif_core_bit16 0x00000010
279#define regk_bif_core_bit17 0x00000011
280#define regk_bif_core_bit18 0x00000012
281#define regk_bif_core_bit19 0x00000013
282#define regk_bif_core_bit20 0x00000014
283#define regk_bif_core_bit21 0x00000015
284#define regk_bif_core_bit22 0x00000016
285#define regk_bif_core_bit23 0x00000017
286#define regk_bif_core_bit24 0x00000018
287#define regk_bif_core_bit25 0x00000019
288#define regk_bif_core_bit26 0x0000001a
289#define regk_bif_core_bit27 0x0000001b
290#define regk_bif_core_bit28 0x0000001c
291#define regk_bif_core_bit29 0x0000001d
292#define regk_bif_core_bit9 0x00000009
293#define regk_bif_core_bw16 0x00000001
294#define regk_bif_core_bw32 0x00000000
295#define regk_bif_core_bwe 0x00000000
296#define regk_bif_core_cwe 0x00000001
297#define regk_bif_core_e15us 0x00000001
298#define regk_bif_core_e7800ns 0x00000002
299#define regk_bif_core_grp0 0x00000000
300#define regk_bif_core_grp1 0x00000001
301#define regk_bif_core_mrs 0x00000003
302#define regk_bif_core_no 0x00000000
303#define regk_bif_core_none 0x00000000
304#define regk_bif_core_nop 0x00000000
305#define regk_bif_core_off 0x00000000
306#define regk_bif_core_pre 0x00000002
307#define regk_bif_core_r_sdram_ref_stat_default 0x00000001
308#define regk_bif_core_rd 0x00000002
309#define regk_bif_core_ref 0x00000001
310#define regk_bif_core_rs_sdram_ref_stat_default 0x00000001
311#define regk_bif_core_rw_grp1_cfg_default 0x000006cf
312#define regk_bif_core_rw_grp2_cfg_default 0x000006cf
313#define regk_bif_core_rw_grp3_cfg_default 0x000006cf
314#define regk_bif_core_rw_grp4_cfg_default 0x000006cf
315#define regk_bif_core_rw_sdram_cfg_grp1_default 0x00000000
316#define regk_bif_core_slf 0x00000004
317#define regk_bif_core_wr 0x00000001
318#define regk_bif_core_yes 0x00000001
319#endif /* __bif_core_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/asm/config_defs_asm.h b/include/asm-cris/arch-v32/mach-fs/hwregs/asm/config_defs_asm.h
new file mode 100644
index 000000000000..a9908dfc2937
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/asm/config_defs_asm.h
@@ -0,0 +1,131 @@
1#ifndef __config_defs_asm_h
2#define __config_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../rtl/config_regs.r
7 * id: config_regs.r,v 1.23 2004/03/04 11:34:42 mikaeln Exp
8 * last modfied: Thu Mar 4 12:34:39 2004
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/config_defs_asm.h ../../rtl/config_regs.r
11 * id: $Id: config_defs_asm.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register r_bootsel, scope config, type r */
57#define reg_config_r_bootsel___boot_mode___lsb 0
58#define reg_config_r_bootsel___boot_mode___width 3
59#define reg_config_r_bootsel___full_duplex___lsb 3
60#define reg_config_r_bootsel___full_duplex___width 1
61#define reg_config_r_bootsel___full_duplex___bit 3
62#define reg_config_r_bootsel___user___lsb 4
63#define reg_config_r_bootsel___user___width 1
64#define reg_config_r_bootsel___user___bit 4
65#define reg_config_r_bootsel___pll___lsb 5
66#define reg_config_r_bootsel___pll___width 1
67#define reg_config_r_bootsel___pll___bit 5
68#define reg_config_r_bootsel___flash_bw___lsb 6
69#define reg_config_r_bootsel___flash_bw___width 1
70#define reg_config_r_bootsel___flash_bw___bit 6
71#define reg_config_r_bootsel_offset 0
72
73/* Register rw_clk_ctrl, scope config, type rw */
74#define reg_config_rw_clk_ctrl___pll___lsb 0
75#define reg_config_rw_clk_ctrl___pll___width 1
76#define reg_config_rw_clk_ctrl___pll___bit 0
77#define reg_config_rw_clk_ctrl___cpu___lsb 1
78#define reg_config_rw_clk_ctrl___cpu___width 1
79#define reg_config_rw_clk_ctrl___cpu___bit 1
80#define reg_config_rw_clk_ctrl___iop___lsb 2
81#define reg_config_rw_clk_ctrl___iop___width 1
82#define reg_config_rw_clk_ctrl___iop___bit 2
83#define reg_config_rw_clk_ctrl___dma01_eth0___lsb 3
84#define reg_config_rw_clk_ctrl___dma01_eth0___width 1
85#define reg_config_rw_clk_ctrl___dma01_eth0___bit 3
86#define reg_config_rw_clk_ctrl___dma23___lsb 4
87#define reg_config_rw_clk_ctrl___dma23___width 1
88#define reg_config_rw_clk_ctrl___dma23___bit 4
89#define reg_config_rw_clk_ctrl___dma45___lsb 5
90#define reg_config_rw_clk_ctrl___dma45___width 1
91#define reg_config_rw_clk_ctrl___dma45___bit 5
92#define reg_config_rw_clk_ctrl___dma67___lsb 6
93#define reg_config_rw_clk_ctrl___dma67___width 1
94#define reg_config_rw_clk_ctrl___dma67___bit 6
95#define reg_config_rw_clk_ctrl___dma89_strcop___lsb 7
96#define reg_config_rw_clk_ctrl___dma89_strcop___width 1
97#define reg_config_rw_clk_ctrl___dma89_strcop___bit 7
98#define reg_config_rw_clk_ctrl___bif___lsb 8
99#define reg_config_rw_clk_ctrl___bif___width 1
100#define reg_config_rw_clk_ctrl___bif___bit 8
101#define reg_config_rw_clk_ctrl___fix_io___lsb 9
102#define reg_config_rw_clk_ctrl___fix_io___width 1
103#define reg_config_rw_clk_ctrl___fix_io___bit 9
104#define reg_config_rw_clk_ctrl_offset 4
105
106/* Register rw_pad_ctrl, scope config, type rw */
107#define reg_config_rw_pad_ctrl___usb_susp___lsb 0
108#define reg_config_rw_pad_ctrl___usb_susp___width 1
109#define reg_config_rw_pad_ctrl___usb_susp___bit 0
110#define reg_config_rw_pad_ctrl___phyrst_n___lsb 1
111#define reg_config_rw_pad_ctrl___phyrst_n___width 1
112#define reg_config_rw_pad_ctrl___phyrst_n___bit 1
113#define reg_config_rw_pad_ctrl_offset 8
114
115
116/* Constants */
117#define regk_config_bw16 0x00000000
118#define regk_config_bw32 0x00000001
119#define regk_config_master 0x00000005
120#define regk_config_nand 0x00000003
121#define regk_config_net_rx 0x00000001
122#define regk_config_net_tx_rx 0x00000002
123#define regk_config_no 0x00000000
124#define regk_config_none 0x00000007
125#define regk_config_nor 0x00000000
126#define regk_config_rw_clk_ctrl_default 0x00000002
127#define regk_config_rw_pad_ctrl_default 0x00000000
128#define regk_config_ser 0x00000004
129#define regk_config_slave 0x00000006
130#define regk_config_yes 0x00000001
131#endif /* __config_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/asm/gio_defs_asm.h b/include/asm-cris/arch-v32/mach-fs/hwregs/asm/gio_defs_asm.h
new file mode 100644
index 000000000000..be4c63936d90
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/asm/gio_defs_asm.h
@@ -0,0 +1,276 @@
1#ifndef __gio_defs_asm_h
2#define __gio_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/gio/rtl/gio_regs.r
7 * id: gio_regs.r,v 1.5 2005/02/04 09:43:21 perz Exp
8 * last modfied: Mon Apr 11 16:07:47 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/gio_defs_asm.h ../../inst/gio/rtl/gio_regs.r
11 * id: $Id: gio_defs_asm.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_pa_dout, scope gio, type rw */
57#define reg_gio_rw_pa_dout___data___lsb 0
58#define reg_gio_rw_pa_dout___data___width 8
59#define reg_gio_rw_pa_dout_offset 0
60
61/* Register r_pa_din, scope gio, type r */
62#define reg_gio_r_pa_din___data___lsb 0
63#define reg_gio_r_pa_din___data___width 8
64#define reg_gio_r_pa_din_offset 4
65
66/* Register rw_pa_oe, scope gio, type rw */
67#define reg_gio_rw_pa_oe___oe___lsb 0
68#define reg_gio_rw_pa_oe___oe___width 8
69#define reg_gio_rw_pa_oe_offset 8
70
71/* Register rw_intr_cfg, scope gio, type rw */
72#define reg_gio_rw_intr_cfg___pa0___lsb 0
73#define reg_gio_rw_intr_cfg___pa0___width 3
74#define reg_gio_rw_intr_cfg___pa1___lsb 3
75#define reg_gio_rw_intr_cfg___pa1___width 3
76#define reg_gio_rw_intr_cfg___pa2___lsb 6
77#define reg_gio_rw_intr_cfg___pa2___width 3
78#define reg_gio_rw_intr_cfg___pa3___lsb 9
79#define reg_gio_rw_intr_cfg___pa3___width 3
80#define reg_gio_rw_intr_cfg___pa4___lsb 12
81#define reg_gio_rw_intr_cfg___pa4___width 3
82#define reg_gio_rw_intr_cfg___pa5___lsb 15
83#define reg_gio_rw_intr_cfg___pa5___width 3
84#define reg_gio_rw_intr_cfg___pa6___lsb 18
85#define reg_gio_rw_intr_cfg___pa6___width 3
86#define reg_gio_rw_intr_cfg___pa7___lsb 21
87#define reg_gio_rw_intr_cfg___pa7___width 3
88#define reg_gio_rw_intr_cfg_offset 12
89
90/* Register rw_intr_mask, scope gio, type rw */
91#define reg_gio_rw_intr_mask___pa0___lsb 0
92#define reg_gio_rw_intr_mask___pa0___width 1
93#define reg_gio_rw_intr_mask___pa0___bit 0
94#define reg_gio_rw_intr_mask___pa1___lsb 1
95#define reg_gio_rw_intr_mask___pa1___width 1
96#define reg_gio_rw_intr_mask___pa1___bit 1
97#define reg_gio_rw_intr_mask___pa2___lsb 2
98#define reg_gio_rw_intr_mask___pa2___width 1
99#define reg_gio_rw_intr_mask___pa2___bit 2
100#define reg_gio_rw_intr_mask___pa3___lsb 3
101#define reg_gio_rw_intr_mask___pa3___width 1
102#define reg_gio_rw_intr_mask___pa3___bit 3
103#define reg_gio_rw_intr_mask___pa4___lsb 4
104#define reg_gio_rw_intr_mask___pa4___width 1
105#define reg_gio_rw_intr_mask___pa4___bit 4
106#define reg_gio_rw_intr_mask___pa5___lsb 5
107#define reg_gio_rw_intr_mask___pa5___width 1
108#define reg_gio_rw_intr_mask___pa5___bit 5
109#define reg_gio_rw_intr_mask___pa6___lsb 6
110#define reg_gio_rw_intr_mask___pa6___width 1
111#define reg_gio_rw_intr_mask___pa6___bit 6
112#define reg_gio_rw_intr_mask___pa7___lsb 7
113#define reg_gio_rw_intr_mask___pa7___width 1
114#define reg_gio_rw_intr_mask___pa7___bit 7
115#define reg_gio_rw_intr_mask_offset 16
116
117/* Register rw_ack_intr, scope gio, type rw */
118#define reg_gio_rw_ack_intr___pa0___lsb 0
119#define reg_gio_rw_ack_intr___pa0___width 1
120#define reg_gio_rw_ack_intr___pa0___bit 0
121#define reg_gio_rw_ack_intr___pa1___lsb 1
122#define reg_gio_rw_ack_intr___pa1___width 1
123#define reg_gio_rw_ack_intr___pa1___bit 1
124#define reg_gio_rw_ack_intr___pa2___lsb 2
125#define reg_gio_rw_ack_intr___pa2___width 1
126#define reg_gio_rw_ack_intr___pa2___bit 2
127#define reg_gio_rw_ack_intr___pa3___lsb 3
128#define reg_gio_rw_ack_intr___pa3___width 1
129#define reg_gio_rw_ack_intr___pa3___bit 3
130#define reg_gio_rw_ack_intr___pa4___lsb 4
131#define reg_gio_rw_ack_intr___pa4___width 1
132#define reg_gio_rw_ack_intr___pa4___bit 4
133#define reg_gio_rw_ack_intr___pa5___lsb 5
134#define reg_gio_rw_ack_intr___pa5___width 1
135#define reg_gio_rw_ack_intr___pa5___bit 5
136#define reg_gio_rw_ack_intr___pa6___lsb 6
137#define reg_gio_rw_ack_intr___pa6___width 1
138#define reg_gio_rw_ack_intr___pa6___bit 6
139#define reg_gio_rw_ack_intr___pa7___lsb 7
140#define reg_gio_rw_ack_intr___pa7___width 1
141#define reg_gio_rw_ack_intr___pa7___bit 7
142#define reg_gio_rw_ack_intr_offset 20
143
144/* Register r_intr, scope gio, type r */
145#define reg_gio_r_intr___pa0___lsb 0
146#define reg_gio_r_intr___pa0___width 1
147#define reg_gio_r_intr___pa0___bit 0
148#define reg_gio_r_intr___pa1___lsb 1
149#define reg_gio_r_intr___pa1___width 1
150#define reg_gio_r_intr___pa1___bit 1
151#define reg_gio_r_intr___pa2___lsb 2
152#define reg_gio_r_intr___pa2___width 1
153#define reg_gio_r_intr___pa2___bit 2
154#define reg_gio_r_intr___pa3___lsb 3
155#define reg_gio_r_intr___pa3___width 1
156#define reg_gio_r_intr___pa3___bit 3
157#define reg_gio_r_intr___pa4___lsb 4
158#define reg_gio_r_intr___pa4___width 1
159#define reg_gio_r_intr___pa4___bit 4
160#define reg_gio_r_intr___pa5___lsb 5
161#define reg_gio_r_intr___pa5___width 1
162#define reg_gio_r_intr___pa5___bit 5
163#define reg_gio_r_intr___pa6___lsb 6
164#define reg_gio_r_intr___pa6___width 1
165#define reg_gio_r_intr___pa6___bit 6
166#define reg_gio_r_intr___pa7___lsb 7
167#define reg_gio_r_intr___pa7___width 1
168#define reg_gio_r_intr___pa7___bit 7
169#define reg_gio_r_intr_offset 24
170
171/* Register r_masked_intr, scope gio, type r */
172#define reg_gio_r_masked_intr___pa0___lsb 0
173#define reg_gio_r_masked_intr___pa0___width 1
174#define reg_gio_r_masked_intr___pa0___bit 0
175#define reg_gio_r_masked_intr___pa1___lsb 1
176#define reg_gio_r_masked_intr___pa1___width 1
177#define reg_gio_r_masked_intr___pa1___bit 1
178#define reg_gio_r_masked_intr___pa2___lsb 2
179#define reg_gio_r_masked_intr___pa2___width 1
180#define reg_gio_r_masked_intr___pa2___bit 2
181#define reg_gio_r_masked_intr___pa3___lsb 3
182#define reg_gio_r_masked_intr___pa3___width 1
183#define reg_gio_r_masked_intr___pa3___bit 3
184#define reg_gio_r_masked_intr___pa4___lsb 4
185#define reg_gio_r_masked_intr___pa4___width 1
186#define reg_gio_r_masked_intr___pa4___bit 4
187#define reg_gio_r_masked_intr___pa5___lsb 5
188#define reg_gio_r_masked_intr___pa5___width 1
189#define reg_gio_r_masked_intr___pa5___bit 5
190#define reg_gio_r_masked_intr___pa6___lsb 6
191#define reg_gio_r_masked_intr___pa6___width 1
192#define reg_gio_r_masked_intr___pa6___bit 6
193#define reg_gio_r_masked_intr___pa7___lsb 7
194#define reg_gio_r_masked_intr___pa7___width 1
195#define reg_gio_r_masked_intr___pa7___bit 7
196#define reg_gio_r_masked_intr_offset 28
197
198/* Register rw_pb_dout, scope gio, type rw */
199#define reg_gio_rw_pb_dout___data___lsb 0
200#define reg_gio_rw_pb_dout___data___width 18
201#define reg_gio_rw_pb_dout_offset 32
202
203/* Register r_pb_din, scope gio, type r */
204#define reg_gio_r_pb_din___data___lsb 0
205#define reg_gio_r_pb_din___data___width 18
206#define reg_gio_r_pb_din_offset 36
207
208/* Register rw_pb_oe, scope gio, type rw */
209#define reg_gio_rw_pb_oe___oe___lsb 0
210#define reg_gio_rw_pb_oe___oe___width 18
211#define reg_gio_rw_pb_oe_offset 40
212
213/* Register rw_pc_dout, scope gio, type rw */
214#define reg_gio_rw_pc_dout___data___lsb 0
215#define reg_gio_rw_pc_dout___data___width 18
216#define reg_gio_rw_pc_dout_offset 48
217
218/* Register r_pc_din, scope gio, type r */
219#define reg_gio_r_pc_din___data___lsb 0
220#define reg_gio_r_pc_din___data___width 18
221#define reg_gio_r_pc_din_offset 52
222
223/* Register rw_pc_oe, scope gio, type rw */
224#define reg_gio_rw_pc_oe___oe___lsb 0
225#define reg_gio_rw_pc_oe___oe___width 18
226#define reg_gio_rw_pc_oe_offset 56
227
228/* Register rw_pd_dout, scope gio, type rw */
229#define reg_gio_rw_pd_dout___data___lsb 0
230#define reg_gio_rw_pd_dout___data___width 18
231#define reg_gio_rw_pd_dout_offset 64
232
233/* Register r_pd_din, scope gio, type r */
234#define reg_gio_r_pd_din___data___lsb 0
235#define reg_gio_r_pd_din___data___width 18
236#define reg_gio_r_pd_din_offset 68
237
238/* Register rw_pd_oe, scope gio, type rw */
239#define reg_gio_rw_pd_oe___oe___lsb 0
240#define reg_gio_rw_pd_oe___oe___width 18
241#define reg_gio_rw_pd_oe_offset 72
242
243/* Register rw_pe_dout, scope gio, type rw */
244#define reg_gio_rw_pe_dout___data___lsb 0
245#define reg_gio_rw_pe_dout___data___width 18
246#define reg_gio_rw_pe_dout_offset 80
247
248/* Register r_pe_din, scope gio, type r */
249#define reg_gio_r_pe_din___data___lsb 0
250#define reg_gio_r_pe_din___data___width 18
251#define reg_gio_r_pe_din_offset 84
252
253/* Register rw_pe_oe, scope gio, type rw */
254#define reg_gio_rw_pe_oe___oe___lsb 0
255#define reg_gio_rw_pe_oe___oe___width 18
256#define reg_gio_rw_pe_oe_offset 88
257
258
259/* Constants */
260#define regk_gio_anyedge 0x00000007
261#define regk_gio_hi 0x00000001
262#define regk_gio_lo 0x00000002
263#define regk_gio_negedge 0x00000006
264#define regk_gio_no 0x00000000
265#define regk_gio_off 0x00000000
266#define regk_gio_posedge 0x00000005
267#define regk_gio_rw_intr_cfg_default 0x00000000
268#define regk_gio_rw_intr_mask_default 0x00000000
269#define regk_gio_rw_pa_oe_default 0x00000000
270#define regk_gio_rw_pb_oe_default 0x00000000
271#define regk_gio_rw_pc_oe_default 0x00000000
272#define regk_gio_rw_pd_oe_default 0x00000000
273#define regk_gio_rw_pe_oe_default 0x00000000
274#define regk_gio_set 0x00000003
275#define regk_gio_yes 0x00000001
276#endif /* __gio_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/asm/pinmux_defs_asm.h b/include/asm-cris/arch-v32/mach-fs/hwregs/asm/pinmux_defs_asm.h
new file mode 100644
index 000000000000..30cf5a936b64
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/asm/pinmux_defs_asm.h
@@ -0,0 +1,632 @@
1#ifndef __pinmux_defs_asm_h
2#define __pinmux_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/pinmux/rtl/guinness/pinmux_regs.r
7 * id: pinmux_regs.r,v 1.40 2005/02/09 16:22:59 perz Exp
8 * last modfied: Mon Apr 11 16:09:11 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/pinmux_defs_asm.h ../../inst/pinmux/rtl/guinness/pinmux_regs.r
11 * id: $Id: pinmux_defs_asm.h,v 1.1 2007/04/11 11:00:39 ricardw Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_pa, scope pinmux, type rw */
57#define reg_pinmux_rw_pa___pa0___lsb 0
58#define reg_pinmux_rw_pa___pa0___width 1
59#define reg_pinmux_rw_pa___pa0___bit 0
60#define reg_pinmux_rw_pa___pa1___lsb 1
61#define reg_pinmux_rw_pa___pa1___width 1
62#define reg_pinmux_rw_pa___pa1___bit 1
63#define reg_pinmux_rw_pa___pa2___lsb 2
64#define reg_pinmux_rw_pa___pa2___width 1
65#define reg_pinmux_rw_pa___pa2___bit 2
66#define reg_pinmux_rw_pa___pa3___lsb 3
67#define reg_pinmux_rw_pa___pa3___width 1
68#define reg_pinmux_rw_pa___pa3___bit 3
69#define reg_pinmux_rw_pa___pa4___lsb 4
70#define reg_pinmux_rw_pa___pa4___width 1
71#define reg_pinmux_rw_pa___pa4___bit 4
72#define reg_pinmux_rw_pa___pa5___lsb 5
73#define reg_pinmux_rw_pa___pa5___width 1
74#define reg_pinmux_rw_pa___pa5___bit 5
75#define reg_pinmux_rw_pa___pa6___lsb 6
76#define reg_pinmux_rw_pa___pa6___width 1
77#define reg_pinmux_rw_pa___pa6___bit 6
78#define reg_pinmux_rw_pa___pa7___lsb 7
79#define reg_pinmux_rw_pa___pa7___width 1
80#define reg_pinmux_rw_pa___pa7___bit 7
81#define reg_pinmux_rw_pa___csp2_n___lsb 8
82#define reg_pinmux_rw_pa___csp2_n___width 1
83#define reg_pinmux_rw_pa___csp2_n___bit 8
84#define reg_pinmux_rw_pa___csp3_n___lsb 9
85#define reg_pinmux_rw_pa___csp3_n___width 1
86#define reg_pinmux_rw_pa___csp3_n___bit 9
87#define reg_pinmux_rw_pa___csp5_n___lsb 10
88#define reg_pinmux_rw_pa___csp5_n___width 1
89#define reg_pinmux_rw_pa___csp5_n___bit 10
90#define reg_pinmux_rw_pa___csp6_n___lsb 11
91#define reg_pinmux_rw_pa___csp6_n___width 1
92#define reg_pinmux_rw_pa___csp6_n___bit 11
93#define reg_pinmux_rw_pa___hsh4___lsb 12
94#define reg_pinmux_rw_pa___hsh4___width 1
95#define reg_pinmux_rw_pa___hsh4___bit 12
96#define reg_pinmux_rw_pa___hsh5___lsb 13
97#define reg_pinmux_rw_pa___hsh5___width 1
98#define reg_pinmux_rw_pa___hsh5___bit 13
99#define reg_pinmux_rw_pa___hsh6___lsb 14
100#define reg_pinmux_rw_pa___hsh6___width 1
101#define reg_pinmux_rw_pa___hsh6___bit 14
102#define reg_pinmux_rw_pa___hsh7___lsb 15
103#define reg_pinmux_rw_pa___hsh7___width 1
104#define reg_pinmux_rw_pa___hsh7___bit 15
105#define reg_pinmux_rw_pa_offset 0
106
107/* Register rw_hwprot, scope pinmux, type rw */
108#define reg_pinmux_rw_hwprot___ser1___lsb 0
109#define reg_pinmux_rw_hwprot___ser1___width 1
110#define reg_pinmux_rw_hwprot___ser1___bit 0
111#define reg_pinmux_rw_hwprot___ser2___lsb 1
112#define reg_pinmux_rw_hwprot___ser2___width 1
113#define reg_pinmux_rw_hwprot___ser2___bit 1
114#define reg_pinmux_rw_hwprot___ser3___lsb 2
115#define reg_pinmux_rw_hwprot___ser3___width 1
116#define reg_pinmux_rw_hwprot___ser3___bit 2
117#define reg_pinmux_rw_hwprot___sser0___lsb 3
118#define reg_pinmux_rw_hwprot___sser0___width 1
119#define reg_pinmux_rw_hwprot___sser0___bit 3
120#define reg_pinmux_rw_hwprot___sser1___lsb 4
121#define reg_pinmux_rw_hwprot___sser1___width 1
122#define reg_pinmux_rw_hwprot___sser1___bit 4
123#define reg_pinmux_rw_hwprot___ata0___lsb 5
124#define reg_pinmux_rw_hwprot___ata0___width 1
125#define reg_pinmux_rw_hwprot___ata0___bit 5
126#define reg_pinmux_rw_hwprot___ata1___lsb 6
127#define reg_pinmux_rw_hwprot___ata1___width 1
128#define reg_pinmux_rw_hwprot___ata1___bit 6
129#define reg_pinmux_rw_hwprot___ata2___lsb 7
130#define reg_pinmux_rw_hwprot___ata2___width 1
131#define reg_pinmux_rw_hwprot___ata2___bit 7
132#define reg_pinmux_rw_hwprot___ata3___lsb 8
133#define reg_pinmux_rw_hwprot___ata3___width 1
134#define reg_pinmux_rw_hwprot___ata3___bit 8
135#define reg_pinmux_rw_hwprot___ata___lsb 9
136#define reg_pinmux_rw_hwprot___ata___width 1
137#define reg_pinmux_rw_hwprot___ata___bit 9
138#define reg_pinmux_rw_hwprot___eth1___lsb 10
139#define reg_pinmux_rw_hwprot___eth1___width 1
140#define reg_pinmux_rw_hwprot___eth1___bit 10
141#define reg_pinmux_rw_hwprot___eth1_mgm___lsb 11
142#define reg_pinmux_rw_hwprot___eth1_mgm___width 1
143#define reg_pinmux_rw_hwprot___eth1_mgm___bit 11
144#define reg_pinmux_rw_hwprot___timer___lsb 12
145#define reg_pinmux_rw_hwprot___timer___width 1
146#define reg_pinmux_rw_hwprot___timer___bit 12
147#define reg_pinmux_rw_hwprot___p21___lsb 13
148#define reg_pinmux_rw_hwprot___p21___width 1
149#define reg_pinmux_rw_hwprot___p21___bit 13
150#define reg_pinmux_rw_hwprot_offset 4
151
152/* Register rw_pb_gio, scope pinmux, type rw */
153#define reg_pinmux_rw_pb_gio___pb0___lsb 0
154#define reg_pinmux_rw_pb_gio___pb0___width 1
155#define reg_pinmux_rw_pb_gio___pb0___bit 0
156#define reg_pinmux_rw_pb_gio___pb1___lsb 1
157#define reg_pinmux_rw_pb_gio___pb1___width 1
158#define reg_pinmux_rw_pb_gio___pb1___bit 1
159#define reg_pinmux_rw_pb_gio___pb2___lsb 2
160#define reg_pinmux_rw_pb_gio___pb2___width 1
161#define reg_pinmux_rw_pb_gio___pb2___bit 2
162#define reg_pinmux_rw_pb_gio___pb3___lsb 3
163#define reg_pinmux_rw_pb_gio___pb3___width 1
164#define reg_pinmux_rw_pb_gio___pb3___bit 3
165#define reg_pinmux_rw_pb_gio___pb4___lsb 4
166#define reg_pinmux_rw_pb_gio___pb4___width 1
167#define reg_pinmux_rw_pb_gio___pb4___bit 4
168#define reg_pinmux_rw_pb_gio___pb5___lsb 5
169#define reg_pinmux_rw_pb_gio___pb5___width 1
170#define reg_pinmux_rw_pb_gio___pb5___bit 5
171#define reg_pinmux_rw_pb_gio___pb6___lsb 6
172#define reg_pinmux_rw_pb_gio___pb6___width 1
173#define reg_pinmux_rw_pb_gio___pb6___bit 6
174#define reg_pinmux_rw_pb_gio___pb7___lsb 7
175#define reg_pinmux_rw_pb_gio___pb7___width 1
176#define reg_pinmux_rw_pb_gio___pb7___bit 7
177#define reg_pinmux_rw_pb_gio___pb8___lsb 8
178#define reg_pinmux_rw_pb_gio___pb8___width 1
179#define reg_pinmux_rw_pb_gio___pb8___bit 8
180#define reg_pinmux_rw_pb_gio___pb9___lsb 9
181#define reg_pinmux_rw_pb_gio___pb9___width 1
182#define reg_pinmux_rw_pb_gio___pb9___bit 9
183#define reg_pinmux_rw_pb_gio___pb10___lsb 10
184#define reg_pinmux_rw_pb_gio___pb10___width 1
185#define reg_pinmux_rw_pb_gio___pb10___bit 10
186#define reg_pinmux_rw_pb_gio___pb11___lsb 11
187#define reg_pinmux_rw_pb_gio___pb11___width 1
188#define reg_pinmux_rw_pb_gio___pb11___bit 11
189#define reg_pinmux_rw_pb_gio___pb12___lsb 12
190#define reg_pinmux_rw_pb_gio___pb12___width 1
191#define reg_pinmux_rw_pb_gio___pb12___bit 12
192#define reg_pinmux_rw_pb_gio___pb13___lsb 13
193#define reg_pinmux_rw_pb_gio___pb13___width 1
194#define reg_pinmux_rw_pb_gio___pb13___bit 13
195#define reg_pinmux_rw_pb_gio___pb14___lsb 14
196#define reg_pinmux_rw_pb_gio___pb14___width 1
197#define reg_pinmux_rw_pb_gio___pb14___bit 14
198#define reg_pinmux_rw_pb_gio___pb15___lsb 15
199#define reg_pinmux_rw_pb_gio___pb15___width 1
200#define reg_pinmux_rw_pb_gio___pb15___bit 15
201#define reg_pinmux_rw_pb_gio___pb16___lsb 16
202#define reg_pinmux_rw_pb_gio___pb16___width 1
203#define reg_pinmux_rw_pb_gio___pb16___bit 16
204#define reg_pinmux_rw_pb_gio___pb17___lsb 17
205#define reg_pinmux_rw_pb_gio___pb17___width 1
206#define reg_pinmux_rw_pb_gio___pb17___bit 17
207#define reg_pinmux_rw_pb_gio_offset 8
208
209/* Register rw_pb_iop, scope pinmux, type rw */
210#define reg_pinmux_rw_pb_iop___pb0___lsb 0
211#define reg_pinmux_rw_pb_iop___pb0___width 1
212#define reg_pinmux_rw_pb_iop___pb0___bit 0
213#define reg_pinmux_rw_pb_iop___pb1___lsb 1
214#define reg_pinmux_rw_pb_iop___pb1___width 1
215#define reg_pinmux_rw_pb_iop___pb1___bit 1
216#define reg_pinmux_rw_pb_iop___pb2___lsb 2
217#define reg_pinmux_rw_pb_iop___pb2___width 1
218#define reg_pinmux_rw_pb_iop___pb2___bit 2
219#define reg_pinmux_rw_pb_iop___pb3___lsb 3
220#define reg_pinmux_rw_pb_iop___pb3___width 1
221#define reg_pinmux_rw_pb_iop___pb3___bit 3
222#define reg_pinmux_rw_pb_iop___pb4___lsb 4
223#define reg_pinmux_rw_pb_iop___pb4___width 1
224#define reg_pinmux_rw_pb_iop___pb4___bit 4
225#define reg_pinmux_rw_pb_iop___pb5___lsb 5
226#define reg_pinmux_rw_pb_iop___pb5___width 1
227#define reg_pinmux_rw_pb_iop___pb5___bit 5
228#define reg_pinmux_rw_pb_iop___pb6___lsb 6
229#define reg_pinmux_rw_pb_iop___pb6___width 1
230#define reg_pinmux_rw_pb_iop___pb6___bit 6
231#define reg_pinmux_rw_pb_iop___pb7___lsb 7
232#define reg_pinmux_rw_pb_iop___pb7___width 1
233#define reg_pinmux_rw_pb_iop___pb7___bit 7
234#define reg_pinmux_rw_pb_iop___pb8___lsb 8
235#define reg_pinmux_rw_pb_iop___pb8___width 1
236#define reg_pinmux_rw_pb_iop___pb8___bit 8
237#define reg_pinmux_rw_pb_iop___pb9___lsb 9
238#define reg_pinmux_rw_pb_iop___pb9___width 1
239#define reg_pinmux_rw_pb_iop___pb9___bit 9
240#define reg_pinmux_rw_pb_iop___pb10___lsb 10
241#define reg_pinmux_rw_pb_iop___pb10___width 1
242#define reg_pinmux_rw_pb_iop___pb10___bit 10
243#define reg_pinmux_rw_pb_iop___pb11___lsb 11
244#define reg_pinmux_rw_pb_iop___pb11___width 1
245#define reg_pinmux_rw_pb_iop___pb11___bit 11
246#define reg_pinmux_rw_pb_iop___pb12___lsb 12
247#define reg_pinmux_rw_pb_iop___pb12___width 1
248#define reg_pinmux_rw_pb_iop___pb12___bit 12
249#define reg_pinmux_rw_pb_iop___pb13___lsb 13
250#define reg_pinmux_rw_pb_iop___pb13___width 1
251#define reg_pinmux_rw_pb_iop___pb13___bit 13
252#define reg_pinmux_rw_pb_iop___pb14___lsb 14
253#define reg_pinmux_rw_pb_iop___pb14___width 1
254#define reg_pinmux_rw_pb_iop___pb14___bit 14
255#define reg_pinmux_rw_pb_iop___pb15___lsb 15
256#define reg_pinmux_rw_pb_iop___pb15___width 1
257#define reg_pinmux_rw_pb_iop___pb15___bit 15
258#define reg_pinmux_rw_pb_iop___pb16___lsb 16
259#define reg_pinmux_rw_pb_iop___pb16___width 1
260#define reg_pinmux_rw_pb_iop___pb16___bit 16
261#define reg_pinmux_rw_pb_iop___pb17___lsb 17
262#define reg_pinmux_rw_pb_iop___pb17___width 1
263#define reg_pinmux_rw_pb_iop___pb17___bit 17
264#define reg_pinmux_rw_pb_iop_offset 12
265
266/* Register rw_pc_gio, scope pinmux, type rw */
267#define reg_pinmux_rw_pc_gio___pc0___lsb 0
268#define reg_pinmux_rw_pc_gio___pc0___width 1
269#define reg_pinmux_rw_pc_gio___pc0___bit 0
270#define reg_pinmux_rw_pc_gio___pc1___lsb 1
271#define reg_pinmux_rw_pc_gio___pc1___width 1
272#define reg_pinmux_rw_pc_gio___pc1___bit 1
273#define reg_pinmux_rw_pc_gio___pc2___lsb 2
274#define reg_pinmux_rw_pc_gio___pc2___width 1
275#define reg_pinmux_rw_pc_gio___pc2___bit 2
276#define reg_pinmux_rw_pc_gio___pc3___lsb 3
277#define reg_pinmux_rw_pc_gio___pc3___width 1
278#define reg_pinmux_rw_pc_gio___pc3___bit 3
279#define reg_pinmux_rw_pc_gio___pc4___lsb 4
280#define reg_pinmux_rw_pc_gio___pc4___width 1
281#define reg_pinmux_rw_pc_gio___pc4___bit 4
282#define reg_pinmux_rw_pc_gio___pc5___lsb 5
283#define reg_pinmux_rw_pc_gio___pc5___width 1
284#define reg_pinmux_rw_pc_gio___pc5___bit 5
285#define reg_pinmux_rw_pc_gio___pc6___lsb 6
286#define reg_pinmux_rw_pc_gio___pc6___width 1
287#define reg_pinmux_rw_pc_gio___pc6___bit 6
288#define reg_pinmux_rw_pc_gio___pc7___lsb 7
289#define reg_pinmux_rw_pc_gio___pc7___width 1
290#define reg_pinmux_rw_pc_gio___pc7___bit 7
291#define reg_pinmux_rw_pc_gio___pc8___lsb 8
292#define reg_pinmux_rw_pc_gio___pc8___width 1
293#define reg_pinmux_rw_pc_gio___pc8___bit 8
294#define reg_pinmux_rw_pc_gio___pc9___lsb 9
295#define reg_pinmux_rw_pc_gio___pc9___width 1
296#define reg_pinmux_rw_pc_gio___pc9___bit 9
297#define reg_pinmux_rw_pc_gio___pc10___lsb 10
298#define reg_pinmux_rw_pc_gio___pc10___width 1
299#define reg_pinmux_rw_pc_gio___pc10___bit 10
300#define reg_pinmux_rw_pc_gio___pc11___lsb 11
301#define reg_pinmux_rw_pc_gio___pc11___width 1
302#define reg_pinmux_rw_pc_gio___pc11___bit 11
303#define reg_pinmux_rw_pc_gio___pc12___lsb 12
304#define reg_pinmux_rw_pc_gio___pc12___width 1
305#define reg_pinmux_rw_pc_gio___pc12___bit 12
306#define reg_pinmux_rw_pc_gio___pc13___lsb 13
307#define reg_pinmux_rw_pc_gio___pc13___width 1
308#define reg_pinmux_rw_pc_gio___pc13___bit 13
309#define reg_pinmux_rw_pc_gio___pc14___lsb 14
310#define reg_pinmux_rw_pc_gio___pc14___width 1
311#define reg_pinmux_rw_pc_gio___pc14___bit 14
312#define reg_pinmux_rw_pc_gio___pc15___lsb 15
313#define reg_pinmux_rw_pc_gio___pc15___width 1
314#define reg_pinmux_rw_pc_gio___pc15___bit 15
315#define reg_pinmux_rw_pc_gio___pc16___lsb 16
316#define reg_pinmux_rw_pc_gio___pc16___width 1
317#define reg_pinmux_rw_pc_gio___pc16___bit 16
318#define reg_pinmux_rw_pc_gio___pc17___lsb 17
319#define reg_pinmux_rw_pc_gio___pc17___width 1
320#define reg_pinmux_rw_pc_gio___pc17___bit 17
321#define reg_pinmux_rw_pc_gio_offset 16
322
323/* Register rw_pc_iop, scope pinmux, type rw */
324#define reg_pinmux_rw_pc_iop___pc0___lsb 0
325#define reg_pinmux_rw_pc_iop___pc0___width 1
326#define reg_pinmux_rw_pc_iop___pc0___bit 0
327#define reg_pinmux_rw_pc_iop___pc1___lsb 1
328#define reg_pinmux_rw_pc_iop___pc1___width 1
329#define reg_pinmux_rw_pc_iop___pc1___bit 1
330#define reg_pinmux_rw_pc_iop___pc2___lsb 2
331#define reg_pinmux_rw_pc_iop___pc2___width 1
332#define reg_pinmux_rw_pc_iop___pc2___bit 2
333#define reg_pinmux_rw_pc_iop___pc3___lsb 3
334#define reg_pinmux_rw_pc_iop___pc3___width 1
335#define reg_pinmux_rw_pc_iop___pc3___bit 3
336#define reg_pinmux_rw_pc_iop___pc4___lsb 4
337#define reg_pinmux_rw_pc_iop___pc4___width 1
338#define reg_pinmux_rw_pc_iop___pc4___bit 4
339#define reg_pinmux_rw_pc_iop___pc5___lsb 5
340#define reg_pinmux_rw_pc_iop___pc5___width 1
341#define reg_pinmux_rw_pc_iop___pc5___bit 5
342#define reg_pinmux_rw_pc_iop___pc6___lsb 6
343#define reg_pinmux_rw_pc_iop___pc6___width 1
344#define reg_pinmux_rw_pc_iop___pc6___bit 6
345#define reg_pinmux_rw_pc_iop___pc7___lsb 7
346#define reg_pinmux_rw_pc_iop___pc7___width 1
347#define reg_pinmux_rw_pc_iop___pc7___bit 7
348#define reg_pinmux_rw_pc_iop___pc8___lsb 8
349#define reg_pinmux_rw_pc_iop___pc8___width 1
350#define reg_pinmux_rw_pc_iop___pc8___bit 8
351#define reg_pinmux_rw_pc_iop___pc9___lsb 9
352#define reg_pinmux_rw_pc_iop___pc9___width 1
353#define reg_pinmux_rw_pc_iop___pc9___bit 9
354#define reg_pinmux_rw_pc_iop___pc10___lsb 10
355#define reg_pinmux_rw_pc_iop___pc10___width 1
356#define reg_pinmux_rw_pc_iop___pc10___bit 10
357#define reg_pinmux_rw_pc_iop___pc11___lsb 11
358#define reg_pinmux_rw_pc_iop___pc11___width 1
359#define reg_pinmux_rw_pc_iop___pc11___bit 11
360#define reg_pinmux_rw_pc_iop___pc12___lsb 12
361#define reg_pinmux_rw_pc_iop___pc12___width 1
362#define reg_pinmux_rw_pc_iop___pc12___bit 12
363#define reg_pinmux_rw_pc_iop___pc13___lsb 13
364#define reg_pinmux_rw_pc_iop___pc13___width 1
365#define reg_pinmux_rw_pc_iop___pc13___bit 13
366#define reg_pinmux_rw_pc_iop___pc14___lsb 14
367#define reg_pinmux_rw_pc_iop___pc14___width 1
368#define reg_pinmux_rw_pc_iop___pc14___bit 14
369#define reg_pinmux_rw_pc_iop___pc15___lsb 15
370#define reg_pinmux_rw_pc_iop___pc15___width 1
371#define reg_pinmux_rw_pc_iop___pc15___bit 15
372#define reg_pinmux_rw_pc_iop___pc16___lsb 16
373#define reg_pinmux_rw_pc_iop___pc16___width 1
374#define reg_pinmux_rw_pc_iop___pc16___bit 16
375#define reg_pinmux_rw_pc_iop___pc17___lsb 17
376#define reg_pinmux_rw_pc_iop___pc17___width 1
377#define reg_pinmux_rw_pc_iop___pc17___bit 17
378#define reg_pinmux_rw_pc_iop_offset 20
379
380/* Register rw_pd_gio, scope pinmux, type rw */
381#define reg_pinmux_rw_pd_gio___pd0___lsb 0
382#define reg_pinmux_rw_pd_gio___pd0___width 1
383#define reg_pinmux_rw_pd_gio___pd0___bit 0
384#define reg_pinmux_rw_pd_gio___pd1___lsb 1
385#define reg_pinmux_rw_pd_gio___pd1___width 1
386#define reg_pinmux_rw_pd_gio___pd1___bit 1
387#define reg_pinmux_rw_pd_gio___pd2___lsb 2
388#define reg_pinmux_rw_pd_gio___pd2___width 1
389#define reg_pinmux_rw_pd_gio___pd2___bit 2
390#define reg_pinmux_rw_pd_gio___pd3___lsb 3
391#define reg_pinmux_rw_pd_gio___pd3___width 1
392#define reg_pinmux_rw_pd_gio___pd3___bit 3
393#define reg_pinmux_rw_pd_gio___pd4___lsb 4
394#define reg_pinmux_rw_pd_gio___pd4___width 1
395#define reg_pinmux_rw_pd_gio___pd4___bit 4
396#define reg_pinmux_rw_pd_gio___pd5___lsb 5
397#define reg_pinmux_rw_pd_gio___pd5___width 1
398#define reg_pinmux_rw_pd_gio___pd5___bit 5
399#define reg_pinmux_rw_pd_gio___pd6___lsb 6
400#define reg_pinmux_rw_pd_gio___pd6___width 1
401#define reg_pinmux_rw_pd_gio___pd6___bit 6
402#define reg_pinmux_rw_pd_gio___pd7___lsb 7
403#define reg_pinmux_rw_pd_gio___pd7___width 1
404#define reg_pinmux_rw_pd_gio___pd7___bit 7
405#define reg_pinmux_rw_pd_gio___pd8___lsb 8
406#define reg_pinmux_rw_pd_gio___pd8___width 1
407#define reg_pinmux_rw_pd_gio___pd8___bit 8
408#define reg_pinmux_rw_pd_gio___pd9___lsb 9
409#define reg_pinmux_rw_pd_gio___pd9___width 1
410#define reg_pinmux_rw_pd_gio___pd9___bit 9
411#define reg_pinmux_rw_pd_gio___pd10___lsb 10
412#define reg_pinmux_rw_pd_gio___pd10___width 1
413#define reg_pinmux_rw_pd_gio___pd10___bit 10
414#define reg_pinmux_rw_pd_gio___pd11___lsb 11
415#define reg_pinmux_rw_pd_gio___pd11___width 1
416#define reg_pinmux_rw_pd_gio___pd11___bit 11
417#define reg_pinmux_rw_pd_gio___pd12___lsb 12
418#define reg_pinmux_rw_pd_gio___pd12___width 1
419#define reg_pinmux_rw_pd_gio___pd12___bit 12
420#define reg_pinmux_rw_pd_gio___pd13___lsb 13
421#define reg_pinmux_rw_pd_gio___pd13___width 1
422#define reg_pinmux_rw_pd_gio___pd13___bit 13
423#define reg_pinmux_rw_pd_gio___pd14___lsb 14
424#define reg_pinmux_rw_pd_gio___pd14___width 1
425#define reg_pinmux_rw_pd_gio___pd14___bit 14
426#define reg_pinmux_rw_pd_gio___pd15___lsb 15
427#define reg_pinmux_rw_pd_gio___pd15___width 1
428#define reg_pinmux_rw_pd_gio___pd15___bit 15
429#define reg_pinmux_rw_pd_gio___pd16___lsb 16
430#define reg_pinmux_rw_pd_gio___pd16___width 1
431#define reg_pinmux_rw_pd_gio___pd16___bit 16
432#define reg_pinmux_rw_pd_gio___pd17___lsb 17
433#define reg_pinmux_rw_pd_gio___pd17___width 1
434#define reg_pinmux_rw_pd_gio___pd17___bit 17
435#define reg_pinmux_rw_pd_gio_offset 24
436
437/* Register rw_pd_iop, scope pinmux, type rw */
438#define reg_pinmux_rw_pd_iop___pd0___lsb 0
439#define reg_pinmux_rw_pd_iop___pd0___width 1
440#define reg_pinmux_rw_pd_iop___pd0___bit 0
441#define reg_pinmux_rw_pd_iop___pd1___lsb 1
442#define reg_pinmux_rw_pd_iop___pd1___width 1
443#define reg_pinmux_rw_pd_iop___pd1___bit 1
444#define reg_pinmux_rw_pd_iop___pd2___lsb 2
445#define reg_pinmux_rw_pd_iop___pd2___width 1
446#define reg_pinmux_rw_pd_iop___pd2___bit 2
447#define reg_pinmux_rw_pd_iop___pd3___lsb 3
448#define reg_pinmux_rw_pd_iop___pd3___width 1
449#define reg_pinmux_rw_pd_iop___pd3___bit 3
450#define reg_pinmux_rw_pd_iop___pd4___lsb 4
451#define reg_pinmux_rw_pd_iop___pd4___width 1
452#define reg_pinmux_rw_pd_iop___pd4___bit 4
453#define reg_pinmux_rw_pd_iop___pd5___lsb 5
454#define reg_pinmux_rw_pd_iop___pd5___width 1
455#define reg_pinmux_rw_pd_iop___pd5___bit 5
456#define reg_pinmux_rw_pd_iop___pd6___lsb 6
457#define reg_pinmux_rw_pd_iop___pd6___width 1
458#define reg_pinmux_rw_pd_iop___pd6___bit 6
459#define reg_pinmux_rw_pd_iop___pd7___lsb 7
460#define reg_pinmux_rw_pd_iop___pd7___width 1
461#define reg_pinmux_rw_pd_iop___pd7___bit 7
462#define reg_pinmux_rw_pd_iop___pd8___lsb 8
463#define reg_pinmux_rw_pd_iop___pd8___width 1
464#define reg_pinmux_rw_pd_iop___pd8___bit 8
465#define reg_pinmux_rw_pd_iop___pd9___lsb 9
466#define reg_pinmux_rw_pd_iop___pd9___width 1
467#define reg_pinmux_rw_pd_iop___pd9___bit 9
468#define reg_pinmux_rw_pd_iop___pd10___lsb 10
469#define reg_pinmux_rw_pd_iop___pd10___width 1
470#define reg_pinmux_rw_pd_iop___pd10___bit 10
471#define reg_pinmux_rw_pd_iop___pd11___lsb 11
472#define reg_pinmux_rw_pd_iop___pd11___width 1
473#define reg_pinmux_rw_pd_iop___pd11___bit 11
474#define reg_pinmux_rw_pd_iop___pd12___lsb 12
475#define reg_pinmux_rw_pd_iop___pd12___width 1
476#define reg_pinmux_rw_pd_iop___pd12___bit 12
477#define reg_pinmux_rw_pd_iop___pd13___lsb 13
478#define reg_pinmux_rw_pd_iop___pd13___width 1
479#define reg_pinmux_rw_pd_iop___pd13___bit 13
480#define reg_pinmux_rw_pd_iop___pd14___lsb 14
481#define reg_pinmux_rw_pd_iop___pd14___width 1
482#define reg_pinmux_rw_pd_iop___pd14___bit 14
483#define reg_pinmux_rw_pd_iop___pd15___lsb 15
484#define reg_pinmux_rw_pd_iop___pd15___width 1
485#define reg_pinmux_rw_pd_iop___pd15___bit 15
486#define reg_pinmux_rw_pd_iop___pd16___lsb 16
487#define reg_pinmux_rw_pd_iop___pd16___width 1
488#define reg_pinmux_rw_pd_iop___pd16___bit 16
489#define reg_pinmux_rw_pd_iop___pd17___lsb 17
490#define reg_pinmux_rw_pd_iop___pd17___width 1
491#define reg_pinmux_rw_pd_iop___pd17___bit 17
492#define reg_pinmux_rw_pd_iop_offset 28
493
494/* Register rw_pe_gio, scope pinmux, type rw */
495#define reg_pinmux_rw_pe_gio___pe0___lsb 0
496#define reg_pinmux_rw_pe_gio___pe0___width 1
497#define reg_pinmux_rw_pe_gio___pe0___bit 0
498#define reg_pinmux_rw_pe_gio___pe1___lsb 1
499#define reg_pinmux_rw_pe_gio___pe1___width 1
500#define reg_pinmux_rw_pe_gio___pe1___bit 1
501#define reg_pinmux_rw_pe_gio___pe2___lsb 2
502#define reg_pinmux_rw_pe_gio___pe2___width 1
503#define reg_pinmux_rw_pe_gio___pe2___bit 2
504#define reg_pinmux_rw_pe_gio___pe3___lsb 3
505#define reg_pinmux_rw_pe_gio___pe3___width 1
506#define reg_pinmux_rw_pe_gio___pe3___bit 3
507#define reg_pinmux_rw_pe_gio___pe4___lsb 4
508#define reg_pinmux_rw_pe_gio___pe4___width 1
509#define reg_pinmux_rw_pe_gio___pe4___bit 4
510#define reg_pinmux_rw_pe_gio___pe5___lsb 5
511#define reg_pinmux_rw_pe_gio___pe5___width 1
512#define reg_pinmux_rw_pe_gio___pe5___bit 5
513#define reg_pinmux_rw_pe_gio___pe6___lsb 6
514#define reg_pinmux_rw_pe_gio___pe6___width 1
515#define reg_pinmux_rw_pe_gio___pe6___bit 6
516#define reg_pinmux_rw_pe_gio___pe7___lsb 7
517#define reg_pinmux_rw_pe_gio___pe7___width 1
518#define reg_pinmux_rw_pe_gio___pe7___bit 7
519#define reg_pinmux_rw_pe_gio___pe8___lsb 8
520#define reg_pinmux_rw_pe_gio___pe8___width 1
521#define reg_pinmux_rw_pe_gio___pe8___bit 8
522#define reg_pinmux_rw_pe_gio___pe9___lsb 9
523#define reg_pinmux_rw_pe_gio___pe9___width 1
524#define reg_pinmux_rw_pe_gio___pe9___bit 9
525#define reg_pinmux_rw_pe_gio___pe10___lsb 10
526#define reg_pinmux_rw_pe_gio___pe10___width 1
527#define reg_pinmux_rw_pe_gio___pe10___bit 10
528#define reg_pinmux_rw_pe_gio___pe11___lsb 11
529#define reg_pinmux_rw_pe_gio___pe11___width 1
530#define reg_pinmux_rw_pe_gio___pe11___bit 11
531#define reg_pinmux_rw_pe_gio___pe12___lsb 12
532#define reg_pinmux_rw_pe_gio___pe12___width 1
533#define reg_pinmux_rw_pe_gio___pe12___bit 12
534#define reg_pinmux_rw_pe_gio___pe13___lsb 13
535#define reg_pinmux_rw_pe_gio___pe13___width 1
536#define reg_pinmux_rw_pe_gio___pe13___bit 13
537#define reg_pinmux_rw_pe_gio___pe14___lsb 14
538#define reg_pinmux_rw_pe_gio___pe14___width 1
539#define reg_pinmux_rw_pe_gio___pe14___bit 14
540#define reg_pinmux_rw_pe_gio___pe15___lsb 15
541#define reg_pinmux_rw_pe_gio___pe15___width 1
542#define reg_pinmux_rw_pe_gio___pe15___bit 15
543#define reg_pinmux_rw_pe_gio___pe16___lsb 16
544#define reg_pinmux_rw_pe_gio___pe16___width 1
545#define reg_pinmux_rw_pe_gio___pe16___bit 16
546#define reg_pinmux_rw_pe_gio___pe17___lsb 17
547#define reg_pinmux_rw_pe_gio___pe17___width 1
548#define reg_pinmux_rw_pe_gio___pe17___bit 17
549#define reg_pinmux_rw_pe_gio_offset 32
550
551/* Register rw_pe_iop, scope pinmux, type rw */
552#define reg_pinmux_rw_pe_iop___pe0___lsb 0
553#define reg_pinmux_rw_pe_iop___pe0___width 1
554#define reg_pinmux_rw_pe_iop___pe0___bit 0
555#define reg_pinmux_rw_pe_iop___pe1___lsb 1
556#define reg_pinmux_rw_pe_iop___pe1___width 1
557#define reg_pinmux_rw_pe_iop___pe1___bit 1
558#define reg_pinmux_rw_pe_iop___pe2___lsb 2
559#define reg_pinmux_rw_pe_iop___pe2___width 1
560#define reg_pinmux_rw_pe_iop___pe2___bit 2
561#define reg_pinmux_rw_pe_iop___pe3___lsb 3
562#define reg_pinmux_rw_pe_iop___pe3___width 1
563#define reg_pinmux_rw_pe_iop___pe3___bit 3
564#define reg_pinmux_rw_pe_iop___pe4___lsb 4
565#define reg_pinmux_rw_pe_iop___pe4___width 1
566#define reg_pinmux_rw_pe_iop___pe4___bit 4
567#define reg_pinmux_rw_pe_iop___pe5___lsb 5
568#define reg_pinmux_rw_pe_iop___pe5___width 1
569#define reg_pinmux_rw_pe_iop___pe5___bit 5
570#define reg_pinmux_rw_pe_iop___pe6___lsb 6
571#define reg_pinmux_rw_pe_iop___pe6___width 1
572#define reg_pinmux_rw_pe_iop___pe6___bit 6
573#define reg_pinmux_rw_pe_iop___pe7___lsb 7
574#define reg_pinmux_rw_pe_iop___pe7___width 1
575#define reg_pinmux_rw_pe_iop___pe7___bit 7
576#define reg_pinmux_rw_pe_iop___pe8___lsb 8
577#define reg_pinmux_rw_pe_iop___pe8___width 1
578#define reg_pinmux_rw_pe_iop___pe8___bit 8
579#define reg_pinmux_rw_pe_iop___pe9___lsb 9
580#define reg_pinmux_rw_pe_iop___pe9___width 1
581#define reg_pinmux_rw_pe_iop___pe9___bit 9
582#define reg_pinmux_rw_pe_iop___pe10___lsb 10
583#define reg_pinmux_rw_pe_iop___pe10___width 1
584#define reg_pinmux_rw_pe_iop___pe10___bit 10
585#define reg_pinmux_rw_pe_iop___pe11___lsb 11
586#define reg_pinmux_rw_pe_iop___pe11___width 1
587#define reg_pinmux_rw_pe_iop___pe11___bit 11
588#define reg_pinmux_rw_pe_iop___pe12___lsb 12
589#define reg_pinmux_rw_pe_iop___pe12___width 1
590#define reg_pinmux_rw_pe_iop___pe12___bit 12
591#define reg_pinmux_rw_pe_iop___pe13___lsb 13
592#define reg_pinmux_rw_pe_iop___pe13___width 1
593#define reg_pinmux_rw_pe_iop___pe13___bit 13
594#define reg_pinmux_rw_pe_iop___pe14___lsb 14
595#define reg_pinmux_rw_pe_iop___pe14___width 1
596#define reg_pinmux_rw_pe_iop___pe14___bit 14
597#define reg_pinmux_rw_pe_iop___pe15___lsb 15
598#define reg_pinmux_rw_pe_iop___pe15___width 1
599#define reg_pinmux_rw_pe_iop___pe15___bit 15
600#define reg_pinmux_rw_pe_iop___pe16___lsb 16
601#define reg_pinmux_rw_pe_iop___pe16___width 1
602#define reg_pinmux_rw_pe_iop___pe16___bit 16
603#define reg_pinmux_rw_pe_iop___pe17___lsb 17
604#define reg_pinmux_rw_pe_iop___pe17___width 1
605#define reg_pinmux_rw_pe_iop___pe17___bit 17
606#define reg_pinmux_rw_pe_iop_offset 36
607
608/* Register rw_usb_phy, scope pinmux, type rw */
609#define reg_pinmux_rw_usb_phy___en_usb0___lsb 0
610#define reg_pinmux_rw_usb_phy___en_usb0___width 1
611#define reg_pinmux_rw_usb_phy___en_usb0___bit 0
612#define reg_pinmux_rw_usb_phy___en_usb1___lsb 1
613#define reg_pinmux_rw_usb_phy___en_usb1___width 1
614#define reg_pinmux_rw_usb_phy___en_usb1___bit 1
615#define reg_pinmux_rw_usb_phy_offset 40
616
617
618/* Constants */
619#define regk_pinmux_no 0x00000000
620#define regk_pinmux_rw_hwprot_default 0x00000000
621#define regk_pinmux_rw_pa_default 0x00000000
622#define regk_pinmux_rw_pb_gio_default 0x00000000
623#define regk_pinmux_rw_pb_iop_default 0x00000000
624#define regk_pinmux_rw_pc_gio_default 0x00000000
625#define regk_pinmux_rw_pc_iop_default 0x00000000
626#define regk_pinmux_rw_pd_gio_default 0x00000000
627#define regk_pinmux_rw_pd_iop_default 0x00000000
628#define regk_pinmux_rw_pe_gio_default 0x00000000
629#define regk_pinmux_rw_pe_iop_default 0x00000000
630#define regk_pinmux_rw_usb_phy_default 0x00000000
631#define regk_pinmux_yes 0x00000001
632#endif /* __pinmux_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/asm/reg_map_asm.h b/include/asm-cris/arch-v32/mach-fs/hwregs/asm/reg_map_asm.h
new file mode 100644
index 000000000000..87517aebd2cb
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/asm/reg_map_asm.h
@@ -0,0 +1,96 @@
1#ifndef __reg_map_h
2#define __reg_map_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../mod/fakereg.rmap
7 * id: fakereg.rmap,v 1.3 2004/02/11 19:53:22 ronny Exp
8 * last modified: Wed Feb 11 20:53:25 2004
9 * file: ../../rtl/global.rmap
10 * id: global.rmap,v 1.3 2003/08/18 15:08:23 mikaeln Exp
11 * last modified: Mon Aug 18 17:08:23 2003
12 * file: ../../mod/modreg.rmap
13 * id: modreg.rmap,v 1.31 2004/02/20 15:40:04 stefans Exp
14 * last modified: Fri Feb 20 16:40:04 2004
15 *
16 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/reg_map_asm.h -base 0xb0000000 ../../rtl/global.rmap ../../mod/modreg.rmap ../../inst/memarb/rtl/guinness/marb_top.r ../../mod/fakereg.rmap
17 * id: $Id: reg_map_asm.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
18 * Any changes here will be lost.
19 *
20 * -*- buffer-read-only: t -*-
21 */
22#define regi_artpec_mod 0xb7044000
23#define regi_ata 0xb0032000
24#define regi_ata_mod 0xb7006000
25#define regi_barber 0xb701a000
26#define regi_bif_core 0xb0014000
27#define regi_bif_dma 0xb0016000
28#define regi_bif_slave 0xb0018000
29#define regi_bif_slave_ext 0xac000000
30#define regi_bus_master 0xb703c000
31#define regi_config 0xb003c000
32#define regi_dma0 0xb0000000
33#define regi_dma1 0xb0002000
34#define regi_dma2 0xb0004000
35#define regi_dma3 0xb0006000
36#define regi_dma4 0xb0008000
37#define regi_dma5 0xb000a000
38#define regi_dma6 0xb000c000
39#define regi_dma7 0xb000e000
40#define regi_dma8 0xb0010000
41#define regi_dma9 0xb0012000
42#define regi_eth0 0xb0034000
43#define regi_eth1 0xb0036000
44#define regi_eth_mod 0xb7004000
45#define regi_eth_mod1 0xb701c000
46#define regi_eth_strmod 0xb7008000
47#define regi_eth_strmod1 0xb7032000
48#define regi_ext_dma 0xb703a000
49#define regi_ext_mem 0xb7046000
50#define regi_gen_io 0xb7016000
51#define regi_gio 0xb001a000
52#define regi_hook 0xb7000000
53#define regi_iop 0xb0020000
54#define regi_irq 0xb001c000
55#define regi_irq_nmi 0xb701e000
56#define regi_marb 0xb003e000
57#define regi_marb_bp0 0xb003e240
58#define regi_marb_bp1 0xb003e280
59#define regi_marb_bp2 0xb003e2c0
60#define regi_marb_bp3 0xb003e300
61#define regi_nand_mod 0xb7014000
62#define regi_p21 0xb002e000
63#define regi_p21_mod 0xb7042000
64#define regi_pci_mod 0xb7010000
65#define regi_pin_test 0xb7018000
66#define regi_pinmux 0xb0038000
67#define regi_sdram_chk 0xb703e000
68#define regi_sdram_mod 0xb7012000
69#define regi_ser0 0xb0026000
70#define regi_ser1 0xb0028000
71#define regi_ser2 0xb002a000
72#define regi_ser3 0xb002c000
73#define regi_ser_mod0 0xb7020000
74#define regi_ser_mod1 0xb7022000
75#define regi_ser_mod2 0xb7024000
76#define regi_ser_mod3 0xb7026000
77#define regi_smif_stat 0xb700e000
78#define regi_sser0 0xb0022000
79#define regi_sser1 0xb0024000
80#define regi_sser_mod0 0xb700a000
81#define regi_sser_mod1 0xb700c000
82#define regi_strcop 0xb0030000
83#define regi_strmux 0xb003a000
84#define regi_strmux_tst 0xb7040000
85#define regi_tap 0xb7002000
86#define regi_timer 0xb001e000
87#define regi_timer_mod 0xb7034000
88#define regi_trace 0xb0040000
89#define regi_usb0 0xb7028000
90#define regi_usb1 0xb702a000
91#define regi_usb2 0xb702c000
92#define regi_usb3 0xb702e000
93#define regi_usb_dev 0xb7030000
94#define regi_utmi_mod0 0xb7036000
95#define regi_utmi_mod1 0xb7038000
96#endif /* __reg_map_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/asm/timer_defs_asm.h b/include/asm-cris/arch-v32/mach-fs/hwregs/asm/timer_defs_asm.h
new file mode 100644
index 000000000000..e1197194d5c1
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/asm/timer_defs_asm.h
@@ -0,0 +1,229 @@
1#ifndef __timer_defs_asm_h
2#define __timer_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/timer/rtl/timer_regs.r
7 * id: timer_regs.r,v 1.7 2003/03/11 11:16:59 perz Exp
8 * last modfied: Mon Apr 11 16:09:53 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/timer_defs_asm.h ../../inst/timer/rtl/timer_regs.r
11 * id: $Id: timer_defs_asm.h,v 1.1 2007/04/11 13:51:01 ricardw Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_tmr0_div, scope timer, type rw */
57#define reg_timer_rw_tmr0_div_offset 0
58
59/* Register r_tmr0_data, scope timer, type r */
60#define reg_timer_r_tmr0_data_offset 4
61
62/* Register rw_tmr0_ctrl, scope timer, type rw */
63#define reg_timer_rw_tmr0_ctrl___op___lsb 0
64#define reg_timer_rw_tmr0_ctrl___op___width 2
65#define reg_timer_rw_tmr0_ctrl___freq___lsb 2
66#define reg_timer_rw_tmr0_ctrl___freq___width 3
67#define reg_timer_rw_tmr0_ctrl_offset 8
68
69/* Register rw_tmr1_div, scope timer, type rw */
70#define reg_timer_rw_tmr1_div_offset 16
71
72/* Register r_tmr1_data, scope timer, type r */
73#define reg_timer_r_tmr1_data_offset 20
74
75/* Register rw_tmr1_ctrl, scope timer, type rw */
76#define reg_timer_rw_tmr1_ctrl___op___lsb 0
77#define reg_timer_rw_tmr1_ctrl___op___width 2
78#define reg_timer_rw_tmr1_ctrl___freq___lsb 2
79#define reg_timer_rw_tmr1_ctrl___freq___width 3
80#define reg_timer_rw_tmr1_ctrl_offset 24
81
82/* Register rs_cnt_data, scope timer, type rs */
83#define reg_timer_rs_cnt_data___tmr___lsb 0
84#define reg_timer_rs_cnt_data___tmr___width 24
85#define reg_timer_rs_cnt_data___cnt___lsb 24
86#define reg_timer_rs_cnt_data___cnt___width 8
87#define reg_timer_rs_cnt_data_offset 32
88
89/* Register r_cnt_data, scope timer, type r */
90#define reg_timer_r_cnt_data___tmr___lsb 0
91#define reg_timer_r_cnt_data___tmr___width 24
92#define reg_timer_r_cnt_data___cnt___lsb 24
93#define reg_timer_r_cnt_data___cnt___width 8
94#define reg_timer_r_cnt_data_offset 36
95
96/* Register rw_cnt_cfg, scope timer, type rw */
97#define reg_timer_rw_cnt_cfg___clk___lsb 0
98#define reg_timer_rw_cnt_cfg___clk___width 2
99#define reg_timer_rw_cnt_cfg_offset 40
100
101/* Register rw_trig, scope timer, type rw */
102#define reg_timer_rw_trig_offset 48
103
104/* Register rw_trig_cfg, scope timer, type rw */
105#define reg_timer_rw_trig_cfg___tmr___lsb 0
106#define reg_timer_rw_trig_cfg___tmr___width 2
107#define reg_timer_rw_trig_cfg_offset 52
108
109/* Register r_time, scope timer, type r */
110#define reg_timer_r_time_offset 56
111
112/* Register rw_out, scope timer, type rw */
113#define reg_timer_rw_out___tmr___lsb 0
114#define reg_timer_rw_out___tmr___width 2
115#define reg_timer_rw_out_offset 60
116
117/* Register rw_wd_ctrl, scope timer, type rw */
118#define reg_timer_rw_wd_ctrl___cnt___lsb 0
119#define reg_timer_rw_wd_ctrl___cnt___width 8
120#define reg_timer_rw_wd_ctrl___cmd___lsb 8
121#define reg_timer_rw_wd_ctrl___cmd___width 1
122#define reg_timer_rw_wd_ctrl___cmd___bit 8
123#define reg_timer_rw_wd_ctrl___key___lsb 9
124#define reg_timer_rw_wd_ctrl___key___width 7
125#define reg_timer_rw_wd_ctrl_offset 64
126
127/* Register r_wd_stat, scope timer, type r */
128#define reg_timer_r_wd_stat___cnt___lsb 0
129#define reg_timer_r_wd_stat___cnt___width 8
130#define reg_timer_r_wd_stat___cmd___lsb 8
131#define reg_timer_r_wd_stat___cmd___width 1
132#define reg_timer_r_wd_stat___cmd___bit 8
133#define reg_timer_r_wd_stat_offset 68
134
135/* Register rw_intr_mask, scope timer, type rw */
136#define reg_timer_rw_intr_mask___tmr0___lsb 0
137#define reg_timer_rw_intr_mask___tmr0___width 1
138#define reg_timer_rw_intr_mask___tmr0___bit 0
139#define reg_timer_rw_intr_mask___tmr1___lsb 1
140#define reg_timer_rw_intr_mask___tmr1___width 1
141#define reg_timer_rw_intr_mask___tmr1___bit 1
142#define reg_timer_rw_intr_mask___cnt___lsb 2
143#define reg_timer_rw_intr_mask___cnt___width 1
144#define reg_timer_rw_intr_mask___cnt___bit 2
145#define reg_timer_rw_intr_mask___trig___lsb 3
146#define reg_timer_rw_intr_mask___trig___width 1
147#define reg_timer_rw_intr_mask___trig___bit 3
148#define reg_timer_rw_intr_mask_offset 72
149
150/* Register rw_ack_intr, scope timer, type rw */
151#define reg_timer_rw_ack_intr___tmr0___lsb 0
152#define reg_timer_rw_ack_intr___tmr0___width 1
153#define reg_timer_rw_ack_intr___tmr0___bit 0
154#define reg_timer_rw_ack_intr___tmr1___lsb 1
155#define reg_timer_rw_ack_intr___tmr1___width 1
156#define reg_timer_rw_ack_intr___tmr1___bit 1
157#define reg_timer_rw_ack_intr___cnt___lsb 2
158#define reg_timer_rw_ack_intr___cnt___width 1
159#define reg_timer_rw_ack_intr___cnt___bit 2
160#define reg_timer_rw_ack_intr___trig___lsb 3
161#define reg_timer_rw_ack_intr___trig___width 1
162#define reg_timer_rw_ack_intr___trig___bit 3
163#define reg_timer_rw_ack_intr_offset 76
164
165/* Register r_intr, scope timer, type r */
166#define reg_timer_r_intr___tmr0___lsb 0
167#define reg_timer_r_intr___tmr0___width 1
168#define reg_timer_r_intr___tmr0___bit 0
169#define reg_timer_r_intr___tmr1___lsb 1
170#define reg_timer_r_intr___tmr1___width 1
171#define reg_timer_r_intr___tmr1___bit 1
172#define reg_timer_r_intr___cnt___lsb 2
173#define reg_timer_r_intr___cnt___width 1
174#define reg_timer_r_intr___cnt___bit 2
175#define reg_timer_r_intr___trig___lsb 3
176#define reg_timer_r_intr___trig___width 1
177#define reg_timer_r_intr___trig___bit 3
178#define reg_timer_r_intr_offset 80
179
180/* Register r_masked_intr, scope timer, type r */
181#define reg_timer_r_masked_intr___tmr0___lsb 0
182#define reg_timer_r_masked_intr___tmr0___width 1
183#define reg_timer_r_masked_intr___tmr0___bit 0
184#define reg_timer_r_masked_intr___tmr1___lsb 1
185#define reg_timer_r_masked_intr___tmr1___width 1
186#define reg_timer_r_masked_intr___tmr1___bit 1
187#define reg_timer_r_masked_intr___cnt___lsb 2
188#define reg_timer_r_masked_intr___cnt___width 1
189#define reg_timer_r_masked_intr___cnt___bit 2
190#define reg_timer_r_masked_intr___trig___lsb 3
191#define reg_timer_r_masked_intr___trig___width 1
192#define reg_timer_r_masked_intr___trig___bit 3
193#define reg_timer_r_masked_intr_offset 84
194
195/* Register rw_test, scope timer, type rw */
196#define reg_timer_rw_test___dis___lsb 0
197#define reg_timer_rw_test___dis___width 1
198#define reg_timer_rw_test___dis___bit 0
199#define reg_timer_rw_test___en___lsb 1
200#define reg_timer_rw_test___en___width 1
201#define reg_timer_rw_test___en___bit 1
202#define reg_timer_rw_test_offset 88
203
204
205/* Constants */
206#define regk_timer_ext 0x00000001
207#define regk_timer_f100 0x00000007
208#define regk_timer_f29_493 0x00000004
209#define regk_timer_f32 0x00000005
210#define regk_timer_f32_768 0x00000006
211#define regk_timer_hold 0x00000001
212#define regk_timer_ld 0x00000000
213#define regk_timer_no 0x00000000
214#define regk_timer_off 0x00000000
215#define regk_timer_run 0x00000002
216#define regk_timer_rw_cnt_cfg_default 0x00000000
217#define regk_timer_rw_intr_mask_default 0x00000000
218#define regk_timer_rw_out_default 0x00000000
219#define regk_timer_rw_test_default 0x00000000
220#define regk_timer_rw_tmr0_ctrl_default 0x00000000
221#define regk_timer_rw_tmr1_ctrl_default 0x00000000
222#define regk_timer_rw_trig_cfg_default 0x00000000
223#define regk_timer_start 0x00000001
224#define regk_timer_stop 0x00000000
225#define regk_timer_time 0x00000001
226#define regk_timer_tmr0 0x00000002
227#define regk_timer_tmr1 0x00000003
228#define regk_timer_yes 0x00000001
229#endif /* __timer_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/bif_core_defs.h b/include/asm-cris/arch-v32/mach-fs/hwregs/bif_core_defs.h
new file mode 100644
index 000000000000..44362a62b47c
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/bif_core_defs.h
@@ -0,0 +1,284 @@
1#ifndef __bif_core_defs_h
2#define __bif_core_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/bif/rtl/bif_core_regs.r
7 * id: bif_core_regs.r,v 1.17 2005/02/04 13:28:22 np Exp
8 * last modfied: Mon Apr 11 16:06:33 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile bif_core_defs.h ../../inst/bif/rtl/bif_core_regs.r
11 * id: $Id: bif_core_defs.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope bif_core */
86
87/* Register rw_grp1_cfg, scope bif_core, type rw */
88typedef struct {
89 unsigned int lw : 6;
90 unsigned int ew : 3;
91 unsigned int zw : 3;
92 unsigned int aw : 2;
93 unsigned int dw : 2;
94 unsigned int ewb : 2;
95 unsigned int bw : 1;
96 unsigned int wr_extend : 1;
97 unsigned int erc_en : 1;
98 unsigned int mode : 1;
99 unsigned int dummy1 : 10;
100} reg_bif_core_rw_grp1_cfg;
101#define REG_RD_ADDR_bif_core_rw_grp1_cfg 0
102#define REG_WR_ADDR_bif_core_rw_grp1_cfg 0
103
104/* Register rw_grp2_cfg, scope bif_core, type rw */
105typedef struct {
106 unsigned int lw : 6;
107 unsigned int ew : 3;
108 unsigned int zw : 3;
109 unsigned int aw : 2;
110 unsigned int dw : 2;
111 unsigned int ewb : 2;
112 unsigned int bw : 1;
113 unsigned int wr_extend : 1;
114 unsigned int erc_en : 1;
115 unsigned int mode : 1;
116 unsigned int dummy1 : 10;
117} reg_bif_core_rw_grp2_cfg;
118#define REG_RD_ADDR_bif_core_rw_grp2_cfg 4
119#define REG_WR_ADDR_bif_core_rw_grp2_cfg 4
120
121/* Register rw_grp3_cfg, scope bif_core, type rw */
122typedef struct {
123 unsigned int lw : 6;
124 unsigned int ew : 3;
125 unsigned int zw : 3;
126 unsigned int aw : 2;
127 unsigned int dw : 2;
128 unsigned int ewb : 2;
129 unsigned int bw : 1;
130 unsigned int wr_extend : 1;
131 unsigned int erc_en : 1;
132 unsigned int mode : 1;
133 unsigned int dummy1 : 2;
134 unsigned int gated_csp0 : 2;
135 unsigned int gated_csp1 : 2;
136 unsigned int gated_csp2 : 2;
137 unsigned int gated_csp3 : 2;
138} reg_bif_core_rw_grp3_cfg;
139#define REG_RD_ADDR_bif_core_rw_grp3_cfg 8
140#define REG_WR_ADDR_bif_core_rw_grp3_cfg 8
141
142/* Register rw_grp4_cfg, scope bif_core, type rw */
143typedef struct {
144 unsigned int lw : 6;
145 unsigned int ew : 3;
146 unsigned int zw : 3;
147 unsigned int aw : 2;
148 unsigned int dw : 2;
149 unsigned int ewb : 2;
150 unsigned int bw : 1;
151 unsigned int wr_extend : 1;
152 unsigned int erc_en : 1;
153 unsigned int mode : 1;
154 unsigned int dummy1 : 4;
155 unsigned int gated_csp4 : 2;
156 unsigned int gated_csp5 : 2;
157 unsigned int gated_csp6 : 2;
158} reg_bif_core_rw_grp4_cfg;
159#define REG_RD_ADDR_bif_core_rw_grp4_cfg 12
160#define REG_WR_ADDR_bif_core_rw_grp4_cfg 12
161
162/* Register rw_sdram_cfg_grp0, scope bif_core, type rw */
163typedef struct {
164 unsigned int bank_sel : 5;
165 unsigned int ca : 3;
166 unsigned int type : 1;
167 unsigned int bw : 1;
168 unsigned int sh : 3;
169 unsigned int wmm : 1;
170 unsigned int sh16 : 1;
171 unsigned int grp_sel : 5;
172 unsigned int dummy1 : 12;
173} reg_bif_core_rw_sdram_cfg_grp0;
174#define REG_RD_ADDR_bif_core_rw_sdram_cfg_grp0 16
175#define REG_WR_ADDR_bif_core_rw_sdram_cfg_grp0 16
176
177/* Register rw_sdram_cfg_grp1, scope bif_core, type rw */
178typedef struct {
179 unsigned int bank_sel : 5;
180 unsigned int ca : 3;
181 unsigned int type : 1;
182 unsigned int bw : 1;
183 unsigned int sh : 3;
184 unsigned int wmm : 1;
185 unsigned int sh16 : 1;
186 unsigned int dummy1 : 17;
187} reg_bif_core_rw_sdram_cfg_grp1;
188#define REG_RD_ADDR_bif_core_rw_sdram_cfg_grp1 20
189#define REG_WR_ADDR_bif_core_rw_sdram_cfg_grp1 20
190
191/* Register rw_sdram_timing, scope bif_core, type rw */
192typedef struct {
193 unsigned int cl : 3;
194 unsigned int rcd : 3;
195 unsigned int rp : 3;
196 unsigned int rc : 2;
197 unsigned int dpl : 2;
198 unsigned int pde : 1;
199 unsigned int ref : 2;
200 unsigned int cpd : 1;
201 unsigned int sdcke : 1;
202 unsigned int sdclk : 1;
203 unsigned int dummy1 : 13;
204} reg_bif_core_rw_sdram_timing;
205#define REG_RD_ADDR_bif_core_rw_sdram_timing 24
206#define REG_WR_ADDR_bif_core_rw_sdram_timing 24
207
208/* Register rw_sdram_cmd, scope bif_core, type rw */
209typedef struct {
210 unsigned int cmd : 3;
211 unsigned int mrs_data : 15;
212 unsigned int dummy1 : 14;
213} reg_bif_core_rw_sdram_cmd;
214#define REG_RD_ADDR_bif_core_rw_sdram_cmd 28
215#define REG_WR_ADDR_bif_core_rw_sdram_cmd 28
216
217/* Register rs_sdram_ref_stat, scope bif_core, type rs */
218typedef struct {
219 unsigned int ok : 1;
220 unsigned int dummy1 : 31;
221} reg_bif_core_rs_sdram_ref_stat;
222#define REG_RD_ADDR_bif_core_rs_sdram_ref_stat 32
223
224/* Register r_sdram_ref_stat, scope bif_core, type r */
225typedef struct {
226 unsigned int ok : 1;
227 unsigned int dummy1 : 31;
228} reg_bif_core_r_sdram_ref_stat;
229#define REG_RD_ADDR_bif_core_r_sdram_ref_stat 36
230
231
232/* Constants */
233enum {
234 regk_bif_core_bank2 = 0x00000000,
235 regk_bif_core_bank4 = 0x00000001,
236 regk_bif_core_bit10 = 0x0000000a,
237 regk_bif_core_bit11 = 0x0000000b,
238 regk_bif_core_bit12 = 0x0000000c,
239 regk_bif_core_bit13 = 0x0000000d,
240 regk_bif_core_bit14 = 0x0000000e,
241 regk_bif_core_bit15 = 0x0000000f,
242 regk_bif_core_bit16 = 0x00000010,
243 regk_bif_core_bit17 = 0x00000011,
244 regk_bif_core_bit18 = 0x00000012,
245 regk_bif_core_bit19 = 0x00000013,
246 regk_bif_core_bit20 = 0x00000014,
247 regk_bif_core_bit21 = 0x00000015,
248 regk_bif_core_bit22 = 0x00000016,
249 regk_bif_core_bit23 = 0x00000017,
250 regk_bif_core_bit24 = 0x00000018,
251 regk_bif_core_bit25 = 0x00000019,
252 regk_bif_core_bit26 = 0x0000001a,
253 regk_bif_core_bit27 = 0x0000001b,
254 regk_bif_core_bit28 = 0x0000001c,
255 regk_bif_core_bit29 = 0x0000001d,
256 regk_bif_core_bit9 = 0x00000009,
257 regk_bif_core_bw16 = 0x00000001,
258 regk_bif_core_bw32 = 0x00000000,
259 regk_bif_core_bwe = 0x00000000,
260 regk_bif_core_cwe = 0x00000001,
261 regk_bif_core_e15us = 0x00000001,
262 regk_bif_core_e7800ns = 0x00000002,
263 regk_bif_core_grp0 = 0x00000000,
264 regk_bif_core_grp1 = 0x00000001,
265 regk_bif_core_mrs = 0x00000003,
266 regk_bif_core_no = 0x00000000,
267 regk_bif_core_none = 0x00000000,
268 regk_bif_core_nop = 0x00000000,
269 regk_bif_core_off = 0x00000000,
270 regk_bif_core_pre = 0x00000002,
271 regk_bif_core_r_sdram_ref_stat_default = 0x00000001,
272 regk_bif_core_rd = 0x00000002,
273 regk_bif_core_ref = 0x00000001,
274 regk_bif_core_rs_sdram_ref_stat_default = 0x00000001,
275 regk_bif_core_rw_grp1_cfg_default = 0x000006cf,
276 regk_bif_core_rw_grp2_cfg_default = 0x000006cf,
277 regk_bif_core_rw_grp3_cfg_default = 0x000006cf,
278 regk_bif_core_rw_grp4_cfg_default = 0x000006cf,
279 regk_bif_core_rw_sdram_cfg_grp1_default = 0x00000000,
280 regk_bif_core_slf = 0x00000004,
281 regk_bif_core_wr = 0x00000001,
282 regk_bif_core_yes = 0x00000001
283};
284#endif /* __bif_core_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/bif_dma_defs.h b/include/asm-cris/arch-v32/mach-fs/hwregs/bif_dma_defs.h
new file mode 100644
index 000000000000..3cb51a09dba7
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/bif_dma_defs.h
@@ -0,0 +1,473 @@
1#ifndef __bif_dma_defs_h
2#define __bif_dma_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/bif/rtl/bif_dma_regs.r
7 * id: bif_dma_regs.r,v 1.6 2005/02/04 13:28:31 perz Exp
8 * last modfied: Mon Apr 11 16:06:33 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile bif_dma_defs.h ../../inst/bif/rtl/bif_dma_regs.r
11 * id: $Id: bif_dma_defs.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope bif_dma */
86
87/* Register rw_ch0_ctrl, scope bif_dma, type rw */
88typedef struct {
89 unsigned int bw : 2;
90 unsigned int burst_len : 1;
91 unsigned int cont : 1;
92 unsigned int end_pad : 1;
93 unsigned int cnt : 1;
94 unsigned int dreq_pin : 3;
95 unsigned int dreq_mode : 2;
96 unsigned int tc_in_pin : 3;
97 unsigned int tc_in_mode : 2;
98 unsigned int bus_mode : 2;
99 unsigned int rate_en : 1;
100 unsigned int wr_all : 1;
101 unsigned int dummy1 : 12;
102} reg_bif_dma_rw_ch0_ctrl;
103#define REG_RD_ADDR_bif_dma_rw_ch0_ctrl 0
104#define REG_WR_ADDR_bif_dma_rw_ch0_ctrl 0
105
106/* Register rw_ch0_addr, scope bif_dma, type rw */
107typedef struct {
108 unsigned int addr : 32;
109} reg_bif_dma_rw_ch0_addr;
110#define REG_RD_ADDR_bif_dma_rw_ch0_addr 4
111#define REG_WR_ADDR_bif_dma_rw_ch0_addr 4
112
113/* Register rw_ch0_start, scope bif_dma, type rw */
114typedef struct {
115 unsigned int run : 1;
116 unsigned int dummy1 : 31;
117} reg_bif_dma_rw_ch0_start;
118#define REG_RD_ADDR_bif_dma_rw_ch0_start 8
119#define REG_WR_ADDR_bif_dma_rw_ch0_start 8
120
121/* Register rw_ch0_cnt, scope bif_dma, type rw */
122typedef struct {
123 unsigned int start_cnt : 16;
124 unsigned int dummy1 : 16;
125} reg_bif_dma_rw_ch0_cnt;
126#define REG_RD_ADDR_bif_dma_rw_ch0_cnt 12
127#define REG_WR_ADDR_bif_dma_rw_ch0_cnt 12
128
129/* Register r_ch0_stat, scope bif_dma, type r */
130typedef struct {
131 unsigned int cnt : 16;
132 unsigned int dummy1 : 15;
133 unsigned int run : 1;
134} reg_bif_dma_r_ch0_stat;
135#define REG_RD_ADDR_bif_dma_r_ch0_stat 16
136
137/* Register rw_ch1_ctrl, scope bif_dma, type rw */
138typedef struct {
139 unsigned int bw : 2;
140 unsigned int burst_len : 1;
141 unsigned int cont : 1;
142 unsigned int end_discard : 1;
143 unsigned int cnt : 1;
144 unsigned int dreq_pin : 3;
145 unsigned int dreq_mode : 2;
146 unsigned int tc_in_pin : 3;
147 unsigned int tc_in_mode : 2;
148 unsigned int bus_mode : 2;
149 unsigned int rate_en : 1;
150 unsigned int dummy1 : 13;
151} reg_bif_dma_rw_ch1_ctrl;
152#define REG_RD_ADDR_bif_dma_rw_ch1_ctrl 32
153#define REG_WR_ADDR_bif_dma_rw_ch1_ctrl 32
154
155/* Register rw_ch1_addr, scope bif_dma, type rw */
156typedef struct {
157 unsigned int addr : 32;
158} reg_bif_dma_rw_ch1_addr;
159#define REG_RD_ADDR_bif_dma_rw_ch1_addr 36
160#define REG_WR_ADDR_bif_dma_rw_ch1_addr 36
161
162/* Register rw_ch1_start, scope bif_dma, type rw */
163typedef struct {
164 unsigned int run : 1;
165 unsigned int dummy1 : 31;
166} reg_bif_dma_rw_ch1_start;
167#define REG_RD_ADDR_bif_dma_rw_ch1_start 40
168#define REG_WR_ADDR_bif_dma_rw_ch1_start 40
169
170/* Register rw_ch1_cnt, scope bif_dma, type rw */
171typedef struct {
172 unsigned int start_cnt : 16;
173 unsigned int dummy1 : 16;
174} reg_bif_dma_rw_ch1_cnt;
175#define REG_RD_ADDR_bif_dma_rw_ch1_cnt 44
176#define REG_WR_ADDR_bif_dma_rw_ch1_cnt 44
177
178/* Register r_ch1_stat, scope bif_dma, type r */
179typedef struct {
180 unsigned int cnt : 16;
181 unsigned int dummy1 : 15;
182 unsigned int run : 1;
183} reg_bif_dma_r_ch1_stat;
184#define REG_RD_ADDR_bif_dma_r_ch1_stat 48
185
186/* Register rw_ch2_ctrl, scope bif_dma, type rw */
187typedef struct {
188 unsigned int bw : 2;
189 unsigned int burst_len : 1;
190 unsigned int cont : 1;
191 unsigned int end_pad : 1;
192 unsigned int cnt : 1;
193 unsigned int dreq_pin : 3;
194 unsigned int dreq_mode : 2;
195 unsigned int tc_in_pin : 3;
196 unsigned int tc_in_mode : 2;
197 unsigned int bus_mode : 2;
198 unsigned int rate_en : 1;
199 unsigned int wr_all : 1;
200 unsigned int dummy1 : 12;
201} reg_bif_dma_rw_ch2_ctrl;
202#define REG_RD_ADDR_bif_dma_rw_ch2_ctrl 64
203#define REG_WR_ADDR_bif_dma_rw_ch2_ctrl 64
204
205/* Register rw_ch2_addr, scope bif_dma, type rw */
206typedef struct {
207 unsigned int addr : 32;
208} reg_bif_dma_rw_ch2_addr;
209#define REG_RD_ADDR_bif_dma_rw_ch2_addr 68
210#define REG_WR_ADDR_bif_dma_rw_ch2_addr 68
211
212/* Register rw_ch2_start, scope bif_dma, type rw */
213typedef struct {
214 unsigned int run : 1;
215 unsigned int dummy1 : 31;
216} reg_bif_dma_rw_ch2_start;
217#define REG_RD_ADDR_bif_dma_rw_ch2_start 72
218#define REG_WR_ADDR_bif_dma_rw_ch2_start 72
219
220/* Register rw_ch2_cnt, scope bif_dma, type rw */
221typedef struct {
222 unsigned int start_cnt : 16;
223 unsigned int dummy1 : 16;
224} reg_bif_dma_rw_ch2_cnt;
225#define REG_RD_ADDR_bif_dma_rw_ch2_cnt 76
226#define REG_WR_ADDR_bif_dma_rw_ch2_cnt 76
227
228/* Register r_ch2_stat, scope bif_dma, type r */
229typedef struct {
230 unsigned int cnt : 16;
231 unsigned int dummy1 : 15;
232 unsigned int run : 1;
233} reg_bif_dma_r_ch2_stat;
234#define REG_RD_ADDR_bif_dma_r_ch2_stat 80
235
236/* Register rw_ch3_ctrl, scope bif_dma, type rw */
237typedef struct {
238 unsigned int bw : 2;
239 unsigned int burst_len : 1;
240 unsigned int cont : 1;
241 unsigned int end_discard : 1;
242 unsigned int cnt : 1;
243 unsigned int dreq_pin : 3;
244 unsigned int dreq_mode : 2;
245 unsigned int tc_in_pin : 3;
246 unsigned int tc_in_mode : 2;
247 unsigned int bus_mode : 2;
248 unsigned int rate_en : 1;
249 unsigned int dummy1 : 13;
250} reg_bif_dma_rw_ch3_ctrl;
251#define REG_RD_ADDR_bif_dma_rw_ch3_ctrl 96
252#define REG_WR_ADDR_bif_dma_rw_ch3_ctrl 96
253
254/* Register rw_ch3_addr, scope bif_dma, type rw */
255typedef struct {
256 unsigned int addr : 32;
257} reg_bif_dma_rw_ch3_addr;
258#define REG_RD_ADDR_bif_dma_rw_ch3_addr 100
259#define REG_WR_ADDR_bif_dma_rw_ch3_addr 100
260
261/* Register rw_ch3_start, scope bif_dma, type rw */
262typedef struct {
263 unsigned int run : 1;
264 unsigned int dummy1 : 31;
265} reg_bif_dma_rw_ch3_start;
266#define REG_RD_ADDR_bif_dma_rw_ch3_start 104
267#define REG_WR_ADDR_bif_dma_rw_ch3_start 104
268
269/* Register rw_ch3_cnt, scope bif_dma, type rw */
270typedef struct {
271 unsigned int start_cnt : 16;
272 unsigned int dummy1 : 16;
273} reg_bif_dma_rw_ch3_cnt;
274#define REG_RD_ADDR_bif_dma_rw_ch3_cnt 108
275#define REG_WR_ADDR_bif_dma_rw_ch3_cnt 108
276
277/* Register r_ch3_stat, scope bif_dma, type r */
278typedef struct {
279 unsigned int cnt : 16;
280 unsigned int dummy1 : 15;
281 unsigned int run : 1;
282} reg_bif_dma_r_ch3_stat;
283#define REG_RD_ADDR_bif_dma_r_ch3_stat 112
284
285/* Register rw_intr_mask, scope bif_dma, type rw */
286typedef struct {
287 unsigned int ext_dma0 : 1;
288 unsigned int ext_dma1 : 1;
289 unsigned int ext_dma2 : 1;
290 unsigned int ext_dma3 : 1;
291 unsigned int dummy1 : 28;
292} reg_bif_dma_rw_intr_mask;
293#define REG_RD_ADDR_bif_dma_rw_intr_mask 128
294#define REG_WR_ADDR_bif_dma_rw_intr_mask 128
295
296/* Register rw_ack_intr, scope bif_dma, type rw */
297typedef struct {
298 unsigned int ext_dma0 : 1;
299 unsigned int ext_dma1 : 1;
300 unsigned int ext_dma2 : 1;
301 unsigned int ext_dma3 : 1;
302 unsigned int dummy1 : 28;
303} reg_bif_dma_rw_ack_intr;
304#define REG_RD_ADDR_bif_dma_rw_ack_intr 132
305#define REG_WR_ADDR_bif_dma_rw_ack_intr 132
306
307/* Register r_intr, scope bif_dma, type r */
308typedef struct {
309 unsigned int ext_dma0 : 1;
310 unsigned int ext_dma1 : 1;
311 unsigned int ext_dma2 : 1;
312 unsigned int ext_dma3 : 1;
313 unsigned int dummy1 : 28;
314} reg_bif_dma_r_intr;
315#define REG_RD_ADDR_bif_dma_r_intr 136
316
317/* Register r_masked_intr, scope bif_dma, type r */
318typedef struct {
319 unsigned int ext_dma0 : 1;
320 unsigned int ext_dma1 : 1;
321 unsigned int ext_dma2 : 1;
322 unsigned int ext_dma3 : 1;
323 unsigned int dummy1 : 28;
324} reg_bif_dma_r_masked_intr;
325#define REG_RD_ADDR_bif_dma_r_masked_intr 140
326
327/* Register rw_pin0_cfg, scope bif_dma, type rw */
328typedef struct {
329 unsigned int master_ch : 2;
330 unsigned int master_mode : 3;
331 unsigned int slave_ch : 2;
332 unsigned int slave_mode : 3;
333 unsigned int dummy1 : 22;
334} reg_bif_dma_rw_pin0_cfg;
335#define REG_RD_ADDR_bif_dma_rw_pin0_cfg 160
336#define REG_WR_ADDR_bif_dma_rw_pin0_cfg 160
337
338/* Register rw_pin1_cfg, scope bif_dma, type rw */
339typedef struct {
340 unsigned int master_ch : 2;
341 unsigned int master_mode : 3;
342 unsigned int slave_ch : 2;
343 unsigned int slave_mode : 3;
344 unsigned int dummy1 : 22;
345} reg_bif_dma_rw_pin1_cfg;
346#define REG_RD_ADDR_bif_dma_rw_pin1_cfg 164
347#define REG_WR_ADDR_bif_dma_rw_pin1_cfg 164
348
349/* Register rw_pin2_cfg, scope bif_dma, type rw */
350typedef struct {
351 unsigned int master_ch : 2;
352 unsigned int master_mode : 3;
353 unsigned int slave_ch : 2;
354 unsigned int slave_mode : 3;
355 unsigned int dummy1 : 22;
356} reg_bif_dma_rw_pin2_cfg;
357#define REG_RD_ADDR_bif_dma_rw_pin2_cfg 168
358#define REG_WR_ADDR_bif_dma_rw_pin2_cfg 168
359
360/* Register rw_pin3_cfg, scope bif_dma, type rw */
361typedef struct {
362 unsigned int master_ch : 2;
363 unsigned int master_mode : 3;
364 unsigned int slave_ch : 2;
365 unsigned int slave_mode : 3;
366 unsigned int dummy1 : 22;
367} reg_bif_dma_rw_pin3_cfg;
368#define REG_RD_ADDR_bif_dma_rw_pin3_cfg 172
369#define REG_WR_ADDR_bif_dma_rw_pin3_cfg 172
370
371/* Register rw_pin4_cfg, scope bif_dma, type rw */
372typedef struct {
373 unsigned int master_ch : 2;
374 unsigned int master_mode : 3;
375 unsigned int slave_ch : 2;
376 unsigned int slave_mode : 3;
377 unsigned int dummy1 : 22;
378} reg_bif_dma_rw_pin4_cfg;
379#define REG_RD_ADDR_bif_dma_rw_pin4_cfg 176
380#define REG_WR_ADDR_bif_dma_rw_pin4_cfg 176
381
382/* Register rw_pin5_cfg, scope bif_dma, type rw */
383typedef struct {
384 unsigned int master_ch : 2;
385 unsigned int master_mode : 3;
386 unsigned int slave_ch : 2;
387 unsigned int slave_mode : 3;
388 unsigned int dummy1 : 22;
389} reg_bif_dma_rw_pin5_cfg;
390#define REG_RD_ADDR_bif_dma_rw_pin5_cfg 180
391#define REG_WR_ADDR_bif_dma_rw_pin5_cfg 180
392
393/* Register rw_pin6_cfg, scope bif_dma, type rw */
394typedef struct {
395 unsigned int master_ch : 2;
396 unsigned int master_mode : 3;
397 unsigned int slave_ch : 2;
398 unsigned int slave_mode : 3;
399 unsigned int dummy1 : 22;
400} reg_bif_dma_rw_pin6_cfg;
401#define REG_RD_ADDR_bif_dma_rw_pin6_cfg 184
402#define REG_WR_ADDR_bif_dma_rw_pin6_cfg 184
403
404/* Register rw_pin7_cfg, scope bif_dma, type rw */
405typedef struct {
406 unsigned int master_ch : 2;
407 unsigned int master_mode : 3;
408 unsigned int slave_ch : 2;
409 unsigned int slave_mode : 3;
410 unsigned int dummy1 : 22;
411} reg_bif_dma_rw_pin7_cfg;
412#define REG_RD_ADDR_bif_dma_rw_pin7_cfg 188
413#define REG_WR_ADDR_bif_dma_rw_pin7_cfg 188
414
415/* Register r_pin_stat, scope bif_dma, type r */
416typedef struct {
417 unsigned int pin0 : 1;
418 unsigned int pin1 : 1;
419 unsigned int pin2 : 1;
420 unsigned int pin3 : 1;
421 unsigned int pin4 : 1;
422 unsigned int pin5 : 1;
423 unsigned int pin6 : 1;
424 unsigned int pin7 : 1;
425 unsigned int dummy1 : 24;
426} reg_bif_dma_r_pin_stat;
427#define REG_RD_ADDR_bif_dma_r_pin_stat 192
428
429
430/* Constants */
431enum {
432 regk_bif_dma_as_master = 0x00000001,
433 regk_bif_dma_as_slave = 0x00000001,
434 regk_bif_dma_burst1 = 0x00000000,
435 regk_bif_dma_burst8 = 0x00000001,
436 regk_bif_dma_bw16 = 0x00000001,
437 regk_bif_dma_bw32 = 0x00000002,
438 regk_bif_dma_bw8 = 0x00000000,
439 regk_bif_dma_dack = 0x00000006,
440 regk_bif_dma_dack_inv = 0x00000007,
441 regk_bif_dma_force = 0x00000001,
442 regk_bif_dma_hi = 0x00000003,
443 regk_bif_dma_inv = 0x00000003,
444 regk_bif_dma_lo = 0x00000002,
445 regk_bif_dma_master = 0x00000001,
446 regk_bif_dma_no = 0x00000000,
447 regk_bif_dma_norm = 0x00000002,
448 regk_bif_dma_off = 0x00000000,
449 regk_bif_dma_rw_ch0_ctrl_default = 0x00000000,
450 regk_bif_dma_rw_ch0_start_default = 0x00000000,
451 regk_bif_dma_rw_ch1_ctrl_default = 0x00000000,
452 regk_bif_dma_rw_ch1_start_default = 0x00000000,
453 regk_bif_dma_rw_ch2_ctrl_default = 0x00000000,
454 regk_bif_dma_rw_ch2_start_default = 0x00000000,
455 regk_bif_dma_rw_ch3_ctrl_default = 0x00000000,
456 regk_bif_dma_rw_ch3_start_default = 0x00000000,
457 regk_bif_dma_rw_intr_mask_default = 0x00000000,
458 regk_bif_dma_rw_pin0_cfg_default = 0x00000000,
459 regk_bif_dma_rw_pin1_cfg_default = 0x00000000,
460 regk_bif_dma_rw_pin2_cfg_default = 0x00000000,
461 regk_bif_dma_rw_pin3_cfg_default = 0x00000000,
462 regk_bif_dma_rw_pin4_cfg_default = 0x00000000,
463 regk_bif_dma_rw_pin5_cfg_default = 0x00000000,
464 regk_bif_dma_rw_pin6_cfg_default = 0x00000000,
465 regk_bif_dma_rw_pin7_cfg_default = 0x00000000,
466 regk_bif_dma_slave = 0x00000002,
467 regk_bif_dma_sreq = 0x00000006,
468 regk_bif_dma_sreq_inv = 0x00000007,
469 regk_bif_dma_tc = 0x00000004,
470 regk_bif_dma_tc_inv = 0x00000005,
471 regk_bif_dma_yes = 0x00000001
472};
473#endif /* __bif_dma_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/bif_slave_defs.h b/include/asm-cris/arch-v32/mach-fs/hwregs/bif_slave_defs.h
new file mode 100644
index 000000000000..0c434585a3f9
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/bif_slave_defs.h
@@ -0,0 +1,249 @@
1#ifndef __bif_slave_defs_h
2#define __bif_slave_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/bif/rtl/bif_slave_regs.r
7 * id: bif_slave_regs.r,v 1.5 2005/02/04 13:55:28 perz Exp
8 * last modfied: Mon Apr 11 16:06:34 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile bif_slave_defs.h ../../inst/bif/rtl/bif_slave_regs.r
11 * id: $Id: bif_slave_defs.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope bif_slave */
86
87/* Register rw_slave_cfg, scope bif_slave, type rw */
88typedef struct {
89 unsigned int slave_id : 3;
90 unsigned int use_slave_id : 1;
91 unsigned int boot_rdy : 1;
92 unsigned int loopback : 1;
93 unsigned int dis : 1;
94 unsigned int dummy1 : 25;
95} reg_bif_slave_rw_slave_cfg;
96#define REG_RD_ADDR_bif_slave_rw_slave_cfg 0
97#define REG_WR_ADDR_bif_slave_rw_slave_cfg 0
98
99/* Register r_slave_mode, scope bif_slave, type r */
100typedef struct {
101 unsigned int ch0_mode : 1;
102 unsigned int ch1_mode : 1;
103 unsigned int ch2_mode : 1;
104 unsigned int ch3_mode : 1;
105 unsigned int dummy1 : 28;
106} reg_bif_slave_r_slave_mode;
107#define REG_RD_ADDR_bif_slave_r_slave_mode 4
108
109/* Register rw_ch0_cfg, scope bif_slave, type rw */
110typedef struct {
111 unsigned int rd_hold : 2;
112 unsigned int access_mode : 1;
113 unsigned int access_ctrl : 1;
114 unsigned int data_cs : 2;
115 unsigned int dummy1 : 26;
116} reg_bif_slave_rw_ch0_cfg;
117#define REG_RD_ADDR_bif_slave_rw_ch0_cfg 16
118#define REG_WR_ADDR_bif_slave_rw_ch0_cfg 16
119
120/* Register rw_ch1_cfg, scope bif_slave, type rw */
121typedef struct {
122 unsigned int rd_hold : 2;
123 unsigned int access_mode : 1;
124 unsigned int access_ctrl : 1;
125 unsigned int data_cs : 2;
126 unsigned int dummy1 : 26;
127} reg_bif_slave_rw_ch1_cfg;
128#define REG_RD_ADDR_bif_slave_rw_ch1_cfg 20
129#define REG_WR_ADDR_bif_slave_rw_ch1_cfg 20
130
131/* Register rw_ch2_cfg, scope bif_slave, type rw */
132typedef struct {
133 unsigned int rd_hold : 2;
134 unsigned int access_mode : 1;
135 unsigned int access_ctrl : 1;
136 unsigned int data_cs : 2;
137 unsigned int dummy1 : 26;
138} reg_bif_slave_rw_ch2_cfg;
139#define REG_RD_ADDR_bif_slave_rw_ch2_cfg 24
140#define REG_WR_ADDR_bif_slave_rw_ch2_cfg 24
141
142/* Register rw_ch3_cfg, scope bif_slave, type rw */
143typedef struct {
144 unsigned int rd_hold : 2;
145 unsigned int access_mode : 1;
146 unsigned int access_ctrl : 1;
147 unsigned int data_cs : 2;
148 unsigned int dummy1 : 26;
149} reg_bif_slave_rw_ch3_cfg;
150#define REG_RD_ADDR_bif_slave_rw_ch3_cfg 28
151#define REG_WR_ADDR_bif_slave_rw_ch3_cfg 28
152
153/* Register rw_arb_cfg, scope bif_slave, type rw */
154typedef struct {
155 unsigned int brin_mode : 1;
156 unsigned int brout_mode : 3;
157 unsigned int bg_mode : 3;
158 unsigned int release : 2;
159 unsigned int acquire : 1;
160 unsigned int settle_time : 2;
161 unsigned int dram_ctrl : 1;
162 unsigned int dummy1 : 19;
163} reg_bif_slave_rw_arb_cfg;
164#define REG_RD_ADDR_bif_slave_rw_arb_cfg 32
165#define REG_WR_ADDR_bif_slave_rw_arb_cfg 32
166
167/* Register r_arb_stat, scope bif_slave, type r */
168typedef struct {
169 unsigned int init_mode : 1;
170 unsigned int mode : 1;
171 unsigned int brin : 1;
172 unsigned int brout : 1;
173 unsigned int bg : 1;
174 unsigned int dummy1 : 27;
175} reg_bif_slave_r_arb_stat;
176#define REG_RD_ADDR_bif_slave_r_arb_stat 36
177
178/* Register rw_intr_mask, scope bif_slave, type rw */
179typedef struct {
180 unsigned int bus_release : 1;
181 unsigned int bus_acquire : 1;
182 unsigned int dummy1 : 30;
183} reg_bif_slave_rw_intr_mask;
184#define REG_RD_ADDR_bif_slave_rw_intr_mask 64
185#define REG_WR_ADDR_bif_slave_rw_intr_mask 64
186
187/* Register rw_ack_intr, scope bif_slave, type rw */
188typedef struct {
189 unsigned int bus_release : 1;
190 unsigned int bus_acquire : 1;
191 unsigned int dummy1 : 30;
192} reg_bif_slave_rw_ack_intr;
193#define REG_RD_ADDR_bif_slave_rw_ack_intr 68
194#define REG_WR_ADDR_bif_slave_rw_ack_intr 68
195
196/* Register r_intr, scope bif_slave, type r */
197typedef struct {
198 unsigned int bus_release : 1;
199 unsigned int bus_acquire : 1;
200 unsigned int dummy1 : 30;
201} reg_bif_slave_r_intr;
202#define REG_RD_ADDR_bif_slave_r_intr 72
203
204/* Register r_masked_intr, scope bif_slave, type r */
205typedef struct {
206 unsigned int bus_release : 1;
207 unsigned int bus_acquire : 1;
208 unsigned int dummy1 : 30;
209} reg_bif_slave_r_masked_intr;
210#define REG_RD_ADDR_bif_slave_r_masked_intr 76
211
212
213/* Constants */
214enum {
215 regk_bif_slave_active_hi = 0x00000003,
216 regk_bif_slave_active_lo = 0x00000002,
217 regk_bif_slave_addr = 0x00000000,
218 regk_bif_slave_always = 0x00000001,
219 regk_bif_slave_at_idle = 0x00000002,
220 regk_bif_slave_burst_end = 0x00000003,
221 regk_bif_slave_dma = 0x00000001,
222 regk_bif_slave_hi = 0x00000003,
223 regk_bif_slave_inv = 0x00000001,
224 regk_bif_slave_lo = 0x00000002,
225 regk_bif_slave_local = 0x00000001,
226 regk_bif_slave_master = 0x00000000,
227 regk_bif_slave_mode_reg = 0x00000001,
228 regk_bif_slave_no = 0x00000000,
229 regk_bif_slave_norm = 0x00000000,
230 regk_bif_slave_on_access = 0x00000000,
231 regk_bif_slave_rw_arb_cfg_default = 0x00000000,
232 regk_bif_slave_rw_ch0_cfg_default = 0x00000000,
233 regk_bif_slave_rw_ch1_cfg_default = 0x00000000,
234 regk_bif_slave_rw_ch2_cfg_default = 0x00000000,
235 regk_bif_slave_rw_ch3_cfg_default = 0x00000000,
236 regk_bif_slave_rw_intr_mask_default = 0x00000000,
237 regk_bif_slave_rw_slave_cfg_default = 0x00000000,
238 regk_bif_slave_shared = 0x00000000,
239 regk_bif_slave_slave = 0x00000001,
240 regk_bif_slave_t0ns = 0x00000003,
241 regk_bif_slave_t10ns = 0x00000002,
242 regk_bif_slave_t20ns = 0x00000003,
243 regk_bif_slave_t30ns = 0x00000002,
244 regk_bif_slave_t40ns = 0x00000001,
245 regk_bif_slave_t50ns = 0x00000000,
246 regk_bif_slave_yes = 0x00000001,
247 regk_bif_slave_z = 0x00000004
248};
249#endif /* __bif_slave_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/config_defs.h b/include/asm-cris/arch-v32/mach-fs/hwregs/config_defs.h
new file mode 100644
index 000000000000..abc5f20705f7
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/config_defs.h
@@ -0,0 +1,142 @@
1#ifndef __config_defs_h
2#define __config_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../rtl/config_regs.r
7 * id: config_regs.r,v 1.23 2004/03/04 11:34:42 mikaeln Exp
8 * last modfied: Thu Mar 4 12:34:39 2004
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile config_defs.h ../../rtl/config_regs.r
11 * id: $Id: config_defs.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope config */
86
87/* Register r_bootsel, scope config, type r */
88typedef struct {
89 unsigned int boot_mode : 3;
90 unsigned int full_duplex : 1;
91 unsigned int user : 1;
92 unsigned int pll : 1;
93 unsigned int flash_bw : 1;
94 unsigned int dummy1 : 25;
95} reg_config_r_bootsel;
96#define REG_RD_ADDR_config_r_bootsel 0
97
98/* Register rw_clk_ctrl, scope config, type rw */
99typedef struct {
100 unsigned int pll : 1;
101 unsigned int cpu : 1;
102 unsigned int iop : 1;
103 unsigned int dma01_eth0 : 1;
104 unsigned int dma23 : 1;
105 unsigned int dma45 : 1;
106 unsigned int dma67 : 1;
107 unsigned int dma89_strcop : 1;
108 unsigned int bif : 1;
109 unsigned int fix_io : 1;
110 unsigned int dummy1 : 22;
111} reg_config_rw_clk_ctrl;
112#define REG_RD_ADDR_config_rw_clk_ctrl 4
113#define REG_WR_ADDR_config_rw_clk_ctrl 4
114
115/* Register rw_pad_ctrl, scope config, type rw */
116typedef struct {
117 unsigned int usb_susp : 1;
118 unsigned int phyrst_n : 1;
119 unsigned int dummy1 : 30;
120} reg_config_rw_pad_ctrl;
121#define REG_RD_ADDR_config_rw_pad_ctrl 8
122#define REG_WR_ADDR_config_rw_pad_ctrl 8
123
124
125/* Constants */
126enum {
127 regk_config_bw16 = 0x00000000,
128 regk_config_bw32 = 0x00000001,
129 regk_config_master = 0x00000005,
130 regk_config_nand = 0x00000003,
131 regk_config_net_rx = 0x00000001,
132 regk_config_net_tx_rx = 0x00000002,
133 regk_config_no = 0x00000000,
134 regk_config_none = 0x00000007,
135 regk_config_nor = 0x00000000,
136 regk_config_rw_clk_ctrl_default = 0x00000002,
137 regk_config_rw_pad_ctrl_default = 0x00000000,
138 regk_config_ser = 0x00000004,
139 regk_config_slave = 0x00000006,
140 regk_config_yes = 0x00000001
141};
142#endif /* __config_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/gio_defs.h b/include/asm-cris/arch-v32/mach-fs/hwregs/gio_defs.h
new file mode 100644
index 000000000000..26aa3efcf91b
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/gio_defs.h
@@ -0,0 +1,295 @@
1#ifndef __gio_defs_h
2#define __gio_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/gio/rtl/gio_regs.r
7 * id: gio_regs.r,v 1.5 2005/02/04 09:43:21 perz Exp
8 * last modfied: Mon Apr 11 16:07:47 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile gio_defs.h ../../inst/gio/rtl/gio_regs.r
11 * id: $Id: gio_defs.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope gio */
86
87/* Register rw_pa_dout, scope gio, type rw */
88typedef struct {
89 unsigned int data : 8;
90 unsigned int dummy1 : 24;
91} reg_gio_rw_pa_dout;
92#define REG_RD_ADDR_gio_rw_pa_dout 0
93#define REG_WR_ADDR_gio_rw_pa_dout 0
94
95/* Register r_pa_din, scope gio, type r */
96typedef struct {
97 unsigned int data : 8;
98 unsigned int dummy1 : 24;
99} reg_gio_r_pa_din;
100#define REG_RD_ADDR_gio_r_pa_din 4
101
102/* Register rw_pa_oe, scope gio, type rw */
103typedef struct {
104 unsigned int oe : 8;
105 unsigned int dummy1 : 24;
106} reg_gio_rw_pa_oe;
107#define REG_RD_ADDR_gio_rw_pa_oe 8
108#define REG_WR_ADDR_gio_rw_pa_oe 8
109
110/* Register rw_intr_cfg, scope gio, type rw */
111typedef struct {
112 unsigned int pa0 : 3;
113 unsigned int pa1 : 3;
114 unsigned int pa2 : 3;
115 unsigned int pa3 : 3;
116 unsigned int pa4 : 3;
117 unsigned int pa5 : 3;
118 unsigned int pa6 : 3;
119 unsigned int pa7 : 3;
120 unsigned int dummy1 : 8;
121} reg_gio_rw_intr_cfg;
122#define REG_RD_ADDR_gio_rw_intr_cfg 12
123#define REG_WR_ADDR_gio_rw_intr_cfg 12
124
125/* Register rw_intr_mask, scope gio, type rw */
126typedef struct {
127 unsigned int pa0 : 1;
128 unsigned int pa1 : 1;
129 unsigned int pa2 : 1;
130 unsigned int pa3 : 1;
131 unsigned int pa4 : 1;
132 unsigned int pa5 : 1;
133 unsigned int pa6 : 1;
134 unsigned int pa7 : 1;
135 unsigned int dummy1 : 24;
136} reg_gio_rw_intr_mask;
137#define REG_RD_ADDR_gio_rw_intr_mask 16
138#define REG_WR_ADDR_gio_rw_intr_mask 16
139
140/* Register rw_ack_intr, scope gio, type rw */
141typedef struct {
142 unsigned int pa0 : 1;
143 unsigned int pa1 : 1;
144 unsigned int pa2 : 1;
145 unsigned int pa3 : 1;
146 unsigned int pa4 : 1;
147 unsigned int pa5 : 1;
148 unsigned int pa6 : 1;
149 unsigned int pa7 : 1;
150 unsigned int dummy1 : 24;
151} reg_gio_rw_ack_intr;
152#define REG_RD_ADDR_gio_rw_ack_intr 20
153#define REG_WR_ADDR_gio_rw_ack_intr 20
154
155/* Register r_intr, scope gio, type r */
156typedef struct {
157 unsigned int pa0 : 1;
158 unsigned int pa1 : 1;
159 unsigned int pa2 : 1;
160 unsigned int pa3 : 1;
161 unsigned int pa4 : 1;
162 unsigned int pa5 : 1;
163 unsigned int pa6 : 1;
164 unsigned int pa7 : 1;
165 unsigned int dummy1 : 24;
166} reg_gio_r_intr;
167#define REG_RD_ADDR_gio_r_intr 24
168
169/* Register r_masked_intr, scope gio, type r */
170typedef struct {
171 unsigned int pa0 : 1;
172 unsigned int pa1 : 1;
173 unsigned int pa2 : 1;
174 unsigned int pa3 : 1;
175 unsigned int pa4 : 1;
176 unsigned int pa5 : 1;
177 unsigned int pa6 : 1;
178 unsigned int pa7 : 1;
179 unsigned int dummy1 : 24;
180} reg_gio_r_masked_intr;
181#define REG_RD_ADDR_gio_r_masked_intr 28
182
183/* Register rw_pb_dout, scope gio, type rw */
184typedef struct {
185 unsigned int data : 18;
186 unsigned int dummy1 : 14;
187} reg_gio_rw_pb_dout;
188#define REG_RD_ADDR_gio_rw_pb_dout 32
189#define REG_WR_ADDR_gio_rw_pb_dout 32
190
191/* Register r_pb_din, scope gio, type r */
192typedef struct {
193 unsigned int data : 18;
194 unsigned int dummy1 : 14;
195} reg_gio_r_pb_din;
196#define REG_RD_ADDR_gio_r_pb_din 36
197
198/* Register rw_pb_oe, scope gio, type rw */
199typedef struct {
200 unsigned int oe : 18;
201 unsigned int dummy1 : 14;
202} reg_gio_rw_pb_oe;
203#define REG_RD_ADDR_gio_rw_pb_oe 40
204#define REG_WR_ADDR_gio_rw_pb_oe 40
205
206/* Register rw_pc_dout, scope gio, type rw */
207typedef struct {
208 unsigned int data : 18;
209 unsigned int dummy1 : 14;
210} reg_gio_rw_pc_dout;
211#define REG_RD_ADDR_gio_rw_pc_dout 48
212#define REG_WR_ADDR_gio_rw_pc_dout 48
213
214/* Register r_pc_din, scope gio, type r */
215typedef struct {
216 unsigned int data : 18;
217 unsigned int dummy1 : 14;
218} reg_gio_r_pc_din;
219#define REG_RD_ADDR_gio_r_pc_din 52
220
221/* Register rw_pc_oe, scope gio, type rw */
222typedef struct {
223 unsigned int oe : 18;
224 unsigned int dummy1 : 14;
225} reg_gio_rw_pc_oe;
226#define REG_RD_ADDR_gio_rw_pc_oe 56
227#define REG_WR_ADDR_gio_rw_pc_oe 56
228
229/* Register rw_pd_dout, scope gio, type rw */
230typedef struct {
231 unsigned int data : 18;
232 unsigned int dummy1 : 14;
233} reg_gio_rw_pd_dout;
234#define REG_RD_ADDR_gio_rw_pd_dout 64
235#define REG_WR_ADDR_gio_rw_pd_dout 64
236
237/* Register r_pd_din, scope gio, type r */
238typedef struct {
239 unsigned int data : 18;
240 unsigned int dummy1 : 14;
241} reg_gio_r_pd_din;
242#define REG_RD_ADDR_gio_r_pd_din 68
243
244/* Register rw_pd_oe, scope gio, type rw */
245typedef struct {
246 unsigned int oe : 18;
247 unsigned int dummy1 : 14;
248} reg_gio_rw_pd_oe;
249#define REG_RD_ADDR_gio_rw_pd_oe 72
250#define REG_WR_ADDR_gio_rw_pd_oe 72
251
252/* Register rw_pe_dout, scope gio, type rw */
253typedef struct {
254 unsigned int data : 18;
255 unsigned int dummy1 : 14;
256} reg_gio_rw_pe_dout;
257#define REG_RD_ADDR_gio_rw_pe_dout 80
258#define REG_WR_ADDR_gio_rw_pe_dout 80
259
260/* Register r_pe_din, scope gio, type r */
261typedef struct {
262 unsigned int data : 18;
263 unsigned int dummy1 : 14;
264} reg_gio_r_pe_din;
265#define REG_RD_ADDR_gio_r_pe_din 84
266
267/* Register rw_pe_oe, scope gio, type rw */
268typedef struct {
269 unsigned int oe : 18;
270 unsigned int dummy1 : 14;
271} reg_gio_rw_pe_oe;
272#define REG_RD_ADDR_gio_rw_pe_oe 88
273#define REG_WR_ADDR_gio_rw_pe_oe 88
274
275
276/* Constants */
277enum {
278 regk_gio_anyedge = 0x00000007,
279 regk_gio_hi = 0x00000001,
280 regk_gio_lo = 0x00000002,
281 regk_gio_negedge = 0x00000006,
282 regk_gio_no = 0x00000000,
283 regk_gio_off = 0x00000000,
284 regk_gio_posedge = 0x00000005,
285 regk_gio_rw_intr_cfg_default = 0x00000000,
286 regk_gio_rw_intr_mask_default = 0x00000000,
287 regk_gio_rw_pa_oe_default = 0x00000000,
288 regk_gio_rw_pb_oe_default = 0x00000000,
289 regk_gio_rw_pc_oe_default = 0x00000000,
290 regk_gio_rw_pd_oe_default = 0x00000000,
291 regk_gio_rw_pe_oe_default = 0x00000000,
292 regk_gio_set = 0x00000003,
293 regk_gio_yes = 0x00000001
294};
295#endif /* __gio_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/intr_vect.h b/include/asm-cris/arch-v32/mach-fs/hwregs/intr_vect.h
new file mode 100644
index 000000000000..bacc2a895c21
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/intr_vect.h
@@ -0,0 +1,41 @@
1/* Interrupt vector numbers autogenerated by /n/asic/design/tools/rdesc/src/rdes2intr version
2 from ../../inst/intr_vect/rtl/guinness/ivmask.config.r
3version . */
4
5#ifndef _______INST_INTR_VECT_RTL_GUINNESS_IVMASK_CONFIG_R
6#define _______INST_INTR_VECT_RTL_GUINNESS_IVMASK_CONFIG_R
7#define MEMARB_INTR_VECT 0x31
8#define GEN_IO_INTR_VECT 0x32
9#define GIO_INTR_VECT GEN_IO_INTR_VECT
10#define IOP0_INTR_VECT 0x33
11#define IOP1_INTR_VECT 0x34
12#define IOP2_INTR_VECT 0x35
13#define IOP3_INTR_VECT 0x36
14#define DMA0_INTR_VECT 0x37
15#define DMA1_INTR_VECT 0x38
16#define DMA2_INTR_VECT 0x39
17#define DMA3_INTR_VECT 0x3a
18#define DMA4_INTR_VECT 0x3b
19#define DMA5_INTR_VECT 0x3c
20#define DMA6_INTR_VECT 0x3d
21#define DMA7_INTR_VECT 0x3e
22#define DMA8_INTR_VECT 0x3f
23#define DMA9_INTR_VECT 0x40
24#define ATA_INTR_VECT 0x41
25#define SSER0_INTR_VECT 0x42
26#define SSER1_INTR_VECT 0x43
27#define SER0_INTR_VECT 0x44
28#define SER1_INTR_VECT 0x45
29#define SER2_INTR_VECT 0x46
30#define SER3_INTR_VECT 0x47
31#define P21_INTR_VECT 0x48
32#define ETH0_INTR_VECT 0x49
33#define ETH1_INTR_VECT 0x4a
34#define TIMER_INTR_VECT 0x4b
35#define TIMER0_INTR_VECT TIMER_INTR_VECT
36#define BIF_ARB_INTR_VECT 0x4c
37#define BIF_DMA_INTR_VECT 0x4d
38#define EXT_INTR_VECT 0x4e
39#define IPI_INTR_VECT 0x4f
40#define NBR_INTR_VECT 0x50
41#endif
diff --git a/include/asm-cris/arch-v32/hwregs/intr_vect_defs.h b/include/asm-cris/arch-v32/mach-fs/hwregs/intr_vect_defs.h
index 535aaf1b4b52..aa65128ae1aa 100644
--- a/include/asm-cris/arch-v32/hwregs/intr_vect_defs.h
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/intr_vect_defs.h
@@ -4,11 +4,11 @@
4/* 4/*
5 * This file is autogenerated from 5 * This file is autogenerated from
6 * file: ../../inst/intr_vect/rtl/guinness/ivmask.config.r 6 * file: ../../inst/intr_vect/rtl/guinness/ivmask.config.r
7 * id: ivmask.config.r,v 1.4 2005/02/15 16:05:38 stefans Exp 7 * id: ivmask.config.r,v 1.4 2005/02/15 16:05:38 stefans Exp
8 * last modfied: Mon Apr 11 16:08:03 2005 8 * last modfied: Mon Apr 11 16:08:03 2005
9 * 9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile intr_vect_defs.h ../../inst/intr_vect/rtl/guinness/ivmask.config.r 10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile intr_vect_defs.h ../../inst/intr_vect/rtl/guinness/ivmask.config.r
11 * id: $Id: intr_vect_defs.h,v 1.8 2005/04/24 18:30:58 starvik Exp $ 11 * id: $Id: intr_vect_defs.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost. 12 * Any changes here will be lost.
13 * 13 *
14 * -*- buffer-read-only: t -*- 14 * -*- buffer-read-only: t -*-
@@ -84,6 +84,7 @@
84 84
85/* C-code for register scope intr_vect */ 85/* C-code for register scope intr_vect */
86 86
87#define STRIDE_intr_vect_rw_mask 0
87/* Register rw_mask, scope intr_vect, type rw */ 88/* Register rw_mask, scope intr_vect, type rw */
88typedef struct { 89typedef struct {
89 unsigned int memarb : 1; 90 unsigned int memarb : 1;
@@ -112,7 +113,7 @@ typedef struct {
112 unsigned int p21 : 1; 113 unsigned int p21 : 1;
113 unsigned int eth0 : 1; 114 unsigned int eth0 : 1;
114 unsigned int eth1 : 1; 115 unsigned int eth1 : 1;
115 unsigned int timer : 1; 116 unsigned int timer0 : 1;
116 unsigned int bif_arb : 1; 117 unsigned int bif_arb : 1;
117 unsigned int bif_dma : 1; 118 unsigned int bif_dma : 1;
118 unsigned int ext : 1; 119 unsigned int ext : 1;
@@ -121,6 +122,7 @@ typedef struct {
121#define REG_RD_ADDR_intr_vect_rw_mask 0 122#define REG_RD_ADDR_intr_vect_rw_mask 0
122#define REG_WR_ADDR_intr_vect_rw_mask 0 123#define REG_WR_ADDR_intr_vect_rw_mask 0
123 124
125#define STRIDE_intr_vect_r_vect 0
124/* Register r_vect, scope intr_vect, type r */ 126/* Register r_vect, scope intr_vect, type r */
125typedef struct { 127typedef struct {
126 unsigned int memarb : 1; 128 unsigned int memarb : 1;
@@ -157,6 +159,7 @@ typedef struct {
157} reg_intr_vect_r_vect; 159} reg_intr_vect_r_vect;
158#define REG_RD_ADDR_intr_vect_r_vect 4 160#define REG_RD_ADDR_intr_vect_r_vect 4
159 161
162#define STRIDE_intr_vect_r_masked_vect 0
160/* Register r_masked_vect, scope intr_vect, type r */ 163/* Register r_masked_vect, scope intr_vect, type r */
161typedef struct { 164typedef struct {
162 unsigned int memarb : 1; 165 unsigned int memarb : 1;
@@ -209,7 +212,7 @@ typedef struct {
209#define REG_RD_ADDR_intr_vect_r_guru 16 212#define REG_RD_ADDR_intr_vect_r_guru 16
210 213
211/* Register rw_ipi, scope intr_vect, type rw */ 214/* Register rw_ipi, scope intr_vect, type rw */
212typedef struct 215typedef struct
213{ 216{
214 unsigned int vector; 217 unsigned int vector;
215} reg_intr_vect_rw_ipi; 218} reg_intr_vect_rw_ipi;
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/marb_bp_defs.h b/include/asm-cris/arch-v32/mach-fs/hwregs/marb_bp_defs.h
new file mode 100644
index 000000000000..dcaaec4620ba
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/marb_bp_defs.h
@@ -0,0 +1,205 @@
1#ifndef __marb_bp_defs_h
2#define __marb_bp_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/memarb/rtl/guinness/marb_top.r
7 * id: <not found>
8 * last modfied: Fri Nov 7 15:36:04 2003
9 *
10 * by /n/asic/projects/guinness/design/top/inst/rdesc/rdes2c ../../rtl/global.rmap ../../mod/modreg.rmap -base 0xb0000000 ../../inst/memarb/rtl/guinness/marb_top.r
11 * id: $Id: marb_bp_defs.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74/* C-code for register scope marb_bp */
75
76/* Register rw_first_addr, scope marb_bp, type rw */
77typedef unsigned int reg_marb_bp_rw_first_addr;
78#define REG_RD_ADDR_marb_bp_rw_first_addr 0
79#define REG_WR_ADDR_marb_bp_rw_first_addr 0
80
81/* Register rw_last_addr, scope marb_bp, type rw */
82typedef unsigned int reg_marb_bp_rw_last_addr;
83#define REG_RD_ADDR_marb_bp_rw_last_addr 4
84#define REG_WR_ADDR_marb_bp_rw_last_addr 4
85
86/* Register rw_op, scope marb_bp, type rw */
87typedef struct {
88 unsigned int read : 1;
89 unsigned int write : 1;
90 unsigned int read_excl : 1;
91 unsigned int pri_write : 1;
92 unsigned int us_read : 1;
93 unsigned int us_write : 1;
94 unsigned int us_read_excl : 1;
95 unsigned int us_pri_write : 1;
96 unsigned int dummy1 : 24;
97} reg_marb_bp_rw_op;
98#define REG_RD_ADDR_marb_bp_rw_op 8
99#define REG_WR_ADDR_marb_bp_rw_op 8
100
101/* Register rw_clients, scope marb_bp, type rw */
102typedef struct {
103 unsigned int dma0 : 1;
104 unsigned int dma1 : 1;
105 unsigned int dma2 : 1;
106 unsigned int dma3 : 1;
107 unsigned int dma4 : 1;
108 unsigned int dma5 : 1;
109 unsigned int dma6 : 1;
110 unsigned int dma7 : 1;
111 unsigned int dma8 : 1;
112 unsigned int dma9 : 1;
113 unsigned int cpui : 1;
114 unsigned int cpud : 1;
115 unsigned int iop : 1;
116 unsigned int slave : 1;
117 unsigned int dummy1 : 18;
118} reg_marb_bp_rw_clients;
119#define REG_RD_ADDR_marb_bp_rw_clients 12
120#define REG_WR_ADDR_marb_bp_rw_clients 12
121
122/* Register rw_options, scope marb_bp, type rw */
123typedef struct {
124 unsigned int wrap : 1;
125 unsigned int dummy1 : 31;
126} reg_marb_bp_rw_options;
127#define REG_RD_ADDR_marb_bp_rw_options 16
128#define REG_WR_ADDR_marb_bp_rw_options 16
129
130/* Register r_break_addr, scope marb_bp, type r */
131typedef unsigned int reg_marb_bp_r_break_addr;
132#define REG_RD_ADDR_marb_bp_r_break_addr 20
133
134/* Register r_break_op, scope marb_bp, type r */
135typedef struct {
136 unsigned int read : 1;
137 unsigned int write : 1;
138 unsigned int read_excl : 1;
139 unsigned int pri_write : 1;
140 unsigned int us_read : 1;
141 unsigned int us_write : 1;
142 unsigned int us_read_excl : 1;
143 unsigned int us_pri_write : 1;
144 unsigned int dummy1 : 24;
145} reg_marb_bp_r_break_op;
146#define REG_RD_ADDR_marb_bp_r_break_op 24
147
148/* Register r_break_clients, scope marb_bp, type r */
149typedef struct {
150 unsigned int dma0 : 1;
151 unsigned int dma1 : 1;
152 unsigned int dma2 : 1;
153 unsigned int dma3 : 1;
154 unsigned int dma4 : 1;
155 unsigned int dma5 : 1;
156 unsigned int dma6 : 1;
157 unsigned int dma7 : 1;
158 unsigned int dma8 : 1;
159 unsigned int dma9 : 1;
160 unsigned int cpui : 1;
161 unsigned int cpud : 1;
162 unsigned int iop : 1;
163 unsigned int slave : 1;
164 unsigned int dummy1 : 18;
165} reg_marb_bp_r_break_clients;
166#define REG_RD_ADDR_marb_bp_r_break_clients 28
167
168/* Register r_break_first_client, scope marb_bp, type r */
169typedef struct {
170 unsigned int dma0 : 1;
171 unsigned int dma1 : 1;
172 unsigned int dma2 : 1;
173 unsigned int dma3 : 1;
174 unsigned int dma4 : 1;
175 unsigned int dma5 : 1;
176 unsigned int dma6 : 1;
177 unsigned int dma7 : 1;
178 unsigned int dma8 : 1;
179 unsigned int dma9 : 1;
180 unsigned int cpui : 1;
181 unsigned int cpud : 1;
182 unsigned int iop : 1;
183 unsigned int slave : 1;
184 unsigned int dummy1 : 18;
185} reg_marb_bp_r_break_first_client;
186#define REG_RD_ADDR_marb_bp_r_break_first_client 32
187
188/* Register r_break_size, scope marb_bp, type r */
189typedef unsigned int reg_marb_bp_r_break_size;
190#define REG_RD_ADDR_marb_bp_r_break_size 36
191
192/* Register rw_ack, scope marb_bp, type rw */
193typedef unsigned int reg_marb_bp_rw_ack;
194#define REG_RD_ADDR_marb_bp_rw_ack 40
195#define REG_WR_ADDR_marb_bp_rw_ack 40
196
197
198/* Constants */
199enum {
200 regk_marb_bp_no = 0x00000000,
201 regk_marb_bp_rw_op_default = 0x00000000,
202 regk_marb_bp_rw_options_default = 0x00000000,
203 regk_marb_bp_yes = 0x00000001
204};
205#endif /* __marb_bp_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/marb_defs.h b/include/asm-cris/arch-v32/mach-fs/hwregs/marb_defs.h
new file mode 100644
index 000000000000..254da0854986
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/marb_defs.h
@@ -0,0 +1,475 @@
1#ifndef __marb_defs_h
2#define __marb_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/memarb/rtl/guinness/marb_top.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:12:16 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile marb_defs.h ../../inst/memarb/rtl/guinness/marb_top.r
11 * id: $Id: marb_defs.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope marb */
86
87#define STRIDE_marb_rw_int_slots 4
88/* Register rw_int_slots, scope marb, type rw */
89typedef struct {
90 unsigned int owner : 4;
91 unsigned int dummy1 : 28;
92} reg_marb_rw_int_slots;
93#define REG_RD_ADDR_marb_rw_int_slots 0
94#define REG_WR_ADDR_marb_rw_int_slots 0
95
96#define STRIDE_marb_rw_ext_slots 4
97/* Register rw_ext_slots, scope marb, type rw */
98typedef struct {
99 unsigned int owner : 4;
100 unsigned int dummy1 : 28;
101} reg_marb_rw_ext_slots;
102#define REG_RD_ADDR_marb_rw_ext_slots 256
103#define REG_WR_ADDR_marb_rw_ext_slots 256
104
105#define STRIDE_marb_rw_regs_slots 4
106/* Register rw_regs_slots, scope marb, type rw */
107typedef struct {
108 unsigned int owner : 4;
109 unsigned int dummy1 : 28;
110} reg_marb_rw_regs_slots;
111#define REG_RD_ADDR_marb_rw_regs_slots 512
112#define REG_WR_ADDR_marb_rw_regs_slots 512
113
114/* Register rw_intr_mask, scope marb, type rw */
115typedef struct {
116 unsigned int bp0 : 1;
117 unsigned int bp1 : 1;
118 unsigned int bp2 : 1;
119 unsigned int bp3 : 1;
120 unsigned int dummy1 : 28;
121} reg_marb_rw_intr_mask;
122#define REG_RD_ADDR_marb_rw_intr_mask 528
123#define REG_WR_ADDR_marb_rw_intr_mask 528
124
125/* Register rw_ack_intr, scope marb, type rw */
126typedef struct {
127 unsigned int bp0 : 1;
128 unsigned int bp1 : 1;
129 unsigned int bp2 : 1;
130 unsigned int bp3 : 1;
131 unsigned int dummy1 : 28;
132} reg_marb_rw_ack_intr;
133#define REG_RD_ADDR_marb_rw_ack_intr 532
134#define REG_WR_ADDR_marb_rw_ack_intr 532
135
136/* Register r_intr, scope marb, type r */
137typedef struct {
138 unsigned int bp0 : 1;
139 unsigned int bp1 : 1;
140 unsigned int bp2 : 1;
141 unsigned int bp3 : 1;
142 unsigned int dummy1 : 28;
143} reg_marb_r_intr;
144#define REG_RD_ADDR_marb_r_intr 536
145
146/* Register r_masked_intr, scope marb, type r */
147typedef struct {
148 unsigned int bp0 : 1;
149 unsigned int bp1 : 1;
150 unsigned int bp2 : 1;
151 unsigned int bp3 : 1;
152 unsigned int dummy1 : 28;
153} reg_marb_r_masked_intr;
154#define REG_RD_ADDR_marb_r_masked_intr 540
155
156/* Register rw_stop_mask, scope marb, type rw */
157typedef struct {
158 unsigned int dma0 : 1;
159 unsigned int dma1 : 1;
160 unsigned int dma2 : 1;
161 unsigned int dma3 : 1;
162 unsigned int dma4 : 1;
163 unsigned int dma5 : 1;
164 unsigned int dma6 : 1;
165 unsigned int dma7 : 1;
166 unsigned int dma8 : 1;
167 unsigned int dma9 : 1;
168 unsigned int cpui : 1;
169 unsigned int cpud : 1;
170 unsigned int iop : 1;
171 unsigned int slave : 1;
172 unsigned int dummy1 : 18;
173} reg_marb_rw_stop_mask;
174#define REG_RD_ADDR_marb_rw_stop_mask 544
175#define REG_WR_ADDR_marb_rw_stop_mask 544
176
177/* Register r_stopped, scope marb, type r */
178typedef struct {
179 unsigned int dma0 : 1;
180 unsigned int dma1 : 1;
181 unsigned int dma2 : 1;
182 unsigned int dma3 : 1;
183 unsigned int dma4 : 1;
184 unsigned int dma5 : 1;
185 unsigned int dma6 : 1;
186 unsigned int dma7 : 1;
187 unsigned int dma8 : 1;
188 unsigned int dma9 : 1;
189 unsigned int cpui : 1;
190 unsigned int cpud : 1;
191 unsigned int iop : 1;
192 unsigned int slave : 1;
193 unsigned int dummy1 : 18;
194} reg_marb_r_stopped;
195#define REG_RD_ADDR_marb_r_stopped 548
196
197/* Register rw_no_snoop, scope marb, type rw */
198typedef struct {
199 unsigned int dma0 : 1;
200 unsigned int dma1 : 1;
201 unsigned int dma2 : 1;
202 unsigned int dma3 : 1;
203 unsigned int dma4 : 1;
204 unsigned int dma5 : 1;
205 unsigned int dma6 : 1;
206 unsigned int dma7 : 1;
207 unsigned int dma8 : 1;
208 unsigned int dma9 : 1;
209 unsigned int cpui : 1;
210 unsigned int cpud : 1;
211 unsigned int iop : 1;
212 unsigned int slave : 1;
213 unsigned int dummy1 : 18;
214} reg_marb_rw_no_snoop;
215#define REG_RD_ADDR_marb_rw_no_snoop 832
216#define REG_WR_ADDR_marb_rw_no_snoop 832
217
218/* Register rw_no_snoop_rq, scope marb, type rw */
219typedef struct {
220 unsigned int dummy1 : 10;
221 unsigned int cpui : 1;
222 unsigned int cpud : 1;
223 unsigned int dummy2 : 20;
224} reg_marb_rw_no_snoop_rq;
225#define REG_RD_ADDR_marb_rw_no_snoop_rq 836
226#define REG_WR_ADDR_marb_rw_no_snoop_rq 836
227
228
229/* Constants */
230enum {
231 regk_marb_cpud = 0x0000000b,
232 regk_marb_cpui = 0x0000000a,
233 regk_marb_dma0 = 0x00000000,
234 regk_marb_dma1 = 0x00000001,
235 regk_marb_dma2 = 0x00000002,
236 regk_marb_dma3 = 0x00000003,
237 regk_marb_dma4 = 0x00000004,
238 regk_marb_dma5 = 0x00000005,
239 regk_marb_dma6 = 0x00000006,
240 regk_marb_dma7 = 0x00000007,
241 regk_marb_dma8 = 0x00000008,
242 regk_marb_dma9 = 0x00000009,
243 regk_marb_iop = 0x0000000c,
244 regk_marb_no = 0x00000000,
245 regk_marb_r_stopped_default = 0x00000000,
246 regk_marb_rw_ext_slots_default = 0x00000000,
247 regk_marb_rw_ext_slots_size = 0x00000040,
248 regk_marb_rw_int_slots_default = 0x00000000,
249 regk_marb_rw_int_slots_size = 0x00000040,
250 regk_marb_rw_intr_mask_default = 0x00000000,
251 regk_marb_rw_no_snoop_default = 0x00000000,
252 regk_marb_rw_no_snoop_rq_default = 0x00000000,
253 regk_marb_rw_regs_slots_default = 0x00000000,
254 regk_marb_rw_regs_slots_size = 0x00000004,
255 regk_marb_rw_stop_mask_default = 0x00000000,
256 regk_marb_slave = 0x0000000d,
257 regk_marb_yes = 0x00000001
258};
259#endif /* __marb_defs_h */
260#ifndef __marb_bp_defs_h
261#define __marb_bp_defs_h
262
263/*
264 * This file is autogenerated from
265 * file: ../../inst/memarb/rtl/guinness/marb_top.r
266 * id: <not found>
267 * last modfied: Mon Apr 11 16:12:16 2005
268 *
269 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile marb_defs.h ../../inst/memarb/rtl/guinness/marb_top.r
270 * id: $Id: marb_defs.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
271 * Any changes here will be lost.
272 *
273 * -*- buffer-read-only: t -*-
274 */
275/* Main access macros */
276#ifndef REG_RD
277#define REG_RD( scope, inst, reg ) \
278 REG_READ( reg_##scope##_##reg, \
279 (inst) + REG_RD_ADDR_##scope##_##reg )
280#endif
281
282#ifndef REG_WR
283#define REG_WR( scope, inst, reg, val ) \
284 REG_WRITE( reg_##scope##_##reg, \
285 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
286#endif
287
288#ifndef REG_RD_VECT
289#define REG_RD_VECT( scope, inst, reg, index ) \
290 REG_READ( reg_##scope##_##reg, \
291 (inst) + REG_RD_ADDR_##scope##_##reg + \
292 (index) * STRIDE_##scope##_##reg )
293#endif
294
295#ifndef REG_WR_VECT
296#define REG_WR_VECT( scope, inst, reg, index, val ) \
297 REG_WRITE( reg_##scope##_##reg, \
298 (inst) + REG_WR_ADDR_##scope##_##reg + \
299 (index) * STRIDE_##scope##_##reg, (val) )
300#endif
301
302#ifndef REG_RD_INT
303#define REG_RD_INT( scope, inst, reg ) \
304 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
305#endif
306
307#ifndef REG_WR_INT
308#define REG_WR_INT( scope, inst, reg, val ) \
309 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
310#endif
311
312#ifndef REG_RD_INT_VECT
313#define REG_RD_INT_VECT( scope, inst, reg, index ) \
314 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
315 (index) * STRIDE_##scope##_##reg )
316#endif
317
318#ifndef REG_WR_INT_VECT
319#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
320 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
321 (index) * STRIDE_##scope##_##reg, (val) )
322#endif
323
324#ifndef REG_TYPE_CONV
325#define REG_TYPE_CONV( type, orgtype, val ) \
326 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
327#endif
328
329#ifndef reg_page_size
330#define reg_page_size 8192
331#endif
332
333#ifndef REG_ADDR
334#define REG_ADDR( scope, inst, reg ) \
335 ( (inst) + REG_RD_ADDR_##scope##_##reg )
336#endif
337
338#ifndef REG_ADDR_VECT
339#define REG_ADDR_VECT( scope, inst, reg, index ) \
340 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
341 (index) * STRIDE_##scope##_##reg )
342#endif
343
344/* C-code for register scope marb_bp */
345
346/* Register rw_first_addr, scope marb_bp, type rw */
347typedef unsigned int reg_marb_bp_rw_first_addr;
348#define REG_RD_ADDR_marb_bp_rw_first_addr 0
349#define REG_WR_ADDR_marb_bp_rw_first_addr 0
350
351/* Register rw_last_addr, scope marb_bp, type rw */
352typedef unsigned int reg_marb_bp_rw_last_addr;
353#define REG_RD_ADDR_marb_bp_rw_last_addr 4
354#define REG_WR_ADDR_marb_bp_rw_last_addr 4
355
356/* Register rw_op, scope marb_bp, type rw */
357typedef struct {
358 unsigned int rd : 1;
359 unsigned int wr : 1;
360 unsigned int rd_excl : 1;
361 unsigned int pri_wr : 1;
362 unsigned int us_rd : 1;
363 unsigned int us_wr : 1;
364 unsigned int us_rd_excl : 1;
365 unsigned int us_pri_wr : 1;
366 unsigned int dummy1 : 24;
367} reg_marb_bp_rw_op;
368#define REG_RD_ADDR_marb_bp_rw_op 8
369#define REG_WR_ADDR_marb_bp_rw_op 8
370
371/* Register rw_clients, scope marb_bp, type rw */
372typedef struct {
373 unsigned int dma0 : 1;
374 unsigned int dma1 : 1;
375 unsigned int dma2 : 1;
376 unsigned int dma3 : 1;
377 unsigned int dma4 : 1;
378 unsigned int dma5 : 1;
379 unsigned int dma6 : 1;
380 unsigned int dma7 : 1;
381 unsigned int dma8 : 1;
382 unsigned int dma9 : 1;
383 unsigned int cpui : 1;
384 unsigned int cpud : 1;
385 unsigned int iop : 1;
386 unsigned int slave : 1;
387 unsigned int dummy1 : 18;
388} reg_marb_bp_rw_clients;
389#define REG_RD_ADDR_marb_bp_rw_clients 12
390#define REG_WR_ADDR_marb_bp_rw_clients 12
391
392/* Register rw_options, scope marb_bp, type rw */
393typedef struct {
394 unsigned int wrap : 1;
395 unsigned int dummy1 : 31;
396} reg_marb_bp_rw_options;
397#define REG_RD_ADDR_marb_bp_rw_options 16
398#define REG_WR_ADDR_marb_bp_rw_options 16
399
400/* Register r_brk_addr, scope marb_bp, type r */
401typedef unsigned int reg_marb_bp_r_brk_addr;
402#define REG_RD_ADDR_marb_bp_r_brk_addr 20
403
404/* Register r_brk_op, scope marb_bp, type r */
405typedef struct {
406 unsigned int rd : 1;
407 unsigned int wr : 1;
408 unsigned int rd_excl : 1;
409 unsigned int pri_wr : 1;
410 unsigned int us_rd : 1;
411 unsigned int us_wr : 1;
412 unsigned int us_rd_excl : 1;
413 unsigned int us_pri_wr : 1;
414 unsigned int dummy1 : 24;
415} reg_marb_bp_r_brk_op;
416#define REG_RD_ADDR_marb_bp_r_brk_op 24
417
418/* Register r_brk_clients, scope marb_bp, type r */
419typedef struct {
420 unsigned int dma0 : 1;
421 unsigned int dma1 : 1;
422 unsigned int dma2 : 1;
423 unsigned int dma3 : 1;
424 unsigned int dma4 : 1;
425 unsigned int dma5 : 1;
426 unsigned int dma6 : 1;
427 unsigned int dma7 : 1;
428 unsigned int dma8 : 1;
429 unsigned int dma9 : 1;
430 unsigned int cpui : 1;
431 unsigned int cpud : 1;
432 unsigned int iop : 1;
433 unsigned int slave : 1;
434 unsigned int dummy1 : 18;
435} reg_marb_bp_r_brk_clients;
436#define REG_RD_ADDR_marb_bp_r_brk_clients 28
437
438/* Register r_brk_first_client, scope marb_bp, type r */
439typedef struct {
440 unsigned int dma0 : 1;
441 unsigned int dma1 : 1;
442 unsigned int dma2 : 1;
443 unsigned int dma3 : 1;
444 unsigned int dma4 : 1;
445 unsigned int dma5 : 1;
446 unsigned int dma6 : 1;
447 unsigned int dma7 : 1;
448 unsigned int dma8 : 1;
449 unsigned int dma9 : 1;
450 unsigned int cpui : 1;
451 unsigned int cpud : 1;
452 unsigned int iop : 1;
453 unsigned int slave : 1;
454 unsigned int dummy1 : 18;
455} reg_marb_bp_r_brk_first_client;
456#define REG_RD_ADDR_marb_bp_r_brk_first_client 32
457
458/* Register r_brk_size, scope marb_bp, type r */
459typedef unsigned int reg_marb_bp_r_brk_size;
460#define REG_RD_ADDR_marb_bp_r_brk_size 36
461
462/* Register rw_ack, scope marb_bp, type rw */
463typedef unsigned int reg_marb_bp_rw_ack;
464#define REG_RD_ADDR_marb_bp_rw_ack 40
465#define REG_WR_ADDR_marb_bp_rw_ack 40
466
467
468/* Constants */
469enum {
470 regk_marb_bp_no = 0x00000000,
471 regk_marb_bp_rw_op_default = 0x00000000,
472 regk_marb_bp_rw_options_default = 0x00000000,
473 regk_marb_bp_yes = 0x00000001
474};
475#endif /* __marb_bp_defs_h */
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/pinmux_defs.h b/include/asm-cris/arch-v32/mach-fs/hwregs/pinmux_defs.h
new file mode 100644
index 000000000000..751eab5f191c
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/pinmux_defs.h
@@ -0,0 +1,357 @@
1#ifndef __pinmux_defs_h
2#define __pinmux_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/pinmux/rtl/guinness/pinmux_regs.r
7 * id: pinmux_regs.r,v 1.40 2005/02/09 16:22:59 perz Exp
8 * last modfied: Mon Apr 11 16:09:11 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile pinmux_defs.h ../../inst/pinmux/rtl/guinness/pinmux_regs.r
11 * id: $Id: pinmux_defs.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope pinmux */
86
87/* Register rw_pa, scope pinmux, type rw */
88typedef struct {
89 unsigned int pa0 : 1;
90 unsigned int pa1 : 1;
91 unsigned int pa2 : 1;
92 unsigned int pa3 : 1;
93 unsigned int pa4 : 1;
94 unsigned int pa5 : 1;
95 unsigned int pa6 : 1;
96 unsigned int pa7 : 1;
97 unsigned int csp2_n : 1;
98 unsigned int csp3_n : 1;
99 unsigned int csp5_n : 1;
100 unsigned int csp6_n : 1;
101 unsigned int hsh4 : 1;
102 unsigned int hsh5 : 1;
103 unsigned int hsh6 : 1;
104 unsigned int hsh7 : 1;
105 unsigned int dummy1 : 16;
106} reg_pinmux_rw_pa;
107#define REG_RD_ADDR_pinmux_rw_pa 0
108#define REG_WR_ADDR_pinmux_rw_pa 0
109
110/* Register rw_hwprot, scope pinmux, type rw */
111typedef struct {
112 unsigned int ser1 : 1;
113 unsigned int ser2 : 1;
114 unsigned int ser3 : 1;
115 unsigned int sser0 : 1;
116 unsigned int sser1 : 1;
117 unsigned int ata0 : 1;
118 unsigned int ata1 : 1;
119 unsigned int ata2 : 1;
120 unsigned int ata3 : 1;
121 unsigned int ata : 1;
122 unsigned int eth1 : 1;
123 unsigned int eth1_mgm : 1;
124 unsigned int timer : 1;
125 unsigned int p21 : 1;
126 unsigned int dummy1 : 18;
127} reg_pinmux_rw_hwprot;
128#define REG_RD_ADDR_pinmux_rw_hwprot 4
129#define REG_WR_ADDR_pinmux_rw_hwprot 4
130
131/* Register rw_pb_gio, scope pinmux, type rw */
132typedef struct {
133 unsigned int pb0 : 1;
134 unsigned int pb1 : 1;
135 unsigned int pb2 : 1;
136 unsigned int pb3 : 1;
137 unsigned int pb4 : 1;
138 unsigned int pb5 : 1;
139 unsigned int pb6 : 1;
140 unsigned int pb7 : 1;
141 unsigned int pb8 : 1;
142 unsigned int pb9 : 1;
143 unsigned int pb10 : 1;
144 unsigned int pb11 : 1;
145 unsigned int pb12 : 1;
146 unsigned int pb13 : 1;
147 unsigned int pb14 : 1;
148 unsigned int pb15 : 1;
149 unsigned int pb16 : 1;
150 unsigned int pb17 : 1;
151 unsigned int dummy1 : 14;
152} reg_pinmux_rw_pb_gio;
153#define REG_RD_ADDR_pinmux_rw_pb_gio 8
154#define REG_WR_ADDR_pinmux_rw_pb_gio 8
155
156/* Register rw_pb_iop, scope pinmux, type rw */
157typedef struct {
158 unsigned int pb0 : 1;
159 unsigned int pb1 : 1;
160 unsigned int pb2 : 1;
161 unsigned int pb3 : 1;
162 unsigned int pb4 : 1;
163 unsigned int pb5 : 1;
164 unsigned int pb6 : 1;
165 unsigned int pb7 : 1;
166 unsigned int pb8 : 1;
167 unsigned int pb9 : 1;
168 unsigned int pb10 : 1;
169 unsigned int pb11 : 1;
170 unsigned int pb12 : 1;
171 unsigned int pb13 : 1;
172 unsigned int pb14 : 1;
173 unsigned int pb15 : 1;
174 unsigned int pb16 : 1;
175 unsigned int pb17 : 1;
176 unsigned int dummy1 : 14;
177} reg_pinmux_rw_pb_iop;
178#define REG_RD_ADDR_pinmux_rw_pb_iop 12
179#define REG_WR_ADDR_pinmux_rw_pb_iop 12
180
181/* Register rw_pc_gio, scope pinmux, type rw */
182typedef struct {
183 unsigned int pc0 : 1;
184 unsigned int pc1 : 1;
185 unsigned int pc2 : 1;
186 unsigned int pc3 : 1;
187 unsigned int pc4 : 1;
188 unsigned int pc5 : 1;
189 unsigned int pc6 : 1;
190 unsigned int pc7 : 1;
191 unsigned int pc8 : 1;
192 unsigned int pc9 : 1;
193 unsigned int pc10 : 1;
194 unsigned int pc11 : 1;
195 unsigned int pc12 : 1;
196 unsigned int pc13 : 1;
197 unsigned int pc14 : 1;
198 unsigned int pc15 : 1;
199 unsigned int pc16 : 1;
200 unsigned int pc17 : 1;
201 unsigned int dummy1 : 14;
202} reg_pinmux_rw_pc_gio;
203#define REG_RD_ADDR_pinmux_rw_pc_gio 16
204#define REG_WR_ADDR_pinmux_rw_pc_gio 16
205
206/* Register rw_pc_iop, scope pinmux, type rw */
207typedef struct {
208 unsigned int pc0 : 1;
209 unsigned int pc1 : 1;
210 unsigned int pc2 : 1;
211 unsigned int pc3 : 1;
212 unsigned int pc4 : 1;
213 unsigned int pc5 : 1;
214 unsigned int pc6 : 1;
215 unsigned int pc7 : 1;
216 unsigned int pc8 : 1;
217 unsigned int pc9 : 1;
218 unsigned int pc10 : 1;
219 unsigned int pc11 : 1;
220 unsigned int pc12 : 1;
221 unsigned int pc13 : 1;
222 unsigned int pc14 : 1;
223 unsigned int pc15 : 1;
224 unsigned int pc16 : 1;
225 unsigned int pc17 : 1;
226 unsigned int dummy1 : 14;
227} reg_pinmux_rw_pc_iop;
228#define REG_RD_ADDR_pinmux_rw_pc_iop 20
229#define REG_WR_ADDR_pinmux_rw_pc_iop 20
230
231/* Register rw_pd_gio, scope pinmux, type rw */
232typedef struct {
233 unsigned int pd0 : 1;
234 unsigned int pd1 : 1;
235 unsigned int pd2 : 1;
236 unsigned int pd3 : 1;
237 unsigned int pd4 : 1;
238 unsigned int pd5 : 1;
239 unsigned int pd6 : 1;
240 unsigned int pd7 : 1;
241 unsigned int pd8 : 1;
242 unsigned int pd9 : 1;
243 unsigned int pd10 : 1;
244 unsigned int pd11 : 1;
245 unsigned int pd12 : 1;
246 unsigned int pd13 : 1;
247 unsigned int pd14 : 1;
248 unsigned int pd15 : 1;
249 unsigned int pd16 : 1;
250 unsigned int pd17 : 1;
251 unsigned int dummy1 : 14;
252} reg_pinmux_rw_pd_gio;
253#define REG_RD_ADDR_pinmux_rw_pd_gio 24
254#define REG_WR_ADDR_pinmux_rw_pd_gio 24
255
256/* Register rw_pd_iop, scope pinmux, type rw */
257typedef struct {
258 unsigned int pd0 : 1;
259 unsigned int pd1 : 1;
260 unsigned int pd2 : 1;
261 unsigned int pd3 : 1;
262 unsigned int pd4 : 1;
263 unsigned int pd5 : 1;
264 unsigned int pd6 : 1;
265 unsigned int pd7 : 1;
266 unsigned int pd8 : 1;
267 unsigned int pd9 : 1;
268 unsigned int pd10 : 1;
269 unsigned int pd11 : 1;
270 unsigned int pd12 : 1;
271 unsigned int pd13 : 1;
272 unsigned int pd14 : 1;
273 unsigned int pd15 : 1;
274 unsigned int pd16 : 1;
275 unsigned int pd17 : 1;
276 unsigned int dummy1 : 14;
277} reg_pinmux_rw_pd_iop;
278#define REG_RD_ADDR_pinmux_rw_pd_iop 28
279#define REG_WR_ADDR_pinmux_rw_pd_iop 28
280
281/* Register rw_pe_gio, scope pinmux, type rw */
282typedef struct {
283 unsigned int pe0 : 1;
284 unsigned int pe1 : 1;
285 unsigned int pe2 : 1;
286 unsigned int pe3 : 1;
287 unsigned int pe4 : 1;
288 unsigned int pe5 : 1;
289 unsigned int pe6 : 1;
290 unsigned int pe7 : 1;
291 unsigned int pe8 : 1;
292 unsigned int pe9 : 1;
293 unsigned int pe10 : 1;
294 unsigned int pe11 : 1;
295 unsigned int pe12 : 1;
296 unsigned int pe13 : 1;
297 unsigned int pe14 : 1;
298 unsigned int pe15 : 1;
299 unsigned int pe16 : 1;
300 unsigned int pe17 : 1;
301 unsigned int dummy1 : 14;
302} reg_pinmux_rw_pe_gio;
303#define REG_RD_ADDR_pinmux_rw_pe_gio 32
304#define REG_WR_ADDR_pinmux_rw_pe_gio 32
305
306/* Register rw_pe_iop, scope pinmux, type rw */
307typedef struct {
308 unsigned int pe0 : 1;
309 unsigned int pe1 : 1;
310 unsigned int pe2 : 1;
311 unsigned int pe3 : 1;
312 unsigned int pe4 : 1;
313 unsigned int pe5 : 1;
314 unsigned int pe6 : 1;
315 unsigned int pe7 : 1;
316 unsigned int pe8 : 1;
317 unsigned int pe9 : 1;
318 unsigned int pe10 : 1;
319 unsigned int pe11 : 1;
320 unsigned int pe12 : 1;
321 unsigned int pe13 : 1;
322 unsigned int pe14 : 1;
323 unsigned int pe15 : 1;
324 unsigned int pe16 : 1;
325 unsigned int pe17 : 1;
326 unsigned int dummy1 : 14;
327} reg_pinmux_rw_pe_iop;
328#define REG_RD_ADDR_pinmux_rw_pe_iop 36
329#define REG_WR_ADDR_pinmux_rw_pe_iop 36
330
331/* Register rw_usb_phy, scope pinmux, type rw */
332typedef struct {
333 unsigned int en_usb0 : 1;
334 unsigned int en_usb1 : 1;
335 unsigned int dummy1 : 30;
336} reg_pinmux_rw_usb_phy;
337#define REG_RD_ADDR_pinmux_rw_usb_phy 40
338#define REG_WR_ADDR_pinmux_rw_usb_phy 40
339
340
341/* Constants */
342enum {
343 regk_pinmux_no = 0x00000000,
344 regk_pinmux_rw_hwprot_default = 0x00000000,
345 regk_pinmux_rw_pa_default = 0x00000000,
346 regk_pinmux_rw_pb_gio_default = 0x00000000,
347 regk_pinmux_rw_pb_iop_default = 0x00000000,
348 regk_pinmux_rw_pc_gio_default = 0x00000000,
349 regk_pinmux_rw_pc_iop_default = 0x00000000,
350 regk_pinmux_rw_pd_gio_default = 0x00000000,
351 regk_pinmux_rw_pd_iop_default = 0x00000000,
352 regk_pinmux_rw_pe_gio_default = 0x00000000,
353 regk_pinmux_rw_pe_iop_default = 0x00000000,
354 regk_pinmux_rw_usb_phy_default = 0x00000000,
355 regk_pinmux_yes = 0x00000001
356};
357#endif /* __pinmux_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/reg_map.h b/include/asm-cris/arch-v32/mach-fs/hwregs/reg_map.h
index e31502838ec6..4146973a58b3 100644
--- a/include/asm-cris/arch-v32/hwregs/reg_map.h
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/reg_map.h
@@ -4,17 +4,17 @@
4/* 4/*
5 * This file is autogenerated from 5 * This file is autogenerated from
6 * file: ../../mod/fakereg.rmap 6 * file: ../../mod/fakereg.rmap
7 * id: fakereg.rmap,v 1.3 2004/02/11 19:53:22 ronny Exp 7 * id: fakereg.rmap,v 1.3 2004/02/11 19:53:22 ronny Exp
8 * last modified: Wed Feb 11 20:53:25 2004 8 * last modified: Wed Feb 11 20:53:25 2004
9 * file: ../../rtl/global.rmap 9 * file: ../../rtl/global.rmap
10 * id: global.rmap,v 1.3 2003/08/18 15:08:23 mikaeln Exp 10 * id: global.rmap,v 1.3 2003/08/18 15:08:23 mikaeln Exp
11 * last modified: Mon Aug 18 17:08:23 2003 11 * last modified: Mon Aug 18 17:08:23 2003
12 * file: ../../mod/modreg.rmap 12 * file: ../../mod/modreg.rmap
13 * id: modreg.rmap,v 1.31 2004/02/20 15:40:04 stefans Exp 13 * id: modreg.rmap,v 1.31 2004/02/20 15:40:04 stefans Exp
14 * last modified: Fri Feb 20 16:40:04 2004 14 * last modified: Fri Feb 20 16:40:04 2004
15 * 15 *
16 * by /n/asic/design/tools/rdesc/src/rdes2c -map -base 0xb0000000 ../../rtl/global.rmap ../../mod/modreg.rmap ../../inst/io_proc/rtl/guinness/iop_top.r ../../inst/memarb/rtl/guinness/marb_top.r ../../mod/fakereg.rmap 16 * by /n/asic/design/tools/rdesc/src/rdes2c -map -base 0xb0000000 ../../rtl/global.rmap ../../mod/modreg.rmap ../../inst/io_proc/rtl/guinness/iop_top.r ../../inst/memarb/rtl/guinness/marb_top.r ../../mod/fakereg.rmap
17 * id: $Id: reg_map.h,v 1.7 2005/04/24 18:30:58 starvik Exp $ 17 * id: $Id: reg_map.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
18 * Any changes here will be lost. 18 * Any changes here will be lost.
19 * 19 *
20 * -*- buffer-read-only: t -*- 20 * -*- buffer-read-only: t -*-
@@ -97,6 +97,7 @@ typedef enum {
97 regi_strcop = 0xb0030000, 97 regi_strcop = 0xb0030000,
98 regi_strmux = 0xb003a000, 98 regi_strmux = 0xb003a000,
99 regi_timer = 0xb001e000, 99 regi_timer = 0xb001e000,
100 regi_timer0 = 0xb001e000,
100 regi_timer2 = 0xb005e000, 101 regi_timer2 = 0xb005e000,
101 regi_trace = 0xb0040000, 102 regi_trace = 0xb0040000,
102} reg_scope_instances; 103} reg_scope_instances;
diff --git a/include/asm-cris/arch-v32/mach-fs/hwregs/strmux_defs.h b/include/asm-cris/arch-v32/mach-fs/hwregs/strmux_defs.h
new file mode 100644
index 000000000000..cbfaa867829e
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/strmux_defs.h
@@ -0,0 +1,127 @@
1#ifndef __strmux_defs_h
2#define __strmux_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/strmux/rtl/guinness/strmux_regs.r
7 * id: strmux_regs.r,v 1.10 2005/02/10 10:10:46 perz Exp
8 * last modfied: Mon Apr 11 16:09:43 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile strmux_defs.h ../../inst/strmux/rtl/guinness/strmux_regs.r
11 * id: $Id: strmux_defs.h,v 1.1 2007/02/13 11:55:30 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope strmux */
86
87/* Register rw_cfg, scope strmux, type rw */
88typedef struct {
89 unsigned int dma0 : 3;
90 unsigned int dma1 : 3;
91 unsigned int dma2 : 3;
92 unsigned int dma3 : 3;
93 unsigned int dma4 : 3;
94 unsigned int dma5 : 3;
95 unsigned int dma6 : 3;
96 unsigned int dma7 : 3;
97 unsigned int dma8 : 3;
98 unsigned int dma9 : 3;
99 unsigned int dummy1 : 2;
100} reg_strmux_rw_cfg;
101#define REG_RD_ADDR_strmux_rw_cfg 0
102#define REG_WR_ADDR_strmux_rw_cfg 0
103
104
105/* Constants */
106enum {
107 regk_strmux_ata = 0x00000003,
108 regk_strmux_eth0 = 0x00000001,
109 regk_strmux_eth1 = 0x00000004,
110 regk_strmux_ext0 = 0x00000001,
111 regk_strmux_ext1 = 0x00000001,
112 regk_strmux_ext2 = 0x00000001,
113 regk_strmux_ext3 = 0x00000001,
114 regk_strmux_iop0 = 0x00000002,
115 regk_strmux_iop1 = 0x00000001,
116 regk_strmux_off = 0x00000000,
117 regk_strmux_p21 = 0x00000004,
118 regk_strmux_rw_cfg_default = 0x00000000,
119 regk_strmux_ser0 = 0x00000002,
120 regk_strmux_ser1 = 0x00000002,
121 regk_strmux_ser2 = 0x00000004,
122 regk_strmux_ser3 = 0x00000003,
123 regk_strmux_sser0 = 0x00000003,
124 regk_strmux_sser1 = 0x00000003,
125 regk_strmux_strcop = 0x00000002
126};
127#endif /* __strmux_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/timer_defs.h b/include/asm-cris/arch-v32/mach-fs/hwregs/timer_defs.h
index 20c8c89ec076..76bcc591921d 100644
--- a/include/asm-cris/arch-v32/hwregs/timer_defs.h
+++ b/include/asm-cris/arch-v32/mach-fs/hwregs/timer_defs.h
@@ -4,11 +4,11 @@
4/* 4/*
5 * This file is autogenerated from 5 * This file is autogenerated from
6 * file: ../../inst/timer/rtl/timer_regs.r 6 * file: ../../inst/timer/rtl/timer_regs.r
7 * id: timer_regs.r,v 1.7 2003/03/11 11:16:59 perz Exp 7 * id: timer_regs.r,v 1.7 2003/03/11 11:16:59 perz Exp
8 * last modfied: Mon Apr 11 16:09:53 2005 8 * last modfied: Mon Apr 11 16:09:53 2005
9 * 9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile timer_defs.h ../../inst/timer/rtl/timer_regs.r 10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile timer_defs.h ../../inst/timer/rtl/timer_regs.r
11 * id: $Id: timer_defs.h,v 1.6 2005/04/24 18:30:58 starvik Exp $ 11 * id: $Id: timer_defs.h,v 1.1 2007/04/11 13:51:01 ricardw Exp $
12 * Any changes here will be lost. 12 * Any changes here will be lost.
13 * 13 *
14 * -*- buffer-read-only: t -*- 14 * -*- buffer-read-only: t -*-
diff --git a/include/asm-cris/arch-v32/mach-fs/pinmux.h b/include/asm-cris/arch-v32/mach-fs/pinmux.h
new file mode 100644
index 000000000000..c2b3036779df
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/pinmux.h
@@ -0,0 +1,38 @@
1#ifndef _ASM_CRIS_ARCH_PINMUX_H
2#define _ASM_CRIS_ARCH_PINMUX_H
3
4#define PORT_B 0
5#define PORT_C 1
6#define PORT_D 2
7#define PORT_E 3
8
9enum pin_mode {
10 pinmux_none = 0,
11 pinmux_fixed,
12 pinmux_gpio,
13 pinmux_iop
14};
15
16enum fixed_function {
17 pinmux_ser1,
18 pinmux_ser2,
19 pinmux_ser3,
20 pinmux_sser0,
21 pinmux_sser1,
22 pinmux_ata0,
23 pinmux_ata1,
24 pinmux_ata2,
25 pinmux_ata3,
26 pinmux_ata,
27 pinmux_eth1,
28 pinmux_timer
29};
30
31int crisv32_pinmux_init(void);
32int crisv32_pinmux_alloc(int port, int first_pin, int last_pin, enum pin_mode);
33int crisv32_pinmux_alloc_fixed(enum fixed_function function);
34int crisv32_pinmux_dealloc(int port, int first_pin, int last_pin);
35int crisv32_pinmux_dealloc_fixed(enum fixed_function function);
36void crisv32_pinmux_dump(void);
37
38#endif
diff --git a/include/asm-cris/arch-v32/mach-fs/startup.inc b/include/asm-cris/arch-v32/mach-fs/startup.inc
new file mode 100644
index 000000000000..4a10ccbd6cc1
--- /dev/null
+++ b/include/asm-cris/arch-v32/mach-fs/startup.inc
@@ -0,0 +1,77 @@
1#include <hwregs/asm/reg_map_asm.h>
2#include <hwregs/asm/bif_core_defs_asm.h>
3#include <hwregs/asm/gio_defs_asm.h>
4#include <hwregs/asm/config_defs_asm.h>
5
6 .macro GIO_INIT
7 move.d CONFIG_ETRAX_DEF_GIO_PA_OUT, $r0
8 move.d REG_ADDR(gio, regi_gio, rw_pa_dout), $r1
9 move.d $r0, [$r1]
10
11 move.d CONFIG_ETRAX_DEF_GIO_PA_OE, $r0
12 move.d REG_ADDR(gio, regi_gio, rw_pa_oe), $r1
13 move.d $r0, [$r1]
14
15 move.d CONFIG_ETRAX_DEF_GIO_PB_OUT, $r0
16 move.d REG_ADDR(gio, regi_gio, rw_pb_dout), $r1
17 move.d $r0, [$r1]
18
19 move.d CONFIG_ETRAX_DEF_GIO_PB_OE, $r0
20 move.d REG_ADDR(gio, regi_gio, rw_pb_oe), $r1
21 move.d $r0, [$r1]
22
23 move.d CONFIG_ETRAX_DEF_GIO_PC_OUT, $r0
24 move.d REG_ADDR(gio, regi_gio, rw_pc_dout), $r1
25 move.d $r0, [$r1]
26
27 move.d CONFIG_ETRAX_DEF_GIO_PC_OE, $r0
28 move.d REG_ADDR(gio, regi_gio, rw_pc_oe), $r1
29 move.d $r0, [$r1]
30
31 move.d CONFIG_ETRAX_DEF_GIO_PD_OUT, $r0
32 move.d REG_ADDR(gio, regi_gio, rw_pd_dout), $r1
33 move.d $r0, [$r1]
34
35 move.d CONFIG_ETRAX_DEF_GIO_PD_OE, $r0
36 move.d REG_ADDR(gio, regi_gio, rw_pd_oe), $r1
37 move.d $r0, [$r1]
38
39 move.d CONFIG_ETRAX_DEF_GIO_PE_OUT, $r0
40 move.d REG_ADDR(gio, regi_gio, rw_pe_dout), $r1
41 move.d $r0, [$r1]
42
43 move.d CONFIG_ETRAX_DEF_GIO_PE_OE, $r0
44 move.d REG_ADDR(gio, regi_gio, rw_pe_oe), $r1
45 move.d $r0, [$r1]
46 .endm
47
48 .macro START_CLOCKS
49 move.d REG_ADDR(config, regi_config, rw_clk_ctrl), $r1
50 move.d [$r1], $r0
51 or.d REG_STATE(config, rw_clk_ctrl, cpu, yes) | \
52 REG_STATE(config, rw_clk_ctrl, bif, yes) | \
53 REG_STATE(config, rw_clk_ctrl, fix_io, yes), $r0
54 move.d $r0, [$r1]
55 .endm
56
57 .macro SETUP_WAIT_STATES
58 ;; Set up waitstates etc
59 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp1_cfg), $r0
60 move.d CONFIG_ETRAX_MEM_GRP1_CONFIG, $r1
61 move.d $r1, [$r0]
62 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp2_cfg), $r0
63 move.d CONFIG_ETRAX_MEM_GRP2_CONFIG, $r1
64 move.d $r1, [$r0]
65 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp3_cfg), $r0
66 move.d CONFIG_ETRAX_MEM_GRP3_CONFIG, $r1
67 move.d $r1, [$r0]
68 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp4_cfg), $r0
69 move.d CONFIG_ETRAX_MEM_GRP4_CONFIG, $r1
70 move.d $r1, [$r0]
71#ifdef CONFIG_ETRAX_VCS_SIM
72 ;; Set up minimal flash waitstates
73 move.d 0, $r10
74 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp1_cfg), $r11
75 move.d $r10, [$r11]
76#endif
77 .endm
diff --git a/include/asm-cris/arch-v32/offset.h b/include/asm-cris/arch-v32/offset.h
index 597419b033f9..4442c4bd52f4 100644
--- a/include/asm-cris/arch-v32/offset.h
+++ b/include/asm-cris/arch-v32/offset.h
@@ -27,7 +27,7 @@
27#define THREAD_usp 4 /* offsetof(struct thread_struct, usp) */ 27#define THREAD_usp 4 /* offsetof(struct thread_struct, usp) */
28#define THREAD_ccs 8 /* offsetof(struct thread_struct, ccs) */ 28#define THREAD_ccs 8 /* offsetof(struct thread_struct, ccs) */
29 29
30#define TASK_pid 149 /* offsetof(struct task_struct, pid) */ 30#define TASK_pid 151 /* offsetof(struct task_struct, pid) */
31 31
32#define LCLONE_VM 256 /* CLONE_VM */ 32#define LCLONE_VM 256 /* CLONE_VM */
33#define LCLONE_UNTRACED 8388608 /* CLONE_UNTRACED */ 33#define LCLONE_UNTRACED 8388608 /* CLONE_UNTRACED */
diff --git a/include/asm-cris/arch-v32/page.h b/include/asm-cris/arch-v32/page.h
index fa454fe12425..20f1b4806bfe 100644
--- a/include/asm-cris/arch-v32/page.h
+++ b/include/asm-cris/arch-v32/page.h
@@ -7,11 +7,11 @@
7#define PAGE_OFFSET KSEG_C /* kseg_c is mapped to physical ram. */ 7#define PAGE_OFFSET KSEG_C /* kseg_c is mapped to physical ram. */
8 8
9/* 9/*
10 * Macros to convert between physical and virtual addresses. By stripiing a 10 * Macros to convert between physical and virtual addresses. By stripping a
11 * selected bit it's possible to convert between KSEG_x and 0x40000000 where the 11 * selected bit it's possible to convert between KSEG_x and 0x40000000 where the
12 * DRAM really resides. DRAM is virtually at 0xc. 12 * DRAM really resides. DRAM is virtually at 0xc.
13 */ 13 */
14#ifndef CONFIG_ETRAXFS_SIM 14#ifndef CONFIG_ETRAX_VCS_SIM
15#define __pa(x) ((unsigned long)(x) & 0x7fffffff) 15#define __pa(x) ((unsigned long)(x) & 0x7fffffff)
16#define __va(x) ((void *)((unsigned long)(x) | 0x80000000)) 16#define __va(x) ((void *)((unsigned long)(x) | 0x80000000))
17#else 17#else
diff --git a/include/asm-cris/arch-v32/pinmux.h b/include/asm-cris/arch-v32/pinmux.h
index a66dc9970919..bb09bce42e7a 100644
--- a/include/asm-cris/arch-v32/pinmux.h
+++ b/include/asm-cris/arch-v32/pinmux.h
@@ -34,6 +34,7 @@ int crisv32_pinmux_init(void);
34int crisv32_pinmux_alloc(int port, int first_pin, int last_pin, enum pin_mode); 34int crisv32_pinmux_alloc(int port, int first_pin, int last_pin, enum pin_mode);
35int crisv32_pinmux_alloc_fixed(enum fixed_function function); 35int crisv32_pinmux_alloc_fixed(enum fixed_function function);
36int crisv32_pinmux_dealloc(int port, int first_pin, int last_pin); 36int crisv32_pinmux_dealloc(int port, int first_pin, int last_pin);
37int crisv32_pinmux_dealloc_fixed(enum fixed_function function);
37void crisv32_pinmux_dump(void); 38void crisv32_pinmux_dump(void);
38 39
39#endif 40#endif
diff --git a/include/asm-cris/arch-v32/processor.h b/include/asm-cris/arch-v32/processor.h
index 5553b0cd02bf..f80b47790ca6 100644
--- a/include/asm-cris/arch-v32/processor.h
+++ b/include/asm-cris/arch-v32/processor.h
@@ -23,7 +23,7 @@ struct thread_struct {
23 * User-space process size. This is hardcoded into a few places, so don't 23 * User-space process size. This is hardcoded into a few places, so don't
24 * changed it unless everything's clear! 24 * changed it unless everything's clear!
25 */ 25 */
26#ifndef CONFIG_ETRAXFS_SIM 26#ifndef CONFIG_ETRAX_VCS_SIM
27#define TASK_SIZE (0xB0000000UL) 27#define TASK_SIZE (0xB0000000UL)
28#else 28#else
29#define TASK_SIZE (0xA0000000UL) 29#define TASK_SIZE (0xA0000000UL)
diff --git a/include/asm-cris/arch-v32/spinlock.h b/include/asm-cris/arch-v32/spinlock.h
index 5f43df0a5fb4..0d5709b983a1 100644
--- a/include/asm-cris/arch-v32/spinlock.h
+++ b/include/asm-cris/arch-v32/spinlock.h
@@ -1,40 +1,47 @@
1#ifndef __ASM_ARCH_SPINLOCK_H 1#ifndef __ASM_ARCH_SPINLOCK_H
2#define __ASM_ARCH_SPINLOCK_H 2#define __ASM_ARCH_SPINLOCK_H
3 3
4#include <asm/system.h> 4#include <linux/spinlock_types.h>
5 5
6#define RW_LOCK_BIAS 0x01000000 6#define RW_LOCK_BIAS 0x01000000
7#define SPIN_LOCK_UNLOCKED (spinlock_t) { 1 }
8#define spin_lock_init(x) do { *(x) = SPIN_LOCK_UNLOCKED; } while(0)
9
10#define spin_is_locked(x) (*(volatile signed char *)(&(x)->lock) <= 0)
11#define spin_unlock_wait(x) do { barrier(); } while(spin_is_locked(x))
12 7
13extern void cris_spin_unlock(void *l, int val); 8extern void cris_spin_unlock(void *l, int val);
14extern void cris_spin_lock(void *l); 9extern void cris_spin_lock(void *l);
15extern int cris_spin_trylock(void* l); 10extern int cris_spin_trylock(void *l);
16 11
17static inline void _raw_spin_unlock(spinlock_t *lock) 12static inline int __raw_spin_is_locked(raw_spinlock_t *x)
13{
14 return *(volatile signed char *)(&(x)->slock) <= 0;
15}
16
17static inline void __raw_spin_unlock(raw_spinlock_t *lock)
18{ 18{
19 __asm__ volatile ("move.d %1,%0" \ 19 __asm__ volatile ("move.d %1,%0" \
20 : "=m" (lock->lock) \ 20 : "=m" (lock->slock) \
21 : "r" (1) \ 21 : "r" (1) \
22 : "memory"); 22 : "memory");
23} 23}
24 24
25static inline int _raw_spin_trylock(spinlock_t *lock) 25static inline void __raw_spin_unlock_wait(raw_spinlock_t *lock)
26{
27 while (__raw_spin_is_locked(lock))
28 cpu_relax();
29}
30
31static inline int __raw_spin_trylock(raw_spinlock_t *lock)
26{ 32{
27 return cris_spin_trylock((void*)&lock->lock); 33 return cris_spin_trylock((void *)&lock->slock);
28} 34}
29 35
30static inline void _raw_spin_lock(spinlock_t *lock) 36static inline void __raw_spin_lock(raw_spinlock_t *lock)
31{ 37{
32 cris_spin_lock((void*)&lock->lock); 38 cris_spin_lock((void *)&lock->slock);
33} 39}
34 40
35static inline void _raw_spin_lock_flags (spinlock_t *lock, unsigned long flags) 41static inline void
42__raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags)
36{ 43{
37 _raw_spin_lock(lock); 44 __raw_spin_lock(lock);
38} 45}
39 46
40/* 47/*
@@ -46,120 +53,75 @@ static inline void _raw_spin_lock_flags (spinlock_t *lock, unsigned long flags)
46 * can "mix" irq-safe locks - any writer needs to get a 53 * can "mix" irq-safe locks - any writer needs to get a
47 * irq-safe write-lock, but readers can get non-irqsafe 54 * irq-safe write-lock, but readers can get non-irqsafe
48 * read-locks. 55 * read-locks.
56 *
49 */ 57 */
50typedef struct {
51 spinlock_t lock;
52 volatile int counter;
53#ifdef CONFIG_PREEMPT
54 unsigned int break_lock;
55#endif
56} rwlock_t;
57
58#define RW_LOCK_UNLOCKED (rwlock_t) { {1}, 0 }
59
60#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while (0)
61
62/**
63 * read_can_lock - would read_trylock() succeed?
64 * @lock: the rwlock in question.
65 */
66#define read_can_lock(x) ((int)(x)->counter >= 0)
67
68/**
69 * write_can_lock - would write_trylock() succeed?
70 * @lock: the rwlock in question.
71 */
72#define write_can_lock(x) ((x)->counter == 0)
73
74#define _raw_read_trylock(lock) generic_raw_read_trylock(lock)
75 58
76/* read_lock, read_unlock are pretty straightforward. Of course it somehow 59static inline int __raw_read_can_lock(raw_rwlock_t *x)
77 * sucks we end up saving/restoring flags twice for read_lock_irqsave aso. */
78
79static __inline__ void _raw_read_lock(rwlock_t *rw)
80{ 60{
81 unsigned long flags; 61 return (int)(x)->lock > 0;
82 local_irq_save(flags);
83 _raw_spin_lock(&rw->lock);
84
85 rw->counter++;
86
87 _raw_spin_unlock(&rw->lock);
88 local_irq_restore(flags);
89} 62}
90 63
91static __inline__ void _raw_read_unlock(rwlock_t *rw) 64static inline int __raw_write_can_lock(raw_rwlock_t *x)
92{ 65{
93 unsigned long flags; 66 return (x)->lock == RW_LOCK_BIAS;
94 local_irq_save(flags);
95 _raw_spin_lock(&rw->lock);
96
97 rw->counter--;
98
99 _raw_spin_unlock(&rw->lock);
100 local_irq_restore(flags);
101} 67}
102 68
103/* write_lock is less trivial. We optimistically grab the lock and check 69static inline void __raw_read_lock(raw_rwlock_t *rw)
104 * if we surprised any readers. If so we release the lock and wait till
105 * they're all gone before trying again
106 *
107 * Also note that we don't use the _irqsave / _irqrestore suffixes here.
108 * If we're called with interrupts enabled and we've got readers (or other
109 * writers) in interrupt handlers someone fucked up and we'd dead-lock
110 * sooner or later anyway. prumpf */
111
112static __inline__ void _raw_write_lock(rwlock_t *rw)
113{ 70{
114retry: 71 __raw_spin_lock(&rw->slock);
115 _raw_spin_lock(&rw->lock); 72 while (rw->lock == 0);
116 73 rw->lock--;
117 if(rw->counter != 0) { 74 __raw_spin_unlock(&rw->slock);
118 /* this basically never happens */
119 _raw_spin_unlock(&rw->lock);
120
121 while(rw->counter != 0);
122
123 goto retry;
124 }
125
126 /* got it. now leave without unlocking */
127 rw->counter = -1; /* remember we are locked */
128} 75}
129 76
130/* write_unlock is absolutely trivial - we don't have to wait for anything */ 77static inline void __raw_write_lock(raw_rwlock_t *rw)
131
132static __inline__ void _raw_write_unlock(rwlock_t *rw)
133{ 78{
134 rw->counter = 0; 79 __raw_spin_lock(&rw->slock);
135 _raw_spin_unlock(&rw->lock); 80 while (rw->lock != RW_LOCK_BIAS);
81 rw->lock == 0;
82 __raw_spin_unlock(&rw->slock);
136} 83}
137 84
138static __inline__ int _raw_write_trylock(rwlock_t *rw) 85static inline void __raw_read_unlock(raw_rwlock_t *rw)
139{ 86{
140 _raw_spin_lock(&rw->lock); 87 __raw_spin_lock(&rw->slock);
141 if (rw->counter != 0) { 88 rw->lock++;
142 /* this basically never happens */ 89 __raw_spin_unlock(&rw->slock);
143 _raw_spin_unlock(&rw->lock); 90}
144
145 return 0;
146 }
147 91
148 /* got it. now leave without unlocking */ 92static inline void __raw_write_unlock(raw_rwlock_t *rw)
149 rw->counter = -1; /* remember we are locked */ 93{
150 return 1; 94 __raw_spin_lock(&rw->slock);
95 while (rw->lock != RW_LOCK_BIAS);
96 rw->lock == RW_LOCK_BIAS;
97 __raw_spin_unlock(&rw->slock);
151} 98}
152 99
153static __inline__ int is_read_locked(rwlock_t *rw) 100static inline int __raw_read_trylock(raw_rwlock_t *rw)
154{ 101{
155 return rw->counter > 0; 102 int ret = 0;
103 __raw_spin_lock(&rw->slock);
104 if (rw->lock != 0) {
105 rw->lock--;
106 ret = 1;
107 }
108 __raw_spin_unlock(&rw->slock);
109 return ret;
156} 110}
157 111
158static __inline__ int is_write_locked(rwlock_t *rw) 112static inline int __raw_write_trylock(raw_rwlock_t *rw)
159{ 113{
160 return rw->counter < 0; 114 int ret = 0;
115 __raw_spin_lock(&rw->slock);
116 if (rw->lock == RW_LOCK_BIAS) {
117 rw->lock == 0;
118 ret = 1;
119 }
120 __raw_spin_unlock(&rw->slock);
121 return 1;
161} 122}
162 123
124
163#define _raw_spin_relax(lock) cpu_relax() 125#define _raw_spin_relax(lock) cpu_relax()
164#define _raw_read_relax(lock) cpu_relax() 126#define _raw_read_relax(lock) cpu_relax()
165#define _raw_write_relax(lock) cpu_relax() 127#define _raw_write_relax(lock) cpu_relax()
diff --git a/include/asm-cris/arch-v32/system.h b/include/asm-cris/arch-v32/system.h
index d20e2d6d64a3..6ca90f1f110a 100644
--- a/include/asm-cris/arch-v32/system.h
+++ b/include/asm-cris/arch-v32/system.h
@@ -66,13 +66,4 @@ struct __xchg_dummy { unsigned long a[100]; };
66#define local_irq_save(x) \ 66#define local_irq_save(x) \
67 __asm__ __volatile__ ("move $ccs, %0\n\tdi" : "=rm" (x) : : "memory"); 67 __asm__ __volatile__ ("move $ccs, %0\n\tdi" : "=rm" (x) : : "memory");
68 68
69#ifdef CONFIG_SMP
70typedef struct {
71 volatile unsigned int lock __attribute__ ((aligned(4)));
72#ifdef CONFIG_PREEMPT
73 unsigned int break_lock;
74#endif
75} spinlock_t;
76#endif
77
78#endif /* _ASM_CRIS_ARCH_SYSTEM_H */ 69#endif /* _ASM_CRIS_ARCH_SYSTEM_H */
diff --git a/include/asm-cris/arch-v32/timex.h b/include/asm-cris/arch-v32/timex.h
index 5a4aa285d5fd..2591d3c5ed9d 100644
--- a/include/asm-cris/arch-v32/timex.h
+++ b/include/asm-cris/arch-v32/timex.h
@@ -1,9 +1,9 @@
1#ifndef _ASM_CRIS_ARCH_TIMEX_H 1#ifndef _ASM_CRIS_ARCH_TIMEX_H
2#define _ASM_CRIS_ARCH_TIMEX_H 2#define _ASM_CRIS_ARCH_TIMEX_H
3 3
4#include <asm/arch/hwregs/reg_map.h> 4#include <hwregs/reg_map.h>
5#include <asm/arch/hwregs/reg_rdwr.h> 5#include <hwregs/reg_rdwr.h>
6#include <asm/arch/hwregs/timer_defs.h> 6#include <hwregs/timer_defs.h>
7 7
8/* 8/*
9 * The clock runs at 100MHz, we divide it by 1000000. If you change anything 9 * The clock runs at 100MHz, we divide it by 1000000. If you change anything
@@ -18,7 +18,7 @@
18 18
19/* Convert the value in step of 10 ns to 1us without overflow: */ 19/* Convert the value in step of 10 ns to 1us without overflow: */
20#define GET_JIFFIES_USEC() \ 20#define GET_JIFFIES_USEC() \
21 ( (TIMER0_DIV - REG_RD(timer, regi_timer, r_tmr0_data)) /100 ) 21 ((TIMER0_DIV - REG_RD(timer, regi_timer0, r_tmr0_data)) / 100)
22 22
23extern unsigned long get_ns_in_jiffie(void); 23extern unsigned long get_ns_in_jiffie(void);
24 24
diff --git a/include/asm-cris/arch-v32/unistd.h b/include/asm-cris/arch-v32/unistd.h
index 5d369d4439d9..0051114c63c7 100644
--- a/include/asm-cris/arch-v32/unistd.h
+++ b/include/asm-cris/arch-v32/unistd.h
@@ -16,7 +16,8 @@ type name(void) \
16 ".endif\n\t" \ 16 ".endif\n\t" \
17 "break 13" \ 17 "break 13" \
18 : "=r" (__a) \ 18 : "=r" (__a) \
19 : "r" (__n_)); \ 19 : "r" (__n_) \
20 : "memory"); \
20 if (__a >= 0) \ 21 if (__a >= 0) \
21 return (type) __a; \ 22 return (type) __a; \
22 errno = -__a; \ 23 errno = -__a; \
@@ -33,7 +34,8 @@ type name(type1 arg1) \
33 ".endif\n\t" \ 34 ".endif\n\t" \
34 "break 13" \ 35 "break 13" \
35 : "=r" (__a) \ 36 : "=r" (__a) \
36 : "r" (__n_), "0" (__a)); \ 37 : "r" (__n_), "0" (__a) \
38 : "memory"); \
37 if (__a >= 0) \ 39 if (__a >= 0) \
38 return (type) __a; \ 40 return (type) __a; \
39 errno = -__a; \ 41 errno = -__a; \
@@ -51,7 +53,8 @@ type name(type1 arg1,type2 arg2) \
51 ".endif\n\t" \ 53 ".endif\n\t" \
52 "break 13" \ 54 "break 13" \
53 : "=r" (__a) \ 55 : "=r" (__a) \
54 : "r" (__n_), "0" (__a), "r" (__b)); \ 56 : "r" (__n_), "0" (__a), "r" (__b) \
57 : "memory"); \
55 if (__a >= 0) \ 58 if (__a >= 0) \
56 return (type) __a; \ 59 return (type) __a; \
57 errno = -__a; \ 60 errno = -__a; \
@@ -70,7 +73,8 @@ type name(type1 arg1,type2 arg2,type3 arg3) \
70 ".endif\n\t" \ 73 ".endif\n\t" \
71 "break 13" \ 74 "break 13" \
72 : "=r" (__a) \ 75 : "=r" (__a) \
73 : "r" (__n_), "0" (__a), "r" (__b), "r" (__c)); \ 76 : "r" (__n_), "0" (__a), "r" (__b), "r" (__c) \
77 : "memory"); \
74 if (__a >= 0) \ 78 if (__a >= 0) \
75 return (type) __a; \ 79 return (type) __a; \
76 errno = -__a; \ 80 errno = -__a; \
@@ -91,7 +95,8 @@ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
91 "break 13" \ 95 "break 13" \
92 : "=r" (__a) \ 96 : "=r" (__a) \
93 : "r" (__n_), "0" (__a), "r" (__b), \ 97 : "r" (__n_), "0" (__a), "r" (__b), \
94 "r" (__c), "r" (__d)); \ 98 "r" (__c), "r" (__d)\
99 : "memory"); \
95 if (__a >= 0) \ 100 if (__a >= 0) \
96 return (type) __a; \ 101 return (type) __a; \
97 errno = -__a; \ 102 errno = -__a; \
@@ -114,7 +119,8 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
114 "break 13" \ 119 "break 13" \
115 : "=r" (__a) \ 120 : "=r" (__a) \
116 : "r" (__n_), "0" (__a), "r" (__b), \ 121 : "r" (__n_), "0" (__a), "r" (__b), \
117 "r" (__c), "r" (__d), "h" (__e)); \ 122 "r" (__c), "r" (__d), "h" (__e) \
123 : "memory"); \
118 if (__a >= 0) \ 124 if (__a >= 0) \
119 return (type) __a; \ 125 return (type) __a; \
120 errno = -__a; \ 126 errno = -__a; \
@@ -138,7 +144,8 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
138 "break 13" \ 144 "break 13" \
139 : "=r" (__a) \ 145 : "=r" (__a) \
140 : "r" (__n_), "0" (__a), "r" (__b), \ 146 : "r" (__n_), "0" (__a), "r" (__b), \
141 "r" (__c), "r" (__d), "h" (__e), "x" (__f)); \ 147 "r" (__c), "r" (__d), "h" (__e), "x" (__f) \
148 : "memory"); \
142 if (__a >= 0) \ 149 if (__a >= 0) \
143 return (type) __a; \ 150 return (type) __a; \
144 errno = -__a; \ 151 errno = -__a; \
diff --git a/include/asm-cris/atomic.h b/include/asm-cris/atomic.h
index 2949a945876a..5fc87768774a 100644
--- a/include/asm-cris/atomic.h
+++ b/include/asm-cris/atomic.h
@@ -91,7 +91,7 @@ static inline int atomic_inc_return(volatile atomic_t *v)
91 unsigned long flags; 91 unsigned long flags;
92 int retval; 92 int retval;
93 cris_atomic_save(v, flags); 93 cris_atomic_save(v, flags);
94 retval = (v->counter)++; 94 retval = ++(v->counter);
95 cris_atomic_restore(v, flags); 95 cris_atomic_restore(v, flags);
96 return retval; 96 return retval;
97} 97}
@@ -101,7 +101,7 @@ static inline int atomic_dec_return(volatile atomic_t *v)
101 unsigned long flags; 101 unsigned long flags;
102 int retval; 102 int retval;
103 cris_atomic_save(v, flags); 103 cris_atomic_save(v, flags);
104 retval = (v->counter)--; 104 retval = --(v->counter);
105 cris_atomic_restore(v, flags); 105 cris_atomic_restore(v, flags);
106 return retval; 106 return retval;
107} 107}
diff --git a/include/asm-cris/axisflashmap.h b/include/asm-cris/axisflashmap.h
index 7a8d3114e682..015ca5445ddd 100644
--- a/include/asm-cris/axisflashmap.h
+++ b/include/asm-cris/axisflashmap.h
@@ -10,23 +10,23 @@
10 */ 10 */
11 11
12#define PARTITION_TABLE_OFFSET 10 12#define PARTITION_TABLE_OFFSET 10
13#define PARTITION_TABLE_MAGIC 0xbeef /* Not a good magic */ 13#define PARTITION_TABLE_MAGIC 0xbeef /* Not a good magic */
14 14
15/* The partitiontable_head is located at offset +10: */ 15/* The partitiontable_head is located at offset +10: */
16struct partitiontable_head { 16struct partitiontable_head {
17 __u16 magic; /* PARTITION_TABLE_MAGIC */ 17 __u16 magic; /* PARTITION_TABLE_MAGIC */
18 __u16 size; /* Length of ptable block (not header) */ 18 __u16 size; /* Length of ptable block (entries + end marker) */
19 __u32 checksum; /* simple longword sum */ 19 __u32 checksum; /* simple longword sum, over entries + end marker */
20}; 20};
21 21
22/* And followed by partition table entries */ 22/* And followed by partition table entries */
23struct partitiontable_entry { 23struct partitiontable_entry {
24 __u32 offset; /* Offset is relative to the sector the ptable is in */ 24 __u32 offset; /* relative to the sector the ptable is in */
25 __u32 size; 25 __u32 size; /* in bytes */
26 __u32 checksum; /* simple longword sum */ 26 __u32 checksum; /* simple longword sum */
27 __u16 type; 27 __u16 type; /* see type codes below */
28 __u16 flags; /* bit 0: ro/rw = 1/0 */ 28 __u16 flags; /* bit 0: ro/rw = 1/0 */
29 __u32 future0; /* 16 bytes reserved for future use */ 29 __u32 future0; /* 16 bytes reserved for future use */
30 __u32 future1; 30 __u32 future1;
31 __u32 future2; 31 __u32 future2;
32 __u32 future3; 32 __u32 future3;
@@ -35,12 +35,27 @@ struct partitiontable_entry {
35#define PARTITIONTABLE_END_MARKER 0xFFFFFFFF 35#define PARTITIONTABLE_END_MARKER 0xFFFFFFFF
36#define PARTITIONTABLE_END_MARKER_SIZE 4 36#define PARTITIONTABLE_END_MARKER_SIZE 4
37 37
38/*#define PARTITION_TYPE_RESCUE 0x0000?*/ /* Not used, maybe it should? */ 38#define PARTITIONTABLE_END_PAD 10
39
40/* Complete structure for whole partition table */
41/* note that table may end before CONFIG_ETRAX_PTABLE_ENTRIES by setting
42 * offset of the last entry + 1 to PARTITIONTABLE_END_MARKER.
43 */
44struct partitiontable {
45 __u8 skip[PARTITION_TABLE_OFFSET];
46 struct partitiontable_head head;
47 struct partitiontable_entry entries[];
48};
49
39#define PARTITION_TYPE_PARAM 0x0001 50#define PARTITION_TYPE_PARAM 0x0001
40#define PARTITION_TYPE_KERNEL 0x0002 51#define PARTITION_TYPE_KERNEL 0x0002
41#define PARTITION_TYPE_JFFS 0x0003 52#define PARTITION_TYPE_JFFS 0x0003
53#define PARTITION_TYPE_JFFS2 0x0000
54
55#define PARTITION_FLAGS_READONLY_MASK 0x0001
56#define PARTITION_FLAGS_READONLY 0x0001
42 57
43/* The master mtd for the entire flash. */ 58/* The master mtd for the entire flash. */
44extern struct mtd_info* axisflash_mtd; 59extern struct mtd_info *axisflash_mtd;
45 60
46#endif 61#endif
diff --git a/include/asm-cris/bug.h b/include/asm-cris/bug.h
index 8dd6b23c15d6..fee12d4ae683 100644
--- a/include/asm-cris/bug.h
+++ b/include/asm-cris/bug.h
@@ -1,4 +1,4 @@
1#ifndef _CRIS_BUG_H 1#ifndef _CRIS_BUG_H
2#define _CRIS_BUG_H 2#define _CRIS_BUG_H
3#include <asm-generic/bug.h> 3#include <asm/arch/bug.h>
4#endif 4#endif
diff --git a/include/asm-cris/delay.h b/include/asm-cris/delay.h
index d3a397803719..123e19aef49d 100644
--- a/include/asm-cris/delay.h
+++ b/include/asm-cris/delay.h
@@ -13,10 +13,13 @@
13 13
14extern unsigned long loops_per_usec; /* arch/cris/mm/init.c */ 14extern unsigned long loops_per_usec; /* arch/cris/mm/init.c */
15 15
16/* May be defined by arch/delay.h. */
17#ifndef udelay
16static inline void udelay(unsigned long usecs) 18static inline void udelay(unsigned long usecs)
17{ 19{
18 __delay(usecs * loops_per_usec); 20 __delay(usecs * loops_per_usec);
19} 21}
22#endif
20 23
21#endif /* defined(_CRIS_DELAY_H) */ 24#endif /* defined(_CRIS_DELAY_H) */
22 25
diff --git a/include/asm-cris/dma-mapping.h b/include/asm-cris/dma-mapping.h
index 662cea70152d..edc8d1bfaae2 100644
--- a/include/asm-cris/dma-mapping.h
+++ b/include/asm-cris/dma-mapping.h
@@ -164,16 +164,5 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size,
164{ 164{
165} 165}
166 166
167#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
168extern int
169dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
170 dma_addr_t device_addr, size_t size, int flags);
171
172extern void
173dma_release_declared_memory(struct device *dev);
174
175extern void *
176dma_mark_declared_memory_occupied(struct device *dev,
177 dma_addr_t device_addr, size_t size);
178 167
179#endif 168#endif
diff --git a/include/asm-cris/etraxgpio.h b/include/asm-cris/etraxgpio.h
index 5d0028dba7c6..38f1c8e1770c 100644
--- a/include/asm-cris/etraxgpio.h
+++ b/include/asm-cris/etraxgpio.h
@@ -1,25 +1,34 @@
1/* $Id: etraxgpio.h,v 1.8 2002/06/17 15:53:07 johana Exp $ */
2/* 1/*
3 * The following devices are accessable using this driver using 2 * The following devices are accessable using this driver using
4 * GPIO_MAJOR (120) and a couple of minor numbers: 3 * GPIO_MAJOR (120) and a couple of minor numbers.
5 * For ETRAX 100LX (ARCH_V10): 4 *
5 * For ETRAX 100LX (CONFIG_ETRAX_ARCH_V10):
6 * /dev/gpioa minor 0, 8 bit GPIO, each bit can change direction 6 * /dev/gpioa minor 0, 8 bit GPIO, each bit can change direction
7 * /dev/gpiob minor 1, 8 bit GPIO, each bit can change direction 7 * /dev/gpiob minor 1, 8 bit GPIO, each bit can change direction
8 * /dev/leds minor 2, Access to leds depending on kernelconfig 8 * /dev/leds minor 2, Access to leds depending on kernelconfig
9 * /dev/gpiog minor 3 9 * /dev/gpiog minor 3
10 g0dir, g8_15dir, g16_23dir, g24 dir configurable in R_GEN_CONFIG 10 * g0dir, g8_15dir, g16_23dir, g24 dir configurable in R_GEN_CONFIG
11 g1-g7 and g25-g31 is both input and outputs but on different pins 11 * g1-g7 and g25-g31 is both input and outputs but on different pins
12 Also note that some bits change pins depending on what interfaces 12 * Also note that some bits change pins depending on what interfaces
13 are enabled. 13 * are enabled.
14 * 14 *
15 * For ETRAX FS (CONFIG_ETRAXFS):
16 * /dev/gpioa minor 0, 8 bit GPIO, each bit can change direction
17 * /dev/gpiob minor 1, 18 bit GPIO, each bit can change direction
18 * /dev/gpioc minor 3, 18 bit GPIO, each bit can change direction
19 * /dev/gpiod minor 4, 18 bit GPIO, each bit can change direction
20 * /dev/gpioe minor 5, 18 bit GPIO, each bit can change direction
21 * /dev/leds minor 2, Access to leds depending on kernelconfig
15 * 22 *
16 * For ETRAX FS (ARCH_V32): 23 * For ARTPEC-3 (CONFIG_CRIS_MACH_ARTPEC3):
17 * /dev/gpioa minor 0, 8 bit GPIO, each bit can change direction 24 * /dev/gpioa minor 0, 8 bit GPIO, each bit can change direction
18 * /dev/gpiob minor 1, 18 bit GPIO, each bit can change direction 25 * /dev/gpiob minor 1, 18 bit GPIO, each bit can change direction
19 * /dev/gpioc minor 2, 18 bit GPIO, each bit can change direction 26 * /dev/gpioc minor 3, 18 bit GPIO, each bit can change direction
20 * /dev/gpiod minor 3, 18 bit GPIO, each bit can change direction 27 * /dev/gpiod minor 4, 18 bit GPIO, each bit can change direction
21 * /dev/gpioe minor 4, 18 bit GPIO, each bit can change direction 28 * /dev/leds minor 2, Access to leds depending on kernelconfig
22 * /dev/leds minor 5, Access to leds depending on kernelconfig 29 * /dev/pwm0 minor 16, PWM channel 0 on PA30
30 * /dev/pwm1 minor 17, PWM channel 1 on PA31
31 * /dev/pwm2 minor 18, PWM channel 2 on PB26
23 * 32 *
24 */ 33 */
25#ifndef _ASM_ETRAXGPIO_H 34#ifndef _ASM_ETRAXGPIO_H
@@ -34,7 +43,8 @@
34#define GPIO_MINOR_G 3 43#define GPIO_MINOR_G 3
35#define GPIO_MINOR_LAST 3 44#define GPIO_MINOR_LAST 3
36#endif 45#endif
37#ifdef CONFIG_ETRAX_ARCH_V32 46
47#ifdef CONFIG_ETRAXFS
38#define ETRAXGPIO_IOCTYPE 43 48#define ETRAXGPIO_IOCTYPE 43
39#define GPIO_MINOR_A 0 49#define GPIO_MINOR_A 0
40#define GPIO_MINOR_B 1 50#define GPIO_MINOR_B 1
@@ -42,8 +52,32 @@
42#define GPIO_MINOR_C 3 52#define GPIO_MINOR_C 3
43#define GPIO_MINOR_D 4 53#define GPIO_MINOR_D 4
44#define GPIO_MINOR_E 5 54#define GPIO_MINOR_E 5
55#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
56#define GPIO_MINOR_V 6
57#define GPIO_MINOR_LAST 6
58#else
45#define GPIO_MINOR_LAST 5 59#define GPIO_MINOR_LAST 5
46#endif 60#endif
61#endif
62
63#ifdef CONFIG_CRIS_MACH_ARTPEC3
64#define ETRAXGPIO_IOCTYPE 43
65#define GPIO_MINOR_A 0
66#define GPIO_MINOR_B 1
67#define GPIO_MINOR_LEDS 2
68#define GPIO_MINOR_C 3
69#define GPIO_MINOR_D 4
70#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
71#define GPIO_MINOR_V 6
72#define GPIO_MINOR_LAST 6
73#else
74#define GPIO_MINOR_LAST 4
75#endif
76#define GPIO_MINOR_PWM0 16
77#define GPIO_MINOR_PWM1 17
78#define GPIO_MINOR_PWM2 18
79#define GPIO_MINOR_LAST_PWM GPIO_MINOR_PWM2
80#endif
47 81
48/* supported ioctl _IOC_NR's */ 82/* supported ioctl _IOC_NR's */
49 83
@@ -63,7 +97,7 @@
63 97
64/* GPIO direction ioctl's */ 98/* GPIO direction ioctl's */
65#define IO_READDIR 0x8 /* Read direction 0=input 1=output (obsolete) */ 99#define IO_READDIR 0x8 /* Read direction 0=input 1=output (obsolete) */
66#define IO_SETINPUT 0x9 /* Set direction for bits set, 0=unchanged 1=input, 100#define IO_SETINPUT 0x9 /* Set direction for bits set, 0=unchanged 1=input,
67 returns mask with current inputs (obsolete) */ 101 returns mask with current inputs (obsolete) */
68#define IO_SETOUTPUT 0xA /* Set direction for bits set, 0=unchanged 1=output, 102#define IO_SETOUTPUT 0xA /* Set direction for bits set, 0=unchanged 1=output,
69 returns mask with current outputs (obsolete)*/ 103 returns mask with current outputs (obsolete)*/
@@ -77,13 +111,13 @@
77#define IO_GET_PWR_BT 0xE 111#define IO_GET_PWR_BT 0xE
78 112
79/* Bit toggling in driver settings */ 113/* Bit toggling in driver settings */
80/* bit set in low byte0 is CLK mask (0x00FF), 114/* bit set in low byte0 is CLK mask (0x00FF),
81 bit set in byte1 is DATA mask (0xFF00) 115 bit set in byte1 is DATA mask (0xFF00)
82 msb, data_mask[7:0] , clk_mask[7:0] 116 msb, data_mask[7:0] , clk_mask[7:0]
83 */ 117 */
84#define IO_CFG_WRITE_MODE 0xF 118#define IO_CFG_WRITE_MODE 0xF
85#define IO_CFG_WRITE_MODE_VALUE(msb, data_mask, clk_mask) \ 119#define IO_CFG_WRITE_MODE_VALUE(msb, data_mask, clk_mask) \
86 ( (((msb)&1) << 16) | (((data_mask) &0xFF) << 8) | ((clk_mask) & 0xFF) ) 120 ( (((msb)&1) << 16) | (((data_mask) &0xFF) << 8) | ((clk_mask) & 0xFF) )
87 121
88/* The following 4 ioctl's take a pointer as argument and handles 122/* The following 4 ioctl's take a pointer as argument and handles
89 * 32 bit ports (port G) properly. 123 * 32 bit ports (port G) properly.
@@ -98,6 +132,48 @@
98 * *arg updated with current output pins. 132 * *arg updated with current output pins.
99 */ 133 */
100 134
135/* The following ioctl's are applicable to the PWM channels only */
136
137#define IO_PWM_SET_MODE 0x20
138
139enum io_pwm_mode {
140 PWM_OFF = 0, /* disabled, deallocated */
141 PWM_STANDARD = 1, /* 390 kHz, duty cycle 0..255/256 */
142 PWM_FAST = 2, /* variable freq, w/ 10ns active pulse len */
143 PWM_VARFREQ = 3 /* individually configurable high/low periods */
144};
145
146struct io_pwm_set_mode {
147 enum io_pwm_mode mode;
148};
149
150/* Only for mode PWM_VARFREQ. Period lo/high set in increments of 10ns
151 * from 10ns (value = 0) to 81920ns (value = 8191)
152 * (Resulting frequencies range from 50 MHz (10ns + 10ns) down to
153 * 6.1 kHz (81920ns + 81920ns) at 50% duty cycle, to 12.2 kHz at min/max duty
154 * cycle (81920 + 10ns or 10ns + 81920ns, respectively).)
155 */
156#define IO_PWM_SET_PERIOD 0x21
157
158struct io_pwm_set_period {
159 unsigned int lo; /* 0..8191 */
160 unsigned int hi; /* 0..8191 */
161};
162
163/* Only for modes PWM_STANDARD and PWM_FAST.
164 * For PWM_STANDARD, set duty cycle of 390 kHz PWM output signal, from
165 * 0 (value = 0) to 255/256 (value = 255).
166 * For PWM_FAST, set duty cycle of PWM output signal from
167 * 0% (value = 0) to 100% (value = 255). Output signal in this mode
168 * is a 10ns pulse surrounded by a high or low level depending on duty
169 * cycle (except for 0% and 100% which result in a constant output).
170 * Resulting output frequency varies from 50 MHz at 50% duty cycle,
171 * down to 390 kHz at min/max duty cycle.
172 */
173#define IO_PWM_SET_DUTY 0x22
101 174
175struct io_pwm_set_duty {
176 int duty; /* 0..255 */
177};
102 178
103#endif 179#endif
diff --git a/include/asm-cris/io.h b/include/asm-cris/io.h
index d196dd6b2df3..b87ce63f531f 100644
--- a/include/asm-cris/io.h
+++ b/include/asm-cris/io.h
@@ -122,8 +122,8 @@ static inline void writel(unsigned int b, volatile void __iomem *addr)
122#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) 122#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
123 123
124 124
125/* The following is junk needed for the arch-independent code but which 125/* I/O port access. Normally there is no I/O space on CRIS but when
126 * we never use in the CRIS port 126 * Cardbus/PCI is enabled the request is passed through the bridge.
127 */ 127 */
128 128
129#define IO_SPACE_LIMIT 0xffff 129#define IO_SPACE_LIMIT 0xffff
diff --git a/include/asm-cris/pgtable.h b/include/asm-cris/pgtable.h
index 417f71116215..a2607575681b 100644
--- a/include/asm-cris/pgtable.h
+++ b/include/asm-cris/pgtable.h
@@ -249,7 +249,7 @@ static inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address)
249#define pte_unmap(pte) do { } while (0) 249#define pte_unmap(pte) do { } while (0)
250#define pte_unmap_nested(pte) do { } while (0) 250#define pte_unmap_nested(pte) do { } while (0)
251#define pte_pfn(x) ((unsigned long)(__va((x).pte)) >> PAGE_SHIFT) 251#define pte_pfn(x) ((unsigned long)(__va((x).pte)) >> PAGE_SHIFT)
252#define pfn_pte(pfn, prot) __pte((__pa((pfn) << PAGE_SHIFT)) | pgprot_val(prot)) 252#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
253 253
254#define pte_ERROR(e) \ 254#define pte_ERROR(e) \
255 printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), pte_val(e)) 255 printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), pte_val(e))
diff --git a/include/asm-cris/rtc.h b/include/asm-cris/rtc.h
index cb4bf9217fee..17d3019529e1 100644
--- a/include/asm-cris/rtc.h
+++ b/include/asm-cris/rtc.h
@@ -1,10 +1,7 @@
1/* $Id: rtc.h,v 1.7 2002/11/04 07:32:09 starvik Exp $ */
2 1
3#ifndef __RTC_H__ 2#ifndef __RTC_H__
4#define __RTC_H__ 3#define __RTC_H__
5 4
6
7
8#ifdef CONFIG_ETRAX_DS1302 5#ifdef CONFIG_ETRAX_DS1302
9 /* Dallas DS1302 clock/calendar register numbers. */ 6 /* Dallas DS1302 clock/calendar register numbers. */
10# define RTC_SECONDS 0 7# define RTC_SECONDS 0
@@ -17,17 +14,17 @@
17# define RTC_CONTROL 7 14# define RTC_CONTROL 7
18 15
19 /* Bits in CONTROL register. */ 16 /* Bits in CONTROL register. */
20# define RTC_CONTROL_WRITEPROTECT 0x80 17# define RTC_CONTROL_WRITEPROTECT 0x80
21# define RTC_TRICKLECHARGER 8 18# define RTC_TRICKLECHARGER 8
22 19
23 /* Bits in TRICKLECHARGER register TCS TCS TCS TCS DS DS RS RS. */ 20 /* Bits in TRICKLECHARGER register TCS TCS TCS TCS DS DS RS RS. */
24# define RTC_TCR_PATTERN 0xA0 /* 1010xxxx */ 21# define RTC_TCR_PATTERN 0xA0 /* 1010xxxx */
25# define RTC_TCR_1DIOD 0x04 /* xxxx01xx */ 22# define RTC_TCR_1DIOD 0x04 /* xxxx01xx */
26# define RTC_TCR_2DIOD 0x08 /* xxxx10xx */ 23# define RTC_TCR_2DIOD 0x08 /* xxxx10xx */
27# define RTC_TCR_DISABLED 0x00 /* xxxxxx00 Disabled */ 24# define RTC_TCR_DISABLED 0x00 /* xxxxxx00 Disabled */
28# define RTC_TCR_2KOHM 0x01 /* xxxxxx01 2KOhm */ 25# define RTC_TCR_2KOHM 0x01 /* xxxxxx01 2KOhm */
29# define RTC_TCR_4KOHM 0x02 /* xxxxxx10 4kOhm */ 26# define RTC_TCR_4KOHM 0x02 /* xxxxxx10 4kOhm */
30# define RTC_TCR_8KOHM 0x03 /* xxxxxx11 8kOhm */ 27# define RTC_TCR_8KOHM 0x03 /* xxxxxx11 8kOhm */
31 28
32#elif defined(CONFIG_ETRAX_PCF8563) 29#elif defined(CONFIG_ETRAX_PCF8563)
33 /* I2C bus slave registers. */ 30 /* I2C bus slave registers. */
@@ -79,7 +76,7 @@ extern int pcf8563_init(void);
79 76
80/* 77/*
81 * The struct used to pass data via the following ioctl. Similar to the 78 * The struct used to pass data via the following ioctl. Similar to the
82 * struct tm in <time.h>, but it needs to be here so that the kernel 79 * struct tm in <time.h>, but it needs to be here so that the kernel
83 * source is self contained, allowing cross-compiles, etc. etc. 80 * source is self contained, allowing cross-compiles, etc. etc.
84 */ 81 */
85struct rtc_time { 82struct rtc_time {
@@ -96,11 +93,15 @@ struct rtc_time {
96 93
97/* ioctl() calls that are permitted to the /dev/rtc interface. */ 94/* ioctl() calls that are permitted to the /dev/rtc interface. */
98#define RTC_MAGIC 'p' 95#define RTC_MAGIC 'p'
99#define RTC_RD_TIME _IOR(RTC_MAGIC, 0x09, struct rtc_time) /* Read RTC time. */ 96/* Read RTC time. */
100#define RTC_SET_TIME _IOW(RTC_MAGIC, 0x0a, struct rtc_time) /* Set RTC time. */ 97#define RTC_RD_TIME _IOR(RTC_MAGIC, 0x09, struct rtc_time)
101#define RTC_SET_CHARGE _IOW(RTC_MAGIC, 0x0b, int) 98/* Set RTC time. */
102#define RTC_VLOW_RD _IOR(RTC_MAGIC, 0x11, int) /* Voltage Low detector */ 99#define RTC_SET_TIME _IOW(RTC_MAGIC, 0x0a, struct rtc_time)
103#define RTC_VLOW_SET _IO(RTC_MAGIC, 0x12) /* Clear voltage low information */ 100#define RTC_SET_CHARGE _IOW(RTC_MAGIC, 0x0b, int)
104#define RTC_MAX_IOCTL 0x12 101/* Voltage low detector */
102#define RTC_VL_READ _IOR(RTC_MAGIC, 0x13, int)
103/* Clear voltage low information */
104#define RTC_VL_CLR _IO(RTC_MAGIC, 0x14)
105#define RTC_MAX_IOCTL 0x14
105 106
106#endif /* __RTC_H__ */ 107#endif /* __RTC_H__ */
diff --git a/include/asm-cris/smp.h b/include/asm-cris/smp.h
index dca5ef1d8c97..dba33aba3e95 100644
--- a/include/asm-cris/smp.h
+++ b/include/asm-cris/smp.h
@@ -4,8 +4,8 @@
4#include <linux/cpumask.h> 4#include <linux/cpumask.h>
5 5
6extern cpumask_t phys_cpu_present_map; 6extern cpumask_t phys_cpu_present_map;
7#define cpu_possible_map phys_cpu_present_map 7extern cpumask_t cpu_possible_map;
8 8
9#define __smp_processor_id() (current_thread_info()->cpu) 9#define raw_smp_processor_id() (current_thread_info()->cpu)
10 10
11#endif 11#endif
diff --git a/include/asm-cris/sync_serial.h b/include/asm-cris/sync_serial.h
index f930b6e00663..d87c24df2b38 100644
--- a/include/asm-cris/sync_serial.h
+++ b/include/asm-cris/sync_serial.h
@@ -67,6 +67,7 @@
67/* Values for SSP_FRAME_SYNC */ 67/* Values for SSP_FRAME_SYNC */
68#define NORMAL_SYNC 1 68#define NORMAL_SYNC 1
69#define EARLY_SYNC 2 69#define EARLY_SYNC 2
70#define SECOND_WORD_SYNC 0x40000
70 71
71#define BIT_SYNC 4 72#define BIT_SYNC 4
72#define WORD_SYNC 8 73#define WORD_SYNC 8
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h
index bd57a7949170..007cb16a6b5b 100644
--- a/include/asm-cris/unistd.h
+++ b/include/asm-cris/unistd.h
@@ -326,9 +326,11 @@
326#define __NR_epoll_pwait 319 326#define __NR_epoll_pwait 319
327#define __NR_utimensat 320 327#define __NR_utimensat 320
328#define __NR_signalfd 321 328#define __NR_signalfd 321
329#define __NR_timerfd 322 329#define __NR_timerfd_create 322
330#define __NR_eventfd 323 330#define __NR_eventfd 323
331#define __NR_fallocate 324 331#define __NR_fallocate 324
332#define __NR_timerfd_settime 315
333#define __NR_timerfd_gettime 316
332 334
333#ifdef __KERNEL__ 335#ifdef __KERNEL__
334 336