aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/Kconfig103
-rw-r--r--arch/sh/Kconfig.cpu2
-rw-r--r--arch/sh/Kconfig.debug1
-rw-r--r--arch/sh/Makefile23
-rw-r--r--arch/sh/boards/Kconfig27
-rw-r--r--arch/sh/boards/board-apsh4a3a.c10
-rw-r--r--arch/sh/boards/board-apsh4ad0a.c10
-rw-r--r--arch/sh/boards/board-edosk7705.c4
-rw-r--r--arch/sh/boards/board-edosk7760.c16
-rw-r--r--arch/sh/boards/board-espt.c7
-rw-r--r--arch/sh/boards/board-magicpanelr2.c71
-rw-r--r--arch/sh/boards/board-polaris.c13
-rw-r--r--arch/sh/boards/board-secureedge5410.c4
-rw-r--r--arch/sh/boards/board-sh2007.c12
-rw-r--r--arch/sh/boards/board-sh7757lcr.c102
-rw-r--r--arch/sh/boards/board-sh7785lcr.c16
-rw-r--r--arch/sh/boards/board-urquell.c3
-rw-r--r--arch/sh/boards/mach-ap325rxa/setup.c85
-rw-r--r--arch/sh/boards/mach-cayman/irq.c2
-rw-r--r--arch/sh/boards/mach-cayman/setup.c1
-rw-r--r--arch/sh/boards/mach-dreamcast/irq.c32
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c359
-rw-r--r--arch/sh/boards/mach-highlander/setup.c2
-rw-r--r--arch/sh/boards/mach-hp6xx/hp6xx_apm.c2
-rw-r--r--arch/sh/boards/mach-hp6xx/pm.c1
-rw-r--r--arch/sh/boards/mach-hp6xx/setup.c5
-rw-r--r--arch/sh/boards/mach-kfr2r09/lcd_wqvga.c22
-rw-r--r--arch/sh/boards/mach-kfr2r09/setup.c57
-rw-r--r--arch/sh/boards/mach-lboxre2/setup.c1
-rw-r--r--arch/sh/boards/mach-microdev/irq.c1
-rw-r--r--arch/sh/boards/mach-microdev/setup.c1
-rw-r--r--arch/sh/boards/mach-migor/lcd_qvga.c3
-rw-r--r--arch/sh/boards/mach-migor/setup.c65
-rw-r--r--arch/sh/boards/mach-rsk/Kconfig10
-rw-r--r--arch/sh/boards/mach-rsk/Makefile2
-rw-r--r--arch/sh/boards/mach-rsk/devices-rsk7264.c58
-rw-r--r--arch/sh/boards/mach-rsk/devices-rsk7269.c60
-rw-r--r--arch/sh/boards/mach-rsk/setup.c53
-rw-r--r--arch/sh/boards/mach-sdk7780/setup.c1
-rw-r--r--arch/sh/boards/mach-sdk7786/setup.c12
-rw-r--r--arch/sh/boards/mach-se/7206/setup.c1
-rw-r--r--arch/sh/boards/mach-se/7343/irq.c129
-rw-r--r--arch/sh/boards/mach-se/7343/setup.c10
-rw-r--r--arch/sh/boards/mach-se/770x/setup.c11
-rw-r--r--arch/sh/boards/mach-se/7721/setup.c1
-rw-r--r--arch/sh/boards/mach-se/7722/irq.c131
-rw-r--r--arch/sh/boards/mach-se/7722/setup.c12
-rw-r--r--arch/sh/boards/mach-se/7724/irq.c36
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c121
-rw-r--r--arch/sh/boards/mach-se/7751/setup.c1
-rw-r--r--arch/sh/boards/mach-se/7780/setup.c1
-rw-r--r--arch/sh/boards/mach-se/board-se7619.c1
-rw-r--r--arch/sh/boards/mach-sh03/setup.c1
-rw-r--r--arch/sh/boards/mach-sh7763rdp/setup.c8
-rw-r--r--arch/sh/boards/mach-x3proto/gpio.c57
-rw-r--r--arch/sh/boot/Makefile14
-rw-r--r--arch/sh/cchips/hd6446x/hd64461.c33
-rw-r--r--arch/sh/configs/apsh4ad0a_defconfig2
-rw-r--r--arch/sh/configs/ecovec24_defconfig2
-rw-r--r--arch/sh/configs/rsk7264_defconfig80
-rw-r--r--arch/sh/configs/rsk7269_defconfig65
-rw-r--r--arch/sh/configs/sdk7786_defconfig4
-rw-r--r--arch/sh/configs/se7206_defconfig2
-rw-r--r--arch/sh/configs/se7724_defconfig2
-rw-r--r--arch/sh/configs/sh7785lcr_32bit_defconfig2
-rw-r--r--arch/sh/configs/shx3_defconfig2
-rw-r--r--arch/sh/configs/urquell_defconfig4
-rw-r--r--arch/sh/drivers/dma/Kconfig17
-rw-r--r--arch/sh/drivers/dma/dma-g2.c6
-rw-r--r--arch/sh/drivers/dma/dma-pvr2.c1
-rw-r--r--arch/sh/drivers/dma/dma-sh.c290
-rw-r--r--arch/sh/drivers/dma/dma-sysfs.c84
-rw-r--r--arch/sh/drivers/dma/dmabrg.c10
-rw-r--r--arch/sh/drivers/pci/fixups-dreamcast.c2
-rw-r--r--arch/sh/drivers/pci/fixups-landisk.c3
-rw-r--r--arch/sh/drivers/pci/fixups-r7780rp.c7
-rw-r--r--arch/sh/drivers/pci/fixups-sdk7780.c18
-rw-r--r--arch/sh/drivers/pci/fixups-sdk7786.c4
-rw-r--r--arch/sh/drivers/pci/fixups-se7751.c5
-rw-r--r--arch/sh/drivers/pci/fixups-sh03.c19
-rw-r--r--arch/sh/drivers/pci/fixups-snapgear.c11
-rw-r--r--arch/sh/drivers/pci/pci-sh5.c4
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.c19
-rw-r--r--arch/sh/drivers/pci/pci.c158
-rw-r--r--arch/sh/drivers/pci/pcie-sh7786.c7
-rw-r--r--arch/sh/drivers/push-switch.c4
-rw-r--r--arch/sh/include/asm/Kbuild45
-rw-r--r--arch/sh/include/asm/atomic-irq.h2
-rw-r--r--arch/sh/include/asm/atomic.h4
-rw-r--r--arch/sh/include/asm/barrier.h54
-rw-r--r--arch/sh/include/asm/bitops.h1
-rw-r--r--arch/sh/include/asm/bl_bit.h10
-rw-r--r--arch/sh/include/asm/bl_bit_32.h33
-rw-r--r--arch/sh/include/asm/bl_bit_64.h40
-rw-r--r--arch/sh/include/asm/bug.h9
-rw-r--r--arch/sh/include/asm/cache_insns.h11
-rw-r--r--arch/sh/include/asm/cache_insns_32.h21
-rw-r--r--arch/sh/include/asm/cache_insns_64.h23
-rw-r--r--arch/sh/include/asm/checksum.h2
-rw-r--r--arch/sh/include/asm/clock.h2
-rw-r--r--arch/sh/include/asm/cmpxchg-irq.h2
-rw-r--r--arch/sh/include/asm/cmpxchg.h70
-rw-r--r--arch/sh/include/asm/device.h18
-rw-r--r--arch/sh/include/asm/dma-mapping.h29
-rw-r--r--arch/sh/include/asm/dma.h13
-rw-r--r--arch/sh/include/asm/elf.h3
-rw-r--r--arch/sh/include/asm/fixmap.h2
-rw-r--r--arch/sh/include/asm/futex-irq.h1
-rw-r--r--arch/sh/include/asm/hugetlb.h6
-rw-r--r--arch/sh/include/asm/hw_breakpoint.h4
-rw-r--r--arch/sh/include/asm/i2c-sh7760.h2
-rw-r--r--arch/sh/include/asm/io.h35
-rw-r--r--arch/sh/include/asm/io_noioport.h52
-rw-r--r--arch/sh/include/asm/irq.h24
-rw-r--r--arch/sh/include/asm/kdebug.h4
-rw-r--r--arch/sh/include/asm/kgdb.h30
-rw-r--r--arch/sh/include/asm/machvec.h1
-rw-r--r--arch/sh/include/asm/mmu_context.h4
-rw-r--r--arch/sh/include/asm/module.h14
-rw-r--r--arch/sh/include/asm/page.h10
-rw-r--r--arch/sh/include/asm/pci.h6
-rw-r--r--arch/sh/include/asm/pgtable_64.h3
-rw-r--r--arch/sh/include/asm/posix_types.h12
-rw-r--r--arch/sh/include/asm/processor.h27
-rw-r--r--arch/sh/include/asm/processor_32.h8
-rw-r--r--arch/sh/include/asm/processor_64.h9
-rw-r--r--arch/sh/include/asm/ptrace.h35
-rw-r--r--arch/sh/include/asm/ptrace_32.h80
-rw-r--r--arch/sh/include/asm/ptrace_64.h17
-rw-r--r--arch/sh/include/asm/sections.h1
-rw-r--r--arch/sh/include/asm/setup.h6
-rw-r--r--arch/sh/include/asm/siu.h1
-rw-r--r--arch/sh/include/asm/stackprotector.h27
-rw-r--r--arch/sh/include/asm/string.h4
-rw-r--r--arch/sh/include/asm/switch_to.h19
-rw-r--r--arch/sh/include/asm/switch_to_32.h134
-rw-r--r--arch/sh/include/asm/switch_to_64.h35
-rw-r--r--arch/sh/include/asm/syscall.h4
-rw-r--r--arch/sh/include/asm/syscalls.h4
-rw-r--r--arch/sh/include/asm/syscalls_32.h18
-rw-r--r--arch/sh/include/asm/syscalls_64.h17
-rw-r--r--arch/sh/include/asm/thread_info.h81
-rw-r--r--arch/sh/include/asm/tlb.h2
-rw-r--r--arch/sh/include/asm/topology.h25
-rw-r--r--arch/sh/include/asm/traps.h21
-rw-r--r--arch/sh/include/asm/traps_32.h68
-rw-r--r--arch/sh/include/asm/traps_64.h38
-rw-r--r--arch/sh/include/asm/types.h5
-rw-r--r--arch/sh/include/asm/uaccess.h93
-rw-r--r--arch/sh/include/asm/uaccess_32.h75
-rw-r--r--arch/sh/include/asm/uaccess_64.h4
-rw-r--r--arch/sh/include/asm/unistd.h50
-rw-r--r--arch/sh/include/asm/word-at-a-time.h53
-rw-r--r--arch/sh/include/cpu-sh2a/cpu/sh7264.h176
-rw-r--r--arch/sh/include/cpu-sh2a/cpu/sh7269.h213
-rw-r--r--arch/sh/include/cpu-sh3/cpu/dma.h13
-rw-r--r--arch/sh/include/cpu-sh4/cpu/dma-register.h32
-rw-r--r--arch/sh/include/cpu-sh4/cpu/dma.h25
-rw-r--r--arch/sh/include/cpu-sh4/cpu/freq.h5
-rw-r--r--arch/sh/include/cpu-sh4/cpu/sh7722.h13
-rw-r--r--arch/sh/include/cpu-sh4/cpu/sh7723.h3
-rw-r--r--arch/sh/include/cpu-sh4/cpu/sh7724.h4
-rw-r--r--arch/sh/include/cpu-sh4/cpu/sh7734.h306
-rw-r--r--arch/sh/include/cpu-sh4/cpu/sh7757.h2
-rw-r--r--arch/sh/include/cpu-sh4a/cpu/dma.h72
-rw-r--r--arch/sh/include/mach-common/mach/hp6xx.h7
-rw-r--r--arch/sh/include/mach-common/mach/lboxre2.h13
-rw-r--r--arch/sh/include/mach-common/mach/mangle-port.h49
-rw-r--r--arch/sh/include/mach-common/mach/sdk7780.h5
-rw-r--r--arch/sh/include/mach-common/mach/titan.h12
-rw-r--r--arch/sh/include/mach-dreamcast/mach/dma.h2
-rw-r--r--arch/sh/include/mach-ecovec24/mach/romimage.h2
-rw-r--r--arch/sh/include/mach-kfr2r09/mach/kfr2r09.h14
-rw-r--r--arch/sh/include/mach-kfr2r09/mach/romimage.h2
-rw-r--r--arch/sh/include/mach-landisk/mach/iodata_landisk.h19
-rw-r--r--arch/sh/include/mach-migor/mach/migor.h2
-rw-r--r--arch/sh/include/mach-se/mach/se.h19
-rw-r--r--arch/sh/include/mach-se/mach/se7343.h16
-rw-r--r--arch/sh/include/mach-se/mach/se7721.h6
-rw-r--r--arch/sh/include/mach-se/mach/se7722.h19
-rw-r--r--arch/sh/include/mach-se/mach/se7724.h7
-rw-r--r--arch/sh/include/mach-se/mach/se7751.h3
-rw-r--r--arch/sh/include/mach-se/mach/se7780.h7
-rw-r--r--arch/sh/include/uapi/asm/Kbuild25
-rw-r--r--arch/sh/include/uapi/asm/auxvec.h38
-rw-r--r--arch/sh/include/uapi/asm/byteorder.h10
-rw-r--r--arch/sh/include/uapi/asm/cachectl.h19
-rw-r--r--arch/sh/include/uapi/asm/cpu-features.h26
-rw-r--r--arch/sh/include/uapi/asm/hw_breakpoint.h4
-rw-r--r--arch/sh/include/uapi/asm/ioctls.h110
-rw-r--r--arch/sh/include/uapi/asm/posix_types.h7
-rw-r--r--arch/sh/include/uapi/asm/posix_types_32.h22
-rw-r--r--arch/sh/include/uapi/asm/posix_types_64.h28
-rw-r--r--arch/sh/include/uapi/asm/ptrace.h34
-rw-r--r--arch/sh/include/uapi/asm/ptrace_32.h77
-rw-r--r--arch/sh/include/uapi/asm/ptrace_64.h14
-rw-r--r--arch/sh/include/uapi/asm/setup.h1
-rw-r--r--arch/sh/include/uapi/asm/sigcontext.h40
-rw-r--r--arch/sh/include/uapi/asm/signal.h15
-rw-r--r--arch/sh/include/uapi/asm/sockios.h14
-rw-r--r--arch/sh/include/uapi/asm/stat.h138
-rw-r--r--arch/sh/include/uapi/asm/swab.h59
-rw-r--r--arch/sh/include/uapi/asm/types.h1
-rw-r--r--arch/sh/include/uapi/asm/unistd.h7
-rw-r--r--arch/sh/include/uapi/asm/unistd_32.h385
-rw-r--r--arch/sh/include/uapi/asm/unistd_64.h405
-rw-r--r--arch/sh/kernel/Makefile5
-rw-r--r--arch/sh/kernel/cpu/Makefile2
-rw-r--r--arch/sh/kernel/cpu/fpu.c1
-rw-r--r--arch/sh/kernel/cpu/init.c2
-rw-r--r--arch/sh/kernel/cpu/irq/imask.c1
-rw-r--r--arch/sh/kernel/cpu/proc.c4
-rw-r--r--arch/sh/kernel/cpu/sh2/clock-sh7619.c12
-rw-r--r--arch/sh/kernel/cpu/sh2/setup-sh7619.c6
-rw-r--r--arch/sh/kernel/cpu/sh2a/Makefile4
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7201.c12
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7203.c12
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7206.c12
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7264.c153
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7269.c184
-rw-r--r--arch/sh/kernel/cpu/sh2a/ex.S1
-rw-r--r--arch/sh/kernel/cpu/sh2a/fpu.c1
-rw-r--r--arch/sh/kernel/cpu/sh2a/opcode_helper.c1
-rw-r--r--arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c2136
-rw-r--r--arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c2839
-rw-r--r--arch/sh/kernel/cpu/sh2a/probe.c6
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-mxg.c2
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7201.c16
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7203.c24
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7206.c8
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7264.c606
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7269.c615
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh3.c12
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7705.c12
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7706.c12
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7709.c12
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7710.c12
-rw-r--r--arch/sh/kernel/cpu/sh3/clock-sh7712.c10
-rw-r--r--arch/sh/kernel/cpu/sh3/entry.S11
-rw-r--r--arch/sh/kernel/cpu/sh3/serial-sh7720.c2
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7705.c13
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh770x.c15
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7710.c13
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7720.c38
-rw-r--r--arch/sh/kernel/cpu/sh4/clock-sh4-202.c6
-rw-r--r--arch/sh/kernel/cpu/sh4/clock-sh4.c12
-rw-r--r--arch/sh/kernel/cpu/sh4/fpu.c2
-rw-r--r--arch/sh/kernel/cpu/sh4/probe.c3
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh4-202.c12
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7750.c17
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7760.c26
-rw-r--r--arch/sh/kernel/cpu/sh4/sq.c24
-rw-r--r--arch/sh/kernel/cpu/sh4a/Makefile9
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7343.c6
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7366.c6
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7722.c81
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7723.c213
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7724.c213
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7734.c266
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7757.c22
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7763.c14
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7770.c12
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7780.c14
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7785.c6
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7786.c4
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-shx3.c4
-rw-r--r--arch/sh/kernel/cpu/sh4a/pinmux-sh7734.c2497
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7343.c31
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7366.c23
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7722.c87
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7723.c86
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7724.c141
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7734.c800
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7757.c155
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7763.c36
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7770.c39
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7780.c39
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7785.c45
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7786.c55
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-shx3.c31
-rw-r--r--arch/sh/kernel/cpu/sh4a/smp-shx3.c2
-rw-r--r--arch/sh/kernel/cpu/sh5/clock-sh5.c12
-rw-r--r--arch/sh/kernel/cpu/sh5/entry.S125
-rw-r--r--arch/sh/kernel/cpu/sh5/fpu.c3
-rw-r--r--arch/sh/kernel/cpu/sh5/unwind.c63
-rw-r--r--arch/sh/kernel/cpu/shmobile/Makefile1
-rw-r--r--arch/sh/kernel/cpu/shmobile/cpuidle.c38
-rw-r--r--arch/sh/kernel/cpu/shmobile/pm.c1
-rw-r--r--arch/sh/kernel/cpufreq.c121
-rw-r--r--arch/sh/kernel/dma-nommu.c4
-rw-r--r--arch/sh/kernel/dumpstack.c58
-rw-r--r--arch/sh/kernel/entry-common.S16
-rw-r--r--arch/sh/kernel/hw_breakpoint.c1
-rw-r--r--arch/sh/kernel/idle.c34
-rw-r--r--arch/sh/kernel/io_trapped.c1
-rw-r--r--arch/sh/kernel/ioport.c2
-rw-r--r--arch/sh/kernel/irq.c8
-rw-r--r--arch/sh/kernel/kgdb.c106
-rw-r--r--arch/sh/kernel/machine_kexec.c3
-rw-r--r--arch/sh/kernel/machvec.c3
-rw-r--r--arch/sh/kernel/perf_event.c5
-rw-r--r--arch/sh/kernel/process.c61
-rw-r--r--arch/sh/kernel/process_32.c150
-rw-r--r--arch/sh/kernel/process_64.c129
-rw-r--r--arch/sh/kernel/ptrace_32.c14
-rw-r--r--arch/sh/kernel/ptrace_64.c15
-rw-r--r--arch/sh/kernel/reboot.c2
-rw-r--r--arch/sh/kernel/setup.c14
-rw-r--r--arch/sh/kernel/sh_ksyms_32.c1
-rw-r--r--arch/sh/kernel/sh_ksyms_64.c2
-rw-r--r--arch/sh/kernel/signal_32.c127
-rw-r--r--arch/sh/kernel/signal_64.c162
-rw-r--r--arch/sh/kernel/smp.c25
-rw-r--r--arch/sh/kernel/sys_sh32.c24
-rw-r--r--arch/sh/kernel/syscalls_32.S11
-rw-r--r--arch/sh/kernel/syscalls_64.S11
-rw-r--r--arch/sh/kernel/time.c2
-rw-r--r--arch/sh/kernel/topology.c4
-rw-r--r--arch/sh/kernel/traps.c73
-rw-r--r--arch/sh/kernel/traps_32.c124
-rw-r--r--arch/sh/kernel/traps_64.c592
-rw-r--r--arch/sh/kernel/vmlinux.lds.S3
-rw-r--r--arch/sh/kernel/vsyscall/vsyscall-sigreturn.S35
-rw-r--r--arch/sh/kernel/vsyscall/vsyscall-trapa.S23
-rw-r--r--arch/sh/kernel/vsyscall/vsyscall.c3
-rw-r--r--arch/sh/lib/mcount.S8
-rw-r--r--arch/sh/lib64/Makefile2
-rw-r--r--arch/sh/math-emu/math.c1
-rw-r--r--arch/sh/mm/Kconfig4
-rw-r--r--arch/sh/mm/Makefile8
-rw-r--r--arch/sh/mm/cache-sh2a.c125
-rw-r--r--arch/sh/mm/cache-sh4.c5
-rw-r--r--arch/sh/mm/cache.c12
-rw-r--r--arch/sh/mm/consistent.c6
-rw-r--r--arch/sh/mm/fault.c514
-rw-r--r--arch/sh/mm/flush-sh4.c2
-rw-r--r--arch/sh/mm/init.c12
-rw-r--r--arch/sh/mm/mmap.c139
-rw-r--r--arch/sh/mm/pmb.c1
-rw-r--r--arch/sh/mm/sram.c1
-rw-r--r--arch/sh/mm/tlb-pteaex.c1
-rw-r--r--arch/sh/mm/tlb-sh3.c1
-rw-r--r--arch/sh/mm/tlb-sh4.c1
-rw-r--r--arch/sh/mm/tlb-sh5.c42
-rw-r--r--arch/sh/mm/tlbex_32.c78
-rw-r--r--arch/sh/mm/tlbex_64.c166
-rw-r--r--arch/sh/mm/tlbflush_64.c295
-rw-r--r--arch/sh/tools/mach-types2
348 files changed, 4465 insertions, 17810 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index babc2b826c5..ff9177c8f64 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -4,8 +4,6 @@ config SUPERH
4 select CLKDEV_LOOKUP 4 select CLKDEV_LOOKUP
5 select HAVE_IDE if HAS_IOPORT 5 select HAVE_IDE if HAS_IOPORT
6 select HAVE_MEMBLOCK 6 select HAVE_MEMBLOCK
7 select HAVE_MEMBLOCK_NODE_MAP
8 select ARCH_DISCARD_MEMBLOCK
9 select HAVE_OPROFILE 7 select HAVE_OPROFILE
10 select HAVE_GENERIC_DMA_COHERENT 8 select HAVE_GENERIC_DMA_COHERENT
11 select HAVE_ARCH_TRACEHOOK 9 select HAVE_ARCH_TRACEHOOK
@@ -13,33 +11,21 @@ config SUPERH
13 select HAVE_DMA_ATTRS 11 select HAVE_DMA_ATTRS
14 select HAVE_IRQ_WORK 12 select HAVE_IRQ_WORK
15 select HAVE_PERF_EVENTS 13 select HAVE_PERF_EVENTS
16 select HAVE_DEBUG_BUGVERBOSE
17 select ARCH_HAVE_CUSTOM_GPIO_H
18 select ARCH_HAVE_NMI_SAFE_CMPXCHG if (GUSA_RB || CPU_SH4A) 14 select ARCH_HAVE_NMI_SAFE_CMPXCHG if (GUSA_RB || CPU_SH4A)
19 select PERF_USE_VMALLOC 15 select PERF_USE_VMALLOC
20 select HAVE_DEBUG_KMEMLEAK
21 select HAVE_KERNEL_GZIP 16 select HAVE_KERNEL_GZIP
22 select HAVE_KERNEL_BZIP2 17 select HAVE_KERNEL_BZIP2
23 select HAVE_KERNEL_LZMA 18 select HAVE_KERNEL_LZMA
24 select HAVE_KERNEL_XZ 19 select HAVE_KERNEL_XZ
25 select HAVE_KERNEL_LZO 20 select HAVE_KERNEL_LZO
26 select HAVE_UID16
27 select ARCH_WANT_IPC_PARSE_VERSION
28 select HAVE_SYSCALL_TRACEPOINTS 21 select HAVE_SYSCALL_TRACEPOINTS
29 select HAVE_REGS_AND_STACK_ACCESS_API 22 select HAVE_REGS_AND_STACK_ACCESS_API
30 select HAVE_GENERIC_HARDIRQS 23 select HAVE_GENERIC_HARDIRQS
31 select MAY_HAVE_SPARSE_IRQ 24 select HAVE_SPARSE_IRQ
32 select IRQ_FORCED_THREADING 25 select IRQ_FORCED_THREADING
33 select RTC_LIB 26 select RTC_LIB
34 select GENERIC_ATOMIC64 27 select GENERIC_ATOMIC64
35 select GENERIC_IRQ_SHOW 28 select GENERIC_IRQ_SHOW
36 select GENERIC_SMP_IDLE_THREAD
37 select GENERIC_CLOCKEVENTS
38 select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST
39 select GENERIC_STRNCPY_FROM_USER
40 select GENERIC_STRNLEN_USER
41 select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER
42 select MODULES_USE_ELF_RELA
43 help 29 help
44 The SuperH is a RISC processor targeted for use in embedded systems 30 The SuperH is a RISC processor targeted for use in embedded systems
45 and consumer electronics; it was also used in the Sega Dreamcast 31 and consumer electronics; it was also used in the Sega Dreamcast
@@ -56,7 +42,6 @@ config SUPERH32
56 select HAVE_DYNAMIC_FTRACE 42 select HAVE_DYNAMIC_FTRACE
57 select HAVE_FUNCTION_TRACE_MCOUNT_TEST 43 select HAVE_FUNCTION_TRACE_MCOUNT_TEST
58 select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE 44 select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE
59 select ARCH_WANT_IPC_PARSE_VERSION
60 select HAVE_FUNCTION_GRAPH_TRACER 45 select HAVE_FUNCTION_GRAPH_TRACER
61 select HAVE_ARCH_KGDB 46 select HAVE_ARCH_KGDB
62 select HAVE_HW_BREAKPOINT 47 select HAVE_HW_BREAKPOINT
@@ -67,7 +52,6 @@ config SUPERH32
67 52
68config SUPERH64 53config SUPERH64
69 def_bool ARCH = "sh64" 54 def_bool ARCH = "sh64"
70 select KALLSYMS
71 55
72config ARCH_DEFCONFIG 56config ARCH_DEFCONFIG
73 string 57 string
@@ -100,10 +84,27 @@ config GENERIC_GPIO
100config GENERIC_CALIBRATE_DELAY 84config GENERIC_CALIBRATE_DELAY
101 bool 85 bool
102 86
87config GENERIC_IOMAP
88 bool
89
90config GENERIC_CLOCKEVENTS
91 def_bool y
92
93config GENERIC_CLOCKEVENTS_BROADCAST
94 bool
95
96config GENERIC_CMOS_UPDATE
97 def_bool y
98 depends on SH_SH03 || SH_DREAMCAST
99
103config GENERIC_LOCKBREAK 100config GENERIC_LOCKBREAK
104 def_bool y 101 def_bool y
105 depends on SMP && PREEMPT 102 depends on SMP && PREEMPT
106 103
104config SYS_SUPPORTS_PM
105 bool
106 depends on !SMP
107
107config ARCH_SUSPEND_POSSIBLE 108config ARCH_SUSPEND_POSSIBLE
108 def_bool n 109 def_bool n
109 110
@@ -156,17 +157,16 @@ config ARCH_NO_VIRT_TO_BUS
156config ARCH_HAS_DEFAULT_IDLE 157config ARCH_HAS_DEFAULT_IDLE
157 def_bool y 158 def_bool y
158 159
160config ARCH_HAS_CPU_IDLE_WAIT
161 def_bool y
162
159config NO_IOPORT 163config NO_IOPORT
160 def_bool !PCI 164 def_bool !PCI
161 depends on !SH_CAYMAN && !SH_SH4202_MICRODEV && !SH_SHMIN && \ 165 depends on !SH_CAYMAN && !SH_SH4202_MICRODEV && !SH_SHMIN
162 !SH_HP6XX && !SH_SOLUTION_ENGINE
163 166
164config IO_TRAPPED 167config IO_TRAPPED
165 bool 168 bool
166 169
167config SWAP_IO_SPACE
168 bool
169
170config DMA_COHERENT 170config DMA_COHERENT
171 bool 171 bool
172 172
@@ -290,20 +290,6 @@ config CPU_SUBTYPE_SH7263
290 select SYS_SUPPORTS_CMT 290 select SYS_SUPPORTS_CMT
291 select SYS_SUPPORTS_MTU2 291 select SYS_SUPPORTS_MTU2
292 292
293config CPU_SUBTYPE_SH7264
294 bool "Support SH7264 processor"
295 select CPU_SH2A
296 select CPU_HAS_FPU
297 select SYS_SUPPORTS_CMT
298 select SYS_SUPPORTS_MTU2
299
300config CPU_SUBTYPE_SH7269
301 bool "Support SH7269 processor"
302 select CPU_SH2A
303 select CPU_HAS_FPU
304 select SYS_SUPPORTS_CMT
305 select SYS_SUPPORTS_MTU2
306
307config CPU_SUBTYPE_MXG 293config CPU_SUBTYPE_MXG
308 bool "Support MX-G processor" 294 bool "Support MX-G processor"
309 select CPU_SH2A 295 select CPU_SH2A
@@ -443,16 +429,6 @@ config CPU_SUBTYPE_SH7724
443 help 429 help
444 Select SH7724 if you have an SH-MobileR2R CPU. 430 Select SH7724 if you have an SH-MobileR2R CPU.
445 431
446config CPU_SUBTYPE_SH7734
447 bool "Support SH7734 processor"
448 select CPU_SH4A
449 select CPU_SHX2
450 select ARCH_WANT_OPTIONAL_GPIOLIB
451 select USB_ARCH_HAS_OHCI
452 select USB_ARCH_HAS_EHCI
453 help
454 Select SH7734 if you have a SH4A SH7734 CPU.
455
456config CPU_SUBTYPE_SH7757 432config CPU_SUBTYPE_SH7757
457 bool "Support SH7757 processor" 433 bool "Support SH7757 processor"
458 select CPU_SH4A 434 select CPU_SH4A
@@ -610,9 +586,9 @@ config SH_CLK_CPG
610config SH_CLK_CPG_LEGACY 586config SH_CLK_CPG_LEGACY
611 depends on SH_CLK_CPG 587 depends on SH_CLK_CPG
612 def_bool y if !CPU_SUBTYPE_SH7785 && !ARCH_SHMOBILE && \ 588 def_bool y if !CPU_SUBTYPE_SH7785 && !ARCH_SHMOBILE && \
613 !CPU_SHX3 && !CPU_SUBTYPE_SH7757 && \ 589 !CPU_SHX3 && !CPU_SUBTYPE_SH7757
614 !CPU_SUBTYPE_SH7734 && !CPU_SUBTYPE_SH7264 && \ 590
615 !CPU_SUBTYPE_SH7269 591source "kernel/time/Kconfig"
616 592
617endmenu 593endmenu
618 594
@@ -673,7 +649,7 @@ config CRASH_DUMP
673 a specially reserved region and then later executed after 649 a specially reserved region and then later executed after
674 a crash by kdump/kexec. The crash dump kernel must be compiled 650 a crash by kdump/kexec. The crash dump kernel must be compiled
675 to a memory address not used by the main kernel using 651 to a memory address not used by the main kernel using
676 PHYSICAL_START. 652 MEMORY_START.
677 653
678 For more details see Documentation/kdump/kdump.txt 654 For more details see Documentation/kdump/kdump.txt
679 655
@@ -684,17 +660,6 @@ config KEXEC_JUMP
684 Jump between original kernel and kexeced kernel and invoke 660 Jump between original kernel and kexeced kernel and invoke
685 code via KEXEC 661 code via KEXEC
686 662
687config PHYSICAL_START
688 hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP)
689 default MEMORY_START
690 ---help---
691 This gives the physical address where the kernel is loaded
692 and is ordinarily the same as MEMORY_START.
693
694 Different values are primarily used in the case of kexec on panic
695 where the fail safe kernel needs to run at a different address
696 than the panic-ed kernel.
697
698config SECCOMP 663config SECCOMP
699 bool "Enable seccomp to safely compute untrusted bytecode" 664 bool "Enable seccomp to safely compute untrusted bytecode"
700 depends on PROC_FS 665 depends on PROC_FS
@@ -711,20 +676,6 @@ config SECCOMP
711 676
712 If unsure, say N. 677 If unsure, say N.
713 678
714config CC_STACKPROTECTOR
715 bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
716 depends on SUPERH32 && EXPERIMENTAL
717 help
718 This option turns on the -fstack-protector GCC feature. This
719 feature puts, at the beginning of functions, a canary value on
720 the stack just before the return address, and validates
721 the value just before actually returning. Stack based buffer
722 overflows (that need to overwrite this return address) now also
723 overwrite the canary, which gets detected and the attack is then
724 neutralized via a kernel panic.
725
726 This feature requires gcc version 4.2 or above.
727
728config SMP 679config SMP
729 bool "Symmetric multi-processing support" 680 bool "Symmetric multi-processing support"
730 depends on SYS_SUPPORTS_SMP 681 depends on SYS_SUPPORTS_SMP
@@ -902,8 +853,6 @@ config PCI
902 bool "PCI support" 853 bool "PCI support"
903 depends on SYS_SUPPORTS_PCI 854 depends on SYS_SUPPORTS_PCI
904 select PCI_DOMAINS 855 select PCI_DOMAINS
905 select GENERIC_PCI_IOMAP
906 select NO_GENERIC_PCI_IOPORT_MAP
907 help 856 help
908 Find out whether you have a PCI motherboard. PCI is the name of a 857 Find out whether you have a PCI motherboard. PCI is the name of a
909 bus system, i.e. the way the CPU talks to the other stuff inside 858 bus system, i.e. the way the CPU talks to the other stuff inside
diff --git a/arch/sh/Kconfig.cpu b/arch/sh/Kconfig.cpu
index 770ff2d5b94..ddf096c7d8b 100644
--- a/arch/sh/Kconfig.cpu
+++ b/arch/sh/Kconfig.cpu
@@ -1,7 +1,7 @@
1menu "Processor features" 1menu "Processor features"
2 2
3choice 3choice
4 prompt "Endianness selection" 4 prompt "Endianess selection"
5 default CPU_LITTLE_ENDIAN 5 default CPU_LITTLE_ENDIAN
6 help 6 help
7 Some SuperH machines can be configured for either little or big 7 Some SuperH machines can be configured for either little or big
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
index 5f2bb4242c0..c1d5a820b1a 100644
--- a/arch/sh/Kconfig.debug
+++ b/arch/sh/Kconfig.debug
@@ -61,7 +61,6 @@ config DUMP_CODE
61config DWARF_UNWINDER 61config DWARF_UNWINDER
62 bool "Enable the DWARF unwinder for stacktraces" 62 bool "Enable the DWARF unwinder for stacktraces"
63 select FRAME_POINTER 63 select FRAME_POINTER
64 depends on SUPERH32
65 default n 64 default n
66 help 65 help
67 Enabling this option will make stacktraces more accurate, at 66 Enabling this option will make stacktraces more accurate, at
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index aed701c7b11..99385d0b3f3 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -9,12 +9,6 @@
9# License. See the file "COPYING" in the main directory of this archive 9# License. See the file "COPYING" in the main directory of this archive
10# for more details. 10# for more details.
11# 11#
12ifneq ($(SUBARCH),$(ARCH))
13 ifeq ($(CROSS_COMPILE),)
14 CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-)
15 endif
16endif
17
18isa-y := any 12isa-y := any
19isa-$(CONFIG_SH_DSP) := sh 13isa-$(CONFIG_SH_DSP) := sh
20isa-$(CONFIG_CPU_SH2) := sh2 14isa-$(CONFIG_CPU_SH2) := sh2
@@ -86,7 +80,6 @@ defaultimage-$(CONFIG_SH_RSK) := uImage
86defaultimage-$(CONFIG_SH_URQUELL) := uImage 80defaultimage-$(CONFIG_SH_URQUELL) := uImage
87defaultimage-$(CONFIG_SH_MIGOR) := uImage 81defaultimage-$(CONFIG_SH_MIGOR) := uImage
88defaultimage-$(CONFIG_SH_AP325RXA) := uImage 82defaultimage-$(CONFIG_SH_AP325RXA) := uImage
89defaultimage-$(CONFIG_SH_SH7757LCR) := uImage
90defaultimage-$(CONFIG_SH_7724_SOLUTION_ENGINE) := uImage 83defaultimage-$(CONFIG_SH_7724_SOLUTION_ENGINE) := uImage
91defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux 84defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux
92defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux 85defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux
@@ -112,19 +105,25 @@ LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \
112KBUILD_DEFCONFIG := cayman_defconfig 105KBUILD_DEFCONFIG := cayman_defconfig
113endif 106endif
114 107
108ifneq ($(SUBARCH),$(ARCH))
109 ifeq ($(CROSS_COMPILE),)
110 CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-)
111 endif
112endif
113
115ifdef CONFIG_CPU_LITTLE_ENDIAN 114ifdef CONFIG_CPU_LITTLE_ENDIAN
116ld-bfd := elf32-$(UTS_MACHINE)-linux 115ld-bfd := elf32-$(UTS_MACHINE)-linux
117LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd) 116LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' --oformat $(ld-bfd)
118LDFLAGS += -EL 117LDFLAGS += -EL
119else 118else
120ld-bfd := elf32-$(UTS_MACHINE)big-linux 119ld-bfd := elf32-$(UTS_MACHINE)big-linux
121LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd) 120LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' --oformat $(ld-bfd)
122LDFLAGS += -EB 121LDFLAGS += -EB
123endif 122endif
124 123
125export ld-bfd BITS 124export ld-bfd BITS
126 125
127head-y := arch/sh/kernel/head_$(BITS).o 126head-y := arch/sh/kernel/init_task.o arch/sh/kernel/head_$(BITS).o
128 127
129core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ 128core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/
130core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ 129core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/
@@ -199,10 +198,6 @@ ifeq ($(CONFIG_DWARF_UNWINDER),y)
199 KBUILD_CFLAGS += -fasynchronous-unwind-tables 198 KBUILD_CFLAGS += -fasynchronous-unwind-tables
200endif 199endif
201 200
202ifeq ($(CONFIG_CC_STACKPROTECTOR),y)
203 KBUILD_CFLAGS += -fstack-protector
204endif
205
206libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) 201libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y)
207libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) 202libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y)
208 203
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
index fb5805745ac..d893411022d 100644
--- a/arch/sh/boards/Kconfig
+++ b/arch/sh/boards/Kconfig
@@ -44,8 +44,6 @@ config SH_7721_SOLUTION_ENGINE
44config SH_7722_SOLUTION_ENGINE 44config SH_7722_SOLUTION_ENGINE
45 bool "SolutionEngine7722" 45 bool "SolutionEngine7722"
46 select SOLUTION_ENGINE 46 select SOLUTION_ENGINE
47 select GENERIC_IRQ_CHIP
48 select IRQ_DOMAIN
49 depends on CPU_SUBTYPE_SH7722 47 depends on CPU_SUBTYPE_SH7722
50 help 48 help
51 Select 7722 SolutionEngine if configuring for a Hitachi SH772 49 Select 7722 SolutionEngine if configuring for a Hitachi SH772
@@ -56,8 +54,6 @@ config SH_7724_SOLUTION_ENGINE
56 select SOLUTION_ENGINE 54 select SOLUTION_ENGINE
57 depends on CPU_SUBTYPE_SH7724 55 depends on CPU_SUBTYPE_SH7724
58 select ARCH_REQUIRE_GPIOLIB 56 select ARCH_REQUIRE_GPIOLIB
59 select SND_SOC_AK4642 if SND_SIMPLE_CARD
60 select REGULATOR_FIXED_VOLTAGE if REGULATOR
61 help 57 help
62 Select 7724 SolutionEngine if configuring for a Hitachi SH7724 58 Select 7724 SolutionEngine if configuring for a Hitachi SH7724
63 evaluation board. 59 evaluation board.
@@ -83,8 +79,6 @@ config SH_7780_SOLUTION_ENGINE
83config SH_7343_SOLUTION_ENGINE 79config SH_7343_SOLUTION_ENGINE
84 bool "SolutionEngine7343" 80 bool "SolutionEngine7343"
85 select SOLUTION_ENGINE 81 select SOLUTION_ENGINE
86 select GENERIC_IRQ_CHIP
87 select IRQ_DOMAIN
88 depends on CPU_SUBTYPE_SH7343 82 depends on CPU_SUBTYPE_SH7343
89 help 83 help
90 Select 7343 SolutionEngine if configuring for a Hitachi 84 Select 7343 SolutionEngine if configuring for a Hitachi
@@ -139,9 +133,7 @@ config SH_RTS7751R2D
139 133
140config SH_RSK 134config SH_RSK
141 bool "Renesas Starter Kit" 135 bool "Renesas Starter Kit"
142 depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203 || \ 136 depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203
143 CPU_SUBTYPE_SH7264 || CPU_SUBTYPE_SH7269
144 select REGULATOR_FIXED_VOLTAGE if REGULATOR
145 help 137 help
146 Select this option if configuring for any of the RSK+ MCU 138 Select this option if configuring for any of the RSK+ MCU
147 evaluation platforms. 139 evaluation platforms.
@@ -161,7 +153,6 @@ config SH_SDK7786
161 select NO_IOPORT if !PCI 153 select NO_IOPORT if !PCI
162 select ARCH_WANT_OPTIONAL_GPIOLIB 154 select ARCH_WANT_OPTIONAL_GPIOLIB
163 select HAVE_SRAM_POOL 155 select HAVE_SRAM_POOL
164 select REGULATOR_FIXED_VOLTAGE if REGULATOR
165 help 156 help
166 Select SDK7786 if configuring for a Renesas Technology Europe 157 Select SDK7786 if configuring for a Renesas Technology Europe
167 SH7786-65nm board. 158 SH7786-65nm board.
@@ -176,7 +167,6 @@ config SH_SH7757LCR
176 bool "SH7757LCR" 167 bool "SH7757LCR"
177 depends on CPU_SUBTYPE_SH7757 168 depends on CPU_SUBTYPE_SH7757
178 select ARCH_REQUIRE_GPIOLIB 169 select ARCH_REQUIRE_GPIOLIB
179 select REGULATOR_FIXED_VOLTAGE if REGULATOR
180 170
181config SH_SH7785LCR 171config SH_SH7785LCR
182 bool "SH7785LCR" 172 bool "SH7785LCR"
@@ -210,7 +200,6 @@ config SH_MIGOR
210 bool "Migo-R" 200 bool "Migo-R"
211 depends on CPU_SUBTYPE_SH7722 201 depends on CPU_SUBTYPE_SH7722
212 select ARCH_REQUIRE_GPIOLIB 202 select ARCH_REQUIRE_GPIOLIB
213 select REGULATOR_FIXED_VOLTAGE if REGULATOR
214 help 203 help
215 Select Migo-R if configuring for the SH7722 Migo-R platform 204 Select Migo-R if configuring for the SH7722 Migo-R platform
216 by Renesas System Solutions Asia Pte. Ltd. 205 by Renesas System Solutions Asia Pte. Ltd.
@@ -219,7 +208,6 @@ config SH_AP325RXA
219 bool "AP-325RXA" 208 bool "AP-325RXA"
220 depends on CPU_SUBTYPE_SH7723 209 depends on CPU_SUBTYPE_SH7723
221 select ARCH_REQUIRE_GPIOLIB 210 select ARCH_REQUIRE_GPIOLIB
222 select REGULATOR_FIXED_VOLTAGE if REGULATOR
223 help 211 help
224 Renesas "AP-325RXA" support. 212 Renesas "AP-325RXA" support.
225 Compatible with ALGO SYSTEM CO.,LTD. "AP-320A" 213 Compatible with ALGO SYSTEM CO.,LTD. "AP-320A"
@@ -228,7 +216,6 @@ config SH_KFR2R09
228 bool "KFR2R09" 216 bool "KFR2R09"
229 depends on CPU_SUBTYPE_SH7724 217 depends on CPU_SUBTYPE_SH7724
230 select ARCH_REQUIRE_GPIOLIB 218 select ARCH_REQUIRE_GPIOLIB
231 select REGULATOR_FIXED_VOLTAGE if REGULATOR
232 help 219 help
233 "Kit For R2R for 2009" support. 220 "Kit For R2R for 2009" support.
234 221
@@ -236,8 +223,6 @@ config SH_ECOVEC
236 bool "EcoVec" 223 bool "EcoVec"
237 depends on CPU_SUBTYPE_SH7724 224 depends on CPU_SUBTYPE_SH7724
238 select ARCH_REQUIRE_GPIOLIB 225 select ARCH_REQUIRE_GPIOLIB
239 select SND_SOC_DA7210 if SND_SIMPLE_CARD
240 select REGULATOR_FIXED_VOLTAGE if REGULATOR
241 help 226 help
242 Renesas "R0P7724LC0011/21RL (EcoVec)" support. 227 Renesas "R0P7724LC0011/21RL (EcoVec)" support.
243 228
@@ -307,13 +292,11 @@ config SH_X3PROTO
307 bool "SH-X3 Prototype board" 292 bool "SH-X3 Prototype board"
308 depends on CPU_SUBTYPE_SHX3 293 depends on CPU_SUBTYPE_SHX3
309 select NO_IOPORT if !PCI 294 select NO_IOPORT if !PCI
310 select IRQ_DOMAIN
311 295
312config SH_MAGIC_PANEL_R2 296config SH_MAGIC_PANEL_R2
313 bool "Magic Panel R2" 297 bool "Magic Panel R2"
314 depends on CPU_SUBTYPE_SH7720 298 depends on CPU_SUBTYPE_SH7720
315 select ARCH_REQUIRE_GPIOLIB 299 select ARCH_REQUIRE_GPIOLIB
316 select REGULATOR_FIXED_VOLTAGE if REGULATOR
317 help 300 help
318 Select Magic Panel R2 if configuring for Magic Panel R2. 301 Select Magic Panel R2 if configuring for Magic Panel R2.
319 302
@@ -325,7 +308,6 @@ config SH_CAYMAN
325config SH_POLARIS 308config SH_POLARIS
326 bool "SMSC Polaris" 309 bool "SMSC Polaris"
327 select CPU_HAS_IPR_IRQ 310 select CPU_HAS_IPR_IRQ
328 select REGULATOR_FIXED_VOLTAGE if REGULATOR
329 depends on CPU_SUBTYPE_SH7709 311 depends on CPU_SUBTYPE_SH7709
330 help 312 help
331 Select if configuring for an SMSC Polaris development board 313 Select if configuring for an SMSC Polaris development board
@@ -333,7 +315,6 @@ config SH_POLARIS
333config SH_SH2007 315config SH_SH2007
334 bool "SH-2007 board" 316 bool "SH-2007 board"
335 select NO_IOPORT 317 select NO_IOPORT
336 select REGULATOR_FIXED_VOLTAGE if REGULATOR
337 depends on CPU_SUBTYPE_SH7780 318 depends on CPU_SUBTYPE_SH7780
338 help 319 help
339 SH-2007 is a single-board computer based around SH7780 chip 320 SH-2007 is a single-board computer based around SH7780 chip
@@ -345,7 +326,6 @@ config SH_SH2007
345config SH_APSH4A3A 326config SH_APSH4A3A
346 bool "AP-SH4A-3A" 327 bool "AP-SH4A-3A"
347 select SH_ALPHA_BOARD 328 select SH_ALPHA_BOARD
348 select REGULATOR_FIXED_VOLTAGE if REGULATOR
349 depends on CPU_SUBTYPE_SH7785 329 depends on CPU_SUBTYPE_SH7785
350 help 330 help
351 Select AP-SH4A-3A if configuring for an ALPHAPROJECT AP-SH4A-3A. 331 Select AP-SH4A-3A if configuring for an ALPHAPROJECT AP-SH4A-3A.
@@ -354,11 +334,12 @@ config SH_APSH4AD0A
354 bool "AP-SH4AD-0A" 334 bool "AP-SH4AD-0A"
355 select SH_ALPHA_BOARD 335 select SH_ALPHA_BOARD
356 select SYS_SUPPORTS_PCI 336 select SYS_SUPPORTS_PCI
357 select REGULATOR_FIXED_VOLTAGE if REGULATOR
358 depends on CPU_SUBTYPE_SH7786 337 depends on CPU_SUBTYPE_SH7786
359 help 338 help
360 Select AP-SH4AD-0A if configuring for an ALPHAPROJECT AP-SH4AD-0A. 339 Select AP-SH4AD-0A if configuring for an ALPHAPROJECT AP-SH4AD-0A.
361 340
341endmenu
342
362source "arch/sh/boards/mach-r2d/Kconfig" 343source "arch/sh/boards/mach-r2d/Kconfig"
363source "arch/sh/boards/mach-highlander/Kconfig" 344source "arch/sh/boards/mach-highlander/Kconfig"
364source "arch/sh/boards/mach-sdk7780/Kconfig" 345source "arch/sh/boards/mach-sdk7780/Kconfig"
@@ -378,5 +359,3 @@ config SH_MAGIC_PANEL_R2_VERSION
378endmenu 359endmenu
379 360
380endif 361endif
381
382endmenu
diff --git a/arch/sh/boards/board-apsh4a3a.c b/arch/sh/boards/board-apsh4a3a.c
index 0a39c241628..2823619c600 100644
--- a/arch/sh/boards/board-apsh4a3a.c
+++ b/arch/sh/boards/board-apsh4a3a.c
@@ -13,8 +13,6 @@
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/mtd/physmap.h> 15#include <linux/mtd/physmap.h>
16#include <linux/regulator/fixed.h>
17#include <linux/regulator/machine.h>
18#include <linux/smsc911x.h> 16#include <linux/smsc911x.h>
19#include <linux/irq.h> 17#include <linux/irq.h>
20#include <linux/clk.h> 18#include <linux/clk.h>
@@ -68,12 +66,6 @@ static struct platform_device nor_flash_device = {
68 .resource = nor_flash_resources, 66 .resource = nor_flash_resources,
69}; 67};
70 68
71/* Dummy supplies, where voltage doesn't matter */
72static struct regulator_consumer_supply dummy_supplies[] = {
73 REGULATOR_SUPPLY("vddvario", "smsc911x"),
74 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
75};
76
77static struct resource smsc911x_resources[] = { 69static struct resource smsc911x_resources[] = {
78 [0] = { 70 [0] = {
79 .name = "smsc911x-memory", 71 .name = "smsc911x-memory",
@@ -113,8 +105,6 @@ static struct platform_device *apsh4a3a_devices[] __initdata = {
113 105
114static int __init apsh4a3a_devices_setup(void) 106static int __init apsh4a3a_devices_setup(void)
115{ 107{
116 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
117
118 return platform_add_devices(apsh4a3a_devices, 108 return platform_add_devices(apsh4a3a_devices,
119 ARRAY_SIZE(apsh4a3a_devices)); 109 ARRAY_SIZE(apsh4a3a_devices));
120} 110}
diff --git a/arch/sh/boards/board-apsh4ad0a.c b/arch/sh/boards/board-apsh4ad0a.c
index 92eac3a9918..b4d6292a924 100644
--- a/arch/sh/boards/board-apsh4ad0a.c
+++ b/arch/sh/boards/board-apsh4ad0a.c
@@ -12,20 +12,12 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/regulator/fixed.h>
16#include <linux/regulator/machine.h>
17#include <linux/smsc911x.h> 15#include <linux/smsc911x.h>
18#include <linux/irq.h> 16#include <linux/irq.h>
19#include <linux/clk.h> 17#include <linux/clk.h>
20#include <asm/machvec.h> 18#include <asm/machvec.h>
21#include <asm/sizes.h> 19#include <asm/sizes.h>
22 20
23/* Dummy supplies, where voltage doesn't matter */
24static struct regulator_consumer_supply dummy_supplies[] = {
25 REGULATOR_SUPPLY("vddvario", "smsc911x"),
26 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
27};
28
29static struct resource smsc911x_resources[] = { 21static struct resource smsc911x_resources[] = {
30 [0] = { 22 [0] = {
31 .name = "smsc911x-memory", 23 .name = "smsc911x-memory",
@@ -64,8 +56,6 @@ static struct platform_device *apsh4ad0a_devices[] __initdata = {
64 56
65static int __init apsh4ad0a_devices_setup(void) 57static int __init apsh4ad0a_devices_setup(void)
66{ 58{
67 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
68
69 return platform_add_devices(apsh4ad0a_devices, 59 return platform_add_devices(apsh4ad0a_devices,
70 ARRAY_SIZE(apsh4ad0a_devices)); 60 ARRAY_SIZE(apsh4ad0a_devices));
71} 61}
diff --git a/arch/sh/boards/board-edosk7705.c b/arch/sh/boards/board-edosk7705.c
index 5e24c17bbda..541d8a28103 100644
--- a/arch/sh/boards/board-edosk7705.c
+++ b/arch/sh/boards/board-edosk7705.c
@@ -13,7 +13,6 @@
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/smc91x.h> 15#include <linux/smc91x.h>
16#include <linux/sh_intc.h>
17#include <asm/machvec.h> 16#include <asm/machvec.h>
18#include <asm/sizes.h> 17#include <asm/sizes.h>
19 18
@@ -21,7 +20,7 @@
21#define SMC_IO_OFFSET 0x300 20#define SMC_IO_OFFSET 0x300
22#define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET) 21#define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET)
23 22
24#define ETHERNET_IRQ evt2irq(0x320) 23#define ETHERNET_IRQ 0x09
25 24
26static void __init sh_edosk7705_init_irq(void) 25static void __init sh_edosk7705_init_irq(void)
27{ 26{
@@ -74,5 +73,6 @@ device_initcall(init_edosk7705_devices);
74 */ 73 */
75static struct sh_machine_vector mv_edosk7705 __initmv = { 74static struct sh_machine_vector mv_edosk7705 __initmv = {
76 .mv_name = "EDOSK7705", 75 .mv_name = "EDOSK7705",
76 .mv_nr_irqs = 80,
77 .mv_init_irq = sh_edosk7705_init_irq, 77 .mv_init_irq = sh_edosk7705_init_irq,
78}; 78};
diff --git a/arch/sh/boards/board-edosk7760.c b/arch/sh/boards/board-edosk7760.c
index bab5b951390..e9656a2cc4c 100644
--- a/arch/sh/boards/board-edosk7760.c
+++ b/arch/sh/boards/board-edosk7760.c
@@ -23,7 +23,6 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/smc91x.h> 24#include <linux/smc91x.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/sh_intc.h>
27#include <linux/i2c.h> 26#include <linux/i2c.h>
28#include <linux/mtd/physmap.h> 27#include <linux/mtd/physmap.h>
29#include <asm/machvec.h> 28#include <asm/machvec.h>
@@ -41,6 +40,8 @@
41#define SMC_IO_OFFSET 0x300 40#define SMC_IO_OFFSET 0x300
42#define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET) 41#define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET)
43 42
43#define ETHERNET_IRQ 5
44
44/* NOR flash */ 45/* NOR flash */
45static struct mtd_partition edosk7760_nor_flash_partitions[] = { 46static struct mtd_partition edosk7760_nor_flash_partitions[] = {
46 { 47 {
@@ -98,8 +99,8 @@ static struct resource sh7760_i2c1_res[] = {
98 .end = SH7760_I2C1_MMIOEND, 99 .end = SH7760_I2C1_MMIOEND,
99 .flags = IORESOURCE_MEM, 100 .flags = IORESOURCE_MEM,
100 },{ 101 },{
101 .start = evt2irq(0x9e0), 102 .start = SH7760_I2C1_IRQ,
102 .end = evt2irq(0x9e0), 103 .end = SH7760_I2C1_IRQ,
103 .flags = IORESOURCE_IRQ, 104 .flags = IORESOURCE_IRQ,
104 }, 105 },
105}; 106};
@@ -121,8 +122,8 @@ static struct resource sh7760_i2c0_res[] = {
121 .end = SH7760_I2C0_MMIOEND, 122 .end = SH7760_I2C0_MMIOEND,
122 .flags = IORESOURCE_MEM, 123 .flags = IORESOURCE_MEM,
123 }, { 124 }, {
124 .start = evt2irq(0x9c0), 125 .start = SH7760_I2C0_IRQ,
125 .end = evt2irq(0x9c0), 126 .end = SH7760_I2C0_IRQ,
126 .flags = IORESOURCE_IRQ, 127 .flags = IORESOURCE_IRQ,
127 }, 128 },
128}; 129};
@@ -149,8 +150,8 @@ static struct resource smc91x_res[] = {
149 .flags = IORESOURCE_MEM, 150 .flags = IORESOURCE_MEM,
150 }, 151 },
151 [1] = { 152 [1] = {
152 .start = evt2irq(0x2a0), 153 .start = ETHERNET_IRQ,
153 .end = evt2irq(0x2a0), 154 .end = ETHERNET_IRQ,
154 .flags = IORESOURCE_IRQ , 155 .flags = IORESOURCE_IRQ ,
155 } 156 }
156}; 157};
@@ -188,4 +189,5 @@ device_initcall(init_edosk7760_devices);
188 */ 189 */
189struct sh_machine_vector mv_edosk7760 __initmv = { 190struct sh_machine_vector mv_edosk7760 __initmv = {
190 .mv_name = "EDOSK7760", 191 .mv_name = "EDOSK7760",
192 .mv_nr_irqs = 128,
191}; 193};
diff --git a/arch/sh/boards/board-espt.c b/arch/sh/boards/board-espt.c
index d71a0bcf814..9da92ac3653 100644
--- a/arch/sh/boards/board-espt.c
+++ b/arch/sh/boards/board-espt.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Data Technology Inc. ESPT-GIGA board support 2 * Data Technology Inc. ESPT-GIGA board suport
3 * 3 *
4 * Copyright (C) 2008, 2009 Renesas Solutions Corp. 4 * Copyright (C) 2008, 2009 Renesas Solutions Corp.
5 * Copyright (C) 2008, 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> 5 * Copyright (C) 2008, 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
@@ -13,10 +13,9 @@
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/mtd/physmap.h> 14#include <linux/mtd/physmap.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/sh_eth.h>
17#include <linux/sh_intc.h>
18#include <asm/machvec.h> 16#include <asm/machvec.h>
19#include <asm/sizes.h> 17#include <asm/sizes.h>
18#include <asm/sh_eth.h>
20 19
21/* NOR Flash */ 20/* NOR Flash */
22static struct mtd_partition espt_nor_flash_partitions[] = { 21static struct mtd_partition espt_nor_flash_partitions[] = {
@@ -72,7 +71,7 @@ static struct resource sh_eth_resources[] = {
72 .flags = IORESOURCE_MEM, 71 .flags = IORESOURCE_MEM,
73 }, { 72 }, {
74 73
75 .start = evt2irq(0x920), /* irq number */ 74 .start = 57, /* irq number */
76 .flags = IORESOURCE_IRQ, 75 .flags = IORESOURCE_IRQ,
77 }, 76 },
78}; 77};
diff --git a/arch/sh/boards/board-magicpanelr2.c b/arch/sh/boards/board-magicpanelr2.c
index 20500858b56..93f5039099b 100644
--- a/arch/sh/boards/board-magicpanelr2.c
+++ b/arch/sh/boards/board-magicpanelr2.c
@@ -14,26 +14,20 @@
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/regulator/fixed.h>
18#include <linux/regulator/machine.h>
19#include <linux/smsc911x.h> 17#include <linux/smsc911x.h>
20#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
21#include <linux/mtd/partitions.h> 19#include <linux/mtd/partitions.h>
22#include <linux/mtd/physmap.h> 20#include <linux/mtd/physmap.h>
23#include <linux/mtd/map.h> 21#include <linux/mtd/map.h>
24#include <linux/sh_intc.h>
25#include <mach/magicpanelr2.h> 22#include <mach/magicpanelr2.h>
26#include <asm/heartbeat.h> 23#include <asm/heartbeat.h>
27#include <cpu/sh7720.h> 24#include <cpu/sh7720.h>
28 25
29/* Dummy supplies, where voltage doesn't matter */
30static struct regulator_consumer_supply dummy_supplies[] = {
31 REGULATOR_SUPPLY("vddvario", "smsc911x"),
32 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
33};
34
35#define LAN9115_READY (__raw_readl(0xA8000084UL) & 0x00000001UL) 26#define LAN9115_READY (__raw_readl(0xA8000084UL) & 0x00000001UL)
36 27
28/* Prefer cmdline over RedBoot */
29static const char *probes[] = { "cmdlinepart", "RedBoot", NULL };
30
37/* Wait until reset finished. Timeout is 100ms. */ 31/* Wait until reset finished. Timeout is 100ms. */
38static int __init ethernet_reset_finished(void) 32static int __init ethernet_reset_finished(void)
39{ 33{
@@ -254,8 +248,8 @@ static struct resource smsc911x_resources[] = {
254 .flags = IORESOURCE_MEM, 248 .flags = IORESOURCE_MEM,
255 }, 249 },
256 [1] = { 250 [1] = {
257 .start = evt2irq(0x660), 251 .start = 35,
258 .end = evt2irq(0x660), 252 .end = 35,
259 .flags = IORESOURCE_IRQ, 253 .flags = IORESOURCE_IRQ,
260 }, 254 },
261}; 255};
@@ -299,6 +293,8 @@ static struct platform_device heartbeat_device = {
299 .resource = heartbeat_resources, 293 .resource = heartbeat_resources,
300}; 294};
301 295
296static struct mtd_partition *parsed_partitions;
297
302static struct mtd_partition mpr2_partitions[] = { 298static struct mtd_partition mpr2_partitions[] = {
303 /* Reserved for bootloader, read-only */ 299 /* Reserved for bootloader, read-only */
304 { 300 {
@@ -322,8 +318,6 @@ static struct mtd_partition mpr2_partitions[] = {
322}; 318};
323 319
324static struct physmap_flash_data flash_data = { 320static struct physmap_flash_data flash_data = {
325 .parts = mpr2_partitions,
326 .nr_parts = ARRAY_SIZE(mpr2_partitions),
327 .width = 2, 321 .width = 2,
328}; 322};
329 323
@@ -343,6 +337,32 @@ static struct platform_device flash_device = {
343 }, 337 },
344}; 338};
345 339
340static struct mtd_info *flash_mtd;
341
342static struct map_info mpr2_flash_map = {
343 .name = "Magic Panel R2 Flash",
344 .size = 0x2000000UL,
345 .bankwidth = 2,
346};
347
348static void __init set_mtd_partitions(void)
349{
350 int nr_parts = 0;
351
352 simple_map_init(&mpr2_flash_map);
353 flash_mtd = do_map_probe("cfi_probe", &mpr2_flash_map);
354 nr_parts = parse_mtd_partitions(flash_mtd, probes,
355 &parsed_partitions, 0);
356 /* If there is no partition table, used the hard coded table */
357 if (nr_parts <= 0) {
358 flash_data.parts = mpr2_partitions;
359 flash_data.nr_parts = ARRAY_SIZE(mpr2_partitions);
360 } else {
361 flash_data.nr_parts = nr_parts;
362 flash_data.parts = parsed_partitions;
363 }
364}
365
346/* 366/*
347 * Add all resources to the platform_device 367 * Add all resources to the platform_device
348 */ 368 */
@@ -356,8 +376,7 @@ static struct platform_device *mpr2_devices[] __initdata = {
356 376
357static int __init mpr2_devices_setup(void) 377static int __init mpr2_devices_setup(void)
358{ 378{
359 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 379 set_mtd_partitions();
360
361 return platform_add_devices(mpr2_devices, ARRAY_SIZE(mpr2_devices)); 380 return platform_add_devices(mpr2_devices, ARRAY_SIZE(mpr2_devices));
362} 381}
363device_initcall(mpr2_devices_setup); 382device_initcall(mpr2_devices_setup);
@@ -369,17 +388,17 @@ static void __init init_mpr2_IRQ(void)
369{ 388{
370 plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-5 */ 389 plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-5 */
371 390
372 irq_set_irq_type(evt2irq(0x600), IRQ_TYPE_LEVEL_LOW); /* IRQ0 CAN1 */ 391 irq_set_irq_type(32, IRQ_TYPE_LEVEL_LOW); /* IRQ0 CAN1 */
373 irq_set_irq_type(evt2irq(0x620), IRQ_TYPE_LEVEL_LOW); /* IRQ1 CAN2 */ 392 irq_set_irq_type(33, IRQ_TYPE_LEVEL_LOW); /* IRQ1 CAN2 */
374 irq_set_irq_type(evt2irq(0x640), IRQ_TYPE_LEVEL_LOW); /* IRQ2 CAN3 */ 393 irq_set_irq_type(34, IRQ_TYPE_LEVEL_LOW); /* IRQ2 CAN3 */
375 irq_set_irq_type(evt2irq(0x660), IRQ_TYPE_LEVEL_LOW); /* IRQ3 SMSC9115 */ 394 irq_set_irq_type(35, IRQ_TYPE_LEVEL_LOW); /* IRQ3 SMSC9115 */
376 irq_set_irq_type(evt2irq(0x680), IRQ_TYPE_EDGE_RISING); /* IRQ4 touchscreen */ 395 irq_set_irq_type(36, IRQ_TYPE_EDGE_RISING); /* IRQ4 touchscreen */
377 irq_set_irq_type(evt2irq(0x6a0), IRQ_TYPE_EDGE_FALLING); /* IRQ5 touchscreen */ 396 irq_set_irq_type(37, IRQ_TYPE_EDGE_FALLING); /* IRQ5 touchscreen */
378 397
379 intc_set_priority(evt2irq(0x600), 13); /* IRQ0 CAN1 */ 398 intc_set_priority(32, 13); /* IRQ0 CAN1 */
380 intc_set_priority(evt2irq(0x620), 13); /* IRQ0 CAN2 */ 399 intc_set_priority(33, 13); /* IRQ0 CAN2 */
381 intc_set_priority(evt2irq(0x640), 13); /* IRQ0 CAN3 */ 400 intc_set_priority(34, 13); /* IRQ0 CAN3 */
382 intc_set_priority(evt2irq(0x660), 6); /* IRQ3 SMSC9115 */ 401 intc_set_priority(35, 6); /* IRQ3 SMSC9115 */
383} 402}
384 403
385/* 404/*
diff --git a/arch/sh/boards/board-polaris.c b/arch/sh/boards/board-polaris.c
index 37a08d09472..594866356c2 100644
--- a/arch/sh/boards/board-polaris.c
+++ b/arch/sh/boards/board-polaris.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * June 2006 Steve Glendinning <steve.glendinning@shawell.net> 2 * June 2006 steve.glendinning@smsc.com
3 * 3 *
4 * Polaris-specific resource declaration 4 * Polaris-specific resource declaration
5 * 5 *
@@ -9,8 +9,6 @@
9#include <linux/interrupt.h> 9#include <linux/interrupt.h>
10#include <linux/irq.h> 10#include <linux/irq.h>
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <linux/regulator/fixed.h>
13#include <linux/regulator/machine.h>
14#include <linux/smsc911x.h> 12#include <linux/smsc911x.h>
15#include <linux/io.h> 13#include <linux/io.h>
16#include <asm/irq.h> 14#include <asm/irq.h>
@@ -24,12 +22,6 @@
24#define AREA5_WAIT_CTRL (0x1C00) 22#define AREA5_WAIT_CTRL (0x1C00)
25#define WAIT_STATES_10 (0x7) 23#define WAIT_STATES_10 (0x7)
26 24
27/* Dummy supplies, where voltage doesn't matter */
28static struct regulator_consumer_supply dummy_supplies[] = {
29 REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
30 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
31};
32
33static struct resource smsc911x_resources[] = { 25static struct resource smsc911x_resources[] = {
34 [0] = { 26 [0] = {
35 .name = "smsc911x-memory", 27 .name = "smsc911x-memory",
@@ -96,8 +88,6 @@ static int __init polaris_initialise(void)
96 88
97 printk(KERN_INFO "Configuring Polaris external bus\n"); 89 printk(KERN_INFO "Configuring Polaris external bus\n");
98 90
99 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
100
101 /* Configure area 5 with 2 wait states */ 91 /* Configure area 5 with 2 wait states */
102 wcr = __raw_readw(WCR2); 92 wcr = __raw_readw(WCR2);
103 wcr &= (~AREA5_WAIT_CTRL); 93 wcr &= (~AREA5_WAIT_CTRL);
@@ -151,5 +141,6 @@ static void __init init_polaris_irq(void)
151 141
152static struct sh_machine_vector mv_polaris __initmv = { 142static struct sh_machine_vector mv_polaris __initmv = {
153 .mv_name = "Polaris", 143 .mv_name = "Polaris",
144 .mv_nr_irqs = 61,
154 .mv_init_irq = init_polaris_irq, 145 .mv_init_irq = init_polaris_irq,
155}; 146};
diff --git a/arch/sh/boards/board-secureedge5410.c b/arch/sh/boards/board-secureedge5410.c
index 98b36205aa7..f968f17891a 100644
--- a/arch/sh/boards/board-secureedge5410.c
+++ b/arch/sh/boards/board-secureedge5410.c
@@ -41,7 +41,8 @@ static int __init eraseconfig_init(void)
41 printk("SnapGear: EraseConfig init\n"); 41 printk("SnapGear: EraseConfig init\n");
42 42
43 /* Setup "EraseConfig" switch on external IRQ 0 */ 43 /* Setup "EraseConfig" switch on external IRQ 0 */
44 if (request_irq(irq, eraseconfig_interrupt, 0, "Erase Config", NULL)) 44 if (request_irq(irq, eraseconfig_interrupt, IRQF_DISABLED,
45 "Erase Config", NULL))
45 printk("SnapGear: failed to register IRQ%d for Reset witch\n", 46 printk("SnapGear: failed to register IRQ%d for Reset witch\n",
46 irq); 47 irq);
47 else 48 else
@@ -71,5 +72,6 @@ static void __init init_snapgear_IRQ(void)
71 */ 72 */
72static struct sh_machine_vector mv_snapgear __initmv = { 73static struct sh_machine_vector mv_snapgear __initmv = {
73 .mv_name = "SnapGear SecureEdge5410", 74 .mv_name = "SnapGear SecureEdge5410",
75 .mv_nr_irqs = 72,
74 .mv_init_irq = init_snapgear_IRQ, 76 .mv_init_irq = init_snapgear_IRQ,
75}; 77};
diff --git a/arch/sh/boards/board-sh2007.c b/arch/sh/boards/board-sh2007.c
index 1980bb7e578..b90b78f6a82 100644
--- a/arch/sh/boards/board-sh2007.c
+++ b/arch/sh/boards/board-sh2007.c
@@ -6,8 +6,6 @@
6 */ 6 */
7#include <linux/init.h> 7#include <linux/init.h>
8#include <linux/irq.h> 8#include <linux/irq.h>
9#include <linux/regulator/fixed.h>
10#include <linux/regulator/machine.h>
11#include <linux/smsc911x.h> 9#include <linux/smsc911x.h>
12#include <linux/platform_device.h> 10#include <linux/platform_device.h>
13#include <linux/ata_platform.h> 11#include <linux/ata_platform.h>
@@ -15,14 +13,6 @@
15#include <asm/machvec.h> 13#include <asm/machvec.h>
16#include <mach/sh2007.h> 14#include <mach/sh2007.h>
17 15
18/* Dummy supplies, where voltage doesn't matter */
19static struct regulator_consumer_supply dummy_supplies[] = {
20 REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
21 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
22 REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
23 REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
24};
25
26struct smsc911x_platform_config smc911x_info = { 16struct smsc911x_platform_config smc911x_info = {
27 .flags = SMSC911X_USE_32BIT, 17 .flags = SMSC911X_USE_32BIT,
28 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 18 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
@@ -108,8 +98,6 @@ static struct platform_device *sh2007_devices[] __initdata = {
108 98
109static int __init sh2007_io_init(void) 99static int __init sh2007_io_init(void)
110{ 100{
111 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
112
113 platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices)); 101 platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices));
114 return 0; 102 return 0;
115} 103}
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
index 41f86702eb9..fa2a208ec6c 100644
--- a/arch/sh/boards/board-sh7757lcr.c
+++ b/arch/sh/boards/board-sh7757lcr.c
@@ -12,18 +12,14 @@
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/gpio.h> 13#include <linux/gpio.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/regulator/fixed.h>
16#include <linux/regulator/machine.h>
17#include <linux/spi/spi.h> 15#include <linux/spi/spi.h>
18#include <linux/spi/flash.h> 16#include <linux/spi/flash.h>
19#include <linux/io.h> 17#include <linux/io.h>
20#include <linux/mmc/host.h> 18#include <linux/mmc/host.h>
21#include <linux/mmc/sh_mmcif.h> 19#include <linux/mmc/sh_mmcif.h>
22#include <linux/mmc/sh_mobile_sdhi.h> 20#include <linux/mmc/sh_mobile_sdhi.h>
23#include <linux/sh_eth.h>
24#include <linux/sh_intc.h>
25#include <linux/usb/renesas_usbhs.h>
26#include <cpu/sh7757.h> 21#include <cpu/sh7757.h>
22#include <asm/sh_eth.h>
27#include <asm/heartbeat.h> 23#include <asm/heartbeat.h>
28 24
29static struct resource heartbeat_resource = { 25static struct resource heartbeat_resource = {
@@ -54,9 +50,9 @@ static struct platform_device heartbeat_device = {
54#define GBECONT 0xffc10100 50#define GBECONT 0xffc10100
55#define GBECONT_RMII1 BIT(17) 51#define GBECONT_RMII1 BIT(17)
56#define GBECONT_RMII0 BIT(16) 52#define GBECONT_RMII0 BIT(16)
57static void sh7757_eth_set_mdio_gate(void *addr) 53static void sh7757_eth_set_mdio_gate(unsigned long addr)
58{ 54{
59 if (((unsigned long)addr & 0x00000fff) < 0x0800) 55 if ((addr & 0x00000fff) < 0x0800)
60 writel(readl(GBECONT) | GBECONT_RMII0, GBECONT); 56 writel(readl(GBECONT) | GBECONT_RMII0, GBECONT);
61 else 57 else
62 writel(readl(GBECONT) | GBECONT_RMII1, GBECONT); 58 writel(readl(GBECONT) | GBECONT_RMII1, GBECONT);
@@ -68,8 +64,8 @@ static struct resource sh_eth0_resources[] = {
68 .end = 0xfef001ff, 64 .end = 0xfef001ff,
69 .flags = IORESOURCE_MEM, 65 .flags = IORESOURCE_MEM,
70 }, { 66 }, {
71 .start = evt2irq(0xc80), 67 .start = 84,
72 .end = evt2irq(0xc80), 68 .end = 84,
73 .flags = IORESOURCE_IRQ, 69 .flags = IORESOURCE_IRQ,
74 }, 70 },
75}; 71};
@@ -97,8 +93,8 @@ static struct resource sh_eth1_resources[] = {
97 .end = 0xfef009ff, 93 .end = 0xfef009ff,
98 .flags = IORESOURCE_MEM, 94 .flags = IORESOURCE_MEM,
99 }, { 95 }, {
100 .start = evt2irq(0xc80), 96 .start = 84,
101 .end = evt2irq(0xc80), 97 .end = 84,
102 .flags = IORESOURCE_IRQ, 98 .flags = IORESOURCE_IRQ,
103 }, 99 },
104}; 100};
@@ -120,9 +116,9 @@ static struct platform_device sh7757_eth1_device = {
120 }, 116 },
121}; 117};
122 118
123static void sh7757_eth_giga_set_mdio_gate(void *addr) 119static void sh7757_eth_giga_set_mdio_gate(unsigned long addr)
124{ 120{
125 if (((unsigned long)addr & 0x00000fff) < 0x0800) { 121 if ((addr & 0x00000fff) < 0x0800) {
126 gpio_set_value(GPIO_PTT4, 1); 122 gpio_set_value(GPIO_PTT4, 1);
127 writel(readl(GBECONT) & ~GBECONT_RMII0, GBECONT); 123 writel(readl(GBECONT) & ~GBECONT_RMII0, GBECONT);
128 } else { 124 } else {
@@ -142,8 +138,8 @@ static struct resource sh_eth_giga0_resources[] = {
142 .end = 0xfee01fff, 138 .end = 0xfee01fff,
143 .flags = IORESOURCE_MEM, 139 .flags = IORESOURCE_MEM,
144 }, { 140 }, {
145 .start = evt2irq(0x2960), 141 .start = 315,
146 .end = evt2irq(0x2960), 142 .end = 315,
147 .flags = IORESOURCE_IRQ, 143 .flags = IORESOURCE_IRQ,
148 }, 144 },
149}; 145};
@@ -172,13 +168,8 @@ static struct resource sh_eth_giga1_resources[] = {
172 .end = 0xfee00fff, 168 .end = 0xfee00fff,
173 .flags = IORESOURCE_MEM, 169 .flags = IORESOURCE_MEM,
174 }, { 170 }, {
175 /* TSU */ 171 .start = 316,
176 .start = 0xfee01800, 172 .end = 316,
177 .end = 0xfee01fff,
178 .flags = IORESOURCE_MEM,
179 }, {
180 .start = evt2irq(0x2980),
181 .end = evt2irq(0x2980),
182 .flags = IORESOURCE_IRQ, 173 .flags = IORESOURCE_IRQ,
183 }, 174 },
184}; 175};
@@ -201,15 +192,6 @@ static struct platform_device sh7757_eth_giga1_device = {
201 }, 192 },
202}; 193};
203 194
204/* Fixed 3.3V regulator to be used by SDHI0, MMCIF */
205static struct regulator_consumer_supply fixed3v3_power_consumers[] =
206{
207 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
208 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
209 REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
210 REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
211};
212
213/* SH_MMCIF */ 195/* SH_MMCIF */
214static struct resource sh_mmcif_resources[] = { 196static struct resource sh_mmcif_resources[] = {
215 [0] = { 197 [0] = {
@@ -218,22 +200,25 @@ static struct resource sh_mmcif_resources[] = {
218 .flags = IORESOURCE_MEM, 200 .flags = IORESOURCE_MEM,
219 }, 201 },
220 [1] = { 202 [1] = {
221 .start = evt2irq(0x1c60), 203 .start = 211,
222 .flags = IORESOURCE_IRQ, 204 .flags = IORESOURCE_IRQ,
223 }, 205 },
224 [2] = { 206 [2] = {
225 .start = evt2irq(0x1c80), 207 .start = 212,
226 .flags = IORESOURCE_IRQ, 208 .flags = IORESOURCE_IRQ,
227 }, 209 },
228}; 210};
229 211
212static struct sh_mmcif_dma sh7757lcr_mmcif_dma = {
213 .chan_priv_tx = SHDMA_SLAVE_MMCIF_TX,
214 .chan_priv_rx = SHDMA_SLAVE_MMCIF_RX,
215};
216
230static struct sh_mmcif_plat_data sh_mmcif_plat = { 217static struct sh_mmcif_plat_data sh_mmcif_plat = {
218 .dma = &sh7757lcr_mmcif_dma,
231 .sup_pclk = 0x0f, 219 .sup_pclk = 0x0f,
232 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA | 220 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
233 MMC_CAP_NONREMOVABLE,
234 .ocr = MMC_VDD_32_33 | MMC_VDD_33_34, 221 .ocr = MMC_VDD_32_33 | MMC_VDD_33_34,
235 .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
236 .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
237}; 222};
238 223
239static struct platform_device sh_mmcif_device = { 224static struct platform_device sh_mmcif_device = {
@@ -260,7 +245,7 @@ static struct resource sdhi_resources[] = {
260 .flags = IORESOURCE_MEM, 245 .flags = IORESOURCE_MEM,
261 }, 246 },
262 [1] = { 247 [1] = {
263 .start = evt2irq(0x480), 248 .start = 20,
264 .flags = IORESOURCE_IRQ, 249 .flags = IORESOURCE_IRQ,
265 }, 250 },
266}; 251};
@@ -275,43 +260,6 @@ static struct platform_device sdhi_device = {
275 }, 260 },
276}; 261};
277 262
278static int usbhs0_get_id(struct platform_device *pdev)
279{
280 return USBHS_GADGET;
281}
282
283static struct renesas_usbhs_platform_info usb0_data = {
284 .platform_callback = {
285 .get_id = usbhs0_get_id,
286 },
287 .driver_param = {
288 .buswait_bwait = 5,
289 }
290};
291
292static struct resource usb0_resources[] = {
293 [0] = {
294 .start = 0xfe450000,
295 .end = 0xfe4501ff,
296 .flags = IORESOURCE_MEM,
297 },
298 [1] = {
299 .start = evt2irq(0x840),
300 .end = evt2irq(0x840),
301 .flags = IORESOURCE_IRQ,
302 },
303};
304
305static struct platform_device usb0_device = {
306 .name = "renesas_usbhs",
307 .id = 0,
308 .dev = {
309 .platform_data = &usb0_data,
310 },
311 .num_resources = ARRAY_SIZE(usb0_resources),
312 .resource = usb0_resources,
313};
314
315static struct platform_device *sh7757lcr_devices[] __initdata = { 263static struct platform_device *sh7757lcr_devices[] __initdata = {
316 &heartbeat_device, 264 &heartbeat_device,
317 &sh7757_eth0_device, 265 &sh7757_eth0_device,
@@ -320,7 +268,6 @@ static struct platform_device *sh7757lcr_devices[] __initdata = {
320 &sh7757_eth_giga1_device, 268 &sh7757_eth_giga1_device,
321 &sh_mmcif_device, 269 &sh_mmcif_device,
322 &sdhi_device, 270 &sdhi_device,
323 &usb0_device,
324}; 271};
325 272
326static struct flash_platform_data spi_flash_data = { 273static struct flash_platform_data spi_flash_data = {
@@ -340,9 +287,6 @@ static struct spi_board_info spi_board_info[] = {
340 287
341static int __init sh7757lcr_devices_setup(void) 288static int __init sh7757lcr_devices_setup(void)
342{ 289{
343 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
344 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
345
346 /* RGMII (PTA) */ 290 /* RGMII (PTA) */
347 gpio_request(GPIO_FN_ET0_MDC, NULL); 291 gpio_request(GPIO_FN_ET0_MDC, NULL);
348 gpio_request(GPIO_FN_ET0_MDIO, NULL); 292 gpio_request(GPIO_FN_ET0_MDIO, NULL);
diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c
index 2c4771ee84c..d879848f3cd 100644
--- a/arch/sh/boards/board-sh7785lcr.c
+++ b/arch/sh/boards/board-sh7785lcr.c
@@ -20,7 +20,6 @@
20#include <linux/i2c-pca-platform.h> 20#include <linux/i2c-pca-platform.h>
21#include <linux/i2c-algo-pca.h> 21#include <linux/i2c-algo-pca.h>
22#include <linux/usb/r8a66597.h> 22#include <linux/usb/r8a66597.h>
23#include <linux/sh_intc.h>
24#include <linux/irq.h> 23#include <linux/irq.h>
25#include <linux/io.h> 24#include <linux/io.h>
26#include <linux/clk.h> 25#include <linux/clk.h>
@@ -29,7 +28,6 @@
29#include <cpu/sh7785.h> 28#include <cpu/sh7785.h>
30#include <asm/heartbeat.h> 29#include <asm/heartbeat.h>
31#include <asm/clock.h> 30#include <asm/clock.h>
32#include <asm/bl_bit.h>
33 31
34/* 32/*
35 * NOTE: This board has 2 physical memory maps. 33 * NOTE: This board has 2 physical memory maps.
@@ -106,8 +104,8 @@ static struct resource r8a66597_usb_host_resources[] = {
106 .flags = IORESOURCE_MEM, 104 .flags = IORESOURCE_MEM,
107 }, 105 },
108 [1] = { 106 [1] = {
109 .start = evt2irq(0x240), 107 .start = 2,
110 .end = evt2irq(0x240), 108 .end = 2,
111 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 109 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
112 }, 110 },
113}; 111};
@@ -136,7 +134,7 @@ static struct resource sm501_resources[] = {
136 .flags = IORESOURCE_MEM, 134 .flags = IORESOURCE_MEM,
137 }, 135 },
138 [2] = { 136 [2] = {
139 .start = evt2irq(0x340), 137 .start = 10,
140 .flags = IORESOURCE_IRQ, 138 .flags = IORESOURCE_IRQ,
141 }, 139 },
142}; 140};
@@ -224,8 +222,8 @@ static struct resource i2c_proto_resources[] = {
224 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, 222 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
225 }, 223 },
226 [1] = { 224 [1] = {
227 .start = evt2irq(0x380), 225 .start = 12,
228 .end = evt2irq(0x380), 226 .end = 12,
229 .flags = IORESOURCE_IRQ, 227 .flags = IORESOURCE_IRQ,
230 }, 228 },
231}; 229};
@@ -237,8 +235,8 @@ static struct resource i2c_resources[] = {
237 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, 235 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
238 }, 236 },
239 [1] = { 237 [1] = {
240 .start = evt2irq(0x380), 238 .start = 12,
241 .end = evt2irq(0x380), 239 .end = 12,
242 .flags = IORESOURCE_IRQ, 240 .flags = IORESOURCE_IRQ,
243 }, 241 },
244}; 242};
diff --git a/arch/sh/boards/board-urquell.c b/arch/sh/boards/board-urquell.c
index b52abcc5259..24e3316c5c1 100644
--- a/arch/sh/boards/board-urquell.c
+++ b/arch/sh/boards/board-urquell.c
@@ -20,7 +20,6 @@
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/sh_intc.h>
24#include <mach/urquell.h> 23#include <mach/urquell.h>
25#include <cpu/sh7786.h> 24#include <cpu/sh7786.h>
26#include <asm/heartbeat.h> 25#include <asm/heartbeat.h>
@@ -79,7 +78,7 @@ static struct resource smc91x_eth_resources[] = {
79 .flags = IORESOURCE_MEM, 78 .flags = IORESOURCE_MEM,
80 }, 79 },
81 [1] = { 80 [1] = {
82 .start = evt2irq(0x360), 81 .start = 11,
83 .flags = IORESOURCE_IRQ, 82 .flags = IORESOURCE_IRQ,
84 }, 83 },
85}; 84};
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index 5620e33c18a..d3626575891 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -20,12 +20,8 @@
20#include <linux/mtd/sh_flctl.h> 20#include <linux/mtd/sh_flctl.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/regulator/fixed.h>
24#include <linux/regulator/machine.h>
25#include <linux/smsc911x.h> 23#include <linux/smsc911x.h>
26#include <linux/gpio.h> 24#include <linux/gpio.h>
27#include <linux/videodev2.h>
28#include <linux/sh_intc.h>
29#include <media/ov772x.h> 25#include <media/ov772x.h>
30#include <media/soc_camera.h> 26#include <media/soc_camera.h>
31#include <media/soc_camera_platform.h> 27#include <media/soc_camera_platform.h>
@@ -36,12 +32,6 @@
36#include <asm/suspend.h> 32#include <asm/suspend.h>
37#include <cpu/sh7723.h> 33#include <cpu/sh7723.h>
38 34
39/* Dummy supplies, where voltage doesn't matter */
40static struct regulator_consumer_supply dummy_supplies[] = {
41 REGULATOR_SUPPLY("vddvario", "smsc911x"),
42 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
43};
44
45static struct smsc911x_platform_config smsc911x_config = { 35static struct smsc911x_platform_config smsc911x_config = {
46 .phy_interface = PHY_INTERFACE_MODE_MII, 36 .phy_interface = PHY_INTERFACE_MODE_MII,
47 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 37 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
@@ -56,8 +46,8 @@ static struct resource smsc9118_resources[] = {
56 .flags = IORESOURCE_MEM, 46 .flags = IORESOURCE_MEM,
57 }, 47 },
58 [1] = { 48 [1] = {
59 .start = evt2irq(0x660), 49 .start = 35,
60 .end = evt2irq(0x660), 50 .end = 35,
61 .flags = IORESOURCE_IRQ, 51 .flags = IORESOURCE_IRQ,
62 } 52 }
63}; 53};
@@ -166,7 +156,7 @@ static struct platform_device nand_flash_device = {
166#define PORT_DRVCRA 0xA405018A 156#define PORT_DRVCRA 0xA405018A
167#define PORT_DRVCRB 0xA405018C 157#define PORT_DRVCRB 0xA405018C
168 158
169static int ap320_wvga_set_brightness(int brightness) 159static int ap320_wvga_set_brightness(void *board_data, int brightness)
170{ 160{
171 if (brightness) { 161 if (brightness) {
172 gpio_set_value(GPIO_PTS3, 0); 162 gpio_set_value(GPIO_PTS3, 0);
@@ -175,11 +165,16 @@ static int ap320_wvga_set_brightness(int brightness)
175 __raw_writew(0, FPGA_BKLREG); 165 __raw_writew(0, FPGA_BKLREG);
176 gpio_set_value(GPIO_PTS3, 1); 166 gpio_set_value(GPIO_PTS3, 1);
177 } 167 }
178 168
179 return 0; 169 return 0;
180} 170}
181 171
182static void ap320_wvga_power_on(void) 172static int ap320_wvga_get_brightness(void *board_data)
173{
174 return gpio_get_value(GPIO_PTS3);
175}
176
177static void ap320_wvga_power_on(void *board_data, struct fb_info *info)
183{ 178{
184 msleep(100); 179 msleep(100);
185 180
@@ -187,7 +182,7 @@ static void ap320_wvga_power_on(void)
187 __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG); 182 __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG);
188} 183}
189 184
190static void ap320_wvga_power_off(void) 185static void ap320_wvga_power_off(void *board_data)
191{ 186{
192 /* ASD AP-320/325 LCD OFF */ 187 /* ASD AP-320/325 LCD OFF */
193 __raw_writew(0, FPGA_LCDREG); 188 __raw_writew(0, FPGA_LCDREG);
@@ -212,21 +207,24 @@ static struct sh_mobile_lcdc_info lcdc_info = {
212 .clock_source = LCDC_CLK_EXTERNAL, 207 .clock_source = LCDC_CLK_EXTERNAL,
213 .ch[0] = { 208 .ch[0] = {
214 .chan = LCDC_CHAN_MAINLCD, 209 .chan = LCDC_CHAN_MAINLCD,
215 .fourcc = V4L2_PIX_FMT_RGB565, 210 .bpp = 16,
216 .interface_type = RGB18, 211 .interface_type = RGB18,
217 .clock_divider = 1, 212 .clock_divider = 1,
218 .lcd_modes = ap325rxa_lcdc_modes, 213 .lcd_cfg = ap325rxa_lcdc_modes,
219 .num_modes = ARRAY_SIZE(ap325rxa_lcdc_modes), 214 .num_cfg = ARRAY_SIZE(ap325rxa_lcdc_modes),
220 .panel_cfg = { 215 .lcd_size_cfg = { /* 7.0 inch */
221 .width = 152, /* 7.0 inch */ 216 .width = 152,
222 .height = 91, 217 .height = 91,
218 },
219 .board_cfg = {
223 .display_on = ap320_wvga_power_on, 220 .display_on = ap320_wvga_power_on,
224 .display_off = ap320_wvga_power_off, 221 .display_off = ap320_wvga_power_off,
222 .set_brightness = ap320_wvga_set_brightness,
223 .get_brightness = ap320_wvga_get_brightness,
225 }, 224 },
226 .bl_info = { 225 .bl_info = {
227 .name = "sh_mobile_lcdc_bl", 226 .name = "sh_mobile_lcdc_bl",
228 .max_brightness = 1, 227 .max_brightness = 1,
229 .set_brightness = ap320_wvga_set_brightness,
230 }, 228 },
231 } 229 }
232}; 230};
@@ -239,7 +237,7 @@ static struct resource lcdc_resources[] = {
239 .flags = IORESOURCE_MEM, 237 .flags = IORESOURCE_MEM,
240 }, 238 },
241 [1] = { 239 [1] = {
242 .start = evt2irq(0x580), 240 .start = 28,
243 .flags = IORESOURCE_IRQ, 241 .flags = IORESOURCE_IRQ,
244 }, 242 },
245}; 243};
@@ -251,6 +249,9 @@ static struct platform_device lcdc_device = {
251 .dev = { 249 .dev = {
252 .platform_data = &lcdc_info, 250 .platform_data = &lcdc_info,
253 }, 251 },
252 .archdata = {
253 .hwblk_id = HWBLK_LCDC,
254 },
254}; 255};
255 256
256static void camera_power(int val) 257static void camera_power(int val)
@@ -344,10 +345,9 @@ static struct soc_camera_platform_info camera_info = {
344 .width = 640, 345 .width = 640,
345 .height = 480, 346 .height = 480,
346 }, 347 },
347 .mbus_param = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER | 348 .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
348 V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH | 349 SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8 |
349 V4L2_MBUS_DATA_ACTIVE_HIGH, 350 SOCAM_DATA_ACTIVE_HIGH,
350 .mbus_type = V4L2_MBUS_PARALLEL,
351 .set_capture = camera_set_capture, 351 .set_capture = camera_set_capture,
352}; 352};
353 353
@@ -407,7 +407,7 @@ static struct resource ceu_resources[] = {
407 .flags = IORESOURCE_MEM, 407 .flags = IORESOURCE_MEM,
408 }, 408 },
409 [1] = { 409 [1] = {
410 .start = evt2irq(0x880), 410 .start = 52,
411 .flags = IORESOURCE_IRQ, 411 .flags = IORESOURCE_IRQ,
412 }, 412 },
413 [2] = { 413 [2] = {
@@ -423,15 +423,9 @@ static struct platform_device ceu_device = {
423 .dev = { 423 .dev = {
424 .platform_data = &sh_mobile_ceu_info, 424 .platform_data = &sh_mobile_ceu_info,
425 }, 425 },
426}; 426 .archdata = {
427 427 .hwblk_id = HWBLK_CEU,
428/* Fixed 3.3V regulators to be used by SDHI0, SDHI1 */ 428 },
429static struct regulator_consumer_supply fixed3v3_power_consumers[] =
430{
431 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
432 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
433 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
434 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
435}; 429};
436 430
437static struct resource sdhi0_cn3_resources[] = { 431static struct resource sdhi0_cn3_resources[] = {
@@ -442,7 +436,7 @@ static struct resource sdhi0_cn3_resources[] = {
442 .flags = IORESOURCE_MEM, 436 .flags = IORESOURCE_MEM,
443 }, 437 },
444 [1] = { 438 [1] = {
445 .start = evt2irq(0xe80), 439 .start = 100,
446 .flags = IORESOURCE_IRQ, 440 .flags = IORESOURCE_IRQ,
447 }, 441 },
448}; 442};
@@ -459,6 +453,9 @@ static struct platform_device sdhi0_cn3_device = {
459 .dev = { 453 .dev = {
460 .platform_data = &sdhi0_cn3_data, 454 .platform_data = &sdhi0_cn3_data,
461 }, 455 },
456 .archdata = {
457 .hwblk_id = HWBLK_SDHI0,
458 },
462}; 459};
463 460
464static struct resource sdhi1_cn7_resources[] = { 461static struct resource sdhi1_cn7_resources[] = {
@@ -469,7 +466,7 @@ static struct resource sdhi1_cn7_resources[] = {
469 .flags = IORESOURCE_MEM, 466 .flags = IORESOURCE_MEM,
470 }, 467 },
471 [1] = { 468 [1] = {
472 .start = evt2irq(0x4e0), 469 .start = 23,
473 .flags = IORESOURCE_IRQ, 470 .flags = IORESOURCE_IRQ,
474 }, 471 },
475}; 472};
@@ -486,6 +483,9 @@ static struct platform_device sdhi1_cn7_device = {
486 .dev = { 483 .dev = {
487 .platform_data = &sdhi1_cn7_data, 484 .platform_data = &sdhi1_cn7_data,
488 }, 485 },
486 .archdata = {
487 .hwblk_id = HWBLK_SDHI1,
488 },
489}; 489};
490 490
491static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { 491static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
@@ -501,7 +501,8 @@ static struct i2c_board_info ap325rxa_i2c_camera[] = {
501}; 501};
502 502
503static struct ov772x_camera_info ov7725_info = { 503static struct ov772x_camera_info ov7725_info = {
504 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, 504 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP | \
505 OV772X_FLAG_8BIT,
505 .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0), 506 .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0),
506}; 507};
507 508
@@ -555,10 +556,6 @@ static int __init ap325rxa_devices_setup(void)
555 &ap325rxa_sdram_leave_start, 556 &ap325rxa_sdram_leave_start,
556 &ap325rxa_sdram_leave_end); 557 &ap325rxa_sdram_leave_end);
557 558
558 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
559 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
560 regulator_register_fixed(1, dummy_supplies, ARRAY_SIZE(dummy_supplies));
561
562 /* LD3 and LD4 LEDs */ 559 /* LD3 and LD4 LEDs */
563 gpio_request(GPIO_PTX5, NULL); /* RUN */ 560 gpio_request(GPIO_PTX5, NULL); /* RUN */
564 gpio_direction_output(GPIO_PTX5, 1); 561 gpio_direction_output(GPIO_PTX5, 1);
diff --git a/arch/sh/boards/mach-cayman/irq.c b/arch/sh/boards/mach-cayman/irq.c
index 724e8b7271f..311bcebdbd0 100644
--- a/arch/sh/boards/mach-cayman/irq.c
+++ b/arch/sh/boards/mach-cayman/irq.c
@@ -46,11 +46,13 @@ static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id)
46static struct irqaction cayman_action_smsc = { 46static struct irqaction cayman_action_smsc = {
47 .name = "Cayman SMSC Mux", 47 .name = "Cayman SMSC Mux",
48 .handler = cayman_interrupt_smsc, 48 .handler = cayman_interrupt_smsc,
49 .flags = IRQF_DISABLED,
49}; 50};
50 51
51static struct irqaction cayman_action_pci2 = { 52static struct irqaction cayman_action_pci2 = {
52 .name = "Cayman PCI2 Mux", 53 .name = "Cayman PCI2 Mux",
53 .handler = cayman_interrupt_pci2, 54 .handler = cayman_interrupt_pci2,
55 .flags = IRQF_DISABLED,
54}; 56};
55 57
56static void enable_cayman_irq(struct irq_data *data) 58static void enable_cayman_irq(struct irq_data *data)
diff --git a/arch/sh/boards/mach-cayman/setup.c b/arch/sh/boards/mach-cayman/setup.c
index 340fd40b381..e89e8e122a2 100644
--- a/arch/sh/boards/mach-cayman/setup.c
+++ b/arch/sh/boards/mach-cayman/setup.c
@@ -181,6 +181,7 @@ extern void init_cayman_irq(void);
181 181
182static struct sh_machine_vector mv_cayman __initmv = { 182static struct sh_machine_vector mv_cayman __initmv = {
183 .mv_name = "Hitachi Cayman", 183 .mv_name = "Hitachi Cayman",
184 .mv_nr_irqs = 64,
184 .mv_ioport_map = cayman_ioport_map, 185 .mv_ioport_map = cayman_ioport_map,
185 .mv_init_irq = init_cayman_irq, 186 .mv_init_irq = init_cayman_irq,
186}; 187};
diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c
index 2789647abeb..f63d323f411 100644
--- a/arch/sh/boards/mach-dreamcast/irq.c
+++ b/arch/sh/boards/mach-dreamcast/irq.c
@@ -8,11 +8,10 @@
8 * This file is part of the LinuxDC project (www.linuxdc.org) 8 * This file is part of the LinuxDC project (www.linuxdc.org)
9 * Released under the terms of the GNU GPL v2.0 9 * Released under the terms of the GNU GPL v2.0
10 */ 10 */
11
11#include <linux/irq.h> 12#include <linux/irq.h>
12#include <linux/io.h> 13#include <linux/io.h>
13#include <linux/irq.h> 14#include <asm/irq.h>
14#include <linux/export.h>
15#include <linux/err.h>
16#include <mach/sysasic.h> 15#include <mach/sysasic.h>
17 16
18/* 17/*
@@ -142,15 +141,26 @@ int systemasic_irq_demux(int irq)
142 141
143void systemasic_irq_init(void) 142void systemasic_irq_init(void)
144{ 143{
145 int irq_base, i; 144 int i, nid = cpu_to_node(boot_cpu_data);
146 145
147 irq_base = irq_alloc_descs(HW_EVENT_IRQ_BASE, HW_EVENT_IRQ_BASE, 146 /* Assign all virtual IRQs to the System ASIC int. handler */
148 HW_EVENT_IRQ_MAX - HW_EVENT_IRQ_BASE, -1); 147 for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++) {
149 if (IS_ERR_VALUE(irq_base)) { 148 unsigned int irq;
150 pr_err("%s: failed hooking irqs\n", __func__); 149
151 return; 150 irq = create_irq_nr(i, nid);
152 } 151 if (unlikely(irq == 0)) {
152 pr_err("%s: failed hooking irq %d for systemasic\n",
153 __func__, i);
154 return;
155 }
156
157 if (unlikely(irq != i)) {
158 pr_err("%s: got irq %d but wanted %d, bailing.\n",
159 __func__, irq, i);
160 destroy_irq(irq);
161 return;
162 }
153 163
154 for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
155 irq_set_chip_and_handler(i, &systemasic_int, handle_level_irq); 164 irq_set_chip_and_handler(i, &systemasic_int, handle_level_irq);
165 }
156} 166}
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 3fede4556c9..b24d69d509e 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -19,8 +19,6 @@
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/regulator/fixed.h>
23#include <linux/regulator/machine.h>
24#include <linux/usb/r8a66597.h> 22#include <linux/usb/r8a66597.h>
25#include <linux/usb/renesas_usbhs.h> 23#include <linux/usb/renesas_usbhs.h>
26#include <linux/i2c.h> 24#include <linux/i2c.h>
@@ -30,17 +28,13 @@
30#include <linux/spi/mmc_spi.h> 28#include <linux/spi/mmc_spi.h>
31#include <linux/input.h> 29#include <linux/input.h>
32#include <linux/input/sh_keysc.h> 30#include <linux/input/sh_keysc.h>
33#include <linux/sh_eth.h>
34#include <linux/sh_intc.h>
35#include <linux/videodev2.h>
36#include <video/sh_mobile_lcdc.h> 31#include <video/sh_mobile_lcdc.h>
37#include <sound/sh_fsi.h> 32#include <sound/sh_fsi.h>
38#include <sound/simple_card.h>
39#include <media/sh_mobile_ceu.h> 33#include <media/sh_mobile_ceu.h>
40#include <media/soc_camera.h>
41#include <media/tw9910.h> 34#include <media/tw9910.h>
42#include <media/mt9t112.h> 35#include <media/mt9t112.h>
43#include <asm/heartbeat.h> 36#include <asm/heartbeat.h>
37#include <asm/sh_eth.h>
44#include <asm/clock.h> 38#include <asm/clock.h>
45#include <asm/suspend.h> 39#include <asm/suspend.h>
46#include <cpu/sh7724.h> 40#include <cpu/sh7724.h>
@@ -141,7 +135,7 @@ static struct resource sh_eth_resources[] = {
141 .flags = IORESOURCE_MEM, 135 .flags = IORESOURCE_MEM,
142 }, 136 },
143 [1] = { 137 [1] = {
144 .start = evt2irq(0xd60), 138 .start = 91,
145 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 139 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
146 }, 140 },
147}; 141};
@@ -162,6 +156,9 @@ static struct platform_device sh_eth_device = {
162 }, 156 },
163 .num_resources = ARRAY_SIZE(sh_eth_resources), 157 .num_resources = ARRAY_SIZE(sh_eth_resources),
164 .resource = sh_eth_resources, 158 .resource = sh_eth_resources,
159 .archdata = {
160 .hwblk_id = HWBLK_ETHER,
161 },
165}; 162};
166 163
167/* USB0 host */ 164/* USB0 host */
@@ -182,8 +179,8 @@ static struct resource usb0_host_resources[] = {
182 .flags = IORESOURCE_MEM, 179 .flags = IORESOURCE_MEM,
183 }, 180 },
184 [1] = { 181 [1] = {
185 .start = evt2irq(0xa20), 182 .start = 65,
186 .end = evt2irq(0xa20), 183 .end = 65,
187 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 184 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
188 }, 185 },
189}; 186};
@@ -218,8 +215,8 @@ static struct resource usb1_common_resources[] = {
218 .flags = IORESOURCE_MEM, 215 .flags = IORESOURCE_MEM,
219 }, 216 },
220 [1] = { 217 [1] = {
221 .start = evt2irq(0xa40), 218 .start = 66,
222 .end = evt2irq(0xa40), 219 .end = 66,
223 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 220 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
224 }, 221 },
225}; 222};
@@ -244,25 +241,13 @@ static int usbhs_get_id(struct platform_device *pdev)
244 return gpio_get_value(GPIO_PTB3); 241 return gpio_get_value(GPIO_PTB3);
245} 242}
246 243
247static void usbhs_phy_reset(struct platform_device *pdev)
248{
249 /* enable vbus if HOST */
250 if (!gpio_get_value(GPIO_PTB3))
251 gpio_set_value(GPIO_PTB5, 1);
252}
253
254static struct renesas_usbhs_platform_info usbhs_info = { 244static struct renesas_usbhs_platform_info usbhs_info = {
255 .platform_callback = { 245 .platform_callback = {
256 .get_id = usbhs_get_id, 246 .get_id = usbhs_get_id,
257 .phy_reset = usbhs_phy_reset,
258 }, 247 },
259 .driver_param = { 248 .driver_param = {
260 .buswait_bwait = 4, 249 .buswait_bwait = 4,
261 .detection_delay = 5, 250 .detection_delay = 5,
262 .d0_tx_id = SHDMA_SLAVE_USB1D0_TX,
263 .d0_rx_id = SHDMA_SLAVE_USB1D0_RX,
264 .d1_tx_id = SHDMA_SLAVE_USB1D1_TX,
265 .d1_rx_id = SHDMA_SLAVE_USB1D1_RX,
266 }, 251 },
267}; 252};
268 253
@@ -273,8 +258,8 @@ static struct resource usbhs_resources[] = {
273 .flags = IORESOURCE_MEM, 258 .flags = IORESOURCE_MEM,
274 }, 259 },
275 [1] = { 260 [1] = {
276 .start = evt2irq(0xa40), 261 .start = 66,
277 .end = evt2irq(0xa40), 262 .end = 66,
278 .flags = IORESOURCE_IRQ, 263 .flags = IORESOURCE_IRQ,
279 }, 264 },
280}; 265};
@@ -289,6 +274,9 @@ static struct platform_device usbhs_device = {
289 }, 274 },
290 .num_resources = ARRAY_SIZE(usbhs_resources), 275 .num_resources = ARRAY_SIZE(usbhs_resources),
291 .resource = usbhs_resources, 276 .resource = usbhs_resources,
277 .archdata = {
278 .hwblk_id = HWBLK_USB1,
279 },
292}; 280};
293 281
294/* LCDC */ 282/* LCDC */
@@ -322,26 +310,34 @@ static const struct fb_videomode ecovec_dvi_modes[] = {
322 }, 310 },
323}; 311};
324 312
325static int ecovec24_set_brightness(int brightness) 313static int ecovec24_set_brightness(void *board_data, int brightness)
326{ 314{
327 gpio_set_value(GPIO_PTR1, brightness); 315 gpio_set_value(GPIO_PTR1, brightness);
328 316
329 return 0; 317 return 0;
330} 318}
331 319
320static int ecovec24_get_brightness(void *board_data)
321{
322 return gpio_get_value(GPIO_PTR1);
323}
324
332static struct sh_mobile_lcdc_info lcdc_info = { 325static struct sh_mobile_lcdc_info lcdc_info = {
333 .ch[0] = { 326 .ch[0] = {
334 .interface_type = RGB18, 327 .interface_type = RGB18,
335 .chan = LCDC_CHAN_MAINLCD, 328 .chan = LCDC_CHAN_MAINLCD,
336 .fourcc = V4L2_PIX_FMT_RGB565, 329 .bpp = 16,
337 .panel_cfg = { /* 7.0 inch */ 330 .lcd_size_cfg = { /* 7.0 inch */
338 .width = 152, 331 .width = 152,
339 .height = 91, 332 .height = 91,
340 }, 333 },
334 .board_cfg = {
335 .set_brightness = ecovec24_set_brightness,
336 .get_brightness = ecovec24_get_brightness,
337 },
341 .bl_info = { 338 .bl_info = {
342 .name = "sh_mobile_lcdc_bl", 339 .name = "sh_mobile_lcdc_bl",
343 .max_brightness = 1, 340 .max_brightness = 1,
344 .set_brightness = ecovec24_set_brightness,
345 }, 341 },
346 } 342 }
347}; 343};
@@ -354,7 +350,7 @@ static struct resource lcdc_resources[] = {
354 .flags = IORESOURCE_MEM, 350 .flags = IORESOURCE_MEM,
355 }, 351 },
356 [1] = { 352 [1] = {
357 .start = evt2irq(0xf40), 353 .start = 106,
358 .flags = IORESOURCE_IRQ, 354 .flags = IORESOURCE_IRQ,
359 }, 355 },
360}; 356};
@@ -366,6 +362,9 @@ static struct platform_device lcdc_device = {
366 .dev = { 362 .dev = {
367 .platform_data = &lcdc_info, 363 .platform_data = &lcdc_info,
368 }, 364 },
365 .archdata = {
366 .hwblk_id = HWBLK_LCDC,
367 },
369}; 368};
370 369
371/* CEU0 */ 370/* CEU0 */
@@ -381,7 +380,7 @@ static struct resource ceu0_resources[] = {
381 .flags = IORESOURCE_MEM, 380 .flags = IORESOURCE_MEM,
382 }, 381 },
383 [1] = { 382 [1] = {
384 .start = evt2irq(0x880), 383 .start = 52,
385 .flags = IORESOURCE_IRQ, 384 .flags = IORESOURCE_IRQ,
386 }, 385 },
387 [2] = { 386 [2] = {
@@ -397,6 +396,9 @@ static struct platform_device ceu0_device = {
397 .dev = { 396 .dev = {
398 .platform_data = &sh_mobile_ceu0_info, 397 .platform_data = &sh_mobile_ceu0_info,
399 }, 398 },
399 .archdata = {
400 .hwblk_id = HWBLK_CEU0,
401 },
400}; 402};
401 403
402/* CEU1 */ 404/* CEU1 */
@@ -412,7 +414,7 @@ static struct resource ceu1_resources[] = {
412 .flags = IORESOURCE_MEM, 414 .flags = IORESOURCE_MEM,
413 }, 415 },
414 [1] = { 416 [1] = {
415 .start = evt2irq(0x9e0), 417 .start = 63,
416 .flags = IORESOURCE_IRQ, 418 .flags = IORESOURCE_IRQ,
417 }, 419 },
418 [2] = { 420 [2] = {
@@ -428,6 +430,9 @@ static struct platform_device ceu1_device = {
428 .dev = { 430 .dev = {
429 .platform_data = &sh_mobile_ceu1_info, 431 .platform_data = &sh_mobile_ceu1_info,
430 }, 432 },
433 .archdata = {
434 .hwblk_id = HWBLK_CEU1,
435 },
431}; 436};
432 437
433/* I2C device */ 438/* I2C device */
@@ -443,7 +448,7 @@ static struct i2c_board_info i2c1_devices[] = {
443 }, 448 },
444 { 449 {
445 I2C_BOARD_INFO("lis3lv02d", 0x1c), 450 I2C_BOARD_INFO("lis3lv02d", 0x1c),
446 .irq = evt2irq(0x620), 451 .irq = 33,
447 } 452 }
448}; 453};
449 454
@@ -469,7 +474,7 @@ static struct resource keysc_resources[] = {
469 .flags = IORESOURCE_MEM, 474 .flags = IORESOURCE_MEM,
470 }, 475 },
471 [1] = { 476 [1] = {
472 .start = evt2irq(0xbe0), 477 .start = 79,
473 .flags = IORESOURCE_IRQ, 478 .flags = IORESOURCE_IRQ,
474 }, 479 },
475}; 480};
@@ -482,11 +487,13 @@ static struct platform_device keysc_device = {
482 .dev = { 487 .dev = {
483 .platform_data = &keysc_info, 488 .platform_data = &keysc_info,
484 }, 489 },
490 .archdata = {
491 .hwblk_id = HWBLK_KEYSC,
492 },
485}; 493};
486 494
487/* TouchScreen */ 495/* TouchScreen */
488#define IRQ0 evt2irq(0x600) 496#define IRQ0 32
489
490static int ts_get_pendown_state(void) 497static int ts_get_pendown_state(void)
491{ 498{
492 int val = 0; 499 int val = 0;
@@ -522,101 +529,18 @@ static struct i2c_board_info ts_i2c_clients = {
522 .irq = IRQ0, 529 .irq = IRQ0,
523}; 530};
524 531
525static struct regulator_consumer_supply cn12_power_consumers[] =
526{
527 REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
528 REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
529 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
530 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
531};
532
533static struct regulator_init_data cn12_power_init_data = {
534 .constraints = {
535 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
536 },
537 .num_consumer_supplies = ARRAY_SIZE(cn12_power_consumers),
538 .consumer_supplies = cn12_power_consumers,
539};
540
541static struct fixed_voltage_config cn12_power_info = {
542 .supply_name = "CN12 SD/MMC Vdd",
543 .microvolts = 3300000,
544 .gpio = GPIO_PTB7,
545 .enable_high = 1,
546 .init_data = &cn12_power_init_data,
547};
548
549static struct platform_device cn12_power = {
550 .name = "reg-fixed-voltage",
551 .id = 0,
552 .dev = {
553 .platform_data = &cn12_power_info,
554 },
555};
556
557#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) 532#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
558/* SDHI0 */ 533/* SDHI0 */
559static struct regulator_consumer_supply sdhi0_power_consumers[] =
560{
561 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
562 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
563};
564
565static struct regulator_init_data sdhi0_power_init_data = {
566 .constraints = {
567 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
568 },
569 .num_consumer_supplies = ARRAY_SIZE(sdhi0_power_consumers),
570 .consumer_supplies = sdhi0_power_consumers,
571};
572
573static struct fixed_voltage_config sdhi0_power_info = {
574 .supply_name = "CN11 SD/MMC Vdd",
575 .microvolts = 3300000,
576 .gpio = GPIO_PTB6,
577 .enable_high = 1,
578 .init_data = &sdhi0_power_init_data,
579};
580
581static struct platform_device sdhi0_power = {
582 .name = "reg-fixed-voltage",
583 .id = 1,
584 .dev = {
585 .platform_data = &sdhi0_power_info,
586 },
587};
588
589static void sdhi0_set_pwr(struct platform_device *pdev, int state) 534static void sdhi0_set_pwr(struct platform_device *pdev, int state)
590{ 535{
591 static int power_gpio = -EINVAL;
592
593 if (power_gpio < 0) {
594 int ret = gpio_request(GPIO_PTB6, NULL);
595 if (!ret) {
596 power_gpio = GPIO_PTB6;
597 gpio_direction_output(power_gpio, 0);
598 }
599 }
600
601 /*
602 * Toggle the GPIO regardless, whether we managed to grab it above or
603 * the fixed regulator driver did.
604 */
605 gpio_set_value(GPIO_PTB6, state); 536 gpio_set_value(GPIO_PTB6, state);
606} 537}
607 538
608static int sdhi0_get_cd(struct platform_device *pdev)
609{
610 return !gpio_get_value(GPIO_PTY7);
611}
612
613static struct sh_mobile_sdhi_info sdhi0_info = { 539static struct sh_mobile_sdhi_info sdhi0_info = {
614 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 540 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
615 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 541 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
616 .set_pwr = sdhi0_set_pwr, 542 .set_pwr = sdhi0_set_pwr,
617 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | 543 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD,
618 MMC_CAP_NEEDS_POLL,
619 .get_cd = sdhi0_get_cd,
620}; 544};
621 545
622static struct resource sdhi0_resources[] = { 546static struct resource sdhi0_resources[] = {
@@ -627,7 +551,7 @@ static struct resource sdhi0_resources[] = {
627 .flags = IORESOURCE_MEM, 551 .flags = IORESOURCE_MEM,
628 }, 552 },
629 [1] = { 553 [1] = {
630 .start = evt2irq(0xe80), 554 .start = 100,
631 .flags = IORESOURCE_IRQ, 555 .flags = IORESOURCE_IRQ,
632 }, 556 },
633}; 557};
@@ -640,41 +564,23 @@ static struct platform_device sdhi0_device = {
640 .dev = { 564 .dev = {
641 .platform_data = &sdhi0_info, 565 .platform_data = &sdhi0_info,
642 }, 566 },
567 .archdata = {
568 .hwblk_id = HWBLK_SDHI0,
569 },
643}; 570};
644 571
645static void cn12_set_pwr(struct platform_device *pdev, int state)
646{
647 static int power_gpio = -EINVAL;
648
649 if (power_gpio < 0) {
650 int ret = gpio_request(GPIO_PTB7, NULL);
651 if (!ret) {
652 power_gpio = GPIO_PTB7;
653 gpio_direction_output(power_gpio, 0);
654 }
655 }
656
657 /*
658 * Toggle the GPIO regardless, whether we managed to grab it above or
659 * the fixed regulator driver did.
660 */
661 gpio_set_value(GPIO_PTB7, state);
662}
663
664#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 572#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
665/* SDHI1 */ 573/* SDHI1 */
666static int sdhi1_get_cd(struct platform_device *pdev) 574static void sdhi1_set_pwr(struct platform_device *pdev, int state)
667{ 575{
668 return !gpio_get_value(GPIO_PTW7); 576 gpio_set_value(GPIO_PTB7, state);
669} 577}
670 578
671static struct sh_mobile_sdhi_info sdhi1_info = { 579static struct sh_mobile_sdhi_info sdhi1_info = {
672 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX, 580 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
673 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, 581 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
674 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | 582 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD,
675 MMC_CAP_NEEDS_POLL, 583 .set_pwr = sdhi1_set_pwr,
676 .set_pwr = cn12_set_pwr,
677 .get_cd = sdhi1_get_cd,
678}; 584};
679 585
680static struct resource sdhi1_resources[] = { 586static struct resource sdhi1_resources[] = {
@@ -685,7 +591,7 @@ static struct resource sdhi1_resources[] = {
685 .flags = IORESOURCE_MEM, 591 .flags = IORESOURCE_MEM,
686 }, 592 },
687 [1] = { 593 [1] = {
688 .start = evt2irq(0x4e0), 594 .start = 23,
689 .flags = IORESOURCE_IRQ, 595 .flags = IORESOURCE_IRQ,
690 }, 596 },
691}; 597};
@@ -698,6 +604,9 @@ static struct platform_device sdhi1_device = {
698 .dev = { 604 .dev = {
699 .platform_data = &sdhi1_info, 605 .platform_data = &sdhi1_info,
700 }, 606 },
607 .archdata = {
608 .hwblk_id = HWBLK_SDHI1,
609 },
701}; 610};
702#endif /* CONFIG_MMC_SH_MMCIF */ 611#endif /* CONFIG_MMC_SH_MMCIF */
703 612
@@ -750,7 +659,7 @@ static struct resource msiof0_resources[] = {
750 .flags = IORESOURCE_MEM, 659 .flags = IORESOURCE_MEM,
751 }, 660 },
752 [1] = { 661 [1] = {
753 .start = evt2irq(0xc80), 662 .start = 84,
754 .flags = IORESOURCE_IRQ, 663 .flags = IORESOURCE_IRQ,
755 }, 664 },
756}; 665};
@@ -763,6 +672,9 @@ static struct platform_device msiof0_device = {
763 }, 672 },
764 .num_resources = ARRAY_SIZE(msiof0_resources), 673 .num_resources = ARRAY_SIZE(msiof0_resources),
765 .resource = msiof0_resources, 674 .resource = msiof0_resources,
675 .archdata = {
676 .hwblk_id = HWBLK_MSIOF0,
677 },
766}; 678};
767 679
768#endif 680#endif
@@ -878,9 +790,7 @@ static struct platform_device camera_devices[] = {
878 790
879/* FSI */ 791/* FSI */
880static struct sh_fsi_platform_info fsi_info = { 792static struct sh_fsi_platform_info fsi_info = {
881 .port_b = { 793 .portb_flags = SH_FSI_BRS_INV,
882 .flags = SH_FSI_BRS_INV,
883 },
884}; 794};
885 795
886static struct resource fsi_resources[] = { 796static struct resource fsi_resources[] = {
@@ -891,7 +801,7 @@ static struct resource fsi_resources[] = {
891 .flags = IORESOURCE_MEM, 801 .flags = IORESOURCE_MEM,
892 }, 802 },
893 [1] = { 803 [1] = {
894 .start = evt2irq(0xf80), 804 .start = 108,
895 .flags = IORESOURCE_IRQ, 805 .flags = IORESOURCE_IRQ,
896 }, 806 },
897}; 807};
@@ -904,32 +814,11 @@ static struct platform_device fsi_device = {
904 .dev = { 814 .dev = {
905 .platform_data = &fsi_info, 815 .platform_data = &fsi_info,
906 }, 816 },
907}; 817 .archdata = {
908 818 .hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */
909static struct asoc_simple_dai_init_info fsi_da7210_init_info = {
910 .fmt = SND_SOC_DAIFMT_I2S,
911 .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
912 .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
913};
914
915static struct asoc_simple_card_info fsi_da7210_info = {
916 .name = "DA7210",
917 .card = "FSIB-DA7210",
918 .cpu_dai = "fsib-dai",
919 .codec = "da7210.0-001a",
920 .platform = "sh_fsi.0",
921 .codec_dai = "da7210-hifi",
922 .init = &fsi_da7210_init_info,
923};
924
925static struct platform_device fsi_da7210_device = {
926 .name = "asoc-simple-card",
927 .dev = {
928 .platform_data = &fsi_da7210_info,
929 }, 819 },
930}; 820};
931 821
932
933/* IrDA */ 822/* IrDA */
934static struct resource irda_resources[] = { 823static struct resource irda_resources[] = {
935 [0] = { 824 [0] = {
@@ -939,7 +828,7 @@ static struct resource irda_resources[] = {
939 .flags = IORESOURCE_MEM, 828 .flags = IORESOURCE_MEM,
940 }, 829 },
941 [1] = { 830 [1] = {
942 .start = evt2irq(0x480), 831 .start = 20,
943 .flags = IORESOURCE_IRQ, 832 .flags = IORESOURCE_IRQ,
944 }, 833 },
945}; 834};
@@ -976,7 +865,7 @@ static struct resource sh_vou_resources[] = {
976 .flags = IORESOURCE_MEM, 865 .flags = IORESOURCE_MEM,
977 }, 866 },
978 [1] = { 867 [1] = {
979 .start = evt2irq(0x8e0), 868 .start = 55,
980 .flags = IORESOURCE_IRQ, 869 .flags = IORESOURCE_IRQ,
981 }, 870 },
982}; 871};
@@ -989,13 +878,21 @@ static struct platform_device vou_device = {
989 .dev = { 878 .dev = {
990 .platform_data = &sh_vou_pdata, 879 .platform_data = &sh_vou_pdata,
991 }, 880 },
881 .archdata = {
882 .hwblk_id = HWBLK_VOU,
883 },
992}; 884};
993 885
994#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) 886#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
995/* SH_MMCIF */ 887/* SH_MMCIF */
888static void mmcif_set_pwr(struct platform_device *pdev, int state)
889{
890 gpio_set_value(GPIO_PTB7, state);
891}
892
996static void mmcif_down_pwr(struct platform_device *pdev) 893static void mmcif_down_pwr(struct platform_device *pdev)
997{ 894{
998 cn12_set_pwr(pdev, 0); 895 gpio_set_value(GPIO_PTB7, 0);
999} 896}
1000 897
1001static struct resource sh_mmcif_resources[] = { 898static struct resource sh_mmcif_resources[] = {
@@ -1007,18 +904,18 @@ static struct resource sh_mmcif_resources[] = {
1007 }, 904 },
1008 [1] = { 905 [1] = {
1009 /* MMC2I */ 906 /* MMC2I */
1010 .start = evt2irq(0x5a0), 907 .start = 29,
1011 .flags = IORESOURCE_IRQ, 908 .flags = IORESOURCE_IRQ,
1012 }, 909 },
1013 [2] = { 910 [2] = {
1014 /* MMC3I */ 911 /* MMC3I */
1015 .start = evt2irq(0x5c0), 912 .start = 30,
1016 .flags = IORESOURCE_IRQ, 913 .flags = IORESOURCE_IRQ,
1017 }, 914 },
1018}; 915};
1019 916
1020static struct sh_mmcif_plat_data sh_mmcif_plat = { 917static struct sh_mmcif_plat_data sh_mmcif_plat = {
1021 .set_pwr = cn12_set_pwr, 918 .set_pwr = mmcif_set_pwr,
1022 .down_pwr = mmcif_down_pwr, 919 .down_pwr = mmcif_down_pwr,
1023 .sup_pclk = 0, /* SH7724: Max Pclk/2 */ 920 .sup_pclk = 0, /* SH7724: Max Pclk/2 */
1024 .caps = MMC_CAP_4_BIT_DATA | 921 .caps = MMC_CAP_4_BIT_DATA |
@@ -1035,6 +932,9 @@ static struct platform_device sh_mmcif_device = {
1035 }, 932 },
1036 .num_resources = ARRAY_SIZE(sh_mmcif_resources), 933 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
1037 .resource = sh_mmcif_resources, 934 .resource = sh_mmcif_resources,
935 .archdata = {
936 .hwblk_id = HWBLK_MMC,
937 },
1038}; 938};
1039#endif 939#endif
1040 940
@@ -1049,9 +949,7 @@ static struct platform_device *ecovec_devices[] __initdata = {
1049 &ceu0_device, 949 &ceu0_device,
1050 &ceu1_device, 950 &ceu1_device,
1051 &keysc_device, 951 &keysc_device,
1052 &cn12_power,
1053#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) 952#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
1054 &sdhi0_power,
1055 &sdhi0_device, 953 &sdhi0_device,
1056#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 954#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1057 &sdhi1_device, 955 &sdhi1_device,
@@ -1063,7 +961,6 @@ static struct platform_device *ecovec_devices[] __initdata = {
1063 &camera_devices[1], 961 &camera_devices[1],
1064 &camera_devices[2], 962 &camera_devices[2],
1065 &fsi_device, 963 &fsi_device,
1066 &fsi_da7210_device,
1067 &irda_device, 964 &irda_device,
1068 &vou_device, 965 &vou_device,
1069#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) 966#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
@@ -1134,7 +1031,6 @@ extern char ecovec24_sdram_leave_end;
1134static int __init arch_setup(void) 1031static int __init arch_setup(void)
1135{ 1032{
1136 struct clk *clk; 1033 struct clk *clk;
1137 bool cn12_enabled = false;
1138 1034
1139 /* register board specific self-refresh code */ 1035 /* register board specific self-refresh code */
1140 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF | 1036 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
@@ -1250,8 +1146,8 @@ static int __init arch_setup(void)
1250 /* DVI */ 1146 /* DVI */
1251 lcdc_info.clock_source = LCDC_CLK_EXTERNAL; 1147 lcdc_info.clock_source = LCDC_CLK_EXTERNAL;
1252 lcdc_info.ch[0].clock_divider = 1; 1148 lcdc_info.ch[0].clock_divider = 1;
1253 lcdc_info.ch[0].lcd_modes = ecovec_dvi_modes; 1149 lcdc_info.ch[0].lcd_cfg = ecovec_dvi_modes;
1254 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_dvi_modes); 1150 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(ecovec_dvi_modes);
1255 1151
1256 gpio_set_value(GPIO_PTA2, 1); 1152 gpio_set_value(GPIO_PTA2, 1);
1257 gpio_set_value(GPIO_PTU1, 1); 1153 gpio_set_value(GPIO_PTU1, 1);
@@ -1259,8 +1155,8 @@ static int __init arch_setup(void)
1259 /* Panel */ 1155 /* Panel */
1260 lcdc_info.clock_source = LCDC_CLK_PERIPHERAL; 1156 lcdc_info.clock_source = LCDC_CLK_PERIPHERAL;
1261 lcdc_info.ch[0].clock_divider = 2; 1157 lcdc_info.ch[0].clock_divider = 2;
1262 lcdc_info.ch[0].lcd_modes = ecovec_lcd_modes; 1158 lcdc_info.ch[0].lcd_cfg = ecovec_lcd_modes;
1263 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_lcd_modes); 1159 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(ecovec_lcd_modes);
1264 1160
1265 gpio_set_value(GPIO_PTR1, 1); 1161 gpio_set_value(GPIO_PTR1, 1);
1266 1162
@@ -1335,13 +1231,9 @@ static int __init arch_setup(void)
1335 gpio_direction_input(GPIO_PTR5); 1231 gpio_direction_input(GPIO_PTR5);
1336 gpio_direction_input(GPIO_PTR6); 1232 gpio_direction_input(GPIO_PTR6);
1337 1233
1338 /* SD-card slot CN11 */
1339 /* Card-detect, used on CN11, either with SDHI0 or with SPI */
1340 gpio_request(GPIO_PTY7, NULL);
1341 gpio_direction_input(GPIO_PTY7);
1342
1343#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) 1234#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
1344 /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */ 1235 /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */
1236 gpio_request(GPIO_FN_SDHI0CD, NULL);
1345 gpio_request(GPIO_FN_SDHI0WP, NULL); 1237 gpio_request(GPIO_FN_SDHI0WP, NULL);
1346 gpio_request(GPIO_FN_SDHI0CMD, NULL); 1238 gpio_request(GPIO_FN_SDHI0CMD, NULL);
1347 gpio_request(GPIO_FN_SDHI0CLK, NULL); 1239 gpio_request(GPIO_FN_SDHI0CLK, NULL);
@@ -1349,6 +1241,25 @@ static int __init arch_setup(void)
1349 gpio_request(GPIO_FN_SDHI0D2, NULL); 1241 gpio_request(GPIO_FN_SDHI0D2, NULL);
1350 gpio_request(GPIO_FN_SDHI0D1, NULL); 1242 gpio_request(GPIO_FN_SDHI0D1, NULL);
1351 gpio_request(GPIO_FN_SDHI0D0, NULL); 1243 gpio_request(GPIO_FN_SDHI0D0, NULL);
1244 gpio_request(GPIO_PTB6, NULL);
1245 gpio_direction_output(GPIO_PTB6, 0);
1246
1247#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1248 /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */
1249 gpio_request(GPIO_FN_SDHI1CD, NULL);
1250 gpio_request(GPIO_FN_SDHI1WP, NULL);
1251 gpio_request(GPIO_FN_SDHI1CMD, NULL);
1252 gpio_request(GPIO_FN_SDHI1CLK, NULL);
1253 gpio_request(GPIO_FN_SDHI1D3, NULL);
1254 gpio_request(GPIO_FN_SDHI1D2, NULL);
1255 gpio_request(GPIO_FN_SDHI1D1, NULL);
1256 gpio_request(GPIO_FN_SDHI1D0, NULL);
1257 gpio_request(GPIO_PTB7, NULL);
1258 gpio_direction_output(GPIO_PTB7, 0);
1259
1260 /* I/O buffer drive ability is high for SDHI1 */
1261 __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA);
1262#endif /* CONFIG_MMC_SH_MMCIF */
1352#else 1263#else
1353 /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ 1264 /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */
1354 gpio_request(GPIO_FN_MSIOF0_TXD, NULL); 1265 gpio_request(GPIO_FN_MSIOF0_TXD, NULL);
@@ -1360,47 +1271,12 @@ static int __init arch_setup(void)
1360 gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */ 1271 gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */
1361 gpio_request(GPIO_PTY6, NULL); /* write protect */ 1272 gpio_request(GPIO_PTY6, NULL); /* write protect */
1362 gpio_direction_input(GPIO_PTY6); 1273 gpio_direction_input(GPIO_PTY6);
1274 gpio_request(GPIO_PTY7, NULL); /* card detect */
1275 gpio_direction_input(GPIO_PTY7);
1363 1276
1364 spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); 1277 spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
1365#endif 1278#endif
1366 1279
1367 /* MMC/SD-card slot CN12 */
1368#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
1369 /* enable MMCIF (needs DS2.6,7 set to OFF,ON) */
1370 gpio_request(GPIO_FN_MMC_D7, NULL);
1371 gpio_request(GPIO_FN_MMC_D6, NULL);
1372 gpio_request(GPIO_FN_MMC_D5, NULL);
1373 gpio_request(GPIO_FN_MMC_D4, NULL);
1374 gpio_request(GPIO_FN_MMC_D3, NULL);
1375 gpio_request(GPIO_FN_MMC_D2, NULL);
1376 gpio_request(GPIO_FN_MMC_D1, NULL);
1377 gpio_request(GPIO_FN_MMC_D0, NULL);
1378 gpio_request(GPIO_FN_MMC_CLK, NULL);
1379 gpio_request(GPIO_FN_MMC_CMD, NULL);
1380
1381 cn12_enabled = true;
1382#elif defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
1383 /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */
1384 gpio_request(GPIO_FN_SDHI1WP, NULL);
1385 gpio_request(GPIO_FN_SDHI1CMD, NULL);
1386 gpio_request(GPIO_FN_SDHI1CLK, NULL);
1387 gpio_request(GPIO_FN_SDHI1D3, NULL);
1388 gpio_request(GPIO_FN_SDHI1D2, NULL);
1389 gpio_request(GPIO_FN_SDHI1D1, NULL);
1390 gpio_request(GPIO_FN_SDHI1D0, NULL);
1391
1392 /* Card-detect, used on CN12 with SDHI1 */
1393 gpio_request(GPIO_PTW7, NULL);
1394 gpio_direction_input(GPIO_PTW7);
1395
1396 cn12_enabled = true;
1397#endif
1398
1399 if (cn12_enabled)
1400 /* I/O buffer drive ability is high for CN12 */
1401 __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000,
1402 IODRIVEA);
1403
1404 /* enable Video */ 1280 /* enable Video */
1405 gpio_request(GPIO_PTU2, NULL); 1281 gpio_request(GPIO_PTU2, NULL);
1406 gpio_direction_output(GPIO_PTU2, 1); 1282 gpio_direction_output(GPIO_PTU2, 1);
@@ -1459,6 +1335,25 @@ static int __init arch_setup(void)
1459 gpio_request(GPIO_PTU5, NULL); 1335 gpio_request(GPIO_PTU5, NULL);
1460 gpio_direction_output(GPIO_PTU5, 0); 1336 gpio_direction_output(GPIO_PTU5, 0);
1461 1337
1338#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
1339 /* enable MMCIF (needs DS2.6,7 set to OFF,ON) */
1340 gpio_request(GPIO_FN_MMC_D7, NULL);
1341 gpio_request(GPIO_FN_MMC_D6, NULL);
1342 gpio_request(GPIO_FN_MMC_D5, NULL);
1343 gpio_request(GPIO_FN_MMC_D4, NULL);
1344 gpio_request(GPIO_FN_MMC_D3, NULL);
1345 gpio_request(GPIO_FN_MMC_D2, NULL);
1346 gpio_request(GPIO_FN_MMC_D1, NULL);
1347 gpio_request(GPIO_FN_MMC_D0, NULL);
1348 gpio_request(GPIO_FN_MMC_CLK, NULL);
1349 gpio_request(GPIO_FN_MMC_CMD, NULL);
1350 gpio_request(GPIO_PTB7, NULL);
1351 gpio_direction_output(GPIO_PTB7, 0);
1352
1353 /* I/O buffer drive ability is high for MMCIF */
1354 __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA);
1355#endif
1356
1462 /* enable I2C device */ 1357 /* enable I2C device */
1463 i2c_register_board_info(0, i2c0_devices, 1358 i2c_register_board_info(0, i2c0_devices,
1464 ARRAY_SIZE(i2c0_devices)); 1359 ARRAY_SIZE(i2c0_devices));
diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
index 4a52590fe3d..74b8db1b74a 100644
--- a/arch/sh/boards/mach-highlander/setup.c
+++ b/arch/sh/boards/mach-highlander/setup.c
@@ -322,7 +322,7 @@ static void ivdr_clk_disable(struct clk *clk)
322 __raw_writew(__raw_readw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL); 322 __raw_writew(__raw_readw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL);
323} 323}
324 324
325static struct sh_clk_ops ivdr_clk_ops = { 325static struct clk_ops ivdr_clk_ops = {
326 .enable = ivdr_clk_enable, 326 .enable = ivdr_clk_enable,
327 .disable = ivdr_clk_disable, 327 .disable = ivdr_clk_disable,
328}; 328};
diff --git a/arch/sh/boards/mach-hp6xx/hp6xx_apm.c b/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
index 865d8d6e823..b49535c0ddd 100644
--- a/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
+++ b/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
@@ -86,7 +86,7 @@ static int __init hp6x0_apm_init(void)
86 int ret; 86 int ret;
87 87
88 ret = request_irq(HP680_BTN_IRQ, hp6x0_apm_interrupt, 88 ret = request_irq(HP680_BTN_IRQ, hp6x0_apm_interrupt,
89 0, MODNAME, NULL); 89 IRQF_DISABLED, MODNAME, NULL);
90 if (unlikely(ret < 0)) { 90 if (unlikely(ret < 0)) {
91 printk(KERN_ERR MODNAME ": IRQ %d request failed\n", 91 printk(KERN_ERR MODNAME ": IRQ %d request failed\n",
92 HP680_BTN_IRQ); 92 HP680_BTN_IRQ);
diff --git a/arch/sh/boards/mach-hp6xx/pm.c b/arch/sh/boards/mach-hp6xx/pm.c
index 8b50cf763c0..adc9b4bba82 100644
--- a/arch/sh/boards/mach-hp6xx/pm.c
+++ b/arch/sh/boards/mach-hp6xx/pm.c
@@ -14,7 +14,6 @@
14#include <linux/gfp.h> 14#include <linux/gfp.h>
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/hd64461.h> 16#include <asm/hd64461.h>
17#include <asm/bl_bit.h>
18#include <mach/hp6xx.h> 17#include <mach/hp6xx.h>
19#include <cpu/dac.h> 18#include <cpu/dac.h>
20#include <asm/freq.h> 19#include <asm/freq.h>
diff --git a/arch/sh/boards/mach-hp6xx/setup.c b/arch/sh/boards/mach-hp6xx/setup.c
index 05797b33f68..8c9add5f4cf 100644
--- a/arch/sh/boards/mach-hp6xx/setup.c
+++ b/arch/sh/boards/mach-hp6xx/setup.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/irq.h> 15#include <linux/irq.h>
16#include <linux/sh_intc.h>
17#include <sound/sh_dac_audio.h> 16#include <sound/sh_dac_audio.h>
18#include <asm/hd64461.h> 17#include <asm/hd64461.h>
19#include <asm/io.h> 18#include <asm/io.h>
@@ -36,7 +35,7 @@ static struct resource cf_ide_resources[] = {
36 .flags = IORESOURCE_MEM, 35 .flags = IORESOURCE_MEM,
37 }, 36 },
38 [2] = { 37 [2] = {
39 .start = evt2irq(0xba0), 38 .start = 77,
40 .flags = IORESOURCE_IRQ, 39 .flags = IORESOURCE_IRQ,
41 }, 40 },
42}; 41};
@@ -169,6 +168,8 @@ device_initcall(hp6xx_devices_setup);
169static struct sh_machine_vector mv_hp6xx __initmv = { 168static struct sh_machine_vector mv_hp6xx __initmv = {
170 .mv_name = "hp6xx", 169 .mv_name = "hp6xx",
171 .mv_setup = hp6xx_setup, 170 .mv_setup = hp6xx_setup,
171 /* IRQ's : CPU(64) + CCHIP(16) + FREE_TO_USE(6) */
172 .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM + 6,
172 /* Enable IRQ0 -> IRQ3 in IRQ_MODE */ 173 /* Enable IRQ0 -> IRQ3 in IRQ_MODE */
173 .mv_init_irq = hp6xx_init_irq, 174 .mv_init_irq = hp6xx_init_irq,
174}; 175};
diff --git a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
index c6205033262..25e145fb708 100644
--- a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
+++ b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
@@ -251,7 +251,8 @@ static void display_on(void *sohandle,
251 write_memory_start(sohandle, so); 251 write_memory_start(sohandle, so);
252} 252}
253 253
254int kfr2r09_lcd_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so) 254int kfr2r09_lcd_setup(void *board_data, void *sohandle,
255 struct sh_mobile_lcdc_sys_bus_ops *so)
255{ 256{
256 /* power on */ 257 /* power on */
257 gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */ 258 gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */
@@ -272,7 +273,8 @@ int kfr2r09_lcd_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
272 return 0; 273 return 0;
273} 274}
274 275
275void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so) 276void kfr2r09_lcd_start(void *board_data, void *sohandle,
277 struct sh_mobile_lcdc_sys_bus_ops *so)
276{ 278{
277 write_memory_start(sohandle, so); 279 write_memory_start(sohandle, so);
278} 280}
@@ -283,7 +285,7 @@ void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
283#define MAIN_MLED4 0x40 285#define MAIN_MLED4 0x40
284#define MAIN_MSW 0x80 286#define MAIN_MSW 0x80
285 287
286int kfr2r09_lcd_set_brightness(int brightness) 288static int kfr2r09_lcd_backlight(int on)
287{ 289{
288 struct i2c_adapter *a; 290 struct i2c_adapter *a;
289 struct i2c_msg msg; 291 struct i2c_msg msg;
@@ -295,7 +297,7 @@ int kfr2r09_lcd_set_brightness(int brightness)
295 return -ENODEV; 297 return -ENODEV;
296 298
297 buf[0] = 0x00; 299 buf[0] = 0x00;
298 if (brightness) 300 if (on)
299 buf[1] = CTRL_CPSW | CTRL_C10 | CTRL_CKSW; 301 buf[1] = CTRL_CPSW | CTRL_C10 | CTRL_CKSW;
300 else 302 else
301 buf[1] = 0; 303 buf[1] = 0;
@@ -309,7 +311,7 @@ int kfr2r09_lcd_set_brightness(int brightness)
309 return -ENODEV; 311 return -ENODEV;
310 312
311 buf[0] = 0x01; 313 buf[0] = 0x01;
312 if (brightness) 314 if (on)
313 buf[1] = MAIN_MSW | MAIN_MLED4 | 0x0c; 315 buf[1] = MAIN_MSW | MAIN_MLED4 | 0x0c;
314 else 316 else
315 buf[1] = 0; 317 buf[1] = 0;
@@ -324,3 +326,13 @@ int kfr2r09_lcd_set_brightness(int brightness)
324 326
325 return 0; 327 return 0;
326} 328}
329
330void kfr2r09_lcd_on(void *board_data, struct fb_info *info)
331{
332 kfr2r09_lcd_backlight(1);
333}
334
335void kfr2r09_lcd_off(void *board_data)
336{
337 kfr2r09_lcd_backlight(0);
338}
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index ab502f12ef5..f65271a8d07 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -21,11 +21,7 @@
21#include <linux/input.h> 21#include <linux/input.h>
22#include <linux/input/sh_keysc.h> 22#include <linux/input/sh_keysc.h>
23#include <linux/i2c.h> 23#include <linux/i2c.h>
24#include <linux/regulator/fixed.h>
25#include <linux/regulator/machine.h>
26#include <linux/usb/r8a66597.h> 24#include <linux/usb/r8a66597.h>
27#include <linux/videodev2.h>
28#include <linux/sh_intc.h>
29#include <media/rj54n1cb0c.h> 25#include <media/rj54n1cb0c.h>
30#include <media/soc_camera.h> 26#include <media/soc_camera.h>
31#include <media/sh_mobile_ceu.h> 27#include <media/sh_mobile_ceu.h>
@@ -113,7 +109,7 @@ static struct resource kfr2r09_sh_keysc_resources[] = {
113 .flags = IORESOURCE_MEM, 109 .flags = IORESOURCE_MEM,
114 }, 110 },
115 [1] = { 111 [1] = {
116 .start = evt2irq(0xbe0), 112 .start = 79,
117 .flags = IORESOURCE_IRQ, 113 .flags = IORESOURCE_IRQ,
118 }, 114 },
119}; 115};
@@ -126,6 +122,9 @@ static struct platform_device kfr2r09_sh_keysc_device = {
126 .dev = { 122 .dev = {
127 .platform_data = &kfr2r09_sh_keysc_info, 123 .platform_data = &kfr2r09_sh_keysc_info,
128 }, 124 },
125 .archdata = {
126 .hwblk_id = HWBLK_KEYSC,
127 },
129}; 128};
130 129
131static const struct fb_videomode kfr2r09_lcdc_modes[] = { 130static const struct fb_videomode kfr2r09_lcdc_modes[] = {
@@ -147,22 +146,21 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = {
147 .clock_source = LCDC_CLK_BUS, 146 .clock_source = LCDC_CLK_BUS,
148 .ch[0] = { 147 .ch[0] = {
149 .chan = LCDC_CHAN_MAINLCD, 148 .chan = LCDC_CHAN_MAINLCD,
150 .fourcc = V4L2_PIX_FMT_RGB565, 149 .bpp = 16,
151 .interface_type = SYS18, 150 .interface_type = SYS18,
152 .clock_divider = 6, 151 .clock_divider = 6,
153 .flags = LCDC_FLAGS_DWPOL, 152 .flags = LCDC_FLAGS_DWPOL,
154 .lcd_modes = kfr2r09_lcdc_modes, 153 .lcd_cfg = kfr2r09_lcdc_modes,
155 .num_modes = ARRAY_SIZE(kfr2r09_lcdc_modes), 154 .num_cfg = ARRAY_SIZE(kfr2r09_lcdc_modes),
156 .panel_cfg = { 155 .lcd_size_cfg = {
157 .width = 35, 156 .width = 35,
158 .height = 58, 157 .height = 58,
158 },
159 .board_cfg = {
159 .setup_sys = kfr2r09_lcd_setup, 160 .setup_sys = kfr2r09_lcd_setup,
160 .start_transfer = kfr2r09_lcd_start, 161 .start_transfer = kfr2r09_lcd_start,
161 }, 162 .display_on = kfr2r09_lcd_on,
162 .bl_info = { 163 .display_off = kfr2r09_lcd_off,
163 .name = "sh_mobile_lcdc_bl",
164 .max_brightness = 1,
165 .set_brightness = kfr2r09_lcd_set_brightness,
166 }, 164 },
167 .sys_bus_cfg = { 165 .sys_bus_cfg = {
168 .ldmt2r = 0x07010904, 166 .ldmt2r = 0x07010904,
@@ -181,7 +179,7 @@ static struct resource kfr2r09_sh_lcdc_resources[] = {
181 .flags = IORESOURCE_MEM, 179 .flags = IORESOURCE_MEM,
182 }, 180 },
183 [1] = { 181 [1] = {
184 .start = evt2irq(0xf40), 182 .start = 106,
185 .flags = IORESOURCE_IRQ, 183 .flags = IORESOURCE_IRQ,
186 }, 184 },
187}; 185};
@@ -193,6 +191,9 @@ static struct platform_device kfr2r09_sh_lcdc_device = {
193 .dev = { 191 .dev = {
194 .platform_data = &kfr2r09_sh_lcdc_info, 192 .platform_data = &kfr2r09_sh_lcdc_info,
195 }, 193 },
194 .archdata = {
195 .hwblk_id = HWBLK_LCDC,
196 },
196}; 197};
197 198
198static struct r8a66597_platdata kfr2r09_usb0_gadget_data = { 199static struct r8a66597_platdata kfr2r09_usb0_gadget_data = {
@@ -206,8 +207,8 @@ static struct resource kfr2r09_usb0_gadget_resources[] = {
206 .flags = IORESOURCE_MEM, 207 .flags = IORESOURCE_MEM,
207 }, 208 },
208 [1] = { 209 [1] = {
209 .start = evt2irq(0xa20), 210 .start = 65,
210 .end = evt2irq(0xa20), 211 .end = 65,
211 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 212 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
212 }, 213 },
213}; 214};
@@ -236,8 +237,8 @@ static struct resource kfr2r09_ceu_resources[] = {
236 .flags = IORESOURCE_MEM, 237 .flags = IORESOURCE_MEM,
237 }, 238 },
238 [1] = { 239 [1] = {
239 .start = evt2irq(0x880), 240 .start = 52,
240 .end = evt2irq(0x880), 241 .end = 52,
241 .flags = IORESOURCE_IRQ, 242 .flags = IORESOURCE_IRQ,
242 }, 243 },
243 [2] = { 244 [2] = {
@@ -253,6 +254,9 @@ static struct platform_device kfr2r09_ceu_device = {
253 .dev = { 254 .dev = {
254 .platform_data = &sh_mobile_ceu_info, 255 .platform_data = &sh_mobile_ceu_info,
255 }, 256 },
257 .archdata = {
258 .hwblk_id = HWBLK_CEU0,
259 },
256}; 260};
257 261
258static struct i2c_board_info kfr2r09_i2c_camera = { 262static struct i2c_board_info kfr2r09_i2c_camera = {
@@ -346,13 +350,6 @@ static struct platform_device kfr2r09_camera = {
346 }, 350 },
347}; 351};
348 352
349/* Fixed 3.3V regulator to be used by SDHI0 */
350static struct regulator_consumer_supply fixed3v3_power_consumers[] =
351{
352 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
353 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
354};
355
356static struct resource kfr2r09_sh_sdhi0_resources[] = { 353static struct resource kfr2r09_sh_sdhi0_resources[] = {
357 [0] = { 354 [0] = {
358 .name = "SDHI0", 355 .name = "SDHI0",
@@ -361,7 +358,7 @@ static struct resource kfr2r09_sh_sdhi0_resources[] = {
361 .flags = IORESOURCE_MEM, 358 .flags = IORESOURCE_MEM,
362 }, 359 },
363 [1] = { 360 [1] = {
364 .start = evt2irq(0xe80), 361 .start = 100,
365 .flags = IORESOURCE_IRQ, 362 .flags = IORESOURCE_IRQ,
366 }, 363 },
367}; 364};
@@ -380,6 +377,9 @@ static struct platform_device kfr2r09_sh_sdhi0_device = {
380 .dev = { 377 .dev = {
381 .platform_data = &sh7724_sdhi0_data, 378 .platform_data = &sh7724_sdhi0_data,
382 }, 379 },
380 .archdata = {
381 .hwblk_id = HWBLK_SDHI0,
382 },
383}; 383};
384 384
385static struct platform_device *kfr2r09_devices[] __initdata = { 385static struct platform_device *kfr2r09_devices[] __initdata = {
@@ -535,9 +535,6 @@ static int __init kfr2r09_devices_setup(void)
535 &kfr2r09_sdram_leave_start, 535 &kfr2r09_sdram_leave_start,
536 &kfr2r09_sdram_leave_end); 536 &kfr2r09_sdram_leave_end);
537 537
538 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
539 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
540
541 /* enable SCIF1 serial port for YC401 console support */ 538 /* enable SCIF1 serial port for YC401 console support */
542 gpio_request(GPIO_FN_SCIF1_RXD, NULL); 539 gpio_request(GPIO_FN_SCIF1_RXD, NULL);
543 gpio_request(GPIO_FN_SCIF1_TXD, NULL); 540 gpio_request(GPIO_FN_SCIF1_TXD, NULL);
diff --git a/arch/sh/boards/mach-lboxre2/setup.c b/arch/sh/boards/mach-lboxre2/setup.c
index 6660622aa45..79b4e0d77b7 100644
--- a/arch/sh/boards/mach-lboxre2/setup.c
+++ b/arch/sh/boards/mach-lboxre2/setup.c
@@ -79,5 +79,6 @@ device_initcall(lboxre2_devices_setup);
79 */ 79 */
80static struct sh_machine_vector mv_lboxre2 __initmv = { 80static struct sh_machine_vector mv_lboxre2 __initmv = {
81 .mv_name = "L-BOX RE2", 81 .mv_name = "L-BOX RE2",
82 .mv_nr_irqs = 72,
82 .mv_init_irq = init_lboxre2_IRQ, 83 .mv_init_irq = init_lboxre2_IRQ,
83}; 84};
diff --git a/arch/sh/boards/mach-microdev/irq.c b/arch/sh/boards/mach-microdev/irq.c
index 9a8aff33961..4fb00369f0e 100644
--- a/arch/sh/boards/mach-microdev/irq.c
+++ b/arch/sh/boards/mach-microdev/irq.c
@@ -12,6 +12,7 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/irq.h> 13#include <linux/irq.h>
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <asm/system.h>
15#include <asm/io.h> 16#include <asm/io.h>
16#include <mach/microdev.h> 17#include <mach/microdev.h>
17 18
diff --git a/arch/sh/boards/mach-microdev/setup.c b/arch/sh/boards/mach-microdev/setup.c
index 6c66ee4d842..d8a747291e0 100644
--- a/arch/sh/boards/mach-microdev/setup.c
+++ b/arch/sh/boards/mach-microdev/setup.c
@@ -194,6 +194,7 @@ device_initcall(microdev_devices_setup);
194 */ 194 */
195static struct sh_machine_vector mv_sh4202_microdev __initmv = { 195static struct sh_machine_vector mv_sh4202_microdev __initmv = {
196 .mv_name = "SH4-202 MicroDev", 196 .mv_name = "SH4-202 MicroDev",
197 .mv_nr_irqs = 72,
197 .mv_ioport_map = microdev_ioport_map, 198 .mv_ioport_map = microdev_ioport_map,
198 .mv_init_irq = init_microdev_irq, 199 .mv_init_irq = init_microdev_irq,
199}; 200};
diff --git a/arch/sh/boards/mach-migor/lcd_qvga.c b/arch/sh/boards/mach-migor/lcd_qvga.c
index 8bccd345b69..de9014a8a93 100644
--- a/arch/sh/boards/mach-migor/lcd_qvga.c
+++ b/arch/sh/boards/mach-migor/lcd_qvga.c
@@ -113,7 +113,8 @@ static const unsigned short magic3_data[] = {
113 0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061, 113 0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061,
114}; 114};
115 115
116int migor_lcd_qvga_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so) 116int migor_lcd_qvga_setup(void *board_data, void *sohandle,
117 struct sh_mobile_lcdc_sys_bus_ops *so)
117{ 118{
118 unsigned long xres = 320; 119 unsigned long xres = 320;
119 unsigned long yres = 240; 120 unsigned long yres = 240;
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 8b73194ed2c..2d4c9c8c666 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -17,18 +17,13 @@
17#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
18#include <linux/mtd/nand.h> 18#include <linux/mtd/nand.h>
19#include <linux/i2c.h> 19#include <linux/i2c.h>
20#include <linux/regulator/fixed.h>
21#include <linux/regulator/machine.h>
22#include <linux/smc91x.h> 20#include <linux/smc91x.h>
23#include <linux/delay.h> 21#include <linux/delay.h>
24#include <linux/clk.h> 22#include <linux/clk.h>
25#include <linux/gpio.h> 23#include <linux/gpio.h>
26#include <linux/videodev2.h>
27#include <linux/sh_intc.h>
28#include <video/sh_mobile_lcdc.h> 24#include <video/sh_mobile_lcdc.h>
29#include <media/sh_mobile_ceu.h> 25#include <media/sh_mobile_ceu.h>
30#include <media/ov772x.h> 26#include <media/ov772x.h>
31#include <media/soc_camera.h>
32#include <media/tw9910.h> 27#include <media/tw9910.h>
33#include <asm/clock.h> 28#include <asm/clock.h>
34#include <asm/machvec.h> 29#include <asm/machvec.h>
@@ -57,7 +52,7 @@ static struct resource smc91x_eth_resources[] = {
57 .flags = IORESOURCE_MEM, 52 .flags = IORESOURCE_MEM,
58 }, 53 },
59 [1] = { 54 [1] = {
60 .start = evt2irq(0x600), /* IRQ0 */ 55 .start = 32, /* IRQ0 */
61 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 56 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
62 }, 57 },
63}; 58};
@@ -91,7 +86,7 @@ static struct resource sh_keysc_resources[] = {
91 .flags = IORESOURCE_MEM, 86 .flags = IORESOURCE_MEM,
92 }, 87 },
93 [1] = { 88 [1] = {
94 .start = evt2irq(0xbe0), 89 .start = 79,
95 .flags = IORESOURCE_IRQ, 90 .flags = IORESOURCE_IRQ,
96 }, 91 },
97}; 92};
@@ -104,6 +99,9 @@ static struct platform_device sh_keysc_device = {
104 .dev = { 99 .dev = {
105 .platform_data = &sh_keysc_info, 100 .platform_data = &sh_keysc_info,
106 }, 101 },
102 .archdata = {
103 .hwblk_id = HWBLK_KEYSC,
104 },
107}; 105};
108 106
109static struct mtd_partition migor_nor_flash_partitions[] = 107static struct mtd_partition migor_nor_flash_partitions[] =
@@ -190,6 +188,7 @@ static struct platform_nand_data migor_nand_flash_data = {
190 .partitions = migor_nand_flash_partitions, 188 .partitions = migor_nand_flash_partitions,
191 .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions), 189 .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions),
192 .chip_delay = 20, 190 .chip_delay = 20,
191 .part_probe_types = (const char *[]) { "cmdlinepart", NULL },
193 }, 192 },
194 .ctrl = { 193 .ctrl = {
195 .dev_ready = migor_nand_flash_ready, 194 .dev_ready = migor_nand_flash_ready,
@@ -245,12 +244,12 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
245 .clock_source = LCDC_CLK_BUS, 244 .clock_source = LCDC_CLK_BUS,
246 .ch[0] = { 245 .ch[0] = {
247 .chan = LCDC_CHAN_MAINLCD, 246 .chan = LCDC_CHAN_MAINLCD,
248 .fourcc = V4L2_PIX_FMT_RGB565, 247 .bpp = 16,
249 .interface_type = RGB16, 248 .interface_type = RGB16,
250 .clock_divider = 2, 249 .clock_divider = 2,
251 .lcd_modes = migor_lcd_modes, 250 .lcd_cfg = migor_lcd_modes,
252 .num_modes = ARRAY_SIZE(migor_lcd_modes), 251 .num_cfg = ARRAY_SIZE(migor_lcd_modes),
253 .panel_cfg = { /* 7.0 inch */ 252 .lcd_size_cfg = { /* 7.0 inch */
254 .width = 152, 253 .width = 152,
255 .height = 91, 254 .height = 91,
256 }, 255 },
@@ -259,14 +258,16 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
259 .clock_source = LCDC_CLK_PERIPHERAL, 258 .clock_source = LCDC_CLK_PERIPHERAL,
260 .ch[0] = { 259 .ch[0] = {
261 .chan = LCDC_CHAN_MAINLCD, 260 .chan = LCDC_CHAN_MAINLCD,
262 .fourcc = V4L2_PIX_FMT_RGB565, 261 .bpp = 16,
263 .interface_type = SYS16A, 262 .interface_type = SYS16A,
264 .clock_divider = 10, 263 .clock_divider = 10,
265 .lcd_modes = migor_lcd_modes, 264 .lcd_cfg = migor_lcd_modes,
266 .num_modes = ARRAY_SIZE(migor_lcd_modes), 265 .num_cfg = ARRAY_SIZE(migor_lcd_modes),
267 .panel_cfg = { 266 .lcd_size_cfg = { /* 2.4 inch */
268 .width = 49, /* 2.4 inch */ 267 .width = 49,
269 .height = 37, 268 .height = 37,
269 },
270 .board_cfg = {
270 .setup_sys = migor_lcd_qvga_setup, 271 .setup_sys = migor_lcd_qvga_setup,
271 }, 272 },
272 .sys_bus_cfg = { 273 .sys_bus_cfg = {
@@ -287,7 +288,7 @@ static struct resource migor_lcdc_resources[] = {
287 .flags = IORESOURCE_MEM, 288 .flags = IORESOURCE_MEM,
288 }, 289 },
289 [1] = { 290 [1] = {
290 .start = evt2irq(0x580), 291 .start = 28,
291 .flags = IORESOURCE_IRQ, 292 .flags = IORESOURCE_IRQ,
292 }, 293 },
293}; 294};
@@ -299,6 +300,9 @@ static struct platform_device migor_lcdc_device = {
299 .dev = { 300 .dev = {
300 .platform_data = &sh_mobile_lcdc_info, 301 .platform_data = &sh_mobile_lcdc_info,
301 }, 302 },
303 .archdata = {
304 .hwblk_id = HWBLK_LCDC,
305 },
302}; 306};
303 307
304static struct clk *camera_clk; 308static struct clk *camera_clk;
@@ -370,7 +374,7 @@ static struct resource migor_ceu_resources[] = {
370 .flags = IORESOURCE_MEM, 374 .flags = IORESOURCE_MEM,
371 }, 375 },
372 [1] = { 376 [1] = {
373 .start = evt2irq(0x880), 377 .start = 52,
374 .flags = IORESOURCE_IRQ, 378 .flags = IORESOURCE_IRQ,
375 }, 379 },
376 [2] = { 380 [2] = {
@@ -386,13 +390,9 @@ static struct platform_device migor_ceu_device = {
386 .dev = { 390 .dev = {
387 .platform_data = &sh_mobile_ceu_info, 391 .platform_data = &sh_mobile_ceu_info,
388 }, 392 },
389}; 393 .archdata = {
390 394 .hwblk_id = HWBLK_CEU,
391/* Fixed 3.3V regulator to be used by SDHI0 */ 395 },
392static struct regulator_consumer_supply fixed3v3_power_consumers[] =
393{
394 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
395 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
396}; 396};
397 397
398static struct resource sdhi_cn9_resources[] = { 398static struct resource sdhi_cn9_resources[] = {
@@ -403,7 +403,7 @@ static struct resource sdhi_cn9_resources[] = {
403 .flags = IORESOURCE_MEM, 403 .flags = IORESOURCE_MEM,
404 }, 404 },
405 [1] = { 405 [1] = {
406 .start = evt2irq(0xe80), 406 .start = 100,
407 .flags = IORESOURCE_IRQ, 407 .flags = IORESOURCE_IRQ,
408 }, 408 },
409}; 409};
@@ -421,6 +421,9 @@ static struct platform_device sdhi_cn9_device = {
421 .dev = { 421 .dev = {
422 .platform_data = &sh7724_sdhi_data, 422 .platform_data = &sh7724_sdhi_data,
423 }, 423 },
424 .archdata = {
425 .hwblk_id = HWBLK_SDHI,
426 },
424}; 427};
425 428
426static struct i2c_board_info migor_i2c_devices[] = { 429static struct i2c_board_info migor_i2c_devices[] = {
@@ -429,7 +432,7 @@ static struct i2c_board_info migor_i2c_devices[] = {
429 }, 432 },
430 { 433 {
431 I2C_BOARD_INFO("migor_ts", 0x51), 434 I2C_BOARD_INFO("migor_ts", 0x51),
432 .irq = evt2irq(0x6c0), /* IRQ6 */ 435 .irq = 38, /* IRQ6 */
433 }, 436 },
434 { 437 {
435 I2C_BOARD_INFO("wm8978", 0x1a), 438 I2C_BOARD_INFO("wm8978", 0x1a),
@@ -445,7 +448,9 @@ static struct i2c_board_info migor_i2c_camera[] = {
445 }, 448 },
446}; 449};
447 450
448static struct ov772x_camera_info ov7725_info; 451static struct ov772x_camera_info ov7725_info = {
452 .flags = OV772X_FLAG_8BIT,
453};
449 454
450static struct soc_camera_link ov7725_link = { 455static struct soc_camera_link ov7725_link = {
451 .power = ov7725_power, 456 .power = ov7725_power,
@@ -507,10 +512,6 @@ static int __init migor_devices_setup(void)
507 &migor_sdram_enter_end, 512 &migor_sdram_enter_end,
508 &migor_sdram_leave_start, 513 &migor_sdram_leave_start,
509 &migor_sdram_leave_end); 514 &migor_sdram_leave_end);
510
511 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
512 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
513
514 /* Let D11 LED show STATUS0 */ 515 /* Let D11 LED show STATUS0 */
515 gpio_request(GPIO_FN_STATUS0, NULL); 516 gpio_request(GPIO_FN_STATUS0, NULL);
516 517
diff --git a/arch/sh/boards/mach-rsk/Kconfig b/arch/sh/boards/mach-rsk/Kconfig
index 458a11ffd02..aeff3b04220 100644
--- a/arch/sh/boards/mach-rsk/Kconfig
+++ b/arch/sh/boards/mach-rsk/Kconfig
@@ -13,16 +13,6 @@ config SH_RSK7203
13 select ARCH_REQUIRE_GPIOLIB 13 select ARCH_REQUIRE_GPIOLIB
14 depends on CPU_SUBTYPE_SH7203 14 depends on CPU_SUBTYPE_SH7203
15 15
16config SH_RSK7264
17 bool "RSK2+SH7264"
18 select ARCH_REQUIRE_GPIOLIB
19 depends on CPU_SUBTYPE_SH7264
20
21config SH_RSK7269
22 bool "RSK2+SH7269"
23 select ARCH_REQUIRE_GPIOLIB
24 depends on CPU_SUBTYPE_SH7269
25
26endchoice 16endchoice
27 17
28endif 18endif
diff --git a/arch/sh/boards/mach-rsk/Makefile b/arch/sh/boards/mach-rsk/Makefile
index 6a4e1b538a6..498da75ce38 100644
--- a/arch/sh/boards/mach-rsk/Makefile
+++ b/arch/sh/boards/mach-rsk/Makefile
@@ -1,4 +1,2 @@
1obj-y := setup.o 1obj-y := setup.o
2obj-$(CONFIG_SH_RSK7203) += devices-rsk7203.o 2obj-$(CONFIG_SH_RSK7203) += devices-rsk7203.o
3obj-$(CONFIG_SH_RSK7264) += devices-rsk7264.o
4obj-$(CONFIG_SH_RSK7269) += devices-rsk7269.o
diff --git a/arch/sh/boards/mach-rsk/devices-rsk7264.c b/arch/sh/boards/mach-rsk/devices-rsk7264.c
deleted file mode 100644
index 7251e37a842..00000000000
--- a/arch/sh/boards/mach-rsk/devices-rsk7264.c
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 * RSK+SH7264 Support.
3 *
4 * Copyright (C) 2012 Renesas Electronics Europe
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#include <linux/init.h>
11#include <linux/types.h>
12#include <linux/platform_device.h>
13#include <linux/interrupt.h>
14#include <linux/input.h>
15#include <linux/smsc911x.h>
16#include <asm/machvec.h>
17#include <asm/io.h>
18
19static struct smsc911x_platform_config smsc911x_config = {
20 .phy_interface = PHY_INTERFACE_MODE_MII,
21 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
22 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
23 .flags = SMSC911X_USE_16BIT | SMSC911X_SWAP_FIFO,
24};
25
26static struct resource smsc911x_resources[] = {
27 [0] = {
28 .start = 0x28000000,
29 .end = 0x280000ff,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = 65,
34 .end = 65,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39static struct platform_device smsc911x_device = {
40 .name = "smsc911x",
41 .id = -1,
42 .num_resources = ARRAY_SIZE(smsc911x_resources),
43 .resource = smsc911x_resources,
44 .dev = {
45 .platform_data = &smsc911x_config,
46 },
47};
48
49static struct platform_device *rsk7264_devices[] __initdata = {
50 &smsc911x_device,
51};
52
53static int __init rsk7264_devices_setup(void)
54{
55 return platform_add_devices(rsk7264_devices,
56 ARRAY_SIZE(rsk7264_devices));
57}
58device_initcall(rsk7264_devices_setup);
diff --git a/arch/sh/boards/mach-rsk/devices-rsk7269.c b/arch/sh/boards/mach-rsk/devices-rsk7269.c
deleted file mode 100644
index 4a544591d6f..00000000000
--- a/arch/sh/boards/mach-rsk/devices-rsk7269.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * RSK+SH7269 Support
3 *
4 * Copyright (C) 2012 Renesas Electronics Europe Ltd
5 * Copyright (C) 2012 Phil Edworthy
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11#include <linux/init.h>
12#include <linux/types.h>
13#include <linux/platform_device.h>
14#include <linux/interrupt.h>
15#include <linux/input.h>
16#include <linux/smsc911x.h>
17#include <linux/gpio.h>
18#include <asm/machvec.h>
19#include <asm/io.h>
20
21static struct smsc911x_platform_config smsc911x_config = {
22 .phy_interface = PHY_INTERFACE_MODE_MII,
23 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
24 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
25 .flags = SMSC911X_USE_16BIT | SMSC911X_SWAP_FIFO,
26};
27
28static struct resource smsc911x_resources[] = {
29 [0] = {
30 .start = 0x24000000,
31 .end = 0x240000ff,
32 .flags = IORESOURCE_MEM,
33 },
34 [1] = {
35 .start = 85,
36 .end = 85,
37 .flags = IORESOURCE_IRQ,
38 },
39};
40
41static struct platform_device smsc911x_device = {
42 .name = "smsc911x",
43 .id = -1,
44 .num_resources = ARRAY_SIZE(smsc911x_resources),
45 .resource = smsc911x_resources,
46 .dev = {
47 .platform_data = &smsc911x_config,
48 },
49};
50
51static struct platform_device *rsk7269_devices[] __initdata = {
52 &smsc911x_device,
53};
54
55static int __init rsk7269_devices_setup(void)
56{
57 return platform_add_devices(rsk7269_devices,
58 ARRAY_SIZE(rsk7269_devices));
59}
60device_initcall(rsk7269_devices_setup);
diff --git a/arch/sh/boards/mach-rsk/setup.c b/arch/sh/boards/mach-rsk/setup.c
index 2685ea03b06..a5c0df785bf 100644
--- a/arch/sh/boards/mach-rsk/setup.c
+++ b/arch/sh/boards/mach-rsk/setup.c
@@ -15,20 +15,12 @@
15#include <linux/mtd/mtd.h> 15#include <linux/mtd/mtd.h>
16#include <linux/mtd/partitions.h> 16#include <linux/mtd/partitions.h>
17#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
18#ifdef CONFIG_MTD
18#include <linux/mtd/map.h> 19#include <linux/mtd/map.h>
19#include <linux/regulator/fixed.h> 20#endif
20#include <linux/regulator/machine.h>
21#include <asm/machvec.h> 21#include <asm/machvec.h>
22#include <asm/io.h> 22#include <asm/io.h>
23 23
24/* Dummy supplies, where voltage doesn't matter */
25static struct regulator_consumer_supply dummy_supplies[] = {
26 REGULATOR_SUPPLY("vddvario", "smsc911x"),
27 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
28};
29
30static const char *part_probes[] = { "cmdlinepart", NULL };
31
32static struct mtd_partition rsk_partitions[] = { 24static struct mtd_partition rsk_partitions[] = {
33 { 25 {
34 .name = "Bootloader", 26 .name = "Bootloader",
@@ -47,10 +39,9 @@ static struct mtd_partition rsk_partitions[] = {
47}; 39};
48 40
49static struct physmap_flash_data flash_data = { 41static struct physmap_flash_data flash_data = {
50 .parts = rsk_partitions, 42 .parts = rsk_partitions,
51 .nr_parts = ARRAY_SIZE(rsk_partitions), 43 .nr_parts = ARRAY_SIZE(rsk_partitions),
52 .width = 2, 44 .width = 2,
53 .part_probe_types = part_probes,
54}; 45};
55 46
56static struct resource flash_resource = { 47static struct resource flash_resource = {
@@ -69,14 +60,44 @@ static struct platform_device flash_device = {
69 }, 60 },
70}; 61};
71 62
63#ifdef CONFIG_MTD
64static const char *probes[] = { "cmdlinepart", NULL };
65
66static struct map_info rsk_flash_map = {
67 .name = "RSK+ Flash",
68 .size = 0x400000,
69 .bankwidth = 2,
70};
71
72static struct mtd_info *flash_mtd;
73
74static struct mtd_partition *parsed_partitions;
75
76static void __init set_mtd_partitions(void)
77{
78 int nr_parts = 0;
79
80 simple_map_init(&rsk_flash_map);
81 flash_mtd = do_map_probe("cfi_probe", &rsk_flash_map);
82 nr_parts = parse_mtd_partitions(flash_mtd, probes,
83 &parsed_partitions, 0);
84 /* If there is no partition table, used the hard coded table */
85 if (nr_parts > 0) {
86 flash_data.nr_parts = nr_parts;
87 flash_data.parts = parsed_partitions;
88 }
89}
90#else
91static inline void set_mtd_partitions(void) {}
92#endif
93
72static struct platform_device *rsk_devices[] __initdata = { 94static struct platform_device *rsk_devices[] __initdata = {
73 &flash_device, 95 &flash_device,
74}; 96};
75 97
76static int __init rsk_devices_setup(void) 98static int __init rsk_devices_setup(void)
77{ 99{
78 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 100 set_mtd_partitions();
79
80 return platform_add_devices(rsk_devices, 101 return platform_add_devices(rsk_devices,
81 ARRAY_SIZE(rsk_devices)); 102 ARRAY_SIZE(rsk_devices));
82} 103}
diff --git a/arch/sh/boards/mach-sdk7780/setup.c b/arch/sh/boards/mach-sdk7780/setup.c
index 2241659c329..4da38db4b5f 100644
--- a/arch/sh/boards/mach-sdk7780/setup.c
+++ b/arch/sh/boards/mach-sdk7780/setup.c
@@ -94,6 +94,7 @@ static void __init sdk7780_setup(char **cmdline_p)
94static struct sh_machine_vector mv_se7780 __initmv = { 94static struct sh_machine_vector mv_se7780 __initmv = {
95 .mv_name = "Renesas SDK7780-R3" , 95 .mv_name = "Renesas SDK7780-R3" ,
96 .mv_setup = sdk7780_setup, 96 .mv_setup = sdk7780_setup,
97 .mv_nr_irqs = 111,
97 .mv_init_irq = init_sdk7780_IRQ, 98 .mv_init_irq = init_sdk7780_IRQ,
98}; 99};
99 100
diff --git a/arch/sh/boards/mach-sdk7786/setup.c b/arch/sh/boards/mach-sdk7786/setup.c
index c29268bfd34..486d1ac3694 100644
--- a/arch/sh/boards/mach-sdk7786/setup.c
+++ b/arch/sh/boards/mach-sdk7786/setup.c
@@ -11,8 +11,6 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/io.h> 13#include <linux/io.h>
14#include <linux/regulator/fixed.h>
15#include <linux/regulator/machine.h>
16#include <linux/smsc911x.h> 14#include <linux/smsc911x.h>
17#include <linux/i2c.h> 15#include <linux/i2c.h>
18#include <linux/irq.h> 16#include <linux/irq.h>
@@ -40,12 +38,6 @@ static struct platform_device heartbeat_device = {
40 .resource = &heartbeat_resource, 38 .resource = &heartbeat_resource,
41}; 39};
42 40
43/* Dummy supplies, where voltage doesn't matter */
44static struct regulator_consumer_supply dummy_supplies[] = {
45 REGULATOR_SUPPLY("vddvario", "smsc911x"),
46 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
47};
48
49static struct resource smsc911x_resources[] = { 41static struct resource smsc911x_resources[] = {
50 [0] = { 42 [0] = {
51 .name = "smsc911x-memory", 43 .name = "smsc911x-memory",
@@ -175,7 +167,7 @@ static void sdk7786_pcie_clk_disable(struct clk *clk)
175 fpga_write_reg(fpga_read_reg(PCIECR) & ~PCIECR_CLKEN, PCIECR); 167 fpga_write_reg(fpga_read_reg(PCIECR) & ~PCIECR_CLKEN, PCIECR);
176} 168}
177 169
178static struct sh_clk_ops sdk7786_pcie_clk_ops = { 170static struct clk_ops sdk7786_pcie_clk_ops = {
179 .enable = sdk7786_pcie_clk_enable, 171 .enable = sdk7786_pcie_clk_enable,
180 .disable = sdk7786_pcie_clk_disable, 172 .disable = sdk7786_pcie_clk_disable,
181}; 173};
@@ -244,8 +236,6 @@ static void __init sdk7786_setup(char **cmdline_p)
244{ 236{
245 pr_info("Renesas Technology Europe SDK7786 support:\n"); 237 pr_info("Renesas Technology Europe SDK7786 support:\n");
246 238
247 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
248
249 sdk7786_fpga_init(); 239 sdk7786_fpga_init();
250 sdk7786_nmi_init(); 240 sdk7786_nmi_init();
251 241
diff --git a/arch/sh/boards/mach-se/7206/setup.c b/arch/sh/boards/mach-se/7206/setup.c
index 68883ec9568..8ab8330e3fd 100644
--- a/arch/sh/boards/mach-se/7206/setup.c
+++ b/arch/sh/boards/mach-se/7206/setup.c
@@ -90,6 +90,7 @@ static int se7206_mode_pins(void)
90 90
91static struct sh_machine_vector mv_se __initmv = { 91static struct sh_machine_vector mv_se __initmv = {
92 .mv_name = "SolutionEngine", 92 .mv_name = "SolutionEngine",
93 .mv_nr_irqs = 256,
93 .mv_init_irq = init_se7206_IRQ, 94 .mv_init_irq = init_se7206_IRQ,
94 .mv_mode_pins = se7206_mode_pins, 95 .mv_mode_pins = se7206_mode_pins,
95}; 96};
diff --git a/arch/sh/boards/mach-se/7343/irq.c b/arch/sh/boards/mach-se/7343/irq.c
index 7646bf0486c..fd45ffc4834 100644
--- a/arch/sh/boards/mach-se/7343/irq.c
+++ b/arch/sh/boards/mach-se/7343/irq.c
@@ -1,129 +1,86 @@
1/* 1/*
2 * Hitachi UL SolutionEngine 7343 FPGA IRQ Support. 2 * linux/arch/sh/boards/se/7343/irq.c
3 * 3 *
4 * Copyright (C) 2008 Yoshihiro Shimoda 4 * Copyright (C) 2008 Yoshihiro Shimoda
5 * Copyright (C) 2012 Paul Mundt
6 * 5 *
7 * Based on linux/arch/sh/boards/se/7343/irq.c 6 * Based on linux/arch/sh/boards/se/7722/irq.c
8 * Copyright (C) 2007 Nobuhiro Iwamatsu 7 * Copyright (C) 2007 Nobuhiro Iwamatsu
9 * 8 *
10 * This file is subject to the terms and conditions of the GNU General Public 9 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file "COPYING" in the main directory of this archive 10 * License. See the file "COPYING" in the main directory of this archive
12 * for more details. 11 * for more details.
13 */ 12 */
14#define DRV_NAME "SE7343-FPGA"
15#define pr_fmt(fmt) DRV_NAME ": " fmt
16
17#define irq_reg_readl ioread16
18#define irq_reg_writel iowrite16
19
20#include <linux/init.h> 13#include <linux/init.h>
21#include <linux/irq.h> 14#include <linux/irq.h>
22#include <linux/interrupt.h> 15#include <linux/interrupt.h>
23#include <linux/irqdomain.h>
24#include <linux/io.h> 16#include <linux/io.h>
25#include <asm/sizes.h>
26#include <mach-se/mach/se7343.h> 17#include <mach-se/mach/se7343.h>
27 18
28#define PA_CPLD_BASE_ADDR 0x11400000 19unsigned int se7343_fpga_irq[SE7343_FPGA_IRQ_NR] = { 0, };
29#define PA_CPLD_ST_REG 0x08 /* CPLD Interrupt status register */
30#define PA_CPLD_IMSK_REG 0x0a /* CPLD Interrupt mask register */
31
32static void __iomem *se7343_irq_regs;
33struct irq_domain *se7343_irq_domain;
34 20
35static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc) 21static void disable_se7343_irq(struct irq_data *data)
36{ 22{
37 struct irq_data *data = irq_get_irq_data(irq); 23 unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data);
38 struct irq_chip *chip = irq_data_get_irq_chip(data); 24 __raw_writew(__raw_readw(PA_CPLD_IMSK) | 1 << bit, PA_CPLD_IMSK);
39 unsigned long mask; 25}
40 int bit;
41
42 chip->irq_mask_ack(data);
43
44 mask = ioread16(se7343_irq_regs + PA_CPLD_ST_REG);
45
46 for_each_set_bit(bit, &mask, SE7343_FPGA_IRQ_NR)
47 generic_handle_irq(irq_linear_revmap(se7343_irq_domain, bit));
48 26
49 chip->irq_unmask(data); 27static void enable_se7343_irq(struct irq_data *data)
28{
29 unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data);
30 __raw_writew(__raw_readw(PA_CPLD_IMSK) & ~(1 << bit), PA_CPLD_IMSK);
50} 31}
51 32
52static void __init se7343_domain_init(void) 33static struct irq_chip se7343_irq_chip __read_mostly = {
34 .name = "SE7343-FPGA",
35 .irq_mask = disable_se7343_irq,
36 .irq_unmask = enable_se7343_irq,
37};
38
39static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc)
53{ 40{
54 int i; 41 unsigned short intv = __raw_readw(PA_CPLD_ST);
42 unsigned int ext_irq = 0;
55 43
56 se7343_irq_domain = irq_domain_add_linear(NULL, SE7343_FPGA_IRQ_NR, 44 intv &= (1 << SE7343_FPGA_IRQ_NR) - 1;
57 &irq_domain_simple_ops, NULL);
58 if (unlikely(!se7343_irq_domain)) {
59 printk("Failed to get IRQ domain\n");
60 return;
61 }
62 45
63 for (i = 0; i < SE7343_FPGA_IRQ_NR; i++) { 46 for (; intv; intv >>= 1, ext_irq++) {
64 int irq = irq_create_mapping(se7343_irq_domain, i); 47 if (!(intv & 1))
48 continue;
65 49
66 if (unlikely(irq == 0)) { 50 generic_handle_irq(se7343_fpga_irq[ext_irq]);
67 printk("Failed to allocate IRQ %d\n", i);
68 return;
69 }
70 } 51 }
71} 52}
72 53
73static void __init se7343_gc_init(void) 54/*
55 * Initialize IRQ setting
56 */
57void __init init_7343se_IRQ(void)
74{ 58{
75 struct irq_chip_generic *gc; 59 int i, irq;
76 struct irq_chip_type *ct;
77 unsigned int irq_base;
78
79 irq_base = irq_linear_revmap(se7343_irq_domain, 0);
80 60
81 gc = irq_alloc_generic_chip(DRV_NAME, 1, irq_base, se7343_irq_regs, 61 __raw_writew(0, PA_CPLD_IMSK); /* disable all irqs */
82 handle_level_irq); 62 __raw_writew(0x2000, 0xb03fffec); /* mrshpc irq enable */
83 if (unlikely(!gc))
84 return;
85 63
86 ct = gc->chip_types; 64 for (i = 0; i < SE7343_FPGA_IRQ_NR; i++) {
87 ct->chip.irq_mask = irq_gc_mask_set_bit; 65 irq = create_irq();
88 ct->chip.irq_unmask = irq_gc_mask_clr_bit; 66 if (irq < 0)
67 return;
68 se7343_fpga_irq[i] = irq;
89 69
90 ct->regs.mask = PA_CPLD_IMSK_REG; 70 irq_set_chip_and_handler_name(se7343_fpga_irq[i],
71 &se7343_irq_chip,
72 handle_level_irq,
73 "level");
91 74
92 irq_setup_generic_chip(gc, IRQ_MSK(SE7343_FPGA_IRQ_NR), 75 irq_set_chip_data(se7343_fpga_irq[i], (void *)i);
93 IRQ_GC_INIT_MASK_CACHE, 76 }
94 IRQ_NOREQUEST | IRQ_NOPROBE, 0);
95 77
96 irq_set_chained_handler(IRQ0_IRQ, se7343_irq_demux); 78 irq_set_chained_handler(IRQ0_IRQ, se7343_irq_demux);
97 irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW); 79 irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
98
99 irq_set_chained_handler(IRQ1_IRQ, se7343_irq_demux); 80 irq_set_chained_handler(IRQ1_IRQ, se7343_irq_demux);
100 irq_set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW); 81 irq_set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
101
102 irq_set_chained_handler(IRQ4_IRQ, se7343_irq_demux); 82 irq_set_chained_handler(IRQ4_IRQ, se7343_irq_demux);
103 irq_set_irq_type(IRQ4_IRQ, IRQ_TYPE_LEVEL_LOW); 83 irq_set_irq_type(IRQ4_IRQ, IRQ_TYPE_LEVEL_LOW);
104
105 irq_set_chained_handler(IRQ5_IRQ, se7343_irq_demux); 84 irq_set_chained_handler(IRQ5_IRQ, se7343_irq_demux);
106 irq_set_irq_type(IRQ5_IRQ, IRQ_TYPE_LEVEL_LOW); 85 irq_set_irq_type(IRQ5_IRQ, IRQ_TYPE_LEVEL_LOW);
107} 86}
108
109/*
110 * Initialize IRQ setting
111 */
112void __init init_7343se_IRQ(void)
113{
114 se7343_irq_regs = ioremap(PA_CPLD_BASE_ADDR, SZ_16);
115 if (unlikely(!se7343_irq_regs)) {
116 pr_err("Failed to remap CPLD\n");
117 return;
118 }
119
120 /*
121 * All FPGA IRQs disabled by default
122 */
123 iowrite16(0, se7343_irq_regs + PA_CPLD_IMSK_REG);
124
125 __raw_writew(0x2000, 0xb03fffec); /* mrshpc irq enable */
126
127 se7343_domain_init();
128 se7343_gc_init();
129}
diff --git a/arch/sh/boards/mach-se/7343/setup.c b/arch/sh/boards/mach-se/7343/setup.c
index 8ce4f2a202a..d2370af56d7 100644
--- a/arch/sh/boards/mach-se/7343/setup.c
+++ b/arch/sh/boards/mach-se/7343/setup.c
@@ -5,7 +5,6 @@
5#include <linux/serial_reg.h> 5#include <linux/serial_reg.h>
6#include <linux/usb/isp116x.h> 6#include <linux/usb/isp116x.h>
7#include <linux/delay.h> 7#include <linux/delay.h>
8#include <linux/irqdomain.h>
9#include <asm/machvec.h> 8#include <asm/machvec.h>
10#include <mach-se/mach/se7343.h> 9#include <mach-se/mach/se7343.h>
11#include <asm/heartbeat.h> 10#include <asm/heartbeat.h>
@@ -146,12 +145,11 @@ static struct platform_device *sh7343se_platform_devices[] __initdata = {
146static int __init sh7343se_devices_setup(void) 145static int __init sh7343se_devices_setup(void)
147{ 146{
148 /* Wire-up dynamic vectors */ 147 /* Wire-up dynamic vectors */
149 serial_platform_data[0].irq = irq_find_mapping(se7343_irq_domain, 148 serial_platform_data[0].irq = se7343_fpga_irq[SE7343_FPGA_IRQ_UARTA];
150 SE7343_FPGA_IRQ_UARTA); 149 serial_platform_data[1].irq = se7343_fpga_irq[SE7343_FPGA_IRQ_UARTB];
151 serial_platform_data[1].irq = irq_find_mapping(se7343_irq_domain, 150
152 SE7343_FPGA_IRQ_UARTB);
153 usb_resources[2].start = usb_resources[2].end = 151 usb_resources[2].start = usb_resources[2].end =
154 irq_find_mapping(se7343_irq_domain, SE7343_FPGA_IRQ_USB); 152 se7343_fpga_irq[SE7343_FPGA_IRQ_USB];
155 153
156 return platform_add_devices(sh7343se_platform_devices, 154 return platform_add_devices(sh7343se_platform_devices,
157 ARRAY_SIZE(sh7343se_platform_devices)); 155 ARRAY_SIZE(sh7343se_platform_devices));
diff --git a/arch/sh/boards/mach-se/770x/setup.c b/arch/sh/boards/mach-se/770x/setup.c
index 9759d6ba7ff..31330c65c0c 100644
--- a/arch/sh/boards/mach-se/770x/setup.c
+++ b/arch/sh/boards/mach-se/770x/setup.c
@@ -184,5 +184,16 @@ device_initcall(se_devices_setup);
184static struct sh_machine_vector mv_se __initmv = { 184static struct sh_machine_vector mv_se __initmv = {
185 .mv_name = "SolutionEngine", 185 .mv_name = "SolutionEngine",
186 .mv_setup = smsc_setup, 186 .mv_setup = smsc_setup,
187#if defined(CONFIG_CPU_SH4)
188 .mv_nr_irqs = 48,
189#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
190 .mv_nr_irqs = 32,
191#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
192 .mv_nr_irqs = 61,
193#elif defined(CONFIG_CPU_SUBTYPE_SH7705)
194 .mv_nr_irqs = 86,
195#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
196 .mv_nr_irqs = 104,
197#endif
187 .mv_init_irq = init_se_IRQ, 198 .mv_init_irq = init_se_IRQ,
188}; 199};
diff --git a/arch/sh/boards/mach-se/7721/setup.c b/arch/sh/boards/mach-se/7721/setup.c
index a0b3dba34eb..7416ad7ee53 100644
--- a/arch/sh/boards/mach-se/7721/setup.c
+++ b/arch/sh/boards/mach-se/7721/setup.c
@@ -92,5 +92,6 @@ static void __init se7721_setup(char **cmdline_p)
92struct sh_machine_vector mv_se7721 __initmv = { 92struct sh_machine_vector mv_se7721 __initmv = {
93 .mv_name = "Solution Engine 7721", 93 .mv_name = "Solution Engine 7721",
94 .mv_setup = se7721_setup, 94 .mv_setup = se7721_setup,
95 .mv_nr_irqs = 109,
95 .mv_init_irq = init_se7721_IRQ, 96 .mv_init_irq = init_se7721_IRQ,
96}; 97};
diff --git a/arch/sh/boards/mach-se/7722/irq.c b/arch/sh/boards/mach-se/7722/irq.c
index f5e2af1bf04..aac92f21ebd 100644
--- a/arch/sh/boards/mach-se/7722/irq.c
+++ b/arch/sh/boards/mach-se/7722/irq.c
@@ -1,96 +1,79 @@
1/* 1/*
2 * Hitachi UL SolutionEngine 7722 FPGA IRQ Support. 2 * linux/arch/sh/boards/se/7722/irq.c
3 * 3 *
4 * Copyright (C) 2007 Nobuhiro Iwamatsu 4 * Copyright (C) 2007 Nobuhiro Iwamatsu
5 * Copyright (C) 2012 Paul Mundt 5 *
6 * Hitachi UL SolutionEngine 7722 Support.
6 * 7 *
7 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
9 * for more details. 10 * for more details.
10 */ 11 */
11#define DRV_NAME "SE7722-FPGA"
12#define pr_fmt(fmt) DRV_NAME ": " fmt
13
14#define irq_reg_readl ioread16
15#define irq_reg_writel iowrite16
16
17#include <linux/init.h> 12#include <linux/init.h>
18#include <linux/irq.h> 13#include <linux/irq.h>
19#include <linux/interrupt.h> 14#include <linux/interrupt.h>
20#include <linux/irqdomain.h> 15#include <asm/irq.h>
21#include <linux/io.h> 16#include <asm/io.h>
22#include <linux/err.h>
23#include <asm/sizes.h>
24#include <mach-se/mach/se7722.h> 17#include <mach-se/mach/se7722.h>
25 18
26#define IRQ01_BASE_ADDR 0x11800000 19unsigned int se7722_fpga_irq[SE7722_FPGA_IRQ_NR] = { 0, };
27#define IRQ01_MODE_REG 0
28#define IRQ01_STS_REG 4
29#define IRQ01_MASK_REG 8
30 20
31static void __iomem *se7722_irq_regs; 21static void disable_se7722_irq(struct irq_data *data)
32struct irq_domain *se7722_irq_domain;
33
34static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc)
35{ 22{
36 struct irq_data *data = irq_get_irq_data(irq); 23 unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data);
37 struct irq_chip *chip = irq_data_get_irq_chip(data); 24 __raw_writew(__raw_readw(IRQ01_MASK) | 1 << bit, IRQ01_MASK);
38 unsigned long mask; 25}
39 int bit;
40
41 chip->irq_mask_ack(data);
42
43 mask = ioread16(se7722_irq_regs + IRQ01_STS_REG);
44
45 for_each_set_bit(bit, &mask, SE7722_FPGA_IRQ_NR)
46 generic_handle_irq(irq_linear_revmap(se7722_irq_domain, bit));
47 26
48 chip->irq_unmask(data); 27static void enable_se7722_irq(struct irq_data *data)
28{
29 unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data);
30 __raw_writew(__raw_readw(IRQ01_MASK) & ~(1 << bit), IRQ01_MASK);
49} 31}
50 32
51static void __init se7722_domain_init(void) 33static struct irq_chip se7722_irq_chip __read_mostly = {
34 .name = "SE7722-FPGA",
35 .irq_mask = disable_se7722_irq,
36 .irq_unmask = enable_se7722_irq,
37};
38
39static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc)
52{ 40{
53 int i; 41 unsigned short intv = __raw_readw(IRQ01_STS);
42 unsigned int ext_irq = 0;
54 43
55 se7722_irq_domain = irq_domain_add_linear(NULL, SE7722_FPGA_IRQ_NR, 44 intv &= (1 << SE7722_FPGA_IRQ_NR) - 1;
56 &irq_domain_simple_ops, NULL);
57 if (unlikely(!se7722_irq_domain)) {
58 printk("Failed to get IRQ domain\n");
59 return;
60 }
61 45
62 for (i = 0; i < SE7722_FPGA_IRQ_NR; i++) { 46 for (; intv; intv >>= 1, ext_irq++) {
63 int irq = irq_create_mapping(se7722_irq_domain, i); 47 if (!(intv & 1))
48 continue;
64 49
65 if (unlikely(irq == 0)) { 50 generic_handle_irq(se7722_fpga_irq[ext_irq]);
66 printk("Failed to allocate IRQ %d\n", i);
67 return;
68 }
69 } 51 }
70} 52}
71 53
72static void __init se7722_gc_init(void) 54/*
55 * Initialize IRQ setting
56 */
57void __init init_se7722_IRQ(void)
73{ 58{
74 struct irq_chip_generic *gc; 59 int i, irq;
75 struct irq_chip_type *ct;
76 unsigned int irq_base;
77
78 irq_base = irq_linear_revmap(se7722_irq_domain, 0);
79 60
80 gc = irq_alloc_generic_chip(DRV_NAME, 1, irq_base, se7722_irq_regs, 61 __raw_writew(0, IRQ01_MASK); /* disable all irqs */
81 handle_level_irq); 62 __raw_writew(0x2000, 0xb03fffec); /* mrshpc irq enable */
82 if (unlikely(!gc))
83 return;
84 63
85 ct = gc->chip_types; 64 for (i = 0; i < SE7722_FPGA_IRQ_NR; i++) {
86 ct->chip.irq_mask = irq_gc_mask_set_bit; 65 irq = create_irq();
87 ct->chip.irq_unmask = irq_gc_mask_clr_bit; 66 if (irq < 0)
67 return;
68 se7722_fpga_irq[i] = irq;
88 69
89 ct->regs.mask = IRQ01_MASK_REG; 70 irq_set_chip_and_handler_name(se7722_fpga_irq[i],
71 &se7722_irq_chip,
72 handle_level_irq,
73 "level");
90 74
91 irq_setup_generic_chip(gc, IRQ_MSK(SE7722_FPGA_IRQ_NR), 75 irq_set_chip_data(se7722_fpga_irq[i], (void *)i);
92 IRQ_GC_INIT_MASK_CACHE, 76 }
93 IRQ_NOREQUEST | IRQ_NOPROBE, 0);
94 77
95 irq_set_chained_handler(IRQ0_IRQ, se7722_irq_demux); 78 irq_set_chained_handler(IRQ0_IRQ, se7722_irq_demux);
96 irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW); 79 irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
@@ -98,25 +81,3 @@ static void __init se7722_gc_init(void)
98 irq_set_chained_handler(IRQ1_IRQ, se7722_irq_demux); 81 irq_set_chained_handler(IRQ1_IRQ, se7722_irq_demux);
99 irq_set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW); 82 irq_set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
100} 83}
101
102/*
103 * Initialize FPGA IRQs
104 */
105void __init init_se7722_IRQ(void)
106{
107 se7722_irq_regs = ioremap(IRQ01_BASE_ADDR, SZ_16);
108 if (unlikely(!se7722_irq_regs)) {
109 printk("Failed to remap IRQ01 regs\n");
110 return;
111 }
112
113 /*
114 * All FPGA IRQs disabled by default
115 */
116 iowrite16(0, se7722_irq_regs + IRQ01_MASK_REG);
117
118 __raw_writew(0x2000, 0xb03fffec); /* mrshpc irq enable */
119
120 se7722_domain_init();
121 se7722_gc_init();
122}
diff --git a/arch/sh/boards/mach-se/7722/setup.c b/arch/sh/boards/mach-se/7722/setup.c
index e04e2bc4698..80a4e571b31 100644
--- a/arch/sh/boards/mach-se/7722/setup.c
+++ b/arch/sh/boards/mach-se/7722/setup.c
@@ -2,7 +2,6 @@
2 * linux/arch/sh/boards/se/7722/setup.c 2 * linux/arch/sh/boards/se/7722/setup.c
3 * 3 *
4 * Copyright (C) 2007 Nobuhiro Iwamatsu 4 * Copyright (C) 2007 Nobuhiro Iwamatsu
5 * Copyright (C) 2012 Paul Mundt
6 * 5 *
7 * Hitachi UL SolutionEngine 7722 Support. 6 * Hitachi UL SolutionEngine 7722 Support.
8 * 7 *
@@ -16,9 +15,7 @@
16#include <linux/ata_platform.h> 15#include <linux/ata_platform.h>
17#include <linux/input.h> 16#include <linux/input.h>
18#include <linux/input/sh_keysc.h> 17#include <linux/input/sh_keysc.h>
19#include <linux/irqdomain.h>
20#include <linux/smc91x.h> 18#include <linux/smc91x.h>
21#include <linux/sh_intc.h>
22#include <mach-se/mach/se7722.h> 19#include <mach-se/mach/se7722.h>
23#include <mach-se/mach/mrshpc.h> 20#include <mach-se/mach/mrshpc.h>
24#include <asm/machvec.h> 21#include <asm/machvec.h>
@@ -117,7 +114,7 @@ static struct resource sh_keysc_resources[] = {
117 .flags = IORESOURCE_MEM, 114 .flags = IORESOURCE_MEM,
118 }, 115 },
119 [1] = { 116 [1] = {
120 .start = evt2irq(0xbe0), 117 .start = 79,
121 .flags = IORESOURCE_IRQ, 118 .flags = IORESOURCE_IRQ,
122 }, 119 },
123}; 120};
@@ -130,6 +127,9 @@ static struct platform_device sh_keysc_device = {
130 .dev = { 127 .dev = {
131 .platform_data = &sh_keysc_info, 128 .platform_data = &sh_keysc_info,
132 }, 129 },
130 .archdata = {
131 .hwblk_id = HWBLK_KEYSC,
132 },
133}; 133};
134 134
135static struct platform_device *se7722_devices[] __initdata = { 135static struct platform_device *se7722_devices[] __initdata = {
@@ -145,10 +145,10 @@ static int __init se7722_devices_setup(void)
145 145
146 /* Wire-up dynamic vectors */ 146 /* Wire-up dynamic vectors */
147 cf_ide_resources[2].start = cf_ide_resources[2].end = 147 cf_ide_resources[2].start = cf_ide_resources[2].end =
148 irq_find_mapping(se7722_irq_domain, SE7722_FPGA_IRQ_MRSHPC0); 148 se7722_fpga_irq[SE7722_FPGA_IRQ_MRSHPC0];
149 149
150 smc91x_eth_resources[1].start = smc91x_eth_resources[1].end = 150 smc91x_eth_resources[1].start = smc91x_eth_resources[1].end =
151 irq_find_mapping(se7722_irq_domain, SE7722_FPGA_IRQ_SMC); 151 se7722_fpga_irq[SE7722_FPGA_IRQ_SMC];
152 152
153 return platform_add_devices(se7722_devices, ARRAY_SIZE(se7722_devices)); 153 return platform_add_devices(se7722_devices, ARRAY_SIZE(se7722_devices));
154} 154}
diff --git a/arch/sh/boards/mach-se/7724/irq.c b/arch/sh/boards/mach-se/7724/irq.c
index 5d1d3ec9a6c..c6342ce7768 100644
--- a/arch/sh/boards/mach-se/7724/irq.c
+++ b/arch/sh/boards/mach-se/7724/irq.c
@@ -17,10 +17,8 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/irq.h> 18#include <linux/irq.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/export.h> 20#include <asm/irq.h>
21#include <linux/topology.h> 21#include <asm/io.h>
22#include <linux/io.h>
23#include <linux/err.h>
24#include <mach-se/mach/se7724.h> 22#include <mach-se/mach/se7724.h>
25 23
26struct fpga_irq { 24struct fpga_irq {
@@ -113,7 +111,7 @@ static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc)
113 */ 111 */
114void __init init_se7724_IRQ(void) 112void __init init_se7724_IRQ(void)
115{ 113{
116 int irq_base, i; 114 int i, nid = cpu_to_node(boot_cpu_data);
117 115
118 __raw_writew(0xffff, IRQ0_MR); /* mask all */ 116 __raw_writew(0xffff, IRQ0_MR); /* mask all */
119 __raw_writew(0xffff, IRQ1_MR); /* mask all */ 117 __raw_writew(0xffff, IRQ1_MR); /* mask all */
@@ -123,16 +121,28 @@ void __init init_se7724_IRQ(void)
123 __raw_writew(0x0000, IRQ2_SR); /* clear irq */ 121 __raw_writew(0x0000, IRQ2_SR); /* clear irq */
124 __raw_writew(0x002a, IRQ_MODE); /* set irq type */ 122 __raw_writew(0x002a, IRQ_MODE); /* set irq type */
125 123
126 irq_base = irq_alloc_descs(SE7724_FPGA_IRQ_BASE, SE7724_FPGA_IRQ_BASE, 124 for (i = 0; i < SE7724_FPGA_IRQ_NR; i++) {
127 SE7724_FPGA_IRQ_NR, numa_node_id()); 125 int irq, wanted;
128 if (IS_ERR_VALUE(irq_base)) { 126
129 pr_err("%s: failed hooking irqs for FPGA\n", __func__); 127 wanted = SE7724_FPGA_IRQ_BASE + i;
130 return; 128
131 } 129 irq = create_irq_nr(wanted, nid);
130 if (unlikely(irq == 0)) {
131 pr_err("%s: failed hooking irq %d for FPGA\n",
132 __func__, wanted);
133 return;
134 }
132 135
133 for (i = 0; i < SE7724_FPGA_IRQ_NR; i++) 136 if (unlikely(irq != wanted)) {
134 irq_set_chip_and_handler_name(irq_base + i, &se7724_irq_chip, 137 pr_err("%s: got irq %d but wanted %d, bailing.\n",
138 __func__, irq, wanted);
139 destroy_irq(irq);
140 return;
141 }
142
143 irq_set_chip_and_handler_name(irq, &se7724_irq_chip,
135 handle_level_irq, "level"); 144 handle_level_irq, "level");
145 }
136 146
137 irq_set_chained_handler(IRQ0_IRQ, se7724_irq_demux); 147 irq_set_chained_handler(IRQ0_IRQ, se7724_irq_demux);
138 irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW); 148 irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 35f6efa3ac0..d00756728bd 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -18,22 +18,17 @@
18#include <linux/mmc/sh_mobile_sdhi.h> 18#include <linux/mmc/sh_mobile_sdhi.h>
19#include <linux/mtd/physmap.h> 19#include <linux/mtd/physmap.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/regulator/fixed.h>
22#include <linux/regulator/machine.h>
23#include <linux/smc91x.h> 21#include <linux/smc91x.h>
24#include <linux/gpio.h> 22#include <linux/gpio.h>
25#include <linux/input.h> 23#include <linux/input.h>
26#include <linux/input/sh_keysc.h> 24#include <linux/input/sh_keysc.h>
27#include <linux/usb/r8a66597.h> 25#include <linux/usb/r8a66597.h>
28#include <linux/sh_eth.h>
29#include <linux/sh_intc.h>
30#include <linux/videodev2.h>
31#include <video/sh_mobile_lcdc.h> 26#include <video/sh_mobile_lcdc.h>
32#include <media/sh_mobile_ceu.h> 27#include <media/sh_mobile_ceu.h>
33#include <sound/sh_fsi.h> 28#include <sound/sh_fsi.h>
34#include <sound/simple_card.h>
35#include <asm/io.h> 29#include <asm/io.h>
36#include <asm/heartbeat.h> 30#include <asm/heartbeat.h>
31#include <asm/sh_eth.h>
37#include <asm/clock.h> 32#include <asm/clock.h>
38#include <asm/suspend.h> 33#include <asm/suspend.h>
39#include <cpu/sh7724.h> 34#include <cpu/sh7724.h>
@@ -184,12 +179,14 @@ static struct sh_mobile_lcdc_info lcdc_info = {
184 .clock_source = LCDC_CLK_EXTERNAL, 179 .clock_source = LCDC_CLK_EXTERNAL,
185 .ch[0] = { 180 .ch[0] = {
186 .chan = LCDC_CHAN_MAINLCD, 181 .chan = LCDC_CHAN_MAINLCD,
187 .fourcc = V4L2_PIX_FMT_RGB565, 182 .bpp = 16,
188 .clock_divider = 1, 183 .clock_divider = 1,
189 .panel_cfg = { /* 7.0 inch */ 184 .lcd_size_cfg = { /* 7.0 inch */
190 .width = 152, 185 .width = 152,
191 .height = 91, 186 .height = 91,
192 }, 187 },
188 .board_cfg = {
189 },
193 } 190 }
194}; 191};
195 192
@@ -201,7 +198,7 @@ static struct resource lcdc_resources[] = {
201 .flags = IORESOURCE_MEM, 198 .flags = IORESOURCE_MEM,
202 }, 199 },
203 [1] = { 200 [1] = {
204 .start = evt2irq(0xf40), 201 .start = 106,
205 .flags = IORESOURCE_IRQ, 202 .flags = IORESOURCE_IRQ,
206 }, 203 },
207}; 204};
@@ -213,6 +210,9 @@ static struct platform_device lcdc_device = {
213 .dev = { 210 .dev = {
214 .platform_data = &lcdc_info, 211 .platform_data = &lcdc_info,
215 }, 212 },
213 .archdata = {
214 .hwblk_id = HWBLK_LCDC,
215 },
216}; 216};
217 217
218/* CEU0 */ 218/* CEU0 */
@@ -228,7 +228,7 @@ static struct resource ceu0_resources[] = {
228 .flags = IORESOURCE_MEM, 228 .flags = IORESOURCE_MEM,
229 }, 229 },
230 [1] = { 230 [1] = {
231 .start = evt2irq(0x880), 231 .start = 52,
232 .flags = IORESOURCE_IRQ, 232 .flags = IORESOURCE_IRQ,
233 }, 233 },
234 [2] = { 234 [2] = {
@@ -244,6 +244,9 @@ static struct platform_device ceu0_device = {
244 .dev = { 244 .dev = {
245 .platform_data = &sh_mobile_ceu0_info, 245 .platform_data = &sh_mobile_ceu0_info,
246 }, 246 },
247 .archdata = {
248 .hwblk_id = HWBLK_CEU0,
249 },
247}; 250};
248 251
249/* CEU1 */ 252/* CEU1 */
@@ -259,7 +262,7 @@ static struct resource ceu1_resources[] = {
259 .flags = IORESOURCE_MEM, 262 .flags = IORESOURCE_MEM,
260 }, 263 },
261 [1] = { 264 [1] = {
262 .start = evt2irq(0x9e0), 265 .start = 63,
263 .flags = IORESOURCE_IRQ, 266 .flags = IORESOURCE_IRQ,
264 }, 267 },
265 [2] = { 268 [2] = {
@@ -275,14 +278,15 @@ static struct platform_device ceu1_device = {
275 .dev = { 278 .dev = {
276 .platform_data = &sh_mobile_ceu1_info, 279 .platform_data = &sh_mobile_ceu1_info,
277 }, 280 },
281 .archdata = {
282 .hwblk_id = HWBLK_CEU1,
283 },
278}; 284};
279 285
280/* FSI */ 286/* FSI */
281/* change J20, J21, J22 pin to 1-2 connection to use slave mode */ 287/* change J20, J21, J22 pin to 1-2 connection to use slave mode */
282static struct sh_fsi_platform_info fsi_info = { 288static struct sh_fsi_platform_info fsi_info = {
283 .port_a = { 289 .porta_flags = SH_FSI_BRS_INV,
284 .flags = SH_FSI_BRS_INV,
285 },
286}; 290};
287 291
288static struct resource fsi_resources[] = { 292static struct resource fsi_resources[] = {
@@ -293,7 +297,7 @@ static struct resource fsi_resources[] = {
293 .flags = IORESOURCE_MEM, 297 .flags = IORESOURCE_MEM,
294 }, 298 },
295 [1] = { 299 [1] = {
296 .start = evt2irq(0xf80), 300 .start = 108,
297 .flags = IORESOURCE_IRQ, 301 .flags = IORESOURCE_IRQ,
298 }, 302 },
299}; 303};
@@ -306,30 +310,13 @@ static struct platform_device fsi_device = {
306 .dev = { 310 .dev = {
307 .platform_data = &fsi_info, 311 .platform_data = &fsi_info,
308 }, 312 },
309}; 313 .archdata = {
310 314 .hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */
311static struct asoc_simple_dai_init_info fsi2_ak4642_init_info = { 315 },
312 .fmt = SND_SOC_DAIFMT_LEFT_J,
313 .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
314 .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
315 .sysclk = 11289600,
316};
317
318static struct asoc_simple_card_info fsi_ak4642_info = {
319 .name = "AK4642",
320 .card = "FSIA-AK4642",
321 .cpu_dai = "fsia-dai",
322 .codec = "ak4642-codec.0-0012",
323 .platform = "sh_fsi.0",
324 .codec_dai = "ak4642-hifi",
325 .init = &fsi2_ak4642_init_info,
326}; 316};
327 317
328static struct platform_device fsi_ak4642_device = { 318static struct platform_device fsi_ak4642_device = {
329 .name = "asoc-simple-card", 319 .name = "sh_fsi_a_ak4642",
330 .dev = {
331 .platform_data = &fsi_ak4642_info,
332 },
333}; 320};
334 321
335/* KEYSC in SoC (Needs SW33-2 set to ON) */ 322/* KEYSC in SoC (Needs SW33-2 set to ON) */
@@ -355,7 +342,7 @@ static struct resource keysc_resources[] = {
355 .flags = IORESOURCE_MEM, 342 .flags = IORESOURCE_MEM,
356 }, 343 },
357 [1] = { 344 [1] = {
358 .start = evt2irq(0xbe0), 345 .start = 79,
359 .flags = IORESOURCE_IRQ, 346 .flags = IORESOURCE_IRQ,
360 }, 347 },
361}; 348};
@@ -368,6 +355,9 @@ static struct platform_device keysc_device = {
368 .dev = { 355 .dev = {
369 .platform_data = &keysc_info, 356 .platform_data = &keysc_info,
370 }, 357 },
358 .archdata = {
359 .hwblk_id = HWBLK_KEYSC,
360 },
371}; 361};
372 362
373/* SH Eth */ 363/* SH Eth */
@@ -378,7 +368,7 @@ static struct resource sh_eth_resources[] = {
378 .flags = IORESOURCE_MEM, 368 .flags = IORESOURCE_MEM,
379 }, 369 },
380 [1] = { 370 [1] = {
381 .start = evt2irq(0xd60), 371 .start = 91,
382 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 372 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
383 }, 373 },
384}; 374};
@@ -396,6 +386,9 @@ static struct platform_device sh_eth_device = {
396 }, 386 },
397 .num_resources = ARRAY_SIZE(sh_eth_resources), 387 .num_resources = ARRAY_SIZE(sh_eth_resources),
398 .resource = sh_eth_resources, 388 .resource = sh_eth_resources,
389 .archdata = {
390 .hwblk_id = HWBLK_ETHER,
391 },
399}; 392};
400 393
401static struct r8a66597_platdata sh7724_usb0_host_data = { 394static struct r8a66597_platdata sh7724_usb0_host_data = {
@@ -409,8 +402,8 @@ static struct resource sh7724_usb0_host_resources[] = {
409 .flags = IORESOURCE_MEM, 402 .flags = IORESOURCE_MEM,
410 }, 403 },
411 [1] = { 404 [1] = {
412 .start = evt2irq(0xa20), 405 .start = 65,
413 .end = evt2irq(0xa20), 406 .end = 65,
414 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 407 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
415 }, 408 },
416}; 409};
@@ -425,6 +418,9 @@ static struct platform_device sh7724_usb0_host_device = {
425 }, 418 },
426 .num_resources = ARRAY_SIZE(sh7724_usb0_host_resources), 419 .num_resources = ARRAY_SIZE(sh7724_usb0_host_resources),
427 .resource = sh7724_usb0_host_resources, 420 .resource = sh7724_usb0_host_resources,
421 .archdata = {
422 .hwblk_id = HWBLK_USB0,
423 },
428}; 424};
429 425
430static struct r8a66597_platdata sh7724_usb1_gadget_data = { 426static struct r8a66597_platdata sh7724_usb1_gadget_data = {
@@ -438,8 +434,8 @@ static struct resource sh7724_usb1_gadget_resources[] = {
438 .flags = IORESOURCE_MEM, 434 .flags = IORESOURCE_MEM,
439 }, 435 },
440 [1] = { 436 [1] = {
441 .start = evt2irq(0xa40), 437 .start = 66,
442 .end = evt2irq(0xa40), 438 .end = 66,
443 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 439 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
444 }, 440 },
445}; 441};
@@ -456,15 +452,6 @@ static struct platform_device sh7724_usb1_gadget_device = {
456 .resource = sh7724_usb1_gadget_resources, 452 .resource = sh7724_usb1_gadget_resources,
457}; 453};
458 454
459/* Fixed 3.3V regulator to be used by SDHI0, SDHI1 */
460static struct regulator_consumer_supply fixed3v3_power_consumers[] =
461{
462 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
463 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
464 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
465 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
466};
467
468static struct resource sdhi0_cn7_resources[] = { 455static struct resource sdhi0_cn7_resources[] = {
469 [0] = { 456 [0] = {
470 .name = "SDHI0", 457 .name = "SDHI0",
@@ -473,7 +460,7 @@ static struct resource sdhi0_cn7_resources[] = {
473 .flags = IORESOURCE_MEM, 460 .flags = IORESOURCE_MEM,
474 }, 461 },
475 [1] = { 462 [1] = {
476 .start = evt2irq(0xe80), 463 .start = 100,
477 .flags = IORESOURCE_IRQ, 464 .flags = IORESOURCE_IRQ,
478 }, 465 },
479}; 466};
@@ -492,6 +479,9 @@ static struct platform_device sdhi0_cn7_device = {
492 .dev = { 479 .dev = {
493 .platform_data = &sh7724_sdhi0_data, 480 .platform_data = &sh7724_sdhi0_data,
494 }, 481 },
482 .archdata = {
483 .hwblk_id = HWBLK_SDHI0,
484 },
495}; 485};
496 486
497static struct resource sdhi1_cn8_resources[] = { 487static struct resource sdhi1_cn8_resources[] = {
@@ -502,7 +492,7 @@ static struct resource sdhi1_cn8_resources[] = {
502 .flags = IORESOURCE_MEM, 492 .flags = IORESOURCE_MEM,
503 }, 493 },
504 [1] = { 494 [1] = {
505 .start = evt2irq(0x4e0), 495 .start = 23,
506 .flags = IORESOURCE_IRQ, 496 .flags = IORESOURCE_IRQ,
507 }, 497 },
508}; 498};
@@ -521,6 +511,9 @@ static struct platform_device sdhi1_cn8_device = {
521 .dev = { 511 .dev = {
522 .platform_data = &sh7724_sdhi1_data, 512 .platform_data = &sh7724_sdhi1_data,
523 }, 513 },
514 .archdata = {
515 .hwblk_id = HWBLK_SDHI1,
516 },
524}; 517};
525 518
526/* IrDA */ 519/* IrDA */
@@ -532,7 +525,7 @@ static struct resource irda_resources[] = {
532 .flags = IORESOURCE_MEM, 525 .flags = IORESOURCE_MEM,
533 }, 526 },
534 [1] = { 527 [1] = {
535 .start = evt2irq(0x480), 528 .start = 20,
536 .flags = IORESOURCE_IRQ, 529 .flags = IORESOURCE_IRQ,
537 }, 530 },
538}; 531};
@@ -570,7 +563,7 @@ static struct resource sh_vou_resources[] = {
570 .flags = IORESOURCE_MEM, 563 .flags = IORESOURCE_MEM,
571 }, 564 },
572 [1] = { 565 [1] = {
573 .start = evt2irq(0x8e0), 566 .start = 55,
574 .flags = IORESOURCE_IRQ, 567 .flags = IORESOURCE_IRQ,
575 }, 568 },
576}; 569};
@@ -583,6 +576,9 @@ static struct platform_device vou_device = {
583 .dev = { 576 .dev = {
584 .platform_data = &sh_vou_pdata, 577 .platform_data = &sh_vou_pdata,
585 }, 578 },
579 .archdata = {
580 .hwblk_id = HWBLK_VOU,
581 },
586}; 582};
587 583
588static struct platform_device *ms7724se_devices[] __initdata = { 584static struct platform_device *ms7724se_devices[] __initdata = {
@@ -616,7 +612,6 @@ static struct i2c_board_info i2c0_devices[] = {
616#define EEPROM_DATA 0xBA20600C 612#define EEPROM_DATA 0xBA20600C
617#define EEPROM_STAT 0xBA206010 613#define EEPROM_STAT 0xBA206010
618#define EEPROM_STRT 0xBA206014 614#define EEPROM_STRT 0xBA206014
619
620static int __init sh_eth_is_eeprom_ready(void) 615static int __init sh_eth_is_eeprom_ready(void)
621{ 616{
622 int t = 10000; 617 int t = 10000;
@@ -673,6 +668,7 @@ extern char ms7724se_sdram_enter_end;
673extern char ms7724se_sdram_leave_start; 668extern char ms7724se_sdram_leave_start;
674extern char ms7724se_sdram_leave_end; 669extern char ms7724se_sdram_leave_end;
675 670
671
676static int __init arch_setup(void) 672static int __init arch_setup(void)
677{ 673{
678 /* enable I2C device */ 674 /* enable I2C device */
@@ -695,10 +691,6 @@ static int __init devices_setup(void)
695 &ms7724se_sdram_enter_end, 691 &ms7724se_sdram_enter_end,
696 &ms7724se_sdram_leave_start, 692 &ms7724se_sdram_leave_start,
697 &ms7724se_sdram_leave_end); 693 &ms7724se_sdram_leave_end);
698
699 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
700 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
701
702 /* Reset Release */ 694 /* Reset Release */
703 fpga_out = __raw_readw(FPGA_OUT); 695 fpga_out = __raw_readw(FPGA_OUT);
704 /* bit4: NTSC_PDN, bit5: NTSC_RESET */ 696 /* bit4: NTSC_PDN, bit5: NTSC_RESET */
@@ -913,12 +905,12 @@ static int __init devices_setup(void)
913 905
914 if (sw & SW41_B) { 906 if (sw & SW41_B) {
915 /* 720p */ 907 /* 720p */
916 lcdc_info.ch[0].lcd_modes = lcdc_720p_modes; 908 lcdc_info.ch[0].lcd_cfg = lcdc_720p_modes;
917 lcdc_info.ch[0].num_modes = ARRAY_SIZE(lcdc_720p_modes); 909 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(lcdc_720p_modes);
918 } else { 910 } else {
919 /* VGA */ 911 /* VGA */
920 lcdc_info.ch[0].lcd_modes = lcdc_vga_modes; 912 lcdc_info.ch[0].lcd_cfg = lcdc_vga_modes;
921 lcdc_info.ch[0].num_modes = ARRAY_SIZE(lcdc_vga_modes); 913 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(lcdc_vga_modes);
922 } 914 }
923 915
924 if (sw & SW41_A) { 916 if (sw & SW41_A) {
@@ -953,4 +945,5 @@ device_initcall(devices_setup);
953static struct sh_machine_vector mv_ms7724se __initmv = { 945static struct sh_machine_vector mv_ms7724se __initmv = {
954 .mv_name = "ms7724se", 946 .mv_name = "ms7724se",
955 .mv_init_irq = init_se7724_IRQ, 947 .mv_init_irq = init_se7724_IRQ,
948 .mv_nr_irqs = SE7724_FPGA_IRQ_BASE + SE7724_FPGA_IRQ_NR,
956}; 949};
diff --git a/arch/sh/boards/mach-se/7751/setup.c b/arch/sh/boards/mach-se/7751/setup.c
index 820f4e7ba0d..4ed60c5e221 100644
--- a/arch/sh/boards/mach-se/7751/setup.c
+++ b/arch/sh/boards/mach-se/7751/setup.c
@@ -55,5 +55,6 @@ device_initcall(se7751_devices_setup);
55 */ 55 */
56static struct sh_machine_vector mv_7751se __initmv = { 56static struct sh_machine_vector mv_7751se __initmv = {
57 .mv_name = "7751 SolutionEngine", 57 .mv_name = "7751 SolutionEngine",
58 .mv_nr_irqs = 72,
58 .mv_init_irq = init_7751se_IRQ, 59 .mv_init_irq = init_7751se_IRQ,
59}; 60};
diff --git a/arch/sh/boards/mach-se/7780/setup.c b/arch/sh/boards/mach-se/7780/setup.c
index ae5a1d84fdf..6f7c207138e 100644
--- a/arch/sh/boards/mach-se/7780/setup.c
+++ b/arch/sh/boards/mach-se/7780/setup.c
@@ -110,5 +110,6 @@ static void __init se7780_setup(char **cmdline_p)
110static struct sh_machine_vector mv_se7780 __initmv = { 110static struct sh_machine_vector mv_se7780 __initmv = {
111 .mv_name = "Solution Engine 7780" , 111 .mv_name = "Solution Engine 7780" ,
112 .mv_setup = se7780_setup , 112 .mv_setup = se7780_setup ,
113 .mv_nr_irqs = 111 ,
113 .mv_init_irq = init_se7780_IRQ, 114 .mv_init_irq = init_se7780_IRQ,
114}; 115};
diff --git a/arch/sh/boards/mach-se/board-se7619.c b/arch/sh/boards/mach-se/board-se7619.c
index 958bcd7aacc..82b6d4a5dc0 100644
--- a/arch/sh/boards/mach-se/board-se7619.c
+++ b/arch/sh/boards/mach-se/board-se7619.c
@@ -22,5 +22,6 @@ static int se7619_mode_pins(void)
22 22
23static struct sh_machine_vector mv_se __initmv = { 23static struct sh_machine_vector mv_se __initmv = {
24 .mv_name = "SolutionEngine", 24 .mv_name = "SolutionEngine",
25 .mv_nr_irqs = 108,
25 .mv_mode_pins = se7619_mode_pins, 26 .mv_mode_pins = se7619_mode_pins,
26}; 27};
diff --git a/arch/sh/boards/mach-sh03/setup.c b/arch/sh/boards/mach-sh03/setup.c
index f582dab5934..d4f79b2a651 100644
--- a/arch/sh/boards/mach-sh03/setup.c
+++ b/arch/sh/boards/mach-sh03/setup.c
@@ -101,5 +101,6 @@ device_initcall(sh03_devices_setup);
101static struct sh_machine_vector mv_sh03 __initmv = { 101static struct sh_machine_vector mv_sh03 __initmv = {
102 .mv_name = "Interface (CTP/PCI-SH03)", 102 .mv_name = "Interface (CTP/PCI-SH03)",
103 .mv_setup = sh03_setup, 103 .mv_setup = sh03_setup,
104 .mv_nr_irqs = 48,
104 .mv_init_irq = init_sh03_IRQ, 105 .mv_init_irq = init_sh03_IRQ,
105}; 106};
diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c
index b7c75298dfb..f3d828f133e 100644
--- a/arch/sh/boards/mach-sh7763rdp/setup.c
+++ b/arch/sh/boards/mach-sh7763rdp/setup.c
@@ -17,9 +17,8 @@
17#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
18#include <linux/fb.h> 18#include <linux/fb.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/sh_eth.h>
21#include <linux/sh_intc.h>
22#include <mach/sh7763rdp.h> 20#include <mach/sh7763rdp.h>
21#include <asm/sh_eth.h>
23#include <asm/sh7760fb.h> 22#include <asm/sh7760fb.h>
24 23
25/* NOR Flash */ 24/* NOR Flash */
@@ -68,7 +67,7 @@ static struct platform_device sh7763rdp_nor_flash_device = {
68 * SH-Ether 67 * SH-Ether
69 * 68 *
70 * SH Ether of SH7763 has multi IRQ handling. 69 * SH Ether of SH7763 has multi IRQ handling.
71 * (0x920,0x940,0x960 -> 0x920) 70 * (57,58,59 -> 57)
72 */ 71 */
73static struct resource sh_eth_resources[] = { 72static struct resource sh_eth_resources[] = {
74 { 73 {
@@ -80,7 +79,7 @@ static struct resource sh_eth_resources[] = {
80 .end = 0xFEE01FFF, 79 .end = 0xFEE01FFF,
81 .flags = IORESOURCE_MEM, 80 .flags = IORESOURCE_MEM,
82 }, { 81 }, {
83 .start = evt2irq(0x920), /* irq number */ 82 .start = 57, /* irq number */
84 .flags = IORESOURCE_IRQ, 83 .flags = IORESOURCE_IRQ,
85 }, 84 },
86}; 85};
@@ -214,5 +213,6 @@ static void __init sh7763rdp_setup(char **cmdline_p)
214static struct sh_machine_vector mv_sh7763rdp __initmv = { 213static struct sh_machine_vector mv_sh7763rdp __initmv = {
215 .mv_name = "sh7763drp", 214 .mv_name = "sh7763drp",
216 .mv_setup = sh7763rdp_setup, 215 .mv_setup = sh7763rdp_setup,
216 .mv_nr_irqs = 112,
217 .mv_init_irq = init_sh7763rdp_IRQ, 217 .mv_init_irq = init_sh7763rdp_IRQ,
218}; 218};
diff --git a/arch/sh/boards/mach-x3proto/gpio.c b/arch/sh/boards/mach-x3proto/gpio.c
index 3ea65e9b56e..f33b2b57019 100644
--- a/arch/sh/boards/mach-x3proto/gpio.c
+++ b/arch/sh/boards/mach-x3proto/gpio.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Renesas SH-X3 Prototype Baseboard GPIO Support. 4 * Renesas SH-X3 Prototype Baseboard GPIO Support.
5 * 5 *
6 * Copyright (C) 2010 - 2012 Paul Mundt 6 * Copyright (C) 2010 Paul Mundt
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
@@ -17,7 +17,6 @@
17#include <linux/irq.h> 17#include <linux/irq.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/spinlock.h> 19#include <linux/spinlock.h>
20#include <linux/irqdomain.h>
21#include <linux/io.h> 20#include <linux/io.h>
22#include <mach/ilsel.h> 21#include <mach/ilsel.h>
23#include <mach/hardware.h> 22#include <mach/hardware.h>
@@ -27,7 +26,7 @@
27#define KEYDETR 0xb81c0004 26#define KEYDETR 0xb81c0004
28 27
29static DEFINE_SPINLOCK(x3proto_gpio_lock); 28static DEFINE_SPINLOCK(x3proto_gpio_lock);
30static struct irq_domain *x3proto_irq_domain; 29static unsigned int x3proto_gpio_irq_map[NR_BASEBOARD_GPIOS] = { 0, };
31 30
32static int x3proto_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) 31static int x3proto_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
33{ 32{
@@ -50,14 +49,7 @@ static int x3proto_gpio_get(struct gpio_chip *chip, unsigned gpio)
50 49
51static int x3proto_gpio_to_irq(struct gpio_chip *chip, unsigned gpio) 50static int x3proto_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
52{ 51{
53 int virq; 52 return x3proto_gpio_irq_map[gpio];
54
55 if (gpio < chip->ngpio)
56 virq = irq_create_mapping(x3proto_irq_domain, gpio);
57 else
58 virq = -ENXIO;
59
60 return virq;
61} 53}
62 54
63static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) 55static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
@@ -70,8 +62,9 @@ static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
70 chip->irq_mask_ack(data); 62 chip->irq_mask_ack(data);
71 63
72 mask = __raw_readw(KEYDETR); 64 mask = __raw_readw(KEYDETR);
65
73 for_each_set_bit(pin, &mask, NR_BASEBOARD_GPIOS) 66 for_each_set_bit(pin, &mask, NR_BASEBOARD_GPIOS)
74 generic_handle_irq(irq_linear_revmap(x3proto_irq_domain, pin)); 67 generic_handle_irq(x3proto_gpio_to_irq(NULL, pin));
75 68
76 chip->irq_unmask(data); 69 chip->irq_unmask(data);
77} 70}
@@ -85,23 +78,10 @@ struct gpio_chip x3proto_gpio_chip = {
85 .ngpio = NR_BASEBOARD_GPIOS, 78 .ngpio = NR_BASEBOARD_GPIOS,
86}; 79};
87 80
88static int x3proto_gpio_irq_map(struct irq_domain *domain, unsigned int virq,
89 irq_hw_number_t hwirq)
90{
91 irq_set_chip_and_handler_name(virq, &dummy_irq_chip, handle_simple_irq,
92 "gpio");
93
94 return 0;
95}
96
97static struct irq_domain_ops x3proto_gpio_irq_ops = {
98 .map = x3proto_gpio_irq_map,
99 .xlate = irq_domain_xlate_twocell,
100};
101
102int __init x3proto_gpio_setup(void) 81int __init x3proto_gpio_setup(void)
103{ 82{
104 int ilsel, ret; 83 int ilsel;
84 int ret, i;
105 85
106 ilsel = ilsel_enable(ILSEL_KEY); 86 ilsel = ilsel_enable(ILSEL_KEY);
107 if (unlikely(ilsel < 0)) 87 if (unlikely(ilsel < 0))
@@ -111,10 +91,21 @@ int __init x3proto_gpio_setup(void)
111 if (unlikely(ret)) 91 if (unlikely(ret))
112 goto err_gpio; 92 goto err_gpio;
113 93
114 x3proto_irq_domain = irq_domain_add_linear(NULL, NR_BASEBOARD_GPIOS, 94 for (i = 0; i < NR_BASEBOARD_GPIOS; i++) {
115 &x3proto_gpio_irq_ops, NULL); 95 unsigned long flags;
116 if (unlikely(!x3proto_irq_domain)) 96 int irq = create_irq();
117 goto err_irq; 97
98 if (unlikely(irq < 0)) {
99 ret = -EINVAL;
100 goto err_irq;
101 }
102
103 spin_lock_irqsave(&x3proto_gpio_lock, flags);
104 x3proto_gpio_irq_map[i] = irq;
105 irq_set_chip_and_handler_name(irq, &dummy_irq_chip,
106 handle_simple_irq, "gpio");
107 spin_unlock_irqrestore(&x3proto_gpio_lock, flags);
108 }
118 109
119 pr_info("registering '%s' support, handling GPIOs %u -> %u, " 110 pr_info("registering '%s' support, handling GPIOs %u -> %u, "
120 "bound to IRQ %u\n", 111 "bound to IRQ %u\n",
@@ -128,6 +119,10 @@ int __init x3proto_gpio_setup(void)
128 return 0; 119 return 0;
129 120
130err_irq: 121err_irq:
122 for (; i >= 0; --i)
123 if (x3proto_gpio_irq_map[i])
124 destroy_irq(x3proto_gpio_irq_map[i]);
125
131 ret = gpiochip_remove(&x3proto_gpio_chip); 126 ret = gpiochip_remove(&x3proto_gpio_chip);
132 if (unlikely(ret)) 127 if (unlikely(ret))
133 pr_err("Failed deregistering GPIO\n"); 128 pr_err("Failed deregistering GPIO\n");
diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile
index 58592dfa5cb..ba515d80024 100644
--- a/arch/sh/boot/Makefile
+++ b/arch/sh/boot/Makefile
@@ -8,6 +8,8 @@
8# Copyright (C) 1999 Stuart Menefy 8# Copyright (C) 1999 Stuart Menefy
9# 9#
10 10
11MKIMAGE := $(srctree)/scripts/mkuboot.sh
12
11# 13#
12# Assign safe dummy values if these variables are not defined, 14# Assign safe dummy values if these variables are not defined,
13# in order to suppress error message. 15# in order to suppress error message.
@@ -17,7 +19,6 @@ CONFIG_MEMORY_START ?= 0x0c000000
17CONFIG_BOOT_LINK_OFFSET ?= 0x00800000 19CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
18CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000 20CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
19CONFIG_ENTRY_OFFSET ?= 0x00001000 21CONFIG_ENTRY_OFFSET ?= 0x00001000
20CONFIG_PHYSICAL_START ?= $(CONFIG_MEMORY_START)
21 22
22suffix-y := bin 23suffix-y := bin
23suffix-$(CONFIG_KERNEL_GZIP) := gz 24suffix-$(CONFIG_KERNEL_GZIP) := gz
@@ -47,7 +48,7 @@ $(obj)/romimage/vmlinux: $(obj)/zImage FORCE
47 $(Q)$(MAKE) $(build)=$(obj)/romimage $@ 48 $(Q)$(MAKE) $(build)=$(obj)/romimage $@
48 49
49KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \ 50KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
50 $$[$(CONFIG_PHYSICAL_START) & 0x1fffffff]') 51 $$[$(CONFIG_MEMORY_START) & 0x1fffffff]')
51 52
52KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \ 53KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
53 $$[$(CONFIG_PAGE_OFFSET) + \ 54 $$[$(CONFIG_PAGE_OFFSET) + \
@@ -59,8 +60,10 @@ KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \
59 $(KERNEL_MEMORY) + \ 60 $(KERNEL_MEMORY) + \
60 $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]') 61 $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
61 62
62UIMAGE_LOADADDR = $(KERNEL_LOAD) 63quiet_cmd_uimage = UIMAGE $@
63UIMAGE_ENTRYADDR = $(KERNEL_ENTRY) 64 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
65 -C $(2) -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
66 -n 'Linux-$(KERNELRELEASE)' -d $< $@
64 67
65$(obj)/vmlinux.bin: vmlinux FORCE 68$(obj)/vmlinux.bin: vmlinux FORCE
66 $(call if_changed,objcopy) 69 $(call if_changed,objcopy)
@@ -111,5 +114,4 @@ $(obj)/uImage: $(obj)/uImage.$(suffix-y)
111 @echo ' Image $@ is ready' 114 @echo ' Image $@ is ready'
112 115
113export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \ 116export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
114 CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \ 117 CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET KERNEL_MEMORY suffix-y
115 KERNEL_MEMORY suffix-y
diff --git a/arch/sh/cchips/hd6446x/hd64461.c b/arch/sh/cchips/hd6446x/hd64461.c
index e9735616bdc..eb4ea4d44d5 100644
--- a/arch/sh/cchips/hd6446x/hd64461.c
+++ b/arch/sh/cchips/hd6446x/hd64461.c
@@ -73,7 +73,10 @@ static void hd64461_irq_demux(unsigned int irq, struct irq_desc *desc)
73 73
74int __init setup_hd64461(void) 74int __init setup_hd64461(void)
75{ 75{
76 int irq_base, i; 76 int i, nid = cpu_to_node(boot_cpu_data);
77
78 if (!MACH_HD64461)
79 return 0;
77 80
78 printk(KERN_INFO 81 printk(KERN_INFO
79 "HD64461 configured at 0x%x on irq %d(mapped into %d to %d)\n", 82 "HD64461 configured at 0x%x on irq %d(mapped into %d to %d)\n",
@@ -86,15 +89,27 @@ int __init setup_hd64461(void)
86#endif 89#endif
87 __raw_writew(0xffff, HD64461_NIMR); 90 __raw_writew(0xffff, HD64461_NIMR);
88 91
89 irq_base = irq_alloc_descs(HD64461_IRQBASE, HD64461_IRQBASE, 16, -1); 92 /* IRQ 80 -> 95 belongs to HD64461 */
90 if (IS_ERR_VALUE(irq_base)) { 93 for (i = HD64461_IRQBASE; i < HD64461_IRQBASE + 16; i++) {
91 pr_err("%s: failed hooking irqs for HD64461\n", __func__); 94 unsigned int irq;
92 return irq_base; 95
93 } 96 irq = create_irq_nr(i, nid);
94 97 if (unlikely(irq == 0)) {
95 for (i = 0; i < 16; i++) 98 pr_err("%s: failed hooking irq %d for HD64461\n",
96 irq_set_chip_and_handler(irq_base + i, &hd64461_irq_chip, 99 __func__, i);
100 return -EBUSY;
101 }
102
103 if (unlikely(irq != i)) {
104 pr_err("%s: got irq %d but wanted %d, bailing.\n",
105 __func__, irq, i);
106 destroy_irq(irq);
107 return -EINVAL;
108 }
109
110 irq_set_chip_and_handler(i, &hd64461_irq_chip,
97 handle_level_irq); 111 handle_level_irq);
112 }
98 113
99 irq_set_chained_handler(CONFIG_HD64461_IRQ, hd64461_irq_demux); 114 irq_set_chained_handler(CONFIG_HD64461_IRQ, hd64461_irq_demux);
100 irq_set_irq_type(CONFIG_HD64461_IRQ, IRQ_TYPE_LEVEL_LOW); 115 irq_set_irq_type(CONFIG_HD64461_IRQ, IRQ_TYPE_LEVEL_LOW);
diff --git a/arch/sh/configs/apsh4ad0a_defconfig b/arch/sh/configs/apsh4ad0a_defconfig
index 95ae23fcfdd..e7583484cc0 100644
--- a/arch/sh/configs/apsh4ad0a_defconfig
+++ b/arch/sh/configs/apsh4ad0a_defconfig
@@ -11,7 +11,7 @@ CONFIG_CGROUP_FREEZER=y
11CONFIG_CGROUP_DEVICE=y 11CONFIG_CGROUP_DEVICE=y
12CONFIG_CGROUP_CPUACCT=y 12CONFIG_CGROUP_CPUACCT=y
13CONFIG_RESOURCE_COUNTERS=y 13CONFIG_RESOURCE_COUNTERS=y
14CONFIG_CGROUP_MEMCG=y 14CONFIG_CGROUP_MEM_RES_CTLR=y
15CONFIG_BLK_CGROUP=y 15CONFIG_BLK_CGROUP=y
16CONFIG_NAMESPACES=y 16CONFIG_NAMESPACES=y
17CONFIG_BLK_DEV_INITRD=y 17CONFIG_BLK_DEV_INITRD=y
diff --git a/arch/sh/configs/ecovec24_defconfig b/arch/sh/configs/ecovec24_defconfig
index c6c2becdc8a..911e30c9abf 100644
--- a/arch/sh/configs/ecovec24_defconfig
+++ b/arch/sh/configs/ecovec24_defconfig
@@ -112,7 +112,7 @@ CONFIG_USB_MON=y
112CONFIG_USB_R8A66597_HCD=y 112CONFIG_USB_R8A66597_HCD=y
113CONFIG_USB_STORAGE=y 113CONFIG_USB_STORAGE=y
114CONFIG_USB_GADGET=y 114CONFIG_USB_GADGET=y
115CONFIG_USB_MASS_STORAGE=m 115CONFIG_USB_FILE_STORAGE=m
116CONFIG_MMC=y 116CONFIG_MMC=y
117CONFIG_MMC_SPI=y 117CONFIG_MMC_SPI=y
118CONFIG_MMC_SDHI=y 118CONFIG_MMC_SDHI=y
diff --git a/arch/sh/configs/rsk7264_defconfig b/arch/sh/configs/rsk7264_defconfig
deleted file mode 100644
index 1600426224c..00000000000
--- a/arch/sh/configs/rsk7264_defconfig
+++ /dev/null
@@ -1,80 +0,0 @@
1CONFIG_LOCALVERSION="uClinux RSK2+SH7264"
2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y
4CONFIG_BSD_PROCESS_ACCT=y
5CONFIG_IKCONFIG=y
6CONFIG_LOG_BUF_SHIFT=14
7CONFIG_NAMESPACES=y
8CONFIG_SYSFS_DEPRECATED=y
9CONFIG_SYSFS_DEPRECATED_V2=y
10CONFIG_CC_OPTIMIZE_FOR_SIZE=y
11CONFIG_SYSCTL_SYSCALL=y
12CONFIG_KALLSYMS_ALL=y
13CONFIG_EMBEDDED=y
14CONFIG_PERF_COUNTERS=y
15# CONFIG_VM_EVENT_COUNTERS is not set
16CONFIG_SLAB=y
17CONFIG_MMAP_ALLOW_UNINITIALIZED=y
18CONFIG_PROFILING=y
19# CONFIG_LBDAF is not set
20# CONFIG_BLK_DEV_BSG is not set
21CONFIG_PARTITION_ADVANCED=y
22# CONFIG_IOSCHED_DEADLINE is not set
23# CONFIG_IOSCHED_CFQ is not set
24CONFIG_CPU_SUBTYPE_SH7264=y
25CONFIG_MEMORY_START=0x0c000000
26CONFIG_FLATMEM_MANUAL=y
27CONFIG_CPU_BIG_ENDIAN=y
28CONFIG_SH_RSK=y
29# CONFIG_SH_TIMER_MTU2 is not set
30CONFIG_BINFMT_FLAT=y
31CONFIG_NET=y
32CONFIG_INET=y
33CONFIG_IP_PNP=y
34CONFIG_IP_PNP_DHCP=y
35# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
36# CONFIG_INET_XFRM_MODE_TUNNEL is not set
37# CONFIG_INET_XFRM_MODE_BEET is not set
38# CONFIG_INET_LRO is not set
39# CONFIG_INET_DIAG is not set
40# CONFIG_IPV6 is not set
41CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
42# CONFIG_PREVENT_FIRMWARE_BUILD is not set
43# CONFIG_FW_LOADER is not set
44CONFIG_BLK_DEV_LOOP=y
45CONFIG_BLK_DEV_RAM=y
46CONFIG_BLK_DEV_RAM_COUNT=4
47CONFIG_SCSI=y
48CONFIG_BLK_DEV_SD=y
49CONFIG_NETDEVICES=y
50CONFIG_SMSC911X=y
51CONFIG_SMSC_PHY=y
52CONFIG_INPUT_FF_MEMLESS=y
53# CONFIG_INPUT_MOUSEDEV is not set
54# CONFIG_INPUT_KEYBOARD is not set
55# CONFIG_INPUT_MOUSE is not set
56# CONFIG_SERIO is not set
57CONFIG_VT_HW_CONSOLE_BINDING=y
58CONFIG_SERIAL_SH_SCI=y
59CONFIG_SERIAL_SH_SCI_NR_UARTS=8
60CONFIG_SERIAL_SH_SCI_CONSOLE=y
61# CONFIG_HWMON is not set
62CONFIG_USB=y
63CONFIG_USB_DEBUG=y
64CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
65# CONFIG_USB_DEVICE_CLASS is not set
66CONFIG_USB_R8A66597_HCD=y
67CONFIG_USB_STORAGE=y
68CONFIG_USB_STORAGE_DEBUG=y
69CONFIG_USB_LIBUSUAL=y
70CONFIG_EXT2_FS=y
71CONFIG_EXT3_FS=y
72# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
73CONFIG_VFAT_FS=y
74CONFIG_NFS_FS=y
75CONFIG_NFS_V3=y
76CONFIG_ROOT_NFS=y
77CONFIG_NLS_CODEPAGE_437=y
78CONFIG_NLS_ISO8859_1=y
79# CONFIG_ENABLE_MUST_CHECK is not set
80# CONFIG_FTRACE is not set
diff --git a/arch/sh/configs/rsk7269_defconfig b/arch/sh/configs/rsk7269_defconfig
deleted file mode 100644
index 9f062b5837d..00000000000
--- a/arch/sh/configs/rsk7269_defconfig
+++ /dev/null
@@ -1,65 +0,0 @@
1CONFIG_LOG_BUF_SHIFT=14
2CONFIG_CC_OPTIMIZE_FOR_SIZE=y
3CONFIG_EMBEDDED=y
4# CONFIG_VM_EVENT_COUNTERS is not set
5CONFIG_SLAB=y
6# CONFIG_LBDAF is not set
7# CONFIG_BLK_DEV_BSG is not set
8# CONFIG_IOSCHED_DEADLINE is not set
9# CONFIG_IOSCHED_CFQ is not set
10CONFIG_SWAP_IO_SPACE=y
11CONFIG_CPU_SUBTYPE_SH7269=y
12CONFIG_MEMORY_START=0x0c000000
13CONFIG_MEMORY_SIZE=0x02000000
14CONFIG_FLATMEM_MANUAL=y
15CONFIG_CPU_BIG_ENDIAN=y
16CONFIG_SH_RSK=y
17# CONFIG_SH_TIMER_MTU2 is not set
18CONFIG_SH_PCLK_FREQ=66700000
19CONFIG_BINFMT_FLAT=y
20CONFIG_NET=y
21CONFIG_INET=y
22CONFIG_IP_PNP=y
23CONFIG_IP_PNP_DHCP=y
24# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
25# CONFIG_INET_XFRM_MODE_TUNNEL is not set
26# CONFIG_INET_XFRM_MODE_BEET is not set
27# CONFIG_INET_LRO is not set
28# CONFIG_INET_DIAG is not set
29# CONFIG_IPV6 is not set
30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
31# CONFIG_FW_LOADER is not set
32CONFIG_SCSI=y
33CONFIG_BLK_DEV_SD=y
34CONFIG_NETDEVICES=y
35CONFIG_SMSC911X=y
36CONFIG_SMSC_PHY=y
37# CONFIG_INPUT_MOUSEDEV is not set
38# CONFIG_INPUT_KEYBOARD is not set
39# CONFIG_INPUT_MOUSE is not set
40# CONFIG_SERIO is not set
41CONFIG_SERIAL_SH_SCI=y
42CONFIG_SERIAL_SH_SCI_NR_UARTS=8
43CONFIG_SERIAL_SH_SCI_CONSOLE=y
44# CONFIG_HWMON is not set
45CONFIG_USB=y
46CONFIG_USB_DEBUG=y
47CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
48# CONFIG_USB_DEVICE_CLASS is not set
49CONFIG_USB_R8A66597_HCD=y
50CONFIG_USB_STORAGE=y
51CONFIG_USB_STORAGE_DEBUG=y
52CONFIG_USB_LIBUSUAL=y
53CONFIG_EXT2_FS=y
54CONFIG_EXT3_FS=y
55# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
56CONFIG_VFAT_FS=y
57CONFIG_NFS_FS=y
58CONFIG_NFS_V3=y
59CONFIG_ROOT_NFS=y
60CONFIG_PARTITION_ADVANCED=y
61CONFIG_NLS_CODEPAGE_437=y
62CONFIG_NLS_ISO8859_1=y
63# CONFIG_ENABLE_MUST_CHECK is not set
64CONFIG_SYSCTL_SYSCALL_CHECK=y
65# CONFIG_FTRACE is not set
diff --git a/arch/sh/configs/sdk7786_defconfig b/arch/sh/configs/sdk7786_defconfig
index 76a76a295d7..8a7dd7b59c5 100644
--- a/arch/sh/configs/sdk7786_defconfig
+++ b/arch/sh/configs/sdk7786_defconfig
@@ -18,8 +18,8 @@ CONFIG_CPUSETS=y
18# CONFIG_PROC_PID_CPUSET is not set 18# CONFIG_PROC_PID_CPUSET is not set
19CONFIG_CGROUP_CPUACCT=y 19CONFIG_CGROUP_CPUACCT=y
20CONFIG_RESOURCE_COUNTERS=y 20CONFIG_RESOURCE_COUNTERS=y
21CONFIG_CGROUP_MEMCG=y 21CONFIG_CGROUP_MEM_RES_CTLR=y
22CONFIG_CGROUP_MEMCG_SWAP=y 22CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
23CONFIG_CGROUP_SCHED=y 23CONFIG_CGROUP_SCHED=y
24CONFIG_RT_GROUP_SCHED=y 24CONFIG_RT_GROUP_SCHED=y
25CONFIG_BLK_CGROUP=y 25CONFIG_BLK_CGROUP=y
diff --git a/arch/sh/configs/se7206_defconfig b/arch/sh/configs/se7206_defconfig
index 6bc30ab9fd1..72c3fad7383 100644
--- a/arch/sh/configs/se7206_defconfig
+++ b/arch/sh/configs/se7206_defconfig
@@ -11,7 +11,7 @@ CONFIG_CGROUP_DEBUG=y
11CONFIG_CGROUP_DEVICE=y 11CONFIG_CGROUP_DEVICE=y
12CONFIG_CGROUP_CPUACCT=y 12CONFIG_CGROUP_CPUACCT=y
13CONFIG_RESOURCE_COUNTERS=y 13CONFIG_RESOURCE_COUNTERS=y
14CONFIG_CGROUP_MEMCG=y 14CONFIG_CGROUP_MEM_RES_CTLR=y
15CONFIG_RELAY=y 15CONFIG_RELAY=y
16CONFIG_NAMESPACES=y 16CONFIG_NAMESPACES=y
17CONFIG_UTS_NS=y 17CONFIG_UTS_NS=y
diff --git a/arch/sh/configs/se7724_defconfig b/arch/sh/configs/se7724_defconfig
index 1faa788aeca..ed35093e375 100644
--- a/arch/sh/configs/se7724_defconfig
+++ b/arch/sh/configs/se7724_defconfig
@@ -109,7 +109,7 @@ CONFIG_USB_STORAGE=y
109CONFIG_USB_GADGET=y 109CONFIG_USB_GADGET=y
110CONFIG_USB_ETH=m 110CONFIG_USB_ETH=m
111CONFIG_USB_GADGETFS=m 111CONFIG_USB_GADGETFS=m
112CONFIG_USB_MASS_STORAGE=m 112CONFIG_USB_FILE_STORAGE=m
113CONFIG_USB_G_SERIAL=m 113CONFIG_USB_G_SERIAL=m
114CONFIG_MMC=y 114CONFIG_MMC=y
115CONFIG_MMC_SPI=y 115CONFIG_MMC_SPI=y
diff --git a/arch/sh/configs/sh7785lcr_32bit_defconfig b/arch/sh/configs/sh7785lcr_32bit_defconfig
index 9bdcf72ec06..7b9c696ac5e 100644
--- a/arch/sh/configs/sh7785lcr_32bit_defconfig
+++ b/arch/sh/configs/sh7785lcr_32bit_defconfig
@@ -5,7 +5,7 @@ CONFIG_BSD_PROCESS_ACCT=y
5CONFIG_IKCONFIG=y 5CONFIG_IKCONFIG=y
6CONFIG_IKCONFIG_PROC=y 6CONFIG_IKCONFIG_PROC=y
7CONFIG_LOG_BUF_SHIFT=16 7CONFIG_LOG_BUF_SHIFT=16
8CONFIG_PERF_EVENTS=y 8CONFIG_PERF_COUNTERS=y
9# CONFIG_COMPAT_BRK is not set 9# CONFIG_COMPAT_BRK is not set
10CONFIG_SLAB=y 10CONFIG_SLAB=y
11CONFIG_PROFILING=y 11CONFIG_PROFILING=y
diff --git a/arch/sh/configs/shx3_defconfig b/arch/sh/configs/shx3_defconfig
index cd6c519f8fa..6bb41303689 100644
--- a/arch/sh/configs/shx3_defconfig
+++ b/arch/sh/configs/shx3_defconfig
@@ -13,7 +13,7 @@ CONFIG_CGROUP_FREEZER=y
13CONFIG_CGROUP_DEVICE=y 13CONFIG_CGROUP_DEVICE=y
14CONFIG_CGROUP_CPUACCT=y 14CONFIG_CGROUP_CPUACCT=y
15CONFIG_RESOURCE_COUNTERS=y 15CONFIG_RESOURCE_COUNTERS=y
16CONFIG_CGROUP_MEMCG=y 16CONFIG_CGROUP_MEM_RES_CTLR=y
17CONFIG_RELAY=y 17CONFIG_RELAY=y
18CONFIG_NAMESPACES=y 18CONFIG_NAMESPACES=y
19CONFIG_UTS_NS=y 19CONFIG_UTS_NS=y
diff --git a/arch/sh/configs/urquell_defconfig b/arch/sh/configs/urquell_defconfig
index d7f89be9f47..8bfa4d056d7 100644
--- a/arch/sh/configs/urquell_defconfig
+++ b/arch/sh/configs/urquell_defconfig
@@ -15,8 +15,8 @@ CONFIG_CPUSETS=y
15# CONFIG_PROC_PID_CPUSET is not set 15# CONFIG_PROC_PID_CPUSET is not set
16CONFIG_CGROUP_CPUACCT=y 16CONFIG_CGROUP_CPUACCT=y
17CONFIG_RESOURCE_COUNTERS=y 17CONFIG_RESOURCE_COUNTERS=y
18CONFIG_CGROUP_MEMCG=y 18CONFIG_CGROUP_MEM_RES_CTLR=y
19CONFIG_CGROUP_MEMCG_SWAP=y 19CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
20CONFIG_CGROUP_SCHED=y 20CONFIG_CGROUP_SCHED=y
21CONFIG_RT_GROUP_SCHED=y 21CONFIG_RT_GROUP_SCHED=y
22CONFIG_BLK_DEV_INITRD=y 22CONFIG_BLK_DEV_INITRD=y
diff --git a/arch/sh/drivers/dma/Kconfig b/arch/sh/drivers/dma/Kconfig
index cfd5b90a862..4d58eb0973d 100644
--- a/arch/sh/drivers/dma/Kconfig
+++ b/arch/sh/drivers/dma/Kconfig
@@ -40,6 +40,23 @@ config NR_ONCHIP_DMA_CHANNELS
40 DMAC supports. This will be 4 for SH7750/SH7751/Sh7750S/SH7091 and 8 for the 40 DMAC supports. This will be 4 for SH7750/SH7751/Sh7750S/SH7091 and 8 for the
41 SH7750R/SH7751R/SH7760, 12 for the SH7723/SH7780/SH7785/SH7724, default is 6. 41 SH7750R/SH7751R/SH7760, 12 for the SH7723/SH7780/SH7785/SH7724, default is 6.
42 42
43config NR_DMA_CHANNELS_BOOL
44 depends on SH_DMA
45 bool "Override default number of maximum DMA channels"
46 help
47 This allows you to forcibly update the maximum number of supported
48 DMA channels for a given board. If this is unset, this will default
49 to the number of channels that the on-chip DMAC has.
50
51config NR_DMA_CHANNELS
52 int "Maximum number of DMA channels"
53 depends on SH_DMA && NR_DMA_CHANNELS_BOOL
54 default NR_ONCHIP_DMA_CHANNELS
55 help
56 This allows you to specify the maximum number of DMA channels to
57 support. Setting this to a higher value allows for cascading DMACs
58 with additional channels.
59
43config SH_DMABRG 60config SH_DMABRG
44 bool "SH7760 DMABRG support" 61 bool "SH7760 DMABRG support"
45 depends on CPU_SUBTYPE_SH7760 62 depends on CPU_SUBTYPE_SH7760
diff --git a/arch/sh/drivers/dma/dma-g2.c b/arch/sh/drivers/dma/dma-g2.c
index e1ab6eb3c04..af7bb589c2c 100644
--- a/arch/sh/drivers/dma/dma-g2.c
+++ b/arch/sh/drivers/dma/dma-g2.c
@@ -170,7 +170,7 @@ static int __init g2_dma_init(void)
170{ 170{
171 int ret; 171 int ret;
172 172
173 ret = request_irq(HW_EVENT_G2_DMA, g2_dma_interrupt, 0, 173 ret = request_irq(HW_EVENT_G2_DMA, g2_dma_interrupt, IRQF_DISABLED,
174 "g2 DMA handler", &g2_dma_info); 174 "g2 DMA handler", &g2_dma_info);
175 if (unlikely(ret)) 175 if (unlikely(ret))
176 return -EINVAL; 176 return -EINVAL;
@@ -181,14 +181,14 @@ static int __init g2_dma_init(void)
181 181
182 ret = register_dmac(&g2_dma_info); 182 ret = register_dmac(&g2_dma_info);
183 if (unlikely(ret != 0)) 183 if (unlikely(ret != 0))
184 free_irq(HW_EVENT_G2_DMA, &g2_dma_info); 184 free_irq(HW_EVENT_G2_DMA, 0);
185 185
186 return ret; 186 return ret;
187} 187}
188 188
189static void __exit g2_dma_exit(void) 189static void __exit g2_dma_exit(void)
190{ 190{
191 free_irq(HW_EVENT_G2_DMA, &g2_dma_info); 191 free_irq(HW_EVENT_G2_DMA, 0);
192 unregister_dmac(&g2_dma_info); 192 unregister_dmac(&g2_dma_info);
193} 193}
194 194
diff --git a/arch/sh/drivers/dma/dma-pvr2.c b/arch/sh/drivers/dma/dma-pvr2.c
index 706a3434af7..3cee58e7f1e 100644
--- a/arch/sh/drivers/dma/dma-pvr2.c
+++ b/arch/sh/drivers/dma/dma-pvr2.c
@@ -70,6 +70,7 @@ static int pvr2_xfer_dma(struct dma_channel *chan)
70static struct irqaction pvr2_dma_irq = { 70static struct irqaction pvr2_dma_irq = {
71 .name = "pvr2 DMA handler", 71 .name = "pvr2 DMA handler",
72 .handler = pvr2_dma_interrupt, 72 .handler = pvr2_dma_interrupt,
73 .flags = IRQF_DISABLED,
73}; 74};
74 75
75static struct dma_ops pvr2_dma_ops = { 76static struct dma_ops pvr2_dma_ops = {
diff --git a/arch/sh/drivers/dma/dma-sh.c b/arch/sh/drivers/dma/dma-sh.c
index b2256562314..827208781ed 100644
--- a/arch/sh/drivers/dma/dma-sh.c
+++ b/arch/sh/drivers/dma/dma-sh.c
@@ -14,72 +14,35 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/io.h>
18#include <mach-dreamcast/mach/dma.h> 17#include <mach-dreamcast/mach/dma.h>
19#include <asm/dma.h> 18#include <asm/dma.h>
20#include <asm/dma-register.h> 19#include <asm/io.h>
21#include <cpu/dma-register.h> 20#include <asm/dma-sh.h>
22#include <cpu/dma.h>
23 21
24/* 22#if defined(DMAE1_IRQ)
25 * Define the default configuration for dual address memory-memory transfer. 23#define NR_DMAE 2
26 * The 0x400 value represents auto-request, external->external.
27 */
28#define RS_DUAL (DM_INC | SM_INC | 0x400 | TS_INDEX2VAL(XMIT_SZ_32BIT))
29
30static unsigned long dma_find_base(unsigned int chan)
31{
32 unsigned long base = SH_DMAC_BASE0;
33
34#ifdef SH_DMAC_BASE1
35 if (chan >= 6)
36 base = SH_DMAC_BASE1;
37#endif
38
39 return base;
40}
41
42static unsigned long dma_base_addr(unsigned int chan)
43{
44 unsigned long base = dma_find_base(chan);
45
46 /* Normalize offset calculation */
47 if (chan >= 9)
48 chan -= 6;
49 if (chan >= 4)
50 base += 0x10;
51
52 return base + (chan * 0x10);
53}
54
55#ifdef CONFIG_SH_DMA_IRQ_MULTI
56static inline unsigned int get_dmte_irq(unsigned int chan)
57{
58 return chan >= 6 ? DMTE6_IRQ : DMTE0_IRQ;
59}
60#else 24#else
61 25#define NR_DMAE 1
62static unsigned int dmte_irq_map[] = {
63 DMTE0_IRQ, DMTE0_IRQ + 1, DMTE0_IRQ + 2, DMTE0_IRQ + 3,
64
65#ifdef DMTE4_IRQ
66 DMTE4_IRQ, DMTE4_IRQ + 1,
67#endif
68
69#ifdef DMTE6_IRQ
70 DMTE6_IRQ, DMTE6_IRQ + 1,
71#endif 26#endif
72 27
73#ifdef DMTE8_IRQ 28static const char *dmae_name[] = {
74 DMTE8_IRQ, DMTE9_IRQ, DMTE10_IRQ, DMTE11_IRQ, 29 "DMAC Address Error0", "DMAC Address Error1"
75#endif
76}; 30};
77 31
78static inline unsigned int get_dmte_irq(unsigned int chan) 32static inline unsigned int get_dmte_irq(unsigned int chan)
79{ 33{
80 return dmte_irq_map[chan]; 34 unsigned int irq = 0;
81} 35 if (chan < ARRAY_SIZE(dmte_irq_map))
36 irq = dmte_irq_map[chan];
37
38#if defined(CONFIG_SH_DMA_IRQ_MULTI)
39 if (irq > DMTE6_IRQ)
40 return DMTE6_IRQ;
41 return DMTE0_IRQ;
42#else
43 return irq;
82#endif 44#endif
45}
83 46
84/* 47/*
85 * We determine the correct shift size based off of the CHCR transmit size 48 * We determine the correct shift size based off of the CHCR transmit size
@@ -90,10 +53,9 @@ static inline unsigned int get_dmte_irq(unsigned int chan)
90 * iterations to complete the transfer. 53 * iterations to complete the transfer.
91 */ 54 */
92static unsigned int ts_shift[] = TS_SHIFT; 55static unsigned int ts_shift[] = TS_SHIFT;
93
94static inline unsigned int calc_xmit_shift(struct dma_channel *chan) 56static inline unsigned int calc_xmit_shift(struct dma_channel *chan)
95{ 57{
96 u32 chcr = __raw_readl(dma_base_addr(chan->chan) + CHCR); 58 u32 chcr = __raw_readl(dma_base_addr[chan->chan] + CHCR);
97 int cnt = ((chcr & CHCR_TS_LOW_MASK) >> CHCR_TS_LOW_SHIFT) | 59 int cnt = ((chcr & CHCR_TS_LOW_MASK) >> CHCR_TS_LOW_SHIFT) |
98 ((chcr & CHCR_TS_HIGH_MASK) >> CHCR_TS_HIGH_SHIFT); 60 ((chcr & CHCR_TS_HIGH_MASK) >> CHCR_TS_HIGH_SHIFT);
99 61
@@ -111,13 +73,13 @@ static irqreturn_t dma_tei(int irq, void *dev_id)
111 struct dma_channel *chan = dev_id; 73 struct dma_channel *chan = dev_id;
112 u32 chcr; 74 u32 chcr;
113 75
114 chcr = __raw_readl(dma_base_addr(chan->chan) + CHCR); 76 chcr = __raw_readl(dma_base_addr[chan->chan] + CHCR);
115 77
116 if (!(chcr & CHCR_TE)) 78 if (!(chcr & CHCR_TE))
117 return IRQ_NONE; 79 return IRQ_NONE;
118 80
119 chcr &= ~(CHCR_IE | CHCR_DE); 81 chcr &= ~(CHCR_IE | CHCR_DE);
120 __raw_writel(chcr, (dma_base_addr(chan->chan) + CHCR)); 82 __raw_writel(chcr, (dma_base_addr[chan->chan] + CHCR));
121 83
122 wake_up(&chan->wait_queue); 84 wake_up(&chan->wait_queue);
123 85
@@ -129,8 +91,13 @@ static int sh_dmac_request_dma(struct dma_channel *chan)
129 if (unlikely(!(chan->flags & DMA_TEI_CAPABLE))) 91 if (unlikely(!(chan->flags & DMA_TEI_CAPABLE)))
130 return 0; 92 return 0;
131 93
132 return request_irq(get_dmte_irq(chan->chan), dma_tei, IRQF_SHARED, 94 return request_irq(get_dmte_irq(chan->chan), dma_tei,
133 chan->dev_id, chan); 95#if defined(CONFIG_SH_DMA_IRQ_MULTI)
96 IRQF_SHARED,
97#else
98 IRQF_DISABLED,
99#endif
100 chan->dev_id, chan);
134} 101}
135 102
136static void sh_dmac_free_dma(struct dma_channel *chan) 103static void sh_dmac_free_dma(struct dma_channel *chan)
@@ -151,7 +118,7 @@ sh_dmac_configure_channel(struct dma_channel *chan, unsigned long chcr)
151 chan->flags &= ~DMA_TEI_CAPABLE; 118 chan->flags &= ~DMA_TEI_CAPABLE;
152 } 119 }
153 120
154 __raw_writel(chcr, (dma_base_addr(chan->chan) + CHCR)); 121 __raw_writel(chcr, (dma_base_addr[chan->chan] + CHCR));
155 122
156 chan->flags |= DMA_CONFIGURED; 123 chan->flags |= DMA_CONFIGURED;
157 return 0; 124 return 0;
@@ -162,13 +129,13 @@ static void sh_dmac_enable_dma(struct dma_channel *chan)
162 int irq; 129 int irq;
163 u32 chcr; 130 u32 chcr;
164 131
165 chcr = __raw_readl(dma_base_addr(chan->chan) + CHCR); 132 chcr = __raw_readl(dma_base_addr[chan->chan] + CHCR);
166 chcr |= CHCR_DE; 133 chcr |= CHCR_DE;
167 134
168 if (chan->flags & DMA_TEI_CAPABLE) 135 if (chan->flags & DMA_TEI_CAPABLE)
169 chcr |= CHCR_IE; 136 chcr |= CHCR_IE;
170 137
171 __raw_writel(chcr, (dma_base_addr(chan->chan) + CHCR)); 138 __raw_writel(chcr, (dma_base_addr[chan->chan] + CHCR));
172 139
173 if (chan->flags & DMA_TEI_CAPABLE) { 140 if (chan->flags & DMA_TEI_CAPABLE) {
174 irq = get_dmte_irq(chan->chan); 141 irq = get_dmte_irq(chan->chan);
@@ -186,9 +153,9 @@ static void sh_dmac_disable_dma(struct dma_channel *chan)
186 disable_irq(irq); 153 disable_irq(irq);
187 } 154 }
188 155
189 chcr = __raw_readl(dma_base_addr(chan->chan) + CHCR); 156 chcr = __raw_readl(dma_base_addr[chan->chan] + CHCR);
190 chcr &= ~(CHCR_DE | CHCR_TE | CHCR_IE); 157 chcr &= ~(CHCR_DE | CHCR_TE | CHCR_IE);
191 __raw_writel(chcr, (dma_base_addr(chan->chan) + CHCR)); 158 __raw_writel(chcr, (dma_base_addr[chan->chan] + CHCR));
192} 159}
193 160
194static int sh_dmac_xfer_dma(struct dma_channel *chan) 161static int sh_dmac_xfer_dma(struct dma_channel *chan)
@@ -219,13 +186,13 @@ static int sh_dmac_xfer_dma(struct dma_channel *chan)
219 */ 186 */
220 if (chan->sar || (mach_is_dreamcast() && 187 if (chan->sar || (mach_is_dreamcast() &&
221 chan->chan == PVR2_CASCADE_CHAN)) 188 chan->chan == PVR2_CASCADE_CHAN))
222 __raw_writel(chan->sar, (dma_base_addr(chan->chan) + SAR)); 189 __raw_writel(chan->sar, (dma_base_addr[chan->chan]+SAR));
223 if (chan->dar || (mach_is_dreamcast() && 190 if (chan->dar || (mach_is_dreamcast() &&
224 chan->chan == PVR2_CASCADE_CHAN)) 191 chan->chan == PVR2_CASCADE_CHAN))
225 __raw_writel(chan->dar, (dma_base_addr(chan->chan) + DAR)); 192 __raw_writel(chan->dar, (dma_base_addr[chan->chan] + DAR));
226 193
227 __raw_writel(chan->count >> calc_xmit_shift(chan), 194 __raw_writel(chan->count >> calc_xmit_shift(chan),
228 (dma_base_addr(chan->chan) + TCR)); 195 (dma_base_addr[chan->chan] + TCR));
229 196
230 sh_dmac_enable_dma(chan); 197 sh_dmac_enable_dma(chan);
231 198
@@ -234,32 +201,13 @@ static int sh_dmac_xfer_dma(struct dma_channel *chan)
234 201
235static int sh_dmac_get_dma_residue(struct dma_channel *chan) 202static int sh_dmac_get_dma_residue(struct dma_channel *chan)
236{ 203{
237 if (!(__raw_readl(dma_base_addr(chan->chan) + CHCR) & CHCR_DE)) 204 if (!(__raw_readl(dma_base_addr[chan->chan] + CHCR) & CHCR_DE))
238 return 0; 205 return 0;
239 206
240 return __raw_readl(dma_base_addr(chan->chan) + TCR) 207 return __raw_readl(dma_base_addr[chan->chan] + TCR)
241 << calc_xmit_shift(chan); 208 << calc_xmit_shift(chan);
242} 209}
243 210
244/*
245 * DMAOR handling
246 */
247#if defined(CONFIG_CPU_SUBTYPE_SH7723) || \
248 defined(CONFIG_CPU_SUBTYPE_SH7724) || \
249 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
250 defined(CONFIG_CPU_SUBTYPE_SH7785)
251#define NR_DMAOR 2
252#else
253#define NR_DMAOR 1
254#endif
255
256/*
257 * DMAOR bases are broken out amongst channel groups. DMAOR0 manages
258 * channels 0 - 5, DMAOR1 6 - 11 (optional).
259 */
260#define dmaor_read_reg(n) __raw_readw(dma_find_base((n)*6))
261#define dmaor_write_reg(n, data) __raw_writew(data, dma_find_base(n)*6)
262
263static inline int dmaor_reset(int no) 211static inline int dmaor_reset(int no)
264{ 212{
265 unsigned long dmaor = dmaor_read_reg(no); 213 unsigned long dmaor = dmaor_read_reg(no);
@@ -280,86 +228,36 @@ static inline int dmaor_reset(int no)
280 return 0; 228 return 0;
281} 229}
282 230
283/* 231#if defined(CONFIG_CPU_SH4)
284 * DMAE handling
285 */
286#ifdef CONFIG_CPU_SH4
287
288#if defined(DMAE1_IRQ)
289#define NR_DMAE 2
290#else
291#define NR_DMAE 1
292#endif
293
294static const char *dmae_name[] = {
295 "DMAC Address Error0",
296 "DMAC Address Error1"
297};
298
299#ifdef CONFIG_SH_DMA_IRQ_MULTI
300static inline unsigned int get_dma_error_irq(int n)
301{
302 return get_dmte_irq(n * 6);
303}
304#else
305
306static unsigned int dmae_irq_map[] = {
307 DMAE0_IRQ,
308
309#ifdef DMAE1_IRQ
310 DMAE1_IRQ,
311#endif
312};
313
314static inline unsigned int get_dma_error_irq(int n)
315{
316 return dmae_irq_map[n];
317}
318#endif
319
320static irqreturn_t dma_err(int irq, void *dummy) 232static irqreturn_t dma_err(int irq, void *dummy)
321{ 233{
322 int i; 234#if defined(CONFIG_SH_DMA_IRQ_MULTI)
323 235 int cnt = 0;
324 for (i = 0; i < NR_DMAOR; i++) 236 switch (irq) {
325 dmaor_reset(i); 237#if defined(DMTE6_IRQ) && defined(DMAE1_IRQ)
326 238 case DMTE6_IRQ:
327 disable_irq(irq); 239 cnt++;
328 240#endif
329 return IRQ_HANDLED; 241 case DMTE0_IRQ:
330} 242 if (dmaor_read_reg(cnt) & (DMAOR_NMIF | DMAOR_AE)) {
331 243 disable_irq(irq);
332static int dmae_irq_init(void) 244 /* DMA multi and error IRQ */
333{ 245 return IRQ_HANDLED;
334 int n;
335
336 for (n = 0; n < NR_DMAE; n++) {
337 int i = request_irq(get_dma_error_irq(n), dma_err,
338 IRQF_SHARED, dmae_name[n], (void *)dmae_name[n]);
339 if (unlikely(i < 0)) {
340 printk(KERN_ERR "%s request_irq fail\n", dmae_name[n]);
341 return i;
342 } 246 }
247 default:
248 return IRQ_NONE;
343 } 249 }
344
345 return 0;
346}
347
348static void dmae_irq_free(void)
349{
350 int n;
351
352 for (n = 0; n < NR_DMAE; n++)
353 free_irq(get_dma_error_irq(n), NULL);
354}
355#else 250#else
356static inline int dmae_irq_init(void) 251 dmaor_reset(0);
357{ 252#if defined(CONFIG_CPU_SUBTYPE_SH7723) || \
358 return 0; 253 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
359} 254 defined(CONFIG_CPU_SUBTYPE_SH7785)
255 dmaor_reset(1);
256#endif
257 disable_irq(irq);
360 258
361static void dmae_irq_free(void) 259 return IRQ_HANDLED;
362{ 260#endif
363} 261}
364#endif 262#endif
365 263
@@ -378,34 +276,72 @@ static struct dma_info sh_dmac_info = {
378 .flags = DMAC_CHANNELS_TEI_CAPABLE, 276 .flags = DMAC_CHANNELS_TEI_CAPABLE,
379}; 277};
380 278
279#ifdef CONFIG_CPU_SH4
280static unsigned int get_dma_error_irq(int n)
281{
282#if defined(CONFIG_SH_DMA_IRQ_MULTI)
283 return (n == 0) ? get_dmte_irq(0) : get_dmte_irq(6);
284#else
285 return (n == 0) ? DMAE0_IRQ :
286#if defined(DMAE1_IRQ)
287 DMAE1_IRQ;
288#else
289 -1;
290#endif
291#endif
292}
293#endif
294
381static int __init sh_dmac_init(void) 295static int __init sh_dmac_init(void)
382{ 296{
383 struct dma_info *info = &sh_dmac_info; 297 struct dma_info *info = &sh_dmac_info;
384 int i, rc; 298 int i;
385 299
386 /* 300#ifdef CONFIG_CPU_SH4
387 * Initialize DMAE, for parts that support it. 301 int n;
388 */ 302
389 rc = dmae_irq_init(); 303 for (n = 0; n < NR_DMAE; n++) {
390 if (unlikely(rc != 0)) 304 i = request_irq(get_dma_error_irq(n), dma_err,
391 return rc; 305#if defined(CONFIG_SH_DMA_IRQ_MULTI)
306 IRQF_SHARED,
307#else
308 IRQF_DISABLED,
309#endif
310 dmae_name[n], (void *)dmae_name[n]);
311 if (unlikely(i < 0)) {
312 printk(KERN_ERR "%s request_irq fail\n", dmae_name[n]);
313 return i;
314 }
315 }
316#endif /* CONFIG_CPU_SH4 */
392 317
393 /* 318 /*
394 * Initialize DMAOR, and clean up any error flags that may have 319 * Initialize DMAOR, and clean up any error flags that may have
395 * been set. 320 * been set.
396 */ 321 */
397 for (i = 0; i < NR_DMAOR; i++) { 322 i = dmaor_reset(0);
398 rc = dmaor_reset(i); 323 if (unlikely(i != 0))
399 if (unlikely(rc != 0)) 324 return i;
400 return rc; 325#if defined(CONFIG_CPU_SUBTYPE_SH7723) || \
401 } 326 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
327 defined(CONFIG_CPU_SUBTYPE_SH7785)
328 i = dmaor_reset(1);
329 if (unlikely(i != 0))
330 return i;
331#endif
402 332
403 return register_dmac(info); 333 return register_dmac(info);
404} 334}
405 335
406static void __exit sh_dmac_exit(void) 336static void __exit sh_dmac_exit(void)
407{ 337{
408 dmae_irq_free(); 338#ifdef CONFIG_CPU_SH4
339 int n;
340
341 for (n = 0; n < NR_DMAE; n++) {
342 free_irq(get_dma_error_irq(n), (void *)dmae_name[n]);
343 }
344#endif /* CONFIG_CPU_SH4 */
409 unregister_dmac(&sh_dmac_info); 345 unregister_dmac(&sh_dmac_info);
410} 346}
411 347
diff --git a/arch/sh/drivers/dma/dma-sysfs.c b/arch/sh/drivers/dma/dma-sysfs.c
index 4b15feda54b..1ee631d3725 100644
--- a/arch/sh/drivers/dma/dma-sysfs.c
+++ b/arch/sh/drivers/dma/dma-sysfs.c
@@ -11,25 +11,23 @@
11 */ 11 */
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/stat.h> 14#include <linux/sysdev.h>
15#include <linux/device.h>
16#include <linux/platform_device.h> 15#include <linux/platform_device.h>
17#include <linux/err.h> 16#include <linux/err.h>
18#include <linux/string.h> 17#include <linux/string.h>
19#include <asm/dma.h> 18#include <asm/dma.h>
20 19
21static struct bus_type dma_subsys = { 20static struct sysdev_class dma_sysclass = {
22 .name = "dma", 21 .name = "dma",
23 .dev_name = "dma",
24}; 22};
25 23
26static ssize_t dma_show_devices(struct device *dev, 24static ssize_t dma_show_devices(struct sys_device *dev,
27 struct device_attribute *attr, char *buf) 25 struct sysdev_attribute *attr, char *buf)
28{ 26{
29 ssize_t len = 0; 27 ssize_t len = 0;
30 int i; 28 int i;
31 29
32 for (i = 0; i < 16; i++) { 30 for (i = 0; i < MAX_DMA_CHANNELS; i++) {
33 struct dma_info *info = get_dma_info(i); 31 struct dma_info *info = get_dma_info(i);
34 struct dma_channel *channel = get_dma_channel(i); 32 struct dma_channel *channel = get_dma_channel(i);
35 33
@@ -44,29 +42,29 @@ static ssize_t dma_show_devices(struct device *dev,
44 return len; 42 return len;
45} 43}
46 44
47static DEVICE_ATTR(devices, S_IRUGO, dma_show_devices, NULL); 45static SYSDEV_ATTR(devices, S_IRUGO, dma_show_devices, NULL);
48 46
49static int __init dma_subsys_init(void) 47static int __init dma_sysclass_init(void)
50{ 48{
51 int ret; 49 int ret;
52 50
53 ret = subsys_system_register(&dma_subsys, NULL); 51 ret = sysdev_class_register(&dma_sysclass);
54 if (unlikely(ret)) 52 if (unlikely(ret))
55 return ret; 53 return ret;
56 54
57 return device_create_file(dma_subsys.dev_root, &dev_attr_devices); 55 return sysfs_create_file(&dma_sysclass.kset.kobj, &attr_devices.attr);
58} 56}
59postcore_initcall(dma_subsys_init); 57postcore_initcall(dma_sysclass_init);
60 58
61static ssize_t dma_show_dev_id(struct device *dev, 59static ssize_t dma_show_dev_id(struct sys_device *dev,
62 struct device_attribute *attr, char *buf) 60 struct sysdev_attribute *attr, char *buf)
63{ 61{
64 struct dma_channel *channel = to_dma_channel(dev); 62 struct dma_channel *channel = to_dma_channel(dev);
65 return sprintf(buf, "%s\n", channel->dev_id); 63 return sprintf(buf, "%s\n", channel->dev_id);
66} 64}
67 65
68static ssize_t dma_store_dev_id(struct device *dev, 66static ssize_t dma_store_dev_id(struct sys_device *dev,
69 struct device_attribute *attr, 67 struct sysdev_attribute *attr,
70 const char *buf, size_t count) 68 const char *buf, size_t count)
71{ 69{
72 struct dma_channel *channel = to_dma_channel(dev); 70 struct dma_channel *channel = to_dma_channel(dev);
@@ -74,10 +72,10 @@ static ssize_t dma_store_dev_id(struct device *dev,
74 return count; 72 return count;
75} 73}
76 74
77static DEVICE_ATTR(dev_id, S_IRUGO | S_IWUSR, dma_show_dev_id, dma_store_dev_id); 75static SYSDEV_ATTR(dev_id, S_IRUGO | S_IWUSR, dma_show_dev_id, dma_store_dev_id);
78 76
79static ssize_t dma_store_config(struct device *dev, 77static ssize_t dma_store_config(struct sys_device *dev,
80 struct device_attribute *attr, 78 struct sysdev_attribute *attr,
81 const char *buf, size_t count) 79 const char *buf, size_t count)
82{ 80{
83 struct dma_channel *channel = to_dma_channel(dev); 81 struct dma_channel *channel = to_dma_channel(dev);
@@ -89,17 +87,17 @@ static ssize_t dma_store_config(struct device *dev,
89 return count; 87 return count;
90} 88}
91 89
92static DEVICE_ATTR(config, S_IWUSR, NULL, dma_store_config); 90static SYSDEV_ATTR(config, S_IWUSR, NULL, dma_store_config);
93 91
94static ssize_t dma_show_mode(struct device *dev, 92static ssize_t dma_show_mode(struct sys_device *dev,
95 struct device_attribute *attr, char *buf) 93 struct sysdev_attribute *attr, char *buf)
96{ 94{
97 struct dma_channel *channel = to_dma_channel(dev); 95 struct dma_channel *channel = to_dma_channel(dev);
98 return sprintf(buf, "0x%08x\n", channel->mode); 96 return sprintf(buf, "0x%08x\n", channel->mode);
99} 97}
100 98
101static ssize_t dma_store_mode(struct device *dev, 99static ssize_t dma_store_mode(struct sys_device *dev,
102 struct device_attribute *attr, 100 struct sysdev_attribute *attr,
103 const char *buf, size_t count) 101 const char *buf, size_t count)
104{ 102{
105 struct dma_channel *channel = to_dma_channel(dev); 103 struct dma_channel *channel = to_dma_channel(dev);
@@ -107,38 +105,38 @@ static ssize_t dma_store_mode(struct device *dev,
107 return count; 105 return count;
108} 106}
109 107
110static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, dma_show_mode, dma_store_mode); 108static SYSDEV_ATTR(mode, S_IRUGO | S_IWUSR, dma_show_mode, dma_store_mode);
111 109
112#define dma_ro_attr(field, fmt) \ 110#define dma_ro_attr(field, fmt) \
113static ssize_t dma_show_##field(struct device *dev, \ 111static ssize_t dma_show_##field(struct sys_device *dev, \
114 struct device_attribute *attr, char *buf)\ 112 struct sysdev_attribute *attr, char *buf)\
115{ \ 113{ \
116 struct dma_channel *channel = to_dma_channel(dev); \ 114 struct dma_channel *channel = to_dma_channel(dev); \
117 return sprintf(buf, fmt, channel->field); \ 115 return sprintf(buf, fmt, channel->field); \
118} \ 116} \
119static DEVICE_ATTR(field, S_IRUGO, dma_show_##field, NULL); 117static SYSDEV_ATTR(field, S_IRUGO, dma_show_##field, NULL);
120 118
121dma_ro_attr(count, "0x%08x\n"); 119dma_ro_attr(count, "0x%08x\n");
122dma_ro_attr(flags, "0x%08lx\n"); 120dma_ro_attr(flags, "0x%08lx\n");
123 121
124int dma_create_sysfs_files(struct dma_channel *chan, struct dma_info *info) 122int dma_create_sysfs_files(struct dma_channel *chan, struct dma_info *info)
125{ 123{
126 struct device *dev = &chan->dev; 124 struct sys_device *dev = &chan->dev;
127 char name[16]; 125 char name[16];
128 int ret; 126 int ret;
129 127
130 dev->id = chan->vchan; 128 dev->id = chan->vchan;
131 dev->bus = &dma_subsys; 129 dev->cls = &dma_sysclass;
132 130
133 ret = device_register(dev); 131 ret = sysdev_register(dev);
134 if (ret) 132 if (ret)
135 return ret; 133 return ret;
136 134
137 ret |= device_create_file(dev, &dev_attr_dev_id); 135 ret |= sysdev_create_file(dev, &attr_dev_id);
138 ret |= device_create_file(dev, &dev_attr_count); 136 ret |= sysdev_create_file(dev, &attr_count);
139 ret |= device_create_file(dev, &dev_attr_mode); 137 ret |= sysdev_create_file(dev, &attr_mode);
140 ret |= device_create_file(dev, &dev_attr_flags); 138 ret |= sysdev_create_file(dev, &attr_flags);
141 ret |= device_create_file(dev, &dev_attr_config); 139 ret |= sysdev_create_file(dev, &attr_config);
142 140
143 if (unlikely(ret)) { 141 if (unlikely(ret)) {
144 dev_err(&info->pdev->dev, "Failed creating attrs\n"); 142 dev_err(&info->pdev->dev, "Failed creating attrs\n");
@@ -151,17 +149,17 @@ int dma_create_sysfs_files(struct dma_channel *chan, struct dma_info *info)
151 149
152void dma_remove_sysfs_files(struct dma_channel *chan, struct dma_info *info) 150void dma_remove_sysfs_files(struct dma_channel *chan, struct dma_info *info)
153{ 151{
154 struct device *dev = &chan->dev; 152 struct sys_device *dev = &chan->dev;
155 char name[16]; 153 char name[16];
156 154
157 device_remove_file(dev, &dev_attr_dev_id); 155 sysdev_remove_file(dev, &attr_dev_id);
158 device_remove_file(dev, &dev_attr_count); 156 sysdev_remove_file(dev, &attr_count);
159 device_remove_file(dev, &dev_attr_mode); 157 sysdev_remove_file(dev, &attr_mode);
160 device_remove_file(dev, &dev_attr_flags); 158 sysdev_remove_file(dev, &attr_flags);
161 device_remove_file(dev, &dev_attr_config); 159 sysdev_remove_file(dev, &attr_config);
162 160
163 snprintf(name, sizeof(name), "dma%d", chan->chan); 161 snprintf(name, sizeof(name), "dma%d", chan->chan);
164 sysfs_remove_link(&info->pdev->dev.kobj, name); 162 sysfs_remove_link(&info->pdev->dev.kobj, name);
165 163
166 device_unregister(dev); 164 sysdev_unregister(dev);
167} 165}
diff --git a/arch/sh/drivers/dma/dmabrg.c b/arch/sh/drivers/dma/dmabrg.c
index c0dd904483c..6ab9c4a1543 100644
--- a/arch/sh/drivers/dma/dmabrg.c
+++ b/arch/sh/drivers/dma/dmabrg.c
@@ -174,23 +174,23 @@ static int __init dmabrg_init(void)
174 or = __raw_readl(DMAOR); 174 or = __raw_readl(DMAOR);
175 __raw_writel(or | DMAOR_BRG | DMAOR_DMEN, DMAOR); 175 __raw_writel(or | DMAOR_BRG | DMAOR_DMEN, DMAOR);
176 176
177 ret = request_irq(DMABRGI0, dmabrg_irq, 0, 177 ret = request_irq(DMABRGI0, dmabrg_irq, IRQF_DISABLED,
178 "DMABRG USB address error", NULL); 178 "DMABRG USB address error", NULL);
179 if (ret) 179 if (ret)
180 goto out0; 180 goto out0;
181 181
182 ret = request_irq(DMABRGI1, dmabrg_irq, 0, 182 ret = request_irq(DMABRGI1, dmabrg_irq, IRQF_DISABLED,
183 "DMABRG Transfer End", NULL); 183 "DMABRG Transfer End", NULL);
184 if (ret) 184 if (ret)
185 goto out1; 185 goto out1;
186 186
187 ret = request_irq(DMABRGI2, dmabrg_irq, 0, 187 ret = request_irq(DMABRGI2, dmabrg_irq, IRQF_DISABLED,
188 "DMABRG Transfer Half", NULL); 188 "DMABRG Transfer Half", NULL);
189 if (ret == 0) 189 if (ret == 0)
190 return ret; 190 return ret;
191 191
192 free_irq(DMABRGI1, NULL); 192 free_irq(DMABRGI1, 0);
193out1: free_irq(DMABRGI0, NULL); 193out1: free_irq(DMABRGI0, 0);
194out0: kfree(dmabrg_handlers); 194out0: kfree(dmabrg_handlers);
195 return ret; 195 return ret;
196} 196}
diff --git a/arch/sh/drivers/pci/fixups-dreamcast.c b/arch/sh/drivers/pci/fixups-dreamcast.c
index d6cde700e31..edeea8960c3 100644
--- a/arch/sh/drivers/pci/fixups-dreamcast.c
+++ b/arch/sh/drivers/pci/fixups-dreamcast.c
@@ -28,7 +28,7 @@
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <mach/pci.h> 29#include <mach/pci.h>
30 30
31static void gapspci_fixup_resources(struct pci_dev *dev) 31static void __init gapspci_fixup_resources(struct pci_dev *dev)
32{ 32{
33 struct pci_channel *p = dev->sysdata; 33 struct pci_channel *p = dev->sysdata;
34 34
diff --git a/arch/sh/drivers/pci/fixups-landisk.c b/arch/sh/drivers/pci/fixups-landisk.c
index db5b40a98e6..ecb1d106063 100644
--- a/arch/sh/drivers/pci/fixups-landisk.c
+++ b/arch/sh/drivers/pci/fixups-landisk.c
@@ -14,7 +14,6 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/pci.h> 16#include <linux/pci.h>
17#include <linux/sh_intc.h>
18#include "pci-sh4.h" 17#include "pci-sh4.h"
19 18
20#define PCIMCR_MRSET_OFF 0xBFFFFFFF 19#define PCIMCR_MRSET_OFF 0xBFFFFFFF
@@ -28,7 +27,7 @@ int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
28 * slot2: pin1-4 = irq7,8,5,6 27 * slot2: pin1-4 = irq7,8,5,6
29 * slot3: pin1-4 = irq8,5,6,7 28 * slot3: pin1-4 = irq8,5,6,7
30 */ 29 */
31 int irq = ((slot + pin - 1) & 0x3) + evt2irq(0x2a0); 30 int irq = ((slot + pin - 1) & 0x3) + 5;
32 31
33 if ((slot | (pin - 1)) > 0x3) { 32 if ((slot | (pin - 1)) > 0x3) {
34 printk(KERN_WARNING "PCI: Bad IRQ mapping request for slot %d pin %c\n", 33 printk(KERN_WARNING "PCI: Bad IRQ mapping request for slot %d pin %c\n",
diff --git a/arch/sh/drivers/pci/fixups-r7780rp.c b/arch/sh/drivers/pci/fixups-r7780rp.c
index 57ed3f09d0c..f9370dce0b7 100644
--- a/arch/sh/drivers/pci/fixups-r7780rp.c
+++ b/arch/sh/drivers/pci/fixups-r7780rp.c
@@ -12,10 +12,13 @@
12 */ 12 */
13#include <linux/pci.h> 13#include <linux/pci.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/sh_intc.h>
16#include "pci-sh4.h" 15#include "pci-sh4.h"
17 16
17static char irq_tab[] __initdata = {
18 65, 66, 67, 68,
19};
20
18int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) 21int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
19{ 22{
20 return evt2irq(0xa20) + slot; 23 return irq_tab[slot];
21} 24}
diff --git a/arch/sh/drivers/pci/fixups-sdk7780.c b/arch/sh/drivers/pci/fixups-sdk7780.c
index c0a015ae6ec..0b8472501b8 100644
--- a/arch/sh/drivers/pci/fixups-sdk7780.c
+++ b/arch/sh/drivers/pci/fixups-sdk7780.c
@@ -13,28 +13,18 @@
13 */ 13 */
14#include <linux/pci.h> 14#include <linux/pci.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/sh_intc.h>
17#include "pci-sh4.h" 16#include "pci-sh4.h"
18 17
19#define IRQ_INTA evt2irq(0xa20)
20#define IRQ_INTB evt2irq(0xa40)
21#define IRQ_INTC evt2irq(0xa60)
22#define IRQ_INTD evt2irq(0xa80)
23
24/* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */ 18/* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */
25static char sdk7780_irq_tab[4][16] __initdata = { 19static char sdk7780_irq_tab[4][16] __initdata = {
26 /* INTA */ 20 /* INTA */
27 { IRQ_INTA, IRQ_INTD, IRQ_INTC, IRQ_INTD, -1, -1, -1, -1, -1, -1, 21 { 65, 68, 67, 68, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
28 -1, -1, -1, -1, -1, -1 },
29 /* INTB */ 22 /* INTB */
30 { IRQ_INTB, IRQ_INTA, -1, IRQ_INTA, -1, -1, -1, -1, -1, -1, -1, -1, 23 { 66, 65, -1, 65, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
31 -1, -1, -1, -1 },
32 /* INTC */ 24 /* INTC */
33 { IRQ_INTC, IRQ_INTB, -1, IRQ_INTB, -1, -1, -1, -1, -1, -1, -1, -1, 25 { 67, 66, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
34 -1, -1, -1, -1 },
35 /* INTD */ 26 /* INTD */
36 { IRQ_INTD, IRQ_INTC, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27 { 68, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
37 -1, -1, -1 },
38}; 28};
39 29
40int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) 30int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
diff --git a/arch/sh/drivers/pci/fixups-sdk7786.c b/arch/sh/drivers/pci/fixups-sdk7786.c
index 36eb6fc3c18..0e18ee33255 100644
--- a/arch/sh/drivers/pci/fixups-sdk7786.c
+++ b/arch/sh/drivers/pci/fixups-sdk7786.c
@@ -23,9 +23,9 @@
23 * Misconfigurations can be detected through the FPGA via the slot 23 * Misconfigurations can be detected through the FPGA via the slot
24 * resistors to determine card presence. Hotplug remains unsupported. 24 * resistors to determine card presence. Hotplug remains unsupported.
25 */ 25 */
26static unsigned int slot4en __initdata; 26static unsigned int slot4en __devinitdata;
27 27
28char *__init pcibios_setup(char *str) 28char *__devinit pcibios_setup(char *str)
29{ 29{
30 if (strcmp(str, "slot4en") == 0) { 30 if (strcmp(str, "slot4en") == 0) {
31 slot4en = 1; 31 slot4en = 1;
diff --git a/arch/sh/drivers/pci/fixups-se7751.c b/arch/sh/drivers/pci/fixups-se7751.c
index 84a88ca9200..2ec146c3fa4 100644
--- a/arch/sh/drivers/pci/fixups-se7751.c
+++ b/arch/sh/drivers/pci/fixups-se7751.c
@@ -4,14 +4,13 @@
4#include <linux/delay.h> 4#include <linux/delay.h>
5#include <linux/pci.h> 5#include <linux/pci.h>
6#include <linux/io.h> 6#include <linux/io.h>
7#include <linux/sh_intc.h>
8#include "pci-sh4.h" 7#include "pci-sh4.h"
9 8
10int __init pcibios_map_platform_irq(const struct pci_dev *, u8 slot, u8 pin) 9int __init pcibios_map_platform_irq(const struct pci_dev *, u8 slot, u8 pin)
11{ 10{
12 switch (slot) { 11 switch (slot) {
13 case 0: return evt2irq(0x3a0); 12 case 0: return 13;
14 case 1: return evt2irq(0x3a0); /* AMD Ethernet controller */ 13 case 1: return 13; /* AMD Ethernet controller */
15 case 2: return -1; 14 case 2: return -1;
16 case 3: return -1; 15 case 3: return -1;
17 case 4: return -1; 16 case 4: return -1;
diff --git a/arch/sh/drivers/pci/fixups-sh03.c b/arch/sh/drivers/pci/fixups-sh03.c
index 16207bef9f5..1615e590616 100644
--- a/arch/sh/drivers/pci/fixups-sh03.c
+++ b/arch/sh/drivers/pci/fixups-sh03.c
@@ -2,7 +2,6 @@
2#include <linux/init.h> 2#include <linux/init.h>
3#include <linux/types.h> 3#include <linux/types.h>
4#include <linux/pci.h> 4#include <linux/pci.h>
5#include <linux/sh_intc.h>
6 5
7int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin) 6int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
8{ 7{
@@ -10,21 +9,21 @@ int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
10 9
11 if (dev->bus->number == 0) { 10 if (dev->bus->number == 0) {
12 switch (slot) { 11 switch (slot) {
13 case 4: return evt2irq(0x2a0); /* eth0 */ 12 case 4: return 5; /* eth0 */
14 case 8: return evt2irq(0x2a0); /* eth1 */ 13 case 8: return 5; /* eth1 */
15 case 6: return evt2irq(0x240); /* PCI bridge */ 14 case 6: return 2; /* PCI bridge */
16 default: 15 default:
17 printk(KERN_ERR "PCI: Bad IRQ mapping request " 16 printk(KERN_ERR "PCI: Bad IRQ mapping request "
18 "for slot %d\n", slot); 17 "for slot %d\n", slot);
19 return evt2irq(0x240); 18 return 2;
20 } 19 }
21 } else { 20 } else {
22 switch (pin) { 21 switch (pin) {
23 case 0: irq = evt2irq(0x240); break; 22 case 0: irq = 2; break;
24 case 1: irq = evt2irq(0x240); break; 23 case 1: irq = 2; break;
25 case 2: irq = evt2irq(0x240); break; 24 case 2: irq = 2; break;
26 case 3: irq = evt2irq(0x240); break; 25 case 3: irq = 2; break;
27 case 4: irq = evt2irq(0x240); break; 26 case 4: irq = 2; break;
28 default: irq = -1; break; 27 default: irq = -1; break;
29 } 28 }
30 } 29 }
diff --git a/arch/sh/drivers/pci/fixups-snapgear.c b/arch/sh/drivers/pci/fixups-snapgear.c
index 6e33ba4cd07..4a093c648d1 100644
--- a/arch/sh/drivers/pci/fixups-snapgear.c
+++ b/arch/sh/drivers/pci/fixups-snapgear.c
@@ -16,7 +16,6 @@
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/pci.h> 18#include <linux/pci.h>
19#include <linux/sh_intc.h>
20#include "pci-sh4.h" 19#include "pci-sh4.h"
21 20
22int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) 21int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
@@ -25,11 +24,11 @@ int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
25 24
26 switch (slot) { 25 switch (slot) {
27 case 8: /* the PCI bridge */ break; 26 case 8: /* the PCI bridge */ break;
28 case 11: irq = evt2irq(0x300); break; /* USB */ 27 case 11: irq = 8; break; /* USB */
29 case 12: irq = evt2irq(0x360); break; /* PCMCIA */ 28 case 12: irq = 11; break; /* PCMCIA */
30 case 13: irq = evt2irq(0x2a0); break; /* eth0 */ 29 case 13: irq = 5; break; /* eth0 */
31 case 14: irq = evt2irq(0x300); break; /* eth1 */ 30 case 14: irq = 8; break; /* eth1 */
32 case 15: irq = evt2irq(0x360); break; /* safenet (unused) */ 31 case 15: irq = 11; break; /* safenet (unused) */
33 } 32 }
34 33
35 printk("PCI: Mapping SnapGear IRQ for slot %d, pin %c to irq %d\n", 34 printk("PCI: Mapping SnapGear IRQ for slot %d, pin %c to irq %d\n",
diff --git a/arch/sh/drivers/pci/pci-sh5.c b/arch/sh/drivers/pci/pci-sh5.c
index 16c1e721bf5..0bf296c7879 100644
--- a/arch/sh/drivers/pci/pci-sh5.c
+++ b/arch/sh/drivers/pci/pci-sh5.c
@@ -107,13 +107,13 @@ static int __init sh5pci_init(void)
107 u32 uval; 107 u32 uval;
108 108
109 if (request_irq(IRQ_ERR, pcish5_err_irq, 109 if (request_irq(IRQ_ERR, pcish5_err_irq,
110 0, "PCI Error",NULL) < 0) { 110 IRQF_DISABLED, "PCI Error",NULL) < 0) {
111 printk(KERN_ERR "PCISH5: Cannot hook PCI_PERR interrupt\n"); 111 printk(KERN_ERR "PCISH5: Cannot hook PCI_PERR interrupt\n");
112 return -EINVAL; 112 return -EINVAL;
113 } 113 }
114 114
115 if (request_irq(IRQ_SERR, pcish5_serr_irq, 115 if (request_irq(IRQ_SERR, pcish5_serr_irq,
116 0, "PCI SERR interrupt", NULL) < 0) { 116 IRQF_DISABLED, "PCI SERR interrupt", NULL) < 0) {
117 printk(KERN_ERR "PCISH5: Cannot hook PCI_SERR interrupt\n"); 117 printk(KERN_ERR "PCISH5: Cannot hook PCI_SERR interrupt\n");
118 return -EINVAL; 118 return -EINVAL;
119 } 119 }
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c
index 5a6dab6e27d..edb7cca1488 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -21,13 +21,6 @@
21#include <asm/mmu.h> 21#include <asm/mmu.h>
22#include <asm/sizes.h> 22#include <asm/sizes.h>
23 23
24#if defined(CONFIG_CPU_BIG_ENDIAN)
25# define PCICR_ENDIANNESS SH4_PCICR_BSWP
26#else
27# define PCICR_ENDIANNESS 0
28#endif
29
30
31static struct resource sh7785_pci_resources[] = { 24static struct resource sh7785_pci_resources[] = {
32 { 25 {
33 .name = "PCI IO", 26 .name = "PCI IO",
@@ -81,7 +74,7 @@ struct pci_errors {
81 { SH4_PCIINT_MLCK, "master lock error" }, 74 { SH4_PCIINT_MLCK, "master lock error" },
82 { SH4_PCIINT_TABT, "target-target abort" }, 75 { SH4_PCIINT_TABT, "target-target abort" },
83 { SH4_PCIINT_TRET, "target retry time out" }, 76 { SH4_PCIINT_TRET, "target retry time out" },
84 { SH4_PCIINT_MFDE, "master function disable error" }, 77 { SH4_PCIINT_MFDE, "master function disable erorr" },
85 { SH4_PCIINT_PRTY, "address parity error" }, 78 { SH4_PCIINT_PRTY, "address parity error" },
86 { SH4_PCIINT_SERR, "SERR" }, 79 { SH4_PCIINT_SERR, "SERR" },
87 { SH4_PCIINT_TWDP, "data parity error for target write" }, 80 { SH4_PCIINT_TWDP, "data parity error for target write" },
@@ -179,7 +172,7 @@ static int __init sh7780_pci_setup_irqs(struct pci_channel *hose)
179 PCI_STATUS_SIG_TARGET_ABORT | \ 172 PCI_STATUS_SIG_TARGET_ABORT | \
180 PCI_STATUS_PARITY, hose->reg_base + PCI_STATUS); 173 PCI_STATUS_PARITY, hose->reg_base + PCI_STATUS);
181 174
182 ret = request_irq(hose->serr_irq, sh7780_pci_serr_irq, 0, 175 ret = request_irq(hose->serr_irq, sh7780_pci_serr_irq, IRQF_DISABLED,
183 "PCI SERR interrupt", hose); 176 "PCI SERR interrupt", hose);
184 if (unlikely(ret)) { 177 if (unlikely(ret)) {
185 printk(KERN_ERR "PCI: Failed hooking SERR IRQ\n"); 178 printk(KERN_ERR "PCI: Failed hooking SERR IRQ\n");
@@ -261,7 +254,7 @@ static int __init sh7780_pci_init(void)
261 __raw_writel(PCIECR_ENBL, PCIECR); 254 __raw_writel(PCIECR_ENBL, PCIECR);
262 255
263 /* Reset */ 256 /* Reset */
264 __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_PRST | PCICR_ENDIANNESS, 257 __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_PRST,
265 chan->reg_base + SH4_PCICR); 258 chan->reg_base + SH4_PCICR);
266 259
267 /* 260 /*
@@ -297,8 +290,7 @@ static int __init sh7780_pci_init(void)
297 * Now throw it in to register initialization mode and 290 * Now throw it in to register initialization mode and
298 * start the real work. 291 * start the real work.
299 */ 292 */
300 __raw_writel(SH4_PCICR_PREFIX | PCICR_ENDIANNESS, 293 __raw_writel(SH4_PCICR_PREFIX, chan->reg_base + SH4_PCICR);
301 chan->reg_base + SH4_PCICR);
302 294
303 memphys = __pa(memory_start); 295 memphys = __pa(memory_start);
304 memsize = roundup_pow_of_two(memory_end - memory_start); 296 memsize = roundup_pow_of_two(memory_end - memory_start);
@@ -388,8 +380,7 @@ static int __init sh7780_pci_init(void)
388 * Initialization mode complete, release the control register and 380 * Initialization mode complete, release the control register and
389 * enable round robin mode to stop device overruns/starvation. 381 * enable round robin mode to stop device overruns/starvation.
390 */ 382 */
391 __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO | 383 __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO,
392 PCICR_ENDIANNESS,
393 chan->reg_base + SH4_PCICR); 384 chan->reg_base + SH4_PCICR);
394 385
395 ret = register_pci_controller(chan); 386 ret = register_pci_controller(chan);
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index 102f5d58b03..194231cb5a7 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -20,7 +20,6 @@
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/mutex.h> 21#include <linux/mutex.h>
22#include <linux/spinlock.h> 22#include <linux/spinlock.h>
23#include <linux/export.h>
24 23
25unsigned long PCIBIOS_MIN_IO = 0x0000; 24unsigned long PCIBIOS_MIN_IO = 0x0000;
26unsigned long PCIBIOS_MIN_MEM = 0; 25unsigned long PCIBIOS_MIN_MEM = 0;
@@ -32,34 +31,19 @@ static struct pci_channel *hose_head, **hose_tail = &hose_head;
32 31
33static int pci_initialized; 32static int pci_initialized;
34 33
35static void pcibios_scanbus(struct pci_channel *hose) 34static void __devinit pcibios_scanbus(struct pci_channel *hose)
36{ 35{
37 static int next_busno; 36 static int next_busno;
38 static int need_domain_info; 37 static int need_domain_info;
39 LIST_HEAD(resources);
40 struct resource *res;
41 resource_size_t offset;
42 int i;
43 struct pci_bus *bus; 38 struct pci_bus *bus;
44 39
45 for (i = 0; i < hose->nr_resources; i++) { 40 bus = pci_scan_bus(next_busno, hose->pci_ops, hose);
46 res = hose->resources + i;
47 offset = 0;
48 if (res->flags & IORESOURCE_IO)
49 offset = hose->io_offset;
50 else if (res->flags & IORESOURCE_MEM)
51 offset = hose->mem_offset;
52 pci_add_resource_offset(&resources, res, offset);
53 }
54
55 bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose,
56 &resources);
57 hose->bus = bus; 41 hose->bus = bus;
58 42
59 need_domain_info = need_domain_info || hose->index; 43 need_domain_info = need_domain_info || hose->index;
60 hose->need_domain_info = need_domain_info; 44 hose->need_domain_info = need_domain_info;
61 if (bus) { 45 if (bus) {
62 next_busno = bus->busn_res.end + 1; 46 next_busno = bus->subordinate + 1;
63 /* Don't allow 8-bit bus number overflow inside the hose - 47 /* Don't allow 8-bit bus number overflow inside the hose -
64 reserve some space for bridges. */ 48 reserve some space for bridges. */
65 if (next_busno > 224) { 49 if (next_busno > 224) {
@@ -70,8 +54,6 @@ static void pcibios_scanbus(struct pci_channel *hose)
70 pci_bus_size_bridges(bus); 54 pci_bus_size_bridges(bus);
71 pci_bus_assign_resources(bus); 55 pci_bus_assign_resources(bus);
72 pci_enable_bridges(bus); 56 pci_enable_bridges(bus);
73 } else {
74 pci_free_resource_list(&resources);
75 } 57 }
76} 58}
77 59
@@ -82,7 +64,7 @@ static void pcibios_scanbus(struct pci_channel *hose)
82DEFINE_RAW_SPINLOCK(pci_config_lock); 64DEFINE_RAW_SPINLOCK(pci_config_lock);
83static DEFINE_MUTEX(pci_scan_mutex); 65static DEFINE_MUTEX(pci_scan_mutex);
84 66
85int register_pci_controller(struct pci_channel *hose) 67int __devinit register_pci_controller(struct pci_channel *hose)
86{ 68{
87 int i; 69 int i;
88 70
@@ -152,12 +134,50 @@ static int __init pcibios_init(void)
152} 134}
153subsys_initcall(pcibios_init); 135subsys_initcall(pcibios_init);
154 136
137static void pcibios_fixup_device_resources(struct pci_dev *dev,
138 struct pci_bus *bus)
139{
140 /* Update device resources. */
141 struct pci_channel *hose = bus->sysdata;
142 unsigned long offset = 0;
143 int i;
144
145 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
146 if (!dev->resource[i].start)
147 continue;
148 if (dev->resource[i].flags & IORESOURCE_IO)
149 offset = hose->io_offset;
150 else if (dev->resource[i].flags & IORESOURCE_MEM)
151 offset = hose->mem_offset;
152
153 dev->resource[i].start += offset;
154 dev->resource[i].end += offset;
155 }
156}
157
155/* 158/*
156 * Called after each bus is probed, but before its children 159 * Called after each bus is probed, but before its children
157 * are examined. 160 * are examined.
158 */ 161 */
159void pcibios_fixup_bus(struct pci_bus *bus) 162void __devinit pcibios_fixup_bus(struct pci_bus *bus)
160{ 163{
164 struct pci_dev *dev = bus->self;
165 struct list_head *ln;
166 struct pci_channel *hose = bus->sysdata;
167
168 if (!dev) {
169 int i;
170
171 for (i = 0; i < hose->nr_resources; i++)
172 bus->resource[i] = hose->resources + i;
173 }
174
175 for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
176 dev = pci_dev_b(ln);
177
178 if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)
179 pcibios_fixup_device_resources(dev, bus);
180 }
161} 181}
162 182
163/* 183/*
@@ -187,11 +207,72 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
187 return start; 207 return start;
188} 208}
189 209
210void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
211 struct resource *res)
212{
213 struct pci_channel *hose = dev->sysdata;
214 unsigned long offset = 0;
215
216 if (res->flags & IORESOURCE_IO)
217 offset = hose->io_offset;
218 else if (res->flags & IORESOURCE_MEM)
219 offset = hose->mem_offset;
220
221 region->start = res->start - offset;
222 region->end = res->end - offset;
223}
224
225void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
226 struct pci_bus_region *region)
227{
228 struct pci_channel *hose = dev->sysdata;
229 unsigned long offset = 0;
230
231 if (res->flags & IORESOURCE_IO)
232 offset = hose->io_offset;
233 else if (res->flags & IORESOURCE_MEM)
234 offset = hose->mem_offset;
235
236 res->start = region->start + offset;
237 res->end = region->end + offset;
238}
239
190int pcibios_enable_device(struct pci_dev *dev, int mask) 240int pcibios_enable_device(struct pci_dev *dev, int mask)
191{ 241{
192 return pci_enable_resources(dev, mask); 242 return pci_enable_resources(dev, mask);
193} 243}
194 244
245/*
246 * If we set up a device for bus mastering, we need to check and set
247 * the latency timer as it may not be properly set.
248 */
249static unsigned int pcibios_max_latency = 255;
250
251void pcibios_set_master(struct pci_dev *dev)
252{
253 u8 lat;
254 pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
255 if (lat < 16)
256 lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency;
257 else if (lat > pcibios_max_latency)
258 lat = pcibios_max_latency;
259 else
260 return;
261 printk(KERN_INFO "PCI: Setting latency timer of device %s to %d\n",
262 pci_name(dev), lat);
263 pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
264}
265
266void __init pcibios_update_irq(struct pci_dev *dev, int irq)
267{
268 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
269}
270
271char * __devinit __weak pcibios_setup(char *str)
272{
273 return str;
274}
275
195static void __init 276static void __init
196pcibios_bus_report_status_early(struct pci_channel *hose, 277pcibios_bus_report_status_early(struct pci_channel *hose,
197 int top_bus, int current_bus, 278 int top_bus, int current_bus,
@@ -295,8 +376,8 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
295 376
296#ifndef CONFIG_GENERIC_IOMAP 377#ifndef CONFIG_GENERIC_IOMAP
297 378
298void __iomem *__pci_ioport_map(struct pci_dev *dev, 379static void __iomem *ioport_map_pci(struct pci_dev *dev,
299 unsigned long port, unsigned int nr) 380 unsigned long port, unsigned int nr)
300{ 381{
301 struct pci_channel *chan = dev->sysdata; 382 struct pci_channel *chan = dev->sysdata;
302 383
@@ -311,6 +392,29 @@ void __iomem *__pci_ioport_map(struct pci_dev *dev,
311 return (void __iomem *)(chan->io_map_base + port); 392 return (void __iomem *)(chan->io_map_base + port);
312} 393}
313 394
395void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
396{
397 resource_size_t start = pci_resource_start(dev, bar);
398 resource_size_t len = pci_resource_len(dev, bar);
399 unsigned long flags = pci_resource_flags(dev, bar);
400
401 if (unlikely(!len || !start))
402 return NULL;
403 if (maxlen && len > maxlen)
404 len = maxlen;
405
406 if (flags & IORESOURCE_IO)
407 return ioport_map_pci(dev, start, len);
408 if (flags & IORESOURCE_MEM) {
409 if (flags & IORESOURCE_CACHEABLE)
410 return ioremap(start, len);
411 return ioremap_nocache(start, len);
412 }
413
414 return NULL;
415}
416EXPORT_SYMBOL(pci_iomap);
417
314void pci_iounmap(struct pci_dev *dev, void __iomem *addr) 418void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
315{ 419{
316 iounmap(addr); 420 iounmap(addr);
@@ -319,5 +423,9 @@ EXPORT_SYMBOL(pci_iounmap);
319 423
320#endif /* CONFIG_GENERIC_IOMAP */ 424#endif /* CONFIG_GENERIC_IOMAP */
321 425
426#ifdef CONFIG_HOTPLUG
427EXPORT_SYMBOL(pcibios_resource_to_bus);
428EXPORT_SYMBOL(pcibios_bus_to_resource);
322EXPORT_SYMBOL(PCIBIOS_MIN_IO); 429EXPORT_SYMBOL(PCIBIOS_MIN_IO);
323EXPORT_SYMBOL(PCIBIOS_MIN_MEM); 430EXPORT_SYMBOL(PCIBIOS_MIN_MEM);
431#endif
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c
index c2c85f6cd73..4df27c4fbf9 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.c
+++ b/arch/sh/drivers/pci/pcie-sh7786.c
@@ -18,7 +18,6 @@
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/sh_clk.h> 20#include <linux/sh_clk.h>
21#include <linux/sh_intc.h>
22#include "pcie-sh7786.h" 21#include "pcie-sh7786.h"
23#include <asm/sizes.h> 22#include <asm/sizes.h>
24 23
@@ -132,7 +131,7 @@ static struct clk fixed_pciexclkp = {
132 .rate = 100000000, /* 100 MHz reference clock */ 131 .rate = 100000000, /* 100 MHz reference clock */
133}; 132};
134 133
135static void sh7786_pci_fixup(struct pci_dev *dev) 134static void __devinit sh7786_pci_fixup(struct pci_dev *dev)
136{ 135{
137 /* 136 /*
138 * Prevent enumeration of root complex resources. 137 * Prevent enumeration of root complex resources.
@@ -239,7 +238,7 @@ static int __init pcie_clk_init(struct sh7786_pcie_port *port)
239 clk->enable_reg = (void __iomem *)(chan->reg_base + SH4A_PCIEPHYCTLR); 238 clk->enable_reg = (void __iomem *)(chan->reg_base + SH4A_PCIEPHYCTLR);
240 clk->enable_bit = BITS_CKE; 239 clk->enable_bit = BITS_CKE;
241 240
242 ret = sh_clk_mstp_register(clk, 1); 241 ret = sh_clk_mstp32_register(clk, 1);
243 if (unlikely(ret < 0)) 242 if (unlikely(ret < 0))
244 goto err_phy; 243 goto err_phy;
245 244
@@ -469,7 +468,7 @@ static int __init pcie_init(struct sh7786_pcie_port *port)
469 468
470int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) 469int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
471{ 470{
472 return evt2irq(0xae0); 471 return 71;
473} 472}
474 473
475static int __init sh7786_pcie_core_init(void) 474static int __init sh7786_pcie_core_init(void)
diff --git a/arch/sh/drivers/push-switch.c b/arch/sh/drivers/push-switch.c
index 5bfb341cc5c..afc24556572 100644
--- a/arch/sh/drivers/push-switch.c
+++ b/arch/sh/drivers/push-switch.c
@@ -63,7 +63,7 @@ static int switch_drv_probe(struct platform_device *pdev)
63 BUG_ON(!psw_info); 63 BUG_ON(!psw_info);
64 64
65 ret = request_irq(irq, psw_info->irq_handler, 65 ret = request_irq(irq, psw_info->irq_handler,
66 psw_info->irq_flags, 66 IRQF_DISABLED | psw_info->irq_flags,
67 psw_info->name ? psw_info->name : DRV_NAME, pdev); 67 psw_info->name ? psw_info->name : DRV_NAME, pdev);
68 if (unlikely(ret < 0)) 68 if (unlikely(ret < 0))
69 goto err; 69 goto err;
@@ -107,7 +107,7 @@ static int switch_drv_remove(struct platform_device *pdev)
107 device_remove_file(&pdev->dev, &dev_attr_switch); 107 device_remove_file(&pdev->dev, &dev_attr_switch);
108 108
109 platform_set_drvdata(pdev, NULL); 109 platform_set_drvdata(pdev, NULL);
110 flush_work(&psw->work); 110 flush_work_sync(&psw->work);
111 del_timer_sync(&psw->debounce); 111 del_timer_sync(&psw->debounce);
112 free_irq(irq, pdev); 112 free_irq(irq, pdev);
113 113
diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild
index 280bea9e5e2..7beb42322f6 100644
--- a/arch/sh/include/asm/Kbuild
+++ b/arch/sh/include/asm/Kbuild
@@ -1,36 +1,11 @@
1include include/asm-generic/Kbuild.asm
1 2
2generic-y += bitsperlong.h 3header-y += cachectl.h
3generic-y += cputime.h 4header-y += cpu-features.h
4generic-y += current.h 5header-y += hw_breakpoint.h
5generic-y += delay.h 6header-y += posix_types_32.h
6generic-y += div64.h 7header-y += posix_types_64.h
7generic-y += emergency-restart.h 8header-y += ptrace_32.h
8generic-y += errno.h 9header-y += ptrace_64.h
9generic-y += exec.h 10header-y += unistd_32.h
10generic-y += fcntl.h 11header-y += unistd_64.h
11generic-y += ioctl.h
12generic-y += ipcbuf.h
13generic-y += irq_regs.h
14generic-y += kvm_para.h
15generic-y += local.h
16generic-y += local64.h
17generic-y += param.h
18generic-y += parport.h
19generic-y += percpu.h
20generic-y += poll.h
21generic-y += mman.h
22generic-y += msgbuf.h
23generic-y += resource.h
24generic-y += scatterlist.h
25generic-y += sembuf.h
26generic-y += serial.h
27generic-y += shmbuf.h
28generic-y += siginfo.h
29generic-y += sizes.h
30generic-y += socket.h
31generic-y += statfs.h
32generic-y += termbits.h
33generic-y += termios.h
34generic-y += trace_clock.h
35generic-y += ucontext.h
36generic-y += xor.h
diff --git a/arch/sh/include/asm/atomic-irq.h b/arch/sh/include/asm/atomic-irq.h
index 9f7c56609e5..467d9415a32 100644
--- a/arch/sh/include/asm/atomic-irq.h
+++ b/arch/sh/include/asm/atomic-irq.h
@@ -1,8 +1,6 @@
1#ifndef __ASM_SH_ATOMIC_IRQ_H 1#ifndef __ASM_SH_ATOMIC_IRQ_H
2#define __ASM_SH_ATOMIC_IRQ_H 2#define __ASM_SH_ATOMIC_IRQ_H
3 3
4#include <linux/irqflags.h>
5
6/* 4/*
7 * To get proper branch prediction for the main line, we must branch 5 * To get proper branch prediction for the main line, we must branch
8 * forward to code at the end of this object's .text section, then 6 * forward to code at the end of this object's .text section, then
diff --git a/arch/sh/include/asm/atomic.h b/arch/sh/include/asm/atomic.h
index f4c1c20bcdf..63a27dbc952 100644
--- a/arch/sh/include/asm/atomic.h
+++ b/arch/sh/include/asm/atomic.h
@@ -9,9 +9,9 @@
9 9
10#include <linux/compiler.h> 10#include <linux/compiler.h>
11#include <linux/types.h> 11#include <linux/types.h>
12#include <asm/cmpxchg.h> 12#include <asm/system.h>
13 13
14#define ATOMIC_INIT(i) { (i) } 14#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
15 15
16#define atomic_read(v) (*(volatile int *)&(v)->counter) 16#define atomic_read(v) (*(volatile int *)&(v)->counter)
17#define atomic_set(v,i) ((v)->counter = (i)) 17#define atomic_set(v,i) ((v)->counter = (i))
diff --git a/arch/sh/include/asm/barrier.h b/arch/sh/include/asm/barrier.h
deleted file mode 100644
index 72c103dae30..00000000000
--- a/arch/sh/include/asm/barrier.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima
3 * Copyright (C) 2002 Paul Mundt
4 */
5#ifndef __ASM_SH_BARRIER_H
6#define __ASM_SH_BARRIER_H
7
8#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
9#include <asm/cache_insns.h>
10#endif
11
12/*
13 * A brief note on ctrl_barrier(), the control register write barrier.
14 *
15 * Legacy SH cores typically require a sequence of 8 nops after
16 * modification of a control register in order for the changes to take
17 * effect. On newer cores (like the sh4a and sh5) this is accomplished
18 * with icbi.
19 *
20 * Also note that on sh4a in the icbi case we can forego a synco for the
21 * write barrier, as it's not necessary for control registers.
22 *
23 * Historically we have only done this type of barrier for the MMUCR, but
24 * it's also necessary for the CCR, so we make it generic here instead.
25 */
26#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
27#define mb() __asm__ __volatile__ ("synco": : :"memory")
28#define rmb() mb()
29#define wmb() __asm__ __volatile__ ("synco": : :"memory")
30#define ctrl_barrier() __icbi(PAGE_OFFSET)
31#define read_barrier_depends() do { } while(0)
32#else
33#define mb() __asm__ __volatile__ ("": : :"memory")
34#define rmb() mb()
35#define wmb() __asm__ __volatile__ ("": : :"memory")
36#define ctrl_barrier() __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop")
37#define read_barrier_depends() do { } while(0)
38#endif
39
40#ifdef CONFIG_SMP
41#define smp_mb() mb()
42#define smp_rmb() rmb()
43#define smp_wmb() wmb()
44#define smp_read_barrier_depends() read_barrier_depends()
45#else
46#define smp_mb() barrier()
47#define smp_rmb() barrier()
48#define smp_wmb() barrier()
49#define smp_read_barrier_depends() do { } while(0)
50#endif
51
52#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
53
54#endif /* __ASM_SH_BARRIER_H */
diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h
index ea8706d94f0..90fa3e48b4d 100644
--- a/arch/sh/include/asm/bitops.h
+++ b/arch/sh/include/asm/bitops.h
@@ -7,6 +7,7 @@
7#error only <linux/bitops.h> can be included directly 7#error only <linux/bitops.h> can be included directly
8#endif 8#endif
9 9
10#include <asm/system.h>
10/* For __swab32 */ 11/* For __swab32 */
11#include <asm/byteorder.h> 12#include <asm/byteorder.h>
12 13
diff --git a/arch/sh/include/asm/bl_bit.h b/arch/sh/include/asm/bl_bit.h
deleted file mode 100644
index 06e4163c674..00000000000
--- a/arch/sh/include/asm/bl_bit.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef __ASM_SH_BL_BIT_H
2#define __ASM_SH_BL_BIT_H
3
4#ifdef CONFIG_SUPERH32
5# include <asm/bl_bit_32.h>
6#else
7# include <asm/bl_bit_64.h>
8#endif
9
10#endif /* __ASM_SH_BL_BIT_H */
diff --git a/arch/sh/include/asm/bl_bit_32.h b/arch/sh/include/asm/bl_bit_32.h
deleted file mode 100644
index fd21eee6214..00000000000
--- a/arch/sh/include/asm/bl_bit_32.h
+++ /dev/null
@@ -1,33 +0,0 @@
1#ifndef __ASM_SH_BL_BIT_32_H
2#define __ASM_SH_BL_BIT_32_H
3
4static inline void set_bl_bit(void)
5{
6 unsigned long __dummy0, __dummy1;
7
8 __asm__ __volatile__ (
9 "stc sr, %0\n\t"
10 "or %2, %0\n\t"
11 "and %3, %0\n\t"
12 "ldc %0, sr\n\t"
13 : "=&r" (__dummy0), "=r" (__dummy1)
14 : "r" (0x10000000), "r" (0xffffff0f)
15 : "memory"
16 );
17}
18
19static inline void clear_bl_bit(void)
20{
21 unsigned long __dummy0, __dummy1;
22
23 __asm__ __volatile__ (
24 "stc sr, %0\n\t"
25 "and %2, %0\n\t"
26 "ldc %0, sr\n\t"
27 : "=&r" (__dummy0), "=r" (__dummy1)
28 : "1" (~0x10000000)
29 : "memory"
30 );
31}
32
33#endif /* __ASM_SH_BL_BIT_32_H */
diff --git a/arch/sh/include/asm/bl_bit_64.h b/arch/sh/include/asm/bl_bit_64.h
deleted file mode 100644
index 6cc8711af43..00000000000
--- a/arch/sh/include/asm/bl_bit_64.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001 Paolo Alberelli
3 * Copyright (C) 2003 Paul Mundt
4 * Copyright (C) 2004 Richard Curnow
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#ifndef __ASM_SH_BL_BIT_64_H
11#define __ASM_SH_BL_BIT_64_H
12
13#include <asm/processor.h>
14
15#define SR_BL_LL 0x0000000010000000LL
16
17static inline void set_bl_bit(void)
18{
19 unsigned long long __dummy0, __dummy1 = SR_BL_LL;
20
21 __asm__ __volatile__("getcon " __SR ", %0\n\t"
22 "or %0, %1, %0\n\t"
23 "putcon %0, " __SR "\n\t"
24 : "=&r" (__dummy0)
25 : "r" (__dummy1));
26
27}
28
29static inline void clear_bl_bit(void)
30{
31 unsigned long long __dummy0, __dummy1 = ~SR_BL_LL;
32
33 __asm__ __volatile__("getcon " __SR ", %0\n\t"
34 "and %0, %1, %0\n\t"
35 "putcon %0, " __SR "\n\t"
36 : "=&r" (__dummy0)
37 : "r" (__dummy1));
38}
39
40#endif /* __ASM_SH_BL_BIT_64_H */
diff --git a/arch/sh/include/asm/bug.h b/arch/sh/include/asm/bug.h
index dcf27807542..6323f864d11 100644
--- a/arch/sh/include/asm/bug.h
+++ b/arch/sh/include/asm/bug.h
@@ -1,8 +1,6 @@
1#ifndef __ASM_SH_BUG_H 1#ifndef __ASM_SH_BUG_H
2#define __ASM_SH_BUG_H 2#define __ASM_SH_BUG_H
3 3
4#include <linux/linkage.h>
5
6#define TRAPA_BUG_OPCODE 0xc33e /* trapa #0x3e */ 4#define TRAPA_BUG_OPCODE 0xc33e /* trapa #0x3e */
7#define BUGFLAG_UNWINDER (1 << 1) 5#define BUGFLAG_UNWINDER (1 << 1)
8 6
@@ -109,11 +107,4 @@ do { \
109 107
110#include <asm-generic/bug.h> 108#include <asm-generic/bug.h>
111 109
112struct pt_regs;
113
114/* arch/sh/kernel/traps.c */
115extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn));
116extern void die_if_kernel(const char *str, struct pt_regs *regs, long err);
117extern void die_if_no_fixup(const char *str, struct pt_regs *regs, long err);
118
119#endif /* __ASM_SH_BUG_H */ 110#endif /* __ASM_SH_BUG_H */
diff --git a/arch/sh/include/asm/cache_insns.h b/arch/sh/include/asm/cache_insns.h
deleted file mode 100644
index 355cb06b7a3..00000000000
--- a/arch/sh/include/asm/cache_insns.h
+++ /dev/null
@@ -1,11 +0,0 @@
1#ifndef __ASM_SH_CACHE_INSNS_H
2#define __ASM_SH_CACHE_INSNS_H
3
4
5#ifdef CONFIG_SUPERH32
6# include <asm/cache_insns_32.h>
7#else
8# include <asm/cache_insns_64.h>
9#endif
10
11#endif /* __ASM_SH_CACHE_INSNS_H */
diff --git a/arch/sh/include/asm/cache_insns_32.h b/arch/sh/include/asm/cache_insns_32.h
deleted file mode 100644
index b92fe541609..00000000000
--- a/arch/sh/include/asm/cache_insns_32.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef __ASM_SH_CACHE_INSNS_32_H
2#define __ASM_SH_CACHE_INSNS_32_H
3
4#include <linux/types.h>
5
6#if defined(CONFIG_CPU_SH4A)
7#define __icbi(addr) __asm__ __volatile__ ( "icbi @%0\n\t" : : "r" (addr))
8#else
9#define __icbi(addr) mb()
10#endif
11
12#define __ocbp(addr) __asm__ __volatile__ ( "ocbp @%0\n\t" : : "r" (addr))
13#define __ocbi(addr) __asm__ __volatile__ ( "ocbi @%0\n\t" : : "r" (addr))
14#define __ocbwb(addr) __asm__ __volatile__ ( "ocbwb @%0\n\t" : : "r" (addr))
15
16static inline reg_size_t register_align(void *val)
17{
18 return (unsigned long)(signed long)val;
19}
20
21#endif /* __ASM_SH_CACHE_INSNS_32_H */
diff --git a/arch/sh/include/asm/cache_insns_64.h b/arch/sh/include/asm/cache_insns_64.h
deleted file mode 100644
index 70b6357eaf1..00000000000
--- a/arch/sh/include/asm/cache_insns_64.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001 Paolo Alberelli
3 * Copyright (C) 2003 Paul Mundt
4 * Copyright (C) 2004 Richard Curnow
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#ifndef __ASM_SH_CACHE_INSNS_64_H
11#define __ASM_SH_CACHE_INSNS_64_H
12
13#define __icbi(addr) __asm__ __volatile__ ( "icbi %0, 0\n\t" : : "r" (addr))
14#define __ocbp(addr) __asm__ __volatile__ ( "ocbp %0, 0\n\t" : : "r" (addr))
15#define __ocbi(addr) __asm__ __volatile__ ( "ocbi %0, 0\n\t" : : "r" (addr))
16#define __ocbwb(addr) __asm__ __volatile__ ( "ocbwb %0, 0\n\t" : : "r" (addr))
17
18static inline reg_size_t register_align(void *val)
19{
20 return (unsigned long long)(signed long long)(signed long)val;
21}
22
23#endif /* __ASM_SH_CACHE_INSNS_64_H */
diff --git a/arch/sh/include/asm/checksum.h b/arch/sh/include/asm/checksum.h
index 34ae2620452..fc26d1f4b59 100644
--- a/arch/sh/include/asm/checksum.h
+++ b/arch/sh/include/asm/checksum.h
@@ -1,5 +1,5 @@
1#ifdef CONFIG_SUPERH32 1#ifdef CONFIG_SUPERH32
2# include <asm/checksum_32.h> 2# include "checksum_32.h"
3#else 3#else
4# include <asm-generic/checksum.h> 4# include <asm-generic/checksum.h>
5#endif 5#endif
diff --git a/arch/sh/include/asm/clock.h b/arch/sh/include/asm/clock.h
index 0390a07e7e3..803d4c7f09d 100644
--- a/arch/sh/include/asm/clock.h
+++ b/arch/sh/include/asm/clock.h
@@ -4,7 +4,7 @@
4#include <linux/sh_clk.h> 4#include <linux/sh_clk.h>
5 5
6/* Should be defined by processor-specific code */ 6/* Should be defined by processor-specific code */
7void __deprecated arch_init_clk_ops(struct sh_clk_ops **, int type); 7void __deprecated arch_init_clk_ops(struct clk_ops **, int type);
8int __init arch_clk_init(void); 8int __init arch_clk_init(void);
9 9
10/* arch/sh/kernel/cpu/clock-cpg.c */ 10/* arch/sh/kernel/cpu/clock-cpg.c */
diff --git a/arch/sh/include/asm/cmpxchg-irq.h b/arch/sh/include/asm/cmpxchg-irq.h
index bd11f630414..43049ec0554 100644
--- a/arch/sh/include/asm/cmpxchg-irq.h
+++ b/arch/sh/include/asm/cmpxchg-irq.h
@@ -1,8 +1,6 @@
1#ifndef __ASM_SH_CMPXCHG_IRQ_H 1#ifndef __ASM_SH_CMPXCHG_IRQ_H
2#define __ASM_SH_CMPXCHG_IRQ_H 2#define __ASM_SH_CMPXCHG_IRQ_H
3 3
4#include <linux/irqflags.h>
5
6static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val) 4static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
7{ 5{
8 unsigned long flags, retval; 6 unsigned long flags, retval;
diff --git a/arch/sh/include/asm/cmpxchg.h b/arch/sh/include/asm/cmpxchg.h
deleted file mode 100644
index f6bd1406b89..00000000000
--- a/arch/sh/include/asm/cmpxchg.h
+++ /dev/null
@@ -1,70 +0,0 @@
1#ifndef __ASM_SH_CMPXCHG_H
2#define __ASM_SH_CMPXCHG_H
3
4/*
5 * Atomic operations that C can't guarantee us. Useful for
6 * resource counting etc..
7 */
8
9#include <linux/compiler.h>
10#include <linux/types.h>
11
12#if defined(CONFIG_GUSA_RB)
13#include <asm/cmpxchg-grb.h>
14#elif defined(CONFIG_CPU_SH4A)
15#include <asm/cmpxchg-llsc.h>
16#else
17#include <asm/cmpxchg-irq.h>
18#endif
19
20extern void __xchg_called_with_bad_pointer(void);
21
22#define __xchg(ptr, x, size) \
23({ \
24 unsigned long __xchg__res; \
25 volatile void *__xchg_ptr = (ptr); \
26 switch (size) { \
27 case 4: \
28 __xchg__res = xchg_u32(__xchg_ptr, x); \
29 break; \
30 case 1: \
31 __xchg__res = xchg_u8(__xchg_ptr, x); \
32 break; \
33 default: \
34 __xchg_called_with_bad_pointer(); \
35 __xchg__res = x; \
36 break; \
37 } \
38 \
39 __xchg__res; \
40})
41
42#define xchg(ptr,x) \
43 ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))
44
45/* This function doesn't exist, so you'll get a linker error
46 * if something tries to do an invalid cmpxchg(). */
47extern void __cmpxchg_called_with_bad_pointer(void);
48
49#define __HAVE_ARCH_CMPXCHG 1
50
51static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
52 unsigned long new, int size)
53{
54 switch (size) {
55 case 4:
56 return __cmpxchg_u32(ptr, old, new);
57 }
58 __cmpxchg_called_with_bad_pointer();
59 return old;
60}
61
62#define cmpxchg(ptr,o,n) \
63 ({ \
64 __typeof__(*(ptr)) _o_ = (o); \
65 __typeof__(*(ptr)) _n_ = (n); \
66 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
67 (unsigned long)_n_, sizeof(*(ptr))); \
68 })
69
70#endif /* __ASM_SH_CMPXCHG_H */
diff --git a/arch/sh/include/asm/device.h b/arch/sh/include/asm/device.h
index 071bcb4d4bf..b16debfe8c1 100644
--- a/arch/sh/include/asm/device.h
+++ b/arch/sh/include/asm/device.h
@@ -3,10 +3,9 @@
3 * 3 *
4 * This file is released under the GPLv2 4 * This file is released under the GPLv2
5 */ 5 */
6#ifndef __ASM_SH_DEVICE_H
7#define __ASM_SH_DEVICE_H
8 6
9#include <asm-generic/device.h> 7struct dev_archdata {
8};
10 9
11struct platform_device; 10struct platform_device;
12/* allocate contiguous memory chunk and fill in struct resource */ 11/* allocate contiguous memory chunk and fill in struct resource */
@@ -15,4 +14,15 @@ int platform_resource_setup_memory(struct platform_device *pdev,
15 14
16void plat_early_device_setup(void); 15void plat_early_device_setup(void);
17 16
18#endif /* __ASM_SH_DEVICE_H */ 17#define PDEV_ARCHDATA_FLAG_INIT 0
18#define PDEV_ARCHDATA_FLAG_IDLE 1
19#define PDEV_ARCHDATA_FLAG_SUSP 2
20
21struct pdev_archdata {
22 int hwblk_id;
23#ifdef CONFIG_PM_RUNTIME
24 unsigned long flags;
25 struct list_head entry;
26 struct mutex mutex;
27#endif
28};
diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h
index b437f2c780b..1a73c3e759a 100644
--- a/arch/sh/include/asm/dma-mapping.h
+++ b/arch/sh/include/asm/dma-mapping.h
@@ -46,38 +46,31 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
46{ 46{
47 struct dma_map_ops *ops = get_dma_ops(dev); 47 struct dma_map_ops *ops = get_dma_ops(dev);
48 48
49 debug_dma_mapping_error(dev, dma_addr);
50 if (ops->mapping_error) 49 if (ops->mapping_error)
51 return ops->mapping_error(dev, dma_addr); 50 return ops->mapping_error(dev, dma_addr);
52 51
53 return dma_addr == 0; 52 return dma_addr == 0;
54} 53}
55 54
56#define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) 55static inline void *dma_alloc_coherent(struct device *dev, size_t size,
57 56 dma_addr_t *dma_handle, gfp_t gfp)
58static inline void *dma_alloc_attrs(struct device *dev, size_t size,
59 dma_addr_t *dma_handle, gfp_t gfp,
60 struct dma_attrs *attrs)
61{ 57{
62 struct dma_map_ops *ops = get_dma_ops(dev); 58 struct dma_map_ops *ops = get_dma_ops(dev);
63 void *memory; 59 void *memory;
64 60
65 if (dma_alloc_from_coherent(dev, size, dma_handle, &memory)) 61 if (dma_alloc_from_coherent(dev, size, dma_handle, &memory))
66 return memory; 62 return memory;
67 if (!ops->alloc) 63 if (!ops->alloc_coherent)
68 return NULL; 64 return NULL;
69 65
70 memory = ops->alloc(dev, size, dma_handle, gfp, attrs); 66 memory = ops->alloc_coherent(dev, size, dma_handle, gfp);
71 debug_dma_alloc_coherent(dev, size, *dma_handle, memory); 67 debug_dma_alloc_coherent(dev, size, *dma_handle, memory);
72 68
73 return memory; 69 return memory;
74} 70}
75 71
76#define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) 72static inline void dma_free_coherent(struct device *dev, size_t size,
77 73 void *vaddr, dma_addr_t dma_handle)
78static inline void dma_free_attrs(struct device *dev, size_t size,
79 void *vaddr, dma_addr_t dma_handle,
80 struct dma_attrs *attrs)
81{ 74{
82 struct dma_map_ops *ops = get_dma_ops(dev); 75 struct dma_map_ops *ops = get_dma_ops(dev);
83 76
@@ -85,16 +78,14 @@ static inline void dma_free_attrs(struct device *dev, size_t size,
85 return; 78 return;
86 79
87 debug_dma_free_coherent(dev, size, vaddr, dma_handle); 80 debug_dma_free_coherent(dev, size, vaddr, dma_handle);
88 if (ops->free) 81 if (ops->free_coherent)
89 ops->free(dev, size, vaddr, dma_handle, attrs); 82 ops->free_coherent(dev, size, vaddr, dma_handle);
90} 83}
91 84
92/* arch/sh/mm/consistent.c */ 85/* arch/sh/mm/consistent.c */
93extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, 86extern void *dma_generic_alloc_coherent(struct device *dev, size_t size,
94 dma_addr_t *dma_addr, gfp_t flag, 87 dma_addr_t *dma_addr, gfp_t flag);
95 struct dma_attrs *attrs);
96extern void dma_generic_free_coherent(struct device *dev, size_t size, 88extern void dma_generic_free_coherent(struct device *dev, size_t size,
97 void *vaddr, dma_addr_t dma_handle, 89 void *vaddr, dma_addr_t dma_handle);
98 struct dma_attrs *attrs);
99 90
100#endif /* __ASM_SH_DMA_MAPPING_H */ 91#endif /* __ASM_SH_DMA_MAPPING_H */
diff --git a/arch/sh/include/asm/dma.h b/arch/sh/include/asm/dma.h
index fb6e4f7b00a..07373a07409 100644
--- a/arch/sh/include/asm/dma.h
+++ b/arch/sh/include/asm/dma.h
@@ -14,9 +14,18 @@
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/wait.h> 15#include <linux/wait.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/device.h> 17#include <linux/sysdev.h>
18#include <cpu/dma.h>
18#include <asm-generic/dma.h> 19#include <asm-generic/dma.h>
19 20
21#ifdef CONFIG_NR_DMA_CHANNELS
22# define MAX_DMA_CHANNELS (CONFIG_NR_DMA_CHANNELS)
23#elif defined(CONFIG_NR_ONCHIP_DMA_CHANNELS)
24# define MAX_DMA_CHANNELS (CONFIG_NR_ONCHIP_DMA_CHANNELS)
25#else
26# define MAX_DMA_CHANNELS 0
27#endif
28
20/* 29/*
21 * Read and write modes can mean drastically different things depending on the 30 * Read and write modes can mean drastically different things depending on the
22 * channel configuration. Consult your DMAC documentation and module 31 * channel configuration. Consult your DMAC documentation and module
@@ -82,7 +91,7 @@ struct dma_channel {
82 91
83 wait_queue_head_t wait_queue; 92 wait_queue_head_t wait_queue;
84 93
85 struct device dev; 94 struct sys_device dev;
86 void *priv_data; 95 void *priv_data;
87}; 96};
88 97
diff --git a/arch/sh/include/asm/elf.h b/arch/sh/include/asm/elf.h
index 37924afa8d8..f38112be67d 100644
--- a/arch/sh/include/asm/elf.h
+++ b/arch/sh/include/asm/elf.h
@@ -183,8 +183,7 @@ do { \
183} while (0) 183} while (0)
184#endif 184#endif
185 185
186#define SET_PERSONALITY(ex) \ 186#define SET_PERSONALITY(ex) set_personality(PER_LINUX_32BIT)
187 set_personality(PER_LINUX_32BIT | (current->personality & (~PER_MASK)))
188 187
189#ifdef CONFIG_VSYSCALL 188#ifdef CONFIG_VSYSCALL
190/* vDSO has arch_setup_additional_pages */ 189/* vDSO has arch_setup_additional_pages */
diff --git a/arch/sh/include/asm/fixmap.h b/arch/sh/include/asm/fixmap.h
index cbe0186b679..bd7e79a1265 100644
--- a/arch/sh/include/asm/fixmap.h
+++ b/arch/sh/include/asm/fixmap.h
@@ -96,7 +96,7 @@ extern void __clear_fixmap(enum fixed_addresses idx, pgprot_t flags);
96#ifdef CONFIG_SUPERH32 96#ifdef CONFIG_SUPERH32
97#define FIXADDR_TOP (P4SEG - PAGE_SIZE) 97#define FIXADDR_TOP (P4SEG - PAGE_SIZE)
98#else 98#else
99#define FIXADDR_TOP ((unsigned long)(-PAGE_SIZE)) 99#define FIXADDR_TOP (0xff000000 - PAGE_SIZE)
100#endif 100#endif
101#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 101#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
102#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 102#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
diff --git a/arch/sh/include/asm/futex-irq.h b/arch/sh/include/asm/futex-irq.h
index 63d33129ea2..6cb9f193a95 100644
--- a/arch/sh/include/asm/futex-irq.h
+++ b/arch/sh/include/asm/futex-irq.h
@@ -1,6 +1,7 @@
1#ifndef __ASM_SH_FUTEX_IRQ_H 1#ifndef __ASM_SH_FUTEX_IRQ_H
2#define __ASM_SH_FUTEX_IRQ_H 2#define __ASM_SH_FUTEX_IRQ_H
3 3
4#include <asm/system.h>
4 5
5static inline int atomic_futex_op_xchg_set(int oparg, u32 __user *uaddr, 6static inline int atomic_futex_op_xchg_set(int oparg, u32 __user *uaddr,
6 int *oldval) 7 int *oldval)
diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
index b3808c7d67b..967068fb79a 100644
--- a/arch/sh/include/asm/hugetlb.h
+++ b/arch/sh/include/asm/hugetlb.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_SH_HUGETLB_H 1#ifndef _ASM_SH_HUGETLB_H
2#define _ASM_SH_HUGETLB_H 2#define _ASM_SH_HUGETLB_H
3 3
4#include <asm/cacheflush.h>
5#include <asm/page.h> 4#include <asm/page.h>
6 5
7 6
@@ -90,9 +89,4 @@ static inline void arch_release_hugepage(struct page *page)
90{ 89{
91} 90}
92 91
93static inline void arch_clear_hugepage_flags(struct page *page)
94{
95 clear_bit(PG_dcache_clean, &page->flags);
96}
97
98#endif /* _ASM_SH_HUGETLB_H */ 92#endif /* _ASM_SH_HUGETLB_H */
diff --git a/arch/sh/include/asm/hw_breakpoint.h b/arch/sh/include/asm/hw_breakpoint.h
index ec9ad593c3d..89890f61a7b 100644
--- a/arch/sh/include/asm/hw_breakpoint.h
+++ b/arch/sh/include/asm/hw_breakpoint.h
@@ -1,8 +1,7 @@
1#ifndef __ASM_SH_HW_BREAKPOINT_H 1#ifndef __ASM_SH_HW_BREAKPOINT_H
2#define __ASM_SH_HW_BREAKPOINT_H 2#define __ASM_SH_HW_BREAKPOINT_H
3 3
4#include <uapi/asm/hw_breakpoint.h> 4#ifdef __KERNEL__
5
6#define __ARCH_HW_BREAKPOINT_H 5#define __ARCH_HW_BREAKPOINT_H
7 6
8#include <linux/kdebug.h> 7#include <linux/kdebug.h>
@@ -67,4 +66,5 @@ extern int register_sh_ubc(struct sh_ubc *);
67 66
68extern struct pmu perf_ops_bp; 67extern struct pmu perf_ops_bp;
69 68
69#endif /* __KERNEL__ */
70#endif /* __ASM_SH_HW_BREAKPOINT_H */ 70#endif /* __ASM_SH_HW_BREAKPOINT_H */
diff --git a/arch/sh/include/asm/i2c-sh7760.h b/arch/sh/include/asm/i2c-sh7760.h
index 69fee1239b0..24182116711 100644
--- a/arch/sh/include/asm/i2c-sh7760.h
+++ b/arch/sh/include/asm/i2c-sh7760.h
@@ -9,9 +9,11 @@
9 9
10#define SH7760_I2C0_MMIO 0xFE140000 10#define SH7760_I2C0_MMIO 0xFE140000
11#define SH7760_I2C0_MMIOEND 0xFE14003B 11#define SH7760_I2C0_MMIOEND 0xFE14003B
12#define SH7760_I2C0_IRQ 62
12 13
13#define SH7760_I2C1_MMIO 0xFE150000 14#define SH7760_I2C1_MMIO 0xFE150000
14#define SH7760_I2C1_MMIOEND 0xFE15003B 15#define SH7760_I2C1_MMIOEND 0xFE15003B
16#define SH7760_I2C1_IRQ 63
15 17
16struct sh7760_i2c_platdata { 18struct sh7760_i2c_platdata {
17 unsigned int speed_khz; 19 unsigned int speed_khz;
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index 629db2ad791..28c5aa58bb4 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -14,6 +14,7 @@
14 */ 14 */
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <asm/cache.h> 16#include <asm/cache.h>
17#include <asm/system.h>
17#include <asm/addrspace.h> 18#include <asm/addrspace.h>
18#include <asm/machvec.h> 19#include <asm/machvec.h>
19#include <asm/pgtable.h> 20#include <asm/pgtable.h>
@@ -23,7 +24,6 @@
23#define __IO_PREFIX generic 24#define __IO_PREFIX generic
24#include <asm/io_generic.h> 25#include <asm/io_generic.h>
25#include <asm/io_trapped.h> 26#include <asm/io_trapped.h>
26#include <mach/mangle-port.h>
27 27
28#define __raw_writeb(v,a) (__chk_io_ptr(a), *(volatile u8 __force *)(a) = (v)) 28#define __raw_writeb(v,a) (__chk_io_ptr(a), *(volatile u8 __force *)(a) = (v))
29#define __raw_writew(v,a) (__chk_io_ptr(a), *(volatile u16 __force *)(a) = (v)) 29#define __raw_writew(v,a) (__chk_io_ptr(a), *(volatile u16 __force *)(a) = (v))
@@ -35,15 +35,21 @@
35#define __raw_readl(a) (__chk_io_ptr(a), *(volatile u32 __force *)(a)) 35#define __raw_readl(a) (__chk_io_ptr(a), *(volatile u32 __force *)(a))
36#define __raw_readq(a) (__chk_io_ptr(a), *(volatile u64 __force *)(a)) 36#define __raw_readq(a) (__chk_io_ptr(a), *(volatile u64 __force *)(a))
37 37
38#define readb_relaxed(c) ({ u8 __v = ioswabb(__raw_readb(c)); __v; }) 38#define readb_relaxed(c) ({ u8 __v = __raw_readb(c); __v; })
39#define readw_relaxed(c) ({ u16 __v = ioswabw(__raw_readw(c)); __v; }) 39#define readw_relaxed(c) ({ u16 __v = le16_to_cpu((__force __le16) \
40#define readl_relaxed(c) ({ u32 __v = ioswabl(__raw_readl(c)); __v; }) 40 __raw_readw(c)); __v; })
41#define readq_relaxed(c) ({ u64 __v = ioswabq(__raw_readq(c)); __v; }) 41#define readl_relaxed(c) ({ u32 __v = le32_to_cpu((__force __le32) \
42 42 __raw_readl(c)); __v; })
43#define writeb_relaxed(v,c) ((void)__raw_writeb((__force u8)ioswabb(v),c)) 43#define readq_relaxed(c) ({ u64 __v = le64_to_cpu((__force __le64) \
44#define writew_relaxed(v,c) ((void)__raw_writew((__force u16)ioswabw(v),c)) 44 __raw_readq(c)); __v; })
45#define writel_relaxed(v,c) ((void)__raw_writel((__force u32)ioswabl(v),c)) 45
46#define writeq_relaxed(v,c) ((void)__raw_writeq((__force u64)ioswabq(v),c)) 46#define writeb_relaxed(v,c) ((void)__raw_writeb(v,c))
47#define writew_relaxed(v,c) ((void)__raw_writew((__force u16) \
48 cpu_to_le16(v),c))
49#define writel_relaxed(v,c) ((void)__raw_writel((__force u32) \
50 cpu_to_le32(v),c))
51#define writeq_relaxed(v,c) ((void)__raw_writeq((__force u64) \
52 cpu_to_le64(v),c))
47 53
48#define readb(a) ({ u8 r_ = readb_relaxed(a); rmb(); r_; }) 54#define readb(a) ({ u8 r_ = readb_relaxed(a); rmb(); r_; })
49#define readw(a) ({ u16 r_ = readw_relaxed(a); rmb(); r_; }) 55#define readw(a) ({ u16 r_ = readw_relaxed(a); rmb(); r_; })
@@ -134,7 +140,7 @@ __BUILD_MEMORY_STRING(__raw_, q, u64)
134 * load/store instructions. sh_io_port_base is the virtual address to 140 * load/store instructions. sh_io_port_base is the virtual address to
135 * which all ports are being mapped. 141 * which all ports are being mapped.
136 */ 142 */
137extern unsigned long sh_io_port_base; 143extern const unsigned long sh_io_port_base;
138 144
139static inline void __set_io_port_base(unsigned long pbase) 145static inline void __set_io_port_base(unsigned long pbase)
140{ 146{
@@ -218,13 +224,8 @@ __BUILD_IOPORT_STRING(w, u16)
218__BUILD_IOPORT_STRING(l, u32) 224__BUILD_IOPORT_STRING(l, u32)
219__BUILD_IOPORT_STRING(q, u64) 225__BUILD_IOPORT_STRING(q, u64)
220 226
221#else /* !CONFIG_HAS_IOPORT */
222
223#include <asm/io_noioport.h>
224
225#endif 227#endif
226 228
227
228#define IO_SPACE_LIMIT 0xffffffff 229#define IO_SPACE_LIMIT 0xffffffff
229 230
230/* synco on SH-4A, otherwise a nop */ 231/* synco on SH-4A, otherwise a nop */
@@ -382,7 +383,7 @@ static inline int iounmap_fixed(void __iomem *addr) { return -EINVAL; }
382#define xlate_dev_kmem_ptr(p) p 383#define xlate_dev_kmem_ptr(p) p
383 384
384#define ARCH_HAS_VALID_PHYS_ADDR_RANGE 385#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
385int valid_phys_addr_range(phys_addr_t addr, size_t size); 386int valid_phys_addr_range(unsigned long addr, size_t size);
386int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); 387int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
387 388
388#endif /* __KERNEL__ */ 389#endif /* __KERNEL__ */
diff --git a/arch/sh/include/asm/io_noioport.h b/arch/sh/include/asm/io_noioport.h
deleted file mode 100644
index 4d48f1436a6..00000000000
--- a/arch/sh/include/asm/io_noioport.h
+++ /dev/null
@@ -1,52 +0,0 @@
1#ifndef __ASM_SH_IO_NOIOPORT_H
2#define __ASM_SH_IO_NOIOPORT_H
3
4static inline u8 inb(unsigned long addr)
5{
6 BUG();
7 return -1;
8}
9
10static inline u16 inw(unsigned long addr)
11{
12 BUG();
13 return -1;
14}
15
16static inline u32 inl(unsigned long addr)
17{
18 BUG();
19 return -1;
20}
21
22static inline void outb(unsigned char x, unsigned long port)
23{
24 BUG();
25}
26
27static inline void outw(unsigned short x, unsigned long port)
28{
29 BUG();
30}
31
32static inline void outl(unsigned int x, unsigned long port)
33{
34 BUG();
35}
36
37#define inb_p(addr) inb(addr)
38#define inw_p(addr) inw(addr)
39#define inl_p(addr) inl(addr)
40#define outb_p(x, addr) outb((x), (addr))
41#define outw_p(x, addr) outw((x), (addr))
42#define outl_p(x, addr) outl((x), (addr))
43
44#define insb(a, b, c) BUG()
45#define insw(a, b, c) BUG()
46#define insl(a, b, c) BUG()
47
48#define outsb(a, b, c) BUG()
49#define outsw(a, b, c) BUG()
50#define outsl(a, b, c) BUG()
51
52#endif /* __ASM_SH_IO_NOIOPORT_H */
diff --git a/arch/sh/include/asm/irq.h b/arch/sh/include/asm/irq.h
index 0e4f532e473..45d08b6a5ef 100644
--- a/arch/sh/include/asm/irq.h
+++ b/arch/sh/include/asm/irq.h
@@ -5,15 +5,12 @@
5#include <asm/machvec.h> 5#include <asm/machvec.h>
6 6
7/* 7/*
8 * Only legacy non-sparseirq platforms have to set a reasonably sane 8 * A sane default based on a reasonable vector table size, platforms are
9 * value here. sparseirq platforms allocate their irq_descs on the fly, 9 * advised to cap this at the hard limit that they're interested in
10 * so will expand automatically based on the number of registered IRQs. 10 * through the machvec.
11 */ 11 */
12#ifdef CONFIG_SPARSE_IRQ 12#define NR_IRQS 512
13# define NR_IRQS 8 13#define NR_IRQS_LEGACY 8 /* Legacy external IRQ0-7 */
14#else
15# define NR_IRQS 512
16#endif
17 14
18/* 15/*
19 * This is a special IRQ number for indicating that no IRQ has been 16 * This is a special IRQ number for indicating that no IRQ has been
@@ -24,6 +21,17 @@
24#define NO_IRQ_IGNORE ((unsigned int)-1) 21#define NO_IRQ_IGNORE ((unsigned int)-1)
25 22
26/* 23/*
24 * Convert back and forth between INTEVT and IRQ values.
25 */
26#ifdef CONFIG_CPU_HAS_INTEVT
27#define evt2irq(evt) (((evt) >> 5) - 16)
28#define irq2evt(irq) (((irq) + 16) << 5)
29#else
30#define evt2irq(evt) (evt)
31#define irq2evt(irq) (irq)
32#endif
33
34/*
27 * Simple Mask Register Support 35 * Simple Mask Register Support
28 */ 36 */
29extern void make_maskreg_irq(unsigned int irq); 37extern void make_maskreg_irq(unsigned int irq);
diff --git a/arch/sh/include/asm/kdebug.h b/arch/sh/include/asm/kdebug.h
index 8d6a831e7ba..5f6d2e9ccb7 100644
--- a/arch/sh/include/asm/kdebug.h
+++ b/arch/sh/include/asm/kdebug.h
@@ -10,8 +10,4 @@ enum die_val {
10 DIE_SSTEP, 10 DIE_SSTEP,
11}; 11};
12 12
13/* arch/sh/kernel/dumpstack.c */
14extern void printk_address(unsigned long address, int reliable);
15extern void dump_mem(const char *str, unsigned long bottom, unsigned long top);
16
17#endif /* __ASM_SH_KDEBUG_H */ 13#endif /* __ASM_SH_KDEBUG_H */
diff --git a/arch/sh/include/asm/kgdb.h b/arch/sh/include/asm/kgdb.h
index 9e7d2d1b03e..f3613952d1a 100644
--- a/arch/sh/include/asm/kgdb.h
+++ b/arch/sh/include/asm/kgdb.h
@@ -4,6 +4,18 @@
4#include <asm/cacheflush.h> 4#include <asm/cacheflush.h>
5#include <asm/ptrace.h> 5#include <asm/ptrace.h>
6 6
7/* Same as pt_regs but has vbr in place of syscall_nr */
8struct kgdb_regs {
9 unsigned long regs[16];
10 unsigned long pc;
11 unsigned long pr;
12 unsigned long sr;
13 unsigned long gbr;
14 unsigned long mach;
15 unsigned long macl;
16 unsigned long vbr;
17};
18
7enum regnames { 19enum regnames {
8 GDB_R0, GDB_R1, GDB_R2, GDB_R3, GDB_R4, GDB_R5, GDB_R6, GDB_R7, 20 GDB_R0, GDB_R1, GDB_R2, GDB_R3, GDB_R4, GDB_R5, GDB_R6, GDB_R7,
9 GDB_R8, GDB_R9, GDB_R10, GDB_R11, GDB_R12, GDB_R13, GDB_R14, GDB_R15, 21 GDB_R8, GDB_R9, GDB_R10, GDB_R11, GDB_R12, GDB_R13, GDB_R14, GDB_R15,
@@ -11,27 +23,17 @@ enum regnames {
11 GDB_PC, GDB_PR, GDB_SR, GDB_GBR, GDB_MACH, GDB_MACL, GDB_VBR, 23 GDB_PC, GDB_PR, GDB_SR, GDB_GBR, GDB_MACH, GDB_MACL, GDB_VBR,
12}; 24};
13 25
14#define _GP_REGS 16 26#define NUMREGBYTES ((GDB_VBR + 1) * 4)
15#define _EXTRA_REGS 7
16#define GDB_SIZEOF_REG sizeof(u32)
17
18#define DBG_MAX_REG_NUM (_GP_REGS + _EXTRA_REGS)
19#define NUMREGBYTES (DBG_MAX_REG_NUM * sizeof(GDB_SIZEOF_REG))
20 27
21static inline void arch_kgdb_breakpoint(void) 28static inline void arch_kgdb_breakpoint(void)
22{ 29{
23 __asm__ __volatile__ ("trapa #0x3c\n"); 30 __asm__ __volatile__ ("trapa #0x3c\n");
24} 31}
25 32
26#define BREAK_INSTR_SIZE 2 33#define BUFMAX 2048
27#define BUFMAX 2048
28
29#ifdef CONFIG_SMP
30# define CACHE_FLUSH_IS_SAFE 0
31#else
32# define CACHE_FLUSH_IS_SAFE 1
33#endif
34 34
35#define CACHE_FLUSH_IS_SAFE 1
36#define BREAK_INSTR_SIZE 2
35#define GDB_ADJUSTS_BREAK_OFFSET 37#define GDB_ADJUSTS_BREAK_OFFSET
36 38
37#endif /* __ASM_SH_KGDB_H */ 39#endif /* __ASM_SH_KGDB_H */
diff --git a/arch/sh/include/asm/machvec.h b/arch/sh/include/asm/machvec.h
index eb9c20d971d..57c5c3d0f39 100644
--- a/arch/sh/include/asm/machvec.h
+++ b/arch/sh/include/asm/machvec.h
@@ -17,6 +17,7 @@
17struct sh_machine_vector { 17struct sh_machine_vector {
18 void (*mv_setup)(char **cmdline_p); 18 void (*mv_setup)(char **cmdline_p);
19 const char *mv_name; 19 const char *mv_name;
20 int mv_nr_irqs;
20 21
21 int (*mv_irq_demux)(int irq); 22 int (*mv_irq_demux)(int irq);
22 void (*mv_init_irq)(void); 23 void (*mv_init_irq)(void);
diff --git a/arch/sh/include/asm/mmu_context.h b/arch/sh/include/asm/mmu_context.h
index 21c5088788d..384c7471a37 100644
--- a/arch/sh/include/asm/mmu_context.h
+++ b/arch/sh/include/asm/mmu_context.h
@@ -46,9 +46,9 @@
46#define MMU_VPN_MASK 0xfffff000 46#define MMU_VPN_MASK 0xfffff000
47 47
48#if defined(CONFIG_SUPERH32) 48#if defined(CONFIG_SUPERH32)
49#include <asm/mmu_context_32.h> 49#include "mmu_context_32.h"
50#else 50#else
51#include <asm/mmu_context_64.h> 51#include "mmu_context_64.h"
52#endif 52#endif
53 53
54/* 54/*
diff --git a/arch/sh/include/asm/module.h b/arch/sh/include/asm/module.h
index 81300d8b544..b7927de86f9 100644
--- a/arch/sh/include/asm/module.h
+++ b/arch/sh/include/asm/module.h
@@ -1,13 +1,21 @@
1#ifndef _ASM_SH_MODULE_H 1#ifndef _ASM_SH_MODULE_H
2#define _ASM_SH_MODULE_H 2#define _ASM_SH_MODULE_H
3 3
4#include <asm-generic/module.h>
5
6#ifdef CONFIG_DWARF_UNWINDER
7struct mod_arch_specific { 4struct mod_arch_specific {
5#ifdef CONFIG_DWARF_UNWINDER
8 struct list_head fde_list; 6 struct list_head fde_list;
9 struct list_head cie_list; 7 struct list_head cie_list;
8#endif
10}; 9};
10
11#ifdef CONFIG_64BIT
12#define Elf_Shdr Elf64_Shdr
13#define Elf_Sym Elf64_Sym
14#define Elf_Ehdr Elf64_Ehdr
15#else
16#define Elf_Shdr Elf32_Shdr
17#define Elf_Sym Elf32_Sym
18#define Elf_Ehdr Elf32_Ehdr
11#endif 19#endif
12 20
13#ifdef CONFIG_CPU_LITTLE_ENDIAN 21#ifdef CONFIG_CPU_LITTLE_ENDIAN
diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h
index 15d970328f7..abcc4dcc2d9 100644
--- a/arch/sh/include/asm/page.h
+++ b/arch/sh/include/asm/page.h
@@ -113,16 +113,6 @@ typedef struct page *pgtable_t;
113#define __MEMORY_SIZE CONFIG_MEMORY_SIZE 113#define __MEMORY_SIZE CONFIG_MEMORY_SIZE
114 114
115/* 115/*
116 * PHYSICAL_OFFSET is the offset in physical memory where the base
117 * of the kernel is loaded.
118 */
119#ifdef CONFIG_PHYSICAL_START
120#define PHYSICAL_OFFSET (CONFIG_PHYSICAL_START - __MEMORY_START)
121#else
122#define PHYSICAL_OFFSET 0
123#endif
124
125/*
126 * PAGE_OFFSET is the virtual address of the start of kernel address 116 * PAGE_OFFSET is the virtual address of the start of kernel address
127 * space. 117 * space.
128 */ 118 */
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
index bff96c2e7d2..cb21e2399dc 100644
--- a/arch/sh/include/asm/pci.h
+++ b/arch/sh/include/asm/pci.h
@@ -114,6 +114,12 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
114/* Board-specific fixup routines. */ 114/* Board-specific fixup routines. */
115int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin); 115int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin);
116 116
117extern void pcibios_resource_to_bus(struct pci_dev *dev,
118 struct pci_bus_region *region, struct resource *res);
119
120extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
121 struct pci_bus_region *region);
122
117#define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index 123#define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index
118 124
119static inline int pci_proc_domain(struct pci_bus *bus) 125static inline int pci_proc_domain(struct pci_bus *bus)
diff --git a/arch/sh/include/asm/pgtable_64.h b/arch/sh/include/asm/pgtable_64.h
index dda8c82601b..42cb9dd5216 100644
--- a/arch/sh/include/asm/pgtable_64.h
+++ b/arch/sh/include/asm/pgtable_64.h
@@ -87,6 +87,9 @@ static __inline__ void set_pte(pte_t *pteptr, pte_t pteval)
87#define pte_unmap(pte) do { } while (0) 87#define pte_unmap(pte) do { } while (0)
88 88
89#ifndef __ASSEMBLY__ 89#ifndef __ASSEMBLY__
90#define IOBASE_VADDR 0xff000000
91#define IOBASE_END 0xffffffff
92
90/* 93/*
91 * PTEL coherent flags. 94 * PTEL coherent flags.
92 * See Chapter 17 ST50 CPU Core Volume 1, Architecture. 95 * See Chapter 17 ST50 CPU Core Volume 1, Architecture.
diff --git a/arch/sh/include/asm/posix_types.h b/arch/sh/include/asm/posix_types.h
index 1aa781079b1..4eeb723aee7 100644
--- a/arch/sh/include/asm/posix_types.h
+++ b/arch/sh/include/asm/posix_types.h
@@ -1,5 +1,13 @@
1#ifdef __KERNEL__
1# ifdef CONFIG_SUPERH32 2# ifdef CONFIG_SUPERH32
2# include <asm/posix_types_32.h> 3# include "posix_types_32.h"
3# else 4# else
4# include <asm/posix_types_64.h> 5# include "posix_types_64.h"
5# endif 6# endif
7#else
8# ifdef __SH5__
9# include "posix_types_64.h"
10# else
11# include "posix_types_32.h"
12# endif
13#endif /* __KERNEL__ */
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
index 5448f9bbf4a..9c7bdfcaebb 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -18,8 +18,7 @@ enum cpu_type {
18 CPU_SH7619, 18 CPU_SH7619,
19 19
20 /* SH-2A types */ 20 /* SH-2A types */
21 CPU_SH7201, CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_SH7264, CPU_SH7269, 21 CPU_SH7201, CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_MXG,
22 CPU_MXG,
23 22
24 /* SH-3 types */ 23 /* SH-3 types */
25 CPU_SH7705, CPU_SH7706, CPU_SH7707, 24 CPU_SH7705, CPU_SH7706, CPU_SH7707,
@@ -33,7 +32,7 @@ enum cpu_type {
33 32
34 /* SH-4A types */ 33 /* SH-4A types */
35 CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SH7786, 34 CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SH7786,
36 CPU_SH7723, CPU_SH7724, CPU_SH7757, CPU_SH7734, CPU_SHX3, 35 CPU_SH7723, CPU_SH7724, CPU_SH7757, CPU_SHX3,
37 36
38 /* SH4AL-DSP types */ 37 /* SH4AL-DSP types */
39 CPU_SH7343, CPU_SH7722, CPU_SH7366, CPU_SH7372, 38 CPU_SH7343, CPU_SH7722, CPU_SH7366, CPU_SH7372,
@@ -86,6 +85,10 @@ struct sh_cpuinfo {
86 struct tlb_info itlb; 85 struct tlb_info itlb;
87 struct tlb_info dtlb; 86 struct tlb_info dtlb;
88 87
88#ifdef CONFIG_SMP
89 struct task_struct *idle;
90#endif
91
89 unsigned int phys_bits; 92 unsigned int phys_bits;
90 unsigned long flags; 93 unsigned long flags;
91} __attribute__ ((aligned(L1_CACHE_BYTES))); 94} __attribute__ ((aligned(L1_CACHE_BYTES)));
@@ -98,9 +101,6 @@ extern struct sh_cpuinfo cpu_data[];
98#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") 101#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory")
99#define cpu_relax() barrier() 102#define cpu_relax() barrier()
100 103
101void default_idle(void);
102void stop_this_cpu(void *);
103
104/* Forward decl */ 104/* Forward decl */
105struct seq_operations; 105struct seq_operations;
106struct task_struct; 106struct task_struct;
@@ -161,23 +161,12 @@ int vsyscall_init(void);
161#define vsyscall_init() do { } while (0) 161#define vsyscall_init() do { } while (0)
162#endif 162#endif
163 163
164/*
165 * SH-2A has both 16 and 32-bit opcodes, do lame encoding checks.
166 */
167#ifdef CONFIG_CPU_SH2A
168extern unsigned int instruction_size(unsigned int insn);
169#elif defined(CONFIG_SUPERH32)
170#define instruction_size(insn) (2)
171#else
172#define instruction_size(insn) (4)
173#endif
174
175#endif /* __ASSEMBLY__ */ 164#endif /* __ASSEMBLY__ */
176 165
177#ifdef CONFIG_SUPERH32 166#ifdef CONFIG_SUPERH32
178# include <asm/processor_32.h> 167# include "processor_32.h"
179#else 168#else
180# include <asm/processor_64.h> 169# include "processor_64.h"
181#endif 170#endif
182 171
183#endif /* __ASM_SH_PROCESSOR_H */ 172#endif /* __ASM_SH_PROCESSOR_H */
diff --git a/arch/sh/include/asm/processor_32.h b/arch/sh/include/asm/processor_32.h
index b1320d55ca3..900f8d72ffe 100644
--- a/arch/sh/include/asm/processor_32.h
+++ b/arch/sh/include/asm/processor_32.h
@@ -126,6 +126,14 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_pc, unsigned lo
126/* Free all resources held by a thread. */ 126/* Free all resources held by a thread. */
127extern void release_thread(struct task_struct *); 127extern void release_thread(struct task_struct *);
128 128
129/* Prepare to copy thread state - unlazy all lazy status */
130void prepare_to_copy(struct task_struct *tsk);
131
132/*
133 * create a kernel thread without removing it from tasklists
134 */
135extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
136
129/* Copy and release all segment info associated with a VM */ 137/* Copy and release all segment info associated with a VM */
130#define copy_segments(p, mm) do { } while(0) 138#define copy_segments(p, mm) do { } while(0)
131#define release_segments(mm) do { } while(0) 139#define release_segments(mm) do { } while(0)
diff --git a/arch/sh/include/asm/processor_64.h b/arch/sh/include/asm/processor_64.h
index 1ee8946f095..e25c4c7d6b6 100644
--- a/arch/sh/include/asm/processor_64.h
+++ b/arch/sh/include/asm/processor_64.h
@@ -121,6 +121,7 @@ struct thread_struct {
121 NULL for a kernel thread. */ 121 NULL for a kernel thread. */
122 struct pt_regs *uregs; 122 struct pt_regs *uregs;
123 123
124 unsigned long trap_no, error_code;
124 unsigned long address; 125 unsigned long address;
125 /* Hardware debugging registers may come here */ 126 /* Hardware debugging registers may come here */
126 127
@@ -137,6 +138,8 @@ struct thread_struct {
137 .pc = 0, \ 138 .pc = 0, \
138 .kregs = &fake_swapper_regs, \ 139 .kregs = &fake_swapper_regs, \
139 .uregs = NULL, \ 140 .uregs = NULL, \
141 .trap_no = 0, \
142 .error_code = 0, \
140 .address = 0, \ 143 .address = 0, \
141 .flags = 0, \ 144 .flags = 0, \
142} 145}
@@ -159,11 +162,17 @@ struct mm_struct;
159 162
160/* Free all resources held by a thread. */ 163/* Free all resources held by a thread. */
161extern void release_thread(struct task_struct *); 164extern void release_thread(struct task_struct *);
165/*
166 * create a kernel thread without removing it from tasklists
167 */
168extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
169
162 170
163/* Copy and release all segment info associated with a VM */ 171/* Copy and release all segment info associated with a VM */
164#define copy_segments(p, mm) do { } while (0) 172#define copy_segments(p, mm) do { } while (0)
165#define release_segments(mm) do { } while (0) 173#define release_segments(mm) do { } while (0)
166#define forget_segments() do { } while (0) 174#define forget_segments() do { } while (0)
175#define prepare_to_copy(tsk) do { } while (0)
167/* 176/*
168 * FPU lazy state save handling. 177 * FPU lazy state save handling.
169 */ 178 */
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h
index 2506c7db76b..2d3679b2447 100644
--- a/arch/sh/include/asm/ptrace.h
+++ b/arch/sh/include/asm/ptrace.h
@@ -1,16 +1,43 @@
1#ifndef __ASM_SH_PTRACE_H
2#define __ASM_SH_PTRACE_H
3
1/* 4/*
2 * Copyright (C) 1999, 2000 Niibe Yutaka 5 * Copyright (C) 1999, 2000 Niibe Yutaka
3 */ 6 */
4#ifndef __ASM_SH_PTRACE_H
5#define __ASM_SH_PTRACE_H
6 7
8#define PTRACE_GETREGS 12 /* General registers */
9#define PTRACE_SETREGS 13
10
11#define PTRACE_GETFPREGS 14 /* FPU registers */
12#define PTRACE_SETFPREGS 15
13
14#define PTRACE_GETFDPIC 31 /* get the ELF fdpic loadmap address */
15
16#define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */
17#define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */
18
19#define PTRACE_GETDSPREGS 55 /* DSP registers */
20#define PTRACE_SETDSPREGS 56
21
22#define PT_TEXT_END_ADDR 240
23#define PT_TEXT_ADDR 244 /* &(struct user)->start_code */
24#define PT_DATA_ADDR 248 /* &(struct user)->start_data */
25#define PT_TEXT_LEN 252
26
27#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
28#include "ptrace_64.h"
29#else
30#include "ptrace_32.h"
31#endif
32
33#ifdef __KERNEL__
7 34
8#include <linux/stringify.h> 35#include <linux/stringify.h>
9#include <linux/stddef.h> 36#include <linux/stddef.h>
10#include <linux/thread_info.h> 37#include <linux/thread_info.h>
11#include <asm/addrspace.h> 38#include <asm/addrspace.h>
12#include <asm/page.h> 39#include <asm/page.h>
13#include <uapi/asm/ptrace.h> 40#include <asm/system.h>
14 41
15#define user_mode(regs) (((regs)->sr & 0x40000000)==0) 42#define user_mode(regs) (((regs)->sr & 0x40000000)==0)
16#define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15]) 43#define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15])
@@ -114,4 +141,6 @@ static inline unsigned long profile_pc(struct pt_regs *regs)
114#define profile_pc profile_pc 141#define profile_pc profile_pc
115 142
116#include <asm-generic/ptrace.h> 143#include <asm-generic/ptrace.h>
144#endif /* __KERNEL__ */
145
117#endif /* __ASM_SH_PTRACE_H */ 146#endif /* __ASM_SH_PTRACE_H */
diff --git a/arch/sh/include/asm/ptrace_32.h b/arch/sh/include/asm/ptrace_32.h
index 1dd4480c536..6c2239cca1a 100644
--- a/arch/sh/include/asm/ptrace_32.h
+++ b/arch/sh/include/asm/ptrace_32.h
@@ -1,13 +1,83 @@
1#ifndef __ASM_SH_PTRACE_32_H 1#ifndef __ASM_SH_PTRACE_32_H
2#define __ASM_SH_PTRACE_32_H 2#define __ASM_SH_PTRACE_32_H
3 3
4#include <uapi/asm/ptrace_32.h> 4/*
5 * GCC defines register number like this:
6 * -----------------------------
7 * 0 - 15 are integer registers
8 * 17 - 22 are control/special registers
9 * 24 - 39 fp registers
10 * 40 - 47 xd registers
11 * 48 - fpscr register
12 * -----------------------------
13 *
14 * We follows above, except:
15 * 16 --- program counter (PC)
16 * 22 --- syscall #
17 * 23 --- floating point communication register
18 */
19#define REG_REG0 0
20#define REG_REG15 15
5 21
22#define REG_PC 16
23
24#define REG_PR 17
25#define REG_SR 18
26#define REG_GBR 19
27#define REG_MACH 20
28#define REG_MACL 21
29
30#define REG_SYSCALL 22
31
32#define REG_FPREG0 23
33#define REG_FPREG15 38
34#define REG_XFREG0 39
35#define REG_XFREG15 54
36
37#define REG_FPSCR 55
38#define REG_FPUL 56
39
40/*
41 * This struct defines the way the registers are stored on the
42 * kernel stack during a system call or other kernel entry.
43 */
44struct pt_regs {
45 unsigned long regs[16];
46 unsigned long pc;
47 unsigned long pr;
48 unsigned long sr;
49 unsigned long gbr;
50 unsigned long mach;
51 unsigned long macl;
52 long tra;
53};
54
55/*
56 * This struct defines the way the DSP registers are stored on the
57 * kernel stack during a system call or other kernel entry.
58 */
59struct pt_dspregs {
60 unsigned long a1;
61 unsigned long a0g;
62 unsigned long a1g;
63 unsigned long m0;
64 unsigned long m1;
65 unsigned long a0;
66 unsigned long x0;
67 unsigned long x1;
68 unsigned long y0;
69 unsigned long y1;
70 unsigned long dsr;
71 unsigned long rs;
72 unsigned long re;
73 unsigned long mod;
74};
75
76#ifdef __KERNEL__
6 77
7#define MAX_REG_OFFSET offsetof(struct pt_regs, tra) 78#define MAX_REG_OFFSET offsetof(struct pt_regs, tra)
8static inline long regs_return_value(struct pt_regs *regs) 79#define regs_return_value(_regs) ((_regs)->regs[0])
9{ 80
10 return regs->regs[0]; 81#endif /* __KERNEL__ */
11}
12 82
13#endif /* __ASM_SH_PTRACE_32_H */ 83#endif /* __ASM_SH_PTRACE_32_H */
diff --git a/arch/sh/include/asm/ptrace_64.h b/arch/sh/include/asm/ptrace_64.h
index 97f4b5660f2..bf9be7764d6 100644
--- a/arch/sh/include/asm/ptrace_64.h
+++ b/arch/sh/include/asm/ptrace_64.h
@@ -1,13 +1,20 @@
1#ifndef __ASM_SH_PTRACE_64_H 1#ifndef __ASM_SH_PTRACE_64_H
2#define __ASM_SH_PTRACE_64_H 2#define __ASM_SH_PTRACE_64_H
3 3
4#include <uapi/asm/ptrace_64.h> 4struct pt_regs {
5 unsigned long long pc;
6 unsigned long long sr;
7 long long syscall_nr;
8 unsigned long long regs[63];
9 unsigned long long tregs[8];
10 unsigned long long pad[2];
11};
5 12
13#ifdef __KERNEL__
6 14
7#define MAX_REG_OFFSET offsetof(struct pt_regs, tregs[7]) 15#define MAX_REG_OFFSET offsetof(struct pt_regs, tregs[7])
8static inline long regs_return_value(struct pt_regs *regs) 16#define regs_return_value(_regs) ((_regs)->regs[3])
9{ 17
10 return regs->regs[3]; 18#endif /* __KERNEL__ */
11}
12 19
13#endif /* __ASM_SH_PTRACE_64_H */ 20#endif /* __ASM_SH_PTRACE_64_H */
diff --git a/arch/sh/include/asm/sections.h b/arch/sh/include/asm/sections.h
index 1b6199740e9..4a5350037c8 100644
--- a/arch/sh/include/asm/sections.h
+++ b/arch/sh/include/asm/sections.h
@@ -6,6 +6,7 @@
6extern long __nosave_begin, __nosave_end; 6extern long __nosave_begin, __nosave_end;
7extern long __machvec_start, __machvec_end; 7extern long __machvec_start, __machvec_end;
8extern char __uncached_start, __uncached_end; 8extern char __uncached_start, __uncached_end;
9extern char _ebss[];
9extern char __start_eh_frame[], __stop_eh_frame[]; 10extern char __start_eh_frame[], __stop_eh_frame[];
10 11
11#endif /* __ASM_SH_SECTIONS_H */ 12#endif /* __ASM_SH_SECTIONS_H */
diff --git a/arch/sh/include/asm/setup.h b/arch/sh/include/asm/setup.h
index 99238108e7a..01fa17a3d75 100644
--- a/arch/sh/include/asm/setup.h
+++ b/arch/sh/include/asm/setup.h
@@ -1,8 +1,9 @@
1#ifndef _SH_SETUP_H 1#ifndef _SH_SETUP_H
2#define _SH_SETUP_H 2#define _SH_SETUP_H
3 3
4#include <uapi/asm/setup.h> 4#include <asm-generic/setup.h>
5 5
6#ifdef __KERNEL__
6/* 7/*
7 * This is set up by the setup-routine at boot-time 8 * This is set up by the setup-routine at boot-time
8 */ 9 */
@@ -19,6 +20,7 @@
19 20
20void sh_mv_setup(void); 21void sh_mv_setup(void);
21void check_for_initrd(void); 22void check_for_initrd(void);
22void per_cpu_trap_init(void); 23
24#endif /* __KERNEL__ */
23 25
24#endif /* _SH_SETUP_H */ 26#endif /* _SH_SETUP_H */
diff --git a/arch/sh/include/asm/siu.h b/arch/sh/include/asm/siu.h
index 580b7ac228b..1d95c78808d 100644
--- a/arch/sh/include/asm/siu.h
+++ b/arch/sh/include/asm/siu.h
@@ -14,6 +14,7 @@
14struct device; 14struct device;
15 15
16struct siu_platform { 16struct siu_platform {
17 struct device *dma_dev;
17 unsigned int dma_slave_tx_a; 18 unsigned int dma_slave_tx_a;
18 unsigned int dma_slave_rx_a; 19 unsigned int dma_slave_rx_a;
19 unsigned int dma_slave_tx_b; 20 unsigned int dma_slave_tx_b;
diff --git a/arch/sh/include/asm/stackprotector.h b/arch/sh/include/asm/stackprotector.h
deleted file mode 100644
index d9df3a76847..00000000000
--- a/arch/sh/include/asm/stackprotector.h
+++ /dev/null
@@ -1,27 +0,0 @@
1#ifndef __ASM_SH_STACKPROTECTOR_H
2#define __ASM_SH_STACKPROTECTOR_H
3
4#include <linux/random.h>
5#include <linux/version.h>
6
7extern unsigned long __stack_chk_guard;
8
9/*
10 * Initialize the stackprotector canary value.
11 *
12 * NOTE: this must only be called from functions that never return,
13 * and it must always be inlined.
14 */
15static __always_inline void boot_init_stack_canary(void)
16{
17 unsigned long canary;
18
19 /* Try to get a semi random initial value. */
20 get_random_bytes(&canary, sizeof(canary));
21 canary ^= LINUX_VERSION_CODE;
22
23 current->stack_canary = canary;
24 __stack_chk_guard = current->stack_canary;
25}
26
27#endif /* __ASM_SH_STACKPROTECTOR_H */
diff --git a/arch/sh/include/asm/string.h b/arch/sh/include/asm/string.h
index 114011fa08a..8c1ea21dc0a 100644
--- a/arch/sh/include/asm/string.h
+++ b/arch/sh/include/asm/string.h
@@ -1,5 +1,5 @@
1#ifdef CONFIG_SUPERH32 1#ifdef CONFIG_SUPERH32
2# include <asm/string_32.h> 2# include "string_32.h"
3#else 3#else
4# include <asm/string_64.h> 4# include "string_64.h"
5#endif 5#endif
diff --git a/arch/sh/include/asm/switch_to.h b/arch/sh/include/asm/switch_to.h
deleted file mode 100644
index bcd722fc834..00000000000
--- a/arch/sh/include/asm/switch_to.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001 Paolo Alberelli
3 * Copyright (C) 2003 Paul Mundt
4 * Copyright (C) 2004 Richard Curnow
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#ifndef __ASM_SH_SWITCH_TO_H
11#define __ASM_SH_SWITCH_TO_H
12
13#ifdef CONFIG_SUPERH32
14# include <asm/switch_to_32.h>
15#else
16# include <asm/switch_to_64.h>
17#endif
18
19#endif /* __ASM_SH_SWITCH_TO_H */
diff --git a/arch/sh/include/asm/switch_to_32.h b/arch/sh/include/asm/switch_to_32.h
deleted file mode 100644
index 0c065513e7a..00000000000
--- a/arch/sh/include/asm/switch_to_32.h
+++ /dev/null
@@ -1,134 +0,0 @@
1#ifndef __ASM_SH_SWITCH_TO_32_H
2#define __ASM_SH_SWITCH_TO_32_H
3
4#ifdef CONFIG_SH_DSP
5
6#define is_dsp_enabled(tsk) \
7 (!!(tsk->thread.dsp_status.status & SR_DSP))
8
9#define __restore_dsp(tsk) \
10do { \
11 register u32 *__ts2 __asm__ ("r2") = \
12 (u32 *)&tsk->thread.dsp_status; \
13 __asm__ __volatile__ ( \
14 ".balign 4\n\t" \
15 "movs.l @r2+, a0\n\t" \
16 "movs.l @r2+, a1\n\t" \
17 "movs.l @r2+, a0g\n\t" \
18 "movs.l @r2+, a1g\n\t" \
19 "movs.l @r2+, m0\n\t" \
20 "movs.l @r2+, m1\n\t" \
21 "movs.l @r2+, x0\n\t" \
22 "movs.l @r2+, x1\n\t" \
23 "movs.l @r2+, y0\n\t" \
24 "movs.l @r2+, y1\n\t" \
25 "lds.l @r2+, dsr\n\t" \
26 "ldc.l @r2+, rs\n\t" \
27 "ldc.l @r2+, re\n\t" \
28 "ldc.l @r2+, mod\n\t" \
29 : : "r" (__ts2)); \
30} while (0)
31
32#define __save_dsp(tsk) \
33do { \
34 register u32 *__ts2 __asm__ ("r2") = \
35 (u32 *)&tsk->thread.dsp_status + 14; \
36 \
37 __asm__ __volatile__ ( \
38 ".balign 4\n\t" \
39 "stc.l mod, @-r2\n\t" \
40 "stc.l re, @-r2\n\t" \
41 "stc.l rs, @-r2\n\t" \
42 "sts.l dsr, @-r2\n\t" \
43 "movs.l y1, @-r2\n\t" \
44 "movs.l y0, @-r2\n\t" \
45 "movs.l x1, @-r2\n\t" \
46 "movs.l x0, @-r2\n\t" \
47 "movs.l m1, @-r2\n\t" \
48 "movs.l m0, @-r2\n\t" \
49 "movs.l a1g, @-r2\n\t" \
50 "movs.l a0g, @-r2\n\t" \
51 "movs.l a1, @-r2\n\t" \
52 "movs.l a0, @-r2\n\t" \
53 : : "r" (__ts2)); \
54} while (0)
55
56#else
57
58#define is_dsp_enabled(tsk) (0)
59#define __save_dsp(tsk) do { } while (0)
60#define __restore_dsp(tsk) do { } while (0)
61#endif
62
63struct task_struct *__switch_to(struct task_struct *prev,
64 struct task_struct *next);
65
66/*
67 * switch_to() should switch tasks to task nr n, first
68 */
69#define switch_to(prev, next, last) \
70do { \
71 register u32 *__ts1 __asm__ ("r1"); \
72 register u32 *__ts2 __asm__ ("r2"); \
73 register u32 *__ts4 __asm__ ("r4"); \
74 register u32 *__ts5 __asm__ ("r5"); \
75 register u32 *__ts6 __asm__ ("r6"); \
76 register u32 __ts7 __asm__ ("r7"); \
77 struct task_struct *__last; \
78 \
79 if (is_dsp_enabled(prev)) \
80 __save_dsp(prev); \
81 \
82 __ts1 = (u32 *)&prev->thread.sp; \
83 __ts2 = (u32 *)&prev->thread.pc; \
84 __ts4 = (u32 *)prev; \
85 __ts5 = (u32 *)next; \
86 __ts6 = (u32 *)&next->thread.sp; \
87 __ts7 = next->thread.pc; \
88 \
89 __asm__ __volatile__ ( \
90 ".balign 4\n\t" \
91 "stc.l gbr, @-r15\n\t" \
92 "sts.l pr, @-r15\n\t" \
93 "mov.l r8, @-r15\n\t" \
94 "mov.l r9, @-r15\n\t" \
95 "mov.l r10, @-r15\n\t" \
96 "mov.l r11, @-r15\n\t" \
97 "mov.l r12, @-r15\n\t" \
98 "mov.l r13, @-r15\n\t" \
99 "mov.l r14, @-r15\n\t" \
100 "mov.l r15, @r1\t! save SP\n\t" \
101 "mov.l @r6, r15\t! change to new stack\n\t" \
102 "mova 1f, %0\n\t" \
103 "mov.l %0, @r2\t! save PC\n\t" \
104 "mov.l 2f, %0\n\t" \
105 "jmp @%0\t! call __switch_to\n\t" \
106 " lds r7, pr\t! with return to new PC\n\t" \
107 ".balign 4\n" \
108 "2:\n\t" \
109 ".long __switch_to\n" \
110 "1:\n\t" \
111 "mov.l @r15+, r14\n\t" \
112 "mov.l @r15+, r13\n\t" \
113 "mov.l @r15+, r12\n\t" \
114 "mov.l @r15+, r11\n\t" \
115 "mov.l @r15+, r10\n\t" \
116 "mov.l @r15+, r9\n\t" \
117 "mov.l @r15+, r8\n\t" \
118 "lds.l @r15+, pr\n\t" \
119 "ldc.l @r15+, gbr\n\t" \
120 : "=z" (__last) \
121 : "r" (__ts1), "r" (__ts2), "r" (__ts4), \
122 "r" (__ts5), "r" (__ts6), "r" (__ts7) \
123 : "r3", "t"); \
124 \
125 last = __last; \
126} while (0)
127
128#define finish_arch_switch(prev) \
129do { \
130 if (is_dsp_enabled(prev)) \
131 __restore_dsp(prev); \
132} while (0)
133
134#endif /* __ASM_SH_SWITCH_TO_32_H */
diff --git a/arch/sh/include/asm/switch_to_64.h b/arch/sh/include/asm/switch_to_64.h
deleted file mode 100644
index ba3129d6bc2..00000000000
--- a/arch/sh/include/asm/switch_to_64.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001 Paolo Alberelli
3 * Copyright (C) 2003 Paul Mundt
4 * Copyright (C) 2004 Richard Curnow
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#ifndef __ASM_SH_SWITCH_TO_64_H
11#define __ASM_SH_SWITCH_TO_64_H
12
13struct thread_struct;
14struct task_struct;
15
16/*
17 * switch_to() should switch tasks to task nr n, first
18 */
19struct task_struct *sh64_switch_to(struct task_struct *prev,
20 struct thread_struct *prev_thread,
21 struct task_struct *next,
22 struct thread_struct *next_thread);
23
24#define switch_to(prev,next,last) \
25do { \
26 if (last_task_used_math != next) { \
27 struct pt_regs *regs = next->thread.uregs; \
28 if (regs) regs->sr |= SR_FD; \
29 } \
30 last = sh64_switch_to(prev, &prev->thread, next, \
31 &next->thread); \
32} while (0)
33
34
35#endif /* __ASM_SH_SWITCH_TO_64_H */
diff --git a/arch/sh/include/asm/syscall.h b/arch/sh/include/asm/syscall.h
index 847128da6ea..aa7777bdc37 100644
--- a/arch/sh/include/asm/syscall.h
+++ b/arch/sh/include/asm/syscall.h
@@ -4,9 +4,9 @@
4extern const unsigned long sys_call_table[]; 4extern const unsigned long sys_call_table[];
5 5
6#ifdef CONFIG_SUPERH32 6#ifdef CONFIG_SUPERH32
7# include <asm/syscall_32.h> 7# include "syscall_32.h"
8#else 8#else
9# include <asm/syscall_64.h> 9# include "syscall_64.h"
10#endif 10#endif
11 11
12#endif /* __ASM_SH_SYSCALL_H */ 12#endif /* __ASM_SH_SYSCALL_H */
diff --git a/arch/sh/include/asm/syscalls.h b/arch/sh/include/asm/syscalls.h
index 3dbfef06f6b..507725af2e5 100644
--- a/arch/sh/include/asm/syscalls.h
+++ b/arch/sh/include/asm/syscalls.h
@@ -11,9 +11,9 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
11 unsigned long fd, unsigned long pgoff); 11 unsigned long fd, unsigned long pgoff);
12 12
13#ifdef CONFIG_SUPERH32 13#ifdef CONFIG_SUPERH32
14# include <asm/syscalls_32.h> 14# include "syscalls_32.h"
15#else 15#else
16# include <asm/syscalls_64.h> 16# include "syscalls_64.h"
17#endif 17#endif
18 18
19#endif /* __KERNEL__ */ 19#endif /* __KERNEL__ */
diff --git a/arch/sh/include/asm/syscalls_32.h b/arch/sh/include/asm/syscalls_32.h
index cc25485996b..ae717e3c26d 100644
--- a/arch/sh/include/asm/syscalls_32.h
+++ b/arch/sh/include/asm/syscalls_32.h
@@ -9,7 +9,23 @@
9 9
10struct pt_regs; 10struct pt_regs;
11 11
12asmlinkage int sys_sigsuspend(old_sigset_t mask); 12asmlinkage int sys_fork(unsigned long r4, unsigned long r5,
13 unsigned long r6, unsigned long r7,
14 struct pt_regs __regs);
15asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
16 unsigned long parent_tidptr,
17 unsigned long child_tidptr,
18 struct pt_regs __regs);
19asmlinkage int sys_vfork(unsigned long r4, unsigned long r5,
20 unsigned long r6, unsigned long r7,
21 struct pt_regs __regs);
22asmlinkage int sys_execve(const char __user *ufilename,
23 const char __user *const __user *uargv,
24 const char __user *const __user *uenvp,
25 unsigned long r7, struct pt_regs __regs);
26asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r5,
27 unsigned long r6, unsigned long r7,
28 struct pt_regs __regs);
13asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act, 29asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act,
14 struct old_sigaction __user *oact); 30 struct old_sigaction __user *oact);
15asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, 31asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
diff --git a/arch/sh/include/asm/syscalls_64.h b/arch/sh/include/asm/syscalls_64.h
index d62e8eb22f7..ee519f41d95 100644
--- a/arch/sh/include/asm/syscalls_64.h
+++ b/arch/sh/include/asm/syscalls_64.h
@@ -9,6 +9,23 @@
9 9
10struct pt_regs; 10struct pt_regs;
11 11
12asmlinkage int sys_fork(unsigned long r2, unsigned long r3,
13 unsigned long r4, unsigned long r5,
14 unsigned long r6, unsigned long r7,
15 struct pt_regs *pregs);
16asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
17 unsigned long r4, unsigned long r5,
18 unsigned long r6, unsigned long r7,
19 struct pt_regs *pregs);
20asmlinkage int sys_vfork(unsigned long r2, unsigned long r3,
21 unsigned long r4, unsigned long r5,
22 unsigned long r6, unsigned long r7,
23 struct pt_regs *pregs);
24asmlinkage int sys_execve(const char *ufilename, char **uargv,
25 char **uenvp, unsigned long r5,
26 unsigned long r6, unsigned long r7,
27 struct pt_regs *pregs);
28
12/* Misc syscall related bits */ 29/* Misc syscall related bits */
13asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs); 30asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs);
14asmlinkage void do_syscall_trace_leave(struct pt_regs *regs); 31asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
index 7d5ac4e4848..ea2d5089de1 100644
--- a/arch/sh/include/asm/thread_info.h
+++ b/arch/sh/include/asm/thread_info.h
@@ -10,18 +10,8 @@
10 * - Incorporating suggestions made by Linus Torvalds and Dave Miller 10 * - Incorporating suggestions made by Linus Torvalds and Dave Miller
11 */ 11 */
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13
14#include <asm/page.h> 13#include <asm/page.h>
15 14
16/*
17 * Page fault error code bits
18 */
19#define FAULT_CODE_WRITE (1 << 0) /* write access */
20#define FAULT_CODE_INITIAL (1 << 1) /* initial page write */
21#define FAULT_CODE_ITLB (1 << 2) /* ITLB miss */
22#define FAULT_CODE_PROT (1 << 3) /* protection fault */
23#define FAULT_CODE_USER (1 << 4) /* user-mode access */
24
25#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
26#include <asm/processor.h> 16#include <asm/processor.h>
27 17
@@ -98,23 +88,29 @@ static inline struct thread_info *current_thread_info(void)
98 return ti; 88 return ti;
99} 89}
100 90
91/* thread information allocation */
92#if THREAD_SHIFT >= PAGE_SHIFT
93
101#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT) 94#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
102 95
96#endif
97
98extern struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node);
99extern void free_thread_info(struct thread_info *ti);
103extern void arch_task_cache_init(void); 100extern void arch_task_cache_init(void);
101#define arch_task_cache_init arch_task_cache_init
104extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); 102extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
105extern void arch_release_task_struct(struct task_struct *tsk);
106extern void init_thread_xstate(void); 103extern void init_thread_xstate(void);
107 104
105#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
106
108#endif /* __ASSEMBLY__ */ 107#endif /* __ASSEMBLY__ */
109 108
110/* 109/*
111 * Thread information flags 110 * thread information flags
112 * 111 * - these are process state flags that various assembly files may need to access
113 * - Limited to 24 bits, upper byte used for fault code encoding. 112 * - pending work-to-be-done flags are in LSW
114 * 113 * - other flags in MSW
115 * - _TIF_ALLWORK_MASK and _TIF_WORK_MASK need to fit within 2 bytes, or
116 * we blow the tst immediate size constraints and need to fix up
117 * arch/sh/kernel/entry-common.S.
118 */ 114 */
119#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 115#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
120#define TIF_SIGPENDING 1 /* signal pending */ 116#define TIF_SIGPENDING 1 /* signal pending */
@@ -126,6 +122,7 @@ extern void init_thread_xstate(void);
126#define TIF_SYSCALL_TRACEPOINT 8 /* for ftrace syscall instrumentation */ 122#define TIF_SYSCALL_TRACEPOINT 8 /* for ftrace syscall instrumentation */
127#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 123#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */
128#define TIF_MEMDIE 18 /* is terminating due to OOM killer */ 124#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
125#define TIF_FREEZE 19 /* Freezing for suspend */
129 126
130#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 127#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
131#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 128#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
@@ -136,6 +133,13 @@ extern void init_thread_xstate(void);
136#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 133#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
137#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) 134#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
138#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 135#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
136#define _TIF_FREEZE (1 << TIF_FREEZE)
137
138/*
139 * _TIF_ALLWORK_MASK and _TIF_WORK_MASK need to fit within 2 bytes, or we
140 * blow the tst immediate size constraints and need to fix up
141 * arch/sh/kernel/entry-common.S.
142 */
139 143
140/* work to do in syscall trace */ 144/* work to do in syscall trace */
141#define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \ 145#define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
@@ -163,52 +167,13 @@ extern void init_thread_xstate(void);
163#define TS_USEDFPU 0x0002 /* FPU used by this task this quantum */ 167#define TS_USEDFPU 0x0002 /* FPU used by this task this quantum */
164 168
165#ifndef __ASSEMBLY__ 169#ifndef __ASSEMBLY__
166
167#define HAVE_SET_RESTORE_SIGMASK 1 170#define HAVE_SET_RESTORE_SIGMASK 1
168static inline void set_restore_sigmask(void) 171static inline void set_restore_sigmask(void)
169{ 172{
170 struct thread_info *ti = current_thread_info(); 173 struct thread_info *ti = current_thread_info();
171 ti->status |= TS_RESTORE_SIGMASK; 174 ti->status |= TS_RESTORE_SIGMASK;
172 WARN_ON(!test_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags)); 175 set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags);
173} 176}
174
175#define TI_FLAG_FAULT_CODE_SHIFT 24
176
177/*
178 * Additional thread flag encoding
179 */
180static inline void set_thread_fault_code(unsigned int val)
181{
182 struct thread_info *ti = current_thread_info();
183 ti->flags = (ti->flags & (~0 >> (32 - TI_FLAG_FAULT_CODE_SHIFT)))
184 | (val << TI_FLAG_FAULT_CODE_SHIFT);
185}
186
187static inline unsigned int get_thread_fault_code(void)
188{
189 struct thread_info *ti = current_thread_info();
190 return ti->flags >> TI_FLAG_FAULT_CODE_SHIFT;
191}
192
193static inline void clear_restore_sigmask(void)
194{
195 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
196}
197static inline bool test_restore_sigmask(void)
198{
199 return current_thread_info()->status & TS_RESTORE_SIGMASK;
200}
201static inline bool test_and_clear_restore_sigmask(void)
202{
203 struct thread_info *ti = current_thread_info();
204 if (!(ti->status & TS_RESTORE_SIGMASK))
205 return false;
206 ti->status &= ~TS_RESTORE_SIGMASK;
207 return true;
208}
209
210#define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG)
211
212#endif /* !__ASSEMBLY__ */ 177#endif /* !__ASSEMBLY__ */
213 178
214#endif /* __KERNEL__ */ 179#endif /* __KERNEL__ */
diff --git a/arch/sh/include/asm/tlb.h b/arch/sh/include/asm/tlb.h
index e61d43d9f68..ec88bfcdf7c 100644
--- a/arch/sh/include/asm/tlb.h
+++ b/arch/sh/include/asm/tlb.h
@@ -2,7 +2,7 @@
2#define __ASM_SH_TLB_H 2#define __ASM_SH_TLB_H
3 3
4#ifdef CONFIG_SUPERH64 4#ifdef CONFIG_SUPERH64
5# include <asm/tlb_64.h> 5# include "tlb_64.h"
6#endif 6#endif
7 7
8#ifndef __ASSEMBLY__ 8#ifndef __ASSEMBLY__
diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h
index b0a282d65f6..88e734069fa 100644
--- a/arch/sh/include/asm/topology.h
+++ b/arch/sh/include/asm/topology.h
@@ -3,6 +3,31 @@
3 3
4#ifdef CONFIG_NUMA 4#ifdef CONFIG_NUMA
5 5
6/* sched_domains SD_NODE_INIT for sh machines */
7#define SD_NODE_INIT (struct sched_domain) { \
8 .parent = NULL, \
9 .child = NULL, \
10 .groups = NULL, \
11 .min_interval = 8, \
12 .max_interval = 32, \
13 .busy_factor = 32, \
14 .imbalance_pct = 125, \
15 .cache_nice_tries = 2, \
16 .busy_idx = 3, \
17 .idle_idx = 2, \
18 .newidle_idx = 0, \
19 .wake_idx = 0, \
20 .forkexec_idx = 0, \
21 .flags = SD_LOAD_BALANCE \
22 | SD_BALANCE_FORK \
23 | SD_BALANCE_EXEC \
24 | SD_BALANCE_NEWIDLE \
25 | SD_SERIALIZE, \
26 .last_balance = jiffies, \
27 .balance_interval = 1, \
28 .nr_balance_failed = 0, \
29}
30
6#define cpu_to_node(cpu) ((void)(cpu),0) 31#define cpu_to_node(cpu) ((void)(cpu),0)
7#define parent_node(node) ((void)(node),0) 32#define parent_node(node) ((void)(node),0)
8 33
diff --git a/arch/sh/include/asm/traps.h b/arch/sh/include/asm/traps.h
deleted file mode 100644
index 9cc149a0dbd..00000000000
--- a/arch/sh/include/asm/traps.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef __ASM_SH_TRAPS_H
2#define __ASM_SH_TRAPS_H
3
4#include <linux/compiler.h>
5
6#ifdef CONFIG_SUPERH32
7# include <asm/traps_32.h>
8#else
9# include <asm/traps_64.h>
10#endif
11
12BUILD_TRAP_HANDLER(address_error);
13BUILD_TRAP_HANDLER(debug);
14BUILD_TRAP_HANDLER(bug);
15BUILD_TRAP_HANDLER(breakpoint);
16BUILD_TRAP_HANDLER(singlestep);
17BUILD_TRAP_HANDLER(fpu_error);
18BUILD_TRAP_HANDLER(fpu_state_restore);
19BUILD_TRAP_HANDLER(nmi);
20
21#endif /* __ASM_SH_TRAPS_H */
diff --git a/arch/sh/include/asm/traps_32.h b/arch/sh/include/asm/traps_32.h
deleted file mode 100644
index cfd55ff9dff..00000000000
--- a/arch/sh/include/asm/traps_32.h
+++ /dev/null
@@ -1,68 +0,0 @@
1#ifndef __ASM_SH_TRAPS_32_H
2#define __ASM_SH_TRAPS_32_H
3
4#include <linux/types.h>
5#include <asm/mmu.h>
6
7#ifdef CONFIG_CPU_HAS_SR_RB
8#define lookup_exception_vector() \
9({ \
10 unsigned long _vec; \
11 \
12 __asm__ __volatile__ ( \
13 "stc r2_bank, %0\n\t" \
14 : "=r" (_vec) \
15 ); \
16 \
17 _vec; \
18})
19#else
20#define lookup_exception_vector() \
21({ \
22 unsigned long _vec; \
23 __asm__ __volatile__ ( \
24 "mov r4, %0\n\t" \
25 : "=r" (_vec) \
26 ); \
27 \
28 _vec; \
29})
30#endif
31
32static inline void trigger_address_error(void)
33{
34 __asm__ __volatile__ (
35 "ldc %0, sr\n\t"
36 "mov.l @%1, %0"
37 :
38 : "r" (0x10000000), "r" (0x80000001)
39 );
40}
41
42asmlinkage void do_address_error(struct pt_regs *regs,
43 unsigned long writeaccess,
44 unsigned long address);
45asmlinkage void do_divide_error(unsigned long r4, unsigned long r5,
46 unsigned long r6, unsigned long r7,
47 struct pt_regs __regs);
48asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5,
49 unsigned long r6, unsigned long r7,
50 struct pt_regs __regs);
51asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5,
52 unsigned long r6, unsigned long r7,
53 struct pt_regs __regs);
54asmlinkage void do_exception_error(unsigned long r4, unsigned long r5,
55 unsigned long r6, unsigned long r7,
56 struct pt_regs __regs);
57
58#define BUILD_TRAP_HANDLER(name) \
59asmlinkage void name##_trap_handler(unsigned long r4, unsigned long r5, \
60 unsigned long r6, unsigned long r7, \
61 struct pt_regs __regs)
62
63#define TRAP_HANDLER_DECL \
64 struct pt_regs *regs = RELOC_HIDE(&__regs, 0); \
65 unsigned int vec = regs->tra; \
66 (void)vec;
67
68#endif /* __ASM_SH_TRAPS_32_H */
diff --git a/arch/sh/include/asm/traps_64.h b/arch/sh/include/asm/traps_64.h
deleted file mode 100644
index ef5eff91944..00000000000
--- a/arch/sh/include/asm/traps_64.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001 Paolo Alberelli
3 * Copyright (C) 2003 Paul Mundt
4 * Copyright (C) 2004 Richard Curnow
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#ifndef __ASM_SH_TRAPS_64_H
11#define __ASM_SH_TRAPS_64_H
12
13#include <cpu/registers.h>
14
15extern void phys_stext(void);
16
17#define lookup_exception_vector() \
18({ \
19 unsigned long _vec; \
20 \
21 __asm__ __volatile__ ( \
22 "getcon " __EXPEVT ", %0\n\t" \
23 : "=r" (_vec) \
24 ); \
25 \
26 _vec; \
27})
28
29static inline void trigger_address_error(void)
30{
31 phys_stext();
32}
33
34#define BUILD_TRAP_HANDLER(name) \
35asmlinkage void name##_trap_handler(unsigned int vec, struct pt_regs *regs)
36#define TRAP_HANDLER_DECL
37
38#endif /* __ASM_SH_TRAPS_64_H */
diff --git a/arch/sh/include/asm/types.h b/arch/sh/include/asm/types.h
index 6a31053fa5e..f8421f7ad63 100644
--- a/arch/sh/include/asm/types.h
+++ b/arch/sh/include/asm/types.h
@@ -1,11 +1,12 @@
1#ifndef __ASM_SH_TYPES_H 1#ifndef __ASM_SH_TYPES_H
2#define __ASM_SH_TYPES_H 2#define __ASM_SH_TYPES_H
3 3
4#include <uapi/asm/types.h> 4#include <asm-generic/types.h>
5 5
6/* 6/*
7 * These aren't exported outside the kernel to avoid name space clashes 7 * These aren't exported outside the kernel to avoid name space clashes
8 */ 8 */
9#ifdef __KERNEL__
9#ifndef __ASSEMBLY__ 10#ifndef __ASSEMBLY__
10 11
11#ifdef CONFIG_SUPERH32 12#ifdef CONFIG_SUPERH32
@@ -17,4 +18,6 @@ typedef u64 reg_size_t;
17#endif 18#endif
18 19
19#endif /* __ASSEMBLY__ */ 20#endif /* __ASSEMBLY__ */
21#endif /* __KERNEL__ */
22
20#endif /* __ASM_SH_TYPES_H */ 23#endif /* __ASM_SH_TYPES_H */
diff --git a/arch/sh/include/asm/uaccess.h b/arch/sh/include/asm/uaccess.h
index 9486376605f..075848f43b6 100644
--- a/arch/sh/include/asm/uaccess.h
+++ b/arch/sh/include/asm/uaccess.h
@@ -25,8 +25,6 @@
25 (__chk_user_ptr(addr), \ 25 (__chk_user_ptr(addr), \
26 __access_ok((unsigned long __force)(addr), (size))) 26 __access_ok((unsigned long __force)(addr), (size)))
27 27
28#define user_addr_max() (current_thread_info()->addr_limit.seg)
29
30/* 28/*
31 * Uh, these should become the main single-value transfer routines ... 29 * Uh, these should become the main single-value transfer routines ...
32 * They automatically use the right size if we just have the right 30 * They automatically use the right size if we just have the right
@@ -97,16 +95,11 @@ struct __large_struct { unsigned long buf[100]; };
97}) 95})
98 96
99#ifdef CONFIG_SUPERH32 97#ifdef CONFIG_SUPERH32
100# include <asm/uaccess_32.h> 98# include "uaccess_32.h"
101#else 99#else
102# include <asm/uaccess_64.h> 100# include "uaccess_64.h"
103#endif 101#endif
104 102
105extern long strncpy_from_user(char *dest, const char __user *src, long count);
106
107extern __must_check long strlen_user(const char __user *str);
108extern __must_check long strnlen_user(const char __user *str, long n);
109
110/* Generic arbitrary sized copy. */ 103/* Generic arbitrary sized copy. */
111/* Return the number of bytes NOT copied */ 104/* Return the number of bytes NOT copied */
112__kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n); 105__kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n);
@@ -144,6 +137,37 @@ __kernel_size_t __clear_user(void *addr, __kernel_size_t size);
144 __cl_size; \ 137 __cl_size; \
145}) 138})
146 139
140/**
141 * strncpy_from_user: - Copy a NUL terminated string from userspace.
142 * @dst: Destination address, in kernel space. This buffer must be at
143 * least @count bytes long.
144 * @src: Source address, in user space.
145 * @count: Maximum number of bytes to copy, including the trailing NUL.
146 *
147 * Copies a NUL-terminated string from userspace to kernel space.
148 *
149 * On success, returns the length of the string (not including the trailing
150 * NUL).
151 *
152 * If access to userspace fails, returns -EFAULT (some data may have been
153 * copied).
154 *
155 * If @count is smaller than the length of the string, copies @count bytes
156 * and returns @count.
157 */
158#define strncpy_from_user(dest,src,count) \
159({ \
160 unsigned long __sfu_src = (unsigned long)(src); \
161 int __sfu_count = (int)(count); \
162 long __sfu_res = -EFAULT; \
163 \
164 if (__access_ok(__sfu_src, __sfu_count)) \
165 __sfu_res = __strncpy_from_user((unsigned long)(dest), \
166 __sfu_src, __sfu_count); \
167 \
168 __sfu_res; \
169})
170
147static inline unsigned long 171static inline unsigned long
148copy_from_user(void *to, const void __user *from, unsigned long n) 172copy_from_user(void *to, const void __user *from, unsigned long n)
149{ 173{
@@ -168,6 +192,43 @@ copy_to_user(void __user *to, const void *from, unsigned long n)
168 return __copy_size; 192 return __copy_size;
169} 193}
170 194
195/**
196 * strnlen_user: - Get the size of a string in user space.
197 * @s: The string to measure.
198 * @n: The maximum valid length
199 *
200 * Context: User context only. This function may sleep.
201 *
202 * Get the size of a NUL-terminated string in user space.
203 *
204 * Returns the size of the string INCLUDING the terminating NUL.
205 * On exception, returns 0.
206 * If the string is too long, returns a value greater than @n.
207 */
208static inline long strnlen_user(const char __user *s, long n)
209{
210 if (!__addr_ok(s))
211 return 0;
212 else
213 return __strnlen_user(s, n);
214}
215
216/**
217 * strlen_user: - Get the size of a string in user space.
218 * @str: The string to measure.
219 *
220 * Context: User context only. This function may sleep.
221 *
222 * Get the size of a NUL-terminated string in user space.
223 *
224 * Returns the size of the string INCLUDING the terminating NUL.
225 * On exception, returns 0.
226 *
227 * If there is a limit on the length of a valid string, you may wish to
228 * consider using strnlen_user() instead.
229 */
230#define strlen_user(str) strnlen_user(str, ~0UL >> 1)
231
171/* 232/*
172 * The exception table consists of pairs of addresses: the first is the 233 * The exception table consists of pairs of addresses: the first is the
173 * address of an instruction that is allowed to fault, and the second is 234 * address of an instruction that is allowed to fault, and the second is
@@ -193,19 +254,5 @@ int fixup_exception(struct pt_regs *regs);
193unsigned long search_exception_table(unsigned long addr); 254unsigned long search_exception_table(unsigned long addr);
194const struct exception_table_entry *search_exception_tables(unsigned long addr); 255const struct exception_table_entry *search_exception_tables(unsigned long addr);
195 256
196extern void *set_exception_table_vec(unsigned int vec, void *handler);
197
198static inline void *set_exception_table_evt(unsigned int evt, void *handler)
199{
200 return set_exception_table_vec(evt >> 5, handler);
201}
202
203struct mem_access {
204 unsigned long (*from)(void *dst, const void __user *src, unsigned long cnt);
205 unsigned long (*to)(void __user *dst, const void *src, unsigned long cnt);
206};
207
208int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
209 struct mem_access *ma, int, unsigned long address);
210 257
211#endif /* __ASM_SH_UACCESS_H */ 258#endif /* __ASM_SH_UACCESS_H */
diff --git a/arch/sh/include/asm/uaccess_32.h b/arch/sh/include/asm/uaccess_32.h
index c0de7ee35ab..ae0d24f6653 100644
--- a/arch/sh/include/asm/uaccess_32.h
+++ b/arch/sh/include/asm/uaccess_32.h
@@ -170,4 +170,79 @@ __asm__ __volatile__( \
170 170
171extern void __put_user_unknown(void); 171extern void __put_user_unknown(void);
172 172
173static inline int
174__strncpy_from_user(unsigned long __dest, unsigned long __user __src, int __count)
175{
176 __kernel_size_t res;
177 unsigned long __dummy, _d, _s, _c;
178
179 __asm__ __volatile__(
180 "9:\n"
181 "mov.b @%2+, %1\n\t"
182 "cmp/eq #0, %1\n\t"
183 "bt/s 2f\n"
184 "1:\n"
185 "mov.b %1, @%3\n\t"
186 "dt %4\n\t"
187 "bf/s 9b\n\t"
188 " add #1, %3\n\t"
189 "2:\n\t"
190 "sub %4, %0\n"
191 "3:\n"
192 ".section .fixup,\"ax\"\n"
193 "4:\n\t"
194 "mov.l 5f, %1\n\t"
195 "jmp @%1\n\t"
196 " mov %9, %0\n\t"
197 ".balign 4\n"
198 "5: .long 3b\n"
199 ".previous\n"
200 ".section __ex_table,\"a\"\n"
201 " .balign 4\n"
202 " .long 9b,4b\n"
203 ".previous"
204 : "=r" (res), "=&z" (__dummy), "=r" (_s), "=r" (_d), "=r"(_c)
205 : "0" (__count), "2" (__src), "3" (__dest), "4" (__count),
206 "i" (-EFAULT)
207 : "memory", "t");
208
209 return res;
210}
211
212/*
213 * Return the size of a string (including the ending 0 even when we have
214 * exceeded the maximum string length).
215 */
216static inline long __strnlen_user(const char __user *__s, long __n)
217{
218 unsigned long res;
219 unsigned long __dummy;
220
221 __asm__ __volatile__(
222 "1:\t"
223 "mov.b @(%0,%3), %1\n\t"
224 "cmp/eq %4, %0\n\t"
225 "bt/s 2f\n\t"
226 " add #1, %0\n\t"
227 "tst %1, %1\n\t"
228 "bf 1b\n\t"
229 "2:\n"
230 ".section .fixup,\"ax\"\n"
231 "3:\n\t"
232 "mov.l 4f, %1\n\t"
233 "jmp @%1\n\t"
234 " mov #0, %0\n"
235 ".balign 4\n"
236 "4: .long 2b\n"
237 ".previous\n"
238 ".section __ex_table,\"a\"\n"
239 " .balign 4\n"
240 " .long 1b,3b\n"
241 ".previous"
242 : "=z" (res), "=&r" (__dummy)
243 : "0" (0), "r" (__s), "r" (__n)
244 : "t");
245 return res;
246}
247
173#endif /* __ASM_SH_UACCESS_32_H */ 248#endif /* __ASM_SH_UACCESS_32_H */
diff --git a/arch/sh/include/asm/uaccess_64.h b/arch/sh/include/asm/uaccess_64.h
index 2e07e0f40c6..56fd20b8cdc 100644
--- a/arch/sh/include/asm/uaccess_64.h
+++ b/arch/sh/include/asm/uaccess_64.h
@@ -84,4 +84,8 @@ extern long __put_user_asm_l(void *, long);
84extern long __put_user_asm_q(void *, long); 84extern long __put_user_asm_q(void *, long);
85extern void __put_user_unknown(void); 85extern void __put_user_unknown(void);
86 86
87extern long __strnlen_user(const char *__s, long __n);
88extern int __strncpy_from_user(unsigned long __dest,
89 unsigned long __user __src, int __count);
90
87#endif /* __ASM_SH_UACCESS_64_H */ 91#endif /* __ASM_SH_UACCESS_64_H */
diff --git a/arch/sh/include/asm/unistd.h b/arch/sh/include/asm/unistd.h
index 012004ed333..65be656ead7 100644
--- a/arch/sh/include/asm/unistd.h
+++ b/arch/sh/include/asm/unistd.h
@@ -1,43 +1,13 @@
1#ifdef __KERNEL__
1# ifdef CONFIG_SUPERH32 2# ifdef CONFIG_SUPERH32
2# include <asm/unistd_32.h> 3# include "unistd_32.h"
3# else 4# else
4# include <asm/unistd_64.h> 5# include "unistd_64.h"
5# endif 6# endif
6 7#else
7# define __ARCH_WANT_SYS_RT_SIGSUSPEND 8# ifdef __SH5__
8# define __ARCH_WANT_OLD_READDIR 9# include "unistd_64.h"
9# define __ARCH_WANT_OLD_STAT 10# else
10# define __ARCH_WANT_STAT64 11# include "unistd_32.h"
11# define __ARCH_WANT_SYS_ALARM 12# endif
12# define __ARCH_WANT_SYS_GETHOSTNAME 13#endif
13# define __ARCH_WANT_SYS_IPC
14# define __ARCH_WANT_SYS_PAUSE
15# define __ARCH_WANT_SYS_SGETMASK
16# define __ARCH_WANT_SYS_SIGNAL
17# define __ARCH_WANT_SYS_TIME
18# define __ARCH_WANT_SYS_UTIME
19# define __ARCH_WANT_SYS_WAITPID
20# define __ARCH_WANT_SYS_SOCKETCALL
21# define __ARCH_WANT_SYS_FADVISE64
22# define __ARCH_WANT_SYS_GETPGRP
23# define __ARCH_WANT_SYS_LLSEEK
24# define __ARCH_WANT_SYS_NICE
25# define __ARCH_WANT_SYS_OLD_GETRLIMIT
26# define __ARCH_WANT_SYS_OLD_UNAME
27# define __ARCH_WANT_SYS_OLDUMOUNT
28# define __ARCH_WANT_SYS_SIGPENDING
29# define __ARCH_WANT_SYS_SIGPROCMASK
30# define __ARCH_WANT_SYS_RT_SIGACTION
31# define __ARCH_WANT_SYS_FORK
32# define __ARCH_WANT_SYS_VFORK
33# define __ARCH_WANT_SYS_CLONE
34
35/*
36 * "Conditional" syscalls
37 *
38 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
39 * but it doesn't work on all toolchains, so we just do it by hand
40 */
41# define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
42
43#include <uapi/asm/unistd.h>
diff --git a/arch/sh/include/asm/word-at-a-time.h b/arch/sh/include/asm/word-at-a-time.h
deleted file mode 100644
index 6e38953ff7f..00000000000
--- a/arch/sh/include/asm/word-at-a-time.h
+++ /dev/null
@@ -1,53 +0,0 @@
1#ifndef __ASM_SH_WORD_AT_A_TIME_H
2#define __ASM_SH_WORD_AT_A_TIME_H
3
4#ifdef CONFIG_CPU_BIG_ENDIAN
5# include <asm-generic/word-at-a-time.h>
6#else
7/*
8 * Little-endian version cribbed from x86.
9 */
10struct word_at_a_time {
11 const unsigned long one_bits, high_bits;
12};
13
14#define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0x01), REPEAT_BYTE(0x80) }
15
16/* Carl Chatfield / Jan Achrenius G+ version for 32-bit */
17static inline long count_masked_bytes(long mask)
18{
19 /* (000000 0000ff 00ffff ffffff) -> ( 1 1 2 3 ) */
20 long a = (0x0ff0001+mask) >> 23;
21 /* Fix the 1 for 00 case */
22 return a & mask;
23}
24
25/* Return nonzero if it has a zero */
26static inline unsigned long has_zero(unsigned long a, unsigned long *bits, const struct word_at_a_time *c)
27{
28 unsigned long mask = ((a - c->one_bits) & ~a) & c->high_bits;
29 *bits = mask;
30 return mask;
31}
32
33static inline unsigned long prep_zero_mask(unsigned long a, unsigned long bits, const struct word_at_a_time *c)
34{
35 return bits;
36}
37
38static inline unsigned long create_zero_mask(unsigned long bits)
39{
40 bits = (bits - 1) & ~bits;
41 return bits >> 7;
42}
43
44/* The mask we created is directly usable as a bytemask */
45#define zero_bytemask(mask) (mask)
46
47static inline unsigned long find_zero(unsigned long mask)
48{
49 return count_masked_bytes(mask);
50}
51#endif
52
53#endif
diff --git a/arch/sh/include/cpu-sh2a/cpu/sh7264.h b/arch/sh/include/cpu-sh2a/cpu/sh7264.h
deleted file mode 100644
index 4d1ef6d74bd..00000000000
--- a/arch/sh/include/cpu-sh2a/cpu/sh7264.h
+++ /dev/null
@@ -1,176 +0,0 @@
1#ifndef __ASM_SH7264_H__
2#define __ASM_SH7264_H__
3
4enum {
5 /* Port A */
6 GPIO_PA3, GPIO_PA2, GPIO_PA1, GPIO_PA0,
7
8 /* Port B */
9 GPIO_PB22, GPIO_PB21, GPIO_PB20,
10 GPIO_PB19, GPIO_PB18, GPIO_PB17, GPIO_PB16,
11 GPIO_PB15, GPIO_PB14, GPIO_PB13, GPIO_PB12,
12 GPIO_PB11, GPIO_PB10, GPIO_PB9, GPIO_PB8,
13 GPIO_PB7, GPIO_PB6, GPIO_PB5, GPIO_PB4,
14 GPIO_PB3, GPIO_PB2, GPIO_PB1,
15
16 /* Port C */
17 GPIO_PC10, GPIO_PC9, GPIO_PC8,
18 GPIO_PC7, GPIO_PC6, GPIO_PC5, GPIO_PC4,
19 GPIO_PC3, GPIO_PC2, GPIO_PC1, GPIO_PC0,
20
21 /* Port D */
22 GPIO_PD15, GPIO_PD14, GPIO_PD13, GPIO_PD12,
23 GPIO_PD11, GPIO_PD10, GPIO_PD9, GPIO_PD8,
24 GPIO_PD7, GPIO_PD6, GPIO_PD5, GPIO_PD4,
25 GPIO_PD3, GPIO_PD2, GPIO_PD1, GPIO_PD0,
26
27 /* Port E */
28 GPIO_PE5, GPIO_PE4,
29 GPIO_PE3, GPIO_PE2, GPIO_PE1, GPIO_PE0,
30
31 /* Port F */
32 GPIO_PF12,
33 GPIO_PF11, GPIO_PF10, GPIO_PF9, GPIO_PF8,
34 GPIO_PF7, GPIO_PF6, GPIO_PF5, GPIO_PF4,
35 GPIO_PF3, GPIO_PF2, GPIO_PF1, GPIO_PF0,
36
37 /* Port G */
38 GPIO_PG24,
39 GPIO_PG23, GPIO_PG22, GPIO_PG21, GPIO_PG20,
40 GPIO_PG19, GPIO_PG18, GPIO_PG17, GPIO_PG16,
41 GPIO_PG15, GPIO_PG14, GPIO_PG13, GPIO_PG12,
42 GPIO_PG11, GPIO_PG10, GPIO_PG9, GPIO_PG8,
43 GPIO_PG7, GPIO_PG6, GPIO_PG5, GPIO_PG4,
44 GPIO_PG3, GPIO_PG2, GPIO_PG1, GPIO_PG0,
45
46 /* Port H */
47 GPIO_PH7, GPIO_PH6, GPIO_PH5, GPIO_PH4,
48 GPIO_PH3, GPIO_PH2, GPIO_PH1, GPIO_PH0,
49
50 /* Port I - not on device */
51
52 /* Port J */
53 GPIO_PJ11, GPIO_PJ10, GPIO_PJ9, GPIO_PJ8,
54 GPIO_PJ7, GPIO_PJ6, GPIO_PJ5, GPIO_PJ4,
55 GPIO_PJ3, GPIO_PJ2, GPIO_PJ1, GPIO_PJ0,
56
57 /* Port K */
58 GPIO_PK11, GPIO_PK10, GPIO_PK9, GPIO_PK8,
59 GPIO_PK7, GPIO_PK6, GPIO_PK5, GPIO_PK4,
60 GPIO_PK3, GPIO_PK2, GPIO_PK1, GPIO_PK0,
61
62 /* INTC: IRQ and PINT on PB/PD/PE */
63 GPIO_FN_PINT7_PG, GPIO_FN_PINT6_PG, GPIO_FN_PINT5_PG, GPIO_FN_PINT4_PG,
64 GPIO_FN_PINT3_PG, GPIO_FN_PINT2_PG, GPIO_FN_PINT1_PG,
65
66 GPIO_FN_IRQ7_PC, GPIO_FN_IRQ6_PC, GPIO_FN_IRQ5_PC, GPIO_FN_IRQ4_PC,
67 GPIO_FN_IRQ3_PG, GPIO_FN_IRQ2_PG, GPIO_FN_IRQ1_PJ, GPIO_FN_IRQ0_PJ,
68 GPIO_FN_IRQ3_PE, GPIO_FN_IRQ2_PE, GPIO_FN_IRQ1_PE, GPIO_FN_IRQ0_PE,
69
70 /* WDT */
71 GPIO_FN_WDTOVF,
72
73 /* CAN */
74 GPIO_FN_CTX1, GPIO_FN_CRX1, GPIO_FN_CTX0, GPIO_FN_CTX0_CTX1,
75 GPIO_FN_CRX0, GPIO_FN_CRX0_CRX1,
76
77 /* DMAC */
78 GPIO_FN_TEND0, GPIO_FN_DACK0, GPIO_FN_DREQ0,
79 GPIO_FN_TEND1, GPIO_FN_DACK1, GPIO_FN_DREQ1,
80
81 /* ADC */
82 GPIO_FN_ADTRG,
83
84 /* BSC */
85
86 GPIO_FN_A25, GPIO_FN_A24,
87 GPIO_FN_A23, GPIO_FN_A22, GPIO_FN_A21, GPIO_FN_A20,
88 GPIO_FN_A19, GPIO_FN_A18, GPIO_FN_A17, GPIO_FN_A16,
89 GPIO_FN_A15, GPIO_FN_A14, GPIO_FN_A13, GPIO_FN_A12,
90 GPIO_FN_A11, GPIO_FN_A10, GPIO_FN_A9, GPIO_FN_A8,
91 GPIO_FN_A7, GPIO_FN_A6, GPIO_FN_A5, GPIO_FN_A4,
92 GPIO_FN_A3, GPIO_FN_A2, GPIO_FN_A1, GPIO_FN_A0,
93 GPIO_FN_D15, GPIO_FN_D14, GPIO_FN_D13, GPIO_FN_D12,
94 GPIO_FN_D11, GPIO_FN_D10, GPIO_FN_D9, GPIO_FN_D8,
95 GPIO_FN_D7, GPIO_FN_D6, GPIO_FN_D5, GPIO_FN_D4,
96 GPIO_FN_D3, GPIO_FN_D2, GPIO_FN_D1, GPIO_FN_D0,
97
98 GPIO_FN_BS,
99 GPIO_FN_CS4, GPIO_FN_CS3, GPIO_FN_CS2, GPIO_FN_CS1, GPIO_FN_CS0,
100 GPIO_FN_CS6CE1B, GPIO_FN_CS5CE1A,
101 GPIO_FN_CE2A, GPIO_FN_CE2B,
102 GPIO_FN_RD, GPIO_FN_RDWR,
103 GPIO_FN_ICIOWRAH, GPIO_FN_ICIORD,
104 GPIO_FN_WE1DQMUWE, GPIO_FN_WE0DQML,
105 GPIO_FN_RAS, GPIO_FN_CAS, GPIO_FN_CKE,
106 GPIO_FN_WAIT, GPIO_FN_BREQ, GPIO_FN_BACK,
107 GPIO_FN_IOIS16,
108
109 /* TMU */
110 GPIO_FN_TIOC4D, GPIO_FN_TIOC4C, GPIO_FN_TIOC4B, GPIO_FN_TIOC4A,
111 GPIO_FN_TIOC3D, GPIO_FN_TIOC3C, GPIO_FN_TIOC3B, GPIO_FN_TIOC3A,
112 GPIO_FN_TIOC2B, GPIO_FN_TIOC1B, GPIO_FN_TIOC2A, GPIO_FN_TIOC1A,
113 GPIO_FN_TIOC0D, GPIO_FN_TIOC0C, GPIO_FN_TIOC0B, GPIO_FN_TIOC0A,
114 GPIO_FN_TCLKD, GPIO_FN_TCLKC, GPIO_FN_TCLKB, GPIO_FN_TCLKA,
115
116 /* SSU */
117 GPIO_FN_SCS0_PD, GPIO_FN_SSO0_PD, GPIO_FN_SSI0_PD, GPIO_FN_SSCK0_PD,
118 GPIO_FN_SCS0_PF, GPIO_FN_SSO0_PF, GPIO_FN_SSI0_PF, GPIO_FN_SSCK0_PF,
119 GPIO_FN_SCS1_PD, GPIO_FN_SSO1_PD, GPIO_FN_SSI1_PD, GPIO_FN_SSCK1_PD,
120 GPIO_FN_SCS1_PF, GPIO_FN_SSO1_PF, GPIO_FN_SSI1_PF, GPIO_FN_SSCK1_PF,
121
122 /* SCIF */
123 GPIO_FN_SCK0, GPIO_FN_SCK1, GPIO_FN_SCK2, GPIO_FN_SCK3,
124 GPIO_FN_RXD0, GPIO_FN_RXD1, GPIO_FN_RXD2, GPIO_FN_RXD3,
125 GPIO_FN_TXD0, GPIO_FN_TXD1, GPIO_FN_TXD2, GPIO_FN_TXD3,
126 GPIO_FN_RXD4, GPIO_FN_RXD5, GPIO_FN_RXD6, GPIO_FN_RXD7,
127 GPIO_FN_TXD4, GPIO_FN_TXD5, GPIO_FN_TXD6, GPIO_FN_TXD7,
128 GPIO_FN_RTS1, GPIO_FN_RTS3, GPIO_FN_CTS1, GPIO_FN_CTS3,
129
130 /* RSPI */
131 GPIO_FN_RSPCK0, GPIO_FN_MOSI0,
132 GPIO_FN_MISO0_PF12, GPIO_FN_MISO1,
133 GPIO_FN_SSL00,
134 GPIO_FN_RSPCK1, GPIO_FN_MOSI1,
135 GPIO_FN_MISO1_PG19, GPIO_FN_SSL10,
136
137 /* IIC3 */
138 GPIO_FN_SCL0, GPIO_FN_SCL1, GPIO_FN_SCL2,
139 GPIO_FN_SDA2, GPIO_FN_SDA1, GPIO_FN_SDA0,
140
141 /* SSI */
142 GPIO_FN_SSISCK0, GPIO_FN_SSIWS0, GPIO_FN_SSITXD0, GPIO_FN_SSIRXD0,
143 GPIO_FN_SSIWS1, GPIO_FN_SSIWS2, GPIO_FN_SSIWS3,
144 GPIO_FN_SSISCK1, GPIO_FN_SSISCK2, GPIO_FN_SSISCK3,
145 GPIO_FN_SSIDATA1, GPIO_FN_SSIDATA2, GPIO_FN_SSIDATA3,
146 GPIO_FN_AUDIO_CLK,
147
148 /* SIOF */
149 GPIO_FN_SIOFTXD, GPIO_FN_SIOFRXD, GPIO_FN_SIOFSYNC, GPIO_FN_SIOFSCK,
150
151 /* SPDIF */
152 GPIO_FN_SPDIF_IN,
153 GPIO_FN_SPDIF_OUT,
154
155 /* NANDFMC */ /* NOTE Controller is not available in boot mode 0 */
156 GPIO_FN_FCE,
157 GPIO_FN_FRB,
158
159 /* VDC3 */
160 GPIO_FN_DV_CLK, GPIO_FN_DV_VSYNC, GPIO_FN_DV_HSYNC,
161 GPIO_FN_DV_DATA7, GPIO_FN_DV_DATA6, GPIO_FN_DV_DATA5, GPIO_FN_DV_DATA4,
162 GPIO_FN_DV_DATA3, GPIO_FN_DV_DATA2, GPIO_FN_DV_DATA1, GPIO_FN_DV_DATA0,
163 GPIO_FN_LCD_CLK, GPIO_FN_LCD_EXTCLK,
164 GPIO_FN_LCD_VSYNC, GPIO_FN_LCD_HSYNC, GPIO_FN_LCD_DE,
165 GPIO_FN_LCD_DATA15, GPIO_FN_LCD_DATA14,
166 GPIO_FN_LCD_DATA13, GPIO_FN_LCD_DATA12,
167 GPIO_FN_LCD_DATA11, GPIO_FN_LCD_DATA10,
168 GPIO_FN_LCD_DATA9, GPIO_FN_LCD_DATA8,
169 GPIO_FN_LCD_DATA7, GPIO_FN_LCD_DATA6,
170 GPIO_FN_LCD_DATA5, GPIO_FN_LCD_DATA4,
171 GPIO_FN_LCD_DATA3, GPIO_FN_LCD_DATA2,
172 GPIO_FN_LCD_DATA1, GPIO_FN_LCD_DATA0,
173 GPIO_FN_LCD_M_DISP,
174};
175
176#endif /* __ASM_SH7264_H__ */
diff --git a/arch/sh/include/cpu-sh2a/cpu/sh7269.h b/arch/sh/include/cpu-sh2a/cpu/sh7269.h
deleted file mode 100644
index 2a0ca8780f0..00000000000
--- a/arch/sh/include/cpu-sh2a/cpu/sh7269.h
+++ /dev/null
@@ -1,213 +0,0 @@
1#ifndef __ASM_SH7269_H__
2#define __ASM_SH7269_H__
3
4enum {
5 /* Port A */
6 GPIO_PA1, GPIO_PA0,
7
8 /* Port B */
9 GPIO_PB22, GPIO_PB21, GPIO_PB20,
10 GPIO_PB19, GPIO_PB18, GPIO_PB17, GPIO_PB16,
11 GPIO_PB15, GPIO_PB14, GPIO_PB13, GPIO_PB12,
12 GPIO_PB11, GPIO_PB10, GPIO_PB9, GPIO_PB8,
13 GPIO_PB7, GPIO_PB6, GPIO_PB5, GPIO_PB4,
14 GPIO_PB3, GPIO_PB2, GPIO_PB1,
15
16 /* Port C */
17 GPIO_PC8,
18 GPIO_PC7, GPIO_PC6, GPIO_PC5, GPIO_PC4,
19 GPIO_PC3, GPIO_PC2, GPIO_PC1, GPIO_PC0,
20
21 /* Port D */
22 GPIO_PD15, GPIO_PD14, GPIO_PD13, GPIO_PD12,
23 GPIO_PD11, GPIO_PD10, GPIO_PD9, GPIO_PD8,
24 GPIO_PD7, GPIO_PD6, GPIO_PD5, GPIO_PD4,
25 GPIO_PD3, GPIO_PD2, GPIO_PD1, GPIO_PD0,
26
27 /* Port E */
28 GPIO_PE7, GPIO_PE6, GPIO_PE5, GPIO_PE4,
29 GPIO_PE3, GPIO_PE2, GPIO_PE1, GPIO_PE0,
30
31 /* Port F */
32 GPIO_PF23, GPIO_PF22, GPIO_PF21, GPIO_PF20,
33 GPIO_PF19, GPIO_PF18, GPIO_PF17, GPIO_PF16,
34 GPIO_PF15, GPIO_PF14, GPIO_PF13, GPIO_PF12,
35 GPIO_PF11, GPIO_PF10, GPIO_PF9, GPIO_PF8,
36 GPIO_PF7, GPIO_PF6, GPIO_PF5, GPIO_PF4,
37 GPIO_PF3, GPIO_PF2, GPIO_PF1, GPIO_PF0,
38
39 /* Port G */
40 GPIO_PG27, GPIO_PG26, GPIO_PG25, GPIO_PG24,
41 GPIO_PG23, GPIO_PG22, GPIO_PG21, GPIO_PG20,
42 GPIO_PG19, GPIO_PG18, GPIO_PG17, GPIO_PG16,
43 GPIO_PG15, GPIO_PG14, GPIO_PG13, GPIO_PG12,
44 GPIO_PG11, GPIO_PG10, GPIO_PG9, GPIO_PG8,
45 GPIO_PG7, GPIO_PG6, GPIO_PG5, GPIO_PG4,
46 GPIO_PG3, GPIO_PG2, GPIO_PG1, GPIO_PG0,
47
48 /* Port H */
49 GPIO_PH7, GPIO_PH6, GPIO_PH5, GPIO_PH4,
50 GPIO_PH3, GPIO_PH2, GPIO_PH1, GPIO_PH0,
51
52 /* Port I - not on device */
53
54 /* Port J */
55 GPIO_PJ31, GPIO_PJ30, GPIO_PJ29, GPIO_PJ28,
56 GPIO_PJ27, GPIO_PJ26, GPIO_PJ25, GPIO_PJ24,
57 GPIO_PJ23, GPIO_PJ22, GPIO_PJ21, GPIO_PJ20,
58 GPIO_PJ19, GPIO_PJ18, GPIO_PJ17, GPIO_PJ16,
59 GPIO_PJ15, GPIO_PJ14, GPIO_PJ13, GPIO_PJ12,
60 GPIO_PJ11, GPIO_PJ10, GPIO_PJ9, GPIO_PJ8,
61 GPIO_PJ7, GPIO_PJ6, GPIO_PJ5, GPIO_PJ4,
62 GPIO_PJ3, GPIO_PJ2, GPIO_PJ1, GPIO_PJ0,
63
64 /* INTC: IRQ and PINT */
65 GPIO_FN_IRQ7_PG, GPIO_FN_IRQ6_PG, GPIO_FN_IRQ5_PG, GPIO_FN_IRQ4_PG,
66 GPIO_FN_IRQ3_PG, GPIO_FN_IRQ2_PG, GPIO_FN_IRQ1_PG, GPIO_FN_IRQ0_PG,
67 GPIO_FN_IRQ7_PF, GPIO_FN_IRQ6_PF, GPIO_FN_IRQ5_PF, GPIO_FN_IRQ4_PF,
68 GPIO_FN_IRQ3_PJ, GPIO_FN_IRQ2_PJ, GPIO_FN_IRQ1_PJ, GPIO_FN_IRQ0_PJ,
69 GPIO_FN_IRQ1_PC, GPIO_FN_IRQ0_PC,
70
71 GPIO_FN_PINT7_PG, GPIO_FN_PINT6_PG, GPIO_FN_PINT5_PG, GPIO_FN_PINT4_PG,
72 GPIO_FN_PINT3_PG, GPIO_FN_PINT2_PG, GPIO_FN_PINT1_PG, GPIO_FN_PINT0_PG,
73 GPIO_FN_PINT7_PH, GPIO_FN_PINT6_PH, GPIO_FN_PINT5_PH, GPIO_FN_PINT4_PH,
74 GPIO_FN_PINT3_PH, GPIO_FN_PINT2_PH, GPIO_FN_PINT1_PH, GPIO_FN_PINT0_PH,
75 GPIO_FN_PINT7_PJ, GPIO_FN_PINT6_PJ, GPIO_FN_PINT5_PJ, GPIO_FN_PINT4_PJ,
76 GPIO_FN_PINT3_PJ, GPIO_FN_PINT2_PJ, GPIO_FN_PINT1_PJ, GPIO_FN_PINT0_PJ,
77
78 /* WDT */
79 GPIO_FN_WDTOVF,
80
81 /* CAN */
82 GPIO_FN_CTX1, GPIO_FN_CRX1, GPIO_FN_CTX0, GPIO_FN_CTX0_CTX1,
83 GPIO_FN_CRX0, GPIO_FN_CRX0_CRX1, GPIO_FN_CRX0_CRX1_CRX2,
84
85 /* DMAC */
86 GPIO_FN_TEND0, GPIO_FN_DACK0, GPIO_FN_DREQ0,
87 GPIO_FN_TEND1, GPIO_FN_DACK1, GPIO_FN_DREQ1,
88
89 /* ADC */
90 GPIO_FN_ADTRG,
91
92 /* BSC */
93 GPIO_FN_A25, GPIO_FN_A24,
94 GPIO_FN_A23, GPIO_FN_A22, GPIO_FN_A21, GPIO_FN_A20,
95 GPIO_FN_A19, GPIO_FN_A18, GPIO_FN_A17, GPIO_FN_A16,
96 GPIO_FN_A15, GPIO_FN_A14, GPIO_FN_A13, GPIO_FN_A12,
97 GPIO_FN_A11, GPIO_FN_A10, GPIO_FN_A9, GPIO_FN_A8,
98 GPIO_FN_A7, GPIO_FN_A6, GPIO_FN_A5, GPIO_FN_A4,
99 GPIO_FN_A3, GPIO_FN_A2, GPIO_FN_A1, GPIO_FN_A0,
100 GPIO_FN_D15, GPIO_FN_D14, GPIO_FN_D13, GPIO_FN_D12,
101 GPIO_FN_D11, GPIO_FN_D10, GPIO_FN_D9, GPIO_FN_D8,
102 GPIO_FN_D7, GPIO_FN_D6, GPIO_FN_D5, GPIO_FN_D4,
103 GPIO_FN_D3, GPIO_FN_D2, GPIO_FN_D1, GPIO_FN_D0,
104
105 GPIO_FN_BS,
106 GPIO_FN_CS4, GPIO_FN_CS3, GPIO_FN_CS2, GPIO_FN_CS1, GPIO_FN_CS0,
107 GPIO_FN_CS5CE1A,
108 GPIO_FN_CE2A, GPIO_FN_CE2B,
109 GPIO_FN_RD, GPIO_FN_RDWR,
110 GPIO_FN_WE3ICIOWRAHDQMUU, GPIO_FN_WE2ICIORDDQMUL,
111 GPIO_FN_WE1DQMUWE, GPIO_FN_WE0DQML,
112 GPIO_FN_RAS, GPIO_FN_CAS, GPIO_FN_CKE,
113 GPIO_FN_WAIT, GPIO_FN_BREQ, GPIO_FN_BACK,
114 GPIO_FN_IOIS16,
115
116 /* TMU */
117 GPIO_FN_TIOC4D, GPIO_FN_TIOC4C, GPIO_FN_TIOC4B, GPIO_FN_TIOC4A,
118 GPIO_FN_TIOC3D, GPIO_FN_TIOC3C, GPIO_FN_TIOC3B, GPIO_FN_TIOC3A,
119 GPIO_FN_TIOC2B, GPIO_FN_TIOC1B, GPIO_FN_TIOC2A, GPIO_FN_TIOC1A,
120 GPIO_FN_TIOC0D, GPIO_FN_TIOC0C, GPIO_FN_TIOC0B, GPIO_FN_TIOC0A,
121 GPIO_FN_TCLKD, GPIO_FN_TCLKC, GPIO_FN_TCLKB, GPIO_FN_TCLKA,
122
123 /* SSU */
124 GPIO_FN_SCS0_PD, GPIO_FN_SSO0_PD, GPIO_FN_SSI0_PD, GPIO_FN_SSCK0_PD,
125 GPIO_FN_SCS0_PF, GPIO_FN_SSO0_PF, GPIO_FN_SSI0_PF, GPIO_FN_SSCK0_PF,
126 GPIO_FN_SCS1_PD, GPIO_FN_SSO1_PD, GPIO_FN_SSI1_PD, GPIO_FN_SSCK1_PD,
127 GPIO_FN_SCS1_PF, GPIO_FN_SSO1_PF, GPIO_FN_SSI1_PF, GPIO_FN_SSCK1_PF,
128
129 /* SCIF */
130 GPIO_FN_SCK0, GPIO_FN_RXD0, GPIO_FN_TXD0,
131 GPIO_FN_SCK1, GPIO_FN_RXD1, GPIO_FN_TXD1, GPIO_FN_RTS1, GPIO_FN_CTS1,
132 GPIO_FN_SCK2, GPIO_FN_RXD2, GPIO_FN_TXD2,
133 GPIO_FN_SCK3, GPIO_FN_RXD3, GPIO_FN_TXD3,
134 GPIO_FN_SCK4, GPIO_FN_RXD4, GPIO_FN_TXD4,
135 GPIO_FN_SCK5, GPIO_FN_RXD5, GPIO_FN_TXD5, GPIO_FN_RTS5, GPIO_FN_CTS5,
136 GPIO_FN_SCK6, GPIO_FN_RXD6, GPIO_FN_TXD6,
137 GPIO_FN_SCK7, GPIO_FN_RXD7, GPIO_FN_TXD7, GPIO_FN_RTS7, GPIO_FN_CTS7,
138
139 /* RSPI */
140 GPIO_FN_MISO0_PJ19, GPIO_FN_MISO0_PB20,
141 GPIO_FN_MOSI0_PJ18, GPIO_FN_MOSI0_PB19,
142 GPIO_FN_SSL00_PJ17, GPIO_FN_SSL00_PB18,
143 GPIO_FN_RSPCK0_PJ16, GPIO_FN_RSPCK0_PB17,
144 GPIO_FN_RSPCK1, GPIO_FN_MOSI1,
145 GPIO_FN_MISO1, GPIO_FN_SSL10,
146
147 /* IIC3 */
148 GPIO_FN_SCL0, GPIO_FN_SCL1, GPIO_FN_SCL2,
149 GPIO_FN_SDA2, GPIO_FN_SDA1, GPIO_FN_SDA0,
150
151 /* SSI */
152 GPIO_FN_SSISCK0, GPIO_FN_SSIWS0, GPIO_FN_SSITXD0, GPIO_FN_SSIRXD0,
153 GPIO_FN_SSIWS1, GPIO_FN_SSIWS2, GPIO_FN_SSIWS3,
154 GPIO_FN_SSISCK1, GPIO_FN_SSISCK2, GPIO_FN_SSISCK3,
155 GPIO_FN_SSIDATA1, GPIO_FN_SSIDATA2, GPIO_FN_SSIDATA3,
156 GPIO_FN_AUDIO_CLK,
157 GPIO_FN_AUDIO_XOUT,
158
159 /* SIOF */
160 GPIO_FN_SIOFTXD, GPIO_FN_SIOFRXD, GPIO_FN_SIOFSYNC, GPIO_FN_SIOFSCK,
161
162 /* SPDIF */
163 GPIO_FN_SPDIF_IN,
164 GPIO_FN_SPDIF_OUT,
165
166 /* NANDFMC */ /* NOTE Controller is not available in boot mode 0 */
167 GPIO_FN_FCE,
168 GPIO_FN_FRB,
169
170 /* VDC */
171 GPIO_FN_DV_CLK, GPIO_FN_DV_VSYNC, GPIO_FN_DV_HSYNC,
172 GPIO_FN_DV_DATA23, GPIO_FN_DV_DATA22,
173 GPIO_FN_DV_DATA21, GPIO_FN_DV_DATA20,
174 GPIO_FN_DV_DATA19, GPIO_FN_DV_DATA18,
175 GPIO_FN_DV_DATA17, GPIO_FN_DV_DATA16,
176 GPIO_FN_DV_DATA15, GPIO_FN_DV_DATA14,
177 GPIO_FN_DV_DATA13, GPIO_FN_DV_DATA12,
178 GPIO_FN_DV_DATA11, GPIO_FN_DV_DATA10,
179 GPIO_FN_DV_DATA9, GPIO_FN_DV_DATA8,
180 GPIO_FN_DV_DATA7, GPIO_FN_DV_DATA6,
181 GPIO_FN_DV_DATA5, GPIO_FN_DV_DATA4,
182 GPIO_FN_DV_DATA3, GPIO_FN_DV_DATA2,
183 GPIO_FN_DV_DATA1, GPIO_FN_DV_DATA0,
184 GPIO_FN_LCD_CLK, GPIO_FN_LCD_EXTCLK,
185 GPIO_FN_LCD_VSYNC, GPIO_FN_LCD_HSYNC, GPIO_FN_LCD_DE,
186 GPIO_FN_LCD_DATA23_PG23, GPIO_FN_LCD_DATA22_PG22,
187 GPIO_FN_LCD_DATA21_PG21, GPIO_FN_LCD_DATA20_PG20,
188 GPIO_FN_LCD_DATA19_PG19, GPIO_FN_LCD_DATA18_PG18,
189 GPIO_FN_LCD_DATA17_PG17, GPIO_FN_LCD_DATA16_PG16,
190 GPIO_FN_LCD_DATA15_PG15, GPIO_FN_LCD_DATA14_PG14,
191 GPIO_FN_LCD_DATA13_PG13, GPIO_FN_LCD_DATA12_PG12,
192 GPIO_FN_LCD_DATA11_PG11, GPIO_FN_LCD_DATA10_PG10,
193 GPIO_FN_LCD_DATA9_PG9, GPIO_FN_LCD_DATA8_PG8,
194 GPIO_FN_LCD_DATA7_PG7, GPIO_FN_LCD_DATA6_PG6,
195 GPIO_FN_LCD_DATA5_PG5, GPIO_FN_LCD_DATA4_PG4,
196 GPIO_FN_LCD_DATA3_PG3, GPIO_FN_LCD_DATA2_PG2,
197 GPIO_FN_LCD_DATA1_PG1, GPIO_FN_LCD_DATA0_PG0,
198 GPIO_FN_LCD_DATA23_PJ23, GPIO_FN_LCD_DATA22_PJ22,
199 GPIO_FN_LCD_DATA21_PJ21, GPIO_FN_LCD_DATA20_PJ20,
200 GPIO_FN_LCD_DATA19_PJ19, GPIO_FN_LCD_DATA18_PJ18,
201 GPIO_FN_LCD_DATA17_PJ17, GPIO_FN_LCD_DATA16_PJ16,
202 GPIO_FN_LCD_DATA15_PJ15, GPIO_FN_LCD_DATA14_PJ14,
203 GPIO_FN_LCD_DATA13_PJ13, GPIO_FN_LCD_DATA12_PJ12,
204 GPIO_FN_LCD_DATA11_PJ11, GPIO_FN_LCD_DATA10_PJ10,
205 GPIO_FN_LCD_DATA9_PJ9, GPIO_FN_LCD_DATA8_PJ8,
206 GPIO_FN_LCD_DATA7_PJ7, GPIO_FN_LCD_DATA6_PJ6,
207 GPIO_FN_LCD_DATA5_PJ5, GPIO_FN_LCD_DATA4_PJ4,
208 GPIO_FN_LCD_DATA3_PJ3, GPIO_FN_LCD_DATA2_PJ2,
209 GPIO_FN_LCD_DATA1_PJ1, GPIO_FN_LCD_DATA0_PJ0,
210 GPIO_FN_LCD_M_DISP,
211};
212
213#endif /* __ASM_SH7269_H__ */
diff --git a/arch/sh/include/cpu-sh3/cpu/dma.h b/arch/sh/include/cpu-sh3/cpu/dma.h
index bccb4144a5e..24e28b91c9d 100644
--- a/arch/sh/include/cpu-sh3/cpu/dma.h
+++ b/arch/sh/include/cpu-sh3/cpu/dma.h
@@ -1,8 +1,6 @@
1#ifndef __ASM_CPU_SH3_DMA_H 1#ifndef __ASM_CPU_SH3_DMA_H
2#define __ASM_CPU_SH3_DMA_H 2#define __ASM_CPU_SH3_DMA_H
3 3
4#include <linux/sh_intc.h>
5
6#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 4#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \
7 defined(CONFIG_CPU_SUBTYPE_SH7721) || \ 5 defined(CONFIG_CPU_SUBTYPE_SH7721) || \
8 defined(CONFIG_CPU_SUBTYPE_SH7710) || \ 6 defined(CONFIG_CPU_SUBTYPE_SH7710) || \
@@ -12,7 +10,14 @@
12#define SH_DMAC_BASE0 0xa4000020 10#define SH_DMAC_BASE0 0xa4000020
13#endif 11#endif
14 12
15#define DMTE0_IRQ evt2irq(0x800) 13#define DMTE0_IRQ 48
16#define DMTE4_IRQ evt2irq(0xb80) 14#define DMTE4_IRQ 76
15
16/* Definitions for the SuperH DMAC */
17#define TM_BURST 0x00000020
18#define TS_8 0x00000000
19#define TS_16 0x00000008
20#define TS_32 0x00000010
21#define TS_128 0x00000018
17 22
18#endif /* __ASM_CPU_SH3_DMA_H */ 23#endif /* __ASM_CPU_SH3_DMA_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/dma-register.h b/arch/sh/include/cpu-sh4/cpu/dma-register.h
index 02788b6a03b..18fa80aba15 100644
--- a/arch/sh/include/cpu-sh4/cpu/dma-register.h
+++ b/arch/sh/include/cpu-sh4/cpu/dma-register.h
@@ -16,29 +16,45 @@
16 16
17#define DMAOR_INIT DMAOR_DME 17#define DMAOR_INIT DMAOR_DME
18 18
19#if defined(CONFIG_CPU_SUBTYPE_SH7343) 19#if defined(CONFIG_CPU_SUBTYPE_SH7343) || \
20 defined(CONFIG_CPU_SUBTYPE_SH7730)
20#define CHCR_TS_LOW_MASK 0x00000018 21#define CHCR_TS_LOW_MASK 0x00000018
21#define CHCR_TS_LOW_SHIFT 3 22#define CHCR_TS_LOW_SHIFT 3
22#define CHCR_TS_HIGH_MASK 0 23#define CHCR_TS_HIGH_MASK 0
23#define CHCR_TS_HIGH_SHIFT 0 24#define CHCR_TS_HIGH_SHIFT 0
24#elif defined(CONFIG_CPU_SUBTYPE_SH7722) || \ 25#elif defined(CONFIG_CPU_SUBTYPE_SH7722) || \
25 defined(CONFIG_CPU_SUBTYPE_SH7723) || \
26 defined(CONFIG_CPU_SUBTYPE_SH7724) || \ 26 defined(CONFIG_CPU_SUBTYPE_SH7724) || \
27 defined(CONFIG_CPU_SUBTYPE_SH7730) || \
28 defined(CONFIG_CPU_SUBTYPE_SH7786) 27 defined(CONFIG_CPU_SUBTYPE_SH7786)
29#define CHCR_TS_LOW_MASK 0x00000018 28#define CHCR_TS_LOW_MASK 0x00000018
30#define CHCR_TS_LOW_SHIFT 3 29#define CHCR_TS_LOW_SHIFT 3
31#define CHCR_TS_HIGH_MASK 0x00300000 30#define CHCR_TS_HIGH_MASK 0x00300000
32#define CHCR_TS_HIGH_SHIFT (20 - 2) /* 2 bits for shifted low TS */ 31#define CHCR_TS_HIGH_SHIFT (20 - 2) /* 2 bits for shifted low TS */
33#elif defined(CONFIG_CPU_SUBTYPE_SH7757) || \ 32#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
34 defined(CONFIG_CPU_SUBTYPE_SH7763) || \ 33 defined(CONFIG_CPU_SUBTYPE_SH7764)
35 defined(CONFIG_CPU_SUBTYPE_SH7764) || \ 34#define CHCR_TS_LOW_MASK 0x00000018
36 defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 35#define CHCR_TS_LOW_SHIFT 3
37 defined(CONFIG_CPU_SUBTYPE_SH7785) 36#define CHCR_TS_HIGH_MASK 0
37#define CHCR_TS_HIGH_SHIFT 0
38#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
39#define CHCR_TS_LOW_MASK 0x00000018
40#define CHCR_TS_LOW_SHIFT 3
41#define CHCR_TS_HIGH_MASK 0
42#define CHCR_TS_HIGH_SHIFT 0
43#elif defined(CONFIG_CPU_SUBTYPE_SH7757)
38#define CHCR_TS_LOW_MASK 0x00000018 44#define CHCR_TS_LOW_MASK 0x00000018
39#define CHCR_TS_LOW_SHIFT 3 45#define CHCR_TS_LOW_SHIFT 3
40#define CHCR_TS_HIGH_MASK 0x00100000 46#define CHCR_TS_HIGH_MASK 0x00100000
41#define CHCR_TS_HIGH_SHIFT (20 - 2) /* 2 bits for shifted low TS */ 47#define CHCR_TS_HIGH_SHIFT (20 - 2) /* 2 bits for shifted low TS */
48#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
49#define CHCR_TS_LOW_MASK 0x00000018
50#define CHCR_TS_LOW_SHIFT 3
51#define CHCR_TS_HIGH_MASK 0
52#define CHCR_TS_HIGH_SHIFT 0
53#else /* SH7785 */
54#define CHCR_TS_LOW_MASK 0x00000018
55#define CHCR_TS_LOW_SHIFT 3
56#define CHCR_TS_HIGH_MASK 0
57#define CHCR_TS_HIGH_SHIFT 0
42#endif 58#endif
43 59
44/* Transmit sizes and respective CHCR register values */ 60/* Transmit sizes and respective CHCR register values */
diff --git a/arch/sh/include/cpu-sh4/cpu/dma.h b/arch/sh/include/cpu-sh4/cpu/dma.h
index a520eb21962..ca747e93c2e 100644
--- a/arch/sh/include/cpu-sh4/cpu/dma.h
+++ b/arch/sh/include/cpu-sh4/cpu/dma.h
@@ -1,17 +1,32 @@
1#ifndef __ASM_CPU_SH4_DMA_H 1#ifndef __ASM_CPU_SH4_DMA_H
2#define __ASM_CPU_SH4_DMA_H 2#define __ASM_CPU_SH4_DMA_H
3 3
4#include <linux/sh_intc.h> 4/* SH7751/7760/7780 DMA IRQ sources */
5 5
6#ifdef CONFIG_CPU_SH4A
7
8#include <cpu/dma-sh4a.h>
9
10#else /* CONFIG_CPU_SH4A */
6/* 11/*
7 * SH7750/SH7751/SH7760 12 * SH7750/SH7751/SH7760
8 */ 13 */
9#define DMTE0_IRQ evt2irq(0x640) 14#define DMTE0_IRQ 34
10#define DMTE4_IRQ evt2irq(0x780) 15#define DMTE4_IRQ 44
11#define DMTE6_IRQ evt2irq(0x7c0) 16#define DMTE6_IRQ 46
12#define DMAE0_IRQ evt2irq(0x6c0) 17#define DMAE0_IRQ 38
13 18
14#define SH_DMAC_BASE0 0xffa00000 19#define SH_DMAC_BASE0 0xffa00000
15#define SH_DMAC_BASE1 0xffa00070 20#define SH_DMAC_BASE1 0xffa00070
21/* Definitions for the SuperH DMAC */
22#define TM_BURST 0x00000080
23#define TS_8 0x00000010
24#define TS_16 0x00000020
25#define TS_32 0x00000030
26#define TS_64 0x00000000
27
28#define DMAOR_COD 0x00000008
29
30#endif
16 31
17#endif /* __ASM_CPU_SH4_DMA_H */ 32#endif /* __ASM_CPU_SH4_DMA_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/freq.h b/arch/sh/include/cpu-sh4/cpu/freq.h
index 1631fc238e6..cffd25ed024 100644
--- a/arch/sh/include/cpu-sh4/cpu/freq.h
+++ b/arch/sh/include/cpu-sh4/cpu/freq.h
@@ -47,11 +47,6 @@
47#define MSTPCR1 0xa4150034 47#define MSTPCR1 0xa4150034
48#define MSTPCR2 0xa4150038 48#define MSTPCR2 0xa4150038
49 49
50#elif defined(CONFIG_CPU_SUBTYPE_SH7734)
51#define FRQCR0 0xffc80000
52#define FRQCR2 0xffc80008
53#define FRQMR1 0xffc80014
54#define FRQMR2 0xffc80018
55#elif defined(CONFIG_CPU_SUBTYPE_SH7785) 50#elif defined(CONFIG_CPU_SUBTYPE_SH7785)
56#define FRQCR0 0xffc80000 51#define FRQCR0 0xffc80000
57#define FRQCR1 0xffc80004 52#define FRQCR1 0xffc80004
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7722.h b/arch/sh/include/cpu-sh4/cpu/sh7722.h
index 3bb74e534d0..bd0622788d6 100644
--- a/arch/sh/include/cpu-sh4/cpu/sh7722.h
+++ b/arch/sh/include/cpu-sh4/cpu/sh7722.h
@@ -222,11 +222,14 @@ enum {
222}; 222};
223 223
224enum { 224enum {
225 HWBLK_URAM, HWBLK_XYMEM, 225 HWBLK_UNKNOWN = 0,
226 HWBLK_TMU, HWBLK_CMT, HWBLK_RWDT, HWBLK_FLCTL, 226 HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_URAM, HWBLK_XYMEM,
227 HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_IIC, HWBLK_RTC, 227 HWBLK_INTC, HWBLK_DMAC, HWBLK_SHYWAY, HWBLK_HUDI,
228 HWBLK_SDHI, HWBLK_KEYSC, 228 HWBLK_UBC, HWBLK_TMU, HWBLK_CMT, HWBLK_RWDT, HWBLK_FLCTL,
229 HWBLK_USBF, HWBLK_2DG, HWBLK_SIU, HWBLK_VOU, 229 HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_SIO,
230 HWBLK_SIOF0, HWBLK_SIOF1, HWBLK_IIC, HWBLK_RTC,
231 HWBLK_TPU, HWBLK_IRDA, HWBLK_SDHI, HWBLK_SIM, HWBLK_KEYSC,
232 HWBLK_TSIF, HWBLK_USBF, HWBLK_2DG, HWBLK_SIU, HWBLK_VOU,
230 HWBLK_JPU, HWBLK_BEU, HWBLK_CEU, HWBLK_VEU, HWBLK_VPU, 233 HWBLK_JPU, HWBLK_BEU, HWBLK_CEU, HWBLK_VEU, HWBLK_VPU,
231 HWBLK_LCDC, 234 HWBLK_LCDC,
232 HWBLK_NR, 235 HWBLK_NR,
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7723.h b/arch/sh/include/cpu-sh4/cpu/sh7723.h
index 6fae50cb1e9..9b36fae7232 100644
--- a/arch/sh/include/cpu-sh4/cpu/sh7723.h
+++ b/arch/sh/include/cpu-sh4/cpu/sh7723.h
@@ -266,9 +266,10 @@ enum {
266}; 266};
267 267
268enum { 268enum {
269 HWBLK_UNKNOWN = 0,
269 HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_L2C, HWBLK_ILMEM, HWBLK_FPU, 270 HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_L2C, HWBLK_ILMEM, HWBLK_FPU,
270 HWBLK_INTC, HWBLK_DMAC0, HWBLK_SHYWAY, 271 HWBLK_INTC, HWBLK_DMAC0, HWBLK_SHYWAY,
271 HWBLK_HUDI, HWBLK_UBC, 272 HWBLK_HUDI, HWBLK_DBG, HWBLK_UBC, HWBLK_SUBC,
272 HWBLK_TMU0, HWBLK_CMT, HWBLK_RWDT, HWBLK_DMAC1, HWBLK_TMU1, 273 HWBLK_TMU0, HWBLK_CMT, HWBLK_RWDT, HWBLK_DMAC1, HWBLK_TMU1,
273 HWBLK_FLCTL, 274 HWBLK_FLCTL,
274 HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, 275 HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2,
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7724.h b/arch/sh/include/cpu-sh4/cpu/sh7724.h
index 38859f96d4e..cbc47e6bcab 100644
--- a/arch/sh/include/cpu-sh4/cpu/sh7724.h
+++ b/arch/sh/include/cpu-sh4/cpu/sh7724.h
@@ -268,9 +268,10 @@ enum {
268}; 268};
269 269
270enum { 270enum {
271 HWBLK_UNKNOWN = 0,
271 HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_RSMEM, HWBLK_ILMEM, HWBLK_L2C, 272 HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_RSMEM, HWBLK_ILMEM, HWBLK_L2C,
272 HWBLK_FPU, HWBLK_INTC, HWBLK_DMAC0, HWBLK_SHYWAY, 273 HWBLK_FPU, HWBLK_INTC, HWBLK_DMAC0, HWBLK_SHYWAY,
273 HWBLK_HUDI, HWBLK_UBC, 274 HWBLK_HUDI, HWBLK_DBG, HWBLK_UBC,
274 HWBLK_TMU0, HWBLK_CMT, HWBLK_RWDT, HWBLK_DMAC1, HWBLK_TMU1, 275 HWBLK_TMU0, HWBLK_CMT, HWBLK_RWDT, HWBLK_DMAC1, HWBLK_TMU1,
275 HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_SCIF3, 276 HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_SCIF3,
276 HWBLK_SCIF4, HWBLK_SCIF5, HWBLK_MSIOF0, HWBLK_MSIOF1, 277 HWBLK_SCIF4, HWBLK_SCIF5, HWBLK_MSIOF0, HWBLK_MSIOF1,
@@ -313,6 +314,5 @@ enum {
313 314
314extern struct clk sh7724_fsimcka_clk; 315extern struct clk sh7724_fsimcka_clk;
315extern struct clk sh7724_fsimckb_clk; 316extern struct clk sh7724_fsimckb_clk;
316extern struct clk sh7724_dv_clki;
317 317
318#endif /* __ASM_SH7724_H__ */ 318#endif /* __ASM_SH7724_H__ */
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7734.h b/arch/sh/include/cpu-sh4/cpu/sh7734.h
deleted file mode 100644
index 2fb9a7b71b4..00000000000
--- a/arch/sh/include/cpu-sh4/cpu/sh7734.h
+++ /dev/null
@@ -1,306 +0,0 @@
1#ifndef __ASM_SH7734_H__
2#define __ASM_SH7734_H__
3
4/* Pin Function Controller:
5 * GPIO_FN_xx - GPIO used to select pin function
6 * GPIO_GP_x_x - GPIO mapped to real I/O pin on CPU
7 */
8enum {
9 GPIO_GP_0_0, GPIO_GP_0_1, GPIO_GP_0_2, GPIO_GP_0_3,
10 GPIO_GP_0_4, GPIO_GP_0_5, GPIO_GP_0_6, GPIO_GP_0_7,
11 GPIO_GP_0_8, GPIO_GP_0_9, GPIO_GP_0_10, GPIO_GP_0_11,
12 GPIO_GP_0_12, GPIO_GP_0_13, GPIO_GP_0_14, GPIO_GP_0_15,
13 GPIO_GP_0_16, GPIO_GP_0_17, GPIO_GP_0_18, GPIO_GP_0_19,
14 GPIO_GP_0_20, GPIO_GP_0_21, GPIO_GP_0_22, GPIO_GP_0_23,
15 GPIO_GP_0_24, GPIO_GP_0_25, GPIO_GP_0_26, GPIO_GP_0_27,
16 GPIO_GP_0_28, GPIO_GP_0_29, GPIO_GP_0_30, GPIO_GP_0_31,
17
18 GPIO_GP_1_0, GPIO_GP_1_1, GPIO_GP_1_2, GPIO_GP_1_3,
19 GPIO_GP_1_4, GPIO_GP_1_5, GPIO_GP_1_6, GPIO_GP_1_7,
20 GPIO_GP_1_8, GPIO_GP_1_9, GPIO_GP_1_10, GPIO_GP_1_11,
21 GPIO_GP_1_12, GPIO_GP_1_13, GPIO_GP_1_14, GPIO_GP_1_15,
22 GPIO_GP_1_16, GPIO_GP_1_17, GPIO_GP_1_18, GPIO_GP_1_19,
23 GPIO_GP_1_20, GPIO_GP_1_21, GPIO_GP_1_22, GPIO_GP_1_23,
24 GPIO_GP_1_24, GPIO_GP_1_25, GPIO_GP_1_26, GPIO_GP_1_27,
25 GPIO_GP_1_28, GPIO_GP_1_29, GPIO_GP_1_30, GPIO_GP_1_31,
26
27 GPIO_GP_2_0, GPIO_GP_2_1, GPIO_GP_2_2, GPIO_GP_2_3,
28 GPIO_GP_2_4, GPIO_GP_2_5, GPIO_GP_2_6, GPIO_GP_2_7,
29 GPIO_GP_2_8, GPIO_GP_2_9, GPIO_GP_2_10, GPIO_GP_2_11,
30 GPIO_GP_2_12, GPIO_GP_2_13, GPIO_GP_2_14, GPIO_GP_2_15,
31 GPIO_GP_2_16, GPIO_GP_2_17, GPIO_GP_2_18, GPIO_GP_2_19,
32 GPIO_GP_2_20, GPIO_GP_2_21, GPIO_GP_2_22, GPIO_GP_2_23,
33 GPIO_GP_2_24, GPIO_GP_2_25, GPIO_GP_2_26, GPIO_GP_2_27,
34 GPIO_GP_2_28, GPIO_GP_2_29, GPIO_GP_2_30, GPIO_GP_2_31,
35
36 GPIO_GP_3_0, GPIO_GP_3_1, GPIO_GP_3_2, GPIO_GP_3_3,
37 GPIO_GP_3_4, GPIO_GP_3_5, GPIO_GP_3_6, GPIO_GP_3_7,
38 GPIO_GP_3_8, GPIO_GP_3_9, GPIO_GP_3_10, GPIO_GP_3_11,
39 GPIO_GP_3_12, GPIO_GP_3_13, GPIO_GP_3_14, GPIO_GP_3_15,
40 GPIO_GP_3_16, GPIO_GP_3_17, GPIO_GP_3_18, GPIO_GP_3_19,
41 GPIO_GP_3_20, GPIO_GP_3_21, GPIO_GP_3_22, GPIO_GP_3_23,
42 GPIO_GP_3_24, GPIO_GP_3_25, GPIO_GP_3_26, GPIO_GP_3_27,
43 GPIO_GP_3_28, GPIO_GP_3_29, GPIO_GP_3_30, GPIO_GP_3_31,
44
45 GPIO_GP_4_0, GPIO_GP_4_1, GPIO_GP_4_2, GPIO_GP_4_3,
46 GPIO_GP_4_4, GPIO_GP_4_5, GPIO_GP_4_6, GPIO_GP_4_7,
47 GPIO_GP_4_8, GPIO_GP_4_9, GPIO_GP_4_10, GPIO_GP_4_11,
48 GPIO_GP_4_12, GPIO_GP_4_13, GPIO_GP_4_14, GPIO_GP_4_15,
49 GPIO_GP_4_16, GPIO_GP_4_17, GPIO_GP_4_18, GPIO_GP_4_19,
50 GPIO_GP_4_20, GPIO_GP_4_21, GPIO_GP_4_22, GPIO_GP_4_23,
51 GPIO_GP_4_24, GPIO_GP_4_25, GPIO_GP_4_26, GPIO_GP_4_27,
52 GPIO_GP_4_28, GPIO_GP_4_29, GPIO_GP_4_30, GPIO_GP_4_31,
53
54 GPIO_GP_5_0, GPIO_GP_5_1, GPIO_GP_5_2, GPIO_GP_5_3,
55 GPIO_GP_5_4, GPIO_GP_5_5, GPIO_GP_5_6, GPIO_GP_5_7,
56 GPIO_GP_5_8, GPIO_GP_5_9, GPIO_GP_5_10, GPIO_GP_5_11,
57
58 GPIO_FN_CLKOUT, GPIO_FN_BS, GPIO_FN_CS0, GPIO_FN_EX_CS0, GPIO_FN_RD,
59 GPIO_FN_WE0, GPIO_FN_WE1,
60
61 GPIO_FN_SCL0, GPIO_FN_PENC0, GPIO_FN_USB_OVC0,
62
63 GPIO_FN_IRQ2_B, GPIO_FN_IRQ3_B,
64
65 /* IPSR0 */
66 GPIO_FN_A15, GPIO_FN_ST0_VCO_CLKIN, GPIO_FN_LCD_DATA15_A,
67 GPIO_FN_TIOC3D_C,
68 GPIO_FN_A14, GPIO_FN_LCD_DATA14_A, GPIO_FN_TIOC3C_C,
69 GPIO_FN_A13, GPIO_FN_LCD_DATA13_A, GPIO_FN_TIOC3B_C,
70 GPIO_FN_A12, GPIO_FN_LCD_DATA12_A, GPIO_FN_TIOC3A_C,
71 GPIO_FN_A11, GPIO_FN_ST0_D7, GPIO_FN_LCD_DATA11_A,
72 GPIO_FN_TIOC2B_C,
73 GPIO_FN_A10, GPIO_FN_ST0_D6, GPIO_FN_LCD_DATA10_A,
74 GPIO_FN_TIOC2A_C,
75 GPIO_FN_A9, GPIO_FN_ST0_D5, GPIO_FN_LCD_DATA9_A,
76 GPIO_FN_TIOC1B_C,
77 GPIO_FN_A8, GPIO_FN_ST0_D4, GPIO_FN_LCD_DATA8_A,
78 GPIO_FN_TIOC1A_C,
79 GPIO_FN_A7, GPIO_FN_ST0_D3, GPIO_FN_LCD_DATA7_A, GPIO_FN_TIOC0D_C,
80 GPIO_FN_A6, GPIO_FN_ST0_D2, GPIO_FN_LCD_DATA6_A, GPIO_FN_TIOC0C_C,
81 GPIO_FN_A5, GPIO_FN_ST0_D1, GPIO_FN_LCD_DATA5_A, GPIO_FN_TIOC0B_C,
82 GPIO_FN_A4, GPIO_FN_ST0_D0, GPIO_FN_LCD_DATA4_A, GPIO_FN_TIOC0A_C,
83 GPIO_FN_A3, GPIO_FN_ST0_VLD, GPIO_FN_LCD_DATA3_A, GPIO_FN_TCLKD_C,
84 GPIO_FN_A2, GPIO_FN_ST0_SYC, GPIO_FN_LCD_DATA2_A, GPIO_FN_TCLKC_C,
85 GPIO_FN_A1, GPIO_FN_ST0_REQ, GPIO_FN_LCD_DATA1_A, GPIO_FN_TCLKB_C,
86 GPIO_FN_A0, GPIO_FN_ST0_CLKIN, GPIO_FN_LCD_DATA0_A, GPIO_FN_TCLKA_C,
87
88 /* IPSR1 */
89 GPIO_FN_D3, GPIO_FN_SD0_DAT3_A, GPIO_FN_MMC_D3_A, GPIO_FN_ST1_D6,
90 GPIO_FN_FD3_A,
91 GPIO_FN_D2, GPIO_FN_SD0_DAT2_A, GPIO_FN_MMC_D2_A, GPIO_FN_ST1_D5,
92 GPIO_FN_FD2_A,
93 GPIO_FN_D1, GPIO_FN_SD0_DAT1_A, GPIO_FN_MMC_D1_A, GPIO_FN_ST1_D4,
94 GPIO_FN_FD1_A,
95 GPIO_FN_D0, GPIO_FN_SD0_DAT0_A, GPIO_FN_MMC_D0_A, GPIO_FN_ST1_D3,
96 GPIO_FN_FD0_A,
97 GPIO_FN_A25, GPIO_FN_TX2_D, GPIO_FN_ST1_D2,
98 GPIO_FN_A24, GPIO_FN_RX2_D, GPIO_FN_ST1_D1,
99 GPIO_FN_A23, GPIO_FN_ST1_D0, GPIO_FN_LCD_M_DISP_A,
100 GPIO_FN_A22, GPIO_FN_ST1_VLD, GPIO_FN_LCD_VEPWC_A,
101 GPIO_FN_A21, GPIO_FN_ST1_SYC, GPIO_FN_LCD_VCPWC_A,
102 GPIO_FN_A20, GPIO_FN_ST1_REQ, GPIO_FN_LCD_FLM_A,
103 GPIO_FN_A19, GPIO_FN_ST1_CLKIN, GPIO_FN_LCD_CLK_A, GPIO_FN_TIOC4D_C,
104 GPIO_FN_A18, GPIO_FN_ST1_PWM, GPIO_FN_LCD_CL2_A, GPIO_FN_TIOC4C_C,
105 GPIO_FN_A17, GPIO_FN_ST1_VCO_CLKIN, GPIO_FN_LCD_CL1_A, GPIO_FN_TIOC4B_C,
106 GPIO_FN_A16, GPIO_FN_ST0_PWM, GPIO_FN_LCD_DON_A, GPIO_FN_TIOC4A_C,
107
108 /* IPSR2 */
109 GPIO_FN_D14, GPIO_FN_TX2_B, GPIO_FN_FSE_A, GPIO_FN_ET0_TX_CLK_B,
110 GPIO_FN_D13, GPIO_FN_RX2_B, GPIO_FN_FRB_A, GPIO_FN_ET0_ETXD6_B,
111 GPIO_FN_D12, GPIO_FN_FWE_A, GPIO_FN_ET0_ETXD5_B,
112 GPIO_FN_D11, GPIO_FN_RSPI_MISO_A, GPIO_FN_QMI_QIO1_A,
113 GPIO_FN_FRE_A, GPIO_FN_ET0_ETXD3_B,
114 GPIO_FN_D10, GPIO_FN_RSPI_MOSI_A, GPIO_FN_QMO_QIO0_A,
115 GPIO_FN_FALE_A, GPIO_FN_ET0_ETXD2_B,
116 GPIO_FN_D9, GPIO_FN_SD0_CMD_A, GPIO_FN_MMC_CMD_A, GPIO_FN_QIO3_A,
117 GPIO_FN_FCLE_A, GPIO_FN_ET0_ETXD1_B,
118 GPIO_FN_D8, GPIO_FN_SD0_CLK_A, GPIO_FN_MMC_CLK_A, GPIO_FN_QIO2_A,
119 GPIO_FN_FCE_A, GPIO_FN_ET0_GTX_CLK_B,
120 GPIO_FN_D7, GPIO_FN_RSPI_SSL_A, GPIO_FN_MMC_D7_A, GPIO_FN_QSSL_A,
121 GPIO_FN_FD7_A,
122 GPIO_FN_D6, GPIO_FN_RSPI_RSPCK_A, GPIO_FN_MMC_D6_A, GPIO_FN_QSPCLK_A,
123 GPIO_FN_FD6_A,
124 GPIO_FN_D5, GPIO_FN_SD0_WP_A, GPIO_FN_MMC_D5_A, GPIO_FN_FD5_A,
125 GPIO_FN_D4, GPIO_FN_SD0_CD_A, GPIO_FN_MMC_D4_A, GPIO_FN_ST1_D7,
126 GPIO_FN_FD4_A,
127
128 /* IPSR3 */
129 GPIO_FN_DRACK0, GPIO_FN_SD1_DAT2_A, GPIO_FN_ATAG, GPIO_FN_TCLK1_A,
130 GPIO_FN_ET0_ETXD7,
131 GPIO_FN_EX_WAIT2, GPIO_FN_SD1_DAT1_A, GPIO_FN_DACK2, GPIO_FN_CAN1_RX_C,
132 GPIO_FN_ET0_MAGIC_C, GPIO_FN_ET0_ETXD6_A,
133 GPIO_FN_EX_WAIT1, GPIO_FN_SD1_DAT0_A, GPIO_FN_DREQ2, GPIO_FN_CAN1_TX_C,
134 GPIO_FN_ET0_LINK_C, GPIO_FN_ET0_ETXD5_A,
135 GPIO_FN_EX_WAIT0, GPIO_FN_TCLK1_B,
136 GPIO_FN_RD_WR, GPIO_FN_TCLK0,
137 GPIO_FN_EX_CS5, GPIO_FN_SD1_CMD_A, GPIO_FN_ATADIR, GPIO_FN_QSSL_B,
138 GPIO_FN_ET0_ETXD3_A,
139 GPIO_FN_EX_CS4, GPIO_FN_SD1_WP_A, GPIO_FN_ATAWR, GPIO_FN_QMI_QIO1_B,
140 GPIO_FN_ET0_ETXD2_A,
141 GPIO_FN_EX_CS3, GPIO_FN_SD1_CD_A, GPIO_FN_ATARD, GPIO_FN_QMO_QIO0_B,
142 GPIO_FN_ET0_ETXD1_A,
143 GPIO_FN_EX_CS2, GPIO_FN_TX3_B, GPIO_FN_ATACS1, GPIO_FN_QSPCLK_B,
144 GPIO_FN_ET0_GTX_CLK_A,
145 GPIO_FN_EX_CS1, GPIO_FN_RX3_B, GPIO_FN_ATACS0, GPIO_FN_QIO2_B,
146 GPIO_FN_ET0_ETXD0,
147 GPIO_FN_CS1_A26, GPIO_FN_QIO3_B,
148 GPIO_FN_D15, GPIO_FN_SCK2_B,
149
150 /* IPSR4 */
151 GPIO_FN_SCK2_A, GPIO_FN_VI0_G3,
152 GPIO_FN_RTS1_B, GPIO_FN_VI0_G2,
153 GPIO_FN_CTS1_B, GPIO_FN_VI0_DATA7_VI0_G1,
154 GPIO_FN_TX1_B, GPIO_FN_VI0_DATA6_VI0_G0, GPIO_FN_ET0_PHY_INT_A,
155 GPIO_FN_RX1_B, GPIO_FN_VI0_DATA5_VI0_B5, GPIO_FN_ET0_MAGIC_A,
156 GPIO_FN_SCK1_B, GPIO_FN_VI0_DATA4_VI0_B4, GPIO_FN_ET0_LINK_A,
157 GPIO_FN_RTS0_B, GPIO_FN_VI0_DATA3_VI0_B3, GPIO_FN_ET0_MDIO_A,
158 GPIO_FN_CTS0_B, GPIO_FN_VI0_DATA2_VI0_B2, GPIO_FN_RMII0_MDIO_A,
159 GPIO_FN_ET0_MDC,
160 GPIO_FN_HTX0_A, GPIO_FN_TX1_A, GPIO_FN_VI0_DATA1_VI0_B1,
161 GPIO_FN_RMII0_MDC_A, GPIO_FN_ET0_COL,
162 GPIO_FN_HRX0_A, GPIO_FN_RX1_A, GPIO_FN_VI0_DATA0_VI0_B0,
163 GPIO_FN_RMII0_CRS_DV_A, GPIO_FN_ET0_CRS,
164 GPIO_FN_HSCK0_A, GPIO_FN_SCK1_A, GPIO_FN_VI0_VSYNC,
165 GPIO_FN_RMII0_RX_ER_A, GPIO_FN_ET0_RX_ER,
166 GPIO_FN_HRTS0_A, GPIO_FN_RTS1_A, GPIO_FN_VI0_HSYNC,
167 GPIO_FN_RMII0_TXD_EN_A, GPIO_FN_ET0_RX_DV,
168 GPIO_FN_HCTS0_A, GPIO_FN_CTS1_A, GPIO_FN_VI0_FIELD,
169 GPIO_FN_RMII0_RXD1_A, GPIO_FN_ET0_ERXD7,
170
171 /* IPSR5 */
172 GPIO_FN_SD2_CLK_A, GPIO_FN_RX2_A, GPIO_FN_VI0_G4, GPIO_FN_ET0_RX_CLK_B,
173 GPIO_FN_SD2_CMD_A, GPIO_FN_TX2_A, GPIO_FN_VI0_G5, GPIO_FN_ET0_ERXD2_B,
174 GPIO_FN_SD2_DAT0_A, GPIO_FN_RX3_A, GPIO_FN_VI0_R0, GPIO_FN_ET0_ERXD3_B,
175 GPIO_FN_SD2_DAT1_A, GPIO_FN_TX3_A, GPIO_FN_VI0_R1, GPIO_FN_ET0_MDIO_B,
176 GPIO_FN_SD2_DAT2_A, GPIO_FN_RX4_A, GPIO_FN_VI0_R2, GPIO_FN_ET0_LINK_B,
177 GPIO_FN_SD2_DAT3_A, GPIO_FN_TX4_A, GPIO_FN_VI0_R3, GPIO_FN_ET0_MAGIC_B,
178 GPIO_FN_SD2_CD_A, GPIO_FN_RX5_A, GPIO_FN_VI0_R4, GPIO_FN_ET0_PHY_INT_B,
179 GPIO_FN_SD2_WP_A, GPIO_FN_TX5_A, GPIO_FN_VI0_R5,
180 GPIO_FN_REF125CK, GPIO_FN_ADTRG, GPIO_FN_RX5_C,
181 GPIO_FN_REF50CK, GPIO_FN_CTS1_E, GPIO_FN_HCTS0_D,
182
183 /* IPSR6 */
184 GPIO_FN_DU0_DR0, GPIO_FN_SCIF_CLK_B, GPIO_FN_HRX0_D, GPIO_FN_IETX_A,
185 GPIO_FN_TCLKA_A, GPIO_FN_HIFD00,
186 GPIO_FN_DU0_DR1, GPIO_FN_SCK0_B, GPIO_FN_HTX0_D, GPIO_FN_IERX_A,
187 GPIO_FN_TCLKB_A, GPIO_FN_HIFD01,
188 GPIO_FN_DU0_DR2, GPIO_FN_RX0_B, GPIO_FN_TCLKC_A, GPIO_FN_HIFD02,
189 GPIO_FN_DU0_DR3, GPIO_FN_TX0_B, GPIO_FN_TCLKD_A, GPIO_FN_HIFD03,
190 GPIO_FN_DU0_DR4, GPIO_FN_CTS0_C, GPIO_FN_TIOC0A_A, GPIO_FN_HIFD04,
191 GPIO_FN_DU0_DR5, GPIO_FN_RTS0_C, GPIO_FN_TIOC0B_A, GPIO_FN_HIFD05,
192 GPIO_FN_DU0_DR6, GPIO_FN_SCK1_C, GPIO_FN_TIOC0C_A, GPIO_FN_HIFD06,
193 GPIO_FN_DU0_DR7, GPIO_FN_RX1_C, GPIO_FN_TIOC0D_A, GPIO_FN_HIFD07,
194 GPIO_FN_DU0_DG0, GPIO_FN_TX1_C, GPIO_FN_HSCK0_D, GPIO_FN_IECLK_A,
195 GPIO_FN_TIOC1A_A, GPIO_FN_HIFD08,
196 GPIO_FN_DU0_DG1, GPIO_FN_CTS1_C, GPIO_FN_HRTS0_D, GPIO_FN_TIOC1B_A,
197 GPIO_FN_HIFD09,
198
199 /* IPSR7 */
200 GPIO_FN_DU0_DG2, GPIO_FN_RTS1_C, GPIO_FN_RMII0_MDC_B, GPIO_FN_TIOC2A_A,
201 GPIO_FN_HIFD10,
202 GPIO_FN_DU0_DG3, GPIO_FN_SCK2_C, GPIO_FN_RMII0_MDIO_B, GPIO_FN_TIOC2B_A,
203 GPIO_FN_HIFD11,
204 GPIO_FN_DU0_DG4, GPIO_FN_RX2_C, GPIO_FN_RMII0_CRS_DV_B,
205 GPIO_FN_TIOC3A_A, GPIO_FN_HIFD12,
206 GPIO_FN_DU0_DG5, GPIO_FN_TX2_C, GPIO_FN_RMII0_RX_ER_B,
207 GPIO_FN_TIOC3B_A, GPIO_FN_HIFD13,
208 GPIO_FN_DU0_DG6, GPIO_FN_RX3_C, GPIO_FN_RMII0_RXD0_B,
209 GPIO_FN_TIOC3C_A, GPIO_FN_HIFD14,
210 GPIO_FN_DU0_DG7, GPIO_FN_TX3_C, GPIO_FN_RMII0_RXD1_B,
211 GPIO_FN_TIOC3D_A, GPIO_FN_HIFD15,
212 GPIO_FN_DU0_DB0, GPIO_FN_RX4_C, GPIO_FN_RMII0_TXD_EN_B,
213 GPIO_FN_TIOC4A_A, GPIO_FN_HIFCS,
214 GPIO_FN_DU0_DB1, GPIO_FN_TX4_C, GPIO_FN_RMII0_TXD0_B,
215 GPIO_FN_TIOC4B_A, GPIO_FN_HIFRS,
216 GPIO_FN_DU0_DB2, GPIO_FN_RX5_B, GPIO_FN_RMII0_TXD1_B,
217 GPIO_FN_TIOC4C_A, GPIO_FN_HIFWR,
218 GPIO_FN_DU0_DB3, GPIO_FN_TX5_B, GPIO_FN_TIOC4D_A, GPIO_FN_HIFRD,
219 GPIO_FN_DU0_DB4, GPIO_FN_HIFINT,
220
221 /* IPSR8 */
222 GPIO_FN_DU0_DB5, GPIO_FN_HIFDREQ,
223 GPIO_FN_DU0_DB6, GPIO_FN_HIFRDY,
224 GPIO_FN_DU0_DB7, GPIO_FN_SSI_SCK0_B, GPIO_FN_HIFEBL_B,
225 GPIO_FN_DU0_DOTCLKIN, GPIO_FN_HSPI_CS0_C, GPIO_FN_SSI_WS0_B,
226 GPIO_FN_DU0_DOTCLKOUT, GPIO_FN_HSPI_CLK0_C, GPIO_FN_SSI_SDATA0_B,
227 GPIO_FN_DU0_EXHSYNC_DU0_HSYNC, GPIO_FN_HSPI_TX0_C, GPIO_FN_SSI_SCK1_B,
228 GPIO_FN_DU0_EXVSYNC_DU0_VSYNC, GPIO_FN_HSPI_RX0_C, GPIO_FN_SSI_WS1_B,
229 GPIO_FN_DU0_EXODDF_DU0_ODDF, GPIO_FN_CAN0_RX_B, GPIO_FN_HSCK0_B,
230 GPIO_FN_SSI_SDATA1_B,
231 GPIO_FN_DU0_DISP, GPIO_FN_CAN0_TX_B, GPIO_FN_HRX0_B,
232 GPIO_FN_AUDIO_CLKA_B,
233 GPIO_FN_DU0_CDE, GPIO_FN_HTX0_B, GPIO_FN_AUDIO_CLKB_B,
234 GPIO_FN_LCD_VCPWC_B,
235 GPIO_FN_IRQ0_A, GPIO_FN_HSPI_TX_B, GPIO_FN_RX3_E, GPIO_FN_ET0_ERXD0,
236 GPIO_FN_IRQ1_A, GPIO_FN_HSPI_RX_B, GPIO_FN_TX3_E, GPIO_FN_ET0_ERXD1,
237 GPIO_FN_IRQ2_A, GPIO_FN_CTS0_A, GPIO_FN_HCTS0_B, GPIO_FN_ET0_ERXD2_A,
238 GPIO_FN_IRQ3_A, GPIO_FN_RTS0_A, GPIO_FN_HRTS0_B, GPIO_FN_ET0_ERXD3_A,
239
240 /* IPSR9 */
241 GPIO_FN_VI1_CLK_A, GPIO_FN_FD0_B, GPIO_FN_LCD_DATA0_B,
242 GPIO_FN_VI1_0_A, GPIO_FN_FD1_B, GPIO_FN_LCD_DATA1_B,
243 GPIO_FN_VI1_1_A, GPIO_FN_FD2_B, GPIO_FN_LCD_DATA2_B,
244 GPIO_FN_VI1_2_A, GPIO_FN_FD3_B, GPIO_FN_LCD_DATA3_B,
245 GPIO_FN_VI1_3_A, GPIO_FN_FD4_B, GPIO_FN_LCD_DATA4_B,
246 GPIO_FN_VI1_4_A, GPIO_FN_FD5_B, GPIO_FN_LCD_DATA5_B,
247 GPIO_FN_VI1_5_A, GPIO_FN_FD6_B, GPIO_FN_LCD_DATA6_B,
248 GPIO_FN_VI1_6_A, GPIO_FN_FD7_B, GPIO_FN_LCD_DATA7_B,
249 GPIO_FN_VI1_7_A, GPIO_FN_FCE_B, GPIO_FN_LCD_DATA8_B,
250 GPIO_FN_SSI_SCK0_A, GPIO_FN_TIOC1A_B, GPIO_FN_LCD_DATA9_B,
251 GPIO_FN_SSI_WS0_A, GPIO_FN_TIOC1B_B, GPIO_FN_LCD_DATA10_B,
252 GPIO_FN_SSI_SDATA0_A, GPIO_FN_VI1_0_B, GPIO_FN_TIOC2A_B,
253 GPIO_FN_LCD_DATA11_B,
254 GPIO_FN_SSI_SCK1_A, GPIO_FN_VI1_1_B, GPIO_FN_TIOC2B_B,
255 GPIO_FN_LCD_DATA12_B,
256 GPIO_FN_SSI_WS1_A, GPIO_FN_VI1_2_B, GPIO_FN_LCD_DATA13_B,
257 GPIO_FN_SSI_SDATA1_A, GPIO_FN_VI1_3_B, GPIO_FN_LCD_DATA14_B,
258
259 /* IPSR10 */
260 GPIO_FN_SSI_SCK23, GPIO_FN_VI1_4_B, GPIO_FN_RX1_D, GPIO_FN_FCLE_B,
261 GPIO_FN_LCD_DATA15_B,
262 GPIO_FN_SSI_WS23, GPIO_FN_VI1_5_B, GPIO_FN_TX1_D, GPIO_FN_HSCK0_C,
263 GPIO_FN_FALE_B, GPIO_FN_LCD_DON_B,
264 GPIO_FN_SSI_SDATA2, GPIO_FN_VI1_6_B, GPIO_FN_HRX0_C, GPIO_FN_FRE_B,
265 GPIO_FN_LCD_CL1_B,
266 GPIO_FN_SSI_SDATA3, GPIO_FN_VI1_7_B, GPIO_FN_HTX0_C, GPIO_FN_FWE_B,
267 GPIO_FN_LCD_CL2_B,
268 GPIO_FN_AUDIO_CLKA_A, GPIO_FN_VI1_CLK_B, GPIO_FN_SCK1_D,
269 GPIO_FN_IECLK_B, GPIO_FN_LCD_FLM_B,
270 GPIO_FN_AUDIO_CLKB_A, GPIO_FN_LCD_CLK_B,
271 GPIO_FN_AUDIO_CLKC, GPIO_FN_SCK1_E, GPIO_FN_HCTS0_C, GPIO_FN_FRB_B,
272 GPIO_FN_LCD_VEPWC_B,
273 GPIO_FN_AUDIO_CLKOUT, GPIO_FN_TX1_E, GPIO_FN_HRTS0_C, GPIO_FN_FSE_B,
274 GPIO_FN_LCD_M_DISP_B,
275 GPIO_FN_CAN_CLK_A, GPIO_FN_RX4_D,
276 GPIO_FN_CAN0_TX_A, GPIO_FN_TX4_D, GPIO_FN_MLB_CLK,
277 GPIO_FN_CAN1_RX_A, GPIO_FN_IRQ1_B,
278 GPIO_FN_CAN0_RX_A, GPIO_FN_IRQ0_B, GPIO_FN_MLB_SIG,
279 GPIO_FN_CAN1_TX_A, GPIO_FN_TX5_C, GPIO_FN_MLB_DAT,
280
281 /* IPSR11 */
282 GPIO_FN_SCL1, GPIO_FN_SCIF_CLK_C,
283 GPIO_FN_SDA1, GPIO_FN_RX1_E,
284 GPIO_FN_SDA0, GPIO_FN_HIFEBL_A,
285 GPIO_FN_SDSELF, GPIO_FN_RTS1_E,
286 GPIO_FN_SCIF_CLK_A, GPIO_FN_HSPI_CLK_A, GPIO_FN_VI0_CLK,
287 GPIO_FN_RMII0_TXD0_A, GPIO_FN_ET0_ERXD4,
288 GPIO_FN_SCK0_A, GPIO_FN_HSPI_CS_A, GPIO_FN_VI0_CLKENB,
289 GPIO_FN_RMII0_TXD1_A, GPIO_FN_ET0_ERXD5,
290 GPIO_FN_RX0_A, GPIO_FN_HSPI_RX_A, GPIO_FN_RMII0_RXD0_A,
291 GPIO_FN_ET0_ERXD6,
292 GPIO_FN_TX0_A, GPIO_FN_HSPI_TX_A,
293 GPIO_FN_PENC1, GPIO_FN_TX3_D, GPIO_FN_CAN1_TX_B, GPIO_FN_TX5_D,
294 GPIO_FN_IETX_B,
295 GPIO_FN_USB_OVC1, GPIO_FN_RX3_D, GPIO_FN_CAN1_RX_B, GPIO_FN_RX5_D,
296 GPIO_FN_IERX_B,
297 GPIO_FN_DREQ0, GPIO_FN_SD1_CLK_A, GPIO_FN_ET0_TX_EN,
298 GPIO_FN_DACK0, GPIO_FN_SD1_DAT3_A, GPIO_FN_ET0_TX_ER,
299 GPIO_FN_DREQ1, GPIO_FN_HSPI_CLK_B, GPIO_FN_RX4_B, GPIO_FN_ET0_PHY_INT_C,
300 GPIO_FN_ET0_TX_CLK_A,
301 GPIO_FN_DACK1, GPIO_FN_HSPI_CS_B, GPIO_FN_TX4_B, GPIO_FN_ET0_RX_CLK_A,
302 GPIO_FN_PRESETOUT, GPIO_FN_ST_CLKOUT,
303
304};
305
306#endif /* __ASM_SH7734_H__ */
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7757.h b/arch/sh/include/cpu-sh4/cpu/sh7757.h
index 5340f3bc186..41f9f8b9db7 100644
--- a/arch/sh/include/cpu-sh4/cpu/sh7757.h
+++ b/arch/sh/include/cpu-sh4/cpu/sh7757.h
@@ -283,7 +283,5 @@ enum {
283 SHDMA_SLAVE_RIIC8_RX, 283 SHDMA_SLAVE_RIIC8_RX,
284 SHDMA_SLAVE_RIIC9_TX, 284 SHDMA_SLAVE_RIIC9_TX,
285 SHDMA_SLAVE_RIIC9_RX, 285 SHDMA_SLAVE_RIIC9_RX,
286 SHDMA_SLAVE_RSPI_TX,
287 SHDMA_SLAVE_RSPI_RX,
288}; 286};
289#endif /* __ASM_SH7757_H__ */ 287#endif /* __ASM_SH7757_H__ */
diff --git a/arch/sh/include/cpu-sh4a/cpu/dma.h b/arch/sh/include/cpu-sh4a/cpu/dma.h
deleted file mode 100644
index 89afb650ce2..00000000000
--- a/arch/sh/include/cpu-sh4a/cpu/dma.h
+++ /dev/null
@@ -1,72 +0,0 @@
1#ifndef __ASM_SH_CPU_SH4_DMA_SH7780_H
2#define __ASM_SH_CPU_SH4_DMA_SH7780_H
3
4#include <linux/sh_intc.h>
5
6#if defined(CONFIG_CPU_SUBTYPE_SH7343) || \
7 defined(CONFIG_CPU_SUBTYPE_SH7730)
8#define DMTE0_IRQ evt2irq(0x800)
9#define DMTE4_IRQ evt2irq(0xb80)
10#define DMAE0_IRQ evt2irq(0xbc0) /* DMA Error IRQ*/
11#define SH_DMAC_BASE0 0xFE008020
12#elif defined(CONFIG_CPU_SUBTYPE_SH7722)
13#define DMTE0_IRQ evt2irq(0x800)
14#define DMTE4_IRQ evt2irq(0xb80)
15#define DMAE0_IRQ evt2irq(0xbc0) /* DMA Error IRQ*/
16#define SH_DMAC_BASE0 0xFE008020
17#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
18 defined(CONFIG_CPU_SUBTYPE_SH7764)
19#define DMTE0_IRQ evt2irq(0x640)
20#define DMTE4_IRQ evt2irq(0x780)
21#define DMAE0_IRQ evt2irq(0x6c0)
22#define SH_DMAC_BASE0 0xFF608020
23#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
24#define DMTE0_IRQ evt2irq(0x800) /* DMAC0A*/
25#define DMTE4_IRQ evt2irq(0xb80) /* DMAC0B */
26#define DMTE6_IRQ evt2irq(0x700)
27#define DMTE8_IRQ evt2irq(0x740) /* DMAC1A */
28#define DMTE9_IRQ evt2irq(0x760)
29#define DMTE10_IRQ evt2irq(0xb00) /* DMAC1B */
30#define DMTE11_IRQ evt2irq(0xb20)
31#define DMAE0_IRQ evt2irq(0xbc0) /* DMA Error IRQ*/
32#define DMAE1_IRQ evt2irq(0xb40) /* DMA Error IRQ*/
33#define SH_DMAC_BASE0 0xFE008020
34#define SH_DMAC_BASE1 0xFDC08020
35#elif defined(CONFIG_CPU_SUBTYPE_SH7724)
36#define DMTE0_IRQ evt2irq(0x800) /* DMAC0A*/
37#define DMTE4_IRQ evt2irq(0xb80) /* DMAC0B */
38#define DMTE6_IRQ evt2irq(0x700)
39#define DMTE8_IRQ evt2irq(0x740) /* DMAC1A */
40#define DMTE9_IRQ evt2irq(0x760)
41#define DMTE10_IRQ evt2irq(0xb00) /* DMAC1B */
42#define DMTE11_IRQ evt2irq(0xb20)
43#define DMAE0_IRQ evt2irq(0xbc0) /* DMA Error IRQ*/
44#define DMAE1_IRQ evt2irq(0xb40) /* DMA Error IRQ*/
45#define SH_DMAC_BASE0 0xFE008020
46#define SH_DMAC_BASE1 0xFDC08020
47#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
48#define DMTE0_IRQ evt2irq(0x640)
49#define DMTE4_IRQ evt2irq(0x780)
50#define DMTE6_IRQ evt2irq(0x7c0)
51#define DMTE8_IRQ evt2irq(0xd80)
52#define DMTE9_IRQ evt2irq(0xda0)
53#define DMTE10_IRQ evt2irq(0xdc0)
54#define DMTE11_IRQ evt2irq(0xde0)
55#define DMAE0_IRQ evt2irq(0x6c0) /* DMA Error IRQ */
56#define SH_DMAC_BASE0 0xFC808020
57#define SH_DMAC_BASE1 0xFC818020
58#else /* SH7785 */
59#define DMTE0_IRQ evt2irq(0x620)
60#define DMTE4_IRQ evt2irq(0x6a0)
61#define DMTE6_IRQ evt2irq(0x880)
62#define DMTE8_IRQ evt2irq(0x8c0)
63#define DMTE9_IRQ evt2irq(0x8e0)
64#define DMTE10_IRQ evt2irq(0x900)
65#define DMTE11_IRQ evt2irq(0x920)
66#define DMAE0_IRQ evt2irq(0x6e0) /* DMA Error IRQ0 */
67#define DMAE1_IRQ evt2irq(0x940) /* DMA Error IRQ1 */
68#define SH_DMAC_BASE0 0xFC808020
69#define SH_DMAC_BASE1 0xFCC08020
70#endif
71
72#endif /* __ASM_SH_CPU_SH4_DMA_SH7780_H */
diff --git a/arch/sh/include/mach-common/mach/hp6xx.h b/arch/sh/include/mach-common/mach/hp6xx.h
index 6aaaf8596e6..bcc301ac12f 100644
--- a/arch/sh/include/mach-common/mach/hp6xx.h
+++ b/arch/sh/include/mach-common/mach/hp6xx.h
@@ -9,11 +9,10 @@
9 * for more details. 9 * for more details.
10 * 10 *
11 */ 11 */
12#include <linux/sh_intc.h>
13 12
14#define HP680_BTN_IRQ evt2irq(0x600) /* IRQ0_IRQ */ 13#define HP680_BTN_IRQ 32 /* IRQ0_IRQ */
15#define HP680_TS_IRQ evt2irq(0x660) /* IRQ3_IRQ */ 14#define HP680_TS_IRQ 35 /* IRQ3_IRQ */
16#define HP680_HD64461_IRQ evt2irq(0x680) /* IRQ4_IRQ */ 15#define HP680_HD64461_IRQ 36 /* IRQ4_IRQ */
17 16
18#define DAC_LCD_BRIGHTNESS 0 17#define DAC_LCD_BRIGHTNESS 0
19#define DAC_SPEAKER_VOLUME 1 18#define DAC_SPEAKER_VOLUME 1
diff --git a/arch/sh/include/mach-common/mach/lboxre2.h b/arch/sh/include/mach-common/mach/lboxre2.h
index 3a4dcc5c74e..e6d16050492 100644
--- a/arch/sh/include/mach-common/mach/lboxre2.h
+++ b/arch/sh/include/mach-common/mach/lboxre2.h
@@ -11,14 +11,13 @@
11 * for more details. 11 * for more details.
12 * 12 *
13 */ 13 */
14#include <linux/sh_intc.h>
15 14
16#define IRQ_CF1 evt2irq(0x320) /* CF1 */ 15#define IRQ_CF1 9 /* CF1 */
17#define IRQ_CF0 evt2irq(0x340) /* CF0 */ 16#define IRQ_CF0 10 /* CF0 */
18#define IRQ_INTD evt2irq(0x360) /* INTD */ 17#define IRQ_INTD 11 /* INTD */
19#define IRQ_ETH1 evt2irq(0x380) /* Ether1 */ 18#define IRQ_ETH1 12 /* Ether1 */
20#define IRQ_ETH0 evt2irq(0x3a0) /* Ether0 */ 19#define IRQ_ETH0 13 /* Ether0 */
21#define IRQ_INTA evt2irq(0x3c0) /* INTA */ 20#define IRQ_INTA 14 /* INTA */
22 21
23void init_lboxre2_IRQ(void); 22void init_lboxre2_IRQ(void);
24 23
diff --git a/arch/sh/include/mach-common/mach/mangle-port.h b/arch/sh/include/mach-common/mach/mangle-port.h
deleted file mode 100644
index 4ca1769a0f1..00000000000
--- a/arch/sh/include/mach-common/mach/mangle-port.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * SH version cribbed from the MIPS copy:
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2003, 2004 Ralf Baechle
9 */
10#ifndef __MACH_COMMON_MANGLE_PORT_H
11#define __MACH_COMMON_MANGLE_PORT_H
12
13/*
14 * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware;
15 * less sane hardware forces software to fiddle with this...
16 *
17 * Regardless, if the host bus endianness mismatches that of PCI/ISA, then
18 * you can't have the numerical value of data and byte addresses within
19 * multibyte quantities both preserved at the same time. Hence two
20 * variations of functions: non-prefixed ones that preserve the value
21 * and prefixed ones that preserve byte addresses. The latters are
22 * typically used for moving raw data between a peripheral and memory (cf.
23 * string I/O functions), hence the "__mem_" prefix.
24 */
25#if defined(CONFIG_SWAP_IO_SPACE)
26
27# define ioswabb(x) (x)
28# define __mem_ioswabb(x) (x)
29# define ioswabw(x) le16_to_cpu(x)
30# define __mem_ioswabw(x) (x)
31# define ioswabl(x) le32_to_cpu(x)
32# define __mem_ioswabl(x) (x)
33# define ioswabq(x) le64_to_cpu(x)
34# define __mem_ioswabq(x) (x)
35
36#else
37
38# define ioswabb(x) (x)
39# define __mem_ioswabb(x) (x)
40# define ioswabw(x) (x)
41# define __mem_ioswabw(x) cpu_to_le16(x)
42# define ioswabl(x) (x)
43# define __mem_ioswabl(x) cpu_to_le32(x)
44# define ioswabq(x) (x)
45# define __mem_ioswabq(x) cpu_to_le32(x)
46
47#endif
48
49#endif /* __MACH_COMMON_MANGLE_PORT_H */
diff --git a/arch/sh/include/mach-common/mach/sdk7780.h b/arch/sh/include/mach-common/mach/sdk7780.h
index ce64e02e9b5..697dc865f21 100644
--- a/arch/sh/include/mach-common/mach/sdk7780.h
+++ b/arch/sh/include/mach-common/mach/sdk7780.h
@@ -11,7 +11,6 @@
11 * License. See the file "COPYING" in the main directory of this archive 11 * License. See the file "COPYING" in the main directory of this archive
12 * for more details. 12 * for more details.
13 */ 13 */
14#include <linux/sh_intc.h>
15#include <asm/addrspace.h> 14#include <asm/addrspace.h>
16 15
17/* Box specific addresses. */ 16/* Box specific addresses. */
@@ -68,9 +67,9 @@
68 67
69#define SDK7780_NR_IRL 15 68#define SDK7780_NR_IRL 15
70/* IDE/ATA interrupt */ 69/* IDE/ATA interrupt */
71#define IRQ_CFCARD evt2irq(0x3c0) 70#define IRQ_CFCARD 14
72/* SMC interrupt */ 71/* SMC interrupt */
73#define IRQ_ETHERNET evt2irq(0x2c0) 72#define IRQ_ETHERNET 6
74 73
75 74
76/* arch/sh/boards/renesas/sdk7780/irq.c */ 75/* arch/sh/boards/renesas/sdk7780/irq.c */
diff --git a/arch/sh/include/mach-common/mach/titan.h b/arch/sh/include/mach-common/mach/titan.h
index fa3cd801cf2..4a674d27cbb 100644
--- a/arch/sh/include/mach-common/mach/titan.h
+++ b/arch/sh/include/mach-common/mach/titan.h
@@ -4,16 +4,14 @@
4#ifndef _ASM_SH_TITAN_H 4#ifndef _ASM_SH_TITAN_H
5#define _ASM_SH_TITAN_H 5#define _ASM_SH_TITAN_H
6 6
7#include <linux/sh_intc.h>
8
9#define __IO_PREFIX titan 7#define __IO_PREFIX titan
10#include <asm/io_generic.h> 8#include <asm/io_generic.h>
11 9
12/* IRQ assignments */ 10/* IRQ assignments */
13#define TITAN_IRQ_WAN evt2irq(0x240) /* eth0 (WAN) */ 11#define TITAN_IRQ_WAN 2 /* eth0 (WAN) */
14#define TITAN_IRQ_LAN evt2irq(0x2a0) /* eth1 (LAN) */ 12#define TITAN_IRQ_LAN 5 /* eth1 (LAN) */
15#define TITAN_IRQ_MPCIA evt2irq(0x300) /* mPCI A */ 13#define TITAN_IRQ_MPCIA 8 /* mPCI A */
16#define TITAN_IRQ_MPCIB evt2irq(0x360) /* mPCI B */ 14#define TITAN_IRQ_MPCIB 11 /* mPCI B */
17#define TITAN_IRQ_USB evt2irq(0x360) /* USB */ 15#define TITAN_IRQ_USB 11 /* USB */
18 16
19#endif /* __ASM_SH_TITAN_H */ 17#endif /* __ASM_SH_TITAN_H */
diff --git a/arch/sh/include/mach-dreamcast/mach/dma.h b/arch/sh/include/mach-dreamcast/mach/dma.h
index 1dbfdf701c9..ddd68e78870 100644
--- a/arch/sh/include/mach-dreamcast/mach/dma.h
+++ b/arch/sh/include/mach-dreamcast/mach/dma.h
@@ -11,7 +11,9 @@
11#define __ASM_SH_DREAMCAST_DMA_H 11#define __ASM_SH_DREAMCAST_DMA_H
12 12
13/* Number of DMA channels */ 13/* Number of DMA channels */
14#define ONCHIP_NR_DMA_CHANNELS 4
14#define G2_NR_DMA_CHANNELS 4 15#define G2_NR_DMA_CHANNELS 4
16#define PVR2_NR_DMA_CHANNELS 1
15 17
16/* Channels for cascading */ 18/* Channels for cascading */
17#define PVR2_CASCADE_CHAN 2 19#define PVR2_CASCADE_CHAN 2
diff --git a/arch/sh/include/mach-ecovec24/mach/romimage.h b/arch/sh/include/mach-ecovec24/mach/romimage.h
index 60f3e8af05f..d63ef51ec18 100644
--- a/arch/sh/include/mach-ecovec24/mach/romimage.h
+++ b/arch/sh/include/mach-ecovec24/mach/romimage.h
@@ -6,7 +6,7 @@
6 */ 6 */
7 7
8#include <asm/romimage-macros.h> 8#include <asm/romimage-macros.h>
9#include <mach/partner-jet-setup.txt> 9#include "partner-jet-setup.txt"
10 10
11 /* execute icbi after enabling cache */ 11 /* execute icbi after enabling cache */
12 mov.l 1f, r0 12 mov.l 1f, r0
diff --git a/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h b/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
index c20c9e5f5ea..07e635b0e04 100644
--- a/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
+++ b/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
@@ -4,19 +4,21 @@
4#include <video/sh_mobile_lcdc.h> 4#include <video/sh_mobile_lcdc.h>
5 5
6#if defined(CONFIG_FB_SH_MOBILE_LCDC) || defined(CONFIG_FB_SH_MOBILE_LCDC_MODULE) 6#if defined(CONFIG_FB_SH_MOBILE_LCDC) || defined(CONFIG_FB_SH_MOBILE_LCDC_MODULE)
7int kfr2r09_lcd_set_brightness(int brightness); 7void kfr2r09_lcd_on(void *board_data, struct fb_info *info);
8int kfr2r09_lcd_setup(void *sys_ops_handle, 8void kfr2r09_lcd_off(void *board_data);
9int kfr2r09_lcd_setup(void *board_data, void *sys_ops_handle,
9 struct sh_mobile_lcdc_sys_bus_ops *sys_ops); 10 struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
10void kfr2r09_lcd_start(void *sys_ops_handle, 11void kfr2r09_lcd_start(void *board_data, void *sys_ops_handle,
11 struct sh_mobile_lcdc_sys_bus_ops *sys_ops); 12 struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
12#else 13#else
13static int kfr2r09_lcd_set_brightness(int brightness) {} 14static void kfr2r09_lcd_on(void *board_data) {}
14static int kfr2r09_lcd_setup(void *sys_ops_handle, 15static void kfr2r09_lcd_off(void *board_data) {}
16static int kfr2r09_lcd_setup(void *board_data, void *sys_ops_handle,
15 struct sh_mobile_lcdc_sys_bus_ops *sys_ops) 17 struct sh_mobile_lcdc_sys_bus_ops *sys_ops)
16{ 18{
17 return -ENODEV; 19 return -ENODEV;
18} 20}
19static void kfr2r09_lcd_start(void *sys_ops_handle, 21static void kfr2r09_lcd_start(void *board_data, void *sys_ops_handle,
20 struct sh_mobile_lcdc_sys_bus_ops *sys_ops) 22 struct sh_mobile_lcdc_sys_bus_ops *sys_ops)
21{ 23{
22} 24}
diff --git a/arch/sh/include/mach-kfr2r09/mach/romimage.h b/arch/sh/include/mach-kfr2r09/mach/romimage.h
index 1afae21ced5..7a883167c84 100644
--- a/arch/sh/include/mach-kfr2r09/mach/romimage.h
+++ b/arch/sh/include/mach-kfr2r09/mach/romimage.h
@@ -6,7 +6,7 @@
6 */ 6 */
7 7
8#include <asm/romimage-macros.h> 8#include <asm/romimage-macros.h>
9#include <mach/partner-jet-setup.txt> 9#include "partner-jet-setup.txt"
10 10
11 /* execute icbi after enabling cache */ 11 /* execute icbi after enabling cache */
12 mov.l 1f, r0 12 mov.l 1f, r0
diff --git a/arch/sh/include/mach-landisk/mach/iodata_landisk.h b/arch/sh/include/mach-landisk/mach/iodata_landisk.h
index ceeea48cc7a..f432773a957 100644
--- a/arch/sh/include/mach-landisk/mach/iodata_landisk.h
+++ b/arch/sh/include/mach-landisk/mach/iodata_landisk.h
@@ -8,7 +8,6 @@
8 * 8 *
9 * IO-DATA LANDISK support 9 * IO-DATA LANDISK support
10 */ 10 */
11#include <linux/sh_intc.h>
12 11
13/* Box specific addresses. */ 12/* Box specific addresses. */
14 13
@@ -26,15 +25,15 @@
26#define PA_PIDE_OFFSET 0x40 /* CF IDE Offset */ 25#define PA_PIDE_OFFSET 0x40 /* CF IDE Offset */
27#define PA_SIDE_OFFSET 0x40 /* HDD IDE Offset */ 26#define PA_SIDE_OFFSET 0x40 /* HDD IDE Offset */
28 27
29#define IRQ_PCIINTA evt2irq(0x2a0) /* PCI INTA IRQ */ 28#define IRQ_PCIINTA 5 /* PCI INTA IRQ */
30#define IRQ_PCIINTB evt2irq(0x2c0) /* PCI INTB IRQ */ 29#define IRQ_PCIINTB 6 /* PCI INTB IRQ */
31#define IRQ_PCIINTC evt2irq(0x2e0) /* PCI INTC IRQ */ 30#define IRQ_PCIINTC 7 /* PCI INTC IRQ */
32#define IRQ_PCIINTD evt2irq(0x300) /* PCI INTD IRQ */ 31#define IRQ_PCIINTD 8 /* PCI INTD IRQ */
33#define IRQ_ATA evt2irq(0x320) /* ATA IRQ */ 32#define IRQ_ATA 9 /* ATA IRQ */
34#define IRQ_FATA evt2irq(0x340) /* FATA IRQ */ 33#define IRQ_FATA 10 /* FATA IRQ */
35#define IRQ_POWER evt2irq(0x360) /* Power Switch IRQ */ 34#define IRQ_POWER 11 /* Power Switch IRQ */
36#define IRQ_BUTTON evt2irq(0x380) /* USL-5P Button IRQ */ 35#define IRQ_BUTTON 12 /* USL-5P Button IRQ */
37#define IRQ_FAULT evt2irq(0x3a0) /* USL-5P Fault IRQ */ 36#define IRQ_FAULT 13 /* USL-5P Fault IRQ */
38 37
39void init_landisk_IRQ(void); 38void init_landisk_IRQ(void);
40 39
diff --git a/arch/sh/include/mach-migor/mach/migor.h b/arch/sh/include/mach-migor/mach/migor.h
index 7de7bb74c29..42fccf93412 100644
--- a/arch/sh/include/mach-migor/mach/migor.h
+++ b/arch/sh/include/mach-migor/mach/migor.h
@@ -9,7 +9,7 @@
9 9
10#include <video/sh_mobile_lcdc.h> 10#include <video/sh_mobile_lcdc.h>
11 11
12int migor_lcd_qvga_setup(void *sys_ops_handle, 12int migor_lcd_qvga_setup(void *board_data, void *sys_ops_handle,
13 struct sh_mobile_lcdc_sys_bus_ops *sys_ops); 13 struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
14 14
15#endif /* __ASM_SH_MIGOR_H */ 15#endif /* __ASM_SH_MIGOR_H */
diff --git a/arch/sh/include/mach-se/mach/se.h b/arch/sh/include/mach-se/mach/se.h
index 8a6d44b4987..14be91c5a2f 100644
--- a/arch/sh/include/mach-se/mach/se.h
+++ b/arch/sh/include/mach-se/mach/se.h
@@ -8,7 +8,6 @@
8 * 8 *
9 * Hitachi SolutionEngine support 9 * Hitachi SolutionEngine support
10 */ 10 */
11#include <linux/sh_intc.h>
12 11
13/* Box specific addresses. */ 12/* Box specific addresses. */
14 13
@@ -83,16 +82,16 @@
83#define INTC_IPRD 0xa4000018UL 82#define INTC_IPRD 0xa4000018UL
84#define INTC_IPRE 0xa400001aUL 83#define INTC_IPRE 0xa400001aUL
85 84
86#define IRQ0_IRQ evt2irq(0x600) 85#define IRQ0_IRQ 32
87#define IRQ1_IRQ evt2irq(0x620) 86#define IRQ1_IRQ 33
88#endif 87#endif
89 88
90#if defined(CONFIG_CPU_SUBTYPE_SH7705) 89#if defined(CONFIG_CPU_SUBTYPE_SH7705)
91#define IRQ_STNIC evt2irq(0x380) 90#define IRQ_STNIC 12
92#define IRQ_CFCARD evt2irq(0x3c0) 91#define IRQ_CFCARD 14
93#else 92#else
94#define IRQ_STNIC evt2irq(0x340) 93#define IRQ_STNIC 10
95#define IRQ_CFCARD evt2irq(0x2e0) 94#define IRQ_CFCARD 7
96#endif 95#endif
97 96
98/* SH Ether support (SH7710/SH7712) */ 97/* SH Ether support (SH7710/SH7712) */
@@ -106,9 +105,9 @@
106# define PHY_ID 0x01 105# define PHY_ID 0x01
107#endif 106#endif
108/* Ether IRQ */ 107/* Ether IRQ */
109#define SH_ETH0_IRQ evt2irq(0xc00) 108#define SH_ETH0_IRQ 80
110#define SH_ETH1_IRQ evt2irq(0xc20) 109#define SH_ETH1_IRQ 81
111#define SH_TSU_IRQ evt2irq(0xc40) 110#define SH_TSU_IRQ 82
112 111
113void init_se_IRQ(void); 112void init_se_IRQ(void);
114 113
diff --git a/arch/sh/include/mach-se/mach/se7343.h b/arch/sh/include/mach-se/mach/se7343.h
index 542521c970c..8d8170d6cc4 100644
--- a/arch/sh/include/mach-se/mach/se7343.h
+++ b/arch/sh/include/mach-se/mach/se7343.h
@@ -8,7 +8,6 @@
8 * 8 *
9 * SH-Mobile SolutionEngine 7343 support 9 * SH-Mobile SolutionEngine 7343 support
10 */ 10 */
11#include <linux/sh_intc.h>
12 11
13/* Box specific addresses. */ 12/* Box specific addresses. */
14 13
@@ -50,6 +49,9 @@
50#define PA_LED 0xb0C00000 /* LED */ 49#define PA_LED 0xb0C00000 /* LED */
51#define LED_SHIFT 0 50#define LED_SHIFT 0
52#define PA_DIPSW 0xb0900000 /* Dip switch 31 */ 51#define PA_DIPSW 0xb0900000 /* Dip switch 31 */
52#define PA_CPLD_MODESET 0xb1400004 /* CPLD Mode set register */
53#define PA_CPLD_ST 0xb1400008 /* CPLD Interrupt status register */
54#define PA_CPLD_IMSK 0xb140000a /* CPLD Interrupt mask register */
53/* Area 5 */ 55/* Area 5 */
54#define PA_EXT5 0x14000000 56#define PA_EXT5 0x14000000
55#define PA_EXT5_SIZE 0x04000000 57#define PA_EXT5_SIZE 0x04000000
@@ -116,10 +118,10 @@
116#define FPGA_IN 0xb1400000 118#define FPGA_IN 0xb1400000
117#define FPGA_OUT 0xb1400002 119#define FPGA_OUT 0xb1400002
118 120
119#define IRQ0_IRQ evt2irq(0x600) 121#define IRQ0_IRQ 32
120#define IRQ1_IRQ evt2irq(0x620) 122#define IRQ1_IRQ 33
121#define IRQ4_IRQ evt2irq(0x680) 123#define IRQ4_IRQ 36
122#define IRQ5_IRQ evt2irq(0x6a0) 124#define IRQ5_IRQ 37
123 125
124#define SE7343_FPGA_IRQ_MRSHPC0 0 126#define SE7343_FPGA_IRQ_MRSHPC0 0
125#define SE7343_FPGA_IRQ_MRSHPC1 1 127#define SE7343_FPGA_IRQ_MRSHPC1 1
@@ -132,10 +134,8 @@
132 134
133#define SE7343_FPGA_IRQ_NR 12 135#define SE7343_FPGA_IRQ_NR 12
134 136
135struct irq_domain;
136
137/* arch/sh/boards/se/7343/irq.c */ 137/* arch/sh/boards/se/7343/irq.c */
138extern struct irq_domain *se7343_irq_domain; 138extern unsigned int se7343_fpga_irq[];
139 139
140void init_7343se_IRQ(void); 140void init_7343se_IRQ(void);
141 141
diff --git a/arch/sh/include/mach-se/mach/se7721.h b/arch/sh/include/mach-se/mach/se7721.h
index eabd0538de4..b957f604119 100644
--- a/arch/sh/include/mach-se/mach/se7721.h
+++ b/arch/sh/include/mach-se/mach/se7721.h
@@ -11,8 +11,6 @@
11 11
12#ifndef __ASM_SH_SE7721_H 12#ifndef __ASM_SH_SE7721_H
13#define __ASM_SH_SE7721_H 13#define __ASM_SH_SE7721_H
14
15#include <linux/sh_intc.h>
16#include <asm/addrspace.h> 14#include <asm/addrspace.h>
17 15
18/* Box specific addresses. */ 16/* Box specific addresses. */
@@ -51,9 +49,9 @@
51#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30) 49#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
52 50
53#define PA_LED 0xB6800000 /* 8bit LED */ 51#define PA_LED 0xB6800000 /* 8bit LED */
54#define PA_FPGA 0xB7000000 /* FPGA base address */ 52#define PA_FPGA 0xB7000000 /* FPGA base address */
55 53
56#define MRSHPC_IRQ0 evt2irq(0x340) 54#define MRSHPC_IRQ0 10
57 55
58#define FPGA_ILSR1 (PA_FPGA + 0x02) 56#define FPGA_ILSR1 (PA_FPGA + 0x02)
59#define FPGA_ILSR2 (PA_FPGA + 0x03) 57#define FPGA_ILSR2 (PA_FPGA + 0x03)
diff --git a/arch/sh/include/mach-se/mach/se7722.h b/arch/sh/include/mach-se/mach/se7722.h
index 637e7ac753f..16505bfb8a9 100644
--- a/arch/sh/include/mach-se/mach/se7722.h
+++ b/arch/sh/include/mach-se/mach/se7722.h
@@ -13,7 +13,6 @@
13 * for more details. 13 * for more details.
14 * 14 *
15 */ 15 */
16#include <linux/sh_intc.h>
17#include <asm/addrspace.h> 16#include <asm/addrspace.h>
18 17
19/* Box specific addresses. */ 18/* Box specific addresses. */
@@ -32,7 +31,7 @@
32 31
33#define PA_PERIPHERAL 0xB0000000 32#define PA_PERIPHERAL 0xB0000000
34 33
35#define PA_PCIC PA_PERIPHERAL /* MR-SHPC-01 PCMCIA */ 34#define PA_PCIC PA_PERIPHERAL /* MR-SHPC-01 PCMCIA */
36#define PA_MRSHPC (PA_PERIPHERAL + 0x003fffe0) /* MR-SHPC-01 PCMCIA controller */ 35#define PA_MRSHPC (PA_PERIPHERAL + 0x003fffe0) /* MR-SHPC-01 PCMCIA controller */
37#define PA_MRSHPC_MW1 (PA_PERIPHERAL + 0x00400000) /* MR-SHPC-01 memory window base */ 36#define PA_MRSHPC_MW1 (PA_PERIPHERAL + 0x00400000) /* MR-SHPC-01 memory window base */
38#define PA_MRSHPC_MW2 (PA_PERIPHERAL + 0x00500000) /* MR-SHPC-01 attribute window base */ 37#define PA_MRSHPC_MW2 (PA_PERIPHERAL + 0x00500000) /* MR-SHPC-01 attribute window base */
@@ -52,7 +51,7 @@
52#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30) 51#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
53 52
54#define PA_LED (PA_PERIPHERAL + 0x00800000) /* 8bit LED */ 53#define PA_LED (PA_PERIPHERAL + 0x00800000) /* 8bit LED */
55#define PA_FPGA (PA_PERIPHERAL + 0x01800000) /* FPGA base address */ 54#define PA_FPGA (PA_PERIPHERAL + 0x01800000) /* FPGA base address */
56 55
57#define PA_LAN (PA_AREA6_IO + 0) /* SMC LAN91C111 */ 56#define PA_LAN (PA_AREA6_IO + 0) /* SMC LAN91C111 */
58/* GPIO */ 57/* GPIO */
@@ -78,8 +77,14 @@
78#define PORT_HIZCRC 0xA405015CUL 77#define PORT_HIZCRC 0xA405015CUL
79 78
80/* IRQ */ 79/* IRQ */
81#define IRQ0_IRQ evt2irq(0x600) 80#define IRQ0_IRQ 32
82#define IRQ1_IRQ evt2irq(0x620) 81#define IRQ1_IRQ 33
82
83#define IRQ01_MODE 0xb1800000
84#define IRQ01_STS 0xb1800004
85#define IRQ01_MASK 0xb1800008
86
87/* Bits in IRQ01_* registers */
83 88
84#define SE7722_FPGA_IRQ_USB 0 /* IRQ0 */ 89#define SE7722_FPGA_IRQ_USB 0 /* IRQ0 */
85#define SE7722_FPGA_IRQ_SMC 1 /* IRQ0 */ 90#define SE7722_FPGA_IRQ_SMC 1 /* IRQ0 */
@@ -89,10 +94,8 @@
89#define SE7722_FPGA_IRQ_MRSHPC3 5 /* IRQ1 */ 94#define SE7722_FPGA_IRQ_MRSHPC3 5 /* IRQ1 */
90#define SE7722_FPGA_IRQ_NR 6 95#define SE7722_FPGA_IRQ_NR 6
91 96
92struct irq_domain;
93
94/* arch/sh/boards/se/7722/irq.c */ 97/* arch/sh/boards/se/7722/irq.c */
95extern struct irq_domain *se7722_irq_domain; 98extern unsigned int se7722_fpga_irq[];
96 99
97void init_se7722_IRQ(void); 100void init_se7722_IRQ(void);
98 101
diff --git a/arch/sh/include/mach-se/mach/se7724.h b/arch/sh/include/mach-se/mach/se7724.h
index be842dd1ca0..29514a39d0f 100644
--- a/arch/sh/include/mach-se/mach/se7724.h
+++ b/arch/sh/include/mach-se/mach/se7724.h
@@ -18,7 +18,6 @@
18 * for more details. 18 * for more details.
19 * 19 *
20 */ 20 */
21#include <linux/sh_intc.h>
22#include <asm/addrspace.h> 21#include <asm/addrspace.h>
23 22
24/* SH Eth */ 23/* SH Eth */
@@ -36,9 +35,9 @@
36#define IRQ2_MR (0xba200028) 35#define IRQ2_MR (0xba200028)
37 36
38/* IRQ */ 37/* IRQ */
39#define IRQ0_IRQ evt2irq(0x600) 38#define IRQ0_IRQ 32
40#define IRQ1_IRQ evt2irq(0x620) 39#define IRQ1_IRQ 33
41#define IRQ2_IRQ evt2irq(0x640) 40#define IRQ2_IRQ 34
42 41
43/* Bits in IRQ012 registers */ 42/* Bits in IRQ012 registers */
44#define SE7724_FPGA_IRQ_BASE 220 43#define SE7724_FPGA_IRQ_BASE 220
diff --git a/arch/sh/include/mach-se/mach/se7751.h b/arch/sh/include/mach-se/mach/se7751.h
index 271871793d5..b36792ac5d6 100644
--- a/arch/sh/include/mach-se/mach/se7751.h
+++ b/arch/sh/include/mach-se/mach/se7751.h
@@ -11,7 +11,6 @@
11 * Modified for 7751 Solution Engine by 11 * Modified for 7751 Solution Engine by
12 * Ian da Silva and Jeremy Siegel, 2001. 12 * Ian da Silva and Jeremy Siegel, 2001.
13 */ 13 */
14#include <linux/sh_intc.h>
15 14
16/* Box specific addresses. */ 15/* Box specific addresses. */
17 16
@@ -64,7 +63,7 @@
64#define BCR_ILCRF (PA_BCR + 10) 63#define BCR_ILCRF (PA_BCR + 10)
65#define BCR_ILCRG (PA_BCR + 12) 64#define BCR_ILCRG (PA_BCR + 12)
66 65
67#define IRQ_79C973 evt2irq(0x3a0) 66#define IRQ_79C973 13
68 67
69void init_7751se_IRQ(void); 68void init_7751se_IRQ(void);
70 69
diff --git a/arch/sh/include/mach-se/mach/se7780.h b/arch/sh/include/mach-se/mach/se7780.h
index bde357cf81b..40e9b41458c 100644
--- a/arch/sh/include/mach-se/mach/se7780.h
+++ b/arch/sh/include/mach-se/mach/se7780.h
@@ -12,7 +12,6 @@
12 * License. See the file "COPYING" in the main directory of this archive 12 * License. See the file "COPYING" in the main directory of this archive
13 * for more details. 13 * for more details.
14 */ 14 */
15#include <linux/sh_intc.h>
16#include <asm/addrspace.h> 15#include <asm/addrspace.h>
17 16
18/* Box specific addresses. */ 17/* Box specific addresses. */
@@ -81,13 +80,13 @@
81#define IRQPOS_PCCPW (0 * 4) 80#define IRQPOS_PCCPW (0 * 4)
82 81
83/* IDE interrupt */ 82/* IDE interrupt */
84#define IRQ_IDE0 evt2irq(0xa60) /* iVDR */ 83#define IRQ_IDE0 67 /* iVDR */
85 84
86/* SMC interrupt */ 85/* SMC interrupt */
87#define SMC_IRQ evt2irq(0x300) 86#define SMC_IRQ 8
88 87
89/* SM501 interrupt */ 88/* SM501 interrupt */
90#define SM501_IRQ evt2irq(0x200) 89#define SM501_IRQ 0
91 90
92/* interrupt pin */ 91/* interrupt pin */
93#define IRQPIN_EXTINT1 0 /* IRQ0 pin */ 92#define IRQPIN_EXTINT1 0 /* IRQ0 pin */
diff --git a/arch/sh/include/uapi/asm/Kbuild b/arch/sh/include/uapi/asm/Kbuild
deleted file mode 100644
index 60613ae7851..00000000000
--- a/arch/sh/include/uapi/asm/Kbuild
+++ /dev/null
@@ -1,25 +0,0 @@
1# UAPI Header export list
2include include/uapi/asm-generic/Kbuild.asm
3
4header-y += auxvec.h
5header-y += byteorder.h
6header-y += cachectl.h
7header-y += cpu-features.h
8header-y += hw_breakpoint.h
9header-y += ioctls.h
10header-y += posix_types.h
11header-y += posix_types_32.h
12header-y += posix_types_64.h
13header-y += ptrace.h
14header-y += ptrace_32.h
15header-y += ptrace_64.h
16header-y += setup.h
17header-y += sigcontext.h
18header-y += signal.h
19header-y += sockios.h
20header-y += stat.h
21header-y += swab.h
22header-y += types.h
23header-y += unistd.h
24header-y += unistd_32.h
25header-y += unistd_64.h
diff --git a/arch/sh/include/uapi/asm/auxvec.h b/arch/sh/include/uapi/asm/auxvec.h
deleted file mode 100644
index 8bcc51af936..00000000000
--- a/arch/sh/include/uapi/asm/auxvec.h
+++ /dev/null
@@ -1,38 +0,0 @@
1#ifndef __ASM_SH_AUXVEC_H
2#define __ASM_SH_AUXVEC_H
3
4/*
5 * Architecture-neutral AT_ values in 0-17, leave some room
6 * for more of them.
7 */
8
9/*
10 * This entry gives some information about the FPU initialization
11 * performed by the kernel.
12 */
13#define AT_FPUCW 18 /* Used FPU control word. */
14
15#if defined(CONFIG_VSYSCALL) || !defined(__KERNEL__)
16/*
17 * Only define this in the vsyscall case, the entry point to
18 * the vsyscall page gets placed here. The kernel will attempt
19 * to build a gate VMA we don't care about otherwise..
20 */
21#define AT_SYSINFO_EHDR 33
22#endif
23
24/*
25 * More complete cache descriptions than AT_[DIU]CACHEBSIZE. If the
26 * value is -1, then the cache doesn't exist. Otherwise:
27 *
28 * bit 0-3: Cache set-associativity; 0 means fully associative.
29 * bit 4-7: Log2 of cacheline size.
30 * bit 8-31: Size of the entire cache >> 8.
31 */
32#define AT_L1I_CACHESHAPE 34
33#define AT_L1D_CACHESHAPE 35
34#define AT_L2_CACHESHAPE 36
35
36#define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */
37
38#endif /* __ASM_SH_AUXVEC_H */
diff --git a/arch/sh/include/uapi/asm/byteorder.h b/arch/sh/include/uapi/asm/byteorder.h
deleted file mode 100644
index db2f5d7cb17..00000000000
--- a/arch/sh/include/uapi/asm/byteorder.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef __ASM_SH_BYTEORDER_H
2#define __ASM_SH_BYTEORDER_H
3
4#ifdef __LITTLE_ENDIAN__
5#include <linux/byteorder/little_endian.h>
6#else
7#include <linux/byteorder/big_endian.h>
8#endif
9
10#endif /* __ASM_SH_BYTEORDER_H */
diff --git a/arch/sh/include/uapi/asm/cachectl.h b/arch/sh/include/uapi/asm/cachectl.h
deleted file mode 100644
index 6ffb4b7a212..00000000000
--- a/arch/sh/include/uapi/asm/cachectl.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef _SH_CACHECTL_H
2#define _SH_CACHECTL_H
3
4/* Definitions for the cacheflush system call. */
5
6#define CACHEFLUSH_D_INVAL 0x1 /* invalidate (without write back) */
7#define CACHEFLUSH_D_WB 0x2 /* write back (without invalidate) */
8#define CACHEFLUSH_D_PURGE 0x3 /* writeback and invalidate */
9
10#define CACHEFLUSH_I 0x4
11
12/*
13 * Options for cacheflush system call
14 */
15#define ICACHE CACHEFLUSH_I /* flush instruction cache */
16#define DCACHE CACHEFLUSH_D_PURGE /* writeback and flush data cache */
17#define BCACHE (ICACHE|DCACHE) /* flush both caches */
18
19#endif /* _SH_CACHECTL_H */
diff --git a/arch/sh/include/uapi/asm/cpu-features.h b/arch/sh/include/uapi/asm/cpu-features.h
deleted file mode 100644
index 694abe490ed..00000000000
--- a/arch/sh/include/uapi/asm/cpu-features.h
+++ /dev/null
@@ -1,26 +0,0 @@
1#ifndef __ASM_SH_CPU_FEATURES_H
2#define __ASM_SH_CPU_FEATURES_H
3
4/*
5 * Processor flags
6 *
7 * Note: When adding a new flag, keep cpu_flags[] in
8 * arch/sh/kernel/setup.c in sync so symbolic name
9 * mapping of the processor flags has a chance of being
10 * reasonably accurate.
11 *
12 * These flags are also available through the ELF
13 * auxiliary vector as AT_HWCAP.
14 */
15#define CPU_HAS_FPU 0x0001 /* Hardware FPU support */
16#define CPU_HAS_P2_FLUSH_BUG 0x0002 /* Need to flush the cache in P2 area */
17#define CPU_HAS_MMU_PAGE_ASSOC 0x0004 /* SH3: TLB way selection bit support */
18#define CPU_HAS_DSP 0x0008 /* SH-DSP: DSP support */
19#define CPU_HAS_PERF_COUNTER 0x0010 /* Hardware performance counters */
20#define CPU_HAS_PTEA 0x0020 /* PTEA register */
21#define CPU_HAS_LLSC 0x0040 /* movli.l/movco.l */
22#define CPU_HAS_L2_CACHE 0x0080 /* Secondary cache / URAM */
23#define CPU_HAS_OP32 0x0100 /* 32-bit instruction support */
24#define CPU_HAS_PTEAEX 0x0200 /* PTE ASID Extension support */
25
26#endif /* __ASM_SH_CPU_FEATURES_H */
diff --git a/arch/sh/include/uapi/asm/hw_breakpoint.h b/arch/sh/include/uapi/asm/hw_breakpoint.h
deleted file mode 100644
index ae5704fa77a..00000000000
--- a/arch/sh/include/uapi/asm/hw_breakpoint.h
+++ /dev/null
@@ -1,4 +0,0 @@
1/*
2 * There isn't anything here anymore, but the file must not be empty or patch
3 * will delete it.
4 */
diff --git a/arch/sh/include/uapi/asm/ioctls.h b/arch/sh/include/uapi/asm/ioctls.h
deleted file mode 100644
index 34224107976..00000000000
--- a/arch/sh/include/uapi/asm/ioctls.h
+++ /dev/null
@@ -1,110 +0,0 @@
1#ifndef __ASM_SH_IOCTLS_H
2#define __ASM_SH_IOCTLS_H
3
4#include <asm/ioctl.h>
5
6#define FIOCLEX _IO('f', 1)
7#define FIONCLEX _IO('f', 2)
8#define FIOASYNC _IOW('f', 125, int)
9#define FIONBIO _IOW('f', 126, int)
10#define FIONREAD _IOR('f', 127, int)
11#define TIOCINQ FIONREAD
12#define FIOQSIZE _IOR('f', 128, loff_t)
13
14#define TCGETS 0x5401
15#define TCSETS 0x5402
16#define TCSETSW 0x5403
17#define TCSETSF 0x5404
18
19#define TCGETA 0x80127417 /* _IOR('t', 23, struct termio) */
20#define TCSETA 0x40127418 /* _IOW('t', 24, struct termio) */
21#define TCSETAW 0x40127419 /* _IOW('t', 25, struct termio) */
22#define TCSETAF 0x4012741C /* _IOW('t', 28, struct termio) */
23
24#define TCSBRK _IO('t', 29)
25#define TCXONC _IO('t', 30)
26#define TCFLSH _IO('t', 31)
27
28#define TIOCSWINSZ 0x40087467 /* _IOW('t', 103, struct winsize) */
29#define TIOCGWINSZ 0x80087468 /* _IOR('t', 104, struct winsize) */
30#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
31#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
32#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
33
34#define TIOCSPGRP _IOW('t', 118, int)
35#define TIOCGPGRP _IOR('t', 119, int)
36
37#define TIOCEXCL _IO('T', 12) /* 0x540C */
38#define TIOCNXCL _IO('T', 13) /* 0x540D */
39#define TIOCSCTTY _IO('T', 14) /* 0x540E */
40
41#define TIOCSTI _IOW('T', 18, char) /* 0x5412 */
42#define TIOCMGET _IOR('T', 21, unsigned int) /* 0x5415 */
43#define TIOCMBIS _IOW('T', 22, unsigned int) /* 0x5416 */
44#define TIOCMBIC _IOW('T', 23, unsigned int) /* 0x5417 */
45#define TIOCMSET _IOW('T', 24, unsigned int) /* 0x5418 */
46# define TIOCM_LE 0x001
47# define TIOCM_DTR 0x002
48# define TIOCM_RTS 0x004
49# define TIOCM_ST 0x008
50# define TIOCM_SR 0x010
51# define TIOCM_CTS 0x020
52# define TIOCM_CAR 0x040
53# define TIOCM_RNG 0x080
54# define TIOCM_DSR 0x100
55# define TIOCM_CD TIOCM_CAR
56# define TIOCM_RI TIOCM_RNG
57
58#define TIOCGSOFTCAR _IOR('T', 25, unsigned int) /* 0x5419 */
59#define TIOCSSOFTCAR _IOW('T', 26, unsigned int) /* 0x541A */
60#define TIOCLINUX _IOW('T', 28, char) /* 0x541C */
61#define TIOCCONS _IO('T', 29) /* 0x541D */
62#define TIOCGSERIAL 0x803C541E /* _IOR('T', 30, struct serial_struct) 0x541E */
63#define TIOCSSERIAL 0x403C541F /* _IOW('T', 31, struct serial_struct) 0x541F */
64#define TIOCPKT _IOW('T', 32, int) /* 0x5420 */
65# define TIOCPKT_DATA 0
66# define TIOCPKT_FLUSHREAD 1
67# define TIOCPKT_FLUSHWRITE 2
68# define TIOCPKT_STOP 4
69# define TIOCPKT_START 8
70# define TIOCPKT_NOSTOP 16
71# define TIOCPKT_DOSTOP 32
72# define TIOCPKT_IOCTL 64
73
74
75#define TIOCNOTTY _IO('T', 34) /* 0x5422 */
76#define TIOCSETD _IOW('T', 35, int) /* 0x5423 */
77#define TIOCGETD _IOR('T', 36, int) /* 0x5424 */
78#define TCSBRKP _IOW('T', 37, int) /* 0x5425 */ /* Needed for POSIX tcsendbreak() */
79#define TIOCSBRK _IO('T', 39) /* 0x5427 */ /* BSD compatibility */
80#define TIOCCBRK _IO('T', 40) /* 0x5428 */ /* BSD compatibility */
81#define TIOCGSID _IOR('T', 41, pid_t) /* 0x5429 */ /* Return the session ID of FD */
82#define TCGETS2 _IOR('T', 42, struct termios2)
83#define TCSETS2 _IOW('T', 43, struct termios2)
84#define TCSETSW2 _IOW('T', 44, struct termios2)
85#define TCSETSF2 _IOW('T', 45, struct termios2)
86#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
87#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
88#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
89#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
90#define TIOCVHANGUP _IO('T', 0x37)
91#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
92#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
93#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
94
95#define TIOCSERCONFIG _IO('T', 83) /* 0x5453 */
96#define TIOCSERGWILD _IOR('T', 84, int) /* 0x5454 */
97#define TIOCSERSWILD _IOW('T', 85, int) /* 0x5455 */
98#define TIOCGLCKTRMIOS 0x5456
99#define TIOCSLCKTRMIOS 0x5457
100#define TIOCSERGSTRUCT 0x80d85458 /* _IOR('T', 88, struct async_struct) 0x5458 */ /* For debugging only */
101#define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* 0x5459 */ /* Get line status register */
102 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
103# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
104#define TIOCSERGETMULTI 0x80A8545A /* _IOR('T', 90, struct serial_multiport_struct) 0x545A */ /* Get multiport config */
105#define TIOCSERSETMULTI 0x40A8545B /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */
106
107#define TIOCMIWAIT _IO('T', 92) /* 0x545C */ /* wait for a change on serial input line(s) */
108#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
109
110#endif /* __ASM_SH_IOCTLS_H */
diff --git a/arch/sh/include/uapi/asm/posix_types.h b/arch/sh/include/uapi/asm/posix_types.h
deleted file mode 100644
index dc55e5adfe1..00000000000
--- a/arch/sh/include/uapi/asm/posix_types.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __KERNEL__
2# ifdef __SH5__
3# include <asm/posix_types_64.h>
4# else
5# include <asm/posix_types_32.h>
6# endif
7#endif /* __KERNEL__ */
diff --git a/arch/sh/include/uapi/asm/posix_types_32.h b/arch/sh/include/uapi/asm/posix_types_32.h
deleted file mode 100644
index ba0bdc423b0..00000000000
--- a/arch/sh/include/uapi/asm/posix_types_32.h
+++ /dev/null
@@ -1,22 +0,0 @@
1#ifndef __ASM_SH_POSIX_TYPES_32_H
2#define __ASM_SH_POSIX_TYPES_32_H
3
4typedef unsigned short __kernel_mode_t;
5#define __kernel_mode_t __kernel_mode_t
6typedef unsigned short __kernel_ipc_pid_t;
7#define __kernel_ipc_pid_t __kernel_ipc_pid_t
8typedef unsigned short __kernel_uid_t;
9#define __kernel_uid_t __kernel_uid_t
10typedef unsigned short __kernel_gid_t;
11#define __kernel_gid_t __kernel_gid_t
12
13typedef unsigned short __kernel_old_uid_t;
14#define __kernel_old_uid_t __kernel_old_uid_t
15typedef unsigned short __kernel_old_gid_t;
16#define __kernel_old_gid_t __kernel_old_gid_t
17typedef unsigned short __kernel_old_dev_t;
18#define __kernel_old_dev_t __kernel_old_dev_t
19
20#include <asm-generic/posix_types.h>
21
22#endif /* __ASM_SH_POSIX_TYPES_32_H */
diff --git a/arch/sh/include/uapi/asm/posix_types_64.h b/arch/sh/include/uapi/asm/posix_types_64.h
deleted file mode 100644
index 244f7e950e1..00000000000
--- a/arch/sh/include/uapi/asm/posix_types_64.h
+++ /dev/null
@@ -1,28 +0,0 @@
1#ifndef __ASM_SH_POSIX_TYPES_64_H
2#define __ASM_SH_POSIX_TYPES_64_H
3
4typedef unsigned short __kernel_mode_t;
5#define __kernel_mode_t __kernel_mode_t
6typedef unsigned short __kernel_ipc_pid_t;
7#define __kernel_ipc_pid_t __kernel_ipc_pid_t
8typedef unsigned short __kernel_uid_t;
9#define __kernel_uid_t __kernel_uid_t
10typedef unsigned short __kernel_gid_t;
11#define __kernel_gid_t __kernel_gid_t
12typedef long unsigned int __kernel_size_t;
13#define __kernel_size_t __kernel_size_t
14typedef int __kernel_ssize_t;
15#define __kernel_ssize_t __kernel_ssize_t
16typedef int __kernel_ptrdiff_t;
17#define __kernel_ptrdiff_t __kernel_ptrdiff_t
18
19typedef unsigned short __kernel_old_uid_t;
20#define __kernel_old_uid_t __kernel_old_uid_t
21typedef unsigned short __kernel_old_gid_t;
22#define __kernel_old_gid_t __kernel_old_gid_t
23typedef unsigned short __kernel_old_dev_t;
24#define __kernel_old_dev_t __kernel_old_dev_t
25
26#include <asm-generic/posix_types.h>
27
28#endif /* __ASM_SH_POSIX_TYPES_64_H */
diff --git a/arch/sh/include/uapi/asm/ptrace.h b/arch/sh/include/uapi/asm/ptrace.h
deleted file mode 100644
index 8b8c5aca9c2..00000000000
--- a/arch/sh/include/uapi/asm/ptrace.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * Copyright (C) 1999, 2000 Niibe Yutaka
3 */
4#ifndef _UAPI__ASM_SH_PTRACE_H
5#define _UAPI__ASM_SH_PTRACE_H
6
7
8#define PTRACE_GETREGS 12 /* General registers */
9#define PTRACE_SETREGS 13
10
11#define PTRACE_GETFPREGS 14 /* FPU registers */
12#define PTRACE_SETFPREGS 15
13
14#define PTRACE_GETFDPIC 31 /* get the ELF fdpic loadmap address */
15
16#define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */
17#define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */
18
19#define PTRACE_GETDSPREGS 55 /* DSP registers */
20#define PTRACE_SETDSPREGS 56
21
22#define PT_TEXT_END_ADDR 240
23#define PT_TEXT_ADDR 244 /* &(struct user)->start_code */
24#define PT_DATA_ADDR 248 /* &(struct user)->start_data */
25#define PT_TEXT_LEN 252
26
27#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
28#include <asm/ptrace_64.h>
29#else
30#include <asm/ptrace_32.h>
31#endif
32
33
34#endif /* _UAPI__ASM_SH_PTRACE_H */
diff --git a/arch/sh/include/uapi/asm/ptrace_32.h b/arch/sh/include/uapi/asm/ptrace_32.h
deleted file mode 100644
index 926e0cefc2b..00000000000
--- a/arch/sh/include/uapi/asm/ptrace_32.h
+++ /dev/null
@@ -1,77 +0,0 @@
1#ifndef _UAPI__ASM_SH_PTRACE_32_H
2#define _UAPI__ASM_SH_PTRACE_32_H
3
4/*
5 * GCC defines register number like this:
6 * -----------------------------
7 * 0 - 15 are integer registers
8 * 17 - 22 are control/special registers
9 * 24 - 39 fp registers
10 * 40 - 47 xd registers
11 * 48 - fpscr register
12 * -----------------------------
13 *
14 * We follows above, except:
15 * 16 --- program counter (PC)
16 * 22 --- syscall #
17 * 23 --- floating point communication register
18 */
19#define REG_REG0 0
20#define REG_REG15 15
21
22#define REG_PC 16
23
24#define REG_PR 17
25#define REG_SR 18
26#define REG_GBR 19
27#define REG_MACH 20
28#define REG_MACL 21
29
30#define REG_SYSCALL 22
31
32#define REG_FPREG0 23
33#define REG_FPREG15 38
34#define REG_XFREG0 39
35#define REG_XFREG15 54
36
37#define REG_FPSCR 55
38#define REG_FPUL 56
39
40/*
41 * This struct defines the way the registers are stored on the
42 * kernel stack during a system call or other kernel entry.
43 */
44struct pt_regs {
45 unsigned long regs[16];
46 unsigned long pc;
47 unsigned long pr;
48 unsigned long sr;
49 unsigned long gbr;
50 unsigned long mach;
51 unsigned long macl;
52 long tra;
53};
54
55/*
56 * This struct defines the way the DSP registers are stored on the
57 * kernel stack during a system call or other kernel entry.
58 */
59struct pt_dspregs {
60 unsigned long a1;
61 unsigned long a0g;
62 unsigned long a1g;
63 unsigned long m0;
64 unsigned long m1;
65 unsigned long a0;
66 unsigned long x0;
67 unsigned long x1;
68 unsigned long y0;
69 unsigned long y1;
70 unsigned long dsr;
71 unsigned long rs;
72 unsigned long re;
73 unsigned long mod;
74};
75
76
77#endif /* _UAPI__ASM_SH_PTRACE_32_H */
diff --git a/arch/sh/include/uapi/asm/ptrace_64.h b/arch/sh/include/uapi/asm/ptrace_64.h
deleted file mode 100644
index 0e52ee83e94..00000000000
--- a/arch/sh/include/uapi/asm/ptrace_64.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef _UAPI__ASM_SH_PTRACE_64_H
2#define _UAPI__ASM_SH_PTRACE_64_H
3
4struct pt_regs {
5 unsigned long long pc;
6 unsigned long long sr;
7 long long syscall_nr;
8 unsigned long long regs[63];
9 unsigned long long tregs[8];
10 unsigned long long pad[2];
11};
12
13
14#endif /* _UAPI__ASM_SH_PTRACE_64_H */
diff --git a/arch/sh/include/uapi/asm/setup.h b/arch/sh/include/uapi/asm/setup.h
deleted file mode 100644
index 552df83f1a4..00000000000
--- a/arch/sh/include/uapi/asm/setup.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/setup.h>
diff --git a/arch/sh/include/uapi/asm/sigcontext.h b/arch/sh/include/uapi/asm/sigcontext.h
deleted file mode 100644
index 8ce1435bc0b..00000000000
--- a/arch/sh/include/uapi/asm/sigcontext.h
+++ /dev/null
@@ -1,40 +0,0 @@
1#ifndef __ASM_SH_SIGCONTEXT_H
2#define __ASM_SH_SIGCONTEXT_H
3
4struct sigcontext {
5 unsigned long oldmask;
6
7#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
8 /* CPU registers */
9 unsigned long long sc_regs[63];
10 unsigned long long sc_tregs[8];
11 unsigned long long sc_pc;
12 unsigned long long sc_sr;
13
14 /* FPU registers */
15 unsigned long long sc_fpregs[32];
16 unsigned int sc_fpscr;
17 unsigned int sc_fpvalid;
18#else
19 /* CPU registers */
20 unsigned long sc_regs[16];
21 unsigned long sc_pc;
22 unsigned long sc_pr;
23 unsigned long sc_sr;
24 unsigned long sc_gbr;
25 unsigned long sc_mach;
26 unsigned long sc_macl;
27
28#if defined(__SH4__) || defined(CONFIG_CPU_SH4) || \
29 defined(__SH2A__) || defined(CONFIG_CPU_SH2A)
30 /* FPU registers */
31 unsigned long sc_fpregs[16];
32 unsigned long sc_xfpregs[16];
33 unsigned int sc_fpscr;
34 unsigned int sc_fpul;
35 unsigned int sc_ownedfp;
36#endif
37#endif
38};
39
40#endif /* __ASM_SH_SIGCONTEXT_H */
diff --git a/arch/sh/include/uapi/asm/signal.h b/arch/sh/include/uapi/asm/signal.h
deleted file mode 100644
index 9ac530a90bc..00000000000
--- a/arch/sh/include/uapi/asm/signal.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef __ASM_SH_SIGNAL_H
2#define __ASM_SH_SIGNAL_H
3
4#define SA_RESTORER 0x04000000
5
6#include <asm-generic/signal.h>
7
8struct old_sigaction {
9 __sighandler_t sa_handler;
10 old_sigset_t sa_mask;
11 unsigned long sa_flags;
12 void (*sa_restorer)(void);
13};
14
15#endif /* __ASM_SH_SIGNAL_H */
diff --git a/arch/sh/include/uapi/asm/sockios.h b/arch/sh/include/uapi/asm/sockios.h
deleted file mode 100644
index cf8b96b1f9a..00000000000
--- a/arch/sh/include/uapi/asm/sockios.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef __ASM_SH_SOCKIOS_H
2#define __ASM_SH_SOCKIOS_H
3
4/* Socket-level I/O control calls. */
5#define FIOGETOWN _IOR('f', 123, int)
6#define FIOSETOWN _IOW('f', 124, int)
7
8#define SIOCATMARK _IOR('s', 7, int)
9#define SIOCSPGRP _IOW('s', 8, pid_t)
10#define SIOCGPGRP _IOR('s', 9, pid_t)
11
12#define SIOCGSTAMP _IOR('s', 100, struct timeval) /* Get stamp (timeval) */
13#define SIOCGSTAMPNS _IOR('s', 101, struct timespec) /* Get stamp (timespec) */
14#endif /* __ASM_SH_SOCKIOS_H */
diff --git a/arch/sh/include/uapi/asm/stat.h b/arch/sh/include/uapi/asm/stat.h
deleted file mode 100644
index e1810cc6e3d..00000000000
--- a/arch/sh/include/uapi/asm/stat.h
+++ /dev/null
@@ -1,138 +0,0 @@
1#ifndef __ASM_SH_STAT_H
2#define __ASM_SH_STAT_H
3
4struct __old_kernel_stat {
5 unsigned short st_dev;
6 unsigned short st_ino;
7 unsigned short st_mode;
8 unsigned short st_nlink;
9 unsigned short st_uid;
10 unsigned short st_gid;
11 unsigned short st_rdev;
12 unsigned long st_size;
13 unsigned long st_atime;
14 unsigned long st_mtime;
15 unsigned long st_ctime;
16};
17
18#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
19struct stat {
20 unsigned short st_dev;
21 unsigned short __pad1;
22 unsigned long st_ino;
23 unsigned short st_mode;
24 unsigned short st_nlink;
25 unsigned short st_uid;
26 unsigned short st_gid;
27 unsigned short st_rdev;
28 unsigned short __pad2;
29 unsigned long st_size;
30 unsigned long st_blksize;
31 unsigned long st_blocks;
32 unsigned long st_atime;
33 unsigned long st_atime_nsec;
34 unsigned long st_mtime;
35 unsigned long st_mtime_nsec;
36 unsigned long st_ctime;
37 unsigned long st_ctime_nsec;
38 unsigned long __unused4;
39 unsigned long __unused5;
40};
41
42/* This matches struct stat64 in glibc2.1, hence the absolutely
43 * insane amounts of padding around dev_t's.
44 */
45struct stat64 {
46 unsigned short st_dev;
47 unsigned char __pad0[10];
48
49 unsigned long st_ino;
50 unsigned int st_mode;
51 unsigned int st_nlink;
52
53 unsigned long st_uid;
54 unsigned long st_gid;
55
56 unsigned short st_rdev;
57 unsigned char __pad3[10];
58
59 long long st_size;
60 unsigned long st_blksize;
61
62 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
63 unsigned long __pad4; /* future possible st_blocks high bits */
64
65 unsigned long st_atime;
66 unsigned long st_atime_nsec;
67
68 unsigned long st_mtime;
69 unsigned long st_mtime_nsec;
70
71 unsigned long st_ctime;
72 unsigned long st_ctime_nsec; /* will be high 32 bits of ctime someday */
73
74 unsigned long __unused1;
75 unsigned long __unused2;
76};
77#else
78struct stat {
79 unsigned long st_dev;
80 unsigned long st_ino;
81 unsigned short st_mode;
82 unsigned short st_nlink;
83 unsigned short st_uid;
84 unsigned short st_gid;
85 unsigned long st_rdev;
86 unsigned long st_size;
87 unsigned long st_blksize;
88 unsigned long st_blocks;
89 unsigned long st_atime;
90 unsigned long st_atime_nsec;
91 unsigned long st_mtime;
92 unsigned long st_mtime_nsec;
93 unsigned long st_ctime;
94 unsigned long st_ctime_nsec;
95 unsigned long __unused4;
96 unsigned long __unused5;
97};
98
99/* This matches struct stat64 in glibc2.1, hence the absolutely
100 * insane amounts of padding around dev_t's.
101 */
102struct stat64 {
103 unsigned long long st_dev;
104 unsigned char __pad0[4];
105
106#define STAT64_HAS_BROKEN_ST_INO 1
107 unsigned long __st_ino;
108
109 unsigned int st_mode;
110 unsigned int st_nlink;
111
112 unsigned long st_uid;
113 unsigned long st_gid;
114
115 unsigned long long st_rdev;
116 unsigned char __pad3[4];
117
118 long long st_size;
119 unsigned long st_blksize;
120
121 unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
122
123 unsigned long st_atime;
124 unsigned long st_atime_nsec;
125
126 unsigned long st_mtime;
127 unsigned long st_mtime_nsec;
128
129 unsigned long st_ctime;
130 unsigned long st_ctime_nsec;
131
132 unsigned long long st_ino;
133};
134
135#define STAT_HAVE_NSEC 1
136#endif
137
138#endif /* __ASM_SH_STAT_H */
diff --git a/arch/sh/include/uapi/asm/swab.h b/arch/sh/include/uapi/asm/swab.h
deleted file mode 100644
index 1cd09767a7a..00000000000
--- a/arch/sh/include/uapi/asm/swab.h
+++ /dev/null
@@ -1,59 +0,0 @@
1#ifndef __ASM_SH_SWAB_H
2#define __ASM_SH_SWAB_H
3
4/*
5 * Copyright (C) 1999 Niibe Yutaka
6 * Copyright (C) 2000, 2001 Paolo Alberelli
7 */
8#include <linux/compiler.h>
9#include <linux/types.h>
10#include <asm-generic/swab.h>
11
12static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
13{
14 __asm__(
15#ifdef __SH5__
16 "byterev %1, %0\n\t"
17 "shari %0, 32, %0"
18#else
19 "swap.b %1, %0\n\t"
20 "swap.w %0, %0\n\t"
21 "swap.b %0, %0"
22#endif
23 : "=r" (x)
24 : "r" (x));
25
26 return x;
27}
28#define __arch_swab32 __arch_swab32
29
30static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
31{
32 __asm__(
33#ifdef __SH5__
34 "byterev %1, %0\n\t"
35 "shari %0, 32, %0"
36#else
37 "swap.b %1, %0"
38#endif
39 : "=r" (x)
40 : "r" (x));
41
42 return x;
43}
44#define __arch_swab16 __arch_swab16
45
46static inline __u64 __arch_swab64(__u64 val)
47{
48 union {
49 struct { __u32 a,b; } s;
50 __u64 u;
51 } v, w;
52 v.u = val;
53 w.s.b = __arch_swab32(v.s.a);
54 w.s.a = __arch_swab32(v.s.b);
55 return w.u;
56}
57#define __arch_swab64 __arch_swab64
58
59#endif /* __ASM_SH_SWAB_H */
diff --git a/arch/sh/include/uapi/asm/types.h b/arch/sh/include/uapi/asm/types.h
deleted file mode 100644
index b9e79bc580d..00000000000
--- a/arch/sh/include/uapi/asm/types.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/types.h>
diff --git a/arch/sh/include/uapi/asm/unistd.h b/arch/sh/include/uapi/asm/unistd.h
deleted file mode 100644
index eeef88dd53c..00000000000
--- a/arch/sh/include/uapi/asm/unistd.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __KERNEL__
2# ifdef __SH5__
3# include <asm/unistd_64.h>
4# else
5# include <asm/unistd_32.h>
6# endif
7#endif
diff --git a/arch/sh/include/uapi/asm/unistd_32.h b/arch/sh/include/uapi/asm/unistd_32.h
deleted file mode 100644
index 9e465f246dc..00000000000
--- a/arch/sh/include/uapi/asm/unistd_32.h
+++ /dev/null
@@ -1,385 +0,0 @@
1#ifndef __ASM_SH_UNISTD_32_H
2#define __ASM_SH_UNISTD_32_H
3
4/*
5 * Copyright (C) 1999 Niibe Yutaka
6 */
7
8/*
9 * This file contains the system call numbers.
10 */
11
12#define __NR_restart_syscall 0
13#define __NR_exit 1
14#define __NR_fork 2
15#define __NR_read 3
16#define __NR_write 4
17#define __NR_open 5
18#define __NR_close 6
19#define __NR_waitpid 7
20#define __NR_creat 8
21#define __NR_link 9
22#define __NR_unlink 10
23#define __NR_execve 11
24#define __NR_chdir 12
25#define __NR_time 13
26#define __NR_mknod 14
27#define __NR_chmod 15
28#define __NR_lchown 16
29 /* 17 was sys_break */
30#define __NR_oldstat 18
31#define __NR_lseek 19
32#define __NR_getpid 20
33#define __NR_mount 21
34#define __NR_umount 22
35#define __NR_setuid 23
36#define __NR_getuid 24
37#define __NR_stime 25
38#define __NR_ptrace 26
39#define __NR_alarm 27
40#define __NR_oldfstat 28
41#define __NR_pause 29
42#define __NR_utime 30
43 /* 31 was sys_stty */
44 /* 32 was sys_gtty */
45#define __NR_access 33
46#define __NR_nice 34
47 /* 35 was sys_ftime */
48#define __NR_sync 36
49#define __NR_kill 37
50#define __NR_rename 38
51#define __NR_mkdir 39
52#define __NR_rmdir 40
53#define __NR_dup 41
54#define __NR_pipe 42
55#define __NR_times 43
56 /* 44 was sys_prof */
57#define __NR_brk 45
58#define __NR_setgid 46
59#define __NR_getgid 47
60#define __NR_signal 48
61#define __NR_geteuid 49
62#define __NR_getegid 50
63#define __NR_acct 51
64#define __NR_umount2 52
65 /* 53 was sys_lock */
66#define __NR_ioctl 54
67#define __NR_fcntl 55
68 /* 56 was sys_mpx */
69#define __NR_setpgid 57
70 /* 58 was sys_ulimit */
71 /* 59 was sys_olduname */
72#define __NR_umask 60
73#define __NR_chroot 61
74#define __NR_ustat 62
75#define __NR_dup2 63
76#define __NR_getppid 64
77#define __NR_getpgrp 65
78#define __NR_setsid 66
79#define __NR_sigaction 67
80#define __NR_sgetmask 68
81#define __NR_ssetmask 69
82#define __NR_setreuid 70
83#define __NR_setregid 71
84#define __NR_sigsuspend 72
85#define __NR_sigpending 73
86#define __NR_sethostname 74
87#define __NR_setrlimit 75
88#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
89#define __NR_getrusage 77
90#define __NR_gettimeofday 78
91#define __NR_settimeofday 79
92#define __NR_getgroups 80
93#define __NR_setgroups 81
94 /* 82 was sys_oldselect */
95#define __NR_symlink 83
96#define __NR_oldlstat 84
97#define __NR_readlink 85
98#define __NR_uselib 86
99#define __NR_swapon 87
100#define __NR_reboot 88
101#define __NR_readdir 89
102#define __NR_mmap 90
103#define __NR_munmap 91
104#define __NR_truncate 92
105#define __NR_ftruncate 93
106#define __NR_fchmod 94
107#define __NR_fchown 95
108#define __NR_getpriority 96
109#define __NR_setpriority 97
110 /* 98 was sys_profil */
111#define __NR_statfs 99
112#define __NR_fstatfs 100
113 /* 101 was sys_ioperm */
114#define __NR_socketcall 102
115#define __NR_syslog 103
116#define __NR_setitimer 104
117#define __NR_getitimer 105
118#define __NR_stat 106
119#define __NR_lstat 107
120#define __NR_fstat 108
121#define __NR_olduname 109
122 /* 110 was sys_iopl */
123#define __NR_vhangup 111
124 /* 112 was sys_idle */
125 /* 113 was sys_vm86old */
126#define __NR_wait4 114
127#define __NR_swapoff 115
128#define __NR_sysinfo 116
129#define __NR_ipc 117
130#define __NR_fsync 118
131#define __NR_sigreturn 119
132#define __NR_clone 120
133#define __NR_setdomainname 121
134#define __NR_uname 122
135#define __NR_cacheflush 123
136#define __NR_adjtimex 124
137#define __NR_mprotect 125
138#define __NR_sigprocmask 126
139 /* 127 was sys_create_module */
140#define __NR_init_module 128
141#define __NR_delete_module 129
142 /* 130 was sys_get_kernel_syms */
143#define __NR_quotactl 131
144#define __NR_getpgid 132
145#define __NR_fchdir 133
146#define __NR_bdflush 134
147#define __NR_sysfs 135
148#define __NR_personality 136
149 /* 137 was sys_afs_syscall */
150#define __NR_setfsuid 138
151#define __NR_setfsgid 139
152#define __NR__llseek 140
153#define __NR_getdents 141
154#define __NR__newselect 142
155#define __NR_flock 143
156#define __NR_msync 144
157#define __NR_readv 145
158#define __NR_writev 146
159#define __NR_getsid 147
160#define __NR_fdatasync 148
161#define __NR__sysctl 149
162#define __NR_mlock 150
163#define __NR_munlock 151
164#define __NR_mlockall 152
165#define __NR_munlockall 153
166#define __NR_sched_setparam 154
167#define __NR_sched_getparam 155
168#define __NR_sched_setscheduler 156
169#define __NR_sched_getscheduler 157
170#define __NR_sched_yield 158
171#define __NR_sched_get_priority_max 159
172#define __NR_sched_get_priority_min 160
173#define __NR_sched_rr_get_interval 161
174#define __NR_nanosleep 162
175#define __NR_mremap 163
176#define __NR_setresuid 164
177#define __NR_getresuid 165
178 /* 166 was sys_vm86 */
179 /* 167 was sys_query_module */
180#define __NR_poll 168
181#define __NR_nfsservctl 169
182#define __NR_setresgid 170
183#define __NR_getresgid 171
184#define __NR_prctl 172
185#define __NR_rt_sigreturn 173
186#define __NR_rt_sigaction 174
187#define __NR_rt_sigprocmask 175
188#define __NR_rt_sigpending 176
189#define __NR_rt_sigtimedwait 177
190#define __NR_rt_sigqueueinfo 178
191#define __NR_rt_sigsuspend 179
192#define __NR_pread64 180
193#define __NR_pwrite64 181
194#define __NR_chown 182
195#define __NR_getcwd 183
196#define __NR_capget 184
197#define __NR_capset 185
198#define __NR_sigaltstack 186
199#define __NR_sendfile 187
200 /* 188 reserved for sys_getpmsg */
201 /* 189 reserved for sys_putpmsg */
202#define __NR_vfork 190
203#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */
204#define __NR_mmap2 192
205#define __NR_truncate64 193
206#define __NR_ftruncate64 194
207#define __NR_stat64 195
208#define __NR_lstat64 196
209#define __NR_fstat64 197
210#define __NR_lchown32 198
211#define __NR_getuid32 199
212#define __NR_getgid32 200
213#define __NR_geteuid32 201
214#define __NR_getegid32 202
215#define __NR_setreuid32 203
216#define __NR_setregid32 204
217#define __NR_getgroups32 205
218#define __NR_setgroups32 206
219#define __NR_fchown32 207
220#define __NR_setresuid32 208
221#define __NR_getresuid32 209
222#define __NR_setresgid32 210
223#define __NR_getresgid32 211
224#define __NR_chown32 212
225#define __NR_setuid32 213
226#define __NR_setgid32 214
227#define __NR_setfsuid32 215
228#define __NR_setfsgid32 216
229#define __NR_pivot_root 217
230#define __NR_mincore 218
231#define __NR_madvise 219
232#define __NR_getdents64 220
233#define __NR_fcntl64 221
234 /* 222 is reserved for tux */
235 /* 223 is unused */
236#define __NR_gettid 224
237#define __NR_readahead 225
238#define __NR_setxattr 226
239#define __NR_lsetxattr 227
240#define __NR_fsetxattr 228
241#define __NR_getxattr 229
242#define __NR_lgetxattr 230
243#define __NR_fgetxattr 231
244#define __NR_listxattr 232
245#define __NR_llistxattr 233
246#define __NR_flistxattr 234
247#define __NR_removexattr 235
248#define __NR_lremovexattr 236
249#define __NR_fremovexattr 237
250#define __NR_tkill 238
251#define __NR_sendfile64 239
252#define __NR_futex 240
253#define __NR_sched_setaffinity 241
254#define __NR_sched_getaffinity 242
255 /* 243 is reserved for set_thread_area */
256 /* 244 is reserved for get_thread_area */
257#define __NR_io_setup 245
258#define __NR_io_destroy 246
259#define __NR_io_getevents 247
260#define __NR_io_submit 248
261#define __NR_io_cancel 249
262#define __NR_fadvise64 250
263 /* 251 is unused */
264#define __NR_exit_group 252
265#define __NR_lookup_dcookie 253
266#define __NR_epoll_create 254
267#define __NR_epoll_ctl 255
268#define __NR_epoll_wait 256
269#define __NR_remap_file_pages 257
270#define __NR_set_tid_address 258
271#define __NR_timer_create 259
272#define __NR_timer_settime (__NR_timer_create+1)
273#define __NR_timer_gettime (__NR_timer_create+2)
274#define __NR_timer_getoverrun (__NR_timer_create+3)
275#define __NR_timer_delete (__NR_timer_create+4)
276#define __NR_clock_settime (__NR_timer_create+5)
277#define __NR_clock_gettime (__NR_timer_create+6)
278#define __NR_clock_getres (__NR_timer_create+7)
279#define __NR_clock_nanosleep (__NR_timer_create+8)
280#define __NR_statfs64 268
281#define __NR_fstatfs64 269
282#define __NR_tgkill 270
283#define __NR_utimes 271
284#define __NR_fadvise64_64 272
285 /* 273 is reserved for vserver */
286#define __NR_mbind 274
287#define __NR_get_mempolicy 275
288#define __NR_set_mempolicy 276
289#define __NR_mq_open 277
290#define __NR_mq_unlink (__NR_mq_open+1)
291#define __NR_mq_timedsend (__NR_mq_open+2)
292#define __NR_mq_timedreceive (__NR_mq_open+3)
293#define __NR_mq_notify (__NR_mq_open+4)
294#define __NR_mq_getsetattr (__NR_mq_open+5)
295#define __NR_kexec_load 283
296#define __NR_waitid 284
297#define __NR_add_key 285
298#define __NR_request_key 286
299#define __NR_keyctl 287
300#define __NR_ioprio_set 288
301#define __NR_ioprio_get 289
302#define __NR_inotify_init 290
303#define __NR_inotify_add_watch 291
304#define __NR_inotify_rm_watch 292
305 /* 293 is unused */
306#define __NR_migrate_pages 294
307#define __NR_openat 295
308#define __NR_mkdirat 296
309#define __NR_mknodat 297
310#define __NR_fchownat 298
311#define __NR_futimesat 299
312#define __NR_fstatat64 300
313#define __NR_unlinkat 301
314#define __NR_renameat 302
315#define __NR_linkat 303
316#define __NR_symlinkat 304
317#define __NR_readlinkat 305
318#define __NR_fchmodat 306
319#define __NR_faccessat 307
320#define __NR_pselect6 308
321#define __NR_ppoll 309
322#define __NR_unshare 310
323#define __NR_set_robust_list 311
324#define __NR_get_robust_list 312
325#define __NR_splice 313
326#define __NR_sync_file_range 314
327#define __NR_tee 315
328#define __NR_vmsplice 316
329#define __NR_move_pages 317
330#define __NR_getcpu 318
331#define __NR_epoll_pwait 319
332#define __NR_utimensat 320
333#define __NR_signalfd 321
334#define __NR_timerfd_create 322
335#define __NR_eventfd 323
336#define __NR_fallocate 324
337#define __NR_timerfd_settime 325
338#define __NR_timerfd_gettime 326
339#define __NR_signalfd4 327
340#define __NR_eventfd2 328
341#define __NR_epoll_create1 329
342#define __NR_dup3 330
343#define __NR_pipe2 331
344#define __NR_inotify_init1 332
345#define __NR_preadv 333
346#define __NR_pwritev 334
347#define __NR_rt_tgsigqueueinfo 335
348#define __NR_perf_event_open 336
349#define __NR_fanotify_init 337
350#define __NR_fanotify_mark 338
351#define __NR_prlimit64 339
352
353/* Non-multiplexed socket family */
354#define __NR_socket 340
355#define __NR_bind 341
356#define __NR_connect 342
357#define __NR_listen 343
358#define __NR_accept 344
359#define __NR_getsockname 345
360#define __NR_getpeername 346
361#define __NR_socketpair 347
362#define __NR_send 348
363#define __NR_sendto 349
364#define __NR_recv 350
365#define __NR_recvfrom 351
366#define __NR_shutdown 352
367#define __NR_setsockopt 353
368#define __NR_getsockopt 354
369#define __NR_sendmsg 355
370#define __NR_recvmsg 356
371#define __NR_recvmmsg 357
372#define __NR_accept4 358
373#define __NR_name_to_handle_at 359
374#define __NR_open_by_handle_at 360
375#define __NR_clock_adjtime 361
376#define __NR_syncfs 362
377#define __NR_sendmmsg 363
378#define __NR_setns 364
379#define __NR_process_vm_readv 365
380#define __NR_process_vm_writev 366
381#define __NR_kcmp 367
382
383#define NR_syscalls 368
384
385#endif /* __ASM_SH_UNISTD_32_H */
diff --git a/arch/sh/include/uapi/asm/unistd_64.h b/arch/sh/include/uapi/asm/unistd_64.h
deleted file mode 100644
index 8e3a2edd284..00000000000
--- a/arch/sh/include/uapi/asm/unistd_64.h
+++ /dev/null
@@ -1,405 +0,0 @@
1#ifndef __ASM_SH_UNISTD_64_H
2#define __ASM_SH_UNISTD_64_H
3
4/*
5 * include/asm-sh/unistd_64.h
6 *
7 * This file contains the system call numbers.
8 *
9 * Copyright (C) 2000, 2001 Paolo Alberelli
10 * Copyright (C) 2003 - 2007 Paul Mundt
11 * Copyright (C) 2004 Sean McGoogan
12 *
13 * This file is subject to the terms and conditions of the GNU General Public
14 * License. See the file "COPYING" in the main directory of this archive
15 * for more details.
16 */
17#define __NR_restart_syscall 0
18#define __NR_exit 1
19#define __NR_fork 2
20#define __NR_read 3
21#define __NR_write 4
22#define __NR_open 5
23#define __NR_close 6
24#define __NR_waitpid 7
25#define __NR_creat 8
26#define __NR_link 9
27#define __NR_unlink 10
28#define __NR_execve 11
29#define __NR_chdir 12
30#define __NR_time 13
31#define __NR_mknod 14
32#define __NR_chmod 15
33#define __NR_lchown 16
34 /* 17 was sys_break */
35#define __NR_oldstat 18
36#define __NR_lseek 19
37#define __NR_getpid 20
38#define __NR_mount 21
39#define __NR_umount 22
40#define __NR_setuid 23
41#define __NR_getuid 24
42#define __NR_stime 25
43#define __NR_ptrace 26
44#define __NR_alarm 27
45#define __NR_oldfstat 28
46#define __NR_pause 29
47#define __NR_utime 30
48 /* 31 was sys_stty */
49 /* 32 was sys_gtty */
50#define __NR_access 33
51#define __NR_nice 34
52 /* 35 was sys_ftime */
53#define __NR_sync 36
54#define __NR_kill 37
55#define __NR_rename 38
56#define __NR_mkdir 39
57#define __NR_rmdir 40
58#define __NR_dup 41
59#define __NR_pipe 42
60#define __NR_times 43
61 /* 44 was sys_prof */
62#define __NR_brk 45
63#define __NR_setgid 46
64#define __NR_getgid 47
65#define __NR_signal 48
66#define __NR_geteuid 49
67#define __NR_getegid 50
68#define __NR_acct 51
69#define __NR_umount2 52
70 /* 53 was sys_lock */
71#define __NR_ioctl 54
72#define __NR_fcntl 55
73 /* 56 was sys_mpx */
74#define __NR_setpgid 57
75 /* 58 was sys_ulimit */
76 /* 59 was sys_olduname */
77#define __NR_umask 60
78#define __NR_chroot 61
79#define __NR_ustat 62
80#define __NR_dup2 63
81#define __NR_getppid 64
82#define __NR_getpgrp 65
83#define __NR_setsid 66
84#define __NR_sigaction 67
85#define __NR_sgetmask 68
86#define __NR_ssetmask 69
87#define __NR_setreuid 70
88#define __NR_setregid 71
89#define __NR_sigsuspend 72
90#define __NR_sigpending 73
91#define __NR_sethostname 74
92#define __NR_setrlimit 75
93#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
94#define __NR_getrusage 77
95#define __NR_gettimeofday 78
96#define __NR_settimeofday 79
97#define __NR_getgroups 80
98#define __NR_setgroups 81
99 /* 82 was sys_select */
100#define __NR_symlink 83
101#define __NR_oldlstat 84
102#define __NR_readlink 85
103#define __NR_uselib 86
104#define __NR_swapon 87
105#define __NR_reboot 88
106#define __NR_readdir 89
107#define __NR_mmap 90
108#define __NR_munmap 91
109#define __NR_truncate 92
110#define __NR_ftruncate 93
111#define __NR_fchmod 94
112#define __NR_fchown 95
113#define __NR_getpriority 96
114#define __NR_setpriority 97
115 /* 98 was sys_profil */
116#define __NR_statfs 99
117#define __NR_fstatfs 100
118 /* 101 was sys_ioperm */
119#define __NR_socketcall 102 /* old implementation of socket systemcall */
120#define __NR_syslog 103
121#define __NR_setitimer 104
122#define __NR_getitimer 105
123#define __NR_stat 106
124#define __NR_lstat 107
125#define __NR_fstat 108
126#define __NR_olduname 109
127 /* 110 was sys_iopl */
128#define __NR_vhangup 111
129 /* 112 was sys_idle */
130 /* 113 was sys_vm86old */
131#define __NR_wait4 114
132#define __NR_swapoff 115
133#define __NR_sysinfo 116
134#define __NR_ipc 117
135#define __NR_fsync 118
136#define __NR_sigreturn 119
137#define __NR_clone 120
138#define __NR_setdomainname 121
139#define __NR_uname 122
140#define __NR_cacheflush 123
141#define __NR_adjtimex 124
142#define __NR_mprotect 125
143#define __NR_sigprocmask 126
144 /* 127 was sys_create_module */
145#define __NR_init_module 128
146#define __NR_delete_module 129
147 /* 130 was sys_get_kernel_syms */
148#define __NR_quotactl 131
149#define __NR_getpgid 132
150#define __NR_fchdir 133
151#define __NR_bdflush 134
152#define __NR_sysfs 135
153#define __NR_personality 136
154 /* 137 was sys_afs_syscall */
155#define __NR_setfsuid 138
156#define __NR_setfsgid 139
157#define __NR__llseek 140
158#define __NR_getdents 141
159#define __NR__newselect 142
160#define __NR_flock 143
161#define __NR_msync 144
162#define __NR_readv 145
163#define __NR_writev 146
164#define __NR_getsid 147
165#define __NR_fdatasync 148
166#define __NR__sysctl 149
167#define __NR_mlock 150
168#define __NR_munlock 151
169#define __NR_mlockall 152
170#define __NR_munlockall 153
171#define __NR_sched_setparam 154
172#define __NR_sched_getparam 155
173#define __NR_sched_setscheduler 156
174#define __NR_sched_getscheduler 157
175#define __NR_sched_yield 158
176#define __NR_sched_get_priority_max 159
177#define __NR_sched_get_priority_min 160
178#define __NR_sched_rr_get_interval 161
179#define __NR_nanosleep 162
180#define __NR_mremap 163
181#define __NR_setresuid 164
182#define __NR_getresuid 165
183 /* 166 was sys_vm86 */
184 /* 167 was sys_query_module */
185#define __NR_poll 168
186#define __NR_nfsservctl 169
187#define __NR_setresgid 170
188#define __NR_getresgid 171
189#define __NR_prctl 172
190#define __NR_rt_sigreturn 173
191#define __NR_rt_sigaction 174
192#define __NR_rt_sigprocmask 175
193#define __NR_rt_sigpending 176
194#define __NR_rt_sigtimedwait 177
195#define __NR_rt_sigqueueinfo 178
196#define __NR_rt_sigsuspend 179
197#define __NR_pread64 180
198#define __NR_pwrite64 181
199#define __NR_chown 182
200#define __NR_getcwd 183
201#define __NR_capget 184
202#define __NR_capset 185
203#define __NR_sigaltstack 186
204#define __NR_sendfile 187
205 /* 188 reserved for getpmsg */
206 /* 189 reserved for putpmsg */
207#define __NR_vfork 190
208#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */
209#define __NR_mmap2 192
210#define __NR_truncate64 193
211#define __NR_ftruncate64 194
212#define __NR_stat64 195
213#define __NR_lstat64 196
214#define __NR_fstat64 197
215#define __NR_lchown32 198
216#define __NR_getuid32 199
217#define __NR_getgid32 200
218#define __NR_geteuid32 201
219#define __NR_getegid32 202
220#define __NR_setreuid32 203
221#define __NR_setregid32 204
222#define __NR_getgroups32 205
223#define __NR_setgroups32 206
224#define __NR_fchown32 207
225#define __NR_setresuid32 208
226#define __NR_getresuid32 209
227#define __NR_setresgid32 210
228#define __NR_getresgid32 211
229#define __NR_chown32 212
230#define __NR_setuid32 213
231#define __NR_setgid32 214
232#define __NR_setfsuid32 215
233#define __NR_setfsgid32 216
234#define __NR_pivot_root 217
235#define __NR_mincore 218
236#define __NR_madvise 219
237
238/* Non-multiplexed socket family */
239#define __NR_socket 220
240#define __NR_bind 221
241#define __NR_connect 222
242#define __NR_listen 223
243#define __NR_accept 224
244#define __NR_getsockname 225
245#define __NR_getpeername 226
246#define __NR_socketpair 227
247#define __NR_send 228
248#define __NR_sendto 229
249#define __NR_recv 230
250#define __NR_recvfrom 231
251#define __NR_shutdown 232
252#define __NR_setsockopt 233
253#define __NR_getsockopt 234
254#define __NR_sendmsg 235
255#define __NR_recvmsg 236
256
257/* Non-multiplexed IPC family */
258#define __NR_semop 237
259#define __NR_semget 238
260#define __NR_semctl 239
261#define __NR_msgsnd 240
262#define __NR_msgrcv 241
263#define __NR_msgget 242
264#define __NR_msgctl 243
265#define __NR_shmat 244
266#define __NR_shmdt 245
267#define __NR_shmget 246
268#define __NR_shmctl 247
269
270#define __NR_getdents64 248
271#define __NR_fcntl64 249
272 /* 250 is reserved for tux */
273 /* 251 is unused */
274#define __NR_gettid 252
275#define __NR_readahead 253
276#define __NR_setxattr 254
277#define __NR_lsetxattr 255
278#define __NR_fsetxattr 256
279#define __NR_getxattr 257
280#define __NR_lgetxattr 258
281#define __NR_fgetxattr 269
282#define __NR_listxattr 260
283#define __NR_llistxattr 261
284#define __NR_flistxattr 262
285#define __NR_removexattr 263
286#define __NR_lremovexattr 264
287#define __NR_fremovexattr 265
288#define __NR_tkill 266
289#define __NR_sendfile64 267
290#define __NR_futex 268
291#define __NR_sched_setaffinity 269
292#define __NR_sched_getaffinity 270
293 /* 271 is reserved for set_thread_area */
294 /* 272 is reserved for get_thread_area */
295#define __NR_io_setup 273
296#define __NR_io_destroy 274
297#define __NR_io_getevents 275
298#define __NR_io_submit 276
299#define __NR_io_cancel 277
300#define __NR_fadvise64 278
301 /* 279 is unused */
302#define __NR_exit_group 280
303
304#define __NR_lookup_dcookie 281
305#define __NR_epoll_create 282
306#define __NR_epoll_ctl 283
307#define __NR_epoll_wait 284
308#define __NR_remap_file_pages 285
309#define __NR_set_tid_address 286
310#define __NR_timer_create 287
311#define __NR_timer_settime (__NR_timer_create+1)
312#define __NR_timer_gettime (__NR_timer_create+2)
313#define __NR_timer_getoverrun (__NR_timer_create+3)
314#define __NR_timer_delete (__NR_timer_create+4)
315#define __NR_clock_settime (__NR_timer_create+5)
316#define __NR_clock_gettime (__NR_timer_create+6)
317#define __NR_clock_getres (__NR_timer_create+7)
318#define __NR_clock_nanosleep (__NR_timer_create+8)
319#define __NR_statfs64 296
320#define __NR_fstatfs64 297
321#define __NR_tgkill 298
322#define __NR_utimes 299
323#define __NR_fadvise64_64 300
324 /* 301 is reserved for vserver */
325 /* 302 is reserved for mbind */
326 /* 303 is reserved for get_mempolicy */
327 /* 304 is reserved for set_mempolicy */
328#define __NR_mq_open 305
329#define __NR_mq_unlink (__NR_mq_open+1)
330#define __NR_mq_timedsend (__NR_mq_open+2)
331#define __NR_mq_timedreceive (__NR_mq_open+3)
332#define __NR_mq_notify (__NR_mq_open+4)
333#define __NR_mq_getsetattr (__NR_mq_open+5)
334 /* 311 is reserved for kexec */
335#define __NR_waitid 312
336#define __NR_add_key 313
337#define __NR_request_key 314
338#define __NR_keyctl 315
339#define __NR_ioprio_set 316
340#define __NR_ioprio_get 317
341#define __NR_inotify_init 318
342#define __NR_inotify_add_watch 319
343#define __NR_inotify_rm_watch 320
344 /* 321 is unused */
345#define __NR_migrate_pages 322
346#define __NR_openat 323
347#define __NR_mkdirat 324
348#define __NR_mknodat 325
349#define __NR_fchownat 326
350#define __NR_futimesat 327
351#define __NR_fstatat64 328
352#define __NR_unlinkat 329
353#define __NR_renameat 330
354#define __NR_linkat 331
355#define __NR_symlinkat 332
356#define __NR_readlinkat 333
357#define __NR_fchmodat 334
358#define __NR_faccessat 335
359#define __NR_pselect6 336
360#define __NR_ppoll 337
361#define __NR_unshare 338
362#define __NR_set_robust_list 339
363#define __NR_get_robust_list 340
364#define __NR_splice 341
365#define __NR_sync_file_range 342
366#define __NR_tee 343
367#define __NR_vmsplice 344
368#define __NR_move_pages 345
369#define __NR_getcpu 346
370#define __NR_epoll_pwait 347
371#define __NR_utimensat 348
372#define __NR_signalfd 349
373#define __NR_timerfd_create 350
374#define __NR_eventfd 351
375#define __NR_fallocate 352
376#define __NR_timerfd_settime 353
377#define __NR_timerfd_gettime 354
378#define __NR_signalfd4 355
379#define __NR_eventfd2 356
380#define __NR_epoll_create1 357
381#define __NR_dup3 358
382#define __NR_pipe2 359
383#define __NR_inotify_init1 360
384#define __NR_preadv 361
385#define __NR_pwritev 362
386#define __NR_rt_tgsigqueueinfo 363
387#define __NR_perf_event_open 364
388#define __NR_recvmmsg 365
389#define __NR_accept4 366
390#define __NR_fanotify_init 367
391#define __NR_fanotify_mark 368
392#define __NR_prlimit64 369
393#define __NR_name_to_handle_at 370
394#define __NR_open_by_handle_at 371
395#define __NR_clock_adjtime 372
396#define __NR_syncfs 373
397#define __NR_sendmmsg 374
398#define __NR_setns 375
399#define __NR_process_vm_readv 376
400#define __NR_process_vm_writev 377
401#define __NR_kcmp 378
402
403#define NR_syscalls 379
404
405#endif /* __ASM_SH_UNISTD_64_H */
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
index f259b37874e..77f7ae1d464 100644
--- a/arch/sh/kernel/Makefile
+++ b/arch/sh/kernel/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the Linux/SuperH kernel. 2# Makefile for the Linux/SuperH kernel.
3# 3#
4 4
5extra-y := head_$(BITS).o vmlinux.lds 5extra-y := head_$(BITS).o init_task.o vmlinux.lds
6 6
7ifdef CONFIG_FUNCTION_TRACER 7ifdef CONFIG_FUNCTION_TRACER
8# Do not profile debug and lowlevel utilities 8# Do not profile debug and lowlevel utilities
@@ -16,7 +16,7 @@ obj-y := debugtraps.o dma-nommu.o dumpstack.o \
16 machvec.o nmi_debug.o process.o \ 16 machvec.o nmi_debug.o process.o \
17 process_$(BITS).o ptrace.o ptrace_$(BITS).o \ 17 process_$(BITS).o ptrace.o ptrace_$(BITS).o \
18 reboot.o return_address.o \ 18 reboot.o return_address.o \
19 setup.o signal_$(BITS).o sys_sh.o \ 19 setup.o signal_$(BITS).o sys_sh.o sys_sh$(BITS).o \
20 syscalls_$(BITS).o time.o topology.o traps.o \ 20 syscalls_$(BITS).o time.o topology.o traps.o \
21 traps_$(BITS).o unwinder.o 21 traps_$(BITS).o unwinder.o
22 22
@@ -25,7 +25,6 @@ obj-y += iomap.o
25obj-$(CONFIG_HAS_IOPORT) += ioport.o 25obj-$(CONFIG_HAS_IOPORT) += ioport.o
26endif 26endif
27 27
28obj-$(CONFIG_SUPERH32) += sys_sh32.o
29obj-y += cpu/ 28obj-y += cpu/
30obj-$(CONFIG_VSYSCALL) += vsyscall/ 29obj-$(CONFIG_VSYSCALL) += vsyscall/
31obj-$(CONFIG_SMP) += smp.o 30obj-$(CONFIG_SMP) += smp.o
diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile
index fa58bfd30d8..ae95935d93c 100644
--- a/arch/sh/kernel/cpu/Makefile
+++ b/arch/sh/kernel/cpu/Makefile
@@ -18,4 +18,4 @@ obj-$(CONFIG_ARCH_SHMOBILE) += shmobile/
18obj-$(CONFIG_SH_ADC) += adc.o 18obj-$(CONFIG_SH_ADC) += adc.o
19obj-$(CONFIG_SH_CLK_CPG_LEGACY) += clock-cpg.o 19obj-$(CONFIG_SH_CLK_CPG_LEGACY) += clock-cpg.o
20 20
21obj-y += irq/ init.o clock.o fpu.o proc.o 21obj-y += irq/ init.o clock.o fpu.o hwblk.o proc.o
diff --git a/arch/sh/kernel/cpu/fpu.c b/arch/sh/kernel/cpu/fpu.c
index f8f7af51c12..7f1b70cace3 100644
--- a/arch/sh/kernel/cpu/fpu.c
+++ b/arch/sh/kernel/cpu/fpu.c
@@ -2,7 +2,6 @@
2#include <linux/slab.h> 2#include <linux/slab.h>
3#include <asm/processor.h> 3#include <asm/processor.h>
4#include <asm/fpu.h> 4#include <asm/fpu.h>
5#include <asm/traps.h>
6 5
7int init_fpu(struct task_struct *tsk) 6int init_fpu(struct task_struct *tsk)
8{ 7{
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c
index 61a07dafcd4..fac742e514e 100644
--- a/arch/sh/kernel/cpu/init.c
+++ b/arch/sh/kernel/cpu/init.c
@@ -18,13 +18,13 @@
18#include <asm/processor.h> 18#include <asm/processor.h>
19#include <asm/uaccess.h> 19#include <asm/uaccess.h>
20#include <asm/page.h> 20#include <asm/page.h>
21#include <asm/system.h>
21#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
22#include <asm/cache.h> 23#include <asm/cache.h>
23#include <asm/elf.h> 24#include <asm/elf.h>
24#include <asm/io.h> 25#include <asm/io.h>
25#include <asm/smp.h> 26#include <asm/smp.h>
26#include <asm/sh_bios.h> 27#include <asm/sh_bios.h>
27#include <asm/setup.h>
28 28
29#ifdef CONFIG_SH_FPU 29#ifdef CONFIG_SH_FPU
30#define cpu_has_fpu 1 30#define cpu_has_fpu 1
diff --git a/arch/sh/kernel/cpu/irq/imask.c b/arch/sh/kernel/cpu/irq/imask.c
index e7f1745bd12..39b6a24c159 100644
--- a/arch/sh/kernel/cpu/irq/imask.c
+++ b/arch/sh/kernel/cpu/irq/imask.c
@@ -19,6 +19,7 @@
19#include <linux/cache.h> 19#include <linux/cache.h>
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/bitmap.h> 21#include <linux/bitmap.h>
22#include <asm/system.h>
22#include <asm/irq.h> 23#include <asm/irq.h>
23 24
24/* Bitmap of IRQ masked */ 25/* Bitmap of IRQ masked */
diff --git a/arch/sh/kernel/cpu/proc.c b/arch/sh/kernel/cpu/proc.c
index 9e6624c9108..f47be8727b3 100644
--- a/arch/sh/kernel/cpu/proc.c
+++ b/arch/sh/kernel/cpu/proc.c
@@ -7,7 +7,6 @@
7static const char *cpu_name[] = { 7static const char *cpu_name[] = {
8 [CPU_SH7201] = "SH7201", 8 [CPU_SH7201] = "SH7201",
9 [CPU_SH7203] = "SH7203", [CPU_SH7263] = "SH7263", 9 [CPU_SH7203] = "SH7203", [CPU_SH7263] = "SH7263",
10 [CPU_SH7264] = "SH7264", [CPU_SH7269] = "SH7269",
11 [CPU_SH7206] = "SH7206", [CPU_SH7619] = "SH7619", 10 [CPU_SH7206] = "SH7206", [CPU_SH7619] = "SH7619",
12 [CPU_SH7705] = "SH7705", [CPU_SH7706] = "SH7706", 11 [CPU_SH7705] = "SH7705", [CPU_SH7706] = "SH7706",
13 [CPU_SH7707] = "SH7707", [CPU_SH7708] = "SH7708", 12 [CPU_SH7707] = "SH7707", [CPU_SH7708] = "SH7708",
@@ -26,8 +25,7 @@ static const char *cpu_name[] = {
26 [CPU_SH5_101] = "SH5-101", [CPU_SH5_103] = "SH5-103", 25 [CPU_SH5_101] = "SH5-101", [CPU_SH5_103] = "SH5-103",
27 [CPU_MXG] = "MX-G", [CPU_SH7723] = "SH7723", 26 [CPU_MXG] = "MX-G", [CPU_SH7723] = "SH7723",
28 [CPU_SH7366] = "SH7366", [CPU_SH7724] = "SH7724", 27 [CPU_SH7366] = "SH7366", [CPU_SH7724] = "SH7724",
29 [CPU_SH7372] = "SH7372", [CPU_SH7734] = "SH7734", 28 [CPU_SH7372] = "SH7372", [CPU_SH_NONE] = "Unknown"
30 [CPU_SH_NONE] = "Unknown"
31}; 29};
32 30
33const char *get_cpu_subtype(struct sh_cpuinfo *c) 31const char *get_cpu_subtype(struct sh_cpuinfo *c)
diff --git a/arch/sh/kernel/cpu/sh2/clock-sh7619.c b/arch/sh/kernel/cpu/sh2/clock-sh7619.c
index e80252ae5bc..5b7f12e58a8 100644
--- a/arch/sh/kernel/cpu/sh2/clock-sh7619.c
+++ b/arch/sh/kernel/cpu/sh2/clock-sh7619.c
@@ -28,7 +28,7 @@ static void master_clk_init(struct clk *clk)
28 clk->rate *= pll2_mult * pll1rate[(__raw_readw(FREQCR) >> 8) & 7]; 28 clk->rate *= pll2_mult * pll1rate[(__raw_readw(FREQCR) >> 8) & 7];
29} 29}
30 30
31static struct sh_clk_ops sh7619_master_clk_ops = { 31static struct clk_ops sh7619_master_clk_ops = {
32 .init = master_clk_init, 32 .init = master_clk_init,
33}; 33};
34 34
@@ -38,7 +38,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
38 return clk->parent->rate / pfc_divisors[idx]; 38 return clk->parent->rate / pfc_divisors[idx];
39} 39}
40 40
41static struct sh_clk_ops sh7619_module_clk_ops = { 41static struct clk_ops sh7619_module_clk_ops = {
42 .recalc = module_clk_recalc, 42 .recalc = module_clk_recalc,
43}; 43};
44 44
@@ -47,22 +47,22 @@ static unsigned long bus_clk_recalc(struct clk *clk)
47 return clk->parent->rate / pll1rate[(__raw_readw(FREQCR) >> 8) & 7]; 47 return clk->parent->rate / pll1rate[(__raw_readw(FREQCR) >> 8) & 7];
48} 48}
49 49
50static struct sh_clk_ops sh7619_bus_clk_ops = { 50static struct clk_ops sh7619_bus_clk_ops = {
51 .recalc = bus_clk_recalc, 51 .recalc = bus_clk_recalc,
52}; 52};
53 53
54static struct sh_clk_ops sh7619_cpu_clk_ops = { 54static struct clk_ops sh7619_cpu_clk_ops = {
55 .recalc = followparent_recalc, 55 .recalc = followparent_recalc,
56}; 56};
57 57
58static struct sh_clk_ops *sh7619_clk_ops[] = { 58static struct clk_ops *sh7619_clk_ops[] = {
59 &sh7619_master_clk_ops, 59 &sh7619_master_clk_ops,
60 &sh7619_module_clk_ops, 60 &sh7619_module_clk_ops,
61 &sh7619_bus_clk_ops, 61 &sh7619_bus_clk_ops,
62 &sh7619_cpu_clk_ops, 62 &sh7619_cpu_clk_ops,
63}; 63};
64 64
65void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 65void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
66{ 66{
67 if (test_mode_pin(MODE_PIN2 | MODE_PIN0) || 67 if (test_mode_pin(MODE_PIN2 | MODE_PIN0) ||
68 test_mode_pin(MODE_PIN2 | MODE_PIN1)) 68 test_mode_pin(MODE_PIN2 | MODE_PIN1))
diff --git a/arch/sh/kernel/cpu/sh2/setup-sh7619.c b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
index e0b740c831c..0f8befccf9f 100644
--- a/arch/sh/kernel/cpu/sh2/setup-sh7619.c
+++ b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
@@ -65,7 +65,7 @@ static struct plat_sci_port scif0_platform_data = {
65 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 65 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
66 .scbrr_algo_id = SCBRR_ALGO_2, 66 .scbrr_algo_id = SCBRR_ALGO_2,
67 .type = PORT_SCIF, 67 .type = PORT_SCIF,
68 .irqs = SCIx_IRQ_MUXED(88), 68 .irqs = { 88, 88, 88, 88 },
69}; 69};
70 70
71static struct platform_device scif0_device = { 71static struct platform_device scif0_device = {
@@ -82,7 +82,7 @@ static struct plat_sci_port scif1_platform_data = {
82 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 82 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
83 .scbrr_algo_id = SCBRR_ALGO_2, 83 .scbrr_algo_id = SCBRR_ALGO_2,
84 .type = PORT_SCIF, 84 .type = PORT_SCIF,
85 .irqs = SCIx_IRQ_MUXED(92), 85 .irqs = { 92, 92, 92, 92 },
86}; 86};
87 87
88static struct platform_device scif1_device = { 88static struct platform_device scif1_device = {
@@ -99,7 +99,7 @@ static struct plat_sci_port scif2_platform_data = {
99 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 99 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
100 .scbrr_algo_id = SCBRR_ALGO_2, 100 .scbrr_algo_id = SCBRR_ALGO_2,
101 .type = PORT_SCIF, 101 .type = PORT_SCIF,
102 .irqs = SCIx_IRQ_MUXED(96), 102 .irqs = { 96, 96, 96, 96 },
103}; 103};
104 104
105static struct platform_device scif2_device = { 105static struct platform_device scif2_device = {
diff --git a/arch/sh/kernel/cpu/sh2a/Makefile b/arch/sh/kernel/cpu/sh2a/Makefile
index 7fdc102d0dd..45f85c77ef7 100644
--- a/arch/sh/kernel/cpu/sh2a/Makefile
+++ b/arch/sh/kernel/cpu/sh2a/Makefile
@@ -11,14 +11,10 @@ obj-$(CONFIG_SH_FPU) += fpu.o
11obj-$(CONFIG_CPU_SUBTYPE_SH7201) += setup-sh7201.o clock-sh7201.o 11obj-$(CONFIG_CPU_SUBTYPE_SH7201) += setup-sh7201.o clock-sh7201.o
12obj-$(CONFIG_CPU_SUBTYPE_SH7203) += setup-sh7203.o clock-sh7203.o 12obj-$(CONFIG_CPU_SUBTYPE_SH7203) += setup-sh7203.o clock-sh7203.o
13obj-$(CONFIG_CPU_SUBTYPE_SH7263) += setup-sh7203.o clock-sh7203.o 13obj-$(CONFIG_CPU_SUBTYPE_SH7263) += setup-sh7203.o clock-sh7203.o
14obj-$(CONFIG_CPU_SUBTYPE_SH7264) += setup-sh7264.o clock-sh7264.o
15obj-$(CONFIG_CPU_SUBTYPE_SH7206) += setup-sh7206.o clock-sh7206.o 14obj-$(CONFIG_CPU_SUBTYPE_SH7206) += setup-sh7206.o clock-sh7206.o
16obj-$(CONFIG_CPU_SUBTYPE_SH7269) += setup-sh7269.o clock-sh7269.o
17obj-$(CONFIG_CPU_SUBTYPE_MXG) += setup-mxg.o clock-sh7206.o 15obj-$(CONFIG_CPU_SUBTYPE_MXG) += setup-mxg.o clock-sh7206.o
18 16
19# Pinmux setup 17# Pinmux setup
20pinmux-$(CONFIG_CPU_SUBTYPE_SH7203) := pinmux-sh7203.o 18pinmux-$(CONFIG_CPU_SUBTYPE_SH7203) := pinmux-sh7203.o
21pinmux-$(CONFIG_CPU_SUBTYPE_SH7264) := pinmux-sh7264.o
22pinmux-$(CONFIG_CPU_SUBTYPE_SH7269) := pinmux-sh7269.o
23 19
24obj-$(CONFIG_GENERIC_GPIO) += $(pinmux-y) 20obj-$(CONFIG_GENERIC_GPIO) += $(pinmux-y)
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7201.c b/arch/sh/kernel/cpu/sh2a/clock-sh7201.c
index 532a36c7232..1174e2d96c0 100644
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7201.c
+++ b/arch/sh/kernel/cpu/sh2a/clock-sh7201.c
@@ -30,7 +30,7 @@ static void master_clk_init(struct clk *clk)
30 pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007]; 30 pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007];
31} 31}
32 32
33static struct sh_clk_ops sh7201_master_clk_ops = { 33static struct clk_ops sh7201_master_clk_ops = {
34 .init = master_clk_init, 34 .init = master_clk_init,
35}; 35};
36 36
@@ -40,7 +40,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
40 return clk->parent->rate / pfc_divisors[idx]; 40 return clk->parent->rate / pfc_divisors[idx];
41} 41}
42 42
43static struct sh_clk_ops sh7201_module_clk_ops = { 43static struct clk_ops sh7201_module_clk_ops = {
44 .recalc = module_clk_recalc, 44 .recalc = module_clk_recalc,
45}; 45};
46 46
@@ -50,7 +50,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
50 return clk->parent->rate / pfc_divisors[idx]; 50 return clk->parent->rate / pfc_divisors[idx];
51} 51}
52 52
53static struct sh_clk_ops sh7201_bus_clk_ops = { 53static struct clk_ops sh7201_bus_clk_ops = {
54 .recalc = bus_clk_recalc, 54 .recalc = bus_clk_recalc,
55}; 55};
56 56
@@ -60,18 +60,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
60 return clk->parent->rate / ifc_divisors[idx]; 60 return clk->parent->rate / ifc_divisors[idx];
61} 61}
62 62
63static struct sh_clk_ops sh7201_cpu_clk_ops = { 63static struct clk_ops sh7201_cpu_clk_ops = {
64 .recalc = cpu_clk_recalc, 64 .recalc = cpu_clk_recalc,
65}; 65};
66 66
67static struct sh_clk_ops *sh7201_clk_ops[] = { 67static struct clk_ops *sh7201_clk_ops[] = {
68 &sh7201_master_clk_ops, 68 &sh7201_master_clk_ops,
69 &sh7201_module_clk_ops, 69 &sh7201_module_clk_ops,
70 &sh7201_bus_clk_ops, 70 &sh7201_bus_clk_ops,
71 &sh7201_cpu_clk_ops, 71 &sh7201_cpu_clk_ops,
72}; 72};
73 73
74void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 74void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
75{ 75{
76 if (test_mode_pin(MODE_PIN1 | MODE_PIN0)) 76 if (test_mode_pin(MODE_PIN1 | MODE_PIN0))
77 pll2_mult = 1; 77 pll2_mult = 1;
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7203.c b/arch/sh/kernel/cpu/sh2a/clock-sh7203.c
index 529f719b6e3..95a008e8b73 100644
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7203.c
+++ b/arch/sh/kernel/cpu/sh2a/clock-sh7203.c
@@ -32,7 +32,7 @@ static void master_clk_init(struct clk *clk)
32 clk->rate *= pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0003] * pll2_mult; 32 clk->rate *= pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0003] * pll2_mult;
33} 33}
34 34
35static struct sh_clk_ops sh7203_master_clk_ops = { 35static struct clk_ops sh7203_master_clk_ops = {
36 .init = master_clk_init, 36 .init = master_clk_init,
37}; 37};
38 38
@@ -42,7 +42,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
42 return clk->parent->rate / pfc_divisors[idx]; 42 return clk->parent->rate / pfc_divisors[idx];
43} 43}
44 44
45static struct sh_clk_ops sh7203_module_clk_ops = { 45static struct clk_ops sh7203_module_clk_ops = {
46 .recalc = module_clk_recalc, 46 .recalc = module_clk_recalc,
47}; 47};
48 48
@@ -52,22 +52,22 @@ static unsigned long bus_clk_recalc(struct clk *clk)
52 return clk->parent->rate / pfc_divisors[idx-2]; 52 return clk->parent->rate / pfc_divisors[idx-2];
53} 53}
54 54
55static struct sh_clk_ops sh7203_bus_clk_ops = { 55static struct clk_ops sh7203_bus_clk_ops = {
56 .recalc = bus_clk_recalc, 56 .recalc = bus_clk_recalc,
57}; 57};
58 58
59static struct sh_clk_ops sh7203_cpu_clk_ops = { 59static struct clk_ops sh7203_cpu_clk_ops = {
60 .recalc = followparent_recalc, 60 .recalc = followparent_recalc,
61}; 61};
62 62
63static struct sh_clk_ops *sh7203_clk_ops[] = { 63static struct clk_ops *sh7203_clk_ops[] = {
64 &sh7203_master_clk_ops, 64 &sh7203_master_clk_ops,
65 &sh7203_module_clk_ops, 65 &sh7203_module_clk_ops,
66 &sh7203_bus_clk_ops, 66 &sh7203_bus_clk_ops,
67 &sh7203_cpu_clk_ops, 67 &sh7203_cpu_clk_ops,
68}; 68};
69 69
70void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 70void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
71{ 71{
72 if (test_mode_pin(MODE_PIN1)) 72 if (test_mode_pin(MODE_PIN1))
73 pll2_mult = 4; 73 pll2_mult = 4;
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7206.c b/arch/sh/kernel/cpu/sh2a/clock-sh7206.c
index 17778983467..3c314d7cd6e 100644
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7206.c
+++ b/arch/sh/kernel/cpu/sh2a/clock-sh7206.c
@@ -29,7 +29,7 @@ static void master_clk_init(struct clk *clk)
29 clk->rate *= pll2_mult * pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007]; 29 clk->rate *= pll2_mult * pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007];
30} 30}
31 31
32static struct sh_clk_ops sh7206_master_clk_ops = { 32static struct clk_ops sh7206_master_clk_ops = {
33 .init = master_clk_init, 33 .init = master_clk_init,
34}; 34};
35 35
@@ -39,7 +39,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
39 return clk->parent->rate / pfc_divisors[idx]; 39 return clk->parent->rate / pfc_divisors[idx];
40} 40}
41 41
42static struct sh_clk_ops sh7206_module_clk_ops = { 42static struct clk_ops sh7206_module_clk_ops = {
43 .recalc = module_clk_recalc, 43 .recalc = module_clk_recalc,
44}; 44};
45 45
@@ -48,7 +48,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
48 return clk->parent->rate / pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007]; 48 return clk->parent->rate / pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007];
49} 49}
50 50
51static struct sh_clk_ops sh7206_bus_clk_ops = { 51static struct clk_ops sh7206_bus_clk_ops = {
52 .recalc = bus_clk_recalc, 52 .recalc = bus_clk_recalc,
53}; 53};
54 54
@@ -58,18 +58,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
58 return clk->parent->rate / ifc_divisors[idx]; 58 return clk->parent->rate / ifc_divisors[idx];
59} 59}
60 60
61static struct sh_clk_ops sh7206_cpu_clk_ops = { 61static struct clk_ops sh7206_cpu_clk_ops = {
62 .recalc = cpu_clk_recalc, 62 .recalc = cpu_clk_recalc,
63}; 63};
64 64
65static struct sh_clk_ops *sh7206_clk_ops[] = { 65static struct clk_ops *sh7206_clk_ops[] = {
66 &sh7206_master_clk_ops, 66 &sh7206_master_clk_ops,
67 &sh7206_module_clk_ops, 67 &sh7206_module_clk_ops,
68 &sh7206_bus_clk_ops, 68 &sh7206_bus_clk_ops,
69 &sh7206_cpu_clk_ops, 69 &sh7206_cpu_clk_ops,
70}; 70};
71 71
72void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 72void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
73{ 73{
74 if (test_mode_pin(MODE_PIN2 | MODE_PIN1 | MODE_PIN0)) 74 if (test_mode_pin(MODE_PIN2 | MODE_PIN1 | MODE_PIN0))
75 pll2_mult = 1; 75 pll2_mult = 1;
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7264.c b/arch/sh/kernel/cpu/sh2a/clock-sh7264.c
deleted file mode 100644
index fdf585c9528..00000000000
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7264.c
+++ /dev/null
@@ -1,153 +0,0 @@
1/*
2 * arch/sh/kernel/cpu/sh2a/clock-sh7264.c
3 *
4 * SH7264 clock framework support
5 *
6 * Copyright (C) 2012 Phil Edworthy
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/io.h>
15#include <linux/clkdev.h>
16#include <asm/clock.h>
17
18/* SH7264 registers */
19#define FRQCR 0xfffe0010
20#define STBCR3 0xfffe0408
21#define STBCR4 0xfffe040c
22#define STBCR5 0xfffe0410
23#define STBCR6 0xfffe0414
24#define STBCR7 0xfffe0418
25#define STBCR8 0xfffe041c
26
27static const unsigned int pll1rate[] = {8, 12};
28
29static unsigned int pll1_div;
30
31/* Fixed 32 KHz root clock for RTC */
32static struct clk r_clk = {
33 .rate = 32768,
34};
35
36/*
37 * Default rate for the root input clock, reset this with clk_set_rate()
38 * from the platform code.
39 */
40static struct clk extal_clk = {
41 .rate = 18000000,
42};
43
44static unsigned long pll_recalc(struct clk *clk)
45{
46 unsigned long rate = clk->parent->rate / pll1_div;
47 return rate * pll1rate[(__raw_readw(FRQCR) >> 8) & 1];
48}
49
50static struct sh_clk_ops pll_clk_ops = {
51 .recalc = pll_recalc,
52};
53
54static struct clk pll_clk = {
55 .ops = &pll_clk_ops,
56 .parent = &extal_clk,
57 .flags = CLK_ENABLE_ON_INIT,
58};
59
60struct clk *main_clks[] = {
61 &r_clk,
62 &extal_clk,
63 &pll_clk,
64};
65
66static int div2[] = { 1, 2, 3, 4, 6, 8, 12 };
67
68static struct clk_div_mult_table div4_div_mult_table = {
69 .divisors = div2,
70 .nr_divisors = ARRAY_SIZE(div2),
71};
72
73static struct clk_div4_table div4_table = {
74 .div_mult_table = &div4_div_mult_table,
75};
76
77enum { DIV4_I, DIV4_P,
78 DIV4_NR };
79
80#define DIV4(_reg, _bit, _mask, _flags) \
81 SH_CLK_DIV4(&pll_clk, _reg, _bit, _mask, _flags)
82
83/* The mask field specifies the div2 entries that are valid */
84struct clk div4_clks[DIV4_NR] = {
85 [DIV4_I] = DIV4(FRQCR, 4, 0x7, CLK_ENABLE_REG_16BIT
86 | CLK_ENABLE_ON_INIT),
87 [DIV4_P] = DIV4(FRQCR, 0, 0x78, CLK_ENABLE_REG_16BIT),
88};
89
90enum { MSTP77, MSTP74, MSTP72,
91 MSTP60,
92 MSTP35, MSTP34, MSTP33, MSTP32, MSTP30,
93 MSTP_NR };
94
95static struct clk mstp_clks[MSTP_NR] = {
96 [MSTP77] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR7, 7, 0), /* SCIF */
97 [MSTP74] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR7, 4, 0), /* VDC */
98 [MSTP72] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR7, 2, 0), /* CMT */
99 [MSTP60] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR6, 0, 0), /* USB */
100 [MSTP35] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR3, 6, 0), /* MTU2 */
101 [MSTP34] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR3, 4, 0), /* SDHI0 */
102 [MSTP33] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR3, 3, 0), /* SDHI1 */
103 [MSTP32] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR3, 2, 0), /* ADC */
104 [MSTP30] = SH_CLK_MSTP8(&r_clk, STBCR3, 0, 0), /* RTC */
105};
106
107static struct clk_lookup lookups[] = {
108 /* main clocks */
109 CLKDEV_CON_ID("rclk", &r_clk),
110 CLKDEV_CON_ID("extal", &extal_clk),
111 CLKDEV_CON_ID("pll_clk", &pll_clk),
112
113 /* DIV4 clocks */
114 CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
115 CLKDEV_CON_ID("peripheral_clk", &div4_clks[DIV4_P]),
116
117 /* MSTP clocks */
118 CLKDEV_CON_ID("sci_ick", &mstp_clks[MSTP77]),
119 CLKDEV_CON_ID("vdc3", &mstp_clks[MSTP74]),
120 CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]),
121 CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]),
122 CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]),
123 CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP34]),
124 CLKDEV_CON_ID("sdhi1", &mstp_clks[MSTP33]),
125 CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]),
126 CLKDEV_CON_ID("rtc0", &mstp_clks[MSTP30]),
127};
128
129int __init arch_clk_init(void)
130{
131 int k, ret = 0;
132
133 if (test_mode_pin(MODE_PIN0)) {
134 if (test_mode_pin(MODE_PIN1))
135 pll1_div = 3;
136 else
137 pll1_div = 4;
138 } else
139 pll1_div = 1;
140
141 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
142 ret = clk_register(main_clks[k]);
143
144 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
145
146 if (!ret)
147 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
148
149 if (!ret)
150 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
151
152 return ret;
153}
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7269.c b/arch/sh/kernel/cpu/sh2a/clock-sh7269.c
deleted file mode 100644
index 6b787620de9..00000000000
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7269.c
+++ /dev/null
@@ -1,184 +0,0 @@
1/*
2 * arch/sh/kernel/cpu/sh2a/clock-sh7269.c
3 *
4 * SH7269 clock framework support
5 *
6 * Copyright (C) 2012 Phil Edworthy
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/io.h>
15#include <linux/clkdev.h>
16#include <asm/clock.h>
17
18/* SH7269 registers */
19#define FRQCR 0xfffe0010
20#define STBCR3 0xfffe0408
21#define STBCR4 0xfffe040c
22#define STBCR5 0xfffe0410
23#define STBCR6 0xfffe0414
24#define STBCR7 0xfffe0418
25
26#define PLL_RATE 20
27
28/* Fixed 32 KHz root clock for RTC */
29static struct clk r_clk = {
30 .rate = 32768,
31};
32
33/*
34 * Default rate for the root input clock, reset this with clk_set_rate()
35 * from the platform code.
36 */
37static struct clk extal_clk = {
38 .rate = 13340000,
39};
40
41static unsigned long pll_recalc(struct clk *clk)
42{
43 return clk->parent->rate * PLL_RATE;
44}
45
46static struct sh_clk_ops pll_clk_ops = {
47 .recalc = pll_recalc,
48};
49
50static struct clk pll_clk = {
51 .ops = &pll_clk_ops,
52 .parent = &extal_clk,
53 .flags = CLK_ENABLE_ON_INIT,
54};
55
56static unsigned long peripheral0_recalc(struct clk *clk)
57{
58 return clk->parent->rate / 8;
59}
60
61static struct sh_clk_ops peripheral0_clk_ops = {
62 .recalc = peripheral0_recalc,
63};
64
65static struct clk peripheral0_clk = {
66 .ops = &peripheral0_clk_ops,
67 .parent = &pll_clk,
68 .flags = CLK_ENABLE_ON_INIT,
69};
70
71static unsigned long peripheral1_recalc(struct clk *clk)
72{
73 return clk->parent->rate / 4;
74}
75
76static struct sh_clk_ops peripheral1_clk_ops = {
77 .recalc = peripheral1_recalc,
78};
79
80static struct clk peripheral1_clk = {
81 .ops = &peripheral1_clk_ops,
82 .parent = &pll_clk,
83 .flags = CLK_ENABLE_ON_INIT,
84};
85
86struct clk *main_clks[] = {
87 &r_clk,
88 &extal_clk,
89 &pll_clk,
90 &peripheral0_clk,
91 &peripheral1_clk,
92};
93
94static int div2[] = { 1, 2, 0, 4 };
95
96static struct clk_div_mult_table div4_div_mult_table = {
97 .divisors = div2,
98 .nr_divisors = ARRAY_SIZE(div2),
99};
100
101static struct clk_div4_table div4_table = {
102 .div_mult_table = &div4_div_mult_table,
103};
104
105enum { DIV4_I, DIV4_B,
106 DIV4_NR };
107
108#define DIV4(_reg, _bit, _mask, _flags) \
109 SH_CLK_DIV4(&pll_clk, _reg, _bit, _mask, _flags)
110
111/* The mask field specifies the div2 entries that are valid */
112struct clk div4_clks[DIV4_NR] = {
113 [DIV4_I] = DIV4(FRQCR, 8, 0xB, CLK_ENABLE_REG_16BIT
114 | CLK_ENABLE_ON_INIT),
115 [DIV4_B] = DIV4(FRQCR, 4, 0xA, CLK_ENABLE_REG_16BIT
116 | CLK_ENABLE_ON_INIT),
117};
118
119enum { MSTP72,
120 MSTP60,
121 MSTP47, MSTP46, MSTP45, MSTP44, MSTP43, MSTP42, MSTP41, MSTP40,
122 MSTP35, MSTP32, MSTP30,
123 MSTP_NR };
124
125static struct clk mstp_clks[MSTP_NR] = {
126 [MSTP72] = SH_CLK_MSTP8(&peripheral0_clk, STBCR7, 2, 0), /* CMT */
127 [MSTP60] = SH_CLK_MSTP8(&peripheral1_clk, STBCR6, 0, 0), /* USB */
128 [MSTP47] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 7, 0), /* SCIF0 */
129 [MSTP46] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 6, 0), /* SCIF1 */
130 [MSTP45] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 5, 0), /* SCIF2 */
131 [MSTP44] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 4, 0), /* SCIF3 */
132 [MSTP43] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 3, 0), /* SCIF4 */
133 [MSTP42] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 2, 0), /* SCIF5 */
134 [MSTP41] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 1, 0), /* SCIF6 */
135 [MSTP40] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 0, 0), /* SCIF7 */
136 [MSTP35] = SH_CLK_MSTP8(&peripheral0_clk, STBCR3, 5, 0), /* MTU2 */
137 [MSTP32] = SH_CLK_MSTP8(&peripheral1_clk, STBCR3, 2, 0), /* ADC */
138 [MSTP30] = SH_CLK_MSTP8(&r_clk, STBCR3, 0, 0), /* RTC */
139};
140
141static struct clk_lookup lookups[] = {
142 /* main clocks */
143 CLKDEV_CON_ID("rclk", &r_clk),
144 CLKDEV_CON_ID("extal", &extal_clk),
145 CLKDEV_CON_ID("pll_clk", &pll_clk),
146 CLKDEV_CON_ID("peripheral_clk", &peripheral1_clk),
147
148 /* DIV4 clocks */
149 CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
150 CLKDEV_CON_ID("bus_clk", &div4_clks[DIV4_B]),
151
152 /* MSTP clocks */
153 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP47]),
154 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP46]),
155 CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP45]),
156 CLKDEV_ICK_ID("sci_fck", "sh-sci.3", &mstp_clks[MSTP44]),
157 CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[MSTP43]),
158 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]),
159 CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]),
160 CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]),
161 CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]),
162 CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]),
163 CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]),
164 CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]),
165 CLKDEV_CON_ID("rtc0", &mstp_clks[MSTP30]),
166};
167
168int __init arch_clk_init(void)
169{
170 int k, ret = 0;
171
172 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
173 ret = clk_register(main_clks[k]);
174
175 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
176
177 if (!ret)
178 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
179
180 if (!ret)
181 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
182
183 return ret;
184}
diff --git a/arch/sh/kernel/cpu/sh2a/ex.S b/arch/sh/kernel/cpu/sh2a/ex.S
index 4568066700c..3ead9e63965 100644
--- a/arch/sh/kernel/cpu/sh2a/ex.S
+++ b/arch/sh/kernel/cpu/sh2a/ex.S
@@ -66,7 +66,6 @@ vector = 0
66 .long exception_entry0 + vector * 6 66 .long exception_entry0 + vector * 6
67vector = vector + 1 67vector = vector + 1
68 .endr 68 .endr
69vector = 0
70 .rept 256 69 .rept 256
71 .long exception_entry1 + vector * 6 70 .long exception_entry1 + vector * 6
72vector = vector + 1 71vector = vector + 1
diff --git a/arch/sh/kernel/cpu/sh2a/fpu.c b/arch/sh/kernel/cpu/sh2a/fpu.c
index 98bbaa447c9..488d24e0cdf 100644
--- a/arch/sh/kernel/cpu/sh2a/fpu.c
+++ b/arch/sh/kernel/cpu/sh2a/fpu.c
@@ -14,7 +14,6 @@
14#include <asm/processor.h> 14#include <asm/processor.h>
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/fpu.h> 16#include <asm/fpu.h>
17#include <asm/traps.h>
18 17
19/* The PR (precision) bit in the FP Status Register must be clear when 18/* The PR (precision) bit in the FP Status Register must be clear when
20 * an frchg instruction is executed, otherwise the instruction is undefined. 19 * an frchg instruction is executed, otherwise the instruction is undefined.
diff --git a/arch/sh/kernel/cpu/sh2a/opcode_helper.c b/arch/sh/kernel/cpu/sh2a/opcode_helper.c
index 72aa61c81e4..9704b7926d8 100644
--- a/arch/sh/kernel/cpu/sh2a/opcode_helper.c
+++ b/arch/sh/kernel/cpu/sh2a/opcode_helper.c
@@ -10,6 +10,7 @@
10 * for more details. 10 * for more details.
11 */ 11 */
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <asm/system.h>
13 14
14/* 15/*
15 * Instructions on SH are generally fixed at 16-bits, however, SH-2A 16 * Instructions on SH are generally fixed at 16-bits, however, SH-2A
diff --git a/arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c b/arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c
deleted file mode 100644
index b055b55d6f2..00000000000
--- a/arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c
+++ /dev/null
@@ -1,2136 +0,0 @@
1/*
2 * SH7264 Pinmux
3 *
4 * Copyright (C) 2012 Renesas Electronics Europe Ltd
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/gpio.h>
14#include <cpu/sh7264.h>
15
16enum {
17 PINMUX_RESERVED = 0,
18
19 PINMUX_DATA_BEGIN,
20 /* Port A */
21 PA3_DATA, PA2_DATA, PA1_DATA, PA0_DATA,
22 /* Port B */
23 PB22_DATA, PB21_DATA, PB20_DATA,
24 PB19_DATA, PB18_DATA, PB17_DATA, PB16_DATA,
25 PB15_DATA, PB14_DATA, PB13_DATA, PB12_DATA,
26 PB11_DATA, PB10_DATA, PB9_DATA, PB8_DATA,
27 PB7_DATA, PB6_DATA, PB5_DATA, PB4_DATA,
28 PB3_DATA, PB2_DATA, PB1_DATA,
29 /* Port C */
30 PC10_DATA, PC9_DATA, PC8_DATA,
31 PC7_DATA, PC6_DATA, PC5_DATA, PC4_DATA,
32 PC3_DATA, PC2_DATA, PC1_DATA, PC0_DATA,
33 /* Port D */
34 PD15_DATA, PD14_DATA, PD13_DATA, PD12_DATA,
35 PD11_DATA, PD10_DATA, PD9_DATA, PD8_DATA,
36 PD7_DATA, PD6_DATA, PD5_DATA, PD4_DATA,
37 PD3_DATA, PD2_DATA, PD1_DATA, PD0_DATA,
38 /* Port E */
39 PE5_DATA, PE4_DATA,
40 PE3_DATA, PE2_DATA, PE1_DATA, PE0_DATA,
41 /* Port F */
42 PF12_DATA,
43 PF11_DATA, PF10_DATA, PF9_DATA, PF8_DATA,
44 PF7_DATA, PF6_DATA, PF5_DATA, PF4_DATA,
45 PF3_DATA, PF2_DATA, PF1_DATA, PF0_DATA,
46 /* Port G */
47 PG24_DATA,
48 PG23_DATA, PG22_DATA, PG21_DATA, PG20_DATA,
49 PG19_DATA, PG18_DATA, PG17_DATA, PG16_DATA,
50 PG15_DATA, PG14_DATA, PG13_DATA, PG12_DATA,
51 PG11_DATA, PG10_DATA, PG9_DATA, PG8_DATA,
52 PG7_DATA, PG6_DATA, PG5_DATA, PG4_DATA,
53 PG3_DATA, PG2_DATA, PG1_DATA, PG0_DATA,
54 /* Port H */
55 /* NOTE - Port H does not have a Data Register, but PH Data is
56 connected to PH Port Register */
57 PH7_DATA, PH6_DATA, PH5_DATA, PH4_DATA,
58 PH3_DATA, PH2_DATA, PH1_DATA, PH0_DATA,
59 /* Port I - not on device */
60 /* Port J */
61 PJ12_DATA,
62 PJ11_DATA, PJ10_DATA, PJ9_DATA, PJ8_DATA,
63 PJ7_DATA, PJ6_DATA, PJ5_DATA, PJ4_DATA,
64 PJ3_DATA, PJ2_DATA, PJ1_DATA, PJ0_DATA,
65 /* Port K */
66 PK12_DATA,
67 PK11_DATA, PK10_DATA, PK9_DATA, PK8_DATA,
68 PK7_DATA, PK6_DATA, PK5_DATA, PK4_DATA,
69 PK3_DATA, PK2_DATA, PK1_DATA, PK0_DATA,
70 PINMUX_DATA_END,
71
72 PINMUX_INPUT_BEGIN,
73 FORCE_IN,
74 /* Port A */
75 PA3_IN, PA2_IN, PA1_IN, PA0_IN,
76 /* Port B */
77 PB22_IN, PB21_IN, PB20_IN,
78 PB19_IN, PB18_IN, PB17_IN, PB16_IN,
79 PB15_IN, PB14_IN, PB13_IN, PB12_IN,
80 PB11_IN, PB10_IN, PB9_IN, PB8_IN,
81 PB7_IN, PB6_IN, PB5_IN, PB4_IN,
82 PB3_IN, PB2_IN, PB1_IN,
83 /* Port C */
84 PC10_IN, PC9_IN, PC8_IN,
85 PC7_IN, PC6_IN, PC5_IN, PC4_IN,
86 PC3_IN, PC2_IN, PC1_IN, PC0_IN,
87 /* Port D */
88 PD15_IN, PD14_IN, PD13_IN, PD12_IN,
89 PD11_IN, PD10_IN, PD9_IN, PD8_IN,
90 PD7_IN, PD6_IN, PD5_IN, PD4_IN,
91 PD3_IN, PD2_IN, PD1_IN, PD0_IN,
92 /* Port E */
93 PE5_IN, PE4_IN,
94 PE3_IN, PE2_IN, PE1_IN, PE0_IN,
95 /* Port F */
96 PF12_IN,
97 PF11_IN, PF10_IN, PF9_IN, PF8_IN,
98 PF7_IN, PF6_IN, PF5_IN, PF4_IN,
99 PF3_IN, PF2_IN, PF1_IN, PF0_IN,
100 /* Port G */
101 PG24_IN,
102 PG23_IN, PG22_IN, PG21_IN, PG20_IN,
103 PG19_IN, PG18_IN, PG17_IN, PG16_IN,
104 PG15_IN, PG14_IN, PG13_IN, PG12_IN,
105 PG11_IN, PG10_IN, PG9_IN, PG8_IN,
106 PG7_IN, PG6_IN, PG5_IN, PG4_IN,
107 PG3_IN, PG2_IN, PG1_IN, PG0_IN,
108 /* Port H - Port H does not have a Data Register */
109 /* Port I - not on device */
110 /* Port J */
111 PJ12_IN,
112 PJ11_IN, PJ10_IN, PJ9_IN, PJ8_IN,
113 PJ7_IN, PJ6_IN, PJ5_IN, PJ4_IN,
114 PJ3_IN, PJ2_IN, PJ1_IN, PJ0_IN,
115 /* Port K */
116 PK12_IN,
117 PK11_IN, PK10_IN, PK9_IN, PK8_IN,
118 PK7_IN, PK6_IN, PK5_IN, PK4_IN,
119 PK3_IN, PK2_IN, PK1_IN, PK0_IN,
120 PINMUX_INPUT_END,
121
122 PINMUX_OUTPUT_BEGIN,
123 FORCE_OUT,
124 /* Port A */
125 PA3_OUT, PA2_OUT, PA1_OUT, PA0_OUT,
126 /* Port B */
127 PB22_OUT, PB21_OUT, PB20_OUT,
128 PB19_OUT, PB18_OUT, PB17_OUT, PB16_OUT,
129 PB15_OUT, PB14_OUT, PB13_OUT, PB12_OUT,
130 PB11_OUT, PB10_OUT, PB9_OUT, PB8_OUT,
131 PB7_OUT, PB6_OUT, PB5_OUT, PB4_OUT,
132 PB3_OUT, PB2_OUT, PB1_OUT,
133 /* Port C */
134 PC10_OUT, PC9_OUT, PC8_OUT,
135 PC7_OUT, PC6_OUT, PC5_OUT, PC4_OUT,
136 PC3_OUT, PC2_OUT, PC1_OUT, PC0_OUT,
137 /* Port D */
138 PD15_OUT, PD14_OUT, PD13_OUT, PD12_OUT,
139 PD11_OUT, PD10_OUT, PD9_OUT, PD8_OUT,
140 PD7_OUT, PD6_OUT, PD5_OUT, PD4_OUT,
141 PD3_OUT, PD2_OUT, PD1_OUT, PD0_OUT,
142 /* Port E */
143 PE5_OUT, PE4_OUT,
144 PE3_OUT, PE2_OUT, PE1_OUT, PE0_OUT,
145 /* Port F */
146 PF12_OUT,
147 PF11_OUT, PF10_OUT, PF9_OUT, PF8_OUT,
148 PF7_OUT, PF6_OUT, PF5_OUT, PF4_OUT,
149 PF3_OUT, PF2_OUT, PF1_OUT, PF0_OUT,
150 /* Port G */
151 PG24_OUT,
152 PG23_OUT, PG22_OUT, PG21_OUT, PG20_OUT,
153 PG19_OUT, PG18_OUT, PG17_OUT, PG16_OUT,
154 PG15_OUT, PG14_OUT, PG13_OUT, PG12_OUT,
155 PG11_OUT, PG10_OUT, PG9_OUT, PG8_OUT,
156 PG7_OUT, PG6_OUT, PG5_OUT, PG4_OUT,
157 PG3_OUT, PG2_OUT, PG1_OUT, PG0_OUT,
158 /* Port H - Port H does not have a Data Register */
159 /* Port I - not on device */
160 /* Port J */
161 PJ12_OUT,
162 PJ11_OUT, PJ10_OUT, PJ9_OUT, PJ8_OUT,
163 PJ7_OUT, PJ6_OUT, PJ5_OUT, PJ4_OUT,
164 PJ3_OUT, PJ2_OUT, PJ1_OUT, PJ0_OUT,
165 /* Port K */
166 PK12_OUT,
167 PK11_OUT, PK10_OUT, PK9_OUT, PK8_OUT,
168 PK7_OUT, PK6_OUT, PK5_OUT, PK4_OUT,
169 PK3_OUT, PK2_OUT, PK1_OUT, PK0_OUT,
170 PINMUX_OUTPUT_END,
171
172 PINMUX_FUNCTION_BEGIN,
173 /* Port A */
174 PA3_IOR_IN, PA3_IOR_OUT,
175 PA2_IOR_IN, PA2_IOR_OUT,
176 PA1_IOR_IN, PA1_IOR_OUT,
177 PA0_IOR_IN, PA0_IOR_OUT,
178
179 /* Port B */
180 PB11_IOR_IN, PB11_IOR_OUT,
181 PB10_IOR_IN, PB10_IOR_OUT,
182 PB9_IOR_IN, PB9_IOR_OUT,
183 PB8_IOR_IN, PB8_IOR_OUT,
184
185 PB22MD_00, PB22MD_01, PB22MD_10,
186 PB21MD_0, PB21MD_1,
187 PB20MD_0, PB20MD_1,
188 PB19MD_00, PB19MD_01, PB19MD_10, PB19MD_11,
189 PB18MD_00, PB18MD_01, PB18MD_10, PB18MD_11,
190 PB17MD_00, PB17MD_01, PB17MD_10, PB17MD_11,
191 PB16MD_00, PB16MD_01, PB16MD_10, PB16MD_11,
192 PB15MD_00, PB15MD_01, PB15MD_10, PB15MD_11,
193 PB14MD_00, PB14MD_01, PB14MD_10, PB14MD_11,
194 PB13MD_00, PB13MD_01, PB13MD_10, PB13MD_11,
195 PB12MD_00, PB12MD_01, PB12MD_10, PB12MD_11,
196 PB11MD_00, PB11MD_01, PB11MD_10, PB11MD_11,
197 PB10MD_00, PB10MD_01, PB10MD_10, PB10MD_11,
198 PB9MD_00, PB9MD_01, PB9MD_10, PB9MD_11,
199 PB8MD_00, PB8MD_01, PB8MD_10, PB8MD_11,
200 PB7MD_00, PB7MD_01, PB7MD_10, PB7MD_11,
201 PB6MD_00, PB6MD_01, PB6MD_10, PB6MD_11,
202 PB5MD_00, PB5MD_01, PB5MD_10, PB5MD_11,
203 PB4MD_00, PB4MD_01, PB4MD_10, PB4MD_11,
204 PB3MD_0, PB3MD_1,
205 PB2MD_0, PB2MD_1,
206 PB1MD_0, PB1MD_1,
207
208 /* Port C */
209 PC14_IOR_IN, PC14_IOR_OUT,
210 PC13_IOR_IN, PC13_IOR_OUT,
211 PC12_IOR_IN, PC12_IOR_OUT,
212 PC11_IOR_IN, PC11_IOR_OUT,
213 PC10_IOR_IN, PC10_IOR_OUT,
214 PC9_IOR_IN, PC9_IOR_OUT,
215 PC8_IOR_IN, PC8_IOR_OUT,
216 PC7_IOR_IN, PC7_IOR_OUT,
217 PC6_IOR_IN, PC6_IOR_OUT,
218 PC5_IOR_IN, PC5_IOR_OUT,
219 PC4_IOR_IN, PC4_IOR_OUT,
220 PC3_IOR_IN, PC3_IOR_OUT,
221 PC2_IOR_IN, PC2_IOR_OUT,
222 PC1_IOR_IN, PC1_IOR_OUT,
223 PC0_IOR_IN, PC0_IOR_OUT,
224
225 PC10MD_0, PC10MD_1,
226 PC9MD_0, PC9MD_1,
227 PC8MD_00, PC8MD_01, PC8MD_10, PC8MD_11,
228 PC7MD_00, PC7MD_01, PC7MD_10, PC7MD_11,
229 PC6MD_00, PC6MD_01, PC6MD_10, PC6MD_11,
230 PC5MD_00, PC5MD_01, PC5MD_10, PC5MD_11,
231 PC4MD_0, PC4MD_1,
232 PC3MD_0, PC3MD_1,
233 PC2MD_0, PC2MD_1,
234 PC1MD_0, PC1MD_1,
235 PC0MD_0, PC0MD_1,
236
237 /* Port D */
238 PD15_IOR_IN, PD15_IOR_OUT,
239 PD14_IOR_IN, PD14_IOR_OUT,
240 PD13_IOR_IN, PD13_IOR_OUT,
241 PD12_IOR_IN, PD12_IOR_OUT,
242 PD11_IOR_IN, PD11_IOR_OUT,
243 PD10_IOR_IN, PD10_IOR_OUT,
244 PD9_IOR_IN, PD9_IOR_OUT,
245 PD8_IOR_IN, PD8_IOR_OUT,
246 PD7_IOR_IN, PD7_IOR_OUT,
247 PD6_IOR_IN, PD6_IOR_OUT,
248 PD5_IOR_IN, PD5_IOR_OUT,
249 PD4_IOR_IN, PD4_IOR_OUT,
250 PD3_IOR_IN, PD3_IOR_OUT,
251 PD2_IOR_IN, PD2_IOR_OUT,
252 PD1_IOR_IN, PD1_IOR_OUT,
253 PD0_IOR_IN, PD0_IOR_OUT,
254
255 PD15MD_00, PD15MD_01, PD15MD_10, PD15MD_11,
256 PD14MD_00, PD14MD_01, PD14MD_10, PD14MD_11,
257 PD13MD_00, PD13MD_01, PD13MD_10, PD13MD_11,
258 PD12MD_00, PD12MD_01, PD12MD_10, PD12MD_11,
259 PD11MD_00, PD11MD_01, PD11MD_10, PD11MD_11,
260 PD10MD_00, PD10MD_01, PD10MD_10, PD10MD_11,
261 PD9MD_00, PD9MD_01, PD9MD_10, PD9MD_11,
262 PD8MD_00, PD8MD_01, PD8MD_10, PD8MD_11,
263 PD7MD_00, PD7MD_01, PD7MD_10, PD7MD_11,
264 PD6MD_00, PD6MD_01, PD6MD_10, PD6MD_11,
265 PD5MD_00, PD5MD_01, PD5MD_10, PD5MD_11,
266 PD4MD_00, PD4MD_01, PD4MD_10, PD4MD_11,
267 PD3MD_00, PD3MD_01, PD3MD_10, PD3MD_11,
268 PD2MD_00, PD2MD_01, PD2MD_10, PD2MD_11,
269 PD1MD_00, PD1MD_01, PD1MD_10, PD1MD_11,
270 PD0MD_00, PD0MD_01, PD0MD_10, PD0MD_11,
271
272 /* Port E */
273 PE5_IOR_IN, PE5_IOR_OUT,
274 PE4_IOR_IN, PE4_IOR_OUT,
275 PE3_IOR_IN, PE3_IOR_OUT,
276 PE2_IOR_IN, PE2_IOR_OUT,
277 PE1_IOR_IN, PE1_IOR_OUT,
278 PE0_IOR_IN, PE0_IOR_OUT,
279
280 PE5MD_00, PE5MD_01, PE5MD_10, PE5MD_11,
281 PE4MD_00, PE4MD_01, PE4MD_10, PE4MD_11,
282 PE3MD_00, PE3MD_01, PE3MD_10, PE3MD_11,
283 PE2MD_00, PE2MD_01, PE2MD_10, PE2MD_11,
284 PE1MD_000, PE1MD_001, PE1MD_010, PE1MD_011,
285 PE1MD_100, PE1MD_101, PE1MD_110, PE1MD_111,
286 PE0MD_00, PE0MD_01, PE0MD_10, PE0MD_11,
287
288 /* Port F */
289 PF12_IOR_IN, PF12_IOR_OUT,
290 PF11_IOR_IN, PF11_IOR_OUT,
291 PF10_IOR_IN, PF10_IOR_OUT,
292 PF9_IOR_IN, PF9_IOR_OUT,
293 PF8_IOR_IN, PF8_IOR_OUT,
294 PF7_IOR_IN, PF7_IOR_OUT,
295 PF6_IOR_IN, PF6_IOR_OUT,
296 PF5_IOR_IN, PF5_IOR_OUT,
297 PF4_IOR_IN, PF4_IOR_OUT,
298 PF3_IOR_IN, PF3_IOR_OUT,
299 PF2_IOR_IN, PF2_IOR_OUT,
300 PF1_IOR_IN, PF1_IOR_OUT,
301 PF0_IOR_IN, PF0_IOR_OUT,
302
303 PF12MD_000, PF12MD_001, PF12MD_010, PF12MD_011,
304 PF12MD_100, PF12MD_101, PF12MD_110, PF12MD_111,
305 PF11MD_000, PF11MD_001, PF11MD_010, PF11MD_011,
306 PF11MD_100, PF11MD_101, PF11MD_110, PF11MD_111,
307 PF10MD_000, PF10MD_001, PF10MD_010, PF10MD_011,
308 PF10MD_100, PF10MD_101, PF10MD_110, PF10MD_111,
309 PF9MD_000, PF9MD_001, PF9MD_010, PF9MD_011,
310 PF9MD_100, PF9MD_101, PF9MD_110, PF9MD_111,
311 PF8MD_00, PF8MD_01, PF8MD_10, PF8MD_11,
312 PF7MD_000, PF7MD_001, PF7MD_010, PF7MD_011,
313 PF7MD_100, PF7MD_101, PF7MD_110, PF7MD_111,
314 PF6MD_000, PF6MD_001, PF6MD_010, PF6MD_011,
315 PF6MD_100, PF6MD_101, PF6MD_110, PF6MD_111,
316 PF5MD_000, PF5MD_001, PF5MD_010, PF5MD_011,
317 PF5MD_100, PF5MD_101, PF5MD_110, PF5MD_111,
318 PF4MD_000, PF4MD_001, PF4MD_010, PF4MD_011,
319 PF4MD_100, PF4MD_101, PF4MD_110, PF4MD_111,
320 PF3MD_000, PF3MD_001, PF3MD_010, PF3MD_011,
321 PF3MD_100, PF3MD_101, PF3MD_110, PF3MD_111,
322 PF2MD_000, PF2MD_001, PF2MD_010, PF2MD_011,
323 PF2MD_100, PF2MD_101, PF2MD_110, PF2MD_111,
324 PF1MD_000, PF1MD_001, PF1MD_010, PF1MD_011,
325 PF1MD_100, PF1MD_101, PF1MD_110, PF1MD_111,
326 PF0MD_000, PF0MD_001, PF0MD_010, PF0MD_011,
327 PF0MD_100, PF0MD_101, PF0MD_110, PF0MD_111,
328
329 /* Port G */
330 PG24_IOR_IN, PG24_IOR_OUT,
331 PG23_IOR_IN, PG23_IOR_OUT,
332 PG22_IOR_IN, PG22_IOR_OUT,
333 PG21_IOR_IN, PG21_IOR_OUT,
334 PG20_IOR_IN, PG20_IOR_OUT,
335 PG19_IOR_IN, PG19_IOR_OUT,
336 PG18_IOR_IN, PG18_IOR_OUT,
337 PG17_IOR_IN, PG17_IOR_OUT,
338 PG16_IOR_IN, PG16_IOR_OUT,
339 PG15_IOR_IN, PG15_IOR_OUT,
340 PG14_IOR_IN, PG14_IOR_OUT,
341 PG13_IOR_IN, PG13_IOR_OUT,
342 PG12_IOR_IN, PG12_IOR_OUT,
343 PG11_IOR_IN, PG11_IOR_OUT,
344 PG10_IOR_IN, PG10_IOR_OUT,
345 PG9_IOR_IN, PG9_IOR_OUT,
346 PG8_IOR_IN, PG8_IOR_OUT,
347 PG7_IOR_IN, PG7_IOR_OUT,
348 PG6_IOR_IN, PG6_IOR_OUT,
349 PG5_IOR_IN, PG5_IOR_OUT,
350 PG4_IOR_IN, PG4_IOR_OUT,
351 PG3_IOR_IN, PG3_IOR_OUT,
352 PG2_IOR_IN, PG2_IOR_OUT,
353 PG1_IOR_IN, PG1_IOR_OUT,
354 PG0_IOR_IN, PG0_IOR_OUT,
355
356 PG24MD_00, PG24MD_01, PG24MD_10, PG24MD_11,
357 PG23MD_00, PG23MD_01, PG23MD_10, PG23MD_11,
358 PG22MD_00, PG22MD_01, PG22MD_10, PG22MD_11,
359 PG21MD_00, PG21MD_01, PG21MD_10, PG21MD_11,
360 PG20MD_000, PG20MD_001, PG20MD_010, PG20MD_011,
361 PG20MD_100, PG20MD_101, PG20MD_110, PG20MD_111,
362 PG19MD_000, PG19MD_001, PG19MD_010, PG19MD_011,
363 PG19MD_100, PG19MD_101, PG19MD_110, PG19MD_111,
364 PG18MD_000, PG18MD_001, PG18MD_010, PG18MD_011,
365 PG18MD_100, PG18MD_101, PG18MD_110, PG18MD_111,
366 PG17MD_000, PG17MD_001, PG17MD_010, PG17MD_011,
367 PG17MD_100, PG17MD_101, PG17MD_110, PG17MD_111,
368 PG16MD_000, PG16MD_001, PG16MD_010, PG16MD_011,
369 PG16MD_100, PG16MD_101, PG16MD_110, PG16MD_111,
370 PG15MD_000, PG15MD_001, PG15MD_010, PG15MD_011,
371 PG15MD_100, PG15MD_101, PG15MD_110, PG15MD_111,
372 PG14MD_000, PG14MD_001, PG14MD_010, PG14MD_011,
373 PG14MD_100, PG14MD_101, PG14MD_110, PG14MD_111,
374 PG13MD_000, PG13MD_001, PG13MD_010, PG13MD_011,
375 PG13MD_100, PG13MD_101, PG13MD_110, PG13MD_111,
376 PG12MD_000, PG12MD_001, PG12MD_010, PG12MD_011,
377 PG12MD_100, PG12MD_101, PG12MD_110, PG12MD_111,
378 PG11MD_000, PG11MD_001, PG11MD_010, PG11MD_011,
379 PG11MD_100, PG11MD_101, PG11MD_110, PG11MD_111,
380 PG10MD_000, PG10MD_001, PG10MD_010, PG10MD_011,
381 PG10MD_100, PG10MD_101, PG10MD_110, PG10MD_111,
382 PG9MD_000, PG9MD_001, PG9MD_010, PG9MD_011,
383 PG9MD_100, PG9MD_101, PG9MD_110, PG9MD_111,
384 PG8MD_000, PG8MD_001, PG8MD_010, PG8MD_011,
385 PG8MD_100, PG8MD_101, PG8MD_110, PG8MD_111,
386 PG7MD_00, PG7MD_01, PG7MD_10, PG7MD_11,
387 PG6MD_00, PG6MD_01, PG6MD_10, PG6MD_11,
388 PG5MD_00, PG5MD_01, PG5MD_10, PG5MD_11,
389 PG4MD_00, PG4MD_01, PG4MD_10, PG4MD_11,
390 PG3MD_00, PG3MD_01, PG3MD_10, PG3MD_11,
391 PG2MD_00, PG2MD_01, PG2MD_10, PG2MD_11,
392 PG1MD_00, PG1MD_01, PG1MD_10, PG1MD_11,
393 PG0MD_000, PG0MD_001, PG0MD_010, PG0MD_011,
394 PG0MD_100, PG0MD_101, PG0MD_110, PG0MD_111,
395
396 /* Port H */
397 PH7MD_0, PH7MD_1,
398 PH6MD_0, PH6MD_1,
399 PH5MD_0, PH5MD_1,
400 PH4MD_0, PH4MD_1,
401 PH3MD_0, PH3MD_1,
402 PH2MD_0, PH2MD_1,
403 PH1MD_0, PH1MD_1,
404 PH0MD_0, PH0MD_1,
405
406 /* Port I - not on device */
407
408 /* Port J */
409 PJ11_IOR_IN, PJ11_IOR_OUT,
410 PJ10_IOR_IN, PJ10_IOR_OUT,
411 PJ9_IOR_IN, PJ9_IOR_OUT,
412 PJ8_IOR_IN, PJ8_IOR_OUT,
413 PJ7_IOR_IN, PJ7_IOR_OUT,
414 PJ6_IOR_IN, PJ6_IOR_OUT,
415 PJ5_IOR_IN, PJ5_IOR_OUT,
416 PJ4_IOR_IN, PJ4_IOR_OUT,
417 PJ3_IOR_IN, PJ3_IOR_OUT,
418 PJ2_IOR_IN, PJ2_IOR_OUT,
419 PJ1_IOR_IN, PJ1_IOR_OUT,
420 PJ0_IOR_IN, PJ0_IOR_OUT,
421
422 PJ11MD_00, PJ11MD_01, PJ11MD_10, PJ11MD_11,
423 PJ10MD_00, PJ10MD_01, PJ10MD_10, PJ10MD_11,
424 PJ9MD_00, PJ9MD_01, PJ9MD_10, PJ9MD_11,
425 PJ8MD_00, PJ8MD_01, PJ8MD_10, PJ8MD_11,
426 PJ7MD_00, PJ7MD_01, PJ7MD_10, PJ7MD_11,
427 PJ6MD_00, PJ6MD_01, PJ6MD_10, PJ6MD_11,
428 PJ5MD_00, PJ5MD_01, PJ5MD_10, PJ5MD_11,
429 PJ4MD_00, PJ4MD_01, PJ4MD_10, PJ4MD_11,
430 PJ3MD_00, PJ3MD_01, PJ3MD_10, PJ3MD_11,
431 PJ2MD_000, PJ2MD_001, PJ2MD_010, PJ2MD_011,
432 PJ2MD_100, PJ2MD_101, PJ2MD_110, PJ2MD_111,
433 PJ1MD_000, PJ1MD_001, PJ1MD_010, PJ1MD_011,
434 PJ1MD_100, PJ1MD_101, PJ1MD_110, PJ1MD_111,
435 PJ0MD_000, PJ0MD_001, PJ0MD_010, PJ0MD_011,
436 PJ0MD_100, PJ0MD_101, PJ0MD_110, PJ0MD_111,
437
438 /* Port K */
439 PK11_IOR_IN, PK11_IOR_OUT,
440 PK10_IOR_IN, PK10_IOR_OUT,
441 PK9_IOR_IN, PK9_IOR_OUT,
442 PK8_IOR_IN, PK8_IOR_OUT,
443 PK7_IOR_IN, PK7_IOR_OUT,
444 PK6_IOR_IN, PK6_IOR_OUT,
445 PK5_IOR_IN, PK5_IOR_OUT,
446 PK4_IOR_IN, PK4_IOR_OUT,
447 PK3_IOR_IN, PK3_IOR_OUT,
448 PK2_IOR_IN, PK2_IOR_OUT,
449 PK1_IOR_IN, PK1_IOR_OUT,
450 PK0_IOR_IN, PK0_IOR_OUT,
451
452 PK11MD_00, PK11MD_01, PK11MD_10, PK11MD_11,
453 PK10MD_00, PK10MD_01, PK10MD_10, PK10MD_11,
454 PK9MD_00, PK9MD_01, PK9MD_10, PK9MD_11,
455 PK8MD_00, PK8MD_01, PK8MD_10, PK8MD_11,
456 PK7MD_00, PK7MD_01, PK7MD_10, PK7MD_11,
457 PK6MD_00, PK6MD_01, PK6MD_10, PK6MD_11,
458 PK5MD_00, PK5MD_01, PK5MD_10, PK5MD_11,
459 PK4MD_00, PK4MD_01, PK4MD_10, PK4MD_11,
460 PK3MD_00, PK3MD_01, PK3MD_10, PK3MD_11,
461 PK2MD_00, PK2MD_01, PK2MD_10, PK2MD_11,
462 PK1MD_00, PK1MD_01, PK1MD_10, PK1MD_11,
463 PK0MD_00, PK0MD_01, PK0MD_10, PK0MD_11,
464 PINMUX_FUNCTION_END,
465
466 PINMUX_MARK_BEGIN,
467 /* Port A */
468
469 /* Port B */
470
471 /* Port C */
472
473 /* Port D */
474
475 /* Port E */
476
477 /* Port F */
478
479 /* Port G */
480
481 /* Port H */
482 PHAN7_MARK, PHAN6_MARK, PHAN5_MARK, PHAN4_MARK,
483 PHAN3_MARK, PHAN2_MARK, PHAN1_MARK, PHAN0_MARK,
484
485 /* Port I - not on device */
486
487 /* Port J */
488
489 /* Port K */
490
491 IRQ7_PC_MARK, IRQ6_PC_MARK, IRQ5_PC_MARK, IRQ4_PC_MARK,
492 IRQ3_PG_MARK, IRQ2_PG_MARK, IRQ1_PJ_MARK, IRQ0_PJ_MARK,
493 IRQ3_PE_MARK, IRQ2_PE_MARK, IRQ1_PE_MARK, IRQ0_PE_MARK,
494
495 PINT7_PG_MARK, PINT6_PG_MARK, PINT5_PG_MARK, PINT4_PG_MARK,
496 PINT3_PG_MARK, PINT2_PG_MARK, PINT1_PG_MARK, PINT0_PG_MARK,
497
498 SD_CD_MARK, SD_D0_MARK, SD_D1_MARK, SD_D2_MARK, SD_D3_MARK,
499 SD_WP_MARK, SD_CLK_MARK, SD_CMD_MARK,
500 CRX0_MARK, CRX1_MARK,
501 CTX0_MARK, CTX1_MARK,
502
503 PWM1A_MARK, PWM1B_MARK, PWM1C_MARK, PWM1D_MARK,
504 PWM1E_MARK, PWM1F_MARK, PWM1G_MARK, PWM1H_MARK,
505 PWM2A_MARK, PWM2B_MARK, PWM2C_MARK, PWM2D_MARK,
506 PWM2E_MARK, PWM2F_MARK, PWM2G_MARK, PWM2H_MARK,
507 IERXD_MARK, IETXD_MARK,
508 CRX0CRX1_MARK,
509 WDTOVF_MARK,
510
511 CRX0X1_MARK,
512
513 /* DMAC */
514 TEND0_MARK, DACK0_MARK, DREQ0_MARK,
515 TEND1_MARK, DACK1_MARK, DREQ1_MARK,
516
517 /* ADC */
518 ADTRG_MARK,
519
520 /* BSC */
521 A25_MARK, A24_MARK,
522 A23_MARK, A22_MARK, A21_MARK, A20_MARK,
523 A19_MARK, A18_MARK, A17_MARK, A16_MARK,
524 A15_MARK, A14_MARK, A13_MARK, A12_MARK,
525 A11_MARK, A10_MARK, A9_MARK, A8_MARK,
526 A7_MARK, A6_MARK, A5_MARK, A4_MARK,
527 A3_MARK, A2_MARK, A1_MARK, A0_MARK,
528 D15_MARK, D14_MARK, D13_MARK, D12_MARK,
529 D11_MARK, D10_MARK, D9_MARK, D8_MARK,
530 D7_MARK, D6_MARK, D5_MARK, D4_MARK,
531 D3_MARK, D2_MARK, D1_MARK, D0_MARK,
532 BS_MARK,
533 CS4_MARK, CS3_MARK, CS2_MARK, CS1_MARK, CS0_MARK,
534 CS6CE1B_MARK, CS5CE1A_MARK,
535 CE2A_MARK, CE2B_MARK,
536 RD_MARK, RDWR_MARK,
537 ICIOWRAH_MARK,
538 ICIORD_MARK,
539 WE1DQMUWE_MARK,
540 WE0DQML_MARK,
541 RAS_MARK, CAS_MARK, CKE_MARK,
542 WAIT_MARK, BREQ_MARK, BACK_MARK, IOIS16_MARK,
543
544 /* TMU */
545 TIOC0A_MARK, TIOC0B_MARK, TIOC0C_MARK, TIOC0D_MARK,
546 TIOC1A_MARK, TIOC1B_MARK,
547 TIOC2A_MARK, TIOC2B_MARK,
548 TIOC3A_MARK, TIOC3B_MARK, TIOC3C_MARK, TIOC3D_MARK,
549 TIOC4A_MARK, TIOC4B_MARK, TIOC4C_MARK, TIOC4D_MARK,
550 TCLKA_MARK, TCLKB_MARK, TCLKC_MARK, TCLKD_MARK,
551
552 /* SCIF */
553 SCK0_MARK, SCK1_MARK, SCK2_MARK, SCK3_MARK,
554 RXD0_MARK, RXD1_MARK, RXD2_MARK, RXD3_MARK,
555 TXD0_MARK, TXD1_MARK, TXD2_MARK, TXD3_MARK,
556 RXD4_MARK, RXD5_MARK, RXD6_MARK, RXD7_MARK,
557 TXD4_MARK, TXD5_MARK, TXD6_MARK, TXD7_MARK,
558 RTS1_MARK, RTS3_MARK,
559 CTS1_MARK, CTS3_MARK,
560
561 /* RSPI */
562 RSPCK0_MARK, RSPCK1_MARK,
563 MOSI0_MARK, MOSI1_MARK,
564 MISO0_PF12_MARK, MISO1_MARK, MISO1_PG19_MARK,
565 SSL00_MARK, SSL10_MARK,
566
567 /* IIC3 */
568 SCL0_MARK, SCL1_MARK, SCL2_MARK,
569 SDA0_MARK, SDA1_MARK, SDA2_MARK,
570
571 /* SSI */
572 SSISCK0_MARK,
573 SSIWS0_MARK,
574 SSITXD0_MARK,
575 SSIRXD0_MARK,
576 SSIWS1_MARK, SSIWS2_MARK, SSIWS3_MARK,
577 SSISCK1_MARK, SSISCK2_MARK, SSISCK3_MARK,
578 SSIDATA1_MARK, SSIDATA2_MARK, SSIDATA3_MARK,
579 AUDIO_CLK_MARK,
580
581 /* SIOF */ /* NOTE Shares AUDIO_CLK with SSI */
582 SIOFTXD_MARK, SIOFRXD_MARK, SIOFSYNC_MARK, SIOFSCK_MARK,
583
584 /* SPDIF */ /* NOTE Shares AUDIO_CLK with SSI */
585 SPDIF_IN_MARK, SPDIF_OUT_MARK,
586
587 /* NANDFMC */ /* NOTE Controller is not available in boot mode 0 */
588 FCE_MARK,
589 FRB_MARK,
590
591 /* VDC3 */
592 DV_CLK_MARK,
593 DV_VSYNC_MARK, DV_HSYNC_MARK,
594 DV_DATA7_MARK, DV_DATA6_MARK, DV_DATA5_MARK, DV_DATA4_MARK,
595 DV_DATA3_MARK, DV_DATA2_MARK, DV_DATA1_MARK, DV_DATA0_MARK,
596 LCD_CLK_MARK, LCD_EXTCLK_MARK,
597 LCD_VSYNC_MARK, LCD_HSYNC_MARK, LCD_DE_MARK,
598 LCD_DATA15_MARK, LCD_DATA14_MARK, LCD_DATA13_MARK, LCD_DATA12_MARK,
599 LCD_DATA11_MARK, LCD_DATA10_MARK, LCD_DATA9_MARK, LCD_DATA8_MARK,
600 LCD_DATA7_MARK, LCD_DATA6_MARK, LCD_DATA5_MARK, LCD_DATA4_MARK,
601 LCD_DATA3_MARK, LCD_DATA2_MARK, LCD_DATA1_MARK, LCD_DATA0_MARK,
602 LCD_M_DISP_MARK,
603 PINMUX_MARK_END,
604};
605
606static pinmux_enum_t pinmux_data[] = {
607
608 /* Port A */
609 PINMUX_DATA(PA3_DATA, PA3_IN),
610 PINMUX_DATA(PA2_DATA, PA2_IN),
611 PINMUX_DATA(PA1_DATA, PA1_IN),
612 PINMUX_DATA(PA0_DATA, PA0_IN),
613
614 /* Port B */
615 PINMUX_DATA(PB22_DATA, PB22MD_00, PB22_IN, PB22_OUT),
616 PINMUX_DATA(A22_MARK, PB22MD_01),
617 PINMUX_DATA(CS4_MARK, PB22MD_10),
618
619 PINMUX_DATA(PB21_DATA, PB21MD_0, PB21_IN, PB21_OUT),
620 PINMUX_DATA(A21_MARK, PB21MD_1),
621 PINMUX_DATA(A20_MARK, PB20MD_1),
622 PINMUX_DATA(A19_MARK, PB19MD_01),
623 PINMUX_DATA(A18_MARK, PB18MD_01),
624 PINMUX_DATA(A17_MARK, PB17MD_01),
625 PINMUX_DATA(A16_MARK, PB16MD_01),
626 PINMUX_DATA(A15_MARK, PB15MD_01),
627 PINMUX_DATA(A14_MARK, PB14MD_01),
628 PINMUX_DATA(A13_MARK, PB13MD_01),
629 PINMUX_DATA(A12_MARK, PB12MD_01),
630 PINMUX_DATA(A11_MARK, PB11MD_01),
631 PINMUX_DATA(A10_MARK, PB10MD_01),
632 PINMUX_DATA(A9_MARK, PB9MD_01),
633 PINMUX_DATA(A8_MARK, PB8MD_01),
634 PINMUX_DATA(A7_MARK, PB7MD_01),
635 PINMUX_DATA(A6_MARK, PB6MD_01),
636 PINMUX_DATA(A5_MARK, PB5MD_01),
637 PINMUX_DATA(A4_MARK, PB4MD_01),
638 PINMUX_DATA(A3_MARK, PB3MD_1),
639 PINMUX_DATA(A2_MARK, PB2MD_1),
640 PINMUX_DATA(A1_MARK, PB1MD_1),
641
642 /* Port C */
643 PINMUX_DATA(PC10_DATA, PC10MD_0),
644 PINMUX_DATA(TIOC2B_MARK, PC1MD_1),
645 PINMUX_DATA(PC9_DATA, PC9MD_0),
646 PINMUX_DATA(TIOC2A_MARK, PC9MD_1),
647 PINMUX_DATA(PC8_DATA, PC8MD_00),
648 PINMUX_DATA(CS3_MARK, PC8MD_01),
649 PINMUX_DATA(TIOC4D_MARK, PC8MD_10),
650 PINMUX_DATA(IRQ7_PC_MARK, PC8MD_11),
651 PINMUX_DATA(PC7_DATA, PC7MD_00),
652 PINMUX_DATA(CKE_MARK, PC7MD_01),
653 PINMUX_DATA(TIOC4C_MARK, PC7MD_10),
654 PINMUX_DATA(IRQ6_PC_MARK, PC7MD_11),
655 PINMUX_DATA(PC6_DATA, PC6MD_00),
656 PINMUX_DATA(CAS_MARK, PC6MD_01),
657 PINMUX_DATA(TIOC4B_MARK, PC6MD_10),
658 PINMUX_DATA(IRQ5_PC_MARK, PC6MD_11),
659 PINMUX_DATA(PC5_DATA, PC5MD_00),
660 PINMUX_DATA(RAS_MARK, PC5MD_01),
661 PINMUX_DATA(TIOC4A_MARK, PC5MD_10),
662 PINMUX_DATA(IRQ4_PC_MARK, PC5MD_11),
663 PINMUX_DATA(PC4_DATA, PC4MD_0),
664 PINMUX_DATA(WE1DQMUWE_MARK, PC4MD_1),
665 PINMUX_DATA(PC3_DATA, PC3MD_0),
666 PINMUX_DATA(WE0DQML_MARK, PC3MD_1),
667 PINMUX_DATA(PC2_DATA, PC2MD_0),
668 PINMUX_DATA(RDWR_MARK, PC2MD_1),
669 PINMUX_DATA(PC1_DATA, PC1MD_0),
670 PINMUX_DATA(RD_MARK, PC1MD_1),
671 PINMUX_DATA(PC0_DATA, PC0MD_0),
672 PINMUX_DATA(CS0_MARK, PC0MD_1),
673
674 /* Port D */
675 PINMUX_DATA(D15_MARK, PD15MD_01),
676 PINMUX_DATA(D14_MARK, PD14MD_01),
677 PINMUX_DATA(D13_MARK, PD13MD_01),
678 PINMUX_DATA(D12_MARK, PD12MD_01),
679 PINMUX_DATA(D11_MARK, PD11MD_01),
680 PINMUX_DATA(D10_MARK, PD10MD_01),
681 PINMUX_DATA(D9_MARK, PD9MD_01),
682 PINMUX_DATA(D8_MARK, PD8MD_01),
683 PINMUX_DATA(D7_MARK, PD7MD_01),
684 PINMUX_DATA(D6_MARK, PD6MD_01),
685 PINMUX_DATA(D5_MARK, PD5MD_01),
686 PINMUX_DATA(D4_MARK, PD4MD_01),
687 PINMUX_DATA(D3_MARK, PD3MD_01),
688 PINMUX_DATA(D2_MARK, PD2MD_01),
689 PINMUX_DATA(D1_MARK, PD1MD_01),
690 PINMUX_DATA(D0_MARK, PD0MD_01),
691
692 /* Port E */
693 PINMUX_DATA(PE5_DATA, PE5MD_00),
694 PINMUX_DATA(SDA2_MARK, PE5MD_01),
695 PINMUX_DATA(DV_HSYNC_MARK, PE5MD_11),
696
697 PINMUX_DATA(PE4_DATA, PE4MD_00),
698 PINMUX_DATA(SCL2_MARK, PE4MD_01),
699 PINMUX_DATA(DV_VSYNC_MARK, PE4MD_11),
700
701 PINMUX_DATA(PE3_DATA, PE3MD_00),
702 PINMUX_DATA(SDA1_MARK, PE3MD_01),
703 PINMUX_DATA(IRQ3_PE_MARK, PE3MD_11),
704
705 PINMUX_DATA(PE2_DATA, PE2MD_00),
706 PINMUX_DATA(SCL1_MARK, PE2MD_01),
707 PINMUX_DATA(IRQ2_PE_MARK, PE2MD_11),
708
709 PINMUX_DATA(PE1_DATA, PE1MD_000),
710 PINMUX_DATA(SDA0_MARK, PE1MD_001),
711 PINMUX_DATA(IOIS16_MARK, PE1MD_010),
712 PINMUX_DATA(IRQ1_PE_MARK, PE1MD_011),
713 PINMUX_DATA(TCLKA_MARK, PE1MD_100),
714 PINMUX_DATA(ADTRG_MARK, PE1MD_101),
715
716 PINMUX_DATA(PE0_DATA, PE0MD_00),
717 PINMUX_DATA(SCL0_MARK, PE0MD_01),
718 PINMUX_DATA(AUDIO_CLK_MARK, PE0MD_10),
719 PINMUX_DATA(IRQ0_PE_MARK, PE0MD_11),
720
721 /* Port F */
722 PINMUX_DATA(PF12_DATA, PF12MD_000),
723 PINMUX_DATA(BS_MARK, PF12MD_001),
724 PINMUX_DATA(MISO0_PF12_MARK, PF12MD_011),
725 PINMUX_DATA(TIOC3D_MARK, PF12MD_100),
726 PINMUX_DATA(SPDIF_OUT_MARK, PF12MD_101),
727
728 PINMUX_DATA(PF11_DATA, PF11MD_000),
729 PINMUX_DATA(A25_MARK, PF11MD_001),
730 PINMUX_DATA(SSIDATA3_MARK, PF11MD_010),
731 PINMUX_DATA(MOSI0_MARK, PF11MD_011),
732 PINMUX_DATA(TIOC3C_MARK, PF11MD_100),
733 PINMUX_DATA(SPDIF_IN_MARK, PF11MD_101),
734
735 PINMUX_DATA(PF10_DATA, PF10MD_000),
736 PINMUX_DATA(A24_MARK, PF10MD_001),
737 PINMUX_DATA(SSIWS3_MARK, PF10MD_010),
738 PINMUX_DATA(SSL00_MARK, PF10MD_011),
739 PINMUX_DATA(TIOC3B_MARK, PF10MD_100),
740 PINMUX_DATA(FCE_MARK, PF10MD_101),
741
742 PINMUX_DATA(PF9_DATA, PF9MD_000),
743 PINMUX_DATA(A23_MARK, PF9MD_001),
744 PINMUX_DATA(SSISCK3_MARK, PF9MD_010),
745 PINMUX_DATA(RSPCK0_MARK, PF9MD_011),
746 PINMUX_DATA(TIOC3A_MARK, PF9MD_100),
747 PINMUX_DATA(FRB_MARK, PF9MD_101),
748
749 PINMUX_DATA(PF8_DATA, PF8MD_00),
750 PINMUX_DATA(CE2B_MARK, PF8MD_01),
751 PINMUX_DATA(SSIDATA3_MARK, PF8MD_10),
752 PINMUX_DATA(DV_CLK_MARK, PF8MD_11),
753
754 PINMUX_DATA(PF7_DATA, PF7MD_000),
755 PINMUX_DATA(CE2A_MARK, PF7MD_001),
756 PINMUX_DATA(SSIWS3_MARK, PF7MD_010),
757 PINMUX_DATA(DV_DATA7_MARK, PF7MD_011),
758 PINMUX_DATA(TCLKD_MARK, PF7MD_100),
759
760 PINMUX_DATA(PF6_DATA, PF6MD_000),
761 PINMUX_DATA(CS6CE1B_MARK, PF6MD_001),
762 PINMUX_DATA(SSISCK3_MARK, PF6MD_010),
763 PINMUX_DATA(DV_DATA6_MARK, PF6MD_011),
764 PINMUX_DATA(TCLKB_MARK, PF6MD_100),
765
766 PINMUX_DATA(PF5_DATA, PF5MD_000),
767 PINMUX_DATA(CS5CE1A_MARK, PF5MD_001),
768 PINMUX_DATA(SSIDATA2_MARK, PF5MD_010),
769 PINMUX_DATA(DV_DATA5_MARK, PF5MD_011),
770 PINMUX_DATA(TCLKC_MARK, PF5MD_100),
771
772 PINMUX_DATA(PF4_DATA, PF4MD_000),
773 PINMUX_DATA(ICIOWRAH_MARK, PF4MD_001),
774 PINMUX_DATA(SSIWS2_MARK, PF4MD_010),
775 PINMUX_DATA(DV_DATA4_MARK, PF4MD_011),
776 PINMUX_DATA(TXD3_MARK, PF4MD_100),
777
778 PINMUX_DATA(PF3_DATA, PF3MD_000),
779 PINMUX_DATA(ICIORD_MARK, PF3MD_001),
780 PINMUX_DATA(SSISCK2_MARK, PF3MD_010),
781 PINMUX_DATA(DV_DATA3_MARK, PF3MD_011),
782 PINMUX_DATA(RXD3_MARK, PF3MD_100),
783
784 PINMUX_DATA(PF2_DATA, PF2MD_000),
785 PINMUX_DATA(BACK_MARK, PF2MD_001),
786 PINMUX_DATA(SSIDATA1_MARK, PF2MD_010),
787 PINMUX_DATA(DV_DATA2_MARK, PF2MD_011),
788 PINMUX_DATA(TXD2_MARK, PF2MD_100),
789 PINMUX_DATA(DACK0_MARK, PF2MD_101),
790
791 PINMUX_DATA(PF1_DATA, PF1MD_000),
792 PINMUX_DATA(BREQ_MARK, PF1MD_001),
793 PINMUX_DATA(SSIWS1_MARK, PF1MD_010),
794 PINMUX_DATA(DV_DATA1_MARK, PF1MD_011),
795 PINMUX_DATA(RXD2_MARK, PF1MD_100),
796 PINMUX_DATA(DREQ0_MARK, PF1MD_101),
797
798 PINMUX_DATA(PF0_DATA, PF0MD_000),
799 PINMUX_DATA(WAIT_MARK, PF0MD_001),
800 PINMUX_DATA(SSISCK1_MARK, PF0MD_010),
801 PINMUX_DATA(DV_DATA0_MARK, PF0MD_011),
802 PINMUX_DATA(SCK2_MARK, PF0MD_100),
803 PINMUX_DATA(TEND0_MARK, PF0MD_101),
804
805 /* Port G */
806 PINMUX_DATA(PG24_DATA, PG24MD_00),
807 PINMUX_DATA(MOSI0_MARK, PG24MD_01),
808 PINMUX_DATA(TIOC0D_MARK, PG24MD_10),
809
810 PINMUX_DATA(PG23_DATA, PG23MD_00),
811 PINMUX_DATA(MOSI1_MARK, PG23MD_01),
812 PINMUX_DATA(TIOC0C_MARK, PG23MD_10),
813
814 PINMUX_DATA(PG22_DATA, PG22MD_00),
815 PINMUX_DATA(SSL10_MARK, PG22MD_01),
816 PINMUX_DATA(TIOC0B_MARK, PG22MD_10),
817
818 PINMUX_DATA(PG21_DATA, PG21MD_00),
819 PINMUX_DATA(RSPCK1_MARK, PG21MD_01),
820 PINMUX_DATA(TIOC0A_MARK, PG21MD_10),
821
822 PINMUX_DATA(PG20_DATA, PG20MD_000),
823 PINMUX_DATA(LCD_EXTCLK_MARK, PG20MD_001),
824 PINMUX_DATA(MISO1_MARK, PG20MD_011),
825 PINMUX_DATA(TXD7_MARK, PG20MD_100),
826
827 PINMUX_DATA(PG19_DATA, PG19MD_000),
828 PINMUX_DATA(LCD_CLK_MARK, PG19MD_001),
829 PINMUX_DATA(TIOC2B_MARK, PG19MD_010),
830 PINMUX_DATA(MISO1_PG19_MARK, PG19MD_011),
831 PINMUX_DATA(RXD7_MARK, PG19MD_100),
832
833 PINMUX_DATA(PG18_DATA, PG18MD_000),
834 PINMUX_DATA(LCD_DE_MARK, PG18MD_001),
835 PINMUX_DATA(TIOC2A_MARK, PG18MD_010),
836 PINMUX_DATA(SSL10_MARK, PG18MD_011),
837 PINMUX_DATA(TXD6_MARK, PG18MD_100),
838
839 PINMUX_DATA(PG17_DATA, PG17MD_000),
840 PINMUX_DATA(LCD_HSYNC_MARK, PG17MD_001),
841 PINMUX_DATA(TIOC1B_MARK, PG17MD_010),
842 PINMUX_DATA(RSPCK1_MARK, PG17MD_011),
843 PINMUX_DATA(RXD6_MARK, PG17MD_100),
844
845 PINMUX_DATA(PG16_DATA, PG16MD_000),
846 PINMUX_DATA(LCD_VSYNC_MARK, PG16MD_001),
847 PINMUX_DATA(TIOC1A_MARK, PG16MD_010),
848 PINMUX_DATA(TXD3_MARK, PG16MD_011),
849 PINMUX_DATA(CTS1_MARK, PG16MD_100),
850
851 PINMUX_DATA(PG15_DATA, PG15MD_000),
852 PINMUX_DATA(LCD_DATA15_MARK, PG15MD_001),
853 PINMUX_DATA(TIOC0D_MARK, PG15MD_010),
854 PINMUX_DATA(RXD3_MARK, PG15MD_011),
855 PINMUX_DATA(RTS1_MARK, PG15MD_100),
856
857 PINMUX_DATA(PG14_DATA, PG14MD_000),
858 PINMUX_DATA(LCD_DATA14_MARK, PG14MD_001),
859 PINMUX_DATA(TIOC0C_MARK, PG14MD_010),
860 PINMUX_DATA(SCK1_MARK, PG14MD_100),
861
862 PINMUX_DATA(PG13_DATA, PG13MD_000),
863 PINMUX_DATA(LCD_DATA13_MARK, PG13MD_001),
864 PINMUX_DATA(TIOC0B_MARK, PG13MD_010),
865 PINMUX_DATA(TXD1_MARK, PG13MD_100),
866
867 PINMUX_DATA(PG12_DATA, PG12MD_000),
868 PINMUX_DATA(LCD_DATA12_MARK, PG12MD_001),
869 PINMUX_DATA(TIOC0A_MARK, PG12MD_010),
870 PINMUX_DATA(RXD1_MARK, PG12MD_100),
871
872 PINMUX_DATA(PG11_DATA, PG11MD_000),
873 PINMUX_DATA(LCD_DATA11_MARK, PG11MD_001),
874 PINMUX_DATA(SSITXD0_MARK, PG11MD_010),
875 PINMUX_DATA(IRQ3_PG_MARK, PG11MD_011),
876 PINMUX_DATA(TXD5_MARK, PG11MD_100),
877 PINMUX_DATA(SIOFTXD_MARK, PG11MD_101),
878
879 PINMUX_DATA(PG10_DATA, PG10MD_000),
880 PINMUX_DATA(LCD_DATA10_MARK, PG10MD_001),
881 PINMUX_DATA(SSIRXD0_MARK, PG10MD_010),
882 PINMUX_DATA(IRQ2_PG_MARK, PG10MD_011),
883 PINMUX_DATA(RXD5_MARK, PG10MD_100),
884 PINMUX_DATA(SIOFRXD_MARK, PG10MD_101),
885
886 PINMUX_DATA(PG9_DATA, PG9MD_000),
887 PINMUX_DATA(LCD_DATA9_MARK, PG9MD_001),
888 PINMUX_DATA(SSIWS0_MARK, PG9MD_010),
889 PINMUX_DATA(TXD4_MARK, PG9MD_100),
890 PINMUX_DATA(SIOFSYNC_MARK, PG9MD_101),
891
892 PINMUX_DATA(PG8_DATA, PG8MD_000),
893 PINMUX_DATA(LCD_DATA8_MARK, PG8MD_001),
894 PINMUX_DATA(SSISCK0_MARK, PG8MD_010),
895 PINMUX_DATA(RXD4_MARK, PG8MD_100),
896 PINMUX_DATA(SIOFSCK_MARK, PG8MD_101),
897
898 PINMUX_DATA(PG7_DATA, PG7MD_00),
899 PINMUX_DATA(LCD_DATA7_MARK, PG7MD_01),
900 PINMUX_DATA(SD_CD_MARK, PG7MD_10),
901 PINMUX_DATA(PINT7_PG_MARK, PG7MD_11),
902
903 PINMUX_DATA(PG6_DATA, PG7MD_00),
904 PINMUX_DATA(LCD_DATA6_MARK, PG7MD_01),
905 PINMUX_DATA(SD_WP_MARK, PG7MD_10),
906 PINMUX_DATA(PINT6_PG_MARK, PG7MD_11),
907
908 PINMUX_DATA(PG5_DATA, PG5MD_00),
909 PINMUX_DATA(LCD_DATA5_MARK, PG5MD_01),
910 PINMUX_DATA(SD_D1_MARK, PG5MD_10),
911 PINMUX_DATA(PINT5_PG_MARK, PG5MD_11),
912
913 PINMUX_DATA(PG4_DATA, PG4MD_00),
914 PINMUX_DATA(LCD_DATA4_MARK, PG4MD_01),
915 PINMUX_DATA(SD_D0_MARK, PG4MD_10),
916 PINMUX_DATA(PINT4_PG_MARK, PG4MD_11),
917
918 PINMUX_DATA(PG3_DATA, PG3MD_00),
919 PINMUX_DATA(LCD_DATA3_MARK, PG3MD_01),
920 PINMUX_DATA(SD_CLK_MARK, PG3MD_10),
921 PINMUX_DATA(PINT3_PG_MARK, PG3MD_11),
922
923 PINMUX_DATA(PG2_DATA, PG2MD_00),
924 PINMUX_DATA(LCD_DATA2_MARK, PG2MD_01),
925 PINMUX_DATA(SD_CMD_MARK, PG2MD_10),
926 PINMUX_DATA(PINT2_PG_MARK, PG2MD_11),
927
928 PINMUX_DATA(PG1_DATA, PG1MD_00),
929 PINMUX_DATA(LCD_DATA1_MARK, PG1MD_01),
930 PINMUX_DATA(SD_D3_MARK, PG1MD_10),
931 PINMUX_DATA(PINT1_PG_MARK, PG1MD_11),
932
933 PINMUX_DATA(PG0_DATA, PG0MD_000),
934 PINMUX_DATA(LCD_DATA0_MARK, PG0MD_001),
935 PINMUX_DATA(SD_D2_MARK, PG0MD_010),
936 PINMUX_DATA(PINT0_PG_MARK, PG0MD_011),
937 PINMUX_DATA(WDTOVF_MARK, PG0MD_100),
938
939 /* Port H */
940 PINMUX_DATA(PH7_DATA, PH7MD_0),
941 PINMUX_DATA(PHAN7_MARK, PH7MD_1),
942
943 PINMUX_DATA(PH6_DATA, PH6MD_0),
944 PINMUX_DATA(PHAN6_MARK, PH6MD_1),
945
946 PINMUX_DATA(PH5_DATA, PH5MD_0),
947 PINMUX_DATA(PHAN5_MARK, PH5MD_1),
948
949 PINMUX_DATA(PH4_DATA, PH4MD_0),
950 PINMUX_DATA(PHAN4_MARK, PH4MD_1),
951
952 PINMUX_DATA(PH3_DATA, PH3MD_0),
953 PINMUX_DATA(PHAN3_MARK, PH3MD_1),
954
955 PINMUX_DATA(PH2_DATA, PH2MD_0),
956 PINMUX_DATA(PHAN2_MARK, PH2MD_1),
957
958 PINMUX_DATA(PH1_DATA, PH1MD_0),
959 PINMUX_DATA(PHAN1_MARK, PH1MD_1),
960
961 PINMUX_DATA(PH0_DATA, PH0MD_0),
962 PINMUX_DATA(PHAN0_MARK, PH0MD_1),
963
964 /* Port I - not on device */
965
966 /* Port J */
967 PINMUX_DATA(PJ11_DATA, PJ11MD_00),
968 PINMUX_DATA(PWM2H_MARK, PJ11MD_01),
969 PINMUX_DATA(DACK1_MARK, PJ11MD_10),
970
971 PINMUX_DATA(PJ10_DATA, PJ10MD_00),
972 PINMUX_DATA(PWM2G_MARK, PJ10MD_01),
973 PINMUX_DATA(DREQ1_MARK, PJ10MD_10),
974
975 PINMUX_DATA(PJ9_DATA, PJ9MD_00),
976 PINMUX_DATA(PWM2F_MARK, PJ9MD_01),
977 PINMUX_DATA(TEND1_MARK, PJ9MD_10),
978
979 PINMUX_DATA(PJ8_DATA, PJ8MD_00),
980 PINMUX_DATA(PWM2E_MARK, PJ8MD_01),
981 PINMUX_DATA(RTS3_MARK, PJ8MD_10),
982
983 PINMUX_DATA(PJ7_DATA, PJ7MD_00),
984 PINMUX_DATA(TIOC1B_MARK, PJ7MD_01),
985 PINMUX_DATA(CTS3_MARK, PJ7MD_10),
986
987 PINMUX_DATA(PJ6_DATA, PJ6MD_00),
988 PINMUX_DATA(TIOC1A_MARK, PJ6MD_01),
989 PINMUX_DATA(SCK3_MARK, PJ6MD_10),
990
991 PINMUX_DATA(PJ5_DATA, PJ5MD_00),
992 PINMUX_DATA(IERXD_MARK, PJ5MD_01),
993 PINMUX_DATA(TXD3_MARK, PJ5MD_10),
994
995 PINMUX_DATA(PJ4_DATA, PJ4MD_00),
996 PINMUX_DATA(IETXD_MARK, PJ4MD_01),
997 PINMUX_DATA(RXD3_MARK, PJ4MD_10),
998
999 PINMUX_DATA(PJ3_DATA, PJ3MD_00),
1000 PINMUX_DATA(CRX1_MARK, PJ3MD_01),
1001 PINMUX_DATA(CRX0X1_MARK, PJ3MD_10),
1002 PINMUX_DATA(IRQ1_PJ_MARK, PJ3MD_11),
1003
1004 PINMUX_DATA(PJ2_DATA, PJ2MD_000),
1005 PINMUX_DATA(CTX1_MARK, PJ2MD_001),
1006 PINMUX_DATA(CRX0CRX1_MARK, PJ2MD_010),
1007 PINMUX_DATA(CS2_MARK, PJ2MD_011),
1008 PINMUX_DATA(SCK0_MARK, PJ2MD_100),
1009 PINMUX_DATA(LCD_M_DISP_MARK, PJ2MD_101),
1010
1011 PINMUX_DATA(PJ1_DATA, PJ1MD_000),
1012 PINMUX_DATA(CRX0_MARK, PJ1MD_001),
1013 PINMUX_DATA(IERXD_MARK, PJ1MD_010),
1014 PINMUX_DATA(IRQ0_PJ_MARK, PJ1MD_011),
1015 PINMUX_DATA(RXD0_MARK, PJ1MD_100),
1016
1017 PINMUX_DATA(PJ0_DATA, PJ0MD_000),
1018 PINMUX_DATA(CTX0_MARK, PJ0MD_001),
1019 PINMUX_DATA(IERXD_MARK, PJ0MD_010),
1020 PINMUX_DATA(CS1_MARK, PJ0MD_011),
1021 PINMUX_DATA(TXD0_MARK, PJ0MD_100),
1022 PINMUX_DATA(A0_MARK, PJ0MD_101),
1023
1024 /* Port K */
1025 PINMUX_DATA(PK11_DATA, PK11MD_00),
1026 PINMUX_DATA(PWM2D_MARK, PK11MD_01),
1027 PINMUX_DATA(SSITXD0_MARK, PK11MD_10),
1028
1029 PINMUX_DATA(PK10_DATA, PK10MD_00),
1030 PINMUX_DATA(PWM2C_MARK, PK10MD_01),
1031 PINMUX_DATA(SSIRXD0_MARK, PK10MD_10),
1032
1033 PINMUX_DATA(PK9_DATA, PK9MD_00),
1034 PINMUX_DATA(PWM2B_MARK, PK9MD_01),
1035 PINMUX_DATA(SSIWS0_MARK, PK9MD_10),
1036
1037 PINMUX_DATA(PK8_DATA, PK8MD_00),
1038 PINMUX_DATA(PWM2A_MARK, PK8MD_01),
1039 PINMUX_DATA(SSISCK0_MARK, PK8MD_10),
1040
1041 PINMUX_DATA(PK7_DATA, PK7MD_00),
1042 PINMUX_DATA(PWM1H_MARK, PK7MD_01),
1043 PINMUX_DATA(SD_CD_MARK, PK7MD_10),
1044
1045 PINMUX_DATA(PK6_DATA, PK6MD_00),
1046 PINMUX_DATA(PWM1G_MARK, PK6MD_01),
1047 PINMUX_DATA(SD_WP_MARK, PK6MD_10),
1048
1049 PINMUX_DATA(PK5_DATA, PK5MD_00),
1050 PINMUX_DATA(PWM1F_MARK, PK5MD_01),
1051 PINMUX_DATA(SD_D1_MARK, PK5MD_10),
1052
1053 PINMUX_DATA(PK4_DATA, PK4MD_00),
1054 PINMUX_DATA(PWM1E_MARK, PK4MD_01),
1055 PINMUX_DATA(SD_D0_MARK, PK4MD_10),
1056
1057 PINMUX_DATA(PK3_DATA, PK3MD_00),
1058 PINMUX_DATA(PWM1D_MARK, PK3MD_01),
1059 PINMUX_DATA(SD_CLK_MARK, PK3MD_10),
1060
1061 PINMUX_DATA(PK2_DATA, PK2MD_00),
1062 PINMUX_DATA(PWM1C_MARK, PK2MD_01),
1063 PINMUX_DATA(SD_CMD_MARK, PK2MD_10),
1064
1065 PINMUX_DATA(PK1_DATA, PK1MD_00),
1066 PINMUX_DATA(PWM1B_MARK, PK1MD_01),
1067 PINMUX_DATA(SD_D3_MARK, PK1MD_10),
1068
1069 PINMUX_DATA(PK0_DATA, PK0MD_00),
1070 PINMUX_DATA(PWM1A_MARK, PK0MD_01),
1071 PINMUX_DATA(SD_D2_MARK, PK0MD_10),
1072};
1073
1074static struct pinmux_gpio pinmux_gpios[] = {
1075
1076 /* Port A */
1077 PINMUX_GPIO(GPIO_PA3, PA3_DATA),
1078 PINMUX_GPIO(GPIO_PA2, PA2_DATA),
1079 PINMUX_GPIO(GPIO_PA1, PA1_DATA),
1080 PINMUX_GPIO(GPIO_PA0, PA0_DATA),
1081
1082 /* Port B */
1083 PINMUX_GPIO(GPIO_PB22, PB22_DATA),
1084 PINMUX_GPIO(GPIO_PB21, PB21_DATA),
1085 PINMUX_GPIO(GPIO_PB20, PB20_DATA),
1086 PINMUX_GPIO(GPIO_PB19, PB19_DATA),
1087 PINMUX_GPIO(GPIO_PB18, PB18_DATA),
1088 PINMUX_GPIO(GPIO_PB17, PB17_DATA),
1089 PINMUX_GPIO(GPIO_PB16, PB16_DATA),
1090 PINMUX_GPIO(GPIO_PB15, PB15_DATA),
1091 PINMUX_GPIO(GPIO_PB14, PB14_DATA),
1092 PINMUX_GPIO(GPIO_PB13, PB13_DATA),
1093 PINMUX_GPIO(GPIO_PB12, PB12_DATA),
1094 PINMUX_GPIO(GPIO_PB11, PB11_DATA),
1095 PINMUX_GPIO(GPIO_PB10, PB10_DATA),
1096 PINMUX_GPIO(GPIO_PB9, PB9_DATA),
1097 PINMUX_GPIO(GPIO_PB8, PB8_DATA),
1098 PINMUX_GPIO(GPIO_PB7, PB7_DATA),
1099 PINMUX_GPIO(GPIO_PB6, PB6_DATA),
1100 PINMUX_GPIO(GPIO_PB5, PB5_DATA),
1101 PINMUX_GPIO(GPIO_PB4, PB4_DATA),
1102 PINMUX_GPIO(GPIO_PB3, PB3_DATA),
1103 PINMUX_GPIO(GPIO_PB2, PB2_DATA),
1104 PINMUX_GPIO(GPIO_PB1, PB1_DATA),
1105
1106 /* Port C */
1107 PINMUX_GPIO(GPIO_PC10, PC10_DATA),
1108 PINMUX_GPIO(GPIO_PC9, PC9_DATA),
1109 PINMUX_GPIO(GPIO_PC8, PC8_DATA),
1110 PINMUX_GPIO(GPIO_PC7, PC7_DATA),
1111 PINMUX_GPIO(GPIO_PC6, PC6_DATA),
1112 PINMUX_GPIO(GPIO_PC5, PC5_DATA),
1113 PINMUX_GPIO(GPIO_PC4, PC4_DATA),
1114 PINMUX_GPIO(GPIO_PC3, PC3_DATA),
1115 PINMUX_GPIO(GPIO_PC2, PC2_DATA),
1116 PINMUX_GPIO(GPIO_PC1, PC1_DATA),
1117 PINMUX_GPIO(GPIO_PC0, PC0_DATA),
1118
1119 /* Port D */
1120 PINMUX_GPIO(GPIO_PD15, PD15_DATA),
1121 PINMUX_GPIO(GPIO_PD14, PD14_DATA),
1122 PINMUX_GPIO(GPIO_PD13, PD13_DATA),
1123 PINMUX_GPIO(GPIO_PD12, PD12_DATA),
1124 PINMUX_GPIO(GPIO_PD11, PD11_DATA),
1125 PINMUX_GPIO(GPIO_PD10, PD10_DATA),
1126 PINMUX_GPIO(GPIO_PD9, PD9_DATA),
1127 PINMUX_GPIO(GPIO_PD8, PD8_DATA),
1128 PINMUX_GPIO(GPIO_PD7, PD7_DATA),
1129 PINMUX_GPIO(GPIO_PD6, PD6_DATA),
1130 PINMUX_GPIO(GPIO_PD5, PD5_DATA),
1131 PINMUX_GPIO(GPIO_PD4, PD4_DATA),
1132 PINMUX_GPIO(GPIO_PD3, PD3_DATA),
1133 PINMUX_GPIO(GPIO_PD2, PD2_DATA),
1134 PINMUX_GPIO(GPIO_PD1, PD1_DATA),
1135 PINMUX_GPIO(GPIO_PD0, PD0_DATA),
1136
1137 /* Port E */
1138 PINMUX_GPIO(GPIO_PE5, PE5_DATA),
1139 PINMUX_GPIO(GPIO_PE4, PE4_DATA),
1140 PINMUX_GPIO(GPIO_PE3, PE3_DATA),
1141 PINMUX_GPIO(GPIO_PE2, PE2_DATA),
1142 PINMUX_GPIO(GPIO_PE1, PE1_DATA),
1143 PINMUX_GPIO(GPIO_PE0, PE0_DATA),
1144
1145 /* Port F */
1146 PINMUX_GPIO(GPIO_PF12, PF12_DATA),
1147 PINMUX_GPIO(GPIO_PF11, PF11_DATA),
1148 PINMUX_GPIO(GPIO_PF10, PF10_DATA),
1149 PINMUX_GPIO(GPIO_PF9, PF9_DATA),
1150 PINMUX_GPIO(GPIO_PF8, PF8_DATA),
1151 PINMUX_GPIO(GPIO_PF7, PF7_DATA),
1152 PINMUX_GPIO(GPIO_PF6, PF6_DATA),
1153 PINMUX_GPIO(GPIO_PF5, PF5_DATA),
1154 PINMUX_GPIO(GPIO_PF4, PF4_DATA),
1155 PINMUX_GPIO(GPIO_PF3, PF3_DATA),
1156 PINMUX_GPIO(GPIO_PF2, PF2_DATA),
1157 PINMUX_GPIO(GPIO_PF1, PF1_DATA),
1158 PINMUX_GPIO(GPIO_PF0, PF0_DATA),
1159
1160 /* Port G */
1161 PINMUX_GPIO(GPIO_PG24, PG24_DATA),
1162 PINMUX_GPIO(GPIO_PG23, PG23_DATA),
1163 PINMUX_GPIO(GPIO_PG22, PG22_DATA),
1164 PINMUX_GPIO(GPIO_PG21, PG21_DATA),
1165 PINMUX_GPIO(GPIO_PG20, PG20_DATA),
1166 PINMUX_GPIO(GPIO_PG19, PG19_DATA),
1167 PINMUX_GPIO(GPIO_PG18, PG18_DATA),
1168 PINMUX_GPIO(GPIO_PG17, PG17_DATA),
1169 PINMUX_GPIO(GPIO_PG16, PG16_DATA),
1170 PINMUX_GPIO(GPIO_PG15, PG15_DATA),
1171 PINMUX_GPIO(GPIO_PG14, PG14_DATA),
1172 PINMUX_GPIO(GPIO_PG13, PG13_DATA),
1173 PINMUX_GPIO(GPIO_PG12, PG12_DATA),
1174 PINMUX_GPIO(GPIO_PG11, PG11_DATA),
1175 PINMUX_GPIO(GPIO_PG10, PG10_DATA),
1176 PINMUX_GPIO(GPIO_PG9, PG9_DATA),
1177 PINMUX_GPIO(GPIO_PG8, PG8_DATA),
1178 PINMUX_GPIO(GPIO_PG7, PG7_DATA),
1179 PINMUX_GPIO(GPIO_PG6, PG6_DATA),
1180 PINMUX_GPIO(GPIO_PG5, PG5_DATA),
1181 PINMUX_GPIO(GPIO_PG4, PG4_DATA),
1182 PINMUX_GPIO(GPIO_PG3, PG3_DATA),
1183 PINMUX_GPIO(GPIO_PG2, PG2_DATA),
1184 PINMUX_GPIO(GPIO_PG1, PG1_DATA),
1185 PINMUX_GPIO(GPIO_PG0, PG0_DATA),
1186
1187 /* Port H - Port H does not have a Data Register */
1188
1189 /* Port I - not on device */
1190
1191 /* Port J */
1192 PINMUX_GPIO(GPIO_PJ11, PJ11_DATA),
1193 PINMUX_GPIO(GPIO_PJ10, PJ10_DATA),
1194 PINMUX_GPIO(GPIO_PJ9, PJ9_DATA),
1195 PINMUX_GPIO(GPIO_PJ8, PJ8_DATA),
1196 PINMUX_GPIO(GPIO_PJ7, PJ7_DATA),
1197 PINMUX_GPIO(GPIO_PJ6, PJ6_DATA),
1198 PINMUX_GPIO(GPIO_PJ5, PJ5_DATA),
1199 PINMUX_GPIO(GPIO_PJ4, PJ4_DATA),
1200 PINMUX_GPIO(GPIO_PJ3, PJ3_DATA),
1201 PINMUX_GPIO(GPIO_PJ2, PJ2_DATA),
1202 PINMUX_GPIO(GPIO_PJ1, PJ1_DATA),
1203 PINMUX_GPIO(GPIO_PJ0, PJ0_DATA),
1204
1205 /* Port K */
1206 PINMUX_GPIO(GPIO_PK11, PK11_DATA),
1207 PINMUX_GPIO(GPIO_PK10, PK10_DATA),
1208 PINMUX_GPIO(GPIO_PK9, PK9_DATA),
1209 PINMUX_GPIO(GPIO_PK8, PK8_DATA),
1210 PINMUX_GPIO(GPIO_PK7, PK7_DATA),
1211 PINMUX_GPIO(GPIO_PK6, PK6_DATA),
1212 PINMUX_GPIO(GPIO_PK5, PK5_DATA),
1213 PINMUX_GPIO(GPIO_PK4, PK4_DATA),
1214 PINMUX_GPIO(GPIO_PK3, PK3_DATA),
1215 PINMUX_GPIO(GPIO_PK2, PK2_DATA),
1216 PINMUX_GPIO(GPIO_PK1, PK1_DATA),
1217 PINMUX_GPIO(GPIO_PK0, PK0_DATA),
1218
1219 /* INTC */
1220 PINMUX_GPIO(GPIO_FN_PINT7_PG, PINT7_PG_MARK),
1221 PINMUX_GPIO(GPIO_FN_PINT6_PG, PINT6_PG_MARK),
1222 PINMUX_GPIO(GPIO_FN_PINT5_PG, PINT5_PG_MARK),
1223 PINMUX_GPIO(GPIO_FN_PINT4_PG, PINT4_PG_MARK),
1224 PINMUX_GPIO(GPIO_FN_PINT3_PG, PINT3_PG_MARK),
1225 PINMUX_GPIO(GPIO_FN_PINT2_PG, PINT2_PG_MARK),
1226 PINMUX_GPIO(GPIO_FN_PINT1_PG, PINT1_PG_MARK),
1227
1228 PINMUX_GPIO(GPIO_FN_IRQ7_PC, IRQ7_PC_MARK),
1229 PINMUX_GPIO(GPIO_FN_IRQ6_PC, IRQ6_PC_MARK),
1230 PINMUX_GPIO(GPIO_FN_IRQ5_PC, IRQ5_PC_MARK),
1231 PINMUX_GPIO(GPIO_FN_IRQ4_PC, IRQ4_PC_MARK),
1232 PINMUX_GPIO(GPIO_FN_IRQ3_PG, IRQ3_PG_MARK),
1233 PINMUX_GPIO(GPIO_FN_IRQ2_PG, IRQ2_PG_MARK),
1234 PINMUX_GPIO(GPIO_FN_IRQ1_PJ, IRQ1_PJ_MARK),
1235 PINMUX_GPIO(GPIO_FN_IRQ0_PJ, IRQ0_PJ_MARK),
1236 PINMUX_GPIO(GPIO_FN_IRQ3_PE, IRQ3_PE_MARK),
1237 PINMUX_GPIO(GPIO_FN_IRQ2_PE, IRQ2_PE_MARK),
1238 PINMUX_GPIO(GPIO_FN_IRQ1_PE, IRQ1_PE_MARK),
1239 PINMUX_GPIO(GPIO_FN_IRQ0_PE, IRQ0_PE_MARK),
1240
1241 /* WDT */
1242 PINMUX_GPIO(GPIO_FN_WDTOVF, WDTOVF_MARK),
1243
1244 /* CAN */
1245 PINMUX_GPIO(GPIO_FN_CTX1, CTX1_MARK),
1246 PINMUX_GPIO(GPIO_FN_CRX1, CRX1_MARK),
1247 PINMUX_GPIO(GPIO_FN_CTX0, CTX0_MARK),
1248 PINMUX_GPIO(GPIO_FN_CRX0, CRX0_MARK),
1249 PINMUX_GPIO(GPIO_FN_CRX0_CRX1, CRX0CRX1_MARK),
1250
1251 /* DMAC */
1252 PINMUX_GPIO(GPIO_FN_TEND0, TEND0_MARK),
1253 PINMUX_GPIO(GPIO_FN_DACK0, DACK0_MARK),
1254 PINMUX_GPIO(GPIO_FN_DREQ0, DREQ0_MARK),
1255 PINMUX_GPIO(GPIO_FN_TEND1, TEND1_MARK),
1256 PINMUX_GPIO(GPIO_FN_DACK1, DACK1_MARK),
1257 PINMUX_GPIO(GPIO_FN_DREQ1, DREQ1_MARK),
1258
1259 /* ADC */
1260 PINMUX_GPIO(GPIO_FN_ADTRG, ADTRG_MARK),
1261
1262 /* BSCh */
1263 PINMUX_GPIO(GPIO_FN_A25, A25_MARK),
1264 PINMUX_GPIO(GPIO_FN_A24, A24_MARK),
1265 PINMUX_GPIO(GPIO_FN_A23, A23_MARK),
1266 PINMUX_GPIO(GPIO_FN_A22, A22_MARK),
1267 PINMUX_GPIO(GPIO_FN_A21, A21_MARK),
1268 PINMUX_GPIO(GPIO_FN_A20, A20_MARK),
1269 PINMUX_GPIO(GPIO_FN_A19, A19_MARK),
1270 PINMUX_GPIO(GPIO_FN_A18, A18_MARK),
1271 PINMUX_GPIO(GPIO_FN_A17, A17_MARK),
1272 PINMUX_GPIO(GPIO_FN_A16, A16_MARK),
1273 PINMUX_GPIO(GPIO_FN_A15, A15_MARK),
1274 PINMUX_GPIO(GPIO_FN_A14, A14_MARK),
1275 PINMUX_GPIO(GPIO_FN_A13, A13_MARK),
1276 PINMUX_GPIO(GPIO_FN_A12, A12_MARK),
1277 PINMUX_GPIO(GPIO_FN_A11, A11_MARK),
1278 PINMUX_GPIO(GPIO_FN_A10, A10_MARK),
1279 PINMUX_GPIO(GPIO_FN_A9, A9_MARK),
1280 PINMUX_GPIO(GPIO_FN_A8, A8_MARK),
1281 PINMUX_GPIO(GPIO_FN_A7, A7_MARK),
1282 PINMUX_GPIO(GPIO_FN_A6, A6_MARK),
1283 PINMUX_GPIO(GPIO_FN_A5, A5_MARK),
1284 PINMUX_GPIO(GPIO_FN_A4, A4_MARK),
1285 PINMUX_GPIO(GPIO_FN_A3, A3_MARK),
1286 PINMUX_GPIO(GPIO_FN_A2, A2_MARK),
1287 PINMUX_GPIO(GPIO_FN_A1, A1_MARK),
1288 PINMUX_GPIO(GPIO_FN_A0, A0_MARK),
1289
1290 PINMUX_GPIO(GPIO_FN_D15, D15_MARK),
1291 PINMUX_GPIO(GPIO_FN_D14, D14_MARK),
1292 PINMUX_GPIO(GPIO_FN_D13, D13_MARK),
1293 PINMUX_GPIO(GPIO_FN_D12, D12_MARK),
1294 PINMUX_GPIO(GPIO_FN_D11, D11_MARK),
1295 PINMUX_GPIO(GPIO_FN_D10, D10_MARK),
1296 PINMUX_GPIO(GPIO_FN_D9, D9_MARK),
1297 PINMUX_GPIO(GPIO_FN_D8, D8_MARK),
1298 PINMUX_GPIO(GPIO_FN_D7, D7_MARK),
1299 PINMUX_GPIO(GPIO_FN_D6, D6_MARK),
1300 PINMUX_GPIO(GPIO_FN_D5, D5_MARK),
1301 PINMUX_GPIO(GPIO_FN_D4, D4_MARK),
1302 PINMUX_GPIO(GPIO_FN_D3, D3_MARK),
1303 PINMUX_GPIO(GPIO_FN_D2, D2_MARK),
1304 PINMUX_GPIO(GPIO_FN_D1, D1_MARK),
1305 PINMUX_GPIO(GPIO_FN_D0, D0_MARK),
1306
1307 PINMUX_GPIO(GPIO_FN_BS, BS_MARK),
1308 PINMUX_GPIO(GPIO_FN_CS4, CS4_MARK),
1309 PINMUX_GPIO(GPIO_FN_CS3, CS3_MARK),
1310 PINMUX_GPIO(GPIO_FN_CS2, CS2_MARK),
1311 PINMUX_GPIO(GPIO_FN_CS1, CS1_MARK),
1312 PINMUX_GPIO(GPIO_FN_CS0, CS0_MARK),
1313 PINMUX_GPIO(GPIO_FN_CS6CE1B, CS6CE1B_MARK),
1314 PINMUX_GPIO(GPIO_FN_CS5CE1A, CS5CE1A_MARK),
1315 PINMUX_GPIO(GPIO_FN_CE2A, CE2A_MARK),
1316 PINMUX_GPIO(GPIO_FN_CE2B, CE2B_MARK),
1317 PINMUX_GPIO(GPIO_FN_RD, RD_MARK),
1318 PINMUX_GPIO(GPIO_FN_RDWR, RDWR_MARK),
1319 PINMUX_GPIO(GPIO_FN_ICIOWRAH, ICIOWRAH_MARK),
1320 PINMUX_GPIO(GPIO_FN_ICIORD, ICIORD_MARK),
1321 PINMUX_GPIO(GPIO_FN_WE1DQMUWE, WE1DQMUWE_MARK),
1322 PINMUX_GPIO(GPIO_FN_WE0DQML, WE0DQML_MARK),
1323 PINMUX_GPIO(GPIO_FN_RAS, RAS_MARK),
1324 PINMUX_GPIO(GPIO_FN_CAS, CAS_MARK),
1325 PINMUX_GPIO(GPIO_FN_CKE, CKE_MARK),
1326 PINMUX_GPIO(GPIO_FN_WAIT, WAIT_MARK),
1327 PINMUX_GPIO(GPIO_FN_BREQ, BREQ_MARK),
1328 PINMUX_GPIO(GPIO_FN_BACK, BACK_MARK),
1329 PINMUX_GPIO(GPIO_FN_IOIS16, IOIS16_MARK),
1330
1331 /* TMU */
1332 PINMUX_GPIO(GPIO_FN_TIOC4D, TIOC4D_MARK),
1333 PINMUX_GPIO(GPIO_FN_TIOC4C, TIOC4C_MARK),
1334 PINMUX_GPIO(GPIO_FN_TIOC4B, TIOC4B_MARK),
1335 PINMUX_GPIO(GPIO_FN_TIOC4A, TIOC4A_MARK),
1336 PINMUX_GPIO(GPIO_FN_TIOC3D, TIOC3D_MARK),
1337 PINMUX_GPIO(GPIO_FN_TIOC3C, TIOC3C_MARK),
1338 PINMUX_GPIO(GPIO_FN_TIOC3B, TIOC3B_MARK),
1339 PINMUX_GPIO(GPIO_FN_TIOC3A, TIOC3A_MARK),
1340 PINMUX_GPIO(GPIO_FN_TIOC2B, TIOC2B_MARK),
1341 PINMUX_GPIO(GPIO_FN_TIOC1B, TIOC1B_MARK),
1342 PINMUX_GPIO(GPIO_FN_TIOC2A, TIOC2A_MARK),
1343 PINMUX_GPIO(GPIO_FN_TIOC1A, TIOC1A_MARK),
1344 PINMUX_GPIO(GPIO_FN_TIOC0D, TIOC0D_MARK),
1345 PINMUX_GPIO(GPIO_FN_TIOC0C, TIOC0C_MARK),
1346 PINMUX_GPIO(GPIO_FN_TIOC0B, TIOC0B_MARK),
1347 PINMUX_GPIO(GPIO_FN_TIOC0A, TIOC0A_MARK),
1348 PINMUX_GPIO(GPIO_FN_TCLKD, TCLKD_MARK),
1349 PINMUX_GPIO(GPIO_FN_TCLKC, TCLKC_MARK),
1350 PINMUX_GPIO(GPIO_FN_TCLKB, TCLKB_MARK),
1351 PINMUX_GPIO(GPIO_FN_TCLKA, TCLKA_MARK),
1352
1353 /* SCIF */
1354 PINMUX_GPIO(GPIO_FN_TXD0, TXD0_MARK),
1355 PINMUX_GPIO(GPIO_FN_RXD0, RXD0_MARK),
1356 PINMUX_GPIO(GPIO_FN_SCK0, SCK0_MARK),
1357 PINMUX_GPIO(GPIO_FN_TXD1, TXD1_MARK),
1358 PINMUX_GPIO(GPIO_FN_RXD1, RXD1_MARK),
1359 PINMUX_GPIO(GPIO_FN_SCK1, SCK1_MARK),
1360 PINMUX_GPIO(GPIO_FN_TXD2, TXD2_MARK),
1361 PINMUX_GPIO(GPIO_FN_RXD2, RXD2_MARK),
1362 PINMUX_GPIO(GPIO_FN_SCK2, SCK2_MARK),
1363 PINMUX_GPIO(GPIO_FN_RTS3, RTS3_MARK),
1364 PINMUX_GPIO(GPIO_FN_CTS3, CTS3_MARK),
1365 PINMUX_GPIO(GPIO_FN_TXD3, TXD3_MARK),
1366 PINMUX_GPIO(GPIO_FN_RXD3, RXD3_MARK),
1367 PINMUX_GPIO(GPIO_FN_SCK3, SCK3_MARK),
1368 PINMUX_GPIO(GPIO_FN_TXD4, TXD4_MARK),
1369 PINMUX_GPIO(GPIO_FN_RXD4, RXD4_MARK),
1370 PINMUX_GPIO(GPIO_FN_TXD5, TXD5_MARK),
1371 PINMUX_GPIO(GPIO_FN_RXD5, RXD5_MARK),
1372 PINMUX_GPIO(GPIO_FN_TXD6, TXD6_MARK),
1373 PINMUX_GPIO(GPIO_FN_RXD6, RXD6_MARK),
1374 PINMUX_GPIO(GPIO_FN_TXD7, TXD7_MARK),
1375 PINMUX_GPIO(GPIO_FN_RXD7, RXD7_MARK),
1376 PINMUX_GPIO(GPIO_FN_RTS1, RTS1_MARK),
1377 PINMUX_GPIO(GPIO_FN_CTS1, CTS1_MARK),
1378
1379 /* RSPI */
1380 PINMUX_GPIO(GPIO_FN_RSPCK0, RSPCK0_MARK),
1381 PINMUX_GPIO(GPIO_FN_MOSI0, MOSI0_MARK),
1382 PINMUX_GPIO(GPIO_FN_MISO0_PF12, MISO0_PF12_MARK),
1383 PINMUX_GPIO(GPIO_FN_MISO1, MISO1_MARK),
1384 PINMUX_GPIO(GPIO_FN_SSL00, SSL00_MARK),
1385 PINMUX_GPIO(GPIO_FN_RSPCK1, RSPCK1_MARK),
1386 PINMUX_GPIO(GPIO_FN_MOSI1, MOSI1_MARK),
1387 PINMUX_GPIO(GPIO_FN_MISO1_PG19, MISO1_PG19_MARK),
1388 PINMUX_GPIO(GPIO_FN_SSL10, SSL10_MARK),
1389
1390 /* IIC3 */
1391 PINMUX_GPIO(GPIO_FN_SCL0, SCL0_MARK),
1392 PINMUX_GPIO(GPIO_FN_SCL1, SCL1_MARK),
1393 PINMUX_GPIO(GPIO_FN_SCL2, SCL2_MARK),
1394 PINMUX_GPIO(GPIO_FN_SDA0, SDA0_MARK),
1395 PINMUX_GPIO(GPIO_FN_SDA1, SDA1_MARK),
1396 PINMUX_GPIO(GPIO_FN_SDA2, SDA2_MARK),
1397
1398 /* SSI */
1399 PINMUX_GPIO(GPIO_FN_SSISCK0, SSISCK0_MARK),
1400 PINMUX_GPIO(GPIO_FN_SSIWS0, SSIWS0_MARK),
1401 PINMUX_GPIO(GPIO_FN_SSITXD0, SSITXD0_MARK),
1402 PINMUX_GPIO(GPIO_FN_SSIRXD0, SSIRXD0_MARK),
1403 PINMUX_GPIO(GPIO_FN_SSIWS1, SSIWS1_MARK),
1404 PINMUX_GPIO(GPIO_FN_SSIWS2, SSIWS2_MARK),
1405 PINMUX_GPIO(GPIO_FN_SSIWS3, SSIWS3_MARK),
1406 PINMUX_GPIO(GPIO_FN_SSISCK1, SSISCK1_MARK),
1407 PINMUX_GPIO(GPIO_FN_SSISCK2, SSISCK2_MARK),
1408 PINMUX_GPIO(GPIO_FN_SSISCK3, SSISCK3_MARK),
1409 PINMUX_GPIO(GPIO_FN_SSIDATA1, SSIDATA1_MARK),
1410 PINMUX_GPIO(GPIO_FN_SSIDATA2, SSIDATA2_MARK),
1411 PINMUX_GPIO(GPIO_FN_SSIDATA3, SSIDATA3_MARK),
1412 PINMUX_GPIO(GPIO_FN_AUDIO_CLK, AUDIO_CLK_MARK),
1413
1414 /* SIOF */ /* NOTE Shares AUDIO_CLK with SSI */
1415 PINMUX_GPIO(GPIO_FN_SIOFTXD, SIOFTXD_MARK),
1416 PINMUX_GPIO(GPIO_FN_SIOFRXD, SIOFRXD_MARK),
1417 PINMUX_GPIO(GPIO_FN_SIOFSYNC, SIOFSYNC_MARK),
1418 PINMUX_GPIO(GPIO_FN_SIOFSCK, SIOFSCK_MARK),
1419
1420 /* SPDIF */ /* NOTE Shares AUDIO_CLK with SSI */
1421 PINMUX_GPIO(GPIO_FN_SPDIF_IN, SPDIF_IN_MARK),
1422 PINMUX_GPIO(GPIO_FN_SPDIF_OUT, SPDIF_OUT_MARK),
1423
1424 /* NANDFMC */ /* NOTE Controller is not available in boot mode 0 */
1425 PINMUX_GPIO(GPIO_FN_FCE, FCE_MARK),
1426 PINMUX_GPIO(GPIO_FN_FRB, FRB_MARK),
1427
1428 /* VDC3 */
1429 PINMUX_GPIO(GPIO_FN_DV_CLK, DV_CLK_MARK),
1430 PINMUX_GPIO(GPIO_FN_DV_VSYNC, DV_VSYNC_MARK),
1431 PINMUX_GPIO(GPIO_FN_DV_HSYNC, DV_HSYNC_MARK),
1432
1433 PINMUX_GPIO(GPIO_FN_DV_DATA7, DV_DATA7_MARK),
1434 PINMUX_GPIO(GPIO_FN_DV_DATA6, DV_DATA6_MARK),
1435 PINMUX_GPIO(GPIO_FN_DV_DATA5, DV_DATA5_MARK),
1436 PINMUX_GPIO(GPIO_FN_DV_DATA4, DV_DATA4_MARK),
1437 PINMUX_GPIO(GPIO_FN_DV_DATA3, DV_DATA3_MARK),
1438 PINMUX_GPIO(GPIO_FN_DV_DATA2, DV_DATA2_MARK),
1439 PINMUX_GPIO(GPIO_FN_DV_DATA1, DV_DATA1_MARK),
1440 PINMUX_GPIO(GPIO_FN_DV_DATA0, DV_DATA0_MARK),
1441
1442 PINMUX_GPIO(GPIO_FN_LCD_CLK, LCD_CLK_MARK),
1443 PINMUX_GPIO(GPIO_FN_LCD_EXTCLK, LCD_EXTCLK_MARK),
1444 PINMUX_GPIO(GPIO_FN_LCD_VSYNC, LCD_VSYNC_MARK),
1445 PINMUX_GPIO(GPIO_FN_LCD_HSYNC, LCD_HSYNC_MARK),
1446 PINMUX_GPIO(GPIO_FN_LCD_DE, LCD_DE_MARK),
1447
1448 PINMUX_GPIO(GPIO_FN_LCD_DATA15, LCD_DATA15_MARK),
1449 PINMUX_GPIO(GPIO_FN_LCD_DATA14, LCD_DATA14_MARK),
1450 PINMUX_GPIO(GPIO_FN_LCD_DATA13, LCD_DATA13_MARK),
1451 PINMUX_GPIO(GPIO_FN_LCD_DATA12, LCD_DATA12_MARK),
1452 PINMUX_GPIO(GPIO_FN_LCD_DATA11, LCD_DATA11_MARK),
1453 PINMUX_GPIO(GPIO_FN_LCD_DATA10, LCD_DATA10_MARK),
1454 PINMUX_GPIO(GPIO_FN_LCD_DATA9, LCD_DATA9_MARK),
1455 PINMUX_GPIO(GPIO_FN_LCD_DATA8, LCD_DATA8_MARK),
1456 PINMUX_GPIO(GPIO_FN_LCD_DATA7, LCD_DATA7_MARK),
1457 PINMUX_GPIO(GPIO_FN_LCD_DATA6, LCD_DATA6_MARK),
1458 PINMUX_GPIO(GPIO_FN_LCD_DATA5, LCD_DATA5_MARK),
1459 PINMUX_GPIO(GPIO_FN_LCD_DATA4, LCD_DATA4_MARK),
1460 PINMUX_GPIO(GPIO_FN_LCD_DATA3, LCD_DATA3_MARK),
1461 PINMUX_GPIO(GPIO_FN_LCD_DATA2, LCD_DATA2_MARK),
1462 PINMUX_GPIO(GPIO_FN_LCD_DATA1, LCD_DATA1_MARK),
1463 PINMUX_GPIO(GPIO_FN_LCD_DATA0, LCD_DATA0_MARK),
1464
1465 PINMUX_GPIO(GPIO_FN_LCD_M_DISP, LCD_M_DISP_MARK),
1466};
1467
1468static struct pinmux_cfg_reg pinmux_config_regs[] = {
1469 { PINMUX_CFG_REG("PAIOR0", 0xfffe3812, 16, 1) {
1470 0, 0, 0, 0, 0, 0, 0, 0,
1471 0, 0, 0, 0, 0, 0, 0, 0,
1472 0, 0, 0, 0, 0, 0, 0, 0,
1473 PA3_IN, PA3_OUT,
1474 PA2_IN, PA2_OUT,
1475 PA1_IN, PA1_OUT,
1476 PA0_IN, PA0_OUT }
1477 },
1478
1479 { PINMUX_CFG_REG("PBCR5", 0xfffe3824, 16, 4) {
1480 0, 0, 0, 0, 0, 0, 0, 0,
1481 0, 0, 0, 0, 0, 0, 0, 0,
1482 PB22MD_00, PB22MD_01, PB22MD_10, 0, 0, 0, 0, 0,
1483 0, 0, 0, 0, 0, 0, 0, 0,
1484 PB21MD_0, PB21MD_1, 0, 0, 0, 0, 0, 0,
1485 0, 0, 0, 0, 0, 0, 0, 0,
1486 0, PB20MD_1, 0, 0, 0, 0, 0, 0,
1487 0, 0, 0, 0, 0, 0, 0, 0 }
1488
1489 },
1490 { PINMUX_CFG_REG("PBCR4", 0xfffe3826, 16, 4) {
1491 0, PB19MD_01, 0, 0, 0, 0, 0, 0,
1492 0, 0, 0, 0, 0, 0, 0, 0,
1493 0, PB18MD_01, 0, 0, 0, 0, 0, 0,
1494 0, 0, 0, 0, 0, 0, 0, 0,
1495 0, PB17MD_01, 0, 0, 0, 0, 0, 0,
1496 0, 0, 0, 0, 0, 0, 0, 0,
1497 0, PB16MD_01, 0, 0, 0, 0, 0, 0,
1498 0, 0, 0, 0, 0, 0, 0, 0 }
1499 },
1500 { PINMUX_CFG_REG("PBCR3", 0xfffe3828, 16, 4) {
1501 0, PB15MD_01, 0, 0, 0, 0, 0, 0,
1502 0, 0, 0, 0, 0, 0, 0, 0,
1503 0, PB14MD_01, 0, 0, 0, 0, 0, 0,
1504 0, 0, 0, 0, 0, 0, 0, 0,
1505 0, PB13MD_01, 0, 0, 0, 0, 0, 0,
1506 0, 0, 0, 0, 0, 0, 0, 0,
1507 0, PB12MD_01, 0, 0, 0, 0, 0, 0,
1508 0, 0, 0, 0, 0, 0, 0, 0 }
1509 },
1510 { PINMUX_CFG_REG("PBCR2", 0xfffe382a, 16, 4) {
1511 0, PB11MD_01, 0, 0, 0, 0, 0, 0,
1512 0, 0, 0, 0, 0, 0, 0, 0,
1513 0, PB10MD_01, 0, 0, 0, 0, 0, 0,
1514 0, 0, 0, 0, 0, 0, 0, 0,
1515 0, PB9MD_01, 0, 0, 0, 0, 0, 0,
1516 0, 0, 0, 0, 0, 0, 0, 0,
1517 0, PB8MD_01, 0, 0, 0, 0, 0, 0,
1518 0, 0, 0, 0, 0, 0, 0, 0 }
1519 },
1520 { PINMUX_CFG_REG("PBCR1", 0xfffe382c, 16, 4) {
1521 0, PB7MD_01, 0, 0, 0, 0, 0, 0,
1522 0, 0, 0, 0, 0, 0, 0, 0,
1523 0, PB6MD_01, 0, 0, 0, 0, 0, 0,
1524 0, 0, 0, 0, 0, 0, 0, 0,
1525 0, PB5MD_01, 0, 0, 0, 0, 0, 0,
1526 0, 0, 0, 0, 0, 0, 0, 0,
1527 0, PB4MD_01, 0, 0, 0, 0, 0, 0,
1528 0, 0, 0, 0, 0, 0, 0, 0 }
1529 },
1530 { PINMUX_CFG_REG("PBCR0", 0xfffe382e, 16, 4) {
1531 0, PB3MD_1, 0, 0, 0, 0, 0, 0,
1532 0, 0, 0, 0, 0, 0, 0, 0,
1533 0, PB2MD_1, 0, 0, 0, 0, 0, 0,
1534 0, 0, 0, 0, 0, 0, 0, 0,
1535 0, PB1MD_1, 0, 0, 0, 0, 0, 0,
1536 0, 0, 0, 0, 0, 0, 0, 0,
1537 0, 0, 0, 0, 0, 0, 0, 0,
1538 0, 0, 0, 0, 0, 0, 0, 0 }
1539 },
1540
1541 { PINMUX_CFG_REG("PBIOR1", 0xfffe3830, 16, 1) {
1542 0, 0, 0, 0, 0, 0, 0, 0,
1543 0, 0, 0, 0, 0, 0, 0, 0,
1544 0, 0,
1545 PB22_IN, PB22_OUT,
1546 PB21_IN, PB21_OUT,
1547 PB20_IN, PB20_OUT,
1548 PB19_IN, PB19_OUT,
1549 PB18_IN, PB18_OUT,
1550 PB17_IN, PB17_OUT,
1551 PB16_IN, PB16_OUT }
1552 },
1553
1554 { PINMUX_CFG_REG("PBIOR0", 0xfffe3832, 16, 1) {
1555 PB15_IN, PB15_OUT,
1556 PB14_IN, PB14_OUT,
1557 PB13_IN, PB13_OUT,
1558 PB12_IN, PB12_OUT,
1559 PB11_IN, PB11_OUT,
1560 PB10_IN, PB10_OUT,
1561 PB9_IN, PB9_OUT,
1562 PB8_IN, PB8_OUT,
1563 PB7_IN, PB7_OUT,
1564 PB6_IN, PB6_OUT,
1565 PB5_IN, PB5_OUT,
1566 PB4_IN, PB4_OUT,
1567 PB3_IN, PB3_OUT,
1568 PB2_IN, PB2_OUT,
1569 PB1_IN, PB1_OUT,
1570 0, 0 }
1571 },
1572
1573 { PINMUX_CFG_REG("PCCR2", 0xfffe384a, 16, 4) {
1574 0, 0, 0, 0, 0, 0, 0, 0,
1575 0, 0, 0, 0, 0, 0, 0, 0,
1576 PC10MD_0, PC10MD_1, 0, 0, 0, 0, 0, 0,
1577 0, 0, 0, 0, 0, 0, 0, 0,
1578 PC9MD_0, PC9MD_1, 0, 0, 0, 0, 0, 0,
1579 0, 0, 0, 0, 0, 0, 0, 0,
1580 PC8MD_00, PC8MD_01, PC8MD_10, PC8MD_11, 0, 0, 0, 0,
1581 0, 0, 0, 0, 0, 0, 0, 0 }
1582 },
1583 { PINMUX_CFG_REG("PCCR1", 0xfffe384c, 16, 4) {
1584 PC7MD_00, PC7MD_01, PC7MD_10, PC7MD_11, 0, 0, 0, 0,
1585 0, 0, 0, 0, 0, 0, 0, 0,
1586 PC6MD_00, PC6MD_01, PC6MD_10, PC6MD_11, 0, 0, 0, 0,
1587 0, 0, 0, 0, 0, 0, 0, 0,
1588 PC5MD_00, PC5MD_01, PC5MD_10, PC5MD_11, 0, 0, 0, 0,
1589 0, 0, 0, 0, 0, 0, 0, 0,
1590 PC4MD_0, PC4MD_1, 0, 0, 0, 0, 0, 0,
1591 0, 0, 0, 0, 0, 0, 0, 0 }
1592 },
1593 { PINMUX_CFG_REG("PCCR0", 0xfffe384e, 16, 4) {
1594 PC3MD_0, PC3MD_1, 0, 0, 0, 0, 0, 0,
1595 0, 0, 0, 0, 0, 0, 0, 0,
1596 PC2MD_0, PC2MD_1, 0, 0, 0, 0, 0, 0,
1597 0, 0, 0, 0, 0, 0, 0, 0,
1598 PC1MD_0, PC1MD_1, 0, 0, 0, 0, 0, 0,
1599 0, 0, 0, 0, 0, 0, 0, 0,
1600 PC0MD_0, PC0MD_1, 0, 0, 0, 0, 0, 0,
1601 0, 0, 0, 0, 0, 0, 0, 0 }
1602 },
1603
1604 { PINMUX_CFG_REG("PCIOR0", 0xfffe3852, 16, 1) {
1605 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1606 PC10_IN, PC10_OUT,
1607 PC9_IN, PC9_OUT,
1608 PC8_IN, PC8_OUT,
1609 PC7_IN, PC7_OUT,
1610 PC6_IN, PC6_OUT,
1611 PC5_IN, PC5_OUT,
1612 PC4_IN, PC4_OUT,
1613 PC3_IN, PC3_OUT,
1614 PC2_IN, PC2_OUT,
1615 PC1_IN, PC1_OUT,
1616 PC0_IN, PC0_OUT
1617 }
1618 },
1619
1620 { PINMUX_CFG_REG("PDCR3", 0xfffe3868, 16, 4) {
1621 0, PD15MD_01, 0, 0, 0, 0, 0, 0,
1622 0, 0, 0, 0, 0, 0, 0, 0,
1623 0, PD14MD_01, 0, 0, 0, 0, 0, 0,
1624 0, 0, 0, 0, 0, 0, 0, 0,
1625 0, PD13MD_01, 0, 0, 0, 0, 0, 0,
1626 0, 0, 0, 0, 0, 0, 0, 0,
1627 0, PD12MD_01, 0, 0, 0, 0, 0, 0,
1628 0, 0, 0, 0, 0, 0, 0, 0 }
1629 },
1630 { PINMUX_CFG_REG("PDCR2", 0xfffe386a, 16, 4) {
1631 0, PD11MD_01, 0, 0, 0, 0, 0, 0,
1632 0, 0, 0, 0, 0, 0, 0, 0,
1633 0, PD10MD_01, 0, 0, 0, 0, 0, 0,
1634 0, 0, 0, 0, 0, 0, 0, 0,
1635 0, PD9MD_01, 0, 0, 0, 0, 0, 0,
1636 0, 0, 0, 0, 0, 0, 0, 0,
1637 0, PD8MD_01, 0, 0, 0, 0, 0, 0,
1638 0, 0, 0, 0, 0, 0, 0, 0 }
1639 },
1640 { PINMUX_CFG_REG("PDCR1", 0xfffe386c, 16, 4) {
1641 0, PD7MD_01, 0, 0, 0, 0, 0, 0,
1642 0, 0, 0, 0, 0, 0, 0, 0,
1643 0, PD6MD_01, 0, 0, 0, 0, 0, 0,
1644 0, 0, 0, 0, 0, 0, 0, 0,
1645 0, PD5MD_01, 0, 0, 0, 0, 0, 0,
1646 0, 0, 0, 0, 0, 0, 0, 0,
1647 0, PD4MD_01, 0, 0, 0, 0, 0, 0,
1648 0, 0, 0, 0, 0, 0, 0, 0 }
1649 },
1650 { PINMUX_CFG_REG("PDCR0", 0xfffe386e, 16, 4) {
1651 0, PD3MD_01, 0, 0, 0, 0, 0, 0,
1652 0, 0, 0, 0, 0, 0, 0, 0,
1653 0, PD2MD_01, 0, 0, 0, 0, 0, 0,
1654 0, 0, 0, 0, 0, 0, 0, 0,
1655 0, PD1MD_01, 0, 0, 0, 0, 0, 0,
1656 0, 0, 0, 0, 0, 0, 0, 0,
1657 0, PD0MD_01, 0, 0, 0, 0, 0, 0,
1658 0, 0, 0, 0, 0, 0, 0, 0 }
1659 },
1660
1661 { PINMUX_CFG_REG("PDIOR0", 0xfffe3872, 16, 1) {
1662 PD15_IN, PD15_OUT,
1663 PD14_IN, PD14_OUT,
1664 PD13_IN, PD13_OUT,
1665 PD12_IN, PD12_OUT,
1666 PD11_IN, PD11_OUT,
1667 PD10_IN, PD10_OUT,
1668 PD9_IN, PD9_OUT,
1669 PD8_IN, PD8_OUT,
1670 PD7_IN, PD7_OUT,
1671 PD6_IN, PD6_OUT,
1672 PD5_IN, PD5_OUT,
1673 PD4_IN, PD4_OUT,
1674 PD3_IN, PD3_OUT,
1675 PD2_IN, PD2_OUT,
1676 PD1_IN, PD1_OUT,
1677 PD0_IN, PD0_OUT }
1678 },
1679
1680 { PINMUX_CFG_REG("PECR1", 0xfffe388c, 16, 4) {
1681 0, 0, 0, 0, 0, 0, 0, 0,
1682 0, 0, 0, 0, 0, 0, 0, 0,
1683 0, 0, 0, 0, 0, 0, 0, 0,
1684 0, 0, 0, 0, 0, 0, 0, 0,
1685 PE5MD_00, PE5MD_01, 0, PE5MD_11, 0, 0, 0, 0,
1686 0, 0, 0, 0, 0, 0, 0, 0,
1687 PE4MD_00, PE4MD_01, 0, PE4MD_11, 0, 0, 0, 0,
1688 0, 0, 0, 0, 0, 0, 0, 0 }
1689 },
1690
1691 { PINMUX_CFG_REG("PECR0", 0xfffe388e, 16, 4) {
1692 PE3MD_00, PE3MD_01, 0, PE3MD_11, 0, 0, 0, 0,
1693 0, 0, 0, 0, 0, 0, 0, 0,
1694 PE2MD_00, PE2MD_01, 0, PE2MD_11, 0, 0, 0, 0,
1695 0, 0, 0, 0, 0, 0, 0, 0,
1696 PE1MD_000, PE1MD_001, PE1MD_010, PE1MD_011,
1697 PE1MD_100, PE1MD_101, 0, 0,
1698 0, 0, 0, 0, 0, 0, 0, 0,
1699 PE0MD_00, PE0MD_01, PE0MD_10, PE0MD_11, 0, 0, 0, 0,
1700 0, 0, 0, 0, 0, 0, 0, 0 }
1701 },
1702
1703 { PINMUX_CFG_REG("PEIOR0", 0xfffe3892, 16, 1) {
1704 0, 0, 0, 0, 0, 0, 0, 0,
1705 0, 0, 0, 0, 0, 0, 0, 0,
1706 0, 0, 0, 0,
1707 PE5_IN, PE5_OUT,
1708 PE4_IN, PE4_OUT,
1709 PE3_IN, PE3_OUT,
1710 PE2_IN, PE2_OUT,
1711 PE1_IN, PE1_OUT,
1712 PE0_IN, PE0_OUT }
1713 },
1714
1715 { PINMUX_CFG_REG("PFCR3", 0xfffe38a8, 16, 4) {
1716 PF12MD_000, PF12MD_001, 0, PF12MD_011,
1717 PF12MD_100, PF12MD_101, 0, 0,
1718 0, 0, 0, 0, 0, 0, 0, 0 }
1719 },
1720
1721 { PINMUX_CFG_REG("PFCR2", 0xfffe38aa, 16, 4) {
1722 PF11MD_000, PF11MD_001, PF11MD_010, PF11MD_011,
1723 PF11MD_100, PF11MD_101, 0, 0,
1724 0, 0, 0, 0, 0, 0, 0, 0,
1725 PF10MD_000, PF10MD_001, PF10MD_010, PF10MD_011,
1726 PF10MD_100, PF10MD_101, 0, 0,
1727 0, 0, 0, 0, 0, 0, 0, 0,
1728 PF9MD_000, PF9MD_001, PF9MD_010, PF9MD_011,
1729 PF9MD_100, PF9MD_101, 0, 0,
1730 0, 0, 0, 0, 0, 0, 0, 0,
1731 PF8MD_00, PF8MD_01, PF8MD_10, PF8MD_11, 0, 0, 0, 0,
1732 0, 0, 0, 0, 0, 0, 0, 0 }
1733 },
1734
1735 { PINMUX_CFG_REG("PFCR1", 0xfffe38ac, 16, 4) {
1736 PF7MD_000, PF7MD_001, PF7MD_010, PF7MD_011,
1737 PF7MD_100, 0, 0, 0,
1738 0, 0, 0, 0, 0, 0, 0, 0,
1739 PF6MD_000, PF6MD_001, PF6MD_010, PF6MD_011,
1740 PF6MD_100, 0, 0, 0,
1741 0, 0, 0, 0, 0, 0, 0, 0,
1742 PF5MD_000, PF5MD_001, PF5MD_010, PF5MD_011,
1743 PF5MD_100, 0, 0, 0,
1744 0, 0, 0, 0, 0, 0, 0, 0,
1745 PF4MD_000, PF4MD_001, PF4MD_010, PF4MD_011,
1746 PF4MD_100, 0, 0, 0,
1747 0, 0, 0, 0, 0, 0, 0, 0 }
1748 },
1749
1750 { PINMUX_CFG_REG("PFCR0", 0xfffe38ae, 16, 4) {
1751 PF3MD_000, PF3MD_001, PF3MD_010, PF3MD_011,
1752 PF3MD_100, 0, 0, 0,
1753 0, 0, 0, 0, 0, 0, 0, 0,
1754 PF2MD_000, PF2MD_001, PF2MD_010, PF2MD_011,
1755 PF2MD_100, PF2MD_101, 0, 0,
1756 0, 0, 0, 0, 0, 0, 0, 0,
1757 PF1MD_000, PF1MD_001, PF1MD_010, PF1MD_011,
1758 PF1MD_100, PF1MD_101, 0, 0,
1759 0, 0, 0, 0, 0, 0, 0, 0
1760 }
1761 },
1762
1763 { PINMUX_CFG_REG("PFIOR0", 0xfffe38b2, 16, 1) {
1764 0, 0, 0, 0, 0, 0,
1765 PF12_IN, PF12_OUT,
1766 PF11_IN, PF11_OUT,
1767 PF10_IN, PF10_OUT,
1768 PF9_IN, PF9_OUT,
1769 PF8_IN, PF8_OUT,
1770 PF7_IN, PF7_OUT,
1771 PF6_IN, PF6_OUT,
1772 PF5_IN, PF5_OUT,
1773 PF4_IN, PF4_OUT,
1774 PF3_IN, PF3_OUT,
1775 PF2_IN, PF2_OUT,
1776 PF1_IN, PF1_OUT,
1777 PF0_IN, PF0_OUT }
1778 },
1779
1780 { PINMUX_CFG_REG("PGCR7", 0xfffe38c0, 16, 4) {
1781 0, 0, 0, 0, 0, 0, 0, 0,
1782 0, 0, 0, 0, 0, 0, 0, 0,
1783 0, 0, 0, 0, 0, 0, 0, 0,
1784 0, 0, 0, 0, 0, 0, 0, 0,
1785 0, 0, 0, 0, 0, 0, 0, 0,
1786 0, 0, 0, 0, 0, 0, 0, 0,
1787 PG0MD_000, PG0MD_001, PG0MD_010, PG0MD_011,
1788 PG0MD_100, 0, 0, 0,
1789 0, 0, 0, 0, 0, 0, 0, 0 }
1790 },
1791
1792 { PINMUX_CFG_REG("PGCR6", 0xfffe38c2, 16, 4) {
1793 0, 0, 0, 0, 0, 0, 0, 0,
1794 0, 0, 0, 0, 0, 0, 0, 0,
1795 0, 0, 0, 0, 0, 0, 0, 0,
1796 0, 0, 0, 0, 0, 0, 0, 0,
1797 0, 0, 0, 0, 0, 0, 0, 0,
1798 0, 0, 0, 0, 0, 0, 0, 0,
1799 PG24MD_00, PG24MD_01, PG24MD_10, PG24MD_11, 0, 0, 0, 0,
1800 0, 0, 0, 0, 0, 0, 0, 0 }
1801 },
1802
1803 { PINMUX_CFG_REG("PGCR5", 0xfffe38c4, 16, 4) {
1804 PG23MD_00, PG23MD_01, PG23MD_10, PG23MD_11, 0, 0, 0, 0,
1805 0, 0, 0, 0, 0, 0, 0, 0,
1806 PG22MD_00, PG22MD_01, PG22MD_10, PG22MD_11, 0, 0, 0, 0,
1807 0, 0, 0, 0, 0, 0, 0, 0,
1808 PG21MD_00, PG21MD_01, PG21MD_10, PG21MD_11, 0, 0, 0, 0,
1809 0, 0, 0, 0, 0, 0, 0, 0,
1810 PG20MD_000, PG20MD_001, PG20MD_010, PG20MD_011,
1811 PG20MD_100, 0, 0, 0,
1812 0, 0, 0, 0, 0, 0, 0, 0 }
1813 },
1814
1815 { PINMUX_CFG_REG("PGCR4", 0xfffe38c6, 16, 4) {
1816 PG19MD_000, PG19MD_001, PG19MD_010, PG19MD_011,
1817 PG19MD_100, 0, 0, 0,
1818 0, 0, 0, 0, 0, 0, 0, 0,
1819 PG18MD_000, PG18MD_001, PG18MD_010, PG18MD_011,
1820 PG18MD_100, 0, 0, 0,
1821 0, 0, 0, 0, 0, 0, 0, 0,
1822 PG17MD_000, PG17MD_001, PG17MD_010, PG17MD_011,
1823 PG17MD_100, 0, 0, 0,
1824 0, 0, 0, 0, 0, 0, 0, 0,
1825 PG16MD_000, PG16MD_001, PG16MD_010, PG16MD_011,
1826 PG16MD_100, 0, 0, 0,
1827 0, 0, 0, 0, 0, 0, 0, 0 }
1828 },
1829
1830 { PINMUX_CFG_REG("PGCR3", 0xfffe38c8, 16, 4) {
1831 PG15MD_000, PG15MD_001, PG15MD_010, PG15MD_011,
1832 PG15MD_100, 0, 0, 0,
1833 0, 0, 0, 0, 0, 0, 0, 0,
1834 PG14MD_000, PG14MD_001, PG14MD_010, 0,
1835 PG14MD_100, 0, 0, 0,
1836 0, 0, 0, 0, 0, 0, 0, 0,
1837 PG13MD_000, PG13MD_001, PG13MD_010, 0,
1838 PG13MD_100, 0, 0, 0,
1839 0, 0, 0, 0, 0, 0, 0, 0,
1840 PG12MD_000, PG12MD_001, PG12MD_010, 0,
1841 PG12MD_100, 0, 0, 0,
1842 0, 0, 0, 0, 0, 0, 0, 0 }
1843 },
1844 { PINMUX_CFG_REG("PGCR2", 0xfffe38ca, 16, 4) {
1845 PG11MD_000, PG11MD_001, PG11MD_010, PG11MD_011,
1846 PG11MD_100, PG11MD_101, 0, 0,
1847 0, 0, 0, 0, 0, 0, 0, 0,
1848 PG10MD_000, PG10MD_001, PG10MD_010, PG10MD_011,
1849 PG10MD_100, PG10MD_101, 0, 0,
1850 0, 0, 0, 0, 0, 0, 0, 0,
1851 PG9MD_000, PG9MD_001, PG9MD_010, PG9MD_011,
1852 PG9MD_100, PG9MD_101, 0, 0,
1853 0, 0, 0, 0, 0, 0, 0, 0,
1854 PG8MD_000, PG8MD_001, PG8MD_010, PG8MD_011,
1855 PG8MD_100, PG8MD_101, 0, 0,
1856 0, 0, 0, 0, 0, 0, 0, 0 }
1857 },
1858
1859 { PINMUX_CFG_REG("PGCR1", 0xfffe38cc, 16, 4) {
1860 PG7MD_00, PG7MD_01, PG7MD_10, PG7MD_11, 0, 0, 0, 0,
1861 0, 0, 0, 0, 0, 0, 0, 0,
1862 PG6MD_00, PG6MD_01, PG6MD_10, PG6MD_11, 0, 0, 0, 0,
1863 0, 0, 0, 0, 0, 0, 0, 0,
1864 PG5MD_00, PG5MD_01, PG5MD_10, PG5MD_11, 0, 0, 0, 0,
1865 0, 0, 0, 0, 0, 0, 0, 0,
1866 PG4MD_00, PG4MD_01, PG4MD_10, PG4MD_11, 0, 0, 0, 0,
1867 0, 0, 0, 0, 0, 0, 0, 0 }
1868 },
1869 { PINMUX_CFG_REG("PGCR0", 0xfffe38ce, 16, 4) {
1870 PG3MD_00, PG3MD_01, PG3MD_10, PG3MD_11, 0, 0, 0, 0,
1871 0, 0, 0, 0, 0, 0, 0, 0,
1872 PG2MD_00, PG2MD_01, PG2MD_10, PG2MD_11, 0, 0, 0, 0,
1873 0, 0, 0, 0, 0, 0, 0, 0,
1874 PG1MD_00, PG1MD_01, PG1MD_10, PG1MD_11, 0, 0, 0, 0,
1875 0, 0, 0, 0, 0, 0, 0, 0,
1876 0, 0, 0, 0, 0, 0, 0, 0,
1877 0, 0, 0, 0, 0, 0, 0, 0 }
1878 },
1879 { PINMUX_CFG_REG("PGIOR1", 0xfffe38d0, 16, 1) {
1880 0, 0, 0, 0, 0, 0, 0, 0,
1881 0, 0, 0, 0, 0, 0,
1882 PG24_IN, PG24_OUT,
1883 PG23_IN, PG23_OUT,
1884 PG22_IN, PG22_OUT,
1885 PG21_IN, PG21_OUT,
1886 PG20_IN, PG20_OUT,
1887 PG19_IN, PG19_OUT,
1888 PG18_IN, PG18_OUT,
1889 PG17_IN, PG17_OUT,
1890 PG16_IN, PG16_OUT }
1891 },
1892
1893 { PINMUX_CFG_REG("PGIOR0", 0xfffe38d2, 16, 1) {
1894 PG15_IN, PG15_OUT,
1895 PG14_IN, PG14_OUT,
1896 PG13_IN, PG13_OUT,
1897 PG12_IN, PG12_OUT,
1898 PG11_IN, PG11_OUT,
1899 PG10_IN, PG10_OUT,
1900 PG9_IN, PG9_OUT,
1901 PG8_IN, PG8_OUT,
1902 PG7_IN, PG7_OUT,
1903 PG6_IN, PG6_OUT,
1904 PG5_IN, PG5_OUT,
1905 PG4_IN, PG4_OUT,
1906 PG3_IN, PG3_OUT,
1907 PG2_IN, PG2_OUT,
1908 PG1_IN, PG1_OUT,
1909 PG0_IN, PG0_OUT
1910 }
1911 },
1912
1913 { PINMUX_CFG_REG("PHCR1", 0xfffe38ec, 16, 4) {
1914 PH7MD_0, PH7MD_1, 0, 0, 0, 0, 0, 0,
1915 0, 0, 0, 0, 0, 0, 0, 0,
1916 PH6MD_0, PH6MD_1, 0, 0, 0, 0, 0, 0,
1917 0, 0, 0, 0, 0, 0, 0, 0,
1918 PH5MD_0, PH5MD_1, 0, 0, 0, 0, 0, 0,
1919 0, 0, 0, 0, 0, 0, 0, 0,
1920 PH4MD_0, PH4MD_1, 0, 0, 0, 0, 0, 0,
1921 0, 0, 0, 0, 0, 0, 0, 0 }
1922 },
1923
1924 { PINMUX_CFG_REG("PHCR0", 0xfffe38ee, 16, 4) {
1925 PH3MD_0, PH3MD_1, 0, 0, 0, 0, 0, 0,
1926 0, 0, 0, 0, 0, 0, 0, 0,
1927 PH2MD_0, PH2MD_1, 0, 0, 0, 0, 0, 0,
1928 0, 0, 0, 0, 0, 0, 0, 0,
1929 PH1MD_0, PH1MD_1, 0, 0, 0, 0, 0, 0,
1930 0, 0, 0, 0, 0, 0, 0, 0,
1931 PH0MD_0, PH0MD_1, 0, 0, 0, 0, 0, 0,
1932 0, 0, 0, 0, 0, 0, 0, 0 }
1933 },
1934
1935 { PINMUX_CFG_REG("PJCR2", 0xfffe390a, 16, 4) {
1936 PJ11MD_00, PJ11MD_01, PJ11MD_10, 0, 0, 0, 0, 0,
1937 0, 0, 0, 0, 0, 0, 0, 0,
1938 PJ10MD_00, PJ10MD_01, PJ10MD_10, 0, 0, 0, 0, 0,
1939 0, 0, 0, 0, 0, 0, 0, 0,
1940 PJ9MD_00, PJ9MD_01, PJ9MD_10, 0, 0, 0, 0, 0,
1941 0, 0, 0, 0, 0, 0, 0, 0,
1942 PJ8MD_00, PJ8MD_01, PJ8MD_10, 0, 0, 0, 0, 0,
1943 0, 0, 0, 0, 0, 0, 0, 0 }
1944 },
1945 { PINMUX_CFG_REG("PJCR1", 0xfffe390c, 16, 4) {
1946 PJ7MD_00, PJ7MD_01, PJ7MD_10, 0, 0, 0, 0, 0,
1947 0, 0, 0, 0, 0, 0, 0, 0,
1948 PJ6MD_00, PJ6MD_01, PJ6MD_10, 0, 0, 0, 0, 0,
1949 0, 0, 0, 0, 0, 0, 0, 0,
1950 PJ5MD_00, PJ5MD_01, PJ5MD_10, 0, 0, 0, 0, 0,
1951 0, 0, 0, 0, 0, 0, 0, 0,
1952 PJ4MD_00, PJ4MD_01, PJ4MD_10, 0, 0, 0, 0, 0,
1953 0, 0, 0, 0, 0, 0, 0, 0 }
1954 },
1955 { PINMUX_CFG_REG("PJCR0", 0xfffe390e, 16, 4) {
1956 PJ3MD_00, PJ3MD_01, PJ3MD_10, PJ3MD_11, 0, 0, 0, 0,
1957 0, 0, 0, 0, 0, 0, 0, 0,
1958 PJ2MD_000, PJ2MD_001, PJ2MD_010, PJ2MD_011,
1959 PJ2MD_100, PJ2MD_101, 0, 0,
1960 0, 0, 0, 0, 0, 0, 0, 0,
1961 PJ1MD_000, PJ1MD_001, PJ1MD_010, PJ1MD_011,
1962 PJ1MD_100, 0, 0, 0,
1963 0, 0, 0, 0, 0, 0, 0, 0,
1964 PJ0MD_000, PJ0MD_001, PJ0MD_010, PJ0MD_011,
1965 PJ0MD_100, PJ0MD_101, 0, 0,
1966 0, 0, 0, 0, 0, 0, 0, 0, }
1967 },
1968 { PINMUX_CFG_REG("PJIOR0", 0xfffe3912, 16, 1) {
1969 0, 0, 0, 0, 0, 0, 0, 0,
1970 PJ11_IN, PJ11_OUT,
1971 PJ10_IN, PJ10_OUT,
1972 PJ9_IN, PJ9_OUT,
1973 PJ8_IN, PJ8_OUT,
1974 PJ7_IN, PJ7_OUT,
1975 PJ6_IN, PJ6_OUT,
1976 PJ5_IN, PJ5_OUT,
1977 PJ4_IN, PJ4_OUT,
1978 PJ3_IN, PJ3_OUT,
1979 PJ2_IN, PJ2_OUT,
1980 PJ1_IN, PJ1_OUT,
1981 PJ0_IN, PJ0_OUT }
1982 },
1983
1984 { PINMUX_CFG_REG("PKCR2", 0xfffe392a, 16, 4) {
1985 PK11MD_00, PK11MD_01, PK11MD_10, 0, 0, 0, 0, 0,
1986 0, 0, 0, 0, 0, 0, 0, 0,
1987 PK10MD_00, PK10MD_01, PK10MD_10, 0, 0, 0, 0, 0,
1988 0, 0, 0, 0, 0, 0, 0, 0,
1989 PK9MD_00, PK9MD_01, PK9MD_10, 0, 0, 0, 0, 0,
1990 0, 0, 0, 0, 0, 0, 0, 0,
1991 PK8MD_00, PK8MD_01, PK8MD_10, 0, 0, 0, 0, 0,
1992 0, 0, 0, 0, 0, 0, 0, 0 }
1993 },
1994
1995 { PINMUX_CFG_REG("PKCR1", 0xfffe392c, 16, 4) {
1996 PK7MD_00, PK7MD_01, PK7MD_10, 0, 0, 0, 0, 0,
1997 0, 0, 0, 0, 0, 0, 0, 0,
1998 PK6MD_00, PK6MD_01, PK6MD_10, 0, 0, 0, 0, 0,
1999 0, 0, 0, 0, 0, 0, 0, 0,
2000 PK5MD_00, PK5MD_01, PK5MD_10, 0, 0, 0, 0, 0,
2001 0, 0, 0, 0, 0, 0, 0, 0,
2002 PK4MD_00, PK4MD_01, PK4MD_10, 0, 0, 0, 0, 0,
2003 0, 0, 0, 0, 0, 0, 0, 0 }
2004 },
2005 { PINMUX_CFG_REG("PKCR0", 0xfffe392e, 16, 4) {
2006 PK3MD_00, PK3MD_01, PK3MD_10, 0, 0, 0, 0, 0,
2007 0, 0, 0, 0, 0, 0, 0, 0,
2008 PK2MD_00, PK2MD_01, PK2MD_10, 0, 0, 0, 0, 0,
2009 0, 0, 0, 0, 0, 0, 0, 0,
2010 PK1MD_00, PK1MD_01, PK1MD_10, 0, 0, 0, 0, 0,
2011 0, 0, 0, 0, 0, 0, 0, 0,
2012 PK0MD_00, PK0MD_01, PK0MD_10, 0, 0, 0, 0, 0,
2013 0, 0, 0, 0, 0, 0, 0, 0 }
2014 },
2015
2016 { PINMUX_CFG_REG("PKIOR0", 0xfffe3932, 16, 1) {
2017 0, 0, 0, 0, 0, 0, 0, 0,
2018 PJ11_IN, PJ11_OUT,
2019 PJ10_IN, PJ10_OUT,
2020 PJ9_IN, PJ9_OUT,
2021 PJ8_IN, PJ8_OUT,
2022 PJ7_IN, PJ7_OUT,
2023 PJ6_IN, PJ6_OUT,
2024 PJ5_IN, PJ5_OUT,
2025 PJ4_IN, PJ4_OUT,
2026 PJ3_IN, PJ3_OUT,
2027 PJ2_IN, PJ2_OUT,
2028 PJ1_IN, PJ1_OUT,
2029 PJ0_IN, PJ0_OUT }
2030 },
2031 {}
2032};
2033
2034static struct pinmux_data_reg pinmux_data_regs[] = {
2035 { PINMUX_DATA_REG("PADR1", 0xfffe3814, 16) {
2036 0, 0, 0, 0, 0, 0, 0, PA3_DATA,
2037 0, 0, 0, 0, 0, 0, 0, PA2_DATA }
2038 },
2039
2040 { PINMUX_DATA_REG("PADR0", 0xfffe3816, 16) {
2041 0, 0, 0, 0, 0, 0, 0, PA1_DATA,
2042 0, 0, 0, 0, 0, 0, 0, PA0_DATA }
2043 },
2044
2045 { PINMUX_DATA_REG("PBDR1", 0xfffe3834, 16) {
2046 0, 0, 0, 0, 0, 0, 0, 0,
2047 0, PB22_DATA, PB21_DATA, PB20_DATA,
2048 PB19_DATA, PB18_DATA, PB17_DATA, PB16_DATA }
2049 },
2050
2051 { PINMUX_DATA_REG("PBDR0", 0xfffe3836, 16) {
2052 PB15_DATA, PB14_DATA, PB13_DATA, PB12_DATA,
2053 PB11_DATA, PB10_DATA, PB9_DATA, PB8_DATA,
2054 PB7_DATA, PB6_DATA, PB5_DATA, PB4_DATA,
2055 PB3_DATA, PB2_DATA, PB1_DATA, 0 }
2056 },
2057
2058 { PINMUX_DATA_REG("PCDR0", 0xfffe3856, 16) {
2059 0, 0, 0, 0,
2060 0, PC10_DATA, PC9_DATA, PC8_DATA,
2061 PC7_DATA, PC6_DATA, PC5_DATA, PC4_DATA,
2062 PC3_DATA, PC2_DATA, PC1_DATA, PC0_DATA }
2063 },
2064
2065 { PINMUX_DATA_REG("PDDR0", 0xfffe3876, 16) {
2066 PD15_DATA, PD14_DATA, PD13_DATA, PD12_DATA,
2067 PD11_DATA, PD10_DATA, PD9_DATA, PD8_DATA,
2068 PD7_DATA, PD6_DATA, PD5_DATA, PD4_DATA,
2069 PD3_DATA, PD2_DATA, PD1_DATA, PD0_DATA }
2070 },
2071
2072 { PINMUX_DATA_REG("PEDR0", 0xfffe3896, 16) {
2073 0, 0, 0, 0, 0, 0, 0, 0,
2074 0, 0, PE5_DATA, PE4_DATA,
2075 PE3_DATA, PE2_DATA, PE1_DATA, PE0_DATA }
2076 },
2077
2078 { PINMUX_DATA_REG("PFDR0", 0xfffe38b6, 16) {
2079 0, 0, 0, PF12_DATA,
2080 PF11_DATA, PF10_DATA, PF9_DATA, PF8_DATA,
2081 PF7_DATA, PF6_DATA, PF5_DATA, PF4_DATA,
2082 PF3_DATA, PF2_DATA, PF1_DATA, PF0_DATA }
2083 },
2084
2085 { PINMUX_DATA_REG("PGDR1", 0xfffe38d4, 16) {
2086 0, 0, 0, 0, 0, 0, 0, PG24_DATA,
2087 PG23_DATA, PG22_DATA, PG21_DATA, PG20_DATA,
2088 PG19_DATA, PG18_DATA, PG17_DATA, PG16_DATA }
2089 },
2090
2091 { PINMUX_DATA_REG("PGDR0", 0xfffe38d6, 16) {
2092 PG15_DATA, PG14_DATA, PG13_DATA, PG12_DATA,
2093 PG11_DATA, PG10_DATA, PG9_DATA, PG8_DATA,
2094 PG7_DATA, PG6_DATA, PG5_DATA, PG4_DATA,
2095 PG3_DATA, PG2_DATA, PG1_DATA, PG0_DATA }
2096 },
2097 { PINMUX_DATA_REG("PJDR0", 0xfffe3916, 16) {
2098 0, 0, 0, PJ12_DATA,
2099 PJ11_DATA, PJ10_DATA, PJ9_DATA, PJ8_DATA,
2100 PJ7_DATA, PJ6_DATA, PJ5_DATA, PJ4_DATA,
2101 PJ3_DATA, PJ2_DATA, PJ1_DATA, PJ0_DATA }
2102 },
2103 { PINMUX_DATA_REG("PKDR0", 0xfffe3936, 16) {
2104 0, 0, 0, PK12_DATA,
2105 PK11_DATA, PK10_DATA, PK9_DATA, PK8_DATA,
2106 PK7_DATA, PK6_DATA, PK5_DATA, PK4_DATA,
2107 PK3_DATA, PK2_DATA, PK1_DATA, PK0_DATA }
2108 },
2109 { }
2110};
2111
2112static struct pinmux_info sh7264_pinmux_info = {
2113 .name = "sh7264_pfc",
2114 .reserved_id = PINMUX_RESERVED,
2115 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2116 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END, FORCE_IN },
2117 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END, FORCE_OUT },
2118 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2119 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2120
2121 .first_gpio = GPIO_PA3,
2122 .last_gpio = GPIO_FN_LCD_M_DISP,
2123
2124 .gpios = pinmux_gpios,
2125 .cfg_regs = pinmux_config_regs,
2126 .data_regs = pinmux_data_regs,
2127
2128 .gpio_data = pinmux_data,
2129 .gpio_data_size = ARRAY_SIZE(pinmux_data),
2130};
2131
2132static int __init plat_pinmux_setup(void)
2133{
2134 return register_pinmux(&sh7264_pinmux_info);
2135}
2136arch_initcall(plat_pinmux_setup);
diff --git a/arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c b/arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c
deleted file mode 100644
index 039e4587dd9..00000000000
--- a/arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c
+++ /dev/null
@@ -1,2839 +0,0 @@
1/*
2 * SH7269 Pinmux
3 *
4 * Copyright (C) 2012 Renesas Electronics Europe Ltd
5 * Copyright (C) 2012 Phil Edworthy
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/gpio.h>
15#include <cpu/sh7269.h>
16
17enum {
18 PINMUX_RESERVED = 0,
19
20 PINMUX_DATA_BEGIN,
21 /* Port A */
22 PA1_DATA, PA0_DATA,
23 /* Port B */
24 PB22_DATA, PB21_DATA, PB20_DATA,
25 PB19_DATA, PB18_DATA, PB17_DATA, PB16_DATA,
26 PB15_DATA, PB14_DATA, PB13_DATA, PB12_DATA,
27 PB11_DATA, PB10_DATA, PB9_DATA, PB8_DATA,
28 PB7_DATA, PB6_DATA, PB5_DATA, PB4_DATA,
29 PB3_DATA, PB2_DATA, PB1_DATA,
30 /* Port C */
31 PC8_DATA,
32 PC7_DATA, PC6_DATA, PC5_DATA, PC4_DATA,
33 PC3_DATA, PC2_DATA, PC1_DATA, PC0_DATA,
34 /* Port D */
35 PD15_DATA, PD14_DATA, PD13_DATA, PD12_DATA,
36 PD11_DATA, PD10_DATA, PD9_DATA, PD8_DATA,
37 PD7_DATA, PD6_DATA, PD5_DATA, PD4_DATA,
38 PD3_DATA, PD2_DATA, PD1_DATA, PD0_DATA,
39 /* Port E */
40 PE7_DATA, PE6_DATA, PE5_DATA, PE4_DATA,
41 PE3_DATA, PE2_DATA, PE1_DATA, PE0_DATA,
42 /* Port F */
43 PF23_DATA, PF22_DATA, PF21_DATA, PF20_DATA,
44 PF19_DATA, PF18_DATA, PF17_DATA, PF16_DATA,
45 PF15_DATA, PF14_DATA, PF13_DATA, PF12_DATA,
46 PF11_DATA, PF10_DATA, PF9_DATA, PF8_DATA,
47 PF7_DATA, PF6_DATA, PF5_DATA, PF4_DATA,
48 PF3_DATA, PF2_DATA, PF1_DATA, PF0_DATA,
49 /* Port G */
50 PG27_DATA, PG26_DATA, PG25_DATA, PG24_DATA,
51 PG23_DATA, PG22_DATA, PG21_DATA, PG20_DATA,
52 PG19_DATA, PG18_DATA, PG17_DATA, PG16_DATA,
53 PG15_DATA, PG14_DATA, PG13_DATA, PG12_DATA,
54 PG11_DATA, PG10_DATA, PG9_DATA, PG8_DATA,
55 PG7_DATA, PG6_DATA, PG5_DATA, PG4_DATA,
56 PG3_DATA, PG2_DATA, PG1_DATA, PG0_DATA,
57 /* Port H */
58 /* NOTE - Port H does not have a Data Register, but PH Data is
59 connected to PH Port Register */
60 PH7_DATA, PH6_DATA, PH5_DATA, PH4_DATA,
61 PH3_DATA, PH2_DATA, PH1_DATA, PH0_DATA,
62 /* Port I - not on device */
63 /* Port J */
64 PJ31_DATA, PJ30_DATA, PJ29_DATA, PJ28_DATA,
65 PJ27_DATA, PJ26_DATA, PJ25_DATA, PJ24_DATA,
66 PJ23_DATA, PJ22_DATA, PJ21_DATA, PJ20_DATA,
67 PJ19_DATA, PJ18_DATA, PJ17_DATA, PJ16_DATA,
68 PJ15_DATA, PJ14_DATA, PJ13_DATA, PJ12_DATA,
69 PJ11_DATA, PJ10_DATA, PJ9_DATA, PJ8_DATA,
70 PJ7_DATA, PJ6_DATA, PJ5_DATA, PJ4_DATA,
71 PJ3_DATA, PJ2_DATA, PJ1_DATA, PJ0_DATA,
72 PINMUX_DATA_END,
73
74 PINMUX_INPUT_BEGIN,
75 FORCE_IN,
76 /* Port A */
77 PA1_IN, PA0_IN,
78 /* Port B */
79 PB22_IN, PB21_IN, PB20_IN,
80 PB19_IN, PB18_IN, PB17_IN, PB16_IN,
81 PB15_IN, PB14_IN, PB13_IN, PB12_IN,
82 PB11_IN, PB10_IN, PB9_IN, PB8_IN,
83 PB7_IN, PB6_IN, PB5_IN, PB4_IN,
84 PB3_IN, PB2_IN, PB1_IN,
85 /* Port C */
86 PC8_IN,
87 PC7_IN, PC6_IN, PC5_IN, PC4_IN,
88 PC3_IN, PC2_IN, PC1_IN, PC0_IN,
89 /* Port D */
90 PD15_IN, PD14_IN, PD13_IN, PD12_IN,
91 PD11_IN, PD10_IN, PD9_IN, PD8_IN,
92 PD7_IN, PD6_IN, PD5_IN, PD4_IN,
93 PD3_IN, PD2_IN, PD1_IN, PD0_IN,
94 /* Port E */
95 PE7_IN, PE6_IN, PE5_IN, PE4_IN,
96 PE3_IN, PE2_IN, PE1_IN, PE0_IN,
97 /* Port F */
98 PF23_IN, PF22_IN, PF21_IN, PF20_IN,
99 PF19_IN, PF18_IN, PF17_IN, PF16_IN,
100 PF15_IN, PF14_IN, PF13_IN, PF12_IN,
101 PF11_IN, PF10_IN, PF9_IN, PF8_IN,
102 PF7_IN, PF6_IN, PF5_IN, PF4_IN,
103 PF3_IN, PF2_IN, PF1_IN, PF0_IN,
104 /* Port G */
105 PG27_IN, PG26_IN, PG25_IN, PG24_IN,
106 PG23_IN, PG22_IN, PG21_IN, PG20_IN,
107 PG19_IN, PG18_IN, PG17_IN, PG16_IN,
108 PG15_IN, PG14_IN, PG13_IN, PG12_IN,
109 PG11_IN, PG10_IN, PG9_IN, PG8_IN,
110 PG7_IN, PG6_IN, PG5_IN, PG4_IN,
111 PG3_IN, PG2_IN, PG1_IN, PG0_IN,
112 /* Port H - Port H does not have a Data Register */
113 /* Port I - not on device */
114 /* Port J */
115 PJ31_IN, PJ30_IN, PJ29_IN, PJ28_IN,
116 PJ27_IN, PJ26_IN, PJ25_IN, PJ24_IN,
117 PJ23_IN, PJ22_IN, PJ21_IN, PJ20_IN,
118 PJ19_IN, PJ18_IN, PJ17_IN, PJ16_IN,
119 PJ15_IN, PJ14_IN, PJ13_IN, PJ12_IN,
120 PJ11_IN, PJ10_IN, PJ9_IN, PJ8_IN,
121 PJ7_IN, PJ6_IN, PJ5_IN, PJ4_IN,
122 PJ3_IN, PJ2_IN, PJ1_IN, PJ0_IN,
123 PINMUX_INPUT_END,
124
125 PINMUX_OUTPUT_BEGIN,
126 FORCE_OUT,
127 /* Port A */
128 PA1_OUT, PA0_OUT,
129 /* Port B */
130 PB22_OUT, PB21_OUT, PB20_OUT,
131 PB19_OUT, PB18_OUT, PB17_OUT, PB16_OUT,
132 PB15_OUT, PB14_OUT, PB13_OUT, PB12_OUT,
133 PB11_OUT, PB10_OUT, PB9_OUT, PB8_OUT,
134 PB7_OUT, PB6_OUT, PB5_OUT, PB4_OUT,
135 PB3_OUT, PB2_OUT, PB1_OUT,
136 /* Port C */
137 PC8_OUT,
138 PC7_OUT, PC6_OUT, PC5_OUT, PC4_OUT,
139 PC3_OUT, PC2_OUT, PC1_OUT, PC0_OUT,
140 /* Port D */
141 PD15_OUT, PD14_OUT, PD13_OUT, PD12_OUT,
142 PD11_OUT, PD10_OUT, PD9_OUT, PD8_OUT,
143 PD7_OUT, PD6_OUT, PD5_OUT, PD4_OUT,
144 PD3_OUT, PD2_OUT, PD1_OUT, PD0_OUT,
145 /* Port E */
146 PE7_OUT, PE6_OUT, PE5_OUT, PE4_OUT,
147 PE3_OUT, PE2_OUT, PE1_OUT, PE0_OUT,
148 /* Port F */
149 PF23_OUT, PF22_OUT, PF21_OUT, PF20_OUT,
150 PF19_OUT, PF18_OUT, PF17_OUT, PF16_OUT,
151 PF15_OUT, PF14_OUT, PF13_OUT, PF12_OUT,
152 PF11_OUT, PF10_OUT, PF9_OUT, PF8_OUT,
153 PF7_OUT, PF6_OUT, PF5_OUT, PF4_OUT,
154 PF3_OUT, PF2_OUT, PF1_OUT, PF0_OUT,
155 /* Port G */
156 PG27_OUT, PG26_OUT, PG25_OUT, PG24_OUT,
157 PG23_OUT, PG22_OUT, PG21_OUT, PG20_OUT,
158 PG19_OUT, PG18_OUT, PG17_OUT, PG16_OUT,
159 PG15_OUT, PG14_OUT, PG13_OUT, PG12_OUT,
160 PG11_OUT, PG10_OUT, PG9_OUT, PG8_OUT,
161 PG7_OUT, PG6_OUT, PG5_OUT, PG4_OUT,
162 PG3_OUT, PG2_OUT, PG1_OUT, PG0_OUT,
163 /* Port H - Port H does not have a Data Register */
164 /* Port I - not on device */
165 /* Port J */
166 PJ31_OUT, PJ30_OUT, PJ29_OUT, PJ28_OUT,
167 PJ27_OUT, PJ26_OUT, PJ25_OUT, PJ24_OUT,
168 PJ23_OUT, PJ22_OUT, PJ21_OUT, PJ20_OUT,
169 PJ19_OUT, PJ18_OUT, PJ17_OUT, PJ16_OUT,
170 PJ15_OUT, PJ14_OUT, PJ13_OUT, PJ12_OUT,
171 PJ11_OUT, PJ10_OUT, PJ9_OUT, PJ8_OUT,
172 PJ7_OUT, PJ6_OUT, PJ5_OUT, PJ4_OUT,
173 PJ3_OUT, PJ2_OUT, PJ1_OUT, PJ0_OUT,
174 PINMUX_OUTPUT_END,
175
176 PINMUX_FUNCTION_BEGIN,
177 /* Port A */
178 PA1_IOR_IN, PA1_IOR_OUT,
179 PA0_IOR_IN, PA0_IOR_OUT,
180
181 /* Port B */
182 PB22_IOR_IN, PB22_IOR_OUT,
183 PB21_IOR_IN, PB21_IOR_OUT,
184 PB20_IOR_IN, PB20_IOR_OUT,
185 PB19_IOR_IN, PB19_IOR_OUT,
186 PB18_IOR_IN, PB18_IOR_OUT,
187 PB17_IOR_IN, PB17_IOR_OUT,
188 PB16_IOR_IN, PB16_IOR_OUT,
189
190 PB15_IOR_IN, PB15_IOR_OUT,
191 PB14_IOR_IN, PB14_IOR_OUT,
192 PB13_IOR_IN, PB13_IOR_OUT,
193 PB12_IOR_IN, PB12_IOR_OUT,
194 PB11_IOR_IN, PB11_IOR_OUT,
195 PB10_IOR_IN, PB10_IOR_OUT,
196 PB9_IOR_IN, PB9_IOR_OUT,
197 PB8_IOR_IN, PB8_IOR_OUT,
198
199 PB7_IOR_IN, PB7_IOR_OUT,
200 PB6_IOR_IN, PB6_IOR_OUT,
201 PB5_IOR_IN, PB5_IOR_OUT,
202 PB4_IOR_IN, PB4_IOR_OUT,
203 PB3_IOR_IN, PB3_IOR_OUT,
204 PB2_IOR_IN, PB2_IOR_OUT,
205 PB1_IOR_IN, PB1_IOR_OUT,
206 PB0_IOR_IN, PB0_IOR_OUT,
207
208 PB22MD_000, PB22MD_001, PB22MD_010, PB22MD_011,
209 PB22MD_100, PB22MD_101, PB22MD_110, PB22MD_111,
210 PB21MD_00, PB21MD_01, PB21MD_10, PB21MD_11,
211 PB20MD_000, PB20MD_001, PB20MD_010, PB20MD_011,
212 PB20MD_100, PB20MD_101, PB20MD_110, PB20MD_111,
213 PB19MD_000, PB19MD_001, PB19MD_010, PB19MD_011,
214 PB19MD_100, PB19MD_101, PB19MD_110, PB19MD_111,
215 PB18MD_000, PB18MD_001, PB18MD_010, PB18MD_011,
216 PB18MD_100, PB18MD_101, PB18MD_110, PB18MD_111,
217 PB17MD_000, PB17MD_001, PB17MD_010, PB17MD_011,
218 PB17MD_100, PB17MD_101, PB17MD_110, PB17MD_111,
219 PB16MD_000, PB16MD_001, PB16MD_010, PB16MD_011,
220 PB16MD_100, PB16MD_101, PB16MD_110, PB16MD_111,
221 PB15MD_000, PB15MD_001, PB15MD_010, PB15MD_011,
222 PB15MD_100, PB15MD_101, PB15MD_110, PB15MD_111,
223 PB14MD_000, PB14MD_001, PB14MD_010, PB14MD_011,
224 PB14MD_100, PB14MD_101, PB14MD_110, PB14MD_111,
225 PB13MD_000, PB13MD_001, PB13MD_010, PB13MD_011,
226 PB13MD_100, PB13MD_101, PB13MD_110, PB13MD_111,
227 PB12MD_00, PB12MD_01, PB12MD_10, PB12MD_11,
228
229 PB11MD_00, PB11MD_01, PB11MD_10, PB11MD_11,
230 PB10MD_00, PB10MD_01, PB10MD_10, PB10MD_11,
231 PB9MD_00, PB9MD_01, PB9MD_10, PB9MD_11,
232 PB8MD_00, PB8MD_01, PB8MD_10, PB8MD_11,
233
234 PB7MD_00, PB7MD_01, PB7MD_10, PB7MD_11,
235 PB6MD_00, PB6MD_01, PB6MD_10, PB6MD_11,
236 PB5MD_00, PB5MD_01, PB5MD_10, PB5MD_11,
237 PB4MD_00, PB4MD_01, PB4MD_10, PB4MD_11,
238
239 PB3MD_00, PB3MD_01, PB3MD_10, PB3MD_11,
240 PB2MD_00, PB2MD_01, PB2MD_10, PB2MD_11,
241 PB1MD_00, PB1MD_01, PB1MD_10, PB1MD_11,
242
243 /* Port C */
244 PC8_IOR_IN, PC8_IOR_OUT,
245 PC7_IOR_IN, PC7_IOR_OUT,
246 PC6_IOR_IN, PC6_IOR_OUT,
247 PC5_IOR_IN, PC5_IOR_OUT,
248 PC4_IOR_IN, PC4_IOR_OUT,
249 PC3_IOR_IN, PC3_IOR_OUT,
250 PC2_IOR_IN, PC2_IOR_OUT,
251 PC1_IOR_IN, PC1_IOR_OUT,
252 PC0_IOR_IN, PC0_IOR_OUT,
253
254 PC8MD_000, PC8MD_001, PC8MD_010, PC8MD_011,
255 PC8MD_100, PC8MD_101, PC8MD_110, PC8MD_111,
256 PC7MD_000, PC7MD_001, PC7MD_010, PC7MD_011,
257 PC7MD_100, PC7MD_101, PC7MD_110, PC7MD_111,
258 PC6MD_000, PC6MD_001, PC6MD_010, PC6MD_011,
259 PC6MD_100, PC6MD_101, PC6MD_110, PC6MD_111,
260 PC5MD_000, PC5MD_001, PC5MD_010, PC5MD_011,
261 PC5MD_100, PC5MD_101, PC5MD_110, PC5MD_111,
262 PC4MD_00, PC4MD_01, PC4MD_10, PC4MD_11,
263
264 PC3MD_00, PC3MD_01, PC3MD_10, PC3MD_11,
265 PC2MD_00, PC2MD_01, PC2MD_10, PC2MD_11,
266 PC1MD_0, PC1MD_1,
267 PC0MD_0, PC0MD_1,
268
269 /* Port D */
270 PD15_IOR_IN, PD15_IOR_OUT,
271 PD14_IOR_IN, PD14_IOR_OUT,
272 PD13_IOR_IN, PD13_IOR_OUT,
273 PD12_IOR_IN, PD12_IOR_OUT,
274 PD11_IOR_IN, PD11_IOR_OUT,
275 PD10_IOR_IN, PD10_IOR_OUT,
276 PD9_IOR_IN, PD9_IOR_OUT,
277 PD8_IOR_IN, PD8_IOR_OUT,
278 PD7_IOR_IN, PD7_IOR_OUT,
279 PD6_IOR_IN, PD6_IOR_OUT,
280 PD5_IOR_IN, PD5_IOR_OUT,
281 PD4_IOR_IN, PD4_IOR_OUT,
282 PD3_IOR_IN, PD3_IOR_OUT,
283 PD2_IOR_IN, PD2_IOR_OUT,
284 PD1_IOR_IN, PD1_IOR_OUT,
285 PD0_IOR_IN, PD0_IOR_OUT,
286
287 PD15MD_00, PD15MD_01, PD15MD_10, PD15MD_11,
288 PD14MD_00, PD14MD_01, PD14MD_10, PD14MD_11,
289 PD13MD_00, PD13MD_01, PD13MD_10, PD13MD_11,
290 PD12MD_00, PD12MD_01, PD12MD_10, PD12MD_11,
291
292 PD11MD_00, PD11MD_01, PD11MD_10, PD11MD_11,
293 PD10MD_00, PD10MD_01, PD10MD_10, PD10MD_11,
294 PD9MD_00, PD9MD_01, PD9MD_10, PD9MD_11,
295 PD8MD_00, PD8MD_01, PD8MD_10, PD8MD_11,
296
297 PD7MD_00, PD7MD_01, PD7MD_10, PD7MD_11,
298 PD6MD_00, PD6MD_01, PD6MD_10, PD6MD_11,
299 PD5MD_00, PD5MD_01, PD5MD_10, PD5MD_11,
300 PD4MD_00, PD4MD_01, PD4MD_10, PD4MD_11,
301
302 PD3MD_00, PD3MD_01, PD3MD_10, PD3MD_11,
303 PD2MD_00, PD2MD_01, PD2MD_10, PD2MD_11,
304 PD1MD_00, PD1MD_01, PD1MD_10, PD1MD_11,
305 PD0MD_00, PD0MD_01, PD0MD_10, PD0MD_11,
306
307 /* Port E */
308 PE7_IOR_IN, PE7_IOR_OUT,
309 PE6_IOR_IN, PE6_IOR_OUT,
310 PE5_IOR_IN, PE5_IOR_OUT,
311 PE4_IOR_IN, PE4_IOR_OUT,
312 PE3_IOR_IN, PE3_IOR_OUT,
313 PE2_IOR_IN, PE2_IOR_OUT,
314 PE1_IOR_IN, PE1_IOR_OUT,
315 PE0_IOR_IN, PE0_IOR_OUT,
316
317 PE7MD_00, PE7MD_01, PE7MD_10, PE7MD_11,
318 PE6MD_00, PE6MD_01, PE6MD_10, PE6MD_11,
319 PE5MD_00, PE5MD_01, PE5MD_10, PE5MD_11,
320 PE4MD_00, PE4MD_01, PE4MD_10, PE4MD_11,
321
322 PE3MD_000, PE3MD_001, PE3MD_010, PE3MD_011,
323 PE3MD_100, PE3MD_101, PE3MD_110, PE3MD_111,
324 PE2MD_000, PE2MD_001, PE2MD_010, PE2MD_011,
325 PE2MD_100, PE2MD_101, PE2MD_110, PE2MD_111,
326 PE1MD_000, PE1MD_001, PE1MD_010, PE1MD_011,
327 PE1MD_100, PE1MD_101, PE1MD_110, PE1MD_111,
328 PE0MD_00, PE0MD_01, PE0MD_10, PE0MD_11,
329
330 /* Port F */
331 PF23_IOR_IN, PF23_IOR_OUT,
332 PF22_IOR_IN, PF22_IOR_OUT,
333 PF21_IOR_IN, PF21_IOR_OUT,
334 PF20_IOR_IN, PF20_IOR_OUT,
335 PF19_IOR_IN, PF19_IOR_OUT,
336 PF18_IOR_IN, PF18_IOR_OUT,
337 PF17_IOR_IN, PF17_IOR_OUT,
338 PF16_IOR_IN, PF16_IOR_OUT,
339 PF15_IOR_IN, PF15_IOR_OUT,
340 PF14_IOR_IN, PF14_IOR_OUT,
341 PF13_IOR_IN, PF13_IOR_OUT,
342 PF12_IOR_IN, PF12_IOR_OUT,
343 PF11_IOR_IN, PF11_IOR_OUT,
344 PF10_IOR_IN, PF10_IOR_OUT,
345 PF9_IOR_IN, PF9_IOR_OUT,
346 PF8_IOR_IN, PF8_IOR_OUT,
347 PF7_IOR_IN, PF7_IOR_OUT,
348 PF6_IOR_IN, PF6_IOR_OUT,
349 PF5_IOR_IN, PF5_IOR_OUT,
350 PF4_IOR_IN, PF4_IOR_OUT,
351 PF3_IOR_IN, PF3_IOR_OUT,
352 PF2_IOR_IN, PF2_IOR_OUT,
353 PF1_IOR_IN, PF1_IOR_OUT,
354 PF0_IOR_IN, PF0_IOR_OUT,
355
356 PF23MD_000, PF23MD_001, PF23MD_010, PF23MD_011,
357 PF23MD_100, PF23MD_101, PF23MD_110, PF23MD_111,
358 PF22MD_000, PF22MD_001, PF22MD_010, PF22MD_011,
359 PF22MD_100, PF22MD_101, PF22MD_110, PF22MD_111,
360 PF21MD_000, PF21MD_001, PF21MD_010, PF21MD_011,
361 PF21MD_100, PF21MD_101, PF21MD_110, PF21MD_111,
362 PF20MD_000, PF20MD_001, PF20MD_010, PF20MD_011,
363 PF20MD_100, PF20MD_101, PF20MD_110, PF20MD_111,
364
365 PF19MD_000, PF19MD_001, PF19MD_010, PF19MD_011,
366 PF19MD_100, PF19MD_101, PF19MD_110, PF19MD_111,
367 PF18MD_000, PF18MD_001, PF18MD_010, PF18MD_011,
368 PF18MD_100, PF18MD_101, PF18MD_110, PF18MD_111,
369 PF17MD_000, PF17MD_001, PF17MD_010, PF17MD_011,
370 PF17MD_100, PF17MD_101, PF17MD_110, PF17MD_111,
371 PF16MD_000, PF16MD_001, PF16MD_010, PF16MD_011,
372 PF16MD_100, PF16MD_101, PF16MD_110, PF16MD_111,
373
374 PF15MD_000, PF15MD_001, PF15MD_010, PF15MD_011,
375 PF15MD_100, PF15MD_101, PF15MD_110, PF15MD_111,
376 PF14MD_000, PF14MD_001, PF14MD_010, PF14MD_011,
377 PF14MD_100, PF14MD_101, PF14MD_110, PF14MD_111,
378 PF13MD_000, PF13MD_001, PF13MD_010, PF13MD_011,
379 PF13MD_100, PF13MD_101, PF13MD_110, PF13MD_111,
380 PF12MD_000, PF12MD_001, PF12MD_010, PF12MD_011,
381 PF12MD_100, PF12MD_101, PF12MD_110, PF12MD_111,
382
383 PF11MD_000, PF11MD_001, PF11MD_010, PF11MD_011,
384 PF11MD_100, PF11MD_101, PF11MD_110, PF11MD_111,
385 PF10MD_000, PF10MD_001, PF10MD_010, PF10MD_011,
386 PF10MD_100, PF10MD_101, PF10MD_110, PF10MD_111,
387 PF9MD_000, PF9MD_001, PF9MD_010, PF9MD_011,
388 PF9MD_100, PF9MD_101, PF9MD_110, PF9MD_111,
389 PF8MD_000, PF8MD_001, PF8MD_010, PF8MD_011,
390 PF8MD_100, PF8MD_101, PF8MD_110, PF8MD_111,
391
392 PF7MD_000, PF7MD_001, PF7MD_010, PF7MD_011,
393 PF7MD_100, PF7MD_101, PF7MD_110, PF7MD_111,
394 PF6MD_000, PF6MD_001, PF6MD_010, PF6MD_011,
395 PF6MD_100, PF6MD_101, PF6MD_110, PF6MD_111,
396 PF5MD_000, PF5MD_001, PF5MD_010, PF5MD_011,
397 PF5MD_100, PF5MD_101, PF5MD_110, PF5MD_111,
398 PF4MD_000, PF4MD_001, PF4MD_010, PF4MD_011,
399 PF4MD_100, PF4MD_101, PF4MD_110, PF4MD_111,
400
401 PF3MD_000, PF3MD_001, PF3MD_010, PF3MD_011,
402 PF3MD_100, PF3MD_101, PF3MD_110, PF3MD_111,
403 PF2MD_000, PF2MD_001, PF2MD_010, PF2MD_011,
404 PF2MD_100, PF2MD_101, PF2MD_110, PF2MD_111,
405 PF1MD_000, PF1MD_001, PF1MD_010, PF1MD_011,
406 PF1MD_100, PF1MD_101, PF1MD_110, PF1MD_111,
407 PF0MD_000, PF0MD_001, PF0MD_010, PF0MD_011,
408 PF0MD_100, PF0MD_101, PF0MD_110, PF0MD_111,
409
410 /* Port G */
411 PG27_IOR_IN, PG27_IOR_OUT,
412 PG26_IOR_IN, PG26_IOR_OUT,
413 PG25_IOR_IN, PG25_IOR_OUT,
414 PG24_IOR_IN, PG24_IOR_OUT,
415 PG23_IOR_IN, PG23_IOR_OUT,
416 PG22_IOR_IN, PG22_IOR_OUT,
417 PG21_IOR_IN, PG21_IOR_OUT,
418 PG20_IOR_IN, PG20_IOR_OUT,
419 PG19_IOR_IN, PG19_IOR_OUT,
420 PG18_IOR_IN, PG18_IOR_OUT,
421 PG17_IOR_IN, PG17_IOR_OUT,
422 PG16_IOR_IN, PG16_IOR_OUT,
423 PG15_IOR_IN, PG15_IOR_OUT,
424 PG14_IOR_IN, PG14_IOR_OUT,
425 PG13_IOR_IN, PG13_IOR_OUT,
426 PG12_IOR_IN, PG12_IOR_OUT,
427 PG11_IOR_IN, PG11_IOR_OUT,
428 PG10_IOR_IN, PG10_IOR_OUT,
429 PG9_IOR_IN, PG9_IOR_OUT,
430 PG8_IOR_IN, PG8_IOR_OUT,
431 PG7_IOR_IN, PG7_IOR_OUT,
432 PG6_IOR_IN, PG6_IOR_OUT,
433 PG5_IOR_IN, PG5_IOR_OUT,
434 PG4_IOR_IN, PG4_IOR_OUT,
435 PG3_IOR_IN, PG3_IOR_OUT,
436 PG2_IOR_IN, PG2_IOR_OUT,
437 PG1_IOR_IN, PG1_IOR_OUT,
438 PG0_IOR_IN, PG0_IOR_OUT,
439
440 PG27MD_00, PG27MD_01, PG27MD_10, PG27MD_11,
441 PG26MD_00, PG26MD_01, PG26MD_10, PG26MD_11,
442 PG25MD_00, PG25MD_01, PG25MD_10, PG25MD_11,
443 PG24MD_00, PG24MD_01, PG24MD_10, PG24MD_11,
444
445 PG23MD_000, PG23MD_001, PG23MD_010, PG23MD_011,
446 PG23MD_100, PG23MD_101, PG23MD_110, PG23MD_111,
447 PG22MD_000, PG22MD_001, PG22MD_010, PG22MD_011,
448 PG22MD_100, PG22MD_101, PG22MD_110, PG22MD_111,
449 PG21MD_000, PG21MD_001, PG21MD_010, PG21MD_011,
450 PG21MD_100, PG21MD_101, PG21MD_110, PG21MD_111,
451 PG20MD_000, PG20MD_001, PG20MD_010, PG20MD_011,
452 PG20MD_100, PG20MD_101, PG20MD_110, PG20MD_111,
453
454 PG19MD_000, PG19MD_001, PG19MD_010, PG19MD_011,
455 PG19MD_100, PG19MD_101, PG19MD_110, PG19MD_111,
456 PG18MD_000, PG18MD_001, PG18MD_010, PG18MD_011,
457 PG18MD_100, PG18MD_101, PG18MD_110, PG18MD_111,
458 PG17MD_00, PG17MD_01, PG17MD_10, PG17MD_11,
459 PG16MD_00, PG16MD_01, PG16MD_10, PG16MD_11,
460
461 PG15MD_00, PG15MD_01, PG15MD_10, PG15MD_11,
462 PG14MD_00, PG14MD_01, PG14MD_10, PG14MD_11,
463 PG13MD_00, PG13MD_01, PG13MD_10, PG13MD_11,
464 PG12MD_00, PG12MD_01, PG12MD_10, PG12MD_11,
465
466 PG11MD_000, PG11MD_001, PG11MD_010, PG11MD_011,
467 PG11MD_100, PG11MD_101, PG11MD_110, PG11MD_111,
468 PG10MD_000, PG10MD_001, PG10MD_010, PG10MD_011,
469 PG10MD_100, PG10MD_101, PG10MD_110, PG10MD_111,
470 PG9MD_000, PG9MD_001, PG9MD_010, PG9MD_011,
471 PG9MD_100, PG9MD_101, PG9MD_110, PG9MD_111,
472 PG8MD_000, PG8MD_001, PG8MD_010, PG8MD_011,
473 PG8MD_100, PG8MD_101, PG8MD_110, PG8MD_111,
474
475 PG7MD_000, PG7MD_001, PG7MD_010, PG7MD_011,
476 PG7MD_100, PG7MD_101, PG7MD_110, PG7MD_111,
477 PG6MD_000, PG6MD_001, PG6MD_010, PG6MD_011,
478 PG6MD_100, PG6MD_101, PG6MD_110, PG6MD_111,
479 PG5MD_000, PG5MD_001, PG5MD_010, PG5MD_011,
480 PG5MD_100, PG5MD_101, PG5MD_110, PG5MD_111,
481 PG4MD_000, PG4MD_001, PG4MD_010, PG4MD_011,
482 PG4MD_100, PG4MD_101, PG4MD_110, PG4MD_111,
483
484 PG3MD_000, PG3MD_001, PG3MD_010, PG3MD_011,
485 PG3MD_100, PG3MD_101, PG3MD_110, PG3MD_111,
486 PG2MD_000, PG2MD_001, PG2MD_010, PG2MD_011,
487 PG2MD_100, PG2MD_101, PG2MD_110, PG2MD_111,
488 PG1MD_000, PG1MD_001, PG1MD_010, PG1MD_011,
489 PG1MD_100, PG1MD_101, PG1MD_110, PG1MD_111,
490 PG0MD_000, PG0MD_001, PG0MD_010, PG0MD_011,
491 PG0MD_100, PG0MD_101, PG0MD_110, PG0MD_111,
492
493 /* Port H */
494 PH7MD_00, PH7MD_01, PH7MD_10, PH7MD_11,
495 PH6MD_00, PH6MD_01, PH6MD_10, PH6MD_11,
496 PH5MD_00, PH5MD_01, PH5MD_10, PH5MD_11,
497 PH4MD_00, PH4MD_01, PH4MD_10, PH4MD_11,
498
499 PH3MD_00, PH3MD_01, PH3MD_10, PH3MD_11,
500 PH2MD_00, PH2MD_01, PH2MD_10, PH2MD_11,
501 PH1MD_00, PH1MD_01, PH1MD_10, PH1MD_11,
502 PH0MD_00, PH0MD_01, PH0MD_10, PH0MD_11,
503
504 /* Port I - not on device */
505
506 /* Port J */
507 PJ31_IOR_IN, PJ31_IOR_OUT,
508 PJ30_IOR_IN, PJ30_IOR_OUT,
509 PJ29_IOR_IN, PJ29_IOR_OUT,
510 PJ28_IOR_IN, PJ28_IOR_OUT,
511 PJ27_IOR_IN, PJ27_IOR_OUT,
512 PJ26_IOR_IN, PJ26_IOR_OUT,
513 PJ25_IOR_IN, PJ25_IOR_OUT,
514 PJ24_IOR_IN, PJ24_IOR_OUT,
515 PJ23_IOR_IN, PJ23_IOR_OUT,
516 PJ22_IOR_IN, PJ22_IOR_OUT,
517 PJ21_IOR_IN, PJ21_IOR_OUT,
518 PJ20_IOR_IN, PJ20_IOR_OUT,
519 PJ19_IOR_IN, PJ19_IOR_OUT,
520 PJ18_IOR_IN, PJ18_IOR_OUT,
521 PJ17_IOR_IN, PJ17_IOR_OUT,
522 PJ16_IOR_IN, PJ16_IOR_OUT,
523 PJ15_IOR_IN, PJ15_IOR_OUT,
524 PJ14_IOR_IN, PJ14_IOR_OUT,
525 PJ13_IOR_IN, PJ13_IOR_OUT,
526 PJ12_IOR_IN, PJ12_IOR_OUT,
527 PJ11_IOR_IN, PJ11_IOR_OUT,
528 PJ10_IOR_IN, PJ10_IOR_OUT,
529 PJ9_IOR_IN, PJ9_IOR_OUT,
530 PJ8_IOR_IN, PJ8_IOR_OUT,
531 PJ7_IOR_IN, PJ7_IOR_OUT,
532 PJ6_IOR_IN, PJ6_IOR_OUT,
533 PJ5_IOR_IN, PJ5_IOR_OUT,
534 PJ4_IOR_IN, PJ4_IOR_OUT,
535 PJ3_IOR_IN, PJ3_IOR_OUT,
536 PJ2_IOR_IN, PJ2_IOR_OUT,
537 PJ1_IOR_IN, PJ1_IOR_OUT,
538 PJ0_IOR_IN, PJ0_IOR_OUT,
539
540 PJ31MD_0, PJ31MD_1,
541 PJ30MD_000, PJ30MD_001, PJ30MD_010, PJ30MD_011,
542 PJ30MD_100, PJ30MD_101, PJ30MD_110, PJ30MD_111,
543 PJ29MD_000, PJ29MD_001, PJ29MD_010, PJ29MD_011,
544 PJ29MD_100, PJ29MD_101, PJ29MD_110, PJ29MD_111,
545 PJ28MD_000, PJ28MD_001, PJ28MD_010, PJ28MD_011,
546 PJ28MD_100, PJ28MD_101, PJ28MD_110, PJ28MD_111,
547
548 PJ27MD_000, PJ27MD_001, PJ27MD_010, PJ27MD_011,
549 PJ27MD_100, PJ27MD_101, PJ27MD_110, PJ27MD_111,
550 PJ26MD_000, PJ26MD_001, PJ26MD_010, PJ26MD_011,
551 PJ26MD_100, PJ26MD_101, PJ26MD_110, PJ26MD_111,
552 PJ25MD_000, PJ25MD_001, PJ25MD_010, PJ25MD_011,
553 PJ25MD_100, PJ25MD_101, PJ25MD_110, PJ25MD_111,
554 PJ24MD_000, PJ24MD_001, PJ24MD_010, PJ24MD_011,
555 PJ24MD_100, PJ24MD_101, PJ24MD_110, PJ24MD_111,
556
557 PJ23MD_000, PJ23MD_001, PJ23MD_010, PJ23MD_011,
558 PJ23MD_100, PJ23MD_101, PJ23MD_110, PJ23MD_111,
559 PJ22MD_000, PJ22MD_001, PJ22MD_010, PJ22MD_011,
560 PJ22MD_100, PJ22MD_101, PJ22MD_110, PJ22MD_111,
561 PJ21MD_000, PJ21MD_001, PJ21MD_010, PJ21MD_011,
562 PJ21MD_100, PJ21MD_101, PJ21MD_110, PJ21MD_111,
563 PJ20MD_000, PJ20MD_001, PJ20MD_010, PJ20MD_011,
564 PJ20MD_100, PJ20MD_101, PJ20MD_110, PJ20MD_111,
565
566 PJ19MD_000, PJ19MD_001, PJ19MD_010, PJ19MD_011,
567 PJ19MD_100, PJ19MD_101, PJ19MD_110, PJ19MD_111,
568 PJ18MD_000, PJ18MD_001, PJ18MD_010, PJ18MD_011,
569 PJ18MD_100, PJ18MD_101, PJ18MD_110, PJ18MD_111,
570 PJ17MD_000, PJ17MD_001, PJ17MD_010, PJ17MD_011,
571 PJ17MD_100, PJ17MD_101, PJ17MD_110, PJ17MD_111,
572 PJ16MD_000, PJ16MD_001, PJ16MD_010, PJ16MD_011,
573 PJ16MD_100, PJ16MD_101, PJ16MD_110, PJ16MD_111,
574
575 PJ15MD_000, PJ15MD_001, PJ15MD_010, PJ15MD_011,
576 PJ15MD_100, PJ15MD_101, PJ15MD_110, PJ15MD_111,
577 PJ14MD_000, PJ14MD_001, PJ14MD_010, PJ14MD_011,
578 PJ14MD_100, PJ14MD_101, PJ14MD_110, PJ14MD_111,
579 PJ13MD_000, PJ13MD_001, PJ13MD_010, PJ13MD_011,
580 PJ13MD_100, PJ13MD_101, PJ13MD_110, PJ13MD_111,
581 PJ12MD_000, PJ12MD_001, PJ12MD_010, PJ12MD_011,
582 PJ12MD_100, PJ12MD_101, PJ12MD_110, PJ12MD_111,
583
584 PJ11MD_000, PJ11MD_001, PJ11MD_010, PJ11MD_011,
585 PJ11MD_100, PJ11MD_101, PJ11MD_110, PJ11MD_111,
586 PJ10MD_000, PJ10MD_001, PJ10MD_010, PJ10MD_011,
587 PJ10MD_100, PJ10MD_101, PJ10MD_110, PJ10MD_111,
588 PJ9MD_000, PJ9MD_001, PJ9MD_010, PJ9MD_011,
589 PJ9MD_100, PJ9MD_101, PJ9MD_110, PJ9MD_111,
590 PJ8MD_000, PJ8MD_001, PJ8MD_010, PJ8MD_011,
591 PJ8MD_100, PJ8MD_101, PJ8MD_110, PJ8MD_111,
592
593 PJ7MD_000, PJ7MD_001, PJ7MD_010, PJ7MD_011,
594 PJ7MD_100, PJ7MD_101, PJ7MD_110, PJ7MD_111,
595 PJ6MD_000, PJ6MD_001, PJ6MD_010, PJ6MD_011,
596 PJ6MD_100, PJ6MD_101, PJ6MD_110, PJ6MD_111,
597 PJ5MD_000, PJ5MD_001, PJ5MD_010, PJ5MD_011,
598 PJ5MD_100, PJ5MD_101, PJ5MD_110, PJ5MD_111,
599 PJ4MD_000, PJ4MD_001, PJ4MD_010, PJ4MD_011,
600 PJ4MD_100, PJ4MD_101, PJ4MD_110, PJ4MD_111,
601
602 PJ3MD_000, PJ3MD_001, PJ3MD_010, PJ3MD_011,
603 PJ3MD_100, PJ3MD_101, PJ3MD_110, PJ3MD_111,
604 PJ2MD_000, PJ2MD_001, PJ2MD_010, PJ2MD_011,
605 PJ2MD_100, PJ2MD_101, PJ2MD_110, PJ2MD_111,
606 PJ1MD_000, PJ1MD_001, PJ1MD_010, PJ1MD_011,
607 PJ1MD_100, PJ1MD_101, PJ1MD_110, PJ1MD_111,
608 PJ0MD_000, PJ0MD_001, PJ0MD_010, PJ0MD_011,
609 PJ0MD_100, PJ0MD_101, PJ0MD_110, PJ0MD_111,
610
611 PINMUX_FUNCTION_END,
612
613 PINMUX_MARK_BEGIN,
614 /* Port H */
615 PHAN7_MARK, PHAN6_MARK, PHAN5_MARK, PHAN4_MARK,
616 PHAN3_MARK, PHAN2_MARK, PHAN1_MARK, PHAN0_MARK,
617
618 /* IRQs */
619 IRQ7_PG_MARK, IRQ6_PG_MARK, IRQ5_PG_MARK, IRQ4_PG_MARK,
620 IRQ3_PG_MARK, IRQ2_PG_MARK, IRQ1_PG_MARK, IRQ0_PG_MARK,
621 IRQ7_PF_MARK, IRQ6_PF_MARK, IRQ5_PF_MARK, IRQ4_PF_MARK,
622 IRQ3_PJ_MARK, IRQ2_PJ_MARK, IRQ1_PJ_MARK, IRQ0_PJ_MARK,
623 IRQ1_PC_MARK, IRQ0_PC_MARK,
624
625 PINT7_PG_MARK, PINT6_PG_MARK, PINT5_PG_MARK, PINT4_PG_MARK,
626 PINT3_PG_MARK, PINT2_PG_MARK, PINT1_PG_MARK, PINT0_PG_MARK,
627 PINT7_PH_MARK, PINT6_PH_MARK, PINT5_PH_MARK, PINT4_PH_MARK,
628 PINT3_PH_MARK, PINT2_PH_MARK, PINT1_PH_MARK, PINT0_PH_MARK,
629 PINT7_PJ_MARK, PINT6_PJ_MARK, PINT5_PJ_MARK, PINT4_PJ_MARK,
630 PINT3_PJ_MARK, PINT2_PJ_MARK, PINT1_PJ_MARK, PINT0_PJ_MARK,
631
632 /* SD */
633 SD_D0_MARK, SD_D1_MARK, SD_D2_MARK, SD_D3_MARK,
634 SD_WP_MARK, SD_CLK_MARK, SD_CMD_MARK, SD_CD_MARK,
635
636 /* MMC */
637 MMC_D0_MARK, MMC_D1_MARK, MMC_D2_MARK, MMC_D3_MARK,
638 MMC_D4_MARK, MMC_D5_MARK, MMC_D6_MARK, MMC_D7_MARK,
639 MMC_CLK_MARK, MMC_CMD_MARK, MMC_CD_MARK,
640
641 /* PWM */
642 PWM1A_MARK, PWM1B_MARK, PWM1C_MARK, PWM1D_MARK,
643 PWM1E_MARK, PWM1F_MARK, PWM1G_MARK, PWM1H_MARK,
644 PWM2A_MARK, PWM2B_MARK, PWM2C_MARK, PWM2D_MARK,
645 PWM2E_MARK, PWM2F_MARK, PWM2G_MARK, PWM2H_MARK,
646
647 /* IEBus */
648 IERXD_MARK, IETXD_MARK,
649
650 /* WDT */
651 WDTOVF_MARK,
652
653 /* DMAC */
654 TEND0_MARK, DACK0_MARK, DREQ0_MARK,
655 TEND1_MARK, DACK1_MARK, DREQ1_MARK,
656
657 /* ADC */
658 ADTRG_MARK,
659
660 /* BSC */
661 A25_MARK, A24_MARK,
662 A23_MARK, A22_MARK, A21_MARK, A20_MARK,
663 A19_MARK, A18_MARK, A17_MARK, A16_MARK,
664 A15_MARK, A14_MARK, A13_MARK, A12_MARK,
665 A11_MARK, A10_MARK, A9_MARK, A8_MARK,
666 A7_MARK, A6_MARK, A5_MARK, A4_MARK,
667 A3_MARK, A2_MARK, A1_MARK, A0_MARK,
668 D31_MARK, D30_MARK, D29_MARK, D28_MARK,
669 D27_MARK, D26_MARK, D25_MARK, D24_MARK,
670 D23_MARK, D22_MARK, D21_MARK, D20_MARK,
671 D19_MARK, D18_MARK, D17_MARK, D16_MARK,
672 D15_MARK, D14_MARK, D13_MARK, D12_MARK,
673 D11_MARK, D10_MARK, D9_MARK, D8_MARK,
674 D7_MARK, D6_MARK, D5_MARK, D4_MARK,
675 D3_MARK, D2_MARK, D1_MARK, D0_MARK,
676 BS_MARK,
677 CS4_MARK, CS3_MARK, CS2_MARK, CS1_MARK, CS0_MARK,
678 CS5CE1A_MARK,
679 CE2A_MARK, CE2B_MARK,
680 RD_MARK, RDWR_MARK,
681 WE3ICIOWRAHDQMUU_MARK,
682 WE2ICIORDDQMUL_MARK,
683 WE1DQMUWE_MARK,
684 WE0DQML_MARK,
685 RAS_MARK, CAS_MARK, CKE_MARK,
686 WAIT_MARK, BREQ_MARK, BACK_MARK, IOIS16_MARK,
687
688 /* TMU */
689 TIOC0A_MARK, TIOC0B_MARK, TIOC0C_MARK, TIOC0D_MARK,
690 TIOC1A_MARK, TIOC1B_MARK,
691 TIOC2A_MARK, TIOC2B_MARK,
692 TIOC3A_MARK, TIOC3B_MARK, TIOC3C_MARK, TIOC3D_MARK,
693 TIOC4A_MARK, TIOC4B_MARK, TIOC4C_MARK, TIOC4D_MARK,
694 TCLKA_MARK, TCLKB_MARK, TCLKC_MARK, TCLKD_MARK,
695
696 /* SCIF */
697 SCK0_MARK, RXD0_MARK, TXD0_MARK,
698 SCK1_MARK, RXD1_MARK, TXD1_MARK, RTS1_MARK, CTS1_MARK,
699 SCK2_MARK, RXD2_MARK, TXD2_MARK,
700 SCK3_MARK, RXD3_MARK, TXD3_MARK,
701 SCK4_MARK, RXD4_MARK, TXD4_MARK,
702 SCK5_MARK, RXD5_MARK, TXD5_MARK, RTS5_MARK, CTS5_MARK,
703 SCK6_MARK, RXD6_MARK, TXD6_MARK,
704 SCK7_MARK, RXD7_MARK, TXD7_MARK, RTS7_MARK, CTS7_MARK,
705
706 /* RSPI */
707 MISO0_PB20_MARK, MOSI0_PB19_MARK, SSL00_PB18_MARK, RSPCK0_PB17_MARK,
708 MISO0_PJ19_MARK, MOSI0_PJ18_MARK, SSL00_PJ17_MARK, RSPCK0_PJ16_MARK,
709 MISO1_MARK, MOSI1_MARK, SSL10_MARK, RSPCK1_MARK,
710
711 /* IIC3 */
712 SCL0_MARK, SDA0_MARK,
713 SCL1_MARK, SDA1_MARK,
714 SCL2_MARK, SDA2_MARK,
715 SCL3_MARK, SDA3_MARK,
716
717 /* SSI */
718 SSISCK0_MARK, SSIWS0_MARK, SSITXD0_MARK, SSIRXD0_MARK,
719 SSISCK1_MARK, SSIWS1_MARK, SSIDATA1_MARK,
720 SSISCK2_MARK, SSIWS2_MARK, SSIDATA2_MARK,
721 SSISCK3_MARK, SSIWS3_MARK, SSIDATA3_MARK,
722 SSISCK4_MARK, SSIWS4_MARK, SSIDATA4_MARK,
723 SSISCK5_MARK, SSIWS5_MARK, SSIDATA5_MARK,
724 AUDIO_CLK_MARK,
725 AUDIO_XOUT_MARK,
726
727 /* SIOF */ /* NOTE Shares AUDIO_CLK with SSI */
728 SIOFTXD_MARK, SIOFRXD_MARK, SIOFSYNC_MARK, SIOFSCK_MARK,
729
730 /* SPDIF */ /* NOTE Shares AUDIO_CLK with SSI */
731 SPDIF_IN_MARK, SPDIF_OUT_MARK,
732 SPDIF_IN_PJ24_MARK, SPDIF_OUT_PJ25_MARK,
733
734 /* NANDFMC */ /* NOTE Controller is not available in boot mode 0 */
735 FCE_MARK,
736 FRB_MARK,
737
738 /* CAN */
739 CRX0_MARK, CTX0_MARK,
740 CRX1_MARK, CTX1_MARK,
741 CRX2_MARK, CTX2_MARK,
742 CRX0CRX1_MARK,
743 CRX0CRX1CRX2_MARK,
744 CTX0CTX1CTX2_MARK,
745 CRX1_PJ22_MARK, CTX1_PJ23_MARK,
746 CRX2_PJ20_MARK, CTX2_PJ21_MARK,
747 CRX0CRX1_PJ22_MARK,
748 CRX0CRX1CRX2_PJ20_MARK,
749
750 /* VDC */
751 DV_CLK_MARK,
752 DV_VSYNC_MARK, DV_HSYNC_MARK,
753 DV_DATA23_MARK, DV_DATA22_MARK, DV_DATA21_MARK, DV_DATA20_MARK,
754 DV_DATA19_MARK, DV_DATA18_MARK, DV_DATA17_MARK, DV_DATA16_MARK,
755 DV_DATA15_MARK, DV_DATA14_MARK, DV_DATA13_MARK, DV_DATA12_MARK,
756 DV_DATA11_MARK, DV_DATA10_MARK, DV_DATA9_MARK, DV_DATA8_MARK,
757 DV_DATA7_MARK, DV_DATA6_MARK, DV_DATA5_MARK, DV_DATA4_MARK,
758 DV_DATA3_MARK, DV_DATA2_MARK, DV_DATA1_MARK, DV_DATA0_MARK,
759 LCD_CLK_MARK, LCD_EXTCLK_MARK,
760 LCD_VSYNC_MARK, LCD_HSYNC_MARK, LCD_DE_MARK,
761 LCD_DATA23_PG23_MARK, LCD_DATA22_PG22_MARK, LCD_DATA21_PG21_MARK,
762 LCD_DATA20_PG20_MARK, LCD_DATA19_PG19_MARK, LCD_DATA18_PG18_MARK,
763 LCD_DATA17_PG17_MARK, LCD_DATA16_PG16_MARK, LCD_DATA15_PG15_MARK,
764 LCD_DATA14_PG14_MARK, LCD_DATA13_PG13_MARK, LCD_DATA12_PG12_MARK,
765 LCD_DATA11_PG11_MARK, LCD_DATA10_PG10_MARK, LCD_DATA9_PG9_MARK,
766 LCD_DATA8_PG8_MARK, LCD_DATA7_PG7_MARK, LCD_DATA6_PG6_MARK,
767 LCD_DATA5_PG5_MARK, LCD_DATA4_PG4_MARK, LCD_DATA3_PG3_MARK,
768 LCD_DATA2_PG2_MARK, LCD_DATA1_PG1_MARK, LCD_DATA0_PG0_MARK,
769 LCD_DATA23_PJ23_MARK, LCD_DATA22_PJ22_MARK, LCD_DATA21_PJ21_MARK,
770 LCD_DATA20_PJ20_MARK, LCD_DATA19_PJ19_MARK, LCD_DATA18_PJ18_MARK,
771 LCD_DATA17_PJ17_MARK, LCD_DATA16_PJ16_MARK, LCD_DATA15_PJ15_MARK,
772 LCD_DATA14_PJ14_MARK, LCD_DATA13_PJ13_MARK, LCD_DATA12_PJ12_MARK,
773 LCD_DATA11_PJ11_MARK, LCD_DATA10_PJ10_MARK, LCD_DATA9_PJ9_MARK,
774 LCD_DATA8_PJ8_MARK, LCD_DATA7_PJ7_MARK, LCD_DATA6_PJ6_MARK,
775 LCD_DATA5_PJ5_MARK, LCD_DATA4_PJ4_MARK, LCD_DATA3_PJ3_MARK,
776 LCD_DATA2_PJ2_MARK, LCD_DATA1_PJ1_MARK, LCD_DATA0_PJ0_MARK,
777 LCD_TCON6_MARK, LCD_TCON5_MARK, LCD_TCON4_MARK,
778 LCD_TCON3_MARK, LCD_TCON2_MARK, LCD_TCON1_MARK, LCD_TCON0_MARK,
779 LCD_M_DISP_MARK,
780 PINMUX_MARK_END,
781};
782
783static pinmux_enum_t pinmux_data[] = {
784
785 /* Port A */
786 PINMUX_DATA(PA1_DATA, PA1_IN),
787 PINMUX_DATA(PA0_DATA, PA0_IN),
788
789 /* Port B */
790 PINMUX_DATA(PB22_DATA, PB22MD_000, PB22_IN, PB22_OUT),
791 PINMUX_DATA(A22_MARK, PB22MD_001),
792 PINMUX_DATA(CTX2_MARK, PB22MD_010),
793 PINMUX_DATA(IETXD_MARK, PB22MD_011),
794 PINMUX_DATA(CS4_MARK, PB22MD_100),
795
796 PINMUX_DATA(PB21_DATA, PB21MD_00, PB21_IN, PB21_OUT),
797 PINMUX_DATA(A21_MARK, PB21MD_01),
798 PINMUX_DATA(CRX2_MARK, PB21MD_10),
799 PINMUX_DATA(IERXD_MARK, PB21MD_11),
800
801 PINMUX_DATA(A20_MARK, PB20MD_001),
802 PINMUX_DATA(A19_MARK, PB19MD_001),
803 PINMUX_DATA(A18_MARK, PB18MD_001),
804 PINMUX_DATA(A17_MARK, PB17MD_001),
805 PINMUX_DATA(A16_MARK, PB16MD_001),
806 PINMUX_DATA(A15_MARK, PB15MD_001),
807 PINMUX_DATA(A14_MARK, PB14MD_001),
808 PINMUX_DATA(A13_MARK, PB13MD_001),
809 PINMUX_DATA(A12_MARK, PB12MD_01),
810 PINMUX_DATA(A11_MARK, PB11MD_01),
811 PINMUX_DATA(A10_MARK, PB10MD_01),
812 PINMUX_DATA(A9_MARK, PB9MD_01),
813 PINMUX_DATA(A8_MARK, PB8MD_01),
814 PINMUX_DATA(A7_MARK, PB7MD_01),
815 PINMUX_DATA(A6_MARK, PB6MD_01),
816 PINMUX_DATA(A5_MARK, PB5MD_01),
817 PINMUX_DATA(A4_MARK, PB4MD_01),
818 PINMUX_DATA(A3_MARK, PB3MD_01),
819 PINMUX_DATA(A2_MARK, PB2MD_01),
820 PINMUX_DATA(A1_MARK, PB1MD_01),
821
822 /* Port C */
823 PINMUX_DATA(PC8_DATA, PC8MD_000),
824 PINMUX_DATA(CS3_MARK, PC8MD_001),
825 PINMUX_DATA(TXD7_MARK, PC8MD_010),
826 PINMUX_DATA(CTX1_MARK, PC8MD_011),
827
828 PINMUX_DATA(PC7_DATA, PC7MD_000),
829 PINMUX_DATA(CKE_MARK, PC7MD_001),
830 PINMUX_DATA(RXD7_MARK, PC7MD_010),
831 PINMUX_DATA(CRX1_MARK, PC7MD_011),
832 PINMUX_DATA(CRX0CRX1_MARK, PC7MD_100),
833 PINMUX_DATA(IRQ1_PC_MARK, PC7MD_101),
834
835 PINMUX_DATA(PC6_DATA, PC6MD_000),
836 PINMUX_DATA(CAS_MARK, PC6MD_001),
837 PINMUX_DATA(SCK7_MARK, PC6MD_010),
838 PINMUX_DATA(CTX0_MARK, PC6MD_011),
839
840 PINMUX_DATA(PC5_DATA, PC5MD_000),
841 PINMUX_DATA(RAS_MARK, PC5MD_001),
842 PINMUX_DATA(CRX0_MARK, PC5MD_011),
843 PINMUX_DATA(CTX0CTX1CTX2_MARK, PC5MD_100),
844 PINMUX_DATA(IRQ0_PC_MARK, PC5MD_101),
845
846 PINMUX_DATA(PC4_DATA, PC4MD_00),
847 PINMUX_DATA(WE1DQMUWE_MARK, PC4MD_01),
848 PINMUX_DATA(TXD6_MARK, PC4MD_10),
849
850 PINMUX_DATA(PC3_DATA, PC3MD_00),
851 PINMUX_DATA(WE0DQML_MARK, PC3MD_01),
852 PINMUX_DATA(RXD6_MARK, PC3MD_10),
853
854 PINMUX_DATA(PC2_DATA, PC2MD_00),
855 PINMUX_DATA(RDWR_MARK, PC2MD_01),
856 PINMUX_DATA(SCK5_MARK, PC2MD_10),
857
858 PINMUX_DATA(PC1_DATA, PC1MD_0),
859 PINMUX_DATA(RD_MARK, PC1MD_1),
860
861 PINMUX_DATA(PC0_DATA, PC0MD_0),
862 PINMUX_DATA(CS0_MARK, PC0MD_1),
863
864 /* Port D */
865 PINMUX_DATA(D15_MARK, PD15MD_01),
866 PINMUX_DATA(D14_MARK, PD14MD_01),
867
868 PINMUX_DATA(PD13_DATA, PD13MD_00),
869 PINMUX_DATA(D13_MARK, PD13MD_01),
870 PINMUX_DATA(PWM2F_MARK, PD13MD_10),
871
872 PINMUX_DATA(PD12_DATA, PD12MD_00),
873 PINMUX_DATA(D12_MARK, PD12MD_01),
874 PINMUX_DATA(PWM2E_MARK, PD12MD_10),
875
876 PINMUX_DATA(D11_MARK, PD11MD_01),
877 PINMUX_DATA(D10_MARK, PD10MD_01),
878 PINMUX_DATA(D9_MARK, PD9MD_01),
879 PINMUX_DATA(D8_MARK, PD8MD_01),
880 PINMUX_DATA(D7_MARK, PD7MD_01),
881 PINMUX_DATA(D6_MARK, PD6MD_01),
882 PINMUX_DATA(D5_MARK, PD5MD_01),
883 PINMUX_DATA(D4_MARK, PD4MD_01),
884 PINMUX_DATA(D3_MARK, PD3MD_01),
885 PINMUX_DATA(D2_MARK, PD2MD_01),
886 PINMUX_DATA(D1_MARK, PD1MD_01),
887 PINMUX_DATA(D0_MARK, PD0MD_01),
888
889 /* Port E */
890 PINMUX_DATA(PE7_DATA, PE7MD_00),
891 PINMUX_DATA(SDA3_MARK, PE7MD_01),
892 PINMUX_DATA(RXD7_MARK, PE7MD_10),
893
894 PINMUX_DATA(PE6_DATA, PE6MD_00),
895 PINMUX_DATA(SCL3_MARK, PE6MD_01),
896 PINMUX_DATA(RXD6_MARK, PE6MD_10),
897
898 PINMUX_DATA(PE5_DATA, PE5MD_00),
899 PINMUX_DATA(SDA2_MARK, PE5MD_01),
900 PINMUX_DATA(RXD5_MARK, PE5MD_10),
901 PINMUX_DATA(DV_HSYNC_MARK, PE5MD_11),
902
903 PINMUX_DATA(PE4_DATA, PE4MD_00),
904 PINMUX_DATA(SCL2_MARK, PE4MD_01),
905 PINMUX_DATA(DV_VSYNC_MARK, PE4MD_11),
906
907 PINMUX_DATA(PE3_DATA, PE3MD_000),
908 PINMUX_DATA(SDA1_MARK, PE3MD_001),
909 PINMUX_DATA(TCLKD_MARK, PE3MD_010),
910 PINMUX_DATA(ADTRG_MARK, PE3MD_011),
911 PINMUX_DATA(DV_HSYNC_MARK, PE3MD_100),
912
913 PINMUX_DATA(PE2_DATA, PE2MD_000),
914 PINMUX_DATA(SCL1_MARK, PE2MD_001),
915 PINMUX_DATA(TCLKD_MARK, PE2MD_010),
916 PINMUX_DATA(IOIS16_MARK, PE2MD_011),
917 PINMUX_DATA(DV_VSYNC_MARK, PE2MD_100),
918
919 PINMUX_DATA(PE1_DATA, PE1MD_000),
920 PINMUX_DATA(SDA0_MARK, PE1MD_001),
921 PINMUX_DATA(TCLKB_MARK, PE1MD_010),
922 PINMUX_DATA(AUDIO_CLK_MARK, PE1MD_010),
923 PINMUX_DATA(DV_CLK_MARK, PE1MD_100),
924
925 PINMUX_DATA(PE0_DATA, PE0MD_00),
926 PINMUX_DATA(SCL0_MARK, PE0MD_01),
927 PINMUX_DATA(TCLKA_MARK, PE0MD_10),
928 PINMUX_DATA(LCD_EXTCLK_MARK, PE0MD_11),
929
930 /* Port F */
931 PINMUX_DATA(PF23_DATA, PF23MD_000),
932 PINMUX_DATA(SD_D2_MARK, PF23MD_001),
933 PINMUX_DATA(TXD3_MARK, PF23MD_100),
934 PINMUX_DATA(MMC_D2_MARK, PF23MD_101),
935
936 PINMUX_DATA(PF22_DATA, PF22MD_000),
937 PINMUX_DATA(SD_D3_MARK, PF22MD_001),
938 PINMUX_DATA(RXD3_MARK, PF22MD_100),
939 PINMUX_DATA(MMC_D3_MARK, PF22MD_101),
940
941 PINMUX_DATA(PF21_DATA, PF21MD_000),
942 PINMUX_DATA(SD_CMD_MARK, PF21MD_001),
943 PINMUX_DATA(SCK3_MARK, PF21MD_100),
944 PINMUX_DATA(MMC_CMD_MARK, PF21MD_101),
945
946 PINMUX_DATA(PF20_DATA, PF20MD_000),
947 PINMUX_DATA(SD_CLK_MARK, PF20MD_001),
948 PINMUX_DATA(SSIDATA3_MARK, PF20MD_010),
949 PINMUX_DATA(MMC_CLK_MARK, PF20MD_101),
950
951 PINMUX_DATA(PF19_DATA, PF19MD_000),
952 PINMUX_DATA(SD_D0_MARK, PF19MD_001),
953 PINMUX_DATA(SSIWS3_MARK, PF19MD_010),
954 PINMUX_DATA(IRQ7_PF_MARK, PF19MD_100),
955 PINMUX_DATA(MMC_D0_MARK, PF19MD_101),
956
957 PINMUX_DATA(PF18_DATA, PF18MD_000),
958 PINMUX_DATA(SD_D1_MARK, PF18MD_001),
959 PINMUX_DATA(SSISCK3_MARK, PF18MD_010),
960 PINMUX_DATA(IRQ6_PF_MARK, PF18MD_100),
961 PINMUX_DATA(MMC_D1_MARK, PF18MD_101),
962
963 PINMUX_DATA(PF17_DATA, PF17MD_000),
964 PINMUX_DATA(SD_WP_MARK, PF17MD_001),
965 PINMUX_DATA(FRB_MARK, PF17MD_011),
966 PINMUX_DATA(IRQ5_PF_MARK, PF17MD_100),
967
968 PINMUX_DATA(PF16_DATA, PF16MD_000),
969 PINMUX_DATA(SD_CD_MARK, PF16MD_001),
970 PINMUX_DATA(FCE_MARK, PF16MD_011),
971 PINMUX_DATA(IRQ4_PF_MARK, PF16MD_100),
972 PINMUX_DATA(MMC_CD_MARK, PF16MD_101),
973
974 PINMUX_DATA(PF15_DATA, PF15MD_000),
975 PINMUX_DATA(A0_MARK, PF15MD_001),
976 PINMUX_DATA(SSIDATA2_MARK, PF15MD_010),
977 PINMUX_DATA(WDTOVF_MARK, PF15MD_011),
978 PINMUX_DATA(TXD2_MARK, PF15MD_100),
979
980 PINMUX_DATA(PF14_DATA, PF14MD_000),
981 PINMUX_DATA(A25_MARK, PF14MD_001),
982 PINMUX_DATA(SSIWS2_MARK, PF14MD_010),
983 PINMUX_DATA(RXD2_MARK, PF14MD_100),
984
985 PINMUX_DATA(PF13_DATA, PF13MD_000),
986 PINMUX_DATA(A24_MARK, PF13MD_001),
987 PINMUX_DATA(SSISCK2_MARK, PF13MD_010),
988 PINMUX_DATA(SCK2_MARK, PF13MD_100),
989
990 PINMUX_DATA(PF12_DATA, PF12MD_000),
991 PINMUX_DATA(SSIDATA1_MARK, PF12MD_010),
992 PINMUX_DATA(DV_DATA12_MARK, PF12MD_011),
993 PINMUX_DATA(TXD1_MARK, PF12MD_100),
994 PINMUX_DATA(MMC_D7_MARK, PF12MD_101),
995
996 PINMUX_DATA(PF11_DATA, PF11MD_000),
997 PINMUX_DATA(SSIWS1_MARK, PF11MD_010),
998 PINMUX_DATA(DV_DATA2_MARK, PF11MD_011),
999 PINMUX_DATA(RXD1_MARK, PF11MD_100),
1000 PINMUX_DATA(MMC_D6_MARK, PF11MD_101),
1001
1002 PINMUX_DATA(PF10_DATA, PF10MD_000),
1003 PINMUX_DATA(CS1_MARK, PF10MD_001),
1004 PINMUX_DATA(SSISCK1_MARK, PF10MD_010),
1005 PINMUX_DATA(DV_DATA1_MARK, PF10MD_011),
1006 PINMUX_DATA(SCK1_MARK, PF10MD_100),
1007 PINMUX_DATA(MMC_D5_MARK, PF10MD_101),
1008
1009 PINMUX_DATA(PF9_DATA, PF9MD_000),
1010 PINMUX_DATA(BS_MARK, PF9MD_001),
1011 PINMUX_DATA(DV_DATA0_MARK, PF9MD_011),
1012 PINMUX_DATA(SCK0_MARK, PF9MD_100),
1013 PINMUX_DATA(MMC_D4_MARK, PF9MD_101),
1014 PINMUX_DATA(RTS1_MARK, PF9MD_110),
1015
1016 PINMUX_DATA(PF8_DATA, PF8MD_000),
1017 PINMUX_DATA(A23_MARK, PF8MD_001),
1018 PINMUX_DATA(TXD0_MARK, PF8MD_100),
1019
1020 PINMUX_DATA(PF7_DATA, PF7MD_000),
1021 PINMUX_DATA(SSIRXD0_MARK, PF7MD_010),
1022 PINMUX_DATA(RXD0_MARK, PF7MD_100),
1023 PINMUX_DATA(CTS1_MARK, PF7MD_110),
1024
1025 PINMUX_DATA(PF6_DATA, PF6MD_000),
1026 PINMUX_DATA(CE2A_MARK, PF6MD_001),
1027 PINMUX_DATA(SSITXD0_MARK, PF6MD_010),
1028
1029 PINMUX_DATA(PF5_DATA, PF5MD_000),
1030 PINMUX_DATA(SSIWS0_MARK, PF5MD_010),
1031
1032 PINMUX_DATA(PF4_DATA, PF4MD_000),
1033 PINMUX_DATA(CS5CE1A_MARK, PF4MD_001),
1034 PINMUX_DATA(SSISCK0_MARK, PF4MD_010),
1035
1036 PINMUX_DATA(PF3_DATA, PF3MD_000),
1037 PINMUX_DATA(CS2_MARK, PF3MD_001),
1038 PINMUX_DATA(MISO1_MARK, PF3MD_011),
1039 PINMUX_DATA(TIOC4D_MARK, PF3MD_100),
1040
1041 PINMUX_DATA(PF2_DATA, PF2MD_000),
1042 PINMUX_DATA(WAIT_MARK, PF2MD_001),
1043 PINMUX_DATA(MOSI1_MARK, PF2MD_011),
1044 PINMUX_DATA(TIOC4C_MARK, PF2MD_100),
1045 PINMUX_DATA(TEND0_MARK, PF2MD_101),
1046
1047 PINMUX_DATA(PF1_DATA, PF1MD_000),
1048 PINMUX_DATA(BACK_MARK, PF1MD_001),
1049 PINMUX_DATA(SSL10_MARK, PF1MD_011),
1050 PINMUX_DATA(TIOC4B_MARK, PF1MD_100),
1051 PINMUX_DATA(DACK0_MARK, PF1MD_101),
1052
1053 PINMUX_DATA(PF0_DATA, PF0MD_000),
1054 PINMUX_DATA(BREQ_MARK, PF0MD_001),
1055 PINMUX_DATA(RSPCK1_MARK, PF0MD_011),
1056 PINMUX_DATA(TIOC4A_MARK, PF0MD_100),
1057 PINMUX_DATA(DREQ0_MARK, PF0MD_101),
1058
1059 /* Port G */
1060 PINMUX_DATA(PG27_DATA, PG27MD_00),
1061 PINMUX_DATA(LCD_TCON2_MARK, PG27MD_10),
1062 PINMUX_DATA(LCD_EXTCLK_MARK, PG27MD_11),
1063 PINMUX_DATA(LCD_DE_MARK, PG27MD_11),
1064
1065 PINMUX_DATA(PG26_DATA, PG26MD_00),
1066 PINMUX_DATA(LCD_TCON1_MARK, PG26MD_10),
1067 PINMUX_DATA(LCD_HSYNC_MARK, PG26MD_10),
1068
1069 PINMUX_DATA(PG25_DATA, PG25MD_00),
1070 PINMUX_DATA(LCD_TCON0_MARK, PG25MD_10),
1071 PINMUX_DATA(LCD_VSYNC_MARK, PG25MD_10),
1072
1073 PINMUX_DATA(PG24_DATA, PG24MD_00),
1074 PINMUX_DATA(LCD_CLK_MARK, PG24MD_10),
1075
1076 PINMUX_DATA(PG23_DATA, PG23MD_000),
1077 PINMUX_DATA(LCD_DATA23_PG23_MARK, PG23MD_010),
1078 PINMUX_DATA(LCD_TCON6_MARK, PG23MD_011),
1079 PINMUX_DATA(TXD5_MARK, PG23MD_100),
1080
1081 PINMUX_DATA(PG22_DATA, PG22MD_000),
1082 PINMUX_DATA(LCD_DATA22_PG22_MARK, PG22MD_010),
1083 PINMUX_DATA(LCD_TCON5_MARK, PG22MD_011),
1084 PINMUX_DATA(RXD5_MARK, PG22MD_100),
1085
1086 PINMUX_DATA(PG21_DATA, PG21MD_000),
1087 PINMUX_DATA(DV_DATA7_MARK, PG21MD_001),
1088 PINMUX_DATA(LCD_DATA21_PG21_MARK, PG21MD_010),
1089 PINMUX_DATA(LCD_TCON4_MARK, PG21MD_011),
1090 PINMUX_DATA(TXD4_MARK, PG21MD_100),
1091
1092 PINMUX_DATA(PG20_DATA, PG20MD_000),
1093 PINMUX_DATA(DV_DATA6_MARK, PG20MD_001),
1094 PINMUX_DATA(LCD_DATA20_PG20_MARK, PG21MD_010),
1095 PINMUX_DATA(LCD_TCON3_MARK, PG20MD_011),
1096 PINMUX_DATA(RXD4_MARK, PG20MD_100),
1097
1098 PINMUX_DATA(PG19_DATA, PG19MD_000),
1099 PINMUX_DATA(DV_DATA5_MARK, PG19MD_001),
1100 PINMUX_DATA(LCD_DATA19_PG19_MARK, PG19MD_010),
1101 PINMUX_DATA(SPDIF_OUT_MARK, PG19MD_011),
1102 PINMUX_DATA(SCK5_MARK, PG19MD_100),
1103
1104 PINMUX_DATA(PG18_DATA, PG18MD_000),
1105 PINMUX_DATA(DV_DATA4_MARK, PG18MD_001),
1106 PINMUX_DATA(LCD_DATA18_PG18_MARK, PG18MD_010),
1107 PINMUX_DATA(SPDIF_IN_MARK, PG18MD_011),
1108 PINMUX_DATA(SCK4_MARK, PG18MD_100),
1109
1110// TODO hardware manual has PG17 3 bits wide in reg picture and 2 bits in description
1111// we're going with 2 bits
1112 PINMUX_DATA(PG17_DATA, PG17MD_00),
1113 PINMUX_DATA(WE3ICIOWRAHDQMUU_MARK, PG17MD_01),
1114 PINMUX_DATA(LCD_DATA17_PG17_MARK, PG17MD_10),
1115
1116// TODO hardware manual has PG16 3 bits wide in reg picture and 2 bits in description
1117// we're going with 2 bits
1118 PINMUX_DATA(PG16_DATA, PG16MD_00),
1119 PINMUX_DATA(WE2ICIORDDQMUL_MARK, PG16MD_01),
1120 PINMUX_DATA(LCD_DATA16_PG16_MARK, PG16MD_10),
1121
1122 PINMUX_DATA(PG15_DATA, PG15MD_00),
1123 PINMUX_DATA(D31_MARK, PG15MD_01),
1124 PINMUX_DATA(LCD_DATA15_PG15_MARK, PG15MD_10),
1125 PINMUX_DATA(PINT7_PG_MARK, PG15MD_11),
1126
1127 PINMUX_DATA(PG14_DATA, PG14MD_00),
1128 PINMUX_DATA(D30_MARK, PG14MD_01),
1129 PINMUX_DATA(LCD_DATA14_PG14_MARK, PG14MD_10),
1130 PINMUX_DATA(PINT6_PG_MARK, PG14MD_11),
1131
1132 PINMUX_DATA(PG13_DATA, PG13MD_00),
1133 PINMUX_DATA(D29_MARK, PG13MD_01),
1134 PINMUX_DATA(LCD_DATA13_PG13_MARK, PG13MD_10),
1135 PINMUX_DATA(PINT5_PG_MARK, PG13MD_11),
1136
1137 PINMUX_DATA(PG12_DATA, PG12MD_00),
1138 PINMUX_DATA(D28_MARK, PG12MD_01),
1139 PINMUX_DATA(LCD_DATA12_PG12_MARK, PG12MD_10),
1140 PINMUX_DATA(PINT4_PG_MARK, PG12MD_11),
1141
1142 PINMUX_DATA(PG11_DATA, PG11MD_000),
1143 PINMUX_DATA(D27_MARK, PG11MD_001),
1144 PINMUX_DATA(LCD_DATA11_PG11_MARK, PG11MD_010),
1145 PINMUX_DATA(PINT3_PG_MARK, PG11MD_011),
1146 PINMUX_DATA(TIOC3D_MARK, PG11MD_100),
1147
1148 PINMUX_DATA(PG10_DATA, PG10MD_000),
1149 PINMUX_DATA(D26_MARK, PG10MD_001),
1150 PINMUX_DATA(LCD_DATA10_PG10_MARK, PG10MD_010),
1151 PINMUX_DATA(PINT2_PG_MARK, PG10MD_011),
1152 PINMUX_DATA(TIOC3C_MARK, PG10MD_100),
1153
1154 PINMUX_DATA(PG9_DATA, PG9MD_000),
1155 PINMUX_DATA(D25_MARK, PG9MD_001),
1156 PINMUX_DATA(LCD_DATA9_PG9_MARK, PG9MD_010),
1157 PINMUX_DATA(PINT1_PG_MARK, PG9MD_011),
1158 PINMUX_DATA(TIOC3B_MARK, PG9MD_100),
1159
1160 PINMUX_DATA(PG8_DATA, PG8MD_000),
1161 PINMUX_DATA(D24_MARK, PG8MD_001),
1162 PINMUX_DATA(LCD_DATA8_PG8_MARK, PG8MD_010),
1163 PINMUX_DATA(PINT0_PG_MARK, PG8MD_011),
1164 PINMUX_DATA(TIOC3A_MARK, PG8MD_100),
1165
1166 PINMUX_DATA(PG7_DATA, PG7MD_000),
1167 PINMUX_DATA(D23_MARK, PG7MD_001),
1168 PINMUX_DATA(LCD_DATA7_PG7_MARK, PG7MD_010),
1169 PINMUX_DATA(IRQ7_PG_MARK, PG7MD_011),
1170 PINMUX_DATA(TIOC2B_MARK, PG7MD_100),
1171
1172 PINMUX_DATA(PG6_DATA, PG6MD_000),
1173 PINMUX_DATA(D22_MARK, PG6MD_001),
1174 PINMUX_DATA(LCD_DATA6_PG6_MARK, PG6MD_010),
1175 PINMUX_DATA(IRQ6_PG_MARK, PG6MD_011),
1176 PINMUX_DATA(TIOC2A_MARK, PG6MD_100),
1177
1178 PINMUX_DATA(PG5_DATA, PG5MD_000),
1179 PINMUX_DATA(D21_MARK, PG5MD_001),
1180 PINMUX_DATA(LCD_DATA5_PG5_MARK, PG5MD_010),
1181 PINMUX_DATA(IRQ5_PG_MARK, PG5MD_011),
1182 PINMUX_DATA(TIOC1B_MARK, PG5MD_100),
1183
1184 PINMUX_DATA(PG4_DATA, PG4MD_000),
1185 PINMUX_DATA(D20_MARK, PG4MD_001),
1186 PINMUX_DATA(LCD_DATA4_PG4_MARK, PG4MD_010),
1187 PINMUX_DATA(IRQ4_PG_MARK, PG4MD_011),
1188 PINMUX_DATA(TIOC1A_MARK, PG4MD_100),
1189
1190 PINMUX_DATA(PG3_DATA, PG3MD_000),
1191 PINMUX_DATA(D19_MARK, PG3MD_001),
1192 PINMUX_DATA(LCD_DATA3_PG3_MARK, PG3MD_010),
1193 PINMUX_DATA(IRQ3_PG_MARK, PG3MD_011),
1194 PINMUX_DATA(TIOC0D_MARK, PG3MD_100),
1195
1196 PINMUX_DATA(PG2_DATA, PG2MD_000),
1197 PINMUX_DATA(D18_MARK, PG2MD_001),
1198 PINMUX_DATA(LCD_DATA2_PG2_MARK, PG2MD_010),
1199 PINMUX_DATA(IRQ2_PG_MARK, PG2MD_011),
1200 PINMUX_DATA(TIOC0C_MARK, PG2MD_100),
1201
1202 PINMUX_DATA(PG1_DATA, PG1MD_000),
1203 PINMUX_DATA(D17_MARK, PG1MD_001),
1204 PINMUX_DATA(LCD_DATA1_PG1_MARK, PG1MD_010),
1205 PINMUX_DATA(IRQ1_PG_MARK, PG1MD_011),
1206 PINMUX_DATA(TIOC0B_MARK, PG1MD_100),
1207
1208 PINMUX_DATA(PG0_DATA, PG0MD_000),
1209 PINMUX_DATA(D16_MARK, PG0MD_001),
1210 PINMUX_DATA(LCD_DATA0_PG0_MARK, PG0MD_010),
1211 PINMUX_DATA(IRQ0_PG_MARK, PG0MD_011),
1212 PINMUX_DATA(TIOC0A_MARK, PG0MD_100),
1213
1214 /* Port H */
1215 PINMUX_DATA(PH7_DATA, PH7MD_00),
1216 PINMUX_DATA(PHAN7_MARK, PH7MD_01),
1217 PINMUX_DATA(PINT7_PH_MARK, PH7MD_10),
1218
1219 PINMUX_DATA(PH6_DATA, PH6MD_00),
1220 PINMUX_DATA(PHAN6_MARK, PH6MD_01),
1221 PINMUX_DATA(PINT6_PH_MARK, PH6MD_10),
1222
1223 PINMUX_DATA(PH5_DATA, PH5MD_00),
1224 PINMUX_DATA(PHAN5_MARK, PH5MD_01),
1225 PINMUX_DATA(PINT5_PH_MARK, PH5MD_10),
1226 PINMUX_DATA(LCD_EXTCLK_MARK, PH5MD_11),
1227
1228 PINMUX_DATA(PH4_DATA, PH4MD_00),
1229 PINMUX_DATA(PHAN4_MARK, PH4MD_01),
1230 PINMUX_DATA(PINT4_PH_MARK, PH4MD_10),
1231
1232 PINMUX_DATA(PH3_DATA, PH3MD_00),
1233 PINMUX_DATA(PHAN3_MARK, PH3MD_01),
1234 PINMUX_DATA(PINT3_PH_MARK, PH3MD_10),
1235
1236 PINMUX_DATA(PH2_DATA, PH2MD_00),
1237 PINMUX_DATA(PHAN2_MARK, PH2MD_01),
1238 PINMUX_DATA(PINT2_PH_MARK, PH2MD_10),
1239
1240 PINMUX_DATA(PH1_DATA, PH1MD_00),
1241 PINMUX_DATA(PHAN1_MARK, PH1MD_01),
1242 PINMUX_DATA(PINT1_PH_MARK, PH1MD_10),
1243
1244 PINMUX_DATA(PH0_DATA, PH0MD_00),
1245 PINMUX_DATA(PHAN0_MARK, PH0MD_01),
1246 PINMUX_DATA(PINT0_PH_MARK, PH0MD_10),
1247
1248 /* Port I - not on device */
1249
1250 /* Port J */
1251 PINMUX_DATA(PJ31_DATA, PJ31MD_0),
1252 PINMUX_DATA(DV_CLK_MARK, PJ31MD_1),
1253
1254 PINMUX_DATA(PJ30_DATA, PJ30MD_000),
1255 PINMUX_DATA(SSIDATA5_MARK, PJ30MD_010),
1256 PINMUX_DATA(TIOC2B_MARK, PJ30MD_100),
1257 PINMUX_DATA(IETXD_MARK, PJ30MD_101),
1258
1259 PINMUX_DATA(PJ29_DATA, PJ29MD_000),
1260 PINMUX_DATA(SSIWS5_MARK, PJ29MD_010),
1261 PINMUX_DATA(TIOC2A_MARK, PJ29MD_100),
1262 PINMUX_DATA(IERXD_MARK, PJ29MD_101),
1263
1264 PINMUX_DATA(PJ28_DATA, PJ28MD_000),
1265 PINMUX_DATA(SSISCK5_MARK, PJ28MD_010),
1266 PINMUX_DATA(TIOC1B_MARK, PJ28MD_100),
1267 PINMUX_DATA(RTS7_MARK, PJ28MD_101),
1268
1269 PINMUX_DATA(PJ27_DATA, PJ27MD_000),
1270 PINMUX_DATA(TIOC1A_MARK, PJ27MD_100),
1271 PINMUX_DATA(CTS7_MARK, PJ27MD_101),
1272
1273 PINMUX_DATA(PJ26_DATA, PJ26MD_000),
1274 PINMUX_DATA(SSIDATA4_MARK, PJ26MD_010),
1275 PINMUX_DATA(LCD_TCON5_MARK, PJ26MD_011),
1276 PINMUX_DATA(TXD7_MARK, PJ26MD_101),
1277
1278 PINMUX_DATA(PJ25_DATA, PJ25MD_000),
1279 PINMUX_DATA(SSIWS4_MARK, PJ25MD_010),
1280 PINMUX_DATA(LCD_TCON4_MARK, PJ25MD_011),
1281 PINMUX_DATA(SPDIF_OUT_MARK, PJ25MD_100),
1282 PINMUX_DATA(RXD7_MARK, PJ25MD_101),
1283
1284 PINMUX_DATA(PJ24_DATA, PJ24MD_000),
1285 PINMUX_DATA(SSISCK4_MARK, PJ24MD_010),
1286 PINMUX_DATA(LCD_TCON3_MARK, PJ24MD_011),
1287 PINMUX_DATA(SPDIF_IN_MARK, PJ24MD_100),
1288 PINMUX_DATA(SCK7_MARK, PJ24MD_101),
1289
1290 PINMUX_DATA(PJ23_DATA, PJ23MD_000),
1291 PINMUX_DATA(DV_DATA23_MARK, PJ23MD_001),
1292 PINMUX_DATA(LCD_DATA23_PJ23_MARK, PJ23MD_010),
1293 PINMUX_DATA(LCD_TCON6_MARK, PJ23MD_011),
1294 PINMUX_DATA(IRQ3_PJ_MARK, PJ23MD_100),
1295 PINMUX_DATA(CTX1_MARK, PJ23MD_101),
1296
1297 PINMUX_DATA(PJ22_DATA, PJ22MD_000),
1298 PINMUX_DATA(DV_DATA22_MARK, PJ22MD_001),
1299 PINMUX_DATA(LCD_DATA22_PJ22_MARK, PJ22MD_010),
1300 PINMUX_DATA(LCD_TCON5_MARK, PJ22MD_011),
1301 PINMUX_DATA(IRQ2_PJ_MARK, PJ22MD_100),
1302 PINMUX_DATA(CRX1_MARK, PJ22MD_101),
1303 PINMUX_DATA(CRX0CRX1_MARK, PJ22MD_110),
1304
1305 PINMUX_DATA(PJ21_DATA, PJ21MD_000),
1306 PINMUX_DATA(DV_DATA21_MARK, PJ21MD_001),
1307 PINMUX_DATA(LCD_DATA21_PJ21_MARK, PJ21MD_010),
1308 PINMUX_DATA(LCD_TCON4_MARK, PJ21MD_011),
1309 PINMUX_DATA(IRQ1_PJ_MARK, PJ21MD_100),
1310 PINMUX_DATA(CTX2_MARK, PJ21MD_101),
1311
1312 PINMUX_DATA(PJ20_DATA, PJ20MD_000),
1313 PINMUX_DATA(DV_DATA20_MARK, PJ20MD_001),
1314 PINMUX_DATA(LCD_DATA20_PJ20_MARK, PJ20MD_010),
1315 PINMUX_DATA(LCD_TCON3_MARK, PJ20MD_011),
1316 PINMUX_DATA(IRQ0_PJ_MARK, PJ20MD_100),
1317 PINMUX_DATA(CRX2_MARK, PJ20MD_101),
1318 PINMUX_DATA(CRX0CRX1CRX2_PJ20_MARK, PJ20MD_110),
1319
1320 PINMUX_DATA(PJ19_DATA, PJ19MD_000),
1321 PINMUX_DATA(DV_DATA19_MARK, PJ19MD_001),
1322 PINMUX_DATA(LCD_DATA19_PJ19_MARK, PJ19MD_010),
1323 PINMUX_DATA(MISO0_PJ19_MARK, PJ19MD_011),
1324 PINMUX_DATA(TIOC0D_MARK, PJ19MD_100),
1325 PINMUX_DATA(SIOFRXD_MARK, PJ19MD_101),
1326 PINMUX_DATA(AUDIO_XOUT_MARK, PJ19MD_110),
1327
1328 PINMUX_DATA(PJ18_DATA, PJ18MD_000),
1329 PINMUX_DATA(DV_DATA18_MARK, PJ18MD_001),
1330 PINMUX_DATA(LCD_DATA18_PJ18_MARK, PJ18MD_010),
1331 PINMUX_DATA(MOSI0_PJ18_MARK, PJ18MD_011),
1332 PINMUX_DATA(TIOC0C_MARK, PJ18MD_100),
1333 PINMUX_DATA(SIOFTXD_MARK, PJ18MD_101),
1334
1335 PINMUX_DATA(PJ17_DATA, PJ17MD_000),
1336 PINMUX_DATA(DV_DATA17_MARK, PJ17MD_001),
1337 PINMUX_DATA(LCD_DATA17_PJ17_MARK, PJ17MD_010),
1338 PINMUX_DATA(SSL00_PJ17_MARK, PJ17MD_011),
1339 PINMUX_DATA(TIOC0B_MARK, PJ17MD_100),
1340 PINMUX_DATA(SIOFSYNC_MARK, PJ17MD_101),
1341
1342 PINMUX_DATA(PJ16_DATA, PJ16MD_000),
1343 PINMUX_DATA(DV_DATA16_MARK, PJ16MD_001),
1344 PINMUX_DATA(LCD_DATA16_PJ16_MARK, PJ16MD_010),
1345 PINMUX_DATA(RSPCK0_PJ16_MARK, PJ16MD_011),
1346 PINMUX_DATA(TIOC0A_MARK, PJ16MD_100),
1347 PINMUX_DATA(SIOFSCK_MARK, PJ16MD_101),
1348
1349 PINMUX_DATA(PJ15_DATA, PJ15MD_000),
1350 PINMUX_DATA(DV_DATA15_MARK, PJ15MD_001),
1351 PINMUX_DATA(LCD_DATA15_PJ15_MARK, PJ15MD_010),
1352 PINMUX_DATA(PINT7_PJ_MARK, PJ15MD_011),
1353 PINMUX_DATA(PWM2H_MARK, PJ15MD_100),
1354 PINMUX_DATA(TXD7_MARK, PJ15MD_101),
1355
1356 PINMUX_DATA(PJ14_DATA, PJ14MD_000),
1357 PINMUX_DATA(DV_DATA14_MARK, PJ14MD_001),
1358 PINMUX_DATA(LCD_DATA14_PJ14_MARK, PJ14MD_010),
1359 PINMUX_DATA(PINT6_PJ_MARK, PJ14MD_011),
1360 PINMUX_DATA(PWM2G_MARK, PJ14MD_100),
1361 PINMUX_DATA(TXD6_MARK, PJ14MD_101),
1362
1363 PINMUX_DATA(PJ13_DATA, PJ13MD_000),
1364 PINMUX_DATA(DV_DATA13_MARK, PJ13MD_001),
1365 PINMUX_DATA(LCD_DATA13_PJ13_MARK, PJ13MD_010),
1366 PINMUX_DATA(PINT5_PJ_MARK, PJ13MD_011),
1367 PINMUX_DATA(PWM2F_MARK, PJ13MD_100),
1368 PINMUX_DATA(TXD5_MARK, PJ13MD_101),
1369
1370 PINMUX_DATA(PJ12_DATA, PJ12MD_000),
1371 PINMUX_DATA(DV_DATA12_MARK, PJ12MD_001),
1372 PINMUX_DATA(LCD_DATA12_PJ12_MARK, PJ12MD_010),
1373 PINMUX_DATA(PINT4_PJ_MARK, PJ12MD_011),
1374 PINMUX_DATA(PWM2E_MARK, PJ12MD_100),
1375 PINMUX_DATA(SCK7_MARK, PJ12MD_101),
1376
1377 PINMUX_DATA(PJ11_DATA, PJ11MD_000),
1378 PINMUX_DATA(DV_DATA11_MARK, PJ11MD_001),
1379 PINMUX_DATA(LCD_DATA11_PJ11_MARK, PJ11MD_010),
1380 PINMUX_DATA(PINT3_PJ_MARK, PJ11MD_011),
1381 PINMUX_DATA(PWM2D_MARK, PJ11MD_100),
1382 PINMUX_DATA(SCK6_MARK, PJ11MD_101),
1383
1384 PINMUX_DATA(PJ10_DATA, PJ10MD_000),
1385 PINMUX_DATA(DV_DATA10_MARK, PJ10MD_001),
1386 PINMUX_DATA(LCD_DATA10_PJ10_MARK, PJ10MD_010),
1387 PINMUX_DATA(PINT2_PJ_MARK, PJ10MD_011),
1388 PINMUX_DATA(PWM2C_MARK, PJ10MD_100),
1389 PINMUX_DATA(SCK5_MARK, PJ10MD_101),
1390
1391 PINMUX_DATA(PJ9_DATA, PJ9MD_000),
1392 PINMUX_DATA(DV_DATA9_MARK, PJ9MD_001),
1393 PINMUX_DATA(LCD_DATA9_PJ9_MARK, PJ9MD_010),
1394 PINMUX_DATA(PINT1_PJ_MARK, PJ9MD_011),
1395 PINMUX_DATA(PWM2B_MARK, PJ9MD_100),
1396 PINMUX_DATA(RTS5_MARK, PJ9MD_101),
1397
1398 PINMUX_DATA(PJ8_DATA, PJ8MD_000),
1399 PINMUX_DATA(DV_DATA8_MARK, PJ8MD_001),
1400 PINMUX_DATA(LCD_DATA8_PJ8_MARK, PJ8MD_010),
1401 PINMUX_DATA(PINT0_PJ_MARK, PJ8MD_011),
1402 PINMUX_DATA(PWM2A_MARK, PJ8MD_100),
1403 PINMUX_DATA(CTS5_MARK, PJ8MD_101),
1404
1405 PINMUX_DATA(PJ7_DATA, PJ7MD_000),
1406 PINMUX_DATA(DV_DATA7_MARK, PJ7MD_001),
1407 PINMUX_DATA(LCD_DATA7_PJ7_MARK, PJ7MD_010),
1408 PINMUX_DATA(SD_D2_MARK, PJ7MD_011),
1409 PINMUX_DATA(PWM1H_MARK, PJ7MD_100),
1410
1411 PINMUX_DATA(PJ6_DATA, PJ6MD_000),
1412 PINMUX_DATA(DV_DATA6_MARK, PJ6MD_001),
1413 PINMUX_DATA(LCD_DATA6_PJ6_MARK, PJ6MD_010),
1414 PINMUX_DATA(SD_D3_MARK, PJ6MD_011),
1415 PINMUX_DATA(PWM1G_MARK, PJ6MD_100),
1416
1417 PINMUX_DATA(PJ5_DATA, PJ5MD_000),
1418 PINMUX_DATA(DV_DATA5_MARK, PJ5MD_001),
1419 PINMUX_DATA(LCD_DATA5_PJ5_MARK, PJ5MD_010),
1420 PINMUX_DATA(SD_CMD_MARK, PJ5MD_011),
1421 PINMUX_DATA(PWM1F_MARK, PJ5MD_100),
1422
1423 PINMUX_DATA(PJ4_DATA, PJ4MD_000),
1424 PINMUX_DATA(DV_DATA4_MARK, PJ4MD_001),
1425 PINMUX_DATA(LCD_DATA4_PJ4_MARK, PJ4MD_010),
1426 PINMUX_DATA(SD_CLK_MARK, PJ4MD_011),
1427 PINMUX_DATA(PWM1E_MARK, PJ4MD_100),
1428
1429 PINMUX_DATA(PJ3_DATA, PJ3MD_000),
1430 PINMUX_DATA(DV_DATA3_MARK, PJ3MD_001),
1431 PINMUX_DATA(LCD_DATA3_PJ3_MARK, PJ3MD_010),
1432 PINMUX_DATA(SD_D0_MARK, PJ3MD_011),
1433 PINMUX_DATA(PWM1D_MARK, PJ3MD_100),
1434
1435 PINMUX_DATA(PJ2_DATA, PJ2MD_000),
1436 PINMUX_DATA(DV_DATA2_MARK, PJ2MD_001),
1437 PINMUX_DATA(LCD_DATA2_PJ2_MARK, PJ2MD_010),
1438 PINMUX_DATA(SD_D1_MARK, PJ2MD_011),
1439 PINMUX_DATA(PWM1C_MARK, PJ2MD_100),
1440
1441 PINMUX_DATA(PJ1_DATA, PJ1MD_000),
1442 PINMUX_DATA(DV_DATA1_MARK, PJ1MD_001),
1443 PINMUX_DATA(LCD_DATA1_PJ1_MARK, PJ1MD_010),
1444 PINMUX_DATA(SD_WP_MARK, PJ1MD_011),
1445 PINMUX_DATA(PWM1B_MARK, PJ1MD_100),
1446
1447 PINMUX_DATA(PJ0_DATA, PJ0MD_000),
1448 PINMUX_DATA(DV_DATA0_MARK, PJ0MD_001),
1449 PINMUX_DATA(LCD_DATA0_PJ0_MARK, PJ0MD_010),
1450 PINMUX_DATA(SD_CD_MARK, PJ0MD_011),
1451 PINMUX_DATA(PWM1A_MARK, PJ0MD_100),
1452};
1453
1454static struct pinmux_gpio pinmux_gpios[] = {
1455 /* Port A */
1456 PINMUX_GPIO(GPIO_PA1, PA1_DATA),
1457 PINMUX_GPIO(GPIO_PA0, PA0_DATA),
1458
1459 /* Port B */
1460 PINMUX_GPIO(GPIO_PB22, PB22_DATA),
1461 PINMUX_GPIO(GPIO_PB21, PB21_DATA),
1462 PINMUX_GPIO(GPIO_PB20, PB20_DATA),
1463 PINMUX_GPIO(GPIO_PB19, PB19_DATA),
1464 PINMUX_GPIO(GPIO_PB18, PB18_DATA),
1465 PINMUX_GPIO(GPIO_PB17, PB17_DATA),
1466 PINMUX_GPIO(GPIO_PB16, PB16_DATA),
1467 PINMUX_GPIO(GPIO_PB15, PB15_DATA),
1468 PINMUX_GPIO(GPIO_PB14, PB14_DATA),
1469 PINMUX_GPIO(GPIO_PB13, PB13_DATA),
1470 PINMUX_GPIO(GPIO_PB12, PB12_DATA),
1471 PINMUX_GPIO(GPIO_PB11, PB11_DATA),
1472 PINMUX_GPIO(GPIO_PB10, PB10_DATA),
1473 PINMUX_GPIO(GPIO_PB9, PB9_DATA),
1474 PINMUX_GPIO(GPIO_PB8, PB8_DATA),
1475 PINMUX_GPIO(GPIO_PB7, PB7_DATA),
1476 PINMUX_GPIO(GPIO_PB6, PB6_DATA),
1477 PINMUX_GPIO(GPIO_PB5, PB5_DATA),
1478 PINMUX_GPIO(GPIO_PB4, PB4_DATA),
1479 PINMUX_GPIO(GPIO_PB3, PB3_DATA),
1480 PINMUX_GPIO(GPIO_PB2, PB2_DATA),
1481 PINMUX_GPIO(GPIO_PB1, PB1_DATA),
1482
1483 /* Port C */
1484 PINMUX_GPIO(GPIO_PC8, PC8_DATA),
1485 PINMUX_GPIO(GPIO_PC7, PC7_DATA),
1486 PINMUX_GPIO(GPIO_PC6, PC6_DATA),
1487 PINMUX_GPIO(GPIO_PC5, PC5_DATA),
1488 PINMUX_GPIO(GPIO_PC4, PC4_DATA),
1489 PINMUX_GPIO(GPIO_PC3, PC3_DATA),
1490 PINMUX_GPIO(GPIO_PC2, PC2_DATA),
1491 PINMUX_GPIO(GPIO_PC1, PC1_DATA),
1492 PINMUX_GPIO(GPIO_PC0, PC0_DATA),
1493
1494 /* Port D */
1495 PINMUX_GPIO(GPIO_PD15, PD15_DATA),
1496 PINMUX_GPIO(GPIO_PD14, PD14_DATA),
1497 PINMUX_GPIO(GPIO_PD13, PD13_DATA),
1498 PINMUX_GPIO(GPIO_PD12, PD12_DATA),
1499 PINMUX_GPIO(GPIO_PD11, PD11_DATA),
1500 PINMUX_GPIO(GPIO_PD10, PD10_DATA),
1501 PINMUX_GPIO(GPIO_PD9, PD9_DATA),
1502 PINMUX_GPIO(GPIO_PD8, PD8_DATA),
1503 PINMUX_GPIO(GPIO_PD7, PD7_DATA),
1504 PINMUX_GPIO(GPIO_PD6, PD6_DATA),
1505 PINMUX_GPIO(GPIO_PD5, PD5_DATA),
1506 PINMUX_GPIO(GPIO_PD4, PD4_DATA),
1507 PINMUX_GPIO(GPIO_PD3, PD3_DATA),
1508 PINMUX_GPIO(GPIO_PD2, PD2_DATA),
1509 PINMUX_GPIO(GPIO_PD1, PD1_DATA),
1510 PINMUX_GPIO(GPIO_PD0, PD0_DATA),
1511
1512 /* Port E */
1513 PINMUX_GPIO(GPIO_PE7, PE7_DATA),
1514 PINMUX_GPIO(GPIO_PE6, PE6_DATA),
1515 PINMUX_GPIO(GPIO_PE5, PE5_DATA),
1516 PINMUX_GPIO(GPIO_PE4, PE4_DATA),
1517 PINMUX_GPIO(GPIO_PE3, PE3_DATA),
1518 PINMUX_GPIO(GPIO_PE2, PE2_DATA),
1519 PINMUX_GPIO(GPIO_PE1, PE1_DATA),
1520 PINMUX_GPIO(GPIO_PE0, PE0_DATA),
1521
1522 /* Port F */
1523 PINMUX_GPIO(GPIO_PF23, PF23_DATA),
1524 PINMUX_GPIO(GPIO_PF22, PF22_DATA),
1525 PINMUX_GPIO(GPIO_PF21, PF21_DATA),
1526 PINMUX_GPIO(GPIO_PF20, PF20_DATA),
1527 PINMUX_GPIO(GPIO_PF19, PF19_DATA),
1528 PINMUX_GPIO(GPIO_PF18, PF18_DATA),
1529 PINMUX_GPIO(GPIO_PF17, PF17_DATA),
1530 PINMUX_GPIO(GPIO_PF16, PF16_DATA),
1531 PINMUX_GPIO(GPIO_PF15, PF15_DATA),
1532 PINMUX_GPIO(GPIO_PF14, PF14_DATA),
1533 PINMUX_GPIO(GPIO_PF13, PF13_DATA),
1534 PINMUX_GPIO(GPIO_PF12, PF12_DATA),
1535 PINMUX_GPIO(GPIO_PF11, PF11_DATA),
1536 PINMUX_GPIO(GPIO_PF10, PF10_DATA),
1537 PINMUX_GPIO(GPIO_PF9, PF9_DATA),
1538 PINMUX_GPIO(GPIO_PF8, PF8_DATA),
1539 PINMUX_GPIO(GPIO_PF7, PF7_DATA),
1540 PINMUX_GPIO(GPIO_PF6, PF6_DATA),
1541 PINMUX_GPIO(GPIO_PF5, PF5_DATA),
1542 PINMUX_GPIO(GPIO_PF4, PF4_DATA),
1543 PINMUX_GPIO(GPIO_PF3, PF3_DATA),
1544 PINMUX_GPIO(GPIO_PF2, PF2_DATA),
1545 PINMUX_GPIO(GPIO_PF1, PF1_DATA),
1546 PINMUX_GPIO(GPIO_PF0, PF0_DATA),
1547
1548 /* Port G */
1549 PINMUX_GPIO(GPIO_PG27, PG27_DATA),
1550 PINMUX_GPIO(GPIO_PG26, PG26_DATA),
1551 PINMUX_GPIO(GPIO_PG25, PG25_DATA),
1552 PINMUX_GPIO(GPIO_PG24, PG24_DATA),
1553 PINMUX_GPIO(GPIO_PG23, PG23_DATA),
1554 PINMUX_GPIO(GPIO_PG22, PG22_DATA),
1555 PINMUX_GPIO(GPIO_PG21, PG21_DATA),
1556 PINMUX_GPIO(GPIO_PG20, PG20_DATA),
1557 PINMUX_GPIO(GPIO_PG19, PG19_DATA),
1558 PINMUX_GPIO(GPIO_PG18, PG18_DATA),
1559 PINMUX_GPIO(GPIO_PG17, PG17_DATA),
1560 PINMUX_GPIO(GPIO_PG16, PG16_DATA),
1561 PINMUX_GPIO(GPIO_PG15, PG15_DATA),
1562 PINMUX_GPIO(GPIO_PG14, PG14_DATA),
1563 PINMUX_GPIO(GPIO_PG13, PG13_DATA),
1564 PINMUX_GPIO(GPIO_PG12, PG12_DATA),
1565 PINMUX_GPIO(GPIO_PG11, PG11_DATA),
1566 PINMUX_GPIO(GPIO_PG10, PG10_DATA),
1567 PINMUX_GPIO(GPIO_PG9, PG9_DATA),
1568 PINMUX_GPIO(GPIO_PG8, PG8_DATA),
1569 PINMUX_GPIO(GPIO_PG7, PG7_DATA),
1570 PINMUX_GPIO(GPIO_PG6, PG6_DATA),
1571 PINMUX_GPIO(GPIO_PG5, PG5_DATA),
1572 PINMUX_GPIO(GPIO_PG4, PG4_DATA),
1573 PINMUX_GPIO(GPIO_PG3, PG3_DATA),
1574 PINMUX_GPIO(GPIO_PG2, PG2_DATA),
1575 PINMUX_GPIO(GPIO_PG1, PG1_DATA),
1576 PINMUX_GPIO(GPIO_PG0, PG0_DATA),
1577
1578 /* Port H - Port H does not have a Data Register */
1579
1580 /* Port I - not on device */
1581
1582 /* Port J */
1583 PINMUX_GPIO(GPIO_PJ31, PJ31_DATA),
1584 PINMUX_GPIO(GPIO_PJ30, PJ30_DATA),
1585 PINMUX_GPIO(GPIO_PJ29, PJ29_DATA),
1586 PINMUX_GPIO(GPIO_PJ28, PJ28_DATA),
1587 PINMUX_GPIO(GPIO_PJ27, PJ27_DATA),
1588 PINMUX_GPIO(GPIO_PJ26, PJ26_DATA),
1589 PINMUX_GPIO(GPIO_PJ25, PJ25_DATA),
1590 PINMUX_GPIO(GPIO_PJ24, PJ24_DATA),
1591 PINMUX_GPIO(GPIO_PJ23, PJ23_DATA),
1592 PINMUX_GPIO(GPIO_PJ22, PJ22_DATA),
1593 PINMUX_GPIO(GPIO_PJ21, PJ21_DATA),
1594 PINMUX_GPIO(GPIO_PJ20, PJ20_DATA),
1595 PINMUX_GPIO(GPIO_PJ19, PJ19_DATA),
1596 PINMUX_GPIO(GPIO_PJ18, PJ18_DATA),
1597 PINMUX_GPIO(GPIO_PJ17, PJ17_DATA),
1598 PINMUX_GPIO(GPIO_PJ16, PJ16_DATA),
1599 PINMUX_GPIO(GPIO_PJ15, PJ15_DATA),
1600 PINMUX_GPIO(GPIO_PJ14, PJ14_DATA),
1601 PINMUX_GPIO(GPIO_PJ13, PJ13_DATA),
1602 PINMUX_GPIO(GPIO_PJ12, PJ12_DATA),
1603 PINMUX_GPIO(GPIO_PJ11, PJ11_DATA),
1604 PINMUX_GPIO(GPIO_PJ10, PJ10_DATA),
1605 PINMUX_GPIO(GPIO_PJ9, PJ9_DATA),
1606 PINMUX_GPIO(GPIO_PJ8, PJ8_DATA),
1607 PINMUX_GPIO(GPIO_PJ7, PJ7_DATA),
1608 PINMUX_GPIO(GPIO_PJ6, PJ6_DATA),
1609 PINMUX_GPIO(GPIO_PJ5, PJ5_DATA),
1610 PINMUX_GPIO(GPIO_PJ4, PJ4_DATA),
1611 PINMUX_GPIO(GPIO_PJ3, PJ3_DATA),
1612 PINMUX_GPIO(GPIO_PJ2, PJ2_DATA),
1613 PINMUX_GPIO(GPIO_PJ1, PJ1_DATA),
1614 PINMUX_GPIO(GPIO_PJ0, PJ0_DATA),
1615
1616 /* INTC */
1617 PINMUX_GPIO(GPIO_FN_IRQ7_PG, IRQ7_PG_MARK),
1618 PINMUX_GPIO(GPIO_FN_IRQ6_PG, IRQ6_PG_MARK),
1619 PINMUX_GPIO(GPIO_FN_IRQ5_PG, IRQ5_PG_MARK),
1620 PINMUX_GPIO(GPIO_FN_IRQ4_PG, IRQ4_PG_MARK),
1621 PINMUX_GPIO(GPIO_FN_IRQ3_PG, IRQ3_PG_MARK),
1622 PINMUX_GPIO(GPIO_FN_IRQ2_PG, IRQ2_PG_MARK),
1623 PINMUX_GPIO(GPIO_FN_IRQ1_PG, IRQ1_PG_MARK),
1624 PINMUX_GPIO(GPIO_FN_IRQ0_PG, IRQ0_PG_MARK),
1625 PINMUX_GPIO(GPIO_FN_IRQ7_PF, IRQ7_PF_MARK),
1626 PINMUX_GPIO(GPIO_FN_IRQ6_PF, IRQ6_PF_MARK),
1627 PINMUX_GPIO(GPIO_FN_IRQ5_PF, IRQ5_PF_MARK),
1628 PINMUX_GPIO(GPIO_FN_IRQ4_PF, IRQ4_PF_MARK),
1629 PINMUX_GPIO(GPIO_FN_IRQ3_PJ, IRQ3_PJ_MARK),
1630 PINMUX_GPIO(GPIO_FN_IRQ2_PJ, IRQ2_PJ_MARK),
1631 PINMUX_GPIO(GPIO_FN_IRQ1_PJ, IRQ1_PJ_MARK),
1632 PINMUX_GPIO(GPIO_FN_IRQ0_PJ, IRQ0_PJ_MARK),
1633 PINMUX_GPIO(GPIO_FN_IRQ1_PC, IRQ1_PC_MARK),
1634 PINMUX_GPIO(GPIO_FN_IRQ0_PC, IRQ0_PC_MARK),
1635
1636 PINMUX_GPIO(GPIO_FN_PINT7_PG, PINT7_PG_MARK),
1637 PINMUX_GPIO(GPIO_FN_PINT6_PG, PINT6_PG_MARK),
1638 PINMUX_GPIO(GPIO_FN_PINT5_PG, PINT5_PG_MARK),
1639 PINMUX_GPIO(GPIO_FN_PINT4_PG, PINT4_PG_MARK),
1640 PINMUX_GPIO(GPIO_FN_PINT3_PG, PINT3_PG_MARK),
1641 PINMUX_GPIO(GPIO_FN_PINT2_PG, PINT2_PG_MARK),
1642 PINMUX_GPIO(GPIO_FN_PINT1_PG, PINT1_PG_MARK),
1643 PINMUX_GPIO(GPIO_FN_PINT0_PG, PINT0_PG_MARK),
1644 PINMUX_GPIO(GPIO_FN_PINT7_PH, PINT7_PH_MARK),
1645 PINMUX_GPIO(GPIO_FN_PINT6_PH, PINT6_PH_MARK),
1646 PINMUX_GPIO(GPIO_FN_PINT5_PH, PINT5_PH_MARK),
1647 PINMUX_GPIO(GPIO_FN_PINT4_PH, PINT4_PH_MARK),
1648 PINMUX_GPIO(GPIO_FN_PINT3_PH, PINT3_PH_MARK),
1649 PINMUX_GPIO(GPIO_FN_PINT2_PH, PINT2_PH_MARK),
1650 PINMUX_GPIO(GPIO_FN_PINT1_PH, PINT1_PH_MARK),
1651 PINMUX_GPIO(GPIO_FN_PINT0_PH, PINT0_PH_MARK),
1652 PINMUX_GPIO(GPIO_FN_PINT7_PJ, PINT7_PJ_MARK),
1653 PINMUX_GPIO(GPIO_FN_PINT6_PJ, PINT6_PJ_MARK),
1654 PINMUX_GPIO(GPIO_FN_PINT5_PJ, PINT5_PJ_MARK),
1655 PINMUX_GPIO(GPIO_FN_PINT4_PJ, PINT4_PJ_MARK),
1656 PINMUX_GPIO(GPIO_FN_PINT3_PJ, PINT3_PJ_MARK),
1657 PINMUX_GPIO(GPIO_FN_PINT2_PJ, PINT2_PJ_MARK),
1658 PINMUX_GPIO(GPIO_FN_PINT1_PJ, PINT1_PJ_MARK),
1659 PINMUX_GPIO(GPIO_FN_PINT0_PJ, PINT0_PJ_MARK),
1660
1661 /* WDT */
1662 PINMUX_GPIO(GPIO_FN_WDTOVF, WDTOVF_MARK),
1663
1664 /* CAN */
1665 PINMUX_GPIO(GPIO_FN_CTX1, CTX1_MARK),
1666 PINMUX_GPIO(GPIO_FN_CRX1, CRX1_MARK),
1667 PINMUX_GPIO(GPIO_FN_CTX0, CTX0_MARK),
1668 PINMUX_GPIO(GPIO_FN_CRX0, CRX0_MARK),
1669 PINMUX_GPIO(GPIO_FN_CRX0_CRX1, CRX0CRX1_MARK),
1670 PINMUX_GPIO(GPIO_FN_CRX0_CRX1_CRX2, CRX0CRX1CRX2_MARK),
1671
1672 /* DMAC */
1673 PINMUX_GPIO(GPIO_FN_TEND0, TEND0_MARK),
1674 PINMUX_GPIO(GPIO_FN_DACK0, DACK0_MARK),
1675 PINMUX_GPIO(GPIO_FN_DREQ0, DREQ0_MARK),
1676 PINMUX_GPIO(GPIO_FN_TEND1, TEND1_MARK),
1677 PINMUX_GPIO(GPIO_FN_DACK1, DACK1_MARK),
1678 PINMUX_GPIO(GPIO_FN_DREQ1, DREQ1_MARK),
1679
1680 /* ADC */
1681 PINMUX_GPIO(GPIO_FN_ADTRG, ADTRG_MARK),
1682
1683 /* BSCh */
1684 PINMUX_GPIO(GPIO_FN_A25, A25_MARK),
1685 PINMUX_GPIO(GPIO_FN_A24, A24_MARK),
1686 PINMUX_GPIO(GPIO_FN_A23, A23_MARK),
1687 PINMUX_GPIO(GPIO_FN_A22, A22_MARK),
1688 PINMUX_GPIO(GPIO_FN_A21, A21_MARK),
1689 PINMUX_GPIO(GPIO_FN_A20, A20_MARK),
1690 PINMUX_GPIO(GPIO_FN_A19, A19_MARK),
1691 PINMUX_GPIO(GPIO_FN_A18, A18_MARK),
1692 PINMUX_GPIO(GPIO_FN_A17, A17_MARK),
1693 PINMUX_GPIO(GPIO_FN_A16, A16_MARK),
1694 PINMUX_GPIO(GPIO_FN_A15, A15_MARK),
1695 PINMUX_GPIO(GPIO_FN_A14, A14_MARK),
1696 PINMUX_GPIO(GPIO_FN_A13, A13_MARK),
1697 PINMUX_GPIO(GPIO_FN_A12, A12_MARK),
1698 PINMUX_GPIO(GPIO_FN_A11, A11_MARK),
1699 PINMUX_GPIO(GPIO_FN_A10, A10_MARK),
1700 PINMUX_GPIO(GPIO_FN_A9, A9_MARK),
1701 PINMUX_GPIO(GPIO_FN_A8, A8_MARK),
1702 PINMUX_GPIO(GPIO_FN_A7, A7_MARK),
1703 PINMUX_GPIO(GPIO_FN_A6, A6_MARK),
1704 PINMUX_GPIO(GPIO_FN_A5, A5_MARK),
1705 PINMUX_GPIO(GPIO_FN_A4, A4_MARK),
1706 PINMUX_GPIO(GPIO_FN_A3, A3_MARK),
1707 PINMUX_GPIO(GPIO_FN_A2, A2_MARK),
1708 PINMUX_GPIO(GPIO_FN_A1, A1_MARK),
1709 PINMUX_GPIO(GPIO_FN_A0, A0_MARK),
1710
1711 PINMUX_GPIO(GPIO_FN_D15, D15_MARK),
1712 PINMUX_GPIO(GPIO_FN_D14, D14_MARK),
1713 PINMUX_GPIO(GPIO_FN_D13, D13_MARK),
1714 PINMUX_GPIO(GPIO_FN_D12, D12_MARK),
1715 PINMUX_GPIO(GPIO_FN_D11, D11_MARK),
1716 PINMUX_GPIO(GPIO_FN_D10, D10_MARK),
1717 PINMUX_GPIO(GPIO_FN_D9, D9_MARK),
1718 PINMUX_GPIO(GPIO_FN_D8, D8_MARK),
1719 PINMUX_GPIO(GPIO_FN_D7, D7_MARK),
1720 PINMUX_GPIO(GPIO_FN_D6, D6_MARK),
1721 PINMUX_GPIO(GPIO_FN_D5, D5_MARK),
1722 PINMUX_GPIO(GPIO_FN_D4, D4_MARK),
1723 PINMUX_GPIO(GPIO_FN_D3, D3_MARK),
1724 PINMUX_GPIO(GPIO_FN_D2, D2_MARK),
1725 PINMUX_GPIO(GPIO_FN_D1, D1_MARK),
1726 PINMUX_GPIO(GPIO_FN_D0, D0_MARK),
1727
1728 PINMUX_GPIO(GPIO_FN_BS, BS_MARK),
1729 PINMUX_GPIO(GPIO_FN_CS4, CS4_MARK),
1730 PINMUX_GPIO(GPIO_FN_CS3, CS3_MARK),
1731 PINMUX_GPIO(GPIO_FN_CS2, CS2_MARK),
1732 PINMUX_GPIO(GPIO_FN_CS1, CS1_MARK),
1733 PINMUX_GPIO(GPIO_FN_CS0, CS0_MARK),
1734 PINMUX_GPIO(GPIO_FN_CS5CE1A, CS5CE1A_MARK),
1735 PINMUX_GPIO(GPIO_FN_CE2A, CE2A_MARK),
1736 PINMUX_GPIO(GPIO_FN_CE2B, CE2B_MARK),
1737 PINMUX_GPIO(GPIO_FN_RD, RD_MARK),
1738 PINMUX_GPIO(GPIO_FN_RDWR, RDWR_MARK),
1739 PINMUX_GPIO(GPIO_FN_WE3ICIOWRAHDQMUU, WE3ICIOWRAHDQMUU_MARK),
1740 PINMUX_GPIO(GPIO_FN_WE2ICIORDDQMUL, WE2ICIORDDQMUL_MARK),
1741 PINMUX_GPIO(GPIO_FN_WE1DQMUWE, WE1DQMUWE_MARK),
1742 PINMUX_GPIO(GPIO_FN_WE0DQML, WE0DQML_MARK),
1743 PINMUX_GPIO(GPIO_FN_RAS, RAS_MARK),
1744 PINMUX_GPIO(GPIO_FN_CAS, CAS_MARK),
1745 PINMUX_GPIO(GPIO_FN_CKE, CKE_MARK),
1746 PINMUX_GPIO(GPIO_FN_WAIT, WAIT_MARK),
1747 PINMUX_GPIO(GPIO_FN_BREQ, BREQ_MARK),
1748 PINMUX_GPIO(GPIO_FN_BACK, BACK_MARK),
1749 PINMUX_GPIO(GPIO_FN_IOIS16, IOIS16_MARK),
1750
1751 /* TMU */
1752 PINMUX_GPIO(GPIO_FN_TIOC4D, TIOC4D_MARK),
1753 PINMUX_GPIO(GPIO_FN_TIOC4C, TIOC4C_MARK),
1754 PINMUX_GPIO(GPIO_FN_TIOC4B, TIOC4B_MARK),
1755 PINMUX_GPIO(GPIO_FN_TIOC4A, TIOC4A_MARK),
1756 PINMUX_GPIO(GPIO_FN_TIOC3D, TIOC3D_MARK),
1757 PINMUX_GPIO(GPIO_FN_TIOC3C, TIOC3C_MARK),
1758 PINMUX_GPIO(GPIO_FN_TIOC3B, TIOC3B_MARK),
1759 PINMUX_GPIO(GPIO_FN_TIOC3A, TIOC3A_MARK),
1760 PINMUX_GPIO(GPIO_FN_TIOC2B, TIOC2B_MARK),
1761 PINMUX_GPIO(GPIO_FN_TIOC1B, TIOC1B_MARK),
1762 PINMUX_GPIO(GPIO_FN_TIOC2A, TIOC2A_MARK),
1763 PINMUX_GPIO(GPIO_FN_TIOC1A, TIOC1A_MARK),
1764 PINMUX_GPIO(GPIO_FN_TIOC0D, TIOC0D_MARK),
1765 PINMUX_GPIO(GPIO_FN_TIOC0C, TIOC0C_MARK),
1766 PINMUX_GPIO(GPIO_FN_TIOC0B, TIOC0B_MARK),
1767 PINMUX_GPIO(GPIO_FN_TIOC0A, TIOC0A_MARK),
1768 PINMUX_GPIO(GPIO_FN_TCLKD, TCLKD_MARK),
1769 PINMUX_GPIO(GPIO_FN_TCLKC, TCLKC_MARK),
1770 PINMUX_GPIO(GPIO_FN_TCLKB, TCLKB_MARK),
1771 PINMUX_GPIO(GPIO_FN_TCLKA, TCLKA_MARK),
1772
1773 /* SCIF */
1774 PINMUX_GPIO(GPIO_FN_SCK0, SCK0_MARK),
1775 PINMUX_GPIO(GPIO_FN_TXD0, TXD0_MARK),
1776 PINMUX_GPIO(GPIO_FN_RXD0, RXD0_MARK),
1777 PINMUX_GPIO(GPIO_FN_SCK1, SCK1_MARK),
1778 PINMUX_GPIO(GPIO_FN_TXD1, TXD1_MARK),
1779 PINMUX_GPIO(GPIO_FN_RXD1, RXD1_MARK),
1780 PINMUX_GPIO(GPIO_FN_RTS1, RTS1_MARK),
1781 PINMUX_GPIO(GPIO_FN_CTS1, CTS1_MARK),
1782 PINMUX_GPIO(GPIO_FN_SCK2, SCK2_MARK),
1783 PINMUX_GPIO(GPIO_FN_TXD2, TXD2_MARK),
1784 PINMUX_GPIO(GPIO_FN_RXD2, RXD2_MARK),
1785 PINMUX_GPIO(GPIO_FN_SCK3, SCK3_MARK),
1786 PINMUX_GPIO(GPIO_FN_TXD3, TXD3_MARK),
1787 PINMUX_GPIO(GPIO_FN_RXD3, RXD3_MARK),
1788 PINMUX_GPIO(GPIO_FN_SCK4, SCK4_MARK),
1789 PINMUX_GPIO(GPIO_FN_TXD4, TXD4_MARK),
1790 PINMUX_GPIO(GPIO_FN_RXD4, RXD4_MARK),
1791 PINMUX_GPIO(GPIO_FN_SCK5, SCK5_MARK),
1792 PINMUX_GPIO(GPIO_FN_TXD5, TXD5_MARK),
1793 PINMUX_GPIO(GPIO_FN_RXD5, RXD5_MARK),
1794 PINMUX_GPIO(GPIO_FN_RTS5, RTS5_MARK),
1795 PINMUX_GPIO(GPIO_FN_CTS5, CTS5_MARK),
1796 PINMUX_GPIO(GPIO_FN_SCK6, SCK6_MARK),
1797 PINMUX_GPIO(GPIO_FN_TXD6, TXD6_MARK),
1798 PINMUX_GPIO(GPIO_FN_RXD6, RXD6_MARK),
1799 PINMUX_GPIO(GPIO_FN_SCK7, SCK7_MARK),
1800 PINMUX_GPIO(GPIO_FN_TXD7, TXD7_MARK),
1801 PINMUX_GPIO(GPIO_FN_RXD7, RXD7_MARK),
1802 PINMUX_GPIO(GPIO_FN_RTS7, RTS7_MARK),
1803 PINMUX_GPIO(GPIO_FN_CTS7, CTS7_MARK),
1804
1805 /* RSPI */
1806 PINMUX_GPIO(GPIO_FN_RSPCK0_PJ16, RSPCK0_PJ16_MARK),
1807 PINMUX_GPIO(GPIO_FN_SSL00_PJ17, SSL00_PJ17_MARK),
1808 PINMUX_GPIO(GPIO_FN_MOSI0_PJ18, MOSI0_PJ18_MARK),
1809 PINMUX_GPIO(GPIO_FN_MISO0_PJ19, MISO0_PJ19_MARK),
1810 PINMUX_GPIO(GPIO_FN_RSPCK0_PB17, RSPCK0_PB17_MARK),
1811 PINMUX_GPIO(GPIO_FN_SSL00_PB18, SSL00_PB18_MARK),
1812 PINMUX_GPIO(GPIO_FN_MOSI0_PB19, MOSI0_PB19_MARK),
1813 PINMUX_GPIO(GPIO_FN_MISO0_PB20, MISO0_PB20_MARK),
1814 PINMUX_GPIO(GPIO_FN_RSPCK1, RSPCK1_MARK),
1815 PINMUX_GPIO(GPIO_FN_MOSI1, MOSI1_MARK),
1816 PINMUX_GPIO(GPIO_FN_MISO1, MISO1_MARK),
1817 PINMUX_GPIO(GPIO_FN_SSL10, SSL10_MARK),
1818
1819 /* IIC3 */
1820 PINMUX_GPIO(GPIO_FN_SCL0, SCL0_MARK),
1821 PINMUX_GPIO(GPIO_FN_SCL1, SCL1_MARK),
1822 PINMUX_GPIO(GPIO_FN_SCL2, SCL2_MARK),
1823 PINMUX_GPIO(GPIO_FN_SDA0, SDA0_MARK),
1824 PINMUX_GPIO(GPIO_FN_SDA1, SDA1_MARK),
1825 PINMUX_GPIO(GPIO_FN_SDA2, SDA2_MARK),
1826
1827 /* SSI */
1828 PINMUX_GPIO(GPIO_FN_SSISCK0, SSISCK0_MARK),
1829 PINMUX_GPIO(GPIO_FN_SSIWS0, SSIWS0_MARK),
1830 PINMUX_GPIO(GPIO_FN_SSITXD0, SSITXD0_MARK),
1831 PINMUX_GPIO(GPIO_FN_SSIRXD0, SSIRXD0_MARK),
1832 PINMUX_GPIO(GPIO_FN_SSIWS1, SSIWS1_MARK),
1833 PINMUX_GPIO(GPIO_FN_SSIWS2, SSIWS2_MARK),
1834 PINMUX_GPIO(GPIO_FN_SSIWS3, SSIWS3_MARK),
1835 PINMUX_GPIO(GPIO_FN_SSISCK1, SSISCK1_MARK),
1836 PINMUX_GPIO(GPIO_FN_SSISCK2, SSISCK2_MARK),
1837 PINMUX_GPIO(GPIO_FN_SSISCK3, SSISCK3_MARK),
1838 PINMUX_GPIO(GPIO_FN_SSIDATA1, SSIDATA1_MARK),
1839 PINMUX_GPIO(GPIO_FN_SSIDATA2, SSIDATA2_MARK),
1840 PINMUX_GPIO(GPIO_FN_SSIDATA3, SSIDATA3_MARK),
1841 PINMUX_GPIO(GPIO_FN_AUDIO_CLK, AUDIO_CLK_MARK),
1842 PINMUX_GPIO(GPIO_FN_AUDIO_XOUT, AUDIO_XOUT_MARK),
1843
1844 /* SIOF */ /* NOTE Shares AUDIO_CLK with SSI */
1845 PINMUX_GPIO(GPIO_FN_SIOFTXD, SIOFTXD_MARK),
1846 PINMUX_GPIO(GPIO_FN_SIOFRXD, SIOFRXD_MARK),
1847 PINMUX_GPIO(GPIO_FN_SIOFSYNC, SIOFSYNC_MARK),
1848 PINMUX_GPIO(GPIO_FN_SIOFSCK, SIOFSCK_MARK),
1849
1850 /* SPDIF */ /* NOTE Shares AUDIO_CLK with SSI */
1851 PINMUX_GPIO(GPIO_FN_SPDIF_IN, SPDIF_IN_MARK),
1852 PINMUX_GPIO(GPIO_FN_SPDIF_OUT, SPDIF_OUT_MARK),
1853
1854 /* NANDFMC */ /* NOTE Controller is not available in boot mode 0 */
1855 PINMUX_GPIO(GPIO_FN_FCE, FCE_MARK),
1856 PINMUX_GPIO(GPIO_FN_FRB, FRB_MARK),
1857
1858 /* VDC3 */
1859 PINMUX_GPIO(GPIO_FN_DV_CLK, DV_CLK_MARK),
1860 PINMUX_GPIO(GPIO_FN_DV_VSYNC, DV_VSYNC_MARK),
1861 PINMUX_GPIO(GPIO_FN_DV_HSYNC, DV_HSYNC_MARK),
1862
1863 PINMUX_GPIO(GPIO_FN_DV_DATA23, DV_DATA23_MARK),
1864 PINMUX_GPIO(GPIO_FN_DV_DATA22, DV_DATA22_MARK),
1865 PINMUX_GPIO(GPIO_FN_DV_DATA21, DV_DATA21_MARK),
1866 PINMUX_GPIO(GPIO_FN_DV_DATA20, DV_DATA20_MARK),
1867 PINMUX_GPIO(GPIO_FN_DV_DATA19, DV_DATA19_MARK),
1868 PINMUX_GPIO(GPIO_FN_DV_DATA18, DV_DATA18_MARK),
1869 PINMUX_GPIO(GPIO_FN_DV_DATA17, DV_DATA17_MARK),
1870 PINMUX_GPIO(GPIO_FN_DV_DATA16, DV_DATA16_MARK),
1871 PINMUX_GPIO(GPIO_FN_DV_DATA15, DV_DATA15_MARK),
1872 PINMUX_GPIO(GPIO_FN_DV_DATA14, DV_DATA14_MARK),
1873 PINMUX_GPIO(GPIO_FN_DV_DATA13, DV_DATA13_MARK),
1874 PINMUX_GPIO(GPIO_FN_DV_DATA12, DV_DATA12_MARK),
1875 PINMUX_GPIO(GPIO_FN_DV_DATA11, DV_DATA11_MARK),
1876 PINMUX_GPIO(GPIO_FN_DV_DATA10, DV_DATA10_MARK),
1877 PINMUX_GPIO(GPIO_FN_DV_DATA9, DV_DATA9_MARK),
1878 PINMUX_GPIO(GPIO_FN_DV_DATA8, DV_DATA8_MARK),
1879 PINMUX_GPIO(GPIO_FN_DV_DATA7, DV_DATA7_MARK),
1880 PINMUX_GPIO(GPIO_FN_DV_DATA6, DV_DATA6_MARK),
1881 PINMUX_GPIO(GPIO_FN_DV_DATA5, DV_DATA5_MARK),
1882 PINMUX_GPIO(GPIO_FN_DV_DATA4, DV_DATA4_MARK),
1883 PINMUX_GPIO(GPIO_FN_DV_DATA3, DV_DATA3_MARK),
1884 PINMUX_GPIO(GPIO_FN_DV_DATA2, DV_DATA2_MARK),
1885 PINMUX_GPIO(GPIO_FN_DV_DATA1, DV_DATA1_MARK),
1886 PINMUX_GPIO(GPIO_FN_DV_DATA0, DV_DATA0_MARK),
1887
1888 PINMUX_GPIO(GPIO_FN_LCD_CLK, LCD_CLK_MARK),
1889 PINMUX_GPIO(GPIO_FN_LCD_EXTCLK, LCD_EXTCLK_MARK),
1890 PINMUX_GPIO(GPIO_FN_LCD_VSYNC, LCD_VSYNC_MARK),
1891 PINMUX_GPIO(GPIO_FN_LCD_HSYNC, LCD_HSYNC_MARK),
1892 PINMUX_GPIO(GPIO_FN_LCD_DE, LCD_DE_MARK),
1893
1894 PINMUX_GPIO(GPIO_FN_LCD_DATA23_PG23, LCD_DATA23_PG23_MARK),
1895 PINMUX_GPIO(GPIO_FN_LCD_DATA22_PG22, LCD_DATA22_PG22_MARK),
1896 PINMUX_GPIO(GPIO_FN_LCD_DATA21_PG21, LCD_DATA21_PG21_MARK),
1897 PINMUX_GPIO(GPIO_FN_LCD_DATA20_PG20, LCD_DATA20_PG20_MARK),
1898 PINMUX_GPIO(GPIO_FN_LCD_DATA19_PG19, LCD_DATA19_PG19_MARK),
1899 PINMUX_GPIO(GPIO_FN_LCD_DATA18_PG18, LCD_DATA18_PG18_MARK),
1900 PINMUX_GPIO(GPIO_FN_LCD_DATA17_PG17, LCD_DATA17_PG17_MARK),
1901 PINMUX_GPIO(GPIO_FN_LCD_DATA16_PG16, LCD_DATA16_PG16_MARK),
1902 PINMUX_GPIO(GPIO_FN_LCD_DATA15_PG15, LCD_DATA15_PG15_MARK),
1903 PINMUX_GPIO(GPIO_FN_LCD_DATA14_PG14, LCD_DATA14_PG14_MARK),
1904 PINMUX_GPIO(GPIO_FN_LCD_DATA13_PG13, LCD_DATA13_PG13_MARK),
1905 PINMUX_GPIO(GPIO_FN_LCD_DATA12_PG12, LCD_DATA12_PG12_MARK),
1906 PINMUX_GPIO(GPIO_FN_LCD_DATA11_PG11, LCD_DATA11_PG11_MARK),
1907 PINMUX_GPIO(GPIO_FN_LCD_DATA10_PG10, LCD_DATA10_PG10_MARK),
1908 PINMUX_GPIO(GPIO_FN_LCD_DATA9_PG9, LCD_DATA9_PG9_MARK),
1909 PINMUX_GPIO(GPIO_FN_LCD_DATA8_PG8, LCD_DATA8_PG8_MARK),
1910 PINMUX_GPIO(GPIO_FN_LCD_DATA7_PG7, LCD_DATA7_PG7_MARK),
1911 PINMUX_GPIO(GPIO_FN_LCD_DATA6_PG6, LCD_DATA6_PG6_MARK),
1912 PINMUX_GPIO(GPIO_FN_LCD_DATA5_PG5, LCD_DATA5_PG5_MARK),
1913 PINMUX_GPIO(GPIO_FN_LCD_DATA4_PG4, LCD_DATA4_PG4_MARK),
1914 PINMUX_GPIO(GPIO_FN_LCD_DATA3_PG3, LCD_DATA3_PG3_MARK),
1915 PINMUX_GPIO(GPIO_FN_LCD_DATA2_PG2, LCD_DATA2_PG2_MARK),
1916 PINMUX_GPIO(GPIO_FN_LCD_DATA1_PG1, LCD_DATA1_PG1_MARK),
1917 PINMUX_GPIO(GPIO_FN_LCD_DATA0_PG0, LCD_DATA0_PG0_MARK),
1918
1919 PINMUX_GPIO(GPIO_FN_LCD_DATA23_PJ23, LCD_DATA23_PJ23_MARK),
1920 PINMUX_GPIO(GPIO_FN_LCD_DATA22_PJ22, LCD_DATA22_PJ22_MARK),
1921 PINMUX_GPIO(GPIO_FN_LCD_DATA21_PJ21, LCD_DATA21_PJ21_MARK),
1922 PINMUX_GPIO(GPIO_FN_LCD_DATA20_PJ20, LCD_DATA20_PJ20_MARK),
1923 PINMUX_GPIO(GPIO_FN_LCD_DATA19_PJ19, LCD_DATA19_PJ19_MARK),
1924 PINMUX_GPIO(GPIO_FN_LCD_DATA18_PJ18, LCD_DATA18_PJ18_MARK),
1925 PINMUX_GPIO(GPIO_FN_LCD_DATA17_PJ17, LCD_DATA17_PJ17_MARK),
1926 PINMUX_GPIO(GPIO_FN_LCD_DATA16_PJ16, LCD_DATA16_PJ16_MARK),
1927 PINMUX_GPIO(GPIO_FN_LCD_DATA15_PJ15, LCD_DATA15_PJ15_MARK),
1928 PINMUX_GPIO(GPIO_FN_LCD_DATA14_PJ14, LCD_DATA14_PJ14_MARK),
1929 PINMUX_GPIO(GPIO_FN_LCD_DATA13_PJ13, LCD_DATA13_PJ13_MARK),
1930 PINMUX_GPIO(GPIO_FN_LCD_DATA12_PJ12, LCD_DATA12_PJ12_MARK),
1931 PINMUX_GPIO(GPIO_FN_LCD_DATA11_PJ11, LCD_DATA11_PJ11_MARK),
1932 PINMUX_GPIO(GPIO_FN_LCD_DATA10_PJ10, LCD_DATA10_PJ10_MARK),
1933 PINMUX_GPIO(GPIO_FN_LCD_DATA9_PJ9, LCD_DATA9_PJ9_MARK),
1934 PINMUX_GPIO(GPIO_FN_LCD_DATA8_PJ8, LCD_DATA8_PJ8_MARK),
1935 PINMUX_GPIO(GPIO_FN_LCD_DATA7_PJ7, LCD_DATA7_PJ7_MARK),
1936 PINMUX_GPIO(GPIO_FN_LCD_DATA6_PJ6, LCD_DATA6_PJ6_MARK),
1937 PINMUX_GPIO(GPIO_FN_LCD_DATA5_PJ5, LCD_DATA5_PJ5_MARK),
1938 PINMUX_GPIO(GPIO_FN_LCD_DATA4_PJ4, LCD_DATA4_PJ4_MARK),
1939 PINMUX_GPIO(GPIO_FN_LCD_DATA3_PJ3, LCD_DATA3_PJ3_MARK),
1940 PINMUX_GPIO(GPIO_FN_LCD_DATA2_PJ2, LCD_DATA2_PJ2_MARK),
1941 PINMUX_GPIO(GPIO_FN_LCD_DATA1_PJ1, LCD_DATA1_PJ1_MARK),
1942 PINMUX_GPIO(GPIO_FN_LCD_DATA0_PJ0, LCD_DATA0_PJ0_MARK),
1943
1944 PINMUX_GPIO(GPIO_FN_LCD_M_DISP, LCD_M_DISP_MARK),
1945};
1946
1947static struct pinmux_cfg_reg pinmux_config_regs[] = {
1948 /* "name" addr register_size Field_Width */
1949
1950 /* where Field_Width is 1 for single mode registers or 4 for upto 16
1951 mode registers and modes are described in assending order [0..16] */
1952
1953 { PINMUX_CFG_REG("PAIOR0", 0xfffe3812, 16, 1) {
1954 0, 0, 0, 0, 0, 0, 0, 0,
1955 0, 0, 0, 0, 0, 0, PA1_IN, PA1_OUT,
1956 0, 0, 0, 0, 0, 0, 0, 0,
1957 0, 0, 0, 0, 0, 0, PA0_IN, PA0_OUT }
1958 },
1959 { PINMUX_CFG_REG("PBCR5", 0xfffe3824, 16, 4) {
1960 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1961
1962 PB22MD_000, PB22MD_001, PB22MD_010, PB22MD_011,
1963 PB22MD_100, PB22MD_101, PB22MD_110, PB22MD_111,
1964 0, 0, 0, 0, 0, 0, 0, 0,
1965
1966 PB21MD_00, PB21MD_01, PB21MD_10, PB21MD_11, 0, 0, 0, 0,
1967 0, 0, 0, 0, 0, 0, 0, 0,
1968
1969 PB20MD_000, PB20MD_001, PB20MD_010, PB20MD_011,
1970 PB20MD_100, PB20MD_101, PB20MD_110, PB20MD_111,
1971 0, 0, 0, 0, 0, 0, 0, 0 }
1972 },
1973 { PINMUX_CFG_REG("PBCR4", 0xfffe3826, 16, 4) {
1974 PB19MD_000, PB19MD_001, PB19MD_010, PB19MD_011,
1975 PB19MD_100, PB19MD_101, PB19MD_110, PB19MD_111,
1976 0, 0, 0, 0, 0, 0, 0, 0,
1977
1978 PB18MD_000, PB18MD_001, PB18MD_010, PB18MD_011,
1979 PB18MD_100, PB18MD_101, PB18MD_110, PB18MD_111,
1980 0, 0, 0, 0, 0, 0, 0, 0,
1981
1982 PB17MD_000, PB17MD_001, PB17MD_010, PB17MD_011,
1983 PB17MD_100, PB17MD_101, PB17MD_110, PB17MD_111,
1984 0, 0, 0, 0, 0, 0, 0, 0,
1985
1986 PB16MD_000, PB16MD_001, PB16MD_010, PB16MD_011,
1987 PB16MD_100, PB16MD_101, PB16MD_110, PB16MD_111,
1988 0, 0, 0, 0, 0, 0, 0, 0 }
1989 },
1990 { PINMUX_CFG_REG("PBCR3", 0xfffe3828, 16, 4) {
1991 PB15MD_000, PB15MD_001, PB15MD_010, PB15MD_011,
1992 PB15MD_100, PB15MD_101, PB15MD_110, PB15MD_111,
1993 0, 0, 0, 0, 0, 0, 0, 0,
1994
1995 PB14MD_000, PB14MD_001, PB14MD_010, PB14MD_011,
1996 PB14MD_100, PB14MD_101, PB14MD_110, PB14MD_111,
1997 0, 0, 0, 0, 0, 0, 0, 0,
1998
1999 PB13MD_000, PB13MD_001, PB13MD_010, PB13MD_011,
2000 PB13MD_100, PB13MD_101, PB13MD_110, PB13MD_111,
2001 0, 0, 0, 0, 0, 0, 0, 0,
2002
2003 PB12MD_00, PB12MD_01, PB12MD_10, PB12MD_11, 0, 0, 0, 0,
2004 0, 0, 0, 0, 0, 0, 0, 0 }
2005 },
2006 { PINMUX_CFG_REG("PBCR2", 0xfffe382a, 16, 4) {
2007 PB11MD_00, PB11MD_01, PB11MD_10, PB11MD_11, 0, 0, 0, 0,
2008 0, 0, 0, 0, 0, 0, 0, 0,
2009
2010 PB10MD_00, PB10MD_01, PB10MD_10, PB10MD_11, 0, 0, 0, 0,
2011 0, 0, 0, 0, 0, 0, 0, 0,
2012
2013 PB9MD_00, PB9MD_01, PB9MD_10, PB9MD_11, 0, 0, 0, 0,
2014 0, 0, 0, 0, 0, 0, 0, 0,
2015
2016 PB8MD_00, PB8MD_01, PB8MD_10, PB8MD_11, 0, 0, 0, 0,
2017 0, 0, 0, 0, 0, 0, 0, 0 }
2018 },
2019 { PINMUX_CFG_REG("PBCR1", 0xfffe382c, 16, 4) {
2020 PB7MD_00, PB7MD_01, PB7MD_10, PB7MD_11, 0, 0, 0, 0,
2021 0, 0, 0, 0, 0, 0, 0, 0,
2022
2023 PB6MD_00, PB6MD_01, PB6MD_10, PB6MD_11, 0, 0, 0, 0,
2024 0, 0, 0, 0, 0, 0, 0, 0,
2025
2026 PB5MD_00, PB5MD_01, PB5MD_10, PB5MD_11, 0, 0, 0, 0,
2027 0, 0, 0, 0, 0, 0, 0, 0,
2028
2029 PB4MD_00, PB4MD_01, PB4MD_10, PB4MD_11, 0, 0, 0, 0,
2030 0, 0, 0, 0, 0, 0, 0, 0 }
2031 },
2032 { PINMUX_CFG_REG("PBCR0", 0xfffe382e, 16, 4) {
2033 PB3MD_00, PB3MD_01, PB3MD_10, PB3MD_11, 0, 0, 0, 0,
2034 0, 0, 0, 0, 0, 0, 0, 0,
2035
2036 PB2MD_00, PB2MD_01, PB2MD_10, PB2MD_11, 0, 0, 0, 0,
2037 0, 0, 0, 0, 0, 0, 0, 0,
2038
2039 PB1MD_00, PB1MD_01, PB1MD_10, PB1MD_11, 0, 0, 0, 0,
2040 0, 0, 0, 0, 0, 0, 0, 0,
2041
2042 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
2043 },
2044
2045 { PINMUX_CFG_REG("PBIOR1", 0xfffe3830, 16, 1) {
2046 0, 0, 0, 0, 0, 0, 0, 0,
2047 0, 0, 0, 0, 0, 0, 0, 0,
2048 0, 0,
2049 PB22_IN, PB22_OUT,
2050 PB21_IN, PB21_OUT,
2051 PB20_IN, PB20_OUT,
2052 PB19_IN, PB19_OUT,
2053 PB18_IN, PB18_OUT,
2054 PB17_IN, PB17_OUT,
2055 PB16_IN, PB16_OUT }
2056 },
2057 { PINMUX_CFG_REG("PBIOR0", 0xfffe3832, 16, 1) {
2058 PB15_IN, PB15_OUT,
2059 PB14_IN, PB14_OUT,
2060 PB13_IN, PB13_OUT,
2061 PB12_IN, PB12_OUT,
2062 PB11_IN, PB11_OUT,
2063 PB10_IN, PB10_OUT,
2064 PB9_IN, PB9_OUT,
2065 PB8_IN, PB8_OUT,
2066 PB7_IN, PB7_OUT,
2067 PB6_IN, PB6_OUT,
2068 PB5_IN, PB5_OUT,
2069 PB4_IN, PB4_OUT,
2070 PB3_IN, PB3_OUT,
2071 PB2_IN, PB2_OUT,
2072 PB1_IN, PB1_OUT,
2073 0, 0 }
2074 },
2075
2076 { PINMUX_CFG_REG("PCCR2", 0xfffe384a, 16, 4) {
2077 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2078
2079 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2080
2081 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2082
2083 PC8MD_000, PC8MD_001, PC8MD_010, PC8MD_011,
2084 PC8MD_100, PC8MD_101, PC8MD_110, PC8MD_111,
2085 0, 0, 0, 0, 0, 0, 0, 0 }
2086 },
2087 { PINMUX_CFG_REG("PCCR1", 0xfffe384c, 16, 4) {
2088 PC7MD_000, PC7MD_001, PC7MD_010, PC7MD_011,
2089 PC7MD_100, PC7MD_101, PC7MD_110, PC7MD_111,
2090 0, 0, 0, 0, 0, 0, 0, 0,
2091
2092 PC6MD_000, PC6MD_001, PC6MD_010, PC6MD_011,
2093 PC6MD_100, PC6MD_101, PC6MD_110, PC6MD_111,
2094 0, 0, 0, 0, 0, 0, 0, 0,
2095
2096 PC5MD_000, PC5MD_001, PC5MD_010, PC5MD_011,
2097 PC5MD_100, PC5MD_101, PC5MD_110, PC5MD_111,
2098 0, 0, 0, 0, 0, 0, 0, 0,
2099
2100 PC4MD_00, PC4MD_01, PC4MD_10, PC4MD_11, 0, 0, 0, 0,
2101 0, 0, 0, 0, 0, 0, 0, 0 }
2102 },
2103 { PINMUX_CFG_REG("PCCR0", 0xfffe384e, 16, 4) {
2104 PC3MD_00, PC3MD_01, PC3MD_10, PC3MD_11, 0, 0, 0, 0,
2105 0, 0, 0, 0, 0, 0, 0, 0,
2106
2107 PC2MD_00, PC2MD_01, PC2MD_10, PC2MD_11, 0, 0, 0, 0,
2108 0, 0, 0, 0, 0, 0, 0, 0,
2109
2110 PC1MD_0, PC1MD_1, 0, 0, 0, 0, 0, 0,
2111 0, 0, 0, 0, 0, 0, 0, 0,
2112
2113 PC0MD_0, PC0MD_1, 0, 0, 0, 0, 0, 0,
2114 0, 0, 0, 0, 0, 0, 0, 0 }
2115 },
2116
2117 { PINMUX_CFG_REG("PCIOR0", 0xfffe3852, 16, 1) {
2118 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2119 PC8_IN, PC8_OUT,
2120 PC7_IN, PC7_OUT,
2121 PC6_IN, PC6_OUT,
2122 PC5_IN, PC5_OUT,
2123 PC4_IN, PC4_OUT,
2124 PC3_IN, PC3_OUT,
2125 PC2_IN, PC2_OUT,
2126 PC1_IN, PC1_OUT,
2127 PC0_IN, PC0_OUT }
2128 },
2129
2130 { PINMUX_CFG_REG("PDCR3", 0xfffe3868, 16, 4) {
2131 PD15MD_00, PD15MD_01, PD15MD_10, PD15MD_11, 0, 0, 0, 0,
2132 0, 0, 0, 0, 0, 0, 0, 0,
2133
2134 PD14MD_00, PD14MD_01, PD14MD_10, PD14MD_11, 0, 0, 0, 0,
2135 0, 0, 0, 0, 0, 0, 0, 0,
2136
2137 PD13MD_00, PD13MD_01, PD13MD_10, PD13MD_11, 0, 0, 0, 0,
2138 0, 0, 0, 0, 0, 0, 0, 0,
2139
2140 PD12MD_00, PD12MD_01, PD12MD_10, PD12MD_11, 0, 0, 0, 0,
2141 0, 0, 0, 0, 0, 0, 0, 0 }
2142 },
2143 { PINMUX_CFG_REG("PDCR2", 0xfffe386a, 16, 4) {
2144 PD11MD_00, PD11MD_01, PD11MD_10, PD11MD_11, 0, 0, 0, 0,
2145 0, 0, 0, 0, 0, 0, 0, 0,
2146
2147 PD10MD_00, PD10MD_01, PD10MD_10, PD10MD_11, 0, 0, 0, 0,
2148 0, 0, 0, 0, 0, 0, 0, 0,
2149
2150 PD9MD_00, PD9MD_01, PD9MD_10, PD9MD_11, 0, 0, 0, 0,
2151 0, 0, 0, 0, 0, 0, 0, 0,
2152
2153 PD8MD_00, PD8MD_01, PD8MD_10, PD8MD_11, 0, 0, 0, 0,
2154 0, 0, 0, 0, 0, 0, 0, 0 }
2155 },
2156 { PINMUX_CFG_REG("PDCR1", 0xfffe386c, 16, 4) {
2157 PD7MD_00, PD7MD_01, PD7MD_10, PD7MD_11, 0, 0, 0, 0,
2158 0, 0, 0, 0, 0, 0, 0, 0,
2159
2160 PD6MD_00, PD6MD_01, PD6MD_10, PD6MD_11, 0, 0, 0, 0,
2161 0, 0, 0, 0, 0, 0, 0, 0,
2162
2163 PD5MD_00, PD5MD_01, PD5MD_10, PD5MD_11, 0, 0, 0, 0,
2164 0, 0, 0, 0, 0, 0, 0, 0,
2165
2166 PD4MD_00, PD4MD_01, PD4MD_10, PD4MD_11, 0, 0, 0, 0,
2167 0, 0, 0, 0, 0, 0, 0, 0 }
2168 },
2169 { PINMUX_CFG_REG("PDCR0", 0xfffe386e, 16, 4) {
2170 PD3MD_00, PD3MD_01, PD3MD_10, PD3MD_11, 0, 0, 0, 0,
2171 0, 0, 0, 0, 0, 0, 0, 0,
2172
2173 PD2MD_00, PD2MD_01, PD2MD_10, PD2MD_11, 0, 0, 0, 0,
2174 0, 0, 0, 0, 0, 0, 0, 0,
2175
2176 PD1MD_00, PD1MD_01, PD1MD_10, PD1MD_11, 0, 0, 0, 0,
2177 0, 0, 0, 0, 0, 0, 0, 0,
2178
2179 PD0MD_00, PD0MD_01, PD0MD_10, PD0MD_11, 0, 0, 0, 0,
2180 0, 0, 0, 0, 0, 0, 0, 0 }
2181 },
2182
2183 { PINMUX_CFG_REG("PDIOR0", 0xfffe3872, 16, 1) {
2184 PD15_IN, PD15_OUT,
2185 PD14_IN, PD14_OUT,
2186 PD13_IN, PD13_OUT,
2187 PD12_IN, PD12_OUT,
2188 PD11_IN, PD11_OUT,
2189 PD10_IN, PD10_OUT,
2190 PD9_IN, PD9_OUT,
2191 PD8_IN, PD8_OUT,
2192 PD7_IN, PD7_OUT,
2193 PD6_IN, PD6_OUT,
2194 PD5_IN, PD5_OUT,
2195 PD4_IN, PD4_OUT,
2196 PD3_IN, PD3_OUT,
2197 PD2_IN, PD2_OUT,
2198 PD1_IN, PD1_OUT,
2199 PD0_IN, PD0_OUT }
2200 },
2201
2202 { PINMUX_CFG_REG("PECR1", 0xfffe388c, 16, 4) {
2203 PE7MD_00, PE7MD_01, PE7MD_10, PE7MD_11, 0, 0, 0, 0,
2204 0, 0, 0, 0, 0, 0, 0, 0,
2205
2206 PE6MD_00, PE6MD_01, PE6MD_10, PE6MD_11, 0, 0, 0, 0,
2207 0, 0, 0, 0, 0, 0, 0, 0,
2208
2209 PE5MD_00, PE5MD_01, PE5MD_10, PE5MD_11, 0, 0, 0, 0,
2210 0, 0, 0, 0, 0, 0, 0, 0,
2211
2212 PE4MD_00, PE4MD_01, PE4MD_10, PE4MD_11, 0, 0, 0, 0,
2213 0, 0, 0, 0, 0, 0, 0, 0 }
2214 },
2215 { PINMUX_CFG_REG("PECR0", 0xfffe388e, 16, 4) {
2216 PE3MD_000, PE3MD_001, PE3MD_010, PE3MD_011,
2217 PE3MD_100, PE3MD_101, PE3MD_110, PE3MD_111,
2218 0, 0, 0, 0, 0, 0, 0, 0,
2219
2220 PE2MD_000, PE2MD_001, PE2MD_010, PE2MD_011,
2221 PE2MD_100, PE2MD_101, PE2MD_110, PE2MD_111,
2222 0, 0, 0, 0, 0, 0, 0, 0,
2223
2224 PE1MD_000, PE1MD_001, PE1MD_010, PE1MD_011,
2225 PE1MD_100, PE1MD_101, PE1MD_110, PE1MD_111,
2226 0, 0, 0, 0, 0, 0, 0, 0,
2227
2228 PE0MD_00, PE0MD_01, PE0MD_10, PE0MD_11, 0, 0, 0, 0,
2229 0, 0, 0, 0, 0, 0, 0, 0 }
2230 },
2231 { PINMUX_CFG_REG("PEIOR0", 0xfffe3892, 16, 1) {
2232 0, 0, 0, 0, 0, 0, 0, 0,
2233 0, 0, 0, 0, 0, 0, 0, 0,
2234 PE7_IN, PE7_OUT,
2235 PE6_IN, PE6_OUT,
2236 PE5_IN, PE5_OUT,
2237 PE4_IN, PE4_OUT,
2238 PE3_IN, PE3_OUT,
2239 PE2_IN, PE2_OUT,
2240 PE1_IN, PE1_OUT,
2241 PE0_IN, PE0_OUT }
2242 },
2243
2244 { PINMUX_CFG_REG("PFCR6", 0xfffe38a2, 16, 4) {
2245 PF23MD_000, PF23MD_001, PF23MD_010, PF23MD_011,
2246 PF23MD_100, PF23MD_101, PF23MD_110, PF23MD_111,
2247 0, 0, 0, 0, 0, 0, 0, 0,
2248
2249 PF22MD_000, PF22MD_001, PF22MD_010, PF22MD_011,
2250 PF22MD_100, PF22MD_101, PF22MD_110, PF22MD_111,
2251 0, 0, 0, 0, 0, 0, 0, 0,
2252
2253 PF21MD_000, PF21MD_001, PF21MD_010, PF21MD_011,
2254 PF21MD_100, PF21MD_101, PF21MD_110, PF21MD_111,
2255 0, 0, 0, 0, 0, 0, 0, 0,
2256
2257 PF20MD_000, PF20MD_001, PF20MD_010, PF20MD_011,
2258 PF20MD_100, PF20MD_101, PF20MD_110, PF20MD_111,
2259 0, 0, 0, 0, 0, 0, 0, 0 }
2260 },
2261 { PINMUX_CFG_REG("PFCR5", 0xfffe38a4, 16, 4) {
2262 PF19MD_000, PF19MD_001, PF19MD_010, PF19MD_011,
2263 PF19MD_100, PF19MD_101, PF19MD_110, PF19MD_111,
2264 0, 0, 0, 0, 0, 0, 0, 0,
2265
2266 PF18MD_000, PF18MD_001, PF18MD_010, PF18MD_011,
2267 PF18MD_100, PF18MD_101, PF18MD_110, PF18MD_111,
2268 0, 0, 0, 0, 0, 0, 0, 0,
2269
2270 PF17MD_000, PF17MD_001, PF17MD_010, PF17MD_011,
2271 PF17MD_100, PF17MD_101, PF17MD_110, PF17MD_111,
2272 0, 0, 0, 0, 0, 0, 0, 0,
2273
2274 PF16MD_000, PF16MD_001, PF16MD_010, PF16MD_011,
2275 PF16MD_100, PF16MD_101, PF16MD_110, PF16MD_111,
2276 0, 0, 0, 0, 0, 0, 0, 0 }
2277 },
2278 { PINMUX_CFG_REG("PFCR4", 0xfffe38a6, 16, 4) {
2279 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2280
2281 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2282
2283 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2284
2285 PF15MD_000, PF15MD_001, PF15MD_010, PF15MD_011,
2286 PF15MD_100, PF15MD_101, PF15MD_110, PF15MD_111,
2287 0, 0, 0, 0, 0, 0, 0, 0 }
2288 },
2289 { PINMUX_CFG_REG("PFCR3", 0xfffe38a8, 16, 4) {
2290 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2291
2292 PF14MD_000, PF14MD_001, PF14MD_010, PF14MD_011,
2293 PF14MD_100, PF14MD_101, PF14MD_110, PF14MD_111,
2294 0, 0, 0, 0, 0, 0, 0, 0,
2295
2296 PF13MD_000, PF13MD_001, PF13MD_010, PF13MD_011,
2297 PF13MD_100, PF13MD_101, PF13MD_110, PF13MD_111,
2298 0, 0, 0, 0, 0, 0, 0, 0,
2299
2300 PF12MD_000, PF12MD_001, PF12MD_010, PF12MD_011,
2301 PF12MD_100, PF12MD_101, PF12MD_110, PF12MD_111,
2302 0, 0, 0, 0, 0, 0, 0, 0 }
2303 },
2304 { PINMUX_CFG_REG("PFCR2", 0xfffe38aa, 16, 4) {
2305 PF11MD_000, PF11MD_001, PF11MD_010, PF11MD_011,
2306 PF11MD_100, PF11MD_101, PF11MD_110, PF11MD_111,
2307 0, 0, 0, 0, 0, 0, 0, 0,
2308
2309 PF10MD_000, PF10MD_001, PF10MD_010, PF10MD_011,
2310 PF10MD_100, PF10MD_101, PF10MD_110, PF10MD_111,
2311 0, 0, 0, 0, 0, 0, 0, 0,
2312
2313 PF9MD_000, PF9MD_001, PF9MD_010, PF9MD_011,
2314 PF9MD_100, PF9MD_101, PF9MD_110, PF9MD_111,
2315 0, 0, 0, 0, 0, 0, 0, 0,
2316
2317 PF8MD_000, PF8MD_001, PF8MD_010, PF8MD_011,
2318 PF8MD_100, PF8MD_101, PF8MD_110, PF8MD_111,
2319 0, 0, 0, 0, 0, 0, 0, 0 }
2320 },
2321 { PINMUX_CFG_REG("PFCR1", 0xfffe38ac, 16, 4) {
2322 PF7MD_000, PF7MD_001, PF7MD_010, PF7MD_011,
2323 PF7MD_100, PF7MD_101, PF7MD_110, PF7MD_111,
2324 0, 0, 0, 0, 0, 0, 0, 0,
2325
2326 PF6MD_000, PF6MD_001, PF6MD_010, PF6MD_011,
2327 PF6MD_100, PF6MD_101, PF6MD_110, PF6MD_111,
2328 0, 0, 0, 0, 0, 0, 0, 0,
2329
2330 PF5MD_000, PF5MD_001, PF5MD_010, PF5MD_011,
2331 PF5MD_100, PF5MD_101, PF5MD_110, PF5MD_111,
2332 0, 0, 0, 0, 0, 0, 0, 0,
2333
2334 PF4MD_000, PF4MD_001, PF4MD_010, PF4MD_011,
2335 PF4MD_100, PF4MD_101, PF4MD_110, PF4MD_111,
2336 0, 0, 0, 0, 0, 0, 0, 0 }
2337 },
2338 { PINMUX_CFG_REG("PFCR0", 0xfffe38ae, 16, 4) {
2339 PF3MD_000, PF3MD_001, PF3MD_010, PF3MD_011,
2340 PF3MD_100, PF3MD_101, PF3MD_110, PF3MD_111,
2341 0, 0, 0, 0, 0, 0, 0, 0,
2342
2343 PF2MD_000, PF2MD_001, PF2MD_010, PF2MD_011,
2344 PF2MD_100, PF2MD_101, PF2MD_110, PF2MD_111,
2345 0, 0, 0, 0, 0, 0, 0, 0,
2346
2347 PF1MD_000, PF1MD_001, PF1MD_010, PF1MD_011,
2348 PF1MD_100, PF1MD_101, PF1MD_110, PF1MD_111,
2349 0, 0, 0, 0, 0, 0, 0, 0,
2350
2351 PF0MD_000, PF0MD_001, PF0MD_010, PF0MD_011,
2352 PF0MD_100, PF0MD_101, PF0MD_110, PF0MD_111,
2353 0, 0, 0, 0, 0, 0, 0, 0 }
2354 },
2355
2356 { PINMUX_CFG_REG("PFIOR1", 0xfffe38b0, 16, 1) {
2357 0, 0, 0, 0, 0, 0, 0, 0,
2358 0, 0, 0, 0, 0, 0, 0, 0,
2359 PF23_IN, PF23_OUT,
2360 PF22_IN, PF22_OUT,
2361 PF21_IN, PF21_OUT,
2362 PF20_IN, PF20_OUT,
2363 PF19_IN, PF19_OUT,
2364 PF18_IN, PF18_OUT,
2365 PF17_IN, PF17_OUT,
2366 PF16_IN, PF16_OUT }
2367 },
2368 { PINMUX_CFG_REG("PFIOR0", 0xfffe38b2, 16, 1) {
2369 PF15_IN, PF15_OUT,
2370 PF14_IN, PF14_OUT,
2371 PF13_IN, PF13_OUT,
2372 PF12_IN, PF12_OUT,
2373 PF11_IN, PF11_OUT,
2374 PF10_IN, PF10_OUT,
2375 PF9_IN, PF9_OUT,
2376 PF8_IN, PF8_OUT,
2377 PF7_IN, PF7_OUT,
2378 PF6_IN, PF6_OUT,
2379 PF5_IN, PF5_OUT,
2380 PF4_IN, PF4_OUT,
2381 PF3_IN, PF3_OUT,
2382 PF2_IN, PF2_OUT,
2383 PF1_IN, PF1_OUT,
2384 PF0_IN, PF0_OUT }
2385 },
2386
2387 { PINMUX_CFG_REG("PGCR6", 0xfffe38c2, 16, 4) {
2388 PG27MD_00, PG27MD_01, PG27MD_10, PG27MD_11, 0, 0, 0, 0,
2389 0, 0, 0, 0, 0, 0, 0, 0,
2390
2391 PG26MD_00, PG26MD_01, PG26MD_10, PG26MD_11, 0, 0, 0, 0,
2392 0, 0, 0, 0, 0, 0, 0, 0,
2393
2394 PG25MD_00, PG25MD_01, PG25MD_10, PG25MD_11, 0, 0, 0, 0,
2395 0, 0, 0, 0, 0, 0, 0, 0,
2396
2397 PG24MD_00, PG24MD_01, PG24MD_10, PG24MD_11, 0, 0, 0, 0,
2398 0, 0, 0, 0, 0, 0, 0, 0 }
2399 },
2400 { PINMUX_CFG_REG("PGCR5", 0xfffe38c4, 16, 4) {
2401 PG23MD_000, PG23MD_001, PG23MD_010, PG23MD_011,
2402 PG23MD_100, PG23MD_101, PG23MD_110, PG23MD_111,
2403 0, 0, 0, 0, 0, 0, 0, 0,
2404
2405 PG22MD_000, PG22MD_001, PG22MD_010, PG22MD_011,
2406 PG22MD_100, PG22MD_101, PG22MD_110, PG22MD_111,
2407 0, 0, 0, 0, 0, 0, 0, 0,
2408
2409 PG21MD_000, PG21MD_001, PG21MD_010, PG21MD_011,
2410 PG21MD_100, PG21MD_101, PG21MD_110, PG21MD_111,
2411 0, 0, 0, 0, 0, 0, 0, 0,
2412
2413 PG20MD_000, PG20MD_001, PG20MD_010, PG20MD_011,
2414 PG20MD_100, PG20MD_101, PG20MD_110, PG20MD_111,
2415 0, 0, 0, 0, 0, 0, 0, 0 }
2416 },
2417 { PINMUX_CFG_REG("PGCR4", 0xfffe38c6, 16, 4) {
2418 PG19MD_000, PG19MD_001, PG19MD_010, PG19MD_011,
2419 PG19MD_100, PG19MD_101, PG19MD_110, PG19MD_111,
2420 0, 0, 0, 0, 0, 0, 0, 0,
2421
2422 PG18MD_000, PG18MD_001, PG18MD_010, PG18MD_011,
2423 PG18MD_100, PG18MD_101, PG18MD_110, PG18MD_111,
2424 0, 0, 0, 0, 0, 0, 0, 0,
2425
2426 PG17MD_00, PG17MD_01, PG17MD_10, PG17MD_11, 0, 0, 0, 0,
2427 0, 0, 0, 0, 0, 0, 0, 0,
2428
2429 PG16MD_00, PG16MD_01, PG16MD_10, PG16MD_11, 0, 0, 0, 0,
2430 0, 0, 0, 0, 0, 0, 0, 0 }
2431 },
2432 { PINMUX_CFG_REG("PGCR3", 0xfffe38c8, 16, 4) {
2433 PG15MD_00, PG15MD_01, PG15MD_10, PG15MD_11, 0, 0, 0, 0,
2434 0, 0, 0, 0, 0, 0, 0, 0,
2435
2436 PG14MD_00, PG14MD_01, PG14MD_10, PG14MD_11, 0, 0, 0, 0,
2437 0, 0, 0, 0, 0, 0, 0, 0,
2438
2439 PG13MD_00, PG13MD_01, PG13MD_10, PG13MD_11, 0, 0, 0, 0,
2440 0, 0, 0, 0, 0, 0, 0, 0,
2441
2442 PG12MD_00, PG12MD_01, PG12MD_10, PG12MD_11, 0, 0, 0, 0,
2443 0, 0, 0, 0, 0, 0, 0, 0 }
2444 },
2445 { PINMUX_CFG_REG("PGCR2", 0xfffe38ca, 16, 4) {
2446 PG11MD_000, PG11MD_001, PG11MD_010, PG11MD_011,
2447 PG11MD_100, PG11MD_101, PG11MD_110, PG11MD_111,
2448 0, 0, 0, 0, 0, 0, 0, 0,
2449
2450 PG10MD_000, PG10MD_001, PG10MD_010, PG10MD_011,
2451 PG10MD_100, PG10MD_101, PG10MD_110, PG10MD_111,
2452 0, 0, 0, 0, 0, 0, 0, 0,
2453
2454 PG9MD_000, PG9MD_001, PG9MD_010, PG9MD_011,
2455 PG9MD_100, PG9MD_101, PG9MD_110, PG9MD_111,
2456 0, 0, 0, 0, 0, 0, 0, 0,
2457
2458 PG8MD_000, PG8MD_001, PG8MD_010, PG8MD_011,
2459 PG8MD_100, PG8MD_101, PG8MD_110, PG8MD_111,
2460 0, 0, 0, 0, 0, 0, 0, 0 }
2461 },
2462
2463 { PINMUX_CFG_REG("PGCR1", 0xfffe38cc, 16, 4) {
2464 PG7MD_000, PG7MD_001, PG7MD_010, PG7MD_011,
2465 PG7MD_100, PG7MD_101, PG7MD_110, PG7MD_111,
2466 0, 0, 0, 0, 0, 0, 0, 0,
2467
2468 PG6MD_000, PG6MD_001, PG6MD_010, PG6MD_011,
2469 PG6MD_100, PG6MD_101, PG6MD_110, PG6MD_111,
2470 0, 0, 0, 0, 0, 0, 0, 0,
2471
2472 PG5MD_000, PG5MD_001, PG5MD_010, PG5MD_011,
2473 PG5MD_100, PG5MD_101, PG5MD_110, PG5MD_111,
2474 0, 0, 0, 0, 0, 0, 0, 0,
2475
2476 PG4MD_000, PG4MD_001, PG4MD_010, PG4MD_011,
2477 PG4MD_100, PG4MD_101, PG4MD_110, PG4MD_111,
2478 0, 0, 0, 0, 0, 0, 0, 0 }
2479 },
2480 { PINMUX_CFG_REG("PGCR0", 0xfffe38ce, 16, 4) {
2481 PG3MD_000, PG3MD_001, PG3MD_010, PG3MD_011,
2482 PG3MD_100, PG3MD_101, PG3MD_110, PG3MD_111,
2483 0, 0, 0, 0, 0, 0, 0, 0,
2484
2485 PG2MD_000, PG2MD_001, PG2MD_010, PG2MD_011,
2486 PG2MD_100, PG2MD_101, PG2MD_110, PG2MD_111,
2487 0, 0, 0, 0, 0, 0, 0, 0,
2488
2489 PG1MD_000, PG1MD_001, PG1MD_010, PG1MD_011,
2490 PG1MD_100, PG1MD_101, PG1MD_110, PG1MD_111,
2491 0, 0, 0, 0, 0, 0, 0, 0,
2492
2493 PG0MD_000, PG0MD_001, PG0MD_010, PG0MD_011,
2494 PG0MD_100, PG0MD_101, PG0MD_110, PG0MD_111,
2495 0, 0, 0, 0, 0, 0, 0, 0 }
2496 },
2497
2498 { PINMUX_CFG_REG("PGIOR1", 0xfffe38d0, 16, 1) {
2499 0, 0, 0, 0, 0, 0, 0, 0,
2500 PG27_IN, PG27_OUT,
2501 PG26_IN, PG26_OUT,
2502 PG25_IN, PG25_OUT,
2503 PG24_IN, PG24_OUT,
2504 PG23_IN, PG23_OUT,
2505 PG22_IN, PG22_OUT,
2506 PG21_IN, PG21_OUT,
2507 PG20_IN, PG20_OUT,
2508 PG19_IN, PG19_OUT,
2509 PG18_IN, PG18_OUT,
2510 PG17_IN, PG17_OUT,
2511 PG16_IN, PG16_OUT }
2512 },
2513 { PINMUX_CFG_REG("PGIOR0", 0xfffe38d2, 16, 1) {
2514 PG15_IN, PG15_OUT,
2515 PG14_IN, PG14_OUT,
2516 PG13_IN, PG13_OUT,
2517 PG12_IN, PG12_OUT,
2518 PG11_IN, PG11_OUT,
2519 PG10_IN, PG10_OUT,
2520 PG9_IN, PG9_OUT,
2521 PG8_IN, PG8_OUT,
2522 PG7_IN, PG7_OUT,
2523 PG6_IN, PG6_OUT,
2524 PG5_IN, PG5_OUT,
2525 PG4_IN, PG4_OUT,
2526 PG3_IN, PG3_OUT,
2527 PG2_IN, PG2_OUT,
2528 PG1_IN, PG1_OUT,
2529 PG0_IN, PG0_OUT }
2530 },
2531
2532 { PINMUX_CFG_REG("PHCR1", 0xfffe38ec, 16, 4) {
2533 PH7MD_00, PH7MD_01, PH7MD_10, PH7MD_11, 0, 0, 0, 0,
2534 0, 0, 0, 0, 0, 0, 0, 0,
2535
2536 PH6MD_00, PH6MD_01, PH6MD_10, PH6MD_11, 0, 0, 0, 0,
2537 0, 0, 0, 0, 0, 0, 0, 0,
2538
2539 PH5MD_00, PH5MD_01, PH5MD_10, PH5MD_11, 0, 0, 0, 0,
2540 0, 0, 0, 0, 0, 0, 0, 0,
2541
2542 PH4MD_00, PH4MD_01, PH4MD_10, PH4MD_11, 0, 0, 0, 0,
2543 0, 0, 0, 0, 0, 0, 0, 0 }
2544 },
2545
2546 { PINMUX_CFG_REG("PHCR0", 0xfffe38ee, 16, 4) {
2547 PH3MD_00, PH3MD_01, PH3MD_10, PH3MD_11, 0, 0, 0, 0,
2548 0, 0, 0, 0, 0, 0, 0, 0,
2549
2550 PH2MD_00, PH2MD_01, PH2MD_10, PH2MD_11, 0, 0, 0, 0,
2551 0, 0, 0, 0, 0, 0, 0, 0,
2552
2553 PH1MD_00, PH1MD_01, PH1MD_10, PH1MD_11, 0, 0, 0, 0,
2554 0, 0, 0, 0, 0, 0, 0, 0,
2555
2556 PH0MD_00, PH0MD_01, PH0MD_10, PH0MD_11, 0, 0, 0, 0,
2557 0, 0, 0, 0, 0, 0, 0, 0 }
2558 },
2559
2560 { PINMUX_CFG_REG("PJCR7", 0xfffe3900, 16, 4) {
2561 PJ31MD_0, PJ31MD_1, 0, 0, 0, 0, 0, 0,
2562 0, 0, 0, 0, 0, 0, 0, 0,
2563
2564 PJ30MD_000, PJ30MD_001, PJ30MD_010, PJ30MD_011,
2565 PJ30MD_100, PJ30MD_101, PJ30MD_110, PJ30MD_111,
2566 0, 0, 0, 0, 0, 0, 0, 0,
2567
2568 PJ29MD_000, PJ29MD_001, PJ29MD_010, PJ29MD_011,
2569 PJ29MD_100, PJ29MD_101, PJ29MD_110, PJ29MD_111,
2570 0, 0, 0, 0, 0, 0, 0, 0,
2571
2572 PJ28MD_000, PJ28MD_001, PJ28MD_010, PJ28MD_011,
2573 PJ28MD_100, PJ28MD_101, PJ28MD_110, PJ28MD_111,
2574 0, 0, 0, 0, 0, 0, 0, 0 }
2575 },
2576 { PINMUX_CFG_REG("PJCR6", 0xfffe3902, 16, 4) {
2577 PJ27MD_000, PJ27MD_001, PJ27MD_010, PJ27MD_011,
2578 PJ27MD_100, PJ27MD_101, PJ27MD_110, PJ27MD_111,
2579 0, 0, 0, 0, 0, 0, 0, 0,
2580
2581 PJ26MD_000, PJ26MD_001, PJ26MD_010, PJ26MD_011,
2582 PJ26MD_100, PJ26MD_101, PJ26MD_110, PJ26MD_111,
2583 0, 0, 0, 0, 0, 0, 0, 0,
2584
2585 PJ25MD_000, PJ25MD_001, PJ25MD_010, PJ25MD_011,
2586 PJ25MD_100, PJ25MD_101, PJ25MD_110, PJ25MD_111,
2587 0, 0, 0, 0, 0, 0, 0, 0,
2588
2589 PJ24MD_000, PJ24MD_001, PJ24MD_010, PJ24MD_011,
2590 PJ24MD_100, PJ24MD_101, PJ24MD_110, PJ24MD_111,
2591 0, 0, 0, 0, 0, 0, 0, 0 }
2592 },
2593 { PINMUX_CFG_REG("PJCR5", 0xfffe3904, 16, 4) {
2594 PJ23MD_000, PJ23MD_001, PJ23MD_010, PJ23MD_011,
2595 PJ23MD_100, PJ23MD_101, PJ23MD_110, PJ23MD_111,
2596 0, 0, 0, 0, 0, 0, 0, 0,
2597
2598 PJ22MD_000, PJ22MD_001, PJ22MD_010, PJ22MD_011,
2599 PJ22MD_100, PJ22MD_101, PJ22MD_110, PJ22MD_111,
2600 0, 0, 0, 0, 0, 0, 0, 0,
2601
2602 PJ21MD_000, PJ21MD_001, PJ21MD_010, PJ21MD_011,
2603 PJ21MD_100, PJ21MD_101, PJ21MD_110, PJ21MD_111,
2604 0, 0, 0, 0, 0, 0, 0, 0,
2605
2606 PJ20MD_000, PJ20MD_001, PJ20MD_010, PJ20MD_011,
2607 PJ20MD_100, PJ20MD_101, PJ20MD_110, PJ20MD_111,
2608 0, 0, 0, 0, 0, 0, 0, 0 }
2609 },
2610 { PINMUX_CFG_REG("PJCR4", 0xfffe3906, 16, 4) {
2611 PJ19MD_000, PJ19MD_001, PJ19MD_010, PJ19MD_011,
2612 PJ19MD_100, PJ19MD_101, PJ19MD_110, PJ19MD_111,
2613 0, 0, 0, 0, 0, 0, 0, 0,
2614
2615 PJ18MD_000, PJ18MD_001, PJ18MD_010, PJ18MD_011,
2616 PJ18MD_100, PJ18MD_101, PJ18MD_110, PJ18MD_111,
2617 0, 0, 0, 0, 0, 0, 0, 0,
2618
2619 PJ17MD_000, PJ17MD_001, PJ17MD_010, PJ17MD_011,
2620 PJ17MD_100, PJ17MD_101, PJ17MD_110, PJ17MD_111,
2621 0, 0, 0, 0, 0, 0, 0, 0,
2622
2623 PJ16MD_000, PJ16MD_001, PJ16MD_010, PJ16MD_011,
2624 PJ16MD_100, PJ16MD_101, PJ16MD_110, PJ16MD_111,
2625 0, 0, 0, 0, 0, 0, 0, 0 }
2626 },
2627 { PINMUX_CFG_REG("PJCR3", 0xfffe3908, 16, 4) {
2628 PJ15MD_000, PJ15MD_001, PJ15MD_010, PJ15MD_011,
2629 PJ15MD_100, PJ15MD_101, PJ15MD_110, PJ15MD_111,
2630 0, 0, 0, 0, 0, 0, 0, 0,
2631
2632 PJ14MD_000, PJ14MD_001, PJ14MD_010, PJ14MD_011,
2633 PJ14MD_100, PJ14MD_101, PJ14MD_110, PJ14MD_111,
2634 0, 0, 0, 0, 0, 0, 0, 0,
2635
2636 PJ13MD_000, PJ13MD_001, PJ13MD_010, PJ13MD_011,
2637 PJ13MD_100, PJ13MD_101, PJ13MD_110, PJ13MD_111,
2638 0, 0, 0, 0, 0, 0, 0, 0,
2639
2640 PJ12MD_000, PJ12MD_001, PJ12MD_010, PJ12MD_011,
2641 PJ12MD_100, PJ12MD_101, PJ12MD_110, PJ12MD_111,
2642 0, 0, 0, 0, 0, 0, 0, 0 }
2643 },
2644 { PINMUX_CFG_REG("PJCR2", 0xfffe390a, 16, 4) {
2645 PJ11MD_000, PJ11MD_001, PJ11MD_010, PJ11MD_011,
2646 PJ11MD_100, PJ11MD_101, PJ11MD_110, PJ11MD_111,
2647 0, 0, 0, 0, 0, 0, 0, 0,
2648
2649 PJ10MD_000, PJ10MD_001, PJ10MD_010, PJ10MD_011,
2650 PJ10MD_100, PJ10MD_101, PJ10MD_110, PJ10MD_111,
2651 0, 0, 0, 0, 0, 0, 0, 0,
2652
2653 PJ9MD_000, PJ9MD_001, PJ9MD_010, PJ9MD_011,
2654 PJ9MD_100, PJ9MD_101, PJ9MD_110, PJ9MD_111,
2655 0, 0, 0, 0, 0, 0, 0, 0,
2656
2657 PJ8MD_000, PJ8MD_001, PJ8MD_010, PJ8MD_011,
2658 PJ8MD_100, PJ8MD_101, PJ8MD_110, PJ8MD_111,
2659 0, 0, 0, 0, 0, 0, 0, 0 }
2660 },
2661 { PINMUX_CFG_REG("PJCR1", 0xfffe390c, 16, 4) {
2662 PJ7MD_000, PJ7MD_001, PJ7MD_010, PJ7MD_011,
2663 PJ7MD_100, PJ7MD_101, PJ7MD_110, PJ7MD_111,
2664 0, 0, 0, 0, 0, 0, 0, 0,
2665
2666 PJ6MD_000, PJ6MD_001, PJ6MD_010, PJ6MD_011,
2667 PJ6MD_100, PJ6MD_101, PJ6MD_110, PJ6MD_111,
2668 0, 0, 0, 0, 0, 0, 0, 0,
2669
2670 PJ5MD_000, PJ5MD_001, PJ5MD_010, PJ5MD_011,
2671 PJ5MD_100, PJ5MD_101, PJ5MD_110, PJ5MD_111,
2672 0, 0, 0, 0, 0, 0, 0, 0,
2673
2674 PJ4MD_000, PJ4MD_001, PJ4MD_010, PJ4MD_011,
2675 PJ4MD_100, PJ4MD_101, PJ4MD_110, PJ4MD_111,
2676 0, 0, 0, 0, 0, 0, 0, 0 }
2677 },
2678 { PINMUX_CFG_REG("PJCR0", 0xfffe390e, 16, 4) {
2679 PJ3MD_000, PJ3MD_001, PJ3MD_010, PJ3MD_011,
2680 PJ3MD_100, PJ3MD_101, PJ3MD_110, PJ3MD_111,
2681 0, 0, 0, 0, 0, 0, 0, 0,
2682
2683 PJ2MD_000, PJ2MD_001, PJ2MD_010, PJ2MD_011,
2684 PJ2MD_100, PJ2MD_101, PJ2MD_110, PJ2MD_111,
2685 0, 0, 0, 0, 0, 0, 0, 0,
2686
2687 PJ1MD_000, PJ1MD_001, PJ1MD_010, PJ1MD_011,
2688 PJ1MD_100, PJ1MD_101, PJ1MD_110, PJ1MD_111,
2689 0, 0, 0, 0, 0, 0, 0, 0,
2690
2691 PJ0MD_000, PJ0MD_001, PJ0MD_010, PJ0MD_011,
2692 PJ0MD_100, PJ0MD_101, PJ0MD_110, PJ0MD_111,
2693 0, 0, 0, 0, 0, 0, 0, 0 }
2694 },
2695
2696 { PINMUX_CFG_REG("PJIOR1", 0xfffe3910, 16, 1) {
2697 PJ31_IN, PJ31_OUT,
2698 PJ30_IN, PJ30_OUT,
2699 PJ29_IN, PJ29_OUT,
2700 PJ28_IN, PJ28_OUT,
2701 PJ27_IN, PJ27_OUT,
2702 PJ26_IN, PJ26_OUT,
2703 PJ25_IN, PJ25_OUT,
2704 PJ24_IN, PJ24_OUT,
2705 PJ23_IN, PJ23_OUT,
2706 PJ22_IN, PJ22_OUT,
2707 PJ21_IN, PJ21_OUT,
2708 PJ20_IN, PJ20_OUT,
2709 PJ19_IN, PJ19_OUT,
2710 PJ18_IN, PJ18_OUT,
2711 PJ17_IN, PJ17_OUT,
2712 PJ16_IN, PJ16_OUT }
2713 },
2714 { PINMUX_CFG_REG("PJIOR0", 0xfffe3912, 16, 1) {
2715 PJ15_IN, PJ15_OUT,
2716 PJ14_IN, PJ14_OUT,
2717 PJ13_IN, PJ13_OUT,
2718 PJ12_IN, PJ12_OUT,
2719 PJ11_IN, PJ11_OUT,
2720 PJ10_IN, PJ10_OUT,
2721 PJ9_IN, PJ9_OUT,
2722 PJ8_IN, PJ8_OUT,
2723 PJ7_IN, PJ7_OUT,
2724 PJ6_IN, PJ6_OUT,
2725 PJ5_IN, PJ5_OUT,
2726 PJ4_IN, PJ4_OUT,
2727 PJ3_IN, PJ3_OUT,
2728 PJ2_IN, PJ2_OUT,
2729 PJ1_IN, PJ1_OUT,
2730 PJ0_IN, PJ0_OUT }
2731 },
2732
2733 {}
2734};
2735
2736static struct pinmux_data_reg pinmux_data_regs[] = {
2737 { PINMUX_DATA_REG("PADR0", 0xfffe3816, 16) {
2738 0, 0, 0, 0, 0, 0, 0, PA1_DATA,
2739 0, 0, 0, 0, 0, 0, 0, PA0_DATA }
2740 },
2741
2742 { PINMUX_DATA_REG("PBDR1", 0xfffe3834, 16) {
2743 0, 0, 0, 0, 0, 0, 0, 0,
2744 0, PB22_DATA, PB21_DATA, PB20_DATA,
2745 PB19_DATA, PB18_DATA, PB17_DATA, PB16_DATA }
2746 },
2747 { PINMUX_DATA_REG("PBDR0", 0xfffe3836, 16) {
2748 PB15_DATA, PB14_DATA, PB13_DATA, PB12_DATA,
2749 PB11_DATA, PB10_DATA, PB9_DATA, PB8_DATA,
2750 PB7_DATA, PB6_DATA, PB5_DATA, PB4_DATA,
2751 PB3_DATA, PB2_DATA, PB1_DATA, 0 }
2752 },
2753
2754 { PINMUX_DATA_REG("PCDR0", 0xfffe3856, 16) {
2755 0, 0, 0, 0,
2756 0, 0, 0, PC8_DATA,
2757 PC7_DATA, PC6_DATA, PC5_DATA, PC4_DATA,
2758 PC3_DATA, PC2_DATA, PC1_DATA, PC0_DATA }
2759 },
2760
2761 { PINMUX_DATA_REG("PDDR0", 0xfffe3876, 16) {
2762 PD15_DATA, PD14_DATA, PD13_DATA, PD12_DATA,
2763 PD11_DATA, PD10_DATA, PD9_DATA, PD8_DATA,
2764 PD7_DATA, PD6_DATA, PD5_DATA, PD4_DATA,
2765 PD3_DATA, PD2_DATA, PD1_DATA, PD0_DATA }
2766 },
2767
2768 { PINMUX_DATA_REG("PEDR0", 0xfffe3896, 16) {
2769 0, 0, 0, 0, 0, 0, 0, 0,
2770 PE7_DATA, PE6_DATA, PE5_DATA, PE4_DATA,
2771 PE3_DATA, PE2_DATA, PE1_DATA, PE0_DATA }
2772 },
2773
2774 { PINMUX_DATA_REG("PFDR1", 0xfffe38b4, 16) {
2775 0, 0, 0, 0, 0, 0, 0, 0,
2776 PF23_DATA, PF22_DATA, PF21_DATA, PF20_DATA,
2777 PF19_DATA, PF18_DATA, PF17_DATA, PF16_DATA }
2778 },
2779 { PINMUX_DATA_REG("PFDR0", 0xfffe38b6, 16) {
2780 PF15_DATA, PF14_DATA, PF13_DATA, PF12_DATA,
2781 PF11_DATA, PF10_DATA, PF9_DATA, PF8_DATA,
2782 PF7_DATA, PF6_DATA, PF5_DATA, PF4_DATA,
2783 PF3_DATA, PF2_DATA, PF1_DATA, PF0_DATA }
2784 },
2785
2786 { PINMUX_DATA_REG("PGDR1", 0xfffe38d4, 16) {
2787 0, 0, 0, 0,
2788 PG27_DATA, PG26_DATA, PG25_DATA, PG24_DATA,
2789 PG23_DATA, PG22_DATA, PG21_DATA, PG20_DATA,
2790 PG19_DATA, PG18_DATA, PG17_DATA, PG16_DATA }
2791 },
2792 { PINMUX_DATA_REG("PGDR0", 0xfffe38d6, 16) {
2793 PG15_DATA, PG14_DATA, PG13_DATA, PG12_DATA,
2794 PG11_DATA, PG10_DATA, PG9_DATA, PG8_DATA,
2795 PG7_DATA, PG6_DATA, PG5_DATA, PG4_DATA,
2796 PG3_DATA, PG2_DATA, PG1_DATA, PG0_DATA }
2797 },
2798
2799 { PINMUX_DATA_REG("PJDR1", 0xfffe3914, 16) {
2800 PJ31_DATA, PJ30_DATA, PJ29_DATA, PJ28_DATA,
2801 PJ27_DATA, PJ26_DATA, PJ25_DATA, PJ24_DATA,
2802 PJ23_DATA, PJ22_DATA, PJ21_DATA, PJ20_DATA,
2803 PJ19_DATA, PJ18_DATA, PJ17_DATA, PJ16_DATA }
2804 },
2805 { PINMUX_DATA_REG("PJDR0", 0xfffe3916, 16) {
2806 PJ15_DATA, PJ14_DATA, PJ13_DATA, PJ12_DATA,
2807 PJ11_DATA, PJ10_DATA, PJ9_DATA, PJ8_DATA,
2808 PJ7_DATA, PJ6_DATA, PJ5_DATA, PJ4_DATA,
2809 PJ3_DATA, PJ2_DATA, PJ1_DATA, PJ0_DATA }
2810 },
2811
2812 { }
2813};
2814
2815static struct pinmux_info sh7269_pinmux_info = {
2816 .name = "sh7269_pfc",
2817 .reserved_id = PINMUX_RESERVED,
2818 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2819 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END, FORCE_IN },
2820 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END, FORCE_OUT },
2821 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2822 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2823
2824 .first_gpio = GPIO_PA1,
2825 .last_gpio = GPIO_FN_LCD_M_DISP,
2826
2827 .gpios = pinmux_gpios,
2828 .cfg_regs = pinmux_config_regs,
2829 .data_regs = pinmux_data_regs,
2830
2831 .gpio_data = pinmux_data,
2832 .gpio_data_size = ARRAY_SIZE(pinmux_data),
2833};
2834
2835static int __init plat_pinmux_setup(void)
2836{
2837 return register_pinmux(&sh7269_pinmux_info);
2838}
2839arch_initcall(plat_pinmux_setup);
diff --git a/arch/sh/kernel/cpu/sh2a/probe.c b/arch/sh/kernel/cpu/sh2a/probe.c
index 5170b6aa412..48e97a2a0c8 100644
--- a/arch/sh/kernel/cpu/sh2a/probe.c
+++ b/arch/sh/kernel/cpu/sh2a/probe.c
@@ -29,12 +29,6 @@ void __cpuinit cpu_probe(void)
29#elif defined(CONFIG_CPU_SUBTYPE_SH7263) 29#elif defined(CONFIG_CPU_SUBTYPE_SH7263)
30 boot_cpu_data.type = CPU_SH7263; 30 boot_cpu_data.type = CPU_SH7263;
31 boot_cpu_data.flags |= CPU_HAS_FPU; 31 boot_cpu_data.flags |= CPU_HAS_FPU;
32#elif defined(CONFIG_CPU_SUBTYPE_SH7264)
33 boot_cpu_data.type = CPU_SH7264;
34 boot_cpu_data.flags |= CPU_HAS_FPU;
35#elif defined(CONFIG_CPU_SUBTYPE_SH7269)
36 boot_cpu_data.type = CPU_SH7269;
37 boot_cpu_data.flags |= CPU_HAS_FPU;
38#elif defined(CONFIG_CPU_SUBTYPE_SH7206) 32#elif defined(CONFIG_CPU_SUBTYPE_SH7206)
39 boot_cpu_data.type = CPU_SH7206; 33 boot_cpu_data.type = CPU_SH7206;
40 boot_cpu_data.flags |= CPU_HAS_DSP; 34 boot_cpu_data.flags |= CPU_HAS_DSP;
diff --git a/arch/sh/kernel/cpu/sh2a/setup-mxg.c b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
index f7f1cf2af30..949bf2bac28 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-mxg.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
@@ -204,7 +204,7 @@ static struct plat_sci_port scif0_platform_data = {
204 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 204 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
205 .scbrr_algo_id = SCBRR_ALGO_2, 205 .scbrr_algo_id = SCBRR_ALGO_2,
206 .type = PORT_SCIF, 206 .type = PORT_SCIF,
207 .irqs = SCIx_IRQ_MUXED(220), 207 .irqs = { 220, 220, 220, 220 },
208}; 208};
209 209
210static struct platform_device scif0_device = { 210static struct platform_device scif0_device = {
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
index 7b84785b896..9df558dcdb8 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
@@ -183,7 +183,7 @@ static struct plat_sci_port scif0_platform_data = {
183 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 183 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
184 .scbrr_algo_id = SCBRR_ALGO_2, 184 .scbrr_algo_id = SCBRR_ALGO_2,
185 .type = PORT_SCIF, 185 .type = PORT_SCIF,
186 .irqs = SCIx_IRQ_MUXED(180), 186 .irqs = { 180, 180, 180, 180 }
187}; 187};
188 188
189static struct platform_device scif0_device = { 189static struct platform_device scif0_device = {
@@ -200,7 +200,7 @@ static struct plat_sci_port scif1_platform_data = {
200 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 200 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
201 .scbrr_algo_id = SCBRR_ALGO_2, 201 .scbrr_algo_id = SCBRR_ALGO_2,
202 .type = PORT_SCIF, 202 .type = PORT_SCIF,
203 .irqs = SCIx_IRQ_MUXED(184), 203 .irqs = { 184, 184, 184, 184 }
204}; 204};
205 205
206static struct platform_device scif1_device = { 206static struct platform_device scif1_device = {
@@ -217,7 +217,7 @@ static struct plat_sci_port scif2_platform_data = {
217 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 217 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
218 .scbrr_algo_id = SCBRR_ALGO_2, 218 .scbrr_algo_id = SCBRR_ALGO_2,
219 .type = PORT_SCIF, 219 .type = PORT_SCIF,
220 .irqs = SCIx_IRQ_MUXED(188), 220 .irqs = { 188, 188, 188, 188 }
221}; 221};
222 222
223static struct platform_device scif2_device = { 223static struct platform_device scif2_device = {
@@ -234,7 +234,7 @@ static struct plat_sci_port scif3_platform_data = {
234 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 234 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
235 .scbrr_algo_id = SCBRR_ALGO_2, 235 .scbrr_algo_id = SCBRR_ALGO_2,
236 .type = PORT_SCIF, 236 .type = PORT_SCIF,
237 .irqs = SCIx_IRQ_MUXED(192), 237 .irqs = { 192, 192, 192, 192 }
238}; 238};
239 239
240static struct platform_device scif3_device = { 240static struct platform_device scif3_device = {
@@ -251,7 +251,7 @@ static struct plat_sci_port scif4_platform_data = {
251 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 251 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
252 .scbrr_algo_id = SCBRR_ALGO_2, 252 .scbrr_algo_id = SCBRR_ALGO_2,
253 .type = PORT_SCIF, 253 .type = PORT_SCIF,
254 .irqs = SCIx_IRQ_MUXED(196), 254 .irqs = { 196, 196, 196, 196 }
255}; 255};
256 256
257static struct platform_device scif4_device = { 257static struct platform_device scif4_device = {
@@ -268,7 +268,7 @@ static struct plat_sci_port scif5_platform_data = {
268 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 268 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
269 .scbrr_algo_id = SCBRR_ALGO_2, 269 .scbrr_algo_id = SCBRR_ALGO_2,
270 .type = PORT_SCIF, 270 .type = PORT_SCIF,
271 .irqs = SCIx_IRQ_MUXED(200), 271 .irqs = { 200, 200, 200, 200 }
272}; 272};
273 273
274static struct platform_device scif5_device = { 274static struct platform_device scif5_device = {
@@ -285,7 +285,7 @@ static struct plat_sci_port scif6_platform_data = {
285 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 285 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
286 .scbrr_algo_id = SCBRR_ALGO_2, 286 .scbrr_algo_id = SCBRR_ALGO_2,
287 .type = PORT_SCIF, 287 .type = PORT_SCIF,
288 .irqs = SCIx_IRQ_MUXED(204), 288 .irqs = { 204, 204, 204, 204 }
289}; 289};
290 290
291static struct platform_device scif6_device = { 291static struct platform_device scif6_device = {
@@ -302,7 +302,7 @@ static struct plat_sci_port scif7_platform_data = {
302 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 302 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
303 .scbrr_algo_id = SCBRR_ALGO_2, 303 .scbrr_algo_id = SCBRR_ALGO_2,
304 .type = PORT_SCIF, 304 .type = PORT_SCIF,
305 .irqs = SCIx_IRQ_MUXED(208), 305 .irqs = { 208, 208, 208, 208 }
306}; 306};
307 307
308static struct platform_device scif7_device = { 308static struct platform_device scif7_device = {
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
index bfc33f6a28c..a43124e608c 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
@@ -176,12 +176,10 @@ static DECLARE_INTC_DESC(intc_desc, "sh7203", vectors, groups,
176static struct plat_sci_port scif0_platform_data = { 176static struct plat_sci_port scif0_platform_data = {
177 .mapbase = 0xfffe8000, 177 .mapbase = 0xfffe8000,
178 .flags = UPF_BOOT_AUTOCONF, 178 .flags = UPF_BOOT_AUTOCONF,
179 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE | 179 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
180 SCSCR_REIE,
181 .scbrr_algo_id = SCBRR_ALGO_2, 180 .scbrr_algo_id = SCBRR_ALGO_2,
182 .type = PORT_SCIF, 181 .type = PORT_SCIF,
183 .irqs = SCIx_IRQ_MUXED(192), 182 .irqs = { 192, 192, 192, 192 },
184 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
185}; 183};
186 184
187static struct platform_device scif0_device = { 185static struct platform_device scif0_device = {
@@ -195,12 +193,10 @@ static struct platform_device scif0_device = {
195static struct plat_sci_port scif1_platform_data = { 193static struct plat_sci_port scif1_platform_data = {
196 .mapbase = 0xfffe8800, 194 .mapbase = 0xfffe8800,
197 .flags = UPF_BOOT_AUTOCONF, 195 .flags = UPF_BOOT_AUTOCONF,
198 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE | 196 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
199 SCSCR_REIE,
200 .scbrr_algo_id = SCBRR_ALGO_2, 197 .scbrr_algo_id = SCBRR_ALGO_2,
201 .type = PORT_SCIF, 198 .type = PORT_SCIF,
202 .irqs = SCIx_IRQ_MUXED(196), 199 .irqs = { 196, 196, 196, 196 },
203 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
204}; 200};
205 201
206static struct platform_device scif1_device = { 202static struct platform_device scif1_device = {
@@ -214,12 +210,10 @@ static struct platform_device scif1_device = {
214static struct plat_sci_port scif2_platform_data = { 210static struct plat_sci_port scif2_platform_data = {
215 .mapbase = 0xfffe9000, 211 .mapbase = 0xfffe9000,
216 .flags = UPF_BOOT_AUTOCONF, 212 .flags = UPF_BOOT_AUTOCONF,
217 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE | 213 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
218 SCSCR_REIE,
219 .scbrr_algo_id = SCBRR_ALGO_2, 214 .scbrr_algo_id = SCBRR_ALGO_2,
220 .type = PORT_SCIF, 215 .type = PORT_SCIF,
221 .irqs = SCIx_IRQ_MUXED(200), 216 .irqs = { 200, 200, 200, 200 },
222 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
223}; 217};
224 218
225static struct platform_device scif2_device = { 219static struct platform_device scif2_device = {
@@ -233,12 +227,10 @@ static struct platform_device scif2_device = {
233static struct plat_sci_port scif3_platform_data = { 227static struct plat_sci_port scif3_platform_data = {
234 .mapbase = 0xfffe9800, 228 .mapbase = 0xfffe9800,
235 .flags = UPF_BOOT_AUTOCONF, 229 .flags = UPF_BOOT_AUTOCONF,
236 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE | 230 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
237 SCSCR_REIE,
238 .scbrr_algo_id = SCBRR_ALGO_2, 231 .scbrr_algo_id = SCBRR_ALGO_2,
239 .type = PORT_SCIF, 232 .type = PORT_SCIF,
240 .irqs = SCIx_IRQ_MUXED(204), 233 .irqs = { 204, 204, 204, 204 },
241 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
242}; 234};
243 235
244static struct platform_device scif3_device = { 236static struct platform_device scif3_device = {
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
index a5010741de8..5d14f849aea 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
@@ -139,7 +139,7 @@ static struct plat_sci_port scif0_platform_data = {
139 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 139 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
140 .scbrr_algo_id = SCBRR_ALGO_2, 140 .scbrr_algo_id = SCBRR_ALGO_2,
141 .type = PORT_SCIF, 141 .type = PORT_SCIF,
142 .irqs = SCIx_IRQ_MUXED(240), 142 .irqs = { 240, 240, 240, 240 },
143}; 143};
144 144
145static struct platform_device scif0_device = { 145static struct platform_device scif0_device = {
@@ -156,7 +156,7 @@ static struct plat_sci_port scif1_platform_data = {
156 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 156 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
157 .scbrr_algo_id = SCBRR_ALGO_2, 157 .scbrr_algo_id = SCBRR_ALGO_2,
158 .type = PORT_SCIF, 158 .type = PORT_SCIF,
159 .irqs = SCIx_IRQ_MUXED(244), 159 .irqs = { 244, 244, 244, 244 },
160}; 160};
161 161
162static struct platform_device scif1_device = { 162static struct platform_device scif1_device = {
@@ -173,7 +173,7 @@ static struct plat_sci_port scif2_platform_data = {
173 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 173 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
174 .scbrr_algo_id = SCBRR_ALGO_2, 174 .scbrr_algo_id = SCBRR_ALGO_2,
175 .type = PORT_SCIF, 175 .type = PORT_SCIF,
176 .irqs = SCIx_IRQ_MUXED(248), 176 .irqs = { 248, 248, 248, 248 },
177}; 177};
178 178
179static struct platform_device scif2_device = { 179static struct platform_device scif2_device = {
@@ -190,7 +190,7 @@ static struct plat_sci_port scif3_platform_data = {
190 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 190 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
191 .scbrr_algo_id = SCBRR_ALGO_2, 191 .scbrr_algo_id = SCBRR_ALGO_2,
192 .type = PORT_SCIF, 192 .type = PORT_SCIF,
193 .irqs = SCIx_IRQ_MUXED(252), 193 .irqs = { 252, 252, 252, 252 },
194}; 194};
195 195
196static struct platform_device scif3_device = { 196static struct platform_device scif3_device = {
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7264.c b/arch/sh/kernel/cpu/sh2a/setup-sh7264.c
deleted file mode 100644
index ce5c1b5aebf..00000000000
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7264.c
+++ /dev/null
@@ -1,606 +0,0 @@
1/*
2 * SH7264 Setup
3 *
4 * Copyright (C) 2012 Renesas Electronics Europe Ltd
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#include <linux/platform_device.h>
11#include <linux/init.h>
12#include <linux/serial.h>
13#include <linux/serial_sci.h>
14#include <linux/usb/r8a66597.h>
15#include <linux/sh_timer.h>
16#include <linux/io.h>
17
18enum {
19 UNUSED = 0,
20
21 /* interrupt sources */
22 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
23 PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7,
24
25 DMAC0, DMAC1, DMAC2, DMAC3, DMAC4, DMAC5, DMAC6, DMAC7,
26 DMAC8, DMAC9, DMAC10, DMAC11, DMAC12, DMAC13, DMAC14, DMAC15,
27 USB, VDC3, CMT0, CMT1, BSC, WDT,
28 MTU0_ABCD, MTU0_VEF, MTU1_AB, MTU1_VU, MTU2_AB, MTU2_VU,
29 MTU3_ABCD, MTU3_TCI3V, MTU4_ABCD, MTU4_TCI4V,
30 PWMT1, PWMT2, ADC_ADI,
31 SSIF0, SSII1, SSII2, SSII3,
32 RSPDIF,
33 IIC30, IIC31, IIC32, IIC33,
34 SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI,
35 SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI,
36 SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI,
37 SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI,
38 SCIF4_BRI, SCIF4_ERI, SCIF4_RXI, SCIF4_TXI,
39 SCIF5_BRI, SCIF5_ERI, SCIF5_RXI, SCIF5_TXI,
40 SCIF6_BRI, SCIF6_ERI, SCIF6_RXI, SCIF6_TXI,
41 SCIF7_BRI, SCIF7_ERI, SCIF7_RXI, SCIF7_TXI,
42 SIO_FIFO, RSPIC0, RSPIC1,
43 RCAN0, RCAN1, IEBC, CD_ROMD,
44 NFMC, SDHI, RTC,
45 SRCC0, SRCC1, DCOMU, OFFI, IFEI,
46
47 /* interrupt groups */
48 PINT, SCIF0, SCIF1, SCIF2, SCIF3, SCIF4, SCIF5, SCIF6, SCIF7,
49};
50
51static struct intc_vect vectors[] __initdata = {
52 INTC_IRQ(IRQ0, 64), INTC_IRQ(IRQ1, 65),
53 INTC_IRQ(IRQ2, 66), INTC_IRQ(IRQ3, 67),
54 INTC_IRQ(IRQ4, 68), INTC_IRQ(IRQ5, 69),
55 INTC_IRQ(IRQ6, 70), INTC_IRQ(IRQ7, 71),
56
57 INTC_IRQ(PINT0, 80), INTC_IRQ(PINT1, 81),
58 INTC_IRQ(PINT2, 82), INTC_IRQ(PINT3, 83),
59 INTC_IRQ(PINT4, 84), INTC_IRQ(PINT5, 85),
60 INTC_IRQ(PINT6, 86), INTC_IRQ(PINT7, 87),
61
62 INTC_IRQ(DMAC0, 108), INTC_IRQ(DMAC0, 109),
63 INTC_IRQ(DMAC1, 112), INTC_IRQ(DMAC1, 113),
64 INTC_IRQ(DMAC2, 116), INTC_IRQ(DMAC2, 117),
65 INTC_IRQ(DMAC3, 120), INTC_IRQ(DMAC3, 121),
66 INTC_IRQ(DMAC4, 124), INTC_IRQ(DMAC4, 125),
67 INTC_IRQ(DMAC5, 128), INTC_IRQ(DMAC5, 129),
68 INTC_IRQ(DMAC6, 132), INTC_IRQ(DMAC6, 133),
69 INTC_IRQ(DMAC7, 136), INTC_IRQ(DMAC7, 137),
70 INTC_IRQ(DMAC8, 140), INTC_IRQ(DMAC8, 141),
71 INTC_IRQ(DMAC9, 144), INTC_IRQ(DMAC9, 145),
72 INTC_IRQ(DMAC10, 148), INTC_IRQ(DMAC10, 149),
73 INTC_IRQ(DMAC11, 152), INTC_IRQ(DMAC11, 153),
74 INTC_IRQ(DMAC12, 156), INTC_IRQ(DMAC12, 157),
75 INTC_IRQ(DMAC13, 160), INTC_IRQ(DMAC13, 161),
76 INTC_IRQ(DMAC14, 164), INTC_IRQ(DMAC14, 165),
77 INTC_IRQ(DMAC15, 168), INTC_IRQ(DMAC15, 169),
78
79 INTC_IRQ(USB, 170),
80 INTC_IRQ(VDC3, 171), INTC_IRQ(VDC3, 172),
81 INTC_IRQ(VDC3, 173), INTC_IRQ(VDC3, 174),
82 INTC_IRQ(CMT0, 175), INTC_IRQ(CMT1, 176),
83 INTC_IRQ(BSC, 177), INTC_IRQ(WDT, 178),
84
85 INTC_IRQ(MTU0_ABCD, 179), INTC_IRQ(MTU0_ABCD, 180),
86 INTC_IRQ(MTU0_ABCD, 181), INTC_IRQ(MTU0_ABCD, 182),
87 INTC_IRQ(MTU0_VEF, 183),
88 INTC_IRQ(MTU0_VEF, 184), INTC_IRQ(MTU0_VEF, 185),
89 INTC_IRQ(MTU1_AB, 186), INTC_IRQ(MTU1_AB, 187),
90 INTC_IRQ(MTU1_VU, 188), INTC_IRQ(MTU1_VU, 189),
91 INTC_IRQ(MTU2_AB, 190), INTC_IRQ(MTU2_AB, 191),
92 INTC_IRQ(MTU2_VU, 192), INTC_IRQ(MTU2_VU, 193),
93 INTC_IRQ(MTU3_ABCD, 194), INTC_IRQ(MTU3_ABCD, 195),
94 INTC_IRQ(MTU3_ABCD, 196), INTC_IRQ(MTU3_ABCD, 197),
95 INTC_IRQ(MTU3_TCI3V, 198),
96 INTC_IRQ(MTU4_ABCD, 199), INTC_IRQ(MTU4_ABCD, 200),
97 INTC_IRQ(MTU4_ABCD, 201), INTC_IRQ(MTU4_ABCD, 202),
98 INTC_IRQ(MTU4_TCI4V, 203),
99
100 INTC_IRQ(PWMT1, 204), INTC_IRQ(PWMT2, 205),
101
102 INTC_IRQ(ADC_ADI, 206),
103
104 INTC_IRQ(SSIF0, 207), INTC_IRQ(SSIF0, 208),
105 INTC_IRQ(SSIF0, 209),
106 INTC_IRQ(SSII1, 210), INTC_IRQ(SSII1, 211),
107 INTC_IRQ(SSII2, 212), INTC_IRQ(SSII2, 213),
108 INTC_IRQ(SSII3, 214), INTC_IRQ(SSII3, 215),
109
110 INTC_IRQ(RSPDIF, 216),
111
112 INTC_IRQ(IIC30, 217), INTC_IRQ(IIC30, 218),
113 INTC_IRQ(IIC30, 219), INTC_IRQ(IIC30, 220),
114 INTC_IRQ(IIC30, 221),
115 INTC_IRQ(IIC31, 222), INTC_IRQ(IIC31, 223),
116 INTC_IRQ(IIC31, 224), INTC_IRQ(IIC31, 225),
117 INTC_IRQ(IIC31, 226),
118 INTC_IRQ(IIC32, 227), INTC_IRQ(IIC32, 228),
119 INTC_IRQ(IIC32, 229), INTC_IRQ(IIC32, 230),
120 INTC_IRQ(IIC32, 231),
121
122 INTC_IRQ(SCIF0_BRI, 232), INTC_IRQ(SCIF0_ERI, 233),
123 INTC_IRQ(SCIF0_RXI, 234), INTC_IRQ(SCIF0_TXI, 235),
124 INTC_IRQ(SCIF1_BRI, 236), INTC_IRQ(SCIF1_ERI, 237),
125 INTC_IRQ(SCIF1_RXI, 238), INTC_IRQ(SCIF1_TXI, 239),
126 INTC_IRQ(SCIF2_BRI, 240), INTC_IRQ(SCIF2_ERI, 241),
127 INTC_IRQ(SCIF2_RXI, 242), INTC_IRQ(SCIF2_TXI, 243),
128 INTC_IRQ(SCIF3_BRI, 244), INTC_IRQ(SCIF3_ERI, 245),
129 INTC_IRQ(SCIF3_RXI, 246), INTC_IRQ(SCIF3_TXI, 247),
130 INTC_IRQ(SCIF4_BRI, 248), INTC_IRQ(SCIF4_ERI, 249),
131 INTC_IRQ(SCIF4_RXI, 250), INTC_IRQ(SCIF4_TXI, 251),
132 INTC_IRQ(SCIF5_BRI, 252), INTC_IRQ(SCIF5_ERI, 253),
133 INTC_IRQ(SCIF5_RXI, 254), INTC_IRQ(SCIF5_TXI, 255),
134 INTC_IRQ(SCIF6_BRI, 256), INTC_IRQ(SCIF6_ERI, 257),
135 INTC_IRQ(SCIF6_RXI, 258), INTC_IRQ(SCIF6_TXI, 259),
136 INTC_IRQ(SCIF7_BRI, 260), INTC_IRQ(SCIF7_ERI, 261),
137 INTC_IRQ(SCIF7_RXI, 262), INTC_IRQ(SCIF7_TXI, 263),
138
139 INTC_IRQ(SIO_FIFO, 264),
140
141 INTC_IRQ(RSPIC0, 265), INTC_IRQ(RSPIC0, 266),
142 INTC_IRQ(RSPIC0, 267),
143 INTC_IRQ(RSPIC1, 268), INTC_IRQ(RSPIC1, 269),
144 INTC_IRQ(RSPIC1, 270),
145
146 INTC_IRQ(RCAN0, 271), INTC_IRQ(RCAN0, 272),
147 INTC_IRQ(RCAN0, 273), INTC_IRQ(RCAN0, 274),
148 INTC_IRQ(RCAN0, 275),
149 INTC_IRQ(RCAN1, 276), INTC_IRQ(RCAN1, 277),
150 INTC_IRQ(RCAN1, 278), INTC_IRQ(RCAN1, 279),
151 INTC_IRQ(RCAN1, 280),
152
153 INTC_IRQ(IEBC, 281),
154
155 INTC_IRQ(CD_ROMD, 282), INTC_IRQ(CD_ROMD, 283),
156 INTC_IRQ(CD_ROMD, 284), INTC_IRQ(CD_ROMD, 285),
157 INTC_IRQ(CD_ROMD, 286), INTC_IRQ(CD_ROMD, 287),
158
159 INTC_IRQ(NFMC, 288), INTC_IRQ(NFMC, 289),
160 INTC_IRQ(NFMC, 290), INTC_IRQ(NFMC, 291),
161
162 INTC_IRQ(SDHI, 292), INTC_IRQ(SDHI, 293),
163 INTC_IRQ(SDHI, 294),
164
165 INTC_IRQ(RTC, 296), INTC_IRQ(RTC, 297),
166 INTC_IRQ(RTC, 298),
167
168 INTC_IRQ(SRCC0, 299), INTC_IRQ(SRCC0, 300),
169 INTC_IRQ(SRCC0, 301), INTC_IRQ(SRCC0, 302),
170 INTC_IRQ(SRCC0, 303),
171 INTC_IRQ(SRCC1, 304), INTC_IRQ(SRCC1, 305),
172 INTC_IRQ(SRCC1, 306), INTC_IRQ(SRCC1, 307),
173 INTC_IRQ(SRCC1, 308),
174
175 INTC_IRQ(DCOMU, 310), INTC_IRQ(DCOMU, 311),
176 INTC_IRQ(DCOMU, 312),
177};
178
179static struct intc_group groups[] __initdata = {
180 INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3,
181 PINT4, PINT5, PINT6, PINT7),
182 INTC_GROUP(SCIF0, SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI),
183 INTC_GROUP(SCIF1, SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI),
184 INTC_GROUP(SCIF2, SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI),
185 INTC_GROUP(SCIF3, SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI),
186 INTC_GROUP(SCIF4, SCIF4_BRI, SCIF4_ERI, SCIF4_RXI, SCIF4_TXI),
187 INTC_GROUP(SCIF5, SCIF5_BRI, SCIF5_ERI, SCIF5_RXI, SCIF5_TXI),
188 INTC_GROUP(SCIF6, SCIF6_BRI, SCIF6_ERI, SCIF6_RXI, SCIF6_TXI),
189 INTC_GROUP(SCIF7, SCIF7_BRI, SCIF7_ERI, SCIF7_RXI, SCIF7_TXI),
190};
191
192static struct intc_prio_reg prio_registers[] __initdata = {
193 { 0xfffe0818, 0, 16, 4, /* IPR01 */ { IRQ0, IRQ1, IRQ2, IRQ3 } },
194 { 0xfffe081a, 0, 16, 4, /* IPR02 */ { IRQ4, IRQ5, IRQ6, IRQ7 } },
195 { 0xfffe0820, 0, 16, 4, /* IPR05 */ { PINT, 0, 0, 0 } },
196 { 0xfffe0c00, 0, 16, 4, /* IPR06 */ { DMAC0, DMAC1, DMAC2, DMAC3 } },
197 { 0xfffe0c02, 0, 16, 4, /* IPR07 */ { DMAC4, DMAC5, DMAC6, DMAC7 } },
198 { 0xfffe0c04, 0, 16, 4, /* IPR08 */ { DMAC8, DMAC9,
199 DMAC10, DMAC11 } },
200 { 0xfffe0c06, 0, 16, 4, /* IPR09 */ { DMAC12, DMAC13,
201 DMAC14, DMAC15 } },
202 { 0xfffe0c08, 0, 16, 4, /* IPR10 */ { USB, VDC3, CMT0, CMT1 } },
203 { 0xfffe0c0a, 0, 16, 4, /* IPR11 */ { BSC, WDT, MTU0_ABCD, MTU0_VEF } },
204 { 0xfffe0c0c, 0, 16, 4, /* IPR12 */ { MTU1_AB, MTU1_VU,
205 MTU2_AB, MTU2_VU } },
206 { 0xfffe0c0e, 0, 16, 4, /* IPR13 */ { MTU3_ABCD, MTU3_TCI3V,
207 MTU4_ABCD, MTU4_TCI4V } },
208 { 0xfffe0c10, 0, 16, 4, /* IPR14 */ { PWMT1, PWMT2, ADC_ADI, 0 } },
209 { 0xfffe0c12, 0, 16, 4, /* IPR15 */ { SSIF0, SSII1, SSII2, SSII3 } },
210 { 0xfffe0c14, 0, 16, 4, /* IPR16 */ { RSPDIF, IIC30, IIC31, IIC32 } },
211 { 0xfffe0c16, 0, 16, 4, /* IPR17 */ { SCIF0, SCIF1, SCIF2, SCIF3 } },
212 { 0xfffe0c18, 0, 16, 4, /* IPR18 */ { SCIF4, SCIF5, SCIF6, SCIF7 } },
213 { 0xfffe0c1a, 0, 16, 4, /* IPR19 */ { SIO_FIFO, 0, RSPIC0, RSPIC1, } },
214 { 0xfffe0c1c, 0, 16, 4, /* IPR20 */ { RCAN0, RCAN1, IEBC, CD_ROMD } },
215 { 0xfffe0c1e, 0, 16, 4, /* IPR21 */ { NFMC, SDHI, RTC, 0 } },
216 { 0xfffe0c20, 0, 16, 4, /* IPR22 */ { SRCC0, SRCC1, 0, DCOMU } },
217};
218
219static struct intc_mask_reg mask_registers[] __initdata = {
220 { 0xfffe0808, 0, 16, /* PINTER */
221 { 0, 0, 0, 0, 0, 0, 0, 0,
222 PINT7, PINT6, PINT5, PINT4, PINT3, PINT2, PINT1, PINT0 } },
223};
224
225static DECLARE_INTC_DESC(intc_desc, "sh7264", vectors, groups,
226 mask_registers, prio_registers, NULL);
227
228static struct plat_sci_port scif0_platform_data = {
229 .mapbase = 0xfffe8000,
230 .flags = UPF_BOOT_AUTOCONF,
231 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
232 SCSCR_REIE | SCSCR_TOIE,
233 .scbrr_algo_id = SCBRR_ALGO_2,
234 .type = PORT_SCIF,
235 .irqs = { 233, 234, 235, 232 },
236 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
237};
238
239static struct platform_device scif0_device = {
240 .name = "sh-sci",
241 .id = 0,
242 .dev = {
243 .platform_data = &scif0_platform_data,
244 },
245};
246
247static struct plat_sci_port scif1_platform_data = {
248 .mapbase = 0xfffe8800,
249 .flags = UPF_BOOT_AUTOCONF,
250 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
251 SCSCR_REIE | SCSCR_TOIE,
252 .scbrr_algo_id = SCBRR_ALGO_2,
253 .type = PORT_SCIF,
254 .irqs = { 237, 238, 239, 236 },
255 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
256};
257
258static struct platform_device scif1_device = {
259 .name = "sh-sci",
260 .id = 1,
261 .dev = {
262 .platform_data = &scif1_platform_data,
263 },
264};
265
266static struct plat_sci_port scif2_platform_data = {
267 .mapbase = 0xfffe9000,
268 .flags = UPF_BOOT_AUTOCONF,
269 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
270 SCSCR_REIE | SCSCR_TOIE,
271 .scbrr_algo_id = SCBRR_ALGO_2,
272 .type = PORT_SCIF,
273 .irqs = { 241, 242, 243, 240 },
274 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
275};
276
277static struct platform_device scif2_device = {
278 .name = "sh-sci",
279 .id = 2,
280 .dev = {
281 .platform_data = &scif2_platform_data,
282 },
283};
284
285static struct plat_sci_port scif3_platform_data = {
286 .mapbase = 0xfffe9800,
287 .flags = UPF_BOOT_AUTOCONF,
288 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
289 SCSCR_REIE | SCSCR_TOIE,
290 .scbrr_algo_id = SCBRR_ALGO_2,
291 .type = PORT_SCIF,
292 .irqs = { 245, 246, 247, 244 },
293 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
294};
295
296static struct platform_device scif3_device = {
297 .name = "sh-sci",
298 .id = 3,
299 .dev = {
300 .platform_data = &scif3_platform_data,
301 },
302};
303
304static struct plat_sci_port scif4_platform_data = {
305 .mapbase = 0xfffea000,
306 .flags = UPF_BOOT_AUTOCONF,
307 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
308 SCSCR_REIE | SCSCR_TOIE,
309 .scbrr_algo_id = SCBRR_ALGO_2,
310 .type = PORT_SCIF,
311 .irqs = { 249, 250, 251, 248 },
312 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
313};
314
315static struct platform_device scif4_device = {
316 .name = "sh-sci",
317 .id = 4,
318 .dev = {
319 .platform_data = &scif4_platform_data,
320 },
321};
322
323static struct plat_sci_port scif5_platform_data = {
324 .mapbase = 0xfffea800,
325 .flags = UPF_BOOT_AUTOCONF,
326 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
327 SCSCR_REIE | SCSCR_TOIE,
328 .scbrr_algo_id = SCBRR_ALGO_2,
329 .type = PORT_SCIF,
330 .irqs = { 253, 254, 255, 252 },
331 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
332};
333
334static struct platform_device scif5_device = {
335 .name = "sh-sci",
336 .id = 5,
337 .dev = {
338 .platform_data = &scif5_platform_data,
339 },
340};
341
342static struct plat_sci_port scif6_platform_data = {
343 .mapbase = 0xfffeb000,
344 .flags = UPF_BOOT_AUTOCONF,
345 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
346 SCSCR_REIE | SCSCR_TOIE,
347 .scbrr_algo_id = SCBRR_ALGO_2,
348 .type = PORT_SCIF,
349 .irqs = { 257, 258, 259, 256 },
350 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
351};
352
353static struct platform_device scif6_device = {
354 .name = "sh-sci",
355 .id = 6,
356 .dev = {
357 .platform_data = &scif6_platform_data,
358 },
359};
360
361static struct plat_sci_port scif7_platform_data = {
362 .mapbase = 0xfffeb800,
363 .flags = UPF_BOOT_AUTOCONF,
364 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
365 SCSCR_REIE | SCSCR_TOIE,
366 .scbrr_algo_id = SCBRR_ALGO_2,
367 .type = PORT_SCIF,
368 .irqs = { 261, 262, 263, 260 },
369 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
370};
371
372static struct platform_device scif7_device = {
373 .name = "sh-sci",
374 .id = 7,
375 .dev = {
376 .platform_data = &scif7_platform_data,
377 },
378};
379
380static struct sh_timer_config cmt0_platform_data = {
381 .channel_offset = 0x02,
382 .timer_bit = 0,
383 .clockevent_rating = 125,
384 .clocksource_rating = 0, /* disabled due to code generation issues */
385};
386
387static struct resource cmt0_resources[] = {
388 [0] = {
389 .name = "CMT0",
390 .start = 0xfffec002,
391 .end = 0xfffec007,
392 .flags = IORESOURCE_MEM,
393 },
394 [1] = {
395 .start = 175,
396 .flags = IORESOURCE_IRQ,
397 },
398};
399
400static struct platform_device cmt0_device = {
401 .name = "sh_cmt",
402 .id = 0,
403 .dev = {
404 .platform_data = &cmt0_platform_data,
405 },
406 .resource = cmt0_resources,
407 .num_resources = ARRAY_SIZE(cmt0_resources),
408};
409
410static struct sh_timer_config cmt1_platform_data = {
411 .name = "CMT1",
412 .channel_offset = 0x08,
413 .timer_bit = 1,
414 .clockevent_rating = 125,
415 .clocksource_rating = 0, /* disabled due to code generation issues */
416};
417
418static struct resource cmt1_resources[] = {
419 [0] = {
420 .name = "CMT1",
421 .start = 0xfffec008,
422 .end = 0xfffec00d,
423 .flags = IORESOURCE_MEM,
424 },
425 [1] = {
426 .start = 176,
427 .flags = IORESOURCE_IRQ,
428 },
429};
430
431static struct platform_device cmt1_device = {
432 .name = "sh_cmt",
433 .id = 1,
434 .dev = {
435 .platform_data = &cmt1_platform_data,
436 },
437 .resource = cmt1_resources,
438 .num_resources = ARRAY_SIZE(cmt1_resources),
439};
440
441static struct sh_timer_config mtu2_0_platform_data = {
442 .name = "MTU2_0",
443 .channel_offset = -0x80,
444 .timer_bit = 0,
445 .clockevent_rating = 200,
446};
447
448static struct resource mtu2_0_resources[] = {
449 [0] = {
450 .name = "MTU2_0",
451 .start = 0xfffe4300,
452 .end = 0xfffe4326,
453 .flags = IORESOURCE_MEM,
454 },
455 [1] = {
456 .start = 179,
457 .flags = IORESOURCE_IRQ,
458 },
459};
460
461static struct platform_device mtu2_0_device = {
462 .name = "sh_mtu2",
463 .id = 0,
464 .dev = {
465 .platform_data = &mtu2_0_platform_data,
466 },
467 .resource = mtu2_0_resources,
468 .num_resources = ARRAY_SIZE(mtu2_0_resources),
469};
470
471static struct sh_timer_config mtu2_1_platform_data = {
472 .name = "MTU2_1",
473 .channel_offset = -0x100,
474 .timer_bit = 1,
475 .clockevent_rating = 200,
476};
477
478static struct resource mtu2_1_resources[] = {
479 [0] = {
480 .name = "MTU2_1",
481 .start = 0xfffe4380,
482 .end = 0xfffe4390,
483 .flags = IORESOURCE_MEM,
484 },
485 [1] = {
486 .start = 186,
487 .flags = IORESOURCE_IRQ,
488 },
489};
490
491static struct platform_device mtu2_1_device = {
492 .name = "sh_mtu2",
493 .id = 1,
494 .dev = {
495 .platform_data = &mtu2_1_platform_data,
496 },
497 .resource = mtu2_1_resources,
498 .num_resources = ARRAY_SIZE(mtu2_1_resources),
499};
500
501static struct resource rtc_resources[] = {
502 [0] = {
503 .start = 0xfffe6000,
504 .end = 0xfffe6000 + 0x30 - 1,
505 .flags = IORESOURCE_IO,
506 },
507 [1] = {
508 /* Shared Period/Carry/Alarm IRQ */
509 .start = 296,
510 .flags = IORESOURCE_IRQ,
511 },
512};
513
514static struct platform_device rtc_device = {
515 .name = "sh-rtc",
516 .id = -1,
517 .num_resources = ARRAY_SIZE(rtc_resources),
518 .resource = rtc_resources,
519};
520
521/* USB Host */
522static void usb_port_power(int port, int power)
523{
524 __raw_writew(0x200 , 0xffffc0c2) ; /* Initialise UACS25 */
525}
526
527static struct r8a66597_platdata r8a66597_data = {
528 .on_chip = 1,
529 .endian = 1,
530 .port_power = usb_port_power,
531};
532
533static struct resource r8a66597_usb_host_resources[] = {
534 [0] = {
535 .start = 0xffffc000,
536 .end = 0xffffc0e4,
537 .flags = IORESOURCE_MEM,
538 },
539 [1] = {
540 .start = 170,
541 .end = 170,
542 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
543 },
544};
545
546static struct platform_device r8a66597_usb_host_device = {
547 .name = "r8a66597_hcd",
548 .id = 0,
549 .dev = {
550 .dma_mask = NULL, /* not use dma */
551 .coherent_dma_mask = 0xffffffff,
552 .platform_data = &r8a66597_data,
553 },
554 .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources),
555 .resource = r8a66597_usb_host_resources,
556};
557
558static struct platform_device *sh7264_devices[] __initdata = {
559 &scif0_device,
560 &scif1_device,
561 &scif2_device,
562 &scif3_device,
563 &scif4_device,
564 &scif5_device,
565 &scif6_device,
566 &scif7_device,
567 &cmt0_device,
568 &cmt1_device,
569 &mtu2_0_device,
570 &mtu2_1_device,
571 &rtc_device,
572 &r8a66597_usb_host_device,
573};
574
575static int __init sh7264_devices_setup(void)
576{
577 return platform_add_devices(sh7264_devices,
578 ARRAY_SIZE(sh7264_devices));
579}
580arch_initcall(sh7264_devices_setup);
581
582void __init plat_irq_setup(void)
583{
584 register_intc_controller(&intc_desc);
585}
586
587static struct platform_device *sh7264_early_devices[] __initdata = {
588 &scif0_device,
589 &scif1_device,
590 &scif2_device,
591 &scif3_device,
592 &scif4_device,
593 &scif5_device,
594 &scif6_device,
595 &scif7_device,
596 &cmt0_device,
597 &cmt1_device,
598 &mtu2_0_device,
599 &mtu2_1_device,
600};
601
602void __init plat_early_device_setup(void)
603{
604 early_platform_add_devices(sh7264_early_devices,
605 ARRAY_SIZE(sh7264_early_devices));
606}
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7269.c b/arch/sh/kernel/cpu/sh2a/setup-sh7269.c
deleted file mode 100644
index e82ae9d8d3b..00000000000
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7269.c
+++ /dev/null
@@ -1,615 +0,0 @@
1/*
2 * SH7269 Setup
3 *
4 * Copyright (C) 2012 Renesas Electronics Europe Ltd
5 * Copyright (C) 2012 Phil Edworthy
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11#include <linux/platform_device.h>
12#include <linux/init.h>
13#include <linux/serial.h>
14#include <linux/serial_sci.h>
15#include <linux/usb/r8a66597.h>
16#include <linux/sh_timer.h>
17#include <linux/io.h>
18
19enum {
20 UNUSED = 0,
21
22 /* interrupt sources */
23 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
24 PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7,
25
26 DMAC0, DMAC1, DMAC2, DMAC3, DMAC4, DMAC5, DMAC6, DMAC7,
27 DMAC8, DMAC9, DMAC10, DMAC11, DMAC12, DMAC13, DMAC14, DMAC15,
28 USB, VDC4, CMT0, CMT1, BSC, WDT,
29 MTU0_ABCD, MTU0_VEF, MTU1_AB, MTU1_VU, MTU2_AB, MTU2_VU,
30 MTU3_ABCD, MTU3_TCI3V, MTU4_ABCD, MTU4_TCI4V,
31 PWMT1, PWMT2, ADC_ADI,
32 SSIF0, SSII1, SSII2, SSII3, SSII4, SSII5,
33 RSPDIF,
34 IIC30, IIC31, IIC32, IIC33,
35 SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI,
36 SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI,
37 SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI,
38 SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI,
39 SCIF4_BRI, SCIF4_ERI, SCIF4_RXI, SCIF4_TXI,
40 SCIF5_BRI, SCIF5_ERI, SCIF5_RXI, SCIF5_TXI,
41 SCIF6_BRI, SCIF6_ERI, SCIF6_RXI, SCIF6_TXI,
42 SCIF7_BRI, SCIF7_ERI, SCIF7_RXI, SCIF7_TXI,
43 RCAN0, RCAN1, RCAN2,
44 RSPIC0, RSPIC1,
45 IEBC, CD_ROMD,
46 NFMC,
47 SDHI0, SDHI1,
48 RTC,
49 SRCC0, SRCC1, SRCC2,
50
51 /* interrupt groups */
52 PINT, SCIF0, SCIF1, SCIF2, SCIF3, SCIF4, SCIF5, SCIF6, SCIF7,
53};
54
55static struct intc_vect vectors[] __initdata = {
56 INTC_IRQ(IRQ0, 64), INTC_IRQ(IRQ1, 65),
57 INTC_IRQ(IRQ2, 66), INTC_IRQ(IRQ3, 67),
58 INTC_IRQ(IRQ4, 68), INTC_IRQ(IRQ5, 69),
59 INTC_IRQ(IRQ6, 70), INTC_IRQ(IRQ7, 71),
60
61 INTC_IRQ(PINT0, 80), INTC_IRQ(PINT1, 81),
62 INTC_IRQ(PINT2, 82), INTC_IRQ(PINT3, 83),
63 INTC_IRQ(PINT4, 84), INTC_IRQ(PINT5, 85),
64 INTC_IRQ(PINT6, 86), INTC_IRQ(PINT7, 87),
65
66 INTC_IRQ(DMAC0, 108), INTC_IRQ(DMAC0, 109),
67 INTC_IRQ(DMAC1, 112), INTC_IRQ(DMAC1, 113),
68 INTC_IRQ(DMAC2, 116), INTC_IRQ(DMAC2, 117),
69 INTC_IRQ(DMAC3, 120), INTC_IRQ(DMAC3, 121),
70 INTC_IRQ(DMAC4, 124), INTC_IRQ(DMAC4, 125),
71 INTC_IRQ(DMAC5, 128), INTC_IRQ(DMAC5, 129),
72 INTC_IRQ(DMAC6, 132), INTC_IRQ(DMAC6, 133),
73 INTC_IRQ(DMAC7, 136), INTC_IRQ(DMAC7, 137),
74 INTC_IRQ(DMAC8, 140), INTC_IRQ(DMAC8, 141),
75 INTC_IRQ(DMAC9, 144), INTC_IRQ(DMAC9, 145),
76 INTC_IRQ(DMAC10, 148), INTC_IRQ(DMAC10, 149),
77 INTC_IRQ(DMAC11, 152), INTC_IRQ(DMAC11, 153),
78 INTC_IRQ(DMAC12, 156), INTC_IRQ(DMAC12, 157),
79 INTC_IRQ(DMAC13, 160), INTC_IRQ(DMAC13, 161),
80 INTC_IRQ(DMAC14, 164), INTC_IRQ(DMAC14, 165),
81 INTC_IRQ(DMAC15, 168), INTC_IRQ(DMAC15, 169),
82
83 INTC_IRQ(USB, 170),
84
85 INTC_IRQ(VDC4, 171), INTC_IRQ(VDC4, 172),
86 INTC_IRQ(VDC4, 173), INTC_IRQ(VDC4, 174),
87 INTC_IRQ(VDC4, 175), INTC_IRQ(VDC4, 176),
88 INTC_IRQ(VDC4, 177), INTC_IRQ(VDC4, 177),
89
90 INTC_IRQ(CMT0, 188), INTC_IRQ(CMT1, 189),
91
92 INTC_IRQ(BSC, 190), INTC_IRQ(WDT, 191),
93
94 INTC_IRQ(MTU0_ABCD, 192), INTC_IRQ(MTU0_ABCD, 193),
95 INTC_IRQ(MTU0_ABCD, 194), INTC_IRQ(MTU0_ABCD, 195),
96 INTC_IRQ(MTU0_VEF, 196), INTC_IRQ(MTU0_VEF, 197),
97 INTC_IRQ(MTU0_VEF, 198),
98 INTC_IRQ(MTU1_AB, 199), INTC_IRQ(MTU1_AB, 200),
99 INTC_IRQ(MTU1_VU, 201), INTC_IRQ(MTU1_VU, 202),
100 INTC_IRQ(MTU2_AB, 203), INTC_IRQ(MTU2_AB, 204),
101 INTC_IRQ(MTU2_VU, 205), INTC_IRQ(MTU2_VU, 206),
102 INTC_IRQ(MTU3_ABCD, 207), INTC_IRQ(MTU3_ABCD, 208),
103 INTC_IRQ(MTU3_ABCD, 209), INTC_IRQ(MTU3_ABCD, 210),
104 INTC_IRQ(MTU3_TCI3V, 211),
105 INTC_IRQ(MTU4_ABCD, 212), INTC_IRQ(MTU4_ABCD, 213),
106 INTC_IRQ(MTU4_ABCD, 214), INTC_IRQ(MTU4_ABCD, 215),
107 INTC_IRQ(MTU4_TCI4V, 216),
108
109 INTC_IRQ(PWMT1, 217), INTC_IRQ(PWMT2, 218),
110
111 INTC_IRQ(ADC_ADI, 223),
112
113 INTC_IRQ(SSIF0, 224), INTC_IRQ(SSIF0, 225),
114 INTC_IRQ(SSIF0, 226),
115 INTC_IRQ(SSII1, 227), INTC_IRQ(SSII1, 228),
116 INTC_IRQ(SSII2, 229), INTC_IRQ(SSII2, 230),
117 INTC_IRQ(SSII3, 231), INTC_IRQ(SSII3, 232),
118 INTC_IRQ(SSII4, 233), INTC_IRQ(SSII4, 234),
119 INTC_IRQ(SSII5, 235), INTC_IRQ(SSII5, 236),
120
121 INTC_IRQ(RSPDIF, 237),
122
123 INTC_IRQ(IIC30, 238), INTC_IRQ(IIC30, 239),
124 INTC_IRQ(IIC30, 240), INTC_IRQ(IIC30, 241),
125 INTC_IRQ(IIC30, 242),
126 INTC_IRQ(IIC31, 243), INTC_IRQ(IIC31, 244),
127 INTC_IRQ(IIC31, 245), INTC_IRQ(IIC31, 246),
128 INTC_IRQ(IIC31, 247),
129 INTC_IRQ(IIC32, 248), INTC_IRQ(IIC32, 249),
130 INTC_IRQ(IIC32, 250), INTC_IRQ(IIC32, 251),
131 INTC_IRQ(IIC32, 252),
132 INTC_IRQ(IIC33, 253), INTC_IRQ(IIC33, 254),
133 INTC_IRQ(IIC33, 255), INTC_IRQ(IIC33, 256),
134 INTC_IRQ(IIC33, 257),
135
136 INTC_IRQ(SCIF0_BRI, 258), INTC_IRQ(SCIF0_ERI, 259),
137 INTC_IRQ(SCIF0_RXI, 260), INTC_IRQ(SCIF0_TXI, 261),
138 INTC_IRQ(SCIF1_BRI, 262), INTC_IRQ(SCIF1_ERI, 263),
139 INTC_IRQ(SCIF1_RXI, 264), INTC_IRQ(SCIF1_TXI, 265),
140 INTC_IRQ(SCIF2_BRI, 266), INTC_IRQ(SCIF2_ERI, 267),
141 INTC_IRQ(SCIF2_RXI, 268), INTC_IRQ(SCIF2_TXI, 269),
142 INTC_IRQ(SCIF3_BRI, 270), INTC_IRQ(SCIF3_ERI, 271),
143 INTC_IRQ(SCIF3_RXI, 272), INTC_IRQ(SCIF3_TXI, 273),
144 INTC_IRQ(SCIF4_BRI, 274), INTC_IRQ(SCIF4_ERI, 275),
145 INTC_IRQ(SCIF4_RXI, 276), INTC_IRQ(SCIF4_TXI, 277),
146 INTC_IRQ(SCIF5_BRI, 278), INTC_IRQ(SCIF5_ERI, 279),
147 INTC_IRQ(SCIF5_RXI, 280), INTC_IRQ(SCIF5_TXI, 281),
148 INTC_IRQ(SCIF6_BRI, 282), INTC_IRQ(SCIF6_ERI, 283),
149 INTC_IRQ(SCIF6_RXI, 284), INTC_IRQ(SCIF6_TXI, 285),
150 INTC_IRQ(SCIF7_BRI, 286), INTC_IRQ(SCIF7_ERI, 287),
151 INTC_IRQ(SCIF7_RXI, 288), INTC_IRQ(SCIF7_TXI, 289),
152
153 INTC_IRQ(RCAN0, 291), INTC_IRQ(RCAN0, 292),
154 INTC_IRQ(RCAN0, 293), INTC_IRQ(RCAN0, 294),
155 INTC_IRQ(RCAN0, 295),
156 INTC_IRQ(RCAN1, 296), INTC_IRQ(RCAN1, 297),
157 INTC_IRQ(RCAN1, 298), INTC_IRQ(RCAN1, 299),
158 INTC_IRQ(RCAN1, 300),
159 INTC_IRQ(RCAN2, 301), INTC_IRQ(RCAN2, 302),
160 INTC_IRQ(RCAN2, 303), INTC_IRQ(RCAN2, 304),
161 INTC_IRQ(RCAN2, 305),
162
163 INTC_IRQ(RSPIC0, 306), INTC_IRQ(RSPIC0, 307),
164 INTC_IRQ(RSPIC0, 308),
165 INTC_IRQ(RSPIC1, 309), INTC_IRQ(RSPIC1, 310),
166 INTC_IRQ(RSPIC1, 311),
167
168 INTC_IRQ(IEBC, 318),
169
170 INTC_IRQ(CD_ROMD, 319), INTC_IRQ(CD_ROMD, 320),
171 INTC_IRQ(CD_ROMD, 321), INTC_IRQ(CD_ROMD, 322),
172 INTC_IRQ(CD_ROMD, 323), INTC_IRQ(CD_ROMD, 324),
173
174 INTC_IRQ(NFMC, 325), INTC_IRQ(NFMC, 326),
175 INTC_IRQ(NFMC, 327), INTC_IRQ(NFMC, 328),
176
177 INTC_IRQ(SDHI0, 332), INTC_IRQ(SDHI0, 333),
178 INTC_IRQ(SDHI0, 334),
179 INTC_IRQ(SDHI1, 335), INTC_IRQ(SDHI1, 336),
180 INTC_IRQ(SDHI1, 337),
181
182 INTC_IRQ(RTC, 338), INTC_IRQ(RTC, 339),
183 INTC_IRQ(RTC, 340),
184
185 INTC_IRQ(SRCC0, 341), INTC_IRQ(SRCC0, 342),
186 INTC_IRQ(SRCC0, 343), INTC_IRQ(SRCC0, 344),
187 INTC_IRQ(SRCC0, 345),
188 INTC_IRQ(SRCC1, 346), INTC_IRQ(SRCC1, 347),
189 INTC_IRQ(SRCC1, 348), INTC_IRQ(SRCC1, 349),
190 INTC_IRQ(SRCC1, 350),
191 INTC_IRQ(SRCC2, 351), INTC_IRQ(SRCC2, 352),
192 INTC_IRQ(SRCC2, 353), INTC_IRQ(SRCC2, 354),
193 INTC_IRQ(SRCC2, 355),
194};
195
196static struct intc_group groups[] __initdata = {
197 INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3,
198 PINT4, PINT5, PINT6, PINT7),
199 INTC_GROUP(SCIF0, SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI),
200 INTC_GROUP(SCIF1, SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI),
201 INTC_GROUP(SCIF2, SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI),
202 INTC_GROUP(SCIF3, SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI),
203 INTC_GROUP(SCIF4, SCIF4_BRI, SCIF4_ERI, SCIF4_RXI, SCIF4_TXI),
204 INTC_GROUP(SCIF5, SCIF5_BRI, SCIF5_ERI, SCIF5_RXI, SCIF5_TXI),
205 INTC_GROUP(SCIF6, SCIF6_BRI, SCIF6_ERI, SCIF6_RXI, SCIF6_TXI),
206 INTC_GROUP(SCIF7, SCIF7_BRI, SCIF7_ERI, SCIF7_RXI, SCIF7_TXI),
207};
208
209static struct intc_prio_reg prio_registers[] __initdata = {
210 { 0xfffe0818, 0, 16, 4, /* IPR01 */ { IRQ0, IRQ1, IRQ2, IRQ3 } },
211 { 0xfffe081a, 0, 16, 4, /* IPR02 */ { IRQ4, IRQ5, IRQ6, IRQ7 } },
212 { 0xfffe0820, 0, 16, 4, /* IPR05 */ { PINT, 0, 0, 0 } },
213 { 0xfffe0c00, 0, 16, 4, /* IPR06 */ { DMAC0, DMAC1, DMAC2, DMAC3 } },
214 { 0xfffe0c02, 0, 16, 4, /* IPR07 */ { DMAC4, DMAC5, DMAC6, DMAC7 } },
215 { 0xfffe0c04, 0, 16, 4, /* IPR08 */ { DMAC8, DMAC9,
216 DMAC10, DMAC11 } },
217 { 0xfffe0c06, 0, 16, 4, /* IPR09 */ { DMAC12, DMAC13,
218 DMAC14, DMAC15 } },
219 { 0xfffe0c08, 0, 16, 4, /* IPR10 */ { USB, VDC4, VDC4, VDC4 } },
220 { 0xfffe0c0a, 0, 16, 4, /* IPR11 */ { 0, 0, 0, 0 } },
221 { 0xfffe0c0c, 0, 16, 4, /* IPR12 */ { CMT0, CMT1, BSC, WDT } },
222 { 0xfffe0c0e, 0, 16, 4, /* IPR13 */ { MTU0_ABCD, MTU0_VEF,
223 MTU1_AB, MTU1_VU } },
224 { 0xfffe0c10, 0, 16, 4, /* IPR14 */ { MTU2_AB, MTU2_VU,
225 MTU3_ABCD, MTU3_TCI3V } },
226 { 0xfffe0c12, 0, 16, 4, /* IPR15 */ { MTU4_ABCD, MTU4_TCI4V,
227 PWMT1, PWMT2 } },
228 { 0xfffe0c14, 0, 16, 4, /* IPR16 */ { 0, 0, 0, 0 } },
229 { 0xfffe0c16, 0, 16, 4, /* IPR17 */ { ADC_ADI, SSIF0, SSII1, SSII2 } },
230 { 0xfffe0c18, 0, 16, 4, /* IPR18 */ { SSII3, SSII4, SSII5, RSPDIF} },
231 { 0xfffe0c1a, 0, 16, 4, /* IPR19 */ { IIC30, IIC31, IIC32, IIC33 } },
232 { 0xfffe0c1c, 0, 16, 4, /* IPR20 */ { SCIF0, SCIF1, SCIF2, SCIF3 } },
233 { 0xfffe0c1e, 0, 16, 4, /* IPR21 */ { SCIF4, SCIF5, SCIF6, SCIF7 } },
234 { 0xfffe0c20, 0, 16, 4, /* IPR22 */ { 0, RCAN0, RCAN1, RCAN2 } },
235 { 0xfffe0c22, 0, 16, 4, /* IPR23 */ { RSPIC0, RSPIC1, 0, 0 } },
236 { 0xfffe0c24, 0, 16, 4, /* IPR24 */ { IEBC, CD_ROMD, NFMC, 0 } },
237 { 0xfffe0c26, 0, 16, 4, /* IPR25 */ { SDHI0, SDHI1, RTC, 0 } },
238 { 0xfffe0c28, 0, 16, 4, /* IPR26 */ { SRCC0, SRCC1, SRCC2, 0 } },
239};
240
241static struct intc_mask_reg mask_registers[] __initdata = {
242 { 0xfffe0808, 0, 16, /* PINTER */
243 { 0, 0, 0, 0, 0, 0, 0, 0,
244 PINT7, PINT6, PINT5, PINT4, PINT3, PINT2, PINT1, PINT0 } },
245};
246
247static DECLARE_INTC_DESC(intc_desc, "sh7269", vectors, groups,
248 mask_registers, prio_registers, NULL);
249
250static struct plat_sci_port scif0_platform_data = {
251 .mapbase = 0xe8007000,
252 .flags = UPF_BOOT_AUTOCONF,
253 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
254 SCSCR_REIE | SCSCR_TOIE,
255 .scbrr_algo_id = SCBRR_ALGO_2,
256 .type = PORT_SCIF,
257 .irqs = { 259, 260, 261, 258 },
258 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
259};
260
261static struct platform_device scif0_device = {
262 .name = "sh-sci",
263 .id = 0,
264 .dev = {
265 .platform_data = &scif0_platform_data,
266 },
267};
268
269static struct plat_sci_port scif1_platform_data = {
270 .mapbase = 0xe8007800,
271 .flags = UPF_BOOT_AUTOCONF,
272 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
273 SCSCR_REIE | SCSCR_TOIE,
274 .scbrr_algo_id = SCBRR_ALGO_2,
275 .type = PORT_SCIF,
276 .irqs = { 263, 264, 265, 262 },
277 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
278};
279
280static struct platform_device scif1_device = {
281 .name = "sh-sci",
282 .id = 1,
283 .dev = {
284 .platform_data = &scif1_platform_data,
285 },
286};
287
288static struct plat_sci_port scif2_platform_data = {
289 .mapbase = 0xe8008000,
290 .flags = UPF_BOOT_AUTOCONF,
291 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
292 SCSCR_REIE | SCSCR_TOIE,
293 .scbrr_algo_id = SCBRR_ALGO_2,
294 .type = PORT_SCIF,
295 .irqs = { 267, 268, 269, 266 },
296 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
297};
298
299static struct platform_device scif2_device = {
300 .name = "sh-sci",
301 .id = 2,
302 .dev = {
303 .platform_data = &scif2_platform_data,
304 },
305};
306
307static struct plat_sci_port scif3_platform_data = {
308 .mapbase = 0xe8008800,
309 .flags = UPF_BOOT_AUTOCONF,
310 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
311 SCSCR_REIE | SCSCR_TOIE,
312 .scbrr_algo_id = SCBRR_ALGO_2,
313 .type = PORT_SCIF,
314 .irqs = { 271, 272, 273, 270 },
315 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
316};
317
318static struct platform_device scif3_device = {
319 .name = "sh-sci",
320 .id = 3,
321 .dev = {
322 .platform_data = &scif3_platform_data,
323 },
324};
325
326static struct plat_sci_port scif4_platform_data = {
327 .mapbase = 0xe8009000,
328 .flags = UPF_BOOT_AUTOCONF,
329 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
330 SCSCR_REIE | SCSCR_TOIE,
331 .scbrr_algo_id = SCBRR_ALGO_2,
332 .type = PORT_SCIF,
333 .irqs = { 275, 276, 277, 274 },
334 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
335};
336
337static struct platform_device scif4_device = {
338 .name = "sh-sci",
339 .id = 4,
340 .dev = {
341 .platform_data = &scif4_platform_data,
342 },
343};
344
345static struct plat_sci_port scif5_platform_data = {
346 .mapbase = 0xe8009800,
347 .flags = UPF_BOOT_AUTOCONF,
348 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
349 SCSCR_REIE | SCSCR_TOIE,
350 .scbrr_algo_id = SCBRR_ALGO_2,
351 .type = PORT_SCIF,
352 .irqs = { 279, 280, 281, 278 },
353 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
354};
355
356static struct platform_device scif5_device = {
357 .name = "sh-sci",
358 .id = 5,
359 .dev = {
360 .platform_data = &scif5_platform_data,
361 },
362};
363
364static struct plat_sci_port scif6_platform_data = {
365 .mapbase = 0xe800a000,
366 .flags = UPF_BOOT_AUTOCONF,
367 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
368 SCSCR_REIE | SCSCR_TOIE,
369 .scbrr_algo_id = SCBRR_ALGO_2,
370 .type = PORT_SCIF,
371 .irqs = { 283, 284, 285, 282 },
372 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
373};
374
375static struct platform_device scif6_device = {
376 .name = "sh-sci",
377 .id = 6,
378 .dev = {
379 .platform_data = &scif6_platform_data,
380 },
381};
382
383static struct plat_sci_port scif7_platform_data = {
384 .mapbase = 0xe800a800,
385 .flags = UPF_BOOT_AUTOCONF,
386 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
387 SCSCR_REIE | SCSCR_TOIE,
388 .scbrr_algo_id = SCBRR_ALGO_2,
389 .type = PORT_SCIF,
390 .irqs = { 287, 288, 289, 286 },
391 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
392};
393
394static struct platform_device scif7_device = {
395 .name = "sh-sci",
396 .id = 7,
397 .dev = {
398 .platform_data = &scif7_platform_data,
399 },
400};
401
402static struct sh_timer_config cmt0_platform_data = {
403 .channel_offset = 0x02,
404 .timer_bit = 0,
405 .clockevent_rating = 125,
406 .clocksource_rating = 0, /* disabled due to code generation issues */
407};
408
409static struct resource cmt0_resources[] = {
410 [0] = {
411 .start = 0xfffec002,
412 .end = 0xfffec007,
413 .flags = IORESOURCE_MEM,
414 },
415 [1] = {
416 .start = 188,
417 .flags = IORESOURCE_IRQ,
418 },
419};
420
421static struct platform_device cmt0_device = {
422 .name = "sh_cmt",
423 .id = 0,
424 .dev = {
425 .platform_data = &cmt0_platform_data,
426 },
427 .resource = cmt0_resources,
428 .num_resources = ARRAY_SIZE(cmt0_resources),
429};
430
431static struct sh_timer_config cmt1_platform_data = {
432 .channel_offset = 0x08,
433 .timer_bit = 1,
434 .clockevent_rating = 125,
435 .clocksource_rating = 0, /* disabled due to code generation issues */
436};
437
438static struct resource cmt1_resources[] = {
439 [0] = {
440 .start = 0xfffec008,
441 .end = 0xfffec00d,
442 .flags = IORESOURCE_MEM,
443 },
444 [1] = {
445 .start = 189,
446 .flags = IORESOURCE_IRQ,
447 },
448};
449
450static struct platform_device cmt1_device = {
451 .name = "sh_cmt",
452 .id = 1,
453 .dev = {
454 .platform_data = &cmt1_platform_data,
455 },
456 .resource = cmt1_resources,
457 .num_resources = ARRAY_SIZE(cmt1_resources),
458};
459
460static struct sh_timer_config mtu2_0_platform_data = {
461 .channel_offset = -0x80,
462 .timer_bit = 0,
463 .clockevent_rating = 200,
464};
465
466static struct resource mtu2_0_resources[] = {
467 [0] = {
468 .start = 0xfffe4300,
469 .end = 0xfffe4326,
470 .flags = IORESOURCE_MEM,
471 },
472 [1] = {
473 .start = 192,
474 .flags = IORESOURCE_IRQ,
475 },
476};
477
478static struct platform_device mtu2_0_device = {
479 .name = "sh_mtu2",
480 .id = 0,
481 .dev = {
482 .platform_data = &mtu2_0_platform_data,
483 },
484 .resource = mtu2_0_resources,
485 .num_resources = ARRAY_SIZE(mtu2_0_resources),
486};
487
488static struct sh_timer_config mtu2_1_platform_data = {
489 .channel_offset = -0x100,
490 .timer_bit = 1,
491 .clockevent_rating = 200,
492};
493
494static struct resource mtu2_1_resources[] = {
495 [0] = {
496 .start = 0xfffe4380,
497 .end = 0xfffe4390,
498 .flags = IORESOURCE_MEM,
499 },
500 [1] = {
501 .start = 203,
502 .flags = IORESOURCE_IRQ,
503 },
504};
505
506static struct platform_device mtu2_1_device = {
507 .name = "sh_mtu2",
508 .id = 1,
509 .dev = {
510 .platform_data = &mtu2_1_platform_data,
511 },
512 .resource = mtu2_1_resources,
513 .num_resources = ARRAY_SIZE(mtu2_1_resources),
514};
515
516static struct resource rtc_resources[] = {
517 [0] = {
518 .start = 0xfffe6000,
519 .end = 0xfffe6000 + 0x30 - 1,
520 .flags = IORESOURCE_IO,
521 },
522 [1] = {
523 /* Shared Period/Carry/Alarm IRQ */
524 .start = 338,
525 .flags = IORESOURCE_IRQ,
526 },
527};
528
529static struct platform_device rtc_device = {
530 .name = "sh-rtc",
531 .id = -1,
532 .num_resources = ARRAY_SIZE(rtc_resources),
533 .resource = rtc_resources,
534};
535
536/* USB Host */
537static struct r8a66597_platdata r8a66597_data = {
538 .on_chip = 1,
539 .endian = 1,
540};
541
542static struct resource r8a66597_usb_host_resources[] = {
543 [0] = {
544 .start = 0xe8010000,
545 .end = 0xe80100e4,
546 .flags = IORESOURCE_MEM,
547 },
548 [1] = {
549 .start = 170,
550 .end = 170,
551 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
552 },
553};
554
555static struct platform_device r8a66597_usb_host_device = {
556 .name = "r8a66597_hcd",
557 .id = 0,
558 .dev = {
559 .dma_mask = NULL, /* not use dma */
560 .coherent_dma_mask = 0xffffffff,
561 .platform_data = &r8a66597_data,
562 },
563 .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources),
564 .resource = r8a66597_usb_host_resources,
565};
566
567static struct platform_device *sh7269_devices[] __initdata = {
568 &scif0_device,
569 &scif1_device,
570 &scif2_device,
571 &scif3_device,
572 &scif4_device,
573 &scif5_device,
574 &scif6_device,
575 &scif7_device,
576 &cmt0_device,
577 &cmt1_device,
578 &mtu2_0_device,
579 &mtu2_1_device,
580 &rtc_device,
581 &r8a66597_usb_host_device,
582};
583
584static int __init sh7269_devices_setup(void)
585{
586 return platform_add_devices(sh7269_devices,
587 ARRAY_SIZE(sh7269_devices));
588}
589arch_initcall(sh7269_devices_setup);
590
591void __init plat_irq_setup(void)
592{
593 register_intc_controller(&intc_desc);
594}
595
596static struct platform_device *sh7269_early_devices[] __initdata = {
597 &scif0_device,
598 &scif1_device,
599 &scif2_device,
600 &scif3_device,
601 &scif4_device,
602 &scif5_device,
603 &scif6_device,
604 &scif7_device,
605 &cmt0_device,
606 &cmt1_device,
607 &mtu2_0_device,
608 &mtu2_1_device,
609};
610
611void __init plat_early_device_setup(void)
612{
613 early_platform_add_devices(sh7269_early_devices,
614 ARRAY_SIZE(sh7269_early_devices));
615}
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh3.c b/arch/sh/kernel/cpu/sh3/clock-sh3.c
index 90faa44ca94..b78384afac0 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh3.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh3.c
@@ -34,7 +34,7 @@ static void master_clk_init(struct clk *clk)
34 clk->rate *= pfc_divisors[idx]; 34 clk->rate *= pfc_divisors[idx];
35} 35}
36 36
37static struct sh_clk_ops sh3_master_clk_ops = { 37static struct clk_ops sh3_master_clk_ops = {
38 .init = master_clk_init, 38 .init = master_clk_init,
39}; 39};
40 40
@@ -46,7 +46,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
46 return clk->parent->rate / pfc_divisors[idx]; 46 return clk->parent->rate / pfc_divisors[idx];
47} 47}
48 48
49static struct sh_clk_ops sh3_module_clk_ops = { 49static struct clk_ops sh3_module_clk_ops = {
50 .recalc = module_clk_recalc, 50 .recalc = module_clk_recalc,
51}; 51};
52 52
@@ -58,7 +58,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
58 return clk->parent->rate / stc_multipliers[idx]; 58 return clk->parent->rate / stc_multipliers[idx];
59} 59}
60 60
61static struct sh_clk_ops sh3_bus_clk_ops = { 61static struct clk_ops sh3_bus_clk_ops = {
62 .recalc = bus_clk_recalc, 62 .recalc = bus_clk_recalc,
63}; 63};
64 64
@@ -70,18 +70,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
70 return clk->parent->rate / ifc_divisors[idx]; 70 return clk->parent->rate / ifc_divisors[idx];
71} 71}
72 72
73static struct sh_clk_ops sh3_cpu_clk_ops = { 73static struct clk_ops sh3_cpu_clk_ops = {
74 .recalc = cpu_clk_recalc, 74 .recalc = cpu_clk_recalc,
75}; 75};
76 76
77static struct sh_clk_ops *sh3_clk_ops[] = { 77static struct clk_ops *sh3_clk_ops[] = {
78 &sh3_master_clk_ops, 78 &sh3_master_clk_ops,
79 &sh3_module_clk_ops, 79 &sh3_module_clk_ops,
80 &sh3_bus_clk_ops, 80 &sh3_bus_clk_ops,
81 &sh3_cpu_clk_ops, 81 &sh3_cpu_clk_ops,
82}; 82};
83 83
84void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 84void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
85{ 85{
86 if (idx < ARRAY_SIZE(sh3_clk_ops)) 86 if (idx < ARRAY_SIZE(sh3_clk_ops))
87 *ops = sh3_clk_ops[idx]; 87 *ops = sh3_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7705.c b/arch/sh/kernel/cpu/sh3/clock-sh7705.c
index a8da4a9986b..0ecea1451c6 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7705.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7705.c
@@ -35,7 +35,7 @@ static void master_clk_init(struct clk *clk)
35 clk->rate *= pfc_divisors[__raw_readw(FRQCR) & 0x0003]; 35 clk->rate *= pfc_divisors[__raw_readw(FRQCR) & 0x0003];
36} 36}
37 37
38static struct sh_clk_ops sh7705_master_clk_ops = { 38static struct clk_ops sh7705_master_clk_ops = {
39 .init = master_clk_init, 39 .init = master_clk_init,
40}; 40};
41 41
@@ -45,7 +45,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
45 return clk->parent->rate / pfc_divisors[idx]; 45 return clk->parent->rate / pfc_divisors[idx];
46} 46}
47 47
48static struct sh_clk_ops sh7705_module_clk_ops = { 48static struct clk_ops sh7705_module_clk_ops = {
49 .recalc = module_clk_recalc, 49 .recalc = module_clk_recalc,
50}; 50};
51 51
@@ -55,7 +55,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
55 return clk->parent->rate / stc_multipliers[idx]; 55 return clk->parent->rate / stc_multipliers[idx];
56} 56}
57 57
58static struct sh_clk_ops sh7705_bus_clk_ops = { 58static struct clk_ops sh7705_bus_clk_ops = {
59 .recalc = bus_clk_recalc, 59 .recalc = bus_clk_recalc,
60}; 60};
61 61
@@ -65,18 +65,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
65 return clk->parent->rate / ifc_divisors[idx]; 65 return clk->parent->rate / ifc_divisors[idx];
66} 66}
67 67
68static struct sh_clk_ops sh7705_cpu_clk_ops = { 68static struct clk_ops sh7705_cpu_clk_ops = {
69 .recalc = cpu_clk_recalc, 69 .recalc = cpu_clk_recalc,
70}; 70};
71 71
72static struct sh_clk_ops *sh7705_clk_ops[] = { 72static struct clk_ops *sh7705_clk_ops[] = {
73 &sh7705_master_clk_ops, 73 &sh7705_master_clk_ops,
74 &sh7705_module_clk_ops, 74 &sh7705_module_clk_ops,
75 &sh7705_bus_clk_ops, 75 &sh7705_bus_clk_ops,
76 &sh7705_cpu_clk_ops, 76 &sh7705_cpu_clk_ops,
77}; 77};
78 78
79void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 79void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
80{ 80{
81 if (idx < ARRAY_SIZE(sh7705_clk_ops)) 81 if (idx < ARRAY_SIZE(sh7705_clk_ops))
82 *ops = sh7705_clk_ops[idx]; 82 *ops = sh7705_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7706.c b/arch/sh/kernel/cpu/sh3/clock-sh7706.c
index a4088e5b220..6f9ff8b57dd 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7706.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7706.c
@@ -30,7 +30,7 @@ static void master_clk_init(struct clk *clk)
30 clk->rate *= pfc_divisors[idx]; 30 clk->rate *= pfc_divisors[idx];
31} 31}
32 32
33static struct sh_clk_ops sh7706_master_clk_ops = { 33static struct clk_ops sh7706_master_clk_ops = {
34 .init = master_clk_init, 34 .init = master_clk_init,
35}; 35};
36 36
@@ -42,7 +42,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
42 return clk->parent->rate / pfc_divisors[idx]; 42 return clk->parent->rate / pfc_divisors[idx];
43} 43}
44 44
45static struct sh_clk_ops sh7706_module_clk_ops = { 45static struct clk_ops sh7706_module_clk_ops = {
46 .recalc = module_clk_recalc, 46 .recalc = module_clk_recalc,
47}; 47};
48 48
@@ -54,7 +54,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
54 return clk->parent->rate / stc_multipliers[idx]; 54 return clk->parent->rate / stc_multipliers[idx];
55} 55}
56 56
57static struct sh_clk_ops sh7706_bus_clk_ops = { 57static struct clk_ops sh7706_bus_clk_ops = {
58 .recalc = bus_clk_recalc, 58 .recalc = bus_clk_recalc,
59}; 59};
60 60
@@ -66,18 +66,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
66 return clk->parent->rate / ifc_divisors[idx]; 66 return clk->parent->rate / ifc_divisors[idx];
67} 67}
68 68
69static struct sh_clk_ops sh7706_cpu_clk_ops = { 69static struct clk_ops sh7706_cpu_clk_ops = {
70 .recalc = cpu_clk_recalc, 70 .recalc = cpu_clk_recalc,
71}; 71};
72 72
73static struct sh_clk_ops *sh7706_clk_ops[] = { 73static struct clk_ops *sh7706_clk_ops[] = {
74 &sh7706_master_clk_ops, 74 &sh7706_master_clk_ops,
75 &sh7706_module_clk_ops, 75 &sh7706_module_clk_ops,
76 &sh7706_bus_clk_ops, 76 &sh7706_bus_clk_ops,
77 &sh7706_cpu_clk_ops, 77 &sh7706_cpu_clk_ops,
78}; 78};
79 79
80void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 80void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
81{ 81{
82 if (idx < ARRAY_SIZE(sh7706_clk_ops)) 82 if (idx < ARRAY_SIZE(sh7706_clk_ops))
83 *ops = sh7706_clk_ops[idx]; 83 *ops = sh7706_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7709.c b/arch/sh/kernel/cpu/sh3/clock-sh7709.c
index 54a6d4bcc0d..f302ba09e68 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7709.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7709.c
@@ -30,7 +30,7 @@ static void master_clk_init(struct clk *clk)
30 clk->rate *= pfc_divisors[idx]; 30 clk->rate *= pfc_divisors[idx];
31} 31}
32 32
33static struct sh_clk_ops sh7709_master_clk_ops = { 33static struct clk_ops sh7709_master_clk_ops = {
34 .init = master_clk_init, 34 .init = master_clk_init,
35}; 35};
36 36
@@ -42,7 +42,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
42 return clk->parent->rate / pfc_divisors[idx]; 42 return clk->parent->rate / pfc_divisors[idx];
43} 43}
44 44
45static struct sh_clk_ops sh7709_module_clk_ops = { 45static struct clk_ops sh7709_module_clk_ops = {
46 .recalc = module_clk_recalc, 46 .recalc = module_clk_recalc,
47}; 47};
48 48
@@ -55,7 +55,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
55 return clk->parent->rate * stc_multipliers[idx]; 55 return clk->parent->rate * stc_multipliers[idx];
56} 56}
57 57
58static struct sh_clk_ops sh7709_bus_clk_ops = { 58static struct clk_ops sh7709_bus_clk_ops = {
59 .recalc = bus_clk_recalc, 59 .recalc = bus_clk_recalc,
60}; 60};
61 61
@@ -67,18 +67,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
67 return clk->parent->rate / ifc_divisors[idx]; 67 return clk->parent->rate / ifc_divisors[idx];
68} 68}
69 69
70static struct sh_clk_ops sh7709_cpu_clk_ops = { 70static struct clk_ops sh7709_cpu_clk_ops = {
71 .recalc = cpu_clk_recalc, 71 .recalc = cpu_clk_recalc,
72}; 72};
73 73
74static struct sh_clk_ops *sh7709_clk_ops[] = { 74static struct clk_ops *sh7709_clk_ops[] = {
75 &sh7709_master_clk_ops, 75 &sh7709_master_clk_ops,
76 &sh7709_module_clk_ops, 76 &sh7709_module_clk_ops,
77 &sh7709_bus_clk_ops, 77 &sh7709_bus_clk_ops,
78 &sh7709_cpu_clk_ops, 78 &sh7709_cpu_clk_ops,
79}; 79};
80 80
81void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 81void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
82{ 82{
83 if (idx < ARRAY_SIZE(sh7709_clk_ops)) 83 if (idx < ARRAY_SIZE(sh7709_clk_ops))
84 *ops = sh7709_clk_ops[idx]; 84 *ops = sh7709_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7710.c b/arch/sh/kernel/cpu/sh3/clock-sh7710.c
index ce601b2e397..29a87d8946a 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7710.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7710.c
@@ -29,7 +29,7 @@ static void master_clk_init(struct clk *clk)
29 clk->rate *= md_table[__raw_readw(FRQCR) & 0x0007]; 29 clk->rate *= md_table[__raw_readw(FRQCR) & 0x0007];
30} 30}
31 31
32static struct sh_clk_ops sh7710_master_clk_ops = { 32static struct clk_ops sh7710_master_clk_ops = {
33 .init = master_clk_init, 33 .init = master_clk_init,
34}; 34};
35 35
@@ -39,7 +39,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
39 return clk->parent->rate / md_table[idx]; 39 return clk->parent->rate / md_table[idx];
40} 40}
41 41
42static struct sh_clk_ops sh7710_module_clk_ops = { 42static struct clk_ops sh7710_module_clk_ops = {
43 .recalc = module_clk_recalc, 43 .recalc = module_clk_recalc,
44}; 44};
45 45
@@ -49,7 +49,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
49 return clk->parent->rate / md_table[idx]; 49 return clk->parent->rate / md_table[idx];
50} 50}
51 51
52static struct sh_clk_ops sh7710_bus_clk_ops = { 52static struct clk_ops sh7710_bus_clk_ops = {
53 .recalc = bus_clk_recalc, 53 .recalc = bus_clk_recalc,
54}; 54};
55 55
@@ -59,18 +59,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
59 return clk->parent->rate / md_table[idx]; 59 return clk->parent->rate / md_table[idx];
60} 60}
61 61
62static struct sh_clk_ops sh7710_cpu_clk_ops = { 62static struct clk_ops sh7710_cpu_clk_ops = {
63 .recalc = cpu_clk_recalc, 63 .recalc = cpu_clk_recalc,
64}; 64};
65 65
66static struct sh_clk_ops *sh7710_clk_ops[] = { 66static struct clk_ops *sh7710_clk_ops[] = {
67 &sh7710_master_clk_ops, 67 &sh7710_master_clk_ops,
68 &sh7710_module_clk_ops, 68 &sh7710_module_clk_ops,
69 &sh7710_bus_clk_ops, 69 &sh7710_bus_clk_ops,
70 &sh7710_cpu_clk_ops, 70 &sh7710_cpu_clk_ops,
71}; 71};
72 72
73void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 73void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
74{ 74{
75 if (idx < ARRAY_SIZE(sh7710_clk_ops)) 75 if (idx < ARRAY_SIZE(sh7710_clk_ops))
76 *ops = sh7710_clk_ops[idx]; 76 *ops = sh7710_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh3/clock-sh7712.c b/arch/sh/kernel/cpu/sh3/clock-sh7712.c
index 21438a9a1ae..b0d0c520399 100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7712.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7712.c
@@ -29,7 +29,7 @@ static void master_clk_init(struct clk *clk)
29 clk->rate *= multipliers[idx]; 29 clk->rate *= multipliers[idx];
30} 30}
31 31
32static struct sh_clk_ops sh7712_master_clk_ops = { 32static struct clk_ops sh7712_master_clk_ops = {
33 .init = master_clk_init, 33 .init = master_clk_init,
34}; 34};
35 35
@@ -41,7 +41,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
41 return clk->parent->rate / divisors[idx]; 41 return clk->parent->rate / divisors[idx];
42} 42}
43 43
44static struct sh_clk_ops sh7712_module_clk_ops = { 44static struct clk_ops sh7712_module_clk_ops = {
45 .recalc = module_clk_recalc, 45 .recalc = module_clk_recalc,
46}; 46};
47 47
@@ -53,17 +53,17 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
53 return clk->parent->rate / divisors[idx]; 53 return clk->parent->rate / divisors[idx];
54} 54}
55 55
56static struct sh_clk_ops sh7712_cpu_clk_ops = { 56static struct clk_ops sh7712_cpu_clk_ops = {
57 .recalc = cpu_clk_recalc, 57 .recalc = cpu_clk_recalc,
58}; 58};
59 59
60static struct sh_clk_ops *sh7712_clk_ops[] = { 60static struct clk_ops *sh7712_clk_ops[] = {
61 &sh7712_master_clk_ops, 61 &sh7712_master_clk_ops,
62 &sh7712_module_clk_ops, 62 &sh7712_module_clk_ops,
63 &sh7712_cpu_clk_ops, 63 &sh7712_cpu_clk_ops,
64}; 64};
65 65
66void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 66void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
67{ 67{
68 if (idx < ARRAY_SIZE(sh7712_clk_ops)) 68 if (idx < ARRAY_SIZE(sh7712_clk_ops))
69 *ops = sh7712_clk_ops[idx]; 69 *ops = sh7712_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S
index 262db6ec067..f6a389c996c 100644
--- a/arch/sh/kernel/cpu/sh3/entry.S
+++ b/arch/sh/kernel/cpu/sh3/entry.S
@@ -2,7 +2,7 @@
2 * arch/sh/kernel/cpu/sh3/entry.S 2 * arch/sh/kernel/cpu/sh3/entry.S
3 * 3 *
4 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka 4 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka
5 * Copyright (C) 2003 - 2012 Paul Mundt 5 * Copyright (C) 2003 - 2006 Paul Mundt
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
@@ -17,7 +17,6 @@
17#include <cpu/mmu_context.h> 17#include <cpu/mmu_context.h>
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/cache.h> 19#include <asm/cache.h>
20#include <asm/thread_info.h>
21 20
22! NOTE: 21! NOTE:
23! GNU as (as of 2.9.1) changes bf/s into bt/s and bra, when the address 22! GNU as (as of 2.9.1) changes bf/s into bt/s and bra, when the address
@@ -115,22 +114,22 @@ ENTRY(tlb_miss_load)
115 .align 2 114 .align 2
116ENTRY(tlb_miss_store) 115ENTRY(tlb_miss_store)
117 bra call_handle_tlbmiss 116 bra call_handle_tlbmiss
118 mov #FAULT_CODE_WRITE, r5 117 mov #1, r5
119 118
120 .align 2 119 .align 2
121ENTRY(initial_page_write) 120ENTRY(initial_page_write)
122 bra call_handle_tlbmiss 121 bra call_handle_tlbmiss
123 mov #FAULT_CODE_INITIAL, r5 122 mov #2, r5
124 123
125 .align 2 124 .align 2
126ENTRY(tlb_protection_violation_load) 125ENTRY(tlb_protection_violation_load)
127 bra call_do_page_fault 126 bra call_do_page_fault
128 mov #FAULT_CODE_PROT, r5 127 mov #0, r5
129 128
130 .align 2 129 .align 2
131ENTRY(tlb_protection_violation_store) 130ENTRY(tlb_protection_violation_store)
132 bra call_do_page_fault 131 bra call_do_page_fault
133 mov #(FAULT_CODE_PROT | FAULT_CODE_WRITE), r5 132 mov #1, r5
134 133
135call_handle_tlbmiss: 134call_handle_tlbmiss:
136 mov.l 1f, r0 135 mov.l 1f, r0
diff --git a/arch/sh/kernel/cpu/sh3/serial-sh7720.c b/arch/sh/kernel/cpu/sh3/serial-sh7720.c
index c4a0336660d..8832c526cdf 100644
--- a/arch/sh/kernel/cpu/sh3/serial-sh7720.c
+++ b/arch/sh/kernel/cpu/sh3/serial-sh7720.c
@@ -2,7 +2,7 @@
2#include <linux/serial_core.h> 2#include <linux/serial_core.h>
3#include <linux/io.h> 3#include <linux/io.h>
4#include <cpu/serial.h> 4#include <cpu/serial.h>
5#include <cpu/gpio.h> 5#include <asm/gpio.h>
6 6
7static void sh7720_sci_init_pins(struct uart_port *port, unsigned int cflag) 7static void sh7720_sci_init_pins(struct uart_port *port, unsigned int cflag)
8{ 8{
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
index 03e4c96f2b1..2309618c015 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
@@ -14,7 +14,6 @@
14#include <linux/serial.h> 14#include <linux/serial.h>
15#include <linux/serial_sci.h> 15#include <linux/serial_sci.h>
16#include <linux/sh_timer.h> 16#include <linux/sh_timer.h>
17#include <linux/sh_intc.h>
18#include <asm/rtc.h> 17#include <asm/rtc.h>
19#include <cpu/serial.h> 18#include <cpu/serial.h>
20 19
@@ -76,7 +75,7 @@ static struct plat_sci_port scif0_platform_data = {
76 SCSCR_RE | SCSCR_CKE1 | SCSCR_CKE0, 75 SCSCR_RE | SCSCR_CKE1 | SCSCR_CKE0,
77 .scbrr_algo_id = SCBRR_ALGO_4, 76 .scbrr_algo_id = SCBRR_ALGO_4,
78 .type = PORT_SCIF, 77 .type = PORT_SCIF,
79 .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)), 78 .irqs = { 56, 56, 56 },
80 .ops = &sh770x_sci_port_ops, 79 .ops = &sh770x_sci_port_ops,
81 .regtype = SCIx_SH7705_SCIF_REGTYPE, 80 .regtype = SCIx_SH7705_SCIF_REGTYPE,
82}; 81};
@@ -95,7 +94,7 @@ static struct plat_sci_port scif1_platform_data = {
95 .scscr = SCSCR_TIE | SCSCR_RIE | SCSCR_TE | SCSCR_RE, 94 .scscr = SCSCR_TIE | SCSCR_RIE | SCSCR_TE | SCSCR_RE,
96 .scbrr_algo_id = SCBRR_ALGO_4, 95 .scbrr_algo_id = SCBRR_ALGO_4,
97 .type = PORT_SCIF, 96 .type = PORT_SCIF,
98 .irqs = SCIx_IRQ_MUXED(evt2irq(0x880)), 97 .irqs = { 52, 52, 52 },
99 .ops = &sh770x_sci_port_ops, 98 .ops = &sh770x_sci_port_ops,
100 .regtype = SCIx_SH7705_SCIF_REGTYPE, 99 .regtype = SCIx_SH7705_SCIF_REGTYPE,
101}; 100};
@@ -115,7 +114,7 @@ static struct resource rtc_resources[] = {
115 .flags = IORESOURCE_IO, 114 .flags = IORESOURCE_IO,
116 }, 115 },
117 [1] = { 116 [1] = {
118 .start = evt2irq(0x480), 117 .start = 20,
119 .flags = IORESOURCE_IRQ, 118 .flags = IORESOURCE_IRQ,
120 }, 119 },
121}; 120};
@@ -147,7 +146,7 @@ static struct resource tmu0_resources[] = {
147 .flags = IORESOURCE_MEM, 146 .flags = IORESOURCE_MEM,
148 }, 147 },
149 [1] = { 148 [1] = {
150 .start = evt2irq(0x400), 149 .start = 16,
151 .flags = IORESOURCE_IRQ, 150 .flags = IORESOURCE_IRQ,
152 }, 151 },
153}; 152};
@@ -175,7 +174,7 @@ static struct resource tmu1_resources[] = {
175 .flags = IORESOURCE_MEM, 174 .flags = IORESOURCE_MEM,
176 }, 175 },
177 [1] = { 176 [1] = {
178 .start = evt2irq(0x420), 177 .start = 17,
179 .flags = IORESOURCE_IRQ, 178 .flags = IORESOURCE_IRQ,
180 }, 179 },
181}; 180};
@@ -202,7 +201,7 @@ static struct resource tmu2_resources[] = {
202 .flags = IORESOURCE_MEM, 201 .flags = IORESOURCE_MEM,
203 }, 202 },
204 [1] = { 203 [1] = {
205 .start = evt2irq(0x440), 204 .start = 18,
206 .flags = IORESOURCE_IRQ, 205 .flags = IORESOURCE_IRQ,
207 }, 206 },
208}; 207};
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
index ba26cd9ce69..3f3d5fe5892 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
@@ -19,7 +19,6 @@
19#include <linux/serial.h> 19#include <linux/serial.h>
20#include <linux/serial_sci.h> 20#include <linux/serial_sci.h>
21#include <linux/sh_timer.h> 21#include <linux/sh_timer.h>
22#include <linux/sh_intc.h>
23#include <cpu/serial.h> 22#include <cpu/serial.h>
24 23
25enum { 24enum {
@@ -96,7 +95,7 @@ static struct resource rtc_resources[] = {
96 .flags = IORESOURCE_IO, 95 .flags = IORESOURCE_IO,
97 }, 96 },
98 [1] = { 97 [1] = {
99 .start = evt2irq(0x480), 98 .start = 20,
100 .flags = IORESOURCE_IRQ, 99 .flags = IORESOURCE_IRQ,
101 }, 100 },
102}; 101};
@@ -115,7 +114,7 @@ static struct plat_sci_port scif0_platform_data = {
115 .scscr = SCSCR_TE | SCSCR_RE, 114 .scscr = SCSCR_TE | SCSCR_RE,
116 .scbrr_algo_id = SCBRR_ALGO_2, 115 .scbrr_algo_id = SCBRR_ALGO_2,
117 .type = PORT_SCI, 116 .type = PORT_SCI,
118 .irqs = SCIx_IRQ_MUXED(evt2irq(0x4e0)), 117 .irqs = { 23, 23, 23, 0 },
119 .ops = &sh770x_sci_port_ops, 118 .ops = &sh770x_sci_port_ops,
120 .regshift = 1, 119 .regshift = 1,
121}; 120};
@@ -136,7 +135,7 @@ static struct plat_sci_port scif1_platform_data = {
136 .scscr = SCSCR_TE | SCSCR_RE, 135 .scscr = SCSCR_TE | SCSCR_RE,
137 .scbrr_algo_id = SCBRR_ALGO_2, 136 .scbrr_algo_id = SCBRR_ALGO_2,
138 .type = PORT_SCIF, 137 .type = PORT_SCIF,
139 .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)), 138 .irqs = { 56, 56, 56, 56 },
140 .ops = &sh770x_sci_port_ops, 139 .ops = &sh770x_sci_port_ops,
141 .regtype = SCIx_SH3_SCIF_REGTYPE, 140 .regtype = SCIx_SH3_SCIF_REGTYPE,
142}; 141};
@@ -158,7 +157,7 @@ static struct plat_sci_port scif2_platform_data = {
158 .scscr = SCSCR_TE | SCSCR_RE, 157 .scscr = SCSCR_TE | SCSCR_RE,
159 .scbrr_algo_id = SCBRR_ALGO_2, 158 .scbrr_algo_id = SCBRR_ALGO_2,
160 .type = PORT_IRDA, 159 .type = PORT_IRDA,
161 .irqs = SCIx_IRQ_MUXED(evt2irq(0x880)), 160 .irqs = { 52, 52, 52, 52 },
162 .ops = &sh770x_sci_port_ops, 161 .ops = &sh770x_sci_port_ops,
163 .regshift = 1, 162 .regshift = 1,
164}; 163};
@@ -185,7 +184,7 @@ static struct resource tmu0_resources[] = {
185 .flags = IORESOURCE_MEM, 184 .flags = IORESOURCE_MEM,
186 }, 185 },
187 [1] = { 186 [1] = {
188 .start = evt2irq(0x400), 187 .start = 16,
189 .flags = IORESOURCE_IRQ, 188 .flags = IORESOURCE_IRQ,
190 }, 189 },
191}; 190};
@@ -213,7 +212,7 @@ static struct resource tmu1_resources[] = {
213 .flags = IORESOURCE_MEM, 212 .flags = IORESOURCE_MEM,
214 }, 213 },
215 [1] = { 214 [1] = {
216 .start = evt2irq(0x420), 215 .start = 17,
217 .flags = IORESOURCE_IRQ, 216 .flags = IORESOURCE_IRQ,
218 }, 217 },
219}; 218};
@@ -240,7 +239,7 @@ static struct resource tmu2_resources[] = {
240 .flags = IORESOURCE_MEM, 239 .flags = IORESOURCE_MEM,
241 }, 240 },
242 [1] = { 241 [1] = {
243 .start = evt2irq(0x440), 242 .start = 18,
244 .flags = IORESOURCE_IRQ, 243 .flags = IORESOURCE_IRQ,
245 }, 244 },
246}; 245};
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
index 93c9c5e24a7..78f6b01d42c 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
@@ -14,7 +14,6 @@
14#include <linux/serial.h> 14#include <linux/serial.h>
15#include <linux/serial_sci.h> 15#include <linux/serial_sci.h>
16#include <linux/sh_timer.h> 16#include <linux/sh_timer.h>
17#include <linux/sh_intc.h>
18#include <asm/rtc.h> 17#include <asm/rtc.h>
19 18
20enum { 19enum {
@@ -78,7 +77,7 @@ static struct resource rtc_resources[] = {
78 .flags = IORESOURCE_IO, 77 .flags = IORESOURCE_IO,
79 }, 78 },
80 [1] = { 79 [1] = {
81 .start = evt2irq(0x480), 80 .start = 20,
82 .flags = IORESOURCE_IRQ, 81 .flags = IORESOURCE_IRQ,
83 }, 82 },
84}; 83};
@@ -104,7 +103,7 @@ static struct plat_sci_port scif0_platform_data = {
104 SCSCR_CKE1 | SCSCR_CKE0, 103 SCSCR_CKE1 | SCSCR_CKE0,
105 .scbrr_algo_id = SCBRR_ALGO_2, 104 .scbrr_algo_id = SCBRR_ALGO_2,
106 .type = PORT_SCIF, 105 .type = PORT_SCIF,
107 .irqs = SCIx_IRQ_MUXED(evt2irq(0x880)), 106 .irqs = { 52, 52, 52, 52 },
108}; 107};
109 108
110static struct platform_device scif0_device = { 109static struct platform_device scif0_device = {
@@ -122,7 +121,7 @@ static struct plat_sci_port scif1_platform_data = {
122 SCSCR_CKE1 | SCSCR_CKE0, 121 SCSCR_CKE1 | SCSCR_CKE0,
123 .scbrr_algo_id = SCBRR_ALGO_2, 122 .scbrr_algo_id = SCBRR_ALGO_2,
124 .type = PORT_SCIF, 123 .type = PORT_SCIF,
125 .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)), 124 .irqs = { 56, 56, 56, 56 },
126}; 125};
127 126
128static struct platform_device scif1_device = { 127static struct platform_device scif1_device = {
@@ -146,7 +145,7 @@ static struct resource tmu0_resources[] = {
146 .flags = IORESOURCE_MEM, 145 .flags = IORESOURCE_MEM,
147 }, 146 },
148 [1] = { 147 [1] = {
149 .start = evt2irq(0x400), 148 .start = 16,
150 .flags = IORESOURCE_IRQ, 149 .flags = IORESOURCE_IRQ,
151 }, 150 },
152}; 151};
@@ -174,7 +173,7 @@ static struct resource tmu1_resources[] = {
174 .flags = IORESOURCE_MEM, 173 .flags = IORESOURCE_MEM,
175 }, 174 },
176 [1] = { 175 [1] = {
177 .start = evt2irq(0x420), 176 .start = 17,
178 .flags = IORESOURCE_IRQ, 177 .flags = IORESOURCE_IRQ,
179 }, 178 },
180}; 179};
@@ -201,7 +200,7 @@ static struct resource tmu2_resources[] = {
201 .flags = IORESOURCE_MEM, 200 .flags = IORESOURCE_MEM,
202 }, 201 },
203 [1] = { 202 [1] = {
204 .start = evt2irq(0x440), 203 .start = 18,
205 .flags = IORESOURCE_IRQ, 204 .flags = IORESOURCE_IRQ,
206 }, 205 },
207}; 206};
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c
index 42d991f632b..94920345c14 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c
@@ -19,8 +19,6 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/serial_sci.h> 20#include <linux/serial_sci.h>
21#include <linux/sh_timer.h> 21#include <linux/sh_timer.h>
22#include <linux/sh_intc.h>
23#include <linux/usb/ohci_pdriver.h>
24#include <asm/rtc.h> 22#include <asm/rtc.h>
25#include <cpu/serial.h> 23#include <cpu/serial.h>
26 24
@@ -32,7 +30,7 @@ static struct resource rtc_resources[] = {
32 }, 30 },
33 [1] = { 31 [1] = {
34 /* Shared Period/Carry/Alarm IRQ */ 32 /* Shared Period/Carry/Alarm IRQ */
35 .start = evt2irq(0x480), 33 .start = 20,
36 .flags = IORESOURCE_IRQ, 34 .flags = IORESOURCE_IRQ,
37 }, 35 },
38}; 36};
@@ -57,7 +55,7 @@ static struct plat_sci_port scif0_platform_data = {
57 .scscr = SCSCR_RE | SCSCR_TE, 55 .scscr = SCSCR_RE | SCSCR_TE,
58 .scbrr_algo_id = SCBRR_ALGO_4, 56 .scbrr_algo_id = SCBRR_ALGO_4,
59 .type = PORT_SCIF, 57 .type = PORT_SCIF,
60 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)), 58 .irqs = { 80, 80, 80, 80 },
61 .ops = &sh7720_sci_port_ops, 59 .ops = &sh7720_sci_port_ops,
62 .regtype = SCIx_SH7705_SCIF_REGTYPE, 60 .regtype = SCIx_SH7705_SCIF_REGTYPE,
63}; 61};
@@ -76,7 +74,7 @@ static struct plat_sci_port scif1_platform_data = {
76 .scscr = SCSCR_RE | SCSCR_TE, 74 .scscr = SCSCR_RE | SCSCR_TE,
77 .scbrr_algo_id = SCBRR_ALGO_4, 75 .scbrr_algo_id = SCBRR_ALGO_4,
78 .type = PORT_SCIF, 76 .type = PORT_SCIF,
79 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)), 77 .irqs = { 81, 81, 81, 81 },
80 .ops = &sh7720_sci_port_ops, 78 .ops = &sh7720_sci_port_ops,
81 .regtype = SCIx_SH7705_SCIF_REGTYPE, 79 .regtype = SCIx_SH7705_SCIF_REGTYPE,
82}; 80};
@@ -96,23 +94,19 @@ static struct resource usb_ohci_resources[] = {
96 .flags = IORESOURCE_MEM, 94 .flags = IORESOURCE_MEM,
97 }, 95 },
98 [1] = { 96 [1] = {
99 .start = evt2irq(0xa60), 97 .start = 67,
100 .end = evt2irq(0xa60), 98 .end = 67,
101 .flags = IORESOURCE_IRQ, 99 .flags = IORESOURCE_IRQ,
102 }, 100 },
103}; 101};
104 102
105static u64 usb_ohci_dma_mask = 0xffffffffUL; 103static u64 usb_ohci_dma_mask = 0xffffffffUL;
106
107static struct usb_ohci_pdata usb_ohci_pdata;
108
109static struct platform_device usb_ohci_device = { 104static struct platform_device usb_ohci_device = {
110 .name = "ohci-platform", 105 .name = "sh_ohci",
111 .id = -1, 106 .id = -1,
112 .dev = { 107 .dev = {
113 .dma_mask = &usb_ohci_dma_mask, 108 .dma_mask = &usb_ohci_dma_mask,
114 .coherent_dma_mask = 0xffffffff, 109 .coherent_dma_mask = 0xffffffff,
115 .platform_data = &usb_ohci_pdata,
116 }, 110 },
117 .num_resources = ARRAY_SIZE(usb_ohci_resources), 111 .num_resources = ARRAY_SIZE(usb_ohci_resources),
118 .resource = usb_ohci_resources, 112 .resource = usb_ohci_resources,
@@ -127,8 +121,8 @@ static struct resource usbf_resources[] = {
127 }, 121 },
128 [1] = { 122 [1] = {
129 .name = "sh_udc", 123 .name = "sh_udc",
130 .start = evt2irq(0xa20), 124 .start = 65,
131 .end = evt2irq(0xa20), 125 .end = 65,
132 .flags = IORESOURCE_IRQ, 126 .flags = IORESOURCE_IRQ,
133 }, 127 },
134}; 128};
@@ -158,7 +152,7 @@ static struct resource cmt0_resources[] = {
158 .flags = IORESOURCE_MEM, 152 .flags = IORESOURCE_MEM,
159 }, 153 },
160 [1] = { 154 [1] = {
161 .start = evt2irq(0xf00), 155 .start = 104,
162 .flags = IORESOURCE_IRQ, 156 .flags = IORESOURCE_IRQ,
163 }, 157 },
164}; 158};
@@ -185,7 +179,7 @@ static struct resource cmt1_resources[] = {
185 .flags = IORESOURCE_MEM, 179 .flags = IORESOURCE_MEM,
186 }, 180 },
187 [1] = { 181 [1] = {
188 .start = evt2irq(0xf00), 182 .start = 104,
189 .flags = IORESOURCE_IRQ, 183 .flags = IORESOURCE_IRQ,
190 }, 184 },
191}; 185};
@@ -212,7 +206,7 @@ static struct resource cmt2_resources[] = {
212 .flags = IORESOURCE_MEM, 206 .flags = IORESOURCE_MEM,
213 }, 207 },
214 [1] = { 208 [1] = {
215 .start = evt2irq(0xf00), 209 .start = 104,
216 .flags = IORESOURCE_IRQ, 210 .flags = IORESOURCE_IRQ,
217 }, 211 },
218}; 212};
@@ -239,7 +233,7 @@ static struct resource cmt3_resources[] = {
239 .flags = IORESOURCE_MEM, 233 .flags = IORESOURCE_MEM,
240 }, 234 },
241 [1] = { 235 [1] = {
242 .start = evt2irq(0xf00), 236 .start = 104,
243 .flags = IORESOURCE_IRQ, 237 .flags = IORESOURCE_IRQ,
244 }, 238 },
245}; 239};
@@ -266,7 +260,7 @@ static struct resource cmt4_resources[] = {
266 .flags = IORESOURCE_MEM, 260 .flags = IORESOURCE_MEM,
267 }, 261 },
268 [1] = { 262 [1] = {
269 .start = evt2irq(0xf00), 263 .start = 104,
270 .flags = IORESOURCE_IRQ, 264 .flags = IORESOURCE_IRQ,
271 }, 265 },
272}; 266};
@@ -294,7 +288,7 @@ static struct resource tmu0_resources[] = {
294 .flags = IORESOURCE_MEM, 288 .flags = IORESOURCE_MEM,
295 }, 289 },
296 [1] = { 290 [1] = {
297 .start = evt2irq(0x400), 291 .start = 16,
298 .flags = IORESOURCE_IRQ, 292 .flags = IORESOURCE_IRQ,
299 }, 293 },
300}; 294};
@@ -322,7 +316,7 @@ static struct resource tmu1_resources[] = {
322 .flags = IORESOURCE_MEM, 316 .flags = IORESOURCE_MEM,
323 }, 317 },
324 [1] = { 318 [1] = {
325 .start = evt2irq(0x420), 319 .start = 17,
326 .flags = IORESOURCE_IRQ, 320 .flags = IORESOURCE_IRQ,
327 }, 321 },
328}; 322};
@@ -349,7 +343,7 @@ static struct resource tmu2_resources[] = {
349 .flags = IORESOURCE_MEM, 343 .flags = IORESOURCE_MEM,
350 }, 344 },
351 [1] = { 345 [1] = {
352 .start = evt2irq(0x440), 346 .start = 18,
353 .flags = IORESOURCE_IRQ, 347 .flags = IORESOURCE_IRQ,
354 }, 348 },
355}; 349};
diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
index 4b5bab5f875..f4e262adb39 100644
--- a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
+++ b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
@@ -41,7 +41,7 @@ static inline int frqcr3_lookup(struct clk *clk, unsigned long rate)
41 return 5; 41 return 5;
42} 42}
43 43
44static struct sh_clk_ops sh4202_emi_clk_ops = { 44static struct clk_ops sh4202_emi_clk_ops = {
45 .recalc = emi_clk_recalc, 45 .recalc = emi_clk_recalc,
46}; 46};
47 47
@@ -56,7 +56,7 @@ static unsigned long femi_clk_recalc(struct clk *clk)
56 return clk->parent->rate / frqcr3_divisors[idx]; 56 return clk->parent->rate / frqcr3_divisors[idx];
57} 57}
58 58
59static struct sh_clk_ops sh4202_femi_clk_ops = { 59static struct clk_ops sh4202_femi_clk_ops = {
60 .recalc = femi_clk_recalc, 60 .recalc = femi_clk_recalc,
61}; 61};
62 62
@@ -130,7 +130,7 @@ static int shoc_clk_set_rate(struct clk *clk, unsigned long rate)
130 return 0; 130 return 0;
131} 131}
132 132
133static struct sh_clk_ops sh4202_shoc_clk_ops = { 133static struct clk_ops sh4202_shoc_clk_ops = {
134 .init = shoc_clk_init, 134 .init = shoc_clk_init,
135 .recalc = shoc_clk_recalc, 135 .recalc = shoc_clk_recalc,
136 .set_rate = shoc_clk_set_rate, 136 .set_rate = shoc_clk_set_rate,
diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4.c b/arch/sh/kernel/cpu/sh4/clock-sh4.c
index 99e5ec8b483..5add75c1f53 100644
--- a/arch/sh/kernel/cpu/sh4/clock-sh4.c
+++ b/arch/sh/kernel/cpu/sh4/clock-sh4.c
@@ -31,7 +31,7 @@ static void master_clk_init(struct clk *clk)
31 clk->rate *= pfc_divisors[__raw_readw(FRQCR) & 0x0007]; 31 clk->rate *= pfc_divisors[__raw_readw(FRQCR) & 0x0007];
32} 32}
33 33
34static struct sh_clk_ops sh4_master_clk_ops = { 34static struct clk_ops sh4_master_clk_ops = {
35 .init = master_clk_init, 35 .init = master_clk_init,
36}; 36};
37 37
@@ -41,7 +41,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
41 return clk->parent->rate / pfc_divisors[idx]; 41 return clk->parent->rate / pfc_divisors[idx];
42} 42}
43 43
44static struct sh_clk_ops sh4_module_clk_ops = { 44static struct clk_ops sh4_module_clk_ops = {
45 .recalc = module_clk_recalc, 45 .recalc = module_clk_recalc,
46}; 46};
47 47
@@ -51,7 +51,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
51 return clk->parent->rate / bfc_divisors[idx]; 51 return clk->parent->rate / bfc_divisors[idx];
52} 52}
53 53
54static struct sh_clk_ops sh4_bus_clk_ops = { 54static struct clk_ops sh4_bus_clk_ops = {
55 .recalc = bus_clk_recalc, 55 .recalc = bus_clk_recalc,
56}; 56};
57 57
@@ -61,18 +61,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
61 return clk->parent->rate / ifc_divisors[idx]; 61 return clk->parent->rate / ifc_divisors[idx];
62} 62}
63 63
64static struct sh_clk_ops sh4_cpu_clk_ops = { 64static struct clk_ops sh4_cpu_clk_ops = {
65 .recalc = cpu_clk_recalc, 65 .recalc = cpu_clk_recalc,
66}; 66};
67 67
68static struct sh_clk_ops *sh4_clk_ops[] = { 68static struct clk_ops *sh4_clk_ops[] = {
69 &sh4_master_clk_ops, 69 &sh4_master_clk_ops,
70 &sh4_module_clk_ops, 70 &sh4_module_clk_ops,
71 &sh4_bus_clk_ops, 71 &sh4_bus_clk_ops,
72 &sh4_cpu_clk_ops, 72 &sh4_cpu_clk_ops,
73}; 73};
74 74
75void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 75void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
76{ 76{
77 if (idx < ARRAY_SIZE(sh4_clk_ops)) 77 if (idx < ARRAY_SIZE(sh4_clk_ops))
78 *ops = sh4_clk_ops[idx]; 78 *ops = sh4_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c
index 69ab4d3c8d4..447482d7f65 100644
--- a/arch/sh/kernel/cpu/sh4/fpu.c
+++ b/arch/sh/kernel/cpu/sh4/fpu.c
@@ -15,8 +15,8 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <cpu/fpu.h> 16#include <cpu/fpu.h>
17#include <asm/processor.h> 17#include <asm/processor.h>
18#include <asm/system.h>
18#include <asm/fpu.h> 19#include <asm/fpu.h>
19#include <asm/traps.h>
20 20
21/* The PR (precision) bit in the FP Status Register must be clear when 21/* The PR (precision) bit in the FP Status Register must be clear when
22 * an frchg instruction is executed, otherwise the instruction is undefined. 22 * an frchg instruction is executed, otherwise the instruction is undefined.
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c
index 0fbbd50bc8a..971cf0fce4f 100644
--- a/arch/sh/kernel/cpu/sh4/probe.c
+++ b/arch/sh/kernel/cpu/sh4/probe.c
@@ -158,9 +158,6 @@ void __cpuinit cpu_probe(void)
158 case 0x40: /* yon-ten-go */ 158 case 0x40: /* yon-ten-go */
159 boot_cpu_data.type = CPU_SH7372; 159 boot_cpu_data.type = CPU_SH7372;
160 break; 160 break;
161 case 0xE0: /* 0x4E0 */
162 boot_cpu_data.type = CPU_SH7734; /* SH7733/SH7734 */
163 break;
164 161
165 } 162 }
166 break; 163 break;
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
index 2a5320aa73b..5b2833159b7 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
@@ -13,7 +13,6 @@
13#include <linux/serial.h> 13#include <linux/serial.h>
14#include <linux/serial_sci.h> 14#include <linux/serial_sci.h>
15#include <linux/sh_timer.h> 15#include <linux/sh_timer.h>
16#include <linux/sh_intc.h>
17#include <linux/io.h> 16#include <linux/io.h>
18 17
19static struct plat_sci_port scif0_platform_data = { 18static struct plat_sci_port scif0_platform_data = {
@@ -22,10 +21,7 @@ static struct plat_sci_port scif0_platform_data = {
22 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 21 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
23 .scbrr_algo_id = SCBRR_ALGO_2, 22 .scbrr_algo_id = SCBRR_ALGO_2,
24 .type = PORT_SCIF, 23 .type = PORT_SCIF,
25 .irqs = { evt2irq(0x700), 24 .irqs = { 40, 41, 43, 42 },
26 evt2irq(0x720),
27 evt2irq(0x760),
28 evt2irq(0x740) },
29}; 25};
30 26
31static struct platform_device scif0_device = { 27static struct platform_device scif0_device = {
@@ -49,7 +45,7 @@ static struct resource tmu0_resources[] = {
49 .flags = IORESOURCE_MEM, 45 .flags = IORESOURCE_MEM,
50 }, 46 },
51 [1] = { 47 [1] = {
52 .start = evt2irq(0x400), 48 .start = 16,
53 .flags = IORESOURCE_IRQ, 49 .flags = IORESOURCE_IRQ,
54 }, 50 },
55}; 51};
@@ -77,7 +73,7 @@ static struct resource tmu1_resources[] = {
77 .flags = IORESOURCE_MEM, 73 .flags = IORESOURCE_MEM,
78 }, 74 },
79 [1] = { 75 [1] = {
80 .start = evt2irq(0x420), 76 .start = 17,
81 .flags = IORESOURCE_IRQ, 77 .flags = IORESOURCE_IRQ,
82 }, 78 },
83}; 79};
@@ -104,7 +100,7 @@ static struct resource tmu2_resources[] = {
104 .flags = IORESOURCE_MEM, 100 .flags = IORESOURCE_MEM,
105 }, 101 },
106 [1] = { 102 [1] = {
107 .start = evt2irq(0x440), 103 .start = 18,
108 .flags = IORESOURCE_IRQ, 104 .flags = IORESOURCE_IRQ,
109 }, 105 },
110}; 106};
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
index 04a45512596..98cc0c794c7 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
@@ -13,7 +13,6 @@
13#include <linux/serial.h> 13#include <linux/serial.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/sh_timer.h> 15#include <linux/sh_timer.h>
16#include <linux/sh_intc.h>
17#include <linux/serial_sci.h> 16#include <linux/serial_sci.h>
18#include <generated/machtypes.h> 17#include <generated/machtypes.h>
19 18
@@ -25,7 +24,7 @@ static struct resource rtc_resources[] = {
25 }, 24 },
26 [1] = { 25 [1] = {
27 /* Shared Period/Carry/Alarm IRQ */ 26 /* Shared Period/Carry/Alarm IRQ */
28 .start = evt2irq(0x480), 27 .start = 20,
29 .flags = IORESOURCE_IRQ, 28 .flags = IORESOURCE_IRQ,
30 }, 29 },
31}; 30};
@@ -44,7 +43,7 @@ static struct plat_sci_port sci_platform_data = {
44 .scscr = SCSCR_TE | SCSCR_RE, 43 .scscr = SCSCR_TE | SCSCR_RE,
45 .scbrr_algo_id = SCBRR_ALGO_2, 44 .scbrr_algo_id = SCBRR_ALGO_2,
46 .type = PORT_SCI, 45 .type = PORT_SCI,
47 .irqs = SCIx_IRQ_MUXED(evt2irq(0x4e0)), 46 .irqs = { 23, 23, 23, 0 },
48 .regshift = 2, 47 .regshift = 2,
49}; 48};
50 49
@@ -62,7 +61,7 @@ static struct plat_sci_port scif_platform_data = {
62 .scscr = SCSCR_TE | SCSCR_RE | SCSCR_REIE, 61 .scscr = SCSCR_TE | SCSCR_RE | SCSCR_REIE,
63 .scbrr_algo_id = SCBRR_ALGO_2, 62 .scbrr_algo_id = SCBRR_ALGO_2,
64 .type = PORT_SCIF, 63 .type = PORT_SCIF,
65 .irqs = SCIx_IRQ_MUXED(evt2irq(0x700)), 64 .irqs = { 40, 40, 40, 40 },
66}; 65};
67 66
68static struct platform_device scif_device = { 67static struct platform_device scif_device = {
@@ -86,7 +85,7 @@ static struct resource tmu0_resources[] = {
86 .flags = IORESOURCE_MEM, 85 .flags = IORESOURCE_MEM,
87 }, 86 },
88 [1] = { 87 [1] = {
89 .start = evt2irq(0x400), 88 .start = 16,
90 .flags = IORESOURCE_IRQ, 89 .flags = IORESOURCE_IRQ,
91 }, 90 },
92}; 91};
@@ -114,7 +113,7 @@ static struct resource tmu1_resources[] = {
114 .flags = IORESOURCE_MEM, 113 .flags = IORESOURCE_MEM,
115 }, 114 },
116 [1] = { 115 [1] = {
117 .start = evt2irq(0x420), 116 .start = 17,
118 .flags = IORESOURCE_IRQ, 117 .flags = IORESOURCE_IRQ,
119 }, 118 },
120}; 119};
@@ -141,7 +140,7 @@ static struct resource tmu2_resources[] = {
141 .flags = IORESOURCE_MEM, 140 .flags = IORESOURCE_MEM,
142 }, 141 },
143 [1] = { 142 [1] = {
144 .start = evt2irq(0x440), 143 .start = 18,
145 .flags = IORESOURCE_IRQ, 144 .flags = IORESOURCE_IRQ,
146 }, 145 },
147}; 146};
@@ -173,7 +172,7 @@ static struct resource tmu3_resources[] = {
173 .flags = IORESOURCE_MEM, 172 .flags = IORESOURCE_MEM,
174 }, 173 },
175 [1] = { 174 [1] = {
176 .start = evt2irq(0xb00), 175 .start = 72,
177 .flags = IORESOURCE_IRQ, 176 .flags = IORESOURCE_IRQ,
178 }, 177 },
179}; 178};
@@ -200,7 +199,7 @@ static struct resource tmu4_resources[] = {
200 .flags = IORESOURCE_MEM, 199 .flags = IORESOURCE_MEM,
201 }, 200 },
202 [1] = { 201 [1] = {
203 .start = evt2irq(0xb80), 202 .start = 76,
204 .flags = IORESOURCE_IRQ, 203 .flags = IORESOURCE_IRQ,
205 }, 204 },
206}; 205};
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7760.c b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
index 98e075ada44..c0b4c774700 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7760.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
@@ -11,7 +11,6 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/serial.h> 12#include <linux/serial.h>
13#include <linux/sh_timer.h> 13#include <linux/sh_timer.h>
14#include <linux/sh_intc.h>
15#include <linux/serial_sci.h> 14#include <linux/serial_sci.h>
16#include <linux/io.h> 15#include <linux/io.h>
17 16
@@ -133,10 +132,7 @@ static struct plat_sci_port scif0_platform_data = {
133 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 132 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
134 .scbrr_algo_id = SCBRR_ALGO_2, 133 .scbrr_algo_id = SCBRR_ALGO_2,
135 .type = PORT_SCIF, 134 .type = PORT_SCIF,
136 .irqs = { evt2irq(0x880), 135 .irqs = { 52, 53, 55, 54 },
137 evt2irq(0x8a0),
138 evt2irq(0x8e0),
139 evt2irq(0x8c0) },
140 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 136 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
141}; 137};
142 138
@@ -154,10 +150,7 @@ static struct plat_sci_port scif1_platform_data = {
154 .type = PORT_SCIF, 150 .type = PORT_SCIF,
155 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 151 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
156 .scbrr_algo_id = SCBRR_ALGO_2, 152 .scbrr_algo_id = SCBRR_ALGO_2,
157 .irqs = { evt2irq(0xb00), 153 .irqs = { 72, 73, 75, 74 },
158 evt2irq(0xb20),
159 evt2irq(0xb60),
160 evt2irq(0xb40) },
161 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 154 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
162}; 155};
163 156
@@ -175,10 +168,7 @@ static struct plat_sci_port scif2_platform_data = {
175 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 168 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
176 .scbrr_algo_id = SCBRR_ALGO_2, 169 .scbrr_algo_id = SCBRR_ALGO_2,
177 .type = PORT_SCIF, 170 .type = PORT_SCIF,
178 .irqs = { evt2irq(0xb80), 171 .irqs = { 76, 77, 79, 78 },
179 evt2irq(0xba0),
180 evt2irq(0xbe0),
181 evt2irq(0xbc0) },
182 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 172 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
183}; 173};
184 174
@@ -196,9 +186,7 @@ static struct plat_sci_port scif3_platform_data = {
196 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 186 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
197 .scbrr_algo_id = SCBRR_ALGO_2, 187 .scbrr_algo_id = SCBRR_ALGO_2,
198 .type = PORT_SCI, 188 .type = PORT_SCI,
199 .irqs = { evt2irq(0xc00), 189 .irqs = { 80, 81, 82, 0 },
200 evt2irq(0xc20),
201 evt2irq(0xc40), },
202 .regshift = 2, 190 .regshift = 2,
203}; 191};
204 192
@@ -223,7 +211,7 @@ static struct resource tmu0_resources[] = {
223 .flags = IORESOURCE_MEM, 211 .flags = IORESOURCE_MEM,
224 }, 212 },
225 [1] = { 213 [1] = {
226 .start = evt2irq(0x400), 214 .start = 16,
227 .flags = IORESOURCE_IRQ, 215 .flags = IORESOURCE_IRQ,
228 }, 216 },
229}; 217};
@@ -251,7 +239,7 @@ static struct resource tmu1_resources[] = {
251 .flags = IORESOURCE_MEM, 239 .flags = IORESOURCE_MEM,
252 }, 240 },
253 [1] = { 241 [1] = {
254 .start = evt2irq(0x420), 242 .start = 17,
255 .flags = IORESOURCE_IRQ, 243 .flags = IORESOURCE_IRQ,
256 }, 244 },
257}; 245};
@@ -278,7 +266,7 @@ static struct resource tmu2_resources[] = {
278 .flags = IORESOURCE_MEM, 266 .flags = IORESOURCE_MEM,
279 }, 267 },
280 [1] = { 268 [1] = {
281 .start = evt2irq(0x440), 269 .start = 18,
282 .flags = IORESOURCE_IRQ, 270 .flags = IORESOURCE_IRQ,
283 }, 271 },
284}; 272};
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index 0a47bd3e7be..f0907995b4c 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -13,7 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/cpu.h> 14#include <linux/cpu.h>
15#include <linux/bitmap.h> 15#include <linux/bitmap.h>
16#include <linux/device.h> 16#include <linux/sysdev.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
@@ -337,9 +337,9 @@ static struct kobj_type ktype_percpu_entry = {
337 .default_attrs = sq_sysfs_attrs, 337 .default_attrs = sq_sysfs_attrs,
338}; 338};
339 339
340static int sq_dev_add(struct device *dev, struct subsys_interface *sif) 340static int __devinit sq_sysdev_add(struct sys_device *sysdev)
341{ 341{
342 unsigned int cpu = dev->id; 342 unsigned int cpu = sysdev->id;
343 struct kobject *kobj; 343 struct kobject *kobj;
344 int error; 344 int error;
345 345
@@ -348,27 +348,25 @@ static int sq_dev_add(struct device *dev, struct subsys_interface *sif)
348 return -ENOMEM; 348 return -ENOMEM;
349 349
350 kobj = sq_kobject[cpu]; 350 kobj = sq_kobject[cpu];
351 error = kobject_init_and_add(kobj, &ktype_percpu_entry, &dev->kobj, 351 error = kobject_init_and_add(kobj, &ktype_percpu_entry, &sysdev->kobj,
352 "%s", "sq"); 352 "%s", "sq");
353 if (!error) 353 if (!error)
354 kobject_uevent(kobj, KOBJ_ADD); 354 kobject_uevent(kobj, KOBJ_ADD);
355 return error; 355 return error;
356} 356}
357 357
358static int sq_dev_remove(struct device *dev, struct subsys_interface *sif) 358static int __devexit sq_sysdev_remove(struct sys_device *sysdev)
359{ 359{
360 unsigned int cpu = dev->id; 360 unsigned int cpu = sysdev->id;
361 struct kobject *kobj = sq_kobject[cpu]; 361 struct kobject *kobj = sq_kobject[cpu];
362 362
363 kobject_put(kobj); 363 kobject_put(kobj);
364 return 0; 364 return 0;
365} 365}
366 366
367static struct subsys_interface sq_interface = { 367static struct sysdev_driver sq_sysdev_driver = {
368 .name = "sq", 368 .add = sq_sysdev_add,
369 .subsys = &cpu_subsys, 369 .remove = __devexit_p(sq_sysdev_remove),
370 .add_dev = sq_dev_add,
371 .remove_dev = sq_dev_remove,
372}; 370};
373 371
374static int __init sq_api_init(void) 372static int __init sq_api_init(void)
@@ -388,7 +386,7 @@ static int __init sq_api_init(void)
388 if (unlikely(!sq_bitmap)) 386 if (unlikely(!sq_bitmap))
389 goto out; 387 goto out;
390 388
391 ret = subsys_interface_register(&sq_interface); 389 ret = sysdev_driver_register(&cpu_sysdev_class, &sq_sysdev_driver);
392 if (unlikely(ret != 0)) 390 if (unlikely(ret != 0))
393 goto out; 391 goto out;
394 392
@@ -403,7 +401,7 @@ out:
403 401
404static void __exit sq_api_exit(void) 402static void __exit sq_api_exit(void)
405{ 403{
406 subsys_interface_unregister(&sq_interface); 404 sysdev_driver_unregister(&cpu_sysdev_class, &sq_sysdev_driver);
407 kfree(sq_bitmap); 405 kfree(sq_bitmap);
408 kmem_cache_destroy(sq_cache); 406 kmem_cache_destroy(sq_cache);
409} 407}
diff --git a/arch/sh/kernel/cpu/sh4a/Makefile b/arch/sh/kernel/cpu/sh4a/Makefile
index 8fc6ec2be2f..c57fb287011 100644
--- a/arch/sh/kernel/cpu/sh4a/Makefile
+++ b/arch/sh/kernel/cpu/sh4a/Makefile
@@ -13,7 +13,6 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7343) += setup-sh7343.o
13obj-$(CONFIG_CPU_SUBTYPE_SH7722) += setup-sh7722.o serial-sh7722.o 13obj-$(CONFIG_CPU_SUBTYPE_SH7722) += setup-sh7722.o serial-sh7722.o
14obj-$(CONFIG_CPU_SUBTYPE_SH7723) += setup-sh7723.o 14obj-$(CONFIG_CPU_SUBTYPE_SH7723) += setup-sh7723.o
15obj-$(CONFIG_CPU_SUBTYPE_SH7724) += setup-sh7724.o 15obj-$(CONFIG_CPU_SUBTYPE_SH7724) += setup-sh7724.o
16obj-$(CONFIG_CPU_SUBTYPE_SH7734) += setup-sh7734.o
17obj-$(CONFIG_CPU_SUBTYPE_SH7366) += setup-sh7366.o 16obj-$(CONFIG_CPU_SUBTYPE_SH7366) += setup-sh7366.o
18obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o intc-shx3.o 17obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o intc-shx3.o
19 18
@@ -28,10 +27,9 @@ clock-$(CONFIG_CPU_SUBTYPE_SH7780) := clock-sh7780.o
28clock-$(CONFIG_CPU_SUBTYPE_SH7785) := clock-sh7785.o 27clock-$(CONFIG_CPU_SUBTYPE_SH7785) := clock-sh7785.o
29clock-$(CONFIG_CPU_SUBTYPE_SH7786) := clock-sh7786.o 28clock-$(CONFIG_CPU_SUBTYPE_SH7786) := clock-sh7786.o
30clock-$(CONFIG_CPU_SUBTYPE_SH7343) := clock-sh7343.o 29clock-$(CONFIG_CPU_SUBTYPE_SH7343) := clock-sh7343.o
31clock-$(CONFIG_CPU_SUBTYPE_SH7722) := clock-sh7722.o 30clock-$(CONFIG_CPU_SUBTYPE_SH7722) := clock-sh7722.o hwblk-sh7722.o
32clock-$(CONFIG_CPU_SUBTYPE_SH7723) := clock-sh7723.o 31clock-$(CONFIG_CPU_SUBTYPE_SH7723) := clock-sh7723.o hwblk-sh7723.o
33clock-$(CONFIG_CPU_SUBTYPE_SH7724) := clock-sh7724.o 32clock-$(CONFIG_CPU_SUBTYPE_SH7724) := clock-sh7724.o hwblk-sh7724.o
34clock-$(CONFIG_CPU_SUBTYPE_SH7734) := clock-sh7734.o
35clock-$(CONFIG_CPU_SUBTYPE_SH7366) := clock-sh7366.o 33clock-$(CONFIG_CPU_SUBTYPE_SH7366) := clock-sh7366.o
36clock-$(CONFIG_CPU_SUBTYPE_SHX3) := clock-shx3.o 34clock-$(CONFIG_CPU_SUBTYPE_SHX3) := clock-shx3.o
37 35
@@ -39,7 +37,6 @@ clock-$(CONFIG_CPU_SUBTYPE_SHX3) := clock-shx3.o
39pinmux-$(CONFIG_CPU_SUBTYPE_SH7722) := pinmux-sh7722.o 37pinmux-$(CONFIG_CPU_SUBTYPE_SH7722) := pinmux-sh7722.o
40pinmux-$(CONFIG_CPU_SUBTYPE_SH7723) := pinmux-sh7723.o 38pinmux-$(CONFIG_CPU_SUBTYPE_SH7723) := pinmux-sh7723.o
41pinmux-$(CONFIG_CPU_SUBTYPE_SH7724) := pinmux-sh7724.o 39pinmux-$(CONFIG_CPU_SUBTYPE_SH7724) := pinmux-sh7724.o
42pinmux-$(CONFIG_CPU_SUBTYPE_SH7734) := pinmux-sh7734.o
43pinmux-$(CONFIG_CPU_SUBTYPE_SH7757) := pinmux-sh7757.o 40pinmux-$(CONFIG_CPU_SUBTYPE_SH7757) := pinmux-sh7757.o
44pinmux-$(CONFIG_CPU_SUBTYPE_SH7785) := pinmux-sh7785.o 41pinmux-$(CONFIG_CPU_SUBTYPE_SH7785) := pinmux-sh7785.o
45pinmux-$(CONFIG_CPU_SUBTYPE_SH7786) := pinmux-sh7786.o 42pinmux-$(CONFIG_CPU_SUBTYPE_SH7786) := pinmux-sh7786.o
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
index 53638e231cd..70e45bdaadc 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
@@ -61,7 +61,7 @@ static unsigned long dll_recalc(struct clk *clk)
61 return clk->parent->rate * mult; 61 return clk->parent->rate * mult;
62} 62}
63 63
64static struct sh_clk_ops dll_clk_ops = { 64static struct clk_ops dll_clk_ops = {
65 .recalc = dll_recalc, 65 .recalc = dll_recalc,
66}; 66};
67 67
@@ -81,7 +81,7 @@ static unsigned long pll_recalc(struct clk *clk)
81 return clk->parent->rate * mult; 81 return clk->parent->rate * mult;
82} 82}
83 83
84static struct sh_clk_ops pll_clk_ops = { 84static struct clk_ops pll_clk_ops = {
85 .recalc = pll_recalc, 85 .recalc = pll_recalc,
86}; 86};
87 87
@@ -283,7 +283,7 @@ int __init arch_clk_init(void)
283 ret = sh_clk_div6_register(div6_clks, DIV6_NR); 283 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
284 284
285 if (!ret) 285 if (!ret)
286 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 286 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
287 287
288 return ret; 288 return ret;
289} 289}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
index 22e485d1990..3c3165000c5 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
@@ -61,7 +61,7 @@ static unsigned long dll_recalc(struct clk *clk)
61 return clk->parent->rate * mult; 61 return clk->parent->rate * mult;
62} 62}
63 63
64static struct sh_clk_ops dll_clk_ops = { 64static struct clk_ops dll_clk_ops = {
65 .recalc = dll_recalc, 65 .recalc = dll_recalc,
66}; 66};
67 67
@@ -84,7 +84,7 @@ static unsigned long pll_recalc(struct clk *clk)
84 return (clk->parent->rate * mult) / div; 84 return (clk->parent->rate * mult) / div;
85} 85}
86 86
87static struct sh_clk_ops pll_clk_ops = { 87static struct clk_ops pll_clk_ops = {
88 .recalc = pll_recalc, 88 .recalc = pll_recalc,
89}; 89};
90 90
@@ -276,7 +276,7 @@ int __init arch_clk_init(void)
276 ret = sh_clk_div6_register(div6_clks, DIV6_NR); 276 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
277 277
278 if (!ret) 278 if (!ret)
279 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 279 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
280 280
281 return ret; 281 return ret;
282} 282}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
index c4cb740e4d1..c9a48088ad4 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
@@ -22,8 +22,8 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/clkdev.h> 24#include <linux/clkdev.h>
25#include <linux/sh_clk.h>
26#include <asm/clock.h> 25#include <asm/clock.h>
26#include <asm/hwblk.h>
27#include <cpu/sh7722.h> 27#include <cpu/sh7722.h>
28 28
29/* SH7722 registers */ 29/* SH7722 registers */
@@ -33,9 +33,6 @@
33#define SCLKBCR 0xa415000c 33#define SCLKBCR 0xa415000c
34#define IRDACLKCR 0xa4150018 34#define IRDACLKCR 0xa4150018
35#define PLLCR 0xa4150024 35#define PLLCR 0xa4150024
36#define MSTPCR0 0xa4150030
37#define MSTPCR1 0xa4150034
38#define MSTPCR2 0xa4150038
39#define DLLFRQ 0xa4150050 36#define DLLFRQ 0xa4150050
40 37
41/* Fixed 32 KHz root clock for RTC and Power Management purposes */ 38/* Fixed 32 KHz root clock for RTC and Power Management purposes */
@@ -64,7 +61,7 @@ static unsigned long dll_recalc(struct clk *clk)
64 return clk->parent->rate * mult; 61 return clk->parent->rate * mult;
65} 62}
66 63
67static struct sh_clk_ops dll_clk_ops = { 64static struct clk_ops dll_clk_ops = {
68 .recalc = dll_recalc, 65 .recalc = dll_recalc,
69}; 66};
70 67
@@ -87,7 +84,7 @@ static unsigned long pll_recalc(struct clk *clk)
87 return (clk->parent->rate * mult) / div; 84 return (clk->parent->rate * mult) / div;
88} 85}
89 86
90static struct sh_clk_ops pll_clk_ops = { 87static struct clk_ops pll_clk_ops = {
91 .recalc = pll_recalc, 88 .recalc = pll_recalc,
92}; 89};
93 90
@@ -151,31 +148,31 @@ struct clk div6_clks[DIV6_NR] = {
151}; 148};
152 149
153static struct clk mstp_clks[HWBLK_NR] = { 150static struct clk mstp_clks[HWBLK_NR] = {
154 [HWBLK_URAM] = SH_CLK_MSTP32(&div4_clks[DIV4_U], MSTPCR0, 28, CLK_ENABLE_ON_INIT), 151 SH_HWBLK_CLK(HWBLK_URAM, &div4_clks[DIV4_U], CLK_ENABLE_ON_INIT),
155 [HWBLK_XYMEM] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 26, CLK_ENABLE_ON_INIT), 152 SH_HWBLK_CLK(HWBLK_XYMEM, &div4_clks[DIV4_B], CLK_ENABLE_ON_INIT),
156 [HWBLK_TMU] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 15, 0), 153 SH_HWBLK_CLK(HWBLK_TMU, &div4_clks[DIV4_P], 0),
157 [HWBLK_CMT] = SH_CLK_MSTP32(&r_clk, MSTPCR0, 14, 0), 154 SH_HWBLK_CLK(HWBLK_CMT, &r_clk, 0),
158 [HWBLK_RWDT] = SH_CLK_MSTP32(&r_clk, MSTPCR0, 13, 0), 155 SH_HWBLK_CLK(HWBLK_RWDT, &r_clk, 0),
159 [HWBLK_FLCTL] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 10, 0), 156 SH_HWBLK_CLK(HWBLK_FLCTL, &div4_clks[DIV4_P], 0),
160 [HWBLK_SCIF0] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 7, 0), 157 SH_HWBLK_CLK(HWBLK_SCIF0, &div4_clks[DIV4_P], 0),
161 [HWBLK_SCIF1] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 6, 0), 158 SH_HWBLK_CLK(HWBLK_SCIF1, &div4_clks[DIV4_P], 0),
162 [HWBLK_SCIF2] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 5, 0), 159 SH_HWBLK_CLK(HWBLK_SCIF2, &div4_clks[DIV4_P], 0),
163 160
164 [HWBLK_IIC] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 9, 0), 161 SH_HWBLK_CLK(HWBLK_IIC, &div4_clks[DIV4_P], 0),
165 [HWBLK_RTC] = SH_CLK_MSTP32(&r_clk, MSTPCR1, 8, 0), 162 SH_HWBLK_CLK(HWBLK_RTC, &r_clk, 0),
166 163
167 [HWBLK_SDHI] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 18, 0), 164 SH_HWBLK_CLK(HWBLK_SDHI, &div4_clks[DIV4_P], 0),
168 [HWBLK_KEYSC] = SH_CLK_MSTP32(&r_clk, MSTPCR2, 14, 0), 165 SH_HWBLK_CLK(HWBLK_KEYSC, &r_clk, 0),
169 [HWBLK_USBF] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 11, 0), 166 SH_HWBLK_CLK(HWBLK_USBF, &div4_clks[DIV4_P], 0),
170 [HWBLK_2DG] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 9, 0), 167 SH_HWBLK_CLK(HWBLK_2DG, &div4_clks[DIV4_B], 0),
171 [HWBLK_SIU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 8, 0), 168 SH_HWBLK_CLK(HWBLK_SIU, &div4_clks[DIV4_B], 0),
172 [HWBLK_JPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 6, 0), 169 SH_HWBLK_CLK(HWBLK_VOU, &div4_clks[DIV4_B], 0),
173 [HWBLK_VOU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 5, 0), 170 SH_HWBLK_CLK(HWBLK_JPU, &div4_clks[DIV4_B], 0),
174 [HWBLK_BEU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 4, 0), 171 SH_HWBLK_CLK(HWBLK_BEU, &div4_clks[DIV4_B], 0),
175 [HWBLK_CEU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 3, 0), 172 SH_HWBLK_CLK(HWBLK_CEU, &div4_clks[DIV4_B], 0),
176 [HWBLK_VEU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 2, 0), 173 SH_HWBLK_CLK(HWBLK_VEU, &div4_clks[DIV4_B], 0),
177 [HWBLK_VPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 1, 0), 174 SH_HWBLK_CLK(HWBLK_VPU, &div4_clks[DIV4_B], 0),
178 [HWBLK_LCDC] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 0, 0), 175 SH_HWBLK_CLK(HWBLK_LCDC, &div4_clks[DIV4_P], 0),
179}; 176};
180 177
181static struct clk_lookup lookups[] = { 178static struct clk_lookup lookups[] = {
@@ -208,27 +205,27 @@ static struct clk_lookup lookups[] = {
208 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU]), 205 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU]),
209 206
210 CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), 207 CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]),
211 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]), 208 CLKDEV_CON_ID("rwdt0", &mstp_clks[HWBLK_RWDT]),
212 CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]), 209 CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]),
213 210
214 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[HWBLK_SCIF0]), 211 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[HWBLK_SCIF0]),
215 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[HWBLK_SCIF1]), 212 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[HWBLK_SCIF1]),
216 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[HWBLK_SCIF2]), 213 CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[HWBLK_SCIF2]),
217 214
218 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC]), 215 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC]),
219 CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]), 216 CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]),
220 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[HWBLK_SDHI]), 217 CLKDEV_CON_ID("sdhi0", &mstp_clks[HWBLK_SDHI]),
221 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[HWBLK_KEYSC]), 218 CLKDEV_CON_ID("keysc0", &mstp_clks[HWBLK_KEYSC]),
222 CLKDEV_CON_ID("usbf0", &mstp_clks[HWBLK_USBF]), 219 CLKDEV_CON_ID("usbf0", &mstp_clks[HWBLK_USBF]),
223 CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]), 220 CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]),
224 CLKDEV_DEV_ID("siu-pcm-audio", &mstp_clks[HWBLK_SIU]), 221 CLKDEV_CON_ID("siu0", &mstp_clks[HWBLK_SIU]),
225 CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]), 222 CLKDEV_CON_ID("vou0", &mstp_clks[HWBLK_VOU]),
226 CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]), 223 CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]),
227 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU]), 224 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU]),
228 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[HWBLK_CEU]), 225 CLKDEV_CON_ID("ceu0", &mstp_clks[HWBLK_CEU]),
229 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU]), 226 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU]),
230 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]), 227 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]),
231 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[HWBLK_LCDC]), 228 CLKDEV_CON_ID("lcdc0", &mstp_clks[HWBLK_LCDC]),
232}; 229};
233 230
234int __init arch_clk_init(void) 231int __init arch_clk_init(void)
@@ -261,7 +258,7 @@ int __init arch_clk_init(void)
261 ret = sh_clk_div6_register(div6_clks, DIV6_NR); 258 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
262 259
263 if (!ret) 260 if (!ret)
264 ret = sh_clk_mstp_register(mstp_clks, HWBLK_NR); 261 ret = sh_hwblk_clk_register(mstp_clks, HWBLK_NR);
265 262
266 return ret; 263 return ret;
267} 264}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
index 37c41c7747a..3cc3827380e 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
@@ -23,8 +23,8 @@
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/clkdev.h> 25#include <linux/clkdev.h>
26#include <linux/sh_clk.h>
27#include <asm/clock.h> 26#include <asm/clock.h>
27#include <asm/hwblk.h>
28#include <cpu/sh7723.h> 28#include <cpu/sh7723.h>
29 29
30/* SH7723 registers */ 30/* SH7723 registers */
@@ -34,9 +34,6 @@
34#define SCLKBCR 0xa415000c 34#define SCLKBCR 0xa415000c
35#define IRDACLKCR 0xa4150018 35#define IRDACLKCR 0xa4150018
36#define PLLCR 0xa4150024 36#define PLLCR 0xa4150024
37#define MSTPCR0 0xa4150030
38#define MSTPCR1 0xa4150034
39#define MSTPCR2 0xa4150038
40#define DLLFRQ 0xa4150050 37#define DLLFRQ 0xa4150050
41 38
42/* Fixed 32 KHz root clock for RTC and Power Management purposes */ 39/* Fixed 32 KHz root clock for RTC and Power Management purposes */
@@ -65,7 +62,7 @@ static unsigned long dll_recalc(struct clk *clk)
65 return clk->parent->rate * mult; 62 return clk->parent->rate * mult;
66} 63}
67 64
68static struct sh_clk_ops dll_clk_ops = { 65static struct clk_ops dll_clk_ops = {
69 .recalc = dll_recalc, 66 .recalc = dll_recalc,
70}; 67};
71 68
@@ -88,7 +85,7 @@ static unsigned long pll_recalc(struct clk *clk)
88 return (clk->parent->rate * mult) / div; 85 return (clk->parent->rate * mult) / div;
89} 86}
90 87
91static struct sh_clk_ops pll_clk_ops = { 88static struct clk_ops pll_clk_ops = {
92 .recalc = pll_recalc, 89 .recalc = pll_recalc,
93}; 90};
94 91
@@ -152,55 +149,55 @@ struct clk div6_clks[DIV6_NR] = {
152 149
153static struct clk mstp_clks[] = { 150static struct clk mstp_clks[] = {
154 /* See page 60 of Datasheet V1.0: Overview -> Block Diagram */ 151 /* See page 60 of Datasheet V1.0: Overview -> Block Diagram */
155 [HWBLK_TLB] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 31, CLK_ENABLE_ON_INIT), 152 SH_HWBLK_CLK(HWBLK_TLB, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT),
156 [HWBLK_IC] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 30, CLK_ENABLE_ON_INIT), 153 SH_HWBLK_CLK(HWBLK_IC, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT),
157 [HWBLK_OC] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 29, CLK_ENABLE_ON_INIT), 154 SH_HWBLK_CLK(HWBLK_OC, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT),
158 [HWBLK_L2C] = SH_CLK_MSTP32(&div4_clks[DIV4_SH], MSTPCR0, 28, CLK_ENABLE_ON_INIT), 155 SH_HWBLK_CLK(HWBLK_L2C, &div4_clks[DIV4_SH], CLK_ENABLE_ON_INIT),
159 [HWBLK_ILMEM] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 27, CLK_ENABLE_ON_INIT), 156 SH_HWBLK_CLK(HWBLK_ILMEM, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT),
160 [HWBLK_FPU] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 24, CLK_ENABLE_ON_INIT), 157 SH_HWBLK_CLK(HWBLK_FPU, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT),
161 [HWBLK_INTC] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 22, CLK_ENABLE_ON_INIT), 158 SH_HWBLK_CLK(HWBLK_INTC, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT),
162 [HWBLK_DMAC0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 21, 0), 159 SH_HWBLK_CLK(HWBLK_DMAC0, &div4_clks[DIV4_B], 0),
163 [HWBLK_SHYWAY] = SH_CLK_MSTP32(&div4_clks[DIV4_SH], MSTPCR0, 20, CLK_ENABLE_ON_INIT), 160 SH_HWBLK_CLK(HWBLK_SHYWAY, &div4_clks[DIV4_SH], CLK_ENABLE_ON_INIT),
164 [HWBLK_HUDI] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 19, 0), 161 SH_HWBLK_CLK(HWBLK_HUDI, &div4_clks[DIV4_P], 0),
165 [HWBLK_UBC] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 17, 0), 162 SH_HWBLK_CLK(HWBLK_UBC, &div4_clks[DIV4_I], 0),
166 [HWBLK_TMU0] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 15, 0), 163 SH_HWBLK_CLK(HWBLK_TMU0, &div4_clks[DIV4_P], 0),
167 [HWBLK_CMT] = SH_CLK_MSTP32(&r_clk, MSTPCR0, 14, 0), 164 SH_HWBLK_CLK(HWBLK_CMT, &r_clk, 0),
168 [HWBLK_RWDT] = SH_CLK_MSTP32(&r_clk, MSTPCR0, 13, 0), 165 SH_HWBLK_CLK(HWBLK_RWDT, &r_clk, 0),
169 [HWBLK_DMAC1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 12, 0), 166 SH_HWBLK_CLK(HWBLK_DMAC1, &div4_clks[DIV4_B], 0),
170 [HWBLK_TMU1] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 11, 0), 167 SH_HWBLK_CLK(HWBLK_TMU1, &div4_clks[DIV4_P], 0),
171 [HWBLK_FLCTL] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 10, 0), 168 SH_HWBLK_CLK(HWBLK_FLCTL, &div4_clks[DIV4_P], 0),
172 [HWBLK_SCIF0] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 9, 0), 169 SH_HWBLK_CLK(HWBLK_SCIF0, &div4_clks[DIV4_P], 0),
173 [HWBLK_SCIF1] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 8, 0), 170 SH_HWBLK_CLK(HWBLK_SCIF1, &div4_clks[DIV4_P], 0),
174 [HWBLK_SCIF2] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 7, 0), 171 SH_HWBLK_CLK(HWBLK_SCIF2, &div4_clks[DIV4_P], 0),
175 [HWBLK_SCIF3] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 6, 0), 172 SH_HWBLK_CLK(HWBLK_SCIF3, &div4_clks[DIV4_B], 0),
176 [HWBLK_SCIF4] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 5, 0), 173 SH_HWBLK_CLK(HWBLK_SCIF4, &div4_clks[DIV4_B], 0),
177 [HWBLK_SCIF5] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 4, 0), 174 SH_HWBLK_CLK(HWBLK_SCIF5, &div4_clks[DIV4_B], 0),
178 [HWBLK_MSIOF0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 2, 0), 175 SH_HWBLK_CLK(HWBLK_MSIOF0, &div4_clks[DIV4_B], 0),
179 [HWBLK_MSIOF1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 1, 0), 176 SH_HWBLK_CLK(HWBLK_MSIOF1, &div4_clks[DIV4_B], 0),
180 [HWBLK_MERAM] = SH_CLK_MSTP32(&div4_clks[DIV4_SH], MSTPCR0, 0, 0), 177 SH_HWBLK_CLK(HWBLK_MERAM, &div4_clks[DIV4_SH], 0),
181 178
182 [HWBLK_IIC] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 9, 0), 179 SH_HWBLK_CLK(HWBLK_IIC, &div4_clks[DIV4_P], 0),
183 [HWBLK_RTC] = SH_CLK_MSTP32(&r_clk, MSTPCR1, 8, 0), 180 SH_HWBLK_CLK(HWBLK_RTC, &r_clk, 0),
184 181
185 [HWBLK_ATAPI] = SH_CLK_MSTP32(&div4_clks[DIV4_SH], MSTPCR2, 28, 0), 182 SH_HWBLK_CLK(HWBLK_ATAPI, &div4_clks[DIV4_SH], 0),
186 [HWBLK_ADC] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 27, 0), 183 SH_HWBLK_CLK(HWBLK_ADC, &div4_clks[DIV4_P], 0),
187 [HWBLK_TPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 25, 0), 184 SH_HWBLK_CLK(HWBLK_TPU, &div4_clks[DIV4_B], 0),
188 [HWBLK_IRDA] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 24, 0), 185 SH_HWBLK_CLK(HWBLK_IRDA, &div4_clks[DIV4_P], 0),
189 [HWBLK_TSIF] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 22, 0), 186 SH_HWBLK_CLK(HWBLK_TSIF, &div4_clks[DIV4_B], 0),
190 [HWBLK_ICB] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 21, CLK_ENABLE_ON_INIT), 187 SH_HWBLK_CLK(HWBLK_ICB, &div4_clks[DIV4_B], CLK_ENABLE_ON_INIT),
191 [HWBLK_SDHI0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 18, 0), 188 SH_HWBLK_CLK(HWBLK_SDHI0, &div4_clks[DIV4_B], 0),
192 [HWBLK_SDHI1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 17, 0), 189 SH_HWBLK_CLK(HWBLK_SDHI1, &div4_clks[DIV4_B], 0),
193 [HWBLK_KEYSC] = SH_CLK_MSTP32(&r_clk, MSTPCR2, 14, 0), 190 SH_HWBLK_CLK(HWBLK_KEYSC, &r_clk, 0),
194 [HWBLK_USB] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 11, 0), 191 SH_HWBLK_CLK(HWBLK_USB, &div4_clks[DIV4_B], 0),
195 [HWBLK_2DG] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 10, 0), 192 SH_HWBLK_CLK(HWBLK_2DG, &div4_clks[DIV4_B], 0),
196 [HWBLK_SIU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 8, 0), 193 SH_HWBLK_CLK(HWBLK_SIU, &div4_clks[DIV4_B], 0),
197 [HWBLK_VEU2H1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 6, 0), 194 SH_HWBLK_CLK(HWBLK_VEU2H1, &div4_clks[DIV4_B], 0),
198 [HWBLK_VOU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 5, 0), 195 SH_HWBLK_CLK(HWBLK_VOU, &div4_clks[DIV4_B], 0),
199 [HWBLK_BEU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 4, 0), 196 SH_HWBLK_CLK(HWBLK_BEU, &div4_clks[DIV4_B], 0),
200 [HWBLK_CEU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 3, 0), 197 SH_HWBLK_CLK(HWBLK_CEU, &div4_clks[DIV4_B], 0),
201 [HWBLK_VEU2H0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 2, 0), 198 SH_HWBLK_CLK(HWBLK_VEU2H0, &div4_clks[DIV4_B], 0),
202 [HWBLK_VPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 1, 0), 199 SH_HWBLK_CLK(HWBLK_VPU, &div4_clks[DIV4_B], 0),
203 [HWBLK_LCDC] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 0, 0), 200 SH_HWBLK_CLK(HWBLK_LCDC, &div4_clks[DIV4_B], 0),
204}; 201};
205 202
206static struct clk_lookup lookups[] = { 203static struct clk_lookup lookups[] = {
@@ -232,17 +229,80 @@ static struct clk_lookup lookups[] = {
232 CLKDEV_CON_ID("ilmem0", &mstp_clks[HWBLK_ILMEM]), 229 CLKDEV_CON_ID("ilmem0", &mstp_clks[HWBLK_ILMEM]),
233 CLKDEV_CON_ID("fpu0", &mstp_clks[HWBLK_FPU]), 230 CLKDEV_CON_ID("fpu0", &mstp_clks[HWBLK_FPU]),
234 CLKDEV_CON_ID("intc0", &mstp_clks[HWBLK_INTC]), 231 CLKDEV_CON_ID("intc0", &mstp_clks[HWBLK_INTC]),
235 CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[HWBLK_DMAC0]), 232 CLKDEV_CON_ID("dmac0", &mstp_clks[HWBLK_DMAC0]),
236 CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]), 233 CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]),
237 CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]), 234 CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),
238 CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]), 235 CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]),
236 {
237 /* TMU0 */
238 .dev_id = "sh_tmu.0",
239 .con_id = "tmu_fck",
240 .clk = &mstp_clks[HWBLK_TMU0],
241 }, {
242 /* TMU1 */
243 .dev_id = "sh_tmu.1",
244 .con_id = "tmu_fck",
245 .clk = &mstp_clks[HWBLK_TMU0],
246 }, {
247 /* TMU2 */
248 .dev_id = "sh_tmu.2",
249 .con_id = "tmu_fck",
250 .clk = &mstp_clks[HWBLK_TMU0],
251 },
239 CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), 252 CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]),
240 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]), 253 CLKDEV_CON_ID("rwdt0", &mstp_clks[HWBLK_RWDT]),
241 CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]), 254 CLKDEV_CON_ID("dmac1", &mstp_clks[HWBLK_DMAC1]),
255 {
256 /* TMU3 */
257 .dev_id = "sh_tmu.3",
258 .con_id = "tmu_fck",
259 .clk = &mstp_clks[HWBLK_TMU1],
260 }, {
261 /* TMU4 */
262 .dev_id = "sh_tmu.4",
263 .con_id = "tmu_fck",
264 .clk = &mstp_clks[HWBLK_TMU1],
265 }, {
266 /* TMU5 */
267 .dev_id = "sh_tmu.5",
268 .con_id = "tmu_fck",
269 .clk = &mstp_clks[HWBLK_TMU1],
270 },
242 CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]), 271 CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]),
243 CLKDEV_DEV_ID("spi_sh_msiof.0", &mstp_clks[HWBLK_MSIOF0]), 272 {
244 CLKDEV_DEV_ID("spi_sh_msiof.1", &mstp_clks[HWBLK_MSIOF1]), 273 /* SCIF0 */
245 CLKDEV_DEV_ID("sh_mobile_meram.0", &mstp_clks[HWBLK_MERAM]), 274 .dev_id = "sh-sci.0",
275 .con_id = "sci_fck",
276 .clk = &mstp_clks[HWBLK_SCIF0],
277 }, {
278 /* SCIF1 */
279 .dev_id = "sh-sci.1",
280 .con_id = "sci_fck",
281 .clk = &mstp_clks[HWBLK_SCIF1],
282 }, {
283 /* SCIF2 */
284 .dev_id = "sh-sci.2",
285 .con_id = "sci_fck",
286 .clk = &mstp_clks[HWBLK_SCIF2],
287 }, {
288 /* SCIF3 */
289 .dev_id = "sh-sci.3",
290 .con_id = "sci_fck",
291 .clk = &mstp_clks[HWBLK_SCIF3],
292 }, {
293 /* SCIF4 */
294 .dev_id = "sh-sci.4",
295 .con_id = "sci_fck",
296 .clk = &mstp_clks[HWBLK_SCIF4],
297 }, {
298 /* SCIF5 */
299 .dev_id = "sh-sci.5",
300 .con_id = "sci_fck",
301 .clk = &mstp_clks[HWBLK_SCIF5],
302 },
303 CLKDEV_CON_ID("msiof0", &mstp_clks[HWBLK_MSIOF0]),
304 CLKDEV_CON_ID("msiof1", &mstp_clks[HWBLK_MSIOF1]),
305 CLKDEV_CON_ID("meram0", &mstp_clks[HWBLK_MERAM]),
246 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC]), 306 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC]),
247 CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]), 307 CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]),
248 CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]), 308 CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]),
@@ -251,34 +311,19 @@ static struct clk_lookup lookups[] = {
251 CLKDEV_CON_ID("irda0", &mstp_clks[HWBLK_IRDA]), 311 CLKDEV_CON_ID("irda0", &mstp_clks[HWBLK_IRDA]),
252 CLKDEV_CON_ID("tsif0", &mstp_clks[HWBLK_TSIF]), 312 CLKDEV_CON_ID("tsif0", &mstp_clks[HWBLK_TSIF]),
253 CLKDEV_CON_ID("icb0", &mstp_clks[HWBLK_ICB]), 313 CLKDEV_CON_ID("icb0", &mstp_clks[HWBLK_ICB]),
254 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[HWBLK_SDHI0]), 314 CLKDEV_CON_ID("sdhi0", &mstp_clks[HWBLK_SDHI0]),
255 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[HWBLK_SDHI1]), 315 CLKDEV_CON_ID("sdhi1", &mstp_clks[HWBLK_SDHI1]),
256 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[HWBLK_KEYSC]), 316 CLKDEV_CON_ID("keysc0", &mstp_clks[HWBLK_KEYSC]),
257 CLKDEV_CON_ID("usb0", &mstp_clks[HWBLK_USB]), 317 CLKDEV_CON_ID("usb0", &mstp_clks[HWBLK_USB]),
258 CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]), 318 CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]),
259 CLKDEV_DEV_ID("siu-pcm-audio", &mstp_clks[HWBLK_SIU]), 319 CLKDEV_CON_ID("siu0", &mstp_clks[HWBLK_SIU]),
260 CLKDEV_CON_ID("veu1", &mstp_clks[HWBLK_VEU2H1]), 320 CLKDEV_CON_ID("veu1", &mstp_clks[HWBLK_VEU2H1]),
261 CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]), 321 CLKDEV_CON_ID("vou0", &mstp_clks[HWBLK_VOU]),
262 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU]), 322 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU]),
263 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[HWBLK_CEU]), 323 CLKDEV_CON_ID("ceu0", &mstp_clks[HWBLK_CEU]),
264 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU2H0]), 324 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU2H0]),
265 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]), 325 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]),
266 326 CLKDEV_CON_ID("lcdc0", &mstp_clks[HWBLK_LCDC]),
267 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU0]),
268 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU0]),
269 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU0]),
270 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]),
271 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[HWBLK_TMU1]),
272 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[HWBLK_TMU1]),
273
274 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[HWBLK_SCIF0]),
275 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[HWBLK_SCIF1]),
276 CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[HWBLK_SCIF2]),
277 CLKDEV_ICK_ID("sci_fck", "sh-sci.3", &mstp_clks[HWBLK_SCIF3]),
278 CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[HWBLK_SCIF4]),
279 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[HWBLK_SCIF5]),
280
281 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[HWBLK_LCDC]),
282}; 327};
283 328
284int __init arch_clk_init(void) 329int __init arch_clk_init(void)
@@ -311,7 +356,7 @@ int __init arch_clk_init(void)
311 ret = sh_clk_div6_register(div6_clks, DIV6_NR); 356 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
312 357
313 if (!ret) 358 if (!ret)
314 ret = sh_clk_mstp_register(mstp_clks, HWBLK_NR); 359 ret = sh_hwblk_clk_register(mstp_clks, HWBLK_NR);
315 360
316 return ret; 361 return ret;
317} 362}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index 5f30f805d2f..8668f557e0a 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -23,8 +23,8 @@
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/clkdev.h> 25#include <linux/clkdev.h>
26#include <linux/sh_clk.h>
27#include <asm/clock.h> 26#include <asm/clock.h>
27#include <asm/hwblk.h>
28#include <cpu/sh7724.h> 28#include <cpu/sh7724.h>
29 29
30/* SH7724 registers */ 30/* SH7724 registers */
@@ -35,9 +35,6 @@
35#define FCLKBCR 0xa415000c 35#define FCLKBCR 0xa415000c
36#define IRDACLKCR 0xa4150018 36#define IRDACLKCR 0xa4150018
37#define PLLCR 0xa4150024 37#define PLLCR 0xa4150024
38#define MSTPCR0 0xa4150030
39#define MSTPCR1 0xa4150034
40#define MSTPCR2 0xa4150038
41#define SPUCLKCR 0xa415003c 38#define SPUCLKCR 0xa415003c
42#define FLLFRQ 0xa4150050 39#define FLLFRQ 0xa4150050
43#define LSTATS 0xa4150060 40#define LSTATS 0xa4150060
@@ -70,7 +67,7 @@ static unsigned long fll_recalc(struct clk *clk)
70 return (clk->parent->rate * mult) / div; 67 return (clk->parent->rate * mult) / div;
71} 68}
72 69
73static struct sh_clk_ops fll_clk_ops = { 70static struct clk_ops fll_clk_ops = {
74 .recalc = fll_recalc, 71 .recalc = fll_recalc,
75}; 72};
76 73
@@ -90,7 +87,7 @@ static unsigned long pll_recalc(struct clk *clk)
90 return clk->parent->rate * mult; 87 return clk->parent->rate * mult;
91} 88}
92 89
93static struct sh_clk_ops pll_clk_ops = { 90static struct clk_ops pll_clk_ops = {
94 .recalc = pll_recalc, 91 .recalc = pll_recalc,
95}; 92};
96 93
@@ -105,7 +102,7 @@ static unsigned long div3_recalc(struct clk *clk)
105 return clk->parent->rate / 3; 102 return clk->parent->rate / 3;
106} 103}
107 104
108static struct sh_clk_ops div3_clk_ops = { 105static struct clk_ops div3_clk_ops = {
109 .recalc = div3_recalc, 106 .recalc = div3_recalc,
110}; 107};
111 108
@@ -114,16 +111,13 @@ static struct clk div3_clk = {
114 .parent = &pll_clk, 111 .parent = &pll_clk,
115}; 112};
116 113
117/* External input clock (pin name: FSIMCKA/FSIMCKB/DV_CLKI ) */ 114/* External input clock (pin name: FSIMCKA/FSIMCKB ) */
118struct clk sh7724_fsimcka_clk = { 115struct clk sh7724_fsimcka_clk = {
119}; 116};
120 117
121struct clk sh7724_fsimckb_clk = { 118struct clk sh7724_fsimckb_clk = {
122}; 119};
123 120
124struct clk sh7724_dv_clki = {
125};
126
127static struct clk *main_clks[] = { 121static struct clk *main_clks[] = {
128 &r_clk, 122 &r_clk,
129 &extal_clk, 123 &extal_clk,
@@ -132,7 +126,6 @@ static struct clk *main_clks[] = {
132 &div3_clk, 126 &div3_clk,
133 &sh7724_fsimcka_clk, 127 &sh7724_fsimcka_clk,
134 &sh7724_fsimckb_clk, 128 &sh7724_fsimckb_clk,
135 &sh7724_dv_clki,
136}; 129};
137 130
138static void div4_kick(struct clk *clk) 131static void div4_kick(struct clk *clk)
@@ -170,20 +163,17 @@ struct clk div4_clks[DIV4_NR] = {
170 [DIV4_M1] = DIV4(FRQCRB, 4, 0x2f7c, CLK_ENABLE_ON_INIT), 163 [DIV4_M1] = DIV4(FRQCRB, 4, 0x2f7c, CLK_ENABLE_ON_INIT),
171}; 164};
172 165
173enum { DIV6_V, DIV6_I, DIV6_S, DIV6_FA, DIV6_FB, DIV6_NR }; 166enum { DIV6_V, DIV6_I, DIV6_S, DIV6_NR };
174 167
175/* Indices are important - they are the actual src selecting values */ 168static struct clk div6_clks[DIV6_NR] = {
176static struct clk *common_parent[] = { 169 [DIV6_V] = SH_CLK_DIV6(&div3_clk, VCLKCR, 0),
177 [0] = &div3_clk, 170 [DIV6_I] = SH_CLK_DIV6(&div3_clk, IRDACLKCR, 0),
178 [1] = NULL, 171 [DIV6_S] = SH_CLK_DIV6(&div3_clk, SPUCLKCR, CLK_ENABLE_ON_INIT),
179}; 172};
180 173
181static struct clk *vclkcr_parent[8] = { 174enum { DIV6_FA, DIV6_FB, DIV6_REPARENT_NR };
182 [0] = &div3_clk,
183 [2] = &sh7724_dv_clki,
184 [4] = &extal_clk,
185};
186 175
176/* Indices are important - they are the actual src selecting values */
187static struct clk *fclkacr_parent[] = { 177static struct clk *fclkacr_parent[] = {
188 [0] = &div3_clk, 178 [0] = &div3_clk,
189 [1] = NULL, 179 [1] = NULL,
@@ -198,74 +188,68 @@ static struct clk *fclkbcr_parent[] = {
198 [3] = NULL, 188 [3] = NULL,
199}; 189};
200 190
201static struct clk div6_clks[DIV6_NR] = { 191static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = {
202 [DIV6_V] = SH_CLK_DIV6_EXT(VCLKCR, 0, 192 [DIV6_FA] = SH_CLK_DIV6_EXT(&div3_clk, FCLKACR, 0,
203 vclkcr_parent, ARRAY_SIZE(vclkcr_parent), 12, 3),
204 [DIV6_I] = SH_CLK_DIV6_EXT(IRDACLKCR, 0,
205 common_parent, ARRAY_SIZE(common_parent), 6, 1),
206 [DIV6_S] = SH_CLK_DIV6_EXT(SPUCLKCR, CLK_ENABLE_ON_INIT,
207 common_parent, ARRAY_SIZE(common_parent), 6, 1),
208 [DIV6_FA] = SH_CLK_DIV6_EXT(FCLKACR, 0,
209 fclkacr_parent, ARRAY_SIZE(fclkacr_parent), 6, 2), 193 fclkacr_parent, ARRAY_SIZE(fclkacr_parent), 6, 2),
210 [DIV6_FB] = SH_CLK_DIV6_EXT(FCLKBCR, 0, 194 [DIV6_FB] = SH_CLK_DIV6_EXT(&div3_clk, FCLKBCR, 0,
211 fclkbcr_parent, ARRAY_SIZE(fclkbcr_parent), 6, 2), 195 fclkbcr_parent, ARRAY_SIZE(fclkbcr_parent), 6, 2),
212}; 196};
213 197
214static struct clk mstp_clks[HWBLK_NR] = { 198static struct clk mstp_clks[HWBLK_NR] = {
215 [HWBLK_TLB] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 31, CLK_ENABLE_ON_INIT), 199 SH_HWBLK_CLK(HWBLK_TLB, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT),
216 [HWBLK_IC] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 30, CLK_ENABLE_ON_INIT), 200 SH_HWBLK_CLK(HWBLK_IC, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT),
217 [HWBLK_OC] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 29, CLK_ENABLE_ON_INIT), 201 SH_HWBLK_CLK(HWBLK_OC, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT),
218 [HWBLK_RSMEM] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 28, CLK_ENABLE_ON_INIT), 202 SH_HWBLK_CLK(HWBLK_RSMEM, &div4_clks[DIV4_B], CLK_ENABLE_ON_INIT),
219 [HWBLK_ILMEM] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 27, CLK_ENABLE_ON_INIT), 203 SH_HWBLK_CLK(HWBLK_ILMEM, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT),
220 [HWBLK_L2C] = SH_CLK_MSTP32(&div4_clks[DIV4_SH], MSTPCR0, 26, CLK_ENABLE_ON_INIT), 204 SH_HWBLK_CLK(HWBLK_L2C, &div4_clks[DIV4_SH], CLK_ENABLE_ON_INIT),
221 [HWBLK_FPU] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 24, CLK_ENABLE_ON_INIT), 205 SH_HWBLK_CLK(HWBLK_FPU, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT),
222 [HWBLK_INTC] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 22, CLK_ENABLE_ON_INIT), 206 SH_HWBLK_CLK(HWBLK_INTC, &div4_clks[DIV4_P], CLK_ENABLE_ON_INIT),
223 [HWBLK_DMAC0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 21, 0), 207 SH_HWBLK_CLK(HWBLK_DMAC0, &div4_clks[DIV4_B], 0),
224 [HWBLK_SHYWAY] = SH_CLK_MSTP32(&div4_clks[DIV4_SH], MSTPCR0, 20, CLK_ENABLE_ON_INIT), 208 SH_HWBLK_CLK(HWBLK_SHYWAY, &div4_clks[DIV4_SH], CLK_ENABLE_ON_INIT),
225 [HWBLK_HUDI] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 19, 0), 209 SH_HWBLK_CLK(HWBLK_HUDI, &div4_clks[DIV4_P], 0),
226 [HWBLK_UBC] = SH_CLK_MSTP32(&div4_clks[DIV4_I], MSTPCR0, 17, 0), 210 SH_HWBLK_CLK(HWBLK_UBC, &div4_clks[DIV4_I], 0),
227 [HWBLK_TMU0] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 15, 0), 211 SH_HWBLK_CLK(HWBLK_TMU0, &div4_clks[DIV4_P], 0),
228 [HWBLK_CMT] = SH_CLK_MSTP32(&r_clk, MSTPCR0, 14, 0), 212 SH_HWBLK_CLK(HWBLK_CMT, &r_clk, 0),
229 [HWBLK_RWDT] = SH_CLK_MSTP32(&r_clk, MSTPCR0, 13, 0), 213 SH_HWBLK_CLK(HWBLK_RWDT, &r_clk, 0),
230 [HWBLK_DMAC1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 12, 0), 214 SH_HWBLK_CLK(HWBLK_DMAC1, &div4_clks[DIV4_B], 0),
231 [HWBLK_TMU1] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 10, 0), 215 SH_HWBLK_CLK(HWBLK_TMU1, &div4_clks[DIV4_P], 0),
232 [HWBLK_SCIF0] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 9, 0), 216 SH_HWBLK_CLK(HWBLK_SCIF0, &div4_clks[DIV4_P], 0),
233 [HWBLK_SCIF1] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 8, 0), 217 SH_HWBLK_CLK(HWBLK_SCIF1, &div4_clks[DIV4_P], 0),
234 [HWBLK_SCIF2] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 7, 0), 218 SH_HWBLK_CLK(HWBLK_SCIF2, &div4_clks[DIV4_P], 0),
235 [HWBLK_SCIF3] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 6, 0), 219 SH_HWBLK_CLK(HWBLK_SCIF3, &div4_clks[DIV4_B], 0),
236 [HWBLK_SCIF4] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 5, 0), 220 SH_HWBLK_CLK(HWBLK_SCIF4, &div4_clks[DIV4_B], 0),
237 [HWBLK_SCIF5] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 4, 0), 221 SH_HWBLK_CLK(HWBLK_SCIF5, &div4_clks[DIV4_B], 0),
238 [HWBLK_MSIOF0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 2, 0), 222 SH_HWBLK_CLK(HWBLK_MSIOF0, &div4_clks[DIV4_B], 0),
239 [HWBLK_MSIOF1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 1, 0), 223 SH_HWBLK_CLK(HWBLK_MSIOF1, &div4_clks[DIV4_B], 0),
240 224
241 [HWBLK_KEYSC] = SH_CLK_MSTP32(&r_clk, MSTPCR1, 12, 0), 225 SH_HWBLK_CLK(HWBLK_KEYSC, &r_clk, 0),
242 [HWBLK_RTC] = SH_CLK_MSTP32(&r_clk, MSTPCR1, 11, 0), 226 SH_HWBLK_CLK(HWBLK_RTC, &r_clk, 0),
243 [HWBLK_IIC0] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 9, 0), 227 SH_HWBLK_CLK(HWBLK_IIC0, &div4_clks[DIV4_P], 0),
244 [HWBLK_IIC1] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 8, 0), 228 SH_HWBLK_CLK(HWBLK_IIC1, &div4_clks[DIV4_P], 0),
245 229
246 [HWBLK_MMC] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 29, 0), 230 SH_HWBLK_CLK(HWBLK_MMC, &div4_clks[DIV4_B], 0),
247 [HWBLK_ETHER] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 28, 0), 231 SH_HWBLK_CLK(HWBLK_ETHER, &div4_clks[DIV4_B], 0),
248 [HWBLK_ATAPI] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 26, 0), 232 SH_HWBLK_CLK(HWBLK_ATAPI, &div4_clks[DIV4_B], 0),
249 [HWBLK_TPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 25, 0), 233 SH_HWBLK_CLK(HWBLK_TPU, &div4_clks[DIV4_B], 0),
250 [HWBLK_IRDA] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 24, 0), 234 SH_HWBLK_CLK(HWBLK_IRDA, &div4_clks[DIV4_P], 0),
251 [HWBLK_TSIF] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 22, 0), 235 SH_HWBLK_CLK(HWBLK_TSIF, &div4_clks[DIV4_B], 0),
252 [HWBLK_USB1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 21, 0), 236 SH_HWBLK_CLK(HWBLK_USB1, &div4_clks[DIV4_B], 0),
253 [HWBLK_USB0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 20, 0), 237 SH_HWBLK_CLK(HWBLK_USB0, &div4_clks[DIV4_B], 0),
254 [HWBLK_2DG] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 19, 0), 238 SH_HWBLK_CLK(HWBLK_2DG, &div4_clks[DIV4_B], 0),
255 [HWBLK_SDHI0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 18, 0), 239 SH_HWBLK_CLK(HWBLK_SDHI0, &div4_clks[DIV4_B], 0),
256 [HWBLK_SDHI1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 17, 0), 240 SH_HWBLK_CLK(HWBLK_SDHI1, &div4_clks[DIV4_B], 0),
257 [HWBLK_VEU1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 15, 0), 241 SH_HWBLK_CLK(HWBLK_VEU1, &div4_clks[DIV4_B], 0),
258 [HWBLK_CEU1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 13, 0), 242 SH_HWBLK_CLK(HWBLK_CEU1, &div4_clks[DIV4_B], 0),
259 [HWBLK_BEU1] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 12, 0), 243 SH_HWBLK_CLK(HWBLK_BEU1, &div4_clks[DIV4_B], 0),
260 [HWBLK_2DDMAC] = SH_CLK_MSTP32(&div4_clks[DIV4_SH], MSTPCR2, 10, 0), 244 SH_HWBLK_CLK(HWBLK_2DDMAC, &div4_clks[DIV4_SH], 0),
261 [HWBLK_SPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 9, 0), 245 SH_HWBLK_CLK(HWBLK_SPU, &div4_clks[DIV4_B], 0),
262 [HWBLK_JPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 6, 0), 246 SH_HWBLK_CLK(HWBLK_JPU, &div4_clks[DIV4_B], 0),
263 [HWBLK_VOU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 5, 0), 247 SH_HWBLK_CLK(HWBLK_VOU, &div4_clks[DIV4_B], 0),
264 [HWBLK_BEU0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 4, 0), 248 SH_HWBLK_CLK(HWBLK_BEU0, &div4_clks[DIV4_B], 0),
265 [HWBLK_CEU0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 3, 0), 249 SH_HWBLK_CLK(HWBLK_CEU0, &div4_clks[DIV4_B], 0),
266 [HWBLK_VEU0] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 2, 0), 250 SH_HWBLK_CLK(HWBLK_VEU0, &div4_clks[DIV4_B], 0),
267 [HWBLK_VPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 1, 0), 251 SH_HWBLK_CLK(HWBLK_VPU, &div4_clks[DIV4_B], 0),
268 [HWBLK_LCDC] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 0, 0), 252 SH_HWBLK_CLK(HWBLK_LCDC, &div4_clks[DIV4_B], 0),
269}; 253};
270 254
271static struct clk_lookup lookups[] = { 255static struct clk_lookup lookups[] = {
@@ -285,8 +269,8 @@ static struct clk_lookup lookups[] = {
285 269
286 /* DIV6 clocks */ 270 /* DIV6 clocks */
287 CLKDEV_CON_ID("video_clk", &div6_clks[DIV6_V]), 271 CLKDEV_CON_ID("video_clk", &div6_clks[DIV6_V]),
288 CLKDEV_CON_ID("fsia_clk", &div6_clks[DIV6_FA]), 272 CLKDEV_CON_ID("fsia_clk", &div6_reparent_clks[DIV6_FA]),
289 CLKDEV_CON_ID("fsib_clk", &div6_clks[DIV6_FB]), 273 CLKDEV_CON_ID("fsib_clk", &div6_reparent_clks[DIV6_FB]),
290 CLKDEV_CON_ID("irda_clk", &div6_clks[DIV6_I]), 274 CLKDEV_CON_ID("irda_clk", &div6_clks[DIV6_I]),
291 CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_S]), 275 CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_S]),
292 276
@@ -299,7 +283,7 @@ static struct clk_lookup lookups[] = {
299 CLKDEV_CON_ID("l2c0", &mstp_clks[HWBLK_L2C]), 283 CLKDEV_CON_ID("l2c0", &mstp_clks[HWBLK_L2C]),
300 CLKDEV_CON_ID("fpu0", &mstp_clks[HWBLK_FPU]), 284 CLKDEV_CON_ID("fpu0", &mstp_clks[HWBLK_FPU]),
301 CLKDEV_CON_ID("intc0", &mstp_clks[HWBLK_INTC]), 285 CLKDEV_CON_ID("intc0", &mstp_clks[HWBLK_INTC]),
302 CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[HWBLK_DMAC0]), 286 CLKDEV_CON_ID("dmac0", &mstp_clks[HWBLK_DMAC0]),
303 CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]), 287 CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]),
304 CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]), 288 CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),
305 CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]), 289 CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]),
@@ -310,47 +294,47 @@ static struct clk_lookup lookups[] = {
310 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]), 294 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]),
311 295
312 CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), 296 CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]),
313 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]), 297 CLKDEV_CON_ID("rwdt0", &mstp_clks[HWBLK_RWDT]),
314 CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]), 298 CLKDEV_CON_ID("dmac1", &mstp_clks[HWBLK_DMAC1]),
315 299
316 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[HWBLK_TMU1]), 300 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[HWBLK_TMU1]),
317 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[HWBLK_TMU1]), 301 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[HWBLK_TMU1]),
318 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[HWBLK_SCIF0]), 302 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[HWBLK_SCIF0]),
319 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[HWBLK_SCIF1]), 303 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[HWBLK_SCIF1]),
320 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[HWBLK_SCIF2]), 304 CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[HWBLK_SCIF2]),
321 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[HWBLK_SCIF3]), 305 CLKDEV_ICK_ID("sci_fck", "sh-sci.3", &mstp_clks[HWBLK_SCIF3]),
322 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[HWBLK_SCIF4]), 306 CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[HWBLK_SCIF4]),
323 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[HWBLK_SCIF5]), 307 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[HWBLK_SCIF5]),
324 308
325 CLKDEV_DEV_ID("spi_sh_msiof.0", &mstp_clks[HWBLK_MSIOF0]), 309 CLKDEV_CON_ID("msiof0", &mstp_clks[HWBLK_MSIOF0]),
326 CLKDEV_DEV_ID("spi_sh_msiof.1", &mstp_clks[HWBLK_MSIOF1]), 310 CLKDEV_CON_ID("msiof1", &mstp_clks[HWBLK_MSIOF1]),
327 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[HWBLK_KEYSC]), 311 CLKDEV_CON_ID("keysc0", &mstp_clks[HWBLK_KEYSC]),
328 CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]), 312 CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]),
329 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC0]), 313 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC0]),
330 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[HWBLK_IIC1]), 314 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[HWBLK_IIC1]),
331 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[HWBLK_MMC]), 315 CLKDEV_CON_ID("mmc0", &mstp_clks[HWBLK_MMC]),
332 CLKDEV_DEV_ID("sh-eth.0", &mstp_clks[HWBLK_ETHER]), 316 CLKDEV_CON_ID("eth0", &mstp_clks[HWBLK_ETHER]),
333 CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]), 317 CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]),
334 CLKDEV_CON_ID("tpu0", &mstp_clks[HWBLK_TPU]), 318 CLKDEV_CON_ID("tpu0", &mstp_clks[HWBLK_TPU]),
335 CLKDEV_CON_ID("irda0", &mstp_clks[HWBLK_IRDA]), 319 CLKDEV_CON_ID("irda0", &mstp_clks[HWBLK_IRDA]),
336 CLKDEV_CON_ID("tsif0", &mstp_clks[HWBLK_TSIF]), 320 CLKDEV_CON_ID("tsif0", &mstp_clks[HWBLK_TSIF]),
337 CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[HWBLK_USB1]), 321 CLKDEV_CON_ID("usb1", &mstp_clks[HWBLK_USB1]),
338 CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[HWBLK_USB0]), 322 CLKDEV_CON_ID("usb0", &mstp_clks[HWBLK_USB0]),
339 CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]), 323 CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]),
340 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[HWBLK_SDHI0]), 324 CLKDEV_CON_ID("sdhi0", &mstp_clks[HWBLK_SDHI0]),
341 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[HWBLK_SDHI1]), 325 CLKDEV_CON_ID("sdhi1", &mstp_clks[HWBLK_SDHI1]),
342 CLKDEV_CON_ID("veu1", &mstp_clks[HWBLK_VEU1]), 326 CLKDEV_CON_ID("veu1", &mstp_clks[HWBLK_VEU1]),
343 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[HWBLK_CEU1]), 327 CLKDEV_CON_ID("ceu1", &mstp_clks[HWBLK_CEU1]),
344 CLKDEV_CON_ID("beu1", &mstp_clks[HWBLK_BEU1]), 328 CLKDEV_CON_ID("beu1", &mstp_clks[HWBLK_BEU1]),
345 CLKDEV_CON_ID("2ddmac0", &mstp_clks[HWBLK_2DDMAC]), 329 CLKDEV_CON_ID("2ddmac0", &mstp_clks[HWBLK_2DDMAC]),
346 CLKDEV_DEV_ID("sh_fsi.0", &mstp_clks[HWBLK_SPU]), 330 CLKDEV_CON_ID("spu0", &mstp_clks[HWBLK_SPU]),
347 CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]), 331 CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]),
348 CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]), 332 CLKDEV_CON_ID("vou0", &mstp_clks[HWBLK_VOU]),
349 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU0]), 333 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU0]),
350 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[HWBLK_CEU0]), 334 CLKDEV_CON_ID("ceu0", &mstp_clks[HWBLK_CEU0]),
351 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU0]), 335 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU0]),
352 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]), 336 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]),
353 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[HWBLK_LCDC]), 337 CLKDEV_CON_ID("lcdc0", &mstp_clks[HWBLK_LCDC]),
354}; 338};
355 339
356int __init arch_clk_init(void) 340int __init arch_clk_init(void)
@@ -372,10 +356,13 @@ int __init arch_clk_init(void)
372 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); 356 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
373 357
374 if (!ret) 358 if (!ret)
375 ret = sh_clk_div6_reparent_register(div6_clks, DIV6_NR); 359 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
360
361 if (!ret)
362 ret = sh_clk_div6_reparent_register(div6_reparent_clks, DIV6_REPARENT_NR);
376 363
377 if (!ret) 364 if (!ret)
378 ret = sh_clk_mstp_register(mstp_clks, HWBLK_NR); 365 ret = sh_hwblk_clk_register(mstp_clks, HWBLK_NR);
379 366
380 return ret; 367 return ret;
381} 368}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
deleted file mode 100644
index deb683abacf..00000000000
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
+++ /dev/null
@@ -1,266 +0,0 @@
1/*
2 * arch/sh/kernel/cpu/sh4a/clock-sh7734.c
3 *
4 * Clock framework for SH7734
5 *
6 * Copyright (C) 2011, 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
7 * Copyright (C) 2011, 2012 Renesas Solutions Corp.
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive
11 * for more details.
12 */
13
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/io.h>
17#include <linux/clkdev.h>
18#include <linux/delay.h>
19#include <asm/clock.h>
20#include <asm/freq.h>
21
22static struct clk extal_clk = {
23 .rate = 33333333,
24};
25
26#define MODEMR (0xFFCC0020)
27#define MODEMR_MASK (0x6)
28#define MODEMR_533MHZ (0x2)
29
30static unsigned long pll_recalc(struct clk *clk)
31{
32 int mode = 12;
33 u32 r = __raw_readl(MODEMR);
34
35 if ((r & MODEMR_MASK) & MODEMR_533MHZ)
36 mode = 16;
37
38 return clk->parent->rate * mode;
39}
40
41static struct sh_clk_ops pll_clk_ops = {
42 .recalc = pll_recalc,
43};
44
45static struct clk pll_clk = {
46 .ops = &pll_clk_ops,
47 .parent = &extal_clk,
48 .flags = CLK_ENABLE_ON_INIT,
49};
50
51static struct clk *main_clks[] = {
52 &extal_clk,
53 &pll_clk,
54};
55
56static int multipliers[] = { 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
57static int divisors[] = { 1, 3, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24 };
58
59static struct clk_div_mult_table div4_div_mult_table = {
60 .divisors = divisors,
61 .nr_divisors = ARRAY_SIZE(divisors),
62 .multipliers = multipliers,
63 .nr_multipliers = ARRAY_SIZE(multipliers),
64};
65
66static struct clk_div4_table div4_table = {
67 .div_mult_table = &div4_div_mult_table,
68};
69
70enum { DIV4_I, DIV4_S, DIV4_B, DIV4_M, DIV4_S1, DIV4_P, DIV4_NR };
71
72#define DIV4(_reg, _bit, _mask, _flags) \
73 SH_CLK_DIV4(&pll_clk, _reg, _bit, _mask, _flags)
74
75struct clk div4_clks[DIV4_NR] = {
76 [DIV4_I] = DIV4(FRQMR1, 28, 0x0003, CLK_ENABLE_ON_INIT),
77 [DIV4_S] = DIV4(FRQMR1, 20, 0x000C, CLK_ENABLE_ON_INIT),
78 [DIV4_B] = DIV4(FRQMR1, 16, 0x0140, CLK_ENABLE_ON_INIT),
79 [DIV4_M] = DIV4(FRQMR1, 12, 0x0004, CLK_ENABLE_ON_INIT),
80 [DIV4_S1] = DIV4(FRQMR1, 4, 0x0030, CLK_ENABLE_ON_INIT),
81 [DIV4_P] = DIV4(FRQMR1, 0, 0x0140, CLK_ENABLE_ON_INIT),
82};
83
84#define MSTPCR0 0xFFC80030
85#define MSTPCR1 0xFFC80034
86#define MSTPCR3 0xFFC8003C
87
88enum {
89 MSTP030, MSTP029, /* IIC */
90 MSTP026, MSTP025, MSTP024, /* SCIF */
91 MSTP023,
92 MSTP022, MSTP021,
93 MSTP019, /* HSCIF */
94 MSTP016, MSTP015, MSTP014, /* TMU / TIMER */
95 MSTP012, MSTP011, MSTP010, MSTP009, MSTP008, /* SSI */
96 MSTP007, /* HSPI */
97 MSTP115, /* ADMAC */
98 MSTP114, /* GETHER */
99 MSTP111, /* DMAC */
100 MSTP109, /* VIDEOIN1 */
101 MSTP108, /* VIDEOIN0 */
102 MSTP107, /* RGPVBG */
103 MSTP106, /* 2DG */
104 MSTP103, /* VIEW */
105 MSTP100, /* USB */
106 MSTP331, /* MMC */
107 MSTP330, /* MIMLB */
108 MSTP323, /* SDHI0 */
109 MSTP322, /* SDHI1 */
110 MSTP321, /* SDHI2 */
111 MSTP320, /* RQSPI */
112 MSTP319, /* SRC0 */
113 MSTP318, /* SRC1 */
114 MSTP317, /* RSPI */
115 MSTP316, /* RCAN0 */
116 MSTP315, /* RCAN1 */
117 MSTP314, /* FLTCL */
118 MSTP313, /* ADC */
119 MSTP312, /* MTU */
120 MSTP304, /* IE-BUS */
121 MSTP303, /* RTC */
122 MSTP302, /* HIF */
123 MSTP301, /* STIF0 */
124 MSTP300, /* STIF1 */
125 MSTP_NR };
126
127static struct clk mstp_clks[MSTP_NR] = {
128 /* MSTPCR0 */
129 [MSTP030] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 30, 0),
130 [MSTP029] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 29, 0),
131 [MSTP026] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 26, 0),
132 [MSTP025] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 25, 0),
133 [MSTP024] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 24, 0),
134 [MSTP023] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 23, 0),
135 [MSTP022] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 22, 0),
136 [MSTP021] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 21, 0),
137 [MSTP019] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 19, 0),
138 [MSTP016] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 16, 0),
139 [MSTP015] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 15, 0),
140 [MSTP014] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 14, 0),
141 [MSTP012] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 12, 0),
142 [MSTP011] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 11, 0),
143 [MSTP010] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 10, 0),
144 [MSTP009] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 9, 0),
145 [MSTP008] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 8, 0),
146 [MSTP007] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 7, 0),
147
148 /* MSTPCR1 */
149 [MSTP115] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 15, 0),
150 [MSTP114] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 14, 0),
151 [MSTP111] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 11, 0),
152 [MSTP109] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 9, 0),
153 [MSTP108] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 8, 0),
154 [MSTP107] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 7, 0),
155 [MSTP106] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 6, 0),
156 [MSTP103] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 3, 0),
157 [MSTP100] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 0, 0),
158
159 /* MSTPCR3 */
160 [MSTP331] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 31, 0),
161 [MSTP330] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 30, 0),
162 [MSTP323] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 23, 0),
163 [MSTP322] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 22, 0),
164 [MSTP321] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 21, 0),
165 [MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 20, 0),
166 [MSTP319] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 19, 0),
167 [MSTP318] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 18, 0),
168 [MSTP317] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 17, 0),
169 [MSTP316] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 16, 0),
170 [MSTP315] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 15, 0),
171 [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 14, 0),
172 [MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 13, 0),
173 [MSTP312] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 12, 0),
174 [MSTP304] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 4, 0),
175 [MSTP303] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 3, 0),
176 [MSTP302] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 2, 0),
177 [MSTP301] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 1, 0),
178 [MSTP300] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 0, 0),
179};
180
181static struct clk_lookup lookups[] = {
182 /* main clocks */
183 CLKDEV_CON_ID("extal", &extal_clk),
184 CLKDEV_CON_ID("pll_clk", &pll_clk),
185
186 /* clocks */
187 CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
188 CLKDEV_CON_ID("shyway_clk", &div4_clks[DIV4_S]),
189 CLKDEV_CON_ID("ddr_clk", &div4_clks[DIV4_M]),
190 CLKDEV_CON_ID("bus_clk", &div4_clks[DIV4_B]),
191 CLKDEV_CON_ID("shyway_clk1", &div4_clks[DIV4_S1]),
192 CLKDEV_CON_ID("peripheral_clk", &div4_clks[DIV4_P]),
193
194 /* MSTP32 clocks */
195 CLKDEV_DEV_ID("i2c-sh7734.0", &mstp_clks[MSTP030]),
196 CLKDEV_DEV_ID("i2c-sh7734.1", &mstp_clks[MSTP029]),
197 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP026]),
198 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP025]),
199 CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP024]),
200 CLKDEV_ICK_ID("sci_fck", "sh-sci.3", &mstp_clks[MSTP023]),
201 CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[MSTP022]),
202 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP021]),
203 CLKDEV_CON_ID("hscif", &mstp_clks[MSTP019]),
204 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP016]),
205 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP016]),
206 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP016]),
207 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP015]),
208 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP015]),
209 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP015]),
210 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.6", &mstp_clks[MSTP014]),
211 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.7", &mstp_clks[MSTP014]),
212 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.8", &mstp_clks[MSTP014]),
213 CLKDEV_CON_ID("ssi0", &mstp_clks[MSTP012]),
214 CLKDEV_CON_ID("ssi1", &mstp_clks[MSTP011]),
215 CLKDEV_CON_ID("ssi2", &mstp_clks[MSTP010]),
216 CLKDEV_CON_ID("ssi3", &mstp_clks[MSTP009]),
217 CLKDEV_CON_ID("sss", &mstp_clks[MSTP008]),
218 CLKDEV_CON_ID("hspi", &mstp_clks[MSTP007]),
219 CLKDEV_CON_ID("usb_fck", &mstp_clks[MSTP100]),
220 CLKDEV_CON_ID("videoin0", &mstp_clks[MSTP109]),
221 CLKDEV_CON_ID("videoin1", &mstp_clks[MSTP108]),
222 CLKDEV_CON_ID("rgpvg", &mstp_clks[MSTP107]),
223 CLKDEV_CON_ID("2dg", &mstp_clks[MSTP106]),
224 CLKDEV_CON_ID("view", &mstp_clks[MSTP103]),
225
226 CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP331]),
227 CLKDEV_CON_ID("mimlb0", &mstp_clks[MSTP330]),
228 CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP323]),
229 CLKDEV_CON_ID("sdhi1", &mstp_clks[MSTP322]),
230 CLKDEV_CON_ID("sdhi2", &mstp_clks[MSTP321]),
231 CLKDEV_CON_ID("rqspi0", &mstp_clks[MSTP320]),
232 CLKDEV_CON_ID("src0", &mstp_clks[MSTP319]),
233 CLKDEV_CON_ID("src1", &mstp_clks[MSTP318]),
234 CLKDEV_CON_ID("rsp0", &mstp_clks[MSTP317]),
235 CLKDEV_CON_ID("rcan0", &mstp_clks[MSTP316]),
236 CLKDEV_CON_ID("rcan1", &mstp_clks[MSTP315]),
237 CLKDEV_CON_ID("fltcl0", &mstp_clks[MSTP314]),
238 CLKDEV_CON_ID("adc0", &mstp_clks[MSTP313]),
239 CLKDEV_CON_ID("mtu0", &mstp_clks[MSTP312]),
240 CLKDEV_CON_ID("iebus0", &mstp_clks[MSTP304]),
241 CLKDEV_DEV_ID("sh-eth.0", &mstp_clks[MSTP114]),
242 CLKDEV_CON_ID("rtc0", &mstp_clks[MSTP303]),
243 CLKDEV_CON_ID("hif0", &mstp_clks[MSTP302]),
244 CLKDEV_CON_ID("stif0", &mstp_clks[MSTP301]),
245 CLKDEV_CON_ID("stif1", &mstp_clks[MSTP300]),
246};
247
248int __init arch_clk_init(void)
249{
250 int i, ret = 0;
251
252 for (i = 0; i < ARRAY_SIZE(main_clks); i++)
253 ret |= clk_register(main_clks[i]);
254
255 for (i = 0; i < ARRAY_SIZE(lookups); i++)
256 clkdev_add(&lookups[i]);
257
258 if (!ret)
259 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
260 &div4_table);
261
262 if (!ret)
263 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
264
265 return ret;
266}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
index e84a43229b9..3b097b09a3b 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
@@ -33,7 +33,7 @@ static unsigned long pll_recalc(struct clk *clk)
33 return clk->parent->rate * multiplier; 33 return clk->parent->rate * multiplier;
34} 34}
35 35
36static struct sh_clk_ops pll_clk_ops = { 36static struct clk_ops pll_clk_ops = {
37 .recalc = pll_recalc, 37 .recalc = pll_recalc,
38}; 38};
39 39
@@ -79,7 +79,7 @@ struct clk div4_clks[DIV4_NR] = {
79#define MSTPCR1 0xffc80034 79#define MSTPCR1 0xffc80034
80#define MSTPCR2 0xffc10028 80#define MSTPCR2 0xffc10028
81 81
82enum { MSTP004, MSTP000, MSTP127, MSTP114, MSTP113, MSTP112, 82enum { MSTP004, MSTP000, MSTP114, MSTP113, MSTP112,
83 MSTP111, MSTP110, MSTP103, MSTP102, MSTP220, 83 MSTP111, MSTP110, MSTP103, MSTP102, MSTP220,
84 MSTP_NR }; 84 MSTP_NR };
85 85
@@ -89,7 +89,6 @@ static struct clk mstp_clks[MSTP_NR] = {
89 [MSTP000] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 0, 0), 89 [MSTP000] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 0, 0),
90 90
91 /* MSTPCR1 */ 91 /* MSTPCR1 */
92 [MSTP127] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 27, 0),
93 [MSTP114] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 14, 0), 92 [MSTP114] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 14, 0),
94 [MSTP113] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 13, 0), 93 [MSTP113] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 13, 0),
95 [MSTP112] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 12, 0), 94 [MSTP112] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 12, 0),
@@ -113,15 +112,8 @@ static struct clk_lookup lookups[] = {
113 CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), 112 CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
114 113
115 /* MSTP32 clocks */ 114 /* MSTP32 clocks */
116 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP004]), 115 CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP004]),
117 CLKDEV_CON_ID("riic0", &mstp_clks[MSTP000]), 116 CLKDEV_CON_ID("riic", &mstp_clks[MSTP000]),
118 CLKDEV_CON_ID("riic1", &mstp_clks[MSTP000]),
119 CLKDEV_CON_ID("riic2", &mstp_clks[MSTP000]),
120 CLKDEV_CON_ID("riic3", &mstp_clks[MSTP000]),
121 CLKDEV_CON_ID("riic4", &mstp_clks[MSTP000]),
122 CLKDEV_CON_ID("riic5", &mstp_clks[MSTP000]),
123 CLKDEV_CON_ID("riic6", &mstp_clks[MSTP000]),
124 CLKDEV_CON_ID("riic7", &mstp_clks[MSTP000]),
125 117
126 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP113]), 118 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP113]),
127 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP114]), 119 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP114]),
@@ -129,10 +121,8 @@ static struct clk_lookup lookups[] = {
129 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]), 121 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]),
130 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]), 122 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]),
131 123
132 CLKDEV_CON_ID("usb_fck", &mstp_clks[MSTP103]), 124 CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]),
133 CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP102]),
134 CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]), 125 CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]),
135 CLKDEV_CON_ID("rspi2", &mstp_clks[MSTP127]),
136}; 126};
137 127
138int __init arch_clk_init(void) 128int __init arch_clk_init(void)
@@ -148,7 +138,7 @@ int __init arch_clk_init(void)
148 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), 138 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
149 &div4_table); 139 &div4_table);
150 if (!ret) 140 if (!ret)
151 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 141 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
152 142
153 return ret; 143 return ret;
154} 144}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7763.c b/arch/sh/kernel/cpu/sh4a/clock-sh7763.c
index 7707e35aea4..2d4c7fd79c0 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7763.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7763.c
@@ -27,7 +27,7 @@ static void master_clk_init(struct clk *clk)
27 clk->rate *= p0fc_divisors[(__raw_readl(FRQCR) >> 4) & 0x07]; 27 clk->rate *= p0fc_divisors[(__raw_readl(FRQCR) >> 4) & 0x07];
28} 28}
29 29
30static struct sh_clk_ops sh7763_master_clk_ops = { 30static struct clk_ops sh7763_master_clk_ops = {
31 .init = master_clk_init, 31 .init = master_clk_init,
32}; 32};
33 33
@@ -37,7 +37,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
37 return clk->parent->rate / p0fc_divisors[idx]; 37 return clk->parent->rate / p0fc_divisors[idx];
38} 38}
39 39
40static struct sh_clk_ops sh7763_module_clk_ops = { 40static struct clk_ops sh7763_module_clk_ops = {
41 .recalc = module_clk_recalc, 41 .recalc = module_clk_recalc,
42}; 42};
43 43
@@ -47,22 +47,22 @@ static unsigned long bus_clk_recalc(struct clk *clk)
47 return clk->parent->rate / bfc_divisors[idx]; 47 return clk->parent->rate / bfc_divisors[idx];
48} 48}
49 49
50static struct sh_clk_ops sh7763_bus_clk_ops = { 50static struct clk_ops sh7763_bus_clk_ops = {
51 .recalc = bus_clk_recalc, 51 .recalc = bus_clk_recalc,
52}; 52};
53 53
54static struct sh_clk_ops sh7763_cpu_clk_ops = { 54static struct clk_ops sh7763_cpu_clk_ops = {
55 .recalc = followparent_recalc, 55 .recalc = followparent_recalc,
56}; 56};
57 57
58static struct sh_clk_ops *sh7763_clk_ops[] = { 58static struct clk_ops *sh7763_clk_ops[] = {
59 &sh7763_master_clk_ops, 59 &sh7763_master_clk_ops,
60 &sh7763_module_clk_ops, 60 &sh7763_module_clk_ops,
61 &sh7763_bus_clk_ops, 61 &sh7763_bus_clk_ops,
62 &sh7763_cpu_clk_ops, 62 &sh7763_cpu_clk_ops,
63}; 63};
64 64
65void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 65void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
66{ 66{
67 if (idx < ARRAY_SIZE(sh7763_clk_ops)) 67 if (idx < ARRAY_SIZE(sh7763_clk_ops))
68 *ops = sh7763_clk_ops[idx]; 68 *ops = sh7763_clk_ops[idx];
@@ -74,7 +74,7 @@ static unsigned long shyway_clk_recalc(struct clk *clk)
74 return clk->parent->rate / cfc_divisors[idx]; 74 return clk->parent->rate / cfc_divisors[idx];
75} 75}
76 76
77static struct sh_clk_ops sh7763_shyway_clk_ops = { 77static struct clk_ops sh7763_shyway_clk_ops = {
78 .recalc = shyway_clk_recalc, 78 .recalc = shyway_clk_recalc,
79}; 79};
80 80
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7770.c b/arch/sh/kernel/cpu/sh4a/clock-sh7770.c
index 5d36f334bb0..9e3354365d4 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7770.c
@@ -24,7 +24,7 @@ static void master_clk_init(struct clk *clk)
24 clk->rate *= pfc_divisors[(__raw_readl(FRQCR) >> 28) & 0x000f]; 24 clk->rate *= pfc_divisors[(__raw_readl(FRQCR) >> 28) & 0x000f];
25} 25}
26 26
27static struct sh_clk_ops sh7770_master_clk_ops = { 27static struct clk_ops sh7770_master_clk_ops = {
28 .init = master_clk_init, 28 .init = master_clk_init,
29}; 29};
30 30
@@ -34,7 +34,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
34 return clk->parent->rate / pfc_divisors[idx]; 34 return clk->parent->rate / pfc_divisors[idx];
35} 35}
36 36
37static struct sh_clk_ops sh7770_module_clk_ops = { 37static struct clk_ops sh7770_module_clk_ops = {
38 .recalc = module_clk_recalc, 38 .recalc = module_clk_recalc,
39}; 39};
40 40
@@ -44,7 +44,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
44 return clk->parent->rate / bfc_divisors[idx]; 44 return clk->parent->rate / bfc_divisors[idx];
45} 45}
46 46
47static struct sh_clk_ops sh7770_bus_clk_ops = { 47static struct clk_ops sh7770_bus_clk_ops = {
48 .recalc = bus_clk_recalc, 48 .recalc = bus_clk_recalc,
49}; 49};
50 50
@@ -54,18 +54,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
54 return clk->parent->rate / ifc_divisors[idx]; 54 return clk->parent->rate / ifc_divisors[idx];
55} 55}
56 56
57static struct sh_clk_ops sh7770_cpu_clk_ops = { 57static struct clk_ops sh7770_cpu_clk_ops = {
58 .recalc = cpu_clk_recalc, 58 .recalc = cpu_clk_recalc,
59}; 59};
60 60
61static struct sh_clk_ops *sh7770_clk_ops[] = { 61static struct clk_ops *sh7770_clk_ops[] = {
62 &sh7770_master_clk_ops, 62 &sh7770_master_clk_ops,
63 &sh7770_module_clk_ops, 63 &sh7770_module_clk_ops,
64 &sh7770_bus_clk_ops, 64 &sh7770_bus_clk_ops,
65 &sh7770_cpu_clk_ops, 65 &sh7770_cpu_clk_ops,
66}; 66};
67 67
68void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 68void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
69{ 69{
70 if (idx < ARRAY_SIZE(sh7770_clk_ops)) 70 if (idx < ARRAY_SIZE(sh7770_clk_ops))
71 *ops = sh7770_clk_ops[idx]; 71 *ops = sh7770_clk_ops[idx];
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7780.c b/arch/sh/kernel/cpu/sh4a/clock-sh7780.c
index 793dae42a2f..3b53348fe2f 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7780.c
@@ -27,7 +27,7 @@ static void master_clk_init(struct clk *clk)
27 clk->rate *= pfc_divisors[__raw_readl(FRQCR) & 0x0003]; 27 clk->rate *= pfc_divisors[__raw_readl(FRQCR) & 0x0003];
28} 28}
29 29
30static struct sh_clk_ops sh7780_master_clk_ops = { 30static struct clk_ops sh7780_master_clk_ops = {
31 .init = master_clk_init, 31 .init = master_clk_init,
32}; 32};
33 33
@@ -37,7 +37,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
37 return clk->parent->rate / pfc_divisors[idx]; 37 return clk->parent->rate / pfc_divisors[idx];
38} 38}
39 39
40static struct sh_clk_ops sh7780_module_clk_ops = { 40static struct clk_ops sh7780_module_clk_ops = {
41 .recalc = module_clk_recalc, 41 .recalc = module_clk_recalc,
42}; 42};
43 43
@@ -47,7 +47,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
47 return clk->parent->rate / bfc_divisors[idx]; 47 return clk->parent->rate / bfc_divisors[idx];
48} 48}
49 49
50static struct sh_clk_ops sh7780_bus_clk_ops = { 50static struct clk_ops sh7780_bus_clk_ops = {
51 .recalc = bus_clk_recalc, 51 .recalc = bus_clk_recalc,
52}; 52};
53 53
@@ -57,18 +57,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
57 return clk->parent->rate / ifc_divisors[idx]; 57 return clk->parent->rate / ifc_divisors[idx];
58} 58}
59 59
60static struct sh_clk_ops sh7780_cpu_clk_ops = { 60static struct clk_ops sh7780_cpu_clk_ops = {
61 .recalc = cpu_clk_recalc, 61 .recalc = cpu_clk_recalc,
62}; 62};
63 63
64static struct sh_clk_ops *sh7780_clk_ops[] = { 64static struct clk_ops *sh7780_clk_ops[] = {
65 &sh7780_master_clk_ops, 65 &sh7780_master_clk_ops,
66 &sh7780_module_clk_ops, 66 &sh7780_module_clk_ops,
67 &sh7780_bus_clk_ops, 67 &sh7780_bus_clk_ops,
68 &sh7780_cpu_clk_ops, 68 &sh7780_cpu_clk_ops,
69}; 69};
70 70
71void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 71void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
72{ 72{
73 if (idx < ARRAY_SIZE(sh7780_clk_ops)) 73 if (idx < ARRAY_SIZE(sh7780_clk_ops))
74 *ops = sh7780_clk_ops[idx]; 74 *ops = sh7780_clk_ops[idx];
@@ -80,7 +80,7 @@ static unsigned long shyway_clk_recalc(struct clk *clk)
80 return clk->parent->rate / cfc_divisors[idx]; 80 return clk->parent->rate / cfc_divisors[idx];
81} 81}
82 82
83static struct sh_clk_ops sh7780_shyway_clk_ops = { 83static struct clk_ops sh7780_shyway_clk_ops = {
84 .recalc = shyway_clk_recalc, 84 .recalc = shyway_clk_recalc,
85}; 85};
86 86
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
index 1c83788db76..e5b420cc126 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
@@ -36,7 +36,7 @@ static unsigned long pll_recalc(struct clk *clk)
36 return clk->parent->rate * multiplier; 36 return clk->parent->rate * multiplier;
37} 37}
38 38
39static struct sh_clk_ops pll_clk_ops = { 39static struct clk_ops pll_clk_ops = {
40 .recalc = pll_recalc, 40 .recalc = pll_recalc,
41}; 41};
42 42
@@ -156,7 +156,7 @@ static struct clk_lookup lookups[] = {
156 CLKDEV_CON_ID("siof_fck", &mstp_clks[MSTP003]), 156 CLKDEV_CON_ID("siof_fck", &mstp_clks[MSTP003]),
157 CLKDEV_CON_ID("hspi_fck", &mstp_clks[MSTP002]), 157 CLKDEV_CON_ID("hspi_fck", &mstp_clks[MSTP002]),
158 CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]), 158 CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]),
159 CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP117]), 159 CLKDEV_CON_ID("ubc_fck", &mstp_clks[MSTP117]),
160 CLKDEV_CON_ID("dmac_11_6_fck", &mstp_clks[MSTP105]), 160 CLKDEV_CON_ID("dmac_11_6_fck", &mstp_clks[MSTP105]),
161 CLKDEV_CON_ID("dmac_5_0_fck", &mstp_clks[MSTP104]), 161 CLKDEV_CON_ID("dmac_5_0_fck", &mstp_clks[MSTP104]),
162 CLKDEV_CON_ID("gdta_fck", &mstp_clks[MSTP100]), 162 CLKDEV_CON_ID("gdta_fck", &mstp_clks[MSTP100]),
@@ -175,7 +175,7 @@ int __init arch_clk_init(void)
175 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), 175 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
176 &div4_table); 176 &div4_table);
177 if (!ret) 177 if (!ret)
178 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 178 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
179 179
180 return ret; 180 return ret;
181} 181}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
index 8bba6f15902..f6c0c3d5599 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
@@ -38,7 +38,7 @@ static unsigned long pll_recalc(struct clk *clk)
38 return clk->parent->rate * multiplier; 38 return clk->parent->rate * multiplier;
39} 39}
40 40
41static struct sh_clk_ops pll_clk_ops = { 41static struct clk_ops pll_clk_ops = {
42 .recalc = pll_recalc, 42 .recalc = pll_recalc,
43}; 43};
44 44
@@ -194,7 +194,7 @@ int __init arch_clk_init(void)
194 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), 194 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
195 &div4_table); 195 &div4_table);
196 if (!ret) 196 if (!ret)
197 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 197 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
198 198
199 return ret; 199 return ret;
200} 200}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-shx3.c b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
index a9422dab0ce..bf2d00b8b90 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
@@ -32,7 +32,7 @@ static unsigned long pll_recalc(struct clk *clk)
32 return clk->parent->rate * 72; 32 return clk->parent->rate * 72;
33} 33}
34 34
35static struct sh_clk_ops pll_clk_ops = { 35static struct clk_ops pll_clk_ops = {
36 .recalc = pll_recalc, 36 .recalc = pll_recalc,
37}; 37};
38 38
@@ -149,7 +149,7 @@ int __init arch_clk_init(void)
149 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), 149 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
150 &div4_table); 150 &div4_table);
151 if (!ret) 151 if (!ret)
152 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 152 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
153 153
154 return ret; 154 return ret;
155} 155}
diff --git a/arch/sh/kernel/cpu/sh4a/pinmux-sh7734.c b/arch/sh/kernel/cpu/sh4a/pinmux-sh7734.c
deleted file mode 100644
index eed3b9d19d3..00000000000
--- a/arch/sh/kernel/cpu/sh4a/pinmux-sh7734.c
+++ /dev/null
@@ -1,2497 +0,0 @@
1/*
2 * SH7734 processor support - PFC hardware block
3 *
4 * Copyright (C) 2012 Renesas Solutions Corp.
5 * Copyright (C) 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/gpio.h>
14#include <linux/ioport.h>
15#include <cpu/sh7734.h>
16
17#define CPU_32_PORT(fn, pfx, sfx) \
18 PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx), \
19 PORT_10(fn, pfx##2, sfx), PORT_1(fn, pfx##30, sfx), \
20 PORT_1(fn, pfx##31, sfx)
21
22#define CPU_32_PORT5(fn, pfx, sfx) \
23 PORT_1(fn, pfx##0, sfx), PORT_1(fn, pfx##1, sfx), \
24 PORT_1(fn, pfx##2, sfx), PORT_1(fn, pfx##3, sfx), \
25 PORT_1(fn, pfx##4, sfx), PORT_1(fn, pfx##5, sfx), \
26 PORT_1(fn, pfx##6, sfx), PORT_1(fn, pfx##7, sfx), \
27 PORT_1(fn, pfx##8, sfx), PORT_1(fn, pfx##9, sfx), \
28 PORT_1(fn, pfx##10, sfx), PORT_1(fn, pfx##11, sfx)
29
30/* GPSR0 - GPSR5 */
31#define CPU_ALL_PORT(fn, pfx, sfx) \
32 CPU_32_PORT(fn, pfx##_0_, sfx), \
33 CPU_32_PORT(fn, pfx##_1_, sfx), \
34 CPU_32_PORT(fn, pfx##_2_, sfx), \
35 CPU_32_PORT(fn, pfx##_3_, sfx), \
36 CPU_32_PORT(fn, pfx##_4_, sfx), \
37 CPU_32_PORT5(fn, pfx##_5_, sfx)
38
39#define _GP_GPIO(pfx, sfx) PINMUX_GPIO(GPIO_GP##pfx, GP##pfx##_DATA)
40#define _GP_DATA(pfx, sfx) PINMUX_DATA(GP##pfx##_DATA, GP##pfx##_FN, \
41 GP##pfx##_IN, GP##pfx##_OUT)
42
43#define _GP_INOUTSEL(pfx, sfx) GP##pfx##_IN, GP##pfx##_OUT
44#define _GP_INDT(pfx, sfx) GP##pfx##_DATA
45
46#define GP_ALL(str) CPU_ALL_PORT(_PORT_ALL, GP, str)
47#define PINMUX_GPIO_GP_ALL() CPU_ALL_PORT(_GP_GPIO, , unused)
48#define PINMUX_DATA_GP_ALL() CPU_ALL_PORT(_GP_DATA, , unused)
49
50#define PORT_10_REV(fn, pfx, sfx) \
51 PORT_1(fn, pfx##9, sfx), PORT_1(fn, pfx##8, sfx), \
52 PORT_1(fn, pfx##7, sfx), PORT_1(fn, pfx##6, sfx), \
53 PORT_1(fn, pfx##5, sfx), PORT_1(fn, pfx##4, sfx), \
54 PORT_1(fn, pfx##3, sfx), PORT_1(fn, pfx##2, sfx), \
55 PORT_1(fn, pfx##1, sfx), PORT_1(fn, pfx##0, sfx)
56
57#define CPU_32_PORT_REV(fn, pfx, sfx) \
58 PORT_1(fn, pfx##31, sfx), PORT_1(fn, pfx##30, sfx), \
59 PORT_10_REV(fn, pfx##2, sfx), PORT_10_REV(fn, pfx##1, sfx), \
60 PORT_10_REV(fn, pfx, sfx)
61
62#define GP_INOUTSEL(bank) CPU_32_PORT_REV(_GP_INOUTSEL, _##bank##_, unused)
63#define GP_INDT(bank) CPU_32_PORT_REV(_GP_INDT, _##bank##_, unused)
64
65#define PINMUX_IPSR_DATA(ipsr, fn) PINMUX_DATA(fn##_MARK, FN_##ipsr, FN_##fn)
66#define PINMUX_IPSR_MODSEL_DATA(ipsr, fn, ms) PINMUX_DATA(fn##_MARK, FN_##ms, \
67 FN_##ipsr, FN_##fn)
68
69enum {
70 PINMUX_RESERVED = 0,
71
72 PINMUX_DATA_BEGIN,
73 GP_ALL(DATA), /* GP_0_0_DATA -> GP_5_11_DATA */
74 PINMUX_DATA_END,
75
76 PINMUX_INPUT_BEGIN,
77 GP_ALL(IN), /* GP_0_0_IN -> GP_5_11_IN */
78 PINMUX_INPUT_END,
79
80 PINMUX_OUTPUT_BEGIN,
81 GP_ALL(OUT), /* GP_0_0_OUT -> GP_5_11_OUT */
82 PINMUX_OUTPUT_END,
83
84 PINMUX_FUNCTION_BEGIN,
85 GP_ALL(FN), /* GP_0_0_FN -> GP_5_11_FN */
86
87 /* GPSR0 */
88 FN_IP1_9_8, FN_IP1_11_10, FN_IP1_13_12, FN_IP1_15_14,
89 FN_IP0_7_6, FN_IP0_9_8, FN_IP0_11_10, FN_IP0_13_12,
90 FN_IP0_15_14, FN_IP0_17_16, FN_IP0_19_18, FN_IP0_21_20,
91 FN_IP0_23_22, FN_IP0_25_24, FN_IP0_27_26, FN_IP0_29_28,
92 FN_IP0_31_30, FN_IP1_1_0, FN_IP1_3_2, FN_IP1_5_4,
93 FN_IP1_7_6, FN_IP11_28, FN_IP0_1_0, FN_IP0_3_2,
94 FN_IP0_5_4, FN_IP1_17_16, FN_IP1_19_18, FN_IP1_22_20,
95 FN_IP1_25_23, FN_IP1_28_26, FN_IP1_31_29, FN_IP2_2_0,
96
97 /* GPSR1 */
98 FN_IP3_20, FN_IP3_29_27, FN_IP11_20_19, FN_IP11_22_21,
99 FN_IP2_16_14, FN_IP2_19_17, FN_IP2_22_20, FN_IP2_24_23,
100 FN_IP2_27_25, FN_IP2_30_28, FN_IP3_1_0, FN_CLKOUT,
101 FN_BS, FN_CS0, FN_IP3_2, FN_EX_CS0,
102 FN_IP3_5_3, FN_IP3_8_6, FN_IP3_11_9, FN_IP3_14_12,
103 FN_IP3_17_15, FN_RD, FN_IP3_19_18, FN_WE0,
104 FN_WE1, FN_IP2_4_3, FN_IP3_23_21, FN_IP3_26_24,
105 FN_IP2_7_5, FN_IP2_10_8, FN_IP2_13_11, FN_IP11_25_23,
106
107 /* GPSR2 */
108 FN_IP11_6_4, FN_IP11_9_7, FN_IP11_11_10, FN_IP4_2_0,
109 FN_IP8_29_28, FN_IP11_27_26, FN_IP8_22_20, FN_IP8_25_23,
110 FN_IP11_12, FN_IP8_27_26, FN_IP4_5_3, FN_IP4_8_6,
111 FN_IP4_11_9, FN_IP4_14_12, FN_IP4_17_15, FN_IP4_19_18,
112 FN_IP4_21_20, FN_IP4_23_22, FN_IP4_25_24, FN_IP4_27_26,
113 FN_IP4_29_28, FN_IP4_31_30, FN_IP5_2_0, FN_IP5_5_3,
114 FN_IP5_8_6, FN_IP5_11_9, FN_IP5_14_12, FN_IP5_17_15,
115 FN_IP5_20_18, FN_IP5_22_21, FN_IP5_24_23, FN_IP5_26_25,
116
117 /* GPSR3 */
118 FN_IP6_2_0, FN_IP6_5_3, FN_IP6_7_6, FN_IP6_9_8,
119 FN_IP6_11_10, FN_IP6_13_12, FN_IP6_15_14, FN_IP6_17_16,
120 FN_IP6_20_18, FN_IP6_23_21, FN_IP7_2_0, FN_IP7_5_3,
121 FN_IP7_8_6, FN_IP7_11_9, FN_IP7_14_12, FN_IP7_17_15,
122 FN_IP7_20_18, FN_IP7_23_21, FN_IP7_26_24, FN_IP7_28_27,
123 FN_IP7_30_29, FN_IP8_1_0, FN_IP8_3_2, FN_IP8_5_4,
124 FN_IP8_7_6, FN_IP8_9_8, FN_IP8_11_10, FN_IP8_13_12,
125 FN_IP8_15_14, FN_IP8_17_16, FN_IP8_19_18, FN_IP9_1_0,
126
127 /* GPSR4 */
128 FN_IP9_19_18, FN_IP9_21_20, FN_IP9_23_22, FN_IP9_25_24,
129 FN_IP9_11_10, FN_IP9_13_12, FN_IP9_15_14, FN_IP9_17_16,
130 FN_IP9_3_2, FN_IP9_5_4, FN_IP9_7_6, FN_IP9_9_8,
131 FN_IP9_27_26, FN_IP9_29_28, FN_IP10_2_0, FN_IP10_5_3,
132 FN_IP10_8_6, FN_IP10_11_9, FN_IP10_14_12, FN_IP10_15,
133 FN_IP10_18_16, FN_IP10_21_19, FN_IP11_0, FN_IP11_1,
134 FN_SCL0, FN_IP11_2, FN_PENC0, FN_IP11_15_13, /* Need check*/
135 FN_USB_OVC0, FN_IP11_18_16,
136 FN_IP10_22, FN_IP10_24_23,
137
138 /* GPSR5 */
139 FN_IP10_25, FN_IP11_3, FN_IRQ2_B, FN_IRQ3_B,
140 FN_IP10_27_26, /* 10 */
141 FN_IP10_29_28, /* 11 */
142
143 /* IPSR0 */
144 FN_A15, FN_ST0_VCO_CLKIN, FN_LCD_DATA15_A, FN_TIOC3D_C,
145 FN_A14, FN_LCD_DATA14_A, FN_TIOC3C_C,
146 FN_A13, FN_LCD_DATA13_A, FN_TIOC3B_C,
147 FN_A12, FN_LCD_DATA12_A, FN_TIOC3A_C,
148 FN_A11, FN_ST0_D7, FN_LCD_DATA11_A, FN_TIOC2B_C,
149 FN_A10, FN_ST0_D6, FN_LCD_DATA10_A, FN_TIOC2A_C,
150 FN_A9, FN_ST0_D5, FN_LCD_DATA9_A, FN_TIOC1B_C,
151 FN_A8, FN_ST0_D4, FN_LCD_DATA8_A, FN_TIOC1A_C,
152 FN_A7, FN_ST0_D3, FN_LCD_DATA7_A, FN_TIOC0D_C,
153 FN_A6, FN_ST0_D2, FN_LCD_DATA6_A, FN_TIOC0C_C,
154 FN_A5, FN_ST0_D1, FN_LCD_DATA5_A, FN_TIOC0B_C,
155 FN_A4, FN_ST0_D0, FN_LCD_DATA4_A, FN_TIOC0A_C,
156 FN_A3, FN_ST0_VLD, FN_LCD_DATA3_A, FN_TCLKD_C,
157 FN_A2, FN_ST0_SYC, FN_LCD_DATA2_A, FN_TCLKC_C,
158 FN_A1, FN_ST0_REQ, FN_LCD_DATA1_A, FN_TCLKB_C,
159 FN_A0, FN_ST0_CLKIN, FN_LCD_DATA0_A, FN_TCLKA_C,
160
161 /* IPSR1 */
162 FN_D3, FN_SD0_DAT3_A, FN_MMC_D3_A, FN_ST1_D6, FN_FD3_A,
163 FN_D2, FN_SD0_DAT2_A, FN_MMC_D2_A, FN_ST1_D5, FN_FD2_A,
164 FN_D1, FN_SD0_DAT1_A, FN_MMC_D1_A, FN_ST1_D4, FN_FD1_A,
165 FN_D0, FN_SD0_DAT0_A, FN_MMC_D0_A, FN_ST1_D3, FN_FD0_A,
166 FN_A25, FN_TX2_D, FN_ST1_D2,
167 FN_A24, FN_RX2_D, FN_ST1_D1,
168 FN_A23, FN_ST1_D0, FN_LCD_M_DISP_A,
169 FN_A22, FN_ST1_VLD, FN_LCD_VEPWC_A,
170 FN_A21, FN_ST1_SYC, FN_LCD_VCPWC_A,
171 FN_A20, FN_ST1_REQ, FN_LCD_FLM_A,
172 FN_A19, FN_ST1_CLKIN, FN_LCD_CLK_A, FN_TIOC4D_C,
173 FN_A18, FN_ST1_PWM, FN_LCD_CL2_A, FN_TIOC4C_C,
174 FN_A17, FN_ST1_VCO_CLKIN, FN_LCD_CL1_A, FN_TIOC4B_C,
175 FN_A16, FN_ST0_PWM, FN_LCD_DON_A, FN_TIOC4A_C,
176
177 /* IPSR2 */
178 FN_D14, FN_TX2_B, FN_FSE_A, FN_ET0_TX_CLK_B,
179 FN_D13, FN_RX2_B, FN_FRB_A, FN_ET0_ETXD6_B,
180 FN_D12, FN_FWE_A, FN_ET0_ETXD5_B,
181 FN_D11, FN_RSPI_MISO_A, FN_QMI_QIO1_A, FN_FRE_A,
182 FN_ET0_ETXD3_B,
183 FN_D10, FN_RSPI_MOSI_A, FN_QMO_QIO0_A, FN_FALE_A,
184 FN_ET0_ETXD2_B,
185 FN_D9, FN_SD0_CMD_A, FN_MMC_CMD_A, FN_QIO3_A, FN_FCLE_A,
186 FN_ET0_ETXD1_B,
187 FN_D8, FN_SD0_CLK_A, FN_MMC_CLK_A, FN_QIO2_A, FN_FCE_A,
188 FN_ET0_GTX_CLK_B,
189 FN_D7, FN_RSPI_SSL_A, FN_MMC_D7_A, FN_QSSL_A, FN_FD7_A,
190 FN_D6, FN_RSPI_RSPCK_A, FN_MMC_D6_A, FN_QSPCLK_A, FN_FD6_A,
191 FN_D5, FN_SD0_WP_A, FN_MMC_D5_A, FN_FD5_A,
192 FN_D4, FN_SD0_CD_A, FN_MMC_D4_A, FN_ST1_D7, FN_FD4_A,
193
194 /* IPSR3 */
195 FN_DRACK0, FN_SD1_DAT2_A, FN_ATAG, FN_TCLK1_A, FN_ET0_ETXD7,
196 FN_EX_WAIT2, FN_SD1_DAT1_A, FN_DACK2, FN_CAN1_RX_C,
197 FN_ET0_MAGIC_C, FN_ET0_ETXD6_A,
198 FN_EX_WAIT1, FN_SD1_DAT0_A, FN_DREQ2, FN_CAN1_TX_C,
199 FN_ET0_LINK_C, FN_ET0_ETXD5_A,
200 FN_EX_WAIT0, FN_TCLK1_B,
201 FN_RD_WR, FN_TCLK0, FN_CAN_CLK_B, FN_ET0_ETXD4,
202 FN_EX_CS5, FN_SD1_CMD_A, FN_ATADIR, FN_QSSL_B, FN_ET0_ETXD3_A,
203 FN_EX_CS4, FN_SD1_WP_A, FN_ATAWR, FN_QMI_QIO1_B, FN_ET0_ETXD2_A,
204 FN_EX_CS3, FN_SD1_CD_A, FN_ATARD, FN_QMO_QIO0_B, FN_ET0_ETXD1_A,
205 FN_EX_CS2, FN_TX3_B, FN_ATACS1, FN_QSPCLK_B, FN_ET0_GTX_CLK_A,
206 FN_EX_CS1, FN_RX3_B, FN_ATACS0, FN_QIO2_B, FN_ET0_ETXD0,
207 FN_CS1_A26, FN_QIO3_B,
208 FN_D15, FN_SCK2_B,
209
210 /* IPSR4 */
211 FN_SCK2_A, FN_VI0_G3,
212 FN_RTS1_B, FN_VI0_G2,
213 FN_CTS1_B, FN_VI0_DATA7_VI0_G1,
214 FN_TX1_B, FN_VI0_DATA6_VI0_G0, FN_ET0_PHY_INT_A,
215 FN_RX1_B, FN_VI0_DATA5_VI0_B5, FN_ET0_MAGIC_A,
216 FN_SCK1_B, FN_VI0_DATA4_VI0_B4, FN_ET0_LINK_A,
217 FN_RTS0_B, FN_VI0_DATA3_VI0_B3, FN_ET0_MDIO_A,
218 FN_CTS0_B, FN_VI0_DATA2_VI0_B2, FN_RMII0_MDIO_A, FN_ET0_MDC,
219 FN_HTX0_A, FN_TX1_A, FN_VI0_DATA1_VI0_B1, FN_RMII0_MDC_A, FN_ET0_COL,
220 FN_HRX0_A, FN_RX1_A, FN_VI0_DATA0_VI0_B0, FN_RMII0_CRS_DV_A, FN_ET0_CRS,
221 FN_HSCK0_A, FN_SCK1_A, FN_VI0_VSYNC, FN_RMII0_RX_ER_A, FN_ET0_RX_ER,
222 FN_HRTS0_A, FN_RTS1_A, FN_VI0_HSYNC, FN_RMII0_TXD_EN_A, FN_ET0_RX_DV,
223 FN_HCTS0_A, FN_CTS1_A, FN_VI0_FIELD, FN_RMII0_RXD1_A, FN_ET0_ERXD7,
224
225 /* IPSR5 */
226 FN_SD2_CLK_A, FN_RX2_A, FN_VI0_G4, FN_ET0_RX_CLK_B,
227 FN_SD2_CMD_A, FN_TX2_A, FN_VI0_G5, FN_ET0_ERXD2_B,
228 FN_SD2_DAT0_A, FN_RX3_A, FN_VI0_R0, FN_ET0_ERXD3_B,
229 FN_SD2_DAT1_A, FN_TX3_A, FN_VI0_R1, FN_ET0_MDIO_B,
230 FN_SD2_DAT2_A, FN_RX4_A, FN_VI0_R2, FN_ET0_LINK_B,
231 FN_SD2_DAT3_A, FN_TX4_A, FN_VI0_R3, FN_ET0_MAGIC_B,
232 FN_SD2_CD_A, FN_RX5_A, FN_VI0_R4, FN_ET0_PHY_INT_B,
233 FN_SD2_WP_A, FN_TX5_A, FN_VI0_R5,
234 FN_REF125CK, FN_ADTRG, FN_RX5_C,
235 FN_REF50CK, FN_CTS1_E, FN_HCTS0_D,
236
237 /* IPSR6 */
238 FN_DU0_DR0, FN_SCIF_CLK_B, FN_HRX0_D, FN_IETX_A, FN_TCLKA_A, FN_HIFD00,
239 FN_DU0_DR1, FN_SCK0_B, FN_HTX0_D, FN_IERX_A, FN_TCLKB_A, FN_HIFD01,
240 FN_DU0_DR2, FN_RX0_B, FN_TCLKC_A, FN_HIFD02,
241 FN_DU0_DR3, FN_TX0_B, FN_TCLKD_A, FN_HIFD03,
242 FN_DU0_DR4, FN_CTS0_C, FN_TIOC0A_A, FN_HIFD04,
243 FN_DU0_DR5, FN_RTS0_C, FN_TIOC0B_A, FN_HIFD05,
244 FN_DU0_DR6, FN_SCK1_C, FN_TIOC0C_A, FN_HIFD06,
245 FN_DU0_DR7, FN_RX1_C, FN_TIOC0D_A, FN_HIFD07,
246 FN_DU0_DG0, FN_TX1_C, FN_HSCK0_D, FN_IECLK_A, FN_TIOC1A_A, FN_HIFD08,
247 FN_DU0_DG1, FN_CTS1_C, FN_HRTS0_D, FN_TIOC1B_A, FN_HIFD09,
248
249 /* IPSR7 */
250 FN_DU0_DG2, FN_RTS1_C, FN_RMII0_MDC_B, FN_TIOC2A_A, FN_HIFD10,
251 FN_DU0_DG3, FN_SCK2_C, FN_RMII0_MDIO_B, FN_TIOC2B_A, FN_HIFD11,
252 FN_DU0_DG4, FN_RX2_C, FN_RMII0_CRS_DV_B, FN_TIOC3A_A, FN_HIFD12,
253 FN_DU0_DG5, FN_TX2_C, FN_RMII0_RX_ER_B, FN_TIOC3B_A, FN_HIFD13,
254 FN_DU0_DG6, FN_RX3_C, FN_RMII0_RXD0_B, FN_TIOC3C_A, FN_HIFD14,
255 FN_DU0_DG7, FN_TX3_C, FN_RMII0_RXD1_B, FN_TIOC3D_A, FN_HIFD15,
256 FN_DU0_DB0, FN_RX4_C, FN_RMII0_TXD_EN_B, FN_TIOC4A_A, FN_HIFCS,
257 FN_DU0_DB1, FN_TX4_C, FN_RMII0_TXD0_B, FN_TIOC4B_A, FN_HIFRS,
258 FN_DU0_DB2, FN_RX5_B, FN_RMII0_TXD1_B, FN_TIOC4C_A, FN_HIFWR,
259 FN_DU0_DB3, FN_TX5_B, FN_TIOC4D_A, FN_HIFRD,
260 FN_DU0_DB4, FN_HIFINT,
261
262 /* IPSR8 */
263 FN_DU0_DB5, FN_HIFDREQ,
264 FN_DU0_DB6, FN_HIFRDY,
265 FN_DU0_DB7, FN_SSI_SCK0_B, FN_HIFEBL_B,
266 FN_DU0_DOTCLKIN, FN_HSPI_CS0_C, FN_SSI_WS0_B,
267 FN_DU0_DOTCLKOUT, FN_HSPI_CLK0_C, FN_SSI_SDATA0_B,
268 FN_DU0_EXHSYNC_DU0_HSYNC, FN_HSPI_TX0_C, FN_SSI_SCK1_B,
269 FN_DU0_EXVSYNC_DU0_VSYNC, FN_HSPI_RX0_C, FN_SSI_WS1_B,
270 FN_DU0_EXODDF_DU0_ODDF, FN_CAN0_RX_B, FN_HSCK0_B, FN_SSI_SDATA1_B,
271 FN_DU0_DISP, FN_CAN0_TX_B, FN_HRX0_B, FN_AUDIO_CLKA_B,
272 FN_DU0_CDE, FN_HTX0_B, FN_AUDIO_CLKB_B, FN_LCD_VCPWC_B,
273 FN_IRQ0_A, FN_HSPI_TX_B, FN_RX3_E, FN_ET0_ERXD0,
274 FN_IRQ1_A, FN_HSPI_RX_B, FN_TX3_E, FN_ET0_ERXD1,
275 FN_IRQ2_A, FN_CTS0_A, FN_HCTS0_B, FN_ET0_ERXD2_A,
276 FN_IRQ3_A, FN_RTS0_A, FN_HRTS0_B, FN_ET0_ERXD3_A,
277
278 /* IPSR9 */
279 FN_VI1_CLK_A, FN_FD0_B, FN_LCD_DATA0_B,
280 FN_VI1_0_A, FN_FD1_B, FN_LCD_DATA1_B,
281 FN_VI1_1_A, FN_FD2_B, FN_LCD_DATA2_B,
282 FN_VI1_2_A, FN_FD3_B, FN_LCD_DATA3_B,
283 FN_VI1_3_A, FN_FD4_B, FN_LCD_DATA4_B,
284 FN_VI1_4_A, FN_FD5_B, FN_LCD_DATA5_B,
285 FN_VI1_5_A, FN_FD6_B, FN_LCD_DATA6_B,
286 FN_VI1_6_A, FN_FD7_B, FN_LCD_DATA7_B,
287 FN_VI1_7_A, FN_FCE_B, FN_LCD_DATA8_B,
288 FN_SSI_SCK0_A, FN_TIOC1A_B, FN_LCD_DATA9_B,
289 FN_SSI_WS0_A, FN_TIOC1B_B, FN_LCD_DATA10_B,
290 FN_SSI_SDATA0_A, FN_VI1_0_B, FN_TIOC2A_B, FN_LCD_DATA11_B,
291 FN_SSI_SCK1_A, FN_VI1_1_B, FN_TIOC2B_B, FN_LCD_DATA12_B,
292 FN_SSI_WS1_A, FN_VI1_2_B, FN_LCD_DATA13_B,
293 FN_SSI_SDATA1_A, FN_VI1_3_B, FN_LCD_DATA14_B,
294
295 /* IPSR10 */
296 FN_SSI_SCK23, FN_VI1_4_B, FN_RX1_D, FN_FCLE_B, FN_LCD_DATA15_B,
297 FN_SSI_WS23, FN_VI1_5_B, FN_TX1_D, FN_HSCK0_C, FN_FALE_B, FN_LCD_DON_B,
298 FN_SSI_SDATA2, FN_VI1_6_B, FN_HRX0_C, FN_FRE_B, FN_LCD_CL1_B,
299 FN_SSI_SDATA3, FN_VI1_7_B, FN_HTX0_C, FN_FWE_B, FN_LCD_CL2_B,
300 FN_AUDIO_CLKA_A, FN_VI1_CLK_B, FN_SCK1_D, FN_IECLK_B, FN_LCD_FLM_B,
301 FN_AUDIO_CLKB_A, FN_LCD_CLK_B,
302 FN_AUDIO_CLKC, FN_SCK1_E, FN_HCTS0_C, FN_FRB_B, FN_LCD_VEPWC_B,
303 FN_AUDIO_CLKOUT, FN_TX1_E, FN_HRTS0_C, FN_FSE_B, FN_LCD_M_DISP_B,
304 FN_CAN_CLK_A, FN_RX4_D,
305 FN_CAN0_TX_A, FN_TX4_D, FN_MLB_CLK,
306 FN_CAN1_RX_A, FN_IRQ1_B,
307 FN_CAN0_RX_A, FN_IRQ0_B, FN_MLB_SIG,
308 FN_CAN1_TX_A, FN_TX5_C, FN_MLB_DAT,
309
310 /* IPSR11 */
311 FN_SCL1, FN_SCIF_CLK_C,
312 FN_SDA1, FN_RX1_E,
313 FN_SDA0, FN_HIFEBL_A,
314 FN_SDSELF, FN_RTS1_E,
315 FN_SCIF_CLK_A, FN_HSPI_CLK_A, FN_VI0_CLK, FN_RMII0_TXD0_A, FN_ET0_ERXD4,
316 FN_SCK0_A, FN_HSPI_CS_A, FN_VI0_CLKENB, FN_RMII0_TXD1_A, FN_ET0_ERXD5,
317 FN_RX0_A, FN_HSPI_RX_A, FN_RMII0_RXD0_A, FN_ET0_ERXD6,
318 FN_TX0_A, FN_HSPI_TX_A,
319 FN_PENC1, FN_TX3_D, FN_CAN1_TX_B, FN_TX5_D, FN_IETX_B,
320 FN_USB_OVC1, FN_RX3_D, FN_CAN1_RX_B, FN_RX5_D, FN_IERX_B,
321 FN_DREQ0, FN_SD1_CLK_A, FN_ET0_TX_EN,
322 FN_DACK0, FN_SD1_DAT3_A, FN_ET0_TX_ER,
323 FN_DREQ1, FN_HSPI_CLK_B, FN_RX4_B, FN_ET0_PHY_INT_C, FN_ET0_TX_CLK_A,
324 FN_DACK1, FN_HSPI_CS_B, FN_TX4_B, FN_ET0_RX_CLK_A,
325 FN_PRESETOUT, FN_ST_CLKOUT,
326
327 /* MOD_SEL1 */
328 FN_SEL_IEBUS_0, FN_SEL_IEBUS_1,
329 FN_SEL_RQSPI_0, FN_SEL_RQSPI_1,
330 FN_SEL_VIN1_0, FN_SEL_VIN1_1,
331 FN_SEL_HIF_0, FN_SEL_HIF_1,
332 FN_SEL_RSPI_0, FN_SEL_RSPI_1,
333 FN_SEL_LCDC_0, FN_SEL_LCDC_1,
334 FN_SEL_ET0_CTL_0, FN_SEL_ET0_CTL_1, FN_SEL_ET0_CTL_2,
335 FN_SEL_ET0_0, FN_SEL_ET0_1,
336 FN_SEL_RMII_0, FN_SEL_RMII_1,
337 FN_SEL_TMU_0, FN_SEL_TMU_1,
338 FN_SEL_HSPI_0, FN_SEL_HSPI_1, FN_SEL_HSPI_2,
339 FN_SEL_HSCIF_0, FN_SEL_HSCIF_1, FN_SEL_HSCIF_2, FN_SEL_HSCIF_3,
340 FN_SEL_RCAN_CLK_0, FN_SEL_RCAN_CLK_1,
341 FN_SEL_RCAN1_0, FN_SEL_RCAN1_1, FN_SEL_RCAN1_2,
342 FN_SEL_RCAN0_0, FN_SEL_RCAN0_1,
343 FN_SEL_SDHI2_0, FN_SEL_SDHI2_1,
344 FN_SEL_SDHI1_0, FN_SEL_SDHI1_1,
345 FN_SEL_SDHI0_0, FN_SEL_SDHI0_1,
346 FN_SEL_SSI1_0, FN_SEL_SSI1_1,
347 FN_SEL_SSI0_0, FN_SEL_SSI0_1,
348 FN_SEL_AUDIO_CLKB_0, FN_SEL_AUDIO_CLKB_1,
349 FN_SEL_AUDIO_CLKA_0, FN_SEL_AUDIO_CLKA_1,
350 FN_SEL_FLCTL_0, FN_SEL_FLCTL_1,
351 FN_SEL_MMC_0, FN_SEL_MMC_1,
352 FN_SEL_INTC_0, FN_SEL_INTC_1,
353
354 /* MOD_SEL2 */
355 FN_SEL_MTU2_CLK_0, FN_SEL_MTU2_CLK_1,
356 FN_SEL_MTU2_CH4_0, FN_SEL_MTU2_CH4_1,
357 FN_SEL_MTU2_CH3_0, FN_SEL_MTU2_CH3_1,
358 FN_SEL_MTU2_CH2_0, FN_SEL_MTU2_CH2_1, FN_SEL_MTU2_CH2_2,
359 FN_SEL_MTU2_CH1_0, FN_SEL_MTU2_CH1_1, FN_SEL_MTU2_CH1_2,
360 FN_SEL_MTU2_CH0_0, FN_SEL_MTU2_CH0_1,
361 FN_SEL_SCIF5_0, FN_SEL_SCIF5_1,
362 FN_SEL_SCIF5_2, FN_SEL_SCIF5_3,
363 FN_SEL_SCIF4_0, FN_SEL_SCIF4_1,
364 FN_SEL_SCIF4_2, FN_SEL_SCIF4_3,
365 FN_SEL_SCIF3_0, FN_SEL_SCIF3_1, FN_SEL_SCIF3_2,
366 FN_SEL_SCIF3_3, FN_SEL_SCIF3_4,
367 FN_SEL_SCIF2_0, FN_SEL_SCIF2_1, FN_SEL_SCIF2_2,
368 FN_SEL_SCIF2_3,
369 FN_SEL_SCIF1_0, FN_SEL_SCIF1_1, FN_SEL_SCIF1_2,
370 FN_SEL_SCIF1_3, FN_SEL_SCIF1_4,
371 FN_SEL_SCIF0_0, FN_SEL_SCIF0_1, FN_SEL_SCIF0_2,
372 FN_SEL_SCIF_CLK_0, FN_SEL_SCIF_CLK_1, FN_SEL_SCIF_CLK_2,
373
374 PINMUX_FUNCTION_END,
375
376 PINMUX_MARK_BEGIN,
377
378 CLKOUT_MARK, BS_MARK, CS0_MARK, EX_CS0_MARK, RD_MARK,
379 WE0_MARK, WE1_MARK,
380
381 SCL0_MARK, PENC0_MARK, USB_OVC0_MARK,
382
383 IRQ2_B_MARK, IRQ3_B_MARK,
384
385 /* IPSR0 */
386 A15_MARK, ST0_VCO_CLKIN_MARK, LCD_DATA15_A_MARK, TIOC3D_C_MARK,
387 A14_MARK, LCD_DATA14_A_MARK, TIOC3C_C_MARK,
388 A13_MARK, LCD_DATA13_A_MARK, TIOC3B_C_MARK,
389 A12_MARK, LCD_DATA12_A_MARK, TIOC3A_C_MARK,
390 A11_MARK, ST0_D7_MARK, LCD_DATA11_A_MARK, TIOC2B_C_MARK,
391 A10_MARK, ST0_D6_MARK, LCD_DATA10_A_MARK, TIOC2A_C_MARK,
392 A9_MARK, ST0_D5_MARK, LCD_DATA9_A_MARK, TIOC1B_C_MARK,
393 A8_MARK, ST0_D4_MARK, LCD_DATA8_A_MARK, TIOC1A_C_MARK,
394 A7_MARK, ST0_D3_MARK, LCD_DATA7_A_MARK, TIOC0D_C_MARK,
395 A6_MARK, ST0_D2_MARK, LCD_DATA6_A_MARK, TIOC0C_C_MARK,
396 A5_MARK, ST0_D1_MARK, LCD_DATA5_A_MARK, TIOC0B_C_MARK,
397 A4_MARK, ST0_D0_MARK, LCD_DATA4_A_MARK, TIOC0A_C_MARK,
398 A3_MARK, ST0_VLD_MARK, LCD_DATA3_A_MARK, TCLKD_C_MARK,
399 A2_MARK, ST0_SYC_MARK, LCD_DATA2_A_MARK, TCLKC_C_MARK,
400 A1_MARK, ST0_REQ_MARK, LCD_DATA1_A_MARK, TCLKB_C_MARK,
401 A0_MARK, ST0_CLKIN_MARK, LCD_DATA0_A_MARK, TCLKA_C_MARK,
402
403 /* IPSR1 */
404 D3_MARK, SD0_DAT3_A_MARK, MMC_D3_A_MARK, ST1_D6_MARK, FD3_A_MARK,
405 D2_MARK, SD0_DAT2_A_MARK, MMC_D2_A_MARK, ST1_D5_MARK, FD2_A_MARK,
406 D1_MARK, SD0_DAT1_A_MARK, MMC_D1_A_MARK, ST1_D4_MARK, FD1_A_MARK,
407 D0_MARK, SD0_DAT0_A_MARK, MMC_D0_A_MARK, ST1_D3_MARK, FD0_A_MARK,
408 A25_MARK, TX2_D_MARK, ST1_D2_MARK,
409 A24_MARK, RX2_D_MARK, ST1_D1_MARK,
410 A23_MARK, ST1_D0_MARK, LCD_M_DISP_A_MARK,
411 A22_MARK, ST1_VLD_MARK, LCD_VEPWC_A_MARK,
412 A21_MARK, ST1_SYC_MARK, LCD_VCPWC_A_MARK,
413 A20_MARK, ST1_REQ_MARK, LCD_FLM_A_MARK,
414 A19_MARK, ST1_CLKIN_MARK, LCD_CLK_A_MARK, TIOC4D_C_MARK,
415 A18_MARK, ST1_PWM_MARK, LCD_CL2_A_MARK, TIOC4C_C_MARK,
416 A17_MARK, ST1_VCO_CLKIN_MARK, LCD_CL1_A_MARK, TIOC4B_C_MARK,
417 A16_MARK, ST0_PWM_MARK, LCD_DON_A_MARK, TIOC4A_C_MARK,
418
419 /* IPSR2 */
420 D14_MARK, TX2_B_MARK, FSE_A_MARK, ET0_TX_CLK_B_MARK,
421 D13_MARK, RX2_B_MARK, FRB_A_MARK, ET0_ETXD6_B_MARK,
422 D12_MARK, FWE_A_MARK, ET0_ETXD5_B_MARK,
423 D11_MARK, RSPI_MISO_A_MARK, QMI_QIO1_A_MARK, FRE_A_MARK,
424 ET0_ETXD3_B_MARK,
425 D10_MARK, RSPI_MOSI_A_MARK, QMO_QIO0_A_MARK, FALE_A_MARK,
426 ET0_ETXD2_B_MARK,
427 D9_MARK, SD0_CMD_A_MARK, MMC_CMD_A_MARK, QIO3_A_MARK,
428 FCLE_A_MARK, ET0_ETXD1_B_MARK,
429 D8_MARK, SD0_CLK_A_MARK, MMC_CLK_A_MARK, QIO2_A_MARK,
430 FCE_A_MARK, ET0_GTX_CLK_B_MARK,
431 D7_MARK, RSPI_SSL_A_MARK, MMC_D7_A_MARK, QSSL_A_MARK,
432 FD7_A_MARK,
433 D6_MARK, RSPI_RSPCK_A_MARK, MMC_D6_A_MARK, QSPCLK_A_MARK,
434 FD6_A_MARK,
435 D5_MARK, SD0_WP_A_MARK, MMC_D5_A_MARK, FD5_A_MARK,
436 D4_MARK, SD0_CD_A_MARK, MMC_D4_A_MARK, ST1_D7_MARK,
437 FD4_A_MARK,
438
439 /* IPSR3 */
440 DRACK0_MARK, SD1_DAT2_A_MARK, ATAG_MARK, TCLK1_A_MARK, ET0_ETXD7_MARK,
441 EX_WAIT2_MARK, SD1_DAT1_A_MARK, DACK2_MARK, CAN1_RX_C_MARK,
442 ET0_MAGIC_C_MARK, ET0_ETXD6_A_MARK,
443 EX_WAIT1_MARK, SD1_DAT0_A_MARK, DREQ2_MARK, CAN1_TX_C_MARK,
444 ET0_LINK_C_MARK, ET0_ETXD5_A_MARK,
445 EX_WAIT0_MARK, TCLK1_B_MARK,
446 RD_WR_MARK, TCLK0_MARK, CAN_CLK_B_MARK, ET0_ETXD4_MARK,
447 EX_CS5_MARK, SD1_CMD_A_MARK, ATADIR_MARK, QSSL_B_MARK,
448 ET0_ETXD3_A_MARK,
449 EX_CS4_MARK, SD1_WP_A_MARK, ATAWR_MARK, QMI_QIO1_B_MARK,
450 ET0_ETXD2_A_MARK,
451 EX_CS3_MARK, SD1_CD_A_MARK, ATARD_MARK, QMO_QIO0_B_MARK,
452 ET0_ETXD1_A_MARK,
453 EX_CS2_MARK, TX3_B_MARK, ATACS1_MARK, QSPCLK_B_MARK,
454 ET0_GTX_CLK_A_MARK,
455 EX_CS1_MARK, RX3_B_MARK, ATACS0_MARK, QIO2_B_MARK,
456 ET0_ETXD0_MARK,
457 CS1_A26_MARK, QIO3_B_MARK,
458 D15_MARK, SCK2_B_MARK,
459
460 /* IPSR4 */
461 SCK2_A_MARK, VI0_G3_MARK,
462 RTS1_B_MARK, VI0_G2_MARK,
463 CTS1_B_MARK, VI0_DATA7_VI0_G1_MARK,
464 TX1_B_MARK, VI0_DATA6_VI0_G0_MARK, ET0_PHY_INT_A_MARK,
465 RX1_B_MARK, VI0_DATA5_VI0_B5_MARK, ET0_MAGIC_A_MARK,
466 SCK1_B_MARK, VI0_DATA4_VI0_B4_MARK, ET0_LINK_A_MARK,
467 RTS0_B_MARK, VI0_DATA3_VI0_B3_MARK, ET0_MDIO_A_MARK,
468 CTS0_B_MARK, VI0_DATA2_VI0_B2_MARK, RMII0_MDIO_A_MARK,
469 ET0_MDC_MARK,
470 HTX0_A_MARK, TX1_A_MARK, VI0_DATA1_VI0_B1_MARK,
471 RMII0_MDC_A_MARK, ET0_COL_MARK,
472 HRX0_A_MARK, RX1_A_MARK, VI0_DATA0_VI0_B0_MARK,
473 RMII0_CRS_DV_A_MARK, ET0_CRS_MARK,
474 HSCK0_A_MARK, SCK1_A_MARK, VI0_VSYNC_MARK,
475 RMII0_RX_ER_A_MARK, ET0_RX_ER_MARK,
476 HRTS0_A_MARK, RTS1_A_MARK, VI0_HSYNC_MARK,
477 RMII0_TXD_EN_A_MARK, ET0_RX_DV_MARK,
478 HCTS0_A_MARK, CTS1_A_MARK, VI0_FIELD_MARK,
479 RMII0_RXD1_A_MARK, ET0_ERXD7_MARK,
480
481 /* IPSR5 */
482 SD2_CLK_A_MARK, RX2_A_MARK, VI0_G4_MARK, ET0_RX_CLK_B_MARK,
483 SD2_CMD_A_MARK, TX2_A_MARK, VI0_G5_MARK, ET0_ERXD2_B_MARK,
484 SD2_DAT0_A_MARK, RX3_A_MARK, VI0_R0_MARK, ET0_ERXD3_B_MARK,
485 SD2_DAT1_A_MARK, TX3_A_MARK, VI0_R1_MARK, ET0_MDIO_B_MARK,
486 SD2_DAT2_A_MARK, RX4_A_MARK, VI0_R2_MARK, ET0_LINK_B_MARK,
487 SD2_DAT3_A_MARK, TX4_A_MARK, VI0_R3_MARK, ET0_MAGIC_B_MARK,
488 SD2_CD_A_MARK, RX5_A_MARK, VI0_R4_MARK, ET0_PHY_INT_B_MARK,
489 SD2_WP_A_MARK, TX5_A_MARK, VI0_R5_MARK,
490 REF125CK_MARK, ADTRG_MARK, RX5_C_MARK,
491 REF50CK_MARK, CTS1_E_MARK, HCTS0_D_MARK,
492
493 /* IPSR6 */
494 DU0_DR0_MARK, SCIF_CLK_B_MARK, HRX0_D_MARK, IETX_A_MARK,
495 TCLKA_A_MARK, HIFD00_MARK,
496 DU0_DR1_MARK, SCK0_B_MARK, HTX0_D_MARK, IERX_A_MARK,
497 TCLKB_A_MARK, HIFD01_MARK,
498 DU0_DR2_MARK, RX0_B_MARK, TCLKC_A_MARK, HIFD02_MARK,
499 DU0_DR3_MARK, TX0_B_MARK, TCLKD_A_MARK, HIFD03_MARK,
500 DU0_DR4_MARK, CTS0_C_MARK, TIOC0A_A_MARK, HIFD04_MARK,
501 DU0_DR5_MARK, RTS0_C_MARK, TIOC0B_A_MARK, HIFD05_MARK,
502 DU0_DR6_MARK, SCK1_C_MARK, TIOC0C_A_MARK, HIFD06_MARK,
503 DU0_DR7_MARK, RX1_C_MARK, TIOC0D_A_MARK, HIFD07_MARK,
504 DU0_DG0_MARK, TX1_C_MARK, HSCK0_D_MARK, IECLK_A_MARK,
505 TIOC1A_A_MARK, HIFD08_MARK,
506 DU0_DG1_MARK, CTS1_C_MARK, HRTS0_D_MARK, TIOC1B_A_MARK,
507 HIFD09_MARK,
508
509 /* IPSR7 */
510 DU0_DG2_MARK, RTS1_C_MARK, RMII0_MDC_B_MARK, TIOC2A_A_MARK,
511 HIFD10_MARK,
512 DU0_DG3_MARK, SCK2_C_MARK, RMII0_MDIO_B_MARK, TIOC2B_A_MARK,
513 HIFD11_MARK,
514 DU0_DG4_MARK, RX2_C_MARK, RMII0_CRS_DV_B_MARK, TIOC3A_A_MARK,
515 HIFD12_MARK,
516 DU0_DG5_MARK, TX2_C_MARK, RMII0_RX_ER_B_MARK, TIOC3B_A_MARK,
517 HIFD13_MARK,
518 DU0_DG6_MARK, RX3_C_MARK, RMII0_RXD0_B_MARK, TIOC3C_A_MARK,
519 HIFD14_MARK,
520 DU0_DG7_MARK, TX3_C_MARK, RMII0_RXD1_B_MARK, TIOC3D_A_MARK,
521 HIFD15_MARK,
522 DU0_DB0_MARK, RX4_C_MARK, RMII0_TXD_EN_B_MARK, TIOC4A_A_MARK,
523 HIFCS_MARK,
524 DU0_DB1_MARK, TX4_C_MARK, RMII0_TXD0_B_MARK, TIOC4B_A_MARK,
525 HIFRS_MARK,
526 DU0_DB2_MARK, RX5_B_MARK, RMII0_TXD1_B_MARK, TIOC4C_A_MARK,
527 HIFWR_MARK,
528 DU0_DB3_MARK, TX5_B_MARK, TIOC4D_A_MARK, HIFRD_MARK,
529 DU0_DB4_MARK, HIFINT_MARK,
530
531 /* IPSR8 */
532 DU0_DB5_MARK, HIFDREQ_MARK,
533 DU0_DB6_MARK, HIFRDY_MARK,
534 DU0_DB7_MARK, SSI_SCK0_B_MARK, HIFEBL_B_MARK,
535 DU0_DOTCLKIN_MARK, HSPI_CS0_C_MARK, SSI_WS0_B_MARK,
536 DU0_DOTCLKOUT_MARK, HSPI_CLK0_C_MARK, SSI_SDATA0_B_MARK,
537 DU0_EXHSYNC_DU0_HSYNC_MARK, HSPI_TX0_C_MARK, SSI_SCK1_B_MARK,
538 DU0_EXVSYNC_DU0_VSYNC_MARK, HSPI_RX0_C_MARK, SSI_WS1_B_MARK,
539 DU0_EXODDF_DU0_ODDF_MARK, CAN0_RX_B_MARK, HSCK0_B_MARK,
540 SSI_SDATA1_B_MARK,
541 DU0_DISP_MARK, CAN0_TX_B_MARK, HRX0_B_MARK, AUDIO_CLKA_B_MARK,
542 DU0_CDE_MARK, HTX0_B_MARK, AUDIO_CLKB_B_MARK, LCD_VCPWC_B_MARK,
543 IRQ0_A_MARK, HSPI_TX_B_MARK, RX3_E_MARK, ET0_ERXD0_MARK,
544 IRQ1_A_MARK, HSPI_RX_B_MARK, TX3_E_MARK, ET0_ERXD1_MARK,
545 IRQ2_A_MARK, CTS0_A_MARK, HCTS0_B_MARK, ET0_ERXD2_A_MARK,
546 IRQ3_A_MARK, RTS0_A_MARK, HRTS0_B_MARK, ET0_ERXD3_A_MARK,
547
548 /* IPSR9 */
549 VI1_CLK_A_MARK, FD0_B_MARK, LCD_DATA0_B_MARK,
550 VI1_0_A_MARK, FD1_B_MARK, LCD_DATA1_B_MARK,
551 VI1_1_A_MARK, FD2_B_MARK, LCD_DATA2_B_MARK,
552 VI1_2_A_MARK, FD3_B_MARK, LCD_DATA3_B_MARK,
553 VI1_3_A_MARK, FD4_B_MARK, LCD_DATA4_B_MARK,
554 VI1_4_A_MARK, FD5_B_MARK, LCD_DATA5_B_MARK,
555 VI1_5_A_MARK, FD6_B_MARK, LCD_DATA6_B_MARK,
556 VI1_6_A_MARK, FD7_B_MARK, LCD_DATA7_B_MARK,
557 VI1_7_A_MARK, FCE_B_MARK, LCD_DATA8_B_MARK,
558 SSI_SCK0_A_MARK, TIOC1A_B_MARK, LCD_DATA9_B_MARK,
559 SSI_WS0_A_MARK, TIOC1B_B_MARK, LCD_DATA10_B_MARK,
560 SSI_SDATA0_A_MARK, VI1_0_B_MARK, TIOC2A_B_MARK, LCD_DATA11_B_MARK,
561 SSI_SCK1_A_MARK, VI1_1_B_MARK, TIOC2B_B_MARK, LCD_DATA12_B_MARK,
562 SSI_WS1_A_MARK, VI1_2_B_MARK, LCD_DATA13_B_MARK,
563 SSI_SDATA1_A_MARK, VI1_3_B_MARK, LCD_DATA14_B_MARK,
564
565 /* IPSR10 */
566 SSI_SCK23_MARK, VI1_4_B_MARK, RX1_D_MARK, FCLE_B_MARK,
567 LCD_DATA15_B_MARK,
568 SSI_WS23_MARK, VI1_5_B_MARK, TX1_D_MARK, HSCK0_C_MARK,
569 FALE_B_MARK, LCD_DON_B_MARK,
570 SSI_SDATA2_MARK, VI1_6_B_MARK, HRX0_C_MARK, FRE_B_MARK,
571 LCD_CL1_B_MARK,
572 SSI_SDATA3_MARK, VI1_7_B_MARK, HTX0_C_MARK, FWE_B_MARK,
573 LCD_CL2_B_MARK,
574 AUDIO_CLKA_A_MARK, VI1_CLK_B_MARK, SCK1_D_MARK, IECLK_B_MARK,
575 LCD_FLM_B_MARK,
576 AUDIO_CLKB_A_MARK, LCD_CLK_B_MARK,
577 AUDIO_CLKC_MARK, SCK1_E_MARK, HCTS0_C_MARK, FRB_B_MARK,
578 LCD_VEPWC_B_MARK,
579 AUDIO_CLKOUT_MARK, TX1_E_MARK, HRTS0_C_MARK, FSE_B_MARK,
580 LCD_M_DISP_B_MARK,
581 CAN_CLK_A_MARK, RX4_D_MARK,
582 CAN0_TX_A_MARK, TX4_D_MARK, MLB_CLK_MARK,
583 CAN1_RX_A_MARK, IRQ1_B_MARK,
584 CAN0_RX_A_MARK, IRQ0_B_MARK, MLB_SIG_MARK,
585 CAN1_TX_A_MARK, TX5_C_MARK, MLB_DAT_MARK,
586
587 /* IPSR11 */
588 SCL1_MARK, SCIF_CLK_C_MARK,
589 SDA1_MARK, RX1_E_MARK,
590 SDA0_MARK, HIFEBL_A_MARK,
591 SDSELF_MARK, RTS1_E_MARK,
592 SCIF_CLK_A_MARK, HSPI_CLK_A_MARK, VI0_CLK_MARK, RMII0_TXD0_A_MARK,
593 ET0_ERXD4_MARK,
594 SCK0_A_MARK, HSPI_CS_A_MARK, VI0_CLKENB_MARK, RMII0_TXD1_A_MARK,
595 ET0_ERXD5_MARK,
596 RX0_A_MARK, HSPI_RX_A_MARK, RMII0_RXD0_A_MARK, ET0_ERXD6_MARK,
597 TX0_A_MARK, HSPI_TX_A_MARK,
598 PENC1_MARK, TX3_D_MARK, CAN1_TX_B_MARK, TX5_D_MARK,
599 IETX_B_MARK,
600 USB_OVC1_MARK, RX3_D_MARK, CAN1_RX_B_MARK, RX5_D_MARK,
601 IERX_B_MARK,
602 DREQ0_MARK, SD1_CLK_A_MARK, ET0_TX_EN_MARK,
603 DACK0_MARK, SD1_DAT3_A_MARK, ET0_TX_ER_MARK,
604 DREQ1_MARK, HSPI_CLK_B_MARK, RX4_B_MARK, ET0_PHY_INT_C_MARK,
605 ET0_TX_CLK_A_MARK,
606 DACK1_MARK, HSPI_CS_B_MARK, TX4_B_MARK, ET0_RX_CLK_A_MARK,
607 PRESETOUT_MARK, ST_CLKOUT_MARK,
608
609 PINMUX_MARK_END,
610};
611
612static pinmux_enum_t pinmux_data[] = {
613 PINMUX_DATA_GP_ALL(), /* PINMUX_DATA(GP_M_N_DATA, GP_M_N_FN...), */
614
615 PINMUX_DATA(CLKOUT_MARK, FN_CLKOUT),
616 PINMUX_DATA(BS_MARK, FN_BS), PINMUX_DATA(CS0_MARK, FN_CS0),
617 PINMUX_DATA(EX_CS0_MARK, FN_EX_CS0),
618 PINMUX_DATA(RD_MARK, FN_RD), PINMUX_DATA(WE0_MARK, FN_WE0),
619 PINMUX_DATA(WE1_MARK, FN_WE1),
620 PINMUX_DATA(SCL0_MARK, FN_SCL0), PINMUX_DATA(PENC0_MARK, FN_PENC0),
621 PINMUX_DATA(USB_OVC0_MARK, FN_USB_OVC0),
622 PINMUX_DATA(IRQ2_B_MARK, FN_IRQ2_B),
623 PINMUX_DATA(IRQ3_B_MARK, FN_IRQ3_B),
624
625 /* IPSR0 */
626 PINMUX_IPSR_DATA(IP0_1_0, A0),
627 PINMUX_IPSR_DATA(IP0_1_0, ST0_CLKIN),
628 PINMUX_IPSR_MODSEL_DATA(IP0_1_0, LCD_DATA0_A, SEL_LCDC_0),
629 PINMUX_IPSR_MODSEL_DATA(IP0_1_0, TCLKA_C, SEL_MTU2_CLK_1),
630
631 PINMUX_IPSR_DATA(IP0_3_2, A1),
632 PINMUX_IPSR_DATA(IP0_3_2, ST0_REQ),
633 PINMUX_IPSR_MODSEL_DATA(IP0_3_2, LCD_DATA1_A, SEL_LCDC_0),
634 PINMUX_IPSR_MODSEL_DATA(IP0_3_2, TCLKB_C, SEL_MTU2_CLK_1),
635
636 PINMUX_IPSR_DATA(IP0_5_4, A2),
637 PINMUX_IPSR_DATA(IP0_5_4, ST0_SYC),
638 PINMUX_IPSR_MODSEL_DATA(IP0_5_4, LCD_DATA2_A, SEL_LCDC_0),
639 PINMUX_IPSR_MODSEL_DATA(IP0_5_4, TCLKC_C, SEL_MTU2_CLK_1),
640
641 PINMUX_IPSR_DATA(IP0_7_6, A3),
642 PINMUX_IPSR_DATA(IP0_7_6, ST0_VLD),
643 PINMUX_IPSR_MODSEL_DATA(IP0_7_6, LCD_DATA3_A, SEL_LCDC_0),
644 PINMUX_IPSR_MODSEL_DATA(IP0_7_6, TCLKD_C, SEL_MTU2_CLK_1),
645
646 PINMUX_IPSR_DATA(IP0_9_8, A4),
647 PINMUX_IPSR_DATA(IP0_9_8, ST0_D0),
648 PINMUX_IPSR_MODSEL_DATA(IP0_9_8, LCD_DATA4_A, SEL_LCDC_0),
649 PINMUX_IPSR_MODSEL_DATA(IP0_9_8, TIOC0A_C, SEL_MTU2_CH0_1),
650
651 PINMUX_IPSR_DATA(IP0_11_10, A5),
652 PINMUX_IPSR_DATA(IP0_11_10, ST0_D1),
653 PINMUX_IPSR_MODSEL_DATA(IP0_11_10, LCD_DATA5_A, SEL_LCDC_0),
654 PINMUX_IPSR_MODSEL_DATA(IP0_11_10, TIOC0B_C, SEL_MTU2_CH0_1),
655
656 PINMUX_IPSR_DATA(IP0_13_12, A6),
657 PINMUX_IPSR_DATA(IP0_13_12, ST0_D2),
658 PINMUX_IPSR_MODSEL_DATA(IP0_13_12, LCD_DATA6_A, SEL_LCDC_0),
659 PINMUX_IPSR_MODSEL_DATA(IP0_13_12, TIOC0C_C, SEL_MTU2_CH0_1),
660
661 PINMUX_IPSR_DATA(IP0_15_14, A7),
662 PINMUX_IPSR_DATA(IP0_15_14, ST0_D3),
663 PINMUX_IPSR_MODSEL_DATA(IP0_15_14, LCD_DATA7_A, SEL_LCDC_0),
664 PINMUX_IPSR_MODSEL_DATA(IP0_15_14, TIOC0D_C, SEL_MTU2_CH0_1),
665
666 PINMUX_IPSR_DATA(IP0_17_16, A8),
667 PINMUX_IPSR_DATA(IP0_17_16, ST0_D4),
668 PINMUX_IPSR_MODSEL_DATA(IP0_17_16, LCD_DATA8_A, SEL_LCDC_0),
669 PINMUX_IPSR_MODSEL_DATA(IP0_17_16, TIOC1A_C, SEL_MTU2_CH1_2),
670
671 PINMUX_IPSR_DATA(IP0_19_18, A9),
672 PINMUX_IPSR_DATA(IP0_19_18, ST0_D5),
673 PINMUX_IPSR_MODSEL_DATA(IP0_19_18, LCD_DATA9_A, SEL_LCDC_0),
674 PINMUX_IPSR_MODSEL_DATA(IP0_19_18, TIOC1B_C, SEL_MTU2_CH1_2),
675
676 PINMUX_IPSR_DATA(IP0_21_20, A10),
677 PINMUX_IPSR_DATA(IP0_21_20, ST0_D6),
678 PINMUX_IPSR_MODSEL_DATA(IP0_21_20, LCD_DATA10_A, SEL_LCDC_0),
679 PINMUX_IPSR_MODSEL_DATA(IP0_21_20, TIOC2A_C, SEL_MTU2_CH2_2),
680
681 PINMUX_IPSR_DATA(IP0_23_22, A11),
682 PINMUX_IPSR_DATA(IP0_23_22, ST0_D7),
683 PINMUX_IPSR_MODSEL_DATA(IP0_23_22, LCD_DATA11_A, SEL_LCDC_0),
684 PINMUX_IPSR_MODSEL_DATA(IP0_23_22, TIOC2B_C, SEL_MTU2_CH2_2),
685
686 PINMUX_IPSR_DATA(IP0_25_24, A12),
687 PINMUX_IPSR_MODSEL_DATA(IP0_25_24, LCD_DATA12_A, SEL_LCDC_0),
688 PINMUX_IPSR_MODSEL_DATA(IP0_25_24, TIOC3A_C, SEL_MTU2_CH3_1),
689
690 PINMUX_IPSR_DATA(IP0_27_26, A13),
691 PINMUX_IPSR_MODSEL_DATA(IP0_27_26, LCD_DATA13_A, SEL_LCDC_0),
692 PINMUX_IPSR_MODSEL_DATA(IP0_27_26, TIOC3B_C, SEL_MTU2_CH3_1),
693
694 PINMUX_IPSR_DATA(IP0_29_28, A14),
695 PINMUX_IPSR_MODSEL_DATA(IP0_29_28, LCD_DATA14_A, SEL_LCDC_0),
696 PINMUX_IPSR_MODSEL_DATA(IP0_29_28, TIOC3C_C, SEL_MTU2_CH3_1),
697
698 PINMUX_IPSR_DATA(IP0_31_30, A15),
699 PINMUX_IPSR_DATA(IP0_31_30, ST0_VCO_CLKIN),
700 PINMUX_IPSR_MODSEL_DATA(IP0_31_30, LCD_DATA15_A, SEL_LCDC_0),
701 PINMUX_IPSR_MODSEL_DATA(IP0_31_30, TIOC3D_C, SEL_MTU2_CH3_1),
702
703
704 /* IPSR1 */
705 PINMUX_IPSR_DATA(IP1_1_0, A16),
706 PINMUX_IPSR_DATA(IP1_1_0, ST0_PWM),
707 PINMUX_IPSR_MODSEL_DATA(IP1_1_0, LCD_DON_A, SEL_LCDC_0),
708 PINMUX_IPSR_MODSEL_DATA(IP1_1_0, TIOC4A_C, SEL_MTU2_CH4_1),
709
710 PINMUX_IPSR_DATA(IP1_3_2, A17),
711 PINMUX_IPSR_DATA(IP1_3_2, ST1_VCO_CLKIN),
712 PINMUX_IPSR_MODSEL_DATA(IP1_3_2, LCD_CL1_A, SEL_LCDC_0),
713 PINMUX_IPSR_MODSEL_DATA(IP1_3_2, TIOC4B_C, SEL_MTU2_CH4_1),
714
715 PINMUX_IPSR_DATA(IP1_5_4, A18),
716 PINMUX_IPSR_DATA(IP1_5_4, ST1_PWM),
717 PINMUX_IPSR_MODSEL_DATA(IP1_5_4, LCD_CL2_A, SEL_LCDC_0),
718 PINMUX_IPSR_MODSEL_DATA(IP1_5_4, TIOC4C_C, SEL_MTU2_CH4_1),
719
720 PINMUX_IPSR_DATA(IP1_7_6, A19),
721 PINMUX_IPSR_DATA(IP1_7_6, ST1_CLKIN),
722 PINMUX_IPSR_MODSEL_DATA(IP1_7_6, LCD_CLK_A, SEL_LCDC_0),
723 PINMUX_IPSR_MODSEL_DATA(IP1_7_6, TIOC4D_C, SEL_MTU2_CH4_1),
724
725 PINMUX_IPSR_DATA(IP1_9_8, A20),
726 PINMUX_IPSR_DATA(IP1_9_8, ST1_REQ),
727 PINMUX_IPSR_MODSEL_DATA(IP1_9_8, LCD_FLM_A, SEL_LCDC_0),
728
729 PINMUX_IPSR_DATA(IP1_11_10, A21),
730 PINMUX_IPSR_DATA(IP1_11_10, ST1_SYC),
731 PINMUX_IPSR_MODSEL_DATA(IP1_11_10, LCD_VCPWC_A, SEL_LCDC_0),
732
733 PINMUX_IPSR_DATA(IP1_13_12, A22),
734 PINMUX_IPSR_DATA(IP1_13_12, ST1_VLD),
735 PINMUX_IPSR_MODSEL_DATA(IP1_13_12, LCD_VEPWC_A, SEL_LCDC_0),
736
737 PINMUX_IPSR_DATA(IP1_15_14, A23),
738 PINMUX_IPSR_DATA(IP1_15_14, ST1_D0),
739 PINMUX_IPSR_MODSEL_DATA(IP1_15_14, LCD_M_DISP_A, SEL_LCDC_0),
740
741 PINMUX_IPSR_DATA(IP1_17_16, A24),
742 PINMUX_IPSR_MODSEL_DATA(IP1_17_16, RX2_D, SEL_SCIF2_3),
743 PINMUX_IPSR_DATA(IP1_17_16, ST1_D1),
744
745 PINMUX_IPSR_DATA(IP1_19_18, A25),
746 PINMUX_IPSR_MODSEL_DATA(IP1_17_16, RX2_D, SEL_SCIF2_3),
747 PINMUX_IPSR_DATA(IP1_17_16, ST1_D2),
748
749 PINMUX_IPSR_DATA(IP1_22_20, D0),
750 PINMUX_IPSR_MODSEL_DATA(IP1_22_20, SD0_DAT0_A, SEL_SDHI0_0),
751 PINMUX_IPSR_MODSEL_DATA(IP1_22_20, MMC_D0_A, SEL_MMC_0),
752 PINMUX_IPSR_DATA(IP1_22_20, ST1_D3),
753 PINMUX_IPSR_MODSEL_DATA(IP1_22_20, FD0_A, SEL_FLCTL_0),
754
755 PINMUX_IPSR_DATA(IP1_25_23, D1),
756 PINMUX_IPSR_MODSEL_DATA(IP1_25_23, SD0_DAT0_A, SEL_SDHI0_0),
757 PINMUX_IPSR_MODSEL_DATA(IP1_25_23, MMC_D1_A, SEL_MMC_0),
758 PINMUX_IPSR_DATA(IP1_25_23, ST1_D4),
759 PINMUX_IPSR_MODSEL_DATA(IP1_25_23, FD1_A, SEL_FLCTL_0),
760
761 PINMUX_IPSR_DATA(IP1_28_26, D2),
762 PINMUX_IPSR_MODSEL_DATA(IP1_28_26, SD0_DAT0_A, SEL_SDHI0_0),
763 PINMUX_IPSR_MODSEL_DATA(IP1_28_26, MMC_D2_A, SEL_MMC_0),
764 PINMUX_IPSR_DATA(IP1_28_26, ST1_D5),
765 PINMUX_IPSR_MODSEL_DATA(IP1_28_26, FD2_A, SEL_FLCTL_0),
766
767 PINMUX_IPSR_DATA(IP1_31_29, D3),
768 PINMUX_IPSR_MODSEL_DATA(IP1_31_29, SD0_DAT0_A, SEL_SDHI0_0),
769 PINMUX_IPSR_MODSEL_DATA(IP1_31_29, MMC_D3_A, SEL_MMC_0),
770 PINMUX_IPSR_DATA(IP1_31_29, ST1_D6),
771 PINMUX_IPSR_MODSEL_DATA(IP1_31_29, FD3_A, SEL_FLCTL_0),
772
773 /* IPSR2 */
774 PINMUX_IPSR_DATA(IP2_2_0, D4),
775 PINMUX_IPSR_MODSEL_DATA(IP2_2_0, SD0_CD_A, SEL_SDHI0_0),
776 PINMUX_IPSR_MODSEL_DATA(IP2_2_0, MMC_D4_A, SEL_MMC_0),
777 PINMUX_IPSR_DATA(IP2_2_0, ST1_D7),
778 PINMUX_IPSR_MODSEL_DATA(IP2_2_0, FD4_A, SEL_FLCTL_0),
779
780 PINMUX_IPSR_DATA(IP2_4_3, D5),
781 PINMUX_IPSR_MODSEL_DATA(IP2_4_3, SD0_WP_A, SEL_SDHI0_0),
782 PINMUX_IPSR_MODSEL_DATA(IP2_4_3, MMC_D5_A, SEL_MMC_0),
783 PINMUX_IPSR_MODSEL_DATA(IP2_4_3, FD5_A, SEL_FLCTL_0),
784
785 PINMUX_IPSR_DATA(IP2_7_5, D6),
786 PINMUX_IPSR_MODSEL_DATA(IP2_7_5, RSPI_RSPCK_A, SEL_RSPI_0),
787 PINMUX_IPSR_MODSEL_DATA(IP2_7_5, MMC_D6_A, SEL_MMC_0),
788 PINMUX_IPSR_MODSEL_DATA(IP2_7_5, QSPCLK_A, SEL_RQSPI_0),
789 PINMUX_IPSR_MODSEL_DATA(IP2_7_5, FD6_A, SEL_FLCTL_0),
790
791 PINMUX_IPSR_DATA(IP2_10_8, D7),
792 PINMUX_IPSR_MODSEL_DATA(IP2_10_8, RSPI_SSL_A, SEL_RSPI_0),
793 PINMUX_IPSR_MODSEL_DATA(IP2_10_8, MMC_D7_A, SEL_MMC_0),
794 PINMUX_IPSR_MODSEL_DATA(IP2_10_8, QSSL_A, SEL_RQSPI_0),
795 PINMUX_IPSR_MODSEL_DATA(IP2_10_8, FD7_A, SEL_FLCTL_0),
796
797 PINMUX_IPSR_DATA(IP2_13_11, D8),
798 PINMUX_IPSR_MODSEL_DATA(IP2_13_11, SD0_CLK_A, SEL_SDHI0_0),
799 PINMUX_IPSR_MODSEL_DATA(IP2_13_11, MMC_CLK_A, SEL_MMC_0),
800 PINMUX_IPSR_MODSEL_DATA(IP2_13_11, QIO2_A, SEL_RQSPI_0),
801 PINMUX_IPSR_MODSEL_DATA(IP2_13_11, FCE_A, SEL_FLCTL_0),
802 PINMUX_IPSR_MODSEL_DATA(IP2_13_11, ET0_GTX_CLK_B, SEL_ET0_1),
803
804 PINMUX_IPSR_DATA(IP2_16_14, D9),
805 PINMUX_IPSR_MODSEL_DATA(IP2_16_14, SD0_CMD_A, SEL_SDHI0_0),
806 PINMUX_IPSR_MODSEL_DATA(IP2_16_14, MMC_CMD_A, SEL_MMC_0),
807 PINMUX_IPSR_MODSEL_DATA(IP2_16_14, QIO3_A, SEL_RQSPI_0),
808 PINMUX_IPSR_MODSEL_DATA(IP2_16_14, FCLE_A, SEL_FLCTL_0),
809 PINMUX_IPSR_MODSEL_DATA(IP2_16_14, ET0_ETXD1_B, SEL_ET0_1),
810
811 PINMUX_IPSR_DATA(IP2_19_17, D10),
812 PINMUX_IPSR_MODSEL_DATA(IP2_19_17, RSPI_MOSI_A, SEL_RSPI_0),
813 PINMUX_IPSR_MODSEL_DATA(IP2_19_17, QMO_QIO0_A, SEL_RQSPI_0),
814 PINMUX_IPSR_MODSEL_DATA(IP2_19_17, FALE_A, SEL_FLCTL_0),
815 PINMUX_IPSR_MODSEL_DATA(IP2_19_17, ET0_ETXD2_B, SEL_ET0_1),
816
817 PINMUX_IPSR_DATA(IP2_22_20, D11),
818 PINMUX_IPSR_MODSEL_DATA(IP2_22_20, RSPI_MISO_A, SEL_RSPI_0),
819 PINMUX_IPSR_MODSEL_DATA(IP2_22_20, QMI_QIO1_A, SEL_RQSPI_0),
820 PINMUX_IPSR_MODSEL_DATA(IP2_22_20, FRE_A, SEL_FLCTL_0),
821
822 PINMUX_IPSR_DATA(IP2_24_23, D12),
823 PINMUX_IPSR_MODSEL_DATA(IP2_24_23, FWE_A, SEL_FLCTL_0),
824 PINMUX_IPSR_MODSEL_DATA(IP2_24_23, ET0_ETXD5_B, SEL_ET0_1),
825
826 PINMUX_IPSR_DATA(IP2_27_25, D13),
827 PINMUX_IPSR_MODSEL_DATA(IP2_27_25, RX2_B, SEL_SCIF2_1),
828 PINMUX_IPSR_MODSEL_DATA(IP2_27_25, FRB_A, SEL_FLCTL_0),
829 PINMUX_IPSR_MODSEL_DATA(IP2_27_25, ET0_ETXD6_B, SEL_ET0_1),
830
831 PINMUX_IPSR_DATA(IP2_30_28, D14),
832 PINMUX_IPSR_MODSEL_DATA(IP2_30_28, TX2_B, SEL_SCIF2_1),
833 PINMUX_IPSR_MODSEL_DATA(IP2_30_28, FSE_A, SEL_FLCTL_0),
834 PINMUX_IPSR_MODSEL_DATA(IP2_30_28, ET0_TX_CLK_B, SEL_ET0_1),
835
836 /* IPSR3 */
837 PINMUX_IPSR_DATA(IP3_1_0, D15),
838 PINMUX_IPSR_MODSEL_DATA(IP3_1_0, SCK2_B, SEL_SCIF2_1),
839
840 PINMUX_IPSR_DATA(IP3_2, CS1_A26),
841 PINMUX_IPSR_MODSEL_DATA(IP3_2, QIO3_B, SEL_RQSPI_1),
842
843 PINMUX_IPSR_DATA(IP3_5_3, EX_CS1),
844 PINMUX_IPSR_MODSEL_DATA(IP3_5_3, RX3_B, SEL_SCIF2_1),
845 PINMUX_IPSR_DATA(IP3_5_3, ATACS0),
846 PINMUX_IPSR_MODSEL_DATA(IP3_5_3, QIO2_B, SEL_RQSPI_1),
847 PINMUX_IPSR_DATA(IP3_5_3, ET0_ETXD0),
848
849 PINMUX_IPSR_DATA(IP3_8_6, EX_CS2),
850 PINMUX_IPSR_MODSEL_DATA(IP3_8_6, TX3_B, SEL_SCIF3_1),
851 PINMUX_IPSR_DATA(IP3_8_6, ATACS1),
852 PINMUX_IPSR_MODSEL_DATA(IP3_8_6, QSPCLK_B, SEL_RQSPI_1),
853 PINMUX_IPSR_MODSEL_DATA(IP3_8_6, ET0_GTX_CLK_A, SEL_ET0_0),
854
855 PINMUX_IPSR_DATA(IP3_11_9, EX_CS3),
856 PINMUX_IPSR_MODSEL_DATA(IP3_11_9, SD1_CD_A, SEL_SDHI1_0),
857 PINMUX_IPSR_DATA(IP3_11_9, ATARD),
858 PINMUX_IPSR_MODSEL_DATA(IP3_11_9, QMO_QIO0_B, SEL_RQSPI_1),
859 PINMUX_IPSR_MODSEL_DATA(IP3_11_9, ET0_ETXD1_A, SEL_ET0_0),
860
861 PINMUX_IPSR_DATA(IP3_14_12, EX_CS4),
862 PINMUX_IPSR_MODSEL_DATA(IP3_14_12, SD1_WP_A, SEL_SDHI1_0),
863 PINMUX_IPSR_DATA(IP3_14_12, ATAWR),
864 PINMUX_IPSR_MODSEL_DATA(IP3_14_12, QMI_QIO1_B, SEL_RQSPI_1),
865 PINMUX_IPSR_MODSEL_DATA(IP3_14_12, ET0_ETXD2_A, SEL_ET0_0),
866
867 PINMUX_IPSR_DATA(IP3_17_15, EX_CS5),
868 PINMUX_IPSR_MODSEL_DATA(IP3_17_15, SD1_CMD_A, SEL_SDHI1_0),
869 PINMUX_IPSR_DATA(IP3_17_15, ATADIR),
870 PINMUX_IPSR_MODSEL_DATA(IP3_17_15, QSSL_B, SEL_RQSPI_1),
871 PINMUX_IPSR_MODSEL_DATA(IP3_17_15, ET0_ETXD3_A, SEL_ET0_0),
872
873 PINMUX_IPSR_DATA(IP3_19_18, RD_WR),
874 PINMUX_IPSR_DATA(IP3_19_18, TCLK0),
875 PINMUX_IPSR_MODSEL_DATA(IP3_19_18, CAN_CLK_B, SEL_RCAN_CLK_1),
876 PINMUX_IPSR_DATA(IP3_19_18, ET0_ETXD4),
877
878 PINMUX_IPSR_DATA(IP3_20, EX_WAIT0),
879 PINMUX_IPSR_MODSEL_DATA(IP3_20, TCLK1_B, SEL_TMU_1),
880
881 PINMUX_IPSR_DATA(IP3_23_21, EX_WAIT1),
882 PINMUX_IPSR_MODSEL_DATA(IP3_23_21, SD1_DAT0_A, SEL_SDHI1_0),
883 PINMUX_IPSR_DATA(IP3_23_21, DREQ2),
884 PINMUX_IPSR_MODSEL_DATA(IP3_23_21, CAN1_TX_C, SEL_RCAN1_2),
885 PINMUX_IPSR_MODSEL_DATA(IP3_23_21, ET0_LINK_C, SEL_ET0_CTL_2),
886 PINMUX_IPSR_MODSEL_DATA(IP3_23_21, ET0_ETXD5_A, SEL_ET0_0),
887
888 PINMUX_IPSR_DATA(IP3_26_24, EX_WAIT2),
889 PINMUX_IPSR_MODSEL_DATA(IP3_26_24, SD1_DAT1_A, SEL_SDHI1_0),
890 PINMUX_IPSR_DATA(IP3_26_24, DACK2),
891 PINMUX_IPSR_MODSEL_DATA(IP3_26_24, CAN1_RX_C, SEL_RCAN1_2),
892 PINMUX_IPSR_MODSEL_DATA(IP3_26_24, ET0_MAGIC_C, SEL_ET0_CTL_2),
893 PINMUX_IPSR_MODSEL_DATA(IP3_26_24, ET0_ETXD6_A, SEL_ET0_0),
894
895 PINMUX_IPSR_DATA(IP3_29_27, DRACK0),
896 PINMUX_IPSR_MODSEL_DATA(IP3_29_27, SD1_DAT2_A, SEL_SDHI1_0),
897 PINMUX_IPSR_DATA(IP3_29_27, ATAG),
898 PINMUX_IPSR_MODSEL_DATA(IP3_29_27, TCLK1_A, SEL_TMU_0),
899 PINMUX_IPSR_DATA(IP3_29_27, ET0_ETXD7),
900
901 /* IPSR4 */
902 PINMUX_IPSR_MODSEL_DATA(IP4_2_0, HCTS0_A, SEL_HSCIF_0),
903 PINMUX_IPSR_MODSEL_DATA(IP4_2_0, CTS1_A, SEL_SCIF1_0),
904 PINMUX_IPSR_DATA(IP4_2_0, VI0_FIELD),
905 PINMUX_IPSR_MODSEL_DATA(IP4_2_0, RMII0_RXD1_A, SEL_RMII_0),
906 PINMUX_IPSR_DATA(IP4_2_0, ET0_ERXD7),
907
908 PINMUX_IPSR_MODSEL_DATA(IP4_5_3, HRTS0_A, SEL_HSCIF_0),
909 PINMUX_IPSR_MODSEL_DATA(IP4_5_3, RTS1_A, SEL_SCIF1_0),
910 PINMUX_IPSR_DATA(IP4_5_3, VI0_HSYNC),
911 PINMUX_IPSR_MODSEL_DATA(IP4_5_3, RMII0_TXD_EN_A, SEL_RMII_0),
912 PINMUX_IPSR_DATA(IP4_5_3, ET0_RX_DV),
913
914 PINMUX_IPSR_MODSEL_DATA(IP4_8_6, HSCK0_A, SEL_HSCIF_0),
915 PINMUX_IPSR_MODSEL_DATA(IP4_8_6, SCK1_A, SEL_SCIF1_0),
916 PINMUX_IPSR_DATA(IP4_8_6, VI0_VSYNC),
917 PINMUX_IPSR_MODSEL_DATA(IP4_8_6, RMII0_RX_ER_A, SEL_RMII_0),
918 PINMUX_IPSR_DATA(IP4_8_6, ET0_RX_ER),
919
920 PINMUX_IPSR_MODSEL_DATA(IP4_11_9, HRX0_A, SEL_HSCIF_0),
921 PINMUX_IPSR_MODSEL_DATA(IP4_11_9, RX1_A, SEL_SCIF1_0),
922 PINMUX_IPSR_DATA(IP4_11_9, VI0_DATA0_VI0_B0),
923 PINMUX_IPSR_MODSEL_DATA(IP4_11_9, RMII0_CRS_DV_A, SEL_RMII_0),
924 PINMUX_IPSR_DATA(IP4_11_9, ET0_CRS),
925
926 PINMUX_IPSR_MODSEL_DATA(IP4_14_12, HTX0_A, SEL_HSCIF_0),
927 PINMUX_IPSR_MODSEL_DATA(IP4_14_12, TX1_A, SEL_SCIF1_0),
928 PINMUX_IPSR_DATA(IP4_14_12, VI0_DATA1_VI0_B1),
929 PINMUX_IPSR_MODSEL_DATA(IP4_14_12, RMII0_MDC_A, SEL_RMII_0),
930 PINMUX_IPSR_DATA(IP4_14_12, ET0_COL),
931
932 PINMUX_IPSR_MODSEL_DATA(IP4_17_15, CTS0_B, SEL_SCIF0_1),
933 PINMUX_IPSR_DATA(IP4_17_15, VI0_DATA2_VI0_B2),
934 PINMUX_IPSR_MODSEL_DATA(IP4_17_15, RMII0_MDIO_A, SEL_RMII_0),
935 PINMUX_IPSR_DATA(IP4_17_15, ET0_MDC),
936
937 PINMUX_IPSR_MODSEL_DATA(IP4_19_18, RTS0_B, SEL_SCIF0_1),
938 PINMUX_IPSR_DATA(IP4_19_18, VI0_DATA3_VI0_B3),
939 PINMUX_IPSR_MODSEL_DATA(IP4_19_18, ET0_MDIO_A, SEL_ET0_0),
940
941 PINMUX_IPSR_MODSEL_DATA(IP4_21_20, SCK1_B, SEL_SCIF1_1),
942 PINMUX_IPSR_DATA(IP4_21_20, VI0_DATA4_VI0_B4),
943 PINMUX_IPSR_MODSEL_DATA(IP4_21_20, ET0_LINK_A, SEL_ET0_CTL_0),
944
945 PINMUX_IPSR_MODSEL_DATA(IP4_23_22, RX1_B, SEL_SCIF1_1),
946 PINMUX_IPSR_DATA(IP4_23_22, VI0_DATA5_VI0_B5),
947 PINMUX_IPSR_MODSEL_DATA(IP4_23_22, ET0_MAGIC_A, SEL_ET0_CTL_0),
948
949 PINMUX_IPSR_MODSEL_DATA(IP4_25_24, TX1_B, SEL_SCIF1_1),
950 PINMUX_IPSR_DATA(IP4_25_24, VI0_DATA6_VI0_G0),
951 PINMUX_IPSR_MODSEL_DATA(IP4_25_24, ET0_PHY_INT_A, SEL_ET0_CTL_0),
952
953 PINMUX_IPSR_MODSEL_DATA(IP4_27_26, CTS1_B, SEL_SCIF1_1),
954 PINMUX_IPSR_DATA(IP4_27_26, VI0_DATA7_VI0_G1),
955
956 PINMUX_IPSR_MODSEL_DATA(IP4_29_28, RTS1_B, SEL_SCIF1_1),
957 PINMUX_IPSR_DATA(IP4_29_28, VI0_G2),
958
959 PINMUX_IPSR_MODSEL_DATA(IP4_31_30, SCK2_A, SEL_SCIF2_0),
960 PINMUX_IPSR_DATA(IP4_31_30, VI0_G3),
961
962 /* IPSR5 */
963 PINMUX_IPSR_MODSEL_DATA(IP5_2_0, SD2_CLK_A, SEL_SDHI2_0),
964 PINMUX_IPSR_MODSEL_DATA(IP5_2_0, RX2_A, SEL_SCIF2_0),
965 PINMUX_IPSR_DATA(IP5_2_0, VI0_G4),
966 PINMUX_IPSR_MODSEL_DATA(IP5_2_0, ET0_RX_CLK_B, SEL_ET0_1),
967
968 PINMUX_IPSR_MODSEL_DATA(IP5_5_3, SD2_CMD_A, SEL_SDHI2_0),
969 PINMUX_IPSR_MODSEL_DATA(IP5_5_3, TX2_A, SEL_SCIF2_0),
970 PINMUX_IPSR_DATA(IP5_5_3, VI0_G5),
971 PINMUX_IPSR_MODSEL_DATA(IP5_5_3, ET0_ERXD2_B, SEL_ET0_1),
972
973 PINMUX_IPSR_MODSEL_DATA(IP5_8_6, SD2_DAT0_A, SEL_SDHI2_0),
974 PINMUX_IPSR_MODSEL_DATA(IP5_8_6, RX3_A, SEL_SCIF3_0),
975 PINMUX_IPSR_DATA(IP4_8_6, VI0_R0),
976 PINMUX_IPSR_MODSEL_DATA(IP4_8_6, ET0_ERXD2_B, SEL_ET0_1),
977
978 PINMUX_IPSR_MODSEL_DATA(IP5_11_9, SD2_DAT1_A, SEL_SDHI2_0),
979 PINMUX_IPSR_MODSEL_DATA(IP5_11_9, TX3_A, SEL_SCIF3_0),
980 PINMUX_IPSR_DATA(IP5_11_9, VI0_R1),
981 PINMUX_IPSR_MODSEL_DATA(IP5_11_9, ET0_MDIO_B, SEL_ET0_1),
982
983 PINMUX_IPSR_MODSEL_DATA(IP5_14_12, SD2_DAT2_A, SEL_SDHI2_0),
984 PINMUX_IPSR_MODSEL_DATA(IP5_14_12, RX4_A, SEL_SCIF4_0),
985 PINMUX_IPSR_DATA(IP5_14_12, VI0_R2),
986 PINMUX_IPSR_MODSEL_DATA(IP5_14_12, ET0_LINK_B, SEL_ET0_CTL_1),
987
988 PINMUX_IPSR_MODSEL_DATA(IP5_17_15, SD2_DAT3_A, SEL_SDHI2_0),
989 PINMUX_IPSR_MODSEL_DATA(IP5_17_15, TX4_A, SEL_SCIF4_0),
990 PINMUX_IPSR_DATA(IP5_17_15, VI0_R3),
991 PINMUX_IPSR_MODSEL_DATA(IP5_17_15, ET0_MAGIC_B, SEL_ET0_CTL_1),
992
993 PINMUX_IPSR_MODSEL_DATA(IP5_20_18, SD2_CD_A, SEL_SDHI2_0),
994 PINMUX_IPSR_MODSEL_DATA(IP5_20_18, RX5_A, SEL_SCIF5_0),
995 PINMUX_IPSR_DATA(IP5_20_18, VI0_R4),
996 PINMUX_IPSR_MODSEL_DATA(IP5_20_18, ET0_PHY_INT_B, SEL_ET0_CTL_1),
997
998 PINMUX_IPSR_MODSEL_DATA(IP5_22_21, SD2_WP_A, SEL_SDHI2_0),
999 PINMUX_IPSR_MODSEL_DATA(IP5_22_21, TX5_A, SEL_SCIF5_0),
1000 PINMUX_IPSR_DATA(IP5_22_21, VI0_R5),
1001
1002 PINMUX_IPSR_DATA(IP5_24_23, REF125CK),
1003 PINMUX_IPSR_DATA(IP5_24_23, ADTRG),
1004 PINMUX_IPSR_MODSEL_DATA(IP5_24_23, RX5_C, SEL_SCIF5_2),
1005 PINMUX_IPSR_DATA(IP5_26_25, REF50CK),
1006 PINMUX_IPSR_MODSEL_DATA(IP5_26_25, CTS1_E, SEL_SCIF1_3),
1007 PINMUX_IPSR_MODSEL_DATA(IP5_26_25, HCTS0_D, SEL_HSCIF_3),
1008
1009 /* IPSR6 */
1010 PINMUX_IPSR_DATA(IP6_2_0, DU0_DR0),
1011 PINMUX_IPSR_MODSEL_DATA(IP6_2_0, SCIF_CLK_B, SEL_SCIF_CLK_1),
1012 PINMUX_IPSR_MODSEL_DATA(IP6_2_0, HRX0_D, SEL_HSCIF_3),
1013 PINMUX_IPSR_MODSEL_DATA(IP6_2_0, IETX_A, SEL_IEBUS_0),
1014 PINMUX_IPSR_MODSEL_DATA(IP6_2_0, TCLKA_A, SEL_MTU2_CLK_0),
1015 PINMUX_IPSR_DATA(IP6_2_0, HIFD00),
1016
1017 PINMUX_IPSR_DATA(IP6_5_3, DU0_DR1),
1018 PINMUX_IPSR_MODSEL_DATA(IP6_5_3, SCK0_B, SEL_SCIF0_1),
1019 PINMUX_IPSR_MODSEL_DATA(IP6_5_3, HTX0_D, SEL_HSCIF_3),
1020 PINMUX_IPSR_MODSEL_DATA(IP6_5_3, IERX_A, SEL_IEBUS_0),
1021 PINMUX_IPSR_MODSEL_DATA(IP6_5_3, TCLKB_A, SEL_MTU2_CLK_0),
1022 PINMUX_IPSR_DATA(IP6_5_3, HIFD01),
1023
1024 PINMUX_IPSR_DATA(IP6_7_6, DU0_DR2),
1025 PINMUX_IPSR_MODSEL_DATA(IP6_7_6, RX0_B, SEL_SCIF0_1),
1026 PINMUX_IPSR_MODSEL_DATA(IP6_7_6, TCLKC_A, SEL_MTU2_CLK_0),
1027 PINMUX_IPSR_DATA(IP6_7_6, HIFD02),
1028
1029 PINMUX_IPSR_DATA(IP6_9_8, DU0_DR3),
1030 PINMUX_IPSR_MODSEL_DATA(IP6_9_8, TX0_B, SEL_SCIF0_1),
1031 PINMUX_IPSR_MODSEL_DATA(IP6_9_8, TCLKD_A, SEL_MTU2_CLK_0),
1032 PINMUX_IPSR_DATA(IP6_9_8, HIFD03),
1033
1034 PINMUX_IPSR_DATA(IP6_11_10, DU0_DR4),
1035 PINMUX_IPSR_MODSEL_DATA(IP6_11_10, CTS0_C, SEL_SCIF0_2),
1036 PINMUX_IPSR_MODSEL_DATA(IP6_11_10, TIOC0A_A, SEL_MTU2_CH0_0),
1037 PINMUX_IPSR_DATA(IP6_11_10, HIFD04),
1038
1039 PINMUX_IPSR_DATA(IP6_13_12, DU0_DR5),
1040 PINMUX_IPSR_MODSEL_DATA(IP6_13_12, RTS0_C, SEL_SCIF0_1),
1041 PINMUX_IPSR_MODSEL_DATA(IP6_13_12, TIOC0B_A, SEL_MTU2_CH0_0),
1042 PINMUX_IPSR_DATA(IP6_13_12, HIFD05),
1043
1044 PINMUX_IPSR_DATA(IP6_15_14, DU0_DR6),
1045 PINMUX_IPSR_MODSEL_DATA(IP6_15_14, SCK1_C, SEL_SCIF1_2),
1046 PINMUX_IPSR_MODSEL_DATA(IP6_15_14, TIOC0C_A, SEL_MTU2_CH0_0),
1047 PINMUX_IPSR_DATA(IP6_15_14, HIFD06),
1048
1049 PINMUX_IPSR_DATA(IP6_17_16, DU0_DR7),
1050 PINMUX_IPSR_MODSEL_DATA(IP6_17_16, RX1_C, SEL_SCIF1_2),
1051 PINMUX_IPSR_MODSEL_DATA(IP6_17_16, TIOC0D_A, SEL_MTU2_CH0_0),
1052 PINMUX_IPSR_DATA(IP6_17_16, HIFD07),
1053
1054 PINMUX_IPSR_DATA(IP6_20_18, DU0_DG0),
1055 PINMUX_IPSR_MODSEL_DATA(IP6_20_18, TX1_C, SEL_SCIF1_2),
1056 PINMUX_IPSR_MODSEL_DATA(IP6_20_18, HSCK0_D, SEL_HSCIF_3),
1057 PINMUX_IPSR_MODSEL_DATA(IP6_20_18, IECLK_A, SEL_IEBUS_0),
1058 PINMUX_IPSR_MODSEL_DATA(IP6_20_18, TIOC1A_A, SEL_MTU2_CH1_0),
1059 PINMUX_IPSR_DATA(IP6_20_18, HIFD08),
1060
1061 PINMUX_IPSR_DATA(IP6_23_21, DU0_DG1),
1062 PINMUX_IPSR_MODSEL_DATA(IP6_23_21, CTS1_C, SEL_SCIF1_2),
1063 PINMUX_IPSR_MODSEL_DATA(IP6_23_21, HRTS0_D, SEL_HSCIF_3),
1064 PINMUX_IPSR_MODSEL_DATA(IP6_23_21, TIOC1B_A, SEL_MTU2_CH1_0),
1065 PINMUX_IPSR_DATA(IP6_23_21, HIFD09),
1066
1067 /* IPSR7 */
1068 PINMUX_IPSR_DATA(IP7_2_0, DU0_DG2),
1069 PINMUX_IPSR_MODSEL_DATA(IP7_2_0, RTS1_C, SEL_SCIF1_2),
1070 PINMUX_IPSR_MODSEL_DATA(IP7_2_0, RMII0_MDC_B, SEL_RMII_1),
1071 PINMUX_IPSR_MODSEL_DATA(IP7_2_0, TIOC2A_A, SEL_MTU2_CH2_0),
1072 PINMUX_IPSR_DATA(IP7_2_0, HIFD10),
1073
1074 PINMUX_IPSR_DATA(IP7_5_3, DU0_DG3),
1075 PINMUX_IPSR_MODSEL_DATA(IP7_5_3, SCK2_C, SEL_SCIF2_2),
1076 PINMUX_IPSR_MODSEL_DATA(IP7_5_3, RMII0_MDIO_B, SEL_RMII_1),
1077 PINMUX_IPSR_MODSEL_DATA(IP7_5_3, TIOC2B_A, SEL_MTU2_CH2_0),
1078 PINMUX_IPSR_DATA(IP7_5_3, HIFD11),
1079
1080 PINMUX_IPSR_DATA(IP7_8_6, DU0_DG4),
1081 PINMUX_IPSR_MODSEL_DATA(IP7_8_6, RX2_C, SEL_SCIF2_2),
1082 PINMUX_IPSR_MODSEL_DATA(IP7_8_6, RMII0_CRS_DV_B, SEL_RMII_1),
1083 PINMUX_IPSR_MODSEL_DATA(IP7_8_6, TIOC3A_A, SEL_MTU2_CH3_0),
1084 PINMUX_IPSR_DATA(IP7_8_6, HIFD12),
1085
1086 PINMUX_IPSR_DATA(IP7_11_9, DU0_DG5),
1087 PINMUX_IPSR_MODSEL_DATA(IP7_11_9, TX2_C, SEL_SCIF2_2),
1088 PINMUX_IPSR_MODSEL_DATA(IP7_11_9, RMII0_RX_ER_B, SEL_RMII_1),
1089 PINMUX_IPSR_MODSEL_DATA(IP7_11_9, TIOC3B_A, SEL_MTU2_CH3_0),
1090 PINMUX_IPSR_DATA(IP7_11_9, HIFD13),
1091
1092 PINMUX_IPSR_DATA(IP7_14_12, DU0_DG6),
1093 PINMUX_IPSR_MODSEL_DATA(IP7_14_12, RX3_C, SEL_SCIF3_2),
1094 PINMUX_IPSR_MODSEL_DATA(IP7_14_12, RMII0_RXD0_B, SEL_RMII_1),
1095 PINMUX_IPSR_MODSEL_DATA(IP7_14_12, TIOC3C_A, SEL_MTU2_CH3_0),
1096 PINMUX_IPSR_DATA(IP7_14_12, HIFD14),
1097
1098 PINMUX_IPSR_DATA(IP7_17_15, DU0_DG7),
1099 PINMUX_IPSR_MODSEL_DATA(IP7_17_15, TX3_C, SEL_SCIF3_2),
1100 PINMUX_IPSR_MODSEL_DATA(IP7_17_15, RMII0_RXD1_B, SEL_RMII_1),
1101 PINMUX_IPSR_MODSEL_DATA(IP7_17_15, TIOC3D_A, SEL_MTU2_CH3_0),
1102 PINMUX_IPSR_DATA(IP7_17_15, HIFD15),
1103
1104 PINMUX_IPSR_DATA(IP7_20_18, DU0_DB0),
1105 PINMUX_IPSR_MODSEL_DATA(IP7_20_18, RX4_C, SEL_SCIF4_2),
1106 PINMUX_IPSR_MODSEL_DATA(IP7_20_18, RMII0_TXD_EN_B, SEL_RMII_1),
1107 PINMUX_IPSR_MODSEL_DATA(IP7_20_18, TIOC4A_A, SEL_MTU2_CH4_0),
1108 PINMUX_IPSR_DATA(IP7_20_18, HIFCS),
1109
1110 PINMUX_IPSR_DATA(IP7_23_21, DU0_DB1),
1111 PINMUX_IPSR_MODSEL_DATA(IP7_23_21, TX4_C, SEL_SCIF4_2),
1112 PINMUX_IPSR_MODSEL_DATA(IP7_23_21, RMII0_TXD0_B, SEL_RMII_1),
1113 PINMUX_IPSR_MODSEL_DATA(IP7_23_21, TIOC4B_A, SEL_MTU2_CH4_0),
1114 PINMUX_IPSR_DATA(IP7_23_21, HIFWR),
1115
1116 PINMUX_IPSR_DATA(IP7_26_24, DU0_DB2),
1117 PINMUX_IPSR_MODSEL_DATA(IP7_26_24, RX5_B, SEL_SCIF5_1),
1118 PINMUX_IPSR_MODSEL_DATA(IP7_26_24, RMII0_TXD1_B, SEL_RMII_1),
1119 PINMUX_IPSR_MODSEL_DATA(IP7_26_24, TIOC4C_A, SEL_MTU2_CH4_0),
1120
1121 PINMUX_IPSR_DATA(IP7_28_27, DU0_DB3),
1122 PINMUX_IPSR_MODSEL_DATA(IP7_28_27, TX5_B, SEL_SCIF5_1),
1123 PINMUX_IPSR_MODSEL_DATA(IP7_28_27, TIOC4D_A, SEL_MTU2_CH4_0),
1124 PINMUX_IPSR_DATA(IP7_28_27, HIFRD),
1125
1126 PINMUX_IPSR_DATA(IP7_30_29, DU0_DB4),
1127 PINMUX_IPSR_DATA(IP7_30_29, HIFINT),
1128
1129 /* IPSR8 */
1130 PINMUX_IPSR_DATA(IP8_1_0, DU0_DB5),
1131 PINMUX_IPSR_DATA(IP8_1_0, HIFDREQ),
1132
1133 PINMUX_IPSR_DATA(IP8_3_2, DU0_DB6),
1134 PINMUX_IPSR_DATA(IP8_3_2, HIFRDY),
1135
1136 PINMUX_IPSR_DATA(IP8_5_4, DU0_DB7),
1137 PINMUX_IPSR_MODSEL_DATA(IP8_5_4, SSI_SCK0_B, SEL_SSI0_1),
1138 PINMUX_IPSR_MODSEL_DATA(IP8_5_4, HIFEBL_B, SEL_HIF_1),
1139
1140 PINMUX_IPSR_DATA(IP8_7_6, DU0_DOTCLKIN),
1141 PINMUX_IPSR_MODSEL_DATA(IP8_7_6, HSPI_CS0_C, SEL_HSPI_2),
1142 PINMUX_IPSR_MODSEL_DATA(IP8_7_6, SSI_WS0_B, SEL_SSI0_1),
1143
1144 PINMUX_IPSR_DATA(IP8_9_8, DU0_DOTCLKOUT),
1145 PINMUX_IPSR_MODSEL_DATA(IP8_9_8, HSPI_CLK0_C, SEL_HSPI_2),
1146 PINMUX_IPSR_MODSEL_DATA(IP8_9_8, SSI_SDATA0_B, SEL_SSI0_1),
1147
1148 PINMUX_IPSR_DATA(IP8_11_10, DU0_EXHSYNC_DU0_HSYNC),
1149 PINMUX_IPSR_MODSEL_DATA(IP8_11_10, HSPI_TX0_C, SEL_HSPI_2),
1150 PINMUX_IPSR_MODSEL_DATA(IP8_11_10, SSI_SCK1_B, SEL_SSI1_1),
1151
1152 PINMUX_IPSR_DATA(IP8_13_12, DU0_EXVSYNC_DU0_VSYNC),
1153 PINMUX_IPSR_MODSEL_DATA(IP8_13_12, HSPI_RX0_C, SEL_HSPI_2),
1154 PINMUX_IPSR_MODSEL_DATA(IP8_13_12, SSI_WS1_B, SEL_SSI1_1),
1155
1156 PINMUX_IPSR_DATA(IP8_15_14, DU0_EXODDF_DU0_ODDF),
1157 PINMUX_IPSR_MODSEL_DATA(IP8_15_14, CAN0_RX_B, SEL_RCAN0_1),
1158 PINMUX_IPSR_MODSEL_DATA(IP8_15_14, HSCK0_B, SEL_HSCIF_1),
1159 PINMUX_IPSR_MODSEL_DATA(IP8_15_14, SSI_SDATA1_B, SEL_SSI1_1),
1160
1161 PINMUX_IPSR_DATA(IP8_17_16, DU0_DISP),
1162 PINMUX_IPSR_MODSEL_DATA(IP8_17_16, CAN0_TX_B, SEL_RCAN0_1),
1163 PINMUX_IPSR_MODSEL_DATA(IP8_17_16, HRX0_B, SEL_HSCIF_1),
1164 PINMUX_IPSR_MODSEL_DATA(IP8_17_16, AUDIO_CLKA_B, SEL_AUDIO_CLKA_1),
1165
1166 PINMUX_IPSR_DATA(IP8_19_18, DU0_CDE),
1167 PINMUX_IPSR_MODSEL_DATA(IP8_19_18, HTX0_B, SEL_HSCIF_1),
1168 PINMUX_IPSR_MODSEL_DATA(IP8_19_18, AUDIO_CLKB_B, SEL_AUDIO_CLKB_1),
1169 PINMUX_IPSR_MODSEL_DATA(IP8_19_18, LCD_VCPWC_B, SEL_LCDC_1),
1170
1171 PINMUX_IPSR_MODSEL_DATA(IP8_22_20, IRQ0_A, SEL_INTC_0),
1172 PINMUX_IPSR_MODSEL_DATA(IP8_22_20, HSPI_TX_B, SEL_HSPI_1),
1173 PINMUX_IPSR_MODSEL_DATA(IP8_22_20, RX3_E, SEL_SCIF3_4),
1174 PINMUX_IPSR_DATA(IP8_22_20, ET0_ERXD0),
1175
1176 PINMUX_IPSR_MODSEL_DATA(IP8_25_23, IRQ1_A, SEL_INTC_0),
1177 PINMUX_IPSR_MODSEL_DATA(IP8_25_23, HSPI_RX_B, SEL_HSPI_1),
1178 PINMUX_IPSR_MODSEL_DATA(IP8_25_23, TX3_E, SEL_SCIF3_4),
1179 PINMUX_IPSR_DATA(IP8_25_23, ET0_ERXD1),
1180
1181 PINMUX_IPSR_MODSEL_DATA(IP8_27_26, IRQ2_A, SEL_INTC_0),
1182 PINMUX_IPSR_MODSEL_DATA(IP8_27_26, CTS0_A, SEL_SCIF0_0),
1183 PINMUX_IPSR_MODSEL_DATA(IP8_27_26, HCTS0_B, SEL_HSCIF_1),
1184 PINMUX_IPSR_MODSEL_DATA(IP8_27_26, ET0_ERXD2_A, SEL_ET0_0),
1185
1186 PINMUX_IPSR_MODSEL_DATA(IP8_29_28, IRQ3_A, SEL_INTC_0),
1187 PINMUX_IPSR_MODSEL_DATA(IP8_29_28, RTS0_A, SEL_SCIF0_0),
1188 PINMUX_IPSR_MODSEL_DATA(IP8_29_28, HRTS0_B, SEL_HSCIF_1),
1189 PINMUX_IPSR_MODSEL_DATA(IP8_29_28, ET0_ERXD3_A, SEL_ET0_0),
1190
1191 /* IPSR9 */
1192 PINMUX_IPSR_MODSEL_DATA(IP9_1_0, VI1_CLK_A, SEL_VIN1_0),
1193 PINMUX_IPSR_MODSEL_DATA(IP9_1_0, FD0_B, SEL_FLCTL_1),
1194 PINMUX_IPSR_MODSEL_DATA(IP9_1_0, LCD_DATA0_B, SEL_LCDC_1),
1195
1196 PINMUX_IPSR_MODSEL_DATA(IP9_3_2, VI1_0_A, SEL_VIN1_0),
1197 PINMUX_IPSR_MODSEL_DATA(IP9_3_2, FD1_B, SEL_FLCTL_1),
1198 PINMUX_IPSR_MODSEL_DATA(IP9_3_2, LCD_DATA1_B, SEL_LCDC_1),
1199
1200 PINMUX_IPSR_MODSEL_DATA(IP9_5_4, VI1_1_A, SEL_VIN1_0),
1201 PINMUX_IPSR_MODSEL_DATA(IP9_5_4, FD2_B, SEL_FLCTL_1),
1202 PINMUX_IPSR_MODSEL_DATA(IP9_5_4, LCD_DATA2_B, SEL_LCDC_1),
1203
1204 PINMUX_IPSR_MODSEL_DATA(IP9_7_6, VI1_2_A, SEL_VIN1_0),
1205 PINMUX_IPSR_MODSEL_DATA(IP9_7_6, FD3_B, SEL_FLCTL_1),
1206 PINMUX_IPSR_MODSEL_DATA(IP9_7_6, LCD_DATA3_B, SEL_LCDC_1),
1207
1208 PINMUX_IPSR_MODSEL_DATA(IP9_9_8, VI1_3_A, SEL_VIN1_0),
1209 PINMUX_IPSR_MODSEL_DATA(IP9_9_8, FD4_B, SEL_FLCTL_1),
1210 PINMUX_IPSR_MODSEL_DATA(IP9_9_8, LCD_DATA4_B, SEL_LCDC_1),
1211
1212 PINMUX_IPSR_MODSEL_DATA(IP9_11_10, VI1_4_A, SEL_VIN1_0),
1213 PINMUX_IPSR_MODSEL_DATA(IP9_11_10, FD5_B, SEL_FLCTL_1),
1214 PINMUX_IPSR_MODSEL_DATA(IP9_11_10, LCD_DATA5_B, SEL_LCDC_1),
1215
1216 PINMUX_IPSR_MODSEL_DATA(IP9_13_12, VI1_5_A, SEL_VIN1_0),
1217 PINMUX_IPSR_MODSEL_DATA(IP9_13_12, FD6_B, SEL_FLCTL_1),
1218 PINMUX_IPSR_MODSEL_DATA(IP9_13_12, LCD_DATA6_B, SEL_LCDC_1),
1219
1220 PINMUX_IPSR_MODSEL_DATA(IP9_15_14, VI1_6_A, SEL_VIN1_0),
1221 PINMUX_IPSR_MODSEL_DATA(IP9_15_14, FD7_B, SEL_FLCTL_1),
1222 PINMUX_IPSR_MODSEL_DATA(IP9_15_14, LCD_DATA7_B, SEL_LCDC_1),
1223
1224 PINMUX_IPSR_MODSEL_DATA(IP9_17_16, VI1_7_A, SEL_VIN1_0),
1225 PINMUX_IPSR_MODSEL_DATA(IP9_17_16, FCE_B, SEL_FLCTL_1),
1226 PINMUX_IPSR_MODSEL_DATA(IP9_17_16, LCD_DATA8_B, SEL_LCDC_1),
1227
1228 PINMUX_IPSR_MODSEL_DATA(IP9_19_18, SSI_SCK0_A, SEL_SSI0_0),
1229 PINMUX_IPSR_MODSEL_DATA(IP9_19_18, TIOC1A_B, SEL_MTU2_CH1_1),
1230 PINMUX_IPSR_MODSEL_DATA(IP9_19_18, LCD_DATA9_B, SEL_LCDC_1),
1231
1232 PINMUX_IPSR_MODSEL_DATA(IP9_21_20, SSI_WS0_A, SEL_SSI0_0),
1233 PINMUX_IPSR_MODSEL_DATA(IP9_21_20, TIOC1B_B, SEL_MTU2_CH1_1),
1234 PINMUX_IPSR_MODSEL_DATA(IP9_21_20, LCD_DATA10_B, SEL_LCDC_1),
1235
1236 PINMUX_IPSR_MODSEL_DATA(IP9_23_22, SSI_SDATA0_A, SEL_SSI0_0),
1237 PINMUX_IPSR_MODSEL_DATA(IP9_23_22, VI1_0_B, SEL_VIN1_1),
1238 PINMUX_IPSR_MODSEL_DATA(IP9_23_22, TIOC2A_B, SEL_MTU2_CH2_1),
1239 PINMUX_IPSR_MODSEL_DATA(IP9_23_22, LCD_DATA11_B, SEL_LCDC_1),
1240
1241 PINMUX_IPSR_MODSEL_DATA(IP9_25_24, SSI_SCK1_A, SEL_SSI1_0),
1242 PINMUX_IPSR_MODSEL_DATA(IP9_25_24, VI1_1_B, SEL_VIN1_1),
1243 PINMUX_IPSR_MODSEL_DATA(IP9_25_24, TIOC2B_B, SEL_MTU2_CH2_1),
1244 PINMUX_IPSR_MODSEL_DATA(IP9_25_24, LCD_DATA12_B, SEL_LCDC_1),
1245
1246 PINMUX_IPSR_MODSEL_DATA(IP9_27_26, SSI_WS1_A, SEL_SSI1_0),
1247 PINMUX_IPSR_MODSEL_DATA(IP9_27_26, VI1_2_B, SEL_VIN1_1),
1248 PINMUX_IPSR_MODSEL_DATA(IP9_27_26, LCD_DATA13_B, SEL_LCDC_1),
1249
1250 PINMUX_IPSR_MODSEL_DATA(IP9_29_28, SSI_SDATA1_A, SEL_SSI1_0),
1251 PINMUX_IPSR_MODSEL_DATA(IP9_29_28, VI1_3_B, SEL_VIN1_1),
1252 PINMUX_IPSR_MODSEL_DATA(IP9_29_28, LCD_DATA14_B, SEL_LCDC_1),
1253
1254 /* IPSE10 */
1255 PINMUX_IPSR_DATA(IP10_2_0, SSI_SCK23),
1256 PINMUX_IPSR_MODSEL_DATA(IP10_2_0, VI1_4_B, SEL_VIN1_1),
1257 PINMUX_IPSR_MODSEL_DATA(IP10_2_0, RX1_D, SEL_SCIF1_3),
1258 PINMUX_IPSR_MODSEL_DATA(IP10_2_0, FCLE_B, SEL_FLCTL_1),
1259 PINMUX_IPSR_MODSEL_DATA(IP10_2_0, LCD_DATA15_B, SEL_LCDC_1),
1260
1261 PINMUX_IPSR_DATA(IP10_5_3, SSI_WS23),
1262 PINMUX_IPSR_MODSEL_DATA(IP10_5_3, VI1_5_B, SEL_VIN1_1),
1263 PINMUX_IPSR_MODSEL_DATA(IP10_5_3, TX1_D, SEL_SCIF1_3),
1264 PINMUX_IPSR_MODSEL_DATA(IP10_5_3, HSCK0_C, SEL_HSCIF_2),
1265 PINMUX_IPSR_MODSEL_DATA(IP10_5_3, FALE_B, SEL_FLCTL_1),
1266 PINMUX_IPSR_MODSEL_DATA(IP10_5_3, LCD_DON_B, SEL_LCDC_1),
1267
1268 PINMUX_IPSR_DATA(IP10_8_6, SSI_SDATA2),
1269 PINMUX_IPSR_MODSEL_DATA(IP10_8_6, VI1_6_B, SEL_VIN1_1),
1270 PINMUX_IPSR_MODSEL_DATA(IP10_8_6, HRX0_C, SEL_HSCIF_2),
1271 PINMUX_IPSR_MODSEL_DATA(IP10_8_6, FRE_B, SEL_FLCTL_1),
1272 PINMUX_IPSR_MODSEL_DATA(IP10_8_6, LCD_CL1_B, SEL_LCDC_1),
1273
1274 PINMUX_IPSR_DATA(IP10_11_9, SSI_SDATA3),
1275 PINMUX_IPSR_MODSEL_DATA(IP10_11_9, VI1_7_B, SEL_VIN1_1),
1276 PINMUX_IPSR_MODSEL_DATA(IP10_11_9, HTX0_C, SEL_HSCIF_2),
1277 PINMUX_IPSR_MODSEL_DATA(IP10_11_9, FWE_B, SEL_FLCTL_1),
1278 PINMUX_IPSR_MODSEL_DATA(IP10_11_9, LCD_CL2_B, SEL_LCDC_1),
1279
1280 PINMUX_IPSR_MODSEL_DATA(IP10_14_12, AUDIO_CLKA_A, SEL_AUDIO_CLKA_0),
1281 PINMUX_IPSR_MODSEL_DATA(IP10_14_12, VI1_CLK_B, SEL_VIN1_1),
1282 PINMUX_IPSR_MODSEL_DATA(IP10_14_12, SCK1_D, SEL_SCIF1_3),
1283 PINMUX_IPSR_MODSEL_DATA(IP10_14_12, IECLK_B, SEL_IEBUS_1),
1284 PINMUX_IPSR_MODSEL_DATA(IP10_14_12, LCD_FLM_B, SEL_LCDC_1),
1285
1286 PINMUX_IPSR_MODSEL_DATA(IP10_15, AUDIO_CLKB_A, SEL_AUDIO_CLKB_0),
1287 PINMUX_IPSR_MODSEL_DATA(IP10_15, LCD_CLK_B, SEL_LCDC_1),
1288
1289 PINMUX_IPSR_DATA(IP10_18_16, AUDIO_CLKC),
1290 PINMUX_IPSR_MODSEL_DATA(IP10_18_16, SCK1_E, SEL_SCIF1_4),
1291 PINMUX_IPSR_MODSEL_DATA(IP10_18_16, HCTS0_C, SEL_HSCIF_2),
1292 PINMUX_IPSR_MODSEL_DATA(IP10_18_16, FRB_B, SEL_FLCTL_1),
1293 PINMUX_IPSR_MODSEL_DATA(IP10_18_16, LCD_VEPWC_B, SEL_LCDC_1),
1294
1295 PINMUX_IPSR_DATA(IP10_21_19, AUDIO_CLKOUT),
1296 PINMUX_IPSR_MODSEL_DATA(IP10_21_19, TX1_E, SEL_SCIF1_4),
1297 PINMUX_IPSR_MODSEL_DATA(IP10_21_19, HRTS0_C, SEL_HSCIF_2),
1298 PINMUX_IPSR_MODSEL_DATA(IP10_21_19, FSE_B, SEL_FLCTL_1),
1299 PINMUX_IPSR_MODSEL_DATA(IP10_21_19, LCD_M_DISP_B, SEL_LCDC_1),
1300
1301 PINMUX_IPSR_MODSEL_DATA(IP10_22, CAN_CLK_A, SEL_RCAN_CLK_0),
1302 PINMUX_IPSR_MODSEL_DATA(IP10_22, RX4_D, SEL_SCIF4_3),
1303
1304 PINMUX_IPSR_MODSEL_DATA(IP10_24_23, CAN0_TX_A, SEL_RCAN0_0),
1305 PINMUX_IPSR_MODSEL_DATA(IP10_24_23, TX4_D, SEL_SCIF4_3),
1306 PINMUX_IPSR_DATA(IP10_24_23, MLB_CLK),
1307
1308 PINMUX_IPSR_MODSEL_DATA(IP10_25, CAN1_RX_A, SEL_RCAN1_0),
1309 PINMUX_IPSR_MODSEL_DATA(IP10_25, IRQ1_B, SEL_INTC_1),
1310
1311 PINMUX_IPSR_MODSEL_DATA(IP10_27_26, CAN0_RX_A, SEL_RCAN0_0),
1312 PINMUX_IPSR_MODSEL_DATA(IP10_27_26, IRQ0_B, SEL_INTC_1),
1313 PINMUX_IPSR_DATA(IP10_27_26, MLB_SIG),
1314
1315 PINMUX_IPSR_MODSEL_DATA(IP10_29_28, CAN1_TX_A, SEL_RCAN1_0),
1316 PINMUX_IPSR_MODSEL_DATA(IP10_29_28, TX5_C, SEL_SCIF1_2),
1317 PINMUX_IPSR_DATA(IP10_29_28, MLB_DAT),
1318
1319 /* IPSR11 */
1320 PINMUX_IPSR_DATA(IP11_0, SCL1),
1321 PINMUX_IPSR_MODSEL_DATA(IP11_0, SCIF_CLK_C, SEL_SCIF_CLK_2),
1322
1323 PINMUX_IPSR_DATA(IP11_1, SDA1),
1324 PINMUX_IPSR_MODSEL_DATA(IP11_0, RX1_E, SEL_SCIF1_4),
1325
1326 PINMUX_IPSR_DATA(IP11_2, SDA0),
1327 PINMUX_IPSR_MODSEL_DATA(IP11_2, HIFEBL_A, SEL_HIF_0),
1328
1329 PINMUX_IPSR_DATA(IP11_3, SDSELF),
1330 PINMUX_IPSR_MODSEL_DATA(IP11_3, RTS1_E, SEL_SCIF1_3),
1331
1332 PINMUX_IPSR_MODSEL_DATA(IP11_6_4, SCIF_CLK_A, SEL_SCIF_CLK_0),
1333 PINMUX_IPSR_MODSEL_DATA(IP11_6_4, HSPI_CLK_A, SEL_HSPI_0),
1334 PINMUX_IPSR_DATA(IP11_6_4, VI0_CLK),
1335 PINMUX_IPSR_MODSEL_DATA(IP11_6_4, RMII0_TXD0_A, SEL_RMII_0),
1336 PINMUX_IPSR_DATA(IP11_6_4, ET0_ERXD4),
1337
1338 PINMUX_IPSR_MODSEL_DATA(IP11_9_7, SCK0_A, SEL_SCIF0_0),
1339 PINMUX_IPSR_MODSEL_DATA(IP11_9_7, HSPI_CS_A, SEL_HSPI_0),
1340 PINMUX_IPSR_DATA(IP11_9_7, VI0_CLKENB),
1341 PINMUX_IPSR_MODSEL_DATA(IP11_9_7, RMII0_TXD1_A, SEL_RMII_0),
1342 PINMUX_IPSR_DATA(IP11_9_7, ET0_ERXD5),
1343
1344 PINMUX_IPSR_MODSEL_DATA(IP11_11_10, RX0_A, SEL_SCIF0_0),
1345 PINMUX_IPSR_MODSEL_DATA(IP11_11_10, HSPI_RX_A, SEL_HSPI_0),
1346 PINMUX_IPSR_MODSEL_DATA(IP11_11_10, RMII0_RXD0_A, SEL_RMII_0),
1347 PINMUX_IPSR_DATA(IP11_11_10, ET0_ERXD6),
1348
1349 PINMUX_IPSR_MODSEL_DATA(IP11_12, TX0_A, SEL_SCIF0_0),
1350 PINMUX_IPSR_MODSEL_DATA(IP11_12, HSPI_TX_A, SEL_HSPI_0),
1351
1352 PINMUX_IPSR_DATA(IP11_15_13, PENC1),
1353 PINMUX_IPSR_MODSEL_DATA(IP11_15_13, TX3_D, SEL_SCIF3_3),
1354 PINMUX_IPSR_MODSEL_DATA(IP11_15_13, CAN1_TX_B, SEL_RCAN1_1),
1355 PINMUX_IPSR_MODSEL_DATA(IP11_15_13, TX5_D, SEL_SCIF5_3),
1356 PINMUX_IPSR_MODSEL_DATA(IP11_15_13, IETX_B, SEL_IEBUS_1),
1357
1358 PINMUX_IPSR_DATA(IP11_18_16, USB_OVC1),
1359 PINMUX_IPSR_MODSEL_DATA(IP11_18_16, RX3_D, SEL_SCIF3_3),
1360 PINMUX_IPSR_MODSEL_DATA(IP11_18_16, CAN1_RX_B, SEL_RCAN1_1),
1361 PINMUX_IPSR_MODSEL_DATA(IP11_18_16, RX5_D, SEL_SCIF5_3),
1362 PINMUX_IPSR_MODSEL_DATA(IP11_18_16, IERX_B, SEL_IEBUS_1),
1363
1364 PINMUX_IPSR_DATA(IP11_20_19, DREQ0),
1365 PINMUX_IPSR_MODSEL_DATA(IP11_20_19, SD1_CLK_A, SEL_SDHI1_0),
1366 PINMUX_IPSR_DATA(IP11_20_19, ET0_TX_EN),
1367
1368 PINMUX_IPSR_DATA(IP11_22_21, DACK0),
1369 PINMUX_IPSR_MODSEL_DATA(IP11_22_21, SD1_DAT3_A, SEL_SDHI1_0),
1370 PINMUX_IPSR_DATA(IP11_22_21, ET0_TX_ER),
1371
1372 PINMUX_IPSR_DATA(IP11_25_23, DREQ1),
1373 PINMUX_IPSR_MODSEL_DATA(IP11_25_23, HSPI_CLK_B, SEL_HSPI_1),
1374 PINMUX_IPSR_MODSEL_DATA(IP11_25_23, RX4_B, SEL_SCIF4_1),
1375 PINMUX_IPSR_MODSEL_DATA(IP11_25_23, ET0_PHY_INT_C, SEL_ET0_CTL_0),
1376 PINMUX_IPSR_MODSEL_DATA(IP11_25_23, ET0_TX_CLK_A, SEL_ET0_0),
1377
1378 PINMUX_IPSR_DATA(IP11_27_26, DACK1),
1379 PINMUX_IPSR_MODSEL_DATA(IP11_27_26, HSPI_CS_B, SEL_HSPI_1),
1380 PINMUX_IPSR_MODSEL_DATA(IP11_27_26, TX4_B, SEL_SCIF3_1),
1381 PINMUX_IPSR_MODSEL_DATA(IP11_27_26, ET0_RX_CLK_A, SEL_ET0_0),
1382
1383 PINMUX_IPSR_DATA(IP11_28, PRESETOUT),
1384 PINMUX_IPSR_DATA(IP11_28, ST_CLKOUT),
1385};
1386
1387static struct pinmux_gpio pinmux_gpios[] = {
1388 PINMUX_GPIO_GP_ALL(),
1389
1390 GPIO_FN(CLKOUT), GPIO_FN(BS), GPIO_FN(CS0), GPIO_FN(EX_CS0),
1391 GPIO_FN(RD), GPIO_FN(WE0), GPIO_FN(WE1),
1392 GPIO_FN(SCL0), GPIO_FN(PENC0), GPIO_FN(USB_OVC0),
1393 GPIO_FN(IRQ2_B), GPIO_FN(IRQ3_B),
1394
1395 /* IPSR0 */
1396 GPIO_FN(A0), GPIO_FN(ST0_CLKIN), GPIO_FN(LCD_DATA0_A),
1397 GPIO_FN(TCLKA_C),
1398 GPIO_FN(A1), GPIO_FN(ST0_REQ), GPIO_FN(LCD_DATA1_A),
1399 GPIO_FN(TCLKB_C),
1400 GPIO_FN(A2), GPIO_FN(ST0_SYC), GPIO_FN(LCD_DATA2_A),
1401 GPIO_FN(TCLKC_C),
1402 GPIO_FN(A3), GPIO_FN(ST0_VLD), GPIO_FN(LCD_DATA3_A),
1403 GPIO_FN(TCLKD_C),
1404 GPIO_FN(A4), GPIO_FN(ST0_D0), GPIO_FN(LCD_DATA4_A),
1405 GPIO_FN(TIOC0A_C),
1406 GPIO_FN(A5), GPIO_FN(ST0_D1), GPIO_FN(LCD_DATA5_A),
1407 GPIO_FN(TIOC0B_C),
1408 GPIO_FN(A6), GPIO_FN(ST0_D2), GPIO_FN(LCD_DATA6_A),
1409 GPIO_FN(TIOC0C_C),
1410 GPIO_FN(A7), GPIO_FN(ST0_D3), GPIO_FN(LCD_DATA7_A),
1411 GPIO_FN(TIOC0D_C),
1412 GPIO_FN(A8), GPIO_FN(ST0_D4), GPIO_FN(LCD_DATA8_A),
1413 GPIO_FN(TIOC1A_C),
1414 GPIO_FN(A9), GPIO_FN(ST0_D5), GPIO_FN(LCD_DATA9_A),
1415 GPIO_FN(TIOC1B_C),
1416 GPIO_FN(A10), GPIO_FN(ST0_D6), GPIO_FN(LCD_DATA10_A),
1417 GPIO_FN(TIOC2A_C),
1418 GPIO_FN(A11), GPIO_FN(ST0_D7), GPIO_FN(LCD_DATA11_A),
1419 GPIO_FN(TIOC2B_C),
1420 GPIO_FN(A12), GPIO_FN(LCD_DATA12_A), GPIO_FN(TIOC3A_C),
1421 GPIO_FN(A13), GPIO_FN(LCD_DATA13_A), GPIO_FN(TIOC3B_C),
1422 GPIO_FN(A14), GPIO_FN(LCD_DATA14_A), GPIO_FN(TIOC3C_C),
1423 GPIO_FN(A15), GPIO_FN(ST0_VCO_CLKIN), GPIO_FN(LCD_DATA15_A),
1424 GPIO_FN(TIOC3D_C),
1425
1426 /* IPSR1 */
1427 GPIO_FN(A16), GPIO_FN(ST0_PWM), GPIO_FN(LCD_DON_A),
1428 GPIO_FN(TIOC4A_C),
1429 GPIO_FN(A17), GPIO_FN(ST1_VCO_CLKIN), GPIO_FN(LCD_CL1_A),
1430 GPIO_FN(TIOC4B_C),
1431 GPIO_FN(A18), GPIO_FN(ST1_PWM), GPIO_FN(LCD_CL2_A),
1432 GPIO_FN(TIOC4C_C),
1433 GPIO_FN(A19), GPIO_FN(ST1_CLKIN), GPIO_FN(LCD_CLK_A),
1434 GPIO_FN(TIOC4D_C),
1435 GPIO_FN(A20), GPIO_FN(ST1_REQ), GPIO_FN(LCD_FLM_A),
1436 GPIO_FN(A21), GPIO_FN(ST1_SYC), GPIO_FN(LCD_VCPWC_A),
1437 GPIO_FN(A22), GPIO_FN(ST1_VLD), GPIO_FN(LCD_VEPWC_A),
1438 GPIO_FN(A23), GPIO_FN(ST1_D0), GPIO_FN(LCD_M_DISP_A),
1439 GPIO_FN(A24), GPIO_FN(RX2_D), GPIO_FN(ST1_D1),
1440 GPIO_FN(A25), GPIO_FN(TX2_D), GPIO_FN(ST1_D2),
1441 GPIO_FN(D0), GPIO_FN(SD0_DAT0_A), GPIO_FN(MMC_D0_A),
1442 GPIO_FN(ST1_D3), GPIO_FN(FD0_A),
1443 GPIO_FN(D1), GPIO_FN(SD0_DAT1_A), GPIO_FN(MMC_D1_A),
1444 GPIO_FN(ST1_D4), GPIO_FN(FD1_A),
1445 GPIO_FN(D2), GPIO_FN(SD0_DAT2_A), GPIO_FN(MMC_D2_A),
1446 GPIO_FN(ST1_D5), GPIO_FN(FD2_A),
1447 GPIO_FN(D3), GPIO_FN(SD0_DAT3_A), GPIO_FN(MMC_D3_A),
1448 GPIO_FN(ST1_D6), GPIO_FN(FD3_A),
1449
1450 /* IPSR2 */
1451 GPIO_FN(D4), GPIO_FN(SD0_CD_A), GPIO_FN(MMC_D4_A), GPIO_FN(ST1_D7),
1452 GPIO_FN(FD4_A),
1453 GPIO_FN(D5), GPIO_FN(SD0_WP_A), GPIO_FN(MMC_D5_A), GPIO_FN(FD5_A),
1454 GPIO_FN(D6), GPIO_FN(RSPI_RSPCK_A), GPIO_FN(MMC_D6_A),
1455 GPIO_FN(QSPCLK_A),
1456 GPIO_FN(FD6_A),
1457 GPIO_FN(D7), GPIO_FN(RSPI_SSL_A), GPIO_FN(MMC_D7_A), GPIO_FN(QSSL_A),
1458 GPIO_FN(FD7_A),
1459 GPIO_FN(D8), GPIO_FN(SD0_CLK_A), GPIO_FN(MMC_CLK_A), GPIO_FN(QIO2_A),
1460 GPIO_FN(FCE_A), GPIO_FN(ET0_GTX_CLK_B),
1461 GPIO_FN(D9), GPIO_FN(SD0_CMD_A), GPIO_FN(MMC_CMD_A), GPIO_FN(QIO3_A),
1462 GPIO_FN(FCLE_A), GPIO_FN(ET0_ETXD1_B),
1463 GPIO_FN(D10), GPIO_FN(RSPI_MOSI_A), GPIO_FN(QMO_QIO0_A),
1464 GPIO_FN(FALE_A), GPIO_FN(ET0_ETXD2_B),
1465 GPIO_FN(D11), GPIO_FN(RSPI_MISO_A), GPIO_FN(QMI_QIO1_A), GPIO_FN(FRE_A),
1466 GPIO_FN(ET0_ETXD3_B),
1467 GPIO_FN(D12), GPIO_FN(FWE_A), GPIO_FN(ET0_ETXD5_B),
1468 GPIO_FN(D13), GPIO_FN(RX2_B), GPIO_FN(FRB_A), GPIO_FN(ET0_ETXD6_B),
1469 GPIO_FN(D14), GPIO_FN(TX2_B), GPIO_FN(FSE_A), GPIO_FN(ET0_TX_CLK_B),
1470
1471 /* IPSR3 */
1472 GPIO_FN(D15), GPIO_FN(SCK2_B),
1473 GPIO_FN(CS1_A26), GPIO_FN(QIO3_B),
1474 GPIO_FN(EX_CS1), GPIO_FN(RX3_B), GPIO_FN(ATACS0), GPIO_FN(QIO2_B),
1475 GPIO_FN(ET0_ETXD0),
1476 GPIO_FN(EX_CS2), GPIO_FN(TX3_B), GPIO_FN(ATACS1), GPIO_FN(QSPCLK_B),
1477 GPIO_FN(ET0_GTX_CLK_A),
1478 GPIO_FN(EX_CS3), GPIO_FN(SD1_CD_A), GPIO_FN(ATARD), GPIO_FN(QMO_QIO0_B),
1479 GPIO_FN(ET0_ETXD1_A),
1480 GPIO_FN(EX_CS4), GPIO_FN(SD1_WP_A), GPIO_FN(ATAWR), GPIO_FN(QMI_QIO1_B),
1481 GPIO_FN(ET0_ETXD2_A),
1482 GPIO_FN(EX_CS5), GPIO_FN(SD1_CMD_A), GPIO_FN(ATADIR), GPIO_FN(QSSL_B),
1483 GPIO_FN(ET0_ETXD3_A),
1484 GPIO_FN(RD_WR), GPIO_FN(TCLK1_B),
1485 GPIO_FN(EX_WAIT0), GPIO_FN(TCLK1_B),
1486 GPIO_FN(EX_WAIT1), GPIO_FN(SD1_DAT0_A), GPIO_FN(DREQ2),
1487 GPIO_FN(CAN1_TX_C), GPIO_FN(ET0_LINK_C), GPIO_FN(ET0_ETXD5_A),
1488 GPIO_FN(EX_WAIT2), GPIO_FN(SD1_DAT1_A), GPIO_FN(DACK2),
1489 GPIO_FN(CAN1_RX_C), GPIO_FN(ET0_MAGIC_C), GPIO_FN(ET0_ETXD6_A),
1490 GPIO_FN(DRACK0), GPIO_FN(SD1_DAT2_A), GPIO_FN(ATAG), GPIO_FN(TCLK1_A),
1491 GPIO_FN(ET0_ETXD7),
1492
1493 /* IPSR4 */
1494 GPIO_FN(HCTS0_A), GPIO_FN(CTS1_A), GPIO_FN(VI0_FIELD),
1495 GPIO_FN(RMII0_RXD1_A), GPIO_FN(ET0_ERXD7),
1496 GPIO_FN(HRTS0_A), GPIO_FN(RTS1_A), GPIO_FN(VI0_HSYNC),
1497 GPIO_FN(RMII0_TXD_EN_A), GPIO_FN(ET0_RX_DV),
1498 GPIO_FN(HSCK0_A), GPIO_FN(SCK1_A), GPIO_FN(VI0_VSYNC),
1499 GPIO_FN(RMII0_RX_ER_A), GPIO_FN(ET0_RX_ER),
1500 GPIO_FN(HRX0_A), GPIO_FN(RX1_A), GPIO_FN(VI0_DATA0_VI0_B0),
1501 GPIO_FN(RMII0_CRS_DV_A), GPIO_FN(ET0_CRS),
1502 GPIO_FN(HTX0_A), GPIO_FN(TX1_A), GPIO_FN(VI0_DATA1_VI0_B1),
1503 GPIO_FN(RMII0_MDC_A), GPIO_FN(ET0_COL),
1504 GPIO_FN(CTS0_B), GPIO_FN(VI0_DATA2_VI0_B2), GPIO_FN(RMII0_MDIO_A),
1505 GPIO_FN(ET0_MDC),
1506 GPIO_FN(RTS0_B), GPIO_FN(VI0_DATA3_VI0_B3), GPIO_FN(ET0_MDIO_A),
1507 GPIO_FN(SCK1_B), GPIO_FN(VI0_DATA4_VI0_B4), GPIO_FN(ET0_LINK_A),
1508 GPIO_FN(RX1_B), GPIO_FN(VI0_DATA5_VI0_B5), GPIO_FN(ET0_MAGIC_A),
1509 GPIO_FN(TX1_B), GPIO_FN(VI0_DATA6_VI0_G0), GPIO_FN(ET0_PHY_INT_A),
1510 GPIO_FN(CTS1_B), GPIO_FN(VI0_DATA7_VI0_G1),
1511 GPIO_FN(RTS1_B), GPIO_FN(VI0_G2),
1512 GPIO_FN(SCK2_A), GPIO_FN(VI0_G3),
1513
1514 /* IPSR5 */
1515 GPIO_FN(REF50CK), GPIO_FN(CTS1_E), GPIO_FN(HCTS0_D),
1516 GPIO_FN(REF125CK), GPIO_FN(ADTRG), GPIO_FN(RX5_C),
1517 GPIO_FN(SD2_WP_A), GPIO_FN(TX5_A), GPIO_FN(VI0_R5),
1518 GPIO_FN(SD2_CD_A), GPIO_FN(RX5_A), GPIO_FN(VI0_R4),
1519 GPIO_FN(ET0_PHY_INT_B),
1520 GPIO_FN(SD2_DAT3_A), GPIO_FN(TX4_A), GPIO_FN(VI0_R3),
1521 GPIO_FN(ET0_MAGIC_B),
1522 GPIO_FN(SD2_DAT2_A), GPIO_FN(RX4_A), GPIO_FN(VI0_R2),
1523 GPIO_FN(ET0_LINK_B),
1524 GPIO_FN(SD2_DAT1_A), GPIO_FN(TX3_A), GPIO_FN(VI0_R1),
1525 GPIO_FN(ET0_MDIO_B),
1526 GPIO_FN(SD2_DAT0_A), GPIO_FN(RX3_A), GPIO_FN(VI0_R0),
1527 GPIO_FN(ET0_ERXD3_B),
1528 GPIO_FN(SD2_CMD_A), GPIO_FN(TX2_A), GPIO_FN(VI0_G5),
1529 GPIO_FN(ET0_ERXD2_B),
1530 GPIO_FN(SD2_CLK_A), GPIO_FN(RX2_A), GPIO_FN(VI0_G4),
1531 GPIO_FN(ET0_RX_CLK_B),
1532
1533 /* IPSR6 */
1534 GPIO_FN(DU0_DG1), GPIO_FN(CTS1_C), GPIO_FN(HRTS0_D),
1535 GPIO_FN(TIOC1B_A), GPIO_FN(HIFD09),
1536 GPIO_FN(DU0_DG0), GPIO_FN(TX1_C), GPIO_FN(HSCK0_D),
1537 GPIO_FN(IECLK_A), GPIO_FN(TIOC1A_A), GPIO_FN(HIFD08),
1538 GPIO_FN(DU0_DR7), GPIO_FN(RX1_C), GPIO_FN(TIOC0D_A),
1539 GPIO_FN(HIFD07),
1540 GPIO_FN(DU0_DR6), GPIO_FN(SCK1_C), GPIO_FN(TIOC0C_A),
1541 GPIO_FN(HIFD06),
1542 GPIO_FN(DU0_DR5), GPIO_FN(RTS0_C), GPIO_FN(TIOC0B_A),
1543 GPIO_FN(HIFD05),
1544 GPIO_FN(DU0_DR4), GPIO_FN(CTS0_C), GPIO_FN(TIOC0A_A),
1545 GPIO_FN(HIFD04),
1546 GPIO_FN(DU0_DR3), GPIO_FN(TX0_B), GPIO_FN(TCLKD_A), GPIO_FN(HIFD03),
1547 GPIO_FN(DU0_DR2), GPIO_FN(RX0_B), GPIO_FN(TCLKC_A), GPIO_FN(HIFD02),
1548 GPIO_FN(DU0_DR1), GPIO_FN(SCK0_B), GPIO_FN(HTX0_D),
1549 GPIO_FN(IERX_A), GPIO_FN(TCLKB_A), GPIO_FN(HIFD01),
1550 GPIO_FN(DU0_DR0), GPIO_FN(SCIF_CLK_B), GPIO_FN(HRX0_D),
1551 GPIO_FN(IETX_A), GPIO_FN(TCLKA_A), GPIO_FN(HIFD00),
1552
1553 /* IPSR7 */
1554 GPIO_FN(DU0_DB4), GPIO_FN(HIFINT),
1555 GPIO_FN(DU0_DB3), GPIO_FN(TX5_B), GPIO_FN(TIOC4D_A), GPIO_FN(HIFRD),
1556 GPIO_FN(DU0_DB2), GPIO_FN(RX5_B), GPIO_FN(RMII0_TXD1_B),
1557 GPIO_FN(TIOC4C_A), GPIO_FN(HIFWR),
1558 GPIO_FN(DU0_DB1), GPIO_FN(TX4_C), GPIO_FN(RMII0_TXD0_B),
1559 GPIO_FN(TIOC4B_A), GPIO_FN(HIFRS),
1560 GPIO_FN(DU0_DB0), GPIO_FN(RX4_C), GPIO_FN(RMII0_TXD_EN_B),
1561 GPIO_FN(TIOC4A_A), GPIO_FN(HIFCS),
1562 GPIO_FN(DU0_DG7), GPIO_FN(TX3_C), GPIO_FN(RMII0_RXD1_B),
1563 GPIO_FN(TIOC3D_A), GPIO_FN(HIFD15),
1564 GPIO_FN(DU0_DG6), GPIO_FN(RX3_C), GPIO_FN(RMII0_RXD0_B),
1565 GPIO_FN(TIOC3C_A), GPIO_FN(HIFD14),
1566 GPIO_FN(DU0_DG5), GPIO_FN(TX2_C), GPIO_FN(RMII0_RX_ER_B),
1567 GPIO_FN(TIOC3B_A), GPIO_FN(HIFD13),
1568 GPIO_FN(DU0_DG4), GPIO_FN(RX2_C), GPIO_FN(RMII0_CRS_DV_B),
1569 GPIO_FN(TIOC3A_A), GPIO_FN(HIFD12),
1570 GPIO_FN(DU0_DG3), GPIO_FN(SCK2_C), GPIO_FN(RMII0_MDIO_B),
1571 GPIO_FN(TIOC2B_A), GPIO_FN(HIFD11),
1572 GPIO_FN(DU0_DG2), GPIO_FN(RTS1_C), GPIO_FN(RMII0_MDC_B),
1573 GPIO_FN(TIOC2A_A), GPIO_FN(HIFD10),
1574
1575 /* IPSR8 */
1576 GPIO_FN(IRQ3_A), GPIO_FN(RTS0_A), GPIO_FN(HRTS0_B),
1577 GPIO_FN(ET0_ERXD3_A),
1578 GPIO_FN(IRQ2_A), GPIO_FN(CTS0_A), GPIO_FN(HCTS0_B),
1579 GPIO_FN(ET0_ERXD2_A),
1580 GPIO_FN(IRQ1_A), GPIO_FN(HSPI_RX_B), GPIO_FN(TX3_E),
1581 GPIO_FN(ET0_ERXD1),
1582 GPIO_FN(IRQ0_A), GPIO_FN(HSPI_TX_B), GPIO_FN(RX3_E),
1583 GPIO_FN(ET0_ERXD0),
1584 GPIO_FN(DU0_CDE), GPIO_FN(HTX0_B), GPIO_FN(AUDIO_CLKB_B),
1585 GPIO_FN(LCD_VCPWC_B),
1586 GPIO_FN(DU0_DISP), GPIO_FN(CAN0_TX_B), GPIO_FN(HRX0_B),
1587 GPIO_FN(AUDIO_CLKA_B),
1588 GPIO_FN(DU0_EXODDF_DU0_ODDF), GPIO_FN(CAN0_RX_B), GPIO_FN(HSCK0_B),
1589 GPIO_FN(SSI_SDATA1_B),
1590 GPIO_FN(DU0_EXVSYNC_DU0_VSYNC), GPIO_FN(HSPI_RX0_C),
1591 GPIO_FN(SSI_WS1_B),
1592 GPIO_FN(DU0_EXHSYNC_DU0_HSYNC), GPIO_FN(HSPI_TX0_C),
1593 GPIO_FN(SSI_SCK1_B),
1594 GPIO_FN(DU0_DOTCLKOUT), GPIO_FN(HSPI_CLK0_C),
1595 GPIO_FN(SSI_SDATA0_B),
1596 GPIO_FN(DU0_DOTCLKIN), GPIO_FN(HSPI_CS0_C),
1597 GPIO_FN(SSI_WS0_B),
1598 GPIO_FN(DU0_DB7), GPIO_FN(SSI_SCK0_B), GPIO_FN(HIFEBL_B),
1599 GPIO_FN(DU0_DB6), GPIO_FN(HIFRDY),
1600 GPIO_FN(DU0_DB5), GPIO_FN(HIFDREQ),
1601
1602 /* IPSR9 */
1603 GPIO_FN(SSI_SDATA1_A), GPIO_FN(VI1_3_B), GPIO_FN(LCD_DATA14_B),
1604 GPIO_FN(SSI_WS1_A), GPIO_FN(VI1_2_B), GPIO_FN(LCD_DATA13_B),
1605 GPIO_FN(SSI_SCK1_A), GPIO_FN(VI1_1_B), GPIO_FN(TIOC2B_B),
1606 GPIO_FN(LCD_DATA12_B),
1607 GPIO_FN(SSI_SDATA0_A), GPIO_FN(VI1_0_B), GPIO_FN(TIOC2A_B),
1608 GPIO_FN(LCD_DATA11_B),
1609 GPIO_FN(SSI_WS0_A), GPIO_FN(TIOC1B_B), GPIO_FN(LCD_DATA10_B),
1610 GPIO_FN(SSI_SCK0_A), GPIO_FN(TIOC1A_B), GPIO_FN(LCD_DATA9_B),
1611 GPIO_FN(VI1_7_A), GPIO_FN(FCE_B), GPIO_FN(LCD_DATA8_B),
1612 GPIO_FN(VI1_6_A), GPIO_FN(FD7_B), GPIO_FN(LCD_DATA7_B),
1613 GPIO_FN(VI1_5_A), GPIO_FN(FD6_B), GPIO_FN(LCD_DATA6_B),
1614 GPIO_FN(VI1_4_A), GPIO_FN(FD5_B), GPIO_FN(LCD_DATA5_B),
1615 GPIO_FN(VI1_3_A), GPIO_FN(FD4_B), GPIO_FN(LCD_DATA4_B),
1616 GPIO_FN(VI1_2_A), GPIO_FN(FD3_B), GPIO_FN(LCD_DATA3_B),
1617 GPIO_FN(VI1_1_A), GPIO_FN(FD2_B), GPIO_FN(LCD_DATA2_B),
1618 GPIO_FN(VI1_0_A), GPIO_FN(FD1_B), GPIO_FN(LCD_DATA1_B),
1619 GPIO_FN(VI1_CLK_A), GPIO_FN(FD0_B), GPIO_FN(LCD_DATA0_B),
1620
1621 /* IPSR10 */
1622 GPIO_FN(CAN1_TX_A), GPIO_FN(TX5_C), GPIO_FN(MLB_DAT),
1623 GPIO_FN(CAN0_RX_A), GPIO_FN(IRQ0_B), GPIO_FN(MLB_SIG),
1624 GPIO_FN(CAN1_RX_A), GPIO_FN(IRQ1_B),
1625 GPIO_FN(CAN0_TX_A), GPIO_FN(TX4_D), GPIO_FN(MLB_CLK),
1626 GPIO_FN(CAN_CLK_A), GPIO_FN(RX4_D),
1627 GPIO_FN(AUDIO_CLKOUT), GPIO_FN(TX1_E), GPIO_FN(HRTS0_C),
1628 GPIO_FN(FSE_B), GPIO_FN(LCD_M_DISP_B),
1629 GPIO_FN(AUDIO_CLKC), GPIO_FN(SCK1_E), GPIO_FN(HCTS0_C),
1630 GPIO_FN(FRB_B), GPIO_FN(LCD_VEPWC_B),
1631 GPIO_FN(AUDIO_CLKB_A), GPIO_FN(LCD_CLK_B),
1632 GPIO_FN(AUDIO_CLKA_A), GPIO_FN(VI1_CLK_B), GPIO_FN(SCK1_D),
1633 GPIO_FN(IECLK_B), GPIO_FN(LCD_FLM_B),
1634 GPIO_FN(SSI_SDATA3), GPIO_FN(VI1_7_B), GPIO_FN(HTX0_C),
1635 GPIO_FN(FWE_B), GPIO_FN(LCD_CL2_B),
1636 GPIO_FN(SSI_SDATA2), GPIO_FN(VI1_6_B), GPIO_FN(HRX0_C),
1637 GPIO_FN(FRE_B), GPIO_FN(LCD_CL1_B),
1638 GPIO_FN(SSI_WS23), GPIO_FN(VI1_5_B), GPIO_FN(TX1_D),
1639 GPIO_FN(HSCK0_C), GPIO_FN(FALE_B), GPIO_FN(LCD_DON_B),
1640 GPIO_FN(SSI_SCK23), GPIO_FN(VI1_4_B), GPIO_FN(RX1_D),
1641 GPIO_FN(FCLE_B), GPIO_FN(LCD_DATA15_B),
1642
1643 /* IPSR11 */
1644 GPIO_FN(PRESETOUT), GPIO_FN(ST_CLKOUT),
1645 GPIO_FN(DACK1), GPIO_FN(HSPI_CS_B), GPIO_FN(TX4_B),
1646 GPIO_FN(ET0_RX_CLK_A),
1647 GPIO_FN(DREQ1), GPIO_FN(HSPI_CLK_B), GPIO_FN(RX4_B),
1648 GPIO_FN(ET0_PHY_INT_C), GPIO_FN(ET0_TX_CLK_A),
1649 GPIO_FN(DACK0), GPIO_FN(SD1_DAT3_A), GPIO_FN(ET0_TX_ER),
1650 GPIO_FN(DREQ0), GPIO_FN(SD1_CLK_A), GPIO_FN(ET0_TX_EN),
1651 GPIO_FN(USB_OVC1), GPIO_FN(RX3_D), GPIO_FN(CAN1_RX_B),
1652 GPIO_FN(RX5_D), GPIO_FN(IERX_B),
1653 GPIO_FN(PENC1), GPIO_FN(TX3_D), GPIO_FN(CAN1_TX_B),
1654 GPIO_FN(TX5_D), GPIO_FN(IETX_B),
1655 GPIO_FN(TX0_A), GPIO_FN(HSPI_TX_A),
1656 GPIO_FN(RX0_A), GPIO_FN(HSPI_RX_A), GPIO_FN(RMII0_RXD0_A),
1657 GPIO_FN(ET0_ERXD6),
1658 GPIO_FN(SCK0_A), GPIO_FN(HSPI_CS_A), GPIO_FN(VI0_CLKENB),
1659 GPIO_FN(RMII0_TXD1_A), GPIO_FN(ET0_ERXD5),
1660 GPIO_FN(SCIF_CLK_A), GPIO_FN(HSPI_CLK_A), GPIO_FN(VI0_CLK),
1661 GPIO_FN(RMII0_TXD0_A), GPIO_FN(ET0_ERXD4),
1662 GPIO_FN(SDSELF), GPIO_FN(RTS1_E),
1663 GPIO_FN(SDA0), GPIO_FN(HIFEBL_A),
1664 GPIO_FN(SDA1), GPIO_FN(RX1_E),
1665 GPIO_FN(SCL1), GPIO_FN(SCIF_CLK_C),
1666};
1667
1668static struct pinmux_cfg_reg pinmux_config_regs[] = {
1669 { PINMUX_CFG_REG("GPSR0", 0xFFFC0004, 32, 1) {
1670 GP_0_31_FN, FN_IP2_2_0,
1671 GP_0_30_FN, FN_IP1_31_29,
1672 GP_0_29_FN, FN_IP1_28_26,
1673 GP_0_28_FN, FN_IP1_25_23,
1674 GP_0_27_FN, FN_IP1_22_20,
1675 GP_0_26_FN, FN_IP1_19_18,
1676 GP_0_25_FN, FN_IP1_17_16,
1677 GP_0_24_FN, FN_IP0_5_4,
1678 GP_0_23_FN, FN_IP0_3_2,
1679 GP_0_22_FN, FN_IP0_1_0,
1680 GP_0_21_FN, FN_IP11_28,
1681 GP_0_20_FN, FN_IP1_7_6,
1682 GP_0_19_FN, FN_IP1_5_4,
1683 GP_0_18_FN, FN_IP1_3_2,
1684 GP_0_17_FN, FN_IP1_1_0,
1685 GP_0_16_FN, FN_IP0_31_30,
1686 GP_0_15_FN, FN_IP0_29_28,
1687 GP_0_14_FN, FN_IP0_27_26,
1688 GP_0_13_FN, FN_IP0_25_24,
1689 GP_0_12_FN, FN_IP0_23_22,
1690 GP_0_11_FN, FN_IP0_21_20,
1691 GP_0_10_FN, FN_IP0_19_18,
1692 GP_0_9_FN, FN_IP0_17_16,
1693 GP_0_8_FN, FN_IP0_15_14,
1694 GP_0_7_FN, FN_IP0_13_12,
1695 GP_0_6_FN, FN_IP0_11_10,
1696 GP_0_5_FN, FN_IP0_9_8,
1697 GP_0_4_FN, FN_IP0_7_6,
1698 GP_0_3_FN, FN_IP1_15_14,
1699 GP_0_2_FN, FN_IP1_13_12,
1700 GP_0_1_FN, FN_IP1_11_10,
1701 GP_0_0_FN, FN_IP1_9_8 }
1702 },
1703 { PINMUX_CFG_REG("GPSR1", 0xFFFC0008, 32, 1) {
1704 GP_1_31_FN, FN_IP11_25_23,
1705 GP_1_30_FN, FN_IP2_13_11,
1706 GP_1_29_FN, FN_IP2_10_8,
1707 GP_1_28_FN, FN_IP2_7_5,
1708 GP_1_27_FN, FN_IP3_26_24,
1709 GP_1_26_FN, FN_IP3_23_21,
1710 GP_1_25_FN, FN_IP2_4_3,
1711 GP_1_24_FN, FN_WE1,
1712 GP_1_23_FN, FN_WE0,
1713 GP_1_22_FN, FN_IP3_19_18,
1714 GP_1_21_FN, FN_RD,
1715 GP_1_20_FN, FN_IP3_17_15,
1716 GP_1_19_FN, FN_IP3_14_12,
1717 GP_1_18_FN, FN_IP3_11_9,
1718 GP_1_17_FN, FN_IP3_8_6,
1719 GP_1_16_FN, FN_IP3_5_3,
1720 GP_1_15_FN, FN_EX_CS0,
1721 GP_1_14_FN, FN_IP3_2,
1722 GP_1_13_FN, FN_CS0,
1723 GP_1_12_FN, FN_BS,
1724 GP_1_11_FN, FN_CLKOUT,
1725 GP_1_10_FN, FN_IP3_1_0,
1726 GP_1_9_FN, FN_IP2_30_28,
1727 GP_1_8_FN, FN_IP2_27_25,
1728 GP_1_7_FN, FN_IP2_24_23,
1729 GP_1_6_FN, FN_IP2_22_20,
1730 GP_1_5_FN, FN_IP2_19_17,
1731 GP_1_4_FN, FN_IP2_16_14,
1732 GP_1_3_FN, FN_IP11_22_21,
1733 GP_1_2_FN, FN_IP11_20_19,
1734 GP_1_1_FN, FN_IP3_29_27,
1735 GP_1_0_FN, FN_IP3_20 }
1736 },
1737 { PINMUX_CFG_REG("GPSR2", 0xFFFC000C, 32, 1) {
1738 GP_2_31_FN, FN_IP4_31_30,
1739 GP_2_30_FN, FN_IP5_2_0,
1740 GP_2_29_FN, FN_IP5_5_3,
1741 GP_2_28_FN, FN_IP5_8_6,
1742 GP_2_27_FN, FN_IP5_11_9,
1743 GP_2_26_FN, FN_IP5_14_12,
1744 GP_2_25_FN, FN_IP5_17_15,
1745 GP_2_24_FN, FN_IP5_20_18,
1746 GP_2_23_FN, FN_IP5_22_21,
1747 GP_2_22_FN, FN_IP5_24_23,
1748 GP_2_21_FN, FN_IP5_26_25,
1749 GP_2_20_FN, FN_IP4_29_28,
1750 GP_2_19_FN, FN_IP4_27_26,
1751 GP_2_18_FN, FN_IP4_25_24,
1752 GP_2_17_FN, FN_IP4_23_22,
1753 GP_2_16_FN, FN_IP4_21_20,
1754 GP_2_15_FN, FN_IP4_19_18,
1755 GP_2_14_FN, FN_IP4_17_15,
1756 GP_2_13_FN, FN_IP4_14_12,
1757 GP_2_12_FN, FN_IP4_11_9,
1758 GP_2_11_FN, FN_IP4_8_6,
1759 GP_2_10_FN, FN_IP4_5_3,
1760 GP_2_9_FN, FN_IP8_27_26,
1761 GP_2_8_FN, FN_IP11_12,
1762 GP_2_7_FN, FN_IP8_25_23,
1763 GP_2_6_FN, FN_IP8_22_20,
1764 GP_2_5_FN, FN_IP11_27_26,
1765 GP_2_4_FN, FN_IP8_29_28,
1766 GP_2_3_FN, FN_IP4_2_0,
1767 GP_2_2_FN, FN_IP11_11_10,
1768 GP_2_1_FN, FN_IP11_9_7,
1769 GP_2_0_FN, FN_IP11_6_4 }
1770 },
1771 { PINMUX_CFG_REG("GPSR3", 0xFFFC0010, 32, 1) {
1772 GP_3_31_FN, FN_IP9_1_0,
1773 GP_3_30_FN, FN_IP8_19_18,
1774 GP_3_29_FN, FN_IP8_17_16,
1775 GP_3_28_FN, FN_IP8_15_14,
1776 GP_3_27_FN, FN_IP8_13_12,
1777 GP_3_26_FN, FN_IP8_11_10,
1778 GP_3_25_FN, FN_IP8_9_8,
1779 GP_3_24_FN, FN_IP8_7_6,
1780 GP_3_23_FN, FN_IP8_5_4,
1781 GP_3_22_FN, FN_IP8_3_2,
1782 GP_3_21_FN, FN_IP8_1_0,
1783 GP_3_20_FN, FN_IP7_30_29,
1784 GP_3_19_FN, FN_IP7_28_27,
1785 GP_3_18_FN, FN_IP7_26_24,
1786 GP_3_17_FN, FN_IP7_23_21,
1787 GP_3_16_FN, FN_IP7_20_18,
1788 GP_3_15_FN, FN_IP7_17_15,
1789 GP_3_14_FN, FN_IP7_14_12,
1790 GP_3_13_FN, FN_IP7_11_9,
1791 GP_3_12_FN, FN_IP7_8_6,
1792 GP_3_11_FN, FN_IP7_5_3,
1793 GP_3_10_FN, FN_IP7_2_0,
1794 GP_3_9_FN, FN_IP6_23_21,
1795 GP_3_8_FN, FN_IP6_20_18,
1796 GP_3_7_FN, FN_IP6_17_16,
1797 GP_3_6_FN, FN_IP6_15_14,
1798 GP_3_5_FN, FN_IP6_13_12,
1799 GP_3_4_FN, FN_IP6_11_10,
1800 GP_3_3_FN, FN_IP6_9_8,
1801 GP_3_2_FN, FN_IP6_7_6,
1802 GP_3_1_FN, FN_IP6_5_3,
1803 GP_3_0_FN, FN_IP6_2_0 }
1804 },
1805
1806 { PINMUX_CFG_REG("GPSR4", 0xFFFC0014, 32, 1) {
1807 GP_4_31_FN, FN_IP10_24_23,
1808 GP_4_30_FN, FN_IP10_22,
1809 GP_4_29_FN, FN_IP11_18_16,
1810 GP_4_28_FN, FN_USB_OVC0,
1811 GP_4_27_FN, FN_IP11_15_13,
1812 GP_4_26_FN, FN_PENC0,
1813 GP_4_25_FN, FN_IP11_2,
1814 GP_4_24_FN, FN_SCL0,
1815 GP_4_23_FN, FN_IP11_1,
1816 GP_4_22_FN, FN_IP11_0,
1817 GP_4_21_FN, FN_IP10_21_19,
1818 GP_4_20_FN, FN_IP10_18_16,
1819 GP_4_19_FN, FN_IP10_15,
1820 GP_4_18_FN, FN_IP10_14_12,
1821 GP_4_17_FN, FN_IP10_11_9,
1822 GP_4_16_FN, FN_IP10_8_6,
1823 GP_4_15_FN, FN_IP10_5_3,
1824 GP_4_14_FN, FN_IP10_2_0,
1825 GP_4_13_FN, FN_IP9_29_28,
1826 GP_4_12_FN, FN_IP9_27_26,
1827 GP_4_11_FN, FN_IP9_9_8,
1828 GP_4_10_FN, FN_IP9_7_6,
1829 GP_4_9_FN, FN_IP9_5_4,
1830 GP_4_8_FN, FN_IP9_3_2,
1831 GP_4_7_FN, FN_IP9_17_16,
1832 GP_4_6_FN, FN_IP9_15_14,
1833 GP_4_5_FN, FN_IP9_13_12,
1834 GP_4_4_FN, FN_IP9_11_10,
1835 GP_4_3_FN, FN_IP9_25_24,
1836 GP_4_2_FN, FN_IP9_23_22,
1837 GP_4_1_FN, FN_IP9_21_20,
1838 GP_4_0_FN, FN_IP9_19_18 }
1839 },
1840 { PINMUX_CFG_REG("GPSR5", 0xFFFC0018, 32, 1) {
1841 0, 0, 0, 0, 0, 0, 0, 0, /* 31 - 28 */
1842 0, 0, 0, 0, 0, 0, 0, 0, /* 27 - 24 */
1843 0, 0, 0, 0, 0, 0, 0, 0, /* 23 - 20 */
1844 0, 0, 0, 0, 0, 0, 0, 0, /* 19 - 16 */
1845 0, 0, 0, 0, 0, 0, 0, 0, /* 15 - 12 */
1846 GP_5_11_FN, FN_IP10_29_28,
1847 GP_5_10_FN, FN_IP10_27_26,
1848 0, 0, 0, 0, 0, 0, 0, 0, /* 9 - 6 */
1849 0, 0, 0, 0, /* 5, 4 */
1850 GP_5_3_FN, FN_IRQ3_B,
1851 GP_5_2_FN, FN_IRQ2_B,
1852 GP_5_1_FN, FN_IP11_3,
1853 GP_5_0_FN, FN_IP10_25 }
1854 },
1855
1856 { PINMUX_CFG_REG_VAR("IPSR0", 0xFFFC001C, 32,
1857 2, 2, 2, 2, 2, 2, 2, 2,
1858 2, 2, 2, 2, 2, 2, 2, 2) {
1859 /* IP0_31_30 [2] */
1860 FN_A15, FN_ST0_VCO_CLKIN, FN_LCD_DATA15_A,
1861 FN_TIOC3D_C,
1862 /* IP0_29_28 [2] */
1863 FN_A14, FN_LCD_DATA14_A, FN_TIOC3C_C, 0,
1864 /* IP0_27_26 [2] */
1865 FN_A13, FN_LCD_DATA13_A, FN_TIOC3B_C, 0,
1866 /* IP0_25_24 [2] */
1867 FN_A12, FN_LCD_DATA12_A, FN_TIOC3A_C, 0,
1868 /* IP0_23_22 [2] */
1869 FN_A11, FN_ST0_D7, FN_LCD_DATA11_A, FN_TIOC2B_C,
1870 /* IP0_21_20 [2] */
1871 FN_A10, FN_ST0_D6, FN_LCD_DATA10_A, FN_TIOC2A_C,
1872 /* IP0_19_18 [2] */
1873 FN_A9, FN_ST0_D5, FN_LCD_DATA9_A, FN_TIOC1B_C,
1874 /* IP0_17_16 [2] */
1875 FN_A8, FN_ST0_D4, FN_LCD_DATA8_A, FN_TIOC1A_C,
1876 /* IP0_15_14 [2] */
1877 FN_A7, FN_ST0_D3, FN_LCD_DATA7_A, FN_TIOC0D_C,
1878 /* IP0_13_12 [2] */
1879 FN_A6, FN_ST0_D2, FN_LCD_DATA6_A, FN_TIOC0C_C,
1880 /* IP0_11_10 [2] */
1881 FN_A5, FN_ST0_D1, FN_LCD_DATA5_A, FN_TIOC0B_C,
1882 /* IP0_9_8 [2] */
1883 FN_A4, FN_ST0_D0, FN_LCD_DATA4_A, FN_TIOC0A_C,
1884 /* IP0_7_6 [2] */
1885 FN_A3, FN_ST0_VLD, FN_LCD_DATA3_A, FN_TCLKD_C,
1886 /* IP0_5_4 [2] */
1887 FN_A2, FN_ST0_SYC, FN_LCD_DATA2_A, FN_TCLKC_C,
1888 /* IP0_3_2 [2] */
1889 FN_A1, FN_ST0_REQ, FN_LCD_DATA1_A, FN_TCLKB_C,
1890 /* IP0_1_0 [2] */
1891 FN_A0, FN_ST0_CLKIN, FN_LCD_DATA0_A, FN_TCLKA_C }
1892 },
1893 { PINMUX_CFG_REG_VAR("IPSR1", 0xFFFC0020, 32,
1894 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) {
1895 /* IP1_31_29 [3] */
1896 FN_D3, FN_SD0_DAT3_A, FN_MMC_D3_A, FN_ST1_D6,
1897 FN_FD3_A, 0, 0, 0,
1898 /* IP1_28_26 [3] */
1899 FN_D2, FN_SD0_DAT2_A, FN_MMC_D2_A, FN_ST1_D5,
1900 FN_FD2_A, 0, 0, 0,
1901 /* IP1_25_23 [3] */
1902 FN_D1, FN_SD0_DAT1_A, FN_MMC_D1_A, FN_ST1_D4,
1903 FN_FD1_A, 0, 0, 0,
1904 /* IP1_22_20 [3] */
1905 FN_D0, FN_SD0_DAT0_A, FN_MMC_D0_A, FN_ST1_D3,
1906 FN_FD0_A, 0, 0, 0,
1907 /* IP1_19_18 [2] */
1908 FN_A25, FN_TX2_D, FN_ST1_D2, 0,
1909 /* IP1_17_16 [2] */
1910 FN_A24, FN_RX2_D, FN_ST1_D1, 0,
1911 /* IP1_15_14 [2] */
1912 FN_A23, FN_ST1_D0, FN_LCD_M_DISP_A, 0,
1913 /* IP1_13_12 [2] */
1914 FN_A22, FN_ST1_VLD, FN_LCD_VEPWC_A, 0,
1915 /* IP1_11_10 [2] */
1916 FN_A21, FN_ST1_SYC, FN_LCD_VCPWC_A, 0,
1917 /* IP1_9_8 [2] */
1918 FN_A20, FN_ST1_REQ, FN_LCD_FLM_A, 0,
1919 /* IP1_7_6 [2] */
1920 FN_A19, FN_ST1_CLKIN, FN_LCD_CLK_A, FN_TIOC4D_C,
1921 /* IP1_5_4 [2] */
1922 FN_A18, FN_ST1_PWM, FN_LCD_CL2_A, FN_TIOC4C_C,
1923 /* IP1_3_2 [2] */
1924 FN_A17, FN_ST1_VCO_CLKIN, FN_LCD_CL1_A, FN_TIOC4B_C,
1925 /* IP1_1_0 [2] */
1926 FN_A16, FN_ST0_PWM, FN_LCD_DON_A, FN_TIOC4A_C }
1927 },
1928 { PINMUX_CFG_REG_VAR("IPSR2", 0xFFFC0024, 32,
1929 1, 3, 3, 2, 3, 3, 3, 3, 3, 3, 2, 3) {
1930 /* IP2_31 [1] */
1931 0, 0,
1932 /* IP2_30_28 [3] */
1933 FN_D14, FN_TX2_B, 0, FN_FSE_A,
1934 FN_ET0_TX_CLK_B, 0, 0, 0,
1935 /* IP2_27_25 [3] */
1936 FN_D13, FN_RX2_B, 0, FN_FRB_A,
1937 FN_ET0_ETXD6_B, 0, 0, 0,
1938 /* IP2_24_23 [2] */
1939 FN_D12, 0, FN_FWE_A, FN_ET0_ETXD5_B,
1940 /* IP2_22_20 [3] */
1941 FN_D11, FN_RSPI_MISO_A, 0, FN_QMI_QIO1_A,
1942 FN_FRE_A, FN_ET0_ETXD3_B, 0, 0,
1943 /* IP2_19_17 [3] */
1944 FN_D10, FN_RSPI_MOSI_A, 0, FN_QMO_QIO0_A,
1945 FN_FALE_A, FN_ET0_ETXD2_B, 0, 0,
1946 /* IP2_16_14 [3] */
1947 FN_D9, FN_SD0_CMD_A, FN_MMC_CMD_A, FN_QIO3_A,
1948 FN_FCLE_A, FN_ET0_ETXD1_B, 0, 0,
1949 /* IP2_13_11 [3] */
1950 FN_D8, FN_SD0_CLK_A, FN_MMC_CLK_A, FN_QIO2_A,
1951 FN_FCE_A, FN_ET0_GTX_CLK_B, 0, 0,
1952 /* IP2_10_8 [3] */
1953 FN_D7, FN_RSPI_SSL_A, FN_MMC_D7_A, FN_QSSL_A,
1954 FN_FD7_A, 0, 0, 0,
1955 /* IP2_7_5 [3] */
1956 FN_D6, FN_RSPI_RSPCK_A, FN_MMC_D6_A, FN_QSPCLK_A,
1957 FN_FD6_A, 0, 0, 0,
1958 /* IP2_4_3 [2] */
1959 FN_D5, FN_SD0_WP_A, FN_MMC_D5_A, FN_FD5_A,
1960 /* IP2_2_0 [3] */
1961 FN_D4, FN_SD0_CD_A, FN_MMC_D4_A, FN_ST1_D7,
1962 FN_FD4_A, 0, 0, 0 }
1963 },
1964 { PINMUX_CFG_REG_VAR("IPSR3", 0xFFFC0028, 32,
1965 2, 3, 3, 3, 1, 2, 3, 3, 3, 3, 3, 1, 2) {
1966 /* IP3_31_30 [2] */
1967 0, 0, 0, 0,
1968 /* IP3_29_27 [3] */
1969 FN_DRACK0, FN_SD1_DAT2_A, FN_ATAG, FN_TCLK1_A,
1970 FN_ET0_ETXD7, 0, 0, 0,
1971 /* IP3_26_24 [3] */
1972 FN_EX_WAIT2, FN_SD1_DAT1_A, FN_DACK2, FN_CAN1_RX_C,
1973 FN_ET0_MAGIC_C, FN_ET0_ETXD6_A, 0, 0,
1974 /* IP3_23_21 [3] */
1975 FN_EX_WAIT1, FN_SD1_DAT0_A, FN_DREQ2, FN_CAN1_TX_C,
1976 FN_ET0_LINK_C, FN_ET0_ETXD5_A, 0, 0,
1977 /* IP3_20 [1] */
1978 FN_EX_WAIT0, FN_TCLK1_B,
1979 /* IP3_19_18 [2] */
1980 FN_RD_WR, FN_TCLK1_B, 0, 0,
1981 /* IP3_17_15 [3] */
1982 FN_EX_CS5, FN_SD1_CMD_A, FN_ATADIR, FN_QSSL_B,
1983 FN_ET0_ETXD3_A, 0, 0, 0,
1984 /* IP3_14_12 [3] */
1985 FN_EX_CS4, FN_SD1_WP_A, FN_ATAWR, FN_QMI_QIO1_B,
1986 FN_ET0_ETXD2_A, 0, 0, 0,
1987 /* IP3_11_9 [3] */
1988 FN_EX_CS3, FN_SD1_CD_A, FN_ATARD, FN_QMO_QIO0_B,
1989 FN_ET0_ETXD1_A, 0, 0, 0,
1990 /* IP3_8_6 [3] */
1991 FN_EX_CS2, FN_TX3_B, FN_ATACS1, FN_QSPCLK_B,
1992 FN_ET0_GTX_CLK_A, 0, 0, 0,
1993 /* IP3_5_3 [3] */
1994 FN_EX_CS1, FN_RX3_B, FN_ATACS0, FN_QIO2_B,
1995 FN_ET0_ETXD0, 0, 0, 0,
1996 /* IP3_2 [1] */
1997 FN_CS1_A26, FN_QIO3_B,
1998 /* IP3_1_0 [2] */
1999 FN_D15, FN_SCK2_B, 0, 0 }
2000 },
2001 { PINMUX_CFG_REG_VAR("IPSR4", 0xFFFC002C, 32,
2002 2, 2, 2, 2, 2, 2 , 2, 3, 3, 3, 3, 3, 3) {
2003 /* IP4_31_30 [2] */
2004 0, FN_SCK2_A, FN_VI0_G3, 0,
2005 /* IP4_29_28 [2] */
2006 0, FN_RTS1_B, FN_VI0_G2, 0,
2007 /* IP4_27_26 [2] */
2008 0, FN_CTS1_B, FN_VI0_DATA7_VI0_G1, 0,
2009 /* IP4_25_24 [2] */
2010 0, FN_TX1_B, FN_VI0_DATA6_VI0_G0, FN_ET0_PHY_INT_A,
2011 /* IP4_23_22 [2] */
2012 0, FN_RX1_B, FN_VI0_DATA5_VI0_B5, FN_ET0_MAGIC_A,
2013 /* IP4_21_20 [2] */
2014 0, FN_SCK1_B, FN_VI0_DATA4_VI0_B4, FN_ET0_LINK_A,
2015 /* IP4_19_18 [2] */
2016 0, FN_RTS0_B, FN_VI0_DATA3_VI0_B3, FN_ET0_MDIO_A,
2017 /* IP4_17_15 [3] */
2018 0, FN_CTS0_B, FN_VI0_DATA2_VI0_B2, FN_RMII0_MDIO_A,
2019 FN_ET0_MDC, 0, 0, 0,
2020 /* IP4_14_12 [3] */
2021 FN_HTX0_A, FN_TX1_A, FN_VI0_DATA1_VI0_B1, FN_RMII0_MDC_A,
2022 FN_ET0_COL, 0, 0, 0,
2023 /* IP4_11_9 [3] */
2024 FN_HRX0_A, FN_RX1_A, FN_VI0_DATA0_VI0_B0, FN_RMII0_CRS_DV_A,
2025 FN_ET0_CRS, 0, 0, 0,
2026 /* IP4_8_6 [3] */
2027 FN_HSCK0_A, FN_SCK1_A, FN_VI0_VSYNC, FN_RMII0_RX_ER_A,
2028 FN_ET0_RX_ER, 0, 0, 0,
2029 /* IP4_5_3 [3] */
2030 FN_HRTS0_A, FN_RTS1_A, FN_VI0_HSYNC, FN_RMII0_TXD_EN_A,
2031 FN_ET0_RX_DV, 0, 0, 0,
2032 /* IP4_2_0 [3] */
2033 FN_HCTS0_A, FN_CTS1_A, FN_VI0_FIELD, FN_RMII0_RXD1_A,
2034 FN_ET0_ERXD7, 0, 0, 0 }
2035 },
2036 { PINMUX_CFG_REG_VAR("IPSR5", 0xFFFC0030, 32,
2037 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3) {
2038 /* IP5_31 [1] */
2039 0, 0,
2040 /* IP5_30 [1] */
2041 0, 0,
2042 /* IP5_29 [1] */
2043 0, 0,
2044 /* IP5_28 [1] */
2045 0, 0,
2046 /* IP5_27 [1] */
2047 0, 0,
2048 /* IP5_26_25 [2] */
2049 FN_REF50CK, FN_CTS1_E, FN_HCTS0_D, 0,
2050 /* IP5_24_23 [2] */
2051 FN_REF125CK, FN_ADTRG, FN_RX5_C, 0,
2052 /* IP5_22_21 [2] */
2053 FN_SD2_WP_A, FN_TX5_A, FN_VI0_R5, 0,
2054 /* IP5_20_18 [3] */
2055 FN_SD2_CD_A, FN_RX5_A, FN_VI0_R4, 0,
2056 0, 0, 0, FN_ET0_PHY_INT_B,
2057 /* IP5_17_15 [3] */
2058 FN_SD2_DAT3_A, FN_TX4_A, FN_VI0_R3, 0,
2059 0, 0, 0, FN_ET0_MAGIC_B,
2060 /* IP5_14_12 [3] */
2061 FN_SD2_DAT2_A, FN_RX4_A, FN_VI0_R2, 0,
2062 0, 0, 0, FN_ET0_LINK_B,
2063 /* IP5_11_9 [3] */
2064 FN_SD2_DAT1_A, FN_TX3_A, FN_VI0_R1, 0,
2065 0, 0, 0, FN_ET0_MDIO_B,
2066 /* IP5_8_6 [3] */
2067 FN_SD2_DAT0_A, FN_RX3_A, FN_VI0_R0, 0,
2068 0, 0, 0, FN_ET0_ERXD3_B,
2069 /* IP5_5_3 [3] */
2070 FN_SD2_CMD_A, FN_TX2_A, FN_VI0_G5, 0,
2071 0, 0, 0, FN_ET0_ERXD2_B,
2072 /* IP5_2_0 [3] */
2073 FN_SD2_CLK_A, FN_RX2_A, FN_VI0_G4, 0,
2074 FN_ET0_RX_CLK_B, 0, 0, 0 }
2075 },
2076 { PINMUX_CFG_REG_VAR("IPSR6", 0xFFFC0034, 32,
2077 1, 1, 1, 1, 1, 1, 1, 1,
2078 3, 3, 2, 2, 2, 2, 2, 2, 3, 3) {
2079 /* IP5_31 [1] */
2080 0, 0,
2081 /* IP6_30 [1] */
2082 0, 0,
2083 /* IP6_29 [1] */
2084 0, 0,
2085 /* IP6_28 [1] */
2086 0, 0,
2087 /* IP6_27 [1] */
2088 0, 0,
2089 /* IP6_26 [1] */
2090 0, 0,
2091 /* IP6_25 [1] */
2092 0, 0,
2093 /* IP6_24 [1] */
2094 0, 0,
2095 /* IP6_23_21 [3] */
2096 FN_DU0_DG1, FN_CTS1_C, FN_HRTS0_D, FN_TIOC1B_A,
2097 FN_HIFD09, 0, 0, 0,
2098 /* IP6_20_18 [3] */
2099 FN_DU0_DG0, FN_TX1_C, FN_HSCK0_D, FN_IECLK_A,
2100 FN_TIOC1A_A, FN_HIFD08, 0, 0,
2101 /* IP6_17_16 [2] */
2102 FN_DU0_DR7, FN_RX1_C, FN_TIOC0D_A, FN_HIFD07,
2103 /* IP6_15_14 [2] */
2104 FN_DU0_DR6, FN_SCK1_C, FN_TIOC0C_A, FN_HIFD06,
2105 /* IP6_13_12 [2] */
2106 FN_DU0_DR5, FN_RTS0_C, FN_TIOC0B_A, FN_HIFD05,
2107 /* IP6_11_10 [2] */
2108 FN_DU0_DR4, FN_CTS0_C, FN_TIOC0A_A, FN_HIFD04,
2109 /* IP6_9_8 [2] */
2110 FN_DU0_DR3, FN_TX0_B, FN_TCLKD_A, FN_HIFD03,
2111 /* IP6_7_6 [2] */
2112 FN_DU0_DR2, FN_RX0_B, FN_TCLKC_A, FN_HIFD02,
2113 /* IP6_5_3 [3] */
2114 FN_DU0_DR1, FN_SCK0_B, FN_HTX0_D, FN_IERX_A,
2115 FN_TCLKB_A, FN_HIFD01, 0, 0,
2116 /* IP6_2_0 [3] */
2117 FN_DU0_DR0, FN_SCIF_CLK_B, FN_HRX0_D, FN_IETX_A,
2118 FN_TCLKA_A, FN_HIFD00, 0, 0 }
2119 },
2120 { PINMUX_CFG_REG_VAR("IPSR7", 0xFFFC0038, 32,
2121 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3) {
2122 /* IP7_31 [1] */
2123 0, 0,
2124 /* IP7_30_29 [2] */
2125 FN_DU0_DB4, 0, FN_HIFINT, 0,
2126 /* IP7_28_27 [2] */
2127 FN_DU0_DB3, FN_TX5_B, FN_TIOC4D_A, FN_HIFRD,
2128 /* IP7_26_24 [3] */
2129 FN_DU0_DB2, FN_RX5_B, FN_RMII0_TXD1_B, FN_TIOC4C_A,
2130 FN_HIFWR, 0, 0, 0,
2131 /* IP7_23_21 [3] */
2132 FN_DU0_DB1, FN_TX4_C, FN_RMII0_TXD0_B, FN_TIOC4B_A,
2133 FN_HIFRS, 0, 0, 0,
2134 /* IP7_20_18 [3] */
2135 FN_DU0_DB0, FN_RX4_C, FN_RMII0_TXD_EN_B, FN_TIOC4A_A,
2136 FN_HIFCS, 0, 0, 0,
2137 /* IP7_17_15 [3] */
2138 FN_DU0_DG7, FN_TX3_C, FN_RMII0_RXD1_B, FN_TIOC3D_A,
2139 FN_HIFD15, 0, 0, 0,
2140 /* IP7_14_12 [3] */
2141 FN_DU0_DG6, FN_RX3_C, FN_RMII0_RXD0_B, FN_TIOC3C_A,
2142 FN_HIFD14, 0, 0, 0,
2143 /* IP7_11_9 [3] */
2144 FN_DU0_DG5, FN_TX2_C, FN_RMII0_RX_ER_B, FN_TIOC3B_A,
2145 FN_HIFD13, 0, 0, 0,
2146 /* IP7_8_6 [3] */
2147 FN_DU0_DG4, FN_RX2_C, FN_RMII0_CRS_DV_B, FN_TIOC3A_A,
2148 FN_HIFD12, 0, 0, 0,
2149 /* IP7_5_3 [3] */
2150 FN_DU0_DG3, FN_SCK2_C, FN_RMII0_MDIO_B, FN_TIOC2B_A,
2151 FN_HIFD11, 0, 0, 0,
2152 /* IP7_2_0 [3] */
2153 FN_DU0_DG2, FN_RTS1_C, FN_RMII0_MDC_B, FN_TIOC2A_A,
2154 FN_HIFD10, 0, 0, 0 }
2155 },
2156 { PINMUX_CFG_REG_VAR("IPSR8", 0xFFFC003C, 32,
2157 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) {
2158 /* IP9_31_30 [2] */
2159 0, 0, 0, 0,
2160 /* IP8_29_28 [2] */
2161 FN_IRQ3_A, FN_RTS0_A, FN_HRTS0_B, FN_ET0_ERXD3_A,
2162 /* IP8_27_26 [2] */
2163 FN_IRQ2_A, FN_CTS0_A, FN_HCTS0_B, FN_ET0_ERXD2_A,
2164 /* IP8_25_23 [3] */
2165 FN_IRQ1_A, 0, FN_HSPI_RX_B, FN_TX3_E,
2166 FN_ET0_ERXD1, 0, 0, 0,
2167 /* IP8_22_20 [3] */
2168 FN_IRQ0_A, 0, FN_HSPI_TX_B, FN_RX3_E,
2169 FN_ET0_ERXD0, 0, 0, 0,
2170 /* IP8_19_18 [2] */
2171 FN_DU0_CDE, FN_HTX0_B, FN_AUDIO_CLKB_B, FN_LCD_VCPWC_B,
2172 /* IP8_17_16 [2] */
2173 FN_DU0_DISP, FN_CAN0_TX_B, FN_HRX0_B, FN_AUDIO_CLKA_B,
2174 /* IP8_15_14 [2] */
2175 FN_DU0_EXODDF_DU0_ODDF, FN_CAN0_RX_B, FN_HSCK0_B,
2176 FN_SSI_SDATA1_B,
2177 /* IP8_13_12 [2] */
2178 FN_DU0_EXVSYNC_DU0_VSYNC, 0, FN_HSPI_RX0_C, FN_SSI_WS1_B,
2179 /* IP8_11_10 [2] */
2180 FN_DU0_EXHSYNC_DU0_HSYNC, 0, FN_HSPI_TX0_C, FN_SSI_SCK1_B,
2181 /* IP8_9_8 [2] */
2182 FN_DU0_DOTCLKOUT, 0, FN_HSPI_CLK0_C, FN_SSI_SDATA0_B,
2183 /* IP8_7_6 [2] */
2184 FN_DU0_DOTCLKIN, 0, FN_HSPI_CS0_C, FN_SSI_WS0_B,
2185 /* IP8_5_4 [2] */
2186 FN_DU0_DB7, 0, FN_SSI_SCK0_B, FN_HIFEBL_B,
2187 /* IP8_3_2 [2] */
2188 FN_DU0_DB6, 0, FN_HIFRDY, 0,
2189 /* IP8_1_0 [2] */
2190 FN_DU0_DB5, 0, FN_HIFDREQ, 0 }
2191 },
2192 { PINMUX_CFG_REG_VAR("IPSR9", 0xFFFC0040, 32,
2193 2, 2, 2, 2, 2, 2, 2, 2,
2194 2, 2, 2, 2, 2, 2, 2, 2) {
2195 /* IP9_31_30 [2] */
2196 0, 0, 0, 0,
2197 /* IP9_29_28 [2] */
2198 FN_SSI_SDATA1_A, FN_VI1_3_B, FN_LCD_DATA14_B, 0,
2199 /* IP9_27_26 [2] */
2200 FN_SSI_WS1_A, FN_VI1_2_B, FN_LCD_DATA13_B, 0,
2201 /* IP9_25_24 [2] */
2202 FN_SSI_SCK1_A, FN_VI1_1_B, FN_TIOC2B_B, FN_LCD_DATA12_B,
2203 /* IP9_23_22 [2] */
2204 FN_SSI_SDATA0_A, FN_VI1_0_B, FN_TIOC2A_B, FN_LCD_DATA11_B,
2205 /* IP9_21_20 [2] */
2206 FN_SSI_WS0_A, FN_TIOC1B_B, FN_LCD_DATA10_B, 0,
2207 /* IP9_19_18 [2] */
2208 FN_SSI_SCK0_A, FN_TIOC1A_B, FN_LCD_DATA9_B, 0,
2209 /* IP9_17_16 [2] */
2210 FN_VI1_7_A, FN_FCE_B, FN_LCD_DATA8_B, 0,
2211 /* IP9_15_14 [2] */
2212 FN_VI1_6_A, 0, FN_FD7_B, FN_LCD_DATA7_B,
2213 /* IP9_13_12 [2] */
2214 FN_VI1_5_A, 0, FN_FD6_B, FN_LCD_DATA6_B,
2215 /* IP9_11_10 [2] */
2216 FN_VI1_4_A, 0, FN_FD5_B, FN_LCD_DATA5_B,
2217 /* IP9_9_8 [2] */
2218 FN_VI1_3_A, 0, FN_FD4_B, FN_LCD_DATA4_B,
2219 /* IP9_7_6 [2] */
2220 FN_VI1_2_A, 0, FN_FD3_B, FN_LCD_DATA3_B,
2221 /* IP9_5_4 [2] */
2222 FN_VI1_1_A, 0, FN_FD2_B, FN_LCD_DATA2_B,
2223 /* IP9_3_2 [2] */
2224 FN_VI1_0_A, 0, FN_FD1_B, FN_LCD_DATA1_B,
2225 /* IP9_1_0 [2] */
2226 FN_VI1_CLK_A, 0, FN_FD0_B, FN_LCD_DATA0_B }
2227 },
2228 { PINMUX_CFG_REG_VAR("IPSR10", 0xFFFC0044, 32,
2229 2, 2, 2, 1, 2, 1, 3,
2230 3, 1, 3, 3, 3, 3, 3) {
2231 /* IP9_31_30 [2] */
2232 0, 0, 0, 0,
2233 /* IP10_29_28 [2] */
2234 FN_CAN1_TX_A, FN_TX5_C, FN_MLB_DAT, 0,
2235 /* IP10_27_26 [2] */
2236 FN_CAN0_RX_A, FN_IRQ0_B, FN_MLB_SIG, 0,
2237 /* IP10_25 [1] */
2238 FN_CAN1_RX_A, FN_IRQ1_B,
2239 /* IP10_24_23 [2] */
2240 FN_CAN0_TX_A, FN_TX4_D, FN_MLB_CLK, 0,
2241 /* IP10_22 [1] */
2242 FN_CAN_CLK_A, FN_RX4_D,
2243 /* IP10_21_19 [3] */
2244 FN_AUDIO_CLKOUT, FN_TX1_E, FN_HRTS0_C, FN_FSE_B,
2245 FN_LCD_M_DISP_B, 0, 0, 0,
2246 /* IP10_18_16 [3] */
2247 FN_AUDIO_CLKC, FN_SCK1_E, FN_HCTS0_C, FN_FRB_B,
2248 FN_LCD_VEPWC_B, 0, 0, 0,
2249 /* IP10_15 [1] */
2250 FN_AUDIO_CLKB_A, FN_LCD_CLK_B,
2251 /* IP10_14_12 [3] */
2252 FN_AUDIO_CLKA_A, FN_VI1_CLK_B, FN_SCK1_D, FN_IECLK_B,
2253 FN_LCD_FLM_B, 0, 0, 0,
2254 /* IP10_11_9 [3] */
2255 FN_SSI_SDATA3, FN_VI1_7_B, FN_HTX0_C, FN_FWE_B,
2256 FN_LCD_CL2_B, 0, 0, 0,
2257 /* IP10_8_6 [3] */
2258 FN_SSI_SDATA2, FN_VI1_6_B, FN_HRX0_C, FN_FRE_B,
2259 FN_LCD_CL1_B, 0, 0, 0,
2260 /* IP10_5_3 [3] */
2261 FN_SSI_WS23, FN_VI1_5_B, FN_TX1_D, FN_HSCK0_C, FN_FALE_B,
2262 FN_LCD_DON_B, 0, 0, 0,
2263 /* IP10_2_0 [3] */
2264 FN_SSI_SCK23, FN_VI1_4_B, FN_RX1_D, FN_FCLE_B,
2265 FN_LCD_DATA15_B, 0, 0, 0 }
2266 },
2267 { PINMUX_CFG_REG_VAR("IPSR11", 0xFFFC0048, 32,
2268 3, 1, 2, 2, 2, 3, 3, 1, 2, 3, 3, 1, 1, 1, 1) {
2269 /* IP11_31_29 [3] */
2270 0, 0, 0, 0, 0, 0, 0, 0,
2271 /* IP11_28 [1] */
2272 FN_PRESETOUT, FN_ST_CLKOUT,
2273 /* IP11_27_26 [2] */
2274 FN_DACK1, FN_HSPI_CS_B, FN_TX4_B, FN_ET0_RX_CLK_A,
2275 /* IP11_25_23 [3] */
2276 FN_DREQ1, FN_HSPI_CLK_B, FN_RX4_B, FN_ET0_PHY_INT_C,
2277 FN_ET0_TX_CLK_A, 0, 0, 0,
2278 /* IP11_22_21 [2] */
2279 FN_DACK0, FN_SD1_DAT3_A, FN_ET0_TX_ER, 0,
2280 /* IP11_20_19 [2] */
2281 FN_DREQ0, FN_SD1_CLK_A, FN_ET0_TX_EN, 0,
2282 /* IP11_18_16 [3] */
2283 FN_USB_OVC1, FN_RX3_D, FN_CAN1_RX_B, FN_RX5_D,
2284 FN_IERX_B, 0, 0, 0,
2285 /* IP11_15_13 [3] */
2286 FN_PENC1, FN_TX3_D, FN_CAN1_TX_B, FN_TX5_D,
2287 FN_IETX_B, 0, 0, 0,
2288 /* IP11_12 [1] */
2289 FN_TX0_A, FN_HSPI_TX_A,
2290 /* IP11_11_10 [2] */
2291 FN_RX0_A, FN_HSPI_RX_A, FN_RMII0_RXD0_A, FN_ET0_ERXD6,
2292 /* IP11_9_7 [3] */
2293 FN_SCK0_A, FN_HSPI_CS_A, FN_VI0_CLKENB, FN_RMII0_TXD1_A,
2294 FN_ET0_ERXD5, 0, 0, 0,
2295 /* IP11_6_4 [3] */
2296 FN_SCIF_CLK_A, FN_HSPI_CLK_A, FN_VI0_CLK, FN_RMII0_TXD0_A,
2297 FN_ET0_ERXD4, 0, 0, 0,
2298 /* IP11_3 [1] */
2299 FN_SDSELF, FN_RTS1_E,
2300 /* IP11_2 [1] */
2301 FN_SDA0, FN_HIFEBL_A,
2302 /* IP11_1 [1] */
2303 FN_SDA1, FN_RX1_E,
2304 /* IP11_0 [1] */
2305 FN_SCL1, FN_SCIF_CLK_C }
2306 },
2307 { PINMUX_CFG_REG_VAR("MOD_SEL1", 0xFFFC004C, 32,
2308 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2,
2309 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) {
2310 /* SEL1_31_29 [3] */
2311 0, 0, 0, 0, 0, 0, 0, 0,
2312 /* SEL1_28 [1] */
2313 FN_SEL_IEBUS_0, FN_SEL_IEBUS_1,
2314 /* SEL1_27 [1] */
2315 FN_SEL_RQSPI_0, FN_SEL_RQSPI_1,
2316 /* SEL1_26 [1] */
2317 FN_SEL_VIN1_0, FN_SEL_VIN1_1,
2318 /* SEL1_25 [1] */
2319 FN_SEL_HIF_0, FN_SEL_HIF_1,
2320 /* SEL1_24 [1] */
2321 FN_SEL_RSPI_0, FN_SEL_RSPI_1,
2322 /* SEL1_23 [1] */
2323 FN_SEL_LCDC_0, FN_SEL_LCDC_1,
2324 /* SEL1_22_21 [2] */
2325 FN_SEL_ET0_CTL_0, FN_SEL_ET0_CTL_1, FN_SEL_ET0_CTL_2, 0,
2326 /* SEL1_20 [1] */
2327 FN_SEL_ET0_0, FN_SEL_ET0_1,
2328 /* SEL1_19 [1] */
2329 FN_SEL_RMII_0, FN_SEL_RMII_1,
2330 /* SEL1_18 [1] */
2331 FN_SEL_TMU_0, FN_SEL_TMU_1,
2332 /* SEL1_17_16 [2] */
2333 FN_SEL_HSPI_0, FN_SEL_HSPI_1, FN_SEL_HSPI_2, 0,
2334 /* SEL1_15_14 [2] */
2335 FN_SEL_HSCIF_0, FN_SEL_HSCIF_1, FN_SEL_HSCIF_2, FN_SEL_HSCIF_3,
2336 /* SEL1_13 [1] */
2337 FN_SEL_RCAN_CLK_0, FN_SEL_RCAN_CLK_1,
2338 /* SEL1_12_11 [2] */
2339 FN_SEL_RCAN1_0, FN_SEL_RCAN1_1, FN_SEL_RCAN1_2, 0,
2340 /* SEL1_10 [1] */
2341 FN_SEL_RCAN0_0, FN_SEL_RCAN0_1,
2342 /* SEL1_9 [1] */
2343 FN_SEL_SDHI2_0, FN_SEL_SDHI2_1,
2344 /* SEL1_8 [1] */
2345 FN_SEL_SDHI1_0, FN_SEL_SDHI1_1,
2346 /* SEL1_7 [1] */
2347 FN_SEL_SDHI0_0, FN_SEL_SDHI0_1,
2348 /* SEL1_6 [1] */
2349 FN_SEL_SSI1_0, FN_SEL_SSI1_1,
2350 /* SEL1_5 [1] */
2351 FN_SEL_SSI0_0, FN_SEL_SSI0_1,
2352 /* SEL1_4 [1] */
2353 FN_SEL_AUDIO_CLKB_0, FN_SEL_AUDIO_CLKB_1,
2354 /* SEL1_3 [1] */
2355 FN_SEL_AUDIO_CLKA_0, FN_SEL_AUDIO_CLKA_1,
2356 /* SEL1_2 [1] */
2357 FN_SEL_FLCTL_0, FN_SEL_FLCTL_1,
2358 /* SEL1_1 [1] */
2359 FN_SEL_MMC_0, FN_SEL_MMC_1,
2360 /* SEL1_0 [1] */
2361 FN_SEL_INTC_0, FN_SEL_INTC_1 }
2362 },
2363 { PINMUX_CFG_REG_VAR("MOD_SEL2", 0xFFFC0050, 32,
2364 1, 1, 1, 1, 1, 1, 1, 1,
2365 1, 1, 1, 2, 2, 1, 2, 2, 3, 2, 3, 2, 2) {
2366 /* SEL2_31 [1] */
2367 0, 0,
2368 /* SEL2_30 [1] */
2369 0, 0,
2370 /* SEL2_29 [1] */
2371 0, 0,
2372 /* SEL2_28 [1] */
2373 0, 0,
2374 /* SEL2_27 [1] */
2375 0, 0,
2376 /* SEL2_26 [1] */
2377 0, 0,
2378 /* SEL2_25 [1] */
2379 0, 0,
2380 /* SEL2_24 [1] */
2381 0, 0,
2382 /* SEL2_23 [1] */
2383 FN_SEL_MTU2_CLK_0, FN_SEL_MTU2_CLK_1,
2384 /* SEL2_22 [1] */
2385 FN_SEL_MTU2_CH4_0, FN_SEL_MTU2_CH4_1,
2386 /* SEL2_21 [1] */
2387 FN_SEL_MTU2_CH3_0, FN_SEL_MTU2_CH3_1,
2388 /* SEL2_20_19 [2] */
2389 FN_SEL_MTU2_CH2_0, FN_SEL_MTU2_CH2_1, FN_SEL_MTU2_CH2_2, 0,
2390 /* SEL2_18_17 [2] */
2391 FN_SEL_MTU2_CH1_0, FN_SEL_MTU2_CH1_1, FN_SEL_MTU2_CH1_2, 0,
2392 /* SEL2_16 [1] */
2393 FN_SEL_MTU2_CH0_0, FN_SEL_MTU2_CH0_1,
2394 /* SEL2_15_14 [2] */
2395 FN_SEL_SCIF5_0, FN_SEL_SCIF5_1, FN_SEL_SCIF5_2, FN_SEL_SCIF5_3,
2396 /* SEL2_13_12 [2] */
2397 FN_SEL_SCIF4_0, FN_SEL_SCIF4_1, FN_SEL_SCIF4_2, FN_SEL_SCIF4_3,
2398 /* SEL2_11_9 [3] */
2399 FN_SEL_SCIF3_0, FN_SEL_SCIF3_1, FN_SEL_SCIF3_2, FN_SEL_SCIF3_3,
2400 FN_SEL_SCIF3_4, 0, 0, 0,
2401 /* SEL2_8_7 [2] */
2402 FN_SEL_SCIF2_0, FN_SEL_SCIF2_1, FN_SEL_SCIF2_2, FN_SEL_SCIF2_3,
2403 /* SEL2_6_4 [3] */
2404 FN_SEL_SCIF1_0, FN_SEL_SCIF1_1, FN_SEL_SCIF1_2, FN_SEL_SCIF1_3,
2405 FN_SEL_SCIF1_4, 0, 0, 0,
2406 /* SEL2_3_2 [2] */
2407 FN_SEL_SCIF0_0, FN_SEL_SCIF0_1, FN_SEL_SCIF0_2, 0,
2408 /* SEL2_1_0 [2] */
2409 FN_SEL_SCIF_CLK_0, FN_SEL_SCIF_CLK_1, FN_SEL_SCIF_CLK_2, 0 }
2410 },
2411 /* GPIO 0 - 5*/
2412 { PINMUX_CFG_REG("INOUTSEL0", 0xFFC40004, 32, 1) { GP_INOUTSEL(0) } },
2413 { PINMUX_CFG_REG("INOUTSEL1", 0xFFC41004, 32, 1) { GP_INOUTSEL(1) } },
2414 { PINMUX_CFG_REG("INOUTSEL2", 0xFFC42004, 32, 1) { GP_INOUTSEL(2) } },
2415 { PINMUX_CFG_REG("INOUTSEL3", 0xFFC43004, 32, 1) { GP_INOUTSEL(3) } },
2416 { PINMUX_CFG_REG("INOUTSEL4", 0xFFC44004, 32, 1) { GP_INOUTSEL(4) } },
2417 { PINMUX_CFG_REG("INOUTSEL5", 0xffc45004, 32, 1) {
2418 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 31 - 24 */
2419 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 23 - 16 */
2420 0, 0, 0, 0, 0, 0, 0, 0, /* 15 - 12 */
2421 GP_5_11_IN, GP_5_11_OUT,
2422 GP_5_10_IN, GP_5_10_OUT,
2423 GP_5_9_IN, GP_5_9_OUT,
2424 GP_5_8_IN, GP_5_8_OUT,
2425 GP_5_7_IN, GP_5_7_OUT,
2426 GP_5_6_IN, GP_5_6_OUT,
2427 GP_5_5_IN, GP_5_5_OUT,
2428 GP_5_4_IN, GP_5_4_OUT,
2429 GP_5_3_IN, GP_5_3_OUT,
2430 GP_5_2_IN, GP_5_2_OUT,
2431 GP_5_1_IN, GP_5_1_OUT,
2432 GP_5_0_IN, GP_5_0_OUT }
2433 },
2434 { },
2435};
2436
2437static struct pinmux_data_reg pinmux_data_regs[] = {
2438 /* GPIO 0 - 5*/
2439 { PINMUX_DATA_REG("INDT0", 0xFFC4000C, 32) { GP_INDT(0) } },
2440 { PINMUX_DATA_REG("INDT1", 0xFFC4100C, 32) { GP_INDT(1) } },
2441 { PINMUX_DATA_REG("INDT2", 0xFFC4200C, 32) { GP_INDT(2) } },
2442 { PINMUX_DATA_REG("INDT3", 0xFFC4300C, 32) { GP_INDT(3) } },
2443 { PINMUX_DATA_REG("INDT4", 0xFFC4400C, 32) { GP_INDT(4) } },
2444 { PINMUX_DATA_REG("INDT5", 0xFFC4500C, 32) {
2445 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2446 0, 0, 0, 0,
2447 GP_5_11_DATA, GP_5_10_DATA, GP_5_9_DATA, GP_5_8_DATA,
2448 GP_5_7_DATA, GP_5_6_DATA, GP_5_5_DATA, GP_5_4_DATA,
2449 GP_5_3_DATA, GP_5_2_DATA, GP_5_1_DATA, GP_5_0_DATA }
2450 },
2451 { },
2452};
2453
2454static struct resource sh7734_pfc_resources[] = {
2455 [0] = { /* PFC */
2456 .start = 0xFFFC0000,
2457 .end = 0xFFFC011C,
2458 .flags = IORESOURCE_MEM,
2459 },
2460 [1] = { /* GPIO */
2461 .start = 0xFFC40000,
2462 .end = 0xFFC4502B,
2463 .flags = IORESOURCE_MEM,
2464 }
2465};
2466
2467static struct pinmux_info sh7734_pinmux_info = {
2468 .name = "sh7734_pfc",
2469
2470 .resource = sh7734_pfc_resources,
2471 .num_resources = ARRAY_SIZE(sh7734_pfc_resources),
2472
2473 .unlock_reg = 0xFFFC0000,
2474
2475 .reserved_id = PINMUX_RESERVED,
2476 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2477 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
2478 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
2479 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2480 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2481
2482 .first_gpio = GPIO_GP_0_0,
2483 .last_gpio = GPIO_FN_ST_CLKOUT,
2484
2485 .gpios = pinmux_gpios,
2486 .cfg_regs = pinmux_config_regs,
2487 .data_regs = pinmux_data_regs,
2488
2489 .gpio_data = pinmux_data,
2490 .gpio_data_size = ARRAY_SIZE(pinmux_data),
2491};
2492
2493static int __init plat_pinmux_setup(void)
2494{
2495 return register_pinmux(&sh7734_pinmux_info);
2496}
2497arch_initcall(plat_pinmux_setup);
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
index b91ea8300a3..1b8848317e9 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
@@ -13,7 +13,6 @@
13#include <linux/serial_sci.h> 13#include <linux/serial_sci.h>
14#include <linux/uio_driver.h> 14#include <linux/uio_driver.h>
15#include <linux/sh_timer.h> 15#include <linux/sh_timer.h>
16#include <linux/sh_intc.h>
17#include <asm/clock.h> 16#include <asm/clock.h>
18 17
19/* Serial */ 18/* Serial */
@@ -23,7 +22,7 @@ static struct plat_sci_port scif0_platform_data = {
23 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 22 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
24 .scbrr_algo_id = SCBRR_ALGO_2, 23 .scbrr_algo_id = SCBRR_ALGO_2,
25 .type = PORT_SCIF, 24 .type = PORT_SCIF,
26 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)), 25 .irqs = { 80, 80, 80, 80 },
27}; 26};
28 27
29static struct platform_device scif0_device = { 28static struct platform_device scif0_device = {
@@ -40,7 +39,7 @@ static struct plat_sci_port scif1_platform_data = {
40 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 39 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
41 .scbrr_algo_id = SCBRR_ALGO_2, 40 .scbrr_algo_id = SCBRR_ALGO_2,
42 .type = PORT_SCIF, 41 .type = PORT_SCIF,
43 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)), 42 .irqs = { 81, 81, 81, 81 },
44}; 43};
45 44
46static struct platform_device scif1_device = { 45static struct platform_device scif1_device = {
@@ -57,7 +56,7 @@ static struct plat_sci_port scif2_platform_data = {
57 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 56 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
58 .scbrr_algo_id = SCBRR_ALGO_2, 57 .scbrr_algo_id = SCBRR_ALGO_2,
59 .type = PORT_SCIF, 58 .type = PORT_SCIF,
60 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc40)), 59 .irqs = { 82, 82, 82, 82 },
61}; 60};
62 61
63static struct platform_device scif2_device = { 62static struct platform_device scif2_device = {
@@ -74,7 +73,7 @@ static struct plat_sci_port scif3_platform_data = {
74 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 73 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
75 .scbrr_algo_id = SCBRR_ALGO_2, 74 .scbrr_algo_id = SCBRR_ALGO_2,
76 .type = PORT_SCIF, 75 .type = PORT_SCIF,
77 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc60)), 76 .irqs = { 83, 83, 83, 83 },
78}; 77};
79 78
80static struct platform_device scif3_device = { 79static struct platform_device scif3_device = {
@@ -93,8 +92,8 @@ static struct resource iic0_resources[] = {
93 .flags = IORESOURCE_MEM, 92 .flags = IORESOURCE_MEM,
94 }, 93 },
95 [1] = { 94 [1] = {
96 .start = evt2irq(0xe00), 95 .start = 96,
97 .end = evt2irq(0xe60), 96 .end = 99,
98 .flags = IORESOURCE_IRQ, 97 .flags = IORESOURCE_IRQ,
99 }, 98 },
100}; 99};
@@ -114,8 +113,8 @@ static struct resource iic1_resources[] = {
114 .flags = IORESOURCE_MEM, 113 .flags = IORESOURCE_MEM,
115 }, 114 },
116 [1] = { 115 [1] = {
117 .start = evt2irq(0x780), 116 .start = 44,
118 .end = evt2irq(0x7e0), 117 .end = 47,
119 .flags = IORESOURCE_IRQ, 118 .flags = IORESOURCE_IRQ,
120 }, 119 },
121}; 120};
@@ -130,7 +129,7 @@ static struct platform_device iic1_device = {
130static struct uio_info vpu_platform_data = { 129static struct uio_info vpu_platform_data = {
131 .name = "VPU4", 130 .name = "VPU4",
132 .version = "0", 131 .version = "0",
133 .irq = evt2irq(0x980), 132 .irq = 60,
134}; 133};
135 134
136static struct resource vpu_resources[] = { 135static struct resource vpu_resources[] = {
@@ -158,7 +157,7 @@ static struct platform_device vpu_device = {
158static struct uio_info veu_platform_data = { 157static struct uio_info veu_platform_data = {
159 .name = "VEU", 158 .name = "VEU",
160 .version = "0", 159 .version = "0",
161 .irq = evt2irq(0x8c0), 160 .irq = 54,
162}; 161};
163 162
164static struct resource veu_resources[] = { 163static struct resource veu_resources[] = {
@@ -186,7 +185,7 @@ static struct platform_device veu_device = {
186static struct uio_info jpu_platform_data = { 185static struct uio_info jpu_platform_data = {
187 .name = "JPU", 186 .name = "JPU",
188 .version = "0", 187 .version = "0",
189 .irq = evt2irq(0x560), 188 .irq = 27,
190}; 189};
191 190
192static struct resource jpu_resources[] = { 191static struct resource jpu_resources[] = {
@@ -225,7 +224,7 @@ static struct resource cmt_resources[] = {
225 .flags = IORESOURCE_MEM, 224 .flags = IORESOURCE_MEM,
226 }, 225 },
227 [1] = { 226 [1] = {
228 .start = evt2irq(0xf00), 227 .start = 104,
229 .flags = IORESOURCE_IRQ, 228 .flags = IORESOURCE_IRQ,
230 }, 229 },
231}; 230};
@@ -253,7 +252,7 @@ static struct resource tmu0_resources[] = {
253 .flags = IORESOURCE_MEM, 252 .flags = IORESOURCE_MEM,
254 }, 253 },
255 [1] = { 254 [1] = {
256 .start = evt2irq(0x400), 255 .start = 16,
257 .flags = IORESOURCE_IRQ, 256 .flags = IORESOURCE_IRQ,
258 }, 257 },
259}; 258};
@@ -281,7 +280,7 @@ static struct resource tmu1_resources[] = {
281 .flags = IORESOURCE_MEM, 280 .flags = IORESOURCE_MEM,
282 }, 281 },
283 [1] = { 282 [1] = {
284 .start = evt2irq(0x420), 283 .start = 17,
285 .flags = IORESOURCE_IRQ, 284 .flags = IORESOURCE_IRQ,
286 }, 285 },
287}; 286};
@@ -308,7 +307,7 @@ static struct resource tmu2_resources[] = {
308 .flags = IORESOURCE_MEM, 307 .flags = IORESOURCE_MEM,
309 }, 308 },
310 [1] = { 309 [1] = {
311 .start = evt2irq(0x440), 310 .start = 18,
312 .flags = IORESOURCE_IRQ, 311 .flags = IORESOURCE_IRQ,
313 }, 312 },
314}; 313};
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
index 0bd09d51419..87773869a2f 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
@@ -15,7 +15,6 @@
15#include <linux/serial_sci.h> 15#include <linux/serial_sci.h>
16#include <linux/uio_driver.h> 16#include <linux/uio_driver.h>
17#include <linux/sh_timer.h> 17#include <linux/sh_timer.h>
18#include <linux/sh_intc.h>
19#include <linux/usb/r8a66597.h> 18#include <linux/usb/r8a66597.h>
20#include <asm/clock.h> 19#include <asm/clock.h>
21 20
@@ -26,7 +25,7 @@ static struct plat_sci_port scif0_platform_data = {
26 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 25 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
27 .scbrr_algo_id = SCBRR_ALGO_2, 26 .scbrr_algo_id = SCBRR_ALGO_2,
28 .type = PORT_SCIF, 27 .type = PORT_SCIF,
29 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)), 28 .irqs = { 80, 80, 80, 80 },
30}; 29};
31 30
32static struct platform_device scif0_device = { 31static struct platform_device scif0_device = {
@@ -45,8 +44,8 @@ static struct resource iic_resources[] = {
45 .flags = IORESOURCE_MEM, 44 .flags = IORESOURCE_MEM,
46 }, 45 },
47 [1] = { 46 [1] = {
48 .start = evt2irq(0xe00), 47 .start = 96,
49 .end = evt2irq(0xe60), 48 .end = 99,
50 .flags = IORESOURCE_IRQ, 49 .flags = IORESOURCE_IRQ,
51 }, 50 },
52}; 51};
@@ -69,8 +68,8 @@ static struct resource usb_host_resources[] = {
69 .flags = IORESOURCE_MEM, 68 .flags = IORESOURCE_MEM,
70 }, 69 },
71 [1] = { 70 [1] = {
72 .start = evt2irq(0xa20), 71 .start = 65,
73 .end = evt2irq(0xa20), 72 .end = 65,
74 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 73 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
75 }, 74 },
76}; 75};
@@ -90,7 +89,7 @@ static struct platform_device usb_host_device = {
90static struct uio_info vpu_platform_data = { 89static struct uio_info vpu_platform_data = {
91 .name = "VPU5", 90 .name = "VPU5",
92 .version = "0", 91 .version = "0",
93 .irq = evt2irq(0x980), 92 .irq = 60,
94}; 93};
95 94
96static struct resource vpu_resources[] = { 95static struct resource vpu_resources[] = {
@@ -118,7 +117,7 @@ static struct platform_device vpu_device = {
118static struct uio_info veu0_platform_data = { 117static struct uio_info veu0_platform_data = {
119 .name = "VEU", 118 .name = "VEU",
120 .version = "0", 119 .version = "0",
121 .irq = evt2irq(0x8c0), 120 .irq = 54,
122}; 121};
123 122
124static struct resource veu0_resources[] = { 123static struct resource veu0_resources[] = {
@@ -146,7 +145,7 @@ static struct platform_device veu0_device = {
146static struct uio_info veu1_platform_data = { 145static struct uio_info veu1_platform_data = {
147 .name = "VEU", 146 .name = "VEU",
148 .version = "0", 147 .version = "0",
149 .irq = evt2irq(0x560), 148 .irq = 27,
150}; 149};
151 150
152static struct resource veu1_resources[] = { 151static struct resource veu1_resources[] = {
@@ -185,7 +184,7 @@ static struct resource cmt_resources[] = {
185 .flags = IORESOURCE_MEM, 184 .flags = IORESOURCE_MEM,
186 }, 185 },
187 [1] = { 186 [1] = {
188 .start = evt2irq(0xf00), 187 .start = 104,
189 .flags = IORESOURCE_IRQ, 188 .flags = IORESOURCE_IRQ,
190 }, 189 },
191}; 190};
@@ -241,7 +240,7 @@ static struct resource tmu1_resources[] = {
241 .flags = IORESOURCE_MEM, 240 .flags = IORESOURCE_MEM,
242 }, 241 },
243 [1] = { 242 [1] = {
244 .start = evt2irq(0x420), 243 .start = 17,
245 .flags = IORESOURCE_IRQ, 244 .flags = IORESOURCE_IRQ,
246 }, 245 },
247}; 246};
@@ -268,7 +267,7 @@ static struct resource tmu2_resources[] = {
268 .flags = IORESOURCE_MEM, 267 .flags = IORESOURCE_MEM,
269 }, 268 },
270 [1] = { 269 [1] = {
271 .start = evt2irq(0x440), 270 .start = 18,
272 .flags = IORESOURCE_IRQ, 271 .flags = IORESOURCE_IRQ,
273 }, 272 },
274}; 273};
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index 6a868b091c2..278a0e57215 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -12,9 +12,7 @@
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/serial.h> 13#include <linux/serial.h>
14#include <linux/serial_sci.h> 14#include <linux/serial_sci.h>
15#include <linux/sh_dma.h>
16#include <linux/sh_timer.h> 15#include <linux/sh_timer.h>
17#include <linux/sh_intc.h>
18#include <linux/uio_driver.h> 16#include <linux/uio_driver.h>
19#include <linux/usb/m66592.h> 17#include <linux/usb/m66592.h>
20 18
@@ -148,21 +146,21 @@ static struct resource sh7722_dmae_resources[] = {
148 .flags = IORESOURCE_MEM, 146 .flags = IORESOURCE_MEM,
149 }, 147 },
150 { 148 {
151 .name = "error_irq", 149 /* DMA error IRQ */
152 .start = evt2irq(0xbc0), 150 .start = 78,
153 .end = evt2irq(0xbc0), 151 .end = 78,
154 .flags = IORESOURCE_IRQ, 152 .flags = IORESOURCE_IRQ,
155 }, 153 },
156 { 154 {
157 /* IRQ for channels 0-3 */ 155 /* IRQ for channels 0-3 */
158 .start = evt2irq(0x800), 156 .start = 48,
159 .end = evt2irq(0x860), 157 .end = 51,
160 .flags = IORESOURCE_IRQ, 158 .flags = IORESOURCE_IRQ,
161 }, 159 },
162 { 160 {
163 /* IRQ for channels 4-5 */ 161 /* IRQ for channels 4-5 */
164 .start = evt2irq(0xb80), 162 .start = 76,
165 .end = evt2irq(0xba0), 163 .end = 77,
166 .flags = IORESOURCE_IRQ, 164 .flags = IORESOURCE_IRQ,
167 }, 165 },
168}; 166};
@@ -175,6 +173,9 @@ struct platform_device dma_device = {
175 .dev = { 173 .dev = {
176 .platform_data = &dma_platform_data, 174 .platform_data = &dma_platform_data,
177 }, 175 },
176 .archdata = {
177 .hwblk_id = HWBLK_DMAC,
178 },
178}; 179};
179 180
180/* Serial */ 181/* Serial */
@@ -184,7 +185,7 @@ static struct plat_sci_port scif0_platform_data = {
184 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 185 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
185 .scbrr_algo_id = SCBRR_ALGO_2, 186 .scbrr_algo_id = SCBRR_ALGO_2,
186 .type = PORT_SCIF, 187 .type = PORT_SCIF,
187 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)), 188 .irqs = { 80, 80, 80, 80 },
188 .ops = &sh7722_sci_port_ops, 189 .ops = &sh7722_sci_port_ops,
189 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, 190 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
190}; 191};
@@ -203,7 +204,7 @@ static struct plat_sci_port scif1_platform_data = {
203 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 204 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
204 .scbrr_algo_id = SCBRR_ALGO_2, 205 .scbrr_algo_id = SCBRR_ALGO_2,
205 .type = PORT_SCIF, 206 .type = PORT_SCIF,
206 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)), 207 .irqs = { 81, 81, 81, 81 },
207 .ops = &sh7722_sci_port_ops, 208 .ops = &sh7722_sci_port_ops,
208 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, 209 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
209}; 210};
@@ -222,7 +223,7 @@ static struct plat_sci_port scif2_platform_data = {
222 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 223 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
223 .scbrr_algo_id = SCBRR_ALGO_2, 224 .scbrr_algo_id = SCBRR_ALGO_2,
224 .type = PORT_SCIF, 225 .type = PORT_SCIF,
225 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc40)), 226 .irqs = { 82, 82, 82, 82 },
226 .ops = &sh7722_sci_port_ops, 227 .ops = &sh7722_sci_port_ops,
227 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, 228 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
228}; 229};
@@ -243,17 +244,17 @@ static struct resource rtc_resources[] = {
243 }, 244 },
244 [1] = { 245 [1] = {
245 /* Period IRQ */ 246 /* Period IRQ */
246 .start = evt2irq(0x7a0), 247 .start = 45,
247 .flags = IORESOURCE_IRQ, 248 .flags = IORESOURCE_IRQ,
248 }, 249 },
249 [2] = { 250 [2] = {
250 /* Carry IRQ */ 251 /* Carry IRQ */
251 .start = evt2irq(0x7c0), 252 .start = 46,
252 .flags = IORESOURCE_IRQ, 253 .flags = IORESOURCE_IRQ,
253 }, 254 },
254 [3] = { 255 [3] = {
255 /* Alarm IRQ */ 256 /* Alarm IRQ */
256 .start = evt2irq(0x780), 257 .start = 44,
257 .flags = IORESOURCE_IRQ, 258 .flags = IORESOURCE_IRQ,
258 }, 259 },
259}; 260};
@@ -263,6 +264,9 @@ static struct platform_device rtc_device = {
263 .id = -1, 264 .id = -1,
264 .num_resources = ARRAY_SIZE(rtc_resources), 265 .num_resources = ARRAY_SIZE(rtc_resources),
265 .resource = rtc_resources, 266 .resource = rtc_resources,
267 .archdata = {
268 .hwblk_id = HWBLK_RTC,
269 },
266}; 270};
267 271
268static struct m66592_platdata usbf_platdata = { 272static struct m66592_platdata usbf_platdata = {
@@ -277,8 +281,8 @@ static struct resource usbf_resources[] = {
277 .flags = IORESOURCE_MEM, 281 .flags = IORESOURCE_MEM,
278 }, 282 },
279 [1] = { 283 [1] = {
280 .start = evt2irq(0xa20), 284 .start = 65,
281 .end = evt2irq(0xa20), 285 .end = 65,
282 .flags = IORESOURCE_IRQ, 286 .flags = IORESOURCE_IRQ,
283 }, 287 },
284}; 288};
@@ -293,6 +297,9 @@ static struct platform_device usbf_device = {
293 }, 297 },
294 .num_resources = ARRAY_SIZE(usbf_resources), 298 .num_resources = ARRAY_SIZE(usbf_resources),
295 .resource = usbf_resources, 299 .resource = usbf_resources,
300 .archdata = {
301 .hwblk_id = HWBLK_USBF,
302 },
296}; 303};
297 304
298static struct resource iic_resources[] = { 305static struct resource iic_resources[] = {
@@ -303,8 +310,8 @@ static struct resource iic_resources[] = {
303 .flags = IORESOURCE_MEM, 310 .flags = IORESOURCE_MEM,
304 }, 311 },
305 [1] = { 312 [1] = {
306 .start = evt2irq(0xe00), 313 .start = 96,
307 .end = evt2irq(0xe60), 314 .end = 99,
308 .flags = IORESOURCE_IRQ, 315 .flags = IORESOURCE_IRQ,
309 }, 316 },
310}; 317};
@@ -314,12 +321,15 @@ static struct platform_device iic_device = {
314 .id = 0, /* "i2c0" clock */ 321 .id = 0, /* "i2c0" clock */
315 .num_resources = ARRAY_SIZE(iic_resources), 322 .num_resources = ARRAY_SIZE(iic_resources),
316 .resource = iic_resources, 323 .resource = iic_resources,
324 .archdata = {
325 .hwblk_id = HWBLK_IIC,
326 },
317}; 327};
318 328
319static struct uio_info vpu_platform_data = { 329static struct uio_info vpu_platform_data = {
320 .name = "VPU4", 330 .name = "VPU4",
321 .version = "0", 331 .version = "0",
322 .irq = evt2irq(0x980), 332 .irq = 60,
323}; 333};
324 334
325static struct resource vpu_resources[] = { 335static struct resource vpu_resources[] = {
@@ -342,12 +352,15 @@ static struct platform_device vpu_device = {
342 }, 352 },
343 .resource = vpu_resources, 353 .resource = vpu_resources,
344 .num_resources = ARRAY_SIZE(vpu_resources), 354 .num_resources = ARRAY_SIZE(vpu_resources),
355 .archdata = {
356 .hwblk_id = HWBLK_VPU,
357 },
345}; 358};
346 359
347static struct uio_info veu_platform_data = { 360static struct uio_info veu_platform_data = {
348 .name = "VEU", 361 .name = "VEU",
349 .version = "0", 362 .version = "0",
350 .irq = evt2irq(0x8c0), 363 .irq = 54,
351}; 364};
352 365
353static struct resource veu_resources[] = { 366static struct resource veu_resources[] = {
@@ -370,12 +383,15 @@ static struct platform_device veu_device = {
370 }, 383 },
371 .resource = veu_resources, 384 .resource = veu_resources,
372 .num_resources = ARRAY_SIZE(veu_resources), 385 .num_resources = ARRAY_SIZE(veu_resources),
386 .archdata = {
387 .hwblk_id = HWBLK_VEU,
388 },
373}; 389};
374 390
375static struct uio_info jpu_platform_data = { 391static struct uio_info jpu_platform_data = {
376 .name = "JPU", 392 .name = "JPU",
377 .version = "0", 393 .version = "0",
378 .irq = evt2irq(0x560), 394 .irq = 27,
379}; 395};
380 396
381static struct resource jpu_resources[] = { 397static struct resource jpu_resources[] = {
@@ -398,6 +414,9 @@ static struct platform_device jpu_device = {
398 }, 414 },
399 .resource = jpu_resources, 415 .resource = jpu_resources,
400 .num_resources = ARRAY_SIZE(jpu_resources), 416 .num_resources = ARRAY_SIZE(jpu_resources),
417 .archdata = {
418 .hwblk_id = HWBLK_JPU,
419 },
401}; 420};
402 421
403static struct sh_timer_config cmt_platform_data = { 422static struct sh_timer_config cmt_platform_data = {
@@ -414,7 +433,7 @@ static struct resource cmt_resources[] = {
414 .flags = IORESOURCE_MEM, 433 .flags = IORESOURCE_MEM,
415 }, 434 },
416 [1] = { 435 [1] = {
417 .start = evt2irq(0xf00), 436 .start = 104,
418 .flags = IORESOURCE_IRQ, 437 .flags = IORESOURCE_IRQ,
419 }, 438 },
420}; 439};
@@ -427,6 +446,9 @@ static struct platform_device cmt_device = {
427 }, 446 },
428 .resource = cmt_resources, 447 .resource = cmt_resources,
429 .num_resources = ARRAY_SIZE(cmt_resources), 448 .num_resources = ARRAY_SIZE(cmt_resources),
449 .archdata = {
450 .hwblk_id = HWBLK_CMT,
451 },
430}; 452};
431 453
432static struct sh_timer_config tmu0_platform_data = { 454static struct sh_timer_config tmu0_platform_data = {
@@ -442,7 +464,7 @@ static struct resource tmu0_resources[] = {
442 .flags = IORESOURCE_MEM, 464 .flags = IORESOURCE_MEM,
443 }, 465 },
444 [1] = { 466 [1] = {
445 .start = evt2irq(0x400), 467 .start = 16,
446 .flags = IORESOURCE_IRQ, 468 .flags = IORESOURCE_IRQ,
447 }, 469 },
448}; 470};
@@ -455,6 +477,9 @@ static struct platform_device tmu0_device = {
455 }, 477 },
456 .resource = tmu0_resources, 478 .resource = tmu0_resources,
457 .num_resources = ARRAY_SIZE(tmu0_resources), 479 .num_resources = ARRAY_SIZE(tmu0_resources),
480 .archdata = {
481 .hwblk_id = HWBLK_TMU,
482 },
458}; 483};
459 484
460static struct sh_timer_config tmu1_platform_data = { 485static struct sh_timer_config tmu1_platform_data = {
@@ -470,7 +495,7 @@ static struct resource tmu1_resources[] = {
470 .flags = IORESOURCE_MEM, 495 .flags = IORESOURCE_MEM,
471 }, 496 },
472 [1] = { 497 [1] = {
473 .start = evt2irq(0x420), 498 .start = 17,
474 .flags = IORESOURCE_IRQ, 499 .flags = IORESOURCE_IRQ,
475 }, 500 },
476}; 501};
@@ -483,6 +508,9 @@ static struct platform_device tmu1_device = {
483 }, 508 },
484 .resource = tmu1_resources, 509 .resource = tmu1_resources,
485 .num_resources = ARRAY_SIZE(tmu1_resources), 510 .num_resources = ARRAY_SIZE(tmu1_resources),
511 .archdata = {
512 .hwblk_id = HWBLK_TMU,
513 },
486}; 514};
487 515
488static struct sh_timer_config tmu2_platform_data = { 516static struct sh_timer_config tmu2_platform_data = {
@@ -510,9 +538,13 @@ static struct platform_device tmu2_device = {
510 }, 538 },
511 .resource = tmu2_resources, 539 .resource = tmu2_resources,
512 .num_resources = ARRAY_SIZE(tmu2_resources), 540 .num_resources = ARRAY_SIZE(tmu2_resources),
541 .archdata = {
542 .hwblk_id = HWBLK_TMU,
543 },
513}; 544};
514 545
515static struct siu_platform siu_platform_data = { 546static struct siu_platform siu_platform_data = {
547 .dma_dev = &dma_device.dev,
516 .dma_slave_tx_a = SHDMA_SLAVE_SIUA_TX, 548 .dma_slave_tx_a = SHDMA_SLAVE_SIUA_TX,
517 .dma_slave_rx_a = SHDMA_SLAVE_SIUA_RX, 549 .dma_slave_rx_a = SHDMA_SLAVE_SIUA_RX,
518 .dma_slave_tx_b = SHDMA_SLAVE_SIUB_TX, 550 .dma_slave_tx_b = SHDMA_SLAVE_SIUB_TX,
@@ -526,7 +558,7 @@ static struct resource siu_resources[] = {
526 .flags = IORESOURCE_MEM, 558 .flags = IORESOURCE_MEM,
527 }, 559 },
528 [1] = { 560 [1] = {
529 .start = evt2irq(0xf80), 561 .start = 108,
530 .flags = IORESOURCE_IRQ, 562 .flags = IORESOURCE_IRQ,
531 }, 563 },
532}; 564};
@@ -539,6 +571,9 @@ static struct platform_device siu_device = {
539 }, 571 },
540 .resource = siu_resources, 572 .resource = siu_resources,
541 .num_resources = ARRAY_SIZE(siu_resources), 573 .num_resources = ARRAY_SIZE(siu_resources),
574 .archdata = {
575 .hwblk_id = HWBLK_SIU,
576 },
542}; 577};
543 578
544static struct platform_device *sh7722_devices[] __initdata = { 579static struct platform_device *sh7722_devices[] __initdata = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
index 28d6fd835fe..3c2810d8f72 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
@@ -15,7 +15,6 @@
15#include <linux/uio_driver.h> 15#include <linux/uio_driver.h>
16#include <linux/usb/r8a66597.h> 16#include <linux/usb/r8a66597.h>
17#include <linux/sh_timer.h> 17#include <linux/sh_timer.h>
18#include <linux/sh_intc.h>
19#include <linux/io.h> 18#include <linux/io.h>
20#include <asm/clock.h> 19#include <asm/clock.h>
21#include <asm/mmzone.h> 20#include <asm/mmzone.h>
@@ -29,7 +28,7 @@ static struct plat_sci_port scif0_platform_data = {
29 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 28 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
30 .scbrr_algo_id = SCBRR_ALGO_2, 29 .scbrr_algo_id = SCBRR_ALGO_2,
31 .type = PORT_SCIF, 30 .type = PORT_SCIF,
32 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)), 31 .irqs = { 80, 80, 80, 80 },
33 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, 32 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
34}; 33};
35 34
@@ -48,7 +47,7 @@ static struct plat_sci_port scif1_platform_data = {
48 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 47 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
49 .scbrr_algo_id = SCBRR_ALGO_2, 48 .scbrr_algo_id = SCBRR_ALGO_2,
50 .type = PORT_SCIF, 49 .type = PORT_SCIF,
51 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)), 50 .irqs = { 81, 81, 81, 81 },
52 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, 51 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
53}; 52};
54 53
@@ -67,7 +66,7 @@ static struct plat_sci_port scif2_platform_data = {
67 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 66 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
68 .scbrr_algo_id = SCBRR_ALGO_2, 67 .scbrr_algo_id = SCBRR_ALGO_2,
69 .type = PORT_SCIF, 68 .type = PORT_SCIF,
70 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc40)), 69 .irqs = { 82, 82, 82, 82 },
71 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, 70 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
72}; 71};
73 72
@@ -86,7 +85,7 @@ static struct plat_sci_port scif3_platform_data = {
86 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 85 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
87 .scbrr_algo_id = SCBRR_ALGO_3, 86 .scbrr_algo_id = SCBRR_ALGO_3,
88 .type = PORT_SCIFA, 87 .type = PORT_SCIFA,
89 .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)), 88 .irqs = { 56, 56, 56, 56 },
90}; 89};
91 90
92static struct platform_device scif3_device = { 91static struct platform_device scif3_device = {
@@ -104,7 +103,7 @@ static struct plat_sci_port scif4_platform_data = {
104 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 103 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
105 .scbrr_algo_id = SCBRR_ALGO_3, 104 .scbrr_algo_id = SCBRR_ALGO_3,
106 .type = PORT_SCIFA, 105 .type = PORT_SCIFA,
107 .irqs = SCIx_IRQ_MUXED(evt2irq(0xd00)), 106 .irqs = { 88, 88, 88, 88 },
108}; 107};
109 108
110static struct platform_device scif4_device = { 109static struct platform_device scif4_device = {
@@ -122,7 +121,7 @@ static struct plat_sci_port scif5_platform_data = {
122 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 121 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
123 .scbrr_algo_id = SCBRR_ALGO_3, 122 .scbrr_algo_id = SCBRR_ALGO_3,
124 .type = PORT_SCIFA, 123 .type = PORT_SCIFA,
125 .irqs = SCIx_IRQ_MUXED(evt2irq(0xfa0)), 124 .irqs = { 109, 109, 109, 109 },
126}; 125};
127 126
128static struct platform_device scif5_device = { 127static struct platform_device scif5_device = {
@@ -136,7 +135,7 @@ static struct platform_device scif5_device = {
136static struct uio_info vpu_platform_data = { 135static struct uio_info vpu_platform_data = {
137 .name = "VPU5", 136 .name = "VPU5",
138 .version = "0", 137 .version = "0",
139 .irq = evt2irq(0x980), 138 .irq = 60,
140}; 139};
141 140
142static struct resource vpu_resources[] = { 141static struct resource vpu_resources[] = {
@@ -159,12 +158,15 @@ static struct platform_device vpu_device = {
159 }, 158 },
160 .resource = vpu_resources, 159 .resource = vpu_resources,
161 .num_resources = ARRAY_SIZE(vpu_resources), 160 .num_resources = ARRAY_SIZE(vpu_resources),
161 .archdata = {
162 .hwblk_id = HWBLK_VPU,
163 },
162}; 164};
163 165
164static struct uio_info veu0_platform_data = { 166static struct uio_info veu0_platform_data = {
165 .name = "VEU2H", 167 .name = "VEU2H",
166 .version = "0", 168 .version = "0",
167 .irq = evt2irq(0x8c0), 169 .irq = 54,
168}; 170};
169 171
170static struct resource veu0_resources[] = { 172static struct resource veu0_resources[] = {
@@ -187,12 +189,15 @@ static struct platform_device veu0_device = {
187 }, 189 },
188 .resource = veu0_resources, 190 .resource = veu0_resources,
189 .num_resources = ARRAY_SIZE(veu0_resources), 191 .num_resources = ARRAY_SIZE(veu0_resources),
192 .archdata = {
193 .hwblk_id = HWBLK_VEU2H0,
194 },
190}; 195};
191 196
192static struct uio_info veu1_platform_data = { 197static struct uio_info veu1_platform_data = {
193 .name = "VEU2H", 198 .name = "VEU2H",
194 .version = "0", 199 .version = "0",
195 .irq = evt2irq(0x560), 200 .irq = 27,
196}; 201};
197 202
198static struct resource veu1_resources[] = { 203static struct resource veu1_resources[] = {
@@ -215,6 +220,9 @@ static struct platform_device veu1_device = {
215 }, 220 },
216 .resource = veu1_resources, 221 .resource = veu1_resources,
217 .num_resources = ARRAY_SIZE(veu1_resources), 222 .num_resources = ARRAY_SIZE(veu1_resources),
223 .archdata = {
224 .hwblk_id = HWBLK_VEU2H1,
225 },
218}; 226};
219 227
220static struct sh_timer_config cmt_platform_data = { 228static struct sh_timer_config cmt_platform_data = {
@@ -231,7 +239,7 @@ static struct resource cmt_resources[] = {
231 .flags = IORESOURCE_MEM, 239 .flags = IORESOURCE_MEM,
232 }, 240 },
233 [1] = { 241 [1] = {
234 .start = evt2irq(0xf00), 242 .start = 104,
235 .flags = IORESOURCE_IRQ, 243 .flags = IORESOURCE_IRQ,
236 }, 244 },
237}; 245};
@@ -244,6 +252,9 @@ static struct platform_device cmt_device = {
244 }, 252 },
245 .resource = cmt_resources, 253 .resource = cmt_resources,
246 .num_resources = ARRAY_SIZE(cmt_resources), 254 .num_resources = ARRAY_SIZE(cmt_resources),
255 .archdata = {
256 .hwblk_id = HWBLK_CMT,
257 },
247}; 258};
248 259
249static struct sh_timer_config tmu0_platform_data = { 260static struct sh_timer_config tmu0_platform_data = {
@@ -259,7 +270,7 @@ static struct resource tmu0_resources[] = {
259 .flags = IORESOURCE_MEM, 270 .flags = IORESOURCE_MEM,
260 }, 271 },
261 [1] = { 272 [1] = {
262 .start = evt2irq(0x400), 273 .start = 16,
263 .flags = IORESOURCE_IRQ, 274 .flags = IORESOURCE_IRQ,
264 }, 275 },
265}; 276};
@@ -272,6 +283,9 @@ static struct platform_device tmu0_device = {
272 }, 283 },
273 .resource = tmu0_resources, 284 .resource = tmu0_resources,
274 .num_resources = ARRAY_SIZE(tmu0_resources), 285 .num_resources = ARRAY_SIZE(tmu0_resources),
286 .archdata = {
287 .hwblk_id = HWBLK_TMU0,
288 },
275}; 289};
276 290
277static struct sh_timer_config tmu1_platform_data = { 291static struct sh_timer_config tmu1_platform_data = {
@@ -287,7 +301,7 @@ static struct resource tmu1_resources[] = {
287 .flags = IORESOURCE_MEM, 301 .flags = IORESOURCE_MEM,
288 }, 302 },
289 [1] = { 303 [1] = {
290 .start = evt2irq(0x420), 304 .start = 17,
291 .flags = IORESOURCE_IRQ, 305 .flags = IORESOURCE_IRQ,
292 }, 306 },
293}; 307};
@@ -300,6 +314,9 @@ static struct platform_device tmu1_device = {
300 }, 314 },
301 .resource = tmu1_resources, 315 .resource = tmu1_resources,
302 .num_resources = ARRAY_SIZE(tmu1_resources), 316 .num_resources = ARRAY_SIZE(tmu1_resources),
317 .archdata = {
318 .hwblk_id = HWBLK_TMU0,
319 },
303}; 320};
304 321
305static struct sh_timer_config tmu2_platform_data = { 322static struct sh_timer_config tmu2_platform_data = {
@@ -314,7 +331,7 @@ static struct resource tmu2_resources[] = {
314 .flags = IORESOURCE_MEM, 331 .flags = IORESOURCE_MEM,
315 }, 332 },
316 [1] = { 333 [1] = {
317 .start = evt2irq(0x440), 334 .start = 18,
318 .flags = IORESOURCE_IRQ, 335 .flags = IORESOURCE_IRQ,
319 }, 336 },
320}; 337};
@@ -327,6 +344,9 @@ static struct platform_device tmu2_device = {
327 }, 344 },
328 .resource = tmu2_resources, 345 .resource = tmu2_resources,
329 .num_resources = ARRAY_SIZE(tmu2_resources), 346 .num_resources = ARRAY_SIZE(tmu2_resources),
347 .archdata = {
348 .hwblk_id = HWBLK_TMU0,
349 },
330}; 350};
331 351
332static struct sh_timer_config tmu3_platform_data = { 352static struct sh_timer_config tmu3_platform_data = {
@@ -341,7 +361,7 @@ static struct resource tmu3_resources[] = {
341 .flags = IORESOURCE_MEM, 361 .flags = IORESOURCE_MEM,
342 }, 362 },
343 [1] = { 363 [1] = {
344 .start = evt2irq(0x920), 364 .start = 57,
345 .flags = IORESOURCE_IRQ, 365 .flags = IORESOURCE_IRQ,
346 }, 366 },
347}; 367};
@@ -354,6 +374,9 @@ static struct platform_device tmu3_device = {
354 }, 374 },
355 .resource = tmu3_resources, 375 .resource = tmu3_resources,
356 .num_resources = ARRAY_SIZE(tmu3_resources), 376 .num_resources = ARRAY_SIZE(tmu3_resources),
377 .archdata = {
378 .hwblk_id = HWBLK_TMU1,
379 },
357}; 380};
358 381
359static struct sh_timer_config tmu4_platform_data = { 382static struct sh_timer_config tmu4_platform_data = {
@@ -368,7 +391,7 @@ static struct resource tmu4_resources[] = {
368 .flags = IORESOURCE_MEM, 391 .flags = IORESOURCE_MEM,
369 }, 392 },
370 [1] = { 393 [1] = {
371 .start = evt2irq(0x940), 394 .start = 58,
372 .flags = IORESOURCE_IRQ, 395 .flags = IORESOURCE_IRQ,
373 }, 396 },
374}; 397};
@@ -381,6 +404,9 @@ static struct platform_device tmu4_device = {
381 }, 404 },
382 .resource = tmu4_resources, 405 .resource = tmu4_resources,
383 .num_resources = ARRAY_SIZE(tmu4_resources), 406 .num_resources = ARRAY_SIZE(tmu4_resources),
407 .archdata = {
408 .hwblk_id = HWBLK_TMU1,
409 },
384}; 410};
385 411
386static struct sh_timer_config tmu5_platform_data = { 412static struct sh_timer_config tmu5_platform_data = {
@@ -395,7 +421,7 @@ static struct resource tmu5_resources[] = {
395 .flags = IORESOURCE_MEM, 421 .flags = IORESOURCE_MEM,
396 }, 422 },
397 [1] = { 423 [1] = {
398 .start = evt2irq(0x920), 424 .start = 57,
399 .flags = IORESOURCE_IRQ, 425 .flags = IORESOURCE_IRQ,
400 }, 426 },
401}; 427};
@@ -408,6 +434,9 @@ static struct platform_device tmu5_device = {
408 }, 434 },
409 .resource = tmu5_resources, 435 .resource = tmu5_resources,
410 .num_resources = ARRAY_SIZE(tmu5_resources), 436 .num_resources = ARRAY_SIZE(tmu5_resources),
437 .archdata = {
438 .hwblk_id = HWBLK_TMU1,
439 },
411}; 440};
412 441
413static struct resource rtc_resources[] = { 442static struct resource rtc_resources[] = {
@@ -418,17 +447,17 @@ static struct resource rtc_resources[] = {
418 }, 447 },
419 [1] = { 448 [1] = {
420 /* Period IRQ */ 449 /* Period IRQ */
421 .start = evt2irq(0xaa0), 450 .start = 69,
422 .flags = IORESOURCE_IRQ, 451 .flags = IORESOURCE_IRQ,
423 }, 452 },
424 [2] = { 453 [2] = {
425 /* Carry IRQ */ 454 /* Carry IRQ */
426 .start = evt2irq(0xac0), 455 .start = 70,
427 .flags = IORESOURCE_IRQ, 456 .flags = IORESOURCE_IRQ,
428 }, 457 },
429 [3] = { 458 [3] = {
430 /* Alarm IRQ */ 459 /* Alarm IRQ */
431 .start = evt2irq(0xa80), 460 .start = 68,
432 .flags = IORESOURCE_IRQ, 461 .flags = IORESOURCE_IRQ,
433 }, 462 },
434}; 463};
@@ -438,6 +467,9 @@ static struct platform_device rtc_device = {
438 .id = -1, 467 .id = -1,
439 .num_resources = ARRAY_SIZE(rtc_resources), 468 .num_resources = ARRAY_SIZE(rtc_resources),
440 .resource = rtc_resources, 469 .resource = rtc_resources,
470 .archdata = {
471 .hwblk_id = HWBLK_RTC,
472 },
441}; 473};
442 474
443static struct r8a66597_platdata r8a66597_data = { 475static struct r8a66597_platdata r8a66597_data = {
@@ -451,8 +483,8 @@ static struct resource sh7723_usb_host_resources[] = {
451 .flags = IORESOURCE_MEM, 483 .flags = IORESOURCE_MEM,
452 }, 484 },
453 [1] = { 485 [1] = {
454 .start = evt2irq(0xa20), 486 .start = 65,
455 .end = evt2irq(0xa20), 487 .end = 65,
456 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 488 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
457 }, 489 },
458}; 490};
@@ -467,6 +499,9 @@ static struct platform_device sh7723_usb_host_device = {
467 }, 499 },
468 .num_resources = ARRAY_SIZE(sh7723_usb_host_resources), 500 .num_resources = ARRAY_SIZE(sh7723_usb_host_resources),
469 .resource = sh7723_usb_host_resources, 501 .resource = sh7723_usb_host_resources,
502 .archdata = {
503 .hwblk_id = HWBLK_USB,
504 },
470}; 505};
471 506
472static struct resource iic_resources[] = { 507static struct resource iic_resources[] = {
@@ -477,8 +512,8 @@ static struct resource iic_resources[] = {
477 .flags = IORESOURCE_MEM, 512 .flags = IORESOURCE_MEM,
478 }, 513 },
479 [1] = { 514 [1] = {
480 .start = evt2irq(0xe00), 515 .start = 96,
481 .end = evt2irq(0xe60), 516 .end = 99,
482 .flags = IORESOURCE_IRQ, 517 .flags = IORESOURCE_IRQ,
483 }, 518 },
484}; 519};
@@ -488,6 +523,9 @@ static struct platform_device iic_device = {
488 .id = 0, /* "i2c0" clock */ 523 .id = 0, /* "i2c0" clock */
489 .num_resources = ARRAY_SIZE(iic_resources), 524 .num_resources = ARRAY_SIZE(iic_resources),
490 .resource = iic_resources, 525 .resource = iic_resources,
526 .archdata = {
527 .hwblk_id = HWBLK_IIC,
528 },
491}; 529};
492 530
493static struct platform_device *sh7723_devices[] __initdata = { 531static struct platform_device *sh7723_devices[] __initdata = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index 26b74c2f949..a37dd72c367 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -20,7 +20,6 @@
20#include <linux/uio_driver.h> 20#include <linux/uio_driver.h>
21#include <linux/sh_dma.h> 21#include <linux/sh_dma.h>
22#include <linux/sh_timer.h> 22#include <linux/sh_timer.h>
23#include <linux/sh_intc.h>
24#include <linux/io.h> 23#include <linux/io.h>
25#include <linux/notifier.h> 24#include <linux/notifier.h>
26 25
@@ -215,21 +214,21 @@ static struct resource sh7724_dmae0_resources[] = {
215 .flags = IORESOURCE_MEM, 214 .flags = IORESOURCE_MEM,
216 }, 215 },
217 { 216 {
218 .name = "error_irq", 217 /* DMA error IRQ */
219 .start = evt2irq(0xbc0), 218 .start = 78,
220 .end = evt2irq(0xbc0), 219 .end = 78,
221 .flags = IORESOURCE_IRQ, 220 .flags = IORESOURCE_IRQ,
222 }, 221 },
223 { 222 {
224 /* IRQ for channels 0-3 */ 223 /* IRQ for channels 0-3 */
225 .start = evt2irq(0x800), 224 .start = 48,
226 .end = evt2irq(0x860), 225 .end = 51,
227 .flags = IORESOURCE_IRQ, 226 .flags = IORESOURCE_IRQ,
228 }, 227 },
229 { 228 {
230 /* IRQ for channels 4-5 */ 229 /* IRQ for channels 4-5 */
231 .start = evt2irq(0xb80), 230 .start = 76,
232 .end = evt2irq(0xba0), 231 .end = 77,
233 .flags = IORESOURCE_IRQ, 232 .flags = IORESOURCE_IRQ,
234 }, 233 },
235}; 234};
@@ -249,21 +248,21 @@ static struct resource sh7724_dmae1_resources[] = {
249 .flags = IORESOURCE_MEM, 248 .flags = IORESOURCE_MEM,
250 }, 249 },
251 { 250 {
252 .name = "error_irq", 251 /* DMA error IRQ */
253 .start = evt2irq(0xb40), 252 .start = 74,
254 .end = evt2irq(0xb40), 253 .end = 74,
255 .flags = IORESOURCE_IRQ, 254 .flags = IORESOURCE_IRQ,
256 }, 255 },
257 { 256 {
258 /* IRQ for channels 0-3 */ 257 /* IRQ for channels 0-3 */
259 .start = evt2irq(0x700), 258 .start = 40,
260 .end = evt2irq(0x760), 259 .end = 43,
261 .flags = IORESOURCE_IRQ, 260 .flags = IORESOURCE_IRQ,
262 }, 261 },
263 { 262 {
264 /* IRQ for channels 4-5 */ 263 /* IRQ for channels 4-5 */
265 .start = evt2irq(0xb00), 264 .start = 72,
266 .end = evt2irq(0xb20), 265 .end = 73,
267 .flags = IORESOURCE_IRQ, 266 .flags = IORESOURCE_IRQ,
268 }, 267 },
269}; 268};
@@ -276,6 +275,9 @@ static struct platform_device dma0_device = {
276 .dev = { 275 .dev = {
277 .platform_data = &dma_platform_data, 276 .platform_data = &dma_platform_data,
278 }, 277 },
278 .archdata = {
279 .hwblk_id = HWBLK_DMAC0,
280 },
279}; 281};
280 282
281static struct platform_device dma1_device = { 283static struct platform_device dma1_device = {
@@ -286,6 +288,9 @@ static struct platform_device dma1_device = {
286 .dev = { 288 .dev = {
287 .platform_data = &dma_platform_data, 289 .platform_data = &dma_platform_data,
288 }, 290 },
291 .archdata = {
292 .hwblk_id = HWBLK_DMAC1,
293 },
289}; 294};
290 295
291/* Serial */ 296/* Serial */
@@ -296,7 +301,7 @@ static struct plat_sci_port scif0_platform_data = {
296 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 301 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
297 .scbrr_algo_id = SCBRR_ALGO_2, 302 .scbrr_algo_id = SCBRR_ALGO_2,
298 .type = PORT_SCIF, 303 .type = PORT_SCIF,
299 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)), 304 .irqs = { 80, 80, 80, 80 },
300 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, 305 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
301}; 306};
302 307
@@ -315,7 +320,7 @@ static struct plat_sci_port scif1_platform_data = {
315 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 320 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
316 .scbrr_algo_id = SCBRR_ALGO_2, 321 .scbrr_algo_id = SCBRR_ALGO_2,
317 .type = PORT_SCIF, 322 .type = PORT_SCIF,
318 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)), 323 .irqs = { 81, 81, 81, 81 },
319 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, 324 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
320}; 325};
321 326
@@ -334,7 +339,7 @@ static struct plat_sci_port scif2_platform_data = {
334 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 339 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
335 .scbrr_algo_id = SCBRR_ALGO_2, 340 .scbrr_algo_id = SCBRR_ALGO_2,
336 .type = PORT_SCIF, 341 .type = PORT_SCIF,
337 .irqs = SCIx_IRQ_MUXED(evt2irq(0xc40)), 342 .irqs = { 82, 82, 82, 82 },
338 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, 343 .regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
339}; 344};
340 345
@@ -353,7 +358,7 @@ static struct plat_sci_port scif3_platform_data = {
353 .scscr = SCSCR_RE | SCSCR_TE, 358 .scscr = SCSCR_RE | SCSCR_TE,
354 .scbrr_algo_id = SCBRR_ALGO_3, 359 .scbrr_algo_id = SCBRR_ALGO_3,
355 .type = PORT_SCIFA, 360 .type = PORT_SCIFA,
356 .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)), 361 .irqs = { 56, 56, 56, 56 },
357}; 362};
358 363
359static struct platform_device scif3_device = { 364static struct platform_device scif3_device = {
@@ -371,7 +376,7 @@ static struct plat_sci_port scif4_platform_data = {
371 .scscr = SCSCR_RE | SCSCR_TE, 376 .scscr = SCSCR_RE | SCSCR_TE,
372 .scbrr_algo_id = SCBRR_ALGO_3, 377 .scbrr_algo_id = SCBRR_ALGO_3,
373 .type = PORT_SCIFA, 378 .type = PORT_SCIFA,
374 .irqs = SCIx_IRQ_MUXED(evt2irq(0xd00)), 379 .irqs = { 88, 88, 88, 88 },
375}; 380};
376 381
377static struct platform_device scif4_device = { 382static struct platform_device scif4_device = {
@@ -389,7 +394,7 @@ static struct plat_sci_port scif5_platform_data = {
389 .scscr = SCSCR_RE | SCSCR_TE, 394 .scscr = SCSCR_RE | SCSCR_TE,
390 .scbrr_algo_id = SCBRR_ALGO_3, 395 .scbrr_algo_id = SCBRR_ALGO_3,
391 .type = PORT_SCIFA, 396 .type = PORT_SCIFA,
392 .irqs = SCIx_IRQ_MUXED(evt2irq(0xfa0)), 397 .irqs = { 109, 109, 109, 109 },
393}; 398};
394 399
395static struct platform_device scif5_device = { 400static struct platform_device scif5_device = {
@@ -409,17 +414,17 @@ static struct resource rtc_resources[] = {
409 }, 414 },
410 [1] = { 415 [1] = {
411 /* Period IRQ */ 416 /* Period IRQ */
412 .start = evt2irq(0xaa0), 417 .start = 69,
413 .flags = IORESOURCE_IRQ, 418 .flags = IORESOURCE_IRQ,
414 }, 419 },
415 [2] = { 420 [2] = {
416 /* Carry IRQ */ 421 /* Carry IRQ */
417 .start = evt2irq(0xac0), 422 .start = 70,
418 .flags = IORESOURCE_IRQ, 423 .flags = IORESOURCE_IRQ,
419 }, 424 },
420 [3] = { 425 [3] = {
421 /* Alarm IRQ */ 426 /* Alarm IRQ */
422 .start = evt2irq(0xa80), 427 .start = 68,
423 .flags = IORESOURCE_IRQ, 428 .flags = IORESOURCE_IRQ,
424 }, 429 },
425}; 430};
@@ -429,6 +434,9 @@ static struct platform_device rtc_device = {
429 .id = -1, 434 .id = -1,
430 .num_resources = ARRAY_SIZE(rtc_resources), 435 .num_resources = ARRAY_SIZE(rtc_resources),
431 .resource = rtc_resources, 436 .resource = rtc_resources,
437 .archdata = {
438 .hwblk_id = HWBLK_RTC,
439 },
432}; 440};
433 441
434/* I2C0 */ 442/* I2C0 */
@@ -440,8 +448,8 @@ static struct resource iic0_resources[] = {
440 .flags = IORESOURCE_MEM, 448 .flags = IORESOURCE_MEM,
441 }, 449 },
442 [1] = { 450 [1] = {
443 .start = evt2irq(0xe00), 451 .start = 96,
444 .end = evt2irq(0xe60), 452 .end = 99,
445 .flags = IORESOURCE_IRQ, 453 .flags = IORESOURCE_IRQ,
446 }, 454 },
447}; 455};
@@ -451,6 +459,9 @@ static struct platform_device iic0_device = {
451 .id = 0, /* "i2c0" clock */ 459 .id = 0, /* "i2c0" clock */
452 .num_resources = ARRAY_SIZE(iic0_resources), 460 .num_resources = ARRAY_SIZE(iic0_resources),
453 .resource = iic0_resources, 461 .resource = iic0_resources,
462 .archdata = {
463 .hwblk_id = HWBLK_IIC0,
464 },
454}; 465};
455 466
456/* I2C1 */ 467/* I2C1 */
@@ -462,8 +473,8 @@ static struct resource iic1_resources[] = {
462 .flags = IORESOURCE_MEM, 473 .flags = IORESOURCE_MEM,
463 }, 474 },
464 [1] = { 475 [1] = {
465 .start = evt2irq(0xd80), 476 .start = 92,
466 .end = evt2irq(0xde0), 477 .end = 95,
467 .flags = IORESOURCE_IRQ, 478 .flags = IORESOURCE_IRQ,
468 }, 479 },
469}; 480};
@@ -473,13 +484,16 @@ static struct platform_device iic1_device = {
473 .id = 1, /* "i2c1" clock */ 484 .id = 1, /* "i2c1" clock */
474 .num_resources = ARRAY_SIZE(iic1_resources), 485 .num_resources = ARRAY_SIZE(iic1_resources),
475 .resource = iic1_resources, 486 .resource = iic1_resources,
487 .archdata = {
488 .hwblk_id = HWBLK_IIC1,
489 },
476}; 490};
477 491
478/* VPU */ 492/* VPU */
479static struct uio_info vpu_platform_data = { 493static struct uio_info vpu_platform_data = {
480 .name = "VPU5F", 494 .name = "VPU5F",
481 .version = "0", 495 .version = "0",
482 .irq = evt2irq(0x980), 496 .irq = 60,
483}; 497};
484 498
485static struct resource vpu_resources[] = { 499static struct resource vpu_resources[] = {
@@ -502,13 +516,16 @@ static struct platform_device vpu_device = {
502 }, 516 },
503 .resource = vpu_resources, 517 .resource = vpu_resources,
504 .num_resources = ARRAY_SIZE(vpu_resources), 518 .num_resources = ARRAY_SIZE(vpu_resources),
519 .archdata = {
520 .hwblk_id = HWBLK_VPU,
521 },
505}; 522};
506 523
507/* VEU0 */ 524/* VEU0 */
508static struct uio_info veu0_platform_data = { 525static struct uio_info veu0_platform_data = {
509 .name = "VEU3F0", 526 .name = "VEU3F0",
510 .version = "0", 527 .version = "0",
511 .irq = evt2irq(0xc60), 528 .irq = 83,
512}; 529};
513 530
514static struct resource veu0_resources[] = { 531static struct resource veu0_resources[] = {
@@ -531,13 +548,16 @@ static struct platform_device veu0_device = {
531 }, 548 },
532 .resource = veu0_resources, 549 .resource = veu0_resources,
533 .num_resources = ARRAY_SIZE(veu0_resources), 550 .num_resources = ARRAY_SIZE(veu0_resources),
551 .archdata = {
552 .hwblk_id = HWBLK_VEU0,
553 },
534}; 554};
535 555
536/* VEU1 */ 556/* VEU1 */
537static struct uio_info veu1_platform_data = { 557static struct uio_info veu1_platform_data = {
538 .name = "VEU3F1", 558 .name = "VEU3F1",
539 .version = "0", 559 .version = "0",
540 .irq = evt2irq(0x8c0), 560 .irq = 54,
541}; 561};
542 562
543static struct resource veu1_resources[] = { 563static struct resource veu1_resources[] = {
@@ -560,6 +580,9 @@ static struct platform_device veu1_device = {
560 }, 580 },
561 .resource = veu1_resources, 581 .resource = veu1_resources,
562 .num_resources = ARRAY_SIZE(veu1_resources), 582 .num_resources = ARRAY_SIZE(veu1_resources),
583 .archdata = {
584 .hwblk_id = HWBLK_VEU1,
585 },
563}; 586};
564 587
565/* BEU0 */ 588/* BEU0 */
@@ -589,6 +612,9 @@ static struct platform_device beu0_device = {
589 }, 612 },
590 .resource = beu0_resources, 613 .resource = beu0_resources,
591 .num_resources = ARRAY_SIZE(beu0_resources), 614 .num_resources = ARRAY_SIZE(beu0_resources),
615 .archdata = {
616 .hwblk_id = HWBLK_BEU0,
617 },
592}; 618};
593 619
594/* BEU1 */ 620/* BEU1 */
@@ -618,6 +644,9 @@ static struct platform_device beu1_device = {
618 }, 644 },
619 .resource = beu1_resources, 645 .resource = beu1_resources,
620 .num_resources = ARRAY_SIZE(beu1_resources), 646 .num_resources = ARRAY_SIZE(beu1_resources),
647 .archdata = {
648 .hwblk_id = HWBLK_BEU1,
649 },
621}; 650};
622 651
623static struct sh_timer_config cmt_platform_data = { 652static struct sh_timer_config cmt_platform_data = {
@@ -634,7 +663,7 @@ static struct resource cmt_resources[] = {
634 .flags = IORESOURCE_MEM, 663 .flags = IORESOURCE_MEM,
635 }, 664 },
636 [1] = { 665 [1] = {
637 .start = evt2irq(0xf00), 666 .start = 104,
638 .flags = IORESOURCE_IRQ, 667 .flags = IORESOURCE_IRQ,
639 }, 668 },
640}; 669};
@@ -647,6 +676,9 @@ static struct platform_device cmt_device = {
647 }, 676 },
648 .resource = cmt_resources, 677 .resource = cmt_resources,
649 .num_resources = ARRAY_SIZE(cmt_resources), 678 .num_resources = ARRAY_SIZE(cmt_resources),
679 .archdata = {
680 .hwblk_id = HWBLK_CMT,
681 },
650}; 682};
651 683
652static struct sh_timer_config tmu0_platform_data = { 684static struct sh_timer_config tmu0_platform_data = {
@@ -662,7 +694,7 @@ static struct resource tmu0_resources[] = {
662 .flags = IORESOURCE_MEM, 694 .flags = IORESOURCE_MEM,
663 }, 695 },
664 [1] = { 696 [1] = {
665 .start = evt2irq(0x400), 697 .start = 16,
666 .flags = IORESOURCE_IRQ, 698 .flags = IORESOURCE_IRQ,
667 }, 699 },
668}; 700};
@@ -675,6 +707,9 @@ static struct platform_device tmu0_device = {
675 }, 707 },
676 .resource = tmu0_resources, 708 .resource = tmu0_resources,
677 .num_resources = ARRAY_SIZE(tmu0_resources), 709 .num_resources = ARRAY_SIZE(tmu0_resources),
710 .archdata = {
711 .hwblk_id = HWBLK_TMU0,
712 },
678}; 713};
679 714
680static struct sh_timer_config tmu1_platform_data = { 715static struct sh_timer_config tmu1_platform_data = {
@@ -690,7 +725,7 @@ static struct resource tmu1_resources[] = {
690 .flags = IORESOURCE_MEM, 725 .flags = IORESOURCE_MEM,
691 }, 726 },
692 [1] = { 727 [1] = {
693 .start = evt2irq(0x420), 728 .start = 17,
694 .flags = IORESOURCE_IRQ, 729 .flags = IORESOURCE_IRQ,
695 }, 730 },
696}; 731};
@@ -703,6 +738,9 @@ static struct platform_device tmu1_device = {
703 }, 738 },
704 .resource = tmu1_resources, 739 .resource = tmu1_resources,
705 .num_resources = ARRAY_SIZE(tmu1_resources), 740 .num_resources = ARRAY_SIZE(tmu1_resources),
741 .archdata = {
742 .hwblk_id = HWBLK_TMU0,
743 },
706}; 744};
707 745
708static struct sh_timer_config tmu2_platform_data = { 746static struct sh_timer_config tmu2_platform_data = {
@@ -717,7 +755,7 @@ static struct resource tmu2_resources[] = {
717 .flags = IORESOURCE_MEM, 755 .flags = IORESOURCE_MEM,
718 }, 756 },
719 [1] = { 757 [1] = {
720 .start = evt2irq(0x440), 758 .start = 18,
721 .flags = IORESOURCE_IRQ, 759 .flags = IORESOURCE_IRQ,
722 }, 760 },
723}; 761};
@@ -730,6 +768,9 @@ static struct platform_device tmu2_device = {
730 }, 768 },
731 .resource = tmu2_resources, 769 .resource = tmu2_resources,
732 .num_resources = ARRAY_SIZE(tmu2_resources), 770 .num_resources = ARRAY_SIZE(tmu2_resources),
771 .archdata = {
772 .hwblk_id = HWBLK_TMU0,
773 },
733}; 774};
734 775
735 776
@@ -745,7 +786,7 @@ static struct resource tmu3_resources[] = {
745 .flags = IORESOURCE_MEM, 786 .flags = IORESOURCE_MEM,
746 }, 787 },
747 [1] = { 788 [1] = {
748 .start = evt2irq(0x920), 789 .start = 57,
749 .flags = IORESOURCE_IRQ, 790 .flags = IORESOURCE_IRQ,
750 }, 791 },
751}; 792};
@@ -758,6 +799,9 @@ static struct platform_device tmu3_device = {
758 }, 799 },
759 .resource = tmu3_resources, 800 .resource = tmu3_resources,
760 .num_resources = ARRAY_SIZE(tmu3_resources), 801 .num_resources = ARRAY_SIZE(tmu3_resources),
802 .archdata = {
803 .hwblk_id = HWBLK_TMU1,
804 },
761}; 805};
762 806
763static struct sh_timer_config tmu4_platform_data = { 807static struct sh_timer_config tmu4_platform_data = {
@@ -772,7 +816,7 @@ static struct resource tmu4_resources[] = {
772 .flags = IORESOURCE_MEM, 816 .flags = IORESOURCE_MEM,
773 }, 817 },
774 [1] = { 818 [1] = {
775 .start = evt2irq(0x940), 819 .start = 58,
776 .flags = IORESOURCE_IRQ, 820 .flags = IORESOURCE_IRQ,
777 }, 821 },
778}; 822};
@@ -785,6 +829,9 @@ static struct platform_device tmu4_device = {
785 }, 829 },
786 .resource = tmu4_resources, 830 .resource = tmu4_resources,
787 .num_resources = ARRAY_SIZE(tmu4_resources), 831 .num_resources = ARRAY_SIZE(tmu4_resources),
832 .archdata = {
833 .hwblk_id = HWBLK_TMU1,
834 },
788}; 835};
789 836
790static struct sh_timer_config tmu5_platform_data = { 837static struct sh_timer_config tmu5_platform_data = {
@@ -799,7 +846,7 @@ static struct resource tmu5_resources[] = {
799 .flags = IORESOURCE_MEM, 846 .flags = IORESOURCE_MEM,
800 }, 847 },
801 [1] = { 848 [1] = {
802 .start = evt2irq(0x920), 849 .start = 57,
803 .flags = IORESOURCE_IRQ, 850 .flags = IORESOURCE_IRQ,
804 }, 851 },
805}; 852};
@@ -812,13 +859,16 @@ static struct platform_device tmu5_device = {
812 }, 859 },
813 .resource = tmu5_resources, 860 .resource = tmu5_resources,
814 .num_resources = ARRAY_SIZE(tmu5_resources), 861 .num_resources = ARRAY_SIZE(tmu5_resources),
862 .archdata = {
863 .hwblk_id = HWBLK_TMU1,
864 },
815}; 865};
816 866
817/* JPU */ 867/* JPU */
818static struct uio_info jpu_platform_data = { 868static struct uio_info jpu_platform_data = {
819 .name = "JPU", 869 .name = "JPU",
820 .version = "0", 870 .version = "0",
821 .irq = evt2irq(0x560), 871 .irq = 27,
822}; 872};
823 873
824static struct resource jpu_resources[] = { 874static struct resource jpu_resources[] = {
@@ -841,13 +891,16 @@ static struct platform_device jpu_device = {
841 }, 891 },
842 .resource = jpu_resources, 892 .resource = jpu_resources,
843 .num_resources = ARRAY_SIZE(jpu_resources), 893 .num_resources = ARRAY_SIZE(jpu_resources),
894 .archdata = {
895 .hwblk_id = HWBLK_JPU,
896 },
844}; 897};
845 898
846/* SPU2DSP0 */ 899/* SPU2DSP0 */
847static struct uio_info spu0_platform_data = { 900static struct uio_info spu0_platform_data = {
848 .name = "SPU2DSP0", 901 .name = "SPU2DSP0",
849 .version = "0", 902 .version = "0",
850 .irq = evt2irq(0xcc0), 903 .irq = 86,
851}; 904};
852 905
853static struct resource spu0_resources[] = { 906static struct resource spu0_resources[] = {
@@ -870,13 +923,16 @@ static struct platform_device spu0_device = {
870 }, 923 },
871 .resource = spu0_resources, 924 .resource = spu0_resources,
872 .num_resources = ARRAY_SIZE(spu0_resources), 925 .num_resources = ARRAY_SIZE(spu0_resources),
926 .archdata = {
927 .hwblk_id = HWBLK_SPU,
928 },
873}; 929};
874 930
875/* SPU2DSP1 */ 931/* SPU2DSP1 */
876static struct uio_info spu1_platform_data = { 932static struct uio_info spu1_platform_data = {
877 .name = "SPU2DSP1", 933 .name = "SPU2DSP1",
878 .version = "0", 934 .version = "0",
879 .irq = evt2irq(0xce0), 935 .irq = 87,
880}; 936};
881 937
882static struct resource spu1_resources[] = { 938static struct resource spu1_resources[] = {
@@ -899,6 +955,9 @@ static struct platform_device spu1_device = {
899 }, 955 },
900 .resource = spu1_resources, 956 .resource = spu1_resources,
901 .num_resources = ARRAY_SIZE(spu1_resources), 957 .num_resources = ARRAY_SIZE(spu1_resources),
958 .archdata = {
959 .hwblk_id = HWBLK_SPU,
960 },
902}; 961};
903 962
904static struct platform_device *sh7724_devices[] __initdata = { 963static struct platform_device *sh7724_devices[] __initdata = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7734.c b/arch/sh/kernel/cpu/sh4a/setup-sh7734.c
deleted file mode 100644
index f799971d453..00000000000
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7734.c
+++ /dev/null
@@ -1,800 +0,0 @@
1/*
2 * arch/sh/kernel/cpu/sh4a/setup-sh7734.c
3
4 * SH7734 Setup
5 *
6 * Copyright (C) 2011,2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
7 * Copyright (C) 2011,2012 Renesas Solutions Corp.
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive
11 * for more details.
12 */
13
14#include <linux/platform_device.h>
15#include <linux/init.h>
16#include <linux/serial.h>
17#include <linux/mm.h>
18#include <linux/dma-mapping.h>
19#include <linux/serial_sci.h>
20#include <linux/sh_timer.h>
21#include <linux/io.h>
22#include <asm/clock.h>
23#include <asm/irq.h>
24#include <cpu/sh7734.h>
25
26/* SCIF */
27static struct plat_sci_port scif0_platform_data = {
28 .mapbase = 0xFFE40000,
29 .flags = UPF_BOOT_AUTOCONF,
30 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
31 .scbrr_algo_id = SCBRR_ALGO_2,
32 .type = PORT_SCIF,
33 .irqs = SCIx_IRQ_MUXED(evt2irq(0x8C0)),
34 .regtype = SCIx_SH4_SCIF_REGTYPE,
35};
36
37static struct platform_device scif0_device = {
38 .name = "sh-sci",
39 .id = 0,
40 .dev = {
41 .platform_data = &scif0_platform_data,
42 },
43};
44
45static struct plat_sci_port scif1_platform_data = {
46 .mapbase = 0xFFE41000,
47 .flags = UPF_BOOT_AUTOCONF,
48 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
49 .scbrr_algo_id = SCBRR_ALGO_2,
50 .type = PORT_SCIF,
51 .irqs = SCIx_IRQ_MUXED(evt2irq(0x8E0)),
52 .regtype = SCIx_SH4_SCIF_REGTYPE,
53};
54
55static struct platform_device scif1_device = {
56 .name = "sh-sci",
57 .id = 1,
58 .dev = {
59 .platform_data = &scif1_platform_data,
60 },
61};
62
63static struct plat_sci_port scif2_platform_data = {
64 .mapbase = 0xFFE42000,
65 .flags = UPF_BOOT_AUTOCONF,
66 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
67 .scbrr_algo_id = SCBRR_ALGO_2,
68 .type = PORT_SCIF,
69 .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)),
70 .regtype = SCIx_SH4_SCIF_REGTYPE,
71};
72
73static struct platform_device scif2_device = {
74 .name = "sh-sci",
75 .id = 2,
76 .dev = {
77 .platform_data = &scif2_platform_data,
78 },
79};
80
81static struct plat_sci_port scif3_platform_data = {
82 .mapbase = 0xFFE43000,
83 .flags = UPF_BOOT_AUTOCONF,
84 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
85 .scbrr_algo_id = SCBRR_ALGO_2,
86 .type = PORT_SCIF,
87 .irqs = SCIx_IRQ_MUXED(evt2irq(0x920)),
88 .regtype = SCIx_SH4_SCIF_REGTYPE,
89};
90
91static struct platform_device scif3_device = {
92 .name = "sh-sci",
93 .id = 3,
94 .dev = {
95 .platform_data = &scif3_platform_data,
96 },
97};
98
99static struct plat_sci_port scif4_platform_data = {
100 .mapbase = 0xFFE44000,
101 .flags = UPF_BOOT_AUTOCONF,
102 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
103 .scbrr_algo_id = SCBRR_ALGO_2,
104 .type = PORT_SCIF,
105 .irqs = SCIx_IRQ_MUXED(evt2irq(0x940)),
106 .regtype = SCIx_SH4_SCIF_REGTYPE,
107};
108
109static struct platform_device scif4_device = {
110 .name = "sh-sci",
111 .id = 4,
112 .dev = {
113 .platform_data = &scif4_platform_data,
114 },
115};
116
117static struct plat_sci_port scif5_platform_data = {
118 .mapbase = 0xFFE43000,
119 .flags = UPF_BOOT_AUTOCONF,
120 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
121 .scbrr_algo_id = SCBRR_ALGO_2,
122 .type = PORT_SCIF,
123 .irqs = SCIx_IRQ_MUXED(evt2irq(0x960)),
124 .regtype = SCIx_SH4_SCIF_REGTYPE,
125};
126
127static struct platform_device scif5_device = {
128 .name = "sh-sci",
129 .id = 5,
130 .dev = {
131 .platform_data = &scif5_platform_data,
132 },
133};
134
135/* RTC */
136static struct resource rtc_resources[] = {
137 [0] = {
138 .name = "rtc",
139 .start = 0xFFFC5000,
140 .end = 0xFFFC5000 + 0x26 - 1,
141 .flags = IORESOURCE_IO,
142 },
143 [1] = {
144 .start = evt2irq(0xC00),
145 .flags = IORESOURCE_IRQ,
146 },
147};
148
149static struct platform_device rtc_device = {
150 .name = "sh-rtc",
151 .id = -1,
152 .num_resources = ARRAY_SIZE(rtc_resources),
153 .resource = rtc_resources,
154};
155
156/* I2C 0 */
157static struct resource i2c0_resources[] = {
158 [0] = {
159 .name = "IIC0",
160 .start = 0xFFC70000,
161 .end = 0xFFC7000A - 1,
162 .flags = IORESOURCE_MEM,
163 },
164 [1] = {
165 .start = evt2irq(0x860),
166 .flags = IORESOURCE_IRQ,
167 },
168};
169
170static struct platform_device i2c0_device = {
171 .name = "i2c-sh7734",
172 .id = 0,
173 .num_resources = ARRAY_SIZE(i2c0_resources),
174 .resource = i2c0_resources,
175};
176
177/* TMU */
178static struct sh_timer_config tmu0_platform_data = {
179 .channel_offset = 0x04,
180 .timer_bit = 0,
181 .clockevent_rating = 200,
182};
183
184static struct resource tmu0_resources[] = {
185 [0] = {
186 .start = 0xFFD80008,
187 .end = 0xFFD80014 - 1,
188 .flags = IORESOURCE_MEM,
189 },
190 [1] = {
191 .start = evt2irq(0x400),
192 .flags = IORESOURCE_IRQ,
193 },
194};
195
196static struct platform_device tmu0_device = {
197 .name = "sh_tmu",
198 .id = 0,
199 .dev = {
200 .platform_data = &tmu0_platform_data,
201 },
202 .resource = tmu0_resources,
203 .num_resources = ARRAY_SIZE(tmu0_resources),
204};
205
206static struct sh_timer_config tmu1_platform_data = {
207 .channel_offset = 0x10,
208 .timer_bit = 1,
209 .clocksource_rating = 200,
210};
211
212static struct resource tmu1_resources[] = {
213 [0] = {
214 .start = 0xFFD80014,
215 .end = 0xFFD80020 - 1,
216 .flags = IORESOURCE_MEM,
217 },
218 [1] = {
219 .start = evt2irq(0x420),
220 .flags = IORESOURCE_IRQ,
221 },
222};
223
224static struct platform_device tmu1_device = {
225 .name = "sh_tmu",
226 .id = 1,
227 .dev = {
228 .platform_data = &tmu1_platform_data,
229 },
230 .resource = tmu1_resources,
231 .num_resources = ARRAY_SIZE(tmu1_resources),
232};
233
234static struct sh_timer_config tmu2_platform_data = {
235 .channel_offset = 0x1c,
236 .timer_bit = 2,
237};
238
239static struct resource tmu2_resources[] = {
240 [0] = {
241 .start = 0xFFD80020,
242 .end = 0xFFD80030 - 1,
243 .flags = IORESOURCE_MEM,
244 },
245 [1] = {
246 .start = evt2irq(0x440),
247 .flags = IORESOURCE_IRQ,
248 },
249};
250
251static struct platform_device tmu2_device = {
252 .name = "sh_tmu",
253 .id = 2,
254 .dev = {
255 .platform_data = &tmu2_platform_data,
256 },
257 .resource = tmu2_resources,
258 .num_resources = ARRAY_SIZE(tmu2_resources),
259};
260
261
262static struct sh_timer_config tmu3_platform_data = {
263 .channel_offset = 0x04,
264 .timer_bit = 0,
265};
266
267static struct resource tmu3_resources[] = {
268 [0] = {
269 .start = 0xFFD81008,
270 .end = 0xFFD81014 - 1,
271 .flags = IORESOURCE_MEM,
272 },
273 [1] = {
274 .start = evt2irq(0x480),
275 .flags = IORESOURCE_IRQ,
276 },
277};
278
279static struct platform_device tmu3_device = {
280 .name = "sh_tmu",
281 .id = 3,
282 .dev = {
283 .platform_data = &tmu3_platform_data,
284 },
285 .resource = tmu3_resources,
286 .num_resources = ARRAY_SIZE(tmu3_resources),
287};
288
289static struct sh_timer_config tmu4_platform_data = {
290 .channel_offset = 0x10,
291 .timer_bit = 1,
292};
293
294static struct resource tmu4_resources[] = {
295 [0] = {
296 .start = 0xFFD81014,
297 .end = 0xFFD81020 - 1,
298 .flags = IORESOURCE_MEM,
299 },
300 [1] = {
301 .start = evt2irq(0x4A0),
302 .flags = IORESOURCE_IRQ,
303 },
304};
305
306static struct platform_device tmu4_device = {
307 .name = "sh_tmu",
308 .id = 4,
309 .dev = {
310 .platform_data = &tmu4_platform_data,
311 },
312 .resource = tmu4_resources,
313 .num_resources = ARRAY_SIZE(tmu4_resources),
314};
315
316static struct sh_timer_config tmu5_platform_data = {
317 .channel_offset = 0x1c,
318 .timer_bit = 2,
319};
320
321static struct resource tmu5_resources[] = {
322 [0] = {
323 .start = 0xFFD81020,
324 .end = 0xFFD81030 - 1,
325 .flags = IORESOURCE_MEM,
326 },
327 [1] = {
328 .start = evt2irq(0x4C0),
329 .flags = IORESOURCE_IRQ,
330 },
331};
332
333static struct platform_device tmu5_device = {
334 .name = "sh_tmu",
335 .id = 5,
336 .dev = {
337 .platform_data = &tmu5_platform_data,
338 },
339 .resource = tmu5_resources,
340 .num_resources = ARRAY_SIZE(tmu5_resources),
341};
342
343static struct sh_timer_config tmu6_platform_data = {
344 .channel_offset = 0x4,
345 .timer_bit = 0,
346};
347
348static struct resource tmu6_resources[] = {
349 [0] = {
350 .start = 0xFFD82008,
351 .end = 0xFFD82014 - 1,
352 .flags = IORESOURCE_MEM,
353 },
354 [1] = {
355 .start = evt2irq(0x500),
356 .flags = IORESOURCE_IRQ,
357 },
358};
359
360static struct platform_device tmu6_device = {
361 .name = "sh_tmu",
362 .id = 6,
363 .dev = {
364 .platform_data = &tmu6_platform_data,
365 },
366 .resource = tmu6_resources,
367 .num_resources = ARRAY_SIZE(tmu6_resources),
368};
369
370static struct sh_timer_config tmu7_platform_data = {
371 .channel_offset = 0x10,
372 .timer_bit = 1,
373};
374
375static struct resource tmu7_resources[] = {
376 [0] = {
377 .start = 0xFFD82014,
378 .end = 0xFFD82020 - 1,
379 .flags = IORESOURCE_MEM,
380 },
381 [1] = {
382 .start = evt2irq(0x520),
383 .flags = IORESOURCE_IRQ,
384 },
385};
386
387static struct platform_device tmu7_device = {
388 .name = "sh_tmu",
389 .id = 7,
390 .dev = {
391 .platform_data = &tmu7_platform_data,
392 },
393 .resource = tmu7_resources,
394 .num_resources = ARRAY_SIZE(tmu7_resources),
395};
396
397static struct sh_timer_config tmu8_platform_data = {
398 .channel_offset = 0x1c,
399 .timer_bit = 2,
400};
401
402static struct resource tmu8_resources[] = {
403 [0] = {
404 .start = 0xFFD82020,
405 .end = 0xFFD82030 - 1,
406 .flags = IORESOURCE_MEM,
407 },
408 [1] = {
409 .start = evt2irq(0x540),
410 .flags = IORESOURCE_IRQ,
411 },
412};
413
414static struct platform_device tmu8_device = {
415 .name = "sh_tmu",
416 .id = 8,
417 .dev = {
418 .platform_data = &tmu8_platform_data,
419 },
420 .resource = tmu8_resources,
421 .num_resources = ARRAY_SIZE(tmu8_resources),
422};
423
424static struct platform_device *sh7734_devices[] __initdata = {
425 &scif0_device,
426 &scif1_device,
427 &scif2_device,
428 &scif3_device,
429 &scif4_device,
430 &scif5_device,
431 &tmu0_device,
432 &tmu1_device,
433 &tmu2_device,
434 &tmu3_device,
435 &tmu4_device,
436 &tmu5_device,
437 &tmu6_device,
438 &tmu7_device,
439 &tmu8_device,
440 &rtc_device,
441};
442
443static struct platform_device *sh7734_early_devices[] __initdata = {
444 &scif0_device,
445 &scif1_device,
446 &scif2_device,
447 &scif3_device,
448 &scif4_device,
449 &scif5_device,
450 &tmu0_device,
451 &tmu1_device,
452 &tmu2_device,
453 &tmu3_device,
454 &tmu4_device,
455 &tmu5_device,
456 &tmu6_device,
457 &tmu7_device,
458 &tmu8_device,
459};
460
461void __init plat_early_device_setup(void)
462{
463 early_platform_add_devices(sh7734_early_devices,
464 ARRAY_SIZE(sh7734_early_devices));
465}
466
467#define GROUP 0
468enum {
469 UNUSED = 0,
470
471 /* interrupt sources */
472
473 IRL0_LLLL, IRL0_LLLH, IRL0_LLHL, IRL0_LLHH,
474 IRL0_LHLL, IRL0_LHLH, IRL0_LHHL, IRL0_LHHH,
475 IRL0_HLLL, IRL0_HLLH, IRL0_HLHL, IRL0_HLHH,
476 IRL0_HHLL, IRL0_HHLH, IRL0_HHHL,
477
478 IRQ0, IRQ1, IRQ2, IRQ3,
479 DU,
480 TMU00, TMU10, TMU20, TMU21,
481 TMU30, TMU40, TMU50, TMU51,
482 TMU60, TMU70, TMU80,
483 RESET_WDT,
484 USB,
485 HUDI,
486 SHDMAC,
487 SSI0, SSI1, SSI2, SSI3,
488 VIN0,
489 RGPVG,
490 _2DG,
491 MMC,
492 HSPI,
493 LBSCATA,
494 I2C0,
495 RCAN0,
496 MIMLB,
497 SCIF0, SCIF1, SCIF2, SCIF3, SCIF4, SCIF5,
498 LBSCDMAC0, LBSCDMAC1, LBSCDMAC2,
499 RCAN1,
500 SDHI0, SDHI1,
501 IEBUS,
502 HPBDMAC0_3, HPBDMAC4_10, HPBDMAC11_18, HPBDMAC19_22, HPBDMAC23_25_27_28,
503 RTC,
504 VIN1,
505 LCDC,
506 SRC0, SRC1,
507 GETHER,
508 SDHI2,
509 GPIO0_3, GPIO4_5,
510 STIF0, STIF1,
511 ADMAC,
512 HIF,
513 FLCTL,
514 ADC,
515 MTU2,
516 RSPI,
517 QSPI,
518 HSCIF,
519 VEU3F_VE3,
520
521 /* Group */
522 /* Mask */
523 STIF_M,
524 GPIO_M,
525 HPBDMAC_M,
526 LBSCDMAC_M,
527 RCAN_M,
528 SRC_M,
529 SCIF_M,
530 LCDC_M,
531 _2DG_M,
532 VIN_M,
533 TMU_3_M,
534 TMU_0_M,
535
536 /* Priority */
537 RCAN_P,
538 LBSCDMAC_P,
539
540 /* Common */
541 SDHI,
542 SSI,
543 SPI,
544};
545
546static struct intc_vect vectors[] __initdata = {
547 INTC_VECT(DU, 0x3E0),
548 INTC_VECT(TMU00, 0x400),
549 INTC_VECT(TMU10, 0x420),
550 INTC_VECT(TMU20, 0x440),
551 INTC_VECT(TMU30, 0x480),
552 INTC_VECT(TMU40, 0x4A0),
553 INTC_VECT(TMU50, 0x4C0),
554 INTC_VECT(TMU51, 0x4E0),
555 INTC_VECT(TMU60, 0x500),
556 INTC_VECT(TMU70, 0x520),
557 INTC_VECT(TMU80, 0x540),
558 INTC_VECT(RESET_WDT, 0x560),
559 INTC_VECT(USB, 0x580),
560 INTC_VECT(HUDI, 0x600),
561 INTC_VECT(SHDMAC, 0x620),
562 INTC_VECT(SSI0, 0x6C0),
563 INTC_VECT(SSI1, 0x6E0),
564 INTC_VECT(SSI2, 0x700),
565 INTC_VECT(SSI3, 0x720),
566 INTC_VECT(VIN0, 0x740),
567 INTC_VECT(RGPVG, 0x760),
568 INTC_VECT(_2DG, 0x780),
569 INTC_VECT(MMC, 0x7A0),
570 INTC_VECT(HSPI, 0x7E0),
571 INTC_VECT(LBSCATA, 0x840),
572 INTC_VECT(I2C0, 0x860),
573 INTC_VECT(RCAN0, 0x880),
574 INTC_VECT(SCIF0, 0x8A0),
575 INTC_VECT(SCIF1, 0x8C0),
576 INTC_VECT(SCIF2, 0x900),
577 INTC_VECT(SCIF3, 0x920),
578 INTC_VECT(SCIF4, 0x940),
579 INTC_VECT(SCIF5, 0x960),
580 INTC_VECT(LBSCDMAC0, 0x9E0),
581 INTC_VECT(LBSCDMAC1, 0xA00),
582 INTC_VECT(LBSCDMAC2, 0xA20),
583 INTC_VECT(RCAN1, 0xA60),
584 INTC_VECT(SDHI0, 0xAE0),
585 INTC_VECT(SDHI1, 0xB00),
586 INTC_VECT(IEBUS, 0xB20),
587 INTC_VECT(HPBDMAC0_3, 0xB60),
588 INTC_VECT(HPBDMAC4_10, 0xB80),
589 INTC_VECT(HPBDMAC11_18, 0xBA0),
590 INTC_VECT(HPBDMAC19_22, 0xBC0),
591 INTC_VECT(HPBDMAC23_25_27_28, 0xBE0),
592 INTC_VECT(RTC, 0xC00),
593 INTC_VECT(VIN1, 0xC20),
594 INTC_VECT(LCDC, 0xC40),
595 INTC_VECT(SRC0, 0xC60),
596 INTC_VECT(SRC1, 0xC80),
597 INTC_VECT(GETHER, 0xCA0),
598 INTC_VECT(SDHI2, 0xCC0),
599 INTC_VECT(GPIO0_3, 0xCE0),
600 INTC_VECT(GPIO4_5, 0xD00),
601 INTC_VECT(STIF0, 0xD20),
602 INTC_VECT(STIF1, 0xD40),
603 INTC_VECT(ADMAC, 0xDA0),
604 INTC_VECT(HIF, 0xDC0),
605 INTC_VECT(FLCTL, 0xDE0),
606 INTC_VECT(ADC, 0xE00),
607 INTC_VECT(MTU2, 0xE20),
608 INTC_VECT(RSPI, 0xE40),
609 INTC_VECT(QSPI, 0xE60),
610 INTC_VECT(HSCIF, 0xFC0),
611 INTC_VECT(VEU3F_VE3, 0xF40),
612};
613
614static struct intc_group groups[] __initdata = {
615 /* Common */
616 INTC_GROUP(SDHI, SDHI0, SDHI1, SDHI2),
617 INTC_GROUP(SPI, HSPI, RSPI, QSPI),
618 INTC_GROUP(SSI, SSI0, SSI1, SSI2, SSI3),
619
620 /* Mask group */
621 INTC_GROUP(STIF_M, STIF0, STIF1), /* 22 */
622 INTC_GROUP(GPIO_M, GPIO0_3, GPIO4_5), /* 21 */
623 INTC_GROUP(HPBDMAC_M, HPBDMAC0_3, HPBDMAC4_10, HPBDMAC11_18,
624 HPBDMAC19_22, HPBDMAC23_25_27_28), /* 19 */
625 INTC_GROUP(LBSCDMAC_M, LBSCDMAC0, LBSCDMAC1, LBSCDMAC2), /* 18 */
626 INTC_GROUP(RCAN_M, RCAN0, RCAN1, IEBUS), /* 17 */
627 INTC_GROUP(SRC_M, SRC0, SRC1), /* 16 */
628 INTC_GROUP(SCIF_M, SCIF0, SCIF1, SCIF2, SCIF3, SCIF4, SCIF5,
629 HSCIF), /* 14 */
630 INTC_GROUP(LCDC_M, LCDC, MIMLB), /* 13 */
631 INTC_GROUP(_2DG_M, _2DG, RGPVG), /* 12 */
632 INTC_GROUP(VIN_M, VIN0, VIN1), /* 10 */
633 INTC_GROUP(TMU_3_M, TMU30, TMU40, TMU50, TMU51,
634 TMU60, TMU60, TMU70, TMU80), /* 2 */
635 INTC_GROUP(TMU_0_M, TMU00, TMU10, TMU20, TMU21), /* 1 */
636
637 /* Priority group*/
638 INTC_GROUP(RCAN_P, RCAN0, RCAN1), /* INT2PRI5 */
639 INTC_GROUP(LBSCDMAC_P, LBSCDMAC0, LBSCDMAC1), /* INT2PRI5 */
640};
641
642static struct intc_mask_reg mask_registers[] __initdata = {
643 { 0xFF804040, 0xFF804044, 32, /* INT2MSKRG / INT2MSKCR */
644 { 0,
645 VEU3F_VE3,
646 SDHI, /* SDHI 0-2 */
647 ADMAC,
648 FLCTL,
649 RESET_WDT,
650 HIF,
651 ADC,
652 MTU2,
653 STIF_M, /* STIF 0,1 */
654 GPIO_M, /* GPIO 0-5*/
655 GETHER,
656 HPBDMAC_M, /* HPBDMAC 0_3 - 23_25_27_28 */
657 LBSCDMAC_M, /* LBSCDMAC 0 - 2 */
658 RCAN_M, /* RCAN, IEBUS */
659 SRC_M, /* SRC 0,1 */
660 LBSCATA,
661 SCIF_M, /* SCIF 0-5, HSCIF */
662 LCDC_M, /* LCDC, MIMLB */
663 _2DG_M, /* 2DG, RGPVG */
664 SPI, /* HSPI, RSPI, QSPI */
665 VIN_M, /* VIN0, 1 */
666 SSI, /* SSI 0-3 */
667 USB,
668 SHDMAC,
669 HUDI,
670 MMC,
671 RTC,
672 I2C0, /* I2C */ /* I2C 0, 1*/
673 TMU_3_M, /* TMU30 - TMU80 */
674 TMU_0_M, /* TMU00 - TMU21 */
675 DU } },
676};
677
678static struct intc_prio_reg prio_registers[] __initdata = {
679 { 0xFF804000, 0, 32, 8, /* INT2PRI0 */
680 { DU, TMU00, TMU10, TMU20 } },
681 { 0xFF804004, 0, 32, 8, /* INT2PRI1 */
682 { TMU30, TMU60, RTC, SDHI } },
683 { 0xFF804008, 0, 32, 8, /* INT2PRI2 */
684 { HUDI, SHDMAC, USB, SSI } },
685 { 0xFF80400C, 0, 32, 8, /* INT2PRI3 */
686 { VIN0, SPI, _2DG, LBSCATA } },
687 { 0xFF804010, 0, 32, 8, /* INT2PRI4 */
688 { SCIF0, SCIF3, HSCIF, LCDC } },
689 { 0xFF804014, 0, 32, 8, /* INT2PRI5 */
690 { RCAN_P, LBSCDMAC_P, LBSCDMAC2, MMC } },
691 { 0xFF804018, 0, 32, 8, /* INT2PRI6 */
692 { HPBDMAC0_3, HPBDMAC4_10, HPBDMAC11_18, HPBDMAC19_22 } },
693 { 0xFF80401C, 0, 32, 8, /* INT2PRI7 */
694 { HPBDMAC23_25_27_28, I2C0, SRC0, SRC1 } },
695 { 0xFF804020, 0, 32, 8, /* INT2PRI8 */
696 { 0 /* ADIF */, VIN1, RESET_WDT, HIF } },
697 { 0xFF804024, 0, 32, 8, /* INT2PRI9 */
698 { ADMAC, FLCTL, GPIO0_3, GPIO4_5 } },
699 { 0xFF804028, 0, 32, 8, /* INT2PRI10 */
700 { STIF0, STIF1, VEU3F_VE3, GETHER } },
701 { 0xFF80402C, 0, 32, 8, /* INT2PRI11 */
702 { MTU2, RGPVG, MIMLB, IEBUS } },
703};
704
705static DECLARE_INTC_DESC(intc_desc, "sh7734", vectors, groups,
706 mask_registers, prio_registers, NULL);
707
708/* Support for external interrupt pins in IRQ mode */
709
710static struct intc_vect irq3210_vectors[] __initdata = {
711 INTC_VECT(IRQ0, 0x240), INTC_VECT(IRQ1, 0x280),
712 INTC_VECT(IRQ2, 0x2C0), INTC_VECT(IRQ3, 0x300),
713};
714
715static struct intc_sense_reg irq3210_sense_registers[] __initdata = {
716 { 0xFF80201C, 32, 2, /* ICR1 */
717 { IRQ0, IRQ1, IRQ2, IRQ3, } },
718};
719
720static struct intc_mask_reg irq3210_ack_registers[] __initdata = {
721 { 0xFF802024, 0, 32, /* INTREQ */
722 { IRQ0, IRQ1, IRQ2, IRQ3, } },
723};
724
725static struct intc_mask_reg irq3210_mask_registers[] __initdata = {
726 { 0xFF802044, 0xFF802064, 32, /* INTMSK0 / INTMSKCLR0 */
727 { IRQ0, IRQ1, IRQ2, IRQ3, } },
728};
729
730static struct intc_prio_reg irq3210_prio_registers[] __initdata = {
731 { 0xFF802010, 0, 32, 4, /* INTPRI */
732 { IRQ0, IRQ1, IRQ2, IRQ3, } },
733};
734
735static DECLARE_INTC_DESC_ACK(intc_desc_irq3210, "sh7734-irq3210",
736 irq3210_vectors, NULL,
737 irq3210_mask_registers, irq3210_prio_registers,
738 irq3210_sense_registers, irq3210_ack_registers);
739
740/* External interrupt pins in IRL mode */
741
742static struct intc_vect vectors_irl3210[] __initdata = {
743 INTC_VECT(IRL0_LLLL, 0x200), INTC_VECT(IRL0_LLLH, 0x220),
744 INTC_VECT(IRL0_LLHL, 0x240), INTC_VECT(IRL0_LLHH, 0x260),
745 INTC_VECT(IRL0_LHLL, 0x280), INTC_VECT(IRL0_LHLH, 0x2a0),
746 INTC_VECT(IRL0_LHHL, 0x2c0), INTC_VECT(IRL0_LHHH, 0x2e0),
747 INTC_VECT(IRL0_HLLL, 0x300), INTC_VECT(IRL0_HLLH, 0x320),
748 INTC_VECT(IRL0_HLHL, 0x340), INTC_VECT(IRL0_HLHH, 0x360),
749 INTC_VECT(IRL0_HHLL, 0x380), INTC_VECT(IRL0_HHLH, 0x3a0),
750 INTC_VECT(IRL0_HHHL, 0x3c0),
751};
752
753static DECLARE_INTC_DESC(intc_desc_irl3210, "sh7734-irl3210",
754 vectors_irl3210, NULL, mask_registers, NULL, NULL);
755
756#define INTC_ICR0 0xFF802000
757#define INTC_INTMSK0 0xFF802044
758#define INTC_INTMSK1 0xFF802048
759#define INTC_INTMSKCLR0 0xFF802064
760#define INTC_INTMSKCLR1 0xFF802068
761
762void __init plat_irq_setup(void)
763{
764 /* disable IRQ3-0 */
765 __raw_writel(0xF0000000, INTC_INTMSK0);
766
767 /* disable IRL3-0 */
768 __raw_writel(0x80000000, INTC_INTMSK1);
769
770 /* select IRL mode for IRL3-0 */
771 __raw_writel(__raw_readl(INTC_ICR0) & ~0x00800000, INTC_ICR0);
772
773 /* disable holding function, ie enable "SH-4 Mode (LVLMODE)" */
774 __raw_writel(__raw_readl(INTC_ICR0) | 0x00200000, INTC_ICR0);
775
776 register_intc_controller(&intc_desc);
777}
778
779void __init plat_irq_setup_pins(int mode)
780{
781 switch (mode) {
782 case IRQ_MODE_IRQ3210:
783 /* select IRQ mode for IRL3-0 */
784 __raw_writel(__raw_readl(INTC_ICR0) | 0x00800000, INTC_ICR0);
785 register_intc_controller(&intc_desc_irq3210);
786 break;
787 case IRQ_MODE_IRL3210:
788 /* enable IRL0-3 but don't provide any masking */
789 __raw_writel(0x80000000, INTC_INTMSKCLR1);
790 __raw_writel(0xf0000000, INTC_INTMSKCLR0);
791 break;
792 case IRQ_MODE_IRL3210_MASK:
793 /* enable IRL0-3 and mask using cpu intc controller */
794 __raw_writel(0x80000000, INTC_INTMSKCLR0);
795 register_intc_controller(&intc_desc_irl3210);
796 break;
797 default:
798 BUG();
799 }
800}
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
index 9079a0f9ea9..05559295d2c 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
@@ -18,8 +18,7 @@
18#include <linux/dma-mapping.h> 18#include <linux/dma-mapping.h>
19#include <linux/sh_timer.h> 19#include <linux/sh_timer.h>
20#include <linux/sh_dma.h> 20#include <linux/sh_dma.h>
21#include <linux/sh_intc.h> 21
22#include <linux/usb/ohci_pdriver.h>
23#include <cpu/dma-register.h> 22#include <cpu/dma-register.h>
24#include <cpu/sh7757.h> 23#include <cpu/sh7757.h>
25 24
@@ -29,7 +28,7 @@ static struct plat_sci_port scif2_platform_data = {
29 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 28 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
30 .scbrr_algo_id = SCBRR_ALGO_2, 29 .scbrr_algo_id = SCBRR_ALGO_2,
31 .type = PORT_SCIF, 30 .type = PORT_SCIF,
32 .irqs = SCIx_IRQ_MUXED(evt2irq(0x700)), 31 .irqs = { 40, 40, 40, 40 },
33}; 32};
34 33
35static struct platform_device scif2_device = { 34static struct platform_device scif2_device = {
@@ -46,7 +45,7 @@ static struct plat_sci_port scif3_platform_data = {
46 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 45 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
47 .scbrr_algo_id = SCBRR_ALGO_2, 46 .scbrr_algo_id = SCBRR_ALGO_2,
48 .type = PORT_SCIF, 47 .type = PORT_SCIF,
49 .irqs = SCIx_IRQ_MUXED(evt2irq(0xb80)), 48 .irqs = { 76, 76, 76, 76 },
50}; 49};
51 50
52static struct platform_device scif3_device = { 51static struct platform_device scif3_device = {
@@ -63,7 +62,7 @@ static struct plat_sci_port scif4_platform_data = {
63 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 62 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
64 .scbrr_algo_id = SCBRR_ALGO_2, 63 .scbrr_algo_id = SCBRR_ALGO_2,
65 .type = PORT_SCIF, 64 .type = PORT_SCIF,
66 .irqs = SCIx_IRQ_MUXED(evt2irq(0xF00)), 65 .irqs = { 104, 104, 104, 104 },
67}; 66};
68 67
69static struct platform_device scif4_device = { 68static struct platform_device scif4_device = {
@@ -87,7 +86,7 @@ static struct resource tmu0_resources[] = {
87 .flags = IORESOURCE_MEM, 86 .flags = IORESOURCE_MEM,
88 }, 87 },
89 [1] = { 88 [1] = {
90 .start = evt2irq(0x580), 89 .start = 28,
91 .flags = IORESOURCE_IRQ, 90 .flags = IORESOURCE_IRQ,
92 }, 91 },
93}; 92};
@@ -115,7 +114,7 @@ static struct resource tmu1_resources[] = {
115 .flags = IORESOURCE_MEM, 114 .flags = IORESOURCE_MEM,
116 }, 115 },
117 [1] = { 116 [1] = {
118 .start = evt2irq(0x5a0), 117 .start = 29,
119 .flags = IORESOURCE_IRQ, 118 .flags = IORESOURCE_IRQ,
120 }, 119 },
121}; 120};
@@ -134,10 +133,10 @@ static struct resource spi0_resources[] = {
134 [0] = { 133 [0] = {
135 .start = 0xfe002000, 134 .start = 0xfe002000,
136 .end = 0xfe0020ff, 135 .end = 0xfe0020ff,
137 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT, 136 .flags = IORESOURCE_MEM,
138 }, 137 },
139 [1] = { 138 [1] = {
140 .start = evt2irq(0xcc0), 139 .start = 86,
141 .flags = IORESOURCE_IRQ, 140 .flags = IORESOURCE_IRQ,
142 }, 141 },
143}; 142};
@@ -217,20 +216,6 @@ static const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = {
217 TS_INDEX2VAL(XMIT_SZ_8BIT), 216 TS_INDEX2VAL(XMIT_SZ_8BIT),
218 .mid_rid = 0x42, 217 .mid_rid = 0x42,
219 }, 218 },
220 {
221 .slave_id = SHDMA_SLAVE_RSPI_TX,
222 .addr = 0xfe480004,
223 .chcr = SM_INC | 0x800 | 0x40000000 |
224 TS_INDEX2VAL(XMIT_SZ_16BIT),
225 .mid_rid = 0xc1,
226 },
227 {
228 .slave_id = SHDMA_SLAVE_RSPI_RX,
229 .addr = 0xfe480004,
230 .chcr = DM_INC | 0x800 | 0x40000000 |
231 TS_INDEX2VAL(XMIT_SZ_16BIT),
232 .mid_rid = 0xc2,
233 },
234}; 219};
235 220
236static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = { 221static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
@@ -480,9 +465,8 @@ static struct resource sh7757_dmae0_resources[] = {
480 .flags = IORESOURCE_MEM, 465 .flags = IORESOURCE_MEM,
481 }, 466 },
482 { 467 {
483 .name = "error_irq", 468 .start = 34,
484 .start = evt2irq(0x640), 469 .end = 34,
485 .end = evt2irq(0x640),
486 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 470 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
487 }, 471 },
488}; 472};
@@ -502,57 +486,57 @@ static struct resource sh7757_dmae1_resources[] = {
502 .flags = IORESOURCE_MEM, 486 .flags = IORESOURCE_MEM,
503 }, 487 },
504 { 488 {
505 .name = "error_irq", 489 /* DMA error */
506 .start = evt2irq(0x640), 490 .start = 34,
507 .end = evt2irq(0x640), 491 .end = 34,
508 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 492 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
509 }, 493 },
510 { 494 {
511 /* IRQ for channels 4 */ 495 /* IRQ for channels 4 */
512 .start = evt2irq(0x7c0), 496 .start = 46,
513 .end = evt2irq(0x7c0), 497 .end = 46,
514 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 498 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
515 }, 499 },
516 { 500 {
517 /* IRQ for channels 5 */ 501 /* IRQ for channels 5 */
518 .start = evt2irq(0x7c0), 502 .start = 46,
519 .end = evt2irq(0x7c0), 503 .end = 46,
520 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 504 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
521 }, 505 },
522 { 506 {
523 /* IRQ for channels 6 */ 507 /* IRQ for channels 6 */
524 .start = evt2irq(0xd00), 508 .start = 88,
525 .end = evt2irq(0xd00), 509 .end = 88,
526 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 510 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
527 }, 511 },
528 { 512 {
529 /* IRQ for channels 7 */ 513 /* IRQ for channels 7 */
530 .start = evt2irq(0xd00), 514 .start = 88,
531 .end = evt2irq(0xd00), 515 .end = 88,
532 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 516 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
533 }, 517 },
534 { 518 {
535 /* IRQ for channels 8 */ 519 /* IRQ for channels 8 */
536 .start = evt2irq(0xd00), 520 .start = 88,
537 .end = evt2irq(0xd00), 521 .end = 88,
538 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 522 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
539 }, 523 },
540 { 524 {
541 /* IRQ for channels 9 */ 525 /* IRQ for channels 9 */
542 .start = evt2irq(0xd00), 526 .start = 88,
543 .end = evt2irq(0xd00), 527 .end = 88,
544 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 528 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
545 }, 529 },
546 { 530 {
547 /* IRQ for channels 10 */ 531 /* IRQ for channels 10 */
548 .start = evt2irq(0xd00), 532 .start = 88,
549 .end = evt2irq(0xd00), 533 .end = 88,
550 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 534 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
551 }, 535 },
552 { 536 {
553 /* IRQ for channels 11 */ 537 /* IRQ for channels 11 */
554 .start = evt2irq(0xd00), 538 .start = 88,
555 .end = evt2irq(0xd00), 539 .end = 88,
556 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 540 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
557 }, 541 },
558}; 542};
@@ -572,21 +556,21 @@ static struct resource sh7757_dmae2_resources[] = {
572 .flags = IORESOURCE_MEM, 556 .flags = IORESOURCE_MEM,
573 }, 557 },
574 { 558 {
575 .name = "error_irq", 559 /* DMA error */
576 .start = evt2irq(0x2a60), 560 .start = 323,
577 .end = evt2irq(0x2a60), 561 .end = 323,
578 .flags = IORESOURCE_IRQ, 562 .flags = IORESOURCE_IRQ,
579 }, 563 },
580 { 564 {
581 /* IRQ for channels 12 to 16 */ 565 /* IRQ for channels 12 to 16 */
582 .start = evt2irq(0x2400), 566 .start = 272,
583 .end = evt2irq(0x2480), 567 .end = 276,
584 .flags = IORESOURCE_IRQ, 568 .flags = IORESOURCE_IRQ,
585 }, 569 },
586 { 570 {
587 /* IRQ for channel 17 */ 571 /* IRQ for channel 17 */
588 .start = evt2irq(0x24e0), 572 .start = 279,
589 .end = evt2irq(0x24e0), 573 .end = 279,
590 .flags = IORESOURCE_IRQ, 574 .flags = IORESOURCE_IRQ,
591 }, 575 },
592}; 576};
@@ -606,21 +590,21 @@ static struct resource sh7757_dmae3_resources[] = {
606 .flags = IORESOURCE_MEM, 590 .flags = IORESOURCE_MEM,
607 }, 591 },
608 { 592 {
609 .name = "error_irq", 593 /* DMA error */
610 .start = evt2irq(0x2a80), 594 .start = 324,
611 .end = evt2irq(0x2a80), 595 .end = 324,
612 .flags = IORESOURCE_IRQ, 596 .flags = IORESOURCE_IRQ,
613 }, 597 },
614 { 598 {
615 /* IRQ for channels 18 to 22 */ 599 /* IRQ for channels 18 to 22 */
616 .start = evt2irq(0x2500), 600 .start = 280,
617 .end = evt2irq(0x2580), 601 .end = 284,
618 .flags = IORESOURCE_IRQ, 602 .flags = IORESOURCE_IRQ,
619 }, 603 },
620 { 604 {
621 /* IRQ for channel 23 */ 605 /* IRQ for channel 23 */
622 .start = evt2irq(0x2600), 606 .start = 288,
623 .end = evt2irq(0x2600), 607 .end = 288,
624 .flags = IORESOURCE_IRQ, 608 .flags = IORESOURCE_IRQ,
625 }, 609 },
626}; 610};
@@ -676,44 +660,6 @@ static struct platform_device spi0_device = {
676 .resource = spi0_resources, 660 .resource = spi0_resources,
677}; 661};
678 662
679static struct resource spi1_resources[] = {
680 {
681 .start = 0xffd8ee70,
682 .end = 0xffd8eeff,
683 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
684 },
685 {
686 .start = evt2irq(0x8c0),
687 .flags = IORESOURCE_IRQ,
688 },
689};
690
691static struct platform_device spi1_device = {
692 .name = "sh_spi",
693 .id = 1,
694 .num_resources = ARRAY_SIZE(spi1_resources),
695 .resource = spi1_resources,
696};
697
698static struct resource rspi_resources[] = {
699 {
700 .start = 0xfe480000,
701 .end = 0xfe4800ff,
702 .flags = IORESOURCE_MEM,
703 },
704 {
705 .start = evt2irq(0x1d80),
706 .flags = IORESOURCE_IRQ,
707 },
708};
709
710static struct platform_device rspi_device = {
711 .name = "rspi",
712 .id = 2,
713 .num_resources = ARRAY_SIZE(rspi_resources),
714 .resource = rspi_resources,
715};
716
717static struct resource usb_ehci_resources[] = { 663static struct resource usb_ehci_resources[] = {
718 [0] = { 664 [0] = {
719 .start = 0xfe4f1000, 665 .start = 0xfe4f1000,
@@ -721,8 +667,8 @@ static struct resource usb_ehci_resources[] = {
721 .flags = IORESOURCE_MEM, 667 .flags = IORESOURCE_MEM,
722 }, 668 },
723 [1] = { 669 [1] = {
724 .start = evt2irq(0x920), 670 .start = 57,
725 .end = evt2irq(0x920), 671 .end = 57,
726 .flags = IORESOURCE_IRQ, 672 .flags = IORESOURCE_IRQ,
727 }, 673 },
728}; 674};
@@ -745,21 +691,18 @@ static struct resource usb_ohci_resources[] = {
745 .flags = IORESOURCE_MEM, 691 .flags = IORESOURCE_MEM,
746 }, 692 },
747 [1] = { 693 [1] = {
748 .start = evt2irq(0x920), 694 .start = 57,
749 .end = evt2irq(0x920), 695 .end = 57,
750 .flags = IORESOURCE_IRQ, 696 .flags = IORESOURCE_IRQ,
751 }, 697 },
752}; 698};
753 699
754static struct usb_ohci_pdata usb_ohci_pdata;
755
756static struct platform_device usb_ohci_device = { 700static struct platform_device usb_ohci_device = {
757 .name = "ohci-platform", 701 .name = "sh_ohci",
758 .id = -1, 702 .id = -1,
759 .dev = { 703 .dev = {
760 .dma_mask = &usb_ohci_device.dev.coherent_dma_mask, 704 .dma_mask = &usb_ohci_device.dev.coherent_dma_mask,
761 .coherent_dma_mask = DMA_BIT_MASK(32), 705 .coherent_dma_mask = DMA_BIT_MASK(32),
762 .platform_data = &usb_ohci_pdata,
763 }, 706 },
764 .num_resources = ARRAY_SIZE(usb_ohci_resources), 707 .num_resources = ARRAY_SIZE(usb_ohci_resources),
765 .resource = usb_ohci_resources, 708 .resource = usb_ohci_resources,
@@ -776,8 +719,6 @@ static struct platform_device *sh7757_devices[] __initdata = {
776 &dma2_device, 719 &dma2_device,
777 &dma3_device, 720 &dma3_device,
778 &spi0_device, 721 &spi0_device,
779 &spi1_device,
780 &rspi_device,
781 &usb_ehci_device, 722 &usb_ehci_device,
782 &usb_ohci_device, 723 &usb_ohci_device,
783}; 724};
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
index 1686acaaf45..00113515f23 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
@@ -13,10 +13,8 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/serial.h> 14#include <linux/serial.h>
15#include <linux/sh_timer.h> 15#include <linux/sh_timer.h>
16#include <linux/sh_intc.h>
17#include <linux/io.h> 16#include <linux/io.h>
18#include <linux/serial_sci.h> 17#include <linux/serial_sci.h>
19#include <linux/usb/ohci_pdriver.h>
20 18
21static struct plat_sci_port scif0_platform_data = { 19static struct plat_sci_port scif0_platform_data = {
22 .mapbase = 0xffe00000, 20 .mapbase = 0xffe00000,
@@ -24,7 +22,7 @@ static struct plat_sci_port scif0_platform_data = {
24 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 22 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
25 .scbrr_algo_id = SCBRR_ALGO_2, 23 .scbrr_algo_id = SCBRR_ALGO_2,
26 .type = PORT_SCIF, 24 .type = PORT_SCIF,
27 .irqs = SCIx_IRQ_MUXED(evt2irq(0x700)), 25 .irqs = { 40, 40, 40, 40 },
28 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 26 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
29}; 27};
30 28
@@ -42,7 +40,7 @@ static struct plat_sci_port scif1_platform_data = {
42 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 40 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
43 .scbrr_algo_id = SCBRR_ALGO_2, 41 .scbrr_algo_id = SCBRR_ALGO_2,
44 .type = PORT_SCIF, 42 .type = PORT_SCIF,
45 .irqs = SCIx_IRQ_MUXED(evt2irq(0xb80)), 43 .irqs = { 76, 76, 76, 76 },
46 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 44 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
47}; 45};
48 46
@@ -60,7 +58,7 @@ static struct plat_sci_port scif2_platform_data = {
60 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 58 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
61 .scbrr_algo_id = SCBRR_ALGO_2, 59 .scbrr_algo_id = SCBRR_ALGO_2,
62 .type = PORT_SCIF, 60 .type = PORT_SCIF,
63 .irqs = SCIx_IRQ_MUXED(evt2irq(0xf00)), 61 .irqs = { 104, 104, 104, 104 },
64 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 62 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
65}; 63};
66 64
@@ -80,7 +78,7 @@ static struct resource rtc_resources[] = {
80 }, 78 },
81 [1] = { 79 [1] = {
82 /* Shared Period/Carry/Alarm IRQ */ 80 /* Shared Period/Carry/Alarm IRQ */
83 .start = evt2irq(0x480), 81 .start = 20,
84 .flags = IORESOURCE_IRQ, 82 .flags = IORESOURCE_IRQ,
85 }, 83 },
86}; 84};
@@ -99,23 +97,19 @@ static struct resource usb_ohci_resources[] = {
99 .flags = IORESOURCE_MEM, 97 .flags = IORESOURCE_MEM,
100 }, 98 },
101 [1] = { 99 [1] = {
102 .start = evt2irq(0xc60), 100 .start = 83,
103 .end = evt2irq(0xc60), 101 .end = 83,
104 .flags = IORESOURCE_IRQ, 102 .flags = IORESOURCE_IRQ,
105 }, 103 },
106}; 104};
107 105
108static u64 usb_ohci_dma_mask = 0xffffffffUL; 106static u64 usb_ohci_dma_mask = 0xffffffffUL;
109
110static struct usb_ohci_pdata usb_ohci_pdata;
111
112static struct platform_device usb_ohci_device = { 107static struct platform_device usb_ohci_device = {
113 .name = "ohci-platform", 108 .name = "sh_ohci",
114 .id = -1, 109 .id = -1,
115 .dev = { 110 .dev = {
116 .dma_mask = &usb_ohci_dma_mask, 111 .dma_mask = &usb_ohci_dma_mask,
117 .coherent_dma_mask = 0xffffffff, 112 .coherent_dma_mask = 0xffffffff,
118 .platform_data = &usb_ohci_pdata,
119 }, 113 },
120 .num_resources = ARRAY_SIZE(usb_ohci_resources), 114 .num_resources = ARRAY_SIZE(usb_ohci_resources),
121 .resource = usb_ohci_resources, 115 .resource = usb_ohci_resources,
@@ -128,8 +122,8 @@ static struct resource usbf_resources[] = {
128 .flags = IORESOURCE_MEM, 122 .flags = IORESOURCE_MEM,
129 }, 123 },
130 [1] = { 124 [1] = {
131 .start = evt2irq(0xc80), 125 .start = 84,
132 .end = evt2irq(0xc80), 126 .end = 84,
133 .flags = IORESOURCE_IRQ, 127 .flags = IORESOURCE_IRQ,
134 }, 128 },
135}; 129};
@@ -158,7 +152,7 @@ static struct resource tmu0_resources[] = {
158 .flags = IORESOURCE_MEM, 152 .flags = IORESOURCE_MEM,
159 }, 153 },
160 [1] = { 154 [1] = {
161 .start = evt2irq(0x580), 155 .start = 28,
162 .flags = IORESOURCE_IRQ, 156 .flags = IORESOURCE_IRQ,
163 }, 157 },
164}; 158};
@@ -186,7 +180,7 @@ static struct resource tmu1_resources[] = {
186 .flags = IORESOURCE_MEM, 180 .flags = IORESOURCE_MEM,
187 }, 181 },
188 [1] = { 182 [1] = {
189 .start = evt2irq(0x5a0), 183 .start = 29,
190 .flags = IORESOURCE_IRQ, 184 .flags = IORESOURCE_IRQ,
191 }, 185 },
192}; 186};
@@ -213,7 +207,7 @@ static struct resource tmu2_resources[] = {
213 .flags = IORESOURCE_MEM, 207 .flags = IORESOURCE_MEM,
214 }, 208 },
215 [1] = { 209 [1] = {
216 .start = evt2irq(0x5c0), 210 .start = 30,
217 .flags = IORESOURCE_IRQ, 211 .flags = IORESOURCE_IRQ,
218 }, 212 },
219}; 213};
@@ -240,7 +234,7 @@ static struct resource tmu3_resources[] = {
240 .flags = IORESOURCE_MEM, 234 .flags = IORESOURCE_MEM,
241 }, 235 },
242 [1] = { 236 [1] = {
243 .start = evt2irq(0xe00), 237 .start = 96,
244 .flags = IORESOURCE_IRQ, 238 .flags = IORESOURCE_IRQ,
245 }, 239 },
246}; 240};
@@ -267,7 +261,7 @@ static struct resource tmu4_resources[] = {
267 .flags = IORESOURCE_MEM, 261 .flags = IORESOURCE_MEM,
268 }, 262 },
269 [1] = { 263 [1] = {
270 .start = evt2irq(0xe20), 264 .start = 97,
271 .flags = IORESOURCE_IRQ, 265 .flags = IORESOURCE_IRQ,
272 }, 266 },
273}; 267};
@@ -294,7 +288,7 @@ static struct resource tmu5_resources[] = {
294 .flags = IORESOURCE_MEM, 288 .flags = IORESOURCE_MEM,
295 }, 289 },
296 [1] = { 290 [1] = {
297 .start = evt2irq(0xe40), 291 .start = 98,
298 .flags = IORESOURCE_IRQ, 292 .flags = IORESOURCE_IRQ,
299 }, 293 },
300}; 294};
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
index 256ea7a4516..2c6aa22cf5f 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
@@ -12,7 +12,6 @@
12#include <linux/serial.h> 12#include <linux/serial.h>
13#include <linux/serial_sci.h> 13#include <linux/serial_sci.h>
14#include <linux/sh_timer.h> 14#include <linux/sh_timer.h>
15#include <linux/sh_intc.h>
16#include <linux/io.h> 15#include <linux/io.h>
17 16
18static struct plat_sci_port scif0_platform_data = { 17static struct plat_sci_port scif0_platform_data = {
@@ -21,7 +20,7 @@ static struct plat_sci_port scif0_platform_data = {
21 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 20 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
22 .scbrr_algo_id = SCBRR_ALGO_2, 21 .scbrr_algo_id = SCBRR_ALGO_2,
23 .type = PORT_SCIF, 22 .type = PORT_SCIF,
24 .irqs = SCIx_IRQ_MUXED(evt2irq(0x9a0)), 23 .irqs = { 61, 61, 61, 61 },
25}; 24};
26 25
27static struct platform_device scif0_device = { 26static struct platform_device scif0_device = {
@@ -38,7 +37,7 @@ static struct plat_sci_port scif1_platform_data = {
38 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 37 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
39 .scbrr_algo_id = SCBRR_ALGO_2, 38 .scbrr_algo_id = SCBRR_ALGO_2,
40 .type = PORT_SCIF, 39 .type = PORT_SCIF,
41 .irqs = SCIx_IRQ_MUXED(evt2irq(0x9c0)), 40 .irqs = { 62, 62, 62, 62 },
42}; 41};
43 42
44static struct platform_device scif1_device = { 43static struct platform_device scif1_device = {
@@ -55,7 +54,7 @@ static struct plat_sci_port scif2_platform_data = {
55 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 54 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
56 .scbrr_algo_id = SCBRR_ALGO_2, 55 .scbrr_algo_id = SCBRR_ALGO_2,
57 .type = PORT_SCIF, 56 .type = PORT_SCIF,
58 .irqs = SCIx_IRQ_MUXED(evt2irq(0x9e0)), 57 .irqs = { 63, 63, 63, 63 },
59}; 58};
60 59
61static struct platform_device scif2_device = { 60static struct platform_device scif2_device = {
@@ -72,7 +71,7 @@ static struct plat_sci_port scif3_platform_data = {
72 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 71 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
73 .scbrr_algo_id = SCBRR_ALGO_2, 72 .scbrr_algo_id = SCBRR_ALGO_2,
74 .type = PORT_SCIF, 73 .type = PORT_SCIF,
75 .irqs = SCIx_IRQ_MUXED(evt2irq(0xa00)), 74 .irqs = { 64, 64, 64, 64 },
76}; 75};
77 76
78static struct platform_device scif3_device = { 77static struct platform_device scif3_device = {
@@ -89,7 +88,7 @@ static struct plat_sci_port scif4_platform_data = {
89 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 88 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
90 .scbrr_algo_id = SCBRR_ALGO_2, 89 .scbrr_algo_id = SCBRR_ALGO_2,
91 .type = PORT_SCIF, 90 .type = PORT_SCIF,
92 .irqs = SCIx_IRQ_MUXED(evt2irq(0xa20)), 91 .irqs = { 65, 65, 65, 65 },
93}; 92};
94 93
95static struct platform_device scif4_device = { 94static struct platform_device scif4_device = {
@@ -106,7 +105,7 @@ static struct plat_sci_port scif5_platform_data = {
106 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 105 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
107 .scbrr_algo_id = SCBRR_ALGO_2, 106 .scbrr_algo_id = SCBRR_ALGO_2,
108 .type = PORT_SCIF, 107 .type = PORT_SCIF,
109 .irqs = SCIx_IRQ_MUXED(evt2irq(0xa40)), 108 .irqs = { 66, 66, 66, 66 },
110}; 109};
111 110
112static struct platform_device scif5_device = { 111static struct platform_device scif5_device = {
@@ -123,7 +122,7 @@ static struct plat_sci_port scif6_platform_data = {
123 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 122 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
124 .scbrr_algo_id = SCBRR_ALGO_2, 123 .scbrr_algo_id = SCBRR_ALGO_2,
125 .type = PORT_SCIF, 124 .type = PORT_SCIF,
126 .irqs = SCIx_IRQ_MUXED(evt2irq(0xa60)), 125 .irqs = { 67, 67, 67, 67 },
127}; 126};
128 127
129static struct platform_device scif6_device = { 128static struct platform_device scif6_device = {
@@ -140,7 +139,7 @@ static struct plat_sci_port scif7_platform_data = {
140 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 139 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
141 .scbrr_algo_id = SCBRR_ALGO_2, 140 .scbrr_algo_id = SCBRR_ALGO_2,
142 .type = PORT_SCIF, 141 .type = PORT_SCIF,
143 .irqs = SCIx_IRQ_MUXED(evt2irq(0xa80)), 142 .irqs = { 68, 68, 68, 68 },
144}; 143};
145 144
146static struct platform_device scif7_device = { 145static struct platform_device scif7_device = {
@@ -157,7 +156,7 @@ static struct plat_sci_port scif8_platform_data = {
157 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 156 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
158 .scbrr_algo_id = SCBRR_ALGO_2, 157 .scbrr_algo_id = SCBRR_ALGO_2,
159 .type = PORT_SCIF, 158 .type = PORT_SCIF,
160 .irqs = SCIx_IRQ_MUXED(evt2irq(0xaa0)), 159 .irqs = { 69, 69, 69, 69 },
161}; 160};
162 161
163static struct platform_device scif8_device = { 162static struct platform_device scif8_device = {
@@ -174,7 +173,7 @@ static struct plat_sci_port scif9_platform_data = {
174 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 173 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
175 .scbrr_algo_id = SCBRR_ALGO_2, 174 .scbrr_algo_id = SCBRR_ALGO_2,
176 .type = PORT_SCIF, 175 .type = PORT_SCIF,
177 .irqs = SCIx_IRQ_MUXED(evt2irq(0xac0)), 176 .irqs = { 70, 70, 70, 70 },
178}; 177};
179 178
180static struct platform_device scif9_device = { 179static struct platform_device scif9_device = {
@@ -198,7 +197,7 @@ static struct resource tmu0_resources[] = {
198 .flags = IORESOURCE_MEM, 197 .flags = IORESOURCE_MEM,
199 }, 198 },
200 [1] = { 199 [1] = {
201 .start = evt2irq(0x400), 200 .start = 16,
202 .flags = IORESOURCE_IRQ, 201 .flags = IORESOURCE_IRQ,
203 }, 202 },
204}; 203};
@@ -226,7 +225,7 @@ static struct resource tmu1_resources[] = {
226 .flags = IORESOURCE_MEM, 225 .flags = IORESOURCE_MEM,
227 }, 226 },
228 [1] = { 227 [1] = {
229 .start = evt2irq(0x420), 228 .start = 17,
230 .flags = IORESOURCE_IRQ, 229 .flags = IORESOURCE_IRQ,
231 }, 230 },
232}; 231};
@@ -253,7 +252,7 @@ static struct resource tmu2_resources[] = {
253 .flags = IORESOURCE_MEM, 252 .flags = IORESOURCE_MEM,
254 }, 253 },
255 [1] = { 254 [1] = {
256 .start = evt2irq(0x440), 255 .start = 18,
257 .flags = IORESOURCE_IRQ, 256 .flags = IORESOURCE_IRQ,
258 }, 257 },
259}; 258};
@@ -280,7 +279,7 @@ static struct resource tmu3_resources[] = {
280 .flags = IORESOURCE_MEM, 279 .flags = IORESOURCE_MEM,
281 }, 280 },
282 [1] = { 281 [1] = {
283 .start = evt2irq(0x460), 282 .start = 19,
284 .flags = IORESOURCE_IRQ, 283 .flags = IORESOURCE_IRQ,
285 }, 284 },
286}; 285};
@@ -307,7 +306,7 @@ static struct resource tmu4_resources[] = {
307 .flags = IORESOURCE_MEM, 306 .flags = IORESOURCE_MEM,
308 }, 307 },
309 [1] = { 308 [1] = {
310 .start = evt2irq(0x480), 309 .start = 20,
311 .flags = IORESOURCE_IRQ, 310 .flags = IORESOURCE_IRQ,
312 }, 311 },
313}; 312};
@@ -334,7 +333,7 @@ static struct resource tmu5_resources[] = {
334 .flags = IORESOURCE_MEM, 333 .flags = IORESOURCE_MEM,
335 }, 334 },
336 [1] = { 335 [1] = {
337 .start = evt2irq(0x4a0), 336 .start = 21,
338 .flags = IORESOURCE_IRQ, 337 .flags = IORESOURCE_IRQ,
339 }, 338 },
340}; 339};
@@ -361,7 +360,7 @@ static struct resource tmu6_resources[] = {
361 .flags = IORESOURCE_MEM, 360 .flags = IORESOURCE_MEM,
362 }, 361 },
363 [1] = { 362 [1] = {
364 .start = evt2irq(0x4c0), 363 .start = 22,
365 .flags = IORESOURCE_IRQ, 364 .flags = IORESOURCE_IRQ,
366 }, 365 },
367}; 366};
@@ -388,7 +387,7 @@ static struct resource tmu7_resources[] = {
388 .flags = IORESOURCE_MEM, 387 .flags = IORESOURCE_MEM,
389 }, 388 },
390 [1] = { 389 [1] = {
391 .start = evt2irq(0x4e0), 390 .start = 23,
392 .flags = IORESOURCE_IRQ, 391 .flags = IORESOURCE_IRQ,
393 }, 392 },
394}; 393};
@@ -415,7 +414,7 @@ static struct resource tmu8_resources[] = {
415 .flags = IORESOURCE_MEM, 414 .flags = IORESOURCE_MEM,
416 }, 415 },
417 [1] = { 416 [1] = {
418 .start = evt2irq(0x500), 417 .start = 24,
419 .flags = IORESOURCE_IRQ, 418 .flags = IORESOURCE_IRQ,
420 }, 419 },
421}; 420};
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
index de45b704687..3d4d2075c19 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
@@ -14,7 +14,6 @@
14#include <linux/serial_sci.h> 14#include <linux/serial_sci.h>
15#include <linux/sh_dma.h> 15#include <linux/sh_dma.h>
16#include <linux/sh_timer.h> 16#include <linux/sh_timer.h>
17#include <linux/sh_intc.h>
18#include <cpu/dma-register.h> 17#include <cpu/dma-register.h>
19 18
20static struct plat_sci_port scif0_platform_data = { 19static struct plat_sci_port scif0_platform_data = {
@@ -23,7 +22,7 @@ static struct plat_sci_port scif0_platform_data = {
23 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 22 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
24 .scbrr_algo_id = SCBRR_ALGO_1, 23 .scbrr_algo_id = SCBRR_ALGO_1,
25 .type = PORT_SCIF, 24 .type = PORT_SCIF,
26 .irqs = SCIx_IRQ_MUXED(evt2irq(0x700)), 25 .irqs = { 40, 40, 40, 40 },
27 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 26 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
28}; 27};
29 28
@@ -41,7 +40,7 @@ static struct plat_sci_port scif1_platform_data = {
41 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 40 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
42 .scbrr_algo_id = SCBRR_ALGO_1, 41 .scbrr_algo_id = SCBRR_ALGO_1,
43 .type = PORT_SCIF, 42 .type = PORT_SCIF,
44 .irqs = SCIx_IRQ_MUXED(evt2irq(0xb80)), 43 .irqs = { 76, 76, 76, 76 },
45 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 44 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
46}; 45};
47 46
@@ -66,7 +65,7 @@ static struct resource tmu0_resources[] = {
66 .flags = IORESOURCE_MEM, 65 .flags = IORESOURCE_MEM,
67 }, 66 },
68 [1] = { 67 [1] = {
69 .start = evt2irq(0x580), 68 .start = 28,
70 .flags = IORESOURCE_IRQ, 69 .flags = IORESOURCE_IRQ,
71 }, 70 },
72}; 71};
@@ -94,7 +93,7 @@ static struct resource tmu1_resources[] = {
94 .flags = IORESOURCE_MEM, 93 .flags = IORESOURCE_MEM,
95 }, 94 },
96 [1] = { 95 [1] = {
97 .start = evt2irq(0x5a0), 96 .start = 29,
98 .flags = IORESOURCE_IRQ, 97 .flags = IORESOURCE_IRQ,
99 }, 98 },
100}; 99};
@@ -121,7 +120,7 @@ static struct resource tmu2_resources[] = {
121 .flags = IORESOURCE_MEM, 120 .flags = IORESOURCE_MEM,
122 }, 121 },
123 [1] = { 122 [1] = {
124 .start = evt2irq(0x5c0), 123 .start = 30,
125 .flags = IORESOURCE_IRQ, 124 .flags = IORESOURCE_IRQ,
126 }, 125 },
127}; 126};
@@ -148,7 +147,7 @@ static struct resource tmu3_resources[] = {
148 .flags = IORESOURCE_MEM, 147 .flags = IORESOURCE_MEM,
149 }, 148 },
150 [1] = { 149 [1] = {
151 .start = evt2irq(0xe00), 150 .start = 96,
152 .flags = IORESOURCE_IRQ, 151 .flags = IORESOURCE_IRQ,
153 }, 152 },
154}; 153};
@@ -175,7 +174,7 @@ static struct resource tmu4_resources[] = {
175 .flags = IORESOURCE_MEM, 174 .flags = IORESOURCE_MEM,
176 }, 175 },
177 [1] = { 176 [1] = {
178 .start = evt2irq(0xe20), 177 .start = 97,
179 .flags = IORESOURCE_IRQ, 178 .flags = IORESOURCE_IRQ,
180 }, 179 },
181}; 180};
@@ -202,7 +201,7 @@ static struct resource tmu5_resources[] = {
202 .flags = IORESOURCE_MEM, 201 .flags = IORESOURCE_MEM,
203 }, 202 },
204 [1] = { 203 [1] = {
205 .start = evt2irq(0xe40), 204 .start = 98,
206 .flags = IORESOURCE_IRQ, 205 .flags = IORESOURCE_IRQ,
207 }, 206 },
208}; 207};
@@ -225,7 +224,7 @@ static struct resource rtc_resources[] = {
225 }, 224 },
226 [1] = { 225 [1] = {
227 /* Shared Period/Carry/Alarm IRQ */ 226 /* Shared Period/Carry/Alarm IRQ */
228 .start = evt2irq(0x480), 227 .start = 20,
229 .flags = IORESOURCE_IRQ, 228 .flags = IORESOURCE_IRQ,
230 }, 229 },
231}; 230};
@@ -322,13 +321,9 @@ static struct resource sh7780_dmae0_resources[] = {
322 .flags = IORESOURCE_MEM, 321 .flags = IORESOURCE_MEM,
323 }, 322 },
324 { 323 {
325 /* 324 /* Real DMA error IRQ is 38, and channel IRQs are 34-37, 44-45 */
326 * Real DMA error vector is 0x6c0, and channel 325 .start = 34,
327 * vectors are 0x640-0x6a0, 0x780-0x7a0 326 .end = 34,
328 */
329 .name = "error_irq",
330 .start = evt2irq(0x640),
331 .end = evt2irq(0x640),
332 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 327 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
333 }, 328 },
334}; 329};
@@ -342,13 +337,9 @@ static struct resource sh7780_dmae1_resources[] = {
342 }, 337 },
343 /* DMAC1 has no DMARS */ 338 /* DMAC1 has no DMARS */
344 { 339 {
345 /* 340 /* Real DMA error IRQ is 38, and channel IRQs are 46-47, 92-95 */
346 * Real DMA error vector is 0x6c0, and channel 341 .start = 46,
347 * vectors are 0x7c0-0x7e0, 0xd80-0xde0 342 .end = 46,
348 */
349 .name = "error_irq",
350 .start = evt2irq(0x7c0),
351 .end = evt2irq(0x7c0),
352 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 343 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
353 }, 344 },
354}; 345};
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
index 0968ecb962e..b29e6340414 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
@@ -15,7 +15,6 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/sh_dma.h> 16#include <linux/sh_dma.h>
17#include <linux/sh_timer.h> 17#include <linux/sh_timer.h>
18#include <linux/sh_intc.h>
19#include <asm/mmzone.h> 18#include <asm/mmzone.h>
20#include <cpu/dma-register.h> 19#include <cpu/dma-register.h>
21 20
@@ -25,7 +24,7 @@ static struct plat_sci_port scif0_platform_data = {
25 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 24 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
26 .scbrr_algo_id = SCBRR_ALGO_1, 25 .scbrr_algo_id = SCBRR_ALGO_1,
27 .type = PORT_SCIF, 26 .type = PORT_SCIF,
28 .irqs = SCIx_IRQ_MUXED(evt2irq(0x700)), 27 .irqs = { 40, 40, 40, 40 },
29 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 28 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
30}; 29};
31 30
@@ -43,7 +42,7 @@ static struct plat_sci_port scif1_platform_data = {
43 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 42 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
44 .scbrr_algo_id = SCBRR_ALGO_1, 43 .scbrr_algo_id = SCBRR_ALGO_1,
45 .type = PORT_SCIF, 44 .type = PORT_SCIF,
46 .irqs = SCIx_IRQ_MUXED(evt2irq(0x780)), 45 .irqs = { 44, 44, 44, 44 },
47 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 46 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
48}; 47};
49 48
@@ -61,7 +60,7 @@ static struct plat_sci_port scif2_platform_data = {
61 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 60 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
62 .scbrr_algo_id = SCBRR_ALGO_1, 61 .scbrr_algo_id = SCBRR_ALGO_1,
63 .type = PORT_SCIF, 62 .type = PORT_SCIF,
64 .irqs = SCIx_IRQ_MUXED(evt2irq(0x980)), 63 .irqs = { 60, 60, 60, 60 },
65 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 64 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
66}; 65};
67 66
@@ -79,7 +78,7 @@ static struct plat_sci_port scif3_platform_data = {
79 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 78 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
80 .scbrr_algo_id = SCBRR_ALGO_1, 79 .scbrr_algo_id = SCBRR_ALGO_1,
81 .type = PORT_SCIF, 80 .type = PORT_SCIF,
82 .irqs = SCIx_IRQ_MUXED(evt2irq(0x9a0)), 81 .irqs = { 61, 61, 61, 61 },
83 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 82 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
84}; 83};
85 84
@@ -97,7 +96,7 @@ static struct plat_sci_port scif4_platform_data = {
97 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 96 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
98 .scbrr_algo_id = SCBRR_ALGO_1, 97 .scbrr_algo_id = SCBRR_ALGO_1,
99 .type = PORT_SCIF, 98 .type = PORT_SCIF,
100 .irqs = SCIx_IRQ_MUXED(evt2irq(0x9c0)), 99 .irqs = { 62, 62, 62, 62 },
101 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 100 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
102}; 101};
103 102
@@ -115,7 +114,7 @@ static struct plat_sci_port scif5_platform_data = {
115 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 114 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
116 .scbrr_algo_id = SCBRR_ALGO_1, 115 .scbrr_algo_id = SCBRR_ALGO_1,
117 .type = PORT_SCIF, 116 .type = PORT_SCIF,
118 .irqs = SCIx_IRQ_MUXED(evt2irq(0x9e0)), 117 .irqs = { 63, 63, 63, 63 },
119 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 118 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
120}; 119};
121 120
@@ -140,7 +139,7 @@ static struct resource tmu0_resources[] = {
140 .flags = IORESOURCE_MEM, 139 .flags = IORESOURCE_MEM,
141 }, 140 },
142 [1] = { 141 [1] = {
143 .start = evt2irq(0x580), 142 .start = 28,
144 .flags = IORESOURCE_IRQ, 143 .flags = IORESOURCE_IRQ,
145 }, 144 },
146}; 145};
@@ -168,7 +167,7 @@ static struct resource tmu1_resources[] = {
168 .flags = IORESOURCE_MEM, 167 .flags = IORESOURCE_MEM,
169 }, 168 },
170 [1] = { 169 [1] = {
171 .start = evt2irq(0x5a0), 170 .start = 29,
172 .flags = IORESOURCE_IRQ, 171 .flags = IORESOURCE_IRQ,
173 }, 172 },
174}; 173};
@@ -195,7 +194,7 @@ static struct resource tmu2_resources[] = {
195 .flags = IORESOURCE_MEM, 194 .flags = IORESOURCE_MEM,
196 }, 195 },
197 [1] = { 196 [1] = {
198 .start = evt2irq(0x5c0), 197 .start = 30,
199 .flags = IORESOURCE_IRQ, 198 .flags = IORESOURCE_IRQ,
200 }, 199 },
201}; 200};
@@ -222,7 +221,7 @@ static struct resource tmu3_resources[] = {
222 .flags = IORESOURCE_MEM, 221 .flags = IORESOURCE_MEM,
223 }, 222 },
224 [1] = { 223 [1] = {
225 .start = evt2irq(0xe00), 224 .start = 96,
226 .flags = IORESOURCE_IRQ, 225 .flags = IORESOURCE_IRQ,
227 }, 226 },
228}; 227};
@@ -249,7 +248,7 @@ static struct resource tmu4_resources[] = {
249 .flags = IORESOURCE_MEM, 248 .flags = IORESOURCE_MEM,
250 }, 249 },
251 [1] = { 250 [1] = {
252 .start = evt2irq(0xe20), 251 .start = 97,
253 .flags = IORESOURCE_IRQ, 252 .flags = IORESOURCE_IRQ,
254 }, 253 },
255}; 254};
@@ -276,7 +275,7 @@ static struct resource tmu5_resources[] = {
276 .flags = IORESOURCE_MEM, 275 .flags = IORESOURCE_MEM,
277 }, 276 },
278 [1] = { 277 [1] = {
279 .start = evt2irq(0xe40), 278 .start = 98,
280 .flags = IORESOURCE_IRQ, 279 .flags = IORESOURCE_IRQ,
281 }, 280 },
282}; 281};
@@ -376,13 +375,9 @@ static struct resource sh7785_dmae0_resources[] = {
376 .flags = IORESOURCE_MEM, 375 .flags = IORESOURCE_MEM,
377 }, 376 },
378 { 377 {
379 /* 378 /* Real DMA error IRQ is 39, and channel IRQs are 33-38 */
380 * Real DMA error vector is 0x6e0, and channel 379 .start = 33,
381 * vectors are 0x620-0x6c0 380 .end = 33,
382 */
383 .name = "error_irq",
384 .start = evt2irq(0x620),
385 .end = evt2irq(0x620),
386 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 381 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
387 }, 382 },
388}; 383};
@@ -396,13 +391,9 @@ static struct resource sh7785_dmae1_resources[] = {
396 }, 391 },
397 /* DMAC1 has no DMARS */ 392 /* DMAC1 has no DMARS */
398 { 393 {
399 /* 394 /* Real DMA error IRQ is 58, and channel IRQs are 52-57 */
400 * Real DMA error vector is 0x940, and channel 395 .start = 52,
401 * vectors are 0x880-0x920 396 .end = 52,
402 */
403 .name = "error_irq",
404 .start = evt2irq(0x880),
405 .end = evt2irq(0x880),
406 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, 397 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
407 }, 398 },
408}; 399};
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index ab52d4d4484..dd5e709f982 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -23,7 +23,6 @@
23#include <linux/sh_timer.h> 23#include <linux/sh_timer.h>
24#include <linux/sh_dma.h> 24#include <linux/sh_dma.h>
25#include <linux/sh_intc.h> 25#include <linux/sh_intc.h>
26#include <linux/usb/ohci_pdriver.h>
27#include <cpu/dma-register.h> 26#include <cpu/dma-register.h>
28#include <asm/mmzone.h> 27#include <asm/mmzone.h>
29 28
@@ -33,10 +32,7 @@ static struct plat_sci_port scif0_platform_data = {
33 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 32 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
34 .scbrr_algo_id = SCBRR_ALGO_1, 33 .scbrr_algo_id = SCBRR_ALGO_1,
35 .type = PORT_SCIF, 34 .type = PORT_SCIF,
36 .irqs = { evt2irq(0x700), 35 .irqs = { 40, 41, 43, 42 },
37 evt2irq(0x720),
38 evt2irq(0x760),
39 evt2irq(0x740) },
40 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 36 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
41}; 37};
42 38
@@ -57,7 +53,7 @@ static struct plat_sci_port scif1_platform_data = {
57 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 53 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
58 .scbrr_algo_id = SCBRR_ALGO_1, 54 .scbrr_algo_id = SCBRR_ALGO_1,
59 .type = PORT_SCIF, 55 .type = PORT_SCIF,
60 .irqs = SCIx_IRQ_MUXED(evt2irq(0x780)), 56 .irqs = { 44, 44, 44, 44 },
61 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 57 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
62}; 58};
63 59
@@ -75,7 +71,7 @@ static struct plat_sci_port scif2_platform_data = {
75 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 71 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
76 .scbrr_algo_id = SCBRR_ALGO_1, 72 .scbrr_algo_id = SCBRR_ALGO_1,
77 .type = PORT_SCIF, 73 .type = PORT_SCIF,
78 .irqs = SCIx_IRQ_MUXED(evt2irq(0x840)), 74 .irqs = { 50, 50, 50, 50 },
79 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 75 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
80}; 76};
81 77
@@ -93,7 +89,7 @@ static struct plat_sci_port scif3_platform_data = {
93 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 89 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
94 .scbrr_algo_id = SCBRR_ALGO_1, 90 .scbrr_algo_id = SCBRR_ALGO_1,
95 .type = PORT_SCIF, 91 .type = PORT_SCIF,
96 .irqs = SCIx_IRQ_MUXED(evt2irq(0x860)), 92 .irqs = { 51, 51, 51, 51 },
97 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 93 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
98}; 94};
99 95
@@ -111,7 +107,7 @@ static struct plat_sci_port scif4_platform_data = {
111 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 107 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
112 .scbrr_algo_id = SCBRR_ALGO_1, 108 .scbrr_algo_id = SCBRR_ALGO_1,
113 .type = PORT_SCIF, 109 .type = PORT_SCIF,
114 .irqs = SCIx_IRQ_MUXED(evt2irq(0x880)), 110 .irqs = { 52, 52, 52, 52 },
115 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 111 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
116}; 112};
117 113
@@ -129,7 +125,7 @@ static struct plat_sci_port scif5_platform_data = {
129 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 125 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
130 .scbrr_algo_id = SCBRR_ALGO_1, 126 .scbrr_algo_id = SCBRR_ALGO_1,
131 .type = PORT_SCIF, 127 .type = PORT_SCIF,
132 .irqs = SCIx_IRQ_MUXED(evt2irq(0x8a0)), 128 .irqs = { 53, 53, 53, 53 },
133 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE, 129 .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
134}; 130};
135 131
@@ -154,7 +150,7 @@ static struct resource tmu0_resources[] = {
154 .flags = IORESOURCE_MEM, 150 .flags = IORESOURCE_MEM,
155 }, 151 },
156 [1] = { 152 [1] = {
157 .start = evt2irq(0x400), 153 .start = 16,
158 .flags = IORESOURCE_IRQ, 154 .flags = IORESOURCE_IRQ,
159 }, 155 },
160}; 156};
@@ -182,7 +178,7 @@ static struct resource tmu1_resources[] = {
182 .flags = IORESOURCE_MEM, 178 .flags = IORESOURCE_MEM,
183 }, 179 },
184 [1] = { 180 [1] = {
185 .start = evt2irq(0x420), 181 .start = 17,
186 .flags = IORESOURCE_IRQ, 182 .flags = IORESOURCE_IRQ,
187 }, 183 },
188}; 184};
@@ -209,7 +205,7 @@ static struct resource tmu2_resources[] = {
209 .flags = IORESOURCE_MEM, 205 .flags = IORESOURCE_MEM,
210 }, 206 },
211 [1] = { 207 [1] = {
212 .start = evt2irq(0x440), 208 .start = 18,
213 .flags = IORESOURCE_IRQ, 209 .flags = IORESOURCE_IRQ,
214 }, 210 },
215}; 211};
@@ -236,7 +232,7 @@ static struct resource tmu3_resources[] = {
236 .flags = IORESOURCE_MEM, 232 .flags = IORESOURCE_MEM,
237 }, 233 },
238 [1] = { 234 [1] = {
239 .start = evt2irq(0x480), 235 .start = 20,
240 .flags = IORESOURCE_IRQ, 236 .flags = IORESOURCE_IRQ,
241 }, 237 },
242}; 238};
@@ -263,7 +259,7 @@ static struct resource tmu4_resources[] = {
263 .flags = IORESOURCE_MEM, 259 .flags = IORESOURCE_MEM,
264 }, 260 },
265 [1] = { 261 [1] = {
266 .start = evt2irq(0x4a0), 262 .start = 21,
267 .flags = IORESOURCE_IRQ, 263 .flags = IORESOURCE_IRQ,
268 }, 264 },
269}; 265};
@@ -290,7 +286,7 @@ static struct resource tmu5_resources[] = {
290 .flags = IORESOURCE_MEM, 286 .flags = IORESOURCE_MEM,
291 }, 287 },
292 [1] = { 288 [1] = {
293 .start = evt2irq(0x4c0), 289 .start = 22,
294 .flags = IORESOURCE_IRQ, 290 .flags = IORESOURCE_IRQ,
295 }, 291 },
296}; 292};
@@ -317,7 +313,7 @@ static struct resource tmu6_resources[] = {
317 .flags = IORESOURCE_MEM, 313 .flags = IORESOURCE_MEM,
318 }, 314 },
319 [1] = { 315 [1] = {
320 .start = evt2irq(0x7a0), 316 .start = 45,
321 .flags = IORESOURCE_IRQ, 317 .flags = IORESOURCE_IRQ,
322 }, 318 },
323}; 319};
@@ -344,7 +340,7 @@ static struct resource tmu7_resources[] = {
344 .flags = IORESOURCE_MEM, 340 .flags = IORESOURCE_MEM,
345 }, 341 },
346 [1] = { 342 [1] = {
347 .start = evt2irq(0x7a0), 343 .start = 45,
348 .flags = IORESOURCE_IRQ, 344 .flags = IORESOURCE_IRQ,
349 }, 345 },
350}; 346};
@@ -371,7 +367,7 @@ static struct resource tmu8_resources[] = {
371 .flags = IORESOURCE_MEM, 367 .flags = IORESOURCE_MEM,
372 }, 368 },
373 [1] = { 369 [1] = {
374 .start = evt2irq(0x7a0), 370 .start = 45,
375 .flags = IORESOURCE_IRQ, 371 .flags = IORESOURCE_IRQ,
376 }, 372 },
377}; 373};
@@ -398,7 +394,7 @@ static struct resource tmu9_resources[] = {
398 .flags = IORESOURCE_MEM, 394 .flags = IORESOURCE_MEM,
399 }, 395 },
400 [1] = { 396 [1] = {
401 .start = evt2irq(0x7c0), 397 .start = 46,
402 .flags = IORESOURCE_IRQ, 398 .flags = IORESOURCE_IRQ,
403 }, 399 },
404}; 400};
@@ -425,7 +421,7 @@ static struct resource tmu10_resources[] = {
425 .flags = IORESOURCE_MEM, 421 .flags = IORESOURCE_MEM,
426 }, 422 },
427 [1] = { 423 [1] = {
428 .start = evt2irq(0x7c0), 424 .start = 46,
429 .flags = IORESOURCE_IRQ, 425 .flags = IORESOURCE_IRQ,
430 }, 426 },
431}; 427};
@@ -452,7 +448,7 @@ static struct resource tmu11_resources[] = {
452 .flags = IORESOURCE_MEM, 448 .flags = IORESOURCE_MEM,
453 }, 449 },
454 [1] = { 450 [1] = {
455 .start = evt2irq(0x7c0), 451 .start = 46,
456 .flags = IORESOURCE_IRQ, 452 .flags = IORESOURCE_IRQ,
457 }, 453 },
458}; 454};
@@ -522,7 +518,7 @@ static struct resource dmac0_resources[] = {
522 .end = 0xfe00900b, 518 .end = 0xfe00900b,
523 .flags = IORESOURCE_MEM, 519 .flags = IORESOURCE_MEM,
524 }, { 520 }, {
525 .name = "error_irq", 521 /* DMA error IRQ */
526 .start = evt2irq(0x5c0), 522 .start = evt2irq(0x5c0),
527 .end = evt2irq(0x5c0), 523 .end = evt2irq(0x5c0),
528 .flags = IORESOURCE_IRQ, 524 .flags = IORESOURCE_IRQ,
@@ -554,8 +550,8 @@ static struct resource usb_ehci_resources[] = {
554 .flags = IORESOURCE_MEM, 550 .flags = IORESOURCE_MEM,
555 }, 551 },
556 [1] = { 552 [1] = {
557 .start = evt2irq(0xba0), 553 .start = 77,
558 .end = evt2irq(0xba0), 554 .end = 77,
559 .flags = IORESOURCE_IRQ, 555 .flags = IORESOURCE_IRQ,
560 }, 556 },
561}; 557};
@@ -578,21 +574,18 @@ static struct resource usb_ohci_resources[] = {
578 .flags = IORESOURCE_MEM, 574 .flags = IORESOURCE_MEM,
579 }, 575 },
580 [1] = { 576 [1] = {
581 .start = evt2irq(0xba0), 577 .start = 77,
582 .end = evt2irq(0xba0), 578 .end = 77,
583 .flags = IORESOURCE_IRQ, 579 .flags = IORESOURCE_IRQ,
584 }, 580 },
585}; 581};
586 582
587static struct usb_ohci_pdata usb_ohci_pdata;
588
589static struct platform_device usb_ohci_device = { 583static struct platform_device usb_ohci_device = {
590 .name = "ohci-platform", 584 .name = "sh_ohci",
591 .id = -1, 585 .id = -1,
592 .dev = { 586 .dev = {
593 .dma_mask = &usb_ohci_device.dev.coherent_dma_mask, 587 .dma_mask = &usb_ohci_device.dev.coherent_dma_mask,
594 .coherent_dma_mask = DMA_BIT_MASK(32), 588 .coherent_dma_mask = DMA_BIT_MASK(32),
595 .platform_data = &usb_ohci_pdata,
596 }, 589 },
597 .num_resources = ARRAY_SIZE(usb_ohci_resources), 590 .num_resources = ARRAY_SIZE(usb_ohci_resources),
598 .resource = usb_ohci_resources, 591 .resource = usb_ohci_resources,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
index 688f7ed1bab..bb208806dc1 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
@@ -14,7 +14,6 @@
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <linux/sh_timer.h> 16#include <linux/sh_timer.h>
17#include <linux/sh_intc.h>
18#include <cpu/shx3.h> 17#include <cpu/shx3.h>
19#include <asm/mmzone.h> 18#include <asm/mmzone.h>
20 19
@@ -33,10 +32,7 @@ static struct plat_sci_port scif0_platform_data = {
33 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 32 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
34 .scbrr_algo_id = SCBRR_ALGO_2, 33 .scbrr_algo_id = SCBRR_ALGO_2,
35 .type = PORT_SCIF, 34 .type = PORT_SCIF,
36 .irqs = { evt2irq(0x700), 35 .irqs = { 40, 41, 43, 42 },
37 evt2irq(0x720),
38 evt2irq(0x760),
39 evt2irq(0x740) },
40}; 36};
41 37
42static struct platform_device scif0_device = { 38static struct platform_device scif0_device = {
@@ -53,10 +49,7 @@ static struct plat_sci_port scif1_platform_data = {
53 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 49 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
54 .scbrr_algo_id = SCBRR_ALGO_2, 50 .scbrr_algo_id = SCBRR_ALGO_2,
55 .type = PORT_SCIF, 51 .type = PORT_SCIF,
56 .irqs = { evt2irq(0x780), 52 .irqs = { 44, 45, 47, 46 },
57 evt2irq(0x7a0),
58 evt2irq(0x7e0),
59 evt2irq(0x7c0) },
60}; 53};
61 54
62static struct platform_device scif1_device = { 55static struct platform_device scif1_device = {
@@ -73,10 +66,7 @@ static struct plat_sci_port scif2_platform_data = {
73 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 66 .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
74 .scbrr_algo_id = SCBRR_ALGO_2, 67 .scbrr_algo_id = SCBRR_ALGO_2,
75 .type = PORT_SCIF, 68 .type = PORT_SCIF,
76 .irqs = { evt2irq(0x880), 69 .irqs = { 52, 53, 55, 54 },
77 evt2irq(0x8a0),
78 evt2irq(0x8e0),
79 evt2irq(0x8c0) },
80}; 70};
81 71
82static struct platform_device scif2_device = { 72static struct platform_device scif2_device = {
@@ -100,7 +90,7 @@ static struct resource tmu0_resources[] = {
100 .flags = IORESOURCE_MEM, 90 .flags = IORESOURCE_MEM,
101 }, 91 },
102 [1] = { 92 [1] = {
103 .start = evt2irq(0x400), 93 .start = 16,
104 .flags = IORESOURCE_IRQ, 94 .flags = IORESOURCE_IRQ,
105 }, 95 },
106}; 96};
@@ -128,7 +118,7 @@ static struct resource tmu1_resources[] = {
128 .flags = IORESOURCE_MEM, 118 .flags = IORESOURCE_MEM,
129 }, 119 },
130 [1] = { 120 [1] = {
131 .start = evt2irq(0x420), 121 .start = 17,
132 .flags = IORESOURCE_IRQ, 122 .flags = IORESOURCE_IRQ,
133 }, 123 },
134}; 124};
@@ -155,7 +145,7 @@ static struct resource tmu2_resources[] = {
155 .flags = IORESOURCE_MEM, 145 .flags = IORESOURCE_MEM,
156 }, 146 },
157 [1] = { 147 [1] = {
158 .start = evt2irq(0x440), 148 .start = 18,
159 .flags = IORESOURCE_IRQ, 149 .flags = IORESOURCE_IRQ,
160 }, 150 },
161}; 151};
@@ -182,7 +172,7 @@ static struct resource tmu3_resources[] = {
182 .flags = IORESOURCE_MEM, 172 .flags = IORESOURCE_MEM,
183 }, 173 },
184 [1] = { 174 [1] = {
185 .start = evt2irq(0x460), 175 .start = 19,
186 .flags = IORESOURCE_IRQ, 176 .flags = IORESOURCE_IRQ,
187 }, 177 },
188}; 178};
@@ -209,7 +199,7 @@ static struct resource tmu4_resources[] = {
209 .flags = IORESOURCE_MEM, 199 .flags = IORESOURCE_MEM,
210 }, 200 },
211 [1] = { 201 [1] = {
212 .start = evt2irq(0x480), 202 .start = 20,
213 .flags = IORESOURCE_IRQ, 203 .flags = IORESOURCE_IRQ,
214 }, 204 },
215}; 205};
@@ -236,7 +226,7 @@ static struct resource tmu5_resources[] = {
236 .flags = IORESOURCE_MEM, 226 .flags = IORESOURCE_MEM,
237 }, 227 },
238 [1] = { 228 [1] = {
239 .start = evt2irq(0x4a0), 229 .start = 21,
240 .flags = IORESOURCE_IRQ, 230 .flags = IORESOURCE_IRQ,
241 }, 231 },
242}; 232};
@@ -494,6 +484,9 @@ void __init plat_irq_setup_pins(int mode)
494 484
495void __init plat_irq_setup(void) 485void __init plat_irq_setup(void)
496{ 486{
487 reserve_intc_vectors(vectors_irq, ARRAY_SIZE(vectors_irq));
488 reserve_intc_vectors(vectors_irl, ARRAY_SIZE(vectors_irl));
489
497 register_intc_controller(&intc_desc); 490 register_intc_controller(&intc_desc);
498} 491}
499 492
diff --git a/arch/sh/kernel/cpu/sh4a/smp-shx3.c b/arch/sh/kernel/cpu/sh4a/smp-shx3.c
index 03f2b55757c..de865cac02e 100644
--- a/arch/sh/kernel/cpu/sh4a/smp-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/smp-shx3.c
@@ -79,7 +79,7 @@ static void shx3_prepare_cpus(unsigned int max_cpus)
79 79
80 for (i = 0; i < SMP_MSG_NR; i++) 80 for (i = 0; i < SMP_MSG_NR; i++)
81 request_irq(104 + i, ipi_interrupt_handler, 81 request_irq(104 + i, ipi_interrupt_handler,
82 IRQF_PERCPU, "IPI", (void *)(long)i); 82 IRQF_DISABLED | IRQF_PERCPU, "IPI", (void *)(long)i);
83 83
84 for (i = 0; i < max_cpus; i++) 84 for (i = 0; i < max_cpus; i++)
85 set_cpu_present(i, true); 85 set_cpu_present(i, true);
diff --git a/arch/sh/kernel/cpu/sh5/clock-sh5.c b/arch/sh/kernel/cpu/sh5/clock-sh5.c
index c48b93d4c08..9cfc19b8dbe 100644
--- a/arch/sh/kernel/cpu/sh5/clock-sh5.c
+++ b/arch/sh/kernel/cpu/sh5/clock-sh5.c
@@ -28,7 +28,7 @@ static void master_clk_init(struct clk *clk)
28 clk->rate *= ifc_table[idx]; 28 clk->rate *= ifc_table[idx];
29} 29}
30 30
31static struct sh_clk_ops sh5_master_clk_ops = { 31static struct clk_ops sh5_master_clk_ops = {
32 .init = master_clk_init, 32 .init = master_clk_init,
33}; 33};
34 34
@@ -38,7 +38,7 @@ static unsigned long module_clk_recalc(struct clk *clk)
38 return clk->parent->rate / ifc_table[idx]; 38 return clk->parent->rate / ifc_table[idx];
39} 39}
40 40
41static struct sh_clk_ops sh5_module_clk_ops = { 41static struct clk_ops sh5_module_clk_ops = {
42 .recalc = module_clk_recalc, 42 .recalc = module_clk_recalc,
43}; 43};
44 44
@@ -48,7 +48,7 @@ static unsigned long bus_clk_recalc(struct clk *clk)
48 return clk->parent->rate / ifc_table[idx]; 48 return clk->parent->rate / ifc_table[idx];
49} 49}
50 50
51static struct sh_clk_ops sh5_bus_clk_ops = { 51static struct clk_ops sh5_bus_clk_ops = {
52 .recalc = bus_clk_recalc, 52 .recalc = bus_clk_recalc,
53}; 53};
54 54
@@ -58,18 +58,18 @@ static unsigned long cpu_clk_recalc(struct clk *clk)
58 return clk->parent->rate / ifc_table[idx]; 58 return clk->parent->rate / ifc_table[idx];
59} 59}
60 60
61static struct sh_clk_ops sh5_cpu_clk_ops = { 61static struct clk_ops sh5_cpu_clk_ops = {
62 .recalc = cpu_clk_recalc, 62 .recalc = cpu_clk_recalc,
63}; 63};
64 64
65static struct sh_clk_ops *sh5_clk_ops[] = { 65static struct clk_ops *sh5_clk_ops[] = {
66 &sh5_master_clk_ops, 66 &sh5_master_clk_ops,
67 &sh5_module_clk_ops, 67 &sh5_module_clk_ops,
68 &sh5_bus_clk_ops, 68 &sh5_bus_clk_ops,
69 &sh5_cpu_clk_ops, 69 &sh5_cpu_clk_ops,
70}; 70};
71 71
72void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) 72void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
73{ 73{
74 cprc_base = (unsigned long)ioremap_nocache(CPRC_BASE, 1024); 74 cprc_base = (unsigned long)ioremap_nocache(CPRC_BASE, 1024);
75 BUG_ON(!cprc_base); 75 BUG_ON(!cprc_base);
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S
index 0c8d0377d40..6b80295dd7a 100644
--- a/arch/sh/kernel/cpu/sh5/entry.S
+++ b/arch/sh/kernel/cpu/sh5/entry.S
@@ -335,7 +335,7 @@ tlb_miss:
335 /* If the fast path handler fixed the fault, just drop through quickly 335 /* If the fast path handler fixed the fault, just drop through quickly
336 to the restore code right away to return to the excepting context. 336 to the restore code right away to return to the excepting context.
337 */ 337 */
338 bnei/u r2, 0, tr1 338 beqi/u r2, 0, tr1
339 339
340fast_tlb_miss_restore: 340fast_tlb_miss_restore:
341 ld.q SP, SAVED_TR0, r2 341 ld.q SP, SAVED_TR0, r2
@@ -933,7 +933,7 @@ ret_with_reschedule:
933 933
934 pta restore_all, tr1 934 pta restore_all, tr1
935 935
936 movi (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME), r8 936 movi _TIF_SIGPENDING, r8
937 and r8, r7, r8 937 and r8, r7, r8
938 pta work_notifysig, tr0 938 pta work_notifysig, tr0
939 bne r8, ZERO, tr0 939 bne r8, ZERO, tr0
@@ -1079,8 +1079,9 @@ restore_all:
1079 * 1079 *
1080 * Kernel TLB fault handlers will get a slightly different interface. 1080 * Kernel TLB fault handlers will get a slightly different interface.
1081 * (r2) struct pt_regs *, original register's frame pointer 1081 * (r2) struct pt_regs *, original register's frame pointer
1082 * (r3) page fault error code (see asm/thread_info.h) 1082 * (r3) writeaccess, whether it's a store fault as opposed to load fault
1083 * (r4) Effective Address of fault 1083 * (r4) execaccess, whether it's a ITLB fault as opposed to DTLB fault
1084 * (r5) Effective Address of fault
1084 * (LINK) return address 1085 * (LINK) return address
1085 * (SP) = r2 1086 * (SP) = r2
1086 * 1087 *
@@ -1091,25 +1092,26 @@ restore_all:
1091tlb_miss_load: 1092tlb_miss_load:
1092 or SP, ZERO, r2 1093 or SP, ZERO, r2
1093 or ZERO, ZERO, r3 /* Read */ 1094 or ZERO, ZERO, r3 /* Read */
1094 getcon TEA, r4 1095 or ZERO, ZERO, r4 /* Data */
1096 getcon TEA, r5
1095 pta call_do_page_fault, tr0 1097 pta call_do_page_fault, tr0
1096 beq ZERO, ZERO, tr0 1098 beq ZERO, ZERO, tr0
1097 1099
1098tlb_miss_store: 1100tlb_miss_store:
1099 or SP, ZERO, r2 1101 or SP, ZERO, r2
1100 movi FAULT_CODE_WRITE, r3 /* Write */ 1102 movi 1, r3 /* Write */
1101 getcon TEA, r4 1103 or ZERO, ZERO, r4 /* Data */
1104 getcon TEA, r5
1102 pta call_do_page_fault, tr0 1105 pta call_do_page_fault, tr0
1103 beq ZERO, ZERO, tr0 1106 beq ZERO, ZERO, tr0
1104 1107
1105itlb_miss_or_IRQ: 1108itlb_miss_or_IRQ:
1106 pta its_IRQ, tr0 1109 pta its_IRQ, tr0
1107 beqi/u r4, EVENT_INTERRUPT, tr0 1110 beqi/u r4, EVENT_INTERRUPT, tr0
1108
1109 /* ITLB miss */
1110 or SP, ZERO, r2 1111 or SP, ZERO, r2
1111 movi FAULT_CODE_ITLB, r3 1112 or ZERO, ZERO, r3 /* Read */
1112 getcon TEA, r4 1113 movi 1, r4 /* Text */
1114 getcon TEA, r5
1113 /* Fall through */ 1115 /* Fall through */
1114 1116
1115call_do_page_fault: 1117call_do_page_fault:
@@ -1228,25 +1230,6 @@ ret_from_fork:
1228 pta ret_from_syscall, tr0 1230 pta ret_from_syscall, tr0
1229 blink tr0, ZERO 1231 blink tr0, ZERO
1230 1232
1231.global ret_from_kernel_thread
1232ret_from_kernel_thread:
1233
1234 movi schedule_tail,r5
1235 ori r5, 1, r5
1236 ptabs r5, tr0
1237 blink tr0, LINK
1238
1239 ld.q SP, FRAME_R(2), r2
1240 ld.q SP, FRAME_R(3), r3
1241 ptabs r3, tr0
1242 blink tr0, LINK
1243
1244 ld.q SP, FRAME_S(FSPC), r2
1245 addi r2, 4, r2 /* Move PC, being pre-execution event */
1246 st.q SP, FRAME_S(FSPC), r2
1247 pta ret_from_syscall, tr0
1248 blink tr0, ZERO
1249
1250syscall_allowed: 1233syscall_allowed:
1251 /* Use LINK to deflect the exit point, default is syscall_ret */ 1234 /* Use LINK to deflect the exit point, default is syscall_ret */
1252 pta syscall_ret, tr0 1235 pta syscall_ret, tr0
@@ -1588,6 +1571,86 @@ ___clear_user_exit:
1588#endif /* CONFIG_MMU */ 1571#endif /* CONFIG_MMU */
1589 1572
1590/* 1573/*
1574 * int __strncpy_from_user(unsigned long __dest, unsigned long __src,
1575 * int __count)
1576 *
1577 * Inputs:
1578 * (r2) target address
1579 * (r3) source address
1580 * (r4) maximum size in bytes
1581 *
1582 * Ouputs:
1583 * (*r2) copied data
1584 * (r2) -EFAULT (in case of faulting)
1585 * copied data (otherwise)
1586 */
1587 .global __strncpy_from_user
1588__strncpy_from_user:
1589 pta ___strncpy_from_user1, tr0
1590 pta ___strncpy_from_user_done, tr1
1591 or r4, ZERO, r5 /* r5 = original count */
1592 beq/u r4, r63, tr1 /* early exit if r4==0 */
1593 movi -(EFAULT), r6 /* r6 = reply, no real fixup */
1594 or ZERO, ZERO, r7 /* r7 = data, clear top byte of data */
1595
1596___strncpy_from_user1:
1597 ld.b r3, 0, r7 /* Fault address: only in reading */
1598 st.b r2, 0, r7
1599 addi r2, 1, r2
1600 addi r3, 1, r3
1601 beq/u ZERO, r7, tr1
1602 addi r4, -1, r4 /* return real number of copied bytes */
1603 bne/l ZERO, r4, tr0
1604
1605___strncpy_from_user_done:
1606 sub r5, r4, r6 /* If done, return copied */
1607
1608___strncpy_from_user_exit:
1609 or r6, ZERO, r2
1610 ptabs LINK, tr0
1611 blink tr0, ZERO
1612
1613/*
1614 * extern long __strnlen_user(const char *__s, long __n)
1615 *
1616 * Inputs:
1617 * (r2) source address
1618 * (r3) source size in bytes
1619 *
1620 * Ouputs:
1621 * (r2) -EFAULT (in case of faulting)
1622 * string length (otherwise)
1623 */
1624 .global __strnlen_user
1625__strnlen_user:
1626 pta ___strnlen_user_set_reply, tr0
1627 pta ___strnlen_user1, tr1
1628 or ZERO, ZERO, r5 /* r5 = counter */
1629 movi -(EFAULT), r6 /* r6 = reply, no real fixup */
1630 or ZERO, ZERO, r7 /* r7 = data, clear top byte of data */
1631 beq r3, ZERO, tr0
1632
1633___strnlen_user1:
1634 ldx.b r2, r5, r7 /* Fault address: only in reading */
1635 addi r3, -1, r3 /* No real fixup */
1636 addi r5, 1, r5
1637 beq r3, ZERO, tr0
1638 bne r7, ZERO, tr1
1639! The line below used to be active. This meant led to a junk byte lying between each pair
1640! of entries in the argv & envp structures in memory. Whilst the program saw the right data
1641! via the argv and envp arguments to main, it meant the 'flat' representation visible through
1642! /proc/$pid/cmdline was corrupt, causing trouble with ps, for example.
1643! addi r5, 1, r5 /* Include '\0' */
1644
1645___strnlen_user_set_reply:
1646 or r5, ZERO, r6 /* If done, return counter */
1647
1648___strnlen_user_exit:
1649 or r6, ZERO, r2
1650 ptabs LINK, tr0
1651 blink tr0, ZERO
1652
1653/*
1591 * extern long __get_user_asm_?(void *val, long addr) 1654 * extern long __get_user_asm_?(void *val, long addr)
1592 * 1655 *
1593 * Inputs: 1656 * Inputs:
@@ -1921,6 +1984,8 @@ asm_uaccess_start:
1921 .long ___copy_user2, ___copy_user_exit 1984 .long ___copy_user2, ___copy_user_exit
1922 .long ___clear_user1, ___clear_user_exit 1985 .long ___clear_user1, ___clear_user_exit
1923#endif 1986#endif
1987 .long ___strncpy_from_user1, ___strncpy_from_user_exit
1988 .long ___strnlen_user1, ___strnlen_user_exit
1924 .long ___get_user_asm_b1, ___get_user_asm_b_exit 1989 .long ___get_user_asm_b1, ___get_user_asm_b_exit
1925 .long ___get_user_asm_w1, ___get_user_asm_w_exit 1990 .long ___get_user_asm_w1, ___get_user_asm_w_exit
1926 .long ___get_user_asm_l1, ___get_user_asm_l_exit 1991 .long ___get_user_asm_l1, ___get_user_asm_l_exit
diff --git a/arch/sh/kernel/cpu/sh5/fpu.c b/arch/sh/kernel/cpu/sh5/fpu.c
index 9f8713aa718..4b3bb35e99f 100644
--- a/arch/sh/kernel/cpu/sh5/fpu.c
+++ b/arch/sh/kernel/cpu/sh5/fpu.c
@@ -107,5 +107,8 @@ asmlinkage void do_fpu_error(unsigned long ex, struct pt_regs *regs)
107 107
108 regs->pc += 4; 108 regs->pc += 4;
109 109
110 tsk->thread.trap_no = 11;
111 tsk->thread.error_code = 0;
112
110 force_sig(SIGFPE, tsk); 113 force_sig(SIGFPE, tsk);
111} 114}
diff --git a/arch/sh/kernel/cpu/sh5/unwind.c b/arch/sh/kernel/cpu/sh5/unwind.c
index 10aed41757f..b205b25eaf4 100644
--- a/arch/sh/kernel/cpu/sh5/unwind.c
+++ b/arch/sh/kernel/cpu/sh5/unwind.c
@@ -16,8 +16,6 @@
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17#include <asm/processor.h> 17#include <asm/processor.h>
18#include <asm/io.h> 18#include <asm/io.h>
19#include <asm/unwinder.h>
20#include <asm/stacktrace.h>
21 19
22static u8 regcache[63]; 20static u8 regcache[63];
23 21
@@ -201,11 +199,8 @@ static int lookup_prev_stack_frame(unsigned long fp, unsigned long pc,
201 return 0; 199 return 0;
202} 200}
203 201
204/* 202/* Don't put this on the stack since we'll want to call sh64_unwind
205 * Don't put this on the stack since we'll want to call in to 203 * when we're close to underflowing the stack anyway. */
206 * sh64_unwinder_dump() when we're close to underflowing the stack
207 * anyway.
208 */
209static struct pt_regs here_regs; 204static struct pt_regs here_regs;
210 205
211extern const char syscall_ret; 206extern const char syscall_ret;
@@ -213,19 +208,17 @@ extern const char ret_from_syscall;
213extern const char ret_from_exception; 208extern const char ret_from_exception;
214extern const char ret_from_irq; 209extern const char ret_from_irq;
215 210
216static void sh64_unwind_inner(const struct stacktrace_ops *ops, 211static void sh64_unwind_inner(struct pt_regs *regs);
217 void *data, struct pt_regs *regs);
218 212
219static inline void unwind_nested(const struct stacktrace_ops *ops, void *data, 213static void unwind_nested (unsigned long pc, unsigned long fp)
220 unsigned long pc, unsigned long fp)
221{ 214{
222 if ((fp >= __MEMORY_START) && 215 if ((fp >= __MEMORY_START) &&
223 ((fp & 7) == 0)) 216 ((fp & 7) == 0)) {
224 sh64_unwind_inner(ops, data, (struct pt_regs *)fp); 217 sh64_unwind_inner((struct pt_regs *) fp);
218 }
225} 219}
226 220
227static void sh64_unwind_inner(const struct stacktrace_ops *ops, 221static void sh64_unwind_inner(struct pt_regs *regs)
228 void *data, struct pt_regs *regs)
229{ 222{
230 unsigned long pc, fp; 223 unsigned long pc, fp;
231 int ofs = 0; 224 int ofs = 0;
@@ -239,29 +232,29 @@ static void sh64_unwind_inner(const struct stacktrace_ops *ops,
239 int cond; 232 int cond;
240 unsigned long next_fp, next_pc; 233 unsigned long next_fp, next_pc;
241 234
242 if (pc == ((unsigned long)&syscall_ret & ~1)) { 235 if (pc == ((unsigned long) &syscall_ret & ~1)) {
243 printk("SYSCALL\n"); 236 printk("SYSCALL\n");
244 unwind_nested(ops, data, pc, fp); 237 unwind_nested(pc,fp);
245 return; 238 return;
246 } 239 }
247 240
248 if (pc == ((unsigned long)&ret_from_syscall & ~1)) { 241 if (pc == ((unsigned long) &ret_from_syscall & ~1)) {
249 printk("SYSCALL (PREEMPTED)\n"); 242 printk("SYSCALL (PREEMPTED)\n");
250 unwind_nested(ops, data, pc, fp); 243 unwind_nested(pc,fp);
251 return; 244 return;
252 } 245 }
253 246
254 /* In this case, the PC is discovered by lookup_prev_stack_frame but 247 /* In this case, the PC is discovered by lookup_prev_stack_frame but
255 it has 4 taken off it to look like the 'caller' */ 248 it has 4 taken off it to look like the 'caller' */
256 if (pc == ((unsigned long)&ret_from_exception & ~1)) { 249 if (pc == ((unsigned long) &ret_from_exception & ~1)) {
257 printk("EXCEPTION\n"); 250 printk("EXCEPTION\n");
258 unwind_nested(ops, data, pc, fp); 251 unwind_nested(pc,fp);
259 return; 252 return;
260 } 253 }
261 254
262 if (pc == ((unsigned long)&ret_from_irq & ~1)) { 255 if (pc == ((unsigned long) &ret_from_irq & ~1)) {
263 printk("IRQ\n"); 256 printk("IRQ\n");
264 unwind_nested(ops, data, pc, fp); 257 unwind_nested(pc,fp);
265 return; 258 return;
266 } 259 }
267 260
@@ -270,7 +263,8 @@ static void sh64_unwind_inner(const struct stacktrace_ops *ops,
270 263
271 pc -= ofs; 264 pc -= ofs;
272 265
273 ops->address(data, pc, 1); 266 printk("[<%08lx>] ", pc);
267 print_symbol("%s\n", pc);
274 268
275 if (first_pass) { 269 if (first_pass) {
276 /* If the innermost frame is a leaf function, it's 270 /* If the innermost frame is a leaf function, it's
@@ -293,13 +287,10 @@ static void sh64_unwind_inner(const struct stacktrace_ops *ops,
293 } 287 }
294 288
295 printk("\n"); 289 printk("\n");
290
296} 291}
297 292
298static void sh64_unwinder_dump(struct task_struct *task, 293void sh64_unwind(struct pt_regs *regs)
299 struct pt_regs *regs,
300 unsigned long *sp,
301 const struct stacktrace_ops *ops,
302 void *data)
303{ 294{
304 if (!regs) { 295 if (!regs) {
305 /* 296 /*
@@ -329,17 +320,7 @@ static void sh64_unwinder_dump(struct task_struct *task,
329 ); 320 );
330 } 321 }
331 322
332 sh64_unwind_inner(ops, data, regs); 323 printk("\nCall Trace:\n");
324 sh64_unwind_inner(regs);
333} 325}
334 326
335static struct unwinder sh64_unwinder = {
336 .name = "sh64-unwinder",
337 .dump = sh64_unwinder_dump,
338 .rating = 150,
339};
340
341static int __init sh64_unwinder_init(void)
342{
343 return unwinder_register(&sh64_unwinder);
344}
345early_initcall(sh64_unwinder_init);
diff --git a/arch/sh/kernel/cpu/shmobile/Makefile b/arch/sh/kernel/cpu/shmobile/Makefile
index e8a5111e848..a39f88ea1a8 100644
--- a/arch/sh/kernel/cpu/shmobile/Makefile
+++ b/arch/sh/kernel/cpu/shmobile/Makefile
@@ -5,3 +5,4 @@
5# Power Management & Sleep mode 5# Power Management & Sleep mode
6obj-$(CONFIG_PM) += pm.o sleep.o 6obj-$(CONFIG_PM) += pm.o sleep.o
7obj-$(CONFIG_CPU_IDLE) += cpuidle.o 7obj-$(CONFIG_CPU_IDLE) += cpuidle.o
8obj-$(CONFIG_PM_RUNTIME) += pm_runtime.o
diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c
index 1ddc876d3b2..e4469e7233c 100644
--- a/arch/sh/kernel/cpu/shmobile/cpuidle.c
+++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c
@@ -14,9 +14,9 @@
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/suspend.h> 15#include <linux/suspend.h>
16#include <linux/cpuidle.h> 16#include <linux/cpuidle.h>
17#include <linux/export.h>
18#include <asm/suspend.h> 17#include <asm/suspend.h>
19#include <asm/uaccess.h> 18#include <asm/uaccess.h>
19#include <asm/hwblk.h>
20 20
21static unsigned long cpuidle_mode[] = { 21static unsigned long cpuidle_mode[] = {
22 SUSP_SH_SLEEP, /* regular sleep mode */ 22 SUSP_SH_SLEEP, /* regular sleep mode */
@@ -25,11 +25,11 @@ static unsigned long cpuidle_mode[] = {
25}; 25};
26 26
27static int cpuidle_sleep_enter(struct cpuidle_device *dev, 27static int cpuidle_sleep_enter(struct cpuidle_device *dev,
28 struct cpuidle_driver *drv, 28 struct cpuidle_state *state)
29 int index)
30{ 29{
31 unsigned long allowed_mode = SUSP_SH_SLEEP; 30 unsigned long allowed_mode = arch_hwblk_sleep_mode();
32 int requested_state = index; 31 ktime_t before, after;
32 int requested_state = state - &dev->states[0];
33 int allowed_state; 33 int allowed_state;
34 int k; 34 int k;
35 35
@@ -46,34 +46,35 @@ static int cpuidle_sleep_enter(struct cpuidle_device *dev,
46 */ 46 */
47 k = min_t(int, allowed_state, requested_state); 47 k = min_t(int, allowed_state, requested_state);
48 48
49 dev->last_state = &dev->states[k];
50 before = ktime_get();
49 sh_mobile_call_standby(cpuidle_mode[k]); 51 sh_mobile_call_standby(cpuidle_mode[k]);
50 52 after = ktime_get();
51 return k; 53 return ktime_to_ns(ktime_sub(after, before)) >> 10;
52} 54}
53 55
54static struct cpuidle_device cpuidle_dev; 56static struct cpuidle_device cpuidle_dev;
55static struct cpuidle_driver cpuidle_driver = { 57static struct cpuidle_driver cpuidle_driver = {
56 .name = "sh_idle", 58 .name = "sh_idle",
57 .owner = THIS_MODULE, 59 .owner = THIS_MODULE,
58 .en_core_tk_irqen = 1,
59}; 60};
60 61
61void sh_mobile_setup_cpuidle(void) 62void sh_mobile_setup_cpuidle(void)
62{ 63{
63 struct cpuidle_device *dev = &cpuidle_dev; 64 struct cpuidle_device *dev = &cpuidle_dev;
64 struct cpuidle_driver *drv = &cpuidle_driver;
65 struct cpuidle_state *state; 65 struct cpuidle_state *state;
66 int i; 66 int i;
67 67
68 cpuidle_register_driver(&cpuidle_driver);
68 69
69 for (i = 0; i < CPUIDLE_STATE_MAX; i++) { 70 for (i = 0; i < CPUIDLE_STATE_MAX; i++) {
70 drv->states[i].name[0] = '\0'; 71 dev->states[i].name[0] = '\0';
71 drv->states[i].desc[0] = '\0'; 72 dev->states[i].desc[0] = '\0';
72 } 73 }
73 74
74 i = CPUIDLE_DRIVER_STATE_START; 75 i = CPUIDLE_DRIVER_STATE_START;
75 76
76 state = &drv->states[i++]; 77 state = &dev->states[i++];
77 snprintf(state->name, CPUIDLE_NAME_LEN, "C1"); 78 snprintf(state->name, CPUIDLE_NAME_LEN, "C1");
78 strncpy(state->desc, "SuperH Sleep Mode", CPUIDLE_DESC_LEN); 79 strncpy(state->desc, "SuperH Sleep Mode", CPUIDLE_DESC_LEN);
79 state->exit_latency = 1; 80 state->exit_latency = 1;
@@ -83,10 +84,10 @@ void sh_mobile_setup_cpuidle(void)
83 state->flags |= CPUIDLE_FLAG_TIME_VALID; 84 state->flags |= CPUIDLE_FLAG_TIME_VALID;
84 state->enter = cpuidle_sleep_enter; 85 state->enter = cpuidle_sleep_enter;
85 86
86 drv->safe_state_index = i-1; 87 dev->safe_state = state;
87 88
88 if (sh_mobile_sleep_supported & SUSP_SH_SF) { 89 if (sh_mobile_sleep_supported & SUSP_SH_SF) {
89 state = &drv->states[i++]; 90 state = &dev->states[i++];
90 snprintf(state->name, CPUIDLE_NAME_LEN, "C2"); 91 snprintf(state->name, CPUIDLE_NAME_LEN, "C2");
91 strncpy(state->desc, "SuperH Sleep Mode [SF]", 92 strncpy(state->desc, "SuperH Sleep Mode [SF]",
92 CPUIDLE_DESC_LEN); 93 CPUIDLE_DESC_LEN);
@@ -99,7 +100,7 @@ void sh_mobile_setup_cpuidle(void)
99 } 100 }
100 101
101 if (sh_mobile_sleep_supported & SUSP_SH_STANDBY) { 102 if (sh_mobile_sleep_supported & SUSP_SH_STANDBY) {
102 state = &drv->states[i++]; 103 state = &dev->states[i++];
103 snprintf(state->name, CPUIDLE_NAME_LEN, "C3"); 104 snprintf(state->name, CPUIDLE_NAME_LEN, "C3");
104 strncpy(state->desc, "SuperH Mobile Standby Mode [SF]", 105 strncpy(state->desc, "SuperH Mobile Standby Mode [SF]",
105 CPUIDLE_DESC_LEN); 106 CPUIDLE_DESC_LEN);
@@ -111,10 +112,7 @@ void sh_mobile_setup_cpuidle(void)
111 state->enter = cpuidle_sleep_enter; 112 state->enter = cpuidle_sleep_enter;
112 } 113 }
113 114
114 drv->state_count = i;
115 dev->state_count = i; 115 dev->state_count = i;
116 116
117 cpuidle_register_driver(&cpuidle_driver);
118
119 cpuidle_register_device(dev); 117 cpuidle_register_device(dev);
120} 118}
diff --git a/arch/sh/kernel/cpu/shmobile/pm.c b/arch/sh/kernel/cpu/shmobile/pm.c
index 08d27fac8d0..a6f95ae4aae 100644
--- a/arch/sh/kernel/cpu/shmobile/pm.c
+++ b/arch/sh/kernel/cpu/shmobile/pm.c
@@ -16,7 +16,6 @@
16#include <asm/suspend.h> 16#include <asm/suspend.h>
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
19#include <asm/bl_bit.h>
20 19
21/* 20/*
22 * Notifier lists for pre/post sleep notification 21 * Notifier lists for pre/post sleep notification
diff --git a/arch/sh/kernel/cpufreq.c b/arch/sh/kernel/cpufreq.c
index e68b45b6f3f..0fffacea6ed 100644
--- a/arch/sh/kernel/cpufreq.c
+++ b/arch/sh/kernel/cpufreq.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * cpufreq driver for the SuperH processors. 4 * cpufreq driver for the SuperH processors.
5 * 5 *
6 * Copyright (C) 2002 - 2012 Paul Mundt 6 * Copyright (C) 2002 - 2007 Paul Mundt
7 * Copyright (C) 2002 M. R. Brown 7 * Copyright (C) 2002 M. R. Brown
8 * 8 *
9 * Clock framework bits from arch/avr32/mach-at32ap/cpufreq.c 9 * Clock framework bits from arch/avr32/mach-at32ap/cpufreq.c
@@ -14,8 +14,6 @@
14 * License. See the file "COPYING" in the main directory of this archive 14 * License. See the file "COPYING" in the main directory of this archive
15 * for more details. 15 * for more details.
16 */ 16 */
17#define pr_fmt(fmt) "cpufreq: " fmt
18
19#include <linux/types.h> 17#include <linux/types.h>
20#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
21#include <linux/kernel.h> 19#include <linux/kernel.h>
@@ -23,18 +21,15 @@
23#include <linux/init.h> 21#include <linux/init.h>
24#include <linux/err.h> 22#include <linux/err.h>
25#include <linux/cpumask.h> 23#include <linux/cpumask.h>
26#include <linux/cpu.h>
27#include <linux/smp.h> 24#include <linux/smp.h>
28#include <linux/sched.h> /* set_cpus_allowed() */ 25#include <linux/sched.h> /* set_cpus_allowed() */
29#include <linux/clk.h> 26#include <linux/clk.h>
30#include <linux/percpu.h>
31#include <linux/sh_clk.h>
32 27
33static DEFINE_PER_CPU(struct clk, sh_cpuclk); 28static struct clk *cpuclk;
34 29
35static unsigned int sh_cpufreq_get(unsigned int cpu) 30static unsigned int sh_cpufreq_get(unsigned int cpu)
36{ 31{
37 return (clk_get_rate(&per_cpu(sh_cpuclk, cpu)) + 500) / 1000; 32 return (clk_get_rate(cpuclk) + 500) / 1000;
38} 33}
39 34
40/* 35/*
@@ -45,10 +40,8 @@ static int sh_cpufreq_target(struct cpufreq_policy *policy,
45 unsigned int relation) 40 unsigned int relation)
46{ 41{
47 unsigned int cpu = policy->cpu; 42 unsigned int cpu = policy->cpu;
48 struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu);
49 cpumask_t cpus_allowed; 43 cpumask_t cpus_allowed;
50 struct cpufreq_freqs freqs; 44 struct cpufreq_freqs freqs;
51 struct device *dev;
52 long freq; 45 long freq;
53 46
54 if (!cpu_online(cpu)) 47 if (!cpu_online(cpu))
@@ -59,15 +52,13 @@ static int sh_cpufreq_target(struct cpufreq_policy *policy,
59 52
60 BUG_ON(smp_processor_id() != cpu); 53 BUG_ON(smp_processor_id() != cpu);
61 54
62 dev = get_cpu_device(cpu);
63
64 /* Convert target_freq from kHz to Hz */ 55 /* Convert target_freq from kHz to Hz */
65 freq = clk_round_rate(cpuclk, target_freq * 1000); 56 freq = clk_round_rate(cpuclk, target_freq * 1000);
66 57
67 if (freq < (policy->min * 1000) || freq > (policy->max * 1000)) 58 if (freq < (policy->min * 1000) || freq > (policy->max * 1000))
68 return -EINVAL; 59 return -EINVAL;
69 60
70 dev_dbg(dev, "requested frequency %u Hz\n", target_freq * 1000); 61 pr_debug("cpufreq: requested frequency %u Hz\n", target_freq * 1000);
71 62
72 freqs.cpu = cpu; 63 freqs.cpu = cpu;
73 freqs.old = sh_cpufreq_get(cpu); 64 freqs.old = sh_cpufreq_get(cpu);
@@ -79,112 +70,78 @@ static int sh_cpufreq_target(struct cpufreq_policy *policy,
79 clk_set_rate(cpuclk, freq); 70 clk_set_rate(cpuclk, freq);
80 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 71 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
81 72
82 dev_dbg(dev, "set frequency %lu Hz\n", freq); 73 pr_debug("cpufreq: set frequency %lu Hz\n", freq);
83
84 return 0;
85}
86
87static int sh_cpufreq_verify(struct cpufreq_policy *policy)
88{
89 struct clk *cpuclk = &per_cpu(sh_cpuclk, policy->cpu);
90 struct cpufreq_frequency_table *freq_table;
91
92 freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL;
93 if (freq_table)
94 return cpufreq_frequency_table_verify(policy, freq_table);
95
96 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
97 policy->cpuinfo.max_freq);
98
99 policy->min = (clk_round_rate(cpuclk, 1) + 500) / 1000;
100 policy->max = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000;
101
102 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
103 policy->cpuinfo.max_freq);
104 74
105 return 0; 75 return 0;
106} 76}
107 77
108static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) 78static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy)
109{ 79{
110 unsigned int cpu = policy->cpu; 80 if (!cpu_online(policy->cpu))
111 struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu);
112 struct cpufreq_frequency_table *freq_table;
113 struct device *dev;
114
115 if (!cpu_online(cpu))
116 return -ENODEV; 81 return -ENODEV;
117 82
118 dev = get_cpu_device(cpu); 83 cpuclk = clk_get(NULL, "cpu_clk");
119
120 cpuclk = clk_get(dev, "cpu_clk");
121 if (IS_ERR(cpuclk)) { 84 if (IS_ERR(cpuclk)) {
122 dev_err(dev, "couldn't get CPU clk\n"); 85 printk(KERN_ERR "cpufreq: couldn't get CPU#%d clk\n",
86 policy->cpu);
123 return PTR_ERR(cpuclk); 87 return PTR_ERR(cpuclk);
124 } 88 }
125 89
126 policy->cur = policy->min = policy->max = sh_cpufreq_get(cpu); 90 /* cpuinfo and default policy values */
91 policy->cpuinfo.min_freq = (clk_round_rate(cpuclk, 1) + 500) / 1000;
92 policy->cpuinfo.max_freq = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000;
93 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
127 94
128 freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; 95 policy->cur = sh_cpufreq_get(policy->cpu);
129 if (freq_table) { 96 policy->min = policy->cpuinfo.min_freq;
130 int result; 97 policy->max = policy->cpuinfo.max_freq;
131 98
132 result = cpufreq_frequency_table_cpuinfo(policy, freq_table); 99 /*
133 if (!result) 100 * Catch the cases where the clock framework hasn't been wired up
134 cpufreq_frequency_table_get_attr(freq_table, cpu); 101 * properly to support scaling.
135 } else { 102 */
136 dev_notice(dev, "no frequency table found, falling back " 103 if (unlikely(policy->min == policy->max)) {
137 "to rate rounding.\n"); 104 printk(KERN_ERR "cpufreq: clock framework rate rounding "
105 "not supported on CPU#%d.\n", policy->cpu);
138 106
139 policy->cpuinfo.min_freq = 107 clk_put(cpuclk);
140 (clk_round_rate(cpuclk, 1) + 500) / 1000; 108 return -EINVAL;
141 policy->cpuinfo.max_freq =
142 (clk_round_rate(cpuclk, ~0UL) + 500) / 1000;
143 } 109 }
144 110
145 policy->min = policy->cpuinfo.min_freq; 111 printk(KERN_INFO "cpufreq: CPU#%d Frequencies - Minimum %u.%03u MHz, "
146 policy->max = policy->cpuinfo.max_freq;
147
148 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
149
150 dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, "
151 "Maximum %u.%03u MHz.\n", 112 "Maximum %u.%03u MHz.\n",
152 policy->min / 1000, policy->min % 1000, 113 policy->cpu, policy->min / 1000, policy->min % 1000,
153 policy->max / 1000, policy->max % 1000); 114 policy->max / 1000, policy->max % 1000);
154 115
155 return 0; 116 return 0;
156} 117}
157 118
158static int sh_cpufreq_cpu_exit(struct cpufreq_policy *policy) 119static int sh_cpufreq_verify(struct cpufreq_policy *policy)
159{ 120{
160 unsigned int cpu = policy->cpu; 121 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
161 struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu); 122 policy->cpuinfo.max_freq);
123 return 0;
124}
162 125
163 cpufreq_frequency_table_put_attr(cpu); 126static int sh_cpufreq_exit(struct cpufreq_policy *policy)
127{
164 clk_put(cpuclk); 128 clk_put(cpuclk);
165
166 return 0; 129 return 0;
167} 130}
168 131
169static struct freq_attr *sh_freq_attr[] = {
170 &cpufreq_freq_attr_scaling_available_freqs,
171 NULL,
172};
173
174static struct cpufreq_driver sh_cpufreq_driver = { 132static struct cpufreq_driver sh_cpufreq_driver = {
175 .owner = THIS_MODULE, 133 .owner = THIS_MODULE,
176 .name = "sh", 134 .name = "sh",
177 .get = sh_cpufreq_get,
178 .target = sh_cpufreq_target,
179 .verify = sh_cpufreq_verify,
180 .init = sh_cpufreq_cpu_init, 135 .init = sh_cpufreq_cpu_init,
181 .exit = sh_cpufreq_cpu_exit, 136 .verify = sh_cpufreq_verify,
182 .attr = sh_freq_attr, 137 .target = sh_cpufreq_target,
138 .get = sh_cpufreq_get,
139 .exit = sh_cpufreq_exit,
183}; 140};
184 141
185static int __init sh_cpufreq_module_init(void) 142static int __init sh_cpufreq_module_init(void)
186{ 143{
187 pr_notice("SuperH CPU frequency driver.\n"); 144 printk(KERN_INFO "cpufreq: SuperH CPU frequency driver.\n");
188 return cpufreq_register_driver(&sh_cpufreq_driver); 145 return cpufreq_register_driver(&sh_cpufreq_driver);
189} 146}
190 147
diff --git a/arch/sh/kernel/dma-nommu.c b/arch/sh/kernel/dma-nommu.c
index 5b0bfcda6d0..3c55b87f8b6 100644
--- a/arch/sh/kernel/dma-nommu.c
+++ b/arch/sh/kernel/dma-nommu.c
@@ -63,8 +63,8 @@ static void nommu_sync_sg(struct device *dev, struct scatterlist *sg,
63#endif 63#endif
64 64
65struct dma_map_ops nommu_dma_ops = { 65struct dma_map_ops nommu_dma_ops = {
66 .alloc = dma_generic_alloc_coherent, 66 .alloc_coherent = dma_generic_alloc_coherent,
67 .free = dma_generic_free_coherent, 67 .free_coherent = dma_generic_free_coherent,
68 .map_page = nommu_map_page, 68 .map_page = nommu_map_page,
69 .map_sg = nommu_map_sg, 69 .map_sg = nommu_map_sg,
70#ifdef CONFIG_DMA_NONCOHERENT 70#ifdef CONFIG_DMA_NONCOHERENT
diff --git a/arch/sh/kernel/dumpstack.c b/arch/sh/kernel/dumpstack.c
index 7617dc4129a..694158b9a50 100644
--- a/arch/sh/kernel/dumpstack.c
+++ b/arch/sh/kernel/dumpstack.c
@@ -2,48 +2,13 @@
2 * Copyright (C) 1991, 1992 Linus Torvalds 2 * Copyright (C) 1991, 1992 Linus Torvalds
3 * Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs 3 * Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs
4 * Copyright (C) 2009 Matt Fleming 4 * Copyright (C) 2009 Matt Fleming
5 * Copyright (C) 2002 - 2012 Paul Mundt
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */ 5 */
11#include <linux/kallsyms.h> 6#include <linux/kallsyms.h>
12#include <linux/ftrace.h> 7#include <linux/ftrace.h>
13#include <linux/debug_locks.h> 8#include <linux/debug_locks.h>
14#include <linux/kdebug.h>
15#include <linux/export.h>
16#include <linux/uaccess.h>
17#include <asm/unwinder.h> 9#include <asm/unwinder.h>
18#include <asm/stacktrace.h> 10#include <asm/stacktrace.h>
19 11
20void dump_mem(const char *str, unsigned long bottom, unsigned long top)
21{
22 unsigned long p;
23 int i;
24
25 printk("%s(0x%08lx to 0x%08lx)\n", str, bottom, top);
26
27 for (p = bottom & ~31; p < top; ) {
28 printk("%04lx: ", p & 0xffff);
29
30 for (i = 0; i < 8; i++, p += 4) {
31 unsigned int val;
32
33 if (p < bottom || p >= top)
34 printk(" ");
35 else {
36 if (__get_user(val, (unsigned int __user *)p)) {
37 printk("\n");
38 return;
39 }
40 printk("%08x ", val);
41 }
42 }
43 printk("\n");
44 }
45}
46
47void printk_address(unsigned long address, int reliable) 12void printk_address(unsigned long address, int reliable)
48{ 13{
49 printk(" [<%p>] %s%pS\n", (void *) address, 14 printk(" [<%p>] %s%pS\n", (void *) address,
@@ -141,26 +106,3 @@ void show_trace(struct task_struct *tsk, unsigned long *sp,
141 106
142 debug_show_held_locks(tsk); 107 debug_show_held_locks(tsk);
143} 108}
144
145void show_stack(struct task_struct *tsk, unsigned long *sp)
146{
147 unsigned long stack;
148
149 if (!tsk)
150 tsk = current;
151 if (tsk == current)
152 sp = (unsigned long *)current_stack_pointer;
153 else
154 sp = (unsigned long *)tsk->thread.sp;
155
156 stack = (unsigned long)sp;
157 dump_mem("Stack: ", stack, THREAD_SIZE +
158 (unsigned long)task_stack_page(tsk));
159 show_trace(tsk, sp, NULL);
160}
161
162void dump_stack(void)
163{
164 show_stack(NULL, NULL);
165}
166EXPORT_SYMBOL(dump_stack);
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S
index 9b6e4beeb29..2b15ae60c3a 100644
--- a/arch/sh/kernel/entry-common.S
+++ b/arch/sh/kernel/entry-common.S
@@ -139,13 +139,12 @@ work_pending:
139 ! r8: current_thread_info 139 ! r8: current_thread_info
140 ! t: result of "tst #_TIF_NEED_RESCHED, r0" 140 ! t: result of "tst #_TIF_NEED_RESCHED, r0"
141 bf/s work_resched 141 bf/s work_resched
142 tst #(_TIF_SIGPENDING | _TIF_NOTIFY_RESUME), r0 142 tst #_TIF_SIGPENDING, r0
143work_notifysig: 143work_notifysig:
144 bt/s __restore_all 144 bt/s __restore_all
145 mov r15, r4 145 mov r15, r4
146 mov r12, r5 ! set arg1(save_r0) 146 mov r12, r5 ! set arg1(save_r0)
147 mov r0, r6 147 mov r0, r6
148 sti
149 mov.l 2f, r1 148 mov.l 2f, r1
150 mov.l 3f, r0 149 mov.l 3f, r0
151 jmp @r1 150 jmp @r1
@@ -297,19 +296,6 @@ ret_from_fork:
297 mov r0, r4 296 mov r0, r4
298 bra syscall_exit 297 bra syscall_exit
299 nop 298 nop
300
301 .align 2
302 .globl ret_from_kernel_thread
303ret_from_kernel_thread:
304 mov.l 1f, r8
305 jsr @r8
306 mov r0, r4
307 mov.l @(OFF_R5,r15), r5 ! fn
308 jsr @r5
309 mov.l @(OFF_R4,r15), r4 ! arg
310 bra syscall_exit
311 nop
312
313 .align 2 299 .align 2
3141: .long schedule_tail 3001: .long schedule_tail
315 301
diff --git a/arch/sh/kernel/hw_breakpoint.c b/arch/sh/kernel/hw_breakpoint.c
index f9173766ec4..efae6ab3d54 100644
--- a/arch/sh/kernel/hw_breakpoint.c
+++ b/arch/sh/kernel/hw_breakpoint.c
@@ -22,7 +22,6 @@
22#include <asm/hw_breakpoint.h> 22#include <asm/hw_breakpoint.h>
23#include <asm/mmu_context.h> 23#include <asm/mmu_context.h>
24#include <asm/ptrace.h> 24#include <asm/ptrace.h>
25#include <asm/traps.h>
26 25
27/* 26/*
28 * Stores the breakpoints currently in use on each breakpoint address 27 * Stores the breakpoints currently in use on each breakpoint address
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
index 0c910163caa..db4ecd731a0 100644
--- a/arch/sh/kernel/idle.c
+++ b/arch/sh/kernel/idle.c
@@ -17,10 +17,10 @@
17#include <linux/irqflags.h> 17#include <linux/irqflags.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/cpuidle.h> 19#include <linux/cpuidle.h>
20#include <linux/atomic.h>
21#include <asm/pgalloc.h> 20#include <asm/pgalloc.h>
21#include <asm/system.h>
22#include <linux/atomic.h>
22#include <asm/smp.h> 23#include <asm/smp.h>
23#include <asm/bl_bit.h>
24 24
25void (*pm_idle)(void); 25void (*pm_idle)(void);
26 26
@@ -89,8 +89,7 @@ void cpu_idle(void)
89 89
90 /* endless idle loop with no priority at all */ 90 /* endless idle loop with no priority at all */
91 while (1) { 91 while (1) {
92 tick_nohz_idle_enter(); 92 tick_nohz_stop_sched_tick(1);
93 rcu_idle_enter();
94 93
95 while (!need_resched()) { 94 while (!need_resched()) {
96 check_pgt_cache(); 95 check_pgt_cache();
@@ -112,9 +111,10 @@ void cpu_idle(void)
112 start_critical_timings(); 111 start_critical_timings();
113 } 112 }
114 113
115 rcu_idle_exit(); 114 tick_nohz_restart_sched_tick();
116 tick_nohz_idle_exit(); 115 preempt_enable_no_resched();
117 schedule_preempt_disabled(); 116 schedule();
117 preempt_disable();
118 } 118 }
119} 119}
120 120
@@ -132,6 +132,10 @@ void __init select_idle_routine(void)
132 pm_idle = poll_idle; 132 pm_idle = poll_idle;
133} 133}
134 134
135static void do_nothing(void *unused)
136{
137}
138
135void stop_this_cpu(void *unused) 139void stop_this_cpu(void *unused)
136{ 140{
137 local_irq_disable(); 141 local_irq_disable();
@@ -140,3 +144,19 @@ void stop_this_cpu(void *unused)
140 for (;;) 144 for (;;)
141 cpu_sleep(); 145 cpu_sleep();
142} 146}
147
148/*
149 * cpu_idle_wait - Used to ensure that all the CPUs discard old value of
150 * pm_idle and update to new pm_idle value. Required while changing pm_idle
151 * handler on SMP systems.
152 *
153 * Caller must have changed pm_idle to the new value before the call. Old
154 * pm_idle value will not be used by any CPU after the return of this function.
155 */
156void cpu_idle_wait(void)
157{
158 smp_mb();
159 /* kick all the CPUs so that they exit out of pm_idle */
160 smp_call_function(do_nothing, NULL, 1);
161}
162EXPORT_SYMBOL_GPL(cpu_idle_wait);
diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c
index c0a9761f2f8..0f62f467275 100644
--- a/arch/sh/kernel/io_trapped.c
+++ b/arch/sh/kernel/io_trapped.c
@@ -15,6 +15,7 @@
15#include <linux/vmalloc.h> 15#include <linux/vmalloc.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <asm/system.h>
18#include <asm/mmu_context.h> 19#include <asm/mmu_context.h>
19#include <asm/uaccess.h> 20#include <asm/uaccess.h>
20#include <asm/io.h> 21#include <asm/io.h>
diff --git a/arch/sh/kernel/ioport.c b/arch/sh/kernel/ioport.c
index cca14ba84a3..e3ad6103e7c 100644
--- a/arch/sh/kernel/ioport.c
+++ b/arch/sh/kernel/ioport.c
@@ -11,7 +11,7 @@
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/io.h> 12#include <linux/io.h>
13 13
14unsigned long sh_io_port_base __read_mostly = -1; 14const unsigned long sh_io_port_base __read_mostly = -1;
15EXPORT_SYMBOL(sh_io_port_base); 15EXPORT_SYMBOL(sh_io_port_base);
16 16
17void __iomem *__ioport_map(unsigned long addr, unsigned int size) 17void __iomem *__ioport_map(unsigned long addr, unsigned int size)
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 063af10ff3c..a3ee9197112 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -231,6 +231,14 @@ void __init init_IRQ(void)
231 irq_ctx_init(smp_processor_id()); 231 irq_ctx_init(smp_processor_id());
232} 232}
233 233
234#ifdef CONFIG_SPARSE_IRQ
235int __init arch_probe_nr_irqs(void)
236{
237 nr_irqs = sh_mv.mv_nr_irqs;
238 return NR_IRQS_LEGACY;
239}
240#endif
241
234#ifdef CONFIG_HOTPLUG_CPU 242#ifdef CONFIG_HOTPLUG_CPU
235static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu) 243static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu)
236{ 244{
diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c
index 38b313909ac..efb6d398dec 100644
--- a/arch/sh/kernel/kgdb.c
+++ b/arch/sh/kernel/kgdb.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * SuperH KGDB support 2 * SuperH KGDB support
3 * 3 *
4 * Copyright (C) 2008 - 2012 Paul Mundt 4 * Copyright (C) 2008 - 2009 Paul Mundt
5 * 5 *
6 * Single stepping taken from the old stub by Henry Bell and Jeremy Siegel. 6 * Single stepping taken from the old stub by Henry Bell and Jeremy Siegel.
7 * 7 *
@@ -14,7 +14,6 @@
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
17#include <asm/traps.h>
18 17
19/* Macros for single step instruction identification */ 18/* Macros for single step instruction identification */
20#define OPCODE_BT(op) (((op) & 0xff00) == 0x8900) 19#define OPCODE_BT(op) (((op) & 0xff00) == 0x8900)
@@ -164,89 +163,42 @@ static void undo_single_step(struct pt_regs *linux_regs)
164 stepped_opcode = 0; 163 stepped_opcode = 0;
165} 164}
166 165
167struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = { 166void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
168 { "r0", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[0]) },
169 { "r1", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[1]) },
170 { "r2", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[2]) },
171 { "r3", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[3]) },
172 { "r4", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[4]) },
173 { "r5", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[5]) },
174 { "r6", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[6]) },
175 { "r7", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[7]) },
176 { "r8", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[8]) },
177 { "r9", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[9]) },
178 { "r10", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[10]) },
179 { "r11", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[11]) },
180 { "r12", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[12]) },
181 { "r13", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[13]) },
182 { "r14", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[14]) },
183 { "r15", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[15]) },
184 { "pc", GDB_SIZEOF_REG, offsetof(struct pt_regs, pc) },
185 { "pr", GDB_SIZEOF_REG, offsetof(struct pt_regs, pr) },
186 { "sr", GDB_SIZEOF_REG, offsetof(struct pt_regs, sr) },
187 { "gbr", GDB_SIZEOF_REG, offsetof(struct pt_regs, gbr) },
188 { "mach", GDB_SIZEOF_REG, offsetof(struct pt_regs, mach) },
189 { "macl", GDB_SIZEOF_REG, offsetof(struct pt_regs, macl) },
190 { "vbr", GDB_SIZEOF_REG, -1 },
191};
192
193int dbg_set_reg(int regno, void *mem, struct pt_regs *regs)
194{ 167{
195 if (regno < 0 || regno >= DBG_MAX_REG_NUM) 168 int i;
196 return -EINVAL; 169
170 for (i = 0; i < 16; i++)
171 gdb_regs[GDB_R0 + i] = regs->regs[i];
197 172
198 if (dbg_reg_def[regno].offset != -1) 173 gdb_regs[GDB_PC] = regs->pc;
199 memcpy((void *)regs + dbg_reg_def[regno].offset, mem, 174 gdb_regs[GDB_PR] = regs->pr;
200 dbg_reg_def[regno].size); 175 gdb_regs[GDB_SR] = regs->sr;
176 gdb_regs[GDB_GBR] = regs->gbr;
177 gdb_regs[GDB_MACH] = regs->mach;
178 gdb_regs[GDB_MACL] = regs->macl;
201 179
202 return 0; 180 __asm__ __volatile__ ("stc vbr, %0" : "=r" (gdb_regs[GDB_VBR]));
203} 181}
204 182
205char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) 183void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs)
206{ 184{
207 if (regno >= DBG_MAX_REG_NUM || regno < 0) 185 int i;
208 return NULL;
209 186
210 if (dbg_reg_def[regno].size != -1) 187 for (i = 0; i < 16; i++)
211 memcpy(mem, (void *)regs + dbg_reg_def[regno].offset, 188 regs->regs[GDB_R0 + i] = gdb_regs[GDB_R0 + i];
212 dbg_reg_def[regno].size);
213
214 switch (regno) {
215 case GDB_VBR:
216 __asm__ __volatile__ ("stc vbr, %0" : "=r" (mem));
217 break;
218 }
219 189
220 return dbg_reg_def[regno].name; 190 regs->pc = gdb_regs[GDB_PC];
191 regs->pr = gdb_regs[GDB_PR];
192 regs->sr = gdb_regs[GDB_SR];
193 regs->gbr = gdb_regs[GDB_GBR];
194 regs->mach = gdb_regs[GDB_MACH];
195 regs->macl = gdb_regs[GDB_MACL];
221} 196}
222 197
223void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) 198void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
224{ 199{
225 struct pt_regs *thread_regs = task_pt_regs(p);
226 int reg;
227
228 /* Initialize to zero */
229 for (reg = 0; reg < DBG_MAX_REG_NUM; reg++)
230 gdb_regs[reg] = 0;
231
232 /*
233 * Copy out GP regs 8 to 14.
234 *
235 * switch_to() relies on SR.RB toggling, so regs 0->7 are banked
236 * and need privileged instructions to get to. The r15 value we
237 * fetch from the thread info directly.
238 */
239 for (reg = GDB_R8; reg < GDB_R15; reg++)
240 gdb_regs[reg] = thread_regs->regs[reg];
241
242 gdb_regs[GDB_R15] = p->thread.sp; 200 gdb_regs[GDB_R15] = p->thread.sp;
243 gdb_regs[GDB_PC] = p->thread.pc; 201 gdb_regs[GDB_PC] = p->thread.pc;
244
245 /*
246 * Additional registers we have context for
247 */
248 gdb_regs[GDB_PR] = thread_regs->pr;
249 gdb_regs[GDB_GBR] = thread_regs->gbr;
250} 202}
251 203
252int kgdb_arch_handle_exception(int e_vector, int signo, int err_code, 204int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
@@ -311,18 +263,6 @@ BUILD_TRAP_HANDLER(singlestep)
311 local_irq_restore(flags); 263 local_irq_restore(flags);
312} 264}
313 265
314static void kgdb_call_nmi_hook(void *ignored)
315{
316 kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
317}
318
319void kgdb_roundup_cpus(unsigned long flags)
320{
321 local_irq_enable();
322 smp_call_function(kgdb_call_nmi_hook, NULL, 0);
323 local_irq_disable();
324}
325
326static int __kgdb_notify(struct die_args *args, unsigned long cmd) 266static int __kgdb_notify(struct die_args *args, unsigned long cmd)
327{ 267{
328 int ret; 268 int ret;
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index 9fea49f6e66..c5a33f007f8 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -157,6 +157,9 @@ void __init reserve_crashkernel(void)
157 unsigned long long crash_size, crash_base; 157 unsigned long long crash_size, crash_base;
158 int ret; 158 int ret;
159 159
160 /* this is necessary because of memblock_phys_mem_size() */
161 memblock_analyze();
162
160 ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(), 163 ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
161 &crash_size, &crash_base); 164 &crash_size, &crash_base);
162 if (ret == 0 && crash_size > 0) { 165 if (ret == 0 && crash_size > 0) {
diff --git a/arch/sh/kernel/machvec.c b/arch/sh/kernel/machvec.c
index ec05f491c34..3d722e49db0 100644
--- a/arch/sh/kernel/machvec.c
+++ b/arch/sh/kernel/machvec.c
@@ -121,4 +121,7 @@ void __init sh_mv_setup(void)
121 mv_set(irq_demux); 121 mv_set(irq_demux);
122 mv_set(mode_pins); 122 mv_set(mode_pins);
123 mv_set(mem_init); 123 mv_set(mem_init);
124
125 if (!sh_mv.mv_nr_irqs)
126 sh_mv.mv_nr_irqs = NR_IRQS;
124} 127}
diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c
index 068b8a2759b..2ee21a47b5a 100644
--- a/arch/sh/kernel/perf_event.c
+++ b/arch/sh/kernel/perf_event.c
@@ -25,7 +25,6 @@
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/irq.h> 26#include <linux/irq.h>
27#include <linux/perf_event.h> 27#include <linux/perf_event.h>
28#include <linux/export.h>
29#include <asm/processor.h> 28#include <asm/processor.h>
30 29
31struct cpu_hw_events { 30struct cpu_hw_events {
@@ -310,10 +309,6 @@ static int sh_pmu_event_init(struct perf_event *event)
310{ 309{
311 int err; 310 int err;
312 311
313 /* does not support taken branch sampling */
314 if (has_branch_stack(event))
315 return -EOPNOTSUPP;
316
317 switch (event->attr.type) { 312 switch (event->attr.type) {
318 case PERF_TYPE_RAW: 313 case PERF_TYPE_RAW:
319 case PERF_TYPE_HW_CACHE: 314 case PERF_TYPE_HW_CACHE:
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 055d91b7030..325f98b1736 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -2,27 +2,12 @@
2#include <linux/kernel.h> 2#include <linux/kernel.h>
3#include <linux/slab.h> 3#include <linux/slab.h>
4#include <linux/sched.h> 4#include <linux/sched.h>
5#include <linux/export.h>
6#include <linux/stackprotector.h>
7#include <asm/fpu.h>
8 5
9struct kmem_cache *task_xstate_cachep = NULL; 6struct kmem_cache *task_xstate_cachep = NULL;
10unsigned int xstate_size; 7unsigned int xstate_size;
11 8
12#ifdef CONFIG_CC_STACKPROTECTOR
13unsigned long __stack_chk_guard __read_mostly;
14EXPORT_SYMBOL(__stack_chk_guard);
15#endif
16
17/*
18 * this gets called so that we can store lazy state into memory and copy the
19 * current task into the new thread.
20 */
21int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) 9int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
22{ 10{
23#ifdef CONFIG_SUPERH32
24 unlazy_fpu(src, task_pt_regs(src));
25#endif
26 *dst = *src; 11 *dst = *src;
27 12
28 if (src->thread.xstate) { 13 if (src->thread.xstate) {
@@ -44,10 +29,52 @@ void free_thread_xstate(struct task_struct *tsk)
44 } 29 }
45} 30}
46 31
47void arch_release_task_struct(struct task_struct *tsk) 32#if THREAD_SHIFT < PAGE_SHIFT
33static struct kmem_cache *thread_info_cache;
34
35struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node)
36{
37 struct thread_info *ti;
38#ifdef CONFIG_DEBUG_STACK_USAGE
39 gfp_t mask = GFP_KERNEL | __GFP_ZERO;
40#else
41 gfp_t mask = GFP_KERNEL;
42#endif
43
44 ti = kmem_cache_alloc_node(thread_info_cache, mask, node);
45 return ti;
46}
47
48void free_thread_info(struct thread_info *ti)
49{
50 free_thread_xstate(ti->task);
51 kmem_cache_free(thread_info_cache, ti);
52}
53
54void thread_info_cache_init(void)
55{
56 thread_info_cache = kmem_cache_create("thread_info", THREAD_SIZE,
57 THREAD_SIZE, SLAB_PANIC, NULL);
58}
59#else
60struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node)
61{
62#ifdef CONFIG_DEBUG_STACK_USAGE
63 gfp_t mask = GFP_KERNEL | __GFP_ZERO;
64#else
65 gfp_t mask = GFP_KERNEL;
66#endif
67 struct page *page = alloc_pages_node(node, mask, THREAD_SIZE_ORDER);
68
69 return page ? page_address(page) : NULL;
70}
71
72void free_thread_info(struct thread_info *ti)
48{ 73{
49 free_thread_xstate(tsk); 74 free_thread_xstate(ti->task);
75 free_pages((unsigned long)ti, THREAD_SIZE_ORDER);
50} 76}
77#endif /* THREAD_SHIFT < PAGE_SHIFT */
51 78
52void arch_task_cache_init(void) 79void arch_task_cache_init(void)
53{ 80{
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c
index 73eb66fc625..aaf6d59c201 100644
--- a/arch/sh/kernel/process_32.c
+++ b/arch/sh/kernel/process_32.c
@@ -22,12 +22,11 @@
22#include <linux/ftrace.h> 22#include <linux/ftrace.h>
23#include <linux/hw_breakpoint.h> 23#include <linux/hw_breakpoint.h>
24#include <linux/prefetch.h> 24#include <linux/prefetch.h>
25#include <linux/stackprotector.h>
26#include <asm/uaccess.h> 25#include <asm/uaccess.h>
27#include <asm/mmu_context.h> 26#include <asm/mmu_context.h>
27#include <asm/system.h>
28#include <asm/fpu.h> 28#include <asm/fpu.h>
29#include <asm/syscalls.h> 29#include <asm/syscalls.h>
30#include <asm/switch_to.h>
31 30
32void show_regs(struct pt_regs * regs) 31void show_regs(struct pt_regs * regs)
33{ 32{
@@ -68,6 +67,38 @@ void show_regs(struct pt_regs * regs)
68 show_code(regs); 67 show_code(regs);
69} 68}
70 69
70/*
71 * Create a kernel thread
72 */
73ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
74{
75 do_exit(fn(arg));
76}
77
78/* Don't use this in BL=1(cli). Or else, CPU resets! */
79int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
80{
81 struct pt_regs regs;
82 int pid;
83
84 memset(&regs, 0, sizeof(regs));
85 regs.regs[4] = (unsigned long)arg;
86 regs.regs[5] = (unsigned long)fn;
87
88 regs.pc = (unsigned long)kernel_thread_helper;
89 regs.sr = SR_MD;
90#if defined(CONFIG_SH_FPU)
91 regs.sr |= SR_FD;
92#endif
93
94 /* Ok, create the new process.. */
95 pid = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
96 &regs, 0, NULL, NULL);
97
98 return pid;
99}
100EXPORT_SYMBOL(kernel_thread);
101
71void start_thread(struct pt_regs *regs, unsigned long new_pc, 102void start_thread(struct pt_regs *regs, unsigned long new_pc,
72 unsigned long new_sp) 103 unsigned long new_sp)
73{ 104{
@@ -124,11 +155,20 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
124} 155}
125EXPORT_SYMBOL(dump_fpu); 156EXPORT_SYMBOL(dump_fpu);
126 157
158/*
159 * This gets called before we allocate a new thread and copy
160 * the current task into it.
161 */
162void prepare_to_copy(struct task_struct *tsk)
163{
164 unlazy_fpu(tsk, task_pt_regs(tsk));
165}
166
127asmlinkage void ret_from_fork(void); 167asmlinkage void ret_from_fork(void);
128asmlinkage void ret_from_kernel_thread(void);
129 168
130int copy_thread(unsigned long clone_flags, unsigned long usp, 169int copy_thread(unsigned long clone_flags, unsigned long usp,
131 unsigned long arg, struct task_struct *p) 170 unsigned long unused,
171 struct task_struct *p, struct pt_regs *regs)
132{ 172{
133 struct thread_info *ti = task_thread_info(p); 173 struct thread_info *ti = task_thread_info(p);
134 struct pt_regs *childregs; 174 struct pt_regs *childregs;
@@ -145,35 +185,29 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
145 } 185 }
146#endif 186#endif
147 187
148 memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps));
149
150 childregs = task_pt_regs(p); 188 childregs = task_pt_regs(p);
151 p->thread.sp = (unsigned long) childregs; 189 *childregs = *regs;
152 if (unlikely(p->flags & PF_KTHREAD)) { 190
153 memset(childregs, 0, sizeof(struct pt_regs)); 191 if (user_mode(regs)) {
154 p->thread.pc = (unsigned long) ret_from_kernel_thread; 192 childregs->regs[15] = usp;
155 childregs->regs[4] = arg; 193 ti->addr_limit = USER_DS;
156 childregs->regs[5] = usp; 194 } else {
157 childregs->sr = SR_MD; 195 childregs->regs[15] = (unsigned long)childregs;
158#if defined(CONFIG_SH_FPU)
159 childregs->sr |= SR_FD;
160#endif
161 ti->addr_limit = KERNEL_DS; 196 ti->addr_limit = KERNEL_DS;
162 ti->status &= ~TS_USEDFPU; 197 ti->status &= ~TS_USEDFPU;
163 p->fpu_counter = 0; 198 p->fpu_counter = 0;
164 return 0;
165 } 199 }
166 *childregs = *current_pt_regs();
167
168 if (usp)
169 childregs->regs[15] = usp;
170 ti->addr_limit = USER_DS;
171 200
172 if (clone_flags & CLONE_SETTLS) 201 if (clone_flags & CLONE_SETTLS)
173 childregs->gbr = childregs->regs[0]; 202 childregs->gbr = childregs->regs[0];
174 203
175 childregs->regs[0] = 0; /* Set return value for child */ 204 childregs->regs[0] = 0; /* Set return value for child */
205
206 p->thread.sp = (unsigned long) childregs;
176 p->thread.pc = (unsigned long) ret_from_fork; 207 p->thread.pc = (unsigned long) ret_from_fork;
208
209 memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps));
210
177 return 0; 211 return 0;
178} 212}
179 213
@@ -186,10 +220,6 @@ __switch_to(struct task_struct *prev, struct task_struct *next)
186{ 220{
187 struct thread_struct *next_t = &next->thread; 221 struct thread_struct *next_t = &next->thread;
188 222
189#if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
190 __stack_chk_guard = next->stack_canary;
191#endif
192
193 unlazy_fpu(prev, task_pt_regs(prev)); 223 unlazy_fpu(prev, task_pt_regs(prev));
194 224
195 /* we're going to use this soon, after a few expensive things */ 225 /* we're going to use this soon, after a few expensive things */
@@ -217,6 +247,74 @@ __switch_to(struct task_struct *prev, struct task_struct *next)
217 return prev; 247 return prev;
218} 248}
219 249
250asmlinkage int sys_fork(unsigned long r4, unsigned long r5,
251 unsigned long r6, unsigned long r7,
252 struct pt_regs __regs)
253{
254#ifdef CONFIG_MMU
255 struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
256 return do_fork(SIGCHLD, regs->regs[15], regs, 0, NULL, NULL);
257#else
258 /* fork almost works, enough to trick you into looking elsewhere :-( */
259 return -EINVAL;
260#endif
261}
262
263asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
264 unsigned long parent_tidptr,
265 unsigned long child_tidptr,
266 struct pt_regs __regs)
267{
268 struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
269 if (!newsp)
270 newsp = regs->regs[15];
271 return do_fork(clone_flags, newsp, regs, 0,
272 (int __user *)parent_tidptr,
273 (int __user *)child_tidptr);
274}
275
276/*
277 * This is trivial, and on the face of it looks like it
278 * could equally well be done in user mode.
279 *
280 * Not so, for quite unobvious reasons - register pressure.
281 * In user mode vfork() cannot have a stack frame, and if
282 * done by calling the "clone()" system call directly, you
283 * do not have enough call-clobbered registers to hold all
284 * the information you need.
285 */
286asmlinkage int sys_vfork(unsigned long r4, unsigned long r5,
287 unsigned long r6, unsigned long r7,
288 struct pt_regs __regs)
289{
290 struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
291 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->regs[15], regs,
292 0, NULL, NULL);
293}
294
295/*
296 * sys_execve() executes a new program.
297 */
298asmlinkage int sys_execve(const char __user *ufilename,
299 const char __user *const __user *uargv,
300 const char __user *const __user *uenvp,
301 unsigned long r7, struct pt_regs __regs)
302{
303 struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
304 int error;
305 char *filename;
306
307 filename = getname(ufilename);
308 error = PTR_ERR(filename);
309 if (IS_ERR(filename))
310 goto out;
311
312 error = do_execve(filename, uargv, uenvp, regs);
313 putname(filename);
314out:
315 return error;
316}
317
220unsigned long get_wchan(struct task_struct *p) 318unsigned long get_wchan(struct task_struct *p)
221{ 319{
222 unsigned long pc; 320 unsigned long pc;
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c
index e611c85144b..210c1cabcb7 100644
--- a/arch/sh/kernel/process_64.c
+++ b/arch/sh/kernel/process_64.c
@@ -30,10 +30,8 @@
30#include <asm/pgtable.h> 30#include <asm/pgtable.h>
31#include <asm/mmu_context.h> 31#include <asm/mmu_context.h>
32#include <asm/fpu.h> 32#include <asm/fpu.h>
33#include <asm/switch_to.h>
34 33
35struct task_struct *last_task_used_math = NULL; 34struct task_struct *last_task_used_math = NULL;
36struct pt_regs fake_swapper_regs = { 0, };
37 35
38void show_regs(struct pt_regs *regs) 36void show_regs(struct pt_regs *regs)
39{ 37{
@@ -285,6 +283,39 @@ void show_regs(struct pt_regs *regs)
285} 283}
286 284
287/* 285/*
286 * Create a kernel thread
287 */
288ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
289{
290 do_exit(fn(arg));
291}
292
293/*
294 * This is the mechanism for creating a new kernel thread.
295 *
296 * NOTE! Only a kernel-only process(ie the swapper or direct descendants
297 * who haven't done an "execve()") should use this: it will work within
298 * a system call from a "real" process, but the process memory space will
299 * not be freed until both the parent and the child have exited.
300 */
301int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
302{
303 struct pt_regs regs;
304
305 memset(&regs, 0, sizeof(regs));
306 regs.regs[2] = (unsigned long)arg;
307 regs.regs[3] = (unsigned long)fn;
308
309 regs.pc = (unsigned long)kernel_thread_helper;
310 regs.sr = (1 << 30);
311
312 /* Ok, create the new process.. */
313 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
314 &regs, 0, NULL, NULL);
315}
316EXPORT_SYMBOL(kernel_thread);
317
318/*
288 * Free current thread data structures etc.. 319 * Free current thread data structures etc..
289 */ 320 */
290void exit_thread(void) 321void exit_thread(void)
@@ -368,37 +399,26 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
368EXPORT_SYMBOL(dump_fpu); 399EXPORT_SYMBOL(dump_fpu);
369 400
370asmlinkage void ret_from_fork(void); 401asmlinkage void ret_from_fork(void);
371asmlinkage void ret_from_kernel_thread(void);
372 402
373int copy_thread(unsigned long clone_flags, unsigned long usp, 403int copy_thread(unsigned long clone_flags, unsigned long usp,
374 unsigned long arg, struct task_struct *p) 404 unsigned long unused,
405 struct task_struct *p, struct pt_regs *regs)
375{ 406{
376 struct pt_regs *childregs, *regs = current_pt_regs(); 407 struct pt_regs *childregs;
377 408
378#ifdef CONFIG_SH_FPU 409#ifdef CONFIG_SH_FPU
379 /* can't happen for a kernel thread */ 410 if(last_task_used_math == current) {
380 if (last_task_used_math == current) {
381 enable_fpu(); 411 enable_fpu();
382 save_fpu(current); 412 save_fpu(current);
383 disable_fpu(); 413 disable_fpu();
384 last_task_used_math = NULL; 414 last_task_used_math = NULL;
385 current_pt_regs()->sr |= SR_FD; 415 regs->sr |= SR_FD;
386 } 416 }
387#endif 417#endif
388 /* Copy from sh version */ 418 /* Copy from sh version */
389 childregs = (struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1; 419 childregs = (struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1;
390 p->thread.sp = (unsigned long) childregs;
391 420
392 if (unlikely(p->flags & PF_KTHREAD)) { 421 *childregs = *regs;
393 memset(childregs, 0, sizeof(struct pt_regs));
394 childregs->regs[2] = (unsigned long)arg;
395 childregs->regs[3] = (unsigned long)fn;
396 childregs->sr = (1 << 30); /* not user_mode */
397 childregs->sr |= SR_FD; /* Invalidate FPU flag */
398 p->thread.pc = (unsigned long) ret_from_kernel_thread;
399 return 0;
400 }
401 *childregs = *current_pt_regs();
402 422
403 /* 423 /*
404 * Sign extend the edited stack. 424 * Sign extend the edited stack.
@@ -406,18 +426,85 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
406 * 32-bit wide and context switch must take care 426 * 32-bit wide and context switch must take care
407 * of NEFF sign extension. 427 * of NEFF sign extension.
408 */ 428 */
409 if (usp) 429 if (user_mode(regs)) {
410 childregs->regs[15] = neff_sign_extend(usp); 430 childregs->regs[15] = neff_sign_extend(usp);
411 p->thread.uregs = childregs; 431 p->thread.uregs = childregs;
432 } else {
433 childregs->regs[15] =
434 neff_sign_extend((unsigned long)task_stack_page(p) +
435 THREAD_SIZE);
436 }
412 437
413 childregs->regs[9] = 0; /* Set return value for child */ 438 childregs->regs[9] = 0; /* Set return value for child */
414 childregs->sr |= SR_FD; /* Invalidate FPU flag */ 439 childregs->sr |= SR_FD; /* Invalidate FPU flag */
415 440
441 p->thread.sp = (unsigned long) childregs;
416 p->thread.pc = (unsigned long) ret_from_fork; 442 p->thread.pc = (unsigned long) ret_from_fork;
417 443
418 return 0; 444 return 0;
419} 445}
420 446
447asmlinkage int sys_fork(unsigned long r2, unsigned long r3,
448 unsigned long r4, unsigned long r5,
449 unsigned long r6, unsigned long r7,
450 struct pt_regs *pregs)
451{
452 return do_fork(SIGCHLD, pregs->regs[15], pregs, 0, 0, 0);
453}
454
455asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
456 unsigned long r4, unsigned long r5,
457 unsigned long r6, unsigned long r7,
458 struct pt_regs *pregs)
459{
460 if (!newsp)
461 newsp = pregs->regs[15];
462 return do_fork(clone_flags, newsp, pregs, 0, 0, 0);
463}
464
465/*
466 * This is trivial, and on the face of it looks like it
467 * could equally well be done in user mode.
468 *
469 * Not so, for quite unobvious reasons - register pressure.
470 * In user mode vfork() cannot have a stack frame, and if
471 * done by calling the "clone()" system call directly, you
472 * do not have enough call-clobbered registers to hold all
473 * the information you need.
474 */
475asmlinkage int sys_vfork(unsigned long r2, unsigned long r3,
476 unsigned long r4, unsigned long r5,
477 unsigned long r6, unsigned long r7,
478 struct pt_regs *pregs)
479{
480 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, pregs->regs[15], pregs, 0, 0, 0);
481}
482
483/*
484 * sys_execve() executes a new program.
485 */
486asmlinkage int sys_execve(const char *ufilename, char **uargv,
487 char **uenvp, unsigned long r5,
488 unsigned long r6, unsigned long r7,
489 struct pt_regs *pregs)
490{
491 int error;
492 char *filename;
493
494 filename = getname((char __user *)ufilename);
495 error = PTR_ERR(filename);
496 if (IS_ERR(filename))
497 goto out;
498
499 error = do_execve(filename,
500 (const char __user *const __user *)uargv,
501 (const char __user *const __user *)uenvp,
502 pregs);
503 putname(filename);
504out:
505 return error;
506}
507
421#ifdef CONFIG_FRAME_POINTER 508#ifdef CONFIG_FRAME_POINTER
422static int in_sh64_switch_to(unsigned long pc) 509static int in_sh64_switch_to(unsigned long pc)
423{ 510{
diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c
index 81f999a672f..92b3c276339 100644
--- a/arch/sh/kernel/ptrace_32.c
+++ b/arch/sh/kernel/ptrace_32.c
@@ -28,6 +28,7 @@
28#include <linux/hw_breakpoint.h> 28#include <linux/hw_breakpoint.h>
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <asm/pgtable.h> 30#include <asm/pgtable.h>
31#include <asm/system.h>
31#include <asm/processor.h> 32#include <asm/processor.h>
32#include <asm/mmu_context.h> 33#include <asm/mmu_context.h>
33#include <asm/syscalls.h> 34#include <asm/syscalls.h>
@@ -503,7 +504,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
503{ 504{
504 long ret = 0; 505 long ret = 0;
505 506
506 secure_computing_strict(regs->regs[0]); 507 secure_computing(regs->regs[0]);
507 508
508 if (test_thread_flag(TIF_SYSCALL_TRACE) && 509 if (test_thread_flag(TIF_SYSCALL_TRACE) &&
509 tracehook_report_syscall_entry(regs)) 510 tracehook_report_syscall_entry(regs))
@@ -517,9 +518,10 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
517 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 518 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
518 trace_sys_enter(regs, regs->regs[0]); 519 trace_sys_enter(regs, regs->regs[0]);
519 520
520 audit_syscall_entry(audit_arch(), regs->regs[3], 521 if (unlikely(current->audit_context))
521 regs->regs[4], regs->regs[5], 522 audit_syscall_entry(audit_arch(), regs->regs[3],
522 regs->regs[6], regs->regs[7]); 523 regs->regs[4], regs->regs[5],
524 regs->regs[6], regs->regs[7]);
523 525
524 return ret ?: regs->regs[0]; 526 return ret ?: regs->regs[0];
525} 527}
@@ -528,7 +530,9 @@ asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
528{ 530{
529 int step; 531 int step;
530 532
531 audit_syscall_exit(regs); 533 if (unlikely(current->audit_context))
534 audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]),
535 regs->regs[0]);
532 536
533 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 537 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
534 trace_sys_exit(regs, regs->regs[0]); 538 trace_sys_exit(regs, regs->regs[0]);
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c
index af90339dadc..c8f97649f35 100644
--- a/arch/sh/kernel/ptrace_64.c
+++ b/arch/sh/kernel/ptrace_64.c
@@ -34,11 +34,11 @@
34#include <asm/io.h> 34#include <asm/io.h>
35#include <asm/uaccess.h> 35#include <asm/uaccess.h>
36#include <asm/pgtable.h> 36#include <asm/pgtable.h>
37#include <asm/system.h>
37#include <asm/processor.h> 38#include <asm/processor.h>
38#include <asm/mmu_context.h> 39#include <asm/mmu_context.h>
39#include <asm/syscalls.h> 40#include <asm/syscalls.h>
40#include <asm/fpu.h> 41#include <asm/fpu.h>
41#include <asm/traps.h>
42 42
43#define CREATE_TRACE_POINTS 43#define CREATE_TRACE_POINTS
44#include <trace/events/syscalls.h> 44#include <trace/events/syscalls.h>
@@ -522,7 +522,7 @@ asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs)
522{ 522{
523 long long ret = 0; 523 long long ret = 0;
524 524
525 secure_computing_strict(regs->regs[9]); 525 secure_computing(regs->regs[9]);
526 526
527 if (test_thread_flag(TIF_SYSCALL_TRACE) && 527 if (test_thread_flag(TIF_SYSCALL_TRACE) &&
528 tracehook_report_syscall_entry(regs)) 528 tracehook_report_syscall_entry(regs))
@@ -536,9 +536,10 @@ asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs)
536 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 536 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
537 trace_sys_enter(regs, regs->regs[9]); 537 trace_sys_enter(regs, regs->regs[9]);
538 538
539 audit_syscall_entry(audit_arch(), regs->regs[1], 539 if (unlikely(current->audit_context))
540 regs->regs[2], regs->regs[3], 540 audit_syscall_entry(audit_arch(), regs->regs[1],
541 regs->regs[4], regs->regs[5]); 541 regs->regs[2], regs->regs[3],
542 regs->regs[4], regs->regs[5]);
542 543
543 return ret ?: regs->regs[9]; 544 return ret ?: regs->regs[9];
544} 545}
@@ -547,7 +548,9 @@ asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
547{ 548{
548 int step; 549 int step;
549 550
550 audit_syscall_exit(regs); 551 if (unlikely(current->audit_context))
552 audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]),
553 regs->regs[9]);
551 554
552 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 555 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
553 trace_sys_exit(regs, regs->regs[9]); 556 trace_sys_exit(regs, regs->regs[9]);
diff --git a/arch/sh/kernel/reboot.c b/arch/sh/kernel/reboot.c
index 04afe5b2066..ca6a5ca6401 100644
--- a/arch/sh/kernel/reboot.c
+++ b/arch/sh/kernel/reboot.c
@@ -8,8 +8,8 @@
8#endif 8#endif
9#include <asm/addrspace.h> 9#include <asm/addrspace.h>
10#include <asm/reboot.h> 10#include <asm/reboot.h>
11#include <asm/system.h>
11#include <asm/tlbflush.h> 12#include <asm/tlbflush.h>
12#include <asm/traps.h>
13 13
14void (*pm_power_off)(void); 14void (*pm_power_off)(void);
15EXPORT_SYMBOL(pm_power_off); 15EXPORT_SYMBOL(pm_power_off);
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index ebe7a7d9721..58bff45d115 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -211,16 +211,13 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
211 } 211 }
212 212
213 /* 213 /*
214 * We don't know which RAM region contains kernel data or 214 * We don't know which RAM region contains kernel data,
215 * the reserved crashkernel region, so try it repeatedly 215 * so we try it repeatedly and let the resource manager
216 * and let the resource manager test it. 216 * test it.
217 */ 217 */
218 request_resource(res, &code_resource); 218 request_resource(res, &code_resource);
219 request_resource(res, &data_resource); 219 request_resource(res, &data_resource);
220 request_resource(res, &bss_resource); 220 request_resource(res, &bss_resource);
221#ifdef CONFIG_KEXEC
222 request_resource(res, &crashk_res);
223#endif
224 221
225 /* 222 /*
226 * Also make sure that there is a PMB mapping that covers this 223 * Also make sure that there is a PMB mapping that covers this
@@ -230,8 +227,7 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
230 pmb_bolt_mapping((unsigned long)__va(start), start, end - start, 227 pmb_bolt_mapping((unsigned long)__va(start), start, end - start,
231 PAGE_KERNEL); 228 PAGE_KERNEL);
232 229
233 memblock_set_node(PFN_PHYS(start_pfn), 230 add_active_range(nid, start_pfn, end_pfn);
234 PFN_PHYS(end_pfn - start_pfn), nid);
235} 231}
236 232
237void __init __weak plat_early_device_setup(void) 233void __init __weak plat_early_device_setup(void)
@@ -273,7 +269,7 @@ void __init setup_arch(char **cmdline_p)
273 data_resource.start = virt_to_phys(_etext); 269 data_resource.start = virt_to_phys(_etext);
274 data_resource.end = virt_to_phys(_edata)-1; 270 data_resource.end = virt_to_phys(_edata)-1;
275 bss_resource.start = virt_to_phys(__bss_start); 271 bss_resource.start = virt_to_phys(__bss_start);
276 bss_resource.end = virt_to_phys(__bss_stop)-1; 272 bss_resource.end = virt_to_phys(_ebss)-1;
277 273
278#ifdef CONFIG_CMDLINE_OVERWRITE 274#ifdef CONFIG_CMDLINE_OVERWRITE
279 strlcpy(command_line, CONFIG_CMDLINE, sizeof(command_line)); 275 strlcpy(command_line, CONFIG_CMDLINE, sizeof(command_line));
diff --git a/arch/sh/kernel/sh_ksyms_32.c b/arch/sh/kernel/sh_ksyms_32.c
index 2a0a596ebf6..3896f26efa4 100644
--- a/arch/sh/kernel/sh_ksyms_32.c
+++ b/arch/sh/kernel/sh_ksyms_32.c
@@ -19,6 +19,7 @@ EXPORT_SYMBOL(csum_partial);
19EXPORT_SYMBOL(csum_partial_copy_generic); 19EXPORT_SYMBOL(csum_partial_copy_generic);
20EXPORT_SYMBOL(copy_page); 20EXPORT_SYMBOL(copy_page);
21EXPORT_SYMBOL(__clear_user); 21EXPORT_SYMBOL(__clear_user);
22EXPORT_SYMBOL(_ebss);
22EXPORT_SYMBOL(empty_zero_page); 23EXPORT_SYMBOL(empty_zero_page);
23 24
24#define DECLARE_EXPORT(name) \ 25#define DECLARE_EXPORT(name) \
diff --git a/arch/sh/kernel/sh_ksyms_64.c b/arch/sh/kernel/sh_ksyms_64.c
index 26a0774f527..45afa5c51f6 100644
--- a/arch/sh/kernel/sh_ksyms_64.c
+++ b/arch/sh/kernel/sh_ksyms_64.c
@@ -32,6 +32,8 @@ EXPORT_SYMBOL(__get_user_asm_b);
32EXPORT_SYMBOL(__get_user_asm_w); 32EXPORT_SYMBOL(__get_user_asm_w);
33EXPORT_SYMBOL(__get_user_asm_l); 33EXPORT_SYMBOL(__get_user_asm_l);
34EXPORT_SYMBOL(__get_user_asm_q); 34EXPORT_SYMBOL(__get_user_asm_q);
35EXPORT_SYMBOL(__strnlen_user);
36EXPORT_SYMBOL(__strncpy_from_user);
35EXPORT_SYMBOL(__clear_user); 37EXPORT_SYMBOL(__clear_user);
36EXPORT_SYMBOL(copy_page); 38EXPORT_SYMBOL(copy_page);
37EXPORT_SYMBOL(__copy_user); 39EXPORT_SYMBOL(__copy_user);
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c
index 2f1f65356c0..579cd2ca358 100644
--- a/arch/sh/kernel/signal_32.c
+++ b/arch/sh/kernel/signal_32.c
@@ -22,8 +22,10 @@
22#include <linux/elf.h> 22#include <linux/elf.h>
23#include <linux/personality.h> 23#include <linux/personality.h>
24#include <linux/binfmts.h> 24#include <linux/binfmts.h>
25#include <linux/freezer.h>
25#include <linux/io.h> 26#include <linux/io.h>
26#include <linux/tracehook.h> 27#include <linux/tracehook.h>
28#include <asm/system.h>
27#include <asm/ucontext.h> 29#include <asm/ucontext.h>
28#include <asm/uaccess.h> 30#include <asm/uaccess.h>
29#include <asm/pgtable.h> 31#include <asm/pgtable.h>
@@ -31,6 +33,8 @@
31#include <asm/syscalls.h> 33#include <asm/syscalls.h>
32#include <asm/fpu.h> 34#include <asm/fpu.h>
33 35
36#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
37
34struct fdpic_func_descriptor { 38struct fdpic_func_descriptor {
35 unsigned long text; 39 unsigned long text;
36 unsigned long GOT; 40 unsigned long GOT;
@@ -50,11 +54,22 @@ struct fdpic_func_descriptor {
50 * Atomically swap in the new signal mask, and wait for a signal. 54 * Atomically swap in the new signal mask, and wait for a signal.
51 */ 55 */
52asmlinkage int 56asmlinkage int
53sys_sigsuspend(old_sigset_t mask) 57sys_sigsuspend(old_sigset_t mask,
58 unsigned long r5, unsigned long r6, unsigned long r7,
59 struct pt_regs __regs)
54{ 60{
55 sigset_t blocked; 61 mask &= _BLOCKABLE;
56 siginitset(&blocked, mask); 62 spin_lock_irq(&current->sighand->siglock);
57 return sigsuspend(&blocked); 63 current->saved_sigmask = current->blocked;
64 siginitset(&current->blocked, mask);
65 recalc_sigpending();
66 spin_unlock_irq(&current->sighand->siglock);
67
68 current->state = TASK_INTERRUPTIBLE;
69 schedule();
70 set_restore_sigmask();
71
72 return -ERESTARTNOHAND;
58} 73}
59 74
60asmlinkage int 75asmlinkage int
@@ -68,10 +83,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
68 old_sigset_t mask; 83 old_sigset_t mask;
69 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 84 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
70 __get_user(new_ka.sa.sa_handler, &act->sa_handler) || 85 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
71 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || 86 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
72 __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
73 __get_user(mask, &act->sa_mask))
74 return -EFAULT; 87 return -EFAULT;
88 __get_user(new_ka.sa.sa_flags, &act->sa_flags);
89 __get_user(mask, &act->sa_mask);
75 siginitset(&new_ka.sa.sa_mask, mask); 90 siginitset(&new_ka.sa.sa_mask, mask);
76 } 91 }
77 92
@@ -80,10 +95,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
80 if (!ret && oact) { 95 if (!ret && oact) {
81 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 96 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
82 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || 97 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
83 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || 98 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
84 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
85 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
86 return -EFAULT; 99 return -EFAULT;
100 __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
101 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
87 } 102 }
88 103
89 return ret; 104 return ret;
@@ -147,11 +162,12 @@ static inline int save_sigcontext_fpu(struct sigcontext __user *sc,
147 if (!(boot_cpu_data.flags & CPU_HAS_FPU)) 162 if (!(boot_cpu_data.flags & CPU_HAS_FPU))
148 return 0; 163 return 0;
149 164
150 if (!used_math()) 165 if (!used_math()) {
151 return __put_user(0, &sc->sc_ownedfp); 166 __put_user(0, &sc->sc_ownedfp);
167 return 0;
168 }
152 169
153 if (__put_user(1, &sc->sc_ownedfp)) 170 __put_user(1, &sc->sc_ownedfp);
154 return -EFAULT;
155 171
156 /* This will cause a "finit" to be triggered by the next 172 /* This will cause a "finit" to be triggered by the next
157 attempted FPU operation by the 'current' process. 173 attempted FPU operation by the 'current' process.
@@ -191,7 +207,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_p
191 regs->sr |= SR_FD; /* Release FPU */ 207 regs->sr |= SR_FD; /* Release FPU */
192 clear_fpu(tsk, regs); 208 clear_fpu(tsk, regs);
193 clear_used_math(); 209 clear_used_math();
194 err |= __get_user (owned_fp, &sc->sc_ownedfp); 210 __get_user (owned_fp, &sc->sc_ownedfp);
195 if (owned_fp) 211 if (owned_fp)
196 err |= restore_sigcontext_fpu(sc); 212 err |= restore_sigcontext_fpu(sc);
197 } 213 }
@@ -223,7 +239,12 @@ asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5,
223 sizeof(frame->extramask)))) 239 sizeof(frame->extramask))))
224 goto badframe; 240 goto badframe;
225 241
226 set_current_blocked(&set); 242 sigdelsetmask(&set, ~_BLOCKABLE);
243
244 spin_lock_irq(&current->sighand->siglock);
245 current->blocked = set;
246 recalc_sigpending();
247 spin_unlock_irq(&current->sighand->siglock);
227 248
228 if (restore_sigcontext(regs, &frame->sc, &r0)) 249 if (restore_sigcontext(regs, &frame->sc, &r0))
229 goto badframe; 250 goto badframe;
@@ -252,7 +273,11 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
252 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) 273 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
253 goto badframe; 274 goto badframe;
254 275
255 set_current_blocked(&set); 276 sigdelsetmask(&set, ~_BLOCKABLE);
277 spin_lock_irq(&current->sighand->siglock);
278 current->blocked = set;
279 recalc_sigpending();
280 spin_unlock_irq(&current->sighand->siglock);
256 281
257 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) 282 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0))
258 goto badframe; 283 goto badframe;
@@ -380,14 +405,11 @@ static int setup_frame(int sig, struct k_sigaction *ka,
380 struct fdpic_func_descriptor __user *funcptr = 405 struct fdpic_func_descriptor __user *funcptr =
381 (struct fdpic_func_descriptor __user *)ka->sa.sa_handler; 406 (struct fdpic_func_descriptor __user *)ka->sa.sa_handler;
382 407
383 err |= __get_user(regs->pc, &funcptr->text); 408 __get_user(regs->pc, &funcptr->text);
384 err |= __get_user(regs->regs[12], &funcptr->GOT); 409 __get_user(regs->regs[12], &funcptr->GOT);
385 } else 410 } else
386 regs->pc = (unsigned long)ka->sa.sa_handler; 411 regs->pc = (unsigned long)ka->sa.sa_handler;
387 412
388 if (err)
389 goto give_sigsegv;
390
391 set_fs(USER_DS); 413 set_fs(USER_DS);
392 414
393 pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n", 415 pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n",
@@ -467,14 +489,11 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
467 struct fdpic_func_descriptor __user *funcptr = 489 struct fdpic_func_descriptor __user *funcptr =
468 (struct fdpic_func_descriptor __user *)ka->sa.sa_handler; 490 (struct fdpic_func_descriptor __user *)ka->sa.sa_handler;
469 491
470 err |= __get_user(regs->pc, &funcptr->text); 492 __get_user(regs->pc, &funcptr->text);
471 err |= __get_user(regs->regs[12], &funcptr->GOT); 493 __get_user(regs->regs[12], &funcptr->GOT);
472 } else 494 } else
473 regs->pc = (unsigned long)ka->sa.sa_handler; 495 regs->pc = (unsigned long)ka->sa.sa_handler;
474 496
475 if (err)
476 goto give_sigsegv;
477
478 set_fs(USER_DS); 497 set_fs(USER_DS);
479 498
480 pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n", 499 pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n",
@@ -517,11 +536,10 @@ handle_syscall_restart(unsigned long save_r0, struct pt_regs *regs,
517/* 536/*
518 * OK, we're invoking a handler 537 * OK, we're invoking a handler
519 */ 538 */
520static void 539static int
521handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, 540handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
522 struct pt_regs *regs, unsigned int save_r0) 541 sigset_t *oldset, struct pt_regs *regs, unsigned int save_r0)
523{ 542{
524 sigset_t *oldset = sigmask_to_save();
525 int ret; 543 int ret;
526 544
527 /* Set up the stack frame */ 545 /* Set up the stack frame */
@@ -530,10 +548,19 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
530 else 548 else
531 ret = setup_frame(sig, ka, oldset, regs); 549 ret = setup_frame(sig, ka, oldset, regs);
532 550
533 if (ret) 551 if (ka->sa.sa_flags & SA_ONESHOT)
534 return; 552 ka->sa.sa_handler = SIG_DFL;
535 signal_delivered(sig, info, ka, regs, 553
536 test_thread_flag(TIF_SINGLESTEP)); 554 if (ret == 0) {
555 spin_lock_irq(&current->sighand->siglock);
556 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
557 if (!(ka->sa.sa_flags & SA_NODEFER))
558 sigaddset(&current->blocked,sig);
559 recalc_sigpending();
560 spin_unlock_irq(&current->sighand->siglock);
561 }
562
563 return ret;
537} 564}
538 565
539/* 566/*
@@ -550,6 +577,7 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
550 siginfo_t info; 577 siginfo_t info;
551 int signr; 578 int signr;
552 struct k_sigaction ka; 579 struct k_sigaction ka;
580 sigset_t *oldset;
553 581
554 /* 582 /*
555 * We want the common case to go fast, which 583 * We want the common case to go fast, which
@@ -560,15 +588,37 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
560 if (!user_mode(regs)) 588 if (!user_mode(regs))
561 return; 589 return;
562 590
591 if (try_to_freeze())
592 goto no_signal;
593
594 if (current_thread_info()->status & TS_RESTORE_SIGMASK)
595 oldset = &current->saved_sigmask;
596 else
597 oldset = &current->blocked;
598
563 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 599 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
564 if (signr > 0) { 600 if (signr > 0) {
565 handle_syscall_restart(save_r0, regs, &ka.sa); 601 handle_syscall_restart(save_r0, regs, &ka.sa);
566 602
567 /* Whee! Actually deliver the signal. */ 603 /* Whee! Actually deliver the signal. */
568 handle_signal(signr, &ka, &info, regs, save_r0); 604 if (handle_signal(signr, &ka, &info, oldset,
605 regs, save_r0) == 0) {
606 /*
607 * A signal was successfully delivered; the saved
608 * sigmask will have been stored in the signal frame,
609 * and will be restored by sigreturn, so we can simply
610 * clear the TS_RESTORE_SIGMASK flag
611 */
612 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
613
614 tracehook_signal_handler(signr, &info, &ka, regs,
615 test_thread_flag(TIF_SINGLESTEP));
616 }
617
569 return; 618 return;
570 } 619 }
571 620
621no_signal:
572 /* Did we come from a system call? */ 622 /* Did we come from a system call? */
573 if (regs->tra >= 0) { 623 if (regs->tra >= 0) {
574 /* Restart the system call - no handlers present */ 624 /* Restart the system call - no handlers present */
@@ -587,7 +637,10 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
587 * If there's no signal to deliver, we just put the saved sigmask 637 * If there's no signal to deliver, we just put the saved sigmask
588 * back. 638 * back.
589 */ 639 */
590 restore_saved_sigmask(); 640 if (current_thread_info()->status & TS_RESTORE_SIGMASK) {
641 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
642 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
643 }
591} 644}
592 645
593asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0, 646asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0,
@@ -600,5 +653,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0,
600 if (thread_info_flags & _TIF_NOTIFY_RESUME) { 653 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
601 clear_thread_flag(TIF_NOTIFY_RESUME); 654 clear_thread_flag(TIF_NOTIFY_RESUME);
602 tracehook_notify_resume(regs); 655 tracehook_notify_resume(regs);
656 if (current->replacement_session_keyring)
657 key_replace_session_keyring();
603 } 658 }
604} 659}
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index d867cd95a62..5a9f1f10ebf 100644
--- a/arch/sh/kernel/signal_64.c
+++ b/arch/sh/kernel/signal_64.c
@@ -18,6 +18,7 @@
18#include <linux/errno.h> 18#include <linux/errno.h>
19#include <linux/wait.h> 19#include <linux/wait.h>
20#include <linux/personality.h> 20#include <linux/personality.h>
21#include <linux/freezer.h>
21#include <linux/ptrace.h> 22#include <linux/ptrace.h>
22#include <linux/unistd.h> 23#include <linux/unistd.h>
23#include <linux/stddef.h> 24#include <linux/stddef.h>
@@ -40,9 +41,11 @@
40 41
41#define DEBUG_SIG 0 42#define DEBUG_SIG 0
42 43
43static void 44#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
45
46static int
44handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, 47handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
45 struct pt_regs * regs); 48 sigset_t *oldset, struct pt_regs * regs);
46 49
47static inline void 50static inline void
48handle_syscall_restart(struct pt_regs *regs, struct sigaction *sa) 51handle_syscall_restart(struct pt_regs *regs, struct sigaction *sa)
@@ -80,7 +83,7 @@ handle_syscall_restart(struct pt_regs *regs, struct sigaction *sa)
80 * the kernel can handle, and then we build all the user-level signal handling 83 * the kernel can handle, and then we build all the user-level signal handling
81 * stack-frames in one go after that. 84 * stack-frames in one go after that.
82 */ 85 */
83static void do_signal(struct pt_regs *regs) 86static int do_signal(struct pt_regs *regs, sigset_t *oldset)
84{ 87{
85 siginfo_t info; 88 siginfo_t info;
86 int signr; 89 int signr;
@@ -93,17 +96,36 @@ static void do_signal(struct pt_regs *regs)
93 * if so. 96 * if so.
94 */ 97 */
95 if (!user_mode(regs)) 98 if (!user_mode(regs))
96 return; 99 return 1;
100
101 if (try_to_freeze())
102 goto no_signal;
103
104 if (current_thread_info()->status & TS_RESTORE_SIGMASK)
105 oldset = &current->saved_sigmask;
106 else if (!oldset)
107 oldset = &current->blocked;
97 108
98 signr = get_signal_to_deliver(&info, &ka, regs, 0); 109 signr = get_signal_to_deliver(&info, &ka, regs, 0);
99 if (signr > 0) { 110 if (signr > 0) {
100 handle_syscall_restart(regs, &ka.sa); 111 handle_syscall_restart(regs, &ka.sa);
101 112
102 /* Whee! Actually deliver the signal. */ 113 /* Whee! Actually deliver the signal. */
103 handle_signal(signr, &info, &ka, regs); 114 if (handle_signal(signr, &info, &ka, oldset, regs) == 0) {
104 return; 115 /*
116 * If a signal was successfully delivered, the
117 * saved sigmask is in its frame, and we can
118 * clear the TS_RESTORE_SIGMASK flag.
119 */
120 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
121
122 tracehook_signal_handler(signr, &info, &ka, regs,
123 test_thread_flag(TIF_SINGLESTEP));
124 return 1;
125 }
105 } 126 }
106 127
128no_signal:
107 /* Did we come from a system call? */ 129 /* Did we come from a system call? */
108 if (regs->syscall_nr >= 0) { 130 if (regs->syscall_nr >= 0) {
109 /* Restart the system call - no handlers present */ 131 /* Restart the system call - no handlers present */
@@ -124,18 +146,80 @@ static void do_signal(struct pt_regs *regs)
124 } 146 }
125 147
126 /* No signal to deliver -- put the saved sigmask back */ 148 /* No signal to deliver -- put the saved sigmask back */
127 restore_saved_sigmask(); 149 if (current_thread_info()->status & TS_RESTORE_SIGMASK) {
150 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
151 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
152 }
153
154 return 0;
128} 155}
129 156
130/* 157/*
131 * Atomically swap in the new signal mask, and wait for a signal. 158 * Atomically swap in the new signal mask, and wait for a signal.
132 */ 159 */
133asmlinkage int 160asmlinkage int
134sys_sigsuspend(old_sigset_t mask) 161sys_sigsuspend(old_sigset_t mask,
162 unsigned long r3, unsigned long r4, unsigned long r5,
163 unsigned long r6, unsigned long r7,
164 struct pt_regs * regs)
165{
166 sigset_t saveset;
167
168 mask &= _BLOCKABLE;
169 spin_lock_irq(&current->sighand->siglock);
170 saveset = current->blocked;
171 siginitset(&current->blocked, mask);
172 recalc_sigpending();
173 spin_unlock_irq(&current->sighand->siglock);
174
175 REF_REG_RET = -EINTR;
176 while (1) {
177 current->state = TASK_INTERRUPTIBLE;
178 schedule();
179 set_restore_sigmask();
180 regs->pc += 4; /* because sys_sigreturn decrements the pc */
181 if (do_signal(regs, &saveset)) {
182 /* pc now points at signal handler. Need to decrement
183 it because entry.S will increment it. */
184 regs->pc -= 4;
185 return -EINTR;
186 }
187 }
188}
189
190asmlinkage int
191sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize,
192 unsigned long r4, unsigned long r5, unsigned long r6,
193 unsigned long r7,
194 struct pt_regs * regs)
135{ 195{
136 sigset_t blocked; 196 sigset_t saveset, newset;
137 siginitset(&blocked, mask); 197
138 return sigsuspend(&blocked); 198 /* XXX: Don't preclude handling different sized sigset_t's. */
199 if (sigsetsize != sizeof(sigset_t))
200 return -EINVAL;
201
202 if (copy_from_user(&newset, unewset, sizeof(newset)))
203 return -EFAULT;
204 sigdelsetmask(&newset, ~_BLOCKABLE);
205 spin_lock_irq(&current->sighand->siglock);
206 saveset = current->blocked;
207 current->blocked = newset;
208 recalc_sigpending();
209 spin_unlock_irq(&current->sighand->siglock);
210
211 REF_REG_RET = -EINTR;
212 while (1) {
213 current->state = TASK_INTERRUPTIBLE;
214 schedule();
215 regs->pc += 4; /* because sys_sigreturn decrements the pc */
216 if (do_signal(regs, &saveset)) {
217 /* pc now points at signal handler. Need to decrement
218 it because entry.S will increment it. */
219 regs->pc -= 4;
220 return -EINTR;
221 }
222 }
139} 223}
140 224
141asmlinkage int 225asmlinkage int
@@ -149,10 +233,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
149 old_sigset_t mask; 233 old_sigset_t mask;
150 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 234 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
151 __get_user(new_ka.sa.sa_handler, &act->sa_handler) || 235 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
152 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || 236 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
153 __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
154 __get_user(mask, &act->sa_mask))
155 return -EFAULT; 237 return -EFAULT;
238 __get_user(new_ka.sa.sa_flags, &act->sa_flags);
239 __get_user(mask, &act->sa_mask);
156 siginitset(&new_ka.sa.sa_mask, mask); 240 siginitset(&new_ka.sa.sa_mask, mask);
157 } 241 }
158 242
@@ -161,10 +245,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
161 if (!ret && oact) { 245 if (!ret && oact) {
162 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 246 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
163 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || 247 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
164 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || 248 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
165 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
166 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
167 return -EFAULT; 249 return -EFAULT;
250 __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
251 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
168 } 252 }
169 253
170 return ret; 254 return ret;
@@ -327,7 +411,12 @@ asmlinkage int sys_sigreturn(unsigned long r2, unsigned long r3,
327 sizeof(frame->extramask)))) 411 sizeof(frame->extramask))))
328 goto badframe; 412 goto badframe;
329 413
330 set_current_blocked(&set); 414 sigdelsetmask(&set, ~_BLOCKABLE);
415
416 spin_lock_irq(&current->sighand->siglock);
417 current->blocked = set;
418 recalc_sigpending();
419 spin_unlock_irq(&current->sighand->siglock);
331 420
332 if (restore_sigcontext(regs, &frame->sc, &ret)) 421 if (restore_sigcontext(regs, &frame->sc, &ret))
333 goto badframe; 422 goto badframe;
@@ -347,6 +436,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3,
347{ 436{
348 struct rt_sigframe __user *frame = (struct rt_sigframe __user *) (long) REF_REG_SP; 437 struct rt_sigframe __user *frame = (struct rt_sigframe __user *) (long) REF_REG_SP;
349 sigset_t set; 438 sigset_t set;
439 stack_t __user st;
350 long long ret; 440 long long ret;
351 441
352 /* Always make any pending restarted system calls return -EINTR */ 442 /* Always make any pending restarted system calls return -EINTR */
@@ -358,16 +448,21 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3,
358 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) 448 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
359 goto badframe; 449 goto badframe;
360 450
361 set_current_blocked(&set); 451 sigdelsetmask(&set, ~_BLOCKABLE);
452 spin_lock_irq(&current->sighand->siglock);
453 current->blocked = set;
454 recalc_sigpending();
455 spin_unlock_irq(&current->sighand->siglock);
362 456
363 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ret)) 457 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ret))
364 goto badframe; 458 goto badframe;
365 regs->pc -= 4; 459 regs->pc -= 4;
366 460
461 if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
462 goto badframe;
367 /* It is more difficult to avoid calling this function than to 463 /* It is more difficult to avoid calling this function than to
368 call it and ignore errors. */ 464 call it and ignore errors. */
369 if (do_sigaltstack(&frame->uc.uc_stack, NULL, REF_REG_SP) == -EFAULT) 465 do_sigaltstack(&st, NULL, REF_REG_SP);
370 goto badframe;
371 466
372 return (int) ret; 467 return (int) ret;
373 468
@@ -631,11 +726,10 @@ give_sigsegv:
631/* 726/*
632 * OK, we're invoking a handler 727 * OK, we're invoking a handler
633 */ 728 */
634static void 729static int
635handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, 730handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
636 struct pt_regs * regs) 731 sigset_t *oldset, struct pt_regs * regs)
637{ 732{
638 sigset_t *oldset = sigmask_to_save();
639 int ret; 733 int ret;
640 734
641 /* Set up the stack frame */ 735 /* Set up the stack frame */
@@ -644,20 +738,30 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
644 else 738 else
645 ret = setup_frame(sig, ka, oldset, regs); 739 ret = setup_frame(sig, ka, oldset, regs);
646 740
647 if (ret) 741 if (ka->sa.sa_flags & SA_ONESHOT)
648 return; 742 ka->sa.sa_handler = SIG_DFL;
649 743
650 signal_delivered(sig, info, ka, regs, 744 if (ret == 0) {
651 test_thread_flag(TIF_SINGLESTEP)); 745 spin_lock_irq(&current->sighand->siglock);
746 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
747 if (!(ka->sa.sa_flags & SA_NODEFER))
748 sigaddset(&current->blocked,sig);
749 recalc_sigpending();
750 spin_unlock_irq(&current->sighand->siglock);
751 }
752
753 return ret;
652} 754}
653 755
654asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) 756asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
655{ 757{
656 if (thread_info_flags & _TIF_SIGPENDING) 758 if (thread_info_flags & _TIF_SIGPENDING)
657 do_signal(regs); 759 do_signal(regs, 0);
658 760
659 if (thread_info_flags & _TIF_NOTIFY_RESUME) { 761 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
660 clear_thread_flag(TIF_NOTIFY_RESUME); 762 clear_thread_flag(TIF_NOTIFY_RESUME);
661 tracehook_notify_resume(regs); 763 tracehook_notify_resume(regs);
764 if (current->replacement_session_keyring)
765 key_replace_session_keyring();
662 } 766 }
663} 767}
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 2062aa88af4..3147a9a6fb8 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -23,11 +23,11 @@
23#include <linux/sched.h> 23#include <linux/sched.h>
24#include <linux/atomic.h> 24#include <linux/atomic.h>
25#include <asm/processor.h> 25#include <asm/processor.h>
26#include <asm/system.h>
26#include <asm/mmu_context.h> 27#include <asm/mmu_context.h>
27#include <asm/smp.h> 28#include <asm/smp.h>
28#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
29#include <asm/sections.h> 30#include <asm/sections.h>
30#include <asm/setup.h>
31 31
32int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ 32int __cpu_number_map[NR_CPUS]; /* Map physical to logical */
33int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ 33int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */
@@ -63,7 +63,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
63 mp_ops->prepare_cpus(max_cpus); 63 mp_ops->prepare_cpus(max_cpus);
64 64
65#ifndef CONFIG_HOTPLUG_CPU 65#ifndef CONFIG_HOTPLUG_CPU
66 init_cpu_present(cpu_possible_mask); 66 init_cpu_present(&cpu_possible_map);
67#endif 67#endif
68} 68}
69 69
@@ -123,6 +123,7 @@ void native_play_dead(void)
123int __cpu_disable(void) 123int __cpu_disable(void)
124{ 124{
125 unsigned int cpu = smp_processor_id(); 125 unsigned int cpu = smp_processor_id();
126 struct task_struct *p;
126 int ret; 127 int ret;
127 128
128 ret = mp_ops->cpu_disable(cpu); 129 ret = mp_ops->cpu_disable(cpu);
@@ -152,7 +153,11 @@ int __cpu_disable(void)
152 flush_cache_all(); 153 flush_cache_all();
153 local_flush_tlb_all(); 154 local_flush_tlb_all();
154 155
155 clear_tasks_mm_cpumask(cpu); 156 read_lock(&tasklist_lock);
157 for_each_process(p)
158 if (p->mm)
159 cpumask_clear_cpu(cpu, mm_cpumask(p->mm));
160 read_unlock(&tasklist_lock);
156 161
157 return 0; 162 return 0;
158} 163}
@@ -215,10 +220,22 @@ extern struct {
215 void *thread_info; 220 void *thread_info;
216} stack_start; 221} stack_start;
217 222
218int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tsk) 223int __cpuinit __cpu_up(unsigned int cpu)
219{ 224{
225 struct task_struct *tsk;
220 unsigned long timeout; 226 unsigned long timeout;
221 227
228 tsk = cpu_data[cpu].idle;
229 if (!tsk) {
230 tsk = fork_idle(cpu);
231 if (IS_ERR(tsk)) {
232 pr_err("Failed forking idle task for cpu %d\n", cpu);
233 return PTR_ERR(tsk);
234 }
235
236 cpu_data[cpu].idle = tsk;
237 }
238
222 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; 239 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
223 240
224 /* Fill in data in head.S for secondary cpus */ 241 /* Fill in data in head.S for secondary cpus */
diff --git a/arch/sh/kernel/sys_sh32.c b/arch/sh/kernel/sys_sh32.c
index 497bab3a040..f56b6fe5c5d 100644
--- a/arch/sh/kernel/sys_sh32.c
+++ b/arch/sh/kernel/sys_sh32.c
@@ -60,3 +60,27 @@ asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1,
60 (u64)len0 << 32 | len1, advice); 60 (u64)len0 << 32 | len1, advice);
61#endif 61#endif
62} 62}
63
64#if defined(CONFIG_CPU_SH2) || defined(CONFIG_CPU_SH2A)
65#define SYSCALL_ARG3 "trapa #0x23"
66#else
67#define SYSCALL_ARG3 "trapa #0x13"
68#endif
69
70/*
71 * Do a system call from kernel instead of calling sys_execve so we
72 * end up with proper pt_regs.
73 */
74int kernel_execve(const char *filename,
75 const char *const argv[],
76 const char *const envp[])
77{
78 register long __sc0 __asm__ ("r3") = __NR_execve;
79 register long __sc4 __asm__ ("r4") = (long) filename;
80 register long __sc5 __asm__ ("r5") = (long) argv;
81 register long __sc6 __asm__ ("r6") = (long) envp;
82 __asm__ __volatile__ (SYSCALL_ARG3 : "=z" (__sc0)
83 : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6)
84 : "memory");
85 return __sc0;
86}
diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S
index fe97ae5e56f..293e39c59c0 100644
--- a/arch/sh/kernel/syscalls_32.S
+++ b/arch/sh/kernel/syscalls_32.S
@@ -204,8 +204,8 @@ ENTRY(sys_call_table)
204 .long sys_capset /* 185 */ 204 .long sys_capset /* 185 */
205 .long sys_sigaltstack 205 .long sys_sigaltstack
206 .long sys_sendfile 206 .long sys_sendfile
207 .long sys_ni_syscall /* getpmsg */ 207 .long sys_ni_syscall /* streams1 */
208 .long sys_ni_syscall /* putpmsg */ 208 .long sys_ni_syscall /* streams2 */
209 .long sys_vfork /* 190 */ 209 .long sys_vfork /* 190 */
210 .long sys_getrlimit 210 .long sys_getrlimit
211 .long sys_mmap2 211 .long sys_mmap2
@@ -259,8 +259,8 @@ ENTRY(sys_call_table)
259 .long sys_futex /* 240 */ 259 .long sys_futex /* 240 */
260 .long sys_sched_setaffinity 260 .long sys_sched_setaffinity
261 .long sys_sched_getaffinity 261 .long sys_sched_getaffinity
262 .long sys_ni_syscall /* reserved for set_thread_area */ 262 .long sys_ni_syscall
263 .long sys_ni_syscall /* reserved for get_thread_area */ 263 .long sys_ni_syscall
264 .long sys_io_setup /* 245 */ 264 .long sys_io_setup /* 245 */
265 .long sys_io_destroy 265 .long sys_io_destroy
266 .long sys_io_getevents 266 .long sys_io_getevents
@@ -382,6 +382,3 @@ ENTRY(sys_call_table)
382 .long sys_syncfs 382 .long sys_syncfs
383 .long sys_sendmmsg 383 .long sys_sendmmsg
384 .long sys_setns 384 .long sys_setns
385 .long sys_process_vm_readv /* 365 */
386 .long sys_process_vm_writev
387 .long sys_kcmp
diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S
index 5c7b1c67bdc..ceb34b94afa 100644
--- a/arch/sh/kernel/syscalls_64.S
+++ b/arch/sh/kernel/syscalls_64.S
@@ -208,8 +208,8 @@ sys_call_table:
208 .long sys_capset /* 185 */ 208 .long sys_capset /* 185 */
209 .long sys_sigaltstack 209 .long sys_sigaltstack
210 .long sys_sendfile 210 .long sys_sendfile
211 .long sys_ni_syscall /* getpmsg */ 211 .long sys_ni_syscall /* streams1 */
212 .long sys_ni_syscall /* putpmsg */ 212 .long sys_ni_syscall /* streams2 */
213 .long sys_vfork /* 190 */ 213 .long sys_vfork /* 190 */
214 .long sys_getrlimit 214 .long sys_getrlimit
215 .long sys_mmap2 215 .long sys_mmap2
@@ -296,8 +296,8 @@ sys_call_table:
296 .long sys_futex 296 .long sys_futex
297 .long sys_sched_setaffinity 297 .long sys_sched_setaffinity
298 .long sys_sched_getaffinity /* 270 */ 298 .long sys_sched_getaffinity /* 270 */
299 .long sys_ni_syscall /* reserved for set_thread_area */ 299 .long sys_ni_syscall
300 .long sys_ni_syscall /* reserved for get_thread_area */ 300 .long sys_ni_syscall
301 .long sys_io_setup 301 .long sys_io_setup
302 .long sys_io_destroy 302 .long sys_io_destroy
303 .long sys_io_getevents /* 275 */ 303 .long sys_io_getevents /* 275 */
@@ -402,6 +402,3 @@ sys_call_table:
402 .long sys_syncfs 402 .long sys_syncfs
403 .long sys_sendmmsg 403 .long sys_sendmmsg
404 .long sys_setns /* 375 */ 404 .long sys_setns /* 375 */
405 .long sys_process_vm_readv
406 .long sys_process_vm_writev
407 .long sys_kcmp
diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c
index 552c8fcf941..8a0072de2bc 100644
--- a/arch/sh/kernel/time.c
+++ b/arch/sh/kernel/time.c
@@ -21,6 +21,7 @@
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/rtc.h> 22#include <linux/rtc.h>
23#include <asm/clock.h> 23#include <asm/clock.h>
24#include <asm/hwblk.h>
24#include <asm/rtc.h> 25#include <asm/rtc.h>
25 26
26/* Dummy RTC ops */ 27/* Dummy RTC ops */
@@ -109,6 +110,7 @@ void __init time_init(void)
109 if (board_time_init) 110 if (board_time_init)
110 board_time_init(); 111 board_time_init();
111 112
113 hwblk_init();
112 clk_init(); 114 clk_init();
113 115
114 late_time_init = sh_late_time_init; 116 late_time_init = sh_late_time_init;
diff --git a/arch/sh/kernel/topology.c b/arch/sh/kernel/topology.c
index 772caffba22..38e862852dd 100644
--- a/arch/sh/kernel/topology.c
+++ b/arch/sh/kernel/topology.c
@@ -11,10 +11,8 @@
11#include <linux/cpumask.h> 11#include <linux/cpumask.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/percpu.h> 13#include <linux/percpu.h>
14#include <linux/topology.h>
15#include <linux/node.h> 14#include <linux/node.h>
16#include <linux/nodemask.h> 15#include <linux/nodemask.h>
17#include <linux/export.h>
18 16
19static DEFINE_PER_CPU(struct cpu, cpu_devices); 17static DEFINE_PER_CPU(struct cpu, cpu_devices);
20 18
@@ -27,7 +25,7 @@ static cpumask_t cpu_coregroup_map(unsigned int cpu)
27 * Presently all SH-X3 SMP cores are multi-cores, so just keep it 25 * Presently all SH-X3 SMP cores are multi-cores, so just keep it
28 * simple until we have a method for determining topology.. 26 * simple until we have a method for determining topology..
29 */ 27 */
30 return *cpu_possible_mask; 28 return cpu_possible_map;
31} 29}
32 30
33const struct cpumask *cpu_coregroup_mask(unsigned int cpu) 31const struct cpumask *cpu_coregroup_mask(unsigned int cpu)
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
index 72246bc0688..0830c2a9f71 100644
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -6,79 +6,8 @@
6#include <linux/sched.h> 6#include <linux/sched.h>
7#include <linux/uaccess.h> 7#include <linux/uaccess.h>
8#include <linux/hardirq.h> 8#include <linux/hardirq.h>
9#include <linux/kernel.h>
10#include <linux/kexec.h>
11#include <linux/module.h>
12#include <asm/unwinder.h> 9#include <asm/unwinder.h>
13#include <asm/traps.h> 10#include <asm/system.h>
14
15static DEFINE_SPINLOCK(die_lock);
16
17void die(const char *str, struct pt_regs *regs, long err)
18{
19 static int die_counter;
20
21 oops_enter();
22
23 spin_lock_irq(&die_lock);
24 console_verbose();
25 bust_spinlocks(1);
26
27 printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
28 print_modules();
29 show_regs(regs);
30
31 printk("Process: %s (pid: %d, stack limit = %p)\n", current->comm,
32 task_pid_nr(current), task_stack_page(current) + 1);
33
34 if (!user_mode(regs) || in_interrupt())
35 dump_mem("Stack: ", regs->regs[15], THREAD_SIZE +
36 (unsigned long)task_stack_page(current));
37
38 notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV);
39
40 bust_spinlocks(0);
41 add_taint(TAINT_DIE);
42 spin_unlock_irq(&die_lock);
43 oops_exit();
44
45 if (kexec_should_crash(current))
46 crash_kexec(regs);
47
48 if (in_interrupt())
49 panic("Fatal exception in interrupt");
50
51 if (panic_on_oops)
52 panic("Fatal exception");
53
54 do_exit(SIGSEGV);
55}
56
57void die_if_kernel(const char *str, struct pt_regs *regs, long err)
58{
59 if (!user_mode(regs))
60 die(str, regs, err);
61}
62
63/*
64 * try and fix up kernelspace address errors
65 * - userspace errors just cause EFAULT to be returned, resulting in SEGV
66 * - kernel/userspace interfaces cause a jump to an appropriate handler
67 * - other kernel errors are bad
68 */
69void die_if_no_fixup(const char *str, struct pt_regs *regs, long err)
70{
71 if (!user_mode(regs)) {
72 const struct exception_table_entry *fixup;
73 fixup = search_exception_tables(regs->pc);
74 if (fixup) {
75 regs->pc = fixup->fixup;
76 return;
77 }
78
79 die(str, regs, err);
80 }
81}
82 11
83#ifdef CONFIG_GENERIC_BUG 12#ifdef CONFIG_GENERIC_BUG
84static void handle_BUG(struct pt_regs *regs) 13static void handle_BUG(struct pt_regs *regs)
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c
index 5f513a64ded..7bbef95c9d1 100644
--- a/arch/sh/kernel/traps_32.c
+++ b/arch/sh/kernel/traps_32.c
@@ -16,20 +16,21 @@
16#include <linux/hardirq.h> 16#include <linux/hardirq.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include <linux/module.h>
19#include <linux/kallsyms.h> 20#include <linux/kallsyms.h>
20#include <linux/io.h> 21#include <linux/io.h>
21#include <linux/bug.h> 22#include <linux/bug.h>
22#include <linux/debug_locks.h> 23#include <linux/debug_locks.h>
23#include <linux/kdebug.h> 24#include <linux/kdebug.h>
25#include <linux/kexec.h>
24#include <linux/limits.h> 26#include <linux/limits.h>
25#include <linux/sysfs.h> 27#include <linux/sysfs.h>
26#include <linux/uaccess.h> 28#include <linux/uaccess.h>
27#include <linux/perf_event.h> 29#include <linux/perf_event.h>
30#include <asm/system.h>
28#include <asm/alignment.h> 31#include <asm/alignment.h>
29#include <asm/fpu.h> 32#include <asm/fpu.h>
30#include <asm/kprobes.h> 33#include <asm/kprobes.h>
31#include <asm/traps.h>
32#include <asm/bl_bit.h>
33 34
34#ifdef CONFIG_CPU_SH2 35#ifdef CONFIG_CPU_SH2
35# define TRAP_RESERVED_INST 4 36# define TRAP_RESERVED_INST 4
@@ -46,6 +47,102 @@
46#define TRAP_ILLEGAL_SLOT_INST 13 47#define TRAP_ILLEGAL_SLOT_INST 13
47#endif 48#endif
48 49
50static void dump_mem(const char *str, unsigned long bottom, unsigned long top)
51{
52 unsigned long p;
53 int i;
54
55 printk("%s(0x%08lx to 0x%08lx)\n", str, bottom, top);
56
57 for (p = bottom & ~31; p < top; ) {
58 printk("%04lx: ", p & 0xffff);
59
60 for (i = 0; i < 8; i++, p += 4) {
61 unsigned int val;
62
63 if (p < bottom || p >= top)
64 printk(" ");
65 else {
66 if (__get_user(val, (unsigned int __user *)p)) {
67 printk("\n");
68 return;
69 }
70 printk("%08x ", val);
71 }
72 }
73 printk("\n");
74 }
75}
76
77static DEFINE_SPINLOCK(die_lock);
78
79void die(const char * str, struct pt_regs * regs, long err)
80{
81 static int die_counter;
82
83 oops_enter();
84
85 spin_lock_irq(&die_lock);
86 console_verbose();
87 bust_spinlocks(1);
88
89 printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
90 print_modules();
91 show_regs(regs);
92
93 printk("Process: %s (pid: %d, stack limit = %p)\n", current->comm,
94 task_pid_nr(current), task_stack_page(current) + 1);
95
96 if (!user_mode(regs) || in_interrupt())
97 dump_mem("Stack: ", regs->regs[15], THREAD_SIZE +
98 (unsigned long)task_stack_page(current));
99
100 notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV);
101
102 bust_spinlocks(0);
103 add_taint(TAINT_DIE);
104 spin_unlock_irq(&die_lock);
105 oops_exit();
106
107 if (kexec_should_crash(current))
108 crash_kexec(regs);
109
110 if (in_interrupt())
111 panic("Fatal exception in interrupt");
112
113 if (panic_on_oops)
114 panic("Fatal exception");
115
116 do_exit(SIGSEGV);
117}
118
119static inline void die_if_kernel(const char *str, struct pt_regs *regs,
120 long err)
121{
122 if (!user_mode(regs))
123 die(str, regs, err);
124}
125
126/*
127 * try and fix up kernelspace address errors
128 * - userspace errors just cause EFAULT to be returned, resulting in SEGV
129 * - kernel/userspace interfaces cause a jump to an appropriate handler
130 * - other kernel errors are bad
131 */
132static void die_if_no_fixup(const char * str, struct pt_regs * regs, long err)
133{
134 if (!user_mode(regs)) {
135 const struct exception_table_entry *fixup;
136 fixup = search_exception_tables(regs->pc);
137 if (fixup) {
138 regs->pc = fixup->fixup;
139 return;
140 }
141
142 die(str, regs, err);
143 }
144}
145
49static inline void sign_extend(unsigned int count, unsigned char *dst) 146static inline void sign_extend(unsigned int count, unsigned char *dst)
50{ 147{
51#ifdef __LITTLE_ENDIAN__ 148#ifdef __LITTLE_ENDIAN__
@@ -802,3 +899,26 @@ void __init trap_init(void)
802 set_exception_table_vec(TRAP_UBC, breakpoint_trap_handler); 899 set_exception_table_vec(TRAP_UBC, breakpoint_trap_handler);
803#endif 900#endif
804} 901}
902
903void show_stack(struct task_struct *tsk, unsigned long *sp)
904{
905 unsigned long stack;
906
907 if (!tsk)
908 tsk = current;
909 if (tsk == current)
910 sp = (unsigned long *)current_stack_pointer;
911 else
912 sp = (unsigned long *)tsk->thread.sp;
913
914 stack = (unsigned long)sp;
915 dump_mem("Stack: ", stack, THREAD_SIZE +
916 (unsigned long)task_stack_page(tsk));
917 show_trace(tsk, sp, NULL);
918}
919
920void dump_stack(void)
921{
922 show_stack(NULL, NULL);
923}
924EXPORT_SYMBOL(dump_stack);
diff --git a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c
index f87d20da179..cd3a4048329 100644
--- a/arch/sh/kernel/traps_64.c
+++ b/arch/sh/kernel/traps_64.c
@@ -25,27 +25,288 @@
25#include <linux/sysctl.h> 25#include <linux/sysctl.h>
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/perf_event.h> 27#include <linux/perf_event.h>
28#include <asm/system.h>
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
29#include <asm/io.h> 30#include <asm/io.h>
30#include <asm/alignment.h> 31#include <linux/atomic.h>
31#include <asm/processor.h> 32#include <asm/processor.h>
32#include <asm/pgtable.h> 33#include <asm/pgtable.h>
33#include <asm/fpu.h> 34#include <asm/fpu.h>
34 35
35static int read_opcode(reg_size_t pc, insn_size_t *result_opcode, int from_user_mode) 36#undef DEBUG_EXCEPTION
37#ifdef DEBUG_EXCEPTION
38/* implemented in ../lib/dbg.c */
39extern void show_excp_regs(char *fname, int trapnr, int signr,
40 struct pt_regs *regs);
41#else
42#define show_excp_regs(a, b, c, d)
43#endif
44
45static void do_unhandled_exception(int trapnr, int signr, char *str, char *fn_name,
46 unsigned long error_code, struct pt_regs *regs, struct task_struct *tsk);
47
48#define DO_ERROR(trapnr, signr, str, name, tsk) \
49asmlinkage void do_##name(unsigned long error_code, struct pt_regs *regs) \
50{ \
51 do_unhandled_exception(trapnr, signr, str, __stringify(name), error_code, regs, current); \
52}
53
54static DEFINE_SPINLOCK(die_lock);
55
56void die(const char * str, struct pt_regs * regs, long err)
57{
58 console_verbose();
59 spin_lock_irq(&die_lock);
60 printk("%s: %lx\n", str, (err & 0xffffff));
61 show_regs(regs);
62 spin_unlock_irq(&die_lock);
63 do_exit(SIGSEGV);
64}
65
66static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err)
67{
68 if (!user_mode(regs))
69 die(str, regs, err);
70}
71
72static void die_if_no_fixup(const char * str, struct pt_regs * regs, long err)
73{
74 if (!user_mode(regs)) {
75 const struct exception_table_entry *fixup;
76 fixup = search_exception_tables(regs->pc);
77 if (fixup) {
78 regs->pc = fixup->fixup;
79 return;
80 }
81 die(str, regs, err);
82 }
83}
84
85DO_ERROR(13, SIGILL, "illegal slot instruction", illegal_slot_inst, current)
86DO_ERROR(87, SIGSEGV, "address error (exec)", address_error_exec, current)
87
88
89/* Implement misaligned load/store handling for kernel (and optionally for user
90 mode too). Limitation : only SHmedia mode code is handled - there is no
91 handling at all for misaligned accesses occurring in SHcompact code yet. */
92
93static int misaligned_fixup(struct pt_regs *regs);
94
95asmlinkage void do_address_error_load(unsigned long error_code, struct pt_regs *regs)
96{
97 if (misaligned_fixup(regs) < 0) {
98 do_unhandled_exception(7, SIGSEGV, "address error(load)",
99 "do_address_error_load",
100 error_code, regs, current);
101 }
102 return;
103}
104
105asmlinkage void do_address_error_store(unsigned long error_code, struct pt_regs *regs)
106{
107 if (misaligned_fixup(regs) < 0) {
108 do_unhandled_exception(8, SIGSEGV, "address error(store)",
109 "do_address_error_store",
110 error_code, regs, current);
111 }
112 return;
113}
114
115#if defined(CONFIG_SH64_ID2815_WORKAROUND)
116
117#define OPCODE_INVALID 0
118#define OPCODE_USER_VALID 1
119#define OPCODE_PRIV_VALID 2
120
121/* getcon/putcon - requires checking which control register is referenced. */
122#define OPCODE_CTRL_REG 3
123
124/* Table of valid opcodes for SHmedia mode.
125 Form a 10-bit value by concatenating the major/minor opcodes i.e.
126 opcode[31:26,20:16]. The 6 MSBs of this value index into the following
127 array. The 4 LSBs select the bit-pair in the entry (bits 1:0 correspond to
128 LSBs==4'b0000 etc). */
129static unsigned long shmedia_opcode_table[64] = {
130 0x55554044,0x54445055,0x15141514,0x14541414,0x00000000,0x10001000,0x01110055,0x04050015,
131 0x00000444,0xc0000000,0x44545515,0x40405555,0x55550015,0x10005555,0x55555505,0x04050000,
132 0x00000555,0x00000404,0x00040445,0x15151414,0x00000000,0x00000000,0x00000000,0x00000000,
133 0x00000055,0x40404444,0x00000404,0xc0009495,0x00000000,0x00000000,0x00000000,0x00000000,
134 0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,
135 0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,
136 0x80005050,0x04005055,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,
137 0x81055554,0x00000404,0x55555555,0x55555555,0x00000000,0x00000000,0x00000000,0x00000000
138};
139
140void do_reserved_inst(unsigned long error_code, struct pt_regs *regs)
141{
142 /* Workaround SH5-101 cut2 silicon defect #2815 :
143 in some situations, inter-mode branches from SHcompact -> SHmedia
144 which should take ITLBMISS or EXECPROT exceptions at the target
145 falsely take RESINST at the target instead. */
146
147 unsigned long opcode = 0x6ff4fff0; /* guaranteed reserved opcode */
148 unsigned long pc, aligned_pc;
149 int get_user_error;
150 int trapnr = 12;
151 int signr = SIGILL;
152 char *exception_name = "reserved_instruction";
153
154 pc = regs->pc;
155 if ((pc & 3) == 1) {
156 /* SHmedia : check for defect. This requires executable vmas
157 to be readable too. */
158 aligned_pc = pc & ~3;
159 if (!access_ok(VERIFY_READ, aligned_pc, sizeof(unsigned long))) {
160 get_user_error = -EFAULT;
161 } else {
162 get_user_error = __get_user(opcode, (unsigned long *)aligned_pc);
163 }
164 if (get_user_error >= 0) {
165 unsigned long index, shift;
166 unsigned long major, minor, combined;
167 unsigned long reserved_field;
168 reserved_field = opcode & 0xf; /* These bits are currently reserved as zero in all valid opcodes */
169 major = (opcode >> 26) & 0x3f;
170 minor = (opcode >> 16) & 0xf;
171 combined = (major << 4) | minor;
172 index = major;
173 shift = minor << 1;
174 if (reserved_field == 0) {
175 int opcode_state = (shmedia_opcode_table[index] >> shift) & 0x3;
176 switch (opcode_state) {
177 case OPCODE_INVALID:
178 /* Trap. */
179 break;
180 case OPCODE_USER_VALID:
181 /* Restart the instruction : the branch to the instruction will now be from an RTE
182 not from SHcompact so the silicon defect won't be triggered. */
183 return;
184 case OPCODE_PRIV_VALID:
185 if (!user_mode(regs)) {
186 /* Should only ever get here if a module has
187 SHcompact code inside it. If so, the same fix up is needed. */
188 return; /* same reason */
189 }
190 /* Otherwise, user mode trying to execute a privileged instruction -
191 fall through to trap. */
192 break;
193 case OPCODE_CTRL_REG:
194 /* If in privileged mode, return as above. */
195 if (!user_mode(regs)) return;
196 /* In user mode ... */
197 if (combined == 0x9f) { /* GETCON */
198 unsigned long regno = (opcode >> 20) & 0x3f;
199 if (regno >= 62) {
200 return;
201 }
202 /* Otherwise, reserved or privileged control register, => trap */
203 } else if (combined == 0x1bf) { /* PUTCON */
204 unsigned long regno = (opcode >> 4) & 0x3f;
205 if (regno >= 62) {
206 return;
207 }
208 /* Otherwise, reserved or privileged control register, => trap */
209 } else {
210 /* Trap */
211 }
212 break;
213 default:
214 /* Fall through to trap. */
215 break;
216 }
217 }
218 /* fall through to normal resinst processing */
219 } else {
220 /* Error trying to read opcode. This typically means a
221 real fault, not a RESINST any more. So change the
222 codes. */
223 trapnr = 87;
224 exception_name = "address error (exec)";
225 signr = SIGSEGV;
226 }
227 }
228
229 do_unhandled_exception(trapnr, signr, exception_name, "do_reserved_inst", error_code, regs, current);
230}
231
232#else /* CONFIG_SH64_ID2815_WORKAROUND */
233
234/* If the workaround isn't needed, this is just a straightforward reserved
235 instruction */
236DO_ERROR(12, SIGILL, "reserved instruction", reserved_inst, current)
237
238#endif /* CONFIG_SH64_ID2815_WORKAROUND */
239
240/* Called with interrupts disabled */
241asmlinkage void do_exception_error(unsigned long ex, struct pt_regs *regs)
242{
243 show_excp_regs(__func__, -1, -1, regs);
244 die_if_kernel("exception", regs, ex);
245}
246
247int do_unknown_trapa(unsigned long scId, struct pt_regs *regs)
248{
249 /* Syscall debug */
250 printk("System call ID error: [0x1#args:8 #syscall:16 0x%lx]\n", scId);
251
252 die_if_kernel("unknown trapa", regs, scId);
253
254 return -ENOSYS;
255}
256
257void show_stack(struct task_struct *tsk, unsigned long *sp)
258{
259#ifdef CONFIG_KALLSYMS
260 extern void sh64_unwind(struct pt_regs *regs);
261 struct pt_regs *regs;
262
263 regs = tsk ? tsk->thread.kregs : NULL;
264
265 sh64_unwind(regs);
266#else
267 printk(KERN_ERR "Can't backtrace on sh64 without CONFIG_KALLSYMS\n");
268#endif
269}
270
271void show_task(unsigned long *sp)
272{
273 show_stack(NULL, sp);
274}
275
276void dump_stack(void)
277{
278 show_task(NULL);
279}
280/* Needed by any user of WARN_ON in view of the defn in include/asm-sh/bug.h */
281EXPORT_SYMBOL(dump_stack);
282
283static void do_unhandled_exception(int trapnr, int signr, char *str, char *fn_name,
284 unsigned long error_code, struct pt_regs *regs, struct task_struct *tsk)
285{
286 show_excp_regs(fn_name, trapnr, signr, regs);
287 tsk->thread.error_code = error_code;
288 tsk->thread.trap_no = trapnr;
289
290 if (user_mode(regs))
291 force_sig(signr, tsk);
292
293 die_if_no_fixup(str, regs, error_code);
294}
295
296static int read_opcode(unsigned long long pc, unsigned long *result_opcode, int from_user_mode)
36{ 297{
37 int get_user_error; 298 int get_user_error;
38 unsigned long aligned_pc; 299 unsigned long aligned_pc;
39 insn_size_t opcode; 300 unsigned long opcode;
40 301
41 if ((pc & 3) == 1) { 302 if ((pc & 3) == 1) {
42 /* SHmedia */ 303 /* SHmedia */
43 aligned_pc = pc & ~3; 304 aligned_pc = pc & ~3;
44 if (from_user_mode) { 305 if (from_user_mode) {
45 if (!access_ok(VERIFY_READ, aligned_pc, sizeof(insn_size_t))) { 306 if (!access_ok(VERIFY_READ, aligned_pc, sizeof(unsigned long))) {
46 get_user_error = -EFAULT; 307 get_user_error = -EFAULT;
47 } else { 308 } else {
48 get_user_error = __get_user(opcode, (insn_size_t *)aligned_pc); 309 get_user_error = __get_user(opcode, (unsigned long *)aligned_pc);
49 *result_opcode = opcode; 310 *result_opcode = opcode;
50 } 311 }
51 return get_user_error; 312 return get_user_error;
@@ -53,7 +314,7 @@ static int read_opcode(reg_size_t pc, insn_size_t *result_opcode, int from_user_
53 /* If the fault was in the kernel, we can either read 314 /* If the fault was in the kernel, we can either read
54 * this directly, or if not, we fault. 315 * this directly, or if not, we fault.
55 */ 316 */
56 *result_opcode = *(insn_size_t *)aligned_pc; 317 *result_opcode = *(unsigned long *) aligned_pc;
57 return 0; 318 return 0;
58 } 319 }
59 } else if ((pc & 1) == 0) { 320 } else if ((pc & 1) == 0) {
@@ -79,23 +340,17 @@ static int address_is_sign_extended(__u64 a)
79#endif 340#endif
80} 341}
81 342
82/* return -1 for fault, 0 for OK */
83static int generate_and_check_address(struct pt_regs *regs, 343static int generate_and_check_address(struct pt_regs *regs,
84 insn_size_t opcode, 344 __u32 opcode,
85 int displacement_not_indexed, 345 int displacement_not_indexed,
86 int width_shift, 346 int width_shift,
87 __u64 *address) 347 __u64 *address)
88{ 348{
349 /* return -1 for fault, 0 for OK */
350
89 __u64 base_address, addr; 351 __u64 base_address, addr;
90 int basereg; 352 int basereg;
91 353
92 switch (1 << width_shift) {
93 case 1: inc_unaligned_byte_access(); break;
94 case 2: inc_unaligned_word_access(); break;
95 case 4: inc_unaligned_dword_access(); break;
96 case 8: inc_unaligned_multi_access(); break;
97 }
98
99 basereg = (opcode >> 20) & 0x3f; 354 basereg = (opcode >> 20) & 0x3f;
100 base_address = regs->regs[basereg]; 355 base_address = regs->regs[basereg];
101 if (displacement_not_indexed) { 356 if (displacement_not_indexed) {
@@ -112,28 +367,28 @@ static int generate_and_check_address(struct pt_regs *regs,
112 } 367 }
113 368
114 /* Check sign extended */ 369 /* Check sign extended */
115 if (!address_is_sign_extended(addr)) 370 if (!address_is_sign_extended(addr)) {
116 return -1; 371 return -1;
372 }
117 373
118 /* Check accessible. For misaligned access in the kernel, assume the 374 /* Check accessible. For misaligned access in the kernel, assume the
119 address is always accessible (and if not, just fault when the 375 address is always accessible (and if not, just fault when the
120 load/store gets done.) */ 376 load/store gets done.) */
121 if (user_mode(regs)) { 377 if (user_mode(regs)) {
122 inc_unaligned_user_access(); 378 if (addr >= TASK_SIZE) {
123
124 if (addr >= TASK_SIZE)
125 return -1; 379 return -1;
126 } else 380 }
127 inc_unaligned_kernel_access(); 381 /* Do access_ok check later - it depends on whether it's a load or a store. */
382 }
128 383
129 *address = addr; 384 *address = addr;
130
131 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, addr);
132 unaligned_fixups_notify(current, opcode, regs);
133
134 return 0; 385 return 0;
135} 386}
136 387
388static int user_mode_unaligned_fixup_count = 10;
389static int user_mode_unaligned_fixup_enable = 1;
390static int kernel_mode_unaligned_fixup_count = 32;
391
137static void misaligned_kernel_word_load(__u64 address, int do_sign_extend, __u64 *result) 392static void misaligned_kernel_word_load(__u64 address, int do_sign_extend, __u64 *result)
138{ 393{
139 unsigned short x; 394 unsigned short x;
@@ -163,7 +418,7 @@ static void misaligned_kernel_word_store(__u64 address, __u64 value)
163} 418}
164 419
165static int misaligned_load(struct pt_regs *regs, 420static int misaligned_load(struct pt_regs *regs,
166 insn_size_t opcode, 421 __u32 opcode,
167 int displacement_not_indexed, 422 int displacement_not_indexed,
168 int width_shift, 423 int width_shift,
169 int do_sign_extend) 424 int do_sign_extend)
@@ -175,8 +430,11 @@ static int misaligned_load(struct pt_regs *regs,
175 430
176 error = generate_and_check_address(regs, opcode, 431 error = generate_and_check_address(regs, opcode,
177 displacement_not_indexed, width_shift, &address); 432 displacement_not_indexed, width_shift, &address);
178 if (error < 0) 433 if (error < 0) {
179 return error; 434 return error;
435 }
436
437 perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, address);
180 438
181 destreg = (opcode >> 4) & 0x3f; 439 destreg = (opcode >> 4) & 0x3f;
182 if (user_mode(regs)) { 440 if (user_mode(regs)) {
@@ -235,10 +493,11 @@ static int misaligned_load(struct pt_regs *regs,
235 } 493 }
236 494
237 return 0; 495 return 0;
496
238} 497}
239 498
240static int misaligned_store(struct pt_regs *regs, 499static int misaligned_store(struct pt_regs *regs,
241 insn_size_t opcode, 500 __u32 opcode,
242 int displacement_not_indexed, 501 int displacement_not_indexed,
243 int width_shift) 502 int width_shift)
244{ 503{
@@ -249,8 +508,11 @@ static int misaligned_store(struct pt_regs *regs,
249 508
250 error = generate_and_check_address(regs, opcode, 509 error = generate_and_check_address(regs, opcode,
251 displacement_not_indexed, width_shift, &address); 510 displacement_not_indexed, width_shift, &address);
252 if (error < 0) 511 if (error < 0) {
253 return error; 512 return error;
513 }
514
515 perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, address);
254 516
255 srcreg = (opcode >> 4) & 0x3f; 517 srcreg = (opcode >> 4) & 0x3f;
256 if (user_mode(regs)) { 518 if (user_mode(regs)) {
@@ -304,12 +566,13 @@ static int misaligned_store(struct pt_regs *regs,
304 } 566 }
305 567
306 return 0; 568 return 0;
569
307} 570}
308 571
309/* Never need to fix up misaligned FPU accesses within the kernel since that's a real 572/* Never need to fix up misaligned FPU accesses within the kernel since that's a real
310 error. */ 573 error. */
311static int misaligned_fpu_load(struct pt_regs *regs, 574static int misaligned_fpu_load(struct pt_regs *regs,
312 insn_size_t opcode, 575 __u32 opcode,
313 int displacement_not_indexed, 576 int displacement_not_indexed,
314 int width_shift, 577 int width_shift,
315 int do_paired_load) 578 int do_paired_load)
@@ -321,8 +584,11 @@ static int misaligned_fpu_load(struct pt_regs *regs,
321 584
322 error = generate_and_check_address(regs, opcode, 585 error = generate_and_check_address(regs, opcode,
323 displacement_not_indexed, width_shift, &address); 586 displacement_not_indexed, width_shift, &address);
324 if (error < 0) 587 if (error < 0) {
325 return error; 588 return error;
589 }
590
591 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, address);
326 592
327 destreg = (opcode >> 4) & 0x3f; 593 destreg = (opcode >> 4) & 0x3f;
328 if (user_mode(regs)) { 594 if (user_mode(regs)) {
@@ -378,10 +644,12 @@ static int misaligned_fpu_load(struct pt_regs *regs,
378 die ("Misaligned FPU load inside kernel", regs, 0); 644 die ("Misaligned FPU load inside kernel", regs, 0);
379 return -1; 645 return -1;
380 } 646 }
647
648
381} 649}
382 650
383static int misaligned_fpu_store(struct pt_regs *regs, 651static int misaligned_fpu_store(struct pt_regs *regs,
384 insn_size_t opcode, 652 __u32 opcode,
385 int displacement_not_indexed, 653 int displacement_not_indexed,
386 int width_shift, 654 int width_shift,
387 int do_paired_load) 655 int do_paired_load)
@@ -393,8 +661,11 @@ static int misaligned_fpu_store(struct pt_regs *regs,
393 661
394 error = generate_and_check_address(regs, opcode, 662 error = generate_and_check_address(regs, opcode,
395 displacement_not_indexed, width_shift, &address); 663 displacement_not_indexed, width_shift, &address);
396 if (error < 0) 664 if (error < 0) {
397 return error; 665 return error;
666 }
667
668 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, address);
398 669
399 srcreg = (opcode >> 4) & 0x3f; 670 srcreg = (opcode >> 4) & 0x3f;
400 if (user_mode(regs)) { 671 if (user_mode(regs)) {
@@ -455,13 +726,11 @@ static int misaligned_fpu_store(struct pt_regs *regs,
455 726
456static int misaligned_fixup(struct pt_regs *regs) 727static int misaligned_fixup(struct pt_regs *regs)
457{ 728{
458 insn_size_t opcode; 729 unsigned long opcode;
459 int error; 730 int error;
460 int major, minor; 731 int major, minor;
461 unsigned int user_action;
462 732
463 user_action = unaligned_user_action(); 733 if (!user_mode_unaligned_fixup_enable)
464 if (!(user_action & UM_FIXUP))
465 return -1; 734 return -1;
466 735
467 error = read_opcode(regs->pc, &opcode, user_mode(regs)); 736 error = read_opcode(regs->pc, &opcode, user_mode(regs));
@@ -471,6 +740,23 @@ static int misaligned_fixup(struct pt_regs *regs)
471 major = (opcode >> 26) & 0x3f; 740 major = (opcode >> 26) & 0x3f;
472 minor = (opcode >> 16) & 0xf; 741 minor = (opcode >> 16) & 0xf;
473 742
743 if (user_mode(regs) && (user_mode_unaligned_fixup_count > 0)) {
744 --user_mode_unaligned_fixup_count;
745 /* Only do 'count' worth of these reports, to remove a potential DoS against syslog */
746 printk("Fixing up unaligned userspace access in \"%s\" pid=%d pc=0x%08x ins=0x%08lx\n",
747 current->comm, task_pid_nr(current), (__u32)regs->pc, opcode);
748 } else if (!user_mode(regs) && (kernel_mode_unaligned_fixup_count > 0)) {
749 --kernel_mode_unaligned_fixup_count;
750 if (in_interrupt()) {
751 printk("Fixing up unaligned kernelspace access in interrupt pc=0x%08x ins=0x%08lx\n",
752 (__u32)regs->pc, opcode);
753 } else {
754 printk("Fixing up unaligned kernelspace access in \"%s\" pid=%d pc=0x%08x ins=0x%08lx\n",
755 current->comm, task_pid_nr(current), (__u32)regs->pc, opcode);
756 }
757 }
758
759
474 switch (major) { 760 switch (major) {
475 case (0x84>>2): /* LD.W */ 761 case (0x84>>2): /* LD.W */
476 error = misaligned_load(regs, opcode, 1, 1, 1); 762 error = misaligned_load(regs, opcode, 1, 1, 1);
@@ -595,202 +881,59 @@ static int misaligned_fixup(struct pt_regs *regs)
595 regs->pc += 4; /* Skip the instruction that's just been emulated */ 881 regs->pc += 4; /* Skip the instruction that's just been emulated */
596 return 0; 882 return 0;
597 } 883 }
598}
599
600static void do_unhandled_exception(int signr, char *str, unsigned long error,
601 struct pt_regs *regs)
602{
603 if (user_mode(regs))
604 force_sig(signr, current);
605 884
606 die_if_no_fixup(str, regs, error);
607}
608
609#define DO_ERROR(signr, str, name) \
610asmlinkage void do_##name(unsigned long error_code, struct pt_regs *regs) \
611{ \
612 do_unhandled_exception(signr, str, error_code, regs); \
613} 885}
614 886
615DO_ERROR(SIGILL, "illegal slot instruction", illegal_slot_inst) 887static ctl_table unaligned_table[] = {
616DO_ERROR(SIGSEGV, "address error (exec)", address_error_exec) 888 {
617 889 .procname = "kernel_reports",
618#if defined(CONFIG_SH64_ID2815_WORKAROUND) 890 .data = &kernel_mode_unaligned_fixup_count,
619 891 .maxlen = sizeof(int),
620#define OPCODE_INVALID 0 892 .mode = 0644,
621#define OPCODE_USER_VALID 1 893 .proc_handler = proc_dointvec
622#define OPCODE_PRIV_VALID 2 894 },
623 895 {
624/* getcon/putcon - requires checking which control register is referenced. */ 896 .procname = "user_reports",
625#define OPCODE_CTRL_REG 3 897 .data = &user_mode_unaligned_fixup_count,
626 898 .maxlen = sizeof(int),
627/* Table of valid opcodes for SHmedia mode. 899 .mode = 0644,
628 Form a 10-bit value by concatenating the major/minor opcodes i.e. 900 .proc_handler = proc_dointvec
629 opcode[31:26,20:16]. The 6 MSBs of this value index into the following 901 },
630 array. The 4 LSBs select the bit-pair in the entry (bits 1:0 correspond to 902 {
631 LSBs==4'b0000 etc). */ 903 .procname = "user_enable",
632static unsigned long shmedia_opcode_table[64] = { 904 .data = &user_mode_unaligned_fixup_enable,
633 0x55554044,0x54445055,0x15141514,0x14541414,0x00000000,0x10001000,0x01110055,0x04050015, 905 .maxlen = sizeof(int),
634 0x00000444,0xc0000000,0x44545515,0x40405555,0x55550015,0x10005555,0x55555505,0x04050000, 906 .mode = 0644,
635 0x00000555,0x00000404,0x00040445,0x15151414,0x00000000,0x00000000,0x00000000,0x00000000, 907 .proc_handler = proc_dointvec},
636 0x00000055,0x40404444,0x00000404,0xc0009495,0x00000000,0x00000000,0x00000000,0x00000000, 908 {}
637 0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,
638 0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,
639 0x80005050,0x04005055,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,
640 0x81055554,0x00000404,0x55555555,0x55555555,0x00000000,0x00000000,0x00000000,0x00000000
641}; 909};
642 910
643/* Workaround SH5-101 cut2 silicon defect #2815 : 911static ctl_table unaligned_root[] = {
644 in some situations, inter-mode branches from SHcompact -> SHmedia 912 {
645 which should take ITLBMISS or EXECPROT exceptions at the target 913 .procname = "unaligned_fixup",
646 falsely take RESINST at the target instead. */ 914 .mode = 0555,
647void do_reserved_inst(unsigned long error_code, struct pt_regs *regs) 915 .child = unaligned_table
648{ 916 },
649 insn_size_t opcode = 0x6ff4fff0; /* guaranteed reserved opcode */ 917 {}
650 unsigned long pc, aligned_pc; 918};
651 unsigned long index, shift;
652 unsigned long major, minor, combined;
653 unsigned long reserved_field;
654 int opcode_state;
655 int get_user_error;
656 int signr = SIGILL;
657 char *exception_name = "reserved_instruction";
658
659 pc = regs->pc;
660
661 /* SHcompact is not handled */
662 if (unlikely((pc & 3) == 0))
663 goto out;
664
665 /* SHmedia : check for defect. This requires executable vmas
666 to be readable too. */
667 aligned_pc = pc & ~3;
668 if (!access_ok(VERIFY_READ, aligned_pc, sizeof(insn_size_t)))
669 get_user_error = -EFAULT;
670 else
671 get_user_error = __get_user(opcode, (insn_size_t *)aligned_pc);
672
673 if (get_user_error < 0) {
674 /*
675 * Error trying to read opcode. This typically means a
676 * real fault, not a RESINST any more. So change the
677 * codes.
678 */
679 exception_name = "address error (exec)";
680 signr = SIGSEGV;
681 goto out;
682 }
683
684 /* These bits are currently reserved as zero in all valid opcodes */
685 reserved_field = opcode & 0xf;
686 if (unlikely(reserved_field))
687 goto out; /* invalid opcode */
688
689 major = (opcode >> 26) & 0x3f;
690 minor = (opcode >> 16) & 0xf;
691 combined = (major << 4) | minor;
692 index = major;
693 shift = minor << 1;
694 opcode_state = (shmedia_opcode_table[index] >> shift) & 0x3;
695 switch (opcode_state) {
696 case OPCODE_INVALID:
697 /* Trap. */
698 break;
699 case OPCODE_USER_VALID:
700 /*
701 * Restart the instruction: the branch to the instruction
702 * will now be from an RTE not from SHcompact so the
703 * silicon defect won't be triggered.
704 */
705 return;
706 case OPCODE_PRIV_VALID:
707 if (!user_mode(regs)) {
708 /*
709 * Should only ever get here if a module has
710 * SHcompact code inside it. If so, the same fix
711 * up is needed.
712 */
713 return; /* same reason */
714 }
715
716 /*
717 * Otherwise, user mode trying to execute a privileged
718 * instruction - fall through to trap.
719 */
720 break;
721 case OPCODE_CTRL_REG:
722 /* If in privileged mode, return as above. */
723 if (!user_mode(regs))
724 return;
725
726 /* In user mode ... */
727 if (combined == 0x9f) { /* GETCON */
728 unsigned long regno = (opcode >> 20) & 0x3f;
729
730 if (regno >= 62)
731 return;
732
733 /* reserved/privileged control register => trap */
734 } else if (combined == 0x1bf) { /* PUTCON */
735 unsigned long regno = (opcode >> 4) & 0x3f;
736
737 if (regno >= 62)
738 return;
739
740 /* reserved/privileged control register => trap */
741 }
742
743 break;
744 default:
745 /* Fall through to trap. */
746 break;
747 }
748
749out:
750 do_unhandled_exception(signr, exception_name, error_code, regs);
751}
752
753#else /* CONFIG_SH64_ID2815_WORKAROUND */
754
755/* If the workaround isn't needed, this is just a straightforward reserved
756 instruction */
757DO_ERROR(SIGILL, "reserved instruction", reserved_inst)
758
759#endif /* CONFIG_SH64_ID2815_WORKAROUND */
760
761/* Called with interrupts disabled */
762asmlinkage void do_exception_error(unsigned long ex, struct pt_regs *regs)
763{
764 die_if_kernel("exception", regs, ex);
765}
766 919
767asmlinkage int do_unknown_trapa(unsigned long scId, struct pt_regs *regs) 920static ctl_table sh64_root[] = {
921 {
922 .procname = "sh64",
923 .mode = 0555,
924 .child = unaligned_root
925 },
926 {}
927};
928static struct ctl_table_header *sysctl_header;
929static int __init init_sysctl(void)
768{ 930{
769 /* Syscall debug */ 931 sysctl_header = register_sysctl_table(sh64_root);
770 printk("System call ID error: [0x1#args:8 #syscall:16 0x%lx]\n", scId); 932 return 0;
771
772 die_if_kernel("unknown trapa", regs, scId);
773
774 return -ENOSYS;
775} 933}
776 934
777/* Implement misaligned load/store handling for kernel (and optionally for user 935__initcall(init_sysctl);
778 mode too). Limitation : only SHmedia mode code is handled - there is no
779 handling at all for misaligned accesses occurring in SHcompact code yet. */
780 936
781asmlinkage void do_address_error_load(unsigned long error_code, struct pt_regs *regs)
782{
783 if (misaligned_fixup(regs) < 0)
784 do_unhandled_exception(SIGSEGV, "address error(load)",
785 error_code, regs);
786}
787
788asmlinkage void do_address_error_store(unsigned long error_code, struct pt_regs *regs)
789{
790 if (misaligned_fixup(regs) < 0)
791 do_unhandled_exception(SIGSEGV, "address error(store)",
792 error_code, regs);
793}
794 937
795asmlinkage void do_debug_interrupt(unsigned long code, struct pt_regs *regs) 938asmlinkage void do_debug_interrupt(unsigned long code, struct pt_regs *regs)
796{ 939{
@@ -802,9 +945,10 @@ asmlinkage void do_debug_interrupt(unsigned long code, struct pt_regs *regs)
802 of access we make to them - just go direct to their physical 945 of access we make to them - just go direct to their physical
803 addresses. */ 946 addresses. */
804 exp_cause = peek_real_address_q(DM_EXP_CAUSE_PHY); 947 exp_cause = peek_real_address_q(DM_EXP_CAUSE_PHY);
805 if (exp_cause & ~4) 948 if (exp_cause & ~4) {
806 printk("DM.EXP_CAUSE had unexpected bits set (=%08lx)\n", 949 printk("DM.EXP_CAUSE had unexpected bits set (=%08lx)\n",
807 (unsigned long)(exp_cause & 0xffffffff)); 950 (unsigned long)(exp_cause & 0xffffffff));
951 }
808 show_state(); 952 show_state();
809 /* Clear all DEBUGINT causes */ 953 /* Clear all DEBUGINT causes */
810 poke_real_address_q(DM_EXP_CAUSE_PHY, 0x0); 954 poke_real_address_q(DM_EXP_CAUSE_PHY, 0x0);
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index db88cbf9eaf..731c10ce67b 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -23,7 +23,7 @@ OUTPUT_ARCH(sh)
23ENTRY(_start) 23ENTRY(_start)
24SECTIONS 24SECTIONS
25{ 25{
26 . = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET; 26 . = PAGE_OFFSET + MEMORY_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
27 27
28 _text = .; /* Text and read-only data */ 28 _text = .; /* Text and read-only data */
29 29
@@ -78,6 +78,7 @@ SECTIONS
78 . = ALIGN(PAGE_SIZE); 78 . = ALIGN(PAGE_SIZE);
79 __init_end = .; 79 __init_end = .;
80 BSS_SECTION(0, PAGE_SIZE, 4) 80 BSS_SECTION(0, PAGE_SIZE, 4)
81 _ebss = .; /* uClinux MTD sucks */
81 _end = . ; 82 _end = . ;
82 83
83 STABS_DEBUG 84 STABS_DEBUG
diff --git a/arch/sh/kernel/vsyscall/vsyscall-sigreturn.S b/arch/sh/kernel/vsyscall/vsyscall-sigreturn.S
index 23af1758405..555a64f124c 100644
--- a/arch/sh/kernel/vsyscall/vsyscall-sigreturn.S
+++ b/arch/sh/kernel/vsyscall/vsyscall-sigreturn.S
@@ -34,41 +34,6 @@ __kernel_rt_sigreturn:
341: .short __NR_rt_sigreturn 341: .short __NR_rt_sigreturn
35.LEND_rt_sigreturn: 35.LEND_rt_sigreturn:
36 .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn 36 .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn
37 .previous
38 37
39 .section .eh_frame,"a",@progbits 38 .section .eh_frame,"a",@progbits
40.LCIE1:
41 .ualong .LCIE1_end - .LCIE1_start
42.LCIE1_start:
43 .ualong 0 /* CIE ID */
44 .byte 0x1 /* Version number */
45 .string "zRS" /* NUL-terminated augmentation string */
46 .uleb128 0x1 /* Code alignment factor */
47 .sleb128 -4 /* Data alignment factor */
48 .byte 0x11 /* Return address register column */
49 .uleb128 0x1 /* Augmentation length and data */
50 .byte 0x1b /* DW_EH_PE_pcrel | DW_EH_PE_sdata4. */
51 .byte 0xc, 0xf, 0x0 /* DW_CFA_def_cfa: r15 ofs 0 */
52
53 .align 2
54.LCIE1_end:
55
56 .ualong .LFDE0_end-.LFDE0_start /* Length FDE0 */
57.LFDE0_start:
58 .ualong .LFDE0_start-.LCIE1 /* CIE pointer */
59 .ualong .LSTART_sigreturn-. /* PC-relative start address */
60 .ualong .LEND_sigreturn-.LSTART_sigreturn
61 .uleb128 0 /* Augmentation */
62 .align 2
63.LFDE0_end:
64
65 .ualong .LFDE1_end-.LFDE1_start /* Length FDE1 */
66.LFDE1_start:
67 .ualong .LFDE1_start-.LCIE1 /* CIE pointer */
68 .ualong .LSTART_rt_sigreturn-. /* PC-relative start address */
69 .ualong .LEND_rt_sigreturn-.LSTART_rt_sigreturn
70 .uleb128 0 /* Augmentation */
71 .align 2
72.LFDE1_end:
73
74 .previous 39 .previous
diff --git a/arch/sh/kernel/vsyscall/vsyscall-trapa.S b/arch/sh/kernel/vsyscall/vsyscall-trapa.S
index 0eb74d00690..3e70f851cdc 100644
--- a/arch/sh/kernel/vsyscall/vsyscall-trapa.S
+++ b/arch/sh/kernel/vsyscall/vsyscall-trapa.S
@@ -3,34 +3,37 @@
3 .type __kernel_vsyscall,@function 3 .type __kernel_vsyscall,@function
4__kernel_vsyscall: 4__kernel_vsyscall:
5.LSTART_vsyscall: 5.LSTART_vsyscall:
6 trapa #0x10 6 /* XXX: We'll have to do something here once we opt to use the vDSO
7 nop 7 * page for something other than the signal trampoline.. as well as
8 * fill out .eh_frame -- PFM. */
8.LEND_vsyscall: 9.LEND_vsyscall:
9 .size __kernel_vsyscall,.-.LSTART_vsyscall 10 .size __kernel_vsyscall,.-.LSTART_vsyscall
10 .previous
11 11
12 .section .eh_frame,"a",@progbits 12 .section .eh_frame,"a",@progbits
13 .previous
13.LCIE: 14.LCIE:
14 .ualong .LCIE_end - .LCIE_start 15 .ualong .LCIE_end - .LCIE_start
15.LCIE_start: 16.LCIE_start:
16 .ualong 0 /* CIE ID */ 17 .ualong 0 /* CIE ID */
17 .byte 0x1 /* Version number */ 18 .byte 0x1 /* Version number */
18 .string "zR" /* NUL-terminated augmentation string */ 19 .string "zRS" /* NUL-terminated augmentation string */
19 .uleb128 0x1 /* Code alignment factor */ 20 .uleb128 0x1 /* Code alignment factor */
20 .sleb128 -4 /* Data alignment factor */ 21 .sleb128 -4 /* Data alignment factor */
21 .byte 0x11 /* Return address register column */ 22 .byte 0x11 /* Return address register column */
22 .uleb128 0x1 /* Augmentation length and data */ 23 /* Augmentation length and data (none) */
23 .byte 0x1b /* DW_EH_PE_pcrel | DW_EH_PE_sdata4. */ 24 .byte 0xc /* DW_CFA_def_cfa */
24 .byte 0xc,0xf,0x0 /* DW_CFA_def_cfa: r15 ofs 0 */ 25 .uleb128 0xf /* r15 */
26 .uleb128 0x0 /* offset 0 */
27
25 .align 2 28 .align 2
26.LCIE_end: 29.LCIE_end:
27 30
28 .ualong .LFDE_end-.LFDE_start /* Length FDE */ 31 .ualong .LFDE_end-.LFDE_start /* Length FDE */
29.LFDE_start: 32.LFDE_start:
30 .ualong .LFDE_start-.LCIE /* CIE pointer */ 33 .ualong .LCIE /* CIE pointer */
31 .ualong .LSTART_vsyscall-. /* PC-relative start address */ 34 .ualong .LSTART_vsyscall-. /* start address */
32 .ualong .LEND_vsyscall-.LSTART_vsyscall 35 .ualong .LEND_vsyscall-.LSTART_vsyscall
33 .uleb128 0 /* Augmentation */ 36 .uleb128 0
34 .align 2 37 .align 2
35.LFDE_end: 38.LFDE_end:
36 .previous 39 .previous
diff --git a/arch/sh/kernel/vsyscall/vsyscall.c b/arch/sh/kernel/vsyscall/vsyscall.c
index 5ca579720a0..1d6d51a1ce7 100644
--- a/arch/sh/kernel/vsyscall/vsyscall.c
+++ b/arch/sh/kernel/vsyscall/vsyscall.c
@@ -73,7 +73,8 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
73 73
74 ret = install_special_mapping(mm, addr, PAGE_SIZE, 74 ret = install_special_mapping(mm, addr, PAGE_SIZE,
75 VM_READ | VM_EXEC | 75 VM_READ | VM_EXEC |
76 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC, 76 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC |
77 VM_ALWAYSDUMP,
77 syscall_pages); 78 syscall_pages);
78 if (unlikely(ret)) 79 if (unlikely(ret))
79 goto up_fail; 80 goto up_fail;
diff --git a/arch/sh/lib/mcount.S b/arch/sh/lib/mcount.S
index 60164e65d66..84a57761f17 100644
--- a/arch/sh/lib/mcount.S
+++ b/arch/sh/lib/mcount.S
@@ -39,7 +39,7 @@
39 * 39 *
40 * Make sure the stack pointer contains a valid address. Valid 40 * Make sure the stack pointer contains a valid address. Valid
41 * addresses for kernel stacks are anywhere after the bss 41 * addresses for kernel stacks are anywhere after the bss
42 * (after __bss_stop) and anywhere in init_thread_union (init_stack). 42 * (after _ebss) and anywhere in init_thread_union (init_stack).
43 */ 43 */
44#define STACK_CHECK() \ 44#define STACK_CHECK() \
45 mov #(THREAD_SIZE >> 10), r0; \ 45 mov #(THREAD_SIZE >> 10), r0; \
@@ -60,7 +60,7 @@
60 cmp/hi r2, r1; \ 60 cmp/hi r2, r1; \
61 bf stack_panic; \ 61 bf stack_panic; \
62 \ 62 \
63 /* If sp > __bss_stop then we're OK. */ \ 63 /* If sp > _ebss then we're OK. */ \
64 mov.l .L_ebss, r1; \ 64 mov.l .L_ebss, r1; \
65 cmp/hi r1, r15; \ 65 cmp/hi r1, r15; \
66 bt 1f; \ 66 bt 1f; \
@@ -70,7 +70,7 @@
70 cmp/hs r1, r15; \ 70 cmp/hs r1, r15; \
71 bf stack_panic; \ 71 bf stack_panic; \
72 \ 72 \
73 /* If sp > init_stack && sp < __bss_stop, not OK. */ \ 73 /* If sp > init_stack && sp < _ebss, not OK. */ \
74 add r0, r1; \ 74 add r0, r1; \
75 cmp/hs r1, r15; \ 75 cmp/hs r1, r15; \
76 bt stack_panic; \ 76 bt stack_panic; \
@@ -292,6 +292,8 @@ stack_panic:
292 nop 292 nop
293 293
294 .align 2 294 .align 2
295.L_ebss:
296 .long _ebss
295.L_init_thread_union: 297.L_init_thread_union:
296 .long init_thread_union 298 .long init_thread_union
297.Lpanic: 299.Lpanic:
diff --git a/arch/sh/lib64/Makefile b/arch/sh/lib64/Makefile
index 69779ff741d..1fee75aa1f9 100644
--- a/arch/sh/lib64/Makefile
+++ b/arch/sh/lib64/Makefile
@@ -10,7 +10,7 @@
10# 10#
11 11
12# Panic should really be compiled as PIC 12# Panic should really be compiled as PIC
13lib-y := udelay.o panic.o memcpy.o memset.o \ 13lib-y := udelay.o dbg.o panic.o memcpy.o memset.o \
14 copy_user_memcpy.o copy_page.o strcpy.o strlen.o 14 copy_user_memcpy.o copy_page.o strcpy.o strlen.o
15 15
16# Extracted from libgcc 16# Extracted from libgcc
diff --git a/arch/sh/math-emu/math.c b/arch/sh/math-emu/math.c
index b876780c1e1..97719521065 100644
--- a/arch/sh/math-emu/math.c
+++ b/arch/sh/math-emu/math.c
@@ -14,6 +14,7 @@
14#include <linux/signal.h> 14#include <linux/signal.h>
15#include <linux/perf_event.h> 15#include <linux/perf_event.h>
16 16
17#include <asm/system.h>
17#include <asm/uaccess.h> 18#include <asm/uaccess.h>
18#include <asm/processor.h> 19#include <asm/processor.h>
19#include <asm/io.h> 20#include <asm/io.h>
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index 0f7c852f355..c3e61b36649 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -111,7 +111,6 @@ config VSYSCALL
111config NUMA 111config NUMA
112 bool "Non Uniform Memory Access (NUMA) Support" 112 bool "Non Uniform Memory Access (NUMA) Support"
113 depends on MMU && SYS_SUPPORTS_NUMA && EXPERIMENTAL 113 depends on MMU && SYS_SUPPORTS_NUMA && EXPERIMENTAL
114 select ARCH_WANT_NUMA_VARIABLE_LOCALITY
115 default n 114 default n
116 help 115 help
117 Some SH systems have many various memories scattered around 116 Some SH systems have many various memories scattered around
@@ -144,6 +143,9 @@ config MAX_ACTIVE_REGIONS
144 CPU_SUBTYPE_SH7785) 143 CPU_SUBTYPE_SH7785)
145 default "1" 144 default "1"
146 145
146config ARCH_POPULATES_NODE_MAP
147 def_bool y
148
147config ARCH_SELECT_MEMORY_MODEL 149config ARCH_SELECT_MEMORY_MODEL
148 def_bool y 150 def_bool y
149 151
diff --git a/arch/sh/mm/Makefile b/arch/sh/mm/Makefile
index cee6b9999d8..2228c8cee4d 100644
--- a/arch/sh/mm/Makefile
+++ b/arch/sh/mm/Makefile
@@ -15,8 +15,8 @@ cacheops-$(CONFIG_CPU_SHX3) += cache-shx3.o
15obj-y += $(cacheops-y) 15obj-y += $(cacheops-y)
16 16
17mmu-y := nommu.o extable_32.o 17mmu-y := nommu.o extable_32.o
18mmu-$(CONFIG_MMU) := extable_$(BITS).o fault.o gup.o ioremap.o kmap.o \ 18mmu-$(CONFIG_MMU) := extable_$(BITS).o fault_$(BITS).o gup.o \
19 pgtable.o tlbex_$(BITS).o tlbflush_$(BITS).o 19 ioremap.o kmap.o pgtable.o tlbflush_$(BITS).o
20 20
21obj-y += $(mmu-y) 21obj-y += $(mmu-y)
22 22
@@ -44,7 +44,7 @@ obj-$(CONFIG_HAVE_SRAM_POOL) += sram.o
44 44
45GCOV_PROFILE_pmb.o := n 45GCOV_PROFILE_pmb.o := n
46 46
47# Special flags for tlbex_64.o. This puts restrictions on the number of 47# Special flags for fault_64.o. This puts restrictions on the number of
48# caller-save registers that the compiler can target when building this file. 48# caller-save registers that the compiler can target when building this file.
49# This is required because the code is called from a context in entry.S where 49# This is required because the code is called from a context in entry.S where
50# very few registers have been saved in the exception handler (for speed 50# very few registers have been saved in the exception handler (for speed
@@ -59,7 +59,7 @@ GCOV_PROFILE_pmb.o := n
59# The resources not listed below are callee save, i.e. the compiler is free to 59# The resources not listed below are callee save, i.e. the compiler is free to
60# use any of them and will spill them to the stack itself. 60# use any of them and will spill them to the stack itself.
61 61
62CFLAGS_tlbex_64.o += -ffixed-r7 \ 62CFLAGS_fault_64.o += -ffixed-r7 \
63 -ffixed-r8 -ffixed-r9 -ffixed-r10 -ffixed-r11 -ffixed-r12 \ 63 -ffixed-r8 -ffixed-r9 -ffixed-r10 -ffixed-r11 -ffixed-r12 \
64 -ffixed-r13 -ffixed-r14 -ffixed-r16 -ffixed-r17 -ffixed-r19 \ 64 -ffixed-r13 -ffixed-r14 -ffixed-r16 -ffixed-r17 -ffixed-r19 \
65 -ffixed-r20 -ffixed-r21 -ffixed-r22 -ffixed-r23 \ 65 -ffixed-r20 -ffixed-r21 -ffixed-r22 -ffixed-r23 \
diff --git a/arch/sh/mm/cache-sh2a.c b/arch/sh/mm/cache-sh2a.c
index 949e2d3138a..1f51225426a 100644
--- a/arch/sh/mm/cache-sh2a.c
+++ b/arch/sh/mm/cache-sh2a.c
@@ -15,80 +15,35 @@
15#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
16#include <asm/io.h> 16#include <asm/io.h>
17 17
18/*
19 * The maximum number of pages we support up to when doing ranged dcache
20 * flushing. Anything exceeding this will simply flush the dcache in its
21 * entirety.
22 */
23#define MAX_OCACHE_PAGES 32
24#define MAX_ICACHE_PAGES 32
25
26#ifdef CONFIG_CACHE_WRITEBACK
27static void sh2a_flush_oc_line(unsigned long v, int way)
28{
29 unsigned long addr = (v & 0x000007f0) | (way << 11);
30 unsigned long data;
31
32 data = __raw_readl(CACHE_OC_ADDRESS_ARRAY | addr);
33 if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) {
34 data &= ~SH_CACHE_UPDATED;
35 __raw_writel(data, CACHE_OC_ADDRESS_ARRAY | addr);
36 }
37}
38#endif
39
40static void sh2a_invalidate_line(unsigned long cache_addr, unsigned long v)
41{
42 /* Set associative bit to hit all ways */
43 unsigned long addr = (v & 0x000007f0) | SH_CACHE_ASSOC;
44 __raw_writel((addr & CACHE_PHYSADDR_MASK), cache_addr | addr);
45}
46
47/*
48 * Write back the dirty D-caches, but not invalidate them.
49 */
50static void sh2a__flush_wback_region(void *start, int size) 18static void sh2a__flush_wback_region(void *start, int size)
51{ 19{
52#ifdef CONFIG_CACHE_WRITEBACK
53 unsigned long v; 20 unsigned long v;
54 unsigned long begin, end; 21 unsigned long begin, end;
55 unsigned long flags; 22 unsigned long flags;
56 int nr_ways;
57 23
58 begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); 24 begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
59 end = ((unsigned long)start + size + L1_CACHE_BYTES-1) 25 end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
60 & ~(L1_CACHE_BYTES-1); 26 & ~(L1_CACHE_BYTES-1);
61 nr_ways = current_cpu_data.dcache.ways;
62 27
63 local_irq_save(flags); 28 local_irq_save(flags);
64 jump_to_uncached(); 29 jump_to_uncached();
65 30
66 /* If there are too many pages then flush the entire cache */ 31 for (v = begin; v < end; v+=L1_CACHE_BYTES) {
67 if (((end - begin) >> PAGE_SHIFT) >= MAX_OCACHE_PAGES) { 32 unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0);
68 begin = CACHE_OC_ADDRESS_ARRAY;
69 end = begin + (nr_ways * current_cpu_data.dcache.way_size);
70
71 for (v = begin; v < end; v += L1_CACHE_BYTES) {
72 unsigned long data = __raw_readl(v);
73 if (data & SH_CACHE_UPDATED)
74 __raw_writel(data & ~SH_CACHE_UPDATED, v);
75 }
76 } else {
77 int way; 33 int way;
78 for (way = 0; way < nr_ways; way++) { 34 for (way = 0; way < 4; way++) {
79 for (v = begin; v < end; v += L1_CACHE_BYTES) 35 unsigned long data = __raw_readl(addr | (way << 11));
80 sh2a_flush_oc_line(v, way); 36 if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) {
37 data &= ~SH_CACHE_UPDATED;
38 __raw_writel(data, addr | (way << 11));
39 }
81 } 40 }
82 } 41 }
83 42
84 back_to_cached(); 43 back_to_cached();
85 local_irq_restore(flags); 44 local_irq_restore(flags);
86#endif
87} 45}
88 46
89/*
90 * Write back the dirty D-caches and invalidate them.
91 */
92static void sh2a__flush_purge_region(void *start, int size) 47static void sh2a__flush_purge_region(void *start, int size)
93{ 48{
94 unsigned long v; 49 unsigned long v;
@@ -103,22 +58,13 @@ static void sh2a__flush_purge_region(void *start, int size)
103 jump_to_uncached(); 58 jump_to_uncached();
104 59
105 for (v = begin; v < end; v+=L1_CACHE_BYTES) { 60 for (v = begin; v < end; v+=L1_CACHE_BYTES) {
106#ifdef CONFIG_CACHE_WRITEBACK 61 __raw_writel((v & CACHE_PHYSADDR_MASK),
107 int way; 62 CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008);
108 int nr_ways = current_cpu_data.dcache.ways;
109 for (way = 0; way < nr_ways; way++)
110 sh2a_flush_oc_line(v, way);
111#endif
112 sh2a_invalidate_line(CACHE_OC_ADDRESS_ARRAY, v);
113 } 63 }
114
115 back_to_cached(); 64 back_to_cached();
116 local_irq_restore(flags); 65 local_irq_restore(flags);
117} 66}
118 67
119/*
120 * Invalidate the D-caches, but no write back please
121 */
122static void sh2a__flush_invalidate_region(void *start, int size) 68static void sh2a__flush_invalidate_region(void *start, int size)
123{ 69{
124 unsigned long v; 70 unsigned long v;
@@ -128,25 +74,29 @@ static void sh2a__flush_invalidate_region(void *start, int size)
128 begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); 74 begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
129 end = ((unsigned long)start + size + L1_CACHE_BYTES-1) 75 end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
130 & ~(L1_CACHE_BYTES-1); 76 & ~(L1_CACHE_BYTES-1);
131
132 local_irq_save(flags); 77 local_irq_save(flags);
133 jump_to_uncached(); 78 jump_to_uncached();
134 79
135 /* If there are too many pages then just blow the cache */ 80#ifdef CONFIG_CACHE_WRITEBACK
136 if (((end - begin) >> PAGE_SHIFT) >= MAX_OCACHE_PAGES) { 81 __raw_writel(__raw_readl(CCR) | CCR_OCACHE_INVALIDATE, CCR);
137 __raw_writel(__raw_readl(CCR) | CCR_OCACHE_INVALIDATE, CCR); 82 /* I-cache invalidate */
138 } else { 83 for (v = begin; v < end; v+=L1_CACHE_BYTES) {
139 for (v = begin; v < end; v += L1_CACHE_BYTES) 84 __raw_writel((v & CACHE_PHYSADDR_MASK),
140 sh2a_invalidate_line(CACHE_OC_ADDRESS_ARRAY, v); 85 CACHE_IC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008);
141 } 86 }
142 87#else
88 for (v = begin; v < end; v+=L1_CACHE_BYTES) {
89 __raw_writel((v & CACHE_PHYSADDR_MASK),
90 CACHE_IC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008);
91 __raw_writel((v & CACHE_PHYSADDR_MASK),
92 CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0) | 0x00000008);
93 }
94#endif
143 back_to_cached(); 95 back_to_cached();
144 local_irq_restore(flags); 96 local_irq_restore(flags);
145} 97}
146 98
147/* 99/* WBack O-Cache and flush I-Cache */
148 * Write back the range of D-cache, and purge the I-cache.
149 */
150static void sh2a_flush_icache_range(void *args) 100static void sh2a_flush_icache_range(void *args)
151{ 101{
152 struct flusher_data *data = args; 102 struct flusher_data *data = args;
@@ -157,20 +107,23 @@ static void sh2a_flush_icache_range(void *args)
157 start = data->addr1 & ~(L1_CACHE_BYTES-1); 107 start = data->addr1 & ~(L1_CACHE_BYTES-1);
158 end = (data->addr2 + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1); 108 end = (data->addr2 + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1);
159 109
160#ifdef CONFIG_CACHE_WRITEBACK
161 sh2a__flush_wback_region((void *)start, end-start);
162#endif
163
164 local_irq_save(flags); 110 local_irq_save(flags);
165 jump_to_uncached(); 111 jump_to_uncached();
166 112
167 /* I-Cache invalidate */ 113 for (v = start; v < end; v+=L1_CACHE_BYTES) {
168 /* If there are too many pages then just blow the cache */ 114 unsigned long addr = (v & 0x000007f0);
169 if (((end - start) >> PAGE_SHIFT) >= MAX_ICACHE_PAGES) { 115 int way;
170 __raw_writel(__raw_readl(CCR) | CCR_ICACHE_INVALIDATE, CCR); 116 /* O-Cache writeback */
171 } else { 117 for (way = 0; way < 4; way++) {
172 for (v = start; v < end; v += L1_CACHE_BYTES) 118 unsigned long data = __raw_readl(CACHE_OC_ADDRESS_ARRAY | addr | (way << 11));
173 sh2a_invalidate_line(CACHE_IC_ADDRESS_ARRAY, v); 119 if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) {
120 data &= ~SH_CACHE_UPDATED;
121 __raw_writel(data, CACHE_OC_ADDRESS_ARRAY | addr | (way << 11));
122 }
123 }
124 /* I-Cache invalidate */
125 __raw_writel(addr,
126 CACHE_IC_ADDRESS_ARRAY | addr | 0x00000008);
174 } 127 }
175 128
176 back_to_cached(); 129 back_to_cached();
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c
index 0e529285b28..92eb98633ab 100644
--- a/arch/sh/mm/cache-sh4.c
+++ b/arch/sh/mm/cache-sh4.c
@@ -18,7 +18,6 @@
18#include <linux/highmem.h> 18#include <linux/highmem.h>
19#include <asm/pgtable.h> 19#include <asm/pgtable.h>
20#include <asm/mmu_context.h> 20#include <asm/mmu_context.h>
21#include <asm/cache_insns.h>
22#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
23 22
24/* 23/*
@@ -245,7 +244,7 @@ static void sh4_flush_cache_page(void *args)
245 if (map_coherent) 244 if (map_coherent)
246 vaddr = kmap_coherent(page, address); 245 vaddr = kmap_coherent(page, address);
247 else 246 else
248 vaddr = kmap_atomic(page); 247 vaddr = kmap_atomic(page, KM_USER0);
249 248
250 address = (unsigned long)vaddr; 249 address = (unsigned long)vaddr;
251 } 250 }
@@ -260,7 +259,7 @@ static void sh4_flush_cache_page(void *args)
260 if (map_coherent) 259 if (map_coherent)
261 kunmap_coherent(vaddr); 260 kunmap_coherent(vaddr);
262 else 261 else
263 kunmap_atomic(vaddr); 262 kunmap_atomic(vaddr, KM_USER0);
264 } 263 }
265} 264}
266 265
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c
index 616966a96cb..5a580ea0442 100644
--- a/arch/sh/mm/cache.c
+++ b/arch/sh/mm/cache.c
@@ -95,7 +95,7 @@ void copy_user_highpage(struct page *to, struct page *from,
95{ 95{
96 void *vfrom, *vto; 96 void *vfrom, *vto;
97 97
98 vto = kmap_atomic(to); 98 vto = kmap_atomic(to, KM_USER1);
99 99
100 if (boot_cpu_data.dcache.n_aliases && page_mapped(from) && 100 if (boot_cpu_data.dcache.n_aliases && page_mapped(from) &&
101 test_bit(PG_dcache_clean, &from->flags)) { 101 test_bit(PG_dcache_clean, &from->flags)) {
@@ -103,16 +103,16 @@ void copy_user_highpage(struct page *to, struct page *from,
103 copy_page(vto, vfrom); 103 copy_page(vto, vfrom);
104 kunmap_coherent(vfrom); 104 kunmap_coherent(vfrom);
105 } else { 105 } else {
106 vfrom = kmap_atomic(from); 106 vfrom = kmap_atomic(from, KM_USER0);
107 copy_page(vto, vfrom); 107 copy_page(vto, vfrom);
108 kunmap_atomic(vfrom); 108 kunmap_atomic(vfrom, KM_USER0);
109 } 109 }
110 110
111 if (pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK) || 111 if (pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK) ||
112 (vma->vm_flags & VM_EXEC)) 112 (vma->vm_flags & VM_EXEC))
113 __flush_purge_region(vto, PAGE_SIZE); 113 __flush_purge_region(vto, PAGE_SIZE);
114 114
115 kunmap_atomic(vto); 115 kunmap_atomic(vto, KM_USER1);
116 /* Make sure this page is cleared on other CPU's too before using it */ 116 /* Make sure this page is cleared on other CPU's too before using it */
117 smp_wmb(); 117 smp_wmb();
118} 118}
@@ -120,14 +120,14 @@ EXPORT_SYMBOL(copy_user_highpage);
120 120
121void clear_user_highpage(struct page *page, unsigned long vaddr) 121void clear_user_highpage(struct page *page, unsigned long vaddr)
122{ 122{
123 void *kaddr = kmap_atomic(page); 123 void *kaddr = kmap_atomic(page, KM_USER0);
124 124
125 clear_page(kaddr); 125 clear_page(kaddr);
126 126
127 if (pages_do_alias((unsigned long)kaddr, vaddr & PAGE_MASK)) 127 if (pages_do_alias((unsigned long)kaddr, vaddr & PAGE_MASK))
128 __flush_purge_region(kaddr, PAGE_SIZE); 128 __flush_purge_region(kaddr, PAGE_SIZE);
129 129
130 kunmap_atomic(kaddr); 130 kunmap_atomic(kaddr, KM_USER0);
131} 131}
132EXPORT_SYMBOL(clear_user_highpage); 132EXPORT_SYMBOL(clear_user_highpage);
133 133
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index b81d9dbf9fe..f251b5f2765 100644
--- a/arch/sh/mm/consistent.c
+++ b/arch/sh/mm/consistent.c
@@ -33,8 +33,7 @@ static int __init dma_init(void)
33fs_initcall(dma_init); 33fs_initcall(dma_init);
34 34
35void *dma_generic_alloc_coherent(struct device *dev, size_t size, 35void *dma_generic_alloc_coherent(struct device *dev, size_t size,
36 dma_addr_t *dma_handle, gfp_t gfp, 36 dma_addr_t *dma_handle, gfp_t gfp)
37 struct dma_attrs *attrs)
38{ 37{
39 void *ret, *ret_nocache; 38 void *ret, *ret_nocache;
40 int order = get_order(size); 39 int order = get_order(size);
@@ -65,8 +64,7 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size,
65} 64}
66 65
67void dma_generic_free_coherent(struct device *dev, size_t size, 66void dma_generic_free_coherent(struct device *dev, size_t size,
68 void *vaddr, dma_addr_t dma_handle, 67 void *vaddr, dma_addr_t dma_handle)
69 struct dma_attrs *attrs)
70{ 68{
71 int order = get_order(size); 69 int order = get_order(size);
72 unsigned long pfn = dma_handle >> PAGE_SHIFT; 70 unsigned long pfn = dma_handle >> PAGE_SHIFT;
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c
deleted file mode 100644
index 1f49c28affa..00000000000
--- a/arch/sh/mm/fault.c
+++ /dev/null
@@ -1,514 +0,0 @@
1/*
2 * Page fault handler for SH with an MMU.
3 *
4 * Copyright (C) 1999 Niibe Yutaka
5 * Copyright (C) 2003 - 2012 Paul Mundt
6 *
7 * Based on linux/arch/i386/mm/fault.c:
8 * Copyright (C) 1995 Linus Torvalds
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file "COPYING" in the main directory of this archive
12 * for more details.
13 */
14#include <linux/kernel.h>
15#include <linux/mm.h>
16#include <linux/hardirq.h>
17#include <linux/kprobes.h>
18#include <linux/perf_event.h>
19#include <linux/kdebug.h>
20#include <asm/io_trapped.h>
21#include <asm/mmu_context.h>
22#include <asm/tlbflush.h>
23#include <asm/traps.h>
24
25static inline int notify_page_fault(struct pt_regs *regs, int trap)
26{
27 int ret = 0;
28
29 if (kprobes_built_in() && !user_mode(regs)) {
30 preempt_disable();
31 if (kprobe_running() && kprobe_fault_handler(regs, trap))
32 ret = 1;
33 preempt_enable();
34 }
35
36 return ret;
37}
38
39static void
40force_sig_info_fault(int si_signo, int si_code, unsigned long address,
41 struct task_struct *tsk)
42{
43 siginfo_t info;
44
45 info.si_signo = si_signo;
46 info.si_errno = 0;
47 info.si_code = si_code;
48 info.si_addr = (void __user *)address;
49
50 force_sig_info(si_signo, &info, tsk);
51}
52
53/*
54 * This is useful to dump out the page tables associated with
55 * 'addr' in mm 'mm'.
56 */
57static void show_pte(struct mm_struct *mm, unsigned long addr)
58{
59 pgd_t *pgd;
60
61 if (mm) {
62 pgd = mm->pgd;
63 } else {
64 pgd = get_TTB();
65
66 if (unlikely(!pgd))
67 pgd = swapper_pg_dir;
68 }
69
70 printk(KERN_ALERT "pgd = %p\n", pgd);
71 pgd += pgd_index(addr);
72 printk(KERN_ALERT "[%08lx] *pgd=%0*Lx", addr,
73 (u32)(sizeof(*pgd) * 2), (u64)pgd_val(*pgd));
74
75 do {
76 pud_t *pud;
77 pmd_t *pmd;
78 pte_t *pte;
79
80 if (pgd_none(*pgd))
81 break;
82
83 if (pgd_bad(*pgd)) {
84 printk("(bad)");
85 break;
86 }
87
88 pud = pud_offset(pgd, addr);
89 if (PTRS_PER_PUD != 1)
90 printk(", *pud=%0*Lx", (u32)(sizeof(*pud) * 2),
91 (u64)pud_val(*pud));
92
93 if (pud_none(*pud))
94 break;
95
96 if (pud_bad(*pud)) {
97 printk("(bad)");
98 break;
99 }
100
101 pmd = pmd_offset(pud, addr);
102 if (PTRS_PER_PMD != 1)
103 printk(", *pmd=%0*Lx", (u32)(sizeof(*pmd) * 2),
104 (u64)pmd_val(*pmd));
105
106 if (pmd_none(*pmd))
107 break;
108
109 if (pmd_bad(*pmd)) {
110 printk("(bad)");
111 break;
112 }
113
114 /* We must not map this if we have highmem enabled */
115 if (PageHighMem(pfn_to_page(pmd_val(*pmd) >> PAGE_SHIFT)))
116 break;
117
118 pte = pte_offset_kernel(pmd, addr);
119 printk(", *pte=%0*Lx", (u32)(sizeof(*pte) * 2),
120 (u64)pte_val(*pte));
121 } while (0);
122
123 printk("\n");
124}
125
126static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address)
127{
128 unsigned index = pgd_index(address);
129 pgd_t *pgd_k;
130 pud_t *pud, *pud_k;
131 pmd_t *pmd, *pmd_k;
132
133 pgd += index;
134 pgd_k = init_mm.pgd + index;
135
136 if (!pgd_present(*pgd_k))
137 return NULL;
138
139 pud = pud_offset(pgd, address);
140 pud_k = pud_offset(pgd_k, address);
141 if (!pud_present(*pud_k))
142 return NULL;
143
144 if (!pud_present(*pud))
145 set_pud(pud, *pud_k);
146
147 pmd = pmd_offset(pud, address);
148 pmd_k = pmd_offset(pud_k, address);
149 if (!pmd_present(*pmd_k))
150 return NULL;
151
152 if (!pmd_present(*pmd))
153 set_pmd(pmd, *pmd_k);
154 else {
155 /*
156 * The page tables are fully synchronised so there must
157 * be another reason for the fault. Return NULL here to
158 * signal that we have not taken care of the fault.
159 */
160 BUG_ON(pmd_page(*pmd) != pmd_page(*pmd_k));
161 return NULL;
162 }
163
164 return pmd_k;
165}
166
167#ifdef CONFIG_SH_STORE_QUEUES
168#define __FAULT_ADDR_LIMIT P3_ADDR_MAX
169#else
170#define __FAULT_ADDR_LIMIT VMALLOC_END
171#endif
172
173/*
174 * Handle a fault on the vmalloc or module mapping area
175 */
176static noinline int vmalloc_fault(unsigned long address)
177{
178 pgd_t *pgd_k;
179 pmd_t *pmd_k;
180 pte_t *pte_k;
181
182 /* Make sure we are in vmalloc/module/P3 area: */
183 if (!(address >= VMALLOC_START && address < __FAULT_ADDR_LIMIT))
184 return -1;
185
186 /*
187 * Synchronize this task's top level page-table
188 * with the 'reference' page table.
189 *
190 * Do _not_ use "current" here. We might be inside
191 * an interrupt in the middle of a task switch..
192 */
193 pgd_k = get_TTB();
194 pmd_k = vmalloc_sync_one(pgd_k, address);
195 if (!pmd_k)
196 return -1;
197
198 pte_k = pte_offset_kernel(pmd_k, address);
199 if (!pte_present(*pte_k))
200 return -1;
201
202 return 0;
203}
204
205static void
206show_fault_oops(struct pt_regs *regs, unsigned long address)
207{
208 if (!oops_may_print())
209 return;
210
211 printk(KERN_ALERT "BUG: unable to handle kernel ");
212 if (address < PAGE_SIZE)
213 printk(KERN_CONT "NULL pointer dereference");
214 else
215 printk(KERN_CONT "paging request");
216
217 printk(KERN_CONT " at %08lx\n", address);
218 printk(KERN_ALERT "PC:");
219 printk_address(regs->pc, 1);
220
221 show_pte(NULL, address);
222}
223
224static noinline void
225no_context(struct pt_regs *regs, unsigned long error_code,
226 unsigned long address)
227{
228 /* Are we prepared to handle this kernel fault? */
229 if (fixup_exception(regs))
230 return;
231
232 if (handle_trapped_io(regs, address))
233 return;
234
235 /*
236 * Oops. The kernel tried to access some bad page. We'll have to
237 * terminate things with extreme prejudice.
238 */
239 bust_spinlocks(1);
240
241 show_fault_oops(regs, address);
242
243 die("Oops", regs, error_code);
244 bust_spinlocks(0);
245 do_exit(SIGKILL);
246}
247
248static void
249__bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
250 unsigned long address, int si_code)
251{
252 struct task_struct *tsk = current;
253
254 /* User mode accesses just cause a SIGSEGV */
255 if (user_mode(regs)) {
256 /*
257 * It's possible to have interrupts off here:
258 */
259 local_irq_enable();
260
261 force_sig_info_fault(SIGSEGV, si_code, address, tsk);
262
263 return;
264 }
265
266 no_context(regs, error_code, address);
267}
268
269static noinline void
270bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
271 unsigned long address)
272{
273 __bad_area_nosemaphore(regs, error_code, address, SEGV_MAPERR);
274}
275
276static void
277__bad_area(struct pt_regs *regs, unsigned long error_code,
278 unsigned long address, int si_code)
279{
280 struct mm_struct *mm = current->mm;
281
282 /*
283 * Something tried to access memory that isn't in our memory map..
284 * Fix it, but check if it's kernel or user first..
285 */
286 up_read(&mm->mmap_sem);
287
288 __bad_area_nosemaphore(regs, error_code, address, si_code);
289}
290
291static noinline void
292bad_area(struct pt_regs *regs, unsigned long error_code, unsigned long address)
293{
294 __bad_area(regs, error_code, address, SEGV_MAPERR);
295}
296
297static noinline void
298bad_area_access_error(struct pt_regs *regs, unsigned long error_code,
299 unsigned long address)
300{
301 __bad_area(regs, error_code, address, SEGV_ACCERR);
302}
303
304static void
305do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address)
306{
307 struct task_struct *tsk = current;
308 struct mm_struct *mm = tsk->mm;
309
310 up_read(&mm->mmap_sem);
311
312 /* Kernel mode? Handle exceptions or die: */
313 if (!user_mode(regs))
314 no_context(regs, error_code, address);
315
316 force_sig_info_fault(SIGBUS, BUS_ADRERR, address, tsk);
317}
318
319static noinline int
320mm_fault_error(struct pt_regs *regs, unsigned long error_code,
321 unsigned long address, unsigned int fault)
322{
323 /*
324 * Pagefault was interrupted by SIGKILL. We have no reason to
325 * continue pagefault.
326 */
327 if (fatal_signal_pending(current)) {
328 if (!(fault & VM_FAULT_RETRY))
329 up_read(&current->mm->mmap_sem);
330 if (!user_mode(regs))
331 no_context(regs, error_code, address);
332 return 1;
333 }
334
335 if (!(fault & VM_FAULT_ERROR))
336 return 0;
337
338 if (fault & VM_FAULT_OOM) {
339 /* Kernel mode? Handle exceptions or die: */
340 if (!user_mode(regs)) {
341 up_read(&current->mm->mmap_sem);
342 no_context(regs, error_code, address);
343 return 1;
344 }
345 up_read(&current->mm->mmap_sem);
346
347 /*
348 * We ran out of memory, call the OOM killer, and return the
349 * userspace (which will retry the fault, or kill us if we got
350 * oom-killed):
351 */
352 pagefault_out_of_memory();
353 } else {
354 if (fault & VM_FAULT_SIGBUS)
355 do_sigbus(regs, error_code, address);
356 else
357 BUG();
358 }
359
360 return 1;
361}
362
363static inline int access_error(int error_code, struct vm_area_struct *vma)
364{
365 if (error_code & FAULT_CODE_WRITE) {
366 /* write, present and write, not present: */
367 if (unlikely(!(vma->vm_flags & VM_WRITE)))
368 return 1;
369 return 0;
370 }
371
372 /* ITLB miss on NX page */
373 if (unlikely((error_code & FAULT_CODE_ITLB) &&
374 !(vma->vm_flags & VM_EXEC)))
375 return 1;
376
377 /* read, not present: */
378 if (unlikely(!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE))))
379 return 1;
380
381 return 0;
382}
383
384static int fault_in_kernel_space(unsigned long address)
385{
386 return address >= TASK_SIZE;
387}
388
389/*
390 * This routine handles page faults. It determines the address,
391 * and the problem, and then passes it off to one of the appropriate
392 * routines.
393 */
394asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
395 unsigned long error_code,
396 unsigned long address)
397{
398 unsigned long vec;
399 struct task_struct *tsk;
400 struct mm_struct *mm;
401 struct vm_area_struct * vma;
402 int fault;
403 int write = error_code & FAULT_CODE_WRITE;
404 unsigned int flags = (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
405 (write ? FAULT_FLAG_WRITE : 0));
406
407 tsk = current;
408 mm = tsk->mm;
409 vec = lookup_exception_vector();
410
411 /*
412 * We fault-in kernel-space virtual memory on-demand. The
413 * 'reference' page table is init_mm.pgd.
414 *
415 * NOTE! We MUST NOT take any locks for this case. We may
416 * be in an interrupt or a critical region, and should
417 * only copy the information from the master page table,
418 * nothing more.
419 */
420 if (unlikely(fault_in_kernel_space(address))) {
421 if (vmalloc_fault(address) >= 0)
422 return;
423 if (notify_page_fault(regs, vec))
424 return;
425
426 bad_area_nosemaphore(regs, error_code, address);
427 return;
428 }
429
430 if (unlikely(notify_page_fault(regs, vec)))
431 return;
432
433 /* Only enable interrupts if they were on before the fault */
434 if ((regs->sr & SR_IMASK) != SR_IMASK)
435 local_irq_enable();
436
437 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
438
439 /*
440 * If we're in an interrupt, have no user context or are running
441 * in an atomic region then we must not take the fault:
442 */
443 if (unlikely(in_atomic() || !mm)) {
444 bad_area_nosemaphore(regs, error_code, address);
445 return;
446 }
447
448retry:
449 down_read(&mm->mmap_sem);
450
451 vma = find_vma(mm, address);
452 if (unlikely(!vma)) {
453 bad_area(regs, error_code, address);
454 return;
455 }
456 if (likely(vma->vm_start <= address))
457 goto good_area;
458 if (unlikely(!(vma->vm_flags & VM_GROWSDOWN))) {
459 bad_area(regs, error_code, address);
460 return;
461 }
462 if (unlikely(expand_stack(vma, address))) {
463 bad_area(regs, error_code, address);
464 return;
465 }
466
467 /*
468 * Ok, we have a good vm_area for this memory access, so
469 * we can handle it..
470 */
471good_area:
472 if (unlikely(access_error(error_code, vma))) {
473 bad_area_access_error(regs, error_code, address);
474 return;
475 }
476
477 set_thread_fault_code(error_code);
478
479 /*
480 * If for any reason at all we couldn't handle the fault,
481 * make sure we exit gracefully rather than endlessly redo
482 * the fault.
483 */
484 fault = handle_mm_fault(mm, vma, address, flags);
485
486 if (unlikely(fault & (VM_FAULT_RETRY | VM_FAULT_ERROR)))
487 if (mm_fault_error(regs, error_code, address, fault))
488 return;
489
490 if (flags & FAULT_FLAG_ALLOW_RETRY) {
491 if (fault & VM_FAULT_MAJOR) {
492 tsk->maj_flt++;
493 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,
494 regs, address);
495 } else {
496 tsk->min_flt++;
497 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,
498 regs, address);
499 }
500 if (fault & VM_FAULT_RETRY) {
501 flags &= ~FAULT_FLAG_ALLOW_RETRY;
502 flags |= FAULT_FLAG_TRIED;
503
504 /*
505 * No need to up_read(&mm->mmap_sem) as we would
506 * have already released it in __lock_page_or_retry
507 * in mm/filemap.c.
508 */
509 goto retry;
510 }
511 }
512
513 up_read(&mm->mmap_sem);
514}
diff --git a/arch/sh/mm/flush-sh4.c b/arch/sh/mm/flush-sh4.c
index 0b85dd9dd3a..cef402678f4 100644
--- a/arch/sh/mm/flush-sh4.c
+++ b/arch/sh/mm/flush-sh4.c
@@ -1,8 +1,6 @@
1#include <linux/mm.h> 1#include <linux/mm.h>
2#include <asm/mmu_context.h> 2#include <asm/mmu_context.h>
3#include <asm/cache_insns.h>
4#include <asm/cacheflush.h> 3#include <asm/cacheflush.h>
5#include <asm/traps.h>
6 4
7/* 5/*
8 * Write back the dirty D-caches, but not invalidate them. 6 * Write back the dirty D-caches, but not invalidate them.
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 82cc576fab1..58a93fb3d96 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -18,7 +18,6 @@
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/memblock.h> 19#include <linux/memblock.h>
20#include <linux/dma-mapping.h> 20#include <linux/dma-mapping.h>
21#include <linux/export.h>
22#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
23#include <asm/mmzone.h> 22#include <asm/mmzone.h>
24#include <asm/kexec.h> 23#include <asm/kexec.h>
@@ -288,8 +287,6 @@ static void __init do_init_bootmem(void)
288static void __init early_reserve_mem(void) 287static void __init early_reserve_mem(void)
289{ 288{
290 unsigned long start_pfn; 289 unsigned long start_pfn;
291 u32 zero_base = (u32)__MEMORY_START + (u32)PHYSICAL_OFFSET;
292 u32 start = zero_base + (u32)CONFIG_ZERO_PAGE_OFFSET;
293 290
294 /* 291 /*
295 * Partially used pages are not usable - thus 292 * Partially used pages are not usable - thus
@@ -303,13 +300,15 @@ static void __init early_reserve_mem(void)
303 * this catches the (definitely buggy) case of us accidentally 300 * this catches the (definitely buggy) case of us accidentally
304 * initializing the bootmem allocator with an invalid RAM area. 301 * initializing the bootmem allocator with an invalid RAM area.
305 */ 302 */
306 memblock_reserve(start, (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) - start); 303 memblock_reserve(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET,
304 (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) -
305 (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET));
307 306
308 /* 307 /*
309 * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET. 308 * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET.
310 */ 309 */
311 if (CONFIG_ZERO_PAGE_OFFSET != 0) 310 if (CONFIG_ZERO_PAGE_OFFSET != 0)
312 memblock_reserve(zero_base, CONFIG_ZERO_PAGE_OFFSET); 311 memblock_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET);
313 312
314 /* 313 /*
315 * Handle additional early reservations 314 * Handle additional early reservations
@@ -324,6 +323,7 @@ void __init paging_init(void)
324 unsigned long vaddr, end; 323 unsigned long vaddr, end;
325 int nid; 324 int nid;
326 325
326 memblock_init();
327 sh_mv.mv_mem_init(); 327 sh_mv.mv_mem_init();
328 328
329 early_reserve_mem(); 329 early_reserve_mem();
@@ -336,7 +336,7 @@ void __init paging_init(void)
336 sh_mv.mv_mem_reserve(); 336 sh_mv.mv_mem_reserve();
337 337
338 memblock_enforce_memory_limit(memory_limit); 338 memblock_enforce_memory_limit(memory_limit);
339 memblock_allow_resize(); 339 memblock_analyze();
340 340
341 memblock_dump_all(); 341 memblock_dump_all();
342 342
diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c
index 6777177807c..afeb710ec5c 100644
--- a/arch/sh/mm/mmap.c
+++ b/arch/sh/mm/mmap.c
@@ -30,13 +30,25 @@ static inline unsigned long COLOUR_ALIGN(unsigned long addr,
30 return base + off; 30 return base + off;
31} 31}
32 32
33static inline unsigned long COLOUR_ALIGN_DOWN(unsigned long addr,
34 unsigned long pgoff)
35{
36 unsigned long base = addr & ~shm_align_mask;
37 unsigned long off = (pgoff << PAGE_SHIFT) & shm_align_mask;
38
39 if (base + off <= addr)
40 return base + off;
41
42 return base - off;
43}
44
33unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, 45unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
34 unsigned long len, unsigned long pgoff, unsigned long flags) 46 unsigned long len, unsigned long pgoff, unsigned long flags)
35{ 47{
36 struct mm_struct *mm = current->mm; 48 struct mm_struct *mm = current->mm;
37 struct vm_area_struct *vma; 49 struct vm_area_struct *vma;
50 unsigned long start_addr;
38 int do_colour_align; 51 int do_colour_align;
39 struct vm_unmapped_area_info info;
40 52
41 if (flags & MAP_FIXED) { 53 if (flags & MAP_FIXED) {
42 /* We do not accept a shared mapping if it would violate 54 /* We do not accept a shared mapping if it would violate
@@ -67,13 +79,47 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
67 return addr; 79 return addr;
68 } 80 }
69 81
70 info.flags = 0; 82 if (len > mm->cached_hole_size) {
71 info.length = len; 83 start_addr = addr = mm->free_area_cache;
72 info.low_limit = TASK_UNMAPPED_BASE; 84 } else {
73 info.high_limit = TASK_SIZE; 85 mm->cached_hole_size = 0;
74 info.align_mask = do_colour_align ? (PAGE_MASK & shm_align_mask) : 0; 86 start_addr = addr = TASK_UNMAPPED_BASE;
75 info.align_offset = pgoff << PAGE_SHIFT; 87 }
76 return vm_unmapped_area(&info); 88
89full_search:
90 if (do_colour_align)
91 addr = COLOUR_ALIGN(addr, pgoff);
92 else
93 addr = PAGE_ALIGN(mm->free_area_cache);
94
95 for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
96 /* At this point: (!vma || addr < vma->vm_end). */
97 if (unlikely(TASK_SIZE - len < addr)) {
98 /*
99 * Start a new search - just in case we missed
100 * some holes.
101 */
102 if (start_addr != TASK_UNMAPPED_BASE) {
103 start_addr = addr = TASK_UNMAPPED_BASE;
104 mm->cached_hole_size = 0;
105 goto full_search;
106 }
107 return -ENOMEM;
108 }
109 if (likely(!vma || addr + len <= vma->vm_start)) {
110 /*
111 * Remember the place where we stopped the search:
112 */
113 mm->free_area_cache = addr + len;
114 return addr;
115 }
116 if (addr + mm->cached_hole_size < vma->vm_start)
117 mm->cached_hole_size = vma->vm_start - addr;
118
119 addr = vma->vm_end;
120 if (do_colour_align)
121 addr = COLOUR_ALIGN(addr, pgoff);
122 }
77} 123}
78 124
79unsigned long 125unsigned long
@@ -85,7 +131,6 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
85 struct mm_struct *mm = current->mm; 131 struct mm_struct *mm = current->mm;
86 unsigned long addr = addr0; 132 unsigned long addr = addr0;
87 int do_colour_align; 133 int do_colour_align;
88 struct vm_unmapped_area_info info;
89 134
90 if (flags & MAP_FIXED) { 135 if (flags & MAP_FIXED) {
91 /* We do not accept a shared mapping if it would violate 136 /* We do not accept a shared mapping if it would violate
@@ -117,27 +162,73 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
117 return addr; 162 return addr;
118 } 163 }
119 164
120 info.flags = VM_UNMAPPED_AREA_TOPDOWN; 165 /* check if free_area_cache is useful for us */
121 info.length = len; 166 if (len <= mm->cached_hole_size) {
122 info.low_limit = PAGE_SIZE; 167 mm->cached_hole_size = 0;
123 info.high_limit = mm->mmap_base; 168 mm->free_area_cache = mm->mmap_base;
124 info.align_mask = do_colour_align ? (PAGE_MASK & shm_align_mask) : 0; 169 }
125 info.align_offset = pgoff << PAGE_SHIFT; 170
126 addr = vm_unmapped_area(&info); 171 /* either no address requested or can't fit in requested address hole */
172 addr = mm->free_area_cache;
173 if (do_colour_align) {
174 unsigned long base = COLOUR_ALIGN_DOWN(addr-len, pgoff);
127 175
176 addr = base + len;
177 }
178
179 /* make sure it can fit in the remaining address space */
180 if (likely(addr > len)) {
181 vma = find_vma(mm, addr-len);
182 if (!vma || addr <= vma->vm_start) {
183 /* remember the address as a hint for next time */
184 return (mm->free_area_cache = addr-len);
185 }
186 }
187
188 if (unlikely(mm->mmap_base < len))
189 goto bottomup;
190
191 addr = mm->mmap_base-len;
192 if (do_colour_align)
193 addr = COLOUR_ALIGN_DOWN(addr, pgoff);
194
195 do {
196 /*
197 * Lookup failure means no vma is above this address,
198 * else if new region fits below vma->vm_start,
199 * return with success:
200 */
201 vma = find_vma(mm, addr);
202 if (likely(!vma || addr+len <= vma->vm_start)) {
203 /* remember the address as a hint for next time */
204 return (mm->free_area_cache = addr);
205 }
206
207 /* remember the largest hole we saw so far */
208 if (addr + mm->cached_hole_size < vma->vm_start)
209 mm->cached_hole_size = vma->vm_start - addr;
210
211 /* try just below the current vma->vm_start */
212 addr = vma->vm_start-len;
213 if (do_colour_align)
214 addr = COLOUR_ALIGN_DOWN(addr, pgoff);
215 } while (likely(len < vma->vm_start));
216
217bottomup:
128 /* 218 /*
129 * A failed mmap() very likely causes application failure, 219 * A failed mmap() very likely causes application failure,
130 * so fall back to the bottom-up function here. This scenario 220 * so fall back to the bottom-up function here. This scenario
131 * can happen with large stack limits and large mmap() 221 * can happen with large stack limits and large mmap()
132 * allocations. 222 * allocations.
133 */ 223 */
134 if (addr & ~PAGE_MASK) { 224 mm->cached_hole_size = ~0UL;
135 VM_BUG_ON(addr != -ENOMEM); 225 mm->free_area_cache = TASK_UNMAPPED_BASE;
136 info.flags = 0; 226 addr = arch_get_unmapped_area(filp, addr0, len, pgoff, flags);
137 info.low_limit = TASK_UNMAPPED_BASE; 227 /*
138 info.high_limit = TASK_SIZE; 228 * Restore the topdown base:
139 addr = vm_unmapped_area(&info); 229 */
140 } 230 mm->free_area_cache = mm->mmap_base;
231 mm->cached_hole_size = ~0UL;
141 232
142 return addr; 233 return addr;
143} 234}
@@ -147,7 +238,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
147 * You really shouldn't be using read() or write() on /dev/mem. This 238 * You really shouldn't be using read() or write() on /dev/mem. This
148 * might go away in the future. 239 * might go away in the future.
149 */ 240 */
150int valid_phys_addr_range(phys_addr_t addr, size_t count) 241int valid_phys_addr_range(unsigned long addr, size_t count)
151{ 242{
152 if (addr < __MEMORY_START) 243 if (addr < __MEMORY_START)
153 return 0; 244 return 0;
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index 7160c9fd6fe..fad52f1f681 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -25,6 +25,7 @@
25#include <linux/vmalloc.h> 25#include <linux/vmalloc.h>
26#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
27#include <asm/sizes.h> 27#include <asm/sizes.h>
28#include <asm/system.h>
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
29#include <asm/pgtable.h> 30#include <asm/pgtable.h>
30#include <asm/page.h> 31#include <asm/page.h>
diff --git a/arch/sh/mm/sram.c b/arch/sh/mm/sram.c
index 2d8fa718d55..bc156ec4545 100644
--- a/arch/sh/mm/sram.c
+++ b/arch/sh/mm/sram.c
@@ -9,7 +9,6 @@
9 */ 9 */
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/errno.h>
13#include <asm/sram.h> 12#include <asm/sram.h>
14 13
15/* 14/*
diff --git a/arch/sh/mm/tlb-pteaex.c b/arch/sh/mm/tlb-pteaex.c
index 4db21adfe5d..b71db6af806 100644
--- a/arch/sh/mm/tlb-pteaex.c
+++ b/arch/sh/mm/tlb-pteaex.c
@@ -12,6 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <asm/system.h>
15#include <asm/mmu_context.h> 16#include <asm/mmu_context.h>
16#include <asm/cacheflush.h> 17#include <asm/cacheflush.h>
17 18
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c
index 6554fb439f0..7a940dbfc2e 100644
--- a/arch/sh/mm/tlb-sh3.c
+++ b/arch/sh/mm/tlb-sh3.c
@@ -20,6 +20,7 @@
20#include <linux/smp.h> 20#include <linux/smp.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22 22
23#include <asm/system.h>
23#include <asm/io.h> 24#include <asm/io.h>
24#include <asm/uaccess.h> 25#include <asm/uaccess.h>
25#include <asm/pgalloc.h> 26#include <asm/pgalloc.h>
diff --git a/arch/sh/mm/tlb-sh4.c b/arch/sh/mm/tlb-sh4.c
index d42dd7e443d..cfdf7930d29 100644
--- a/arch/sh/mm/tlb-sh4.c
+++ b/arch/sh/mm/tlb-sh4.c
@@ -11,6 +11,7 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/io.h> 13#include <linux/io.h>
14#include <asm/system.h>
14#include <asm/mmu_context.h> 15#include <asm/mmu_context.h>
15#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
16 17
diff --git a/arch/sh/mm/tlb-sh5.c b/arch/sh/mm/tlb-sh5.c
index ff1c40a31cb..f27dbe1c159 100644
--- a/arch/sh/mm/tlb-sh5.c
+++ b/arch/sh/mm/tlb-sh5.c
@@ -17,7 +17,7 @@
17/** 17/**
18 * sh64_tlb_init - Perform initial setup for the DTLB and ITLB. 18 * sh64_tlb_init - Perform initial setup for the DTLB and ITLB.
19 */ 19 */
20int __cpuinit sh64_tlb_init(void) 20int __init sh64_tlb_init(void)
21{ 21{
22 /* Assign some sane DTLB defaults */ 22 /* Assign some sane DTLB defaults */
23 cpu_data->dtlb.entries = 64; 23 cpu_data->dtlb.entries = 64;
@@ -182,43 +182,3 @@ void tlb_unwire_entry(void)
182 182
183 local_irq_restore(flags); 183 local_irq_restore(flags);
184} 184}
185
186void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte)
187{
188 unsigned long long ptel;
189 unsigned long long pteh=0;
190 struct tlb_info *tlbp;
191 unsigned long long next;
192 unsigned int fault_code = get_thread_fault_code();
193
194 /* Get PTEL first */
195 ptel = pte.pte_low;
196
197 /*
198 * Set PTEH register
199 */
200 pteh = neff_sign_extend(address & MMU_VPN_MASK);
201
202 /* Set the ASID. */
203 pteh |= get_asid() << PTEH_ASID_SHIFT;
204 pteh |= PTEH_VALID;
205
206 /* Set PTEL register, set_pte has performed the sign extension */
207 ptel &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */
208
209 if (fault_code & FAULT_CODE_ITLB)
210 tlbp = &cpu_data->itlb;
211 else
212 tlbp = &cpu_data->dtlb;
213
214 next = tlbp->next;
215 __flush_tlb_slot(next);
216 asm volatile ("putcfg %0,1,%2\n\n\t"
217 "putcfg %0,0,%1\n"
218 : : "r" (next), "r" (pteh), "r" (ptel) );
219
220 next += TLB_STEP;
221 if (next > tlbp->last)
222 next = tlbp->first;
223 tlbp->next = next;
224}
diff --git a/arch/sh/mm/tlbex_32.c b/arch/sh/mm/tlbex_32.c
deleted file mode 100644
index 382262dc0c4..00000000000
--- a/arch/sh/mm/tlbex_32.c
+++ /dev/null
@@ -1,78 +0,0 @@
1/*
2 * TLB miss handler for SH with an MMU.
3 *
4 * Copyright (C) 1999 Niibe Yutaka
5 * Copyright (C) 2003 - 2012 Paul Mundt
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11#include <linux/kernel.h>
12#include <linux/mm.h>
13#include <linux/kprobes.h>
14#include <linux/kdebug.h>
15#include <asm/mmu_context.h>
16#include <asm/thread_info.h>
17
18/*
19 * Called with interrupts disabled.
20 */
21asmlinkage int __kprobes
22handle_tlbmiss(struct pt_regs *regs, unsigned long error_code,
23 unsigned long address)
24{
25 pgd_t *pgd;
26 pud_t *pud;
27 pmd_t *pmd;
28 pte_t *pte;
29 pte_t entry;
30
31 /*
32 * We don't take page faults for P1, P2, and parts of P4, these
33 * are always mapped, whether it be due to legacy behaviour in
34 * 29-bit mode, or due to PMB configuration in 32-bit mode.
35 */
36 if (address >= P3SEG && address < P3_ADDR_MAX) {
37 pgd = pgd_offset_k(address);
38 } else {
39 if (unlikely(address >= TASK_SIZE || !current->mm))
40 return 1;
41
42 pgd = pgd_offset(current->mm, address);
43 }
44
45 pud = pud_offset(pgd, address);
46 if (pud_none_or_clear_bad(pud))
47 return 1;
48 pmd = pmd_offset(pud, address);
49 if (pmd_none_or_clear_bad(pmd))
50 return 1;
51 pte = pte_offset_kernel(pmd, address);
52 entry = *pte;
53 if (unlikely(pte_none(entry) || pte_not_present(entry)))
54 return 1;
55 if (unlikely(error_code && !pte_write(entry)))
56 return 1;
57
58 if (error_code)
59 entry = pte_mkdirty(entry);
60 entry = pte_mkyoung(entry);
61
62 set_pte(pte, entry);
63
64#if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SMP)
65 /*
66 * SH-4 does not set MMUCR.RC to the corresponding TLB entry in
67 * the case of an initial page write exception, so we need to
68 * flush it in order to avoid potential TLB entry duplication.
69 */
70 if (error_code == FAULT_CODE_INITIAL)
71 local_flush_tlb_one(get_asid(), address & PAGE_MASK);
72#endif
73
74 set_thread_fault_code(error_code);
75 update_mmu_cache(NULL, address, pte);
76
77 return 0;
78}
diff --git a/arch/sh/mm/tlbex_64.c b/arch/sh/mm/tlbex_64.c
deleted file mode 100644
index 8557548fc53..00000000000
--- a/arch/sh/mm/tlbex_64.c
+++ /dev/null
@@ -1,166 +0,0 @@
1/*
2 * The SH64 TLB miss.
3 *
4 * Original code from fault.c
5 * Copyright (C) 2000, 2001 Paolo Alberelli
6 *
7 * Fast PTE->TLB refill path
8 * Copyright (C) 2003 Richard.Curnow@superh.com
9 *
10 * IMPORTANT NOTES :
11 * The do_fast_page_fault function is called from a context in entry.S
12 * where very few registers have been saved. In particular, the code in
13 * this file must be compiled not to use ANY caller-save registers that
14 * are not part of the restricted save set. Also, it means that code in
15 * this file must not make calls to functions elsewhere in the kernel, or
16 * else the excepting context will see corruption in its caller-save
17 * registers. Plus, the entry.S save area is non-reentrant, so this code
18 * has to run with SR.BL==1, i.e. no interrupts taken inside it and panic
19 * on any exception.
20 *
21 * This file is subject to the terms and conditions of the GNU General Public
22 * License. See the file "COPYING" in the main directory of this archive
23 * for more details.
24 */
25#include <linux/signal.h>
26#include <linux/sched.h>
27#include <linux/kernel.h>
28#include <linux/errno.h>
29#include <linux/string.h>
30#include <linux/types.h>
31#include <linux/ptrace.h>
32#include <linux/mman.h>
33#include <linux/mm.h>
34#include <linux/smp.h>
35#include <linux/interrupt.h>
36#include <linux/kprobes.h>
37#include <asm/tlb.h>
38#include <asm/io.h>
39#include <asm/uaccess.h>
40#include <asm/pgalloc.h>
41#include <asm/mmu_context.h>
42
43static int handle_tlbmiss(unsigned long long protection_flags,
44 unsigned long address)
45{
46 pgd_t *pgd;
47 pud_t *pud;
48 pmd_t *pmd;
49 pte_t *pte;
50 pte_t entry;
51
52 if (is_vmalloc_addr((void *)address)) {
53 pgd = pgd_offset_k(address);
54 } else {
55 if (unlikely(address >= TASK_SIZE || !current->mm))
56 return 1;
57
58 pgd = pgd_offset(current->mm, address);
59 }
60
61 pud = pud_offset(pgd, address);
62 if (pud_none(*pud) || !pud_present(*pud))
63 return 1;
64
65 pmd = pmd_offset(pud, address);
66 if (pmd_none(*pmd) || !pmd_present(*pmd))
67 return 1;
68
69 pte = pte_offset_kernel(pmd, address);
70 entry = *pte;
71 if (pte_none(entry) || !pte_present(entry))
72 return 1;
73
74 /*
75 * If the page doesn't have sufficient protection bits set to
76 * service the kind of fault being handled, there's not much
77 * point doing the TLB refill. Punt the fault to the general
78 * handler.
79 */
80 if ((pte_val(entry) & protection_flags) != protection_flags)
81 return 1;
82
83 update_mmu_cache(NULL, address, pte);
84
85 return 0;
86}
87
88/*
89 * Put all this information into one structure so that everything is just
90 * arithmetic relative to a single base address. This reduces the number
91 * of movi/shori pairs needed just to load addresses of static data.
92 */
93struct expevt_lookup {
94 unsigned short protection_flags[8];
95 unsigned char is_text_access[8];
96 unsigned char is_write_access[8];
97};
98
99#define PRU (1<<9)
100#define PRW (1<<8)
101#define PRX (1<<7)
102#define PRR (1<<6)
103
104/* Sized as 8 rather than 4 to allow checking the PTE's PRU bit against whether
105 the fault happened in user mode or privileged mode. */
106static struct expevt_lookup expevt_lookup_table = {
107 .protection_flags = {PRX, PRX, 0, 0, PRR, PRR, PRW, PRW},
108 .is_text_access = {1, 1, 0, 0, 0, 0, 0, 0}
109};
110
111static inline unsigned int
112expevt_to_fault_code(unsigned long expevt)
113{
114 if (expevt == 0xa40)
115 return FAULT_CODE_ITLB;
116 else if (expevt == 0x060)
117 return FAULT_CODE_WRITE;
118
119 return 0;
120}
121
122/*
123 This routine handles page faults that can be serviced just by refilling a
124 TLB entry from an existing page table entry. (This case represents a very
125 large majority of page faults.) Return 1 if the fault was successfully
126 handled. Return 0 if the fault could not be handled. (This leads into the
127 general fault handling in fault.c which deals with mapping file-backed
128 pages, stack growth, segmentation faults, swapping etc etc)
129 */
130asmlinkage int __kprobes
131do_fast_page_fault(unsigned long long ssr_md, unsigned long long expevt,
132 unsigned long address)
133{
134 unsigned long long protection_flags;
135 unsigned long long index;
136 unsigned long long expevt4;
137 unsigned int fault_code;
138
139 /* The next few lines implement a way of hashing EXPEVT into a
140 * small array index which can be used to lookup parameters
141 * specific to the type of TLBMISS being handled.
142 *
143 * Note:
144 * ITLBMISS has EXPEVT==0xa40
145 * RTLBMISS has EXPEVT==0x040
146 * WTLBMISS has EXPEVT==0x060
147 */
148 expevt4 = (expevt >> 4);
149 /* TODO : xor ssr_md into this expression too. Then we can check
150 * that PRU is set when it needs to be. */
151 index = expevt4 ^ (expevt4 >> 5);
152 index &= 7;
153
154 fault_code = expevt_to_fault_code(expevt);
155
156 protection_flags = expevt_lookup_table.protection_flags[index];
157
158 if (expevt_lookup_table.is_text_access[index])
159 fault_code |= FAULT_CODE_ITLB;
160 if (!ssr_md)
161 fault_code |= FAULT_CODE_USER;
162
163 set_thread_fault_code(fault_code);
164
165 return handle_tlbmiss(protection_flags, address);
166}
diff --git a/arch/sh/mm/tlbflush_64.c b/arch/sh/mm/tlbflush_64.c
index f33fdd2558e..e3430e093d4 100644
--- a/arch/sh/mm/tlbflush_64.c
+++ b/arch/sh/mm/tlbflush_64.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2000, 2001 Paolo Alberelli 4 * Copyright (C) 2000, 2001 Paolo Alberelli
5 * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes) 5 * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes)
6 * Copyright (C) 2003 - 2012 Paul Mundt 6 * Copyright (C) 2003 - 2009 Paul Mundt
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
@@ -22,12 +22,301 @@
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/perf_event.h> 23#include <linux/perf_event.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <asm/system.h>
25#include <asm/io.h> 26#include <asm/io.h>
26#include <asm/tlb.h> 27#include <asm/tlb.h>
27#include <asm/uaccess.h> 28#include <asm/uaccess.h>
28#include <asm/pgalloc.h> 29#include <asm/pgalloc.h>
29#include <asm/mmu_context.h> 30#include <asm/mmu_context.h>
30 31
32extern void die(const char *,struct pt_regs *,long);
33
34#define PFLAG(val,flag) (( (val) & (flag) ) ? #flag : "" )
35#define PPROT(flag) PFLAG(pgprot_val(prot),flag)
36
37static inline void print_prots(pgprot_t prot)
38{
39 printk("prot is 0x%016llx\n",pgprot_val(prot));
40
41 printk("%s %s %s %s %s\n",PPROT(_PAGE_SHARED),PPROT(_PAGE_READ),
42 PPROT(_PAGE_EXECUTE),PPROT(_PAGE_WRITE),PPROT(_PAGE_USER));
43}
44
45static inline void print_vma(struct vm_area_struct *vma)
46{
47 printk("vma start 0x%08lx\n", vma->vm_start);
48 printk("vma end 0x%08lx\n", vma->vm_end);
49
50 print_prots(vma->vm_page_prot);
51 printk("vm_flags 0x%08lx\n", vma->vm_flags);
52}
53
54static inline void print_task(struct task_struct *tsk)
55{
56 printk("Task pid %d\n", task_pid_nr(tsk));
57}
58
59static pte_t *lookup_pte(struct mm_struct *mm, unsigned long address)
60{
61 pgd_t *dir;
62 pud_t *pud;
63 pmd_t *pmd;
64 pte_t *pte;
65 pte_t entry;
66
67 dir = pgd_offset(mm, address);
68 if (pgd_none(*dir))
69 return NULL;
70
71 pud = pud_offset(dir, address);
72 if (pud_none(*pud))
73 return NULL;
74
75 pmd = pmd_offset(pud, address);
76 if (pmd_none(*pmd))
77 return NULL;
78
79 pte = pte_offset_kernel(pmd, address);
80 entry = *pte;
81 if (pte_none(entry) || !pte_present(entry))
82 return NULL;
83
84 return pte;
85}
86
87/*
88 * This routine handles page faults. It determines the address,
89 * and the problem, and then passes it off to one of the appropriate
90 * routines.
91 */
92asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
93 unsigned long textaccess, unsigned long address)
94{
95 struct task_struct *tsk;
96 struct mm_struct *mm;
97 struct vm_area_struct * vma;
98 const struct exception_table_entry *fixup;
99 pte_t *pte;
100 int fault;
101
102 /* SIM
103 * Note this is now called with interrupts still disabled
104 * This is to cope with being called for a missing IO port
105 * address with interrupts disabled. This should be fixed as
106 * soon as we have a better 'fast path' miss handler.
107 *
108 * Plus take care how you try and debug this stuff.
109 * For example, writing debug data to a port which you
110 * have just faulted on is not going to work.
111 */
112
113 tsk = current;
114 mm = tsk->mm;
115
116 /* Not an IO address, so reenable interrupts */
117 local_irq_enable();
118
119 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
120
121 /*
122 * If we're in an interrupt or have no user
123 * context, we must not take the fault..
124 */
125 if (in_atomic() || !mm)
126 goto no_context;
127
128 /* TLB misses upon some cache flushes get done under cli() */
129 down_read(&mm->mmap_sem);
130
131 vma = find_vma(mm, address);
132
133 if (!vma) {
134#ifdef DEBUG_FAULT
135 print_task(tsk);
136 printk("%s:%d fault, address is 0x%08x PC %016Lx textaccess %d writeaccess %d\n",
137 __func__, __LINE__,
138 address,regs->pc,textaccess,writeaccess);
139 show_regs(regs);
140#endif
141 goto bad_area;
142 }
143 if (vma->vm_start <= address) {
144 goto good_area;
145 }
146
147 if (!(vma->vm_flags & VM_GROWSDOWN)) {
148#ifdef DEBUG_FAULT
149 print_task(tsk);
150 printk("%s:%d fault, address is 0x%08x PC %016Lx textaccess %d writeaccess %d\n",
151 __func__, __LINE__,
152 address,regs->pc,textaccess,writeaccess);
153 show_regs(regs);
154
155 print_vma(vma);
156#endif
157 goto bad_area;
158 }
159 if (expand_stack(vma, address)) {
160#ifdef DEBUG_FAULT
161 print_task(tsk);
162 printk("%s:%d fault, address is 0x%08x PC %016Lx textaccess %d writeaccess %d\n",
163 __func__, __LINE__,
164 address,regs->pc,textaccess,writeaccess);
165 show_regs(regs);
166#endif
167 goto bad_area;
168 }
169/*
170 * Ok, we have a good vm_area for this memory access, so
171 * we can handle it..
172 */
173good_area:
174 if (textaccess) {
175 if (!(vma->vm_flags & VM_EXEC))
176 goto bad_area;
177 } else {
178 if (writeaccess) {
179 if (!(vma->vm_flags & VM_WRITE))
180 goto bad_area;
181 } else {
182 if (!(vma->vm_flags & VM_READ))
183 goto bad_area;
184 }
185 }
186
187 /*
188 * If for any reason at all we couldn't handle the fault,
189 * make sure we exit gracefully rather than endlessly redo
190 * the fault.
191 */
192 fault = handle_mm_fault(mm, vma, address, writeaccess ? FAULT_FLAG_WRITE : 0);
193 if (unlikely(fault & VM_FAULT_ERROR)) {
194 if (fault & VM_FAULT_OOM)
195 goto out_of_memory;
196 else if (fault & VM_FAULT_SIGBUS)
197 goto do_sigbus;
198 BUG();
199 }
200
201 if (fault & VM_FAULT_MAJOR) {
202 tsk->maj_flt++;
203 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,
204 regs, address);
205 } else {
206 tsk->min_flt++;
207 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,
208 regs, address);
209 }
210
211 /* If we get here, the page fault has been handled. Do the TLB refill
212 now from the newly-setup PTE, to avoid having to fault again right
213 away on the same instruction. */
214 pte = lookup_pte (mm, address);
215 if (!pte) {
216 /* From empirical evidence, we can get here, due to
217 !pte_present(pte). (e.g. if a swap-in occurs, and the page
218 is swapped back out again before the process that wanted it
219 gets rescheduled?) */
220 goto no_pte;
221 }
222
223 __do_tlb_refill(address, textaccess, pte);
224
225no_pte:
226
227 up_read(&mm->mmap_sem);
228 return;
229
230/*
231 * Something tried to access memory that isn't in our memory map..
232 * Fix it, but check if it's kernel or user first..
233 */
234bad_area:
235#ifdef DEBUG_FAULT
236 printk("fault:bad area\n");
237#endif
238 up_read(&mm->mmap_sem);
239
240 if (user_mode(regs)) {
241 static int count=0;
242 siginfo_t info;
243 if (count < 4) {
244 /* This is really to help debug faults when starting
245 * usermode, so only need a few */
246 count++;
247 printk("user mode bad_area address=%08lx pid=%d (%s) pc=%08lx\n",
248 address, task_pid_nr(current), current->comm,
249 (unsigned long) regs->pc);
250#if 0
251 show_regs(regs);
252#endif
253 }
254 if (is_global_init(tsk)) {
255 panic("INIT had user mode bad_area\n");
256 }
257 tsk->thread.address = address;
258 tsk->thread.error_code = writeaccess;
259 info.si_signo = SIGSEGV;
260 info.si_errno = 0;
261 info.si_addr = (void *) address;
262 force_sig_info(SIGSEGV, &info, tsk);
263 return;
264 }
265
266no_context:
267#ifdef DEBUG_FAULT
268 printk("fault:No context\n");
269#endif
270 /* Are we prepared to handle this kernel fault? */
271 fixup = search_exception_tables(regs->pc);
272 if (fixup) {
273 regs->pc = fixup->fixup;
274 return;
275 }
276
277/*
278 * Oops. The kernel tried to access some bad page. We'll have to
279 * terminate things with extreme prejudice.
280 *
281 */
282 if (address < PAGE_SIZE)
283 printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
284 else
285 printk(KERN_ALERT "Unable to handle kernel paging request");
286 printk(" at virtual address %08lx\n", address);
287 printk(KERN_ALERT "pc = %08Lx%08Lx\n", regs->pc >> 32, regs->pc & 0xffffffff);
288 die("Oops", regs, writeaccess);
289 do_exit(SIGKILL);
290
291/*
292 * We ran out of memory, or some other thing happened to us that made
293 * us unable to handle the page fault gracefully.
294 */
295out_of_memory:
296 up_read(&mm->mmap_sem);
297 if (!user_mode(regs))
298 goto no_context;
299 pagefault_out_of_memory();
300 return;
301
302do_sigbus:
303 printk("fault:Do sigbus\n");
304 up_read(&mm->mmap_sem);
305
306 /*
307 * Send a sigbus, regardless of whether we were in kernel
308 * or user mode.
309 */
310 tsk->thread.address = address;
311 tsk->thread.error_code = writeaccess;
312 tsk->thread.trap_no = 14;
313 force_sig(SIGBUS, tsk);
314
315 /* Kernel mode? Handle exceptions or die */
316 if (!user_mode(regs))
317 goto no_context;
318}
319
31void local_flush_tlb_one(unsigned long asid, unsigned long page) 320void local_flush_tlb_one(unsigned long asid, unsigned long page)
32{ 321{
33 unsigned long long match, pteh=0, lpage; 322 unsigned long long match, pteh=0, lpage;
@@ -170,3 +459,7 @@ void __flush_tlb_global(void)
170{ 459{
171 flush_tlb_all(); 460 flush_tlb_all();
172} 461}
462
463void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte)
464{
465}
diff --git a/arch/sh/tools/mach-types b/arch/sh/tools/mach-types
index 569977e52c9..6dd56c4d005 100644
--- a/arch/sh/tools/mach-types
+++ b/arch/sh/tools/mach-types
@@ -51,8 +51,6 @@ SDK7780 SH_SDK7780
51MIGOR SH_MIGOR 51MIGOR SH_MIGOR
52RSK7201 SH_RSK7201 52RSK7201 SH_RSK7201
53RSK7203 SH_RSK7203 53RSK7203 SH_RSK7203
54RSK7264 SH_RSK7264
55RSK7269 SH_RSK7269
56AP325RXA SH_AP325RXA 54AP325RXA SH_AP325RXA
57SH2007 SH_SH2007 55SH2007 SH_SH2007
58SH7757LCR SH_SH7757LCR 56SH7757LCR SH_SH7757LCR