2023-01-13 06:36:56

by Christoph Hellwig

[permalink] [raw]
Subject: remove arch/sh

Hi all,

arch/sh has been a long drag because it supports a lot of SOCs, and most
of them haven't even been converted to device tree infrastructure. These
SOCs are generally obsolete as well, and all of the support has been barely
maintained for almost 10 years, and not at all for more than 1 year.

Drop arch/sh and everything that depends on it.

Diffstat:
Documentation/sh/booting.rst | 12
Documentation/sh/features.rst | 3
Documentation/sh/index.rst | 56
Documentation/sh/new-machine.rst | 277 -
Documentation/sh/register-banks.rst | 40
arch/sh/Kbuild | 7
arch/sh/Kconfig | 793 ----
arch/sh/Kconfig.cpu | 100
arch/sh/Kconfig.debug | 78
arch/sh/Makefile | 215 -
arch/sh/boards/Kconfig | 400 --
arch/sh/boards/Makefile | 20
arch/sh/boards/board-apsh4a3a.c | 182
arch/sh/boards/board-apsh4ad0a.c | 132
arch/sh/boards/board-edosk7705.c | 79
arch/sh/boards/board-edosk7760.c | 178
arch/sh/boards/board-espt.c | 105
arch/sh/boards/board-magicpanelr2.c | 390 --
arch/sh/boards/board-polaris.c | 156
arch/sh/boards/board-secureedge5410.c | 75
arch/sh/boards/board-sh2007.c | 146
arch/sh/boards/board-sh7757lcr.c | 604 ---
arch/sh/boards/board-sh7785lcr.c | 384 --
arch/sh/boards/board-shmin.c | 35
arch/sh/boards/board-titan.c | 21
arch/sh/boards/board-urquell.c | 218 -
arch/sh/boards/mach-ap325rxa/Makefile | 3
arch/sh/boards/mach-ap325rxa/sdram.S | 66
arch/sh/boards/mach-ap325rxa/setup.c | 573 ---
arch/sh/boards/mach-dreamcast/Makefile | 7
arch/sh/boards/mach-dreamcast/irq.c | 155
arch/sh/boards/mach-dreamcast/rtc.c | 96
arch/sh/boards/mach-dreamcast/setup.c | 39
arch/sh/boards/mach-ecovec24/Makefile | 10
arch/sh/boards/mach-ecovec24/sdram.S | 108
arch/sh/boards/mach-ecovec24/setup.c | 1521 --------
arch/sh/boards/mach-highlander/Kconfig | 26
arch/sh/boards/mach-highlander/Makefile | 12
arch/sh/boards/mach-highlander/irq-r7780mp.c | 71
arch/sh/boards/mach-highlander/irq-r7780rp.c | 64
arch/sh/boards/mach-highlander/irq-r7785rp.c | 83
arch/sh/boards/mach-highlander/pinmux-r7785rp.c | 17
arch/sh/boards/mach-highlander/psw.c | 119
arch/sh/boards/mach-highlander/setup.c | 416 --
arch/sh/boards/mach-hp6xx/Makefile | 8
arch/sh/boards/mach-hp6xx/hp6xx_apm.c | 109
arch/sh/boards/mach-hp6xx/pm.c | 156
arch/sh/boards/mach-hp6xx/pm_wakeup.S | 39
arch/sh/boards/mach-hp6xx/setup.c | 172
arch/sh/boards/mach-kfr2r09/Makefile | 5
arch/sh/boards/mach-kfr2r09/lcd_wqvga.c | 275 -
arch/sh/boards/mach-kfr2r09/sdram.S | 77
arch/sh/boards/mach-kfr2r09/setup.c | 649 ---
arch/sh/boards/mach-landisk/Makefile | 6
arch/sh/boards/mach-landisk/gio.c | 164
arch/sh/boards/mach-landisk/irq.c | 63
arch/sh/boards/mach-landisk/psw.c | 140
arch/sh/boards/mach-landisk/setup.c | 102
arch/sh/boards/mach-lboxre2/Makefile | 6
arch/sh/boards/mach-lboxre2/irq.c | 27
arch/sh/boards/mach-lboxre2/setup.c | 79
arch/sh/boards/mach-microdev/Makefile | 6
arch/sh/boards/mach-microdev/fdc37c93xapm.c | 157
arch/sh/boards/mach-microdev/io.c | 123
arch/sh/boards/mach-microdev/irq.c | 150
arch/sh/boards/mach-microdev/setup.c | 197 -
arch/sh/boards/mach-migor/Kconfig | 16
arch/sh/boards/mach-migor/Makefile | 3
arch/sh/boards/mach-migor/lcd_qvga.c | 163
arch/sh/boards/mach-migor/sdram.S | 66
arch/sh/boards/mach-migor/setup.c | 649 ---
arch/sh/boards/mach-r2d/Kconfig | 24
arch/sh/boards/mach-r2d/Makefile | 6
arch/sh/boards/mach-r2d/irq.c | 156
arch/sh/boards/mach-r2d/setup.c | 305 -
arch/sh/boards/mach-rsk/Kconfig | 29
arch/sh/boards/mach-rsk/Makefile | 5
arch/sh/boards/mach-rsk/devices-rsk7203.c | 137
arch/sh/boards/mach-rsk/devices-rsk7264.c | 55
arch/sh/boards/mach-rsk/devices-rsk7269.c | 57
arch/sh/boards/mach-rsk/setup.c | 84
arch/sh/boards/mach-sdk7780/Kconfig | 17
arch/sh/boards/mach-sdk7780/Makefile | 6
arch/sh/boards/mach-sdk7780/irq.c | 43
arch/sh/boards/mach-sdk7780/setup.c | 96
arch/sh/boards/mach-sdk7786/Makefile | 5
arch/sh/boards/mach-sdk7786/fpga.c | 69
arch/sh/boards/mach-sdk7786/gpio.c | 46
arch/sh/boards/mach-sdk7786/irq.c | 45
arch/sh/boards/mach-sdk7786/nmi.c | 80
arch/sh/boards/mach-sdk7786/setup.c | 266 -
arch/sh/boards/mach-sdk7786/sram.c | 69
arch/sh/boards/mach-se/7206/Makefile | 6
arch/sh/boards/mach-se/7206/irq.c | 151
arch/sh/boards/mach-se/7206/setup.c | 96
arch/sh/boards/mach-se/7343/Makefile | 6
arch/sh/boards/mach-se/7343/irq.c | 123
arch/sh/boards/mach-se/7343/setup.c | 182
arch/sh/boards/mach-se/770x/Makefile | 6
arch/sh/boards/mach-se/770x/irq.c | 109
arch/sh/boards/mach-se/770x/setup.c | 205 -
arch/sh/boards/mach-se/7721/Makefile | 2
arch/sh/boards/mach-se/7721/irq.c | 42
arch/sh/boards/mach-se/7721/setup.c | 92
arch/sh/boards/mach-se/7722/Makefile | 11
arch/sh/boards/mach-se/7722/irq.c | 116
arch/sh/boards/mach-se/7722/setup.c | 190
arch/sh/boards/mach-se/7724/Makefile | 11
arch/sh/boards/mach-se/7724/irq.c | 143
arch/sh/boards/mach-se/7724/sdram.S | 128
arch/sh/boards/mach-se/7724/setup.c | 986 -----
arch/sh/boards/mach-se/7751/Makefile | 6
arch/sh/boards/mach-se/7751/irq.c | 51
arch/sh/boards/mach-se/7751/setup.c | 60
arch/sh/boards/mach-se/7780/Makefile | 11
arch/sh/boards/mach-se/7780/irq.c | 65
arch/sh/boards/mach-se/7780/setup.c | 111
arch/sh/boards/mach-se/Makefile | 11
arch/sh/boards/mach-se/board-se7619.c | 27
arch/sh/boards/mach-sh03/Makefile | 7
arch/sh/boards/mach-sh03/rtc.c | 143
arch/sh/boards/mach-sh03/setup.c | 97
arch/sh/boards/mach-sh7763rdp/Makefile | 2
arch/sh/boards/mach-sh7763rdp/irq.c | 42
arch/sh/boards/mach-sh7763rdp/setup.c | 213 -
arch/sh/boards/mach-x3proto/Makefile | 4
arch/sh/boards/mach-x3proto/gpio.c | 136
arch/sh/boards/mach-x3proto/ilsel.c | 156
arch/sh/boards/mach-x3proto/setup.c | 270 -
arch/sh/boards/of-generic.c | 172
arch/sh/boot/.gitignore | 5
arch/sh/boot/Makefile | 115
arch/sh/boot/compressed/.gitignore | 2
arch/sh/boot/compressed/Makefile | 66
arch/sh/boot/compressed/ashiftrt.S | 2
arch/sh/boot/compressed/ashldi3.c | 2
arch/sh/boot/compressed/ashlsi3.S | 2
arch/sh/boot/compressed/ashrsi3.S | 2
arch/sh/boot/compressed/cache.c | 13
arch/sh/boot/compressed/head_32.S | 126
arch/sh/boot/compressed/head_64.S | 159
arch/sh/boot/compressed/lshrsi3.S | 2
arch/sh/boot/compressed/misc.c | 146
arch/sh/boot/compressed/vmlinux.scr | 10
arch/sh/boot/dts/Makefile | 2
arch/sh/boot/dts/j2_mimas_v2.dts | 99
arch/sh/boot/romimage/Makefile | 30
arch/sh/boot/romimage/head.S | 85
arch/sh/boot/romimage/mmcif-sh7724.c | 78
arch/sh/boot/romimage/vmlinux.scr | 8
arch/sh/cchips/Kconfig | 46
arch/sh/cchips/hd6446x/Makefile | 4
arch/sh/cchips/hd6446x/hd64461.c | 112
arch/sh/configs/ap325rxa_defconfig | 103
arch/sh/configs/apsh4a3a_defconfig | 91
arch/sh/configs/apsh4ad0a_defconfig | 122
arch/sh/configs/dreamcast_defconfig | 72
arch/sh/configs/ecovec24-romimage_defconfig | 58
arch/sh/configs/ecovec24_defconfig | 132
arch/sh/configs/edosk7705_defconfig | 35
arch/sh/configs/edosk7760_defconfig | 114
arch/sh/configs/espt_defconfig | 114
arch/sh/configs/hp6xx_defconfig | 60
arch/sh/configs/j2_defconfig | 42
arch/sh/configs/kfr2r09-romimage_defconfig | 53
arch/sh/configs/kfr2r09_defconfig | 84
arch/sh/configs/landisk_defconfig | 115
arch/sh/configs/lboxre2_defconfig | 62
arch/sh/configs/magicpanelr2_defconfig | 90
arch/sh/configs/microdev_defconfig | 43
arch/sh/configs/migor_defconfig | 94
arch/sh/configs/polaris_defconfig | 83
arch/sh/configs/r7780mp_defconfig | 109
arch/sh/configs/r7785rp_defconfig | 107
arch/sh/configs/rsk7201_defconfig | 63
arch/sh/configs/rsk7203_defconfig | 121
arch/sh/configs/rsk7264_defconfig | 71
arch/sh/configs/rsk7269_defconfig | 56
arch/sh/configs/rts7751r2d1_defconfig | 91
arch/sh/configs/rts7751r2dplus_defconfig | 96
arch/sh/configs/sdk7780_defconfig | 139
arch/sh/configs/sdk7786_defconfig | 217 -
arch/sh/configs/se7206_defconfig | 108
arch/sh/configs/se7343_defconfig | 96
arch/sh/configs/se7619_defconfig | 43
arch/sh/configs/se7705_defconfig | 54
arch/sh/configs/se7712_defconfig | 101
arch/sh/configs/se7721_defconfig | 127
arch/sh/configs/se7722_defconfig | 56
arch/sh/configs/se7724_defconfig | 132
arch/sh/configs/se7750_defconfig | 55
arch/sh/configs/se7751_defconfig | 46
arch/sh/configs/se7780_defconfig | 106
arch/sh/configs/secureedge5410_defconfig | 53
arch/sh/configs/sh03_defconfig | 126
arch/sh/configs/sh2007_defconfig | 199 -
arch/sh/configs/sh7710voipgw_defconfig | 55
arch/sh/configs/sh7724_generic_defconfig | 41
arch/sh/configs/sh7757lcr_defconfig | 85
arch/sh/configs/sh7763rdp_defconfig | 116
arch/sh/configs/sh7770_generic_defconfig | 43
arch/sh/configs/sh7785lcr_32bit_defconfig | 149
arch/sh/configs/sh7785lcr_defconfig | 117
arch/sh/configs/shmin_defconfig | 52
arch/sh/configs/shx3_defconfig | 103
arch/sh/configs/titan_defconfig | 272 -
arch/sh/configs/ul2_defconfig | 84
arch/sh/configs/urquell_defconfig | 147
arch/sh/drivers/Kconfig | 20
arch/sh/drivers/Makefile | 11
arch/sh/drivers/dma/Kconfig | 74
arch/sh/drivers/dma/Makefile | 9
arch/sh/drivers/dma/dma-api.c | 417 --
arch/sh/drivers/dma/dma-g2.c | 197 -
arch/sh/drivers/dma/dma-pvr2.c | 102
arch/sh/drivers/dma/dma-sh.c | 414 --
arch/sh/drivers/dma/dma-sysfs.c | 164
arch/sh/drivers/dma/dmabrg.c | 196 -
arch/sh/drivers/heartbeat.c | 152
arch/sh/drivers/pci/Makefile | 27
arch/sh/drivers/pci/common.c | 159
arch/sh/drivers/pci/fixups-dreamcast.c | 84
arch/sh/drivers/pci/fixups-landisk.c | 57
arch/sh/drivers/pci/fixups-r7780rp.c | 18
arch/sh/drivers/pci/fixups-rts7751r2d.c | 64
arch/sh/drivers/pci/fixups-sdk7780.c | 40
arch/sh/drivers/pci/fixups-sdk7786.c | 64
arch/sh/drivers/pci/fixups-se7751.c | 113
arch/sh/drivers/pci/fixups-sh03.c | 33
arch/sh/drivers/pci/fixups-snapgear.c | 37
arch/sh/drivers/pci/fixups-titan.c | 36
arch/sh/drivers/pci/ops-dreamcast.c | 79
arch/sh/drivers/pci/ops-sh4.c | 105
arch/sh/drivers/pci/ops-sh7786.c | 168
arch/sh/drivers/pci/pci-dreamcast.c | 97
arch/sh/drivers/pci/pci-sh4.h | 182
arch/sh/drivers/pci/pci-sh7751.c | 179
arch/sh/drivers/pci/pci-sh7751.h | 126
arch/sh/drivers/pci/pci-sh7780.c | 407 --
arch/sh/drivers/pci/pci-sh7780.h | 43
arch/sh/drivers/pci/pci.c | 298 -
arch/sh/drivers/pci/pcie-sh7786.c | 609 ---
arch/sh/drivers/pci/pcie-sh7786.h | 577 ---
arch/sh/drivers/platform_early.c | 340 -
arch/sh/drivers/push-switch.c | 136
arch/sh/drivers/superhyway/Makefile | 7
arch/sh/drivers/superhyway/ops-sh4-202.c | 168
arch/sh/include/asm/Kbuild | 5
arch/sh/include/asm/adc.h | 12
arch/sh/include/asm/addrspace.h | 63
arch/sh/include/asm/alignment.h | 22
arch/sh/include/asm/asm-offsets.h | 2
arch/sh/include/asm/atomic-grb.h | 86
arch/sh/include/asm/atomic-irq.h | 72
arch/sh/include/asm/atomic-llsc.h | 88
arch/sh/include/asm/atomic.h | 38
arch/sh/include/asm/barrier.h | 45
arch/sh/include/asm/bitops-cas.h | 94
arch/sh/include/asm/bitops-grb.h | 173
arch/sh/include/asm/bitops-llsc.h | 147
arch/sh/include/asm/bitops-op32.h | 143
arch/sh/include/asm/bitops.h | 72
arch/sh/include/asm/bl_bit.h | 2
arch/sh/include/asm/bl_bit_32.h | 34
arch/sh/include/asm/bug.h | 121
arch/sh/include/asm/bugs.h | 74
arch/sh/include/asm/cache.h | 46
arch/sh/include/asm/cache_insns.h | 2
arch/sh/include/asm/cache_insns_32.h | 22
arch/sh/include/asm/cacheflush.h | 106
arch/sh/include/asm/checksum.h | 2
arch/sh/include/asm/checksum_32.h | 203 -
arch/sh/include/asm/clock.h | 17
arch/sh/include/asm/cmpxchg-cas.h | 25
arch/sh/include/asm/cmpxchg-grb.h | 95
arch/sh/include/asm/cmpxchg-irq.h | 54
arch/sh/include/asm/cmpxchg-llsc.h | 53
arch/sh/include/asm/cmpxchg-xchg.h | 50
arch/sh/include/asm/cmpxchg.h | 74
arch/sh/include/asm/device.h | 17
arch/sh/include/asm/dma-register.h | 50
arch/sh/include/asm/dma.h | 140
arch/sh/include/asm/dmabrg.h | 24
arch/sh/include/asm/dwarf.h | 417 --
arch/sh/include/asm/elf.h | 211 -
arch/sh/include/asm/entry-macros.S | 123
arch/sh/include/asm/extable.h | 7
arch/sh/include/asm/fb.h | 20
arch/sh/include/asm/fixmap.h | 86
arch/sh/include/asm/flat.h | 33
arch/sh/include/asm/fpu.h | 69
arch/sh/include/asm/freq.h | 12
arch/sh/include/asm/ftrace.h | 48
arch/sh/include/asm/futex-cas.h | 35
arch/sh/include/asm/futex-irq.h | 25
arch/sh/include/asm/futex-llsc.h | 42
arch/sh/include/asm/futex.h | 72
arch/sh/include/asm/gpio.h | 50
arch/sh/include/asm/hardirq.h | 11
arch/sh/include/asm/hd64461.h | 252 -
arch/sh/include/asm/heartbeat.h | 19
arch/sh/include/asm/hugetlb.h | 38
arch/sh/include/asm/hw_breakpoint.h | 70
arch/sh/include/asm/hw_irq.h | 36
arch/sh/include/asm/i2c-sh7760.h | 21
arch/sh/include/asm/io.h | 294 -
arch/sh/include/asm/io_generic.h | 19
arch/sh/include/asm/io_noioport.h | 86
arch/sh/include/asm/io_trapped.h | 59
arch/sh/include/asm/irq.h | 58
arch/sh/include/asm/irqflags.h | 10
arch/sh/include/asm/kdebug.h | 19
arch/sh/include/asm/kexec.h | 72
arch/sh/include/asm/kgdb.h | 38
arch/sh/include/asm/kprobes.h | 57
arch/sh/include/asm/linkage.h | 8
arch/sh/include/asm/machvec.h | 41
arch/sh/include/asm/mmiowb.h | 12
arch/sh/include/asm/mmu.h | 107
arch/sh/include/asm/mmu_context.h | 178
arch/sh/include/asm/mmu_context_32.h | 51
arch/sh/include/asm/mmzone.h | 45
arch/sh/include/asm/module.h | 14
arch/sh/include/asm/page.h | 186
arch/sh/include/asm/pci.h | 91
arch/sh/include/asm/perf_event.h | 30
arch/sh/include/asm/pgalloc.h | 40
arch/sh/include/asm/pgtable-2level.h | 24
arch/sh/include/asm/pgtable-3level.h | 59
arch/sh/include/asm/pgtable.h | 150
arch/sh/include/asm/pgtable_32.h | 462 --
arch/sh/include/asm/platform_early.h | 61
arch/sh/include/asm/posix_types.h | 2
arch/sh/include/asm/processor.h | 173
arch/sh/include/asm/processor_32.h | 202 -
arch/sh/include/asm/ptrace.h | 139
arch/sh/include/asm/ptrace_32.h | 14
arch/sh/include/asm/push-switch.h | 32
arch/sh/include/asm/reboot.h | 22
arch/sh/include/asm/romimage-macros.h | 74
arch/sh/include/asm/rtc.h | 15
arch/sh/include/asm/seccomp.h | 21
arch/sh/include/asm/sections.h | 12
arch/sh/include/asm/setup.h | 25
arch/sh/include/asm/sfp-machine.h | 80
arch/sh/include/asm/sh7760fb.h | 198 -
arch/sh/include/asm/sh_bios.h | 28
arch/sh/include/asm/shmparam.h | 19
arch/sh/include/asm/siu.h | 20
arch/sh/include/asm/smc37c93x.h | 191 -
arch/sh/include/asm/smp-ops.h | 52
arch/sh/include/asm/smp.h | 83
arch/sh/include/asm/sparsemem.h | 12
arch/sh/include/asm/spi.h | 14
arch/sh/include/asm/spinlock-cas.h | 89
arch/sh/include/asm/spinlock-llsc.h | 198 -
arch/sh/include/asm/spinlock.h | 19
arch/sh/include/asm/spinlock_types.h | 22
arch/sh/include/asm/sram.h | 39
arch/sh/include/asm/stackprotector.h | 21
arch/sh/include/asm/stacktrace.h | 21
arch/sh/include/asm/string.h | 2
arch/sh/include/asm/string_32.h | 102
arch/sh/include/asm/suspend.h | 97
arch/sh/include/asm/switch_to.h | 7
arch/sh/include/asm/switch_to_32.h | 131
arch/sh/include/asm/syscall.h | 9
arch/sh/include/asm/syscall_32.h | 69
arch/sh/include/asm/syscalls.h | 14
arch/sh/include/asm/syscalls_32.h | 27
arch/sh/include/asm/thread_info.h | 171
arch/sh/include/asm/timex.h | 24
arch/sh/include/asm/tlb.h | 29
arch/sh/include/asm/tlbflush.h | 52
arch/sh/include/asm/topology.h | 28
arch/sh/include/asm/traps.h | 18
arch/sh/include/asm/traps_32.h | 61
arch/sh/include/asm/types.h | 16
arch/sh/include/asm/uaccess.h | 133
arch/sh/include/asm/uaccess_32.h | 227 -
arch/sh/include/asm/uncached.h | 59
arch/sh/include/asm/unistd.h | 31
arch/sh/include/asm/unwinder.h | 32
arch/sh/include/asm/user.h | 55
arch/sh/include/asm/vermagic.h | 30
arch/sh/include/asm/vga.h | 7
arch/sh/include/asm/vmalloc.h | 4
arch/sh/include/asm/vmlinux.lds.h | 18
arch/sh/include/asm/watchdog.h | 159
arch/sh/include/asm/word-at-a-time.h | 54
arch/sh/include/cpu-common/cpu/addrspace.h | 16
arch/sh/include/cpu-common/cpu/mmu_context.h | 13
arch/sh/include/cpu-common/cpu/pfc.h | 18
arch/sh/include/cpu-common/cpu/rtc.h | 9
arch/sh/include/cpu-common/cpu/sigcontext.h | 18
arch/sh/include/cpu-common/cpu/timer.h | 7
arch/sh/include/cpu-sh2/cpu/cache.h | 40
arch/sh/include/cpu-sh2/cpu/freq.h | 15
arch/sh/include/cpu-sh2/cpu/watchdog.h | 66
arch/sh/include/cpu-sh2a/cpu/addrspace.h | 11
arch/sh/include/cpu-sh2a/cpu/cache.h | 40
arch/sh/include/cpu-sh2a/cpu/freq.h | 13
arch/sh/include/cpu-sh2a/cpu/rtc.h | 9
arch/sh/include/cpu-sh2a/cpu/sh7203.h | 144
arch/sh/include/cpu-sh2a/cpu/sh7264.h | 169
arch/sh/include/cpu-sh2a/cpu/sh7269.h | 213 -
arch/sh/include/cpu-sh2a/cpu/watchdog.h | 2
arch/sh/include/cpu-sh3/cpu/adc.h | 29
arch/sh/include/cpu-sh3/cpu/cache.h | 40
arch/sh/include/cpu-sh3/cpu/dac.h | 42
arch/sh/include/cpu-sh3/cpu/dma-register.h | 38
arch/sh/include/cpu-sh3/cpu/dma.h | 19
arch/sh/include/cpu-sh3/cpu/freq.h | 24
arch/sh/include/cpu-sh3/cpu/gpio.h | 78
arch/sh/include/cpu-sh3/cpu/mmu_context.h | 42
arch/sh/include/cpu-sh3/cpu/serial.h | 11
arch/sh/include/cpu-sh3/cpu/sh7720.h | 175
arch/sh/include/cpu-sh3/cpu/watchdog.h | 22
arch/sh/include/cpu-sh4/cpu/addrspace.h | 41
arch/sh/include/cpu-sh4/cpu/cache.h | 41
arch/sh/include/cpu-sh4/cpu/dma-register.h | 98
arch/sh/include/cpu-sh4/cpu/dma.h | 18
arch/sh/include/cpu-sh4/cpu/fpu.h | 30
arch/sh/include/cpu-sh4/cpu/freq.h | 74
arch/sh/include/cpu-sh4/cpu/mmu_context.h | 79
arch/sh/include/cpu-sh4/cpu/rtc.h | 14
arch/sh/include/cpu-sh4/cpu/sh7722.h | 252 -
arch/sh/include/cpu-sh4/cpu/sh7723.h | 285 -
arch/sh/include/cpu-sh4/cpu/sh7724.h | 319 -
arch/sh/include/cpu-sh4/cpu/sh7734.h | 307 -
arch/sh/include/cpu-sh4/cpu/sh7757.h | 290 -
arch/sh/include/cpu-sh4/cpu/sh7785.h | 260 -
arch/sh/include/cpu-sh4/cpu/sh7786.h | 138
arch/sh/include/cpu-sh4/cpu/shx3.h | 65
arch/sh/include/cpu-sh4/cpu/sigcontext.h | 25
arch/sh/include/cpu-sh4/cpu/sq.h | 33
arch/sh/include/cpu-sh4/cpu/watchdog.h | 41
arch/sh/include/cpu-sh4a/cpu/dma.h | 72
arch/sh/include/cpu-sh4a/cpu/serial.h | 8
arch/sh/include/mach-common/mach/highlander.h | 208 -
arch/sh/include/mach-common/mach/hp6xx.h | 59
arch/sh/include/mach-common/mach/lboxre2.h | 24
arch/sh/include/mach-common/mach/magicpanelr2.h | 64
arch/sh/include/mach-common/mach/mangle-port.h | 46
arch/sh/include/mach-common/mach/microdev.h | 69
arch/sh/include/mach-common/mach/r2d.h | 71
arch/sh/include/mach-common/mach/romimage.h | 12
arch/sh/include/mach-common/mach/sdk7780.h | 79
arch/sh/include/mach-common/mach/secureedge5410.h | 47
arch/sh/include/mach-common/mach/sh2007.h | 118
arch/sh/include/mach-common/mach/sh7763rdp.h | 50
arch/sh/include/mach-common/mach/sh7785lcr.h | 58
arch/sh/include/mach-common/mach/shmin.h | 10
arch/sh/include/mach-common/mach/titan.h | 20
arch/sh/include/mach-common/mach/urquell.h | 69
arch/sh/include/mach-dreamcast/mach/dma.h | 29
arch/sh/include/mach-dreamcast/mach/maple.h | 38
arch/sh/include/mach-dreamcast/mach/pci.h | 24
arch/sh/include/mach-dreamcast/mach/sysasic.h | 46
arch/sh/include/mach-ecovec24/mach/partner-jet-setup.txt | 82
arch/sh/include/mach-ecovec24/mach/romimage.h | 48
arch/sh/include/mach-kfr2r09/mach/kfr2r09.h | 24
arch/sh/include/mach-kfr2r09/mach/partner-jet-setup.txt | 144
arch/sh/include/mach-kfr2r09/mach/romimage.h | 31
arch/sh/include/mach-landisk/mach/gio.h | 38
arch/sh/include/mach-landisk/mach/iodata_landisk.h | 46
arch/sh/include/mach-migor/mach/migor.h | 16
arch/sh/include/mach-sdk7786/mach/fpga.h | 156
arch/sh/include/mach-sdk7786/mach/irq.h | 8
arch/sh/include/mach-se/mach/mrshpc.h | 53
arch/sh/include/mach-se/mach/se.h | 120
arch/sh/include/mach-se/mach/se7206.h | 14
arch/sh/include/mach-se/mach/se7343.h | 143
arch/sh/include/mach-se/mach/se7721.h | 68
arch/sh/include/mach-se/mach/se7722.h | 98
arch/sh/include/mach-se/mach/se7724.h | 69
arch/sh/include/mach-se/mach/se7751.h | 75
arch/sh/include/mach-se/mach/se7780.h | 106
arch/sh/include/mach-sh03/mach/io.h | 26
arch/sh/include/mach-sh03/mach/sh03.h | 19
arch/sh/include/mach-x3proto/mach/hardware.h | 13
arch/sh/include/mach-x3proto/mach/ilsel.h | 46
arch/sh/include/uapi/asm/Kbuild | 4
arch/sh/include/uapi/asm/auxvec.h | 39
arch/sh/include/uapi/asm/byteorder.h | 11
arch/sh/include/uapi/asm/cachectl.h | 20
arch/sh/include/uapi/asm/cpu-features.h | 28
arch/sh/include/uapi/asm/hw_breakpoint.h | 5
arch/sh/include/uapi/asm/ioctls.h | 116
arch/sh/include/uapi/asm/posix_types.h | 2
arch/sh/include/uapi/asm/posix_types_32.h | 23
arch/sh/include/uapi/asm/ptrace.h | 30
arch/sh/include/uapi/asm/ptrace_32.h | 78
arch/sh/include/uapi/asm/sigcontext.h | 25
arch/sh/include/uapi/asm/signal.h | 18
arch/sh/include/uapi/asm/sockios.h | 18
arch/sh/include/uapi/asm/stat.h | 78
arch/sh/include/uapi/asm/swab.h | 50
arch/sh/include/uapi/asm/unistd.h | 2
arch/sh/kernel/.gitignore | 2
arch/sh/kernel/Makefile | 49
arch/sh/kernel/asm-offsets.c | 60
arch/sh/kernel/cpu/Makefile | 21
arch/sh/kernel/cpu/adc.c | 37
arch/sh/kernel/cpu/clock-cpg.c | 78
arch/sh/kernel/cpu/clock.c | 52
arch/sh/kernel/cpu/fpu.c | 92
arch/sh/kernel/cpu/init.c | 366 -
arch/sh/kernel/cpu/irq/Makefile | 6
arch/sh/kernel/cpu/irq/imask.c | 85
arch/sh/kernel/cpu/irq/ipr.c | 80
arch/sh/kernel/cpu/pfc.c | 25
arch/sh/kernel/cpu/proc.c | 151
arch/sh/kernel/cpu/sh2/Makefile | 12
arch/sh/kernel/cpu/sh2/clock-sh7619.c | 74
arch/sh/kernel/cpu/sh2/entry.S | 373 -
arch/sh/kernel/cpu/sh2/ex.S | 44
arch/sh/kernel/cpu/sh2/probe.c | 71
arch/sh/kernel/cpu/sh2/setup-sh7619.c | 205 -
arch/sh/kernel/cpu/sh2/smp-j2.c | 136
arch/sh/kernel/cpu/sh2a/Makefile | 25
arch/sh/kernel/cpu/sh2a/clock-sh7201.c | 82
arch/sh/kernel/cpu/sh2a/clock-sh7203.c | 78
arch/sh/kernel/cpu/sh2a/clock-sh7206.c | 80
arch/sh/kernel/cpu/sh2a/clock-sh7264.c | 157
arch/sh/kernel/cpu/sh2a/clock-sh7269.c | 181
arch/sh/kernel/cpu/sh2a/entry.S | 247 -
arch/sh/kernel/cpu/sh2a/ex.S | 70
arch/sh/kernel/cpu/sh2a/fpu.c | 572 ---
arch/sh/kernel/cpu/sh2a/opcode_helper.c | 51
arch/sh/kernel/cpu/sh2a/pinmux-sh7203.c | 27
arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c | 27
arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c | 28
arch/sh/kernel/cpu/sh2a/probe.c | 57
arch/sh/kernel/cpu/sh2a/setup-mxg.c | 175
arch/sh/kernel/cpu/sh2a/setup-sh7201.c | 418 --
arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 355 -
arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 291 -
arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 552 --
arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 568 --
arch/sh/kernel/cpu/sh3/Makefile | 34
arch/sh/kernel/cpu/sh3/clock-sh3.c | 86
arch/sh/kernel/cpu/sh3/clock-sh7705.c | 81
arch/sh/kernel/cpu/sh3/clock-sh7706.c | 81
arch/sh/kernel/cpu/sh3/clock-sh7709.c | 82
arch/sh/kernel/cpu/sh3/clock-sh7710.c | 75
arch/sh/kernel/cpu/sh3/clock-sh7712.c | 68
arch/sh/kernel/cpu/sh3/entry.S | 509 --
arch/sh/kernel/cpu/sh3/ex.S | 56
arch/sh/kernel/cpu/sh3/pinmux-sh7720.c | 27
arch/sh/kernel/cpu/sh3/probe.c | 108
arch/sh/kernel/cpu/sh3/serial-sh770x.c | 34
arch/sh/kernel/cpu/sh3/serial-sh7710.c | 21
arch/sh/kernel/cpu/sh3/serial-sh7720.c | 38
arch/sh/kernel/cpu/sh3/setup-sh3.c | 69
arch/sh/kernel/cpu/sh3/setup-sh7705.c | 190
arch/sh/kernel/cpu/sh3/setup-sh770x.c | 246 -
arch/sh/kernel/cpu/sh3/setup-sh7710.c | 189
arch/sh/kernel/cpu/sh3/setup-sh7720.c | 286 -
arch/sh/kernel/cpu/sh3/swsusp.S | 144
arch/sh/kernel/cpu/sh4/Makefile | 37
arch/sh/kernel/cpu/sh4/clock-sh4-202.c | 174
arch/sh/kernel/cpu/sh4/clock-sh4.c | 77
arch/sh/kernel/cpu/sh4/fpu.c | 425 --
arch/sh/kernel/cpu/sh4/perf_event.c | 265 -
arch/sh/kernel/cpu/sh4/probe.c | 260 -
arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 139
arch/sh/kernel/cpu/sh4/setup-sh7750.c | 359 -
arch/sh/kernel/cpu/sh4/setup-sh7760.c | 297 -
arch/sh/kernel/cpu/sh4/softfloat.c | 930 ----
arch/sh/kernel/cpu/sh4/sq.c | 414 --
arch/sh/kernel/cpu/sh4a/Makefile | 53
arch/sh/kernel/cpu/sh4a/clock-sh7343.c | 277 -
arch/sh/kernel/cpu/sh4a/clock-sh7366.c | 270 -
arch/sh/kernel/cpu/sh4a/clock-sh7722.c | 253 -
arch/sh/kernel/cpu/sh4a/clock-sh7723.c | 301 -
arch/sh/kernel/cpu/sh4a/clock-sh7724.c | 367 -
arch/sh/kernel/cpu/sh4a/clock-sh7734.c | 256 -
arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 152
arch/sh/kernel/cpu/sh4a/clock-sh7763.c | 116
arch/sh/kernel/cpu/sh4a/clock-sh7770.c | 70
arch/sh/kernel/cpu/sh4a/clock-sh7780.c | 122
arch/sh/kernel/cpu/sh4a/clock-sh7785.c | 174
arch/sh/kernel/cpu/sh4a/clock-sh7786.c | 189
arch/sh/kernel/cpu/sh4a/clock-shx3.c | 148
arch/sh/kernel/cpu/sh4a/intc-shx3.c | 31
arch/sh/kernel/cpu/sh4a/perf_event.c | 299 -
arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c | 21
arch/sh/kernel/cpu/sh4a/pinmux-sh7723.c | 27
arch/sh/kernel/cpu/sh4a/pinmux-sh7724.c | 32
arch/sh/kernel/cpu/sh4a/pinmux-sh7734.c | 32
arch/sh/kernel/cpu/sh4a/pinmux-sh7757.c | 32
arch/sh/kernel/cpu/sh4a/pinmux-sh7785.c | 27
arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c | 32
arch/sh/kernel/cpu/sh4a/pinmux-shx3.c | 26
arch/sh/kernel/cpu/sh4a/serial-sh7722.c | 24
arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 444 --
arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 388 --
arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 666 ---
arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 644 ---
arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 1288 ------
arch/sh/kernel/cpu/sh4a/setup-sh7734.c | 621 ---
arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 1242 ------
arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 455 --
arch/sh/kernel/cpu/sh4a/setup-sh7770.c | 571 ---
arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 505 --
arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 608 ---
arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 841 ----
arch/sh/kernel/cpu/sh4a/setup-shx3.c | 396 --
arch/sh/kernel/cpu/sh4a/smp-shx3.c | 146
arch/sh/kernel/cpu/sh4a/ubc.c | 130
arch/sh/kernel/cpu/shmobile/Makefile | 8
arch/sh/kernel/cpu/shmobile/cpuidle.c | 95
arch/sh/kernel/cpu/shmobile/pm.c | 153
arch/sh/kernel/cpu/shmobile/sleep.S | 402 --
arch/sh/kernel/crash_dump.c | 27
arch/sh/kernel/debugtraps.S | 38
arch/sh/kernel/disassemble.c | 572 ---
arch/sh/kernel/dma-coherent.c | 33
arch/sh/kernel/dumpstack.c | 156
arch/sh/kernel/dwarf.c | 1206 ------
arch/sh/kernel/entry-common.S | 400 --
arch/sh/kernel/ftrace.c | 365 -
arch/sh/kernel/head_32.S | 365 -
arch/sh/kernel/hw_breakpoint.c | 408 --
arch/sh/kernel/idle.c | 57
arch/sh/kernel/io.c | 111
arch/sh/kernel/io_trapped.c | 291 -
arch/sh/kernel/iomap.c | 162
arch/sh/kernel/ioport.c | 41
arch/sh/kernel/irq.c | 249 -
arch/sh/kernel/irq_32.c | 54
arch/sh/kernel/kdebugfs.c | 14
arch/sh/kernel/kgdb.c | 378 -
arch/sh/kernel/kprobes.c | 452 --
arch/sh/kernel/machine_kexec.c | 204 -
arch/sh/kernel/machvec.c | 122
arch/sh/kernel/module.c | 104
arch/sh/kernel/nmi_debug.c | 75
arch/sh/kernel/perf_callchain.c | 32
arch/sh/kernel/perf_event.c | 363 -
arch/sh/kernel/process.c | 77
arch/sh/kernel/process_32.c | 197 -
arch/sh/kernel/ptrace.c | 34
arch/sh/kernel/ptrace_32.c | 487 --
arch/sh/kernel/reboot.c | 96
arch/sh/kernel/relocate_kernel.S | 230 -
arch/sh/kernel/return_address.c | 56
arch/sh/kernel/setup.c | 356 -
arch/sh/kernel/sh_bios.c | 169
arch/sh/kernel/sh_ksyms_32.c | 118
arch/sh/kernel/signal_32.c | 507 --
arch/sh/kernel/smp.c | 471 --
arch/sh/kernel/stacktrace.c | 79
arch/sh/kernel/swsusp.c | 35
arch/sh/kernel/sys_sh.c | 96
arch/sh/kernel/sys_sh32.c | 61
arch/sh/kernel/syscalls/Makefile | 32
arch/sh/kernel/syscalls/syscall.tbl | 455 --
arch/sh/kernel/syscalls_32.S | 17
arch/sh/kernel/time.c | 45
arch/sh/kernel/topology.c | 74
arch/sh/kernel/traps.c | 204 -
arch/sh/kernel/traps_32.c | 795 ----
arch/sh/kernel/unwinder.c | 165
arch/sh/kernel/vmlinux.lds.S | 82
arch/sh/kernel/vsyscall/.gitignore | 2
arch/sh/kernel/vsyscall/Makefile | 36
arch/sh/kernel/vsyscall/vsyscall-note.S | 26
arch/sh/kernel/vsyscall/vsyscall-sigreturn.S | 75
arch/sh/kernel/vsyscall/vsyscall-syscall.S | 11
arch/sh/kernel/vsyscall/vsyscall-trapa.S | 40
arch/sh/kernel/vsyscall/vsyscall.c | 93
arch/sh/kernel/vsyscall/vsyscall.lds.S | 85
arch/sh/lib/Makefile | 32
arch/sh/lib/__clear_user.S | 109
arch/sh/lib/ashiftrt.S | 128
arch/sh/lib/ashldi3.c | 30
arch/sh/lib/ashlsi3.S | 189
arch/sh/lib/ashrdi3.c | 32
arch/sh/lib/ashrsi3.S | 179
arch/sh/lib/checksum.S | 365 -
arch/sh/lib/copy_page.S | 390 --
arch/sh/lib/delay.c | 54
arch/sh/lib/div64-generic.c | 20
arch/sh/lib/div64.S | 47
arch/sh/lib/io.c | 79
arch/sh/lib/libgcc.h | 27
arch/sh/lib/lshrdi3.c | 30
arch/sh/lib/lshrsi3.S | 188
arch/sh/lib/mcount.S | 287 -
arch/sh/lib/memchr.S | 27
arch/sh/lib/memcpy-sh4.S | 800 ----
arch/sh/lib/memcpy.S | 228 -
arch/sh/lib/memmove.S | 255 -
arch/sh/lib/memset-sh4.S | 108
arch/sh/lib/memset.S | 59
arch/sh/lib/movmem.S | 217 -
arch/sh/lib/strlen.S | 71
arch/sh/lib/udiv_qrnnd.S | 60
arch/sh/lib/udivsi3.S | 66
arch/sh/lib/udivsi3_i4i-Os.S | 128
arch/sh/lib/udivsi3_i4i.S | 645 ---
arch/sh/math-emu/Makefile | 2
arch/sh/math-emu/math.c | 506 --
arch/sh/math-emu/sfp-util.h | 73
arch/sh/mm/Kconfig | 254 -
arch/sh/mm/Makefile | 45
arch/sh/mm/alignment.c | 189
arch/sh/mm/asids-debugfs.c | 59
arch/sh/mm/cache-debugfs.c | 109
arch/sh/mm/cache-j2.c | 64
arch/sh/mm/cache-sh2.c | 90
arch/sh/mm/cache-sh2a.c | 188
arch/sh/mm/cache-sh3.c | 102
arch/sh/mm/cache-sh4.c | 390 --
arch/sh/mm/cache-sh7705.c | 194 -
arch/sh/mm/cache-shx3.c | 44
arch/sh/mm/cache.c | 360 -
arch/sh/mm/consistent.c | 65
arch/sh/mm/extable_32.c | 24
arch/sh/mm/fault.c | 504 --
arch/sh/mm/flush-sh4.c | 111
arch/sh/mm/hugetlbpage.c | 82
arch/sh/mm/init.c | 424 --
arch/sh/mm/ioremap.c | 192 -
arch/sh/mm/ioremap.h | 23
arch/sh/mm/ioremap_fixed.c | 135
arch/sh/mm/kmap.c | 65
arch/sh/mm/mmap.c | 184
arch/sh/mm/nommu.c | 98
arch/sh/mm/numa.c | 56
arch/sh/mm/pgtable.c | 57
arch/sh/mm/pmb.c | 887 ----
arch/sh/mm/sram.c | 35
arch/sh/mm/tlb-debugfs.c | 160
arch/sh/mm/tlb-pteaex.c | 106
arch/sh/mm/tlb-sh3.c | 95
arch/sh/mm/tlb-sh4.c | 108
arch/sh/mm/tlb-urb.c | 93
arch/sh/mm/tlbex_32.c | 82
arch/sh/mm/tlbflush_32.c | 137
arch/sh/mm/uncached.c | 44
arch/sh/tools/Makefile | 16
arch/sh/tools/gen-mach-types | 48
arch/sh/tools/mach-types | 67
b/Documentation/arch.rst | 1
b/Documentation/watchdog/watchdog-parameters.rst | 12
b/MAINTAINERS | 10
b/drivers/Makefile | 1
b/drivers/base/platform.c | 4
b/drivers/clocksource/sh_cmt.c | 16
b/drivers/clocksource/sh_mtu2.c | 16
b/drivers/clocksource/sh_tmu.c | 17
b/drivers/cpufreq/Kconfig | 14
b/drivers/cpufreq/Makefile | 1
b/drivers/dma/sh/Kconfig | 20
b/drivers/dma/sh/Makefile | 13
b/drivers/gpu/drm/Kconfig | 2
b/drivers/gpu/drm/Makefile | 1
b/drivers/i2c/busses/Kconfig | 13
b/drivers/i2c/busses/Makefile | 1
b/drivers/input/keyboard/Kconfig | 10
b/drivers/input/keyboard/Makefile | 1
b/drivers/media/platform/renesas/Kconfig | 11
b/drivers/media/platform/renesas/Makefile | 1
b/drivers/mmc/host/Kconfig | 6
b/drivers/mmc/host/sh_mmcif.c | 21
b/drivers/mtd/nand/raw/Kconfig | 8
b/drivers/mtd/nand/raw/Makefile | 1
b/drivers/net/ethernet/8390/Kconfig | 14
b/drivers/net/ethernet/8390/Makefile | 1
b/drivers/net/ethernet/renesas/Kconfig | 2
b/drivers/net/ethernet/smsc/Kconfig | 4
b/drivers/pinctrl/renesas/Kconfig | 63
b/drivers/pinctrl/renesas/Makefile | 27
b/drivers/pinctrl/renesas/core.c | 598 ---
b/drivers/rtc/Kconfig | 4
b/drivers/rtc/rtc-sh.c | 18
b/drivers/spi/Kconfig | 24
b/drivers/spi/Makefile | 3
b/drivers/tty/serial/Kconfig | 3
b/drivers/tty/serial/sh-sci.c | 57
b/drivers/tty/vt/keyboard.c | 2
b/drivers/usb/host/Kconfig | 18
b/drivers/usb/host/ehci-hcd.c | 7
b/drivers/usb/renesas_usbhs/Kconfig | 2
b/drivers/video/console/Kconfig | 2
b/drivers/video/fbdev/Kconfig | 17
b/drivers/video/fbdev/Makefile | 1
b/drivers/video/logo/Kconfig | 15
b/drivers/video/logo/Makefile | 3
b/drivers/video/logo/logo.c | 12
b/drivers/watchdog/Kconfig | 20
b/drivers/watchdog/Makefile | 3
b/fs/Kconfig.binfmt | 2
b/fs/minix/Kconfig | 2
b/include/linux/cpuhotplug.h | 1
b/include/linux/platform_device.h | 15
b/include/linux/sh_intc.h | 4
b/include/linux/shdma-base.h | 4
b/init/Kconfig | 2
b/kernel/sysctl.c | 3
b/lib/Kconfig.debug | 2
b/lib/math/div64.c | 4
b/lib/test_user_copy.c | 3
b/scripts/coccinelle/misc/cond_no_effect.cocci | 13
b/scripts/head-object-list.txt | 1
b/sound/Kconfig | 2
b/sound/Makefile | 2
b/sound/soc/sh/Kconfig | 48
b/sound/soc/sh/Makefile | 16
b/sound/soc/sh/fsi.c | 9
b/tools/include/asm/barrier.h | 2
b/tools/perf/util/dwarf-regs.c | 1
drivers/cpufreq/sh-cpufreq.c | 175
drivers/dma/sh/shdma-base.c | 1052 -----
drivers/dma/sh/shdma.h | 61
drivers/dma/sh/shdmac.c | 938 ----
drivers/gpu/drm/shmobile/Kconfig | 12
drivers/gpu/drm/shmobile/Makefile | 8
drivers/gpu/drm/shmobile/shmob_drm_backlight.c | 82
drivers/gpu/drm/shmobile/shmob_drm_backlight.h | 19
drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 683 ---
drivers/gpu/drm/shmobile/shmob_drm_crtc.h | 55
drivers/gpu/drm/shmobile/shmob_drm_drv.c | 303 -
drivers/gpu/drm/shmobile/shmob_drm_drv.h | 42
drivers/gpu/drm/shmobile/shmob_drm_kms.c | 150
drivers/gpu/drm/shmobile/shmob_drm_kms.h | 29
drivers/gpu/drm/shmobile/shmob_drm_plane.c | 261 -
drivers/gpu/drm/shmobile/shmob_drm_plane.h | 19
drivers/gpu/drm/shmobile/shmob_drm_regs.h | 310 -
drivers/i2c/busses/i2c-sh7760.c | 565 --
drivers/input/keyboard/sh_keysc.c | 334 -
drivers/media/platform/renesas/sh_vou.c | 1375 -------
drivers/mtd/nand/raw/sh_flctl.c | 1234 ------
drivers/net/ethernet/8390/stnic.c | 302 -
drivers/pinctrl/renesas/pfc-sh7203.c | 1577 --------
drivers/pinctrl/renesas/pfc-sh7264.c | 2131 -----------
drivers/pinctrl/renesas/pfc-sh7269.c | 2851 ---------------
drivers/pinctrl/renesas/pfc-sh7720.c | 1201 ------
drivers/pinctrl/renesas/pfc-sh7722.c | 1703 --------
drivers/pinctrl/renesas/pfc-sh7723.c | 1902 ----------
drivers/pinctrl/renesas/pfc-sh7724.c | 2177 -----------
drivers/pinctrl/renesas/pfc-sh7734.c | 2408 ------------
drivers/pinctrl/renesas/pfc-sh7757.c | 2219 -----------
drivers/pinctrl/renesas/pfc-sh7785.c | 1258 ------
drivers/pinctrl/renesas/pfc-sh7786.c | 809 ----
drivers/pinctrl/renesas/pfc-shx3.c | 557 --
drivers/sh/Kconfig | 6
drivers/sh/Makefile | 12
drivers/sh/clk/Makefile | 4
drivers/sh/clk/core.c | 624 ---
drivers/sh/clk/cpg.c | 477 --
drivers/sh/intc/Kconfig | 44
drivers/sh/intc/Makefile | 6
drivers/sh/intc/access.c | 246 -
drivers/sh/intc/balancing.c | 97
drivers/sh/intc/chip.c | 211 -
drivers/sh/intc/core.c | 501 --
drivers/sh/intc/handle.c | 306 -
drivers/sh/intc/internals.h | 191 -
drivers/sh/intc/irqdomain.c | 68
drivers/sh/intc/userimask.c | 84
drivers/sh/intc/virq-debugfs.c | 54
drivers/sh/intc/virq.c | 269 -
drivers/sh/maple/Makefile | 4
drivers/sh/maple/maple.c | 895 ----
drivers/sh/pm_runtime.c | 40
drivers/sh/superhyway/Makefile | 8
drivers/sh/superhyway/superhyway-sysfs.c | 54
drivers/sh/superhyway/superhyway.c | 234 -
drivers/spi/spi-jcore.c | 235 -
drivers/spi/spi-sh-sci.c | 197 -
drivers/spi/spi-sh.c | 474 --
drivers/usb/host/ehci-sh.c | 182
drivers/video/fbdev/sh7760fb.c | 587 ---
drivers/video/logo/logo_superh_clut224.ppm | 1604 --------
drivers/video/logo/logo_superh_vga16.ppm | 1604 --------
drivers/watchdog/shwdt.c | 344 -
include/linux/mtd/sh_flctl.h | 180
include/linux/sh_clk.h | 213 -
include/linux/superhyway.h | 107
sound/sh/Kconfig | 32
sound/sh/Makefile | 11
sound/sh/aica.c | 628 ---
sound/sh/aica.h | 68
sound/sh/sh_dac_audio.c | 412 --
sound/soc/sh/dma-sh7760.c | 334 -
sound/soc/sh/hac.c | 345 -
sound/soc/sh/migor.c | 205 -
sound/soc/sh/sh7760-ac97.c | 72
sound/soc/sh/siu.h | 180
sound/soc/sh/siu_dai.c | 799 ----
sound/soc/sh/siu_pcm.c | 553 --
sound/soc/sh/ssi.c | 403 --
896 files changed, 46 insertions(+), 138518 deletions(-)


2023-01-13 06:37:19

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 16/22] spi: remove spi-sh-sci

Now that arch/sh is removed this driver is dead code.

Signed-off-by: Christoph Hellwig <[email protected]>
---
drivers/spi/Kconfig | 7 --
drivers/spi/Makefile | 1 -
drivers/spi/spi-sh-sci.c | 197 ---------------------------------------
3 files changed, 205 deletions(-)
delete mode 100644 drivers/spi/spi-sh-sci.c

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 7508dcef909c78..76f3bc6f8c81fc 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -882,13 +882,6 @@ config SPI_SH_MSIOF
help
SPI driver for SuperH and SH Mobile MSIOF blocks.

-config SPI_SH_SCI
- tristate "SuperH SCI SPI controller"
- depends on SUPERH
- select SPI_BITBANG
- help
- SPI driver for SuperH SCI blocks.
-
config SPI_SH_HSPI
tristate "SuperH HSPI controller"
depends on ARCH_RENESAS || COMPILE_TEST
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index 342a7eb5181c9b..27d877440c6539 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -118,7 +118,6 @@ obj-$(CONFIG_SPI_S3C64XX) += spi-s3c64xx.o
obj-$(CONFIG_SPI_SC18IS602) += spi-sc18is602.o
obj-$(CONFIG_SPI_SH_HSPI) += spi-sh-hspi.o
obj-$(CONFIG_SPI_SH_MSIOF) += spi-sh-msiof.o
-obj-$(CONFIG_SPI_SH_SCI) += spi-sh-sci.o
obj-$(CONFIG_SPI_SIFIVE) += spi-sifive.o
obj-$(CONFIG_SPI_SLAVE_MT27XX) += spi-slave-mt27xx.o
obj-$(CONFIG_SPI_SN_F_OSPI) += spi-sn-f-ospi.o
diff --git a/drivers/spi/spi-sh-sci.c b/drivers/spi/spi-sh-sci.c
deleted file mode 100644
index 8f30531e141867..00000000000000
--- a/drivers/spi/spi-sh-sci.c
+++ /dev/null
@@ -1,197 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * SH SCI SPI interface
- *
- * Copyright (c) 2008 Magnus Damm
- *
- * Based on S3C24XX GPIO based SPI driver, which is:
- * Copyright (c) 2006 Ben Dooks
- * Copyright (c) 2006 Simtec Electronics
- */
-
-#include <linux/kernel.h>
-#include <linux/delay.h>
-#include <linux/spinlock.h>
-#include <linux/platform_device.h>
-
-#include <linux/spi/spi.h>
-#include <linux/spi/spi_bitbang.h>
-#include <linux/module.h>
-
-#include <asm/spi.h>
-#include <asm/io.h>
-
-struct sh_sci_spi {
- struct spi_bitbang bitbang;
-
- void __iomem *membase;
- unsigned char val;
- struct sh_spi_info *info;
- struct platform_device *dev;
-};
-
-#define SCSPTR(sp) (sp->membase + 0x1c)
-#define PIN_SCK (1 << 2)
-#define PIN_TXD (1 << 0)
-#define PIN_RXD PIN_TXD
-#define PIN_INIT ((1 << 1) | (1 << 3) | PIN_SCK | PIN_TXD)
-
-static inline void setbits(struct sh_sci_spi *sp, int bits, int on)
-{
- /*
- * We are the only user of SCSPTR so no locking is required.
- * Reading bit 2 and 0 in SCSPTR gives pin state as input.
- * Writing the same bits sets the output value.
- * This makes regular read-modify-write difficult so we
- * use sp->val to keep track of the latest register value.
- */
-
- if (on)
- sp->val |= bits;
- else
- sp->val &= ~bits;
-
- iowrite8(sp->val, SCSPTR(sp));
-}
-
-static inline void setsck(struct spi_device *dev, int on)
-{
- setbits(spi_master_get_devdata(dev->master), PIN_SCK, on);
-}
-
-static inline void setmosi(struct spi_device *dev, int on)
-{
- setbits(spi_master_get_devdata(dev->master), PIN_TXD, on);
-}
-
-static inline u32 getmiso(struct spi_device *dev)
-{
- struct sh_sci_spi *sp = spi_master_get_devdata(dev->master);
-
- return (ioread8(SCSPTR(sp)) & PIN_RXD) ? 1 : 0;
-}
-
-#define spidelay(x) ndelay(x)
-
-#include "spi-bitbang-txrx.h"
-
-static u32 sh_sci_spi_txrx_mode0(struct spi_device *spi,
- unsigned nsecs, u32 word, u8 bits,
- unsigned flags)
-{
- return bitbang_txrx_be_cpha0(spi, nsecs, 0, flags, word, bits);
-}
-
-static u32 sh_sci_spi_txrx_mode1(struct spi_device *spi,
- unsigned nsecs, u32 word, u8 bits,
- unsigned flags)
-{
- return bitbang_txrx_be_cpha1(spi, nsecs, 0, flags, word, bits);
-}
-
-static u32 sh_sci_spi_txrx_mode2(struct spi_device *spi,
- unsigned nsecs, u32 word, u8 bits,
- unsigned flags)
-{
- return bitbang_txrx_be_cpha0(spi, nsecs, 1, flags, word, bits);
-}
-
-static u32 sh_sci_spi_txrx_mode3(struct spi_device *spi,
- unsigned nsecs, u32 word, u8 bits,
- unsigned flags)
-{
- return bitbang_txrx_be_cpha1(spi, nsecs, 1, flags, word, bits);
-}
-
-static void sh_sci_spi_chipselect(struct spi_device *dev, int value)
-{
- struct sh_sci_spi *sp = spi_master_get_devdata(dev->master);
-
- if (sp->info->chip_select)
- (sp->info->chip_select)(sp->info, dev->chip_select, value);
-}
-
-static int sh_sci_spi_probe(struct platform_device *dev)
-{
- struct resource *r;
- struct spi_master *master;
- struct sh_sci_spi *sp;
- int ret;
-
- master = spi_alloc_master(&dev->dev, sizeof(struct sh_sci_spi));
- if (master == NULL) {
- dev_err(&dev->dev, "failed to allocate spi master\n");
- ret = -ENOMEM;
- goto err0;
- }
-
- sp = spi_master_get_devdata(master);
-
- platform_set_drvdata(dev, sp);
- sp->info = dev_get_platdata(&dev->dev);
- if (!sp->info) {
- dev_err(&dev->dev, "platform data is missing\n");
- ret = -ENOENT;
- goto err1;
- }
-
- /* setup spi bitbang adaptor */
- sp->bitbang.master = master;
- sp->bitbang.master->bus_num = sp->info->bus_num;
- sp->bitbang.master->num_chipselect = sp->info->num_chipselect;
- sp->bitbang.chipselect = sh_sci_spi_chipselect;
-
- sp->bitbang.txrx_word[SPI_MODE_0] = sh_sci_spi_txrx_mode0;
- sp->bitbang.txrx_word[SPI_MODE_1] = sh_sci_spi_txrx_mode1;
- sp->bitbang.txrx_word[SPI_MODE_2] = sh_sci_spi_txrx_mode2;
- sp->bitbang.txrx_word[SPI_MODE_3] = sh_sci_spi_txrx_mode3;
-
- r = platform_get_resource(dev, IORESOURCE_MEM, 0);
- if (r == NULL) {
- ret = -ENOENT;
- goto err1;
- }
- sp->membase = ioremap(r->start, resource_size(r));
- if (!sp->membase) {
- ret = -ENXIO;
- goto err1;
- }
- sp->val = ioread8(SCSPTR(sp));
- setbits(sp, PIN_INIT, 1);
-
- ret = spi_bitbang_start(&sp->bitbang);
- if (!ret)
- return 0;
-
- setbits(sp, PIN_INIT, 0);
- iounmap(sp->membase);
- err1:
- spi_master_put(sp->bitbang.master);
- err0:
- return ret;
-}
-
-static int sh_sci_spi_remove(struct platform_device *dev)
-{
- struct sh_sci_spi *sp = platform_get_drvdata(dev);
-
- spi_bitbang_stop(&sp->bitbang);
- setbits(sp, PIN_INIT, 0);
- iounmap(sp->membase);
- spi_master_put(sp->bitbang.master);
- return 0;
-}
-
-static struct platform_driver sh_sci_spi_drv = {
- .probe = sh_sci_spi_probe,
- .remove = sh_sci_spi_remove,
- .driver = {
- .name = "spi_sh_sci",
- },
-};
-module_platform_driver(sh_sci_spi_drv);
-
-MODULE_DESCRIPTION("SH SCI SPI Driver");
-MODULE_AUTHOR("Magnus Damm <[email protected]>");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:spi_sh_sci");
--
2.39.0

2023-01-13 06:37:27

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 09/22] i2c: remove i2c-sh7760

Now that arch/sh is removed this driver is dead code.

Signed-off-by: Christoph Hellwig <[email protected]>
---
drivers/i2c/busses/Kconfig | 9 -
drivers/i2c/busses/Makefile | 1 -
drivers/i2c/busses/i2c-sh7760.c | 565 --------------------------------
3 files changed, 575 deletions(-)
delete mode 100644 drivers/i2c/busses/i2c-sh7760.c

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 22602c512a6e50..44267a023fd19a 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -1016,15 +1016,6 @@ config I2C_S3C2410
Say Y here to include support for I2C controller in the
Samsung SoCs (S3C, S5Pv210, Exynos).

-config I2C_SH7760
- tristate "Renesas SH7760 I2C Controller"
- depends on CPU_SUBTYPE_SH7760
- help
- This driver supports the 2 I2C interfaces on the Renesas SH7760.
-
- This driver can also be built as a module. If so, the module
- will be called i2c-sh7760.
-
config I2C_SH_MOBILE
tristate "SuperH Mobile I2C Controller"
depends on ARCH_RENESAS || COMPILE_TEST
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index e73cdb1d2b5a85..6be213e5e4dd16 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -104,7 +104,6 @@ obj-$(CONFIG_I2C_RIIC) += i2c-riic.o
obj-$(CONFIG_I2C_RK3X) += i2c-rk3x.o
obj-$(CONFIG_I2C_RZV2M) += i2c-rzv2m.o
obj-$(CONFIG_I2C_S3C2410) += i2c-s3c2410.o
-obj-$(CONFIG_I2C_SH7760) += i2c-sh7760.o
obj-$(CONFIG_I2C_SH_MOBILE) += i2c-sh_mobile.o
obj-$(CONFIG_I2C_SIMTEC) += i2c-simtec.o
obj-$(CONFIG_I2C_SPRD) += i2c-sprd.o
diff --git a/drivers/i2c/busses/i2c-sh7760.c b/drivers/i2c/busses/i2c-sh7760.c
deleted file mode 100644
index 319d1fa617c883..00000000000000
--- a/drivers/i2c/busses/i2c-sh7760.c
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
- * I2C bus driver for the SH7760 I2C Interfaces.
- *
- * (c) 2005-2008 MSC Vertriebsges.m.b.H, Manuel Lauss <[email protected]>
- *
- * licensed under the terms outlined in the file COPYING.
- *
- */
-
-#include <linux/completion.h>
-#include <linux/delay.h>
-#include <linux/err.h>
-#include <linux/i2c.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/io.h>
-#include <linux/module.h>
-
-#include <asm/clock.h>
-#include <asm/i2c-sh7760.h>
-
-/* register offsets */
-#define I2CSCR 0x0 /* slave ctrl */
-#define I2CMCR 0x4 /* master ctrl */
-#define I2CSSR 0x8 /* slave status */
-#define I2CMSR 0xC /* master status */
-#define I2CSIER 0x10 /* slave irq enable */
-#define I2CMIER 0x14 /* master irq enable */
-#define I2CCCR 0x18 /* clock dividers */
-#define I2CSAR 0x1c /* slave address */
-#define I2CMAR 0x20 /* master address */
-#define I2CRXTX 0x24 /* data port */
-#define I2CFCR 0x28 /* fifo control */
-#define I2CFSR 0x2C /* fifo status */
-#define I2CFIER 0x30 /* fifo irq enable */
-#define I2CRFDR 0x34 /* rx fifo count */
-#define I2CTFDR 0x38 /* tx fifo count */
-
-#define REGSIZE 0x3C
-
-#define MCR_MDBS 0x80 /* non-fifo mode switch */
-#define MCR_FSCL 0x40 /* override SCL pin */
-#define MCR_FSDA 0x20 /* override SDA pin */
-#define MCR_OBPC 0x10 /* override pins */
-#define MCR_MIE 0x08 /* master if enable */
-#define MCR_TSBE 0x04
-#define MCR_FSB 0x02 /* force stop bit */
-#define MCR_ESG 0x01 /* en startbit gen. */
-
-#define MSR_MNR 0x40 /* nack received */
-#define MSR_MAL 0x20 /* arbitration lost */
-#define MSR_MST 0x10 /* sent a stop */
-#define MSR_MDE 0x08
-#define MSR_MDT 0x04
-#define MSR_MDR 0x02
-#define MSR_MAT 0x01 /* slave addr xfer done */
-
-#define MIE_MNRE 0x40 /* nack irq en */
-#define MIE_MALE 0x20 /* arblos irq en */
-#define MIE_MSTE 0x10 /* stop irq en */
-#define MIE_MDEE 0x08
-#define MIE_MDTE 0x04
-#define MIE_MDRE 0x02
-#define MIE_MATE 0x01 /* address sent irq en */
-
-#define FCR_RFRST 0x02 /* reset rx fifo */
-#define FCR_TFRST 0x01 /* reset tx fifo */
-
-#define FSR_TEND 0x04 /* last byte sent */
-#define FSR_RDF 0x02 /* rx fifo trigger */
-#define FSR_TDFE 0x01 /* tx fifo empty */
-
-#define FIER_TEIE 0x04 /* tx fifo empty irq en */
-#define FIER_RXIE 0x02 /* rx fifo trig irq en */
-#define FIER_TXIE 0x01 /* tx fifo trig irq en */
-
-#define FIFO_SIZE 16
-
-struct cami2c {
- void __iomem *iobase;
- struct i2c_adapter adap;
-
- /* message processing */
- struct i2c_msg *msg;
-#define IDF_SEND 1
-#define IDF_RECV 2
-#define IDF_STOP 4
- int flags;
-
-#define IDS_DONE 1
-#define IDS_ARBLOST 2
-#define IDS_NACK 4
- int status;
- struct completion xfer_done;
-
- int irq;
- struct resource *ioarea;
-};
-
-static inline void OUT32(struct cami2c *cam, int reg, unsigned long val)
-{
- __raw_writel(val, (unsigned long)cam->iobase + reg);
-}
-
-static inline unsigned long IN32(struct cami2c *cam, int reg)
-{
- return __raw_readl((unsigned long)cam->iobase + reg);
-}
-
-static irqreturn_t sh7760_i2c_irq(int irq, void *ptr)
-{
- struct cami2c *id = ptr;
- struct i2c_msg *msg = id->msg;
- char *data = msg->buf;
- unsigned long msr, fsr, fier, len;
-
- msr = IN32(id, I2CMSR);
- fsr = IN32(id, I2CFSR);
-
- /* arbitration lost */
- if (msr & MSR_MAL) {
- OUT32(id, I2CMCR, 0);
- OUT32(id, I2CSCR, 0);
- OUT32(id, I2CSAR, 0);
- id->status |= IDS_DONE | IDS_ARBLOST;
- goto out;
- }
-
- if (msr & MSR_MNR) {
- /* NACK handling is very screwed up. After receiving a
- * NAK IRQ one has to wait a bit before writing to any
- * registers, or the ctl will lock up. After that delay
- * do a normal i2c stop. Then wait at least 1 ms before
- * attempting another transfer or ctl will stop working
- */
- udelay(100); /* wait or risk ctl hang */
- OUT32(id, I2CFCR, FCR_RFRST | FCR_TFRST);
- OUT32(id, I2CMCR, MCR_MIE | MCR_FSB);
- OUT32(id, I2CFIER, 0);
- OUT32(id, I2CMIER, MIE_MSTE);
- OUT32(id, I2CSCR, 0);
- OUT32(id, I2CSAR, 0);
- id->status |= IDS_NACK;
- msr &= ~MSR_MAT;
- fsr = 0;
- /* In some cases the MST bit is also set. */
- }
-
- /* i2c-stop was sent */
- if (msr & MSR_MST) {
- id->status |= IDS_DONE;
- goto out;
- }
-
- /* i2c slave addr was sent; set to "normal" operation */
- if (msr & MSR_MAT)
- OUT32(id, I2CMCR, MCR_MIE);
-
- fier = IN32(id, I2CFIER);
-
- if (fsr & FSR_RDF) {
- len = IN32(id, I2CRFDR);
- if (msg->len <= len) {
- if (id->flags & IDF_STOP) {
- OUT32(id, I2CMCR, MCR_MIE | MCR_FSB);
- OUT32(id, I2CFIER, 0);
- /* manual says: wait >= 0.5 SCL times */
- udelay(5);
- /* next int should be MST */
- } else {
- id->status |= IDS_DONE;
- /* keep the RDF bit: ctrl holds SCL low
- * until the setup for the next i2c_msg
- * clears this bit.
- */
- fsr &= ~FSR_RDF;
- }
- }
- while (msg->len && len) {
- *data++ = IN32(id, I2CRXTX);
- msg->len--;
- len--;
- }
-
- if (msg->len) {
- len = (msg->len >= FIFO_SIZE) ? FIFO_SIZE - 1
- : msg->len - 1;
-
- OUT32(id, I2CFCR, FCR_TFRST | ((len & 0xf) << 4));
- }
-
- } else if (id->flags & IDF_SEND) {
- if ((fsr & FSR_TEND) && (msg->len < 1)) {
- if (id->flags & IDF_STOP) {
- OUT32(id, I2CMCR, MCR_MIE | MCR_FSB);
- } else {
- id->status |= IDS_DONE;
- /* keep the TEND bit: ctl holds SCL low
- * until the setup for the next i2c_msg
- * clears this bit.
- */
- fsr &= ~FSR_TEND;
- }
- }
- if (fsr & FSR_TDFE) {
- while (msg->len && (IN32(id, I2CTFDR) < FIFO_SIZE)) {
- OUT32(id, I2CRXTX, *data++);
- msg->len--;
- }
-
- if (msg->len < 1) {
- fier &= ~FIER_TXIE;
- OUT32(id, I2CFIER, fier);
- } else {
- len = (msg->len >= FIFO_SIZE) ? 2 : 0;
- OUT32(id, I2CFCR,
- FCR_RFRST | ((len & 3) << 2));
- }
- }
- }
-out:
- if (id->status & IDS_DONE) {
- OUT32(id, I2CMIER, 0);
- OUT32(id, I2CFIER, 0);
- id->msg = NULL;
- complete(&id->xfer_done);
- }
- /* clear status flags and ctrl resumes work */
- OUT32(id, I2CMSR, ~msr);
- OUT32(id, I2CFSR, ~fsr);
- OUT32(id, I2CSSR, 0);
-
- return IRQ_HANDLED;
-}
-
-
-/* prepare and start a master receive operation */
-static void sh7760_i2c_mrecv(struct cami2c *id)
-{
- int len;
-
- id->flags |= IDF_RECV;
-
- /* set the slave addr reg; otherwise rcv wont work! */
- OUT32(id, I2CSAR, 0xfe);
- OUT32(id, I2CMAR, (id->msg->addr << 1) | 1);
-
- /* adjust rx fifo trigger */
- if (id->msg->len >= FIFO_SIZE)
- len = FIFO_SIZE - 1; /* trigger at fifo full */
- else
- len = id->msg->len - 1; /* trigger before all received */
-
- OUT32(id, I2CFCR, FCR_RFRST | FCR_TFRST);
- OUT32(id, I2CFCR, FCR_TFRST | ((len & 0xF) << 4));
-
- OUT32(id, I2CMSR, 0);
- OUT32(id, I2CMCR, MCR_MIE | MCR_ESG);
- OUT32(id, I2CMIER, MIE_MNRE | MIE_MALE | MIE_MSTE | MIE_MATE);
- OUT32(id, I2CFIER, FIER_RXIE);
-}
-
-/* prepare and start a master send operation */
-static void sh7760_i2c_msend(struct cami2c *id)
-{
- int len;
-
- id->flags |= IDF_SEND;
-
- /* set the slave addr reg; otherwise xmit wont work! */
- OUT32(id, I2CSAR, 0xfe);
- OUT32(id, I2CMAR, (id->msg->addr << 1) | 0);
-
- /* adjust tx fifo trigger */
- if (id->msg->len >= FIFO_SIZE)
- len = 2; /* trig: 2 bytes left in TX fifo */
- else
- len = 0; /* trig: 8 bytes left in TX fifo */
-
- OUT32(id, I2CFCR, FCR_RFRST | FCR_TFRST);
- OUT32(id, I2CFCR, FCR_RFRST | ((len & 3) << 2));
-
- while (id->msg->len && IN32(id, I2CTFDR) < FIFO_SIZE) {
- OUT32(id, I2CRXTX, *(id->msg->buf));
- (id->msg->len)--;
- (id->msg->buf)++;
- }
-
- OUT32(id, I2CMSR, 0);
- OUT32(id, I2CMCR, MCR_MIE | MCR_ESG);
- OUT32(id, I2CFSR, 0);
- OUT32(id, I2CMIER, MIE_MNRE | MIE_MALE | MIE_MSTE | MIE_MATE);
- OUT32(id, I2CFIER, FIER_TEIE | (id->msg->len ? FIER_TXIE : 0));
-}
-
-static inline int sh7760_i2c_busy_check(struct cami2c *id)
-{
- return (IN32(id, I2CMCR) & MCR_FSDA);
-}
-
-static int sh7760_i2c_master_xfer(struct i2c_adapter *adap,
- struct i2c_msg *msgs,
- int num)
-{
- struct cami2c *id = adap->algo_data;
- int i, retr;
-
- if (sh7760_i2c_busy_check(id)) {
- dev_err(&adap->dev, "sh7760-i2c%d: bus busy!\n", adap->nr);
- return -EBUSY;
- }
-
- i = 0;
- while (i < num) {
- retr = adap->retries;
-retry:
- id->flags = ((i == (num-1)) ? IDF_STOP : 0);
- id->status = 0;
- id->msg = msgs;
- init_completion(&id->xfer_done);
-
- if (msgs->flags & I2C_M_RD)
- sh7760_i2c_mrecv(id);
- else
- sh7760_i2c_msend(id);
-
- wait_for_completion(&id->xfer_done);
-
- if (id->status == 0) {
- num = -EIO;
- break;
- }
-
- if (id->status & IDS_NACK) {
- /* wait a bit or i2c module stops working */
- mdelay(1);
- num = -EREMOTEIO;
- break;
- }
-
- if (id->status & IDS_ARBLOST) {
- if (retr--) {
- mdelay(2);
- goto retry;
- }
- num = -EREMOTEIO;
- break;
- }
-
- msgs++;
- i++;
- }
-
- id->msg = NULL;
- id->flags = 0;
- id->status = 0;
-
- OUT32(id, I2CMCR, 0);
- OUT32(id, I2CMSR, 0);
- OUT32(id, I2CMIER, 0);
- OUT32(id, I2CFIER, 0);
-
- /* reset slave module registers too: master mode enables slave
- * module for receive ops (ack, data). Without this reset,
- * eternal bus activity might be reported after NACK / ARBLOST.
- */
- OUT32(id, I2CSCR, 0);
- OUT32(id, I2CSAR, 0);
- OUT32(id, I2CSSR, 0);
-
- return num;
-}
-
-static u32 sh7760_i2c_func(struct i2c_adapter *adap)
-{
- return I2C_FUNC_I2C | (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK);
-}
-
-static const struct i2c_algorithm sh7760_i2c_algo = {
- .master_xfer = sh7760_i2c_master_xfer,
- .functionality = sh7760_i2c_func,
-};
-
-/* calculate CCR register setting for a desired scl clock. SCL clock is
- * derived from I2C module clock (iclk) which in turn is derived from
- * peripheral module clock (mclk, usually around 33MHz):
- * iclk = mclk/(CDF + 1). iclk must be < 20MHz.
- * scl = iclk/(SCGD*8 + 20).
- */
-static int calc_CCR(unsigned long scl_hz)
-{
- struct clk *mclk;
- unsigned long mck, m1, dff, odff, iclk;
- signed char cdf, cdfm;
- int scgd, scgdm, scgds;
-
- mclk = clk_get(NULL, "peripheral_clk");
- if (IS_ERR(mclk)) {
- return PTR_ERR(mclk);
- } else {
- mck = mclk->rate;
- clk_put(mclk);
- }
-
- odff = scl_hz;
- scgdm = cdfm = m1 = 0;
- for (cdf = 3; cdf >= 0; cdf--) {
- iclk = mck / (1 + cdf);
- if (iclk >= 20000000)
- continue;
- scgds = ((iclk / scl_hz) - 20) >> 3;
- for (scgd = scgds; (scgd < 63) && scgd <= scgds + 1; scgd++) {
- m1 = iclk / (20 + (scgd << 3));
- dff = abs(scl_hz - m1);
- if (dff < odff) {
- odff = dff;
- cdfm = cdf;
- scgdm = scgd;
- }
- }
- }
- /* fail if more than 25% off of requested SCL */
- if (odff > (scl_hz >> 2))
- return -EINVAL;
-
- /* create a CCR register value */
- return ((scgdm << 2) | cdfm);
-}
-
-static int sh7760_i2c_probe(struct platform_device *pdev)
-{
- struct sh7760_i2c_platdata *pd;
- struct resource *res;
- struct cami2c *id;
- int ret;
-
- pd = dev_get_platdata(&pdev->dev);
- if (!pd) {
- dev_err(&pdev->dev, "no platform_data!\n");
- ret = -ENODEV;
- goto out0;
- }
-
- id = kzalloc(sizeof(struct cami2c), GFP_KERNEL);
- if (!id) {
- dev_err(&pdev->dev, "no mem for private data\n");
- ret = -ENOMEM;
- goto out0;
- }
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(&pdev->dev, "no mmio resources\n");
- ret = -ENODEV;
- goto out1;
- }
-
- id->ioarea = request_mem_region(res->start, REGSIZE, pdev->name);
- if (!id->ioarea) {
- dev_err(&pdev->dev, "mmio already reserved\n");
- ret = -EBUSY;
- goto out1;
- }
-
- id->iobase = ioremap(res->start, REGSIZE);
- if (!id->iobase) {
- dev_err(&pdev->dev, "cannot ioremap\n");
- ret = -ENODEV;
- goto out2;
- }
-
- ret = platform_get_irq(pdev, 0);
- if (ret < 0)
- goto out3;
- id->irq = ret;
-
- id->adap.nr = pdev->id;
- id->adap.algo = &sh7760_i2c_algo;
- id->adap.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
- id->adap.retries = 3;
- id->adap.algo_data = id;
- id->adap.dev.parent = &pdev->dev;
- snprintf(id->adap.name, sizeof(id->adap.name),
- "SH7760 I2C at %08lx", (unsigned long)res->start);
-
- OUT32(id, I2CMCR, 0);
- OUT32(id, I2CMSR, 0);
- OUT32(id, I2CMIER, 0);
- OUT32(id, I2CMAR, 0);
- OUT32(id, I2CSIER, 0);
- OUT32(id, I2CSAR, 0);
- OUT32(id, I2CSCR, 0);
- OUT32(id, I2CSSR, 0);
- OUT32(id, I2CFIER, 0);
- OUT32(id, I2CFCR, FCR_RFRST | FCR_TFRST);
- OUT32(id, I2CFSR, 0);
-
- ret = calc_CCR(pd->speed_khz * 1000);
- if (ret < 0) {
- dev_err(&pdev->dev, "invalid SCL clock: %dkHz\n",
- pd->speed_khz);
- goto out3;
- }
- OUT32(id, I2CCCR, ret);
-
- if (request_irq(id->irq, sh7760_i2c_irq, 0,
- SH7760_I2C_DEVNAME, id)) {
- dev_err(&pdev->dev, "cannot get irq %d\n", id->irq);
- ret = -EBUSY;
- goto out3;
- }
-
- ret = i2c_add_numbered_adapter(&id->adap);
- if (ret < 0)
- goto out4;
-
- platform_set_drvdata(pdev, id);
-
- dev_info(&pdev->dev, "%d kHz mmio %08x irq %d\n",
- pd->speed_khz, res->start, id->irq);
-
- return 0;
-
-out4:
- free_irq(id->irq, id);
-out3:
- iounmap(id->iobase);
-out2:
- release_resource(id->ioarea);
- kfree(id->ioarea);
-out1:
- kfree(id);
-out0:
- return ret;
-}
-
-static int sh7760_i2c_remove(struct platform_device *pdev)
-{
- struct cami2c *id = platform_get_drvdata(pdev);
-
- i2c_del_adapter(&id->adap);
- free_irq(id->irq, id);
- iounmap(id->iobase);
- release_resource(id->ioarea);
- kfree(id->ioarea);
- kfree(id);
-
- return 0;
-}
-
-static struct platform_driver sh7760_i2c_drv = {
- .driver = {
- .name = SH7760_I2C_DEVNAME,
- },
- .probe = sh7760_i2c_probe,
- .remove = sh7760_i2c_remove,
-};
-
-module_platform_driver(sh7760_i2c_drv);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("SH7760 I2C bus driver");
-MODULE_AUTHOR("Manuel Lauss <[email protected]>");
--
2.39.0

2023-01-13 06:37:34

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 11/22] mtd/nand: remove sh_flctl

Now that arch/sh is removed this driver is dead code.

Signed-off-by: Christoph Hellwig <[email protected]>
---
drivers/mtd/nand/raw/Kconfig | 8 -
drivers/mtd/nand/raw/Makefile | 1 -
drivers/mtd/nand/raw/sh_flctl.c | 1234 -------------------------------
include/linux/mtd/sh_flctl.h | 180 -----
4 files changed, 1423 deletions(-)
delete mode 100644 drivers/mtd/nand/raw/sh_flctl.c
delete mode 100644 include/linux/mtd/sh_flctl.h

diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
index 98ea1c9e65c8ef..20a4988ea418d5 100644
--- a/drivers/mtd/nand/raw/Kconfig
+++ b/drivers/mtd/nand/raw/Kconfig
@@ -284,14 +284,6 @@ config MTD_NAND_MXC
This enables the driver for the NAND flash controller on the
MXC processors.

-config MTD_NAND_SH_FLCTL
- tristate "Renesas SuperH FLCTL NAND controller"
- depends on SUPERH || COMPILE_TEST
- depends on HAS_IOMEM
- help
- Several Renesas SuperH CPU has FLCTL. This option enables support
- for NAND Flash using FLCTL.
-
config MTD_NAND_DAVINCI
tristate "DaVinci/Keystone NAND controller"
depends on ARCH_DAVINCI || (ARCH_KEYSTONE && TI_AEMIF) || COMPILE_TEST
diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
index fa1d0012031012..2c6eb25c9d0aae 100644
--- a/drivers/mtd/nand/raw/Makefile
+++ b/drivers/mtd/nand/raw/Makefile
@@ -33,7 +33,6 @@ obj-$(CONFIG_MTD_NAND_FSL_IFC) += fsl_ifc_nand.o
obj-$(CONFIG_MTD_NAND_FSL_UPM) += fsl_upm.o
obj-$(CONFIG_MTD_NAND_SLC_LPC32XX) += lpc32xx_slc.o
obj-$(CONFIG_MTD_NAND_MLC_LPC32XX) += lpc32xx_mlc.o
-obj-$(CONFIG_MTD_NAND_SH_FLCTL) += sh_flctl.o
obj-$(CONFIG_MTD_NAND_MXC) += mxc_nand.o
obj-$(CONFIG_MTD_NAND_SOCRATES) += socrates_nand.o
obj-$(CONFIG_MTD_NAND_TXX9NDFMC) += txx9ndfmc.o
diff --git a/drivers/mtd/nand/raw/sh_flctl.c b/drivers/mtd/nand/raw/sh_flctl.c
deleted file mode 100644
index a278829469d610..00000000000000
--- a/drivers/mtd/nand/raw/sh_flctl.c
+++ /dev/null
@@ -1,1234 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * SuperH FLCTL nand controller
- *
- * Copyright (c) 2008 Renesas Solutions Corp.
- * Copyright (c) 2008 Atom Create Engineering Co., Ltd.
- *
- * Based on fsl_elbc_nand.c, Copyright (c) 2006-2007 Freescale Semiconductor
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/completion.h>
-#include <linux/delay.h>
-#include <linux/dmaengine.h>
-#include <linux/dma-mapping.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
-#include <linux/platform_device.h>
-#include <linux/pm_runtime.h>
-#include <linux/sh_dma.h>
-#include <linux/slab.h>
-#include <linux/string.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/rawnand.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/sh_flctl.h>
-
-static int flctl_4secc_ooblayout_sp_ecc(struct mtd_info *mtd, int section,
- struct mtd_oob_region *oobregion)
-{
- struct nand_chip *chip = mtd_to_nand(mtd);
-
- if (section)
- return -ERANGE;
-
- oobregion->offset = 0;
- oobregion->length = chip->ecc.bytes;
-
- return 0;
-}
-
-static int flctl_4secc_ooblayout_sp_free(struct mtd_info *mtd, int section,
- struct mtd_oob_region *oobregion)
-{
- if (section)
- return -ERANGE;
-
- oobregion->offset = 12;
- oobregion->length = 4;
-
- return 0;
-}
-
-static const struct mtd_ooblayout_ops flctl_4secc_oob_smallpage_ops = {
- .ecc = flctl_4secc_ooblayout_sp_ecc,
- .free = flctl_4secc_ooblayout_sp_free,
-};
-
-static int flctl_4secc_ooblayout_lp_ecc(struct mtd_info *mtd, int section,
- struct mtd_oob_region *oobregion)
-{
- struct nand_chip *chip = mtd_to_nand(mtd);
-
- if (section >= chip->ecc.steps)
- return -ERANGE;
-
- oobregion->offset = (section * 16) + 6;
- oobregion->length = chip->ecc.bytes;
-
- return 0;
-}
-
-static int flctl_4secc_ooblayout_lp_free(struct mtd_info *mtd, int section,
- struct mtd_oob_region *oobregion)
-{
- struct nand_chip *chip = mtd_to_nand(mtd);
-
- if (section >= chip->ecc.steps)
- return -ERANGE;
-
- oobregion->offset = section * 16;
- oobregion->length = 6;
-
- if (!section) {
- oobregion->offset += 2;
- oobregion->length -= 2;
- }
-
- return 0;
-}
-
-static const struct mtd_ooblayout_ops flctl_4secc_oob_largepage_ops = {
- .ecc = flctl_4secc_ooblayout_lp_ecc,
- .free = flctl_4secc_ooblayout_lp_free,
-};
-
-static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
-
-static struct nand_bbt_descr flctl_4secc_smallpage = {
- .offs = 11,
- .len = 1,
- .pattern = scan_ff_pattern,
-};
-
-static struct nand_bbt_descr flctl_4secc_largepage = {
- .offs = 0,
- .len = 2,
- .pattern = scan_ff_pattern,
-};
-
-static void empty_fifo(struct sh_flctl *flctl)
-{
- writel(flctl->flintdmacr_base | AC1CLR | AC0CLR, FLINTDMACR(flctl));
- writel(flctl->flintdmacr_base, FLINTDMACR(flctl));
-}
-
-static void start_translation(struct sh_flctl *flctl)
-{
- writeb(TRSTRT, FLTRCR(flctl));
-}
-
-static void timeout_error(struct sh_flctl *flctl, const char *str)
-{
- dev_err(&flctl->pdev->dev, "Timeout occurred in %s\n", str);
-}
-
-static void wait_completion(struct sh_flctl *flctl)
-{
- uint32_t timeout = LOOP_TIMEOUT_MAX;
-
- while (timeout--) {
- if (readb(FLTRCR(flctl)) & TREND) {
- writeb(0x0, FLTRCR(flctl));
- return;
- }
- udelay(1);
- }
-
- timeout_error(flctl, __func__);
- writeb(0x0, FLTRCR(flctl));
-}
-
-static void flctl_dma_complete(void *param)
-{
- struct sh_flctl *flctl = param;
-
- complete(&flctl->dma_complete);
-}
-
-static void flctl_release_dma(struct sh_flctl *flctl)
-{
- if (flctl->chan_fifo0_rx) {
- dma_release_channel(flctl->chan_fifo0_rx);
- flctl->chan_fifo0_rx = NULL;
- }
- if (flctl->chan_fifo0_tx) {
- dma_release_channel(flctl->chan_fifo0_tx);
- flctl->chan_fifo0_tx = NULL;
- }
-}
-
-static void flctl_setup_dma(struct sh_flctl *flctl)
-{
- dma_cap_mask_t mask;
- struct dma_slave_config cfg;
- struct platform_device *pdev = flctl->pdev;
- struct sh_flctl_platform_data *pdata = dev_get_platdata(&pdev->dev);
- int ret;
-
- if (!pdata)
- return;
-
- if (pdata->slave_id_fifo0_tx <= 0 || pdata->slave_id_fifo0_rx <= 0)
- return;
-
- /* We can only either use DMA for both Tx and Rx or not use it at all */
- dma_cap_zero(mask);
- dma_cap_set(DMA_SLAVE, mask);
-
- flctl->chan_fifo0_tx = dma_request_channel(mask, shdma_chan_filter,
- (void *)(uintptr_t)pdata->slave_id_fifo0_tx);
- dev_dbg(&pdev->dev, "%s: TX: got channel %p\n", __func__,
- flctl->chan_fifo0_tx);
-
- if (!flctl->chan_fifo0_tx)
- return;
-
- memset(&cfg, 0, sizeof(cfg));
- cfg.direction = DMA_MEM_TO_DEV;
- cfg.dst_addr = flctl->fifo;
- cfg.src_addr = 0;
- ret = dmaengine_slave_config(flctl->chan_fifo0_tx, &cfg);
- if (ret < 0)
- goto err;
-
- flctl->chan_fifo0_rx = dma_request_channel(mask, shdma_chan_filter,
- (void *)(uintptr_t)pdata->slave_id_fifo0_rx);
- dev_dbg(&pdev->dev, "%s: RX: got channel %p\n", __func__,
- flctl->chan_fifo0_rx);
-
- if (!flctl->chan_fifo0_rx)
- goto err;
-
- cfg.direction = DMA_DEV_TO_MEM;
- cfg.dst_addr = 0;
- cfg.src_addr = flctl->fifo;
- ret = dmaengine_slave_config(flctl->chan_fifo0_rx, &cfg);
- if (ret < 0)
- goto err;
-
- init_completion(&flctl->dma_complete);
-
- return;
-
-err:
- flctl_release_dma(flctl);
-}
-
-static void set_addr(struct mtd_info *mtd, int column, int page_addr)
-{
- struct sh_flctl *flctl = mtd_to_flctl(mtd);
- uint32_t addr = 0;
-
- if (column == -1) {
- addr = page_addr; /* ERASE1 */
- } else if (page_addr != -1) {
- /* SEQIN, READ0, etc.. */
- if (flctl->chip.options & NAND_BUSWIDTH_16)
- column >>= 1;
- if (flctl->page_size) {
- addr = column & 0x0FFF;
- addr |= (page_addr & 0xff) << 16;
- addr |= ((page_addr >> 8) & 0xff) << 24;
- /* big than 128MB */
- if (flctl->rw_ADRCNT == ADRCNT2_E) {
- uint32_t addr2;
- addr2 = (page_addr >> 16) & 0xff;
- writel(addr2, FLADR2(flctl));
- }
- } else {
- addr = column;
- addr |= (page_addr & 0xff) << 8;
- addr |= ((page_addr >> 8) & 0xff) << 16;
- addr |= ((page_addr >> 16) & 0xff) << 24;
- }
- }
- writel(addr, FLADR(flctl));
-}
-
-static void wait_rfifo_ready(struct sh_flctl *flctl)
-{
- uint32_t timeout = LOOP_TIMEOUT_MAX;
-
- while (timeout--) {
- uint32_t val;
- /* check FIFO */
- val = readl(FLDTCNTR(flctl)) >> 16;
- if (val & 0xFF)
- return;
- udelay(1);
- }
- timeout_error(flctl, __func__);
-}
-
-static void wait_wfifo_ready(struct sh_flctl *flctl)
-{
- uint32_t len, timeout = LOOP_TIMEOUT_MAX;
-
- while (timeout--) {
- /* check FIFO */
- len = (readl(FLDTCNTR(flctl)) >> 16) & 0xFF;
- if (len >= 4)
- return;
- udelay(1);
- }
- timeout_error(flctl, __func__);
-}
-
-static enum flctl_ecc_res_t wait_recfifo_ready
- (struct sh_flctl *flctl, int sector_number)
-{
- uint32_t timeout = LOOP_TIMEOUT_MAX;
- void __iomem *ecc_reg[4];
- int i;
- int state = FL_SUCCESS;
- uint32_t data, size;
-
- /*
- * First this loops checks in FLDTCNTR if we are ready to read out the
- * oob data. This is the case if either all went fine without errors or
- * if the bottom part of the loop corrected the errors or marked them as
- * uncorrectable and the controller is given time to push the data into
- * the FIFO.
- */
- while (timeout--) {
- /* check if all is ok and we can read out the OOB */
- size = readl(FLDTCNTR(flctl)) >> 24;
- if ((size & 0xFF) == 4)
- return state;
-
- /* check if a correction code has been calculated */
- if (!(readl(FL4ECCCR(flctl)) & _4ECCEND)) {
- /*
- * either we wait for the fifo to be filled or a
- * correction pattern is being generated
- */
- udelay(1);
- continue;
- }
-
- /* check for an uncorrectable error */
- if (readl(FL4ECCCR(flctl)) & _4ECCFA) {
- /* check if we face a non-empty page */
- for (i = 0; i < 512; i++) {
- if (flctl->done_buff[i] != 0xff) {
- state = FL_ERROR; /* can't correct */
- break;
- }
- }
-
- if (state == FL_SUCCESS)
- dev_dbg(&flctl->pdev->dev,
- "reading empty sector %d, ecc error ignored\n",
- sector_number);
-
- writel(0, FL4ECCCR(flctl));
- continue;
- }
-
- /* start error correction */
- ecc_reg[0] = FL4ECCRESULT0(flctl);
- ecc_reg[1] = FL4ECCRESULT1(flctl);
- ecc_reg[2] = FL4ECCRESULT2(flctl);
- ecc_reg[3] = FL4ECCRESULT3(flctl);
-
- for (i = 0; i < 3; i++) {
- uint8_t org;
- unsigned int index;
-
- data = readl(ecc_reg[i]);
-
- if (flctl->page_size)
- index = (512 * sector_number) +
- (data >> 16);
- else
- index = data >> 16;
-
- org = flctl->done_buff[index];
- flctl->done_buff[index] = org ^ (data & 0xFF);
- }
- state = FL_REPAIRABLE;
- writel(0, FL4ECCCR(flctl));
- }
-
- timeout_error(flctl, __func__);
- return FL_TIMEOUT; /* timeout */
-}
-
-static void wait_wecfifo_ready(struct sh_flctl *flctl)
-{
- uint32_t timeout = LOOP_TIMEOUT_MAX;
- uint32_t len;
-
- while (timeout--) {
- /* check FLECFIFO */
- len = (readl(FLDTCNTR(flctl)) >> 24) & 0xFF;
- if (len >= 4)
- return;
- udelay(1);
- }
- timeout_error(flctl, __func__);
-}
-
-static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,
- int len, enum dma_data_direction dir)
-{
- struct dma_async_tx_descriptor *desc = NULL;
- struct dma_chan *chan;
- enum dma_transfer_direction tr_dir;
- dma_addr_t dma_addr;
- dma_cookie_t cookie;
- uint32_t reg;
- int ret = 0;
- unsigned long time_left;
-
- if (dir == DMA_FROM_DEVICE) {
- chan = flctl->chan_fifo0_rx;
- tr_dir = DMA_DEV_TO_MEM;
- } else {
- chan = flctl->chan_fifo0_tx;
- tr_dir = DMA_MEM_TO_DEV;
- }
-
- dma_addr = dma_map_single(chan->device->dev, buf, len, dir);
-
- if (!dma_mapping_error(chan->device->dev, dma_addr))
- desc = dmaengine_prep_slave_single(chan, dma_addr, len,
- tr_dir, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
-
- if (desc) {
- reg = readl(FLINTDMACR(flctl));
- reg |= DREQ0EN;
- writel(reg, FLINTDMACR(flctl));
-
- desc->callback = flctl_dma_complete;
- desc->callback_param = flctl;
- cookie = dmaengine_submit(desc);
- if (dma_submit_error(cookie)) {
- ret = dma_submit_error(cookie);
- dev_warn(&flctl->pdev->dev,
- "DMA submit failed, falling back to PIO\n");
- goto out;
- }
-
- dma_async_issue_pending(chan);
- } else {
- /* DMA failed, fall back to PIO */
- flctl_release_dma(flctl);
- dev_warn(&flctl->pdev->dev,
- "DMA failed, falling back to PIO\n");
- ret = -EIO;
- goto out;
- }
-
- time_left =
- wait_for_completion_timeout(&flctl->dma_complete,
- msecs_to_jiffies(3000));
-
- if (time_left == 0) {
- dmaengine_terminate_all(chan);
- dev_err(&flctl->pdev->dev, "wait_for_completion_timeout\n");
- ret = -ETIMEDOUT;
- }
-
-out:
- reg = readl(FLINTDMACR(flctl));
- reg &= ~DREQ0EN;
- writel(reg, FLINTDMACR(flctl));
-
- dma_unmap_single(chan->device->dev, dma_addr, len, dir);
-
- /* ret == 0 is success */
- return ret;
-}
-
-static void read_datareg(struct sh_flctl *flctl, int offset)
-{
- unsigned long data;
- unsigned long *buf = (unsigned long *)&flctl->done_buff[offset];
-
- wait_completion(flctl);
-
- data = readl(FLDATAR(flctl));
- *buf = le32_to_cpu(data);
-}
-
-static void read_fiforeg(struct sh_flctl *flctl, int rlen, int offset)
-{
- int i, len_4align;
- unsigned long *buf = (unsigned long *)&flctl->done_buff[offset];
-
- len_4align = (rlen + 3) / 4;
-
- /* initiate DMA transfer */
- if (flctl->chan_fifo0_rx && rlen >= 32 &&
- !flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_FROM_DEVICE))
- goto convert; /* DMA success */
-
- /* do polling transfer */
- for (i = 0; i < len_4align; i++) {
- wait_rfifo_ready(flctl);
- buf[i] = readl(FLDTFIFO(flctl));
- }
-
-convert:
- for (i = 0; i < len_4align; i++)
- buf[i] = be32_to_cpu(buf[i]);
-}
-
-static enum flctl_ecc_res_t read_ecfiforeg
- (struct sh_flctl *flctl, uint8_t *buff, int sector)
-{
- int i;
- enum flctl_ecc_res_t res;
- unsigned long *ecc_buf = (unsigned long *)buff;
-
- res = wait_recfifo_ready(flctl , sector);
-
- if (res != FL_ERROR) {
- for (i = 0; i < 4; i++) {
- ecc_buf[i] = readl(FLECFIFO(flctl));
- ecc_buf[i] = be32_to_cpu(ecc_buf[i]);
- }
- }
-
- return res;
-}
-
-static void write_fiforeg(struct sh_flctl *flctl, int rlen,
- unsigned int offset)
-{
- int i, len_4align;
- unsigned long *buf = (unsigned long *)&flctl->done_buff[offset];
-
- len_4align = (rlen + 3) / 4;
- for (i = 0; i < len_4align; i++) {
- wait_wfifo_ready(flctl);
- writel(cpu_to_be32(buf[i]), FLDTFIFO(flctl));
- }
-}
-
-static void write_ec_fiforeg(struct sh_flctl *flctl, int rlen,
- unsigned int offset)
-{
- int i, len_4align;
- unsigned long *buf = (unsigned long *)&flctl->done_buff[offset];
-
- len_4align = (rlen + 3) / 4;
-
- for (i = 0; i < len_4align; i++)
- buf[i] = cpu_to_be32(buf[i]);
-
- /* initiate DMA transfer */
- if (flctl->chan_fifo0_tx && rlen >= 32 &&
- !flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_TO_DEVICE))
- return; /* DMA success */
-
- /* do polling transfer */
- for (i = 0; i < len_4align; i++) {
- wait_wecfifo_ready(flctl);
- writel(buf[i], FLECFIFO(flctl));
- }
-}
-
-static void set_cmd_regs(struct mtd_info *mtd, uint32_t cmd, uint32_t flcmcdr_val)
-{
- struct sh_flctl *flctl = mtd_to_flctl(mtd);
- uint32_t flcmncr_val = flctl->flcmncr_base & ~SEL_16BIT;
- uint32_t flcmdcr_val, addr_len_bytes = 0;
-
- /* Set SNAND bit if page size is 2048byte */
- if (flctl->page_size)
- flcmncr_val |= SNAND_E;
- else
- flcmncr_val &= ~SNAND_E;
-
- /* default FLCMDCR val */
- flcmdcr_val = DOCMD1_E | DOADR_E;
-
- /* Set for FLCMDCR */
- switch (cmd) {
- case NAND_CMD_ERASE1:
- addr_len_bytes = flctl->erase_ADRCNT;
- flcmdcr_val |= DOCMD2_E;
- break;
- case NAND_CMD_READ0:
- case NAND_CMD_READOOB:
- case NAND_CMD_RNDOUT:
- addr_len_bytes = flctl->rw_ADRCNT;
- flcmdcr_val |= CDSRC_E;
- if (flctl->chip.options & NAND_BUSWIDTH_16)
- flcmncr_val |= SEL_16BIT;
- break;
- case NAND_CMD_SEQIN:
- /* This case is that cmd is READ0 or READ1 or READ00 */
- flcmdcr_val &= ~DOADR_E; /* ONLY execute 1st cmd */
- break;
- case NAND_CMD_PAGEPROG:
- addr_len_bytes = flctl->rw_ADRCNT;
- flcmdcr_val |= DOCMD2_E | CDSRC_E | SELRW;
- if (flctl->chip.options & NAND_BUSWIDTH_16)
- flcmncr_val |= SEL_16BIT;
- break;
- case NAND_CMD_READID:
- flcmncr_val &= ~SNAND_E;
- flcmdcr_val |= CDSRC_E;
- addr_len_bytes = ADRCNT_1;
- break;
- case NAND_CMD_STATUS:
- case NAND_CMD_RESET:
- flcmncr_val &= ~SNAND_E;
- flcmdcr_val &= ~(DOADR_E | DOSR_E);
- break;
- default:
- break;
- }
-
- /* Set address bytes parameter */
- flcmdcr_val |= addr_len_bytes;
-
- /* Now actually write */
- writel(flcmncr_val, FLCMNCR(flctl));
- writel(flcmdcr_val, FLCMDCR(flctl));
- writel(flcmcdr_val, FLCMCDR(flctl));
-}
-
-static int flctl_read_page_hwecc(struct nand_chip *chip, uint8_t *buf,
- int oob_required, int page)
-{
- struct mtd_info *mtd = nand_to_mtd(chip);
-
- nand_read_page_op(chip, page, 0, buf, mtd->writesize);
- if (oob_required)
- chip->legacy.read_buf(chip, chip->oob_poi, mtd->oobsize);
- return 0;
-}
-
-static int flctl_write_page_hwecc(struct nand_chip *chip, const uint8_t *buf,
- int oob_required, int page)
-{
- struct mtd_info *mtd = nand_to_mtd(chip);
-
- nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize);
- chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize);
- return nand_prog_page_end_op(chip);
-}
-
-static void execmd_read_page_sector(struct mtd_info *mtd, int page_addr)
-{
- struct sh_flctl *flctl = mtd_to_flctl(mtd);
- int sector, page_sectors;
- enum flctl_ecc_res_t ecc_result;
-
- page_sectors = flctl->page_size ? 4 : 1;
-
- set_cmd_regs(mtd, NAND_CMD_READ0,
- (NAND_CMD_READSTART << 8) | NAND_CMD_READ0);
-
- writel(readl(FLCMNCR(flctl)) | ACM_SACCES_MODE | _4ECCCORRECT,
- FLCMNCR(flctl));
- writel(readl(FLCMDCR(flctl)) | page_sectors, FLCMDCR(flctl));
- writel(page_addr << 2, FLADR(flctl));
-
- empty_fifo(flctl);
- start_translation(flctl);
-
- for (sector = 0; sector < page_sectors; sector++) {
- read_fiforeg(flctl, 512, 512 * sector);
-
- ecc_result = read_ecfiforeg(flctl,
- &flctl->done_buff[mtd->writesize + 16 * sector],
- sector);
-
- switch (ecc_result) {
- case FL_REPAIRABLE:
- dev_info(&flctl->pdev->dev,
- "applied ecc on page 0x%x", page_addr);
- mtd->ecc_stats.corrected++;
- break;
- case FL_ERROR:
- dev_warn(&flctl->pdev->dev,
- "page 0x%x contains corrupted data\n",
- page_addr);
- mtd->ecc_stats.failed++;
- break;
- default:
- ;
- }
- }
-
- wait_completion(flctl);
-
- writel(readl(FLCMNCR(flctl)) & ~(ACM_SACCES_MODE | _4ECCCORRECT),
- FLCMNCR(flctl));
-}
-
-static void execmd_read_oob(struct mtd_info *mtd, int page_addr)
-{
- struct sh_flctl *flctl = mtd_to_flctl(mtd);
- int page_sectors = flctl->page_size ? 4 : 1;
- int i;
-
- set_cmd_regs(mtd, NAND_CMD_READ0,
- (NAND_CMD_READSTART << 8) | NAND_CMD_READ0);
-
- empty_fifo(flctl);
-
- for (i = 0; i < page_sectors; i++) {
- set_addr(mtd, (512 + 16) * i + 512 , page_addr);
- writel(16, FLDTCNTR(flctl));
-
- start_translation(flctl);
- read_fiforeg(flctl, 16, 16 * i);
- wait_completion(flctl);
- }
-}
-
-static void execmd_write_page_sector(struct mtd_info *mtd)
-{
- struct sh_flctl *flctl = mtd_to_flctl(mtd);
- int page_addr = flctl->seqin_page_addr;
- int sector, page_sectors;
-
- page_sectors = flctl->page_size ? 4 : 1;
-
- set_cmd_regs(mtd, NAND_CMD_PAGEPROG,
- (NAND_CMD_PAGEPROG << 8) | NAND_CMD_SEQIN);
-
- empty_fifo(flctl);
- writel(readl(FLCMNCR(flctl)) | ACM_SACCES_MODE, FLCMNCR(flctl));
- writel(readl(FLCMDCR(flctl)) | page_sectors, FLCMDCR(flctl));
- writel(page_addr << 2, FLADR(flctl));
- start_translation(flctl);
-
- for (sector = 0; sector < page_sectors; sector++) {
- write_fiforeg(flctl, 512, 512 * sector);
- write_ec_fiforeg(flctl, 16, mtd->writesize + 16 * sector);
- }
-
- wait_completion(flctl);
- writel(readl(FLCMNCR(flctl)) & ~ACM_SACCES_MODE, FLCMNCR(flctl));
-}
-
-static void execmd_write_oob(struct mtd_info *mtd)
-{
- struct sh_flctl *flctl = mtd_to_flctl(mtd);
- int page_addr = flctl->seqin_page_addr;
- int sector, page_sectors;
-
- page_sectors = flctl->page_size ? 4 : 1;
-
- set_cmd_regs(mtd, NAND_CMD_PAGEPROG,
- (NAND_CMD_PAGEPROG << 8) | NAND_CMD_SEQIN);
-
- for (sector = 0; sector < page_sectors; sector++) {
- empty_fifo(flctl);
- set_addr(mtd, sector * 528 + 512, page_addr);
- writel(16, FLDTCNTR(flctl)); /* set read size */
-
- start_translation(flctl);
- write_fiforeg(flctl, 16, 16 * sector);
- wait_completion(flctl);
- }
-}
-
-static void flctl_cmdfunc(struct nand_chip *chip, unsigned int command,
- int column, int page_addr)
-{
- struct mtd_info *mtd = nand_to_mtd(chip);
- struct sh_flctl *flctl = mtd_to_flctl(mtd);
- uint32_t read_cmd = 0;
-
- pm_runtime_get_sync(&flctl->pdev->dev);
-
- flctl->read_bytes = 0;
- if (command != NAND_CMD_PAGEPROG)
- flctl->index = 0;
-
- switch (command) {
- case NAND_CMD_READ1:
- case NAND_CMD_READ0:
- if (flctl->hwecc) {
- /* read page with hwecc */
- execmd_read_page_sector(mtd, page_addr);
- break;
- }
- if (flctl->page_size)
- set_cmd_regs(mtd, command, (NAND_CMD_READSTART << 8)
- | command);
- else
- set_cmd_regs(mtd, command, command);
-
- set_addr(mtd, 0, page_addr);
-
- flctl->read_bytes = mtd->writesize + mtd->oobsize;
- if (flctl->chip.options & NAND_BUSWIDTH_16)
- column >>= 1;
- flctl->index += column;
- goto read_normal_exit;
-
- case NAND_CMD_READOOB:
- if (flctl->hwecc) {
- /* read page with hwecc */
- execmd_read_oob(mtd, page_addr);
- break;
- }
-
- if (flctl->page_size) {
- set_cmd_regs(mtd, command, (NAND_CMD_READSTART << 8)
- | NAND_CMD_READ0);
- set_addr(mtd, mtd->writesize, page_addr);
- } else {
- set_cmd_regs(mtd, command, command);
- set_addr(mtd, 0, page_addr);
- }
- flctl->read_bytes = mtd->oobsize;
- goto read_normal_exit;
-
- case NAND_CMD_RNDOUT:
- if (flctl->hwecc)
- break;
-
- if (flctl->page_size)
- set_cmd_regs(mtd, command, (NAND_CMD_RNDOUTSTART << 8)
- | command);
- else
- set_cmd_regs(mtd, command, command);
-
- set_addr(mtd, column, 0);
-
- flctl->read_bytes = mtd->writesize + mtd->oobsize - column;
- goto read_normal_exit;
-
- case NAND_CMD_READID:
- set_cmd_regs(mtd, command, command);
-
- /* READID is always performed using an 8-bit bus */
- if (flctl->chip.options & NAND_BUSWIDTH_16)
- column <<= 1;
- set_addr(mtd, column, 0);
-
- flctl->read_bytes = 8;
- writel(flctl->read_bytes, FLDTCNTR(flctl)); /* set read size */
- empty_fifo(flctl);
- start_translation(flctl);
- read_fiforeg(flctl, flctl->read_bytes, 0);
- wait_completion(flctl);
- break;
-
- case NAND_CMD_ERASE1:
- flctl->erase1_page_addr = page_addr;
- break;
-
- case NAND_CMD_ERASE2:
- set_cmd_regs(mtd, NAND_CMD_ERASE1,
- (command << 8) | NAND_CMD_ERASE1);
- set_addr(mtd, -1, flctl->erase1_page_addr);
- start_translation(flctl);
- wait_completion(flctl);
- break;
-
- case NAND_CMD_SEQIN:
- if (!flctl->page_size) {
- /* output read command */
- if (column >= mtd->writesize) {
- column -= mtd->writesize;
- read_cmd = NAND_CMD_READOOB;
- } else if (column < 256) {
- read_cmd = NAND_CMD_READ0;
- } else {
- column -= 256;
- read_cmd = NAND_CMD_READ1;
- }
- }
- flctl->seqin_column = column;
- flctl->seqin_page_addr = page_addr;
- flctl->seqin_read_cmd = read_cmd;
- break;
-
- case NAND_CMD_PAGEPROG:
- empty_fifo(flctl);
- if (!flctl->page_size) {
- set_cmd_regs(mtd, NAND_CMD_SEQIN,
- flctl->seqin_read_cmd);
- set_addr(mtd, -1, -1);
- writel(0, FLDTCNTR(flctl)); /* set 0 size */
- start_translation(flctl);
- wait_completion(flctl);
- }
- if (flctl->hwecc) {
- /* write page with hwecc */
- if (flctl->seqin_column == mtd->writesize)
- execmd_write_oob(mtd);
- else if (!flctl->seqin_column)
- execmd_write_page_sector(mtd);
- else
- pr_err("Invalid address !?\n");
- break;
- }
- set_cmd_regs(mtd, command, (command << 8) | NAND_CMD_SEQIN);
- set_addr(mtd, flctl->seqin_column, flctl->seqin_page_addr);
- writel(flctl->index, FLDTCNTR(flctl)); /* set write size */
- start_translation(flctl);
- write_fiforeg(flctl, flctl->index, 0);
- wait_completion(flctl);
- break;
-
- case NAND_CMD_STATUS:
- set_cmd_regs(mtd, command, command);
- set_addr(mtd, -1, -1);
-
- flctl->read_bytes = 1;
- writel(flctl->read_bytes, FLDTCNTR(flctl)); /* set read size */
- start_translation(flctl);
- read_datareg(flctl, 0); /* read and end */
- break;
-
- case NAND_CMD_RESET:
- set_cmd_regs(mtd, command, command);
- set_addr(mtd, -1, -1);
-
- writel(0, FLDTCNTR(flctl)); /* set 0 size */
- start_translation(flctl);
- wait_completion(flctl);
- break;
-
- default:
- break;
- }
- goto runtime_exit;
-
-read_normal_exit:
- writel(flctl->read_bytes, FLDTCNTR(flctl)); /* set read size */
- empty_fifo(flctl);
- start_translation(flctl);
- read_fiforeg(flctl, flctl->read_bytes, 0);
- wait_completion(flctl);
-runtime_exit:
- pm_runtime_put_sync(&flctl->pdev->dev);
- return;
-}
-
-static void flctl_select_chip(struct nand_chip *chip, int chipnr)
-{
- struct sh_flctl *flctl = mtd_to_flctl(nand_to_mtd(chip));
- int ret;
-
- switch (chipnr) {
- case -1:
- flctl->flcmncr_base &= ~CE0_ENABLE;
-
- pm_runtime_get_sync(&flctl->pdev->dev);
- writel(flctl->flcmncr_base, FLCMNCR(flctl));
-
- if (flctl->qos_request) {
- dev_pm_qos_remove_request(&flctl->pm_qos);
- flctl->qos_request = 0;
- }
-
- pm_runtime_put_sync(&flctl->pdev->dev);
- break;
- case 0:
- flctl->flcmncr_base |= CE0_ENABLE;
-
- if (!flctl->qos_request) {
- ret = dev_pm_qos_add_request(&flctl->pdev->dev,
- &flctl->pm_qos,
- DEV_PM_QOS_RESUME_LATENCY,
- 100);
- if (ret < 0)
- dev_err(&flctl->pdev->dev,
- "PM QoS request failed: %d\n", ret);
- flctl->qos_request = 1;
- }
-
- if (flctl->holden) {
- pm_runtime_get_sync(&flctl->pdev->dev);
- writel(HOLDEN, FLHOLDCR(flctl));
- pm_runtime_put_sync(&flctl->pdev->dev);
- }
- break;
- default:
- BUG();
- }
-}
-
-static void flctl_write_buf(struct nand_chip *chip, const uint8_t *buf, int len)
-{
- struct sh_flctl *flctl = mtd_to_flctl(nand_to_mtd(chip));
-
- memcpy(&flctl->done_buff[flctl->index], buf, len);
- flctl->index += len;
-}
-
-static uint8_t flctl_read_byte(struct nand_chip *chip)
-{
- struct sh_flctl *flctl = mtd_to_flctl(nand_to_mtd(chip));
- uint8_t data;
-
- data = flctl->done_buff[flctl->index];
- flctl->index++;
- return data;
-}
-
-static void flctl_read_buf(struct nand_chip *chip, uint8_t *buf, int len)
-{
- struct sh_flctl *flctl = mtd_to_flctl(nand_to_mtd(chip));
-
- memcpy(buf, &flctl->done_buff[flctl->index], len);
- flctl->index += len;
-}
-
-static int flctl_chip_attach_chip(struct nand_chip *chip)
-{
- u64 targetsize = nanddev_target_size(&chip->base);
- struct mtd_info *mtd = nand_to_mtd(chip);
- struct sh_flctl *flctl = mtd_to_flctl(mtd);
-
- /*
- * NAND_BUSWIDTH_16 may have been set by nand_scan_ident().
- * Add the SEL_16BIT flag in flctl->flcmncr_base.
- */
- if (chip->options & NAND_BUSWIDTH_16)
- flctl->flcmncr_base |= SEL_16BIT;
-
- if (mtd->writesize == 512) {
- flctl->page_size = 0;
- if (targetsize > (32 << 20)) {
- /* big than 32MB */
- flctl->rw_ADRCNT = ADRCNT_4;
- flctl->erase_ADRCNT = ADRCNT_3;
- } else if (targetsize > (2 << 16)) {
- /* big than 128KB */
- flctl->rw_ADRCNT = ADRCNT_3;
- flctl->erase_ADRCNT = ADRCNT_2;
- } else {
- flctl->rw_ADRCNT = ADRCNT_2;
- flctl->erase_ADRCNT = ADRCNT_1;
- }
- } else {
- flctl->page_size = 1;
- if (targetsize > (128 << 20)) {
- /* big than 128MB */
- flctl->rw_ADRCNT = ADRCNT2_E;
- flctl->erase_ADRCNT = ADRCNT_3;
- } else if (targetsize > (8 << 16)) {
- /* big than 512KB */
- flctl->rw_ADRCNT = ADRCNT_4;
- flctl->erase_ADRCNT = ADRCNT_2;
- } else {
- flctl->rw_ADRCNT = ADRCNT_3;
- flctl->erase_ADRCNT = ADRCNT_1;
- }
- }
-
- if (flctl->hwecc) {
- if (mtd->writesize == 512) {
- mtd_set_ooblayout(mtd, &flctl_4secc_oob_smallpage_ops);
- chip->badblock_pattern = &flctl_4secc_smallpage;
- } else {
- mtd_set_ooblayout(mtd, &flctl_4secc_oob_largepage_ops);
- chip->badblock_pattern = &flctl_4secc_largepage;
- }
-
- chip->ecc.size = 512;
- chip->ecc.bytes = 10;
- chip->ecc.strength = 4;
- chip->ecc.read_page = flctl_read_page_hwecc;
- chip->ecc.write_page = flctl_write_page_hwecc;
- chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST;
-
- /* 4 symbols ECC enabled */
- flctl->flcmncr_base |= _4ECCEN;
- } else {
- chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_SOFT;
- chip->ecc.algo = NAND_ECC_ALGO_HAMMING;
- }
-
- return 0;
-}
-
-static const struct nand_controller_ops flctl_nand_controller_ops = {
- .attach_chip = flctl_chip_attach_chip,
-};
-
-static irqreturn_t flctl_handle_flste(int irq, void *dev_id)
-{
- struct sh_flctl *flctl = dev_id;
-
- dev_err(&flctl->pdev->dev, "flste irq: %x\n", readl(FLINTDMACR(flctl)));
- writel(flctl->flintdmacr_base, FLINTDMACR(flctl));
-
- return IRQ_HANDLED;
-}
-
-struct flctl_soc_config {
- unsigned long flcmncr_val;
- unsigned has_hwecc:1;
- unsigned use_holden:1;
-};
-
-static struct flctl_soc_config flctl_sh7372_config = {
- .flcmncr_val = CLK_16B_12L_4H | TYPESEL_SET | SHBUSSEL,
- .has_hwecc = 1,
- .use_holden = 1,
-};
-
-static const struct of_device_id of_flctl_match[] = {
- { .compatible = "renesas,shmobile-flctl-sh7372",
- .data = &flctl_sh7372_config },
- {},
-};
-MODULE_DEVICE_TABLE(of, of_flctl_match);
-
-static struct sh_flctl_platform_data *flctl_parse_dt(struct device *dev)
-{
- const struct flctl_soc_config *config;
- struct sh_flctl_platform_data *pdata;
-
- config = of_device_get_match_data(dev);
- if (!config) {
- dev_err(dev, "%s: no OF configuration attached\n", __func__);
- return NULL;
- }
-
- pdata = devm_kzalloc(dev, sizeof(struct sh_flctl_platform_data),
- GFP_KERNEL);
- if (!pdata)
- return NULL;
-
- /* set SoC specific options */
- pdata->flcmncr_val = config->flcmncr_val;
- pdata->has_hwecc = config->has_hwecc;
- pdata->use_holden = config->use_holden;
-
- return pdata;
-}
-
-static int flctl_probe(struct platform_device *pdev)
-{
- struct resource *res;
- struct sh_flctl *flctl;
- struct mtd_info *flctl_mtd;
- struct nand_chip *nand;
- struct sh_flctl_platform_data *pdata;
- int ret;
- int irq;
-
- flctl = devm_kzalloc(&pdev->dev, sizeof(struct sh_flctl), GFP_KERNEL);
- if (!flctl)
- return -ENOMEM;
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- flctl->reg = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(flctl->reg))
- return PTR_ERR(flctl->reg);
- flctl->fifo = res->start + 0x24; /* FLDTFIFO */
-
- irq = platform_get_irq(pdev, 0);
- if (irq < 0)
- return irq;
-
- ret = devm_request_irq(&pdev->dev, irq, flctl_handle_flste, IRQF_SHARED,
- "flste", flctl);
- if (ret) {
- dev_err(&pdev->dev, "request interrupt failed.\n");
- return ret;
- }
-
- if (pdev->dev.of_node)
- pdata = flctl_parse_dt(&pdev->dev);
- else
- pdata = dev_get_platdata(&pdev->dev);
-
- if (!pdata) {
- dev_err(&pdev->dev, "no setup data defined\n");
- return -EINVAL;
- }
-
- platform_set_drvdata(pdev, flctl);
- nand = &flctl->chip;
- flctl_mtd = nand_to_mtd(nand);
- nand_set_flash_node(nand, pdev->dev.of_node);
- flctl_mtd->dev.parent = &pdev->dev;
- flctl->pdev = pdev;
- flctl->hwecc = pdata->has_hwecc;
- flctl->holden = pdata->use_holden;
- flctl->flcmncr_base = pdata->flcmncr_val;
- flctl->flintdmacr_base = flctl->hwecc ? (STERINTE | ECERB) : STERINTE;
-
- /* Set address of hardware control function */
- /* 20 us command delay time */
- nand->legacy.chip_delay = 20;
-
- nand->legacy.read_byte = flctl_read_byte;
- nand->legacy.write_buf = flctl_write_buf;
- nand->legacy.read_buf = flctl_read_buf;
- nand->legacy.select_chip = flctl_select_chip;
- nand->legacy.cmdfunc = flctl_cmdfunc;
- nand->legacy.set_features = nand_get_set_features_notsupp;
- nand->legacy.get_features = nand_get_set_features_notsupp;
-
- if (pdata->flcmncr_val & SEL_16BIT)
- nand->options |= NAND_BUSWIDTH_16;
-
- nand->options |= NAND_BBM_FIRSTPAGE | NAND_BBM_SECONDPAGE;
-
- pm_runtime_enable(&pdev->dev);
- pm_runtime_resume(&pdev->dev);
-
- flctl_setup_dma(flctl);
-
- nand->legacy.dummy_controller.ops = &flctl_nand_controller_ops;
- ret = nand_scan(nand, 1);
- if (ret)
- goto err_chip;
-
- ret = mtd_device_register(flctl_mtd, pdata->parts, pdata->nr_parts);
- if (ret)
- goto cleanup_nand;
-
- return 0;
-
-cleanup_nand:
- nand_cleanup(nand);
-err_chip:
- flctl_release_dma(flctl);
- pm_runtime_disable(&pdev->dev);
- return ret;
-}
-
-static int flctl_remove(struct platform_device *pdev)
-{
- struct sh_flctl *flctl = platform_get_drvdata(pdev);
- struct nand_chip *chip = &flctl->chip;
- int ret;
-
- flctl_release_dma(flctl);
- ret = mtd_device_unregister(nand_to_mtd(chip));
- WARN_ON(ret);
- nand_cleanup(chip);
- pm_runtime_disable(&pdev->dev);
-
- return 0;
-}
-
-static struct platform_driver flctl_driver = {
- .remove = flctl_remove,
- .driver = {
- .name = "sh_flctl",
- .of_match_table = of_flctl_match,
- },
-};
-
-module_platform_driver_probe(flctl_driver, flctl_probe);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Yoshihiro Shimoda");
-MODULE_DESCRIPTION("SuperH FLCTL driver");
-MODULE_ALIAS("platform:sh_flctl");
diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h
deleted file mode 100644
index 78fc2d4218c808..00000000000000
--- a/include/linux/mtd/sh_flctl.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
- * SuperH FLCTL nand controller
- *
- * Copyright © 2008 Renesas Solutions Corp.
- */
-
-#ifndef __SH_FLCTL_H__
-#define __SH_FLCTL_H__
-
-#include <linux/completion.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/rawnand.h>
-#include <linux/mtd/partitions.h>
-#include <linux/pm_qos.h>
-
-/* FLCTL registers */
-#define FLCMNCR(f) (f->reg + 0x0)
-#define FLCMDCR(f) (f->reg + 0x4)
-#define FLCMCDR(f) (f->reg + 0x8)
-#define FLADR(f) (f->reg + 0xC)
-#define FLADR2(f) (f->reg + 0x3C)
-#define FLDATAR(f) (f->reg + 0x10)
-#define FLDTCNTR(f) (f->reg + 0x14)
-#define FLINTDMACR(f) (f->reg + 0x18)
-#define FLBSYTMR(f) (f->reg + 0x1C)
-#define FLBSYCNT(f) (f->reg + 0x20)
-#define FLDTFIFO(f) (f->reg + 0x24)
-#define FLECFIFO(f) (f->reg + 0x28)
-#define FLTRCR(f) (f->reg + 0x2C)
-#define FLHOLDCR(f) (f->reg + 0x38)
-#define FL4ECCRESULT0(f) (f->reg + 0x80)
-#define FL4ECCRESULT1(f) (f->reg + 0x84)
-#define FL4ECCRESULT2(f) (f->reg + 0x88)
-#define FL4ECCRESULT3(f) (f->reg + 0x8C)
-#define FL4ECCCR(f) (f->reg + 0x90)
-#define FL4ECCCNT(f) (f->reg + 0x94)
-#define FLERRADR(f) (f->reg + 0x98)
-
-/* FLCMNCR control bits */
-#define _4ECCCNTEN (0x1 << 24)
-#define _4ECCEN (0x1 << 23)
-#define _4ECCCORRECT (0x1 << 22)
-#define SHBUSSEL (0x1 << 20)
-#define SEL_16BIT (0x1 << 19)
-#define SNAND_E (0x1 << 18) /* SNAND (0=512 1=2048)*/
-#define QTSEL_E (0x1 << 17)
-#define ENDIAN (0x1 << 16) /* 1 = little endian */
-#define FCKSEL_E (0x1 << 15)
-#define ACM_SACCES_MODE (0x01 << 10)
-#define NANWF_E (0x1 << 9)
-#define SE_D (0x1 << 8) /* Spare area disable */
-#define CE1_ENABLE (0x1 << 4) /* Chip Enable 1 */
-#define CE0_ENABLE (0x1 << 3) /* Chip Enable 0 */
-#define TYPESEL_SET (0x1 << 0)
-
-/*
- * Clock settings using the PULSEx registers from FLCMNCR
- *
- * Some hardware uses bits called PULSEx instead of FCKSEL_E and QTSEL_E
- * to control the clock divider used between the High-Speed Peripheral Clock
- * and the FLCTL internal clock. If so, use CLK_8_BIT_xxx for connecting 8 bit
- * and CLK_16_BIT_xxx for connecting 16 bit bus bandwith NAND chips. For the 16
- * bit version the divider is seperate for the pulse width of high and low
- * signals.
- */
-#define PULSE3 (0x1 << 27)
-#define PULSE2 (0x1 << 17)
-#define PULSE1 (0x1 << 15)
-#define PULSE0 (0x1 << 9)
-#define CLK_8B_0_5 PULSE1
-#define CLK_8B_1 0x0
-#define CLK_8B_1_5 (PULSE1 | PULSE2)
-#define CLK_8B_2 PULSE0
-#define CLK_8B_3 (PULSE0 | PULSE1 | PULSE2)
-#define CLK_8B_4 (PULSE0 | PULSE2)
-#define CLK_16B_6L_2H PULSE0
-#define CLK_16B_9L_3H (PULSE0 | PULSE1 | PULSE2)
-#define CLK_16B_12L_4H (PULSE0 | PULSE2)
-
-/* FLCMDCR control bits */
-#define ADRCNT2_E (0x1 << 31) /* 5byte address enable */
-#define ADRMD_E (0x1 << 26) /* Sector address access */
-#define CDSRC_E (0x1 << 25) /* Data buffer selection */
-#define DOSR_E (0x1 << 24) /* Status read check */
-#define SELRW (0x1 << 21) /* 0:read 1:write */
-#define DOADR_E (0x1 << 20) /* Address stage execute */
-#define ADRCNT_1 (0x00 << 18) /* Address data bytes: 1byte */
-#define ADRCNT_2 (0x01 << 18) /* Address data bytes: 2byte */
-#define ADRCNT_3 (0x02 << 18) /* Address data bytes: 3byte */
-#define ADRCNT_4 (0x03 << 18) /* Address data bytes: 4byte */
-#define DOCMD2_E (0x1 << 17) /* 2nd cmd stage execute */
-#define DOCMD1_E (0x1 << 16) /* 1st cmd stage execute */
-
-/* FLINTDMACR control bits */
-#define ESTERINTE (0x1 << 24) /* ECC error interrupt enable */
-#define AC1CLR (0x1 << 19) /* ECC FIFO clear */
-#define AC0CLR (0x1 << 18) /* Data FIFO clear */
-#define DREQ0EN (0x1 << 16) /* FLDTFIFODMA Request Enable */
-#define ECERB (0x1 << 9) /* ECC error */
-#define STERB (0x1 << 8) /* Status error */
-#define STERINTE (0x1 << 4) /* Status error enable */
-
-/* FLTRCR control bits */
-#define TRSTRT (0x1 << 0) /* translation start */
-#define TREND (0x1 << 1) /* translation end */
-
-/*
- * FLHOLDCR control bits
- *
- * HOLDEN: Bus Occupancy Enable (inverted)
- * Enable this bit when the external bus might be used in between transfers.
- * If not set and the bus gets used by other modules, a deadlock occurs.
- */
-#define HOLDEN (0x1 << 0)
-
-/* FL4ECCCR control bits */
-#define _4ECCFA (0x1 << 2) /* 4 symbols correct fault */
-#define _4ECCEND (0x1 << 1) /* 4 symbols end */
-#define _4ECCEXST (0x1 << 0) /* 4 symbols exist */
-
-#define LOOP_TIMEOUT_MAX 0x00010000
-
-enum flctl_ecc_res_t {
- FL_SUCCESS,
- FL_REPAIRABLE,
- FL_ERROR,
- FL_TIMEOUT
-};
-
-struct dma_chan;
-
-struct sh_flctl {
- struct nand_chip chip;
- struct platform_device *pdev;
- struct dev_pm_qos_request pm_qos;
- void __iomem *reg;
- resource_size_t fifo;
-
- uint8_t done_buff[2048 + 64]; /* max size 2048 + 64 */
- int read_bytes;
- unsigned int index;
- int seqin_column; /* column in SEQIN cmd */
- int seqin_page_addr; /* page_addr in SEQIN cmd */
- uint32_t seqin_read_cmd; /* read cmd in SEQIN cmd */
- int erase1_page_addr; /* page_addr in ERASE1 cmd */
- uint32_t erase_ADRCNT; /* bits of FLCMDCR in ERASE1 cmd */
- uint32_t rw_ADRCNT; /* bits of FLCMDCR in READ WRITE cmd */
- uint32_t flcmncr_base; /* base value of FLCMNCR */
- uint32_t flintdmacr_base; /* irq enable bits */
-
- unsigned page_size:1; /* NAND page size (0 = 512, 1 = 2048) */
- unsigned hwecc:1; /* Hardware ECC (0 = disabled, 1 = enabled) */
- unsigned holden:1; /* Hardware has FLHOLDCR and HOLDEN is set */
- unsigned qos_request:1; /* QoS request to prevent deep power shutdown */
-
- /* DMA related objects */
- struct dma_chan *chan_fifo0_rx;
- struct dma_chan *chan_fifo0_tx;
- struct completion dma_complete;
-};
-
-struct sh_flctl_platform_data {
- struct mtd_partition *parts;
- int nr_parts;
- unsigned long flcmncr_val;
-
- unsigned has_hwecc:1;
- unsigned use_holden:1;
-
- unsigned int slave_id_fifo0_tx;
- unsigned int slave_id_fifo0_rx;
-};
-
-static inline struct sh_flctl *mtd_to_flctl(struct mtd_info *mtdinfo)
-{
- return container_of(mtd_to_nand(mtdinfo), struct sh_flctl, chip);
-}
-
-#endif /* __SH_FLCTL_H__ */
--
2.39.0

2023-01-13 06:40:53

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 05/22] sound: remove sh-specific sounds/soc/sh drivers

Now that arch/sh is removed these drivers are dead code.

Signed-off-by: Christoph Hellwig <[email protected]>
---
sound/soc/sh/Kconfig | 44 --
sound/soc/sh/Makefile | 16 -
sound/soc/sh/dma-sh7760.c | 334 ----------------
sound/soc/sh/fsi.c | 9 -
sound/soc/sh/hac.c | 345 ----------------
sound/soc/sh/migor.c | 205 ----------
sound/soc/sh/sh7760-ac97.c | 72 ----
sound/soc/sh/siu.h | 180 ---------
sound/soc/sh/siu_dai.c | 799 -------------------------------------
sound/soc/sh/siu_pcm.c | 553 -------------------------
sound/soc/sh/ssi.c | 403 -------------------
11 files changed, 2960 deletions(-)
delete mode 100644 sound/soc/sh/dma-sh7760.c
delete mode 100644 sound/soc/sh/hac.c
delete mode 100644 sound/soc/sh/migor.c
delete mode 100644 sound/soc/sh/sh7760-ac97.c
delete mode 100644 sound/soc/sh/siu.h
delete mode 100644 sound/soc/sh/siu_dai.c
delete mode 100644 sound/soc/sh/siu_pcm.c
delete mode 100644 sound/soc/sh/ssi.c

diff --git a/sound/soc/sh/Kconfig b/sound/soc/sh/Kconfig
index 793a0326f32b46..4367927b81df20 100644
--- a/sound/soc/sh/Kconfig
+++ b/sound/soc/sh/Kconfig
@@ -2,25 +2,10 @@
menu "SoC Audio support for Renesas SoCs"
depends on ARCH_RENESAS || COMPILE_TEST

-config SND_SOC_PCM_SH7760
- tristate "SoC Audio support for Renesas SH7760"
- depends on CPU_SUBTYPE_SH7760 && SH_DMABRG
- help
- Enable this option for SH7760 AC97/I2S audio support.
-
-
##
## Audio unit modules
##

-config SND_SOC_SH4_HAC
- tristate
- select AC97_BUS
- select SND_SOC_AC97_BUS
-
-config SND_SOC_SH4_SSI
- tristate
-
config SND_SOC_SH4_FSI
tristate "SH4 FSI support"
depends on COMMON_CLK
@@ -28,14 +13,6 @@ config SND_SOC_SH4_FSI
help
This option enables FSI sound support

-config SND_SOC_SH4_SIU
- tristate
- depends on ARCH_SHMOBILE && HAVE_CLK
- depends on DMADEVICES
- select DMA_ENGINE
- select SH_DMAE
- select FW_LOADER
-
config SND_SOC_RCAR
tristate "R-Car series SRU/SCU/SSIU/SSI support"
depends on COMMON_CLK
@@ -51,25 +28,4 @@ config SND_SOC_RZ
help
This option enables RZ/G2L SSIF-2 sound support.

-##
-## Boards
-##
-
-config SND_SH7760_AC97
- tristate "SH7760 AC97 sound support"
- depends on CPU_SUBTYPE_SH7760 && SND_SOC_PCM_SH7760
- select SND_SOC_SH4_HAC
- select SND_SOC_AC97_CODEC
- help
- This option enables generic sound support for the first
- AC97 unit of the SH7760.
-
-config SND_SIU_MIGOR
- tristate "SIU sound support on Migo-R"
- depends on SH_MIGOR && I2C
- select SND_SOC_SH4_SIU
- select SND_SOC_WM8978
- help
- This option enables sound support for the SH7722 Migo-R board
-
endmenu
diff --git a/sound/soc/sh/Makefile b/sound/soc/sh/Makefile
index f6fd79948f6ae9..c308dda887e633 100644
--- a/sound/soc/sh/Makefile
+++ b/sound/soc/sh/Makefile
@@ -1,28 +1,12 @@
# SPDX-License-Identifier: GPL-2.0
-## DMA engines
-snd-soc-dma-sh7760-objs := dma-sh7760.o
-obj-$(CONFIG_SND_SOC_PCM_SH7760) += snd-soc-dma-sh7760.o

## audio units found on some SH-4
-snd-soc-hac-objs := hac.o
-snd-soc-ssi-objs := ssi.o
snd-soc-fsi-objs := fsi.o
-snd-soc-siu-objs := siu_pcm.o siu_dai.o
-obj-$(CONFIG_SND_SOC_SH4_HAC) += snd-soc-hac.o
-obj-$(CONFIG_SND_SOC_SH4_SSI) += snd-soc-ssi.o
obj-$(CONFIG_SND_SOC_SH4_FSI) += snd-soc-fsi.o
-obj-$(CONFIG_SND_SOC_SH4_SIU) += snd-soc-siu.o

## audio units for R-Car
obj-$(CONFIG_SND_SOC_RCAR) += rcar/

-## boards
-snd-soc-sh7760-ac97-objs := sh7760-ac97.o
-snd-soc-migor-objs := migor.o
-
-obj-$(CONFIG_SND_SH7760_AC97) += snd-soc-sh7760-ac97.o
-obj-$(CONFIG_SND_SIU_MIGOR) += snd-soc-migor.o
-
# RZ/G2L
snd-soc-rz-ssi-objs := rz-ssi.o
obj-$(CONFIG_SND_SOC_RZ) += snd-soc-rz-ssi.o
diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c
deleted file mode 100644
index 121e48f984c50c..00000000000000
--- a/sound/soc/sh/dma-sh7760.c
+++ /dev/null
@@ -1,334 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-//
-// SH7760 ("camelot") DMABRG audio DMA unit support
-//
-// Copyright (C) 2007 Manuel Lauss <[email protected]>
-//
-// The SH7760 DMABRG provides 4 dma channels (2x rec, 2x play), which
-// trigger an interrupt when one half of the programmed transfer size
-// has been xmitted.
-//
-// FIXME: little-endian only for now
-
-#include <linux/module.h>
-#include <linux/gfp.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/soc.h>
-#include <asm/dmabrg.h>
-
-
-/* registers and bits */
-#define BRGATXSAR 0x00
-#define BRGARXDAR 0x04
-#define BRGATXTCR 0x08
-#define BRGARXTCR 0x0C
-#define BRGACR 0x10
-#define BRGATXTCNT 0x14
-#define BRGARXTCNT 0x18
-
-#define ACR_RAR (1 << 18)
-#define ACR_RDS (1 << 17)
-#define ACR_RDE (1 << 16)
-#define ACR_TAR (1 << 2)
-#define ACR_TDS (1 << 1)
-#define ACR_TDE (1 << 0)
-
-/* receiver/transmitter data alignment */
-#define ACR_RAM_NONE (0 << 24)
-#define ACR_RAM_4BYTE (1 << 24)
-#define ACR_RAM_2WORD (2 << 24)
-#define ACR_TAM_NONE (0 << 8)
-#define ACR_TAM_4BYTE (1 << 8)
-#define ACR_TAM_2WORD (2 << 8)
-
-
-struct camelot_pcm {
- unsigned long mmio; /* DMABRG audio channel control reg MMIO */
- unsigned int txid; /* ID of first DMABRG IRQ for this unit */
-
- struct snd_pcm_substream *tx_ss;
- unsigned long tx_period_size;
- unsigned int tx_period;
-
- struct snd_pcm_substream *rx_ss;
- unsigned long rx_period_size;
- unsigned int rx_period;
-
-} cam_pcm_data[2] = {
- {
- .mmio = 0xFE3C0040,
- .txid = DMABRGIRQ_A0TXF,
- },
- {
- .mmio = 0xFE3C0060,
- .txid = DMABRGIRQ_A1TXF,
- },
-};
-
-#define BRGREG(x) (*(unsigned long *)(cam->mmio + (x)))
-
-/*
- * set a minimum of 16kb per period, to avoid interrupt-"storm" and
- * resulting skipping. In general, the bigger the minimum size, the
- * better for overall system performance. (The SH7760 is a puny CPU
- * with a slow SDRAM interface and poor internal bus bandwidth,
- * *especially* when the LCDC is active). The minimum for the DMAC
- * is 8 bytes; 16kbytes are enough to get skip-free playback of a
- * 44kHz/16bit/stereo MP3 on a lightly loaded system, and maintain
- * reasonable responsiveness in MPlayer.
- */
-#define DMABRG_PERIOD_MIN 16 * 1024
-#define DMABRG_PERIOD_MAX 0x03fffffc
-#define DMABRG_PREALLOC_BUFFER 32 * 1024
-#define DMABRG_PREALLOC_BUFFER_MAX 32 * 1024
-
-static const struct snd_pcm_hardware camelot_pcm_hardware = {
- .info = (SNDRV_PCM_INFO_MMAP |
- SNDRV_PCM_INFO_INTERLEAVED |
- SNDRV_PCM_INFO_BLOCK_TRANSFER |
- SNDRV_PCM_INFO_MMAP_VALID |
- SNDRV_PCM_INFO_BATCH),
- .buffer_bytes_max = DMABRG_PERIOD_MAX,
- .period_bytes_min = DMABRG_PERIOD_MIN,
- .period_bytes_max = DMABRG_PERIOD_MAX / 2,
- .periods_min = 2,
- .periods_max = 2,
- .fifo_size = 128,
-};
-
-static void camelot_txdma(void *data)
-{
- struct camelot_pcm *cam = data;
- cam->tx_period ^= 1;
- snd_pcm_period_elapsed(cam->tx_ss);
-}
-
-static void camelot_rxdma(void *data)
-{
- struct camelot_pcm *cam = data;
- cam->rx_period ^= 1;
- snd_pcm_period_elapsed(cam->rx_ss);
-}
-
-static int camelot_pcm_open(struct snd_soc_component *component,
- struct snd_pcm_substream *substream)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct camelot_pcm *cam = &cam_pcm_data[asoc_rtd_to_cpu(rtd, 0)->id];
- int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1;
- int ret, dmairq;
-
- snd_soc_set_runtime_hwparams(substream, &camelot_pcm_hardware);
-
- /* DMABRG buffer half/full events */
- dmairq = (recv) ? cam->txid + 2 : cam->txid;
- if (recv) {
- cam->rx_ss = substream;
- ret = dmabrg_request_irq(dmairq, camelot_rxdma, cam);
- if (unlikely(ret)) {
- pr_debug("audio unit %d irqs already taken!\n",
- asoc_rtd_to_cpu(rtd, 0)->id);
- return -EBUSY;
- }
- (void)dmabrg_request_irq(dmairq + 1,camelot_rxdma, cam);
- } else {
- cam->tx_ss = substream;
- ret = dmabrg_request_irq(dmairq, camelot_txdma, cam);
- if (unlikely(ret)) {
- pr_debug("audio unit %d irqs already taken!\n",
- asoc_rtd_to_cpu(rtd, 0)->id);
- return -EBUSY;
- }
- (void)dmabrg_request_irq(dmairq + 1, camelot_txdma, cam);
- }
- return 0;
-}
-
-static int camelot_pcm_close(struct snd_soc_component *component,
- struct snd_pcm_substream *substream)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct camelot_pcm *cam = &cam_pcm_data[asoc_rtd_to_cpu(rtd, 0)->id];
- int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1;
- int dmairq;
-
- dmairq = (recv) ? cam->txid + 2 : cam->txid;
-
- if (recv)
- cam->rx_ss = NULL;
- else
- cam->tx_ss = NULL;
-
- dmabrg_free_irq(dmairq + 1);
- dmabrg_free_irq(dmairq);
-
- return 0;
-}
-
-static int camelot_hw_params(struct snd_soc_component *component,
- struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *hw_params)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct camelot_pcm *cam = &cam_pcm_data[asoc_rtd_to_cpu(rtd, 0)->id];
- int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1;
-
- if (recv) {
- cam->rx_period_size = params_period_bytes(hw_params);
- cam->rx_period = 0;
- } else {
- cam->tx_period_size = params_period_bytes(hw_params);
- cam->tx_period = 0;
- }
- return 0;
-}
-
-static int camelot_prepare(struct snd_soc_component *component,
- struct snd_pcm_substream *substream)
-{
- struct snd_pcm_runtime *runtime = substream->runtime;
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct camelot_pcm *cam = &cam_pcm_data[asoc_rtd_to_cpu(rtd, 0)->id];
-
- pr_debug("PCM data: addr 0x%08lx len %d\n",
- (u32)runtime->dma_addr, runtime->dma_bytes);
-
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- BRGREG(BRGATXSAR) = (unsigned long)runtime->dma_area;
- BRGREG(BRGATXTCR) = runtime->dma_bytes;
- } else {
- BRGREG(BRGARXDAR) = (unsigned long)runtime->dma_area;
- BRGREG(BRGARXTCR) = runtime->dma_bytes;
- }
-
- return 0;
-}
-
-static inline void dmabrg_play_dma_start(struct camelot_pcm *cam)
-{
- unsigned long acr = BRGREG(BRGACR) & ~(ACR_TDS | ACR_RDS);
- /* start DMABRG engine: XFER start, auto-addr-reload */
- BRGREG(BRGACR) = acr | ACR_TDE | ACR_TAR | ACR_TAM_2WORD;
-}
-
-static inline void dmabrg_play_dma_stop(struct camelot_pcm *cam)
-{
- unsigned long acr = BRGREG(BRGACR) & ~(ACR_TDS | ACR_RDS);
- /* forcibly terminate data transmission */
- BRGREG(BRGACR) = acr | ACR_TDS;
-}
-
-static inline void dmabrg_rec_dma_start(struct camelot_pcm *cam)
-{
- unsigned long acr = BRGREG(BRGACR) & ~(ACR_TDS | ACR_RDS);
- /* start DMABRG engine: recv start, auto-reload */
- BRGREG(BRGACR) = acr | ACR_RDE | ACR_RAR | ACR_RAM_2WORD;
-}
-
-static inline void dmabrg_rec_dma_stop(struct camelot_pcm *cam)
-{
- unsigned long acr = BRGREG(BRGACR) & ~(ACR_TDS | ACR_RDS);
- /* forcibly terminate data receiver */
- BRGREG(BRGACR) = acr | ACR_RDS;
-}
-
-static int camelot_trigger(struct snd_soc_component *component,
- struct snd_pcm_substream *substream, int cmd)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct camelot_pcm *cam = &cam_pcm_data[asoc_rtd_to_cpu(rtd, 0)->id];
- int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1;
-
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_START:
- if (recv)
- dmabrg_rec_dma_start(cam);
- else
- dmabrg_play_dma_start(cam);
- break;
- case SNDRV_PCM_TRIGGER_STOP:
- if (recv)
- dmabrg_rec_dma_stop(cam);
- else
- dmabrg_play_dma_stop(cam);
- break;
- default:
- return -EINVAL;
- }
-
- return 0;
-}
-
-static snd_pcm_uframes_t camelot_pos(struct snd_soc_component *component,
- struct snd_pcm_substream *substream)
-{
- struct snd_pcm_runtime *runtime = substream->runtime;
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct camelot_pcm *cam = &cam_pcm_data[asoc_rtd_to_cpu(rtd, 0)->id];
- int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1;
- unsigned long pos;
-
- /* cannot use the DMABRG pointer register: under load, by the
- * time ALSA comes around to read the register, it is already
- * far ahead (or worse, already done with the fragment) of the
- * position at the time the IRQ was triggered, which results in
- * fast-playback sound in my test application (ScummVM)
- */
- if (recv)
- pos = cam->rx_period ? cam->rx_period_size : 0;
- else
- pos = cam->tx_period ? cam->tx_period_size : 0;
-
- return bytes_to_frames(runtime, pos);
-}
-
-static int camelot_pcm_new(struct snd_soc_component *component,
- struct snd_soc_pcm_runtime *rtd)
-{
- struct snd_pcm *pcm = rtd->pcm;
-
- /* dont use SNDRV_DMA_TYPE_DEV, since it will oops the SH kernel
- * in MMAP mode (i.e. aplay -M)
- */
- snd_pcm_set_managed_buffer_all(pcm,
- SNDRV_DMA_TYPE_CONTINUOUS,
- NULL,
- DMABRG_PREALLOC_BUFFER, DMABRG_PREALLOC_BUFFER_MAX);
-
- return 0;
-}
-
-static const struct snd_soc_component_driver sh7760_soc_component = {
- .open = camelot_pcm_open,
- .close = camelot_pcm_close,
- .hw_params = camelot_hw_params,
- .prepare = camelot_prepare,
- .trigger = camelot_trigger,
- .pointer = camelot_pos,
- .pcm_construct = camelot_pcm_new,
-};
-
-static int sh7760_soc_platform_probe(struct platform_device *pdev)
-{
- return devm_snd_soc_register_component(&pdev->dev, &sh7760_soc_component,
- NULL, 0);
-}
-
-static struct platform_driver sh7760_pcm_driver = {
- .driver = {
- .name = "sh7760-pcm-audio",
- },
-
- .probe = sh7760_soc_platform_probe,
-};
-
-module_platform_driver(sh7760_pcm_driver);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("SH7760 Audio DMA (DMABRG) driver");
-MODULE_AUTHOR("Manuel Lauss <[email protected]>");
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index f3edc2e3d9d7c4..c599070f2210f4 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1372,16 +1372,7 @@ static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io, struct dev
{
int is_play = fsi_stream_is_play(fsi, io);

-#ifdef CONFIG_SUPERH
- dma_cap_mask_t mask;
- dma_cap_zero(mask);
- dma_cap_set(DMA_SLAVE, mask);
-
- io->chan = dma_request_channel(mask, shdma_chan_filter,
- (void *)io->dma_id);
-#else
io->chan = dma_request_slave_channel(dev, is_play ? "tx" : "rx");
-#endif
if (io->chan) {
struct dma_slave_config cfg = {};
int ret;
diff --git a/sound/soc/sh/hac.c b/sound/soc/sh/hac.c
deleted file mode 100644
index 46d145cbaf2970..00000000000000
--- a/sound/soc/sh/hac.c
+++ /dev/null
@@ -1,345 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-//
-// Hitachi Audio Controller (AC97) support for SH7760/SH7780
-//
-// Copyright (c) 2007 Manuel Lauss <[email protected]>
-//
-// dont forget to set IPSEL/OMSEL register bits (in your board code) to
-// enable HAC output pins!
-
-/* BIG FAT FIXME: although the SH7760 has 2 independent AC97 units, only
- * the FIRST can be used since ASoC does not pass any information to the
- * ac97_read/write() functions regarding WHICH unit to use. You'll have
- * to edit the code a bit to use the other AC97 unit. --mlau
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/wait.h>
-#include <linux/delay.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/ac97_codec.h>
-#include <sound/initval.h>
-#include <sound/soc.h>
-
-/* regs and bits */
-#define HACCR 0x08
-#define HACCSAR 0x20
-#define HACCSDR 0x24
-#define HACPCML 0x28
-#define HACPCMR 0x2C
-#define HACTIER 0x50
-#define HACTSR 0x54
-#define HACRIER 0x58
-#define HACRSR 0x5C
-#define HACACR 0x60
-
-#define CR_CR (1 << 15) /* "codec-ready" indicator */
-#define CR_CDRT (1 << 11) /* cold reset */
-#define CR_WMRT (1 << 10) /* warm reset */
-#define CR_B9 (1 << 9) /* the mysterious "bit 9" */
-#define CR_ST (1 << 5) /* AC97 link start bit */
-
-#define CSAR_RD (1 << 19) /* AC97 data read bit */
-#define CSAR_WR (0)
-
-#define TSR_CMDAMT (1 << 31)
-#define TSR_CMDDMT (1 << 30)
-
-#define RSR_STARY (1 << 22)
-#define RSR_STDRY (1 << 21)
-
-#define ACR_DMARX16 (1 << 30)
-#define ACR_DMATX16 (1 << 29)
-#define ACR_TX12ATOM (1 << 26)
-#define ACR_DMARX20 ((1 << 24) | (1 << 22))
-#define ACR_DMATX20 ((1 << 23) | (1 << 21))
-
-#define CSDR_SHIFT 4
-#define CSDR_MASK (0xffff << CSDR_SHIFT)
-#define CSAR_SHIFT 12
-#define CSAR_MASK (0x7f << CSAR_SHIFT)
-
-#define AC97_WRITE_RETRY 1
-#define AC97_READ_RETRY 5
-
-/* manual-suggested AC97 codec access timeouts (us) */
-#define TMO_E1 500 /* 21 < E1 < 1000 */
-#define TMO_E2 13 /* 13 < E2 */
-#define TMO_E3 21 /* 21 < E3 */
-#define TMO_E4 500 /* 21 < E4 < 1000 */
-
-struct hac_priv {
- unsigned long mmio; /* HAC base address */
-} hac_cpu_data[] = {
-#if defined(CONFIG_CPU_SUBTYPE_SH7760)
- {
- .mmio = 0xFE240000,
- },
- {
- .mmio = 0xFE250000,
- },
-#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
- {
- .mmio = 0xFFE40000,
- },
-#else
-#error "Unsupported SuperH SoC"
-#endif
-};
-
-#define HACREG(reg) (*(unsigned long *)(hac->mmio + (reg)))
-
-/*
- * AC97 read/write flow as outlined in the SH7760 manual (pages 903-906)
- */
-static int hac_get_codec_data(struct hac_priv *hac, unsigned short r,
- unsigned short *v)
-{
- unsigned int to1, to2, i;
- unsigned short adr;
-
- for (i = AC97_READ_RETRY; i; i--) {
- *v = 0;
- /* wait for HAC to receive something from the codec */
- for (to1 = TMO_E4;
- to1 && !(HACREG(HACRSR) & RSR_STARY);
- --to1)
- udelay(1);
- for (to2 = TMO_E4;
- to2 && !(HACREG(HACRSR) & RSR_STDRY);
- --to2)
- udelay(1);
-
- if (!to1 && !to2)
- return 0; /* codec comm is down */
-
- adr = ((HACREG(HACCSAR) & CSAR_MASK) >> CSAR_SHIFT);
- *v = ((HACREG(HACCSDR) & CSDR_MASK) >> CSDR_SHIFT);
-
- HACREG(HACRSR) &= ~(RSR_STDRY | RSR_STARY);
-
- if (r == adr)
- break;
-
- /* manual says: wait at least 21 usec before retrying */
- udelay(21);
- }
- HACREG(HACRSR) &= ~(RSR_STDRY | RSR_STARY);
- return i;
-}
-
-static unsigned short hac_read_codec_aux(struct hac_priv *hac,
- unsigned short reg)
-{
- unsigned short val;
- unsigned int i, to;
-
- for (i = AC97_READ_RETRY; i; i--) {
- /* send_read_request */
- local_irq_disable();
- HACREG(HACTSR) &= ~(TSR_CMDAMT);
- HACREG(HACCSAR) = (reg << CSAR_SHIFT) | CSAR_RD;
- local_irq_enable();
-
- for (to = TMO_E3;
- to && !(HACREG(HACTSR) & TSR_CMDAMT);
- --to)
- udelay(1);
-
- HACREG(HACTSR) &= ~TSR_CMDAMT;
- val = 0;
- if (hac_get_codec_data(hac, reg, &val) != 0)
- break;
- }
-
- return i ? val : ~0;
-}
-
-static void hac_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
- unsigned short val)
-{
- int unit_id = 0 /* ac97->private_data */;
- struct hac_priv *hac = &hac_cpu_data[unit_id];
- unsigned int i, to;
- /* write_codec_aux */
- for (i = AC97_WRITE_RETRY; i; i--) {
- /* send_write_request */
- local_irq_disable();
- HACREG(HACTSR) &= ~(TSR_CMDDMT | TSR_CMDAMT);
- HACREG(HACCSDR) = (val << CSDR_SHIFT);
- HACREG(HACCSAR) = (reg << CSAR_SHIFT) & (~CSAR_RD);
- local_irq_enable();
-
- /* poll-wait for CMDAMT and CMDDMT */
- for (to = TMO_E1;
- to && !(HACREG(HACTSR) & (TSR_CMDAMT|TSR_CMDDMT));
- --to)
- udelay(1);
-
- HACREG(HACTSR) &= ~(TSR_CMDAMT | TSR_CMDDMT);
- if (to)
- break;
- /* timeout, try again */
- }
-}
-
-static unsigned short hac_ac97_read(struct snd_ac97 *ac97,
- unsigned short reg)
-{
- int unit_id = 0 /* ac97->private_data */;
- struct hac_priv *hac = &hac_cpu_data[unit_id];
- return hac_read_codec_aux(hac, reg);
-}
-
-static void hac_ac97_warmrst(struct snd_ac97 *ac97)
-{
- int unit_id = 0 /* ac97->private_data */;
- struct hac_priv *hac = &hac_cpu_data[unit_id];
- unsigned int tmo;
-
- HACREG(HACCR) = CR_WMRT | CR_ST | CR_B9;
- msleep(10);
- HACREG(HACCR) = CR_ST | CR_B9;
- for (tmo = 1000; (tmo > 0) && !(HACREG(HACCR) & CR_CR); tmo--)
- udelay(1);
-
- if (!tmo)
- printk(KERN_INFO "hac: reset: AC97 link down!\n");
- /* settings this bit lets us have a conversation with codec */
- HACREG(HACACR) |= ACR_TX12ATOM;
-}
-
-static void hac_ac97_coldrst(struct snd_ac97 *ac97)
-{
- int unit_id = 0 /* ac97->private_data */;
- struct hac_priv *hac;
- hac = &hac_cpu_data[unit_id];
-
- HACREG(HACCR) = 0;
- HACREG(HACCR) = CR_CDRT | CR_ST | CR_B9;
- msleep(10);
- hac_ac97_warmrst(ac97);
-}
-
-static struct snd_ac97_bus_ops hac_ac97_ops = {
- .read = hac_ac97_read,
- .write = hac_ac97_write,
- .reset = hac_ac97_coldrst,
- .warm_reset = hac_ac97_warmrst,
-};
-
-static int hac_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params,
- struct snd_soc_dai *dai)
-{
- struct hac_priv *hac = &hac_cpu_data[dai->id];
- int d = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1;
-
- switch (params->msbits) {
- case 16:
- HACREG(HACACR) |= d ? ACR_DMARX16 : ACR_DMATX16;
- HACREG(HACACR) &= d ? ~ACR_DMARX20 : ~ACR_DMATX20;
- break;
- case 20:
- HACREG(HACACR) &= d ? ~ACR_DMARX16 : ~ACR_DMATX16;
- HACREG(HACACR) |= d ? ACR_DMARX20 : ACR_DMATX20;
- break;
- default:
- pr_debug("hac: invalid depth %d bit\n", params->msbits);
- return -EINVAL;
- break;
- }
-
- return 0;
-}
-
-#define AC97_RATES \
- SNDRV_PCM_RATE_8000_192000
-
-#define AC97_FMTS \
- SNDRV_PCM_FMTBIT_S16_LE
-
-static const struct snd_soc_dai_ops hac_dai_ops = {
- .hw_params = hac_hw_params,
-};
-
-static struct snd_soc_dai_driver sh4_hac_dai[] = {
-{
- .name = "hac-dai.0",
- .playback = {
- .rates = AC97_RATES,
- .formats = AC97_FMTS,
- .channels_min = 2,
- .channels_max = 2,
- },
- .capture = {
- .rates = AC97_RATES,
- .formats = AC97_FMTS,
- .channels_min = 2,
- .channels_max = 2,
- },
- .ops = &hac_dai_ops,
-},
-#ifdef CONFIG_CPU_SUBTYPE_SH7760
-{
- .name = "hac-dai.1",
- .id = 1,
- .playback = {
- .rates = AC97_RATES,
- .formats = AC97_FMTS,
- .channels_min = 2,
- .channels_max = 2,
- },
- .capture = {
- .rates = AC97_RATES,
- .formats = AC97_FMTS,
- .channels_min = 2,
- .channels_max = 2,
- },
- .ops = &hac_dai_ops,
-
-},
-#endif
-};
-
-static const struct snd_soc_component_driver sh4_hac_component = {
- .name = "sh4-hac",
- .legacy_dai_naming = 1,
-};
-
-static int hac_soc_platform_probe(struct platform_device *pdev)
-{
- int ret;
-
- ret = snd_soc_set_ac97_ops(&hac_ac97_ops);
- if (ret != 0)
- return ret;
-
- return devm_snd_soc_register_component(&pdev->dev, &sh4_hac_component,
- sh4_hac_dai, ARRAY_SIZE(sh4_hac_dai));
-}
-
-static int hac_soc_platform_remove(struct platform_device *pdev)
-{
- snd_soc_set_ac97_ops(NULL);
- return 0;
-}
-
-static struct platform_driver hac_pcm_driver = {
- .driver = {
- .name = "hac-pcm-audio",
- },
-
- .probe = hac_soc_platform_probe,
- .remove = hac_soc_platform_remove,
-};
-
-module_platform_driver(hac_pcm_driver);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("SuperH onchip HAC (AC97) audio driver");
-MODULE_AUTHOR("Manuel Lauss <[email protected]>");
diff --git a/sound/soc/sh/migor.c b/sound/soc/sh/migor.c
deleted file mode 100644
index 7082c12d3bf238..00000000000000
--- a/sound/soc/sh/migor.c
+++ /dev/null
@@ -1,205 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-//
-// ALSA SoC driver for Migo-R
-//
-// Copyright (C) 2009-2010 Guennadi Liakhovetski <[email protected]>
-
-#include <linux/clkdev.h>
-#include <linux/device.h>
-#include <linux/firmware.h>
-#include <linux/module.h>
-
-#include <asm/clock.h>
-
-#include <cpu/sh7722.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-
-#include "../codecs/wm8978.h"
-#include "siu.h"
-
-/* Default 8000Hz sampling frequency */
-static unsigned long codec_freq = 8000 * 512;
-
-static unsigned int use_count;
-
-/* External clock, sourced from the codec at the SIUMCKB pin */
-static unsigned long siumckb_recalc(struct clk *clk)
-{
- return codec_freq;
-}
-
-static struct sh_clk_ops siumckb_clk_ops = {
- .recalc = siumckb_recalc,
-};
-
-static struct clk siumckb_clk = {
- .ops = &siumckb_clk_ops,
- .rate = 0, /* initialised at run-time */
-};
-
-static struct clk_lookup *siumckb_lookup;
-
-static int migor_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
- int ret;
- unsigned int rate = params_rate(params);
-
- ret = snd_soc_dai_set_sysclk(codec_dai, WM8978_PLL, 13000000,
- SND_SOC_CLOCK_IN);
- if (ret < 0)
- return ret;
-
- ret = snd_soc_dai_set_clkdiv(codec_dai, WM8978_OPCLKRATE, rate * 512);
- if (ret < 0)
- return ret;
-
- codec_freq = rate * 512;
- /*
- * This propagates the parent frequency change to children and
- * recalculates the frequency table
- */
- clk_set_rate(&siumckb_clk, codec_freq);
- dev_dbg(codec_dai->dev, "%s: configure %luHz\n", __func__, codec_freq);
-
- ret = snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0), SIU_CLKB_EXT,
- codec_freq / 2, SND_SOC_CLOCK_IN);
-
- if (!ret)
- use_count++;
-
- return ret;
-}
-
-static int migor_hw_free(struct snd_pcm_substream *substream)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
-
- if (use_count) {
- use_count--;
-
- if (!use_count)
- snd_soc_dai_set_sysclk(codec_dai, WM8978_PLL, 0,
- SND_SOC_CLOCK_IN);
- } else {
- dev_dbg(codec_dai->dev, "Unbalanced hw_free!\n");
- }
-
- return 0;
-}
-
-static const struct snd_soc_ops migor_dai_ops = {
- .hw_params = migor_hw_params,
- .hw_free = migor_hw_free,
-};
-
-static const struct snd_soc_dapm_widget migor_dapm_widgets[] = {
- SND_SOC_DAPM_HP("Headphone", NULL),
- SND_SOC_DAPM_MIC("Onboard Microphone", NULL),
- SND_SOC_DAPM_MIC("External Microphone", NULL),
-};
-
-static const struct snd_soc_dapm_route audio_map[] = {
- /* Headphone output connected to LHP/RHP, enable OUT4 for VMID */
- { "Headphone", NULL, "OUT4 VMID" },
- { "OUT4 VMID", NULL, "LHP" },
- { "OUT4 VMID", NULL, "RHP" },
-
- /* On-board microphone */
- { "RMICN", NULL, "Mic Bias" },
- { "RMICP", NULL, "Mic Bias" },
- { "Mic Bias", NULL, "Onboard Microphone" },
-
- /* External microphone */
- { "LMICN", NULL, "Mic Bias" },
- { "LMICP", NULL, "Mic Bias" },
- { "Mic Bias", NULL, "External Microphone" },
-};
-
-/* migor digital audio interface glue - connects codec <--> CPU */
-SND_SOC_DAILINK_DEFS(wm8978,
- DAILINK_COMP_ARRAY(COMP_CPU("siu-pcm-audio")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm8978.0-001a", "wm8978-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("siu-pcm-audio")));
-
-static struct snd_soc_dai_link migor_dai = {
- .name = "wm8978",
- .stream_name = "WM8978",
- .dai_fmt = SND_SOC_DAIFMT_NB_IF | SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_CBS_CFS,
- .ops = &migor_dai_ops,
- SND_SOC_DAILINK_REG(wm8978),
-};
-
-/* migor audio machine driver */
-static struct snd_soc_card snd_soc_migor = {
- .name = "Migo-R",
- .owner = THIS_MODULE,
- .dai_link = &migor_dai,
- .num_links = 1,
-
- .dapm_widgets = migor_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(migor_dapm_widgets),
- .dapm_routes = audio_map,
- .num_dapm_routes = ARRAY_SIZE(audio_map),
-};
-
-static struct platform_device *migor_snd_device;
-
-static int __init migor_init(void)
-{
- int ret;
-
- ret = clk_register(&siumckb_clk);
- if (ret < 0)
- return ret;
-
- siumckb_lookup = clkdev_create(&siumckb_clk, "siumckb_clk", NULL);
- if (!siumckb_lookup) {
- ret = -ENOMEM;
- goto eclkdevalloc;
- }
-
- /* Port number used on this machine: port B */
- migor_snd_device = platform_device_alloc("soc-audio", 1);
- if (!migor_snd_device) {
- ret = -ENOMEM;
- goto epdevalloc;
- }
-
- platform_set_drvdata(migor_snd_device, &snd_soc_migor);
-
- ret = platform_device_add(migor_snd_device);
- if (ret)
- goto epdevadd;
-
- return 0;
-
-epdevadd:
- platform_device_put(migor_snd_device);
-epdevalloc:
- clkdev_drop(siumckb_lookup);
-eclkdevalloc:
- clk_unregister(&siumckb_clk);
- return ret;
-}
-
-static void __exit migor_exit(void)
-{
- clkdev_drop(siumckb_lookup);
- clk_unregister(&siumckb_clk);
- platform_device_unregister(migor_snd_device);
-}
-
-module_init(migor_init);
-module_exit(migor_exit);
-
-MODULE_AUTHOR("Guennadi Liakhovetski <[email protected]>");
-MODULE_DESCRIPTION("ALSA SoC Migor");
-MODULE_LICENSE("GPL v2");
diff --git a/sound/soc/sh/sh7760-ac97.c b/sound/soc/sh/sh7760-ac97.c
deleted file mode 100644
index d267243a159ba6..00000000000000
--- a/sound/soc/sh/sh7760-ac97.c
+++ /dev/null
@@ -1,72 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-//
-// Generic AC97 sound support for SH7760
-//
-// (c) 2007 Manuel Lauss
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/platform_device.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-#include <asm/io.h>
-
-#define IPSEL 0xFE400034
-
-SND_SOC_DAILINK_DEFS(ac97,
- DAILINK_COMP_ARRAY(COMP_CPU("hac-dai.0")), /* HAC0 */
- DAILINK_COMP_ARRAY(COMP_CODEC("ac97-codec", "ac97-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("sh7760-pcm-audio")));
-
-static struct snd_soc_dai_link sh7760_ac97_dai = {
- .name = "AC97",
- .stream_name = "AC97 HiFi",
- SND_SOC_DAILINK_REG(ac97),
-};
-
-static struct snd_soc_card sh7760_ac97_soc_machine = {
- .name = "SH7760 AC97",
- .owner = THIS_MODULE,
- .dai_link = &sh7760_ac97_dai,
- .num_links = 1,
-};
-
-static struct platform_device *sh7760_ac97_snd_device;
-
-static int __init sh7760_ac97_init(void)
-{
- int ret;
- unsigned short ipsel;
-
- /* enable both AC97 controllers in pinmux reg */
- ipsel = __raw_readw(IPSEL);
- __raw_writew(ipsel | (3 << 10), IPSEL);
-
- ret = -ENOMEM;
- sh7760_ac97_snd_device = platform_device_alloc("soc-audio", -1);
- if (!sh7760_ac97_snd_device)
- goto out;
-
- platform_set_drvdata(sh7760_ac97_snd_device,
- &sh7760_ac97_soc_machine);
- ret = platform_device_add(sh7760_ac97_snd_device);
-
- if (ret)
- platform_device_put(sh7760_ac97_snd_device);
-
-out:
- return ret;
-}
-
-static void __exit sh7760_ac97_exit(void)
-{
- platform_device_unregister(sh7760_ac97_snd_device);
-}
-
-module_init(sh7760_ac97_init);
-module_exit(sh7760_ac97_exit);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("Generic SH7760 AC97 sound machine");
-MODULE_AUTHOR("Manuel Lauss <[email protected]>");
diff --git a/sound/soc/sh/siu.h b/sound/soc/sh/siu.h
deleted file mode 100644
index a675c36fc9d956..00000000000000
--- a/sound/soc/sh/siu.h
+++ /dev/null
@@ -1,180 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-//
-// siu.h - ALSA SoC driver for Renesas SH7343, SH7722 SIU peripheral.
-//
-// Copyright (C) 2009-2010 Guennadi Liakhovetski <[email protected]>
-// Copyright (C) 2006 Carlos Munoz <[email protected]>
-
-#ifndef SIU_H
-#define SIU_H
-
-/* Common kernel and user-space firmware-building defines and types */
-
-#define YRAM0_SIZE (0x0040 / 4) /* 16 */
-#define YRAM1_SIZE (0x0080 / 4) /* 32 */
-#define YRAM2_SIZE (0x0040 / 4) /* 16 */
-#define YRAM3_SIZE (0x0080 / 4) /* 32 */
-#define YRAM4_SIZE (0x0080 / 4) /* 32 */
-#define YRAM_DEF_SIZE (YRAM0_SIZE + YRAM1_SIZE + YRAM2_SIZE + \
- YRAM3_SIZE + YRAM4_SIZE)
-#define YRAM_FIR_SIZE (0x0400 / 4) /* 256 */
-#define YRAM_IIR_SIZE (0x0200 / 4) /* 128 */
-
-#define XRAM0_SIZE (0x0400 / 4) /* 256 */
-#define XRAM1_SIZE (0x0200 / 4) /* 128 */
-#define XRAM2_SIZE (0x0200 / 4) /* 128 */
-
-/* PRAM program array size */
-#define PRAM0_SIZE (0x0100 / 4) /* 64 */
-#define PRAM1_SIZE ((0x2000 - 0x0100) / 4) /* 1984 */
-
-#include <linux/types.h>
-
-struct siu_spb_param {
- __u32 ab1a; /* input FIFO address */
- __u32 ab0a; /* output FIFO address */
- __u32 dir; /* 0=the ather except CPUOUTPUT, 1=CPUINPUT */
- __u32 event; /* SPB program starting conditions */
- __u32 stfifo; /* STFIFO register setting value */
- __u32 trdat; /* TRDAT register setting value */
-};
-
-struct siu_firmware {
- __u32 yram_fir_coeff[YRAM_FIR_SIZE];
- __u32 pram0[PRAM0_SIZE];
- __u32 pram1[PRAM1_SIZE];
- __u32 yram0[YRAM0_SIZE];
- __u32 yram1[YRAM1_SIZE];
- __u32 yram2[YRAM2_SIZE];
- __u32 yram3[YRAM3_SIZE];
- __u32 yram4[YRAM4_SIZE];
- __u32 spbpar_num;
- struct siu_spb_param spbpar[32];
-};
-
-#ifdef __KERNEL__
-
-#include <linux/dmaengine.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <linux/sh_dma.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-
-#define SIU_PERIOD_BYTES_MAX 8192 /* DMA transfer/period size */
-#define SIU_PERIOD_BYTES_MIN 256 /* DMA transfer/period size */
-#define SIU_PERIODS_MAX 64 /* Max periods in buffer */
-#define SIU_PERIODS_MIN 4 /* Min periods in buffer */
-#define SIU_BUFFER_BYTES_MAX (SIU_PERIOD_BYTES_MAX * SIU_PERIODS_MAX)
-
-/* SIU ports: only one can be used at a time */
-enum {
- SIU_PORT_A,
- SIU_PORT_B,
- SIU_PORT_NUM,
-};
-
-/* SIU clock configuration */
-enum {
- SIU_CLKA_PLL,
- SIU_CLKA_EXT,
- SIU_CLKB_PLL,
- SIU_CLKB_EXT
-};
-
-struct device;
-struct siu_info {
- struct device *dev;
- int port_id;
- u32 __iomem *pram;
- u32 __iomem *xram;
- u32 __iomem *yram;
- u32 __iomem *reg;
- struct siu_firmware fw;
-};
-
-struct siu_stream {
- struct work_struct work;
- struct snd_pcm_substream *substream;
- snd_pcm_format_t format;
- size_t buf_bytes;
- size_t period_bytes;
- int cur_period; /* Period currently in dma */
- u32 volume;
- snd_pcm_sframes_t xfer_cnt; /* Number of frames */
- u8 rw_flg; /* transfer status */
- /* DMA status */
- struct dma_chan *chan; /* DMA channel */
- struct dma_async_tx_descriptor *tx_desc;
- dma_cookie_t cookie;
- struct sh_dmae_slave param;
-};
-
-struct siu_port {
- unsigned long play_cap; /* Used to track full duplex */
- struct snd_pcm *pcm;
- struct siu_stream playback;
- struct siu_stream capture;
- u32 stfifo; /* STFIFO value from firmware */
- u32 trdat; /* TRDAT value from firmware */
-};
-
-extern struct siu_port *siu_ports[SIU_PORT_NUM];
-
-static inline struct siu_port *siu_port_info(struct snd_pcm_substream *substream)
-{
- struct platform_device *pdev =
- to_platform_device(substream->pcm->card->dev);
- return siu_ports[pdev->id];
-}
-
-/* Register access */
-static inline void siu_write32(u32 __iomem *addr, u32 val)
-{
- __raw_writel(val, addr);
-}
-
-static inline u32 siu_read32(u32 __iomem *addr)
-{
- return __raw_readl(addr);
-}
-
-/* SIU registers */
-#define SIU_IFCTL (0x000 / sizeof(u32))
-#define SIU_SRCTL (0x004 / sizeof(u32))
-#define SIU_SFORM (0x008 / sizeof(u32))
-#define SIU_CKCTL (0x00c / sizeof(u32))
-#define SIU_TRDAT (0x010 / sizeof(u32))
-#define SIU_STFIFO (0x014 / sizeof(u32))
-#define SIU_DPAK (0x01c / sizeof(u32))
-#define SIU_CKREV (0x020 / sizeof(u32))
-#define SIU_EVNTC (0x028 / sizeof(u32))
-#define SIU_SBCTL (0x040 / sizeof(u32))
-#define SIU_SBPSET (0x044 / sizeof(u32))
-#define SIU_SBFSTS (0x068 / sizeof(u32))
-#define SIU_SBDVCA (0x06c / sizeof(u32))
-#define SIU_SBDVCB (0x070 / sizeof(u32))
-#define SIU_SBACTIV (0x074 / sizeof(u32))
-#define SIU_DMAIA (0x090 / sizeof(u32))
-#define SIU_DMAIB (0x094 / sizeof(u32))
-#define SIU_DMAOA (0x098 / sizeof(u32))
-#define SIU_DMAOB (0x09c / sizeof(u32))
-#define SIU_DMAML (0x0a0 / sizeof(u32))
-#define SIU_SPSTS (0x0cc / sizeof(u32))
-#define SIU_SPCTL (0x0d0 / sizeof(u32))
-#define SIU_BRGASEL (0x100 / sizeof(u32))
-#define SIU_BRRA (0x104 / sizeof(u32))
-#define SIU_BRGBSEL (0x108 / sizeof(u32))
-#define SIU_BRRB (0x10c / sizeof(u32))
-
-extern const struct snd_soc_component_driver siu_component;
-extern struct siu_info *siu_i2s_data;
-
-int siu_init_port(int port, struct siu_port **port_info, struct snd_card *card);
-void siu_free_port(struct siu_port *port_info);
-
-#endif
-
-#endif /* SIU_H */
diff --git a/sound/soc/sh/siu_dai.c b/sound/soc/sh/siu_dai.c
deleted file mode 100644
index f2a386fcd92e4d..00000000000000
--- a/sound/soc/sh/siu_dai.c
+++ /dev/null
@@ -1,799 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-//
-// siu_dai.c - ALSA SoC driver for Renesas SH7343, SH7722 SIU peripheral.
-//
-// Copyright (C) 2009-2010 Guennadi Liakhovetski <[email protected]>
-// Copyright (C) 2006 Carlos Munoz <[email protected]>
-
-#include <linux/delay.h>
-#include <linux/firmware.h>
-#include <linux/pm_runtime.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-
-#include <asm/clock.h>
-#include <asm/siu.h>
-
-#include <sound/control.h>
-#include <sound/soc.h>
-
-#include "siu.h"
-
-/* Board specifics */
-#if defined(CONFIG_CPU_SUBTYPE_SH7722)
-# define SIU_MAX_VOLUME 0x1000
-#else
-# define SIU_MAX_VOLUME 0x7fff
-#endif
-
-#define PRAM_SIZE 0x2000
-#define XRAM_SIZE 0x800
-#define YRAM_SIZE 0x800
-
-#define XRAM_OFFSET 0x4000
-#define YRAM_OFFSET 0x6000
-#define REG_OFFSET 0xc000
-
-#define PLAYBACK_ENABLED 1
-#define CAPTURE_ENABLED 2
-
-#define VOLUME_CAPTURE 0
-#define VOLUME_PLAYBACK 1
-#define DFLT_VOLUME_LEVEL 0x08000800
-
-/*
- * SPDIF is only available on port A and on some SIU implementations it is only
- * available for input. Due to the lack of hardware to test it, SPDIF is left
- * disabled in this driver version
- */
-struct format_flag {
- u32 i2s;
- u32 pcm;
- u32 spdif;
- u32 mask;
-};
-
-struct port_flag {
- struct format_flag playback;
- struct format_flag capture;
-};
-
-struct siu_info *siu_i2s_data;
-
-static struct port_flag siu_flags[SIU_PORT_NUM] = {
- [SIU_PORT_A] = {
- .playback = {
- .i2s = 0x50000000,
- .pcm = 0x40000000,
- .spdif = 0x80000000, /* not on all SIU versions */
- .mask = 0xd0000000,
- },
- .capture = {
- .i2s = 0x05000000,
- .pcm = 0x04000000,
- .spdif = 0x08000000,
- .mask = 0x0d000000,
- },
- },
- [SIU_PORT_B] = {
- .playback = {
- .i2s = 0x00500000,
- .pcm = 0x00400000,
- .spdif = 0, /* impossible - turn off */
- .mask = 0x00500000,
- },
- .capture = {
- .i2s = 0x00050000,
- .pcm = 0x00040000,
- .spdif = 0, /* impossible - turn off */
- .mask = 0x00050000,
- },
- },
-};
-
-static void siu_dai_start(struct siu_port *port_info)
-{
- struct siu_info *info = siu_i2s_data;
- u32 __iomem *base = info->reg;
-
- dev_dbg(port_info->pcm->card->dev, "%s\n", __func__);
-
- /* Issue software reset to siu */
- siu_write32(base + SIU_SRCTL, 0);
-
- /* Wait for the reset to take effect */
- udelay(1);
-
- port_info->stfifo = 0;
- port_info->trdat = 0;
-
- /* portA, portB, SIU operate */
- siu_write32(base + SIU_SRCTL, 0x301);
-
- /* portA=256fs, portB=256fs */
- siu_write32(base + SIU_CKCTL, 0x40400000);
-
- /* portA's BRG does not divide SIUCKA */
- siu_write32(base + SIU_BRGASEL, 0);
- siu_write32(base + SIU_BRRA, 0);
-
- /* portB's BRG divides SIUCKB by half */
- siu_write32(base + SIU_BRGBSEL, 1);
- siu_write32(base + SIU_BRRB, 0);
-
- siu_write32(base + SIU_IFCTL, 0x44440000);
-
- /* portA: 32 bit/fs, master; portB: 32 bit/fs, master */
- siu_write32(base + SIU_SFORM, 0x0c0c0000);
-
- /*
- * Volume levels: looks like the DSP firmware implements volume controls
- * differently from what's described in the datasheet
- */
- siu_write32(base + SIU_SBDVCA, port_info->playback.volume);
- siu_write32(base + SIU_SBDVCB, port_info->capture.volume);
-}
-
-static void siu_dai_stop(struct siu_port *port_info)
-{
- struct siu_info *info = siu_i2s_data;
- u32 __iomem *base = info->reg;
-
- /* SIU software reset */
- siu_write32(base + SIU_SRCTL, 0);
-}
-
-static void siu_dai_spbAselect(struct siu_port *port_info)
-{
- struct siu_info *info = siu_i2s_data;
- struct siu_firmware *fw = &info->fw;
- u32 *ydef = fw->yram0;
- u32 idx;
-
- /* path A use */
- if (!info->port_id)
- idx = 1; /* portA */
- else
- idx = 2; /* portB */
-
- ydef[0] = (fw->spbpar[idx].ab1a << 16) |
- (fw->spbpar[idx].ab0a << 8) |
- (fw->spbpar[idx].dir << 7) | 3;
- ydef[1] = fw->yram0[1]; /* 0x03000300 */
- ydef[2] = (16 / 2) << 24;
- ydef[3] = fw->yram0[3]; /* 0 */
- ydef[4] = fw->yram0[4]; /* 0 */
- ydef[7] = fw->spbpar[idx].event;
- port_info->stfifo |= fw->spbpar[idx].stfifo;
- port_info->trdat |= fw->spbpar[idx].trdat;
-}
-
-static void siu_dai_spbBselect(struct siu_port *port_info)
-{
- struct siu_info *info = siu_i2s_data;
- struct siu_firmware *fw = &info->fw;
- u32 *ydef = fw->yram0;
- u32 idx;
-
- /* path B use */
- if (!info->port_id)
- idx = 7; /* portA */
- else
- idx = 8; /* portB */
-
- ydef[5] = (fw->spbpar[idx].ab1a << 16) |
- (fw->spbpar[idx].ab0a << 8) | 1;
- ydef[6] = fw->spbpar[idx].event;
- port_info->stfifo |= fw->spbpar[idx].stfifo;
- port_info->trdat |= fw->spbpar[idx].trdat;
-}
-
-static void siu_dai_open(struct siu_stream *siu_stream)
-{
- struct siu_info *info = siu_i2s_data;
- u32 __iomem *base = info->reg;
- u32 srctl, ifctl;
-
- srctl = siu_read32(base + SIU_SRCTL);
- ifctl = siu_read32(base + SIU_IFCTL);
-
- switch (info->port_id) {
- case SIU_PORT_A:
- /* portA operates */
- srctl |= 0x200;
- ifctl &= ~0xc2;
- break;
- case SIU_PORT_B:
- /* portB operates */
- srctl |= 0x100;
- ifctl &= ~0x31;
- break;
- }
-
- siu_write32(base + SIU_SRCTL, srctl);
- /* Unmute and configure portA */
- siu_write32(base + SIU_IFCTL, ifctl);
-}
-
-/*
- * At the moment only fixed Left-upper, Left-lower, Right-upper, Right-lower
- * packing is supported
- */
-static void siu_dai_pcmdatapack(struct siu_stream *siu_stream)
-{
- struct siu_info *info = siu_i2s_data;
- u32 __iomem *base = info->reg;
- u32 dpak;
-
- dpak = siu_read32(base + SIU_DPAK);
-
- switch (info->port_id) {
- case SIU_PORT_A:
- dpak &= ~0xc0000000;
- break;
- case SIU_PORT_B:
- dpak &= ~0x00c00000;
- break;
- }
-
- siu_write32(base + SIU_DPAK, dpak);
-}
-
-static int siu_dai_spbstart(struct siu_port *port_info)
-{
- struct siu_info *info = siu_i2s_data;
- u32 __iomem *base = info->reg;
- struct siu_firmware *fw = &info->fw;
- u32 *ydef = fw->yram0;
- int cnt;
- u32 __iomem *add;
- u32 *ptr;
-
- /* Load SPB Program in PRAM */
- ptr = fw->pram0;
- add = info->pram;
- for (cnt = 0; cnt < PRAM0_SIZE; cnt++, add++, ptr++)
- siu_write32(add, *ptr);
-
- ptr = fw->pram1;
- add = info->pram + (0x0100 / sizeof(u32));
- for (cnt = 0; cnt < PRAM1_SIZE; cnt++, add++, ptr++)
- siu_write32(add, *ptr);
-
- /* XRAM initialization */
- add = info->xram;
- for (cnt = 0; cnt < XRAM0_SIZE + XRAM1_SIZE + XRAM2_SIZE; cnt++, add++)
- siu_write32(add, 0);
-
- /* YRAM variable area initialization */
- add = info->yram;
- for (cnt = 0; cnt < YRAM_DEF_SIZE; cnt++, add++)
- siu_write32(add, ydef[cnt]);
-
- /* YRAM FIR coefficient area initialization */
- add = info->yram + (0x0200 / sizeof(u32));
- for (cnt = 0; cnt < YRAM_FIR_SIZE; cnt++, add++)
- siu_write32(add, fw->yram_fir_coeff[cnt]);
-
- /* YRAM IIR coefficient area initialization */
- add = info->yram + (0x0600 / sizeof(u32));
- for (cnt = 0; cnt < YRAM_IIR_SIZE; cnt++, add++)
- siu_write32(add, 0);
-
- siu_write32(base + SIU_TRDAT, port_info->trdat);
- port_info->trdat = 0x0;
-
-
- /* SPB start condition: software */
- siu_write32(base + SIU_SBACTIV, 0);
- /* Start SPB */
- siu_write32(base + SIU_SBCTL, 0xc0000000);
- /* Wait for program to halt */
- cnt = 0x10000;
- while (--cnt && siu_read32(base + SIU_SBCTL) != 0x80000000)
- cpu_relax();
-
- if (!cnt)
- return -EBUSY;
-
- /* SPB program start address setting */
- siu_write32(base + SIU_SBPSET, 0x00400000);
- /* SPB hardware start(FIFOCTL source) */
- siu_write32(base + SIU_SBACTIV, 0xc0000000);
-
- return 0;
-}
-
-static void siu_dai_spbstop(struct siu_port *port_info)
-{
- struct siu_info *info = siu_i2s_data;
- u32 __iomem *base = info->reg;
-
- siu_write32(base + SIU_SBACTIV, 0);
- /* SPB stop */
- siu_write32(base + SIU_SBCTL, 0);
-
- port_info->stfifo = 0;
-}
-
-/* API functions */
-
-/* Playback and capture hardware properties are identical */
-static const struct snd_pcm_hardware siu_dai_pcm_hw = {
- .info = SNDRV_PCM_INFO_INTERLEAVED,
- .formats = SNDRV_PCM_FMTBIT_S16,
- .rates = SNDRV_PCM_RATE_8000_48000,
- .rate_min = 8000,
- .rate_max = 48000,
- .channels_min = 2,
- .channels_max = 2,
- .buffer_bytes_max = SIU_BUFFER_BYTES_MAX,
- .period_bytes_min = SIU_PERIOD_BYTES_MIN,
- .period_bytes_max = SIU_PERIOD_BYTES_MAX,
- .periods_min = SIU_PERIODS_MIN,
- .periods_max = SIU_PERIODS_MAX,
-};
-
-static int siu_dai_info_volume(struct snd_kcontrol *kctrl,
- struct snd_ctl_elem_info *uinfo)
-{
- struct siu_port *port_info = snd_kcontrol_chip(kctrl);
-
- dev_dbg(port_info->pcm->card->dev, "%s\n", __func__);
-
- uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
- uinfo->count = 2;
- uinfo->value.integer.min = 0;
- uinfo->value.integer.max = SIU_MAX_VOLUME;
-
- return 0;
-}
-
-static int siu_dai_get_volume(struct snd_kcontrol *kctrl,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct siu_port *port_info = snd_kcontrol_chip(kctrl);
- struct device *dev = port_info->pcm->card->dev;
- u32 vol;
-
- dev_dbg(dev, "%s\n", __func__);
-
- switch (kctrl->private_value) {
- case VOLUME_PLAYBACK:
- /* Playback is always on port 0 */
- vol = port_info->playback.volume;
- ucontrol->value.integer.value[0] = vol & 0xffff;
- ucontrol->value.integer.value[1] = vol >> 16 & 0xffff;
- break;
- case VOLUME_CAPTURE:
- /* Capture is always on port 1 */
- vol = port_info->capture.volume;
- ucontrol->value.integer.value[0] = vol & 0xffff;
- ucontrol->value.integer.value[1] = vol >> 16 & 0xffff;
- break;
- default:
- dev_err(dev, "%s() invalid private_value=%ld\n",
- __func__, kctrl->private_value);
- return -EINVAL;
- }
-
- return 0;
-}
-
-static int siu_dai_put_volume(struct snd_kcontrol *kctrl,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct siu_port *port_info = snd_kcontrol_chip(kctrl);
- struct device *dev = port_info->pcm->card->dev;
- struct siu_info *info = siu_i2s_data;
- u32 __iomem *base = info->reg;
- u32 new_vol;
- u32 cur_vol;
-
- dev_dbg(dev, "%s\n", __func__);
-
- if (ucontrol->value.integer.value[0] < 0 ||
- ucontrol->value.integer.value[0] > SIU_MAX_VOLUME ||
- ucontrol->value.integer.value[1] < 0 ||
- ucontrol->value.integer.value[1] > SIU_MAX_VOLUME)
- return -EINVAL;
-
- new_vol = ucontrol->value.integer.value[0] |
- ucontrol->value.integer.value[1] << 16;
-
- /* See comment above - DSP firmware implementation */
- switch (kctrl->private_value) {
- case VOLUME_PLAYBACK:
- /* Playback is always on port 0 */
- cur_vol = port_info->playback.volume;
- siu_write32(base + SIU_SBDVCA, new_vol);
- port_info->playback.volume = new_vol;
- break;
- case VOLUME_CAPTURE:
- /* Capture is always on port 1 */
- cur_vol = port_info->capture.volume;
- siu_write32(base + SIU_SBDVCB, new_vol);
- port_info->capture.volume = new_vol;
- break;
- default:
- dev_err(dev, "%s() invalid private_value=%ld\n",
- __func__, kctrl->private_value);
- return -EINVAL;
- }
-
- if (cur_vol != new_vol)
- return 1;
-
- return 0;
-}
-
-static const struct snd_kcontrol_new playback_controls = {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "PCM Playback Volume",
- .index = 0,
- .info = siu_dai_info_volume,
- .get = siu_dai_get_volume,
- .put = siu_dai_put_volume,
- .private_value = VOLUME_PLAYBACK,
-};
-
-static const struct snd_kcontrol_new capture_controls = {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "PCM Capture Volume",
- .index = 0,
- .info = siu_dai_info_volume,
- .get = siu_dai_get_volume,
- .put = siu_dai_put_volume,
- .private_value = VOLUME_CAPTURE,
-};
-
-int siu_init_port(int port, struct siu_port **port_info, struct snd_card *card)
-{
- struct device *dev = card->dev;
- struct snd_kcontrol *kctrl;
- int ret;
-
- *port_info = kzalloc(sizeof(**port_info), GFP_KERNEL);
- if (!*port_info)
- return -ENOMEM;
-
- dev_dbg(dev, "%s: port #%[email protected]%p\n", __func__, port, *port_info);
-
- (*port_info)->playback.volume = DFLT_VOLUME_LEVEL;
- (*port_info)->capture.volume = DFLT_VOLUME_LEVEL;
-
- /*
- * Add mixer support. The SPB is used to change the volume. Both
- * ports use the same SPB. Therefore, we only register one
- * control instance since it will be used by both channels.
- * In error case we continue without controls.
- */
- kctrl = snd_ctl_new1(&playback_controls, *port_info);
- ret = snd_ctl_add(card, kctrl);
- if (ret < 0)
- dev_err(dev,
- "failed to add playback controls %p port=%d err=%d\n",
- kctrl, port, ret);
-
- kctrl = snd_ctl_new1(&capture_controls, *port_info);
- ret = snd_ctl_add(card, kctrl);
- if (ret < 0)
- dev_err(dev,
- "failed to add capture controls %p port=%d err=%d\n",
- kctrl, port, ret);
-
- return 0;
-}
-
-void siu_free_port(struct siu_port *port_info)
-{
- kfree(port_info);
-}
-
-static int siu_dai_startup(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
-{
- struct siu_info *info = snd_soc_dai_get_drvdata(dai);
- struct snd_pcm_runtime *rt = substream->runtime;
- struct siu_port *port_info = siu_port_info(substream);
- int ret;
-
- dev_dbg(substream->pcm->card->dev, "%s: port=%[email protected]%p\n", __func__,
- info->port_id, port_info);
-
- snd_soc_set_runtime_hwparams(substream, &siu_dai_pcm_hw);
-
- ret = snd_pcm_hw_constraint_integer(rt, SNDRV_PCM_HW_PARAM_PERIODS);
- if (unlikely(ret < 0))
- return ret;
-
- siu_dai_start(port_info);
-
- return 0;
-}
-
-static void siu_dai_shutdown(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
-{
- struct siu_info *info = snd_soc_dai_get_drvdata(dai);
- struct siu_port *port_info = siu_port_info(substream);
-
- dev_dbg(substream->pcm->card->dev, "%s: port=%[email protected]%p\n", __func__,
- info->port_id, port_info);
-
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- port_info->play_cap &= ~PLAYBACK_ENABLED;
- else
- port_info->play_cap &= ~CAPTURE_ENABLED;
-
- /* Stop the siu if the other stream is not using it */
- if (!port_info->play_cap) {
- /* during stmread or stmwrite ? */
- if (WARN_ON(port_info->playback.rw_flg || port_info->capture.rw_flg))
- return;
- siu_dai_spbstop(port_info);
- siu_dai_stop(port_info);
- }
-}
-
-/* PCM part of siu_dai_playback_prepare() / siu_dai_capture_prepare() */
-static int siu_dai_prepare(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
-{
- struct siu_info *info = snd_soc_dai_get_drvdata(dai);
- struct snd_pcm_runtime *rt = substream->runtime;
- struct siu_port *port_info = siu_port_info(substream);
- struct siu_stream *siu_stream;
- int self, ret;
-
- dev_dbg(substream->pcm->card->dev,
- "%s: port %d, active streams %lx, %d channels\n",
- __func__, info->port_id, port_info->play_cap, rt->channels);
-
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- self = PLAYBACK_ENABLED;
- siu_stream = &port_info->playback;
- } else {
- self = CAPTURE_ENABLED;
- siu_stream = &port_info->capture;
- }
-
- /* Set up the siu if not already done */
- if (!port_info->play_cap) {
- siu_stream->rw_flg = 0; /* stream-data transfer flag */
-
- siu_dai_spbAselect(port_info);
- siu_dai_spbBselect(port_info);
-
- siu_dai_open(siu_stream);
-
- siu_dai_pcmdatapack(siu_stream);
-
- ret = siu_dai_spbstart(port_info);
- if (ret < 0)
- goto fail;
- } else {
- ret = 0;
- }
-
- port_info->play_cap |= self;
-
-fail:
- return ret;
-}
-
-/*
- * SIU can set bus format to I2S / PCM / SPDIF independently for playback and
- * capture, however, the current API sets the bus format globally for a DAI.
- */
-static int siu_dai_set_fmt(struct snd_soc_dai *dai,
- unsigned int fmt)
-{
- struct siu_info *info = snd_soc_dai_get_drvdata(dai);
- u32 __iomem *base = info->reg;
- u32 ifctl;
-
- dev_dbg(dai->dev, "%s: fmt 0x%x on port %d\n",
- __func__, fmt, info->port_id);
-
- if (info->port_id < 0)
- return -ENODEV;
-
- /* Here select between I2S / PCM / SPDIF */
- switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
- case SND_SOC_DAIFMT_I2S:
- ifctl = siu_flags[info->port_id].playback.i2s |
- siu_flags[info->port_id].capture.i2s;
- break;
- case SND_SOC_DAIFMT_LEFT_J:
- ifctl = siu_flags[info->port_id].playback.pcm |
- siu_flags[info->port_id].capture.pcm;
- break;
- /* SPDIF disabled - see comment at the top */
- default:
- return -EINVAL;
- }
-
- ifctl |= ~(siu_flags[info->port_id].playback.mask |
- siu_flags[info->port_id].capture.mask) &
- siu_read32(base + SIU_IFCTL);
- siu_write32(base + SIU_IFCTL, ifctl);
-
- return 0;
-}
-
-static int siu_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
- unsigned int freq, int dir)
-{
- struct clk *siu_clk, *parent_clk;
- char *siu_name, *parent_name;
- int ret;
-
- if (dir != SND_SOC_CLOCK_IN)
- return -EINVAL;
-
- dev_dbg(dai->dev, "%s: using clock %d\n", __func__, clk_id);
-
- switch (clk_id) {
- case SIU_CLKA_PLL:
- siu_name = "siua_clk";
- parent_name = "pll_clk";
- break;
- case SIU_CLKA_EXT:
- siu_name = "siua_clk";
- parent_name = "siumcka_clk";
- break;
- case SIU_CLKB_PLL:
- siu_name = "siub_clk";
- parent_name = "pll_clk";
- break;
- case SIU_CLKB_EXT:
- siu_name = "siub_clk";
- parent_name = "siumckb_clk";
- break;
- default:
- return -EINVAL;
- }
-
- siu_clk = clk_get(dai->dev, siu_name);
- if (IS_ERR(siu_clk)) {
- dev_err(dai->dev, "%s: cannot get a SIU clock: %ld\n", __func__,
- PTR_ERR(siu_clk));
- return PTR_ERR(siu_clk);
- }
-
- parent_clk = clk_get(dai->dev, parent_name);
- if (IS_ERR(parent_clk)) {
- ret = PTR_ERR(parent_clk);
- dev_err(dai->dev, "cannot get a SIU clock parent: %d\n", ret);
- goto epclkget;
- }
-
- ret = clk_set_parent(siu_clk, parent_clk);
- if (ret < 0) {
- dev_err(dai->dev, "cannot reparent the SIU clock: %d\n", ret);
- goto eclksetp;
- }
-
- ret = clk_set_rate(siu_clk, freq);
- if (ret < 0)
- dev_err(dai->dev, "cannot set SIU clock rate: %d\n", ret);
-
- /* TODO: when clkdev gets reference counting we'll move these to siu_dai_shutdown() */
-eclksetp:
- clk_put(parent_clk);
-epclkget:
- clk_put(siu_clk);
-
- return ret;
-}
-
-static const struct snd_soc_dai_ops siu_dai_ops = {
- .startup = siu_dai_startup,
- .shutdown = siu_dai_shutdown,
- .prepare = siu_dai_prepare,
- .set_sysclk = siu_dai_set_sysclk,
- .set_fmt = siu_dai_set_fmt,
-};
-
-static struct snd_soc_dai_driver siu_i2s_dai = {
- .name = "siu-i2s-dai",
- .playback = {
- .channels_min = 2,
- .channels_max = 2,
- .formats = SNDRV_PCM_FMTBIT_S16,
- .rates = SNDRV_PCM_RATE_8000_48000,
- },
- .capture = {
- .channels_min = 2,
- .channels_max = 2,
- .formats = SNDRV_PCM_FMTBIT_S16,
- .rates = SNDRV_PCM_RATE_8000_48000,
- },
- .ops = &siu_dai_ops,
-};
-
-static int siu_probe(struct platform_device *pdev)
-{
- const struct firmware *fw_entry;
- struct resource *res, *region;
- struct siu_info *info;
- int ret;
-
- info = devm_kmalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
- if (!info)
- return -ENOMEM;
- siu_i2s_data = info;
- info->dev = &pdev->dev;
-
- ret = request_firmware(&fw_entry, "siu_spb.bin", &pdev->dev);
- if (ret)
- return ret;
-
- /*
- * Loaded firmware is "const" - read only, but we have to modify it in
- * snd_siu_sh7343_spbAselect() and snd_siu_sh7343_spbBselect()
- */
- memcpy(&info->fw, fw_entry->data, fw_entry->size);
-
- release_firmware(fw_entry);
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -ENODEV;
-
- region = devm_request_mem_region(&pdev->dev, res->start,
- resource_size(res), pdev->name);
- if (!region) {
- dev_err(&pdev->dev, "SIU region already claimed\n");
- return -EBUSY;
- }
-
- info->pram = devm_ioremap(&pdev->dev, res->start, PRAM_SIZE);
- if (!info->pram)
- return -ENOMEM;
- info->xram = devm_ioremap(&pdev->dev, res->start + XRAM_OFFSET,
- XRAM_SIZE);
- if (!info->xram)
- return -ENOMEM;
- info->yram = devm_ioremap(&pdev->dev, res->start + YRAM_OFFSET,
- YRAM_SIZE);
- if (!info->yram)
- return -ENOMEM;
- info->reg = devm_ioremap(&pdev->dev, res->start + REG_OFFSET,
- resource_size(res) - REG_OFFSET);
- if (!info->reg)
- return -ENOMEM;
-
- dev_set_drvdata(&pdev->dev, info);
-
- /* register using ARRAY version so we can keep dai name */
- ret = devm_snd_soc_register_component(&pdev->dev, &siu_component,
- &siu_i2s_dai, 1);
- if (ret < 0)
- return ret;
-
- pm_runtime_enable(&pdev->dev);
-
- return 0;
-}
-
-static int siu_remove(struct platform_device *pdev)
-{
- pm_runtime_disable(&pdev->dev);
- return 0;
-}
-
-static struct platform_driver siu_driver = {
- .driver = {
- .name = "siu-pcm-audio",
- },
- .probe = siu_probe,
- .remove = siu_remove,
-};
-
-module_platform_driver(siu_driver);
-
-MODULE_AUTHOR("Carlos Munoz <[email protected]>");
-MODULE_DESCRIPTION("ALSA SoC SH7722 SIU driver");
-MODULE_LICENSE("GPL");
diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c
deleted file mode 100644
index f15ff36e793455..00000000000000
--- a/sound/soc/sh/siu_pcm.c
+++ /dev/null
@@ -1,553 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-//
-// siu_pcm.c - ALSA driver for Renesas SH7343, SH7722 SIU peripheral.
-//
-// Copyright (C) 2009-2010 Guennadi Liakhovetski <[email protected]>
-// Copyright (C) 2006 Carlos Munoz <[email protected]>
-
-#include <linux/delay.h>
-#include <linux/dma-mapping.h>
-#include <linux/dmaengine.h>
-#include <linux/interrupt.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-
-#include <sound/control.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/soc.h>
-
-#include <asm/siu.h>
-
-#include "siu.h"
-
-#define DRV_NAME "siu-i2s"
-#define GET_MAX_PERIODS(buf_bytes, period_bytes) \
- ((buf_bytes) / (period_bytes))
-#define PERIOD_OFFSET(buf_addr, period_num, period_bytes) \
- ((buf_addr) + ((period_num) * (period_bytes)))
-
-#define RWF_STM_RD 0x01 /* Read in progress */
-#define RWF_STM_WT 0x02 /* Write in progress */
-
-struct siu_port *siu_ports[SIU_PORT_NUM];
-
-/* transfersize is number of u32 dma transfers per period */
-static int siu_pcm_stmwrite_stop(struct siu_port *port_info)
-{
- struct siu_info *info = siu_i2s_data;
- u32 __iomem *base = info->reg;
- struct siu_stream *siu_stream = &port_info->playback;
- u32 stfifo;
-
- if (!siu_stream->rw_flg)
- return -EPERM;
-
- /* output FIFO disable */
- stfifo = siu_read32(base + SIU_STFIFO);
- siu_write32(base + SIU_STFIFO, stfifo & ~0x0c180c18);
- pr_debug("%s: STFIFO %x -> %x\n", __func__,
- stfifo, stfifo & ~0x0c180c18);
-
- /* during stmwrite clear */
- siu_stream->rw_flg = 0;
-
- return 0;
-}
-
-static int siu_pcm_stmwrite_start(struct siu_port *port_info)
-{
- struct siu_stream *siu_stream = &port_info->playback;
-
- if (siu_stream->rw_flg)
- return -EPERM;
-
- /* Current period in buffer */
- port_info->playback.cur_period = 0;
-
- /* during stmwrite flag set */
- siu_stream->rw_flg = RWF_STM_WT;
-
- /* DMA transfer start */
- queue_work(system_highpri_wq, &siu_stream->work);
-
- return 0;
-}
-
-static void siu_dma_tx_complete(void *arg)
-{
- struct siu_stream *siu_stream = arg;
-
- if (!siu_stream->rw_flg)
- return;
-
- /* Update completed period count */
- if (++siu_stream->cur_period >=
- GET_MAX_PERIODS(siu_stream->buf_bytes,
- siu_stream->period_bytes))
- siu_stream->cur_period = 0;
-
- pr_debug("%s: done period #%d (%u/%u bytes), cookie %d\n",
- __func__, siu_stream->cur_period,
- siu_stream->cur_period * siu_stream->period_bytes,
- siu_stream->buf_bytes, siu_stream->cookie);
-
- queue_work(system_highpri_wq, &siu_stream->work);
-
- /* Notify alsa: a period is done */
- snd_pcm_period_elapsed(siu_stream->substream);
-}
-
-static int siu_pcm_wr_set(struct siu_port *port_info,
- dma_addr_t buff, u32 size)
-{
- struct siu_info *info = siu_i2s_data;
- u32 __iomem *base = info->reg;
- struct siu_stream *siu_stream = &port_info->playback;
- struct snd_pcm_substream *substream = siu_stream->substream;
- struct device *dev = substream->pcm->card->dev;
- struct dma_async_tx_descriptor *desc;
- dma_cookie_t cookie;
- struct scatterlist sg;
- u32 stfifo;
-
- sg_init_table(&sg, 1);
- sg_set_page(&sg, pfn_to_page(PFN_DOWN(buff)),
- size, offset_in_page(buff));
- sg_dma_len(&sg) = size;
- sg_dma_address(&sg) = buff;
-
- desc = dmaengine_prep_slave_sg(siu_stream->chan,
- &sg, 1, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
- if (!desc) {
- dev_err(dev, "Failed to allocate a dma descriptor\n");
- return -ENOMEM;
- }
-
- desc->callback = siu_dma_tx_complete;
- desc->callback_param = siu_stream;
- cookie = dmaengine_submit(desc);
- if (cookie < 0) {
- dev_err(dev, "Failed to submit a dma transfer\n");
- return cookie;
- }
-
- siu_stream->tx_desc = desc;
- siu_stream->cookie = cookie;
-
- dma_async_issue_pending(siu_stream->chan);
-
- /* only output FIFO enable */
- stfifo = siu_read32(base + SIU_STFIFO);
- siu_write32(base + SIU_STFIFO, stfifo | (port_info->stfifo & 0x0c180c18));
- dev_dbg(dev, "%s: STFIFO %x -> %x\n", __func__,
- stfifo, stfifo | (port_info->stfifo & 0x0c180c18));
-
- return 0;
-}
-
-static int siu_pcm_rd_set(struct siu_port *port_info,
- dma_addr_t buff, size_t size)
-{
- struct siu_info *info = siu_i2s_data;
- u32 __iomem *base = info->reg;
- struct siu_stream *siu_stream = &port_info->capture;
- struct snd_pcm_substream *substream = siu_stream->substream;
- struct device *dev = substream->pcm->card->dev;
- struct dma_async_tx_descriptor *desc;
- dma_cookie_t cookie;
- struct scatterlist sg;
- u32 stfifo;
-
- dev_dbg(dev, "%s: %[email protected]%llx\n", __func__, size, (unsigned long long)buff);
-
- sg_init_table(&sg, 1);
- sg_set_page(&sg, pfn_to_page(PFN_DOWN(buff)),
- size, offset_in_page(buff));
- sg_dma_len(&sg) = size;
- sg_dma_address(&sg) = buff;
-
- desc = dmaengine_prep_slave_sg(siu_stream->chan,
- &sg, 1, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
- if (!desc) {
- dev_err(dev, "Failed to allocate dma descriptor\n");
- return -ENOMEM;
- }
-
- desc->callback = siu_dma_tx_complete;
- desc->callback_param = siu_stream;
- cookie = dmaengine_submit(desc);
- if (cookie < 0) {
- dev_err(dev, "Failed to submit dma descriptor\n");
- return cookie;
- }
-
- siu_stream->tx_desc = desc;
- siu_stream->cookie = cookie;
-
- dma_async_issue_pending(siu_stream->chan);
-
- /* only input FIFO enable */
- stfifo = siu_read32(base + SIU_STFIFO);
- siu_write32(base + SIU_STFIFO, siu_read32(base + SIU_STFIFO) |
- (port_info->stfifo & 0x13071307));
- dev_dbg(dev, "%s: STFIFO %x -> %x\n", __func__,
- stfifo, stfifo | (port_info->stfifo & 0x13071307));
-
- return 0;
-}
-
-static void siu_io_work(struct work_struct *work)
-{
- struct siu_stream *siu_stream = container_of(work, struct siu_stream,
- work);
- struct snd_pcm_substream *substream = siu_stream->substream;
- struct device *dev = substream->pcm->card->dev;
- struct snd_pcm_runtime *rt = substream->runtime;
- struct siu_port *port_info = siu_port_info(substream);
-
- dev_dbg(dev, "%s: flags %x\n", __func__, siu_stream->rw_flg);
-
- if (!siu_stream->rw_flg) {
- dev_dbg(dev, "%s: stream inactive\n", __func__);
- return;
- }
-
- if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
- dma_addr_t buff;
- size_t count;
-
- buff = (dma_addr_t)PERIOD_OFFSET(rt->dma_addr,
- siu_stream->cur_period,
- siu_stream->period_bytes);
- count = siu_stream->period_bytes;
-
- /* DMA transfer start */
- siu_pcm_rd_set(port_info, buff, count);
- } else {
- siu_pcm_wr_set(port_info,
- (dma_addr_t)PERIOD_OFFSET(rt->dma_addr,
- siu_stream->cur_period,
- siu_stream->period_bytes),
- siu_stream->period_bytes);
- }
-}
-
-/* Capture */
-static int siu_pcm_stmread_start(struct siu_port *port_info)
-{
- struct siu_stream *siu_stream = &port_info->capture;
-
- if (siu_stream->xfer_cnt > 0x1000000)
- return -EINVAL;
- if (siu_stream->rw_flg)
- return -EPERM;
-
- /* Current period in buffer */
- siu_stream->cur_period = 0;
-
- /* during stmread flag set */
- siu_stream->rw_flg = RWF_STM_RD;
-
- queue_work(system_highpri_wq, &siu_stream->work);
-
- return 0;
-}
-
-static int siu_pcm_stmread_stop(struct siu_port *port_info)
-{
- struct siu_info *info = siu_i2s_data;
- u32 __iomem *base = info->reg;
- struct siu_stream *siu_stream = &port_info->capture;
- struct device *dev = siu_stream->substream->pcm->card->dev;
- u32 stfifo;
-
- if (!siu_stream->rw_flg)
- return -EPERM;
-
- /* input FIFO disable */
- stfifo = siu_read32(base + SIU_STFIFO);
- siu_write32(base + SIU_STFIFO, stfifo & ~0x13071307);
- dev_dbg(dev, "%s: STFIFO %x -> %x\n", __func__,
- stfifo, stfifo & ~0x13071307);
-
- /* during stmread flag clear */
- siu_stream->rw_flg = 0;
-
- return 0;
-}
-
-static bool filter(struct dma_chan *chan, void *secondary)
-{
- struct sh_dmae_slave *param = secondary;
-
- pr_debug("%s: secondary ID %d\n", __func__, param->shdma_slave.slave_id);
-
- chan->private = &param->shdma_slave;
- return true;
-}
-
-static int siu_pcm_open(struct snd_soc_component *component,
- struct snd_pcm_substream *ss)
-{
- /* Playback / Capture */
- struct siu_platform *pdata = component->dev->platform_data;
- struct siu_info *info = siu_i2s_data;
- struct siu_port *port_info = siu_port_info(ss);
- struct siu_stream *siu_stream;
- u32 port = info->port_id;
- struct device *dev = ss->pcm->card->dev;
- dma_cap_mask_t mask;
- struct sh_dmae_slave *param;
-
- dma_cap_zero(mask);
- dma_cap_set(DMA_SLAVE, mask);
-
- dev_dbg(dev, "%s, port=%[email protected]%p\n", __func__, port, port_info);
-
- if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- siu_stream = &port_info->playback;
- param = &siu_stream->param;
- param->shdma_slave.slave_id = port ? pdata->dma_slave_tx_b :
- pdata->dma_slave_tx_a;
- } else {
- siu_stream = &port_info->capture;
- param = &siu_stream->param;
- param->shdma_slave.slave_id = port ? pdata->dma_slave_rx_b :
- pdata->dma_slave_rx_a;
- }
-
- /* Get DMA channel */
- siu_stream->chan = dma_request_channel(mask, filter, param);
- if (!siu_stream->chan) {
- dev_err(dev, "DMA channel allocation failed!\n");
- return -EBUSY;
- }
-
- siu_stream->substream = ss;
-
- return 0;
-}
-
-static int siu_pcm_close(struct snd_soc_component *component,
- struct snd_pcm_substream *ss)
-{
- struct siu_info *info = siu_i2s_data;
- struct device *dev = ss->pcm->card->dev;
- struct siu_port *port_info = siu_port_info(ss);
- struct siu_stream *siu_stream;
-
- dev_dbg(dev, "%s: port=%d\n", __func__, info->port_id);
-
- if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
- siu_stream = &port_info->playback;
- else
- siu_stream = &port_info->capture;
-
- dma_release_channel(siu_stream->chan);
- siu_stream->chan = NULL;
-
- siu_stream->substream = NULL;
-
- return 0;
-}
-
-static int siu_pcm_prepare(struct snd_soc_component *component,
- struct snd_pcm_substream *ss)
-{
- struct siu_info *info = siu_i2s_data;
- struct siu_port *port_info = siu_port_info(ss);
- struct device *dev = ss->pcm->card->dev;
- struct snd_pcm_runtime *rt;
- struct siu_stream *siu_stream;
- snd_pcm_sframes_t xfer_cnt;
-
- if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
- siu_stream = &port_info->playback;
- else
- siu_stream = &port_info->capture;
-
- rt = siu_stream->substream->runtime;
-
- siu_stream->buf_bytes = snd_pcm_lib_buffer_bytes(ss);
- siu_stream->period_bytes = snd_pcm_lib_period_bytes(ss);
-
- dev_dbg(dev, "%s: port=%d, %d channels, period=%u bytes\n", __func__,
- info->port_id, rt->channels, siu_stream->period_bytes);
-
- /* We only support buffers that are multiples of the period */
- if (siu_stream->buf_bytes % siu_stream->period_bytes) {
- dev_err(dev, "%s() - buffer=%d not multiple of period=%d\n",
- __func__, siu_stream->buf_bytes,
- siu_stream->period_bytes);
- return -EINVAL;
- }
-
- xfer_cnt = bytes_to_frames(rt, siu_stream->period_bytes);
- if (!xfer_cnt || xfer_cnt > 0x1000000)
- return -EINVAL;
-
- siu_stream->format = rt->format;
- siu_stream->xfer_cnt = xfer_cnt;
-
- dev_dbg(dev, "port=%d buf=%lx buf_bytes=%d period_bytes=%d "
- "format=%d channels=%d xfer_cnt=%d\n", info->port_id,
- (unsigned long)rt->dma_addr, siu_stream->buf_bytes,
- siu_stream->period_bytes,
- siu_stream->format, rt->channels, (int)xfer_cnt);
-
- return 0;
-}
-
-static int siu_pcm_trigger(struct snd_soc_component *component,
- struct snd_pcm_substream *ss, int cmd)
-{
- struct siu_info *info = siu_i2s_data;
- struct device *dev = ss->pcm->card->dev;
- struct siu_port *port_info = siu_port_info(ss);
- int ret;
-
- dev_dbg(dev, "%s: port=%[email protected]%p, cmd=%d\n", __func__,
- info->port_id, port_info, cmd);
-
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_START:
- if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
- ret = siu_pcm_stmwrite_start(port_info);
- else
- ret = siu_pcm_stmread_start(port_info);
-
- if (ret < 0)
- dev_warn(dev, "%s: start failed on port=%d\n",
- __func__, info->port_id);
-
- break;
- case SNDRV_PCM_TRIGGER_STOP:
- if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
- siu_pcm_stmwrite_stop(port_info);
- else
- siu_pcm_stmread_stop(port_info);
- ret = 0;
-
- break;
- default:
- dev_err(dev, "%s() unsupported cmd=%d\n", __func__, cmd);
- ret = -EINVAL;
- }
-
- return ret;
-}
-
-/*
- * So far only resolution of one period is supported, subject to extending the
- * dmangine API
- */
-static snd_pcm_uframes_t
-siu_pcm_pointer_dma(struct snd_soc_component *component,
- struct snd_pcm_substream *ss)
-{
- struct device *dev = ss->pcm->card->dev;
- struct siu_info *info = siu_i2s_data;
- u32 __iomem *base = info->reg;
- struct siu_port *port_info = siu_port_info(ss);
- struct snd_pcm_runtime *rt = ss->runtime;
- size_t ptr;
- struct siu_stream *siu_stream;
-
- if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
- siu_stream = &port_info->playback;
- else
- siu_stream = &port_info->capture;
-
- /*
- * ptr is the offset into the buffer where the dma is currently at. We
- * check if the dma buffer has just wrapped.
- */
- ptr = PERIOD_OFFSET(rt->dma_addr,
- siu_stream->cur_period,
- siu_stream->period_bytes) - rt->dma_addr;
-
- dev_dbg(dev,
- "%s: port=%d, events %x, FSTS %x, xferred %u/%u, cookie %d\n",
- __func__, info->port_id, siu_read32(base + SIU_EVNTC),
- siu_read32(base + SIU_SBFSTS), ptr, siu_stream->buf_bytes,
- siu_stream->cookie);
-
- if (ptr >= siu_stream->buf_bytes)
- ptr = 0;
-
- return bytes_to_frames(ss->runtime, ptr);
-}
-
-static int siu_pcm_new(struct snd_soc_component *component,
- struct snd_soc_pcm_runtime *rtd)
-{
- /* card->dev == socdev->dev, see snd_soc_new_pcms() */
- struct snd_card *card = rtd->card->snd_card;
- struct snd_pcm *pcm = rtd->pcm;
- struct siu_info *info = siu_i2s_data;
- struct platform_device *pdev = to_platform_device(card->dev);
- int ret;
- int i;
-
- /* pdev->id selects between SIUA and SIUB */
- if (pdev->id < 0 || pdev->id >= SIU_PORT_NUM)
- return -EINVAL;
-
- info->port_id = pdev->id;
-
- /*
- * While the siu has 2 ports, only one port can be on at a time (only 1
- * SPB). So far all the boards using the siu had only one of the ports
- * wired to a codec. To simplify things, we only register one port with
- * alsa. In case both ports are needed, it should be changed here
- */
- for (i = pdev->id; i < pdev->id + 1; i++) {
- struct siu_port **port_info = &siu_ports[i];
-
- ret = siu_init_port(i, port_info, card);
- if (ret < 0)
- return ret;
-
- snd_pcm_set_managed_buffer_all(pcm,
- SNDRV_DMA_TYPE_DEV, card->dev,
- SIU_BUFFER_BYTES_MAX, SIU_BUFFER_BYTES_MAX);
-
- (*port_info)->pcm = pcm;
-
- /* IO works */
- INIT_WORK(&(*port_info)->playback.work, siu_io_work);
- INIT_WORK(&(*port_info)->capture.work, siu_io_work);
- }
-
- dev_info(card->dev, "SuperH SIU driver initialized.\n");
- return 0;
-}
-
-static void siu_pcm_free(struct snd_soc_component *component,
- struct snd_pcm *pcm)
-{
- struct platform_device *pdev = to_platform_device(pcm->card->dev);
- struct siu_port *port_info = siu_ports[pdev->id];
-
- cancel_work_sync(&port_info->capture.work);
- cancel_work_sync(&port_info->playback.work);
-
- siu_free_port(port_info);
-
- dev_dbg(pcm->card->dev, "%s\n", __func__);
-}
-
-const struct snd_soc_component_driver siu_component = {
- .name = DRV_NAME,
- .open = siu_pcm_open,
- .close = siu_pcm_close,
- .prepare = siu_pcm_prepare,
- .trigger = siu_pcm_trigger,
- .pointer = siu_pcm_pointer_dma,
- .pcm_construct = siu_pcm_new,
- .pcm_destruct = siu_pcm_free,
- .legacy_dai_naming = 1,
-};
-EXPORT_SYMBOL_GPL(siu_component);
diff --git a/sound/soc/sh/ssi.c b/sound/soc/sh/ssi.c
deleted file mode 100644
index 96cf523c227343..00000000000000
--- a/sound/soc/sh/ssi.c
+++ /dev/null
@@ -1,403 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-//
-// Serial Sound Interface (I2S) support for SH7760/SH7780
-//
-// Copyright (c) 2007 Manuel Lauss <[email protected]>
-//
-// dont forget to set IPSEL/OMSEL register bits (in your board code) to
-// enable SSI output pins!
-
-/*
- * LIMITATIONS:
- * The SSI unit has only one physical data line, so full duplex is
- * impossible. This can be remedied on the SH7760 by using the
- * other SSI unit for recording; however the SH7780 has only 1 SSI
- * unit, and its pins are shared with the AC97 unit, among others.
- *
- * FEATURES:
- * The SSI features "compressed mode": in this mode it continuously
- * streams PCM data over the I2S lines and uses LRCK as a handshake
- * signal. Can be used to send compressed data (AC3/DTS) to a DSP.
- * The number of bits sent over the wire in a frame can be adjusted
- * and can be independent from the actual sample bit depth. This is
- * useful to support TDM mode codecs like the AD1939 which have a
- * fixed TDM slot size, regardless of sample resolution.
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/initval.h>
-#include <sound/soc.h>
-#include <asm/io.h>
-
-#define SSICR 0x00
-#define SSISR 0x04
-
-#define CR_DMAEN (1 << 28)
-#define CR_CHNL_SHIFT 22
-#define CR_CHNL_MASK (3 << CR_CHNL_SHIFT)
-#define CR_DWL_SHIFT 19
-#define CR_DWL_MASK (7 << CR_DWL_SHIFT)
-#define CR_SWL_SHIFT 16
-#define CR_SWL_MASK (7 << CR_SWL_SHIFT)
-#define CR_SCK_MASTER (1 << 15) /* bitclock master bit */
-#define CR_SWS_MASTER (1 << 14) /* wordselect master bit */
-#define CR_SCKP (1 << 13) /* I2Sclock polarity */
-#define CR_SWSP (1 << 12) /* LRCK polarity */
-#define CR_SPDP (1 << 11)
-#define CR_SDTA (1 << 10) /* i2s alignment (msb/lsb) */
-#define CR_PDTA (1 << 9) /* fifo data alignment */
-#define CR_DEL (1 << 8) /* delay data by 1 i2sclk */
-#define CR_BREN (1 << 7) /* clock gating in burst mode */
-#define CR_CKDIV_SHIFT 4
-#define CR_CKDIV_MASK (7 << CR_CKDIV_SHIFT) /* bitclock divider */
-#define CR_MUTE (1 << 3) /* SSI mute */
-#define CR_CPEN (1 << 2) /* compressed mode */
-#define CR_TRMD (1 << 1) /* transmit/receive select */
-#define CR_EN (1 << 0) /* enable SSI */
-
-#define SSIREG(reg) (*(unsigned long *)(ssi->mmio + (reg)))
-
-struct ssi_priv {
- unsigned long mmio;
- unsigned long sysclk;
- int inuse;
-} ssi_cpu_data[] = {
-#if defined(CONFIG_CPU_SUBTYPE_SH7760)
- {
- .mmio = 0xFE680000,
- },
- {
- .mmio = 0xFE690000,
- },
-#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
- {
- .mmio = 0xFFE70000,
- },
-#else
-#error "Unsupported SuperH SoC"
-#endif
-};
-
-/*
- * track usage of the SSI; it is simplex-only so prevent attempts of
- * concurrent playback + capture. FIXME: any locking required?
- */
-static int ssi_startup(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
-{
- struct ssi_priv *ssi = &ssi_cpu_data[dai->id];
- if (ssi->inuse) {
- pr_debug("ssi: already in use!\n");
- return -EBUSY;
- } else
- ssi->inuse = 1;
- return 0;
-}
-
-static void ssi_shutdown(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
-{
- struct ssi_priv *ssi = &ssi_cpu_data[dai->id];
-
- ssi->inuse = 0;
-}
-
-static int ssi_trigger(struct snd_pcm_substream *substream, int cmd,
- struct snd_soc_dai *dai)
-{
- struct ssi_priv *ssi = &ssi_cpu_data[dai->id];
-
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_START:
- SSIREG(SSICR) |= CR_DMAEN | CR_EN;
- break;
- case SNDRV_PCM_TRIGGER_STOP:
- SSIREG(SSICR) &= ~(CR_DMAEN | CR_EN);
- break;
- default:
- return -EINVAL;
- }
-
- return 0;
-}
-
-static int ssi_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params,
- struct snd_soc_dai *dai)
-{
- struct ssi_priv *ssi = &ssi_cpu_data[dai->id];
- unsigned long ssicr = SSIREG(SSICR);
- unsigned int bits, channels, swl, recv, i;
-
- channels = params_channels(params);
- bits = params->msbits;
- recv = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 0 : 1;
-
- pr_debug("ssi_hw_params() enter\nssicr was %08lx\n", ssicr);
- pr_debug("bits: %u channels: %u\n", bits, channels);
-
- ssicr &= ~(CR_TRMD | CR_CHNL_MASK | CR_DWL_MASK | CR_PDTA |
- CR_SWL_MASK);
-
- /* direction (send/receive) */
- if (!recv)
- ssicr |= CR_TRMD; /* transmit */
-
- /* channels */
- if ((channels < 2) || (channels > 8) || (channels & 1)) {
- pr_debug("ssi: invalid number of channels\n");
- return -EINVAL;
- }
- ssicr |= ((channels >> 1) - 1) << CR_CHNL_SHIFT;
-
- /* DATA WORD LENGTH (DWL): databits in audio sample */
- i = 0;
- switch (bits) {
- case 32: ++i;
- case 24: ++i;
- case 22: ++i;
- case 20: ++i;
- case 18: ++i;
- case 16: ++i;
- ssicr |= i << CR_DWL_SHIFT;
- case 8: break;
- default:
- pr_debug("ssi: invalid sample width\n");
- return -EINVAL;
- }
-
- /*
- * SYSTEM WORD LENGTH: size in bits of half a frame over the I2S
- * wires. This is usually bits_per_sample x channels/2; i.e. in
- * Stereo mode the SWL equals DWL. SWL can be bigger than the
- * product of (channels_per_slot x samplebits), e.g. for codecs
- * like the AD1939 which only accept 32bit wide TDM slots. For
- * "standard" I2S operation we set SWL = chans / 2 * DWL here.
- * Waiting for ASoC to get TDM support ;-)
- */
- if ((bits > 16) && (bits <= 24)) {
- bits = 24; /* these are padded by the SSI */
- /*ssicr |= CR_PDTA;*/ /* cpu/data endianness ? */
- }
- i = 0;
- swl = (bits * channels) / 2;
- switch (swl) {
- case 256: ++i;
- case 128: ++i;
- case 64: ++i;
- case 48: ++i;
- case 32: ++i;
- case 16: ++i;
- ssicr |= i << CR_SWL_SHIFT;
- case 8: break;
- default:
- pr_debug("ssi: invalid system word length computed\n");
- return -EINVAL;
- }
-
- SSIREG(SSICR) = ssicr;
-
- pr_debug("ssi_hw_params() leave\nssicr is now %08lx\n", ssicr);
- return 0;
-}
-
-static int ssi_set_sysclk(struct snd_soc_dai *cpu_dai, int clk_id,
- unsigned int freq, int dir)
-{
- struct ssi_priv *ssi = &ssi_cpu_data[cpu_dai->id];
-
- ssi->sysclk = freq;
-
- return 0;
-}
-
-/*
- * This divider is used to generate the SSI_SCK (I2S bitclock) from the
- * clock at the HAC_BIT_CLK ("oversampling clock") pin.
- */
-static int ssi_set_clkdiv(struct snd_soc_dai *dai, int did, int div)
-{
- struct ssi_priv *ssi = &ssi_cpu_data[dai->id];
- unsigned long ssicr;
- int i;
-
- i = 0;
- ssicr = SSIREG(SSICR) & ~CR_CKDIV_MASK;
- switch (div) {
- case 16: ++i;
- case 8: ++i;
- case 4: ++i;
- case 2: ++i;
- SSIREG(SSICR) = ssicr | (i << CR_CKDIV_SHIFT);
- case 1: break;
- default:
- pr_debug("ssi: invalid sck divider %d\n", div);
- return -EINVAL;
- }
-
- return 0;
-}
-
-static int ssi_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
-{
- struct ssi_priv *ssi = &ssi_cpu_data[dai->id];
- unsigned long ssicr = SSIREG(SSICR);
-
- pr_debug("ssi_set_fmt()\nssicr was 0x%08lx\n", ssicr);
-
- ssicr &= ~(CR_DEL | CR_PDTA | CR_BREN | CR_SWSP | CR_SCKP |
- CR_SWS_MASTER | CR_SCK_MASTER);
-
- switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
- case SND_SOC_DAIFMT_I2S:
- break;
- case SND_SOC_DAIFMT_RIGHT_J:
- ssicr |= CR_DEL | CR_PDTA;
- break;
- case SND_SOC_DAIFMT_LEFT_J:
- ssicr |= CR_DEL;
- break;
- default:
- pr_debug("ssi: unsupported format\n");
- return -EINVAL;
- }
-
- switch (fmt & SND_SOC_DAIFMT_CLOCK_MASK) {
- case SND_SOC_DAIFMT_CONT:
- break;
- case SND_SOC_DAIFMT_GATED:
- ssicr |= CR_BREN;
- break;
- }
-
- switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
- case SND_SOC_DAIFMT_NB_NF:
- ssicr |= CR_SCKP; /* sample data at low clkedge */
- break;
- case SND_SOC_DAIFMT_NB_IF:
- ssicr |= CR_SCKP | CR_SWSP;
- break;
- case SND_SOC_DAIFMT_IB_NF:
- break;
- case SND_SOC_DAIFMT_IB_IF:
- ssicr |= CR_SWSP; /* word select starts low */
- break;
- default:
- pr_debug("ssi: invalid inversion\n");
- return -EINVAL;
- }
-
- switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
- case SND_SOC_DAIFMT_BC_FC:
- break;
- case SND_SOC_DAIFMT_BP_FC:
- ssicr |= CR_SCK_MASTER;
- break;
- case SND_SOC_DAIFMT_BC_FP:
- ssicr |= CR_SWS_MASTER;
- break;
- case SND_SOC_DAIFMT_BP_FP:
- ssicr |= CR_SWS_MASTER | CR_SCK_MASTER;
- break;
- default:
- pr_debug("ssi: invalid master/secondary configuration\n");
- return -EINVAL;
- }
-
- SSIREG(SSICR) = ssicr;
- pr_debug("ssi_set_fmt() leave\nssicr is now 0x%08lx\n", ssicr);
-
- return 0;
-}
-
-/* the SSI depends on an external clocksource (at HAC_BIT_CLK) even in
- * Master mode, so really this is board specific; the SSI can do any
- * rate with the right bitclk and divider settings.
- */
-#define SSI_RATES \
- SNDRV_PCM_RATE_8000_192000
-
-/* the SSI can do 8-32 bit samples, with 8 possible channels */
-#define SSI_FMTS \
- (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | \
- SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE | \
- SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_U20_3LE | \
- SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_U24_3LE | \
- SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_U32_LE)
-
-static const struct snd_soc_dai_ops ssi_dai_ops = {
- .startup = ssi_startup,
- .shutdown = ssi_shutdown,
- .trigger = ssi_trigger,
- .hw_params = ssi_hw_params,
- .set_sysclk = ssi_set_sysclk,
- .set_clkdiv = ssi_set_clkdiv,
- .set_fmt = ssi_set_fmt,
-};
-
-static struct snd_soc_dai_driver sh4_ssi_dai[] = {
-{
- .name = "ssi-dai.0",
- .playback = {
- .rates = SSI_RATES,
- .formats = SSI_FMTS,
- .channels_min = 2,
- .channels_max = 8,
- },
- .capture = {
- .rates = SSI_RATES,
- .formats = SSI_FMTS,
- .channels_min = 2,
- .channels_max = 8,
- },
- .ops = &ssi_dai_ops,
-},
-#ifdef CONFIG_CPU_SUBTYPE_SH7760
-{
- .name = "ssi-dai.1",
- .playback = {
- .rates = SSI_RATES,
- .formats = SSI_FMTS,
- .channels_min = 2,
- .channels_max = 8,
- },
- .capture = {
- .rates = SSI_RATES,
- .formats = SSI_FMTS,
- .channels_min = 2,
- .channels_max = 8,
- },
- .ops = &ssi_dai_ops,
-},
-#endif
-};
-
-static const struct snd_soc_component_driver sh4_ssi_component = {
- .name = "sh4-ssi",
- .legacy_dai_naming = 1,
-};
-
-static int sh4_soc_dai_probe(struct platform_device *pdev)
-{
- return devm_snd_soc_register_component(&pdev->dev, &sh4_ssi_component,
- sh4_ssi_dai,
- ARRAY_SIZE(sh4_ssi_dai));
-}
-
-static struct platform_driver sh4_ssi_driver = {
- .driver = {
- .name = "sh4-ssi-dai",
- },
-
- .probe = sh4_soc_dai_probe,
-};
-
-module_platform_driver(sh4_ssi_driver);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("SuperH onchip SSI (I2S) audio driver");
-MODULE_AUTHOR("Manuel Lauss <[email protected]>");
--
2.39.0

2023-01-13 06:44:06

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 17/22] spi: remove spi-jcore

Now that arch/sh is removed this driver is dead code.

Signed-off-by: Christoph Hellwig <[email protected]>
---
drivers/spi/Kconfig | 7 --
drivers/spi/Makefile | 1 -
drivers/spi/spi-jcore.c | 235 ----------------------------------------
3 files changed, 243 deletions(-)
delete mode 100644 drivers/spi/spi-jcore.c

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 76f3bc6f8c81fc..17c75f5c19be75 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -483,13 +483,6 @@ config SPI_INTEL_PLATFORM
To compile this driver as a module, choose M here: the module
will be called spi-intel-platform.

-config SPI_JCORE
- tristate "J-Core SPI Master"
- depends on OF && (SUPERH || COMPILE_TEST)
- help
- This enables support for the SPI master controller in the J-Core
- synthesizable, open source SoC.
-
config SPI_LM70_LLP
tristate "Parallel port adapter for LM70 eval board (DEVELOPMENT)"
depends on PARPORT
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index 27d877440c6539..2d03fcefc11ea2 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -67,7 +67,6 @@ obj-$(CONFIG_SPI_INTEL) += spi-intel.o
obj-$(CONFIG_SPI_INTEL_PCI) += spi-intel-pci.o
obj-$(CONFIG_SPI_INTEL_PLATFORM) += spi-intel-platform.o
obj-$(CONFIG_SPI_LANTIQ_SSC) += spi-lantiq-ssc.o
-obj-$(CONFIG_SPI_JCORE) += spi-jcore.o
obj-$(CONFIG_SPI_LM70_LLP) += spi-lm70llp.o
obj-$(CONFIG_SPI_LP8841_RTC) += spi-lp8841-rtc.o
obj-$(CONFIG_SPI_MESON_SPICC) += spi-meson-spicc.o
diff --git a/drivers/spi/spi-jcore.c b/drivers/spi/spi-jcore.c
deleted file mode 100644
index 74c8319c29f170..00000000000000
--- a/drivers/spi/spi-jcore.c
+++ /dev/null
@@ -1,235 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * J-Core SPI controller driver
- *
- * Copyright (C) 2012-2016 Smart Energy Instruments, Inc.
- *
- * Current version by Rich Felker
- * Based loosely on initial version by Oleksandr G Zhadan
- *
- */
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/errno.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/spi/spi.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/of.h>
-#include <linux/delay.h>
-
-#define DRV_NAME "jcore_spi"
-
-#define CTRL_REG 0x0
-#define DATA_REG 0x4
-
-#define JCORE_SPI_CTRL_XMIT 0x02
-#define JCORE_SPI_STAT_BUSY 0x02
-#define JCORE_SPI_CTRL_LOOP 0x08
-#define JCORE_SPI_CTRL_CS_BITS 0x15
-
-#define JCORE_SPI_WAIT_RDY_MAX_LOOP 2000000
-
-struct jcore_spi {
- struct spi_master *master;
- void __iomem *base;
- unsigned int cs_reg;
- unsigned int speed_reg;
- unsigned int speed_hz;
- unsigned int clock_freq;
-};
-
-static int jcore_spi_wait(void __iomem *ctrl_reg)
-{
- unsigned timeout = JCORE_SPI_WAIT_RDY_MAX_LOOP;
-
- do {
- if (!(readl(ctrl_reg) & JCORE_SPI_STAT_BUSY))
- return 0;
- cpu_relax();
- } while (--timeout);
-
- return -EBUSY;
-}
-
-static void jcore_spi_program(struct jcore_spi *hw)
-{
- void __iomem *ctrl_reg = hw->base + CTRL_REG;
-
- if (jcore_spi_wait(ctrl_reg))
- dev_err(hw->master->dev.parent,
- "timeout waiting to program ctrl reg.\n");
-
- writel(hw->cs_reg | hw->speed_reg, ctrl_reg);
-}
-
-static void jcore_spi_chipsel(struct spi_device *spi, bool value)
-{
- struct jcore_spi *hw = spi_master_get_devdata(spi->master);
- u32 csbit = 1U << (2 * spi->chip_select);
-
- dev_dbg(hw->master->dev.parent, "chipselect %d\n", spi->chip_select);
-
- if (value)
- hw->cs_reg |= csbit;
- else
- hw->cs_reg &= ~csbit;
-
- jcore_spi_program(hw);
-}
-
-static void jcore_spi_baudrate(struct jcore_spi *hw, int speed)
-{
- if (speed == hw->speed_hz)
- return;
- hw->speed_hz = speed;
- if (speed >= hw->clock_freq / 2)
- hw->speed_reg = 0;
- else
- hw->speed_reg = ((hw->clock_freq / 2 / speed) - 1) << 27;
- jcore_spi_program(hw);
- dev_dbg(hw->master->dev.parent, "speed=%d reg=0x%x\n",
- speed, hw->speed_reg);
-}
-
-static int jcore_spi_txrx(struct spi_master *master, struct spi_device *spi,
- struct spi_transfer *t)
-{
- struct jcore_spi *hw = spi_master_get_devdata(master);
-
- void __iomem *ctrl_reg = hw->base + CTRL_REG;
- void __iomem *data_reg = hw->base + DATA_REG;
- u32 xmit;
-
- /* data buffers */
- const unsigned char *tx;
- unsigned char *rx;
- unsigned int len;
- unsigned int count;
-
- jcore_spi_baudrate(hw, t->speed_hz);
-
- xmit = hw->cs_reg | hw->speed_reg | JCORE_SPI_CTRL_XMIT;
- tx = t->tx_buf;
- rx = t->rx_buf;
- len = t->len;
-
- for (count = 0; count < len; count++) {
- if (jcore_spi_wait(ctrl_reg))
- break;
-
- writel(tx ? *tx++ : 0, data_reg);
- writel(xmit, ctrl_reg);
-
- if (jcore_spi_wait(ctrl_reg))
- break;
-
- if (rx)
- *rx++ = readl(data_reg);
- }
-
- spi_finalize_current_transfer(master);
-
- if (count < len)
- return -EREMOTEIO;
-
- return 0;
-}
-
-static int jcore_spi_probe(struct platform_device *pdev)
-{
- struct device_node *node = pdev->dev.of_node;
- struct jcore_spi *hw;
- struct spi_master *master;
- struct resource *res;
- u32 clock_freq;
- struct clk *clk;
- int err = -ENODEV;
-
- master = spi_alloc_master(&pdev->dev, sizeof(struct jcore_spi));
- if (!master)
- return err;
-
- /* Setup the master state. */
- master->num_chipselect = 3;
- master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
- master->transfer_one = jcore_spi_txrx;
- master->set_cs = jcore_spi_chipsel;
- master->dev.of_node = node;
- master->bus_num = pdev->id;
-
- hw = spi_master_get_devdata(master);
- hw->master = master;
- platform_set_drvdata(pdev, hw);
-
- /* Find and map our resources */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- goto exit_busy;
- if (!devm_request_mem_region(&pdev->dev, res->start,
- resource_size(res), pdev->name))
- goto exit_busy;
- hw->base = devm_ioremap(&pdev->dev, res->start,
- resource_size(res));
- if (!hw->base)
- goto exit_busy;
-
- /*
- * The SPI clock rate controlled via a configurable clock divider
- * which is applied to the reference clock. A 50 MHz reference is
- * most suitable for obtaining standard SPI clock rates, but some
- * designs may have a different reference clock, and the DT must
- * make the driver aware so that it can properly program the
- * requested rate. If the clock is omitted, 50 MHz is assumed.
- */
- clock_freq = 50000000;
- clk = devm_clk_get(&pdev->dev, "ref_clk");
- if (!IS_ERR(clk)) {
- if (clk_prepare_enable(clk) == 0) {
- clock_freq = clk_get_rate(clk);
- clk_disable_unprepare(clk);
- } else
- dev_warn(&pdev->dev, "could not enable ref_clk\n");
- }
- hw->clock_freq = clock_freq;
-
- /* Initialize all CS bits to high. */
- hw->cs_reg = JCORE_SPI_CTRL_CS_BITS;
- jcore_spi_baudrate(hw, 400000);
-
- /* Register our spi controller */
- err = devm_spi_register_master(&pdev->dev, master);
- if (err)
- goto exit;
-
- return 0;
-
-exit_busy:
- err = -EBUSY;
-exit:
- spi_master_put(master);
- return err;
-}
-
-static const struct of_device_id jcore_spi_of_match[] = {
- { .compatible = "jcore,spi2" },
- {},
-};
-MODULE_DEVICE_TABLE(of, jcore_spi_of_match);
-
-static struct platform_driver jcore_spi_driver = {
- .probe = jcore_spi_probe,
- .driver = {
- .name = DRV_NAME,
- .of_match_table = jcore_spi_of_match,
- },
-};
-
-module_platform_driver(jcore_spi_driver);
-
-MODULE_DESCRIPTION("J-Core SPI driver");
-MODULE_AUTHOR("Rich Felker <[email protected]>");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
--
2.39.0

2023-01-13 06:44:08

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 03/22] remove arch/sh

The Linux SH port has been mostly abandoned for years, with the last
minor maintainer updated being in November 2021. Drop it as it drags
maintainance of the rest of the kernel down.

Signed-off-by: Christoph Hellwig <[email protected]>
---
Documentation/arch.rst | 1 -
Documentation/sh/booting.rst | 12 -
Documentation/sh/features.rst | 3 -
Documentation/sh/index.rst | 56 -
Documentation/sh/new-machine.rst | 277 ---
Documentation/sh/register-banks.rst | 40 -
MAINTAINERS | 10 -
arch/sh/Kbuild | 7 -
arch/sh/Kconfig | 793 --------
arch/sh/Kconfig.cpu | 100 -
arch/sh/Kconfig.debug | 78 -
arch/sh/Makefile | 215 ---
arch/sh/boards/Kconfig | 400 ----
arch/sh/boards/Makefile | 20 -
arch/sh/boards/board-apsh4a3a.c | 182 --
arch/sh/boards/board-apsh4ad0a.c | 132 --
arch/sh/boards/board-edosk7705.c | 79 -
arch/sh/boards/board-edosk7760.c | 178 --
arch/sh/boards/board-espt.c | 105 --
arch/sh/boards/board-magicpanelr2.c | 390 ----
arch/sh/boards/board-polaris.c | 156 --
arch/sh/boards/board-secureedge5410.c | 75 -
arch/sh/boards/board-sh2007.c | 146 --
arch/sh/boards/board-sh7757lcr.c | 604 -------
arch/sh/boards/board-sh7785lcr.c | 384 ----
arch/sh/boards/board-shmin.c | 35 -
arch/sh/boards/board-titan.c | 21 -
arch/sh/boards/board-urquell.c | 218 ---
arch/sh/boards/mach-ap325rxa/Makefile | 3 -
arch/sh/boards/mach-ap325rxa/sdram.S | 66 -
arch/sh/boards/mach-ap325rxa/setup.c | 573 ------
arch/sh/boards/mach-dreamcast/Makefile | 7 -
arch/sh/boards/mach-dreamcast/irq.c | 155 --
arch/sh/boards/mach-dreamcast/rtc.c | 96 -
arch/sh/boards/mach-dreamcast/setup.c | 39 -
arch/sh/boards/mach-ecovec24/Makefile | 10 -
arch/sh/boards/mach-ecovec24/sdram.S | 108 --
arch/sh/boards/mach-ecovec24/setup.c | 1521 ----------------
arch/sh/boards/mach-highlander/Kconfig | 26 -
arch/sh/boards/mach-highlander/Makefile | 12 -
arch/sh/boards/mach-highlander/irq-r7780mp.c | 71 -
arch/sh/boards/mach-highlander/irq-r7780rp.c | 64 -
arch/sh/boards/mach-highlander/irq-r7785rp.c | 83 -
.../boards/mach-highlander/pinmux-r7785rp.c | 17 -
arch/sh/boards/mach-highlander/psw.c | 119 --
arch/sh/boards/mach-highlander/setup.c | 416 -----
arch/sh/boards/mach-hp6xx/Makefile | 8 -
arch/sh/boards/mach-hp6xx/hp6xx_apm.c | 109 --
arch/sh/boards/mach-hp6xx/pm.c | 156 --
arch/sh/boards/mach-hp6xx/pm_wakeup.S | 39 -
arch/sh/boards/mach-hp6xx/setup.c | 172 --
arch/sh/boards/mach-kfr2r09/Makefile | 5 -
arch/sh/boards/mach-kfr2r09/lcd_wqvga.c | 275 ---
arch/sh/boards/mach-kfr2r09/sdram.S | 77 -
arch/sh/boards/mach-kfr2r09/setup.c | 649 -------
arch/sh/boards/mach-landisk/Makefile | 6 -
arch/sh/boards/mach-landisk/gio.c | 164 --
arch/sh/boards/mach-landisk/irq.c | 63 -
arch/sh/boards/mach-landisk/psw.c | 140 --
arch/sh/boards/mach-landisk/setup.c | 102 --
arch/sh/boards/mach-lboxre2/Makefile | 6 -
arch/sh/boards/mach-lboxre2/irq.c | 27 -
arch/sh/boards/mach-lboxre2/setup.c | 79 -
arch/sh/boards/mach-microdev/Makefile | 6 -
arch/sh/boards/mach-microdev/fdc37c93xapm.c | 157 --
arch/sh/boards/mach-microdev/io.c | 123 --
arch/sh/boards/mach-microdev/irq.c | 150 --
arch/sh/boards/mach-microdev/setup.c | 197 --
arch/sh/boards/mach-migor/Kconfig | 16 -
arch/sh/boards/mach-migor/Makefile | 3 -
arch/sh/boards/mach-migor/lcd_qvga.c | 163 --
arch/sh/boards/mach-migor/sdram.S | 66 -
arch/sh/boards/mach-migor/setup.c | 649 -------
arch/sh/boards/mach-r2d/Kconfig | 24 -
arch/sh/boards/mach-r2d/Makefile | 6 -
arch/sh/boards/mach-r2d/irq.c | 156 --
arch/sh/boards/mach-r2d/setup.c | 305 ----
arch/sh/boards/mach-rsk/Kconfig | 29 -
arch/sh/boards/mach-rsk/Makefile | 5 -
arch/sh/boards/mach-rsk/devices-rsk7203.c | 137 --
arch/sh/boards/mach-rsk/devices-rsk7264.c | 55 -
arch/sh/boards/mach-rsk/devices-rsk7269.c | 57 -
arch/sh/boards/mach-rsk/setup.c | 84 -
arch/sh/boards/mach-sdk7780/Kconfig | 17 -
arch/sh/boards/mach-sdk7780/Makefile | 6 -
arch/sh/boards/mach-sdk7780/irq.c | 43 -
arch/sh/boards/mach-sdk7780/setup.c | 96 -
arch/sh/boards/mach-sdk7786/Makefile | 5 -
arch/sh/boards/mach-sdk7786/fpga.c | 69 -
arch/sh/boards/mach-sdk7786/gpio.c | 46 -
arch/sh/boards/mach-sdk7786/irq.c | 45 -
arch/sh/boards/mach-sdk7786/nmi.c | 80 -
arch/sh/boards/mach-sdk7786/setup.c | 266 ---
arch/sh/boards/mach-sdk7786/sram.c | 69 -
arch/sh/boards/mach-se/7206/Makefile | 6 -
arch/sh/boards/mach-se/7206/irq.c | 151 --
arch/sh/boards/mach-se/7206/setup.c | 96 -
arch/sh/boards/mach-se/7343/Makefile | 6 -
arch/sh/boards/mach-se/7343/irq.c | 123 --
arch/sh/boards/mach-se/7343/setup.c | 182 --
arch/sh/boards/mach-se/770x/Makefile | 6 -
arch/sh/boards/mach-se/770x/irq.c | 109 --
arch/sh/boards/mach-se/770x/setup.c | 205 ---
arch/sh/boards/mach-se/7721/Makefile | 2 -
arch/sh/boards/mach-se/7721/irq.c | 42 -
arch/sh/boards/mach-se/7721/setup.c | 92 -
arch/sh/boards/mach-se/7722/Makefile | 11 -
arch/sh/boards/mach-se/7722/irq.c | 116 --
arch/sh/boards/mach-se/7722/setup.c | 190 --
arch/sh/boards/mach-se/7724/Makefile | 11 -
arch/sh/boards/mach-se/7724/irq.c | 143 --
arch/sh/boards/mach-se/7724/sdram.S | 128 --
arch/sh/boards/mach-se/7724/setup.c | 986 ----------
arch/sh/boards/mach-se/7751/Makefile | 6 -
arch/sh/boards/mach-se/7751/irq.c | 51 -
arch/sh/boards/mach-se/7751/setup.c | 60 -
arch/sh/boards/mach-se/7780/Makefile | 11 -
arch/sh/boards/mach-se/7780/irq.c | 65 -
arch/sh/boards/mach-se/7780/setup.c | 111 --
arch/sh/boards/mach-se/Makefile | 11 -
arch/sh/boards/mach-se/board-se7619.c | 27 -
arch/sh/boards/mach-sh03/Makefile | 7 -
arch/sh/boards/mach-sh03/rtc.c | 143 --
arch/sh/boards/mach-sh03/setup.c | 97 -
arch/sh/boards/mach-sh7763rdp/Makefile | 2 -
arch/sh/boards/mach-sh7763rdp/irq.c | 42 -
arch/sh/boards/mach-sh7763rdp/setup.c | 213 ---
arch/sh/boards/mach-x3proto/Makefile | 4 -
arch/sh/boards/mach-x3proto/gpio.c | 136 --
arch/sh/boards/mach-x3proto/ilsel.c | 156 --
arch/sh/boards/mach-x3proto/setup.c | 270 ---
arch/sh/boards/of-generic.c | 172 --
arch/sh/boot/.gitignore | 5 -
arch/sh/boot/Makefile | 115 --
arch/sh/boot/compressed/.gitignore | 2 -
arch/sh/boot/compressed/Makefile | 66 -
arch/sh/boot/compressed/ashiftrt.S | 2 -
arch/sh/boot/compressed/ashldi3.c | 2 -
arch/sh/boot/compressed/ashlsi3.S | 2 -
arch/sh/boot/compressed/ashrsi3.S | 2 -
arch/sh/boot/compressed/cache.c | 13 -
arch/sh/boot/compressed/head_32.S | 126 --
arch/sh/boot/compressed/head_64.S | 159 --
arch/sh/boot/compressed/lshrsi3.S | 2 -
arch/sh/boot/compressed/misc.c | 146 --
arch/sh/boot/compressed/vmlinux.scr | 10 -
arch/sh/boot/dts/Makefile | 2 -
arch/sh/boot/dts/j2_mimas_v2.dts | 99 -
arch/sh/boot/romimage/Makefile | 30 -
arch/sh/boot/romimage/head.S | 85 -
arch/sh/boot/romimage/mmcif-sh7724.c | 78 -
arch/sh/boot/romimage/vmlinux.scr | 8 -
arch/sh/cchips/Kconfig | 46 -
arch/sh/cchips/hd6446x/Makefile | 4 -
arch/sh/cchips/hd6446x/hd64461.c | 112 --
arch/sh/configs/ap325rxa_defconfig | 103 --
arch/sh/configs/apsh4a3a_defconfig | 91 -
arch/sh/configs/apsh4ad0a_defconfig | 122 --
arch/sh/configs/dreamcast_defconfig | 72 -
arch/sh/configs/ecovec24-romimage_defconfig | 58 -
arch/sh/configs/ecovec24_defconfig | 132 --
arch/sh/configs/edosk7705_defconfig | 35 -
arch/sh/configs/edosk7760_defconfig | 114 --
arch/sh/configs/espt_defconfig | 114 --
arch/sh/configs/hp6xx_defconfig | 60 -
arch/sh/configs/j2_defconfig | 42 -
arch/sh/configs/kfr2r09-romimage_defconfig | 53 -
arch/sh/configs/kfr2r09_defconfig | 84 -
arch/sh/configs/landisk_defconfig | 115 --
arch/sh/configs/lboxre2_defconfig | 62 -
arch/sh/configs/magicpanelr2_defconfig | 90 -
arch/sh/configs/microdev_defconfig | 43 -
arch/sh/configs/migor_defconfig | 94 -
arch/sh/configs/polaris_defconfig | 83 -
arch/sh/configs/r7780mp_defconfig | 109 --
arch/sh/configs/r7785rp_defconfig | 107 --
arch/sh/configs/rsk7201_defconfig | 63 -
arch/sh/configs/rsk7203_defconfig | 121 --
arch/sh/configs/rsk7264_defconfig | 71 -
arch/sh/configs/rsk7269_defconfig | 56 -
arch/sh/configs/rts7751r2d1_defconfig | 91 -
arch/sh/configs/rts7751r2dplus_defconfig | 96 -
arch/sh/configs/sdk7780_defconfig | 139 --
arch/sh/configs/sdk7786_defconfig | 217 ---
arch/sh/configs/se7206_defconfig | 108 --
arch/sh/configs/se7343_defconfig | 96 -
arch/sh/configs/se7619_defconfig | 43 -
arch/sh/configs/se7705_defconfig | 54 -
arch/sh/configs/se7712_defconfig | 101 --
arch/sh/configs/se7721_defconfig | 127 --
arch/sh/configs/se7722_defconfig | 56 -
arch/sh/configs/se7724_defconfig | 132 --
arch/sh/configs/se7750_defconfig | 55 -
arch/sh/configs/se7751_defconfig | 46 -
arch/sh/configs/se7780_defconfig | 106 --
arch/sh/configs/secureedge5410_defconfig | 53 -
arch/sh/configs/sh03_defconfig | 126 --
arch/sh/configs/sh2007_defconfig | 199 --
arch/sh/configs/sh7710voipgw_defconfig | 55 -
arch/sh/configs/sh7724_generic_defconfig | 41 -
arch/sh/configs/sh7757lcr_defconfig | 85 -
arch/sh/configs/sh7763rdp_defconfig | 116 --
arch/sh/configs/sh7770_generic_defconfig | 43 -
arch/sh/configs/sh7785lcr_32bit_defconfig | 149 --
arch/sh/configs/sh7785lcr_defconfig | 117 --
arch/sh/configs/shmin_defconfig | 52 -
arch/sh/configs/shx3_defconfig | 103 --
arch/sh/configs/titan_defconfig | 272 ---
arch/sh/configs/ul2_defconfig | 84 -
arch/sh/configs/urquell_defconfig | 147 --
arch/sh/drivers/Kconfig | 20 -
arch/sh/drivers/Makefile | 11 -
arch/sh/drivers/dma/Kconfig | 74 -
arch/sh/drivers/dma/Makefile | 9 -
arch/sh/drivers/dma/dma-api.c | 417 -----
arch/sh/drivers/dma/dma-g2.c | 197 --
arch/sh/drivers/dma/dma-pvr2.c | 102 --
arch/sh/drivers/dma/dma-sh.c | 414 -----
arch/sh/drivers/dma/dma-sysfs.c | 164 --
arch/sh/drivers/dma/dmabrg.c | 196 --
arch/sh/drivers/heartbeat.c | 152 --
arch/sh/drivers/pci/Makefile | 27 -
arch/sh/drivers/pci/common.c | 159 --
arch/sh/drivers/pci/fixups-dreamcast.c | 84 -
arch/sh/drivers/pci/fixups-landisk.c | 57 -
arch/sh/drivers/pci/fixups-r7780rp.c | 18 -
arch/sh/drivers/pci/fixups-rts7751r2d.c | 64 -
arch/sh/drivers/pci/fixups-sdk7780.c | 40 -
arch/sh/drivers/pci/fixups-sdk7786.c | 64 -
arch/sh/drivers/pci/fixups-se7751.c | 113 --
arch/sh/drivers/pci/fixups-sh03.c | 33 -
arch/sh/drivers/pci/fixups-snapgear.c | 37 -
arch/sh/drivers/pci/fixups-titan.c | 36 -
arch/sh/drivers/pci/ops-dreamcast.c | 79 -
arch/sh/drivers/pci/ops-sh4.c | 105 --
arch/sh/drivers/pci/ops-sh7786.c | 168 --
arch/sh/drivers/pci/pci-dreamcast.c | 97 -
arch/sh/drivers/pci/pci-sh4.h | 182 --
arch/sh/drivers/pci/pci-sh7751.c | 179 --
arch/sh/drivers/pci/pci-sh7751.h | 126 --
arch/sh/drivers/pci/pci-sh7780.c | 407 -----
arch/sh/drivers/pci/pci-sh7780.h | 43 -
arch/sh/drivers/pci/pci.c | 298 ---
arch/sh/drivers/pci/pcie-sh7786.c | 609 -------
arch/sh/drivers/pci/pcie-sh7786.h | 577 ------
arch/sh/drivers/platform_early.c | 340 ----
arch/sh/drivers/push-switch.c | 136 --
arch/sh/drivers/superhyway/Makefile | 7 -
arch/sh/drivers/superhyway/ops-sh4-202.c | 168 --
arch/sh/include/asm/Kbuild | 5 -
arch/sh/include/asm/adc.h | 12 -
arch/sh/include/asm/addrspace.h | 63 -
arch/sh/include/asm/alignment.h | 22 -
arch/sh/include/asm/asm-offsets.h | 2 -
arch/sh/include/asm/atomic-grb.h | 86 -
arch/sh/include/asm/atomic-irq.h | 72 -
arch/sh/include/asm/atomic-llsc.h | 88 -
arch/sh/include/asm/atomic.h | 38 -
arch/sh/include/asm/barrier.h | 45 -
arch/sh/include/asm/bitops-cas.h | 94 -
arch/sh/include/asm/bitops-grb.h | 173 --
arch/sh/include/asm/bitops-llsc.h | 147 --
arch/sh/include/asm/bitops-op32.h | 143 --
arch/sh/include/asm/bitops.h | 72 -
arch/sh/include/asm/bl_bit.h | 2 -
arch/sh/include/asm/bl_bit_32.h | 34 -
arch/sh/include/asm/bug.h | 121 --
arch/sh/include/asm/bugs.h | 74 -
arch/sh/include/asm/cache.h | 46 -
arch/sh/include/asm/cache_insns.h | 2 -
arch/sh/include/asm/cache_insns_32.h | 22 -
arch/sh/include/asm/cacheflush.h | 106 --
arch/sh/include/asm/checksum.h | 2 -
arch/sh/include/asm/checksum_32.h | 203 ---
arch/sh/include/asm/clock.h | 17 -
arch/sh/include/asm/cmpxchg-cas.h | 25 -
arch/sh/include/asm/cmpxchg-grb.h | 95 -
arch/sh/include/asm/cmpxchg-irq.h | 54 -
arch/sh/include/asm/cmpxchg-llsc.h | 53 -
arch/sh/include/asm/cmpxchg-xchg.h | 50 -
arch/sh/include/asm/cmpxchg.h | 74 -
arch/sh/include/asm/device.h | 17 -
arch/sh/include/asm/dma-register.h | 50 -
arch/sh/include/asm/dma.h | 140 --
arch/sh/include/asm/dmabrg.h | 24 -
arch/sh/include/asm/dwarf.h | 417 -----
arch/sh/include/asm/elf.h | 211 ---
arch/sh/include/asm/entry-macros.S | 123 --
arch/sh/include/asm/extable.h | 7 -
arch/sh/include/asm/fb.h | 20 -
arch/sh/include/asm/fixmap.h | 86 -
arch/sh/include/asm/flat.h | 33 -
arch/sh/include/asm/fpu.h | 69 -
arch/sh/include/asm/freq.h | 12 -
arch/sh/include/asm/ftrace.h | 48 -
arch/sh/include/asm/futex-cas.h | 35 -
arch/sh/include/asm/futex-irq.h | 25 -
arch/sh/include/asm/futex-llsc.h | 42 -
arch/sh/include/asm/futex.h | 72 -
arch/sh/include/asm/gpio.h | 50 -
arch/sh/include/asm/hardirq.h | 11 -
arch/sh/include/asm/hd64461.h | 252 ---
arch/sh/include/asm/heartbeat.h | 19 -
arch/sh/include/asm/hugetlb.h | 38 -
arch/sh/include/asm/hw_breakpoint.h | 70 -
arch/sh/include/asm/hw_irq.h | 36 -
arch/sh/include/asm/i2c-sh7760.h | 21 -
arch/sh/include/asm/io.h | 294 ---
arch/sh/include/asm/io_generic.h | 19 -
arch/sh/include/asm/io_noioport.h | 86 -
arch/sh/include/asm/io_trapped.h | 59 -
arch/sh/include/asm/irq.h | 58 -
arch/sh/include/asm/irqflags.h | 10 -
arch/sh/include/asm/kdebug.h | 19 -
arch/sh/include/asm/kexec.h | 72 -
arch/sh/include/asm/kgdb.h | 38 -
arch/sh/include/asm/kprobes.h | 57 -
arch/sh/include/asm/linkage.h | 8 -
arch/sh/include/asm/machvec.h | 41 -
arch/sh/include/asm/mmiowb.h | 12 -
arch/sh/include/asm/mmu.h | 107 --
arch/sh/include/asm/mmu_context.h | 178 --
arch/sh/include/asm/mmu_context_32.h | 51 -
arch/sh/include/asm/mmzone.h | 45 -
arch/sh/include/asm/module.h | 14 -
arch/sh/include/asm/page.h | 186 --
arch/sh/include/asm/pci.h | 91 -
arch/sh/include/asm/perf_event.h | 30 -
arch/sh/include/asm/pgalloc.h | 40 -
arch/sh/include/asm/pgtable-2level.h | 24 -
arch/sh/include/asm/pgtable-3level.h | 59 -
arch/sh/include/asm/pgtable.h | 150 --
arch/sh/include/asm/pgtable_32.h | 462 -----
arch/sh/include/asm/platform_early.h | 61 -
arch/sh/include/asm/posix_types.h | 2 -
arch/sh/include/asm/processor.h | 173 --
arch/sh/include/asm/processor_32.h | 202 ---
arch/sh/include/asm/ptrace.h | 139 --
arch/sh/include/asm/ptrace_32.h | 14 -
arch/sh/include/asm/push-switch.h | 32 -
arch/sh/include/asm/reboot.h | 22 -
arch/sh/include/asm/romimage-macros.h | 74 -
arch/sh/include/asm/rtc.h | 15 -
arch/sh/include/asm/seccomp.h | 21 -
arch/sh/include/asm/sections.h | 12 -
arch/sh/include/asm/setup.h | 25 -
arch/sh/include/asm/sfp-machine.h | 80 -
arch/sh/include/asm/sh7760fb.h | 198 --
arch/sh/include/asm/sh_bios.h | 28 -
arch/sh/include/asm/shmparam.h | 19 -
arch/sh/include/asm/siu.h | 20 -
arch/sh/include/asm/smc37c93x.h | 191 --
arch/sh/include/asm/smp-ops.h | 52 -
arch/sh/include/asm/smp.h | 83 -
arch/sh/include/asm/sparsemem.h | 12 -
arch/sh/include/asm/spi.h | 14 -
arch/sh/include/asm/spinlock-cas.h | 89 -
arch/sh/include/asm/spinlock-llsc.h | 198 --
arch/sh/include/asm/spinlock.h | 19 -
arch/sh/include/asm/spinlock_types.h | 22 -
arch/sh/include/asm/sram.h | 39 -
arch/sh/include/asm/stackprotector.h | 21 -
arch/sh/include/asm/stacktrace.h | 21 -
arch/sh/include/asm/string.h | 2 -
arch/sh/include/asm/string_32.h | 102 --
arch/sh/include/asm/suspend.h | 97 -
arch/sh/include/asm/switch_to.h | 7 -
arch/sh/include/asm/switch_to_32.h | 131 --
arch/sh/include/asm/syscall.h | 9 -
arch/sh/include/asm/syscall_32.h | 69 -
arch/sh/include/asm/syscalls.h | 14 -
arch/sh/include/asm/syscalls_32.h | 27 -
arch/sh/include/asm/thread_info.h | 171 --
arch/sh/include/asm/timex.h | 24 -
arch/sh/include/asm/tlb.h | 29 -
arch/sh/include/asm/tlbflush.h | 52 -
arch/sh/include/asm/topology.h | 28 -
arch/sh/include/asm/traps.h | 18 -
arch/sh/include/asm/traps_32.h | 61 -
arch/sh/include/asm/types.h | 16 -
arch/sh/include/asm/uaccess.h | 133 --
arch/sh/include/asm/uaccess_32.h | 227 ---
arch/sh/include/asm/uncached.h | 59 -
arch/sh/include/asm/unistd.h | 31 -
arch/sh/include/asm/unwinder.h | 32 -
arch/sh/include/asm/user.h | 55 -
arch/sh/include/asm/vermagic.h | 30 -
arch/sh/include/asm/vga.h | 7 -
arch/sh/include/asm/vmalloc.h | 4 -
arch/sh/include/asm/vmlinux.lds.h | 18 -
arch/sh/include/asm/watchdog.h | 159 --
arch/sh/include/asm/word-at-a-time.h | 54 -
arch/sh/include/cpu-common/cpu/addrspace.h | 16 -
arch/sh/include/cpu-common/cpu/mmu_context.h | 13 -
arch/sh/include/cpu-common/cpu/pfc.h | 18 -
arch/sh/include/cpu-common/cpu/rtc.h | 9 -
arch/sh/include/cpu-common/cpu/sigcontext.h | 18 -
arch/sh/include/cpu-common/cpu/timer.h | 7 -
arch/sh/include/cpu-sh2/cpu/cache.h | 40 -
arch/sh/include/cpu-sh2/cpu/freq.h | 15 -
arch/sh/include/cpu-sh2/cpu/watchdog.h | 66 -
arch/sh/include/cpu-sh2a/cpu/addrspace.h | 11 -
arch/sh/include/cpu-sh2a/cpu/cache.h | 40 -
arch/sh/include/cpu-sh2a/cpu/freq.h | 13 -
arch/sh/include/cpu-sh2a/cpu/rtc.h | 9 -
arch/sh/include/cpu-sh2a/cpu/sh7203.h | 144 --
arch/sh/include/cpu-sh2a/cpu/sh7264.h | 169 --
arch/sh/include/cpu-sh2a/cpu/sh7269.h | 213 ---
arch/sh/include/cpu-sh2a/cpu/watchdog.h | 2 -
arch/sh/include/cpu-sh3/cpu/adc.h | 29 -
arch/sh/include/cpu-sh3/cpu/cache.h | 40 -
arch/sh/include/cpu-sh3/cpu/dac.h | 42 -
arch/sh/include/cpu-sh3/cpu/dma-register.h | 38 -
arch/sh/include/cpu-sh3/cpu/dma.h | 19 -
arch/sh/include/cpu-sh3/cpu/freq.h | 24 -
arch/sh/include/cpu-sh3/cpu/gpio.h | 78 -
arch/sh/include/cpu-sh3/cpu/mmu_context.h | 42 -
arch/sh/include/cpu-sh3/cpu/serial.h | 11 -
arch/sh/include/cpu-sh3/cpu/sh7720.h | 175 --
arch/sh/include/cpu-sh3/cpu/watchdog.h | 22 -
arch/sh/include/cpu-sh4/cpu/addrspace.h | 41 -
arch/sh/include/cpu-sh4/cpu/cache.h | 41 -
arch/sh/include/cpu-sh4/cpu/dma-register.h | 98 -
arch/sh/include/cpu-sh4/cpu/dma.h | 18 -
arch/sh/include/cpu-sh4/cpu/fpu.h | 30 -
arch/sh/include/cpu-sh4/cpu/freq.h | 74 -
arch/sh/include/cpu-sh4/cpu/mmu_context.h | 79 -
arch/sh/include/cpu-sh4/cpu/rtc.h | 14 -
arch/sh/include/cpu-sh4/cpu/sh7722.h | 252 ---
arch/sh/include/cpu-sh4/cpu/sh7723.h | 285 ---
arch/sh/include/cpu-sh4/cpu/sh7724.h | 319 ----
arch/sh/include/cpu-sh4/cpu/sh7734.h | 307 ----
arch/sh/include/cpu-sh4/cpu/sh7757.h | 290 ---
arch/sh/include/cpu-sh4/cpu/sh7785.h | 260 ---
arch/sh/include/cpu-sh4/cpu/sh7786.h | 138 --
arch/sh/include/cpu-sh4/cpu/shx3.h | 65 -
arch/sh/include/cpu-sh4/cpu/sigcontext.h | 25 -
arch/sh/include/cpu-sh4/cpu/sq.h | 33 -
arch/sh/include/cpu-sh4/cpu/watchdog.h | 41 -
arch/sh/include/cpu-sh4a/cpu/dma.h | 72 -
arch/sh/include/cpu-sh4a/cpu/serial.h | 8 -
arch/sh/include/mach-common/mach/highlander.h | 208 ---
arch/sh/include/mach-common/mach/hp6xx.h | 59 -
arch/sh/include/mach-common/mach/lboxre2.h | 24 -
.../include/mach-common/mach/magicpanelr2.h | 64 -
.../sh/include/mach-common/mach/mangle-port.h | 46 -
arch/sh/include/mach-common/mach/microdev.h | 69 -
arch/sh/include/mach-common/mach/r2d.h | 71 -
arch/sh/include/mach-common/mach/romimage.h | 12 -
arch/sh/include/mach-common/mach/sdk7780.h | 79 -
.../include/mach-common/mach/secureedge5410.h | 47 -
arch/sh/include/mach-common/mach/sh2007.h | 118 --
arch/sh/include/mach-common/mach/sh7763rdp.h | 50 -
arch/sh/include/mach-common/mach/sh7785lcr.h | 58 -
arch/sh/include/mach-common/mach/shmin.h | 10 -
arch/sh/include/mach-common/mach/titan.h | 20 -
arch/sh/include/mach-common/mach/urquell.h | 69 -
arch/sh/include/mach-dreamcast/mach/dma.h | 29 -
arch/sh/include/mach-dreamcast/mach/maple.h | 38 -
arch/sh/include/mach-dreamcast/mach/pci.h | 24 -
arch/sh/include/mach-dreamcast/mach/sysasic.h | 46 -
.../mach-ecovec24/mach/partner-jet-setup.txt | 82 -
arch/sh/include/mach-ecovec24/mach/romimage.h | 48 -
arch/sh/include/mach-kfr2r09/mach/kfr2r09.h | 24 -
.../mach-kfr2r09/mach/partner-jet-setup.txt | 144 --
arch/sh/include/mach-kfr2r09/mach/romimage.h | 31 -
arch/sh/include/mach-landisk/mach/gio.h | 38 -
.../mach-landisk/mach/iodata_landisk.h | 46 -
arch/sh/include/mach-migor/mach/migor.h | 16 -
arch/sh/include/mach-sdk7786/mach/fpga.h | 156 --
arch/sh/include/mach-sdk7786/mach/irq.h | 8 -
arch/sh/include/mach-se/mach/mrshpc.h | 53 -
arch/sh/include/mach-se/mach/se.h | 120 --
arch/sh/include/mach-se/mach/se7206.h | 14 -
arch/sh/include/mach-se/mach/se7343.h | 143 --
arch/sh/include/mach-se/mach/se7721.h | 68 -
arch/sh/include/mach-se/mach/se7722.h | 98 -
arch/sh/include/mach-se/mach/se7724.h | 69 -
arch/sh/include/mach-se/mach/se7751.h | 75 -
arch/sh/include/mach-se/mach/se7780.h | 106 --
arch/sh/include/mach-sh03/mach/io.h | 26 -
arch/sh/include/mach-sh03/mach/sh03.h | 19 -
arch/sh/include/mach-x3proto/mach/hardware.h | 13 -
arch/sh/include/mach-x3proto/mach/ilsel.h | 46 -
arch/sh/include/uapi/asm/Kbuild | 4 -
arch/sh/include/uapi/asm/auxvec.h | 39 -
arch/sh/include/uapi/asm/byteorder.h | 11 -
arch/sh/include/uapi/asm/cachectl.h | 20 -
arch/sh/include/uapi/asm/cpu-features.h | 28 -
arch/sh/include/uapi/asm/hw_breakpoint.h | 5 -
arch/sh/include/uapi/asm/ioctls.h | 116 --
arch/sh/include/uapi/asm/posix_types.h | 2 -
arch/sh/include/uapi/asm/posix_types_32.h | 23 -
arch/sh/include/uapi/asm/ptrace.h | 30 -
arch/sh/include/uapi/asm/ptrace_32.h | 78 -
arch/sh/include/uapi/asm/sigcontext.h | 25 -
arch/sh/include/uapi/asm/signal.h | 18 -
arch/sh/include/uapi/asm/sockios.h | 18 -
arch/sh/include/uapi/asm/stat.h | 78 -
arch/sh/include/uapi/asm/swab.h | 50 -
arch/sh/include/uapi/asm/unistd.h | 2 -
arch/sh/kernel/.gitignore | 2 -
arch/sh/kernel/Makefile | 49 -
arch/sh/kernel/asm-offsets.c | 60 -
arch/sh/kernel/cpu/Makefile | 21 -
arch/sh/kernel/cpu/adc.c | 37 -
arch/sh/kernel/cpu/clock-cpg.c | 78 -
arch/sh/kernel/cpu/clock.c | 52 -
arch/sh/kernel/cpu/fpu.c | 92 -
arch/sh/kernel/cpu/init.c | 366 ----
arch/sh/kernel/cpu/irq/Makefile | 6 -
arch/sh/kernel/cpu/irq/imask.c | 85 -
arch/sh/kernel/cpu/irq/ipr.c | 80 -
arch/sh/kernel/cpu/pfc.c | 25 -
arch/sh/kernel/cpu/proc.c | 151 --
arch/sh/kernel/cpu/sh2/Makefile | 12 -
arch/sh/kernel/cpu/sh2/clock-sh7619.c | 74 -
arch/sh/kernel/cpu/sh2/entry.S | 373 ----
arch/sh/kernel/cpu/sh2/ex.S | 44 -
arch/sh/kernel/cpu/sh2/probe.c | 71 -
arch/sh/kernel/cpu/sh2/setup-sh7619.c | 205 ---
arch/sh/kernel/cpu/sh2/smp-j2.c | 136 --
arch/sh/kernel/cpu/sh2a/Makefile | 25 -
arch/sh/kernel/cpu/sh2a/clock-sh7201.c | 82 -
arch/sh/kernel/cpu/sh2a/clock-sh7203.c | 78 -
arch/sh/kernel/cpu/sh2a/clock-sh7206.c | 80 -
arch/sh/kernel/cpu/sh2a/clock-sh7264.c | 157 --
arch/sh/kernel/cpu/sh2a/clock-sh7269.c | 181 --
arch/sh/kernel/cpu/sh2a/entry.S | 247 ---
arch/sh/kernel/cpu/sh2a/ex.S | 70 -
arch/sh/kernel/cpu/sh2a/fpu.c | 572 ------
arch/sh/kernel/cpu/sh2a/opcode_helper.c | 51 -
arch/sh/kernel/cpu/sh2a/pinmux-sh7203.c | 27 -
arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c | 27 -
arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c | 28 -
arch/sh/kernel/cpu/sh2a/probe.c | 57 -
arch/sh/kernel/cpu/sh2a/setup-mxg.c | 175 --
arch/sh/kernel/cpu/sh2a/setup-sh7201.c | 418 -----
arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 355 ----
arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 291 ---
arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 552 ------
arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 568 ------
arch/sh/kernel/cpu/sh3/Makefile | 34 -
arch/sh/kernel/cpu/sh3/clock-sh3.c | 86 -
arch/sh/kernel/cpu/sh3/clock-sh7705.c | 81 -
arch/sh/kernel/cpu/sh3/clock-sh7706.c | 81 -
arch/sh/kernel/cpu/sh3/clock-sh7709.c | 82 -
arch/sh/kernel/cpu/sh3/clock-sh7710.c | 75 -
arch/sh/kernel/cpu/sh3/clock-sh7712.c | 68 -
arch/sh/kernel/cpu/sh3/entry.S | 509 ------
arch/sh/kernel/cpu/sh3/ex.S | 56 -
arch/sh/kernel/cpu/sh3/pinmux-sh7720.c | 27 -
arch/sh/kernel/cpu/sh3/probe.c | 108 --
arch/sh/kernel/cpu/sh3/serial-sh770x.c | 34 -
arch/sh/kernel/cpu/sh3/serial-sh7710.c | 21 -
arch/sh/kernel/cpu/sh3/serial-sh7720.c | 38 -
arch/sh/kernel/cpu/sh3/setup-sh3.c | 69 -
arch/sh/kernel/cpu/sh3/setup-sh7705.c | 190 --
arch/sh/kernel/cpu/sh3/setup-sh770x.c | 246 ---
arch/sh/kernel/cpu/sh3/setup-sh7710.c | 189 --
arch/sh/kernel/cpu/sh3/setup-sh7720.c | 286 ---
arch/sh/kernel/cpu/sh3/swsusp.S | 144 --
arch/sh/kernel/cpu/sh4/Makefile | 37 -
arch/sh/kernel/cpu/sh4/clock-sh4-202.c | 174 --
arch/sh/kernel/cpu/sh4/clock-sh4.c | 77 -
arch/sh/kernel/cpu/sh4/fpu.c | 425 -----
arch/sh/kernel/cpu/sh4/perf_event.c | 265 ---
arch/sh/kernel/cpu/sh4/probe.c | 260 ---
arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 139 --
arch/sh/kernel/cpu/sh4/setup-sh7750.c | 359 ----
arch/sh/kernel/cpu/sh4/setup-sh7760.c | 297 ---
arch/sh/kernel/cpu/sh4/softfloat.c | 930 ----------
arch/sh/kernel/cpu/sh4/sq.c | 414 -----
arch/sh/kernel/cpu/sh4a/Makefile | 53 -
arch/sh/kernel/cpu/sh4a/clock-sh7343.c | 277 ---
arch/sh/kernel/cpu/sh4a/clock-sh7366.c | 270 ---
arch/sh/kernel/cpu/sh4a/clock-sh7722.c | 253 ---
arch/sh/kernel/cpu/sh4a/clock-sh7723.c | 301 ----
arch/sh/kernel/cpu/sh4a/clock-sh7724.c | 367 ----
arch/sh/kernel/cpu/sh4a/clock-sh7734.c | 256 ---
arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 152 --
arch/sh/kernel/cpu/sh4a/clock-sh7763.c | 116 --
arch/sh/kernel/cpu/sh4a/clock-sh7770.c | 70 -
arch/sh/kernel/cpu/sh4a/clock-sh7780.c | 122 --
arch/sh/kernel/cpu/sh4a/clock-sh7785.c | 174 --
arch/sh/kernel/cpu/sh4a/clock-sh7786.c | 189 --
arch/sh/kernel/cpu/sh4a/clock-shx3.c | 148 --
arch/sh/kernel/cpu/sh4a/intc-shx3.c | 31 -
arch/sh/kernel/cpu/sh4a/perf_event.c | 299 ---
arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c | 21 -
arch/sh/kernel/cpu/sh4a/pinmux-sh7723.c | 27 -
arch/sh/kernel/cpu/sh4a/pinmux-sh7724.c | 32 -
arch/sh/kernel/cpu/sh4a/pinmux-sh7734.c | 32 -
arch/sh/kernel/cpu/sh4a/pinmux-sh7757.c | 32 -
arch/sh/kernel/cpu/sh4a/pinmux-sh7785.c | 27 -
arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c | 32 -
arch/sh/kernel/cpu/sh4a/pinmux-shx3.c | 26 -
arch/sh/kernel/cpu/sh4a/serial-sh7722.c | 24 -
arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 444 -----
arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 388 ----
arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 666 -------
arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 644 -------
arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 1288 -------------
arch/sh/kernel/cpu/sh4a/setup-sh7734.c | 621 -------
arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 1242 -------------
arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 455 -----
arch/sh/kernel/cpu/sh4a/setup-sh7770.c | 571 ------
arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 505 ------
arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 608 -------
arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 841 ---------
arch/sh/kernel/cpu/sh4a/setup-shx3.c | 396 ----
arch/sh/kernel/cpu/sh4a/smp-shx3.c | 146 --
arch/sh/kernel/cpu/sh4a/ubc.c | 130 --
arch/sh/kernel/cpu/shmobile/Makefile | 8 -
arch/sh/kernel/cpu/shmobile/cpuidle.c | 95 -
arch/sh/kernel/cpu/shmobile/pm.c | 153 --
arch/sh/kernel/cpu/shmobile/sleep.S | 402 -----
arch/sh/kernel/crash_dump.c | 27 -
arch/sh/kernel/debugtraps.S | 38 -
arch/sh/kernel/disassemble.c | 572 ------
arch/sh/kernel/dma-coherent.c | 33 -
arch/sh/kernel/dumpstack.c | 156 --
arch/sh/kernel/dwarf.c | 1206 -------------
arch/sh/kernel/entry-common.S | 400 ----
arch/sh/kernel/ftrace.c | 365 ----
arch/sh/kernel/head_32.S | 365 ----
arch/sh/kernel/hw_breakpoint.c | 408 -----
arch/sh/kernel/idle.c | 57 -
arch/sh/kernel/io.c | 111 --
arch/sh/kernel/io_trapped.c | 291 ---
arch/sh/kernel/iomap.c | 162 --
arch/sh/kernel/ioport.c | 41 -
arch/sh/kernel/irq.c | 249 ---
arch/sh/kernel/irq_32.c | 54 -
arch/sh/kernel/kdebugfs.c | 14 -
arch/sh/kernel/kgdb.c | 378 ----
arch/sh/kernel/kprobes.c | 452 -----
arch/sh/kernel/machine_kexec.c | 204 ---
arch/sh/kernel/machvec.c | 122 --
arch/sh/kernel/module.c | 104 --
arch/sh/kernel/nmi_debug.c | 75 -
arch/sh/kernel/perf_callchain.c | 32 -
arch/sh/kernel/perf_event.c | 363 ----
arch/sh/kernel/process.c | 77 -
arch/sh/kernel/process_32.c | 197 --
arch/sh/kernel/ptrace.c | 34 -
arch/sh/kernel/ptrace_32.c | 487 -----
arch/sh/kernel/reboot.c | 96 -
arch/sh/kernel/relocate_kernel.S | 230 ---
arch/sh/kernel/return_address.c | 56 -
arch/sh/kernel/setup.c | 356 ----
arch/sh/kernel/sh_bios.c | 169 --
arch/sh/kernel/sh_ksyms_32.c | 118 --
arch/sh/kernel/signal_32.c | 507 ------
arch/sh/kernel/smp.c | 471 -----
arch/sh/kernel/stacktrace.c | 79 -
arch/sh/kernel/swsusp.c | 35 -
arch/sh/kernel/sys_sh.c | 96 -
arch/sh/kernel/sys_sh32.c | 61 -
arch/sh/kernel/syscalls/Makefile | 32 -
arch/sh/kernel/syscalls/syscall.tbl | 455 -----
arch/sh/kernel/syscalls_32.S | 17 -
arch/sh/kernel/time.c | 45 -
arch/sh/kernel/topology.c | 74 -
arch/sh/kernel/traps.c | 204 ---
arch/sh/kernel/traps_32.c | 795 --------
arch/sh/kernel/unwinder.c | 165 --
arch/sh/kernel/vmlinux.lds.S | 82 -
arch/sh/kernel/vsyscall/.gitignore | 2 -
arch/sh/kernel/vsyscall/Makefile | 36 -
arch/sh/kernel/vsyscall/vsyscall-note.S | 26 -
arch/sh/kernel/vsyscall/vsyscall-sigreturn.S | 75 -
arch/sh/kernel/vsyscall/vsyscall-syscall.S | 11 -
arch/sh/kernel/vsyscall/vsyscall-trapa.S | 40 -
arch/sh/kernel/vsyscall/vsyscall.c | 93 -
arch/sh/kernel/vsyscall/vsyscall.lds.S | 85 -
arch/sh/lib/Makefile | 32 -
arch/sh/lib/__clear_user.S | 109 --
arch/sh/lib/ashiftrt.S | 128 --
arch/sh/lib/ashldi3.c | 30 -
arch/sh/lib/ashlsi3.S | 189 --
arch/sh/lib/ashrdi3.c | 32 -
arch/sh/lib/ashrsi3.S | 179 --
arch/sh/lib/checksum.S | 365 ----
arch/sh/lib/copy_page.S | 390 ----
arch/sh/lib/delay.c | 54 -
arch/sh/lib/div64-generic.c | 20 -
arch/sh/lib/div64.S | 47 -
arch/sh/lib/io.c | 79 -
arch/sh/lib/libgcc.h | 27 -
arch/sh/lib/lshrdi3.c | 30 -
arch/sh/lib/lshrsi3.S | 188 --
arch/sh/lib/mcount.S | 287 ---
arch/sh/lib/memchr.S | 27 -
arch/sh/lib/memcpy-sh4.S | 800 --------
arch/sh/lib/memcpy.S | 228 ---
arch/sh/lib/memmove.S | 255 ---
arch/sh/lib/memset-sh4.S | 108 --
arch/sh/lib/memset.S | 59 -
arch/sh/lib/movmem.S | 217 ---
arch/sh/lib/strlen.S | 71 -
arch/sh/lib/udiv_qrnnd.S | 60 -
arch/sh/lib/udivsi3.S | 66 -
arch/sh/lib/udivsi3_i4i-Os.S | 128 --
arch/sh/lib/udivsi3_i4i.S | 645 -------
arch/sh/math-emu/Makefile | 2 -
arch/sh/math-emu/math.c | 506 ------
arch/sh/math-emu/sfp-util.h | 73 -
arch/sh/mm/Kconfig | 254 ---
arch/sh/mm/Makefile | 45 -
arch/sh/mm/alignment.c | 189 --
arch/sh/mm/asids-debugfs.c | 59 -
arch/sh/mm/cache-debugfs.c | 109 --
arch/sh/mm/cache-j2.c | 64 -
arch/sh/mm/cache-sh2.c | 90 -
arch/sh/mm/cache-sh2a.c | 188 --
arch/sh/mm/cache-sh3.c | 102 --
arch/sh/mm/cache-sh4.c | 390 ----
arch/sh/mm/cache-sh7705.c | 194 --
arch/sh/mm/cache-shx3.c | 44 -
arch/sh/mm/cache.c | 360 ----
arch/sh/mm/consistent.c | 65 -
arch/sh/mm/extable_32.c | 24 -
arch/sh/mm/fault.c | 504 ------
arch/sh/mm/flush-sh4.c | 111 --
arch/sh/mm/hugetlbpage.c | 82 -
arch/sh/mm/init.c | 424 -----
arch/sh/mm/ioremap.c | 192 --
arch/sh/mm/ioremap.h | 23 -
arch/sh/mm/ioremap_fixed.c | 135 --
arch/sh/mm/kmap.c | 65 -
arch/sh/mm/mmap.c | 184 --
arch/sh/mm/nommu.c | 98 -
arch/sh/mm/numa.c | 56 -
arch/sh/mm/pgtable.c | 57 -
arch/sh/mm/pmb.c | 887 ---------
arch/sh/mm/sram.c | 35 -
arch/sh/mm/tlb-debugfs.c | 160 --
arch/sh/mm/tlb-pteaex.c | 106 --
arch/sh/mm/tlb-sh3.c | 95 -
arch/sh/mm/tlb-sh4.c | 108 --
arch/sh/mm/tlb-urb.c | 93 -
arch/sh/mm/tlbex_32.c | 82 -
arch/sh/mm/tlbflush_32.c | 137 --
arch/sh/mm/uncached.c | 44 -
arch/sh/tools/Makefile | 16 -
arch/sh/tools/gen-mach-types | 48 -
arch/sh/tools/mach-types | 67 -
drivers/clocksource/sh_cmt.c | 8 -
drivers/clocksource/sh_mtu2.c | 8 -
drivers/clocksource/sh_tmu.c | 8 -
drivers/i2c/busses/Kconfig | 4 +-
drivers/media/platform/renesas/Kconfig | 2 +-
drivers/mmc/host/Kconfig | 6 +-
drivers/mmc/host/sh_mmcif.c | 21 +-
drivers/net/ethernet/8390/Kconfig | 2 +-
drivers/net/ethernet/renesas/Kconfig | 2 +-
drivers/net/ethernet/smsc/Kconfig | 4 +-
drivers/rtc/Kconfig | 4 +-
drivers/rtc/rtc-sh.c | 18 +-
drivers/spi/Kconfig | 4 +-
drivers/tty/serial/Kconfig | 3 +-
drivers/tty/serial/sh-sci.c | 57 -
drivers/tty/vt/keyboard.c | 2 +-
drivers/usb/renesas_usbhs/Kconfig | 2 +-
drivers/video/console/Kconfig | 2 +-
drivers/video/logo/Kconfig | 15 -
drivers/video/logo/Makefile | 3 -
drivers/video/logo/logo.c | 12 -
drivers/video/logo/logo_superh_clut224.ppm | 1604 -----------------
drivers/video/logo/logo_superh_vga16.ppm | 1604 -----------------
fs/Kconfig.binfmt | 2 +-
fs/minix/Kconfig | 2 +-
include/linux/cpuhotplug.h | 1 -
include/linux/sh_intc.h | 4 -
init/Kconfig | 2 +-
kernel/sysctl.c | 3 +-
lib/Kconfig.debug | 2 +-
lib/math/div64.c | 4 +-
lib/test_user_copy.c | 3 +-
scripts/coccinelle/misc/cond_no_effect.cocci | 13 +-
scripts/head-object-list.txt | 1 -
sound/soc/sh/Kconfig | 4 +-
tools/include/asm/barrier.h | 2 -
tools/perf/util/dwarf-regs.c | 1 -
785 files changed, 36 insertions(+), 97715 deletions(-)
delete mode 100644 Documentation/sh/booting.rst
delete mode 100644 Documentation/sh/features.rst
delete mode 100644 Documentation/sh/index.rst
delete mode 100644 Documentation/sh/new-machine.rst
delete mode 100644 Documentation/sh/register-banks.rst
delete mode 100644 arch/sh/Kbuild
delete mode 100644 arch/sh/Kconfig
delete mode 100644 arch/sh/Kconfig.cpu
delete mode 100644 arch/sh/Kconfig.debug
delete mode 100644 arch/sh/Makefile
delete mode 100644 arch/sh/boards/Kconfig
delete mode 100644 arch/sh/boards/Makefile
delete mode 100644 arch/sh/boards/board-apsh4a3a.c
delete mode 100644 arch/sh/boards/board-apsh4ad0a.c
delete mode 100644 arch/sh/boards/board-edosk7705.c
delete mode 100644 arch/sh/boards/board-edosk7760.c
delete mode 100644 arch/sh/boards/board-espt.c
delete mode 100644 arch/sh/boards/board-magicpanelr2.c
delete mode 100644 arch/sh/boards/board-polaris.c
delete mode 100644 arch/sh/boards/board-secureedge5410.c
delete mode 100644 arch/sh/boards/board-sh2007.c
delete mode 100644 arch/sh/boards/board-sh7757lcr.c
delete mode 100644 arch/sh/boards/board-sh7785lcr.c
delete mode 100644 arch/sh/boards/board-shmin.c
delete mode 100644 arch/sh/boards/board-titan.c
delete mode 100644 arch/sh/boards/board-urquell.c
delete mode 100644 arch/sh/boards/mach-ap325rxa/Makefile
delete mode 100644 arch/sh/boards/mach-ap325rxa/sdram.S
delete mode 100644 arch/sh/boards/mach-ap325rxa/setup.c
delete mode 100644 arch/sh/boards/mach-dreamcast/Makefile
delete mode 100644 arch/sh/boards/mach-dreamcast/irq.c
delete mode 100644 arch/sh/boards/mach-dreamcast/rtc.c
delete mode 100644 arch/sh/boards/mach-dreamcast/setup.c
delete mode 100644 arch/sh/boards/mach-ecovec24/Makefile
delete mode 100644 arch/sh/boards/mach-ecovec24/sdram.S
delete mode 100644 arch/sh/boards/mach-ecovec24/setup.c
delete mode 100644 arch/sh/boards/mach-highlander/Kconfig
delete mode 100644 arch/sh/boards/mach-highlander/Makefile
delete mode 100644 arch/sh/boards/mach-highlander/irq-r7780mp.c
delete mode 100644 arch/sh/boards/mach-highlander/irq-r7780rp.c
delete mode 100644 arch/sh/boards/mach-highlander/irq-r7785rp.c
delete mode 100644 arch/sh/boards/mach-highlander/pinmux-r7785rp.c
delete mode 100644 arch/sh/boards/mach-highlander/psw.c
delete mode 100644 arch/sh/boards/mach-highlander/setup.c
delete mode 100644 arch/sh/boards/mach-hp6xx/Makefile
delete mode 100644 arch/sh/boards/mach-hp6xx/hp6xx_apm.c
delete mode 100644 arch/sh/boards/mach-hp6xx/pm.c
delete mode 100644 arch/sh/boards/mach-hp6xx/pm_wakeup.S
delete mode 100644 arch/sh/boards/mach-hp6xx/setup.c
delete mode 100644 arch/sh/boards/mach-kfr2r09/Makefile
delete mode 100644 arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
delete mode 100644 arch/sh/boards/mach-kfr2r09/sdram.S
delete mode 100644 arch/sh/boards/mach-kfr2r09/setup.c
delete mode 100644 arch/sh/boards/mach-landisk/Makefile
delete mode 100644 arch/sh/boards/mach-landisk/gio.c
delete mode 100644 arch/sh/boards/mach-landisk/irq.c
delete mode 100644 arch/sh/boards/mach-landisk/psw.c
delete mode 100644 arch/sh/boards/mach-landisk/setup.c
delete mode 100644 arch/sh/boards/mach-lboxre2/Makefile
delete mode 100644 arch/sh/boards/mach-lboxre2/irq.c
delete mode 100644 arch/sh/boards/mach-lboxre2/setup.c
delete mode 100644 arch/sh/boards/mach-microdev/Makefile
delete mode 100644 arch/sh/boards/mach-microdev/fdc37c93xapm.c
delete mode 100644 arch/sh/boards/mach-microdev/io.c
delete mode 100644 arch/sh/boards/mach-microdev/irq.c
delete mode 100644 arch/sh/boards/mach-microdev/setup.c
delete mode 100644 arch/sh/boards/mach-migor/Kconfig
delete mode 100644 arch/sh/boards/mach-migor/Makefile
delete mode 100644 arch/sh/boards/mach-migor/lcd_qvga.c
delete mode 100644 arch/sh/boards/mach-migor/sdram.S
delete mode 100644 arch/sh/boards/mach-migor/setup.c
delete mode 100644 arch/sh/boards/mach-r2d/Kconfig
delete mode 100644 arch/sh/boards/mach-r2d/Makefile
delete mode 100644 arch/sh/boards/mach-r2d/irq.c
delete mode 100644 arch/sh/boards/mach-r2d/setup.c
delete mode 100644 arch/sh/boards/mach-rsk/Kconfig
delete mode 100644 arch/sh/boards/mach-rsk/Makefile
delete mode 100644 arch/sh/boards/mach-rsk/devices-rsk7203.c
delete mode 100644 arch/sh/boards/mach-rsk/devices-rsk7264.c
delete mode 100644 arch/sh/boards/mach-rsk/devices-rsk7269.c
delete mode 100644 arch/sh/boards/mach-rsk/setup.c
delete mode 100644 arch/sh/boards/mach-sdk7780/Kconfig
delete mode 100644 arch/sh/boards/mach-sdk7780/Makefile
delete mode 100644 arch/sh/boards/mach-sdk7780/irq.c
delete mode 100644 arch/sh/boards/mach-sdk7780/setup.c
delete mode 100644 arch/sh/boards/mach-sdk7786/Makefile
delete mode 100644 arch/sh/boards/mach-sdk7786/fpga.c
delete mode 100644 arch/sh/boards/mach-sdk7786/gpio.c
delete mode 100644 arch/sh/boards/mach-sdk7786/irq.c
delete mode 100644 arch/sh/boards/mach-sdk7786/nmi.c
delete mode 100644 arch/sh/boards/mach-sdk7786/setup.c
delete mode 100644 arch/sh/boards/mach-sdk7786/sram.c
delete mode 100644 arch/sh/boards/mach-se/7206/Makefile
delete mode 100644 arch/sh/boards/mach-se/7206/irq.c
delete mode 100644 arch/sh/boards/mach-se/7206/setup.c
delete mode 100644 arch/sh/boards/mach-se/7343/Makefile
delete mode 100644 arch/sh/boards/mach-se/7343/irq.c
delete mode 100644 arch/sh/boards/mach-se/7343/setup.c
delete mode 100644 arch/sh/boards/mach-se/770x/Makefile
delete mode 100644 arch/sh/boards/mach-se/770x/irq.c
delete mode 100644 arch/sh/boards/mach-se/770x/setup.c
delete mode 100644 arch/sh/boards/mach-se/7721/Makefile
delete mode 100644 arch/sh/boards/mach-se/7721/irq.c
delete mode 100644 arch/sh/boards/mach-se/7721/setup.c
delete mode 100644 arch/sh/boards/mach-se/7722/Makefile
delete mode 100644 arch/sh/boards/mach-se/7722/irq.c
delete mode 100644 arch/sh/boards/mach-se/7722/setup.c
delete mode 100644 arch/sh/boards/mach-se/7724/Makefile
delete mode 100644 arch/sh/boards/mach-se/7724/irq.c
delete mode 100644 arch/sh/boards/mach-se/7724/sdram.S
delete mode 100644 arch/sh/boards/mach-se/7724/setup.c
delete mode 100644 arch/sh/boards/mach-se/7751/Makefile
delete mode 100644 arch/sh/boards/mach-se/7751/irq.c
delete mode 100644 arch/sh/boards/mach-se/7751/setup.c
delete mode 100644 arch/sh/boards/mach-se/7780/Makefile
delete mode 100644 arch/sh/boards/mach-se/7780/irq.c
delete mode 100644 arch/sh/boards/mach-se/7780/setup.c
delete mode 100644 arch/sh/boards/mach-se/Makefile
delete mode 100644 arch/sh/boards/mach-se/board-se7619.c
delete mode 100644 arch/sh/boards/mach-sh03/Makefile
delete mode 100644 arch/sh/boards/mach-sh03/rtc.c
delete mode 100644 arch/sh/boards/mach-sh03/setup.c
delete mode 100644 arch/sh/boards/mach-sh7763rdp/Makefile
delete mode 100644 arch/sh/boards/mach-sh7763rdp/irq.c
delete mode 100644 arch/sh/boards/mach-sh7763rdp/setup.c
delete mode 100644 arch/sh/boards/mach-x3proto/Makefile
delete mode 100644 arch/sh/boards/mach-x3proto/gpio.c
delete mode 100644 arch/sh/boards/mach-x3proto/ilsel.c
delete mode 100644 arch/sh/boards/mach-x3proto/setup.c
delete mode 100644 arch/sh/boards/of-generic.c
delete mode 100644 arch/sh/boot/.gitignore
delete mode 100644 arch/sh/boot/Makefile
delete mode 100644 arch/sh/boot/compressed/.gitignore
delete mode 100644 arch/sh/boot/compressed/Makefile
delete mode 100644 arch/sh/boot/compressed/ashiftrt.S
delete mode 100644 arch/sh/boot/compressed/ashldi3.c
delete mode 100644 arch/sh/boot/compressed/ashlsi3.S
delete mode 100644 arch/sh/boot/compressed/ashrsi3.S
delete mode 100644 arch/sh/boot/compressed/cache.c
delete mode 100644 arch/sh/boot/compressed/head_32.S
delete mode 100644 arch/sh/boot/compressed/head_64.S
delete mode 100644 arch/sh/boot/compressed/lshrsi3.S
delete mode 100644 arch/sh/boot/compressed/misc.c
delete mode 100644 arch/sh/boot/compressed/vmlinux.scr
delete mode 100644 arch/sh/boot/dts/Makefile
delete mode 100644 arch/sh/boot/dts/j2_mimas_v2.dts
delete mode 100644 arch/sh/boot/romimage/Makefile
delete mode 100644 arch/sh/boot/romimage/head.S
delete mode 100644 arch/sh/boot/romimage/mmcif-sh7724.c
delete mode 100644 arch/sh/boot/romimage/vmlinux.scr
delete mode 100644 arch/sh/cchips/Kconfig
delete mode 100644 arch/sh/cchips/hd6446x/Makefile
delete mode 100644 arch/sh/cchips/hd6446x/hd64461.c
delete mode 100644 arch/sh/configs/ap325rxa_defconfig
delete mode 100644 arch/sh/configs/apsh4a3a_defconfig
delete mode 100644 arch/sh/configs/apsh4ad0a_defconfig
delete mode 100644 arch/sh/configs/dreamcast_defconfig
delete mode 100644 arch/sh/configs/ecovec24-romimage_defconfig
delete mode 100644 arch/sh/configs/ecovec24_defconfig
delete mode 100644 arch/sh/configs/edosk7705_defconfig
delete mode 100644 arch/sh/configs/edosk7760_defconfig
delete mode 100644 arch/sh/configs/espt_defconfig
delete mode 100644 arch/sh/configs/hp6xx_defconfig
delete mode 100644 arch/sh/configs/j2_defconfig
delete mode 100644 arch/sh/configs/kfr2r09-romimage_defconfig
delete mode 100644 arch/sh/configs/kfr2r09_defconfig
delete mode 100644 arch/sh/configs/landisk_defconfig
delete mode 100644 arch/sh/configs/lboxre2_defconfig
delete mode 100644 arch/sh/configs/magicpanelr2_defconfig
delete mode 100644 arch/sh/configs/microdev_defconfig
delete mode 100644 arch/sh/configs/migor_defconfig
delete mode 100644 arch/sh/configs/polaris_defconfig
delete mode 100644 arch/sh/configs/r7780mp_defconfig
delete mode 100644 arch/sh/configs/r7785rp_defconfig
delete mode 100644 arch/sh/configs/rsk7201_defconfig
delete mode 100644 arch/sh/configs/rsk7203_defconfig
delete mode 100644 arch/sh/configs/rsk7264_defconfig
delete mode 100644 arch/sh/configs/rsk7269_defconfig
delete mode 100644 arch/sh/configs/rts7751r2d1_defconfig
delete mode 100644 arch/sh/configs/rts7751r2dplus_defconfig
delete mode 100644 arch/sh/configs/sdk7780_defconfig
delete mode 100644 arch/sh/configs/sdk7786_defconfig
delete mode 100644 arch/sh/configs/se7206_defconfig
delete mode 100644 arch/sh/configs/se7343_defconfig
delete mode 100644 arch/sh/configs/se7619_defconfig
delete mode 100644 arch/sh/configs/se7705_defconfig
delete mode 100644 arch/sh/configs/se7712_defconfig
delete mode 100644 arch/sh/configs/se7721_defconfig
delete mode 100644 arch/sh/configs/se7722_defconfig
delete mode 100644 arch/sh/configs/se7724_defconfig
delete mode 100644 arch/sh/configs/se7750_defconfig
delete mode 100644 arch/sh/configs/se7751_defconfig
delete mode 100644 arch/sh/configs/se7780_defconfig
delete mode 100644 arch/sh/configs/secureedge5410_defconfig
delete mode 100644 arch/sh/configs/sh03_defconfig
delete mode 100644 arch/sh/configs/sh2007_defconfig
delete mode 100644 arch/sh/configs/sh7710voipgw_defconfig
delete mode 100644 arch/sh/configs/sh7724_generic_defconfig
delete mode 100644 arch/sh/configs/sh7757lcr_defconfig
delete mode 100644 arch/sh/configs/sh7763rdp_defconfig
delete mode 100644 arch/sh/configs/sh7770_generic_defconfig
delete mode 100644 arch/sh/configs/sh7785lcr_32bit_defconfig
delete mode 100644 arch/sh/configs/sh7785lcr_defconfig
delete mode 100644 arch/sh/configs/shmin_defconfig
delete mode 100644 arch/sh/configs/shx3_defconfig
delete mode 100644 arch/sh/configs/titan_defconfig
delete mode 100644 arch/sh/configs/ul2_defconfig
delete mode 100644 arch/sh/configs/urquell_defconfig
delete mode 100644 arch/sh/drivers/Kconfig
delete mode 100644 arch/sh/drivers/Makefile
delete mode 100644 arch/sh/drivers/dma/Kconfig
delete mode 100644 arch/sh/drivers/dma/Makefile
delete mode 100644 arch/sh/drivers/dma/dma-api.c
delete mode 100644 arch/sh/drivers/dma/dma-g2.c
delete mode 100644 arch/sh/drivers/dma/dma-pvr2.c
delete mode 100644 arch/sh/drivers/dma/dma-sh.c
delete mode 100644 arch/sh/drivers/dma/dma-sysfs.c
delete mode 100644 arch/sh/drivers/dma/dmabrg.c
delete mode 100644 arch/sh/drivers/heartbeat.c
delete mode 100644 arch/sh/drivers/pci/Makefile
delete mode 100644 arch/sh/drivers/pci/common.c
delete mode 100644 arch/sh/drivers/pci/fixups-dreamcast.c
delete mode 100644 arch/sh/drivers/pci/fixups-landisk.c
delete mode 100644 arch/sh/drivers/pci/fixups-r7780rp.c
delete mode 100644 arch/sh/drivers/pci/fixups-rts7751r2d.c
delete mode 100644 arch/sh/drivers/pci/fixups-sdk7780.c
delete mode 100644 arch/sh/drivers/pci/fixups-sdk7786.c
delete mode 100644 arch/sh/drivers/pci/fixups-se7751.c
delete mode 100644 arch/sh/drivers/pci/fixups-sh03.c
delete mode 100644 arch/sh/drivers/pci/fixups-snapgear.c
delete mode 100644 arch/sh/drivers/pci/fixups-titan.c
delete mode 100644 arch/sh/drivers/pci/ops-dreamcast.c
delete mode 100644 arch/sh/drivers/pci/ops-sh4.c
delete mode 100644 arch/sh/drivers/pci/ops-sh7786.c
delete mode 100644 arch/sh/drivers/pci/pci-dreamcast.c
delete mode 100644 arch/sh/drivers/pci/pci-sh4.h
delete mode 100644 arch/sh/drivers/pci/pci-sh7751.c
delete mode 100644 arch/sh/drivers/pci/pci-sh7751.h
delete mode 100644 arch/sh/drivers/pci/pci-sh7780.c
delete mode 100644 arch/sh/drivers/pci/pci-sh7780.h
delete mode 100644 arch/sh/drivers/pci/pci.c
delete mode 100644 arch/sh/drivers/pci/pcie-sh7786.c
delete mode 100644 arch/sh/drivers/pci/pcie-sh7786.h
delete mode 100644 arch/sh/drivers/platform_early.c
delete mode 100644 arch/sh/drivers/push-switch.c
delete mode 100644 arch/sh/drivers/superhyway/Makefile
delete mode 100644 arch/sh/drivers/superhyway/ops-sh4-202.c
delete mode 100644 arch/sh/include/asm/Kbuild
delete mode 100644 arch/sh/include/asm/adc.h
delete mode 100644 arch/sh/include/asm/addrspace.h
delete mode 100644 arch/sh/include/asm/alignment.h
delete mode 100644 arch/sh/include/asm/asm-offsets.h
delete mode 100644 arch/sh/include/asm/atomic-grb.h
delete mode 100644 arch/sh/include/asm/atomic-irq.h
delete mode 100644 arch/sh/include/asm/atomic-llsc.h
delete mode 100644 arch/sh/include/asm/atomic.h
delete mode 100644 arch/sh/include/asm/barrier.h
delete mode 100644 arch/sh/include/asm/bitops-cas.h
delete mode 100644 arch/sh/include/asm/bitops-grb.h
delete mode 100644 arch/sh/include/asm/bitops-llsc.h
delete mode 100644 arch/sh/include/asm/bitops-op32.h
delete mode 100644 arch/sh/include/asm/bitops.h
delete mode 100644 arch/sh/include/asm/bl_bit.h
delete mode 100644 arch/sh/include/asm/bl_bit_32.h
delete mode 100644 arch/sh/include/asm/bug.h
delete mode 100644 arch/sh/include/asm/bugs.h
delete mode 100644 arch/sh/include/asm/cache.h
delete mode 100644 arch/sh/include/asm/cache_insns.h
delete mode 100644 arch/sh/include/asm/cache_insns_32.h
delete mode 100644 arch/sh/include/asm/cacheflush.h
delete mode 100644 arch/sh/include/asm/checksum.h
delete mode 100644 arch/sh/include/asm/checksum_32.h
delete mode 100644 arch/sh/include/asm/clock.h
delete mode 100644 arch/sh/include/asm/cmpxchg-cas.h
delete mode 100644 arch/sh/include/asm/cmpxchg-grb.h
delete mode 100644 arch/sh/include/asm/cmpxchg-irq.h
delete mode 100644 arch/sh/include/asm/cmpxchg-llsc.h
delete mode 100644 arch/sh/include/asm/cmpxchg-xchg.h
delete mode 100644 arch/sh/include/asm/cmpxchg.h
delete mode 100644 arch/sh/include/asm/device.h
delete mode 100644 arch/sh/include/asm/dma-register.h
delete mode 100644 arch/sh/include/asm/dma.h
delete mode 100644 arch/sh/include/asm/dmabrg.h
delete mode 100644 arch/sh/include/asm/dwarf.h
delete mode 100644 arch/sh/include/asm/elf.h
delete mode 100644 arch/sh/include/asm/entry-macros.S
delete mode 100644 arch/sh/include/asm/extable.h
delete mode 100644 arch/sh/include/asm/fb.h
delete mode 100644 arch/sh/include/asm/fixmap.h
delete mode 100644 arch/sh/include/asm/flat.h
delete mode 100644 arch/sh/include/asm/fpu.h
delete mode 100644 arch/sh/include/asm/freq.h
delete mode 100644 arch/sh/include/asm/ftrace.h
delete mode 100644 arch/sh/include/asm/futex-cas.h
delete mode 100644 arch/sh/include/asm/futex-irq.h
delete mode 100644 arch/sh/include/asm/futex-llsc.h
delete mode 100644 arch/sh/include/asm/futex.h
delete mode 100644 arch/sh/include/asm/gpio.h
delete mode 100644 arch/sh/include/asm/hardirq.h
delete mode 100644 arch/sh/include/asm/hd64461.h
delete mode 100644 arch/sh/include/asm/heartbeat.h
delete mode 100644 arch/sh/include/asm/hugetlb.h
delete mode 100644 arch/sh/include/asm/hw_breakpoint.h
delete mode 100644 arch/sh/include/asm/hw_irq.h
delete mode 100644 arch/sh/include/asm/i2c-sh7760.h
delete mode 100644 arch/sh/include/asm/io.h
delete mode 100644 arch/sh/include/asm/io_generic.h
delete mode 100644 arch/sh/include/asm/io_noioport.h
delete mode 100644 arch/sh/include/asm/io_trapped.h
delete mode 100644 arch/sh/include/asm/irq.h
delete mode 100644 arch/sh/include/asm/irqflags.h
delete mode 100644 arch/sh/include/asm/kdebug.h
delete mode 100644 arch/sh/include/asm/kexec.h
delete mode 100644 arch/sh/include/asm/kgdb.h
delete mode 100644 arch/sh/include/asm/kprobes.h
delete mode 100644 arch/sh/include/asm/linkage.h
delete mode 100644 arch/sh/include/asm/machvec.h
delete mode 100644 arch/sh/include/asm/mmiowb.h
delete mode 100644 arch/sh/include/asm/mmu.h
delete mode 100644 arch/sh/include/asm/mmu_context.h
delete mode 100644 arch/sh/include/asm/mmu_context_32.h
delete mode 100644 arch/sh/include/asm/mmzone.h
delete mode 100644 arch/sh/include/asm/module.h
delete mode 100644 arch/sh/include/asm/page.h
delete mode 100644 arch/sh/include/asm/pci.h
delete mode 100644 arch/sh/include/asm/perf_event.h
delete mode 100644 arch/sh/include/asm/pgalloc.h
delete mode 100644 arch/sh/include/asm/pgtable-2level.h
delete mode 100644 arch/sh/include/asm/pgtable-3level.h
delete mode 100644 arch/sh/include/asm/pgtable.h
delete mode 100644 arch/sh/include/asm/pgtable_32.h
delete mode 100644 arch/sh/include/asm/platform_early.h
delete mode 100644 arch/sh/include/asm/posix_types.h
delete mode 100644 arch/sh/include/asm/processor.h
delete mode 100644 arch/sh/include/asm/processor_32.h
delete mode 100644 arch/sh/include/asm/ptrace.h
delete mode 100644 arch/sh/include/asm/ptrace_32.h
delete mode 100644 arch/sh/include/asm/push-switch.h
delete mode 100644 arch/sh/include/asm/reboot.h
delete mode 100644 arch/sh/include/asm/romimage-macros.h
delete mode 100644 arch/sh/include/asm/rtc.h
delete mode 100644 arch/sh/include/asm/seccomp.h
delete mode 100644 arch/sh/include/asm/sections.h
delete mode 100644 arch/sh/include/asm/setup.h
delete mode 100644 arch/sh/include/asm/sfp-machine.h
delete mode 100644 arch/sh/include/asm/sh7760fb.h
delete mode 100644 arch/sh/include/asm/sh_bios.h
delete mode 100644 arch/sh/include/asm/shmparam.h
delete mode 100644 arch/sh/include/asm/siu.h
delete mode 100644 arch/sh/include/asm/smc37c93x.h
delete mode 100644 arch/sh/include/asm/smp-ops.h
delete mode 100644 arch/sh/include/asm/smp.h
delete mode 100644 arch/sh/include/asm/sparsemem.h
delete mode 100644 arch/sh/include/asm/spi.h
delete mode 100644 arch/sh/include/asm/spinlock-cas.h
delete mode 100644 arch/sh/include/asm/spinlock-llsc.h
delete mode 100644 arch/sh/include/asm/spinlock.h
delete mode 100644 arch/sh/include/asm/spinlock_types.h
delete mode 100644 arch/sh/include/asm/sram.h
delete mode 100644 arch/sh/include/asm/stackprotector.h
delete mode 100644 arch/sh/include/asm/stacktrace.h
delete mode 100644 arch/sh/include/asm/string.h
delete mode 100644 arch/sh/include/asm/string_32.h
delete mode 100644 arch/sh/include/asm/suspend.h
delete mode 100644 arch/sh/include/asm/switch_to.h
delete mode 100644 arch/sh/include/asm/switch_to_32.h
delete mode 100644 arch/sh/include/asm/syscall.h
delete mode 100644 arch/sh/include/asm/syscall_32.h
delete mode 100644 arch/sh/include/asm/syscalls.h
delete mode 100644 arch/sh/include/asm/syscalls_32.h
delete mode 100644 arch/sh/include/asm/thread_info.h
delete mode 100644 arch/sh/include/asm/timex.h
delete mode 100644 arch/sh/include/asm/tlb.h
delete mode 100644 arch/sh/include/asm/tlbflush.h
delete mode 100644 arch/sh/include/asm/topology.h
delete mode 100644 arch/sh/include/asm/traps.h
delete mode 100644 arch/sh/include/asm/traps_32.h
delete mode 100644 arch/sh/include/asm/types.h
delete mode 100644 arch/sh/include/asm/uaccess.h
delete mode 100644 arch/sh/include/asm/uaccess_32.h
delete mode 100644 arch/sh/include/asm/uncached.h
delete mode 100644 arch/sh/include/asm/unistd.h
delete mode 100644 arch/sh/include/asm/unwinder.h
delete mode 100644 arch/sh/include/asm/user.h
delete mode 100644 arch/sh/include/asm/vermagic.h
delete mode 100644 arch/sh/include/asm/vga.h
delete mode 100644 arch/sh/include/asm/vmalloc.h
delete mode 100644 arch/sh/include/asm/vmlinux.lds.h
delete mode 100644 arch/sh/include/asm/watchdog.h
delete mode 100644 arch/sh/include/asm/word-at-a-time.h
delete mode 100644 arch/sh/include/cpu-common/cpu/addrspace.h
delete mode 100644 arch/sh/include/cpu-common/cpu/mmu_context.h
delete mode 100644 arch/sh/include/cpu-common/cpu/pfc.h
delete mode 100644 arch/sh/include/cpu-common/cpu/rtc.h
delete mode 100644 arch/sh/include/cpu-common/cpu/sigcontext.h
delete mode 100644 arch/sh/include/cpu-common/cpu/timer.h
delete mode 100644 arch/sh/include/cpu-sh2/cpu/cache.h
delete mode 100644 arch/sh/include/cpu-sh2/cpu/freq.h
delete mode 100644 arch/sh/include/cpu-sh2/cpu/watchdog.h
delete mode 100644 arch/sh/include/cpu-sh2a/cpu/addrspace.h
delete mode 100644 arch/sh/include/cpu-sh2a/cpu/cache.h
delete mode 100644 arch/sh/include/cpu-sh2a/cpu/freq.h
delete mode 100644 arch/sh/include/cpu-sh2a/cpu/rtc.h
delete mode 100644 arch/sh/include/cpu-sh2a/cpu/sh7203.h
delete mode 100644 arch/sh/include/cpu-sh2a/cpu/sh7264.h
delete mode 100644 arch/sh/include/cpu-sh2a/cpu/sh7269.h
delete mode 100644 arch/sh/include/cpu-sh2a/cpu/watchdog.h
delete mode 100644 arch/sh/include/cpu-sh3/cpu/adc.h
delete mode 100644 arch/sh/include/cpu-sh3/cpu/cache.h
delete mode 100644 arch/sh/include/cpu-sh3/cpu/dac.h
delete mode 100644 arch/sh/include/cpu-sh3/cpu/dma-register.h
delete mode 100644 arch/sh/include/cpu-sh3/cpu/dma.h
delete mode 100644 arch/sh/include/cpu-sh3/cpu/freq.h
delete mode 100644 arch/sh/include/cpu-sh3/cpu/gpio.h
delete mode 100644 arch/sh/include/cpu-sh3/cpu/mmu_context.h
delete mode 100644 arch/sh/include/cpu-sh3/cpu/serial.h
delete mode 100644 arch/sh/include/cpu-sh3/cpu/sh7720.h
delete mode 100644 arch/sh/include/cpu-sh3/cpu/watchdog.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/addrspace.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/cache.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/dma-register.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/dma.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/fpu.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/freq.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/mmu_context.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/rtc.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/sh7722.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/sh7723.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/sh7724.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/sh7734.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/sh7757.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/sh7785.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/sh7786.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/shx3.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/sigcontext.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/sq.h
delete mode 100644 arch/sh/include/cpu-sh4/cpu/watchdog.h
delete mode 100644 arch/sh/include/cpu-sh4a/cpu/dma.h
delete mode 100644 arch/sh/include/cpu-sh4a/cpu/serial.h
delete mode 100644 arch/sh/include/mach-common/mach/highlander.h
delete mode 100644 arch/sh/include/mach-common/mach/hp6xx.h
delete mode 100644 arch/sh/include/mach-common/mach/lboxre2.h
delete mode 100644 arch/sh/include/mach-common/mach/magicpanelr2.h
delete mode 100644 arch/sh/include/mach-common/mach/mangle-port.h
delete mode 100644 arch/sh/include/mach-common/mach/microdev.h
delete mode 100644 arch/sh/include/mach-common/mach/r2d.h
delete mode 100644 arch/sh/include/mach-common/mach/romimage.h
delete mode 100644 arch/sh/include/mach-common/mach/sdk7780.h
delete mode 100644 arch/sh/include/mach-common/mach/secureedge5410.h
delete mode 100644 arch/sh/include/mach-common/mach/sh2007.h
delete mode 100644 arch/sh/include/mach-common/mach/sh7763rdp.h
delete mode 100644 arch/sh/include/mach-common/mach/sh7785lcr.h
delete mode 100644 arch/sh/include/mach-common/mach/shmin.h
delete mode 100644 arch/sh/include/mach-common/mach/titan.h
delete mode 100644 arch/sh/include/mach-common/mach/urquell.h
delete mode 100644 arch/sh/include/mach-dreamcast/mach/dma.h
delete mode 100644 arch/sh/include/mach-dreamcast/mach/maple.h
delete mode 100644 arch/sh/include/mach-dreamcast/mach/pci.h
delete mode 100644 arch/sh/include/mach-dreamcast/mach/sysasic.h
delete mode 100644 arch/sh/include/mach-ecovec24/mach/partner-jet-setup.txt
delete mode 100644 arch/sh/include/mach-ecovec24/mach/romimage.h
delete mode 100644 arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
delete mode 100644 arch/sh/include/mach-kfr2r09/mach/partner-jet-setup.txt
delete mode 100644 arch/sh/include/mach-kfr2r09/mach/romimage.h
delete mode 100644 arch/sh/include/mach-landisk/mach/gio.h
delete mode 100644 arch/sh/include/mach-landisk/mach/iodata_landisk.h
delete mode 100644 arch/sh/include/mach-migor/mach/migor.h
delete mode 100644 arch/sh/include/mach-sdk7786/mach/fpga.h
delete mode 100644 arch/sh/include/mach-sdk7786/mach/irq.h
delete mode 100644 arch/sh/include/mach-se/mach/mrshpc.h
delete mode 100644 arch/sh/include/mach-se/mach/se.h
delete mode 100644 arch/sh/include/mach-se/mach/se7206.h
delete mode 100644 arch/sh/include/mach-se/mach/se7343.h
delete mode 100644 arch/sh/include/mach-se/mach/se7721.h
delete mode 100644 arch/sh/include/mach-se/mach/se7722.h
delete mode 100644 arch/sh/include/mach-se/mach/se7724.h
delete mode 100644 arch/sh/include/mach-se/mach/se7751.h
delete mode 100644 arch/sh/include/mach-se/mach/se7780.h
delete mode 100644 arch/sh/include/mach-sh03/mach/io.h
delete mode 100644 arch/sh/include/mach-sh03/mach/sh03.h
delete mode 100644 arch/sh/include/mach-x3proto/mach/hardware.h
delete mode 100644 arch/sh/include/mach-x3proto/mach/ilsel.h
delete mode 100644 arch/sh/include/uapi/asm/Kbuild
delete mode 100644 arch/sh/include/uapi/asm/auxvec.h
delete mode 100644 arch/sh/include/uapi/asm/byteorder.h
delete mode 100644 arch/sh/include/uapi/asm/cachectl.h
delete mode 100644 arch/sh/include/uapi/asm/cpu-features.h
delete mode 100644 arch/sh/include/uapi/asm/hw_breakpoint.h
delete mode 100644 arch/sh/include/uapi/asm/ioctls.h
delete mode 100644 arch/sh/include/uapi/asm/posix_types.h
delete mode 100644 arch/sh/include/uapi/asm/posix_types_32.h
delete mode 100644 arch/sh/include/uapi/asm/ptrace.h
delete mode 100644 arch/sh/include/uapi/asm/ptrace_32.h
delete mode 100644 arch/sh/include/uapi/asm/sigcontext.h
delete mode 100644 arch/sh/include/uapi/asm/signal.h
delete mode 100644 arch/sh/include/uapi/asm/sockios.h
delete mode 100644 arch/sh/include/uapi/asm/stat.h
delete mode 100644 arch/sh/include/uapi/asm/swab.h
delete mode 100644 arch/sh/include/uapi/asm/unistd.h
delete mode 100644 arch/sh/kernel/.gitignore
delete mode 100644 arch/sh/kernel/Makefile
delete mode 100644 arch/sh/kernel/asm-offsets.c
delete mode 100644 arch/sh/kernel/cpu/Makefile
delete mode 100644 arch/sh/kernel/cpu/adc.c
delete mode 100644 arch/sh/kernel/cpu/clock-cpg.c
delete mode 100644 arch/sh/kernel/cpu/clock.c
delete mode 100644 arch/sh/kernel/cpu/fpu.c
delete mode 100644 arch/sh/kernel/cpu/init.c
delete mode 100644 arch/sh/kernel/cpu/irq/Makefile
delete mode 100644 arch/sh/kernel/cpu/irq/imask.c
delete mode 100644 arch/sh/kernel/cpu/irq/ipr.c
delete mode 100644 arch/sh/kernel/cpu/pfc.c
delete mode 100644 arch/sh/kernel/cpu/proc.c
delete mode 100644 arch/sh/kernel/cpu/sh2/Makefile
delete mode 100644 arch/sh/kernel/cpu/sh2/clock-sh7619.c
delete mode 100644 arch/sh/kernel/cpu/sh2/entry.S
delete mode 100644 arch/sh/kernel/cpu/sh2/ex.S
delete mode 100644 arch/sh/kernel/cpu/sh2/probe.c
delete mode 100644 arch/sh/kernel/cpu/sh2/setup-sh7619.c
delete mode 100644 arch/sh/kernel/cpu/sh2/smp-j2.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/Makefile
delete mode 100644 arch/sh/kernel/cpu/sh2a/clock-sh7201.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/clock-sh7203.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/clock-sh7206.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/clock-sh7264.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/clock-sh7269.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/entry.S
delete mode 100644 arch/sh/kernel/cpu/sh2a/ex.S
delete mode 100644 arch/sh/kernel/cpu/sh2a/fpu.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/opcode_helper.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/pinmux-sh7203.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/probe.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/setup-mxg.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/setup-sh7201.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/setup-sh7203.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/setup-sh7206.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/setup-sh7264.c
delete mode 100644 arch/sh/kernel/cpu/sh2a/setup-sh7269.c
delete mode 100644 arch/sh/kernel/cpu/sh3/Makefile
delete mode 100644 arch/sh/kernel/cpu/sh3/clock-sh3.c
delete mode 100644 arch/sh/kernel/cpu/sh3/clock-sh7705.c
delete mode 100644 arch/sh/kernel/cpu/sh3/clock-sh7706.c
delete mode 100644 arch/sh/kernel/cpu/sh3/clock-sh7709.c
delete mode 100644 arch/sh/kernel/cpu/sh3/clock-sh7710.c
delete mode 100644 arch/sh/kernel/cpu/sh3/clock-sh7712.c
delete mode 100644 arch/sh/kernel/cpu/sh3/entry.S
delete mode 100644 arch/sh/kernel/cpu/sh3/ex.S
delete mode 100644 arch/sh/kernel/cpu/sh3/pinmux-sh7720.c
delete mode 100644 arch/sh/kernel/cpu/sh3/probe.c
delete mode 100644 arch/sh/kernel/cpu/sh3/serial-sh770x.c
delete mode 100644 arch/sh/kernel/cpu/sh3/serial-sh7710.c
delete mode 100644 arch/sh/kernel/cpu/sh3/serial-sh7720.c
delete mode 100644 arch/sh/kernel/cpu/sh3/setup-sh3.c
delete mode 100644 arch/sh/kernel/cpu/sh3/setup-sh7705.c
delete mode 100644 arch/sh/kernel/cpu/sh3/setup-sh770x.c
delete mode 100644 arch/sh/kernel/cpu/sh3/setup-sh7710.c
delete mode 100644 arch/sh/kernel/cpu/sh3/setup-sh7720.c
delete mode 100644 arch/sh/kernel/cpu/sh3/swsusp.S
delete mode 100644 arch/sh/kernel/cpu/sh4/Makefile
delete mode 100644 arch/sh/kernel/cpu/sh4/clock-sh4-202.c
delete mode 100644 arch/sh/kernel/cpu/sh4/clock-sh4.c
delete mode 100644 arch/sh/kernel/cpu/sh4/fpu.c
delete mode 100644 arch/sh/kernel/cpu/sh4/perf_event.c
delete mode 100644 arch/sh/kernel/cpu/sh4/probe.c
delete mode 100644 arch/sh/kernel/cpu/sh4/setup-sh4-202.c
delete mode 100644 arch/sh/kernel/cpu/sh4/setup-sh7750.c
delete mode 100644 arch/sh/kernel/cpu/sh4/setup-sh7760.c
delete mode 100644 arch/sh/kernel/cpu/sh4/softfloat.c
delete mode 100644 arch/sh/kernel/cpu/sh4/sq.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/Makefile
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-sh7343.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-sh7366.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-sh7722.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-sh7723.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-sh7724.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-sh7734.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-sh7757.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-sh7763.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-sh7770.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-sh7780.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-sh7785.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-sh7786.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/clock-shx3.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/intc-shx3.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/perf_event.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/pinmux-sh7723.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/pinmux-sh7724.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/pinmux-sh7734.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/pinmux-sh7757.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/pinmux-sh7785.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/pinmux-shx3.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/serial-sh7722.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-sh7343.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-sh7366.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-sh7722.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-sh7723.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-sh7724.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-sh7734.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-sh7757.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-sh7763.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-sh7770.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-sh7780.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-sh7785.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-sh7786.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/setup-shx3.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/smp-shx3.c
delete mode 100644 arch/sh/kernel/cpu/sh4a/ubc.c
delete mode 100644 arch/sh/kernel/cpu/shmobile/Makefile
delete mode 100644 arch/sh/kernel/cpu/shmobile/cpuidle.c
delete mode 100644 arch/sh/kernel/cpu/shmobile/pm.c
delete mode 100644 arch/sh/kernel/cpu/shmobile/sleep.S
delete mode 100644 arch/sh/kernel/crash_dump.c
delete mode 100644 arch/sh/kernel/debugtraps.S
delete mode 100644 arch/sh/kernel/disassemble.c
delete mode 100644 arch/sh/kernel/dma-coherent.c
delete mode 100644 arch/sh/kernel/dumpstack.c
delete mode 100644 arch/sh/kernel/dwarf.c
delete mode 100644 arch/sh/kernel/entry-common.S
delete mode 100644 arch/sh/kernel/ftrace.c
delete mode 100644 arch/sh/kernel/head_32.S
delete mode 100644 arch/sh/kernel/hw_breakpoint.c
delete mode 100644 arch/sh/kernel/idle.c
delete mode 100644 arch/sh/kernel/io.c
delete mode 100644 arch/sh/kernel/io_trapped.c
delete mode 100644 arch/sh/kernel/iomap.c
delete mode 100644 arch/sh/kernel/ioport.c
delete mode 100644 arch/sh/kernel/irq.c
delete mode 100644 arch/sh/kernel/irq_32.c
delete mode 100644 arch/sh/kernel/kdebugfs.c
delete mode 100644 arch/sh/kernel/kgdb.c
delete mode 100644 arch/sh/kernel/kprobes.c
delete mode 100644 arch/sh/kernel/machine_kexec.c
delete mode 100644 arch/sh/kernel/machvec.c
delete mode 100644 arch/sh/kernel/module.c
delete mode 100644 arch/sh/kernel/nmi_debug.c
delete mode 100644 arch/sh/kernel/perf_callchain.c
delete mode 100644 arch/sh/kernel/perf_event.c
delete mode 100644 arch/sh/kernel/process.c
delete mode 100644 arch/sh/kernel/process_32.c
delete mode 100644 arch/sh/kernel/ptrace.c
delete mode 100644 arch/sh/kernel/ptrace_32.c
delete mode 100644 arch/sh/kernel/reboot.c
delete mode 100644 arch/sh/kernel/relocate_kernel.S
delete mode 100644 arch/sh/kernel/return_address.c
delete mode 100644 arch/sh/kernel/setup.c
delete mode 100644 arch/sh/kernel/sh_bios.c
delete mode 100644 arch/sh/kernel/sh_ksyms_32.c
delete mode 100644 arch/sh/kernel/signal_32.c
delete mode 100644 arch/sh/kernel/smp.c
delete mode 100644 arch/sh/kernel/stacktrace.c
delete mode 100644 arch/sh/kernel/swsusp.c
delete mode 100644 arch/sh/kernel/sys_sh.c
delete mode 100644 arch/sh/kernel/sys_sh32.c
delete mode 100644 arch/sh/kernel/syscalls/Makefile
delete mode 100644 arch/sh/kernel/syscalls/syscall.tbl
delete mode 100644 arch/sh/kernel/syscalls_32.S
delete mode 100644 arch/sh/kernel/time.c
delete mode 100644 arch/sh/kernel/topology.c
delete mode 100644 arch/sh/kernel/traps.c
delete mode 100644 arch/sh/kernel/traps_32.c
delete mode 100644 arch/sh/kernel/unwinder.c
delete mode 100644 arch/sh/kernel/vmlinux.lds.S
delete mode 100644 arch/sh/kernel/vsyscall/.gitignore
delete mode 100644 arch/sh/kernel/vsyscall/Makefile
delete mode 100644 arch/sh/kernel/vsyscall/vsyscall-note.S
delete mode 100644 arch/sh/kernel/vsyscall/vsyscall-sigreturn.S
delete mode 100644 arch/sh/kernel/vsyscall/vsyscall-syscall.S
delete mode 100644 arch/sh/kernel/vsyscall/vsyscall-trapa.S
delete mode 100644 arch/sh/kernel/vsyscall/vsyscall.c
delete mode 100644 arch/sh/kernel/vsyscall/vsyscall.lds.S
delete mode 100644 arch/sh/lib/Makefile
delete mode 100644 arch/sh/lib/__clear_user.S
delete mode 100644 arch/sh/lib/ashiftrt.S
delete mode 100644 arch/sh/lib/ashldi3.c
delete mode 100644 arch/sh/lib/ashlsi3.S
delete mode 100644 arch/sh/lib/ashrdi3.c
delete mode 100644 arch/sh/lib/ashrsi3.S
delete mode 100644 arch/sh/lib/checksum.S
delete mode 100644 arch/sh/lib/copy_page.S
delete mode 100644 arch/sh/lib/delay.c
delete mode 100644 arch/sh/lib/div64-generic.c
delete mode 100644 arch/sh/lib/div64.S
delete mode 100644 arch/sh/lib/io.c
delete mode 100644 arch/sh/lib/libgcc.h
delete mode 100644 arch/sh/lib/lshrdi3.c
delete mode 100644 arch/sh/lib/lshrsi3.S
delete mode 100644 arch/sh/lib/mcount.S
delete mode 100644 arch/sh/lib/memchr.S
delete mode 100644 arch/sh/lib/memcpy-sh4.S
delete mode 100644 arch/sh/lib/memcpy.S
delete mode 100644 arch/sh/lib/memmove.S
delete mode 100644 arch/sh/lib/memset-sh4.S
delete mode 100644 arch/sh/lib/memset.S
delete mode 100644 arch/sh/lib/movmem.S
delete mode 100644 arch/sh/lib/strlen.S
delete mode 100644 arch/sh/lib/udiv_qrnnd.S
delete mode 100644 arch/sh/lib/udivsi3.S
delete mode 100644 arch/sh/lib/udivsi3_i4i-Os.S
delete mode 100644 arch/sh/lib/udivsi3_i4i.S
delete mode 100644 arch/sh/math-emu/Makefile
delete mode 100644 arch/sh/math-emu/math.c
delete mode 100644 arch/sh/math-emu/sfp-util.h
delete mode 100644 arch/sh/mm/Kconfig
delete mode 100644 arch/sh/mm/Makefile
delete mode 100644 arch/sh/mm/alignment.c
delete mode 100644 arch/sh/mm/asids-debugfs.c
delete mode 100644 arch/sh/mm/cache-debugfs.c
delete mode 100644 arch/sh/mm/cache-j2.c
delete mode 100644 arch/sh/mm/cache-sh2.c
delete mode 100644 arch/sh/mm/cache-sh2a.c
delete mode 100644 arch/sh/mm/cache-sh3.c
delete mode 100644 arch/sh/mm/cache-sh4.c
delete mode 100644 arch/sh/mm/cache-sh7705.c
delete mode 100644 arch/sh/mm/cache-shx3.c
delete mode 100644 arch/sh/mm/cache.c
delete mode 100644 arch/sh/mm/consistent.c
delete mode 100644 arch/sh/mm/extable_32.c
delete mode 100644 arch/sh/mm/fault.c
delete mode 100644 arch/sh/mm/flush-sh4.c
delete mode 100644 arch/sh/mm/hugetlbpage.c
delete mode 100644 arch/sh/mm/init.c
delete mode 100644 arch/sh/mm/ioremap.c
delete mode 100644 arch/sh/mm/ioremap.h
delete mode 100644 arch/sh/mm/ioremap_fixed.c
delete mode 100644 arch/sh/mm/kmap.c
delete mode 100644 arch/sh/mm/mmap.c
delete mode 100644 arch/sh/mm/nommu.c
delete mode 100644 arch/sh/mm/numa.c
delete mode 100644 arch/sh/mm/pgtable.c
delete mode 100644 arch/sh/mm/pmb.c
delete mode 100644 arch/sh/mm/sram.c
delete mode 100644 arch/sh/mm/tlb-debugfs.c
delete mode 100644 arch/sh/mm/tlb-pteaex.c
delete mode 100644 arch/sh/mm/tlb-sh3.c
delete mode 100644 arch/sh/mm/tlb-sh4.c
delete mode 100644 arch/sh/mm/tlb-urb.c
delete mode 100644 arch/sh/mm/tlbex_32.c
delete mode 100644 arch/sh/mm/tlbflush_32.c
delete mode 100644 arch/sh/mm/uncached.c
delete mode 100644 arch/sh/tools/Makefile
delete mode 100644 arch/sh/tools/gen-mach-types
delete mode 100644 arch/sh/tools/mach-types
delete mode 100644 drivers/video/logo/logo_superh_clut224.ppm
delete mode 100644 drivers/video/logo/logo_superh_vga16.ppm

diff --git a/Documentation/arch.rst b/Documentation/arch.rst
index 41a66a8b38e424..18669458eec4dd 100644
--- a/Documentation/arch.rst
+++ b/Documentation/arch.rst
@@ -22,7 +22,6 @@ implementation.
powerpc/index
riscv/index
s390/index
- sh/index
sparc/index
x86/index
xtensa/index
diff --git a/Documentation/sh/booting.rst b/Documentation/sh/booting.rst
deleted file mode 100644
index d851c49a01bf07..00000000000000
--- a/Documentation/sh/booting.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0
-
-DeviceTree Booting
-------------------
-
- Device-tree compatible SH bootloaders are expected to provide the physical
- address of the device tree blob in r4. Since legacy bootloaders did not
- guarantee any particular initial register state, kernels built to
- inter-operate with old bootloaders must either use a builtin DTB or
- select a legacy board option (something other than CONFIG_SH_DEVICE_TREE)
- that does not use device tree. Support for the latter is being phased out
- in favor of device tree.
diff --git a/Documentation/sh/features.rst b/Documentation/sh/features.rst
deleted file mode 100644
index f722af3b6c9934..00000000000000
--- a/Documentation/sh/features.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0
-
-.. kernel-feat:: $srctree/Documentation/features sh
diff --git a/Documentation/sh/index.rst b/Documentation/sh/index.rst
deleted file mode 100644
index c64776738cf6b2..00000000000000
--- a/Documentation/sh/index.rst
+++ /dev/null
@@ -1,56 +0,0 @@
-=======================
-SuperH Interfaces Guide
-=======================
-
-:Author: Paul Mundt
-
-.. toctree::
- :maxdepth: 1
-
- booting
- new-machine
- register-banks
-
- features
-
-Memory Management
-=================
-
-SH-4
-----
-
-Store Queue API
-~~~~~~~~~~~~~~~
-
-.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
- :export:
-
-Machine Specific Interfaces
-===========================
-
-mach-dreamcast
---------------
-
-.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
- :internal:
-
-mach-x3proto
-------------
-
-.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
- :export:
-
-Busses
-======
-
-SuperHyway
-----------
-
-.. kernel-doc:: drivers/sh/superhyway/superhyway.c
- :export:
-
-Maple
------
-
-.. kernel-doc:: drivers/sh/maple/maple.c
- :export:
diff --git a/Documentation/sh/new-machine.rst b/Documentation/sh/new-machine.rst
deleted file mode 100644
index e501c52b3b30d2..00000000000000
--- a/Documentation/sh/new-machine.rst
+++ /dev/null
@@ -1,277 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0
-
-=============================
-Adding a new board to LinuxSH
-=============================
-
- Paul Mundt <[email protected]>
-
-This document attempts to outline what steps are necessary to add support
-for new boards to the LinuxSH port under the new 2.5 and 2.6 kernels. This
-also attempts to outline some of the noticeable changes between the 2.4
-and the 2.5/2.6 SH backend.
-
-1. New Directory Structure
-==========================
-
-The first thing to note is the new directory structure. Under 2.4, most
-of the board-specific code (with the exception of stboards) ended up
-in arch/sh/kernel/ directly, with board-specific headers ending up in
-include/asm-sh/. For the new kernel, things are broken out by board type,
-companion chip type, and CPU type. Looking at a tree view of this directory
-hierarchy looks like the following:
-
-Board-specific code::
-
- .
- |-- arch
- | `-- sh
- | `-- boards
- | |-- adx
- | | `-- board-specific files
- | |-- bigsur
- | | `-- board-specific files
- | |
- | ... more boards here ...
- |
- `-- include
- `-- asm-sh
- |-- adx
- | `-- board-specific headers
- |-- bigsur
- | `-- board-specific headers
- |
- .. more boards here ...
-
-Next, for companion chips::
-
- .
- `-- arch
- `-- sh
- `-- cchips
- `-- hd6446x
- `-- hd64461
- `-- cchip-specific files
-
-... and so on. Headers for the companion chips are treated the same way as
-board-specific headers. Thus, include/asm-sh/hd64461 is home to all of the
-hd64461-specific headers.
-
-Finally, CPU family support is also abstracted::
-
- .
- |-- arch
- | `-- sh
- | |-- kernel
- | | `-- cpu
- | | |-- sh2
- | | | `-- SH-2 generic files
- | | |-- sh3
- | | | `-- SH-3 generic files
- | | `-- sh4
- | | `-- SH-4 generic files
- | `-- mm
- | `-- This is also broken out per CPU family, so each family can
- | have their own set of cache/tlb functions.
- |
- `-- include
- `-- asm-sh
- |-- cpu-sh2
- | `-- SH-2 specific headers
- |-- cpu-sh3
- | `-- SH-3 specific headers
- `-- cpu-sh4
- `-- SH-4 specific headers
-
-It should be noted that CPU subtypes are _not_ abstracted. Thus, these still
-need to be dealt with by the CPU family specific code.
-
-2. Adding a New Board
-=====================
-
-The first thing to determine is whether the board you are adding will be
-isolated, or whether it will be part of a family of boards that can mostly
-share the same board-specific code with minor differences.
-
-In the first case, this is just a matter of making a directory for your
-board in arch/sh/boards/ and adding rules to hook your board in with the
-build system (more on this in the next section). However, for board families
-it makes more sense to have a common top-level arch/sh/boards/ directory
-and then populate that with sub-directories for each member of the family.
-Both the Solution Engine and the hp6xx boards are an example of this.
-
-After you have setup your new arch/sh/boards/ directory, remember that you
-should also add a directory in include/asm-sh for headers localized to this
-board (if there are going to be more than one). In order to interoperate
-seamlessly with the build system, it's best to have this directory the same
-as the arch/sh/boards/ directory name, though if your board is again part of
-a family, the build system has ways of dealing with this (via incdir-y
-overloading), and you can feel free to name the directory after the family
-member itself.
-
-There are a few things that each board is required to have, both in the
-arch/sh/boards and the include/asm-sh/ hierarchy. In order to better
-explain this, we use some examples for adding an imaginary board. For
-setup code, we're required at the very least to provide definitions for
-get_system_type() and platform_setup(). For our imaginary board, this
-might look something like::
-
- /*
- * arch/sh/boards/vapor/setup.c - Setup code for imaginary board
- */
- #include <linux/init.h>
-
- const char *get_system_type(void)
- {
- return "FooTech Vaporboard";
- }
-
- int __init platform_setup(void)
- {
- /*
- * If our hardware actually existed, we would do real
- * setup here. Though it's also sane to leave this empty
- * if there's no real init work that has to be done for
- * this board.
- */
-
- /* Start-up imaginary PCI ... */
-
- /* And whatever else ... */
-
- return 0;
- }
-
-Our new imaginary board will also have to tie into the machvec in order for it
-to be of any use.
-
-machvec functions fall into a number of categories:
-
- - I/O functions to IO memory (inb etc) and PCI/main memory (readb etc).
- - I/O mapping functions (ioport_map, ioport_unmap, etc).
- - a 'heartbeat' function.
- - PCI and IRQ initialization routines.
- - Consistent allocators (for boards that need special allocators,
- particularly for allocating out of some board-specific SRAM for DMA
- handles).
-
-There are machvec functions added and removed over time, so always be sure to
-consult include/asm-sh/machvec.h for the current state of the machvec.
-
-The kernel will automatically wrap in generic routines for undefined function
-pointers in the machvec at boot time, as machvec functions are referenced
-unconditionally throughout most of the tree. Some boards have incredibly
-sparse machvecs (such as the dreamcast and sh03), whereas others must define
-virtually everything (rts7751r2d).
-
-Adding a new machine is relatively trivial (using vapor as an example):
-
-If the board-specific definitions are quite minimalistic, as is the case for
-the vast majority of boards, simply having a single board-specific header is
-sufficient.
-
- - add a new file include/asm-sh/vapor.h which contains prototypes for
- any machine specific IO functions prefixed with the machine name, for
- example vapor_inb. These will be needed when filling out the machine
- vector.
-
- Note that these prototypes are generated automatically by setting
- __IO_PREFIX to something sensible. A typical example would be::
-
- #define __IO_PREFIX vapor
- #include <asm/io_generic.h>
-
- somewhere in the board-specific header. Any boards being ported that still
- have a legacy io.h should remove it entirely and switch to the new model.
-
- - Add machine vector definitions to the board's setup.c. At a bare minimum,
- this must be defined as something like::
-
- struct sh_machine_vector mv_vapor __initmv = {
- .mv_name = "vapor",
- };
- ALIAS_MV(vapor)
-
- - finally add a file arch/sh/boards/vapor/io.c, which contains definitions of
- the machine specific io functions (if there are enough to warrant it).
-
-3. Hooking into the Build System
-================================
-
-Now that we have the corresponding directories setup, and all of the
-board-specific code is in place, it's time to look at how to get the
-whole mess to fit into the build system.
-
-Large portions of the build system are now entirely dynamic, and merely
-require the proper entry here and there in order to get things done.
-
-The first thing to do is to add an entry to arch/sh/Kconfig, under the
-"System type" menu::
-
- config SH_VAPOR
- bool "Vapor"
- help
- select Vapor if configuring for a FooTech Vaporboard.
-
-next, this has to be added into arch/sh/Makefile. All boards require a
-machdir-y entry in order to be built. This entry needs to be the name of
-the board directory as it appears in arch/sh/boards, even if it is in a
-sub-directory (in which case, all parent directories below arch/sh/boards/
-need to be listed). For our new board, this entry can look like::
-
- machdir-$(CONFIG_SH_VAPOR) += vapor
-
-provided that we've placed everything in the arch/sh/boards/vapor/ directory.
-
-Next, the build system assumes that your include/asm-sh directory will also
-be named the same. If this is not the case (as is the case with multiple
-boards belonging to a common family), then the directory name needs to be
-implicitly appended to incdir-y. The existing code manages this for the
-Solution Engine and hp6xx boards, so see these for an example.
-
-Once that is taken care of, it's time to add an entry for the mach type.
-This is done by adding an entry to the end of the arch/sh/tools/mach-types
-list. The method for doing this is self explanatory, and so we won't waste
-space restating it here. After this is done, you will be able to use
-implicit checks for your board if you need this somewhere throughout the
-common code, such as::
-
- /* Make sure we're on the FooTech Vaporboard */
- if (!mach_is_vapor())
- return -ENODEV;
-
-also note that the mach_is_boardname() check will be implicitly forced to
-lowercase, regardless of the fact that the mach-types entries are all
-uppercase. You can read the script if you really care, but it's pretty ugly,
-so you probably don't want to do that.
-
-Now all that's left to do is providing a defconfig for your new board. This
-way, other people who end up with this board can simply use this config
-for reference instead of trying to guess what settings are supposed to be
-used on it.
-
-Also, as soon as you have copied over a sample .config for your new board
-(assume arch/sh/configs/vapor_defconfig), you can also use this directly as a
-build target, and it will be implicitly listed as such in the help text.
-
-Looking at the 'make help' output, you should now see something like:
-
-Architecture specific targets (sh):
-
- ======================= =============================================
- zImage Compressed kernel image (arch/sh/boot/zImage)
- adx_defconfig Build for adx
- cqreek_defconfig Build for cqreek
- dreamcast_defconfig Build for dreamcast
- ...
- vapor_defconfig Build for vapor
- ======================= =============================================
-
-which then allows you to do::
-
- $ make ARCH=sh CROSS_COMPILE=sh4-linux- vapor_defconfig vmlinux
-
-which will in turn copy the defconfig for this board, run it through
-oldconfig (prompting you for any new options since the time of creation),
-and start you on your way to having a functional kernel for your new
-board.
diff --git a/Documentation/sh/register-banks.rst b/Documentation/sh/register-banks.rst
deleted file mode 100644
index 2bef5c8fcbbc06..00000000000000
--- a/Documentation/sh/register-banks.rst
+++ /dev/null
@@ -1,40 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0
-
-==========================================
-Notes on register bank usage in the kernel
-==========================================
-
-Introduction
-------------
-
-The SH-3 and SH-4 CPU families traditionally include a single partial register
-bank (selected by SR.RB, only r0 ... r7 are banked), whereas other families
-may have more full-featured banking or simply no such capabilities at all.
-
-SR.RB banking
--------------
-
-In the case of this type of banking, banked registers are mapped directly to
-r0 ... r7 if SR.RB is set to the bank we are interested in, otherwise ldc/stc
-can still be used to reference the banked registers (as r0_bank ... r7_bank)
-when in the context of another bank. The developer must keep the SR.RB value
-in mind when writing code that utilizes these banked registers, for obvious
-reasons. Userspace is also not able to poke at the bank1 values, so these can
-be used rather effectively as scratch registers by the kernel.
-
-Presently the kernel uses several of these registers.
-
- - r0_bank, r1_bank (referenced as k0 and k1, used for scratch
- registers when doing exception handling).
-
- - r2_bank (used to track the EXPEVT/INTEVT code)
-
- - Used by do_IRQ() and friends for doing irq mapping based off
- of the interrupt exception vector jump table offset
-
- - r6_bank (global interrupt mask)
-
- - The SR.IMASK interrupt handler makes use of this to set the
- interrupt priority level (used by local_irq_enable())
-
- - r7_bank (current)
diff --git a/MAINTAINERS b/MAINTAINERS
index e278cd5d0de00e..5899ff135e3deb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -20067,16 +20067,6 @@ S: Maintained
F: Documentation/devicetree/bindings/watchdog/sunplus,sp7021-wdt.yaml
F: drivers/watchdog/sunplus_wdt.c

-SUPERH
-M: Yoshinori Sato <[email protected]>
-M: Rich Felker <[email protected]>
-L: [email protected]
-S: Maintained
-Q: http://patchwork.kernel.org/project/linux-sh/list/
-F: Documentation/sh/
-F: arch/sh/
-F: drivers/sh/
-
SUSPEND TO RAM
M: "Rafael J. Wysocki" <[email protected]>
M: Len Brown <[email protected]>
diff --git a/arch/sh/Kbuild b/arch/sh/Kbuild
deleted file mode 100644
index be171880977e5d..00000000000000
--- a/arch/sh/Kbuild
+++ /dev/null
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-obj-y += kernel/ mm/ boards/
-obj-$(CONFIG_SH_FPU_EMU) += math-emu/
-obj-$(CONFIG_USE_BUILTIN_DTB) += boot/dts/
-
-# for cleaning
-subdir- += boot
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
deleted file mode 100644
index 0665ac0add0b49..00000000000000
--- a/arch/sh/Kconfig
+++ /dev/null
@@ -1,793 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-config SUPERH
- def_bool y
- select ARCH_32BIT_OFF_T
- select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM && MMU
- select ARCH_ENABLE_MEMORY_HOTREMOVE if SPARSEMEM && MMU
- select ARCH_HAVE_CUSTOM_GPIO_H
- select ARCH_HAVE_NMI_SAFE_CMPXCHG if (GUSA_RB || CPU_SH4A)
- select ARCH_HAS_BINFMT_FLAT if !MMU
- select ARCH_HAS_CURRENT_STACK_POINTER
- select ARCH_HAS_GIGANTIC_PAGE
- select ARCH_HAS_GCOV_PROFILE_ALL
- select ARCH_HAS_PTE_SPECIAL
- select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
- select ARCH_HIBERNATION_POSSIBLE if MMU
- select ARCH_MIGHT_HAVE_PC_PARPORT
- select ARCH_WANT_IPC_PARSE_VERSION
- select CPU_NO_EFFICIENT_FFS
- select DMA_DECLARE_COHERENT
- select GENERIC_ATOMIC64
- select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST
- select GENERIC_IDLE_POLL_SETUP
- select GENERIC_IRQ_SHOW
- select GENERIC_PCI_IOMAP if PCI
- select GENERIC_SCHED_CLOCK
- select GENERIC_SMP_IDLE_THREAD
- select GUP_GET_PXX_LOW_HIGH if X2TLB
- select HAVE_ARCH_AUDITSYSCALL
- select HAVE_ARCH_KGDB
- select HAVE_ARCH_SECCOMP_FILTER
- select HAVE_ARCH_TRACEHOOK
- select HAVE_DEBUG_BUGVERBOSE
- select HAVE_DEBUG_KMEMLEAK
- select HAVE_DYNAMIC_FTRACE
- select HAVE_FAST_GUP if MMU
- select HAVE_FUNCTION_GRAPH_TRACER
- select HAVE_FUNCTION_TRACER
- select HAVE_FTRACE_MCOUNT_RECORD
- select HAVE_HW_BREAKPOINT
- select HAVE_IOREMAP_PROT if MMU && !X2TLB
- select HAVE_KERNEL_BZIP2
- select HAVE_KERNEL_GZIP
- select HAVE_KERNEL_LZMA
- select HAVE_KERNEL_LZO
- select HAVE_KERNEL_XZ
- select HAVE_KPROBES
- select HAVE_KRETPROBES
- select HAVE_MIXED_BREAKPOINTS_REGS
- select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER
- select HAVE_NMI
- select HAVE_PATA_PLATFORM
- select HAVE_PERF_EVENTS
- select HAVE_REGS_AND_STACK_ACCESS_API
- select HAVE_UID16
- select HAVE_SOFTIRQ_ON_OWN_STACK if IRQSTACKS
- select HAVE_STACKPROTECTOR
- select HAVE_SYSCALL_TRACEPOINTS
- select IRQ_FORCED_THREADING
- select MODULES_USE_ELF_RELA
- select NEED_SG_DMA_LENGTH
- select NO_DMA if !MMU && !DMA_COHERENT
- select NO_GENERIC_PCI_IOPORT_MAP if PCI
- select OLD_SIGACTION
- select OLD_SIGSUSPEND
- select PCI_DOMAINS if PCI
- select PERF_EVENTS
- select PERF_USE_VMALLOC
- select RTC_LIB
- select SPARSE_IRQ
- select TRACE_IRQFLAGS_SUPPORT
- help
- The SuperH is a RISC processor targeted for use in embedded systems
- and consumer electronics; it was also used in the Sega Dreamcast
- gaming console. The SuperH port has a home page at
- <http://www.linux-sh.org/>.
-
-config GENERIC_BUG
- def_bool y
- depends on BUG
-
-config GENERIC_HWEIGHT
- def_bool y
-
-config GENERIC_CALIBRATE_DELAY
- bool
-
-config GENERIC_LOCKBREAK
- def_bool y
- depends on SMP && PREEMPTION
-
-config ARCH_SUSPEND_POSSIBLE
- def_bool n
-
-config ARCH_HIBERNATION_POSSIBLE
- def_bool n
-
-config SYS_SUPPORTS_APM_EMULATION
- bool
- select ARCH_SUSPEND_POSSIBLE
-
-config SYS_SUPPORTS_SMP
- bool
-
-config SYS_SUPPORTS_NUMA
- bool
-
-config STACKTRACE_SUPPORT
- def_bool y
-
-config LOCKDEP_SUPPORT
- def_bool y
-
-config ARCH_HAS_ILOG2_U32
- def_bool n
-
-config ARCH_HAS_ILOG2_U64
- def_bool n
-
-config NO_IOPORT_MAP
- def_bool !PCI
- depends on !SH_SH4202_MICRODEV && !SH_SHMIN && !SH_HP6XX && \
- !SH_SOLUTION_ENGINE
-
-config IO_TRAPPED
- bool
-
-config SWAP_IO_SPACE
- bool
-
-config DMA_COHERENT
- bool
-
-config DMA_NONCOHERENT
- def_bool !NO_DMA && !DMA_COHERENT
- select ARCH_HAS_DMA_PREP_COHERENT
- select ARCH_HAS_SYNC_DMA_FOR_DEVICE
- select DMA_DIRECT_REMAP
-
-config PGTABLE_LEVELS
- default 3 if X2TLB
- default 2
-
-menu "System type"
-
-#
-# Processor families
-#
-config CPU_SH2
- bool
- select SH_INTC
-
-config CPU_SH2A
- bool
- select CPU_SH2
- select UNCACHED_MAPPING
-
-config CPU_J2
- bool
- select CPU_SH2
- select OF
- select OF_EARLY_FLATTREE
-
-config CPU_SH3
- bool
- select CPU_HAS_INTEVT
- select CPU_HAS_SR_RB
- select SH_INTC
- select SYS_SUPPORTS_SH_TMU
-
-config CPU_SH4
- bool
- select ARCH_SUPPORTS_HUGETLBFS if MMU
- select CPU_HAS_INTEVT
- select CPU_HAS_SR_RB
- select CPU_HAS_FPU if !CPU_SH4AL_DSP
- select SH_INTC
- select SYS_SUPPORTS_SH_TMU
-
-config CPU_SH4A
- bool
- select CPU_SH4
-
-config CPU_SH4AL_DSP
- bool
- select CPU_SH4A
- select CPU_HAS_DSP
-
-config CPU_SHX2
- bool
-
-config CPU_SHX3
- bool
- select DMA_COHERENT
- select SYS_SUPPORTS_SMP
- select SYS_SUPPORTS_NUMA
-
-config ARCH_SHMOBILE
- bool
- select ARCH_SUSPEND_POSSIBLE
- select PM
-
-config CPU_HAS_PMU
- depends on CPU_SH4 || CPU_SH4A
- default y
- bool
-
-choice
- prompt "Processor sub-type selection"
-
-#
-# Processor subtypes
-#
-
-# SH-2 Processor Support
-
-config CPU_SUBTYPE_SH7619
- bool "Support SH7619 processor"
- select CPU_SH2
- select SYS_SUPPORTS_SH_CMT
-
-config CPU_SUBTYPE_J2
- bool "Support J2 processor"
- select CPU_J2
- select SYS_SUPPORTS_SMP
- select GENERIC_CLOCKEVENTS_BROADCAST if SMP
-
-# SH-2A Processor Support
-
-config CPU_SUBTYPE_SH7201
- bool "Support SH7201 processor"
- select CPU_SH2A
- select CPU_HAS_FPU
- select SYS_SUPPORTS_SH_MTU2
-
-config CPU_SUBTYPE_SH7203
- bool "Support SH7203 processor"
- select CPU_SH2A
- select CPU_HAS_FPU
- select SYS_SUPPORTS_SH_CMT
- select SYS_SUPPORTS_SH_MTU2
- select PINCTRL
-
-config CPU_SUBTYPE_SH7206
- bool "Support SH7206 processor"
- select CPU_SH2A
- select SYS_SUPPORTS_SH_CMT
- select SYS_SUPPORTS_SH_MTU2
-
-config CPU_SUBTYPE_SH7263
- bool "Support SH7263 processor"
- select CPU_SH2A
- select CPU_HAS_FPU
- select SYS_SUPPORTS_SH_CMT
- select SYS_SUPPORTS_SH_MTU2
-
-config CPU_SUBTYPE_SH7264
- bool "Support SH7264 processor"
- select CPU_SH2A
- select CPU_HAS_FPU
- select SYS_SUPPORTS_SH_CMT
- select SYS_SUPPORTS_SH_MTU2
- select PINCTRL
-
-config CPU_SUBTYPE_SH7269
- bool "Support SH7269 processor"
- select CPU_SH2A
- select CPU_HAS_FPU
- select SYS_SUPPORTS_SH_CMT
- select SYS_SUPPORTS_SH_MTU2
- select PINCTRL
-
-config CPU_SUBTYPE_MXG
- bool "Support MX-G processor"
- select CPU_SH2A
- select SYS_SUPPORTS_SH_MTU2
- help
- Select MX-G if running on an R8A03022BG part.
-
-# SH-3 Processor Support
-
-config CPU_SUBTYPE_SH7705
- bool "Support SH7705 processor"
- select CPU_SH3
-
-config CPU_SUBTYPE_SH7706
- bool "Support SH7706 processor"
- select CPU_SH3
- help
- Select SH7706 if you have a 133 Mhz SH-3 HD6417706 CPU.
-
-config CPU_SUBTYPE_SH7707
- bool "Support SH7707 processor"
- select CPU_SH3
- help
- Select SH7707 if you have a 60 Mhz SH-3 HD6417707 CPU.
-
-config CPU_SUBTYPE_SH7708
- bool "Support SH7708 processor"
- select CPU_SH3
- help
- Select SH7708 if you have a 60 Mhz SH-3 HD6417708S or
- if you have a 100 Mhz SH-3 HD6417708R CPU.
-
-config CPU_SUBTYPE_SH7709
- bool "Support SH7709 processor"
- select CPU_SH3
- help
- Select SH7709 if you have a 80 Mhz SH-3 HD6417709 CPU.
-
-config CPU_SUBTYPE_SH7710
- bool "Support SH7710 processor"
- select CPU_SH3
- select CPU_HAS_DSP
- help
- Select SH7710 if you have a SH3-DSP SH7710 CPU.
-
-config CPU_SUBTYPE_SH7712
- bool "Support SH7712 processor"
- select CPU_SH3
- select CPU_HAS_DSP
- help
- Select SH7712 if you have a SH3-DSP SH7712 CPU.
-
-config CPU_SUBTYPE_SH7720
- bool "Support SH7720 processor"
- select CPU_SH3
- select CPU_HAS_DSP
- select SYS_SUPPORTS_SH_CMT
- select USB_OHCI_SH if USB_OHCI_HCD
- select PINCTRL
- help
- Select SH7720 if you have a SH3-DSP SH7720 CPU.
-
-config CPU_SUBTYPE_SH7721
- bool "Support SH7721 processor"
- select CPU_SH3
- select CPU_HAS_DSP
- select SYS_SUPPORTS_SH_CMT
- select USB_OHCI_SH if USB_OHCI_HCD
- help
- Select SH7721 if you have a SH3-DSP SH7721 CPU.
-
-# SH-4 Processor Support
-
-config CPU_SUBTYPE_SH7750
- bool "Support SH7750 processor"
- select CPU_SH4
- help
- Select SH7750 if you have a 200 Mhz SH-4 HD6417750 CPU.
-
-config CPU_SUBTYPE_SH7091
- bool "Support SH7091 processor"
- select CPU_SH4
- help
- Select SH7091 if you have an SH-4 based Sega device (such as
- the Dreamcast, Naomi, and Naomi 2).
-
-config CPU_SUBTYPE_SH7750R
- bool "Support SH7750R processor"
- select CPU_SH4
-
-config CPU_SUBTYPE_SH7750S
- bool "Support SH7750S processor"
- select CPU_SH4
-
-config CPU_SUBTYPE_SH7751
- bool "Support SH7751 processor"
- select CPU_SH4
- help
- Select SH7751 if you have a 166 Mhz SH-4 HD6417751 CPU,
- or if you have a HD6417751R CPU.
-
-config CPU_SUBTYPE_SH7751R
- bool "Support SH7751R processor"
- select CPU_SH4
-
-config CPU_SUBTYPE_SH7760
- bool "Support SH7760 processor"
- select CPU_SH4
-
-config CPU_SUBTYPE_SH4_202
- bool "Support SH4-202 processor"
- select CPU_SH4
-
-# SH-4A Processor Support
-
-config CPU_SUBTYPE_SH7723
- bool "Support SH7723 processor"
- select CPU_SH4A
- select CPU_SHX2
- select ARCH_SHMOBILE
- select ARCH_SPARSEMEM_ENABLE
- select SYS_SUPPORTS_SH_CMT
- select PINCTRL
- help
- Select SH7723 if you have an SH-MobileR2 CPU.
-
-config CPU_SUBTYPE_SH7724
- bool "Support SH7724 processor"
- select CPU_SH4A
- select CPU_SHX2
- select ARCH_SHMOBILE
- select ARCH_SPARSEMEM_ENABLE
- select SYS_SUPPORTS_SH_CMT
- select PINCTRL
- help
- Select SH7724 if you have an SH-MobileR2R CPU.
-
-config CPU_SUBTYPE_SH7734
- bool "Support SH7734 processor"
- select CPU_SH4A
- select CPU_SHX2
- select PINCTRL
- help
- Select SH7734 if you have a SH4A SH7734 CPU.
-
-config CPU_SUBTYPE_SH7757
- bool "Support SH7757 processor"
- select CPU_SH4A
- select CPU_SHX2
- select PINCTRL
- help
- Select SH7757 if you have a SH4A SH7757 CPU.
-
-config CPU_SUBTYPE_SH7763
- bool "Support SH7763 processor"
- select CPU_SH4A
- select USB_OHCI_SH if USB_OHCI_HCD
- help
- Select SH7763 if you have a SH4A SH7763(R5S77631) CPU.
-
-config CPU_SUBTYPE_SH7770
- bool "Support SH7770 processor"
- select CPU_SH4A
-
-config CPU_SUBTYPE_SH7780
- bool "Support SH7780 processor"
- select CPU_SH4A
-
-config CPU_SUBTYPE_SH7785
- bool "Support SH7785 processor"
- select CPU_SH4A
- select CPU_SHX2
- select ARCH_SPARSEMEM_ENABLE
- select SYS_SUPPORTS_NUMA
- select PINCTRL
-
-config CPU_SUBTYPE_SH7786
- bool "Support SH7786 processor"
- select CPU_SH4A
- select CPU_SHX3
- select CPU_HAS_PTEAEX
- select GENERIC_CLOCKEVENTS_BROADCAST if SMP
- select USB_OHCI_SH if USB_OHCI_HCD
- select USB_EHCI_SH if USB_EHCI_HCD
- select PINCTRL
-
-config CPU_SUBTYPE_SHX3
- bool "Support SH-X3 processor"
- select CPU_SH4A
- select CPU_SHX3
- select GENERIC_CLOCKEVENTS_BROADCAST if SMP
- select GPIOLIB
- select PINCTRL
-
-# SH4AL-DSP Processor Support
-
-config CPU_SUBTYPE_SH7343
- bool "Support SH7343 processor"
- select CPU_SH4AL_DSP
- select ARCH_SHMOBILE
- select SYS_SUPPORTS_SH_CMT
-
-config CPU_SUBTYPE_SH7722
- bool "Support SH7722 processor"
- select CPU_SH4AL_DSP
- select CPU_SHX2
- select ARCH_SHMOBILE
- select ARCH_SPARSEMEM_ENABLE
- select SYS_SUPPORTS_NUMA
- select SYS_SUPPORTS_SH_CMT
- select PINCTRL
-
-config CPU_SUBTYPE_SH7366
- bool "Support SH7366 processor"
- select CPU_SH4AL_DSP
- select CPU_SHX2
- select ARCH_SHMOBILE
- select ARCH_SPARSEMEM_ENABLE
- select SYS_SUPPORTS_NUMA
- select SYS_SUPPORTS_SH_CMT
-
-endchoice
-
-source "arch/sh/mm/Kconfig"
-
-source "arch/sh/Kconfig.cpu"
-
-source "arch/sh/boards/Kconfig"
-
-menu "Timer and clock configuration"
-
-config SH_PCLK_FREQ
- int "Peripheral clock frequency (in Hz)"
- depends on SH_CLK_CPG_LEGACY
- default "31250000" if CPU_SUBTYPE_SH7619
- default "33333333" if CPU_SUBTYPE_SH7770 || \
- CPU_SUBTYPE_SH7760 || \
- CPU_SUBTYPE_SH7705 || \
- CPU_SUBTYPE_SH7203 || \
- CPU_SUBTYPE_SH7206 || \
- CPU_SUBTYPE_SH7263 || \
- CPU_SUBTYPE_MXG
- default "60000000" if CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R
- default "66000000" if CPU_SUBTYPE_SH4_202
- default "50000000"
- help
- This option is used to specify the peripheral clock frequency.
- This is necessary for determining the reference clock value on
- platforms lacking an RTC.
-
-config SH_CLK_CPG
- def_bool y
-
-config SH_CLK_CPG_LEGACY
- depends on SH_CLK_CPG
- def_bool y if !CPU_SUBTYPE_SH7785 && !ARCH_SHMOBILE && \
- !CPU_SHX3 && !CPU_SUBTYPE_SH7757 && \
- !CPU_SUBTYPE_SH7734 && !CPU_SUBTYPE_SH7264 && \
- !CPU_SUBTYPE_SH7269
-
-endmenu
-
-menu "CPU Frequency scaling"
-source "drivers/cpufreq/Kconfig"
-endmenu
-
-source "arch/sh/drivers/Kconfig"
-
-endmenu
-
-menu "Kernel features"
-
-source "kernel/Kconfig.hz"
-
-config KEXEC
- bool "kexec system call (EXPERIMENTAL)"
- depends on MMU
- select KEXEC_CORE
- help
- kexec is a system call that implements the ability to shutdown your
- current kernel, and to start another kernel. It is like a reboot
- but it is independent of the system firmware. And like a reboot
- you can start any kernel with it, not just Linux.
-
- The name comes from the similarity to the exec system call.
-
- It is an ongoing process to be certain the hardware in a machine
- is properly shutdown, so do not be surprised if this code does not
- initially work for you. As of this writing the exact hardware
- interface is strongly in flux, so no good recommendation can be
- made.
-
-config CRASH_DUMP
- bool "kernel crash dumps (EXPERIMENTAL)"
- depends on BROKEN_ON_SMP
- help
- Generate crash dump after being started by kexec.
- This should be normally only set in special crash dump kernels
- which are loaded in the main kernel with kexec-tools into
- a specially reserved region and then later executed after
- a crash by kdump/kexec. The crash dump kernel must be compiled
- to a memory address not used by the main kernel using
- PHYSICAL_START.
-
- For more details see Documentation/admin-guide/kdump/kdump.rst
-
-config KEXEC_JUMP
- bool "kexec jump (EXPERIMENTAL)"
- depends on KEXEC && HIBERNATION
- help
- Jump between original kernel and kexeced kernel and invoke
- code via KEXEC
-
-config PHYSICAL_START
- hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP)
- default MEMORY_START
- help
- This gives the physical address where the kernel is loaded
- and is ordinarily the same as MEMORY_START.
-
- Different values are primarily used in the case of kexec on panic
- where the fail safe kernel needs to run at a different address
- than the panic-ed kernel.
-
-config SMP
- bool "Symmetric multi-processing support"
- depends on SYS_SUPPORTS_SMP
- help
- This enables support for systems with more than one CPU. If you have
- a system with only one CPU, say N. If you have a system with more
- than one CPU, say Y.
-
- If you say N here, the kernel will run on uni- and multiprocessor
- machines, but will use only one CPU of a multiprocessor machine. If
- you say Y here, the kernel will run on many, but not all,
- uniprocessor machines. On a uniprocessor machine, the kernel
- will run faster if you say N here.
-
- People using multiprocessor machines who say Y here should also say
- Y to "Enhanced Real Time Clock Support", below.
-
- See also <file:Documentation/admin-guide/lockup-watchdogs.rst> and the SMP-HOWTO
- available at <https://www.tldp.org/docs.html#howto>.
-
- If you don't know what to do here, say N.
-
-config NR_CPUS
- int "Maximum number of CPUs (2-32)"
- range 2 32
- depends on SMP
- default "4" if CPU_SUBTYPE_SHX3
- default "2"
- help
- This allows you to specify the maximum number of CPUs which this
- kernel will support. The maximum supported value is 32 and the
- minimum value which makes sense is 2.
-
- This is purely to save memory - each supported CPU adds
- approximately eight kilobytes to the kernel image.
-
-config HOTPLUG_CPU
- bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
- depends on SMP
- help
- Say Y here to experiment with turning CPUs off and on. CPUs
- can be controlled through /sys/devices/system/cpu.
-
-config GUSA
- def_bool y
- depends on !SMP
- help
- This enables support for gUSA (general UserSpace Atomicity).
- This is the default implementation for both UP and non-ll/sc
- CPUs, and is used by the libc, amongst others.
-
- For additional information, design information can be found
- in <http://lc.linux.or.jp/lc2002/papers/niibe0919p.pdf>.
-
- This should only be disabled for special cases where alternate
- atomicity implementations exist.
-
-config GUSA_RB
- bool "Implement atomic operations by roll-back (gRB) (EXPERIMENTAL)"
- depends on GUSA && CPU_SH3 || (CPU_SH4 && !CPU_SH4A)
- help
- Enabling this option will allow the kernel to implement some
- atomic operations using a software implementation of load-locked/
- store-conditional (LLSC). On machines which do not have hardware
- LLSC, this should be more efficient than the other alternative of
- disabling interrupts around the atomic sequence.
-
-config HW_PERF_EVENTS
- bool "Enable hardware performance counter support for perf events"
- depends on PERF_EVENTS && CPU_HAS_PMU
- default y
- help
- Enable hardware performance counter support for perf events. If
- disabled, perf events will use software events only.
-
-source "drivers/sh/Kconfig"
-
-endmenu
-
-menu "Boot options"
-
-config USE_BUILTIN_DTB
- bool "Use builtin DTB"
- default n
- depends on SH_DEVICE_TREE
- help
- Link a device tree blob for particular hardware into the kernel,
- suppressing use of the DTB pointer provided by the bootloader.
- This option should only be used with legacy bootloaders that are
- not capable of providing a DTB to the kernel, or for experimental
- hardware without stable device tree bindings.
-
-config BUILTIN_DTB_SOURCE
- string "Source file for builtin DTB"
- default ""
- depends on USE_BUILTIN_DTB
- help
- Base name (without suffix, relative to arch/sh/boot/dts) for the
- a DTS file that will be used to produce the DTB linked into the
- kernel.
-
-config ZERO_PAGE_OFFSET
- hex
- default "0x00010000" if PAGE_SIZE_64KB || SH_RTS7751R2D || \
- SH_7751_SOLUTION_ENGINE
- default "0x00004000" if PAGE_SIZE_16KB || SH_SH03
- default "0x00002000" if PAGE_SIZE_8KB
- default "0x00001000"
- help
- This sets the default offset of zero page.
-
-config BOOT_LINK_OFFSET
- hex
- default "0x00210000" if SH_SHMIN
- default "0x00810000" if SH_7780_SOLUTION_ENGINE
- default "0x009e0000" if SH_TITAN
- default "0x01800000" if SH_SDK7780
- default "0x02000000" if SH_EDOSK7760
- default "0x00800000"
- help
- This option allows you to set the link address offset of the zImage.
- This can be useful if you are on a board which has a small amount of
- memory.
-
-config ENTRY_OFFSET
- hex
- default "0x00001000" if PAGE_SIZE_4KB
- default "0x00002000" if PAGE_SIZE_8KB
- default "0x00004000" if PAGE_SIZE_16KB
- default "0x00010000" if PAGE_SIZE_64KB
- default "0x00000000"
-
-config ROMIMAGE_MMCIF
- bool "Include MMCIF loader in romImage (EXPERIMENTAL)"
- depends on CPU_SUBTYPE_SH7724
- help
- Say Y here to include experimental MMCIF loading code in
- romImage. With this enabled it is possible to write the romImage
- kernel image to an MMC card and boot the kernel straight from
- the reset vector. At reset the processor Mask ROM will load the
- first part of the romImage which in turn loads the rest the kernel
- image to RAM using the MMCIF hardware block.
-
-choice
- prompt "Kernel command line"
- optional
- default CMDLINE_OVERWRITE
- help
- Setting this option allows the kernel command line arguments
- to be set.
-
-config CMDLINE_OVERWRITE
- bool "Overwrite bootloader kernel arguments"
- help
- Given string will overwrite any arguments passed in by
- a bootloader.
-
-config CMDLINE_EXTEND
- bool "Extend bootloader kernel arguments"
- help
- Given string will be concatenated with arguments passed in
- by a bootloader.
-
-endchoice
-
-config CMDLINE
- string "Kernel command line arguments string"
- depends on CMDLINE_OVERWRITE || CMDLINE_EXTEND
- default "console=ttySC1,115200"
-
-endmenu
-
-menu "Bus options"
-
-config SUPERHYWAY
- tristate "SuperHyway Bus support"
- depends on CPU_SUBTYPE_SH4_202
-
-config MAPLE
- bool "Maple Bus support"
- depends on SH_DREAMCAST
- help
- The Maple Bus is SEGA's serial communication bus for peripherals
- on the Dreamcast. Without this bus support you won't be able to
- get your Dreamcast keyboard etc to work, so most users
- probably want to say 'Y' here, unless you are only using the
- Dreamcast with a serial line terminal or a remote network
- connection.
-
-endmenu
-
-menu "Power management options (EXPERIMENTAL)"
-
-source "kernel/power/Kconfig"
-
-source "drivers/cpuidle/Kconfig"
-
-endmenu
diff --git a/arch/sh/Kconfig.cpu b/arch/sh/Kconfig.cpu
deleted file mode 100644
index fff419f3d7574c..00000000000000
--- a/arch/sh/Kconfig.cpu
+++ /dev/null
@@ -1,100 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-menu "Processor features"
-
-choice
- prompt "Endianness selection"
- default CPU_LITTLE_ENDIAN
- help
- Some SuperH machines can be configured for either little or big
- endian byte order. These modes require different kernels.
-
-config CPU_LITTLE_ENDIAN
- bool "Little Endian"
-
-config CPU_BIG_ENDIAN
- bool "Big Endian"
-
-endchoice
-
-config SH_FPU
- def_bool y
- prompt "FPU support"
- depends on CPU_HAS_FPU
- help
- Selecting this option will enable support for SH processors that
- have FPU units (ie, SH77xx).
-
- This option must be set in order to enable the FPU.
-
-config SH_FPU_EMU
- def_bool n
- prompt "FPU emulation support"
- depends on !SH_FPU
- help
- Selecting this option will enable support for software FPU emulation.
- Most SH-3 users will want to say Y here, whereas most SH-4 users will
- want to say N.
-
-config SH_DSP
- def_bool y
- prompt "DSP support"
- depends on CPU_HAS_DSP
- help
- Selecting this option will enable support for SH processors that
- have DSP units (ie, SH2-DSP, SH3-DSP, and SH4AL-DSP).
-
- This option must be set in order to enable the DSP.
-
-config SH_ADC
- def_bool y
- prompt "ADC support"
- depends on CPU_SH3
- help
- Selecting this option will allow the Linux kernel to use SH3 on-chip
- ADC module.
-
- If unsure, say N.
-
-config SH_STORE_QUEUES
- bool "Support for Store Queues"
- depends on CPU_SH4
- help
- Selecting this option will enable an in-kernel API for manipulating
- the store queues integrated in the SH-4 processors.
-
-config SPECULATIVE_EXECUTION
- bool "Speculative subroutine return"
- depends on CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 || CPU_SUBTYPE_SH7786
- help
- This enables support for a speculative instruction fetch for
- subroutine return. There are various pitfalls associated with
- this, as outlined in the SH7780 hardware manual.
-
- If unsure, say N.
-
-config CPU_HAS_INTEVT
- bool
-
-config CPU_HAS_IPR_IRQ
- bool
-
-config CPU_HAS_SR_RB
- bool
- help
- This will enable the use of SR.RB register bank usage. Processors
- that are lacking this bit must have another method in place for
- accomplishing what is taken care of by the banked registers.
-
- See <file:Documentation/sh/register-banks.rst> for further
- information on SR.RB and register banking in the kernel in general.
-
-config CPU_HAS_PTEAEX
- bool
-
-config CPU_HAS_DSP
- bool
-
-config CPU_HAS_FPU
- bool
-
-endmenu
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
deleted file mode 100644
index 10290e5c1f4387..00000000000000
--- a/arch/sh/Kconfig.debug
+++ /dev/null
@@ -1,78 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-
-config SH_STANDARD_BIOS
- bool "Use LinuxSH standard BIOS"
- help
- Say Y here if your target has the gdb-sh-stub
- package from http://www.m17n.org (or any conforming standard LinuxSH BIOS)
- in FLASH or EPROM. The kernel will use standard BIOS calls during
- boot for various housekeeping tasks (including calls to read and
- write characters to a system console, get a MAC address from an
- on-board Ethernet interface, and shut down the hardware). Note this
- does not work with machines with an existing operating system in
- mask ROM and no flash (WindowsCE machines fall in this category).
- If unsure, say N.
-
-config STACK_DEBUG
- bool "Check for stack overflows"
- depends on DEBUG_KERNEL
- help
- This option will cause messages to be printed if free stack space
- drops below a certain limit. Saying Y here will add overhead to
- every function call and will therefore incur a major
- performance hit. Most users should say N.
-
-config 4KSTACKS
- bool "Use 4Kb for kernel stacks instead of 8Kb"
- depends on DEBUG_KERNEL && (MMU || BROKEN) && !PAGE_SIZE_64KB
- help
- If you say Y here the kernel will use a 4Kb stacksize for the
- kernel stack attached to each process/thread. This facilitates
- running more threads on a system and also reduces the pressure
- on the VM subsystem for higher order allocations. This option
- will also use IRQ stacks to compensate for the reduced stackspace.
-
-config IRQSTACKS
- bool "Use separate kernel stacks when processing interrupts"
- depends on DEBUG_KERNEL && BROKEN
- help
- If you say Y here the kernel will use separate kernel stacks
- for handling hard and soft interrupts. This can help avoid
- overflowing the process kernel stacks.
-
-config DUMP_CODE
- bool "Show disassembly of nearby code in register dumps"
- depends on DEBUG_KERNEL
- default y if DEBUG_BUGVERBOSE
- default n
- help
- This prints out a code trace of the instructions leading up to
- the faulting instruction as a debugging aid. As this does grow
- the kernel in size a bit, most users will want to say N here.
-
- Those looking for more verbose debugging output should say Y.
-
-config DWARF_UNWINDER
- bool "Enable the DWARF unwinder for stacktraces"
- depends on DEBUG_KERNEL
- select FRAME_POINTER
- default n
- help
- Enabling this option will make stacktraces more accurate, at
- the cost of an increase in overall kernel size.
-
-config SH_NO_BSS_INIT
- bool "Avoid zeroing BSS (to speed-up startup on suitable platforms)"
- depends on DEBUG_KERNEL
- default n
- help
- If running in painfully slow environments, such as an RTL
- simulation or from remote memory via SHdebug, where the memory
- can already be guaranteed to ber zeroed on boot, say Y.
-
- For all other cases, say N. If this option seems perplexing, or
- you aren't sure, say N.
-
-config MCOUNT
- def_bool y
- depends on STACK_DEBUG || FUNCTION_TRACER
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
deleted file mode 100644
index 5c8776482530c3..00000000000000
--- a/arch/sh/Makefile
+++ /dev/null
@@ -1,215 +0,0 @@
-#
-# arch/sh/Makefile
-#
-# Copyright (C) 1999 Kaz Kojima
-# Copyright (C) 2002 - 2008 Paul Mundt
-# Copyright (C) 2002 M. R. Brown
-#
-# This file is subject to the terms and conditions of the GNU General Public
-# License. See the file "COPYING" in the main directory of this archive
-# for more details.
-#
-ifdef cross_compiling
- ifeq ($(CROSS_COMPILE),)
- CROSS_COMPILE := $(call cc-cross-prefix, sh-linux- sh-linux-gnu- sh-unknown-linux-gnu-)
- endif
-endif
-
-KBUILD_DEFCONFIG := shx3_defconfig
-
-isa-y := any
-isa-$(CONFIG_SH_DSP) := sh
-isa-$(CONFIG_CPU_SH2) := sh2
-isa-$(CONFIG_CPU_SH2A) := sh2a
-isa-$(CONFIG_CPU_SH3) := sh3
-isa-$(CONFIG_CPU_SH4) := sh4
-isa-$(CONFIG_CPU_SH4A) := sh4a
-isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al
-
-isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp
-isa-y := $(isa-y)-up
-
-cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,)
-cflags-$(CONFIG_CPU_J2) += $(call cc-option,-mj2,)
-cflags-$(CONFIG_CPU_SH2A) += $(call cc-option,-m2a,) \
- $(call cc-option,-m2a-nofpu,) \
- $(call cc-option,-m4-nofpu,)
-cflags-$(CONFIG_CPU_SH3) := $(call cc-option,-m3,)
-cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \
- $(call cc-option,-mno-implicit-fp,-m4-nofpu)
-cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \
- $(call cc-option,-m4a-nofpu,)
-cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,)
-
-ifeq ($(cflags-y),)
-#
-# In the case where we are stuck with a compiler that has been uselessly
-# restricted to a particular ISA, a favourite default of newer GCCs when
-# extensive multilib targets are not provided, ensure we get the best fit
-# regarding FP generation. This is intentionally stupid (albeit many
-# orders of magnitude less than GCC's default behaviour), as anything
-# with a large number of multilib targets better have been built
-# correctly for the target in mind.
-#
-cflags-y += $(shell $(CC) $(KBUILD_CFLAGS) -print-multi-lib | \
- grep nofpu | sed q | sed -e 's/^/-/;s/;.*$$//')
-# At this point, anything goes.
-isaflags-y := $(call as-option,-Wa$(comma)-isa=any,)
-else
-#
-# -Wa,-isa= tuning implies -Wa,-dsp for the versions of binutils that
-# support it, while -Wa,-dsp by itself limits the range of usable opcodes
-# on certain CPU subtypes. Try the ISA variant first, and if that fails,
-# fall back on -Wa,-dsp for the old binutils versions. Even without DSP
-# opcodes, we always want the best ISA tuning the version of binutils
-# will provide.
-#
-isaflags-y := $(call as-option,-Wa$(comma)-isa=$(isa-y),)
-
-isaflags-$(CONFIG_SH_DSP) := \
- $(call as-option,-Wa$(comma)-isa=$(isa-y),-Wa$(comma)-dsp)
-endif
-
-cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb
-cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml
-
-cflags-y += $(call cc-option,-mno-fdpic)
-cflags-y += $(isaflags-y) -ffreestanding
-
-OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment \
- -R .stab -R .stabstr -S
-
-# Give the various platforms the opportunity to set default image types
-defaultimage-y := zImage
-defaultimage-$(CONFIG_SH_SH7785LCR) := uImage
-defaultimage-$(CONFIG_SH_RSK) := uImage
-defaultimage-$(CONFIG_SH_URQUELL) := uImage
-defaultimage-$(CONFIG_SH_MIGOR) := uImage
-defaultimage-$(CONFIG_SH_AP325RXA) := uImage
-defaultimage-$(CONFIG_SH_SH7757LCR) := uImage
-defaultimage-$(CONFIG_SH_7724_SOLUTION_ENGINE) := uImage
-defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux
-defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux
-
-# Set some sensible Kbuild defaults
-boot := arch/sh/boot
-KBUILD_IMAGE := $(boot)/$(defaultimage-y)
-
-#
-# Choosing incompatible machines durings configuration will result in
-# error messages during linking.
-#
-UTS_MACHINE := sh
-LDFLAGS_vmlinux += -e _stext
-
-ifdef CONFIG_CPU_LITTLE_ENDIAN
-ld-bfd := elf32-sh-linux
-LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
-KBUILD_LDFLAGS += -EL
-else
-ld-bfd := elf32-shbig-linux
-LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
-KBUILD_LDFLAGS += -EB
-endif
-
-export ld-bfd
-
-# Mach groups
-machdir-$(CONFIG_SOLUTION_ENGINE) += mach-se
-machdir-$(CONFIG_SH_HP6XX) += mach-hp6xx
-machdir-$(CONFIG_SH_DREAMCAST) += mach-dreamcast
-machdir-$(CONFIG_SH_SH03) += mach-sh03
-machdir-$(CONFIG_SH_RTS7751R2D) += mach-r2d
-machdir-$(CONFIG_SH_HIGHLANDER) += mach-highlander
-machdir-$(CONFIG_SH_MIGOR) += mach-migor
-machdir-$(CONFIG_SH_AP325RXA) += mach-ap325rxa
-machdir-$(CONFIG_SH_KFR2R09) += mach-kfr2r09
-machdir-$(CONFIG_SH_ECOVEC) += mach-ecovec24
-machdir-$(CONFIG_SH_SDK7780) += mach-sdk7780
-machdir-$(CONFIG_SH_SDK7786) += mach-sdk7786
-machdir-$(CONFIG_SH_X3PROTO) += mach-x3proto
-machdir-$(CONFIG_SH_SH7763RDP) += mach-sh7763rdp
-machdir-$(CONFIG_SH_SH4202_MICRODEV) += mach-microdev
-machdir-$(CONFIG_SH_LANDISK) += mach-landisk
-machdir-$(CONFIG_SH_LBOX_RE2) += mach-lboxre2
-machdir-$(CONFIG_SH_RSK) += mach-rsk
-
-ifneq ($(machdir-y),)
-core-y += $(addprefix arch/sh/boards/, \
- $(filter-out ., $(patsubst %,%/,$(machdir-y))))
-endif
-
-# Common machine type headers. Not part of the arch/sh/boards/ hierarchy.
-machdir-y += mach-common
-
-# Companion chips
-core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/
-
-#
-# CPU header paths
-#
-# These are ordered by optimization level. A CPU family that is a subset
-# of another (ie, SH-2A / SH-2), is picked up first, with increasing
-# levels of genericness if nothing more suitable is situated in the
-# hierarchy.
-#
-# As an example, in order of preference, SH-2A > SH-2 > common definitions.
-#
-cpuincdir-$(CONFIG_CPU_SH2A) += cpu-sh2a
-cpuincdir-$(CONFIG_CPU_SH2) += cpu-sh2
-cpuincdir-$(CONFIG_CPU_SH3) += cpu-sh3
-cpuincdir-$(CONFIG_CPU_SH4A) += cpu-sh4a
-cpuincdir-$(CONFIG_CPU_SH4) += cpu-sh4
-cpuincdir-y += cpu-common # Must be last
-
-drivers-y += arch/sh/drivers/
-
-cflags-y += $(foreach d, $(cpuincdir-y), -I $(srctree)/arch/sh/include/$(d)) \
- $(foreach d, $(machdir-y), -I $(srctree)/arch/sh/include/$(d))
-
-KBUILD_CFLAGS += -pipe $(cflags-y)
-KBUILD_CPPFLAGS += $(cflags-y)
-KBUILD_AFLAGS += $(cflags-y)
-
-ifeq ($(CONFIG_MCOUNT),y)
- KBUILD_CFLAGS += -pg
-endif
-
-ifeq ($(CONFIG_DWARF_UNWINDER),y)
- KBUILD_CFLAGS += -fasynchronous-unwind-tables
-endif
-
-libs-y := arch/sh/lib/ $(libs-y)
-
-BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.xz uImage.lzo \
- uImage.srec uImage.bin zImage vmlinux.bin vmlinux.srec \
- romImage
-PHONY += $(BOOT_TARGETS)
-
-all: $(notdir $(KBUILD_IMAGE))
-
-$(BOOT_TARGETS): vmlinux
- $(Q)$(MAKE) $(build)=$(boot) $(boot)/[email protected]
-
-compressed: zImage
-
-archprepare:
- $(Q)$(MAKE) $(build)=arch/sh/tools include/generated/machtypes.h
-
-archheaders:
- $(Q)$(MAKE) $(build)=arch/sh/kernel/syscalls all
-
-define archhelp
- @echo ' zImage - Compressed kernel image'
- @echo ' romImage - Compressed ROM image, if supported'
- @echo ' vmlinux.srec - Create an ELF S-record'
- @echo ' vmlinux.bin - Create an uncompressed binary image'
- @echo '* uImage - Alias to bootable U-Boot image'
- @echo ' uImage.srec - Create an S-record for U-Boot'
- @echo ' uImage.bin - Kernel-only image for U-Boot (bin)'
- @echo '* uImage.gz - Kernel-only image for U-Boot (gzip)'
- @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)'
- @echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)'
- @echo ' uImage.xz - Kernel-only image for U-Boot (xz)'
- @echo ' uImage.lzo - Kernel-only image for U-Boot (lzo)'
-endef
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
deleted file mode 100644
index 83bcb6d2dacadd..00000000000000
--- a/arch/sh/boards/Kconfig
+++ /dev/null
@@ -1,400 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-menu "Board support"
-
-config SOLUTION_ENGINE
- bool
-
-config SH_ALPHA_BOARD
- bool
-
-config SH_CUSTOM_CLK
- def_bool y
- depends on !SH_DEVICE_TREE
- select HAVE_LEGACY_CLK
-
-config SH_DEVICE_TREE
- bool
- select OF
- select OF_EARLY_FLATTREE
- select TIMER_OF
- select COMMON_CLK
- select GENERIC_CALIBRATE_DELAY
-
-config SH_JCORE_SOC
- bool "J-Core SoC"
- select SH_DEVICE_TREE
- select CLKSRC_JCORE_PIT
- select JCORE_AIC
- depends on CPU_J2
- help
- Select this option to include drivers core components of the
- J-Core SoC, including interrupt controllers and timers.
-
-config SH_SOLUTION_ENGINE
- bool "SolutionEngine"
- select SOLUTION_ENGINE
- select CPU_HAS_IPR_IRQ
- depends on CPU_SUBTYPE_SH7705 || CPU_SUBTYPE_SH7709 || CPU_SUBTYPE_SH7710 || \
- CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7750S || \
- CPU_SUBTYPE_SH7750R
- help
- Select SolutionEngine if configuring for a Hitachi SH7705, SH7709,
- SH7710, SH7712, SH7750, SH7750S or SH7750R evaluation board.
-
-config SH_7206_SOLUTION_ENGINE
- bool "SolutionEngine7206"
- select SOLUTION_ENGINE
- depends on CPU_SUBTYPE_SH7206
- help
- Select 7206 SolutionEngine if configuring for a Hitachi SH7206
- evaluation board.
-
-config SH_7619_SOLUTION_ENGINE
- bool "SolutionEngine7619"
- select SOLUTION_ENGINE
- depends on CPU_SUBTYPE_SH7619
- help
- Select 7619 SolutionEngine if configuring for a Hitachi SH7619
- evaluation board.
-
-config SH_7721_SOLUTION_ENGINE
- bool "SolutionEngine7721"
- select SOLUTION_ENGINE
- depends on CPU_SUBTYPE_SH7721
- help
- Select 7721 SolutionEngine if configuring for a Hitachi SH7721
- evaluation board.
-
-config SH_7722_SOLUTION_ENGINE
- bool "SolutionEngine7722"
- select SOLUTION_ENGINE
- select GENERIC_IRQ_CHIP
- select IRQ_DOMAIN
- depends on CPU_SUBTYPE_SH7722
- help
- Select 7722 SolutionEngine if configuring for a Hitachi SH772
- evaluation board.
-
-config SH_7724_SOLUTION_ENGINE
- bool "SolutionEngine7724"
- select SOLUTION_ENGINE
- depends on CPU_SUBTYPE_SH7724
- select GPIOLIB
- select SND_SOC_AK4642 if SND_SIMPLE_CARD
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
- help
- Select 7724 SolutionEngine if configuring for a Hitachi SH7724
- evaluation board.
-
-config SH_7751_SOLUTION_ENGINE
- bool "SolutionEngine7751"
- select SOLUTION_ENGINE
- select CPU_HAS_IPR_IRQ
- depends on CPU_SUBTYPE_SH7751
- help
- Select 7751 SolutionEngine if configuring for a Hitachi SH7751
- evaluation board.
-
-config SH_7780_SOLUTION_ENGINE
- bool "SolutionEngine7780"
- select SOLUTION_ENGINE
- select HAVE_PCI
- depends on CPU_SUBTYPE_SH7780
- help
- Select 7780 SolutionEngine if configuring for a Renesas SH7780
- evaluation board.
-
-config SH_7343_SOLUTION_ENGINE
- bool "SolutionEngine7343"
- select SOLUTION_ENGINE
- select GENERIC_IRQ_CHIP
- select IRQ_DOMAIN
- depends on CPU_SUBTYPE_SH7343
- help
- Select 7343 SolutionEngine if configuring for a Hitachi
- SH7343 (SH-Mobile 3AS) evaluation board.
-
-config SH_HP6XX
- bool "HP6XX"
- select SYS_SUPPORTS_APM_EMULATION
- select HD6446X_SERIES
- depends on CPU_SUBTYPE_SH7709
- help
- Select HP6XX if configuring for a HP jornada HP6xx.
- More information (hardware only) at
- <http://www.hp.com/jornada/>.
-
-config SH_DREAMCAST
- bool "Dreamcast"
- select HAVE_PCI
- depends on CPU_SUBTYPE_SH7091
- help
- Select Dreamcast if configuring for a SEGA Dreamcast.
- More information at <http://www.linux-sh.org>
-
-config SH_SH03
- bool "Interface CTP/PCI-SH03"
- depends on CPU_SUBTYPE_SH7751
- select CPU_HAS_IPR_IRQ
- select HAVE_PCI
- help
- CTP/PCI-SH03 is a CPU module computer that is produced
- by Interface Corporation.
- More information at <http://www.interface.co.jp>
-
-config SH_SECUREEDGE5410
- bool "SecureEdge5410"
- depends on CPU_SUBTYPE_SH7751R
- select CPU_HAS_IPR_IRQ
- select HAVE_PCI
- help
- Select SecureEdge5410 if configuring for a SnapGear SH board.
- This includes both the OEM SecureEdge products as well as the
- SME product line.
-
-config SH_RTS7751R2D
- bool "RTS7751R2D"
- depends on CPU_SUBTYPE_SH7751R
- select HAVE_PCI
- select IO_TRAPPED if MMU
- help
- Select RTS7751R2D if configuring for a Renesas Technology
- Sales SH-Graphics board.
-
-config SH_RSK
- bool "Renesas Starter Kit"
- depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203 || \
- CPU_SUBTYPE_SH7264 || CPU_SUBTYPE_SH7269
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
- help
- Select this option if configuring for any of the RSK+ MCU
- evaluation platforms.
-
-config SH_SDK7780
- bool "SDK7780R3"
- depends on CPU_SUBTYPE_SH7780
- select HAVE_PCI
- help
- Select SDK7780 if configuring for a Renesas SH7780 SDK7780R3
- evaluation board.
-
-config SH_SDK7786
- bool "SDK7786"
- depends on CPU_SUBTYPE_SH7786
- select HAVE_PCI
- select NO_IOPORT_MAP if !PCI
- select HAVE_SRAM_POOL
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
- help
- Select SDK7786 if configuring for a Renesas Technology Europe
- SH7786-65nm board.
-
-config SH_HIGHLANDER
- bool "Highlander"
- depends on CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785
- select HAVE_PCI
- select IO_TRAPPED if MMU
-
-config SH_SH7757LCR
- bool "SH7757LCR"
- depends on CPU_SUBTYPE_SH7757
- select GPIOLIB
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
-
-config SH_SH7785LCR
- bool "SH7785LCR"
- depends on CPU_SUBTYPE_SH7785
- select HAVE_PCI
-
-config SH_SH7785LCR_29BIT_PHYSMAPS
- bool "SH7785LCR 29bit physmaps"
- depends on SH_SH7785LCR && 29BIT
- default y
- help
- This board has 2 physical memory maps. It can be changed with
- DIP switch(S2-5). If you set the DIP switch for S2-5 = ON,
- you can access all on-board device in 29bit address mode.
-
-config SH_SH7785LCR_PT
- bool "SH7785LCR prototype board on 32-bit MMU mode"
- depends on SH_SH7785LCR && 32BIT
- default n
- help
- If you use prototype board, this option is enabled.
-
-config SH_URQUELL
- bool "Urquell"
- depends on CPU_SUBTYPE_SH7786
- select GPIOLIB
- select HAVE_PCI
- select NO_IOPORT_MAP if !PCI
-
-config SH_MIGOR
- bool "Migo-R"
- depends on CPU_SUBTYPE_SH7722
- select GPIOLIB
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
- help
- Select Migo-R if configuring for the SH7722 Migo-R platform
- by Renesas System Solutions Asia Pte. Ltd.
-
-config SH_AP325RXA
- bool "AP-325RXA"
- depends on CPU_SUBTYPE_SH7723
- select GPIOLIB
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
- help
- Renesas "AP-325RXA" support.
- Compatible with ALGO SYSTEM CO.,LTD. "AP-320A"
-
-config SH_KFR2R09
- bool "KFR2R09"
- depends on CPU_SUBTYPE_SH7724
- select GPIOLIB
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
- help
- "Kit For R2R for 2009" support.
-
-config SH_ECOVEC
- bool "EcoVec"
- depends on CPU_SUBTYPE_SH7724
- select GPIOLIB
- select SND_SOC_DA7210 if SND_SIMPLE_CARD
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
- help
- Renesas "R0P7724LC0011/21RL (EcoVec)" support.
-
-config SH_SH7763RDP
- bool "SH7763RDP"
- depends on CPU_SUBTYPE_SH7763
- help
- Select SH7763RDP if configuring for a Renesas SH7763
- evaluation board.
-
-config SH_ESPT
- bool "ESPT"
- depends on CPU_SUBTYPE_SH7763
- help
- Select ESPT if configuring for a Renesas SH7763
- with gigabit ether evaluation board.
-
-config SH_EDOSK7705
- bool "EDOSK7705"
- depends on CPU_SUBTYPE_SH7705
-
-config SH_EDOSK7760
- bool "EDOSK7760"
- depends on CPU_SUBTYPE_SH7760
- help
- Select if configuring for a Renesas EDOSK7760
- evaluation board.
-
-config SH_SH4202_MICRODEV
- bool "SH4-202 MicroDev"
- depends on CPU_SUBTYPE_SH4_202
- help
- Select SH4-202 MicroDev if configuring for a SuperH MicroDev board
- with an SH4-202 CPU.
-
-config SH_LANDISK
- bool "LANDISK"
- depends on CPU_SUBTYPE_SH7751R
- select HAVE_PCI
- help
- I-O DATA DEVICE, INC. "LANDISK Series" support.
-
-config SH_TITAN
- bool "TITAN"
- depends on CPU_SUBTYPE_SH7751R
- select CPU_HAS_IPR_IRQ
- select HAVE_PCI
- help
- Select Titan if you are configuring for a Nimble Microsystems
- NetEngine NP51R.
-
-config SH_SHMIN
- bool "SHMIN"
- depends on CPU_SUBTYPE_SH7706
- select CPU_HAS_IPR_IRQ
- help
- Select SHMIN if configuring for the SHMIN board.
-
-config SH_LBOX_RE2
- bool "L-BOX RE2"
- depends on CPU_SUBTYPE_SH7751R
- select HAVE_PCI
- help
- Select L-BOX RE2 if configuring for the NTT COMWARE L-BOX RE2.
-
-config SH_X3PROTO
- bool "SH-X3 Prototype board"
- depends on CPU_SUBTYPE_SHX3
- select NO_IOPORT_MAP if !PCI
- select IRQ_DOMAIN
-
-config SH_MAGIC_PANEL_R2
- bool "Magic Panel R2"
- depends on CPU_SUBTYPE_SH7720
- select GPIOLIB
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
- help
- Select Magic Panel R2 if configuring for Magic Panel R2.
-
-config SH_POLARIS
- bool "SMSC Polaris"
- select CPU_HAS_IPR_IRQ
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
- depends on CPU_SUBTYPE_SH7709
- help
- Select if configuring for an SMSC Polaris development board
-
-config SH_SH2007
- bool "SH-2007 board"
- select NO_IOPORT_MAP
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
- depends on CPU_SUBTYPE_SH7780
- help
- SH-2007 is a single-board computer based around SH7780 chip
- intended for embedded applications.
- It has an Ethernet interface (SMC9118), direct connected
- Compact Flash socket, two serial ports and PC-104 bus.
- More information at <http://sh2000.sh-linux.org>.
-
-config SH_APSH4A3A
- bool "AP-SH4A-3A"
- select SH_ALPHA_BOARD
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
- depends on CPU_SUBTYPE_SH7785
- help
- Select AP-SH4A-3A if configuring for an ALPHAPROJECT AP-SH4A-3A.
-
-config SH_APSH4AD0A
- bool "AP-SH4AD-0A"
- select SH_ALPHA_BOARD
- select HAVE_PCI
- select REGULATOR_FIXED_VOLTAGE if REGULATOR
- depends on CPU_SUBTYPE_SH7786
- help
- Select AP-SH4AD-0A if configuring for an ALPHAPROJECT AP-SH4AD-0A.
-
-source "arch/sh/boards/mach-r2d/Kconfig"
-source "arch/sh/boards/mach-highlander/Kconfig"
-source "arch/sh/boards/mach-sdk7780/Kconfig"
-source "arch/sh/boards/mach-migor/Kconfig"
-source "arch/sh/boards/mach-rsk/Kconfig"
-
-if SH_MAGIC_PANEL_R2
-
-menu "Magic Panel R2 options"
-
-config SH_MAGIC_PANEL_R2_VERSION
- int "Magic Panel R2 Version"
- default "3"
- help
- Set the version of the Magic Panel R2
-
-endmenu
-
-endif
-
-endmenu
diff --git a/arch/sh/boards/Makefile b/arch/sh/boards/Makefile
deleted file mode 100644
index 4002a22a7c409b..00000000000000
--- a/arch/sh/boards/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Specific board support, not covered by a mach group.
-#
-obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o
-obj-$(CONFIG_SH_SECUREEDGE5410) += board-secureedge5410.o
-obj-$(CONFIG_SH_SH2007) += board-sh2007.o
-obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o
-obj-$(CONFIG_SH_URQUELL) += board-urquell.o
-obj-$(CONFIG_SH_SHMIN) += board-shmin.o
-obj-$(CONFIG_SH_EDOSK7705) += board-edosk7705.o
-obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o
-obj-$(CONFIG_SH_ESPT) += board-espt.o
-obj-$(CONFIG_SH_POLARIS) += board-polaris.o
-obj-$(CONFIG_SH_TITAN) += board-titan.o
-obj-$(CONFIG_SH_SH7757LCR) += board-sh7757lcr.o
-obj-$(CONFIG_SH_APSH4A3A) += board-apsh4a3a.o
-obj-$(CONFIG_SH_APSH4AD0A) += board-apsh4ad0a.o
-
-obj-$(CONFIG_SH_DEVICE_TREE) += of-generic.o
diff --git a/arch/sh/boards/board-apsh4a3a.c b/arch/sh/boards/board-apsh4a3a.c
deleted file mode 100644
index abf19a947df354..00000000000000
--- a/arch/sh/boards/board-apsh4a3a.c
+++ /dev/null
@@ -1,182 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * ALPHAPROJECT AP-SH4A-3A Support.
- *
- * Copyright (C) 2010 ALPHAPROJECT Co.,Ltd.
- * Copyright (C) 2008 Yoshihiro Shimoda
- * Copyright (C) 2009 Paul Mundt
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-#include <linux/mtd/physmap.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/smsc911x.h>
-#include <linux/irq.h>
-#include <linux/clk.h>
-#include <asm/machvec.h>
-#include <linux/sizes.h>
-#include <asm/clock.h>
-
-static struct mtd_partition nor_flash_partitions[] = {
- {
- .name = "loader",
- .offset = 0x00000000,
- .size = 512 * 1024,
- },
- {
- .name = "bootenv",
- .offset = MTDPART_OFS_APPEND,
- .size = 512 * 1024,
- },
- {
- .name = "kernel",
- .offset = MTDPART_OFS_APPEND,
- .size = 4 * 1024 * 1024,
- },
- {
- .name = "data",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data nor_flash_data = {
- .width = 4,
- .parts = nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(nor_flash_partitions),
-};
-
-static struct resource nor_flash_resources[] = {
- [0] = {
- .start = 0x00000000,
- .end = 0x01000000 - 1,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device nor_flash_device = {
- .name = "physmap-flash",
- .dev = {
- .platform_data = &nor_flash_data,
- },
- .num_resources = ARRAY_SIZE(nor_flash_resources),
- .resource = nor_flash_resources,
-};
-
-/* Dummy supplies, where voltage doesn't matter */
-static struct regulator_consumer_supply dummy_supplies[] = {
- REGULATOR_SUPPLY("vddvario", "smsc911x"),
- REGULATOR_SUPPLY("vdd33a", "smsc911x"),
-};
-
-static struct resource smsc911x_resources[] = {
- [0] = {
- .name = "smsc911x-memory",
- .start = 0xA4000000,
- .end = 0xA4000000 + SZ_256 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .name = "smsc911x-irq",
- .start = evt2irq(0x200),
- .end = evt2irq(0x200),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct smsc911x_platform_config smsc911x_config = {
- .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
- .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
- .flags = SMSC911X_USE_16BIT,
- .phy_interface = PHY_INTERFACE_MODE_MII,
-};
-
-static struct platform_device smsc911x_device = {
- .name = "smsc911x",
- .id = -1,
- .num_resources = ARRAY_SIZE(smsc911x_resources),
- .resource = smsc911x_resources,
- .dev = {
- .platform_data = &smsc911x_config,
- },
-};
-
-static struct platform_device *apsh4a3a_devices[] __initdata = {
- &nor_flash_device,
- &smsc911x_device,
-};
-
-static int __init apsh4a3a_devices_setup(void)
-{
- regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
-
- return platform_add_devices(apsh4a3a_devices,
- ARRAY_SIZE(apsh4a3a_devices));
-}
-device_initcall(apsh4a3a_devices_setup);
-
-static int apsh4a3a_clk_init(void)
-{
- struct clk *clk;
- int ret;
-
- clk = clk_get(NULL, "extal");
- if (IS_ERR(clk))
- return PTR_ERR(clk);
- ret = clk_set_rate(clk, 33333000);
- clk_put(clk);
-
- return ret;
-}
-
-/* Initialize the board */
-static void __init apsh4a3a_setup(char **cmdline_p)
-{
- printk(KERN_INFO "Alpha Project AP-SH4A-3A support:\n");
-}
-
-static void __init apsh4a3a_init_irq(void)
-{
- plat_irq_setup_pins(IRQ_MODE_IRQ7654);
-}
-
-/* Return the board specific boot mode pin configuration */
-static int apsh4a3a_mode_pins(void)
-{
- int value = 0;
-
- /* These are the factory default settings of SW1 and SW2.
- * If you change these dip switches then you will need to
- * adjust the values below as well.
- */
- value &= ~MODE_PIN0; /* Clock Mode 16 */
- value &= ~MODE_PIN1;
- value &= ~MODE_PIN2;
- value &= ~MODE_PIN3;
- value |= MODE_PIN4;
- value &= ~MODE_PIN5; /* 16-bit Area0 bus width */
- value |= MODE_PIN6; /* Area 0 SRAM interface */
- value |= MODE_PIN7;
- value |= MODE_PIN8; /* Little Endian */
- value |= MODE_PIN9; /* Master Mode */
- value |= MODE_PIN10; /* Crystal resonator */
- value |= MODE_PIN11; /* Display Unit */
- value |= MODE_PIN12;
- value &= ~MODE_PIN13; /* 29-bit address mode */
- value |= MODE_PIN14; /* No PLL step-up */
-
- return value;
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_apsh4a3a __initmv = {
- .mv_name = "AP-SH4A-3A",
- .mv_setup = apsh4a3a_setup,
- .mv_clk_init = apsh4a3a_clk_init,
- .mv_init_irq = apsh4a3a_init_irq,
- .mv_mode_pins = apsh4a3a_mode_pins,
-};
diff --git a/arch/sh/boards/board-apsh4ad0a.c b/arch/sh/boards/board-apsh4ad0a.c
deleted file mode 100644
index fa031a16c9b5c7..00000000000000
--- a/arch/sh/boards/board-apsh4ad0a.c
+++ /dev/null
@@ -1,132 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * ALPHAPROJECT AP-SH4AD-0A Support.
- *
- * Copyright (C) 2010 ALPHAPROJECT Co.,Ltd.
- * Copyright (C) 2010 Matt Fleming
- * Copyright (C) 2010 Paul Mundt
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/smsc911x.h>
-#include <linux/irq.h>
-#include <linux/clk.h>
-#include <asm/machvec.h>
-#include <linux/sizes.h>
-
-/* Dummy supplies, where voltage doesn't matter */
-static struct regulator_consumer_supply dummy_supplies[] = {
- REGULATOR_SUPPLY("vddvario", "smsc911x"),
- REGULATOR_SUPPLY("vdd33a", "smsc911x"),
-};
-
-static struct resource smsc911x_resources[] = {
- [0] = {
- .name = "smsc911x-memory",
- .start = 0xA4000000,
- .end = 0xA4000000 + SZ_256 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .name = "smsc911x-irq",
- .start = evt2irq(0x200),
- .end = evt2irq(0x200),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct smsc911x_platform_config smsc911x_config = {
- .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
- .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
- .flags = SMSC911X_USE_16BIT,
- .phy_interface = PHY_INTERFACE_MODE_MII,
-};
-
-static struct platform_device smsc911x_device = {
- .name = "smsc911x",
- .id = -1,
- .num_resources = ARRAY_SIZE(smsc911x_resources),
- .resource = smsc911x_resources,
- .dev = {
- .platform_data = &smsc911x_config,
- },
-};
-
-static struct platform_device *apsh4ad0a_devices[] __initdata = {
- &smsc911x_device,
-};
-
-static int __init apsh4ad0a_devices_setup(void)
-{
- regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
-
- return platform_add_devices(apsh4ad0a_devices,
- ARRAY_SIZE(apsh4ad0a_devices));
-}
-device_initcall(apsh4ad0a_devices_setup);
-
-static int apsh4ad0a_mode_pins(void)
-{
- int value = 0;
-
- /* These are the factory default settings of SW1 and SW2.
- * If you change these dip switches then you will need to
- * adjust the values below as well.
- */
- value |= MODE_PIN0; /* Clock Mode 3 */
- value |= MODE_PIN1;
- value &= ~MODE_PIN2;
- value &= ~MODE_PIN3;
- value &= ~MODE_PIN4; /* 16-bit Area0 bus width */
- value |= MODE_PIN5;
- value |= MODE_PIN6;
- value |= MODE_PIN7; /* Normal mode */
- value |= MODE_PIN8; /* Little Endian */
- value |= MODE_PIN9; /* Crystal resonator */
- value &= ~MODE_PIN10; /* 29-bit address mode */
- value &= ~MODE_PIN11; /* PCI-E Root port */
- value &= ~MODE_PIN12; /* 4 lane + 1 lane */
- value |= MODE_PIN13; /* AUD Enable */
- value &= ~MODE_PIN14; /* Normal Operation */
-
- return value;
-}
-
-static int apsh4ad0a_clk_init(void)
-{
- struct clk *clk;
- int ret;
-
- clk = clk_get(NULL, "extal");
- if (IS_ERR(clk))
- return PTR_ERR(clk);
- ret = clk_set_rate(clk, 33333000);
- clk_put(clk);
-
- return ret;
-}
-
-/* Initialize the board */
-static void __init apsh4ad0a_setup(char **cmdline_p)
-{
- pr_info("Alpha Project AP-SH4AD-0A support:\n");
-}
-
-static void __init apsh4ad0a_init_irq(void)
-{
- plat_irq_setup_pins(IRQ_MODE_IRQ3210);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_apsh4ad0a __initmv = {
- .mv_name = "AP-SH4AD-0A",
- .mv_setup = apsh4ad0a_setup,
- .mv_mode_pins = apsh4ad0a_mode_pins,
- .mv_clk_init = apsh4ad0a_clk_init,
- .mv_init_irq = apsh4ad0a_init_irq,
-};
diff --git a/arch/sh/boards/board-edosk7705.c b/arch/sh/boards/board-edosk7705.c
deleted file mode 100644
index 0de7d603da2d8c..00000000000000
--- a/arch/sh/boards/board-edosk7705.c
+++ /dev/null
@@ -1,79 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/renesas/edosk7705/setup.c
- *
- * Copyright (C) 2000 Kazumoto Kojima
- *
- * Hitachi SolutionEngine Support.
- *
- * Modified for edosk7705 development
- * board by S. Dunn, 2003.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/smc91x.h>
-#include <linux/sh_intc.h>
-#include <asm/machvec.h>
-#include <linux/sizes.h>
-
-#define SMC_IOBASE 0xA2000000
-#define SMC_IO_OFFSET 0x300
-#define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET)
-
-#define ETHERNET_IRQ evt2irq(0x320)
-
-static void __init sh_edosk7705_init_irq(void)
-{
- make_imask_irq(ETHERNET_IRQ);
-}
-
-/* eth initialization functions */
-static struct smc91x_platdata smc91x_info = {
- .flags = SMC91X_USE_16BIT | SMC91X_IO_SHIFT_1 | IORESOURCE_IRQ_LOWLEVEL,
-};
-
-static struct resource smc91x_res[] = {
- [0] = {
- .start = SMC_IOADDR,
- .end = SMC_IOADDR + SZ_32 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = ETHERNET_IRQ,
- .end = ETHERNET_IRQ,
- .flags = IORESOURCE_IRQ ,
- }
-};
-
-static struct platform_device smc91x_dev = {
- .name = "smc91x",
- .id = -1,
- .num_resources = ARRAY_SIZE(smc91x_res),
- .resource = smc91x_res,
-
- .dev = {
- .platform_data = &smc91x_info,
- },
-};
-
-/* platform init code */
-static struct platform_device *edosk7705_devices[] __initdata = {
- &smc91x_dev,
-};
-
-static int __init init_edosk7705_devices(void)
-{
- return platform_add_devices(edosk7705_devices,
- ARRAY_SIZE(edosk7705_devices));
-}
-device_initcall(init_edosk7705_devices);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_edosk7705 __initmv = {
- .mv_name = "EDOSK7705",
- .mv_init_irq = sh_edosk7705_init_irq,
-};
diff --git a/arch/sh/boards/board-edosk7760.c b/arch/sh/boards/board-edosk7760.c
deleted file mode 100644
index 7569d85c5ff5a8..00000000000000
--- a/arch/sh/boards/board-edosk7760.c
+++ /dev/null
@@ -1,178 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Renesas Europe EDOSK7760 Board Support
- *
- * Copyright (C) 2008 SPES Societa' Progettazione Elettronica e Software Ltd.
- * Author: Luca Santini <[email protected]>
- */
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/platform_device.h>
-#include <linux/smc91x.h>
-#include <linux/interrupt.h>
-#include <linux/sh_intc.h>
-#include <linux/i2c.h>
-#include <linux/mtd/physmap.h>
-#include <asm/machvec.h>
-#include <asm/io.h>
-#include <asm/addrspace.h>
-#include <asm/delay.h>
-#include <asm/i2c-sh7760.h>
-#include <linux/sizes.h>
-
-/* Bus state controller registers for CS4 area */
-#define BSC_CS4BCR 0xA4FD0010
-#define BSC_CS4WCR 0xA4FD0030
-
-#define SMC_IOBASE 0xA2000000
-#define SMC_IO_OFFSET 0x300
-#define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET)
-
-/* NOR flash */
-static struct mtd_partition edosk7760_nor_flash_partitions[] = {
- {
- .name = "bootloader",
- .offset = 0,
- .size = SZ_256K,
- .mask_flags = MTD_WRITEABLE, /* Read-only */
- }, {
- .name = "kernel",
- .offset = MTDPART_OFS_APPEND,
- .size = SZ_2M,
- }, {
- .name = "fs",
- .offset = MTDPART_OFS_APPEND,
- .size = (26 << 20),
- }, {
- .name = "other",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data edosk7760_nor_flash_data = {
- .width = 4,
- .parts = edosk7760_nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(edosk7760_nor_flash_partitions),
-};
-
-static struct resource edosk7760_nor_flash_resources[] = {
- [0] = {
- .name = "NOR Flash",
- .start = 0x00000000,
- .end = 0x00000000 + SZ_32M - 1,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device edosk7760_nor_flash_device = {
- .name = "physmap-flash",
- .resource = edosk7760_nor_flash_resources,
- .num_resources = ARRAY_SIZE(edosk7760_nor_flash_resources),
- .dev = {
- .platform_data = &edosk7760_nor_flash_data,
- },
-};
-
-/* i2c initialization functions */
-static struct sh7760_i2c_platdata i2c_pd = {
- .speed_khz = 400,
-};
-
-static struct resource sh7760_i2c1_res[] = {
- {
- .start = SH7760_I2C1_MMIO,
- .end = SH7760_I2C1_MMIOEND,
- .flags = IORESOURCE_MEM,
- },{
- .start = evt2irq(0x9e0),
- .end = evt2irq(0x9e0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device sh7760_i2c1_dev = {
- .dev = {
- .platform_data = &i2c_pd,
- },
-
- .name = SH7760_I2C_DEVNAME,
- .id = 1,
- .resource = sh7760_i2c1_res,
- .num_resources = ARRAY_SIZE(sh7760_i2c1_res),
-};
-
-static struct resource sh7760_i2c0_res[] = {
- {
- .start = SH7760_I2C0_MMIO,
- .end = SH7760_I2C0_MMIOEND,
- .flags = IORESOURCE_MEM,
- }, {
- .start = evt2irq(0x9c0),
- .end = evt2irq(0x9c0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device sh7760_i2c0_dev = {
- .dev = {
- .platform_data = &i2c_pd,
- },
- .name = SH7760_I2C_DEVNAME,
- .id = 0,
- .resource = sh7760_i2c0_res,
- .num_resources = ARRAY_SIZE(sh7760_i2c0_res),
-};
-
-/* eth initialization functions */
-static struct smc91x_platdata smc91x_info = {
- .flags = SMC91X_USE_16BIT | SMC91X_IO_SHIFT_1 | IORESOURCE_IRQ_LOWLEVEL,
-};
-
-static struct resource smc91x_res[] = {
- [0] = {
- .start = SMC_IOADDR,
- .end = SMC_IOADDR + SZ_32 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x2a0),
- .end = evt2irq(0x2a0),
- .flags = IORESOURCE_IRQ ,
- }
-};
-
-static struct platform_device smc91x_dev = {
- .name = "smc91x",
- .id = -1,
- .num_resources = ARRAY_SIZE(smc91x_res),
- .resource = smc91x_res,
-
- .dev = {
- .platform_data = &smc91x_info,
- },
-};
-
-/* platform init code */
-static struct platform_device *edosk7760_devices[] __initdata = {
- &smc91x_dev,
- &edosk7760_nor_flash_device,
- &sh7760_i2c0_dev,
- &sh7760_i2c1_dev,
-};
-
-static int __init init_edosk7760_devices(void)
-{
- plat_irq_setup_pins(IRQ_MODE_IRQ);
-
- return platform_add_devices(edosk7760_devices,
- ARRAY_SIZE(edosk7760_devices));
-}
-device_initcall(init_edosk7760_devices);
-
-/*
- * The Machine Vector
- */
-struct sh_machine_vector mv_edosk7760 __initmv = {
- .mv_name = "EDOSK7760",
-};
diff --git a/arch/sh/boards/board-espt.c b/arch/sh/boards/board-espt.c
deleted file mode 100644
index 6e784b5cf5a0b2..00000000000000
--- a/arch/sh/boards/board-espt.c
+++ /dev/null
@@ -1,105 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Data Technology Inc. ESPT-GIGA board support
- *
- * Copyright (C) 2008, 2009 Renesas Solutions Corp.
- * Copyright (C) 2008, 2009 Nobuhiro Iwamatsu <[email protected]>
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/mtd/physmap.h>
-#include <linux/io.h>
-#include <linux/sh_eth.h>
-#include <linux/sh_intc.h>
-#include <asm/machvec.h>
-#include <linux/sizes.h>
-
-/* NOR Flash */
-static struct mtd_partition espt_nor_flash_partitions[] = {
- {
- .name = "U-Boot",
- .offset = 0,
- .size = (2 * SZ_128K),
- .mask_flags = MTD_WRITEABLE, /* Read-only */
- }, {
- .name = "Linux-Kernel",
- .offset = MTDPART_OFS_APPEND,
- .size = (20 * SZ_128K),
- }, {
- .name = "Root Filesystem",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data espt_nor_flash_data = {
- .width = 2,
- .parts = espt_nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(espt_nor_flash_partitions),
-};
-
-static struct resource espt_nor_flash_resources[] = {
- [0] = {
- .name = "NOR Flash",
- .start = 0,
- .end = SZ_8M - 1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device espt_nor_flash_device = {
- .name = "physmap-flash",
- .resource = espt_nor_flash_resources,
- .num_resources = ARRAY_SIZE(espt_nor_flash_resources),
- .dev = {
- .platform_data = &espt_nor_flash_data,
- },
-};
-
-/* SH-Ether */
-static struct resource sh_eth_resources[] = {
- {
- .start = 0xFEE00800, /* use eth1 */
- .end = 0xFEE00F7C - 1,
- .flags = IORESOURCE_MEM,
- }, {
- .start = 0xFEE01800, /* TSU */
- .end = 0xFEE01FFF,
- .flags = IORESOURCE_MEM,
- }, {
-
- .start = evt2irq(0x920), /* irq number */
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct sh_eth_plat_data sh7763_eth_pdata = {
- .phy = 0,
- .phy_interface = PHY_INTERFACE_MODE_MII,
-};
-
-static struct platform_device espt_eth_device = {
- .name = "sh7763-gether",
- .resource = sh_eth_resources,
- .num_resources = ARRAY_SIZE(sh_eth_resources),
- .dev = {
- .platform_data = &sh7763_eth_pdata,
- },
-};
-
-static struct platform_device *espt_devices[] __initdata = {
- &espt_nor_flash_device,
- &espt_eth_device,
-};
-
-static int __init espt_devices_setup(void)
-{
- return platform_add_devices(espt_devices,
- ARRAY_SIZE(espt_devices));
-}
-device_initcall(espt_devices_setup);
-
-static struct sh_machine_vector mv_espt __initmv = {
- .mv_name = "ESPT-GIGA",
-};
diff --git a/arch/sh/boards/board-magicpanelr2.c b/arch/sh/boards/board-magicpanelr2.c
deleted file mode 100644
index 56bd386ff3b043..00000000000000
--- a/arch/sh/boards/board-magicpanelr2.c
+++ /dev/null
@@ -1,390 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/magicpanel/setup.c
- *
- * Copyright (C) 2007 Markus Brunner, Mark Jonas
- *
- * Magic Panel Release 2 board setup
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/gpio.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/smsc911x.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/map.h>
-#include <linux/sh_intc.h>
-#include <mach/magicpanelr2.h>
-#include <asm/heartbeat.h>
-#include <cpu/sh7720.h>
-
-/* Dummy supplies, where voltage doesn't matter */
-static struct regulator_consumer_supply dummy_supplies[] = {
- REGULATOR_SUPPLY("vddvario", "smsc911x"),
- REGULATOR_SUPPLY("vdd33a", "smsc911x"),
-};
-
-#define LAN9115_READY (__raw_readl(0xA8000084UL) & 0x00000001UL)
-
-/* Wait until reset finished. Timeout is 100ms. */
-static int __init ethernet_reset_finished(void)
-{
- int i;
-
- if (LAN9115_READY)
- return 1;
-
- for (i = 0; i < 10; ++i) {
- mdelay(10);
- if (LAN9115_READY)
- return 1;
- }
-
- return 0;
-}
-
-static void __init reset_ethernet(void)
-{
- /* PMDR: LAN_RESET=on */
- CLRBITS_OUTB(0x10, PORT_PMDR);
-
- udelay(200);
-
- /* PMDR: LAN_RESET=off */
- SETBITS_OUTB(0x10, PORT_PMDR);
-}
-
-static void __init setup_chip_select(void)
-{
- /* CS2: LAN (0x08000000 - 0x0bffffff) */
- /* no idle cycles, normal space, 8 bit data bus */
- __raw_writel(0x36db0400, CS2BCR);
- /* (SW:1.5 WR:3 HW:1.5), ext. wait */
- __raw_writel(0x000003c0, CS2WCR);
-
- /* CS4: CAN1 (0xb0000000 - 0xb3ffffff) */
- /* no idle cycles, normal space, 8 bit data bus */
- __raw_writel(0x00000200, CS4BCR);
- /* (SW:1.5 WR:3 HW:1.5), ext. wait */
- __raw_writel(0x00100981, CS4WCR);
-
- /* CS5a: CAN2 (0xb4000000 - 0xb5ffffff) */
- /* no idle cycles, normal space, 8 bit data bus */
- __raw_writel(0x00000200, CS5ABCR);
- /* (SW:1.5 WR:3 HW:1.5), ext. wait */
- __raw_writel(0x00100981, CS5AWCR);
-
- /* CS5b: CAN3 (0xb6000000 - 0xb7ffffff) */
- /* no idle cycles, normal space, 8 bit data bus */
- __raw_writel(0x00000200, CS5BBCR);
- /* (SW:1.5 WR:3 HW:1.5), ext. wait */
- __raw_writel(0x00100981, CS5BWCR);
-
- /* CS6a: Rotary (0xb8000000 - 0xb9ffffff) */
- /* no idle cycles, normal space, 8 bit data bus */
- __raw_writel(0x00000200, CS6ABCR);
- /* (SW:1.5 WR:3 HW:1.5), no ext. wait */
- __raw_writel(0x001009C1, CS6AWCR);
-}
-
-static void __init setup_port_multiplexing(void)
-{
- /* A7 GPO(LED8); A6 GPO(LED7); A5 GPO(LED6); A4 GPO(LED5);
- * A3 GPO(LED4); A2 GPO(LED3); A1 GPO(LED2); A0 GPO(LED1);
- */
- __raw_writew(0x5555, PORT_PACR); /* 01 01 01 01 01 01 01 01 */
-
- /* B7 GPO(RST4); B6 GPO(RST3); B5 GPO(RST2); B4 GPO(RST1);
- * B3 GPO(PB3); B2 GPO(PB2); B1 GPO(PB1); B0 GPO(PB0);
- */
- __raw_writew(0x5555, PORT_PBCR); /* 01 01 01 01 01 01 01 01 */
-
- /* C7 GPO(PC7); C6 GPO(PC6); C5 GPO(PC5); C4 GPO(PC4);
- * C3 LCD_DATA3; C2 LCD_DATA2; C1 LCD_DATA1; C0 LCD_DATA0;
- */
- __raw_writew(0x5500, PORT_PCCR); /* 01 01 01 01 00 00 00 00 */
-
- /* D7 GPO(PD7); D6 GPO(PD6); D5 GPO(PD5); D4 GPO(PD4);
- * D3 GPO(PD3); D2 GPO(PD2); D1 GPO(PD1); D0 GPO(PD0);
- */
- __raw_writew(0x5555, PORT_PDCR); /* 01 01 01 01 01 01 01 01 */
-
- /* E7 (x); E6 GPI(nu); E5 GPI(nu); E4 LCD_M_DISP;
- * E3 LCD_CL1; E2 LCD_CL2; E1 LCD_DON; E0 LCD_FLM;
- */
- __raw_writew(0x3C00, PORT_PECR); /* 00 11 11 00 00 00 00 00 */
-
- /* F7 (x); F6 DA1(VLCD); F5 DA0(nc); F4 AN3;
- * F3 AN2(MID_AD); F2 AN1(EARTH_AD); F1 AN0(TEMP); F0 GPI+(nc);
- */
- __raw_writew(0x0002, PORT_PFCR); /* 00 00 00 00 00 00 00 10 */
-
- /* G7 (x); G6 IRQ5(TOUCH_BUSY); G5 IRQ4(TOUCH_IRQ); G4 GPI(KEY2);
- * G3 GPI(KEY1); G2 GPO(LED11); G1 GPO(LED10); G0 GPO(LED9);
- */
- __raw_writew(0x03D5, PORT_PGCR); /* 00 00 00 11 11 01 01 01 */
-
- /* H7 (x); H6 /RAS(BRAS); H5 /CAS(BCAS); H4 CKE(BCKE);
- * H3 GPO(EARTH_OFF); H2 GPO(EARTH_TEST); H1 USB2_PWR; H0 USB1_PWR;
- */
- __raw_writew(0x0050, PORT_PHCR); /* 00 00 00 00 01 01 00 00 */
-
- /* J7 (x); J6 AUDCK; J5 ASEBRKAK; J4 AUDATA3;
- * J3 AUDATA2; J2 AUDATA1; J1 AUDATA0; J0 AUDSYNC;
- */
- __raw_writew(0x0000, PORT_PJCR); /* 00 00 00 00 00 00 00 00 */
-
- /* K7 (x); K6 (x); K5 (x); K4 (x);
- * K3 PINT7(/PWR2); K2 PINT6(/PWR1); K1 PINT5(nu); K0 PINT4(FLASH_READY)
- */
- __raw_writew(0x00FF, PORT_PKCR); /* 00 00 00 00 11 11 11 11 */
-
- /* L7 TRST; L6 TMS; L5 TDO; L4 TDI;
- * L3 TCK; L2 (x); L1 (x); L0 (x);
- */
- __raw_writew(0x0000, PORT_PLCR); /* 00 00 00 00 00 00 00 00 */
-
- /* M7 GPO(CURRENT_SINK); M6 GPO(PWR_SWITCH); M5 GPO(LAN_SPEED);
- * M4 GPO(LAN_RESET); M3 GPO(BUZZER); M2 GPO(LCD_BL);
- * M1 CS5B(CAN3_CS); M0 GPI+(nc);
- */
- __raw_writew(0x5552, PORT_PMCR); /* 01 01 01 01 01 01 00 10 */
-
- /* CURRENT_SINK=off, PWR_SWITCH=off, LAN_SPEED=100MBit,
- * LAN_RESET=off, BUZZER=off, LCD_BL=off
- */
-#if CONFIG_SH_MAGIC_PANEL_R2_VERSION == 2
- __raw_writeb(0x30, PORT_PMDR);
-#elif CONFIG_SH_MAGIC_PANEL_R2_VERSION == 3
- __raw_writeb(0xF0, PORT_PMDR);
-#else
-#error Unknown revision of PLATFORM_MP_R2
-#endif
-
- /* P7 (x); P6 (x); P5 (x);
- * P4 GPO(nu); P3 IRQ3(LAN_IRQ); P2 IRQ2(CAN3_IRQ);
- * P1 IRQ1(CAN2_IRQ); P0 IRQ0(CAN1_IRQ)
- */
- __raw_writew(0x0100, PORT_PPCR); /* 00 00 00 01 00 00 00 00 */
- __raw_writeb(0x10, PORT_PPDR);
-
- /* R7 A25; R6 A24; R5 A23; R4 A22;
- * R3 A21; R2 A20; R1 A19; R0 A0;
- */
- gpio_request(GPIO_FN_A25, NULL);
- gpio_request(GPIO_FN_A24, NULL);
- gpio_request(GPIO_FN_A23, NULL);
- gpio_request(GPIO_FN_A22, NULL);
- gpio_request(GPIO_FN_A21, NULL);
- gpio_request(GPIO_FN_A20, NULL);
- gpio_request(GPIO_FN_A19, NULL);
- gpio_request(GPIO_FN_A0, NULL);
-
- /* S7 (x); S6 (x); S5 (x); S4 GPO(EEPROM_CS2);
- * S3 GPO(EEPROM_CS1); S2 SIOF0_TXD; S1 SIOF0_RXD; S0 SIOF0_SCK;
- */
- __raw_writew(0x0140, PORT_PSCR); /* 00 00 00 01 01 00 00 00 */
-
- /* T7 (x); T6 (x); T5 (x); T4 COM1_CTS;
- * T3 COM1_RTS; T2 COM1_TXD; T1 COM1_RXD; T0 GPO(WDOG)
- */
- __raw_writew(0x0001, PORT_PTCR); /* 00 00 00 00 00 00 00 01 */
-
- /* U7 (x); U6 (x); U5 (x); U4 GPI+(/AC_FAULT);
- * U3 GPO(TOUCH_CS); U2 TOUCH_TXD; U1 TOUCH_RXD; U0 TOUCH_SCK;
- */
- __raw_writew(0x0240, PORT_PUCR); /* 00 00 00 10 01 00 00 00 */
-
- /* V7 (x); V6 (x); V5 (x); V4 GPO(MID2);
- * V3 GPO(MID1); V2 CARD_TxD; V1 CARD_RxD; V0 GPI+(/BAT_FAULT);
- */
- __raw_writew(0x0142, PORT_PVCR); /* 00 00 00 01 01 00 00 10 */
-}
-
-static void __init mpr2_setup(char **cmdline_p)
-{
- /* set Pin Select Register A:
- * /PCC_CD1, /PCC_CD2, PCC_BVD1, PCC_BVD2,
- * /IOIS16, IRQ4, IRQ5, USB1d_SUSPEND
- */
- __raw_writew(0xAABC, PORT_PSELA);
- /* set Pin Select Register B:
- * /SCIF0_RTS, /SCIF0_CTS, LCD_VCPWC,
- * LCD_VEPWC, IIC_SDA, IIC_SCL, Reserved
- */
- __raw_writew(0x3C00, PORT_PSELB);
- /* set Pin Select Register C:
- * SIOF1_SCK, SIOF1_RxD, SCIF1_RxD, SCIF1_TxD, Reserved
- */
- __raw_writew(0x0000, PORT_PSELC);
- /* set Pin Select Register D: Reserved, SIOF1_TxD, Reserved, SIOF1_MCLK,
- * Reserved, SIOF1_SYNC, Reserved, SCIF1_SCK, Reserved
- */
- __raw_writew(0x0000, PORT_PSELD);
- /* set USB TxRx Control: Reserved, DRV, Reserved, USB_TRANS, USB_SEL */
- __raw_writew(0x0101, PORT_UTRCTL);
- /* set USB Clock Control: USSCS, USSTB, Reserved (HighByte always A5) */
- __raw_writew(0xA5C0, PORT_UCLKCR_W);
-
- setup_chip_select();
-
- setup_port_multiplexing();
-
- reset_ethernet();
-
- printk(KERN_INFO "Magic Panel Release 2 A.%i\n",
- CONFIG_SH_MAGIC_PANEL_R2_VERSION);
-
- if (ethernet_reset_finished() == 0)
- printk(KERN_WARNING "Ethernet not ready\n");
-}
-
-static struct resource smsc911x_resources[] = {
- [0] = {
- .start = 0xa8000000,
- .end = 0xabffffff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x660),
- .end = evt2irq(0x660),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct smsc911x_platform_config smsc911x_config = {
- .phy_interface = PHY_INTERFACE_MODE_MII,
- .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
- .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
- .flags = SMSC911X_USE_32BIT,
-};
-
-static struct platform_device smsc911x_device = {
- .name = "smsc911x",
- .id = -1,
- .num_resources = ARRAY_SIZE(smsc911x_resources),
- .resource = smsc911x_resources,
- .dev = {
- .platform_data = &smsc911x_config,
- },
-};
-
-static struct resource heartbeat_resources[] = {
- [0] = {
- .start = PA_LED,
- .end = PA_LED,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct heartbeat_data heartbeat_data = {
- .flags = HEARTBEAT_INVERTED,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .dev = {
- .platform_data = &heartbeat_data,
- },
- .num_resources = ARRAY_SIZE(heartbeat_resources),
- .resource = heartbeat_resources,
-};
-
-static struct mtd_partition mpr2_partitions[] = {
- /* Reserved for bootloader, read-only */
- {
- .name = "Bootloader",
- .offset = 0x00000000UL,
- .size = MPR2_MTD_BOOTLOADER_SIZE,
- .mask_flags = MTD_WRITEABLE,
- },
- /* Reserved for kernel image */
- {
- .name = "Kernel",
- .offset = MTDPART_OFS_NXTBLK,
- .size = MPR2_MTD_KERNEL_SIZE,
- },
- /* Rest is used for Flash FS */
- {
- .name = "Flash_FS",
- .offset = MTDPART_OFS_NXTBLK,
- .size = MTDPART_SIZ_FULL,
- }
-};
-
-static struct physmap_flash_data flash_data = {
- .parts = mpr2_partitions,
- .nr_parts = ARRAY_SIZE(mpr2_partitions),
- .width = 2,
-};
-
-static struct resource flash_resource = {
- .start = 0x00000000,
- .end = 0x2000000UL,
- .flags = IORESOURCE_MEM,
-};
-
-static struct platform_device flash_device = {
- .name = "physmap-flash",
- .id = -1,
- .resource = &flash_resource,
- .num_resources = 1,
- .dev = {
- .platform_data = &flash_data,
- },
-};
-
-/*
- * Add all resources to the platform_device
- */
-
-static struct platform_device *mpr2_devices[] __initdata = {
- &heartbeat_device,
- &smsc911x_device,
- &flash_device,
-};
-
-
-static int __init mpr2_devices_setup(void)
-{
- regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
-
- return platform_add_devices(mpr2_devices, ARRAY_SIZE(mpr2_devices));
-}
-device_initcall(mpr2_devices_setup);
-
-/*
- * Initialize IRQ setting
- */
-static void __init init_mpr2_IRQ(void)
-{
- plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-5 */
-
- irq_set_irq_type(evt2irq(0x600), IRQ_TYPE_LEVEL_LOW); /* IRQ0 CAN1 */
- irq_set_irq_type(evt2irq(0x620), IRQ_TYPE_LEVEL_LOW); /* IRQ1 CAN2 */
- irq_set_irq_type(evt2irq(0x640), IRQ_TYPE_LEVEL_LOW); /* IRQ2 CAN3 */
- irq_set_irq_type(evt2irq(0x660), IRQ_TYPE_LEVEL_LOW); /* IRQ3 SMSC9115 */
- irq_set_irq_type(evt2irq(0x680), IRQ_TYPE_EDGE_RISING); /* IRQ4 touchscreen */
- irq_set_irq_type(evt2irq(0x6a0), IRQ_TYPE_EDGE_FALLING); /* IRQ5 touchscreen */
-
- intc_set_priority(evt2irq(0x600), 13); /* IRQ0 CAN1 */
- intc_set_priority(evt2irq(0x620), 13); /* IRQ0 CAN2 */
- intc_set_priority(evt2irq(0x640), 13); /* IRQ0 CAN3 */
- intc_set_priority(evt2irq(0x660), 6); /* IRQ3 SMSC9115 */
-}
-
-/*
- * The Machine Vector
- */
-
-static struct sh_machine_vector mv_mpr2 __initmv = {
- .mv_name = "mpr2",
- .mv_setup = mpr2_setup,
- .mv_init_irq = init_mpr2_IRQ,
-};
diff --git a/arch/sh/boards/board-polaris.c b/arch/sh/boards/board-polaris.c
deleted file mode 100644
index 3de7bac0190392..00000000000000
--- a/arch/sh/boards/board-polaris.c
+++ /dev/null
@@ -1,156 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * June 2006 Steve Glendinning <[email protected]>
- *
- * Polaris-specific resource declaration
- *
- */
-
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/platform_device.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/smsc911x.h>
-#include <linux/io.h>
-#include <asm/irq.h>
-#include <asm/machvec.h>
-#include <asm/heartbeat.h>
-#include <cpu/gpio.h>
-#include <mach-se/mach/se.h>
-
-#define BCR2 (0xFFFFFF62)
-#define WCR2 (0xFFFFFF66)
-#define AREA5_WAIT_CTRL (0x1C00)
-#define WAIT_STATES_10 (0x7)
-
-/* Dummy supplies, where voltage doesn't matter */
-static struct regulator_consumer_supply dummy_supplies[] = {
- REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
- REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
-};
-
-static struct resource smsc911x_resources[] = {
- [0] = {
- .name = "smsc911x-memory",
- .start = PA_EXT5,
- .end = PA_EXT5 + 0x1fff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .name = "smsc911x-irq",
- .start = IRQ0_IRQ,
- .end = IRQ0_IRQ,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct smsc911x_platform_config smsc911x_config = {
- .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
- .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
- .flags = SMSC911X_USE_32BIT,
- .phy_interface = PHY_INTERFACE_MODE_MII,
-};
-
-static struct platform_device smsc911x_device = {
- .name = "smsc911x",
- .id = 0,
- .num_resources = ARRAY_SIZE(smsc911x_resources),
- .resource = smsc911x_resources,
- .dev = {
- .platform_data = &smsc911x_config,
- },
-};
-
-static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3 };
-
-static struct heartbeat_data heartbeat_data = {
- .bit_pos = heartbeat_bit_pos,
- .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
-};
-
-static struct resource heartbeat_resource = {
- .start = PORT_PCDR,
- .end = PORT_PCDR,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .dev = {
- .platform_data = &heartbeat_data,
- },
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-static struct platform_device *polaris_devices[] __initdata = {
- &smsc911x_device,
- &heartbeat_device,
-};
-
-static int __init polaris_initialise(void)
-{
- u16 wcr, bcr_mask;
-
- printk(KERN_INFO "Configuring Polaris external bus\n");
-
- regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
-
- /* Configure area 5 with 2 wait states */
- wcr = __raw_readw(WCR2);
- wcr &= (~AREA5_WAIT_CTRL);
- wcr |= (WAIT_STATES_10 << 10);
- __raw_writew(wcr, WCR2);
-
- /* Configure area 5 for 32-bit access */
- bcr_mask = __raw_readw(BCR2);
- bcr_mask |= 1 << 10;
- __raw_writew(bcr_mask, BCR2);
-
- return platform_add_devices(polaris_devices,
- ARRAY_SIZE(polaris_devices));
-}
-arch_initcall(polaris_initialise);
-
-static struct ipr_data ipr_irq_table[] = {
- /* External IRQs */
- { IRQ0_IRQ, 0, 0, 1, }, /* IRQ0 */
- { IRQ1_IRQ, 0, 4, 1, }, /* IRQ1 */
-};
-
-static unsigned long ipr_offsets[] = {
- INTC_IPRC
-};
-
-static struct ipr_desc ipr_irq_desc = {
- .ipr_offsets = ipr_offsets,
- .nr_offsets = ARRAY_SIZE(ipr_offsets),
-
- .ipr_data = ipr_irq_table,
- .nr_irqs = ARRAY_SIZE(ipr_irq_table),
- .chip = {
- .name = "sh7709-ext",
- },
-};
-
-static void __init init_polaris_irq(void)
-{
- /* Disable all interrupts */
- __raw_writew(0, BCR_ILCRA);
- __raw_writew(0, BCR_ILCRB);
- __raw_writew(0, BCR_ILCRC);
- __raw_writew(0, BCR_ILCRD);
- __raw_writew(0, BCR_ILCRE);
- __raw_writew(0, BCR_ILCRF);
- __raw_writew(0, BCR_ILCRG);
-
- register_ipr_controller(&ipr_irq_desc);
-}
-
-static struct sh_machine_vector mv_polaris __initmv = {
- .mv_name = "Polaris",
- .mv_init_irq = init_polaris_irq,
-};
diff --git a/arch/sh/boards/board-secureedge5410.c b/arch/sh/boards/board-secureedge5410.c
deleted file mode 100644
index 603a82325c65f0..00000000000000
--- a/arch/sh/boards/board-secureedge5410.c
+++ /dev/null
@@ -1,75 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright (C) 2002 David McCullough <[email protected]>
- * Copyright (C) 2003 Paul Mundt <[email protected]>
- *
- * Based on files with the following comments:
- *
- * Copyright (C) 2000 Kazumoto Kojima
- *
- * Modified for 7751 Solution Engine by
- * Ian da Silva and Jeremy Siegel, 2001.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/timer.h>
-#include <linux/delay.h>
-#include <linux/sched.h>
-#include <asm/machvec.h>
-#include <mach/secureedge5410.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <cpu/timer.h>
-
-unsigned short secureedge5410_ioport;
-
-/*
- * EraseConfig handling functions
- */
-static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
-{
- printk("SnapGear: erase switch interrupt!\n");
-
- return IRQ_HANDLED;
-}
-
-static int __init eraseconfig_init(void)
-{
- unsigned int irq = evt2irq(0x240);
-
- printk("SnapGear: EraseConfig init\n");
-
- /* Setup "EraseConfig" switch on external IRQ 0 */
- if (request_irq(irq, eraseconfig_interrupt, 0, "Erase Config", NULL))
- printk("SnapGear: failed to register IRQ%d for Reset witch\n",
- irq);
- else
- printk("SnapGear: registered EraseConfig switch on IRQ%d\n",
- irq);
- return 0;
-}
-device_initcall(eraseconfig_init);
-
-/*
- * Initialize IRQ setting
- *
- * IRL0 = erase switch
- * IRL1 = eth0
- * IRL2 = eth1
- * IRL3 = crypto
- */
-static void __init init_snapgear_IRQ(void)
-{
- printk("Setup SnapGear IRQ/IPR ...\n");
- /* enable individual interrupt mode for externals */
- plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_snapgear __initmv = {
- .mv_name = "SnapGear SecureEdge5410",
- .mv_init_irq = init_snapgear_IRQ,
-};
diff --git a/arch/sh/boards/board-sh2007.c b/arch/sh/boards/board-sh2007.c
deleted file mode 100644
index 6ea85e4808512f..00000000000000
--- a/arch/sh/boards/board-sh2007.c
+++ /dev/null
@@ -1,146 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * SH-2007 board support.
- *
- * Copyright (C) 2003, 2004 SUGIOKA Toshinobu
- * Copyright (C) 2010 Hitoshi Mitake <[email protected]>
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/smsc911x.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/io.h>
-#include <asm/machvec.h>
-#include <mach/sh2007.h>
-
-/* Dummy supplies, where voltage doesn't matter */
-static struct regulator_consumer_supply dummy_supplies[] = {
- REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
- REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
- REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
- REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
-};
-
-struct smsc911x_platform_config smc911x_info = {
- .flags = SMSC911X_USE_32BIT,
- .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
- .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
-};
-
-static struct resource smsc9118_0_resources[] = {
- [0] = {
- .start = SMC0_BASE,
- .end = SMC0_BASE + 0xff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x240),
- .end = evt2irq(0x240),
- .flags = IORESOURCE_IRQ,
- }
-};
-
-static struct resource smsc9118_1_resources[] = {
- [0] = {
- .start = SMC1_BASE,
- .end = SMC1_BASE + 0xff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x280),
- .end = evt2irq(0x280),
- .flags = IORESOURCE_IRQ,
- }
-};
-
-static struct platform_device smsc9118_0_device = {
- .name = "smsc911x",
- .id = 0,
- .num_resources = ARRAY_SIZE(smsc9118_0_resources),
- .resource = smsc9118_0_resources,
- .dev = {
- .platform_data = &smc911x_info,
- },
-};
-
-static struct platform_device smsc9118_1_device = {
- .name = "smsc911x",
- .id = 1,
- .num_resources = ARRAY_SIZE(smsc9118_1_resources),
- .resource = smsc9118_1_resources,
- .dev = {
- .platform_data = &smc911x_info,
- },
-};
-
-static struct resource cf_resources[] = {
- [0] = {
- .start = CF_BASE + CF_OFFSET,
- .end = CF_BASE + CF_OFFSET + 0x0f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = CF_BASE + CF_OFFSET + 0x206,
- .end = CF_BASE + CF_OFFSET + 0x20f,
- .flags = IORESOURCE_MEM,
- },
- [2] = {
- .start = evt2irq(0x2c0),
- .end = evt2irq(0x2c0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device cf_device = {
- .name = "pata_platform",
- .id = 0,
- .num_resources = ARRAY_SIZE(cf_resources),
- .resource = cf_resources,
-};
-
-static struct platform_device *sh2007_devices[] __initdata = {
- &smsc9118_0_device,
- &smsc9118_1_device,
- &cf_device,
-};
-
-static int __init sh2007_io_init(void)
-{
- regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
-
- platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices));
- return 0;
-}
-subsys_initcall(sh2007_io_init);
-
-static void __init sh2007_init_irq(void)
-{
- plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-/*
- * Initialize the board
- */
-static void __init sh2007_setup(char **cmdline_p)
-{
- pr_info("SH-2007 Setup...");
-
- /* setup wait control registers for area 5 */
- __raw_writel(CS5BCR_D, CS5BCR);
- __raw_writel(CS5WCR_D, CS5WCR);
- __raw_writel(CS5PCR_D, CS5PCR);
-
- pr_cont(" done.\n");
-}
-
-/*
- * The Machine Vector
- */
-struct sh_machine_vector mv_sh2007 __initmv = {
- .mv_setup = sh2007_setup,
- .mv_name = "sh2007",
- .mv_init_irq = sh2007_init_irq,
-};
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
deleted file mode 100644
index f39c8196efdfd1..00000000000000
--- a/arch/sh/boards/board-sh7757lcr.c
+++ /dev/null
@@ -1,604 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Renesas R0P7757LC0012RL Support.
- *
- * Copyright (C) 2009 - 2010 Renesas Solutions Corp.
- */
-
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/gpio.h>
-#include <linux/irq.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/spi/spi.h>
-#include <linux/spi/flash.h>
-#include <linux/io.h>
-#include <linux/mfd/tmio.h>
-#include <linux/mmc/host.h>
-#include <linux/platform_data/sh_mmcif.h>
-#include <linux/sh_eth.h>
-#include <linux/sh_intc.h>
-#include <linux/usb/renesas_usbhs.h>
-#include <cpu/sh7757.h>
-#include <asm/heartbeat.h>
-
-static struct resource heartbeat_resource = {
- .start = 0xffec005c, /* PUDR */
- .end = 0xffec005c,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
-};
-
-static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3 };
-
-static struct heartbeat_data heartbeat_data = {
- .bit_pos = heartbeat_bit_pos,
- .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
- .flags = HEARTBEAT_INVERTED,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .dev = {
- .platform_data = &heartbeat_data,
- },
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-/* Fast Ethernet */
-#define GBECONT 0xffc10100
-#define GBECONT_RMII1 BIT(17)
-#define GBECONT_RMII0 BIT(16)
-static void sh7757_eth_set_mdio_gate(void *addr)
-{
- if (((unsigned long)addr & 0x00000fff) < 0x0800)
- writel(readl(GBECONT) | GBECONT_RMII0, GBECONT);
- else
- writel(readl(GBECONT) | GBECONT_RMII1, GBECONT);
-}
-
-static struct resource sh_eth0_resources[] = {
- {
- .start = 0xfef00000,
- .end = 0xfef001ff,
- .flags = IORESOURCE_MEM,
- }, {
- .start = evt2irq(0xc80),
- .end = evt2irq(0xc80),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct sh_eth_plat_data sh7757_eth0_pdata = {
- .phy = 1,
- .set_mdio_gate = sh7757_eth_set_mdio_gate,
-};
-
-static struct platform_device sh7757_eth0_device = {
- .name = "sh7757-ether",
- .resource = sh_eth0_resources,
- .id = 0,
- .num_resources = ARRAY_SIZE(sh_eth0_resources),
- .dev = {
- .platform_data = &sh7757_eth0_pdata,
- },
-};
-
-static struct resource sh_eth1_resources[] = {
- {
- .start = 0xfef00800,
- .end = 0xfef009ff,
- .flags = IORESOURCE_MEM,
- }, {
- .start = evt2irq(0xc80),
- .end = evt2irq(0xc80),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct sh_eth_plat_data sh7757_eth1_pdata = {
- .phy = 1,
- .set_mdio_gate = sh7757_eth_set_mdio_gate,
-};
-
-static struct platform_device sh7757_eth1_device = {
- .name = "sh7757-ether",
- .resource = sh_eth1_resources,
- .id = 1,
- .num_resources = ARRAY_SIZE(sh_eth1_resources),
- .dev = {
- .platform_data = &sh7757_eth1_pdata,
- },
-};
-
-static void sh7757_eth_giga_set_mdio_gate(void *addr)
-{
- if (((unsigned long)addr & 0x00000fff) < 0x0800) {
- gpio_set_value(GPIO_PTT4, 1);
- writel(readl(GBECONT) & ~GBECONT_RMII0, GBECONT);
- } else {
- gpio_set_value(GPIO_PTT4, 0);
- writel(readl(GBECONT) & ~GBECONT_RMII1, GBECONT);
- }
-}
-
-static struct resource sh_eth_giga0_resources[] = {
- {
- .start = 0xfee00000,
- .end = 0xfee007ff,
- .flags = IORESOURCE_MEM,
- }, {
- /* TSU */
- .start = 0xfee01800,
- .end = 0xfee01fff,
- .flags = IORESOURCE_MEM,
- }, {
- .start = evt2irq(0x2960),
- .end = evt2irq(0x2960),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct sh_eth_plat_data sh7757_eth_giga0_pdata = {
- .phy = 18,
- .set_mdio_gate = sh7757_eth_giga_set_mdio_gate,
- .phy_interface = PHY_INTERFACE_MODE_RGMII_ID,
-};
-
-static struct platform_device sh7757_eth_giga0_device = {
- .name = "sh7757-gether",
- .resource = sh_eth_giga0_resources,
- .id = 2,
- .num_resources = ARRAY_SIZE(sh_eth_giga0_resources),
- .dev = {
- .platform_data = &sh7757_eth_giga0_pdata,
- },
-};
-
-static struct resource sh_eth_giga1_resources[] = {
- {
- .start = 0xfee00800,
- .end = 0xfee00fff,
- .flags = IORESOURCE_MEM,
- }, {
- /* TSU */
- .start = 0xfee01800,
- .end = 0xfee01fff,
- .flags = IORESOURCE_MEM,
- }, {
- .start = evt2irq(0x2980),
- .end = evt2irq(0x2980),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct sh_eth_plat_data sh7757_eth_giga1_pdata = {
- .phy = 19,
- .set_mdio_gate = sh7757_eth_giga_set_mdio_gate,
- .phy_interface = PHY_INTERFACE_MODE_RGMII_ID,
-};
-
-static struct platform_device sh7757_eth_giga1_device = {
- .name = "sh7757-gether",
- .resource = sh_eth_giga1_resources,
- .id = 3,
- .num_resources = ARRAY_SIZE(sh_eth_giga1_resources),
- .dev = {
- .platform_data = &sh7757_eth_giga1_pdata,
- },
-};
-
-/* Fixed 3.3V regulator to be used by SDHI0, MMCIF */
-static struct regulator_consumer_supply fixed3v3_power_consumers[] =
-{
- REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
- REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
- REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
- REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
-};
-
-/* SH_MMCIF */
-static struct resource sh_mmcif_resources[] = {
- [0] = {
- .start = 0xffcb0000,
- .end = 0xffcb00ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x1c60),
- .flags = IORESOURCE_IRQ,
- },
- [2] = {
- .start = evt2irq(0x1c80),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct sh_mmcif_plat_data sh_mmcif_plat = {
- .sup_pclk = 0x0f,
- .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
- MMC_CAP_NONREMOVABLE,
- .ocr = MMC_VDD_32_33 | MMC_VDD_33_34,
- .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
- .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
-};
-
-static struct platform_device sh_mmcif_device = {
- .name = "sh_mmcif",
- .id = 0,
- .dev = {
- .platform_data = &sh_mmcif_plat,
- },
- .num_resources = ARRAY_SIZE(sh_mmcif_resources),
- .resource = sh_mmcif_resources,
-};
-
-/* SDHI0 */
-static struct tmio_mmc_data sdhi_info = {
- .chan_priv_tx = (void *)SHDMA_SLAVE_SDHI_TX,
- .chan_priv_rx = (void *)SHDMA_SLAVE_SDHI_RX,
- .capabilities = MMC_CAP_SD_HIGHSPEED,
-};
-
-static struct resource sdhi_resources[] = {
- [0] = {
- .start = 0xffe50000,
- .end = 0xffe500ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x480),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device sdhi_device = {
- .name = "sh_mobile_sdhi",
- .num_resources = ARRAY_SIZE(sdhi_resources),
- .resource = sdhi_resources,
- .id = 0,
- .dev = {
- .platform_data = &sdhi_info,
- },
-};
-
-static int usbhs0_get_id(struct platform_device *pdev)
-{
- return USBHS_GADGET;
-}
-
-static struct renesas_usbhs_platform_info usb0_data = {
- .platform_callback = {
- .get_id = usbhs0_get_id,
- },
- .driver_param = {
- .buswait_bwait = 5,
- }
-};
-
-static struct resource usb0_resources[] = {
- [0] = {
- .start = 0xfe450000,
- .end = 0xfe4501ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x840),
- .end = evt2irq(0x840),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device usb0_device = {
- .name = "renesas_usbhs",
- .id = 0,
- .dev = {
- .platform_data = &usb0_data,
- },
- .num_resources = ARRAY_SIZE(usb0_resources),
- .resource = usb0_resources,
-};
-
-static struct platform_device *sh7757lcr_devices[] __initdata = {
- &heartbeat_device,
- &sh7757_eth0_device,
- &sh7757_eth1_device,
- &sh7757_eth_giga0_device,
- &sh7757_eth_giga1_device,
- &sh_mmcif_device,
- &sdhi_device,
- &usb0_device,
-};
-
-static struct flash_platform_data spi_flash_data = {
- .name = "m25p80",
- .type = "m25px64",
-};
-
-static struct spi_board_info spi_board_info[] = {
- {
- .modalias = "m25p80",
- .max_speed_hz = 25000000,
- .bus_num = 0,
- .chip_select = 1,
- .platform_data = &spi_flash_data,
- },
-};
-
-static int __init sh7757lcr_devices_setup(void)
-{
- regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
- ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
-
- /* RGMII (PTA) */
- gpio_request(GPIO_FN_ET0_MDC, NULL);
- gpio_request(GPIO_FN_ET0_MDIO, NULL);
- gpio_request(GPIO_FN_ET1_MDC, NULL);
- gpio_request(GPIO_FN_ET1_MDIO, NULL);
-
- /* ONFI (PTB, PTZ) */
- gpio_request(GPIO_FN_ON_NRE, NULL);
- gpio_request(GPIO_FN_ON_NWE, NULL);
- gpio_request(GPIO_FN_ON_NWP, NULL);
- gpio_request(GPIO_FN_ON_NCE0, NULL);
- gpio_request(GPIO_FN_ON_R_B0, NULL);
- gpio_request(GPIO_FN_ON_ALE, NULL);
- gpio_request(GPIO_FN_ON_CLE, NULL);
-
- gpio_request(GPIO_FN_ON_DQ7, NULL);
- gpio_request(GPIO_FN_ON_DQ6, NULL);
- gpio_request(GPIO_FN_ON_DQ5, NULL);
- gpio_request(GPIO_FN_ON_DQ4, NULL);
- gpio_request(GPIO_FN_ON_DQ3, NULL);
- gpio_request(GPIO_FN_ON_DQ2, NULL);
- gpio_request(GPIO_FN_ON_DQ1, NULL);
- gpio_request(GPIO_FN_ON_DQ0, NULL);
-
- /* IRQ8 to 0 (PTB, PTC) */
- gpio_request(GPIO_FN_IRQ8, NULL);
- gpio_request(GPIO_FN_IRQ7, NULL);
- gpio_request(GPIO_FN_IRQ6, NULL);
- gpio_request(GPIO_FN_IRQ5, NULL);
- gpio_request(GPIO_FN_IRQ4, NULL);
- gpio_request(GPIO_FN_IRQ3, NULL);
- gpio_request(GPIO_FN_IRQ2, NULL);
- gpio_request(GPIO_FN_IRQ1, NULL);
- gpio_request(GPIO_FN_IRQ0, NULL);
-
- /* SPI0 (PTD) */
- gpio_request(GPIO_FN_SP0_MOSI, NULL);
- gpio_request(GPIO_FN_SP0_MISO, NULL);
- gpio_request(GPIO_FN_SP0_SCK, NULL);
- gpio_request(GPIO_FN_SP0_SCK_FB, NULL);
- gpio_request(GPIO_FN_SP0_SS0, NULL);
- gpio_request(GPIO_FN_SP0_SS1, NULL);
- gpio_request(GPIO_FN_SP0_SS2, NULL);
- gpio_request(GPIO_FN_SP0_SS3, NULL);
-
- /* RMII 0/1 (PTE, PTF) */
- gpio_request(GPIO_FN_RMII0_CRS_DV, NULL);
- gpio_request(GPIO_FN_RMII0_TXD1, NULL);
- gpio_request(GPIO_FN_RMII0_TXD0, NULL);
- gpio_request(GPIO_FN_RMII0_TXEN, NULL);
- gpio_request(GPIO_FN_RMII0_REFCLK, NULL);
- gpio_request(GPIO_FN_RMII0_RXD1, NULL);
- gpio_request(GPIO_FN_RMII0_RXD0, NULL);
- gpio_request(GPIO_FN_RMII0_RX_ER, NULL);
- gpio_request(GPIO_FN_RMII1_CRS_DV, NULL);
- gpio_request(GPIO_FN_RMII1_TXD1, NULL);
- gpio_request(GPIO_FN_RMII1_TXD0, NULL);
- gpio_request(GPIO_FN_RMII1_TXEN, NULL);
- gpio_request(GPIO_FN_RMII1_REFCLK, NULL);
- gpio_request(GPIO_FN_RMII1_RXD1, NULL);
- gpio_request(GPIO_FN_RMII1_RXD0, NULL);
- gpio_request(GPIO_FN_RMII1_RX_ER, NULL);
-
- /* eMMC (PTG) */
- gpio_request(GPIO_FN_MMCCLK, NULL);
- gpio_request(GPIO_FN_MMCCMD, NULL);
- gpio_request(GPIO_FN_MMCDAT7, NULL);
- gpio_request(GPIO_FN_MMCDAT6, NULL);
- gpio_request(GPIO_FN_MMCDAT5, NULL);
- gpio_request(GPIO_FN_MMCDAT4, NULL);
- gpio_request(GPIO_FN_MMCDAT3, NULL);
- gpio_request(GPIO_FN_MMCDAT2, NULL);
- gpio_request(GPIO_FN_MMCDAT1, NULL);
- gpio_request(GPIO_FN_MMCDAT0, NULL);
-
- /* LPC (PTG, PTH, PTQ, PTU) */
- gpio_request(GPIO_FN_SERIRQ, NULL);
- gpio_request(GPIO_FN_LPCPD, NULL);
- gpio_request(GPIO_FN_LDRQ, NULL);
- gpio_request(GPIO_FN_WP, NULL);
- gpio_request(GPIO_FN_FMS0, NULL);
- gpio_request(GPIO_FN_LAD3, NULL);
- gpio_request(GPIO_FN_LAD2, NULL);
- gpio_request(GPIO_FN_LAD1, NULL);
- gpio_request(GPIO_FN_LAD0, NULL);
- gpio_request(GPIO_FN_LFRAME, NULL);
- gpio_request(GPIO_FN_LRESET, NULL);
- gpio_request(GPIO_FN_LCLK, NULL);
- gpio_request(GPIO_FN_LGPIO7, NULL);
- gpio_request(GPIO_FN_LGPIO6, NULL);
- gpio_request(GPIO_FN_LGPIO5, NULL);
- gpio_request(GPIO_FN_LGPIO4, NULL);
-
- /* SPI1 (PTH) */
- gpio_request(GPIO_FN_SP1_MOSI, NULL);
- gpio_request(GPIO_FN_SP1_MISO, NULL);
- gpio_request(GPIO_FN_SP1_SCK, NULL);
- gpio_request(GPIO_FN_SP1_SCK_FB, NULL);
- gpio_request(GPIO_FN_SP1_SS0, NULL);
- gpio_request(GPIO_FN_SP1_SS1, NULL);
-
- /* SDHI (PTI) */
- gpio_request(GPIO_FN_SD_WP, NULL);
- gpio_request(GPIO_FN_SD_CD, NULL);
- gpio_request(GPIO_FN_SD_CLK, NULL);
- gpio_request(GPIO_FN_SD_CMD, NULL);
- gpio_request(GPIO_FN_SD_D3, NULL);
- gpio_request(GPIO_FN_SD_D2, NULL);
- gpio_request(GPIO_FN_SD_D1, NULL);
- gpio_request(GPIO_FN_SD_D0, NULL);
-
- /* SCIF3/4 (PTJ, PTW) */
- gpio_request(GPIO_FN_RTS3, NULL);
- gpio_request(GPIO_FN_CTS3, NULL);
- gpio_request(GPIO_FN_TXD3, NULL);
- gpio_request(GPIO_FN_RXD3, NULL);
- gpio_request(GPIO_FN_RTS4, NULL);
- gpio_request(GPIO_FN_RXD4, NULL);
- gpio_request(GPIO_FN_TXD4, NULL);
- gpio_request(GPIO_FN_CTS4, NULL);
-
- /* SERMUX (PTK, PTL, PTO, PTV) */
- gpio_request(GPIO_FN_COM2_TXD, NULL);
- gpio_request(GPIO_FN_COM2_RXD, NULL);
- gpio_request(GPIO_FN_COM2_RTS, NULL);
- gpio_request(GPIO_FN_COM2_CTS, NULL);
- gpio_request(GPIO_FN_COM2_DTR, NULL);
- gpio_request(GPIO_FN_COM2_DSR, NULL);
- gpio_request(GPIO_FN_COM2_DCD, NULL);
- gpio_request(GPIO_FN_COM2_RI, NULL);
- gpio_request(GPIO_FN_RAC_RXD, NULL);
- gpio_request(GPIO_FN_RAC_RTS, NULL);
- gpio_request(GPIO_FN_RAC_CTS, NULL);
- gpio_request(GPIO_FN_RAC_DTR, NULL);
- gpio_request(GPIO_FN_RAC_DSR, NULL);
- gpio_request(GPIO_FN_RAC_DCD, NULL);
- gpio_request(GPIO_FN_RAC_TXD, NULL);
- gpio_request(GPIO_FN_COM1_TXD, NULL);
- gpio_request(GPIO_FN_COM1_RXD, NULL);
- gpio_request(GPIO_FN_COM1_RTS, NULL);
- gpio_request(GPIO_FN_COM1_CTS, NULL);
-
- writeb(0x10, 0xfe470000); /* SMR0: SerMux mode 0 */
-
- /* IIC (PTM, PTR, PTS) */
- gpio_request(GPIO_FN_SDA7, NULL);
- gpio_request(GPIO_FN_SCL7, NULL);
- gpio_request(GPIO_FN_SDA6, NULL);
- gpio_request(GPIO_FN_SCL6, NULL);
- gpio_request(GPIO_FN_SDA5, NULL);
- gpio_request(GPIO_FN_SCL5, NULL);
- gpio_request(GPIO_FN_SDA4, NULL);
- gpio_request(GPIO_FN_SCL4, NULL);
- gpio_request(GPIO_FN_SDA3, NULL);
- gpio_request(GPIO_FN_SCL3, NULL);
- gpio_request(GPIO_FN_SDA2, NULL);
- gpio_request(GPIO_FN_SCL2, NULL);
- gpio_request(GPIO_FN_SDA1, NULL);
- gpio_request(GPIO_FN_SCL1, NULL);
- gpio_request(GPIO_FN_SDA0, NULL);
- gpio_request(GPIO_FN_SCL0, NULL);
-
- /* USB (PTN) */
- gpio_request(GPIO_FN_VBUS_EN, NULL);
- gpio_request(GPIO_FN_VBUS_OC, NULL);
-
- /* SGPIO1/0 (PTN, PTO) */
- gpio_request(GPIO_FN_SGPIO1_CLK, NULL);
- gpio_request(GPIO_FN_SGPIO1_LOAD, NULL);
- gpio_request(GPIO_FN_SGPIO1_DI, NULL);
- gpio_request(GPIO_FN_SGPIO1_DO, NULL);
- gpio_request(GPIO_FN_SGPIO0_CLK, NULL);
- gpio_request(GPIO_FN_SGPIO0_LOAD, NULL);
- gpio_request(GPIO_FN_SGPIO0_DI, NULL);
- gpio_request(GPIO_FN_SGPIO0_DO, NULL);
-
- /* WDT (PTN) */
- gpio_request(GPIO_FN_SUB_CLKIN, NULL);
-
- /* System (PTT) */
- gpio_request(GPIO_FN_STATUS1, NULL);
- gpio_request(GPIO_FN_STATUS0, NULL);
-
- /* PWMX (PTT) */
- gpio_request(GPIO_FN_PWMX1, NULL);
- gpio_request(GPIO_FN_PWMX0, NULL);
-
- /* R-SPI (PTV) */
- gpio_request(GPIO_FN_R_SPI_MOSI, NULL);
- gpio_request(GPIO_FN_R_SPI_MISO, NULL);
- gpio_request(GPIO_FN_R_SPI_RSPCK, NULL);
- gpio_request(GPIO_FN_R_SPI_SSL0, NULL);
- gpio_request(GPIO_FN_R_SPI_SSL1, NULL);
-
- /* EVC (PTV, PTW) */
- gpio_request(GPIO_FN_EVENT7, NULL);
- gpio_request(GPIO_FN_EVENT6, NULL);
- gpio_request(GPIO_FN_EVENT5, NULL);
- gpio_request(GPIO_FN_EVENT4, NULL);
- gpio_request(GPIO_FN_EVENT3, NULL);
- gpio_request(GPIO_FN_EVENT2, NULL);
- gpio_request(GPIO_FN_EVENT1, NULL);
- gpio_request(GPIO_FN_EVENT0, NULL);
-
- /* LED for heartbeat */
- gpio_request(GPIO_PTU3, NULL);
- gpio_direction_output(GPIO_PTU3, 1);
- gpio_request(GPIO_PTU2, NULL);
- gpio_direction_output(GPIO_PTU2, 1);
- gpio_request(GPIO_PTU1, NULL);
- gpio_direction_output(GPIO_PTU1, 1);
- gpio_request(GPIO_PTU0, NULL);
- gpio_direction_output(GPIO_PTU0, 1);
-
- /* control for MDIO of Gigabit Ethernet */
- gpio_request(GPIO_PTT4, NULL);
- gpio_direction_output(GPIO_PTT4, 1);
-
- /* control for eMMC */
- gpio_request(GPIO_PTT7, NULL); /* eMMC_RST# */
- gpio_direction_output(GPIO_PTT7, 0);
- gpio_request(GPIO_PTT6, NULL); /* eMMC_INDEX# */
- gpio_direction_output(GPIO_PTT6, 0);
- gpio_request(GPIO_PTT5, NULL); /* eMMC_PRST# */
- gpio_direction_output(GPIO_PTT5, 1);
-
- /* register SPI device information */
- spi_register_board_info(spi_board_info,
- ARRAY_SIZE(spi_board_info));
-
- /* General platform */
- return platform_add_devices(sh7757lcr_devices,
- ARRAY_SIZE(sh7757lcr_devices));
-}
-arch_initcall(sh7757lcr_devices_setup);
-
-/* Initialize IRQ setting */
-void __init init_sh7757lcr_IRQ(void)
-{
- plat_irq_setup_pins(IRQ_MODE_IRQ7654);
- plat_irq_setup_pins(IRQ_MODE_IRQ3210);
-}
-
-/* Initialize the board */
-static void __init sh7757lcr_setup(char **cmdline_p)
-{
- printk(KERN_INFO "Renesas R0P7757LC0012RL support.\n");
-}
-
-static int sh7757lcr_mode_pins(void)
-{
- int value = 0;
-
- /* These are the factory default settings of S3 (Low active).
- * If you change these dip switches then you will need to
- * adjust the values below as well.
- */
- value |= MODE_PIN0; /* Clock Mode: 1 */
-
- return value;
-}
-
-/* The Machine Vector */
-static struct sh_machine_vector mv_sh7757lcr __initmv = {
- .mv_name = "SH7757LCR",
- .mv_setup = sh7757lcr_setup,
- .mv_init_irq = init_sh7757lcr_IRQ,
- .mv_mode_pins = sh7757lcr_mode_pins,
-};
-
diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c
deleted file mode 100644
index 77dad1e511b465..00000000000000
--- a/arch/sh/boards/board-sh7785lcr.c
+++ /dev/null
@@ -1,384 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Renesas Technology Corp. R0P7785LC0011RL Support.
- *
- * Copyright (C) 2008 Yoshihiro Shimoda
- * Copyright (C) 2009 Paul Mundt
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/sm501.h>
-#include <linux/sm501-regs.h>
-#include <linux/fb.h>
-#include <linux/mtd/physmap.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
-#include <linux/i2c.h>
-#include <linux/platform_data/i2c-pca-platform.h>
-#include <linux/i2c-algo-pca.h>
-#include <linux/usb/r8a66597.h>
-#include <linux/sh_intc.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <linux/clk.h>
-#include <linux/errno.h>
-#include <linux/gpio/machine.h>
-#include <mach/sh7785lcr.h>
-#include <cpu/sh7785.h>
-#include <asm/heartbeat.h>
-#include <asm/clock.h>
-#include <asm/bl_bit.h>
-
-/*
- * NOTE: This board has 2 physical memory maps.
- * Please look at include/asm-sh/sh7785lcr.h or hardware manual.
- */
-static struct resource heartbeat_resource = {
- .start = PLD_LEDCR,
- .end = PLD_LEDCR,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-static struct mtd_partition nor_flash_partitions[] = {
- {
- .name = "loader",
- .offset = 0x00000000,
- .size = 512 * 1024,
- },
- {
- .name = "bootenv",
- .offset = MTDPART_OFS_APPEND,
- .size = 512 * 1024,
- },
- {
- .name = "kernel",
- .offset = MTDPART_OFS_APPEND,
- .size = 4 * 1024 * 1024,
- },
- {
- .name = "data",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data nor_flash_data = {
- .width = 4,
- .parts = nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(nor_flash_partitions),
-};
-
-static struct resource nor_flash_resources[] = {
- [0] = {
- .start = NOR_FLASH_ADDR,
- .end = NOR_FLASH_ADDR + NOR_FLASH_SIZE - 1,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device nor_flash_device = {
- .name = "physmap-flash",
- .dev = {
- .platform_data = &nor_flash_data,
- },
- .num_resources = ARRAY_SIZE(nor_flash_resources),
- .resource = nor_flash_resources,
-};
-
-static struct r8a66597_platdata r8a66597_data = {
- .xtal = R8A66597_PLATDATA_XTAL_12MHZ,
- .vif = 1,
-};
-
-static struct resource r8a66597_usb_host_resources[] = {
- [0] = {
- .start = R8A66597_ADDR,
- .end = R8A66597_ADDR + R8A66597_SIZE - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x240),
- .end = evt2irq(0x240),
- .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
- },
-};
-
-static struct platform_device r8a66597_usb_host_device = {
- .name = "r8a66597_hcd",
- .id = -1,
- .dev = {
- .dma_mask = NULL,
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &r8a66597_data,
- },
- .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources),
- .resource = r8a66597_usb_host_resources,
-};
-
-static struct resource sm501_resources[] = {
- [0] = {
- .start = SM107_MEM_ADDR,
- .end = SM107_MEM_ADDR + SM107_MEM_SIZE - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = SM107_REG_ADDR,
- .end = SM107_REG_ADDR + SM107_REG_SIZE - 1,
- .flags = IORESOURCE_MEM,
- },
- [2] = {
- .start = evt2irq(0x340),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct fb_videomode sm501_default_mode_crt = {
- .pixclock = 35714, /* 28MHz */
- .xres = 640,
- .yres = 480,
- .left_margin = 105,
- .right_margin = 16,
- .upper_margin = 33,
- .lower_margin = 10,
- .hsync_len = 39,
- .vsync_len = 2,
- .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-};
-
-static struct fb_videomode sm501_default_mode_pnl = {
- .pixclock = 40000, /* 25MHz */
- .xres = 640,
- .yres = 480,
- .left_margin = 2,
- .right_margin = 16,
- .upper_margin = 33,
- .lower_margin = 10,
- .hsync_len = 39,
- .vsync_len = 2,
- .sync = 0,
-};
-
-static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = {
- .def_bpp = 16,
- .def_mode = &sm501_default_mode_pnl,
- .flags = SM501FB_FLAG_USE_INIT_MODE |
- SM501FB_FLAG_USE_HWCURSOR |
- SM501FB_FLAG_USE_HWACCEL |
- SM501FB_FLAG_DISABLE_AT_EXIT |
- SM501FB_FLAG_PANEL_NO_VBIASEN,
-};
-
-static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = {
- .def_bpp = 16,
- .def_mode = &sm501_default_mode_crt,
- .flags = SM501FB_FLAG_USE_INIT_MODE |
- SM501FB_FLAG_USE_HWCURSOR |
- SM501FB_FLAG_USE_HWACCEL |
- SM501FB_FLAG_DISABLE_AT_EXIT,
-};
-
-static struct sm501_platdata_fb sm501_fb_pdata = {
- .fb_route = SM501_FB_OWN,
- .fb_crt = &sm501_pdata_fbsub_crt,
- .fb_pnl = &sm501_pdata_fbsub_pnl,
-};
-
-static struct sm501_initdata sm501_initdata = {
- .gpio_high = {
- .set = 0x00001fe0,
- .mask = 0x0,
- },
- .devices = 0,
- .mclk = 84 * 1000000,
- .m1xclk = 112 * 1000000,
-};
-
-static struct sm501_platdata sm501_platform_data = {
- .init = &sm501_initdata,
- .fb = &sm501_fb_pdata,
-};
-
-static struct platform_device sm501_device = {
- .name = "sm501",
- .id = -1,
- .dev = {
- .platform_data = &sm501_platform_data,
- },
- .num_resources = ARRAY_SIZE(sm501_resources),
- .resource = sm501_resources,
-};
-
-static struct resource i2c_proto_resources[] = {
- [0] = {
- .start = PCA9564_PROTO_32BIT_ADDR,
- .end = PCA9564_PROTO_32BIT_ADDR + PCA9564_SIZE - 1,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
- },
- [1] = {
- .start = evt2irq(0x380),
- .end = evt2irq(0x380),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct resource i2c_resources[] = {
- [0] = {
- .start = PCA9564_ADDR,
- .end = PCA9564_ADDR + PCA9564_SIZE - 1,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
- },
- [1] = {
- .start = evt2irq(0x380),
- .end = evt2irq(0x380),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct gpiod_lookup_table i2c_gpio_table = {
- .dev_id = "i2c.0",
- .table = {
- GPIO_LOOKUP("pfc-sh7757", 0, "reset-gpios", GPIO_ACTIVE_LOW),
- { },
- },
-};
-
-static struct i2c_pca9564_pf_platform_data i2c_platform_data = {
- .i2c_clock_speed = I2C_PCA_CON_330kHz,
- .timeout = HZ,
-};
-
-static struct platform_device i2c_device = {
- .name = "i2c-pca-platform",
- .id = -1,
- .dev = {
- .platform_data = &i2c_platform_data,
- },
- .num_resources = ARRAY_SIZE(i2c_resources),
- .resource = i2c_resources,
-};
-
-static struct platform_device *sh7785lcr_devices[] __initdata = {
- &heartbeat_device,
- &nor_flash_device,
- &r8a66597_usb_host_device,
- &sm501_device,
- &i2c_device,
-};
-
-static struct i2c_board_info __initdata sh7785lcr_i2c_devices[] = {
- {
- I2C_BOARD_INFO("r2025sd", 0x32),
- },
-};
-
-static int __init sh7785lcr_devices_setup(void)
-{
- i2c_register_board_info(0, sh7785lcr_i2c_devices,
- ARRAY_SIZE(sh7785lcr_i2c_devices));
-
- if (mach_is_sh7785lcr_pt()) {
- i2c_device.resource = i2c_proto_resources;
- i2c_device.num_resources = ARRAY_SIZE(i2c_proto_resources);
- }
-
- gpiod_add_lookup_table(&i2c_gpio_table);
- return platform_add_devices(sh7785lcr_devices,
- ARRAY_SIZE(sh7785lcr_devices));
-}
-device_initcall(sh7785lcr_devices_setup);
-
-/* Initialize IRQ setting */
-void __init init_sh7785lcr_IRQ(void)
-{
- plat_irq_setup_pins(IRQ_MODE_IRQ7654);
- plat_irq_setup_pins(IRQ_MODE_IRQ3210);
-}
-
-static int sh7785lcr_clk_init(void)
-{
- struct clk *clk;
- int ret;
-
- clk = clk_get(NULL, "extal");
- if (IS_ERR(clk))
- return PTR_ERR(clk);
- ret = clk_set_rate(clk, 33333333);
- clk_put(clk);
-
- return ret;
-}
-
-static void sh7785lcr_power_off(void)
-{
- unsigned char *p;
-
- p = ioremap(PLD_POFCR, PLD_POFCR + 1);
- if (!p) {
- printk(KERN_ERR "%s: ioremap error.\n", __func__);
- return;
- }
- *p = 0x01;
- iounmap(p);
- set_bl_bit();
- while (1)
- cpu_relax();
-}
-
-/* Initialize the board */
-static void __init sh7785lcr_setup(char **cmdline_p)
-{
- void __iomem *sm501_reg;
-
- printk(KERN_INFO "Renesas Technology Corp. R0P7785LC0011RL support.\n");
-
- pm_power_off = sh7785lcr_power_off;
-
- /* sm501 DRAM configuration */
- sm501_reg = ioremap(SM107_REG_ADDR, SM501_DRAM_CONTROL);
- if (!sm501_reg) {
- printk(KERN_ERR "%s: ioremap error.\n", __func__);
- return;
- }
-
- writel(0x000307c2, sm501_reg + SM501_DRAM_CONTROL);
- iounmap(sm501_reg);
-}
-
-/* Return the board specific boot mode pin configuration */
-static int sh7785lcr_mode_pins(void)
-{
- int value = 0;
-
- /* These are the factory default settings of S1 and S2.
- * If you change these dip switches then you will need to
- * adjust the values below as well.
- */
- value |= MODE_PIN4; /* Clock Mode 16 */
- value |= MODE_PIN5; /* 32-bit Area0 bus width */
- value |= MODE_PIN6; /* 32-bit Area0 bus width */
- value |= MODE_PIN7; /* Area 0 SRAM interface [fixed] */
- value |= MODE_PIN8; /* Little Endian */
- value |= MODE_PIN9; /* Master Mode */
- value |= MODE_PIN14; /* No PLL step-up */
-
- return value;
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_sh7785lcr __initmv = {
- .mv_name = "SH7785LCR",
- .mv_setup = sh7785lcr_setup,
- .mv_clk_init = sh7785lcr_clk_init,
- .mv_init_irq = init_sh7785lcr_IRQ,
- .mv_mode_pins = sh7785lcr_mode_pins,
-};
-
diff --git a/arch/sh/boards/board-shmin.c b/arch/sh/boards/board-shmin.c
deleted file mode 100644
index 83296c0b75c45d..00000000000000
--- a/arch/sh/boards/board-shmin.c
+++ /dev/null
@@ -1,35 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/shmin/setup.c
- *
- * Copyright (C) 2006 Takashi YOSHII
- *
- * SHMIN Support.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <asm/machvec.h>
-#include <mach/shmin.h>
-#include <asm/clock.h>
-#include <asm/io.h>
-
-#define PFC_PHCR 0xa400010eUL
-#define INTC_ICR1 0xa4000010UL
-
-static void __init init_shmin_irq(void)
-{
- __raw_writew(0x2a00, PFC_PHCR); // IRQ0-3=IRQ
- __raw_writew(0x0aaa, INTC_ICR1); // IRQ0-3=IRQ-mode,Low-active.
- plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-static void __init shmin_setup(char **cmdline_p)
-{
- __set_io_port_base(SHMIN_IO_BASE);
-}
-
-static struct sh_machine_vector mv_shmin __initmv = {
- .mv_name = "SHMIN",
- .mv_setup = shmin_setup,
- .mv_init_irq = init_shmin_irq,
-};
diff --git a/arch/sh/boards/board-titan.c b/arch/sh/boards/board-titan.c
deleted file mode 100644
index 074a848d8b564d..00000000000000
--- a/arch/sh/boards/board-titan.c
+++ /dev/null
@@ -1,21 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/titan/setup.c - Setup for Titan
- *
- * Copyright (C) 2006 Jamie Lenehan
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <mach/titan.h>
-#include <asm/io.h>
-
-static void __init init_titan_irq(void)
-{
- /* enable individual interrupt mode for externals */
- plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-static struct sh_machine_vector mv_titan __initmv = {
- .mv_name = "Titan",
- .mv_init_irq = init_titan_irq,
-};
diff --git a/arch/sh/boards/board-urquell.c b/arch/sh/boards/board-urquell.c
deleted file mode 100644
index dad2b3b40735cb..00000000000000
--- a/arch/sh/boards/board-urquell.c
+++ /dev/null
@@ -1,218 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Renesas Technology Corp. SH7786 Urquell Support.
- *
- * Copyright (C) 2008 Kuninori Morimoto <[email protected]>
- * Copyright (C) 2009, 2010 Paul Mundt
- *
- * Based on board-sh7785lcr.c
- * Copyright (C) 2008 Yoshihiro Shimoda
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/fb.h>
-#include <linux/smc91x.h>
-#include <linux/mtd/physmap.h>
-#include <linux/delay.h>
-#include <linux/gpio.h>
-#include <linux/irq.h>
-#include <linux/clk.h>
-#include <linux/sh_intc.h>
-#include <mach/urquell.h>
-#include <cpu/sh7786.h>
-#include <asm/heartbeat.h>
-#include <linux/sizes.h>
-#include <asm/smp-ops.h>
-
-/*
- * bit 1234 5678
- *----------------------------
- * SW1 0101 0010 -> Pck 33MHz version
- * (1101 0010) Pck 66MHz version
- * SW2 0x1x xxxx -> little endian
- * 29bit mode
- * SW47 0001 1000 -> CS0 : on-board flash
- * CS1 : SRAM, registers, LAN, PCMCIA
- * 38400 bps for SCIF1
- *
- * Address
- * 0x00000000 - 0x04000000 (CS0) Nor Flash
- * 0x04000000 - 0x04200000 (CS1) SRAM
- * 0x05000000 - 0x05800000 (CS1) on board register
- * 0x05800000 - 0x06000000 (CS1) LAN91C111
- * 0x06000000 - 0x06400000 (CS1) PCMCIA
- * 0x08000000 - 0x10000000 (CS2-CS3) DDR3
- * 0x10000000 - 0x14000000 (CS4) PCIe
- * 0x14000000 - 0x14800000 (CS5) Core0 LRAM/URAM
- * 0x14800000 - 0x15000000 (CS5) Core1 LRAM/URAM
- * 0x18000000 - 0x1C000000 (CS6) ATA/NAND-Flash
- * 0x1C000000 - (CS7) SH7786 Control register
- */
-
-/* HeartBeat */
-static struct resource heartbeat_resource = {
- .start = BOARDREG(SLEDR),
- .end = BOARDREG(SLEDR),
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-/* LAN91C111 */
-static struct smc91x_platdata smc91x_info = {
- .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
-};
-
-static struct resource smc91x_eth_resources[] = {
- [0] = {
- .name = "SMC91C111" ,
- .start = 0x05800300,
- .end = 0x0580030f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x360),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device smc91x_eth_device = {
- .name = "smc91x",
- .num_resources = ARRAY_SIZE(smc91x_eth_resources),
- .resource = smc91x_eth_resources,
- .dev = {
- .platform_data = &smc91x_info,
- },
-};
-
-/* Nor Flash */
-static struct mtd_partition nor_flash_partitions[] = {
- {
- .name = "loader",
- .offset = 0x00000000,
- .size = SZ_512K,
- .mask_flags = MTD_WRITEABLE, /* Read-only */
- },
- {
- .name = "bootenv",
- .offset = MTDPART_OFS_APPEND,
- .size = SZ_512K,
- .mask_flags = MTD_WRITEABLE, /* Read-only */
- },
- {
- .name = "kernel",
- .offset = MTDPART_OFS_APPEND,
- .size = SZ_4M,
- },
- {
- .name = "data",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data nor_flash_data = {
- .width = 2,
- .parts = nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(nor_flash_partitions),
-};
-
-static struct resource nor_flash_resources[] = {
- [0] = {
- .start = NOR_FLASH_ADDR,
- .end = NOR_FLASH_ADDR + NOR_FLASH_SIZE - 1,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device nor_flash_device = {
- .name = "physmap-flash",
- .dev = {
- .platform_data = &nor_flash_data,
- },
- .num_resources = ARRAY_SIZE(nor_flash_resources),
- .resource = nor_flash_resources,
-};
-
-static struct platform_device *urquell_devices[] __initdata = {
- &heartbeat_device,
- &smc91x_eth_device,
- &nor_flash_device,
-};
-
-static int __init urquell_devices_setup(void)
-{
- /* USB */
- gpio_request(GPIO_FN_USB_OVC0, NULL);
- gpio_request(GPIO_FN_USB_PENC0, NULL);
-
- /* enable LAN */
- __raw_writew(__raw_readw(UBOARDREG(IRL2MSKR)) & ~0x00000001,
- UBOARDREG(IRL2MSKR));
-
- return platform_add_devices(urquell_devices,
- ARRAY_SIZE(urquell_devices));
-}
-device_initcall(urquell_devices_setup);
-
-static void urquell_power_off(void)
-{
- __raw_writew(0xa5a5, UBOARDREG(SRSTR));
-}
-
-static void __init urquell_init_irq(void)
-{
- plat_irq_setup_pins(IRQ_MODE_IRL3210_MASK);
-}
-
-static int urquell_mode_pins(void)
-{
- return __raw_readw(UBOARDREG(MDSWMR));
-}
-
-static int urquell_clk_init(void)
-{
- struct clk *clk;
- int ret;
-
- /*
- * Only handle the EXTAL case, anyone interfacing a crystal
- * resonator will need to provide their own input clock.
- */
- if (test_mode_pin(MODE_PIN9))
- return -EINVAL;
-
- clk = clk_get(NULL, "extal");
- if (IS_ERR(clk))
- return PTR_ERR(clk);
- ret = clk_set_rate(clk, 33333333);
- clk_put(clk);
-
- return ret;
-}
-
-/* Initialize the board */
-static void __init urquell_setup(char **cmdline_p)
-{
- printk(KERN_INFO "Renesas Technology Corp. Urquell support.\n");
-
- pm_power_off = urquell_power_off;
-
- register_smp_ops(&shx3_smp_ops);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_urquell __initmv = {
- .mv_name = "Urquell",
- .mv_setup = urquell_setup,
- .mv_init_irq = urquell_init_irq,
- .mv_mode_pins = urquell_mode_pins,
- .mv_clk_init = urquell_clk_init,
-};
diff --git a/arch/sh/boards/mach-ap325rxa/Makefile b/arch/sh/boards/mach-ap325rxa/Makefile
deleted file mode 100644
index dba5d0c202615a..00000000000000
--- a/arch/sh/boards/mach-ap325rxa/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-y := setup.o sdram.o
-
diff --git a/arch/sh/boards/mach-ap325rxa/sdram.S b/arch/sh/boards/mach-ap325rxa/sdram.S
deleted file mode 100644
index 541c82cc30b112..00000000000000
--- a/arch/sh/boards/mach-ap325rxa/sdram.S
+++ /dev/null
@@ -1,66 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
- * AP325RXA sdram self/auto-refresh setup code
- *
- * Copyright (C) 2009 Magnus Damm
- */
-
-#include <linux/sys.h>
-#include <linux/errno.h>
-#include <linux/linkage.h>
-#include <asm/asm-offsets.h>
-#include <asm/suspend.h>
-#include <asm/romimage-macros.h>
-
-/* code to enter and leave self-refresh. must be self-contained.
- * this code will be copied to on-chip memory and executed from there.
- */
- .balign 4
-ENTRY(ap325rxa_sdram_enter_start)
-
- /* SBSC: disable power down and put in self-refresh mode */
- mov.l 1f, r4
- mov.l 2f, r1
- mov.l @r4, r2
- or r1, r2
- mov.l 3f, r3
- and r3, r2
- mov.l r2, @r4
-
- rts
- nop
-
- .balign 4
-1: .long 0xfe400008 /* SDCR0 */
-2: .long 0x00000400
-3: .long 0xffff7fff
-ENTRY(ap325rxa_sdram_enter_end)
-
- .balign 4
-ENTRY(ap325rxa_sdram_leave_start)
-
- /* SBSC: set auto-refresh mode */
- mov.l 1f, r4
- mov.l @r4, r0
- mov.l 4f, r1
- and r1, r0
- mov.l r0, @r4
- mov.l 6f, r4
- mov.l 8f, r0
- mov.l @r4, r1
- mov #-1, r4
- add r4, r1
- or r1, r0
- mov.l 7f, r1
- mov.l r0, @r1
-
- rts
- nop
-
- .balign 4
-1: .long 0xfe400008 /* SDCR0 */
-4: .long 0xfffffbff
-6: .long 0xfe40001c /* RTCOR */
-7: .long 0xfe400018 /* RTCNT */
-8: .long 0xa55a0000
-ENTRY(ap325rxa_sdram_leave_end)
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
deleted file mode 100644
index c77b5f00a66a3d..00000000000000
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ /dev/null
@@ -1,573 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Renesas - AP-325RXA
- * (Compatible with Algo System ., LTD. - AP-320A)
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- * Author : Yusuke Goda <[email protected]>
- */
-
-#include <asm/clock.h>
-#include <asm/io.h>
-#include <asm/suspend.h>
-
-#include <cpu/sh7723.h>
-
-#include <linux/dma-map-ops.h>
-#include <linux/clkdev.h>
-#include <linux/delay.h>
-#include <linux/device.h>
-#include <linux/gpio.h>
-#include <linux/gpio/machine.h>
-#include <linux/i2c.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/memblock.h>
-#include <linux/mfd/tmio.h>
-#include <linux/mmc/host.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/sh_flctl.h>
-#include <linux/platform_device.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/sh_intc.h>
-#include <linux/smsc911x.h>
-#include <linux/videodev2.h>
-
-#include <media/drv-intf/renesas-ceu.h>
-#include <media/i2c/ov772x.h>
-
-#include <video/sh_mobile_lcdc.h>
-
-#define CEU_BUFFER_MEMORY_SIZE (4 << 20)
-static phys_addr_t ceu_dma_membase;
-
-/* Dummy supplies, where voltage doesn't matter */
-static struct regulator_consumer_supply dummy_supplies[] = {
- REGULATOR_SUPPLY("vddvario", "smsc911x"),
- REGULATOR_SUPPLY("vdd33a", "smsc911x"),
-};
-
-static struct smsc911x_platform_config smsc911x_config = {
- .phy_interface = PHY_INTERFACE_MODE_MII,
- .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
- .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
- .flags = SMSC911X_USE_32BIT,
-};
-
-static struct resource smsc9118_resources[] = {
- [0] = {
- .start = 0xb6080000,
- .end = 0xb60fffff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x660),
- .end = evt2irq(0x660),
- .flags = IORESOURCE_IRQ,
- }
-};
-
-static struct platform_device smsc9118_device = {
- .name = "smsc911x",
- .id = -1,
- .num_resources = ARRAY_SIZE(smsc9118_resources),
- .resource = smsc9118_resources,
- .dev = {
- .platform_data = &smsc911x_config,
- },
-};
-
-/*
- * AP320 and AP325RXA has CPLD data in NOR Flash(0xA80000-0xABFFFF).
- * If this area erased, this board can not boot.
- */
-static struct mtd_partition ap325rxa_nor_flash_partitions[] = {
- {
- .name = "uboot",
- .offset = 0,
- .size = (1 * 1024 * 1024),
- .mask_flags = MTD_WRITEABLE, /* Read-only */
- }, {
- .name = "kernel",
- .offset = MTDPART_OFS_APPEND,
- .size = (2 * 1024 * 1024),
- }, {
- .name = "free-area0",
- .offset = MTDPART_OFS_APPEND,
- .size = ((7 * 1024 * 1024) + (512 * 1024)),
- }, {
- .name = "CPLD-Data",
- .offset = MTDPART_OFS_APPEND,
- .mask_flags = MTD_WRITEABLE, /* Read-only */
- .size = (1024 * 128 * 2),
- }, {
- .name = "free-area1",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data ap325rxa_nor_flash_data = {
- .width = 2,
- .parts = ap325rxa_nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(ap325rxa_nor_flash_partitions),
-};
-
-static struct resource ap325rxa_nor_flash_resources[] = {
- [0] = {
- .name = "NOR Flash",
- .start = 0x00000000,
- .end = 0x00ffffff,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device ap325rxa_nor_flash_device = {
- .name = "physmap-flash",
- .resource = ap325rxa_nor_flash_resources,
- .num_resources = ARRAY_SIZE(ap325rxa_nor_flash_resources),
- .dev = {
- .platform_data = &ap325rxa_nor_flash_data,
- },
-};
-
-static struct mtd_partition nand_partition_info[] = {
- {
- .name = "nand_data",
- .offset = 0,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct resource nand_flash_resources[] = {
- [0] = {
- .start = 0xa4530000,
- .end = 0xa45300ff,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct sh_flctl_platform_data nand_flash_data = {
- .parts = nand_partition_info,
- .nr_parts = ARRAY_SIZE(nand_partition_info),
- .flcmncr_val = FCKSEL_E | TYPESEL_SET | NANWF_E,
- .has_hwecc = 1,
-};
-
-static struct platform_device nand_flash_device = {
- .name = "sh_flctl",
- .resource = nand_flash_resources,
- .num_resources = ARRAY_SIZE(nand_flash_resources),
- .dev = {
- .platform_data = &nand_flash_data,
- },
-};
-
-#define FPGA_LCDREG 0xB4100180
-#define FPGA_BKLREG 0xB4100212
-#define FPGA_LCDREG_VAL 0x0018
-#define PORT_MSELCRB 0xA4050182
-#define PORT_HIZCRC 0xA405015C
-#define PORT_DRVCRA 0xA405018A
-#define PORT_DRVCRB 0xA405018C
-
-static int ap320_wvga_set_brightness(int brightness)
-{
- if (brightness) {
- gpio_set_value(GPIO_PTS3, 0);
- __raw_writew(0x100, FPGA_BKLREG);
- } else {
- __raw_writew(0, FPGA_BKLREG);
- gpio_set_value(GPIO_PTS3, 1);
- }
-
- return 0;
-}
-
-static void ap320_wvga_power_on(void)
-{
- msleep(100);
-
- /* ASD AP-320/325 LCD ON */
- __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG);
-}
-
-static void ap320_wvga_power_off(void)
-{
- /* ASD AP-320/325 LCD OFF */
- __raw_writew(0, FPGA_LCDREG);
-}
-
-static const struct fb_videomode ap325rxa_lcdc_modes[] = {
- {
- .name = "LB070WV1",
- .xres = 800,
- .yres = 480,
- .left_margin = 32,
- .right_margin = 160,
- .hsync_len = 8,
- .upper_margin = 63,
- .lower_margin = 80,
- .vsync_len = 1,
- .sync = 0, /* hsync and vsync are active low */
- },
-};
-
-static struct sh_mobile_lcdc_info lcdc_info = {
- .clock_source = LCDC_CLK_EXTERNAL,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
- .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = RGB18,
- .clock_divider = 1,
- .lcd_modes = ap325rxa_lcdc_modes,
- .num_modes = ARRAY_SIZE(ap325rxa_lcdc_modes),
- .panel_cfg = {
- .width = 152, /* 7.0 inch */
- .height = 91,
- .display_on = ap320_wvga_power_on,
- .display_off = ap320_wvga_power_off,
- },
- .bl_info = {
- .name = "sh_mobile_lcdc_bl",
- .max_brightness = 1,
- .set_brightness = ap320_wvga_set_brightness,
- },
- }
-};
-
-static struct resource lcdc_resources[] = {
- [0] = {
- .name = "LCDC",
- .start = 0xfe940000, /* P4-only space */
- .end = 0xfe942fff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x580),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device lcdc_device = {
- .name = "sh_mobile_lcdc_fb",
- .num_resources = ARRAY_SIZE(lcdc_resources),
- .resource = lcdc_resources,
- .dev = {
- .platform_data = &lcdc_info,
- },
-};
-
-/* Powerdown/reset gpios for CEU image sensors */
-static struct gpiod_lookup_table ov7725_gpios = {
- .dev_id = "0-0021",
- .table = {
- GPIO_LOOKUP("sh7723_pfc", GPIO_PTZ5, "reset", GPIO_ACTIVE_LOW),
- },
-};
-
-static struct ceu_platform_data ceu0_pdata = {
- .num_subdevs = 1,
- .subdevs = {
- { /* [0] = ov7725 */
- .flags = 0,
- .bus_width = 8,
- .bus_shift = 0,
- .i2c_adapter_id = 0,
- .i2c_address = 0x21,
- },
- },
-};
-
-static struct resource ceu_resources[] = {
- [0] = {
- .name = "CEU",
- .start = 0xfe910000,
- .end = 0xfe91009f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x880),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device ap325rxa_ceu_device = {
- .name = "renesas-ceu",
- .id = 0, /* "ceu.0" clock */
- .num_resources = ARRAY_SIZE(ceu_resources),
- .resource = ceu_resources,
- .dev = {
- .platform_data = &ceu0_pdata,
- },
-};
-
-/* Fixed 3.3V regulators to be used by SDHI0, SDHI1 */
-static struct regulator_consumer_supply fixed3v3_power_consumers[] =
-{
- REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
- REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
- REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
- REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
-};
-
-static struct resource sdhi0_cn3_resources[] = {
- [0] = {
- .name = "SDHI0",
- .start = 0x04ce0000,
- .end = 0x04ce00ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xe80),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct tmio_mmc_data sdhi0_cn3_data = {
- .capabilities = MMC_CAP_SDIO_IRQ,
-};
-
-static struct platform_device sdhi0_cn3_device = {
- .name = "sh_mobile_sdhi",
- .id = 0, /* "sdhi0" clock */
- .num_resources = ARRAY_SIZE(sdhi0_cn3_resources),
- .resource = sdhi0_cn3_resources,
- .dev = {
- .platform_data = &sdhi0_cn3_data,
- },
-};
-
-static struct resource sdhi1_cn7_resources[] = {
- [0] = {
- .name = "SDHI1",
- .start = 0x04cf0000,
- .end = 0x04cf00ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x4e0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct tmio_mmc_data sdhi1_cn7_data = {
- .capabilities = MMC_CAP_SDIO_IRQ,
-};
-
-static struct platform_device sdhi1_cn7_device = {
- .name = "sh_mobile_sdhi",
- .id = 1, /* "sdhi1" clock */
- .num_resources = ARRAY_SIZE(sdhi1_cn7_resources),
- .resource = sdhi1_cn7_resources,
- .dev = {
- .platform_data = &sdhi1_cn7_data,
- },
-};
-
-static struct ov772x_camera_info ov7725_info = {
- .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP,
- .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0),
-};
-
-static struct i2c_board_info ap325rxa_i2c_devices[] __initdata = {
- {
- I2C_BOARD_INFO("pcf8563", 0x51),
- },
- {
- I2C_BOARD_INFO("ov772x", 0x21),
- .platform_data = &ov7725_info,
- },
-};
-
-static struct platform_device *ap325rxa_devices[] __initdata = {
- &smsc9118_device,
- &ap325rxa_nor_flash_device,
- &lcdc_device,
- &nand_flash_device,
- &sdhi0_cn3_device,
- &sdhi1_cn7_device,
-};
-
-extern char ap325rxa_sdram_enter_start;
-extern char ap325rxa_sdram_enter_end;
-extern char ap325rxa_sdram_leave_start;
-extern char ap325rxa_sdram_leave_end;
-
-static int __init ap325rxa_devices_setup(void)
-{
- /* register board specific self-refresh code */
- sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF,
- &ap325rxa_sdram_enter_start,
- &ap325rxa_sdram_enter_end,
- &ap325rxa_sdram_leave_start,
- &ap325rxa_sdram_leave_end);
-
- regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
- ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
- regulator_register_fixed(1, dummy_supplies, ARRAY_SIZE(dummy_supplies));
-
- /* LD3 and LD4 LEDs */
- gpio_request(GPIO_PTX5, NULL); /* RUN */
- gpio_direction_output(GPIO_PTX5, 1);
- gpio_export(GPIO_PTX5, 0);
-
- gpio_request(GPIO_PTX4, NULL); /* INDICATOR */
- gpio_direction_output(GPIO_PTX4, 0);
- gpio_export(GPIO_PTX4, 0);
-
- /* SW1 input */
- gpio_request(GPIO_PTF7, NULL); /* MODE */
- gpio_direction_input(GPIO_PTF7);
- gpio_export(GPIO_PTF7, 0);
-
- /* LCDC */
- gpio_request(GPIO_FN_LCDD15, NULL);
- gpio_request(GPIO_FN_LCDD14, NULL);
- gpio_request(GPIO_FN_LCDD13, NULL);
- gpio_request(GPIO_FN_LCDD12, NULL);
- gpio_request(GPIO_FN_LCDD11, NULL);
- gpio_request(GPIO_FN_LCDD10, NULL);
- gpio_request(GPIO_FN_LCDD9, NULL);
- gpio_request(GPIO_FN_LCDD8, NULL);
- gpio_request(GPIO_FN_LCDD7, NULL);
- gpio_request(GPIO_FN_LCDD6, NULL);
- gpio_request(GPIO_FN_LCDD5, NULL);
- gpio_request(GPIO_FN_LCDD4, NULL);
- gpio_request(GPIO_FN_LCDD3, NULL);
- gpio_request(GPIO_FN_LCDD2, NULL);
- gpio_request(GPIO_FN_LCDD1, NULL);
- gpio_request(GPIO_FN_LCDD0, NULL);
- gpio_request(GPIO_FN_LCDLCLK_PTR, NULL);
- gpio_request(GPIO_FN_LCDDCK, NULL);
- gpio_request(GPIO_FN_LCDVEPWC, NULL);
- gpio_request(GPIO_FN_LCDVCPWC, NULL);
- gpio_request(GPIO_FN_LCDVSYN, NULL);
- gpio_request(GPIO_FN_LCDHSYN, NULL);
- gpio_request(GPIO_FN_LCDDISP, NULL);
- gpio_request(GPIO_FN_LCDDON, NULL);
-
- /* LCD backlight */
- gpio_request(GPIO_PTS3, NULL);
- gpio_direction_output(GPIO_PTS3, 1);
-
- /* CEU */
- gpio_request(GPIO_FN_VIO_CLK2, NULL);
- gpio_request(GPIO_FN_VIO_VD2, NULL);
- gpio_request(GPIO_FN_VIO_HD2, NULL);
- gpio_request(GPIO_FN_VIO_FLD, NULL);
- gpio_request(GPIO_FN_VIO_CKO, NULL);
- gpio_request(GPIO_FN_VIO_D15, NULL);
- gpio_request(GPIO_FN_VIO_D14, NULL);
- gpio_request(GPIO_FN_VIO_D13, NULL);
- gpio_request(GPIO_FN_VIO_D12, NULL);
- gpio_request(GPIO_FN_VIO_D11, NULL);
- gpio_request(GPIO_FN_VIO_D10, NULL);
- gpio_request(GPIO_FN_VIO_D9, NULL);
- gpio_request(GPIO_FN_VIO_D8, NULL);
-
- gpio_request(GPIO_PTZ7, NULL);
- gpio_direction_output(GPIO_PTZ7, 0); /* OE_CAM */
- gpio_request(GPIO_PTZ6, NULL);
- gpio_direction_output(GPIO_PTZ6, 0); /* STBY_CAM */
- gpio_request(GPIO_PTZ5, NULL);
- gpio_direction_output(GPIO_PTZ5, 0); /* RST_CAM */
- gpio_request(GPIO_PTZ4, NULL);
- gpio_direction_output(GPIO_PTZ4, 0); /* SADDR */
-
- __raw_writew(__raw_readw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB);
-
- /* FLCTL */
- gpio_request(GPIO_FN_FCE, NULL);
- gpio_request(GPIO_FN_NAF7, NULL);
- gpio_request(GPIO_FN_NAF6, NULL);
- gpio_request(GPIO_FN_NAF5, NULL);
- gpio_request(GPIO_FN_NAF4, NULL);
- gpio_request(GPIO_FN_NAF3, NULL);
- gpio_request(GPIO_FN_NAF2, NULL);
- gpio_request(GPIO_FN_NAF1, NULL);
- gpio_request(GPIO_FN_NAF0, NULL);
- gpio_request(GPIO_FN_FCDE, NULL);
- gpio_request(GPIO_FN_FOE, NULL);
- gpio_request(GPIO_FN_FSC, NULL);
- gpio_request(GPIO_FN_FWE, NULL);
- gpio_request(GPIO_FN_FRB, NULL);
-
- __raw_writew(0, PORT_HIZCRC);
- __raw_writew(0xFFFF, PORT_DRVCRA);
- __raw_writew(0xFFFF, PORT_DRVCRB);
-
- /* SDHI0 - CN3 - SD CARD */
- gpio_request(GPIO_FN_SDHI0CD_PTD, NULL);
- gpio_request(GPIO_FN_SDHI0WP_PTD, NULL);
- gpio_request(GPIO_FN_SDHI0D3_PTD, NULL);
- gpio_request(GPIO_FN_SDHI0D2_PTD, NULL);
- gpio_request(GPIO_FN_SDHI0D1_PTD, NULL);
- gpio_request(GPIO_FN_SDHI0D0_PTD, NULL);
- gpio_request(GPIO_FN_SDHI0CMD_PTD, NULL);
- gpio_request(GPIO_FN_SDHI0CLK_PTD, NULL);
-
- /* SDHI1 - CN7 - MICRO SD CARD */
- gpio_request(GPIO_FN_SDHI1CD, NULL);
- gpio_request(GPIO_FN_SDHI1D3, NULL);
- gpio_request(GPIO_FN_SDHI1D2, NULL);
- gpio_request(GPIO_FN_SDHI1D1, NULL);
- gpio_request(GPIO_FN_SDHI1D0, NULL);
- gpio_request(GPIO_FN_SDHI1CMD, NULL);
- gpio_request(GPIO_FN_SDHI1CLK, NULL);
-
- /* Add a clock alias for ov7725 xclk source. */
- clk_add_alias(NULL, "0-0021", "video_clk", NULL);
-
- /* Register RSTB gpio for ov7725 camera sensor. */
- gpiod_add_lookup_table(&ov7725_gpios);
-
- i2c_register_board_info(0, ap325rxa_i2c_devices,
- ARRAY_SIZE(ap325rxa_i2c_devices));
-
- /* Initialize CEU platform device separately to map memory first */
- device_initialize(&ap325rxa_ceu_device.dev);
- dma_declare_coherent_memory(&ap325rxa_ceu_device.dev,
- ceu_dma_membase, ceu_dma_membase,
- ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1);
-
- platform_device_add(&ap325rxa_ceu_device);
-
- return platform_add_devices(ap325rxa_devices,
- ARRAY_SIZE(ap325rxa_devices));
-}
-arch_initcall(ap325rxa_devices_setup);
-
-/* Return the board specific boot mode pin configuration */
-static int ap325rxa_mode_pins(void)
-{
- /* MD0=0, MD1=0, MD2=0: Clock Mode 0
- * MD3=0: 16-bit Area0 Bus Width
- * MD5=1: Little Endian
- * TSTMD=1, MD8=1: Test Mode Disabled
- */
- return MODE_PIN5 | MODE_PIN8;
-}
-
-/* Reserve a portion of memory for CEU buffers */
-static void __init ap325rxa_mv_mem_reserve(void)
-{
- phys_addr_t phys;
- phys_addr_t size = CEU_BUFFER_MEMORY_SIZE;
-
- phys = memblock_phys_alloc(size, PAGE_SIZE);
- if (!phys)
- panic("Failed to allocate CEU memory\n");
-
- memblock_phys_free(phys, size);
- memblock_remove(phys, size);
-
- ceu_dma_membase = phys;
-}
-
-static struct sh_machine_vector mv_ap325rxa __initmv = {
- .mv_name = "AP-325RXA",
- .mv_mode_pins = ap325rxa_mode_pins,
- .mv_mem_reserve = ap325rxa_mv_mem_reserve,
-};
diff --git a/arch/sh/boards/mach-dreamcast/Makefile b/arch/sh/boards/mach-dreamcast/Makefile
deleted file mode 100644
index 37b2452206aa21..00000000000000
--- a/arch/sh/boards/mach-dreamcast/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the Sega Dreamcast specific parts of the kernel
-#
-
-obj-y := setup.o irq.o
-obj-$(CONFIG_RTC_DRV_GENERIC) += rtc.o
diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c
deleted file mode 100644
index cc06e4cdb4cdf9..00000000000000
--- a/arch/sh/boards/mach-dreamcast/irq.c
+++ /dev/null
@@ -1,155 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/dreamcast/irq.c
- *
- * Holly IRQ support for the Sega Dreamcast.
- *
- * Copyright (c) 2001, 2002 M. R. Brown <[email protected]>
- *
- * This file is part of the LinuxDC project (http://www.linuxdc.org)
- */
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <linux/export.h>
-#include <linux/err.h>
-#include <mach/sysasic.h>
-
-/*
- * Dreamcast System ASIC Hardware Events -
- *
- * The Dreamcast's System ASIC (a.k.a. Holly) is responsible for receiving
- * hardware events from system peripherals and triggering an SH7750 IRQ.
- * Hardware events can trigger IRQs 13, 11, or 9 depending on which bits are
- * set in the Event Mask Registers (EMRs). When a hardware event is
- * triggered, its corresponding bit in the Event Status Registers (ESRs)
- * is set, and that bit should be rewritten to the ESR to acknowledge that
- * event.
- *
- * There are three 32-bit ESRs located at 0xa05f6900 - 0xa05f6908. Event
- * types can be found in arch/sh/include/mach-dreamcast/mach/sysasic.h.
- * There are three groups of EMRs that parallel the ESRs. Each EMR group
- * corresponds to an IRQ, so 0xa05f6910 - 0xa05f6918 triggers IRQ 13,
- * 0xa05f6920 - 0xa05f6928 triggers IRQ 11, and 0xa05f6930 - 0xa05f6938
- * triggers IRQ 9.
- *
- * In the kernel, these events are mapped to virtual IRQs so that drivers can
- * respond to them as they would a normal interrupt. In order to keep this
- * mapping simple, the events are mapped as:
- *
- * 6900/6910 - Events 0-31, IRQ 13
- * 6904/6924 - Events 32-63, IRQ 11
- * 6908/6938 - Events 64-95, IRQ 9
- *
- */
-
-#define ESR_BASE 0x005f6900 /* Base event status register */
-#define EMR_BASE 0x005f6910 /* Base event mask register */
-
-/*
- * Helps us determine the EMR group that this event belongs to: 0 = 0x6910,
- * 1 = 0x6920, 2 = 0x6930; also determine the event offset.
- */
-#define LEVEL(event) (((event) - HW_EVENT_IRQ_BASE) / 32)
-
-/* Return the hardware event's bit position within the EMR/ESR */
-#define EVENT_BIT(event) (((event) - HW_EVENT_IRQ_BASE) & 31)
-
-/*
- * For each of these *_irq routines, the IRQ passed in is the virtual IRQ
- * (logically mapped to the corresponding bit for the hardware event).
- */
-
-/* Disable the hardware event by masking its bit in its EMR */
-static inline void disable_systemasic_irq(struct irq_data *data)
-{
- unsigned int irq = data->irq;
- __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
- __u32 mask;
-
- mask = inl(emr);
- mask &= ~(1 << EVENT_BIT(irq));
- outl(mask, emr);
-}
-
-/* Enable the hardware event by setting its bit in its EMR */
-static inline void enable_systemasic_irq(struct irq_data *data)
-{
- unsigned int irq = data->irq;
- __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
- __u32 mask;
-
- mask = inl(emr);
- mask |= (1 << EVENT_BIT(irq));
- outl(mask, emr);
-}
-
-/* Acknowledge a hardware event by writing its bit back to its ESR */
-static void mask_ack_systemasic_irq(struct irq_data *data)
-{
- unsigned int irq = data->irq;
- __u32 esr = ESR_BASE + (LEVEL(irq) << 2);
- disable_systemasic_irq(data);
- outl((1 << EVENT_BIT(irq)), esr);
-}
-
-struct irq_chip systemasic_int = {
- .name = "System ASIC",
- .irq_mask = disable_systemasic_irq,
- .irq_mask_ack = mask_ack_systemasic_irq,
- .irq_unmask = enable_systemasic_irq,
-};
-
-/*
- * Map the hardware event indicated by the processor IRQ to a virtual IRQ.
- */
-int systemasic_irq_demux(int irq)
-{
- __u32 emr, esr, status, level;
- __u32 j, bit;
-
- switch (irq) {
- case 13:
- level = 0;
- break;
- case 11:
- level = 1;
- break;
- case 9:
- level = 2;
- break;
- default:
- return irq;
- }
- emr = EMR_BASE + (level << 4) + (level << 2);
- esr = ESR_BASE + (level << 2);
-
- /* Mask the ESR to filter any spurious, unwanted interrupts */
- status = inl(esr);
- status &= inl(emr);
-
- /* Now scan and find the first set bit as the event to map */
- for (bit = 1, j = 0; j < 32; bit <<= 1, j++) {
- if (status & bit) {
- irq = HW_EVENT_IRQ_BASE + j + (level << 5);
- return irq;
- }
- }
-
- /* Not reached */
- return irq;
-}
-
-void systemasic_irq_init(void)
-{
- int irq_base, i;
-
- irq_base = irq_alloc_descs(HW_EVENT_IRQ_BASE, HW_EVENT_IRQ_BASE,
- HW_EVENT_IRQ_MAX - HW_EVENT_IRQ_BASE, -1);
- if (IS_ERR_VALUE(irq_base)) {
- pr_err("%s: failed hooking irqs\n", __func__);
- return;
- }
-
- for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
- irq_set_chip_and_handler(i, &systemasic_int, handle_level_irq);
-}
diff --git a/arch/sh/boards/mach-dreamcast/rtc.c b/arch/sh/boards/mach-dreamcast/rtc.c
deleted file mode 100644
index 7873cd27e4e008..00000000000000
--- a/arch/sh/boards/mach-dreamcast/rtc.c
+++ /dev/null
@@ -1,96 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/dreamcast/rtc.c
- *
- * Dreamcast AICA RTC routines.
- *
- * Copyright (c) 2001, 2002 M. R. Brown <[email protected]>
- * Copyright (c) 2002 Paul Mundt <[email protected]>
- */
-
-#include <linux/time.h>
-#include <linux/rtc.h>
-#include <linux/io.h>
-#include <linux/platform_device.h>
-
-/* The AICA RTC has an Epoch of 1/1/1950, so we must subtract 20 years (in
- seconds) to get the standard Unix Epoch when getting the time, and add
- 20 years when setting the time. */
-#define TWENTY_YEARS ((20 * 365LU + 5) * 86400)
-
-/* The AICA RTC is represented by a 32-bit seconds counter stored in 2 16-bit
- registers.*/
-#define AICA_RTC_SECS_H 0xa0710000
-#define AICA_RTC_SECS_L 0xa0710004
-
-/**
- * aica_rtc_gettimeofday - Get the time from the AICA RTC
- * @dev: the RTC device (ignored)
- * @tm: pointer to resulting RTC time structure
- *
- * Grabs the current RTC seconds counter and adjusts it to the Unix Epoch.
- */
-static int aica_rtc_gettimeofday(struct device *dev, struct rtc_time *tm)
-{
- unsigned long val1, val2;
- time64_t t;
-
- do {
- val1 = ((__raw_readl(AICA_RTC_SECS_H) & 0xffff) << 16) |
- (__raw_readl(AICA_RTC_SECS_L) & 0xffff);
-
- val2 = ((__raw_readl(AICA_RTC_SECS_H) & 0xffff) << 16) |
- (__raw_readl(AICA_RTC_SECS_L) & 0xffff);
- } while (val1 != val2);
-
- /* normalize to 1970..2106 time range */
- t = (u32)(val1 - TWENTY_YEARS);
-
- rtc_time64_to_tm(t, tm);
-
- return 0;
-}
-
-/**
- * aica_rtc_settimeofday - Set the AICA RTC to the current time
- * @dev: the RTC device (ignored)
- * @tm: pointer to new RTC time structure
- *
- * Adjusts the given @tv to the AICA Epoch and sets the RTC seconds counter.
- */
-static int aica_rtc_settimeofday(struct device *dev, struct rtc_time *tm)
-{
- unsigned long val1, val2;
- time64_t secs = rtc_tm_to_time64(tm);
- u32 adj = secs + TWENTY_YEARS;
-
- do {
- __raw_writel((adj & 0xffff0000) >> 16, AICA_RTC_SECS_H);
- __raw_writel((adj & 0xffff), AICA_RTC_SECS_L);
-
- val1 = ((__raw_readl(AICA_RTC_SECS_H) & 0xffff) << 16) |
- (__raw_readl(AICA_RTC_SECS_L) & 0xffff);
-
- val2 = ((__raw_readl(AICA_RTC_SECS_H) & 0xffff) << 16) |
- (__raw_readl(AICA_RTC_SECS_L) & 0xffff);
- } while (val1 != val2);
-
- return 0;
-}
-
-static const struct rtc_class_ops rtc_generic_ops = {
- .read_time = aica_rtc_gettimeofday,
- .set_time = aica_rtc_settimeofday,
-};
-
-static int __init aica_time_init(void)
-{
- struct platform_device *pdev;
-
- pdev = platform_device_register_data(NULL, "rtc-generic", -1,
- &rtc_generic_ops,
- sizeof(rtc_generic_ops));
-
- return PTR_ERR_OR_ZERO(pdev);
-}
-arch_initcall(aica_time_init);
diff --git a/arch/sh/boards/mach-dreamcast/setup.c b/arch/sh/boards/mach-dreamcast/setup.c
deleted file mode 100644
index 2d966c1c2cc188..00000000000000
--- a/arch/sh/boards/mach-dreamcast/setup.c
+++ /dev/null
@@ -1,39 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/dreamcast/setup.c
- *
- * Hardware support for the Sega Dreamcast.
- *
- * Copyright (c) 2001, 2002 M. R. Brown <[email protected]>
- * Copyright (c) 2002, 2003, 2004 Paul Mundt <[email protected]>
- *
- * This file is part of the LinuxDC project (http://www.linuxdc.org)
- *
- * This file originally bore the message (with enclosed-$):
- * Id: setup_dc.c,v 1.5 2001/05/24 05:09:16 mrbrown Exp
- * SEGA Dreamcast support
- */
-
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/param.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/device.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/rtc.h>
-#include <asm/machvec.h>
-#include <mach/sysasic.h>
-
-static void __init dreamcast_setup(char **cmdline_p)
-{
-}
-
-static struct sh_machine_vector mv_dreamcast __initmv = {
- .mv_name = "Sega Dreamcast",
- .mv_setup = dreamcast_setup,
- .mv_irq_demux = systemasic_irq_demux,
- .mv_init_irq = systemasic_irq_init,
-};
diff --git a/arch/sh/boards/mach-ecovec24/Makefile b/arch/sh/boards/mach-ecovec24/Makefile
deleted file mode 100644
index d78d4904ddee32..00000000000000
--- a/arch/sh/boards/mach-ecovec24/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the R0P7724LC0011/21RL (EcoVec)
-#
-# This file is subject to the terms and conditions of the GNU General Public
-# License. See the file "COPYING" in the main directory of this archive
-# for more details.
-#
-
-obj-y := setup.o sdram.o
diff --git a/arch/sh/boards/mach-ecovec24/sdram.S b/arch/sh/boards/mach-ecovec24/sdram.S
deleted file mode 100644
index d2f269169abb94..00000000000000
--- a/arch/sh/boards/mach-ecovec24/sdram.S
+++ /dev/null
@@ -1,108 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
- * Ecovec24 sdram self/auto-refresh setup code
- *
- * Copyright (C) 2009 Magnus Damm
- */
-
-#include <linux/sys.h>
-#include <linux/errno.h>
-#include <linux/linkage.h>
-#include <asm/asm-offsets.h>
-#include <asm/suspend.h>
-#include <asm/romimage-macros.h>
-
-/* code to enter and leave self-refresh. must be self-contained.
- * this code will be copied to on-chip memory and executed from there.
- */
- .balign 4
-ENTRY(ecovec24_sdram_enter_start)
-
- /* DBSC: put memory in self-refresh mode */
-
- ED 0xFD000010, 0x00000000 /* DBEN */
- ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
- ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
-
- rts
- nop
-
-ENTRY(ecovec24_sdram_enter_end)
-
- .balign 4
-ENTRY(ecovec24_sdram_leave_start)
-
- mov.l @(SH_SLEEP_MODE, r5), r0
- tst #SUSP_SH_RSTANDBY, r0
- bf resume_rstandby
-
- /* DBSC: put memory in auto-refresh mode */
-
- ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
- WAIT 1
- ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000010, 0x00000001 /* DBEN */
- ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
-
- rts
- nop
-
-resume_rstandby:
-
- /* DBSC: re-initialize and put in auto-refresh */
-
- ED 0xFD000108, 0x00000181 /* DBPDCNT0 */
- ED 0xFD000020, 0x015B0002 /* DBCONF */
- ED 0xFD000030, 0x03071502 /* DBTR0 */
- ED 0xFD000034, 0x02020102 /* DBTR1 */
- ED 0xFD000038, 0x01090405 /* DBTR2 */
- ED 0xFD00003C, 0x00000002 /* DBTR3 */
- ED 0xFD000008, 0x00000005 /* DBKIND */
- ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
- ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
- ED 0xFD000018, 0x00000001 /* DBCKECNT */
-
- mov #100,r0
-WAIT_400NS:
- dt r0
- bf WAIT_400NS
-
- ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
- ED 0xFD000060, 0x00020000 /* DBMRCNT (EMR2) */
- ED 0xFD000060, 0x00030000 /* DBMRCNT (EMR3) */
- ED 0xFD000060, 0x00010004 /* DBMRCNT (EMR) */
- ED 0xFD000060, 0x00000532 /* DBMRCNT (MRS) */
- ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000060, 0x00000432 /* DBMRCNT (MRS) */
- ED 0xFD000060, 0x000103c0 /* DBMRCNT (EMR) */
- ED 0xFD000060, 0x00010040 /* DBMRCNT (EMR) */
-
- mov #100,r0
-WAIT_400NS_2:
- dt r0
- bf WAIT_400NS_2
-
- ED 0xFD000010, 0x00000001 /* DBEN */
- ED 0xFD000044, 0x0000050f /* DBRFPDN1 */
- ED 0xFD000048, 0x236800e6 /* DBRFPDN2 */
-
- mov.l DUMMY,r0
- mov.l @r0, r1 /* force single dummy read */
-
- ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000108, 0x00000080 /* DBPDCNT0 */
- ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
-
- rts
- nop
-
- .balign 4
-DUMMY: .long 0xac400000
-
-ENTRY(ecovec24_sdram_leave_end)
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
deleted file mode 100644
index 674da7ebd8b7f5..00000000000000
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ /dev/null
@@ -1,1521 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright (C) 2009 Renesas Solutions Corp.
- *
- * Kuninori Morimoto <[email protected]>
- */
-#include <asm/clock.h>
-#include <asm/heartbeat.h>
-#include <asm/suspend.h>
-#include <cpu/sh7724.h>
-#include <linux/delay.h>
-#include <linux/device.h>
-#include <linux/i2c.h>
-#include <linux/io.h>
-#include <linux/init.h>
-#include <linux/input.h>
-#include <linux/input/sh_keysc.h>
-#include <linux/interrupt.h>
-#include <linux/memblock.h>
-#include <linux/mfd/tmio.h>
-#include <linux/mmc/host.h>
-#include <linux/platform_data/sh_mmcif.h>
-#include <linux/mtd/physmap.h>
-#include <linux/gpio.h>
-#include <linux/gpio/machine.h>
-#include <linux/platform_data/gpio_backlight.h>
-#include <linux/platform_data/tsc2007.h>
-#include <linux/platform_device.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/sh_eth.h>
-#include <linux/sh_intc.h>
-#include <linux/spi/mmc_spi.h>
-#include <linux/spi/sh_msiof.h>
-#include <linux/spi/spi.h>
-#include <linux/usb/r8a66597.h>
-#include <linux/usb/renesas_usbhs.h>
-#include <linux/videodev2.h>
-#include <linux/dma-map-ops.h>
-
-#include <media/drv-intf/renesas-ceu.h>
-#include <media/i2c/mt9t112.h>
-#include <media/i2c/tw9910.h>
-
-#include <sound/sh_fsi.h>
-#include <sound/simple_card.h>
-
-#include <video/sh_mobile_lcdc.h>
-
-/*
- * Address Interface BusWidth
- *-----------------------------------------
- * 0x0000_0000 uboot 16bit
- * 0x0004_0000 Linux romImage 16bit
- * 0x0014_0000 MTD for Linux 16bit
- * 0x0400_0000 Internal I/O 16/32bit
- * 0x0800_0000 DRAM 32bit
- * 0x1800_0000 MFI 16bit
- */
-
-/* SWITCH
- *------------------------------
- * DS2[1] = FlashROM write protect ON : write protect
- * OFF : No write protect
- * DS2[2] = RMII / TS, SCIF ON : RMII
- * OFF : TS, SCIF3
- * DS2[3] = Camera / Video ON : Camera
- * OFF : NTSC/PAL (IN)
- * DS2[5] = NTSC_OUT Clock ON : On board OSC
- * OFF : SH7724 DV_CLK
- * DS2[6-7] = MMC / SD ON-OFF : SD
- * OFF-ON : MMC
- */
-
-/*
- * FSI - DA7210
- *
- * it needs amixer settings for playing
- *
- * amixer set 'HeadPhone' 80
- * amixer set 'Out Mixer Left DAC Left' on
- * amixer set 'Out Mixer Right DAC Right' on
- */
-
-#define CEU_BUFFER_MEMORY_SIZE (4 << 20)
-static phys_addr_t ceu0_dma_membase;
-static phys_addr_t ceu1_dma_membase;
-
-/* Heartbeat */
-static unsigned char led_pos[] = { 0, 1, 2, 3 };
-
-static struct heartbeat_data heartbeat_data = {
- .nr_bits = 4,
- .bit_pos = led_pos,
-};
-
-static struct resource heartbeat_resource = {
- .start = 0xA405012C, /* PTG */
- .end = 0xA405012E - 1,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .dev = {
- .platform_data = &heartbeat_data,
- },
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-/* MTD */
-static struct mtd_partition nor_flash_partitions[] = {
- {
- .name = "boot loader",
- .offset = 0,
- .size = (5 * 1024 * 1024),
- .mask_flags = MTD_WRITEABLE, /* force read-only */
- }, {
- .name = "free-area",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data nor_flash_data = {
- .width = 2,
- .parts = nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(nor_flash_partitions),
-};
-
-static struct resource nor_flash_resources[] = {
- [0] = {
- .name = "NOR Flash",
- .start = 0x00000000,
- .end = 0x03ffffff,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device nor_flash_device = {
- .name = "physmap-flash",
- .resource = nor_flash_resources,
- .num_resources = ARRAY_SIZE(nor_flash_resources),
- .dev = {
- .platform_data = &nor_flash_data,
- },
-};
-
-/* SH Eth */
-#define SH_ETH_ADDR (0xA4600000)
-static struct resource sh_eth_resources[] = {
- [0] = {
- .start = SH_ETH_ADDR,
- .end = SH_ETH_ADDR + 0x1FC,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xd60),
- .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
- },
-};
-
-static struct sh_eth_plat_data sh_eth_plat = {
- .phy = 0x1f, /* SMSC LAN8700 */
- .phy_interface = PHY_INTERFACE_MODE_MII,
- .ether_link_active_low = 1
-};
-
-static struct platform_device sh_eth_device = {
- .name = "sh7724-ether",
- .id = 0,
- .dev = {
- .platform_data = &sh_eth_plat,
- },
- .num_resources = ARRAY_SIZE(sh_eth_resources),
- .resource = sh_eth_resources,
-};
-
-/* USB0 host */
-static void usb0_port_power(int port, int power)
-{
- gpio_set_value(GPIO_PTB4, power);
-}
-
-static struct r8a66597_platdata usb0_host_data = {
- .on_chip = 1,
- .port_power = usb0_port_power,
-};
-
-static struct resource usb0_host_resources[] = {
- [0] = {
- .start = 0xa4d80000,
- .end = 0xa4d80124 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xa20),
- .end = evt2irq(0xa20),
- .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
- },
-};
-
-static struct platform_device usb0_host_device = {
- .name = "r8a66597_hcd",
- .id = 0,
- .dev = {
- .dma_mask = NULL, /* not use dma */
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &usb0_host_data,
- },
- .num_resources = ARRAY_SIZE(usb0_host_resources),
- .resource = usb0_host_resources,
-};
-
-/* USB1 host/function */
-static void usb1_port_power(int port, int power)
-{
- gpio_set_value(GPIO_PTB5, power);
-}
-
-static struct r8a66597_platdata usb1_common_data = {
- .on_chip = 1,
- .port_power = usb1_port_power,
-};
-
-static struct resource usb1_common_resources[] = {
- [0] = {
- .start = 0xa4d90000,
- .end = 0xa4d90124 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xa40),
- .end = evt2irq(0xa40),
- .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
- },
-};
-
-static struct platform_device usb1_common_device = {
- /* .name will be added in arch_setup */
- .id = 1,
- .dev = {
- .dma_mask = NULL, /* not use dma */
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &usb1_common_data,
- },
- .num_resources = ARRAY_SIZE(usb1_common_resources),
- .resource = usb1_common_resources,
-};
-
-/*
- * USBHS
- */
-static int usbhs_get_id(struct platform_device *pdev)
-{
- return gpio_get_value(GPIO_PTB3);
-}
-
-static int usbhs_phy_reset(struct platform_device *pdev)
-{
- /* enable vbus if HOST */
- if (!gpio_get_value(GPIO_PTB3))
- gpio_set_value(GPIO_PTB5, 1);
-
- return 0;
-}
-
-static struct renesas_usbhs_platform_info usbhs_info = {
- .platform_callback = {
- .get_id = usbhs_get_id,
- .phy_reset = usbhs_phy_reset,
- },
- .driver_param = {
- .buswait_bwait = 4,
- .detection_delay = 5,
- .d0_tx_id = SHDMA_SLAVE_USB1D0_TX,
- .d0_rx_id = SHDMA_SLAVE_USB1D0_RX,
- .d1_tx_id = SHDMA_SLAVE_USB1D1_TX,
- .d1_rx_id = SHDMA_SLAVE_USB1D1_RX,
- },
-};
-
-static struct resource usbhs_resources[] = {
- [0] = {
- .start = 0xa4d90000,
- .end = 0xa4d90124 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xa40),
- .end = evt2irq(0xa40),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device usbhs_device = {
- .name = "renesas_usbhs",
- .id = 1,
- .dev = {
- .dma_mask = NULL, /* not use dma */
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &usbhs_info,
- },
- .num_resources = ARRAY_SIZE(usbhs_resources),
- .resource = usbhs_resources,
-};
-
-/* LCDC and backlight */
-static const struct fb_videomode ecovec_lcd_modes[] = {
- {
- .name = "Panel",
- .xres = 800,
- .yres = 480,
- .left_margin = 220,
- .right_margin = 110,
- .hsync_len = 70,
- .upper_margin = 20,
- .lower_margin = 5,
- .vsync_len = 5,
- .sync = 0, /* hsync and vsync are active low */
- },
-};
-
-static const struct fb_videomode ecovec_dvi_modes[] = {
- {
- .name = "DVI",
- .xres = 1280,
- .yres = 720,
- .left_margin = 220,
- .right_margin = 110,
- .hsync_len = 40,
- .upper_margin = 20,
- .lower_margin = 5,
- .vsync_len = 5,
- .sync = 0, /* hsync and vsync are active low */
- },
-};
-
-static struct sh_mobile_lcdc_info lcdc_info = {
- .ch[0] = {
- .interface_type = RGB18,
- .chan = LCDC_CHAN_MAINLCD,
- .fourcc = V4L2_PIX_FMT_RGB565,
- .panel_cfg = { /* 7.0 inch */
- .width = 152,
- .height = 91,
- },
- }
-};
-
-static struct resource lcdc_resources[] = {
- [0] = {
- .name = "LCDC",
- .start = 0xfe940000,
- .end = 0xfe942fff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xf40),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device lcdc_device = {
- .name = "sh_mobile_lcdc_fb",
- .num_resources = ARRAY_SIZE(lcdc_resources),
- .resource = lcdc_resources,
- .dev = {
- .platform_data = &lcdc_info,
- },
-};
-
-static struct gpiod_lookup_table gpio_backlight_lookup = {
- .dev_id = "gpio-backlight.0",
- .table = {
- GPIO_LOOKUP("sh7724_pfc", GPIO_PTR1, NULL, GPIO_ACTIVE_HIGH),
- { }
- },
-};
-
-static struct property_entry gpio_backlight_props[] = {
- PROPERTY_ENTRY_BOOL("default-on"),
- { }
-};
-
-static struct gpio_backlight_platform_data gpio_backlight_data = {
- .fbdev = &lcdc_device.dev,
-};
-
-static const struct platform_device_info gpio_backlight_device_info = {
- .name = "gpio-backlight",
- .data = &gpio_backlight_data,
- .size_data = sizeof(gpio_backlight_data),
- .properties = gpio_backlight_props,
-};
-
-static struct platform_device *gpio_backlight_device;
-
-/* CEU0 */
-static struct ceu_platform_data ceu0_pdata = {
- .num_subdevs = 2,
- .subdevs = {
- { /* [0] = mt9t112 */
- .flags = 0,
- .bus_width = 8,
- .bus_shift = 0,
- .i2c_adapter_id = 0,
- .i2c_address = 0x3c,
- },
- { /* [1] = tw9910 */
- .flags = 0,
- .bus_width = 8,
- .bus_shift = 0,
- .i2c_adapter_id = 0,
- .i2c_address = 0x45,
- },
- },
-};
-
-static struct resource ceu0_resources[] = {
- [0] = {
- .name = "CEU0",
- .start = 0xfe910000,
- .end = 0xfe91009f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x880),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device ceu0_device = {
- .name = "renesas-ceu",
- .id = 0, /* ceu.0 */
- .num_resources = ARRAY_SIZE(ceu0_resources),
- .resource = ceu0_resources,
- .dev = {
- .platform_data = &ceu0_pdata,
- },
-};
-
-/* CEU1 */
-static struct ceu_platform_data ceu1_pdata = {
- .num_subdevs = 1,
- .subdevs = {
- { /* [0] = mt9t112 */
- .flags = 0,
- .bus_width = 8,
- .bus_shift = 0,
- .i2c_adapter_id = 1,
- .i2c_address = 0x3c,
- },
- },
-};
-
-static struct resource ceu1_resources[] = {
- [0] = {
- .name = "CEU1",
- .start = 0xfe914000,
- .end = 0xfe91409f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x9e0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device ceu1_device = {
- .name = "renesas-ceu",
- .id = 1, /* ceu.1 */
- .num_resources = ARRAY_SIZE(ceu1_resources),
- .resource = ceu1_resources,
- .dev = {
- .platform_data = &ceu1_pdata,
- },
-};
-
-/* Power up/down GPIOs for camera devices and video decoder */
-static struct gpiod_lookup_table tw9910_gpios = {
- .dev_id = "0-0045",
- .table = {
- GPIO_LOOKUP("sh7724_pfc", GPIO_PTU2, "pdn", GPIO_ACTIVE_HIGH),
- },
-};
-
-static struct gpiod_lookup_table mt9t112_0_gpios = {
- .dev_id = "0-003c",
- .table = {
- GPIO_LOOKUP("sh7724_pfc", GPIO_PTA3, "standby",
- GPIO_ACTIVE_HIGH),
- },
-};
-
-static struct gpiod_lookup_table mt9t112_1_gpios = {
- .dev_id = "1-003c",
- .table = {
- GPIO_LOOKUP("sh7724_pfc", GPIO_PTA4, "standby",
- GPIO_ACTIVE_HIGH),
- },
-};
-
-/* I2C device */
-static struct tw9910_video_info tw9910_info = {
- .buswidth = 8,
- .mpout = TW9910_MPO_FIELD,
-};
-
-static struct mt9t112_platform_data mt9t112_0_pdata = {
- .flags = MT9T112_FLAG_PCLK_RISING_EDGE,
- .divider = { 0x49, 0x6, 0, 6, 0, 9, 9, 6, 0 }, /* for 24MHz */
-};
-
-static struct mt9t112_platform_data mt9t112_1_pdata = {
- .flags = MT9T112_FLAG_PCLK_RISING_EDGE,
- .divider = { 0x49, 0x6, 0, 6, 0, 9, 9, 6, 0 }, /* for 24MHz */
-};
-
-static struct i2c_board_info i2c0_devices[] = {
- {
- I2C_BOARD_INFO("da7210", 0x1a),
- },
- {
- I2C_BOARD_INFO("tw9910", 0x45),
- .platform_data = &tw9910_info,
- },
- {
- /* 1st camera */
- I2C_BOARD_INFO("mt9t112", 0x3c),
- .platform_data = &mt9t112_0_pdata,
- },
-};
-
-static struct i2c_board_info i2c1_devices[] = {
- {
- I2C_BOARD_INFO("r2025sd", 0x32),
- },
- {
- I2C_BOARD_INFO("lis3lv02d", 0x1c),
- .irq = evt2irq(0x620),
- },
- {
- /* 2nd camera */
- I2C_BOARD_INFO("mt9t112", 0x3c),
- .platform_data = &mt9t112_1_pdata,
- },
-};
-
-/* KEYSC */
-static struct sh_keysc_info keysc_info = {
- .mode = SH_KEYSC_MODE_1,
- .scan_timing = 3,
- .delay = 50,
- .kycr2_delay = 100,
- .keycodes = { KEY_1, 0, 0, 0, 0,
- KEY_2, 0, 0, 0, 0,
- KEY_3, 0, 0, 0, 0,
- KEY_4, 0, 0, 0, 0,
- KEY_5, 0, 0, 0, 0,
- KEY_6, 0, 0, 0, 0, },
-};
-
-static struct resource keysc_resources[] = {
- [0] = {
- .name = "KEYSC",
- .start = 0x044b0000,
- .end = 0x044b000f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xbe0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device keysc_device = {
- .name = "sh_keysc",
- .id = 0, /* keysc0 clock */
- .num_resources = ARRAY_SIZE(keysc_resources),
- .resource = keysc_resources,
- .dev = {
- .platform_data = &keysc_info,
- },
-};
-
-/* TouchScreen */
-#define IRQ0 evt2irq(0x600)
-
-static int ts_get_pendown_state(struct device *dev)
-{
- int val = 0;
- gpio_free(GPIO_FN_INTC_IRQ0);
- gpio_request(GPIO_PTZ0, NULL);
- gpio_direction_input(GPIO_PTZ0);
-
- val = gpio_get_value(GPIO_PTZ0);
-
- gpio_free(GPIO_PTZ0);
- gpio_request(GPIO_FN_INTC_IRQ0, NULL);
-
- return val ? 0 : 1;
-}
-
-static int ts_init(void)
-{
- gpio_request(GPIO_FN_INTC_IRQ0, NULL);
- return 0;
-}
-
-static struct tsc2007_platform_data tsc2007_info = {
- .model = 2007,
- .x_plate_ohms = 180,
- .get_pendown_state = ts_get_pendown_state,
- .init_platform_hw = ts_init,
-};
-
-static struct i2c_board_info ts_i2c_clients = {
- I2C_BOARD_INFO("tsc2007", 0x48),
- .type = "tsc2007",
- .platform_data = &tsc2007_info,
- .irq = IRQ0,
-};
-
-static struct regulator_consumer_supply cn12_power_consumers[] =
-{
- REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
- REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
- REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
- REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
-};
-
-static struct regulator_init_data cn12_power_init_data = {
- .constraints = {
- .valid_ops_mask = REGULATOR_CHANGE_STATUS,
- },
- .num_consumer_supplies = ARRAY_SIZE(cn12_power_consumers),
- .consumer_supplies = cn12_power_consumers,
-};
-
-static struct fixed_voltage_config cn12_power_info = {
- .supply_name = "CN12 SD/MMC Vdd",
- .microvolts = 3300000,
- .init_data = &cn12_power_init_data,
-};
-
-static struct platform_device cn12_power = {
- .name = "reg-fixed-voltage",
- .id = 0,
- .dev = {
- .platform_data = &cn12_power_info,
- },
-};
-
-static struct gpiod_lookup_table cn12_power_gpiod_table = {
- .dev_id = "reg-fixed-voltage.0",
- .table = {
- /* Offset 7 on port B */
- GPIO_LOOKUP("sh7724_pfc", GPIO_PTB7,
- NULL, GPIO_ACTIVE_HIGH),
- { },
- },
-};
-
-#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
-/* SDHI0 */
-static struct regulator_consumer_supply sdhi0_power_consumers[] =
-{
- REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
- REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
-};
-
-static struct regulator_init_data sdhi0_power_init_data = {
- .constraints = {
- .valid_ops_mask = REGULATOR_CHANGE_STATUS,
- },
- .num_consumer_supplies = ARRAY_SIZE(sdhi0_power_consumers),
- .consumer_supplies = sdhi0_power_consumers,
-};
-
-static struct fixed_voltage_config sdhi0_power_info = {
- .supply_name = "CN11 SD/MMC Vdd",
- .microvolts = 3300000,
- .init_data = &sdhi0_power_init_data,
-};
-
-static struct platform_device sdhi0_power = {
- .name = "reg-fixed-voltage",
- .id = 1,
- .dev = {
- .platform_data = &sdhi0_power_info,
- },
-};
-
-static struct gpiod_lookup_table sdhi0_power_gpiod_table = {
- .dev_id = "reg-fixed-voltage.1",
- .table = {
- /* Offset 6 on port B */
- GPIO_LOOKUP("sh7724_pfc", GPIO_PTB6,
- NULL, GPIO_ACTIVE_HIGH),
- { },
- },
-};
-
-static struct gpiod_lookup_table sdhi0_gpio_table = {
- .dev_id = "sh_mobile_sdhi.0",
- .table = {
- /* Card detect */
- GPIO_LOOKUP("sh7724_pfc", GPIO_PTY7, "cd", GPIO_ACTIVE_LOW),
- { },
- },
-};
-
-static struct tmio_mmc_data sdhi0_info = {
- .chan_priv_tx = (void *)SHDMA_SLAVE_SDHI0_TX,
- .chan_priv_rx = (void *)SHDMA_SLAVE_SDHI0_RX,
- .capabilities = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD |
- MMC_CAP_NEEDS_POLL,
-};
-
-static struct resource sdhi0_resources[] = {
- [0] = {
- .name = "SDHI0",
- .start = 0x04ce0000,
- .end = 0x04ce00ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xe80),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device sdhi0_device = {
- .name = "sh_mobile_sdhi",
- .num_resources = ARRAY_SIZE(sdhi0_resources),
- .resource = sdhi0_resources,
- .id = 0,
- .dev = {
- .platform_data = &sdhi0_info,
- },
-};
-
-#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
-/* SDHI1 */
-static struct tmio_mmc_data sdhi1_info = {
- .chan_priv_tx = (void *)SHDMA_SLAVE_SDHI1_TX,
- .chan_priv_rx = (void *)SHDMA_SLAVE_SDHI1_RX,
- .capabilities = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD |
- MMC_CAP_NEEDS_POLL,
-};
-
-static struct gpiod_lookup_table sdhi1_gpio_table = {
- .dev_id = "sh_mobile_sdhi.1",
- .table = {
- /* Card detect */
- GPIO_LOOKUP("sh7724_pfc", GPIO_PTW7, "cd", GPIO_ACTIVE_LOW),
- { },
- },
-};
-
-static struct resource sdhi1_resources[] = {
- [0] = {
- .name = "SDHI1",
- .start = 0x04cf0000,
- .end = 0x04cf00ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x4e0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device sdhi1_device = {
- .name = "sh_mobile_sdhi",
- .num_resources = ARRAY_SIZE(sdhi1_resources),
- .resource = sdhi1_resources,
- .id = 1,
- .dev = {
- .platform_data = &sdhi1_info,
- },
-};
-#endif /* CONFIG_MMC_SH_MMCIF */
-
-#else
-
-/* MMC SPI */
-static void mmc_spi_setpower(struct device *dev, unsigned int maskval)
-{
- gpio_set_value(GPIO_PTB6, maskval ? 1 : 0);
-}
-
-static struct mmc_spi_platform_data mmc_spi_info = {
- .caps = MMC_CAP_NEEDS_POLL,
- .caps2 = MMC_CAP2_RO_ACTIVE_HIGH,
- .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* 3.3V only */
- .setpower = mmc_spi_setpower,
-};
-
-static struct gpiod_lookup_table mmc_spi_gpio_table = {
- .dev_id = "mmc_spi.0", /* device "mmc_spi" @ CS0 */
- .table = {
- /* Card detect */
- GPIO_LOOKUP_IDX("sh7724_pfc", GPIO_PTY7, NULL, 0,
- GPIO_ACTIVE_LOW),
- /* Write protect */
- GPIO_LOOKUP_IDX("sh7724_pfc", GPIO_PTY6, NULL, 1,
- GPIO_ACTIVE_HIGH),
- { },
- },
-};
-
-static struct spi_board_info spi_bus[] = {
- {
- .modalias = "mmc_spi",
- .platform_data = &mmc_spi_info,
- .max_speed_hz = 5000000,
- .mode = SPI_MODE_0,
- },
-};
-
-/* MSIOF0 */
-static struct sh_msiof_spi_info msiof0_data = {
- .num_chipselect = 1,
-};
-
-static struct resource msiof0_resources[] = {
- [0] = {
- .name = "MSIOF0",
- .start = 0xa4c40000,
- .end = 0xa4c40063,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xc80),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device msiof0_device = {
- .name = "spi_sh_msiof",
- .id = 0, /* MSIOF0 */
- .dev = {
- .platform_data = &msiof0_data,
- },
- .num_resources = ARRAY_SIZE(msiof0_resources),
- .resource = msiof0_resources,
-};
-
-static struct gpiod_lookup_table msiof_gpio_table = {
- .dev_id = "spi_sh_msiof.0",
- .table = {
- GPIO_LOOKUP("sh7724_pfc", GPIO_PTM4, "cs", GPIO_ACTIVE_HIGH),
- { },
- },
-};
-
-#endif
-
-/* FSI */
-static struct resource fsi_resources[] = {
- [0] = {
- .name = "FSI",
- .start = 0xFE3C0000,
- .end = 0xFE3C021d,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xf80),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device fsi_device = {
- .name = "sh_fsi",
- .id = 0,
- .num_resources = ARRAY_SIZE(fsi_resources),
- .resource = fsi_resources,
-};
-
-static struct asoc_simple_card_info fsi_da7210_info = {
- .name = "DA7210",
- .card = "FSIB-DA7210",
- .codec = "da7210.0-001a",
- .platform = "sh_fsi.0",
- .daifmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBP_CFP,
- .cpu_dai = {
- .name = "fsib-dai",
- },
- .codec_dai = {
- .name = "da7210-hifi",
- },
-};
-
-static struct platform_device fsi_da7210_device = {
- .name = "asoc-simple-card",
- .dev = {
- .platform_data = &fsi_da7210_info,
- .coherent_dma_mask = DMA_BIT_MASK(32),
- .dma_mask = &fsi_da7210_device.dev.coherent_dma_mask,
- },
-};
-
-
-/* IrDA */
-static struct resource irda_resources[] = {
- [0] = {
- .name = "IrDA",
- .start = 0xA45D0000,
- .end = 0xA45D0049,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x480),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device irda_device = {
- .name = "sh_sir",
- .num_resources = ARRAY_SIZE(irda_resources),
- .resource = irda_resources,
-};
-
-#include <media/i2c/ak881x.h>
-#include <media/drv-intf/sh_vou.h>
-
-static struct ak881x_pdata ak881x_pdata = {
- .flags = AK881X_IF_MODE_SLAVE,
-};
-
-static struct i2c_board_info ak8813 = {
- I2C_BOARD_INFO("ak8813", 0x20),
- .platform_data = &ak881x_pdata,
-};
-
-static struct sh_vou_pdata sh_vou_pdata = {
- .bus_fmt = SH_VOU_BUS_8BIT,
- .flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW,
- .board_info = &ak8813,
- .i2c_adap = 0,
-};
-
-static struct resource sh_vou_resources[] = {
- [0] = {
- .start = 0xfe960000,
- .end = 0xfe962043,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x8e0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device vou_device = {
- .name = "sh-vou",
- .id = -1,
- .num_resources = ARRAY_SIZE(sh_vou_resources),
- .resource = sh_vou_resources,
- .dev = {
- .platform_data = &sh_vou_pdata,
- },
-};
-
-#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
-/* SH_MMCIF */
-static struct resource sh_mmcif_resources[] = {
- [0] = {
- .name = "SH_MMCIF",
- .start = 0xA4CA0000,
- .end = 0xA4CA00FF,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- /* MMC2I */
- .start = evt2irq(0x5a0),
- .flags = IORESOURCE_IRQ,
- },
- [2] = {
- /* MMC3I */
- .start = evt2irq(0x5c0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct sh_mmcif_plat_data sh_mmcif_plat = {
- .sup_pclk = 0, /* SH7724: Max Pclk/2 */
- .caps = MMC_CAP_4_BIT_DATA |
- MMC_CAP_8_BIT_DATA |
- MMC_CAP_NEEDS_POLL,
- .ocr = MMC_VDD_32_33 | MMC_VDD_33_34,
-};
-
-static struct platform_device sh_mmcif_device = {
- .name = "sh_mmcif",
- .id = 0,
- .dev = {
- .platform_data = &sh_mmcif_plat,
- },
- .num_resources = ARRAY_SIZE(sh_mmcif_resources),
- .resource = sh_mmcif_resources,
-};
-#endif
-
-static struct platform_device *ecovec_ceu_devices[] __initdata = {
- &ceu0_device,
- &ceu1_device,
-};
-
-static struct platform_device *ecovec_devices[] __initdata = {
- &heartbeat_device,
- &nor_flash_device,
- &sh_eth_device,
- &usb0_host_device,
- &usb1_common_device,
- &usbhs_device,
- &lcdc_device,
- &keysc_device,
- &cn12_power,
-#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
- &sdhi0_power,
- &sdhi0_device,
-#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
- &sdhi1_device,
-#endif
-#else
- &msiof0_device,
-#endif
- &fsi_device,
- &fsi_da7210_device,
- &irda_device,
- &vou_device,
-#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
- &sh_mmcif_device,
-#endif
-};
-
-#ifdef CONFIG_I2C
-#define EEPROM_ADDR 0x50
-static u8 mac_read(struct i2c_adapter *a, u8 command)
-{
- struct i2c_msg msg[2];
- u8 buf;
- int ret;
-
- msg[0].addr = EEPROM_ADDR;
- msg[0].flags = 0;
- msg[0].len = 1;
- msg[0].buf = &command;
-
- msg[1].addr = EEPROM_ADDR;
- msg[1].flags = I2C_M_RD;
- msg[1].len = 1;
- msg[1].buf = &buf;
-
- ret = i2c_transfer(a, msg, 2);
- if (ret < 0) {
- printk(KERN_ERR "error %d\n", ret);
- buf = 0xff;
- }
-
- return buf;
-}
-
-static void __init sh_eth_init(struct sh_eth_plat_data *pd)
-{
- struct i2c_adapter *a = i2c_get_adapter(1);
- int i;
-
- if (!a) {
- pr_err("can not get I2C 1\n");
- return;
- }
-
- /* read MAC address from EEPROM */
- for (i = 0; i < sizeof(pd->mac_addr); i++) {
- pd->mac_addr[i] = mac_read(a, 0x10 + i);
- msleep(10);
- }
-
- i2c_put_adapter(a);
-}
-#else
-static void __init sh_eth_init(struct sh_eth_plat_data *pd)
-{
- pr_err("unable to read sh_eth MAC address\n");
-}
-#endif
-
-#define PORT_HIZA 0xA4050158
-#define IODRIVEA 0xA405018A
-
-extern char ecovec24_sdram_enter_start;
-extern char ecovec24_sdram_enter_end;
-extern char ecovec24_sdram_leave_start;
-extern char ecovec24_sdram_leave_end;
-
-static int __init arch_setup(void)
-{
- struct clk *clk;
- bool cn12_enabled = false;
-
- /* register board specific self-refresh code */
- sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
- SUSP_SH_RSTANDBY,
- &ecovec24_sdram_enter_start,
- &ecovec24_sdram_enter_end,
- &ecovec24_sdram_leave_start,
- &ecovec24_sdram_leave_end);
-
- /* enable STATUS0, STATUS2 and PDSTATUS */
- gpio_request(GPIO_FN_STATUS0, NULL);
- gpio_request(GPIO_FN_STATUS2, NULL);
- gpio_request(GPIO_FN_PDSTATUS, NULL);
-
- /* enable SCIFA0 */
- gpio_request(GPIO_FN_SCIF0_TXD, NULL);
- gpio_request(GPIO_FN_SCIF0_RXD, NULL);
-
- /* enable debug LED */
- gpio_request(GPIO_PTG0, NULL);
- gpio_request(GPIO_PTG1, NULL);
- gpio_request(GPIO_PTG2, NULL);
- gpio_request(GPIO_PTG3, NULL);
- gpio_direction_output(GPIO_PTG0, 0);
- gpio_direction_output(GPIO_PTG1, 0);
- gpio_direction_output(GPIO_PTG2, 0);
- gpio_direction_output(GPIO_PTG3, 0);
- __raw_writew((__raw_readw(PORT_HIZA) & ~(0x1 << 1)) , PORT_HIZA);
-
- /* enable SH-Eth */
- gpio_request(GPIO_PTA1, NULL);
- gpio_direction_output(GPIO_PTA1, 1);
- mdelay(20);
-
- gpio_request(GPIO_FN_RMII_RXD0, NULL);
- gpio_request(GPIO_FN_RMII_RXD1, NULL);
- gpio_request(GPIO_FN_RMII_TXD0, NULL);
- gpio_request(GPIO_FN_RMII_TXD1, NULL);
- gpio_request(GPIO_FN_RMII_REF_CLK, NULL);
- gpio_request(GPIO_FN_RMII_TX_EN, NULL);
- gpio_request(GPIO_FN_RMII_RX_ER, NULL);
- gpio_request(GPIO_FN_RMII_CRS_DV, NULL);
- gpio_request(GPIO_FN_MDIO, NULL);
- gpio_request(GPIO_FN_MDC, NULL);
- gpio_request(GPIO_FN_LNKSTA, NULL);
-
- /* enable USB */
- __raw_writew(0x0000, 0xA4D80000);
- __raw_writew(0x0000, 0xA4D90000);
- gpio_request(GPIO_PTB3, NULL);
- gpio_request(GPIO_PTB4, NULL);
- gpio_request(GPIO_PTB5, NULL);
- gpio_direction_input(GPIO_PTB3);
- gpio_direction_output(GPIO_PTB4, 0);
- gpio_direction_output(GPIO_PTB5, 0);
- __raw_writew(0x0600, 0xa40501d4);
- __raw_writew(0x0600, 0xa4050192);
-
- if (gpio_get_value(GPIO_PTB3)) {
- printk(KERN_INFO "USB1 function is selected\n");
- usb1_common_device.name = "r8a66597_udc";
- } else {
- printk(KERN_INFO "USB1 host is selected\n");
- usb1_common_device.name = "r8a66597_hcd";
- }
-
- /* enable LCDC */
- gpio_request(GPIO_FN_LCDD23, NULL);
- gpio_request(GPIO_FN_LCDD22, NULL);
- gpio_request(GPIO_FN_LCDD21, NULL);
- gpio_request(GPIO_FN_LCDD20, NULL);
- gpio_request(GPIO_FN_LCDD19, NULL);
- gpio_request(GPIO_FN_LCDD18, NULL);
- gpio_request(GPIO_FN_LCDD17, NULL);
- gpio_request(GPIO_FN_LCDD16, NULL);
- gpio_request(GPIO_FN_LCDD15, NULL);
- gpio_request(GPIO_FN_LCDD14, NULL);
- gpio_request(GPIO_FN_LCDD13, NULL);
- gpio_request(GPIO_FN_LCDD12, NULL);
- gpio_request(GPIO_FN_LCDD11, NULL);
- gpio_request(GPIO_FN_LCDD10, NULL);
- gpio_request(GPIO_FN_LCDD9, NULL);
- gpio_request(GPIO_FN_LCDD8, NULL);
- gpio_request(GPIO_FN_LCDD7, NULL);
- gpio_request(GPIO_FN_LCDD6, NULL);
- gpio_request(GPIO_FN_LCDD5, NULL);
- gpio_request(GPIO_FN_LCDD4, NULL);
- gpio_request(GPIO_FN_LCDD3, NULL);
- gpio_request(GPIO_FN_LCDD2, NULL);
- gpio_request(GPIO_FN_LCDD1, NULL);
- gpio_request(GPIO_FN_LCDD0, NULL);
- gpio_request(GPIO_FN_LCDDISP, NULL);
- gpio_request(GPIO_FN_LCDHSYN, NULL);
- gpio_request(GPIO_FN_LCDDCK, NULL);
- gpio_request(GPIO_FN_LCDVSYN, NULL);
- gpio_request(GPIO_FN_LCDDON, NULL);
- gpio_request(GPIO_FN_LCDLCLK, NULL);
- __raw_writew((__raw_readw(PORT_HIZA) & ~0x0001), PORT_HIZA);
-
- gpio_request(GPIO_PTE6, NULL);
- gpio_request(GPIO_PTU1, NULL);
- gpio_request(GPIO_PTA2, NULL);
- gpio_direction_input(GPIO_PTE6);
- gpio_direction_output(GPIO_PTU1, 0);
- gpio_direction_output(GPIO_PTA2, 0);
-
- /* I/O buffer drive ability is high */
- __raw_writew((__raw_readw(IODRIVEA) & ~0x00c0) | 0x0080 , IODRIVEA);
-
- if (gpio_get_value(GPIO_PTE6)) {
- /* DVI */
- lcdc_info.clock_source = LCDC_CLK_EXTERNAL;
- lcdc_info.ch[0].clock_divider = 1;
- lcdc_info.ch[0].lcd_modes = ecovec_dvi_modes;
- lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_dvi_modes);
-
- /* No backlight */
- gpio_backlight_data.fbdev = NULL;
-
- gpio_set_value(GPIO_PTA2, 1);
- gpio_set_value(GPIO_PTU1, 1);
- } else {
- /* Panel */
- lcdc_info.clock_source = LCDC_CLK_PERIPHERAL;
- lcdc_info.ch[0].clock_divider = 2;
- lcdc_info.ch[0].lcd_modes = ecovec_lcd_modes;
- lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_lcd_modes);
-
- /* FIXME
- *
- * LCDDON control is needed for Panel,
- * but current sh_mobile_lcdc driver doesn't control it.
- * It is temporary correspondence
- */
- gpio_request(GPIO_PTF4, NULL);
- gpio_direction_output(GPIO_PTF4, 1);
-
- /* enable TouchScreen */
- i2c_register_board_info(0, &ts_i2c_clients, 1);
- irq_set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
- }
-
- /* enable CEU0 */
- gpio_request(GPIO_FN_VIO0_D15, NULL);
- gpio_request(GPIO_FN_VIO0_D14, NULL);
- gpio_request(GPIO_FN_VIO0_D13, NULL);
- gpio_request(GPIO_FN_VIO0_D12, NULL);
- gpio_request(GPIO_FN_VIO0_D11, NULL);
- gpio_request(GPIO_FN_VIO0_D10, NULL);
- gpio_request(GPIO_FN_VIO0_D9, NULL);
- gpio_request(GPIO_FN_VIO0_D8, NULL);
- gpio_request(GPIO_FN_VIO0_D7, NULL);
- gpio_request(GPIO_FN_VIO0_D6, NULL);
- gpio_request(GPIO_FN_VIO0_D5, NULL);
- gpio_request(GPIO_FN_VIO0_D4, NULL);
- gpio_request(GPIO_FN_VIO0_D3, NULL);
- gpio_request(GPIO_FN_VIO0_D2, NULL);
- gpio_request(GPIO_FN_VIO0_D1, NULL);
- gpio_request(GPIO_FN_VIO0_D0, NULL);
- gpio_request(GPIO_FN_VIO0_VD, NULL);
- gpio_request(GPIO_FN_VIO0_CLK, NULL);
- gpio_request(GPIO_FN_VIO0_FLD, NULL);
- gpio_request(GPIO_FN_VIO0_HD, NULL);
-
- /* enable CEU1 */
- gpio_request(GPIO_FN_VIO1_D7, NULL);
- gpio_request(GPIO_FN_VIO1_D6, NULL);
- gpio_request(GPIO_FN_VIO1_D5, NULL);
- gpio_request(GPIO_FN_VIO1_D4, NULL);
- gpio_request(GPIO_FN_VIO1_D3, NULL);
- gpio_request(GPIO_FN_VIO1_D2, NULL);
- gpio_request(GPIO_FN_VIO1_D1, NULL);
- gpio_request(GPIO_FN_VIO1_D0, NULL);
- gpio_request(GPIO_FN_VIO1_FLD, NULL);
- gpio_request(GPIO_FN_VIO1_HD, NULL);
- gpio_request(GPIO_FN_VIO1_VD, NULL);
- gpio_request(GPIO_FN_VIO1_CLK, NULL);
-
- /* enable KEYSC */
- gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
- gpio_request(GPIO_FN_KEYOUT4_IN6, NULL);
- gpio_request(GPIO_FN_KEYOUT3, NULL);
- gpio_request(GPIO_FN_KEYOUT2, NULL);
- gpio_request(GPIO_FN_KEYOUT1, NULL);
- gpio_request(GPIO_FN_KEYOUT0, NULL);
- gpio_request(GPIO_FN_KEYIN0, NULL);
-
- /* enable user debug switch */
- gpio_request(GPIO_PTR0, NULL);
- gpio_request(GPIO_PTR4, NULL);
- gpio_request(GPIO_PTR5, NULL);
- gpio_request(GPIO_PTR6, NULL);
- gpio_direction_input(GPIO_PTR0);
- gpio_direction_input(GPIO_PTR4);
- gpio_direction_input(GPIO_PTR5);
- gpio_direction_input(GPIO_PTR6);
-
- /* SD-card slot CN11 */
-#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
- /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */
- gpio_request(GPIO_FN_SDHI0WP, NULL);
- gpio_request(GPIO_FN_SDHI0CMD, NULL);
- gpio_request(GPIO_FN_SDHI0CLK, NULL);
- gpio_request(GPIO_FN_SDHI0D3, NULL);
- gpio_request(GPIO_FN_SDHI0D2, NULL);
- gpio_request(GPIO_FN_SDHI0D1, NULL);
- gpio_request(GPIO_FN_SDHI0D0, NULL);
-#else
- /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */
- gpio_request(GPIO_FN_MSIOF0_TXD, NULL);
- gpio_request(GPIO_FN_MSIOF0_RXD, NULL);
- gpio_request(GPIO_FN_MSIOF0_TSCK, NULL);
- gpio_request(GPIO_PTB6, NULL); /* 3.3V power control */
- gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */
-
- gpiod_add_lookup_table(&mmc_spi_gpio_table);
- gpiod_add_lookup_table(&msiof_gpio_table);
- spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
-#endif
-
- /* MMC/SD-card slot CN12 */
-#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
- /* enable MMCIF (needs DS2.6,7 set to OFF,ON) */
- gpio_request(GPIO_FN_MMC_D7, NULL);
- gpio_request(GPIO_FN_MMC_D6, NULL);
- gpio_request(GPIO_FN_MMC_D5, NULL);
- gpio_request(GPIO_FN_MMC_D4, NULL);
- gpio_request(GPIO_FN_MMC_D3, NULL);
- gpio_request(GPIO_FN_MMC_D2, NULL);
- gpio_request(GPIO_FN_MMC_D1, NULL);
- gpio_request(GPIO_FN_MMC_D0, NULL);
- gpio_request(GPIO_FN_MMC_CLK, NULL);
- gpio_request(GPIO_FN_MMC_CMD, NULL);
-
- cn12_enabled = true;
-#elif defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
- /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */
- gpio_request(GPIO_FN_SDHI1WP, NULL);
- gpio_request(GPIO_FN_SDHI1CMD, NULL);
- gpio_request(GPIO_FN_SDHI1CLK, NULL);
- gpio_request(GPIO_FN_SDHI1D3, NULL);
- gpio_request(GPIO_FN_SDHI1D2, NULL);
- gpio_request(GPIO_FN_SDHI1D1, NULL);
- gpio_request(GPIO_FN_SDHI1D0, NULL);
-
- cn12_enabled = true;
-#endif
-
- if (cn12_enabled)
- /* I/O buffer drive ability is high for CN12 */
- __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000,
- IODRIVEA);
-
- /* enable FSI */
- gpio_request(GPIO_FN_FSIMCKB, NULL);
- gpio_request(GPIO_FN_FSIIBSD, NULL);
- gpio_request(GPIO_FN_FSIOBSD, NULL);
- gpio_request(GPIO_FN_FSIIBBCK, NULL);
- gpio_request(GPIO_FN_FSIIBLRCK, NULL);
- gpio_request(GPIO_FN_FSIOBBCK, NULL);
- gpio_request(GPIO_FN_FSIOBLRCK, NULL);
- gpio_request(GPIO_FN_CLKAUDIOBO, NULL);
-
- /* set SPU2 clock to 83.4 MHz */
- clk = clk_get(NULL, "spu_clk");
- if (!IS_ERR(clk)) {
- clk_set_rate(clk, clk_round_rate(clk, 83333333));
- clk_put(clk);
- }
-
- /* change parent of FSI B */
- clk = clk_get(NULL, "fsib_clk");
- if (!IS_ERR(clk)) {
- /* 48kHz dummy clock was used to make sure 1/1 divide */
- clk_set_rate(&sh7724_fsimckb_clk, 48000);
- clk_set_parent(clk, &sh7724_fsimckb_clk);
- clk_set_rate(clk, 48000);
- clk_put(clk);
- }
-
- gpio_request(GPIO_PTU0, NULL);
- gpio_direction_output(GPIO_PTU0, 0);
- mdelay(20);
-
- /* enable motion sensor */
- gpio_request(GPIO_FN_INTC_IRQ1, NULL);
- gpio_direction_input(GPIO_FN_INTC_IRQ1);
-
- /* set VPU clock to 166 MHz */
- clk = clk_get(NULL, "vpu_clk");
- if (!IS_ERR(clk)) {
- clk_set_rate(clk, clk_round_rate(clk, 166000000));
- clk_put(clk);
- }
-
- /* enable IrDA */
- gpio_request(GPIO_FN_IRDA_OUT, NULL);
- gpio_request(GPIO_FN_IRDA_IN, NULL);
- gpio_request(GPIO_PTU5, NULL);
- gpio_direction_output(GPIO_PTU5, 0);
-
- /* Register gpio lookup tables for cameras and video decoder */
- gpiod_add_lookup_table(&tw9910_gpios);
- gpiod_add_lookup_table(&mt9t112_0_gpios);
- gpiod_add_lookup_table(&mt9t112_1_gpios);
-
- /* enable I2C device */
- i2c_register_board_info(0, i2c0_devices,
- ARRAY_SIZE(i2c0_devices));
-
- i2c_register_board_info(1, i2c1_devices,
- ARRAY_SIZE(i2c1_devices));
-
-#if defined(CONFIG_VIDEO_SH_VOU) || defined(CONFIG_VIDEO_SH_VOU_MODULE)
- /* VOU */
- gpio_request(GPIO_FN_DV_D15, NULL);
- gpio_request(GPIO_FN_DV_D14, NULL);
- gpio_request(GPIO_FN_DV_D13, NULL);
- gpio_request(GPIO_FN_DV_D12, NULL);
- gpio_request(GPIO_FN_DV_D11, NULL);
- gpio_request(GPIO_FN_DV_D10, NULL);
- gpio_request(GPIO_FN_DV_D9, NULL);
- gpio_request(GPIO_FN_DV_D8, NULL);
- gpio_request(GPIO_FN_DV_CLKI, NULL);
- gpio_request(GPIO_FN_DV_CLK, NULL);
- gpio_request(GPIO_FN_DV_VSYNC, NULL);
- gpio_request(GPIO_FN_DV_HSYNC, NULL);
-
- /* AK8813 power / reset sequence */
- gpio_request(GPIO_PTG4, NULL);
- gpio_request(GPIO_PTU3, NULL);
- /* Reset */
- gpio_direction_output(GPIO_PTG4, 0);
- /* Power down */
- gpio_direction_output(GPIO_PTU3, 1);
-
- udelay(10);
-
- /* Power up, reset */
- gpio_set_value(GPIO_PTU3, 0);
-
- udelay(10);
-
- /* Remove reset */
- gpio_set_value(GPIO_PTG4, 1);
-#endif
-
- /* Initialize CEU platform devices separately to map memory first */
- device_initialize(&ecovec_ceu_devices[0]->dev);
- dma_declare_coherent_memory(&ecovec_ceu_devices[0]->dev,
- ceu0_dma_membase, ceu0_dma_membase,
- ceu0_dma_membase +
- CEU_BUFFER_MEMORY_SIZE - 1);
- platform_device_add(ecovec_ceu_devices[0]);
-
- device_initialize(&ecovec_ceu_devices[1]->dev);
- dma_declare_coherent_memory(&ecovec_ceu_devices[1]->dev,
- ceu1_dma_membase, ceu1_dma_membase,
- ceu1_dma_membase +
- CEU_BUFFER_MEMORY_SIZE - 1);
- platform_device_add(ecovec_ceu_devices[1]);
-
- gpiod_add_lookup_table(&cn12_power_gpiod_table);
-#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
- gpiod_add_lookup_table(&sdhi0_power_gpiod_table);
- gpiod_add_lookup_table(&sdhi0_gpio_table);
-#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
- gpiod_add_lookup_table(&sdhi1_gpio_table);
-#endif
-#endif
-
- gpiod_add_lookup_table(&gpio_backlight_lookup);
- gpio_backlight_device = platform_device_register_full(
- &gpio_backlight_device_info);
- if (IS_ERR(gpio_backlight_device))
- return PTR_ERR(gpio_backlight_device);
-
- return platform_add_devices(ecovec_devices,
- ARRAY_SIZE(ecovec_devices));
-}
-arch_initcall(arch_setup);
-
-static int __init devices_setup(void)
-{
- sh_eth_init(&sh_eth_plat);
- return 0;
-}
-device_initcall(devices_setup);
-
-/* Reserve a portion of memory for CEU 0 and CEU 1 buffers */
-static void __init ecovec_mv_mem_reserve(void)
-{
- phys_addr_t phys;
- phys_addr_t size = CEU_BUFFER_MEMORY_SIZE;
-
- phys = memblock_phys_alloc(size, PAGE_SIZE);
- if (!phys)
- panic("Failed to allocate CEU0 memory\n");
-
- memblock_phys_free(phys, size);
- memblock_remove(phys, size);
- ceu0_dma_membase = phys;
-
- phys = memblock_phys_alloc(size, PAGE_SIZE);
- if (!phys)
- panic("Failed to allocate CEU1 memory\n");
-
- memblock_phys_free(phys, size);
- memblock_remove(phys, size);
- ceu1_dma_membase = phys;
-}
-
-static struct sh_machine_vector mv_ecovec __initmv = {
- .mv_name = "R0P7724 (EcoVec)",
- .mv_mem_reserve = ecovec_mv_mem_reserve,
-};
diff --git a/arch/sh/boards/mach-highlander/Kconfig b/arch/sh/boards/mach-highlander/Kconfig
deleted file mode 100644
index b0abd03cac4e57..00000000000000
--- a/arch/sh/boards/mach-highlander/Kconfig
+++ /dev/null
@@ -1,26 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-if SH_HIGHLANDER
-
-choice
- prompt "Highlander options"
- default SH_R7780MP
-
-config SH_R7780RP
- bool "R7780RP-1 board support"
- depends on CPU_SUBTYPE_SH7780
-
-config SH_R7780MP
- bool "R7780MP board support"
- depends on CPU_SUBTYPE_SH7780
- help
- Selecting this option will enable support for the mass-production
- version of the R7780RP. If in doubt, say Y.
-
-config SH_R7785RP
- bool "R7785RP board support"
- depends on CPU_SUBTYPE_SH7785
- select GPIOLIB
-
-endchoice
-
-endif
diff --git a/arch/sh/boards/mach-highlander/Makefile b/arch/sh/boards/mach-highlander/Makefile
deleted file mode 100644
index 880ed68138b00f..00000000000000
--- a/arch/sh/boards/mach-highlander/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the Highlander specific parts of the kernel
-#
-obj-y := setup.o
-obj-$(CONFIG_SH_R7780RP) += irq-r7780rp.o
-obj-$(CONFIG_SH_R7780MP) += irq-r7780mp.o
-obj-$(CONFIG_SH_R7785RP) += irq-r7785rp.o pinmux-r7785rp.o
-
-ifneq ($(CONFIG_SH_R7785RP),y)
-obj-$(CONFIG_PUSH_SWITCH) += psw.o
-endif
diff --git a/arch/sh/boards/mach-highlander/irq-r7780mp.c b/arch/sh/boards/mach-highlander/irq-r7780mp.c
deleted file mode 100644
index f46637377b6a18..00000000000000
--- a/arch/sh/boards/mach-highlander/irq-r7780mp.c
+++ /dev/null
@@ -1,71 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Renesas Solutions Highlander R7780MP Support.
- *
- * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2006 Paul Mundt
- * Copyright (C) 2007 Magnus Damm
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <mach/highlander.h>
-
-enum {
- UNUSED = 0,
-
- /* board specific interrupt sources */
- CF, /* Compact Flash */
- TP, /* Touch panel */
- SCIF1, /* FPGA SCIF1 */
- SCIF0, /* FPGA SCIF0 */
- SMBUS, /* SMBUS */
- RTC, /* RTC Alarm */
- AX88796, /* Ethernet controller */
- PSW, /* Push Switch */
-
- /* external bus connector */
- EXT1, EXT2, EXT4, EXT5, EXT6,
-};
-
-static struct intc_vect vectors[] __initdata = {
- INTC_IRQ(CF, IRQ_CF),
- INTC_IRQ(TP, IRQ_TP),
- INTC_IRQ(SCIF1, IRQ_SCIF1),
- INTC_IRQ(SCIF0, IRQ_SCIF0),
- INTC_IRQ(SMBUS, IRQ_SMBUS),
- INTC_IRQ(RTC, IRQ_RTC),
- INTC_IRQ(AX88796, IRQ_AX88796),
- INTC_IRQ(PSW, IRQ_PSW),
-
- INTC_IRQ(EXT1, IRQ_EXT1), INTC_IRQ(EXT2, IRQ_EXT2),
- INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
- INTC_IRQ(EXT6, IRQ_EXT6),
-};
-
-static struct intc_mask_reg mask_registers[] __initdata = {
- { 0xa4000000, 0, 16, /* IRLMSK */
- { SCIF0, SCIF1, RTC, 0, CF, 0, TP, SMBUS,
- 0, EXT6, EXT5, EXT4, EXT2, EXT1, PSW, AX88796 } },
-};
-
-static unsigned char irl2irq[HL_NR_IRL] __initdata = {
- 0, IRQ_CF, IRQ_TP, IRQ_SCIF1,
- IRQ_SCIF0, IRQ_SMBUS, IRQ_RTC, IRQ_EXT6,
- IRQ_EXT5, IRQ_EXT4, IRQ_EXT2, IRQ_EXT1,
- 0, IRQ_AX88796, IRQ_PSW,
-};
-
-static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors,
- NULL, mask_registers, NULL, NULL);
-
-unsigned char * __init highlander_plat_irq_setup(void)
-{
- if ((__raw_readw(0xa4000700) & 0xf000) == 0x2000) {
- printk(KERN_INFO "Using r7780mp interrupt controller.\n");
- register_intc_controller(&intc_desc);
- return irl2irq;
- }
-
- return NULL;
-}
diff --git a/arch/sh/boards/mach-highlander/irq-r7780rp.c b/arch/sh/boards/mach-highlander/irq-r7780rp.c
deleted file mode 100644
index c61177e8724ba7..00000000000000
--- a/arch/sh/boards/mach-highlander/irq-r7780rp.c
+++ /dev/null
@@ -1,64 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Renesas Solutions Highlander R7780RP-1 Support.
- *
- * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2006 Paul Mundt
- * Copyright (C) 2008 Magnus Damm
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <mach/highlander.h>
-
-enum {
- UNUSED = 0,
-
- /* board specific interrupt sources */
-
- AX88796, /* Ethernet controller */
- PSW, /* Push Switch */
- CF, /* Compact Flash */
-
- PCI_A,
- PCI_B,
- PCI_C,
- PCI_D,
-};
-
-static struct intc_vect vectors[] __initdata = {
- INTC_IRQ(PCI_A, 65), /* dirty: overwrite cpu vectors for pci */
- INTC_IRQ(PCI_B, 66),
- INTC_IRQ(PCI_C, 67),
- INTC_IRQ(PCI_D, 68),
- INTC_IRQ(CF, IRQ_CF),
- INTC_IRQ(PSW, IRQ_PSW),
- INTC_IRQ(AX88796, IRQ_AX88796),
-};
-
-static struct intc_mask_reg mask_registers[] __initdata = {
- { 0xa5000000, 0, 16, /* IRLMSK */
- { PCI_A, PCI_B, PCI_C, PCI_D, CF, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, PSW, AX88796 } },
-};
-
-static unsigned char irl2irq[HL_NR_IRL] __initdata = {
- 65, 66, 67, 68,
- IRQ_CF, 0, 0, 0,
- 0, 0, 0, 0,
- IRQ_AX88796, IRQ_PSW
-};
-
-static DECLARE_INTC_DESC(intc_desc, "r7780rp", vectors,
- NULL, mask_registers, NULL, NULL);
-
-unsigned char * __init highlander_plat_irq_setup(void)
-{
- if (__raw_readw(0xa5000600)) {
- printk(KERN_INFO "Using r7780rp interrupt controller.\n");
- register_intc_controller(&intc_desc);
- return irl2irq;
- }
-
- return NULL;
-}
diff --git a/arch/sh/boards/mach-highlander/irq-r7785rp.c b/arch/sh/boards/mach-highlander/irq-r7785rp.c
deleted file mode 100644
index 0ebebbed0d63fb..00000000000000
--- a/arch/sh/boards/mach-highlander/irq-r7785rp.c
+++ /dev/null
@@ -1,83 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Renesas Solutions Highlander R7785RP Support.
- *
- * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2006 - 2008 Paul Mundt
- * Copyright (C) 2007 Magnus Damm
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <mach/highlander.h>
-
-enum {
- UNUSED = 0,
-
- /* FPGA specific interrupt sources */
- CF, /* Compact Flash */
- SMBUS, /* SMBUS */
- TP, /* Touch panel */
- RTC, /* RTC Alarm */
- TH_ALERT, /* Temperature sensor */
- AX88796, /* Ethernet controller */
-
- /* external bus connector */
- EXT0, EXT1, EXT2, EXT3, EXT4, EXT5, EXT6, EXT7,
-};
-
-static struct intc_vect vectors[] __initdata = {
- INTC_IRQ(CF, IRQ_CF),
- INTC_IRQ(SMBUS, IRQ_SMBUS),
- INTC_IRQ(TP, IRQ_TP),
- INTC_IRQ(RTC, IRQ_RTC),
- INTC_IRQ(TH_ALERT, IRQ_TH_ALERT),
-
- INTC_IRQ(EXT0, IRQ_EXT0), INTC_IRQ(EXT1, IRQ_EXT1),
- INTC_IRQ(EXT2, IRQ_EXT2), INTC_IRQ(EXT3, IRQ_EXT3),
-
- INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
- INTC_IRQ(EXT6, IRQ_EXT6), INTC_IRQ(EXT7, IRQ_EXT7),
-
- INTC_IRQ(AX88796, IRQ_AX88796),
-};
-
-static struct intc_mask_reg mask_registers[] __initdata = {
- { 0xa4000010, 0, 16, /* IRLMCR1 */
- { 0, 0, 0, 0, CF, AX88796, SMBUS, TP,
- RTC, 0, TH_ALERT, 0, 0, 0, 0, 0 } },
- { 0xa4000012, 0, 16, /* IRLMCR2 */
- { 0, 0, 0, 0, 0, 0, 0, 0,
- EXT7, EXT6, EXT5, EXT4, EXT3, EXT2, EXT1, EXT0 } },
-};
-
-static unsigned char irl2irq[HL_NR_IRL] __initdata = {
- 0, IRQ_CF, IRQ_EXT4, IRQ_EXT5,
- IRQ_EXT6, IRQ_EXT7, IRQ_SMBUS, IRQ_TP,
- IRQ_RTC, IRQ_TH_ALERT, IRQ_AX88796, IRQ_EXT0,
- IRQ_EXT1, IRQ_EXT2, IRQ_EXT3,
-};
-
-static DECLARE_INTC_DESC(intc_desc, "r7785rp", vectors,
- NULL, mask_registers, NULL, NULL);
-
-unsigned char * __init highlander_plat_irq_setup(void)
-{
- if ((__raw_readw(0xa4000158) & 0xf000) != 0x1000)
- return NULL;
-
- printk(KERN_INFO "Using r7785rp interrupt controller.\n");
-
- __raw_writew(0x0000, PA_IRLSSR1); /* FPGA IRLSSR1(CF_CD clear) */
-
- /* Setup the FPGA IRL */
- __raw_writew(0x0000, PA_IRLPRA); /* FPGA IRLA */
- __raw_writew(0xe598, PA_IRLPRB); /* FPGA IRLB */
- __raw_writew(0x7060, PA_IRLPRC); /* FPGA IRLC */
- __raw_writew(0x0000, PA_IRLPRD); /* FPGA IRLD */
- __raw_writew(0x4321, PA_IRLPRE); /* FPGA IRLE */
- __raw_writew(0xdcba, PA_IRLPRF); /* FPGA IRLF */
-
- register_intc_controller(&intc_desc);
- return irl2irq;
-}
diff --git a/arch/sh/boards/mach-highlander/pinmux-r7785rp.c b/arch/sh/boards/mach-highlander/pinmux-r7785rp.c
deleted file mode 100644
index 703179faf652b2..00000000000000
--- a/arch/sh/boards/mach-highlander/pinmux-r7785rp.c
+++ /dev/null
@@ -1,17 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright (C) 2008 Paul Mundt
- */
-#include <linux/init.h>
-#include <linux/gpio.h>
-#include <cpu/sh7785.h>
-
-void __init highlander_plat_pinmux_setup(void)
-{
- /* SCIF0 */
- gpio_request(GPIO_FN_SCIF0_CTS, NULL);
- gpio_request(GPIO_FN_SCIF0_RTS, NULL);
- gpio_request(GPIO_FN_SCIF0_SCK, NULL);
- gpio_request(GPIO_FN_SCIF0_RXD, NULL);
- gpio_request(GPIO_FN_SCIF0_TXD, NULL);
-}
diff --git a/arch/sh/boards/mach-highlander/psw.c b/arch/sh/boards/mach-highlander/psw.c
deleted file mode 100644
index d445c54f74e440..00000000000000
--- a/arch/sh/boards/mach-highlander/psw.c
+++ /dev/null
@@ -1,119 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/renesas/r7780rp/psw.c
- *
- * push switch support for RDBRP-1/RDBREVRP-1 debug boards.
- *
- * Copyright (C) 2006 Paul Mundt
- */
-#include <linux/io.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <mach/highlander.h>
-#include <asm/push-switch.h>
-
-static irqreturn_t psw_irq_handler(int irq, void *arg)
-{
- struct platform_device *pdev = arg;
- struct push_switch *psw = platform_get_drvdata(pdev);
- struct push_switch_platform_info *psw_info = pdev->dev.platform_data;
- unsigned int l, mask;
- int ret = 0;
-
- l = __raw_readw(PA_DBSW);
-
- /* Nothing to do if there's no state change */
- if (psw->state) {
- ret = 1;
- goto out;
- }
-
- mask = l & 0x70;
- /* Figure out who raised it */
- if (mask & (1 << psw_info->bit)) {
- psw->state = !!(mask & (1 << psw_info->bit));
- if (psw->state) /* debounce */
- mod_timer(&psw->debounce, jiffies + 50);
-
- ret = 1;
- }
-
-out:
- /* Clear the switch IRQs */
- l |= (0x7 << 12);
- __raw_writew(l, PA_DBSW);
-
- return IRQ_RETVAL(ret);
-}
-
-static struct resource psw_resources[] = {
- [0] = {
- .start = IRQ_PSW,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct push_switch_platform_info s2_platform_data = {
- .name = "s2",
- .bit = 6,
- .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
- IRQF_SHARED,
- .irq_handler = psw_irq_handler,
-};
-
-static struct platform_device s2_switch_device = {
- .name = "push-switch",
- .id = 0,
- .num_resources = ARRAY_SIZE(psw_resources),
- .resource = psw_resources,
- .dev = {
- .platform_data = &s2_platform_data,
- },
-};
-
-static struct push_switch_platform_info s3_platform_data = {
- .name = "s3",
- .bit = 5,
- .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
- IRQF_SHARED,
- .irq_handler = psw_irq_handler,
-};
-
-static struct platform_device s3_switch_device = {
- .name = "push-switch",
- .id = 1,
- .num_resources = ARRAY_SIZE(psw_resources),
- .resource = psw_resources,
- .dev = {
- .platform_data = &s3_platform_data,
- },
-};
-
-static struct push_switch_platform_info s4_platform_data = {
- .name = "s4",
- .bit = 4,
- .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
- IRQF_SHARED,
- .irq_handler = psw_irq_handler,
-};
-
-static struct platform_device s4_switch_device = {
- .name = "push-switch",
- .id = 2,
- .num_resources = ARRAY_SIZE(psw_resources),
- .resource = psw_resources,
- .dev = {
- .platform_data = &s4_platform_data,
- },
-};
-
-static struct platform_device *psw_devices[] = {
- &s2_switch_device, &s3_switch_device, &s4_switch_device,
-};
-
-static int __init psw_init(void)
-{
- return platform_add_devices(psw_devices, ARRAY_SIZE(psw_devices));
-}
-module_init(psw_init);
diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
deleted file mode 100644
index 533393d779c2b9..00000000000000
--- a/arch/sh/boards/mach-highlander/setup.c
+++ /dev/null
@@ -1,416 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/renesas/r7780rp/setup.c
- *
- * Renesas Solutions Highlander Support.
- *
- * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2005 - 2008 Paul Mundt
- *
- * This contains support for the R7780RP-1, R7780MP, and R7785RP
- * Highlander modules.
- */
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/types.h>
-#include <linux/mtd/physmap.h>
-#include <linux/i2c.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/usb/r8a66597.h>
-#include <linux/usb/m66592.h>
-#include <linux/clkdev.h>
-#include <net/ax88796.h>
-#include <asm/machvec.h>
-#include <mach/highlander.h>
-#include <asm/clock.h>
-#include <asm/heartbeat.h>
-#include <asm/io.h>
-#include <asm/io_trapped.h>
-
-static struct r8a66597_platdata r8a66597_data = {
- .xtal = R8A66597_PLATDATA_XTAL_12MHZ,
- .vif = 1,
-};
-
-static struct resource r8a66597_usb_host_resources[] = {
- [0] = {
- .start = 0xA4200000,
- .end = 0xA42000FF,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = IRQ_EXT1, /* irq number */
- .end = IRQ_EXT1,
- .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
- },
-};
-
-static struct platform_device r8a66597_usb_host_device = {
- .name = "r8a66597_hcd",
- .id = -1,
- .dev = {
- .dma_mask = NULL, /* don't use dma */
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &r8a66597_data,
- },
- .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources),
- .resource = r8a66597_usb_host_resources,
-};
-
-static struct m66592_platdata usbf_platdata = {
- .xtal = M66592_PLATDATA_XTAL_24MHZ,
- .vif = 1,
-};
-
-static struct resource m66592_usb_peripheral_resources[] = {
- [0] = {
- .name = "m66592_udc",
- .start = 0xb0000000,
- .end = 0xb00000FF,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .name = "m66592_udc",
- .start = IRQ_EXT4, /* irq number */
- .end = IRQ_EXT4,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device m66592_usb_peripheral_device = {
- .name = "m66592_udc",
- .id = -1,
- .dev = {
- .dma_mask = NULL, /* don't use dma */
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &usbf_platdata,
- },
- .num_resources = ARRAY_SIZE(m66592_usb_peripheral_resources),
- .resource = m66592_usb_peripheral_resources,
-};
-
-static struct resource cf_ide_resources[] = {
- [0] = {
- .start = PA_AREA5_IO + 0x1000,
- .end = PA_AREA5_IO + 0x1000 + 0x08 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = PA_AREA5_IO + 0x80c,
- .end = PA_AREA5_IO + 0x80c + 0x16 - 1,
- .flags = IORESOURCE_MEM,
- },
- [2] = {
- .start = IRQ_CF,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct pata_platform_info pata_info = {
- .ioport_shift = 1,
-};
-
-static struct platform_device cf_ide_device = {
- .name = "pata_platform",
- .id = -1,
- .num_resources = ARRAY_SIZE(cf_ide_resources),
- .resource = cf_ide_resources,
- .dev = {
- .platform_data = &pata_info,
- },
-};
-
-static struct resource heartbeat_resources[] = {
- [0] = {
- .start = PA_OBLED,
- .end = PA_OBLED,
- .flags = IORESOURCE_MEM,
- },
-};
-
-#ifndef CONFIG_SH_R7785RP
-static unsigned char heartbeat_bit_pos[] = { 2, 1, 0, 3, 6, 5, 4, 7 };
-
-static struct heartbeat_data heartbeat_data = {
- .bit_pos = heartbeat_bit_pos,
- .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
-};
-#endif
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
-
- /* R7785RP has a slightly more sensible FPGA.. */
-#ifndef CONFIG_SH_R7785RP
- .dev = {
- .platform_data = &heartbeat_data,
- },
-#endif
- .num_resources = ARRAY_SIZE(heartbeat_resources),
- .resource = heartbeat_resources,
-};
-
-static struct ax_plat_data ax88796_platdata = {
- .flags = AXFLG_HAS_93CX6,
- .wordlength = 2,
- .dcr_val = 0x1,
- .rcr_val = 0x40,
-};
-
-static struct resource ax88796_resources[] = {
- {
-#ifdef CONFIG_SH_R7780RP
- .start = 0xa5800400,
- .end = 0xa5800400 + (0x20 * 0x2) - 1,
-#else
- .start = 0xa4100400,
- .end = 0xa4100400 + (0x20 * 0x2) - 1,
-#endif
- .flags = IORESOURCE_MEM,
- },
- {
- .start = IRQ_AX88796,
- .end = IRQ_AX88796,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device ax88796_device = {
- .name = "ax88796",
- .id = 0,
-
- .dev = {
- .platform_data = &ax88796_platdata,
- },
-
- .num_resources = ARRAY_SIZE(ax88796_resources),
- .resource = ax88796_resources,
-};
-
-static struct mtd_partition nor_flash_partitions[] = {
- {
- .name = "loader",
- .offset = 0x00000000,
- .size = 512 * 1024,
- },
- {
- .name = "bootenv",
- .offset = MTDPART_OFS_APPEND,
- .size = 512 * 1024,
- },
- {
- .name = "kernel",
- .offset = MTDPART_OFS_APPEND,
- .size = 4 * 1024 * 1024,
- },
- {
- .name = "data",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data nor_flash_data = {
- .width = 4,
- .parts = nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(nor_flash_partitions),
-};
-
-/* This config is flash board for mass production. */
-static struct resource nor_flash_resources[] = {
- [0] = {
- .start = PA_NORFLASH_ADDR,
- .end = PA_NORFLASH_ADDR + PA_NORFLASH_SIZE - 1,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device nor_flash_device = {
- .name = "physmap-flash",
- .dev = {
- .platform_data = &nor_flash_data,
- },
- .num_resources = ARRAY_SIZE(nor_flash_resources),
- .resource = nor_flash_resources,
-};
-
-static struct resource smbus_resources[] = {
- [0] = {
- .start = PA_SMCR,
- .end = PA_SMCR + 0x100 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = IRQ_SMBUS,
- .end = IRQ_SMBUS,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device smbus_device = {
- .name = "i2c-highlander",
- .id = 0,
- .num_resources = ARRAY_SIZE(smbus_resources),
- .resource = smbus_resources,
-};
-
-static struct i2c_board_info __initdata highlander_i2c_devices[] = {
- {
- I2C_BOARD_INFO("r2025sd", 0x32),
- },
-};
-
-static struct platform_device *r7780rp_devices[] __initdata = {
- &r8a66597_usb_host_device,
- &m66592_usb_peripheral_device,
- &heartbeat_device,
- &smbus_device,
- &nor_flash_device,
-#ifndef CONFIG_SH_R7780RP
- &ax88796_device,
-#endif
-};
-
-/*
- * The CF is connected using a 16-bit bus where 8-bit operations are
- * unsupported. The linux ata driver is however using 8-bit operations, so
- * insert a trapped io filter to convert 8-bit operations into 16-bit.
- */
-static struct trapped_io cf_trapped_io = {
- .resource = cf_ide_resources,
- .num_resources = 2,
- .minimum_bus_width = 16,
-};
-
-static int __init r7780rp_devices_setup(void)
-{
- int ret = 0;
-
-#ifndef CONFIG_SH_R7780RP
- if (register_trapped_io(&cf_trapped_io) == 0)
- ret |= platform_device_register(&cf_ide_device);
-#endif
-
- ret |= platform_add_devices(r7780rp_devices,
- ARRAY_SIZE(r7780rp_devices));
-
- ret |= i2c_register_board_info(0, highlander_i2c_devices,
- ARRAY_SIZE(highlander_i2c_devices));
-
- return ret;
-}
-device_initcall(r7780rp_devices_setup);
-
-/*
- * Platform specific clocks
- */
-static int ivdr_clk_enable(struct clk *clk)
-{
- __raw_writew(__raw_readw(PA_IVDRCTL) | (1 << IVDR_CK_ON), PA_IVDRCTL);
- return 0;
-}
-
-static void ivdr_clk_disable(struct clk *clk)
-{
- __raw_writew(__raw_readw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL);
-}
-
-static struct sh_clk_ops ivdr_clk_ops = {
- .enable = ivdr_clk_enable,
- .disable = ivdr_clk_disable,
-};
-
-static struct clk ivdr_clk = {
- .ops = &ivdr_clk_ops,
-};
-
-static struct clk *r7780rp_clocks[] = {
- &ivdr_clk,
-};
-
-static struct clk_lookup lookups[] = {
- /* main clocks */
- CLKDEV_CON_ID("ivdr_clk", &ivdr_clk),
-};
-
-static void r7780rp_power_off(void)
-{
- if (mach_is_r7780mp() || mach_is_r7785rp())
- __raw_writew(0x0001, PA_POFF);
-}
-
-/*
- * Initialize the board
- */
-static void __init highlander_setup(char **cmdline_p)
-{
- u16 ver = __raw_readw(PA_VERREG);
- int i;
-
- printk(KERN_INFO "Renesas Solutions Highlander %s support.\n",
- mach_is_r7780rp() ? "R7780RP-1" :
- mach_is_r7780mp() ? "R7780MP" :
- "R7785RP");
-
- printk(KERN_INFO "Board version: %d (revision %d), "
- "FPGA version: %d (revision %d)\n",
- (ver >> 12) & 0xf, (ver >> 8) & 0xf,
- (ver >> 4) & 0xf, ver & 0xf);
-
- highlander_plat_pinmux_setup();
-
- /*
- * Enable the important clocks right away..
- */
- for (i = 0; i < ARRAY_SIZE(r7780rp_clocks); i++) {
- struct clk *clk = r7780rp_clocks[i];
-
- clk_register(clk);
- clk_enable(clk);
- }
-
- clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
- __raw_writew(0x0000, PA_OBLED); /* Clear LED. */
-
- if (mach_is_r7780rp())
- __raw_writew(0x0001, PA_SDPOW); /* SD Power ON */
-
- __raw_writew(__raw_readw(PA_IVDRCTL) | 0x01, PA_IVDRCTL); /* Si13112 */
-
- pm_power_off = r7780rp_power_off;
-}
-
-static unsigned char irl2irq[HL_NR_IRL];
-
-static int highlander_irq_demux(int irq)
-{
- if (irq >= HL_NR_IRL || irq < 0 || !irl2irq[irq])
- return irq;
-
- return irl2irq[irq];
-}
-
-static void __init highlander_init_irq(void)
-{
- unsigned char *ucp = highlander_plat_irq_setup();
-
- if (ucp) {
- plat_irq_setup_pins(IRQ_MODE_IRL3210);
- memcpy(irl2irq, ucp, HL_NR_IRL);
- }
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_highlander __initmv = {
- .mv_name = "Highlander",
- .mv_setup = highlander_setup,
- .mv_init_irq = highlander_init_irq,
- .mv_irq_demux = highlander_irq_demux,
-};
diff --git a/arch/sh/boards/mach-hp6xx/Makefile b/arch/sh/boards/mach-hp6xx/Makefile
deleted file mode 100644
index 4b0fe29e5612eb..00000000000000
--- a/arch/sh/boards/mach-hp6xx/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the HP6xx specific parts of the kernel
-#
-
-obj-y := setup.o
-obj-$(CONFIG_PM) += pm.o pm_wakeup.o
-obj-$(CONFIG_APM_EMULATION) += hp6xx_apm.o
diff --git a/arch/sh/boards/mach-hp6xx/hp6xx_apm.c b/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
deleted file mode 100644
index e5c4c7d34139ea..00000000000000
--- a/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
+++ /dev/null
@@ -1,109 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * bios-less APM driver for hp680
- *
- * Copyright 2005 (c) Andriy Skulysh <[email protected]>
- * Copyright 2008 (c) Kristoffer Ericson <[email protected]>
- */
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/apm-emulation.h>
-#include <linux/io.h>
-#include <asm/adc.h>
-#include <mach/hp6xx.h>
-
-/* percentage values */
-#define APM_CRITICAL 10
-#define APM_LOW 30
-
-/* resonably sane values */
-#define HP680_BATTERY_MAX 898
-#define HP680_BATTERY_MIN 486
-#define HP680_BATTERY_AC_ON 1023
-
-#define MODNAME "hp6x0_apm"
-
-#define PGDR 0xa400012c
-
-static void hp6x0_apm_get_power_status(struct apm_power_info *info)
-{
- int battery, backup, charging, percentage;
- u8 pgdr;
-
- battery = adc_single(ADC_CHANNEL_BATTERY);
- backup = adc_single(ADC_CHANNEL_BACKUP);
- charging = adc_single(ADC_CHANNEL_CHARGE);
-
- percentage = 100 * (battery - HP680_BATTERY_MIN) /
- (HP680_BATTERY_MAX - HP680_BATTERY_MIN);
-
- /* % of full battery */
- info->battery_life = percentage;
-
- /* We want our estimates in minutes */
- info->units = 0;
-
- /* Extremely(!!) rough estimate, we will replace this with a datalist later on */
- info->time = (2 * battery);
-
- info->ac_line_status = (battery > HP680_BATTERY_AC_ON) ?
- APM_AC_ONLINE : APM_AC_OFFLINE;
-
- pgdr = __raw_readb(PGDR);
- if (pgdr & PGDR_MAIN_BATTERY_OUT) {
- info->battery_status = APM_BATTERY_STATUS_NOT_PRESENT;
- info->battery_flag = 0x80;
- } else if (charging < 8) {
- info->battery_status = APM_BATTERY_STATUS_CHARGING;
- info->battery_flag = 0x08;
- info->ac_line_status = 0x01;
- } else if (percentage <= APM_CRITICAL) {
- info->battery_status = APM_BATTERY_STATUS_CRITICAL;
- info->battery_flag = 0x04;
- } else if (percentage <= APM_LOW) {
- info->battery_status = APM_BATTERY_STATUS_LOW;
- info->battery_flag = 0x02;
- } else {
- info->battery_status = APM_BATTERY_STATUS_HIGH;
- info->battery_flag = 0x01;
- }
-}
-
-static irqreturn_t hp6x0_apm_interrupt(int irq, void *dev)
-{
- if (!APM_DISABLED)
- apm_queue_event(APM_USER_SUSPEND);
-
- return IRQ_HANDLED;
-}
-
-static int __init hp6x0_apm_init(void)
-{
- int ret;
-
- ret = request_irq(HP680_BTN_IRQ, hp6x0_apm_interrupt,
- 0, MODNAME, NULL);
- if (unlikely(ret < 0)) {
- printk(KERN_ERR MODNAME ": IRQ %d request failed\n",
- HP680_BTN_IRQ);
- return ret;
- }
-
- apm_get_power_status = hp6x0_apm_get_power_status;
-
- return ret;
-}
-
-static void __exit hp6x0_apm_exit(void)
-{
- free_irq(HP680_BTN_IRQ, 0);
-}
-
-module_init(hp6x0_apm_init);
-module_exit(hp6x0_apm_exit);
-
-MODULE_AUTHOR("Adriy Skulysh");
-MODULE_DESCRIPTION("hp6xx Advanced Power Management");
-MODULE_LICENSE("GPL");
diff --git a/arch/sh/boards/mach-hp6xx/pm.c b/arch/sh/boards/mach-hp6xx/pm.c
deleted file mode 100644
index fe505ec168d021..00000000000000
--- a/arch/sh/boards/mach-hp6xx/pm.c
+++ /dev/null
@@ -1,156 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * hp6x0 Power Management Routines
- *
- * Copyright (c) 2006 Andriy Skulysh <[email protected]>
- */
-#include <linux/init.h>
-#include <linux/suspend.h>
-#include <linux/errno.h>
-#include <linux/time.h>
-#include <linux/delay.h>
-#include <linux/gfp.h>
-#include <asm/io.h>
-#include <asm/hd64461.h>
-#include <asm/bl_bit.h>
-#include <mach/hp6xx.h>
-#include <cpu/dac.h>
-#include <asm/freq.h>
-#include <asm/watchdog.h>
-
-#define INTR_OFFSET 0x600
-
-#define STBCR 0xffffff82
-#define STBCR2 0xffffff88
-
-#define STBCR_STBY 0x80
-#define STBCR_MSTP2 0x04
-
-#define MCR 0xffffff68
-#define RTCNT 0xffffff70
-
-#define MCR_RMODE 2
-#define MCR_RFSH 4
-
-extern u8 wakeup_start;
-extern u8 wakeup_end;
-
-static void pm_enter(void)
-{
- u8 stbcr, csr;
- u16 frqcr, mcr;
- u32 vbr_new, vbr_old;
-
- set_bl_bit();
-
- /* set wdt */
- csr = sh_wdt_read_csr();
- csr &= ~WTCSR_TME;
- csr |= WTCSR_CKS_4096;
- sh_wdt_write_csr(csr);
- csr = sh_wdt_read_csr();
- sh_wdt_write_cnt(0);
-
- /* disable PLL1 */
- frqcr = __raw_readw(FRQCR);
- frqcr &= ~(FRQCR_PLLEN | FRQCR_PSTBY);
- __raw_writew(frqcr, FRQCR);
-
- /* enable standby */
- stbcr = __raw_readb(STBCR);
- __raw_writeb(stbcr | STBCR_STBY | STBCR_MSTP2, STBCR);
-
- /* set self-refresh */
- mcr = __raw_readw(MCR);
- __raw_writew(mcr & ~MCR_RFSH, MCR);
-
- /* set interrupt handler */
- asm volatile("stc vbr, %0" : "=r" (vbr_old));
- vbr_new = get_zeroed_page(GFP_ATOMIC);
- udelay(50);
- memcpy((void*)(vbr_new + INTR_OFFSET),
- &wakeup_start, &wakeup_end - &wakeup_start);
- asm volatile("ldc %0, vbr" : : "r" (vbr_new));
-
- __raw_writew(0, RTCNT);
- __raw_writew(mcr | MCR_RFSH | MCR_RMODE, MCR);
-
- cpu_sleep();
-
- asm volatile("ldc %0, vbr" : : "r" (vbr_old));
-
- free_page(vbr_new);
-
- /* enable PLL1 */
- frqcr = __raw_readw(FRQCR);
- frqcr |= FRQCR_PSTBY;
- __raw_writew(frqcr, FRQCR);
- udelay(50);
- frqcr |= FRQCR_PLLEN;
- __raw_writew(frqcr, FRQCR);
-
- __raw_writeb(stbcr, STBCR);
-
- clear_bl_bit();
-}
-
-static int hp6x0_pm_enter(suspend_state_t state)
-{
- u8 stbcr, stbcr2;
-#ifdef CONFIG_HD64461_ENABLER
- u8 scr;
- u16 hd64461_stbcr;
-#endif
-
-#ifdef CONFIG_HD64461_ENABLER
- outb(0, HD64461_PCC1CSCIER);
-
- scr = inb(HD64461_PCC1SCR);
- scr |= HD64461_PCCSCR_VCC1;
- outb(scr, HD64461_PCC1SCR);
-
- hd64461_stbcr = inw(HD64461_STBCR);
- hd64461_stbcr |= HD64461_STBCR_SPC1ST;
- outw(hd64461_stbcr, HD64461_STBCR);
-#endif
-
- __raw_writeb(0x1f, DACR);
-
- stbcr = __raw_readb(STBCR);
- __raw_writeb(0x01, STBCR);
-
- stbcr2 = __raw_readb(STBCR2);
- __raw_writeb(0x7f , STBCR2);
-
- outw(0xf07f, HD64461_SCPUCR);
-
- pm_enter();
-
- outw(0, HD64461_SCPUCR);
- __raw_writeb(stbcr, STBCR);
- __raw_writeb(stbcr2, STBCR2);
-
-#ifdef CONFIG_HD64461_ENABLER
- hd64461_stbcr = inw(HD64461_STBCR);
- hd64461_stbcr &= ~HD64461_STBCR_SPC1ST;
- outw(hd64461_stbcr, HD64461_STBCR);
-
- outb(0x4c, HD64461_PCC1CSCIER);
- outb(0x00, HD64461_PCC1CSCR);
-#endif
-
- return 0;
-}
-
-static const struct platform_suspend_ops hp6x0_pm_ops = {
- .enter = hp6x0_pm_enter,
- .valid = suspend_valid_only_mem,
-};
-
-static int __init hp6x0_pm_init(void)
-{
- suspend_set_ops(&hp6x0_pm_ops);
- return 0;
-}
-
-late_initcall(hp6x0_pm_init);
diff --git a/arch/sh/boards/mach-hp6xx/pm_wakeup.S b/arch/sh/boards/mach-hp6xx/pm_wakeup.S
deleted file mode 100644
index 0fd43301f083d0..00000000000000
--- a/arch/sh/boards/mach-hp6xx/pm_wakeup.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
- * Copyright (c) 2006 Andriy Skulysh <[email protected]>
- */
-
-#include <linux/linkage.h>
-#include <cpu/mmu_context.h>
-
-/*
- * Kernel mode register usage:
- * k0 scratch
- * k1 scratch
- * For more details, please have a look at entry.S
- */
-
-#define k0 r0
-#define k1 r1
-
-ENTRY(wakeup_start)
-! clear STBY bit
- mov #-126, k1
- and #127, k0
- mov.b k0, @k1
-! enable refresh
- mov.l 5f, k1
- mov.w 6f, k0
- mov.w k0, @k1
-! jump to handler
- mov.l 4f, k1
- jmp @k1
- nop
-
- .align 2
-4: .long handle_interrupt
-5: .long 0xffffff68
-6: .word 0x0524
-
-ENTRY(wakeup_end)
- nop
diff --git a/arch/sh/boards/mach-hp6xx/setup.c b/arch/sh/boards/mach-hp6xx/setup.c
deleted file mode 100644
index 2ceead68d7bf82..00000000000000
--- a/arch/sh/boards/mach-hp6xx/setup.c
+++ /dev/null
@@ -1,172 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/hp6xx/setup.c
- *
- * Copyright (C) 2002 Andriy Skulysh
- * Copyright (C) 2007 Kristoffer Ericson <[email protected]>
- *
- * Setup code for HP620/HP660/HP680/HP690 (internal peripherials only)
- */
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/irq.h>
-#include <linux/sh_intc.h>
-#include <sound/sh_dac_audio.h>
-#include <asm/hd64461.h>
-#include <asm/io.h>
-#include <mach/hp6xx.h>
-#include <cpu/dac.h>
-
-#define SCPCR 0xa4000116
-#define SCPDR 0xa4000136
-
-/* CF Slot */
-static struct resource cf_ide_resources[] = {
- [0] = {
- .start = 0x15000000 + 0x1f0,
- .end = 0x15000000 + 0x1f0 + 0x08 - 0x01,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 0x15000000 + 0x1fe,
- .end = 0x15000000 + 0x1fe + 0x01,
- .flags = IORESOURCE_MEM,
- },
- [2] = {
- .start = evt2irq(0xba0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device cf_ide_device = {
- .name = "pata_platform",
- .id = -1,
- .num_resources = ARRAY_SIZE(cf_ide_resources),
- .resource = cf_ide_resources,
-};
-
-static struct platform_device jornadakbd_device = {
- .name = "jornada680_kbd",
- .id = -1,
-};
-
-static void dac_audio_start(struct dac_audio_pdata *pdata)
-{
- u16 v;
- u8 v8;
-
- /* HP Jornada 680/690 speaker on */
- v = inw(HD64461_GPADR);
- v &= ~HD64461_GPADR_SPEAKER;
- outw(v, HD64461_GPADR);
-
- /* HP Palmtop 620lx/660lx speaker on */
- v8 = inb(PKDR);
- v8 &= ~PKDR_SPEAKER;
- outb(v8, PKDR);
-
- sh_dac_enable(pdata->channel);
-}
-
-static void dac_audio_stop(struct dac_audio_pdata *pdata)
-{
- u16 v;
- u8 v8;
-
- /* HP Jornada 680/690 speaker off */
- v = inw(HD64461_GPADR);
- v |= HD64461_GPADR_SPEAKER;
- outw(v, HD64461_GPADR);
-
- /* HP Palmtop 620lx/660lx speaker off */
- v8 = inb(PKDR);
- v8 |= PKDR_SPEAKER;
- outb(v8, PKDR);
-
- sh_dac_output(0, pdata->channel);
- sh_dac_disable(pdata->channel);
-}
-
-static struct dac_audio_pdata dac_audio_platform_data = {
- .buffer_size = 64000,
- .channel = 1,
- .start = dac_audio_start,
- .stop = dac_audio_stop,
-};
-
-static struct platform_device dac_audio_device = {
- .name = "dac_audio",
- .id = -1,
- .dev = {
- .platform_data = &dac_audio_platform_data,
- }
-
-};
-
-static struct platform_device *hp6xx_devices[] __initdata = {
- &cf_ide_device,
- &jornadakbd_device,
- &dac_audio_device,
-};
-
-static void __init hp6xx_init_irq(void)
-{
- /* Gets touchscreen and powerbutton IRQ working */
- plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-static int __init hp6xx_devices_setup(void)
-{
- return platform_add_devices(hp6xx_devices, ARRAY_SIZE(hp6xx_devices));
-}
-
-static void __init hp6xx_setup(char **cmdline_p)
-{
- u8 v8;
- u16 v;
-
- v = inw(HD64461_STBCR);
- v |= HD64461_STBCR_SURTST | HD64461_STBCR_SIRST |
- HD64461_STBCR_STM1ST | HD64461_STBCR_STM0ST |
- HD64461_STBCR_SAFEST | HD64461_STBCR_SPC0ST |
- HD64461_STBCR_SMIAST | HD64461_STBCR_SAFECKE_OST|
- HD64461_STBCR_SAFECKE_IST;
-#ifndef CONFIG_HD64461_ENABLER
- v |= HD64461_STBCR_SPC1ST;
-#endif
- outw(v, HD64461_STBCR);
- v = inw(HD64461_GPADR);
- v |= HD64461_GPADR_SPEAKER | HD64461_GPADR_PCMCIA0;
- outw(v, HD64461_GPADR);
-
- outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC0GCR);
-
-#ifndef CONFIG_HD64461_ENABLER
- outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC1GCR);
-#endif
-
- sh_dac_output(0, DAC_SPEAKER_VOLUME);
- sh_dac_disable(DAC_SPEAKER_VOLUME);
- v8 = __raw_readb(DACR);
- v8 &= ~DACR_DAE;
- __raw_writeb(v8,DACR);
-
- v8 = __raw_readb(SCPDR);
- v8 |= SCPDR_TS_SCAN_X | SCPDR_TS_SCAN_Y;
- v8 &= ~SCPDR_TS_SCAN_ENABLE;
- __raw_writeb(v8, SCPDR);
-
- v = __raw_readw(SCPCR);
- v &= ~SCPCR_TS_MASK;
- v |= SCPCR_TS_ENABLE;
- __raw_writew(v, SCPCR);
-}
-device_initcall(hp6xx_devices_setup);
-
-static struct sh_machine_vector mv_hp6xx __initmv = {
- .mv_name = "hp6xx",
- .mv_setup = hp6xx_setup,
- /* Enable IRQ0 -> IRQ3 in IRQ_MODE */
- .mv_init_irq = hp6xx_init_irq,
-};
diff --git a/arch/sh/boards/mach-kfr2r09/Makefile b/arch/sh/boards/mach-kfr2r09/Makefile
deleted file mode 100644
index 4a4a35ad7ba07c..00000000000000
--- a/arch/sh/boards/mach-kfr2r09/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-y := setup.o sdram.o
-ifneq ($(CONFIG_FB_SH_MOBILE_LCDC),)
-obj-y += lcd_wqvga.o
-endif
diff --git a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
deleted file mode 100644
index f6bbac106d1328..00000000000000
--- a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
+++ /dev/null
@@ -1,275 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * KFR2R09 LCD panel support
- *
- * Copyright (C) 2009 Magnus Damm
- *
- * Register settings based on the out-of-tree t33fb.c driver
- * Copyright (C) 2008 Lineo Solutions, Inc.
- */
-
-#include <linux/delay.h>
-#include <linux/err.h>
-#include <linux/fb.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/gpio.h>
-#include <video/sh_mobile_lcdc.h>
-#include <mach/kfr2r09.h>
-#include <cpu/sh7724.h>
-
-/* The on-board LCD module is a Hitachi TX07D34VM0AAA. This module is made
- * up of a 240x400 LCD hooked up to a R61517 driver IC. The driver IC is
- * communicating with the main port of the LCDC using an 18-bit SYS interface.
- *
- * The device code for this LCD module is 0x01221517.
- */
-
-static const unsigned char data_frame_if[] = {
- 0x02, /* WEMODE: 1=cont, 0=one-shot */
- 0x00, 0x00,
- 0x00, /* EPF, DFM */
- 0x02, /* RIM[1] : 1 (18bpp) */
-};
-
-static const unsigned char data_panel[] = {
- 0x0b,
- 0x63, /* 400 lines */
- 0x04, 0x00, 0x00, 0x04, 0x11, 0x00, 0x00,
-};
-
-static const unsigned char data_timing[] = {
- 0x00, 0x00, 0x13, 0x08, 0x08,
-};
-
-static const unsigned char data_timing_src[] = {
- 0x11, 0x01, 0x00, 0x01,
-};
-
-static const unsigned char data_gamma[] = {
- 0x01, 0x02, 0x08, 0x23, 0x03, 0x0c, 0x00, 0x06, 0x00, 0x00,
- 0x01, 0x00, 0x0c, 0x23, 0x03, 0x08, 0x02, 0x06, 0x00, 0x00,
-};
-
-static const unsigned char data_power[] = {
- 0x07, 0xc5, 0xdc, 0x02, 0x33, 0x0a,
-};
-
-static unsigned long read_reg(void *sohandle,
- struct sh_mobile_lcdc_sys_bus_ops *so)
-{
- return so->read_data(sohandle);
-}
-
-static void write_reg(void *sohandle,
- struct sh_mobile_lcdc_sys_bus_ops *so,
- int i, unsigned long v)
-{
- if (i)
- so->write_data(sohandle, v); /* PTH4/LCDRS High [param, 17:0] */
- else
- so->write_index(sohandle, v); /* PTH4/LCDRS Low [cmd, 7:0] */
-}
-
-static void write_data(void *sohandle,
- struct sh_mobile_lcdc_sys_bus_ops *so,
- unsigned char const *data, int no_data)
-{
- int i;
-
- for (i = 0; i < no_data; i++)
- write_reg(sohandle, so, 1, data[i]);
-}
-
-static unsigned long read_device_code(void *sohandle,
- struct sh_mobile_lcdc_sys_bus_ops *so)
-{
- unsigned long device_code;
-
- /* access protect OFF */
- write_reg(sohandle, so, 0, 0xb0);
- write_reg(sohandle, so, 1, 0x00);
-
- /* deep standby OFF */
- write_reg(sohandle, so, 0, 0xb1);
- write_reg(sohandle, so, 1, 0x00);
-
- /* device code command */
- write_reg(sohandle, so, 0, 0xbf);
- mdelay(50);
-
- /* dummy read */
- read_reg(sohandle, so);
-
- /* read device code */
- device_code = ((read_reg(sohandle, so) & 0xff) << 24);
- device_code |= ((read_reg(sohandle, so) & 0xff) << 16);
- device_code |= ((read_reg(sohandle, so) & 0xff) << 8);
- device_code |= (read_reg(sohandle, so) & 0xff);
-
- return device_code;
-}
-
-static void write_memory_start(void *sohandle,
- struct sh_mobile_lcdc_sys_bus_ops *so)
-{
- write_reg(sohandle, so, 0, 0x2c);
-}
-
-static void clear_memory(void *sohandle,
- struct sh_mobile_lcdc_sys_bus_ops *so)
-{
- int i;
-
- /* write start */
- write_memory_start(sohandle, so);
-
- /* paint it black */
- for (i = 0; i < (240 * 400); i++)
- write_reg(sohandle, so, 1, 0x00);
-}
-
-static void display_on(void *sohandle,
- struct sh_mobile_lcdc_sys_bus_ops *so)
-{
- /* access protect off */
- write_reg(sohandle, so, 0, 0xb0);
- write_reg(sohandle, so, 1, 0x00);
-
- /* exit deep standby mode */
- write_reg(sohandle, so, 0, 0xb1);
- write_reg(sohandle, so, 1, 0x00);
-
- /* frame memory I/F */
- write_reg(sohandle, so, 0, 0xb3);
- write_data(sohandle, so, data_frame_if, ARRAY_SIZE(data_frame_if));
-
- /* display mode and frame memory write mode */
- write_reg(sohandle, so, 0, 0xb4);
- write_reg(sohandle, so, 1, 0x00); /* DBI, internal clock */
-
- /* panel */
- write_reg(sohandle, so, 0, 0xc0);
- write_data(sohandle, so, data_panel, ARRAY_SIZE(data_panel));
-
- /* timing (normal) */
- write_reg(sohandle, so, 0, 0xc1);
- write_data(sohandle, so, data_timing, ARRAY_SIZE(data_timing));
-
- /* timing (partial) */
- write_reg(sohandle, so, 0, 0xc2);
- write_data(sohandle, so, data_timing, ARRAY_SIZE(data_timing));
-
- /* timing (idle) */
- write_reg(sohandle, so, 0, 0xc3);
- write_data(sohandle, so, data_timing, ARRAY_SIZE(data_timing));
-
- /* timing (source/VCOM/gate driving) */
- write_reg(sohandle, so, 0, 0xc4);
- write_data(sohandle, so, data_timing_src, ARRAY_SIZE(data_timing_src));
-
- /* gamma (red) */
- write_reg(sohandle, so, 0, 0xc8);
- write_data(sohandle, so, data_gamma, ARRAY_SIZE(data_gamma));
-
- /* gamma (green) */
- write_reg(sohandle, so, 0, 0xc9);
- write_data(sohandle, so, data_gamma, ARRAY_SIZE(data_gamma));
-
- /* gamma (blue) */
- write_reg(sohandle, so, 0, 0xca);
- write_data(sohandle, so, data_gamma, ARRAY_SIZE(data_gamma));
-
- /* power (common) */
- write_reg(sohandle, so, 0, 0xd0);
- write_data(sohandle, so, data_power, ARRAY_SIZE(data_power));
-
- /* VCOM */
- write_reg(sohandle, so, 0, 0xd1);
- write_reg(sohandle, so, 1, 0x00);
- write_reg(sohandle, so, 1, 0x0f);
- write_reg(sohandle, so, 1, 0x02);
-
- /* power (normal) */
- write_reg(sohandle, so, 0, 0xd2);
- write_reg(sohandle, so, 1, 0x63);
- write_reg(sohandle, so, 1, 0x24);
-
- /* power (partial) */
- write_reg(sohandle, so, 0, 0xd3);
- write_reg(sohandle, so, 1, 0x63);
- write_reg(sohandle, so, 1, 0x24);
-
- /* power (idle) */
- write_reg(sohandle, so, 0, 0xd4);
- write_reg(sohandle, so, 1, 0x63);
- write_reg(sohandle, so, 1, 0x24);
-
- write_reg(sohandle, so, 0, 0xd8);
- write_reg(sohandle, so, 1, 0x77);
- write_reg(sohandle, so, 1, 0x77);
-
- /* TE signal */
- write_reg(sohandle, so, 0, 0x35);
- write_reg(sohandle, so, 1, 0x00);
-
- /* TE signal line */
- write_reg(sohandle, so, 0, 0x44);
- write_reg(sohandle, so, 1, 0x00);
- write_reg(sohandle, so, 1, 0x00);
-
- /* column address */
- write_reg(sohandle, so, 0, 0x2a);
- write_reg(sohandle, so, 1, 0x00);
- write_reg(sohandle, so, 1, 0x00);
- write_reg(sohandle, so, 1, 0x00);
- write_reg(sohandle, so, 1, 0xef);
-
- /* page address */
- write_reg(sohandle, so, 0, 0x2b);
- write_reg(sohandle, so, 1, 0x00);
- write_reg(sohandle, so, 1, 0x00);
- write_reg(sohandle, so, 1, 0x01);
- write_reg(sohandle, so, 1, 0x8f);
-
- /* exit sleep mode */
- write_reg(sohandle, so, 0, 0x11);
-
- mdelay(120);
-
- /* clear vram */
- clear_memory(sohandle, so);
-
- /* display ON */
- write_reg(sohandle, so, 0, 0x29);
- mdelay(1);
-
- write_memory_start(sohandle, so);
-}
-
-int kfr2r09_lcd_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
-{
- /* power on */
- gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */
- gpio_set_value(GPIO_PTE4, 0); /* LCD_RST/ -> L */
- gpio_set_value(GPIO_PTF4, 1); /* PROTECT/ -> H */
- udelay(1100);
- gpio_set_value(GPIO_PTE4, 1); /* LCD_RST/ -> H */
- udelay(10);
- gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */
- mdelay(20);
-
- if (read_device_code(sohandle, so) != 0x01221517)
- return -ENODEV;
-
- pr_info("KFR2R09 WQVGA LCD Module detected.\n");
-
- display_on(sohandle, so);
- return 0;
-}
-
-void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
-{
- write_memory_start(sohandle, so);
-}
diff --git a/arch/sh/boards/mach-kfr2r09/sdram.S b/arch/sh/boards/mach-kfr2r09/sdram.S
deleted file mode 100644
index f1b8985cb9223c..00000000000000
--- a/arch/sh/boards/mach-kfr2r09/sdram.S
+++ /dev/null
@@ -1,77 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
- * KFR2R09 sdram self/auto-refresh setup code
- *
- * Copyright (C) 2009 Magnus Damm
- */
-
-#include <linux/sys.h>
-#include <linux/errno.h>
-#include <linux/linkage.h>
-#include <asm/asm-offsets.h>
-#include <asm/suspend.h>
-#include <asm/romimage-macros.h>
-
-/* code to enter and leave self-refresh. must be self-contained.
- * this code will be copied to on-chip memory and executed from there.
- */
- .balign 4
-ENTRY(kfr2r09_sdram_enter_start)
-
- /* DBSC: put memory in self-refresh mode */
-
- ED 0xFD000010, 0x00000000 /* DBEN */
- ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
- ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
-
- rts
- nop
-
-ENTRY(kfr2r09_sdram_enter_end)
-
- .balign 4
-ENTRY(kfr2r09_sdram_leave_start)
-
- /* DBSC: put memory in auto-refresh mode */
-
- mov.l @(SH_SLEEP_MODE, r5), r0
- tst #SUSP_SH_RSTANDBY, r0
- bf resume_rstandby
-
- ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
- WAIT 1
- ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000010, 0x00000001 /* DBEN */
- ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
-
- rts
- nop
-
-resume_rstandby:
-
- /* DBSC: re-initialize and put in auto-refresh */
-
- ED 0xFD000108, 0x40000301 /* DBPDCNT0 */
- ED 0xFD000020, 0x011B0002 /* DBCONF */
- ED 0xFD000030, 0x03060E02 /* DBTR0 */
- ED 0xFD000034, 0x01020102 /* DBTR1 */
- ED 0xFD000038, 0x01090406 /* DBTR2 */
- ED 0xFD000008, 0x00000004 /* DBKIND */
- ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
- ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
- ED 0xFD000018, 0x00000001 /* DBCKECNT */
- WAIT 1
- ED 0xFD000010, 0x00000001 /* DBEN */
- ED 0xFD000044, 0x000004AF /* DBRFPDN1 */
- ED 0xFD000048, 0x20CF0037 /* DBRFPDN2 */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000108, 0x40000300 /* DBPDCNT0 */
- ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
-
- rts
- nop
-
-ENTRY(kfr2r09_sdram_leave_end)
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
deleted file mode 100644
index 20f4db778ed6ae..00000000000000
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ /dev/null
@@ -1,649 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * KFR2R09 board support code
- *
- * Copyright (C) 2009 Magnus Damm
- */
-
-#include <asm/clock.h>
-#include <asm/io.h>
-#include <asm/machvec.h>
-#include <asm/suspend.h>
-
-#include <cpu/sh7724.h>
-
-#include <linux/clkdev.h>
-#include <linux/delay.h>
-#include <linux/gpio.h>
-#include <linux/gpio/machine.h>
-#include <linux/i2c.h>
-#include <linux/init.h>
-#include <linux/input.h>
-#include <linux/input/sh_keysc.h>
-#include <linux/interrupt.h>
-#include <linux/memblock.h>
-#include <linux/mfd/tmio.h>
-#include <linux/mmc/host.h>
-#include <linux/mtd/physmap.h>
-#include <linux/platform_data/lv5207lp.h>
-#include <linux/platform_device.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/sh_intc.h>
-#include <linux/usb/r8a66597.h>
-#include <linux/videodev2.h>
-#include <linux/dma-map-ops.h>
-
-#include <mach/kfr2r09.h>
-
-#include <media/drv-intf/renesas-ceu.h>
-#include <media/i2c/rj54n1cb0c.h>
-
-#include <video/sh_mobile_lcdc.h>
-
-#define CEU_BUFFER_MEMORY_SIZE (4 << 20)
-static phys_addr_t ceu_dma_membase;
-
-/* set VIO_CKO clock to 25MHz */
-#define CEU_MCLK_FREQ 25000000
-#define DRVCRB 0xA405018C
-
-static struct mtd_partition kfr2r09_nor_flash_partitions[] =
-{
- {
- .name = "boot",
- .offset = 0,
- .size = (4 * 1024 * 1024),
- .mask_flags = MTD_WRITEABLE, /* Read-only */
- },
- {
- .name = "other",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data kfr2r09_nor_flash_data = {
- .width = 2,
- .parts = kfr2r09_nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(kfr2r09_nor_flash_partitions),
-};
-
-static struct resource kfr2r09_nor_flash_resources[] = {
- [0] = {
- .name = "NOR Flash",
- .start = 0x00000000,
- .end = 0x03ffffff,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device kfr2r09_nor_flash_device = {
- .name = "physmap-flash",
- .resource = kfr2r09_nor_flash_resources,
- .num_resources = ARRAY_SIZE(kfr2r09_nor_flash_resources),
- .dev = {
- .platform_data = &kfr2r09_nor_flash_data,
- },
-};
-
-static struct resource kfr2r09_nand_flash_resources[] = {
- [0] = {
- .name = "NAND Flash",
- .start = 0x10000000,
- .end = 0x1001ffff,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device kfr2r09_nand_flash_device = {
- .name = "onenand-flash",
- .resource = kfr2r09_nand_flash_resources,
- .num_resources = ARRAY_SIZE(kfr2r09_nand_flash_resources),
-};
-
-static struct sh_keysc_info kfr2r09_sh_keysc_info = {
- .mode = SH_KEYSC_MODE_1, /* KEYOUT0->4, KEYIN0->4 */
- .scan_timing = 3,
- .delay = 10,
- .keycodes = {
- KEY_PHONE, KEY_CLEAR, KEY_MAIL, KEY_WWW, KEY_ENTER,
- KEY_1, KEY_2, KEY_3, 0, KEY_UP,
- KEY_4, KEY_5, KEY_6, 0, KEY_LEFT,
- KEY_7, KEY_8, KEY_9, KEY_PROG1, KEY_RIGHT,
- KEY_S, KEY_0, KEY_P, KEY_PROG2, KEY_DOWN,
- 0, 0, 0, 0, 0
- },
-};
-
-static struct resource kfr2r09_sh_keysc_resources[] = {
- [0] = {
- .name = "KEYSC",
- .start = 0x044b0000,
- .end = 0x044b000f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xbe0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device kfr2r09_sh_keysc_device = {
- .name = "sh_keysc",
- .id = 0, /* "keysc0" clock */
- .num_resources = ARRAY_SIZE(kfr2r09_sh_keysc_resources),
- .resource = kfr2r09_sh_keysc_resources,
- .dev = {
- .platform_data = &kfr2r09_sh_keysc_info,
- },
-};
-
-static const struct fb_videomode kfr2r09_lcdc_modes[] = {
- {
- .name = "TX07D34VM0AAA",
- .xres = 240,
- .yres = 400,
- .left_margin = 0,
- .right_margin = 16,
- .hsync_len = 8,
- .upper_margin = 0,
- .lower_margin = 1,
- .vsync_len = 1,
- .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- },
-};
-
-static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = {
- .clock_source = LCDC_CLK_BUS,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
- .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = SYS18,
- .clock_divider = 6,
- .flags = LCDC_FLAGS_DWPOL,
- .lcd_modes = kfr2r09_lcdc_modes,
- .num_modes = ARRAY_SIZE(kfr2r09_lcdc_modes),
- .panel_cfg = {
- .width = 35,
- .height = 58,
- .setup_sys = kfr2r09_lcd_setup,
- .start_transfer = kfr2r09_lcd_start,
- },
- .sys_bus_cfg = {
- .ldmt2r = 0x07010904,
- .ldmt3r = 0x14012914,
- /* set 1s delay to encourage fsync() */
- .deferred_io_msec = 1000,
- },
- }
-};
-
-static struct resource kfr2r09_sh_lcdc_resources[] = {
- [0] = {
- .name = "LCDC",
- .start = 0xfe940000, /* P4-only space */
- .end = 0xfe942fff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xf40),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device kfr2r09_sh_lcdc_device = {
- .name = "sh_mobile_lcdc_fb",
- .num_resources = ARRAY_SIZE(kfr2r09_sh_lcdc_resources),
- .resource = kfr2r09_sh_lcdc_resources,
- .dev = {
- .platform_data = &kfr2r09_sh_lcdc_info,
- },
-};
-
-static struct lv5207lp_platform_data kfr2r09_backlight_data = {
- .fbdev = &kfr2r09_sh_lcdc_device.dev,
- .def_value = 13,
- .max_value = 13,
-};
-
-static struct i2c_board_info kfr2r09_backlight_board_info = {
- I2C_BOARD_INFO("lv5207lp", 0x75),
- .platform_data = &kfr2r09_backlight_data,
-};
-
-static struct r8a66597_platdata kfr2r09_usb0_gadget_data = {
- .on_chip = 1,
-};
-
-static struct resource kfr2r09_usb0_gadget_resources[] = {
- [0] = {
- .start = 0x04d80000,
- .end = 0x04d80123,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xa20),
- .end = evt2irq(0xa20),
- .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
- },
-};
-
-static struct platform_device kfr2r09_usb0_gadget_device = {
- .name = "r8a66597_udc",
- .id = 0,
- .dev = {
- .dma_mask = NULL, /* not use dma */
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &kfr2r09_usb0_gadget_data,
- },
- .num_resources = ARRAY_SIZE(kfr2r09_usb0_gadget_resources),
- .resource = kfr2r09_usb0_gadget_resources,
-};
-
-static struct ceu_platform_data ceu_pdata = {
- .num_subdevs = 1,
- .subdevs = {
- { /* [0] = rj54n1cb0c */
- .flags = 0,
- .bus_width = 8,
- .bus_shift = 0,
- .i2c_adapter_id = 1,
- .i2c_address = 0x50,
- },
- },
-};
-
-static struct resource kfr2r09_ceu_resources[] = {
- [0] = {
- .name = "CEU",
- .start = 0xfe910000,
- .end = 0xfe91009f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x880),
- .end = evt2irq(0x880),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device kfr2r09_ceu_device = {
- .name = "renesas-ceu",
- .id = 0, /* "ceu0" clock */
- .num_resources = ARRAY_SIZE(kfr2r09_ceu_resources),
- .resource = kfr2r09_ceu_resources,
- .dev = {
- .platform_data = &ceu_pdata,
- },
-};
-
-static struct rj54n1_pdata rj54n1_priv = {
- .mclk_freq = CEU_MCLK_FREQ,
- .ioctl_high = false,
-};
-
-static struct i2c_board_info kfr2r09_i2c_camera = {
- I2C_BOARD_INFO("rj54n1cb0c", 0x50),
- .platform_data = &rj54n1_priv,
-};
-
-static struct gpiod_lookup_table rj54n1_gpios = {
- .dev_id = "1-0050",
- .table = {
- GPIO_LOOKUP("sh7724_pfc", GPIO_PTB4, "poweron",
- GPIO_ACTIVE_HIGH),
- GPIO_LOOKUP("sh7724_pfc", GPIO_PTB7, "enable",
- GPIO_ACTIVE_HIGH),
- },
-};
-
-/* Fixed 3.3V regulator to be used by SDHI0 */
-static struct regulator_consumer_supply fixed3v3_power_consumers[] =
-{
- REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
- REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
-};
-
-static struct resource kfr2r09_sh_sdhi0_resources[] = {
- [0] = {
- .name = "SDHI0",
- .start = 0x04ce0000,
- .end = 0x04ce00ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xe80),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct tmio_mmc_data sh7724_sdhi0_data = {
- .chan_priv_tx = (void *)SHDMA_SLAVE_SDHI0_TX,
- .chan_priv_rx = (void *)SHDMA_SLAVE_SDHI0_RX,
- .capabilities = MMC_CAP_SDIO_IRQ,
- .capabilities2 = MMC_CAP2_NO_WRITE_PROTECT,
-};
-
-static struct platform_device kfr2r09_sh_sdhi0_device = {
- .name = "sh_mobile_sdhi",
- .num_resources = ARRAY_SIZE(kfr2r09_sh_sdhi0_resources),
- .resource = kfr2r09_sh_sdhi0_resources,
- .dev = {
- .platform_data = &sh7724_sdhi0_data,
- },
-};
-
-static struct platform_device *kfr2r09_devices[] __initdata = {
- &kfr2r09_nor_flash_device,
- &kfr2r09_nand_flash_device,
- &kfr2r09_sh_keysc_device,
- &kfr2r09_sh_lcdc_device,
- &kfr2r09_sh_sdhi0_device,
-};
-
-#define BSC_CS0BCR 0xfec10004
-#define BSC_CS0WCR 0xfec10024
-#define BSC_CS4BCR 0xfec10010
-#define BSC_CS4WCR 0xfec10030
-#define PORT_MSELCRB 0xa4050182
-
-#ifdef CONFIG_I2C
-static int kfr2r09_usb0_gadget_i2c_setup(void)
-{
- struct i2c_adapter *a;
- struct i2c_msg msg;
- unsigned char buf[2];
- int ret;
-
- a = i2c_get_adapter(0);
- if (!a)
- return -ENODEV;
-
- /* set bit 1 (the second bit) of chip at 0x09, register 0x13 */
- buf[0] = 0x13;
- msg.addr = 0x09;
- msg.buf = buf;
- msg.len = 1;
- msg.flags = 0;
- ret = i2c_transfer(a, &msg, 1);
- if (ret != 1)
- return -ENODEV;
-
- buf[0] = 0;
- msg.addr = 0x09;
- msg.buf = buf;
- msg.len = 1;
- msg.flags = I2C_M_RD;
- ret = i2c_transfer(a, &msg, 1);
- if (ret != 1)
- return -ENODEV;
-
- buf[1] = buf[0] | (1 << 1);
- buf[0] = 0x13;
- msg.addr = 0x09;
- msg.buf = buf;
- msg.len = 2;
- msg.flags = 0;
- ret = i2c_transfer(a, &msg, 1);
- if (ret != 1)
- return -ENODEV;
-
- return 0;
-}
-
-static int kfr2r09_serial_i2c_setup(void)
-{
- struct i2c_adapter *a;
- struct i2c_msg msg;
- unsigned char buf[2];
- int ret;
-
- a = i2c_get_adapter(0);
- if (!a)
- return -ENODEV;
-
- /* set bit 6 (the 7th bit) of chip at 0x09, register 0x13 */
- buf[0] = 0x13;
- msg.addr = 0x09;
- msg.buf = buf;
- msg.len = 1;
- msg.flags = 0;
- ret = i2c_transfer(a, &msg, 1);
- if (ret != 1)
- return -ENODEV;
-
- buf[0] = 0;
- msg.addr = 0x09;
- msg.buf = buf;
- msg.len = 1;
- msg.flags = I2C_M_RD;
- ret = i2c_transfer(a, &msg, 1);
- if (ret != 1)
- return -ENODEV;
-
- buf[1] = buf[0] | (1 << 6);
- buf[0] = 0x13;
- msg.addr = 0x09;
- msg.buf = buf;
- msg.len = 2;
- msg.flags = 0;
- ret = i2c_transfer(a, &msg, 1);
- if (ret != 1)
- return -ENODEV;
-
- return 0;
-}
-#else
-static int kfr2r09_usb0_gadget_i2c_setup(void)
-{
- return -ENODEV;
-}
-
-static int kfr2r09_serial_i2c_setup(void)
-{
- return -ENODEV;
-}
-#endif
-
-static int kfr2r09_usb0_gadget_setup(void)
-{
- int plugged_in;
-
- gpio_request(GPIO_PTN4, NULL); /* USB_DET */
- gpio_direction_input(GPIO_PTN4);
- plugged_in = gpio_get_value(GPIO_PTN4);
- if (!plugged_in)
- return -ENODEV; /* no cable plugged in */
-
- if (kfr2r09_usb0_gadget_i2c_setup() != 0)
- return -ENODEV; /* unable to configure using i2c */
-
- __raw_writew((__raw_readw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);
- gpio_request(GPIO_FN_PDSTATUS, NULL); /* R-standby disables USB clock */
- gpio_request(GPIO_PTV6, NULL); /* USBCLK_ON */
- gpio_direction_output(GPIO_PTV6, 1); /* USBCLK_ON = H */
- msleep(20); /* wait 20ms to let the clock settle */
- clk_enable(clk_get(NULL, "usb0"));
- __raw_writew(0x0600, 0xa40501d4);
-
- return 0;
-}
-
-extern char kfr2r09_sdram_enter_start;
-extern char kfr2r09_sdram_enter_end;
-extern char kfr2r09_sdram_leave_start;
-extern char kfr2r09_sdram_leave_end;
-
-static int __init kfr2r09_devices_setup(void)
-{
- struct clk *camera_clk;
-
- /* register board specific self-refresh code */
- sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
- SUSP_SH_RSTANDBY,
- &kfr2r09_sdram_enter_start,
- &kfr2r09_sdram_enter_end,
- &kfr2r09_sdram_leave_start,
- &kfr2r09_sdram_leave_end);
-
- regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
- ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
-
- /* enable SCIF1 serial port for YC401 console support */
- gpio_request(GPIO_FN_SCIF1_RXD, NULL);
- gpio_request(GPIO_FN_SCIF1_TXD, NULL);
- kfr2r09_serial_i2c_setup(); /* ECONTMSK(bit6=L10ONEN) set 1 */
- gpio_request(GPIO_PTG3, NULL); /* HPON_ON */
- gpio_direction_output(GPIO_PTG3, 1); /* HPON_ON = H */
-
- /* setup NOR flash at CS0 */
- __raw_writel(0x36db0400, BSC_CS0BCR);
- __raw_writel(0x00000500, BSC_CS0WCR);
-
- /* setup NAND flash at CS4 */
- __raw_writel(0x36db0400, BSC_CS4BCR);
- __raw_writel(0x00000500, BSC_CS4WCR);
-
- /* setup KEYSC pins */
- gpio_request(GPIO_FN_KEYOUT0, NULL);
- gpio_request(GPIO_FN_KEYOUT1, NULL);
- gpio_request(GPIO_FN_KEYOUT2, NULL);
- gpio_request(GPIO_FN_KEYOUT3, NULL);
- gpio_request(GPIO_FN_KEYOUT4_IN6, NULL);
- gpio_request(GPIO_FN_KEYIN0, NULL);
- gpio_request(GPIO_FN_KEYIN1, NULL);
- gpio_request(GPIO_FN_KEYIN2, NULL);
- gpio_request(GPIO_FN_KEYIN3, NULL);
- gpio_request(GPIO_FN_KEYIN4, NULL);
- gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
-
- /* setup LCDC pins for SYS panel */
- gpio_request(GPIO_FN_LCDD17, NULL);
- gpio_request(GPIO_FN_LCDD16, NULL);
- gpio_request(GPIO_FN_LCDD15, NULL);
- gpio_request(GPIO_FN_LCDD14, NULL);
- gpio_request(GPIO_FN_LCDD13, NULL);
- gpio_request(GPIO_FN_LCDD12, NULL);
- gpio_request(GPIO_FN_LCDD11, NULL);
- gpio_request(GPIO_FN_LCDD10, NULL);
- gpio_request(GPIO_FN_LCDD9, NULL);
- gpio_request(GPIO_FN_LCDD8, NULL);
- gpio_request(GPIO_FN_LCDD7, NULL);
- gpio_request(GPIO_FN_LCDD6, NULL);
- gpio_request(GPIO_FN_LCDD5, NULL);
- gpio_request(GPIO_FN_LCDD4, NULL);
- gpio_request(GPIO_FN_LCDD3, NULL);
- gpio_request(GPIO_FN_LCDD2, NULL);
- gpio_request(GPIO_FN_LCDD1, NULL);
- gpio_request(GPIO_FN_LCDD0, NULL);
- gpio_request(GPIO_FN_LCDRS, NULL); /* LCD_RS */
- gpio_request(GPIO_FN_LCDCS, NULL); /* LCD_CS/ */
- gpio_request(GPIO_FN_LCDRD, NULL); /* LCD_RD/ */
- gpio_request(GPIO_FN_LCDWR, NULL); /* LCD_WR/ */
- gpio_request(GPIO_FN_LCDVSYN, NULL); /* LCD_VSYNC */
- gpio_request(GPIO_PTE4, NULL); /* LCD_RST/ */
- gpio_direction_output(GPIO_PTE4, 1);
- gpio_request(GPIO_PTF4, NULL); /* PROTECT/ */
- gpio_direction_output(GPIO_PTF4, 1);
- gpio_request(GPIO_PTU0, NULL); /* LEDSTDBY/ */
- gpio_direction_output(GPIO_PTU0, 1);
-
- /* setup USB function */
- if (kfr2r09_usb0_gadget_setup() == 0)
- platform_device_register(&kfr2r09_usb0_gadget_device);
-
- /* CEU */
- gpio_request(GPIO_FN_VIO_CKO, NULL);
- gpio_request(GPIO_FN_VIO0_CLK, NULL);
- gpio_request(GPIO_FN_VIO0_VD, NULL);
- gpio_request(GPIO_FN_VIO0_HD, NULL);
- gpio_request(GPIO_FN_VIO0_FLD, NULL);
- gpio_request(GPIO_FN_VIO0_D7, NULL);
- gpio_request(GPIO_FN_VIO0_D6, NULL);
- gpio_request(GPIO_FN_VIO0_D5, NULL);
- gpio_request(GPIO_FN_VIO0_D4, NULL);
- gpio_request(GPIO_FN_VIO0_D3, NULL);
- gpio_request(GPIO_FN_VIO0_D2, NULL);
- gpio_request(GPIO_FN_VIO0_D1, NULL);
- gpio_request(GPIO_FN_VIO0_D0, NULL);
-
- /* SDHI0 connected to yc304 */
- gpio_request(GPIO_FN_SDHI0CD, NULL);
- gpio_request(GPIO_FN_SDHI0D3, NULL);
- gpio_request(GPIO_FN_SDHI0D2, NULL);
- gpio_request(GPIO_FN_SDHI0D1, NULL);
- gpio_request(GPIO_FN_SDHI0D0, NULL);
- gpio_request(GPIO_FN_SDHI0CMD, NULL);
- gpio_request(GPIO_FN_SDHI0CLK, NULL);
-
- i2c_register_board_info(0, &kfr2r09_backlight_board_info, 1);
-
- /* Set camera clock frequency and register and alias for rj54n1. */
- camera_clk = clk_get(NULL, "video_clk");
- if (!IS_ERR(camera_clk)) {
- clk_set_rate(camera_clk,
- clk_round_rate(camera_clk, CEU_MCLK_FREQ));
- clk_put(camera_clk);
- }
- clk_add_alias(NULL, "1-0050", "video_clk", NULL);
-
- /* set DRVCRB
- *
- * use 1.8 V for VccQ_VIO
- * use 2.85V for VccQ_SR
- */
- __raw_writew((__raw_readw(DRVCRB) & ~0x0003) | 0x0001, DRVCRB);
-
- gpiod_add_lookup_table(&rj54n1_gpios);
-
- i2c_register_board_info(1, &kfr2r09_i2c_camera, 1);
-
- /* Initialize CEU platform device separately to map memory first */
- device_initialize(&kfr2r09_ceu_device.dev);
- dma_declare_coherent_memory(&kfr2r09_ceu_device.dev,
- ceu_dma_membase, ceu_dma_membase,
- ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1);
-
- platform_device_add(&kfr2r09_ceu_device);
-
- return platform_add_devices(kfr2r09_devices,
- ARRAY_SIZE(kfr2r09_devices));
-}
-device_initcall(kfr2r09_devices_setup);
-
-/* Return the board specific boot mode pin configuration */
-static int kfr2r09_mode_pins(void)
-{
- /* MD0=1, MD1=1, MD2=0: Clock Mode 3
- * MD3=0: 16-bit Area0 Bus Width
- * MD5=1: Little Endian
- * MD8=1: Test Mode Disabled
- */
- return MODE_PIN0 | MODE_PIN1 | MODE_PIN5 | MODE_PIN8;
-}
-
-/* Reserve a portion of memory for CEU buffers */
-static void __init kfr2r09_mv_mem_reserve(void)
-{
- phys_addr_t phys;
- phys_addr_t size = CEU_BUFFER_MEMORY_SIZE;
-
- phys = memblock_phys_alloc(size, PAGE_SIZE);
- if (!phys)
- panic("Failed to allocate CEU memory\n");
-
- memblock_phys_free(phys, size);
- memblock_remove(phys, size);
-
- ceu_dma_membase = phys;
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_kfr2r09 __initmv = {
- .mv_name = "kfr2r09",
- .mv_mode_pins = kfr2r09_mode_pins,
- .mv_mem_reserve = kfr2r09_mv_mem_reserve,
-};
diff --git a/arch/sh/boards/mach-landisk/Makefile b/arch/sh/boards/mach-landisk/Makefile
deleted file mode 100644
index 6cba041fffe0f3..00000000000000
--- a/arch/sh/boards/mach-landisk/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for I-O DATA DEVICE, INC. "LANDISK Series"
-#
-
-obj-y := setup.o irq.o psw.o gio.o
diff --git a/arch/sh/boards/mach-landisk/gio.c b/arch/sh/boards/mach-landisk/gio.c
deleted file mode 100644
index ff2200fec29a76..00000000000000
--- a/arch/sh/boards/mach-landisk/gio.c
+++ /dev/null
@@ -1,164 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/landisk/gio.c - driver for landisk
- *
- * This driver will also support the I-O DATA Device, Inc. LANDISK Board.
- * LANDISK and USL-5P Button, LED and GIO driver drive function.
- *
- * Copylight (C) 2006 kogiidena
- * Copylight (C) 2002 Atom Create Engineering Co., Ltd. *
- */
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/kdev_t.h>
-#include <linux/cdev.h>
-#include <linux/fs.h>
-#include <asm/io.h>
-#include <linux/uaccess.h>
-#include <mach-landisk/mach/gio.h>
-#include <mach-landisk/mach/iodata_landisk.h>
-
-#define DEVCOUNT 4
-#define GIO_MINOR 2 /* GIO minor no. */
-
-static dev_t dev;
-static struct cdev *cdev_p;
-static int openCnt;
-
-static int gio_open(struct inode *inode, struct file *filp)
-{
- int minor = iminor(inode);
- int ret = -ENOENT;
-
- preempt_disable();
- if (minor < DEVCOUNT) {
- if (openCnt > 0) {
- ret = -EALREADY;
- } else {
- openCnt++;
- ret = 0;
- }
- }
- preempt_enable();
- return ret;
-}
-
-static int gio_close(struct inode *inode, struct file *filp)
-{
- int minor = iminor(inode);
-
- if (minor < DEVCOUNT) {
- openCnt--;
- }
- return 0;
-}
-
-static long gio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
-{
- unsigned int data;
- static unsigned int addr = 0;
-
- if (cmd & 0x01) { /* write */
- if (copy_from_user(&data, (int *)arg, sizeof(int))) {
- return -EFAULT;
- }
- }
-
- switch (cmd) {
- case GIODRV_IOCSGIOSETADDR: /* address set */
- addr = data;
- break;
-
- case GIODRV_IOCSGIODATA1: /* write byte */
- __raw_writeb((unsigned char)(0x0ff & data), addr);
- break;
-
- case GIODRV_IOCSGIODATA2: /* write word */
- if (addr & 0x01) {
- return -EFAULT;
- }
- __raw_writew((unsigned short int)(0x0ffff & data), addr);
- break;
-
- case GIODRV_IOCSGIODATA4: /* write long */
- if (addr & 0x03) {
- return -EFAULT;
- }
- __raw_writel(data, addr);
- break;
-
- case GIODRV_IOCGGIODATA1: /* read byte */
- data = __raw_readb(addr);
- break;
-
- case GIODRV_IOCGGIODATA2: /* read word */
- if (addr & 0x01) {
- return -EFAULT;
- }
- data = __raw_readw(addr);
- break;
-
- case GIODRV_IOCGGIODATA4: /* read long */
- if (addr & 0x03) {
- return -EFAULT;
- }
- data = __raw_readl(addr);
- break;
- default:
- return -EFAULT;
- break;
- }
-
- if ((cmd & 0x01) == 0) { /* read */
- if (copy_to_user((int *)arg, &data, sizeof(int))) {
- return -EFAULT;
- }
- }
- return 0;
-}
-
-static const struct file_operations gio_fops = {
- .owner = THIS_MODULE,
- .open = gio_open, /* open */
- .release = gio_close, /* release */
- .unlocked_ioctl = gio_ioctl,
- .llseek = noop_llseek,
-};
-
-static int __init gio_init(void)
-{
- int error;
-
- printk(KERN_INFO "gio: driver initialized\n");
-
- openCnt = 0;
-
- if ((error = alloc_chrdev_region(&dev, 0, DEVCOUNT, "gio")) < 0) {
- printk(KERN_ERR
- "gio: Couldn't alloc_chrdev_region, error=%d\n",
- error);
- return 1;
- }
-
- cdev_p = cdev_alloc();
- cdev_p->ops = &gio_fops;
- error = cdev_add(cdev_p, dev, DEVCOUNT);
- if (error) {
- printk(KERN_ERR
- "gio: Couldn't cdev_add, error=%d\n", error);
- return 1;
- }
-
- return 0;
-}
-
-static void __exit gio_exit(void)
-{
- cdev_del(cdev_p);
- unregister_chrdev_region(dev, DEVCOUNT);
-}
-
-module_init(gio_init);
-module_exit(gio_exit);
-
-MODULE_LICENSE("GPL");
diff --git a/arch/sh/boards/mach-landisk/irq.c b/arch/sh/boards/mach-landisk/irq.c
deleted file mode 100644
index 0b672b80c56179..00000000000000
--- a/arch/sh/boards/mach-landisk/irq.c
+++ /dev/null
@@ -1,63 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/mach-landisk/irq.c
- *
- * I-O DATA Device, Inc. LANDISK Support
- *
- * Copyright (C) 2005-2007 kogiidena
- * Copyright (C) 2011 Nobuhiro Iwamatsu
- *
- * Copyright (C) 2001 Ian da Silva, Jeremy Siegel
- * Based largely on io_se.c.
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <mach-landisk/mach/iodata_landisk.h>
-
-enum {
- UNUSED = 0,
-
- PCI_INTA, /* PCI int A */
- PCI_INTB, /* PCI int B */
- PCI_INTC, /* PCI int C */
- PCI_INTD, /* PCI int D */
- ATA, /* ATA */
- FATA, /* CF */
- POWER, /* Power switch */
- BUTTON, /* Button switch */
-};
-
-/* Vectors for LANDISK */
-static struct intc_vect vectors_landisk[] __initdata = {
- INTC_IRQ(PCI_INTA, IRQ_PCIINTA),
- INTC_IRQ(PCI_INTB, IRQ_PCIINTB),
- INTC_IRQ(PCI_INTC, IRQ_PCIINTC),
- INTC_IRQ(PCI_INTD, IRQ_PCIINTD),
- INTC_IRQ(ATA, IRQ_ATA),
- INTC_IRQ(FATA, IRQ_FATA),
- INTC_IRQ(POWER, IRQ_POWER),
- INTC_IRQ(BUTTON, IRQ_BUTTON),
-};
-
-/* IRLMSK mask register layout for LANDISK */
-static struct intc_mask_reg mask_registers_landisk[] __initdata = {
- { PA_IMASK, 0, 8, /* IRLMSK */
- { BUTTON, POWER, FATA, ATA,
- PCI_INTD, PCI_INTC, PCI_INTB, PCI_INTA,
- }
- },
-};
-
-static DECLARE_INTC_DESC(intc_desc_landisk, "landisk", vectors_landisk, NULL,
- mask_registers_landisk, NULL, NULL);
-/*
- * Initialize IRQ setting
- */
-void __init init_landisk_IRQ(void)
-{
- register_intc_controller(&intc_desc_landisk);
- __raw_writeb(0x00, PA_PWRINT_CLR);
-}
diff --git a/arch/sh/boards/mach-landisk/psw.c b/arch/sh/boards/mach-landisk/psw.c
deleted file mode 100644
index e171d9af48f3df..00000000000000
--- a/arch/sh/boards/mach-landisk/psw.c
+++ /dev/null
@@ -1,140 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/landisk/psw.c
- *
- * push switch support for LANDISK and USL-5P
- *
- * Copyright (C) 2006-2007 Paul Mundt
- * Copyright (C) 2007 kogiidena
- */
-#include <linux/io.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <mach-landisk/mach/iodata_landisk.h>
-#include <asm/push-switch.h>
-
-static irqreturn_t psw_irq_handler(int irq, void *arg)
-{
- struct platform_device *pdev = arg;
- struct push_switch *psw = platform_get_drvdata(pdev);
- struct push_switch_platform_info *psw_info = pdev->dev.platform_data;
- unsigned int sw_value;
- int ret = 0;
-
- sw_value = (0x0ff & (~__raw_readb(PA_STATUS)));
-
- /* Nothing to do if there's no state change */
- if (psw->state) {
- ret = 1;
- goto out;
- }
-
- /* Figure out who raised it */
- if (sw_value & (1 << psw_info->bit)) {
- psw->state = 1;
- mod_timer(&psw->debounce, jiffies + 50);
- ret = 1;
- }
-
-out:
- /* Clear the switch IRQs */
- __raw_writeb(0x00, PA_PWRINT_CLR);
-
- return IRQ_RETVAL(ret);
-}
-
-static struct resource psw_power_resources[] = {
- [0] = {
- .start = IRQ_POWER,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct resource psw_usl5p_resources[] = {
- [0] = {
- .start = IRQ_BUTTON,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct push_switch_platform_info psw_power_platform_data = {
- .name = "psw_power",
- .bit = 4,
- .irq_flags = IRQF_SHARED,
- .irq_handler = psw_irq_handler,
-};
-
-static struct push_switch_platform_info psw1_platform_data = {
- .name = "psw1",
- .bit = 0,
- .irq_flags = IRQF_SHARED,
- .irq_handler = psw_irq_handler,
-};
-
-static struct push_switch_platform_info psw2_platform_data = {
- .name = "psw2",
- .bit = 2,
- .irq_flags = IRQF_SHARED,
- .irq_handler = psw_irq_handler,
-};
-
-static struct push_switch_platform_info psw3_platform_data = {
- .name = "psw3",
- .bit = 1,
- .irq_flags = IRQF_SHARED,
- .irq_handler = psw_irq_handler,
-};
-
-static struct platform_device psw_power_switch_device = {
- .name = "push-switch",
- .id = 0,
- .num_resources = ARRAY_SIZE(psw_power_resources),
- .resource = psw_power_resources,
- .dev = {
- .platform_data = &psw_power_platform_data,
- },
-};
-
-static struct platform_device psw1_switch_device = {
- .name = "push-switch",
- .id = 1,
- .num_resources = ARRAY_SIZE(psw_usl5p_resources),
- .resource = psw_usl5p_resources,
- .dev = {
- .platform_data = &psw1_platform_data,
- },
-};
-
-static struct platform_device psw2_switch_device = {
- .name = "push-switch",
- .id = 2,
- .num_resources = ARRAY_SIZE(psw_usl5p_resources),
- .resource = psw_usl5p_resources,
- .dev = {
- .platform_data = &psw2_platform_data,
- },
-};
-
-static struct platform_device psw3_switch_device = {
- .name = "push-switch",
- .id = 3,
- .num_resources = ARRAY_SIZE(psw_usl5p_resources),
- .resource = psw_usl5p_resources,
- .dev = {
- .platform_data = &psw3_platform_data,
- },
-};
-
-static struct platform_device *psw_devices[] = {
- &psw_power_switch_device,
- &psw1_switch_device,
- &psw2_switch_device,
- &psw3_switch_device,
-};
-
-static int __init psw_init(void)
-{
- return platform_add_devices(psw_devices, ARRAY_SIZE(psw_devices));
-}
-device_initcall(psw_init);
diff --git a/arch/sh/boards/mach-landisk/setup.c b/arch/sh/boards/mach-landisk/setup.c
deleted file mode 100644
index 2c44b94f82fb27..00000000000000
--- a/arch/sh/boards/mach-landisk/setup.c
+++ /dev/null
@@ -1,102 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/landisk/setup.c
- *
- * I-O DATA Device, Inc. LANDISK Support.
- *
- * Copyright (C) 2000 Kazumoto Kojima
- * Copyright (C) 2002 Paul Mundt
- * Copylight (C) 2002 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2005-2007 kogiidena
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/pm.h>
-#include <linux/mm.h>
-#include <asm/machvec.h>
-#include <mach-landisk/mach/iodata_landisk.h>
-#include <asm/io.h>
-
-static void landisk_power_off(void)
-{
- __raw_writeb(0x01, PA_SHUTDOWN);
-}
-
-static struct resource cf_ide_resources[3];
-
-static struct pata_platform_info pata_info = {
- .ioport_shift = 1,
-};
-
-static struct platform_device cf_ide_device = {
- .name = "pata_platform",
- .id = -1,
- .num_resources = ARRAY_SIZE(cf_ide_resources),
- .resource = cf_ide_resources,
- .dev = {
- .platform_data = &pata_info,
- },
-};
-
-static struct platform_device rtc_device = {
- .name = "rs5c313",
- .id = -1,
-};
-
-static struct platform_device *landisk_devices[] __initdata = {
- &cf_ide_device,
- &rtc_device,
-};
-
-static int __init landisk_devices_setup(void)
-{
- pgprot_t prot;
- unsigned long paddrbase;
- void *cf_ide_base;
-
- /* open I/O area window */
- paddrbase = virt_to_phys((void *)PA_AREA5_IO);
- prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
- cf_ide_base = ioremap_prot(paddrbase, PAGE_SIZE, pgprot_val(prot));
- if (!cf_ide_base) {
- printk("allocate_cf_area : can't open CF I/O window!\n");
- return -ENOMEM;
- }
-
- /* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */
- cf_ide_resources[0].start = (unsigned long)cf_ide_base + 0x40;
- cf_ide_resources[0].end = (unsigned long)cf_ide_base + 0x40 + 0x0f;
- cf_ide_resources[0].flags = IORESOURCE_IO;
- cf_ide_resources[1].start = (unsigned long)cf_ide_base + 0x2c;
- cf_ide_resources[1].end = (unsigned long)cf_ide_base + 0x2c + 0x03;
- cf_ide_resources[1].flags = IORESOURCE_IO;
- cf_ide_resources[2].start = IRQ_FATA;
- cf_ide_resources[2].flags = IORESOURCE_IRQ;
-
- return platform_add_devices(landisk_devices,
- ARRAY_SIZE(landisk_devices));
-}
-
-device_initcall(landisk_devices_setup);
-
-static void __init landisk_setup(char **cmdline_p)
-{
- /* I/O port identity mapping */
- __set_io_port_base(0);
-
- /* LED ON */
- __raw_writeb(__raw_readb(PA_LED) | 0x03, PA_LED);
-
- printk(KERN_INFO "I-O DATA DEVICE, INC. \"LANDISK Series\" support.\n");
- pm_power_off = landisk_power_off;
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_landisk __initmv = {
- .mv_name = "LANDISK",
- .mv_setup = landisk_setup,
- .mv_init_irq = init_landisk_IRQ,
-};
diff --git a/arch/sh/boards/mach-lboxre2/Makefile b/arch/sh/boards/mach-lboxre2/Makefile
deleted file mode 100644
index 0fbd0822911a49..00000000000000
--- a/arch/sh/boards/mach-lboxre2/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the L-BOX RE2 specific parts of the kernel
-# Copyright (c) 2007 Nobuhiro Iwamatsu
-
-obj-y := setup.o irq.o
diff --git a/arch/sh/boards/mach-lboxre2/irq.c b/arch/sh/boards/mach-lboxre2/irq.c
deleted file mode 100644
index a250e3b9019de1..00000000000000
--- a/arch/sh/boards/mach-lboxre2/irq.c
+++ /dev/null
@@ -1,27 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/lboxre2/irq.c
- *
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- *
- * NTT COMWARE L-BOX RE2 Support.
- */
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <mach/lboxre2.h>
-
-/*
- * Initialize IRQ setting
- */
-void __init init_lboxre2_IRQ(void)
-{
- make_imask_irq(IRQ_CF1);
- make_imask_irq(IRQ_CF0);
- make_imask_irq(IRQ_INTD);
- make_imask_irq(IRQ_ETH1);
- make_imask_irq(IRQ_ETH0);
- make_imask_irq(IRQ_INTA);
-}
diff --git a/arch/sh/boards/mach-lboxre2/setup.c b/arch/sh/boards/mach-lboxre2/setup.c
deleted file mode 100644
index 20d01b430f2a81..00000000000000
--- a/arch/sh/boards/mach-lboxre2/setup.c
+++ /dev/null
@@ -1,79 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/lbox/setup.c
- *
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- *
- * NTT COMWARE L-BOX RE2 Support
- */
-
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <asm/machvec.h>
-#include <asm/addrspace.h>
-#include <mach/lboxre2.h>
-#include <asm/io.h>
-
-static struct resource cf_ide_resources[] = {
- [0] = {
- .start = 0x1f0,
- .end = 0x1f0 + 8 ,
- .flags = IORESOURCE_IO,
- },
- [1] = {
- .start = 0x1f0 + 0x206,
- .end = 0x1f0 +8 + 0x206 + 8,
- .flags = IORESOURCE_IO,
- },
- [2] = {
- .start = IRQ_CF0,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device cf_ide_device = {
- .name = "pata_platform",
- .id = -1,
- .num_resources = ARRAY_SIZE(cf_ide_resources),
- .resource = cf_ide_resources,
-};
-
-static struct platform_device *lboxre2_devices[] __initdata = {
- &cf_ide_device,
-};
-
-static int __init lboxre2_devices_setup(void)
-{
- u32 cf0_io_base; /* Boot CF base address */
- pgprot_t prot;
- unsigned long paddrbase, psize;
-
- /* open I/O area window */
- paddrbase = virt_to_phys((void*)PA_AREA5_IO);
- psize = PAGE_SIZE;
- prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
- cf0_io_base = (u32)ioremap_prot(paddrbase, psize, pgprot_val(prot));
- if (!cf0_io_base) {
- printk(KERN_ERR "%s : can't open CF I/O window!\n" , __func__ );
- return -ENOMEM;
- }
-
- cf_ide_resources[0].start += cf0_io_base ;
- cf_ide_resources[0].end += cf0_io_base ;
- cf_ide_resources[1].start += cf0_io_base ;
- cf_ide_resources[1].end += cf0_io_base ;
-
- return platform_add_devices(lboxre2_devices,
- ARRAY_SIZE(lboxre2_devices));
-
-}
-device_initcall(lboxre2_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_lboxre2 __initmv = {
- .mv_name = "L-BOX RE2",
- .mv_init_irq = init_lboxre2_IRQ,
-};
diff --git a/arch/sh/boards/mach-microdev/Makefile b/arch/sh/boards/mach-microdev/Makefile
deleted file mode 100644
index 05c5698dcad025..00000000000000
--- a/arch/sh/boards/mach-microdev/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the SuperH MicroDev specific parts of the kernel
-#
-
-obj-y := setup.o irq.o io.o fdc37c93xapm.o
diff --git a/arch/sh/boards/mach-microdev/fdc37c93xapm.c b/arch/sh/boards/mach-microdev/fdc37c93xapm.c
deleted file mode 100644
index 2a04f72dd14577..00000000000000
--- a/arch/sh/boards/mach-microdev/fdc37c93xapm.c
+++ /dev/null
@@ -1,157 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Setup for the SMSC FDC37C93xAPM
- *
- * Copyright (C) 2003 Sean McGoogan ([email protected])
- * Copyright (C) 2003, 2004 SuperH, Inc.
- * Copyright (C) 2004, 2005 Paul Mundt
- *
- * SuperH SH4-202 MicroDev board support.
- */
-#include <linux/init.h>
-#include <linux/ioport.h>
-#include <linux/io.h>
-#include <linux/err.h>
-#include <mach/microdev.h>
-
-#define SMSC_CONFIG_PORT_ADDR (0x3F0)
-#define SMSC_INDEX_PORT_ADDR SMSC_CONFIG_PORT_ADDR
-#define SMSC_DATA_PORT_ADDR (SMSC_INDEX_PORT_ADDR + 1)
-
-#define SMSC_ENTER_CONFIG_KEY 0x55
-#define SMSC_EXIT_CONFIG_KEY 0xaa
-
-#define SMCS_LOGICAL_DEV_INDEX 0x07 /* Logical Device Number */
-#define SMSC_DEVICE_ID_INDEX 0x20 /* Device ID */
-#define SMSC_DEVICE_REV_INDEX 0x21 /* Device Revision */
-#define SMSC_ACTIVATE_INDEX 0x30 /* Activate */
-#define SMSC_PRIMARY_BASE_INDEX 0x60 /* Primary Base Address */
-#define SMSC_SECONDARY_BASE_INDEX 0x62 /* Secondary Base Address */
-#define SMSC_PRIMARY_INT_INDEX 0x70 /* Primary Interrupt Select */
-#define SMSC_SECONDARY_INT_INDEX 0x72 /* Secondary Interrupt Select */
-#define SMSC_HDCS0_INDEX 0xf0 /* HDCS0 Address Decoder */
-#define SMSC_HDCS1_INDEX 0xf1 /* HDCS1 Address Decoder */
-
-#define SMSC_IDE1_DEVICE 1 /* IDE #1 logical device */
-#define SMSC_IDE2_DEVICE 2 /* IDE #2 logical device */
-#define SMSC_PARALLEL_DEVICE 3 /* Parallel Port logical device */
-#define SMSC_SERIAL1_DEVICE 4 /* Serial #1 logical device */
-#define SMSC_SERIAL2_DEVICE 5 /* Serial #2 logical device */
-#define SMSC_KEYBOARD_DEVICE 7 /* Keyboard logical device */
-#define SMSC_CONFIG_REGISTERS 8 /* Configuration Registers (Aux I/O) */
-
-#define SMSC_READ_INDEXED(index) ({ \
- outb((index), SMSC_INDEX_PORT_ADDR); \
- inb(SMSC_DATA_PORT_ADDR); })
-#define SMSC_WRITE_INDEXED(val, index) ({ \
- outb((index), SMSC_INDEX_PORT_ADDR); \
- outb((val), SMSC_DATA_PORT_ADDR); })
-
-#define IDE1_PRIMARY_BASE 0x01f0 /* Task File Registe base for IDE #1 */
-#define IDE1_SECONDARY_BASE 0x03f6 /* Miscellaneous AT registers for IDE #1 */
-#define IDE2_PRIMARY_BASE 0x0170 /* Task File Registe base for IDE #2 */
-#define IDE2_SECONDARY_BASE 0x0376 /* Miscellaneous AT registers for IDE #2 */
-
-#define SERIAL1_PRIMARY_BASE 0x03f8
-#define SERIAL2_PRIMARY_BASE 0x02f8
-
-#define MSB(x) ( (x) >> 8 )
-#define LSB(x) ( (x) & 0xff )
-
- /* General-Purpose base address on CPU-board FPGA */
-#define MICRODEV_FPGA_GP_BASE 0xa6100000ul
-
-static int __init smsc_superio_setup(void)
-{
-
- unsigned char devid, devrev;
-
- /* Initially the chip is in run state */
- /* Put it into configuration state */
- outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
-
- /* Read device ID info */
- devid = SMSC_READ_INDEXED(SMSC_DEVICE_ID_INDEX);
- devrev = SMSC_READ_INDEXED(SMSC_DEVICE_REV_INDEX);
-
- if ((devid == 0x30) && (devrev == 0x01))
- printk("SMSC FDC37C93xAPM SuperIO device detected\n");
- else
- return -ENODEV;
-
- /* Select the keyboard device */
- SMSC_WRITE_INDEXED(SMSC_KEYBOARD_DEVICE, SMCS_LOGICAL_DEV_INDEX);
- /* enable it */
- SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
- /* enable the interrupts */
- SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_KEYBOARD, SMSC_PRIMARY_INT_INDEX);
- SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_MOUSE, SMSC_SECONDARY_INT_INDEX);
-
- /* Select the Serial #1 device */
- SMSC_WRITE_INDEXED(SMSC_SERIAL1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
- /* enable it */
- SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
- /* program with port addresses */
- SMSC_WRITE_INDEXED(MSB(SERIAL1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
- SMSC_WRITE_INDEXED(LSB(SERIAL1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
- SMSC_WRITE_INDEXED(0x00, SMSC_HDCS0_INDEX);
- /* enable the interrupts */
- SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_SERIAL1, SMSC_PRIMARY_INT_INDEX);
-
- /* Select the Serial #2 device */
- SMSC_WRITE_INDEXED(SMSC_SERIAL2_DEVICE, SMCS_LOGICAL_DEV_INDEX);
- /* enable it */
- SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
- /* program with port addresses */
- SMSC_WRITE_INDEXED(MSB(SERIAL2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
- SMSC_WRITE_INDEXED(LSB(SERIAL2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
- SMSC_WRITE_INDEXED(0x00, SMSC_HDCS0_INDEX);
- /* enable the interrupts */
- SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_SERIAL2, SMSC_PRIMARY_INT_INDEX);
-
- /* Select the IDE#1 device */
- SMSC_WRITE_INDEXED(SMSC_IDE1_DEVICE, SMCS_LOGICAL_DEV_INDEX);
- /* enable it */
- SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
- /* program with port addresses */
- SMSC_WRITE_INDEXED(MSB(IDE1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
- SMSC_WRITE_INDEXED(LSB(IDE1_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
- SMSC_WRITE_INDEXED(MSB(IDE1_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+0);
- SMSC_WRITE_INDEXED(LSB(IDE1_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+1);
- SMSC_WRITE_INDEXED(0x0c, SMSC_HDCS0_INDEX);
- SMSC_WRITE_INDEXED(0x00, SMSC_HDCS1_INDEX);
- /* select the interrupt */
- SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_IDE1, SMSC_PRIMARY_INT_INDEX);
-
- /* Select the IDE#2 device */
- SMSC_WRITE_INDEXED(SMSC_IDE2_DEVICE, SMCS_LOGICAL_DEV_INDEX);
- /* enable it */
- SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX);
- /* program with port addresses */
- SMSC_WRITE_INDEXED(MSB(IDE2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+0);
- SMSC_WRITE_INDEXED(LSB(IDE2_PRIMARY_BASE), SMSC_PRIMARY_BASE_INDEX+1);
- SMSC_WRITE_INDEXED(MSB(IDE2_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+0);
- SMSC_WRITE_INDEXED(LSB(IDE2_SECONDARY_BASE), SMSC_SECONDARY_BASE_INDEX+1);
- /* select the interrupt */
- SMSC_WRITE_INDEXED(MICRODEV_FPGA_IRQ_IDE2, SMSC_PRIMARY_INT_INDEX);
-
- /* Select the configuration registers */
- SMSC_WRITE_INDEXED(SMSC_CONFIG_REGISTERS, SMCS_LOGICAL_DEV_INDEX);
- /* enable the appropriate GPIO pins for IDE functionality:
- * bit[0] In/Out 1==input; 0==output
- * bit[1] Polarity 1==invert; 0==no invert
- * bit[2] Int Enb #1 1==Enable Combined IRQ #1; 0==disable
- * bit[3:4] Function Select 00==original; 01==Alternate Function #1
- */
- SMSC_WRITE_INDEXED(0x00, 0xc2); /* GP42 = nIDE1_OE */
- SMSC_WRITE_INDEXED(0x01, 0xc5); /* GP45 = IDE1_IRQ */
- SMSC_WRITE_INDEXED(0x00, 0xc6); /* GP46 = nIOROP */
- SMSC_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */
- SMSC_WRITE_INDEXED(0x08, 0xe8); /* GP20 = nIDE2_OE */
-
- /* Exit the configuration state */
- outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
-
- return 0;
-}
-device_initcall(smsc_superio_setup);
diff --git a/arch/sh/boards/mach-microdev/io.c b/arch/sh/boards/mach-microdev/io.c
deleted file mode 100644
index a76c12721e63dc..00000000000000
--- a/arch/sh/boards/mach-microdev/io.c
+++ /dev/null
@@ -1,123 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/superh/microdev/io.c
- *
- * Copyright (C) 2003 Sean McGoogan ([email protected])
- * Copyright (C) 2003, 2004 SuperH, Inc.
- * Copyright (C) 2004 Paul Mundt
- *
- * SuperH SH4-202 MicroDev board support.
- */
-
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/wait.h>
-#include <asm/io.h>
-#include <mach/microdev.h>
-
- /*
- * we need to have a 'safe' address to re-direct all I/O requests
- * that we do not explicitly wish to handle. This safe address
- * must have the following properies:
- *
- * * writes are ignored (no exception)
- * * reads are benign (no side-effects)
- * * accesses of width 1, 2 and 4-bytes are all valid.
- *
- * The Processor Version Register (PVR) has these properties.
- */
-#define PVR 0xff000030 /* Processor Version Register */
-
-
-#define IO_IDE2_BASE 0x170ul /* I/O base for SMSC FDC37C93xAPM IDE #2 */
-#define IO_IDE1_BASE 0x1f0ul /* I/O base for SMSC FDC37C93xAPM IDE #1 */
-#define IO_ISP1161_BASE 0x290ul /* I/O port for Philips ISP1161x USB chip */
-#define IO_SERIAL2_BASE 0x2f8ul /* I/O base for SMSC FDC37C93xAPM Serial #2 */
-#define IO_LAN91C111_BASE 0x300ul /* I/O base for SMSC LAN91C111 Ethernet chip */
-#define IO_IDE2_MISC 0x376ul /* I/O misc for SMSC FDC37C93xAPM IDE #2 */
-#define IO_SUPERIO_BASE 0x3f0ul /* I/O base for SMSC FDC37C93xAPM SuperIO chip */
-#define IO_IDE1_MISC 0x3f6ul /* I/O misc for SMSC FDC37C93xAPM IDE #1 */
-#define IO_SERIAL1_BASE 0x3f8ul /* I/O base for SMSC FDC37C93xAPM Serial #1 */
-
-#define IO_ISP1161_EXTENT 0x04ul /* I/O extent for Philips ISP1161x USB chip */
-#define IO_LAN91C111_EXTENT 0x10ul /* I/O extent for SMSC LAN91C111 Ethernet chip */
-#define IO_SUPERIO_EXTENT 0x02ul /* I/O extent for SMSC FDC37C93xAPM SuperIO chip */
-#define IO_IDE_EXTENT 0x08ul /* I/O extent for IDE Task Register set */
-#define IO_SERIAL_EXTENT 0x10ul
-
-#define IO_LAN91C111_PHYS 0xa7500000ul /* Physical address of SMSC LAN91C111 Ethernet chip */
-#define IO_ISP1161_PHYS 0xa7700000ul /* Physical address of Philips ISP1161x USB chip */
-#define IO_SUPERIO_PHYS 0xa7800000ul /* Physical address of SMSC FDC37C93xAPM SuperIO chip */
-
-/*
- * map I/O ports to memory-mapped addresses
- */
-void __iomem *microdev_ioport_map(unsigned long offset, unsigned int len)
-{
- unsigned long result;
-
- if ((offset >= IO_LAN91C111_BASE) &&
- (offset < IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
- /*
- * SMSC LAN91C111 Ethernet chip
- */
- result = IO_LAN91C111_PHYS + offset - IO_LAN91C111_BASE;
- } else if ((offset >= IO_SUPERIO_BASE) &&
- (offset < IO_SUPERIO_BASE + IO_SUPERIO_EXTENT)) {
- /*
- * SMSC FDC37C93xAPM SuperIO chip
- *
- * Configuration Registers
- */
- result = IO_SUPERIO_PHYS + (offset << 1);
- } else if (((offset >= IO_IDE1_BASE) &&
- (offset < IO_IDE1_BASE + IO_IDE_EXTENT)) ||
- (offset == IO_IDE1_MISC)) {
- /*
- * SMSC FDC37C93xAPM SuperIO chip
- *
- * IDE #1
- */
- result = IO_SUPERIO_PHYS + (offset << 1);
- } else if (((offset >= IO_IDE2_BASE) &&
- (offset < IO_IDE2_BASE + IO_IDE_EXTENT)) ||
- (offset == IO_IDE2_MISC)) {
- /*
- * SMSC FDC37C93xAPM SuperIO chip
- *
- * IDE #2
- */
- result = IO_SUPERIO_PHYS + (offset << 1);
- } else if ((offset >= IO_SERIAL1_BASE) &&
- (offset < IO_SERIAL1_BASE + IO_SERIAL_EXTENT)) {
- /*
- * SMSC FDC37C93xAPM SuperIO chip
- *
- * Serial #1
- */
- result = IO_SUPERIO_PHYS + (offset << 1);
- } else if ((offset >= IO_SERIAL2_BASE) &&
- (offset < IO_SERIAL2_BASE + IO_SERIAL_EXTENT)) {
- /*
- * SMSC FDC37C93xAPM SuperIO chip
- *
- * Serial #2
- */
- result = IO_SUPERIO_PHYS + (offset << 1);
- } else if ((offset >= IO_ISP1161_BASE) &&
- (offset < IO_ISP1161_BASE + IO_ISP1161_EXTENT)) {
- /*
- * Philips USB ISP1161x chip
- */
- result = IO_ISP1161_PHYS + offset - IO_ISP1161_BASE;
- } else {
- /*
- * safe default.
- */
- printk("Warning: unexpected port in %s( offset = 0x%lx )\n",
- __func__, offset);
- result = PVR;
- }
-
- return (void __iomem *)result;
-}
diff --git a/arch/sh/boards/mach-microdev/irq.c b/arch/sh/boards/mach-microdev/irq.c
deleted file mode 100644
index dc27492c83d765..00000000000000
--- a/arch/sh/boards/mach-microdev/irq.c
+++ /dev/null
@@ -1,150 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/superh/microdev/irq.c
- *
- * Copyright (C) 2003 Sean McGoogan ([email protected])
- *
- * SuperH SH4-202 MicroDev board support.
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <asm/io.h>
-#include <mach/microdev.h>
-
-#define NUM_EXTERNAL_IRQS 16 /* IRL0 .. IRL15 */
-
-static const struct {
- unsigned char fpgaIrq;
- unsigned char mapped;
- const char *name;
-} fpgaIrqTable[NUM_EXTERNAL_IRQS] = {
- { 0, 0, "unused" }, /* IRQ #0 IRL=15 0x200 */
- { MICRODEV_FPGA_IRQ_KEYBOARD, 1, "keyboard" }, /* IRQ #1 IRL=14 0x220 */
- { MICRODEV_FPGA_IRQ_SERIAL1, 1, "Serial #1"}, /* IRQ #2 IRL=13 0x240 */
- { MICRODEV_FPGA_IRQ_ETHERNET, 1, "Ethernet" }, /* IRQ #3 IRL=12 0x260 */
- { MICRODEV_FPGA_IRQ_SERIAL2, 0, "Serial #2"}, /* IRQ #4 IRL=11 0x280 */
- { 0, 0, "unused" }, /* IRQ #5 IRL=10 0x2a0 */
- { 0, 0, "unused" }, /* IRQ #6 IRL=9 0x2c0 */
- { MICRODEV_FPGA_IRQ_USB_HC, 1, "USB" }, /* IRQ #7 IRL=8 0x2e0 */
- { MICRODEV_IRQ_PCI_INTA, 1, "PCI INTA" }, /* IRQ #8 IRL=7 0x300 */
- { MICRODEV_IRQ_PCI_INTB, 1, "PCI INTB" }, /* IRQ #9 IRL=6 0x320 */
- { MICRODEV_IRQ_PCI_INTC, 1, "PCI INTC" }, /* IRQ #10 IRL=5 0x340 */
- { MICRODEV_IRQ_PCI_INTD, 1, "PCI INTD" }, /* IRQ #11 IRL=4 0x360 */
- { MICRODEV_FPGA_IRQ_MOUSE, 1, "mouse" }, /* IRQ #12 IRL=3 0x380 */
- { MICRODEV_FPGA_IRQ_IDE2, 1, "IDE #2" }, /* IRQ #13 IRL=2 0x3a0 */
- { MICRODEV_FPGA_IRQ_IDE1, 1, "IDE #1" }, /* IRQ #14 IRL=1 0x3c0 */
- { 0, 0, "unused" }, /* IRQ #15 IRL=0 0x3e0 */
-};
-
-#if (MICRODEV_LINUX_IRQ_KEYBOARD != 1)
-# error Inconsistancy in defining the IRQ# for Keyboard!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_ETHERNET != 3)
-# error Inconsistancy in defining the IRQ# for Ethernet!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_USB_HC != 7)
-# error Inconsistancy in defining the IRQ# for USB!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_MOUSE != 12)
-# error Inconsistancy in defining the IRQ# for PS/2 Mouse!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_IDE2 != 13)
-# error Inconsistancy in defining the IRQ# for secondary IDE!
-#endif
-
-#if (MICRODEV_LINUX_IRQ_IDE1 != 14)
-# error Inconsistancy in defining the IRQ# for primary IDE!
-#endif
-
-static void disable_microdev_irq(struct irq_data *data)
-{
- unsigned int irq = data->irq;
- unsigned int fpgaIrq;
-
- if (irq >= NUM_EXTERNAL_IRQS)
- return;
- if (!fpgaIrqTable[irq].mapped)
- return;
-
- fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
-
- /* disable interrupts on the FPGA INTC register */
- __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG);
-}
-
-static void enable_microdev_irq(struct irq_data *data)
-{
- unsigned int irq = data->irq;
- unsigned long priorityReg, priorities, pri;
- unsigned int fpgaIrq;
-
- if (unlikely(irq >= NUM_EXTERNAL_IRQS))
- return;
- if (unlikely(!fpgaIrqTable[irq].mapped))
- return;
-
- pri = 15 - irq;
-
- fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
- priorityReg = MICRODEV_FPGA_INTPRI_REG(fpgaIrq);
-
- /* set priority for the interrupt */
- priorities = __raw_readl(priorityReg);
- priorities &= ~MICRODEV_FPGA_INTPRI_MASK(fpgaIrq);
- priorities |= MICRODEV_FPGA_INTPRI_LEVEL(fpgaIrq, pri);
- __raw_writel(priorities, priorityReg);
-
- /* enable interrupts on the FPGA INTC register */
- __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG);
-}
-
-static struct irq_chip microdev_irq_type = {
- .name = "MicroDev-IRQ",
- .irq_unmask = enable_microdev_irq,
- .irq_mask = disable_microdev_irq,
-};
-
-/* This function sets the desired irq handler to be a MicroDev type */
-static void __init make_microdev_irq(unsigned int irq)
-{
- disable_irq_nosync(irq);
- irq_set_chip_and_handler(irq, &microdev_irq_type, handle_level_irq);
- disable_microdev_irq(irq_get_irq_data(irq));
-}
-
-extern void __init init_microdev_irq(void)
-{
- int i;
-
- /* disable interrupts on the FPGA INTC register */
- __raw_writel(~0ul, MICRODEV_FPGA_INTDSB_REG);
-
- for (i = 0; i < NUM_EXTERNAL_IRQS; i++)
- make_microdev_irq(i);
-}
-
-extern void microdev_print_fpga_intc_status(void)
-{
- volatile unsigned int * const intenb = (unsigned int*)MICRODEV_FPGA_INTENB_REG;
- volatile unsigned int * const intdsb = (unsigned int*)MICRODEV_FPGA_INTDSB_REG;
- volatile unsigned int * const intpria = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(0);
- volatile unsigned int * const intprib = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(8);
- volatile unsigned int * const intpric = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(16);
- volatile unsigned int * const intprid = (unsigned int*)MICRODEV_FPGA_INTPRI_REG(24);
- volatile unsigned int * const intsrc = (unsigned int*)MICRODEV_FPGA_INTSRC_REG;
- volatile unsigned int * const intreq = (unsigned int*)MICRODEV_FPGA_INTREQ_REG;
-
- printk("-------------------------- microdev_print_fpga_intc_status() ------------------\n");
- printk("FPGA_INTENB = 0x%08x\n", *intenb);
- printk("FPGA_INTDSB = 0x%08x\n", *intdsb);
- printk("FPGA_INTSRC = 0x%08x\n", *intsrc);
- printk("FPGA_INTREQ = 0x%08x\n", *intreq);
- printk("FPGA_INTPRI[3..0] = %08x:%08x:%08x:%08x\n", *intprid, *intpric, *intprib, *intpria);
- printk("-------------------------------------------------------------------------------\n");
-}
diff --git a/arch/sh/boards/mach-microdev/setup.c b/arch/sh/boards/mach-microdev/setup.c
deleted file mode 100644
index f4a777fe2d0121..00000000000000
--- a/arch/sh/boards/mach-microdev/setup.c
+++ /dev/null
@@ -1,197 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/superh/microdev/setup.c
- *
- * Copyright (C) 2003 Sean McGoogan ([email protected])
- * Copyright (C) 2003, 2004 SuperH, Inc.
- * Copyright (C) 2004, 2005 Paul Mundt
- *
- * SuperH SH4-202 MicroDev board support.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ioport.h>
-#include <video/s1d13xxxfb.h>
-#include <mach/microdev.h>
-#include <asm/io.h>
-#include <asm/machvec.h>
-#include <linux/sizes.h>
-
-static struct resource smc91x_resources[] = {
- [0] = {
- .start = 0x300,
- .end = 0x300 + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = MICRODEV_LINUX_IRQ_ETHERNET,
- .end = MICRODEV_LINUX_IRQ_ETHERNET,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device smc91x_device = {
- .name = "smc91x",
- .id = -1,
- .num_resources = ARRAY_SIZE(smc91x_resources),
- .resource = smc91x_resources,
-};
-
-static struct s1d13xxxfb_regval s1d13806_initregs[] = {
- { S1DREG_MISC, 0x00 },
- { S1DREG_COM_DISP_MODE, 0x00 },
- { S1DREG_GPIO_CNF0, 0x00 },
- { S1DREG_GPIO_CNF1, 0x00 },
- { S1DREG_GPIO_CTL0, 0x00 },
- { S1DREG_GPIO_CTL1, 0x00 },
- { S1DREG_CLK_CNF, 0x02 },
- { S1DREG_LCD_CLK_CNF, 0x01 },
- { S1DREG_CRT_CLK_CNF, 0x03 },
- { S1DREG_MPLUG_CLK_CNF, 0x03 },
- { S1DREG_CPU2MEM_WST_SEL, 0x02 },
- { S1DREG_SDRAM_REF_RATE, 0x03 },
- { S1DREG_SDRAM_TC0, 0x00 },
- { S1DREG_SDRAM_TC1, 0x01 },
- { S1DREG_MEM_CNF, 0x80 },
- { S1DREG_PANEL_TYPE, 0x25 },
- { S1DREG_MOD_RATE, 0x00 },
- { S1DREG_LCD_DISP_HWIDTH, 0x63 },
- { S1DREG_LCD_NDISP_HPER, 0x1e },
- { S1DREG_TFT_FPLINE_START, 0x06 },
- { S1DREG_TFT_FPLINE_PWIDTH, 0x03 },
- { S1DREG_LCD_DISP_VHEIGHT0, 0x57 },
- { S1DREG_LCD_DISP_VHEIGHT1, 0x02 },
- { S1DREG_LCD_NDISP_VPER, 0x00 },
- { S1DREG_TFT_FPFRAME_START, 0x0a },
- { S1DREG_TFT_FPFRAME_PWIDTH, 0x81 },
- { S1DREG_LCD_DISP_MODE, 0x03 },
- { S1DREG_LCD_MISC, 0x00 },
- { S1DREG_LCD_DISP_START0, 0x00 },
- { S1DREG_LCD_DISP_START1, 0x00 },
- { S1DREG_LCD_DISP_START2, 0x00 },
- { S1DREG_LCD_MEM_OFF0, 0x90 },
- { S1DREG_LCD_MEM_OFF1, 0x01 },
- { S1DREG_LCD_PIX_PAN, 0x00 },
- { S1DREG_LCD_DISP_FIFO_HTC, 0x00 },
- { S1DREG_LCD_DISP_FIFO_LTC, 0x00 },
- { S1DREG_CRT_DISP_HWIDTH, 0x63 },
- { S1DREG_CRT_NDISP_HPER, 0x1f },
- { S1DREG_CRT_HRTC_START, 0x04 },
- { S1DREG_CRT_HRTC_PWIDTH, 0x8f },
- { S1DREG_CRT_DISP_VHEIGHT0, 0x57 },
- { S1DREG_CRT_DISP_VHEIGHT1, 0x02 },
- { S1DREG_CRT_NDISP_VPER, 0x1b },
- { S1DREG_CRT_VRTC_START, 0x00 },
- { S1DREG_CRT_VRTC_PWIDTH, 0x83 },
- { S1DREG_TV_OUT_CTL, 0x10 },
- { S1DREG_CRT_DISP_MODE, 0x05 },
- { S1DREG_CRT_DISP_START0, 0x00 },
- { S1DREG_CRT_DISP_START1, 0x00 },
- { S1DREG_CRT_DISP_START2, 0x00 },
- { S1DREG_CRT_MEM_OFF0, 0x20 },
- { S1DREG_CRT_MEM_OFF1, 0x03 },
- { S1DREG_CRT_PIX_PAN, 0x00 },
- { S1DREG_CRT_DISP_FIFO_HTC, 0x00 },
- { S1DREG_CRT_DISP_FIFO_LTC, 0x00 },
- { S1DREG_LCD_CUR_CTL, 0x00 },
- { S1DREG_LCD_CUR_START, 0x01 },
- { S1DREG_LCD_CUR_XPOS0, 0x00 },
- { S1DREG_LCD_CUR_XPOS1, 0x00 },
- { S1DREG_LCD_CUR_YPOS0, 0x00 },
- { S1DREG_LCD_CUR_YPOS1, 0x00 },
- { S1DREG_LCD_CUR_BCTL0, 0x00 },
- { S1DREG_LCD_CUR_GCTL0, 0x00 },
- { S1DREG_LCD_CUR_RCTL0, 0x00 },
- { S1DREG_LCD_CUR_BCTL1, 0x1f },
- { S1DREG_LCD_CUR_GCTL1, 0x3f },
- { S1DREG_LCD_CUR_RCTL1, 0x1f },
- { S1DREG_LCD_CUR_FIFO_HTC, 0x00 },
- { S1DREG_CRT_CUR_CTL, 0x00 },
- { S1DREG_CRT_CUR_START, 0x01 },
- { S1DREG_CRT_CUR_XPOS0, 0x00 },
- { S1DREG_CRT_CUR_XPOS1, 0x00 },
- { S1DREG_CRT_CUR_YPOS0, 0x00 },
- { S1DREG_CRT_CUR_YPOS1, 0x00 },
- { S1DREG_CRT_CUR_BCTL0, 0x00 },
- { S1DREG_CRT_CUR_GCTL0, 0x00 },
- { S1DREG_CRT_CUR_RCTL0, 0x00 },
- { S1DREG_CRT_CUR_BCTL1, 0x1f },
- { S1DREG_CRT_CUR_GCTL1, 0x3f },
- { S1DREG_CRT_CUR_RCTL1, 0x1f },
- { S1DREG_CRT_CUR_FIFO_HTC, 0x00 },
- { S1DREG_BBLT_CTL0, 0x00 },
- { S1DREG_BBLT_CTL1, 0x00 },
- { S1DREG_BBLT_CC_EXP, 0x00 },
- { S1DREG_BBLT_OP, 0x00 },
- { S1DREG_BBLT_SRC_START0, 0x00 },
- { S1DREG_BBLT_SRC_START1, 0x00 },
- { S1DREG_BBLT_SRC_START2, 0x00 },
- { S1DREG_BBLT_DST_START0, 0x00 },
- { S1DREG_BBLT_DST_START1, 0x00 },
- { S1DREG_BBLT_DST_START2, 0x00 },
- { S1DREG_BBLT_MEM_OFF0, 0x00 },
- { S1DREG_BBLT_MEM_OFF1, 0x00 },
- { S1DREG_BBLT_WIDTH0, 0x00 },
- { S1DREG_BBLT_WIDTH1, 0x00 },
- { S1DREG_BBLT_HEIGHT0, 0x00 },
- { S1DREG_BBLT_HEIGHT1, 0x00 },
- { S1DREG_BBLT_BGC0, 0x00 },
- { S1DREG_BBLT_BGC1, 0x00 },
- { S1DREG_BBLT_FGC0, 0x00 },
- { S1DREG_BBLT_FGC1, 0x00 },
- { S1DREG_LKUP_MODE, 0x00 },
- { S1DREG_LKUP_ADDR, 0x00 },
- { S1DREG_PS_CNF, 0x10 },
- { S1DREG_PS_STATUS, 0x00 },
- { S1DREG_CPU2MEM_WDOGT, 0x00 },
- { S1DREG_COM_DISP_MODE, 0x02 },
-};
-
-static struct s1d13xxxfb_pdata s1d13806_platform_data = {
- .initregs = s1d13806_initregs,
- .initregssize = ARRAY_SIZE(s1d13806_initregs),
-};
-
-static struct resource s1d13806_resources[] = {
- [0] = {
- .start = 0x07200000,
- .end = 0x07200000 + SZ_2M - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 0x07000000,
- .end = 0x07000000 + SZ_2M - 1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device s1d13806_device = {
- .name = "s1d13806fb",
- .id = -1,
- .num_resources = ARRAY_SIZE(s1d13806_resources),
- .resource = s1d13806_resources,
-
- .dev = {
- .platform_data = &s1d13806_platform_data,
- },
-};
-
-static struct platform_device *microdev_devices[] __initdata = {
- &smc91x_device,
- &s1d13806_device,
-};
-
-static int __init microdev_devices_setup(void)
-{
- return platform_add_devices(microdev_devices, ARRAY_SIZE(microdev_devices));
-}
-device_initcall(microdev_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_sh4202_microdev __initmv = {
- .mv_name = "SH4-202 MicroDev",
- .mv_ioport_map = microdev_ioport_map,
- .mv_init_irq = init_microdev_irq,
-};
diff --git a/arch/sh/boards/mach-migor/Kconfig b/arch/sh/boards/mach-migor/Kconfig
deleted file mode 100644
index fb64a10e217065..00000000000000
--- a/arch/sh/boards/mach-migor/Kconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-if SH_MIGOR
-
-choice
- prompt "Migo-R LCD Panel Board Selection"
- default SH_MIGOR_QVGA
-
-config SH_MIGOR_QVGA
- bool "QVGA (320x240)"
-
-config SH_MIGOR_RTA_WVGA
- bool "RTA WVGA (800x480)"
-
-endchoice
-
-endif
diff --git a/arch/sh/boards/mach-migor/Makefile b/arch/sh/boards/mach-migor/Makefile
deleted file mode 100644
index c223d759fcb1ee..00000000000000
--- a/arch/sh/boards/mach-migor/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-y := setup.o sdram.o
-obj-$(CONFIG_SH_MIGOR_QVGA) += lcd_qvga.o
diff --git a/arch/sh/boards/mach-migor/lcd_qvga.c b/arch/sh/boards/mach-migor/lcd_qvga.c
deleted file mode 100644
index 4ebf130510bc6e..00000000000000
--- a/arch/sh/boards/mach-migor/lcd_qvga.c
+++ /dev/null
@@ -1,163 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Support for SuperH MigoR Quarter VGA LCD Panel
- *
- * Copyright (C) 2008 Magnus Damm
- *
- * Based on lcd_powertip.c from Kenati Technologies Pvt Ltd.
- * Copyright (c) 2007 Ujjwal Pande <[email protected]>,
- */
-
-#include <linux/delay.h>
-#include <linux/err.h>
-#include <linux/fb.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/gpio.h>
-#include <video/sh_mobile_lcdc.h>
-#include <cpu/sh7722.h>
-#include <mach/migor.h>
-
-/* LCD Module is a PH240320T according to board schematics. This module
- * is made up of a 240x320 LCD hooked up to a R61505U (or HX8347-A01?)
- * Driver IC. This IC is connected to the SH7722 built-in LCDC using a
- * SYS-80 interface configured in 16 bit mode.
- *
- * Index 0: "Device Code Read" returns 0x1505.
- */
-
-static void reset_lcd_module(void)
-{
- gpio_set_value(GPIO_PTH2, 0);
- mdelay(2);
- gpio_set_value(GPIO_PTH2, 1);
- mdelay(1);
-}
-
-/* DB0-DB7 are connected to D1-D8, and DB8-DB15 to D10-D17 */
-
-static unsigned long adjust_reg18(unsigned short data)
-{
- unsigned long tmp1, tmp2;
-
- tmp1 = (data<<1 | 0x00000001) & 0x000001FF;
- tmp2 = (data<<2 | 0x00000200) & 0x0003FE00;
- return tmp1 | tmp2;
-}
-
-static void write_reg(void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
- unsigned short reg, unsigned short data)
-{
- sys_ops->write_index(sys_ops_handle, adjust_reg18(reg << 8 | data));
-}
-
-static void write_reg16(void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
- unsigned short reg, unsigned short data)
-{
- sys_ops->write_index(sys_ops_handle, adjust_reg18(reg));
- sys_ops->write_data(sys_ops_handle, adjust_reg18(data));
-}
-
-static unsigned long read_reg16(void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
- unsigned short reg)
-{
- unsigned long data;
-
- sys_ops->write_index(sys_ops_handle, adjust_reg18(reg));
- data = sys_ops->read_data(sys_ops_handle);
- return ((data >> 1) & 0xff) | ((data >> 2) & 0xff00);
-}
-
-static void migor_lcd_qvga_seq(void *sys_ops_handle,
- struct sh_mobile_lcdc_sys_bus_ops *sys_ops,
- unsigned short const *data, int no_data)
-{
- int i;
-
- for (i = 0; i < no_data; i += 2)
- write_reg16(sys_ops_handle, sys_ops, data[i], data[i + 1]);
-}
-
-static const unsigned short sync_data[] = {
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-};
-
-static const unsigned short magic0_data[] = {
- 0x0060, 0x2700, 0x0008, 0x0808, 0x0090, 0x001A, 0x0007, 0x0001,
- 0x0017, 0x0001, 0x0019, 0x0000, 0x0010, 0x17B0, 0x0011, 0x0116,
- 0x0012, 0x0198, 0x0013, 0x1400, 0x0029, 0x000C, 0x0012, 0x01B8,
-};
-
-static const unsigned short magic1_data[] = {
- 0x0030, 0x0307, 0x0031, 0x0303, 0x0032, 0x0603, 0x0033, 0x0202,
- 0x0034, 0x0202, 0x0035, 0x0202, 0x0036, 0x1F1F, 0x0037, 0x0303,
- 0x0038, 0x0303, 0x0039, 0x0603, 0x003A, 0x0202, 0x003B, 0x0102,
- 0x003C, 0x0204, 0x003D, 0x0000, 0x0001, 0x0100, 0x0002, 0x0300,
- 0x0003, 0x5028, 0x0020, 0x00ef, 0x0021, 0x0000, 0x0004, 0x0000,
- 0x0009, 0x0000, 0x000A, 0x0008, 0x000C, 0x0000, 0x000D, 0x0000,
- 0x0015, 0x8000,
-};
-
-static const unsigned short magic2_data[] = {
- 0x0061, 0x0001, 0x0092, 0x0100, 0x0093, 0x0001, 0x0007, 0x0021,
-};
-
-static const unsigned short magic3_data[] = {
- 0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061,
-};
-
-int migor_lcd_qvga_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
-{
- unsigned long xres = 320;
- unsigned long yres = 240;
- int k;
-
- reset_lcd_module();
- migor_lcd_qvga_seq(sohandle, so, sync_data, ARRAY_SIZE(sync_data));
-
- if (read_reg16(sohandle, so, 0) != 0x1505)
- return -ENODEV;
-
- pr_info("Migo-R QVGA LCD Module detected.\n");
-
- migor_lcd_qvga_seq(sohandle, so, sync_data, ARRAY_SIZE(sync_data));
- write_reg16(sohandle, so, 0x00A4, 0x0001);
- mdelay(10);
-
- migor_lcd_qvga_seq(sohandle, so, magic0_data, ARRAY_SIZE(magic0_data));
- mdelay(100);
-
- migor_lcd_qvga_seq(sohandle, so, magic1_data, ARRAY_SIZE(magic1_data));
- write_reg16(sohandle, so, 0x0050, 0xef - (yres - 1));
- write_reg16(sohandle, so, 0x0051, 0x00ef);
- write_reg16(sohandle, so, 0x0052, 0x0000);
- write_reg16(sohandle, so, 0x0053, xres - 1);
-
- migor_lcd_qvga_seq(sohandle, so, magic2_data, ARRAY_SIZE(magic2_data));
- mdelay(10);
-
- migor_lcd_qvga_seq(sohandle, so, magic3_data, ARRAY_SIZE(magic3_data));
- mdelay(40);
-
- /* clear GRAM to avoid displaying garbage */
-
- write_reg16(sohandle, so, 0x0020, 0x0000); /* horiz addr */
- write_reg16(sohandle, so, 0x0021, 0x0000); /* vert addr */
-
- for (k = 0; k < (xres * 256); k++) /* yes, 256 words per line */
- write_reg16(sohandle, so, 0x0022, 0x0000);
-
- write_reg16(sohandle, so, 0x0020, 0x0000); /* reset horiz addr */
- write_reg16(sohandle, so, 0x0021, 0x0000); /* reset vert addr */
- write_reg16(sohandle, so, 0x0007, 0x0173);
- mdelay(40);
-
- /* enable display */
- write_reg(sohandle, so, 0x00, 0x22);
- mdelay(100);
- return 0;
-}
diff --git a/arch/sh/boards/mach-migor/sdram.S b/arch/sh/boards/mach-migor/sdram.S
deleted file mode 100644
index 3a6bee1270aaf7..00000000000000
--- a/arch/sh/boards/mach-migor/sdram.S
+++ /dev/null
@@ -1,66 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
- * Migo-R sdram self/auto-refresh setup code
- *
- * Copyright (C) 2009 Magnus Damm
- */
-
-#include <linux/sys.h>
-#include <linux/errno.h>
-#include <linux/linkage.h>
-#include <asm/asm-offsets.h>
-#include <asm/suspend.h>
-#include <asm/romimage-macros.h>
-
-/* code to enter and leave self-refresh. must be self-contained.
- * this code will be copied to on-chip memory and executed from there.
- */
- .balign 4
-ENTRY(migor_sdram_enter_start)
-
- /* SBSC: disable power down and put in self-refresh mode */
- mov.l 1f, r4
- mov.l 2f, r1
- mov.l @r4, r2
- or r1, r2
- mov.l 3f, r3
- and r3, r2
- mov.l r2, @r4
-
- rts
- nop
-
- .balign 4
-1: .long 0xfe400008 /* SDCR0 */
-2: .long 0x00000400
-3: .long 0xffff7fff
-ENTRY(migor_sdram_enter_end)
-
- .balign 4
-ENTRY(migor_sdram_leave_start)
-
- /* SBSC: set auto-refresh mode */
- mov.l 1f, r4
- mov.l @r4, r0
- mov.l 4f, r1
- and r1, r0
- mov.l r0, @r4
- mov.l 6f, r4
- mov.l 8f, r0
- mov.l @r4, r1
- mov #-1, r4
- add r4, r1
- or r1, r0
- mov.l 7f, r1
- mov.l r0, @r1
-
- rts
- nop
-
- .balign 4
-1: .long 0xfe400008 /* SDCR0 */
-4: .long 0xfffffbff
-6: .long 0xfe40001c /* RTCOR */
-7: .long 0xfe400018 /* RTCNT */
-8: .long 0xa55a0000
-ENTRY(migor_sdram_leave_end)
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
deleted file mode 100644
index f60061283c4827..00000000000000
--- a/arch/sh/boards/mach-migor/setup.c
+++ /dev/null
@@ -1,649 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Renesas System Solutions Asia Pte. Ltd - Migo-R
- *
- * Copyright (C) 2008 Magnus Damm
- */
-#include <linux/clkdev.h>
-#include <linux/dma-map-ops.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/input/sh_keysc.h>
-#include <linux/memblock.h>
-#include <linux/mmc/host.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mfd/tmio.h>
-#include <linux/mtd/platnand.h>
-#include <linux/i2c.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/smc91x.h>
-#include <linux/delay.h>
-#include <linux/clk.h>
-#include <linux/gpio.h>
-#include <linux/gpio/machine.h>
-#include <linux/videodev2.h>
-#include <linux/sh_intc.h>
-#include <video/sh_mobile_lcdc.h>
-#include <media/drv-intf/renesas-ceu.h>
-#include <media/i2c/ov772x.h>
-#include <media/i2c/tw9910.h>
-#include <asm/clock.h>
-#include <asm/machvec.h>
-#include <asm/io.h>
-#include <asm/suspend.h>
-#include <mach/migor.h>
-#include <cpu/sh7722.h>
-
-/* Address IRQ Size Bus Description
- * 0x00000000 64MB 16 NOR Flash (SP29PL256N)
- * 0x0c000000 64MB 64 SDRAM (2xK4M563233G)
- * 0x10000000 IRQ0 16 Ethernet (SMC91C111)
- * 0x14000000 IRQ4 16 USB 2.0 Host Controller (M66596)
- * 0x18000000 8GB 8 NAND Flash (K9K8G08U0A)
- */
-
-#define CEU_BUFFER_MEMORY_SIZE (4 << 20)
-static phys_addr_t ceu_dma_membase;
-
-static struct smc91x_platdata smc91x_info = {
- .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
-};
-
-static struct resource smc91x_eth_resources[] = {
- [0] = {
- .name = "SMC91C111" ,
- .start = 0x10000300,
- .end = 0x1000030f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x600), /* IRQ0 */
- .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
- },
-};
-
-static struct platform_device smc91x_eth_device = {
- .name = "smc91x",
- .num_resources = ARRAY_SIZE(smc91x_eth_resources),
- .resource = smc91x_eth_resources,
- .dev = {
- .platform_data = &smc91x_info,
- },
-};
-
-static struct sh_keysc_info sh_keysc_info = {
- .mode = SH_KEYSC_MODE_2, /* KEYOUT0->4, KEYIN1->5 */
- .scan_timing = 3,
- .delay = 5,
- .keycodes = {
- 0, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_ENTER,
- 0, KEY_F, KEY_C, KEY_D, KEY_H, KEY_1,
- 0, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6,
- 0, KEY_7, KEY_8, KEY_9, KEY_S, KEY_0,
- 0, KEY_P, KEY_STOP, KEY_REWIND, KEY_PLAY, KEY_FASTFORWARD,
- },
-};
-
-static struct resource sh_keysc_resources[] = {
- [0] = {
- .start = 0x044b0000,
- .end = 0x044b000f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xbe0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device sh_keysc_device = {
- .name = "sh_keysc",
- .id = 0, /* "keysc0" clock */
- .num_resources = ARRAY_SIZE(sh_keysc_resources),
- .resource = sh_keysc_resources,
- .dev = {
- .platform_data = &sh_keysc_info,
- },
-};
-
-static struct mtd_partition migor_nor_flash_partitions[] =
-{
- {
- .name = "uboot",
- .offset = 0,
- .size = (1 * 1024 * 1024),
- .mask_flags = MTD_WRITEABLE, /* Read-only */
- },
- {
- .name = "rootfs",
- .offset = MTDPART_OFS_APPEND,
- .size = (15 * 1024 * 1024),
- },
- {
- .name = "other",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data migor_nor_flash_data = {
- .width = 2,
- .parts = migor_nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(migor_nor_flash_partitions),
-};
-
-static struct resource migor_nor_flash_resources[] = {
- [0] = {
- .name = "NOR Flash",
- .start = 0x00000000,
- .end = 0x03ffffff,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device migor_nor_flash_device = {
- .name = "physmap-flash",
- .resource = migor_nor_flash_resources,
- .num_resources = ARRAY_SIZE(migor_nor_flash_resources),
- .dev = {
- .platform_data = &migor_nor_flash_data,
- },
-};
-
-static struct mtd_partition migor_nand_flash_partitions[] = {
- {
- .name = "nanddata1",
- .offset = 0x0,
- .size = 512 * 1024 * 1024,
- },
- {
- .name = "nanddata2",
- .offset = MTDPART_OFS_APPEND,
- .size = 512 * 1024 * 1024,
- },
-};
-
-static void migor_nand_flash_cmd_ctl(struct nand_chip *chip, int cmd,
- unsigned int ctrl)
-{
- if (cmd == NAND_CMD_NONE)
- return;
-
- if (ctrl & NAND_CLE)
- writeb(cmd, chip->legacy.IO_ADDR_W + 0x00400000);
- else if (ctrl & NAND_ALE)
- writeb(cmd, chip->legacy.IO_ADDR_W + 0x00800000);
- else
- writeb(cmd, chip->legacy.IO_ADDR_W);
-}
-
-static int migor_nand_flash_ready(struct nand_chip *chip)
-{
- return gpio_get_value(GPIO_PTA1); /* NAND_RBn */
-}
-
-static struct platform_nand_data migor_nand_flash_data = {
- .chip = {
- .nr_chips = 1,
- .partitions = migor_nand_flash_partitions,
- .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions),
- .chip_delay = 20,
- },
- .ctrl = {
- .dev_ready = migor_nand_flash_ready,
- .cmd_ctrl = migor_nand_flash_cmd_ctl,
- },
-};
-
-static struct resource migor_nand_flash_resources[] = {
- [0] = {
- .name = "NAND Flash",
- .start = 0x18000000,
- .end = 0x18ffffff,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device migor_nand_flash_device = {
- .name = "gen_nand",
- .resource = migor_nand_flash_resources,
- .num_resources = ARRAY_SIZE(migor_nand_flash_resources),
- .dev = {
- .platform_data = &migor_nand_flash_data,
- }
-};
-
-static const struct fb_videomode migor_lcd_modes[] = {
- {
-#if defined(CONFIG_SH_MIGOR_RTA_WVGA)
- .name = "LB070WV1",
- .xres = 800,
- .yres = 480,
- .left_margin = 64,
- .right_margin = 16,
- .hsync_len = 120,
- .sync = 0,
-#elif defined(CONFIG_SH_MIGOR_QVGA)
- .name = "PH240320T",
- .xres = 320,
- .yres = 240,
- .left_margin = 0,
- .right_margin = 16,
- .hsync_len = 8,
- .sync = FB_SYNC_HOR_HIGH_ACT,
-#endif
- .upper_margin = 1,
- .lower_margin = 17,
- .vsync_len = 2,
- },
-};
-
-static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
-#if defined(CONFIG_SH_MIGOR_RTA_WVGA)
- .clock_source = LCDC_CLK_BUS,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
- .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = RGB16,
- .clock_divider = 2,
- .lcd_modes = migor_lcd_modes,
- .num_modes = ARRAY_SIZE(migor_lcd_modes),
- .panel_cfg = { /* 7.0 inch */
- .width = 152,
- .height = 91,
- },
- }
-#elif defined(CONFIG_SH_MIGOR_QVGA)
- .clock_source = LCDC_CLK_PERIPHERAL,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
- .fourcc = V4L2_PIX_FMT_RGB565,
- .interface_type = SYS16A,
- .clock_divider = 10,
- .lcd_modes = migor_lcd_modes,
- .num_modes = ARRAY_SIZE(migor_lcd_modes),
- .panel_cfg = {
- .width = 49, /* 2.4 inch */
- .height = 37,
- .setup_sys = migor_lcd_qvga_setup,
- },
- .sys_bus_cfg = {
- .ldmt2r = 0x06000a09,
- .ldmt3r = 0x180e3418,
- /* set 1s delay to encourage fsync() */
- .deferred_io_msec = 1000,
- },
- }
-#endif
-};
-
-static struct resource migor_lcdc_resources[] = {
- [0] = {
- .name = "LCDC",
- .start = 0xfe940000, /* P4-only space */
- .end = 0xfe942fff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x580),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device migor_lcdc_device = {
- .name = "sh_mobile_lcdc_fb",
- .num_resources = ARRAY_SIZE(migor_lcdc_resources),
- .resource = migor_lcdc_resources,
- .dev = {
- .platform_data = &sh_mobile_lcdc_info,
- },
-};
-
-static struct ceu_platform_data ceu_pdata = {
- .num_subdevs = 2,
- .subdevs = {
- { /* [0] = ov772x */
- .flags = 0,
- .bus_width = 8,
- .bus_shift = 0,
- .i2c_adapter_id = 0,
- .i2c_address = 0x21,
- },
- { /* [1] = tw9910 */
- .flags = 0,
- .bus_width = 8,
- .bus_shift = 0,
- .i2c_adapter_id = 0,
- .i2c_address = 0x45,
- },
- },
-};
-
-static struct resource migor_ceu_resources[] = {
- [0] = {
- .name = "CEU",
- .start = 0xfe910000,
- .end = 0xfe91009f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x880),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device migor_ceu_device = {
- .name = "renesas-ceu",
- .id = 0, /* ceu.0 */
- .num_resources = ARRAY_SIZE(migor_ceu_resources),
- .resource = migor_ceu_resources,
- .dev = {
- .platform_data = &ceu_pdata,
- },
-};
-
-/* Powerdown/reset gpios for CEU image sensors */
-static struct gpiod_lookup_table ov7725_gpios = {
- .dev_id = "0-0021",
- .table = {
- GPIO_LOOKUP("sh7722_pfc", GPIO_PTT0, "powerdown",
- GPIO_ACTIVE_HIGH),
- GPIO_LOOKUP("sh7722_pfc", GPIO_PTT3, "reset", GPIO_ACTIVE_LOW),
- },
-};
-
-static struct gpiod_lookup_table tw9910_gpios = {
- .dev_id = "0-0045",
- .table = {
- GPIO_LOOKUP("sh7722_pfc", GPIO_PTT2, "pdn", GPIO_ACTIVE_LOW),
- GPIO_LOOKUP("sh7722_pfc", GPIO_PTT3, "rstb", GPIO_ACTIVE_LOW),
- },
-};
-
-/* Fixed 3.3V regulator to be used by SDHI0 */
-static struct regulator_consumer_supply fixed3v3_power_consumers[] =
-{
- REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
- REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
-};
-
-static struct resource sdhi_cn9_resources[] = {
- [0] = {
- .name = "SDHI",
- .start = 0x04ce0000,
- .end = 0x04ce00ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xe80),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct tmio_mmc_data sh7724_sdhi_data = {
- .chan_priv_tx = (void *)SHDMA_SLAVE_SDHI0_TX,
- .chan_priv_rx = (void *)SHDMA_SLAVE_SDHI0_RX,
- .capabilities = MMC_CAP_SDIO_IRQ,
-};
-
-static struct platform_device sdhi_cn9_device = {
- .name = "sh_mobile_sdhi",
- .num_resources = ARRAY_SIZE(sdhi_cn9_resources),
- .resource = sdhi_cn9_resources,
- .dev = {
- .platform_data = &sh7724_sdhi_data,
- },
-};
-
-static struct ov772x_camera_info ov7725_info = {
- .flags = 0,
-};
-
-static struct tw9910_video_info tw9910_info = {
- .buswidth = 8,
- .mpout = TW9910_MPO_FIELD,
-};
-
-static struct i2c_board_info migor_i2c_devices[] = {
- {
- I2C_BOARD_INFO("rs5c372b", 0x32),
- },
- {
- I2C_BOARD_INFO("migor_ts", 0x51),
- .irq = evt2irq(0x6c0), /* IRQ6 */
- },
- {
- I2C_BOARD_INFO("wm8978", 0x1a),
- },
- {
- I2C_BOARD_INFO("ov772x", 0x21),
- .platform_data = &ov7725_info,
- },
- {
- I2C_BOARD_INFO("tw9910", 0x45),
- .platform_data = &tw9910_info,
- },
-};
-
-static struct platform_device *migor_devices[] __initdata = {
- &smc91x_eth_device,
- &sh_keysc_device,
- &migor_lcdc_device,
- &migor_nor_flash_device,
- &migor_nand_flash_device,
- &sdhi_cn9_device,
-};
-
-extern char migor_sdram_enter_start;
-extern char migor_sdram_enter_end;
-extern char migor_sdram_leave_start;
-extern char migor_sdram_leave_end;
-
-static int __init migor_devices_setup(void)
-{
- struct clk *video_clk;
-
- /* register board specific self-refresh code */
- sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF,
- &migor_sdram_enter_start,
- &migor_sdram_enter_end,
- &migor_sdram_leave_start,
- &migor_sdram_leave_end);
-
- regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
- ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
-
- /* Let D11 LED show STATUS0 */
- gpio_request(GPIO_FN_STATUS0, NULL);
-
- /* Lit D12 LED show PDSTATUS */
- gpio_request(GPIO_FN_PDSTATUS, NULL);
-
- /* SMC91C111 - Enable IRQ0, Setup CS4 for 16-bit fast access */
- gpio_request(GPIO_FN_IRQ0, NULL);
- __raw_writel(0x00003400, BSC_CS4BCR);
- __raw_writel(0x00110080, BSC_CS4WCR);
-
- /* KEYSC */
- gpio_request(GPIO_FN_KEYOUT0, NULL);
- gpio_request(GPIO_FN_KEYOUT1, NULL);
- gpio_request(GPIO_FN_KEYOUT2, NULL);
- gpio_request(GPIO_FN_KEYOUT3, NULL);
- gpio_request(GPIO_FN_KEYOUT4_IN6, NULL);
- gpio_request(GPIO_FN_KEYIN1, NULL);
- gpio_request(GPIO_FN_KEYIN2, NULL);
- gpio_request(GPIO_FN_KEYIN3, NULL);
- gpio_request(GPIO_FN_KEYIN4, NULL);
- gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
-
- /* NAND Flash */
- gpio_request(GPIO_FN_CS6A_CE2B, NULL);
- __raw_writel((__raw_readl(BSC_CS6ABCR) & ~0x0600) | 0x0200, BSC_CS6ABCR);
- gpio_request(GPIO_PTA1, NULL);
- gpio_direction_input(GPIO_PTA1);
-
- /* SDHI */
- gpio_request(GPIO_FN_SDHICD, NULL);
- gpio_request(GPIO_FN_SDHIWP, NULL);
- gpio_request(GPIO_FN_SDHID3, NULL);
- gpio_request(GPIO_FN_SDHID2, NULL);
- gpio_request(GPIO_FN_SDHID1, NULL);
- gpio_request(GPIO_FN_SDHID0, NULL);
- gpio_request(GPIO_FN_SDHICMD, NULL);
- gpio_request(GPIO_FN_SDHICLK, NULL);
-
- /* Touch Panel */
- gpio_request(GPIO_FN_IRQ6, NULL);
-
- /* LCD Panel */
-#ifdef CONFIG_SH_MIGOR_QVGA /* LCDC - QVGA - Enable SYS Interface signals */
- gpio_request(GPIO_FN_LCDD17, NULL);
- gpio_request(GPIO_FN_LCDD16, NULL);
- gpio_request(GPIO_FN_LCDD15, NULL);
- gpio_request(GPIO_FN_LCDD14, NULL);
- gpio_request(GPIO_FN_LCDD13, NULL);
- gpio_request(GPIO_FN_LCDD12, NULL);
- gpio_request(GPIO_FN_LCDD11, NULL);
- gpio_request(GPIO_FN_LCDD10, NULL);
- gpio_request(GPIO_FN_LCDD8, NULL);
- gpio_request(GPIO_FN_LCDD7, NULL);
- gpio_request(GPIO_FN_LCDD6, NULL);
- gpio_request(GPIO_FN_LCDD5, NULL);
- gpio_request(GPIO_FN_LCDD4, NULL);
- gpio_request(GPIO_FN_LCDD3, NULL);
- gpio_request(GPIO_FN_LCDD2, NULL);
- gpio_request(GPIO_FN_LCDD1, NULL);
- gpio_request(GPIO_FN_LCDRS, NULL);
- gpio_request(GPIO_FN_LCDCS, NULL);
- gpio_request(GPIO_FN_LCDRD, NULL);
- gpio_request(GPIO_FN_LCDWR, NULL);
- gpio_request(GPIO_PTH2, NULL); /* LCD_DON */
- gpio_direction_output(GPIO_PTH2, 1);
-#endif
-#ifdef CONFIG_SH_MIGOR_RTA_WVGA /* LCDC - WVGA - Enable RGB Interface signals */
- gpio_request(GPIO_FN_LCDD15, NULL);
- gpio_request(GPIO_FN_LCDD14, NULL);
- gpio_request(GPIO_FN_LCDD13, NULL);
- gpio_request(GPIO_FN_LCDD12, NULL);
- gpio_request(GPIO_FN_LCDD11, NULL);
- gpio_request(GPIO_FN_LCDD10, NULL);
- gpio_request(GPIO_FN_LCDD9, NULL);
- gpio_request(GPIO_FN_LCDD8, NULL);
- gpio_request(GPIO_FN_LCDD7, NULL);
- gpio_request(GPIO_FN_LCDD6, NULL);
- gpio_request(GPIO_FN_LCDD5, NULL);
- gpio_request(GPIO_FN_LCDD4, NULL);
- gpio_request(GPIO_FN_LCDD3, NULL);
- gpio_request(GPIO_FN_LCDD2, NULL);
- gpio_request(GPIO_FN_LCDD1, NULL);
- gpio_request(GPIO_FN_LCDD0, NULL);
- gpio_request(GPIO_FN_LCDLCLK, NULL);
- gpio_request(GPIO_FN_LCDDCK, NULL);
- gpio_request(GPIO_FN_LCDVEPWC, NULL);
- gpio_request(GPIO_FN_LCDVCPWC, NULL);
- gpio_request(GPIO_FN_LCDVSYN, NULL);
- gpio_request(GPIO_FN_LCDHSYN, NULL);
- gpio_request(GPIO_FN_LCDDISP, NULL);
- gpio_request(GPIO_FN_LCDDON, NULL);
-#endif
-
- /* CEU */
- gpio_request(GPIO_FN_VIO_CLK2, NULL);
- gpio_request(GPIO_FN_VIO_VD2, NULL);
- gpio_request(GPIO_FN_VIO_HD2, NULL);
- gpio_request(GPIO_FN_VIO_FLD, NULL);
- gpio_request(GPIO_FN_VIO_CKO, NULL);
- gpio_request(GPIO_FN_VIO_D15, NULL);
- gpio_request(GPIO_FN_VIO_D14, NULL);
- gpio_request(GPIO_FN_VIO_D13, NULL);
- gpio_request(GPIO_FN_VIO_D12, NULL);
- gpio_request(GPIO_FN_VIO_D11, NULL);
- gpio_request(GPIO_FN_VIO_D10, NULL);
- gpio_request(GPIO_FN_VIO_D9, NULL);
- gpio_request(GPIO_FN_VIO_D8, NULL);
-
- __raw_writew(__raw_readw(PORT_MSELCRB) | 0x2000, PORT_MSELCRB); /* D15->D8 */
-
- /* SIU: Port B */
- gpio_request(GPIO_FN_SIUBOLR, NULL);
- gpio_request(GPIO_FN_SIUBOBT, NULL);
- gpio_request(GPIO_FN_SIUBISLD, NULL);
- gpio_request(GPIO_FN_SIUBOSLD, NULL);
- gpio_request(GPIO_FN_SIUMCKB, NULL);
-
- /*
- * The original driver sets SIUB OLR/OBT, ILR/IBT, and SIUA OLR/OBT to
- * output. Need only SIUB, set to output for master mode (table 34.2)
- */
- __raw_writew(__raw_readw(PORT_MSELCRA) | 1, PORT_MSELCRA);
-
- /*
- * Use 10 MHz VIO_CKO instead of 24 MHz to work around signal quality
- * issues on Panel Board V2.1.
- */
- video_clk = clk_get(NULL, "video_clk");
- if (!IS_ERR(video_clk)) {
- clk_set_rate(video_clk, clk_round_rate(video_clk, 10000000));
- clk_put(video_clk);
- }
-
- /* Add a clock alias for ov7725 xclk source. */
- clk_add_alias(NULL, "0-0021", "video_clk", NULL);
-
- /* Register GPIOs for video sources. */
- gpiod_add_lookup_table(&ov7725_gpios);
- gpiod_add_lookup_table(&tw9910_gpios);
-
- i2c_register_board_info(0, migor_i2c_devices,
- ARRAY_SIZE(migor_i2c_devices));
-
- /* Initialize CEU platform device separately to map memory first */
- device_initialize(&migor_ceu_device.dev);
- dma_declare_coherent_memory(&migor_ceu_device.dev,
- ceu_dma_membase, ceu_dma_membase,
- ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1);
-
- platform_device_add(&migor_ceu_device);
-
- return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices));
-}
-arch_initcall(migor_devices_setup);
-
-/* Return the board specific boot mode pin configuration */
-static int migor_mode_pins(void)
-{
- /* MD0=1, MD1=1, MD2=0: Clock Mode 3
- * MD3=0: 16-bit Area0 Bus Width
- * MD5=1: Little Endian
- * TSTMD=1, MD8=0: Test Mode Disabled
- */
- return MODE_PIN0 | MODE_PIN1 | MODE_PIN5;
-}
-
-/* Reserve a portion of memory for CEU buffers */
-static void __init migor_mv_mem_reserve(void)
-{
- phys_addr_t phys;
- phys_addr_t size = CEU_BUFFER_MEMORY_SIZE;
-
- phys = memblock_phys_alloc(size, PAGE_SIZE);
- if (!phys)
- panic("Failed to allocate CEU memory\n");
-
- memblock_phys_free(phys, size);
- memblock_remove(phys, size);
-
- ceu_dma_membase = phys;
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_migor __initmv = {
- .mv_name = "Migo-R",
- .mv_mode_pins = migor_mode_pins,
- .mv_mem_reserve = migor_mv_mem_reserve,
-};
diff --git a/arch/sh/boards/mach-r2d/Kconfig b/arch/sh/boards/mach-r2d/Kconfig
deleted file mode 100644
index 21770e668de283..00000000000000
--- a/arch/sh/boards/mach-r2d/Kconfig
+++ /dev/null
@@ -1,24 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-if SH_RTS7751R2D
-
-menu "RTS7751R2D Board Revision"
-
-config RTS7751R2D_PLUS
- bool "R2D-PLUS"
- help
- Selecting this option will configure the kernel for R2D-PLUS.
-
- R2D-PLUS is the smaller of the two R2D board versions, equipped
- with a single PCI slot.
-
-config RTS7751R2D_1
- bool "R2D-1"
- help
- Selecting this option will configure the kernel for R2D-1.
-
- R2D-1 is the larger of the two R2D board versions, equipped
- with two PCI slots.
-endmenu
-
-endif
-
diff --git a/arch/sh/boards/mach-r2d/Makefile b/arch/sh/boards/mach-r2d/Makefile
deleted file mode 100644
index 7e7ac5e0566211..00000000000000
--- a/arch/sh/boards/mach-r2d/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the RTS7751R2D specific parts of the kernel
-#
-
-obj-y := setup.o irq.o
diff --git a/arch/sh/boards/mach-r2d/irq.c b/arch/sh/boards/mach-r2d/irq.c
deleted file mode 100644
index e34f81e9ae813b..00000000000000
--- a/arch/sh/boards/mach-r2d/irq.c
+++ /dev/null
@@ -1,156 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/renesas/rts7751r2d/irq.c
- *
- * Copyright (C) 2007 Magnus Damm
- * Copyright (C) 2000 Kazumoto Kojima
- *
- * Renesas Technology Sales RTS7751R2D Support, R2D-PLUS and R2D-1.
- *
- * Modified for RTS7751R2D by
- * Atom Create Engineering Co., Ltd. 2002.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <mach/r2d.h>
-
-#define R2D_NR_IRL 13
-
-enum {
- UNUSED = 0,
-
- /* board specific interrupt sources (R2D-1 and R2D-PLUS) */
- EXT, /* EXT_INT0-3 */
- RTC_T, RTC_A, /* Real Time Clock */
- AX88796, /* Ethernet controller (R2D-1 board) */
- KEY, /* Key input (R2D-PLUS board) */
- SDCARD, /* SD Card */
- CF_CD, CF_IDE, /* CF Card Detect + CF IDE */
- SM501, /* SM501 aka Voyager */
- PCI_INTD_RTL8139, /* Ethernet controller */
- PCI_INTC_PCI1520, /* Cardbus/PCMCIA bridge */
- PCI_INTB_RTL8139, /* Ethernet controller with HUB (R2D-PLUS board) */
- PCI_INTB_SLOT, /* PCI Slot 3.3v (R2D-1 board) */
- PCI_INTA_SLOT, /* PCI Slot 3.3v */
- TP, /* Touch Panel */
-};
-
-#ifdef CONFIG_RTS7751R2D_1
-
-/* Vectors for R2D-1 */
-static struct intc_vect vectors_r2d_1[] __initdata = {
- INTC_IRQ(EXT, IRQ_EXT),
- INTC_IRQ(RTC_T, IRQ_RTC_T), INTC_IRQ(RTC_A, IRQ_RTC_A),
- INTC_IRQ(AX88796, IRQ_AX88796), INTC_IRQ(SDCARD, IRQ_SDCARD),
- INTC_IRQ(CF_CD, IRQ_CF_CD), INTC_IRQ(CF_IDE, IRQ_CF_IDE), /* ng */
- INTC_IRQ(SM501, IRQ_VOYAGER),
- INTC_IRQ(PCI_INTD_RTL8139, IRQ_PCI_INTD),
- INTC_IRQ(PCI_INTC_PCI1520, IRQ_PCI_INTC),
- INTC_IRQ(PCI_INTB_SLOT, IRQ_PCI_INTB),
- INTC_IRQ(PCI_INTA_SLOT, IRQ_PCI_INTA),
- INTC_IRQ(TP, IRQ_TP),
-};
-
-/* IRLMSK mask register layout for R2D-1 */
-static struct intc_mask_reg mask_registers_r2d_1[] __initdata = {
- { 0xa4000000, 0, 16, /* IRLMSK */
- { TP, PCI_INTA_SLOT, PCI_INTB_SLOT,
- PCI_INTC_PCI1520, PCI_INTD_RTL8139,
- SM501, CF_IDE, CF_CD, SDCARD, AX88796,
- RTC_A, RTC_T, 0, 0, 0, EXT } },
-};
-
-/* IRLn to IRQ table for R2D-1 */
-static unsigned char irl2irq_r2d_1[R2D_NR_IRL] __initdata = {
- IRQ_PCI_INTD, IRQ_CF_IDE, IRQ_CF_CD, IRQ_PCI_INTC,
- IRQ_VOYAGER, IRQ_AX88796, IRQ_RTC_A, IRQ_RTC_T,
- IRQ_SDCARD, IRQ_PCI_INTA, IRQ_PCI_INTB, IRQ_EXT,
- IRQ_TP,
-};
-
-static DECLARE_INTC_DESC(intc_desc_r2d_1, "r2d-1", vectors_r2d_1,
- NULL, mask_registers_r2d_1, NULL, NULL);
-
-#endif /* CONFIG_RTS7751R2D_1 */
-
-#ifdef CONFIG_RTS7751R2D_PLUS
-
-/* Vectors for R2D-PLUS */
-static struct intc_vect vectors_r2d_plus[] __initdata = {
- INTC_IRQ(EXT, IRQ_EXT),
- INTC_IRQ(RTC_T, IRQ_RTC_T), INTC_IRQ(RTC_A, IRQ_RTC_A),
- INTC_IRQ(KEY, IRQ_KEY), INTC_IRQ(SDCARD, IRQ_SDCARD),
- INTC_IRQ(CF_CD, IRQ_CF_CD), INTC_IRQ(CF_IDE, IRQ_CF_IDE),
- INTC_IRQ(SM501, IRQ_VOYAGER),
- INTC_IRQ(PCI_INTD_RTL8139, IRQ_PCI_INTD),
- INTC_IRQ(PCI_INTC_PCI1520, IRQ_PCI_INTC),
- INTC_IRQ(PCI_INTB_RTL8139, IRQ_PCI_INTB),
- INTC_IRQ(PCI_INTA_SLOT, IRQ_PCI_INTA),
- INTC_IRQ(TP, IRQ_TP),
-};
-
-/* IRLMSK mask register layout for R2D-PLUS */
-static struct intc_mask_reg mask_registers_r2d_plus[] __initdata = {
- { 0xa4000000, 0, 16, /* IRLMSK */
- { TP, PCI_INTA_SLOT, PCI_INTB_RTL8139,
- PCI_INTC_PCI1520, PCI_INTD_RTL8139,
- SM501, CF_IDE, CF_CD, SDCARD, KEY,
- RTC_A, RTC_T, 0, 0, 0, EXT } },
-};
-
-/* IRLn to IRQ table for R2D-PLUS */
-static unsigned char irl2irq_r2d_plus[R2D_NR_IRL] __initdata = {
- IRQ_PCI_INTD, IRQ_CF_IDE, IRQ_CF_CD, IRQ_PCI_INTC,
- IRQ_VOYAGER, IRQ_KEY, IRQ_RTC_A, IRQ_RTC_T,
- IRQ_SDCARD, IRQ_PCI_INTA, IRQ_PCI_INTB, IRQ_EXT,
- IRQ_TP,
-};
-
-static DECLARE_INTC_DESC(intc_desc_r2d_plus, "r2d-plus", vectors_r2d_plus,
- NULL, mask_registers_r2d_plus, NULL, NULL);
-
-#endif /* CONFIG_RTS7751R2D_PLUS */
-
-static unsigned char irl2irq[R2D_NR_IRL];
-
-int rts7751r2d_irq_demux(int irq)
-{
- if (irq >= R2D_NR_IRL || irq < 0 || !irl2irq[irq])
- return irq;
-
- return irl2irq[irq];
-}
-
-/*
- * Initialize IRQ setting
- */
-void __init init_rts7751r2d_IRQ(void)
-{
- struct intc_desc *d;
-
- switch (__raw_readw(PA_VERREG) & 0xf0) {
-#ifdef CONFIG_RTS7751R2D_PLUS
- case 0x10:
- printk(KERN_INFO "Using R2D-PLUS interrupt controller.\n");
- d = &intc_desc_r2d_plus;
- memcpy(irl2irq, irl2irq_r2d_plus, R2D_NR_IRL);
- break;
-#endif
-#ifdef CONFIG_RTS7751R2D_1
- case 0x00: /* according to manual */
- case 0x30: /* in reality */
- printk(KERN_INFO "Using R2D-1 interrupt controller.\n");
- d = &intc_desc_r2d_1;
- memcpy(irl2irq, irl2irq_r2d_1, R2D_NR_IRL);
- break;
-#endif
- default:
- printk(KERN_INFO "Unknown R2D interrupt controller 0x%04x\n",
- __raw_readw(PA_VERREG));
- return;
- }
-
- register_intc_controller(d);
-}
diff --git a/arch/sh/boards/mach-r2d/setup.c b/arch/sh/boards/mach-r2d/setup.c
deleted file mode 100644
index 3bc52f651d9611..00000000000000
--- a/arch/sh/boards/mach-r2d/setup.c
+++ /dev/null
@@ -1,305 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Renesas Technology Sales RTS7751R2D Support.
- *
- * Copyright (C) 2002 - 2006 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2004 - 2007 Paul Mundt
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/physmap.h>
-#include <linux/ata_platform.h>
-#include <linux/sm501.h>
-#include <linux/sm501-regs.h>
-#include <linux/pm.h>
-#include <linux/fb.h>
-#include <linux/spi/spi.h>
-#include <linux/spi/spi_bitbang.h>
-#include <asm/machvec.h>
-#include <mach/r2d.h>
-#include <asm/io.h>
-#include <asm/io_trapped.h>
-#include <asm/spi.h>
-
-static struct resource cf_ide_resources[] = {
- [0] = {
- .start = PA_AREA5_IO + 0x1000,
- .end = PA_AREA5_IO + 0x1000 + 0x10 - 0x2,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = PA_AREA5_IO + 0x80c,
- .end = PA_AREA5_IO + 0x80c,
- .flags = IORESOURCE_MEM,
- },
-#ifndef CONFIG_RTS7751R2D_1 /* For R2D-1 polling is preferred */
- [2] = {
- .start = IRQ_CF_IDE,
- .flags = IORESOURCE_IRQ,
- },
-#endif
-};
-
-static struct pata_platform_info pata_info = {
- .ioport_shift = 1,
-};
-
-static struct platform_device cf_ide_device = {
- .name = "pata_platform",
- .id = -1,
- .num_resources = ARRAY_SIZE(cf_ide_resources),
- .resource = cf_ide_resources,
- .dev = {
- .platform_data = &pata_info,
- },
-};
-
-static struct spi_board_info spi_bus[] = {
- {
- .modalias = "rtc-r9701",
- .max_speed_hz = 1000000,
- .mode = SPI_MODE_3,
- },
-};
-
-static void r2d_chip_select(struct sh_spi_info *spi, int cs, int state)
-{
- BUG_ON(cs != 0); /* Single Epson RTC-9701JE attached on CS0 */
- __raw_writew(state == BITBANG_CS_ACTIVE, PA_RTCCE);
-}
-
-static struct sh_spi_info spi_info = {
- .num_chipselect = 1,
- .chip_select = r2d_chip_select,
-};
-
-static struct resource spi_sh_sci_resources[] = {
- {
- .start = 0xffe00000,
- .end = 0xffe0001f,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device spi_sh_sci_device = {
- .name = "spi_sh_sci",
- .id = -1,
- .num_resources = ARRAY_SIZE(spi_sh_sci_resources),
- .resource = spi_sh_sci_resources,
- .dev = {
- .platform_data = &spi_info,
- },
-};
-
-static struct resource heartbeat_resources[] = {
- [0] = {
- .start = PA_OUTPORT,
- .end = PA_OUTPORT,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .num_resources = ARRAY_SIZE(heartbeat_resources),
- .resource = heartbeat_resources,
-};
-
-static struct resource sm501_resources[] = {
- [0] = {
- .start = 0x10000000,
- .end = 0x13e00000 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 0x13e00000,
- .end = 0x13ffffff,
- .flags = IORESOURCE_MEM,
- },
- [2] = {
- .start = IRQ_VOYAGER,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct fb_videomode sm501_default_mode = {
- .pixclock = 35714,
- .xres = 640,
- .yres = 480,
- .left_margin = 105,
- .right_margin = 50,
- .upper_margin = 35,
- .lower_margin = 0,
- .hsync_len = 96,
- .vsync_len = 2,
- .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-};
-
-static struct sm501_platdata_fbsub sm501_pdata_fbsub_pnl = {
- .def_bpp = 16,
- .def_mode = &sm501_default_mode,
- .flags = SM501FB_FLAG_USE_INIT_MODE |
- SM501FB_FLAG_USE_HWCURSOR |
- SM501FB_FLAG_USE_HWACCEL |
- SM501FB_FLAG_DISABLE_AT_EXIT,
-};
-
-static struct sm501_platdata_fbsub sm501_pdata_fbsub_crt = {
- .flags = (SM501FB_FLAG_USE_INIT_MODE |
- SM501FB_FLAG_USE_HWCURSOR |
- SM501FB_FLAG_USE_HWACCEL |
- SM501FB_FLAG_DISABLE_AT_EXIT),
-
-};
-
-static struct sm501_platdata_fb sm501_fb_pdata = {
- .fb_route = SM501_FB_OWN,
- .fb_crt = &sm501_pdata_fbsub_crt,
- .fb_pnl = &sm501_pdata_fbsub_pnl,
- .flags = SM501_FBPD_SWAP_FB_ENDIAN,
-};
-
-static struct sm501_initdata sm501_initdata = {
- .devices = SM501_USE_USB_HOST | SM501_USE_UART0,
-};
-
-static struct sm501_platdata sm501_platform_data = {
- .init = &sm501_initdata,
- .fb = &sm501_fb_pdata,
-};
-
-static struct platform_device sm501_device = {
- .name = "sm501",
- .id = -1,
- .dev = {
- .platform_data = &sm501_platform_data,
- },
- .num_resources = ARRAY_SIZE(sm501_resources),
- .resource = sm501_resources,
-};
-
-static struct mtd_partition r2d_partitions[] = {
- {
- .name = "U-Boot",
- .offset = 0x00000000,
- .size = 0x00040000,
- .mask_flags = MTD_WRITEABLE,
- }, {
- .name = "Environment",
- .offset = MTDPART_OFS_NXTBLK,
- .size = 0x00040000,
- .mask_flags = MTD_WRITEABLE,
- }, {
- .name = "Kernel",
- .offset = MTDPART_OFS_NXTBLK,
- .size = 0x001c0000,
- }, {
- .name = "Flash_FS",
- .offset = MTDPART_OFS_NXTBLK,
- .size = MTDPART_SIZ_FULL,
- }
-};
-
-static struct physmap_flash_data flash_data = {
- .width = 2,
- .nr_parts = ARRAY_SIZE(r2d_partitions),
- .parts = r2d_partitions,
-};
-
-static struct resource flash_resource = {
- .start = 0x00000000,
- .end = 0x02000000,
- .flags = IORESOURCE_MEM,
-};
-
-static struct platform_device flash_device = {
- .name = "physmap-flash",
- .id = -1,
- .resource = &flash_resource,
- .num_resources = 1,
- .dev = {
- .platform_data = &flash_data,
- },
-};
-
-static struct platform_device *rts7751r2d_devices[] __initdata = {
- &sm501_device,
- &heartbeat_device,
- &spi_sh_sci_device,
-};
-
-/*
- * The CF is connected with a 16-bit bus where 8-bit operations are
- * unsupported. The linux ata driver is however using 8-bit operations, so
- * insert a trapped io filter to convert 8-bit operations into 16-bit.
- */
-static struct trapped_io cf_trapped_io = {
- .resource = cf_ide_resources,
- .num_resources = 2,
- .minimum_bus_width = 16,
-};
-
-static int __init rts7751r2d_devices_setup(void)
-{
- if (register_trapped_io(&cf_trapped_io) == 0)
- platform_device_register(&cf_ide_device);
-
- if (mach_is_r2d_plus())
- platform_device_register(&flash_device);
-
- spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
-
- return platform_add_devices(rts7751r2d_devices,
- ARRAY_SIZE(rts7751r2d_devices));
-}
-device_initcall(rts7751r2d_devices_setup);
-
-static void rts7751r2d_power_off(void)
-{
- __raw_writew(0x0001, PA_POWOFF);
-}
-
-/*
- * Initialize the board
- */
-static void __init rts7751r2d_setup(char **cmdline_p)
-{
- void __iomem *sm501_reg;
- u16 ver = __raw_readw(PA_VERREG);
-
- printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n");
-
- printk(KERN_INFO "FPGA version:%d (revision:%d)\n",
- (ver >> 4) & 0xf, ver & 0xf);
-
- __raw_writew(0x0000, PA_OUTPORT);
- pm_power_off = rts7751r2d_power_off;
-
- /* sm501 dram configuration:
- * ColSizeX = 11 - External Memory Column Size: 256 words.
- * APX = 1 - External Memory Active to Pre-Charge Delay: 7 clocks.
- * RstX = 1 - External Memory Reset: Normal.
- * Rfsh = 1 - Local Memory Refresh to Command Delay: 12 clocks.
- * BwC = 1 - Local Memory Block Write Cycle Time: 2 clocks.
- * BwP = 1 - Local Memory Block Write to Pre-Charge Delay: 1 clock.
- * AP = 1 - Internal Memory Active to Pre-Charge Delay: 7 clocks.
- * Rst = 1 - Internal Memory Reset: Normal.
- * RA = 1 - Internal Memory Remain in Active State: Do not remain.
- */
-
- sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL;
- writel(readl(sm501_reg) | 0x00f107c0, sm501_reg);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_rts7751r2d __initmv = {
- .mv_name = "RTS7751R2D",
- .mv_setup = rts7751r2d_setup,
- .mv_init_irq = init_rts7751r2d_IRQ,
- .mv_irq_demux = rts7751r2d_irq_demux,
-};
diff --git a/arch/sh/boards/mach-rsk/Kconfig b/arch/sh/boards/mach-rsk/Kconfig
deleted file mode 100644
index f0299bc4416f80..00000000000000
--- a/arch/sh/boards/mach-rsk/Kconfig
+++ /dev/null
@@ -1,29 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-if SH_RSK
-
-choice
- prompt "RSK+ options"
- default SH_RSK7203
-
-config SH_RSK7201
- bool "RSK7201"
- depends on CPU_SUBTYPE_SH7201
-
-config SH_RSK7203
- bool "RSK7203"
- select GPIOLIB
- depends on CPU_SUBTYPE_SH7203
-
-config SH_RSK7264
- bool "RSK2+SH7264"
- select GPIOLIB
- depends on CPU_SUBTYPE_SH7264
-
-config SH_RSK7269
- bool "RSK2+SH7269"
- select GPIOLIB
- depends on CPU_SUBTYPE_SH7269
-
-endchoice
-
-endif
diff --git a/arch/sh/boards/mach-rsk/Makefile b/arch/sh/boards/mach-rsk/Makefile
deleted file mode 100644
index 43cca39a9fe612..00000000000000
--- a/arch/sh/boards/mach-rsk/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-y := setup.o
-obj-$(CONFIG_SH_RSK7203) += devices-rsk7203.o
-obj-$(CONFIG_SH_RSK7264) += devices-rsk7264.o
-obj-$(CONFIG_SH_RSK7269) += devices-rsk7269.o
diff --git a/arch/sh/boards/mach-rsk/devices-rsk7203.c b/arch/sh/boards/mach-rsk/devices-rsk7203.c
deleted file mode 100644
index e6b05d4588b7b9..00000000000000
--- a/arch/sh/boards/mach-rsk/devices-rsk7203.c
+++ /dev/null
@@ -1,137 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Renesas Technology Europe RSK+ 7203 Support.
- *
- * Copyright (C) 2008 - 2010 Paul Mundt
- */
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/smsc911x.h>
-#include <linux/input.h>
-#include <linux/gpio.h>
-#include <linux/gpio_keys.h>
-#include <linux/leds.h>
-#include <asm/machvec.h>
-#include <asm/io.h>
-#include <cpu/sh7203.h>
-
-static struct smsc911x_platform_config smsc911x_config = {
- .phy_interface = PHY_INTERFACE_MODE_MII,
- .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
- .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
- .flags = SMSC911X_USE_32BIT | SMSC911X_SWAP_FIFO,
-};
-
-static struct resource smsc911x_resources[] = {
- [0] = {
- .start = 0x24000000,
- .end = 0x240000ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 64,
- .end = 64,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device smsc911x_device = {
- .name = "smsc911x",
- .id = -1,
- .num_resources = ARRAY_SIZE(smsc911x_resources),
- .resource = smsc911x_resources,
- .dev = {
- .platform_data = &smsc911x_config,
- },
-};
-
-static struct gpio_led rsk7203_gpio_leds[] = {
- {
- .name = "green",
- .gpio = GPIO_PE10,
- .active_low = 1,
- }, {
- .name = "orange",
- .default_trigger = "nand-disk",
- .gpio = GPIO_PE12,
- .active_low = 1,
- }, {
- .name = "red:timer",
- .default_trigger = "timer",
- .gpio = GPIO_PC14,
- .active_low = 1,
- }, {
- .name = "red:heartbeat",
- .default_trigger = "heartbeat",
- .gpio = GPIO_PE11,
- .active_low = 1,
- },
-};
-
-static struct gpio_led_platform_data rsk7203_gpio_leds_info = {
- .leds = rsk7203_gpio_leds,
- .num_leds = ARRAY_SIZE(rsk7203_gpio_leds),
-};
-
-static struct platform_device led_device = {
- .name = "leds-gpio",
- .id = -1,
- .dev = {
- .platform_data = &rsk7203_gpio_leds_info,
- },
-};
-
-static struct gpio_keys_button rsk7203_gpio_keys_table[] = {
- {
- .code = BTN_0,
- .gpio = GPIO_PB0,
- .active_low = 1,
- .desc = "SW1",
- }, {
- .code = BTN_1,
- .gpio = GPIO_PB1,
- .active_low = 1,
- .desc = "SW2",
- }, {
- .code = BTN_2,
- .gpio = GPIO_PB2,
- .active_low = 1,
- .desc = "SW3",
- },
-};
-
-static struct gpio_keys_platform_data rsk7203_gpio_keys_info = {
- .buttons = rsk7203_gpio_keys_table,
- .nbuttons = ARRAY_SIZE(rsk7203_gpio_keys_table),
- .poll_interval = 50, /* default to 50ms */
-};
-
-static struct platform_device keys_device = {
- .name = "gpio-keys-polled",
- .dev = {
- .platform_data = &rsk7203_gpio_keys_info,
- },
-};
-
-static struct platform_device *rsk7203_devices[] __initdata = {
- &smsc911x_device,
- &led_device,
- &keys_device,
-};
-
-static int __init rsk7203_devices_setup(void)
-{
- /* Select pins for SCIF0 */
- gpio_request(GPIO_FN_TXD0, NULL);
- gpio_request(GPIO_FN_RXD0, NULL);
-
- /* Setup LAN9118: CS1 in 16-bit Big Endian Mode, IRQ0 at Port B */
- __raw_writel(0x36db0400, 0xfffc0008); /* CS1BCR */
- gpio_request(GPIO_FN_IRQ0_PB, NULL);
-
- return platform_add_devices(rsk7203_devices,
- ARRAY_SIZE(rsk7203_devices));
-}
-device_initcall(rsk7203_devices_setup);
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 eaf700a20b833e..00000000000000
--- a/arch/sh/boards/mach-rsk/devices-rsk7264.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * RSK+SH7264 Support.
- *
- * Copyright (C) 2012 Renesas Electronics Europe
- */
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/smsc911x.h>
-#include <asm/machvec.h>
-#include <asm/io.h>
-
-static struct smsc911x_platform_config smsc911x_config = {
- .phy_interface = PHY_INTERFACE_MODE_MII,
- .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
- .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
- .flags = SMSC911X_USE_16BIT | SMSC911X_SWAP_FIFO,
-};
-
-static struct resource smsc911x_resources[] = {
- [0] = {
- .start = 0x28000000,
- .end = 0x280000ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 65,
- .end = 65,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device smsc911x_device = {
- .name = "smsc911x",
- .id = -1,
- .num_resources = ARRAY_SIZE(smsc911x_resources),
- .resource = smsc911x_resources,
- .dev = {
- .platform_data = &smsc911x_config,
- },
-};
-
-static struct platform_device *rsk7264_devices[] __initdata = {
- &smsc911x_device,
-};
-
-static int __init rsk7264_devices_setup(void)
-{
- return platform_add_devices(rsk7264_devices,
- ARRAY_SIZE(rsk7264_devices));
-}
-device_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 4b1e386b51dd64..00000000000000
--- a/arch/sh/boards/mach-rsk/devices-rsk7269.c
+++ /dev/null
@@ -1,57 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * RSK+SH7269 Support
- *
- * Copyright (C) 2012 Renesas Electronics Europe Ltd
- * Copyright (C) 2012 Phil Edworthy
- */
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/smsc911x.h>
-#include <linux/gpio.h>
-#include <asm/machvec.h>
-#include <asm/io.h>
-
-static struct smsc911x_platform_config smsc911x_config = {
- .phy_interface = PHY_INTERFACE_MODE_MII,
- .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
- .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
- .flags = SMSC911X_USE_16BIT | SMSC911X_SWAP_FIFO,
-};
-
-static struct resource smsc911x_resources[] = {
- [0] = {
- .start = 0x24000000,
- .end = 0x240000ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 85,
- .end = 85,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device smsc911x_device = {
- .name = "smsc911x",
- .id = -1,
- .num_resources = ARRAY_SIZE(smsc911x_resources),
- .resource = smsc911x_resources,
- .dev = {
- .platform_data = &smsc911x_config,
- },
-};
-
-static struct platform_device *rsk7269_devices[] __initdata = {
- &smsc911x_device,
-};
-
-static int __init rsk7269_devices_setup(void)
-{
- return platform_add_devices(rsk7269_devices,
- ARRAY_SIZE(rsk7269_devices));
-}
-device_initcall(rsk7269_devices_setup);
diff --git a/arch/sh/boards/mach-rsk/setup.c b/arch/sh/boards/mach-rsk/setup.c
deleted file mode 100644
index 9370c4fdc41e13..00000000000000
--- a/arch/sh/boards/mach-rsk/setup.c
+++ /dev/null
@@ -1,84 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Renesas Technology Europe RSK+ Support.
- *
- * Copyright (C) 2008 Paul Mundt
- * Copyright (C) 2008 Peter Griffin <[email protected]>
- */
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/map.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <asm/machvec.h>
-#include <asm/io.h>
-
-/* Dummy supplies, where voltage doesn't matter */
-static struct regulator_consumer_supply dummy_supplies[] = {
- REGULATOR_SUPPLY("vddvario", "smsc911x"),
- REGULATOR_SUPPLY("vdd33a", "smsc911x"),
-};
-
-static struct mtd_partition rsk_partitions[] = {
- {
- .name = "Bootloader",
- .offset = 0x00000000,
- .size = 0x00040000,
- .mask_flags = MTD_WRITEABLE,
- }, {
- .name = "Kernel",
- .offset = MTDPART_OFS_NXTBLK,
- .size = 0x001c0000,
- }, {
- .name = "Flash_FS",
- .offset = MTDPART_OFS_NXTBLK,
- .size = MTDPART_SIZ_FULL,
- }
-};
-
-static struct physmap_flash_data flash_data = {
- .parts = rsk_partitions,
- .nr_parts = ARRAY_SIZE(rsk_partitions),
- .width = 2,
-};
-
-static struct resource flash_resource = {
- .start = 0x20000000,
- .end = 0x20400000,
- .flags = IORESOURCE_MEM,
-};
-
-static struct platform_device flash_device = {
- .name = "physmap-flash",
- .id = -1,
- .resource = &flash_resource,
- .num_resources = 1,
- .dev = {
- .platform_data = &flash_data,
- },
-};
-
-static struct platform_device *rsk_devices[] __initdata = {
- &flash_device,
-};
-
-static int __init rsk_devices_setup(void)
-{
- regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
-
- return platform_add_devices(rsk_devices,
- ARRAY_SIZE(rsk_devices));
-}
-device_initcall(rsk_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_rsk __initmv = {
- .mv_name = "RSK+",
-};
diff --git a/arch/sh/boards/mach-sdk7780/Kconfig b/arch/sh/boards/mach-sdk7780/Kconfig
deleted file mode 100644
index d4392efd2f74db..00000000000000
--- a/arch/sh/boards/mach-sdk7780/Kconfig
+++ /dev/null
@@ -1,17 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-if SH_SDK7780
-
-choice
- prompt "SDK7780 options"
- default SH_SDK7780_BASE
-
-config SH_SDK7780_BASE
- bool "SDK7780 with base-board support"
- depends on CPU_SUBTYPE_SH7780
- help
- Selecting this option will enable support for the expansion
- baseboard devices. If in doubt, say Y.
-
-endchoice
-
-endif
diff --git a/arch/sh/boards/mach-sdk7780/Makefile b/arch/sh/boards/mach-sdk7780/Makefile
deleted file mode 100644
index 37e857f9a55a26..00000000000000
--- a/arch/sh/boards/mach-sdk7780/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the SDK7780 specific parts of the kernel
-#
-obj-y := setup.o irq.o
-
diff --git a/arch/sh/boards/mach-sdk7780/irq.c b/arch/sh/boards/mach-sdk7780/irq.c
deleted file mode 100644
index fa392f3dce266b..00000000000000
--- a/arch/sh/boards/mach-sdk7780/irq.c
+++ /dev/null
@@ -1,43 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/renesas/sdk7780/irq.c
- *
- * Renesas Technology Europe SDK7780 Support.
- *
- * Copyright (C) 2008 Nicholas Beck <[email protected]>
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <mach/sdk7780.h>
-
-enum {
- UNUSED = 0,
- /* board specific interrupt sources */
- SMC91C111, /* Ethernet controller */
-};
-
-static struct intc_vect fpga_vectors[] __initdata = {
- INTC_IRQ(SMC91C111, IRQ_ETHERNET),
-};
-
-static struct intc_mask_reg fpga_mask_registers[] __initdata = {
- { 0, FPGA_IRQ0MR, 16,
- { 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, SMC91C111, 0, 0, 0, 0 } },
-};
-
-static DECLARE_INTC_DESC(fpga_intc_desc, "sdk7780-irq", fpga_vectors,
- NULL, fpga_mask_registers, NULL, NULL);
-
-void __init init_sdk7780_IRQ(void)
-{
- printk(KERN_INFO "Using SDK7780 interrupt controller.\n");
-
- __raw_writew(0xFFFF, FPGA_IRQ0MR);
- /* Setup IRL 0-3 */
- __raw_writew(0x0003, FPGA_IMSR);
- plat_irq_setup_pins(IRQ_MODE_IRL3210);
-
- register_intc_controller(&fpga_intc_desc);
-}
diff --git a/arch/sh/boards/mach-sdk7780/setup.c b/arch/sh/boards/mach-sdk7780/setup.c
deleted file mode 100644
index 482761b780e406..00000000000000
--- a/arch/sh/boards/mach-sdk7780/setup.c
+++ /dev/null
@@ -1,96 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/renesas/sdk7780/setup.c
- *
- * Renesas Solutions SH7780 SDK Support
- * Copyright (C) 2008 Nicholas Beck <[email protected]>
- */
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <asm/machvec.h>
-#include <mach/sdk7780.h>
-#include <asm/heartbeat.h>
-#include <asm/io.h>
-#include <asm/addrspace.h>
-
-#define GPIO_PECR 0xFFEA0008
-
-/* Heartbeat */
-static struct resource heartbeat_resource = {
- .start = PA_LED,
- .end = PA_LED,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-/* SMC91x */
-static struct resource smc91x_eth_resources[] = {
- [0] = {
- .name = "smc91x-regs" ,
- .start = PA_LAN + 0x300,
- .end = PA_LAN + 0x300 + 0x10 ,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = IRQ_ETHERNET,
- .end = IRQ_ETHERNET,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device smc91x_eth_device = {
- .name = "smc91x",
- .id = 0,
- .dev = {
- .dma_mask = NULL, /* don't use dma */
- .coherent_dma_mask = 0xffffffff,
- },
- .num_resources = ARRAY_SIZE(smc91x_eth_resources),
- .resource = smc91x_eth_resources,
-};
-
-static struct platform_device *sdk7780_devices[] __initdata = {
- &heartbeat_device,
- &smc91x_eth_device,
-};
-
-static int __init sdk7780_devices_setup(void)
-{
- return platform_add_devices(sdk7780_devices,
- ARRAY_SIZE(sdk7780_devices));
-}
-device_initcall(sdk7780_devices_setup);
-
-static void __init sdk7780_setup(char **cmdline_p)
-{
- u16 ver = __raw_readw(FPGA_FPVERR);
- u16 dateStamp = __raw_readw(FPGA_FPDATER);
-
- printk(KERN_INFO "Renesas Technology Europe SDK7780 support.\n");
- printk(KERN_INFO "Board version: %d (revision %d), "
- "FPGA version: %d (revision %d), datestamp : %d\n",
- (ver >> 12) & 0xf, (ver >> 8) & 0xf,
- (ver >> 4) & 0xf, ver & 0xf,
- dateStamp);
-
- /* Setup pin mux'ing for PCIC */
- __raw_writew(0x0000, GPIO_PECR);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_se7780 __initmv = {
- .mv_name = "Renesas SDK7780-R3" ,
- .mv_setup = sdk7780_setup,
- .mv_init_irq = init_sdk7780_IRQ,
-};
-
diff --git a/arch/sh/boards/mach-sdk7786/Makefile b/arch/sh/boards/mach-sdk7786/Makefile
deleted file mode 100644
index 731a87c694b3bc..00000000000000
--- a/arch/sh/boards/mach-sdk7786/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-y := fpga.o irq.o nmi.o setup.o
-
-obj-$(CONFIG_GPIOLIB) += gpio.o
-obj-$(CONFIG_HAVE_SRAM_POOL) += sram.o
diff --git a/arch/sh/boards/mach-sdk7786/fpga.c b/arch/sh/boards/mach-sdk7786/fpga.c
deleted file mode 100644
index a37e1e88c6b1f2..00000000000000
--- a/arch/sh/boards/mach-sdk7786/fpga.c
+++ /dev/null
@@ -1,69 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * SDK7786 FPGA Support.
- *
- * Copyright (C) 2010 Paul Mundt
- */
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/bcd.h>
-#include <mach/fpga.h>
-#include <linux/sizes.h>
-
-#define FPGA_REGS_OFFSET 0x03fff800
-#define FPGA_REGS_SIZE 0x490
-
-/*
- * The FPGA can be mapped in any of the generally available areas,
- * so we attempt to scan for it using the fixed SRSTR read magic.
- *
- * Once the FPGA is located, the rest of the mapping data for the other
- * components can be determined dynamically from its section mapping
- * registers.
- */
-static void __iomem *sdk7786_fpga_probe(void)
-{
- unsigned long area;
- void __iomem *base;
-
- /*
- * Iterate over all of the areas where the FPGA could be mapped.
- * The possible range is anywhere from area 0 through 6, area 7
- * is reserved.
- */
- for (area = PA_AREA0; area < PA_AREA7; area += SZ_64M) {
- base = ioremap(area + FPGA_REGS_OFFSET, FPGA_REGS_SIZE);
- if (!base) {
- /* Failed to remap this area, move along. */
- continue;
- }
-
- if (ioread16(base + SRSTR) == SRSTR_MAGIC)
- return base; /* Found it! */
-
- iounmap(base);
- }
-
- return NULL;
-}
-
-void __iomem *sdk7786_fpga_base;
-
-void __init sdk7786_fpga_init(void)
-{
- u16 version, date;
-
- sdk7786_fpga_base = sdk7786_fpga_probe();
- if (unlikely(!sdk7786_fpga_base)) {
- panic("FPGA detection failed.\n");
- return;
- }
-
- version = fpga_read_reg(FPGAVR);
- date = fpga_read_reg(FPGADR);
-
- pr_info("\tFPGA version:\t%d.%d (built on %d/%d/%d)\n",
- bcd2bin(version >> 8) & 0xf, bcd2bin(version & 0xf),
- ((date >> 12) & 0xf) + 2000,
- (date >> 8) & 0xf, bcd2bin(date & 0xff));
-}
diff --git a/arch/sh/boards/mach-sdk7786/gpio.c b/arch/sh/boards/mach-sdk7786/gpio.c
deleted file mode 100644
index c4587d1013e611..00000000000000
--- a/arch/sh/boards/mach-sdk7786/gpio.c
+++ /dev/null
@@ -1,46 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * SDK7786 FPGA USRGPIR Support.
- *
- * Copyright (C) 2010 Paul Mundt
- */
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/gpio/driver.h>
-#include <linux/irq.h>
-#include <linux/kernel.h>
-#include <linux/spinlock.h>
-#include <linux/io.h>
-#include <mach/fpga.h>
-
-#define NR_FPGA_GPIOS 8
-
-static const char *usrgpir_gpio_names[NR_FPGA_GPIOS] = {
- "in0", "in1", "in2", "in3", "in4", "in5", "in6", "in7",
-};
-
-static int usrgpir_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
-{
- /* always in */
- return 0;
-}
-
-static int usrgpir_gpio_get(struct gpio_chip *chip, unsigned gpio)
-{
- return !!(fpga_read_reg(USRGPIR) & (1 << gpio));
-}
-
-static struct gpio_chip usrgpir_gpio_chip = {
- .label = "sdk7786-fpga",
- .names = usrgpir_gpio_names,
- .direction_input = usrgpir_gpio_direction_input,
- .get = usrgpir_gpio_get,
- .base = -1, /* don't care */
- .ngpio = NR_FPGA_GPIOS,
-};
-
-static int __init usrgpir_gpio_setup(void)
-{
- return gpiochip_add_data(&usrgpir_gpio_chip, NULL);
-}
-device_initcall(usrgpir_gpio_setup);
diff --git a/arch/sh/boards/mach-sdk7786/irq.c b/arch/sh/boards/mach-sdk7786/irq.c
deleted file mode 100644
index 340c306ea95239..00000000000000
--- a/arch/sh/boards/mach-sdk7786/irq.c
+++ /dev/null
@@ -1,45 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * SDK7786 FPGA IRQ Controller Support.
- *
- * Copyright (C) 2010 Matt Fleming
- * Copyright (C) 2010 Paul Mundt
- */
-#include <linux/irq.h>
-#include <mach/fpga.h>
-#include <mach/irq.h>
-
-enum {
- ATA_IRQ_BIT = 1,
- SPI_BUSY_BIT = 2,
- LIRQ5_BIT = 3,
- LIRQ6_BIT = 4,
- LIRQ7_BIT = 5,
- LIRQ8_BIT = 6,
- KEY_IRQ_BIT = 7,
- PEN_IRQ_BIT = 8,
- ETH_IRQ_BIT = 9,
- RTC_ALARM_BIT = 10,
- CRYSTAL_FAIL_BIT = 12,
- ETH_PME_BIT = 14,
-};
-
-void __init sdk7786_init_irq(void)
-{
- unsigned int tmp;
-
- /* Enable priority encoding for all IRLs */
- fpga_write_reg(fpga_read_reg(INTMSR) | 0x0303, INTMSR);
-
- /* Clear FPGA interrupt status registers */
- fpga_write_reg(0x0000, INTASR);
- fpga_write_reg(0x0000, INTBSR);
-
- /* Unmask FPGA interrupts */
- tmp = fpga_read_reg(INTAMR);
- tmp &= ~(1 << ETH_IRQ_BIT);
- fpga_write_reg(tmp, INTAMR);
-
- plat_irq_setup_pins(IRQ_MODE_IRL7654_MASK);
- plat_irq_setup_pins(IRQ_MODE_IRL3210_MASK);
-}
diff --git a/arch/sh/boards/mach-sdk7786/nmi.c b/arch/sh/boards/mach-sdk7786/nmi.c
deleted file mode 100644
index afba49679a1219..00000000000000
--- a/arch/sh/boards/mach-sdk7786/nmi.c
+++ /dev/null
@@ -1,80 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * SDK7786 FPGA NMI Support.
- *
- * Copyright (C) 2010 Paul Mundt
- */
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <mach/fpga.h>
-
-enum {
- NMI_MODE_MANUAL,
- NMI_MODE_AUX,
- NMI_MODE_MASKED,
- NMI_MODE_ANY,
- NMI_MODE_UNKNOWN,
-};
-
-/*
- * Default to the manual NMI switch.
- */
-static unsigned int __initdata nmi_mode = NMI_MODE_ANY;
-
-static int __init nmi_mode_setup(char *str)
-{
- if (!str)
- return 0;
-
- if (strcmp(str, "manual") == 0)
- nmi_mode = NMI_MODE_MANUAL;
- else if (strcmp(str, "aux") == 0)
- nmi_mode = NMI_MODE_AUX;
- else if (strcmp(str, "masked") == 0)
- nmi_mode = NMI_MODE_MASKED;
- else if (strcmp(str, "any") == 0)
- nmi_mode = NMI_MODE_ANY;
- else {
- nmi_mode = NMI_MODE_UNKNOWN;
- pr_warn("Unknown NMI mode %s\n", str);
- }
-
- printk("Set NMI mode to %d\n", nmi_mode);
- return 0;
-}
-early_param("nmi_mode", nmi_mode_setup);
-
-void __init sdk7786_nmi_init(void)
-{
- unsigned int source, mask, tmp;
-
- switch (nmi_mode) {
- case NMI_MODE_MANUAL:
- source = NMISR_MAN_NMI;
- mask = NMIMR_MAN_NMIM;
- break;
- case NMI_MODE_AUX:
- source = NMISR_AUX_NMI;
- mask = NMIMR_AUX_NMIM;
- break;
- case NMI_MODE_ANY:
- source = NMISR_MAN_NMI | NMISR_AUX_NMI;
- mask = NMIMR_MAN_NMIM | NMIMR_AUX_NMIM;
- break;
- case NMI_MODE_MASKED:
- case NMI_MODE_UNKNOWN:
- default:
- source = mask = 0;
- break;
- }
-
- /* Set the NMI source */
- tmp = fpga_read_reg(NMISR);
- tmp &= ~NMISR_MASK;
- tmp |= source;
- fpga_write_reg(tmp, NMISR);
-
- /* And the IRQ masking */
- fpga_write_reg(NMIMR_MASK ^ mask, NMIMR);
-}
diff --git a/arch/sh/boards/mach-sdk7786/setup.c b/arch/sh/boards/mach-sdk7786/setup.c
deleted file mode 100644
index d183026dbeb19a..00000000000000
--- a/arch/sh/boards/mach-sdk7786/setup.c
+++ /dev/null
@@ -1,266 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Renesas Technology Europe SDK7786 Support.
- *
- * Copyright (C) 2010 Matt Fleming
- * Copyright (C) 2010 Paul Mundt
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/smsc911x.h>
-#include <linux/i2c.h>
-#include <linux/irq.h>
-#include <linux/clk.h>
-#include <linux/clkdev.h>
-#include <mach/fpga.h>
-#include <mach/irq.h>
-#include <asm/machvec.h>
-#include <asm/heartbeat.h>
-#include <linux/sizes.h>
-#include <asm/clock.h>
-#include <asm/reboot.h>
-#include <asm/smp-ops.h>
-
-static struct resource heartbeat_resource = {
- .start = 0x07fff8b0,
- .end = 0x07fff8b0 + sizeof(u16) - 1,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-/* Dummy supplies, where voltage doesn't matter */
-static struct regulator_consumer_supply dummy_supplies[] = {
- REGULATOR_SUPPLY("vddvario", "smsc911x"),
- REGULATOR_SUPPLY("vdd33a", "smsc911x"),
-};
-
-static struct resource smsc911x_resources[] = {
- [0] = {
- .name = "smsc911x-memory",
- .start = 0x07ffff00,
- .end = 0x07ffff00 + SZ_256 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .name = "smsc911x-irq",
- .start = evt2irq(0x2c0),
- .end = evt2irq(0x2c0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct smsc911x_platform_config smsc911x_config = {
- .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
- .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
- .flags = SMSC911X_USE_32BIT,
- .phy_interface = PHY_INTERFACE_MODE_MII,
-};
-
-static struct platform_device smsc911x_device = {
- .name = "smsc911x",
- .id = -1,
- .num_resources = ARRAY_SIZE(smsc911x_resources),
- .resource = smsc911x_resources,
- .dev = {
- .platform_data = &smsc911x_config,
- },
-};
-
-static struct resource smbus_fpga_resource = {
- .start = 0x07fff9e0,
- .end = 0x07fff9e0 + SZ_32 - 1,
- .flags = IORESOURCE_MEM,
-};
-
-static struct platform_device smbus_fpga_device = {
- .name = "i2c-sdk7786",
- .id = 0,
- .num_resources = 1,
- .resource = &smbus_fpga_resource,
-};
-
-static struct resource smbus_pcie_resource = {
- .start = 0x07fffc30,
- .end = 0x07fffc30 + SZ_32 - 1,
- .flags = IORESOURCE_MEM,
-};
-
-static struct platform_device smbus_pcie_device = {
- .name = "i2c-sdk7786",
- .id = 1,
- .num_resources = 1,
- .resource = &smbus_pcie_resource,
-};
-
-static struct i2c_board_info __initdata sdk7786_i2c_devices[] = {
- {
- I2C_BOARD_INFO("max6900", 0x68),
- },
-};
-
-static struct platform_device *sh7786_devices[] __initdata = {
- &heartbeat_device,
- &smsc911x_device,
- &smbus_fpga_device,
- &smbus_pcie_device,
-};
-
-static int sdk7786_i2c_setup(void)
-{
- unsigned int tmp;
-
- /*
- * Hand over I2C control to the FPGA.
- */
- tmp = fpga_read_reg(SBCR);
- tmp &= ~SCBR_I2CCEN;
- tmp |= SCBR_I2CMEN;
- fpga_write_reg(tmp, SBCR);
-
- return i2c_register_board_info(0, sdk7786_i2c_devices,
- ARRAY_SIZE(sdk7786_i2c_devices));
-}
-
-static int __init sdk7786_devices_setup(void)
-{
- int ret;
-
- ret = platform_add_devices(sh7786_devices, ARRAY_SIZE(sh7786_devices));
- if (unlikely(ret != 0))
- return ret;
-
- return sdk7786_i2c_setup();
-}
-device_initcall(sdk7786_devices_setup);
-
-static int sdk7786_mode_pins(void)
-{
- return fpga_read_reg(MODSWR);
-}
-
-/*
- * FPGA-driven PCIe clocks
- *
- * Historically these include the oscillator, clock B (slots 2/3/4) and
- * clock A (slot 1 and the CPU clock). Newer revs of the PCB shove
- * everything under a single PCIe clocks enable bit that happens to map
- * to the same bit position as the oscillator bit for earlier FPGA
- * versions.
- *
- * Given that the legacy clocks have the side-effect of shutting the CPU
- * off through the FPGA along with the PCI slots, we simply leave them in
- * their initial state and don't bother registering them with the clock
- * framework.
- */
-static int sdk7786_pcie_clk_enable(struct clk *clk)
-{
- fpga_write_reg(fpga_read_reg(PCIECR) | PCIECR_CLKEN, PCIECR);
- return 0;
-}
-
-static void sdk7786_pcie_clk_disable(struct clk *clk)
-{
- fpga_write_reg(fpga_read_reg(PCIECR) & ~PCIECR_CLKEN, PCIECR);
-}
-
-static struct sh_clk_ops sdk7786_pcie_clk_ops = {
- .enable = sdk7786_pcie_clk_enable,
- .disable = sdk7786_pcie_clk_disable,
-};
-
-static struct clk sdk7786_pcie_clk = {
- .ops = &sdk7786_pcie_clk_ops,
-};
-
-static struct clk_lookup sdk7786_pcie_cl = {
- .con_id = "pcie_plat_clk",
- .clk = &sdk7786_pcie_clk,
-};
-
-static int sdk7786_clk_init(void)
-{
- struct clk *clk;
- int ret;
-
- /*
- * Only handle the EXTAL case, anyone interfacing a crystal
- * resonator will need to provide their own input clock.
- */
- if (test_mode_pin(MODE_PIN9))
- return -EINVAL;
-
- clk = clk_get(NULL, "extal");
- if (IS_ERR(clk))
- return PTR_ERR(clk);
- ret = clk_set_rate(clk, 33333333);
- clk_put(clk);
-
- /*
- * Setup the FPGA clocks.
- */
- ret = clk_register(&sdk7786_pcie_clk);
- if (unlikely(ret)) {
- pr_err("FPGA clock registration failed\n");
- return ret;
- }
-
- clkdev_add(&sdk7786_pcie_cl);
-
- return 0;
-}
-
-static void sdk7786_restart(char *cmd)
-{
- fpga_write_reg(0xa5a5, SRSTR);
-}
-
-static void sdk7786_power_off(void)
-{
- fpga_write_reg(fpga_read_reg(PWRCR) | PWRCR_PDWNREQ, PWRCR);
-
- /*
- * It can take up to 20us for the R8C to do its job, back off and
- * wait a bit until we've been shut off. Even though newer FPGA
- * versions don't set the ACK bit, the latency issue remains.
- */
- while ((fpga_read_reg(PWRCR) & PWRCR_PDWNACK) == 0)
- cpu_sleep();
-}
-
-/* Initialize the board */
-static void __init sdk7786_setup(char **cmdline_p)
-{
- pr_info("Renesas Technology Europe SDK7786 support:\n");
-
- regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
-
- sdk7786_fpga_init();
- sdk7786_nmi_init();
-
- pr_info("\tPCB revision:\t%d\n", fpga_read_reg(PCBRR) & 0xf);
-
- machine_ops.restart = sdk7786_restart;
- pm_power_off = sdk7786_power_off;
-
- register_smp_ops(&shx3_smp_ops);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_sdk7786 __initmv = {
- .mv_name = "SDK7786",
- .mv_setup = sdk7786_setup,
- .mv_mode_pins = sdk7786_mode_pins,
- .mv_clk_init = sdk7786_clk_init,
- .mv_init_irq = sdk7786_init_irq,
-};
diff --git a/arch/sh/boards/mach-sdk7786/sram.c b/arch/sh/boards/mach-sdk7786/sram.c
deleted file mode 100644
index 7c6ca976f332fe..00000000000000
--- a/arch/sh/boards/mach-sdk7786/sram.c
+++ /dev/null
@@ -1,69 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * SDK7786 FPGA SRAM Support.
- *
- * Copyright (C) 2010 Paul Mundt
- */
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/io.h>
-#include <linux/string.h>
-#include <mach/fpga.h>
-#include <asm/sram.h>
-#include <linux/sizes.h>
-
-static int __init fpga_sram_init(void)
-{
- unsigned long phys;
- unsigned int area;
- void __iomem *vaddr;
- int ret;
- u16 data;
-
- /* Enable FPGA SRAM */
- data = fpga_read_reg(LCLASR);
- data |= LCLASR_FRAMEN;
- fpga_write_reg(data, LCLASR);
-
- /*
- * FPGA_SEL determines the area mapping
- */
- area = (data & LCLASR_FPGA_SEL_MASK) >> LCLASR_FPGA_SEL_SHIFT;
- if (unlikely(area == LCLASR_AREA_MASK)) {
- pr_err("FPGA memory unmapped.\n");
- return -ENXIO;
- }
-
- /*
- * The memory itself occupies a 2KiB range at the top of the area
- * immediately below the system registers.
- */
- phys = (area << 26) + SZ_64M - SZ_4K;
-
- /*
- * The FPGA SRAM resides in translatable physical space, so set
- * up a mapping prior to inserting it in to the pool.
- */
- vaddr = ioremap(phys, SZ_2K);
- if (unlikely(!vaddr)) {
- pr_err("Failed remapping FPGA memory.\n");
- return -ENXIO;
- }
-
- pr_info("Adding %dKiB of FPGA memory at 0x%08lx-0x%08lx "
- "(area %d) to pool.\n",
- SZ_2K >> 10, phys, phys + SZ_2K - 1, area);
-
- ret = gen_pool_add(sram_pool, (unsigned long)vaddr, SZ_2K, -1);
- if (unlikely(ret < 0)) {
- pr_err("Failed adding memory\n");
- iounmap(vaddr);
- return ret;
- }
-
- return 0;
-}
-postcore_initcall(fpga_sram_init);
diff --git a/arch/sh/boards/mach-se/7206/Makefile b/arch/sh/boards/mach-se/7206/Makefile
deleted file mode 100644
index b40b30853ce376..00000000000000
--- a/arch/sh/boards/mach-se/7206/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the 7206 SolutionEngine specific parts of the kernel
-#
-
-obj-y := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/7206/irq.c b/arch/sh/boards/mach-se/7206/irq.c
deleted file mode 100644
index 2b15370829aef3..00000000000000
--- a/arch/sh/boards/mach-se/7206/irq.c
+++ /dev/null
@@ -1,151 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/se/7206/irq.c
- *
- * Copyright (C) 2005,2006 Yoshinori Sato
- *
- * Hitachi SolutionEngine Support.
- *
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <linux/interrupt.h>
-#include <mach-se/mach/se7206.h>
-
-#define INTSTS0 0x31800000
-#define INTSTS1 0x31800002
-#define INTMSK0 0x31800004
-#define INTMSK1 0x31800006
-#define INTSEL 0x31800008
-
-#define IRQ0_IRQ 64
-#define IRQ1_IRQ 65
-#define IRQ3_IRQ 67
-
-#define INTC_IPR01 0xfffe0818
-#define INTC_ICR1 0xfffe0802
-
-static void disable_se7206_irq(struct irq_data *data)
-{
- unsigned int irq = data->irq;
- unsigned short val;
- unsigned short mask = 0xffff ^ (0x0f << 4 * (3 - (IRQ0_IRQ - irq)));
- unsigned short msk0,msk1;
-
- /* Set the priority in IPR to 0 */
- val = __raw_readw(INTC_IPR01);
- val &= mask;
- __raw_writew(val, INTC_IPR01);
- /* FPGA mask set */
- msk0 = __raw_readw(INTMSK0);
- msk1 = __raw_readw(INTMSK1);
-
- switch (irq) {
- case IRQ0_IRQ:
- msk0 |= 0x0010;
- break;
- case IRQ1_IRQ:
- msk0 |= 0x000f;
- break;
- case IRQ3_IRQ:
- msk0 |= 0x0f00;
- msk1 |= 0x00ff;
- break;
- }
- __raw_writew(msk0, INTMSK0);
- __raw_writew(msk1, INTMSK1);
-}
-
-static void enable_se7206_irq(struct irq_data *data)
-{
- unsigned int irq = data->irq;
- unsigned short val;
- unsigned short value = (0x0001 << 4 * (3 - (IRQ0_IRQ - irq)));
- unsigned short msk0,msk1;
-
- /* Set priority in IPR back to original value */
- val = __raw_readw(INTC_IPR01);
- val |= value;
- __raw_writew(val, INTC_IPR01);
-
- /* FPGA mask reset */
- msk0 = __raw_readw(INTMSK0);
- msk1 = __raw_readw(INTMSK1);
-
- switch (irq) {
- case IRQ0_IRQ:
- msk0 &= ~0x0010;
- break;
- case IRQ1_IRQ:
- msk0 &= ~0x000f;
- break;
- case IRQ3_IRQ:
- msk0 &= ~0x0f00;
- msk1 &= ~0x00ff;
- break;
- }
- __raw_writew(msk0, INTMSK0);
- __raw_writew(msk1, INTMSK1);
-}
-
-static void eoi_se7206_irq(struct irq_data *data)
-{
- unsigned short sts0,sts1;
- unsigned int irq = data->irq;
-
- if (!irqd_irq_disabled(data) && !irqd_irq_inprogress(data))
- enable_se7206_irq(data);
- /* FPGA isr clear */
- sts0 = __raw_readw(INTSTS0);
- sts1 = __raw_readw(INTSTS1);
-
- switch (irq) {
- case IRQ0_IRQ:
- sts0 &= ~0x0010;
- break;
- case IRQ1_IRQ:
- sts0 &= ~0x000f;
- break;
- case IRQ3_IRQ:
- sts0 &= ~0x0f00;
- sts1 &= ~0x00ff;
- break;
- }
- __raw_writew(sts0, INTSTS0);
- __raw_writew(sts1, INTSTS1);
-}
-
-static struct irq_chip se7206_irq_chip __read_mostly = {
- .name = "SE7206-FPGA",
- .irq_mask = disable_se7206_irq,
- .irq_unmask = enable_se7206_irq,
- .irq_eoi = eoi_se7206_irq,
-};
-
-static void make_se7206_irq(unsigned int irq)
-{
- disable_irq_nosync(irq);
- irq_set_chip_and_handler_name(irq, &se7206_irq_chip,
- handle_level_irq, "level");
- disable_se7206_irq(irq_get_irq_data(irq));
-}
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se7206_IRQ(void)
-{
- make_se7206_irq(IRQ0_IRQ); /* SMC91C111 */
- make_se7206_irq(IRQ1_IRQ); /* ATA */
- make_se7206_irq(IRQ3_IRQ); /* SLOT / PCM */
-
- __raw_writew(__raw_readw(INTC_ICR1) | 0x000b, INTC_ICR1); /* ICR1 */
-
- /* FPGA System register setup*/
- __raw_writew(0x0000,INTSTS0); /* Clear INTSTS0 */
- __raw_writew(0x0000,INTSTS1); /* Clear INTSTS1 */
-
- /* IRQ0=LAN, IRQ1=ATA, IRQ3=SLT,PCM */
- __raw_writew(0x0001,INTSEL);
-}
diff --git a/arch/sh/boards/mach-se/7206/setup.c b/arch/sh/boards/mach-se/7206/setup.c
deleted file mode 100644
index dc55d3a69665ee..00000000000000
--- a/arch/sh/boards/mach-se/7206/setup.c
+++ /dev/null
@@ -1,96 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- *
- * linux/arch/sh/boards/se/7206/setup.c
- *
- * Copyright (C) 2006 Yoshinori Sato
- * Copyright (C) 2007 - 2008 Paul Mundt
- *
- * Hitachi 7206 SolutionEngine Support.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/smc91x.h>
-#include <mach-se/mach/se7206.h>
-#include <asm/io.h>
-#include <asm/machvec.h>
-#include <asm/heartbeat.h>
-
-static struct resource smc91x_resources[] = {
- [0] = {
- .name = "smc91x-regs",
- .start = PA_SMSC + 0x300,
- .end = PA_SMSC + 0x300 + 0x020 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 64,
- .end = 64,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct smc91x_platdata smc91x_info = {
- .flags = SMC91X_USE_16BIT,
-};
-
-static struct platform_device smc91x_device = {
- .name = "smc91x",
- .id = -1,
- .dev = {
- .dma_mask = NULL,
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &smc91x_info,
- },
- .num_resources = ARRAY_SIZE(smc91x_resources),
- .resource = smc91x_resources,
-};
-
-static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
-
-static struct heartbeat_data heartbeat_data = {
- .bit_pos = heartbeat_bit_pos,
- .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
-};
-
-static struct resource heartbeat_resource = {
- .start = PA_LED,
- .end = PA_LED,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .dev = {
- .platform_data = &heartbeat_data,
- },
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-static struct platform_device *se7206_devices[] __initdata = {
- &smc91x_device,
- &heartbeat_device,
-};
-
-static int __init se7206_devices_setup(void)
-{
- return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
-}
-device_initcall(se7206_devices_setup);
-
-static int se7206_mode_pins(void)
-{
- return MODE_PIN1 | MODE_PIN2;
-}
-
-/*
- * The Machine Vector
- */
-
-static struct sh_machine_vector mv_se __initmv = {
- .mv_name = "SolutionEngine",
- .mv_init_irq = init_se7206_IRQ,
- .mv_mode_pins = se7206_mode_pins,
-};
diff --git a/arch/sh/boards/mach-se/7343/Makefile b/arch/sh/boards/mach-se/7343/Makefile
deleted file mode 100644
index e058661091a26f..00000000000000
--- a/arch/sh/boards/mach-se/7343/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the 7343 SolutionEngine specific parts of the kernel
-#
-
-obj-y := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/7343/irq.c b/arch/sh/boards/mach-se/7343/irq.c
deleted file mode 100644
index f9f3b14f70d574..00000000000000
--- a/arch/sh/boards/mach-se/7343/irq.c
+++ /dev/null
@@ -1,123 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Hitachi UL SolutionEngine 7343 FPGA IRQ Support.
- *
- * Copyright (C) 2008 Yoshihiro Shimoda
- * Copyright (C) 2012 Paul Mundt
- *
- * Based on linux/arch/sh/boards/se/7343/irq.c
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- */
-#define DRV_NAME "SE7343-FPGA"
-#define pr_fmt(fmt) DRV_NAME ": " fmt
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/irqdomain.h>
-#include <linux/io.h>
-#include <linux/sizes.h>
-#include <mach-se/mach/se7343.h>
-
-#define PA_CPLD_BASE_ADDR 0x11400000
-#define PA_CPLD_ST_REG 0x08 /* CPLD Interrupt status register */
-#define PA_CPLD_IMSK_REG 0x0a /* CPLD Interrupt mask register */
-
-static void __iomem *se7343_irq_regs;
-struct irq_domain *se7343_irq_domain;
-
-static void se7343_irq_demux(struct irq_desc *desc)
-{
- struct irq_data *data = irq_desc_get_irq_data(desc);
- struct irq_chip *chip = irq_data_get_irq_chip(data);
- unsigned long mask;
- int bit;
-
- chip->irq_mask_ack(data);
-
- mask = ioread16(se7343_irq_regs + PA_CPLD_ST_REG);
-
- for_each_set_bit(bit, &mask, SE7343_FPGA_IRQ_NR)
- generic_handle_domain_irq(se7343_irq_domain, bit);
-
- chip->irq_unmask(data);
-}
-
-static void __init se7343_domain_init(void)
-{
- int i;
-
- se7343_irq_domain = irq_domain_add_linear(NULL, SE7343_FPGA_IRQ_NR,
- &irq_domain_simple_ops, NULL);
- if (unlikely(!se7343_irq_domain)) {
- printk("Failed to get IRQ domain\n");
- return;
- }
-
- for (i = 0; i < SE7343_FPGA_IRQ_NR; i++) {
- int irq = irq_create_mapping(se7343_irq_domain, i);
-
- if (unlikely(irq == 0)) {
- printk("Failed to allocate IRQ %d\n", i);
- return;
- }
- }
-}
-
-static void __init se7343_gc_init(void)
-{
- struct irq_chip_generic *gc;
- struct irq_chip_type *ct;
- unsigned int irq_base;
-
- irq_base = irq_linear_revmap(se7343_irq_domain, 0);
-
- gc = irq_alloc_generic_chip(DRV_NAME, 1, irq_base, se7343_irq_regs,
- handle_level_irq);
- if (unlikely(!gc))
- return;
-
- ct = gc->chip_types;
- ct->chip.irq_mask = irq_gc_mask_set_bit;
- ct->chip.irq_unmask = irq_gc_mask_clr_bit;
-
- ct->regs.mask = PA_CPLD_IMSK_REG;
-
- irq_setup_generic_chip(gc, IRQ_MSK(SE7343_FPGA_IRQ_NR),
- IRQ_GC_INIT_MASK_CACHE,
- IRQ_NOREQUEST | IRQ_NOPROBE, 0);
-
- irq_set_chained_handler(IRQ0_IRQ, se7343_irq_demux);
- irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
-
- irq_set_chained_handler(IRQ1_IRQ, se7343_irq_demux);
- irq_set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
-
- irq_set_chained_handler(IRQ4_IRQ, se7343_irq_demux);
- irq_set_irq_type(IRQ4_IRQ, IRQ_TYPE_LEVEL_LOW);
-
- irq_set_chained_handler(IRQ5_IRQ, se7343_irq_demux);
- irq_set_irq_type(IRQ5_IRQ, IRQ_TYPE_LEVEL_LOW);
-}
-
-/*
- * Initialize IRQ setting
- */
-void __init init_7343se_IRQ(void)
-{
- se7343_irq_regs = ioremap(PA_CPLD_BASE_ADDR, SZ_16);
- if (unlikely(!se7343_irq_regs)) {
- pr_err("Failed to remap CPLD\n");
- return;
- }
-
- /*
- * All FPGA IRQs disabled by default
- */
- iowrite16(0, se7343_irq_regs + PA_CPLD_IMSK_REG);
-
- __raw_writew(0x2000, 0xb03fffec); /* mrshpc irq enable */
-
- se7343_domain_init();
- se7343_gc_init();
-}
diff --git a/arch/sh/boards/mach-se/7343/setup.c b/arch/sh/boards/mach-se/7343/setup.c
deleted file mode 100644
index fe0e550601a2e2..00000000000000
--- a/arch/sh/boards/mach-se/7343/setup.c
+++ /dev/null
@@ -1,182 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
-#include <linux/serial_8250.h>
-#include <linux/serial_reg.h>
-#include <linux/usb/isp116x.h>
-#include <linux/delay.h>
-#include <linux/irqdomain.h>
-#include <asm/machvec.h>
-#include <mach-se/mach/se7343.h>
-#include <asm/heartbeat.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-
-static struct resource heartbeat_resource = {
- .start = PA_LED,
- .end = PA_LED,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-static struct mtd_partition nor_flash_partitions[] = {
- {
- .name = "loader",
- .offset = 0x00000000,
- .size = 128 * 1024,
- },
- {
- .name = "rootfs",
- .offset = MTDPART_OFS_APPEND,
- .size = 31 * 1024 * 1024,
- },
- {
- .name = "data",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data nor_flash_data = {
- .width = 2,
- .parts = nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(nor_flash_partitions),
-};
-
-static struct resource nor_flash_resources[] = {
- [0] = {
- .start = 0x00000000,
- .end = 0x01ffffff,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device nor_flash_device = {
- .name = "physmap-flash",
- .dev = {
- .platform_data = &nor_flash_data,
- },
- .num_resources = ARRAY_SIZE(nor_flash_resources),
- .resource = nor_flash_resources,
-};
-
-#define ST16C2550C_FLAGS (UPF_BOOT_AUTOCONF | UPF_IOREMAP)
-
-static struct plat_serial8250_port serial_platform_data[] = {
- [0] = {
- .iotype = UPIO_MEM,
- .mapbase = 0x16000000,
- .regshift = 1,
- .flags = ST16C2550C_FLAGS,
- .uartclk = 7372800,
- },
- [1] = {
- .iotype = UPIO_MEM,
- .mapbase = 0x17000000,
- .regshift = 1,
- .flags = ST16C2550C_FLAGS,
- .uartclk = 7372800,
- },
- { },
-};
-
-static struct platform_device uart_device = {
- .name = "serial8250",
- .id = PLAT8250_DEV_PLATFORM,
- .dev = {
- .platform_data = serial_platform_data,
- },
-};
-
-static void isp116x_delay(struct device *dev, int delay)
-{
- ndelay(delay);
-}
-
-static struct resource usb_resources[] = {
- [0] = {
- .start = 0x11800000,
- .end = 0x11800001,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 0x11800002,
- .end = 0x11800003,
- .flags = IORESOURCE_MEM,
- },
- [2] = {
- /* Filled in later */
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct isp116x_platform_data usb_platform_data = {
- .sel15Kres = 1,
- .oc_enable = 1,
- .int_act_high = 0,
- .int_edge_triggered = 0,
- .remote_wakeup_enable = 0,
- .delay = isp116x_delay,
-};
-
-static struct platform_device usb_device = {
- .name = "isp116x-hcd",
- .id = -1,
- .num_resources = ARRAY_SIZE(usb_resources),
- .resource = usb_resources,
- .dev = {
- .platform_data = &usb_platform_data,
- },
-
-};
-
-static struct platform_device *sh7343se_platform_devices[] __initdata = {
- &heartbeat_device,
- &nor_flash_device,
- &uart_device,
- &usb_device,
-};
-
-static int __init sh7343se_devices_setup(void)
-{
- /* Wire-up dynamic vectors */
- serial_platform_data[0].irq = irq_find_mapping(se7343_irq_domain,
- SE7343_FPGA_IRQ_UARTA);
- serial_platform_data[1].irq = irq_find_mapping(se7343_irq_domain,
- SE7343_FPGA_IRQ_UARTB);
- usb_resources[2].start = usb_resources[2].end =
- irq_find_mapping(se7343_irq_domain, SE7343_FPGA_IRQ_USB);
-
- return platform_add_devices(sh7343se_platform_devices,
- ARRAY_SIZE(sh7343se_platform_devices));
-}
-device_initcall(sh7343se_devices_setup);
-
-/*
- * Initialize the board
- */
-static void __init sh7343se_setup(char **cmdline_p)
-{
- __raw_writew(0xf900, FPGA_OUT); /* FPGA */
-
- __raw_writew(0x0002, PORT_PECR); /* PORT E 1 = IRQ5 */
- __raw_writew(0x0020, PORT_PSELD);
-
- printk(KERN_INFO "MS7343CP01 Setup...done\n");
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_7343se __initmv = {
- .mv_name = "SolutionEngine 7343",
- .mv_setup = sh7343se_setup,
- .mv_init_irq = init_7343se_IRQ,
-};
diff --git a/arch/sh/boards/mach-se/770x/Makefile b/arch/sh/boards/mach-se/770x/Makefile
deleted file mode 100644
index 900d93cfb6a531..00000000000000
--- a/arch/sh/boards/mach-se/770x/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the 770x SolutionEngine specific parts of the kernel
-#
-
-obj-y := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/770x/irq.c b/arch/sh/boards/mach-se/770x/irq.c
deleted file mode 100644
index 66e2c8aa0b69f3..00000000000000
--- a/arch/sh/boards/mach-se/770x/irq.c
+++ /dev/null
@@ -1,109 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/se/770x/irq.c
- *
- * Copyright (C) 2000 Kazumoto Kojima
- * Copyright (C) 2006 Nobuhiro Iwamatsu
- *
- * Hitachi SolutionEngine Support.
- *
- */
-
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-#include <mach-se/mach/se.h>
-
-static struct ipr_data ipr_irq_table[] = {
- /*
- * Super I/O (Just mimic PC):
- * 1: keyboard
- * 3: serial 0
- * 4: serial 1
- * 5: printer
- * 6: floppy
- * 8: rtc
- * 12: mouse
- * 14: ide0
- */
-#if defined(CONFIG_CPU_SUBTYPE_SH7705)
- /* This is default value */
- { 13, 0, 8, 0x0f-13, },
- { 5 , 0, 4, 0x0f- 5, },
- { 10, 1, 0, 0x0f-10, },
- { 7 , 2, 4, 0x0f- 7, },
- { 3 , 2, 0, 0x0f- 3, },
- { 1 , 3, 12, 0x0f- 1, },
- { 12, 3, 4, 0x0f-12, }, /* LAN */
- { 2 , 4, 8, 0x0f- 2, }, /* PCIRQ2 */
- { 6 , 4, 4, 0x0f- 6, }, /* PCIRQ1 */
- { 14, 4, 0, 0x0f-14, }, /* PCIRQ0 */
- { 0 , 5, 12, 0x0f , },
- { 4 , 5, 4, 0x0f- 4, },
- { 8 , 6, 12, 0x0f- 8, },
- { 9 , 6, 8, 0x0f- 9, },
- { 11, 6, 4, 0x0f-11, },
-#else
- { 14, 0, 8, 0x0f-14, },
- { 12, 0, 4, 0x0f-12, },
- { 8, 1, 4, 0x0f- 8, },
- { 6, 2, 12, 0x0f- 6, },
- { 5, 2, 8, 0x0f- 5, },
- { 4, 2, 4, 0x0f- 4, },
- { 3, 2, 0, 0x0f- 3, },
- { 1, 3, 12, 0x0f- 1, },
-#if defined(CONFIG_STNIC)
- /* ST NIC */
- { 10, 3, 4, 0x0f-10, }, /* LAN */
-#endif
- /* MRSHPC IRQs setting */
- { 0, 4, 12, 0x0f- 0, }, /* PCIRQ3 */
- { 11, 4, 8, 0x0f-11, }, /* PCIRQ2 */
- { 9, 4, 4, 0x0f- 9, }, /* PCIRQ1 */
- { 7, 4, 0, 0x0f- 7, }, /* PCIRQ0 */
- /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */
- /* NOTE: #2 and #13 are not used on PC */
- { 13, 6, 4, 0x0f-13, }, /* SLOTIRQ2 */
- { 2, 6, 0, 0x0f- 2, }, /* SLOTIRQ1 */
-#endif
-};
-
-static unsigned long ipr_offsets[] = {
- BCR_ILCRA,
- BCR_ILCRB,
- BCR_ILCRC,
- BCR_ILCRD,
- BCR_ILCRE,
- BCR_ILCRF,
- BCR_ILCRG,
-};
-
-static struct ipr_desc ipr_irq_desc = {
- .ipr_offsets = ipr_offsets,
- .nr_offsets = ARRAY_SIZE(ipr_offsets),
-
- .ipr_data = ipr_irq_table,
- .nr_irqs = ARRAY_SIZE(ipr_irq_table),
- .chip = {
- .name = "IPR-se770x",
- },
-};
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se_IRQ(void)
-{
- /* Disable all interrupts */
- __raw_writew(0, BCR_ILCRA);
- __raw_writew(0, BCR_ILCRB);
- __raw_writew(0, BCR_ILCRC);
- __raw_writew(0, BCR_ILCRD);
- __raw_writew(0, BCR_ILCRE);
- __raw_writew(0, BCR_ILCRF);
- __raw_writew(0, BCR_ILCRG);
-
- register_ipr_controller(&ipr_irq_desc);
-}
diff --git a/arch/sh/boards/mach-se/770x/setup.c b/arch/sh/boards/mach-se/770x/setup.c
deleted file mode 100644
index 412326d59e6fce..00000000000000
--- a/arch/sh/boards/mach-se/770x/setup.c
+++ /dev/null
@@ -1,205 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/se/770x/setup.c
- *
- * Copyright (C) 2000 Kazumoto Kojima
- *
- * Hitachi SolutionEngine Support.
- *
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/sh_eth.h>
-#include <mach-se/mach/se.h>
-#include <mach-se/mach/mrshpc.h>
-#include <asm/machvec.h>
-#include <asm/io.h>
-#include <asm/smc37c93x.h>
-#include <asm/heartbeat.h>
-
-/*
- * Configure the Super I/O chip
- */
-static void __init smsc_config(int index, int data)
-{
- outb_p(index, INDEX_PORT);
- outb_p(data, DATA_PORT);
-}
-
-/* XXX: Another candidate for a more generic cchip machine vector */
-static void __init smsc_setup(char **cmdline_p)
-{
- outb_p(CONFIG_ENTER, CONFIG_PORT);
- outb_p(CONFIG_ENTER, CONFIG_PORT);
-
- /* FDC */
- smsc_config(CURRENT_LDN_INDEX, LDN_FDC);
- smsc_config(ACTIVATE_INDEX, 0x01);
- smsc_config(IRQ_SELECT_INDEX, 6); /* IRQ6 */
-
- /* AUXIO (GPIO): to use IDE1 */
- smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO);
- smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */
- smsc_config(GPIO47_INDEX, 0x00); /* nIOWOP */
-
- /* COM1 */
- smsc_config(CURRENT_LDN_INDEX, LDN_COM1);
- smsc_config(ACTIVATE_INDEX, 0x01);
- smsc_config(IO_BASE_HI_INDEX, 0x03);
- smsc_config(IO_BASE_LO_INDEX, 0xf8);
- smsc_config(IRQ_SELECT_INDEX, 4); /* IRQ4 */
-
- /* COM2 */
- smsc_config(CURRENT_LDN_INDEX, LDN_COM2);
- smsc_config(ACTIVATE_INDEX, 0x01);
- smsc_config(IO_BASE_HI_INDEX, 0x02);
- smsc_config(IO_BASE_LO_INDEX, 0xf8);
- smsc_config(IRQ_SELECT_INDEX, 3); /* IRQ3 */
-
- /* RTC */
- smsc_config(CURRENT_LDN_INDEX, LDN_RTC);
- smsc_config(ACTIVATE_INDEX, 0x01);
- smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */
-
- /* XXX: PARPORT, KBD, and MOUSE will come here... */
- outb_p(CONFIG_EXIT, CONFIG_PORT);
-}
-
-
-static struct resource cf_ide_resources[] = {
- [0] = {
- .start = PA_MRSHPC_IO + 0x1f0,
- .end = PA_MRSHPC_IO + 0x1f0 + 8,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = PA_MRSHPC_IO + 0x1f0 + 0x206,
- .end = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
- .flags = IORESOURCE_MEM,
- },
- [2] = {
- .start = IRQ_CFCARD,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device cf_ide_device = {
- .name = "pata_platform",
- .id = -1,
- .num_resources = ARRAY_SIZE(cf_ide_resources),
- .resource = cf_ide_resources,
-};
-
-static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
-
-static struct heartbeat_data heartbeat_data = {
- .bit_pos = heartbeat_bit_pos,
- .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
-};
-
-static struct resource heartbeat_resource = {
- .start = PA_LED,
- .end = PA_LED,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .dev = {
- .platform_data = &heartbeat_data,
- },
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
- defined(CONFIG_CPU_SUBTYPE_SH7712)
-/* SH771X Ethernet driver */
-static struct sh_eth_plat_data sh_eth_plat = {
- .phy = PHY_ID,
- .phy_interface = PHY_INTERFACE_MODE_MII,
-};
-
-static struct resource sh_eth0_resources[] = {
- [0] = {
- .start = SH_ETH0_BASE,
- .end = SH_ETH0_BASE + 0x1B8 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = SH_TSU_BASE,
- .end = SH_TSU_BASE + 0x200 - 1,
- .flags = IORESOURCE_MEM,
- },
- [2] = {
- .start = SH_ETH0_IRQ,
- .end = SH_ETH0_IRQ,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device sh_eth0_device = {
- .name = "sh771x-ether",
- .id = 0,
- .dev = {
- .platform_data = &sh_eth_plat,
- },
- .num_resources = ARRAY_SIZE(sh_eth0_resources),
- .resource = sh_eth0_resources,
-};
-
-static struct resource sh_eth1_resources[] = {
- [0] = {
- .start = SH_ETH1_BASE,
- .end = SH_ETH1_BASE + 0x1B8 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = SH_TSU_BASE,
- .end = SH_TSU_BASE + 0x200 - 1,
- .flags = IORESOURCE_MEM,
- },
- [2] = {
- .start = SH_ETH1_IRQ,
- .end = SH_ETH1_IRQ,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device sh_eth1_device = {
- .name = "sh771x-ether",
- .id = 1,
- .dev = {
- .platform_data = &sh_eth_plat,
- },
- .num_resources = ARRAY_SIZE(sh_eth1_resources),
- .resource = sh_eth1_resources,
-};
-#endif
-
-static struct platform_device *se_devices[] __initdata = {
- &heartbeat_device,
- &cf_ide_device,
-#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
- defined(CONFIG_CPU_SUBTYPE_SH7712)
- &sh_eth0_device,
- &sh_eth1_device,
-#endif
-};
-
-static int __init se_devices_setup(void)
-{
- mrshpc_setup_windows();
- return platform_add_devices(se_devices, ARRAY_SIZE(se_devices));
-}
-device_initcall(se_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_se __initmv = {
- .mv_name = "SolutionEngine",
- .mv_setup = smsc_setup,
- .mv_init_irq = init_se_IRQ,
-};
diff --git a/arch/sh/boards/mach-se/7721/Makefile b/arch/sh/boards/mach-se/7721/Makefile
deleted file mode 100644
index 09436f10ddf198..00000000000000
--- a/arch/sh/boards/mach-se/7721/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-y := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/7721/irq.c b/arch/sh/boards/mach-se/7721/irq.c
deleted file mode 100644
index e6ef2a2655c37c..00000000000000
--- a/arch/sh/boards/mach-se/7721/irq.c
+++ /dev/null
@@ -1,42 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/se/7721/irq.c
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <mach-se/mach/se7721.h>
-
-enum {
- UNUSED = 0,
-
- /* board specific interrupt sources */
- MRSHPC,
-};
-
-static struct intc_vect vectors[] __initdata = {
- INTC_IRQ(MRSHPC, MRSHPC_IRQ0),
-};
-
-static struct intc_prio_reg prio_registers[] __initdata = {
- { FPGA_ILSR6, 0, 8, 4, /* IRLMSK */
- { 0, MRSHPC } },
-};
-
-static DECLARE_INTC_DESC(intc_desc, "SE7721", vectors,
- NULL, NULL, prio_registers, NULL);
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se7721_IRQ(void)
-{
- /* PPCR */
- __raw_writew(__raw_readw(0xa4050118) & ~0x00ff, 0xa4050118);
-
- register_intc_controller(&intc_desc);
- intc_set_priority(MRSHPC_IRQ0, 0xf - MRSHPC_IRQ0);
-}
diff --git a/arch/sh/boards/mach-se/7721/setup.c b/arch/sh/boards/mach-se/7721/setup.c
deleted file mode 100644
index 3af724dc4ba44a..00000000000000
--- a/arch/sh/boards/mach-se/7721/setup.c
+++ /dev/null
@@ -1,92 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/se/7721/setup.c
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- *
- * Hitachi UL SolutionEngine 7721 Support.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <mach-se/mach/se7721.h>
-#include <mach-se/mach/mrshpc.h>
-#include <asm/machvec.h>
-#include <asm/io.h>
-#include <asm/heartbeat.h>
-
-static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
-
-static struct heartbeat_data heartbeat_data = {
- .bit_pos = heartbeat_bit_pos,
- .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
-};
-
-static struct resource heartbeat_resource = {
- .start = PA_LED,
- .end = PA_LED,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .dev = {
- .platform_data = &heartbeat_data,
- },
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-static struct resource cf_ide_resources[] = {
- [0] = {
- .start = PA_MRSHPC_IO + 0x1f0,
- .end = PA_MRSHPC_IO + 0x1f0 + 8 ,
- .flags = IORESOURCE_IO,
- },
- [1] = {
- .start = PA_MRSHPC_IO + 0x1f0 + 0x206,
- .end = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
- .flags = IORESOURCE_IO,
- },
- [2] = {
- .start = MRSHPC_IRQ0,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device cf_ide_device = {
- .name = "pata_platform",
- .id = -1,
- .num_resources = ARRAY_SIZE(cf_ide_resources),
- .resource = cf_ide_resources,
-};
-
-static struct platform_device *se7721_devices[] __initdata = {
- &cf_ide_device,
- &heartbeat_device
-};
-
-static int __init se7721_devices_setup(void)
-{
- mrshpc_setup_windows();
- return platform_add_devices(se7721_devices, ARRAY_SIZE(se7721_devices));
-}
-device_initcall(se7721_devices_setup);
-
-static void __init se7721_setup(char **cmdline_p)
-{
- /* for USB */
- __raw_writew(0x0000, 0xA405010C); /* PGCR */
- __raw_writew(0x0000, 0xA405010E); /* PHCR */
- __raw_writew(0x00AA, 0xA4050118); /* PPCR */
- __raw_writew(0x0000, 0xA4050124); /* PSELA */
-}
-
-/*
- * The Machine Vector
- */
-struct sh_machine_vector mv_se7721 __initmv = {
- .mv_name = "Solution Engine 7721",
- .mv_setup = se7721_setup,
- .mv_init_irq = init_se7721_IRQ,
-};
diff --git a/arch/sh/boards/mach-se/7722/Makefile b/arch/sh/boards/mach-se/7722/Makefile
deleted file mode 100644
index a5e89c0c6bb2d4..00000000000000
--- a/arch/sh/boards/mach-se/7722/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the HITACHI UL SolutionEngine 7722 specific parts of the kernel
-#
-# This file is subject to the terms and conditions of the GNU General Public
-# License. See the file "COPYING" in the main directory of this archive
-# for more details.
-#
-#
-
-obj-y := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/7722/irq.c b/arch/sh/boards/mach-se/7722/irq.c
deleted file mode 100644
index efa96edd47dc5f..00000000000000
--- a/arch/sh/boards/mach-se/7722/irq.c
+++ /dev/null
@@ -1,116 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Hitachi UL SolutionEngine 7722 FPGA IRQ Support.
- *
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- * Copyright (C) 2012 Paul Mundt
- */
-#define DRV_NAME "SE7722-FPGA"
-#define pr_fmt(fmt) DRV_NAME ": " fmt
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/irqdomain.h>
-#include <linux/io.h>
-#include <linux/err.h>
-#include <linux/sizes.h>
-#include <mach-se/mach/se7722.h>
-
-#define IRQ01_BASE_ADDR 0x11800000
-#define IRQ01_MODE_REG 0
-#define IRQ01_STS_REG 4
-#define IRQ01_MASK_REG 8
-
-static void __iomem *se7722_irq_regs;
-struct irq_domain *se7722_irq_domain;
-
-static void se7722_irq_demux(struct irq_desc *desc)
-{
- struct irq_data *data = irq_desc_get_irq_data(desc);
- struct irq_chip *chip = irq_data_get_irq_chip(data);
- unsigned long mask;
- int bit;
-
- chip->irq_mask_ack(data);
-
- mask = ioread16(se7722_irq_regs + IRQ01_STS_REG);
-
- for_each_set_bit(bit, &mask, SE7722_FPGA_IRQ_NR)
- generic_handle_domain_irq(se7722_irq_domain, bit);
-
- chip->irq_unmask(data);
-}
-
-static void __init se7722_domain_init(void)
-{
- int i;
-
- se7722_irq_domain = irq_domain_add_linear(NULL, SE7722_FPGA_IRQ_NR,
- &irq_domain_simple_ops, NULL);
- if (unlikely(!se7722_irq_domain)) {
- printk("Failed to get IRQ domain\n");
- return;
- }
-
- for (i = 0; i < SE7722_FPGA_IRQ_NR; i++) {
- int irq = irq_create_mapping(se7722_irq_domain, i);
-
- if (unlikely(irq == 0)) {
- printk("Failed to allocate IRQ %d\n", i);
- return;
- }
- }
-}
-
-static void __init se7722_gc_init(void)
-{
- struct irq_chip_generic *gc;
- struct irq_chip_type *ct;
- unsigned int irq_base;
-
- irq_base = irq_linear_revmap(se7722_irq_domain, 0);
-
- gc = irq_alloc_generic_chip(DRV_NAME, 1, irq_base, se7722_irq_regs,
- handle_level_irq);
- if (unlikely(!gc))
- return;
-
- ct = gc->chip_types;
- ct->chip.irq_mask = irq_gc_mask_set_bit;
- ct->chip.irq_unmask = irq_gc_mask_clr_bit;
-
- ct->regs.mask = IRQ01_MASK_REG;
-
- irq_setup_generic_chip(gc, IRQ_MSK(SE7722_FPGA_IRQ_NR),
- IRQ_GC_INIT_MASK_CACHE,
- IRQ_NOREQUEST | IRQ_NOPROBE, 0);
-
- irq_set_chained_handler(IRQ0_IRQ, se7722_irq_demux);
- irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
-
- irq_set_chained_handler(IRQ1_IRQ, se7722_irq_demux);
- irq_set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
-}
-
-/*
- * Initialize FPGA IRQs
- */
-void __init init_se7722_IRQ(void)
-{
- se7722_irq_regs = ioremap(IRQ01_BASE_ADDR, SZ_16);
- if (unlikely(!se7722_irq_regs)) {
- printk("Failed to remap IRQ01 regs\n");
- return;
- }
-
- /*
- * All FPGA IRQs disabled by default
- */
- iowrite16(0, se7722_irq_regs + IRQ01_MASK_REG);
-
- __raw_writew(0x2000, 0xb03fffec); /* mrshpc irq enable */
-
- se7722_domain_init();
- se7722_gc_init();
-}
diff --git a/arch/sh/boards/mach-se/7722/setup.c b/arch/sh/boards/mach-se/7722/setup.c
deleted file mode 100644
index 2cd4a2e84b930c..00000000000000
--- a/arch/sh/boards/mach-se/7722/setup.c
+++ /dev/null
@@ -1,190 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/se/7722/setup.c
- *
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- * Copyright (C) 2012 Paul Mundt
- *
- * Hitachi UL SolutionEngine 7722 Support.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/input.h>
-#include <linux/input/sh_keysc.h>
-#include <linux/irqdomain.h>
-#include <linux/smc91x.h>
-#include <linux/sh_intc.h>
-#include <mach-se/mach/se7722.h>
-#include <mach-se/mach/mrshpc.h>
-#include <asm/machvec.h>
-#include <asm/clock.h>
-#include <asm/io.h>
-#include <asm/heartbeat.h>
-#include <cpu/sh7722.h>
-
-/* Heartbeat */
-static struct resource heartbeat_resource = {
- .start = PA_LED,
- .end = PA_LED,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-/* SMC91x */
-static struct smc91x_platdata smc91x_info = {
- .flags = SMC91X_USE_16BIT,
-};
-
-static struct resource smc91x_eth_resources[] = {
- [0] = {
- .name = "smc91x-regs" ,
- .start = PA_LAN + 0x300,
- .end = PA_LAN + 0x300 + 0x10 ,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- /* Filled in later */
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device smc91x_eth_device = {
- .name = "smc91x",
- .id = 0,
- .dev = {
- .dma_mask = NULL, /* don't use dma */
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &smc91x_info,
- },
- .num_resources = ARRAY_SIZE(smc91x_eth_resources),
- .resource = smc91x_eth_resources,
-};
-
-static struct resource cf_ide_resources[] = {
- [0] = {
- .start = PA_MRSHPC_IO + 0x1f0,
- .end = PA_MRSHPC_IO + 0x1f0 + 8 ,
- .flags = IORESOURCE_IO,
- },
- [1] = {
- .start = PA_MRSHPC_IO + 0x1f0 + 0x206,
- .end = PA_MRSHPC_IO + 0x1f0 +8 + 0x206 + 8,
- .flags = IORESOURCE_IO,
- },
- [2] = {
- /* Filled in later */
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device cf_ide_device = {
- .name = "pata_platform",
- .id = -1,
- .num_resources = ARRAY_SIZE(cf_ide_resources),
- .resource = cf_ide_resources,
-};
-
-static struct sh_keysc_info sh_keysc_info = {
- .mode = SH_KEYSC_MODE_1, /* KEYOUT0->5, KEYIN0->4 */
- .scan_timing = 3,
- .delay = 5,
- .keycodes = { /* SW1 -> SW30 */
- KEY_A, KEY_B, KEY_C, KEY_D, KEY_E,
- KEY_F, KEY_G, KEY_H, KEY_I, KEY_J,
- KEY_K, KEY_L, KEY_M, KEY_N, KEY_O,
- KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T,
- KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y,
- KEY_Z,
- KEY_HOME, KEY_SLEEP, KEY_WAKEUP, KEY_COFFEE, /* life */
- },
-};
-
-static struct resource sh_keysc_resources[] = {
- [0] = {
- .start = 0x044b0000,
- .end = 0x044b000f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xbe0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device sh_keysc_device = {
- .name = "sh_keysc",
- .id = 0, /* "keysc0" clock */
- .num_resources = ARRAY_SIZE(sh_keysc_resources),
- .resource = sh_keysc_resources,
- .dev = {
- .platform_data = &sh_keysc_info,
- },
-};
-
-static struct platform_device *se7722_devices[] __initdata = {
- &heartbeat_device,
- &smc91x_eth_device,
- &cf_ide_device,
- &sh_keysc_device,
-};
-
-static int __init se7722_devices_setup(void)
-{
- mrshpc_setup_windows();
-
- /* Wire-up dynamic vectors */
- cf_ide_resources[2].start = cf_ide_resources[2].end =
- irq_find_mapping(se7722_irq_domain, SE7722_FPGA_IRQ_MRSHPC0);
-
- smc91x_eth_resources[1].start = smc91x_eth_resources[1].end =
- irq_find_mapping(se7722_irq_domain, SE7722_FPGA_IRQ_SMC);
-
- return platform_add_devices(se7722_devices, ARRAY_SIZE(se7722_devices));
-}
-device_initcall(se7722_devices_setup);
-
-static void __init se7722_setup(char **cmdline_p)
-{
- __raw_writew(0x010D, FPGA_OUT); /* FPGA */
-
- __raw_writew(0x0000, PORT_PECR); /* PORT E 1 = IRQ5 ,E 0 = BS */
- __raw_writew(0x1000, PORT_PJCR); /* PORT J 1 = IRQ1,J 0 =IRQ0 */
-
- /* LCDC I/O */
- __raw_writew(0x0020, PORT_PSELD);
-
- /* SIOF1*/
- __raw_writew(0x0003, PORT_PSELB);
- __raw_writew(0xe000, PORT_PSELC);
- __raw_writew(0x0000, PORT_PKCR);
-
- /* LCDC */
- __raw_writew(0x4020, PORT_PHCR);
- __raw_writew(0x0000, PORT_PLCR);
- __raw_writew(0x0000, PORT_PMCR);
- __raw_writew(0x0002, PORT_PRCR);
- __raw_writew(0x0000, PORT_PXCR); /* LCDC,CS6A */
-
- /* KEYSC */
- __raw_writew(0x0A10, PORT_PSELA); /* BS,SHHID2 */
- __raw_writew(0x0000, PORT_PYCR);
- __raw_writew(0x0000, PORT_PZCR);
- __raw_writew(__raw_readw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
- __raw_writew(__raw_readw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_se7722 __initmv = {
- .mv_name = "Solution Engine 7722" ,
- .mv_setup = se7722_setup ,
- .mv_init_irq = init_se7722_IRQ,
-};
diff --git a/arch/sh/boards/mach-se/7724/Makefile b/arch/sh/boards/mach-se/7724/Makefile
deleted file mode 100644
index 6c6112b24617d0..00000000000000
--- a/arch/sh/boards/mach-se/7724/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the HITACHI UL SolutionEngine 7724 specific parts of the kernel
-#
-# This file is subject to the terms and conditions of the GNU General Public
-# License. See the file "COPYING" in the main directory of this archive
-# for more details.
-#
-#
-
-obj-y := setup.o irq.o sdram.o
diff --git a/arch/sh/boards/mach-se/7724/irq.c b/arch/sh/boards/mach-se/7724/irq.c
deleted file mode 100644
index 14ce3024738f3b..00000000000000
--- a/arch/sh/boards/mach-se/7724/irq.c
+++ /dev/null
@@ -1,143 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/se/7724/irq.c
- *
- * Copyright (C) 2009 Renesas Solutions Corp.
- *
- * Kuninori Morimoto <[email protected]>
- *
- * Based on linux/arch/sh/boards/se/7722/irq.c
- * Copyright (C) 2007 Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7724 Support.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/export.h>
-#include <linux/topology.h>
-#include <linux/io.h>
-#include <linux/err.h>
-#include <mach-se/mach/se7724.h>
-
-struct fpga_irq {
- unsigned long sraddr;
- unsigned long mraddr;
- unsigned short mask;
- unsigned int base;
-};
-
-static unsigned int fpga2irq(unsigned int irq)
-{
- if (irq >= IRQ0_BASE &&
- irq <= IRQ0_END)
- return IRQ0_IRQ;
- else if (irq >= IRQ1_BASE &&
- irq <= IRQ1_END)
- return IRQ1_IRQ;
- else
- return IRQ2_IRQ;
-}
-
-static struct fpga_irq get_fpga_irq(unsigned int irq)
-{
- struct fpga_irq set;
-
- switch (irq) {
- case IRQ0_IRQ:
- set.sraddr = IRQ0_SR;
- set.mraddr = IRQ0_MR;
- set.mask = IRQ0_MASK;
- set.base = IRQ0_BASE;
- break;
- case IRQ1_IRQ:
- set.sraddr = IRQ1_SR;
- set.mraddr = IRQ1_MR;
- set.mask = IRQ1_MASK;
- set.base = IRQ1_BASE;
- break;
- default:
- set.sraddr = IRQ2_SR;
- set.mraddr = IRQ2_MR;
- set.mask = IRQ2_MASK;
- set.base = IRQ2_BASE;
- break;
- }
-
- return set;
-}
-
-static void disable_se7724_irq(struct irq_data *data)
-{
- unsigned int irq = data->irq;
- struct fpga_irq set = get_fpga_irq(fpga2irq(irq));
- unsigned int bit = irq - set.base;
- __raw_writew(__raw_readw(set.mraddr) | 0x0001 << bit, set.mraddr);
-}
-
-static void enable_se7724_irq(struct irq_data *data)
-{
- unsigned int irq = data->irq;
- struct fpga_irq set = get_fpga_irq(fpga2irq(irq));
- unsigned int bit = irq - set.base;
- __raw_writew(__raw_readw(set.mraddr) & ~(0x0001 << bit), set.mraddr);
-}
-
-static struct irq_chip se7724_irq_chip __read_mostly = {
- .name = "SE7724-FPGA",
- .irq_mask = disable_se7724_irq,
- .irq_unmask = enable_se7724_irq,
-};
-
-static void se7724_irq_demux(struct irq_desc *desc)
-{
- unsigned int irq = irq_desc_get_irq(desc);
- struct fpga_irq set = get_fpga_irq(irq);
- unsigned short intv = __raw_readw(set.sraddr);
- unsigned int ext_irq = set.base;
-
- intv &= set.mask;
-
- for (; intv; intv >>= 1, ext_irq++) {
- if (!(intv & 1))
- continue;
-
- generic_handle_irq(ext_irq);
- }
-}
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se7724_IRQ(void)
-{
- int irq_base, i;
-
- __raw_writew(0xffff, IRQ0_MR); /* mask all */
- __raw_writew(0xffff, IRQ1_MR); /* mask all */
- __raw_writew(0xffff, IRQ2_MR); /* mask all */
- __raw_writew(0x0000, IRQ0_SR); /* clear irq */
- __raw_writew(0x0000, IRQ1_SR); /* clear irq */
- __raw_writew(0x0000, IRQ2_SR); /* clear irq */
- __raw_writew(0x002a, IRQ_MODE); /* set irq type */
-
- irq_base = irq_alloc_descs(SE7724_FPGA_IRQ_BASE, SE7724_FPGA_IRQ_BASE,
- SE7724_FPGA_IRQ_NR, numa_node_id());
- if (IS_ERR_VALUE(irq_base)) {
- pr_err("%s: failed hooking irqs for FPGA\n", __func__);
- return;
- }
-
- for (i = 0; i < SE7724_FPGA_IRQ_NR; i++)
- irq_set_chip_and_handler_name(irq_base + i, &se7724_irq_chip,
- handle_level_irq, "level");
-
- irq_set_chained_handler(IRQ0_IRQ, se7724_irq_demux);
- irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
-
- irq_set_chained_handler(IRQ1_IRQ, se7724_irq_demux);
- irq_set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
-
- irq_set_chained_handler(IRQ2_IRQ, se7724_irq_demux);
- irq_set_irq_type(IRQ2_IRQ, IRQ_TYPE_LEVEL_LOW);
-}
diff --git a/arch/sh/boards/mach-se/7724/sdram.S b/arch/sh/boards/mach-se/7724/sdram.S
deleted file mode 100644
index 61c1fe78d71a05..00000000000000
--- a/arch/sh/boards/mach-se/7724/sdram.S
+++ /dev/null
@@ -1,128 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
- * MS7724SE sdram self/auto-refresh setup code
- *
- * Copyright (C) 2009 Magnus Damm
- */
-
-#include <linux/sys.h>
-#include <linux/errno.h>
-#include <linux/linkage.h>
-#include <asm/asm-offsets.h>
-#include <asm/suspend.h>
-#include <asm/romimage-macros.h>
-
-/* code to enter and leave self-refresh. must be self-contained.
- * this code will be copied to on-chip memory and executed from there.
- */
- .balign 4
-ENTRY(ms7724se_sdram_enter_start)
-
- /* DBSC: put memory in self-refresh mode */
-
- ED 0xFD000010, 0x00000000 /* DBEN */
- ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
- ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
-
- rts
- nop
-
-ENTRY(ms7724se_sdram_enter_end)
-
- .balign 4
-ENTRY(ms7724se_sdram_leave_start)
-
- /* DBSC: put memory in auto-refresh mode */
-
- mov.l @(SH_SLEEP_MODE, r5), r0
- tst #SUSP_SH_RSTANDBY, r0
- bf resume_rstandby
-
- ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
- WAIT 1
- ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000010, 0x00000001 /* DBEN */
- ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
-
- rts
- nop
-
-resume_rstandby:
-
- /* CPG: setup clocks before restarting external memory */
-
- ED 0xA4150024, 0x00004000 /* PLLCR */
-
- mov.l FRQCRA,r0
- mov.l @r0,r3
- mov.l KICK,r1
- or r1, r3
- mov.l r3, @r0
-
- mov.l LSTATS,r0
- mov #1,r1
-WAIT_LSTATS:
- mov.l @r0,r3
- tst r1,r3
- bf WAIT_LSTATS
-
- /* DBSC: re-initialize and put in auto-refresh */
-
- ED 0xFD000108, 0x00000181 /* DBPDCNT0 */
- ED 0xFD000020, 0x015B0002 /* DBCONF */
- ED 0xFD000030, 0x03071502 /* DBTR0 */
- ED 0xFD000034, 0x02020102 /* DBTR1 */
- ED 0xFD000038, 0x01090405 /* DBTR2 */
- ED 0xFD00003C, 0x00000002 /* DBTR3 */
- ED 0xFD000008, 0x00000005 /* DBKIND */
- ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
- ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
- ED 0xFD000018, 0x00000001 /* DBCKECNT */
-
- mov #100,r0
-WAIT_400NS:
- dt r0
- bf WAIT_400NS
-
- ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
- ED 0xFD000060, 0x00020000 /* DBMRCNT (EMR2) */
- ED 0xFD000060, 0x00030000 /* DBMRCNT (EMR3) */
- ED 0xFD000060, 0x00010004 /* DBMRCNT (EMR) */
- ED 0xFD000060, 0x00000532 /* DBMRCNT (MRS) */
- ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000060, 0x00000432 /* DBMRCNT (MRS) */
- ED 0xFD000060, 0x000103c0 /* DBMRCNT (EMR) */
- ED 0xFD000060, 0x00010040 /* DBMRCNT (EMR) */
-
- mov #100,r0
-WAIT_400NS_2:
- dt r0
- bf WAIT_400NS_2
-
- ED 0xFD000010, 0x00000001 /* DBEN */
- ED 0xFD000044, 0x0000050f /* DBRFPDN1 */
- ED 0xFD000048, 0x236800e6 /* DBRFPDN2 */
-
- mov.l DUMMY,r0
- mov.l @r0, r1 /* force single dummy read */
-
- ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
- ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
- ED 0xFD000108, 0x00000080 /* DBPDCNT0 */
- ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
-
- rts
- nop
-
- .balign 4
-DUMMY: .long 0xac400000
-FRQCRA: .long 0xa4150000
-KICK: .long 0x80000000
-LSTATS: .long 0xa4150060
-
-ENTRY(ms7724se_sdram_leave_end)
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
deleted file mode 100644
index b60a2626e18b27..00000000000000
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ /dev/null
@@ -1,986 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/se/7724/setup.c
- *
- * Copyright (C) 2009 Renesas Solutions Corp.
- *
- * Kuninori Morimoto <[email protected]>
- */
-#include <asm/clock.h>
-#include <asm/heartbeat.h>
-#include <asm/io.h>
-#include <asm/suspend.h>
-
-#include <cpu/sh7724.h>
-
-#include <linux/delay.h>
-#include <linux/device.h>
-#include <linux/gpio.h>
-#include <linux/init.h>
-#include <linux/input.h>
-#include <linux/input/sh_keysc.h>
-#include <linux/interrupt.h>
-#include <linux/memblock.h>
-#include <linux/mfd/tmio.h>
-#include <linux/mmc/host.h>
-#include <linux/mtd/physmap.h>
-#include <linux/platform_device.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/sh_eth.h>
-#include <linux/sh_intc.h>
-#include <linux/smc91x.h>
-#include <linux/usb/r8a66597.h>
-#include <linux/videodev2.h>
-#include <linux/dma-map-ops.h>
-
-#include <mach-se/mach/se7724.h>
-#include <media/drv-intf/renesas-ceu.h>
-
-#include <sound/sh_fsi.h>
-#include <sound/simple_card.h>
-
-#include <video/sh_mobile_lcdc.h>
-
-#define CEU_BUFFER_MEMORY_SIZE (4 << 20)
-static phys_addr_t ceu0_dma_membase;
-static phys_addr_t ceu1_dma_membase;
-
-/*
- * SWx 1234 5678
- * ------------------------------------
- * SW31 : 1001 1100 : default
- * SW32 : 0111 1111 : use on board flash
- *
- * SW41 : abxx xxxx -> a = 0 : Analog monitor
- * 1 : Digital monitor
- * b = 0 : VGA
- * 1 : 720p
- */
-
-/*
- * about 720p
- *
- * When you use 1280 x 720 lcdc output,
- * you should change OSC6 lcdc clock from 25.175MHz to 74.25MHz,
- * and change SW41 to use 720p
- */
-
-/*
- * about sound
- *
- * This setup.c supports FSI slave mode.
- * Please change J20, J21, J22 pin to 1-2 connection.
- */
-
-/* Heartbeat */
-static struct resource heartbeat_resource = {
- .start = PA_LED,
- .end = PA_LED,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-/* LAN91C111 */
-static struct smc91x_platdata smc91x_info = {
- .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
-};
-
-static struct resource smc91x_eth_resources[] = {
- [0] = {
- .name = "SMC91C111" ,
- .start = 0x1a300300,
- .end = 0x1a30030f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = IRQ0_SMC,
- .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
- },
-};
-
-static struct platform_device smc91x_eth_device = {
- .name = "smc91x",
- .num_resources = ARRAY_SIZE(smc91x_eth_resources),
- .resource = smc91x_eth_resources,
- .dev = {
- .platform_data = &smc91x_info,
- },
-};
-
-/* MTD */
-static struct mtd_partition nor_flash_partitions[] = {
- {
- .name = "uboot",
- .offset = 0,
- .size = (1 * 1024 * 1024),
- .mask_flags = MTD_WRITEABLE, /* Read-only */
- }, {
- .name = "kernel",
- .offset = MTDPART_OFS_APPEND,
- .size = (2 * 1024 * 1024),
- }, {
- .name = "free-area",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data nor_flash_data = {
- .width = 2,
- .parts = nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(nor_flash_partitions),
-};
-
-static struct resource nor_flash_resources[] = {
- [0] = {
- .name = "NOR Flash",
- .start = 0x00000000,
- .end = 0x01ffffff,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device nor_flash_device = {
- .name = "physmap-flash",
- .resource = nor_flash_resources,
- .num_resources = ARRAY_SIZE(nor_flash_resources),
- .dev = {
- .platform_data = &nor_flash_data,
- },
-};
-
-/* LCDC */
-static const struct fb_videomode lcdc_720p_modes[] = {
- {
- .name = "LB070WV1",
- .sync = 0, /* hsync and vsync are active low */
- .xres = 1280,
- .yres = 720,
- .left_margin = 220,
- .right_margin = 110,
- .hsync_len = 40,
- .upper_margin = 20,
- .lower_margin = 5,
- .vsync_len = 5,
- },
-};
-
-static const struct fb_videomode lcdc_vga_modes[] = {
- {
- .name = "LB070WV1",
- .sync = 0, /* hsync and vsync are active low */
- .xres = 640,
- .yres = 480,
- .left_margin = 105,
- .right_margin = 50,
- .hsync_len = 96,
- .upper_margin = 33,
- .lower_margin = 10,
- .vsync_len = 2,
- },
-};
-
-static struct sh_mobile_lcdc_info lcdc_info = {
- .clock_source = LCDC_CLK_EXTERNAL,
- .ch[0] = {
- .chan = LCDC_CHAN_MAINLCD,
- .fourcc = V4L2_PIX_FMT_RGB565,
- .clock_divider = 1,
- .panel_cfg = { /* 7.0 inch */
- .width = 152,
- .height = 91,
- },
- }
-};
-
-static struct resource lcdc_resources[] = {
- [0] = {
- .name = "LCDC",
- .start = 0xfe940000,
- .end = 0xfe942fff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xf40),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device lcdc_device = {
- .name = "sh_mobile_lcdc_fb",
- .num_resources = ARRAY_SIZE(lcdc_resources),
- .resource = lcdc_resources,
- .dev = {
- .platform_data = &lcdc_info,
- },
-};
-
-/* CEU0 */
-static struct ceu_platform_data ceu0_pdata = {
- .num_subdevs = 0,
-};
-
-static struct resource ceu0_resources[] = {
- [0] = {
- .name = "CEU0",
- .start = 0xfe910000,
- .end = 0xfe91009f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x880),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device ceu0_device = {
- .name = "renesas-ceu",
- .id = 0, /* "ceu.0" clock */
- .num_resources = ARRAY_SIZE(ceu0_resources),
- .resource = ceu0_resources,
- .dev = {
- .platform_data = &ceu0_pdata,
- },
-};
-
-/* CEU1 */
-static struct ceu_platform_data ceu1_pdata = {
- .num_subdevs = 0,
-};
-
-static struct resource ceu1_resources[] = {
- [0] = {
- .name = "CEU1",
- .start = 0xfe914000,
- .end = 0xfe91409f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x9e0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device ceu1_device = {
- .name = "renesas-ceu",
- .id = 1, /* "ceu.1" clock */
- .num_resources = ARRAY_SIZE(ceu1_resources),
- .resource = ceu1_resources,
- .dev = {
- .platform_data = &ceu1_pdata,
- },
-};
-
-/* FSI */
-/* change J20, J21, J22 pin to 1-2 connection to use slave mode */
-static struct resource fsi_resources[] = {
- [0] = {
- .name = "FSI",
- .start = 0xFE3C0000,
- .end = 0xFE3C021d,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xf80),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device fsi_device = {
- .name = "sh_fsi",
- .id = 0,
- .num_resources = ARRAY_SIZE(fsi_resources),
- .resource = fsi_resources,
-};
-
-static struct asoc_simple_card_info fsi_ak4642_info = {
- .name = "AK4642",
- .card = "FSIA-AK4642",
- .codec = "ak4642-codec.0-0012",
- .platform = "sh_fsi.0",
- .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBP_CFP,
- .cpu_dai = {
- .name = "fsia-dai",
- },
- .codec_dai = {
- .name = "ak4642-hifi",
- .sysclk = 11289600,
- },
-};
-
-static struct platform_device fsi_ak4642_device = {
- .name = "asoc-simple-card",
- .dev = {
- .platform_data = &fsi_ak4642_info,
- },
-};
-
-/* KEYSC in SoC (Needs SW33-2 set to ON) */
-static struct sh_keysc_info keysc_info = {
- .mode = SH_KEYSC_MODE_1,
- .scan_timing = 3,
- .delay = 50,
- .keycodes = {
- KEY_1, KEY_2, KEY_3, KEY_4, KEY_5,
- KEY_6, KEY_7, KEY_8, KEY_9, KEY_A,
- KEY_B, KEY_C, KEY_D, KEY_E, KEY_F,
- KEY_G, KEY_H, KEY_I, KEY_K, KEY_L,
- KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q,
- KEY_R, KEY_S, KEY_T, KEY_U, KEY_V,
- },
-};
-
-static struct resource keysc_resources[] = {
- [0] = {
- .name = "KEYSC",
- .start = 0x044b0000,
- .end = 0x044b000f,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xbe0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device keysc_device = {
- .name = "sh_keysc",
- .id = 0, /* "keysc0" clock */
- .num_resources = ARRAY_SIZE(keysc_resources),
- .resource = keysc_resources,
- .dev = {
- .platform_data = &keysc_info,
- },
-};
-
-/* SH Eth */
-static struct resource sh_eth_resources[] = {
- [0] = {
- .start = SH_ETH_ADDR,
- .end = SH_ETH_ADDR + 0x1FC - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xd60),
- .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
- },
-};
-
-static struct sh_eth_plat_data sh_eth_plat = {
- .phy = 0x1f, /* SMSC LAN8187 */
- .phy_interface = PHY_INTERFACE_MODE_MII,
-};
-
-static struct platform_device sh_eth_device = {
- .name = "sh7724-ether",
- .id = 0,
- .dev = {
- .platform_data = &sh_eth_plat,
- },
- .num_resources = ARRAY_SIZE(sh_eth_resources),
- .resource = sh_eth_resources,
-};
-
-static struct r8a66597_platdata sh7724_usb0_host_data = {
- .on_chip = 1,
-};
-
-static struct resource sh7724_usb0_host_resources[] = {
- [0] = {
- .start = 0xa4d80000,
- .end = 0xa4d80124 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xa20),
- .end = evt2irq(0xa20),
- .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
- },
-};
-
-static struct platform_device sh7724_usb0_host_device = {
- .name = "r8a66597_hcd",
- .id = 0,
- .dev = {
- .dma_mask = NULL, /* not use dma */
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &sh7724_usb0_host_data,
- },
- .num_resources = ARRAY_SIZE(sh7724_usb0_host_resources),
- .resource = sh7724_usb0_host_resources,
-};
-
-static struct r8a66597_platdata sh7724_usb1_gadget_data = {
- .on_chip = 1,
-};
-
-static struct resource sh7724_usb1_gadget_resources[] = {
- [0] = {
- .start = 0xa4d90000,
- .end = 0xa4d90123,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xa40),
- .end = evt2irq(0xa40),
- .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
- },
-};
-
-static struct platform_device sh7724_usb1_gadget_device = {
- .name = "r8a66597_udc",
- .id = 1, /* USB1 */
- .dev = {
- .dma_mask = NULL, /* not use dma */
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &sh7724_usb1_gadget_data,
- },
- .num_resources = ARRAY_SIZE(sh7724_usb1_gadget_resources),
- .resource = sh7724_usb1_gadget_resources,
-};
-
-/* Fixed 3.3V regulator to be used by SDHI0, SDHI1 */
-static struct regulator_consumer_supply fixed3v3_power_consumers[] =
-{
- REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
- REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
- REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
- REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
-};
-
-static struct resource sdhi0_cn7_resources[] = {
- [0] = {
- .name = "SDHI0",
- .start = 0x04ce0000,
- .end = 0x04ce00ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0xe80),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct tmio_mmc_data sh7724_sdhi0_data = {
- .chan_priv_tx = (void *)SHDMA_SLAVE_SDHI0_TX,
- .chan_priv_rx = (void *)SHDMA_SLAVE_SDHI0_RX,
- .capabilities = MMC_CAP_SDIO_IRQ,
-};
-
-static struct platform_device sdhi0_cn7_device = {
- .name = "sh_mobile_sdhi",
- .id = 0,
- .num_resources = ARRAY_SIZE(sdhi0_cn7_resources),
- .resource = sdhi0_cn7_resources,
- .dev = {
- .platform_data = &sh7724_sdhi0_data,
- },
-};
-
-static struct resource sdhi1_cn8_resources[] = {
- [0] = {
- .name = "SDHI1",
- .start = 0x04cf0000,
- .end = 0x04cf00ff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x4e0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct tmio_mmc_data sh7724_sdhi1_data = {
- .chan_priv_tx = (void *)SHDMA_SLAVE_SDHI1_TX,
- .chan_priv_rx = (void *)SHDMA_SLAVE_SDHI1_RX,
- .capabilities = MMC_CAP_SDIO_IRQ,
-};
-
-static struct platform_device sdhi1_cn8_device = {
- .name = "sh_mobile_sdhi",
- .id = 1,
- .num_resources = ARRAY_SIZE(sdhi1_cn8_resources),
- .resource = sdhi1_cn8_resources,
- .dev = {
- .platform_data = &sh7724_sdhi1_data,
- },
-};
-
-/* IrDA */
-static struct resource irda_resources[] = {
- [0] = {
- .name = "IrDA",
- .start = 0xA45D0000,
- .end = 0xA45D0049,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x480),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device irda_device = {
- .name = "sh_sir",
- .num_resources = ARRAY_SIZE(irda_resources),
- .resource = irda_resources,
-};
-
-#include <media/i2c/ak881x.h>
-#include <media/drv-intf/sh_vou.h>
-
-static struct ak881x_pdata ak881x_pdata = {
- .flags = AK881X_IF_MODE_SLAVE,
-};
-
-static struct i2c_board_info ak8813 = {
- /* With open J18 jumper address is 0x21 */
- I2C_BOARD_INFO("ak8813", 0x20),
- .platform_data = &ak881x_pdata,
-};
-
-static struct sh_vou_pdata sh_vou_pdata = {
- .bus_fmt = SH_VOU_BUS_8BIT,
- .flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW,
- .board_info = &ak8813,
- .i2c_adap = 0,
-};
-
-static struct resource sh_vou_resources[] = {
- [0] = {
- .start = 0xfe960000,
- .end = 0xfe962043,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x8e0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device vou_device = {
- .name = "sh-vou",
- .id = -1,
- .num_resources = ARRAY_SIZE(sh_vou_resources),
- .resource = sh_vou_resources,
- .dev = {
- .platform_data = &sh_vou_pdata,
- },
-};
-
-static struct platform_device *ms7724se_ceu_devices[] __initdata = {
- &ceu0_device,
- &ceu1_device,
-};
-
-static struct platform_device *ms7724se_devices[] __initdata = {
- &heartbeat_device,
- &smc91x_eth_device,
- &lcdc_device,
- &nor_flash_device,
- &keysc_device,
- &sh_eth_device,
- &sh7724_usb0_host_device,
- &sh7724_usb1_gadget_device,
- &fsi_device,
- &fsi_ak4642_device,
- &sdhi0_cn7_device,
- &sdhi1_cn8_device,
- &irda_device,
- &vou_device,
-};
-
-/* I2C device */
-static struct i2c_board_info i2c0_devices[] = {
- {
- I2C_BOARD_INFO("ak4642", 0x12),
- },
-};
-
-#define EEPROM_OP 0xBA206000
-#define EEPROM_ADR 0xBA206004
-#define EEPROM_DATA 0xBA20600C
-#define EEPROM_STAT 0xBA206010
-#define EEPROM_STRT 0xBA206014
-
-static int __init sh_eth_is_eeprom_ready(void)
-{
- int t = 10000;
-
- while (t--) {
- if (!__raw_readw(EEPROM_STAT))
- return 1;
- udelay(1);
- }
-
- printk(KERN_ERR "ms7724se can not access to eeprom\n");
- return 0;
-}
-
-static void __init sh_eth_init(void)
-{
- int i;
- u16 mac;
-
- /* check EEPROM status */
- if (!sh_eth_is_eeprom_ready())
- return;
-
- /* read MAC addr from EEPROM */
- for (i = 0 ; i < 3 ; i++) {
- __raw_writew(0x0, EEPROM_OP); /* read */
- __raw_writew(i*2, EEPROM_ADR);
- __raw_writew(0x1, EEPROM_STRT);
- if (!sh_eth_is_eeprom_ready())
- return;
-
- mac = __raw_readw(EEPROM_DATA);
- sh_eth_plat.mac_addr[i << 1] = mac & 0xff;
- sh_eth_plat.mac_addr[(i << 1) + 1] = mac >> 8;
- }
-}
-
-#define SW4140 0xBA201000
-#define FPGA_OUT 0xBA200400
-#define PORT_HIZA 0xA4050158
-#define PORT_MSELCRB 0xA4050182
-
-#define SW41_A 0x0100
-#define SW41_B 0x0200
-#define SW41_C 0x0400
-#define SW41_D 0x0800
-#define SW41_E 0x1000
-#define SW41_F 0x2000
-#define SW41_G 0x4000
-#define SW41_H 0x8000
-
-extern char ms7724se_sdram_enter_start;
-extern char ms7724se_sdram_enter_end;
-extern char ms7724se_sdram_leave_start;
-extern char ms7724se_sdram_leave_end;
-
-static int __init arch_setup(void)
-{
- /* enable I2C device */
- i2c_register_board_info(0, i2c0_devices,
- ARRAY_SIZE(i2c0_devices));
- return 0;
-}
-arch_initcall(arch_setup);
-
-static int __init devices_setup(void)
-{
- u16 sw = __raw_readw(SW4140); /* select camera, monitor */
- struct clk *clk;
- u16 fpga_out;
-
- /* register board specific self-refresh code */
- sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
- SUSP_SH_RSTANDBY,
- &ms7724se_sdram_enter_start,
- &ms7724se_sdram_enter_end,
- &ms7724se_sdram_leave_start,
- &ms7724se_sdram_leave_end);
-
- regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
- ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
-
- /* Reset Release */
- fpga_out = __raw_readw(FPGA_OUT);
- /* bit4: NTSC_PDN, bit5: NTSC_RESET */
- fpga_out &= ~((1 << 1) | /* LAN */
- (1 << 4) | /* AK8813 PDN */
- (1 << 5) | /* AK8813 RESET */
- (1 << 6) | /* VIDEO DAC */
- (1 << 7) | /* AK4643 */
- (1 << 8) | /* IrDA */
- (1 << 12) | /* USB0 */
- (1 << 14)); /* RMII */
- __raw_writew(fpga_out | (1 << 4), FPGA_OUT);
-
- udelay(10);
-
- /* AK8813 RESET */
- __raw_writew(fpga_out | (1 << 5), FPGA_OUT);
-
- udelay(10);
-
- __raw_writew(fpga_out, FPGA_OUT);
-
- /* turn on USB clocks, use external clock */
- __raw_writew((__raw_readw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);
-
- /* Let LED9 show STATUS2 */
- gpio_request(GPIO_FN_STATUS2, NULL);
-
- /* Lit LED10 show STATUS0 */
- gpio_request(GPIO_FN_STATUS0, NULL);
-
- /* Lit LED11 show PDSTATUS */
- gpio_request(GPIO_FN_PDSTATUS, NULL);
-
- /* enable USB0 port */
- __raw_writew(0x0600, 0xa40501d4);
-
- /* enable USB1 port */
- __raw_writew(0x0600, 0xa4050192);
-
- /* enable IRQ 0,1,2 */
- gpio_request(GPIO_FN_INTC_IRQ0, NULL);
- gpio_request(GPIO_FN_INTC_IRQ1, NULL);
- gpio_request(GPIO_FN_INTC_IRQ2, NULL);
-
- /* enable SCIFA3 */
- gpio_request(GPIO_FN_SCIF3_I_SCK, NULL);
- gpio_request(GPIO_FN_SCIF3_I_RXD, NULL);
- gpio_request(GPIO_FN_SCIF3_I_TXD, NULL);
- gpio_request(GPIO_FN_SCIF3_I_CTS, NULL);
- gpio_request(GPIO_FN_SCIF3_I_RTS, NULL);
-
- /* enable LCDC */
- gpio_request(GPIO_FN_LCDD23, NULL);
- gpio_request(GPIO_FN_LCDD22, NULL);
- gpio_request(GPIO_FN_LCDD21, NULL);
- gpio_request(GPIO_FN_LCDD20, NULL);
- gpio_request(GPIO_FN_LCDD19, NULL);
- gpio_request(GPIO_FN_LCDD18, NULL);
- gpio_request(GPIO_FN_LCDD17, NULL);
- gpio_request(GPIO_FN_LCDD16, NULL);
- gpio_request(GPIO_FN_LCDD15, NULL);
- gpio_request(GPIO_FN_LCDD14, NULL);
- gpio_request(GPIO_FN_LCDD13, NULL);
- gpio_request(GPIO_FN_LCDD12, NULL);
- gpio_request(GPIO_FN_LCDD11, NULL);
- gpio_request(GPIO_FN_LCDD10, NULL);
- gpio_request(GPIO_FN_LCDD9, NULL);
- gpio_request(GPIO_FN_LCDD8, NULL);
- gpio_request(GPIO_FN_LCDD7, NULL);
- gpio_request(GPIO_FN_LCDD6, NULL);
- gpio_request(GPIO_FN_LCDD5, NULL);
- gpio_request(GPIO_FN_LCDD4, NULL);
- gpio_request(GPIO_FN_LCDD3, NULL);
- gpio_request(GPIO_FN_LCDD2, NULL);
- gpio_request(GPIO_FN_LCDD1, NULL);
- gpio_request(GPIO_FN_LCDD0, NULL);
- gpio_request(GPIO_FN_LCDDISP, NULL);
- gpio_request(GPIO_FN_LCDHSYN, NULL);
- gpio_request(GPIO_FN_LCDDCK, NULL);
- gpio_request(GPIO_FN_LCDVSYN, NULL);
- gpio_request(GPIO_FN_LCDDON, NULL);
- gpio_request(GPIO_FN_LCDVEPWC, NULL);
- gpio_request(GPIO_FN_LCDVCPWC, NULL);
- gpio_request(GPIO_FN_LCDRD, NULL);
- gpio_request(GPIO_FN_LCDLCLK, NULL);
- __raw_writew((__raw_readw(PORT_HIZA) & ~0x0001), PORT_HIZA);
-
- /* enable CEU0 */
- gpio_request(GPIO_FN_VIO0_D15, NULL);
- gpio_request(GPIO_FN_VIO0_D14, NULL);
- gpio_request(GPIO_FN_VIO0_D13, NULL);
- gpio_request(GPIO_FN_VIO0_D12, NULL);
- gpio_request(GPIO_FN_VIO0_D11, NULL);
- gpio_request(GPIO_FN_VIO0_D10, NULL);
- gpio_request(GPIO_FN_VIO0_D9, NULL);
- gpio_request(GPIO_FN_VIO0_D8, NULL);
- gpio_request(GPIO_FN_VIO0_D7, NULL);
- gpio_request(GPIO_FN_VIO0_D6, NULL);
- gpio_request(GPIO_FN_VIO0_D5, NULL);
- gpio_request(GPIO_FN_VIO0_D4, NULL);
- gpio_request(GPIO_FN_VIO0_D3, NULL);
- gpio_request(GPIO_FN_VIO0_D2, NULL);
- gpio_request(GPIO_FN_VIO0_D1, NULL);
- gpio_request(GPIO_FN_VIO0_D0, NULL);
- gpio_request(GPIO_FN_VIO0_VD, NULL);
- gpio_request(GPIO_FN_VIO0_CLK, NULL);
- gpio_request(GPIO_FN_VIO0_FLD, NULL);
- gpio_request(GPIO_FN_VIO0_HD, NULL);
-
- /* enable CEU1 */
- gpio_request(GPIO_FN_VIO1_D7, NULL);
- gpio_request(GPIO_FN_VIO1_D6, NULL);
- gpio_request(GPIO_FN_VIO1_D5, NULL);
- gpio_request(GPIO_FN_VIO1_D4, NULL);
- gpio_request(GPIO_FN_VIO1_D3, NULL);
- gpio_request(GPIO_FN_VIO1_D2, NULL);
- gpio_request(GPIO_FN_VIO1_D1, NULL);
- gpio_request(GPIO_FN_VIO1_D0, NULL);
- gpio_request(GPIO_FN_VIO1_FLD, NULL);
- gpio_request(GPIO_FN_VIO1_HD, NULL);
- gpio_request(GPIO_FN_VIO1_VD, NULL);
- gpio_request(GPIO_FN_VIO1_CLK, NULL);
-
- /* KEYSC */
- gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
- gpio_request(GPIO_FN_KEYOUT4_IN6, NULL);
- gpio_request(GPIO_FN_KEYIN4, NULL);
- gpio_request(GPIO_FN_KEYIN3, NULL);
- gpio_request(GPIO_FN_KEYIN2, NULL);
- gpio_request(GPIO_FN_KEYIN1, NULL);
- gpio_request(GPIO_FN_KEYIN0, NULL);
- gpio_request(GPIO_FN_KEYOUT3, NULL);
- gpio_request(GPIO_FN_KEYOUT2, NULL);
- gpio_request(GPIO_FN_KEYOUT1, NULL);
- gpio_request(GPIO_FN_KEYOUT0, NULL);
-
- /* enable FSI */
- gpio_request(GPIO_FN_FSIMCKA, NULL);
- gpio_request(GPIO_FN_FSIIASD, NULL);
- gpio_request(GPIO_FN_FSIOASD, NULL);
- gpio_request(GPIO_FN_FSIIABCK, NULL);
- gpio_request(GPIO_FN_FSIIALRCK, NULL);
- gpio_request(GPIO_FN_FSIOABCK, NULL);
- gpio_request(GPIO_FN_FSIOALRCK, NULL);
- gpio_request(GPIO_FN_CLKAUDIOAO, NULL);
-
- /* set SPU2 clock to 83.4 MHz */
- clk = clk_get(NULL, "spu_clk");
- if (!IS_ERR(clk)) {
- clk_set_rate(clk, clk_round_rate(clk, 83333333));
- clk_put(clk);
- }
-
- /* change parent of FSI A */
- clk = clk_get(NULL, "fsia_clk");
- if (!IS_ERR(clk)) {
- /* 48kHz dummy clock was used to make sure 1/1 divide */
- clk_set_rate(&sh7724_fsimcka_clk, 48000);
- clk_set_parent(clk, &sh7724_fsimcka_clk);
- clk_set_rate(clk, 48000);
- clk_put(clk);
- }
-
- /* SDHI0 connected to cn7 */
- gpio_request(GPIO_FN_SDHI0CD, NULL);
- gpio_request(GPIO_FN_SDHI0WP, NULL);
- gpio_request(GPIO_FN_SDHI0D3, NULL);
- gpio_request(GPIO_FN_SDHI0D2, NULL);
- gpio_request(GPIO_FN_SDHI0D1, NULL);
- gpio_request(GPIO_FN_SDHI0D0, NULL);
- gpio_request(GPIO_FN_SDHI0CMD, NULL);
- gpio_request(GPIO_FN_SDHI0CLK, NULL);
-
- /* SDHI1 connected to cn8 */
- gpio_request(GPIO_FN_SDHI1CD, NULL);
- gpio_request(GPIO_FN_SDHI1WP, NULL);
- gpio_request(GPIO_FN_SDHI1D3, NULL);
- gpio_request(GPIO_FN_SDHI1D2, NULL);
- gpio_request(GPIO_FN_SDHI1D1, NULL);
- gpio_request(GPIO_FN_SDHI1D0, NULL);
- gpio_request(GPIO_FN_SDHI1CMD, NULL);
- gpio_request(GPIO_FN_SDHI1CLK, NULL);
-
- /* enable IrDA */
- gpio_request(GPIO_FN_IRDA_OUT, NULL);
- gpio_request(GPIO_FN_IRDA_IN, NULL);
-
- /*
- * enable SH-Eth
- *
- * please remove J33 pin from your board !!
- *
- * ms7724 board should not use GPIO_FN_LNKSTA pin
- * So, This time PTX5 is set to input pin
- */
- gpio_request(GPIO_FN_RMII_RXD0, NULL);
- gpio_request(GPIO_FN_RMII_RXD1, NULL);
- gpio_request(GPIO_FN_RMII_TXD0, NULL);
- gpio_request(GPIO_FN_RMII_TXD1, NULL);
- gpio_request(GPIO_FN_RMII_REF_CLK, NULL);
- gpio_request(GPIO_FN_RMII_TX_EN, NULL);
- gpio_request(GPIO_FN_RMII_RX_ER, NULL);
- gpio_request(GPIO_FN_RMII_CRS_DV, NULL);
- gpio_request(GPIO_FN_MDIO, NULL);
- gpio_request(GPIO_FN_MDC, NULL);
- gpio_request(GPIO_PTX5, NULL);
- gpio_direction_input(GPIO_PTX5);
- sh_eth_init();
-
- if (sw & SW41_B) {
- /* 720p */
- lcdc_info.ch[0].lcd_modes = lcdc_720p_modes;
- lcdc_info.ch[0].num_modes = ARRAY_SIZE(lcdc_720p_modes);
- } else {
- /* VGA */
- lcdc_info.ch[0].lcd_modes = lcdc_vga_modes;
- lcdc_info.ch[0].num_modes = ARRAY_SIZE(lcdc_vga_modes);
- }
-
- if (sw & SW41_A) {
- /* Digital monitor */
- lcdc_info.ch[0].interface_type = RGB18;
- lcdc_info.ch[0].flags = 0;
- } else {
- /* Analog monitor */
- lcdc_info.ch[0].interface_type = RGB24;
- lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL;
- }
-
- /* VOU */
- gpio_request(GPIO_FN_DV_D15, NULL);
- gpio_request(GPIO_FN_DV_D14, NULL);
- gpio_request(GPIO_FN_DV_D13, NULL);
- gpio_request(GPIO_FN_DV_D12, NULL);
- gpio_request(GPIO_FN_DV_D11, NULL);
- gpio_request(GPIO_FN_DV_D10, NULL);
- gpio_request(GPIO_FN_DV_D9, NULL);
- gpio_request(GPIO_FN_DV_D8, NULL);
- gpio_request(GPIO_FN_DV_CLKI, NULL);
- gpio_request(GPIO_FN_DV_CLK, NULL);
- gpio_request(GPIO_FN_DV_VSYNC, NULL);
- gpio_request(GPIO_FN_DV_HSYNC, NULL);
-
- /* Initialize CEU platform devices separately to map memory first */
- device_initialize(&ms7724se_ceu_devices[0]->dev);
- dma_declare_coherent_memory(&ms7724se_ceu_devices[0]->dev,
- ceu0_dma_membase, ceu0_dma_membase,
- ceu0_dma_membase +
- CEU_BUFFER_MEMORY_SIZE - 1);
- platform_device_add(ms7724se_ceu_devices[0]);
-
- device_initialize(&ms7724se_ceu_devices[1]->dev);
- dma_declare_coherent_memory(&ms7724se_ceu_devices[1]->dev,
- ceu1_dma_membase, ceu1_dma_membase,
- ceu1_dma_membase +
- CEU_BUFFER_MEMORY_SIZE - 1);
- platform_device_add(ms7724se_ceu_devices[1]);
-
- return platform_add_devices(ms7724se_devices,
- ARRAY_SIZE(ms7724se_devices));
-}
-device_initcall(devices_setup);
-
-/* Reserve a portion of memory for CEU 0 and CEU 1 buffers */
-static void __init ms7724se_mv_mem_reserve(void)
-{
- phys_addr_t phys;
- phys_addr_t size = CEU_BUFFER_MEMORY_SIZE;
-
- phys = memblock_phys_alloc(size, PAGE_SIZE);
- if (!phys)
- panic("Failed to allocate CEU0 memory\n");
-
- memblock_phys_free(phys, size);
- memblock_remove(phys, size);
- ceu0_dma_membase = phys;
-
- phys = memblock_phys_alloc(size, PAGE_SIZE);
- if (!phys)
- panic("Failed to allocate CEU1 memory\n");
-
- memblock_phys_free(phys, size);
- memblock_remove(phys, size);
- ceu1_dma_membase = phys;
-}
-
-static struct sh_machine_vector mv_ms7724se __initmv = {
- .mv_name = "ms7724se",
- .mv_init_irq = init_se7724_IRQ,
- .mv_mem_reserve = ms7724se_mv_mem_reserve,
-};
diff --git a/arch/sh/boards/mach-se/7751/Makefile b/arch/sh/boards/mach-se/7751/Makefile
deleted file mode 100644
index 2406d3e353524b..00000000000000
--- a/arch/sh/boards/mach-se/7751/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the 7751 SolutionEngine specific parts of the kernel
-#
-
-obj-y := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/7751/irq.c b/arch/sh/boards/mach-se/7751/irq.c
deleted file mode 100644
index dcefe58d87534b..00000000000000
--- a/arch/sh/boards/mach-se/7751/irq.c
+++ /dev/null
@@ -1,51 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/se/7751/irq.c
- *
- * Copyright (C) 2000 Kazumoto Kojima
- *
- * Hitachi SolutionEngine Support.
- *
- * Modified for 7751 Solution Engine by
- * Ian da Silva and Jeremy Siegel, 2001.
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <asm/irq.h>
-#include <mach-se/mach/se7751.h>
-
-static struct ipr_data ipr_irq_table[] = {
- { 13, 3, 3, 2 },
- /* Add additional entries here as drivers are added and tested. */
-};
-
-static unsigned long ipr_offsets[] = {
- BCR_ILCRA,
- BCR_ILCRB,
- BCR_ILCRC,
- BCR_ILCRD,
- BCR_ILCRE,
- BCR_ILCRF,
- BCR_ILCRG,
-};
-
-static struct ipr_desc ipr_irq_desc = {
- .ipr_offsets = ipr_offsets,
- .nr_offsets = ARRAY_SIZE(ipr_offsets),
-
- .ipr_data = ipr_irq_table,
- .nr_irqs = ARRAY_SIZE(ipr_irq_table),
-
- .chip = {
- .name = "IPR-se7751",
- },
-};
-
-/*
- * Initialize IRQ setting
- */
-void __init init_7751se_IRQ(void)
-{
- register_ipr_controller(&ipr_irq_desc);
-}
diff --git a/arch/sh/boards/mach-se/7751/setup.c b/arch/sh/boards/mach-se/7751/setup.c
deleted file mode 100644
index 4c480605557f46..00000000000000
--- a/arch/sh/boards/mach-se/7751/setup.c
+++ /dev/null
@@ -1,60 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/se/7751/setup.c
- *
- * Copyright (C) 2000 Kazumoto Kojima
- *
- * Hitachi SolutionEngine Support.
- *
- * Modified for 7751 Solution Engine by
- * Ian da Silva and Jeremy Siegel, 2001.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/machvec.h>
-#include <mach-se/mach/se7751.h>
-#include <asm/io.h>
-#include <asm/heartbeat.h>
-
-static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
-
-static struct heartbeat_data heartbeat_data = {
- .bit_pos = heartbeat_bit_pos,
- .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
-};
-
-static struct resource heartbeat_resources[] = {
- [0] = {
- .start = PA_LED,
- .end = PA_LED,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .dev = {
- .platform_data = &heartbeat_data,
- },
- .num_resources = ARRAY_SIZE(heartbeat_resources),
- .resource = heartbeat_resources,
-};
-
-static struct platform_device *se7751_devices[] __initdata = {
- &heartbeat_device,
-};
-
-static int __init se7751_devices_setup(void)
-{
- return platform_add_devices(se7751_devices, ARRAY_SIZE(se7751_devices));
-}
-device_initcall(se7751_devices_setup);
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_7751se __initmv = {
- .mv_name = "7751 SolutionEngine",
- .mv_init_irq = init_7751se_IRQ,
-};
diff --git a/arch/sh/boards/mach-se/7780/Makefile b/arch/sh/boards/mach-se/7780/Makefile
deleted file mode 100644
index 1f6669ab1bc0db..00000000000000
--- a/arch/sh/boards/mach-se/7780/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the HITACHI UL SolutionEngine 7780 specific parts of the kernel
-#
-# This file is subject to the terms and conditions of the GNU General Public
-# License. See the file "COPYING" in the main directory of this archive
-# for more details.
-#
-#
-
-obj-y := setup.o irq.o
diff --git a/arch/sh/boards/mach-se/7780/irq.c b/arch/sh/boards/mach-se/7780/irq.c
deleted file mode 100644
index d427dfd711f171..00000000000000
--- a/arch/sh/boards/mach-se/7780/irq.c
+++ /dev/null
@@ -1,65 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/se/7780/irq.c
- *
- * Copyright (C) 2006,2007 Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7780 Support.
- */
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <mach-se/mach/se7780.h>
-
-#define INTC_BASE 0xffd00000
-#define INTC_ICR1 (INTC_BASE+0x1c)
-
-/*
- * Initialize IRQ setting
- */
-void __init init_se7780_IRQ(void)
-{
- /* enable all interrupt at FPGA */
- __raw_writew(0, FPGA_INTMSK1);
- /* mask SM501 interrupt */
- __raw_writew((__raw_readw(FPGA_INTMSK1) | 0x0002), FPGA_INTMSK1);
- /* enable all interrupt at FPGA */
- __raw_writew(0, FPGA_INTMSK2);
-
- /* set FPGA INTSEL register */
- /* FPGA + 0x06 */
- __raw_writew( ((IRQPIN_SM501 << IRQPOS_SM501) |
- (IRQPIN_SMC91CX << IRQPOS_SMC91CX)), FPGA_INTSEL1);
-
- /* FPGA + 0x08 */
- __raw_writew(((IRQPIN_EXTINT4 << IRQPOS_EXTINT4) |
- (IRQPIN_EXTINT3 << IRQPOS_EXTINT3) |
- (IRQPIN_EXTINT2 << IRQPOS_EXTINT2) |
- (IRQPIN_EXTINT1 << IRQPOS_EXTINT1)), FPGA_INTSEL2);
-
- /* FPGA + 0x0A */
- __raw_writew((IRQPIN_PCCPW << IRQPOS_PCCPW), FPGA_INTSEL3);
-
- plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-7 */
-
- /* ICR1: detect low level(for 2ndcut) */
- __raw_writel(0xAAAA0000, INTC_ICR1);
-
- /*
- * FPGA PCISEL register initialize
- *
- * CPU || SLOT1 | SLOT2 | S-ATA | USB
- * -------------------------------------
- * INTA || INTA | INTD | -- | INTB
- * -------------------------------------
- * INTB || INTB | INTA | -- | INTC
- * -------------------------------------
- * INTC || INTC | INTB | INTA | --
- * -------------------------------------
- * INTD || INTD | INTC | -- | INTA
- * -------------------------------------
- */
- __raw_writew(0x0013, FPGA_PCI_INTSEL1);
- __raw_writew(0xE402, FPGA_PCI_INTSEL2);
-}
diff --git a/arch/sh/boards/mach-se/7780/setup.c b/arch/sh/boards/mach-se/7780/setup.c
deleted file mode 100644
index 309f2681381b08..00000000000000
--- a/arch/sh/boards/mach-se/7780/setup.c
+++ /dev/null
@@ -1,111 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/se/7780/setup.c
- *
- * Copyright (C) 2006,2007 Nobuhiro Iwamatsu
- *
- * Hitachi UL SolutionEngine 7780 Support.
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/machvec.h>
-#include <mach-se/mach/se7780.h>
-#include <asm/io.h>
-#include <asm/heartbeat.h>
-
-/* Heartbeat */
-static struct resource heartbeat_resource = {
- .start = PA_LED,
- .end = PA_LED,
- .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .num_resources = 1,
- .resource = &heartbeat_resource,
-};
-
-/* SMC91x */
-static struct resource smc91x_eth_resources[] = {
- [0] = {
- .name = "smc91x-regs" ,
- .start = PA_LAN + 0x300,
- .end = PA_LAN + 0x300 + 0x10 ,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = SMC_IRQ,
- .end = SMC_IRQ,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device smc91x_eth_device = {
- .name = "smc91x",
- .id = 0,
- .dev = {
- .dma_mask = NULL, /* don't use dma */
- .coherent_dma_mask = 0xffffffff,
- },
- .num_resources = ARRAY_SIZE(smc91x_eth_resources),
- .resource = smc91x_eth_resources,
-};
-
-static struct platform_device *se7780_devices[] __initdata = {
- &heartbeat_device,
- &smc91x_eth_device,
-};
-
-static int __init se7780_devices_setup(void)
-{
- return platform_add_devices(se7780_devices,
- ARRAY_SIZE(se7780_devices));
-}
-device_initcall(se7780_devices_setup);
-
-#define GPIO_PHCR 0xFFEA000E
-#define GPIO_PMSELR 0xFFEA0080
-#define GPIO_PECR 0xFFEA0008
-
-static void __init se7780_setup(char **cmdline_p)
-{
- /* "SH-Linux" on LED Display */
- __raw_writew( 'S' , PA_LED_DISP + (DISP_SEL0_ADDR << 1) );
- __raw_writew( 'H' , PA_LED_DISP + (DISP_SEL1_ADDR << 1) );
- __raw_writew( '-' , PA_LED_DISP + (DISP_SEL2_ADDR << 1) );
- __raw_writew( 'L' , PA_LED_DISP + (DISP_SEL3_ADDR << 1) );
- __raw_writew( 'i' , PA_LED_DISP + (DISP_SEL4_ADDR << 1) );
- __raw_writew( 'n' , PA_LED_DISP + (DISP_SEL5_ADDR << 1) );
- __raw_writew( 'u' , PA_LED_DISP + (DISP_SEL6_ADDR << 1) );
- __raw_writew( 'x' , PA_LED_DISP + (DISP_SEL7_ADDR << 1) );
-
- printk(KERN_INFO "Hitachi UL Solutions Engine 7780SE03 support.\n");
-
- /*
- * PCI REQ/GNT setting
- * REQ0/GNT0 -> USB
- * REQ1/GNT1 -> PC Card
- * REQ2/GNT2 -> Serial ATA
- * REQ3/GNT3 -> PCI slot
- */
- __raw_writew(0x0213, FPGA_REQSEL);
-
- /* GPIO setting */
- __raw_writew(0x0000, GPIO_PECR);
- __raw_writew(__raw_readw(GPIO_PHCR)&0xfff3, GPIO_PHCR);
- __raw_writew(0x0c00, GPIO_PMSELR);
-
- /* iVDR Power ON */
- __raw_writew(0x0001, FPGA_IVDRPW);
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_se7780 __initmv = {
- .mv_name = "Solution Engine 7780" ,
- .mv_setup = se7780_setup ,
- .mv_init_irq = init_se7780_IRQ,
-};
diff --git a/arch/sh/boards/mach-se/Makefile b/arch/sh/boards/mach-se/Makefile
deleted file mode 100644
index 8f69fc147c733d..00000000000000
--- a/arch/sh/boards/mach-se/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_SH_7619_SOLUTION_ENGINE) += board-se7619.o
-
-obj-$(CONFIG_SH_SOLUTION_ENGINE) += 770x/
-obj-$(CONFIG_SH_7206_SOLUTION_ENGINE) += 7206/
-obj-$(CONFIG_SH_7722_SOLUTION_ENGINE) += 7722/
-obj-$(CONFIG_SH_7751_SOLUTION_ENGINE) += 7751/
-obj-$(CONFIG_SH_7780_SOLUTION_ENGINE) += 7780/
-obj-$(CONFIG_SH_7343_SOLUTION_ENGINE) += 7343/
-obj-$(CONFIG_SH_7721_SOLUTION_ENGINE) += 7721/
-obj-$(CONFIG_SH_7724_SOLUTION_ENGINE) += 7724/
diff --git a/arch/sh/boards/mach-se/board-se7619.c b/arch/sh/boards/mach-se/board-se7619.c
deleted file mode 100644
index 4431da64a56f6a..00000000000000
--- a/arch/sh/boards/mach-se/board-se7619.c
+++ /dev/null
@@ -1,27 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/se/7619/setup.c
- *
- * Copyright (C) 2006 Yoshinori Sato
- *
- * Hitachi SH7619 SolutionEngine Support.
- */
-
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/io.h>
-#include <asm/machvec.h>
-
-static int se7619_mode_pins(void)
-{
- return MODE_PIN2 | MODE_PIN0;
-}
-
-/*
- * The Machine Vector
- */
-
-static struct sh_machine_vector mv_se __initmv = {
- .mv_name = "SolutionEngine",
- .mv_mode_pins = se7619_mode_pins,
-};
diff --git a/arch/sh/boards/mach-sh03/Makefile b/arch/sh/boards/mach-sh03/Makefile
deleted file mode 100644
index f89c25c6a39c8a..00000000000000
--- a/arch/sh/boards/mach-sh03/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the Interface (CTP/PCI-SH03) specific parts of the kernel
-#
-
-obj-y := setup.o
-obj-$(CONFIG_RTC_DRV_GENERIC) += rtc.o
diff --git a/arch/sh/boards/mach-sh03/rtc.c b/arch/sh/boards/mach-sh03/rtc.c
deleted file mode 100644
index 7fb474844a2d1d..00000000000000
--- a/arch/sh/boards/mach-sh03/rtc.c
+++ /dev/null
@@ -1,143 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/sh03/rtc.c -- CTP/PCI-SH03 on-chip RTC support
- *
- * Copyright (C) 2004 Saito.K & Jeanne([email protected])
- *
- */
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/time.h>
-#include <linux/bcd.h>
-#include <linux/spinlock.h>
-#include <linux/io.h>
-#include <linux/rtc.h>
-#include <linux/platform_device.h>
-
-#define RTC_BASE 0xb0000000
-#define RTC_SEC1 (RTC_BASE + 0)
-#define RTC_SEC10 (RTC_BASE + 1)
-#define RTC_MIN1 (RTC_BASE + 2)
-#define RTC_MIN10 (RTC_BASE + 3)
-#define RTC_HOU1 (RTC_BASE + 4)
-#define RTC_HOU10 (RTC_BASE + 5)
-#define RTC_WEE1 (RTC_BASE + 6)
-#define RTC_DAY1 (RTC_BASE + 7)
-#define RTC_DAY10 (RTC_BASE + 8)
-#define RTC_MON1 (RTC_BASE + 9)
-#define RTC_MON10 (RTC_BASE + 10)
-#define RTC_YEA1 (RTC_BASE + 11)
-#define RTC_YEA10 (RTC_BASE + 12)
-#define RTC_YEA100 (RTC_BASE + 13)
-#define RTC_YEA1000 (RTC_BASE + 14)
-#define RTC_CTL (RTC_BASE + 15)
-#define RTC_BUSY 1
-#define RTC_STOP 2
-
-static DEFINE_SPINLOCK(sh03_rtc_lock);
-
-static int sh03_rtc_gettimeofday(struct device *dev, struct rtc_time *tm)
-{
- unsigned int year, mon, day, hour, min, sec;
-
- spin_lock(&sh03_rtc_lock);
- again:
- do {
- sec = (__raw_readb(RTC_SEC1) & 0xf) + (__raw_readb(RTC_SEC10) & 0x7) * 10;
- min = (__raw_readb(RTC_MIN1) & 0xf) + (__raw_readb(RTC_MIN10) & 0xf) * 10;
- hour = (__raw_readb(RTC_HOU1) & 0xf) + (__raw_readb(RTC_HOU10) & 0xf) * 10;
- day = (__raw_readb(RTC_DAY1) & 0xf) + (__raw_readb(RTC_DAY10) & 0xf) * 10;
- mon = (__raw_readb(RTC_MON1) & 0xf) + (__raw_readb(RTC_MON10) & 0xf) * 10;
- year = (__raw_readb(RTC_YEA1) & 0xf) + (__raw_readb(RTC_YEA10) & 0xf) * 10
- + (__raw_readb(RTC_YEA100 ) & 0xf) * 100
- + (__raw_readb(RTC_YEA1000) & 0xf) * 1000;
- } while (sec != (__raw_readb(RTC_SEC1) & 0xf) + (__raw_readb(RTC_SEC10) & 0x7) * 10);
- if (year == 0 || mon < 1 || mon > 12 || day > 31 || day < 1 ||
- hour > 23 || min > 59 || sec > 59) {
- printk(KERN_ERR
- "SH-03 RTC: invalid value, resetting to 1 Jan 2000\n");
- printk("year=%d, mon=%d, day=%d, hour=%d, min=%d, sec=%d\n",
- year, mon, day, hour, min, sec);
-
- __raw_writeb(0, RTC_SEC1); __raw_writeb(0, RTC_SEC10);
- __raw_writeb(0, RTC_MIN1); __raw_writeb(0, RTC_MIN10);
- __raw_writeb(0, RTC_HOU1); __raw_writeb(0, RTC_HOU10);
- __raw_writeb(6, RTC_WEE1);
- __raw_writeb(1, RTC_DAY1); __raw_writeb(0, RTC_DAY10);
- __raw_writeb(1, RTC_MON1); __raw_writeb(0, RTC_MON10);
- __raw_writeb(0, RTC_YEA1); __raw_writeb(0, RTC_YEA10);
- __raw_writeb(0, RTC_YEA100);
- __raw_writeb(2, RTC_YEA1000);
- __raw_writeb(0, RTC_CTL);
- goto again;
- }
-
- spin_unlock(&sh03_rtc_lock);
-
- tm->tm_sec = sec;
- tm->tm_min = min;
- tm->tm_hour = hour;
- tm->tm_mday = day;
- tm->tm_mon = mon;
- tm->tm_year = year - 1900;
-
- return 0;
-}
-
-static int set_rtc_mmss(struct rtc_time *tm)
-{
- int retval = 0;
- int real_seconds, real_minutes, cmos_minutes;
- int i;
-
- /* gets recalled with irq locally disabled */
- spin_lock(&sh03_rtc_lock);
- for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
- if (!(__raw_readb(RTC_CTL) & RTC_BUSY))
- break;
- cmos_minutes = (__raw_readb(RTC_MIN1) & 0xf) + (__raw_readb(RTC_MIN10) & 0xf) * 10;
- real_seconds = tm->tm_sec;
- real_minutes = tm->tm_min;
- if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
- real_minutes += 30; /* correct for half hour time zone */
- real_minutes %= 60;
-
- if (abs(real_minutes - cmos_minutes) < 30) {
- __raw_writeb(real_seconds % 10, RTC_SEC1);
- __raw_writeb(real_seconds / 10, RTC_SEC10);
- __raw_writeb(real_minutes % 10, RTC_MIN1);
- __raw_writeb(real_minutes / 10, RTC_MIN10);
- } else {
- printk_once(KERN_NOTICE
- "set_rtc_mmss: can't update from %d to %d\n",
- cmos_minutes, real_minutes);
- retval = -EINVAL;
- }
- spin_unlock(&sh03_rtc_lock);
-
- return retval;
-}
-
-int sh03_rtc_settimeofday(struct device *dev, struct rtc_time *tm)
-{
- return set_rtc_mmss(tm);
-}
-
-static const struct rtc_class_ops rtc_generic_ops = {
- .read_time = sh03_rtc_gettimeofday,
- .set_time = sh03_rtc_settimeofday,
-};
-
-static int __init sh03_time_init(void)
-{
- struct platform_device *pdev;
-
- pdev = platform_device_register_data(NULL, "rtc-generic", -1,
- &rtc_generic_ops,
- sizeof(rtc_generic_ops));
-
- return PTR_ERR_OR_ZERO(pdev);
-}
-arch_initcall(sh03_time_init);
diff --git a/arch/sh/boards/mach-sh03/setup.c b/arch/sh/boards/mach-sh03/setup.c
deleted file mode 100644
index 3901b6031ad565..00000000000000
--- a/arch/sh/boards/mach-sh03/setup.c
+++ /dev/null
@@ -1,97 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/sh03/setup.c
- *
- * Copyright (C) 2004 Interface Co.,Ltd. Saito.K
- *
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/pci.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <asm/io.h>
-#include <asm/rtc.h>
-#include <mach-sh03/mach/io.h>
-#include <mach-sh03/mach/sh03.h>
-#include <asm/addrspace.h>
-
-static void __init init_sh03_IRQ(void)
-{
- plat_irq_setup_pins(IRQ_MODE_IRQ);
-}
-
-static struct resource cf_ide_resources[] = {
- [0] = {
- .start = 0x1f0,
- .end = 0x1f0 + 8,
- .flags = IORESOURCE_IO,
- },
- [1] = {
- .start = 0x1f0 + 0x206,
- .end = 0x1f0 +8 + 0x206 + 8,
- .flags = IORESOURCE_IO,
- },
- [2] = {
- .start = IRL2_IRQ,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device cf_ide_device = {
- .name = "pata_platform",
- .id = -1,
- .num_resources = ARRAY_SIZE(cf_ide_resources),
- .resource = cf_ide_resources,
-};
-
-static struct resource heartbeat_resources[] = {
- [0] = {
- .start = 0xa0800000,
- .end = 0xa0800000,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .num_resources = ARRAY_SIZE(heartbeat_resources),
- .resource = heartbeat_resources,
-};
-
-static struct platform_device *sh03_devices[] __initdata = {
- &heartbeat_device,
- &cf_ide_device,
-};
-
-static int __init sh03_devices_setup(void)
-{
- pgprot_t prot;
- unsigned long paddrbase;
- void *cf_ide_base;
-
- /* open I/O area window */
- paddrbase = virt_to_phys((void *)PA_AREA5_IO);
- prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
- cf_ide_base = ioremap_prot(paddrbase, PAGE_SIZE, pgprot_val(prot));
- if (!cf_ide_base) {
- printk("allocate_cf_area : can't open CF I/O window!\n");
- return -ENOMEM;
- }
-
- /* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */
- cf_ide_resources[0].start += (unsigned long)cf_ide_base;
- cf_ide_resources[0].end += (unsigned long)cf_ide_base;
- cf_ide_resources[1].start += (unsigned long)cf_ide_base;
- cf_ide_resources[1].end += (unsigned long)cf_ide_base;
-
- return platform_add_devices(sh03_devices, ARRAY_SIZE(sh03_devices));
-}
-device_initcall(sh03_devices_setup);
-
-static struct sh_machine_vector mv_sh03 __initmv = {
- .mv_name = "Interface (CTP/PCI-SH03)",
- .mv_init_irq = init_sh03_IRQ,
-};
diff --git a/arch/sh/boards/mach-sh7763rdp/Makefile b/arch/sh/boards/mach-sh7763rdp/Makefile
deleted file mode 100644
index d6341310444a51..00000000000000
--- a/arch/sh/boards/mach-sh7763rdp/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-y := setup.o irq.o
diff --git a/arch/sh/boards/mach-sh7763rdp/irq.c b/arch/sh/boards/mach-sh7763rdp/irq.c
deleted file mode 100644
index efd382b7dad403..00000000000000
--- a/arch/sh/boards/mach-sh7763rdp/irq.c
+++ /dev/null
@@ -1,42 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/renesas/sh7763rdp/irq.c
- *
- * Renesas Solutions SH7763RDP Support.
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- * Copyright (C) 2008 Nobuhiro Iwamatsu <[email protected]>
- */
-
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <mach/sh7763rdp.h>
-
-#define INTC_BASE (0xFFD00000)
-#define INTC_INT2PRI7 (INTC_BASE+0x4001C)
-#define INTC_INT2MSKCR (INTC_BASE+0x4003C)
-#define INTC_INT2MSKCR1 (INTC_BASE+0x400D4)
-
-/*
- * Initialize IRQ setting
- */
-void __init init_sh7763rdp_IRQ(void)
-{
- /* GPIO enabled */
- __raw_writel(1 << 25, INTC_INT2MSKCR);
-
- /* enable GPIO interrupts */
- __raw_writel((__raw_readl(INTC_INT2PRI7) & 0xFF00FFFF) | 0x000F0000,
- INTC_INT2PRI7);
-
- /* USBH enabled */
- __raw_writel(1 << 17, INTC_INT2MSKCR1);
-
- /* GETHER enabled */
- __raw_writel(1 << 16, INTC_INT2MSKCR1);
-
- /* DMAC enabled */
- __raw_writel(1 << 8, INTC_INT2MSKCR);
-}
diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c
deleted file mode 100644
index 97e715e4e9b33c..00000000000000
--- a/arch/sh/boards/mach-sh7763rdp/setup.c
+++ /dev/null
@@ -1,213 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/arch/sh/boards/renesas/sh7763rdp/setup.c
- *
- * Renesas Solutions sh7763rdp board
- *
- * Copyright (C) 2008 Renesas Solutions Corp.
- * Copyright (C) 2008 Nobuhiro Iwamatsu <[email protected]>
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/mtd/physmap.h>
-#include <linux/fb.h>
-#include <linux/io.h>
-#include <linux/sh_eth.h>
-#include <linux/sh_intc.h>
-#include <mach/sh7763rdp.h>
-#include <asm/sh7760fb.h>
-
-/* NOR Flash */
-static struct mtd_partition sh7763rdp_nor_flash_partitions[] = {
- {
- .name = "U-Boot",
- .offset = 0,
- .size = (2 * 128 * 1024),
- .mask_flags = MTD_WRITEABLE, /* Read-only */
- }, {
- .name = "Linux-Kernel",
- .offset = MTDPART_OFS_APPEND,
- .size = (20 * 128 * 1024),
- }, {
- .name = "Root Filesystem",
- .offset = MTDPART_OFS_APPEND,
- .size = MTDPART_SIZ_FULL,
- },
-};
-
-static struct physmap_flash_data sh7763rdp_nor_flash_data = {
- .width = 2,
- .parts = sh7763rdp_nor_flash_partitions,
- .nr_parts = ARRAY_SIZE(sh7763rdp_nor_flash_partitions),
-};
-
-static struct resource sh7763rdp_nor_flash_resources[] = {
- [0] = {
- .name = "NOR Flash",
- .start = 0,
- .end = (64 * 1024 * 1024),
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device sh7763rdp_nor_flash_device = {
- .name = "physmap-flash",
- .resource = sh7763rdp_nor_flash_resources,
- .num_resources = ARRAY_SIZE(sh7763rdp_nor_flash_resources),
- .dev = {
- .platform_data = &sh7763rdp_nor_flash_data,
- },
-};
-
-/*
- * SH-Ether
- *
- * SH Ether of SH7763 has multi IRQ handling.
- * (0x920,0x940,0x960 -> 0x920)
- */
-static struct resource sh_eth_resources[] = {
- {
- .start = 0xFEE00800, /* use eth1 */
- .end = 0xFEE00F7C - 1,
- .flags = IORESOURCE_MEM,
- }, {
- .start = 0xFEE01800, /* TSU */
- .end = 0xFEE01FFF,
- .flags = IORESOURCE_MEM,
- }, {
- .start = evt2irq(0x920), /* irq number */
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct sh_eth_plat_data sh7763_eth_pdata = {
- .phy = 1,
- .phy_interface = PHY_INTERFACE_MODE_MII,
-};
-
-static struct platform_device sh7763rdp_eth_device = {
- .name = "sh7763-gether",
- .resource = sh_eth_resources,
- .num_resources = ARRAY_SIZE(sh_eth_resources),
- .dev = {
- .platform_data = &sh7763_eth_pdata,
- },
-};
-
-/* SH7763 LCDC */
-static struct resource sh7763rdp_fb_resources[] = {
- {
- .start = 0xFFE80000,
- .end = 0xFFE80442 - 1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct fb_videomode sh7763fb_videomode = {
- .refresh = 60,
- .name = "VGA Monitor",
- .xres = 640,
- .yres = 480,
- .pixclock = 10000,
- .left_margin = 80,
- .right_margin = 24,
- .upper_margin = 30,
- .lower_margin = 1,
- .hsync_len = 96,
- .vsync_len = 1,
- .sync = 0,
- .vmode = FB_VMODE_NONINTERLACED,
- .flag = FBINFO_FLAG_DEFAULT,
-};
-
-static struct sh7760fb_platdata sh7763fb_def_pdata = {
- .def_mode = &sh7763fb_videomode,
- .ldmtr = (LDMTR_TFT_COLOR_16|LDMTR_MCNT),
- .lddfr = LDDFR_16BPP_RGB565,
- .ldpmmr = 0x0000,
- .ldpspr = 0xFFFF,
- .ldaclnr = 0x0001,
- .ldickr = 0x1102,
- .rotate = 0,
- .novsync = 0,
- .blank = NULL,
-};
-
-static struct platform_device sh7763rdp_fb_device = {
- .name = "sh7760-lcdc",
- .resource = sh7763rdp_fb_resources,
- .num_resources = ARRAY_SIZE(sh7763rdp_fb_resources),
- .dev = {
- .platform_data = &sh7763fb_def_pdata,
- },
-};
-
-static struct platform_device *sh7763rdp_devices[] __initdata = {
- &sh7763rdp_nor_flash_device,
- &sh7763rdp_eth_device,
- &sh7763rdp_fb_device,
-};
-
-static int __init sh7763rdp_devices_setup(void)
-{
- return platform_add_devices(sh7763rdp_devices,
- ARRAY_SIZE(sh7763rdp_devices));
-}
-device_initcall(sh7763rdp_devices_setup);
-
-static void __init sh7763rdp_setup(char **cmdline_p)
-{
- /* Board version check */
- if (__raw_readw(CPLD_BOARD_ID_ERV_REG) == 0xECB1)
- printk(KERN_INFO "RTE Standard Configuration\n");
- else
- printk(KERN_INFO "RTA Standard Configuration\n");
-
- /* USB pin select bits (clear bit 5-2 to 0) */
- __raw_writew((__raw_readw(PORT_PSEL2) & 0xFFC3), PORT_PSEL2);
- /* USBH setup port I controls to other (clear bits 4-9 to 0) */
- __raw_writew(__raw_readw(PORT_PICR) & 0xFC0F, PORT_PICR);
-
- /* Select USB Host controller */
- __raw_writew(0x00, USB_USBHSC);
-
- /* For LCD */
- /* set PTJ7-1, bits 15-2 of PJCR to 0 */
- __raw_writew(__raw_readw(PORT_PJCR) & 0x0003, PORT_PJCR);
- /* set PTI5, bits 11-10 of PICR to 0 */
- __raw_writew(__raw_readw(PORT_PICR) & 0xF3FF, PORT_PICR);
- __raw_writew(0, PORT_PKCR);
- __raw_writew(0, PORT_PLCR);
- /* set PSEL2 bits 14-8, 5-4, of PSEL2 to 0 */
- __raw_writew((__raw_readw(PORT_PSEL2) & 0x00C0), PORT_PSEL2);
- /* set PSEL3 bits 14-12, 6-4, 2-0 of PSEL3 to 0 */
- __raw_writew((__raw_readw(PORT_PSEL3) & 0x0700), PORT_PSEL3);
-
- /* For HAC */
- /* bit3-0 0100:HAC & SSI1 enable */
- __raw_writew((__raw_readw(PORT_PSEL1) & 0xFFF0) | 0x0004, PORT_PSEL1);
- /* bit14 1:SSI_HAC_CLK enable */
- __raw_writew(__raw_readw(PORT_PSEL4) | 0x4000, PORT_PSEL4);
-
- /* SH-Ether */
- __raw_writew((__raw_readw(PORT_PSEL1) & ~0xff00) | 0x2400, PORT_PSEL1);
- __raw_writew(0x0, PORT_PFCR);
- __raw_writew(0x0, PORT_PFCR);
- __raw_writew(0x0, PORT_PFCR);
-
- /* MMC */
- /*selects SCIF and MMC other functions */
- __raw_writew(0x0001, PORT_PSEL0);
- /* MMC clock operates */
- __raw_writel(__raw_readl(MSTPCR1) & ~0x8, MSTPCR1);
- __raw_writew(__raw_readw(PORT_PACR) & ~0x3000, PORT_PACR);
- __raw_writew(__raw_readw(PORT_PCCR) & ~0xCFC3, PORT_PCCR);
-}
-
-static struct sh_machine_vector mv_sh7763rdp __initmv = {
- .mv_name = "sh7763drp",
- .mv_setup = sh7763rdp_setup,
- .mv_init_irq = init_sh7763rdp_IRQ,
-};
diff --git a/arch/sh/boards/mach-x3proto/Makefile b/arch/sh/boards/mach-x3proto/Makefile
deleted file mode 100644
index 6caefa1145980d..00000000000000
--- a/arch/sh/boards/mach-x3proto/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-y += setup.o ilsel.o
-
-obj-$(CONFIG_GPIOLIB) += gpio.o
diff --git a/arch/sh/boards/mach-x3proto/gpio.c b/arch/sh/boards/mach-x3proto/gpio.c
deleted file mode 100644
index f82d3a6a844a58..00000000000000
--- a/arch/sh/boards/mach-x3proto/gpio.c
+++ /dev/null
@@ -1,136 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/mach-x3proto/gpio.c
- *
- * Renesas SH-X3 Prototype Baseboard GPIO Support.
- *
- * Copyright (C) 2010 - 2012 Paul Mundt
- */
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/gpio/driver.h>
-#include <linux/irq.h>
-#include <linux/kernel.h>
-#include <linux/spinlock.h>
-#include <linux/irqdomain.h>
-#include <linux/io.h>
-#include <mach/ilsel.h>
-#include <mach/hardware.h>
-
-#define KEYCTLR 0xb81c0000
-#define KEYOUTR 0xb81c0002
-#define KEYDETR 0xb81c0004
-
-static DEFINE_SPINLOCK(x3proto_gpio_lock);
-static struct irq_domain *x3proto_irq_domain;
-
-static int x3proto_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
-{
- unsigned long flags;
- unsigned int data;
-
- spin_lock_irqsave(&x3proto_gpio_lock, flags);
- data = __raw_readw(KEYCTLR);
- data |= (1 << gpio);
- __raw_writew(data, KEYCTLR);
- spin_unlock_irqrestore(&x3proto_gpio_lock, flags);
-
- return 0;
-}
-
-static int x3proto_gpio_get(struct gpio_chip *chip, unsigned gpio)
-{
- return !!(__raw_readw(KEYDETR) & (1 << gpio));
-}
-
-static int x3proto_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
-{
- int virq;
-
- if (gpio < chip->ngpio)
- virq = irq_create_mapping(x3proto_irq_domain, gpio);
- else
- virq = -ENXIO;
-
- return virq;
-}
-
-static void x3proto_gpio_irq_handler(struct irq_desc *desc)
-{
- struct irq_data *data = irq_desc_get_irq_data(desc);
- struct irq_chip *chip = irq_data_get_irq_chip(data);
- unsigned long mask;
- int pin;
-
- chip->irq_mask_ack(data);
-
- mask = __raw_readw(KEYDETR);
- for_each_set_bit(pin, &mask, NR_BASEBOARD_GPIOS)
- generic_handle_domain_irq(x3proto_irq_domain, pin);
-
- chip->irq_unmask(data);
-}
-
-struct gpio_chip x3proto_gpio_chip = {
- .label = "x3proto-gpio",
- .direction_input = x3proto_gpio_direction_input,
- .get = x3proto_gpio_get,
- .to_irq = x3proto_gpio_to_irq,
- .base = -1,
- .ngpio = NR_BASEBOARD_GPIOS,
-};
-
-static int x3proto_gpio_irq_map(struct irq_domain *domain, unsigned int virq,
- irq_hw_number_t hwirq)
-{
- irq_set_chip_and_handler_name(virq, &dummy_irq_chip, handle_simple_irq,
- "gpio");
-
- return 0;
-}
-
-static struct irq_domain_ops x3proto_gpio_irq_ops = {
- .map = x3proto_gpio_irq_map,
- .xlate = irq_domain_xlate_twocell,
-};
-
-int __init x3proto_gpio_setup(void)
-{
- int ilsel, ret;
-
- ilsel = ilsel_enable(ILSEL_KEY);
- if (unlikely(ilsel < 0))
- return ilsel;
-
- ret = gpiochip_add_data(&x3proto_gpio_chip, NULL);
- if (unlikely(ret))
- goto err_gpio;
-
- x3proto_irq_domain = irq_domain_add_linear(NULL, NR_BASEBOARD_GPIOS,
- &x3proto_gpio_irq_ops, NULL);
- if (unlikely(!x3proto_irq_domain))
- goto err_irq;
-
- pr_info("registering '%s' support, handling GPIOs %u -> %u, "
- "bound to IRQ %u\n",
- x3proto_gpio_chip.label, x3proto_gpio_chip.base,
- x3proto_gpio_chip.base + x3proto_gpio_chip.ngpio,
- ilsel);
-
- irq_set_chained_handler(ilsel, x3proto_gpio_irq_handler);
- irq_set_irq_wake(ilsel, 1);
-
- return 0;
-
-err_irq:
- gpiochip_remove(&x3proto_gpio_chip);
- ret = 0;
-err_gpio:
- synchronize_irq(ilsel);
-
- ilsel_disable(ILSEL_KEY);
-
- return ret;
-}
diff --git a/arch/sh/boards/mach-x3proto/ilsel.c b/arch/sh/boards/mach-x3proto/ilsel.c
deleted file mode 100644
index f0d5eb41521a49..00000000000000
--- a/arch/sh/boards/mach-x3proto/ilsel.c
+++ /dev/null
@@ -1,156 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/mach-x3proto/ilsel.c
- *
- * Helper routines for SH-X3 proto board ILSEL.
- *
- * Copyright (C) 2007 - 2010 Paul Mundt
- */
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/bitmap.h>
-#include <linux/io.h>
-#include <mach/ilsel.h>
-
-/*
- * ILSEL is split across:
- *
- * ILSEL0 - 0xb8100004 [ Levels 1 - 4 ]
- * ILSEL1 - 0xb8100006 [ Levels 5 - 8 ]
- * ILSEL2 - 0xb8100008 [ Levels 9 - 12 ]
- * ILSEL3 - 0xb810000a [ Levels 13 - 15 ]
- *
- * With each level being relative to an ilsel_source_t.
- */
-#define ILSEL_BASE 0xb8100004
-#define ILSEL_LEVELS 15
-
-/*
- * ILSEL level map, in descending order from the highest level down.
- *
- * Supported levels are 1 - 15 spread across ILSEL0 - ILSEL4, mapping
- * directly to IRLs. As the IRQs are numbered in reverse order relative
- * to the interrupt level, the level map is carefully managed to ensure a
- * 1:1 mapping between the bit position and the IRQ number.
- *
- * This careful constructions allows ilsel_enable*() to be referenced
- * directly for hooking up an ILSEL set and getting back an IRQ which can
- * subsequently be used for internal accounting in the (optional) disable
- * path.
- */
-static unsigned long ilsel_level_map;
-
-static inline unsigned int ilsel_offset(unsigned int bit)
-{
- return ILSEL_LEVELS - bit - 1;
-}
-
-static inline unsigned long mk_ilsel_addr(unsigned int bit)
-{
- return ILSEL_BASE + ((ilsel_offset(bit) >> 1) & ~0x1);
-}
-
-static inline unsigned int mk_ilsel_shift(unsigned int bit)
-{
- return (ilsel_offset(bit) & 0x3) << 2;
-}
-
-static void __ilsel_enable(ilsel_source_t set, unsigned int bit)
-{
- unsigned int tmp, shift;
- unsigned long addr;
-
- pr_notice("enabling ILSEL set %d\n", set);
-
- addr = mk_ilsel_addr(bit);
- shift = mk_ilsel_shift(bit);
-
- pr_debug("%s: bit#%d: addr - 0x%08lx (shift %d, set %d)\n",
- __func__, bit, addr, shift, set);
-
- tmp = __raw_readw(addr);
- tmp &= ~(0xf << shift);
- tmp |= set << shift;
- __raw_writew(tmp, addr);
-}
-
-/**
- * ilsel_enable - Enable an ILSEL set.
- * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).
- *
- * Enables a given non-aliased ILSEL source (<= ILSEL_KEY) at the highest
- * available interrupt level. Callers should take care to order callsites
- * noting descending interrupt levels. Aliasing FPGA and external board
- * IRQs need to use ilsel_enable_fixed().
- *
- * The return value is an IRQ number that can later be taken down with
- * ilsel_disable().
- */
-int ilsel_enable(ilsel_source_t set)
-{
- unsigned int bit;
-
- if (unlikely(set > ILSEL_KEY)) {
- pr_err("Aliased sources must use ilsel_enable_fixed()\n");
- return -EINVAL;
- }
-
- do {
- bit = find_first_zero_bit(&ilsel_level_map, ILSEL_LEVELS);
- } while (test_and_set_bit(bit, &ilsel_level_map));
-
- __ilsel_enable(set, bit);
-
- return bit;
-}
-EXPORT_SYMBOL_GPL(ilsel_enable);
-
-/**
- * ilsel_enable_fixed - Enable an ILSEL set at a fixed interrupt level
- * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).
- * @level: Interrupt level (1 - 15)
- *
- * Enables a given ILSEL source at a fixed interrupt level. Necessary
- * both for level reservation as well as for aliased sources that only
- * exist on special ILSEL#s.
- *
- * Returns an IRQ number (as ilsel_enable()).
- */
-int ilsel_enable_fixed(ilsel_source_t set, unsigned int level)
-{
- unsigned int bit = ilsel_offset(level - 1);
-
- if (test_and_set_bit(bit, &ilsel_level_map))
- return -EBUSY;
-
- __ilsel_enable(set, bit);
-
- return bit;
-}
-EXPORT_SYMBOL_GPL(ilsel_enable_fixed);
-
-/**
- * ilsel_disable - Disable an ILSEL set
- * @irq: Bit position for ILSEL set value (retval from enable routines)
- *
- * Disable a previously enabled ILSEL set.
- */
-void ilsel_disable(unsigned int irq)
-{
- unsigned long addr;
- unsigned int tmp;
-
- pr_notice("disabling ILSEL set %d\n", irq);
-
- addr = mk_ilsel_addr(irq);
-
- tmp = __raw_readw(addr);
- tmp &= ~(0xf << mk_ilsel_shift(irq));
- __raw_writew(tmp, addr);
-
- clear_bit(irq, &ilsel_level_map);
-}
-EXPORT_SYMBOL_GPL(ilsel_disable);
diff --git a/arch/sh/boards/mach-x3proto/setup.c b/arch/sh/boards/mach-x3proto/setup.c
deleted file mode 100644
index 95b85f2e13dda7..00000000000000
--- a/arch/sh/boards/mach-x3proto/setup.c
+++ /dev/null
@@ -1,270 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boards/mach-x3proto/setup.c
- *
- * Renesas SH-X3 Prototype Board Support.
- *
- * Copyright (C) 2007 - 2010 Paul Mundt
- */
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/kernel.h>
-#include <linux/io.h>
-#include <linux/smc91x.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/usb/r8a66597.h>
-#include <linux/usb/m66592.h>
-#include <linux/gpio.h>
-#include <linux/gpio_keys.h>
-#include <mach/ilsel.h>
-#include <mach/hardware.h>
-#include <asm/smp-ops.h>
-
-static struct resource heartbeat_resources[] = {
- [0] = {
- .start = 0xb8140020,
- .end = 0xb8140020,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device heartbeat_device = {
- .name = "heartbeat",
- .id = -1,
- .num_resources = ARRAY_SIZE(heartbeat_resources),
- .resource = heartbeat_resources,
-};
-
-static struct smc91x_platdata smc91x_info = {
- .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
-};
-
-static struct resource smc91x_resources[] = {
- [0] = {
- .start = 0x18000300,
- .end = 0x18000300 + 0x10 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- /* Filled in by ilsel */
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device smc91x_device = {
- .name = "smc91x",
- .id = -1,
- .resource = smc91x_resources,
- .num_resources = ARRAY_SIZE(smc91x_resources),
- .dev = {
- .platform_data = &smc91x_info,
- },
-};
-
-static struct r8a66597_platdata r8a66597_data = {
- .xtal = R8A66597_PLATDATA_XTAL_12MHZ,
- .vif = 1,
-};
-
-static struct resource r8a66597_usb_host_resources[] = {
- [0] = {
- .start = 0x18040000,
- .end = 0x18080000 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- /* Filled in by ilsel */
- .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
- },
-};
-
-static struct platform_device r8a66597_usb_host_device = {
- .name = "r8a66597_hcd",
- .id = -1,
- .dev = {
- .dma_mask = NULL, /* don't use dma */
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &r8a66597_data,
- },
- .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources),
- .resource = r8a66597_usb_host_resources,
-};
-
-static struct m66592_platdata usbf_platdata = {
- .xtal = M66592_PLATDATA_XTAL_24MHZ,
- .vif = 1,
-};
-
-static struct resource m66592_usb_peripheral_resources[] = {
- [0] = {
- .name = "m66592_udc",
- .start = 0x18080000,
- .end = 0x180c0000 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .name = "m66592_udc",
- /* Filled in by ilsel */
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device m66592_usb_peripheral_device = {
- .name = "m66592_udc",
- .id = -1,
- .dev = {
- .dma_mask = NULL, /* don't use dma */
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &usbf_platdata,
- },
- .num_resources = ARRAY_SIZE(m66592_usb_peripheral_resources),
- .resource = m66592_usb_peripheral_resources,
-};
-
-static struct gpio_keys_button baseboard_buttons[NR_BASEBOARD_GPIOS] = {
- {
- .desc = "key44",
- .code = KEY_POWER,
- .active_low = 1,
- .wakeup = 1,
- }, {
- .desc = "key43",
- .code = KEY_SUSPEND,
- .active_low = 1,
- .wakeup = 1,
- }, {
- .desc = "key42",
- .code = KEY_KATAKANAHIRAGANA,
- .active_low = 1,
- }, {
- .desc = "key41",
- .code = KEY_SWITCHVIDEOMODE,
- .active_low = 1,
- }, {
- .desc = "key34",
- .code = KEY_F12,
- .active_low = 1,
- }, {
- .desc = "key33",
- .code = KEY_F11,
- .active_low = 1,
- }, {
- .desc = "key32",
- .code = KEY_F10,
- .active_low = 1,
- }, {
- .desc = "key31",
- .code = KEY_F9,
- .active_low = 1,
- }, {
- .desc = "key24",
- .code = KEY_F8,
- .active_low = 1,
- }, {
- .desc = "key23",
- .code = KEY_F7,
- .active_low = 1,
- }, {
- .desc = "key22",
- .code = KEY_F6,
- .active_low = 1,
- }, {
- .desc = "key21",
- .code = KEY_F5,
- .active_low = 1,
- }, {
- .desc = "key14",
- .code = KEY_F4,
- .active_low = 1,
- }, {
- .desc = "key13",
- .code = KEY_F3,
- .active_low = 1,
- }, {
- .desc = "key12",
- .code = KEY_F2,
- .active_low = 1,
- }, {
- .desc = "key11",
- .code = KEY_F1,
- .active_low = 1,
- },
-};
-
-static struct gpio_keys_platform_data baseboard_buttons_data = {
- .buttons = baseboard_buttons,
- .nbuttons = ARRAY_SIZE(baseboard_buttons),
-};
-
-static struct platform_device baseboard_buttons_device = {
- .name = "gpio-keys",
- .id = -1,
- .dev = {
- .platform_data = &baseboard_buttons_data,
- },
-};
-
-static struct platform_device *x3proto_devices[] __initdata = {
- &heartbeat_device,
- &smc91x_device,
- &r8a66597_usb_host_device,
- &m66592_usb_peripheral_device,
- &baseboard_buttons_device,
-};
-
-static void __init x3proto_init_irq(void)
-{
- plat_irq_setup_pins(IRQ_MODE_IRL3210);
-
- /* Set ICR0.LVLMODE */
- __raw_writel(__raw_readl(0xfe410000) | (1 << 21), 0xfe410000);
-}
-
-static int __init x3proto_devices_setup(void)
-{
- int ret, i;
-
- /*
- * IRLs are only needed for ILSEL mappings, so flip over the INTC
- * pins at a later point to enable the GPIOs to settle.
- */
- x3proto_init_irq();
-
- /*
- * Now that ILSELs are available, set up the baseboard GPIOs.
- */
- ret = x3proto_gpio_setup();
- if (unlikely(ret))
- return ret;
-
- /*
- * Propagate dynamic GPIOs for the baseboard button device.
- */
- for (i = 0; i < ARRAY_SIZE(baseboard_buttons); i++)
- baseboard_buttons[i].gpio = x3proto_gpio_chip.base + i;
-
- r8a66597_usb_host_resources[1].start =
- r8a66597_usb_host_resources[1].end = ilsel_enable(ILSEL_USBH_I);
-
- m66592_usb_peripheral_resources[1].start =
- m66592_usb_peripheral_resources[1].end = ilsel_enable(ILSEL_USBP_I);
-
- smc91x_resources[1].start =
- smc91x_resources[1].end = ilsel_enable(ILSEL_LAN);
-
- return platform_add_devices(x3proto_devices,
- ARRAY_SIZE(x3proto_devices));
-}
-device_initcall(x3proto_devices_setup);
-
-static void __init x3proto_setup(char **cmdline_p)
-{
- register_smp_ops(&shx3_smp_ops);
-}
-
-static struct sh_machine_vector mv_x3proto __initmv = {
- .mv_name = "x3proto",
- .mv_setup = x3proto_setup,
-};
diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c
deleted file mode 100644
index f7f3e618e85b6a..00000000000000
--- a/arch/sh/boards/of-generic.c
+++ /dev/null
@@ -1,172 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * SH generic board support, using device tree
- *
- * Copyright (C) 2015-2016 Smart Energy Instruments, Inc.
- */
-
-#include <linux/of.h>
-#include <linux/of_clk.h>
-#include <linux/of_fdt.h>
-#include <linux/clocksource.h>
-#include <linux/irqchip.h>
-#include <asm/machvec.h>
-#include <asm/rtc.h>
-
-#ifdef CONFIG_SMP
-
-static void dummy_smp_setup(void)
-{
-}
-
-static void dummy_prepare_cpus(unsigned int max_cpus)
-{
-}
-
-static void dummy_start_cpu(unsigned int cpu, unsigned long entry_point)
-{
-}
-
-static unsigned int dummy_smp_processor_id(void)
-{
- return 0;
-}
-
-static void dummy_send_ipi(unsigned int cpu, unsigned int message)
-{
-}
-
-static struct plat_smp_ops dummy_smp_ops = {
- .smp_setup = dummy_smp_setup,
- .prepare_cpus = dummy_prepare_cpus,
- .start_cpu = dummy_start_cpu,
- .smp_processor_id = dummy_smp_processor_id,
- .send_ipi = dummy_send_ipi,
- .cpu_die = native_cpu_die,
- .cpu_disable = native_cpu_disable,
- .play_dead = native_play_dead,
-};
-
-extern const struct of_cpu_method __cpu_method_of_table[];
-const struct of_cpu_method __cpu_method_of_table_sentinel
- __section("__cpu_method_of_table_end");
-
-static void sh_of_smp_probe(void)
-{
- struct device_node *np;
- const char *method = NULL;
- const struct of_cpu_method *m = __cpu_method_of_table;
-
- pr_info("SH generic board support: scanning for cpus\n");
-
- init_cpu_possible(cpumask_of(0));
-
- for_each_of_cpu_node(np) {
- u64 id = of_get_cpu_hwid(np, 0);
-
- if (id < NR_CPUS) {
- if (!method)
- of_property_read_string(np, "enable-method", &method);
- set_cpu_possible(id, true);
- set_cpu_present(id, true);
- __cpu_number_map[id] = id;
- __cpu_logical_map[id] = id;
- }
- }
- if (!method) {
- np = of_find_node_by_name(NULL, "cpus");
- of_property_read_string(np, "enable-method", &method);
- of_node_put(np);
- }
-
- pr_info("CPU enable method: %s\n", method);
- if (method)
- for (; m->method; m++)
- if (!strcmp(m->method, method)) {
- register_smp_ops(m->ops);
- return;
- }
-
- register_smp_ops(&dummy_smp_ops);
-}
-
-#else
-
-static void sh_of_smp_probe(void)
-{
-}
-
-#endif
-
-static void noop(void)
-{
-}
-
-static int noopi(void)
-{
- return 0;
-}
-
-static void __init sh_of_mem_reserve(void)
-{
- early_init_fdt_reserve_self();
- early_init_fdt_scan_reserved_mem();
-}
-
-static void __init sh_of_setup(char **cmdline_p)
-{
- struct device_node *root;
-
- sh_mv.mv_name = "Unknown SH model";
- root = of_find_node_by_path("/");
- if (root) {
- of_property_read_string(root, "model", &sh_mv.mv_name);
- of_node_put(root);
- }
-
- sh_of_smp_probe();
-}
-
-static int sh_of_irq_demux(int irq)
-{
- /* FIXME: eventually this should not be used at all;
- * the interrupt controller should set_handle_irq(). */
- return irq;
-}
-
-static void __init sh_of_init_irq(void)
-{
- pr_info("SH generic board support: scanning for interrupt controllers\n");
- irqchip_init();
-}
-
-static int __init sh_of_clk_init(void)
-{
-#ifdef CONFIG_COMMON_CLK
- /* Disabled pending move to COMMON_CLK framework. */
- pr_info("SH generic board support: scanning for clk providers\n");
- of_clk_init(NULL);
-#endif
- return 0;
-}
-
-static struct sh_machine_vector __initmv sh_of_generic_mv = {
- .mv_setup = sh_of_setup,
- .mv_name = "devicetree", /* replaced by DT root's model */
- .mv_irq_demux = sh_of_irq_demux,
- .mv_init_irq = sh_of_init_irq,
- .mv_clk_init = sh_of_clk_init,
- .mv_mode_pins = noopi,
- .mv_mem_init = noop,
- .mv_mem_reserve = sh_of_mem_reserve,
-};
-
-struct sh_clk_ops;
-
-void __init __weak arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
-{
-}
-
-void __init __weak plat_irq_setup(void)
-{
-}
diff --git a/arch/sh/boot/.gitignore b/arch/sh/boot/.gitignore
deleted file mode 100644
index 6603bbbc917d64..00000000000000
--- a/arch/sh/boot/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-zImage
-vmlinux*
-uImage*
-!vmlinux.scr
diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile
deleted file mode 100644
index 1f5d2df3c7e060..00000000000000
--- a/arch/sh/boot/Makefile
+++ /dev/null
@@ -1,115 +0,0 @@
-#
-# arch/sh/boot/Makefile
-#
-# This file is subject to the terms and conditions of the GNU General Public
-# License. See the file "COPYING" in the main directory of this archive
-# for more details.
-#
-# Copyright (C) 1999 Stuart Menefy
-#
-
-#
-# Assign safe dummy values if these variables are not defined,
-# in order to suppress error message.
-#
-CONFIG_PAGE_OFFSET ?= 0x80000000
-CONFIG_MEMORY_START ?= 0x0c000000
-CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
-CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
-CONFIG_ENTRY_OFFSET ?= 0x00001000
-CONFIG_PHYSICAL_START ?= $(CONFIG_MEMORY_START)
-
-suffix_y := bin
-suffix_$(CONFIG_KERNEL_GZIP) := gz
-suffix_$(CONFIG_KERNEL_BZIP2) := bz2
-suffix_$(CONFIG_KERNEL_LZMA) := lzma
-suffix_$(CONFIG_KERNEL_XZ) := xz
-suffix_$(CONFIG_KERNEL_LZO) := lzo
-
-targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \
- uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin \
- vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
- vmlinux.bin.xz vmlinux.bin.lzo
-subdir- := compressed romimage
-
-$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
- $(call if_changed,objcopy)
- @echo ' Kernel: [email protected] is ready'
-
-$(obj)/compressed/vmlinux: FORCE
- $(Q)$(MAKE) $(build)=$(obj)/compressed [email protected]
-
-$(obj)/romImage: $(obj)/romimage/vmlinux FORCE
- $(call if_changed,objcopy)
- @echo ' Kernel: [email protected] is ready'
-
-$(obj)/romimage/vmlinux: $(obj)/zImage FORCE
- $(Q)$(MAKE) $(build)=$(obj)/romimage [email protected]
-
-KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
- $$[$(CONFIG_PHYSICAL_START) & 0x1fffffff]')
-
-KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
- $$[$(CONFIG_PAGE_OFFSET) + \
- $(KERNEL_MEMORY) + \
- $(CONFIG_ZERO_PAGE_OFFSET)]')
-
-KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \
- $$[$(CONFIG_PAGE_OFFSET) + \
- $(KERNEL_MEMORY) + \
- $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
-
-UIMAGE_LOADADDR = $(KERNEL_LOAD)
-UIMAGE_ENTRYADDR = $(KERNEL_ENTRY)
-
-$(obj)/vmlinux.bin: vmlinux FORCE
- $(call if_changed,objcopy)
-
-$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
- $(call if_changed,gzip)
-
-$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
- $(call if_changed,bzip2)
-
-$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
- $(call if_changed,lzma)
-
-$(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE
- $(call if_changed,xzkern)
-
-$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
- $(call if_changed,lzo)
-
-$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2 FORCE
- $(call if_changed,uimage,bzip2)
-
-$(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE
- $(call if_changed,uimage,gzip)
-
-$(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE
- $(call if_changed,uimage,lzma)
-
-$(obj)/uImage.xz: $(obj)/vmlinux.bin.xz FORCE
- $(call if_changed,uimage,xz)
-
-$(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo FORCE
- $(call if_changed,uimage,lzo)
-
-$(obj)/uImage.bin: $(obj)/vmlinux.bin FORCE
- $(call if_changed,uimage,none)
-
-OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
-$(obj)/vmlinux.srec: $(obj)/compressed/vmlinux FORCE
- $(call if_changed,objcopy)
-
-OBJCOPYFLAGS_uImage.srec := -I binary -O srec
-$(obj)/uImage.srec: $(obj)/uImage FORCE
- $(call if_changed,objcopy)
-
-$(obj)/uImage: $(obj)/uImage.$(suffix_y)
- @ln -sf $(notdir $<) [email protected]
- @echo ' Image [email protected] is ready'
-
-export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
- CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \
- KERNEL_MEMORY suffix_y
diff --git a/arch/sh/boot/compressed/.gitignore b/arch/sh/boot/compressed/.gitignore
deleted file mode 100644
index cd16663bc7c84c..00000000000000
--- a/arch/sh/boot/compressed/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-vmlinux.bin.*
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile
deleted file mode 100644
index 591125c42d49df..00000000000000
--- a/arch/sh/boot/compressed/Makefile
+++ /dev/null
@@ -1,66 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# linux/arch/sh/boot/compressed/Makefile
-#
-# create a compressed vmlinux image from the original vmlinux
-#
-
-OBJECTS := head_32.o misc.o cache.o piggy.o \
- ashiftrt.o ashldi3.o ashrsi3.o ashlsi3.o lshrsi3.o
-
-# These were previously generated files. When you are building the kernel
-# with O=, make sure to remove the stale files in the output tree. Otherwise,
-# the build system wrongly compiles the stale ones.
-ifdef building_out_of_srctree
-$(shell rm -f $(addprefix $(obj)/, ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S lshrsi3.S))
-endif
-
-targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
- vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo $(OBJECTS)
-
-GCOV_PROFILE := n
-
-#
-# IMAGE_OFFSET is the load offset of the compression loader
-#
-ifeq ($(CONFIG_32BIT),y)
-IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
- $$[$(CONFIG_MEMORY_START) + \
- $(CONFIG_BOOT_LINK_OFFSET)]')
-else
-IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
- $$[$(CONFIG_PAGE_OFFSET) + \
- $(KERNEL_MEMORY) + \
- $(CONFIG_BOOT_LINK_OFFSET)]')
-endif
-
-ccflags-remove-$(CONFIG_MCOUNT) += -pg
-
-LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
- -T $(obj)/../../kernel/vmlinux.lds
-
-KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
-
-$(obj)/vmlinux: $(addprefix $(obj)/, $(OBJECTS)) FORCE
- $(call if_changed,ld)
-
-$(obj)/vmlinux.bin: vmlinux FORCE
- $(call if_changed,objcopy)
-
-$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
- $(call if_changed,gzip)
-$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
- $(call if_changed,bzip2_with_size)
-$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
- $(call if_changed,lzma_with_size)
-$(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE
- $(call if_changed,xzkern_with_size)
-$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
- $(call if_changed,lzo_with_size)
-
-OBJCOPYFLAGS += -R .empty_zero_page
-
-LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
-
-$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE
- $(call if_changed,ld)
diff --git a/arch/sh/boot/compressed/ashiftrt.S b/arch/sh/boot/compressed/ashiftrt.S
deleted file mode 100644
index 0f3b291a3f4bca..00000000000000
--- a/arch/sh/boot/compressed/ashiftrt.S
+++ /dev/null
@@ -1,2 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#include "../../lib/ashiftrt.S"
diff --git a/arch/sh/boot/compressed/ashldi3.c b/arch/sh/boot/compressed/ashldi3.c
deleted file mode 100644
index 7cebd646df839b..00000000000000
--- a/arch/sh/boot/compressed/ashldi3.c
+++ /dev/null
@@ -1,2 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-#include "../../lib/ashldi3.c"
diff --git a/arch/sh/boot/compressed/ashlsi3.S b/arch/sh/boot/compressed/ashlsi3.S
deleted file mode 100644
index e354262b275f4d..00000000000000
--- a/arch/sh/boot/compressed/ashlsi3.S
+++ /dev/null
@@ -1,2 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#include "../../lib/ashlsi3.S"
diff --git a/arch/sh/boot/compressed/ashrsi3.S b/arch/sh/boot/compressed/ashrsi3.S
deleted file mode 100644
index e564be9a4dcd89..00000000000000
--- a/arch/sh/boot/compressed/ashrsi3.S
+++ /dev/null
@@ -1,2 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#include "../../lib/ashrsi3.S"
diff --git a/arch/sh/boot/compressed/cache.c b/arch/sh/boot/compressed/cache.c
deleted file mode 100644
index 31e04ff4841ed0..00000000000000
--- a/arch/sh/boot/compressed/cache.c
+++ /dev/null
@@ -1,13 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-int cache_control(unsigned int command)
-{
- volatile unsigned int *p = (volatile unsigned int *) 0x80000000;
- int i;
-
- for (i = 0; i < (32 * 1024); i += 32) {
- (void)*p;
- p += (32 / sizeof(int));
- }
-
- return 0;
-}
diff --git a/arch/sh/boot/compressed/head_32.S b/arch/sh/boot/compressed/head_32.S
deleted file mode 100644
index 7bb168133dbbf8..00000000000000
--- a/arch/sh/boot/compressed/head_32.S
+++ /dev/null
@@ -1,126 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * linux/arch/sh/boot/compressed/head.S
- *
- * Copyright (C) 1999 Stuart Menefy
- * Copyright (C) 2003 SUGIOKA Toshinobu
- */
-
-.text
-
-#include <asm/page.h>
-
- .global startup
-startup:
- /* Load initial status register */
- mov.l init_sr, r1
- ldc r1, sr
-
- /* Move myself to proper location if necessary */
- mova 1f, r0
- mov.l 1f, r2
- cmp/eq r2, r0
- bt clear_bss
- sub r0, r2
- mov.l bss_start_addr, r0
- mov #0xffffffe0, r1
- and r1, r0 ! align cache line
- mov.l text_start_addr, r3
- mov r0, r1
- sub r2, r1
-3:
- mov.l @r1, r4
- mov.l @(4,r1), r5
- mov.l @(8,r1), r6
- mov.l @(12,r1), r7
- mov.l @(16,r1), r8
- mov.l @(20,r1), r9
- mov.l @(24,r1), r10
- mov.l @(28,r1), r11
- mov.l r4, @r0
- mov.l r5, @(4,r0)
- mov.l r6, @(8,r0)
- mov.l r7, @(12,r0)
- mov.l r8, @(16,r0)
- mov.l r9, @(20,r0)
- mov.l r10, @(24,r0)
- mov.l r11, @(28,r0)
-#ifdef CONFIG_CPU_SH4
- ocbwb @r0
-#endif
- cmp/hi r3, r0
- add #-32, r0
- bt/s 3b
- add #-32, r1
- mov.l 2f, r0
- jmp @r0
- nop
-
- .align 2
-1: .long 1b
-2: .long clear_bss
-text_start_addr:
- .long startup
-
- /* Clear BSS */
-clear_bss:
- mov.l end_addr, r1
- mov.l bss_start_addr, r2
- mov #0, r0
-l1:
- mov.l r0, @-r1
- cmp/eq r1,r2
- bf l1
-
- /* Set the initial pointer. */
- mov.l init_stack_addr, r0
- mov.l @r0, r15
-
- /* Decompress the kernel */
- mov.l decompress_kernel_addr, r0
- jsr @r0
- nop
-
- /* Jump to the start of the decompressed kernel */
- mov.l kernel_start_addr, r0
- jmp @r0
- nop
-
- .align 2
-bss_start_addr:
- .long __bss_start
-end_addr:
- .long _end
-init_sr:
- .long 0x500000F0 /* Privileged mode, Bank=0, Block=1, IMASK=0xF */
-kexec_magic:
- .long 0x400000F0 /* magic used by kexec to parse zImage format */
-init_stack_addr:
- .long stack_start
-decompress_kernel_addr:
- .long decompress_kernel
-kernel_start_addr:
-#ifdef CONFIG_32BIT
- .long ___pa(_text+PAGE_SIZE)
-#else
- .long _text+PAGE_SIZE
-#endif
-
- .align 9
-fake_headers_as_bzImage:
- .word 0
- .ascii "HdrS" ! header signature
- .word 0x0202 ! header version number (>= 0x0105)
- ! or else old loadlin-1.5 will fail)
- .word 0 ! default_switch
- .word 0 ! SETUPSEG
- .word 0x1000
- .word 0 ! pointing to kernel version string
- .byte 0 ! = 0, old one (LILO, Loadlin,
- ! 0xTV: T=0 for LILO
- ! V = version
- .byte 1 ! Load flags bzImage=1
- .word 0x8000 ! size to move, when setup is not
- .long 0x100000 ! 0x100000 = default for big kernel
- .long 0 ! address of loaded ramdisk image
- .long 0 # its size in bytes
diff --git a/arch/sh/boot/compressed/head_64.S b/arch/sh/boot/compressed/head_64.S
deleted file mode 100644
index 9993113c671386..00000000000000
--- a/arch/sh/boot/compressed/head_64.S
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * arch/shmedia/boot/compressed/head.S
- *
- * Copied from
- * arch/shmedia/kernel/head.S
- * which carried the copyright:
- * Copyright (C) 2000, 2001 Paolo Alberelli
- *
- * Modification for compressed loader:
- * Copyright (C) 2002 Stuart Menefy ([email protected])
- */
-#include <asm/cache.h>
-#include <asm/tlb.h>
-#include <cpu/mmu_context.h>
-#include <cpu/registers.h>
-
-/*
- * Fixed TLB entries to identity map the beginning of RAM
- */
-#define MMUIR_TEXT_H 0x0000000000000003 | CONFIG_MEMORY_START
- /* Enabled, Shared, ASID 0, Eff. Add. 0xA0000000 */
-#define MMUIR_TEXT_L 0x000000000000009a | CONFIG_MEMORY_START
- /* 512 Mb, Cacheable (Write-back), execute, Not User, Ph. Add. */
-
-#define MMUDR_CACHED_H 0x0000000000000003 | CONFIG_MEMORY_START
- /* Enabled, Shared, ASID 0, Eff. Add. 0xA0000000 */
-#define MMUDR_CACHED_L 0x000000000000015a | CONFIG_MEMORY_START
- /* 512 Mb, Cacheable (Write-back), read/write, Not User, Ph. Add. */
-
-#define ICCR0_INIT_VAL ICCR0_ON | ICCR0_ICI /* ICE + ICI */
-#define ICCR1_INIT_VAL ICCR1_NOLOCK /* No locking */
-
-#define OCCR0_INIT_VAL OCCR0_ON | OCCR0_OCI | OCCR0_WB /* OCE + OCI + WB */
-#define OCCR1_INIT_VAL OCCR1_NOLOCK /* No locking */
-
- .text
-
- .global startup
-startup:
- /*
- * Prevent speculative fetch on device memory due to
- * uninitialized target registers.
- * This must be executed before the first branch.
- */
- ptabs/u r63, tr0
- ptabs/u r63, tr1
- ptabs/u r63, tr2
- ptabs/u r63, tr3
- ptabs/u r63, tr4
- ptabs/u r63, tr5
- ptabs/u r63, tr6
- ptabs/u r63, tr7
- synci
-
- /*
- * Set initial TLB entries for cached and uncached regions.
- * Note: PTA/BLINK is PIC code, PTABS/BLINK isn't !
- */
- /* Clear ITLBs */
- pta 1f, tr1
- movi ITLB_FIXED, r21
- movi ITLB_LAST_VAR_UNRESTRICTED+TLB_STEP, r22
-1: putcfg r21, 0, r63 /* Clear MMUIR[n].PTEH.V */
- addi r21, TLB_STEP, r21
- bne r21, r22, tr1
-
- /* Clear DTLBs */
- pta 1f, tr1
- movi DTLB_FIXED, r21
- movi DTLB_LAST_VAR_UNRESTRICTED+TLB_STEP, r22
-1: putcfg r21, 0, r63 /* Clear MMUDR[n].PTEH.V */
- addi r21, TLB_STEP, r21
- bne r21, r22, tr1
-
- /* Map one big (512Mb) page for ITLB */
- movi ITLB_FIXED, r21
- movi MMUIR_TEXT_L, r22 /* PTEL first */
- putcfg r21, 1, r22 /* Set MMUIR[0].PTEL */
- movi MMUIR_TEXT_H, r22 /* PTEH last */
- putcfg r21, 0, r22 /* Set MMUIR[0].PTEH */
-
- /* Map one big CACHED (512Mb) page for DTLB */
- movi DTLB_FIXED, r21
- movi MMUDR_CACHED_L, r22 /* PTEL first */
- putcfg r21, 1, r22 /* Set MMUDR[0].PTEL */
- movi MMUDR_CACHED_H, r22 /* PTEH last */
- putcfg r21, 0, r22 /* Set MMUDR[0].PTEH */
-
- /* ICache */
- movi ICCR_BASE, r21
- movi ICCR0_INIT_VAL, r22
- movi ICCR1_INIT_VAL, r23
- putcfg r21, ICCR_REG0, r22
- putcfg r21, ICCR_REG1, r23
- synci
-
- /* OCache */
- movi OCCR_BASE, r21
- movi OCCR0_INIT_VAL, r22
- movi OCCR1_INIT_VAL, r23
- putcfg r21, OCCR_REG0, r22
- putcfg r21, OCCR_REG1, r23
- synco
-
- /*
- * Enable the MMU.
- * From here-on code can be non-PIC.
- */
- movi SR_HARMLESS | SR_ENABLE_MMU, r22
- putcon r22, SSR
- movi 1f, r22
- putcon r22, SPC
- synco
- rte /* And now go into the hyperspace ... */
-1: /* ... that's the next instruction ! */
-
- /* Set initial stack pointer */
- movi datalabel stack_start, r0
- ld.l r0, 0, r15
-
- /*
- * Clear bss
- */
- pt 1f, tr1
- movi datalabel __bss_start, r22
- movi datalabel _end, r23
-1: st.l r22, 0, r63
- addi r22, 4, r22
- bne r22, r23, tr1
-
- /*
- * Decompress the kernel.
- */
- pt decompress_kernel, tr0
- blink tr0, r18
-
- /*
- * Disable the MMU.
- */
- movi SR_HARMLESS, r22
- putcon r22, SSR
- movi 1f, r22
- putcon r22, SPC
- synco
- rte /* And now go into the hyperspace ... */
-1: /* ... that's the next instruction ! */
-
- /* Jump into the decompressed kernel */
- movi datalabel (CONFIG_MEMORY_START + 0x2000)+1, r19
- ptabs r19, tr0
- blink tr0, r18
-
- /* Shouldn't return here, but just in case, loop forever */
- pt 1f, tr0
-1: blink tr0, r63
diff --git a/arch/sh/boot/compressed/lshrsi3.S b/arch/sh/boot/compressed/lshrsi3.S
deleted file mode 100644
index 5a8281b7e5161b..00000000000000
--- a/arch/sh/boot/compressed/lshrsi3.S
+++ /dev/null
@@ -1,2 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#include "../../lib/lshrsi3.S"
diff --git a/arch/sh/boot/compressed/misc.c b/arch/sh/boot/compressed/misc.c
deleted file mode 100644
index ca05c99a3d5b48..00000000000000
--- a/arch/sh/boot/compressed/misc.c
+++ /dev/null
@@ -1,146 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * arch/sh/boot/compressed/misc.c
- *
- * This is a collection of several routines from gzip-1.0.3
-